diff --git a/main.asm b/main.asm new file mode 100644 index 000000000..91f75383e --- /dev/null +++ b/main.asm @@ -0,0 +1,994263 @@ + .macro arm_func_start name + .align 2, 0 + .global \name + .arm + .type \name, %function + .endm + + .macro arm_func_end name + .size \name, .-\name + .endm + + .macro thumb_func_start name + .align 2, 0 + .global \name + .thumb + .thumb_func + .type \name, %function + .endm + + .macro non_word_aligned_thumb_func_start name + .global \name + .thumb + .thumb_func + .type \name, %function + .endm + + .macro thumb_func_end name + .size \name, .-\name + .endm + + .syntax unified + + .global RomBase + + .text + + .arm + +RomBase: + b start_loop + +CartridgeHeaderNintendoLogo: + .incbin "base_emerald.gba", 0x4, 0xA0 - 0x4 + +CartridgeHeaderGameTitle: + .ascii "POKEMON EMER" + +CartridgeHeaderGameCode: + .ascii "BPEE" + +CartridgeHeaderMakerCode: + .ascii "01" + +CartridgeHeaderMagic: + .byte 0x96 + +CartridgeHeaderMainUnitCode: + .byte 0 + +CartridgeHeaderDeviceType: + .byte 0 + +CartridgeHeaderReserved1: + .rept 7 + .byte 0 + .endr + +CartridgeHeaderSoftwareVersion: + .byte 0 + +CartridgeHeaderChecksum: + .byte 0x72 + +CartridgeHeaderReserved2: + .rept 2 + .byte 0 + .endr + +_080000C0: + .long 0 + +_080000C4: + .short 0 + +_080000C6: + .short 0 + +_080000C8: + .long 0 + + .incbin "base_emerald.gba", 0xCC, 0x204 - 0xCC + + arm_func_start start_loop +start_loop: @ 8000204 + mov r0, 0x12 + msr cpsr_cf, r0 + ldr sp, _0800023C + mov r0, 0x1F + msr cpsr_cf, r0 + ldr sp, _08000238 + ldr r1, _08000240 + add r0, pc, 0x20 + str r0, [r1] + ldr r1, _08000244 + mov lr, pc + bx r1 + b start_loop + .align 2, 0 +_08000238: .4byte 0x03007e40 +_0800023C: .4byte 0x03007fa0 +_08000240: .4byte 0x03007ffc +_08000244: .4byte main_loop + 1 + arm_func_end start_loop + + arm_func_start irq_handler +irq_handler: @ 8000248 + mov r3, 0x4000000 + add r3, r3, 0x200 + ldr r2, [r3] + ldrh r1, [r3, 0x8] + mrs r0, spsr + stmdb sp!, {r0-r3,lr} + mov r0, 0 + strh r0, [r3, 0x8] + and r1, r2, r2, lsr 16 + mov r12, 0 + ands r0, r1, 0x4 + bne _08000320 + add r12, r12, 0x4 + mov r0, 0x1 + strh r0, [r3, 0x8] + ands r0, r1, 0x80 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x40 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x2 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x1 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x8 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x10 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x20 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x100 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x200 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x400 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x800 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x1000 + bne _08000320 + add r12, r12, 0x4 + ands r0, r1, 0x2000 + strbne r0, [r3, -0x17C] +_0800031C: + bne _0800031C +_08000320: + strh r0, [r3, 0x2] + bic r2, r2, r0 + ldr r0, _0800039C + ldr r0, [r0] + ldrb r0, [r0, 0xA] + mov r1, 0x8 + mov r0, r1, lsl r0 + orr r0, r0, 0x2000 + orr r1, r0, 0xC6 + and r1, r1, r2 + strh r1, [r3] + mrs r3, cpsr + bic r3, r3, 0xDF + orr r3, r3, 0x1F + msr cpsr_cf, r3 + ldr r1, _080003A0 + add r1, r1, r12 + ldr r0, [r1] + stmdb sp!, {lr} + add lr, pc, 0 + bx r0 + ldmia sp!, {lr} + mrs r3, cpsr + bic r3, r3, 0xDF + orr r3, r3, 0x92 + msr cpsr_cf, r3 + ldmia sp!, {r0-r3,lr} + strh r2, [r3] + strh r1, [r3, 0x8] + msr spsr_cf, r0 + bx lr + .align 2, 0 +_0800039C: .4byte 0x03007868 +_080003A0: .4byte 0x03002710 + arm_func_end irq_handler + + .thumb + thumb_func_start main_loop +main_loop: @ 80003A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0xFF + bl RegisterRamReset + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _08000468 + adds r0, r2, 0 + strh r0, [r1] + bl lcd_io_copy_queue_clean + ldr r1, _0800046C + ldr r3, _08000470 + adds r0, r3, 0 + strh r0, [r1] + bl init_keypad_data + bl init_irq_handler + bl m4aSoundInit + bl lcd_enable_vcount_irq_at_150px + bl sub_800E6D0 + bl sub_802F21C + bl flash_timeout_start_on_timer_2_when_flash_present + bl init_saveblock_ptrs_and_set_copyright_callback2 + bl sound_sources_off + bl dma3_transfer_queue_clear + bl gpu_init_bgs + bl fboxes_set_default_ptr + ldr r0, _08000474 + movs r1, 0xE0 + lsls r1, 9 + bl init_malloc + ldr r0, _08000478 + movs r4, 0 + strb r4, [r0] + ldr r0, _0800047C + ldr r0, [r0] + cmp r0, 0x1 + beq _08000414 + movs r0, 0 + bl set_callback2 +_08000414: + ldr r2, _08000480 + strb r4, [r2] + ldr r1, _08000484 + movs r3, 0xFC + lsls r3, 4 + adds r0, r3, 0 + strh r0, [r1] + ldr r7, _08000488 + movs r0, 0 + mov r8, r0 + adds r6, r2, 0 +_0800042A: + bl load_keys + ldr r0, _08000478 + ldrb r0, [r0] + cmp r0, 0 + bne _08000454 + ldrh r1, [r7, 0x28] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08000454 + movs r0, 0xE + ands r0, r1 + cmp r0, 0xE + bne _08000454 + bl rfu_REQ_stopMode + bl rfu_waitREQComplete + bl do_reset +_08000454: + bl sub_8087634 + cmp r0, 0x1 + bne _0800048C + strb r0, [r6] + bl call_callbacks_wrapper + movs r0, 0 + strb r0, [r6] + b _080004B2 + .align 2, 0 +_08000468: .4byte 0x00007fff +_0800046C: .4byte 0x04000204 +_08000470: .4byte 0x00004014 +_08000474: .4byte 0x02000000 +_08000478: .4byte 0x03002700 +_0800047C: .4byte 0x03005d88 +_08000480: .4byte 0x030022b4 +_08000484: .4byte 0x03000000 +_08000488: .4byte 0x030022c0 +_0800048C: + ldr r5, _080004C0 + movs r0, 0 + strb r0, [r5] + bl call_callbacks_wrapper + bl sub_80875C8 + adds r4, r0, 0 + cmp r4, 0x1 + bne _080004B2 + movs r0, 0 + strh r0, [r7, 0x2E] + bl copy_queue_clear + strb r4, [r5] + bl call_callbacks_wrapper + mov r2, r8 + strb r2, [r5] +_080004B2: + bl gametime_increment + bl sound_something + bl wait_for_vblank + b _0800042A + .align 2, 0 +_080004C0: .4byte 0x030022b4 + thumb_func_end main_loop + + thumb_func_start call_callbacks_wrapper +call_callbacks_wrapper: @ 80004C4 + push {lr} + bl sub_800B40C + lsls r0, 24 + cmp r0, 0 + bne _080004D4 + bl call_callbacks +_080004D4: + pop {r0} + bx r0 + thumb_func_end call_callbacks_wrapper + + thumb_func_start init_saveblock_ptrs_and_set_copyright_callback2 +init_saveblock_ptrs_and_set_copyright_callback2: @ 80004D8 + push {lr} + ldr r2, _08000500 + movs r0, 0 + str r0, [r2, 0x20] + ldr r1, _08000504 + str r0, [r1] + str r0, [r2, 0x24] + str r0, [r2] + ldr r0, _08000508 + bl set_callback2 + ldr r1, _0800050C + ldr r0, _08000510 + str r0, [r1] + ldr r1, _08000514 + ldr r0, _08000518 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08000500: .4byte 0x030022c0 +_08000504: .4byte 0x0203cf5c +_08000508: .4byte c2_copyright_1 + 1 +_0800050C: .4byte 0x03005d90 +_08000510: .4byte 0x02024a54 +_08000514: .4byte 0x03005d94 +_08000518: .4byte 0x02029808 + thumb_func_end init_saveblock_ptrs_and_set_copyright_callback2 + + thumb_func_start call_callbacks +call_callbacks: @ 800051C + push {r4,lr} + ldr r4, _0800053C + ldr r0, [r4] + cmp r0, 0 + beq _0800052A + bl _call_via_r0 +_0800052A: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _08000534 + bl _call_via_r0 +_08000534: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800053C: .4byte 0x030022c0 + thumb_func_end call_callbacks + + thumb_func_start set_callback2 +set_callback2: @ 8000540 + ldr r1, _08000550 + str r0, [r1, 0x4] + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08000550: .4byte 0x030022c0 + thumb_func_end set_callback2 + + thumb_func_start start_timer1 +start_timer1: @ 8000554 + ldr r1, _0800055C + movs r0, 0x80 + strh r0, [r1] + bx lr + .align 2, 0 +_0800055C: .4byte 0x04000106 + thumb_func_end start_timer1 + + thumb_func_start set_rand_seed_and_trainer_id_hi +set_rand_seed_and_trainer_id_hi: @ 8000560 + push {r4,lr} + ldr r0, _0800057C + ldrh r4, [r0] + adds r0, r4, 0 + bl SeedRng + ldr r1, _08000580 + movs r0, 0 + strh r0, [r1] + ldr r0, _08000584 + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800057C: .4byte 0x04000104 +_08000580: .4byte 0x04000106 +_08000584: .4byte 0x02020000 + thumb_func_end set_rand_seed_and_trainer_id_hi + + thumb_func_start get_trainer_id_hi +get_trainer_id_hi: @ 8000588 + ldr r0, _08000590 + ldrh r0, [r0] + bx lr + .align 2, 0 +_08000590: .4byte 0x02020000 + thumb_func_end get_trainer_id_hi + + thumb_func_start lcd_enable_vcount_irq_at_150px +lcd_enable_vcount_irq_at_150px: @ 8000594 + push {lr} + movs r0, 0x4 + bl lcd_io_get + movs r1, 0xFF + ands r1, r0 + movs r2, 0x96 + lsls r2, 8 + adds r0, r2, 0 + orrs r1, r0 + movs r0, 0x20 + orrs r1, r0 + movs r0, 0x4 + bl lcd_io_set + movs r0, 0x4 + bl enable_irqs + pop {r0} + bx r0 + thumb_func_end lcd_enable_vcount_irq_at_150px + + thumb_func_start init_keypad_data +init_keypad_data: @ 80005BC + ldr r1, _080005D8 + movs r0, 0x5 + strh r0, [r1] + ldr r1, _080005DC + movs r0, 0x28 + strh r0, [r1] + ldr r1, _080005E0 + movs r0, 0 + strh r0, [r1, 0x2C] + strh r0, [r1, 0x2E] + strh r0, [r1, 0x30] + strh r0, [r1, 0x28] + strh r0, [r1, 0x2A] + bx lr + .align 2, 0 +_080005D8: .4byte 0x030026fc +_080005DC: .4byte 0x030022b0 +_080005E0: .4byte 0x030022c0 + thumb_func_end init_keypad_data + + thumb_func_start load_keys +load_keys: @ 80005E4 + push {lr} + ldr r0, _08000620 + ldrh r1, [r0] + ldr r2, _08000624 + adds r0, r2, 0 + adds r3, r0, 0 + eors r3, r1 + ldr r1, _08000628 + ldrh r2, [r1, 0x28] + adds r0, r3, 0 + bics r0, r2 + strh r0, [r1, 0x2A] + strh r0, [r1, 0x2E] + strh r0, [r1, 0x30] + adds r2, r1, 0 + cmp r3, 0 + beq _08000630 + ldrh r0, [r2, 0x2C] + cmp r0, r3 + bne _08000630 + ldrh r0, [r2, 0x32] + subs r0, 0x1 + strh r0, [r2, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _08000636 + strh r3, [r2, 0x30] + ldr r0, _0800062C + b _08000632 + .align 2, 0 +_08000620: .4byte 0x04000130 +_08000624: .4byte 0x000003ff +_08000628: .4byte 0x030022c0 +_0800062C: .4byte 0x030026fc +_08000630: + ldr r0, _0800067C +_08000632: + ldrh r0, [r0] + strh r0, [r2, 0x32] +_08000636: + strh r3, [r2, 0x28] + strh r3, [r2, 0x2C] + ldr r0, _08000680 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _08000668 + ldrh r1, [r2, 0x2E] + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08000658 + movs r0, 0x1 + orrs r0, r1 + strh r0, [r2, 0x2E] +_08000658: + ldrh r1, [r2, 0x2C] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08000668 + movs r0, 0x1 + orrs r0, r1 + strh r0, [r2, 0x2C] +_08000668: + ldrh r1, [r2, 0x2E] + ldrh r0, [r2, 0x36] + ands r0, r1 + cmp r0, 0 + beq _08000676 + movs r0, 0x1 + strh r0, [r2, 0x34] +_08000676: + pop {r0} + bx r0 + .align 2, 0 +_0800067C: .4byte 0x030022b0 +_08000680: .4byte 0x03005d90 + thumb_func_end load_keys + + thumb_func_start init_irq_handler +init_irq_handler: @ 8000684 + push {r4,r5,lr} + ldr r5, _080006D0 + ldr r4, _080006D4 + ldr r3, _080006D8 + ldr r2, _080006DC + movs r1, 0xD +_08000690: + ldm r3!, {r0} + stm r2!, {r0} + subs r1, 0x1 + cmp r1, 0 + bge _08000690 + ldr r0, _080006E0 + str r5, [r0] + str r4, [r0, 0x4] + ldr r1, _080006E4 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r0, _080006E8 + str r4, [r0] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl set_serial_callback + ldr r1, _080006EC + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + bl enable_irqs + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080006D0: .4byte irq_handler +_080006D4: .4byte 0x03002750 +_080006D8: .4byte 0x082e9548 +_080006DC: .4byte 0x03002710 +_080006E0: .4byte 0x040000d4 +_080006E4: .4byte 0x84000200 +_080006E8: .4byte 0x03007ffc +_080006EC: .4byte 0x04000208 + thumb_func_end init_irq_handler + + thumb_func_start SetVBlankCallback +SetVBlankCallback: @ 80006F0 + ldr r1, _080006F8 + str r0, [r1, 0xC] + bx lr + .align 2, 0 +_080006F8: .4byte 0x030022c0 + thumb_func_end SetVBlankCallback + + thumb_func_start SetHBlankCallback +SetHBlankCallback: @ 80006FC + ldr r1, _08000704 + str r0, [r1, 0x10] + bx lr + .align 2, 0 +_08000704: .4byte 0x030022c0 + thumb_func_end SetHBlankCallback + + thumb_func_start SetVCountCallback +SetVCountCallback: @ 8000708 + ldr r1, _08000710 + str r0, [r1, 0x14] + bx lr + .align 2, 0 +_08000710: .4byte 0x030022c0 + thumb_func_end SetVCountCallback + + thumb_func_start restore_serial_timer3_irq_handlers +restore_serial_timer3_irq_handlers: @ 8000714 + ldr r0, _08000720 + ldr r1, _08000724 + str r1, [r0, 0x4] + ldr r1, _08000728 + str r1, [r0, 0x8] + bx lr + .align 2, 0 +_08000720: .4byte 0x03002710 +_08000724: .4byte irq_serial + 1 +_08000728: .4byte irq_timer3 + 1 + thumb_func_end restore_serial_timer3_irq_handlers + + thumb_func_start set_serial_callback +set_serial_callback: @ 800072C + ldr r1, _08000734 + str r0, [r1, 0x18] + bx lr + .align 2, 0 +_08000734: .4byte 0x030022c0 + thumb_func_end set_serial_callback + + thumb_func_start irq_vblank +irq_vblank: @ 8000738 + push {r4,lr} + ldr r0, _08000748 + ldrb r0, [r0] + cmp r0, 0 + beq _0800074C + bl rfu_syncVBlank__ + b _08000758 + .align 2, 0 +_08000748: .4byte 0x030030fc +_0800074C: + ldr r0, _080007DC + ldrb r0, [r0] + cmp r0, 0 + bne _08000758 + bl sub_800B9B8 +_08000758: + ldr r0, _080007E0 + ldr r1, [r0, 0x20] + adds r1, 0x1 + str r1, [r0, 0x20] + ldr r1, _080007E4 + ldr r1, [r1] + adds r4, r0, 0 + cmp r1, 0 + beq _08000778 + ldr r2, [r1] + movs r0, 0x2 + negs r0, r0 + cmp r2, r0 + bhi _08000778 + adds r0, r2, 0x1 + str r0, [r1] +_08000778: + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _08000782 + bl _call_via_r0 +_08000782: + ldr r0, [r4, 0x24] + adds r0, 0x1 + str r0, [r4, 0x24] + bl lcd_io_copy_queue_process + bl dma_transfer_queue_process + ldr r1, _080007E8 + ldr r0, _080007EC + ldrb r0, [r0, 0x4] + strb r0, [r1] + bl m4aSoundMain + bl sub_8033648 + ldr r1, _080007F0 + adds r0, r4, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080007BA + ldr r0, _080007F4 + ldr r0, [r0] + ldr r1, _080007F8 + ands r0, r1 + cmp r0, 0 + bne _080007BE +_080007BA: + bl GenerateRandomNumber +_080007BE: + bl sub_800E174 + ldr r2, _080007FC + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + ldr r0, _080007E0 + ldrh r2, [r0, 0x1C] + ldrh r3, [r0, 0x1C] + orrs r1, r2 + strh r1, [r0, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080007DC: .4byte 0x03002748 +_080007E0: .4byte 0x030022c0 +_080007E4: .4byte 0x0203cf5c +_080007E8: .4byte 0x03002f50 +_080007EC: .4byte 0x03006380 +_080007F0: .4byte 0x00000439 +_080007F4: .4byte 0x02022fec +_080007F8: .4byte 0x013f0102 +_080007FC: .4byte 0x03007ff8 + thumb_func_end irq_vblank + + thumb_func_start flash_timeout_start_on_timer_2 +flash_timeout_start_on_timer_2: @ 8000800 + push {lr} + ldr r1, _08000810 + movs r0, 0x2 + bl SetFlashTimerIntr + pop {r0} + bx r0 + .align 2, 0 +_08000810: .4byte 0x0300272c + thumb_func_end flash_timeout_start_on_timer_2 + + thumb_func_start irq_hblank +irq_hblank: @ 8000814 + push {r4,lr} + ldr r4, _0800083C + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _08000822 + bl _call_via_r0 +_08000822: + ldr r2, _08000840 + ldrh r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x1C] + ldrh r2, [r4, 0x1C] + orrs r1, r0 + strh r1, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800083C: .4byte 0x030022c0 +_08000840: .4byte 0x03007ff8 + thumb_func_end irq_hblank + + thumb_func_start irq_vcount +irq_vcount: @ 8000844 + push {r4,lr} + ldr r4, _08000870 + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _08000852 + bl _call_via_r0 +_08000852: + bl SoundVSync_rev01 + ldr r2, _08000874 + ldrh r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x1C] + ldrh r2, [r4, 0x1C] + orrs r1, r0 + strh r1, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08000870: .4byte 0x030022c0 +_08000874: .4byte 0x03007ff8 + thumb_func_end irq_vcount + + thumb_func_start irq_serial +irq_serial: @ 8000878 + push {r4,lr} + ldr r4, _080008A0 + ldr r0, [r4, 0x18] + cmp r0, 0 + beq _08000886 + bl _call_via_r0 +_08000886: + ldr r2, _080008A4 + ldrh r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x1C] + ldrh r2, [r4, 0x1C] + orrs r1, r0 + strh r1, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080008A0: .4byte 0x030022c0 +_080008A4: .4byte 0x03007ff8 + thumb_func_end irq_serial + + thumb_func_start irq_other +irq_other: @ 80008A8 + bx lr + thumb_func_end irq_other + + thumb_func_start wait_for_vblank +wait_for_vblank: @ 80008AC + push {lr} + ldr r2, _080008D4 + ldrh r1, [r2, 0x1C] + ldr r0, _080008D8 + ands r0, r1 + ldrh r1, [r2, 0x1C] + strh r0, [r2, 0x1C] + ldrh r1, [r2, 0x1C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080008D0 + movs r3, 0x1 +_080008C6: + ldrh r1, [r2, 0x1C] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080008C6 +_080008D0: + pop {r0} + bx r0 + .align 2, 0 +_080008D4: .4byte 0x030022c0 +_080008D8: .4byte 0x0000fffe + thumb_func_end wait_for_vblank + + thumb_func_start sub_80008DC +sub_80008DC: @ 80008DC + ldr r1, _080008E4 + str r0, [r1] + bx lr + .align 2, 0 +_080008E4: .4byte 0x0203cf5c + thumb_func_end sub_80008DC + + thumb_func_start sub_80008E8 +sub_80008E8: @ 80008E8 + ldr r1, _080008F0 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080008F0: .4byte 0x0203cf5c + thumb_func_end sub_80008E8 + + thumb_func_start do_reset +do_reset: @ 80008F4 + push {r4,lr} + ldr r1, _08000950 + movs r0, 0 + strh r0, [r1] + bl SoundVSyncOff_rev01 + bl remove_some_task + ldr r1, _08000954 + ldrh r2, [r1, 0xA] + ldr r3, _08000958 + adds r0, r3, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r4, [r1, 0xA] + ldr r2, _0800095C + adds r0, r2, 0 + ands r0, r4 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + adds r1, 0xC + ldrh r4, [r1, 0xA] + adds r0, r3, 0 + ands r0, r4 + strh r0, [r1, 0xA] + ldrh r4, [r1, 0xA] + adds r0, r2, 0 + ands r0, r4 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r0, _08000960 + ldrh r1, [r0, 0xA] + ands r3, r1 + strh r3, [r0, 0xA] + ldrh r1, [r0, 0xA] + ands r2, r1 + strh r2, [r0, 0xA] + ldrh r0, [r0, 0xA] + bl sub_82E2168 + movs r0, 0xFF + bl SoftReset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08000950: .4byte 0x04000208 +_08000954: .4byte 0x040000bc +_08000958: .4byte 0x0000c5ff +_0800095C: .4byte 0x00007fff +_08000960: .4byte 0x040000d4 + thumb_func_end do_reset + + thumb_func_start sub_8000964 +sub_8000964: @ 8000964 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _08000980 + ldr r2, _08000984 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08000980: .4byte 0x03007330 +_08000984: .4byte 0x01000034 + thumb_func_end sub_8000964 + + thumb_func_start malloc_header +malloc_header: @ 8000988 + push {r4,lr} + movs r4, 0 + strh r4, [r0] + ldr r4, _080009A0 + strh r4, [r0, 0x2] + str r3, [r0, 0x4] + str r1, [r0, 0x8] + str r2, [r0, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080009A0: .4byte 0x0000a3a3 + thumb_func_end malloc_header + + thumb_func_start malloc_unlinked_header +malloc_unlinked_header: @ 80009A4 + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + subs r3, 0x10 + adds r1, r2, 0 + bl malloc_header + pop {r0} + bx r0 + thumb_func_end malloc_unlinked_header + + thumb_func_start malloc_core +malloc_core: @ 80009B8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r4, 0 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080009CC + lsrs r0, r1, 2 + adds r0, 0x1 + lsls r1, r0, 2 +_080009CC: + movs r2, 0x1 +_080009CE: + ldrh r0, [r4] + cmp r0, 0 + bne _08000A0C + ldr r3, [r4, 0x4] + cmp r3, r1 + bcc _08000A0C + subs r0, r3, r1 + cmp r0, 0x1F + bhi _080009E4 + strh r2, [r4] + b _08000A06 +_080009E4: + subs r3, 0x10 + subs r3, r1 + adds r0, r1, 0 + adds r0, 0x10 + adds r5, r4, r0 + strh r2, [r4] + str r1, [r4, 0x4] + ldr r2, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl malloc_header + str r5, [r4, 0xC] + ldr r0, [r5, 0xC] + cmp r0, r6 + beq _08000A06 + str r5, [r0, 0x8] +_08000A06: + adds r0, r4, 0 + adds r0, 0x10 + b _08000A18 +_08000A0C: + ldr r0, [r4, 0xC] + cmp r0, r6 + beq _08000A16 + adds r4, r0, 0 + b _080009CE +_08000A16: + movs r0, 0 +_08000A18: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end malloc_core + + thumb_func_start free_core +free_core: @ 8000A20 + push {r4,r5,lr} + cmp r1, 0 + beq _08000A7C + adds r5, r0, 0 + adds r2, r1, 0 + subs r2, 0x10 + movs r0, 0 + strh r0, [r2] + ldr r3, [r2, 0xC] + cmp r3, r5 + beq _08000A54 + ldrh r4, [r3] + cmp r4, 0 + bne _08000A54 + ldr r0, [r2, 0x4] + adds r0, 0x10 + ldr r1, [r3, 0x4] + adds r0, r1 + str r0, [r2, 0x4] + strh r4, [r3, 0x2] + ldr r0, [r2, 0xC] + ldr r0, [r0, 0xC] + str r0, [r2, 0xC] + cmp r0, r5 + beq _08000A54 + str r2, [r0, 0x8] +_08000A54: + cmp r2, r5 + beq _08000A7C + ldr r1, [r2, 0x8] + ldrh r3, [r1] + cmp r3, 0 + bne _08000A7C + ldr r0, [r2, 0xC] + str r0, [r1, 0xC] + ldr r1, [r2, 0xC] + cmp r1, r5 + beq _08000A6E + ldr r0, [r2, 0x8] + str r0, [r1, 0x8] +_08000A6E: + strh r3, [r2, 0x2] + ldr r0, [r2, 0x8] + ldr r1, [r0, 0x4] + adds r1, 0x10 + ldr r2, [r2, 0x4] + adds r1, r2 + str r1, [r0, 0x4] +_08000A7C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end free_core + + thumb_func_start malloc_core_and_clear +malloc_core_and_clear: @ 8000A84 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + bl malloc_core + adds r5, r0, 0 + cmp r5, 0 + beq _08000AB8 + movs r0, 0x3 + ands r0, r4 + cmp r0, 0 + beq _08000AA2 + lsrs r0, r4, 2 + adds r0, 0x1 + lsls r4, r0, 2 +_08000AA2: + movs r0, 0 + str r0, [sp] + lsls r2, r4, 9 + lsrs r2, 11 + movs r0, 0xA0 + lsls r0, 19 + orrs r2, r0 + mov r0, sp + adds r1, r5, 0 + bl CpuSet +_08000AB8: + adds r0, r5, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end malloc_core_and_clear + + thumb_func_start check_memblk_core +check_memblk_core: @ 8000AC4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r3, r1, 0 + subs r3, 0x10 + ldrh r2, [r3, 0x2] + ldr r0, _08000B10 + cmp r2, r0 + bne _08000B0A + ldr r0, [r3, 0xC] + ldrh r1, [r0, 0x2] + adds r4, r0, 0 + cmp r1, r2 + bne _08000B0A + cmp r4, r5 + beq _08000AE8 + ldr r0, [r4, 0x8] + cmp r0, r3 + bne _08000B0A +_08000AE8: + ldr r2, [r3, 0x8] + ldrh r1, [r2, 0x2] + ldr r0, _08000B10 + cmp r1, r0 + bne _08000B0A + cmp r2, r5 + beq _08000AFC + ldr r0, [r2, 0xC] + cmp r0, r3 + bne _08000B0A +_08000AFC: + cmp r4, r5 + beq _08000B14 + ldr r0, [r3, 0x4] + adds r0, 0x10 + adds r0, r3, r0 + cmp r4, r0 + beq _08000B14 +_08000B0A: + movs r0, 0 + b _08000B16 + .align 2, 0 +_08000B10: .4byte 0x0000a3a3 +_08000B14: + movs r0, 0x1 +_08000B16: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end check_memblk_core + + thumb_func_start init_malloc +init_malloc: @ 8000B1C + push {lr} + ldr r2, _08000B30 + str r0, [r2] + ldr r2, _08000B34 + str r1, [r2] + bl malloc_unlinked_header + pop {r0} + bx r0 + .align 2, 0 +_08000B30: .4byte 0x03000004 +_08000B34: .4byte 0x03000008 + thumb_func_end init_malloc + + thumb_func_start malloc +malloc: @ 8000B38 + push {lr} + adds r1, r0, 0 + ldr r0, _08000B48 + ldr r0, [r0] + bl malloc_core + pop {r1} + bx r1 + .align 2, 0 +_08000B48: .4byte 0x03000004 + thumb_func_end malloc + + thumb_func_start malloc_and_clear +malloc_and_clear: @ 8000B4C + push {lr} + adds r1, r0, 0 + ldr r0, _08000B5C + ldr r0, [r0] + bl malloc_core_and_clear + pop {r1} + bx r1 + .align 2, 0 +_08000B5C: .4byte 0x03000004 + thumb_func_end malloc_and_clear + + thumb_func_start free +free: @ 8000B60 + push {lr} + adds r1, r0, 0 + ldr r0, _08000B70 + ldr r0, [r0] + bl free_core + pop {r0} + bx r0 + .align 2, 0 +_08000B70: .4byte 0x03000004 + thumb_func_end free + + thumb_func_start check_memblk +check_memblk: @ 8000B74 + push {lr} + adds r1, r0, 0 + ldr r0, _08000B84 + ldr r0, [r0] + bl check_memblk_core + pop {r1} + bx r1 + .align 2, 0 +_08000B84: .4byte 0x03000004 + thumb_func_end check_memblk + + thumb_func_start check_all_memblks +check_all_memblks: @ 8000B88 + push {r4,r5,lr} + ldr r0, _08000BAC + ldr r4, [r0] + adds r5, r0, 0 +_08000B90: + ldr r0, [r5] + adds r1, r4, 0 + adds r1, 0x10 + bl check_memblk_core + cmp r0, 0 + beq _08000BB0 + ldr r4, [r4, 0xC] + ldr r0, [r5] + cmp r4, r0 + bne _08000B90 + movs r0, 0x1 + b _08000BB2 + .align 2, 0 +_08000BAC: .4byte 0x03000004 +_08000BB0: + movs r0, 0 +_08000BB2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end check_all_memblks + + thumb_func_start dma3_transfer_queue_clear +dma3_transfer_queue_clear: @ 8000BB8 + push {lr} + ldr r2, _08000BE4 + movs r0, 0x1 + strb r0, [r2] + ldr r1, _08000BE8 + movs r0, 0 + strb r0, [r1] + movs r3, 0 + ldr r0, _08000BEC + movs r1, 0x7F +_08000BCC: + strh r3, [r0, 0x8] + str r3, [r0] + str r3, [r0, 0x4] + adds r0, 0x10 + subs r1, 0x1 + cmp r1, 0 + bge _08000BCC + movs r0, 0 + strb r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_08000BE4: .4byte 0x03000810 +_08000BE8: .4byte 0x03000811 +_08000BEC: .4byte 0x03000010 + thumb_func_end dma3_transfer_queue_clear + + thumb_func_start dma_transfer_queue_process +dma_transfer_queue_process: @ 8000BF0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, _08000C6C + ldrb r0, [r0] + cmp r0, 0 + beq _08000C06 + b _08000E46 +_08000C06: + movs r0, 0 + str r0, [sp, 0x8] + ldr r1, _08000C70 + ldr r2, _08000C74 + ldrb r0, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0, 0x8] + mov r12, r2 + cmp r0, 0 + bne _08000C1E + b _08000E46 +_08000C1E: + mov r8, r1 + adds r1, 0x4 + mov r10, r1 + movs r6, 0x80 + lsls r6, 5 + ldr r7, _08000C78 + movs r2, 0 + mov r9, r2 +_08000C2E: + mov r3, r12 + ldrb r0, [r3] + lsls r5, r0, 4 + mov r0, r8 + adds r1, r5, r0 + ldrh r0, [r1, 0x8] + ldr r2, [sp, 0x8] + adds r0, r2, r0 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + movs r0, 0xA0 + lsls r0, 8 + ldr r3, [sp, 0x8] + cmp r3, r0 + bls _08000C50 + b _08000E46 +_08000C50: + ldr r0, _08000C7C + ldrb r0, [r0] + cmp r0, 0xE0 + bls _08000C5A + b _08000E46 +_08000C5A: + ldrh r0, [r1, 0xA] + cmp r0, 0x2 + beq _08000CD0 + cmp r0, 0x2 + bgt _08000C80 + cmp r0, 0x1 + beq _08000C8C + b _08000DF0 + .align 2, 0 +_08000C6C: .4byte 0x03000810 +_08000C70: .4byte 0x03000010 +_08000C74: .4byte 0x03000811 +_08000C78: .4byte 0x040000d4 +_08000C7C: .4byte 0x04000006 +_08000C80: + cmp r0, 0x3 + beq _08000D3C + cmp r0, 0x4 + bne _08000C8A + b _08000D88 +_08000C8A: + b _08000DF0 +_08000C8C: + ldr r3, [r1] + mov r2, r10 + adds r0, r5, r2 + ldr r2, [r0] + ldrh r1, [r1, 0x8] + cmp r1, r6 + bhi _08000CA6 + str r3, [r7] + str r2, [r7, 0x4] + lsrs r0, r1, 2 + movs r1, 0x84 + lsls r1, 24 + b _08000DAA +_08000CA6: + ldr r4, _08000CC8 + str r3, [r4] + str r2, [r4, 0x4] + ldr r0, _08000CCC + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + adds r3, r6 + adds r2, r6 + subs r1, r6 + cmp r1, r6 + bhi _08000CA6 + str r3, [r4] + str r2, [r4, 0x4] + lsrs r0, r1, 2 + movs r1, 0x84 + lsls r1, 24 + b _08000D76 + .align 2, 0 +_08000CC8: .4byte 0x040000d4 +_08000CCC: .4byte 0x84000400 +_08000CD0: + mov r3, r10 + adds r0, r5, r3 + ldr r4, [r0] + ldrh r1, [r1, 0x8] + cmp r1, r6 + bhi _08000CF4 + mov r0, r8 + adds r0, 0xC + adds r0, r5, r0 + ldr r0, [r0] + str r0, [sp] + mov r5, sp + str r5, [r7] + str r4, [r7, 0x4] + lsrs r0, r1, 2 + movs r1, 0x85 + lsls r1, 24 + b _08000DAA +_08000CF4: + mov r2, r12 + ldrb r0, [r2] + lsls r0, 4 + mov r5, r8 + adds r5, 0xC + adds r0, r5 + ldr r0, [r0] + str r0, [sp] + ldr r3, _08000D34 + mov r0, sp + str r0, [r3] + str r4, [r3, 0x4] + ldr r0, _08000D38 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + adds r4, r6 + subs r1, r6 + cmp r1, r6 + bhi _08000CF4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, r5 + ldr r0, [r0] + str r0, [sp] + mov r2, sp + str r2, [r3] + str r4, [r3, 0x4] + lsrs r0, r1, 2 + movs r1, 0x85 + lsls r1, 24 + b _08000DEA + .align 2, 0 +_08000D34: .4byte 0x040000d4 +_08000D38: .4byte 0x85000400 +_08000D3C: + ldr r3, [r1] + mov r2, r10 + adds r0, r5, r2 + ldr r2, [r0] + ldrh r1, [r1, 0x8] + cmp r1, r6 + bhi _08000D56 + str r3, [r7] + str r2, [r7, 0x4] + lsrs r0, r1, 1 + movs r1, 0x80 + lsls r1, 24 + b _08000DAA +_08000D56: + ldr r4, _08000D80 + str r3, [r4] + str r2, [r4, 0x4] + ldr r0, _08000D84 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + adds r3, r6 + adds r2, r6 + subs r1, r6 + cmp r1, r6 + bhi _08000D56 + str r3, [r4] + str r2, [r4, 0x4] + lsrs r0, r1, 1 + movs r1, 0x80 + lsls r1, 24 +_08000D76: + orrs r0, r1 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + b _08000DF0 + .align 2, 0 +_08000D80: .4byte 0x040000d4 +_08000D84: .4byte 0x80000800 +_08000D88: + mov r3, r10 + adds r0, r5, r3 + ldr r2, [r0] + ldrh r4, [r1, 0x8] + add r1, sp, 0x4 + cmp r4, r6 + bhi _08000DB2 + mov r0, r8 + adds r0, 0xC + adds r0, r5, r0 + ldr r0, [r0] + strh r0, [r1] + str r1, [r7] + str r2, [r7, 0x4] + lsrs r0, r4, 1 + movs r1, 0x81 + lsls r1, 24 +_08000DAA: + orrs r0, r1 + str r0, [r7, 0x8] + ldr r0, [r7, 0x8] + b _08000DF0 +_08000DB2: + mov r5, r12 + ldrb r0, [r5] + lsls r0, 4 + ldr r3, _08000E58 + adds r0, r3 + ldr r0, [r0] + strh r0, [r1] + ldr r3, _08000E5C + str r1, [r3] + str r2, [r3, 0x4] + ldr r0, _08000E60 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + adds r2, r6 + subs r4, r6 + cmp r4, r6 + bhi _08000DB2 + ldrb r0, [r5] + lsls r0, 4 + ldr r5, _08000E58 + adds r0, r5 + ldr r0, [r0] + strh r0, [r1] + str r1, [r3] + str r2, [r3, 0x4] + lsrs r0, r4, 1 + movs r1, 0x81 + lsls r1, 24 +_08000DEA: + orrs r0, r1 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] +_08000DF0: + ldr r1, _08000E64 + mov r3, r12 + ldrb r0, [r3] + lsls r0, 4 + adds r0, r1 + mov r2, r9 + str r2, [r0] + ldrb r0, [r3] + lsls r0, 4 + add r0, r10 + str r2, [r0] + ldrb r0, [r3] + lsls r0, 4 + adds r0, r1 + movs r4, 0 + strh r2, [r0, 0x8] + ldrb r0, [r3] + lsls r0, 4 + adds r0, r1 + mov r5, r9 + strh r5, [r0, 0xA] + ldrb r0, [r3] + lsls r0, 4 + adds r1, 0xC + adds r0, r1 + mov r1, r9 + str r1, [r0] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + cmp r0, 0 + bge _08000E34 + strb r4, [r3] +_08000E34: + mov r2, r12 + ldrb r0, [r2] + lsls r0, 4 + ldr r3, _08000E64 + adds r0, r3 + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _08000E46 + b _08000C2E +_08000E46: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08000E58: .4byte 0x0300001c +_08000E5C: .4byte 0x040000d4 +_08000E60: .4byte 0x81000800 +_08000E64: .4byte 0x03000010 + thumb_func_end dma_transfer_queue_process + + thumb_func_start dma3_transfer_queue_add_copy +dma3_transfer_queue_add_copy: @ 8000E68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r12, r0 + mov r8, r1 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 24 + lsrs r4, r3, 24 + movs r5, 0 + ldr r1, _08000EB4 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _08000EB8 + ldrb r2, [r0] + mov r10, r1 + ldr r6, _08000EBC + mov r9, r6 + lsls r0, r2, 4 + adds r1, r0, r6 +_08000E94: + lsls r3, r2, 4 + ldrh r0, [r1, 0x8] + cmp r0, 0 + bne _08000ED4 + mov r0, r12 + str r0, [r1] + mov r0, r9 + adds r0, 0x4 + adds r0, r3, r0 + mov r3, r8 + str r3, [r0] + strh r7, [r1, 0x8] + cmp r4, 0x1 + bne _08000EC0 + strh r4, [r1, 0xA] + b _08000EC4 + .align 2, 0 +_08000EB4: .4byte 0x03000810 +_08000EB8: .4byte 0x03000811 +_08000EBC: .4byte 0x03000010 +_08000EC0: + movs r0, 0x3 + strh r0, [r1, 0xA] +_08000EC4: + movs r0, 0 + ldr r1, _08000ED0 + strb r0, [r1] + lsls r0, r2, 16 + asrs r0, 16 + b _08000EF0 + .align 2, 0 +_08000ED0: .4byte 0x03000810 +_08000ED4: + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x7F + ble _08000EE0 + adds r1, r6, 0 + movs r2, 0 +_08000EE0: + adds r5, 0x1 + cmp r5, 0x7F + ble _08000E94 + movs r0, 0 + mov r3, r10 + strb r0, [r3] + movs r0, 0x1 + negs r0, r0 +_08000EF0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end dma3_transfer_queue_add_copy + + thumb_func_start dma3_transfer_queue_add_fill +dma3_transfer_queue_add_fill: @ 8000F00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + mov r8, r1 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 24 + lsrs r5, r3, 24 + movs r6, 0 + ldr r0, _08000F58 + ldrb r2, [r0] + ldr r1, _08000F5C + movs r0, 0x1 + strb r0, [r1] + mov r10, r1 + ldr r0, _08000F60 + mov r12, r0 + mov r4, r12 + lsls r0, r2, 4 + adds r0, 0x8 + adds r1, r0, r4 +_08000F30: + lsls r3, r2, 4 + ldrh r0, [r1] + cmp r0, 0 + bne _08000F78 + adds r0, r4, 0x4 + adds r0, r3, r0 + mov r6, r8 + str r6, [r0] + strh r7, [r1] + strh r5, [r1, 0x2] + adds r0, r4, 0 + adds r0, 0xC + adds r0, r3, r0 + mov r3, r9 + str r3, [r0] + cmp r5, 0x1 + bne _08000F64 + movs r0, 0x2 + b _08000F66 + .align 2, 0 +_08000F58: .4byte 0x03000811 +_08000F5C: .4byte 0x03000810 +_08000F60: .4byte 0x03000010 +_08000F64: + movs r0, 0x4 +_08000F66: + strh r0, [r1, 0x2] + movs r0, 0 + ldr r6, _08000F74 + strb r0, [r6] + lsls r0, r2, 16 + asrs r0, 16 + b _08000F96 + .align 2, 0 +_08000F74: .4byte 0x03000810 +_08000F78: + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x7F + ble _08000F86 + mov r1, r12 + adds r1, 0x8 + movs r2, 0 +_08000F86: + adds r6, 0x1 + cmp r6, 0x7F + ble _08000F30 + movs r0, 0 + mov r1, r10 + strb r0, [r1] + movs r0, 0x1 + negs r0, r0 +_08000F96: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end dma3_transfer_queue_add_fill + + thumb_func_start dma3_transfer_queue_check_for_space +dma3_transfer_queue_check_for_space: @ 8000FA4 + push {lr} + movs r2, 0 + lsls r0, 16 + asrs r1, r0, 16 + movs r3, 0x1 + negs r3, r3 + cmp r1, r3 + bne _08000FCC + ldr r1, _08000FC8 +_08000FB6: + ldrh r0, [r1, 0x8] + cmp r0, 0 + bne _08000FD8 + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x7F + ble _08000FB6 +_08000FC4: + movs r0, 0 + b _08000FDC + .align 2, 0 +_08000FC8: .4byte 0x03000010 +_08000FCC: + ldr r0, _08000FE0 + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _08000FC4 +_08000FD8: + movs r0, 0x1 + negs r0, r0 +_08000FDC: + pop {r1} + bx r1 + .align 2, 0 +_08000FE0: .4byte 0x03000010 + thumb_func_end dma3_transfer_queue_check_for_space + + thumb_func_start lcd_io_copy_queue_clean +lcd_io_copy_queue_clean: @ 8000FE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r2, 0 + ldr r7, _08001028 + ldr r0, _0800102C + mov r12, r0 + ldr r1, _08001030 + mov r8, r1 + ldr r6, _08001034 + movs r5, 0 + ldr r4, _08001038 + movs r3, 0xFF +_08000FFE: + adds r0, r2, r6 + strb r5, [r0] + adds r1, r2, r4 + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x5F + ble _08000FFE + movs r0, 0 + strb r0, [r7] + mov r1, r12 + strb r0, [r1] + movs r0, 0 + mov r1, r8 + strh r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08001028: .4byte 0x030008d8 +_0800102C: .4byte 0x030008d9 +_08001030: .4byte 0x030008da +_08001034: .4byte 0x03000818 +_08001038: .4byte 0x03000878 + thumb_func_end lcd_io_copy_queue_clean + + thumb_func_start lcd_io_buffer_to_hardware +lcd_io_buffer_to_hardware: @ 800103C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bne _08001068 + ldr r2, _0800105C + ldrh r1, [r2] + ldr r0, _08001060 + ands r0, r1 + strh r0, [r2] + ldr r1, _08001064 + ldrh r0, [r2] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2] + b _08001076 + .align 2, 0 +_0800105C: .4byte 0x04000004 +_08001060: .4byte 0x0000ffe7 +_08001064: .4byte 0x0300081c +_08001068: + movs r0, 0x80 + lsls r0, 19 + adds r0, r2, r0 + ldr r1, _0800107C + adds r1, r2, r1 + ldrh r1, [r1] + strh r1, [r0] +_08001076: + pop {r0} + bx r0 + .align 2, 0 +_0800107C: .4byte 0x03000818 + thumb_func_end lcd_io_buffer_to_hardware + + thumb_func_start lcd_io_copy_queue_process +lcd_io_copy_queue_process: @ 8001080 + push {r4,r5,lr} + ldr r0, _080010AC + ldrb r0, [r0] + cmp r0, 0 + bne _080010A4 + movs r5, 0 +_0800108C: + ldr r0, _080010B0 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _080010A4 + bl lcd_io_buffer_to_hardware + movs r0, 0xFF + strb r0, [r4] + adds r5, 0x1 + cmp r5, 0x5F + ble _0800108C +_080010A4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080010AC: .4byte 0x030008d8 +_080010B0: .4byte 0x03000878 + thumb_func_end lcd_io_copy_queue_process + + thumb_func_start lcd_io_set +lcd_io_set: @ 80010B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + cmp r4, 0x5F + bhi _08001130 + ldr r0, _080010F0 + adds r0, r4, r0 + strh r1, [r0] + ldr r0, _080010F4 + ldrh r1, [r0] + movs r0, 0xFF + ands r0, r1 + subs r0, 0xA1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x40 + bls _080010E8 + movs r0, 0x80 + lsls r0, 19 + ldrh r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080010FE +_080010E8: + adds r0, r4, 0 + bl lcd_io_buffer_to_hardware + b _08001130 + .align 2, 0 +_080010F0: .4byte 0x03000818 +_080010F4: .4byte 0x04000006 +_080010F8: + movs r0, 0 + strb r0, [r5] + b _08001130 +_080010FE: + ldr r2, _08001138 + movs r0, 0x1 + strb r0, [r2] + movs r3, 0 + ldr r0, _0800113C + ldrb r1, [r0] + adds r5, r2, 0 + adds r2, r0, 0 + cmp r1, 0xFF + beq _08001128 + adds r1, r2, 0 +_08001114: + ldrb r0, [r1] + cmp r0, r4 + beq _080010F8 + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x5F + bgt _08001128 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08001114 +_08001128: + adds r0, r3, r2 + movs r1, 0 + strb r4, [r0] + strb r1, [r5] +_08001130: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08001138: .4byte 0x030008d8 +_0800113C: .4byte 0x03000878 + thumb_func_end lcd_io_set + + thumb_func_start lcd_io_set_forced_blank +lcd_io_set_forced_blank: @ 8001140 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + cmp r4, 0x5F + bhi _080011A8 + ldr r0, _0800116C + adds r0, r4, r0 + strh r1, [r0] + movs r0, 0x80 + lsls r0, 19 + ldrh r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08001176 + adds r0, r4, 0 + bl lcd_io_buffer_to_hardware + b _080011A8 + .align 2, 0 +_0800116C: .4byte 0x03000818 +_08001170: + movs r0, 0 + strb r0, [r5] + b _080011A8 +_08001176: + ldr r2, _080011B0 + movs r0, 0x1 + strb r0, [r2] + movs r3, 0 + ldr r0, _080011B4 + ldrb r1, [r0] + adds r5, r2, 0 + adds r2, r0, 0 + cmp r1, 0xFF + beq _080011A0 + adds r1, r2, 0 +_0800118C: + ldrb r0, [r1] + cmp r0, r4 + beq _08001170 + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x5F + bgt _080011A0 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0800118C +_080011A0: + adds r0, r3, r2 + movs r1, 0 + strb r4, [r0] + strb r1, [r5] +_080011A8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080011B0: .4byte 0x030008d8 +_080011B4: .4byte 0x03000878 + thumb_func_end lcd_io_set_forced_blank + + thumb_func_start lcd_io_get +lcd_io_get: @ 80011B8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r1, 0x4 + bne _080011CC + ldr r0, _080011C8 + b _080011DE + .align 2, 0 +_080011C8: .4byte 0x04000004 +_080011CC: + cmp r1, 0x6 + beq _080011DC + ldr r0, _080011D8 + adds r0, r1, r0 + ldrh r0, [r0] + b _080011E0 + .align 2, 0 +_080011D8: .4byte 0x03000818 +_080011DC: + ldr r0, _080011E4 +_080011DE: + ldrh r0, [r0] +_080011E0: + pop {r1} + bx r1 + .align 2, 0 +_080011E4: .4byte 0x04000006 + thumb_func_end lcd_io_get + + thumb_func_start lcd_io_set_bits +lcd_io_set_bits: @ 80011E8 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08001204 + adds r1, r0, r1 + ldrh r1, [r1] + orrs r1, r2 + lsls r1, 16 + lsrs r1, 16 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08001204: .4byte 0x03000818 + thumb_func_end lcd_io_set_bits + + thumb_func_start lcd_io_clear_bits +lcd_io_clear_bits: @ 8001208 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + ldr r1, _08001224 + adds r1, r0, r1 + ldrh r1, [r1] + lsrs r2, 16 + bics r1, r2 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08001224: .4byte 0x03000818 + thumb_func_end lcd_io_clear_bits + + thumb_func_start update_hardware_IE +update_hardware_IE: @ 8001228 + push {r4,r5,lr} + ldr r5, _0800124C + ldrb r0, [r5] + cmp r0, 0 + beq _08001246 + ldr r2, _08001250 + ldrh r1, [r2] + movs r4, 0 + strh r4, [r2] + ldr r3, _08001254 + ldr r0, _08001258 + ldrh r0, [r0] + strh r0, [r3] + strh r1, [r2] + strb r4, [r5] +_08001246: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800124C: .4byte 0x030008d9 +_08001250: .4byte 0x04000208 +_08001254: .4byte 0x04000200 +_08001258: .4byte 0x030008da + thumb_func_end update_hardware_IE + + thumb_func_start enable_irqs +enable_irqs: @ 800125C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08001280 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r4] + ldr r1, _08001284 + movs r0, 0x1 + strb r0, [r1] + bl update_hardware_IE + ldrh r0, [r4] + bl dispstat_set_vblank_hblank_irqs + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08001280: .4byte 0x030008da +_08001284: .4byte 0x030008d9 + thumb_func_end enable_irqs + + thumb_func_start disable_irqs +disable_irqs: @ 8001288 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080012AC + ldrh r1, [r4] + bics r1, r0 + strh r1, [r4] + ldr r1, _080012B0 + movs r0, 0x1 + strb r0, [r1] + bl update_hardware_IE + ldrh r0, [r4] + bl dispstat_set_vblank_hblank_irqs + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080012AC: .4byte 0x030008da +_080012B0: .4byte 0x030008d9 + thumb_func_end disable_irqs + + thumb_func_start dispstat_set_vblank_hblank_irqs +dispstat_set_vblank_hblank_irqs: @ 80012B4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x4 + bl lcd_io_get + movs r2, 0x18 + ands r2, r0 + movs r1, 0x1 + ands r1, r4 + negs r0, r1 + orrs r0, r1 + asrs r1, r0, 31 + movs r0, 0x8 + ands r1, r0 + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _080012E0 + movs r0, 0x10 + orrs r1, r0 +_080012E0: + cmp r2, r1 + beq _080012EA + movs r0, 0x4 + bl lcd_io_set +_080012EA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end dispstat_set_vblank_hblank_irqs + + thumb_func_start gpu_init_bgs +gpu_init_bgs: @ 80012F0 + push {lr} + bl gpu_reset_bg_configs + ldr r1, _08001304 + movs r0, 0 + strh r0, [r1, 0x10] + bl gpu_sync_text_mode_and_hide_bgs + pop {r0} + bx r0 + .align 2, 0 +_08001304: .4byte 0x030008e0 + thumb_func_end gpu_init_bgs + + thumb_func_start gpu_set_bg_mode +gpu_set_bg_mode: @ 8001308 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0800131C + ldrh r2, [r3, 0x10] + ldr r1, _08001320 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x10] + bx lr + .align 2, 0 +_0800131C: .4byte 0x030008e0 +_08001320: .4byte 0x0000fff8 + thumb_func_end gpu_set_bg_mode + + thumb_func_start gpu_get_bg_mode +gpu_get_bg_mode: @ 8001324 + ldr r0, _08001330 + ldrb r1, [r0, 0x10] + movs r0, 0x7 + ands r0, r1 + bx lr + .align 2, 0 +_08001330: .4byte 0x030008e0 + thumb_func_end gpu_get_bg_mode + + thumb_func_start gpu_reset_bg_configs +gpu_reset_bg_configs: @ 8001334 + push {lr} + ldr r2, _0800134C + ldr r0, _08001350 + ldr r0, [r0] + adds r1, r2, 0 + adds r1, 0xC +_08001340: + str r0, [r1] + subs r1, 0x4 + cmp r1, r2 + bge _08001340 + pop {r0} + bx r0 + .align 2, 0 +_0800134C: .4byte 0x030008e0 +_08001350: .4byte 0x082e9580 + thumb_func_end gpu_reset_bg_configs + + thumb_func_start sub_8001354 +sub_8001354: @ 8001354 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_invalid_bg_id + lsls r0, 24 + cmp r0, 0 + bne _08001372 + ldr r1, _08001378 + lsls r0, r4, 2 + adds r0, r1 + ldr r1, _0800137C + ldr r1, [r1] + str r1, [r0] +_08001372: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08001378: .4byte 0x030008e0 +_0800137C: .4byte 0x082e9580 + thumb_func_end sub_8001354 + + thumb_func_start gpu_bg_config_set_fields +gpu_bg_config_set_fields: @ 8001380 + 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 r12, r6 + ldr r6, [sp, 0x3C] + mov r8, r6 + lsls r0, 24 + lsrs r7, r0, 24 + str r7, [sp] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + lsls r5, 24 + lsrs r5, 24 + mov r0, r12 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + adds r0, r7, 0 + bl is_invalid_bg_id + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0 + bne _08001498 + ldr r2, _080014A8 + mov r8, r2 + mov r0, r10 + cmp r0, 0xFF + beq _080013F4 + lsls r2, r7, 2 + add r2, r8 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] +_080013F4: + cmp r6, 0xFF + beq _0800140C + lsls r1, r7, 2 + add r1, r8 + movs r0, 0x1F + ands r6, r0 + lsls r3, r6, 2 + ldrb r2, [r1, 0x1] + subs r0, 0x9C + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x1] +_0800140C: + mov r1, r9 + cmp r1, 0xFF + beq _08001428 + lsls r1, r7, 2 + add r1, r8 + movs r0, 0x3 + mov r2, r9 + ands r2, r0 + lsls r3, r2, 2 + ldrb r2, [r1] + subs r0, 0x10 + ands r0, r2 + orrs r0, r3 + strb r0, [r1] +_08001428: + ldr r6, [sp, 0x4] + cmp r6, 0xFF + beq _0800143E + lsls r1, r7, 2 + add r1, r8 + lsls r3, r6, 7 + ldrb r2, [r1, 0x1] + movs r0, 0x7F + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x1] +_0800143E: + cmp r5, 0xFF + beq _08001456 + lsls r1, r7, 2 + add r1, r8 + movs r0, 0x3 + ands r5, r0 + lsls r3, r5, 4 + ldrb r2, [r1] + subs r0, 0x34 + ands r0, r2 + orrs r0, r3 + strb r0, [r1] +_08001456: + cmp r4, 0xFF + beq _0800146E + lsls r1, r7, 2 + add r1, r8 + movs r0, 0x1 + ands r4, r0 + lsls r3, r4, 6 + ldrb r2, [r1] + subs r0, 0x42 + ands r0, r2 + orrs r0, r3 + strb r0, [r1] +_0800146E: + ldr r0, [sp, 0xC] + cmp r0, 0xFF + beq _08001484 + lsls r1, r7, 2 + add r1, r8 + lsls r3, r0, 7 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + orrs r0, r3 + strb r0, [r1] +_08001484: + ldr r1, [sp] + lsls r0, r1, 2 + add r0, r8 + mov r2, r12 + strb r2, [r0, 0x2] + strb r2, [r0, 0x3] + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_08001498: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080014A8: .4byte 0x030008e0 + thumb_func_end gpu_bg_config_set_fields + + thumb_func_start gpu_bg_config_get_field +gpu_bg_config_get_field: @ 80014AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r4, 0 + bl is_invalid_bg_id + lsls r0, 24 + cmp r0, 0 + bne _08001558 + ldr r1, _080014E4 + lsls r2, r4, 2 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 31 + adds r3, r1, 0 + cmp r0, 0 + beq _08001558 + subs r0, r5, 0x1 + cmp r0, 0x7 + bhi _08001558 + lsls r0, 2 + ldr r1, _080014E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080014E4: .4byte 0x030008e0 +_080014E8: .4byte _080014EC + .align 2, 0 +_080014EC: + .4byte _0800150C + .4byte _08001516 + .4byte _08001520 + .4byte _0800152A + .4byte _08001534 + .4byte _0800153C + .4byte _08001546 + .4byte _08001550 +_0800150C: + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + b _0800155A +_08001516: + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsls r0, 30 + lsrs r0, 30 + b _0800155A +_08001520: + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsls r0, 25 + lsrs r0, 27 + b _0800155A +_0800152A: + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + b _0800155A +_08001534: + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsrs r0, 7 + b _0800155A +_0800153C: + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 30 + b _0800155A +_08001546: + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 31 + b _0800155A +_08001550: + adds r0, r2, r3 + ldrb r0, [r0] + lsrs r0, 7 + b _0800155A +_08001558: + movs r0, 0xFF +_0800155A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end gpu_bg_config_get_field + + thumb_func_start gpu_copy_to_vram_by_bg_id +gpu_copy_to_vram_by_bg_id: @ 8001560 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r6, r3, 16 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r4, 0 + bl is_invalid_bg_id + lsls r0, 24 + cmp r0, 0 + bne _080015D8 + ldr r1, _080015A0 + lsls r0, r4, 2 + adds r1, r0, r1 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080015D8 + cmp r5, 0x1 + beq _080015A4 + cmp r5, 0x2 + beq _080015AC + movs r2, 0xFF + b _080015DC + .align 2, 0 +_080015A0: .4byte 0x030008e0 +_080015A4: + ldrb r0, [r1, 0x1] + lsls r0, 30 + lsrs r0, 16 + b _080015B4 +_080015AC: + ldrb r0, [r1, 0x1] + lsls r0, 25 + lsrs r0, 27 + lsls r0, 11 +_080015B4: + adds r0, r6, r0 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xC0 + lsls r1, 19 + adds r1, r0, r1 + mov r0, r8 + adds r2, r7, 0 + movs r3, 0 + bl dma3_transfer_queue_add_copy + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080015DC +_080015D8: + movs r0, 0xFF + b _080015DE +_080015DC: + adds r0, r2, 0 +_080015DE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end gpu_copy_to_vram_by_bg_id + + thumb_func_start gpu_bg_show +gpu_bg_show: @ 80015E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_invalid_bg_id + lsls r0, 24 + cmp r0, 0 + bne _08001656 + ldr r5, _0800165C + lsls r0, r4, 2 + adds r2, r0, r5 + ldrb r3, [r2] + lsls r0, r3, 31 + cmp r0, 0 + beq _08001656 + lsls r1, r3, 26 + lsrs r1, 30 + ldrb r2, [r2, 0x1] + lsls r0, r2, 30 + lsrs r0, 28 + orrs r1, r0 + movs r0, 0x40 + ands r0, r3 + orrs r1, r0 + lsrs r0, r2, 7 + lsls r0, 7 + orrs r1, r0 + lsls r2, 25 + lsrs r2, 27 + lsls r2, 8 + orrs r1, r2 + lsrs r0, r3, 7 + lsls r0, 13 + orrs r1, r0 + lsls r0, r3, 28 + lsrs r0, 30 + lsls r0, 14 + orrs r1, r0 + lsls r0, r4, 25 + movs r2, 0x80 + lsls r2, 20 + adds r0, r2 + lsrs r0, 24 + bl lcd_io_set + adds r1, r4, 0 + adds r1, 0x8 + movs r0, 0x1 + lsls r0, r1 + ldrh r1, [r5, 0x10] + orrs r0, r1 + ldr r1, _08001660 + ands r0, r1 + strh r0, [r5, 0x10] +_08001656: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800165C: .4byte 0x030008e0 +_08001660: .4byte 0x00000f07 + thumb_func_end gpu_bg_show + + thumb_func_start gpu_bg_hide +gpu_bg_hide: @ 8001664 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_invalid_bg_id + lsls r0, 24 + cmp r0, 0 + bne _0800168A + ldr r2, _08001690 + adds r0, r4, 0 + adds r0, 0x8 + movs r1, 0x1 + lsls r1, r0 + ldrh r0, [r2, 0x10] + bics r0, r1 + ldr r1, _08001694 + ands r0, r1 + strh r0, [r2, 0x10] +_0800168A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08001690: .4byte 0x030008e0 +_08001694: .4byte 0x00000f07 + thumb_func_end gpu_bg_hide + + thumb_func_start gpu_sync_bg_visibility_and_mode +gpu_sync_bg_visibility_and_mode: @ 8001698 + push {lr} + movs r0, 0 + bl lcd_io_get + ldr r1, _080016B4 + ands r1, r0 + ldr r0, _080016B8 + ldrh r0, [r0, 0x10] + orrs r1, r0 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080016B4: .4byte 0x0000f0f8 +_080016B8: .4byte 0x030008e0 + thumb_func_end gpu_sync_bg_visibility_and_mode + + thumb_func_start gpu_sync_text_mode_and_hide_bgs +gpu_sync_text_mode_and_hide_bgs: @ 80016BC + push {lr} + movs r0, 0 + bl lcd_io_get + ldr r1, _080016D4 + ands r1, r0 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080016D4: .4byte 0x0000f0f8 + thumb_func_end gpu_sync_text_mode_and_hide_bgs + + thumb_func_start gpu_bg_affine_set +gpu_bg_affine_set: @ 80016D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x24 + mov r12, r1 + mov r8, r2 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + ldr r4, [sp, 0x44] + ldr r5, [sp, 0x48] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _0800171C + ldrh r0, [r0, 0x10] + movs r1, 0x7 + ands r1, r0 + cmp r1, 0x1 + beq _08001720 + cmp r1, 0x1 + ble _08001796 + cmp r1, 0x2 + beq _08001726 + b _08001796 + .align 2, 0 +_0800171C: .4byte 0x030008e0 +_08001720: + cmp r6, 0x2 + bne _08001796 + b _08001730 +_08001726: + subs r0, r6, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08001796 +_08001730: + mov r0, r12 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, sp + strh r3, [r0, 0x8] + strh r7, [r0, 0xA] + strh r2, [r0, 0xC] + strh r4, [r0, 0xE] + strh r5, [r0, 0x10] + add r4, sp, 0x14 + adds r1, r4, 0 + movs r2, 0x1 + bl BgAffineSet + ldrh r1, [r4] + movs r0, 0x20 + bl lcd_io_set + ldrh r1, [r4, 0x2] + movs r0, 0x22 + bl lcd_io_set + ldrh r1, [r4, 0x4] + movs r0, 0x24 + bl lcd_io_set + ldrh r1, [r4, 0x6] + movs r0, 0x26 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x20 + bl lcd_io_set + ldrh r1, [r4, 0x8] + movs r0, 0x28 + bl lcd_io_set + ldrh r1, [r4, 0xA] + movs r0, 0x2A + bl lcd_io_set + ldrh r1, [r4, 0xC] + movs r0, 0x2C + bl lcd_io_set + ldrh r1, [r4, 0xE] + movs r0, 0x2E + bl lcd_io_set +_08001796: + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end gpu_bg_affine_set + + thumb_func_start is_invalid_bg_id +is_invalid_bg_id: @ 80017A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080017B2 + movs r0, 0 + b _080017B4 +_080017B2: + movs r0, 0x1 +_080017B4: + pop {r1} + bx r1 + thumb_func_end is_invalid_bg_id + + thumb_func_start do_nothing +do_nothing: @ 80017B8 + movs r0, 0 + bx lr + thumb_func_end do_nothing + + thumb_func_start gpu_reset_bgs_and_dma3_busy_flags +gpu_reset_bgs_and_dma3_busy_flags: @ 80017BC + push {r4,lr} + adds r4, r0, 0 + bl gpu_init_bgs + ldr r1, _080017E0 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xC +_080017CC: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _080017CC + ldr r0, _080017E4 + str r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080017E0: .4byte 0x03000938 +_080017E4: .4byte 0x03002f54 + thumb_func_end gpu_reset_bgs_and_dma3_busy_flags + + thumb_func_start bg_vram_setup +bg_vram_setup: @ 80017E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r4, r2, 24 + bl gpu_set_bg_mode + bl gpu_reset_bg_configs + cmp r4, 0 + beq _08001894 + movs r7, 0 + ldr r0, _080018A4 + mov r9, r0 + movs r2, 0xC + add r2, r9 + mov r10, r2 + adds r6, r5, 0 + mov r8, r4 +_0800181A: + ldr r4, [r6] + lsls r0, r4, 30 + lsrs r5, r0, 30 + cmp r5, 0x3 + bhi _08001886 + lsls r1, r4, 28 + lsrs r1, 30 + lsls r2, r4, 23 + lsrs r2, 27 + lsls r3, r4, 21 + lsrs r3, 30 + lsls r0, r4, 20 + lsrs r0, 31 + str r0, [sp] + lsls r0, r4, 18 + lsrs r0, 30 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + str r7, [sp, 0xC] + adds r0, r5, 0 + bl gpu_bg_config_set_fields + lsls r4, r5, 4 + mov r5, r9 + adds r3, r4, r5 + ldr r2, [r6] + lsls r2, 8 + lsrs r2, 22 + ldrh r0, [r3] + ldr r5, _080018A8 + adds r1, r5, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + ldrb r0, [r3, 0x1] + movs r2, 0x3D + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r3, 0x1] + ldr r0, [r3] + ldr r1, _080018AC + ands r0, r1 + str r0, [r3] + mov r0, r9 + adds r0, 0x4 + adds r0, r4, r0 + str r7, [r0] + mov r0, r9 + adds r0, 0x8 + adds r0, r4, r0 + str r7, [r0] + add r4, r10 + str r7, [r4] +_08001886: + adds r6, 0x4 + movs r5, 0x1 + negs r5, r5 + add r8, r5 + mov r0, r8 + cmp r0, 0 + bne _0800181A +_08001894: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080018A4: .4byte 0x030008f8 +_080018A8: .4byte 0xfffffc00 +_080018AC: .4byte 0x00003fff + thumb_func_end bg_vram_setup + + thumb_func_start bg_init_bg_config_2_from_bg_config_3 +bg_init_bg_config_2_from_bg_config_3: @ 80018B0 + push {r4-r7,lr} + sub sp, 0x10 + adds r7, r0, 0 + ldr r4, [r7] + lsls r0, r4, 30 + lsrs r5, r0, 30 + cmp r5, 0x3 + bhi _08001920 + lsls r1, r4, 28 + lsrs r1, 30 + lsls r2, r4, 23 + lsrs r2, 27 + lsls r3, r4, 21 + lsrs r3, 30 + lsls r0, r4, 20 + lsrs r0, 31 + str r0, [sp] + lsls r0, r4, 18 + lsrs r0, 30 + str r0, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r5, 0 + bl gpu_bg_config_set_fields + ldr r4, _08001928 + lsls r5, 4 + adds r3, r5, r4 + ldr r1, [r7] + lsls r1, 8 + lsrs r1, 22 + ldrh r2, [r3] + ldr r0, _0800192C + ands r0, r2 + orrs r0, r1 + strh r0, [r3] + ldrb r1, [r3, 0x1] + movs r0, 0x3D + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x1] + ldr r0, [r3] + ldr r1, _08001930 + ands r0, r1 + str r0, [r3] + adds r0, r4, 0x4 + adds r0, r5, r0 + str r6, [r0] + adds r0, r4, 0 + adds r0, 0x8 + adds r0, r5, r0 + str r6, [r0] + adds r4, 0xC + adds r5, r4 + str r6, [r5] +_08001920: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08001928: .4byte 0x030008f8 +_0800192C: .4byte 0xfffffc00 +_08001930: .4byte 0x00003fff + thumb_func_end bg_init_bg_config_2_from_bg_config_3 + + thumb_func_start call_gpu_set_bg_mode +call_gpu_set_bg_mode: @ 8001934 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl gpu_set_bg_mode + pop {r0} + bx r0 + thumb_func_end call_gpu_set_bg_mode + + thumb_func_start gpu_copy_bg_tile_pattern_data_to_vram +gpu_copy_bg_tile_pattern_data_to_vram: @ 8001944 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r4, r3, 16 + adds r0, r5, 0 + movs r1, 0x5 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + bne _08001980 + ldr r1, _0800197C + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r0, r4 + lsls r0, 21 + b _08001990 + .align 2, 0 +_0800197C: .4byte 0x030008f8 +_08001980: + ldr r1, _080019B0 + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r0, r4 + lsls r0, 22 +_08001990: + lsrs r4, r0, 16 + movs r6, 0x1 + str r6, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl gpu_copy_to_vram_by_bg_id + lsls r2, r0, 24 + lsrs r1, r2, 24 + adds r7, r1, 0 + cmp r1, 0xFF + bne _080019B8 + ldr r0, _080019B4 + b _080019E6 + .align 2, 0 +_080019B0: .4byte 0x030008f8 +_080019B4: .4byte 0x0000ffff +_080019B8: + ldr r0, _080019F4 + lsrs r2, 29 + lsls r2, 2 + adds r2, r0 + movs r0, 0x1F + ands r0, r1 + adds r1, r6, 0 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, _080019F8 + ldr r0, [r0] + cmp r0, 0x1 + bne _080019E4 + lsrs r1, r4, 5 + mov r0, r8 + lsrs r2, r0, 5 + adds r0, r5, 0 + movs r3, 0x1 + bl do_nothing +_080019E4: + adds r0, r7, 0 +_080019E6: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080019F4: .4byte 0x03000938 +_080019F8: .4byte 0x03002f54 + thumb_func_end gpu_copy_bg_tile_pattern_data_to_vram + + thumb_func_start gpu_copy_bg_tile_map_to_vram +gpu_copy_bg_tile_map_to_vram: @ 80019FC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 17 + lsrs r3, 16 + movs r4, 0x2 + str r4, [sp] + bl gpu_copy_to_vram_by_bg_id + lsls r2, r0, 24 + lsrs r3, r2, 24 + cmp r3, 0xFF + beq _08001A3C + ldr r0, _08001A38 + lsrs r2, 29 + lsls r2, 2 + adds r2, r0 + movs r0, 0x1F + ands r0, r3 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + adds r0, r3, 0 + b _08001A3E + .align 2, 0 +_08001A38: .4byte 0x03000938 +_08001A3C: + ldr r0, _08001A48 +_08001A3E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08001A48: .4byte 0x0000ffff + thumb_func_end gpu_copy_bg_tile_map_to_vram + + thumb_func_start unused_copy_palette +unused_copy_palette: @ 8001A4C + push {r4-r7,lr} + adds r7, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08001A98 + ldr r1, _08001A9C + lsls r0, r4, 4 + adds r0, r1 + ldrb r1, [r0, 0x1] + lsls r1, 26 + lsrs r1, 28 + lsls r1, 5 + lsls r0, r5, 1 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0xA0 + lsls r0, 19 + adds r1, r0 + adds r0, r7, 0 + adds r2, r6, 0 + movs r3, 0 + bl dma3_transfer_queue_add_copy + lsls r3, r0, 24 + asrs r1, r3, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08001AA4 +_08001A98: + ldr r0, _08001AA0 + b _08001AC8 + .align 2, 0 +_08001A9C: .4byte 0x030008f8 +_08001AA0: .4byte 0x0000ffff +_08001AA4: + ldr r4, _08001AD0 + adds r0, r1, 0 + cmp r1, 0 + bge _08001AAE + adds r0, 0x1F +_08001AAE: + asrs r0, 5 + lsls r2, r0, 2 + adds r2, r4 + lsls r0, 5 + subs r0, r1, r0 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + lsrs r0, r3, 24 +_08001AC8: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08001AD0: .4byte 0x03000938 + thumb_func_end unused_copy_palette + + thumb_func_start is_dma3_queue_busy_with_gpu_copy +is_dma3_queue_busy_with_gpu_copy: @ 8001AD4 + push {r4-r7,lr} + movs r5, 0 + movs r7, 0x1 + negs r7, r7 +_08001ADC: + adds r0, r5, 0 + cmp r5, 0 + bge _08001AE4 + adds r0, 0x1F +_08001AE4: + asrs r0, 5 + lsls r2, r0, 24 + lsls r0, 5 + subs r0, r5, r0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08001B18 + lsrs r2, 22 + adds r4, r2, r1 + movs r6, 0x1 + lsls r6, r0 + ldr r0, [r4] + ands r0, r6 + cmp r0, 0 + beq _08001B22 + lsls r0, r5, 16 + asrs r0, 16 + bl dma3_transfer_queue_check_for_space + lsls r0, 24 + asrs r0, 24 + cmp r0, r7 + bne _08001B1C + movs r0, 0x1 + b _08001B2A + .align 2, 0 +_08001B18: .4byte 0x03000938 +_08001B1C: + ldr r0, [r4] + bics r0, r6 + str r0, [r4] +_08001B22: + adds r5, 0x1 + cmp r5, 0x7F + ble _08001ADC + movs r0, 0 +_08001B2A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end is_dma3_queue_busy_with_gpu_copy + + thumb_func_start gpu_sync_bg_show +gpu_sync_bg_show: @ 8001B30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl gpu_bg_show + bl gpu_sync_bg_visibility_and_mode + pop {r0} + bx r0 + thumb_func_end gpu_sync_bg_show + + thumb_func_start gpu_sync_bg_hide +gpu_sync_bg_hide: @ 8001B44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl gpu_bg_hide + bl gpu_sync_bg_visibility_and_mode + pop {r0} + bx r0 + thumb_func_end gpu_sync_bg_hide + + thumb_func_start gpu_bg_config_set_field +gpu_bg_config_set_field: @ 8001B58 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r3, r2, 24 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _08001C12 + lsls r0, 2 + ldr r1, _08001B78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08001B78: .4byte _08001B7C + .align 2, 0 +_08001B7C: + .4byte _08001B98 + .4byte _08001BA8 + .4byte _08001BBA + .4byte _08001BD0 + .4byte _08001BE4 + .4byte _08001BFC + .4byte _08001BDA +_08001B98: + movs r0, 0xFF + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r1, r3, 0 + b _08001BF2 +_08001BA8: + movs r0, 0xFF + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xFF + adds r2, r3, 0 + b _08001BF4 +_08001BBA: + movs r0, 0xFF + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0xFF + bl gpu_bg_config_set_fields + b _08001C12 +_08001BD0: + str r3, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r0, [sp, 0x8] + b _08001BEC +_08001BDA: + movs r0, 0xFF + str r0, [sp] + str r3, [sp, 0x4] + str r0, [sp, 0x8] + b _08001BEC +_08001BE4: + movs r0, 0xFF + str r0, [sp] + str r0, [sp, 0x4] + str r3, [sp, 0x8] +_08001BEC: + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xFF +_08001BF2: + movs r2, 0xFF +_08001BF4: + movs r3, 0xFF + bl gpu_bg_config_set_fields + b _08001C12 +_08001BFC: + movs r0, 0xFF + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r3, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0xFF + movs r3, 0xFF + bl gpu_bg_config_set_fields +_08001C12: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end gpu_bg_config_set_field + + thumb_func_start bg_get_field +bg_get_field: @ 8001C1C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x9 + bhi _08001CF8 + lsls r0, 2 + ldr r1, _08001C38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08001C38: .4byte _08001C3C + .align 2, 0 +_08001C3C: + .4byte _08001C64 + .4byte _08001C6E + .4byte _08001C78 + .4byte _08001C82 + .4byte _08001C96 + .4byte _08001CA0 + .4byte _08001C8C + .4byte _08001CAA + .4byte _08001CD8 + .4byte _08001CE4 +_08001C64: + adds r0, r4, 0 + movs r1, 0x2 + bl gpu_bg_config_get_field + b _08001CDE +_08001C6E: + adds r0, r4, 0 + movs r1, 0x3 + bl gpu_bg_config_get_field + b _08001CDE +_08001C78: + adds r0, r4, 0 + movs r1, 0x4 + bl gpu_bg_config_get_field + b _08001CDE +_08001C82: + adds r0, r4, 0 + movs r1, 0x5 + bl gpu_bg_config_get_field + b _08001CDE +_08001C8C: + adds r0, r4, 0 + movs r1, 0x6 + bl gpu_bg_config_get_field + b _08001CDE +_08001C96: + adds r0, r4, 0 + movs r1, 0x7 + bl gpu_bg_config_get_field + b _08001CDE +_08001CA0: + adds r0, r4, 0 + movs r1, 0x8 + bl gpu_bg_config_get_field + b _08001CDE +_08001CAA: + adds r0, r4, 0 + bl bg_get_type_by_bg_id + cmp r0, 0 + beq _08001CBC + cmp r0, 0x1 + beq _08001CCA + movs r0, 0 + b _08001CFA +_08001CBC: + adds r0, r4, 0 + movs r1, 0 + bl bg_get_screen_size_in_regular_mode + lsls r0, 27 + lsrs r0, 16 + b _08001CFA +_08001CCA: + adds r0, r4, 0 + movs r1, 0 + bl bg_get_screen_size_in_affine_mode + lsls r0, 24 + lsrs r0, 16 + b _08001CFA +_08001CD8: + adds r0, r4, 0 + bl bg_get_type_by_bg_id +_08001CDE: + lsls r0, 16 + lsrs r0, 16 + b _08001CFA +_08001CE4: + ldr r0, _08001CF4 + lsls r1, r4, 4 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 22 + lsrs r0, 22 + b _08001CFA + .align 2, 0 +_08001CF4: .4byte 0x030008f8 +_08001CF8: + ldr r0, _08001D00 +_08001CFA: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08001D00: .4byte 0x0000ffff + thumb_func_end bg_get_field + + thumb_func_start bg_change_x_offset +bg_change_x_offset: @ 8001D04 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08001D28 + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + bne _08001D2E +_08001D28: + movs r0, 0x1 + negs r0, r0 + b _08001E34 +_08001D2E: + cmp r5, 0x1 + beq _08001D4C + cmp r5, 0x1 + ble _08001D3A + cmp r5, 0x2 + beq _08001D60 +_08001D3A: + ldr r0, _08001D48 + lsls r1, r4, 4 + adds r0, 0x8 + adds r0, r1, r0 + str r6, [r0] + adds r5, r1, 0 + b _08001D70 + .align 2, 0 +_08001D48: .4byte 0x030008f8 +_08001D4C: + ldr r0, _08001D5C + lsls r2, r4, 4 + adds r0, 0x8 + adds r0, r2, r0 + ldr r1, [r0] + adds r1, r6 + b _08001D6C + .align 2, 0 +_08001D5C: .4byte 0x030008f8 +_08001D60: + ldr r0, _08001D88 + lsls r2, r4, 4 + adds r0, 0x8 + adds r0, r2, r0 + ldr r1, [r0] + subs r1, r6 +_08001D6C: + str r1, [r0] + adds r5, r2, 0 +_08001D70: + bl gpu_get_bg_mode + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x1 + beq _08001DAC + cmp r4, 0x1 + bgt _08001D8C + cmp r4, 0 + beq _08001D96 + b _08001E2C + .align 2, 0 +_08001D88: .4byte 0x030008f8 +_08001D8C: + cmp r4, 0x2 + beq _08001DC0 + cmp r4, 0x3 + beq _08001DF8 + b _08001E2C +_08001D96: + ldr r0, _08001DA8 + ldr r0, [r0, 0x8] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x10 + bl lcd_io_set + b _08001E2C + .align 2, 0 +_08001DA8: .4byte 0x030008f8 +_08001DAC: + ldr r0, _08001DBC + ldr r0, [r0, 0x18] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x14 + bl lcd_io_set + b _08001E2C + .align 2, 0 +_08001DBC: .4byte 0x030008f8 +_08001DC0: + cmp r0, 0 + bne _08001DD8 + ldr r0, _08001DD4 + ldr r0, [r0, 0x28] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x18 + bl lcd_io_set + b _08001E2C + .align 2, 0 +_08001DD4: .4byte 0x030008f8 +_08001DD8: + ldr r0, _08001DF4 + ldr r0, [r0, 0x28] + lsrs r1, r0, 16 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x2A + bl lcd_io_set + movs r0, 0x28 + adds r1, r4, 0 + bl lcd_io_set + b _08001E2C + .align 2, 0 +_08001DF4: .4byte 0x030008f8 +_08001DF8: + cmp r0, 0 + bne _08001E10 + ldr r0, _08001E0C + ldr r0, [r0, 0x38] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x1C + bl lcd_io_set + b _08001E2C + .align 2, 0 +_08001E0C: .4byte 0x030008f8 +_08001E10: + cmp r0, 0x2 + bne _08001E2C + ldr r0, _08001E3C + ldr r0, [r0, 0x38] + lsrs r1, r0, 16 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x3A + bl lcd_io_set + movs r0, 0x38 + adds r1, r4, 0 + bl lcd_io_set +_08001E2C: + ldr r0, _08001E3C + adds r0, 0x8 + adds r0, r5, r0 + ldr r0, [r0] +_08001E34: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08001E3C: .4byte 0x030008f8 + thumb_func_end bg_change_x_offset + + thumb_func_start bg_get_x_offset +bg_get_x_offset: @ 8001E40 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08001E70 + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + beq _08001E70 + ldr r0, _08001E6C + lsls r1, r4, 4 + adds r0, 0x8 + adds r1, r0 + ldr r0, [r1] + b _08001E74 + .align 2, 0 +_08001E6C: .4byte 0x030008f8 +_08001E70: + movs r0, 0x1 + negs r0, r0 +_08001E74: + pop {r4} + pop {r1} + bx r1 + thumb_func_end bg_get_x_offset + + thumb_func_start bg_change_y_offset +bg_change_y_offset: @ 8001E7C + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08001EA0 + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + bne _08001EA6 +_08001EA0: + movs r0, 0x1 + negs r0, r0 + b _08001FAC +_08001EA6: + cmp r5, 0x1 + beq _08001EC4 + cmp r5, 0x1 + ble _08001EB2 + cmp r5, 0x2 + beq _08001ED8 +_08001EB2: + ldr r0, _08001EC0 + lsls r1, r4, 4 + adds r0, 0xC + adds r0, r1, r0 + str r6, [r0] + adds r5, r1, 0 + b _08001EE8 + .align 2, 0 +_08001EC0: .4byte 0x030008f8 +_08001EC4: + ldr r0, _08001ED4 + lsls r2, r4, 4 + adds r0, 0xC + adds r0, r2, r0 + ldr r1, [r0] + adds r1, r6 + b _08001EE4 + .align 2, 0 +_08001ED4: .4byte 0x030008f8 +_08001ED8: + ldr r0, _08001F00 + lsls r2, r4, 4 + adds r0, 0xC + adds r0, r2, r0 + ldr r1, [r0] + subs r1, r6 +_08001EE4: + str r1, [r0] + adds r5, r2, 0 +_08001EE8: + bl gpu_get_bg_mode + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x1 + beq _08001F24 + cmp r4, 0x1 + bgt _08001F04 + cmp r4, 0 + beq _08001F0E + b _08001FA4 + .align 2, 0 +_08001F00: .4byte 0x030008f8 +_08001F04: + cmp r4, 0x2 + beq _08001F38 + cmp r4, 0x3 + beq _08001F70 + b _08001FA4 +_08001F0E: + ldr r0, _08001F20 + ldr r0, [r0, 0xC] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x12 + bl lcd_io_set + b _08001FA4 + .align 2, 0 +_08001F20: .4byte 0x030008f8 +_08001F24: + ldr r0, _08001F34 + ldr r0, [r0, 0x1C] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x16 + bl lcd_io_set + b _08001FA4 + .align 2, 0 +_08001F34: .4byte 0x030008f8 +_08001F38: + cmp r0, 0 + bne _08001F50 + ldr r0, _08001F4C + ldr r0, [r0, 0x2C] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x1A + bl lcd_io_set + b _08001FA4 + .align 2, 0 +_08001F4C: .4byte 0x030008f8 +_08001F50: + ldr r0, _08001F6C + ldr r0, [r0, 0x2C] + lsrs r1, r0, 16 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x2E + bl lcd_io_set + movs r0, 0x2C + adds r1, r4, 0 + bl lcd_io_set + b _08001FA4 + .align 2, 0 +_08001F6C: .4byte 0x030008f8 +_08001F70: + cmp r0, 0 + bne _08001F88 + ldr r0, _08001F84 + ldr r0, [r0, 0x3C] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x1E + bl lcd_io_set + b _08001FA4 + .align 2, 0 +_08001F84: .4byte 0x030008f8 +_08001F88: + cmp r0, 0x2 + bne _08001FA4 + ldr r0, _08001FB4 + ldr r0, [r0, 0x3C] + lsrs r1, r0, 16 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x3E + bl lcd_io_set + movs r0, 0x3C + adds r1, r4, 0 + bl lcd_io_set +_08001FA4: + ldr r0, _08001FB4 + adds r0, 0xC + adds r0, r5, r0 + ldr r0, [r0] +_08001FAC: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08001FB4: .4byte 0x030008f8 + thumb_func_end bg_change_y_offset + + thumb_func_start bg_change_y_offset_to_copy_queue +bg_change_y_offset_to_copy_queue: @ 8001FB8 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08001FDC + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + bne _08001FE2 +_08001FDC: + movs r0, 0x1 + negs r0, r0 + b _080020E8 +_08001FE2: + cmp r5, 0x1 + beq _08002000 + cmp r5, 0x1 + ble _08001FEE + cmp r5, 0x2 + beq _08002014 +_08001FEE: + ldr r0, _08001FFC + lsls r1, r4, 4 + adds r0, 0xC + adds r0, r1, r0 + str r6, [r0] + adds r5, r1, 0 + b _08002024 + .align 2, 0 +_08001FFC: .4byte 0x030008f8 +_08002000: + ldr r0, _08002010 + lsls r2, r4, 4 + adds r0, 0xC + adds r0, r2, r0 + ldr r1, [r0] + adds r1, r6 + b _08002020 + .align 2, 0 +_08002010: .4byte 0x030008f8 +_08002014: + ldr r0, _0800203C + lsls r2, r4, 4 + adds r0, 0xC + adds r0, r2, r0 + ldr r1, [r0] + subs r1, r6 +_08002020: + str r1, [r0] + adds r5, r2, 0 +_08002024: + bl gpu_get_bg_mode + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x1 + beq _08002060 + cmp r4, 0x1 + bgt _08002040 + cmp r4, 0 + beq _0800204A + b _080020E0 + .align 2, 0 +_0800203C: .4byte 0x030008f8 +_08002040: + cmp r4, 0x2 + beq _08002074 + cmp r4, 0x3 + beq _080020AC + b _080020E0 +_0800204A: + ldr r0, _0800205C + ldr r0, [r0, 0xC] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x12 + bl lcd_io_set_forced_blank + b _080020E0 + .align 2, 0 +_0800205C: .4byte 0x030008f8 +_08002060: + ldr r0, _08002070 + ldr r0, [r0, 0x1C] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x16 + bl lcd_io_set_forced_blank + b _080020E0 + .align 2, 0 +_08002070: .4byte 0x030008f8 +_08002074: + cmp r0, 0 + bne _0800208C + ldr r0, _08002088 + ldr r0, [r0, 0x2C] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x1A + bl lcd_io_set_forced_blank + b _080020E0 + .align 2, 0 +_08002088: .4byte 0x030008f8 +_0800208C: + ldr r0, _080020A8 + ldr r0, [r0, 0x2C] + lsrs r1, r0, 16 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x2E + bl lcd_io_set_forced_blank + movs r0, 0x2C + adds r1, r4, 0 + bl lcd_io_set_forced_blank + b _080020E0 + .align 2, 0 +_080020A8: .4byte 0x030008f8 +_080020AC: + cmp r0, 0 + bne _080020C4 + ldr r0, _080020C0 + ldr r0, [r0, 0x3C] + lsls r0, 8 + lsrs r1, r0, 16 + movs r0, 0x1E + bl lcd_io_set_forced_blank + b _080020E0 + .align 2, 0 +_080020C0: .4byte 0x030008f8 +_080020C4: + cmp r0, 0x2 + bne _080020E0 + ldr r0, _080020F0 + ldr r0, [r0, 0x3C] + lsrs r1, r0, 16 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x3E + bl lcd_io_set_forced_blank + movs r0, 0x3C + adds r1, r4, 0 + bl lcd_io_set_forced_blank +_080020E0: + ldr r0, _080020F0 + adds r0, 0xC + adds r0, r5, r0 + ldr r0, [r0] +_080020E8: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080020F0: .4byte 0x030008f8 + thumb_func_end bg_change_y_offset_to_copy_queue + + thumb_func_start bg_get_y_offset +bg_get_y_offset: @ 80020F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08002124 + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + beq _08002124 + ldr r0, _08002120 + lsls r1, r4, 4 + adds r0, 0xC + adds r1, r0 + ldr r0, [r1] + b _08002128 + .align 2, 0 +_08002120: .4byte 0x030008f8 +_08002124: + movs r0, 0x1 + negs r0, r0 +_08002128: + pop {r4} + pop {r1} + bx r1 + thumb_func_end bg_get_y_offset + + thumb_func_start call_gpu_bg_affine_set +call_gpu_bg_affine_set: @ 8002130 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + ldr r6, [sp, 0x30] + ldr r7, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r7, 16 + lsrs r7, 16 + lsls r3, 16 + asrs r3, 16 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + lsls r6, 16 + asrs r6, 16 + str r6, [sp, 0x8] + str r7, [sp, 0xC] + bl gpu_bg_affine_set + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end call_gpu_bg_affine_set + + thumb_func_start mosaic_something +mosaic_something: @ 8002170 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0x4C + bl lcd_io_get + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0xF + movs r3, 0xF + ands r3, r5 + lsrs r2, r0, 20 + ands r2, r1 + movs r0, 0xFF + lsls r0, 8 + ands r5, r0 + cmp r6, 0x6 + bhi _080021C4 + lsls r0, r6, 2 + ldr r1, _080021A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080021A4: .4byte _080021A8 + .align 2, 0 +_080021A8: + .4byte _080021C4 + .4byte _080021CC + .4byte _080021D2 + .4byte _080021E4 + .4byte _080021FA + .4byte _08002200 + .4byte _08002212 +_080021C4: + movs r3, 0xF + ands r3, r4 + lsrs r2, r4, 4 + b _08002226 +_080021CC: + movs r3, 0xF + ands r3, r4 + b _08002226 +_080021D2: + lsls r0, r3, 16 + asrs r0, 16 + adds r0, r4 + cmp r0, 0xF + ble _080021E0 + movs r3, 0xF + b _08002226 +_080021E0: + adds r0, r3, r4 + b _080021F4 +_080021E4: + lsls r0, r3, 16 + asrs r0, 16 + subs r0, r4 + cmp r0, 0 + bge _080021F2 + movs r3, 0 + b _08002226 +_080021F2: + subs r0, r3, r4 +_080021F4: + lsls r0, 16 + lsrs r3, r0, 16 + b _08002226 +_080021FA: + movs r2, 0xF + ands r2, r4 + b _08002226 +_08002200: + lsls r0, r2, 16 + asrs r0, 16 + adds r0, r4 + cmp r0, 0xF + ble _0800220E + movs r2, 0xF + b _08002226 +_0800220E: + adds r0, r2, r4 + b _08002222 +_08002212: + lsls r0, r2, 16 + asrs r0, 16 + subs r0, r4 + cmp r0, 0 + bge _08002220 + movs r2, 0 + b _08002226 +_08002220: + subs r0, r2, r4 +_08002222: + lsls r0, 16 + lsrs r2, r0, 16 +_08002226: + lsls r0, r2, 16 + asrs r0, 12 + movs r1, 0xF0 + ands r0, r1 + orrs r5, r0 + lsls r0, r3, 16 + asrs r0, 16 + movs r1, 0xF + ands r0, r1 + orrs r5, r0 + lsls r0, r5, 16 + lsrs r5, r0, 16 + movs r0, 0x4C + adds r1, r5, 0 + bl lcd_io_set + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end mosaic_something + + thumb_func_start bg_set_tilemap +bg_set_tilemap: @ 8002250 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _0800227A + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + beq _0800227A + ldr r0, _08002280 + lsls r1, r4, 4 + adds r0, 0x4 + adds r1, r0 + str r5, [r1] +_0800227A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08002280: .4byte 0x030008f8 + thumb_func_end bg_set_tilemap + + thumb_func_start bg_unset_tilemap +bg_unset_tilemap: @ 8002284 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + adds r5, r0, 0 + cmp r5, 0 + bne _080022AE + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + beq _080022AE + ldr r0, _080022B4 + lsls r1, r4, 4 + adds r0, 0x4 + adds r1, r0 + str r5, [r1] +_080022AE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080022B4: .4byte 0x030008f8 + thumb_func_end bg_unset_tilemap + + thumb_func_start bg_get_tilemap +bg_get_tilemap: @ 80022B8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _080022E8 + adds r0, r4, 0 + movs r1, 0x1 + bl gpu_bg_config_get_field + lsls r0, 16 + cmp r0, 0 + beq _080022E8 + ldr r0, _080022E4 + lsls r1, r4, 4 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + b _080022EA + .align 2, 0 +_080022E4: .4byte 0x030008f8 +_080022E8: + movs r0, 0 +_080022EA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end bg_get_tilemap + + thumb_func_start gpu_copy_to_wram_bg_tile_map +gpu_copy_to_wram_bg_tile_map: @ 80022F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r9, r4 + lsls r7, r2, 16 + lsrs r6, r7, 16 + lsls r3, 16 + lsrs r5, r3, 16 + mov r8, r5 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _08002358 + adds r0, r4, 0 + bl IsTileMapOutsideWram + cmp r0, 0 + bne _08002358 + cmp r6, 0 + beq _08002340 + ldr r0, _0800233C + lsls r1, r4, 4 + adds r0, 0x4 + adds r1, r0 + lsls r0, r5, 1 + ldr r1, [r1] + adds r1, r0 + lsrs r2, r7, 17 + mov r0, r10 + bl CpuSet + b _08002358 + .align 2, 0 +_0800233C: .4byte 0x030008f8 +_08002340: + ldr r0, _08002368 + mov r2, r9 + lsls r1, r2, 4 + adds r0, 0x4 + adds r1, r0 + mov r2, r8 + lsls r0, r2, 1 + ldr r1, [r1] + adds r1, r0 + mov r0, r10 + bl LZ77UnCompWram +_08002358: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08002368: .4byte 0x030008f8 + thumb_func_end gpu_copy_to_wram_bg_tile_map + + thumb_func_start gpu_copy_wram_bg_tilemap_to_vram +gpu_copy_wram_bg_tilemap_to_vram: @ 800236C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _080023C8 + adds r0, r4, 0 + bl IsTileMapOutsideWram + cmp r0, 0 + bne _080023C8 + adds r0, r4, 0 + bl bg_get_type_by_bg_id + cmp r0, 0 + beq _0800239A + cmp r0, 0x1 + beq _080023A6 + movs r2, 0 + b _080023B2 +_0800239A: + adds r0, r4, 0 + movs r1, 0 + bl bg_get_screen_size_in_regular_mode + lsls r0, 27 + b _080023B0 +_080023A6: + adds r0, r4, 0 + movs r1, 0 + bl bg_get_screen_size_in_affine_mode + lsls r0, 24 +_080023B0: + lsrs r2, r0, 16 +_080023B2: + ldr r0, _080023D0 + lsls r1, r4, 4 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r3, 0 + bl gpu_copy_to_vram_by_bg_id +_080023C8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080023D0: .4byte 0x030008f8 + thumb_func_end gpu_copy_wram_bg_tilemap_to_vram + + thumb_func_start gpu_copy_to_iwram_tile_map_rect +gpu_copy_to_iwram_tile_map_rect: @ 80023D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r1 + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r4, 24 + lsrs r6, r4, 24 + adds r0, r5, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _080024C4 + adds r0, r5, 0 + bl IsTileMapOutsideWram + cmp r0, 0 + bne _080024C4 + adds r0, r5, 0 + bl bg_get_type_by_bg_id + cmp r0, 0 + beq _08002422 + cmp r0, 0x1 + beq _08002470 + b _080024C4 +_08002422: + mov r4, r8 + adds r3, r7, 0 + adds r0, r3, r6 + cmp r3, r0 + bge _080024C4 + mov r12, r0 + lsls r1, r5, 4 + ldr r0, _0800246C + adds r1, r0 + mov r8, r1 +_08002436: + mov r2, r10 + mov r1, r9 + adds r0, r2, r1 + adds r7, r3, 0x1 + cmp r2, r0 + bge _08002460 + mov r1, r8 + ldr r6, [r1] + lsls r5, r3, 5 + adds r3, r0, 0 +_0800244A: + adds r0, r5, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r4] + strh r1, [r0] + adds r4, 0x2 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + blt _0800244A +_08002460: + lsls r0, r7, 16 + lsrs r3, r0, 16 + cmp r3, r12 + blt _08002436 + b _080024C4 + .align 2, 0 +_0800246C: .4byte 0x030008fc +_08002470: + mov r4, r8 + adds r0, r5, 0 + movs r1, 0x1 + bl bg_get_screen_size_in_affine_mode + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + adds r3, r7, 0 + adds r0, r3, r6 + cmp r3, r0 + bge _080024C4 + mov r12, r0 + lsls r5, 4 + mov r8, r5 +_0800248E: + mov r2, r10 + mov r1, r9 + adds r0, r2, r1 + adds r7, r3, 0x1 + cmp r2, r0 + bge _080024BC + ldr r6, _080024D4 + add r6, r8 + ldr r1, [sp] + adds r5, r3, 0 + muls r5, r1 + adds r3, r0, 0 +_080024A6: + ldr r1, [r6] + adds r0, r5, r2 + adds r1, r0 + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x1 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + blt _080024A6 +_080024BC: + lsls r0, r7, 16 + lsrs r3, r0, 16 + cmp r3, r12 + blt _0800248E +_080024C4: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080024D4: .4byte 0x030008fc + thumb_func_end gpu_copy_to_iwram_tile_map_rect + + thumb_func_start bg_copy_tilemap_rect_simple +bg_copy_tilemap_rect_simple: @ 80024D8 + push {r4-r6,lr} + sub sp, 0x24 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r6, [sp, 0x3C] + 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 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + str r4, [sp, 0x10] + str r5, [sp, 0x14] + str r6, [sp, 0x18] + movs r2, 0 + str r2, [sp, 0x1C] + str r2, [sp, 0x20] + movs r3, 0 + bl bg_copy_tilemap_rect + add sp, 0x24 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end bg_copy_tilemap_rect_simple + + thumb_func_start bg_copy_tilemap_rect +bg_copy_tilemap_rect: @ 800251C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + str r1, [sp, 0x8] + ldr r1, [sp, 0x60] + ldr r4, [sp, 0x68] + ldr r5, [sp, 0x6C] + ldr r6, [sp, 0x70] + ldr r7, [sp, 0x74] + mov r8, r7 + ldr r7, [sp, 0x78] + mov r9, r7 + ldr r7, [sp, 0x7C] + mov r10, r7 + ldr r7, [sp, 0x80] + mov r12, r7 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x14] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x18] + mov r0, r8 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x1C] + mov r2, r10 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x20] + mov r0, r12 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x24] + ldr r0, [sp, 0x4] + bl is_invalid_bg_id_2 + cmp r0, 0 + beq _08002592 + b _080026EE +_08002592: + ldr r0, [sp, 0x4] + bl IsTileMapOutsideWram + cmp r0, 0 + beq _0800259E + b _080026EE +_0800259E: + ldr r0, [sp, 0x4] + movs r1, 0x4 + bl gpu_bg_config_get_field + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x30] + ldr r0, [sp, 0x4] + movs r1, 0x1 + bl bg_get_screen_size_in_regular_mode + lsls r0, 21 + lsrs r0, 16 + str r0, [sp, 0x28] + ldr r0, [sp, 0x4] + movs r1, 0x2 + bl bg_get_screen_size_in_regular_mode + lsls r0, 21 + lsrs r0, 16 + str r0, [sp, 0x2C] + ldr r0, [sp, 0x4] + bl bg_get_type_by_bg_id + cmp r0, 0 + beq _080025D8 + cmp r0, 0x1 + beq _08002674 + b _080026EE +_080025D8: + ldr r1, [sp, 0x10] + adds r0, r1, 0 + muls r0, r7 + ldr r2, [sp, 0xC] + adds r0, r2 + lsls r0, 1 + ldr r1, [sp, 0x8] + adds r6, r1, r0 + adds r0, r5, r4 + cmp r5, r0 + blt _080025F0 + b _080026EE +_080025F0: + ldr r2, [sp, 0x18] + subs r2, r7, r2 + str r2, [sp, 0x34] + str r0, [sp, 0x38] +_080025F8: + ldr r4, [sp, 0x14] + ldr r7, [sp, 0x18] + adds r0, r4, r7 + adds r1, r5, 0x1 + str r1, [sp, 0x3C] + cmp r4, r0 + bge _0800265A + ldr r2, [sp, 0x4] + lsls r0, r2, 4 + ldr r1, _08002670 + adds r0, r1 + mov r10, r0 + ldr r7, [sp, 0x20] + lsls r7, 16 + mov r9, r7 + ldr r1, [sp, 0x24] + lsls r0, r1, 16 + asrs r0, 16 + mov r8, r0 +_0800261E: + ldr r2, [sp, 0x2C] + str r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + ldr r2, [sp, 0x30] + ldr r3, [sp, 0x28] + bl bg_get_index_from_tile_coords + lsls r0, 16 + lsrs r0, 15 + mov r7, r10 + ldr r1, [r7] + adds r1, r0 + mov r0, r8 + str r0, [sp] + adds r0, r6, 0 + ldr r2, [sp, 0x1C] + mov r7, r9 + asrs r3, r7, 16 + bl bg_copy_tilemap_entry_not_rotscale_mode + adds r6, 0x2 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + cmp r4, r0 + blt _0800261E +_0800265A: + ldr r5, [sp, 0x34] + lsls r0, r5, 1 + adds r6, r0 + ldr r7, [sp, 0x3C] + lsls r0, r7, 16 + lsrs r5, r0, 16 + ldr r0, [sp, 0x38] + cmp r5, r0 + blt _080025F8 + b _080026EE + .align 2, 0 +_08002670: .4byte 0x030008fc +_08002674: + ldr r1, [sp, 0x10] + adds r0, r1, 0 + muls r0, r7 + ldr r2, [sp, 0xC] + adds r0, r2 + ldr r1, [sp, 0x8] + adds r6, r1, r0 + ldr r0, [sp, 0x4] + movs r1, 0x1 + bl bg_get_screen_size_in_affine_mode + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + adds r0, r5, r4 + cmp r5, r0 + bge _080026EE + ldr r2, [sp, 0x18] + subs r2, r7, r2 + str r2, [sp, 0x34] + str r0, [sp, 0x38] + ldr r7, _08002700 + mov r10, r7 + ldr r0, [sp, 0x4] + lsls r0, 4 + mov r8, r0 +_080026A8: + ldr r4, [sp, 0x14] + ldr r1, [sp, 0x18] + adds r0, r4, r1 + adds r2, r5, 0x1 + str r2, [sp, 0x3C] + cmp r4, r0 + bge _080026DE + mov r3, r8 + add r3, r10 + mov r7, r9 + muls r7, r5 + mov r12, r7 + adds r2, r0, 0 +_080026C2: + ldr r1, [r3] + mov r5, r12 + adds r0, r5, r4 + adds r1, r0 + ldrb r0, [r6] + ldr r7, [sp, 0x20] + adds r0, r7 + strb r0, [r1] + adds r6, 0x1 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r2 + blt _080026C2 +_080026DE: + ldr r0, [sp, 0x34] + adds r6, r0 + ldr r1, [sp, 0x3C] + lsls r0, r1, 16 + lsrs r5, r0, 16 + ldr r2, [sp, 0x38] + cmp r5, r2 + blt _080026A8 +_080026EE: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08002700: .4byte 0x030008fc + thumb_func_end bg_copy_tilemap_rect + + thumb_func_start bg_fill_tilemap_rect +bg_fill_tilemap_rect: @ 8002704 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl is_invalid_bg_id_2 + cmp r0, 0 + bne _080027F0 + adds r0, r6, 0 + bl IsTileMapOutsideWram + cmp r0, 0 + bne _080027F0 + adds r0, r6, 0 + bl bg_get_type_by_bg_id + cmp r0, 0 + beq _08002756 + cmp r0, 0x1 + beq _080027A0 + b _080027F0 +_08002756: + adds r3, r7, 0 + adds r5, r3, r5 + cmp r3, r5 + bge _080027F0 + adds r7, r5, 0 + lsls r1, r6, 4 + ldr r0, _0800279C + adds r1, r0 + mov r12, r1 +_08002768: + mov r2, r10 + mov r1, r9 + adds r0, r2, r1 + adds r6, r3, 0x1 + cmp r2, r0 + bge _08002790 + mov r5, r12 + ldr r4, [r5] + lsls r3, 5 + adds r1, r0, 0 +_0800277C: + adds r0, r3, r2 + lsls r0, 1 + adds r0, r4 + mov r5, r8 + strh r5, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r1 + blt _0800277C +_08002790: + lsls r0, r6, 16 + lsrs r3, r0, 16 + cmp r3, r7 + blt _08002768 + b _080027F0 + .align 2, 0 +_0800279C: .4byte 0x030008fc +_080027A0: + adds r0, r6, 0 + movs r1, 0x1 + bl bg_get_screen_size_in_affine_mode + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + adds r3, r7, 0 + adds r5, r3, r5 + cmp r3, r5 + bge _080027F0 + adds r7, r5, 0 + lsls r6, 4 + mov r12, r6 +_080027BC: + mov r2, r10 + mov r1, r9 + adds r0, r2, r1 + adds r6, r3, 0x1 + cmp r2, r0 + bge _080027E8 + ldr r5, _08002800 + add r5, r12 + ldr r1, [sp] + adds r4, r3, 0 + muls r4, r1 + adds r3, r0, 0 +_080027D4: + ldr r0, [r5] + adds r1, r4, r2 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + blt _080027D4 +_080027E8: + lsls r0, r6, 16 + lsrs r3, r0, 16 + cmp r3, r7 + blt _080027BC +_080027F0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08002800: .4byte 0x030008fc + thumb_func_end bg_fill_tilemap_rect + + thumb_func_start Bg_FillWramTileMapRectWithTileAndPalette +Bg_FillWramTileMapRectWithTileAndPalette: @ 8002804 + push {r4-r6,lr} + sub sp, 0x10 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + 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 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r4, 0 + str r4, [sp, 0xC] + bl bg_write_sequence_to_wram_tile_map_rect + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end Bg_FillWramTileMapRectWithTileAndPalette + + thumb_func_start bg_write_sequence_to_wram_tile_map_rect +bg_write_sequence_to_wram_tile_map_rect: @ 8002840 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + ldr r4, [sp, 0x4C] + ldr r5, [sp, 0x50] + ldr r6, [sp, 0x54] + ldr r7, [sp, 0x58] + mov r8, r7 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + add r0, sp, 0x4 + strh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x8] + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r4, r5, 24 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0xC] + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + mov r0, r9 + bl is_invalid_bg_id_2 + cmp r0, 0 + beq _0800288E + b _080029D4 +_0800288E: + mov r0, r9 + bl IsTileMapOutsideWram + cmp r0, 0 + beq _0800289A + b _080029D4 +_0800289A: + mov r0, r9 + movs r1, 0x4 + bl gpu_bg_config_get_field + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x1C] + mov r0, r9 + movs r1, 0x1 + bl bg_get_screen_size_in_regular_mode + lsls r0, 21 + lsrs r0, 16 + str r0, [sp, 0x14] + mov r0, r9 + movs r1, 0x2 + bl bg_get_screen_size_in_regular_mode + lsls r0, 21 + lsrs r0, 16 + str r0, [sp, 0x18] + mov r0, r9 + bl bg_get_type_by_bg_id + cmp r0, 0 + beq _080028D4 + cmp r0, 0x1 + beq _0800295C + b _080029D4 +_080028D4: + adds r5, r7, 0 + adds r0, r5, r4 + cmp r5, r0 + bge _080029D4 + str r0, [sp, 0x24] + add r7, sp, 0x4 +_080028E0: + ldr r4, [sp, 0x8] + mov r1, r10 + adds r0, r4, r1 + adds r2, r5, 0x1 + mov r8, r2 + cmp r4, r0 + bge _08002944 + mov r3, r9 + lsls r1, r3, 4 + ldr r0, _08002954 + adds r6, r1, r0 +_080028F6: + ldr r0, [sp, 0x18] + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + ldr r3, [sp, 0x14] + bl bg_get_index_from_tile_coords + lsls r0, 16 + lsrs r0, 15 + ldr r1, [r6] + adds r1, r0 + movs r0, 0 + str r0, [sp] + add r0, sp, 0x4 + ldr r2, [sp, 0xC] + movs r3, 0 + bl bg_copy_tilemap_entry_not_rotscale_mode + ldrh r0, [r7] + movs r2, 0xFC + lsls r2, 8 + adds r1, r2, 0 + adds r2, r0, 0 + ands r2, r1 + ldr r3, [sp, 0x10] + adds r0, r3 + ldr r3, _08002958 + adds r1, r3, 0 + ands r0, r1 + adds r2, r0 + strh r2, [r7] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [sp, 0x8] + add r0, r10 + cmp r4, r0 + blt _080028F6 +_08002944: + mov r1, r8 + lsls r0, r1, 16 + lsrs r5, r0, 16 + ldr r2, [sp, 0x24] + cmp r5, r2 + blt _080028E0 + b _080029D4 + .align 2, 0 +_08002954: .4byte 0x030008fc +_08002958: .4byte 0x000003ff +_0800295C: + mov r0, r9 + movs r1, 0x1 + bl bg_get_screen_size_in_affine_mode + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x20] + adds r5, r7, 0 + adds r0, r5, r4 + cmp r5, r0 + bge _080029D4 + str r0, [sp, 0x24] + mov r3, r9 + lsls r3, 4 + mov r12, r3 +_0800297A: + ldr r4, [sp, 0x8] + mov r7, r10 + adds r0, r4, r7 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r0 + bge _080029C8 + ldr r2, _080029E4 + add r2, r12 + str r2, [sp, 0x28] + ldr r7, [sp, 0x20] + adds r3, r5, 0 + muls r3, r7 + add r2, sp, 0x4 + movs r1, 0xFC + lsls r1, 8 + mov r9, r1 + ldr r7, _080029E8 + adds r5, r7, 0 + adds r6, r0, 0 +_080029A2: + ldr r0, [sp, 0x28] + ldr r1, [r0] + adds r0, r3, r4 + adds r1, r0 + ldrh r0, [r2] + strb r0, [r1] + ldrh r0, [r2] + mov r1, r9 + ands r1, r0 + ldr r7, [sp, 0x10] + adds r0, r7 + ands r0, r5 + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r6 + blt _080029A2 +_080029C8: + mov r1, r8 + lsls r0, r1, 16 + lsrs r5, r0, 16 + ldr r2, [sp, 0x24] + cmp r5, r2 + blt _0800297A +_080029D4: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080029E4: .4byte 0x030008fc +_080029E8: .4byte 0x000003ff + thumb_func_end bg_write_sequence_to_wram_tile_map_rect + + thumb_func_start bg_get_screen_size_in_regular_mode +bg_get_screen_size_in_regular_mode: @ 80029EC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + movs r1, 0x4 + bl gpu_bg_config_get_field + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x1 + beq _08002A2C + cmp r4, 0x1 + bgt _08002A10 + cmp r4, 0 + beq _08002A16 + b _08002A52 +_08002A10: + cmp r5, 0x2 + beq _08002A3E + b _08002A52 +_08002A16: + cmp r0, 0x2 + bgt _08002A24 + cmp r0, 0x1 + bge _08002A4E +_08002A1E: + cmp r0, 0 + beq _08002A46 + b _08002A52 +_08002A24: + cmp r0, 0x3 + bne _08002A52 + movs r0, 0x4 + b _08002A54 +_08002A2C: + cmp r0, 0x1 + beq _08002A4E + cmp r0, 0x1 + ble _08002A1E + cmp r0, 0x2 + beq _08002A46 + cmp r0, 0x3 + bne _08002A52 + b _08002A4E +_08002A3E: + cmp r0, 0 + blt _08002A52 + cmp r0, 0x1 + bgt _08002A4A +_08002A46: + movs r0, 0x1 + b _08002A54 +_08002A4A: + cmp r0, 0x3 + bgt _08002A52 +_08002A4E: + movs r0, 0x2 + b _08002A54 +_08002A52: + movs r0, 0 +_08002A54: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end bg_get_screen_size_in_regular_mode + + thumb_func_start bg_get_screen_size_in_affine_mode +bg_get_screen_size_in_affine_mode: @ 8002A5C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r1, 0x4 + bl gpu_bg_config_get_field + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r1, 0 + cmp r4, 0 + beq _08002A84 + cmp r4, 0 + blt _08002AAC + cmp r4, 0x2 + bgt _08002AAC + movs r0, 0x10 + lsls r0, r1 + b _08002AAE +_08002A84: + cmp r1, 0x1 + beq _08002AA0 + cmp r1, 0x1 + bgt _08002A92 + cmp r1, 0 + beq _08002A9C + b _08002AAC +_08002A92: + cmp r0, 0x2 + beq _08002AA4 + cmp r0, 0x3 + beq _08002AA8 + b _08002AAC +_08002A9C: + movs r0, 0x1 + b _08002AAE +_08002AA0: + movs r0, 0x4 + b _08002AAE +_08002AA4: + movs r0, 0x10 + b _08002AAE +_08002AA8: + movs r0, 0x40 + b _08002AAE +_08002AAC: + movs r0, 0 +_08002AAE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end bg_get_screen_size_in_affine_mode + + thumb_func_start bg_get_index_from_tile_coords +bg_get_index_from_tile_coords: @ 8002AB4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [sp, 0x8] + subs r3, 0x1 + ands r4, r3 + subs r0, 0x1 + ands r1, r0 + cmp r2, 0x1 + beq _08002AD8 + cmp r2, 0x1 + ble _08002AE0 + cmp r2, 0x2 + beq _08002AE0 + cmp r2, 0x3 + bne _08002AE0 + cmp r1, 0x1F + ble _08002AD8 + adds r1, 0x20 +_08002AD8: + cmp r4, 0x1F + ble _08002AE0 + subs r4, 0x20 + adds r1, 0x20 +_08002AE0: + lsls r0, r1, 5 + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end bg_get_index_from_tile_coords + + thumb_func_start bg_copy_tilemap_entry_not_rotscale_mode +bg_copy_tilemap_entry_not_rotscale_mode: @ 8002AEC + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r5, [sp, 0x10] + cmp r2, 0x10 + beq _08002B14 + cmp r2, 0x10 + bgt _08002B34 + cmp r2, 0 + blt _08002B34 + ldrh r0, [r4] + adds r0, r3 + ldr r3, _08002B10 + adds r1, r3, 0 + ands r0, r1 + adds r1, r2, r5 + lsls r1, 12 + b _08002B3A + .align 2, 0 +_08002B10: .4byte 0x00000fff +_08002B14: + ldrh r1, [r6] + movs r0, 0xFC + lsls r0, 8 + ands r1, r0 + lsls r2, r5, 12 + adds r2, r1, r2 + ldrh r0, [r4] + adds r0, r3 + ldr r3, _08002B30 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + b _08002B3C + .align 2, 0 +_08002B30: .4byte 0x000003ff +_08002B34: + ldrh r0, [r4] + adds r0, r3 + lsls r1, r5, 12 +_08002B3A: + adds r0, r1 +_08002B3C: + lsls r0, 16 + lsrs r1, r0, 16 + strh r1, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end bg_copy_tilemap_entry_not_rotscale_mode + + thumb_func_start bg_get_type_by_bg_id +bg_get_type_by_bg_id: @ 8002B48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl gpu_get_bg_mode + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x2 + beq _08002B76 + cmp r4, 0x2 + ble _08002B66 + cmp r4, 0x3 + beq _08002B86 + b _08002B8E +_08002B66: + cmp r5, 0 + blt _08002B8E + cmp r0, 0x1 + bgt _08002B8E + cmp r0, 0 + blt _08002B8E +_08002B72: + movs r0, 0 + b _08002B90 +_08002B76: + cmp r0, 0 + beq _08002B72 + cmp r0, 0 + blt _08002B8E + cmp r0, 0x2 + bgt _08002B8E +_08002B82: + movs r0, 0x1 + b _08002B90 +_08002B86: + cmp r0, 0 + beq _08002B72 + cmp r0, 0x2 + beq _08002B82 +_08002B8E: + ldr r0, _08002B98 +_08002B90: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08002B98: .4byte 0x0000ffff + thumb_func_end bg_get_type_by_bg_id + + thumb_func_start is_invalid_bg_id_2 +is_invalid_bg_id_2: @ 8002B9C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _08002BAA + movs r0, 0 + b _08002BAC +_08002BAA: + movs r0, 0x1 +_08002BAC: + pop {r1} + bx r1 + thumb_func_end is_invalid_bg_id_2 + + thumb_func_start IsTileMapOutsideWram +IsTileMapOutsideWram: @ 8002BB0 + push {lr} + lsls r0, 24 + ldr r1, _08002BCC + lsrs r0, 20 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + ldr r0, _08002BD0 + cmp r1, r0 + bhi _08002BD4 + cmp r1, 0 + beq _08002BD4 + movs r0, 0 + b _08002BD6 + .align 2, 0 +_08002BCC: .4byte 0x030008f8 +_08002BD0: .4byte 0x03008000 +_08002BD4: + movs r0, 0x1 +_08002BD6: + pop {r1} + bx r1 + thumb_func_end IsTileMapOutsideWram + + thumb_func_start sub_8002BDC +sub_8002BDC: @ 8002BDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r7, 16 + lsrs r7, 16 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + movs r4, 0xFF + str r4, [sp, 0x10] + bl PixelBlock_CopyRect4Bpp + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8002BDC + + thumb_func_start PixelBlock_CopyRect4Bpp +PixelBlock_CopyRect4Bpp: @ 8002C20 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r4, [sp, 0x54] + ldr r5, [sp, 0x58] + ldr r6, [sp, 0x5C] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r7, r3, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x10] + ldr r0, [sp, 0x4] + ldrh r3, [r0, 0x4] + ldr r1, [sp, 0xC] + subs r0, r3, r1 + adds r2, r4 + mov r8, r2 + cmp r0, r4 + bge _08002C74 + ldr r2, [sp, 0x8] + adds r0, r2 + mov r8, r0 +_08002C74: + ldr r4, [sp, 0x4] + ldrh r0, [r4, 0x6] + mov r1, r9 + subs r0, r1 + adds r2, r5, r7 + str r2, [sp, 0x14] + cmp r0, r5 + bge _08002C88 + adds r0, r7 + str r0, [sp, 0x14] +_08002C88: + ldr r4, [sp] + ldrh r1, [r4, 0x4] + movs r2, 0x7 + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x18] + adds r0, r3, 0 + ands r0, r2 + adds r0, r3, r0 + asrs r0, 3 + str r0, [sp, 0x1C] + ldr r0, [sp, 0x10] + cmp r0, 0xFF + bne _08002D46 + adds r3, r7, 0 + mov r1, r9 + ldr r2, [sp, 0x14] + cmp r3, r2 + blt _08002CB4 + b _08002DEE +_08002CB4: + ldr r5, [sp, 0x8] + ldr r6, [sp, 0xC] + adds r4, r3, 0x1 + str r4, [sp, 0x24] + adds r0, r1, 0x1 + str r0, [sp, 0x28] + cmp r5, r8 + bge _08002D3A + movs r7, 0x3 + asrs r0, r3, 3 + ldr r2, [sp, 0x18] + muls r0, r2 + lsls r0, 5 + mov r10, r0 + lsls r0, r3, 29 + lsrs r0, 27 + mov r9, r0 + asrs r0, r1, 3 + ldr r4, [sp, 0x1C] + muls r0, r4 + lsls r0, 5 + mov r12, r0 + lsls r0, r1, 29 + lsrs r3, r0, 27 +_08002CE4: + asrs r0, r5, 1 + ands r0, r7 + ldr r2, [sp] + ldr r1, [r2] + adds r1, r0 + asrs r0, r5, 3 + lsls r0, 5 + adds r1, r0 + add r1, r10 + mov r4, r9 + adds r2, r1, r4 + asrs r0, r6, 1 + ands r0, r7 + ldr r4, [sp, 0x4] + ldr r1, [r4] + adds r1, r0 + asrs r0, r6, 3 + lsls r0, 5 + adds r1, r0 + add r1, r12 + adds r4, r1, r3 + ldrb r2, [r2] + adds r0, r5, 0 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + adds r0, r6, 0 + ands r0, r1 + lsls r1, r0, 2 + lsls r2, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r4] + ands r0, r1 + orrs r2, r0 + strb r2, [r4] + adds r5, 0x1 + adds r6, 0x1 + cmp r5, r8 + blt _08002CE4 +_08002D3A: + ldr r3, [sp, 0x24] + ldr r1, [sp, 0x28] + ldr r2, [sp, 0x14] + cmp r3, r2 + blt _08002CB4 + b _08002DEE +_08002D46: + adds r3, r7, 0 + mov r1, r9 + ldr r4, [sp, 0x14] + cmp r3, r4 + bge _08002DEE +_08002D50: + ldr r5, [sp, 0x8] + ldr r6, [sp, 0xC] + adds r0, r3, 0x1 + str r0, [sp, 0x24] + adds r2, r1, 0x1 + str r2, [sp, 0x28] + cmp r5, r8 + bge _08002DE4 + movs r4, 0x3 + mov r9, r4 + asrs r0, r3, 3 + ldr r2, [sp, 0x18] + muls r0, r2 + lsls r0, 5 + str r0, [sp, 0x20] + lsls r0, r3, 29 + lsrs r0, 27 + mov r10, r0 + movs r3, 0x1 + asrs r0, r1, 3 + ldr r4, [sp, 0x1C] + muls r0, r4 + lsls r0, 5 + mov r12, r0 + lsls r0, r1, 29 + lsrs r7, r0, 27 +_08002D84: + asrs r0, r5, 1 + mov r1, r9 + ands r0, r1 + ldr r2, [sp] + ldr r1, [r2] + adds r1, r0 + asrs r0, r5, 3 + lsls r0, 5 + adds r1, r0 + ldr r4, [sp, 0x20] + adds r1, r4 + mov r0, r10 + adds r2, r1, r0 + asrs r0, r6, 1 + mov r1, r9 + ands r0, r1 + ldr r4, [sp, 0x4] + ldr r1, [r4] + adds r1, r0 + asrs r0, r6, 3 + lsls r0, 5 + adds r1, r0 + add r1, r12 + adds r4, r1, r7 + ldrb r2, [r2] + adds r0, r5, 0 + ands r0, r3 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + ldr r0, [sp, 0x10] + cmp r2, r0 + beq _08002DDC + adds r0, r6, 0 + ands r0, r3 + lsls r1, r0, 2 + lsls r2, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r4] + ands r0, r1 + orrs r2, r0 + strb r2, [r4] +_08002DDC: + adds r5, 0x1 + adds r6, 0x1 + cmp r5, r8 + blt _08002D84 +_08002DE4: + ldr r3, [sp, 0x24] + ldr r1, [sp, 0x28] + ldr r2, [sp, 0x14] + cmp r3, r2 + blt _08002D50 +_08002DEE: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PixelBlock_CopyRect4Bpp + + thumb_func_start PixelBlock_FillRect4Bpp +PixelBlock_FillRect4Bpp: @ 8002E00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r0 + ldr r0, [sp, 0x28] + ldr r4, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r2, 16 + lsrs r2, 16 + adds r6, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r5, r4, 24 + adds r4, r1, r3 + mov r3, r9 + ldrh r1, [r3, 0x4] + cmp r4, r1 + ble _08002E36 + adds r4, r1, 0 +_08002E36: + adds r2, r0 + mov r12, r2 + mov r2, r9 + ldrh r0, [r2, 0x6] + cmp r12, r0 + ble _08002E44 + mov r12, r0 +_08002E44: + movs r0, 0x7 + ands r0, r1 + adds r0, r1, r0 + asrs r0, 3 + str r0, [sp, 0x4] + lsls r0, r5, 28 + lsrs r0, 24 + mov r8, r0 + movs r3, 0xF + mov r10, r3 + mov r0, r10 + ands r0, r5 + mov r10, r0 + adds r1, r6, 0 + cmp r1, r12 + bge _08002EB6 +_08002E64: + ldr r3, [sp] + adds r7, r1, 0x1 + cmp r3, r4 + bge _08002EB0 + asrs r0, r1, 3 + ldr r2, [sp, 0x4] + muls r0, r2 + lsls r6, r0, 5 + lsls r0, r1, 29 + lsrs r5, r0, 27 +_08002E78: + asrs r2, r3, 1 + movs r0, 0x3 + ands r2, r0 + mov r0, r9 + ldr r1, [r0] + adds r1, r2 + asrs r0, r3, 3 + lsls r0, 5 + adds r1, r0 + adds r1, r6 + adds r2, r1, r5 + lsls r0, r3, 31 + cmp r0, 0 + beq _08002E9E + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + mov r1, r8 + b _08002EA6 +_08002E9E: + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + mov r1, r10 +_08002EA6: + orrs r0, r1 + strb r0, [r2] + adds r3, 0x1 + cmp r3, r4 + blt _08002E78 +_08002EB0: + adds r1, r7, 0 + cmp r1, r12 + blt _08002E64 +_08002EB6: + 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 PixelBlock_FillRect4Bpp + + thumb_func_start PixelBlock_CopyRect4BppTo8Bpp +PixelBlock_CopyRect4BppTo8Bpp: @ 8002EC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x60] + ldr r5, [sp, 0x64] + ldr r4, [sp, 0x68] + ldr r6, [sp, 0x6C] + ldr r7, [sp, 0x70] + mov r8, r7 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x10] + mov r0, r8 + lsls r0, 28 + lsrs r0, 24 + str r0, [sp, 0x14] + lsls r0, r6, 28 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r1, [sp, 0x4] + ldrh r0, [r1, 0x4] + ldr r2, [sp, 0xC] + subs r0, r2 + ldr r1, [sp, 0x8] + adds r1, r5, r1 + str r1, [sp, 0x18] + cmp r0, r5 + bge _08002F2E + ldr r2, [sp, 0x8] + adds r0, r2 + str r0, [sp, 0x18] +_08002F2E: + ldr r5, [sp, 0x4] + ldrh r1, [r5, 0x6] + subs r0, r1, r7 + cmp r0, r4 + bge _08002F40 + adds r0, r3, r1 + subs r0, r7 + str r0, [sp, 0x1C] + b _08002F44 +_08002F40: + adds r4, r3, r4 + str r4, [sp, 0x1C] +_08002F44: + ldr r0, [sp] + ldrh r1, [r0, 0x4] + movs r2, 0x7 + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x20] + ldr r5, [sp, 0x4] + ldrh r1, [r5, 0x4] + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x24] + ldr r0, [sp, 0x10] + cmp r0, 0xFF + bne _08003024 + adds r2, r3, 0 + adds r5, r7, 0 + ldr r1, [sp, 0x1C] + cmp r2, r1 + blt _08002F74 + b _08003106 +_08002F74: + ldr r3, [sp, 0x8] + lsrs r3, 1 + str r3, [sp, 0x2C] + movs r0, 0x3 + ands r3, r0 + str r3, [sp, 0x2C] + ldr r7, [sp, 0x8] + lsrs r0, r7, 3 + lsls r0, 5 + str r0, [sp, 0x30] +_08002F88: + ldr r0, [sp] + ldr r1, [r0] + ldr r3, [sp, 0x2C] + adds r1, r3 + ldr r7, [sp, 0x30] + adds r1, r7 + asrs r0, r2, 3 + ldr r3, [sp, 0x20] + muls r0, r3 + lsls r0, 5 + mov r8, r0 + add r1, r8 + lsls r0, r2, 29 + lsrs r7, r0, 27 + adds r6, r1, r7 + ldr r3, [sp, 0x8] + ldr r4, [sp, 0xC] + adds r2, 0x1 + mov r10, r2 + adds r0, r5, 0x1 + str r0, [sp, 0x38] + ldr r1, [sp, 0x18] + cmp r3, r1 + bge _08003018 + asrs r0, r5, 3 + ldr r2, [sp, 0x24] + muls r0, r2 + lsls r0, 6 + mov r12, r0 + lsls r0, r5, 29 + lsrs r0, 26 + mov r9, r0 +_08002FC8: + movs r0, 0x7 + ands r0, r4 + ldr r5, [sp, 0x4] + ldr r1, [r5] + adds r1, r0 + asrs r0, r4, 3 + lsls r0, 6 + adds r1, r0 + add r1, r12 + mov r0, r9 + adds r5, r1, r0 + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _08002FEC + ldrb r0, [r6] + lsrs r0, 4 + b _08003008 +_08002FEC: + asrs r2, r3, 1 + movs r0, 0x3 + ands r2, r0 + ldr r0, [sp] + ldr r1, [r0] + adds r1, r2 + asrs r0, r3, 3 + lsls r0, 5 + adds r1, r0 + add r1, r8 + adds r6, r1, r7 + ldrb r1, [r6] + movs r0, 0xF + ands r0, r1 +_08003008: + ldr r1, [sp, 0x14] + adds r0, r1, r0 + strb r0, [r5] + adds r3, 0x1 + adds r4, 0x1 + ldr r2, [sp, 0x18] + cmp r3, r2 + blt _08002FC8 +_08003018: + mov r2, r10 + ldr r5, [sp, 0x38] + ldr r3, [sp, 0x1C] + cmp r2, r3 + blt _08002F88 + b _08003106 +_08003024: + adds r2, r3, 0 + adds r5, r7, 0 + ldr r7, [sp, 0x1C] + cmp r2, r7 + bge _08003106 + ldr r0, [sp, 0x8] + lsrs r0, 1 + str r0, [sp, 0x34] + movs r0, 0x3 + ldr r1, [sp, 0x34] + ands r1, r0 + str r1, [sp, 0x34] +_0800303C: + ldr r3, [sp] + ldr r1, [r3] + ldr r7, [sp, 0x34] + adds r1, r7 + ldr r3, [sp, 0x8] + lsrs r0, r3, 3 + lsls r0, 5 + adds r1, r0 + asrs r0, r2, 3 + ldr r7, [sp, 0x20] + muls r0, r7 + lsls r0, 5 + mov r8, r0 + add r1, r8 + lsls r0, r2, 29 + lsrs r7, r0, 27 + adds r6, r1, r7 + ldr r4, [sp, 0xC] + adds r2, 0x1 + mov r10, r2 + adds r0, r5, 0x1 + str r0, [sp, 0x38] + ldr r1, [sp, 0x18] + cmp r3, r1 + bge _080030FC + asrs r0, r5, 3 + ldr r2, [sp, 0x24] + muls r0, r2 + lsls r0, 6 + mov r9, r0 + lsls r0, r5, 29 + lsrs r0, 26 + mov r12, r0 +_0800307E: + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _080030B2 + ldrb r2, [r6] + movs r0, 0xF0 + ands r0, r2 + ldr r5, [sp, 0x28] + cmp r0, r5 + beq _080030F2 + adds r0, r4, 0 + movs r1, 0x7 + ands r0, r1 + ldr r5, [sp, 0x4] + ldr r1, [r5] + adds r1, r0 + asrs r0, r4, 3 + lsls r0, 6 + adds r1, r0 + add r1, r9 + mov r0, r12 + adds r5, r1, r0 + lsrs r0, r2, 4 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + b _080030F0 +_080030B2: + asrs r2, r3, 1 + movs r0, 0x3 + ands r2, r0 + ldr r5, [sp] + ldr r1, [r5] + adds r1, r2 + asrs r0, r3, 3 + lsls r0, 5 + adds r1, r0 + add r1, r8 + adds r6, r1, r7 + ldrb r0, [r6] + movs r2, 0xF + ands r2, r0 + ldr r0, [sp, 0x10] + cmp r2, r0 + beq _080030F2 + adds r0, r4, 0 + movs r1, 0x7 + ands r0, r1 + ldr r5, [sp, 0x4] + ldr r1, [r5] + adds r1, r0 + asrs r0, r4, 3 + lsls r0, 6 + adds r1, r0 + add r1, r9 + mov r0, r12 + adds r5, r1, r0 + ldr r1, [sp, 0x14] + adds r0, r1, r2 +_080030F0: + strb r0, [r5] +_080030F2: + adds r3, 0x1 + adds r4, 0x1 + ldr r2, [sp, 0x18] + cmp r3, r2 + blt _0800307E +_080030FC: + mov r2, r10 + ldr r5, [sp, 0x38] + ldr r3, [sp, 0x1C] + cmp r2, r3 + blt _0800303C +_08003106: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PixelBlock_CopyRect4BppTo8Bpp + + thumb_func_start PixelBlock_FillRect8Bpp +PixelBlock_FillRect8Bpp: @ 8003118 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + ldr r0, [sp, 0x28] + ldr r4, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + adds r6, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + adds r5, r1, r3 + mov r3, r8 + ldrh r1, [r3, 0x4] + cmp r5, r1 + ble _08003150 + adds r5, r1, 0 +_08003150: + adds r7, r2, r0 + mov r2, r8 + ldrh r0, [r2, 0x6] + cmp r7, r0 + ble _0800315C + adds r7, r0, 0 +_0800315C: + movs r0, 0x7 + ands r0, r1 + adds r0, r1, r0 + asrs r0, 3 + str r0, [sp] + adds r1, r6, 0 + cmp r1, r7 + bge _080031AC +_0800316C: + mov r3, r10 + adds r6, r1, 0x1 + str r6, [sp, 0x4] + cmp r3, r5 + bge _080031A6 + movs r0, 0x7 + mov r12, r0 + asrs r0, r1, 3 + ldr r2, [sp] + muls r0, r2 + lsls r4, r0, 6 + lsls r0, r1, 29 + lsrs r2, r0, 26 +_08003186: + adds r0, r3, 0 + mov r6, r12 + ands r0, r6 + mov r6, r8 + ldr r1, [r6] + adds r1, r0 + asrs r0, r3, 3 + lsls r0, 6 + adds r1, r0 + adds r1, r4 + adds r1, r2 + mov r0, r9 + strb r0, [r1] + adds r3, 0x1 + cmp r3, r5 + blt _08003186 +_080031A6: + ldr r1, [sp, 0x4] + cmp r1, r7 + blt _0800316C +_080031AC: + 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 PixelBlock_FillRect8Bpp + + thumb_func_start nullsub_8 +nullsub_8: @ 80031BC + bx lr + thumb_func_end nullsub_8 + + thumb_func_start Window_InitFromTemplates +Window_InitFromTemplates: @ 80031C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + movs r0, 0 + mov r8, r0 + ldr r4, _08003254 +_080031D4: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + bl bg_get_tilemap + cmp r0, 0 + beq _080031E4 + ldr r0, _08003258 +_080031E4: + str r0, [r4] + adds r4, 0x4 + movs r2, 0x1 + add r8, r2 + mov r0, r8 + cmp r0, 0x3 + ble _080031D4 + ldr r0, _0800325C + ldr r2, [r0] + ldr r3, [r0, 0x4] + ldr r1, _08003260 + movs r0, 0 + movs r4, 0x1F + mov r8, r4 +_08003200: + str r2, [r1] + str r3, [r1, 0x4] + str r0, [r1, 0x8] + adds r1, 0xC + movs r4, 0x1 + negs r4, r4 + add r8, r4 + mov r4, r8 + cmp r4, 0 + bge _08003200 + movs r0, 0 + mov r8, r0 + movs r1, 0 + str r1, [sp] + ldrb r7, [r5] + cmp r7, 0xFF + bne _08003224 + b _0800335C +_08003224: + adds r6, r5, 0 + movs r2, 0 + str r2, [sp, 0x4] +_0800322A: + ldr r0, _08003264 + ldr r0, [r0] + cmp r0, 0x1 + bne _08003268 + ldrb r1, [r6, 0x3] + ldrb r0, [r6, 0x4] + adds r2, r1, 0 + muls r2, r0 + adds r0, r7, 0 + movs r1, 0 + movs r3, 0 + bl do_nothing + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + ldr r4, [sp] + cmp r4, r0 + bne _08003268 +_08003250: + movs r0, 0 + b _08003364 + .align 2, 0 +_08003254: .4byte 0x03002f70 +_08003258: .4byte nullsub_8 + 1 +_0800325C: .4byte 0x082e9584 +_08003260: .4byte 0x02020004 +_08003264: .4byte 0x03002f54 +_08003268: + ldr r0, _080032A0 + mov r9, r0 + lsls r0, r7, 2 + mov r2, r9 + adds r1, r0, r2 + ldr r1, [r1] + mov r10, r0 + cmp r1, 0 + bne _080032CA + adds r0, r7, 0 + movs r1, 0x8 + bl bg_get_field + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _080032A4 + cmp r5, r0 + beq _080032CA + adds r0, r5, 0 + bl malloc_and_clear + adds r4, r0, 0 + cmp r4, 0 + bne _080032A8 + bl Window_FreeMemory + b _08003250 + .align 2, 0 +_080032A0: .4byte 0x03002f70 +_080032A4: .4byte 0x0000ffff +_080032A8: + movs r1, 0 + mov r3, r9 + cmp r1, r5 + bge _080032BC + movs r2, 0 +_080032B2: + adds r0, r4, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, r5 + blt _080032B2 +_080032BC: + mov r1, r10 + adds r0, r1, r3 + str r4, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl bg_set_tilemap +_080032CA: + ldrb r1, [r6, 0x3] + ldrb r0, [r6, 0x4] + muls r0, r1 + lsls r0, 21 + lsrs r0, 16 + bl malloc_and_clear + adds r4, r0, 0 + cmp r4, 0 + bne _0800330C + adds r0, r7, 0 + bl GetNumActiveWindowsOnBg + lsls r0, 24 + cmp r0, 0 + bne _08003250 + ldr r0, _08003304 + mov r2, r10 + adds r5, r2, r0 + ldr r1, [r5] + ldr r0, _08003308 + cmp r1, r0 + beq _08003250 + adds r0, r1, 0 + bl free + str r4, [r5] + b _08003250 + .align 2, 0 +_08003304: .4byte 0x03002f70 +_08003308: .4byte nullsub_8 + 1 +_0800330C: + ldr r1, _08003374 + adds r0, r1, 0 + adds r0, 0x8 + ldr r2, [sp, 0x4] + adds r0, r2, r0 + str r4, [r0] + adds r2, r1 + ldr r0, [r6] + ldr r1, [r6, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, _08003378 + ldr r0, [r0] + cmp r0, 0x1 + bne _08003342 + mov r4, sp + ldrh r4, [r4] + strh r4, [r2, 0x6] + ldrb r0, [r6, 0x3] + ldrb r1, [r6, 0x4] + adds r2, r0, 0 + muls r2, r1 + adds r0, r7, 0 + ldr r1, [sp] + movs r3, 0x1 + bl do_nothing +_08003342: + adds r6, 0x8 + ldr r0, [sp, 0x4] + adds r0, 0xC + str r0, [sp, 0x4] + movs r1, 0x1 + add r8, r1 + ldrb r7, [r6] + cmp r7, 0xFF + beq _0800335C + mov r2, r8 + cmp r2, 0x1F + bgt _0800335C + b _0800322A +_0800335C: + ldr r1, _0800337C + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 +_08003364: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08003374: .4byte 0x02020004 +_08003378: .4byte 0x03002f54 +_0800337C: .4byte 0x03002f60 + thumb_func_end Window_InitFromTemplates + + thumb_func_start Window_AddFromTemplate +Window_AddFromTemplate: @ 8003380 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + movs r6, 0 + ldr r1, _08003470 + ldrb r0, [r1] + cmp r0, 0xFF + beq _080033B0 +_08003398: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1F + bhi _080033B0 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08003398 +_080033B0: + cmp r6, 0x20 + beq _0800346A + mov r0, r8 + ldrb r7, [r0] + movs r1, 0 + mov r9, r1 + ldr r0, _08003474 + ldr r0, [r0] + cmp r0, 0x1 + bne _080033E2 + mov r2, r8 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + adds r2, r1, 0 + muls r2, r0 + adds r0, r7, 0 + movs r1, 0 + movs r3, 0 + bl do_nothing + mov r9, r0 + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0800346A +_080033E2: + ldr r3, _08003478 + mov r10, r3 + lsls r0, r7, 2 + adds r1, r0, r3 + ldr r1, [r1] + str r0, [sp] + cmp r1, 0 + bne _08003432 + adds r0, r7, 0 + movs r1, 0x8 + bl bg_get_field + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0800347C + cmp r5, r0 + beq _08003432 + adds r0, r5, 0 + bl malloc_and_clear + adds r4, r0, 0 + cmp r4, 0 + beq _0800346A + movs r1, 0 + mov r3, r10 + cmp r1, r5 + bge _08003424 + movs r2, 0 +_0800341A: + adds r0, r4, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, r5 + blt _0800341A +_08003424: + ldr r1, [sp] + adds r0, r1, r3 + str r4, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl bg_set_tilemap +_08003432: + mov r2, r8 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + muls r0, r1 + lsls r0, 21 + lsrs r0, 16 + bl malloc_and_clear + adds r4, r0, 0 + cmp r4, 0 + bne _08003484 + adds r0, r7, 0 + bl GetNumActiveWindowsOnBg + lsls r0, 24 + cmp r0, 0 + bne _0800346A + ldr r0, _08003478 + ldr r3, [sp] + adds r5, r3, r0 + ldr r1, [r5] + ldr r0, _08003480 + cmp r1, r0 + beq _0800346A + adds r0, r1, 0 + bl free + str r4, [r5] +_0800346A: + movs r0, 0xFF + b _080034C0 + .align 2, 0 +_08003470: .4byte 0x02020004 +_08003474: .4byte 0x03002f54 +_08003478: .4byte 0x03002f70 +_0800347C: .4byte 0x0000ffff +_08003480: .4byte nullsub_8 + 1 +_08003484: + ldr r2, _080034D0 + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + str r4, [r0] + adds r2, r1, r2 + mov r3, r8 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, _080034D4 + ldr r0, [r0] + cmp r0, 0x1 + bne _080034BE + mov r0, r9 + strh r0, [r2, 0x6] + ldrb r0, [r2, 0x3] + ldrb r1, [r2, 0x4] + adds r2, r0, 0 + muls r2, r1 + adds r0, r7, 0 + mov r1, r9 + movs r3, 0x1 + bl do_nothing +_080034BE: + adds r0, r6, 0 +_080034C0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080034D0: .4byte 0x02020004 +_080034D4: .4byte 0x03002f54 + thumb_func_end Window_AddFromTemplate + + thumb_func_start Window_AddFromTemplateWithoutAllocatingMemory +Window_AddFromTemplateWithoutAllocatingMemory: @ 80034D8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r1, _0800352C + ldrb r0, [r1] + cmp r0, 0xFF + beq _080034FE +_080034E6: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bhi _080034FE + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080034E6 +_080034FE: + cmp r4, 0x20 + beq _08003528 + ldrb r6, [r5] + movs r3, 0 + ldr r0, _08003530 + ldr r0, [r0] + cmp r0, 0x1 + bne _08003534 + ldrb r1, [r5, 0x3] + ldrb r0, [r5, 0x4] + adds r2, r1, 0 + muls r2, r0 + adds r0, r6, 0 + movs r1, 0 + bl do_nothing + adds r3, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + bne _08003534 +_08003528: + movs r0, 0xFF + b _08003564 + .align 2, 0 +_0800352C: .4byte 0x02020004 +_08003530: .4byte 0x03002f54 +_08003534: + ldr r1, _0800356C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r1 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, _08003570 + ldr r0, [r0] + cmp r0, 0x1 + bne _08003562 + strh r3, [r2, 0x6] + ldrb r0, [r2, 0x3] + ldrb r1, [r2, 0x4] + adds r2, r0, 0 + muls r2, r1 + adds r0, r6, 0 + adds r1, r3, 0 + movs r3, 0x1 + bl do_nothing +_08003562: + adds r0, r4, 0 +_08003564: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0800356C: .4byte 0x02020004 +_08003570: .4byte 0x03002f54 + thumb_func_end Window_AddFromTemplateWithoutAllocatingMemory + + thumb_func_start Window_Remove +Window_Remove: @ 8003574 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080035F0 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r4, r0, r1 + ldrb r3, [r4] + adds r7, r3, 0 + ldr r0, _080035F4 + ldr r0, [r0] + cmp r0, 0x1 + bne _080035A0 + ldrh r1, [r4, 0x6] + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x4] + muls r2, r0 + adds r0, r3, 0 + movs r3, 0x2 + bl do_nothing +_080035A0: + ldr r0, _080035F8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r4] + str r1, [r4, 0x4] + adds r0, r7, 0 + bl GetNumActiveWindowsOnBg + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080035CE + ldr r0, _080035FC + lsls r1, r7, 2 + adds r4, r1, r0 + ldr r1, [r4] + ldr r0, _08003600 + cmp r1, r0 + beq _080035CE + adds r0, r1, 0 + bl free + str r5, [r4] +_080035CE: + ldr r1, _080035F0 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r1, 0x8 + adds r4, r0, r1 + ldr r0, [r4] + cmp r0, 0 + beq _080035E8 + bl free + movs r0, 0 + str r0, [r4] +_080035E8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080035F0: .4byte 0x02020004 +_080035F4: .4byte 0x03002f54 +_080035F8: .4byte 0x082e9584 +_080035FC: .4byte 0x03002f70 +_08003600: .4byte nullsub_8 + 1 + thumb_func_end Window_Remove + + thumb_func_start Window_FreeMemory +Window_FreeMemory: @ 8003604 + push {r4-r6,lr} + ldr r4, _0800364C + movs r5, 0x3 +_0800360A: + ldr r1, [r4] + cmp r1, 0 + beq _08003620 + ldr r0, _08003650 + cmp r1, r0 + beq _08003620 + adds r0, r1, 0 + bl free + movs r0, 0 + str r0, [r4] +_08003620: + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _0800360A + ldr r0, _08003654 + adds r4, r0, 0 + adds r4, 0x8 + movs r6, 0 + movs r5, 0x1F +_08003632: + ldr r0, [r4] + cmp r0, 0 + beq _0800363E + bl free + str r6, [r4] +_0800363E: + adds r4, 0xC + subs r5, 0x1 + cmp r5, 0 + bge _08003632 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800364C: .4byte 0x03002f70 +_08003650: .4byte nullsub_8 + 1 +_08003654: .4byte 0x02020004 + thumb_func_end Window_FreeMemory + + thumb_func_start Window_CopyToVram +Window_CopyToVram: @ 8003658 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + adds r5, r3, 0 + ldr r2, _08003690 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + mov r0, sp + adds r1, r2 + ldm r1!, {r2,r4,r6} + stm r0!, {r2,r4,r6} + mov r0, sp + ldrb r1, [r0, 0x3] + ldrb r0, [r0, 0x4] + muls r0, r1 + lsls r0, 21 + lsrs r4, r0, 16 + cmp r3, 0x2 + beq _080036A4 + cmp r3, 0x2 + bgt _08003694 + cmp r3, 0x1 + beq _0800369A + b _080036CE + .align 2, 0 +_08003690: .4byte 0x02020004 +_08003694: + cmp r5, 0x3 + beq _080036B6 + b _080036CE +_0800369A: + mov r0, sp + ldrb r0, [r0] + bl gpu_copy_wram_bg_tilemap_to_vram + b _080036CE +_080036A4: + mov r0, sp + ldrb r0, [r0] + ldr r1, [sp, 0x8] + mov r2, sp + ldrh r3, [r2, 0x6] + adds r2, r4, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _080036CE +_080036B6: + mov r0, sp + ldrb r0, [r0] + ldr r1, [sp, 0x8] + mov r2, sp + ldrh r3, [r2, 0x6] + adds r2, r4, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + mov r0, sp + ldrb r0, [r0] + bl gpu_copy_wram_bg_tilemap_to_vram +_080036CE: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end Window_CopyToVram + + thumb_func_start Window_CopyRectToVram +Window_CopyRectToVram: @ 80036D8 + push {r4-r7,lr} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + mov r12, r3 + ldr r3, [sp, 0x24] + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _08003782 + cmp r3, 0 + beq _08003782 + ldr r2, _0800372C + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + mov r1, sp + adds r0, r2 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + subs r2, r3, 0x1 + mov r0, sp + ldrb r1, [r0, 0x3] + adds r3, r2, 0 + muls r3, r1 + subs r0, r1, r4 + adds r3, r0 + ldr r2, [sp, 0x20] + adds r0, r4, r2 + subs r0, r1, r0 + subs r3, r0 + lsls r3, 5 + mov r0, r12 + muls r0, r1 + adds r4, r0, r4 + cmp r5, 0x2 + beq _08003740 + cmp r5, 0x2 + bhi _08003730 + cmp r5, 0x1 + beq _08003736 + b _08003782 + .align 2, 0 +_0800372C: .4byte 0x02020004 +_08003730: + cmp r5, 0x3 + beq _0800375E + b _08003782 +_08003736: + mov r0, sp + ldrb r0, [r0] + bl gpu_copy_wram_bg_tilemap_to_vram + b _08003782 +_08003740: + mov r0, sp + ldrb r0, [r0] + lsls r2, r4, 5 + ldr r1, [sp, 0x8] + adds r1, r2 + lsls r2, r3, 16 + lsrs r2, 16 + mov r3, sp + ldrh r3, [r3, 0x6] + adds r3, r4 + lsls r3, 16 + lsrs r3, 16 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _08003782 +_0800375E: + mov r0, sp + ldrb r0, [r0] + lsls r2, r4, 5 + ldr r1, [sp, 0x8] + adds r1, r2 + lsls r2, r3, 16 + lsrs r2, 16 + mov r3, sp + ldrh r3, [r3, 0x6] + adds r3, r4 + lsls r3, 16 + lsrs r3, 16 + bl gpu_copy_bg_tile_pattern_data_to_vram + mov r0, sp + ldrb r0, [r0] + bl gpu_copy_wram_bg_tilemap_to_vram +_08003782: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end Window_CopyRectToVram + + thumb_func_start Window_WriteStandardTileMap +Window_WriteStandardTileMap: @ 800378C + push {r4,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080037E8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + add r0, sp, 0x10 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + add r0, sp, 0x10 + ldrb r0, [r0] + movs r1, 0xA + bl bg_get_field + adds r1, r0, 0 + add r0, sp, 0x10 + ldrh r0, [r0, 0x6] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + add r0, sp, 0x10 + ldrb r0, [r0] + add r2, sp, 0x10 + ldrb r2, [r2, 0x1] + add r3, sp, 0x10 + ldrb r3, [r3, 0x2] + add r4, sp, 0x10 + ldrb r4, [r4, 0x3] + str r4, [sp] + add r4, sp, 0x10 + ldrb r4, [r4, 0x4] + str r4, [sp, 0x4] + add r4, sp, 0x10 + ldrb r4, [r4, 0x5] + str r4, [sp, 0x8] + movs r4, 0x1 + str r4, [sp, 0xC] + bl bg_write_sequence_to_wram_tile_map_rect + add sp, 0x1C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080037E8: .4byte 0x02020004 + thumb_func_end Window_WriteStandardTileMap + + thumb_func_start Window_WriteStandardTileMapRectOverridePalette +Window_WriteStandardTileMapRectOverridePalette: @ 80037EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r4, [sp, 0x44] + ldr r5, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x20] + ldr r2, _080038A0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + add r0, sp, 0x10 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + add r0, sp, 0x10 + ldrb r0, [r0] + movs r1, 0xA + bl bg_get_field + add r2, sp, 0x10 + adds r1, r2, 0 + ldrb r1, [r1, 0x3] + mov r3, r9 + muls r3, r1 + adds r1, r3, 0 + ldrh r2, [r2, 0x6] + adds r1, r2 + add r1, r10 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + movs r5, 0 + cmp r5, r8 + bge _0800388E + add r4, sp, 0x10 + movs r7, 0x1 +_0800385A: + ldrb r0, [r4] + ldrb r2, [r4, 0x1] + add r2, r10 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + add r3, r9 + adds r3, r5 + lsls r3, 24 + lsrs r3, 24 + ldr r1, [sp, 0x1C] + str r1, [sp] + str r7, [sp, 0x4] + ldr r1, [sp, 0x20] + str r1, [sp, 0x8] + str r7, [sp, 0xC] + adds r1, r6, 0 + bl bg_write_sequence_to_wram_tile_map_rect + ldrb r0, [r4, 0x3] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x1 + cmp r5, r8 + blt _0800385A +_0800388E: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080038A0: .4byte 0x02020004 + thumb_func_end Window_WriteStandardTileMapRectOverridePalette + + thumb_func_start Window_FillTileMap +Window_FillTileMap: @ 80038A4 + push {r4,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080038EC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + add r0, sp, 0xC + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + add r0, sp, 0xC + ldrb r0, [r0] + ldr r1, _080038F0 + ldrb r1, [r1] + add r2, sp, 0xC + ldrb r2, [r2, 0x1] + add r3, sp, 0xC + ldrb r3, [r3, 0x2] + add r4, sp, 0xC + ldrb r4, [r4, 0x3] + str r4, [sp] + add r4, sp, 0xC + ldrb r4, [r4, 0x4] + str r4, [sp, 0x4] + add r4, sp, 0xC + ldrb r4, [r4, 0x5] + str r4, [sp, 0x8] + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080038EC: .4byte 0x02020004 +_080038F0: .4byte 0x03002f60 + thumb_func_end Window_FillTileMap + + thumb_func_start Window_WriteStandardTileMapRect +Window_WriteStandardTileMapRect: @ 80038F4 + 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 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + ldr r2, _080039A0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + add r0, sp, 0x10 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + add r0, sp, 0x10 + ldrb r0, [r0] + movs r1, 0xA + bl bg_get_field + add r2, sp, 0x10 + adds r1, r2, 0 + ldrb r1, [r1, 0x3] + mov r3, r9 + muls r3, r1 + adds r1, r3, 0 + ldrh r2, [r2, 0x6] + adds r1, r2 + add r1, r10 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + movs r5, 0 + cmp r5, r8 + bge _0800398E + add r4, sp, 0x10 + movs r7, 0x1 +_0800395A: + ldrb r0, [r4] + ldrb r2, [r4, 0x1] + add r2, r10 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + add r3, r9 + adds r3, r5 + lsls r3, 24 + lsrs r3, 24 + ldr r1, [sp, 0x1C] + str r1, [sp] + str r7, [sp, 0x4] + ldrb r1, [r4, 0x5] + str r1, [sp, 0x8] + str r7, [sp, 0xC] + adds r1, r6, 0 + bl bg_write_sequence_to_wram_tile_map_rect + ldrb r0, [r4, 0x3] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x1 + cmp r5, r8 + blt _0800395A +_0800398E: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080039A0: .4byte 0x02020004 + thumb_func_end Window_WriteStandardTileMapRect + + thumb_func_start Window_CopyWholePixelBlockToWindow +Window_CopyWholePixelBlockToWindow: @ 80039A4 + push {r4,r5,lr} + sub sp, 0x18 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + str r4, [sp] + str r5, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + str r4, [sp, 0x10] + str r5, [sp, 0x14] + movs r2, 0 + movs r3, 0 + bl Window_CopyPixelRectToWindow + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Window_CopyWholePixelBlockToWindow + + thumb_func_start Window_CopyPixelRectToWindow +Window_CopyPixelRectToWindow: @ 80039DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r4, [sp, 0x44] + ldr r5, [sp, 0x48] + ldr r6, [sp, 0x4C] + mov r8, r6 + ldr r6, [sp, 0x50] + mov r9, r6 + ldr r6, [sp, 0x54] + mov r10, r6 + ldr r6, [sp, 0x58] + mov r12, r6 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + mov r6, r8 + lsls r6, 16 + lsrs r6, 16 + mov r8, r6 + mov r6, r9 + lsls r6, 16 + lsrs r6, 16 + mov r9, r6 + mov r6, r10 + lsls r6, 16 + lsrs r6, 16 + mov r10, r6 + mov r6, r12 + lsls r6, 16 + lsrs r6, 16 + mov r12, r6 + str r1, [sp, 0x14] + ldr r7, _08003A90 + lsls r5, 16 + ldr r6, _08003A94 + lsrs r4, 16 + orrs r4, r5 + str r4, [sp, 0x18] + ldr r1, _08003A98 + lsls r5, r0, 1 + adds r5, r0 + lsls r5, 2 + adds r0, r1, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r0, [r0] + str r0, [sp, 0x1C] + adds r5, r1 + ldrb r0, [r5, 0x3] + lsls r0, 3 + add r1, sp, 0x1C + ldr r4, [r1, 0x4] + ands r4, r7 + orrs r4, r0 + str r4, [r1, 0x4] + ldrb r0, [r5, 0x4] + lsls r0, 19 + ands r6, r4 + orrs r6, r0 + str r6, [r1, 0x4] + mov r0, r8 + str r0, [sp] + mov r6, r9 + str r6, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + mov r6, r12 + str r6, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + add r0, sp, 0x14 + bl PixelBlock_CopyRect4Bpp + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08003A90: .4byte 0xffff0000 +_08003A94: .4byte 0x0000ffff +_08003A98: .4byte 0x02020004 + thumb_func_end Window_CopyPixelRectToWindow + + thumb_func_start Window_copy_pixels_rect_3 +Window_copy_pixels_rect_3: @ 8003A9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, [sp, 0x48] + ldr r5, [sp, 0x4C] + ldr r6, [sp, 0x50] + mov r8, r6 + ldr r7, [sp, 0x54] + mov r9, r7 + ldr r6, [sp, 0x58] + mov r10, r6 + ldr r7, [sp, 0x5C] + mov r12, r7 + ldr r6, [sp, 0x60] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + mov r7, r8 + lsls r7, 16 + lsrs r7, 16 + mov r8, r7 + mov r7, r9 + lsls r7, 16 + lsrs r7, 16 + mov r9, r7 + mov r7, r10 + lsls r7, 16 + lsrs r7, 16 + mov r10, r7 + mov r7, r12 + lsls r7, 16 + lsrs r7, 16 + mov r12, r7 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x24] + str r1, [sp, 0x14] + lsls r5, 16 + ldr r6, _08003B58 + lsrs r4, 16 + orrs r4, r5 + str r4, [sp, 0x18] + ldr r1, _08003B5C + lsls r5, r0, 1 + adds r5, r0 + lsls r5, 2 + adds r0, r1, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r0, [r0] + str r0, [sp, 0x1C] + adds r5, r1 + ldrb r0, [r5, 0x3] + lsls r0, 3 + add r1, sp, 0x1C + ldr r4, [r1, 0x4] + ldr r7, _08003B60 + ands r4, r7 + orrs r4, r0 + str r4, [r1, 0x4] + ldrb r0, [r5, 0x4] + lsls r0, 19 + ands r6, r4 + orrs r6, r0 + str r6, [r1, 0x4] + mov r0, r8 + str r0, [sp] + mov r6, r9 + str r6, [sp, 0x4] + mov r7, r10 + str r7, [sp, 0x8] + mov r0, r12 + str r0, [sp, 0xC] + ldr r6, [sp, 0x24] + str r6, [sp, 0x10] + add r0, sp, 0x14 + bl PixelBlock_CopyRect4Bpp + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08003B58: .4byte 0x0000ffff +_08003B5C: .4byte 0x02020004 +_08003B60: .4byte 0xffff0000 + thumb_func_end Window_copy_pixels_rect_3 + + thumb_func_start Window_FillPixelRect +Window_FillPixelRect: @ 8003B64 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + mov r9, r3 + ldr r3, [sp, 0x28] + ldr r4, [sp, 0x2C] + mov r8, r4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + mov r4, r9 + lsls r4, 16 + lsrs r4, 16 + mov r9, r4 + lsls r3, 16 + lsrs r3, 16 + mov r4, r8 + lsls r4, 16 + lsrs r4, 16 + mov r8, r4 + ldr r5, _08003BE4 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp, 0x8] + adds r4, r5 + ldrb r0, [r4, 0x3] + lsls r0, 3 + ldr r6, _08003BE8 + ldr r5, [sp, 0xC] + ands r5, r6 + orrs r5, r0 + str r5, [sp, 0xC] + ldrb r4, [r4, 0x4] + lsls r4, 19 + ldr r0, _08003BEC + ands r0, r5 + orrs r0, r4 + str r0, [sp, 0xC] + mov r0, r8 + str r0, [sp] + str r1, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r2, 0 + mov r2, r9 + bl PixelBlock_FillRect4Bpp + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08003BE4: .4byte 0x02020004 +_08003BE8: .4byte 0xffff0000 +_08003BEC: .4byte 0x0000ffff + thumb_func_end Window_FillPixelRect + + thumb_func_start Window_CopyToPixels +Window_CopyToPixels: @ 8003BF0 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r5, r2, 16 + lsls r3, 16 + lsrs r2, r3, 16 + cmp r5, 0 + beq _08003C24 + ldr r1, _08003C20 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + lsls r2, 5 + ldr r1, [r0] + adds r1, r2 + lsrs r2, r5, 17 + adds r0, r6, 0 + bl CpuSet + b _08003C3C + .align 2, 0 +_08003C20: .4byte 0x02020004 +_08003C24: + ldr r1, _08003C44 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + lsls r2, 5 + ldr r1, [r0] + adds r1, r2 + adds r0, r6, 0 + bl LZ77UnCompWram +_08003C3C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08003C44: .4byte 0x02020004 + thumb_func_end Window_CopyToPixels + + thumb_func_start Window_FastFillPixels +Window_FastFillPixels: @ 8003C48 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r5, _08003C90 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + ldrb r2, [r0, 0x3] + ldrb r0, [r0, 0x4] + muls r2, r0 + lsls r0, r1, 24 + lsls r3, r1, 16 + orrs r0, r3 + lsls r3, r1, 8 + orrs r0, r3 + orrs r0, r1 + str r0, [sp] + adds r5, 0x8 + adds r4, r5 + ldr r1, [r4] + lsls r2, 3 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08003C90: .4byte 0x02020004 + thumb_func_end Window_FastFillPixels + + thumb_func_start Window_ScrollVertically +Window_ScrollVertically: @ 8003C94 + 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, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + ldr r2, _08003D30 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r2 + adds r2, 0x8 + adds r1, r2 + ldr r5, [r1] + lsls r7, r3, 24 + lsls r0, r3, 16 + orrs r7, r0 + lsls r0, r3, 8 + orrs r7, r0 + orrs r7, r3 + ldr r1, [r4] + ldr r2, [r4, 0x4] + ldrb r3, [r4, 0x4] + lsrs r0, r1, 24 + muls r0, r3 + lsls r6, r0, 5 + lsrs r1, 24 + mov r12, r1 + mov r0, r8 + cmp r0, 0x1 + bne _08003CE8 + b _08003E9E +_08003CE8: + cmp r0, 0x1 + ble _08003CEE + b _08004046 +_08003CEE: + cmp r0, 0 + beq _08003CF4 + b _08004046 +_08003CF4: + movs r4, 0 + cmp r4, r6 + blt _08003CFC + b _08004046 +_08003CFC: + movs r1, 0x8 + negs r1, r1 + mov r9, r1 + movs r2, 0x7 + mov r8, r2 + mov r10, r5 +_08003D08: + ldr r3, [sp] + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + adds r0, r3, 0 + mov r2, r8 + ands r0, r2 + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003D34 + adds r0, r5, r1 + ldr r0, [r0] + mov r1, r10 + str r0, [r1] + b _08003D38 + .align 2, 0 +_08003D30: .4byte 0x02020004 +_08003D34: + mov r2, r10 + str r7, [r2] +_08003D38: + adds r3, 0x1 + adds r2, r4, 0x4 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003D64 + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003D68 +_08003D64: + adds r0, r5, r2 + str r7, [r0] +_08003D68: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x8 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003D96 + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003D9A +_08003D96: + adds r0, r5, r2 + str r7, [r0] +_08003D9A: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0xC + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003DC8 + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003DCC +_08003DC8: + adds r0, r5, r2 + str r7, [r0] +_08003DCC: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x10 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003DFA + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003DFE +_08003DFA: + adds r0, r5, r2 + str r7, [r0] +_08003DFE: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x14 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003E2C + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003E30 +_08003E2C: + adds r0, r5, r2 + str r7, [r0] +_08003E30: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x18 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003E5E + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003E62 +_08003E5E: + adds r0, r5, r2 + str r7, [r0] +_08003E62: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x1C + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + adds r0, r1, 0 + mov r1, r8 + ands r3, r1 + orrs r0, r3 + lsls r0, 2 + adds r1, r4, r0 + cmp r1, r6 + bge _08003E8C + adds r0, r5, r2 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003E90 +_08003E8C: + adds r0, r5, r2 + str r7, [r0] +_08003E90: + movs r2, 0x20 + add r10, r2 + adds r4, 0x20 + cmp r4, r6 + bge _08003E9C + b _08003D08 +_08003E9C: + b _08004046 +_08003E9E: + subs r0, r6, 0x4 + adds r5, r0 + movs r4, 0 + cmp r4, r6 + blt _08003EAA + b _08004046 +_08003EAA: + movs r0, 0x8 + negs r0, r0 + mov r9, r0 + movs r1, 0x7 + mov r8, r1 + mov r10, r5 +_08003EB6: + ldr r3, [sp] + adds r0, r3, 0 + mov r2, r9 + ands r0, r2 + mov r1, r12 + muls r1, r0 + adds r0, r3, 0 + mov r2, r8 + ands r0, r2 + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003EDC + subs r0, r5, r1 + ldr r0, [r0] + mov r1, r10 + str r0, [r1] + b _08003EE0 +_08003EDC: + mov r2, r10 + str r7, [r2] +_08003EE0: + adds r3, 0x1 + adds r2, r4, 0x4 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003F0C + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003F10 +_08003F0C: + subs r0, r5, r2 + str r7, [r0] +_08003F10: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x8 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003F3E + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003F42 +_08003F3E: + subs r0, r5, r2 + str r7, [r0] +_08003F42: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0xC + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003F70 + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003F74 +_08003F70: + subs r0, r5, r2 + str r7, [r0] +_08003F74: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x10 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003FA2 + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003FA6 +_08003FA2: + subs r0, r5, r2 + str r7, [r0] +_08003FA6: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x14 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08003FD4 + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08003FD8 +_08003FD4: + subs r0, r5, r2 + str r7, [r0] +_08003FD8: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x18 + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + str r1, [sp, 0x4] + adds r0, r3, 0 + mov r1, r8 + ands r0, r1 + ldr r1, [sp, 0x4] + orrs r1, r0 + lsls r1, 2 + adds r1, r4, r1 + cmp r1, r6 + bge _08004006 + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _0800400A +_08004006: + subs r0, r5, r2 + str r7, [r0] +_0800400A: + adds r3, 0x1 + adds r2, r4, 0 + adds r2, 0x1C + adds r0, r3, 0 + mov r1, r9 + ands r0, r1 + mov r1, r12 + muls r1, r0 + adds r0, r1, 0 + mov r1, r8 + ands r3, r1 + orrs r0, r3 + lsls r0, 2 + adds r1, r4, r0 + cmp r1, r6 + bge _08004034 + subs r0, r5, r2 + subs r1, r5, r1 + ldr r1, [r1] + str r1, [r0] + b _08004038 +_08004034: + subs r0, r5, r2 + str r7, [r0] +_08004038: + movs r2, 0x20 + negs r2, r2 + add r10, r2 + adds r4, 0x20 + cmp r4, r6 + bge _08004046 + b _08003EB6 +_08004046: + 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 Window_ScrollVertically + + thumb_func_start CallWindowFunction +CallWindowFunction: @ 8004058 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + mov r8, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080040A4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r5, [r1] + ldr r6, [r1, 0x4] + ldrb r0, [r1] + lsrs r1, r5, 8 + lsls r1, 24 + lsrs r1, 24 + lsrs r2, r5, 16 + lsls r2, 24 + lsrs r2, 24 + lsrs r3, r5, 24 + lsls r4, r6, 24 + lsrs r4, 24 + str r4, [sp] + lsrs r4, r6, 8 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + bl _call_via_r8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080040A4: .4byte 0x02020004 + thumb_func_end CallWindowFunction + + thumb_func_start Window_SetField +Window_SetField: @ 80040A8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0x7 + bhi _08004142 + lsls r0, 2 + ldr r1, _080040C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080040C0: .4byte _080040C4 + .align 2, 0 +_080040C4: + .4byte _08004142 + .4byte _080040E4 + .4byte _080040F8 + .4byte _08004142 + .4byte _08004142 + .4byte _0800410C + .4byte _08004120 + .4byte _08004134 +_080040E4: + ldr r1, _080040F4 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strb r2, [r0, 0x1] + movs r0, 0 + b _08004144 + .align 2, 0 +_080040F4: .4byte 0x02020004 +_080040F8: + ldr r1, _08004108 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strb r2, [r0, 0x2] + movs r0, 0 + b _08004144 + .align 2, 0 +_08004108: .4byte 0x02020004 +_0800410C: + ldr r1, _0800411C + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strb r2, [r0, 0x5] + movs r0, 0 + b _08004144 + .align 2, 0 +_0800411C: .4byte 0x02020004 +_08004120: + ldr r1, _08004130 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strh r2, [r0, 0x6] + movs r0, 0 + b _08004144 + .align 2, 0 +_08004130: .4byte 0x02020004 +_08004134: + ldr r1, _08004148 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + str r2, [r0] +_08004142: + movs r0, 0x1 +_08004144: + pop {r1} + bx r1 + .align 2, 0 +_08004148: .4byte 0x02020004 + thumb_func_end Window_SetField + + thumb_func_start Window_GetField +Window_GetField: @ 800414C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0x7 + bhi _08004228 + lsls r0, 2 + ldr r1, _08004164 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08004164: .4byte _08004168 + .align 2, 0 +_08004168: + .4byte _08004188 + .4byte _0800419C + .4byte _080041B0 + .4byte _080041C4 + .4byte _080041D8 + .4byte _080041EC + .4byte _08004200 + .4byte _08004214 +_08004188: + ldr r0, _08004198 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + b _0800422A + .align 2, 0 +_08004198: .4byte 0x02020004 +_0800419C: + ldr r0, _080041AC + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _0800422A + .align 2, 0 +_080041AC: .4byte 0x02020004 +_080041B0: + ldr r0, _080041C0 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + b _0800422A + .align 2, 0 +_080041C0: .4byte 0x02020004 +_080041C4: + ldr r0, _080041D4 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x3] + b _0800422A + .align 2, 0 +_080041D4: .4byte 0x02020004 +_080041D8: + ldr r0, _080041E8 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x4] + b _0800422A + .align 2, 0 +_080041E8: .4byte 0x02020004 +_080041EC: + ldr r0, _080041FC + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x5] + b _0800422A + .align 2, 0 +_080041FC: .4byte 0x02020004 +_08004200: + ldr r0, _08004210 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + b _0800422A + .align 2, 0 +_08004210: .4byte 0x02020004 +_08004214: + ldr r0, _08004224 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r0, 0x8 + adds r1, r0 + ldr r0, [r1] + b _0800422A + .align 2, 0 +_08004224: .4byte 0x02020004 +_08004228: + movs r0, 0 +_0800422A: + pop {r1} + bx r1 + thumb_func_end Window_GetField + + thumb_func_start GetNumActiveWindowsOnBg +GetNumActiveWindowsOnBg: @ 8004230 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r2, _08004258 + movs r1, 0x1F +_0800423C: + ldrb r0, [r2] + cmp r0, r4 + bne _08004248 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_08004248: + adds r2, 0xC + subs r1, 0x1 + cmp r1, 0 + bge _0800423C + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08004258: .4byte 0x02020004 + thumb_func_end GetNumActiveWindowsOnBg + + thumb_func_start nullsub_9 +nullsub_9: @ 800425C + bx lr + thumb_func_end nullsub_9 + + thumb_func_start Window_AddFromTemplate8Bpp +Window_AddFromTemplate8Bpp: @ 8004260 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + movs r6, 0 + ldr r1, _08004328 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0800428E +_08004276: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1F + bhi _0800428E + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08004276 +_0800428E: + cmp r6, 0x20 + beq _08004322 + mov r0, r9 + ldrb r7, [r0] + ldr r1, _0800432C + mov r10, r1 + lsls r2, r7, 2 + mov r8, r2 + mov r0, r8 + add r0, r10 + ldr r0, [r0] + cmp r0, 0 + bne _080042EA + adds r0, r7, 0 + movs r1, 0x8 + bl bg_get_field + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _08004330 + cmp r5, r0 + beq _080042EA + adds r0, r5, 0 + bl malloc + adds r4, r0, 0 + cmp r4, 0 + beq _08004322 + movs r1, 0 + mov r12, r10 + mov r3, r8 + cmp r1, r5 + bge _080042DC + movs r2, 0 +_080042D2: + adds r0, r4, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, r5 + blt _080042D2 +_080042DC: + mov r1, r12 + adds r0, r3, r1 + str r4, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl bg_set_tilemap +_080042EA: + mov r2, r9 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + muls r0, r1 + lsls r0, 22 + lsrs r0, 16 + bl malloc + adds r4, r0, 0 + cmp r4, 0 + bne _08004338 + adds r0, r7, 0 + bl GetNumActiveWindowsOnBgDuplicate + lsls r0, 24 + cmp r0, 0 + bne _08004322 + ldr r0, _0800432C + lsls r1, r7, 2 + adds r5, r1, r0 + ldr r1, [r5] + ldr r0, _08004334 + cmp r1, r0 + beq _08004322 + adds r0, r1, 0 + bl free + str r4, [r5] +_08004322: + movs r0, 0xFF + b _08004356 + .align 2, 0 +_08004328: .4byte 0x02020004 +_0800432C: .4byte 0x03002f70 +_08004330: .4byte 0x0000ffff +_08004334: .4byte nullsub_9 + 1 +_08004338: + ldr r1, _08004364 + lsls r2, r6, 1 + adds r2, r6 + lsls r2, 2 + adds r0, r1, 0 + adds r0, 0x8 + adds r0, r2, r0 + str r4, [r0] + adds r2, r1 + mov r3, r9 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + adds r0, r6, 0 +_08004356: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08004364: .4byte 0x02020004 + thumb_func_end Window_AddFromTemplate8Bpp + + thumb_func_start Window_FillPixels8Bpp +Window_FillPixels8Bpp: @ 8004368 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r6, _080043A4 + lsls r1, r0, 1 + adds r1, r0 + lsls r4, r1, 2 + adds r0, r4, r6 + ldrb r1, [r0, 0x3] + ldrb r0, [r0, 0x4] + muls r0, r1 + lsls r0, 22 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r3 + bge _0800439E + adds r0, r6, 0 + adds r0, 0x8 + adds r1, r4, r0 +_08004392: + ldr r0, [r1] + adds r0, r2 + strb r5, [r0] + adds r2, 0x1 + cmp r2, r3 + blt _08004392 +_0800439E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080043A4: .4byte 0x02020004 + thumb_func_end Window_FillPixels8Bpp + + thumb_func_start Window_FillPixelRect8Bpp +Window_FillPixelRect8Bpp: @ 80043A8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + mov r9, r3 + ldr r3, [sp, 0x28] + ldr r4, [sp, 0x2C] + mov r8, r4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + mov r4, r9 + lsls r4, 16 + lsrs r4, 16 + mov r9, r4 + lsls r3, 16 + lsrs r3, 16 + mov r4, r8 + lsls r4, 16 + lsrs r4, 16 + mov r8, r4 + ldr r5, _08004428 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp, 0x8] + adds r4, r5 + ldrb r0, [r4, 0x3] + lsls r0, 3 + ldr r6, _0800442C + ldr r5, [sp, 0xC] + ands r5, r6 + orrs r5, r0 + str r5, [sp, 0xC] + ldrb r4, [r4, 0x4] + lsls r4, 19 + ldr r0, _08004430 + ands r0, r5 + orrs r0, r4 + str r0, [sp, 0xC] + mov r0, r8 + str r0, [sp] + str r1, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r2, 0 + mov r2, r9 + bl PixelBlock_FillRect8Bpp + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08004428: .4byte 0x02020004 +_0800442C: .4byte 0xffff0000 +_08004430: .4byte 0x0000ffff + thumb_func_end Window_FillPixelRect8Bpp + + thumb_func_start Window_CopyPixelRectToWindow4BppTo8Bpp +Window_CopyPixelRectToWindow4BppTo8Bpp: @ 8004434 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + ldr r4, [sp, 0x4C] + ldr r5, [sp, 0x50] + ldr r6, [sp, 0x54] + mov r8, r6 + ldr r7, [sp, 0x58] + mov r9, r7 + ldr r6, [sp, 0x5C] + mov r10, r6 + ldr r7, [sp, 0x60] + mov r12, r7 + ldr r6, [sp, 0x64] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + mov r7, r8 + lsls r7, 16 + lsrs r7, 16 + mov r8, r7 + mov r7, r9 + lsls r7, 16 + lsrs r7, 16 + mov r9, r7 + mov r7, r10 + lsls r7, 16 + lsrs r7, 16 + mov r10, r7 + mov r7, r12 + lsls r7, 16 + lsrs r7, 16 + mov r12, r7 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x28] + str r1, [sp, 0x18] + lsls r5, 16 + ldr r6, _080044F4 + lsrs r4, 16 + orrs r4, r5 + str r4, [sp, 0x1C] + ldr r1, _080044F8 + lsls r5, r0, 1 + adds r5, r0 + lsls r5, 2 + adds r0, r1, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r0, [r0] + str r0, [sp, 0x20] + adds r5, r1 + ldrb r0, [r5, 0x3] + lsls r0, 3 + add r1, sp, 0x20 + ldr r4, [r1, 0x4] + ldr r7, _080044FC + ands r4, r7 + orrs r4, r0 + str r4, [r1, 0x4] + ldrb r0, [r5, 0x4] + lsls r0, 19 + ands r6, r4 + orrs r6, r0 + str r6, [r1, 0x4] + mov r0, r8 + str r0, [sp] + mov r6, r9 + str r6, [sp, 0x4] + mov r7, r10 + str r7, [sp, 0x8] + mov r0, r12 + str r0, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + ldr r6, [sp, 0x28] + str r6, [sp, 0x14] + add r0, sp, 0x18 + bl PixelBlock_CopyRect4BppTo8Bpp + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080044F4: .4byte 0x0000ffff +_080044F8: .4byte 0x02020004 +_080044FC: .4byte 0xffff0000 + thumb_func_end Window_CopyPixelRectToWindow4BppTo8Bpp + + thumb_func_start Window_CopyToVram8Bpp +Window_CopyToVram8Bpp: @ 8004500 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + adds r5, r2, 0 + ldr r6, _08004534 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, _08004538 + adds r3, r1, r0 + str r3, [r6] + ldr r4, _0800453C + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + muls r0, r1 + lsls r0, 6 + strh r0, [r4] + cmp r2, 0x2 + beq _0800454E + cmp r2, 0x2 + bgt _08004540 + cmp r2, 0x1 + beq _08004546 + b _08004570 + .align 2, 0 +_08004534: .4byte 0x02020184 +_08004538: .4byte 0x02020004 +_0800453C: .4byte 0x02020188 +_08004540: + cmp r5, 0x3 + beq _0800455C + b _08004570 +_08004546: + ldrb r0, [r3] + bl gpu_copy_wram_bg_tilemap_to_vram + b _08004570 +_0800454E: + ldrb r0, [r3] + ldr r1, [r3, 0x8] + ldrh r2, [r4] + ldrh r3, [r3, 0x6] + bl gpu_copy_bg_tile_pattern_data_to_vram + b _08004570 +_0800455C: + ldrb r0, [r3] + ldr r1, [r3, 0x8] + ldrh r2, [r4] + ldrh r3, [r3, 0x6] + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, [r6] + ldrb r0, [r0] + bl gpu_copy_wram_bg_tilemap_to_vram +_08004570: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end Window_CopyToVram8Bpp + + thumb_func_start GetNumActiveWindowsOnBgDuplicate +GetNumActiveWindowsOnBgDuplicate: @ 8004578 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r2, _080045A0 + movs r1, 0x1F +_08004584: + ldrb r0, [r2] + cmp r0, r4 + bne _08004590 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_08004590: + adds r2, 0xC + subs r1, 0x1 + cmp r1, 0 + bge _08004584 + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080045A0: .4byte 0x02020004 + thumb_func_end GetNumActiveWindowsOnBgDuplicate + + thumb_func_start fboxes_set_ptr +fboxes_set_ptr: @ 80045A4 + ldr r1, _080045AC + str r0, [r1] + bx lr + .align 2, 0 +_080045AC: .4byte 0x03002f80 + thumb_func_end fboxes_set_ptr + + thumb_func_start TextBox_ResetSomeField +TextBox_ResetSomeField: @ 80045B0 + push {lr} + ldr r1, _080045C8 + movs r2, 0 + ldr r3, _080045CC + adds r0, r1, r3 +_080045BA: + strb r2, [r0, 0x1B] + subs r0, 0x24 + cmp r0, r1 + bge _080045BA + pop {r0} + bx r0 + .align 2, 0 +_080045C8: .4byte 0x020201b0 +_080045CC: .4byte 0x0000045c + thumb_func_end TextBox_ResetSomeField + + thumb_func_start Print +Print: @ 80045D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + ldr r7, [sp, 0x30] + lsls r1, 24 + lsrs r1, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + str r2, [sp] + mov r2, sp + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + strb r3, [r0, 0x6] + strb r4, [r0, 0x7] + strb r3, [r0, 0x8] + strb r4, [r0, 0x9] + ldr r0, _08004678 + ldr r0, [r0] + lsls r3, r1, 1 + adds r3, r1 + lsls r3, 2 + adds r3, r0 + ldrb r0, [r3, 0x6] + strb r0, [r2, 0xA] + mov r1, sp + ldrb r0, [r3, 0x7] + strb r0, [r1, 0xB] + mov r5, sp + ldrb r1, [r3, 0x8] + lsls r1, 28 + movs r6, 0xF + lsrs r1, 28 + ldrb r4, [r5, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r5, 0xC] + mov r4, sp + ldrb r1, [r3, 0x8] + lsrs r1, 4 + lsls r1, 4 + ands r0, r6 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r0, [r3, 0x9] + lsls r0, 28 + lsrs r0, 28 + adds r1, r6, 0 + ands r1, r0 + ldrb r0, [r4, 0xD] + ands r2, r0 + orrs r2, r1 + strb r2, [r4, 0xD] + mov r1, sp + ldrb r0, [r3, 0x9] + lsrs r0, 4 + lsls r0, 4 + ands r2, r6 + orrs r2, r0 + strb r2, [r1, 0xD] + mov r0, sp + mov r1, r8 + adds r2, r7, 0 + bl remo_copy + lsls r0, 16 + lsrs r0, 16 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08004678: .4byte 0x03002f80 + thumb_func_end Print + + thumb_func_start remo_copy +remo_copy: @ 800467C + push {r4-r7,lr} + adds r6, r0, 0 + mov r12, r2 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _08004694 + ldr r0, [r0] + cmp r0, 0 + bne _08004698 + movs r0, 0 + b _08004766 + .align 2, 0 +_08004694: .4byte 0x03002f80 +_08004698: + ldr r0, _08004710 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0, 0x1B] + strb r2, [r0, 0x1C] + strb r5, [r0, 0x1D] + strb r2, [r0, 0x1E] + strb r2, [r0, 0x1F] + adds r4, r0, 0 + movs r1, 0x6 + adds r0, 0x1A +_080046AE: + strb r2, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _080046AE + adds r1, r4, 0 + adds r0, r6, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r0] + str r0, [r1] + mov r0, r12 + str r0, [r4, 0x10] + adds r0, r4, 0 + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + ldrb r2, [r6, 0xD] + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + bl GenerateFontHalfRowLut + cmp r5, 0xFF + beq _08004718 + cmp r5, 0 + beq _08004718 + ldrb r0, [r4, 0x1D] + subs r0, 0x1 + strb r0, [r4, 0x1D] + ldr r2, _08004714 + ldrb r0, [r6, 0x4] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + b _0800475E + .align 2, 0 +_08004710: .4byte 0x0202018c +_08004714: .4byte 0x020201b0 +_08004718: + ldr r1, _08004724 + movs r0, 0 + strb r0, [r1, 0x1D] + movs r4, 0 + ldr r7, _08004728 + b _08004732 + .align 2, 0 +_08004724: .4byte 0x0202018c +_08004728: .4byte 0x000003ff +_0800472C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08004732: + cmp r4, r7 + bhi _08004740 + ldr r0, _0800476C + bl fbox_exec + cmp r0, 0x1 + bne _0800472C +_08004740: + cmp r5, 0xFF + beq _0800474E + ldr r0, _0800476C + ldrb r0, [r0, 0x4] + movs r1, 0x2 + bl Window_CopyToVram +_0800474E: + ldr r2, _08004770 + ldrb r1, [r6, 0x4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x1B] +_0800475E: + ldr r1, _08004774 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 +_08004766: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800476C: .4byte 0x0202018c +_08004770: .4byte 0x020201b0 +_08004774: .4byte 0x03002f84 + thumb_func_end remo_copy + + thumb_func_start run_remoboxes +run_remoboxes: @ 8004778 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080047B0 + ldrb r0, [r0] + cmp r0, 0 + bne _080047F6 + ldr r0, _080047B4 + movs r6, 0 + adds r5, r0, 0x4 + mov r8, r0 + movs r7, 0x1F +_08004790: + ldrb r0, [r5, 0x17] + cmp r0, 0 + beq _080047E8 + mov r0, r8 + bl fbox_exec + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + beq _080047E4 + cmp r4, 0x1 + bgt _080047B8 + cmp r4, 0 + beq _080047BE + b _080047E8 + .align 2, 0 +_080047B0: .4byte 0x03002f84 +_080047B4: .4byte 0x020201b0 +_080047B8: + cmp r4, 0x3 + beq _080047C6 + b _080047E8 +_080047BE: + ldrb r0, [r5] + movs r1, 0x2 + bl Window_CopyToVram +_080047C6: + ldr r1, _080047E0 + adds r0, r1, 0 + adds r0, 0x10 + adds r0, r6, r0 + ldr r2, [r0] + cmp r2, 0 + beq _080047E8 + adds r0, r6, r1 + adds r1, r4, 0 + bl _call_via_r2 + b _080047E8 + .align 2, 0 +_080047E0: .4byte 0x020201b0 +_080047E4: + movs r0, 0 + strb r0, [r5, 0x17] +_080047E8: + adds r6, 0x24 + adds r5, 0x24 + movs r0, 0x24 + add r8, r0 + subs r7, 0x1 + cmp r7, 0 + bge _08004790 +_080047F6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end run_remoboxes + + thumb_func_start a_pressed_maybe +a_pressed_maybe: @ 8004800 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08004814 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x1B] + bx lr + .align 2, 0 +_08004814: .4byte 0x020201b0 + thumb_func_end a_pressed_maybe + + thumb_func_start fbox_exec +fbox_exec: @ 8004818 + push {r4,lr} + adds r4, r0, 0 +_0800481C: + ldrb r1, [r4, 0x5] + ldr r0, _08004840 + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _0800481C + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08004840: .4byte 0x03002f80 + thumb_func_end fbox_exec + + thumb_func_start GenerateFontHalfRowLut +GenerateFontHalfRowLut: @ 8004844 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08004BD0 + ldr r4, _08004BD4 + strh r1, [r4] + ldr r4, _08004BD8 + strh r0, [r4] + ldr r4, _08004BDC + strh r2, [r4] + lsls r5, r1, 12 + lsls r6, r0, 12 + lsls r4, r2, 12 + mov r8, r4 + lsls r7, r1, 8 + str r7, [sp] + lsls r4, r1, 4 + mov r9, r4 + orrs r7, r4 + str r7, [sp, 0x4] + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + lsls r7, r0, 8 + mov r10, r7 + mov r4, r10 + mov r7, r9 + orrs r4, r7 + str r4, [sp, 0x8] + adds r7, r4, 0 + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + lsls r7, r2, 8 + mov r12, r7 + mov r4, r12 + mov r7, r9 + orrs r4, r7 + str r4, [sp, 0xC] + adds r7, r4, 0 + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + lsls r7, r0, 4 + mov r9, r7 + ldr r4, [sp] + orrs r4, r7 + str r4, [sp, 0x10] + adds r7, r4, 0 + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + mov r7, r10 + adds r4, r7, 0 + mov r7, r9 + orrs r4, r7 + str r4, [sp, 0x14] + adds r7, r4, 0 + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + mov r7, r12 + adds r4, r7, 0 + mov r7, r9 + orrs r4, r7 + str r4, [sp, 0x18] + adds r7, r4, 0 + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + lsls r7, r2, 4 + mov r9, r7 + mov r4, r9 + ldr r7, [sp] + orrs r7, r4 + str r7, [sp, 0x1C] + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + mov r7, r9 + mov r4, r10 + orrs r4, r7 + str r4, [sp, 0x20] + adds r7, r4, 0 + orrs r7, r1 + adds r4, r5, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + adds r4, r6, 0 + orrs r4, r7 + strh r4, [r3] + adds r3, 0x2 + mov r4, r8 + orrs r7, r4 + strh r7, [r3] + adds r3, 0x2 + mov r4, r12 + mov r7, r9 + orrs r4, r7 + adds r7, r4, 0 + orrs r7, r1 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x4] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x8] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0xC] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x10] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x14] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x18] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x1C] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + ldr r7, [sp, 0x20] + orrs r7, r0 + adds r1, r5, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + adds r1, r6, 0 + orrs r1, r7 + strh r1, [r3] + adds r3, 0x2 + mov r1, r8 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + adds r7, r4, 0 + orrs r7, r0 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r0, [sp, 0x4] + orrs r7, r0 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + orrs r7, r1 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0x8] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0xC] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0x10] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0x14] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0x18] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0x1C] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + ldr r1, [sp, 0x20] + orrs r7, r1 + adds r0, r5, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + adds r0, r6, 0 + orrs r0, r7 + strh r0, [r3] + adds r3, 0x2 + mov r0, r8 + orrs r7, r0 + strh r7, [r3] + adds r3, 0x2 + adds r7, r2, 0 + orrs r7, r4 + orrs r5, r7 + strh r5, [r3] + adds r3, 0x2 + orrs r6, r7 + strh r6, [r3] + orrs r0, r7 + strh r0, [r3, 0x2] + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08004BD0: .4byte 0x03000948 +_08004BD4: .4byte 0x030009ea +_08004BD8: .4byte 0x030009ec +_08004BDC: .4byte 0x030009ee + thumb_func_end GenerateFontHalfRowLut + + thumb_func_start save_remo_colors +save_remo_colors: @ 8004BE0 + ldr r3, _08004BF4 + ldrh r3, [r3] + strb r3, [r1] + ldr r1, _08004BF8 + ldrh r1, [r1] + strb r1, [r0] + ldr r0, _08004BFC + ldrh r0, [r0] + strb r0, [r2] + bx lr + .align 2, 0 +_08004BF4: .4byte 0x030009ea +_08004BF8: .4byte 0x030009ec +_08004BFC: .4byte 0x030009ee + thumb_func_end save_remo_colors + + thumb_func_start restore_remo_colors +restore_remo_colors: @ 8004C00 + push {lr} + ldrb r0, [r0] + ldrb r1, [r1] + ldrb r2, [r2] + bl GenerateFontHalfRowLut + pop {r0} + bx r0 + thumb_func_end restore_remo_colors + + thumb_func_start font_render_sub +font_render_sub: @ 8004C10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldrh r7, [r0] + ldr r5, _08004D50 + ldr r4, _08004D54 + movs r2, 0xFF + mov r8, r2 + adds r2, r7, 0 + mov r3, r8 + ands r2, r3 + adds r2, r4 + ldrb r2, [r2] + lsls r2, 1 + adds r2, r5 + ldrh r3, [r2] + lsls r3, 16 + lsrs r2, r7, 8 + adds r2, r4 + ldrb r2, [r2] + lsls r2, 1 + adds r2, r5 + ldrh r2, [r2] + orrs r3, r2 + adds r6, r1, 0 + stm r6!, {r3} + ldrh r7, [r0, 0x2] + adds r0, 0x4 + adds r2, r7, 0 + mov r3, r8 + ands r2, r3 + adds r2, r4 + ldrb r2, [r2] + lsls r2, 1 + adds r2, r5 + ldrh r3, [r2] + lsls r3, 16 + lsrs r2, r7, 8 + adds r2, r4 + ldrb r2, [r2] + lsls r2, 1 + adds r2, r5 + ldrh r2, [r2] + orrs r3, r2 + str r3, [r1, 0x4] + adds r6, 0x4 + ldrh r7, [r0] + adds r0, 0x2 + adds r1, r7, 0 + mov r2, r8 + ands r1, r2 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 16 + lsrs r1, r7, 8 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r1, [r1] + orrs r2, r1 + stm r6!, {r2} + ldrh r7, [r0] + adds r0, 0x2 + adds r1, r7, 0 + mov r3, r8 + ands r1, r3 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 16 + lsrs r1, r7, 8 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r1, [r1] + orrs r2, r1 + stm r6!, {r2} + ldrh r7, [r0] + adds r0, 0x2 + adds r1, r7, 0 + ands r1, r3 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 16 + lsrs r1, r7, 8 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r1, [r1] + orrs r2, r1 + stm r6!, {r2} + ldrh r7, [r0] + adds r0, 0x2 + adds r1, r7, 0 + ands r1, r3 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 16 + lsrs r1, r7, 8 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r1, [r1] + orrs r2, r1 + stm r6!, {r2} + ldrh r7, [r0] + adds r1, r7, 0 + ands r1, r3 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 16 + lsrs r1, r7, 8 + adds r1, r4 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r5 + ldrh r1, [r1] + orrs r2, r1 + stm r6!, {r2} + ldrh r7, [r0, 0x2] + adds r0, r7, 0 + ands r0, r3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 16 + lsrs r0, r7, 8 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + orrs r1, r0 + str r1, [r6] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08004D50: .4byte 0x03000948 +_08004D54: .4byte 0x082e958c + thumb_func_end font_render_sub + + thumb_func_start sub_8004D58 +sub_8004D58: @ 8004D58 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _08004D8C + cmp r0, 0x1 + bgt _08004D6E + cmp r0, 0 + beq _08004D74 + b _08004D98 +_08004D6E: + cmp r1, 0x2 + beq _08004D80 + b _08004D98 +_08004D74: + ldr r0, _08004D7C + ldrb r0, [r0] + b _08004D9A + .align 2, 0 +_08004D7C: .4byte 0x030009ec +_08004D80: + ldr r0, _08004D88 + ldrb r0, [r0] + b _08004D9A + .align 2, 0 +_08004D88: .4byte 0x030009ea +_08004D8C: + ldr r0, _08004D94 + ldrb r0, [r0] + b _08004D9A + .align 2, 0 +_08004D94: .4byte 0x030009ee +_08004D98: + movs r0, 0 +_08004D9A: + pop {r1} + bx r1 + thumb_func_end sub_8004D58 + + thumb_func_start CopyGlyphToWindow +CopyGlyphToWindow: @ 8004DA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8C + adds r3, r0, 0 + ldrb r1, [r3, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _08004E7C + adds r1, r0, r1 + adds r2, r1, 0 + ldrb r7, [r1, 0x3] + lsls r0, r7, 3 + ldrb r6, [r3, 0x8] + subs r4, r0, r6 + ldr r5, _08004E80 + adds r0, r5, 0 + adds r0, 0x80 + ldrb r0, [r0] + cmp r4, r0 + ble _08004DD2 + adds r4, r0, 0 +_08004DD2: + ldrb r0, [r1, 0x4] + lsls r0, 3 + ldrb r3, [r3, 0x9] + subs r0, r3 + adds r1, r5, 0 + adds r1, 0x81 + ldrb r1, [r1] + cmp r0, r1 + ble _08004DE6 + adds r0, r1, 0 +_08004DE6: + str r6, [sp] + mov r8, r3 + adds r3, r5, 0 + ldr r2, [r2, 0x8] + mov r9, r2 + lsls r1, r7, 5 + str r1, [sp, 0x4] + cmp r4, 0x8 + ble _08004DFA + b _08004F94 +_08004DFA: + cmp r0, 0x8 + bgt _08004E84 + mov r1, r8 + str r3, [sp, 0x8] + adds r2, r6, 0 + adds r2, r4 + mov r8, r2 + adds r0, r1, r0 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + cmp r1, r0 + bcc _08004E14 + b _080052AA +_08004E14: + ldr r3, [sp, 0x8] + ldm r3!, {r5} + str r3, [sp, 0x8] + ldr r4, [sp, 0x10] + adds r0, r1, 0x1 + mov r10, r0 + cmp r4, r8 + bcs _08004E72 + movs r2, 0x7 + mov r12, r2 + lsrs r0, r1, 3 + ldr r2, [sp, 0x4] + adds r3, r0, 0 + muls r3, r2 + adds r7, r3, 0 + mov r3, r12 + ands r1, r3 + lsls r6, r1, 2 +_08004E38: + adds r3, r5, 0 + movs r0, 0xF + ands r3, r0 + cmp r3, 0 + beq _08004E6A + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r12 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_08004E6A: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r8 + bcc _08004E38 +_08004E72: + mov r1, r10 + ldr r2, [sp, 0xC] + cmp r1, r2 + bcc _08004E14 + b _080052AA + .align 2, 0 +_08004E7C: .4byte 0x02020004 +_08004E80: .4byte 0x03002f90 +_08004E84: + mov r1, r8 + str r3, [sp, 0x14] + ldr r3, [sp] + adds r3, r4 + mov r12, r3 + adds r2, r1, 0 + adds r2, 0x8 + str r2, [sp, 0x18] + ldr r3, [sp] + str r3, [sp, 0x1C] + mov r2, r12 + str r2, [sp, 0x74] + ldr r3, [sp, 0x18] + str r3, [sp, 0x88] + subs r0, 0x8 + str r0, [sp, 0x80] + cmp r1, r3 + bcs _08004F0E +_08004EA8: + ldr r0, [sp, 0x14] + ldm r0!, {r5} + str r0, [sp, 0x14] + ldr r4, [sp, 0x1C] + adds r2, r1, 0x1 + mov r8, r2 + cmp r4, r12 + bcs _08004F06 + movs r3, 0x7 + mov r10, r3 + lsrs r0, r1, 3 + ldr r3, [sp, 0x4] + adds r2, r0, 0 + muls r2, r3 + adds r7, r2, 0 + mov r0, r10 + ands r1, r0 + lsls r6, r1, 2 +_08004ECC: + adds r3, r5, 0 + movs r1, 0xF + ands r3, r1 + cmp r3, 0 + beq _08004EFE + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r10 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_08004EFE: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r12 + bcc _08004ECC +_08004F06: + mov r1, r8 + ldr r2, [sp, 0x18] + cmp r1, r2 + bcc _08004EA8 +_08004F0E: + ldr r1, [sp, 0x88] + ldr r3, _08004F90 + str r3, [sp, 0x20] + ldr r0, [sp, 0x74] + mov r8, r0 + ldr r2, [sp, 0x80] + adds r2, r1, r2 + str r2, [sp, 0x24] + ldr r3, [sp] + str r3, [sp, 0x28] + cmp r1, r2 + bcc _08004F28 + b _080052AA +_08004F28: + ldr r0, [sp, 0x20] + ldm r0!, {r5} + str r0, [sp, 0x20] + ldr r4, [sp, 0x28] + adds r2, r1, 0x1 + mov r10, r2 + cmp r4, r8 + bcs _08004F86 + movs r3, 0x7 + mov r12, r3 + lsrs r0, r1, 3 + ldr r3, [sp, 0x4] + adds r2, r0, 0 + muls r2, r3 + adds r7, r2, 0 + mov r0, r12 + ands r1, r0 + lsls r6, r1, 2 +_08004F4C: + adds r3, r5, 0 + movs r1, 0xF + ands r3, r1 + cmp r3, 0 + beq _08004F7E + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r12 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_08004F7E: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r8 + bcc _08004F4C +_08004F86: + mov r1, r10 + ldr r2, [sp, 0x24] + cmp r1, r2 + bcc _08004F28 + b _080052AA + .align 2, 0 +_08004F90: .4byte 0x03002fd0 +_08004F94: + cmp r0, 0x8 + ble _08004F9A + b _080050A4 +_08004F9A: + mov r1, r8 + str r3, [sp, 0x2C] + ldr r3, [sp] + adds r3, 0x8 + mov r12, r3 + add r0, r8 + str r0, [sp, 0x30] + ldr r0, [sp] + str r0, [sp, 0x34] + ldr r2, [sp, 0x30] + str r2, [sp, 0x78] + str r3, [sp, 0x84] + subs r4, 0x8 + str r4, [sp, 0x7C] + cmp r8, r2 + bcs _0800501C +_08004FBA: + ldr r0, [sp, 0x2C] + ldm r0!, {r5} + str r0, [sp, 0x2C] + ldr r4, [sp, 0x34] + adds r2, r1, 0x1 + mov r10, r2 + cmp r4, r12 + bcs _08005014 + lsrs r0, r1, 3 + ldr r2, [sp, 0x4] + adds r3, r0, 0 + muls r3, r2 + adds r7, r3, 0 + movs r3, 0x7 + ands r1, r3 + lsls r6, r1, 2 +_08004FDA: + adds r3, r5, 0 + movs r0, 0xF + ands r3, r0 + cmp r3, 0 + beq _0800500C + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + movs r1, 0x7 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_0800500C: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r12 + bcc _08004FDA +_08005014: + mov r1, r10 + ldr r2, [sp, 0x30] + cmp r1, r2 + bcc _08004FBA +_0800501C: + mov r1, r8 + ldr r3, _080050A0 + str r3, [sp, 0x38] + ldr r0, [sp, 0x84] + ldr r2, [sp, 0x7C] + adds r0, r2 + mov r8, r0 + ldr r3, [sp, 0x78] + str r3, [sp, 0x3C] + ldr r0, [sp, 0x84] + str r0, [sp, 0x40] + cmp r1, r3 + bcc _08005038 + b _080052AA +_08005038: + ldr r2, [sp, 0x38] + ldm r2!, {r5} + str r2, [sp, 0x38] + ldr r4, [sp, 0x40] + adds r3, r1, 0x1 + mov r10, r3 + cmp r4, r8 + bcs _08005096 + movs r0, 0x7 + mov r12, r0 + lsrs r0, r1, 3 + ldr r3, [sp, 0x4] + adds r2, r0, 0 + muls r2, r3 + adds r7, r2, 0 + mov r0, r12 + ands r1, r0 + lsls r6, r1, 2 +_0800505C: + adds r3, r5, 0 + movs r1, 0xF + ands r3, r1 + cmp r3, 0 + beq _0800508E + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r12 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_0800508E: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r8 + bcc _0800505C +_08005096: + mov r1, r10 + ldr r2, [sp, 0x3C] + cmp r1, r2 + bcc _08005038 + b _080052AA + .align 2, 0 +_080050A0: .4byte 0x03002fb0 +_080050A4: + mov r1, r8 + str r5, [sp, 0x44] + ldr r3, [sp] + adds r3, 0x8 + mov r12, r3 + mov r2, r8 + adds r2, 0x8 + str r2, [sp, 0x48] + ldr r3, [sp] + str r3, [sp, 0x4C] + str r2, [sp, 0x88] + subs r0, 0x8 + str r0, [sp, 0x80] + mov r0, r12 + str r0, [sp, 0x84] + subs r4, 0x8 + str r4, [sp, 0x7C] + cmp r8, r2 + bcs _0800512C +_080050CA: + ldr r2, [sp, 0x44] + ldm r2!, {r5} + str r2, [sp, 0x44] + ldr r4, [sp, 0x4C] + adds r3, r1, 0x1 + mov r10, r3 + cmp r4, r12 + bcs _08005124 + lsrs r0, r1, 3 + ldr r3, [sp, 0x4] + adds r2, r0, 0 + muls r2, r3 + adds r7, r2, 0 + movs r0, 0x7 + ands r1, r0 + lsls r6, r1, 2 +_080050EA: + adds r3, r5, 0 + movs r1, 0xF + ands r3, r1 + cmp r3, 0 + beq _0800511C + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + movs r1, 0x7 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_0800511C: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r12 + bcc _080050EA +_08005124: + mov r1, r10 + ldr r2, [sp, 0x48] + cmp r1, r2 + bcc _080050CA +_0800512C: + mov r1, r8 + ldr r3, _080052BC + str r3, [sp, 0x50] + ldr r0, [sp, 0x84] + ldr r2, [sp, 0x7C] + adds r0, r2 + mov r8, r0 + ldr r3, [sp, 0x88] + str r3, [sp, 0x54] + ldr r0, [sp, 0x84] + str r0, [sp, 0x58] + cmp r1, r3 + bcs _080051AC +_08005146: + ldr r2, [sp, 0x50] + ldm r2!, {r5} + str r2, [sp, 0x50] + ldr r4, [sp, 0x58] + adds r3, r1, 0x1 + mov r10, r3 + cmp r4, r8 + bcs _080051A4 + movs r0, 0x7 + mov r12, r0 + lsrs r0, r1, 3 + ldr r3, [sp, 0x4] + adds r2, r0, 0 + muls r2, r3 + adds r7, r2, 0 + mov r0, r12 + ands r1, r0 + lsls r6, r1, 2 +_0800516A: + adds r3, r5, 0 + movs r1, 0xF + ands r3, r1 + cmp r3, 0 + beq _0800519C + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r12 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_0800519C: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r8 + bcc _0800516A +_080051A4: + mov r1, r10 + ldr r2, [sp, 0x54] + cmp r1, r2 + bcc _08005146 +_080051AC: + ldr r1, [sp, 0x88] + ldr r3, _080052C0 + str r3, [sp, 0x5C] + ldr r0, [sp, 0x84] + mov r8, r0 + ldr r2, [sp, 0x80] + adds r2, r1, r2 + str r2, [sp, 0x60] + ldr r3, [sp] + str r3, [sp, 0x64] + cmp r1, r2 + bcs _0800522A +_080051C4: + ldr r0, [sp, 0x5C] + ldm r0!, {r5} + str r0, [sp, 0x5C] + ldr r4, [sp, 0x64] + adds r2, r1, 0x1 + mov r10, r2 + cmp r4, r8 + bcs _08005222 + movs r3, 0x7 + mov r12, r3 + lsrs r0, r1, 3 + ldr r3, [sp, 0x4] + adds r2, r0, 0 + muls r2, r3 + adds r7, r2, 0 + mov r0, r12 + ands r1, r0 + lsls r6, r1, 2 +_080051E8: + adds r3, r5, 0 + movs r1, 0xF + ands r3, r1 + cmp r3, 0 + beq _0800521A + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r12 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_0800521A: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r8 + bcc _080051E8 +_08005222: + mov r1, r10 + ldr r2, [sp, 0x60] + cmp r1, r2 + bcc _080051C4 +_0800522A: + ldr r4, [sp, 0x84] + ldr r1, [sp, 0x88] + ldr r3, _080052C4 + str r3, [sp, 0x68] + ldr r0, [sp, 0x7C] + adds r0, r4 + mov r8, r0 + ldr r2, [sp, 0x80] + adds r2, r1, r2 + str r2, [sp, 0x6C] + str r4, [sp, 0x70] + cmp r1, r2 + bcs _080052AA +_08005244: + ldr r3, [sp, 0x68] + ldm r3!, {r5} + str r3, [sp, 0x68] + ldr r4, [sp, 0x70] + adds r0, r1, 0x1 + mov r10, r0 + cmp r4, r8 + bcs _080052A2 + movs r2, 0x7 + mov r12, r2 + lsrs r0, r1, 3 + ldr r2, [sp, 0x4] + adds r3, r0, 0 + muls r3, r2 + adds r7, r3, 0 + mov r3, r12 + ands r1, r3 + lsls r6, r1, 2 +_08005268: + adds r3, r5, 0 + movs r0, 0xF + ands r3, r0 + cmp r3, 0 + beq _0800529A + lsrs r2, r4, 3 + lsls r2, 5 + add r2, r9 + adds r0, r4, 0 + mov r1, r12 + ands r0, r1 + lsrs r0, 1 + adds r2, r0 + adds r2, r7 + adds r2, r6 + movs r1, 0x1 + ands r1, r4 + lsls r1, 2 + lsls r3, r1 + movs r0, 0xF0 + asrs r0, r1 + ldrb r1, [r2] + ands r0, r1 + orrs r3, r0 + strb r3, [r2] +_0800529A: + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r8 + bcc _08005268 +_080052A2: + mov r1, r10 + ldr r2, [sp, 0x6C] + cmp r1, r2 + bcc _08005244 +_080052AA: + add sp, 0x8C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080052BC: .4byte 0x03002fb0 +_080052C0: .4byte 0x03002fd0 +_080052C4: .4byte 0x03002ff0 + thumb_func_end CopyGlyphToWindow + + thumb_func_start Text_ClearHorizontalSpan +Text_ClearHorizontalSpan: @ 80052C8 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, _08005328 + ldrh r5, [r0] + cmp r5, 0 + beq _0800531E + ldrb r1, [r4, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _0800532C + adds r0, r1 + ldr r1, [r0, 0x8] + str r1, [sp, 0x8] + ldrb r2, [r0, 0x3] + lsls r2, 3 + ldr r3, _08005330 + ldr r1, [sp, 0xC] + ands r1, r3 + orrs r1, r2 + str r1, [sp, 0xC] + ldrb r2, [r0, 0x4] + lsls r2, 19 + ldr r0, _08005334 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0xC] + ldr r0, _08005338 + adds r0, 0x81 + ldrb r1, [r4, 0x8] + ldrb r2, [r4, 0x9] + lsls r3, r6, 16 + lsrs r3, 16 + ldrb r0, [r0] + str r0, [sp] + lsls r0, r5, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + add r0, sp, 0x8 + bl PixelBlock_FillRect4Bpp +_0800531E: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08005328: .4byte 0x030009ea +_0800532C: .4byte 0x02020004 +_08005330: .4byte 0xffff0000 +_08005334: .4byte 0x0000ffff +_08005338: .4byte 0x03002f90 + thumb_func_end Text_ClearHorizontalSpan + + thumb_func_start fbox0_func +fbox0_func: @ 800533C + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08005360 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_08005360: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox0_func + + thumb_func_start fbox1_func +fbox1_func: @ 8005370 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08005398 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_08005398: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox1_func + + thumb_func_start fbox2_func +fbox2_func: @ 80053A8 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080053D0 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_080053D0: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox2_func + + thumb_func_start fbox3_func +fbox3_func: @ 80053E0 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08005408 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_08005408: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox3_func + + thumb_func_start fbox4_func +fbox4_func: @ 8005418 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08005440 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_08005440: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox4_func + + thumb_func_start fbox5_func +fbox5_func: @ 8005450 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08005478 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x5 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_08005478: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox5_func + + thumb_func_start fbox7_func +fbox7_func: @ 8005488 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080054B0 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x7 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_080054B0: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox7_func + + thumb_func_start fbox8_func +fbox8_func: @ 80054C0 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x14 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080054E8 + ldrb r1, [r2, 0x14] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] +_080054E8: + adds r0, r2, 0 + bl font_render_b + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end fbox8_func + + thumb_func_start sub_80054F8 +sub_80054F8: @ 80054F8 + push {lr} + adds r2, r0, 0 + adds r2, 0x14 + ldr r0, _08005510 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08005514 + movs r0, 0 + strb r0, [r2, 0x2] + b _08005524 + .align 2, 0 +_08005510: .4byte 0x03003014 +_08005514: + ldrb r0, [r2, 0x1] + movs r1, 0x61 + negs r1, r1 + ands r1, r0 + movs r0, 0x20 + negs r0, r0 + ands r1, r0 + strb r1, [r2, 0x1] +_08005524: + pop {r0} + bx r0 + thumb_func_end sub_80054F8 + + thumb_func_start remo_draw_bouncing_down_arrow +remo_draw_bouncing_down_arrow: @ 8005528 + push {r4-r7,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r6, r5, 0 + adds r6, 0x14 + ldr r7, _0800555C + ldrb r1, [r7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080055EE + ldrb r2, [r6, 0x1] + movs r0, 0x1F + ands r0, r2 + cmp r0, 0 + beq _08005560 + ldr r0, [r5, 0x14] + lsls r0, 19 + lsrs r0, 27 + subs r0, 0x1 + movs r1, 0x1F + ands r0, r1 + movs r1, 0x20 + negs r1, r1 + b _080055E8 + .align 2, 0 +_0800555C: .4byte 0x03003014 +_08005560: + ldrb r0, [r5, 0x4] + ldrb r2, [r5, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + ldrb r2, [r5, 0x8] + ldrb r3, [r5, 0x9] + movs r4, 0x8 + str r4, [sp] + movs r4, 0x10 + str r4, [sp, 0x4] + bl Window_FillPixelRect + ldr r0, [r7] + lsls r0, 30 + lsrs r0, 31 + cmp r0, 0 + beq _0800558A + cmp r0, 0x1 + beq _08005594 +_0800558A: + ldr r7, _08005590 + b _08005596 + .align 2, 0 +_08005590: .4byte 0x082e968c +_08005594: + ldr r7, _080055F8 +_08005596: + ldrb r0, [r5, 0x4] + ldr r2, _080055FC + ldr r1, [r6] + lsls r1, 17 + lsrs r1, 30 + adds r1, r2 + ldrb r3, [r1] + movs r4, 0x8 + str r4, [sp] + movs r2, 0x10 + str r2, [sp, 0x4] + ldrb r1, [r5, 0x8] + str r1, [sp, 0x8] + ldrb r1, [r5, 0x9] + str r1, [sp, 0xC] + str r4, [sp, 0x10] + str r2, [sp, 0x14] + adds r1, r7, 0 + movs r2, 0 + bl Window_CopyPixelRectToWindow + ldrb r0, [r5, 0x4] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r6, 0x1] + movs r1, 0x20 + negs r1, r1 + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r6, 0x1] + ldr r0, [r6] + lsls r0, 17 + lsrs r0, 30 + adds r0, 0x1 + movs r2, 0x3 + ands r0, r2 + lsls r0, 5 + movs r2, 0x61 + negs r2, r2 +_080055E8: + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x1] +_080055EE: + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080055F8: .4byte 0x082e974c +_080055FC: .4byte 0x082e9d0c + thumb_func_end remo_draw_bouncing_down_arrow + + thumb_func_start remo_clear_down_arrow +remo_clear_down_arrow: @ 8005600 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldrb r0, [r5, 0x4] + ldrb r2, [r5, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + ldrb r2, [r5, 0x8] + ldrb r3, [r5, 0x9] + movs r4, 0x8 + str r4, [sp] + movs r4, 0x10 + str r4, [sp, 0x4] + bl Window_FillPixelRect + ldrb r0, [r5, 0x4] + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end remo_clear_down_arrow + + thumb_func_start remo_is_it_time_to_continue_autopilot +remo_is_it_time_to_continue_autopilot: @ 8005634 + push {lr} + adds r1, r0, 0 + adds r1, 0x14 + ldrb r0, [r1, 0x2] + cmp r0, 0x31 + beq _08005648 + adds r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0 + b _0800564A +_08005648: + movs r0, 0x1 +_0800564A: + pop {r1} + bx r1 + thumb_func_end remo_is_it_time_to_continue_autopilot + + thumb_func_start remo_is_it_time_to_continue_plus_down_arrow +remo_is_it_time_to_continue_plus_down_arrow: @ 8005650 + push {r4,lr} + adds r2, r0, 0 + movs r4, 0 + ldr r0, _08005670 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08005674 + adds r0, r2, 0 + bl remo_is_it_time_to_continue_autopilot + lsls r0, 24 + lsrs r4, r0, 24 + b _0800568E + .align 2, 0 +_08005670: .4byte 0x03003014 +_08005674: + adds r0, r2, 0 + bl remo_draw_bouncing_down_arrow + ldr r0, _08005698 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0800568E + movs r4, 0x1 + movs r0, 0x5 + bl audio_play +_0800568E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08005698: .4byte 0x030022c0 + thumb_func_end remo_is_it_time_to_continue_plus_down_arrow + + thumb_func_start remo_is_it_time_to_continue +remo_is_it_time_to_continue: @ 800569C + push {r4,lr} + adds r2, r0, 0 + movs r4, 0 + ldr r0, _080056BC + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080056C0 + adds r0, r2, 0 + bl remo_is_it_time_to_continue_autopilot + lsls r0, 24 + lsrs r4, r0, 24 + b _080056D4 + .align 2, 0 +_080056BC: .4byte 0x03003014 +_080056C0: + ldr r0, _080056DC + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080056D4 + movs r4, 0x1 + movs r0, 0x5 + bl audio_play +_080056D4: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080056DC: .4byte 0x030022c0 + thumb_func_end remo_is_it_time_to_continue + + thumb_func_start draw_bouncing_down_arrow_2 +draw_bouncing_down_arrow_2: @ 80056E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + mov r9, r5 + ldr r5, [sp, 0x40] + mov r10, r5 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, r9 + ldrb r0, [r1] + cmp r0, 0 + beq _0800571A + subs r0, 0x1 + strb r0, [r1] + b _0800579A +_0800571A: + lsls r1, r3, 4 + orrs r1, r3 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r5, 0 + mov r2, r8 + adds r3, r7, 0 + bl Window_FillPixelRect + cmp r4, 0 + bne _0800579A + ldr r0, _0800574C + ldr r0, [r0] + lsls r0, 30 + lsrs r0, 31 + cmp r0, 0 + beq _08005748 + cmp r0, 0x1 + beq _08005754 +_08005748: + ldr r6, _08005750 + b _08005756 + .align 2, 0 +_0800574C: .4byte 0x03003014 +_08005750: .4byte 0x082e968c +_08005754: + ldr r6, _080057AC +_08005756: + ldr r2, _080057B0 + mov r0, r10 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + adds r0, r2 + ldrb r3, [r0] + movs r4, 0x8 + str r4, [sp] + movs r1, 0x10 + str r1, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + subs r0, r7, 0x2 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl Window_CopyPixelRectToWindow + adds r0, r5, 0 + movs r1, 0x2 + bl Window_CopyToVram + mov r1, r9 + strb r4, [r1] + mov r5, r10 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_0800579A: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080057AC: .4byte 0x082e974c +_080057B0: .4byte 0x082e9d0c + thumb_func_end draw_bouncing_down_arrow_2 + + thumb_func_start font_render_b +font_render_b: @ 80057B4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r6, 0 + adds r4, 0x14 + ldrb r0, [r6, 0x1C] + cmp r0, 0x6 + bls _080057C4 + b _08005D6C +_080057C4: + lsls r0, 2 + ldr r1, _080057D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080057D0: .4byte _080057D4 + .align 2, 0 +_080057D4: + .4byte _080057F0 + .4byte _08005C78 + .4byte _08005C8C + .4byte _08005CB8 + .4byte _08005CF0 + .4byte _08005D48 + .4byte _08005D5A +_080057F0: + ldr r2, _08005844 + ldrh r1, [r2, 0x2C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0800580A + ldrb r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0800580A + movs r0, 0 + strb r0, [r6, 0x1E] +_0800580A: + ldrb r1, [r6, 0x1E] + cmp r1, 0 + beq _0800584C + ldrb r0, [r6, 0x1D] + cmp r0, 0 + beq _0800584C + subs r0, r1, 0x1 + strb r0, [r6, 0x1E] + ldr r0, _08005848 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08005828 + b _08005B56 +_08005828: + ldrh r1, [r2, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08005834 + b _08005B56 +_08005834: + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4] + movs r0, 0 + strb r0, [r6, 0x1E] + b _08005B56 + .align 2, 0 +_08005844: .4byte 0x030022c0 +_08005848: .4byte 0x03003014 +_0800584C: + ldr r0, _0800586C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08005874 + ldr r0, _08005870 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08005874 + movs r0, 0x3 + b _08005876 + .align 2, 0 +_0800586C: .4byte 0x02022fec +_08005870: .4byte 0x03003014 +_08005874: + ldrb r0, [r6, 0x1D] +_08005876: + strb r0, [r6, 0x1E] + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + adds r0, r3, 0 + subs r0, 0xF8 + cmp r0, 0x7 + bls _0800588A + b _08005B90 +_0800588A: + lsls r0, 2 + ldr r1, _08005894 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08005894: .4byte _08005898 + .align 2, 0 +_08005898: + .4byte _08005B6C + .4byte _08005B5A + .4byte _08005B4C + .4byte _08005B48 + .4byte _080058E0 + .4byte _080058DC + .4byte _080058B8 + .4byte _08005D6C +_080058B8: + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + ldrb r1, [r6, 0x5] + ldr r0, _080058D8 + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + ldrb r0, [r6, 0x9] + adds r0, r1 + b _08005ABA + .align 2, 0 +_080058D8: .4byte 0x03002f80 +_080058DC: + ldr r0, [r6] + b _08005B30 +_080058E0: + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + subs r0, r3, 0x1 + cmp r0, 0x17 + bls _080058F0 + b _08005B90 +_080058F0: + lsls r0, 2 + ldr r1, _080058FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080058FC: .4byte _08005900 + .align 2, 0 +_08005900: + .4byte _08005960 + .4byte _08005982 + .4byte _080059A6 + .4byte _080059C0 + .4byte _08005A0E + .4byte _08005A12 + .4byte _08005A0A + .4byte _08005A2A + .4byte _08005A3A + .4byte _08005A58 + .4byte _08005A5C + .4byte _08005B5A + .4byte _08005A90 + .4byte _08005A98 + .4byte _08005AA4 + .4byte _08005A76 + .4byte _08005AD8 + .4byte _08005AF2 + .4byte _08005B02 + .4byte _08005B26 + .4byte _08005B36 + .4byte _08005B3E + .4byte _08005ABE + .4byte _08005ACC +_08005960: + ldr r2, [r6] + ldrb r1, [r2] + lsls r1, 4 + ldrb r3, [r6, 0xC] + movs r0, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r2, 0x1 + str r2, [r6] + lsls r0, 24 + lsrs r0, 28 + ldrb r2, [r6, 0xD] + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _08005A06 +_08005982: + ldr r1, [r6] + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + ldrb r3, [r6, 0xD] + movs r2, 0x10 + negs r2, r2 + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _08005A06 +_080059A6: + ldr r1, [r6] + ldrb r0, [r1] + lsls r0, 4 + ldrb r3, [r6, 0xD] + movs r2, 0xF + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + b _080059FE +_080059C0: + ldr r3, [r6] + ldrb r1, [r3] + lsls r1, 4 + ldrb r4, [r6, 0xC] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r5, r3, 0x1 + str r5, [r6] + ldrb r3, [r3, 0x1] + adds r1, r2, 0 + ands r1, r3 + ldrb r4, [r6, 0xD] + movs r3, 0x10 + negs r3, r3 + ands r3, r4 + orrs r3, r1 + strb r3, [r6, 0xD] + adds r4, r5, 0x1 + str r4, [r6] + ldrb r1, [r5, 0x1] + lsls r1, 4 + ands r2, r3 + orrs r2, r1 + strb r2, [r6, 0xD] + adds r4, 0x1 + str r4, [r6] + lsls r0, 24 + lsrs r0, 28 +_080059FE: + lsls r1, r2, 28 + lsrs r1, 28 + lsls r2, 24 + lsrs r2, 28 +_08005A06: + bl GenerateFontHalfRowLut +_08005A0A: + movs r0, 0x2 + b _08005D6E +_08005A0E: + ldr r0, [r6] + b _08005B30 +_08005A12: + ldr r0, [r6] + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r6] + b _08005B30 +_08005A2A: + ldr r0, [r6] + ldrb r1, [r0] + strb r1, [r6, 0x1E] + adds r0, 0x1 + str r0, [r6] + movs r0, 0x6 + strb r0, [r6, 0x1C] + b _08005A0A +_08005A3A: + movs r0, 0x1 + strb r0, [r6, 0x1C] + ldr r0, _08005A54 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08005A4C + b _08005B56 +_08005A4C: + movs r0, 0 + strb r0, [r4, 0x2] + b _08005B56 + .align 2, 0 +_08005A54: .4byte 0x03003014 +_08005A58: + movs r0, 0x5 + b _08005D56 +_08005A5C: + ldr r0, [r6] + ldrb r3, [r0] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r0, [r0, 0x1] + lsls r0, 8 + orrs r3, r0 + adds r1, 0x1 + str r1, [r6] + adds r0, r3, 0 + bl song_play_for_text + b _08005A0A +_08005A76: + ldr r0, [r6] + ldrb r3, [r0] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r0, [r0, 0x1] + lsls r0, 8 + orrs r3, r0 + adds r1, 0x1 + str r1, [r6] + adds r0, r3, 0 + bl audio_play + b _08005A0A +_08005A90: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r3, [r6, 0x6] + b _08005AF8 +_08005A98: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x7] + adds r0, r2 + strb r0, [r6, 0x9] + b _08005AFC +_08005AA4: + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + ldrb r0, [r6, 0x7] +_08005ABA: + strb r0, [r6, 0x9] + b _08005A0A +_08005ABE: + ldr r0, _08005AC8 + bl MPlayStop_rev01 + b _08005A0A + .align 2, 0 +_08005AC8: .4byte 0x03007420 +_08005ACC: + ldr r0, _08005AD4 + bl m4aMPlayContinue + b _08005A0A + .align 2, 0 +_08005AD4: .4byte 0x03007420 +_08005AD8: + ldr r0, [r6] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r6] + cmp r4, 0 + ble _08005A0A + adds r0, r6, 0 + adds r1, r4, 0 + bl Text_ClearHorizontalSpan + ldrb r0, [r6, 0x8] + adds r0, r4 + b _08005C6E +_08005AF2: + ldr r1, [r6] + ldrb r0, [r6, 0x6] + ldrb r3, [r1] +_08005AF8: + adds r0, r3 + strb r0, [r6, 0x8] +_08005AFC: + adds r1, 0x1 + str r1, [r6] + b _08005A0A +_08005B02: + ldr r0, [r6] + ldrb r2, [r0] + ldrb r1, [r6, 0x6] + adds r2, r1 + adds r0, 0x1 + str r0, [r6] + ldrb r0, [r6, 0x8] + subs r4, r2, r0 + cmp r4, 0 + bgt _08005B18 + b _08005A0A +_08005B18: + adds r0, r6, 0 + adds r1, r4, 0 + bl Text_ClearHorizontalSpan + ldrb r0, [r6, 0x8] + adds r0, r4 + b _08005C6E +_08005B26: + ldr r0, [r6] + ldrb r2, [r0] + adds r1, r6, 0 + adds r1, 0x20 + strb r2, [r1] +_08005B30: + adds r0, 0x1 + str r0, [r6] + b _08005A0A +_08005B36: + adds r1, r6, 0 + adds r1, 0x21 + movs r0, 0x1 + b _08005B44 +_08005B3E: + adds r1, r6, 0 + adds r1, 0x21 + movs r0, 0 +_08005B44: + strb r0, [r1] + b _08005A0A +_08005B48: + movs r0, 0x2 + b _08005B4E +_08005B4C: + movs r0, 0x3 +_08005B4E: + strb r0, [r6, 0x1C] + adds r0, r6, 0 + bl sub_80054F8 +_08005B56: + movs r0, 0x3 + b _08005D6E +_08005B5A: + ldr r0, [r6] + ldrb r3, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r3, r1 + adds r0, 0x1 + str r0, [r6] + b _08005B90 +_08005B6C: + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + ldrb r0, [r6, 0x4] + adds r1, r3, 0 + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0x9] + bl TextBox_DrawKeypadIcon + ldr r1, _08005B8C + adds r1, 0x80 + strb r0, [r1] + ldrb r3, [r6, 0xA] + adds r0, r3 + b _08005C6A + .align 2, 0 +_08005B8C: .4byte 0x03002f90 +_08005B90: + ldr r0, [r4] + lsls r0, 28 + lsrs r0, 28 + cmp r0, 0x8 + bhi _08005C10 + lsls r0, 2 + ldr r1, _08005BA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08005BA4: .4byte _08005BA8 + .align 2, 0 +_08005BA8: + .4byte _08005BCC + .4byte _08005BDA + .4byte _08005BE8 + .4byte _08005BE8 + .4byte _08005BE8 + .4byte _08005BE8 + .4byte _08005C10 + .4byte _08005BF6 + .4byte _08005C04 +_08005BCC: + adds r0, r6, 0 + adds r0, 0x21 + ldrb r1, [r0] + adds r0, r3, 0 + bl Text_DecompressGlyphFont0 + b _08005C10 +_08005BDA: + adds r0, r6, 0 + adds r0, 0x21 + ldrb r1, [r0] + adds r0, r3, 0 + bl Text_DecompressGlyphFont1 + b _08005C10 +_08005BE8: + adds r0, r6, 0 + adds r0, 0x21 + ldrb r1, [r0] + adds r0, r3, 0 + bl Text_DecompressGlyphFont2 + b _08005C10 +_08005BF6: + adds r0, r6, 0 + adds r0, 0x21 + ldrb r1, [r0] + adds r0, r3, 0 + bl Text_DecompressGlyphFont7 + b _08005C10 +_08005C04: + adds r0, r6, 0 + adds r0, 0x21 + ldrb r1, [r0] + adds r0, r3, 0 + bl Text_DecompressGlyphFont8 +_08005C10: + adds r0, r6, 0 + bl CopyGlyphToWindow + adds r2, r6, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0 + beq _08005C48 + ldr r1, _08005C44 + adds r1, 0x80 + ldrb r0, [r1] + ldrb r3, [r6, 0x8] + adds r0, r3 + strb r0, [r6, 0x8] + ldrb r2, [r2] + ldrb r0, [r1] + subs r4, r2, r0 + cmp r4, 0 + ble _08005C70 + adds r0, r6, 0 + adds r1, r4, 0 + bl Text_ClearHorizontalSpan + ldrb r0, [r6, 0x8] + adds r0, r4 + b _08005C6E + .align 2, 0 +_08005C44: .4byte 0x03002f90 +_08005C48: + adds r0, r6, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0 + beq _08005C64 + ldr r0, _08005C60 + adds r0, 0x80 + ldrb r1, [r6, 0xA] + ldrb r0, [r0] + adds r1, r0 + ldrb r0, [r6, 0x8] + b _08005C6C + .align 2, 0 +_08005C60: .4byte 0x03002f90 +_08005C64: + ldr r0, _08005C74 + adds r0, 0x80 + ldrb r0, [r0] +_08005C6A: + ldrb r1, [r6, 0x8] +_08005C6C: + adds r0, r1 +_08005C6E: + strb r0, [r6, 0x8] +_08005C70: + movs r0, 0 + b _08005D6E + .align 2, 0 +_08005C74: .4byte 0x03002f90 +_08005C78: + adds r0, r6, 0 + bl remo_is_it_time_to_continue + lsls r0, 16 + cmp r0, 0 + bne _08005C86 + b _08005B56 +_08005C86: + movs r0, 0 + strb r0, [r6, 0x1C] + b _08005B56 +_08005C8C: + adds r0, r6, 0 + bl remo_is_it_time_to_continue_plus_down_arrow + lsls r0, 16 + cmp r0, 0 + bne _08005C9A + b _08005B56 +_08005C9A: + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + ldrb r0, [r6, 0x6] + movs r1, 0 + strb r0, [r6, 0x8] + ldrb r0, [r6, 0x7] + strb r0, [r6, 0x9] + strb r1, [r6, 0x1C] + b _08005B56 +_08005CB8: + adds r0, r6, 0 + bl remo_is_it_time_to_continue_plus_down_arrow + lsls r0, 16 + cmp r0, 0 + bne _08005CC6 + b _08005B56 +_08005CC6: + adds r0, r6, 0 + bl remo_clear_down_arrow + ldrb r1, [r6, 0x5] + ldr r0, _08005CEC + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + strb r1, [r6, 0x1F] + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + movs r0, 0x4 + strb r0, [r6, 0x1C] + b _08005B56 + .align 2, 0 +_08005CEC: .4byte 0x03002f80 +_08005CF0: + ldrb r0, [r6, 0x1F] + cmp r0, 0 + beq _08005D44 + bl sub_8197964 + ldr r1, _08005D1C + adds r0, r1 + ldrb r4, [r0] + ldrb r2, [r6, 0x1F] + cmp r2, r4 + bge _08005D20 + ldrb r0, [r6, 0x4] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl Window_ScrollVertically + movs r0, 0 + b _08005D38 + .align 2, 0 +_08005D1C: .4byte 0x082e9d10 +_08005D20: + ldrb r0, [r6, 0x4] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + adds r2, r4, 0 + bl Window_ScrollVertically + ldrb r0, [r6, 0x1F] + subs r0, r4 +_08005D38: + strb r0, [r6, 0x1F] + ldrb r0, [r6, 0x4] + movs r1, 0x2 + bl Window_CopyToVram + b _08005B56 +_08005D44: + strb r0, [r6, 0x1C] + b _08005B56 +_08005D48: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08005D56 + b _08005B56 +_08005D56: + strb r0, [r6, 0x1C] + b _08005B56 +_08005D5A: + ldrb r0, [r6, 0x1E] + adds r1, r0, 0 + cmp r1, 0 + beq _08005D68 + subs r0, 0x1 + strb r0, [r6, 0x1E] + b _08005B56 +_08005D68: + strb r1, [r6, 0x1C] + b _08005B56 +_08005D6C: + movs r0, 0x1 +_08005D6E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end font_render_b + + thumb_func_start sub_8005D74 +sub_8005D74: @ 8005D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r2, 0 + mov r1, sp + adds r1, 0x7 +_08005D8C: + strb r2, [r1] + subs r1, 0x1 + cmp r1, sp + bge _08005D8C + movs r5, 0 + movs r6, 0 + adds r4, r0, 0 + movs r2, 0 +_08005D9C: + adds r0, r4, r2 + ldrb r3, [r0] + adds r2, 0x1 + adds r0, r3, 0 + subs r0, 0xF7 + cmp r0, 0x8 + bhi _08005E6A + lsls r0, 2 + ldr r1, _08005DB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08005DB4: .4byte _08005DB8 + .align 2, 0 +_08005DB8: + .4byte _08005E64 + .4byte _08005E68 + .4byte _08005E68 + .4byte _08005E70 + .4byte _08005E70 + .4byte _08005DEC + .4byte _08005E64 + .4byte _08005DDC + .4byte _08005DDC +_08005DDC: + mov r1, sp + adds r0, r1, r6 + strb r5, [r0] + movs r5, 0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _08005E70 +_08005DEC: + adds r0, r4, r2 + ldrb r0, [r0] + adds r2, 0x1 + subs r0, 0x1 + cmp r0, 0x15 + bhi _08005E70 + lsls r0, 2 + ldr r1, _08005E04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08005E04: .4byte _08005E08 + .align 2, 0 +_08005E08: + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E60 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E70 + .4byte _08005E64 + .4byte _08005E70 + .4byte _08005E70 + .4byte _08005E62 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E70 + .4byte _08005E62 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E64 + .4byte _08005E70 + .4byte _08005E70 +_08005E60: + adds r2, 0x1 +_08005E62: + adds r2, 0x1 +_08005E64: + adds r2, 0x1 + b _08005E70 +_08005E68: + adds r2, 0x1 +_08005E6A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08005E70: + cmp r3, 0xFF + bne _08005D9C + movs r5, 0 + movs r2, 0 +_08005E78: + mov r1, sp + adds r0, r1, r2 + ldrb r1, [r0] + cmp r5, r1 + bcs _08005E84 + ldrb r5, [r0] +_08005E84: + adds r2, 0x1 + cmp r2, 0x7 + ble _08005E78 + adds r0, r7, 0 + movs r1, 0 + bl fbox_get_field + add r0, r8 + lsls r0, 24 + lsrs r0, 24 + muls r0, r5 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8005D74 + + thumb_func_start font_get_get_width_func +font_get_get_width_func: @ 8005EA8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r0, _08005EC0 + adds r2, r0, 0x4 + adds r1, r0, 0 +_08005EB6: + ldr r0, [r1] + cmp r4, r0 + bne _08005EC4 + ldr r0, [r2] + b _08005ED0 + .align 2, 0 +_08005EC0: .4byte 0x082e9d14 +_08005EC4: + adds r2, 0x8 + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x8 + bls _08005EB6 + movs r0, 0 +_08005ED0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end font_get_get_width_func + + thumb_func_start font_get_width_of_string +font_get_width_of_string: @ 8005ED8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + movs r0, 0 + mov r9, r0 + movs r7, 0 + adds r0, r6, 0 + bl font_get_get_width_func + mov r8, r0 + cmp r0, 0 + bne _08005F06 +_08005F02: + movs r0, 0 + b _0800612E +_08005F06: + lsls r0, r5, 16 + asrs r2, r0, 16 + movs r1, 0x1 + negs r1, r1 + str r0, [sp, 0x4] + cmp r2, r1 + bne _08005F24 + adds r0, r6, 0 + movs r1, 0x2 + bl fbox_get_field + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + b _08005F26 +_08005F24: + mov r10, r2 +_08005F26: + movs r2, 0 + str r2, [sp] + movs r5, 0 + movs r6, 0 + b _0800611E +_08005F30: + ldrb r1, [r4] + adds r0, r1, 0 + subs r0, 0xF7 + cmp r0, 0x7 + bls _08005F3C + b _080060F8 +_08005F3C: + lsls r0, 2 + ldr r1, _08005F48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08005F48: .4byte _08005F4C + .align 2, 0 +_08005F4C: + .4byte _08005FA2 + .4byte _080060BC + .4byte _080060BC + .4byte _0800611C + .4byte _0800611C + .4byte _08005FEA + .4byte _08005F78 + .4byte _08005F6C +_08005F6C: + ldr r0, [sp] + cmp r5, r0 + bls _08005F74 + str r5, [sp] +_08005F74: + movs r5, 0 + b _0800611C +_08005F78: + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0x3 + beq _08005F98 + cmp r0, 0x3 + bgt _08005F8A + cmp r0, 0x2 + beq _08005F90 + b _08005F02 +_08005F8A: + cmp r0, 0x4 + beq _08005FA0 + b _08005F02 +_08005F90: + ldr r6, _08005F94 + b _08005FA2 + .align 2, 0 +_08005F94: .4byte 0x02021cc4 +_08005F98: + ldr r6, _08005F9C + b _08005FA2 + .align 2, 0 +_08005F9C: .4byte 0x02021dc4 +_08005FA0: + ldr r6, _08005FB4 +_08005FA2: + cmp r6, 0 + bne _08005FE0 + adds r4, 0x1 + ldrb r0, [r4] + bl sub_81AFC74 + adds r6, r0, 0 + b _08005FE0 + .align 2, 0 +_08005FB4: .4byte 0x02021ec4 +_08005FB8: + ldrb r0, [r6] + adds r6, 0x1 + mov r1, r9 + bl _call_via_r8 + cmp r7, 0 + ble _08005FD0 + cmp r0, r7 + bge _08005FCC + adds r0, r7, 0 +_08005FCC: + adds r5, r0 + b _08005FE0 +_08005FD0: + adds r5, r0 + mov r2, r9 + cmp r2, 0 + beq _08005FE0 + ldrb r0, [r4, 0x1] + cmp r0, 0xFF + beq _08005FE0 + add r5, r10 +_08005FE0: + ldrb r0, [r6] + cmp r0, 0xFF + bne _08005FB8 + movs r6, 0 + b _0800611C +_08005FEA: + adds r4, 0x1 + ldrb r0, [r4] + subs r0, 0x1 + cmp r0, 0x15 + bls _08005FF6 + b _0800611C +_08005FF6: + lsls r0, 2 + ldr r1, _08006000 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08006000: .4byte _08006004 + .align 2, 0 +_08006004: + .4byte _08006060 + .4byte _08006060 + .4byte _08006060 + .4byte _0800605C + .4byte _08006060 + .4byte _08006064 + .4byte _0800611C + .4byte _08006060 + .4byte _0800611C + .4byte _0800611C + .4byte _0800605E + .4byte _08006060 + .4byte _08006060 + .4byte _08006060 + .4byte _0800611C + .4byte _0800605E + .4byte _08006090 + .4byte _08006098 + .4byte _0800609E + .4byte _080060AA + .4byte _080060B0 + .4byte _080060B6 +_0800605C: + adds r4, 0x1 +_0800605E: + adds r4, 0x1 +_08006060: + adds r4, 0x1 + b _0800611C +_08006064: + adds r4, 0x1 + ldrb r0, [r4] + bl font_get_get_width_func + mov r8, r0 + cmp r0, 0 + bne _08006074 + b _08005F02 +_08006074: + ldr r0, [sp, 0x4] + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0800611C + ldrb r0, [r4] + movs r1, 0x2 + bl fbox_get_field + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + b _0800611C +_08006090: + adds r4, 0x1 + ldrb r0, [r4] +_08006094: + adds r5, r0 + b _0800611C +_08006098: + adds r4, 0x1 + ldrb r5, [r4] + b _0800611C +_0800609E: + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, r5 + bls _0800611C + adds r5, r0, 0 + b _0800611C +_080060AA: + adds r4, 0x1 + ldrb r7, [r4] + b _0800611C +_080060B0: + movs r2, 0x1 + mov r9, r2 + b _0800611C +_080060B6: + movs r0, 0 + mov r9, r0 + b _0800611C +_080060BC: + ldrb r0, [r4] + cmp r0, 0xF9 + bne _080060D6 + adds r4, 0x1 + ldrb r0, [r4] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r0, r1 + mov r1, r9 + bl _call_via_r8 + b _080060E2 +_080060D6: + adds r4, 0x1 + ldrb r0, [r4] + bl Font_ReturnsValueFromLUT + lsls r0, 24 + lsrs r0, 24 +_080060E2: + cmp r7, 0 + ble _080060EE + cmp r0, r7 + bge _08006094 + adds r0, r7, 0 + b _08006094 +_080060EE: + adds r5, r0 + mov r0, r9 + cmp r0, 0 + beq _0800611C + b _08006114 +_080060F8: + adds r0, r1, 0 + mov r1, r9 + bl _call_via_r8 + cmp r7, 0 + ble _0800610C + cmp r0, r7 + bge _08006094 + adds r0, r7, 0 + b _08006094 +_0800610C: + adds r5, r0 + mov r2, r9 + cmp r2, 0 + beq _0800611C +_08006114: + ldrb r0, [r4, 0x1] + cmp r0, 0xFF + beq _0800611C + add r5, r10 +_0800611C: + adds r4, 0x1 +_0800611E: + ldrb r0, [r4] + cmp r0, 0xFF + beq _08006126 + b _08005F30 +_08006126: + ldr r0, [sp] + cmp r5, r0 + bls _0800612E + adds r0, r5, 0 +_0800612E: + 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 font_get_width_of_string + + thumb_func_start font_render_some +font_render_some: @ 8006140 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r0 + adds r6, r2, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + mov r4, sp + adds r4, 0x1 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + bl save_remo_colors + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x3 + mov r10, r0 + movs r0, 0x1 + movs r1, 0 + movs r2, 0x3 + bl GenerateFontHalfRowLut + adds r7, r6, 0 + movs r6, 0 +_08006182: + adds r0, r7, r6 + ldrb r0, [r0] + mov r8, r0 + adds r6, 0x1 + subs r0, 0xF7 + cmp r0, 0x8 + bhi _0800627E + lsls r0, 2 + ldr r1, _0800619C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800619C: .4byte _080061A0 + .align 2, 0 +_080061A0: + .4byte _08006276 + .4byte _08006276 + .4byte _08006276 + .4byte _080062B8 + .4byte _080062B8 + .4byte _080061C4 + .4byte _08006276 + .4byte _080062B8 + .4byte _080062B8 +_080061C4: + adds r0, r7, r6 + ldrb r0, [r0] + adds r6, 0x1 + subs r0, 0x1 + cmp r0, 0x15 + bhi _080062B8 + lsls r0, 2 + ldr r1, _080061DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080061DC: .4byte _080061E0 + .align 2, 0 +_080061E0: + .4byte _0800624A + .4byte _08006254 + .4byte _0800625C + .4byte _08006238 + .4byte _08006276 + .4byte _08006270 + .4byte _080062B8 + .4byte _08006276 + .4byte _080062B8 + .4byte _080062B8 + .4byte _0800627A + .4byte _08006276 + .4byte _08006276 + .4byte _08006276 + .4byte _080062B8 + .4byte _0800627A + .4byte _08006276 + .4byte _08006276 + .4byte _08006276 + .4byte _08006276 + .4byte _080062B8 + .4byte _080062B8 +_08006238: + adds r0, r7, r6 + ldrb r0, [r0] + str r0, [sp, 0x8] + adds r6, 0x1 + adds r0, r7, r6 + ldrb r0, [r0] + str r0, [sp, 0xC] + adds r6, 0x1 + b _0800625C +_0800624A: + adds r0, r7, r6 + ldrb r0, [r0] + str r0, [sp, 0x8] + adds r6, 0x1 + b _08006266 +_08006254: + adds r0, r7, r6 + ldrb r0, [r0] + str r0, [sp, 0xC] + b _08006262 +_0800625C: + adds r0, r7, r6 + ldrb r0, [r0] + mov r10, r0 +_08006262: + adds r6, 0x1 + ldr r0, [sp, 0x8] +_08006266: + ldr r1, [sp, 0xC] + mov r2, r10 + bl GenerateFontHalfRowLut + b _080062B8 +_08006270: + adds r0, r7, r6 + ldrb r0, [r0] + str r0, [sp, 0x4] +_08006276: + adds r6, 0x1 + b _080062B8 +_0800627A: + adds r6, 0x1 + b _08006276 +_0800627E: + ldr r0, [sp, 0x4] + cmp r0, 0x1 + beq _08006290 + cmp r0, 0x9 + bne _08006290 + mov r0, r8 + bl Text_DecompressGlyphFont9 + b _08006298 +_08006290: + mov r0, r8 + movs r1, 0x1 + bl Text_DecompressGlyphFont1 +_08006298: + ldr r4, _080062E0 + ldr r5, _080062E4 + adds r0, r4, 0 + mov r1, r9 + adds r2, r5, 0 + bl CpuSet + adds r4, 0x40 + mov r1, r9 + adds r1, 0x20 + adds r0, r4, 0 + adds r2, r5, 0 + bl CpuSet + movs r0, 0x40 + add r9, r0 +_080062B8: + mov r0, r8 + cmp r0, 0xFF + beq _080062C0 + b _08006182 +_080062C0: + mov r0, sp + mov r1, sp + adds r1, 0x1 + mov r2, sp + adds r2, 0x2 + bl restore_remo_colors + movs r0, 0x1 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080062E0: .4byte 0x03002f90 +_080062E4: .4byte 0x04000008 + thumb_func_end font_render_some + + thumb_func_start TextBox_DrawKeypadIcon +TextBox_DrawKeypadIcon: @ 80062E8 + push {r4,r5,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, _08006330 + lsrs r1, 22 + adds r1, r4 + ldrh r5, [r1] + lsls r5, 5 + ldr r4, _08006334 + adds r5, r4 + movs r4, 0x80 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + ldrb r4, [r1, 0x2] + str r4, [sp, 0x10] + ldrb r1, [r1, 0x3] + str r1, [sp, 0x14] + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl Window_CopyPixelRectToWindow + adds r0, r4, 0 + add sp, 0x18 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08006330: .4byte 0x082e9d5c +_08006334: .4byte 0x082e9d90 + thumb_func_end TextBox_DrawKeypadIcon + + thumb_func_start sub_8006338 +sub_8006338: @ 8006338 + lsls r0, 24 + ldr r1, _08006344 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08006344: .4byte 0x082e9d5c + thumb_func_end sub_8006338 + + thumb_func_start Font_ReturnsValueFromLUT +Font_ReturnsValueFromLUT: @ 8006348 + lsls r0, 24 + ldr r1, _08006354 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0, 0x2] + bx lr + .align 2, 0 +_08006354: .4byte 0x082e9d5c + thumb_func_end Font_ReturnsValueFromLUT + + thumb_func_start sub_8006358 +sub_8006358: @ 8006358 + lsls r0, 24 + ldr r1, _08006364 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0, 0x3] + bx lr + .align 2, 0 +_08006364: .4byte 0x082e9d5c + thumb_func_end sub_8006358 + + thumb_func_start fboxes_set_default_ptr +fboxes_set_default_ptr: @ 8006368 + push {lr} + ldr r0, _08006374 + bl fboxes_set_ptr + pop {r0} + bx r0 + .align 2, 0 +_08006374: .4byte 0x082ea590 + thumb_func_end fboxes_set_default_ptr + + thumb_func_start fbox_get_field +fbox_get_field: @ 8006378 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + cmp r1, 0x7 + bhi _08006456 + lsls r0, r1, 2 + ldr r1, _08006394 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08006394: .4byte _08006398 + .align 2, 0 +_08006398: + .4byte _080063B8 + .4byte _080063CC + .4byte _080063E0 + .4byte _080063F4 + .4byte _08006408 + .4byte _0800641C + .4byte _08006430 + .4byte _08006448 +_080063B8: + ldr r1, _080063C8 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + b _08006456 + .align 2, 0 +_080063C8: .4byte 0x082ea590 +_080063CC: + ldr r1, _080063DC + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + b _08006456 + .align 2, 0 +_080063DC: .4byte 0x082ea590 +_080063E0: + ldr r1, _080063F0 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x6] + b _08006456 + .align 2, 0 +_080063F0: .4byte 0x082ea590 +_080063F4: + ldr r1, _08006404 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x7] + b _08006456 + .align 2, 0 +_08006404: .4byte 0x082ea590 +_08006408: + ldr r0, _08006418 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x8] + b _0800643C + .align 2, 0 +_08006418: .4byte 0x082ea590 +_0800641C: + ldr r0, _0800642C + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x8] + b _08006454 + .align 2, 0 +_0800642C: .4byte 0x082ea590 +_08006430: + ldr r0, _08006444 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x9] +_0800643C: + lsls r0, 28 + lsrs r0, 28 + b _08006456 + .align 2, 0 +_08006444: .4byte 0x082ea590 +_08006448: + ldr r0, _0800645C + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x9] +_08006454: + lsrs r0, 4 +_08006456: + pop {r1} + bx r1 + .align 2, 0 +_0800645C: .4byte 0x082ea590 + thumb_func_end fbox_get_field + + thumb_func_start sub_8006460 +sub_8006460: @ 8006460 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08006474 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .align 2, 0 +_08006474: .4byte 0x082ea608 + thumb_func_end sub_8006460 + + thumb_func_start Text_DecompressGlyphFont0 +Text_DecompressGlyphFont0: @ 8006478 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + cmp r1, 0x1 + bne _080064C4 + lsrs r2, r0, 20 + lsls r2, 9 + movs r0, 0xF + ands r0, r3 + lsls r0, 4 + ldr r1, _080064BC + adds r0, r1 + adds r5, r2, r0 + ldr r4, _080064C0 + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0x8 + strb r0, [r1] + adds r4, 0x81 + movs r0, 0xC + strb r0, [r4] + b _08006534 + .align 2, 0 +_080064BC: .4byte 0x086544e4 +_080064C0: .4byte 0x03002f90 +_080064C4: + lsls r1, r3, 6 + ldr r0, _080064F4 + adds r5, r1, r0 + ldr r4, _080064F8 + ldr r0, _080064FC + adds r0, r3, r0 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x80 + strb r1, [r0] + cmp r1, 0x8 + bhi _08006500 + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + b _0800652C + .align 2, 0 +_080064F4: .4byte 0x08633ce4 +_080064F8: .4byte 0x03002f90 +_080064FC: .4byte 0x0863bce4 +_08006500: + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x30 + adds r1, r4, 0 + adds r1, 0x60 + bl font_render_sub +_0800652C: + ldr r0, _0800653C + adds r0, 0x81 + movs r1, 0xD + strb r1, [r0] +_08006534: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800653C: .4byte 0x03002f90 + thumb_func_end Text_DecompressGlyphFont0 + + thumb_func_start get_font_width_unk3 +get_font_width_unk3: @ 8006540 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, 0x1 + beq _08006558 + ldr r0, _08006554 + adds r0, r2, r0 + ldrb r0, [r0] + b _0800655A + .align 2, 0 +_08006554: .4byte 0x0863bce4 +_08006558: + movs r0, 0x8 +_0800655A: + pop {r1} + bx r1 + thumb_func_end get_font_width_unk3 + + thumb_func_start Text_DecompressGlyphFont7 +Text_DecompressGlyphFont7: @ 8006560 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + cmp r1, 0x1 + bne _080065AC + lsrs r2, r0, 20 + lsls r2, 9 + movs r5, 0xF + adds r0, r3, 0 + ands r0, r5 + lsls r0, 4 + ldr r1, _080065A4 + adds r0, r1 + adds r6, r2, r0 + ldr r4, _080065A8 + adds r0, r6, 0 + adds r1, r4, 0 + bl font_render_sub + movs r1, 0x80 + lsls r1, 1 + adds r0, r6, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0x8 + strb r0, [r1] + adds r4, 0x81 + strb r5, [r4] + b _0800661C + .align 2, 0 +_080065A4: .4byte 0x086584e4 +_080065A8: .4byte 0x03002f90 +_080065AC: + lsls r1, r3, 6 + ldr r0, _080065DC + adds r6, r1, r0 + ldr r4, _080065E0 + ldr r0, _080065E4 + adds r0, r3, r0 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x80 + strb r1, [r0] + cmp r1, 0x8 + bhi _080065E8 + adds r0, r6, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + b _08006614 + .align 2, 0 +_080065DC: .4byte 0x0863bee4 +_080065E0: .4byte 0x03002f90 +_080065E4: .4byte 0x08643ee4 +_080065E8: + adds r0, r6, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x30 + adds r1, r4, 0 + adds r1, 0x60 + bl font_render_sub +_08006614: + ldr r0, _08006624 + adds r0, 0x81 + movs r1, 0xF + strb r1, [r0] +_0800661C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006624: .4byte 0x03002f90 + thumb_func_end Text_DecompressGlyphFont7 + + thumb_func_start get_font_width_black_en +get_font_width_black_en: @ 8006628 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, 0x1 + beq _08006640 + ldr r0, _0800663C + adds r0, r2, r0 + ldrb r0, [r0] + b _08006642 + .align 2, 0 +_0800663C: .4byte 0x08643ee4 +_08006640: + movs r0, 0x8 +_08006642: + pop {r1} + bx r1 + thumb_func_end get_font_width_black_en + + thumb_func_start Text_DecompressGlyphFont8 +Text_DecompressGlyphFont8: @ 8006648 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + cmp r1, 0x1 + bne _08006694 + lsrs r2, r0, 20 + lsls r2, 9 + movs r0, 0xF + ands r0, r3 + lsls r0, 4 + ldr r1, _0800668C + adds r0, r1 + adds r5, r2, r0 + ldr r4, _08006690 + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0x8 + strb r0, [r1] + adds r4, 0x81 + movs r0, 0xC + strb r0, [r4] + b _08006704 + .align 2, 0 +_0800668C: .4byte 0x086544e4 +_08006690: .4byte 0x03002f90 +_08006694: + lsls r1, r3, 6 + ldr r0, _080066C4 + adds r5, r1, r0 + ldr r4, _080066C8 + ldr r0, _080066CC + adds r0, r3, r0 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x80 + strb r1, [r0] + cmp r1, 0x8 + bhi _080066D0 + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + b _080066FC + .align 2, 0 +_080066C4: .4byte 0x0862bae4 +_080066C8: .4byte 0x03002f90 +_080066CC: .4byte 0x08633ae4 +_080066D0: + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x30 + adds r1, r4, 0 + adds r1, 0x60 + bl font_render_sub +_080066FC: + ldr r0, _0800670C + adds r0, 0x81 + movs r1, 0xC + strb r1, [r0] +_08006704: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800670C: .4byte 0x03002f90 + thumb_func_end Text_DecompressGlyphFont8 + + thumb_func_start get_font_width_unk2 +get_font_width_unk2: @ 8006710 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, 0x1 + beq _08006728 + ldr r0, _08006724 + adds r0, r2, r0 + ldrb r0, [r0] + b _0800672A + .align 2, 0 +_08006724: .4byte 0x08633ae4 +_08006728: + movs r0, 0x8 +_0800672A: + pop {r1} + bx r1 + thumb_func_end get_font_width_unk2 + + thumb_func_start Text_DecompressGlyphFont2 +Text_DecompressGlyphFont2: @ 8006730 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + cmp r1, 0x1 + bne _080067A0 + lsrs r2, r0, 19 + lsls r2, 9 + movs r0, 0x7 + ands r0, r6 + lsls r0, 5 + ldr r1, _08006794 + adds r0, r1 + adds r4, r2, r0 + ldr r5, _08006798 + adds r0, r4, 0 + adds r1, r5, 0 + bl font_render_sub + adds r0, r4, 0 + adds r0, 0x10 + adds r1, r5, 0 + adds r1, 0x20 + bl font_render_sub + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, r1 + adds r1, r5, 0 + adds r1, 0x40 + bl font_render_sub + movs r1, 0x88 + lsls r1, 1 + adds r0, r4, r1 + adds r1, r5, 0 + adds r1, 0x60 + bl font_render_sub + ldr r0, _0800679C + adds r0, r6, r0 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x80 + strb r1, [r0] + adds r1, r5, 0 + adds r1, 0x81 + movs r0, 0xE + strb r0, [r1] + b _08006810 + .align 2, 0 +_08006794: .4byte 0x0866c8e4 +_08006798: .4byte 0x03002f90 +_0800679C: .4byte 0x086748e4 +_080067A0: + lsls r1, r6, 6 + ldr r0, _080067D0 + adds r4, r1, r0 + ldr r5, _080067D4 + ldr r0, _080067D8 + adds r0, r6, r0 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x80 + strb r1, [r0] + cmp r1, 0x8 + bhi _080067DC + adds r0, r4, 0 + adds r1, r5, 0 + bl font_render_sub + adds r0, r4, 0 + adds r0, 0x20 + adds r1, r5, 0 + adds r1, 0x40 + bl font_render_sub + b _08006808 + .align 2, 0 +_080067D0: .4byte 0x086440e4 +_080067D4: .4byte 0x03002f90 +_080067D8: .4byte 0x0864c0e4 +_080067DC: + adds r0, r4, 0 + adds r1, r5, 0 + bl font_render_sub + adds r0, r4, 0 + adds r0, 0x10 + adds r1, r5, 0 + adds r1, 0x20 + bl font_render_sub + adds r0, r4, 0 + adds r0, 0x20 + adds r1, r5, 0 + adds r1, 0x40 + bl font_render_sub + adds r0, r4, 0 + adds r0, 0x30 + adds r1, r5, 0 + adds r1, 0x60 + bl font_render_sub +_08006808: + ldr r0, _08006818 + adds r0, 0x81 + movs r1, 0xE + strb r1, [r0] +_08006810: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006818: .4byte 0x03002f90 + thumb_func_end Text_DecompressGlyphFont2 + + thumb_func_start get_font_width_unk +get_font_width_unk: @ 800681C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, 0x1 + beq _08006830 + ldr r0, _0800682C + b _08006832 + .align 2, 0 +_0800682C: .4byte 0x0864c0e4 +_08006830: + ldr r0, _0800683C +_08006832: + adds r0, r2, r0 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_0800683C: .4byte 0x086748e4 + thumb_func_end get_font_width_unk + + thumb_func_start Text_DecompressGlyphFont1 +Text_DecompressGlyphFont1: @ 8006840 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + cmp r1, 0x1 + bne _0800688C + lsrs r2, r0, 20 + lsls r2, 9 + movs r5, 0xF + adds r0, r3, 0 + ands r0, r5 + lsls r0, 4 + ldr r1, _08006884 + adds r0, r1 + adds r6, r2, r0 + ldr r4, _08006888 + adds r0, r6, 0 + adds r1, r4, 0 + bl font_render_sub + movs r1, 0x80 + lsls r1, 1 + adds r0, r6, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0x8 + strb r0, [r1] + adds r4, 0x81 + strb r5, [r4] + b _080068FC + .align 2, 0 +_08006884: .4byte 0x086584e4 +_08006888: .4byte 0x03002f90 +_0800688C: + lsls r1, r3, 6 + ldr r0, _080068BC + adds r6, r1, r0 + ldr r4, _080068C0 + ldr r0, _080068C4 + adds r0, r3, r0 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x80 + strb r1, [r0] + cmp r1, 0x8 + bhi _080068C8 + adds r0, r6, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + b _080068F4 + .align 2, 0 +_080068BC: .4byte 0x0864c2e4 +_080068C0: .4byte 0x03002f90 +_080068C4: .4byte 0x086542e4 +_080068C8: + adds r0, r6, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x20 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + adds r0, r6, 0 + adds r0, 0x30 + adds r1, r4, 0 + adds r1, 0x60 + bl font_render_sub +_080068F4: + ldr r0, _08006904 + adds r0, 0x81 + movs r1, 0xF + strb r1, [r0] +_080068FC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006904: .4byte 0x03002f90 + thumb_func_end Text_DecompressGlyphFont1 + + thumb_func_start get_font_width_red_en_jp +get_font_width_red_en_jp: @ 8006908 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, 0x1 + beq _08006920 + ldr r0, _0800691C + adds r0, r2, r0 + ldrb r0, [r0] + b _08006922 + .align 2, 0 +_0800691C: .4byte 0x086542e4 +_08006920: + movs r0, 0x8 +_08006922: + pop {r1} + bx r1 + thumb_func_end get_font_width_red_en_jp + + thumb_func_start Text_DecompressGlyphFont9 +Text_DecompressGlyphFont9: @ 8006928 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 20 + lsls r4, 9 + movs r1, 0xF0 + lsls r1, 12 + ands r1, r0 + lsrs r1, 12 + ldr r0, _0800696C + adds r1, r0 + adds r4, r1 + ldr r5, _08006970 + adds r0, r4, 0 + adds r1, r5, 0 + bl font_render_sub + movs r0, 0x80 + lsls r0, 1 + adds r4, r0 + adds r1, r5, 0 + adds r1, 0x40 + adds r0, r4, 0 + bl font_render_sub + adds r1, r5, 0 + adds r1, 0x80 + movs r0, 0x8 + strb r0, [r1] + adds r5, 0x81 + movs r0, 0xC + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800696C: .4byte 0x082ea61c +_08006970: .4byte 0x03002f90 + thumb_func_end Text_DecompressGlyphFont9 + + thumb_func_start reset_all_obj_data +reset_all_obj_data: @ 8006974 + push {r4,lr} + movs r0, 0 + movs r1, 0x80 + bl reset_super_sprites + bl obj_delete_all + bl copy_queue_clear + bl rotscale_reset_all + bl gpu_tile_obj_tags_reset + ldr r1, _080069B0 + movs r0, 0x40 + strb r0, [r1] + ldr r0, _080069B4 + movs r4, 0 + strh r4, [r0] + movs r0, 0 + bl gpu_tile_obj_alloc + ldr r0, _080069B8 + strh r4, [r0] + ldr r0, _080069BC + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080069B0: .4byte 0x02021b38 +_080069B4: .4byte 0x02021b3a +_080069B8: .4byte 0x02021bbc +_080069BC: .4byte 0x02021bbe + thumb_func_end reset_all_obj_data + + thumb_func_start call_obj_callbacks +call_obj_callbacks: @ 80069C0 + push {r4-r7,lr} + movs r6, 0 + movs r7, 0x1 +_080069C6: + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, _08006A08 + adds r4, r0, r1 + adds r5, r4, 0 + adds r5, 0x3E + ldrb r1, [r5] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080069F6 + ldr r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + ldrb r1, [r5] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080069F6 + adds r0, r4, 0 + bl obj_anim_step +_080069F6: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3F + bls _080069C6 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08006A08: .4byte 0x02020630 + thumb_func_end call_obj_callbacks + + thumb_func_start obj_sync_something +obj_sync_something: @ 8006A0C + push {r4,r5,lr} + bl update_obj_oam_coords + bl do_something_with_obj_priorites + bl determine_visible_sprites_maybe + ldr r5, _08006A4C + ldr r0, _08006A50 + adds r5, r0 + ldrb r0, [r5] + lsls r4, r0, 31 + lsrs r4, 31 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r5] + bl super_sprites_fill + bl copy_rotscale_coeffs_to_super_sprites + movs r2, 0x1 + ldrb r1, [r5] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + orrs r4, r0 + strb r4, [r5] + ldr r0, _08006A54 + strb r2, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08006A4C: .4byte 0x030022c0 +_08006A50: .4byte 0x00000439 +_08006A54: .4byte 0x02021834 + thumb_func_end obj_sync_something + + thumb_func_start update_obj_oam_coords +update_obj_oam_coords: @ 8006A58 + push {r4-r7,lr} + movs r4, 0 + ldr r7, _08006AC4 + ldr r0, _08006AC8 + adds r5, r0, 0 + ldr r6, _08006ACC +_08006A64: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r7 + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x5 + ands r0, r1 + cmp r0, 0x1 + bne _08006B0A + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08006AD8 + movs r2, 0x20 + ldrsh r1, [r3, r2] + movs r2, 0x24 + ldrsh r0, [r3, r2] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r1, r0 + ldr r0, _08006AD0 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r1, r0 + ands r1, r5 + ldrh r2, [r3, 0x2] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x2] + ldrh r1, [r3, 0x26] + ldrh r0, [r3, 0x22] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x29 + ldrb r0, [r0] + ldr r2, _08006AD4 + adds r0, r1 + ldrb r2, [r2] + adds r0, r2 + b _08006B08 + .align 2, 0 +_08006AC4: .4byte 0x02020630 +_08006AC8: .4byte 0x000001ff +_08006ACC: .4byte 0xfffffe00 +_08006AD0: .4byte 0x02021bbc +_08006AD4: .4byte 0x02021bbe +_08006AD8: + movs r2, 0x20 + ldrsh r1, [r3, r2] + movs r2, 0x24 + ldrsh r0, [r3, r2] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r1, r0 + ands r1, r5 + ldrh r2, [r3, 0x2] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x2] + ldrh r1, [r3, 0x26] + ldrh r0, [r3, 0x22] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x29 + ldrb r0, [r0] + adds r0, r1 +_08006B08: + strb r0, [r3] +_08006B0A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3F + bls _08006A64 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end update_obj_oam_coords + + thumb_func_start do_something_with_obj_priorites +do_something_with_obj_priorites: @ 8006B1C + push {r4,lr} + movs r2, 0 + ldr r4, _08006B54 + ldr r3, _08006B58 +_08006B24: + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + adds r1, r0, 0 + adds r1, 0x43 + ldrb r1, [r1] + ldrb r0, [r0, 0x5] + lsls r0, 28 + lsrs r0, 30 + lsls r0, 8 + orrs r1, r0 + lsls r0, r2, 1 + adds r0, r3 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3F + bls _08006B24 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08006B54: .4byte 0x02020630 +_08006B58: .4byte 0x02021774 + thumb_func_end do_something_with_obj_priorites + + thumb_func_start determine_visible_sprites_maybe +determine_visible_sprites_maybe: @ 8006B5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x1 + mov r12, r0 + ldr r1, _08006C24 + mov r10, r1 + ldr r3, _08006C28 + mov r9, r3 + ldr r6, _08006C2C + mov r8, r6 +_08006B78: + mov r5, r12 + mov r0, r12 + subs r0, 0x1 + add r0, r10 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r7, _08006C30 + adds r3, r0, r7 + mov r0, r12 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r7 + lsls r2, 1 + ldr r0, _08006C34 + adds r2, r0 + ldrh r2, [r2] + str r2, [sp] + lsls r1, 1 + adds r1, r0 + ldrh r6, [r1] + ldrb r1, [r3] + ldrb r2, [r4] + adds r0, r1, 0 + cmp r0, 0x9F + ble _08006BBA + add r0, r9 + lsls r0, 16 + lsrs r1, r0, 16 +_08006BBA: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _08006BC8 + add r0, r9 + lsls r0, 16 + lsrs r2, r0, 16 +_08006BC8: + ldr r0, [r3] + mov r7, r8 + ands r0, r7 + cmp r0, r8 + bne _08006BEC + ldrb r0, [r3, 0x1] + lsrs r0, 6 + cmp r0, 0 + beq _08006BDE + cmp r0, 0x2 + bne _08006BEC +_08006BDE: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x80 + ble _08006BEC + add r0, r9 + lsls r0, 16 + lsrs r1, r0, 16 +_08006BEC: + ldr r0, [r4] + mov r3, r8 + ands r0, r3 + cmp r0, r8 + bne _08006C10 + ldrb r0, [r4, 0x1] + lsrs r0, 6 + cmp r0, 0 + beq _08006C02 + cmp r0, 0x2 + bne _08006C10 +_08006C02: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x80 + ble _08006C10 + add r0, r9 + lsls r0, 16 + lsrs r2, r0, 16 +_08006C10: + movs r7, 0x1 + add r12, r7 + cmp r5, 0 + beq _08006CF6 + ldr r0, [sp] + cmp r0, r6 + bhi _08006C38 + cmp r0, r6 + bne _08006CF6 + b _08006CEE + .align 2, 0 +_08006C24: .4byte 0x020217f4 +_08006C28: .4byte 0xffffff00 +_08006C2C: .4byte 0xc0000300 +_08006C30: .4byte 0x02020630 +_08006C34: .4byte 0x02021774 +_08006C38: + mov r1, r10 + adds r3, r5, r1 + ldrb r4, [r3] + subs r2, r5, 0x1 + adds r1, r2, r1 + ldrb r0, [r1] + strb r0, [r3] + strb r4, [r1] + lsls r2, 24 + lsrs r5, r2, 24 + subs r0, r5, 0x1 + add r0, r10 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r6, _08006D14 + adds r3, r0, r6 + mov r7, r10 + adds r0, r5, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r6 + lsls r2, 1 + ldr r0, _08006D18 + adds r2, r0 + ldrh r2, [r2] + str r2, [sp] + lsls r1, 1 + adds r1, r0 + ldrh r6, [r1] + ldrb r1, [r3] + ldrb r2, [r4] + adds r0, r1, 0 + cmp r0, 0x9F + ble _08006C8A + add r0, r9 + lsls r0, 16 + lsrs r1, r0, 16 +_08006C8A: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _08006C98 + add r0, r9 + lsls r0, 16 + lsrs r2, r0, 16 +_08006C98: + ldr r0, [r3] + mov r7, r8 + ands r0, r7 + cmp r0, r8 + bne _08006CBC + ldrb r0, [r3, 0x1] + lsrs r0, 6 + cmp r0, 0 + beq _08006CAE + cmp r0, 0x2 + bne _08006CBC +_08006CAE: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x80 + ble _08006CBC + add r0, r9 + lsls r0, 16 + lsrs r1, r0, 16 +_08006CBC: + ldr r0, [r4] + mov r3, r8 + ands r0, r3 + cmp r0, r8 + bne _08006CE0 + ldrb r0, [r4, 0x1] + lsrs r0, 6 + cmp r0, 0 + beq _08006CD2 + cmp r0, 0x2 + bne _08006CE0 +_08006CD2: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x80 + ble _08006CE0 + add r0, r9 + lsls r0, 16 + lsrs r2, r0, 16 +_08006CE0: + cmp r5, 0 + beq _08006CF6 + ldr r7, [sp] + cmp r7, r6 + bhi _08006C38 + cmp r7, r6 + bne _08006CF6 +_08006CEE: + lsls r1, 16 + lsls r0, r2, 16 + cmp r1, r0 + blt _08006C38 +_08006CF6: + mov r1, r12 + lsls r0, r1, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3F + bhi _08006D04 + b _08006B78 +_08006D04: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08006D14: .4byte 0x02020630 +_08006D18: .4byte 0x02021774 + thumb_func_end determine_visible_sprites_maybe + + thumb_func_start copy_rotscale_coeffs_to_super_sprites +copy_rotscale_coeffs_to_super_sprites: @ 8006D1C + push {r4-r6,lr} + movs r4, 0 + ldr r5, _08006D60 + ldr r6, _08006D64 +_08006D24: + lsls r2, r4, 2 + lsls r1, r4, 5 + adds r1, r5 + lsls r3, r4, 3 + adds r3, r6 + ldrh r0, [r3] + strh r0, [r1, 0x3E] + adds r0, r2, 0x1 + lsls r0, 3 + adds r0, r5 + ldrh r1, [r3, 0x2] + strh r1, [r0, 0x3E] + adds r0, r2, 0x2 + lsls r0, 3 + adds r0, r5 + ldrh r1, [r3, 0x4] + strh r1, [r0, 0x3E] + adds r2, 0x3 + lsls r2, 3 + adds r2, r5 + ldrh r0, [r3, 0x6] + strh r0, [r2, 0x3E] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08006D24 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006D60: .4byte 0x030022c0 +_08006D64: .4byte 0x02021bc0 + thumb_func_end copy_rotscale_coeffs_to_super_sprites + + thumb_func_start super_sprites_fill +super_sprites_fill: @ 8006D68 + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + mov r0, sp + strb r4, [r0] +_08006D72: + ldr r0, _08006DE0 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08006DE4 + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x5 + ands r0, r1 + cmp r0, 0x1 + bne _08006D9E + adds r0, r2, 0 + mov r1, sp + bl super_sprite_add + lsls r0, 24 + cmp r0, 0 + bne _08006DD8 +_08006D9E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3F + bls _08006D72 + mov r0, sp + ldr r4, _08006DE8 + ldrb r0, [r0] + ldrb r1, [r4] + cmp r0, r1 + bcs _08006DD8 + mov r1, sp + ldr r5, _08006DEC + ldr r0, _08006DF0 + ldr r2, [r0] + ldr r3, [r0, 0x4] +_08006DBE: + ldrb r0, [r1] + lsls r0, 3 + adds r0, r5 + str r2, [r0] + str r3, [r0, 0x4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r6, [r4] + cmp r0, r6 + bcc _08006DBE +_08006DD8: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006DE0: .4byte 0x020217f4 +_08006DE4: .4byte 0x02020630 +_08006DE8: .4byte 0x02021b38 +_08006DEC: .4byte 0x030022f8 +_08006DF0: .4byte 0x082ec690 + thumb_func_end super_sprites_fill + + thumb_func_start obj_add_from_template_forward_search +obj_add_from_template_forward_search: @ 8006DF4 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r3, 24 + lsrs r4, r3, 24 + movs r3, 0 + ldr r0, _08006E30 + mov r12, r0 + lsls r5, r1, 16 + lsls r6, r2, 16 +_08006E08: + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + add r0, r12 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08006E34 + str r4, [sp] + adds r0, r3, 0 + adds r1, r7, 0 + asrs r2, r5, 16 + asrs r3, r6, 16 + bl template_read + lsls r0, 24 + lsrs r0, 24 + b _08006E40 + .align 2, 0 +_08006E30: .4byte 0x02020630 +_08006E34: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3F + bls _08006E08 + movs r0, 0x40 +_08006E40: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end obj_add_from_template_forward_search + + thumb_func_start obj_add_from_template_backward_search +obj_add_from_template_backward_search: @ 8006E48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + lsls r3, 24 + lsrs r6, r3, 24 + movs r3, 0x3F + ldr r0, _08006E94 + mov r8, r0 + movs r0, 0x1 + negs r0, r0 + mov r12, r0 + lsls r4, r1, 16 + lsls r5, r2, 16 +_08006E66: + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08006E98 + lsls r0, r3, 24 + lsrs r0, 24 + str r6, [sp] + adds r1, r7, 0 + asrs r2, r4, 16 + asrs r3, r5, 16 + bl template_read + lsls r0, 24 + lsrs r0, 24 + b _08006EA6 + .align 2, 0 +_08006E94: .4byte 0x02020630 +_08006E98: + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + asrs r0, 16 + cmp r0, r12 + bgt _08006E66 + movs r0, 0x40 +_08006EA6: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end obj_add_from_template_backward_search + + thumb_func_start obj_add_empty_with_callback +obj_add_empty_with_callback: @ 8006EB4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, _08006EEC + movs r1, 0 + movs r2, 0 + movs r3, 0x1F + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _08006EF4 + ldr r4, _08006EF0 + lsls r1, r5, 4 + adds r1, r5 + 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 + str r6, [r1] + adds r0, r5, 0 + b _08006EF6 + .align 2, 0 +_08006EEC: .4byte 0x082ec6ac +_08006EF0: .4byte 0x02020630 +_08006EF4: + movs r0, 0x40 +_08006EF6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end obj_add_empty_with_callback + + thumb_func_start template_read +template_read: @ 8006EFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r1 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 4 + add r0, r10 + lsls r0, 2 + ldr r1, _08006FC0 + adds r7, r0, r1 + adds r0, r7, 0 + bl obj_delete + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x3F + adds r0, r7 + mov r9, r0 + ldrb r0, [r0] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x40 + orrs r0, r1 + mov r1, r9 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x43 + strb r4, [r0] + mov r1, r8 + ldr r0, [r1, 0x4] + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r7] + str r1, [r7, 0x4] + mov r1, r8 + ldr r0, [r1, 0x8] + str r0, [r7, 0x8] + ldr r0, [r1, 0x10] + str r0, [r7, 0x10] + str r1, [r7, 0x14] + ldr r0, [r1, 0x14] + str r0, [r7, 0x1C] + strh r5, [r7, 0x20] + strh r6, [r7, 0x22] + ldrb r3, [r7, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r7, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r7, 0 + bl oam_center + mov r0, r8 + ldrh r1, [r0] + ldr r4, _08006FC4 + lsrs r0, r4, 16 + cmp r1, r0 + bne _08006FF8 + mov r1, r8 + ldr r0, [r1, 0xC] + str r0, [r7, 0xC] + ldrh r0, [r0, 0x4] + lsrs r0, 5 + lsls r0, 24 + lsrs r0, 24 + bl gpu_tile_obj_alloc + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + asrs r1, r4, 16 + cmp r0, r1 + bne _08006FC8 + adds r0, r7, 0 + bl obj_delete + movs r0, 0x40 + b _08007040 + .align 2, 0 +_08006FC0: .4byte 0x02020630 +_08006FC4: .4byte 0xffff0000 +_08006FC8: + ldr r1, _08006FF0 + adds r0, r1, 0 + ands r2, r0 + ldrh r1, [r7, 0x4] + ldr r0, _08006FF4 + ands r0, r1 + orrs r0, r2 + strh r0, [r7, 0x4] + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + mov r1, r9 + strb r0, [r1] + adds r1, r7, 0 + adds r1, 0x40 + movs r0, 0 + strh r0, [r1] + b _0800700C + .align 2, 0 +_08006FF0: .4byte 0x000003ff +_08006FF4: .4byte 0xfffffc00 +_08006FF8: + mov r1, r8 + ldrh r0, [r1] + bl gpu_tile_obj_tag_get_range_start + adds r1, r7, 0 + adds r1, 0x40 + strh r0, [r1] + adds r0, r7, 0 + bl sub_8008324 +_0800700C: + ldrb r0, [r7, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08007020 + adds r0, r7, 0 + bl obj_alloc_rotscale_entry +_08007020: + mov r0, r8 + ldrh r1, [r0, 0x2] + ldr r0, _08007050 + cmp r1, r0 + beq _0800703E + mov r1, r8 + ldrh r0, [r1, 0x2] + bl gpu_pal_tags_index_of + lsls r0, 4 + ldrb r2, [r7, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x5] +_0800703E: + mov r0, r10 +_08007040: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08007050: .4byte 0x0000ffff + thumb_func_end template_read + + thumb_func_start obj_add_from_template_call_callback_once +obj_add_from_template_call_callback_once: @ 8007054 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + movs r3, 0 + ldr r5, _080070C4 + lsls r1, 16 + mov r12, r1 + lsls r2, 16 + mov r8, r2 +_08007074: + lsls r0, r3, 4 + adds r0, r3 + lsls r6, r0, 2 + adds r4, r6, r5 + adds r7, r4, 0 + adds r7, 0x3E + ldrb r0, [r7] + lsls r0, 31 + cmp r0, 0 + bne _080070CC + mov r0, r9 + str r0, [sp] + adds r0, r3, 0 + mov r1, r10 + mov r3, r12 + asrs r2, r3, 16 + mov r5, r8 + asrs r3, r5, 16 + bl template_read + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + cmp r5, 0x40 + beq _080070D6 + ldr r1, _080070C8 + adds r0, r6, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + ldrb r0, [r7] + lsls r0, 31 + cmp r0, 0 + beq _080070C0 + adds r0, r4, 0 + bl obj_anim_step +_080070C0: + adds r0, r5, 0 + b _080070D8 + .align 2, 0 +_080070C4: .4byte 0x02020630 +_080070C8: .4byte 0x0202064c +_080070CC: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3F + bls _08007074 +_080070D6: + movs r0, 0x40 +_080070D8: + 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 obj_add_from_template_call_callback_once + + thumb_func_start obj_delete_and_free_tiles +obj_delete_and_free_tiles: @ 80070E8 + push {r4-r7,lr} + adds r5, r0, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08007144 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0800713E + ldr r0, [r5, 0xC] + ldrh r2, [r0, 0x4] + lsrs r2, 5 + ldrh r0, [r5, 0x4] + lsls r0, 22 + lsrs r1, r0, 22 + adds r4, r1, r2 + adds r3, r1, 0 + cmp r3, r4 + bcs _0800713E + ldr r0, _0800714C + mov r12, r0 + movs r6, 0x7 + movs r7, 0x1 +_08007122: + lsrs r2, r3, 3 + add r2, r12 + adds r0, r3, 0 + ands r0, r6 + adds r1, r7, 0 + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _08007122 +_0800713E: + adds r0, r5, 0 + bl obj_delete +_08007144: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800714C: .4byte 0x02021b3c + thumb_func_end obj_delete_and_free_tiles + + thumb_func_start reset_super_sprites +reset_super_sprites: @ 8007150 + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _08007178 + ldr r6, _08007180 + ldr r5, _08007184 +_08007162: + lsls r0, r3, 3 + adds r0, r6 + ldr r1, [r5] + ldr r2, [r5, 0x4] + str r1, [r0] + str r2, [r0, 0x4] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcc _08007162 +_08007178: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007180: .4byte 0x030022f8 +_08007184: .4byte 0x082ec690 + thumb_func_end reset_super_sprites + + thumb_func_start copy_super_sprites_to_oam +copy_super_sprites_to_oam: @ 8007188 + push {lr} + ldr r2, _080071AC + ldr r1, _080071B0 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080071A8 + adds r0, r2, 0 + adds r0, 0x38 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _080071B4 + bl CpuSet +_080071A8: + pop {r0} + bx r0 + .align 2, 0 +_080071AC: .4byte 0x030022c0 +_080071B0: .4byte 0x00000439 +_080071B4: .4byte 0x04000100 + thumb_func_end copy_super_sprites_to_oam + + thumb_func_start copy_queue_clear +copy_queue_clear: @ 80071B8 + push {r4,r5,lr} + ldr r0, _080071EC + movs r1, 0 + strb r1, [r0] + ldr r0, _080071F0 + strb r1, [r0] + movs r2, 0 + ldr r4, _080071F4 + movs r3, 0 + adds r5, r4, 0x4 +_080071CC: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r4 + str r3, [r1] + adds r0, r5 + str r3, [r0] + strh r3, [r1, 0x8] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _080071CC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080071EC: .4byte 0x02021834 +_080071F0: .4byte 0x02021835 +_080071F4: .4byte 0x02021838 + thumb_func_end copy_queue_clear + + thumb_func_start reset_rotscale_coeffs +reset_rotscale_coeffs: @ 80071F8 + push {r4,lr} + movs r1, 0 + ldr r4, _08007220 + movs r3, 0 + movs r2, 0x80 + lsls r2, 1 +_08007204: + lsls r0, r1, 3 + adds r0, r4 + strh r2, [r0] + strh r3, [r0, 0x2] + strh r3, [r0, 0x4] + strh r2, [r0, 0x6] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _08007204 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08007220: .4byte 0x02021bc0 + thumb_func_end reset_rotscale_coeffs + + thumb_func_start rotscale_set_direct +rotscale_set_direct: @ 8007224 + push {r4,r5,lr} + ldr r5, [sp, 0xC] + lsls r0, 24 + ldr r4, _08007240 + lsrs r0, 21 + adds r0, r4 + strh r1, [r0] + strh r2, [r0, 0x2] + strh r3, [r0, 0x4] + strh r5, [r0, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08007240: .4byte 0x02021bc0 + thumb_func_end rotscale_set_direct + + thumb_func_start obj_delete +obj_delete: @ 8007244 + push {lr} + ldr r1, _08007254 + movs r2, 0x44 + bl memcpy + pop {r0} + bx r0 + .align 2, 0 +_08007254: .4byte 0x082ec64c + thumb_func_end obj_delete + + thumb_func_start oam_center +oam_center: @ 8007258 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsls r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, _08007298 + lsrs r2, 23 + lsrs r1, 21 + adds r2, r1 + adds r0, r2, r4 + ldrb r5, [r0] + adds r4, 0x1 + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x2 + ands r3, r0 + cmp r3, 0 + beq _08007286 + lsls r0, r5, 25 + lsrs r5, r0, 24 + lsls r0, r1, 25 + lsrs r1, r0, 24 +_08007286: + adds r0, r6, 0 + adds r0, 0x28 + strb r5, [r0] + adds r0, 0x1 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007298: .4byte 0x082ec634 + thumb_func_end oam_center + + thumb_func_start gpu_tile_obj_alloc +gpu_tile_obj_alloc: @ 800729C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _080072F2 + ldr r0, _080072E0 + ldrh r3, [r0] + ldr r0, _080072E4 + cmp r3, r0 + bhi _080072DA + ldr r7, _080072E8 + movs r6, 0x7 + adds r4, r0, 0 + movs r5, 0x1 +_080072BE: + lsrs r2, r3, 3 + adds r2, r7 + adds r0, r3, 0 + ands r0, r6 + adds r1, r5, 0 + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bls _080072BE +_080072DA: + movs r0, 0 + b _080073A4 + .align 2, 0 +_080072E0: .4byte 0x02021b3a +_080072E4: .4byte 0x000003ff +_080072E8: .4byte 0x02021b3c +_080072EC: + movs r0, 0x1 + negs r0, r0 + b _080073A4 +_080072F2: + ldr r0, _080073B0 + ldrh r3, [r0] + ldr r0, _080073B4 + mov r9, r0 + movs r7, 0x7 + movs r6, 0x1 +_080072FE: + lsrs r0, r3, 3 + add r0, r9 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r7 + asrs r1, r0 + ands r1, r6 + cmp r1, 0 + beq _08007332 + movs r5, 0x80 + lsls r5, 3 + ldr r2, _080073B4 +_08007316: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r5 + beq _080072EC + lsrs r0, 19 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r7 + asrs r1, r0 + ands r1, r6 + cmp r1, 0 + bne _08007316 +_08007332: + mov r8, r3 + movs r2, 0x1 + cmp r2, r4 + beq _0800736C + movs r1, 0x80 + lsls r1, 3 + mov r12, r1 + ldr r5, _080073B4 +_08007342: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r12 + beq _080072EC + lsrs r0, 19 + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r7 + asrs r1, r0 + ands r1, r6 + cmp r1, 0 + bne _08007368 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r4 + bne _08007342 +_08007368: + cmp r2, r4 + bne _080072FE +_0800736C: + mov r1, r8 + lsls r0, r1, 16 + lsrs r3, r0, 16 + asrs r1, r0, 16 + adds r1, r4, r1 + adds r6, r0, 0 + cmp r3, r1 + bge _080073A2 + ldr r0, _080073B4 + mov r8, r0 + movs r7, 0x7 + adds r4, r1, 0 + movs r5, 0x1 +_08007386: + lsrs r2, r3, 3 + add r2, r8 + adds r1, r3, 0 + ands r1, r7 + adds r0, r5, 0 + lsls r0, r1 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + blt _08007386 +_080073A2: + asrs r0, r6, 16 +_080073A4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080073B0: .4byte 0x02021b3a +_080073B4: .4byte 0x02021b3c + thumb_func_end gpu_tile_obj_alloc + + thumb_func_start gpu_tile_obj_alloc_map_bit_op +gpu_tile_obj_alloc_map_bit_op: @ 80073B8 + push {r4-r6,lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsrs r0, 19 + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + movs r0, 0x7 + ands r2, r0 + adds r4, r2, 0 + movs r5, 0 + cmp r1, 0 + bne _080073F0 + movs r0, 0x1 + lsls r0, r2 + mvns r0, r0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080073EC + adds r0, r3, r0 + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + b _0800741C + .align 2, 0 +_080073EC: .4byte 0x02021b3c +_080073F0: + cmp r1, 0x1 + bne _0800740C + lsls r1, r2 + lsls r0, r1, 24 + lsrs r2, r0, 24 + ldr r0, _08007408 + adds r0, r3, r0 + ldrb r1, [r0] + orrs r2, r1 + strb r2, [r0] + b _0800741C + .align 2, 0 +_08007408: .4byte 0x02021b3c +_0800740C: + movs r0, 0x80 + lsls r0, 17 + lsls r0, r4 + lsrs r5, r0, 24 + ldr r0, _08007424 + adds r0, r6, r0 + ldrb r0, [r0] + ands r5, r0 +_0800741C: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08007424: .4byte 0x02021b3c + thumb_func_end gpu_tile_obj_alloc_map_bit_op + + thumb_func_start nullsub_12 +nullsub_12: @ 8007428 + bx lr + thumb_func_end nullsub_12 + + thumb_func_start copy_queue_process +copy_queue_process: @ 800742C + push {r4-r7,lr} + ldr r0, _0800747C + ldrb r0, [r0] + cmp r0, 0 + beq _08007474 + movs r4, 0 + ldr r1, _08007480 + ldrb r0, [r1] + cmp r0, 0 + beq _0800746E + ldr r6, _08007484 + adds r7, r6, 0x4 + adds r5, r1, 0 +_08007446: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1, r6 + ldr r0, [r2] + adds r1, r7 + ldr r1, [r1] + ldrh r2, [r2, 0x8] + lsrs r2, 1 + bl CpuSet + ldrb r1, [r5] + subs r1, 0x1 + strb r1, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + cmp r1, 0 + bne _08007446 +_0800746E: + ldr r1, _0800747C + movs r0, 0 + strb r0, [r1] +_08007474: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800747C: .4byte 0x02021834 +_08007480: .4byte 0x02021835 +_08007484: .4byte 0x02021838 + thumb_func_end copy_queue_process + + thumb_func_start copy_queue_add_oam_frame +copy_queue_add_oam_frame: @ 8007488 + push {r4-r6,lr} + adds r5, r2, 0 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r4, _080074E0 + ldrb r0, [r4] + cmp r0, 0x3F + bhi _080074D8 + ldr r3, _080074E4 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + lsls r2, 3 + adds r2, r5 + ldr r1, [r2] + str r1, [r0] + ldrb r0, [r4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r0, r3, 0x4 + adds r1, r0 + lsls r0, r6, 5 + ldr r5, _080074E8 + adds r0, r5 + str r0, [r1] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x8] + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] +_080074D8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080074E0: .4byte 0x02021835 +_080074E4: .4byte 0x02021838 +_080074E8: .4byte 0x06010000 + thumb_func_end copy_queue_add_oam_frame + + thumb_func_start copy_queue_add +copy_queue_add: @ 80074EC + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r3, _08007534 + ldrb r0, [r3] + cmp r0, 0x3F + bhi _0800752C + ldr r2, _08007538 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + str r4, [r0] + ldrb r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0x4 + adds r0, r1 + str r5, [r0] + ldrb r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x8] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_0800752C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007534: .4byte 0x02021835 +_08007538: .4byte 0x02021838 + thumb_func_end copy_queue_add + + thumb_func_start copy_all_from_objects +copy_all_from_objects: @ 800753C + push {r4,lr} + adds r1, r0, 0 + ldr r3, _0800755C + movs r2, 0 + ldr r4, _08007560 +_08007546: + ldrb r0, [r3] + strb r0, [r1] + adds r1, 0x1 + adds r3, 0x1 + adds r2, 0x1 + cmp r2, r4 + bls _08007546 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800755C: .4byte 0x02020630 +_08007560: .4byte 0x000010ff + thumb_func_end copy_all_from_objects + + thumb_func_start copy_all_to_objects +copy_all_to_objects: @ 8007564 + push {r4,lr} + adds r1, r0, 0 + ldr r3, _08007584 + movs r2, 0 + ldr r4, _08007588 +_0800756E: + ldrb r0, [r1] + strb r0, [r3] + adds r1, 0x1 + adds r3, 0x1 + adds r2, 0x1 + cmp r2, r4 + bls _0800756E + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08007584: .4byte 0x02020630 +_08007588: .4byte 0x000010ff + thumb_func_end copy_all_to_objects + + thumb_func_start obj_delete_all +obj_delete_all: @ 800758C + push {r4,r5,lr} + movs r4, 0 +_08007590: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r5, _080075C0 + adds r0, r5 + bl obj_delete + ldr r0, _080075C4 + adds r0, r4, r0 + strb r4, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3F + bls _08007590 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl obj_delete + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080075C0: .4byte 0x02020630 +_080075C4: .4byte 0x020217f4 + thumb_func_end obj_delete_all + + thumb_func_start obj_free_tiles +obj_free_tiles: @ 80075C8 + push {lr} + ldr r2, [r0, 0x14] + ldrh r1, [r2] + ldr r0, _080075E0 + cmp r1, r0 + beq _080075DA + adds r0, r1, 0 + bl gpu_tile_obj_free_by_tag +_080075DA: + pop {r0} + bx r0 + .align 2, 0 +_080075E0: .4byte 0x0000ffff + thumb_func_end obj_free_tiles + + thumb_func_start obj_free_pal +obj_free_pal: @ 80075E4 + push {lr} + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + bl gpu_pal_free_tag + pop {r0} + bx r0 + thumb_func_end obj_free_pal + + thumb_func_start obj_free_rotscale_entry +obj_free_rotscale_entry: @ 80075F4 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800761A + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0800761A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end obj_free_rotscale_entry + + thumb_func_start obj_delete_and_free_resources +obj_delete_and_free_resources: @ 8007620 + push {r4,lr} + adds r4, r0, 0 + bl obj_free_tiles + adds r0, r4, 0 + bl obj_free_pal + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end obj_delete_and_free_resources + + thumb_func_start obj_anim_step +obj_anim_step: @ 8007640 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _0800767C + adds r5, r4, 0 + adds r5, 0x3F + ldrb r1, [r5] + movs r0, 0x4 + ands r0, r1 + adds r0, r2 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + ldr r0, _08007680 + ldrb r0, [r0] + cmp r0, 0 + bne _08007676 + ldr r0, _08007684 + ldrb r1, [r5] + lsls r1, 28 + lsrs r1, 31 + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r4, 0 + bl _call_via_r1 +_08007676: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800767C: .4byte 0x082ec6c4 +_08007680: .4byte 0x02021cc0 +_08007684: .4byte 0x082ec6cc + thumb_func_end obj_anim_step + + thumb_func_start obj_anim_image_begin +obj_anim_image_begin: @ 8007688 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x2B + movs r2, 0 + strb r2, [r3] + adds r5, r4, 0 + adds r5, 0x3F + ldrb r1, [r5] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r5] + adds r0, r4, 0 + adds r0, 0x2D + strb r2, [r0] + adds r2, r4, 0 + adds r2, 0x2A + ldrb r1, [r2] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r3] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + mov r9, r0 + lsls r0, 16 + mov r8, r0 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800776C + ldrb r1, [r5] + subs r0, 0x4 + ands r0, r1 + strb r0, [r5] + ldrb r1, [r2] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r3] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r0, 10 + lsrs r3, r1, 26 + lsls r1, r0, 9 + lsrs r7, r1, 31 + lsls r0, 8 + lsrs r6, r0, 31 + cmp r3, 0 + beq _08007704 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_08007704: + adds r2, r4, 0 + adds r2, 0x2C + movs r0, 0x3F + ands r3, r0 + ldrb r1, [r2] + subs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800772E + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl obj_set_horizonal_and_vertical_flip +_0800772E: + ldrb r1, [r5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0800775C + adds r0, r4, 0 + adds r0, 0x40 + ldrh r1, [r0] + add r1, r9 + ldr r2, _08007754 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r4, 0x4] + ldr r0, _08007758 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + b _0800776C + .align 2, 0 +_08007754: .4byte 0x000003ff +_08007758: .4byte 0xfffffc00 +_0800775C: + mov r1, r8 + lsrs r0, r1, 16 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 22 + ldr r2, [r4, 0xC] + bl copy_queue_add_oam_frame +_0800776C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end obj_anim_image_begin + + thumb_func_start obj_anim_image_continue +obj_anim_image_continue: @ 8007778 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + beq _080077C8 + adds r0, r4, 0 + bl obj_anim_image_delay_progress + adds r0, r4, 0 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r0, 9 + lsrs r3, r1, 31 + lsls r0, 8 + lsrs r2, r0, 31 + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800780E + adds r0, r4, 0 + adds r1, r3, 0 + bl obj_set_horizonal_and_vertical_flip + b _0800780E +_080077C8: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0800780E + adds r2, r4, 0 + adds r2, 0x2B + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x2A + ldrb r0, [r0] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r2] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + movs r2, 0x3 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bge _080077FE + adds r0, 0x3 + lsls r0, 16 + lsrs r2, r0, 16 +_080077FE: + ldr r0, _08007814 + lsls r1, r2, 16 + asrs r1, 14 + adds r1, r0 + ldr r1, [r1] + adds r0, r4, 0 + bl _call_via_r1 +_0800780E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08007814: .4byte 0x082ec6d4 + thumb_func_end obj_anim_image_continue + + thumb_func_start anim_image_3 +anim_image_3: @ 8007818 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r7, [r0] + mov r8, r7 + ldr r0, [r0] + lsls r1, r0, 10 + lsrs r3, r1, 26 + lsls r1, r0, 9 + lsrs r6, r1, 31 + lsls r0, 8 + lsrs r5, r0, 31 + cmp r3, 0 + beq _08007852 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_08007852: + adds r2, r4, 0 + adds r2, 0x2C + movs r0, 0x3F + ands r3, r0 + ldrb r1, [r2] + subs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800787C + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl obj_set_horizonal_and_vertical_flip +_0800787C: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080078AC + adds r0, r4, 0 + adds r0, 0x40 + ldrh r1, [r0] + adds r1, r7 + ldr r2, _080078A4 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r4, 0x4] + ldr r0, _080078A8 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + b _080078BA + .align 2, 0 +_080078A4: .4byte 0x000003ff +_080078A8: .4byte 0xfffffc00 +_080078AC: + mov r0, r8 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 22 + ldr r2, [r4, 0xC] + bl copy_queue_add_oam_frame +_080078BA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end anim_image_3 + + thumb_func_start anim_image_2 +anim_image_2: @ 80078C4 + adds r2, r0, 0 + adds r2, 0x2B + ldrb r1, [r2] + subs r1, 0x1 + strb r1, [r2] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x10 + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end anim_image_2 + + thumb_func_start anim_image_1 +anim_image_1: @ 80078DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x2A + ldrb r1, [r3] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + adds r2, r4, 0 + adds r2, 0x2B + ldrb r0, [r2] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 10 + lsrs r0, 26 + strb r0, [r2] + ldrb r0, [r3] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r2] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrh r7, [r1] + mov r8, r7 + ldr r0, [r1] + lsls r1, r0, 10 + lsrs r3, r1, 26 + lsls r1, r0, 9 + lsrs r6, r1, 31 + lsls r0, 8 + lsrs r5, r0, 31 + cmp r3, 0 + beq _08007930 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_08007930: + adds r2, r4, 0 + adds r2, 0x2C + movs r0, 0x3F + ands r3, r0 + ldrb r1, [r2] + subs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800795A + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl obj_set_horizonal_and_vertical_flip +_0800795A: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0800798C + adds r0, r4, 0 + adds r0, 0x40 + ldrh r1, [r0] + adds r1, r7 + ldr r2, _08007984 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r4, 0x4] + ldr r0, _08007988 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + b _0800799A + .align 2, 0 +_08007984: .4byte 0x000003ff +_08007988: .4byte 0xfffffc00 +_0800798C: + mov r0, r8 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 22 + ldr r2, [r4, 0xC] + bl copy_queue_add_oam_frame +_0800799A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end anim_image_1 + + thumb_func_start anim_image_0 +anim_image_0: @ 80079A4 + push {lr} + adds r1, r0, 0 + adds r0, 0x2D + ldrb r0, [r0] + cmp r0, 0 + beq _080079B8 + adds r0, r1, 0 + bl sub_80079FC + b _080079BE +_080079B8: + adds r0, r1, 0 + bl sub_80079C4 +_080079BE: + pop {r0} + bx r0 + thumb_func_end anim_image_0 + + thumb_func_start sub_80079C4 +sub_80079C4: @ 80079C4 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 10 + lsrs r0, 26 + adds r1, r4, 0 + adds r1, 0x2D + strb r0, [r1] + adds r0, r4, 0 + bl obj_anim_rewind_to_cmd00 + adds r0, r4, 0 + bl obj_anim_image_continue + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80079C4 + + thumb_func_start sub_80079FC +sub_80079FC: @ 80079FC + push {r4,lr} + adds r4, r0, 0 + adds r1, r4, 0 + adds r1, 0x2D + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl obj_anim_rewind_to_cmd00 + adds r0, r4, 0 + bl obj_anim_image_continue + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80079FC + + thumb_func_start obj_anim_rewind_to_cmd00 +obj_anim_rewind_to_cmd00: @ 8007A1C + push {r4-r7,lr} + mov r12, r0 + adds r0, 0x2D + ldrb r0, [r0] + cmp r0, 0 + beq _08007A88 + mov r3, r12 + adds r3, 0x2B + ldrb r0, [r3] + subs r0, 0x1 + strb r0, [r3] + mov r5, r12 + adds r5, 0x2A + ldrb r1, [r5] + mov r2, r12 + ldr r0, [r2, 0x8] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r3] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + subs r0, 0x4 + movs r7, 0 + ldrsh r0, [r0, r7] + movs r1, 0x3 + negs r1, r1 + adds r4, r3, 0 + cmp r0, r1 + beq _08007A82 + adds r6, r1, 0 + adds r2, r4, 0 +_08007A5C: + ldrb r0, [r2] + cmp r0, 0 + beq _08007A82 + subs r0, 0x1 + strb r0, [r3] + ldrb r1, [r5] + mov r7, r12 + ldr r0, [r7, 0x8] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r2] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + subs r0, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, r6 + bne _08007A5C +_08007A82: + ldrb r0, [r4] + subs r0, 0x1 + strb r0, [r4] +_08007A88: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end obj_anim_rewind_to_cmd00 + + thumb_func_start obj_anim_rotscale_begin +obj_anim_rotscale_begin: @ 8007A90 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + ldrb r0, [r6, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08007B12 + ldr r0, [r6, 0x10] + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, _08007B1C + cmp r1, r0 + beq _08007B12 + adds r0, r6, 0 + bl obj_get_rotscale_entry_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl rotscale_reset_half + mov r5, sp + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + bl rotscale_load_frame + adds r7, r6, 0 + adds r7, 0x3F + ldrb r1, [r7] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + strb r0, [r7] + adds r0, r4, 0 + mov r1, sp + bl sub_8008168 + ldr r1, _08007B20 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r5, 0x5] + strb r1, [r0, 0x2] + ldrb r1, [r7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08007B12 + movs r0, 0x3A + ldrsh r1, [r6, r0] + movs r0, 0x3C + ldrsh r2, [r6, r0] + adds r0, r6, 0 + bl obj_update_pos2 +_08007B12: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08007B1C: .4byte 0x00007fff +_08007B20: .4byte 0x03000b70 + thumb_func_end obj_anim_rotscale_begin + + thumb_func_start obj_anim_rotscale_continue +obj_anim_rotscale_continue: @ 8007B24 + push {r4,r5,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08007BC6 + adds r0, r4, 0 + bl obj_get_rotscale_entry_index + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + ldr r1, _08007B5C + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x2] + cmp r0, 0 + beq _08007B60 + adds r0, r2, 0 + adds r1, r4, 0 + bl sub_8007BD8 + b _08007BAA + .align 2, 0 +_08007B5C: .4byte 0x03000b70 +_08007B60: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08007BC6 + ldrb r0, [r3, 0x1] + adds r0, 0x1 + strb r0, [r3, 0x1] + ldrb r0, [r3] + ldr r1, [r4, 0x10] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r3, 0x1] + ldr r0, [r0] + lsls r1, 3 + adds r1, r0 + movs r2, 0x3 + movs r0, 0 + ldrsh r1, [r1, r0] + ldr r0, _08007BCC + cmp r1, r0 + ble _08007B98 + ldr r2, _08007BD0 + adds r0, r1, r2 + lsls r0, 16 + lsrs r2, r0, 16 +_08007B98: + ldr r0, _08007BD4 + lsls r1, r2, 16 + asrs r1, 14 + adds r1, r0 + ldr r2, [r1] + adds r0, r5, 0 + adds r1, r4, 0 + bl _call_via_r2 +_08007BAA: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08007BC6 + movs r0, 0x3A + ldrsh r1, [r4, r0] + movs r0, 0x3C + ldrsh r2, [r4, r0] + adds r0, r4, 0 + bl obj_update_pos2 +_08007BC6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08007BCC: .4byte 0x00007ffc +_08007BD0: .4byte 0xffff8003 +_08007BD4: .4byte 0x082ec6e4 + thumb_func_end obj_anim_rotscale_continue + + thumb_func_start sub_8007BD8 +sub_8007BD8: @ 8007BD8 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl obj_anim_rotscale_delay_progress + lsls r0, 24 + cmp r0, 0 + bne _08007C02 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl rotscale_load_frame + adds r0, r4, 0 + mov r1, sp + bl rotscale_frame_apply_relative_and_sync +_08007C02: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8007BD8 + + thumb_func_start anim_rotscale_0 +anim_rotscale_0: @ 8007C0C + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08007C30 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _08007C34 + adds r0, r2, 0 + adds r1, r3, 0 + bl sub_8007C7C + b _08007C3C + .align 2, 0 +_08007C30: .4byte 0x03000b70 +_08007C34: + adds r0, r2, 0 + adds r1, r3, 0 + bl sub_8007C40 +_08007C3C: + pop {r0} + bx r0 + thumb_func_end anim_rotscale_0 + + thumb_func_start sub_8007C40 +sub_8007C40: @ 8007C40 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08007C78 + lsls r3, r0, 1 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + ldrb r2, [r3] + ldr r1, [r4, 0x10] + lsls r2, 2 + adds r2, r1 + ldrb r1, [r3, 0x1] + ldr r2, [r2] + lsls r1, 3 + adds r1, r2 + ldrh r1, [r1, 0x2] + strb r1, [r3, 0x3] + adds r1, r4, 0 + bl obj_anim_rotscale_rewind_to_cmd00_maybe + adds r0, r4, 0 + bl obj_anim_rotscale_continue + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08007C78: .4byte 0x03000b70 + thumb_func_end sub_8007C40 + + thumb_func_start sub_8007C7C +sub_8007C7C: @ 8007C7C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08007CA8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x3] + subs r2, 0x1 + strb r2, [r1, 0x3] + adds r1, r4, 0 + bl obj_anim_rotscale_rewind_to_cmd00_maybe + adds r0, r4, 0 + bl obj_anim_rotscale_continue + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08007CA8: .4byte 0x03000b70 + thumb_func_end sub_8007C7C + + thumb_func_start obj_anim_rotscale_rewind_to_cmd00_maybe +obj_anim_rotscale_rewind_to_cmd00_maybe: @ 8007CAC + push {r4-r7,lr} + mov r12, r1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08007CD0 + lsls r3, r5, 1 + adds r0, r3, r5 + lsls r0, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x3] + adds r6, r1, 0 + cmp r0, 0 + beq _08007D0C + ldrb r0, [r2, 0x1] + subs r0, 0x1 + strb r0, [r2, 0x1] + adds r4, r3, 0 + b _08007CDC + .align 2, 0 +_08007CD0: .4byte 0x03000b70 +_08007CD4: + cmp r2, 0 + beq _08007D00 + subs r0, r2, 0x1 + strb r0, [r3, 0x1] +_08007CDC: + adds r0, r4, r5 + lsls r0, 2 + adds r3, r0, r6 + ldrb r0, [r3] + mov r2, r12 + ldr r1, [r2, 0x10] + lsls r0, 2 + adds r0, r1 + ldrb r2, [r3, 0x1] + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r1 + subs r0, 0x8 + movs r7, 0 + ldrsh r1, [r0, r7] + ldr r0, _08007D14 + cmp r1, r0 + bne _08007CD4 +_08007D00: + adds r1, r4, r5 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x1] + subs r0, 0x1 + strb r0, [r1, 0x1] +_08007D0C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08007D14: .4byte 0x00007ffd + thumb_func_end obj_anim_rotscale_rewind_to_cmd00_maybe + + thumb_func_start anim_rotscale_1 +anim_rotscale_1: @ 8007D18 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08007D60 + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 2 + adds r4, r0 + ldrb r2, [r4] + ldr r0, [r1, 0x10] + lsls r2, 2 + adds r2, r0 + ldrb r0, [r4, 0x1] + ldr r2, [r2] + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x2] + strb r0, [r4, 0x1] + mov r6, sp + adds r0, r5, 0 + mov r2, sp + bl rotscale_load_frame + adds r0, r5, 0 + mov r1, sp + bl sub_8008168 + ldrb r0, [r6, 0x5] + strb r0, [r4, 0x2] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007D60: .4byte 0x03000b70 + thumb_func_end anim_rotscale_1 + + thumb_func_start anim_rotscale_2 +anim_rotscale_2: @ 8007D64 + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + movs r3, 0 + str r2, [sp] + str r3, [sp, 0x4] + adds r1, 0x3F + ldrb r2, [r1] + movs r3, 0x20 + orrs r2, r3 + strb r2, [r1] + ldr r2, _08007D9C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x1] + subs r2, 0x1 + strb r2, [r1, 0x1] + mov r1, sp + bl rotscale_frame_apply_relative_and_sync + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_08007D9C: .4byte 0x03000b70 + thumb_func_end anim_rotscale_2 + + thumb_func_start anim_rotscale_3 +anim_rotscale_3: @ 8007DA0 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r5, sp + adds r0, r4, 0 + mov r2, sp + bl rotscale_load_frame + adds r0, r4, 0 + mov r1, sp + bl sub_8008168 + ldr r1, _08007DD4 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r5, 0x5] + strb r1, [r0, 0x2] + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08007DD4: .4byte 0x03000b70 + thumb_func_end anim_rotscale_3 + + thumb_func_start rotscale_set_indirect +rotscale_set_indirect: @ 8007DD8 + lsls r0, 24 + ldr r2, _08007DF4 + lsrs r0, 21 + adds r0, r2 + ldrh r2, [r1] + strh r2, [r0] + ldrh r2, [r1, 0x2] + strh r2, [r0, 0x2] + ldrh r2, [r1, 0x4] + strh r2, [r0, 0x4] + ldrh r1, [r1, 0x6] + strh r1, [r0, 0x6] + bx lr + .align 2, 0 +_08007DF4: .4byte 0x02021bc0 + thumb_func_end rotscale_set_indirect + + thumb_func_start obj_get_rotscale_entry_index +obj_get_rotscale_entry_index: @ 8007DF8 + push {lr} + adds r2, r0, 0 + movs r3, 0 + ldrb r0, [r2, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08007E12 + ldrb r0, [r2, 0x3] + lsls r0, 26 + lsrs r3, r0, 27 +_08007E12: + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end obj_get_rotscale_entry_index + + thumb_func_start sub_8007E18 +sub_8007E18: @ 8007E18 + strh r1, [r0, 0x3A] + strh r2, [r0, 0x3C] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_8007E18 + + thumb_func_start sub_8007E28 +sub_8007E28: @ 8007E28 + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r2, 0 + subs r0, r1, r3 + cmp r0, 0 + bge _08007E3A + negs r0, r0 + asrs r4, r0, 9 + b _08007E3E +_08007E3A: + asrs r0, 9 + negs r4, r0 +_08007E3E: + adds r0, r5, 0 + muls r0, r1 + adds r1, r3, 0 + bl __udivsi3 + adds r0, r4 + subs r0, r5, r0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8007E28 + + thumb_func_start obj_update_pos2 +obj_update_pos2: @ 8007E54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + ldrb r1, [r5, 0x3] + lsls r0, r1, 26 + lsrs r7, r0, 27 + movs r0, 0x80 + lsls r0, 4 + mov r9, r0 + cmp r6, r9 + beq _08007EA2 + ldr r2, _08007EE8 + lsrs r1, 6 + lsls r1, 3 + ldrb r0, [r5, 0x1] + lsrs r0, 6 + lsls r0, 5 + adds r1, r0 + adds r1, r2 + ldr r0, [r1] + lsls r4, r0, 8 + lsls r0, 16 + ldr r2, _08007EEC + lsls r1, r7, 3 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl __divsi3 + adds r1, r0, 0 + adds r0, r4, 0 + adds r2, r6, 0 + bl sub_8007E28 + strh r0, [r5, 0x24] +_08007EA2: + cmp r8, r9 + beq _08007EDA + ldr r2, _08007EE8 + ldrb r1, [r5, 0x3] + lsrs r1, 6 + lsls r1, 3 + ldrb r0, [r5, 0x1] + lsrs r0, 6 + lsls r0, 5 + adds r1, r0 + adds r2, 0x4 + adds r1, r2 + ldr r0, [r1] + lsls r4, r0, 8 + lsls r0, 16 + ldr r2, _08007EEC + lsls r1, r7, 3 + adds r1, r2 + movs r2, 0x6 + ldrsh r1, [r1, r2] + bl __divsi3 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + bl sub_8007E28 + strh r0, [r5, 0x26] +_08007EDA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08007EE8: .4byte 0x082ec6f4 +_08007EEC: .4byte 0x02021bc0 + thumb_func_end obj_update_pos2 + + thumb_func_start obj_set_horizonal_and_vertical_flip +obj_set_horizonal_and_vertical_flip: @ 8007EF0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldrb r6, [r0, 0x3] + lsls r3, r6, 26 + lsrs r3, 27 + movs r4, 0x7 + ands r3, r4 + lsls r3, 1 + subs r4, 0x46 + mov r8, r4 + mov r5, r8 + ands r5, r6 + orrs r5, r3 + strb r5, [r0, 0x3] + lsls r4, r5, 26 + lsrs r4, 27 + movs r6, 0x3F + adds r6, r0 + mov r12, r6 + ldrb r3, [r6] + lsls r3, 31 + lsrs r3, 31 + eors r1, r3 + movs r6, 0x1 + ands r1, r6 + lsls r1, 3 + orrs r4, r1 + lsls r4, 1 + mov r3, r8 + ands r3, r5 + orrs r3, r4 + strb r3, [r0, 0x3] + lsls r4, r3, 26 + lsrs r4, 27 + mov r5, r12 + ldrb r1, [r5] + lsls r1, 30 + lsrs r1, 31 + eors r2, r1 + ands r2, r6 + lsls r2, 4 + orrs r4, r2 + lsls r4, 1 + mov r6, r8 + ands r3, r6 + orrs r3, r4 + strb r3, [r0, 0x3] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end obj_set_horizonal_and_vertical_flip + + thumb_func_start rotscale_reset_half +rotscale_reset_half: @ 8007F64 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08007F7C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + strb r0, [r1, 0x3] + bx lr + .align 2, 0 +_08007F7C: .4byte 0x03000b70 + thumb_func_end rotscale_reset_half + + thumb_func_start rotscale_reset_full_1 +rotscale_reset_full_1: @ 8007F80 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08007FA4 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r3, 0 + strb r1, [r2] + strb r3, [r2, 0x1] + strb r3, [r2, 0x2] + strb r3, [r2, 0x3] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r2, 0x4] + strh r0, [r2, 0x6] + strh r3, [r2, 0x8] + bx lr + .align 2, 0 +_08007FA4: .4byte 0x03000b70 + thumb_func_end rotscale_reset_full_1 + + thumb_func_start rotscale_reset_full_2 +rotscale_reset_full_2: @ 8007FA8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08007FCC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + strb r0, [r1, 0x3] + movs r2, 0x80 + lsls r2, 1 + strh r2, [r1, 0x4] + strh r2, [r1, 0x6] + strh r0, [r1, 0x8] + bx lr + .align 2, 0 +_08007FCC: .4byte 0x03000b70 + thumb_func_end rotscale_reset_full_2 + + thumb_func_start rotscale_frame_apply_absolute +rotscale_frame_apply_absolute: @ 8007FD0 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08007FF0 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrh r0, [r1] + strh r0, [r2, 0x4] + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x6] + ldrb r0, [r1, 0x4] + lsls r0, 8 + strh r0, [r2, 0x8] + bx lr + .align 2, 0 +_08007FF0: .4byte 0x03000b70 + thumb_func_end rotscale_frame_apply_absolute + + thumb_func_start obj_anim_image_delay_progress +obj_anim_image_delay_progress: @ 8007FF4 + push {lr} + adds r3, r0, 0 + adds r3, 0x2C + ldrb r2, [r3] + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _08008018 + lsls r0, r2, 26 + lsrs r0, 26 + subs r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_08008018: + pop {r0} + bx r0 + thumb_func_end obj_anim_image_delay_progress + + thumb_func_start obj_anim_rotscale_delay_progress +obj_anim_rotscale_delay_progress: @ 800801C + push {lr} + lsls r1, 24 + lsrs r2, r1, 24 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08008040 + ldr r0, _08008048 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + subs r0, 0x1 + strb r0, [r1, 0x2] +_08008040: + ldrb r0, [r3] + lsrs r0, 7 + pop {r1} + bx r1 + .align 2, 0 +_08008048: .4byte 0x03000b70 + thumb_func_end obj_anim_rotscale_delay_progress + + thumb_func_start rotscale_frame_apply_relative_and_sync +rotscale_frame_apply_relative_and_sync: @ 800804C + push {r4-r6,lr} + sub sp, 0x10 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080080D4 + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r1] + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r4, 0x4] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x6] + adds r0, r2 + strh r0, [r4, 0x6] + ldrb r0, [r1, 0x4] + lsls r0, 8 + ldrh r1, [r4, 0x8] + adds r0, r1 + ldr r2, _080080D8 + adds r1, r2, 0 + ands r0, r1 + strh r0, [r4, 0x8] + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl divide_0x10000_by + lsls r0, 16 + lsrs r0, 16 + ldr r6, _080080DC + ldr r1, [sp] + ands r1, r6 + orrs r1, r0 + str r1, [sp] + movs r2, 0x6 + ldrsh r0, [r4, r2] + bl divide_0x10000_by + lsls r0, 16 + ldr r2, _080080E0 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldrh r1, [r4, 0x8] + ldr r0, [sp, 0x4] + ands r0, r6 + orrs r0, r1 + str r0, [sp, 0x4] + add r4, sp, 0x8 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl _082E709C + adds r0, r5, 0 + adds r1, r4, 0 + bl rotscale_set_indirect + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080080D4: .4byte 0x03000b70 +_080080D8: .4byte 0xffffff00 +_080080DC: .4byte 0xffff0000 +_080080E0: .4byte 0x0000ffff + thumb_func_end rotscale_frame_apply_relative_and_sync + + thumb_func_start divide_0x10000_by +divide_0x10000_by: @ 80080E4 + push {lr} + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 9 + lsls r1, 16 + asrs r1, 16 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end divide_0x10000_by + + thumb_func_start rotscale_load_frame +rotscale_load_frame: @ 80080FC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08008164 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r4, r3 + ldrb r3, [r4] + ldr r0, [r1, 0x10] + lsls r3, 2 + adds r3, r0 + ldrb r0, [r4, 0x1] + ldr r3, [r3] + lsls r0, 3 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2] + ldrb r3, [r4] + ldr r0, [r1, 0x10] + lsls r3, 2 + adds r3, r0 + ldrb r0, [r4, 0x1] + ldr r3, [r3] + lsls r0, 3 + adds r0, r3 + ldrh r0, [r0, 0x2] + strh r0, [r2, 0x2] + ldrb r3, [r4] + ldr r0, [r1, 0x10] + lsls r3, 2 + adds r3, r0 + ldrb r0, [r4, 0x1] + ldr r3, [r3] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x4] + strb r0, [r2, 0x4] + ldrb r3, [r4] + ldr r0, [r1, 0x10] + lsls r3, 2 + adds r3, r0 + ldrb r0, [r4, 0x1] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x5] + strb r0, [r2, 0x5] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08008164: .4byte 0x03000b70 + thumb_func_end rotscale_load_frame + + thumb_func_start sub_8008168 +sub_8008168: @ 8008168 + push {r4,lr} + sub sp, 0x8 + adds r2, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + ldrb r0, [r2, 0x5] + cmp r0, 0 + beq _0800818E + subs r0, 0x1 + strb r0, [r2, 0x5] + adds r0, r4, 0 + adds r1, r2, 0 + bl rotscale_frame_apply_relative_and_sync + b _0800819E +_0800818E: + adds r0, r4, 0 + adds r1, r2, 0 + bl rotscale_frame_apply_absolute + adds r0, r4, 0 + mov r1, sp + bl rotscale_frame_apply_relative_and_sync +_0800819E: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8008168 + + thumb_func_start obj_anim_image_start +obj_anim_image_start: @ 80081A8 + adds r2, r0, 0 + adds r2, 0x2A + strb r1, [r2] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + movs r2, 0x11 + negs r2, r2 + ands r1, r2 + strb r1, [r0] + bx lr + thumb_func_end obj_anim_image_start + + thumb_func_start obj_anim_image_start_if_different +obj_anim_image_start_if_different: @ 80081C0 + push {lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, r1 + beq _080081D6 + adds r0, r2, 0 + bl obj_anim_image_start +_080081D6: + pop {r0} + bx r0 + thumb_func_end obj_anim_image_start_if_different + + thumb_func_start obj_anim_image_seek +obj_anim_image_seek: @ 80081DC + push {r4-r7,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r4, r3, 0 + adds r4, 0x2C + ldrb r0, [r4] + lsls r0, 25 + lsrs r6, r0, 31 + subs r1, 0x1 + adds r0, r3, 0 + adds r0, 0x2B + strb r1, [r0] + ldrb r1, [r4] + movs r7, 0x40 + negs r7, r7 + adds r0, r7, 0 + ands r0, r1 + strb r0, [r4] + adds r2, r3, 0 + adds r2, 0x3F + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + ldrb r1, [r4] + movs r5, 0x41 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r4] + adds r0, r3, 0 + bl obj_anim_image_continue + ldrb r2, [r4] + movs r0, 0x3F + ands r0, r2 + cmp r0, 0 + beq _08008244 + lsls r0, r2, 26 + lsrs r0, 26 + adds r0, 0x1 + movs r1, 0x3F + ands r0, r1 + adds r1, r7, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4] +_08008244: + lsls r2, r6, 6 + ldrb r1, [r4] + adds r0, r5, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end obj_anim_image_seek + + thumb_func_start sub_8008258 +sub_8008258: @ 8008258 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl obj_get_rotscale_entry_index + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl rotscale_reset_full_1 + adds r5, 0x3F + ldrb r0, [r5] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8008258 + + thumb_func_start sub_8008284 +sub_8008284: @ 8008284 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl obj_get_rotscale_entry_index + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080082B4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1] + cmp r0, r4 + beq _080082AC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8008258 +_080082AC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080082B4: .4byte 0x03000b70 + thumb_func_end sub_8008284 + + thumb_func_start sub_80082B8 +sub_80082B8: @ 80082B8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl obj_get_rotscale_entry_index + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080082EC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strb r4, [r1] + adds r5, 0x3F + ldrb r0, [r5] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080082EC: .4byte 0x03000b70 + thumb_func_end sub_80082B8 + + thumb_func_start sub_80082F0 +sub_80082F0: @ 80082F0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl obj_get_rotscale_entry_index + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08008320 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1] + cmp r0, r4 + beq _08008318 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80082B8 +_08008318: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08008320: .4byte 0x03000b70 + thumb_func_end sub_80082F0 + + thumb_func_start sub_8008324 +sub_8008324: @ 8008324 + push {lr} + adds r3, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08008370 + adds r0, r3, 0 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, [r3, 0x8] + lsls r1, 2 + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r2, [r0] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08008358 + movs r2, 0 +_08008358: + adds r0, r3, 0 + adds r0, 0x40 + ldrh r1, [r0] + adds r1, r2 + ldr r2, _08008374 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, _08008378 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] +_08008370: + pop {r0} + bx r0 + .align 2, 0 +_08008374: .4byte 0x000003ff +_08008378: .4byte 0xfffffc00 + thumb_func_end sub_8008324 + + thumb_func_start rotscale_reset_all +rotscale_reset_all: @ 800837C + push {r4,lr} + ldr r1, _080083A8 + movs r0, 0 + strb r0, [r1] + ldr r1, _080083AC + movs r0, 0 + str r0, [r1] + bl reset_rotscale_coeffs + movs r4, 0 +_08008390: + adds r0, r4, 0 + bl rotscale_reset_full_2 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08008390 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080083A8: .4byte 0x02021cc0 +_080083AC: .4byte 0x03003018 + thumb_func_end rotscale_reset_all + + thumb_func_start rotscale_alloc_entry +rotscale_alloc_entry: @ 80083B0 + push {r4,lr} + movs r2, 0 + movs r1, 0x1 + ldr r0, _080083D0 + ldr r4, [r0] + adds r3, r0, 0 +_080083BC: + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080083D4 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r0, r2, 0 + b _080083E2 + .align 2, 0 +_080083D0: .4byte 0x03003018 +_080083D4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 1 + cmp r2, 0x1F + bls _080083BC + movs r0, 0xFF +_080083E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end rotscale_alloc_entry + + thumb_func_start rotscale_free_entry +rotscale_free_entry: @ 80083E8 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + movs r1, 0x1 + ldr r3, _08008424 + cmp r0, r2 + bcs _08008406 +_080083FA: + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 1 + cmp r0, r2 + bcc _080083FA +_08008406: + ldr r0, [r3] + bics r0, r1 + str r0, [r3] + movs r1, 0x80 + lsls r1, 1 + str r1, [sp] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08008424: .4byte 0x03003018 + thumb_func_end rotscale_free_entry + + thumb_func_start obj_alloc_rotscale_entry +obj_alloc_rotscale_entry: @ 8008428 + push {r4,r5,lr} + adds r4, r0, 0 + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xFF + beq _08008470 + 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 oam_center + movs r0, 0x1F + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl rotscale_reset_full_2 +_08008470: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end obj_alloc_rotscale_entry + + thumb_func_start sub_8008478 +sub_8008478: @ 8008478 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + adds r6, r0, 0 + adds r0, r1, 0 + adds r4, r2, 0 + adds r5, r3, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r0, 16 + asrs r0, 16 + bl divide_0x10000_by + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080084F0 + mov r8, r1 + ldr r1, [sp] + mov r2, r8 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl divide_0x10000_by + lsls r0, 16 + ldr r2, _080084F4 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldr r0, [sp, 0x4] + mov r1, r8 + ands r0, r1 + orrs r0, r5 + str r0, [sp, 0x4] + add r4, sp, 0x8 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl _082E709C + adds r0, r6, 0 + adds r1, r4, 0 + bl rotscale_set_indirect + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080084F0: .4byte 0xffff0000 +_080084F4: .4byte 0x0000ffff + thumb_func_end sub_8008478 + + thumb_func_start gpu_tile_obj_alloc_tag_and_copy_to_vram +gpu_tile_obj_alloc_tag_and_copy_to_vram: @ 80084F8 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x4] + lsrs r0, 5 + bl gpu_tile_obj_alloc + lsls r4, r0, 16 + asrs r6, r4, 16 + cmp r6, 0 + blt _08008534 + ldrh r0, [r5, 0x6] + lsrs r4, 16 + ldrh r2, [r5, 0x4] + lsrs r2, 5 + adds r1, r4, 0 + bl gpu_tile_obj_tag_add + ldr r0, [r5] + lsls r1, r6, 5 + ldr r2, _08008530 + adds r1, r2 + ldrh r2, [r5, 0x4] + lsrs r2, 1 + bl CpuSet + adds r0, r4, 0 + b _08008536 + .align 2, 0 +_08008530: .4byte 0x06010000 +_08008534: + movs r0, 0 +_08008536: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end gpu_tile_obj_alloc_tag_and_copy_to_vram + + thumb_func_start gpu_tile_obj_alloc_and_load_multiple +gpu_tile_obj_alloc_and_load_multiple: @ 800853C + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r0, [r5] + cmp r0, 0 + beq _08008560 +_08008548: + lsls r0, r4, 3 + adds r0, r5, r0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 3 + adds r0, r5 + ldr r0, [r0] + cmp r0, 0 + bne _08008548 +_08008560: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end gpu_tile_obj_alloc_and_load_multiple + + thumb_func_start gpu_tile_obj_free_by_tag +gpu_tile_obj_free_by_tag: @ 8008568 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + bl gpu_tile_obj_tag_index_of + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _080085C6 + ldr r0, _080085D0 + lsls r1, r4, 2 + adds r2, r1, r0 + adds r0, 0x2 + adds r1, r0 + ldrh r0, [r1] + ldrh r3, [r2] + adds r0, r3, r0 + ldr r1, _080085D4 + mov r8, r1 + lsls r5, r4, 1 + cmp r3, r0 + bge _080085BE + ldr r1, _080085D8 + mov r12, r1 + movs r6, 0x7 + movs r7, 0x1 + adds r4, r0, 0 +_080085A2: + lsrs r2, r3, 3 + add r2, r12 + adds r0, r3, 0 + ands r0, r6 + adds r1, r7, 0 + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + blt _080085A2 +_080085BE: + mov r0, r8 + adds r1, r5, r0 + ldr r0, _080085DC + strh r0, [r1] +_080085C6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080085D0: .4byte 0x03000a70 +_080085D4: .4byte 0x030009f0 +_080085D8: .4byte 0x02021b3c +_080085DC: .4byte 0x0000ffff + thumb_func_end gpu_tile_obj_free_by_tag + + thumb_func_start gpu_tile_obj_tags_reset +gpu_tile_obj_tags_reset: @ 80085E0 + push {r4-r7,lr} + movs r2, 0 + ldr r7, _08008614 + ldr r0, _08008618 + adds r6, r0, 0 + ldr r4, _0800861C + movs r3, 0 + adds r5, r4, 0x2 +_080085F0: + lsls r1, r2, 1 + adds r1, r7 + ldrh r0, [r1] + orrs r0, r6 + strh r0, [r1] + lsls r1, r2, 2 + adds r0, r1, r4 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _080085F0 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08008614: .4byte 0x030009f0 +_08008618: .4byte 0x0000ffff +_0800861C: .4byte 0x03000a70 + thumb_func_end gpu_tile_obj_tags_reset + + thumb_func_start gpu_tile_obj_tag_get_range_start +gpu_tile_obj_tag_get_range_start: @ 8008620 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl gpu_tile_obj_tag_index_of + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _08008640 + ldr r0, _0800863C + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1] + b _08008642 + .align 2, 0 +_0800863C: .4byte 0x03000a70 +_08008640: + ldr r0, _08008648 +_08008642: + pop {r1} + bx r1 + .align 2, 0 +_08008648: .4byte 0x0000ffff + thumb_func_end gpu_tile_obj_tag_get_range_start + + thumb_func_start gpu_tile_obj_tag_index_of +gpu_tile_obj_tag_index_of: @ 800864C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, _08008664 +_08008656: + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _08008668 + adds r0, r1, 0 + b _08008674 + .align 2, 0 +_08008664: .4byte 0x030009f0 +_08008668: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3F + bls _08008656 + movs r0, 0xFF +_08008674: + pop {r1} + bx r1 + thumb_func_end gpu_tile_obj_tag_index_of + + thumb_func_start gpu_tile_obj_tag_get_by_range_start +gpu_tile_obj_tag_get_by_range_start: @ 8008678 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r6, _080086A0 + ldr r5, _080086A4 + ldr r4, _080086A8 +_08008686: + lsls r0, r2, 1 + adds r1, r0, r6 + ldrh r0, [r1] + cmp r0, r5 + beq _080086AC + lsls r0, r2, 2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + bne _080086AC + ldrh r0, [r1] + b _080086B8 + .align 2, 0 +_080086A0: .4byte 0x030009f0 +_080086A4: .4byte 0x0000ffff +_080086A8: .4byte 0x03000a70 +_080086AC: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _08008686 + ldr r0, _080086C0 +_080086B8: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080086C0: .4byte 0x0000ffff + thumb_func_end gpu_tile_obj_tag_get_by_range_start + + thumb_func_start gpu_tile_obj_tag_add +gpu_tile_obj_tag_add: @ 80086C4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, _08008700 + bl gpu_tile_obj_tag_index_of + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08008704 + lsls r1, r0, 1 + adds r1, r2 + strh r4, [r1] + ldr r1, _08008708 + lsls r0, 2 + adds r2, r0, r1 + strh r5, [r2] + adds r1, 0x2 + adds r0, r1 + strh r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08008700: .4byte 0x0000ffff +_08008704: .4byte 0x030009f0 +_08008708: .4byte 0x03000a70 + thumb_func_end gpu_tile_obj_tag_add + + thumb_func_start gpu_pal_allocator_reset +gpu_pal_allocator_reset: @ 800870C + push {r4,lr} + ldr r1, _08008738 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + ldr r4, _0800873C + ldr r0, _08008740 + adds r3, r0, 0 +_0800871C: + lsls r0, r2, 1 + adds r0, r4 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0800871C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08008738: .4byte 0x0300301c +_0800873C: .4byte 0x03000cf0 +_08008740: .4byte 0x0000ffff + thumb_func_end gpu_pal_allocator_reset + + thumb_func_start gpu_pal_obj_alloc_tag_and_apply +gpu_pal_obj_alloc_tag_and_apply: @ 8008744 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _0800875A + adds r0, r4, 0 + b _0800878A +_0800875A: + ldr r0, _08008780 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _08008788 + ldr r1, _08008784 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldr r0, [r5] + lsls r1, r4, 4 + bl gpu_pal_obj_load + adds r0, r4, 0 + b _0800878A + .align 2, 0 +_08008780: .4byte 0x0000ffff +_08008784: .4byte 0x03000cf0 +_08008788: + movs r0, 0xFF +_0800878A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end gpu_pal_obj_alloc_tag_and_apply + + thumb_func_start gpu_pal_obj_alloc_and_load_multiple +gpu_pal_obj_alloc_and_load_multiple: @ 8008790 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 + b _0800879E +_08008798: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_0800879E: + lsls r0, r4, 3 + adds r1, r0, r5 + ldr r0, [r1] + cmp r0, 0 + beq _080087B6 + adds r0, r1, 0 + bl gpu_pal_obj_alloc_tag_and_apply + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08008798 +_080087B6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end gpu_pal_obj_alloc_and_load_multiple + + thumb_func_start gpu_pal_obj_load +gpu_pal_obj_load: @ 80087BC + push {lr} + lsls r1, 16 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + thumb_func_end gpu_pal_obj_load + + thumb_func_start gpu_pal_alloc_new +gpu_pal_alloc_new: @ 80087D4 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _080087F4 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080087FC + ldr r1, _080087F8 + lsls r0, r2, 1 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + b _080087FE + .align 2, 0 +_080087F4: .4byte 0x0000ffff +_080087F8: .4byte 0x03000cf0 +_080087FC: + movs r0, 0xFF +_080087FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end gpu_pal_alloc_new + + thumb_func_start gpu_pal_tags_index_of +gpu_pal_tags_index_of: @ 8008804 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _08008824 + ldrb r1, [r0] + cmp r1, 0xF + bhi _08008836 + ldr r3, _08008828 +_08008814: + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0800882C + adds r0, r1, 0 + b _08008838 + .align 2, 0 +_08008824: .4byte 0x0300301c +_08008828: .4byte 0x03000cf0 +_0800882C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _08008814 +_08008836: + movs r0, 0xFF +_08008838: + pop {r1} + bx r1 + thumb_func_end gpu_pal_tags_index_of + + thumb_func_start gpu_pal_tag_by_index +gpu_pal_tag_by_index: @ 800883C + lsls r0, 24 + ldr r1, _08008848 + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_08008848: .4byte 0x03000cf0 + thumb_func_end gpu_pal_tag_by_index + + thumb_func_start gpu_pal_free_tag +gpu_pal_free_tag: @ 800884C + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _08008868 + ldr r0, _0800886C + lsls r1, 1 + adds r1, r0 + ldr r0, _08008870 + strh r0, [r1] +_08008868: + pop {r0} + bx r0 + .align 2, 0 +_0800886C: .4byte 0x03000cf0 +_08008870: .4byte 0x0000ffff + thumb_func_end gpu_pal_free_tag + + thumb_func_start obj_set_f18_to_r0_f42_to_40 +obj_set_f18_to_r0_f42_to_40: @ 8008874 + str r1, [r0, 0x18] + adds r0, 0x42 + movs r1, 0x40 + strb r1, [r0] + bx lr + thumb_func_end obj_set_f18_to_r0_f42_to_40 + + thumb_func_start super_sprite_add +super_sprite_add: @ 8008880 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + ldr r1, _08008894 + ldrb r0, [r3] + ldrb r1, [r1] + cmp r0, r1 + bcc _08008898 + movs r0, 0x1 + b _080088E0 + .align 2, 0 +_08008894: .4byte 0x02021b38 +_08008898: + ldr r0, [r4, 0x18] + cmp r0, 0 + beq _080088AC + adds r0, r4, 0 + adds r0, 0x42 + ldrb r1, [r0] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + bne _080088CC +_080088AC: + ldr r0, _080088C8 + ldrb r2, [r3] + lsls r2, 3 + adds r0, 0x38 + adds r2, r0 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + movs r0, 0 + b _080088E0 + .align 2, 0 +_080088C8: .4byte 0x030022c0 +_080088CC: + ldrb r1, [r3] + lsls r1, 3 + ldr r0, _080088E8 + adds r1, r0 + adds r0, r4, 0 + adds r2, r3, 0 + bl sub_80088EC + lsls r0, 24 + lsrs r0, 24 +_080088E0: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080088E8: .4byte 0x030022f8 + thumb_func_end super_sprite_add + + thumb_func_start sub_80088EC +sub_80088EC: @ 80088EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r3, r0, 0 + str r1, [sp] + mov r8, r2 + ldr r0, _0800890C + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bcc _08008910 +_08008908: + movs r0, 0x1 + b _08008AE6 + .align 2, 0 +_0800890C: .4byte 0x02021b38 +_08008910: + adds r0, r3, 0 + adds r0, 0x42 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 23 + ldr r2, [r3, 0x18] + adds r7, r2, r1 + mov r12, r3 + str r0, [sp, 0x18] + cmp r7, 0 + beq _0800892C + ldr r0, [r7, 0x4] + cmp r0, 0 + bne _08008942 +_0800892C: + mov r2, r12 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [sp] + str r0, [r2] + str r1, [r2, 0x4] + mov r1, r8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08008AE4 +_08008942: + mov r2, r12 + ldrh r0, [r2, 0x4] + lsls r0, 22 + lsrs r0, 22 + str r0, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0xC] + ldrb r0, [r2, 0x3] + lsls r0, 26 + lsrs r0, 27 + asrs r1, r0, 3 + str r1, [sp, 0x10] + movs r1, 0x1 + ldr r2, [sp, 0x10] + ands r2, r1 + str r2, [sp, 0x10] + asrs r0, 4 + mov r10, r0 + ands r0, r1 + mov r10, r0 + mov r1, r12 + ldrh r0, [r1, 0x2] + lsls r0, 23 + lsrs r0, 23 + adds r1, 0x28 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + mov r1, r12 + ldrb r0, [r1] + adds r1, 0x29 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0xC] + cmp r9, r1 + bcc _080089A0 + b _08008AE4 +_080089A0: + lsls r0, r2, 16 + asrs r0, 16 + str r0, [sp, 0x14] +_080089A6: + mov r2, r8 + ldrb r0, [r2] + ldr r1, _08008AF8 + ldrb r1, [r1] + cmp r0, r1 + bcs _08008908 + ldr r0, [r7, 0x4] + mov r2, r9 + lsls r6, r2, 2 + adds r2, r6, r0 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [sp, 0x10] + cmp r0, 0 + beq _080089FC + ldr r0, [r2] + lsls r1, r0, 12 + lsrs r1, 30 + lsls r1, 2 + lsls r0, 14 + lsrs r0, 30 + lsls r0, 4 + adds r1, r0 + ldr r0, _08008AFC + adds r1, r0 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r0, r4, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + mvns r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_080089FC: + mov r1, r10 + cmp r1, 0 + beq _08008A2E + ldr r0, [r2] + lsls r1, r0, 12 + lsrs r1, 30 + lsls r1, 2 + lsls r0, 14 + lsrs r0, 30 + lsls r0, 4 + adds r1, r0 + ldr r2, _08008AFC + adds r1, r2 + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + mvns r0, r5 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_08008A2E: + mov r1, r9 + lsls r0, r1, 3 + ldr r2, [sp] + adds r3, r0, r2 + mov r2, r12 + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [r3] + str r1, [r3, 0x4] + ldr r0, [r7, 0x4] + adds r0, r6, r0 + ldr r1, [r0] + lsls r1, 14 + lsrs r1, 30 + lsls r1, 6 + ldrb r2, [r3, 0x1] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] + ldr r0, [r7, 0x4] + adds r0, r6, r0 + ldr r1, [r0] + lsls r1, 12 + lsrs r1, 30 + lsls r1, 6 + ldrb r2, [r3, 0x3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + lsls r1, r4, 16 + asrs r1, 16 + ldr r0, [sp, 0x14] + adds r1, r0, r1 + ldr r2, _08008B00 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x2] + ldr r0, _08008B04 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x2] + ldr r1, [sp, 0x8] + adds r0, r1, r5 + strb r0, [r3] + ldr r0, [r7, 0x4] + adds r0, r6, r0 + ldr r1, [r0] + lsls r1, 2 + lsrs r1, 22 + ldr r2, [sp, 0x4] + adds r1, r2, r1 + ldr r2, _08008B08 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, _08008B0C + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldr r0, [sp, 0x18] + ldrb r1, [r0] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + beq _08008ACA + ldr r0, [r7, 0x4] + adds r0, r6, r0 + ldr r1, [r0] + lsrs r1, 30 + lsls r1, 2 + ldrb r2, [r3, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] +_08008ACA: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r1, r8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, [sp, 0xC] + cmp r9, r2 + bcs _08008AE4 + b _080089A6 +_08008AE4: + movs r0, 0 +_08008AE6: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08008AF8: .4byte 0x02021b38 +_08008AFC: .4byte 0x082ec754 +_08008B00: .4byte 0x000001ff +_08008B04: .4byte 0xfffffe00 +_08008B08: .4byte 0x000003ff +_08008B0C: .4byte 0xfffffc00 + thumb_func_end sub_80088EC + + thumb_func_start strcpy_limit_10_chars +strcpy_limit_10_chars: @ 8008B10 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0xA + movs r3, 0 +_08008B18: + adds r2, r4, r3 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08008B2C + adds r0, r2, 0 + b _08008B3C +_08008B2C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _08008B18 + adds r0, r4, r3 + movs r1, 0xFF + strb r1, [r0] +_08008B3C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end strcpy_limit_10_chars + + thumb_func_start get_end_of_string_ptr_limit_10_chars +get_end_of_string_ptr_limit_10_chars: @ 8008B44 + push {r4,lr} + adds r3, r0, 0 + movs r4, 0xA + movs r2, 0 +_08008B4C: + adds r1, r3, r2 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08008B58 + adds r0, r1, 0 + b _08008B68 +_08008B58: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _08008B4C + adds r0, r3, r2 + movs r1, 0xFF + strb r1, [r0] +_08008B68: + pop {r4} + pop {r1} + bx r1 + thumb_func_end get_end_of_string_ptr_limit_10_chars + + thumb_func_start strcpy_limit_7_chars +strcpy_limit_7_chars: @ 8008B70 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0x7 + movs r3, 0 +_08008B78: + adds r2, r4, r3 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08008B8C + adds r0, r2, 0 + b _08008B98 +_08008B8C: + adds r3, 0x1 + cmp r3, r5 + blt _08008B78 + adds r0, r4, r3 + movs r1, 0xFF + strb r1, [r0] +_08008B98: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end strcpy_limit_7_chars + + thumb_func_start gf_strcpy +gf_strcpy: @ 8008BA0 + push {lr} + adds r3, r0, 0 + b _08008BAC +_08008BA6: + strb r2, [r3] + adds r3, 0x1 + adds r1, 0x1 +_08008BAC: + ldrb r2, [r1] + adds r0, r2, 0 + cmp r0, 0xFF + bne _08008BA6 + movs r0, 0xFF + strb r0, [r3] + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end gf_strcpy + + thumb_func_start gf_strcat +gf_strcat: @ 8008BC0 + push {lr} + adds r2, r0, 0 + b _08008BC8 +_08008BC6: + adds r2, 0x1 +_08008BC8: + ldrb r0, [r2] + cmp r0, 0xFF + bne _08008BC6 + adds r0, r2, 0 + bl gf_strcpy + pop {r1} + bx r1 + thumb_func_end gf_strcat + + thumb_func_start gf_strncpy +gf_strncpy: @ 8008BD8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r5, r2, 24 + movs r3, 0 + adds r0, r5, 0 + cmp r3, r0 + bcs _08008BFE + adds r2, r0, 0 +_08008BEC: + adds r1, r4, r3 + adds r0, r6, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r2 + bcc _08008BEC +_08008BFE: + adds r0, r4, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end gf_strncpy + + thumb_func_start sub_8008C08 +sub_8008C08: @ 8008C08 + push {lr} + adds r3, r0, 0 + lsls r2, 24 + lsrs r2, 24 + b _08008C14 +_08008C12: + adds r3, 0x1 +_08008C14: + ldrb r0, [r3] + cmp r0, 0xFF + bne _08008C12 + adds r0, r3, 0 + bl gf_strncpy + pop {r1} + bx r1 + thumb_func_end sub_8008C08 + + thumb_func_start sub_8008C24 +sub_8008C24: @ 8008C24 + push {lr} + adds r2, r0, 0 + movs r1, 0 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08008C3E +_08008C30: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08008C30 +_08008C3E: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8008C24 + + thumb_func_start sub_8008C44 +sub_8008C44: @ 8008C44 + push {lr} + adds r2, r0, 0 + b _08008C56 +_08008C4A: + cmp r0, 0xFF + bne _08008C52 + movs r0, 0 + b _08008C64 +_08008C52: + adds r2, 0x1 + adds r1, 0x1 +_08008C56: + ldrb r0, [r2] + ldrb r3, [r1] + cmp r0, r3 + beq _08008C4A + ldrb r0, [r2] + ldrb r1, [r1] + subs r0, r1 +_08008C64: + pop {r1} + bx r1 + thumb_func_end sub_8008C44 + + thumb_func_start sub_8008C68 +sub_8008C68: @ 8008C68 + push {r4,lr} + adds r3, r0, 0 + b _08008C80 +_08008C6E: + cmp r0, 0xFF + beq _08008C7C + adds r3, 0x1 + adds r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _08008C80 +_08008C7C: + movs r0, 0 + b _08008C8E +_08008C80: + ldrb r0, [r3] + ldrb r4, [r1] + cmp r0, r4 + beq _08008C6E + ldrb r0, [r3] + ldrb r1, [r1] + subs r0, r1 +_08008C8E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8008C68 + + thumb_func_start sub_8008C94 +sub_8008C94: @ 8008C94 + push {lr} + adds r3, r0, 0 + movs r2, 0 + cmp r2, r1 + bge _08008CB8 +_08008C9E: + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08008CAE + cmp r0, 0xFF + beq _08008CAE + movs r0, 0x1 + b _08008CBA +_08008CAE: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + blt _08008C9E +_08008CB8: + movs r0, 0 +_08008CBA: + pop {r1} + bx r1 + thumb_func_end sub_8008C94 + + thumb_func_start decimal_int_to_string +decimal_int_to_string: @ 8008CC0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r3, 24 + ldr r0, _08008D18 + lsrs r3, 22 + subs r3, 0x4 + adds r3, r0 + ldr r0, [r3] + movs r7, 0 + cmp r2, 0x1 + bne _08008CDE + movs r7, 0x2 +_08008CDE: + cmp r2, 0x2 + bne _08008CE4 + movs r7, 0x1 +_08008CE4: + adds r5, r0, 0 + cmp r5, 0 + ble _08008D60 + ldr r0, _08008D1C + mov r8, r0 +_08008CEE: + adds r0, r6, 0 + adds r1, r5, 0 + bl __divsi3 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + adds r0, r5, 0 + muls r0, r2 + subs r1, r6, r0 + cmp r7, 0x1 + bne _08008D26 + adds r3, r4, 0 + adds r4, 0x1 + cmp r2, 0x9 + bhi _08008D20 + mov r6, r8 + adds r0, r2, r6 + ldrb r0, [r0] + b _08008D22 + .align 2, 0 +_08008D18: .4byte 0x082ec7e4 +_08008D1C: .4byte 0x082ec7d4 +_08008D20: + movs r0, 0xAC +_08008D22: + strb r0, [r3] + b _08008D50 +_08008D26: + cmp r2, 0 + bne _08008D2E + cmp r5, 0x1 + bne _08008D46 +_08008D2E: + movs r7, 0x1 + adds r2, r4, 0 + adds r4, 0x1 + cmp r3, 0x9 + bhi _08008D40 + mov r6, r8 + adds r0, r3, r6 + ldrb r0, [r0] + b _08008D42 +_08008D40: + movs r0, 0xAC +_08008D42: + strb r0, [r2] + b _08008D50 +_08008D46: + cmp r7, 0x2 + bne _08008D50 + movs r0, 0x77 + strb r0, [r4] + adds r4, 0x1 +_08008D50: + adds r6, r1, 0 + adds r0, r5, 0 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + cmp r5, 0 + bgt _08008CEE +_08008D60: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end decimal_int_to_string + + thumb_func_start sub_8008D70 +sub_8008D70: @ 8008D70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r3, 24 + ldr r0, _08008DC8 + lsrs r3, 22 + subs r3, 0x4 + adds r3, r0 + ldr r0, [r3] + movs r7, 0 + cmp r2, 0x1 + bne _08008D8E + movs r7, 0x2 +_08008D8E: + cmp r2, 0x2 + bne _08008D94 + movs r7, 0x1 +_08008D94: + adds r5, r0, 0 + cmp r5, 0 + ble _08008E10 + ldr r0, _08008DCC + mov r8, r0 +_08008D9E: + adds r0, r6, 0 + adds r1, r5, 0 + bl __udivsi3 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + adds r0, r5, 0 + muls r0, r2 + subs r1, r6, r0 + cmp r7, 0x1 + bne _08008DD6 + adds r3, r4, 0 + adds r4, 0x1 + cmp r2, 0x9 + bhi _08008DD0 + mov r6, r8 + adds r0, r2, r6 + ldrb r0, [r0] + b _08008DD2 + .align 2, 0 +_08008DC8: .4byte 0x082ec7e4 +_08008DCC: .4byte 0x082ec7d4 +_08008DD0: + movs r0, 0xAC +_08008DD2: + strb r0, [r3] + b _08008E00 +_08008DD6: + cmp r2, 0 + bne _08008DDE + cmp r5, 0x1 + bne _08008DF6 +_08008DDE: + movs r7, 0x1 + adds r2, r4, 0 + adds r4, 0x1 + cmp r3, 0x9 + bhi _08008DF0 + mov r6, r8 + adds r0, r3, r6 + ldrb r0, [r0] + b _08008DF2 +_08008DF0: + movs r0, 0xAC +_08008DF2: + strb r0, [r2] + b _08008E00 +_08008DF6: + cmp r7, 0x2 + bne _08008E00 + movs r0, 0x77 + strb r0, [r4] + adds r4, 0x1 +_08008E00: + adds r6, r1, 0 + adds r0, r5, 0 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + cmp r5, 0 + bgt _08008D9E +_08008E10: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8008D70 + + thumb_func_start sub_8008E20 +sub_8008E20: @ 8008E20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + movs r0, 0x1 + cmp r1, r3 + bcs _08008E46 +_08008E3A: + lsls r1, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r3 + bcc _08008E3A +_08008E46: + movs r3, 0 + cmp r2, 0x1 + bne _08008E4E + movs r3, 0x2 +_08008E4E: + cmp r2, 0x2 + bne _08008E54 + movs r3, 0x1 +_08008E54: + adds r5, r1, 0 + cmp r5, 0 + ble _08008ECA + ldr r0, _08008E8C + mov r9, r0 +_08008E5E: + mov r0, r8 + adds r1, r5, 0 + str r3, [sp] + bl __divsi3 + adds r4, r0, 0 + adds r7, r4, 0 + mov r0, r8 + adds r1, r5, 0 + bl __modsi3 + adds r1, r0, 0 + ldr r3, [sp] + cmp r3, 0x1 + bne _08008E90 + adds r2, r6, 0 + adds r6, 0x1 + cmp r4, 0xF + bhi _08008EAA + mov r7, r9 + adds r0, r4, r7 + ldrb r0, [r0] + b _08008EAC + .align 2, 0 +_08008E8C: .4byte 0x082ec7d4 +_08008E90: + cmp r4, 0 + bne _08008E98 + cmp r5, 0x1 + bne _08008EB0 +_08008E98: + movs r3, 0x1 + adds r2, r6, 0 + adds r6, 0x1 + cmp r7, 0xF + bhi _08008EAA + mov r4, r9 + adds r0, r7, r4 + ldrb r0, [r0] + b _08008EAC +_08008EAA: + movs r0, 0xAC +_08008EAC: + strb r0, [r2] + b _08008EBA +_08008EB0: + cmp r3, 0x2 + bne _08008EBA + movs r0, 0x77 + strb r0, [r6] + adds r6, 0x1 +_08008EBA: + mov r8, r1 + adds r0, r5, 0 + cmp r5, 0 + bge _08008EC4 + adds r0, 0xF +_08008EC4: + asrs r5, r0, 4 + cmp r5, 0 + bgt _08008E5E +_08008ECA: + movs r0, 0xFF + strb r0, [r6] + adds r0, r6, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8008E20 + + thumb_func_start ExpandTextCodes +ExpandTextCodes: @ 8008EE0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 +_08008EE6: + ldrb r2, [r5] + adds r5, 0x1 + adds r0, r2, 0 + subs r0, 0xFA + cmp r0, 0x5 + bhi _08008FBA + lsls r0, 2 + ldr r1, _08008EFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08008EFC: .4byte _08008F00 + .align 2, 0 +_08008F00: + .4byte _08008FBA + .4byte _08008FBA + .4byte _08008F2C + .4byte _08008F18 + .4byte _08008FBA + .4byte _08008FC0 +_08008F18: + ldrb r0, [r5] + adds r5, 0x1 + bl get_fcode_buffer + adds r1, r0, 0 + adds r0, r4, 0 + bl ExpandTextCodes + adds r4, r0, 0 + b _08008EE6 +_08008F2C: + strb r2, [r4] + adds r4, 0x1 + ldrb r2, [r5] + adds r5, 0x1 + strb r2, [r4] + adds r4, 0x1 + subs r0, r2, 0x4 + cmp r0, 0x14 + bhi _08008FB0 + lsls r0, 2 + ldr r1, _08008F48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08008F48: .4byte _08008F4C + .align 2, 0 +_08008F4C: + .4byte _08008FA0 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008EE6 + .4byte _08008FB0 + .4byte _08008EE6 + .4byte _08008FB0 + .4byte _08008FA8 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008EE6 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008FB0 + .4byte _08008EE6 + .4byte _08008EE6 + .4byte _08008EE6 + .4byte _08008EE6 +_08008FA0: + ldrb r0, [r5] + strb r0, [r4] + adds r5, 0x1 + adds r4, 0x1 +_08008FA8: + ldrb r0, [r5] + strb r0, [r4] + adds r5, 0x1 + adds r4, 0x1 +_08008FB0: + ldrb r0, [r5] + strb r0, [r4] + adds r5, 0x1 + adds r4, 0x1 + b _08008EE6 +_08008FBA: + strb r2, [r4] + adds r4, 0x1 + b _08008EE6 +_08008FC0: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end ExpandTextCodes + + thumb_func_start sub_8008FCC +sub_8008FCC: @ 8008FCC + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, _08009004 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r4, sp, 0x4 + ldr r1, _08009008 + adds r0, r4, 0 + movs r2, 0x5 + bl memcpy + adds r0, r5, 0 + mov r1, sp +_08008FEE: + bl gf_strcpy + adds r5, r0, 0 +_08008FF4: + ldrb r0, [r6] + adds r6, 0x1 + cmp r0, 0xFE + beq _0800900C + cmp r0, 0xFF + bne _08009012 + b _0800901E + .align 2, 0 +_08009004: .4byte 0x082ec80c +_08009008: .4byte 0x082ec810 +_0800900C: + adds r0, r5, 0 + adds r1, r4, 0 + b _08008FEE +_08009012: + strb r0, [r5] + adds r5, 0x1 + adds r0, 0x40 + strb r0, [r5] + adds r5, 0x1 + b _08008FF4 +_0800901E: + strb r0, [r5] + adds r0, r5, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8008FCC + + thumb_func_start sub_800902C +sub_800902C: @ 800902C + ldr r0, _08009030 + bx lr + .align 2, 0 +_08009030: .4byte 0x020223ac + thumb_func_end sub_800902C + + thumb_func_start sub_8009034 +sub_8009034: @ 8009034 + ldr r0, _0800903C + ldr r0, [r0] + bx lr + .align 2, 0 +_0800903C: .4byte 0x03005d90 + thumb_func_end sub_8009034 + + thumb_func_start sub_8009040 +sub_8009040: @ 8009040 + ldr r0, _08009044 + bx lr + .align 2, 0 +_08009044: .4byte 0x02021cc4 + thumb_func_end sub_8009040 + + thumb_func_start sub_8009048 +sub_8009048: @ 8009048 + ldr r0, _0800904C + bx lr + .align 2, 0 +_0800904C: .4byte 0x02021dc4 + thumb_func_end sub_8009048 + + thumb_func_start sub_8009050 +sub_8009050: @ 8009050 + ldr r0, _08009054 + bx lr + .align 2, 0 +_08009054: .4byte 0x02021ec4 + thumb_func_end sub_8009050 + + thumb_func_start sub_8009058 +sub_8009058: @ 8009058 + push {lr} + ldr r0, _08009068 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _08009070 + ldr r0, _0800906C + b _08009072 + .align 2, 0 +_08009068: .4byte 0x03005d90 +_0800906C: .4byte 0x085e821a +_08009070: + ldr r0, _08009078 +_08009072: + pop {r1} + bx r1 + .align 2, 0 +_08009078: .4byte 0x085e8219 + thumb_func_end sub_8009058 + + thumb_func_start sub_800907C +sub_800907C: @ 800907C + push {lr} + ldr r0, _0800908C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _08009094 + ldr r0, _08009090 + b _08009096 + .align 2, 0 +_0800908C: .4byte 0x03005d90 +_08009090: .4byte 0x085e8258 +_08009094: + ldr r0, _0800909C +_08009096: + pop {r1} + bx r1 + .align 2, 0 +_0800909C: .4byte 0x085e8260 + thumb_func_end sub_800907C + + thumb_func_start sub_80090A0 +sub_80090A0: @ 80090A0 + ldr r0, _080090A4 + bx lr + .align 2, 0 +_080090A4: .4byte 0x085e8229 + thumb_func_end sub_80090A0 + + thumb_func_start sub_80090A8 +sub_80090A8: @ 80090A8 + ldr r0, _080090AC + bx lr + .align 2, 0 +_080090AC: .4byte 0x085e8231 + thumb_func_end sub_80090A8 + + thumb_func_start sub_80090B0 +sub_80090B0: @ 80090B0 + ldr r0, _080090B4 + bx lr + .align 2, 0 +_080090B4: .4byte 0x085e8236 + thumb_func_end sub_80090B0 + + thumb_func_start sub_80090B8 +sub_80090B8: @ 80090B8 + ldr r0, _080090BC + bx lr + .align 2, 0 +_080090BC: .4byte 0x085e823c + thumb_func_end sub_80090B8 + + thumb_func_start sub_80090C0 +sub_80090C0: @ 80090C0 + ldr r0, _080090C4 + bx lr + .align 2, 0 +_080090C4: .4byte 0x085e8243 + thumb_func_end sub_80090C0 + + thumb_func_start sub_80090C8 +sub_80090C8: @ 80090C8 + ldr r0, _080090CC + bx lr + .align 2, 0 +_080090CC: .4byte 0x085e8249 + thumb_func_end sub_80090C8 + + thumb_func_start sub_80090D0 +sub_80090D0: @ 80090D0 + ldr r0, _080090D4 + bx lr + .align 2, 0 +_080090D4: .4byte 0x085e8250 + thumb_func_end sub_80090D0 + + thumb_func_start get_fcode_buffer +get_fcode_buffer: @ 80090D8 + push {lr} + cmp r0, 0xD + bhi _080090F0 + ldr r1, _080090EC + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + b _080090F2 + .align 2, 0 +_080090EC: .4byte 0x082ec818 +_080090F0: + ldr r0, _080090F8 +_080090F2: + pop {r1} + bx r1 + .align 2, 0 +_080090F8: .4byte 0x085e8218 + thumb_func_end get_fcode_buffer + + thumb_func_start sub_80090FC +sub_80090FC: @ 80090FC + push {lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + cmp r0, r2 + bcs _0800911C +_0800910E: + strb r1, [r3] + adds r3, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r2 + bcc _0800910E +_0800911C: + movs r0, 0xFF + strb r0, [r3] + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_80090FC + + thumb_func_start sub_8009128 +sub_8009128: @ 8009128 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r3, 16 + b _08009148 +_08009138: + strb r1, [r4] + adds r5, 0x1 + adds r4, 0x1 + cmp r3, 0 + beq _08009148 + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 +_08009148: + ldrb r1, [r5] + adds r0, r1, 0 + cmp r0, 0xFF + bne _08009138 + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _08009178 + cmp r3, r0 + beq _0800916C + adds r1, r0, 0 +_0800915E: + strb r2, [r4] + adds r4, 0x1 + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bne _0800915E +_0800916C: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08009178: .4byte 0x0000ffff + thumb_func_end sub_8009128 + + thumb_func_start sub_800917C +sub_800917C: @ 800917C + push {lr} + lsls r2, r1, 16 + lsrs r2, 16 + movs r1, 0xFF + bl sub_80090FC + pop {r1} + bx r1 + thumb_func_end sub_800917C + + thumb_func_start sub_800918C +sub_800918C: @ 800918C + push {r4,r5,lr} + adds r4, r0, 0 + adds r3, r1, 0 + subs r2, 0x1 + movs r5, 0x1 + negs r5, r5 + b _080091B2 +_0800919A: + strb r0, [r4] + adds r3, 0x1 + adds r4, 0x1 + subs r0, r3, 0x1 + ldrb r0, [r0] + cmp r0, 0xF9 + bne _080091B0 + ldrb r0, [r3] + strb r0, [r4] + adds r3, 0x1 + adds r4, 0x1 +_080091B0: + subs r2, 0x1 +_080091B2: + cmp r2, r5 + beq _080091BE + ldrb r0, [r3] + adds r1, r0, 0 + cmp r1, 0xFF + bne _0800919A +_080091BE: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800918C + + thumb_func_start sub_80091CC +sub_80091CC: @ 80091CC + push {lr} + adds r2, r0, 0 + movs r3, 0 + b _080091DE +_080091D4: + cmp r1, 0xF9 + bne _080091DA + adds r2, 0x1 +_080091DA: + adds r2, 0x1 + adds r3, 0x1 +_080091DE: + ldrb r1, [r2] + adds r0, r1, 0 + cmp r0, 0xFF + bne _080091D4 + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_80091CC + + thumb_func_start sub_80091EC +sub_80091EC: @ 80091EC + push {lr} + adds r3, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xFC + strb r0, [r3] + adds r3, 0x1 + cmp r1, 0x1 + beq _0800920E + cmp r1, 0x1 + bcc _08009208 + cmp r1, 0x2 + beq _08009214 + b _08009218 +_08009208: + movs r0, 0x1 + strb r0, [r3] + b _08009216 +_0800920E: + movs r0, 0x3 + strb r0, [r3] + b _08009216 +_08009214: + strb r1, [r3] +_08009216: + adds r3, 0x1 +_08009218: + strb r2, [r3] + adds r3, 0x1 + movs r0, 0xFF + strb r0, [r3] + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_80091EC + + thumb_func_start sub_8009228 +sub_8009228: @ 8009228 + push {lr} + adds r2, r0, 0 + b _0800923E +_0800922E: + adds r0, r1, 0 + cmp r0, 0xA0 + bhi _0800923C + cmp r0, 0 + beq _0800923C + movs r0, 0x1 + b _08009248 +_0800923C: + adds r2, 0x1 +_0800923E: + ldrb r1, [r2] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0800922E + movs r0, 0 +_08009248: + pop {r1} + bx r1 + thumb_func_end sub_8009228 + + thumb_func_start sub_800924C +sub_800924C: @ 800924C + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + movs r1, 0 + b _08009268 +_08009256: + adds r0, r2, 0 + cmp r0, 0xA0 + bhi _08009264 + cmp r0, 0 + beq _08009264 + movs r0, 0x1 + b _08009276 +_08009264: + adds r3, 0x1 + adds r1, 0x1 +_08009268: + ldrb r2, [r3] + adds r0, r2, 0 + cmp r0, 0xFF + beq _08009274 + cmp r1, r4 + blt _08009256 +_08009274: + movs r0, 0 +_08009276: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800924C + + thumb_func_start sub_800927C +sub_800927C: @ 800927C + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + cmp r1, 0x18 + bhi _0800928E + ldr r0, _08009294 + adds r0, r1, r0 + ldrb r0, [r0] +_0800928E: + pop {r1} + bx r1 + .align 2, 0 +_08009294: .4byte 0x082ec850 + thumb_func_end sub_800927C + + thumb_func_start sub_8009298 +sub_8009298: @ 8009298 + push {r4,lr} + adds r4, r0, 0 + b _080092AC +_0800929E: + adds r4, 0x1 + ldrb r0, [r4] + bl sub_800927C + lsls r0, 24 + lsrs r0, 24 + adds r4, r0 +_080092AC: + ldrb r0, [r4] + cmp r0, 0xFC + beq _0800929E + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8009298 + + thumb_func_start sub_80092BC +sub_80092BC: @ 80092BC + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r6, 0 + b _080092DE +_080092C6: + cmp r1, r0 + bcs _080092D4 + movs r6, 0x1 + negs r6, r6 + cmp r0, 0xFF + bne _080092D4 + movs r6, 0x1 +_080092D4: + ldrb r0, [r4] + cmp r0, 0xFF + beq _080092FE + adds r4, 0x1 + adds r5, 0x1 +_080092DE: + adds r0, r4, 0 + bl sub_8009298 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8009298 + adds r5, r0, 0 + ldrb r1, [r4] + ldrb r0, [r5] + cmp r1, r0 + bls _080092C6 + movs r6, 0x1 + cmp r1, 0xFF + bne _080092FE + subs r6, 0x2 +_080092FE: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80092BC + + thumb_func_start sub_8009308 +sub_8009308: @ 8009308 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + bne _08009368 + bl sub_8009370 + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r2, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + adds r1, r4, r1 + movs r0, 0xFC + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r4, r3 + movs r0, 0x16 + strb r0, [r3] + adds r0, r2, 0x1 + lsls r0, 24 + adds r2, r4, r2 + movs r1, 0xFF + strb r1, [r2] + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + b _0800935A +_08009350: + adds r1, r2, r4 + ldrb r0, [r1] + strb r0, [r1, 0x2] + subs r0, r2, 0x1 + lsls r0, 24 +_0800935A: + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _08009350 + movs r0, 0xFC + strb r0, [r4] + movs r0, 0x15 + strb r0, [r4, 0x1] +_08009368: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8009308 + + thumb_func_start sub_8009370 +sub_8009370: @ 8009370 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _080093C0 +_0800937E: + adds r0, r5, r4 + ldrb r0, [r0] + cmp r0, 0xFC + bne _080093A0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, r4 + ldrb r0, [r0] + bl sub_800927C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + b _080093B8 +_080093A0: + adds r2, r6, 0 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, r5, r2 + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r1, r5, r1 + ldrb r0, [r1] + strb r0, [r2] +_080093B8: + adds r0, r5, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0800937E +_080093C0: + adds r1, r5, r6 + movs r0, 0xFF + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8009370 + + thumb_func_start sub_80093CC +sub_80093CC: @ 80093CC + push {lr} + bl sub_800B488 + bl sub_800E700 + bl sub_800BEC0 + ldr r1, _080093F0 + cmp r0, r1 + beq _080093F4 + bl sub_800B4A4 + bl sub_80097E8 + bl restore_serial_timer3_irq_handlers + movs r0, 0 + b _080093FE + .align 2, 0 +_080093F0: .4byte 0x00008001 +_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, _08009470 + lsls r1, r5, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r3, _08009474 + ldr r0, _08009478 + 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, _0800947C + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + ldr r0, _08009480 + 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 + .align 2, 0 +_08009470: .4byte 0x082ecf20 +_08009474: .4byte 0x040000d4 +_08009478: .4byte 0x082ecf40 +_0800947C: .4byte 0x80000110 +_08009480: .4byte 0x03003130 +_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 lcd_io_set + b _080094C0 +_0800949E: + lsls r1, r6, 8 + movs r0, 0x1 + orrs r1, r0 + lsls r0, r7, 2 + orrs r1, r0 + movs r0, 0xC + bl lcd_io_set + b _080094C0 +_080094B0: + lsls r1, r6, 8 + movs r0, 0x1 + orrs r1, r0 + lsls r0, r7, 2 + orrs r1, r0 + movs r0, 0xE + bl lcd_io_set +_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 lcd_io_set + adds r4, 0x12 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl lcd_io_set + 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, _08009558 + mov r2, r8 + lsls r1, r2, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r2, _0800955C + ldr r0, _08009560 + str r0, [r2] + lsls r0, r5, 14 + movs r1, 0xC0 + lsls r1, 19 + adds r0, r1 + str r0, [r2, 0x4] + ldr r0, _08009564 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, _08009568 + str r4, [r0] + mov r1, r8 + str r1, [r0, 0x4] + movs r1, 0 + str r1, [r0, 0x8] + ldr r0, _0800956C + adds r6, r0 + ldrb r0, [r6] + lsls r4, 8 + lsls r5, 2 + orrs r4, r5 + adds r1, r4, 0 + bl lcd_io_set + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08009558: .4byte 0x082ecf20 +_0800955C: .4byte 0x040000d4 +_08009560: .4byte 0x082ecf40 +_08009564: .4byte 0x80000110 +_08009568: .4byte 0x03003130 +_0800956C: .4byte 0x082ed1d0 + thumb_func_end sub_80094EC + + thumb_func_start sub_8009570 +sub_8009570: @ 8009570 + push {r4,lr} + sub sp, 0x4 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + ldr r0, _08009604 + bl SetVBlankCallback + bl sub_800A2E0 + ldr r1, _08009608 + ldr r2, _0800960C + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009734 + ldr r0, _08009610 + ldrh r0, [r0, 0x24] + bl SeedRng + movs r4, 0 +_080095A0: + bl GenerateRandomNumber + ldr r1, _08009614 + 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 lcd_io_set + ldr r0, _08009618 + movs r1, 0 + bl AddTask + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + ldr r0, _0800961C + str r4, [r0] + bl sub_8009638 + ldr r0, _08009620 + movs r1, 0 + bl AddTask + ldr r0, _08009624 + bl set_callback2 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08009604: .4byte sub_80096BC + 1 +_08009608: .4byte 0x020229c6 +_0800960C: .4byte 0x00001111 +_08009610: .4byte 0x030022c0 +_08009614: .4byte 0x03005d90 +_08009618: .4byte sub_8009404 + 1 +_0800961C: .4byte 0x03000d60 +_08009620: .4byte task00_link_test + 1 +_08009624: .4byte c2_08009A8C + 1 + thumb_func_end sub_8009570 + + thumb_func_start sub_8009628 +sub_8009628: @ 8009628 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08009634 + strh r0, [r1, 0x18] + bx lr + .align 2, 0 +_08009634: .4byte 0x020229cc + thumb_func_end sub_8009628 + + thumb_func_start sub_8009638 +sub_8009638: @ 8009638 + push {r4,r5,lr} + ldr r5, _080096A4 + ldr r4, _080096A8 + 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 gf_strcpy + ldr r0, [r4] + ldrb r0, [r0, 0x8] + strb r0, [r5, 0x13] + ldr r0, _080096AC + ldrh r0, [r0] + str r0, [r5, 0x14] + ldr r0, _080096B0 + ldrb r0, [r0] + strh r0, [r5, 0x1A] + ldr r0, _080096B4 + 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, _080096B8 + bl flag_check + 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 + .align 2, 0 +_080096A4: .4byte 0x020229cc +_080096A8: .4byte 0x03005d90 +_080096AC: .4byte 0x020229c6 +_080096B0: .4byte 0x082e9531 +_080096B4: .4byte 0x082e9530 +_080096B8: .4byte 0x0000087f + thumb_func_end sub_8009638 + + thumb_func_start sub_80096BC +sub_80096BC: @ 80096BC + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + 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, _080096F0 + ldr r1, _080096F4 + ldr r2, _080096F8 + 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 + .align 2, 0 +_080096F0: .4byte 0x020229c4 +_080096F4: .4byte 0x03003110 +_080096F8: .4byte 0x0000efff + thumb_func_end sub_80096D0 + + thumb_func_start task02_080097CC +task02_080097CC: @ 80096FC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0800972C + 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, _08009730 + movs r0, 0x1 + strb r0, [r1] + adds r0, r2, 0 + bl remove_task +_08009726: + pop {r0} + bx r0 + .align 2, 0 +_0800972C: .4byte 0x03005e00 +_08009730: .4byte 0x03003144 + thumb_func_end task02_080097CC + + thumb_func_start sub_8009734 +sub_8009734: @ 8009734 + push {r4-r6,lr} + ldr r0, _0800977C + ldrb r4, [r0] + cmp r4, 0 + bne _080097A8 + bl sub_800B628 + bl sub_80096D0 + ldr r1, _08009780 + ldr r0, _08009784 + str r0, [r1] + ldr r0, _08009788 + strb r4, [r0] + ldr r0, _0800978C + strb r4, [r0] + ldr r0, _08009790 + strb r4, [r0] + bl sub_800A5B4 + bl sub_800A2E0 + ldr r0, _08009794 + str r4, [r0] + ldr r0, _08009798 + strb r4, [r0] + ldr r0, _0800979C + strb r4, [r0] + ldr r0, _080097A0 + strh r4, [r0] + ldr r0, _080097A4 + movs r1, 0x2 + bl AddTask + b _080097AC + .align 2, 0 +_0800977C: .4byte 0x030030fc +_08009780: .4byte 0x03003140 +_08009784: .4byte sub_800A824 + 1 +_08009788: .4byte 0x03002748 +_0800978C: .4byte 0x0300306c +_08009790: .4byte 0x030030f8 +_08009794: .4byte 0x03000d54 +_08009798: .4byte 0x030030e8 +_0800979C: .4byte 0x030030e4 +_080097A0: .4byte 0x030030f4 +_080097A4: .4byte task02_080097CC + 1 +_080097A8: + bl sub_800E700 +_080097AC: + ldr r1, _080097D8 + movs r0, 0 + strb r0, [r1] + movs r1, 0 + ldr r6, _080097DC + movs r2, 0 + movs r5, 0x1 + ldr r4, _080097E0 + ldr r3, _080097E4 +_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 + .align 2, 0 +_080097D8: .4byte 0x03003124 +_080097DC: .4byte 0x03003078 +_080097E0: .4byte 0x030030f0 +_080097E4: .4byte 0x030030ec + thumb_func_end sub_8009734 + + thumb_func_start sub_80097E8 +sub_80097E8: @ 80097E8 + push {r4,lr} + ldr r0, _0800980C + movs r4, 0 + strb r4, [r0] + ldr r0, _08009810 + ldrb r0, [r0] + cmp r0, 0 + beq _080097FC + bl sub_800EDD4 +_080097FC: + ldr r0, _08009814 + strb r4, [r0] + bl sub_800B53C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800980C: .4byte 0x03003124 +_08009810: .4byte 0x030030fc +_08009814: .4byte 0x020229c4 + 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, _080098DC + ldr r4, _080098E0 + 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, _080098E4 +_08009840: + ldr r0, _080098E8 + 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, _080098E4 + mov r9, r0 + ldr r1, _080098EC + 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, _080098F0 + 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, _080098F4 + 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, _080098F8 + strb r6, [r0] + ldr r0, _080098FC + 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 + .align 2, 0 +_080098DC: .4byte 0x03000d64 +_080098E0: .4byte 0x03000d10 +_080098E4: .4byte 0x03000d20 +_080098E8: .4byte 0x03000d68 +_080098EC: .4byte 0x00000342 +_080098F0: .4byte 0x020223c4 +_080098F4: .4byte 0x03003148 +_080098F8: .4byte 0x020223bc +_080098FC: .4byte 0x020223bd + thumb_func_end sub_8009818 + + thumb_func_start sub_8009900 +sub_8009900: @ 8009900 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, _080099A0 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08009916 + ldr r1, _080099A4 + 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, _080099A8 + ldr r1, _080099AC + 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 sub_80A1AD4 +_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, _080099B0 + ldrb r0, [r0] + cmp r0, 0 + beq _08009996 + ldr r2, [r4, 0x24] + ldr r0, _080099B4 + ldrb r1, [r0] + ldr r0, _080099B8 + 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 + .align 2, 0 +_080099A0: .4byte 0x030022c0 +_080099A4: .4byte 0x03003144 +_080099A8: .4byte 0x02004000 +_080099AC: .4byte 0x00002004 +_080099B0: .4byte 0x020223bc +_080099B4: .4byte 0x03002748 +_080099B8: .4byte 0x03003140 + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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, _080099F0 + ldrb r0, [r0] + cmp r0, 0 + bne _080099F4 + movs r0, 0 + b _08009A3C + .align 2, 0 +_080099F0: .4byte 0x020229c4 +_080099F4: + movs r1, 0 + ldr r5, _08009A44 + ldr r3, _08009A48 + 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, _08009A4C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08009A38 + ldr r0, _08009A50 + ldr r0, [r0] + lsls r0, 26 + lsrs r0, 30 + bl sub_8009AA0 + ldr r0, _08009A54 + ldr r0, [r0] + cmp r0, 0 + beq _08009A34 + bl _call_via_r0 +_08009A34: + bl sub_800AEB4 +_08009A38: + ldr r0, _08009A4C + ldrh r0, [r0] +_08009A3C: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08009A44: .4byte 0x03003084 +_08009A48: .4byte 0x03003110 +_08009A4C: .4byte 0x030030e0 +_08009A50: .4byte 0x04000128 +_08009A54: .4byte 0x03003140 + 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, _08009A6C + adds r0, r1 + strb r5, [r0] + movs r4, 0 + adds r6, r1, 0 + b _08009A78 + .align 2, 0 +_08009A6C: .4byte 0x03003078 +_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, _08009A9C + ldrb r0, [r1] + cmp r0, 0 + bne _08009A94 + movs r0, 0x1 + strb r0, [r1] +_08009A94: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08009A9C: .4byte 0x03003124 + 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, _08009AF8 + lsls r1, r6, 1 + adds r3, r1, r0 + movs r0, 0 + strh r0, [r3] + lsls r4, r6, 4 + ldr r5, _08009AFC + 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, _08009B00 + cmp r1, r0 + bne _08009AD6 + b _08009D20 +_08009AD6: + cmp r1, r0 + bgt _08009B24 + ldr r0, _08009B04 + cmp r1, r0 + bne _08009AE2 + b _08009D64 +_08009AE2: + cmp r1, r0 + bgt _08009B10 + ldr r0, _08009B08 + cmp r1, r0 + beq _08009B68 + ldr r0, _08009B0C + cmp r1, r0 + bne _08009AF4 + b _08009D28 +_08009AF4: + b _08009D6E + .align 2, 0 +_08009AF8: .4byte 0x03003020 +_08009AFC: .4byte 0x03003090 +_08009B00: .4byte 0x00005fff +_08009B04: .4byte 0x00004444 +_08009B08: .4byte 0x00002222 +_08009B0C: .4byte 0x00002ffe +_08009B10: + ldr r0, _08009B20 + cmp r1, r0 + beq _08009BB8 + adds r0, 0x11 + cmp r1, r0 + beq _08009BB8 + b _08009D6E + .align 2, 0 +_08009B20: .4byte 0x00005555 +_08009B24: + ldr r0, _08009B40 + cmp r1, r0 + beq _08009BC4 + cmp r1, r0 + bgt _08009B4C + ldr r0, _08009B44 + cmp r1, r0 + beq _08009BF0 + ldr r0, _08009B48 + cmp r1, r0 + bne _08009B3C + b _08009D38 +_08009B3C: + b _08009D6E + .align 2, 0 +_08009B40: .4byte 0x0000bbbb +_08009B44: .4byte 0x00008888 +_08009B48: .4byte 0x0000aaaa +_08009B4C: + ldr r0, _08009B60 + cmp r1, r0 + bne _08009B54 + b _08009D64 +_08009B54: + ldr r0, _08009B64 + cmp r1, r0 + bne _08009B5C + b _08009D3E +_08009B5C: + b _08009D6E + .align 2, 0 +_08009B60: .4byte 0x0000cafe +_08009B64: .4byte 0x0000cccc +_08009B68: + bl sub_8009638 + ldr r0, _08009BAC + adds r2, r0, 0 + adds r2, 0x10 + ldr r1, _08009BB0 + 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, _08009BB4 + 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 + .align 2, 0 +_08009BAC: .4byte 0x03003030 +_08009BB0: .4byte 0x020229cc +_08009BB4: .4byte 0x082ed1d4 +_08009BB8: + ldr r1, _08009BC0 + movs r0, 0x1 + strb r0, [r1] + b _08009D6E + .align 2, 0 +_08009BC0: .4byte 0x030030e8 +_08009BC4: + mov r7, r12 + adds r1, r7, r6 + lsls r1, 2 + ldr r0, _08009BE8 + adds r1, r0 + movs r2, 0 + strh r2, [r1] + ldr r0, _08009BEC + adds r0, 0x2 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r1, 0x2] + ldr r0, _08009BEC + adds r0, 0x4 + adds r0, r4, r0 + ldrh r0, [r0] + strb r0, [r1, 0x9] + b _08009D6E + .align 2, 0 +_08009BE8: .4byte 0x03000d20 +_08009BEC: .4byte 0x03003090 +_08009BF0: + mov r3, r12 + adds r0, r3, r6 + lsls r0, 2 + ldr r5, _08009C34 + 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, _08009C38 + mov r8, r0 + movs r2, 0 + adds r5, r3, 0 + ldr r7, _08009C3C + 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 + .align 2, 0 +_08009C34: .4byte 0x03000d20 +_08009C38: .4byte 0x0201c000 +_08009C3C: .4byte 0x03003090 +_08009C40: + movs r2, 0 + ldr r1, _08009CF4 + mov r9, r1 + adds r7, r3, 0 + ldr r3, _08009CF8 + 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, _08009CFC + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08009D16 + lsls r1, r6, 8 + ldr r0, _08009CF4 + adds r1, r0 + mov r8, r1 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + ldr r1, _08009D00 + 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, _08009D04 + 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, _08009D08 + bl set_callback2 + b _08009D6E + .align 2, 0 +_08009CF4: .4byte 0x020223c4 +_08009CF8: .4byte 0x03003090 +_08009CFC: .4byte 0x03003078 +_08009D00: .4byte 0x020229e8 +_08009D04: .4byte 0x082ed1d4 +_08009D08: .4byte c2_800ACD4 + 1 +_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, _08009D24 + b _08009D2A + .align 2, 0 +_08009D24: .4byte 0x030030f0 +_08009D28: + ldr r0, _08009D34 +_08009D2A: + adds r0, r6, r0 + movs r1, 0x1 + strb r1, [r0] + b _08009D6E + .align 2, 0 +_08009D34: .4byte 0x030030ec +_08009D38: + bl sub_800A418 + b _08009D6E +_08009D3E: + ldr r3, _08009D5C + ldr r0, _08009D60 + 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 + .align 2, 0 +_08009D5C: .4byte 0x082ed1a8 +_08009D60: .4byte 0x03003090 +_08009D64: + ldr r0, _08009D8C + 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 + .align 2, 0 +_08009D8C: .4byte 0x03003090 + thumb_func_end sub_8009AA0 + + thumb_func_start sub_8009D90 +sub_8009D90: @ 8009D90 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _08009DBC + cmp r2, r0 + beq _08009E60 + cmp r2, r0 + bgt _08009DF0 + ldr r0, _08009DC0 + cmp r2, r0 + beq _08009E4C + cmp r2, r0 + bgt _08009DCC + ldr r0, _08009DC4 + cmp r2, r0 + beq _08009E38 + ldr r0, _08009DC8 +_08009DB2: + cmp r2, r0 + bne _08009DB8 + b _08009EE4 +_08009DB8: + b _08009F06 + .align 2, 0 +_08009DBC: .4byte 0x00006666 +_08009DC0: .4byte 0x00004444 +_08009DC4: .4byte 0x00002222 +_08009DC8: .4byte 0x00002ffe +_08009DCC: + ldr r0, _08009DDC + cmp r2, r0 + bne _08009DD4 + b _08009EE4 +_08009DD4: + cmp r2, r0 + bgt _08009DE0 + subs r0, 0x11 + b _08009DB2 + .align 2, 0 +_08009DDC: .4byte 0x00005566 +_08009DE0: + ldr r0, _08009DEC + cmp r2, r0 + bne _08009DE8 + b _08009ED0 +_08009DE8: + b _08009F06 + .align 2, 0 +_08009DEC: .4byte 0x00005fff +_08009DF0: + ldr r0, _08009E04 + cmp r2, r0 + beq _08009EA8 + cmp r2, r0 + bgt _08009E10 + ldr r0, _08009E08 + cmp r2, r0 + beq _08009E6C + ldr r0, _08009E0C + b _08009DB2 + .align 2, 0 +_08009E04: .4byte 0x0000aaab +_08009E08: .4byte 0x00007777 +_08009E0C: .4byte 0x0000aaaa +_08009E10: + ldr r0, _08009E24 + cmp r2, r0 + beq _08009EF0 + cmp r2, r0 + bgt _08009E2C + ldr r0, _08009E28 + cmp r2, r0 + beq _08009E8C + b _08009F06 + .align 2, 0 +_08009E24: .4byte 0x0000cafe +_08009E28: .4byte 0x0000bbbb +_08009E2C: + ldr r0, _08009E34 + cmp r2, r0 + beq _08009EBC + b _08009F06 + .align 2, 0 +_08009E34: .4byte 0x0000cccc +_08009E38: + ldr r0, _08009E44 + strh r2, [r0] + ldr r1, _08009E48 + ldrh r1, [r1] + b _08009F04 + .align 2, 0 +_08009E44: .4byte 0x03003110 +_08009E48: .4byte 0x020229c6 +_08009E4C: + ldr r0, _08009E58 + strh r2, [r0] + ldr r1, _08009E5C + ldrh r1, [r1, 0x2C] + b _08009F04 + .align 2, 0 +_08009E58: .4byte 0x03003110 +_08009E5C: .4byte 0x030022c0 +_08009E60: + ldr r0, _08009E68 + movs r1, 0 + b _08009F02 + .align 2, 0 +_08009E68: .4byte 0x03003110 +_08009E6C: + ldr r0, _08009E88 + 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 + .align 2, 0 +_08009E88: .4byte 0x03003110 +_08009E8C: + ldr r1, _08009EA0 + strh r2, [r1] + ldr r2, _08009EA4 + ldrh r0, [r2, 0x2] + strh r0, [r1, 0x2] + ldrb r0, [r2, 0x9] + adds r0, 0x80 + strh r0, [r1, 0x4] + b _08009F06 + .align 2, 0 +_08009EA0: .4byte 0x03003110 +_08009EA4: .4byte 0x03000d10 +_08009EA8: + ldr r0, _08009EB4 + strh r2, [r0] + ldr r1, _08009EB8 + ldrh r1, [r1] + b _08009F04 + .align 2, 0 +_08009EB4: .4byte 0x03003110 +_08009EB8: .4byte 0x0203ce7c +_08009EBC: + ldr r0, _08009EC8 + strh r2, [r0] + ldr r1, _08009ECC + ldrb r1, [r1] + b _08009F04 + .align 2, 0 +_08009EC8: .4byte 0x03003110 +_08009ECC: .4byte 0x03003150 +_08009ED0: + ldr r0, _08009EDC + strh r2, [r0] + ldr r1, _08009EE0 + ldrh r1, [r1] + b _08009F04 + .align 2, 0 +_08009EDC: .4byte 0x03003110 +_08009EE0: .4byte 0x030030f4 +_08009EE4: + ldr r0, _08009EEC + strh r2, [r0] + b _08009F06 + .align 2, 0 +_08009EEC: .4byte 0x03003110 +_08009EF0: + ldr r0, _08009F0C + ldrh r1, [r0] + cmp r1, 0 + beq _08009F06 + ldr r0, _08009F10 + ldrb r0, [r0] + cmp r0, 0 + bne _08009F06 + ldr r0, _08009F14 +_08009F02: + strh r2, [r0] +_08009F04: + strh r1, [r0, 0x2] +_08009F06: + pop {r0} + bx r0 + .align 2, 0 +_08009F0C: .4byte 0x03005da8 +_08009F10: .4byte 0x030022b4 +_08009F14: .4byte 0x03003110 + thumb_func_end sub_8009D90 + + thumb_func_start sub_8009F18 +sub_8009F18: @ 8009F18 + push {lr} + ldr r0, _08009F30 + ldrb r0, [r0] + cmp r0, 0 + beq _08009F26 + bl sub_800F804 +_08009F26: + ldr r1, _08009F34 + ldr r0, _08009F38 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08009F30: .4byte 0x030030fc +_08009F34: .4byte 0x03003140 +_08009F38: .4byte sub_8009F70 + 1 + thumb_func_end sub_8009F18 + + thumb_func_start sub_8009F3C +sub_8009F3C: @ 8009F3C + push {lr} + ldr r0, _08009F4C + ldrb r0, [r0] + cmp r0, 0 + beq _08009F50 + bl sub_800F7E4 + b _08009F6A + .align 2, 0 +_08009F4C: .4byte 0x030030fc +_08009F50: + ldr r0, _08009F60 + ldr r1, [r0] + ldr r0, _08009F64 + cmp r1, r0 + beq _08009F68 + movs r0, 0 + b _08009F6A + .align 2, 0 +_08009F60: .4byte 0x03003140 +_08009F64: .4byte sub_8009F70 + 1 +_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, _08009F84 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08009F80 + ldr r0, _08009F88 + bl sub_8009D90 +_08009F80: + pop {r0} + bx r0 + .align 2, 0 +_08009F84: .4byte 0x03003124 +_08009F88: .4byte 0x0000cafe + thumb_func_end sub_8009F70 + + thumb_func_start sub_8009F8C +sub_8009F8C: @ 8009F8C + push {lr} + ldr r0, _08009F9C + ldrb r1, [r0] + cmp r1, 0 + beq _08009FA0 + bl Rfu_set_zero + b _08009FA4 + .align 2, 0 +_08009F9C: .4byte 0x030030fc +_08009FA0: + ldr r0, _08009FA8 + str r1, [r0] +_08009FA4: + pop {r0} + bx r0 + .align 2, 0 +_08009FA8: .4byte 0x03003140 + thumb_func_end sub_8009F8C + + thumb_func_start sub_8009FAC +sub_8009FAC: @ 8009FAC + push {lr} + ldr r0, _08009FBC + ldrb r1, [r0] + cmp r1, 0 + beq _08009FC0 + bl Rfu_set_zero + b _08009FC4 + .align 2, 0 +_08009FBC: .4byte 0x030030fc +_08009FC0: + ldr r0, _08009FC8 + str r1, [r0] +_08009FC4: + pop {r0} + bx r0 + .align 2, 0 +_08009FC8: .4byte 0x03003140 + thumb_func_end sub_8009FAC + + thumb_func_start sub_8009FCC +sub_8009FCC: @ 8009FCC + push {lr} + ldr r0, _08009FE4 + ldrb r0, [r0] + cmp r0, 0 + bne _08009FEC + ldr r0, _08009FE8 + ldr r0, [r0] + movs r1, 0x1C + ands r0, r1 + lsrs r0, 2 + b _08009FF4 + .align 2, 0 +_08009FE4: .4byte 0x030030fc +_08009FE8: .4byte 0x030030e0 +_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, _0800A024 +_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 + .align 2, 0 +_0800A024: .4byte 0x020229e8 +_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, _0800A0A0 + 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 + .align 2, 0 +_0800A0A0: .4byte 0x020229e8 +_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, _0800A0C0 + movs r1, 0 + str r1, [r0] + ldr r0, _0800A0C4 + strh r1, [r0] + bl sub_8009734 + pop {r0} + bx r0 + .align 2, 0 +_0800A0C0: .4byte 0x03000d5c +_0800A0C4: .4byte 0x020229c8 + 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, _0800A0F4 + 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, _0800A0F8 + movs r0, 0x6 + str r0, [r1] + b _0800A22E + .align 2, 0 +_0800A0F4: .4byte 0x03003124 +_0800A0F8: .4byte 0x03000d5c +_0800A0FC: + bl sub_8009FCC + lsls r0, 24 + cmp r0, 0 + bne _0800A10E + ldr r0, _0800A118 + strb r4, [r0] + bl sub_80097E8 +_0800A10E: + movs r6, 0 + ldr r4, _0800A11C + movs r5, 0 + b _0800A134 + .align 2, 0 +_0800A118: .4byte 0x0300306c +_0800A11C: .4byte 0x020229e8 +_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, _0800A16C + ldr r1, [r0, 0x14] + ldr r0, _0800A170 + 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, _0800A174 + b _0800A22C + .align 2, 0 +_0800A16C: .4byte 0x020229e8 +_0800A170: .4byte 0x00001133 +_0800A174: .4byte 0x03000d5c +_0800A178: + cmp r0, 0x2 + beq _0800A190 + ldr r3, _0800A180 + b _0800A22C + .align 2, 0 +_0800A180: .4byte 0x03000d5c +_0800A184: + ldr r1, _0800A18C + movs r0, 0x4 + b _0800A1A0 + .align 2, 0 +_0800A18C: .4byte 0x03000d5c +_0800A190: + ldr r1, _0800A198 + movs r0, 0x5 + b _0800A1A0 + .align 2, 0 +_0800A198: .4byte 0x03000d5c +_0800A19C: + ldr r1, _0800A1A8 + movs r0, 0x1 +_0800A1A0: + str r0, [r1] + adds r3, r1, 0 + b _0800A22C + .align 2, 0 +_0800A1A8: .4byte 0x03000d5c +_0800A1AC: + ldr r6, _0800A200 + movs r0, 0x3 + str r0, [r6] + ldr r4, _0800A204 + 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, _0800A208 + cmp r5, r2 + bne _0800A1EA + ldr r0, _0800A20C + cmp r1, r0 + beq _0800A1F6 +_0800A1EA: + ldr r0, _0800A20C + adds r3, r6, 0 + cmp r5, r0 + bne _0800A22C + cmp r1, r2 + bne _0800A22C +_0800A1F6: + ldr r1, _0800A210 + movs r0, 0x3 + strh r0, [r1] + ldr r3, _0800A200 + b _0800A22C + .align 2, 0 +_0800A200: .4byte 0x03000d5c +_0800A204: .4byte 0x020229e8 +_0800A208: .4byte 0x00002266 +_0800A20C: .4byte 0x00002277 +_0800A210: .4byte 0x020375e2 +_0800A214: + ldr r0, _0800A234 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x96 + lsls r0, 18 + ldr r3, _0800A238 + cmp r1, r0 + bls _0800A22C + movs r0, 0x2 + str r0, [r3] +_0800A22C: + ldrb r0, [r3] +_0800A22E: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800A234: .4byte 0x020229c8 +_0800A238: .4byte 0x03000d5c + 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, _0800A248 + b _0800A26C + .align 2, 0 +_0800A248: .4byte 0x020229e8 +_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, _0800A28C + str r2, [r0] + b _0800A298 + .align 2, 0 +_0800A28C: .4byte 0x03000d5c +_0800A290: + movs r2, 0 + ldr r1, _0800A2A0 + movs r0, 0x3 + str r0, [r1] +_0800A298: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0800A2A0: .4byte 0x03000d5c + thumb_func_end sub_800A23C + + thumb_func_start sub_800A2A4 +sub_800A2A4: @ 800A2A4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0800A2B8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, 0x4 + adds r1, r2 + ldr r0, [r1] + bx lr + .align 2, 0 +_0800A2B8: .4byte 0x020229e8 + thumb_func_end sub_800A2A4 + + thumb_func_start sub_800A2BC +sub_800A2BC: @ 800A2BC + push {r4,r5,lr} + ldr r5, _0800A2DC + 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 + .align 2, 0 +_0800A2DC: .4byte 0x020229e8 + thumb_func_end sub_800A2BC + + thumb_func_start sub_800A2E0 +sub_800A2E0: @ 800A2E0 + ldr r1, _0800A2F0 + movs r0, 0 + strb r0, [r1, 0x8] + strh r0, [r1] + strh r0, [r1, 0x2] + str r0, [r1, 0x4] + bx lr + .align 2, 0 +_0800A2F0: .4byte 0x03000d10 + 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, _0800A308 + ldrb r5, [r4, 0x8] + cmp r5, 0 + beq _0800A30C + movs r0, 0 + b _0800A34A + .align 2, 0 +_0800A308: .4byte 0x03000d10 +_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, _0800A350 + 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, _0800A354 + bl sub_8009D90 + ldr r1, _0800A358 + ldr r0, _0800A35C + str r0, [r1] + ldr r1, _0800A360 + movs r0, 0 + str r0, [r1] + movs r0, 0x1 +_0800A34A: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800A350: .4byte 0x020228c4 +_0800A354: .4byte 0x0000bbbb +_0800A358: .4byte 0x03003140 +_0800A35C: .4byte sub_800A364 + 1 +_0800A360: .4byte 0x03000d50 + thumb_func_end sub_800A2F4 + + thumb_func_start sub_800A364 +sub_800A364: @ 800A364 + push {lr} + ldr r1, _0800A37C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x2 + bls _0800A378 + ldr r1, _0800A380 + ldr r0, _0800A384 + str r0, [r1] +_0800A378: + pop {r0} + bx r0 + .align 2, 0 +_0800A37C: .4byte 0x03000d50 +_0800A380: .4byte 0x03003140 +_0800A384: .4byte sub_800A388 + 1 + thumb_func_end sub_800A364 + + thumb_func_start sub_800A388 +sub_800A388: @ 800A388 + push {r4-r6,lr} + ldr r0, _0800A3D8 + ldr r5, [r0, 0x4] + ldr r2, _0800A3DC + ldr r1, _0800A3E0 + 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, _0800A3E4 + ldr r0, _0800A3E8 + str r0, [r1] +_0800A3D0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800A3D8: .4byte 0x03000d10 +_0800A3DC: .4byte 0x03003110 +_0800A3E0: .4byte 0x00008888 +_0800A3E4: .4byte 0x03003140 +_0800A3E8: .4byte sub_800A3EC + 1 + thumb_func_end sub_800A388 + + thumb_func_start sub_800A3EC +sub_800A3EC: @ 800A3EC + ldr r1, _0800A3F4 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_0800A3F4: .4byte 0x03003140 + thumb_func_end sub_800A3EC + + thumb_func_start sub_800A3F8 +sub_800A3F8: @ 800A3F8 + push {lr} + bl link_get_multiplayer_id + ldr r0, _0800A410 + bl sub_8009D90 + ldr r1, _0800A414 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0800A410: .4byte 0x00004444 +_0800A414: .4byte 0x020223c0 + thumb_func_end sub_800A3F8 + + thumb_func_start sub_800A418 +sub_800A418: @ 800A418 + push {lr} + ldr r1, _0800A430 + movs r0, 0 + str r0, [r1] + ldr r0, _0800A434 + ldrb r0, [r0] + cmp r0, 0 + beq _0800A438 + bl sub_800F850 + b _0800A43E + .align 2, 0 +_0800A430: .4byte 0x020223c0 +_0800A434: .4byte 0x030030fc +_0800A438: + ldr r1, _0800A444 + ldr r0, _0800A448 + str r0, [r1] +_0800A43E: + pop {r0} + bx r0 + .align 2, 0 +_0800A444: .4byte 0x03003140 +_0800A448: .4byte sub_800A3F8 + 1 + thumb_func_end sub_800A418 + + thumb_func_start sub_800A44C +sub_800A44C: @ 800A44C + ldr r0, _0800A454 + ldr r0, [r0] + bx lr + .align 2, 0 +_0800A454: .4byte 0x020223c0 + thumb_func_end sub_800A44C + + thumb_func_start sub_800A458 +sub_800A458: @ 800A458 + push {lr} + ldr r0, _0800A464 + bl sub_8009D90 + pop {r0} + bx r0 + .align 2, 0 +_0800A464: .4byte 0x0000aaaa + thumb_func_end sub_800A458 + + thumb_func_start link_get_multiplayer_id +link_get_multiplayer_id: @ 800A468 + push {lr} + ldr r0, _0800A47C + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800A484 + ldr r0, _0800A480 + ldr r0, [r0] + lsls r0, 26 + lsrs r0, 30 + b _0800A48C + .align 2, 0 +_0800A47C: .4byte 0x030030fc +_0800A480: .4byte 0x04000128 +_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, _0800A4C4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800A4C8 + adds r0, r3, 0 + bl sub_800A2F4 + b _0800A4CE + .align 2, 0 +_0800A4C4: .4byte 0x030030fc +_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, _0800A4F4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A4F8 + adds r0, r1, 0 + bl sub_8010100 + lsls r0, 24 + lsrs r0, 24 + b _0800A514 + .align 2, 0 +_0800A4F4: .4byte 0x030030fc +_0800A4F8: + ldr r0, _0800A504 + ldr r0, [r0] + cmp r0, 0 + beq _0800A508 + movs r0, 0 + b _0800A514 + .align 2, 0 +_0800A504: .4byte 0x03003140 +_0800A508: + ldr r0, _0800A518 + strb r2, [r0] + ldr r0, _0800A51C + bl sub_8009D90 + movs r0, 0x1 +_0800A514: + pop {r1} + bx r1 + .align 2, 0 +_0800A518: .4byte 0x03003150 +_0800A51C: .4byte 0x0000cccc + thumb_func_end sub_800A4D8 + + thumb_func_start sub_800A520 +sub_800A520: @ 800A520 + push {lr} + ldr r0, _0800A534 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A538 + bl sub_8010500 + lsls r0, 24 + lsrs r0, 24 + b _0800A546 + .align 2, 0 +_0800A534: .4byte 0x030030fc +_0800A538: + movs r1, 0 + ldr r0, _0800A54C + ldr r0, [r0] + cmp r0, 0 + bne _0800A544 + movs r1, 0x1 +_0800A544: + adds r0, r1, 0 +_0800A546: + pop {r1} + bx r1 + .align 2, 0 +_0800A54C: .4byte 0x03003140 + thumb_func_end sub_800A520 + + thumb_func_start sub_800A550 +sub_800A550: @ 800A550 + push {lr} + ldr r0, _0800A574 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800A57C + ldr r2, _0800A578 + 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 + .align 2, 0 +_0800A574: .4byte 0x030030fc +_0800A578: .4byte 0x0300307c +_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, _0800A5A0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A5A4 + adds r0, r1, 0 + bl sub_800F6FC + b _0800A5AC + .align 2, 0 +_0800A5A0: .4byte 0x030030fc +_0800A5A4: + ldr r0, _0800A5B0 + adds r0, r1, r0 + movs r1, 0x1 + strb r1, [r0] +_0800A5AC: + pop {r0} + bx r0 + .align 2, 0 +_0800A5B0: .4byte 0x0300307c + thumb_func_end sub_800A588 + + thumb_func_start sub_800A5B4 +sub_800A5B4: @ 800A5B4 + push {r4,lr} + ldr r0, _0800A5D0 + 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 + .align 2, 0 +_0800A5D0: .4byte 0x030030fc +_0800A5D4: + ldr r1, _0800A5E8 + 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 + .align 2, 0 +_0800A5E8: .4byte 0x0300307c + thumb_func_end sub_800A5B4 + + thumb_func_start sub_800A5EC +sub_800A5EC: @ 800A5EC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0800A604 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A608 + adds r0, r1, 0 + bl sub_800F728 + b _0800A616 + .align 2, 0 +_0800A604: .4byte 0x030030fc +_0800A608: + ldr r0, _0800A61C + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0800A616 + movs r0, 0 + strb r0, [r1] +_0800A616: + pop {r0} + bx r0 + .align 2, 0 +_0800A61C: .4byte 0x0300307c + thumb_func_end sub_800A5EC + + thumb_func_start sub_800A620 +sub_800A620: @ 800A620 + push {lr} + ldr r0, _0800A640 + 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, _0800A644 + movs r0, 0x1 + strb r0, [r1] +_0800A63C: + pop {r0} + bx r0 + .align 2, 0 +_0800A640: .4byte 0x030030e0 +_0800A644: .4byte 0x03003144 + 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, _0800A6AC + 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 + .align 2, 0 +_0800A6AC: .4byte 0x03003130 + 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, _0800A6E4 + 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 + .align 2, 0 +_0800A6E4: .4byte 0x03003130 + 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, _0800A844 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 +_0800A830: + beq _0800A838 + ldr r0, _0800A848 + bl sub_8009D90 +_0800A838: + ldr r1, _0800A84C + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0800A844: .4byte 0x030030e0 +_0800A848: .4byte 0x00002222 +_0800A84C: .4byte 0x03003140 + thumb_func_end sub_800A824 + + thumb_func_start task00_link_test +task00_link_test: @ 800A850 + push {r4-r6,lr} + sub sp, 0x20 + ldr r1, _0800A970 + mov r0, sp + bl strcat + mov r0, sp + movs r1, 0x5 + movs r2, 0x2 + bl sub_800A7DC + ldr r0, _0800A974 + ldrb r0, [r0] + movs r1, 0x2 + movs r2, 0x1 + movs r3, 0x2 + bl sub_800A6E8 + ldr r4, _0800A978 + ldr r0, [r4] + movs r1, 0xF + movs r2, 0x1 + movs r3, 0x8 + bl sub_800A6E8 + ldr r0, _0800A97C + 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, _0800A980 + ldrb r0, [r0] + movs r1, 0x19 + movs r2, 0x1 + movs r3, 0x2 + bl sub_800A6E8 + ldr r0, _0800A984 + 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, _0800A988 + ldr r0, [r0] + movs r1, 0x2 + movs r2, 0xC + movs r3, 0x8 + bl sub_800A6E8 + ldr r0, _0800A98C + 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, _0800A990 +_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 + .align 2, 0 +_0800A970: .4byte 0x082ed1e4 +_0800A974: .4byte 0x03003144 +_0800A978: .4byte 0x030030e0 +_0800A97C: .4byte 0x03003170 +_0800A980: .4byte 0x03003160 +_0800A984: .4byte 0x03004130 +_0800A988: .4byte 0x0300302c +_0800A98C: .4byte 0x03003070 +_0800A990: .4byte 0x03003148 + thumb_func_end task00_link_test + + thumb_func_start sub_800A994 +sub_800A994: @ 800A994 + ldr r2, _0800A9A0 + str r0, [r2] + ldr r0, _0800A9A4 + str r1, [r0] + bx lr + .align 2, 0 +_0800A9A0: .4byte 0x0300302c +_0800A9A4: .4byte 0x03003070 + thumb_func_end sub_800A994 + + thumb_func_start sub_800A9A8 +sub_800A9A8: @ 800A9A8 + push {r4,lr} + movs r1, 0 + movs r2, 0 + ldr r0, _0800A9D4 + 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 + .align 2, 0 +_0800A9D4: .4byte 0x03003100 + 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, _0800AA38 + strb r0, [r1] + bl link_get_multiplayer_id + ldr r1, _0800AA3C + strb r0, [r1] + ldr r4, _0800AA40 + ldr r3, _0800AA44 + 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 + .align 2, 0 +_0800AA38: .4byte 0x03003100 +_0800AA3C: .4byte 0x03003120 +_0800AA40: .4byte 0x020229e8 +_0800AA44: .4byte 0x02022a74 + thumb_func_end sub_800AA04 + + thumb_func_start sub_800AA48 +sub_800AA48: @ 800AA48 + ldr r0, _0800AA50 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800AA50: .4byte 0x03003100 + thumb_func_end sub_800AA48 + + thumb_func_start sub_800AA54 +sub_800AA54: @ 800AA54 + ldr r0, _0800AA5C + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800AA5C: .4byte 0x03003120 + 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, _0800AAD0 + ldrb r1, [r0] + mov r9, r0 + cmp r3, r1 + bge _0800AAB4 + ldr r0, _0800AAD4 + mov r12, r0 + ldr r0, _0800AAD8 + ldr r2, _0800AADC + mov r8, r2 + ldr r7, _0800AAE0 + 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 + .align 2, 0 +_0800AAD0: .4byte 0x03003100 +_0800AAD4: .4byte 0x020229e8 +_0800AAD8: .4byte 0x02022a74 +_0800AADC: .4byte 0x00002288 +_0800AAE0: .4byte 0x020229c6 +_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, _0800AB14 + 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 + .align 2, 0 +_0800AB14: .4byte 0x02022a74 + 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, _0800AB84 + ldrb r0, [r0] + cmp r4, r0 + bcs _0800AB78 + ldr r6, _0800AB88 + ldr r5, _0800AB8C + 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 sub_8008C44 + cmp r0, 0 + beq _0800AB6A +_0800AB5A: + ldr r1, _0800AB90 + movs r0, 0x1 + strb r0, [r1] + bl sub_80097E8 + ldr r0, _0800AB94 + bl set_callback2 +_0800AB6A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0800AB84 + ldrb r0, [r0] + cmp r4, r0 + bcc _0800AB36 +_0800AB78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800AB84: .4byte 0x03003100 +_0800AB88: .4byte 0x02022a74 +_0800AB8C: .4byte 0x020229e8 +_0800AB90: .4byte 0x0300306c +_0800AB94: .4byte c2_800ACD4 + 1 + thumb_func_end sub_800AB18 + + thumb_func_start sub_800AB98 +sub_800AB98: @ 800AB98 + ldr r0, _0800ABA4 + movs r1, 0 + strb r1, [r0] + ldr r0, _0800ABA8 + strb r1, [r0] + bx lr + .align 2, 0 +_0800ABA4: .4byte 0x03003100 +_0800ABA8: .4byte 0x03003120 + thumb_func_end sub_800AB98 + + thumb_func_start sub_800ABAC +sub_800ABAC: @ 800ABAC + ldr r0, _0800ABB8 + ldr r0, [r0] + movs r1, 0x1C + ands r0, r1 + lsrs r0, 2 + bx lr + .align 2, 0 +_0800ABB8: .4byte 0x030030e0 + thumb_func_end sub_800ABAC + + thumb_func_start sub_800ABBC +sub_800ABBC: @ 800ABBC + push {lr} + ldr r0, _0800ABD4 + ldrb r0, [r0] + cmp r0, 0 + bne _0800ABDC + ldr r0, _0800ABD8 + ldr r0, [r0] + lsrs r0, 5 + movs r1, 0x1 + ands r0, r1 + b _0800ABE4 + .align 2, 0 +_0800ABD4: .4byte 0x030030fc +_0800ABD8: .4byte 0x030030e0 +_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, _0800ABF0 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800ABF0: .4byte 0x03000d58 + thumb_func_end sub_800ABE8 + + thumb_func_start sub_800ABF4 +sub_800ABF4: @ 800ABF4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _0800AC08 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AC0C + bl task_add_05_task_del_08FA224_when_no_RfuFunc + b _0800AC20 + .align 2, 0 +_0800AC08: .4byte 0x030030fc +_0800AC0C: + ldr r2, _0800AC24 + ldr r1, [r2] + cmp r1, 0 + bne _0800AC20 + ldr r0, _0800AC28 + str r0, [r2] + ldr r0, _0800AC2C + strb r1, [r0] + ldr r0, _0800AC30 + strh r3, [r0] +_0800AC20: + pop {r0} + bx r0 + .align 2, 0 +_0800AC24: .4byte 0x03003140 +_0800AC28: .4byte sub_800AC80 + 1 +_0800AC2C: .4byte 0x030030e4 +_0800AC30: .4byte 0x030030f4 + thumb_func_end sub_800ABF4 + + thumb_func_start sub_800AC34 +sub_800AC34: @ 800AC34 + push {lr} + ldr r0, _0800AC44 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AC48 + bl task_add_05_task_del_08FA224_when_no_RfuFunc + b _0800AC70 + .align 2, 0 +_0800AC44: .4byte 0x030030fc +_0800AC48: + ldr r2, _0800AC5C + ldr r1, [r2] + cmp r1, 0 + beq _0800AC64 + ldr r1, _0800AC60 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0800AC70 + .align 2, 0 +_0800AC5C: .4byte 0x03003140 +_0800AC60: .4byte 0x02022b08 +_0800AC64: + ldr r0, _0800AC74 + str r0, [r2] + ldr r0, _0800AC78 + strb r1, [r0] + ldr r0, _0800AC7C + strh r1, [r0] +_0800AC70: + pop {r0} + bx r0 + .align 2, 0 +_0800AC74: .4byte sub_800AC80 + 1 +_0800AC78: .4byte 0x030030e4 +_0800AC7C: .4byte 0x030030f4 + thumb_func_end sub_800AC34 + + thumb_func_start sub_800AC80 +sub_800AC80: @ 800AC80 + push {lr} + ldr r0, _0800AC9C + ldrb r0, [r0] + cmp r0, 0 + bne _0800AC96 + ldr r0, _0800ACA0 + bl sub_8009D90 + ldr r1, _0800ACA4 + ldr r0, _0800ACA8 + str r0, [r1] +_0800AC96: + pop {r0} + bx r0 + .align 2, 0 +_0800AC9C: .4byte 0x03004130 +_0800ACA0: .4byte 0x00005fff +_0800ACA4: .4byte 0x03003140 +_0800ACA8: .4byte sub_800ACAC + 1 + 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, _0800ACFC +_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, _0800AD00 + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldr r0, _0800AD04 + movs r4, 0x1 + strb r4, [r0] + bl sub_80097E8 + ldr r1, _0800AD08 + movs r0, 0 + str r0, [r1] + ldr r0, _0800AD0C + strb r4, [r0] +_0800ACF4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800ACFC: .4byte 0x030030f0 +_0800AD00: .4byte 0x02022fec +_0800AD04: .4byte 0x03002748 +_0800AD08: .4byte 0x03003140 +_0800AD0C: .4byte 0x030030e4 + thumb_func_end sub_800ACAC + + thumb_func_start sub_800AD10 +sub_800AD10: @ 800AD10 + push {lr} + ldr r0, _0800AD20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AD24 + bl task_add_05_task_del_08FA224_when_no_RfuFunc + b _0800AD4C + .align 2, 0 +_0800AD20: .4byte 0x030030fc +_0800AD24: + ldr r2, _0800AD38 + ldr r1, [r2] + cmp r1, 0 + beq _0800AD40 + ldr r1, _0800AD3C + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0800AD4C + .align 2, 0 +_0800AD38: .4byte 0x03003140 +_0800AD3C: .4byte 0x02022b08 +_0800AD40: + ldr r0, _0800AD50 + str r0, [r2] + ldr r0, _0800AD54 + strb r1, [r0] + ldr r0, _0800AD58 + strh r1, [r0] +_0800AD4C: + pop {r0} + bx r0 + .align 2, 0 +_0800AD50: .4byte sub_800AD5C + 1 +_0800AD54: .4byte 0x030030e4 +_0800AD58: .4byte 0x030030f4 + thumb_func_end sub_800AD10 + + thumb_func_start sub_800AD5C +sub_800AD5C: @ 800AD5C + push {lr} + ldr r0, _0800AD78 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AD72 + ldr r0, _0800AD7C + bl sub_8009D90 + ldr r1, _0800AD80 + ldr r0, _0800AD84 + str r0, [r1] +_0800AD72: + pop {r0} + bx r0 + .align 2, 0 +_0800AD78: .4byte 0x03004130 +_0800AD7C: .4byte 0x00005fff +_0800AD80: .4byte 0x03003140 +_0800AD84: .4byte sub_800AD88 + 1 + 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, _0800ADE0 + ldr r4, _0800ADE4 +_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, _0800ADE8 + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldr r0, _0800ADEC + movs r4, 0x1 + strb r4, [r0] + bl sub_80097E8 + ldr r1, _0800ADF0 + movs r0, 0 + str r0, [r1] + ldr r0, _0800ADF4 + strb r4, [r0] +_0800ADDA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800ADE0: .4byte 0x030030f0 +_0800ADE4: .4byte 0x020229e8 +_0800ADE8: .4byte 0x02022fec +_0800ADEC: .4byte 0x03002748 +_0800ADF0: .4byte 0x03003140 +_0800ADF4: .4byte 0x030030e4 + thumb_func_end sub_800AD88 + + thumb_func_start sub_800ADF8 +sub_800ADF8: @ 800ADF8 + push {lr} + ldr r0, _0800AE08 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AE0C + bl sub_8010434 + b _0800AE1E + .align 2, 0 +_0800AE08: .4byte 0x030030fc +_0800AE0C: + ldr r1, _0800AE24 + ldr r0, [r1] + cmp r0, 0 + bne _0800AE18 + ldr r0, _0800AE28 + str r0, [r1] +_0800AE18: + ldr r1, _0800AE2C + movs r0, 0 + strb r0, [r1] +_0800AE1E: + pop {r0} + bx r0 + .align 2, 0 +_0800AE24: .4byte 0x03003140 +_0800AE28: .4byte sub_800AE30 + 1 +_0800AE2C: .4byte 0x030030e4 + thumb_func_end sub_800ADF8 + + thumb_func_start sub_800AE30 +sub_800AE30: @ 800AE30 + push {lr} + ldr r0, _0800AE4C + ldrb r0, [r0] + cmp r0, 0 + bne _0800AE46 + ldr r0, _0800AE50 + bl sub_8009D90 + ldr r1, _0800AE54 + ldr r0, _0800AE58 + str r0, [r1] +_0800AE46: + pop {r0} + bx r0 + .align 2, 0 +_0800AE4C: .4byte 0x03004130 +_0800AE50: .4byte 0x00002ffe +_0800AE54: .4byte 0x03003140 +_0800AE58: .4byte sub_800AE5C + 1 + 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, _0800AEAC + 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, _0800AEB0 + ldr r3, _0800AEAC + 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 + .align 2, 0 +_0800AEAC: .4byte 0x030030ec +_0800AEB0: .4byte 0x03003140 + thumb_func_end sub_800AE5C + + thumb_func_start sub_800AEB4 +sub_800AEB4: @ 800AEB4 + push {lr} + ldr r0, _0800AEF8 + ldrb r0, [r0] + cmp r0, 0 + beq _0800AEF4 + ldr r0, _0800AEFC + ldr r2, [r0] + movs r0, 0xFE + lsls r0, 11 + ands r0, r2 + cmp r0, 0 + beq _0800AEF4 + ldr r0, _0800AF00 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AEEA + ldr r1, _0800AF04 + str r2, [r1] + ldr r0, _0800AF08 + ldrb r0, [r0] + strb r0, [r1, 0x4] + ldr r0, _0800AF0C + ldrb r0, [r0] + strb r0, [r1, 0x5] + ldr r0, _0800AF10 + bl set_callback2 +_0800AEEA: + ldr r1, _0800AF14 + movs r0, 0x1 + strb r0, [r1] + bl sub_80097E8 +_0800AEF4: + pop {r0} + bx r0 + .align 2, 0 +_0800AEF8: .4byte 0x020229c4 +_0800AEFC: .4byte 0x030030e0 +_0800AF00: .4byte 0x030030f8 +_0800AF04: .4byte 0x02022b00 +_0800AF08: .4byte 0x03004130 +_0800AF0C: .4byte 0x03003160 +_0800AF10: .4byte c2_800ACD4 + 1 +_0800AF14: .4byte 0x0300306c + thumb_func_end sub_800AEB4 + + thumb_func_start sub_800AF18 +sub_800AF18: @ 800AF18 + push {r4,lr} + ldr r4, _0800AF2C + str r0, [r4] + strb r1, [r4, 0x5] + strb r2, [r4, 0x4] + strb r3, [r4, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800AF2C: .4byte 0x02022b00 + thumb_func_end sub_800AF18 + + thumb_func_start c2_800ACD4 +c2_800ACD4: @ 800AF30 + push {r4,lr} + movs r0, 0 + movs r1, 0 + bl lcd_io_set + ldr r0, _0800B044 + bl MPlayStop_rev01 + ldr r0, _0800B048 + bl MPlayStop_rev01 + ldr r0, _0800B04C + bl MPlayStop_rev01 + ldr r0, _0800B050 + movs r1, 0xE0 + lsls r1, 9 + bl init_malloc + bl reset_all_obj_data + bl gpu_pal_allocator_reset + 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, _0800B054 + ldrb r0, [r1] + cmp r0, 0 + beq _0800AF8C + ldr r0, _0800B058 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0800AF88 + movs r0, 0x3 + strb r0, [r1] +_0800AF88: + bl sub_800E604 +_0800AF8C: + ldr r0, _0800B05C + bl SetVBlankCallback + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0800B060 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + ldr r4, _0800B064 + movs r0, 0x80 + lsls r0, 4 + bl malloc + adds r1, r0, 0 + str r1, [r4] + movs r0, 0x1 + bl bg_set_tilemap + ldr r0, _0800B068 + bl Window_InitFromTemplates + lsls r0, 16 + cmp r0, 0 + beq _0800B03C + bl TextBox_ResetSomeField + bl reset_temp_tile_data_buffers + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r1, 0xE0 + lsls r1, 8 + movs r0, 0 + bl lcd_io_clear_bits + ldr r0, _0800B06C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0800B070 + movs r0, 0 + strb r0, [r1] + ldr r0, _0800B074 + movs r1, 0 + bl AddTask + bl sub_80A2F30 + ldr r1, _0800B078 + movs r0, 0 + str r0, [r1] + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + ldr r0, _0800B07C + bl set_callback2 +_0800B03C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800B044: .4byte 0x030075f0 +_0800B048: .4byte 0x03007630 +_0800B04C: .4byte 0x03007800 +_0800B050: .4byte 0x02000000 +_0800B054: .4byte 0x030030fc +_0800B058: .4byte 0x02022b00 +_0800B05C: .4byte sub_80096BC + 1 +_0800B060: .4byte 0x082ed1fc +_0800B064: .4byte 0x02022b0c +_0800B068: .4byte 0x082ed204 +_0800B06C: .4byte 0x0860f074 +_0800B070: .4byte 0x03002700 +_0800B074: .4byte sub_8009404 + 1 +_0800B078: .4byte 0x030022c0 +_0800B07C: .4byte sub_800B1A0 + 1 + thumb_func_end c2_800ACD4 + + thumb_func_start sub_800B080 +sub_800B080: @ 800B080 + push {r4,r5,lr} + sub sp, 0xC + ldr r1, _0800B11C + movs r0, 0 + movs r2, 0x20 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _0800B120 + 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, _0800B124 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0800B128 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + ldr r4, _0800B12C + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, _0800B130 + 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, _0800B134 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl box_print + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0 + bl Window_CopyToVram + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800B11C: .4byte 0x082ed168 +_0800B120: .4byte 0x082ec88c +_0800B124: .4byte 0x082ecd34 +_0800B128: .4byte 0x082ec86c +_0800B12C: .4byte 0x082ed224 +_0800B130: .4byte 0x085ee4f7 +_0800B134: .4byte 0x085ee50c + thumb_func_end sub_800B080 + + thumb_func_start sub_800B138 +sub_800B138: @ 800B138 + push {lr} + sub sp, 0xC + ldr r1, _0800B194 + movs r0, 0 + movs r2, 0x20 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _0800B198 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, _0800B19C + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0 + bl box_print + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0 + bl Window_CopyToVram + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_0800B194: .4byte 0x082ed168 +_0800B198: .4byte 0x082ed224 +_0800B19C: .4byte 0x085ee4a4 + thumb_func_end sub_800B138 + + thumb_func_start sub_800B1A0 +sub_800B1A0: @ 800B1A0 + push {r4,lr} + sub sp, 0xC + ldr r0, _0800B1C0 + 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 + .align 2, 0 +_0800B1C0: .4byte 0x030022c0 +_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, _0800B1E8 + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800B1EC + bl sub_800B080 + b _0800B260 + .align 2, 0 +_0800B1E8: .4byte 0x02022b00 +_0800B1EC: + bl sub_800B138 + b _0800B260 +_0800B1F2: + movs r0, 0 + bl gpu_sync_bg_show + ldr r0, _0800B208 + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800B260 + movs r0, 0x1 + bl gpu_sync_bg_show + b _0800B260 + .align 2, 0 +_0800B208: .4byte 0x02022b00 +_0800B20C: + movs r0, 0x16 + bl audio_play + b _0800B260 +_0800B214: + ldr r0, _0800B238 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0800B244 + ldr r0, _0800B23C + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, _0800B240 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x14 + bl box_print + b _0800B260 + .align 2, 0 +_0800B238: .4byte 0x030030fc +_0800B23C: .4byte 0x082ed224 +_0800B240: .4byte 0x085ee572 +_0800B244: + cmp r0, 0x1 + bne _0800B260 + ldr r0, _0800B294 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, _0800B298 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x14 + bl box_print +_0800B260: + ldr r0, _0800B29C + movs r2, 0x87 + lsls r2, 3 + adds r1, r0, r2 + ldrb r1, [r1] + cmp r1, 0xA0 + bne _0800B2D0 + ldr r4, _0800B2A0 + 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, _0800B2A4 + movs r0, 0 + strb r0, [r1, 0x6] + bl sub_81700F8 + b _0800B2C2 + .align 2, 0 +_0800B294: .4byte 0x082ed224 +_0800B298: .4byte 0x085ee553 +_0800B29C: .4byte 0x030022c0 +_0800B2A0: .4byte 0x030030fc +_0800B2A4: .4byte 0x02022b00 +_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 do_reset +_0800B2C2: + ldr r0, _0800B2E4 + 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 + .align 2, 0 +_0800B2E4: .4byte 0x030022c0 + thumb_func_end sub_800B1A0 + + thumb_func_start sub_800B2E8 +sub_800B2E8: @ 800B2E8 + ldr r0, _0800B2F4 + ldrh r0, [r0] + lsrs r0, 2 + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_0800B2F4: .4byte 0x04000128 + thumb_func_end sub_800B2E8 + + thumb_func_start sub_800B2F8 +sub_800B2F8: @ 800B2F8 + push {lr} + movs r3, 0 + ldr r2, _0800B31C + 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 + .align 2, 0 +_0800B31C: .4byte 0x04000128 + thumb_func_end sub_800B2F8 + + thumb_func_start sub_800B320 +sub_800B320: @ 800B320 + ldr r0, _0800B32C + ldr r0, [r0] + lsrs r0, 6 + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_0800B32C: .4byte 0x030030e0 + thumb_func_end sub_800B320 + + thumb_func_start sub_800B330 +sub_800B330: @ 800B330 + ldr r1, _0800B338 + strb r0, [r1] + bx lr + .align 2, 0 +_0800B338: .4byte 0x030030f8 + thumb_func_end sub_800B330 + + thumb_func_start sub_800B33C +sub_800B33C: @ 800B33C + ldr r0, _0800B344 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800B344: .4byte 0x0300306c + thumb_func_end sub_800B33C + + thumb_func_start sub_800B348 +sub_800B348: @ 800B348 + push {r4-r6,lr} + bl sub_8009638 + ldr r1, _0800B394 + adds r2, r1, 0 + adds r2, 0x10 + ldr r0, _0800B398 + 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, _0800B39C + 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, _0800B3A0 + movs r2, 0x3C + bl memcpy + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800B394: .4byte 0x03003030 +_0800B398: .4byte 0x020229cc +_0800B39C: .4byte 0x082ed1d4 +_0800B3A0: .4byte 0x020228c4 + 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, _0800B3FC + adds r4, r2, r1 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + ldr r0, _0800B400 + 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, _0800B404 + 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, _0800B408 + bl set_callback2 +_0800B3F4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800B3FC: .4byte 0x020223c4 +_0800B400: .4byte 0x020229e8 +_0800B404: .4byte 0x082ed1d4 +_0800B408: .4byte c2_800ACD4 + 1 + thumb_func_end sub_800B3A4 + + thumb_func_start sub_800B40C +sub_800B40C: @ 800B40C + push {r4,r5,lr} + ldr r0, _0800B444 + ldrb r0, [r0] + cmp r0, 0 + bne _0800B45C + ldr r0, _0800B448 + ldr r1, _0800B44C + ldr r2, _0800B450 + bl sub_800B638 + ldr r4, _0800B454 + str r0, [r4] + ldr r0, _0800B458 + 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 + .align 2, 0 +_0800B444: .4byte 0x030030fc +_0800B448: .4byte 0x03003144 +_0800B44C: .4byte 0x03003110 +_0800B450: .4byte 0x03003090 +_0800B454: .4byte 0x030030e0 +_0800B458: .4byte 0x030022ec +_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 sub_800B40C + + thumb_func_start sub_800B488 +sub_800B488: @ 800B488 + push {lr} + ldr r0, _0800B49C + ldrb r0, [r0] + cmp r0, 0 + bne _0800B498 + ldr r1, _0800B4A0 + movs r0, 0x1 + strb r0, [r1] +_0800B498: + pop {r0} + bx r0 + .align 2, 0 +_0800B49C: .4byte 0x03003124 +_0800B4A0: .4byte 0x030030fc + thumb_func_end sub_800B488 + + thumb_func_start sub_800B4A4 +sub_800B4A4: @ 800B4A4 + push {lr} + ldr r0, _0800B4B8 + ldrb r1, [r0] + cmp r1, 0 + bne _0800B4B2 + ldr r0, _0800B4BC + strb r1, [r0] +_0800B4B2: + pop {r0} + bx r0 + .align 2, 0 +_0800B4B8: .4byte 0x03003124 +_0800B4BC: .4byte 0x030030fc + thumb_func_end sub_800B4A4 + + thumb_func_start sub_800B4C0 +sub_800B4C0: @ 800B4C0 + push {lr} + ldr r0, _0800B4D4 + ldrb r1, [r0] + cmp r1, 0 + bne _0800B4CE + ldr r0, _0800B4D8 + strb r1, [r0] +_0800B4CE: + pop {r0} + bx r0 + .align 2, 0 +_0800B4D4: .4byte 0x03003124 +_0800B4D8: .4byte 0x030030fc + thumb_func_end sub_800B4C0 + + thumb_func_start sub_800B4DC +sub_800B4DC: @ 800B4DC + push {lr} + ldr r0, _0800B4F0 + ldrb r0, [r0] + cmp r0, 0 + bne _0800B4FC + ldr r0, _0800B4F4 + ldr r1, _0800B4F8 + adds r0, r1 + ldrb r0, [r0] + b _0800B500 + .align 2, 0 +_0800B4F0: .4byte 0x030030fc +_0800B4F4: .4byte 0x03003170 +_0800B4F8: .4byte 0x00000fbd +_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, _0800B520 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800B520: .4byte 0x030030fc + 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 sub_8009308 + 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 disable_irqs + ldr r1, _0800B57C + movs r2, 0x80 + lsls r2, 6 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0800B580 + movs r2, 0 + strh r2, [r0] + adds r1, 0xDA + movs r0, 0xC0 + strh r0, [r1] + ldr r0, _0800B584 + strh r2, [r0] + ldr r2, _0800B588 + movs r0, 0 + movs r1, 0 + str r0, [r2] + str r1, [r2, 0x4] + str r0, [sp] + ldr r1, _0800B58C + ldr r2, _0800B590 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0800B57C: .4byte 0x04000128 +_0800B580: .4byte 0x0400010e +_0800B584: .4byte 0x0400012a +_0800B588: .4byte 0x04000120 +_0800B58C: .4byte 0x03003170 +_0800B590: .4byte 0x050003f0 + thumb_func_end sub_800B53C + + thumb_func_start sub_800B594 +sub_800B594: @ 800B594 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xC0 + bl disable_irqs + ldr r0, _0800B5F4 + movs r4, 0 + strh r4, [r0] + ldr r2, _0800B5F8 + movs r1, 0x80 + lsls r1, 6 + adds r0, r1, 0 + strh r0, [r2] + ldrh r0, [r2] + ldr r3, _0800B5FC + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + movs r0, 0x80 + bl enable_irqs + ldr r0, _0800B600 + strh r4, [r0] + movs r5, 0 + str r5, [sp] + ldr r1, _0800B604 + ldr r2, _0800B608 + mov r0, sp + bl CpuSet + ldr r0, _0800B60C + strb r4, [r0] + ldr r0, _0800B610 + strh r5, [r0] + ldr r0, _0800B614 + strh r5, [r0] + ldr r0, _0800B618 + strb r4, [r0] + ldr r0, _0800B61C + strb r4, [r0] + ldr r0, _0800B620 + strb r4, [r0] + ldr r0, _0800B624 + strb r4, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800B5F4: .4byte 0x04000134 +_0800B5F8: .4byte 0x04000128 +_0800B5FC: .4byte 0x00004003 +_0800B600: .4byte 0x0400012a +_0800B604: .4byte 0x03003170 +_0800B608: .4byte 0x050003f0 +_0800B60C: .4byte 0x03000d6c +_0800B610: .4byte 0x03000d6e +_0800B614: .4byte 0x03000d70 +_0800B618: .4byte 0x03000d72 +_0800B61C: .4byte 0x03000d73 +_0800B620: .4byte 0x03003160 +_0800B624: .4byte 0x03004130 + 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, _0800B654 + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bhi _0800B6EA + lsls r0, 2 + ldr r1, _0800B658 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800B654: .4byte 0x03003170 +_0800B658: .4byte _0800B65C + .align 2, 0 +_0800B65C: + .4byte _0800B670 + .4byte _0800B680 + .4byte _0800B698 + .4byte _0800B6D4 + .4byte _0800B6DE +_0800B670: + bl sub_800B53C + ldr r1, _0800B67C + movs r0, 0x1 + strb r0, [r1, 0x1] + b _0800B6EA + .align 2, 0 +_0800B67C: .4byte 0x03003170 +_0800B680: + ldrb r0, [r4] + cmp r0, 0x1 + bne _0800B6EA + bl sub_800B594 + ldr r1, _0800B694 + movs r0, 0x2 + strb r0, [r1, 0x1] + b _0800B6EA + .align 2, 0 +_0800B694: .4byte 0x03003170 +_0800B698: + ldrb r1, [r4] + cmp r1, 0x1 + beq _0800B6A8 + cmp r1, 0x2 + beq _0800B6C0 + bl sub_800B764 + b _0800B6EA +_0800B6A8: + ldr r2, _0800B6BC + ldrb r0, [r2] + cmp r0, 0x8 + bne _0800B6EA + ldrb r0, [r2, 0x3] + cmp r0, 0x1 + bls _0800B6EA + strb r1, [r2, 0xE] + b _0800B6EA + .align 2, 0 +_0800B6BC: .4byte 0x03003170 +_0800B6C0: + ldr r0, _0800B6CC + movs r1, 0 + strb r1, [r0, 0x1] + ldr r0, _0800B6D0 + strh r1, [r0] + b _0800B6EA + .align 2, 0 +_0800B6CC: .4byte 0x03003170 +_0800B6D0: .4byte 0x0400012a +_0800B6D4: + bl sub_800B790 + ldr r1, _0800B724 + 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, _0800B724 + 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 + .align 2, 0 +_0800B724: .4byte 0x03003170 +_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, _0800B780 + ldr r1, [r0] + movs r0, 0xC + ands r1, r0 + ldr r2, _0800B784 + cmp r1, 0x8 + bne _0800B788 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0800B788 + strb r1, [r2] + b _0800B78C + .align 2, 0 +_0800B780: .4byte 0x04000128 +_0800B784: .4byte 0x03003170 +_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, _0800B7B4 + ldrb r0, [r0] + cmp r0, 0 + beq _0800B7AE + ldr r1, _0800B7B8 + ldr r2, _0800B7BC + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x41 + strh r0, [r1] + movs r0, 0x40 + bl enable_irqs +_0800B7AE: + pop {r0} + bx r0 + .align 2, 0 +_0800B7B4: .4byte 0x03003170 +_0800B7B8: .4byte 0x0400010c +_0800B7BC: .4byte 0x0000ff3b + 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, _0800B838 + ldr r1, _0800B83C + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, _0800B840 + ldr r4, _0800B844 + 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, _0800B848 + mov r9, r4 + ldr r1, _0800B84C + 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 + .align 2, 0 +_0800B838: .4byte 0x03004134 +_0800B83C: .4byte 0x04000208 +_0800B840: .4byte 0x03003170 +_0800B844: .4byte 0x00000339 +_0800B848: .4byte 0x03000d6e +_0800B84C: .4byte 0x03003160 +_0800B850: + movs r0, 0x1 + strb r0, [r6, 0x12] + ldr r2, _0800B894 + mov r9, r2 + ldr r4, _0800B898 + mov r10, r4 +_0800B85C: + mov r1, r9 + ldrh r0, [r1] + cmp r0, 0 + beq _0800B874 + ldr r2, _0800B89C + 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, _0800B8A0 + ldr r2, _0800B8A4 + ldrh r0, [r2] + strh r0, [r1] + ldr r4, _0800B89C + 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 + .align 2, 0 +_0800B894: .4byte 0x03000d6e +_0800B898: .4byte 0x03003160 +_0800B89C: .4byte 0x00000339 +_0800B8A0: .4byte 0x04000208 +_0800B8A4: .4byte 0x03004134 + 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, _0800B904 + ldr r1, _0800B908 + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, _0800B90C + ldr r3, _0800B910 + 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 + .align 2, 0 +_0800B904: .4byte 0x03004134 +_0800B908: .4byte 0x04000208 +_0800B90C: .4byte 0x03003170 +_0800B910: .4byte 0x00000fbd +_0800B914: + movs r3, 0 + mov r0, r12 + ldrb r1, [r0, 0x3] + cmp r3, r1 + bcs _0800B96A + ldr r0, _0800B9A8 + 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, _0800B9AC + adds r1, r2, r0 + ldrb r0, [r1] + subs r0, 0x1 + movs r3, 0 + strb r0, [r1] + ldr r1, _0800B9A8 + 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, _0800B9B0 + ldr r3, _0800B9B4 + 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 + .align 2, 0 +_0800B9A8: .4byte 0x00000fbc +_0800B9AC: .4byte 0x00000fbd +_0800B9B0: .4byte 0x04000208 +_0800B9B4: .4byte 0x03004134 + thumb_func_end sub_800B8A8 + + thumb_func_start sub_800B9B8 +sub_800B9B8: @ 800B9B8 + push {r4,lr} + ldr r3, _0800B9E0 + 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 + .align 2, 0 +_0800B9E0: .4byte 0x03003170 +_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, _0800BA24 + 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 + .align 2, 0 +_0800BA24: .4byte 0x03000d6c + thumb_func_end sub_800B9B8 + + thumb_func_start irq_timer3 +irq_timer3: @ 800BA28 + push {lr} + bl sub_800BD98 + bl sub_800BAC0 + pop {r0} + bx r0 + thumb_func_end irq_timer3 + + thumb_func_start sub_800BA38 +sub_800BA38: @ 800BA38 + push {r4,lr} + ldr r4, _0800BA64 + ldr r0, _0800BA68 + 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 + .align 2, 0 +_0800BA64: .4byte 0x03003170 +_0800BA68: .4byte 0x04000128 +_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, _0800BAB0 + ldrb r0, [r3, 0xD] + adds r0, 0x1 + movs r2, 0 + strb r0, [r3, 0xD] + ldr r1, _0800BAB4 + strb r2, [r1] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x8 + bne _0800BAAA + ldr r0, _0800BAB8 + ldr r2, _0800BABC + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] +_0800BAAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800BAB0: .4byte 0x03003170 +_0800BAB4: .4byte 0x03000d6c +_0800BAB8: .4byte 0x03004130 +_0800BABC: .4byte 0x00000fbd + thumb_func_end sub_800BA38 + + thumb_func_start sub_800BAC0 +sub_800BAC0: @ 800BAC0 + ldr r0, _0800BACC + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_0800BACC: .4byte 0x04000128 + 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, _0800BAEC + ldr r0, _0800BAF0 + ldrb r1, [r0, 0xE] + adds r7, r0, 0 + cmp r1, 0x1 + bne _0800BAFC + ldr r1, _0800BAF4 + ldr r2, _0800BAF8 + b _0800BB00 + .align 2, 0 +_0800BAEC: .4byte 0x0000ffff +_0800BAF0: .4byte 0x03003170 +_0800BAF4: .4byte 0x0400012a +_0800BAF8: .4byte 0x00008fff +_0800BAFC: + ldr r1, _0800BB54 + ldr r2, _0800BB58 +_0800BB00: + adds r0, r2, 0 + strh r0, [r1] + ldr r2, _0800BB5C + ldr r3, _0800BB60 + 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, _0800BB64 + mov r9, r0 + mov r8, r2 + ldr r2, _0800BB68 + ldr r1, _0800BB6C + 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, _0800BB58 + 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 + .align 2, 0 +_0800BB54: .4byte 0x0400012a +_0800BB58: .4byte 0x0000b9a0 +_0800BB5C: .4byte 0x03003174 +_0800BB60: .4byte 0x04000120 +_0800BB64: .4byte 0x03000d73 +_0800BB68: .4byte 0x00008fff +_0800BB6C: .4byte 0x0000ffff +_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, _0800BBA0 + cmp r1, r0 + bne _0800BBA4 + movs r0, 0x1 + b _0800BBBE + .align 2, 0 +_0800BBA0: .4byte 0x00008fff +_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, _0800BC24 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, _0800BC28 + ldrb r1, [r0, 0x16] + adds r6, r0, 0 + cmp r1, 0 + bne _0800BC30 + movs r4, 0 + ldr r7, _0800BC2C + 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 + .align 2, 0 +_0800BC24: .4byte 0x04000120 +_0800BC28: .4byte 0x03003170 +_0800BC2C: .4byte 0x03000d72 +_0800BC30: + ldr r2, _0800BCA0 + 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, _0800BCA4 + 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 + .align 2, 0 +_0800BCA0: .4byte 0x00000fbc +_0800BCA4: .4byte 0x03000d70 +_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, _0800BCDC + ldrh r0, [r2] + cmp r0, 0 + beq _0800BCD0 + ldr r1, _0800BCE0 + 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 + .align 2, 0 +_0800BCDC: .4byte 0x03000d70 +_0800BCE0: .4byte 0x00000fbd + thumb_func_end sub_800BBCC + + thumb_func_start sub_800BCE4 +sub_800BCE4: @ 800BCE4 + push {r4,lr} + ldr r0, _0800BD20 + ldrb r1, [r0, 0x16] + adds r4, r0, 0 + cmp r1, 0x8 + bne _0800BD36 + ldr r1, _0800BD24 + ldrh r0, [r4, 0x14] + strh r0, [r1] + ldr r1, _0800BD28 + ldrb r2, [r1] + cmp r2, 0 + bne _0800BD30 + ldr r0, _0800BD2C + 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 + .align 2, 0 +_0800BD20: .4byte 0x03003170 +_0800BD24: .4byte 0x0400012a +_0800BD28: .4byte 0x03000d6d +_0800BD2C: .4byte 0x00000339 +_0800BD30: + movs r0, 0 + strb r0, [r1] + b _0800BD8C +_0800BD36: + ldr r1, _0800BD5C + ldrb r0, [r1] + cmp r0, 0 + bne _0800BD52 + ldr r2, _0800BD60 + 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, _0800BD64 + movs r0, 0 + strh r0, [r1] + b _0800BD86 + .align 2, 0 +_0800BD5C: .4byte 0x03000d6d +_0800BD60: .4byte 0x00000339 +_0800BD64: .4byte 0x0400012a +_0800BD68: + ldr r3, _0800BD94 + 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 + .align 2, 0 +_0800BD94: .4byte 0x0400012a + thumb_func_end sub_800BCE4 + + thumb_func_start sub_800BD98 +sub_800BD98: @ 800BD98 + push {lr} + ldr r0, _0800BDB8 + ldrb r0, [r0] + cmp r0, 0 + beq _0800BDB4 + ldr r2, _0800BDBC + ldrh r1, [r2] + ldr r0, _0800BDC0 + ands r0, r1 + strh r0, [r2] + ldr r1, _0800BDC4 + ldr r2, _0800BDC8 + adds r0, r2, 0 + strh r0, [r1] +_0800BDB4: + pop {r0} + bx r0 + .align 2, 0 +_0800BDB8: .4byte 0x03003170 +_0800BDBC: .4byte 0x0400010e +_0800BDC0: .4byte 0x0000ff7f +_0800BDC4: .4byte 0x0400010c +_0800BDC8: .4byte 0x0000ff3b + thumb_func_end sub_800BD98 + + thumb_func_start sub_800BDCC +sub_800BDCC: @ 800BDCC + push {lr} + ldr r1, _0800BDE0 + ldrb r0, [r1, 0x17] + cmp r0, 0x8 + bne _0800BDE4 + movs r0, 0 + strb r0, [r1, 0x16] + strb r0, [r1, 0x17] + b _0800BDF4 + .align 2, 0 +_0800BDE0: .4byte 0x03003170 +_0800BDE4: + ldrb r0, [r1] + cmp r0, 0 + beq _0800BDF4 + ldr r0, _0800BDF8 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] +_0800BDF4: + pop {r0} + bx r0 + .align 2, 0 +_0800BDF8: .4byte 0x0400010e + thumb_func_end sub_800BDCC + + thumb_func_start sub_800BDFC +sub_800BDFC: @ 800BDFC + push {r4-r6,lr} + ldr r1, _0800BE44 + ldr r2, _0800BE48 + 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, _0800BE4C +_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 + .align 2, 0 +_0800BE44: .4byte 0x03003170 +_0800BE48: .4byte 0x00000339 +_0800BE4C: .4byte 0x0000efff + thumb_func_end sub_800BDFC + + thumb_func_start sub_800BE50 +sub_800BE50: @ 800BE50 + push {r4-r7,lr} + ldr r1, _0800BEB0 + ldr r2, _0800BEB4 + adds r0, r1, r2 + movs r2, 0 + strb r2, [r0] + ldr r3, _0800BEB8 + 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, _0800BEBC +_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 + .align 2, 0 +_0800BEB0: .4byte 0x03003170 +_0800BEB4: .4byte 0x00000fbd +_0800BEB8: .4byte 0x00000fbc +_0800BEBC: .4byte 0x0000efff + 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, _0800BF04 + cmp r4, r0 + bne _0800BED4 + ldr r1, _0800BF08 + movs r0, 0x1 + strb r0, [r1, 0x8] +_0800BED4: + ldr r0, _0800BF08 + 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 + .align 2, 0 +_0800BF04: .4byte 0x00008001 +_0800BF08: .4byte 0x03004140 + 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, _0800BF2C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + bne _0800BF34 + ldr r0, _0800BF30 + ldrb r0, [r0, 0x2] + movs r2, 0 + cmp r0, 0x1 + bne _0800BF3C + movs r2, 0x1 + b _0800BF3C + .align 2, 0 +_0800BF2C: .4byte 0x03007890 +_0800BF30: .4byte 0x03004140 +_0800BF34: + ldr r0, _0800BF48 + ldrb r1, [r0, 0x3] + movs r1, 0 + strb r1, [r0, 0x3] +_0800BF3C: + adds r0, r2, 0 + bl rfu_REQ_sendData + pop {r0} + bx r0 + .align 2, 0 +_0800BF48: .4byte 0x03004140 + 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, _0800BF84 + ldr r2, _0800BF88 + 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, _0800BF8C + bl rfu_setMSCCallback + ldr r0, _0800BF90 + bl rfu_setREQCallback + movs r0, 0 + b _0800BF96 + .align 2, 0 +_0800BF84: .4byte 0x03004140 +_0800BF88: .4byte 0x01000024 +_0800BF8C: .4byte sub_800CEB0 + 1 +_0800BF90: .4byte sub_800C7B4 + 1 +_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, _0800BFC4 + ldr r2, _0800BFC8 + 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 + .align 2, 0 +_0800BFC4: .4byte 0x03004140 +_0800BFC8: .4byte 0x01000020 + 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, _0800BFFC + 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 + .align 2, 0 +_0800BFFC: .4byte 0x03004140 + thumb_func_end sub_800BFCC + + thumb_func_start sub_800C000 +sub_800C000: @ 800C000 + push {r4,r5,lr} + ldr r2, _0800C044 + 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 + .align 2, 0 +_0800C044: .4byte 0x03004140 + thumb_func_end sub_800C000 + + thumb_func_start sub_800C048 +sub_800C048: @ 800C048 + ldr r1, _0800C050 + movs r0, 0x15 + strb r0, [r1, 0x4] + bx lr + .align 2, 0 +_0800C050: .4byte 0x03004140 + 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, _0800C08C + 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 + .align 2, 0 +_0800C08C: .4byte 0x03004140 +_0800C090: + bl rfu_getMasterSlave + lsls r0, 24 + cmp r0, 0 + bne _0800C0B0 + ldr r1, _0800C0AC + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x2 + b _0800C122 + .align 2, 0 +_0800C0AC: .4byte 0x03004140 +_0800C0B0: + movs r2, 0 + ldrh r0, [r6] + ldr r4, _0800C0E4 + adds r1, r6, 0x2 + ldr r3, _0800C0E8 + 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 + .align 2, 0 +_0800C0E4: .4byte 0x0000ffff +_0800C0E8: .4byte 0x03004140 +_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 mega_func_4 +mega_func_4: @ 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, _0800C160 + 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 + .align 2, 0 +_0800C160: .4byte 0x03004140 +_0800C164: + bl rfu_getMasterSlave + lsls r0, 24 + cmp r0, 0 + bne _0800C184 + ldr r1, _0800C180 + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x2 + b _0800C204 + .align 2, 0 +_0800C180: .4byte 0x03004140 +_0800C184: + movs r2, 0 + ldr r0, _0800C1D0 + ldr r1, [r0] + ldrb r3, [r1, 0x8] + ldr r5, _0800C1D4 + 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 + .align 2, 0 +_0800C1D0: .4byte 0x03007890 +_0800C1D4: .4byte 0x03004140 +_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 mega_func_4 + + thumb_func_start sub_800C210 +sub_800C210: @ 800C210 + push {r4-r7,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r6, _0800C274 + 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, _0800C278 + 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, _0800C274 + strh r4, [r0, 0x14] + movs r0, 0x33 + adds r1, r4, 0 + bl sub_800D30C +_0800C26C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800C274: .4byte 0x03004140 +_0800C278: .4byte 0x03007890 + 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, _0800C298 + 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 + .align 2, 0 +_0800C298: .4byte 0x03004140 +_0800C29C: + ldrb r0, [r5, 0x4] + subs r0, 0x5 + cmp r0, 0xD + bhi _0800C352 + lsls r0, 2 + ldr r1, _0800C2B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800C2B0: .4byte _0800C2B4 + .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, _0800C348 + 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 + .align 2, 0 +_0800C348: .4byte 0x03007890 +_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, _0800C408 + 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 + .align 2, 0 +_0800C408: .4byte 0x03004140 +_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, _0800C528 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800C518 + ldrb r0, [r7] + cmp r0, 0 + beq _0800C49C + movs r2, 0 + ldr r6, _0800C52C + 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, _0800C52C + 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, _0800C52C + 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, _0800C52C + strh r4, [r0, 0x14] + movs r0, 0x33 + movs r1, 0x1 + bl sub_800D30C +_0800C506: + ldr r0, _0800C52C + 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 + .align 2, 0 +_0800C528: .4byte 0x03007890 +_0800C52C: .4byte 0x03004140 + 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, _0800C564 + ldr r2, [r1, 0x40] + cmp r2, 0 + bne _0800C568 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0800C568 + strb r2, [r1, 0x4] + b _0800C736 + .align 2, 0 +_0800C564: .4byte 0x03004140 +_0800C568: + ldr r0, _0800C59C + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0800C576 + adds r0, r3, 0 + bl sub_800C744 +_0800C576: + ldr r4, _0800C59C + 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, _0800C5A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800C59C: .4byte 0x03004140 +_0800C5A0: .4byte _0800C5A4 + .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, _0800C61C + movs r2, 0xFF + cmp r0, r1 + bne _0800C60E + movs r2, 0x44 +_0800C60E: + ldr r1, _0800C620 + movs r0, 0 + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] + adds r0, r2, 0 + b _0800C64E + .align 2, 0 +_0800C61C: .4byte 0x00008001 +_0800C620: .4byte 0x03004140 +_0800C624: + bl sub_800BEC0 + ldr r1, _0800C63C + cmp r0, r1 + bne _0800C644 + ldr r0, _0800C640 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + movs r1, 0x3 + strb r1, [r0, 0x5] + b _0800C6F6 + .align 2, 0 +_0800C63C: .4byte 0x00008001 +_0800C640: .4byte 0x03004140 +_0800C644: + ldr r1, _0800C658 + movs r0, 0 + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] + movs r0, 0xFF +_0800C64E: + movs r1, 0 + bl sub_800D30C + b _0800C6F6 + .align 2, 0 +_0800C658: .4byte 0x03004140 +_0800C65C: + bl rfu_REQ_reset + b _0800C6F6 +_0800C662: + ldr r0, _0800C674 + ldr r2, [r0, 0x3C] + ldrh r0, [r2, 0x2] + ldrb r1, [r2] + ldrb r2, [r2, 0x1] + bl rfu_REQ_configSystem + b _0800C6F6 + .align 2, 0 +_0800C674: .4byte 0x03004140 +_0800C678: + ldr r0, _0800C68C + 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 + .align 2, 0 +_0800C68C: .4byte 0x03004140 +_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, _0800C6C0 + ldrh r0, [r0, 0x1E] + bl rfu_REQ_startConnectParent + b _0800C6F6 + .align 2, 0 +_0800C6C0: .4byte 0x03004140 +_0800C6C4: + bl rfu_REQ_pollConnectParent + b _0800C6F6 +_0800C6CA: + bl rfu_REQ_endConnectParent + b _0800C6F6 +_0800C6D0: + ldr r0, _0800C6DC + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bl rfu_REQ_CHILD_startConnectRecovery + b _0800C6F6 + .align 2, 0 +_0800C6DC: .4byte 0x03007890 +_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, _0800C73C + movs r0, 0 + strb r0, [r1, 0xE] +_0800C700: + ldr r0, _0800C73C + ldrb r0, [r0, 0x4] + subs r0, 0x12 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0800C710 + b _0800C576 +_0800C710: + ldr r0, _0800C740 + 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 + .align 2, 0 +_0800C73C: .4byte 0x03004140 +_0800C740: .4byte 0x03007890 + thumb_func_end sub_800C54C + + thumb_func_start sub_800C744 +sub_800C744: @ 800C744 + push {r4,lr} + adds r3, r0, 0 + ldr r0, _0800C768 + 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 + .align 2, 0 +_0800C768: .4byte 0x03004140 +_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, _0800C7EC + 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, _0800C7F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800C7EC: .4byte 0x03004140 +_0800C7F0: .4byte _0800C7F4 + .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, _0800C8C0 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + movs r1, 0x4 + strb r1, [r0, 0x5] + b _0800CC8A + .align 2, 0 +_0800C8C0: .4byte 0x03004140 +_0800C8C4: + cmp r6, 0 + beq _0800C8CA + b _0800CC8A +_0800C8CA: + ldr r0, _0800C8D4 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + b _0800CC8A + .align 2, 0 +_0800C8D4: .4byte 0x03004140 +_0800C8D8: + cmp r6, 0 + beq _0800C8DE + b _0800CC8A +_0800C8DE: + ldr r0, _0800C8E8 + strb r6, [r0, 0x5] + strb r6, [r0, 0x4] + movs r0, 0 + b _0800CBF6 + .align 2, 0 +_0800C8E8: .4byte 0x03004140 +_0800C8EC: + cmp r6, 0 + beq _0800C8F2 + b _0800CC8A +_0800C8F2: + ldr r1, _0800C8F8 + movs r0, 0x6 + b _0800CA0C + .align 2, 0 +_0800C8F8: .4byte 0x03004140 +_0800C8FC: + ldr r1, _0800C91C + 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 + .align 2, 0 +_0800C91C: .4byte 0x03004140 +_0800C920: + cmp r6, 0 + beq _0800C926 + b _0800CC8A +_0800C926: + ldr r0, _0800C93C + 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 + .align 2, 0 +_0800C93C: .4byte 0x03004140 +_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, _0800C95C + movs r0, 0xA + b _0800CA0C + .align 2, 0 +_0800C95C: .4byte 0x03004140 +_0800C960: + cmp r6, 0 + bne _0800C9A6 + bl sub_800D294 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + ldr r4, _0800C9C8 + 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, _0800C9CC + 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, _0800C9C8 + 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 + .align 2, 0 +_0800C9C8: .4byte 0x03004140 +_0800C9CC: .4byte 0x03007890 +_0800C9D0: + cmp r6, 0 + beq _0800C9D6 + b _0800CC8A +_0800C9D6: + ldr r2, _0800C9F0 + 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 + .align 2, 0 +_0800C9F0: .4byte 0x03004140 +_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, _0800CA14 + movs r0, 0xD +_0800CA0C: + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] + b _0800CC8A + .align 2, 0 +_0800CA14: .4byte 0x03004140 +_0800CA18: + cmp r6, 0 + bne _0800CA3C + ldr r4, _0800CA58 + 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, _0800CA5C + 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 + .align 2, 0 +_0800CA58: .4byte 0x03004150 +_0800CA5C: .4byte 0x03004140 +_0800CA60: + cmp r6, 0 + beq _0800CA66 + b _0800CC8A +_0800CA66: + ldr r4, _0800CA98 + 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 + .align 2, 0 +_0800CA98: .4byte 0x03004150 +_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, _0800CACC + ldrb r0, [r4, 0x1E] + movs r1, 0x1 + bl sub_800D30C + movs r0, 0 + strh r0, [r4, 0x1E] + b _0800CC8A + .align 2, 0 +_0800CACC: .4byte 0x03004140 +_0800CAD0: + cmp r6, 0 + beq _0800CAD6 + b _0800CC8A +_0800CAD6: + ldr r2, _0800CB18 + 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 + .align 2, 0 +_0800CB18: .4byte 0x03007890 +_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, _0800CB60 + movs r0, 0x12 + strb r0, [r1, 0x4] +_0800CB3A: + ldr r2, _0800CB60 + 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 + .align 2, 0 +_0800CB60: .4byte 0x03004140 +_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, _0800CB90 + movs r0, 0x13 + strb r0, [r1, 0x4] + movs r0, 0x16 + strb r0, [r1, 0x5] + movs r0, 0x32 + strh r0, [r1, 0x1E] + b _0800CBA8 + .align 2, 0 +_0800CB90: .4byte 0x03004140 +_0800CB94: + ldr r4, _0800CBD0 + strb r6, [r4, 0x5] + strb r6, [r4, 0x4] + ldr r0, _0800CBD4 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bl sub_800D334 + movs r0, 0x33 + strh r0, [r4, 0x1E] +_0800CBA8: + ldr r5, _0800CBD0 + 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 + .align 2, 0 +_0800CBD0: .4byte 0x03004140 +_0800CBD4: .4byte 0x03007890 +_0800CBD8: + cmp r6, 0 + bne _0800CC8A + ldr r5, _0800CC00 + 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 + .align 2, 0 +_0800CC00: .4byte 0x03004140 +_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, _0800CC74 + 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 + .align 2, 0 +_0800CC74: .4byte 0x03007890 +_0800CC78: + cmp r6, 0 + bne _0800CC8A + ldr r0, _0800CC94 + strb r6, [r0, 0x5] + strb r6, [r0, 0x4] + movs r0, 0x42 + movs r1, 0 + bl sub_800D30C +_0800CC8A: + ldr r1, _0800CC94 + movs r0, 0x1 + strb r0, [r1, 0xE] + b _0800CCE6 + .align 2, 0 +_0800CC94: .4byte 0x03004140 +_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, _0800CCFC + 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 + .align 2, 0 +_0800CCFC: .4byte 0x03007890 +_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, _0800CDC4 + 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, _0800CDC4 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0800CD6A + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] +_0800CD6A: + mov r3, sp + ldr r1, _0800CDC4 + ldrb r2, [r1] + ldrb r0, [r1, 0x14] + ands r0, r2 + strb r0, [r3] + movs r3, 0 + adds r7, r1, 0 + ldr r2, _0800CDC8 + 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 + .align 2, 0 +_0800CDC4: .4byte 0x03004140 +_0800CDC8: .4byte 0x03007890 +_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, _0800CE1C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + beq _0800CE3E + movs r0, 0x50 + movs r1, 0 + bl sub_800D30C + b _0800CE3E + .align 2, 0 +_0800CE1C: .4byte 0x03007890 +_0800CE20: + cmp r6, 0 + bne _0800CE42 + ldr r0, _0800CE6C + 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, _0800CE6C + mov r0, r8 + cmp r0, 0x1C + bne _0800CE74 + cmp r6, 0 + beq _0800CE74 + ldrb r0, [r7, 0x7] + cmp r0, 0x4 + bne _0800CE74 + ldr r2, _0800CE70 + 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 + .align 2, 0 +_0800CE6C: .4byte 0x03004140 +_0800CE70: .4byte 0x03007890 +_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, _0800CEE4 + ldrb r7, [r4, 0xE] + movs r0, 0 + strb r0, [r4, 0xE] + movs r0, 0x1 + strb r0, [r4, 0xF] + ldr r0, _0800CEE8 + 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 + .align 2, 0 +_0800CEE4: .4byte 0x03004140 +_0800CEE8: .4byte 0x03007890 +_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, _0800CF30 + 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, _0800CF30 + movs r0, 0 + strb r0, [r1, 0xF] + strb r7, [r1, 0xE] +_0800CF28: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800CF30: .4byte 0x03004140 + 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, _0800CFB8 + 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, _0800CFBC + 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 + .align 2, 0 +_0800CFB8: .4byte 0x03004140 +_0800CFBC: .4byte 0x03007890 +_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, _0800D034 + 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, _0800D038 + cmp r2, r0 + beq _0800D024 + ldr r0, _0800D03C + ldr r0, [r0] + lsls r1, r6, 5 + adds r0, r1 + ldrh r0, [r0, 0x18] + ldr r1, _0800D038 +_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 + .align 2, 0 +_0800D034: .4byte 0x03007880 +_0800D038: .4byte 0x0000ffff +_0800D03C: .4byte 0x03007890 +_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, _0800D114 + 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, _0800D118 + 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, _0800D118 + strh r4, [r0, 0x14] + movs r0, 0x11 + movs r1, 0x1 + bl sub_800D30C +_0800D0AE: + ldr r1, _0800D118 + ldrb r0, [r1, 0xD] + cmp r0, 0 + beq _0800D0EA + movs r5, 0x1 + ldr r0, _0800D11C + 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, _0800D118 + 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, _0800D118 + 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 + .align 2, 0 +_0800D114: .4byte 0x0000ffff +_0800D118: .4byte 0x03004140 +_0800D11C: .4byte 0x03007890 +_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, _0800D1FC + ldrh r0, [r1] + adds r6, r0, 0 + movs r0, 0 + strh r0, [r1] + ldr r4, _0800D200 + 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, _0800D204 + 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, _0800D1FC + strh r6, [r0] + ldr r5, _0800D200 + 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, _0800D208 + 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 + .align 2, 0 +_0800D1FC: .4byte 0x04000208 +_0800D200: .4byte 0x03004140 +_0800D204: .4byte 0x03007880 +_0800D208: .4byte 0x03007890 + thumb_func_end sub_800D158 + + thumb_func_start sub_800D20C +sub_800D20C: @ 800D20C + push {r4,r5,lr} + ldr r5, _0800D260 + ldrb r0, [r5, 0x4] + cmp r0, 0xF + bne _0800D258 + ldr r1, _0800D264 + 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 + .align 2, 0 +_0800D260: .4byte 0x03004140 +_0800D264: .4byte 0x03007880 + thumb_func_end sub_800D20C + + thumb_func_start sub_800D268 +sub_800D268: @ 800D268 + push {lr} + ldr r1, _0800D290 + 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 + .align 2, 0 +_0800D290: .4byte 0x03004140 + 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, _0800D300 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + cmp r6, r0 + bcs _0800D2F0 + mov r8, r0 + ldr r0, _0800D304 + 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, _0800D308 + cmp r2, r1 + beq _0800D2E6 + mov r1, r9 + ldr r0, [r1] + lsls r1, r5, 5 + adds r0, r1 + ldrh r4, [r0, 0x18] + ldr r7, _0800D308 + 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 + .align 2, 0 +_0800D300: .4byte 0x03007890 +_0800D304: .4byte 0x03004140 +_0800D308: .4byte 0x0000ffff + 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, _0800D330 + 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 + .align 2, 0 +_0800D330: .4byte 0x03004140 + 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, _0800D354 + 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 + .align 2, 0 +_0800D354: .4byte 0x03004140 + 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, _0800D424 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0800D3A0 + movs r4, 0 +_0800D36A: + ldr r1, _0800D428 + 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, _0800D424 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _0800D3DE + movs r4, 0 +_0800D3AC: + ldr r1, _0800D428 + 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, _0800D424 + 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, _0800D42C + ldr r6, _0800D430 +_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 + .align 2, 0 +_0800D424: .4byte 0x03007890 +_0800D428: .4byte 0x03007880 +_0800D42C: .4byte 0x03007870 +_0800D430: .4byte 0x00008024 + 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, _0800D520 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _0800D510 + ldr r0, _0800D524 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0800D4D4 + movs r6, 0 +_0800D454: + ldr r3, _0800D528 + 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, _0800D520 + 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, _0800D524 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _0800D510 + movs r6, 0 +_0800D4E0: + ldr r1, _0800D528 + 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, _0800D520 + 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 + .align 2, 0 +_0800D520: .4byte 0x03004140 +_0800D524: .4byte 0x03007890 +_0800D528: .4byte 0x03007880 + thumb_func_end sub_800D434 + + thumb_func_start sub_800D52C +sub_800D52C: @ 800D52C + push {lr} + ldr r1, _0800D53C + str r0, [r1, 0x44] + ldr r0, _0800D540 + bl rfu_setMSCCallback + pop {r0} + bx r0 + .align 2, 0 +_0800D53C: .4byte 0x03004140 +_0800D540: .4byte sub_800CEB0 + 1 + thumb_func_end sub_800D52C + + thumb_func_start sub_800D544 +sub_800D544: @ 800D544 + ldr r1, _0800D54C + str r0, [r1, 0x40] + bx lr + .align 2, 0 +_0800D54C: .4byte 0x03004140 + 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, _0800D574 + 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 + .align 2, 0 +_0800D574: .4byte 0x03004140 +_0800D578: + ldr r2, _0800D590 + 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 + .align 2, 0 +_0800D590: .4byte 0x04000208 + thumb_func_end sub_800D550 + + thumb_func_start sub_800D594 +sub_800D594: @ 800D594 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _0800D5B0 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + ldrb r0, [r0, 0x5] + orrs r0, r1 + cmp r0, 0 + bne _0800D5B8 + ldr r0, _0800D5B4 + strh r2, [r0, 0x18] + movs r0, 0 + b _0800D5C8 + .align 2, 0 +_0800D5B0: .4byte 0x03007890 +_0800D5B4: .4byte 0x03004140 +_0800D5B8: + ldr r1, _0800D5CC + movs r0, 0x6 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x6 +_0800D5C8: + pop {r1} + bx r1 + .align 2, 0 +_0800D5CC: .4byte 0x03004140 + 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, _0800D5F8 + 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 + .align 2, 0 +_0800D5F8: .4byte 0x03004140 +_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, _0800D62C + 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 + .align 2, 0 +_0800D62C: .4byte 0x03004140 + thumb_func_end sub_800D610 + + thumb_func_start sub_800D630 +sub_800D630: @ 800D630 + push {lr} + ldr r1, _0800D644 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _0800D648 + movs r0, 0x45 + movs r1, 0 + bl sub_800D30C + b _0800D654 + .align 2, 0 +_0800D644: .4byte 0x03004140 +_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, _0800D678 + 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, _0800D67C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800D678: .4byte 0x03004140 +_0800D67C: .4byte _0800D680 + .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, _0800D718 + 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, _0800D71C + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, _0800D720 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800D718: .4byte 0x000008c1 +_0800D71C: .4byte 0x000008c2 +_0800D720: .4byte 0x000008c3 + 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, _0800D774 + 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, _0800D778 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, _0800D77C + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800D774: .4byte 0x00000231 +_0800D778: .4byte 0x00000232 +_0800D77C: .4byte 0x00000233 + 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, _0800D7CC + 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, _0800D7D0 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, _0800D7D4 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800D7CC: .4byte 0x00000201 +_0800D7D0: .4byte 0x00000202 +_0800D7D4: .4byte 0x00000203 + 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, _0800D86C + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1F + bhi _0800D874 + ldr r0, _0800D870 + 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, _0800D86C + 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, _0800D870 + strh r7, [r0] + b _0800D87E + .align 2, 0 +_0800D86C: .4byte 0x000008c2 +_0800D870: .4byte 0x04000208 +_0800D874: + ldr r1, _0800D884 + adds r0, r3, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] +_0800D87E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800D884: .4byte 0x000008c3 + 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, _0800D918 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0x27 + bhi _0800D920 + ldr r1, _0800D91C + 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, _0800D918 + 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, _0800D91C + strh r7, [r0] + b _0800D92A + .align 2, 0 +_0800D918: .4byte 0x00000232 +_0800D91C: .4byte 0x04000208 +_0800D920: + ldr r1, _0800D930 + adds r0, r6, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] +_0800D92A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800D930: .4byte 0x00000233 + 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, _0800D978 + ldrh r0, [r1] + mov r12, r0 + movs r0, 0 + strh r0, [r1] + movs r1, 0x8C + lsls r1, 4 + adds r0, r3, r1 + ldr r7, _0800D97C + adds r5, r3, r7 + ldrb r1, [r0] + ldrb r0, [r5] + cmp r1, r0 + beq _0800D960 + ldr r1, _0800D980 + 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, _0800D978 + mov r7, r12 + strh r7, [r0] + movs r0, 0 + b _0800D9CA + .align 2, 0 +_0800D978: .4byte 0x04000208 +_0800D97C: .4byte 0x000008c1 +_0800D980: .4byte 0x000008c3 +_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, _0800D9D0 + 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, _0800D9D4 + adds r1, r3, r7 + ldrb r0, [r1] + subs r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, _0800D9D8 + mov r1, r12 + strh r1, [r0] + movs r0, 0x1 +_0800D9CA: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800D9D0: .4byte 0x000008c1 +_0800D9D4: .4byte 0x000008c2 +_0800D9D8: .4byte 0x04000208 + 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, _0800DA04 + adds r0, r5, r1 + ldrb r0, [r0] + adds r2, r0, 0 + cmp r2, 0 + beq _0800DA08 +_0800DA00: + movs r0, 0 + b _0800DA54 + .align 2, 0 +_0800DA04: .4byte 0x00000233 +_0800DA08: + ldr r1, _0800DA5C + 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, _0800DA60 + 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, _0800DA64 + adds r1, r5, r0 + ldrb r0, [r1] + subs r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, _0800DA5C + strh r7, [r0] + movs r0, 0x1 +_0800DA54: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800DA5C: .4byte 0x04000208 +_0800DA60: .4byte 0x00000231 +_0800DA64: .4byte 0x00000232 + 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, _0800DB6C + 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, _0800DB6C + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + b _0800DB7A + .align 2, 0 +_0800DB6C: .4byte 0x00000202 +_0800DB70: + ldr r1, _0800DB80 + adds r0, r3, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] +_0800DB7A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800DB80: .4byte 0x00000203 + 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, _0800DBAC + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800DBB0 +_0800DBA6: + movs r0, 0 + b _0800DBEA + .align 2, 0 +_0800DBAC: .4byte 0x00000203 +_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, _0800DBF0 + 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, _0800DBF4 + 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 + .align 2, 0 +_0800DBF0: .4byte 0x00000201 +_0800DBF4: .4byte 0x00000202 + 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, _0800DCB0 + 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 + .align 2, 0 +_0800DCB0: .4byte 0x03000d74 + 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, _0800DCE4 + 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 + .align 2, 0 +_0800DCE4: .4byte 0x082ed470 + 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, _0800DD18 + 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 + .align 2, 0 +_0800DD18: .4byte 0x082ed370 + 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, _0800DD44 + 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 + .align 2, 0 +_0800DD44: .4byte 0x03007890 +_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, _0800DE70 + 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, _0800DE74 + bl flag_check + 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, _0800DE78 + bl flag_check + 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 + .align 2, 0 +_0800DE70: .4byte 0x03005d90 +_0800DE74: .4byte 0x0000087f +_0800DE78: .4byte 0x00000864 + 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, _0800DED0 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0800DED8 + movs r0, 0x1 + mov r9, r0 + ldr r6, _0800DED4 + 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 + .align 2, 0 +_0800DED0: .4byte 0x03004140 +_0800DED4: .4byte 0x03007890 +_0800DED8: + movs r0, 0 + mov r9, r0 + ldr r6, _0800DF0C + 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 + .align 2, 0 +_0800DF0C: .4byte 0x03007890 +_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, _0800DF6C + ldr r0, [r6] + lsrs r4, r2, 19 + adds r2, r0, r4 + ldrh r1, [r2, 0x18] + ldr r0, _0800DF70 + 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 + .align 2, 0 +_0800DF6C: .4byte 0x03007890 +_0800DF70: .4byte 0x00007f7d +_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, _0800DFAC + movs r2, 0xD + bl memcpy + ldr r1, _0800DFB0 + adds r0, r4, 0 + movs r2, 0x8 + bl memcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800DFAC: .4byte 0x02022b14 +_0800DFB0: .4byte 0x02022b22 + 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, _0800E00C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800E024 + ldr r0, _0800E010 + adds r1, r3, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _0800E014 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r4, r0 + ldr r0, _0800E018 + strh r0, [r4, 0x3C] + ldr r0, _0800E01C + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_tag_get_range_start + strh r0, [r4, 0x3A] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldr r0, _0800E020 + strb r5, [r0] + b _0800E06A + .align 2, 0 +_0800E00C: .4byte 0x03007890 +_0800E010: .4byte 0x082ed5f0 +_0800E014: .4byte 0x02020630 +_0800E018: .4byte 0x00001234 +_0800E01C: .4byte 0x082ed5e0 +_0800E020: .4byte 0x02022b10 +_0800E024: + ldr r0, _0800E070 + adds r1, r3, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r4, _0800E074 + strb r0, [r4] + ldr r5, _0800E078 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0800E07C + strh r1, [r0, 0x3C] + ldr r0, _0800E080 + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_tag_get_range_start + 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 + .align 2, 0 +_0800E070: .4byte 0x082ed5f0 +_0800E074: .4byte 0x02022b10 +_0800E078: .4byte 0x02020630 +_0800E07C: .4byte 0x00001234 +_0800E080: .4byte 0x082ed5e0 + thumb_func_end sub_800DFB4 + + thumb_func_start sub_800E084 +sub_800E084: @ 800E084 + push {r4,lr} + ldr r4, _0800E0D0 + ldr r3, _0800E0D4 + 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, _0800E0D8 + 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 obj_delete_and_free_tiles + ldr r3, _0800E0DC + movs r0, 0x84 + lsls r0, 3 + adds r3, r0 + ldr r0, _0800E0E0 + ldr r1, [r0] + ldr r2, [r0, 0x4] + str r1, [r3] + str r2, [r3, 0x4] + ldr r1, _0800E0E4 + movs r2, 0x4 + bl CpuSet +_0800E0CA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800E0D0: .4byte 0x02020630 +_0800E0D4: .4byte 0x02022b10 +_0800E0D8: .4byte 0x00001234 +_0800E0DC: .4byte 0x030022c0 +_0800E0E0: .4byte 0x082ec690 +_0800E0E4: .4byte 0x070003e8 + thumb_func_end sub_800E084 + + thumb_func_start sub_800E0E8 +sub_800E0E8: @ 800E0E8 + push {r4,lr} + ldr r4, _0800E114 + ldrh r0, [r4, 0x6] + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + ldr r1, _0800E118 + cmp r0, r1 + bne _0800E100 + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load +_0800E100: + ldr r0, _0800E11C + bl gpu_pal_obj_alloc_tag_and_apply + ldr r1, _0800E120 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800E114: .4byte 0x082ed5e0 +_0800E118: .4byte 0xffff0000 +_0800E11C: .4byte 0x082ed5e8 +_0800E120: .4byte 0x02022b10 + thumb_func_end sub_800E0E8 + + thumb_func_start sub_800E124 +sub_800E124: @ 800E124 + push {r4,lr} + ldr r1, _0800E144 + 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 + .align 2, 0 +_0800E144: .4byte 0x03007890 +_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, _0800E1B8 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0800E184 + b _0800E346 +_0800E184: + ldr r2, _0800E1BC + 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, _0800E1C0 + cmp r1, r0 + beq _0800E19C + b _0800E346 +_0800E19C: + adds r6, r2, 0 + movs r5, 0xFF + movs r4, 0 + ldr r0, _0800E1C4 + 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 + .align 2, 0 +_0800E1B8: .4byte 0x02022b10 +_0800E1BC: .4byte 0x02020630 +_0800E1C0: .4byte 0x00001234 +_0800E1C4: .4byte 0x03007890 +_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, _0800E350 + movs r1, 0x84 + lsls r1, 3 + adds r0, r4, r1 + ldr r1, _0800E354 + 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, _0800E358 + adds r5, r4, r1 + ldr r3, _0800E35C + adds r1, r3, 0 + ands r2, r1 + ldrh r3, [r5] + ldr r1, _0800E360 + 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, _0800E364 + 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, _0800E368 + adds r4, r1 + ldr r3, _0800E36C + adds r1, r3, 0 + ands r2, r1 + ldrh r3, [r4] + ldr r1, _0800E370 + ands r1, r3 + orrs r1, r2 + strh r1, [r4] + ldr r1, _0800E374 + 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 + .align 2, 0 +_0800E350: .4byte 0x030022c0 +_0800E354: .4byte 0x082ed570 +_0800E358: .4byte 0x00000422 +_0800E35C: .4byte 0x000001ff +_0800E360: .4byte 0xfffffe00 +_0800E364: .4byte 0x00000425 +_0800E368: .4byte 0x00000424 +_0800E36C: .4byte 0x000003ff +_0800E370: .4byte 0xfffffc00 +_0800E374: .4byte 0x070003e8 + thumb_func_end sub_800E174 + + thumb_func_start sub_800E378 +sub_800E378: @ 800E378 + push {lr} + stm r0!, {r1} + adds r1, r2, 0 + bl gf_strcpy + 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, _0800E3CC + ldrb r0, [r0] + cmp r0, 0 + bne _0800E3BE + b _0800E520 +_0800E3BE: + movs r0, 0xF0 + bl malloc_and_clear + str r0, [sp, 0x14] + movs r4, 0 + b _0800E434 + .align 2, 0 +_0800E3CC: .4byte 0x030030fc +_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, _0800E450 + mov r10, r7 + ldr r6, _0800E454 + movs r4, 0 + mov r0, r10 + subs r0, 0x4 + ldr r1, [sp, 0x1C] + adds r3, r1, r0 +_0800E3FC: + ldrh r1, [r3] + ldr r0, _0800E458 + ldr r2, [r0] + ldr r7, _0800E454 + 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 sub_8008C44 + 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 + .align 2, 0 +_0800E450: .4byte 0x020229f0 +_0800E454: .4byte 0x00003b98 +_0800E458: .4byte 0x03005d8c +_0800E45C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0800E4A6 + ldr r2, _0800E530 + 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, _0800E534 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldr r1, _0800E538 + 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, _0800E534 + mov r9, r1 + ldr r6, _0800E53C + 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, _0800E53C + 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, _0800E534 + ldr r0, [r0] + ldr r7, _0800E53C + 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 + .align 2, 0 +_0800E530: .4byte 0x020229e8 +_0800E534: .4byte 0x03005d8c +_0800E538: .4byte 0x00003b9c +_0800E53C: .4byte 0x00003b98 + 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, _0800E57C + ldr r4, _0800E580 + movs r5, 0 +_0800E558: + ldr r0, [r6] + adds r0, r4 + adds r0, 0x4 + mov r1, r9 + bl sub_8008C44 + cmp r0, 0 + bne _0800E584 + ldr r0, [r6] + ldr r1, _0800E580 + adds r0, r1 + adds r0, r5 + ldr r0, [r0] + cmp r0, r8 + bne _0800E584 + movs r0, 0x1 + b _0800E59E + .align 2, 0 +_0800E57C: .4byte 0x03005d8c +_0800E580: .4byte 0x00003b98 +_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, _0800E5F0 + mov r8, r0 + movs r7, 0 + mov r6, r8 + movs r5, 0 + movs r4, 0x13 +_0800E5C0: + ldr r0, _0800E5F4 + 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, _0800E5F8 + 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 + .align 2, 0 +_0800E5F0: .4byte 0x00003b98 +_0800E5F4: .4byte 0x03005d8c +_0800E5F8: .4byte 0x01000004 + 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, _0800E6A8 + adds r5, r6, 0 + adds r5, 0xEE + ldrb r4, [r5] + mov r0, sp + movs r7, 0 + strh r7, [r0] + ldr r2, _0800E6AC + 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, _0800E6B0 + adds r0, r4, 0 + bl sub_800FCC4 + adds r0, r4, 0 + adds r0, 0xB8 + bl sub_800D6C8 + ldr r0, _0800E6B4 + adds r4, r0 + adds r0, r4, 0 + bl sub_800D724 + strh r5, [r7] + ldr r1, _0800E6B8 + ldr r2, _0800E6BC + adds r0, r7, 0 + bl CpuSet + mov r0, r8 + strh r5, [r0] + ldr r1, _0800E6C0 + ldr r2, _0800E6C4 + bl CpuSet + mov r0, r9 + strh r5, [r0] + ldr r1, _0800E6C8 + ldr r2, _0800E6CC + bl CpuSet + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800E6A8: .4byte 0x03005000 +_0800E6AC: .4byte 0x0100067a +_0800E6B0: .4byte 0x0300506c +_0800E6B4: .4byte 0x0000097c +_0800E6B8: .4byte 0x03003110 +_0800E6BC: .4byte 0x01000008 +_0800E6C0: .4byte 0x03003090 +_0800E6C4: .4byte 0x01000028 +_0800E6C8: .4byte 0x020229e8 +_0800E6CC: .4byte 0x01000046 + thumb_func_end sub_800E604 + + thumb_func_start sub_800E6D0 +sub_800E6D0: @ 800E6D0 + push {r4-r6,lr} + ldr r4, _0800E6F8 + ldr r5, [r4, 0x4] + ldr r6, [r4, 0x8] + bl sub_800E700 + bl rfu_REQ_stopMode + bl rfu_waitREQComplete + ldr r1, _0800E6FC + 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 + .align 2, 0 +_0800E6F8: .4byte 0x03002710 +_0800E6FC: .4byte 0x04000208 + thumb_func_end sub_800E6D0 + + thumb_func_start sub_800E700 +sub_800E700: @ 800E700 + push {r4,lr} + ldr r0, _0800E738 + ldr r1, _0800E73C + ldr r4, _0800E740 + adds r2, r4, 0 + movs r3, 0x1 + bl rfu_initializeAPI + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _0800E732 + ldr r0, _0800E744 + 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 + .align 2, 0 +_0800E738: .4byte 0x03004190 +_0800E73C: .4byte 0x00000e64 +_0800E740: .4byte 0x03002714 +_0800E744: .4byte 0x020229c6 + 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, _0800E768 + ldrh r0, [r0, 0x4] + cmp r0, 0x12 + bls _0800E75C + b _0800E862 +_0800E75C: + lsls r0, 2 + ldr r1, _0800E76C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800E768: .4byte 0x03005000 +_0800E76C: .4byte _0800E770 + .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, _0800E7D8 + bl sub_800BFCC + ldr r0, _0800E7DC + movs r2, 0x1 + strh r2, [r0, 0x4] + ldr r1, _0800E7E0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0xA] + b _0800E862 + .align 2, 0 +_0800E7D8: .4byte 0x02022b2c +_0800E7DC: .4byte 0x03005000 +_0800E7E0: .4byte 0x03005e00 +_0800E7E4: + ldr r4, _0800E808 + ldrb r0, [r4, 0xC] + ldr r3, _0800E80C + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + movs r0, 0x3 + strh r0, [r4, 0x4] + ldr r1, _0800E810 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0xA] + b _0800E862 + .align 2, 0 +_0800E808: .4byte 0x03005000 +_0800E80C: .4byte 0x082ed6e0 +_0800E810: .4byte 0x03005e00 +_0800E814: + movs r0, 0 + bl sub_800C27C + ldr r1, _0800E824 + movs r0, 0x5 + strh r0, [r1, 0x4] + b _0800E862 + .align 2, 0 +_0800E824: .4byte 0x03005000 +_0800E828: + ldr r4, _0800E868 + ldr r0, _0800E86C + adds r1, r4, r0 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, _0800E870 + bl sub_800D52C + bl sub_800EAB4 + bl sub_800EAFC + movs r0, 0x14 + strh r0, [r4, 0x4] + ldr r1, _0800E874 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0xA] + ldr r0, _0800E878 + movs r1, 0x5 + bl AddTask + adds r0, r5, 0 + bl remove_task +_0800E862: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800E868: .4byte 0x03005000 +_0800E86C: .4byte 0x00000cdb +_0800E870: .4byte sub_800EDBC + 1 +_0800E874: .4byte 0x03005e00 +_0800E878: .4byte sub_801084C + 1 + thumb_func_end sub_800E748 + + thumb_func_start sub_800E87C +sub_800E87C: @ 800E87C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0800E888 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800E888: .4byte 0x082ed6a5 + 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, _0800E8C8 +_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 + .align 2, 0 +_0800E8C8: .4byte 0x03005cde +_0800E8CC: + movs r3, 0 + mvns r0, r1 + mov r12, r0 + movs r7, 0x1 + ldr r4, _0800E948 +_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, _0800E948 + ldrb r7, [r0] +_0800E8F4: + movs r3, 0 + subs r1, r4, 0x1 + cmp r7, r4 + beq _0800E910 + ldr r2, _0800E948 +_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, _0800E948 +_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 + .align 2, 0 +_0800E948: .4byte 0x03005cde + 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, _0800E968 + ldrh r3, [r0, 0x4] + adds r7, r0, 0 + cmp r3, 0xC + bls _0800E95E + b _0800EA9A +_0800E95E: + lsls r0, r3, 2 + ldr r1, _0800E96C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800E968: .4byte 0x03005000 +_0800E96C: .4byte _0800E970 + .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, _0800E9B4 + bl sub_800BFCC + ldr r0, _0800E9B8 + movs r2, 0x1 + strh r2, [r0, 0x4] + b _0800E9CC + .align 2, 0 +_0800E9B4: .4byte 0x082ed608 +_0800E9B8: .4byte 0x03005000 +_0800E9BC: + ldrb r0, [r7, 0xC] + ldr r3, _0800E9DC + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + movs r2, 0x7 + strh r2, [r7, 0x4] +_0800E9CC: + ldr r1, _0800E9E0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0xA] + b _0800EA9A + .align 2, 0 +_0800E9DC: .4byte 0x082ed6e0 +_0800E9E0: .4byte 0x03005e00 +_0800E9E4: + ldr r0, _0800E9F4 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0xA + strh r0, [r1, 0xA] + b _0800EA9A + .align 2, 0 +_0800E9F4: .4byte 0x03005e00 +_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, _0800EA18 + movs r0, 0xC + strh r0, [r1, 0x4] + b _0800EA9A + .align 2, 0 +_0800EA18: .4byte 0x03005000 +_0800EA1C: + bl sub_800D630 + ldr r0, _0800EA34 + ldr r1, _0800EA38 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + adds r0, r6, 0 + bl remove_task + b _0800EA9A + .align 2, 0 +_0800EA34: .4byte 0x03005000 +_0800EA38: .4byte 0x00000ce4 +_0800EA3C: + ldr r0, _0800EAA0 + 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, _0800EAA4 + 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, _0800EAA8 + 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, _0800EAAC + 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, _0800EAB0 + movs r1, 0x5 + bl AddTask +_0800EA9A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800EAA0: .4byte 0x00000c3e +_0800EAA4: .4byte 0x00000c3f +_0800EAA8: .4byte 0x03005e00 +_0800EAAC: .4byte 0x02022b44 +_0800EAB0: .4byte sub_801084C + 1 + thumb_func_end sub_800E94C + + thumb_func_start sub_800EAB4 +sub_800EAB4: @ 800EAB4 + push {r4,r5,lr} + ldr r0, _0800EAF4 + 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, _0800EAF8 + 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 + .align 2, 0 +_0800EAF4: .4byte 0x03004140 +_0800EAF8: .4byte 0x03005014 + thumb_func_end sub_800EAB4 + + thumb_func_start sub_800EAFC +sub_800EAFC: @ 800EAFC + push {r4-r6,lr} + ldr r0, _0800EB38 + ldrb r5, [r0] + ldr r4, _0800EB3C + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x46 + bl rfu_UNI_setSendData + adds r0, r5, 0 + bl sub_800E87C + ldr r1, _0800EB40 + 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 + .align 2, 0 +_0800EB38: .4byte 0x03004140 +_0800EB3C: .4byte 0x03005c87 +_0800EB40: .4byte 0xfffff379 + 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, _0800EB90 + ldrb r0, [r0] + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + movs r0, 0 + movs r1, 0 + bl sub_8011A64 +_0800EB78: + ldr r0, _0800EB94 + ldrh r2, [r0, 0x4] + adds r6, r0, 0 + cmp r2, 0x12 + bls _0800EB84 + b _0800ECF4 +_0800EB84: + lsls r0, r2, 2 + ldr r1, _0800EB98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800EB90: .4byte 0x03004140 +_0800EB94: .4byte 0x03005000 +_0800EB98: .4byte _0800EB9C + .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, _0800EC04 + bl sub_800BFCC + ldr r0, _0800EC08 + movs r2, 0x1 + strh r2, [r0, 0x4] + ldr r1, _0800EC0C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0xA] + b _0800ECF4 + .align 2, 0 +_0800EC04: .4byte 0x02022b2c +_0800EC08: .4byte 0x03005000 +_0800EC0C: .4byte 0x03005e00 +_0800EC10: + ldr r3, _0800EC2C + movs r0, 0x2 + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + ldr r0, _0800EC30 + bl sub_800D52C + ldr r1, _0800EC34 + movs r0, 0x12 + strh r0, [r1, 0x4] + b _0800ECF4 + .align 2, 0 +_0800EC2C: .4byte 0x082ed6e0 +_0800EC30: .4byte sub_800ED34 + 1 +_0800EC34: .4byte 0x03005000 +_0800EC38: + ldr r1, _0800EC7C + 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, _0800EC80 + 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, _0800EC84 + movs r1, 0x1 + bl AddTask + b _0800ECF4 + .align 2, 0 +_0800EC7C: .4byte 0x00000c3e +_0800EC80: .4byte 0x03005e00 +_0800EC84: .4byte sub_8010D0C + 1 +_0800EC88: + ldr r0, _0800EC94 + movs r1, 0x5 + bl AddTask + b _0800ECF4 + .align 2, 0 +_0800EC94: .4byte sub_801084C + 1 +_0800EC98: + movs r0, 0 + bl sub_800C27C + ldr r1, _0800ECA8 + movs r0, 0xF + strh r0, [r1, 0x4] + b _0800ECF4 + .align 2, 0 +_0800ECA8: .4byte 0x03005000 +_0800ECAC: + ldr r0, _0800ECFC + adds r1, r6, r0 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, _0800ED00 + bl sub_800D52C + movs r0, 0x1 + bl sub_8011068 + bl sub_800EAB4 + bl sub_800EAFC + movs r0, 0x14 + strh r0, [r6, 0x4] + ldr r1, _0800ED04 + 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, _0800ED08 + movs r1, 0x5 + bl AddTask + ldr r1, _0800ED0C + adds r0, r6, r1 + strb r4, [r0] + adds r0, r5, 0 + bl remove_task +_0800ECF4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800ECFC: .4byte 0x00000cdb +_0800ED00: .4byte sub_800EDBC + 1 +_0800ED04: .4byte 0x03005e00 +_0800ED08: .4byte sub_801084C + 1 +_0800ED0C: .4byte 0x00000ce8 + thumb_func_end sub_800EB44 + + thumb_func_start sub_800ED10 +sub_800ED10: @ 800ED10 + push {lr} + ldr r3, _0800ED24 + movs r0, 0x1 + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + pop {r0} + bx r0 + .align 2, 0 +_0800ED24: .4byte 0x082ed6e0 + 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, _0800EDA8 + 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, _0800EDAC + ldr r3, _0800EDA8 + ldr r0, _0800EDB0 + 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, _0800EDB4 + adds r1, r3, r2 + bl sub_800D7D8 + ldr r1, _0800EDB8 + 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 + .align 2, 0 +_0800EDA8: .4byte 0x03005000 +_0800EDAC: .4byte 0x03007870 +_0800EDB0: .4byte 0x00000c3e +_0800EDB4: .4byte 0x00000c3f +_0800EDB8: .4byte 0x02022b44 + thumb_func_end sub_800ED34 + + thumb_func_start sub_800EDBC +sub_800EDBC: @ 800EDBC + ldr r0, _0800EDCC + ldr r1, _0800EDD0 + adds r0, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_0800EDCC: .4byte 0x03005000 +_0800EDD0: .4byte 0x00000cdb + thumb_func_end sub_800EDBC + + thumb_func_start sub_800EDD4 +sub_800EDD4: @ 800EDD4 + push {r4-r6,lr} + bl sub_800C048 + ldr r4, _0800EDE8 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + bne _0800EDF0 + ldr r0, _0800EDEC + b _0800EDF6 + .align 2, 0 +_0800EDE8: .4byte 0x03005000 +_0800EDEC: .4byte sub_800E748 + 1 +_0800EDF0: + cmp r0, 0 + bne _0800EE18 + ldr r0, _0800EE14 +_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 + .align 2, 0 +_0800EE14: .4byte sub_800E94C + 1 +_0800EE18: + cmp r0, 0x2 + bne _0800EE38 + ldr r0, _0800EE70 + 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, _0800EE74 +_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 + .align 2, 0 +_0800EE70: .4byte sub_800EB44 + 1 +_0800EE74: .4byte 0x082ed7e0 + thumb_func_end sub_800EDD4 + + thumb_func_start sub_800EE78 +sub_800EE78: @ 800EE78 + push {lr} + ldr r0, _0800EE8C + movs r1, 0x1 + bl AddTask + ldr r1, _0800EE90 + adds r1, 0x67 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0800EE8C: .4byte sub_800E748 + 1 +_0800EE90: .4byte 0x03005000 + thumb_func_end sub_800EE78 + + thumb_func_start sub_800EE94 +sub_800EE94: @ 800EE94 + push {lr} + ldr r1, _0800EEAC + ldrh r0, [r1, 0x4] + cmp r0, 0x7 + bne _0800EEB4 + ldr r2, _0800EEB0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0800EEB4 + movs r0, 0x1 + b _0800EEB6 + .align 2, 0 +_0800EEAC: .4byte 0x03005000 +_0800EEB0: .4byte 0x00000ccd +_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, _0800EEEC + ldrh r0, [r4, 0x4] + cmp r0, 0x7 + bne _0800EEF8 + ldr r0, _0800EEF0 + ldr r1, [r0] + ldr r2, _0800EEF4 + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 5 + adds r1, r0 + ldrh r0, [r1, 0x14] + movs r1, 0xF0 + bl mega_func_4 + lsls r0, 24 + cmp r0, 0 + bne _0800EEF8 + movs r0, 0x9 + strh r0, [r4, 0x4] + movs r0, 0x1 + b _0800EEFA + .align 2, 0 +_0800EEEC: .4byte 0x03005000 +_0800EEF0: .4byte 0x03007890 +_0800EEF4: .4byte 0x00000c3d +_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, _0800EF14 + movs r1, 0x1 + bl AddTask + ldr r1, _0800EF18 + adds r1, 0x67 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0800EF14: .4byte sub_800E94C + 1 +_0800EF18: .4byte 0x03005000 + thumb_func_end sub_800EF00 + + thumb_func_start sub_800EF1C +sub_800EF1C: @ 800EF1C + push {lr} + ldr r0, _0800EF2C + ldrb r0, [r0] + cmp r0, 0 + bne _0800EF30 + movs r0, 0 + b _0800EF32 + .align 2, 0 +_0800EF2C: .4byte 0x03004140 +_0800EF30: + movs r0, 0x1 +_0800EF32: + pop {r1} + bx r1 + thumb_func_end sub_800EF1C + + thumb_func_start sub_800EF38 +sub_800EF38: @ 800EF38 + ldr r1, _0800EF4C + movs r0, 0x4 + strh r0, [r1, 0x4] + ldr r0, _0800EF50 + ldrb r0, [r0] + ldr r2, _0800EF54 + adds r1, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_0800EF4C: .4byte 0x03005000 +_0800EF50: .4byte 0x03004140 +_0800EF54: .4byte 0x00000ce7 + thumb_func_end sub_800EF38 + + thumb_func_start sub_800EF58 +sub_800EF58: @ 800EF58 + push {lr} + adds r1, r0, 0 + ldr r2, _0800EF70 + 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 + .align 2, 0 +_0800EF70: .4byte 0x03005000 +_0800EF74: + movs r0, 0 +_0800EF76: + pop {r1} + bx r1 + thumb_func_end sub_800EF58 + + thumb_func_start sub_800EF7C +sub_800EF7C: @ 800EF7C + ldr r1, _0800EF84 + movs r0, 0xE + strh r0, [r1, 0x4] + bx lr + .align 2, 0 +_0800EF84: .4byte 0x03005000 + 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, _0800F004 + ldr r0, _0800F008 + adds r6, r7, 0 + ldr r1, _0800F00C + 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, _0800F010 + mov r0, sp + adds r1, r7, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F004: .4byte 0x03003090 +_0800F008: .4byte 0x03005000 +_0800F00C: .4byte 0x00000c87 +_0800F010: .4byte 0x01000028 + thumb_func_end sub_800EFB0 + + thumb_func_start sub_800F014 +sub_800F014: @ 800F014 + push {lr} + ldr r3, _0800F040 + ldr r2, _0800F044 + 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, _0800F040 + 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 + .align 2, 0 +_0800F040: .4byte 0x03003110 +_0800F044: .4byte 0x03003090 + thumb_func_end sub_800F014 + + thumb_func_start sub_800F048 +sub_800F048: @ 800F048 + push {r4,r5,lr} + ldr r4, _0800F0A4 + ldr r0, _0800F0A8 + adds r5, r4, r0 + ldrb r0, [r5] + cmp r0, 0 + beq _0800F07A + ldr r1, _0800F0AC + adds r0, r4, r1 + adds r1, r4, 0 + adds r1, 0x4C + bl sub_800DAC8 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0800F0B0 + 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, _0800F0A4 + ldr r1, _0800F0A8 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0800F09E + ldr r1, _0800F0B4 + adds r0, r5, r1 + adds r4, r5, 0 + adds r4, 0x4C + adds r1, r4, 0 + bl sub_800D9DC + ldr r1, _0800F0AC + adds r0, r5, r1 + adds r1, r4, 0 + bl sub_800DA68 +_0800F09E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800F0A4: .4byte 0x03005000 +_0800F0A8: .4byte 0x00000c3c +_0800F0AC: .4byte 0x00000c1c +_0800F0B0: .4byte 0x00000c3a +_0800F0B4: .4byte 0x000009e8 + thumb_func_end sub_800F048 + + thumb_func_start sub_800F0B8 +sub_800F0B8: @ 800F0B8 + push {r4,lr} + ldr r0, _0800F0C8 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0800F0CC +_0800F0C4: + movs r0, 0 + b _0800F0EC + .align 2, 0 +_0800F0C8: .4byte 0x03007890 +_0800F0CC: + movs r3, 0 + ldr r4, _0800F0F4 +_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 + .align 2, 0 +_0800F0F4: .4byte 0x03003090 + thumb_func_end sub_800F0B8 + + thumb_func_start sub_800F0F8 +sub_800F0F8: @ 800F0F8 + push {r4-r6,lr} + ldr r6, _0800F114 + 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 + .align 2, 0 +_0800F114: .4byte 0x03005000 +_0800F118: + ldr r0, _0800F174 + adds r1, r6, r0 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, _0800F178 + adds r1, r6, r0 + ldr r0, _0800F17C + 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, _0800F180 + adds r0, r6, r1 + ldrb r0, [r0] + adds r5, r0, 0 + cmp r5, 0 + bne _0800F1C8 + ldr r0, _0800F184 + adds r4, r6, r0 + ldrb r0, [r4] + cmp r0, 0 + beq _0800F1A8 + bl sub_8011D6C + strb r5, [r4] + ldr r1, _0800F188 + 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 + .align 2, 0 +_0800F174: .4byte 0x00000cdb +_0800F178: .4byte 0x00000ce2 +_0800F17C: .4byte 0x03007890 +_0800F180: .4byte 0x00000cdc +_0800F184: .4byte 0x00000ce3 +_0800F188: .4byte 0x00000ce4 +_0800F18C: + ldr r0, _0800F1A0 + ldrb r4, [r0] + cmp r4, 0 + bne _0800F1A8 + bl sub_800EDD4 + ldr r0, _0800F1A4 + strb r4, [r0] + b _0800F1D2 + .align 2, 0 +_0800F1A0: .4byte 0x03004140 +_0800F1A4: .4byte 0x03003124 +_0800F1A8: + bl sub_800EFB0 + ldr r0, _0800F1C0 + ldr r1, _0800F1C4 + adds r0, r1 + ldrb r0, [r0] + bl rfu_UNI_readySendData + movs r0, 0x1 + bl rfu_REQ_sendData_wrapper + b _0800F1CC + .align 2, 0 +_0800F1C0: .4byte 0x03005000 +_0800F1C4: .4byte 0x00000cda +_0800F1C8: + bl rfu_REQ_PARENT_resumeRetransmitAndChange +_0800F1CC: + ldr r1, _0800F1DC + movs r0, 0x1 + strb r0, [r1, 0xE] +_0800F1D2: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0800F1DC: .4byte 0x03005000 + 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, _0800F2C0 + 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, _0800F2C4 + 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, _0800F2C8 + ldr r4, _0800F2C0 + ldr r1, _0800F2CC + adds r0, r4, r1 + ldrb r1, [r2, 0x3] + ldrb r0, [r0] + ands r1, r0 + cmp r1, r0 + beq _0800F23C + b _0800F444 +_0800F23C: + ldr r6, _0800F2D0 + adds r1, r4, r6 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, _0800F2D4 + 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, _0800F2C0 + 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, _0800F2D8 + 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, _0800F2DC + 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 + .align 2, 0 +_0800F2C0: .4byte 0x03005000 +_0800F2C4: .4byte 0x00000cdb +_0800F2C8: .4byte 0x03004140 +_0800F2CC: .4byte 0x00000ce2 +_0800F2D0: .4byte 0x00000cdc +_0800F2D4: .4byte 0x02022b44 +_0800F2D8: .4byte 0x00000cee +_0800F2DC: .4byte 0x00000cea +_0800F2E0: + ldr r2, _0800F420 + ldr r6, _0800F424 + 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, _0800F420 + 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, _0800F428 + 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, _0800F42C + 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, _0800F420 + ldr r1, _0800F430 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800F452 + ldr r2, _0800F434 + adds r0, r4, r2 + ldrb r2, [r0] + cmp r2, 0 + bne _0800F452 + ldr r0, _0800F438 + ldrb r1, [r0, 0xE] + strb r2, [r0, 0xE] + ldr r6, _0800F43C + 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, _0800F430 + 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, _0800F440 + movs r1, 0 + bl AddTask + b _0800F452 + .align 2, 0 +_0800F420: .4byte 0x03005000 +_0800F424: .4byte 0x00000cee +_0800F428: .4byte 0x03005cde +_0800F42C: .4byte 0x03003090 +_0800F430: .4byte 0x00000ce5 +_0800F434: .4byte 0x00000cd9 +_0800F438: .4byte 0x02022b44 +_0800F43C: .4byte 0x00000cda +_0800F440: .4byte sub_8010AAC + 1 +_0800F444: + ldr r2, _0800F474 + adds r1, r4, r2 + ldrb r0, [r1] + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + strb r2, [r4, 0xE] +_0800F452: + ldr r1, _0800F478 + movs r0, 0 + strb r0, [r1, 0xE] + adds r6, r1, 0 +_0800F45A: + ldr r1, _0800F474 + adds r0, r6, r1 + ldrb r0, [r0] + adds r1, r0, 0 + ldr r0, _0800F47C + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800F484 + movs r0, 0x1 + ands r0, r1 + b _0800F486 + .align 2, 0 +_0800F474: .4byte 0x00000cdc +_0800F478: .4byte 0x03005000 +_0800F47C: .4byte 0x03007890 +_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, _0800F4D8 + 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 + .align 2, 0 +_0800F4D8: .4byte 0x03005000 +_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, _0800F614 + mov r1, sp + bl sub_800D934 + movs r1, 0 + ldr r0, _0800F618 + 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, _0800F61C + ldrb r0, [r0, 0x2] + cmp r0, 0 + bne _0800F5C0 + ldr r0, _0800F620 + ldr r2, _0800F624 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0800F5C0 + ldr r0, _0800F628 + 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, _0800F62C + movs r0, 0 + strb r0, [r1] + ldr r0, _0800F620 + movs r5, 0 + str r5, [r0] + ldr r7, _0800F624 + 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, _0800F61C + strb r5, [r0, 0x5] + strb r5, [r0, 0x4] + strb r5, [r6] +_0800F5C0: + ldr r6, _0800F620 + 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, _0800F630 + add r4, sp, 0x48 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_800F498 + ldr r1, _0800F634 + 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 + .align 2, 0 +_0800F614: .4byte 0x03005124 +_0800F618: .4byte 0x03003090 +_0800F61C: .4byte 0x03004140 +_0800F620: .4byte 0x03005000 +_0800F624: .4byte 0x00000ce4 +_0800F628: .4byte 0x03007890 +_0800F62C: .4byte 0x03003124 +_0800F630: .4byte 0x03003110 +_0800F634: .4byte 0x000009e8 + 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, _0800F6E4 + 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, _0800F6E8 + 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, _0800F6EC + 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, _0800F6F0 + 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, _0800F6E8 + ldr r1, _0800F6F0 +_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, _0800F6F4 + 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, _0800F6F8 + 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 + .align 2, 0 +_0800F6E4: .4byte 0x03005000 +_0800F6E8: .4byte 0x03000d90 +_0800F6EC: .4byte 0xffff8900 +_0800F6F0: .4byte 0x03000d80 +_0800F6F4: .4byte 0x030059e8 +_0800F6F8: .4byte 0x0300506e + thumb_func_end sub_800F638 + + thumb_func_start sub_800F6FC +sub_800F6FC: @ 800F6FC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0800F718 + 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 + .align 2, 0 +_0800F718: .4byte 0x03005000 +_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, _0800F748 + 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 + .align 2, 0 +_0800F748: .4byte 0x03005000 + thumb_func_end sub_800F728 + + thumb_func_start sub_800F74C +sub_800F74C: @ 800F74C + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, _0800F760 + ldrb r1, [r0, 0xC] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0800F764 + movs r0, 0 + b _0800F786 + .align 2, 0 +_0800F760: .4byte 0x03005000 +_0800F764: + movs r2, 0 + ldr r0, _0800F78C + 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, _0800F790 + adds r0, r5, r1 + ldrb r0, [r0] + adds r0, r3 + ldrb r0, [r0] +_0800F786: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0800F78C: .4byte 0x00000cde +_0800F790: .4byte 0x00000c3e + thumb_func_end sub_800F74C + + thumb_func_start rfu_func_080F97B8 +rfu_func_080F97B8: @ 800F794 + push {lr} + ldr r0, _0800F7CC + ldrb r0, [r0] + cmp r0, 0 + beq _0800F7C6 + ldr r3, _0800F7D0 + ldrh r2, [r3] + cmp r2, 0 + beq _0800F7C6 + ldr r0, _0800F7D4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800F7C6 + ldr r1, _0800F7D8 + 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 + .align 2, 0 +_0800F7CC: .4byte 0x03003124 +_0800F7D0: .4byte 0x03005da8 +_0800F7D4: .4byte 0x030022b4 +_0800F7D8: .4byte 0x03000d78 + thumb_func_end rfu_func_080F97B8 + + thumb_func_start sub_800F7DC +sub_800F7DC: @ 800F7DC + ldr r0, _0800F7E0 + bx lr + .align 2, 0 +_0800F7E0: .4byte 0x02022b14 + thumb_func_end sub_800F7DC + + thumb_func_start sub_800F7E4 +sub_800F7E4: @ 800F7E4 + push {lr} + movs r2, 0 + ldr r0, _0800F7FC + ldr r1, [r0] + ldr r0, _0800F800 + cmp r1, r0 + bne _0800F7F4 + movs r2, 0x1 +_0800F7F4: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_0800F7FC: .4byte 0x03005000 +_0800F800: .4byte rfu_func_080F97B8 + 1 + thumb_func_end sub_800F7E4 + + thumb_func_start sub_800F804 +sub_800F804: @ 800F804 + ldr r1, _0800F80C + ldr r0, _0800F810 + str r0, [r1] + bx lr + .align 2, 0 +_0800F80C: .4byte 0x03005000 +_0800F810: .4byte rfu_func_080F97B8 + 1 + thumb_func_end sub_800F804 + + thumb_func_start Rfu_set_zero +Rfu_set_zero: @ 800F814 + ldr r1, _0800F81C + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_0800F81C: .4byte 0x03005000 + 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, _0800F848 + strh r0, [r1, 0xC] +_0800F83C: + ldr r1, _0800F84C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0800F848: .4byte 0x03003110 +_0800F84C: .4byte 0x020223c0 + thumb_func_end sub_800F820 + + thumb_func_start sub_800F850 +sub_800F850: @ 800F850 + push {lr} + ldr r1, _0800F864 + ldr r0, [r1] + cmp r0, 0 + bne _0800F85E + ldr r0, _0800F868 + str r0, [r1] +_0800F85E: + pop {r0} + bx r0 + .align 2, 0 +_0800F864: .4byte 0x03005000 +_0800F868: .4byte sub_800F820 + 1 + 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, _0800F8C0 + 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 + .align 2, 0 +_0800F8C0: .4byte 0x03003090 +_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, _0800F948 + ldrb r0, [r4, 0xC] + cmp r0, 0 + bne _0800F920 + ldr r0, _0800F94C + ldrb r0, [r0] + cmp r0, 0 + beq _0800F920 + b _0800FC50 +_0800F920: + ldr r0, _0800F950 + ldr r0, [r0] + ldrb r0, [r0] + mov r6, r8 + adds r6, 0x1 + cmp r0, 0 + beq _0800F930 + b _0800FC08 +_0800F930: + ldr r1, _0800F954 + adds r0, r5, r1 + ldrh r0, [r0] + ldr r2, _0800F948 + strb r0, [r2, 0xD] + ldr r3, _0800F958 + adds r0, r5, r3 + bl sub_800F74C + ldr r4, _0800F95C + strb r0, [r4] + b _0800FC08 + .align 2, 0 +_0800F948: .4byte 0x03005000 +_0800F94C: .4byte 0x03003124 +_0800F950: .4byte 0x03007890 +_0800F954: .4byte 0x03003092 +_0800F958: .4byte 0x03003094 +_0800F95C: .4byte 0x03005cce +_0800F960: + ldr r0, _0800F9BC + 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, _0800F9C0 + adds r0, r5, r1 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x82 + strh r0, [r1] + ldr r1, _0800F9C4 + 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 + .align 2, 0 +_0800F9BC: .4byte 0x03005000 +_0800F9C0: .4byte 0x03003092 +_0800F9C4: .4byte 0x03003094 +_0800F9C8: + ldr r4, _0800FA98 + 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, _0800FA9C + 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, _0800FAA0 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + lsls r2, 16 + lsrs r4, r2, 16 + cmp r4, 0x5 + bls _0800FA0E + ldr r4, _0800FA98 + 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, _0800FAA4 + 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, _0800FAA8 + 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, _0800FA9C + bl sub_8010A70 + b _0800FC08 + .align 2, 0 +_0800FA98: .4byte 0x03005000 +_0800FA9C: .4byte 0x020223c4 +_0800FAA0: .4byte 0x03003090 +_0800FAA4: .4byte 0x082ed628 +_0800FAA8: .4byte 0x03003124 +_0800FAAC: + ldr r2, _0800FAC8 + ldr r3, _0800FACC + 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 + .align 2, 0 +_0800FAC8: .4byte 0x082ed6b8 +_0800FACC: .4byte 0x03003092 +_0800FAD0: + ldr r1, _0800FADC + add r1, r8 + movs r0, 0x1 + strb r0, [r1] + b _0800FC04 + .align 2, 0 +_0800FADC: .4byte 0x030050e4 +_0800FAE0: + ldr r2, _0800FB08 + movs r4, 0x80 + lsls r4, 1 + adds r0, r2, r4 + ldr r3, _0800FB0C + 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 + .align 2, 0 +_0800FB08: .4byte 0x03005000 +_0800FB0C: .4byte 0x03003092 +_0800FB10: + ldr r7, _0800FB5C + ldrb r2, [r7, 0xC] + cmp r2, 0 + bne _0800FB78 + ldr r3, _0800FB60 + ldrb r0, [r3] + mov r6, r8 + adds r6, 0x1 + cmp r0, 0 + beq _0800FC08 + ldr r0, _0800FB64 + adds r4, r5, r0 + ldrh r1, [r4] + ldr r0, _0800FB68 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + ands r1, r0 + cmp r1, 0 + beq _0800FB48 + strb r2, [r3] + bl sub_800D630 + ldr r1, _0800FB6C + adds r0, r5, r1 + ldrh r1, [r0] + ldr r2, _0800FB70 + adds r0, r7, r2 + strb r1, [r0] +_0800FB48: + ldr r0, _0800FB74 + adds r0, 0x6 + adds r0, r5, r0 + ldrh r0, [r0] + strb r0, [r7, 0xD] + ldrh r0, [r4] + bl sub_80109E8 + b _0800FC08 + .align 2, 0 +_0800FB5C: .4byte 0x03005000 +_0800FB60: .4byte 0x03003124 +_0800FB64: .4byte 0x03003092 +_0800FB68: .4byte 0x03007890 +_0800FB6C: .4byte 0x03003094 +_0800FB70: .4byte 0x00000ce4 +_0800FB74: .4byte 0x03003090 +_0800FB78: + movs r0, 0xEE + lsls r0, 8 + bl sub_800FD14 + ldr r1, _0800FBA0 + ldr r3, _0800FBA4 + adds r0, r5, r3 + ldrh r0, [r0] + strh r0, [r1, 0x2] + ldr r4, _0800FBA8 + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, _0800FBAC + adds r0, 0x6 + adds r0, r5, r0 + ldrh r0, [r0] + strh r0, [r1, 0x6] + b _0800FC04 + .align 2, 0 +_0800FBA0: .4byte 0x03003110 +_0800FBA4: .4byte 0x03003092 +_0800FBA8: .4byte 0x03003094 +_0800FBAC: .4byte 0x03003090 +_0800FBB0: + ldr r4, _0800FBE0 + ldrb r0, [r4, 0xC] + mov r6, r8 + adds r6, 0x1 + cmp r0, 0x1 + bne _0800FC44 + ldr r0, _0800FBE4 + adds r2, r4, r0 + ldr r1, _0800FBE8 + adds r3, r5, r1 + ldrb r1, [r3] + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, _0800FBEC + adds r0, r5, r2 + ldrh r1, [r0] + ldr r2, _0800FBF0 + adds r0, r4, r2 + strb r1, [r0] + ldrh r0, [r3] + bl sub_80109E8 + b _0800FC08 + .align 2, 0 +_0800FBE0: .4byte 0x03005000 +_0800FBE4: .4byte 0x00000ce3 +_0800FBE8: .4byte 0x03003092 +_0800FBEC: .4byte 0x03003094 +_0800FBF0: .4byte 0x00000ce4 +_0800FBF4: + ldr r0, _0800FC34 + mov r3, r8 + lsls r1, r3, 1 + adds r1, r0 + ldr r4, _0800FC38 + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r1] +_0800FC04: + mov r6, r8 + adds r6, 0x1 +_0800FC08: + ldr r3, _0800FC3C + 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 + .align 2, 0 +_0800FC34: .4byte 0x03003020 +_0800FC38: .4byte 0x03003092 +_0800FC3C: .4byte 0x03005000 +_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, _0800FC74 + adds r1, r0, 0 + adds r1, 0x92 +_0800FC6A: + ldrb r0, [r1] + cmp r0, 0 + beq _0800FC78 + movs r0, 0 + b _0800FC82 + .align 2, 0 +_0800FC74: .4byte 0x03005000 +_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, _0800FCB0 + 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 + .align 2, 0 +_0800FCB0: .4byte 0x03005000 +_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, _0800FD10 + 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 + .align 2, 0 +_0800FD10: .4byte 0x03005000 + 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, _0800FD4C + 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 + .align 2, 0 +_0800FD4C: .4byte 0x03003110 +_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, _0800FD94 + 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 + .align 2, 0 +_0800FD94: .4byte 0x03005000 +_0800FD98: + bl sub_800FC60 + lsls r0, 24 + cmp r0, 0 + beq _0800FE46 + ldr r0, _0800FDAC + adds r0, 0x5A + ldrb r0, [r0] + b _0800FE44 + .align 2, 0 +_0800FDAC: .4byte 0x03005000 +_0800FDB0: + ldr r3, _0800FDEC + ldr r1, _0800FDF0 + adds r0, r3, r1 + ldr r2, _0800FDF4 + adds r1, r3, r2 + ldrb r2, [r0] + ldrb r0, [r1] + eors r0, r2 + ldr r1, _0800FDF8 + 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, _0800FDFC + 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 + .align 2, 0 +_0800FDEC: .4byte 0x03005000 +_0800FDF0: .4byte 0x00000ce2 +_0800FDF4: .4byte 0x00000ce3 +_0800FDF8: .4byte 0x082ed695 +_0800FDFC: .4byte 0x00000cde +_0800FE00: + ldr r0, _0800FE10 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _0800FE46 + .align 2, 0 +_0800FE10: .4byte 0x03005000 +_0800FE14: + strh r1, [r5] + ldr r0, _0800FE1C + ldrh r0, [r0, 0x2C] + b _0800FE44 + .align 2, 0 +_0800FE1C: .4byte 0x030022c0 +_0800FE20: + movs r4, 0 + ldr r3, _0800FE3C +_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 + .align 2, 0 +_0800FE3C: .4byte 0x030050f2 +_0800FE40: + ldr r0, _0800FE4C + ldrh r0, [r0] +_0800FE44: + strh r0, [r5, 0x2] +_0800FE46: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800FE4C: .4byte 0x03005da8 + thumb_func_end sub_800FD14 + + thumb_func_start sub_800FE50 +sub_800FE50: @ 800FE50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0800FE7C + ldrh r0, [r0] + cmp r0, 0 + bne _0800FE76 + bl sub_8011A80 + cmp r0, 0 + bne _0800FE76 + ldr r0, _0800FE80 + 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 + .align 2, 0 +_0800FE7C: .4byte 0x03003110 +_0800FE80: .4byte 0x030050f2 + thumb_func_end sub_800FE50 + + thumb_func_start sub_800FE84 +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, _0800FEBC + ldr r0, [r5] + cmp r0, 0 + bne _0800FEB8 + ldr r0, _0800FEC0 + 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, _0800FEC4 + adds r1, 0x83 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0800FEB8: + movs r0, 0 + b _0800FF32 + .align 2, 0 +_0800FEBC: .4byte 0x03005000 +_0800FEC0: .4byte 0x03003110 +_0800FEC4: .4byte 0x02022b44 +_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, _0800FF40 + 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, _0800FF44 + ldr r1, _0800FF48 + 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 + .align 2, 0 +_0800FF40: .4byte 0x020228c4 +_0800FF44: .4byte 0x03005000 +_0800FF48: .4byte rfufunc_80F9F44 + 1 + thumb_func_end sub_800FE84 + + thumb_func_start rfufunc_80F9F44 +rfufunc_80F9F44: @ 800FF4C + push {r4,r5,lr} + ldr r0, _0800FF7C + ldrh r0, [r0] + cmp r0, 0 + bne _0800FFA0 + movs r5, 0x88 + lsls r5, 8 + adds r0, r5, 0 + bl sub_800FD14 + ldr r4, _0800FF80 + 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 + .align 2, 0 +_0800FF7C: .4byte 0x03003110 +_0800FF80: .4byte 0x03005000 +_0800FF84: + bl link_get_multiplayer_id + ldr r1, _0800FFA8 + 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, _0800FFAC + str r0, [r4] +_0800FFA0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800FFA8: .4byte 0x03003090 +_0800FFAC: .4byte sub_800FFB0 + 1 + thumb_func_end rfufunc_80F9F44 + + thumb_func_start sub_800FFB0 +sub_800FFB0: @ 800FFB0 + push {r4-r6,lr} + ldr r0, _0801001C + mov r12, r0 + ldr r5, [r0, 0x70] + ldr r3, _08010020 + 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, _08010024 + mov r1, r12 + str r0, [r1] +_08010014: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801001C: .4byte 0x03005000 +_08010020: .4byte 0x03003110 +_08010024: .4byte rfufunc_80FA020 + 1 + 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, _080100D0 + 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, _080100D4 + adds r2, r5, 0 + adds r2, 0x6E + ldrh r0, [r2] + subs r0, 0x1 + ldr r4, _080100D8 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r3] + movs r4, 0 + mov r9, r5 + ldr r0, _080100DC + 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, _080100E0 + 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, _080100E4 + adds r1, 0x64 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080100F4 + .align 2, 0 +_080100D0: .4byte 0x03005000 +_080100D4: .4byte 0x03003110 +_080100D8: .4byte 0xffff8900 +_080100DC: .4byte 0x03003090 +_080100E0: .4byte 0x082ed628 +_080100E4: .4byte 0x02022b44 +_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, _08010118 + adds r1, 0x5A + strb r0, [r1] + movs r0, 0xA1 + lsls r0, 8 + bl sub_800FD14 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_08010118: .4byte 0x03005000 + thumb_func_end sub_8010100 + + thumb_func_start sub_801011C +sub_801011C: @ 801011C + push {lr} + bl rfu_clearAllSlot + bl sub_800C048 + ldr r1, _08010140 + movs r0, 0 + strb r0, [r1] + ldr r2, _08010144 + adds r3, r2, 0 + adds r3, 0xEF + movs r1, 0 + movs r0, 0x1 + strb r0, [r3] + str r1, [r2] + pop {r0} + bx r0 + .align 2, 0 +_08010140: .4byte 0x03003124 +_08010144: .4byte 0x03005000 + thumb_func_end sub_801011C + + thumb_func_start sub_8010148 +sub_8010148: @ 8010148 + push {lr} + ldr r0, _08010164 + 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 + .align 2, 0 +_08010164: .4byte 0x03007890 + thumb_func_end sub_8010148 + + thumb_func_start sub_8010168 +sub_8010168: @ 8010168 + push {r4,lr} + ldr r4, _08010180 + ldrb r0, [r4, 0xC] + cmp r0, 0 + bne _08010188 + bl sub_800D630 + ldr r0, _08010184 + adds r1, r4, r0 + movs r0, 0x2 + strb r0, [r1] + b _0801018C + .align 2, 0 +_08010180: .4byte 0x03005000 +_08010184: .4byte 0x00000ce4 +_08010188: + ldr r0, _08010194 + str r0, [r4] +_0801018C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010194: .4byte sub_8010148 + 1 + thumb_func_end sub_8010168 + + thumb_func_start sub_8010198 +sub_8010198: @ 8010198 + push {lr} + bl sub_800D630 + ldr r2, _080101BC + ldr r0, _080101C0 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080101C4 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + ldrb r1, [r1, 0x3] + orrs r0, r1 + ldr r1, _080101C8 + adds r2, r1 + strb r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_080101BC: .4byte 0x03005000 +_080101C0: .4byte 0x00000ce4 +_080101C4: .4byte 0x03007890 +_080101C8: .4byte 0x00000ce3 + thumb_func_end sub_8010198 + + thumb_func_start sub_80101CC +sub_80101CC: @ 80101CC + push {r4,r5,lr} + ldr r0, _08010214 + 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, _08010218 + 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 + .align 2, 0 +_08010214: .4byte 0x03005000 +_08010218: .4byte 0x02022fec +_0801021C: + ldr r0, _08010228 + str r0, [r3] +_08010220: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08010228: .4byte sub_8010168 + 1 + thumb_func_end sub_80101CC + + thumb_func_start sub_801022C +sub_801022C: @ 801022C + push {r4,lr} + ldr r0, _08010254 + ldrh r0, [r0] + cmp r0, 0 + bne _0801024E + ldr r4, _08010258 + ldr r1, _0801025C + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801024E + movs r0, 0xBE + lsls r0, 7 + bl sub_800FD14 + ldr r0, _08010260 + str r0, [r4] +_0801024E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010254: .4byte 0x03003110 +_08010258: .4byte 0x03005000 +_0801025C: .4byte 0x00000ce8 +_08010260: .4byte sub_80101CC + 1 + thumb_func_end sub_801022C + + thumb_func_start sub_8010264 +sub_8010264: @ 8010264 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08010288 + ldr r0, [r2] + cmp r0, 0 + bne _08010284 + ldr r1, _0801028C + adds r0, r2, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08010290 + str r0, [r2] + adds r0, r3, 0 + bl remove_task +_08010284: + pop {r0} + bx r0 + .align 2, 0 +_08010288: .4byte 0x03005000 +_0801028C: .4byte 0x00000cd9 +_08010290: .4byte sub_801022C + 1 + 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, _080102B4 + 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 + .align 2, 0 +_080102B4: .4byte sub_8010264 + 1 + 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, _08010350 + ldr r2, _08010354 + 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, _08010350 + 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, _08010350 + 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 + .align 2, 0 +_08010350: .4byte 0x03005000 +_08010354: .4byte 0x000009e6 + thumb_func_end sub_80102B8 + + thumb_func_start sub_8010358 +sub_8010358: @ 8010358 + push {r4,lr} + ldr r4, _08010380 + ldr r1, _08010384 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801037A + ldr r0, _08010388 + ldrh r0, [r0] + cmp r0, 0 + bne _0801037A + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + ldr r0, _0801038C + str r0, [r4] +_0801037A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010380: .4byte 0x03005000 +_08010384: .4byte 0x000009e6 +_08010388: .4byte 0x03003110 +_0801038C: .4byte sub_80102B8 + 1 + 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, _080103BC + ldr r1, _080103C0 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801041E + ldr r0, _080103C4 + ldrh r0, [r0] + cmp r0, 0 + bne _0801041E + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + ldr r0, _080103C8 + b _0801041C + .align 2, 0 +_080103BC: .4byte 0x03005000 +_080103C0: .4byte 0x000009e6 +_080103C4: .4byte 0x03003110 +_080103C8: .4byte sub_80102B8 + 1 +_080103CC: + bl sub_8009FCC + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1 + cmp r1, r2 + bcs _080103FA + ldr r3, _08010424 + 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, _08010424 + ldr r1, _08010428 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801041E + ldr r0, _0801042C + ldrh r0, [r0] + cmp r0, 0 + bne _0801041E + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + ldr r0, _08010430 +_0801041C: + str r0, [r4] +_0801041E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010424: .4byte 0x03005000 +_08010428: .4byte 0x000009e6 +_0801042C: .4byte 0x03003110 +_08010430: .4byte sub_8010358 + 1 + thumb_func_end sub_8010390 + + thumb_func_start sub_8010434 +sub_8010434: @ 8010434 + push {lr} + ldr r1, _0801044C + ldr r2, [r1] + cmp r2, 0 + bne _08010448 + ldr r0, _08010450 + str r0, [r1] + adds r0, r1, 0 + adds r0, 0xFE + strh r2, [r0] +_08010448: + pop {r0} + bx r0 + .align 2, 0 +_0801044C: .4byte 0x03005000 +_08010450: .4byte sub_8010390 + 1 + thumb_func_end sub_8010434 + + thumb_func_start sub_8010454 +sub_8010454: @ 8010454 + push {r4,lr} + adds r3, r0, 0 + ldr r1, _08010470 + ldrh r0, [r1] + cmp r0, r3 + beq _08010482 + ldr r4, _08010474 + adds r2, r1, 0 +_08010464: + ldrh r0, [r2] + cmp r0, r4 + bne _08010478 + movs r0, 0 + b _08010484 + .align 2, 0 +_08010470: .4byte 0x082ed6e0 +_08010474: .4byte 0x0000ffff +_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, _080104C8 + ldr r1, _080104CC + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0 + bl sub_800C27C + pop {r0} + bx r0 + .align 2, 0 +_080104C8: .4byte 0x03005000 +_080104CC: .4byte 0x00000cd9 + thumb_func_end sub_80104B0 + + thumb_func_start rfu_get_multiplayer_id +rfu_get_multiplayer_id: @ 80104D0 + push {lr} + ldr r1, _080104E4 + ldrb r0, [r1, 0xC] + cmp r0, 0x1 + beq _080104EC + ldr r2, _080104E8 + adds r0, r1, r2 + ldrb r0, [r0] + b _080104EE + .align 2, 0 +_080104E4: .4byte 0x03005000 +_080104E8: .4byte 0x00000cce +_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, _080104FC + ldrb r0, [r0, 0xD] + bx lr + .align 2, 0 +_080104FC: .4byte 0x03005000 + thumb_func_end sub_80104F4 + + thumb_func_start sub_8010500 +sub_8010500: @ 8010500 + push {lr} + ldr r2, _08010514 + adds r0, r2, 0 + adds r0, 0xF1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08010518 + movs r0, 0 + b _08010524 + .align 2, 0 +_08010514: .4byte 0x03005000 +_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, _0801053C + ldr r0, [r0] + cmp r0, 0 + beq _08010536 + bl _call_via_r0 +_08010536: + pop {r0} + bx r0 + .align 2, 0 +_0801053C: .4byte 0x03005000 + 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, _080105AC + ldr r0, _080105B0 + adds r0, r6 + mov r8, r0 +_08010552: + ldr r1, _080105B4 + 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, _080105B8 + 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, _080105BC + 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 + .align 2, 0 +_080105AC: .4byte 0x03005000 +_080105B0: .4byte 0x00000c3e +_080105B4: .4byte 0x00000cd1 +_080105B8: .4byte 0x03007880 +_080105BC: .4byte 0x00000cd5 +_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, _08010638 + 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, _08010638 +_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 + .align 2, 0 +_08010638: .4byte 0x03005cd5 +_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, _08010678 + ldr r2, _0801067C + adds r0, r2 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x9 + beq _08010680 + movs r0, 0 + b _08010682 + .align 2, 0 +_08010678: .4byte 0x03005000 +_0801067C: .4byte 0x00000cd1 +_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, _080106CC + ldr r0, _080106D0 + 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 + .align 2, 0 +_080106CC: .4byte 0x03005000 +_080106D0: .4byte 0x00000cd1 + thumb_func_end sub_8010688 + + thumb_func_start sub_80106D4 +sub_80106D4: @ 80106D4 + push {r4,r5,lr} + ldr r4, _08010708 + ldr r0, _0801070C + adds r5, r4, r0 + movs r0, 0x8 + strb r0, [r5] + ldr r0, _08010710 + 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 + .align 2, 0 +_08010708: .4byte 0x03005000 +_0801070C: .4byte 0x00000c85 +_08010710: .4byte 0x00000c3e + 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, _08010744 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0 + beq _08010748 + movs r0, 0 + b _0801074A + .align 2, 0 +_08010744: .4byte 0x03007880 +_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, _08010794 + ldr r1, _08010798 + adds r5, r0, r1 +_0801075E: + ldr r1, _0801079C + 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 + .align 2, 0 +_08010794: .4byte 0x03005000 +_08010798: .4byte 0x00000cd5 +_0801079C: .4byte 0x03007880 + thumb_func_end sub_8010750 + + thumb_func_start sub_80107A0 +sub_80107A0: @ 80107A0 + push {r4,r5,lr} + movs r4, 0 + ldr r1, _08010818 + ldr r2, _0801081C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080107DA + ldr r2, _08010820 + ldr r0, _08010824 + 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, _08010820 + ldr r5, _08010818 + ldr r0, _08010824 + 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, _08010828 + adds r4, r5, r2 + ldrb r0, [r4] + movs r1, 0 + bl sub_8011A64 + ldrb r4, [r4] + b _08010844 + .align 2, 0 +_08010818: .4byte 0x03005000 +_0801081C: .4byte 0x00000c85 +_08010820: .4byte 0x03007880 +_08010824: .4byte 0x00000c3e +_08010828: .4byte 0x00000c86 +_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, _08010898 + 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, _0801089C + adds r1, r5, r0 + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl remove_task +_08010872: + ldr r2, _080108A0 + 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 + .align 2, 0 +_08010898: .4byte 0x03005000 +_0801089C: .4byte 0x00000ce8 +_080108A0: .4byte 0x03005e00 +_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, _080108E4 + ldrb r0, [r0] + cmp r0, 0 + beq _080108E8 + movs r0, 0xF0 + lsls r0, 7 + bl sub_800FD14 + b _080108F0 + .align 2, 0 +_080108E4: .4byte 0x03003124 +_080108E8: + movs r0, 0xEE + lsls r0, 7 + bl sub_800FD14 +_080108F0: + ldr r0, _08010900 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0x65 + strh r0, [r1, 0x8] + b _080109D2 + .align 2, 0 +_08010900: .4byte 0x03005e00 +_08010904: + ldr r0, _08010914 + ldrh r0, [r0] + cmp r0, 0 + bne _080109D2 +_0801090C: + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080109D2 + .align 2, 0 +_08010914: .4byte 0x03003110 +_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, _08010980 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080109D2 + .align 2, 0 +_08010980: .4byte 0x03005e00 +_08010984: + adds r0, r6, 0 + bl remove_task + ldr r1, _080109D8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080109DC + adds r1, r5, r0 + movs r0, 0 + strb r0, [r1] + movs r1, 0x96 + lsls r1, 2 + movs r0, 0x1 + bl sub_800D550 + ldr r2, _080109E0 + adds r1, r5, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080109D2 + movs r4, 0 + adds r2, r1, 0 + movs r3, 0x1 + ldr r0, _080109E4 + 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 + .align 2, 0 +_080109D8: .4byte 0x03003124 +_080109DC: .4byte 0x00000ce8 +_080109E0: .4byte 0x00000ce6 +_080109E4: .4byte 0x00000ce5 + 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, _08010A10 + 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 + .align 2, 0 +_08010A10: .4byte 0x03005cde + thumb_func_end sub_80109E8 + + thumb_func_start sub_8010A14 +sub_8010A14: @ 8010A14 + push {r4-r7,lr} + adds r2, r0, 0 + ldr r1, _08010A64 + ldrb r0, [r2, 0xF] + strb r0, [r1, 0xD] + movs r4, 0 + ldr r0, _08010A68 + 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, _08010A6C + 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 + .align 2, 0 +_08010A64: .4byte 0x03005000 +_08010A68: .4byte 0x00000cde +_08010A6C: .4byte 0x020229e8 + 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, _08010AA4 + 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, _08010AA8 + adds r1, r4, 0 + bl CpuSet + movs r0, 0 + bl sub_800A5EC +_08010A9C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08010AA4: .4byte 0x082ed7ec +_08010AA8: .4byte 0x0100007e + 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, _08010B0C + ldr r2, _08010B10 + ldr r1, _08010B14 + adds r0, r3, r1 + ldrb r1, [r0] + adds r1, r2 + ldr r2, _08010B18 + 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, _08010B1C + adds r1, r3, r5 + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl remove_task +_08010AE8: + ldr r0, _08010B20 + 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, _08010B24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08010B0C: .4byte 0x03005000 +_08010B10: .4byte 0x082ed68c +_08010B14: .4byte 0x00000ce9 +_08010B18: .4byte 0x00000cde +_08010B1C: .4byte 0x00000ce8 +_08010B20: .4byte 0x03005e00 +_08010B24: .4byte _08010B28 + .align 2, 0 +_08010B28: + .4byte _08010B40 + .4byte _08010B60 + .4byte _08010B78 + .4byte _08010BC0 + .4byte _08010C0A + .4byte _08010C94 +_08010B40: + ldr r0, _08010B5C + 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 + .align 2, 0 +_08010B5C: .4byte 0x03003110 +_08010B60: + ldr r0, _08010B74 + ldrh r0, [r0] + cmp r0, 0 + beq _08010B6A + b _08010CF0 +_08010B6A: + adds r1, r7, r6 + lsls r1, 3 + adds r1, r3 + b _08010C52 + .align 2, 0 +_08010B74: .4byte 0x03003110 +_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, _08010BB8 + adds r2, r0 + ldr r1, _08010BBC + 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 + .align 2, 0 +_08010BB8: .4byte 0x020223c4 +_08010BBC: .4byte 0x020229e8 +_08010BC0: + ldr r5, _08010C5C + adds r1, r5, 0 + ldr r0, _08010C60 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldrh r2, [r0] + strh r2, [r1] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x2] + ldr r1, _08010C64 + ldrb r0, [r1, 0xD] + strb r0, [r5, 0xF] + movs r2, 0 + adds r4, r5, 0 + adds r4, 0x10 + ldr r0, _08010C68 + 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, _08010C6C + adds r0, r5, 0 + adds r0, 0x14 + movs r2, 0x8C + bl memcpy + ldr r0, _08010C70 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_08010C0A: + ldr r5, _08010C5C + ldr r1, _08010C64 + ldrb r0, [r1, 0xD] + strb r0, [r5, 0xF] + movs r2, 0 + ldr r3, _08010C6C + mov r12, r3 + adds r4, r5, 0 + adds r4, 0x10 + ldr r0, _08010C68 + 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, _08010C5C + movs r0, 0 + movs r2, 0xA0 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _08010CF0 +_08010C4A: + ldr r0, _08010C70 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 +_08010C52: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08010CF0 + .align 2, 0 +_08010C5C: .4byte 0x020228c4 +_08010C60: .4byte 0x082ed7ec +_08010C64: .4byte 0x03005000 +_08010C68: .4byte 0x00000cde +_08010C6C: .4byte 0x020229e8 +_08010C70: .4byte 0x03005e00 +_08010C74: + adds r0, r3, 0 + lsls r0, r2 + ldr r2, _08010C8C + adds r1, r5, r2 + strb r0, [r1] + ldrb r1, [r4] + eors r0, r1 + strb r0, [r4] + ldr r4, _08010C90 + adds r0, r5, r4 + strb r3, [r0] + b _08010CEA + .align 2, 0 +_08010C8C: .4byte 0x00000ce5 +_08010C90: .4byte 0x00000ce8 +_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, _08010CF8 + ldr r2, _08010CFC + bl CpuSet + movs r0, 0 + bl sub_800A5EC + ldr r1, _08010D00 + ldr r5, _08010D04 + adds r0, r1, r5 + strb r4, [r0] + ldr r0, _08010D08 + 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 + .align 2, 0 +_08010CF8: .4byte 0x020223c4 +_08010CFC: .4byte 0x0100007e +_08010D00: .4byte 0x03005000 +_08010D04: .4byte 0x00000ce8 +_08010D08: .4byte 0x00000ce6 + 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, _08010D48 + 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, _08010D4C + 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 + .align 2, 0 +_08010D48: .4byte 0x03005000 +_08010D4C: .4byte 0x03005e00 +_08010D50: + cmp r0, 0x2 + beq _08010D82 + b _08010DA6 +_08010D56: + ldrb r0, [r6, 0xD] + cmp r0, 0 + beq _08010DA6 + bl sub_800B348 + ldr r1, _08010D6C + movs r0, 0 + movs r2, 0x3C + bl link_0800A448 + b _08010D7A + .align 2, 0 +_08010D6C: .4byte 0x020228c4 +_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, _08010DAC + bl sub_8010A14 + movs r0, 0 + bl sub_800A5EC + ldr r0, _08010DB0 + strb r4, [r0] + adds r0, r5, 0 + bl remove_task +_08010DA6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08010DAC: .4byte 0x020223c4 +_08010DB0: .4byte 0x03003124 + thumb_func_end sub_8010D0C + + thumb_func_start sub_8010DB4 +sub_8010DB4: @ 8010DB4 + push {r4-r7,lr} + ldr r0, _08010E3C + adds r1, r0, 0 + adds r1, 0xEE + ldrb r1, [r1] + adds r3, r0, 0 + cmp r1, 0x1 + bne _08010E5C + ldr r2, _08010E40 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _08010E5C + ldr r0, _08010E44 + ldr r1, [r0, 0x4] + ldr r0, _08010E48 + cmp r1, r0 + beq _08010DDE + ldr r0, [r2, 0x3C] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08010DE4 +_08010DDE: + ldr r1, _08010E4C + movs r0, 0x2 + strb r0, [r1] +_08010DE4: + ldr r4, _08010E50 + adds r0, r4, 0 + bl set_callback2 + ldr r0, _08010E44 + str r4, [r0, 0x8] + ldr r5, _08010E3C + 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, _08010E54 + adds r0, r5, r1 + ldrb r0, [r0] + adds r7, r0, 0 + ldr r1, _08010E58 + 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 + .align 2, 0 +_08010E3C: .4byte 0x03005000 +_08010E40: .4byte 0x03004140 +_08010E44: .4byte 0x030022c0 +_08010E48: .4byte sub_8018438 + 1 +_08010E4C: .4byte 0x030030fc +_08010E50: .4byte c2_800ACD4 + 1 +_08010E54: .4byte 0x000009e6 +_08010E58: .4byte 0x00000c1a +_08010E5C: + ldr r1, _08010E94 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08010E70 + ldr r1, _08010E98 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08010E8E +_08010E70: + ldr r0, _08010E9C + 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 + .align 2, 0 +_08010E94: .4byte 0x00000c1b +_08010E98: .4byte 0x000009e7 +_08010E9C: .4byte 0x03004140 + thumb_func_end sub_8010DB4 + + thumb_func_start rfu_REQ_recvData_then_sendData +rfu_REQ_recvData_then_sendData: @ 8010EA0 + push {lr} + ldr r0, _08010EBC + 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 + .align 2, 0 +_08010EBC: .4byte 0x03004140 + 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, _08010EF4 + ldr r1, _08010EF8 + 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 + .align 2, 0 +_08010EF4: .4byte 0x03005000 +_08010EF8: .4byte 0x00000ccd +_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, _08010F44 + 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 + .align 2, 0 +_08010F44: .4byte 0x03005000 + thumb_func_end sub_8010F1C + + thumb_func_start sub_8010F48 +sub_8010F48: @ 8010F48 + push {lr} + ldr r0, _08010F58 + ldr r1, _08010F5C + ldr r1, [r1] + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_08010F58: .4byte 0x02022b22 +_08010F5C: .4byte 0x03005d90 + thumb_func_end sub_8010F48 + + thumb_func_start sub_8010F60 +sub_8010F60: @ 8010F60 + push {r4,lr} + ldr r4, _08010F80 + 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 + .align 2, 0 +_08010F80: .4byte 0x02022b14 + 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, _08010F9C + adds r1, r4, 0 + bl sub_800DD94 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010F9C: .4byte 0x02022b14 + thumb_func_end sub_8010F84 + + thumb_func_start sub_8010FA0 +sub_8010FA0: @ 8010FA0 + push {r4,r5,lr} + ldr r5, _08010FC8 + 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 + .align 2, 0 +_08010FC8: .4byte 0x02022b14 + thumb_func_end sub_8010FA0 + + thumb_func_start sub_8010FCC +sub_8010FCC: @ 8010FCC + push {r4,r5,lr} + ldr r5, _08011000 + lsls r0, 2 + ldrb r4, [r5, 0x9] + movs r3, 0x3 + ands r3, r4 + orrs r3, r0 + strb r3, [r5, 0x9] + ldr r3, _08011004 + adds r0, r3, 0 + ands r1, r0 + ldrh r3, [r5, 0x8] + ldr r0, _08011008 + 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 + .align 2, 0 +_08011000: .4byte 0x02022b14 +_08011004: .4byte 0x000003ff +_08011008: .4byte 0xfffffc00 + thumb_func_end sub_8010FCC + + thumb_func_start sub_801100C +sub_801100C: @ 801100C + push {r4,lr} + movs r4, 0x80 + ldr r3, _08011038 + 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 + .align 2, 0 +_08011038: .4byte 0x020229e8 + thumb_func_end sub_801100C + + thumb_func_start sub_801103C +sub_801103C: @ 801103C + push {r4,r5,lr} + ldr r5, _08011044 + movs r4, 0x1 + b _08011054 + .align 2, 0 +_08011044: .4byte 0x02022b14 +_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, _08011088 + lsrs r0, 17 + ldrb r3, [r2, 0xA] + movs r1, 0x7F + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0xA] + ldr r3, _0801108C + movs r0, 0 + movs r1, 0x2 + bl rfu_REQ_configGameData + pop {r0} + bx r0 + .align 2, 0 +_08011088: .4byte 0x02022b14 +_0801108C: .4byte 0x02022b22 + 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, _080110B0 + ldr r3, _080110B4 + movs r0, 0 + movs r1, 0x2 + bl rfu_REQ_configGameData + pop {r0} + bx r0 + .align 2, 0 +_080110B0: .4byte 0x02022b14 +_080110B4: .4byte 0x02022b22 + 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, _0801115C + ldr r1, _08011160 + adds r0, r3, r1 + ldr r2, _08011164 + 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, _08011168 + mov r12, r2 + ldr r0, _0801116C + 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 + .align 2, 0 +_0801115C: .4byte 0x03005000 +_08011160: .4byte 0x00000ce2 +_08011164: .4byte 0x00000ce3 +_08011168: .4byte 0x020229e8 +_0801116C: .4byte 0x00000cde + thumb_func_end sub_80110B8 + + thumb_func_start sub_8011170 +sub_8011170: @ 8011170 + push {r4,lr} + adds r4, r0, 0 + ldr r2, _08011198 + adds r3, r2, 0 + adds r3, 0xEE + ldrb r0, [r3] + cmp r0, 0 + bne _08011192 + ldr r1, _0801119C + 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 + .align 2, 0 +_08011198: .4byte 0x03005000 +_0801119C: .4byte 0x03004140 + thumb_func_end sub_8011170 + + thumb_func_start sub_80111A0 +sub_80111A0: @ 80111A0 + ldr r0, _080111AC + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_080111AC: .4byte 0x03005000 + 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, _080111C4 + adds r0, 0xEE + ldrb r1, [r0] + strb r2, [r0] + b _080111D2 + .align 2, 0 +_080111C4: .4byte 0x03005000 +_080111C8: + ldr r0, _080111D8 + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0x4 + strb r1, [r0] +_080111D2: + pop {r0} + bx r0 + .align 2, 0 +_080111D8: .4byte 0x03005000 + thumb_func_end sub_80111B0 + + thumb_func_start sub_80111DC +sub_80111DC: @ 80111DC + push {lr} + ldr r0, _080111F4 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_8011E94 + ldr r1, _080111F8 + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080111F4: .4byte 0x03004140 +_080111F8: .4byte 0x03005000 + thumb_func_end sub_80111DC + + thumb_func_start sub_80111FC +sub_80111FC: @ 80111FC + ldr r1, _08011204 + ldr r0, _08011208 + str r0, [r1] + bx lr + .align 2, 0 +_08011204: .4byte 0x03005000 +_08011208: .4byte sub_80111DC + 1 + 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, _08011288 + movs r0, 0x2 + strh r0, [r1, 0x4] + b _080113EE + .align 2, 0 +_08011288: .4byte 0x03005000 +_0801128C: + ldr r0, _080112F0 + ldrh r0, [r0, 0x14] + bl sub_80115EC + movs r5, 0 + movs r0, 0x1 + mov r8, r0 + ldr r1, _080112F4 + mov r9, r1 + ldr r3, _080112F8 + add r3, r9 + mov r10, r3 + movs r7, 0x7F +_080112A6: + ldr r0, _080112F0 + ldrh r0, [r0, 0x14] + asrs r0, r5 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0801130E + ldr r0, _080112FC + 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, _08011300 + 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 + .align 2, 0 +_080112F0: .4byte 0x03004140 +_080112F4: .4byte 0x03005000 +_080112F8: .4byte 0x00000cd5 +_080112FC: .4byte 0x03007890 +_08011300: .4byte 0x00000cd1 +_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, _08011348 + ldr r1, _0801134C + adds r0, r4, r1 + ldr r1, _08011350 + 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 + .align 2, 0 +_08011348: .4byte 0x03005000 +_0801134C: .4byte 0x00000ce7 +_08011350: .4byte 0x03004140 +_08011354: + ldr r0, _0801135C + adds r0, 0xF0 + b _080113EA + .align 2, 0 +_0801135C: .4byte 0x03005000 +_08011360: + ldr r0, _08011368 + adds r0, 0xF0 + movs r1, 0x3 + b _080113EC + .align 2, 0 +_08011368: .4byte 0x03005000 +_0801136C: + ldr r1, _0801139C + adds r2, r1, 0 + adds r2, 0xF0 + movs r0, 0x4 + strb r0, [r2] + ldr r3, _080113A0 + adds r1, r3 + ldr r0, _080113A4 + ldrb r2, [r0, 0x14] + ldrb r0, [r1] + adds r3, r0, 0 + bics r3, r2 + adds r2, r3, 0 + strb r2, [r1] + ldr r0, _080113A8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080113B0 + cmp r2, 0 + bne _080113AC + adds r0, r4, 0 + bl sub_8011170 + b _080113B0 + .align 2, 0 +_0801139C: .4byte 0x03005000 +_080113A0: .4byte 0x00000ce2 +_080113A4: .4byte 0x03004140 +_080113A8: .4byte 0x03003124 +_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, _080113D0 + adds r0, 0xEF + b _080113EA + .align 2, 0 +_080113D0: .4byte 0x03005000 +_080113D4: + adds r0, r4, 0 + bl sub_8011170 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + ldr r0, _080113FC + ldr r1, _08011400 + 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 + .align 2, 0 +_080113FC: .4byte 0x03005000 +_08011400: .4byte 0x00000cdb + 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, _08011478 + movs r0, 0x6 + strh r0, [r1, 0x4] + b _080115DE + .align 2, 0 +_08011478: .4byte 0x03005000 +_0801147C: + ldr r0, _08011488 + ldr r1, _0801148C + ldrh r1, [r1, 0x14] + ldr r2, _08011490 + adds r0, r2 + b _080115DC + .align 2, 0 +_08011488: .4byte 0x03005000 +_0801148C: .4byte 0x03004140 +_08011490: .4byte 0x00000ccd +_08011494: + ldr r0, _080114A4 + ldr r1, _080114A8 + ldrh r1, [r1, 0x14] + ldr r2, _080114AC + adds r0, r2 + ldrb r2, [r0] + b _080115DC + .align 2, 0 +_080114A4: .4byte 0x03005000 +_080114A8: .4byte 0x03004140 +_080114AC: .4byte 0x00000c3e +_080114B0: + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + b _080115DE +_080114BA: + ldr r4, _080114F0 + movs r1, 0 + movs r0, 0xB + strh r0, [r4, 0x4] + ldr r2, _080114F4 + adds r0, r4, r2 + strb r1, [r0] + ldr r0, _080114F8 + adds r2, r4, r0 + strb r1, [r2] + ldr r1, _080114FC + adds r5, r4, r1 + ldrb r1, [r5] + movs r0, 0x20 + movs r3, 0x1 + bl rfu_setRecvBuffer + ldrb r1, [r5] + ldr r2, _08011500 + adds r4, r2 + movs r0, 0x10 + adds r2, r4, 0 + movs r3, 0x46 + bl rfu_setRecvBuffer + b _080115DE + .align 2, 0 +_080114F0: .4byte 0x03005000 +_080114F4: .4byte 0x00000c85 +_080114F8: .4byte 0x00000c86 +_080114FC: .4byte 0x00000c3e +_08011500: .4byte 0x00000c3f +_08011504: + movs r0, 0x2 + movs r1, 0x25 + bl sub_8011A64 + b _080115DE +_0801150E: + ldr r0, _08011560 + adds r2, r0, 0 + adds r2, 0xF0 + movs r1, 0x2 + strb r1, [r2] + ldr r1, _08011564 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080115DE +_08011522: + ldr r2, _08011560 + adds r1, r2, 0 + adds r1, 0xF0 + ldrb r0, [r1] + cmp r0, 0x2 + beq _08011532 + movs r0, 0x4 + strb r0, [r1] +_08011532: + ldr r1, _08011564 + 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, _08011568 + movs r1, 0x5 + movs r2, 0x5 + bl nullsub_5 + ldr r0, _0801156C + ldrb r0, [r0] + cmp r0, 0x1 + bne _080115DE + adds r0, r4, 0 + bl sub_8011170 + b _080115DE + .align 2, 0 +_08011560: .4byte 0x03005000 +_08011564: .4byte 0x00000c86 +_08011568: .4byte 0x082ed7fc +_0801156C: .4byte 0x03003124 +_08011570: + ldr r0, _08011584 + adds r0, 0xF0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08011588 + movs r1, 0x5 + movs r2, 0x5 + bl nullsub_5 + b _080115DE + .align 2, 0 +_08011584: .4byte 0x03005000 +_08011588: .4byte 0x082ed814 +_0801158C: + ldr r1, _080115A4 + adds r2, r1, 0 + adds r2, 0xF0 + movs r0, 0x3 + strb r0, [r2] + ldr r2, _080115A8 + adds r1, r2 + ldrb r0, [r1] + movs r0, 0x1 + strb r0, [r1] + b _080115DE + .align 2, 0 +_080115A4: .4byte 0x03005000 +_080115A8: .4byte 0x00000c3c +_080115AC: + movs r0, 0x1 + movs r1, 0xF3 + bl sub_8011A64 + movs r0, 0xF3 + bl sub_8011170 + ldr r0, _080115C0 + adds r0, 0xEF + b _080115DA + .align 2, 0 +_080115C0: .4byte 0x03005000 +_080115C4: + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + adds r0, r4, 0 + bl sub_8011170 + ldr r0, _080115E4 + ldr r1, _080115E8 + adds r0, r1 + ldrb r1, [r0] +_080115DA: + movs r1, 0x1 +_080115DC: + strb r1, [r0] +_080115DE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080115E4: .4byte 0x03005000 +_080115E8: .4byte 0x00000cdb + 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, _08011620 + ldr r4, _08011624 + 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 + .align 2, 0 +_08011620: .4byte 0x03005000 +_08011624: .4byte 0x00000cea + 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, _08011670 + 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 + .align 2, 0 +_08011670: .4byte 0x03007890 + 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, _08011714 + movs r0, 0x11 + strh r0, [r1, 0x4] + b _08011A42 + .align 2, 0 +_08011714: .4byte 0x03005000 +_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, _08011784 + ldr r1, _08011788 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080117DC + ldr r0, _0801178C + 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, _08011790 + adds r6, r5, r7 + ldrb r2, [r6] + cmp r2, 0 + bne _08011798 + ldr r0, _08011794 + 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 + .align 2, 0 +_08011784: .4byte 0x03005000 +_08011788: .4byte 0x00000cd9 +_0801178C: .4byte 0x03004140 +_08011790: .4byte 0x00000ce6 +_08011794: .4byte 0x00000ce8 +_08011798: + ldr r0, _080117C8 + ldr r1, _080117CC + adds r0, r1 + ldrb r2, [r0] + adds r1, r4, 0 + orrs r1, r2 + strb r1, [r0] +_080117A6: + ldr r0, _080117D0 + ldrh r1, [r0, 0x14] + cmp r4, r1 + beq _080117F6 + ldr r2, _080117C8 + ldr r7, _080117D4 + adds r3, r2, r7 + adds r0, r4, 0 + eors r0, r1 + ldrb r1, [r3] + orrs r0, r1 + strb r0, [r3] + ldr r0, _080117D8 + adds r2, r0 + movs r0, 0x2 + strb r0, [r2] + b _080117F6 + .align 2, 0 +_080117C8: .4byte 0x03005000 +_080117CC: .4byte 0x00000ce6 +_080117D0: .4byte 0x03004140 +_080117D4: .4byte 0x00000ce3 +_080117D8: .4byte 0x00000ce4 +_080117DC: + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x54 + bne _080117F6 + ldr r0, _08011800 + ldrb r0, [r0] + bl rfu_REQ_disconnect + bl rfu_waitREQComplete +_080117F6: + ldr r0, _08011800 + ldrh r0, [r0, 0x14] + bl sub_80115EC + b _08011A42 + .align 2, 0 +_08011800: .4byte 0x03004140 +_08011804: + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + beq _08011836 + ldr r4, _08011848 + 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, _0801184C + ldrh r0, [r1, 0x4] + cmp r0, 0xF + beq _08011840 + b _08011A42 +_08011840: + movs r0, 0x10 + strh r0, [r1, 0x4] + b _08011A42 + .align 2, 0 +_08011848: .4byte 0x03004140 +_0801184C: .4byte 0x03005000 +_08011850: + ldr r0, _0801185C + ldr r1, _08011860 + ldrh r1, [r1, 0x14] + ldr r2, _08011864 + adds r0, r2 + b _08011A40 + .align 2, 0 +_0801185C: .4byte 0x03005000 +_08011860: .4byte 0x03004140 +_08011864: .4byte 0x00000ccd +_08011868: + ldr r0, _08011878 + ldr r1, _0801187C + ldrh r1, [r1, 0x14] + ldr r7, _08011880 + adds r0, r7 + ldrb r2, [r0] + b _08011A40 + .align 2, 0 +_08011878: .4byte 0x03005000 +_0801187C: .4byte 0x03004140 +_08011880: .4byte 0x00000c3e +_08011884: + ldr r1, _080118A4 + movs r0, 0x12 + strh r0, [r1, 0x4] + ldr r0, _080118A8 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x1 + bhi _080118B0 + adds r0, 0x1 + strb r0, [r1] + ldr r0, _080118AC + movs r1, 0x2 + bl AddTask + b _08011A42 + .align 2, 0 +_080118A4: .4byte 0x03005000 +_080118A8: .4byte 0x00000ccf +_080118AC: .4byte sub_801209C + 1 +_080118B0: + movs r0, 0x2 + movs r1, 0x23 + bl sub_8011A64 + b _08011A42 +_080118BA: + ldr r4, _080118E0 + movs r0, 0xD + strh r0, [r4, 0x4] + movs r0, 0x3 + movs r1, 0 + bl sub_8011A64 + ldr r1, _080118E4 + adds r0, r4, r1 + ldrb r1, [r0] + ldr r2, _080118E8 + adds r4, r2 + movs r0, 0x10 + adds r2, r4, 0 + movs r3, 0x46 + bl rfu_setRecvBuffer + b _08011A42 + .align 2, 0 +_080118E0: .4byte 0x03005000 +_080118E4: .4byte 0x00000c3e +_080118E8: .4byte 0x00000c3f +_080118EC: + movs r0, 0x2 + movs r1, 0x25 + bl sub_8011A64 + b _08011A42 +_080118F6: + ldr r0, _0801190C + ldrb r1, [r0] + ldrh r0, [r0, 0x14] + ands r1, r0 + cmp r1, 0 + bne _08011904 + b _08011A42 +_08011904: + ldr r0, _08011910 + adds r0, 0xF0 + movs r1, 0x1 + b _08011A40 + .align 2, 0 +_0801190C: .4byte 0x03004140 +_08011910: .4byte 0x03005000 +_08011914: + ldr r2, _08011934 + adds r1, r2, 0 + adds r1, 0xF0 + movs r0, 0x3 + strb r0, [r1] + ldr r0, _08011938 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _0801192A + b _08011A42 +_0801192A: + ldr r7, _0801193C + adds r0, r2, r7 + ldrb r1, [r0] + movs r1, 0x1 + b _08011A40 + .align 2, 0 +_08011934: .4byte 0x03005000 +_08011938: .4byte 0x03007890 +_0801193C: .4byte 0x00000c3c +_08011940: + ldr r0, _08011980 + adds r0, 0xF0 + movs r1, 0x2 + strb r1, [r0] +_08011948: + ldr r2, _08011980 + 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, _08011984 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080119B4 + ldr r0, _08011988 + adds r2, r0 + ldr r0, _0801198C + 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 + .align 2, 0 +_08011980: .4byte 0x03005000 +_08011984: .4byte 0x03003124 +_08011988: .4byte 0x00000ce2 +_0801198C: .4byte 0x03004140 +_08011990: + bl sub_80111FC + b _080119B4 +_08011996: + ldr r1, _080119E4 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080119B4 + ldr r0, _080119E8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080119B4 + adds r0, r4, 0 + bl sub_8011170 + movs r0, 0 + bl sub_800C27C +_080119B4: + ldr r0, _080119EC + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + bne _080119DA + ldr r0, _080119F0 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _080119DA + ldr r0, _080119F4 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080119DA + ldr r1, _080119F8 + movs r0, 0x11 + strh r0, [r1, 0x4] +_080119DA: + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + b _08011A42 + .align 2, 0 +_080119E4: .4byte 0x00000ce4 +_080119E8: .4byte 0x03003124 +_080119EC: .4byte 0x03007890 +_080119F0: .4byte 0x03004140 +_080119F4: .4byte sub_800EB44 + 1 +_080119F8: .4byte 0x03005000 +_080119FC: + ldr r0, _08011A04 + ldr r2, _08011A08 + adds r0, r2 + b _08011A3E + .align 2, 0 +_08011A04: .4byte 0x03005000 +_08011A08: .4byte 0x00000ce3 +_08011A0C: + movs r0, 0x1 + movs r1, 0xF3 + bl sub_8011A64 + movs r0, 0xF3 + bl sub_8011170 + ldr r0, _08011A24 + adds r0, 0xEF + movs r1, 0x1 + b _08011A40 + .align 2, 0 +_08011A24: .4byte 0x03005000 +_08011A28: + adds r0, r4, 0 + bl sub_8011170 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + ldr r0, _08011A48 + ldr r7, _08011A4C + adds r0, r7 + ldrb r1, [r0] +_08011A3E: + movs r1, 0 +_08011A40: + strb r1, [r0] +_08011A42: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08011A48: .4byte 0x03005000 +_08011A4C: .4byte 0x00000cdb + thumb_func_end sub_8011674 + + thumb_func_start sub_8011A50 +sub_8011A50: @ 8011A50 + ldr r0, _08011A5C + ldr r1, _08011A60 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + bx lr + .align 2, 0 +_08011A5C: .4byte 0x03005000 +_08011A60: .4byte 0x00000ce4 + thumb_func_end sub_8011A50 + + thumb_func_start sub_8011A64 +sub_8011A64: @ 8011A64 + ldr r2, _08011A70 + adds r3, r2, 0 + adds r3, 0xF1 + strb r0, [r3] + strh r1, [r2, 0xA] + bx lr + .align 2, 0 +_08011A70: .4byte 0x03005000 + thumb_func_end sub_8011A64 + + thumb_func_start sub_8011A74 +sub_8011A74: @ 8011A74 + ldr r0, _08011A7C + adds r0, 0xF1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08011A7C: .4byte 0x03005000 + 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, _08011AA8 + ldr r1, _08011AAC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08011AA8: .4byte 0x03005000 +_08011AAC: .4byte 0x00000ce8 + thumb_func_end sub_8011A9C + + thumb_func_start sub_8011AB0 +sub_8011AB0: @ 8011AB0 + ldr r0, _08011AB8 + ldrb r0, [r0, 0xC] + bx lr + .align 2, 0 +_08011AB8: .4byte 0x03005000 + 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, _08011AE0 + ldr r2, _08011AE4 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08011AE0: .4byte 0x03003090 +_08011AE4: .4byte 0x05000014 + thumb_func_end sub_8011AC8 + + thumb_func_start sub_8011AE8 +sub_8011AE8: @ 8011AE8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + 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 reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + bl sub_80A1A74 + ldr r0, _08011B78 + bl SetVBlankCallback + bl sub_80093CC + lsls r0, 24 + cmp r0, 0 + beq _08011B70 + ldr r1, _08011B7C + ldr r2, _08011B80 + adds r0, r2, 0 + strh r0, [r1] + bl sub_800B488 + bl sub_8009734 + ldr r0, _08011B84 + ldrh r0, [r0, 0x24] + bl SeedRng + movs r4, 0 +_08011B38: + bl GenerateRandomNumber + ldr r1, _08011B88 + 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 lcd_io_set + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + bl sub_8011BA4 + ldr r0, _08011B8C + bl set_callback2 +_08011B70: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08011B78: .4byte sub_8011AE8 + 1 +_08011B7C: .4byte 0x020229c6 +_08011B80: .4byte 0x00001111 +_08011B84: .4byte 0x030022c0 +_08011B88: .4byte 0x03005d90 +_08011B8C: .4byte sub_8011BF8 + 1 + thumb_func_end sub_8011AFC + + thumb_func_start sub_8011B90 +sub_8011B90: @ 8011B90 + push {lr} + ldr r0, _08011BA0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08011BA0: .4byte sub_800EB44 + 1 + thumb_func_end sub_8011B90 + + thumb_func_start sub_8011BA4 +sub_8011BA4: @ 8011BA4 + push {r4,lr} + ldr r4, _08011BC8 + 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, _08011BCC + adds r1, 0x66 + strb r0, [r1] +_08011BC2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08011BC8: .4byte nullsub_89 + 1 +_08011BCC: .4byte 0x03005000 + thumb_func_end sub_8011BA4 + + thumb_func_start sub_8011BD0 +sub_8011BD0: @ 8011BD0 + push {lr} + ldr r0, _08011BF0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08011BEA + ldr r0, _08011BF4 + adds r0, 0x66 + ldrb r0, [r0] + bl remove_task +_08011BEA: + pop {r0} + bx r0 + .align 2, 0 +_08011BF0: .4byte nullsub_89 + 1 +_08011BF4: .4byte 0x03005000 + thumb_func_end sub_8011BD0 + + thumb_func_start sub_8011BF8 +sub_8011BF8: @ 8011BF8 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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, _08011C48 + movs r0, 0x1 + strb r0, [r1, 0xC] + bl sub_8010F48 + ldr r0, _08011C4C + movs r1, 0 + bl sub_800BF4C + ldr r2, _08011C50 + adds r1, r2, 0 + ldr r0, _08011C54 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldr r0, _08011C58 + subs r4, 0x1 + adds r4, r0 + ldrb r0, [r4] + strh r0, [r2, 0x2] + bl sub_800EE78 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08011C48: .4byte 0x03005000 +_08011C4C: .4byte sub_801120C + 1 +_08011C50: .4byte 0x02022b2c +_08011C54: .4byte 0x082ed608 +_08011C58: .4byte 0x082ed620 + thumb_func_end sub_8011C10 + + thumb_func_start sub_8011C5C +sub_8011C5C: @ 8011C5C + push {lr} + ldr r1, _08011C78 + movs r0, 0 + strb r0, [r1, 0xC] + bl sub_8010F48 + ldr r0, _08011C7C + ldr r1, _08011C80 + bl sub_800BF4C + bl sub_800EF00 + pop {r0} + bx r0 + .align 2, 0 +_08011C78: .4byte 0x03005000 +_08011C7C: .4byte sub_8011404 + 1 +_08011C80: .4byte sub_800ED34 + 1 + thumb_func_end sub_8011C5C + + thumb_func_start sub_8011C84 +sub_8011C84: @ 8011C84 + push {r4-r7,lr} + ldr r4, _08011CC4 + movs r5, 0 + movs r0, 0x2 + strb r0, [r4, 0xC] + bl sub_8010F48 + ldr r0, _08011CC8 + movs r1, 0 + bl sub_800BF4C + ldr r2, _08011CCC + adds r1, r2, 0 + ldr r0, _08011CD0 + 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, _08011CD4 + movs r1, 0x1 + bl AddTask + adds r4, 0x67 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08011CC4: .4byte 0x03005000 +_08011CC8: .4byte sub_8011674 + 1 +_08011CCC: .4byte 0x02022b2c +_08011CD0: .4byte 0x082ed608 +_08011CD4: .4byte sub_800EB44 + 1 + 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, _08011D68 + 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 sub_8008C44 + 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 + .align 2, 0 +_08011D68: .4byte 0x03007890 + 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, _08011DB0 + ldr r0, _08011DB4 + adds r5, r4, r0 + ldrb r0, [r5] + bics r0, r6 + strb r0, [r5] + ldr r1, _08011DB8 + adds r6, r4, r1 + ldrb r1, [r6] + movs r0, 0x1 + bl rfu_clearSlot + ldrb r0, [r5] + ldr r1, _08011DBC + 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 + .align 2, 0 +_08011DB0: .4byte 0x03005000 +_08011DB4: .4byte 0x00000ce2 +_08011DB8: .4byte 0x00000cda +_08011DBC: .4byte 0x00000c87 + 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, _08011E28 + 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 + .align 2, 0 +_08011E28: .4byte 0x03005cde + 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, _08011E80 + ldrh r0, [r6] + cmp r0, 0 + bne _08011E7A + ldr r5, _08011E84 + ldr r1, _08011E88 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08011E7A + movs r0, 0xED + lsls r0, 8 + bl sub_800FD14 + ldr r1, _08011E8C + 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, _08011E90 + 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 + .align 2, 0 +_08011E80: .4byte 0x03003110 +_08011E84: .4byte 0x03005000 +_08011E88: .4byte 0x00000ce8 +_08011E8C: .4byte 0x03005e00 +_08011E90: .4byte 0x082ed695 + 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, _08011EC4 + 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, _08011EC8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + b _08011EDC + .align 2, 0 +_08011EC4: .4byte sub_8011E2C + 1 +_08011EC8: .4byte 0x03005e00 +_08011ECC: + ldr r0, _08011EF0 + 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, _08011EF0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08011EF0: .4byte 0x03005e00 + 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, _08011F4C + 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, _08011F50 + ldr r0, [r0] + lsls r1, r2, 5 + adds r0, r1 + ldrb r0, [r0, 0x16] + cmp r0, 0xFF + beq _08011F5C + ldr r0, _08011F54 + ldr r1, _08011F58 + adds r0, r1 + strb r2, [r0] + bl sub_800EEBC + cmp r0, 0 + beq _08011FAA + b _08011F84 + .align 2, 0 +_08011F4C: .4byte 0x03005e08 +_08011F50: .4byte 0x03007890 +_08011F54: .4byte 0x03005000 +_08011F58: .4byte 0x00000c3d +_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, _08011F9C + ldr r1, _08011FA0 + adds r0, r1 + strb r2, [r0] + b _08011FAA + .align 2, 0 +_08011F9C: .4byte 0x03005000 +_08011FA0: .4byte 0x00000c3d +_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, _08012000 + adds r0, 0xF1 + movs r1, 0 + strb r1, [r0] + ldr r0, _08012004 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _08012008 + adds r4, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl gf_strcpy + strh r5, [r4, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08012000: .4byte 0x03005000 +_08012004: .4byte sub_8011EF4 + 1 +_08012008: .4byte 0x03005e08 + 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, _08012060 + ldrh r0, [r5, 0x8] + ldr r3, _08012064 + 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 + .align 2, 0 +_08012060: .4byte 0x0300510a +_08012064: .4byte 0x000003ff +_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, _08012154 + 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, _08012158 + 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, _0801215C + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0801217C + ldr r0, _08012160 + 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, _08012164 + 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, _08012168 + 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 mega_func_4 + lsls r0, 24 + cmp r0, 0 + bne _0801217C + movs r0, 0xA + strh r0, [r6, 0x4] + adds r0, r5, 0 + bl remove_task + b _0801217C + .align 2, 0 +_08012154: .4byte 0x03005000 +_08012158: .4byte 0x03005e00 +_0801215C: .4byte 0x00000ccd +_08012160: .4byte 0x03004140 +_08012164: .4byte 0x00000119 +_08012168: .4byte 0x03007890 +_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, _080121F8 + ldr r1, _080121FC + adds r0, r6, r1 + movs r7, 0 + strb r7, [r0] + adds r0, r6, 0 + adds r0, 0xF1 + strb r7, [r0] + ldr r1, _08012200 + adds r0, r6, r1 + adds r1, r3, 0 + bl gf_strcpy + movs r1, 0x85 + lsls r1, 1 + adds r0, r6, r1 + adds r1, r5, 0 + movs r2, 0xD + bl memcpy + bl sub_800D658 + ldr r0, _08012204 + movs r1, 0x2 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08012208 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r4, [r1, 0xA] + ldr r0, _0801220C + 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 + .align 2, 0 +_080121F8: .4byte 0x03005000 +_080121FC: .4byte 0x00000ccf +_08012200: .4byte 0x00000119 +_08012204: .4byte sub_801209C + 1 +_08012208: .4byte 0x03005e00 +_0801220C: .4byte sub_800EB44 + 1 +_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, _08012234 + adds r0, 0xF0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08012238 + movs r0, 0 + b _0801223A + .align 2, 0 +_08012234: .4byte 0x03005000 +_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, _08012264 + ldrb r2, [r0] + ldr r4, _08012268 + 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 + .align 2, 0 +_08012264: .4byte 0x03004140 +_08012268: .4byte 0x03005cd1 +_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, _08012298 + movs r1, 0 + bl nullsub_5 + adds r4, 0x1 + cmp r4, 0x13 + ble _08012280 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08012298: .4byte 0x082ed82c + 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, _0801236C + 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, _08012370 + 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, _08012370 + 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, _08012374 + movs r1, 0x1 + movs r2, 0xF + bl nullsub_5 + b _080124AA + .align 2, 0 +_0801236C: .4byte 0x03007890 +_08012370: .4byte 0x03005000 +_08012374: .4byte 0x082ed868 +_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, _08012400 + movs r1, 0x6 + adds r2, r4, 0 + bl nullsub_5 + ldr r0, _08012404 + 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, _08012408 + ldr r1, [r5] + ldr r4, _0801240C + ldr r0, _08012410 + 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 + .align 2, 0 +_08012400: .4byte 0x082ed84b +_08012404: .4byte 0x082ed85b +_08012408: .4byte 0x03007890 +_0801240C: .4byte 0x03005000 +_08012410: .4byte 0x00000c3e +_08012414: + movs r6, 0 + ldr r1, _080124B4 + 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, _080124B8 + movs r1, 0x6 + adds r2, r4, 0 + bl nullsub_5 + ldr r0, _080124BC + 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 + .align 2, 0 +_080124B4: .4byte 0x03007890 +_080124B8: .4byte 0x082ed84b +_080124BC: .4byte 0x082ed85b + thumb_func_end sub_801229C + + thumb_func_start sub_80124C0 +sub_80124C0: @ 80124C0 + ldr r0, _080124CC + ldr r1, _080124D0 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080124CC: .4byte 0x03005000 +_080124D0: .4byte 0x00000c1a + thumb_func_end sub_80124C0 + + thumb_func_start sub_80124D4 +sub_80124D4: @ 80124D4 + ldr r0, _080124E0 + ldr r1, _080124E4 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080124E0: .4byte 0x03005000 +_080124E4: .4byte 0x000009e6 + 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 Window_FastFillPixels + 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, _08012540 + subs r0, r5, 0x1 + lsls r0, 2 + b _0801256C + .align 2, 0 +_08012540: .4byte 0x082edb60 +_08012544: + ldr r1, _08012550 + subs r0, r5, 0x1 + lsls r0, 2 + adds r1, 0x14 + b _0801256C + .align 2, 0 +_08012550: .4byte 0x082edb60 +_08012554: + ldr r1, _08012560 + subs r0, r5, 0x1 + lsls r0, 2 + adds r1, 0x28 + b _0801256C + .align 2, 0 +_08012560: .4byte 0x082edb60 +_08012564: + ldr r1, _08012584 + 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 + .align 2, 0 +_08012584: .4byte 0x082edb60 +_08012588: + ldr r1, _080125B8 + 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 Window_CopyToVram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080125B8: .4byte 0x082edb60 + 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, _08012624 + 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, _08012628 + add r0, sp, 0x8 + bl gf_strcpy + 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 decimal_int_to_string + 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 + .align 2, 0 +_08012624: .4byte 0x03005d90 +_08012628: .4byte 0x082ed8cc + 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, _08012644 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08012644: .4byte _08012648 + .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, _080126C4 + ldr r1, _080126C8 + bl ExpandTextCodes +_080126C0: + pop {r0} + bx r0 + .align 2, 0 +_080126C4: .4byte 0x02021fc4 +_080126C8: .4byte 0x082ed960 + 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, _080126E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080126E0: .4byte _080126E4 + .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 sub_801273C +sub_801273C: @ 801273C + push {lr} + ldr r0, _0801276C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08012770 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08012774 + adds r1, r0 + str r1, [r2] + ldr r0, _08012778 + str r1, [r0] + movs r0, 0 + strb r0, [r1, 0xC] + strb r0, [r1, 0xD] + ldr r1, _0801277C + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0801276C: .4byte sub_8012780 + 1 +_08012770: .4byte 0x02022c30 +_08012774: .4byte 0x03005e08 +_08012778: .4byte 0x03000da0 +_0801277C: .4byte 0x020375f0 + thumb_func_end sub_801273C + + 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, _080127A4 + ldr r6, [r0] + ldrb r0, [r6, 0xC] + cmp r0, 0x1E + bls _0801279A + bl _08012F50 +_0801279A: + lsls r0, 2 + ldr r1, _080127A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080127A4: .4byte 0x02022c30 +_080127A8: .4byte _080127AC + .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, _08012888 + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, 0x14 + bne _08012848 + ldr r0, _0801288C + ldr r0, [r0] + ldr r1, _08012890 + 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, _08012894 + ldr r1, _08012898 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + strb r0, [r2] + ldr r4, _0801289C + 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 + .align 2, 0 +_08012888: .4byte 0x020375e0 +_0801288C: .4byte 0x03005d90 +_08012890: .4byte 0x00000ca9 +_08012894: .4byte 0x02022c2c +_08012898: .4byte 0x082f00c4 +_0801289C: .4byte 0x02022c2d +_080128A0: + movs r0, 0x70 + bl malloc_and_clear + str r0, [r6, 0x4] + movs r0, 0xA0 + bl malloc_and_clear + str r0, [r6] + movs r0, 0xA0 + bl malloc_and_clear + 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, _08012920 + bl Window_AddFromTemplate + strb r0, [r6, 0x10] + ldr r0, _08012924 + 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 + .align 2, 0 +_08012920: .4byte 0x082f00bc +_08012924: .4byte 0x02022c2d +_08012928: + ldr r0, _0801292C + b _08012932 + .align 2, 0 +_0801292C: .4byte 0x082f011c +_08012930: + ldr r0, _080129B4 +_08012932: + bl Window_AddFromTemplate + strb r0, [r6, 0xF] +_08012938: + ldr r0, _080129B8 + bl Window_AddFromTemplate + strb r0, [r6, 0x11] + ldrb r0, [r6, 0x10] + movs r1, 0x22 + bl Window_FastFillPixels + ldrb r0, [r6, 0x10] + ldr r2, _080129BC + 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 Window_WriteStandardTileMap + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r6, 0xF] + movs r1, 0 + bl sub_81973FC + ldr r0, _080129C0 + adds r2, r0, 0 + ldr r1, _080129C4 + 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 calls_per_item_funcs_in_list_outer + strb r0, [r6, 0x12] + ldrb r0, [r6, 0x11] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6, 0x11] + bl Window_WriteStandardTileMap + ldrb r0, [r6, 0x11] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + mov r5, r8 + strb r5, [r6, 0x13] + strb r4, [r6, 0xC] + b _08012F50 + .align 2, 0 +_080129B4: .4byte 0x082f0124 +_080129B8: .4byte 0x082f012c +_080129BC: .4byte 0x082edbc4 +_080129C0: .4byte 0x03006310 +_080129C4: .4byte 0x082f015c +_080129C8: + ldr r0, _08012A00 + ldr r2, _08012A04 + ldr r4, _08012A08 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _08012A0C + 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, _08012A10 + ldr r1, _08012A14 + bl ExpandTextCodes + b _08012A34 + .align 2, 0 +_08012A00: .4byte 0x02021cc4 +_08012A04: .4byte 0x082f0048 +_08012A08: .4byte 0x02022c2c +_08012A0C: .4byte 0x02022c2d +_08012A10: .4byte 0x02021fc4 +_08012A14: .4byte 0x082ed990 +_08012A18: + ldr r0, _08012A24 + ldr r1, _08012A28 + bl ExpandTextCodes + b _08012A34 + .align 2, 0 +_08012A24: .4byte 0x02021fc4 +_08012A28: .4byte 0x082ed960 +_08012A2C: + ldr r0, _08012A48 + ldrb r1, [r4] + bl sub_801262C +_08012A34: + ldrb r0, [r6, 0x11] + ldr r1, _08012A4C + ldrb r1, [r1] + ldrb r2, [r6, 0x13] + bl sub_80124EC + movs r0, 0x5 + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012A48: .4byte 0x02021fc4 +_08012A4C: .4byte 0x02022c2d +_08012A50: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, _08012A68 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012A62 + b _08012F50 +_08012A62: + movs r0, 0x6 + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012A68: .4byte 0x02021fc4 +_08012A6C: + adds r0, r6, 0 + movs r1, 0x7 + movs r2, 0xA + bl sub_801320C + ldr r0, _08012A8C + 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 + .align 2, 0 +_08012A8C: .4byte 0x030022c0 +_08012A90: + ldr r0, _08012AA0 + ldrb r1, [r0] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _08012AA4 + movs r0, 0x1E + b _08012AA6 + .align 2, 0 +_08012AA0: .4byte 0x02022c2d +_08012AA4: + movs r0, 0x13 +_08012AA6: + strb r0, [r6, 0xC] +_08012AA8: + ldr r0, _08012AF4 + 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, _08012AF8 + 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 + .align 2, 0 +_08012AF4: .4byte 0x02022c2d +_08012AF8: .4byte 0x030022c0 +_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, _08012B4C + 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, _08012B50 + 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 + .align 2, 0 +_08012B4C: .4byte 0x02022c2c +_08012B50: .4byte 0x082eddc4 +_08012B54: + ldr r0, _08012B84 + 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, _08012B88 + 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 + .align 2, 0 +_08012B84: .4byte 0x02022c2d +_08012B88: .4byte 0x082eddc4 +_08012B8C: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, _08012BA4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012B9E + b _08012F50 +_08012B9E: + movs r0, 0xB + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012BA4: .4byte 0x02021fc4 +_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, _08012CC0 + 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 + .align 2, 0 +_08012CC0: .4byte 0x02022c2d +_08012CC4: + ldr r0, _08012CF4 + ldrb r2, [r6, 0x13] + lsls r2, 5 + subs r2, 0x20 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + ldr r0, _08012CF8 + ldr r1, _08012CFC + bl ExpandTextCodes + movs r0, 0xD + strb r0, [r6, 0xC] +_08012CE0: + bl sub_800EF38 + ldrb r0, [r6, 0x11] + ldr r1, _08012D00 + ldrb r1, [r1] + ldrb r2, [r6, 0x13] + bl sub_80124EC + b _08012D44 + .align 2, 0 +_08012CF4: .4byte 0x02021cc4 +_08012CF8: .4byte 0x02021fc4 +_08012CFC: .4byte 0x082edc9c +_08012D00: .4byte 0x02022c2d +_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, _08012D74 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012D6C + b _08012F50 +_08012D6C: + movs r0, 0xE + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012D74: .4byte 0x02021fc4 +_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, _08012DA4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012D9C + b _08012F50 +_08012D9C: + movs r0, 0x10 + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012DA4: .4byte 0x082edc5c +_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, _08012DE8 + ldrb r1, [r0] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _08012DEC + movs r0, 0x1E + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012DE8: .4byte 0x02022c2d +_08012DEC: + movs r0, 0x13 + strb r0, [r6, 0xC] + b _08012F50 +_08012DF2: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, _08012E0C + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012E04 + b _08012F50 +_08012E04: + movs r0, 0x14 + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012E0C: .4byte 0x082edc78 +_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, _08012E48 + ldrb r2, [r0] + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + beq _08012E4C + movs r0, 0xF + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012E48: .4byte 0x02022c2d +_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, _08012ECC + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08012F50 +_08012EC6: + movs r0, 0x17 + strb r0, [r6, 0xC] + b _08012F50 + .align 2, 0 +_08012ECC: .4byte 0x082edd58 +_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, _08012EF8 + movs r0, 0x5 + strh r0, [r1] + b _08012F50 + .align 2, 0 +_08012EF8: .4byte 0x020375f0 +_08012EFC: + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task + ldr r1, _08012F10 + movs r0, 0x8 + strh r0, [r1] + b _08012F50 + .align 2, 0 +_08012F10: .4byte 0x020375f0 +_08012F14: + bl sub_8011A80 + cmp r0, 0 + beq _08012F22 + movs r0, 0x1D + strb r0, [r6, 0xC] + b _08012F50 +_08012F22: + ldr r0, _08012F5C + ldrb r0, [r0] + cmp r0, 0 + beq _08012F50 + ldr r0, _08012F60 + 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 + .align 2, 0 +_08012F5C: .4byte 0x03003124 +_08012F60: .4byte 0x02022c2c + 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 Window_FillTileMap + 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 Window_FillTileMap + ldrb r0, [r4, 0xF] + movs r1, 0 + bl sub_819746C + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrb r0, [r4, 0x11] + bl Window_Remove + ldrb r0, [r4, 0xF] + bl Window_Remove + ldrb r0, [r4, 0x10] + bl Window_Remove + 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, _08012FDC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08012FDC: .4byte _08012FE0 + .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, _08013054 + b _0801305A + .align 2, 0 +_08013054: .4byte 0x082edbe8 +_08013058: + ldr r1, _08013064 +_0801305A: + adds r0, r2, 0 + bl ExpandTextCodes + b _08013070 + .align 2, 0 +_08013064: .4byte 0x082edc0c +_08013068: + ldr r1, _08013074 + adds r0, r2, 0 + bl ExpandTextCodes +_08013070: + pop {r0} + bx r0 + .align 2, 0 +_08013074: .4byte 0x082edc34 + 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, _080130A0 + bl ExpandTextCodes + b _080130AA + .align 2, 0 +_080130A0: .4byte 0x082ee560 +_080130A4: + ldr r1, _080130B0 + bl ExpandTextCodes +_080130AA: + pop {r0} + bx r0 + .align 2, 0 +_080130B0: .4byte 0x082ee57c + 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, _080130CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080130CC: .4byte _080130D0 + .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, _0801314C + adds r0, r2, 0 + bl ExpandTextCodes + b _08013158 + .align 2, 0 +_0801314C: .4byte 0x082efc3c +_08013150: + ldr r1, _0801315C + adds r0, r2, 0 + bl ExpandTextCodes +_08013158: + pop {r0} + bx r0 + .align 2, 0 +_0801315C: .4byte 0x082efc54 + 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, _08013178 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08013178: .4byte _0801317C + .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, _080131F8 + adds r0, r2, 0 + bl ExpandTextCodes + b _08013204 + .align 2, 0 +_080131F8: .4byte 0x082eddf4 +_080131FC: + ldr r1, _08013208 + adds r0, r2, 0 + bl ExpandTextCodes +_08013204: + pop {r0} + bx r0 + .align 2, 0 +_08013208: .4byte 0x082ede0c + 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, _08013250 + ldrb r2, [r4, 0x13] + lsls r2, 5 + ldr r1, [r4] + adds r1, r2 + bl sub_8018404 + ldr r0, _08013254 + ldr r1, _08013258 + ldrb r1, [r1] + bl sub_8012FC4 + strb r6, [r4, 0xC] + b _08013270 + .align 2, 0 +_08013250: .4byte 0x02021dc4 +_08013254: .4byte 0x02021fc4 +_08013258: .4byte 0x02022c2c +_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, _080132A4 + 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 + .align 2, 0 +_080132A4: .4byte 0x02022c30 +_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, _0801332C + 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 + .align 2, 0 +_0801332C: .4byte 0x02022c30 +_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, _0801346C + 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, _08013470 + 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 + .align 2, 0 +_0801346C: .4byte 0x02022c30 +_08013470: .4byte 0x082f045c +_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 sub_80134A4 +sub_80134A4: @ 80134A4 + push {lr} + ldr r0, _080134D4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080134D8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080134DC + adds r1, r0 + str r1, [r2] + ldr r0, _080134E0 + str r1, [r0] + movs r0, 0 + strb r0, [r1, 0x8] + strb r0, [r1, 0x9] + ldr r1, _080134E4 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080134D4: .4byte sub_80134E8 + 1 +_080134D8: .4byte 0x02022c30 +_080134DC: .4byte 0x03005e08 +_080134E0: .4byte 0x03000da4 +_080134E4: .4byte 0x020375f0 + thumb_func_end sub_80134A4 + + thumb_func_start sub_80134E8 +sub_80134E8: @ 80134E8 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08013508 + ldr r6, [r0] + ldrb r0, [r6, 0x8] + cmp r0, 0x17 + bls _080134FC + b _08013B82 +_080134FC: + lsls r0, 2 + ldr r1, _0801350C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08013508: .4byte 0x02022c30 +_0801350C: .4byte _08013510 + .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, _080135CC + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, 0x14 + bne _08013590 + ldr r0, _080135D0 + ldr r0, [r0] + ldr r1, _080135D4 + 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, _080135D8 + ldr r1, _080135DC + 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 malloc_and_clear + str r0, [r6, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + str r0, [r6] + movs r0, 0x1 + strb r0, [r6, 0x8] + b _08013B82 + .align 2, 0 +_080135CC: .4byte 0x020375e0 +_080135D0: .4byte 0x03005d90 +_080135D4: .4byte 0x00000ca9 +_080135D8: .4byte 0x02022c2c +_080135DC: .4byte 0x082f0530 +_080135E0: + adds r0, r6, 0 + adds r0, 0x9 + ldr r2, _08013604 + ldr r1, _08013608 + 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 + .align 2, 0 +_08013604: .4byte 0x082efb70 +_08013608: .4byte 0x020375e0 +_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, _080136BC + ldrh r1, [r1] + bl sub_8016FC0 + movs r4, 0 + strb r0, [r6, 0x11] + ldr r0, _080136C0 + bl Window_AddFromTemplate + strb r0, [r6, 0xC] + ldr r0, _080136C4 + bl Window_AddFromTemplate + strb r0, [r6, 0xB] + ldr r0, _080136C8 + bl Window_AddFromTemplate + strb r0, [r6, 0xD] + ldrb r0, [r6, 0xC] + movs r1, 0x22 + bl Window_FastFillPixels + ldrb r0, [r6, 0xC] + ldr r2, _080136CC + 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 Window_WriteStandardTileMap + ldrb r0, [r6, 0xC] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r6, 0xB] + movs r1, 0 + bl sub_81973FC + ldr r0, _080136D0 + adds r2, r0, 0 + ldr r1, _080136D4 + 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 calls_per_item_funcs_in_list_outer + strb r0, [r6, 0xE] + ldrb r0, [r6, 0xD] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6, 0xD] + bl Window_WriteStandardTileMap + ldrb r0, [r6, 0xD] + bl sub_80125BC + ldrb r0, [r6, 0xD] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + strb r4, [r6, 0xF] + movs r0, 0x3 + strb r0, [r6, 0x8] + b _08013B82 + .align 2, 0 +_080136BC: .4byte 0x020375e0 +_080136C0: .4byte 0x082f00bc +_080136C4: .4byte 0x082f0174 +_080136C8: .4byte 0x082f017c +_080136CC: .4byte 0x082ef7dc +_080136D0: .4byte 0x03006310 +_080136D4: .4byte 0x082f0204 +_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 sub_81AE604 + adds r4, r0, 0 + ldr r0, _08013740 + 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 + .align 2, 0 +_08013740: .4byte 0x030022c0 +_08013744: + ldr r0, _08013760 + ldr r2, _08013764 + subs r1, 0x1 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + movs r0, 0x12 +_08013756: + strb r0, [r6, 0x8] + movs r0, 0x6E + bl audio_play + b _08013B82 + .align 2, 0 +_08013760: .4byte 0x02021fc4 +_08013764: .4byte 0x082edd50 +_08013768: + movs r0, 0x7 + bl audio_play + b _08013B82 +_08013770: + ldr r0, _08013784 + 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 + .align 2, 0 +_08013784: .4byte 0x030022c0 +_08013788: + ldr r4, _080137B8 + ldr r0, _080137BC + 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, _080137C0 + ldrb r2, [r6, 0xF] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + b _08013A86 + .align 2, 0 +_080137B8: .4byte 0x02021fc4 +_080137BC: .4byte 0x02022c2c +_080137C0: .4byte 0x02021cc4 +_080137C4: + ldr r0, _080137F8 + ldrb r0, [r0] + cmp r0, 0 + beq _0801387A + ldr r4, _080137FC + 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, _08013800 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080137F8: .4byte 0x03003124 +_080137FC: .4byte 0x02022c2c +_08013800: .4byte _08013804 + .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, _08013894 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08013894: .4byte _08013898 + .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, _080138FC + ldr r4, _08013900 + 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 + .align 2, 0 +_080138FC: .4byte 0x02021fc4 +_08013900: .4byte 0x02022c2c +_08013904: + movs r0, 0x7 + movs r1, 0 + bl sub_8011A64 + ldr r0, _08013928 + ldr r2, _0801392C + ldrb r1, [r4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r1, _08013930 + adds r0, r5, 0 + bl ExpandTextCodes + b _080139EC + .align 2, 0 +_08013928: .4byte 0x02021cc4 +_0801392C: .4byte 0x082f0048 +_08013930: .4byte 0x082ede48 +_08013934: + ldrb r0, [r6, 0x15] + adds r2, r0, 0 + cmp r2, 0xF0 + bls _0801395C + adds r0, r6, 0 + adds r0, 0x9 + ldr r1, _08013958 + 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 + .align 2, 0 +_08013958: .4byte 0x02021fc4 +_0801395C: + ldr r0, _08013970 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x1B + bhi _080139E8 + lsls r0, 2 + ldr r1, _08013974 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08013970: .4byte 0x02022c2c +_08013974: .4byte _08013978 + .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, _08013A0C + 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 + .align 2, 0 +_08013A0C: .4byte 0x030022c0 +_08013A10: + adds r0, r6, 0 + adds r0, 0x9 + ldr r1, _08013A28 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08013A22 + b _08013B82 +_08013A22: + movs r0, 0x8 + strb r0, [r6, 0x8] + b _08013B82 + .align 2, 0 +_08013A28: .4byte 0x082ede64 +_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 Window_FillTileMap + 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 Window_FillTileMap + ldrb r0, [r6, 0xB] + movs r1, 0 + bl sub_819746C + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrb r0, [r6, 0xD] + bl Window_Remove + ldrb r0, [r6, 0xB] + bl Window_Remove + ldrb r0, [r6, 0xC] + bl Window_Remove + 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, _08013B0C + 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, _08013B10 + movs r1, 0x6 + b _08013B58 + .align 2, 0 +_08013B0C: .4byte 0x082ede9c +_08013B10: .4byte 0x020375f0 +_08013B14: + bl sub_800E084 + ldr r0, _08013B20 + movs r1, 0x5 + b _08013B58 + .align 2, 0 +_08013B20: .4byte 0x020375f0 +_08013B24: + bl sub_800E084 + adds r5, r6, 0 + adds r5, 0x9 + ldr r4, _08013B40 + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r1, [r0] + adds r0, r5, 0 + b _08013B4A + .align 2, 0 +_08013B40: .4byte 0x082ede9c +_08013B44: + adds r0, r6, 0 + adds r0, 0x9 + ldr r1, _08013B60 +_08013B4A: + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08013B82 + ldr r0, _08013B64 + movs r1, 0x8 +_08013B58: + strh r1, [r0] + movs r0, 0x17 + strb r0, [r6, 0x8] + b _08013B82 + .align 2, 0 +_08013B60: .4byte 0x02021fc4 +_08013B64: .4byte 0x020375f0 +_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, _08013BBC + 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, _08013BC0 + 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 + .align 2, 0 +_08013BBC: .4byte 0x02022c2c +_08013BC0: .4byte 0x03005d90 +_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, _08013C34 + ldrb r2, [r4, 0xF] + lsls r2, 5 + ldr r1, [r4] + adds r1, r2 + bl sub_8018404 + ldr r1, _08013C38 + ldr r0, _08013C3C + 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 + .align 2, 0 +_08013C34: .4byte 0x02021cc4 +_08013C38: .4byte 0x082f0530 +_08013C3C: .4byte 0x020375e0 + thumb_func_end sub_8013BD8 + + thumb_func_start sub_8013C40 +sub_8013C40: @ 8013C40 + push {lr} + ldr r0, _08013C6C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08013C70 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, _08013C74 + adds r1, r2 + str r1, [r3] + movs r2, 0 + strb r2, [r1, 0x8] + strb r2, [r1, 0x9] + ldr r2, _08013C78 + str r1, [r2] + pop {r1} + bx r1 + .align 2, 0 +_08013C6C: .4byte sub_8013C7C + 1 +_08013C70: .4byte 0x02022c30 +_08013C74: .4byte 0x03005e08 +_08013C78: .4byte 0x03000da4 + 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, _08013C98 + ldr r4, [r0] + ldrb r0, [r4, 0x8] + cmp r0, 0xB + bhi _08013D80 + lsls r0, 2 + ldr r1, _08013C9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08013C98: .4byte 0x02022c30 +_08013C9C: .4byte _08013CA0 + .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 malloc_and_clear + str r0, [r4, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + 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, _08013D54 + 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 + .align 2, 0 +_08013D54: .4byte 0x03005e00 +_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, _08013DA4 + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + b _08013DB0 + .align 2, 0 +_08013DA4: .4byte 0x082f04d8 +_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, _08013E40 + 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 + .align 2, 0 +_08013E40: .4byte 0x02022c30 + 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, _08013EAC + 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 + .align 2, 0 +_08013EAC: .4byte 0x02022c30 +_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, _08013F5C + 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 + .align 2, 0 +_08013F5C: .4byte 0x0000012b + 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, _08013F8C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08013F8C: .4byte sub_8013F60 + 1 + 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, _08013FCC + 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, _08013FD0 + 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 + .align 2, 0 +_08013FCC: .4byte 0x02022c40 +_08013FD0: .4byte 0x03005e00 +_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, _08013FF8 + adds r1, r0 + movs r0, 0 + movs r2, 0x64 + bl link_0800A448 + b _080140BC + .align 2, 0 +_08013FF8: .4byte 0x020244ec +_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, _08014030 + movs r2, 0x1 + eors r1, r2 + lsls r1, 24 + lsrs r1, 16 + ldr r2, _08014034 + adds r1, r2 + movs r2, 0x64 + bl memcpy + movs r0, 0x32 + bl sav12_xor_increment + bl sub_800A5B4 + b _0801405A + .align 2, 0 +_08014030: .4byte 0x02024744 +_08014034: .4byte 0x020223c4 +_08014038: + ldr r4, _08014064 + ldr r0, _08014068 + ldr r1, [r0] + ldr r0, _0801406C + 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 + .align 2, 0 +_08014064: .4byte 0x020228c4 +_08014068: .4byte 0x03005d8c +_0801406C: .4byte 0x00002be0 +_08014070: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080140BC + ldr r4, _080140C8 + bl link_get_multiplayer_id + adds r1, r0, 0 + movs r0, 0x1 + eors r1, r0 + lsls r1, 24 + lsrs r1, 16 + ldr r0, _080140CC + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xD8 + bl memcpy + bl sub_800A5B4 + ldr r1, _080140D0 + strb r7, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r1, _080140D4 + ldr r0, _080140D8 + str r0, [r1, 0x8] + ldr r0, _080140DC + bl set_callback2 + 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 + .align 2, 0 +_080140C8: .4byte 0x020321c0 +_080140CC: .4byte 0x020223c4 +_080140D0: .4byte 0x02032298 +_080140D4: .4byte 0x030022c0 +_080140D8: .4byte c2_exit_to_overworld_2_switch + 1 +_080140DC: .4byte sub_807AE50 + 1 + 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, _08014100 + 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 + .align 2, 0 +_08014100: .4byte 0x03005e00 +_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, _08014134 + b _08014152 + .align 2, 0 +_08014134: .4byte 0x020229e8 +_08014138: + lsls r1, r4, 8 + ldr r0, _08014188 + adds r3, r1, r0 + movs r0, 0x64 + muls r0, r4 + ldr r1, _0801418C + 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, _08014188 + adds r3, r0, r1 + adds r0, r3, 0 + adds r0, 0x60 + ldrh r0, [r0] + bl sub_801B94C + b _08014194 + .align 2, 0 +_08014188: .4byte 0x020223c4 +_0801418C: .4byte 0x02039b58 +_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, _080141BC + 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 + .align 2, 0 +_080141BC: .4byte 0x030022c0 +_080141C0: + ldr r0, _080141D0 + movs r1, 0x5 + bl AddTask + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080141F2 + .align 2, 0 +_080141D0: .4byte sub_80140E0 + 1 +_080141D4: + ldr r0, _08014208 + 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, _0801420C + bl sub_80C4E74 +_080141F2: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08014208: .4byte sub_80140E0 + 1 +_0801420C: .4byte c2_exit_to_overworld_2_switch + 1 + 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 sub_8076ECC + ldr r5, _0801427C + ldr r0, _08014280 + 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, _08014284 + ldr r0, _08014288 + str r0, [r1, 0x8] + ldr r0, _0801428C + str r6, [r0] + bl sub_806E64C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801427C: .4byte 0x020229e8 +_08014280: .4byte 0x00002211 +_08014284: .4byte 0x030022c0 +_08014288: .4byte sub_80B360C + 1 +_0801428C: .4byte 0x02022fec + 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, _080142FC + adds r1, r3, 0 + bl var_set + ldr r6, _08014300 + 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 + .align 2, 0 +_080142FC: .4byte 0x00004087 +_08014300: .4byte 0x03005d8c + 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, _08014374 + strh r1, [r0] + ldr r0, _08014378 + bl var_set + bl sub_8009FCC + ldr r1, _0801437C + strb r0, [r1] + bl link_get_multiplayer_id + ldr r1, _08014380 + 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 + .align 2, 0 +_08014374: .4byte 0x020375e0 +_08014378: .4byte 0x00004087 +_0801437C: .4byte 0x03005db8 +_08014380: .4byte 0x03005db4 + thumb_func_end sub_8014304 + + thumb_func_start sub_8014384 +sub_8014384: @ 8014384 + push {r4,lr} + ldr r0, _0801439C + 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 + .align 2, 0 +_0801439C: .4byte 0x030022c0 +_080143A0: + ldr r0, _080143B0 + movs r1, 0x5 + bl AddTask + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080143C6 + .align 2, 0 +_080143B0: .4byte sub_80140E0 + 1 +_080143B4: + ldr r0, _080143DC + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080143C6 + ldr r0, _080143E0 + bl set_callback2 +_080143C6: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080143DC: .4byte sub_80140E0 + 1 +_080143E0: .4byte sub_8086074 + 1 + 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, _0801442C + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0xE + bhi _08014474 + lsls r0, 2 + ldr r1, _08014430 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801442C: .4byte 0x02022c2c +_08014430: .4byte _08014434 + .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, _0801448C + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x50 + bls _08014480 + b _08014764 +_08014480: + lsls r0, 2 + ldr r1, _08014490 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801448C: .4byte 0x02022c2c +_08014490: .4byte _08014494 + .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, _080145EC + ldr r0, _080145F0 + str r0, [r1, 0x8] + movs r0, 0x3 + bl sub_81B8518 + b _08014764 + .align 2, 0 +_080145EC: .4byte 0x030022c0 +_080145F0: .4byte sub_801AC54 + 1 +_080145F4: + bl overworld_free_bg_tilemaps + ldr r0, _0801461C + movs r1, 0x1 + bl sub_80143E4 + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl sub_8076ECC + movs r0, 0x1 + str r0, [sp] + movs r0, 0x19 + movs r1, 0x18 + movs r2, 0x6 + movs r3, 0x8 + b _080146B0 + .align 2, 0 +_0801461C: .4byte 0x020228c4 +_08014620: + bl overworld_free_bg_tilemaps + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl sub_8076ECC + ldr r0, _08014648 + 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 + .align 2, 0 +_08014648: .4byte 0x020228c4 +_0801464C: + bl overworld_free_bg_tilemaps + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl sub_8076ECC + ldr r0, _08014674 + 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 + .align 2, 0 +_08014674: .4byte 0x020228c4 +_08014678: + ldr r0, _08014694 + 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 + .align 2, 0 +_08014694: .4byte 0x020228c4 +_08014698: + ldr r0, _080146BC + 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, _080146C0 + bl set_callback2 + b _08014764 + .align 2, 0 +_080146BC: .4byte 0x020228c4 +_080146C0: .4byte sub_8014384 + 1 +_080146C4: + bl overworld_free_bg_tilemaps + ldr r0, _080146D4 + movs r1, 0 + bl AddTask + b _08014764 + .align 2, 0 +_080146D4: .4byte sub_8013F90 + 1 +_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, _0801470C + movs r1, 0 + bl sub_80143E4 + ldr r0, _08014710 + bl set_callback2 + b _08014764 + .align 2, 0 +_0801470C: .4byte 0x020228c4 +_08014710: .4byte sub_80141A4 + 1 +_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, _08014730 + bl sub_802A9A8 + b _08014764 + .align 2, 0 +_08014730: .4byte c2_load_new_map + 1 +_08014734: + movs r0, 0x7 + movs r1, 0x9 + movs r2, 0x1 + bl sub_8014290 + ldr r0, _08014748 + bl sub_8020C70 + b _08014764 + .align 2, 0 +_08014748: .4byte c2_load_new_map + 1 +_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, _08014784 + bl sub_802493C +_08014764: + adds r0, r4, 0 + bl remove_task + ldr r1, _08014788 + movs r0, 0x1 + strh r0, [r1] + ldr r0, _0801478C + ldrb r0, [r0] + cmp r0, 0x44 + beq _0801477C + bl script_env_2_disable +_0801477C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08014784: .4byte c2_load_new_map + 1 +_08014788: .4byte 0x020375f0 +_0801478C: .4byte 0x02022c2c + 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, _080147C0 + adds r7, r0, r1 + ldr r0, _080147C4 + 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, _080147C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080147C0: .4byte 0x03005e08 +_080147C4: .4byte 0x020228c4 +_080147C8: .4byte _080147CC + .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, _0801480C + movs r0, 0x1 + strh r0, [r1] + ldr r0, _08014810 + ldrb r0, [r0] + subs r0, 0xE + cmp r0, 0xE + bhi _080148C2 + lsls r0, 2 + ldr r1, _08014814 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801480C: .4byte 0x020375f0 +_08014810: .4byte 0x02022c2c +_08014814: .4byte _08014818 + .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, _080148A4 + ldr r0, _080148A8 + 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, _080148AC + ldrb r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, _080148B0 + 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, _080148B4 + mov r1, r8 + str r1, [r0, 0x8] + movs r0, 0x4 + strh r0, [r7] + bl sub_800E3A8 + bl sub_800A5B4 + b _080149B2 + .align 2, 0 +_080148A4: .4byte 0x020229e8 +_080148A8: .4byte 0x00002211 +_080148AC: .4byte 0x0203cef8 +_080148B0: .4byte 0x02024488 +_080148B4: .4byte 0x030022c0 +_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, _08014908 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080149B2 + ldr r0, _0801490C + ldrb r0, [r0] + cmp r0, 0x1D + bne _08014914 + adds r0, r4, 0 + bl remove_task + ldr r0, _08014910 + bl set_callback2 + b _080149B2 + .align 2, 0 +_08014908: .4byte 0x02037fd4 +_0801490C: .4byte 0x02022c2c +_08014910: .4byte sub_80773AC + 1 +_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, _08014978 + movs r2, 0x80 + lsls r2, 1 + adds r1, r0, r2 + bl sub_80B2AF4 + cmp r0, 0 + beq _08014980 + ldr r0, _0801497C + movs r1, 0xB + strh r1, [r0] + movs r0, 0x7 + strh r0, [r7] + b _080149B2 + .align 2, 0 +_08014978: .4byte 0x020223c4 +_0801497C: .4byte 0x020375f0 +_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, _080149C0 + 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 + .align 2, 0 +_080149C0: .4byte 0x03003124 + thumb_func_end sub_8014790 + + thumb_func_start sub_80149C4 +sub_80149C4: @ 80149C4 + push {lr} + ldr r0, _080149D4 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080149D4: .4byte sub_8014790 + 1 + thumb_func_end sub_80149C4 + + thumb_func_start sub_80149D8 +sub_80149D8: @ 80149D8 + push {lr} + ldr r0, _080149F8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080149FC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_080149F8: .4byte sub_801440C + 1 +_080149FC: .4byte 0x03005e00 + thumb_func_end sub_80149D8 + + thumb_func_start sub_8014A00 +sub_8014A00: @ 8014A00 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08014A30 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08014A34 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08014A38 + adds r1, r0 + str r1, [r2] + movs r2, 0 + strb r2, [r1, 0xC] + strb r2, [r1, 0xD] + strb r4, [r1, 0x18] + ldr r0, _08014A3C + strh r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08014A30: .4byte sub_8014A40 + 1 +_08014A34: .4byte 0x02022c30 +_08014A38: .4byte 0x03005e08 +_08014A3C: .4byte 0x020375f0 + 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, _08014A60 + ldr r5, [r0] + ldrb r0, [r5, 0xC] + cmp r0, 0x11 + bls _08014A54 + b _08014EF2 +_08014A54: + lsls r0, 2 + ldr r1, _08014A64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08014A60: .4byte 0x02022c30 +_08014A64: .4byte _08014A68 + .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, _08014AE4 + ldrb r0, [r5, 0x18] + strb r0, [r1] + ldr r1, _08014AE8 + 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 + .align 2, 0 +_08014AE4: .4byte 0x02022c2c +_08014AE8: .4byte 0x02022c2d +_08014AEC: + movs r0, 0x70 + bl malloc_and_clear + str r0, [r5, 0x4] + movs r0, 0xA0 + bl malloc_and_clear + str r0, [r5] + movs r0, 0xA0 + bl malloc_and_clear + 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, _08014BA8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + bl sub_8019930 + lsls r0, 16 + ldr r2, _08014BAC + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + ldr r0, _08014BB0 + ands r1, r0 + movs r0, 0xC0 + lsls r0, 4 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r5, 0xF] + ldrb r0, [r5, 0xF] + bl sub_8018784 + ldr r0, _08014BB4 + adds r2, r0, 0 + ldr r1, _08014BB8 + 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 calls_per_item_funcs_in_list_outer + strb r0, [r5, 0x12] + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + strb r0, [r5, 0x13] + b _08014C42 + .align 2, 0 +_08014BA8: .4byte 0x082f011c +_08014BAC: .4byte 0x0000ffff +_08014BB0: .4byte 0xffff00ff +_08014BB4: .4byte 0x03006310 +_08014BB8: .4byte 0x082f015c +_08014BBC: + ldr r0, _08014BDC + ldr r2, _08014BE0 + ldr r4, _08014BE4 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _08014BE8 + ldrb r1, [r4] + bl sub_801262C + movs r0, 0x3 + strb r0, [r5, 0xC] + b _08014EF2 + .align 2, 0 +_08014BDC: .4byte 0x02021cc4 +_08014BE0: .4byte 0x082f0048 +_08014BE4: .4byte 0x02022c2c +_08014BE8: .4byte 0x02021fc4 +_08014BEC: + ldr r0, _08014BF8 + bl sub_8018884 + movs r0, 0x4 + strb r0, [r5, 0xC] + b _08014EF2 + .align 2, 0 +_08014BF8: .4byte 0x02021fc4 +_08014BFC: + adds r0, r5, 0 + movs r1, 0x5 + movs r2, 0x6 + bl sub_801320C + ldr r0, _08014C20 + 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 + .align 2, 0 +_08014C20: .4byte 0x030022c0 +_08014C24: + adds r0, r5, 0 + adds r0, 0xD + ldr r1, _08014C48 + 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 + .align 2, 0 +_08014C48: .4byte 0x082edf40 +_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, _08014C78 + 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 + .align 2, 0 +_08014C78: .4byte 0x02021fc4 +_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, _08014D58 + ldrb r2, [r5, 0x13] + lsls r2, 5 + subs r2, 0x20 + ldr r1, [r5] + adds r1, r2 + bl sub_8018404 + ldr r0, _08014D5C + ldr r1, _08014D60 + bl ExpandTextCodes + movs r0, 0x9 + strb r0, [r5, 0xC] + bl sub_800EF38 + b _08014DA4 + .align 2, 0 +_08014D58: .4byte 0x02021cc4 +_08014D5C: .4byte 0x02021fc4 +_08014D60: .4byte 0x082edc9c +_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, _08014DC8 + bl sub_8018884 + movs r0, 0xA + strb r0, [r5, 0xC] + b _08014EF2 + .align 2, 0 +_08014DC8: .4byte 0x02021fc4 +_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 gpu_copy_wram_bg_tilemap_to_vram + ldrb r0, [r5, 0xF] + bl Window_Remove + 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, _08014E6C + bl mevent_0814257C + cmp r0, 0 + beq _08014EF2 + adds r0, r4, 0 + bl remove_task + ldr r1, _08014E70 + movs r0, 0x5 + strh r0, [r1] + b _08014EF2 + .align 2, 0 +_08014E6C: .4byte 0x082ed8d0 +_08014E70: .4byte 0x020375f0 +_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, _08014EA4 + ldrb r0, [r0] + cmp r0, 0 + beq _08014EF2 + movs r0, 0x1 + bl sub_8011068 + b _08014EDA + .align 2, 0 +_08014EA4: .4byte 0x03003124 +_08014EA8: + ldrb r0, [r5, 0x12] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrb r0, [r5, 0xF] + bl Window_Remove + 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, _08014F34 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08014F38 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08014F3C + adds r1, r0 + str r1, [r2] + ldr r0, _08014F40 + str r1, [r0] + movs r2, 0 + strb r2, [r1, 0x8] + strb r2, [r1, 0x9] + subs r4, 0x15 + strb r4, [r1, 0x12] + ldr r0, _08014F44 + strh r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08014F34: .4byte sub_8014F48 + 1 +_08014F38: .4byte 0x02022c30 +_08014F3C: .4byte 0x03005e08 +_08014F40: .4byte 0x03000da4 +_08014F44: .4byte 0x020375f0 + 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, _08014F68 + ldr r7, [r0] + ldrb r0, [r7, 0x8] + cmp r0, 0xC + bls _08014F5C + b _080152A0 +_08014F5C: + lsls r0, 2 + ldr r1, _08014F6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08014F68: .4byte 0x02022c30 +_08014F6C: .4byte _08014F70 + .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 malloc_and_clear + str r0, [r7, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + str r0, [r7] + movs r0, 0x1 + strb r0, [r7, 0x8] + b _080152A0 +_08014FD8: + ldr r0, _08014FE4 + bl sub_8018884 + movs r0, 0x2 + strb r0, [r7, 0x8] + b _080152A0 + .align 2, 0 +_08014FE4: .4byte 0x082ef7f8 +_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, _080150A0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + bl sub_8019930 + lsls r0, 16 + ldr r2, _080150A4 + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + ldr r5, _080150A8 + ands r1, r5 + movs r4, 0xC0 + lsls r4, 4 + orrs r1, r4 + str r1, [sp, 0x4] + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r7, 0xB] + ldr r0, _080150AC + 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 Window_AddFromTemplate + strb r0, [r7, 0xD] + ldrb r0, [r7, 0xB] + bl sub_8018784 + ldr r0, _080150B0 + adds r2, r0, 0 + ldr r1, _080150B4 + 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 calls_per_item_funcs_in_list_outer + strb r0, [r7, 0xE] + ldrb r0, [r7, 0xD] + bl sub_8018784 + ldrb r0, [r7, 0xD] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r7, 0xD] + bl Window_WriteStandardTileMap + ldrb r0, [r7, 0xD] + bl sub_80125BC + ldrb r0, [r7, 0xD] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + strb r6, [r7, 0xF] + movs r0, 0x3 + strb r0, [r7, 0x8] + b _080152A0 + .align 2, 0 +_080150A0: .4byte 0x082f0174 +_080150A4: .4byte 0x0000ffff +_080150A8: .4byte 0xffff00ff +_080150AC: .4byte 0x082f017c +_080150B0: .4byte 0x03006310 +_080150B4: .4byte 0x082f0204 +_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 sub_81AE604 + adds r2, r0, 0 + ldr r0, _08015158 + 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, _0801515C + 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 + .align 2, 0 +_08015158: .4byte 0x030022c0 +_0801515C: .4byte 0x02021cc4 +_08015160: + movs r0, 0x7 + bl audio_play + b _080152A0 +_08015168: + ldr r0, _0801517C + 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 + .align 2, 0 +_0801517C: .4byte 0x030022c0 +_08015180: + ldr r0, _0801519C + bl sub_8018884 + ldr r0, _080151A0 + 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 + .align 2, 0 +_0801519C: .4byte 0x082efc3c +_080151A0: .4byte 0x02021cc4 +_080151A4: + ldr r0, _080151DC + ldrb r0, [r0] + cmp r0, 0 + beq _080151C2 + ldr r2, _080151E0 + 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 + .align 2, 0 +_080151DC: .4byte 0x03003124 +_080151E0: .4byte 0x02022c2c +_080151E4: + cmp r0, 0x6 + bne _080152A0 +_080151E8: + movs r0, 0x8 + strb r0, [r7, 0x8] + b _080152A0 +_080151EE: + ldr r0, _08015200 + bl sub_8018884 + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + b _080152A0 + .align 2, 0 +_08015200: .4byte 0x082eddf4 +_08015204: + ldrb r0, [r7, 0xE] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrb r0, [r7, 0xD] + bl Window_Remove + ldrb r0, [r7, 0xB] + bl Window_Remove + 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, _0801525C + 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 + .align 2, 0 +_0801525C: .4byte 0x082edf80 +_08015260: + bl sub_800E084 + ldr r0, _0801527C + bl sub_8018884 +_0801526A: + adds r0, r6, 0 + bl remove_task + bl sub_800EDD4 + ldr r1, _08015280 + movs r0, 0x5 + strh r0, [r1] + b _080152A0 + .align 2, 0 +_0801527C: .4byte 0x082ed8d0 +_08015280: .4byte 0x020375f0 +_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, _080152E0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080152E4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080152E8 + adds r1, r0 + str r1, [r2] + ldr r0, _080152EC + str r1, [r0] + movs r2, 0 + strb r2, [r1, 0x8] + strb r2, [r1, 0x9] + subs r4, 0x15 + strb r4, [r1, 0x12] + ldr r0, _080152F0 + strh r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080152E0: .4byte task00_081182DC + 1 +_080152E4: .4byte 0x02022c30 +_080152E8: .4byte 0x03005e08 +_080152EC: .4byte 0x03000da4 +_080152F0: .4byte 0x020375f0 + 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, _08015314 + ldr r5, [r0] + ldrb r0, [r5, 0x8] + cmp r0, 0xE + bls _08015308 + b _08015604 +_08015308: + lsls r0, 2 + ldr r1, _08015318 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08015314: .4byte 0x02022c30 +_08015318: .4byte _0801531C + .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 malloc_and_clear + str r0, [r5, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + str r0, [r5] + movs r0, 0x1 + strb r0, [r5, 0x8] + b _08015604 +_08015386: + ldr r0, _08015394 + bl sub_8018884 + movs r0, 0x2 + strb r0, [r5, 0x8] + b _08015604 + .align 2, 0 +_08015394: .4byte 0x082efbc8 +_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, _08015410 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + bl sub_8019930 + lsls r0, 16 + ldr r2, _08015414 + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r5, 0xB] + ldrb r0, [r5, 0xB] + bl sub_8018784 + ldr r0, _08015418 + adds r2, r0, 0 + ldr r1, _0801541C + 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 calls_per_item_funcs_in_list_outer + strb r0, [r5, 0xE] + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_08015404: + movs r0, 0 + strb r0, [r5, 0xF] + movs r0, 0x3 + strb r0, [r5, 0x8] + b _08015604 + .align 2, 0 +_08015410: .4byte 0x082f0174 +_08015414: .4byte 0x0000ffff +_08015418: .4byte 0x03006310 +_0801541C: .4byte 0x082f0204 +_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 sub_81AE604 +_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, _080154DC + 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 + .align 2, 0 +_080154DC: .4byte 0x030022c0 +_080154E0: + ldr r0, _080154FC + bl sub_8018884 + ldr r0, _08015500 + 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 + .align 2, 0 +_080154FC: .4byte 0x082efc90 +_08015500: .4byte 0x02021cc4 +_08015504: + ldr r0, _0801553C + ldrb r0, [r0] + cmp r0, 0 + beq _08015522 + ldr r2, _08015540 + 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 + .align 2, 0 +_0801553C: .4byte 0x03003124 +_08015540: .4byte 0x02022c2c +_08015544: + cmp r0, 0x6 + bne _08015604 +_08015548: + movs r0, 0x8 + strb r0, [r5, 0x8] + b _08015604 +_0801554E: + ldr r0, _08015560 + bl sub_8018884 + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + b _08015604 + .align 2, 0 +_08015560: .4byte 0x082edec4 +_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 gpu_copy_wram_bg_tilemap_to_vram + ldrb r0, [r5, 0xB] + bl Window_Remove +_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, _080155A4 + b _080155C2 + .align 2, 0 +_080155A4: .4byte 0x082edf04 +_080155A8: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, _080155B0 + b _080155C2 + .align 2, 0 +_080155B0: .4byte 0x082ed8f8 +_080155B4: + adds r0, r5, 0 + adds r0, 0x9 + ldr r2, _080155E0 + 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, _080155E4 + movs r0, 0x5 + strh r0, [r1] + b _08015604 + .align 2, 0 +_080155E0: .4byte 0x082efd58 +_080155E4: .4byte 0x020375f0 +_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 sub_801560C +sub_801560C: @ 801560C + push {r4,lr} + bl sub_8010F60 + ldr r0, _08015648 + movs r1, 0xA + bl AddTask + ldr r4, _0801564C + movs r0, 0x9B + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + ldr r1, _08015650 + str r0, [r1] + movs r1, 0 + strb r1, [r0, 0x14] + strb r1, [r0, 0x16] + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + ldr r0, _08015654 + strh r1, [r0] + movs r0, 0xD0 + movs r1, 0x1 + bl sub_819A2BC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08015648: .4byte sub_80156E0 + 1 +_0801564C: .4byte 0x02022c30 +_08015650: .4byte 0x03000da8 +_08015654: .4byte 0x020375f0 + thumb_func_end sub_801560C + + 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, _08015684 + ldr r2, [r1] + movs r1, 0x8 + strb r1, [r2, 0x14] + strb r0, [r2, 0x15] + ldr r0, _08015688 + cmp r3, r0 + beq _0801567E + adds r1, r3, 0 + bl ExpandTextCodes +_0801567E: + pop {r0} + bx r0 + .align 2, 0 +_08015684: .4byte 0x02022c30 +_08015688: .4byte 0x02021fc4 + thumb_func_end sub_8015664 + + thumb_func_start sub_801568C +sub_801568C: @ 801568C + push {lr} + adds r2, r0, 0 + ldr r0, _080156A8 + ldr r1, [r0] + movs r0, 0x1A + strb r0, [r1, 0x14] + ldr r0, _080156AC + cmp r2, r0 + beq _080156A4 + adds r1, r2, 0 + bl ExpandTextCodes +_080156A4: + pop {r0} + bx r0 + .align 2, 0 +_080156A8: .4byte 0x02022c30 +_080156AC: .4byte 0x02021fc4 + thumb_func_end sub_801568C + + thumb_func_start sub_80156B0 +sub_80156B0: @ 80156B0 + push {lr} + ldr r3, _080156C4 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r0, r3, 0 + bl memcpy + pop {r0} + bx r0 + .align 2, 0 +_080156C4: .4byte 0x0201ff00 + thumb_func_end sub_80156B0 + + thumb_func_start sub_80156C8 +sub_80156C8: @ 80156C8 + push {lr} + ldr r0, [r0] + ldr r1, _080156DC + movs r2, 0x80 + lsls r2, 1 + bl memcpy + pop {r0} + bx r0 + .align 2, 0 +_080156DC: .4byte 0x0201ff00 + 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, _0801570C + ldr r6, [r0] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08015710 + adds r7, r0, r1 + ldrb r0, [r6, 0x14] + cmp r0, 0x38 + bls _08015702 + bl _08016878 +_08015702: + lsls r0, 2 + ldr r1, _08015714 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801570C: .4byte 0x02022c30 +_08015710: .4byte 0x03005e08 +_08015714: .4byte _08015718 + .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 malloc_and_clear + str r0, [r6, 0x4] + movs r0, 0x70 + bl malloc_and_clear + str r0, [r6, 0xC] + movs r0, 0x80 + lsls r0, 1 + bl malloc_and_clear + str r0, [r6] + movs r0, 0x20 + bl malloc_and_clear + str r0, [r6, 0x8] + ldr r0, [r6] + movs r1, 0x8 + bl sub_8017580 + ldr r1, _08015850 + 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 + .align 2, 0 +_08015850: .4byte 0x02022c2c +_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, _080158C0 + 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, _080158C4 + movs r0, 0 + strh r0, [r1] + movs r0, 0x3 + bl _08016876 + .align 2, 0 +_080158C0: .4byte 0x02022c40 +_080158C4: .4byte 0x020375f0 +_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, _080158FC + 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 + .align 2, 0 +_080158FC: .4byte 0x02022c40 +_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, _08015928 + bl sub_801568C + b _0801598E + .align 2, 0 +_08015928: .4byte 0x082ef4fc +_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, _08015948 + movs r0, 0x34 + bl sub_8015664 + b _0801598E + .align 2, 0 +_08015948: .4byte 0x082ef47c +_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, _08015968 + bl sub_801568C + b _0801598E + .align 2, 0 +_08015968: .4byte 0x082ef544 +_0801596C: + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + ldr r1, _08015998 + 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, _0801599C + movs r0, 0 + strh r0, [r1] + bl _08016878 + .align 2, 0 +_08015998: .4byte 0x02022c2c +_0801599C: .4byte 0x02022c40 +_080159A0: + movs r0, 0x4 + bl _08016876 +_080159A6: + ldr r4, _080159D4 + 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, _080159D8 + ldr r1, _080159DC + ldr r1, [r1] + bl gf_strcpy + movs r1, 0 + movs r0, 0x2A + b _08015A02 + .align 2, 0 +_080159D4: .4byte 0x020375f0 +_080159D8: .4byte 0x02021cc4 +_080159DC: .4byte 0x03005d90 +_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, _08015A48 + 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 + .align 2, 0 +_08015A48: .4byte 0x030022c0 +_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, _08015A78 + ldr r1, _08015A7C + ldr r1, [r1] + bl gf_strcpy + movs r0, 0x2D + bl _08016876 + .align 2, 0 +_08015A78: .4byte 0x02021cc4 +_08015A7C: .4byte 0x03005d90 +_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, _08015AFC + 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 + .align 2, 0 +_08015AFC: .4byte sub_809FA34 + 1 +_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, _08015B64 + ldrb r2, [r2] + bl sub_8012188 + strh r5, [r6, 0x12] + movs r0, 0x19 + bl _08016876 + .align 2, 0 +_08015B64: .4byte 0x02022c2c +_08015B68: + ldr r1, _08015B74 + movs r0, 0x13 + bl sub_8015664 + bl _08016878 + .align 2, 0 +_08015B74: .4byte 0x02021fc4 +_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, _08015BAC + bl sub_801568C + b _08015BB8 + .align 2, 0 +_08015BAC: .4byte 0x082ee6c8 +_08015BB0: + ldr r1, _08015BE0 + movs r0, 0x1E + bl sub_8015664 +_08015BB8: + ldr r1, _08015BE4 + movs r0, 0x40 + strb r0, [r1] +_08015BBE: + ldr r0, _08015BE8 + ldrb r0, [r0] + cmp r0, 0 + bne _08015BCA + bl _08016878 +_08015BCA: + ldr r0, _08015BEC + movs r1, 0x1 + bl sub_80143E4 + ldr r0, _08015BF0 + movs r1, 0x5 + bl AddTask + movs r0, 0x26 + bl _08016876 + .align 2, 0 +_08015BE0: .4byte 0x082ee6c8 +_08015BE4: .4byte 0x02022c2c +_08015BE8: .4byte 0x03003124 +_08015BEC: .4byte 0x020228c4 +_08015BF0: .4byte sub_80140E0 + 1 +_08015BF4: + ldr r0, _08015C18 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08015C04 + bl _08016878 +_08015C04: + ldr r0, _08015C1C + ldrb r0, [r0] + cmp r0, 0x44 + bne _08015C24 + ldr r1, _08015C20 + movs r0, 0x1F + bl sub_8015664 + bl _08016878 + .align 2, 0 +_08015C18: .4byte sub_80140E0 + 1 +_08015C1C: .4byte 0x02022c2c +_08015C20: .4byte 0x082ee004 +_08015C24: + movs r0, 0x5 + bl _08016876 +_08015C2A: + ldr r0, _08015C50 + 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 + .align 2, 0 +_08015C50: .4byte 0x03003124 +_08015C54: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1B + adds r2, r6, 0 + adds r2, 0x1C + ldr r3, _08015C88 + ldr r4, _08015C8C + 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, _08015C90 + ldrb r0, [r0] + cmp r0, 0 + bne _08015C94 + movs r0, 0x1C + bl _08016876 + .align 2, 0 +_08015C88: .4byte 0x082f021c +_08015C8C: .4byte 0x082f0244 +_08015C90: .4byte 0x03003124 +_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, _08015CD8 + ldr r2, _08015CDC + ldr r1, _08015CE0 + ldrb r1, [r1, 0x13] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + movs r0, 0x20 + bl _08016876 + .align 2, 0 +_08015CD8: .4byte 0x02021fc4 +_08015CDC: .4byte 0x082eeb80 +_08015CE0: .4byte 0x020229e8 +_08015CE4: + ldr r0, _08015D0C + strb r5, [r0] + ldr r1, _08015D10 + 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, _08015D14 + movs r0, 0x5 + bl sub_8015664 + bl _08016878 + .align 2, 0 +_08015D0C: .4byte 0x02022c2c +_08015D10: .4byte 0x02022c2d +_08015D14: .4byte 0x082eebd0 +_08015D18: + ldr r0, _08015D30 + 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 + .align 2, 0 +_08015D30: .4byte 0x02022c2c +_08015D34: + ldr r0, _08015D44 + ldr r1, _08015D48 + bl gf_strcpy + movs r0, 0x24 + bl _08016876 + .align 2, 0 +_08015D44: .4byte 0x02021fc4 +_08015D48: .4byte 0x082eeb88 +_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, _08015D98 + 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 + .align 2, 0 +_08015D98: .4byte 0x082ee82c +_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, _08015DCC + 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 + .align 2, 0 +_08015DCC: .4byte 0x02022c40 +_08015DD0: + ldr r0, _08015DE8 + ldrb r0, [r0] + cmp r0, 0 + bne _08015DF4 + ldr r0, _08015DEC + ldr r1, _08015DF0 + bl gf_strcpy + movs r0, 0x1C + bl _08016876 + .align 2, 0 +_08015DE8: .4byte 0x03003124 +_08015DEC: .4byte 0x02021fc4 +_08015DF0: .4byte 0x082eeb88 +_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, _08015E1C + ldrb r0, [r0] + cmp r0, 0x8 + bne _08015E24 + ldr r0, _08015E20 + adds r1, r6, 0 + movs r2, 0 + bl sub_8018220 + movs r0, 0x28 + bl _08016876 + .align 2, 0 +_08015E1C: .4byte 0x02022c2c +_08015E20: .4byte 0x02021fc4 +_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, _08015E50 + ldr r4, _08015E54 + ldrb r2, [r4] + movs r1, 0x40 + orrs r1, r2 + ldr r2, _08015E58 + ldrb r2, [r2, 0x13] + bl sub_8017D9C + strb r5, [r4] + bl _08016878 + .align 2, 0 +_08015E50: .4byte 0x02021fc4 +_08015E54: .4byte 0x02022c2c +_08015E58: .4byte 0x020229e8 +_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, _08015E90 + 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 + .align 2, 0 +_08015E90: .4byte 0x082ee24c +_08015E94: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, _08015EC0 + 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 + .align 2, 0 +_08015EC0: .4byte 0x02021fc4 +_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, _08015F1C + 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, _08015F20 + adds r1, r4 + adds r0, r5, 0 + bl gf_strcpy + ldrh r0, [r4, 0x18] + adds r4, 0x1C + adds r1, r4, 0 + bl sub_800E540 + adds r5, r0, 0 + ldr r0, _08015F24 + ldr r2, _08015F28 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl ExpandTextCodes + movs r0, 0x21 + bl _08016876 + .align 2, 0 +_08015F1C: .4byte 0x02021cc4 +_08015F20: .4byte 0x020229f0 +_08015F24: .4byte 0x02021fc4 +_08015F28: .4byte 0x082ee378 +_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 gpu_copy_wram_bg_tilemap_to_vram + ldr r4, _08015F94 + 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 + .align 2, 0 +_08015F94: .4byte 0x02022c2c +_08015F98: + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + ldr r1, _08015FB4 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_801568C + bl _08016878 + .align 2, 0 +_08015FB4: .4byte 0x082eec9c +_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, _08016024 + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_801568C + b _08016040 + .align 2, 0 +_08016024: .4byte 0x082eed3c +_08016028: + ldr r0, _08016038 + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1E + bl sub_8015664 + b _08016040 + .align 2, 0 +_08016038: .4byte 0x082eed3c +_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, _08016080 + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_801568C + b _08016092 + .align 2, 0 +_08016080: .4byte 0x082eed3c +_08016084: + ldr r0, _080160A4 + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1E + bl sub_8015664 +_08016092: + ldr r0, _080160A8 + ldrb r0, [r0] + cmp r0, 0 + bne _0801609E + bl _08016878 +_0801609E: + movs r0, 0x10 + bl _08016876 + .align 2, 0 +_080160A4: .4byte 0x082eed3c +_080160A8: .4byte 0x03003124 +_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, _080160F8 + ldrb r0, [r0] + cmp r0, 0 + bne _080160E4 + b _08016878 +_080160E4: + ldr r0, _080160FC + movs r1, 0x1 + bl sub_80143E4 + ldr r0, _08016100 + movs r1, 0x5 + bl AddTask + movs r0, 0x27 + b _08016876 + .align 2, 0 +_080160F8: .4byte 0x03003124 +_080160FC: .4byte 0x020228c4 +_08016100: .4byte sub_80140E0 + 1 +_08016104: + adds r0, r6, 0 + bl sub_801689C + ldr r0, _08016144 + 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, _08016148 + ldr r4, _0801614C + adds r1, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + subs r0, 0x24 + ldrh r0, [r0, 0x20] + adds r1, r4, 0 + bl sub_800E540 + adds r5, r0, 0 + ldr r0, _08016150 + ldr r2, _08016154 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl ExpandTextCodes + b _08016878 + .align 2, 0 +_08016144: .4byte sub_80140E0 + 1 +_08016148: .4byte 0x02021cc4 +_0801614C: .4byte 0x02022a0c +_08016150: .4byte 0x02021fc4 +_08016154: .4byte 0x082ee324 +_08016158: + adds r0, r6, 0 + bl sub_801689C + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, _08016174 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08016170 + b _08016878 +_08016170: + movs r0, 0x22 + b _08016876 + .align 2, 0 +_08016174: .4byte 0x02021fc4 +_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, _080161AC + 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, _080161B0 + ldr r1, _080161B4 + bl gf_strcpy + movs r0, 0x24 + b _08016876 + .align 2, 0 +_080161AC: .4byte 0x030022c0 +_080161B0: .4byte 0x02021fc4 +_080161B4: .4byte 0x082ee598 +_080161B8: + ldr r1, _080161C4 + movs r0, 0x9 + bl sub_8015664 + b _08016878 + .align 2, 0 +_080161C4: .4byte 0x02021fc4 +_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, _0801621C + 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 + .align 2, 0 +_0801621C: .4byte 0x02022c2c +_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, _08016270 + 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, _08016274 + ldr r1, _08016278 + bl gf_strcpy + b _08016878 + .align 2, 0 +_08016270: .4byte 0x02022c2c +_08016274: .4byte 0x02021fc4 +_08016278: .4byte 0x082eec14 +_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, _080162A0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_8018220 + movs r0, 0x28 + b _08016876 + .align 2, 0 +_080162A0: .4byte 0x02021fc4 +_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, _080162CC + ldr r1, _080162D0 + ldrb r1, [r1] + bl sub_8013078 + b _08016878 + .align 2, 0 +_080162CC: .4byte 0x02021fc4 +_080162D0: .4byte 0x02022c2c +_080162D4: + bl sub_800AC34 + movs r0, 0x24 + b _08016876 +_080162DC: + ldr r0, _0801630C + ldrb r4, [r0] + cmp r4, 0 + beq _080162E6 + b _08016878 +_080162E6: + ldr r1, _08016310 + movs r0, 0x40 + strb r0, [r1] + ldr r1, _08016314 + 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 + .align 2, 0 +_0801630C: .4byte 0x03003124 +_08016310: .4byte 0x02022c2c +_08016314: .4byte 0x02021fc4 +_08016318: + movs r0, 0x2 + strb r0, [r6, 0x14] + movs r0, 0 + bl sub_801818C + b _08016878 +_08016324: + ldr r4, _08016340 + ldr r0, _08016344 + 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 + .align 2, 0 +_08016340: .4byte 0x02021fc4 +_08016344: .4byte 0x02022c2c +_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 sub_80A1AD4 + 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, _080163C8 + ldr r0, [r0] + bl free + bl sub_80149D8 + b _08016878 + .align 2, 0 +_080163C8: .4byte 0x02022c30 +_080163CC: + bl sub_800F7DC + ldrh r1, [r0, 0x8] + ldr r4, _080163E0 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080163E4 + movs r0, 0x2B + b _08016876 + .align 2, 0 +_080163E0: .4byte 0x000003ff +_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, _08016400 + ldr r1, _08016404 + bl gf_strcpy + b _0801643E + .align 2, 0 +_08016400: .4byte 0x02021fc4 +_08016404: .4byte 0x082ef590 +_08016408: + ldr r4, _08016448 + bl sub_800F7DC + ldrh r0, [r0, 0x8] + lsls r0, 22 + lsrs r0, 22 + movs r1, 0xB + muls r1, r0 + ldr r0, _0801644C + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r4, _08016450 + bl sub_800F7DC + ldrb r1, [r0, 0xB] + lsrs r1, 1 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, _08016454 + ldr r1, _08016458 + bl ExpandTextCodes +_0801643E: + ldr r1, _08016454 + movs r0, 0x2C + bl sub_8015664 + b _08016878 + .align 2, 0 +_08016448: .4byte 0x02021cc4 +_0801644C: .4byte 0x083185c8 +_08016450: .4byte 0x02021dc4 +_08016454: .4byte 0x02021fc4 +_08016458: .4byte 0x082ef564 +_0801645C: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, _08016474 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _0801646E + b _08016878 +_0801646E: + movs r0, 0x2F + b _08016876 + .align 2, 0 +_08016474: .4byte 0x082ef20c +_08016478: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x1E + ldr r3, _080164B0 + ldr r4, _080164B4 + 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 + .align 2, 0 +_080164B0: .4byte 0x082f025c +_080164B4: .4byte 0x082f027c +_080164B8: + cmp r5, 0x1 + beq _080164C2 + cmp r5, 0x2 + beq _080164D0 + b _08016878 +_080164C2: + ldr r1, _080164CC + movs r0, 0x35 + bl sub_8015664 + b _08016878 + .align 2, 0 +_080164CC: .4byte 0x082ef4c4 +_080164D0: + ldr r1, _080164DC + movs r0, 0x2F + bl sub_8015664 + b _08016878 + .align 2, 0 +_080164DC: .4byte 0x082ef298 +_080164E0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x36 + b _08016876 +_080164F4: + ldr r0, _08016518 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08016502 + b _08016878 +_08016502: + ldr r1, _0801651C + movs r0, 0x1 + strh r0, [r1] + ldr r1, _08016520 + ldr r0, _08016524 + str r0, [r1] + ldr r1, _08016528 + movs r0, 0x8 + bl sub_81B8904 + b _08016878 + .align 2, 0 +_08016518: .4byte 0x02037fd4 +_0801651C: .4byte 0x02022c40 +_08016520: .4byte 0x03005dac +_08016524: .4byte sub_80AF128 + 1 +_08016528: .4byte c2_exit_to_overworld_2_switch + 1 +_0801652C: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x1E + ldr r3, _08016570 + ldr r4, _08016574 + 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, _08016578 + bl sub_801807C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, _0801657C + bl sub_801568C + b _08016878 + .align 2, 0 +_08016570: .4byte 0x082f0294 +_08016574: .4byte 0x082f032c +_08016578: .4byte 0x02022c40 +_0801657C: .4byte 0x082ef4fc +_08016580: + ldr r0, _08016588 + strh r5, [r0, 0x2] + movs r0, 0x37 + b _08016876 + .align 2, 0 +_08016588: .4byte 0x02022c40 +_0801658C: + ldr r2, _080165A0 + ldrh r0, [r2, 0x2] + ldrh r1, [r2, 0xA] + ldrh r2, [r2, 0xC] + bl sub_8010FCC + ldr r0, _080165A4 + bl sub_801568C + b _08016878 + .align 2, 0 +_080165A0: .4byte 0x02022c40 +_080165A4: .4byte 0x082ef520 +_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, _08016608 + 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, _0801660C + bl sub_801807C + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 + .align 2, 0 +_08016608: .4byte 0x082ef5b8 +_0801660C: .4byte 0x02022c40 +_08016610: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, _08016628 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08016622 + b _08016878 +_08016622: + movs r0, 0x2E + b _08016876 + .align 2, 0 +_08016628: .4byte 0x082ef1ec +_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, _08016674 + str r4, [sp] + ldr r4, _08016678 + 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 + .align 2, 0 +_08016674: .4byte 0x082f034c +_08016678: .4byte 0x082f03a4 +_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, _080166C0 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r1, _080166C4 + movs r0, 0x31 + bl sub_8015664 + strh r5, [r7, 0x2] + b _08016878 + .align 2, 0 +_080166C0: .4byte 0x02021cc4 +_080166C4: .4byte 0x082ef65c +_080166C8: + ldr r0, _080166EC + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r0, _080166F0 + ldr r1, [r6] + adds r1, r4 + ldrb r2, [r1, 0x9] + lsrs r2, 2 + lsls r1, r2, 3 + subs r1, r2 + ldr r2, _080166F4 + adds r1, r2 + bl gf_strcpy + ldr r1, _080166F8 + b _0801671E + .align 2, 0 +_080166EC: .4byte 0x02021cc4 +_080166F0: .4byte 0x02021dc4 +_080166F4: .4byte 0x0831ae38 +_080166F8: .4byte 0x082ef6e4 +_080166FC: + ldr r0, _08016728 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r0, _0801672C + ldr r1, [r6] + adds r1, r4 + ldrb r2, [r1, 0x9] + lsrs r2, 2 + lsls r1, r2, 3 + subs r1, r2 + ldr r2, _08016730 + adds r1, r2 + bl gf_strcpy + ldr r1, _08016734 +_0801671E: + movs r0, 0x2E + bl sub_8015664 + b _08016878 + .align 2, 0 +_08016728: .4byte 0x02021cc4 +_0801672C: .4byte 0x02021dc4 +_08016730: .4byte 0x0831ae38 +_08016734: .4byte 0x082ef718 +_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, _080167D4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _0801677E + b _08016878 +_0801677E: + ldr r4, _080167D8 + movs r0, 0x2 + strh r0, [r4] + ldr r2, _080167DC + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r2, _080167E0 + 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, _080167E4 + 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, _080167E8 + ldr r0, _080167EC + str r0, [r1] + ldr r1, _080167F0 + movs r0, 0x9 + bl sub_81B8904 + adds r0, r6, 0 + bl sub_80156B0 + ldrh r0, [r7, 0x2] + strb r0, [r4, 0x8] + b _08016878 + .align 2, 0 +_080167D4: .4byte 0x082ef4c4 +_080167D8: .4byte 0x02022c40 +_080167DC: .4byte 0x02022c38 +_080167E0: .4byte 0x02022c3e +_080167E4: .4byte 0x02022c3c +_080167E8: .4byte 0x03005dac +_080167EC: .4byte sub_80AF128 + 1 +_080167F0: .4byte c2_exit_to_overworld_2_switch + 1 +_080167F4: + ldr r1, _0801682C + 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, _08016830 + movs r3, 0x2 + ldrsh r2, [r7, r3] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + ldr r0, _08016834 + ldr r0, [r0, 0x8] + bl sub_8017020 + movs r0, 0x19 + b _08016876 + .align 2, 0 +_0801682C: .4byte 0x02022c2c +_08016830: .4byte 0x02021cc4 +_08016834: .4byte 0x082ee17c +_08016838: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, _08016860 + 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 + .align 2, 0 +_08016860: .4byte 0x02021fc4 +_08016864: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, _08016880 + 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 + .align 2, 0 +_08016880: .4byte 0x02021fc4 + thumb_func_end sub_80156E0 + + thumb_func_start var_800D_set_xB +var_800D_set_xB: @ 8016884 + push {lr} + bl in_trade_center + cmp r0, 0x1 + bne _08016894 + ldr r1, _08016898 + movs r0, 0xB + strh r0, [r1] +_08016894: + pop {r0} + bx r0 + .align 2, 0 +_08016898: .4byte 0x020375f0 + 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, _080168D8 + 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 + .align 2, 0 +_080168D8: .4byte 0x03003090 + 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, _08016910 + ldr r1, _08016914 + 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, _08016918 + ldrh r0, [r5] + strb r0, [r1] + movs r0, 0 + b _0801692E + .align 2, 0 +_08016910: .4byte 0x02021fc4 +_08016914: .4byte 0x020229e8 +_08016918: .4byte 0x02022c2c +_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, _0801696C + movs r0, 0xFF + strb r0, [r5] + ldr r0, _08016970 + movs r1, 0 + bl AddTask + ldr r4, _08016974 + movs r0, 0x9B + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + ldr r1, _08016978 + 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 + .align 2, 0 +_0801696C: .4byte 0x02022c20 +_08016970: .4byte task00_081199FC + 1 +_08016974: .4byte 0x02022c30 +_08016978: .4byte 0x03000da8 + 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, _0801699C + ldr r5, [r0] + ldrb r0, [r5, 0x14] + cmp r0, 0x4 + bls _08016990 + b _08016AC8 +_08016990: + lsls r0, 2 + ldr r1, _080169A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801699C: .4byte 0x02022c30 +_080169A0: .4byte _080169A4 + .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 malloc_and_clear + str r0, [r5, 0x4] + movs r1, 0x4 + bl sub_80175EC + movs r0, 0x70 + bl malloc_and_clear + str r0, [r5, 0xC] + movs r1, 0x4 + bl sub_80175EC + movs r0, 0x80 + lsls r0, 1 + bl malloc_and_clear + str r0, [r5] + movs r1, 0x8 + bl sub_8017580 + movs r0, 0x20 + bl malloc_and_clear + 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, _08016A80 + 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 + .align 2, 0 +_08016A80: .4byte 0x02022c20 +_08016A84: + ldr r0, _08016A90 + mov r1, sp + bl gf_strcpy + b _08016AC8 + .align 2, 0 +_08016A90: .4byte 0x02022c20 +_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, _08016AD0 + 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 + .align 2, 0 +_08016AD0: .4byte 0x02022c30 + thumb_func_end task00_081199FC + + thumb_func_start sp182_move_string +sp182_move_string: @ 8016AD4 + push {r4,lr} + ldr r4, _08016AE4 + ldrb r0, [r4] + cmp r0, 0xFF + bne _08016AE8 + movs r0, 0 + b _08016AF6 + .align 2, 0 +_08016AE4: .4byte 0x02022c20 +_08016AE8: + ldr r0, _08016AFC + adds r1, r4, 0 + bl gf_strcpy + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x1 +_08016AF6: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08016AFC: .4byte 0x02021cc4 + 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, _08016B54 + ldr r4, [r0] + movs r7, 0 + movs r6, 0 + movs r5, 0 +_08016B12: + ldr r0, [r4, 0xC] + adds r0, r5 + ldr r1, _08016B58 + 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 + .align 2, 0 +_08016B54: .4byte 0x02022c30 +_08016B58: .4byte 0x082f045c +_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, _08016C38 + 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 + .align 2, 0 +_08016C38: .4byte 0x00000257 +_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, _08016C9C + 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 + .align 2, 0 +_08016C9C: .4byte 0x00000383 + 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, _08016D90 + 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, _08016D94 + adds r1, r3 + movs r5, 0x10 + ldrsh r1, [r1, r5] + bl sub_8013D88 + cmp r0, 0 + bne _08016D00 + mov r1, sp + ldr r0, _08016D98 + 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, _08016D98 + 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, _08016D98 + 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, _08016D98 + 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 + .align 2, 0 +_08016D90: .4byte 0x03005e08 +_08016D94: .4byte 0x03005e00 +_08016D98: .4byte 0x082f045c +_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, _08016DEC + 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 + .align 2, 0 +_08016DEC: .4byte 0x082f045c + 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, _08016E1C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, _08016E20 + 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 + .align 2, 0 +_08016E1C: .4byte sub_8016CA0 + 1 +_08016E20: .4byte 0x03005e08 + 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, _08016F10 + 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, _08016F14 + 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, _08016F18 + 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, _08016F18 + 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, _08016F18 + 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 + .align 2, 0 +_08016F10: .4byte 0x03005e08 +_08016F14: .4byte 0x03005e00 +_08016F18: .4byte 0x082f045c + 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, _08016FB8 + 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, _08016FBC + 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 + .align 2, 0 +_08016FB8: .4byte 0x03005e08 +_08016FBC: .4byte 0x082f045c + 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, _08016FE8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r1, _08016FEC + adds r3, r2, r1 + str r4, [r3] + adds r1, r2 + strh r5, [r1, 0x4] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08016FE8: .4byte sub_8016E24 + 1 +_08016FEC: .4byte 0x03005e08 + 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, _08017018 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r1, _0801701C + adds r3, r2, r1 + str r4, [r3] + adds r1, r2 + strh r5, [r1, 0x4] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08017018: .4byte sub_8016F44 + 1 +_0801701C: .4byte 0x03005e08 + 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, _08017048 + adds r1, r4, 0 + bl ExpandTextCodes + movs r0, 0 + movs r1, 0x1 + bl sub_819735C + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08017048: .4byte 0x02021fc4 + 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, _08017098 + adds r1, r5, 0 + bl ExpandTextCodes + movs r0, 0x1 + bl sub_8197310 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080170AE + .align 2, 0 +_08017098: .4byte 0x02021fc4 +_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 Window_AddFromTemplate + 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 Window_FastFillPixels + ldr r2, _08017164 + 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 Window_CopyToVram + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08017164: .4byte 0x082efd94 + thumb_func_end sub_8017118 + + thumb_func_start sub_8017168 +sub_8017168: @ 8017168 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + 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, _0801721C + 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, _08017220 + ands r0, r2 + orrs r0, r1 + str r0, [sp] +_080171DC: + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldr r0, _08017224 + 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 calls_per_item_funcs_in_list_outer + mov r1, r9 + strb r0, [r1] + ldrb r0, [r5] + movs r1, 0x1 + bl Window_CopyToVram + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _0801728E + .align 2, 0 +_0801721C: .4byte 0x00ffffff +_08017220: .4byte 0xffff00ff +_08017224: .4byte 0x03006310 +_08017228: + mov r3, r9 + ldrb r0, [r3] + bl sub_81AE604 + mov r8, r0 + ldr r0, _08017260 + 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 Window_Remove + movs r0, 0 + strb r0, [r7] + mov r0, r8 + b _08017292 + .align 2, 0 +_08017260: .4byte 0x030022c0 +_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 Window_Remove + 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, _08017304 + bl sub_8017118 + mov r1, r9 + strb r0, [r1] + ldr r0, [sp, 0x20] + bl Window_AddFromTemplate + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldr r0, _08017308 + 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 calls_per_item_funcs_in_list_outer + mov r1, r10 + strb r0, [r1] + b _08017314 + .align 2, 0 +_08017304: .4byte 0x082f0344 +_08017308: .4byte 0x03006310 +_0801730C: + ldrb r0, [r6] + movs r1, 0x1 + bl Window_CopyToVram +_08017314: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0801739C +_0801731C: + mov r3, r10 + ldrb r0, [r3] + bl sub_81AE604 + adds r1, r0, 0 + ldr r0, _08017364 + 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 Window_Remove + mov r7, r9 + ldrb r0, [r7] + bl sub_8017168 + movs r0, 0 + strb r0, [r5] + movs r0, 0x2 + negs r0, r0 + b _080173A0 + .align 2, 0 +_08017364: .4byte 0x030022c0 +_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 Window_Remove + 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 Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _0801742C + 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, _08017430 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801742C: .4byte 0x03003014 +_08017430: .4byte _08017434 + .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 remo_copy + 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, _080175E8 + 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 + .align 2, 0 +_080175E8: .4byte 0x082f045c + thumb_func_end sub_8017580 + + thumb_func_start sub_80175EC +sub_80175EC: @ 80175EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, _0801762C + 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 + .align 2, 0 +_0801762C: .4byte 0x082f045c + 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, _080176D8 + 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 + .align 2, 0 +_080176D8: .4byte 0x000003ff +_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, _08017894 + adds r1, 0x1 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _08017898 + adds r0, r5, 0 + bl gf_strcat + 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 decimal_int_to_string + ldr r1, _0801789C + adds r0, r5, 0 + bl gf_strcpy + adds r0, r5, 0 + add r1, sp, 0x8 + bl gf_strcat + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x88 + bl sub_81DB368 + 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 + .align 2, 0 +_08017894: .4byte 0x02021fc4 +_08017898: .4byte 0x082ed8c8 +_0801789C: .4byte 0x082ed8cc + 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, _08017938 + 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 decimal_int_to_string + ldr r1, _0801793C + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + add r1, sp, 0x8 + bl gf_strcat + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x68 + bl sub_81DB368 + 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 + .align 2, 0 +_08017938: .4byte 0x02021fc4 +_0801793C: .4byte 0x082ed8cc + 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 player_get_pos_to_plus_one_step_in_direction_player_is_facing + 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, _08017974 + ldrb r0, [r0, 0x3] + cmp r0, 0x2 + beq _0801796E + cmp r0, 0 + bne _08017978 +_0801796E: + movs r0, 0x1 + b _0801797A + .align 2, 0 +_08017974: .4byte 0x02037590 +_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, _08017A2C + 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, _08017A30 + ldr r3, _08017A34 + lsls r1, r6, 2 + lsls r2, 3 + adds r1, r2 + adds r1, r3 + ldr r1, [r1] + bl ExpandTextCodes + movs r0, 0x2 + b _08017B2A + .align 2, 0 +_08017A2C: .4byte 0x02021cc4 +_08017A30: .4byte 0x02021fc4 +_08017A34: .4byte 0x082ee6b8 +_08017A38: + ldr r0, _08017A48 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_8017020 + movs r0, 0x1 + b _08017B2A + .align 2, 0 +_08017A48: .4byte 0x082ee17c +_08017A4C: + ldr r0, _08017A7C + 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 + .align 2, 0 +_08017A7C: .4byte 0x02021cc4 +_08017A80: + cmp r1, 0x5 + beq _08017AD0 + cmp r1, 0x8 + beq _08017AF4 + b _08017B20 +_08017A8A: + ldr r5, _08017AA8 + ldr r4, _08017AAC + 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 + .align 2, 0 +_08017AA8: .4byte 0x02021fc4 +_08017AAC: .4byte 0x082eeeac +_08017AB0: + ldr r5, _08017AC8 + ldr r4, _08017ACC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + lsls r1, r6, 4 + b _08017B08 + .align 2, 0 +_08017AC8: .4byte 0x02021fc4 +_08017ACC: .4byte 0x082ef1cc +_08017AD0: + ldr r5, _08017AEC + ldr r4, _08017AF0 + 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 + .align 2, 0 +_08017AEC: .4byte 0x02021fc4 +_08017AF0: .4byte 0x082ef010 +_08017AF4: + ldr r5, _08017B18 + ldr r4, _08017B1C + 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 ExpandTextCodes + b _08017B28 + .align 2, 0 +_08017B18: .4byte 0x02021fc4 +_08017B1C: .4byte 0x082ef100 +_08017B20: + ldr r0, _08017B30 + ldr r1, _08017B34 + bl ExpandTextCodes +_08017B28: + movs r0, 0 +_08017B2A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08017B30: .4byte 0x02021fc4 +_08017B34: .4byte 0x082ee6c8 + 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, _08017B90 + str r5, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0x44 + bl sub_80173E0 + b _08017BD4 + .align 2, 0 +_08017B90: .4byte 0x082ef7d0 +_08017B94: + adds r1, r7, 0x1 + adds r0, r6, 0 + movs r2, 0x44 + adds r3, r5, 0 + bl sub_819A2F8 + movs r0, 0xB + mov r2, r8 + muls r2, r0 + ldr r0, _08017BE4 + 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 decimal_int_to_string + 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 + .align 2, 0 +_08017BE4: .4byte 0x083185c8 + 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, _08017C3C + ldr r0, [r0] + mov r8, r0 + movs r0, 0x3 + negs r0, r0 + cmp r4, r0 + bne _08017C6C + ldr r0, _08017C40 + 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, _08017C44 + ands r0, r1 + cmp r0, 0 + beq _08017CA0 + ldr r0, _08017C48 + ldr r3, [r0] + movs r0, 0x5 + str r0, [sp] + mov r0, r9 + adds r1, r7, 0 + bl sub_8017B3C + b _08017CA0 + .align 2, 0 +_08017C3C: .4byte 0x02022c30 +_08017C40: .4byte 0x082f03a4 +_08017C44: .4byte 0x000003ff +_08017C48: .4byte 0x03005d90 +_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, _08017CE0 + 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 + .align 2, 0 +_08017CE0: .4byte 0x000003ff +_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, _08017D3C + 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, _08017D40 + ldrb r0, [r0] + cmp r4, r0 + blt _08017D14 + movs r0, 0x2 + b _08017D90 + .align 2, 0 +_08017D3C: .4byte 0x020244ec +_08017D40: .4byte 0x020244e9 +_08017D44: + movs r4, 0 + ldr r0, _08017D78 + ldrb r0, [r0] + cmp r4, r0 + bge _08017D8E + ldr r6, _08017D7C +_08017D50: + movs r0, 0x64 + muls r0, r4 + ldr r1, _08017D80 + 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 + .align 2, 0 +_08017D78: .4byte 0x020244e9 +_08017D7C: .4byte 0x083203cc +_08017D80: .4byte 0x020244ec +_08017D84: + adds r4, 0x1 + ldr r0, _08017D98 + ldrb r0, [r0] + cmp r4, r0 + blt _08017D50 +_08017D8E: + movs r0, 0x1 +_08017D90: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08017D98: .4byte 0x020244e9 + 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, _08017DC4 + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + b _08017DDA + .align 2, 0 +_08017DC4: .4byte 0x082eea68 +_08017DC8: + ldr r0, _08017DD4 + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + b _08017DDA + .align 2, 0 +_08017DD4: .4byte 0x082eed3c +_08017DD8: + ldr r1, _08017DE4 +_08017DDA: + adds r0, r3, 0 + bl ExpandTextCodes + b _08017DF6 + .align 2, 0 +_08017DE4: .4byte 0x082ef7b0 +_08017DE8: + ldr r0, _08017DFC + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r3, 0 + bl ExpandTextCodes +_08017DF6: + pop {r0} + bx r0 + .align 2, 0 +_08017DFC: .4byte 0x082eeb08 + 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, _08017E34 + 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 + .align 2, 0 +_08017E34: .4byte 0x020229e8 +_08017E38: + cmp r6, 0x45 + beq _08017E78 + b _08017E94 +_08017E3E: + ldr r2, _08017E50 + 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 + .align 2, 0 +_08017E50: .4byte 0x082ee984 +_08017E54: + ldr r2, _08017E74 + 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 gf_strcpy + b _08017E94 + .align 2, 0 +_08017E74: .4byte 0x082ee984 +_08017E78: + ldr r2, _08017E9C + 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 gf_strcpy +_08017E94: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08017E9C: .4byte 0x082ee984 + 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, _08017EC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08017EC4: .4byte _08017EC8 + .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, _08017EF0 + b _08017FAE + .align 2, 0 +_08017EF0: .4byte 0x082ee3dc +_08017EF4: + ldr r1, _08017EF8 + b _08017FAE + .align 2, 0 +_08017EF8: .4byte 0x082ee430 +_08017EFC: + adds r0, r6, 0 + adds r0, 0x58 + ldr r4, _08017F24 + ldrh r1, [r4, 0xC] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r6, 0 + adds r0, 0x68 + ldrh r2, [r4, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, _08017F28 + adds r1, r2 + bl gf_strcpy + movs r4, 0 + b _08017F2E + .align 2, 0 +_08017F24: .4byte 0x02022c40 +_08017F28: .4byte 0x083185c8 +_08017F2C: + adds r4, 0x1 +_08017F2E: + cmp r4, 0x3 + bgt _08017F64 + ldr r0, _08017F78 + 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 decimal_int_to_string + ldrh r1, [r5, 0x2] + movs r0, 0xB + muls r1, r0 + ldr r0, _08017F7C + adds r1, r0 + adds r0, r6, 0 + adds r0, 0x88 + bl gf_strcpy + ldrh r5, [r5, 0x2] + mov r8, r5 +_08017F64: + movs r0, 0xCE + lsls r0, 1 + cmp r8, r0 + bne _08017F84 + ldr r1, _08017F80 + adds r0, r7, 0 + bl gf_strcpy + b _08017FB4 + .align 2, 0 +_08017F78: .4byte 0x03007890 +_08017F7C: .4byte 0x083185c8 +_08017F80: .4byte 0x082ee4f0 +_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, _08017FA8 + adds r0, r7, 0 + bl sub_81AFC28 + b _08017FB4 + .align 2, 0 +_08017FA8: .4byte 0x082ee47c +_08017FAC: + ldr r1, _08017FB8 +_08017FAE: + adds r0, r7, 0 + bl ExpandTextCodes +_08017FB4: + movs r2, 0x1 + b _08017FC6 + .align 2, 0 +_08017FB8: .4byte 0x082ee380 +_08017FBC: + ldr r1, _08017FD4 + adds r0, r7, 0 + bl ExpandTextCodes + movs r2, 0x2 +_08017FC6: + adds r0, r2, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08017FD4: .4byte 0x082ee544 + thumb_func_end sub_8017EA0 + + thumb_func_start sub_8017FD8 +sub_8017FD8: @ 8017FD8 + push {lr} + adds r2, r0, 0 + ldr r0, _08017FF8 + 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 + .align 2, 0 +_08017FF8: .4byte 0x03003090 +_08017FFC: + movs r0, 0 +_08017FFE: + pop {r1} + bx r1 + thumb_func_end sub_8017FD8 + + thumb_func_start in_trade_center +in_trade_center: @ 8018004 + push {lr} + movs r2, 0 + ldr r0, _0801801C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _08018020 + cmp r1, r0 + bne _08018016 + movs r2, 0x1 +_08018016: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_0801801C: .4byte 0x03005d8c +_08018020: .4byte 0x00003c19 + thumb_func_end in_trade_center + + thumb_func_start sub_8018024 +sub_8018024: @ 8018024 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + ldr r0, _0801806C + ldrb r0, [r0] + cmp r6, r0 + bge _08018064 +_08018032: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08018070 + 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, _0801806C + ldrb r0, [r0] + cmp r5, r0 + blt _08018032 +_08018064: + cmp r6, 0x1 + bgt _08018074 + movs r0, 0 + b _08018076 + .align 2, 0 +_0801806C: .4byte 0x020244e9 +_08018070: .4byte 0x020244ec +_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, _0801809C + bl sub_801807C + pop {r0} + bx r0 + .align 2, 0 +_0801809C: .4byte 0x02022c40 + 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, _080180DC + 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 + .align 2, 0 +_080180DC: .4byte 0x020244ec +_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, _0801811C + 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 + .align 2, 0 +_0801811C: .4byte 0x020244ec + 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, _08018184 + 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, _08018188 + ldrb r0, [r0] + cmp r5, r0 + blt _08018146 +_08018176: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08018184: .4byte 0x020244ec +_08018188: .4byte 0x020244e9 + 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, _080181C4 + movs r0, 0 + strb r0, [r1] + cmp r4, 0 + beq _080181BC + ldr r2, _080181C8 + 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 + .align 2, 0 +_080181C4: .4byte 0x02022c2c +_080181C8: .4byte 0x02022c40 + 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, _080183B0 + 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, _080183B4 + adds r1, r0 + adds r0, r6, 0 + bl gf_strcpy + 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, _080183B8 + mov r2, r8 + ldrb r0, [r2, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcpy + 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 decimal_int_to_string + 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 decimal_int_to_string + mov r4, r9 + adds r4, 0xFC + mov r2, r8 + ldrh r1, [r2, 0x12] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + 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, _080183BC + adds r0, r4, 0 + bl sub_81AFC28 + ldr r0, _080183C0 + adds r1, r4, 0 + bl gf_strcpy + mov r0, r8 + ldrh r1, [r0, 0x14] + ldr r4, _080183C4 + cmp r1, r4 + ble _0801830C + adds r1, r4, 0 +_0801830C: + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + 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 decimal_int_to_string + 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 decimal_int_to_string + 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 sub_811EBBC + 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, _080183C8 + adds r0, r4, 0 + bl sub_81AFC28 + ldr r5, _080183C0 + adds r0, r5, 0 + adds r1, r4, 0 + bl gf_strcat + ldr r0, [sp] + cmp r0, 0x1 + bne _080183D0 + ldr r1, _080183CC + adds r0, r4, 0 + bl sub_81AFC28 + adds r0, r5, 0 + adds r1, r4, 0 + bl gf_strcat + b _080183F0 + .align 2, 0 +_080183B0: .4byte 0x02039b58 +_080183B4: .4byte 0x0830fcd4 +_080183B8: .4byte 0x082eff50 +_080183BC: .4byte 0x082eff64 +_080183C0: .4byte 0x02021fc4 +_080183C4: .4byte 0x0000270f +_080183C8: .4byte 0x082effa4 +_080183CC: .4byte 0x082f0020 +_080183D0: + ldr r2, [sp] + cmp r2, 0 + bne _080183F0 + ldr r0, _08018400 + 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 gf_strcat +_080183F0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08018400: .4byte 0x082f0018 + 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 strcpy_limit_7_chars + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + adds r0, r5, 0 + bl sub_8009308 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8018404 + + thumb_func_start sub_8018424 +sub_8018424: @ 8018424 + push {lr} + bl copy_queue_process + bl copy_super_sprites_to_oam + 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 run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + 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, _08018470 + 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 + .align 2, 0 +_08018470: .4byte 0x030022c0 +_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 reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + bl remove_some_task + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0801856C + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0x3 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0x2 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + movs r0, 0x3 + bl bgid_upload_textbox_1 + ldr r0, _08018570 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r1, 0xC0 + lsls r1, 7 + movs r0, 0 + bl lcd_io_clear_bits + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + b _08018610 + .align 2, 0 +_0801856C: .4byte 0x082f0598 +_08018570: .4byte 0x082f05a8 +_08018574: + ldr r0, _080185F4 + 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 Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x3 + bl sub_8018798 + lsls r0, r7, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80186EC + b _08018610 + .align 2, 0 +_080185F4: .4byte 0x082f0548 +_080185F8: + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_08018610: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08018644 +_08018618: + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r0, _0801863C + bl song_play_for_text + ldr r0, _08018640 + bl SetVBlankCallback + movs r0, 0xC5 + bl enable_irqs + movs r0, 0x1 + b _08018646 + .align 2, 0 +_0801863C: .4byte 0x0000021d +_08018640: .4byte sub_8018424 + 1 +_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, _08018674 + bl set_callback2 + ldr r1, _08018678 + movs r0, 0 + strb r0, [r1] + bl task_add_00_mystery_gift +_0801866C: + bl run_active_tasks + pop {r0} + bx r0 + .align 2, 0 +_08018674: .4byte sub_8018438 + 1 +_08018678: .4byte 0x02022c60 + 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, _0801869C + bl set_callback2 + ldr r1, _080186A0 + movs r0, 0x1 + strb r0, [r1] + bl sub_81D5014 +_08018698: + pop {r0} + bx r0 + .align 2, 0 +_0801869C: .4byte sub_8018438 + 1 +_080186A0: .4byte 0x02022c60 + thumb_func_end sub_801867C + + thumb_func_start sub_80186A4 +sub_80186A4: @ 80186A4 + push {lr} + ldr r1, _080186E4 + movs r0, 0 + strb r0, [r1] + bl Window_FreeMemory + movs r0, 0 + bl bg_get_tilemap + bl free + movs r0, 0x1 + bl bg_get_tilemap + bl free + movs r0, 0x2 + bl bg_get_tilemap + bl free + movs r0, 0x3 + bl bg_get_tilemap + bl free + ldr r0, _080186E8 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080186E4: .4byte 0x02022c60 +_080186E8: .4byte c2_title_screen_1 + 1 + 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 Window_FastFillPixels + cmp r4, 0 + bne _0801871C + ldr r0, _08018710 + ldr r7, _08018714 + cmp r5, 0 + bne _08018720 + ldr r7, _08018718 + b _08018720 + .align 2, 0 +_08018710: .4byte 0x085ef654 +_08018714: .4byte 0x085ef678 +_08018718: .4byte 0x085ef664 +_0801871C: + ldr r0, _08018778 + ldr r7, _0801877C +_08018720: + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + ldr r6, _08018780 + 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 sub_8199EEC + movs r0, 0 + adds r1, r7, 0 + movs r2, 0xDE + bl sub_81DB368 + 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 sub_8199EEC + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl Window_WriteStandardTileMap + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08018778: .4byte 0x085edfbf +_0801877C: .4byte 0x085edfc9 +_08018780: .4byte 0x082f0720 + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette +_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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette +_08018876: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _080188D4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0x11 + bl Window_FastFillPixels + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r0, _080188D8 + 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 sub_8199EEC + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080188D4: .4byte 0x02021fc4 +_080188D8: .4byte 0x082f0728 + 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 Window_FillTileMap + movs r0, 0x1 + movs r1, 0x1 + bl Window_CopyToVram + 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, _0801894C + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl draw_bouncing_down_arrow_2 + ldr r0, _08018950 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08018980 +_08018944: + ldrb r0, [r4] + adds r0, 0x1 + b _0801897E + .align 2, 0 +_0801894C: .4byte 0x02022c58 +_08018950: .4byte 0x030022c0 +_08018954: + movs r0, 0x1 + str r0, [sp] + ldr r0, _08018978 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl draw_bouncing_down_arrow_2 + movs r0, 0 + strb r0, [r4] + bl sub_80188DC + movs r0, 0x1 + b _08018982 + .align 2, 0 +_08018978: .4byte 0x02022c58 +_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, _080189B0 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl draw_bouncing_down_arrow_2 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_080189B0: .4byte 0x02022c58 + 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, _080189D8 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl draw_bouncing_down_arrow_2 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_080189D8: .4byte 0x02022c58 + 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, _08018A04 + 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 + .align 2, 0 +_08018A04: .4byte 0x030022c0 +_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, _08018A74 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, _08018A78 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x1C] + str r1, [sp, 0x20] + cmp r2, 0 + bne _08018A80 + ldr r0, _08018A7C + b _08018A82 + .align 2, 0 +_08018A74: .4byte 0x082f0638 +_08018A78: .4byte 0x082f05e0 +_08018A7C: .4byte 0x082f0608 +_08018A80: + ldr r0, _08018AC0 +_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, _08018AC4 + 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, _08018AC8 + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x1C] + b _08018AD2 + .align 2, 0 +_08018AC0: .4byte 0x082f0620 +_08018AC4: .4byte 0x00ffffff +_08018AC8: .4byte 0xffff00ff +_08018ACC: + ldr r0, _08018B04 + 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 sub_81AE45C + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08018AFA + movs r0, 0x2 + bl Window_FillTileMap + movs r0, 0x2 + movs r1, 0x1 + bl Window_CopyToVram +_08018AFA: + adds r0, r4, 0 + add sp, 0x24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08018B04: .4byte 0xffff00ff + 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, _08018B40 + bl ExpandTextCodes + cmp r6, 0 + bne _08018B48 + ldr r0, _08018B44 + b _08018B4A + .align 2, 0 +_08018B40: .4byte 0x02021fc4 +_08018B44: .4byte 0x082f05c8 +_08018B48: + ldr r0, _08018B8C +_08018B4A: + bl Window_AddFromTemplate + strh r0, [r4] + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + ldr r1, _08018B90 + str r1, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, _08018B94 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl sub_8199EEC + ldrb r0, [r4] + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + ldrb r0, [r4] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r4] + bl Window_WriteStandardTileMap + b _08018BD6 + .align 2, 0 +_08018B8C: .4byte 0x082f05d0 +_08018B90: .4byte 0x082f0728 +_08018B94: .4byte 0x02021fc4 +_08018B98: + ldr r0, _08018BB4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x14] + str r1, [sp, 0x18] + cmp r6, 0 + bne _08018BBC + ldr r0, _08018BB8 + ldr r1, [sp, 0x14] + ands r1, r0 + movs r0, 0x90 + lsls r0, 12 + b _08018BC6 + .align 2, 0 +_08018BB4: .4byte 0x082f05e8 +_08018BB8: .4byte 0xff00ffff +_08018BBC: + ldr r0, _08018BE0 + 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 sub_81996C0 +_08018BD6: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08018C3E + .align 2, 0 +_08018BE0: .4byte 0xff00ffff +_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 Window_FillTileMap + ldrb r0, [r4] + movs r1, 0x1 + bl Window_CopyToVram + ldrb r0, [r4] + bl Window_Remove + adds r0, r6, 0 + b _08018C42 +_08018C1A: + movs r0, 0 + strb r0, [r5] + ldrb r0, [r4] + bl rbox_fill_rectangle + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + movs r1, 0x1 + bl Window_CopyToVram + ldrb r0, [r4] + bl Window_Remove + 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, _08018C7C + ldr r1, _08018C80 + bl ExpandTextCodes + b _08018C8C + .align 2, 0 +_08018C7C: .4byte 0x02021fc4 +_08018C80: .4byte 0x085ef2fc +_08018C84: + ldr r0, _08018CD8 + ldr r1, _08018CDC + bl ExpandTextCodes +_08018C8C: + ldr r0, _08018CE0 + bl Window_AddFromTemplate + strh r0, [r5] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r5] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + ldr r1, _08018CE4 + str r1, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, _08018CD8 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl sub_8199EEC + ldrb r0, [r5] + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + ldrb r0, [r5] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r5] + bl Window_WriteStandardTileMap + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08018D8C + .align 2, 0 +_08018CD8: .4byte 0x02021fc4 +_08018CDC: .4byte 0x085ef330 +_08018CE0: .4byte 0x082f05d8 +_08018CE4: .4byte 0x082f0728 +_08018CE8: + cmp r3, 0 + beq _08018D10 + cmp r2, 0 + bne _08018D00 + ldr r0, _08018CF8 + ldr r1, _08018CFC + b _08018D28 + .align 2, 0 +_08018CF8: .4byte 0x082f05f8 +_08018CFC: .4byte 0x082f06c8 +_08018D00: + ldr r0, _08018D08 + ldr r1, _08018D0C + b _08018D28 + .align 2, 0 +_08018D08: .4byte 0x082f0600 +_08018D0C: .4byte 0x082f06f8 +_08018D10: + cmp r2, 0 + bne _08018D24 + ldr r0, _08018D1C + ldr r1, _08018D20 + b _08018D28 + .align 2, 0 +_08018D1C: .4byte 0x082f05f0 +_08018D20: .4byte 0x082f06b0 +_08018D24: + ldr r0, _08018D60 + ldr r1, _08018D64 +_08018D28: + movs r2, 0xE0 + str r2, [sp] + movs r2, 0x1 + movs r3, 0xA + bl sub_81AE45C + 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 Window_FillTileMap + ldrb r0, [r5] + movs r1, 0x1 + bl Window_CopyToVram + ldrb r0, [r5] + bl Window_Remove + adds r0, r4, 0 + b _08018D90 + .align 2, 0 +_08018D60: .4byte 0x082f05f8 +_08018D64: .4byte 0x082f06e0 +_08018D68: + movs r0, 0 + strb r0, [r6] + ldrb r0, [r5] + bl rbox_fill_rectangle + ldrb r0, [r5] + bl Window_FillTileMap + ldrb r0, [r5] + movs r1, 0x1 + bl Window_CopyToVram + ldrb r0, [r5] + bl Window_Remove + 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, _08018E5C + b _08018E62 + .align 2, 0 +_08018E5C: .4byte 0x085ef55c +_08018E60: + ldr r3, _08018E70 +_08018E62: + movs r2, 0x1 + bl sub_8018B08 + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08018E70: .4byte 0x085ef520 + 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, _08018E80 + b _08018E86 + .align 2, 0 +_08018E80: .4byte 0x085ef630 +_08018E84: + ldr r1, _08018E90 +_08018E86: + bl mevent_0814257C + pop {r1} + bx r1 + .align 2, 0 +_08018E90: .4byte 0x085ef60c + 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, _08018EA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08018EA8: .4byte _08018EAC + .align 2, 0 +_08018EAC: + .4byte _08018EC0 + .4byte _08018ECC + .4byte _08018ED4 + .4byte _08018EE0 + .4byte _08018EF8 +_08018EC0: + ldr r0, _08018EC8 + bl sub_8018884 + b _08018EEC + .align 2, 0 +_08018EC8: .4byte 0x085ef5bc +_08018ECC: + movs r0, 0 + bl save_game_when_memory_present + b _08018EEC +_08018ED4: + ldr r0, _08018EDC + bl sub_8018884 + b _08018EEC + .align 2, 0 +_08018EDC: .4byte 0x085ef5e0 +_08018EE0: + ldr r0, _08018EF4 + 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 + .align 2, 0 +_08018EF4: .4byte 0x030022c0 +_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, _08018F2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08018F2C: .4byte _08018F30 + .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, _08018F74 + b _08019034 + .align 2, 0 +_08018F74: .4byte 0x085ef2e4 +_08018F78: + movs r0, 0 + str r0, [r4] + ldr r2, _08018F80 + b _08019034 + .align 2, 0 +_08018F80: .4byte 0x085ef244 +_08018F84: + movs r0, 0x1 + str r0, [r4] + ldr r2, _08018F94 + cmp r5, 0 + bne _08019034 + ldr r2, _08018F98 + b _08019034 + .align 2, 0 +_08018F94: .4byte 0x085ef0c8 +_08018F98: .4byte 0x085ef124 +_08018F9C: + movs r0, 0x1 + str r0, [r4] + ldr r2, _08018FAC + cmp r5, 0 + bne _08019034 + ldr r2, _08018FB0 + b _08019034 + .align 2, 0 +_08018FAC: .4byte 0x085ef0f4 +_08018FB0: .4byte 0x085ef14c +_08018FB4: + movs r0, 0x1 + str r0, [r4] + ldr r2, _08018FBC + b _08019034 + .align 2, 0 +_08018FBC: .4byte 0x085ef178 +_08018FC0: + movs r0, 0 + str r0, [r4] + ldr r2, _08018FC8 + b _08019034 + .align 2, 0 +_08018FC8: .4byte 0x085ef1b4 +_08018FCC: + movs r0, 0 + str r0, [r4] + ldr r2, _08018FD4 + b _08019034 + .align 2, 0 +_08018FD4: .4byte 0x085ef200 +_08018FD8: + movs r0, 0 + str r0, [r4] + ldr r2, _08018FE0 + b _08019034 + .align 2, 0 +_08018FE0: .4byte 0x085ef1d8 +_08018FE4: + movs r0, 0 + str r0, [r4] + ldr r2, _08018FEC + b _08019034 + .align 2, 0 +_08018FEC: .4byte 0x085ef21c +_08018FF0: + movs r0, 0 + str r0, [r4] + ldr r2, _08018FF8 + b _08019034 + .align 2, 0 +_08018FF8: .4byte 0x085ef02c +_08018FFC: + movs r0, 0 + str r0, [r4] + ldr r2, _0801900C + cmp r6, 0 + bne _08019034 + ldr r2, _08019010 + b _08019034 + .align 2, 0 +_0801900C: .4byte 0x085ef2b4 +_08019010: .4byte 0x085ef280 +_08019014: + movs r0, 0 + str r0, [r4] + ldr r2, _0801901C + b _08019034 + .align 2, 0 +_0801901C: .4byte 0x085ef014 +_08019020: + movs r0, 0x1 + str r0, [r4] + ldr r2, _08019028 + b _08019034 + .align 2, 0 +_08019028: .4byte 0x085ef198 +_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, _080190C0 + movs r0, 0 + str r0, [r3] + adds r4, r1, 0 + cmp r2, 0xE + bhi _08019166 + lsls r0, r2, 2 + ldr r1, _080190C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080190C0: .4byte 0x085ef014 +_080190C4: .4byte _080190C8 + .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, _08019108 + b _08019166 + .align 2, 0 +_08019108: .4byte 0x085ef2e4 +_0801910C: + ldr r1, _08019110 + b _08019166 + .align 2, 0 +_08019110: .4byte 0x085ef244 +_08019114: + ldr r1, _08019118 + b _0801911E + .align 2, 0 +_08019118: .4byte 0x085ef39c +_0801911C: + ldr r1, _08019124 +_0801911E: + movs r0, 0x1 + str r0, [r3] + b _08019166 + .align 2, 0 +_08019124: .4byte 0x085ef3c4 +_08019128: + ldr r1, _0801912C + b _08019166 + .align 2, 0 +_0801912C: .4byte 0x085ef3f0 +_08019130: + ldr r1, _08019134 + b _08019166 + .align 2, 0 +_08019134: .4byte 0x085ef42c +_08019138: + ldr r1, _0801913C + b _08019166 + .align 2, 0 +_0801913C: .4byte 0x085ef494 +_08019140: + ldr r1, _08019144 + b _08019166 + .align 2, 0 +_08019144: .4byte 0x085ef460 +_08019148: + ldr r1, _0801914C + b _08019166 + .align 2, 0 +_0801914C: .4byte 0x085ef21c +_08019150: + ldr r1, _08019154 + b _08019166 + .align 2, 0 +_08019154: .4byte 0x085ef4c4 +_08019158: + adds r1, r4, 0 + b _08019166 +_0801915C: + ldr r1, _08019160 + b _08019166 + .align 2, 0 +_08019160: .4byte 0x085ef410 +_08019164: + ldr r1, _08019170 +_08019166: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08019170: .4byte 0x085ef4f0 + 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, _080191EC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _080191F0 + 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 malloc_and_clear + str r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080191EC: .4byte task00_mystery_gift + 1 +_080191F0: .4byte 0x03005e08 + 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, _08019218 + adds r5, r0, r1 + ldrb r0, [r5, 0x8] + cmp r0, 0x25 + bls _0801920E + b _08019922 +_0801920E: + lsls r0, 2 + ldr r1, _0801921C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08019218: .4byte 0x03005e08 +_0801921C: .4byte _08019220 + .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, _08019310 + b _0801931A + .align 2, 0 +_08019310: .4byte 0x085eeef0 +_08019314: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, _08019334 +_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 + .align 2, 0 +_08019334: .4byte 0x085eef2c +_08019338: + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _0801934C + ldr r0, _08019348 + bl sub_8018884 + b _08019352 + .align 2, 0 +_08019348: .4byte 0x085eef68 +_0801934C: + ldr r0, _08019358 + bl sub_8018884 +_08019352: + movs r0, 0x4 + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_08019358: .4byte 0x085eef94 +_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, _080193C8 + movs r1, 0xFF + strb r1, [r0] + ldr r0, _080193CC + strb r1, [r0] + ldr r0, _080193D0 + strb r1, [r0] + ldrb r0, [r5, 0xC] + cmp r0, 0 + beq _080193D4 + cmp r0, 0x1 + beq _080193EE + b _08019406 + .align 2, 0 +_080193C8: .4byte 0x02021cc4 +_080193CC: .4byte 0x02021dc4 +_080193D0: .4byte 0x02021ec4 +_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, _08019428 + 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 + .align 2, 0 +_08019428: .4byte 0x03003124 +_0801942C: + ldr r0, _08019440 + ldrh r0, [r0] + cmp r0, 0x5 + beq _08019436 + b _08019922 +_08019436: + movs r0, 0x1 + bl sub_8018838 + b _080197C0 + .align 2, 0 +_08019440: .4byte 0x020375f0 +_08019444: + ldr r0, _08019450 + bl sub_8018884 + movs r0, 0x8 + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_08019450: .4byte 0x085eefe8 +_08019454: + adds r0, r5, 0 + bl sub_801D4A8 + subs r0, 0x2 + cmp r0, 0x4 + bls _08019462 + b _08019922 +_08019462: + lsls r0, 2 + ldr r1, _0801946C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801946C: .4byte _08019470 + .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, _080194C4 + ldr r1, _080194C8 + bl gf_strcpy + b _08019922 + .align 2, 0 +_080194C4: .4byte 0x02021cc4 +_080194C8: .4byte 0x020229f0 +_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, _08019530 + 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 + .align 2, 0 +_08019530: .4byte 0x085ef050 +_08019534: + movs r0, 0 + b _08019566 +_08019538: + adds r0, r5, 0 + adds r0, 0x9 + ldr r3, _0801955C + 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 + .align 2, 0 +_0801955C: .4byte 0x085ef084 +_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, _08019588 + ldrb r0, [r0] + cmp r0, 0 + beq _0801957E + b _08019922 +_0801957E: + bl sub_800E084 + movs r0, 0xE + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_08019588: .4byte 0x03003124 +_0801958C: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, _080195B0 + bl sub_8018A1C + cmp r0, 0 + bne _0801959C + b _08019922 +_0801959C: + ldrb r0, [r5, 0xD] + cmp r0, 0x1 + bne _080195AA + ldr r0, _080195B4 + ldr r1, _080195B8 + bl gf_strcpy +_080195AA: + movs r0, 0xF + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_080195B0: .4byte 0x085eeff8 +_080195B4: .4byte 0x02021cc4 +_080195B8: .4byte 0x020229f0 +_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, _08019660 + 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 + .align 2, 0 +_08019660: .4byte 0x030022c0 +_08019664: + ldr r0, _08019678 + ldrh r0, [r0, 0x2E] + bl sub_801CCD0 + cmp r0, 0 + beq _0801967C + cmp r0, 0x1 + beq _08019682 + b _08019922 + .align 2, 0 +_08019678: .4byte 0x030022c0 +_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, _08019754 + 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 + .align 2, 0 +_08019754: .4byte 0x085ef584 +_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, _0801980C + ldrb r0, [r0] + cmp r0, 0 + beq _08019810 + movs r0, 0x1 + bl sub_8018838 + movs r0, 0x1F + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_0801980C: .4byte 0x03003124 +_08019810: + ldr r0, _08019828 + 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 + .align 2, 0 +_08019828: .4byte 0x020375f0 +_0801982C: + ldr r0, _0801984C + movs r1, 0xFF + strb r1, [r0] + ldr r0, _08019850 + strb r1, [r0] + ldr r0, _08019854 + strb r1, [r0] + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _0801985C + ldr r0, _08019858 + bl sub_8018884 + bl sub_801D0A0 + b _08019866 + .align 2, 0 +_0801984C: .4byte 0x02021cc4 +_08019850: .4byte 0x02021dc4 +_08019854: .4byte 0x02021ec4 +_08019858: .4byte 0x085ef360 +_0801985C: + ldr r0, _0801986C + bl sub_8018884 + bl sub_801D07C +_08019866: + movs r0, 0x20 + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_0801986C: .4byte 0x085ef37c +_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, _08019898 + ldr r1, _0801989C + bl gf_strcpy + movs r0, 0x22 + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_08019898: .4byte 0x02021cc4 +_0801989C: .4byte 0x02022a0c +_080198A0: + ldr r0, _080198B4 + ldrb r0, [r0] + cmp r0, 0 + bne _08019922 + bl sub_800E084 + movs r0, 0x23 + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_080198B4: .4byte 0x03003124 +_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, _080198E4 + ands r0, r1 + ldr r1, _080198E8 + cmp r0, r1 + bne _080198FA + movs r0, 0x3 + bl sub_801DB68 +_080198DC: + movs r0, 0x11 + strb r0, [r5, 0x8] + b _08019922 + .align 2, 0 +_080198E4: .4byte 0x00ffff00 +_080198E8: .4byte 0x00030100 +_080198EC: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, _08019908 + 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 + .align 2, 0 +_08019908: .4byte 0x085ef014 +_0801990C: + bl sub_80097E8 + ldr r0, [r5, 0x10] + bl free + adds r0, r4, 0 + bl remove_task + ldr r0, _0801992C + bl set_callback2 +_08019922: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801992C: .4byte sub_80186A4 + 1 + thumb_func_end task00_mystery_gift + + thumb_func_start sub_8019930 +sub_8019930: @ 8019930 + ldr r0, _08019934 + bx lr + .align 2, 0 +_08019934: .4byte 0x000001a9 + 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, _08019954 + 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 + .align 2, 0 +_08019954: .4byte 0x082f0568 + thumb_func_end bgid_upload_textbox_1 + + thumb_func_start is_walking_or_running +is_walking_or_running: @ 8019958 + push {lr} + ldr r0, _0801996C + ldrb r0, [r0, 0x3] + cmp r0, 0x2 + beq _08019966 + cmp r0, 0 + bne _08019970 +_08019966: + movs r0, 0x1 + b _08019972 + .align 2, 0 +_0801996C: .4byte 0x02037590 +_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, _0801998C + 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 + .align 2, 0 +_0801998C: .4byte 0x082f072c + thumb_func_end sub_8019978 + + thumb_func_start sub_8019990 +sub_8019990: @ 8019990 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, _080199D8 + mov r8, r4 + lsls r0, 2 + adds r4, r0, r4 + movs r6, 0 + ldrsh r5, [r4, r6] + ldr r6, _080199DC + 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 + .align 2, 0 +_080199D8: .4byte 0x082f0740 +_080199DC: .4byte 0x082f0760 + thumb_func_end sub_8019990 + + thumb_func_start sub_80199E0 +sub_80199E0: @ 80199E0 + push {r4-r7,lr} + mov r12, r3 + ldr r7, _08019A20 + lsls r5, r0, 2 + adds r0, r5, r7 + movs r4, 0 + ldrsh r3, [r0, r4] + ldr r6, _08019A24 + 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 + .align 2, 0 +_08019A20: .4byte 0x082f0740 +_08019A24: .4byte 0x082f0760 +_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, _08019A48 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08019A48: .4byte 0x000002bf + thumb_func_end sub_8019A30 + + thumb_func_start flag_set_x63 +flag_set_x63: @ 8019A4C + push {lr} + ldr r1, _08019A60 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_08019A60: .4byte 0x000002bf + thumb_func_end flag_set_x63 + + thumb_func_start flag_clear_x63 +flag_clear_x63: @ 8019A64 + push {lr} + ldr r1, _08019A78 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_08019A78: .4byte 0x000002bf + thumb_func_end flag_clear_x63 + + thumb_func_start sub_8019A7C +sub_8019A7C: @ 8019A7C + push {lr} + ldr r2, _08019A94 + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_08019A94: .4byte 0x00004010 + thumb_func_end sub_8019A7C + + thumb_func_start sub_8019A98 +sub_8019A98: @ 8019A98 + push {lr} + ldr r1, _08019AB0 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08019AB4 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + pop {r0} + bx r0 + .align 2, 0 +_08019AB0: .4byte 0x082f0774 +_08019AB4: .4byte 0x03005d8c + thumb_func_end sub_8019A98 + + thumb_func_start sub_8019AB8 +sub_8019AB8: @ 8019AB8 + push {lr} + ldr r1, _08019AD0 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08019AD4 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl npc_hide_by_local_id_and_map + pop {r0} + bx r0 + .align 2, 0 +_08019AD0: .4byte 0x082f0774 +_08019AD4: .4byte 0x03005d8c + 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, _08019B24 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08019B28 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + 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, _08019B2C + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + bne _08019B30 + ldrb r1, [r5] + adds r0, r4, 0 + bl npc_set_state_2 + lsls r0, 24 + cmp r0, 0 + bne _08019B30 + movs r0, 0x1 + b _08019B32 + .align 2, 0 +_08019B24: .4byte 0x082f0774 +_08019B28: .4byte 0x03005d8c +_08019B2C: .4byte 0x02037350 +_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, _08019B78 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08019B7C + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + 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, _08019B80 + adds r4, r0, r1 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + bne _08019B84 + movs r0, 0 + b _08019B9E + .align 2, 0 +_08019B78: .4byte 0x082f0774 +_08019B7C: .4byte 0x03005d8c +_08019B80: .4byte 0x02037350 +_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, _08019BD4 + movs r1, 0 + str r1, [r2] + ldr r1, _08019BD8 + 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 + .align 2, 0 +_08019BD4: .4byte 0x02022c68 +_08019BD8: .4byte 0x02022c64 + 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, _08019C0C + 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 + .align 2, 0 +_08019C0C: .4byte 0x082f078c +_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 player_get_pos_to + 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, _08019CD0 + adds r0, r5, 0 + bl sub_8019AD8 + cmp r0, 0x1 + bne _08019CE6 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08019CE6 + .align 2, 0 +_08019CD0: .4byte 0x082f078e +_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, _08019D14 + 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 + .align 2, 0 +_08019D14: .4byte 0x02022c64 +_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, _08019D38 + 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 + .align 2, 0 +_08019D38: .4byte 0x02022c64 +_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, _08019DF0 +_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 + .align 2, 0 +_08019DF0: .4byte 0x02022c64 + thumb_func_end sub_8019DD0 + + thumb_func_start sub_8019DF4 +sub_8019DF4: @ 8019DF4 + push {r4,lr} + ldr r4, _08019E14 + 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 + .align 2, 0 +_08019E14: .4byte sub_8019DD0 + 1 +_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, _08019E38 + 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 + .align 2, 0 +_08019E38: .4byte sub_8019DD0 + 1 + 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, _08019E6C + movs r0, 0 + str r0, [r1] + bl sub_8019E20 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08019E6C: .4byte 0x02022c64 + 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, _08019EFC + 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, _08019F00 +_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 + .align 2, 0 +_08019EFC: .4byte 0x082f0740 +_08019F00: .4byte 0x082f0760 + 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, _08019F28 +_08019F0C: + adds r0, r5, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_delete_and_free_tiles + adds r4, 0x1 + cmp r4, 0x27 + ble _08019F0C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08019F28: .4byte 0x02020630 + 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, _08019F74 + adds r0, r1, r0 + ldrb r0, [r0] + b _08019F88 + .align 2, 0 +_08019F74: .4byte 0x082f076f +_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 player_get_pos_to + 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, _0801A188 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801A188: .4byte _0801A18C + .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, _0801A254 + 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 + .align 2, 0 +_0801A254: .4byte 0x02022c68 +_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, _0801A280 + movs r0, 0x96 + lsls r0, 1 + str r0, [r1] + bx lr + .align 2, 0 +_0801A280: .4byte 0x02022c68 + thumb_func_end sub_801A274 + + thumb_func_start sub_801A284 +sub_801A284: @ 801A284 + push {lr} + adds r2, r0, 0 + ldr r0, _0801A2A4 + 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 + .align 2, 0 +_0801A2A4: .4byte 0x02022c68 + 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, _0801A2EC + bl player_get_direction__sp1AA + 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 + .align 2, 0 +_0801A2EC: .4byte 0x082f076a +_0801A2F0: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + movs r0, 0 + str r0, [sp, 0xC] + ldr r0, _0801A3A8 + 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, _0801A3AC +_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 + .align 2, 0 +_0801A3A8: .4byte 0x082f0740 +_0801A3AC: .4byte 0x082f0760 + 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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0801A414 + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _0801A438 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0801A438: .4byte sub_801A43C + 1 + 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 lcd_io_set + ldr r5, _0801A560 + movs r0, 0x6C + bl malloc_and_clear + str r0, [r5] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0801A564 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + ldr r1, _0801A568 + 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, _0801A56C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r0, _0801A570 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + bl remove_some_task + bl SoundVSyncOn_rev01 + ldr r0, _0801A574 + bl SetVBlankCallback + ldr r0, _0801A578 + 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 bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _0801A57C + 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 Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0801A580 + bl set_callback2 + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A560: .4byte 0x03000dac +_0801A564: .4byte 0x082f0d34 +_0801A568: .4byte 0x082f0990 +_0801A56C: .4byte 0x082f0ba0 +_0801A570: .4byte 0x082f0d3c +_0801A574: .4byte sub_801A418 + 1 +_0801A578: .4byte sub_801A6C0 + 1 +_0801A57C: .4byte 0x082f0790 +_0801A580: .4byte sub_801A3F4 + 1 + thumb_func_end sub_801A43C + + thumb_func_start sub_801A584 +sub_801A584: @ 801A584 + push {r4,lr} + bl Window_FreeMemory + movs r4, 0 +_0801A58C: + lsls r0, r4, 24 + lsrs r0, 24 + bl bg_get_tilemap + bl free + adds r4, 0x1 + cmp r4, 0x1 + ble _0801A58C + ldr r0, _0801A5B4 + ldr r0, [r0] + bl free + ldr r0, _0801A5B8 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801A5B4: .4byte 0x03000dac +_0801A5B8: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + 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, _0801A5FC + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0801A5FC: .4byte 0x082f0790 + 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 Window_FastFillPixels + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + ldr r5, _0801A6BC + ldr r4, [r5] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC0 + bl sub_81DB35C + 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, _0801A6BC + 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 Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A6BC: .4byte 0x082f0d5c + 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, _0801A6EC + 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, _0801A6F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801A6EC: .4byte 0x03005e00 +_0801A6F0: .4byte _0801A6F4 + .align 2, 0 +_0801A6F4: + .4byte _0801A70C + .4byte _0801A728 + .4byte _0801A74C + .4byte _0801A768 + .4byte _0801A85C + .4byte _0801A884 +_0801A70C: + bl sub_801A600 + ldr r0, _0801A724 + 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 + .align 2, 0 +_0801A724: .4byte 0x03005e00 +_0801A728: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_sync_bg_show + b _0801A86C +_0801A74C: + ldr r0, _0801A764 + 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 + .align 2, 0 +_0801A764: .4byte 0x02037fd4 +_0801A768: + ldr r0, _0801A7C4 + 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 Window_FastFillPixels + movs r4, 0 + ldr r6, _0801A7C8 + movs r7, 0x80 + lsls r7, 20 +_0801A796: + ldr r0, _0801A7C4 + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + 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 + .align 2, 0 +_0801A7C4: .4byte 0x03000dac +_0801A7C8: .4byte 0x02021fc4 +_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 Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram +_0801A7F8: + ldr r0, _0801A84C + 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, _0801A850 + ldr r0, _0801A854 + 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, _0801A858 + adds r1, r0 + adds r0, r1, 0 + adds r0, 0xE + adds r1, 0x10 + bl sub_801A5BC + b _0801A89C + .align 2, 0 +_0801A84C: .4byte 0x030022c0 +_0801A850: .4byte 0x03005e00 +_0801A854: .4byte 0x03000dac +_0801A858: .4byte 0x03005e08 +_0801A85C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0801A86C: + ldr r1, _0801A880 + 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 + .align 2, 0 +_0801A880: .4byte 0x03005e00 +_0801A884: + ldr r0, _0801A8A8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0801A89C + ldr r0, _0801A8AC + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_0801A89C: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801A8A8: .4byte 0x02037fd4 +_0801A8AC: .4byte sub_801A584 + 1 + 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, _0801A8DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801A8DC: .4byte _0801A8E0 + .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 sub_8199EEC + 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, _0801A9D8 + 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 + .align 2, 0 +_0801A9D8: .4byte 0x082f0d70 +_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, _0801AA98 + 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 + .align 2, 0 +_0801AA98: .4byte 0x03005e08 +_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, _0801AB54 + ldr r5, _0801AB58 +_0801AAE4: + ldr r0, _0801AB5C + 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, _0801AB54 + 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, _0801AB54 + movs r5, 0 + adds r6, r4, 0 + adds r6, 0x64 +_0801AB1E: + ldr r1, _0801AB58 + 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, _0801AB60 + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _0801AB64 + bl set_callback2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801AB54: .4byte 0x020244ec +_0801AB58: .4byte 0x02024744 +_0801AB5C: .4byte 0x0203cef8 +_0801AB60: .4byte 0x02038bca +_0801AB64: .4byte sub_8036760 + 1 + 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, _0801ABD8 + 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 Window_FastFillPixels + 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 sub_8199EEC + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801ABD8: .4byte 0x082f0de4 + 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 Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0801AC36 +_0801AC22: + movs r0, 0 + bl a_pressed_maybe + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _0801AC74 + 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, _0801AC78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801AC74: .4byte 0x030022c0 +_0801AC78: .4byte _0801AC7C + .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 lcd_io_set + ldr r4, _0801ADE8 + movs r0, 0x4 + bl malloc_and_clear + str r0, [r4] + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0801ADEC + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + bl reset_temp_tile_data_buffers + ldr r0, _0801ADF0 + bl Window_InitFromTemplates + lsls r0, 16 + cmp r0, 0 + bne _0801AD8C + b _0801AFC2 +_0801AD8C: + bl TextBox_ResetSomeField + movs r0, 0 + bl Window_FillTileMap + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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, _0801ADF4 + bl SetVBlankCallback + ldr r1, _0801ADF8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0801AF8A + .align 2, 0 +_0801ADE8: .4byte 0x02022c6c +_0801ADEC: .4byte 0x082f0dd0 +_0801ADF0: .4byte 0x082f0dd4 +_0801ADF4: .4byte sub_801AC40 + 1 +_0801ADF8: .4byte 0x030022c0 +_0801ADFC: + ldr r0, _0801AE18 + ldr r0, [r0] + ldr r1, _0801AE1C + movs r2, 0 + bl sub_801ABDC + cmp r0, 0 + bne _0801AE0E + b _0801AFAE +_0801AE0E: + ldr r1, _0801AE20 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0801AF8A + .align 2, 0 +_0801AE18: .4byte 0x02022c6c +_0801AE1C: .4byte 0x085efbd2 +_0801AE20: .4byte 0x030022c0 +_0801AE24: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0 + bl gpu_sync_bg_show + ldr r1, _0801AE44 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0801AF8A + .align 2, 0 +_0801AE44: .4byte 0x030022c0 +_0801AE48: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _0801AE54 + b _0801AFAE +_0801AE54: + ldr r4, _0801AE70 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x20 + bl memset + ldr r0, _0801AE74 + ldrb r1, [r0] + ldrb r0, [r0, 0x1] + cmn r1, r0 + bne _0801AE78 + movs r0, 0x52 + b _0801AE7A + .align 2, 0 +_0801AE70: .4byte 0x020228c4 +_0801AE74: .4byte 0x0203cef8 +_0801AE78: + movs r0, 0x51 +_0801AE7A: + strb r0, [r4] + ldr r1, _0801AE90 + movs r0, 0 + movs r2, 0x20 + bl link_0800A448 + ldr r1, _0801AE94 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0801AF8A + .align 2, 0 +_0801AE90: .4byte 0x020228c4 +_0801AE94: .4byte 0x030022c0 +_0801AE98: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0801AEA6 + b _0801AFAE +_0801AEA6: + ldr r1, _0801AED8 + 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 sub_80A1AD4 + ldr r0, _0801AEDC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x32 + b _0801AF16 + .align 2, 0 +_0801AED8: .4byte 0x020223c4 +_0801AEDC: .4byte 0x030022c0 +_0801AEE0: + bl sub_800AC34 + ldr r4, _0801AF04 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 16 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x52 + bne _0801AF0C + ldr r0, _0801AF08 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x6 + b _0801AF16 + .align 2, 0 +_0801AF04: .4byte 0x020223c4 +_0801AF08: .4byte 0x030022c0 +_0801AF0C: + ldr r0, _0801AF20 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x8 +_0801AF16: + strb r1, [r0] + bl sub_800A5B4 + b _0801AFAE + .align 2, 0 +_0801AF20: .4byte 0x030022c0 +_0801AF24: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0801AFAE + bl sub_800ADF8 + ldr r1, _0801AF3C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0801AF8A + .align 2, 0 +_0801AF3C: .4byte 0x030022c0 +_0801AF40: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801AFAE + ldr r0, _0801AF54 + bl set_callback2 + b _0801AFAE + .align 2, 0 +_0801AF54: .4byte sub_801AAD4 + 1 +_0801AF58: + ldr r0, _0801AF70 + ldr r0, [r0] + ldr r1, _0801AF74 + movs r2, 0x1 + bl sub_801ABDC + cmp r0, 0 + beq _0801AFAE + ldr r0, _0801AF78 + bl set_callback2 + b _0801AFAE + .align 2, 0 +_0801AF70: .4byte 0x02022c6c +_0801AF74: .4byte 0x085efc27 +_0801AF78: .4byte c2_exit_to_overworld_2_switch + 1 +_0801AF7C: + ldr r0, _0801AF94 + 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 + .align 2, 0 +_0801AF94: .4byte 0x03003124 +_0801AF98: + ldr r0, _0801AFCC + ldr r0, [r0] + ldr r1, _0801AFD0 + movs r2, 0x1 + bl sub_801ABDC + cmp r0, 0 + beq _0801AFAE + ldr r0, _0801AFD4 + bl set_callback2 +_0801AFAE: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably +_0801AFC2: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801AFCC: .4byte 0x02022c6c +_0801AFD0: .4byte 0x085efc0c +_0801AFD4: .4byte c2_exit_to_overworld_2_switch + 1 + 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, _0801B000 + ldr r1, [r0] + ldr r0, _0801B004 + adds r1, r0 + ldr r2, _0801B008 + mov r0, sp + bl CpuSet + bl sub_801B180 + bl sub_811F8BC + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0801B000: .4byte 0x03005d8c +_0801B004: .4byte 0x0000322c +_0801B008: .4byte 0x050000db + thumb_func_end sub_801AFD8 + + thumb_func_start sub_801B00C +sub_801B00C: @ 801B00C + ldr r0, _0801B018 + ldr r0, [r0] + ldr r1, _0801B01C + adds r0, r1 + bx lr + .align 2, 0 +_0801B018: .4byte 0x03005d8c +_0801B01C: .4byte 0x00003230 + thumb_func_end sub_801B00C + + thumb_func_start sav1_get_mevent_buffer_1 +sav1_get_mevent_buffer_1: @ 801B020 + ldr r0, _0801B02C + ldr r0, [r0] + ldr r1, _0801B030 + adds r0, r1 + bx lr + .align 2, 0 +_0801B02C: .4byte 0x03005d8c +_0801B030: .4byte 0x000033f0 + thumb_func_end sav1_get_mevent_buffer_1 + + thumb_func_start sav1_get_mevent_buffer_2 +sav1_get_mevent_buffer_2: @ 801B034 + ldr r0, _0801B040 + ldr r0, [r0] + movs r1, 0xD5 + lsls r1, 6 + adds r0, r1 + bx lr + .align 2, 0 +_0801B040: .4byte 0x03005d8c + thumb_func_end sav1_get_mevent_buffer_2 + + thumb_func_start sub_801B044 +sub_801B044: @ 801B044 + ldr r0, _0801B050 + ldr r0, [r0] + ldr r1, _0801B054 + adds r0, r1 + bx lr + .align 2, 0 +_0801B050: .4byte 0x03005d8c +_0801B054: .4byte 0x0000356c + thumb_func_end sub_801B044 + + thumb_func_start sub_801B058 +sub_801B058: @ 801B058 + ldr r0, _0801B064 + ldr r0, [r0] + ldr r1, _0801B068 + adds r0, r1 + bx lr + .align 2, 0 +_0801B064: .4byte 0x03005d8c +_0801B068: .4byte 0x00003564 + 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, _0801B0B8 + ldr r0, [r4] + ldr r5, _0801B0BC + 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, _0801B0C0 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + movs r0, 0x1 + b _0801B0C6 + .align 2, 0 +_0801B0B8: .4byte 0x03005d8c +_0801B0BC: .4byte 0x00003230 +_0801B0C0: .4byte 0x0000322c +_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, _0801B100 + ldr r0, [r4] + ldr r1, _0801B104 + adds r0, r1 + movs r1, 0xDE + lsls r1, 1 + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + ldr r4, [r4] + ldr r2, _0801B108 + adds r1, r4, r2 + ldr r1, [r1] + cmp r0, r1 + bne _0801B10C + ldr r1, _0801B104 + adds r0, r4, r1 + bl sub_801B114 + cmp r0, 0 + beq _0801B10C + movs r0, 0x1 + b _0801B10E + .align 2, 0 +_0801B100: .4byte 0x03005d8c +_0801B104: .4byte 0x00003230 +_0801B108: .4byte 0x0000322c +_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, _0801B13C + ldr r0, [r0] + ldr r1, _0801B140 + adds r0, r1 + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0801B144 + movs r0, 0x1 + b _0801B146 + .align 2, 0 +_0801B13C: .4byte 0x03005d8c +_0801B140: .4byte 0x00003230 +_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, _0801B174 + mov r0, sp + bl CpuSet + ldr r0, _0801B178 + ldr r0, [r0] + ldr r1, _0801B17C + adds r0, r1 + str r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B174: .4byte 0x0500006f +_0801B178: .4byte 0x03005d8c +_0801B17C: .4byte 0x0000322c + 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, _0801B1A0 + mov r0, sp + bl CpuSet + bl sub_801DBC0 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0801B1A0: .4byte 0x05000001 + thumb_func_end sub_801B180 + + thumb_func_start sub_801B1A4 +sub_801B1A4: @ 801B1A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0801B1BC + ldr r0, [r0] + ldr r1, _0801B1C0 + adds r4, r0, r1 + bl sub_801B0CC + cmp r0, 0 + bne _0801B1C4 +_0801B1B8: + movs r0, 0 + b _0801B1DC + .align 2, 0 +_0801B1BC: .4byte 0x03005d8c +_0801B1C0: .4byte 0x00003230 +_0801B1C4: + movs r2, 0 + ldr r3, _0801B1E4 +_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 + .align 2, 0 +_0801B1E4: .4byte 0x000001bb + 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, _0801B214 + ldr r0, [r0] + ldr r1, _0801B218 + adds r0, r1 + bl sub_816534C + pop {r0} + bx r0 + .align 2, 0 +_0801B214: .4byte 0x03005d90 +_0801B218: .4byte 0x00000bec + 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, _0801B268 + ldr r0, [r4] + ldr r5, _0801B26C + 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, _0801B270 + 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 + .align 2, 0 +_0801B268: .4byte 0x03005d8c +_0801B26C: .4byte 0x000033f0 +_0801B270: .4byte 0x000033ec +_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, _0801B2B8 + ldr r0, [r5] + ldr r1, _0801B2BC + 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, _0801B2C0 + adds r0, r1 + bl sub_801B2CC + cmp r0, 0 + beq _0801B2C4 + bl sub_80991F8 + cmp r0, 0 + beq _0801B2C4 + movs r0, 0x1 + b _0801B2C6 + .align 2, 0 +_0801B2B8: .4byte 0x03005d8c +_0801B2BC: .4byte 0x000033ec +_0801B2C0: .4byte 0x000033f0 +_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, _0801B320 + ldr r0, [r0] + ldr r1, _0801B324 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0801B328 + movs r0, 0x1 + b _0801B32A + .align 2, 0 +_0801B320: .4byte 0x03005d8c +_0801B324: .4byte 0x000033f0 +_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, _0801B358 + ldr r1, [r4] + ldr r0, _0801B35C + adds r1, r0 + ldr r2, _0801B360 + mov r0, sp + bl CpuSet + ldr r0, [r4] + ldr r1, _0801B364 + adds r0, r1 + str r5, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801B358: .4byte 0x03005d8c +_0801B35C: .4byte 0x000033f0 +_0801B360: .4byte 0x05000053 +_0801B364: .4byte 0x000033ec + 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, _0801B390 + mov r0, sp + bl CpuSet + ldr r0, _0801B394 + ldr r0, [r0] + ldr r1, _0801B398 + adds r0, r1 + str r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B390: .4byte 0x05000009 +_0801B394: .4byte 0x03005d8c +_0801B398: .4byte 0x0000353c + 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, _0801B3B8 + ldr r0, [r0] + ldr r1, _0801B3BC + adds r0, r1 + ldrh r0, [r0] +_0801B3B4: + pop {r1} + bx r1 + .align 2, 0 +_0801B3B8: .4byte 0x03005d8c +_0801B3BC: .4byte 0x000033f0 + 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, _0801B3EC + adds r0, r1 + lsrs r0, 16 + cmp r0, 0x13 + bls _0801B3F0 + movs r0, 0 + b _0801B3F2 + .align 2, 0 +_0801B3EC: .4byte 0xfc180000 +_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, _0801B428 + ldr r2, _0801B42C + adds r0, r4, r2 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0801B430 + movs r0, 0x1 + b _0801B432 + .align 2, 0 +_0801B428: .4byte 0x082f0de8 +_0801B42C: .4byte 0xfffffc18 +_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, _0801B4C0 + cmp r1, r0 + bhi _0801B4C4 + movs r0, 0x1 + b _0801B4C6 + .align 2, 0 +_0801B4C0: .4byte 0x0000019b +_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, _0801B4F8 + ldr r3, [r0] + ldr r0, _0801B4FC + 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 + .align 2, 0 +_0801B4F8: .4byte 0x03005d8c +_0801B4FC: .4byte 0x000033f0 +_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, _0801B538 + ldr r0, [r6] + ldr r1, _0801B53C + 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 + .align 2, 0 +_0801B538: .4byte 0x03005d8c +_0801B53C: .4byte 0x000033f0 +_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, _0801B57C + 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 + .align 2, 0 +_0801B57C: .4byte 0x00003548 + 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, _0801B5B4 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + ldr r0, _0801B5B8 + 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, _0801B5BC + b _0801B5C8 + .align 2, 0 +_0801B5B4: .4byte 0x05000019 +_0801B5B8: .4byte 0x00000101 +_0801B5BC: .4byte 0x00000201 +_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, _0801B688 + 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, _0801B68C + ldr r0, [r0] + ldr r3, _0801B690 + 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 gf_strcpy + ldr r0, _0801B68C + ldr r0, [r0] + ldr r3, _0801B694 + 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, _0801B698 + mov r0, r9 + movs r2, 0x4 + bl memcpy + ldr r0, _0801B69C + 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 + .align 2, 0 +_0801B688: .4byte 0x03005d90 +_0801B68C: .4byte 0x03005d8c +_0801B690: .4byte 0x00003564 +_0801B694: .4byte 0x00002bb0 +_0801B698: .4byte CartridgeHeaderGameCode +_0801B69C: .4byte CartridgeHeaderSoftwareVersion + 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, _0801B6E0 + 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 + .align 2, 0 +_0801B6E0: .4byte 0x00000101 +_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, _0801B798 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B798: .4byte _0801B79C + .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, _0801B800 + ldr r0, [r2] + ldr r1, _0801B804 + 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, _0801B808 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B800: .4byte 0x03005d8c +_0801B804: .4byte 0x000033f0 +_0801B808: .4byte _0801B80C + .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, _0801B830 + b _0801B838 + .align 2, 0 +_0801B830: .4byte 0x00003542 +_0801B834: + ldr r0, [r3] + ldr r1, _0801B858 +_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, _0801B85C + cmp r0, r1 + bls _0801B850 + strh r1, [r2] +_0801B850: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B858: .4byte 0x00003544 +_0801B85C: .4byte 0x000003e7 + 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, _0801B870 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B870: .4byte _0801B874 + .align 2, 0 +_0801B874: + .4byte _0801B888 + .4byte _0801B8AC + .4byte _0801B8D0 + .4byte _0801B8F4 + .4byte _0801B918 +_0801B888: + ldr r0, _0801B8A4 + ldr r2, [r0] + ldr r1, _0801B8A8 + 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 + .align 2, 0 +_0801B8A4: .4byte 0x03005d8c +_0801B8A8: .4byte 0x000033f0 +_0801B8AC: + ldr r0, _0801B8C8 + ldr r2, [r0] + ldr r1, _0801B8CC + 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 + .align 2, 0 +_0801B8C8: .4byte 0x03005d8c +_0801B8CC: .4byte 0x000033f0 +_0801B8D0: + ldr r0, _0801B8EC + ldr r2, [r0] + ldr r1, _0801B8F0 + 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 + .align 2, 0 +_0801B8EC: .4byte 0x03005d8c +_0801B8F0: .4byte 0x000033f0 +_0801B8F4: + ldr r0, _0801B910 + ldr r0, [r0] + ldr r1, _0801B914 + 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 + .align 2, 0 +_0801B910: .4byte 0x03005d8c +_0801B914: .4byte 0x000033f0 +_0801B918: + ldr r0, _0801B930 + ldr r0, [r0] + ldr r1, _0801B934 + 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 + .align 2, 0 +_0801B930: .4byte 0x03005d8c +_0801B934: .4byte 0x000033f0 +_0801B938: + movs r0, 0 +_0801B93A: + pop {r1} + bx r1 + thumb_func_end mevent_081445C0 + + thumb_func_start sub_801B940 +sub_801B940: @ 801B940 + ldr r1, _0801B948 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_0801B948: .4byte 0x02022c70 + 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, _0801B97C + movs r0, 0 + str r0, [r5] + cmp r4, 0 + beq _0801B98A + bl sub_801B27C + cmp r0, 0 + beq _0801B988 + ldr r0, _0801B980 + ldr r0, [r0] + ldr r1, _0801B984 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r4 + bne _0801B988 + movs r0, 0x1 + str r0, [r5] + b _0801B98A + .align 2, 0 +_0801B97C: .4byte 0x02022c70 +_0801B980: .4byte 0x03005d8c +_0801B984: .4byte 0x000033f0 +_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, _0801B9B4 + 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, _0801B9B8 + ldr r2, [r0] + ldr r0, _0801B9BC + adds r2, r0 + movs r0, 0x2 + b _0801B9CA + .align 2, 0 +_0801B9B4: .4byte 0x02022c70 +_0801B9B8: .4byte 0x03005d8c +_0801B9BC: .4byte 0x00003584 +_0801B9C0: + ldr r0, _0801B9D4 + ldr r2, [r0] + ldr r0, _0801B9D8 + adds r2, r0 + movs r0, 0 +_0801B9CA: + movs r3, 0x5 + bl sub_801BA8C + b _0801B9EC + .align 2, 0 +_0801B9D4: .4byte 0x03005d8c +_0801B9D8: .4byte 0x00003570 +_0801B9DC: + ldr r0, _0801B9F0 + ldr r2, [r0] + ldr r0, _0801B9F4 + adds r2, r0 + movs r0, 0x1 + movs r3, 0x5 + bl sub_801BA8C +_0801B9EC: + pop {r0} + bx r0 + .align 2, 0 +_0801B9F0: .4byte 0x03005d8c +_0801B9F4: .4byte 0x00003570 + 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, _0801BA18 + ldr r1, [r0] + ldr r0, _0801BA1C + adds r1, r0 + ldr r2, _0801BA20 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0801BA18: .4byte 0x03005d8c +_0801BA1C: .4byte 0x00003570 +_0801BA20: .4byte 0x0500000a + 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, _0801BACC + ldr r0, _0801BAD0 + bl malloc_and_clear + str r0, [r7] + cmp r0, 0 + bne _0801BAD4 +_0801BAC8: + movs r0, 0 + b _0801BB3E + .align 2, 0 +_0801BACC: .4byte 0x02022c74 +_0801BAD0: .4byte 0x0000145c +_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, _0801BB44 + adds r0, r1 + str r0, [r2] + movs r0, 0x1 +_0801BB3E: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801BB44: .4byte 0x082f1d60 + thumb_func_end sub_801BAAC + + thumb_func_start sub_801BB48 +sub_801BB48: @ 801BB48 + push {r4,lr} + ldr r4, _0801BB6C + ldr r0, [r4] + cmp r0, 0 + beq _0801BB64 + ldr r2, _0801BB70 + movs r1, 0 + bl memset + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] +_0801BB64: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801BB6C: .4byte 0x02022c74 +_0801BB70: .4byte 0x0000145c + thumb_func_end sub_801BB48 + + thumb_func_start sub_801BB74 +sub_801BB74: @ 801BB74 + push {r4-r6,lr} + sub sp, 0x24 + ldr r5, _0801BB88 + ldr r0, [r5] + cmp r0, 0 + bne _0801BB8C + movs r0, 0x1 + negs r0, r0 + b _0801BD98 + .align 2, 0 +_0801BB88: .4byte 0x02022c74 +_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, _0801BBA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801BBA4: .4byte _0801BBA8 + .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 sub_80A1AD4 + 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 bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r5, _0801BC84 + 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, _0801BC88 + adds r0, r4, 0 + bl Window_AddFromTemplate + ldr r1, [r5] + movs r2, 0xBB + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + adds r0, r4, 0 + adds r0, 0x8 + bl Window_AddFromTemplate + ldr r1, [r5] + movs r2, 0xBC + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + adds r4, 0x10 + adds r0, r4, 0 + bl Window_AddFromTemplate + ldr r1, [r5] + movs r2, 0xBD + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + b _0801BD86 + .align 2, 0 +_0801BC84: .4byte 0x02022c74 +_0801BC88: .4byte 0x082f0e1c +_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, _0801BD08 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r5, _0801BD0C + 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, _0801BD10 + 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 bg_copy_tilemap_rect + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0801BD86 + .align 2, 0 +_0801BD08: .4byte 0x02037fd4 +_0801BD0C: .4byte 0x02022c74 +_0801BD10: .4byte 0x0000045c +_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 gpu_copy_wram_bg_tilemap_to_vram + b _0801BD86 +_0801BD34: + bl sub_80D2F04 + b _0801BD86 +_0801BD3A: + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r2, _0801BD6C + 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 sub_80A1AD4 + bl fade_and_return_progress_probably + b _0801BD86 + .align 2, 0 +_0801BD6C: .4byte 0x02037fd4 +_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, _0801BDA0 + 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 + .align 2, 0 +_0801BDA0: .4byte 0x02022c74 + 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, _0801BDB8 + ldr r0, [r5] + cmp r0, 0 + bne _0801BDBC + movs r0, 0x1 + negs r0, r0 + b _0801BEEC + .align 2, 0 +_0801BDB8: .4byte 0x02022c74 +_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, _0801BDD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801BDD4: .4byte _0801BDD8 + .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 sub_80A1AD4 + 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 bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0801BEDA +_0801BE56: + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + ldr r4, _0801BE90 + ldr r0, [r4] + movs r1, 0xBD + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl Window_Remove + ldr r0, [r4] + movs r1, 0xBC + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl Window_Remove + ldr r0, [r4] + movs r1, 0xBB + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl Window_Remove + b _0801BEDA + .align 2, 0 +_0801BE90: .4byte 0x02022c74 +_0801BE94: + bl sub_801C61C + bl sub_80D2F9C + b _0801BEDA +_0801BE9E: + ldr r0, _0801BEC0 + ldrb r0, [r0] + adds r1, r2, 0 + bl sub_80186EC + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _0801BEDA + .align 2, 0 +_0801BEC0: .4byte 0x02022c60 +_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, _0801BEF4 + 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 + .align 2, 0 +_0801BEF4: .4byte 0x02022c74 + 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, _0801BFDC + ldr r1, [r4] + ldr r2, _0801BFE0 + adds r0, r1, r2 + adds r1, 0xA + movs r2, 0x28 + bl memcpy + ldr r0, [r4] + ldr r3, _0801BFE4 + 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, _0801BFE8 + cmp r0, r2 + bls _0801BF54 + str r2, [r1, 0x4] +_0801BF54: + ldr r1, [r4] + ldr r2, _0801BFEC + adds r0, r1, r2 + ldr r1, [r1, 0x4] + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + 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, _0801BFDC + 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 + .align 2, 0 +_0801BFDC: .4byte 0x02022c74 +_0801BFE0: .4byte 0x0000018b +_0801BFE4: .4byte 0x000001b3 +_0801BFE8: .4byte 0x000f423f +_0801BFEC: .4byte 0x000001dd +_0801BFF0: + cmp r0, 0x2 + beq _0801C028 + b _0801C168 +_0801BFF6: + ldr r2, _0801C010 + adds r0, r1, r2 + movs r3, 0x91 + lsls r3, 1 + adds r1, r3 + movs r2, 0x28 + bl memcpy + ldr r1, [r6] + ldr r0, _0801C014 + adds r1, r0 + b _0801C01C + .align 2, 0 +_0801C010: .4byte 0x000002b1 +_0801C014: .4byte 0x000002d9 +_0801C018: + ldr r2, _0801C024 + adds r1, r2 +_0801C01C: + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + b _0801C168 + .align 2, 0 +_0801C024: .4byte 0x000002b1 +_0801C028: + ldr r3, _0801C0E4 + 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, _0801C0E8 + 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, _0801C0EC + mov r8, r1 + movs r2, 0x91 + lsls r2, 1 + mov r10, r2 + ldr r7, _0801C0F0 + 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, _0801C0F0 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + adds r0, r6, r0 + ldr r4, _0801C0F4 + adds r1, r2, r4 + adds r1, r0 + strb r3, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + b _0801C15E + .align 2, 0 +_0801C0E4: .4byte 0x000002b1 +_0801C0E8: .4byte 0x000003e7 +_0801C0EC: .4byte 0x02022c74 +_0801C0F0: .4byte 0x00000175 +_0801C0F4: .4byte 0x000002dd +_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 decimal_int_to_string + 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, _0801C1C0 + 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 Window_WriteStandardTileMap + adds r0, r5, 0 + movs r1, 0 + bl Window_FastFillPixels + cmp r4, 0x1 + beq _0801C2A0 + cmp r4, 0x1 + bgt _0801C1C4 + cmp r4, 0 + beq _0801C1D0 + mov r9, r6 + b _0801C498 + .align 2, 0 +_0801C1C0: .4byte 0x02022c74 +_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, _0801C294 + mov r8, r0 + add r1, r8 + str r1, [sp] + ldr r1, [sp, 0xC] + str r1, [sp, 0x4] + ldr r0, _0801C298 + 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 fbox_get_field + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x3 + adds r1, r4, 0 + bl font_get_width_of_string + 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, _0801C29C + 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 + .align 2, 0 +_0801C294: .4byte 0x082f0e10 +_0801C298: .4byte 0x0000018b +_0801C29C: .4byte 0x000001dd +_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, _0801C2FC + 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, _0801C300 + 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 + .align 2, 0 +_0801C2FC: .4byte 0x02022c74 +_0801C300: .4byte 0x082f0e10 +_0801C304: + ldr r4, _0801C38C + 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, _0801C390 + 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, _0801C394 + 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 + .align 2, 0 +_0801C38C: .4byte 0x082f0e18 +_0801C390: .4byte 0x082f0e10 +_0801C394: .4byte 0x000002b1 +_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 fbox_get_field + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r7] + ldr r1, _0801C4B4 + 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, _0801C4B8 + 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, _0801C4BC + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _0801C482 + adds r1, r4 + adds r1, 0x1 + movs r0, 0x3 + mov r2, r10 + bl font_get_width_of_string + 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, _0801C4B8 + 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 font_get_width_of_string + 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, _0801C4B4 + adds r0, r2 + ldrb r0, [r0] + cmp r1, r0 + blt _0801C3CE +_0801C498: + mov r1, r9 + lsrs r0, r1, 24 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801C4B4: .4byte 0x00000175 +_0801C4B8: .4byte 0x082f0e10 +_0801C4BC: .4byte 0x00000306 + 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, _0801C600 + 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, _0801C604 + 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, _0801C608 + 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, _0801C60C + bl gpu_tile_obj_decompress_and_load3 + 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, _0801C610 + adds r0, r1 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, [r4] + ldrb r0, [r0, 0x9] + cmp r7, r0 + bcs _0801C5EE + adds r6, r4, 0 + ldr r0, _0801C614 + 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, _0801C618 + adds r1, r5, 0 + movs r2, 0x90 + movs r3, 0x8 + bl obj_add_from_template_forward_search + 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, _0801C604 + 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 + .align 2, 0 +_0801C600: .4byte 0x02022c74 +_0801C604: .4byte nullsub_12 + 1 +_0801C608: .4byte 0x02020630 +_0801C60C: .4byte 0x082f1d00 +_0801C610: .4byte 0x082f1d08 +_0801C614: .4byte 0x0000017d +_0801C618: .4byte 0x082f1d48 + thumb_func_end sub_801C4C0 + + thumb_func_start sub_801C61C +sub_801C61C: @ 801C61C + push {r4-r7,lr} + movs r5, 0 + ldr r4, _0801C6BC + 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, _0801C6C0 + 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, _0801C6C0 +_0801C65A: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, _0801C6C4 + 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 obj_delete_and_free_tiles +_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 gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag +_0801C6B4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801C6BC: .4byte 0x02022c74 +_0801C6C0: .4byte 0x02020630 +_0801C6C4: .4byte 0x0000017d + 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, _0801C6E4 + ldr r0, _0801C6E8 + bl malloc_and_clear + str r0, [r5] + cmp r0, 0 + bne _0801C6EC +_0801C6DE: + movs r0, 0 + b _0801C71C + .align 2, 0 +_0801C6E4: .4byte 0x02022c78 +_0801C6E8: .4byte 0x000013a4 +_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, _0801C724 + adds r0, r1 + str r0, [r3] + ldr r0, _0801C728 + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + movs r0, 0x1 +_0801C71C: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801C724: .4byte 0x082f24c8 +_0801C728: .4byte 0x000001c1 + thumb_func_end sub_801C6C8 + + thumb_func_start sub_801C72C +sub_801C72C: @ 801C72C + push {r4,lr} + ldr r4, _0801C750 + ldr r0, [r4] + cmp r0, 0 + beq _0801C748 + ldr r2, _0801C754 + movs r1, 0 + bl memset + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] +_0801C748: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801C750: .4byte 0x02022c78 +_0801C754: .4byte 0x000013a4 + 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, _0801C774 + ldr r0, [r5] + cmp r0, 0 + bne _0801C778 + movs r0, 0x1 + negs r0, r0 + b _0801CA3A + .align 2, 0 +_0801C774: .4byte 0x02022c78 +_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, _0801C794 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801C794: .4byte _0801C798 + .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 sub_80A1AD4 + 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 bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + ldr r1, _0801C828 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x1F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x1B + bl lcd_io_set + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + b _0801CA1E + .align 2, 0 +_0801C828: .4byte 0x00001a98 +_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 bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r5, _0801C8CC + 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, _0801C8D0 + adds r0, r4, 0 + bl Window_AddFromTemplate + ldr r1, [r5] + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + adds r4, 0x8 + adds r0, r4, 0 + bl Window_AddFromTemplate + ldr r1, [r5] + movs r3, 0xE5 + lsls r3, 1 + adds r1, r3 + strh r0, [r1] + b _0801CA1E + .align 2, 0 +_0801C8CC: .4byte 0x02022c78 +_0801C8D0: .4byte 0x082f1de8 +_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, _0801C988 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r0, _0801C98C + 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 bg_copy_tilemap_rect + 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 bg_copy_tilemap_rect + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0801CA1E + .align 2, 0 +_0801C988: .4byte 0x02037fd4 +_0801C98C: .4byte 0x02022c78 +_0801C990: + bl sub_801CDCC + b _0801CA1E +_0801C996: + bl sub_801CE7C + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0801CA1E +_0801C9A8: + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r2, _0801C9F8 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r4, _0801C9FC + ldr r1, [r4] + movs r3, 0xE5 + lsls r3, 2 + adds r0, r1, r3 + movs r2, 0xE3 + lsls r2, 1 + adds r1, r2 + bl sub_81AF380 + ldr r1, [r4] + ldr r3, _0801CA00 + 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 sub_80A1AD4 + bl fade_and_return_progress_probably + b _0801CA1E + .align 2, 0 +_0801C9F8: .4byte 0x02037fd4 +_0801C9FC: .4byte 0x02022c78 +_0801CA00: .4byte 0x000001c1 +_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, _0801CA4C + 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 + .align 2, 0 +_0801CA4C: .4byte 0x02022c78 + 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, _0801CA64 + ldr r0, [r5] + cmp r0, 0 + bne _0801CA68 + movs r0, 0x1 + negs r0, r0 + b _0801CC2A + .align 2, 0 +_0801CA64: .4byte 0x02022c78 +_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, _0801CA84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801CA84: .4byte _0801CA88 + .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 sub_80A1AD4 + 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 bg_change_y_offset + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + 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 bg_fill_tilemap_rect + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + movs r5, 0x18 + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0801CC0E +_0801CB54: + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + ldr r4, _0801CB80 + ldr r0, [r4] + movs r1, 0xE5 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl Window_Remove + ldr r0, [r4] + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 + ldrb r0, [r0] + bl Window_Remove + b _0801CC0E + .align 2, 0 +_0801CB80: .4byte 0x02022c78 +_0801CB84: + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r4, _0801CBB8 + ldr r0, [r4] + ldr r2, _0801CBBC + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801CC0E + bl sub_81AF620 + ldr r0, [r4] + ldr r2, _0801CBBC + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] + b _0801CC0E + .align 2, 0 +_0801CBB8: .4byte 0x02022c78 +_0801CBBC: .4byte 0x000001c1 +_0801CBC0: + ldr r0, _0801CBF0 + ldrb r0, [r0] + adds r1, r2, 0 + bl sub_80186EC + movs r0, 0x3 + bl sub_8018798 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _0801CC0E + .align 2, 0 +_0801CBF0: .4byte 0x02022c60 +_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, _0801CC34 + 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 + .align 2, 0 +_0801CC34: .4byte 0x02022c78 + thumb_func_end sub_801CA50 + + thumb_func_start sub_801CC38 +sub_801CC38: @ 801CC38 + push {r4,r5,lr} + ldr r4, _0801CC78 + 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, _0801CC7C + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801CC72 + bl sub_81AF620 + ldr r0, [r4] + ldr r2, _0801CC7C + 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 + .align 2, 0 +_0801CC78: .4byte 0x02022c78 +_0801CC7C: .4byte 0x000001c1 + thumb_func_end sub_801CC38 + + thumb_func_start sub_801CC80 +sub_801CC80: @ 801CC80 + push {r4,lr} + ldr r4, _0801CCC8 + 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 sub_81AF380 + ldr r1, [r4] + ldr r2, _0801CCCC + 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 + .align 2, 0 +_0801CCC8: .4byte 0x02022c78 +_0801CCCC: .4byte 0x000001c1 + 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, _0801CCFC + 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 + .align 2, 0 +_0801CCFC: .4byte 0x02022c78 +_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, _0801CD4C + add r2, r12 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + b _0801CD7E + .align 2, 0 +_0801CD4C: .4byte 0x000001c3 +_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, _0801CDC0 + 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 + .align 2, 0 +_0801CDC0: .4byte 0x000001c3 +_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, _0801CE6C + 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, _0801CE70 + adds r0, r3 + adds r1, r2 + adds r1, 0x2C + movs r2, 0x28 + bl memcpy + ldr r0, [r6] + ldr r1, _0801CE74 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] + cmp r5, 0x7 + bls _0801CE34 + ldr r1, [r6] + ldr r2, _0801CE70 + 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, _0801CE6C + ldr r1, [r2] + movs r4, 0xE5 + lsls r4, 2 + adds r1, r4 + ldr r0, _0801CE78 + 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 + .align 2, 0 +_0801CE6C: .4byte 0x02022c78 +_0801CE70: .4byte 0x000001f7 +_0801CE74: .4byte 0x0000021f +_0801CE78: .4byte 0x082f1df8 + 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, _0801CF98 + ldr r0, [r6] + movs r7, 0xE4 + lsls r7, 1 + adds r0, r7 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r6] + movs r4, 0xE5 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r6] + adds r0, r7 + ldrb r0, [r0] + movs r1, 0 + bl Window_FastFillPixels + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + bl Window_FastFillPixels + ldr r4, [r6] + movs r0, 0xE7 + lsls r0, 1 + mov r8, r0 + add r4, r8 + movs r0, 0x3 + movs r1, 0x2 + bl fbox_get_field + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x3 + adds r1, r4, 0 + bl font_get_width_of_string + 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, _0801CF9C + 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, _0801CF98 + 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, _0801CF9C + 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, _0801CFA0 + 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 Window_CopyToVram + ldr r0, [r6] + movs r1, 0xE5 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801CF98: .4byte 0x02022c78 +_0801CF9C: .4byte 0x082f1de0 +_0801CFA0: .4byte 0x000001f7 + thumb_func_end sub_801CE7C + + thumb_func_start sub_801CFA4 +sub_801CFA4: @ 801CFA4 + push {r4-r6,lr} + ldr r0, _0801CFDC + 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, _0801CFE0 + 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 bg_change_y_offset + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + b _0801CFF8 + .align 2, 0 +_0801CFDC: .4byte 0x02022c78 +_0801CFE0: .4byte 0x000001c3 +_0801CFE4: + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x2 + bl bg_change_y_offset + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0x2 + bl bg_change_y_offset +_0801CFF8: + ldr r3, _0801D03C + ldr r0, [r3] + ldr r2, _0801D040 + 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 + .align 2, 0 +_0801D03C: .4byte 0x02022c78 +_0801D040: .4byte 0x000001c3 +_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, _0801D078 + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + strb r0, [r2] +_0801D070: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801D078: .4byte 0x000001c3 + thumb_func_end sub_801CFA4 + + thumb_func_start sub_801D07C +sub_801D07C: @ 801D07C + push {r4,lr} + ldr r4, _0801D098 + movs r0, 0x60 + bl malloc_and_clear + str r0, [r4] + ldr r1, _0801D09C + movs r2, 0 + movs r3, 0x1 + bl mevent_srv_init_common + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801D098: .4byte 0x02022c7c +_0801D09C: .4byte 0x082f298c + thumb_func_end sub_801D07C + + thumb_func_start sub_801D0A0 +sub_801D0A0: @ 801D0A0 + push {r4,lr} + ldr r4, _0801D0BC + movs r0, 0x60 + bl malloc_and_clear + str r0, [r4] + ldr r1, _0801D0C0 + movs r2, 0 + movs r3, 0x1 + bl mevent_srv_init_common + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801D0BC: .4byte 0x02022c7c +_0801D0C0: .4byte 0x082f29ec + thumb_func_end sub_801D0A0 + + thumb_func_start sub_801D0C4 +sub_801D0C4: @ 801D0C4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, _0801D0D4 + ldr r0, [r4] + cmp r0, 0 + bne _0801D0D8 + movs r0, 0x3 + b _0801D0F8 + .align 2, 0 +_0801D0D4: .4byte 0x02022c7c +_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 malloc_and_clear + str r0, [r4, 0x18] + movs r0, 0xDE + lsls r0, 1 + bl malloc_and_clear + str r0, [r4, 0x1C] + movs r0, 0x80 + lsls r0, 3 + bl malloc_and_clear + str r0, [r4, 0x14] + movs r0, 0x64 + bl malloc_and_clear + 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, _0801D218 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801D218: .4byte _0801D21C + .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, _0801D480 + ldr r1, [r0, 0x8] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .align 2, 0 +_0801D480: .4byte 0x082f2548 + thumb_func_end mevent_dispatch_08145600 + + thumb_func_start sub_801D484 +sub_801D484: @ 801D484 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0801D4A4 + movs r0, 0x50 + bl malloc_and_clear + 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 + .align 2, 0 +_0801D4A4: .4byte 0x02022c80 + thumb_func_end sub_801D484 + + thumb_func_start sub_801D4A8 +sub_801D4A8: @ 801D4A8 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, _0801D4B8 + ldr r0, [r4] + cmp r0, 0 + bne _0801D4BC + movs r0, 0x6 + b _0801D4DC + .align 2, 0 +_0801D4B8: .4byte 0x02022c80 +_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, _0801D4F0 + ldr r1, [r0] + ldr r0, [r1, 0xC] + adds r0, 0x1 + str r0, [r1, 0xC] + bx lr + .align 2, 0 +_0801D4F0: .4byte 0x02022c80 + thumb_func_end sub_801D4E4 + + thumb_func_start sub_801D4F4 +sub_801D4F4: @ 801D4F4 + ldr r0, _0801D4FC + ldr r0, [r0] + ldr r0, [r0, 0x20] + bx lr + .align 2, 0 +_0801D4FC: .4byte 0x02022c80 + thumb_func_end sub_801D4F4 + + thumb_func_start sub_801D500 +sub_801D500: @ 801D500 + ldr r1, _0801D508 + ldr r1, [r1] + str r0, [r1, 0x4] + bx lr + .align 2, 0 +_0801D508: .4byte 0x02022c80 + 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 malloc_and_clear + str r0, [r4, 0x14] + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4, 0x18] + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4, 0x1C] + movs r0, 0x40 + bl malloc_and_clear + 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, _0801D5CC + 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 + .align 2, 0 +_0801D5CC: .4byte 0x05000100 + 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, _0801D5F4 + 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 + .align 2, 0 +_0801D5F4: .4byte 0x082f2598 + 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, _0801D660 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801D660: .4byte _0801D664 + .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, _0801D7E8 + ldr r0, [r0] + ldr r1, _0801D7EC + adds r0, r1 + ldr r1, [r4, 0x18] + movs r2, 0xBC + bl memcpy + bl sub_81652B4 + b _0801D804 + .align 2, 0 +_0801D7E8: .4byte 0x03005d90 +_0801D7EC: .4byte 0x00000bec +_0801D7F0: + ldr r0, _0801D80C + 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 + .align 2, 0 +_0801D80C: .4byte 0x0201c000 + 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, _0801D888 + adds r0, r4, 0x4 + ldr r1, _0801D88C + ldr r1, [r1] + ldr r2, _0801D890 + 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 + .align 2, 0 +_0801D888: .4byte 0x0201c000 +_0801D88C: .4byte 0x03005d90 +_0801D890: .4byte 0x03005d8c + 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, _0801D8BC + 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 + .align 2, 0 +_0801D8BC: .4byte 0x082f255c + 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, _0801D8FC + str r1, [r0, 0x24] + ldr r1, _0801D900 + str r1, [r0, 0x20] + bx lr + .align 2, 0 +_0801D8FC: .4byte sub_801DA5C + 1 +_0801D900: .4byte sub_801D988 + 1 + 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, _0801D950 + adds r3, r1 + adds r1, r3, 0 + bl memcpy + pop {r0} + bx r0 + .align 2, 0 +_0801D950: .4byte 0x020223c4 + 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, _0801DAC0 + 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, _0801DAC4 + 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 + .align 2, 0 +_0801DAC0: .4byte 0xffff0000 +_0801DAC4: .4byte 0x0000ffff +_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, _0801DBD8 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_0801DBD8: .4byte 0x0000402e + thumb_func_end sub_801DBC0 + + thumb_func_start sub_801DBDC +sub_801DBDC: @ 801DBDC + push {r4,lr} + ldr r0, _0801DC18 + bl var_get_pointer + 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, _0801DC1C + 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 + .align 2, 0 +_0801DC18: .4byte 0x0000402e +_0801DC1C: .4byte 0x01f30000 + thumb_func_end sub_801DBDC + + thumb_func_start sub_801DC20 +sub_801DC20: @ 801DC20 + push {r4-r6,lr} + ldr r6, _0801DC40 + 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 + .align 2, 0 +_0801DC40: .4byte 0x020375f0 +_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, _0801DC5C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801DC5C: .4byte _0801DC60 + .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, _0801DDC4 + movs r0, 0xDE + lsls r0, 1 + bl malloc + str r0, [r4] + bl sub_801DDD0 + ldr r1, _0801DDC8 + movs r0, 0x14 + strh r0, [r1] + movs r0, 0 + bl SetVBlankCallback + ldr r0, _0801DDCC + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801DDC4: .4byte 0x02022c84 +_0801DDC8: .4byte 0x030022b0 +_0801DDCC: .4byte c2_081284E0 + 1 + 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, _0801DE28 + ldr r6, _0801DE2C + adds r4, 0xB9 + movs r5, 0x9 +_0801DE0E: + ldr r1, [r7] + adds r1, r6 + adds r0, r4, 0 + bl gf_strcpy + adds r6, 0x15 + adds r4, 0x15 + subs r5, 0x1 + cmp r5, 0 + bge _0801DE0E + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801DE28: .4byte 0x03005d8c +_0801DE2C: .4byte 0x00003c88 + thumb_func_end sub_801DDD0 + + thumb_func_start sub_801DE30 +sub_801DE30: @ 801DE30 + push {r4,lr} + ldr r4, _0801DE50 + 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 + .align 2, 0 +_0801DE50: .4byte 0x02022c84 + thumb_func_end sub_801DE30 + + thumb_func_start c2_081284E0 +c2_081284E0: @ 801DE54 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, _0801DE70 + 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 + .align 2, 0 +_0801DE70: .4byte 0x030022c0 +_0801DE74: + cmp r0, 0x2 + beq _0801DEC8 + b _0801DF04 +_0801DE7A: + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + 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 sub_80A1AD4 + ldr r0, _0801DEC4 + bl SetVBlankCallback +_0801DEBC: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _0801DF04 + .align 2, 0 +_0801DEC4: .4byte sub_801DF20 + 1 +_0801DEC8: + bl fade_and_return_progress_probably + ldr r0, _0801DF0C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0801DF04 + ldr r0, _0801DF10 + bl set_callback2 + ldr r0, _0801DF14 + movs r1, 0x8 + bl AddTask + ldr r4, _0801DF18 + ldr r1, [r4] + strb r0, [r1, 0xE] + ldr r0, _0801DF1C + 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 + .align 2, 0 +_0801DF0C: .4byte 0x02037fd4 +_0801DF10: .4byte sub_801DF38 + 1 +_0801DF14: .4byte sub_801DF54 + 1 +_0801DF18: .4byte 0x02022c84 +_0801DF1C: .4byte sub_801F2B4 + 1 + thumb_func_end c2_081284E0 + + thumb_func_start sub_801DF20 +sub_801DF20: @ 801DF20 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl copy_super_sprites_to_oam + bl copy_queue_process + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_801DF20 + + thumb_func_start sub_801DF38 +sub_801DF38: @ 801DF38 + push {lr} + bl run_active_tasks + bl sub_801F5B8 + bl call_obj_callbacks + bl obj_sync_something + 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, _0801DF6C + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r0, 0x2 + beq _0801DF7A + cmp r0, 0x2 + bgt _0801DF70 + cmp r0, 0x1 + beq _0801DF76 + b _0801DF8A + .align 2, 0 +_0801DF6C: .4byte 0x02022c84 +_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, _0801DFA4 + ldr r0, _0801DFA8 + 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 + .align 2, 0 +_0801DFA4: .4byte 0x082f2a7c +_0801DFA8: .4byte 0x02022c84 + thumb_func_end sub_801DF54 + + thumb_func_start sub_801DFAC +sub_801DFAC: @ 801DFAC + push {r4,lr} + ldr r4, _0801DFC4 + ldr r0, [r4] + ldrh r1, [r0, 0x6] + cmp r1, 0x1 + beq _0801DFE0 + cmp r1, 0x1 + bgt _0801DFC8 + cmp r1, 0 + beq _0801DFCE + b _0801E028 + .align 2, 0 +_0801DFC4: .4byte 0x02022c84 +_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, _0801E014 + 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 + .align 2, 0 +_0801E014: .4byte 0x02022c84 +_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, _0801E044 + ldr r3, [r5] + ldrh r0, [r3, 0x6] + cmp r0, 0 + beq _0801E048 + cmp r0, 0x1 + beq _0801E0F6 + b _0801E118 + .align 2, 0 +_0801E044: .4byte 0x02022c84 +_0801E048: + ldr r1, _0801E064 + 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 + .align 2, 0 +_0801E064: .4byte 0x030022c0 +_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, _0801E138 + ldr r0, [r0] + ldrh r0, [r0, 0x6] + cmp r0, 0x4 + bls _0801E12E + b _0801E23A +_0801E12E: + lsls r0, 2 + ldr r1, _0801E13C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E138: .4byte 0x02022c84 +_0801E13C: .4byte _0801E140 + .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, _0801E178 + ldr r1, [r0] + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E23A + .align 2, 0 +_0801E178: .4byte 0x02022c84 +_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, _0801E1B0 + ldr r2, [r5] + ldrb r0, [r2, 0x10] + cmp r0, r4 + beq _0801E1DC + cmp r4, 0x3 + ble _0801E1EC + b _0801E1DC + .align 2, 0 +_0801E1B0: .4byte 0x02022c84 +_0801E1B4: + ldr r0, _0801E1D0 + 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 + .align 2, 0 +_0801E1D0: .4byte 0x030022c0 +_0801E1D4: + movs r0, 0x4 + movs r1, 0 + bl sub_801F5EC +_0801E1DC: + ldr r0, _0801E1E8 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x6] + b _0801E23A + .align 2, 0 +_0801E1E8: .4byte 0x02022c84 +_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, _0801E25C + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r2, r1, 0 + cmp r0, 0xA + bls _0801E250 + b _0801E458 +_0801E250: + lsls r0, 2 + ldr r1, _0801E260 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E25C: .4byte 0x02022c84 +_0801E260: .4byte _0801E264 + .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, _0801E2A4 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x6] + b _0801E458 + .align 2, 0 +_0801E2A4: .4byte 0x02022c84 +_0801E2A8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E2B6 + b _0801E458 +_0801E2B6: + ldr r0, _0801E2C0 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x6] + b _0801E458 + .align 2, 0 +_0801E2C0: .4byte 0x02022c84 +_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, _0801E30C + 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 + .align 2, 0 +_0801E30C: .4byte 0x02022c84 +_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, _0801E358 + ldr r1, [r0] + movs r0, 0xA + strh r0, [r1, 0x6] + b _0801E458 + .align 2, 0 +_0801E358: .4byte 0x02022c84 +_0801E35C: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E36A + b _0801E458 +_0801E36A: + ldr r0, _0801E374 + ldr r1, [r0] + movs r0, 0x8 + strh r0, [r1, 0x6] + b _0801E458 + .align 2, 0 +_0801E374: .4byte 0x02022c84 +_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, _0801E3A8 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x6] + b _0801E458 + .align 2, 0 +_0801E3A8: .4byte 0x02022c84 +_0801E3AC: + bl sub_80104B0 + ldr r4, _0801E3D0 + 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 + .align 2, 0 +_0801E3D0: .4byte 0x02022c84 +_0801E3D4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E414 + bl sub_8011A9C + cmp r0, 0 + bne _0801E414 + ldr r4, _0801E40C + 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 + .align 2, 0 +_0801E40C: .4byte 0x02022c84 +_0801E410: + movs r0, 0x5 +_0801E412: + strh r0, [r1, 0x6] +_0801E414: + ldr r0, _0801E420 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E458 + b _0801E42C + .align 2, 0 +_0801E420: .4byte 0x03003124 +_0801E424: + ldr r0, _0801E434 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E438 +_0801E42C: + movs r0, 0x9 + bl sub_801EBD4 + b _0801E458 + .align 2, 0 +_0801E434: .4byte 0x03003124 +_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, _0801E47C + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r2, r1, 0 + cmp r0, 0x7 + bls _0801E470 + b _0801E5BC +_0801E470: + lsls r0, 2 + ldr r1, _0801E480 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E47C: .4byte 0x02022c84 +_0801E480: .4byte _0801E484 + .align 2, 0 +_0801E484: + .4byte _0801E4A4 + .4byte _0801E4C8 + .4byte _0801E4E8 + .4byte _0801E50C + .4byte _0801E540 + .4byte _0801E560 + .4byte _0801E584 + .4byte _0801E5A8 +_0801E4A4: + ldr r0, _0801E4C0 + 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, _0801E4C4 + ldr r1, [r0] + b _0801E59A + .align 2, 0 +_0801E4C0: .4byte sub_801F2B4 + 1 +_0801E4C4: .4byte 0x02022c84 +_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, _0801E4E4 + ldr r1, [r0] + b _0801E59A + .align 2, 0 +_0801E4E4: .4byte 0x02022c84 +_0801E4E8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E5BC + ldr r4, _0801E508 + ldr r0, [r4] + movs r1, 0xC8 + lsls r1, 1 + adds r0, r1 + bl sub_801EFA8 + ldr r1, [r4] + b _0801E59A + .align 2, 0 +_0801E508: .4byte 0x02022c84 +_0801E50C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E5BC + bl sub_8011A9C + cmp r0, 0 + bne _0801E5BC + ldr r4, _0801E53C + 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 + .align 2, 0 +_0801E53C: .4byte 0x02022c84 +_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, _0801E55C + ldr r1, [r0] + b _0801E59A + .align 2, 0 +_0801E55C: .4byte 0x02022c84 +_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, _0801E580 + ldr r1, [r0] + strh r4, [r1, 0xA] + b _0801E59A + .align 2, 0 +_0801E580: .4byte 0x02022c84 +_0801E584: + ldr r1, [r2] + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bhi _0801E590 + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E590: + ldr r0, _0801E5A4 + 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 + .align 2, 0 +_0801E5A4: .4byte 0x03003124 +_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, _0801E5DC + ldr r1, [r5] + ldrh r0, [r1, 0x6] + cmp r0, 0x1 + beq _0801E604 + cmp r0, 0x1 + bgt _0801E5E0 + cmp r0, 0 + beq _0801E5EA + b _0801E662 + .align 2, 0 +_0801E5DC: .4byte 0x02022c84 +_0801E5E0: + cmp r0, 0x2 + beq _0801E62E + cmp r0, 0x3 + beq _0801E650 + b _0801E662 +_0801E5EA: + ldr r0, _0801E600 + 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 + .align 2, 0 +_0801E600: .4byte sub_801F2B4 + 1 +_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, _0801E64C + 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 + .align 2, 0 +_0801E64C: .4byte 0x03003124 +_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, _0801E680 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _0801E75C + lsls r0, 2 + ldr r1, _0801E684 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E680: .4byte 0x02022c84 +_0801E684: .4byte _0801E688 + .align 2, 0 +_0801E688: + .4byte _0801E69C + .4byte _0801E6C8 + .4byte _0801E6F0 + .4byte _0801E724 + .4byte _0801E748 +_0801E69C: + ldr r0, _0801E6C0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0801E75C + ldr r4, _0801E6C4 + 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 + .align 2, 0 +_0801E6C0: .4byte sub_801F2B4 + 1 +_0801E6C4: .4byte 0x02022c84 +_0801E6C8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E75C + ldr r4, _0801E6EC + 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 + .align 2, 0 +_0801E6EC: .4byte 0x02022c84 +_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, _0801E720 + ldr r1, [r0] + strh r4, [r1, 0xA] + b _0801E73A + .align 2, 0 +_0801E720: .4byte 0x02022c84 +_0801E724: + ldr r1, [r2] + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bhi _0801E730 + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E730: + ldr r0, _0801E744 + 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 + .align 2, 0 +_0801E744: .4byte 0x03003124 +_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, _0801E77C + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0801E830 + lsls r0, 2 + ldr r1, _0801E780 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E77C: .4byte 0x02022c84 +_0801E780: .4byte _0801E784 + .align 2, 0 +_0801E784: + .4byte _0801E798 + .4byte _0801E7C0 + .4byte _0801E7F4 + .4byte _0801E802 + .4byte _0801E820 +_0801E798: + ldr r0, _0801E7A8 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E7AC + movs r0, 0x1 + bl sub_801EBD4 + b _0801E830 + .align 2, 0 +_0801E7A8: .4byte 0x03003124 +_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, _0801E7F0 + 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 + .align 2, 0 +_0801E7F0: .4byte 0x02022c84 +_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, _0801E81C + ldr r1, [r0] +_0801E812: + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E830 + .align 2, 0 +_0801E81C: .4byte 0x02022c84 +_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, _0801E850 + ldr r0, [r0] + ldrh r0, [r0, 0x6] + cmp r0, 0x6 + bls _0801E846 + b _0801E968 +_0801E846: + lsls r0, 2 + ldr r1, _0801E854 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E850: .4byte 0x02022c84 +_0801E854: .4byte _0801E858 + .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, _0801E88C + ldr r1, [r0] + movs r0, 0x2 + b _0801E966 + .align 2, 0 +_0801E88C: .4byte 0x02022c84 +_0801E890: + movs r0, 0xD + movs r1, 0 + bl sub_801F5EC + ldr r0, _0801E8A0 + ldr r1, [r0] + movs r0, 0x5 + b _0801E966 + .align 2, 0 +_0801E8A0: .4byte 0x02022c84 +_0801E8A4: + ldr r0, _0801E8C4 + 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, _0801E8C8 + ldr r1, [r0] + movs r0, 0x3 + b _0801E966 + .align 2, 0 +_0801E8C4: .4byte 0x030022c0 +_0801E8C8: .4byte 0x02022c84 +_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, _0801E8F4 + ldr r0, [r0] + strh r4, [r0, 0x6] + b _0801E968 + .align 2, 0 +_0801E8F4: .4byte 0x02022c84 +_0801E8F8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E968 + ldr r0, _0801E90C + ldr r1, [r0] + movs r0, 0x1 + b _0801E966 + .align 2, 0 +_0801E90C: .4byte 0x02022c84 +_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, _0801E948 + ldr r1, [r0] + movs r0, 0x6 + b _0801E966 + .align 2, 0 +_0801E948: .4byte 0x02022c84 +_0801E94C: + ldr r0, _0801E970 + 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, _0801E974 + ldr r1, [r0] + movs r0, 0x4 +_0801E966: + strh r0, [r1, 0x6] +_0801E968: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801E970: .4byte 0x030022c0 +_0801E974: .4byte 0x02022c84 + thumb_func_end sub_801E838 + + thumb_func_start sub_801E978 +sub_801E978: @ 801E978 + push {r4,lr} + sub sp, 0x4 + ldr r1, _0801E994 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r4, r1, 0 + cmp r0, 0xD + bls _0801E98A + b _0801EBC2 +_0801E98A: + lsls r0, 2 + ldr r1, _0801E998 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E994: .4byte 0x02022c84 +_0801E998: .4byte _0801E99C + .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, _0801EA10 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EA10: .4byte 0x02022c84 +_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, _0801EA3C + ldr r1, [r0] + b _0801EB82 + .align 2, 0 +_0801EA3C: .4byte 0x02022c84 +_0801EA40: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r0, _0801EA54 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EA54: .4byte 0x02022c84 +_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, _0801EA78 + ldr r1, [r0] + movs r0, 0x4 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EA78: .4byte 0x02022c84 +_0801EA7C: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801EA8A + b _0801EBC2 +_0801EA8A: + ldr r0, _0801EA94 + ldr r1, [r0] + movs r0, 0x5 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EA94: .4byte 0x02022c84 +_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, _0801EAC0 + ldr r1, [r0] + b _0801EB82 + .align 2, 0 +_0801EAC0: .4byte 0x02022c84 +_0801EAC4: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r0, _0801EAD8 + ldr r1, [r0] + movs r0, 0x6 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EAD8: .4byte 0x02022c84 +_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, _0801EB00 + ldr r1, [r0] + movs r0, 0x7 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EB00: .4byte 0x02022c84 +_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, _0801EB24 + ldr r1, [r0] + movs r0, 0x8 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EB24: .4byte 0x02022c84 +_0801EB28: + movs r0, 0x11 + movs r1, 0 + bl sub_801F5EC + ldr r0, _0801EB3C + ldr r1, [r0] + movs r0, 0x9 + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EB3C: .4byte 0x02022c84 +_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, _0801EB60 + ldr r1, [r0] + movs r0, 0xA + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EB60: .4byte 0x02022c84 +_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 sub_80A1AD4 + ldr r0, _0801EBA4 + ldr r1, [r0] + movs r0, 0xD + strh r0, [r1, 0x6] + b _0801EBC2 + .align 2, 0 +_0801EBA4: .4byte 0x02022c84 +_0801EBA8: + ldr r0, _0801EBCC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0801EBC2 + bl sub_801F544 + bl sub_801DE30 + ldr r0, _0801EBD0 + bl set_callback2 +_0801EBC2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EBCC: .4byte 0x02037fd4 +_0801EBD0: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_801E978 + + thumb_func_start sub_801EBD4 +sub_801EBD4: @ 801EBD4 + ldr r1, _0801EBE0 + ldr r1, [r1] + movs r2, 0 + strh r0, [r1, 0x4] + strh r2, [r1, 0x6] + bx lr + .align 2, 0 +_0801EBE0: .4byte 0x02022c84 + thumb_func_end sub_801EBD4 + + thumb_func_start sub_801EBE4 +sub_801EBE4: @ 801EBE4 + push {lr} + ldr r0, _0801EC14 + 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, _0801EC18 + ldr r2, [r0] + ldr r1, _0801EC1C + 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 + .align 2, 0 +_0801EC14: .4byte 0x030022c0 +_0801EC18: .4byte 0x02022c84 +_0801EC1C: .4byte 0x082f2aa4 +_0801EC20: + strb r3, [r2, 0x12] + b _0801EC8A +_0801EC24: + ldr r0, _0801EC48 + 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 + .align 2, 0 +_0801EC48: .4byte 0x02022c84 +_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, _0801EC7C + ldr r2, [r0] + ldrb r0, [r2, 0x12] + cmp r0, 0 + beq _0801EC80 + subs r0, 0x1 + b _0801EC88 + .align 2, 0 +_0801EC7C: .4byte 0x02022c84 +_0801EC80: + ldr r0, _0801EC90 + ldrb r1, [r2, 0x10] + adds r1, r0 + ldrb r0, [r1] +_0801EC88: + strb r0, [r2, 0x12] +_0801EC8A: + movs r0, 0x1 +_0801EC8C: + pop {r1} + bx r1 + .align 2, 0 +_0801EC90: .4byte 0x082f2aa4 + thumb_func_end sub_801EBE4 + + thumb_func_start sub_801EC94 +sub_801EC94: @ 801EC94 + push {r4-r6,lr} + sub sp, 0x18 + ldr r0, _0801ECD4 + ldr r5, [r0] + ldrb r0, [r5, 0x10] + cmp r0, 0x3 + beq _0801ECDC + ldr r3, _0801ECD8 + 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 + .align 2, 0 +_0801ECD4: .4byte 0x02022c84 +_0801ECD8: .4byte 0x082f2ba8 +_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 gf_strcpy + movs r1, 0 + strb r1, [r0] + movs r1, 0xFF + strb r1, [r0, 0x1] + mov r4, sp + mov r0, sp + bl sub_80091CC + adds r5, r0, 0 +_0801ED02: + ldr r6, _0801ED64 + 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 + .align 2, 0 +_0801ED64: .4byte 0x02022c84 + thumb_func_end sub_801EC94 + + thumb_func_start sub_801ED68 +sub_801ED68: @ 801ED68 + push {r4,lr} + ldr r4, _0801ED90 + 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 + .align 2, 0 +_0801ED90: .4byte 0x02022c84 + thumb_func_end sub_801ED68 + + thumb_func_start sub_801ED94 +sub_801ED94: @ 801ED94 + push {lr} + ldr r0, _0801EDBC + 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, _0801EDC0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0801EDB8 + strb r0, [r2] +_0801EDB8: + pop {r0} + bx r0 + .align 2, 0 +_0801EDBC: .4byte 0x02022c84 +_0801EDC0: .4byte 0x082f2aa8 + thumb_func_end sub_801ED94 + + thumb_func_start sub_801EDC4 +sub_801EDC4: @ 801EDC4 + push {lr} + ldr r0, _0801EDD4 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0801EDD8 + movs r0, 0 + b _0801EDDA + .align 2, 0 +_0801EDD4: .4byte 0x02022c84 +_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, _0801EE0C + 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 gf_strcpy + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x18] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EE0C: .4byte 0x02022c84 + thumb_func_end sub_801EDE0 + + thumb_func_start sub_801EE10 +sub_801EE10: @ 801EE10 + ldr r1, _0801EE28 + 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 + .align 2, 0 +_0801EE28: .4byte 0x02022c84 + thumb_func_end sub_801EE10 + + thumb_func_start sub_801EE2C +sub_801EE2C: @ 801EE2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0801EE60 + mov r8, r0 + ldr r7, _0801EE64 + movs r6, 0xB9 + ldr r5, _0801EE68 + movs r4, 0x9 +_0801EE3E: + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldr r1, [r7] + adds r1, r6 + bl gf_strcpy + 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 + .align 2, 0 +_0801EE60: .4byte 0x03005d8c +_0801EE64: .4byte 0x02022c84 +_0801EE68: .4byte 0x00003c88 + thumb_func_end sub_801EE2C + + thumb_func_start sub_801EE6C +sub_801EE6C: @ 801EE6C + ldr r2, _0801EE80 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r0 + adds r1, 0xB9 + ldr r0, [r2] + adds r0, r1 + bx lr + .align 2, 0 +_0801EE80: .4byte 0x02022c84 + thumb_func_end sub_801EE6C + + thumb_func_start sub_801EE84 +sub_801EE84: @ 801EE84 + push {lr} + ldr r0, _0801EEA4 + 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 + .align 2, 0 +_0801EEA4: .4byte 0x02022c84 + thumb_func_end sub_801EE84 + + thumb_func_start sub_801EEA8 +sub_801EEA8: @ 801EEA8 + push {lr} + ldr r0, _0801EED4 + 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 + .align 2, 0 +_0801EED4: .4byte 0x02022c84 + thumb_func_end sub_801EEA8 + + thumb_func_start sub_801EED8 +sub_801EED8: @ 801EED8 + push {r4,lr} + ldr r4, _0801EF18 + ldr r0, [r4] + adds r0, 0x1A + bl sub_80091CC + 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 + .align 2, 0 +_0801EF18: .4byte 0x02022c84 + 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, _0801EF44 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _0801EF48 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EF44: .4byte 0x03005d90 +_0801EF48: .4byte 0x02022c84 + 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, _0801EF74 + ldr r1, [r1] + bl gf_strcpy + adds r4, 0x9 + ldr r0, _0801EF78 + ldr r1, [r0] + adds r1, 0x1A + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EF74: .4byte 0x03005d90 +_0801EF78: .4byte 0x02022c84 + 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, _0801EFA0 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _0801EFA4 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + bl sub_8011A50 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EFA0: .4byte 0x03005d90 +_0801EFA4: .4byte 0x02022c84 + 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, _0801EFC8 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _0801EFCC + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EFC8: .4byte 0x03005d90 +_0801EFCC: .4byte 0x02022c84 + 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, _0801EFF0 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _0801EFF4 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801EFF0: .4byte 0x03005d90 +_0801EFF4: .4byte 0x02022c84 + 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, _0801F03C + 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, _0801F040 + b _0801F094 + .align 2, 0 +_0801F03C: .4byte 0x02022c84 +_0801F040: .4byte 0x085ed2a9 +_0801F044: + adds r0, r6, 0 + adds r1, r4, 0 + bl gf_strcpy + 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 gf_strcpy + movs r0, 0x1 + b _0801F0AA +_0801F06E: + ldr r0, _0801F0A0 + ldr r0, [r0] + adds r0, 0x79 + adds r1, r4, 0 + bl gf_strcpy +_0801F07A: + ldr r0, _0801F0A0 + 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, _0801F0A4 +_0801F094: + adds r0, r6, 0 + bl sub_81AFC28 + movs r0, 0x1 + b _0801F0AA + .align 2, 0 +_0801F0A0: .4byte 0x02022c84 +_0801F0A4: .4byte 0x085ed2bd +_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, _0801F0B8 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + bx lr + .align 2, 0 +_0801F0B8: .4byte 0x02022c84 + thumb_func_end sub_801F0B0 + + thumb_func_start sub_801F0BC +sub_801F0BC: @ 801F0BC + ldr r2, _0801F0CC + ldr r3, [r2] + ldrb r2, [r3, 0x11] + strb r2, [r0] + ldrb r0, [r3, 0x12] + strb r0, [r1] + bx lr + .align 2, 0 +_0801F0CC: .4byte 0x02022c84 + thumb_func_end sub_801F0BC + + thumb_func_start sub_801F0D0 +sub_801F0D0: @ 801F0D0 + ldr r0, _0801F0D8 + ldr r0, [r0] + adds r0, 0x1A + bx lr + .align 2, 0 +_0801F0D8: .4byte 0x02022c84 + thumb_func_end sub_801F0D0 + + thumb_func_start sub_801F0DC +sub_801F0DC: @ 801F0DC + push {lr} + bl sub_801F0D0 + bl sub_80091CC + 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, _0801F104 + 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 + .align 2, 0 +_0801F104: .4byte 0x02022c84 +_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, _0801F140 + 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 + .align 2, 0 +_0801F140: .4byte 0x02022c84 + 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, _0801F17C + 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 + .align 2, 0 +_0801F17C: .4byte 0x02022c84 + thumb_func_end sub_801F144 + + thumb_func_start sub_801F180 +sub_801F180: @ 801F180 + ldr r0, _0801F188 + ldr r0, [r0] + adds r0, 0x39 + bx lr + .align 2, 0 +_0801F188: .4byte 0x02022c84 + thumb_func_end sub_801F180 + + thumb_func_start sub_801F18C +sub_801F18C: @ 801F18C + ldr r0, _0801F194 + ldr r0, [r0] + ldrb r0, [r0, 0x16] + bx lr + .align 2, 0 +_0801F194: .4byte 0x02022c84 + thumb_func_end sub_801F18C + + thumb_func_start sub_801F198 +sub_801F198: @ 801F198 + ldr r0, _0801F1A0 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + bx lr + .align 2, 0 +_0801F1A0: .4byte 0x02022c84 + 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, _0801F1C4 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, r1 + beq _0801F1BE + cmp r0, 0 + bne _0801F1C8 +_0801F1BE: + movs r0, 0x3 + b _0801F1CA + .align 2, 0 +_0801F1C4: .4byte 0x082f2aa8 +_0801F1C8: + movs r0, 0 +_0801F1CA: + pop {r1} + bx r1 + thumb_func_end sub_801F1A4 + + thumb_func_start sub_801F1D0 +sub_801F1D0: @ 801F1D0 + ldr r0, _0801F1D8 + ldr r0, [r0] + adds r0, 0x79 + bx lr + .align 2, 0 +_0801F1D8: .4byte 0x02022c84 + thumb_func_end sub_801F1D0 + + thumb_func_start copy_strings_to_sav1 +copy_strings_to_sav1: @ 801F1DC + push {r4,lr} + ldr r4, _0801F260 + ldr r0, [r4] + ldr r1, _0801F264 + adds r0, r1 + ldr r1, _0801F268 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F26C + adds r0, r1 + ldr r1, _0801F270 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F274 + adds r0, r1 + ldr r1, _0801F278 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F27C + adds r0, r1 + ldr r1, _0801F280 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F284 + adds r0, r1 + ldr r1, _0801F288 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F28C + adds r0, r1 + ldr r1, _0801F290 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F294 + adds r0, r1 + ldr r1, _0801F298 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F29C + adds r0, r1 + ldr r1, _0801F2A0 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F2A4 + adds r0, r1 + ldr r1, _0801F2A8 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _0801F2AC + adds r0, r1 + ldr r1, _0801F2B0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801F260: .4byte 0x03005d8c +_0801F264: .4byte 0x00003c88 +_0801F268: .4byte 0x085ed40f +_0801F26C: .4byte 0x00003c9d +_0801F270: .4byte 0x085ed415 +_0801F274: .4byte 0x00003cb2 +_0801F278: .4byte 0x085ed41d +_0801F27C: .4byte 0x00003cc7 +_0801F280: .4byte 0x085ed423 +_0801F284: .4byte 0x00003cdc +_0801F288: .4byte 0x085ed42a +_0801F28C: .4byte 0x00003cf1 +_0801F290: .4byte 0x085ed430 +_0801F294: .4byte 0x00003d06 +_0801F298: .4byte 0x085ed434 +_0801F29C: .4byte 0x00003d1b +_0801F2A0: .4byte 0x085ed43a +_0801F2A4: .4byte 0x00003d30 +_0801F2A8: .4byte 0x085ed440 +_0801F2AC: .4byte 0x00003d45 +_0801F2B0: .4byte 0x085ed44a + 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, _0801F2D8 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bls _0801F2CE + b _0801F4C4 +_0801F2CE: + lsls r0, 2 + ldr r1, _0801F2DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801F2D8: .4byte 0x03005e08 +_0801F2DC: .4byte _0801F2E0 + .align 2, 0 +_0801F2E0: + .4byte _0801F300 + .4byte _0801F30E + .4byte _0801F4A8 + .4byte _0801F35C + .4byte _0801F448 + .4byte _0801F480 + .4byte _0801F494 + .4byte _0801F438 +_0801F300: + ldr r0, _0801F334 + 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, _0801F338 + 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 + .align 2, 0 +_0801F334: .4byte 0x03003124 +_0801F338: .4byte 0x02022c84 +_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, _0801F3C8 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x4 + bhi _0801F3E4 + lsls r0, 2 + ldr r1, _0801F3CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801F3C8: .4byte 0x020223c4 +_0801F3CC: .4byte _0801F3D0 + .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, _0801F424 + ldr r0, [r5] + adds r0, 0x39 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r1, 8 + ldr r2, _0801F428 + 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 + .align 2, 0 +_0801F424: .4byte 0x02022c84 +_0801F428: .4byte 0x020223c4 +_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, _0801F470 + 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 + .align 2, 0 +_0801F470: .4byte 0x02022c84 +_0801F474: + movs r5, 0x4 + ldrsh r0, [r4, r5] + bl sub_8011DE0 +_0801F47C: + movs r0, 0x3 + b _0801F4C2 +_0801F480: + ldr r0, _0801F490 + ldr r1, [r0] + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _0801F49C + movs r0, 0x2 + b _0801F49A + .align 2, 0 +_0801F490: .4byte 0x02022c84 +_0801F494: + ldr r0, _0801F4A4 + ldr r1, [r0] + movs r0, 0x3 +_0801F49A: + strb r0, [r1, 0x17] +_0801F49C: + adds r0, r5, 0 + bl remove_task + b _0801F4C4 + .align 2, 0 +_0801F4A4: .4byte 0x02022c84 +_0801F4A8: + bl sub_8011A9C + cmp r0, 0 + bne _0801F4C4 + ldr r0, _0801F4CC + 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 + .align 2, 0 +_0801F4CC: .4byte 0x02022c84 + thumb_func_end sub_801F2B4 + + thumb_func_start sub_801F4D0 +sub_801F4D0: @ 801F4D0 + push {r4,lr} + ldr r4, _0801F51C + ldr r0, _0801F520 + bl malloc + str r0, [r4] + cmp r0, 0 + beq _0801F52C + bl sub_8020890 + cmp r0, 0 + beq _0801F52C + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0801F524 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _0801F528 + bl Window_InitFromTemplates + 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 + .align 2, 0 +_0801F51C: .4byte 0x02022c88 +_0801F520: .4byte 0x00002168 +_0801F524: .4byte 0x082f2c60 +_0801F528: .4byte 0x082f2c70 +_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, _0801F56C + ldr r0, [r4] + cmp r0, 0 + beq _0801F55A + bl free + movs r0, 0 + str r0, [r4] +_0801F55A: + bl Window_FreeMemory + ldr r1, _0801F570 + movs r0, 0x3 + strb r0, [r1, 0x15] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801F56C: .4byte 0x02022c88 +_0801F570: .4byte 0x02039b28 + 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, _0801F5B0 + ldr r0, [r1] + cmp r0, 0 + beq _0801F5A8 + movs r2, 0 + adds r4, r1, 0 + ldr r5, _0801F5B4 + 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 + .align 2, 0 +_0801F5B0: .4byte 0x02022c88 +_0801F5B4: .4byte sub_801FDD8 + 1 + thumb_func_end sub_801F580 + + thumb_func_start sub_801F5B8 +sub_801F5B8: @ 801F5B8 + push {r4-r6,lr} + ldr r1, _0801F5E8 + 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 + .align 2, 0 +_0801F5E8: .4byte 0x02022c88 + 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, _0801F628 + ldr r0, [r3] + lsrs r1, 21 + adds r0, r1 + ldr r2, _0801F62C + str r2, [r0] + movs r4, 0 + adds r5, r3, 0 + adds r3, r1, 0 + mov r12, r4 + ldr r1, _0801F630 + 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 + .align 2, 0 +_0801F628: .4byte 0x02022c88 +_0801F62C: .4byte sub_801FDD8 + 1 +_0801F630: .4byte 0x082f2c98 +_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, _0801F654 + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + ldrb r0, [r1, 0x4] + bx lr + .align 2, 0 +_0801F654: .4byte 0x02022c88 + 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, _0801F678 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801F678: .4byte _0801F67C + .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 is_dma3_queue_busy_with_gpu_copy + 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 Window_CopyToVram + b _0801F720 +_0801F716: + bl is_dma3_queue_busy_with_gpu_copy + 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 Window_CopyToVram + b _0801F758 +_0801F74E: + bl is_dma3_queue_busy_with_gpu_copy + 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 Window_CopyToVram + b _0801F7C4 +_0801F79E: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801F810 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + b _0801F81E + .align 2, 0 +_0801F810: .4byte 0x02022c88 +_0801F814: + bl is_dma3_queue_busy_with_gpu_copy + 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 gpu_copy_wram_bg_tilemap_to_vram + b _0801F862 +_0801F84C: + bl is_dma3_queue_busy_with_gpu_copy + 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 Window_CopyToVram + b _0801F8CC +_0801F8BA: + bl is_dma3_queue_busy_with_gpu_copy + 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 sub_80091CC + 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 Window_CopyToVram + b _0801F972 +_0801F938: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0801F978 + movs r0, 0x1 + movs r1, 0x10 + bl sub_801FF18 + ldr r0, _0801F958 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + b _0801F972 + .align 2, 0 +_0801F958: .4byte 0x02022c88 +_0801F95C: + bl is_dma3_queue_busy_with_gpu_copy + 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 sub_80091CC + 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 Window_CopyToVram + b _0801FA1A +_0801F9E0: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0801FA20 + bl sub_8020094 + ldr r0, _0801F9FC + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + b _0801FA1A + .align 2, 0 +_0801F9FC: .4byte 0x02022c88 +_0801FA00: + bl is_dma3_queue_busy_with_gpu_copy + 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 Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FA5E +_0801FA50: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FA7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801FA7C: .4byte _0801FA80 + .align 2, 0 +_0801FA80: + .4byte _0801FA94 + .4byte _0801FAC0 + .4byte _0801FAF0 + .4byte _0801FB14 + .4byte _0801FADE +_0801FA94: + ldr r0, _0801FABC + 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 Window_CopyToVram + b _0801FB34 + .align 2, 0 +_0801FABC: .4byte 0x02022c88 +_0801FAC0: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0801FB3A + ldr r0, _0801FAE4 + 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 + .align 2, 0 +_0801FAE4: .4byte 0x02022c88 +_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 Window_ScrollVertically + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, _0801FB30 + 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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0801FB3A + ldr r0, _0801FB30 + ldr r0, [r0] + ldrh r0, [r0, 0x1C] + cmp r0, 0x2 + bhi _0801FB34 + ldrb r0, [r6] + subs r0, 0x1 + b _0801FB38 + .align 2, 0 +_0801FB30: .4byte 0x02022c88 +_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, _0801FB9C + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FBAA + .align 2, 0 +_0801FB9C: .4byte 0x02022c88 +_0801FBA0: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FBE0 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FBEE + .align 2, 0 +_0801FBE0: .4byte 0x02022c88 +_0801FBE4: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FC34 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FC42 + .align 2, 0 +_0801FC34: .4byte 0x02022c88 +_0801FC38: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FC84 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FC92 + .align 2, 0 +_0801FC84: .4byte 0x02022c88 +_0801FC88: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FCD4 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FCE2 + .align 2, 0 +_0801FCD4: .4byte 0x02022c88 +_0801FCD8: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FD18 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FD26 + .align 2, 0 +_0801FD18: .4byte 0x02022c88 +_0801FD1C: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FD6C + ldr r1, [r0] + movs r0, 0 + bl sub_81AFC0C + movs r0, 0x9 + movs r1, 0 + bl sub_801FF18 + ldr r0, _0801FD70 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FD7E + .align 2, 0 +_0801FD6C: .4byte 0x03005d90 +_0801FD70: .4byte 0x02022c88 +_0801FD74: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FDC0 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FDCE + .align 2, 0 +_0801FDC0: .4byte 0x02022c88 +_0801FDC4: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0801FE9C + ldr r2, [sp, 0xC] + ands r2, r4 + lsrs r0, 16 + ldr r3, _0801FEA0 + ands r2, r3 + orrs r2, r0 + lsrs r1, 8 + ldr r0, _0801FEA4 + ands r2, r0 + orrs r2, r1 + ldr r0, _0801FEA8 + 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, _0801FEAC + ands r0, r1 + movs r1, 0xA4 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x10] + add r0, sp, 0xC + bl Window_AddFromTemplate + adds r1, r0, 0 + ldr r5, _0801FEB0 + 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 Window_FastFillPixels + ldr r0, [r5] + ldrb r0, [r0, 0x18] + bl Window_WriteStandardTileMap + ldr r0, [r5] + ldrb r0, [r0, 0x18] + ldr r2, _0801FEB4 + 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, _0801FEB8 + 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 + .align 2, 0 +_0801FE9C: .4byte 0xffffff00 +_0801FEA0: .4byte 0xffff00ff +_0801FEA4: .4byte 0xff00ffff +_0801FEA8: .4byte 0x00ffffff +_0801FEAC: .4byte 0x0000ffff +_0801FEB0: .4byte 0x02022c88 +_0801FEB4: .4byte 0x085eae62 +_0801FEB8: .4byte 0x085eae66 + thumb_func_end sub_801FDDC + + thumb_func_start sub_801FEBC +sub_801FEBC: @ 801FEBC + push {r4,lr} + ldr r4, _0801FEE0 + 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 Window_FillTileMap +_0801FEDA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801FEE0: .4byte 0x02022c88 + thumb_func_end sub_801FEBC + + thumb_func_start sub_801FEE4 +sub_801FEE4: @ 801FEE4 + push {r4,lr} + ldr r4, _0801FF04 + ldr r0, [r4] + ldrh r0, [r0, 0x18] + cmp r0, 0xFF + beq _0801FEFE + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + ldr r1, [r4] + movs r0, 0xFF + strh r0, [r1, 0x18] +_0801FEFE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801FF04: .4byte 0x02022c88 + 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, _0801FFC4 + ldr r3, [sp, 0x14] + ands r3, r1 + ldr r2, _0801FFC8 + ands r3, r2 + movs r0, 0x80 + lsls r0, 4 + orrs r3, r0 + ldr r0, _0801FFCC + ands r3, r0 + movs r0, 0x80 + lsls r0, 13 + orrs r3, r0 + ldr r5, _0801FFD0 + 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, _0801FFD4 + ands r0, r1 + movs r1, 0xD4 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x18] + ldr r1, _0801FFD8 + 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 Window_AddFromTemplate + ldr r5, _0801FFDC + 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 + .align 2, 0 +_0801FFC4: .4byte 0xffffff00 +_0801FFC8: .4byte 0xffff00ff +_0801FFCC: .4byte 0xff00ffff +_0801FFD0: .4byte 0x00ffffff +_0801FFD4: .4byte 0x0000ffff +_0801FFD8: .4byte 0x082f2d40 +_0801FFDC: .4byte 0x02022c88 +_0801FFE0: + ldr r6, [r4] +_0801FFE2: + mov r0, r9 + lsls r1, r0, 8 + movs r0, 0 + movs r2, 0 + bl bg_change_y_offset + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_WriteStandardTileMap + ldr r1, _0802004C + 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 + .align 2, 0 +_0802004C: .4byte 0x082f2d40 +_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, _08020090 + 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 + .align 2, 0 +_08020090: .4byte 0x02022c88 + thumb_func_end sub_801FF18 + + thumb_func_start sub_8020094 +sub_8020094: @ 8020094 + push {r4,lr} + ldr r4, _080200C4 + 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 Window_FillTileMap +_080200B2: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080200C4: .4byte 0x02022c88 + thumb_func_end sub_8020094 + + thumb_func_start sub_80200C8 +sub_80200C8: @ 80200C8 + push {r4,lr} + ldr r4, _080200E8 + ldr r0, [r4] + ldrh r0, [r0, 0x1E] + cmp r0, 0xFF + beq _080200E2 + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + ldr r1, [r4] + movs r0, 0xFF + strh r0, [r1, 0x1E] +_080200E2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080200E8: .4byte 0x02022c88 + 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 Window_FillPixelRect + 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 gf_strcpy + 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 Window_FastFillPixels + 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, _0802023C + 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 gf_strcpy + 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 + .align 2, 0 +_0802023C: .4byte 0x082f2ba8 +_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 font_get_width_of_string + 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 sub_80091CC + 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 sub_800918C + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl font_get_width_of_string + 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, _0802031C + 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 + .align 2, 0 +_0802031C: .4byte 0x082f2dc4 + thumb_func_end sub_80201A4 + + thumb_func_start sub_8020320 +sub_8020320: @ 8020320 + push {r4,lr} + ldr r1, _08020344 + 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 + .align 2, 0 +_08020344: .4byte 0x02022c88 +_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, _0802038C + 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 + .align 2, 0 +_0802038C: .4byte 0x02022c88 +_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 Window_FastFillPixels + 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, _08020408 + 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 Window_WriteStandardTileMap + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08020408: .4byte 0x082f2dc8 + 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 Window_FillTileMap + 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 Window_FillPixelRect + 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 bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set_bits + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r1, 0xE0 + lsls r1, 8 + movs r0, 0 + bl lcd_io_clear_bits + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldr r1, _08020534 + movs r0, 0x40 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0x90 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3D + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x3F + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08020534: .4byte 0x000040f0 + thumb_func_end sub_8020480 + + thumb_func_start sub_8020538 +sub_8020538: @ 8020538 + push {r4,lr} + ldr r4, _08020574 + ldr r1, [r4] + movs r0, 0x94 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _08020578 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _0802057C + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _08020580 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08020574: .4byte 0x02022c88 +_08020578: .4byte 0x00000928 +_0802057C: .4byte 0x00001128 +_08020580: .4byte 0x00001928 + 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 dma3_transfer_queue_add_fill + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _080205F4 + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080205F8 + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080205FC + 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, _08020600 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080205F4: .4byte 0x08dd4bd0 +_080205F8: .4byte 0x08dd4bb0 +_080205FC: .4byte 0x08dd4bf0 +_08020600: .4byte 0x08dd4c4c + 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, _08020668 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0802066C + 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, _08020670 + ldr r1, [r4] + ldr r2, _08020674 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + movs r1, 0x84 + lsls r1, 3 + adds r0, r5, r1 + ldr r1, [r4] + ldr r2, _08020678 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet +_0802064E: + ldr r1, _0802067C + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08020668: .4byte 0x08dd4860 +_0802066C: .4byte 0x08dd4880 +_08020670: .4byte 0x02022c88 +_08020674: .4byte 0x00002128 +_08020678: .4byte 0x00002148 +_0802067C: .4byte 0x08dd4ab8 + thumb_func_end task_tutorial_story_unknown + + thumb_func_start sub_8020680 +sub_8020680: @ 8020680 + push {lr} + ldr r0, _0802069C + movs r1, 0x80 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080206A0 + movs r0, 0 + movs r2, 0x20 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + pop {r0} + bx r0 + .align 2, 0 +_0802069C: .4byte 0x082f2c20 +_080206A0: .4byte 0x06004020 + thumb_func_end sub_8020680 + + thumb_func_start sub_80206A4 +sub_80206A4: @ 80206A4 + push {lr} + ldr r0, _080206CC + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + pop {r0} + bx r0 + .align 2, 0 +_080206CC: .4byte 0x082f2c40 + thumb_func_end sub_80206A4 + + thumb_func_start sub_80206D0 +sub_80206D0: @ 80206D0 + push {lr} + movs r0, 0x2 + bl Window_WriteStandardTileMap + bl sub_80201A4 + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + 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, _08020738 + ldr r1, [r0] + ldr r0, _0802073C + 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 Window_CopyWholePixelBlockToWindow + adds r4, 0x1 + cmp r4, 0xE + ble _080206F8 + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08020738: .4byte 0x02022c88 +_0802073C: .4byte 0x00002128 + thumb_func_end sub_80206E8 + + thumb_func_start sub_8020740 +sub_8020740: @ 8020740 + push {lr} + movs r0, 0x3 + movs r1, 0x11 + bl Window_FastFillPixels + 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, _0802076C + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0802076C: .4byte 0x0860f074 + thumb_func_end sub_8020740 + + thumb_func_start sub_8020770 +sub_8020770: @ 8020770 + push {lr} + sub sp, 0x10 + ldr r0, _080207AC + str r0, [sp, 0x4] + ldr r0, _080207B0 + 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, _080207B4 + ldr r0, [r0] + strh r1, [r0, 0x20] + str r1, [sp, 0xC] + add r0, sp, 0xC + ldr r1, _080207B8 + ldr r2, _080207BC + bl CpuFastSet + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_080207AC: .4byte 0xa2600001 +_080207B0: .4byte 0x04000014 +_080207B4: .4byte 0x02022c88 +_080207B8: .4byte 0x02038c28 +_080207BC: .4byte 0x010003c0 + 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, _08020808 + ldrb r0, [r5, 0x14] + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 7 + ldr r4, _0802080C + adds r1, r4 + ldr r2, _08020810 + 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, _08020814 + bl CpuSet + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08020808: .4byte 0x02039b28 +_0802080C: .4byte 0x02038c28 +_08020810: .4byte 0x01000090 +_08020814: .4byte 0x01000010 + 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, _08020884 + ldr r0, _08020888 + 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, _0802088C + 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 + .align 2, 0 +_08020884: .4byte 0x02038c28 +_08020888: .4byte 0x01000090 +_0802088C: .4byte 0x01000010 + thumb_func_end sub_8020818 + + thumb_func_start sub_8020890 +sub_8020890: @ 8020890 + push {r4,r5,lr} + movs r5, 0 + ldr r4, _080208BC +_08020896: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x4 + bls _08020896 + ldr r0, _080208C0 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r4, _080208C4 + movs r0, 0x18 + bl malloc + str r0, [r4] + cmp r0, 0 + beq _080208C8 + movs r0, 0x1 + b _080208CA + .align 2, 0 +_080208BC: .4byte 0x082f3134 +_080208C0: .4byte 0x082f315c +_080208C4: .4byte 0x02022c8c +_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, _080208E4 + ldr r0, [r0] + cmp r0, 0 + beq _080208DE + bl free +_080208DE: + pop {r0} + bx r0 + .align 2, 0 +_080208E4: .4byte 0x02022c8c + thumb_func_end sub_80208D0 + + thumb_func_start sub_80208E8 +sub_80208E8: @ 80208E8 + push {lr} + ldr r0, _08020910 + movs r1, 0xA + movs r2, 0x18 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08020914 + ldr r2, [r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08020918 + adds r1, r0 + str r1, [r2] + pop {r0} + bx r0 + .align 2, 0 +_08020910: .4byte 0x082f319c +_08020914: .4byte 0x02022c8c +_08020918: .4byte 0x02020630 + thumb_func_end sub_80208E8 + + thumb_func_start sub_802091C +sub_802091C: @ 802091C + ldr r1, _08020938 + 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 + .align 2, 0 +_08020938: .4byte 0x02022c8c + 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, _08020978 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start + 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 + .align 2, 0 +_08020978: .4byte 0x02022c8c +_0802097C: + ldr r4, _080209A8 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start + 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 + .align 2, 0 +_080209A8: .4byte 0x02022c8c + 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, _080209D8 + adds r4, r0 + movs r0, 0 + bl gpu_pal_tags_index_of + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + ldr r0, _080209DC + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x4 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080209D8: .4byte 0x082f2df2 +_080209DC: .4byte 0x01010000 + 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, _080209FC + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + b _08020A0C + .align 2, 0 +_080209FC: .4byte 0x02022c8c +_08020A00: + ldr r0, _08020A18 + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0x3 + bl obj_anim_image_start +_08020A0C: + ldr r0, _08020A18 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x14] + pop {r0} + bx r0 + .align 2, 0 +_08020A18: .4byte 0x02022c8c + thumb_func_end sub_80209E0 + + thumb_func_start sub_8020A1C +sub_8020A1C: @ 8020A1C + push {r4,lr} + ldr r4, _08020A2C + ldr r1, [r4] + ldrh r0, [r1, 0x14] + cmp r0, 0x3 + bls _08020A30 +_08020A28: + movs r0, 0 + b _08020A62 + .align 2, 0 +_08020A2C: .4byte 0x02022c8c +_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 obj_anim_image_start + b _08020A28 +_08020A54: + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start + 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, _08020AAC + movs r1, 0x4C + movs r2, 0x98 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08020AB0 + ldr r2, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, _08020AB4 + adds r1, r4 + str r1, [r2, 0x8] + ldr r0, _08020AB8 + movs r1, 0x40 + movs r2, 0x98 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 + .align 2, 0 +_08020AAC: .4byte 0x082f31bc +_08020AB0: .4byte 0x02022c8c +_08020AB4: .4byte 0x02020630 +_08020AB8: .4byte 0x082f31d4 + 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, _08020B70 + movs r1, 0x8 + movs r2, 0x98 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08020B74 + ldr r2, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, _08020B78 + adds r1, r4 + str r1, [r2, 0xC] + ldr r0, _08020B7C + movs r1, 0x20 + movs r2, 0x98 + movs r3, 0x4 + bl obj_add_from_template_forward_search + 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 + .align 2, 0 +_08020B70: .4byte 0x082f322c +_08020B74: .4byte 0x02022c8c +_08020B78: .4byte 0x02020630 +_08020B7C: .4byte 0x082f3244 + 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, _08020BB4 + 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 obj_anim_image_start + b _08020BF6 + .align 2, 0 +_08020BB4: .4byte 0x02022c8c +_08020BB8: + bl sub_801F1A4 + adds r4, r0, 0 + cmp r4, 0x3 + bne _08020BD8 +_08020BC2: + ldr r0, _08020BD4 + ldr r0, [r0] + ldr r1, [r0, 0x10] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _08020BF6 + .align 2, 0 +_08020BD4: .4byte 0x02022c8c +_08020BD8: + ldr r3, _08020BFC + 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 obj_anim_image_start +_08020BF6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08020BFC: .4byte 0x02022c8c + thumb_func_end sub_8020B80 + + thumb_func_start sub_8020C00 +sub_8020C00: @ 8020C00 + ldr r0, _08020C08 + ldr r0, [r0] + bx lr + .align 2, 0 +_08020C08: .4byte 0x02022c90 + thumb_func_end sub_8020C00 + + thumb_func_start sub_8020C0C +sub_8020C0C: @ 8020C0C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08020C1C + ldr r0, [r5] + cmp r0, 0 + bne _08020C20 + movs r0, 0x2 + b _08020C5C + .align 2, 0 +_08020C1C: .4byte 0x02022c90 +_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 set_callback2 + ldr r0, _08020C64 + cmp r4, r0 + bne _08020C5A + ldr r2, _08020C68 + 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, _08020C6C + bl set_callback1 +_08020C5A: + movs r0, 0 +_08020C5C: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08020C64: .4byte c2_exit_to_overworld_2_switch + 1 +_08020C68: .4byte 0x03003014 +_08020C6C: .4byte c1_overworld + 1 + 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, _08020CA0 + ldrb r0, [r0] + cmp r0, 0 + beq _08020C8E + ldr r0, _08020CA4 + ldrb r0, [r0] + cmp r0, 0 + bne _08020CAC +_08020C8E: + adds r0, r4, 0 + bl set_callback2 + ldr r0, _08020CA8 + mov r1, r8 + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + b _08020CF8 + .align 2, 0 +_08020CA0: .4byte 0x03003124 +_08020CA4: .4byte 0x030030fc +_08020CA8: .4byte 0x03005000 +_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 set_callback2 + ldr r0, _08020CD8 + movs r1, 0 + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + b _08020CF8 + .align 2, 0 +_08020CD8: .4byte 0x03005000 +_08020CDC: + ldr r6, _08020D04 + ldr r0, _08020D08 + bl malloc_and_clear + adds r5, r0, 0 + str r5, [r6] + cmp r5, 0 + bne _08020D10 + adds r0, r4, 0 + bl set_callback2 + ldr r0, _08020D0C + strh r5, [r0, 0x10] + strh r5, [r0, 0x12] +_08020CF8: + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] + b _08020D74 + .align 2, 0 +_08020D04: .4byte 0x02022c90 +_08020D08: .4byte 0x000041c0 +_08020D0C: .4byte 0x03005000 +_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, _08020D80 + bl set_callback2 + ldr r0, _08020D84 + movs r1, 0x8 + bl AddTask + ldr r1, [r6] + strb r0, [r1, 0xA] + ldr r2, _08020D88 + 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 + .align 2, 0 +_08020D80: .4byte sub_8020F88 + 1 +_08020D84: .4byte sub_8020FA0 + 1 +_08020D88: .4byte 0x03003014 + thumb_func_end sub_8020C70 + + thumb_func_start sub_8020D8C +sub_8020D8C: @ 8020D8C + push {r4,lr} + sub sp, 0xC + ldr r1, _08020DA4 + 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 + .align 2, 0 +_08020DA4: .4byte 0x0203ce7c +_08020DA8: + ldrh r0, [r1] + movs r1, 0x1 + bl sub_80D6AA4 +_08020DB0: + ldr r4, _08020E0C + ldr r2, [r4] + ldrb r0, [r2, 0x8] + lsls r0, 5 + adds r0, r2, r0 + ldr r1, _08020E10 + 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, _08020E14 + movs r1, 0x8 + bl AddTask + ldr r1, [r4] + strb r0, [r1, 0xA] + ldr r0, _08020E18 + bl set_callback2 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08020E0C: .4byte 0x02022c90 +_08020E10: .4byte 0x0203ce7c +_08020E14: .4byte sub_8020FA0 + 1 +_08020E18: .4byte sub_8020F88 + 1 + thumb_func_end sub_8020D8C + + thumb_func_start sub_8020E1C +sub_8020E1C: @ 8020E1C + push {lr} + ldr r0, _08020E34 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl remove_task + ldr r0, _08020E38 + bl sub_81AABF0 + pop {r0} + bx r0 + .align 2, 0 +_08020E34: .4byte 0x02022c90 +_08020E38: .4byte sub_8020D8C + 1 + thumb_func_end sub_8020E1C + + thumb_func_start sub_8020E3C +sub_8020E3C: @ 8020E3C + push {lr} + ldr r0, _08020E48 + bl SetVBlankCallback + pop {r0} + bx r0 + .align 2, 0 +_08020E48: .4byte sub_8020F74 + 1 + 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, _08020E9C + 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, _08020EA0 + 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 + .align 2, 0 +_08020E9C: .4byte 0x02022c90 +_08020EA0: .4byte 0x0000ffff +_08020EA4: + cmp r0, 0x4 + beq _08020EEC + cmp r0, 0x5 + beq _08020F20 + b _08020F48 +_08020EAE: + ldr r5, _08020ED8 + 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 + .align 2, 0 +_08020ED8: .4byte 0x03005d90 +_08020EDC: + ldr r5, _08020EE8 + ldr r0, [r5] + movs r6, 0xF7 + lsls r6, 1 + b _08020F28 + .align 2, 0 +_08020EE8: .4byte 0x03005d90 +_08020EEC: + ldr r5, _08020F1C + 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 + .align 2, 0 +_08020F1C: .4byte 0x03005d90 +_08020F20: + ldr r5, _08020F6C + 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, _08020F70 + 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 + .align 2, 0 +_08020F6C: .4byte 0x03005d90 +_08020F70: .4byte 0x02022c90 + thumb_func_end sub_8020E58 + + thumb_func_start sub_8020F74 +sub_8020F74: @ 8020F74 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl copy_super_sprites_to_oam + bl copy_queue_process + pop {r0} + bx r0 + thumb_func_end sub_8020F74 + + thumb_func_start sub_8020F88 +sub_8020F88: @ 8020F88 + push {lr} + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + pop {r0} + bx r0 + thumb_func_end sub_8020F88 + + thumb_func_start sub_8020FA0 +sub_8020FA0: @ 8020FA0 + push {r4,lr} + ldr r4, _08020FC0 + 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 + .align 2, 0 +_08020FC0: .4byte 0x02022c90 + 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, _0802102C + adds r1, r2 + bl gf_strcpy + 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, _08021030 + 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 + .align 2, 0 +_0802102C: .4byte 0x020229f0 +_08021030: .4byte 0x03005d90 +_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, _08021074 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08021074: .4byte _08021078 + .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 lcd_io_set + 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, _080210DC + bl CpuSet + ldr r0, _080210E0 + strb r4, [r0] + movs r0, 0x3 + bl sub_8034C54 + b _080212FC + .align 2, 0 +_080210DC: .4byte 0x01000200 +_080210E0: .4byte 0x0300301c +_080210E4: + bl sub_80A1A74 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + b _080212FC +_080210F2: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08021174 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0xE0 + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x1 + bl bg_set_tilemap + movs r0, 0x87 + lsls r0, 6 + adds r1, r5, r0 + movs r0, 0x2 + bl bg_set_tilemap + movs r0, 0xC7 + lsls r0, 6 + adds r1, r5, r0 + movs r0, 0x3 + bl bg_set_tilemap + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + b _080212FC + .align 2, 0 +_08021174: .4byte 0x082f32c8 +_08021178: + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + movs r0, 0x40 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + b _080212FC +_080211BE: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, _080211E8 + 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 + .align 2, 0 +_080211E8: .4byte 0x08de34b8 +_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, _08021218 + ldrb r1, [r0, 0x8] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x8] + b _080212FC + .align 2, 0 +_08021218: .4byte 0x02037fd4 +_0802121C: + ldr r0, _08021268 + movs r2, 0xC0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + ldr r1, _0802126C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _08021270 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _08021274 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + adds r0, r5, 0 + bl sub_80226D0 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080212FC + .align 2, 0 +_08021268: .4byte 0x08de3398 +_0802126C: .4byte 0x082f3c8c +_08021270: .4byte 0x082f3dbc +_08021274: .4byte 0x082f3f54 +_08021278: + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + adds r0, r5, 0 + bl sub_8022730 + ldr r0, _080212B0 + ldrh r1, [r0] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x16 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + b _080212FC + .align 2, 0 +_080212B0: .4byte 0x02021bbe +_080212B4: + ldr r2, _080212F8 + 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 gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set_bits + bl sub_8020E3C + movs r0, 0 + strb r0, [r5, 0xC] + movs r0, 0x1 + b _08021304 + .align 2, 0 +_080212F8: .4byte 0x02037fd4 +_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, _08021334 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08021334: .4byte _08021338 + .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 sub_80A1AD4 + 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 bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0802143E +_080213E6: + bl Window_FreeMemory + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl bg_unset_tilemap + movs r0, 0x3 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl bg_unset_tilemap + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_clear_bits + 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, _08021484 + 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 lcd_io_set + 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 + .align 2, 0 +_08021484: .4byte 0x02021bbe + thumb_func_end sub_8021450 + + thumb_func_start sub_8021488 +sub_8021488: @ 8021488 + movs r1, 0 + ldr r2, _0802149C + strh r2, [r0, 0x2A] + strh r1, [r0, 0x2C] + ldr r0, _080214A0 + strh r1, [r0] + ldr r0, _080214A4 + strh r2, [r0] + bx lr + .align 2, 0 +_0802149C: .4byte 0x0000ff98 +_080214A0: .4byte 0x02021bbc +_080214A4: .4byte 0x02021bbe + 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, _080215F4 + 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, _080215F8 + adds r1, r2, 0 + bl sub_81AFF34 + 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, _080215FC + 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, _08021600 + 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, _08021604 + 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 sub_8008258 +_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 + .align 2, 0 +_080215F4: .4byte 0x082f41e8 +_080215F8: .4byte 0x082f436c +_080215FC: .4byte 0x02020630 +_08021600: .4byte 0x0000fff0 +_08021604: .4byte 0xffff8000 + 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, _080216A0 + 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, _080216A0 + ands r0, r2 + cmp r1, r0 + blt _0802169A + ldr r0, _080216A4 + str r0, [r5, 0x1C] + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl obj_delete_and_free_tiles +_0802169A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080216A0: .4byte 0x00007fff +_080216A4: .4byte nullsub_12 + 1 + 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, _080216DC +_080216B6: + lsls r0, r5, 1 + adds r0, r7 + ldrh r4, [r0] + adds r0, r4, 0 + bl gpu_pal_free_tag + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + 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 + .align 2, 0 +_080216DC: .4byte 0x082f41e8 + 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, _08021744 +_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 obj_anim_image_start + b _0802175A + .align 2, 0 +_08021744: .4byte 0x082f41cc +_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 obj_anim_image_start +_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, _080217BC + 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 + .align 2, 0 +_080217BC: .4byte 0x082f41cd +_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, _08021854 + str r0, [r2, 0x1C] + lsls r1, r4, 1 + ldr r3, _08021858 + 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, _0802185C + 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 obj_anim_image_start + b _08021868 + .align 2, 0 +_08021854: .4byte sub_8022B28 + 1 +_08021858: .4byte 0x082f41d2 +_0802185C: .4byte 0x082f41d3 +_08021860: + ldr r0, [r7] + movs r1, 0 + bl obj_anim_image_start +_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, _080219C0 + 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, _080219C4 + adds r0, r7, 0 + bl __udivsi3 + strh r0, [r6, 0x8] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080219C0: .4byte 0x082f334c +_080219C4: .4byte 0x000f4240 + 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 font_get_width_of_string + lsls r4, 2 + lsrs r0, 1 + subs r4, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r5, 1 + adds r0, r5 + ldr r1, _08021A24 + 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 + .align 2, 0 +_08021A24: .4byte 0x082f32d8 + 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, _08021B40 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r0, _08021B44 + adds r0, r4, r0 + ldr r1, [r0] + ldr r0, _08021B40 + bl gf_strcat + 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 + .align 2, 0 +_08021B40: .4byte 0x02021fc4 +_08021B44: .4byte 0x082f43b4 +_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, _08021C04 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + 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, _08021C08 + 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, _08021C0C + bl __udivsi3 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _08021C10 + adds r1, r3, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _08021C14 + ldr r2, [sp, 0x28] + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, _08021C18 + bl ExpandTextCodes + b _08021C5E + .align 2, 0 +_08021C04: .4byte 0x02021cc4 +_08021C08: .4byte 0x082f334c +_08021C0C: .4byte 0x000f4240 +_08021C10: .4byte 0x02021dc4 +_08021C14: .4byte 0x082f43b4 +_08021C18: .4byte 0x02021fc4 +_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, _08021CA4 + adds r1, r0 + ldr r0, _08021CA8 + bl gf_strcpy + ldr r0, _08021CAC + ldr r1, [r0, 0x8] + ldr r0, _08021CB0 + bl ExpandTextCodes + 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, _08021CB0 + adds r2, r4, 0 + bl sub_81DB368 + 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, _08021CB4 + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r1, _08021CB0 + 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, _08021CB8 + ldr r1, _08021CBC + bl gf_strcpy + b _08021CC8 + .align 2, 0 +_08021CA4: .4byte 0x0858a670 +_08021CA8: .4byte 0x02021cc4 +_08021CAC: .4byte 0x082f43b4 +_08021CB0: .4byte 0x02021fc4 +_08021CB4: .4byte 0x082f32d8 +_08021CB8: .4byte 0x02021ec4 +_08021CBC: .4byte 0x085ed7d4 +_08021CC0: + ldr r0, _08021D24 + ldr r1, _08021D28 + bl gf_strcpy +_08021CC8: + ldr r4, _08021D24 + 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, _08021D2C + 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, _08021D30 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r2, _08021D2C + 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 + .align 2, 0 +_08021D24: .4byte 0x02021ec4 +_08021D28: .4byte 0x085ed7e0 +_08021D2C: .4byte 0x02021fc4 +_08021D30: .4byte 0x082f32d8 + 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 Window_GetField + 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, _08021F88 + str r4, [sp] + str r6, [sp, 0x4] + ldr r1, _08021F8C + str r1, [sp, 0x8] + movs r1, 0x2 + movs r2, 0 + adds r3, r7, 0 + bl box_print + ldr r4, _08021F90 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + movs r1, 0xB0 + subs r0, r1, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r2, r9 + ldrb r0, [r2] + ldr r1, _08021F88 + 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, _08021F94 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _08021F98 + movs r1, 0xA0 + lsls r1, 1 + add r1, r8 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r5, _08021F9C + ldr r1, _08021FA0 + adds r0, r5, 0 + bl ExpandTextCodes + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r4, r9 + ldrb r0, [r4] + ldr r1, _08021F88 + 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, _08021FA4 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r9 + ldrb r0, [r1] + ldr r2, _08021F88 + 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, _08021F94 + movs r2, 0x2 + movs r3, 0x1 + bl decimal_int_to_string + ldr r1, _08021FA8 + adds r0, r5, 0 + bl ExpandTextCodes + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r4, r9 + ldrb r0, [r4] + ldr r1, _08021F88 + 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, _08021F88 + str r4, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r1, _08021FAC + str r1, [sp, 0x8] + movs r1, 0x2 + movs r2, 0 + adds r3, r7, 0 + bl box_print + ldr r4, _08021FB0 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + 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, _08021F88 + 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, _08021FB4 +_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, _08021F94 + mov r2, r12 + lsrs r1, r2, 8 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _08021F98 + ldr r1, _08021FB8 + ldr r0, [sp, 0xC] + bl __udivsi3 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _08021F9C + ldr r1, _08021FBC + adds r0, r4, 0 + bl ExpandTextCodes + movs r2, 0x1 + negs r2, r2 + movs r0, 0x2 + adds r1, r4, 0 + bl font_get_width_of_string + 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, _08021FC0 + 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 + .align 2, 0 +_08021F88: .4byte 0x082f32d8 +_08021F8C: .4byte 0x085ed808 +_08021F90: .4byte 0x085ed840 +_08021F94: .4byte 0x02021cc4 +_08021F98: .4byte 0x02021dc4 +_08021F9C: .4byte 0x02021fc4 +_08021FA0: .4byte 0x085ed838 +_08021FA4: .4byte 0x085ed830 +_08021FA8: .4byte 0x085ed82c +_08021FAC: .4byte 0x085ed810 +_08021FB0: .4byte 0x085ed850 +_08021FB4: .4byte 0x082f334c +_08021FB8: .4byte 0x000f4240 +_08021FBC: .4byte 0x085ed848 +_08021FC0: .4byte 0x082f32e7 +_08021FC4: + movs r0, 0xDD + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + ldr r1, _0802205C + 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, _0802205C + mov r9, r2 + str r2, [sp] + movs r5, 0 + str r5, [sp, 0x4] + ldr r1, _08022060 + str r1, [sp, 0x8] + movs r1, 0x2 + movs r2, 0 + adds r3, r7, 0 + bl box_print + ldr r0, _08022064 + ldr r4, [sp, 0x10] + ldrh r1, [r4, 0x8] + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _08022068 + ldr r1, _0802206C + adds r0, r4, 0 + bl ExpandTextCodes + movs r2, 0x1 + negs r2, r2 + movs r0, 0x2 + adds r1, r4, 0 + bl font_get_width_of_string + 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 + .align 2, 0 +_0802205C: .4byte 0x082f32d8 +_08022060: .4byte 0x085ed820 +_08022064: .4byte 0x02021cc4 +_08022068: .4byte 0x02021fc4 +_0802206C: .4byte 0x085ed85c + 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, _08022090 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022090: .4byte _08022094 + .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, _080220D4 + 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, _080220D8 + adds r0, 0x4 + b _080220DE + .align 2, 0 +_080220D4: .4byte 0x082f32cc +_080220D8: .4byte 0x082f3344 +_080220DC: + ldr r0, _080220F4 +_080220DE: + adds r0, r5, r0 + ldrb r1, [r0] + mov r0, sp + strb r1, [r0, 0x4] + mov r0, sp + bl Window_AddFromTemplate + adds r1, r6, 0 + adds r1, 0x82 + strb r0, [r1] + b _08022218 + .align 2, 0 +_080220F4: .4byte 0x082f3344 +_080220F8: + adds r4, r6, 0 + adds r4, 0x82 + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + b _08022218 +_0802210C: + adds r5, r6, 0 + adds r5, 0x82 + ldrb r0, [r5] + ldr r4, _0802212C + 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 + .align 2, 0 +_0802212C: .4byte 0x0000021d +_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, _0802217C + movs r1, 0x14 + movs r2, 0x3 + bl sub_80219C8 + ldr r0, _08022180 + 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 + .align 2, 0 +_0802217C: .4byte 0x085ed860 +_08022180: .4byte 0x082f3344 +_08022184: + adds r0, r6, 0 + adds r0, 0x82 + ldrb r0, [r0] + ldr r2, _080221C0 + 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, _080221C4 + 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 + .align 2, 0 +_080221C0: .4byte 0x082f43b4 +_080221C4: .4byte 0x082f3344 +_080221C8: + adds r0, r6, 0 + adds r0, 0x82 + ldrb r0, [r0] + ldr r3, _080221F0 + movs r1, 0x16 + movs r2, 0x3 + bl sub_80219C8 + ldr r0, _080221F4 + 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 + .align 2, 0 +_080221F0: .4byte 0x085ed878 +_080221F4: .4byte 0x082f3344 +_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 Window_CopyToVram + 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 Window_Remove + 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, _08022284 + 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 + .align 2, 0 +_08022284: .4byte 0x03005e08 +_08022288: + cmp r0, 0x2 + bne _0802228E + b _08022480 +_0802228E: + cmp r0, 0x3 + bne _08022294 + b _08022494 +_08022294: + b _080224BA +_08022296: + ldr r0, _080222C8 + bl Window_AddFromTemplate + strh r0, [r6, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + ldrb r0, [r6, 0x2] + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r6, 0x2] + ldr r4, _080222CC + 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 + .align 2, 0 +_080222C8: .4byte 0x082f32ec +_080222CC: .4byte 0x0000021d +_080222D0: + ldr r0, _08022450 + mov r10, r0 + movs r1, 0x1 + negs r1, r1 + mov r8, r1 + movs r0, 0x1 + mov r1, r10 + mov r2, r8 + bl font_get_width_of_string + lsrs r0, 1 + movs r4, 0x60 + subs r0, r4, r0 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x2] + ldr r5, _08022454 + 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, _08022458 + mov r10, r0 + movs r0, 0x1 + mov r1, r10 + mov r2, r8 + bl font_get_width_of_string + 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, _0802245C + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r0, _08022460 + ldr r1, _08022464 + bl ExpandTextCodes + ldrb r0, [r6, 0x2] + ldr r1, _08022468 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, _08022460 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + mov r3, r10 + bl box_print + movs r0, 0x1 + ldr r1, _0802246C + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + movs r1, 0xC0 + subs r1, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldrb r0, [r6, 0x2] + ldr r1, _08022468 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, _0802246C + 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, _08022470 +_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, _0802245C + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, [sp, 0xC] + ldr r1, _08022474 + bl __udivsi3 + adds r1, r0, 0 + ldr r0, _08022478 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _08022460 + ldr r1, _0802247C + bl ExpandTextCodes + movs r0, 0x1 + ldr r1, _08022460 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + subs r0, r7, r0 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x2] + ldr r1, _08022468 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, _08022460 + 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 Window_CopyToVram + b _080224BA + .align 2, 0 +_08022450: .4byte 0x085ed8d0 +_08022454: .4byte 0x082f32e1 +_08022458: .4byte 0x085ed8dc +_0802245C: .4byte 0x02021cc4 +_08022460: .4byte 0x02021fc4 +_08022464: .4byte 0x085ed8f4 +_08022468: .4byte 0x082f32d8 +_0802246C: .4byte 0x085ed850 +_08022470: .4byte 0x082f334c +_08022474: .4byte 0x000f4240 +_08022478: .4byte 0x02021dc4 +_0802247C: .4byte 0x085ed848 +_08022480: + ldr r0, _08022490 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080224BA + b _080224C0 + .align 2, 0 +_08022490: .4byte 0x030022c0 +_08022494: + ldrb r0, [r6, 0x2] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r6, 0x2] + bl Window_FillTileMap + ldrb r0, [r6, 0x2] + bl Window_Remove + 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, _08022518 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0802251C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _08022520 + 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 + .align 2, 0 +_08022518: .4byte sub_8022250 + 1 +_0802251C: .4byte 0x03005e00 +_08022520: .4byte 0x03005d90 + 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, _080225F0 +_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, _080225F4 + adds r0, r1 + str r0, [r2] + ldrb r0, [r0] + lsls r0, 3 + ldr r1, _080225F8 + adds r0, r1 + bl Window_AddFromTemplate + ldr r1, _080225FC + adds r4, r5, r1 + adds r4, r6 + strb r0, [r4] + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + 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 + .align 2, 0 +_080225F0: .4byte 0x082f417c +_080225F4: .4byte 0x082f4190 +_080225F8: .4byte 0x082f32f4 +_080225FC: .4byte 0x000001bb + 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, _08022660 + adds r0, r6, r1 + adds r5, r0, r7 + ldrb r0, [r5] + bl Window_WriteStandardTileMap + 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 font_get_width_of_string + 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, _08022664 + str r1, [sp, 0x8] + mov r1, r8 + str r1, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0x2 + movs r3, 0x1 + bl sub_8199EEC + b _0802269C + .align 2, 0 +_08022660: .4byte 0x000001bb +_08022664: .4byte 0x082f32db +_08022668: + lsls r4, r7, 5 + adds r4, 0x98 + adds r4, r6, r4 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0 + bl font_get_width_of_string + 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, _080226C8 + str r1, [sp, 0x8] + mov r1, r8 + str r1, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0x2 + movs r3, 0x1 + bl sub_8199EEC +_0802269C: + ldr r1, _080226CC + adds r0, r6, r1 + adds r0, r7 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram + 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 gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080226C8: .4byte 0x082f32de +_080226CC: .4byte 0x000001bb + 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, _080226E4 + ldr r4, _080226E8 + adds r1, r4, 0 + bl LZ77UnCompWram + b _0802271A + .align 2, 0 +_080226E4: .4byte 0x08de3fd4 +_080226E8: .4byte 0x0201c000 +_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 gpu_copy_to_iwram_tile_map_rect + 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 gpu_copy_wram_bg_tilemap_to_vram + 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, _08022930 + strh r0, [r6, 0x2A] + strh r5, [r6, 0x2C] + ldr r1, _08022934 + strh r5, [r1] + ldr r1, _08022938 + strh r0, [r1] + ldr r4, _0802293C +_08022746: + lsls r0, r5, 3 + adds r0, r4 + bl gpu_tile_obj_decompress_and_load + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08022746 + ldr r0, _08022940 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _08022944 + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0x5 + bl obj_add_from_template_forward_search + 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, _08022948 + 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, _0802294C + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _08022948 + 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, _08022950 + 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, _08022954 + movs r3, 0x6 + bl obj_add_from_template_forward_search + 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, _08022948 + 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, _08022958 + movs r2, 0x8 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _08022948 + 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, _0802295C + 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 + .align 2, 0 +_08022930: .4byte 0x0000ff98 +_08022934: .4byte 0x02021bbc +_08022938: .4byte 0x02021bbe +_0802293C: .4byte 0x082f41f4 +_08022940: .4byte 0x082f421c +_08022944: .4byte 0x082f430c +_08022948: .4byte 0x02020630 +_0802294C: .4byte 0x082f4324 +_08022950: .4byte 0x082f41d2 +_08022954: .4byte 0x082f433c +_08022958: .4byte 0x082f4354 +_0802295C: .4byte 0x082f4384 + 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 gpu_tile_obj_free_by_tag + movs r0, 0x3 + bl gpu_tile_obj_free_by_tag + movs r0, 0x2 + bl gpu_tile_obj_free_by_tag + movs r0, 0x1 + bl gpu_tile_obj_free_by_tag + movs r0, 0x4 + bl gpu_pal_free_tag + movs r0, 0x2 + bl gpu_pal_free_tag + movs r0, 0x1 + bl gpu_pal_free_tag + movs r0, 0xD8 + lsls r0, 1 + adds r6, r5, r0 +_08022996: + lsls r0, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + bl obj_delete_and_free_tiles + 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 obj_delete_and_free_tiles + 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 obj_delete_and_free_tiles + 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 obj_delete_and_free_tiles +_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, _08022A90 + 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 + .align 2, 0 +_08022A90: .4byte nullsub_12 + 1 + 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, _08022B20 + 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, _08022B20 + ands r0, r2 + cmp r1, r0 + ble _08022B1A + ldr r0, _08022B24 + str r0, [r5, 0x1C] +_08022B1A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08022B20: .4byte 0x00007fff +_08022B24: .4byte sub_8022A4C + 1 + 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, _08022BE4 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r7, 0xE] + mov r0, r8 + strh r0, [r6, 0x26] + strh r0, [r6, 0x24] + ldr r0, _08022BE8 + 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 + .align 2, 0 +_08022BE4: .4byte 0xffff8000 +_08022BE8: .4byte sub_8022A94 + 1 + 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, _08022C3C + 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, _08022C3C + ldrb r1, [r6, 0xE] + lsls r1, 2 + b _08022C44 + .align 2, 0 +_08022C3C: .4byte 0x082f43cc +_08022C40: + ldr r0, _08022C54 + 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 + .align 2, 0 +_08022C54: .4byte 0x082f43cc + 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, _08022CAC + 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 sub_80A1AD4 + 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 + .align 2, 0 +_08022CAC: .4byte 0x02037fd4 + 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, _08022D88 + ldr r1, _08022D8C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandTextCodes + 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 text_box_related_one + b _08022DB2 + .align 2, 0 +_08022D88: .4byte 0x02021fc4 +_08022D8C: .4byte 0x082f32a4 +_08022D90: + ldr r1, _08022DBC + 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 text_box_related_one +_08022DB2: + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + b _08022E08 + .align 2, 0 +_08022DBC: .4byte 0x082f32a4 +_08022DC0: + movs r0, 0 + bl a_pressed_maybe + 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, _08022DE4 + ldrh r0, [r0, 0x2E] + ands r4, r0 + cmp r4, 0 + bne _08022E08 + b _08022E0E + .align 2, 0 +_08022DE4: .4byte 0x030022c0 +_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, _08022E98 + 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 + .align 2, 0 +_08022E98: .4byte 0x000001e5 +_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, _08022F18 + bl set_callback2 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08022F18: .4byte sub_8020E1C + 1 + 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, _08022F38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022F38: .4byte _08022F3C + .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, _08023038 + 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, _0802303C + movs r6, 0 + ldr r4, _08023040 +_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 + .align 2, 0 +_08023038: .4byte 0x082f4448 +_0802303C: .4byte 0x020223c4 +_08023040: .4byte 0x0858ab24 +_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, _08023088 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08023088: .4byte _0802308C + .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, _080230E4 + 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 + .align 2, 0 +_080230E4: .4byte 0x00000139 +_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, _0802311C + 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 + .align 2, 0 +_0802311C: .4byte sub_8021608 + 1 +_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, _0802314C + 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 + .align 2, 0 +_0802314C: .4byte sub_8021608 + 1 +_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, _08023214 + 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, _08023218 + 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 + .align 2, 0 +_08023214: .4byte 0x00000139 +_08023218: .4byte 0x082f326c +_0802321C: + ldr r7, _08023294 + movs r0, 0x9C + lsls r0, 1 + adds r6, r4, r0 + ldr r1, _08023298 + 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 lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl lcd_io_set + 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 + .align 2, 0 +_08023294: .4byte 0x082f326c +_08023298: .4byte 0x00000139 +_0802329C: + movs r0, 0 + strh r0, [r4, 0x2C] + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + 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, _08023374 + 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 + .align 2, 0 +_08023374: .4byte 0x00000139 +_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, _08023460 + mov r10, r3 +_080233C0: + lsls r0, r7, 4 + ldr r1, _08023464 + 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 + .align 2, 0 +_08023460: .4byte 0x082f325c +_08023464: .4byte 0x03003090 +_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, _08023530 + 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 + .align 2, 0 +_08023530: .4byte 0x082f3264 +_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, _080235D0 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080236A0 + movs r4, 0x9C + lsls r4, 1 + adds r1, r3, r4 + b _08023612 + .align 2, 0 +_080235D0: .4byte 0x0000013b +_080235D4: + ldr r5, _08023600 + adds r2, r3, r5 + ldrb r0, [r2] + cmp r0, 0 + beq _0802361A + ldr r0, _08023604 + adds r1, r3, r0 + ldrb r2, [r1] + cmp r6, r2 + beq _0802360C + subs r0, r6, 0x1 + strb r0, [r1] + ldr r1, _08023608 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x9D + lsls r4, 1 + adds r1, r3, r4 + strb r0, [r1] + b _08023640 + .align 2, 0 +_08023600: .4byte 0x0000013b +_08023604: .4byte 0x00000139 +_08023608: .4byte 0x082f3290 +_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, _08023670 + adds r1, r3, r4 + strb r0, [r1] + ldr r1, _08023674 + 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, _08023678 + 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, _08023670 + adds r1, r3, r5 + strb r0, [r1] + strb r0, [r2] + strb r0, [r4] + movs r1, 0 + b _08023690 + .align 2, 0 +_08023670: .4byte 0x00000139 +_08023674: .4byte 0x082f3290 +_08023678: .4byte 0x0000013b +_0802367C: + ldr r2, _08023698 + ldrb r1, [r1] + ldr r4, _0802369C + 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 + .align 2, 0 +_08023698: .4byte 0x082f3290 +_0802369C: .4byte 0x00000139 +_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, _0802374C + 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, _08023750 + 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 + .align 2, 0 +_0802374C: .4byte 0x030022c0 +_08023750: .4byte 0x082f4444 +_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, _08023794 + 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 + .align 2, 0 +_08023794: .4byte 0x082f4434 +_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, _08023858 + 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 + .align 2, 0 +_08023858: .4byte 0x00008c9f + 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, _080238A8 + 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 + .align 2, 0 +_080238A8: .4byte 0x03003090 +_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 lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl lcd_io_set + 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, _08023960 + 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 + .align 2, 0 +_08023960: .4byte 0x00008c9f +_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 lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl lcd_io_set + 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, _08023A08 + 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 + .align 2, 0 +_08023A08: .4byte 0x00008c9f +_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, _08023A48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08023A48: .4byte _08023A4C + .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, _08023A88 + movs r1, 0x8 + bl sub_80A2A20 + movs r0, 0x9C + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x2 + strb r0, [r1] + b _08023BB2 + .align 2, 0 +_08023A88: .4byte 0x000003ff +_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, _08023AD0 + movs r1, 0 + bl sub_80A2A20 + ldr r2, _08023AD4 + adds r1, r4, r2 + movs r0, 0x4 + strb r0, [r1] + movs r0, 0 + strb r0, [r5] + ldr r2, _08023AD8 + 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 + .align 2, 0 +_08023AD0: .4byte 0x000003ff +_08023AD4: .4byte 0x00000139 +_08023AD8: .4byte 0x082f326c +_08023ADC: + ldr r7, _08023B54 + movs r0, 0x9C + lsls r0, 1 + adds r6, r4, r0 + ldr r1, _08023B58 + 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 lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl lcd_io_set + 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 + .align 2, 0 +_08023B54: .4byte 0x082f326c +_08023B58: .4byte 0x00000139 +_08023B5C: + movs r0, 0 + strh r0, [r4, 0x2C] + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + 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 lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + b _08023C9C +_08023C5C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023CA2 + ldr r0, _08023C98 + ldr r1, [r5, 0x1C] + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + 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 + .align 2, 0 +_08023C98: .4byte 0x02021cc4 +_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, _08023CCC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08023CCC: .4byte _08023CD0 + .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, _08023D94 + 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, _08023D98 +_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 + .align 2, 0 +_08023D94: .4byte 0x082f4448 +_08023D98: .4byte 0x020223c4 +_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, _0802400C + adds r0, r4, 0 + movs r2, 0x30 + bl memcpy + bl sub_800A5B4 +_08024004: + movs r0, 0 + strh r0, [r7, 0x10] + b _0802402E + .align 2, 0 +_0802400C: .4byte 0x020223c4 +_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, _08024060 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08024060: .4byte _08024064 + .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 gpu_copy_wram_bg_tilemap_to_vram + 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, _080240C8 + 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 + .align 2, 0 +_080240C8: .4byte 0x030022c0 +_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, _0802411C + ldr r1, [r5, 0x1C] + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + ldr r4, _08024120 + bl sub_80247BC + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + 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 + .align 2, 0 +_0802411C: .4byte 0x02021cc4 +_08024120: .4byte 0x02021dc4 +_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, _0802414C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802414C: .4byte _08024150 + .align 2, 0 +_08024150: + .4byte _08024164 + .4byte _080241A0 + .4byte _080241A6 + .4byte _080241F0 + .4byte _08024204 +_08024164: + ldrh r1, [r5, 0x28] + ldr r0, _0802419C + 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 + .align 2, 0 +_0802419C: .4byte 0x00008c9f +_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, _080241E8 + 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 text_box_related_one + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _080241EC + movs r1, 0 + bl AddTask + b _08024218 + .align 2, 0 +_080241E8: .4byte 0x082c8959 +_080241EC: .4byte sub_8153688 + 1 +_080241F0: + ldr r0, _08024200 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08024218 + b _0802421E + .align 2, 0 +_08024200: .4byte sub_8153688 + 1 +_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, _08024388 + 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, _0802438C +_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 + .align 2, 0 +_08024388: .4byte 0x082f4448 +_0802438C: .4byte 0x020223c4 +_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 sub_80A1AD4 + 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, _0802448C + 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 text_box_related_one + b _080244AC + .align 2, 0 +_0802448C: .4byte 0x082f32a4 +_08024490: + ldr r0, _080244B8 + 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 text_box_related_one +_080244AC: + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + b _080244F6 + .align 2, 0 +_080244B8: .4byte 0x082f32a4 +_080244BC: + movs r0, 0 + bl a_pressed_maybe + 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, _08024554 + 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 + .align 2, 0 +_08024554: .4byte 0x03003124 +_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, _08024600 + 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, _08024600 + 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 + .align 2, 0 +_08024600: .4byte 0x0000ffff + 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, _08024678 + ldr r1, [r1] + adds r1, 0xAC + ldr r0, [r0] + ldr r1, [r1] + eors r0, r1 + bx lr + .align 2, 0 +_08024678: .4byte 0x03005d90 + thumb_func_end sub_8024668 + + thumb_func_start sub_802467C +sub_802467C: @ 802467C + ldr r2, _0802468C + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + eors r2, r1 + str r2, [r0] + bx lr + .align 2, 0 +_0802468C: .4byte 0x03005d90 + thumb_func_end sub_802467C + + thumb_func_start sub_8024690 +sub_8024690: @ 8024690 + push {lr} + adds r1, r0, 0 + ldr r0, _080246A8 + ldr r0, [r0] + movs r2, 0xFA + lsls r2, 1 + adds r0, r2 + bl apply_u32_xor_crypto + pop {r0} + bx r0 + .align 2, 0 +_080246A8: .4byte 0x03005d90 + thumb_func_end sub_8024690 + + thumb_func_start sub_80246AC +sub_80246AC: @ 80246AC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080246C8 + 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 + .align 2, 0 +_080246C8: .4byte 0x03005d90 +_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, _080246F0 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + bl sub_8024668 + ldr r1, _080246F4 + ldrh r1, [r1] + cmp r0, r1 + bcc _080246F8 + movs r0, 0x1 + b _080246FA + .align 2, 0 +_080246F0: .4byte 0x03005d90 +_080246F4: .4byte 0x020375e0 +_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, _08024728 + 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, _0802472C + cmp r1, r2 + bhi _08024730 + adds r0, r5, 0 + bl sub_802467C + movs r0, 0x1 + b _0802473A + .align 2, 0 +_08024728: .4byte 0x03005d90 +_0802472C: .4byte 0x0001869f +_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, _08024770 + 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 + .align 2, 0 +_08024770: .4byte 0x03005d90 +_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, _080247AC + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r4, r0, r1 + ldr r5, _080247B0 + 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 + .align 2, 0 +_080247AC: .4byte 0x03005d90 +_080247B0: .4byte 0x020375e0 +_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, _080247D0 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + bl sub_8024668 + pop {r1} + bx r1 + .align 2, 0 +_080247D0: .4byte 0x03005d90 + 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, _08024828 + mov r9, r0 + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string + 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 + .align 2, 0 +_08024828: .4byte 0x02021cc4 + 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, _08024888 + 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 + .align 2, 0 +_08024888: .4byte 0x085edcde + 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, _080248AC + 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 + .align 2, 0 +_080248AC: .4byte 0x02022c94 + 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, _08024910 + add r0, sp, 0x10 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + ldr r5, _08024914 + 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 + .align 2, 0 +_08024910: .4byte 0x02022c94 +_08024914: .4byte 0x0000021d + thumb_func_end sub_80248B0 + + thumb_func_start sub_8024918 +sub_8024918: @ 8024918 + push {r4,lr} + ldr r4, _08024938 + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08024938: .4byte 0x02022c94 + 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, _080249E4 + movs r0, 0 + str r0, [r1] + ldr r0, _080249E8 + ldrb r0, [r0] + cmp r0, 0 + beq _08024A10 + ldr r4, _080249EC + ldr r0, _080249F0 + bl malloc_and_clear + 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, _080249F4 + 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, _080249F8 + 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, _080249FC + adds r1, r2 + adds r0, r1 + movs r1, 0x64 + muls r1, r6 + ldr r2, _08024A00 + adds r1, r2 + bl sub_80261F8 + ldr r0, _08024A04 + movs r1, 0x1 + bl AddTask + ldr r0, _08024A08 + bl set_callback2 + 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, _08024A0C + bl current_map_music_set + b _08024A16 + .align 2, 0 +_080249E4: .4byte 0x03000db0 +_080249E8: .4byte 0x03003124 +_080249EC: .4byte 0x02022c98 +_080249F0: .4byte 0x00003330 +_080249F4: .4byte 0x000032cc +_080249F8: .4byte 0x000031a0 +_080249FC: .4byte 0x0000318c +_08024A00: .4byte 0x020244ec +_08024A04: .4byte sub_8024BC8 + 1 +_08024A08: .4byte sub_80261CC + 1 +_08024A0C: .4byte 0x0000021e +_08024A10: + adds r0, r5, 0 + bl set_callback2 +_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 reset_all_obj_data + bl gpu_pal_allocator_reset + 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, _08024BE8 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + cmp r0, 0x7 + bls _08024BDC + b _08024D34 +_08024BDC: + lsls r0, 2 + ldr r1, _08024BEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08024BE8: .4byte 0x02022c98 +_08024BEC: .4byte _08024BF0 + .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, _08024C20 + movs r1, 0x4 + bl sub_802620C + b _08024D20 + .align 2, 0 +_08024C20: .4byte sub_8025910 + 1 +_08024C24: + ldr r0, _08024C44 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08024C32 + b _08024D40 +_08024C32: + ldr r4, _08024C48 + ldr r0, [r4] + movs r1, 0xB0 + lsls r1, 1 + adds r0, r1 + bl sub_8029274 + ldr r1, [r4] + b _08024D24 + .align 2, 0 +_08024C44: .4byte sub_8025910 + 1 +_08024C48: .4byte 0x02022c98 +_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, _08024C7C + ldrb r0, [r0] + cmp r0, 0 + beq _08024D20 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08024D20 + .align 2, 0 +_08024C7C: .4byte 0x03003124 +_08024C80: + ldr r0, _08024CCC + ldr r0, [r0] + adds r0, 0x24 + ldrb r5, [r0] + bl sub_80283A8 + movs r4, 0 + cmp r4, r5 + bcs _08024CBA +_08024C92: + ldr r0, _08024CCC + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x34 + adds r0, r4 + ldrb r2, [r0] + lsls r0, r2, 2 + ldr r3, _08024CD0 + 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, _08024CCC + ldr r0, [r4] + adds r0, 0x24 + ldrb r1, [r0] + movs r0, 0 + bl sub_802868C + ldr r1, [r4] + b _08024D24 + .align 2, 0 +_08024CCC: .4byte 0x02022c98 +_08024CD0: .4byte 0x0000318c +_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 sub_80A1AD4 + ldr r0, _08024D0C + bl SetVBlankCallback + b _08024D20 + .align 2, 0 +_08024D0C: .4byte sub_80261E4 + 1 +_08024D10: + bl fade_and_return_progress_probably + ldr r0, _08024D2C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08024D40 +_08024D20: + ldr r0, _08024D30 + ldr r1, [r0] +_08024D24: + ldrb r0, [r1, 0xC] + adds r0, 0x1 + strb r0, [r1, 0xC] + b _08024D40 + .align 2, 0 +_08024D2C: .4byte 0x02037fd4 +_08024D30: .4byte 0x02022c98 +_08024D34: + adds r0, r1, 0 + bl remove_task + ldr r0, _08024D48 + bl sub_802621C +_08024D40: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08024D48: .4byte sub_802589C + 1 + thumb_func_end sub_8024BC8 + + thumb_func_start sub_8024D4C +sub_8024D4C: @ 8024D4C + push {lr} + bl sub_8025D04 + ldr r1, _08024D78 + ldr r0, _08024D7C + ldr r0, [r0] + ldrb r0, [r0, 0x18] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _08024D80 + ldr r0, [r0] + cmp r0, 0 + bne _08024D70 + bl sub_8026AF4 +_08024D70: + bl sub_8025D50 + pop {r0} + bx r0 + .align 2, 0 +_08024D78: .4byte 0x082f7ac4 +_08024D7C: .4byte 0x02022c98 +_08024D80: .4byte 0x03000db0 + thumb_func_end sub_8024D4C + + thumb_func_start sub_8024D84 +sub_8024D84: @ 8024D84 + push {lr} + bl sub_8025E0C + ldr r1, _08024DB0 + ldr r0, _08024DB4 + ldr r0, [r0] + ldrb r0, [r0, 0x18] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _08024DB8 + ldr r0, [r0] + cmp r0, 0 + bne _08024DA8 + bl sub_8026B28 +_08024DA8: + bl sub_8025ED8 + pop {r0} + bx r0 + .align 2, 0 +_08024DB0: .4byte 0x082f7af4 +_08024DB4: .4byte 0x02022c98 +_08024DB8: .4byte 0x03000db0 + thumb_func_end sub_8024D84 + + thumb_func_start sub_8024DBC +sub_8024DBC: @ 8024DBC + push {r4,lr} + ldr r4, _08024DD0 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08024DD4 + cmp r0, 0x1 + beq _08024DEA + b _08024DF8 + .align 2, 0 +_08024DD0: .4byte 0x02022c98 +_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, _08024E1C + 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 + .align 2, 0 +_08024E1C: .4byte 0x02022c98 +_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, _08024E54 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + adds r4, r1, 0 + cmp r0, 0x5 + bhi _08024F08 + lsls r0, 2 + ldr r1, _08024E58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08024E54: .4byte 0x02022c98 +_08024E58: .4byte _08024E5C + .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, _08024E8C + ldr r1, [r0] + b _08024EF0 + .align 2, 0 +_08024E8C: .4byte 0x02022c98 +_08024E90: + bl sub_8010434 + ldr r0, _08024E9C + ldr r1, [r0] + b _08024EF0 + .align 2, 0 +_08024E9C: .4byte 0x02022c98 +_08024EA0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08024F08 + ldr r2, _08024EC0 + 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 + .align 2, 0 +_08024EC0: .4byte 0x02022c98 +_08024EC4: + bl sub_802EB84 + cmp r0, 0 + bne _08024F08 + ldr r0, _08024ED4 + ldr r1, [r0] + b _08024EF0 + .align 2, 0 +_08024ED4: .4byte 0x02022c98 +_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, _08024F34 + 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 + .align 2, 0 +_08024F34: .4byte 0x02022c98 + thumb_func_end sub_8024F10 + + thumb_func_start sub_8024F38 +sub_8024F38: @ 8024F38 + push {r4,lr} + ldr r4, _08024F78 + 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, _08024F7C + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08024F88 + ldr r1, _08024F80 + adds r0, r2, r1 + ldrb r1, [r0] + cmp r1, 0 + bne _08024FEE + ldr r3, _08024F84 + adds r0, r2, r3 + strb r1, [r0] + movs r0, 0x2 + b _08024FC2 + .align 2, 0 +_08024F78: .4byte 0x02022c98 +_08024F7C: .4byte 0x030022c0 +_08024F80: .4byte 0x000031cc +_08024F84: .4byte 0x000031d0 +_08024F88: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08024FA8 + ldr r3, _08024FA4 + 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 + .align 2, 0 +_08024FA4: .4byte 0x000031cc +_08024FA8: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08024FD4 + ldr r3, _08024FD0 + 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, _08024FD0 + adds r1, r2 + strb r0, [r1] + b _08024FEE + .align 2, 0 +_08024FD0: .4byte 0x000031cc +_08024FD4: + movs r0, 0 + bl sub_8027518 + ldr r1, [r4] + ldr r3, _08024FE4 + adds r1, r3 + strb r0, [r1] + b _08024FEE + .align 2, 0 +_08024FE4: .4byte 0x000031cc +_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, _0802503C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _080250C4 + ldr r0, _08025040 + 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, _08025044 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080250CA + ldr r3, _08025048 + adds r1, r2, r3 + movs r0, 0x2 + strb r0, [r1] + b _080250CA + .align 2, 0 +_0802503C: .4byte 0x02022c98 +_08025040: .4byte 0x030022c0 +_08025044: .4byte 0x000031cc +_08025048: .4byte 0x000032f8 +_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, _08025078 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080250CA + ldr r3, _0802507C + adds r1, r2, r3 + movs r0, 0x1 + strb r0, [r1] + b _080250CA + .align 2, 0 +_08025078: .4byte 0x000031cc +_0802507C: .4byte 0x000032f8 +_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, _080250B0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080250CA + ldr r3, _080250B4 + adds r1, r2, r3 + movs r0, 0x3 + strb r0, [r1] + b _080250CA + .align 2, 0 +_080250B0: .4byte 0x000031cc +_080250B4: .4byte 0x000032f8 +_080250B8: + ldr r3, _080250C0 + adds r0, r2, r3 + strb r1, [r0] + b _080250CA + .align 2, 0 +_080250C0: .4byte 0x000032f8 +_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, _08025120 + 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 + .align 2, 0 +_08025120: .4byte 0x02022c98 +_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, _080251B0 + ldr r1, [r5] + ldrb r4, [r1, 0x10] + cmp r4, 0x1 + beq _080251D0 + cmp r4, 0x1 + bgt _080251B4 + cmp r4, 0 + beq _080251BA + b _0802520C + .align 2, 0 +_080251B0: .4byte 0x02022c98 +_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, _0802522C + movs r1, 0x4 + bl sub_80A2F88 +_08025226: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802522C: .4byte 0x0000020b + thumb_func_end sub_8025198 + + thumb_func_start sub_8025230 +sub_8025230: @ 8025230 + push {r4,r5,lr} + ldr r5, _08025248 + ldr r2, [r5] + ldrb r4, [r2, 0x10] + cmp r4, 0x1 + beq _08025274 + cmp r4, 0x1 + bgt _0802524C + cmp r4, 0 + beq _08025252 + b _080252DC + .align 2, 0 +_08025248: .4byte 0x02022c98 +_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, _080252D4 + 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, _080252D8 + 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 + .align 2, 0 +_080252D4: .4byte 0x020223c4 +_080252D8: .4byte 0x02022c98 +_080252DC: + movs r0, 0x1 + bl ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _08025316 + ldr r0, _0802531C + 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, _08025320 + movs r1, 0x4 + bl sub_80A2F88 +_08025316: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802531C: .4byte 0x02022c98 +_08025320: .4byte 0x0000020b + 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, _08025344 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x4 + bls _0802533A + b _08025458 +_0802533A: + lsls r0, 2 + ldr r1, _08025348 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08025344: .4byte 0x02022c98 +_08025348: .4byte _0802534C + .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, _08025380 + ldr r1, [r0] + b _08025448 + .align 2, 0 +_08025380: .4byte 0x02022c98 +_08025384: + bl sub_802A770 + cmp r0, 0 + bne _08025466 + movs r0, 0x5 + bl sub_80292E0 + ldr r0, _08025398 + ldr r1, [r0] + b _08025448 + .align 2, 0 +_08025398: .4byte 0x02022c98 +_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, _080253B8 + ldr r1, [r0] + b _08025448 + .align 2, 0 +_080253B8: .4byte 0x02022c98 +_080253BC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08025466 + ldr r3, _080253D8 + 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 + .align 2, 0 +_080253D8: .4byte 0x02022c98 +_080253DC: + bl sub_8025170 + cmp r0, 0 + beq _08025422 + movs r2, 0 + ldr r1, _08025450 + 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, _08025454 +_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, _08025450 + 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 + .align 2, 0 +_08025450: .4byte 0x02022c98 +_08025454: .4byte 0x020223c4 +_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, _0802548C + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0x7 + bls _08025480 + b _08025606 +_08025480: + lsls r0, 2 + ldr r1, _08025490 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802548C: .4byte 0x02022c98 +_08025490: .4byte _08025494 + .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, _080254CC + cmp r0, r1 + bls _080254C4 + movs r0, 0x4 + bl sub_80292E0 +_080254C4: + ldr r0, _080254D0 + ldr r1, [r0] + b _080255E8 + .align 2, 0 +_080254CC: .4byte 0x00000bb7 +_080254D0: .4byte 0x02022c98 +_080254D4: + bl sub_802A770 + cmp r0, 0 + beq _080254DE + b _0802563C +_080254DE: + movs r0, 0x3 + bl sub_80292E0 + ldr r0, _080254EC + ldr r1, [r0] + b _080255E8 + .align 2, 0 +_080254EC: .4byte 0x02022c98 +_080254F0: + bl sub_8028FCC + bl sub_80272E8 + ldr r0, _08025500 + ldr r1, [r0] + b _080255E8 + .align 2, 0 +_08025500: .4byte 0x02022c98 +_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, _0802551C + ldr r1, [r0] + b _080255E8 + .align 2, 0 +_0802551C: .4byte 0x02022c98 +_08025520: + bl sub_802A770 + cmp r0, 0 + beq _0802552A + b _0802563C +_0802552A: + movs r0, 0x5 + bl sub_80292E0 + ldr r0, _08025538 + ldr r1, [r0] + b _080255E8 + .align 2, 0 +_08025538: .4byte 0x02022c98 +_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, _08025560 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x8] + ldr r1, [r2] + b _080255E8 + .align 2, 0 +_08025560: .4byte 0x02022c98 +_08025564: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0802563C + ldr r0, _08025574 + ldr r1, [r0] + b _080255E8 + .align 2, 0 +_08025574: .4byte 0x02022c98 +_08025578: + bl sub_8025170 + cmp r0, 0 + beq _080255BE + movs r2, 0 + ldr r1, _080255F0 + 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, _080255F4 +_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, _080255F0 + 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 + .align 2, 0 +_080255F0: .4byte 0x02022c98 +_080255F4: .4byte 0x020223c4 +_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, _0802565C + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + beq _08025672 + cmp r0, 0x1 + bgt _08025660 + cmp r0, 0 + beq _08025666 + b _08025692 + .align 2, 0 +_0802565C: .4byte 0x02022c98 +_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, _080256A8 + ldrb r0, [r0] + cmp r0, 0 + bne _080256A0 + movs r0, 0x9 + bl sub_8026240 +_080256A0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080256A8: .4byte 0x03003124 + thumb_func_end sub_8025644 + + thumb_func_start sub_80256AC +sub_80256AC: @ 80256AC + push {r4,lr} + sub sp, 0x4 + ldr r4, _080256C4 + ldr r0, [r4] + ldrb r1, [r0, 0x10] + cmp r1, 0x1 + beq _080256E0 + cmp r1, 0x1 + bgt _080256C8 + cmp r1, 0 + beq _080256CE + b _08025728 + .align 2, 0 +_080256C4: .4byte 0x02022c98 +_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 sub_80A1AD4 + b _0802571A +_080256E0: + bl fade_and_return_progress_probably + ldr r0, _080256F4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802574C + b _0802571A + .align 2, 0 +_080256F4: .4byte 0x02037fd4 +_080256F8: + bl sub_8028B80 + bl sub_80287E4 + ldr r0, [r4] + adds r0, 0x24 + ldrb r0, [r0] + bl sub_8028614 + bl sub_8028E84 + ldr r1, _08025724 + 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 + .align 2, 0 +_08025724: .4byte 0x03000db0 +_08025728: + bl sub_802A770 + cmp r0, 0 + bne _0802574C + ldr r4, _08025754 + ldr r0, [r4] + ldr r0, [r0] + bl set_callback2 + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl remove_task + ldr r0, [r4] + bl free + bl Window_FreeMemory +_0802574C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08025754: .4byte 0x02022c98 + thumb_func_end sub_80256AC + + thumb_func_start sub_8025758 +sub_8025758: @ 8025758 + push {r4,lr} + sub sp, 0x4 + ldr r4, _08025774 + ldr r1, [r4] + ldrb r0, [r1, 0x10] + cmp r0, 0x6 + bls _08025768 + b _0802585C +_08025768: + lsls r0, 2 + ldr r1, _08025778 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08025774: .4byte 0x02022c98 +_08025778: .4byte _0802577C + .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 sub_80A1AD4 + b _08025848 +_080257B0: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + b _08025848 +_08025802: + bl sub_80A2F30 + b _08025848 +_08025808: + ldr r0, _08025814 + bl current_map_music_set + bl sub_8028E4C + b _08025848 + .align 2, 0 +_08025814: .4byte 0x0000021e +_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 sub_80A1AD4 + b _08025848 +_08025838: + bl fade_and_return_progress_probably + ldr r0, _08025854 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802588C +_08025848: + ldr r0, _08025858 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _0802588C + .align 2, 0 +_08025854: .4byte 0x02037fd4 +_08025858: .4byte 0x02022c98 +_0802585C: + ldrb r0, [r1, 0x4] + bl remove_task + ldr r0, _08025894 + bl sub_802621C + bl sub_802903C + ldr r0, [r4] + bl sub_8024A30 + ldr r0, _08025898 + 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 + .align 2, 0 +_08025894: .4byte sub_802589C + 1 +_08025898: .4byte 0x03003124 + 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, _080258B8 + 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 + .align 2, 0 +_080258B8: .4byte 0x02022c98 +_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, _080258F4 + bl sub_802621C + b _080258FE + .align 2, 0 +_080258F4: .4byte sub_8024D4C + 1 +_080258F8: + ldr r0, _0802590C + bl sub_802621C +_080258FE: + adds r0, r5, 0 + bl remove_task +_08025904: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802590C: .4byte sub_8024D84 + 1 + 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, _08025934 + 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 + .align 2, 0 +_08025934: .4byte 0x03005e08 +_08025938: + cmp r4, 0x2 + beq _0802597E + b _080259E8 +_0802593E: + ldr r6, _08025964 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 2 + ldr r2, _08025968 + 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 + .align 2, 0 +_08025964: .4byte 0x02022c98 +_08025968: .4byte 0x0000318c +_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, _080259F0 + ldr r0, [r1] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcs _080259C4 + adds r3, r1, 0 + ldr r5, _080259F4 + ldr r4, _080259F8 +_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, _080259F0 + 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 + .align 2, 0 +_080259F0: .4byte 0x02022c98 +_080259F4: .4byte 0x020223c4 +_080259F8: .4byte 0x0000318c + 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, _08025AD8 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x24 + ldrb r7, [r1] + ldr r2, _08025ADC + adds r1, r0, r2 + ldr r3, _08025AE0 + adds r2, r0, r3 + ldr r4, _08025AE4 + adds r3, r0, r4 + ldr r5, _08025AE8 + 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, _08025AEC + 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, _08025AE0 + 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, _08025AE0 + 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, _08025AD8 + 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 + .align 2, 0 +_08025AD8: .4byte 0x02022c98 +_08025ADC: .4byte 0x000031a0 +_08025AE0: .4byte 0x000031cc +_08025AE4: .4byte 0x00003208 +_08025AE8: .4byte 0x00003244 +_08025AEC: .4byte 0x000031b0 +_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, _08025B4C + mov r12, r3 + ldr r4, _08025B50 + 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 + .align 2, 0 +_08025B4C: .4byte 0x000031cc +_08025B50: .4byte 0x02022c98 +_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, _08025BA0 + adds r0, r6 + strb r2, [r0] + ldr r0, [r3] + adds r0, r1 + ldr r1, _08025BA4 + adds r0, r1 + b _08025BEA + .align 2, 0 +_08025BA0: .4byte 0x000031d0 +_08025BA4: .4byte 0x000031d4 +_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, _08025C04 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + ldr r6, _08025C08 + 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 + .align 2, 0 +_08025C04: .4byte 0x000031d0 +_08025C08: .4byte 0x000031d4 + thumb_func_end sub_80259FC + + thumb_func_start sub_8025C0C +sub_8025C0C: @ 8025C0C + push {r4-r7,lr} + sub sp, 0x18 + ldr r5, _08025CD0 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x24 + ldrb r6, [r1] + ldr r2, _08025CD4 + adds r1, r0, r2 + ldr r3, _08025CD8 + adds r2, r0, r3 + ldr r4, _08025CDC + adds r3, r0, r4 + ldr r7, _08025CE0 + 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, _08025CE4 + 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, _08025CD0 + 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, _08025CD0 + 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 + .align 2, 0 +_08025CD0: .4byte 0x02022c98 +_08025CD4: .4byte 0x000031a0 +_08025CD8: .4byte 0x000031cc +_08025CDC: .4byte 0x00003208 +_08025CE0: .4byte 0x00003244 +_08025CE4: .4byte 0x000031b0 +_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, _08025D1C + ldr r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0x4 + beq _08025D40 + cmp r0, 0x4 + bgt _08025D20 + cmp r0, 0x3 + beq _08025D26 + b _08025D4A + .align 2, 0 +_08025D1C: .4byte 0x02022c98 +_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, _08025D64 + ldr r5, [r0] + ldrb r0, [r5, 0x18] + cmp r0, 0x4 + beq _08025D68 + cmp r0, 0xB + beq _08025DB8 + b _08025DF4 + .align 2, 0 +_08025D64: .4byte 0x02022c98 +_08025D68: + ldr r1, _08025DA8 + adds r0, r5, r1 + ldr r2, _08025DAC + adds r1, r5, r2 + ldr r3, _08025DB0 + adds r2, r5, r3 + ldr r4, _08025DB4 + 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 + .align 2, 0 +_08025DA8: .4byte 0x000032cc +_08025DAC: .4byte 0x000031cc +_08025DB0: .4byte 0x00003208 +_08025DB4: .4byte 0x00003244 +_08025DB8: + ldr r1, _08025DFC + adds r0, r5, r1 + ldr r2, _08025E00 + adds r1, r5, r2 + ldr r3, _08025E04 + adds r2, r5, r3 + ldr r4, _08025E08 + 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 + .align 2, 0 +_08025DFC: .4byte 0x000032cc +_08025E00: .4byte 0x000031cc +_08025E04: .4byte 0x00003208 +_08025E08: .4byte 0x00003244 + thumb_func_end sub_8025D50 + + thumb_func_start sub_8025E0C +sub_8025E0C: @ 8025E0C + push {r4-r6,lr} + sub sp, 0x18 + ldr r0, _08025E20 + ldr r5, [r0] + ldrb r0, [r5, 0x18] + cmp r0, 0x4 + beq _08025E24 + cmp r0, 0xB + beq _08025E7C + b _08025EC0 + .align 2, 0 +_08025E20: .4byte 0x02022c98 +_08025E24: + adds r0, r5, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + ldr r2, _08025E6C + adds r1, r2 + adds r1, r5, r1 + ldr r3, _08025E70 + adds r2, r5, r3 + ldr r4, _08025E74 + adds r3, r5, r4 + ldr r6, _08025E78 + 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 + .align 2, 0 +_08025E6C: .4byte 0x000031a0 +_08025E70: .4byte 0x000031cc +_08025E74: .4byte 0x00003208 +_08025E78: .4byte 0x00003244 +_08025E7C: + adds r0, r5, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + ldr r2, _08025EC8 + adds r1, r2 + adds r1, r5, r1 + ldr r3, _08025ECC + adds r2, r5, r3 + ldr r4, _08025ED0 + adds r3, r5, r4 + ldr r6, _08025ED4 + 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 + .align 2, 0 +_08025EC8: .4byte 0x000031a0 +_08025ECC: .4byte 0x000031cc +_08025ED0: .4byte 0x00003208 +_08025ED4: .4byte 0x00003244 + thumb_func_end sub_8025E0C + + thumb_func_start sub_8025ED8 +sub_8025ED8: @ 8025ED8 + push {r4,lr} + ldr r4, _08025EF0 + ldr r1, [r4] + ldrb r0, [r1, 0x18] + cmp r0, 0x4 + beq _08025F0E + cmp r0, 0x4 + bgt _08025EF4 + cmp r0, 0x3 + beq _08025EFA + b _08025F40 + .align 2, 0 +_08025EF0: .4byte 0x02022c98 +_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, _08025F20 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08025F40 + bl sub_80282EC + b _08025F40 + .align 2, 0 +_08025F20: .4byte 0x000032f8 +_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, _08025F80 + 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, _08025F84 + 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 + .align 2, 0 +_08025F80: .4byte 0x02022c98 +_08025F84: .4byte 0x000031cc +_08025F88: + ldr r3, _08025FB4 + 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 + .align 2, 0 +_08025FB4: .4byte 0x000031d0 +_08025FB8: + ldr r3, _08026014 + 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, _08026018 + 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 + .align 2, 0 +_08026014: .4byte 0x000031d4 +_08026018: .4byte 0x02022c98 +_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, _08026090 + 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, _08026094 + adds r0, r1, r3 + ldrb r3, [r0] + cmp r3, 0 + bne _0802609C + ldr r4, _08026098 + 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 + .align 2, 0 +_08026090: .4byte 0x02022c98 +_08026094: .4byte 0x000031cc +_08026098: .4byte 0x000031d0 +_0802609C: + ldr r3, _080260C8 + 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 + .align 2, 0 +_080260C8: .4byte 0x000031d0 +_080260CC: + ldr r4, _08026150 + 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, _08026154 +_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, _08026158 + 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 + .align 2, 0 +_08026150: .4byte 0x000031d4 +_08026154: .4byte 0x02022c98 +_08026158: .4byte 0x000031a0 +_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, _0802619C + 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 + .align 2, 0 +_0802619C: .4byte 0x02022c98 +_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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _0802623C + 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 + .align 2, 0 +_0802623C: .4byte 0x02022c98 + thumb_func_end sub_802621C + + thumb_func_start sub_8026240 +sub_8026240: @ 8026240 + push {r4,lr} + ldr r2, _08026260 + 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 + .align 2, 0 +_08026260: .4byte 0x02022c98 + thumb_func_end sub_8026240 + + thumb_func_start sub_8026264 +sub_8026264: @ 8026264 + push {r4,lr} + ldr r3, _08026298 + 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, _0802629C + 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 + .align 2, 0 +_08026298: .4byte 0x02022c98 +_0802629C: .4byte 0x082f7a94 +_080262A0: + lsls r4, r2, 3 + adds r1, r4, 0 + movs r0, 0x14 + bl lcd_io_set + negs r4, r4 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x18 + adds r1, r4, 0 + bl lcd_io_set +_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, _08026318 + 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, _0802631C + 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, _08026320 + 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 + .align 2, 0 +_08026318: .4byte 0x02022c98 +_0802631C: .4byte 0x000032e0 +_08026320: .4byte 0x000032eb + 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, _080263F8 + 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, _080263F8 + lsls r0, r6, 4 + subs r1, r0, r6 + lsls r1, 2 + ldr r2, [r3] + adds r1, r2 + ldr r4, _080263FC + 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, _08026400 + 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, _080263F8 + 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 + .align 2, 0 +_080263F8: .4byte 0x02022c98 +_080263FC: .4byte 0x000031cc +_08026400: .4byte 0x082f449c +_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, _08026504 + 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, _08026508 + mov r9, r1 +_08026450: + movs r6, 0xFF + ldr r0, _0802650C + 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, _08026510 + ldr r0, _08026514 + 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 + .align 2, 0 +_08026504: .4byte 0x000031d4 +_08026508: .4byte 0x02022c98 +_0802650C: .4byte 0x082f449c +_08026510: .4byte 0x082f7a88 +_08026514: .4byte 0x000031b4 +_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, _08026624 + 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, _08026628 + 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, _0802662C + 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, _08026630 + 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 + .align 2, 0 +_08026624: .4byte 0x000032eb +_08026628: .4byte 0x000031d0 +_0802662C: .4byte 0x000031d4 +_08026630: .4byte 0x000032e0 + 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, _08026668 + 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, _0802666C + adds r1, r0 + mov r12, r2 + cmp r3, 0x2 + beq _08026670 + cmp r3, 0x2 + bgt _08026676 + cmp r3, 0x1 + beq _08026674 + b _08026676 + .align 2, 0 +_08026668: .4byte 0x02022c98 +_0802666C: .4byte 0x000032e0 +_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, _080266C8 + 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, _080266CC + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _0802670A + .align 2, 0 +_080266C8: .4byte 0x082f45af +_080266CC: .4byte 0x000031d4 +_080266D0: + movs r0, 0x1 + b _0802670C +_080266D4: + ldr r0, _08026714 + 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, _08026718 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_0802670A: + movs r0, 0 +_0802670C: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08026714: .4byte 0x082f45af +_08026718: .4byte 0x000031d4 + 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, _080267F0 + 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, _080267F4 + 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, _080267F8 + 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 + .align 2, 0 +_080267F0: .4byte 0x02022c98 +_080267F4: .4byte 0x000032eb +_080267F8: .4byte 0x000032e0 +_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, _08026864 + ldr r0, _08026868 + 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 + .align 2, 0 +_08026864: .4byte 0x082f7a88 +_08026868: .4byte 0x000032e0 +_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, _080268E8 + 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, _080268EC + 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, _080268F0 + adds r1, r4, r2 + adds r1, r5 + strb r0, [r1] + b _08026964 + .align 2, 0 +_080268E8: .4byte 0x000031d0 +_080268EC: .4byte 0x000032eb +_080268F0: .4byte 0x000032e0 +_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, _08026984 + 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 + .align 2, 0 +_08026984: .4byte 0x000032eb + 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, _080269F0 + 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, _080269F4 + mov r9, r0 +_080269A8: + ldr r0, _080269F0 + 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, _080269F8 + 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 + .align 2, 0 +_080269F0: .4byte 0x02022c98 +_080269F4: .4byte 0x082f449c +_080269F8: .4byte 0x000031a0 +_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, _08026AC0 + 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, _08026AC4 + 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 + .align 2, 0 +_08026AC0: .4byte 0x02022c98 +_08026AC4: .4byte 0x000031cc + thumb_func_end sub_8026A88 + + thumb_func_start sub_8026AC8 +sub_8026AC8: @ 8026AC8 + push {r4,r5,lr} + ldr r0, _08026AF0 + 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 + .align 2, 0 +_08026AF0: .4byte 0x02022c98 + thumb_func_end sub_8026AC8 + + thumb_func_start sub_8026AF4 +sub_8026AF4: @ 8026AF4 + push {lr} + bl sub_8026988 + ldr r0, _08026B0C + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _08026B10 + bl sub_8026AC8 + b _08026B14 + .align 2, 0 +_08026B0C: .4byte 0x02022c98 +_08026B10: + bl sub_8026A88 +_08026B14: + ldr r0, _08026B24 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + bl sub_80288D4 + pop {r0} + bx r0 + .align 2, 0 +_08026B24: .4byte 0x02022c98 + thumb_func_end sub_8026AF4 + + thumb_func_start sub_8026B28 +sub_8026B28: @ 8026B28 + push {lr} + bl sub_8026988 + ldr r0, _08026B40 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _08026B44 + bl sub_8026AC8 + b _08026B48 + .align 2, 0 +_08026B40: .4byte 0x02022c98 +_08026B44: + bl sub_8026A88 +_08026B48: + ldr r0, _08026B58 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + bl sub_80288D4 + pop {r0} + bx r0 + .align 2, 0 +_08026B58: .4byte 0x02022c98 + 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, _08026B74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08026B74: .4byte _08026B78 + .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, _08026C10 + 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, _08026C10 + 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 + .align 2, 0 +_08026C10: .4byte 0x02022c98 +_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, _08026C4C + 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 + .align 2, 0 +_08026C4C: .4byte 0x02022c98 + thumb_func_end sub_8026C28 + + thumb_func_start sub_8026C50 +sub_8026C50: @ 8026C50 + push {r4,lr} + ldr r3, _08026C84 + 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 + .align 2, 0 +_08026C84: .4byte 0x02022c98 +_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, _08026D08 + 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, _08026D0C + 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, _08026D10 + 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 + .align 2, 0 +_08026D08: .4byte 0x02022c98 +_08026D0C: .4byte 0x082f449c +_08026D10: .4byte 0x000031bf +_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, _08026D84 + mov r8, r0 + ldr r0, _08026D88 + 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 + .align 2, 0 +_08026D84: .4byte 0x082f7a9c +_08026D88: .4byte 0x02022c98 + thumb_func_end sub_8026D1C + + thumb_func_start sub_8026D8C +sub_8026D8C: @ 8026D8C + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08026DA8 + ldr r1, _08026DAC + 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 + .align 2, 0 +_08026DA8: .4byte 0x082f4648 +_08026DAC: .4byte 0x02022c98 + 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, _08026E30 + ldr r1, [r4] + adds r1, 0x24 + ldrb r2, [r1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08026E34 + 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, _08026E38 + 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 + .align 2, 0 +_08026E30: .4byte 0x02022c98 +_08026E34: .4byte 0x082f45fa +_08026E38: .4byte 0x082f467f +_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, _08026E9C + 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, _08026EA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08026E9C: .4byte 0x02022c98 +_08026EA0: .4byte _08026EA4 + .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, _08026F44 + 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 + .align 2, 0 +_08026F44: .4byte 0x02022c98 +_08026F48: + ldr r3, _08026F70 + 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, _08026F74 + bl sub_8027A28 + ldr r1, [r6] + adds r1, 0x4A + adds r1, r4 + b _0802722A + .align 2, 0 +_08026F70: .4byte 0x000031b4 +_08026F74: .4byte 0x00004e20 +_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, _08026FB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08026FB4: .4byte _08026FB8 + .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, _08026FF4 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x68 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x74 + b _08027226 + .align 2, 0 +_08026FF4: .4byte 0x02022c98 +_08026FF8: + ldr r0, _08027000 + ldr r1, [r0] + adds r1, 0x74 + b _08027226 + .align 2, 0 +_08027000: .4byte 0x02022c98 +_08027004: + ldr r0, _08027018 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x74 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x80 + b _08027226 + .align 2, 0 +_08027018: .4byte 0x02022c98 +_0802701C: + ldr r0, _08027024 + ldr r1, [r0] + adds r1, 0x80 + b _08027226 + .align 2, 0 +_08027024: .4byte 0x02022c98 +_08027028: + ldr r0, _0802703C + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x80 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x50 + b _08027226 + .align 2, 0 +_0802703C: .4byte 0x02022c98 +_08027040: + ldr r0, _08027048 + ldr r1, [r0] + adds r1, 0x50 + b _08027226 + .align 2, 0 +_08027048: .4byte 0x02022c98 +_0802704C: + ldr r0, _0802705C + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 + .align 2, 0 +_0802705C: .4byte 0x02022c98 +_08027060: + ldr r0, _08027068 + ldr r1, [r0] + b _08027224 + .align 2, 0 +_08027068: .4byte 0x02022c98 +_0802706C: + ldr r0, _08027080 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x5C + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x68 + b _08027226 + .align 2, 0 +_08027080: .4byte 0x02022c98 +_08027084: + ldr r0, _0802708C + ldr r1, [r0] + adds r1, 0x68 + b _08027226 + .align 2, 0 +_0802708C: .4byte 0x02022c98 +_08027090: + subs r0, r4, 0x1 + cmp r0, 0x7 + bls _08027098 + b _0802722C +_08027098: + lsls r0, 2 + ldr r1, _080270A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080270A4: .4byte _080270A8 + .align 2, 0 +_080270A8: + .4byte _080270C8 + .4byte _080270E0 + .4byte _080270EC + .4byte _08027104 + .4byte _08027110 + .4byte _08027124 + .4byte _08027130 + .4byte _08027148 +_080270C8: + ldr r0, _080270DC + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x68 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x74 + b _08027226 + .align 2, 0 +_080270DC: .4byte 0x02022c98 +_080270E0: + ldr r0, _080270E8 + ldr r1, [r0] + adds r1, 0x74 + b _08027226 + .align 2, 0 +_080270E8: .4byte 0x02022c98 +_080270EC: + ldr r0, _08027100 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x74 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x50 + b _08027226 + .align 2, 0 +_08027100: .4byte 0x02022c98 +_08027104: + ldr r0, _0802710C + ldr r1, [r0] + adds r1, 0x50 + b _08027226 + .align 2, 0 +_0802710C: .4byte 0x02022c98 +_08027110: + ldr r0, _08027120 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 + .align 2, 0 +_08027120: .4byte 0x02022c98 +_08027124: + ldr r0, _0802712C + ldr r1, [r0] + b _08027224 + .align 2, 0 +_0802712C: .4byte 0x02022c98 +_08027130: + ldr r0, _08027144 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x5C + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x68 + b _08027226 + .align 2, 0 +_08027144: .4byte 0x02022c98 +_08027148: + ldr r0, _08027150 + ldr r1, [r0] + adds r1, 0x68 + b _08027226 + .align 2, 0 +_08027150: .4byte 0x02022c98 +_08027154: + subs r0, r4, 0x2 + cmp r0, 0x5 + bhi _0802722C + lsls r0, 2 + ldr r1, _08027164 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08027164: .4byte _08027168 + .align 2, 0 +_08027168: + .4byte _08027180 + .4byte _08027198 + .4byte _080271A4 + .4byte _080271BC + .4byte _080271C8 + .4byte _080271DC +_08027180: + ldr r0, _08027194 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x5C + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x68 + b _08027226 + .align 2, 0 +_08027194: .4byte 0x02022c98 +_08027198: + ldr r0, _080271A0 + ldr r1, [r0] + adds r1, 0x68 + b _08027226 + .align 2, 0 +_080271A0: .4byte 0x02022c98 +_080271A4: + ldr r0, _080271B8 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x68 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x50 + b _08027226 + .align 2, 0 +_080271B8: .4byte 0x02022c98 +_080271BC: + ldr r0, _080271C4 + ldr r1, [r0] + adds r1, 0x50 + b _08027226 + .align 2, 0 +_080271C4: .4byte 0x02022c98 +_080271C8: + ldr r0, _080271D8 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 + .align 2, 0 +_080271D8: .4byte 0x02022c98 +_080271DC: + ldr r0, _080271E4 + ldr r1, [r0] + b _08027224 + .align 2, 0 +_080271E4: .4byte 0x02022c98 +_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, _08027278 + 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, _0802727C + cmp r0, r1 + bls _0802729E + strh r1, [r2] + b _0802729E + .align 2, 0 +_08027278: .4byte 0x02022c98 +_0802727C: .4byte 0x0000270f +_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, _080272E4 + 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 + .align 2, 0 +_080272E4: .4byte 0x02022c98 + 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, _080273D8 + movs r4, 0 + ldr r0, _080273DC + 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, _080273E0 + adds r0, r2 + strb r4, [r0] + ldr r0, [r7] + adds r0, r1 + ldr r1, _080273E4 + 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, _080273E8 + adds r1, r2 + strb r4, [r1] + ldr r2, [r7] + ldr r1, _080273EC + 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, _080273D8 + ldr r0, [r2] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, _080273D8 + 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 + .align 2, 0 +_080273D8: .4byte 0x02022c98 +_080273DC: .4byte 0x000031bf +_080273E0: .4byte 0x000031cc +_080273E4: .4byte 0x000031d0 +_080273E8: .4byte 0x00003308 +_080273EC: .4byte 0x0000330c + thumb_func_end sub_80272E8 + + thumb_func_start sub_80273F0 +sub_80273F0: @ 80273F0 + push {r4,r5,lr} + movs r4, 0 + ldr r0, _08027408 + ldr r0, [r0] + adds r0, 0x24 + ldrb r0, [r0] + cmp r0, 0x4 + beq _0802740C + cmp r0, 0x5 + beq _08027410 + b _08027412 + .align 2, 0 +_08027408: .4byte 0x02022c98 +_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, _08027454 + ldr r2, _08027458 + 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 + .align 2, 0 +_08027454: .4byte 0x02022c98 +_08027458: .4byte 0x082f7aa4 + thumb_func_end sub_80273F0 + + thumb_func_start sub_802745C +sub_802745C: @ 802745C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08027494 + 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, _08027498 + cmp r0, r1 + bls _0802748E + adds r0, r1, 0 +_0802748E: + pop {r1} + bx r1 + .align 2, 0 +_08027494: .4byte 0x02022c98 +_08027498: .4byte 0x0000270f + thumb_func_end sub_802745C + + thumb_func_start sub_802749C +sub_802749C: @ 802749C + push {r4-r6,lr} + ldr r5, _08027504 + ldr r0, [r5] + adds r0, 0x28 + ldrb r0, [r0] + bl sub_802745C + ldr r1, _08027508 + bl sub_8027A38 + adds r4, r0, 0 + ldr r0, [r5] + adds r0, 0x28 + ldrb r0, [r0] + bl sub_80276C0 + ldr r1, _0802750C + bl sub_8027A38 + adds r2, r0, 0 + ldr r3, _08027510 + 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, _08027514 + 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 + .align 2, 0 +_08027504: .4byte 0x02022c98 +_08027508: .4byte 0x0000270f +_0802750C: .4byte 0x000f4236 +_08027510: .4byte 0x03005d90 +_08027514: .4byte 0x00000212 + 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, _08027550 + 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 + .align 2, 0 +_08027550: .4byte 0x02022c98 + thumb_func_end sub_8027518 + + thumb_func_start sub_8027554 +sub_8027554: @ 8027554 + push {r4,lr} + ldr r4, _08027588 + 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, _0802758C + 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, _08027590 + adds r0, r1 + movs r1, 0x2 + b _080275CA + .align 2, 0 +_08027588: .4byte 0x02022c98 +_0802758C: .4byte 0x030022c0 +_08027590: .4byte 0x000031cc +_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, _080275AC + adds r0, r1 + movs r1, 0x3 + b _080275CA + .align 2, 0 +_080275AC: .4byte 0x000031cc +_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, _080275E4 + 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 + .align 2, 0 +_080275E4: .4byte 0x000031cc +_080275E8: + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r3, r0 + ldr r1, _080275F8 + adds r0, r1 + strb r2, [r0] + b _08027600 + .align 2, 0 +_080275F8: .4byte 0x000031cc +_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, _08027624 + 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, _08027628 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08027624: .4byte 0x02022c98 +_08027628: .4byte 0x000031cc + thumb_func_end sub_8027608 + + thumb_func_start sub_802762C +sub_802762C: @ 802762C + ldr r0, _0802764C + 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 + .align 2, 0 +_0802764C: .4byte 0x02022c98 + thumb_func_end sub_802762C + + thumb_func_start sub_8027650 +sub_8027650: @ 8027650 + ldr r0, _0802765C + ldr r0, [r0] + adds r0, 0x24 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0802765C: .4byte 0x02022c98 + thumb_func_end sub_8027650 + + thumb_func_start sub_8027660 +sub_8027660: @ 8027660 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08027680 + ldrb r0, [r0] + cmp r0, 0 + bne _0802768C + ldr r0, _08027684 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + ldr r2, _08027688 + adds r1, r2 + ldr r0, [r0] + b _08027694 + .align 2, 0 +_08027680: .4byte 0x03003124 +_08027684: .4byte 0x02022c98 +_08027688: .4byte 0x000031a0 +_0802768C: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + ldr r1, _0802769C +_08027694: + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_0802769C: .4byte 0x020229f0 + thumb_func_end sub_8027660 + + thumb_func_start sub_80276A0 +sub_80276A0: @ 80276A0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r2, _080276BC + 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 + .align 2, 0 +_080276BC: .4byte 0x02022c98 + 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, _0802772C + mov r9, r0 + ldr r2, _08027730 + 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 + .align 2, 0 +_0802772C: .4byte 0x02022c98 +_08027730: .4byte 0x082f7b24 +_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, _08027784 + 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, _08027788 + adds r0, r5, 0 + bl sub_8027A38 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08027784: .4byte 0x02022c98 +_08027788: .4byte 0x000f4236 + thumb_func_end sub_8027748 + + thumb_func_start sub_802778C +sub_802778C: @ 802778C + push {r4,r5,lr} + lsls r0, 24 + ldr r1, _080277CC + 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 + .align 2, 0 +_080277CC: .4byte 0x02022c98 + 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, _08027848 + 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 + .align 2, 0 +_08027848: .4byte 0x02022c98 + 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, _0802792C + 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, _08027930 + mov r12, r1 + movs r7, 0 + movs r6, 0x4 + ldr r3, _08027934 +_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, _08027938 + bl sub_8027A38 + ldr r1, _0802792C + ldr r1, [r1] + lsls r2, r4, 3 + ldr r3, _08027934 + 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, _0802792C + mov r10, r7 +_080278DE: + mov r0, r10 + ldr r2, [r0] + lsls r1, r4, 3 + ldr r7, _08027934 + adds r0, r2, r7 + adds r0, r1 + ldr r0, [r0] + cmp r6, r0 + bne _0802790C + adds r0, r2, r1 + ldr r1, _08027930 + 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 + .align 2, 0 +_0802792C: .4byte 0x02022c98 +_08027930: .4byte 0x00003308 +_08027934: .4byte 0x0000330c +_08027938: .4byte 0x000f4236 + thumb_func_end sub_802784C + + thumb_func_start sub_802793C +sub_802793C: @ 802793C + lsls r1, 24 + ldr r2, _08027954 + ldr r2, [r2] + lsrs r1, 21 + ldr r3, _08027958 + adds r2, r3 + adds r2, r1 + ldr r1, [r2] + ldr r2, [r2, 0x4] + str r1, [r0] + str r2, [r0, 0x4] + bx lr + .align 2, 0 +_08027954: .4byte 0x02022c98 +_08027958: .4byte 0x00003308 + 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, _080279C4 + 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 + .align 2, 0 +_080279C4: .4byte 0x02022c98 + thumb_func_end sub_802795C + + thumb_func_start sub_80279C8 +sub_80279C8: @ 80279C8 + push {r4-r6,lr} + ldr r0, _080279F0 + 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 + .align 2, 0 +_080279F0: .4byte 0x02022c98 +_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, _08027A58 + ldr r1, [r1] + adds r1, 0x34 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_08027A58: .4byte 0x02022c98 + thumb_func_end sub_8027A48 + + thumb_func_start sub_8027A5C +sub_8027A5C: @ 8027A5C + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08027A8C +_08027A62: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08027A90 + 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 + .align 2, 0 +_08027A8C: .4byte 0x020375f0 +_08027A90: .4byte 0x020244ec +_08027A94: + adds r5, 0x1 + cmp r5, 0x5 + ble _08027A62 + ldr r1, _08027AA8 + movs r0, 0 + strh r0, [r1] +_08027AA0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08027AA8: .4byte 0x020375f0 + thumb_func_end sub_8027A5C + + thumb_func_start sub_8027AAC +sub_8027AAC: @ 8027AAC + push {r4,lr} + ldr r4, _08027AC8 + 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 + .align 2, 0 +_08027AC8: .4byte sub_8027ACC + 1 + 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, _08027AF0 + 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 + .align 2, 0 +_08027AF0: .4byte 0x03005e08 +_08027AF4: + cmp r0, 0x2 + beq _08027BA0 + cmp r0, 0x3 + beq _08027BC8 + b _08027BE2 +_08027AFE: + ldr r0, _08027B80 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r1, _08027B84 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r4, r0, 0 + movs r6, 0 + ldr r5, _08027B88 +_08027B18: + ldr r1, [r5] + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + 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, _08027B8C + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r4, 24 + ldr r1, _08027B90 + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, sp + bl Window_AddFromTemplate + 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 + .align 2, 0 +_08027B80: .4byte 0x082f7b2c +_08027B84: .4byte 0x085edce5 +_08027B88: .4byte 0x082f7b34 +_08027B8C: .4byte 0xffff00ff +_08027B90: .4byte 0x00ffffff +_08027B94: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08027BE2 + b _08027BBA +_08027BA0: + ldr r0, _08027BC4 + 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 Window_CopyToVram +_08027BBA: + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + b _08027BE2 + .align 2, 0 +_08027BC4: .4byte 0x030022c0 +_08027BC8: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08027BE2 + ldrb r0, [r7, 0x2] + bl Window_Remove + 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, _08027CFC + 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, _08027D00 + adds r1, r0 + ldrh r0, [r1] + str r0, [sp, 0x14] + ldr r4, _08027D04 + 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 Window_FastFillPixels + ldr r4, _08027D08 + ldr r0, [sp, 0x18] + lsls r2, r0, 3 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_81DB35C + 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, _08027D0C + 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, _08027D10 + adds r0, r6, r0 + ldrb r3, [r0] + mov r0, r8 + movs r2, 0 + bl decimal_int_to_string + movs r0, 0x1 + mov r1, r8 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + adds r5, r0, 0 + ldr r0, _08027D14 + adds r4, r0 + ldr r2, [r4] + ldr r0, _08027D18 + 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, _08027D1C + 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 Window_WriteStandardTileMap + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08027CFC: .4byte 0x03005d90 +_08027D00: .4byte 0x00000212 +_08027D04: .4byte 0x0000021d +_08027D08: .4byte 0x085edce5 +_08027D0C: .4byte 0x02021cc4 +_08027D10: .4byte 0x082f7b40 +_08027D14: .4byte 0x082f7b34 +_08027D18: .4byte 0x082f7b44 +_08027D1C: .4byte 0x082f7b4a + thumb_func_end sub_8027BEC + + thumb_func_start sub_8027D20 +sub_8027D20: @ 8027D20 + push {lr} + bl sub_8009FCC + ldr r1, _08027D34 + ldr r1, [r1] + adds r1, 0x24 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08027D34: .4byte 0x02022c98 + thumb_func_end sub_8027D20 + + thumb_func_start sub_8027D38 +sub_8027D38: @ 8027D38 + push {r4-r7,lr} + ldr r0, _08027DC0 + ldr r0, [r0] + adds r0, 0x24 + ldrb r4, [r0] + cmp r4, 0x4 + bhi _08027D66 + ldr r5, _08027DC4 +_08027D48: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, _08027DC8 + adds r0, r1 + lsls r1, r4, 2 + adds r1, r5 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _08027D48 +_08027D66: + ldr r0, _08027DC0 + 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, _08027DC0 + lsls r3, r1, 1 + ldr r6, _08027DCC +_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 + .align 2, 0 +_08027DC0: .4byte 0x02022c98 +_08027DC4: .4byte 0x082f7b90 +_08027DC8: .4byte 0x020229f0 +_08027DCC: .4byte 0x082f7b50 + thumb_func_end sub_8027D38 + + thumb_func_start sub_8027DD0 +sub_8027DD0: @ 8027DD0 + push {lr} + sub sp, 0x8 + ldr r3, _08027DF8 + 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 + .align 2, 0 +_08027DF8: .4byte 0xffffff00 + thumb_func_end sub_8027DD0 + + thumb_func_start sub_8027DFC +sub_8027DFC: @ 8027DFC + push {lr} + adds r2, r0, 0 + ldr r3, _08027E24 + 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 + .align 2, 0 +_08027E24: .4byte 0x03003090 +_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, _080281A0 + 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 + .align 2, 0 +_080281A0: .4byte 0x03003090 +_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, _08028314 + 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 + .align 2, 0 +_08028314: .4byte 0xffffff00 + 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, _08028340 + 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 + .align 2, 0 +_08028340: .4byte 0x03003090 +_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, _08028370 + 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 + .align 2, 0 +_08028370: .4byte 0xffffff00 + thumb_func_end sub_8028350 + + thumb_func_start sub_8028374 +sub_8028374: @ 8028374 + push {lr} + adds r2, r0, 0 + ldr r3, _0802839C + 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 + .align 2, 0 +_0802839C: .4byte 0x03003090 +_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 malloc_and_clear + adds r4, r0, 0 + ldr r0, _080283FC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, _08028400 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x10] + str r1, [sp, 0x14] + ldr r0, _08028404 + adds r1, r4, 0 + bl LZ77UnCompWram + cmp r4, 0 + beq _080283E8 + str r4, [sp] + str r5, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r4, 0 + bl free +_080283E8: + add r0, sp, 0x8 + bl gpu_pal_obj_alloc_tag_and_apply + add r0, sp, 0x10 + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080283FC: .4byte 0x082fb2d8 +_08028400: .4byte 0x082fb2e0 +_08028404: .4byte 0x082f98bc + 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, _08028494 + str r0, [sp, 0x1C] + ldr r0, _08028498 + str r0, [sp, 0x20] + str r3, [sp, 0x24] + ldr r0, _0802849C + str r0, [sp, 0x28] + ldr r0, _080284A0 + str r0, [sp, 0x2C] + mov r0, sp + movs r2, 0x18 + bl memcpy + movs r0, 0x4 + bl malloc_and_clear + ldr r1, _080284A4 + 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 obj_add_from_template_forward_search + 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 + .align 2, 0 +_08028494: .4byte 0x082fb1e0 +_08028498: .4byte 0x082fb228 +_0802849C: .4byte 0x082ec6a8 +_080284A0: .4byte sub_80284A8 + 1 +_080284A4: .4byte 0x02022c9c + 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, _080284FC + 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, _08028500 + 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 + .align 2, 0 +_080284FC: .4byte 0x02022c9c +_08028500: .4byte 0x02020630 + thumb_func_end sub_80284CC + + thumb_func_start sub_8028504 +sub_8028504: @ 8028504 + push {lr} + bl link_get_multiplayer_id + ldr r1, _08028534 + 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, _08028538 + 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 + .align 2, 0 +_08028534: .4byte 0x02022c9c +_08028538: .4byte 0x02020630 + 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, _0802864C +_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, _08028650 + adds r0, r1 + cmp r0, 0 + beq _0802863C + bl obj_delete_and_free_resources +_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 + .align 2, 0 +_0802864C: .4byte 0x02022c9c +_08028650: .4byte 0x02020630 + thumb_func_end sub_8028614 + + thumb_func_start sub_8028654 +sub_8028654: @ 8028654 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, _08028684 + ldr r2, _08028688 + 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 + .align 2, 0 +_08028684: .4byte 0x02020630 +_08028688: .4byte 0x02022c9c + 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, _080286D8 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, _080286DC + adds r0, r2 + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_080286D8: .4byte 0x02022c9c +_080286DC: .4byte 0x02020630 + 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, _0802872C + mov r12, r0 + movs r6, 0 + ldr r5, _08028730 +_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 + .align 2, 0 +_0802872C: .4byte 0x02020630 +_08028730: .4byte 0x02022cf4 + 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 malloc_and_clear + adds r6, r0, 0 + ldr r0, _080287D4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, _080287D8 + 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, _080287DC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r4, _080287E0 + movs r0, 0x40 + bl malloc_and_clear + str r0, [r4] + adds r0, r5, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + add r0, sp, 0x20 + bl gpu_pal_obj_alloc_tag_and_apply + 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 obj_add_from_template_forward_search + ldr r1, _080287E0 + 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 + .align 2, 0 +_080287D4: .4byte 0x082fb2e8 +_080287D8: .4byte 0x082f96e0 +_080287DC: .4byte 0x082fb2f0 +_080287E0: .4byte 0x02022cf4 + thumb_func_end sub_8028734 + + thumb_func_start sub_80287E4 +sub_80287E4: @ 80287E4 + push {r4,r5,lr} + movs r4, 0 +_080287E8: + ldr r5, _08028820 + 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, _08028824 + adds r0, r1 + cmp r0, 0 + beq _08028806 + bl obj_delete_and_free_resources +_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 + .align 2, 0 +_08028820: .4byte 0x02022cf4 +_08028824: .4byte 0x02020630 + 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, _080288B8 + 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, _080288BC + 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, _080288C0 + 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 + .align 2, 0 +_080288B8: .4byte 0x02022cf4 +_080288BC: .4byte 0x02020630 +_080288C0: .4byte 0x0000fff0 +_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, _08028908 + 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, _0802890C + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080288E0 + b _080289DA + .align 2, 0 +_08028908: .4byte 0x02022cf4 +_0802890C: .4byte 0x02020630 +_08028910: + movs r4, 0 + movs r0, 0xA + subs r0, r5 + cmp r4, r0 + bge _080289D6 + ldr r6, _08028940 +_0802891C: + cmp r5, 0x6 + bls _08028984 + ldr r0, _08028944 + ldr r2, [r0] + ldr r1, _08028948 + 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 + .align 2, 0 +_08028940: .4byte 0x02020630 +_08028944: .4byte 0x02022cf4 +_08028948: .4byte 0x0000fffa +_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 obj_anim_image_start + 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 obj_anim_image_start + b _0802899E +_08028984: + ldr r0, _080289B0 + 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 obj_anim_image_start +_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 + .align 2, 0 +_080289B0: .4byte 0x02022cf4 +_080289B4: + ldr r0, _080289E0 + 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, _080289E4 + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + 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 + .align 2, 0 +_080289E0: .4byte 0x02022cf4 +_080289E4: .4byte 0x02020630 + 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, _08028A2C + movs r1, 0x1 + ands r0, r1 + lsls r4, r0, 2 + movs r6, 0x5 + negs r6, r6 + ldr r5, _08028A30 +_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 + .align 2, 0 +_08028A2C: .4byte 0x02020630 +_08028A30: .4byte 0x02022cf4 + 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 malloc_and_clear + adds r4, r0, 0 + ldr r0, _08028A80 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, _08028A84 + 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 gpu_tile_obj_alloc_tag_and_copy_to_vram +_08028A6A: + add r0, sp, 0x8 + bl gpu_pal_obj_alloc_tag_and_apply + adds r0, r4, 0 + bl free + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08028A80: .4byte 0x082fb314 +_08028A84: .4byte 0x082f7eb0 + 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, _08028B18 + 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, _08028B1C + 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 malloc_and_clear + ldr r1, _08028B20 + 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 obj_add_from_template_forward_search + 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, _08028B24 + ldr r4, _08028B28 + mov r8, r4 +_08028AF0: + movs r0, 0x4 + bl malloc_and_clear + 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 obj_add_from_template_forward_search + ldr r1, [r7, 0xC] + b _08028B40 + .align 2, 0 +_08028B18: .4byte 0x082fb324 +_08028B1C: .4byte 0x082fb33c +_08028B20: .4byte 0x02022cb8 +_08028B24: .4byte 0x02022ce4 +_08028B28: .4byte 0x082fb31c +_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 obj_add_from_template_forward_search + 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, _08028B7C + adds r0, r1 + adds r1, r5, 0 + bl obj_anim_image_start + 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 + .align 2, 0 +_08028B7C: .4byte 0x02020630 + thumb_func_end sub_8028A88 + + thumb_func_start sub_8028B80 +sub_8028B80: @ 8028B80 + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08028BEC +_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, _08028BF0 + adds r0, r1 + cmp r0, 0 + beq _08028BA0 + bl obj_delete_and_free_tiles +_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, _08028BF4 +_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, _08028BF0 + adds r0, r1 + cmp r0, 0 + beq _08028BD2 + bl obj_delete_and_free_tiles +_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 + .align 2, 0 +_08028BEC: .4byte 0x02022cb8 +_08028BF0: .4byte 0x02020630 +_08028BF4: .4byte 0x02022ce4 + thumb_func_end sub_8028B80 + + thumb_func_start sub_8028BF8 +sub_8028BF8: @ 8028BF8 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _08028C28 + ldr r2, _08028C2C + 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 + .align 2, 0 +_08028C28: .4byte 0x02020630 +_08028C2C: .4byte 0x02022cb8 + 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, _08028C74 + ldr r6, _08028C78 + 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 + .align 2, 0 +_08028C74: .4byte 0x02020630 +_08028C78: .4byte 0x02022ce4 + thumb_func_end sub_8028C30 + + thumb_func_start sub_8028C7C +sub_8028C7C: @ 8028C7C + lsls r0, 24 + lsls r1, 24 + ldr r3, _08028C9C + ldr r2, _08028CA0 + 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 + .align 2, 0 +_08028C9C: .4byte 0x02020630 +_08028CA0: .4byte 0x02022cb8 + 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, _08028CC8 + lsrs r0, 14 + adds r0, r2 + ldr r0, [r0] + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, _08028CCC + adds r0, r2 + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_08028CC8: .4byte 0x02022cb8 +_08028CCC: .4byte 0x02020630 + thumb_func_end sub_8028CA4 + + thumb_func_start sub_8028CD0 +sub_8028CD0: @ 8028CD0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08028CF0 + 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 + .align 2, 0 +_08028CF0: .4byte 0x02020630 + 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, _08028D3C + ldr r6, _08028D40 + 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 + .align 2, 0 +_08028D3C: .4byte 0x082fb354 +_08028D40: .4byte 0x02022cb0 + 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 malloc_and_clear + adds r6, r0, 0 + ldr r0, _08028DE8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, _08028DEC + 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, _08028DF0 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + add r0, sp, 0x20 + bl gpu_pal_obj_alloc_tag_and_apply + movs r5, 0 + ldr r7, _08028DF4 + adds r0, r7, 0x2 + mov r9, r0 + ldr r1, _08028DF8 + mov r8, r1 +_08028D9E: + movs r0, 0x4 + bl malloc_and_clear + 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 obj_add_from_template_forward_search + 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 + .align 2, 0 +_08028DE8: .4byte 0x082fb360 +_08028DEC: .4byte 0x082f9774 +_08028DF0: .4byte 0x082fb368 +_08028DF4: .4byte 0x082fb356 +_08028DF8: .4byte 0x02022cb0 + thumb_func_end sub_8028D44 + + thumb_func_start sub_8028DFC +sub_8028DFC: @ 8028DFC + push {r4-r7,lr} + movs r3, 0 + ldr r0, _08028E40 + mov r12, r0 + ldr r4, _08028E44 + adds r7, r4, 0x2 + ldr r6, _08028E48 + 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 + .align 2, 0 +_08028E40: .4byte 0x02022cb0 +_08028E44: .4byte 0x082fb356 +_08028E48: .4byte 0x02020630 + thumb_func_end sub_8028DFC + + thumb_func_start sub_8028E4C +sub_8028E4C: @ 8028E4C + push {r4,r5,lr} + movs r2, 0 + ldr r5, _08028E7C + ldr r4, _08028E80 + 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 + .align 2, 0 +_08028E7C: .4byte 0x02022cb0 +_08028E80: .4byte 0x02020630 + thumb_func_end sub_8028E4C + + thumb_func_start sub_8028E84 +sub_8028E84: @ 8028E84 + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08028EC0 +_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, _08028EC4 + adds r0, r1 + cmp r0, 0 + beq _08028EA4 + bl obj_delete_and_free_tiles +_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 + .align 2, 0 +_08028EC0: .4byte 0x02022cb0 +_08028EC4: .4byte 0x02020630 + 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, _08028F0C + ldr r6, _08028F10 + 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 + .align 2, 0 +_08028F0C: .4byte 0x02020630 +_08028F10: .4byte 0x02022cb0 + 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, _08028F30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08028F30: .4byte _08028F34 + .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, _08028F9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08028F9C: .4byte _08028FA0 + .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 gpu_copy_bg_tile_pattern_data_to_vram + 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, _0802906C + ldr r0, [r3] + movs r2, 0xC0 + lsls r2, 6 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r1, _08029070 + 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 + .align 2, 0 +_0802906C: .4byte 0x02022cf8 +_08029070: .4byte 0x00003014 + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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, _080292BC + str r0, [r4] + movs r2, 0xC0 + lsls r2, 6 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r3, _080292C0 + adds r1, r0, r3 + strb r2, [r1] + ldr r1, _080292C4 + 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, _080292C8 + movs r1, 0x3 + bl AddTask + ldr r1, [r4] + ldr r2, _080292CC + adds r1, r2 + strb r0, [r1] + ldr r0, _080292D0 + bl sub_802A72C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080292BC: .4byte 0x02022cf8 +_080292C0: .4byte 0x00003014 +_080292C4: .4byte 0x00003018 +_080292C8: .4byte sub_8029314 + 1 +_080292CC: .4byte 0x00003004 +_080292D0: .4byte sub_8029338 + 1 + thumb_func_end sub_8029274 + + thumb_func_start sub_80292D4 +sub_80292D4: @ 80292D4 + push {lr} + bl Window_FreeMemory + 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, _08029310 + 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 + .align 2, 0 +_08029310: .4byte 0x082fb40c + thumb_func_end sub_80292E0 + + thumb_func_start sub_8029314 +sub_8029314: @ 8029314 + push {lr} + ldr r0, _08029334 + 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 + .align 2, 0 +_08029334: .4byte 0x02022cf8 + thumb_func_end sub_8029314 + + thumb_func_start sub_8029338 +sub_8029338: @ 8029338 + push {lr} + ldr r0, _08029354 + ldr r1, [r0] + ldr r2, _08029358 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _08029430 + lsls r0, 2 + ldr r1, _0802935C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08029354: .4byte 0x02022cf8 +_08029358: .4byte 0x00003014 +_0802935C: .4byte _08029360 + .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, _0802938C + ldr r1, [r0] + ldr r2, _08029390 + adds r1, r2 + b _0802941C + .align 2, 0 +_0802938C: .4byte 0x02022cf8 +_08029390: .4byte 0x00003014 +_08029394: + ldr r1, _080293CC + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _080293D0 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _080293D4 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _08029414 + .align 2, 0 +_080293CC: .4byte 0x082faad8 +_080293D0: .4byte 0x082faf94 +_080293D4: .4byte 0x082fad44 +_080293D8: + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r0, _080293FC + ldr r1, [r0] + ldr r2, _08029400 + adds r1, r2 + b _0802941C + .align 2, 0 +_080293FC: .4byte 0x02022cf8 +_08029400: .4byte 0x00003014 +_08029404: + ldr r0, _08029424 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8028FF8 + bl sub_802902C +_08029414: + ldr r0, _08029428 + ldr r1, [r0] + ldr r0, _0802942C + adds r1, r0 +_0802941C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802943A + .align 2, 0 +_08029424: .4byte 0x03005d90 +_08029428: .4byte 0x02022cf8 +_0802942C: .4byte 0x00003014 +_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, _08029480 + ldr r0, [r4] + ldr r2, _08029484 + 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 + .align 2, 0 +_08029480: .4byte 0x02022cf8 +_08029484: .4byte 0x00003014 +_08029488: + bl sub_8027650 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080295C4 + subs r0, r7, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + ldr r2, _080295C8 + ldr r0, [sp, 0xC] + ands r0, r2 + ldr r1, _080295CC + 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, _080295D0 + ands r0, r1 + movs r1, 0xD0 + lsls r1, 4 + orrs r0, r1 + ldr r1, _080295D4 + 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, _080295D8 + 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 font_get_width_of_string + movs r1, 0x38 + subs r1, r0 + lsrs r1, 1 + str r1, [sp, 0x14] + ldrb r0, [r5] + lsls r0, 8 + ldr r2, _080295D0 + ldr r1, [sp, 0xC] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] + ldrb r2, [r5, 0x1] + lsls r2, 16 + ldr r0, _080295DC + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0xC] + add r0, sp, 0xC + bl Window_AddFromTemplate + 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 Window_FillTileMap + mov r3, r10 + ldr r0, [r3] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + 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, _080295E0 + 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 Window_CopyToVram + 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, _080295E4 + ldr r1, [r0] + ldr r0, _080295E8 + adds r1, r0 + b _0802962A + .align 2, 0 +_080295C4: .4byte 0x082fb3c8 +_080295C8: .4byte 0xffffff00 +_080295CC: .4byte 0x00ffffff +_080295D0: .4byte 0xffff00ff +_080295D4: .4byte 0x0000ffff +_080295D8: .4byte 0x00003008 +_080295DC: .4byte 0xff00ffff +_080295E0: .4byte 0x082fb380 +_080295E4: .4byte 0x02022cf8 +_080295E8: .4byte 0x00003014 +_080295EC: + bl is_dma3_queue_busy_with_gpu_copy + 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, _08029634 + adds r0, r1 + adds r0, r6 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r7 + bcc _08029604 +_0802961C: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _08029638 + ldr r1, [r0] + ldr r2, _0802963C + adds r1, r2 +_0802962A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802968E + .align 2, 0 +_08029634: .4byte 0x00003008 +_08029638: .4byte 0x02022cf8 +_0802963C: .4byte 0x00003014 +_08029640: + ldr r5, _080296A0 + ldr r0, [r5] + ldr r4, _080296A4 + adds r0, r4 + adds r0, r6 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r5] + adds r0, r4 + adds r0, r6 + ldrb r0, [r0] + bl Window_Remove + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _080296A0 + 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 + .align 2, 0 +_080296A0: .4byte 0x02022cf8 +_080296A4: .4byte 0x00003008 + 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, _08029870 + 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, _08029874 + 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 font_get_width_of_string + 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, _08029878 + 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, _0802987C + ldr r0, [r2] + add r0, r10 + ldrb r0, [r0] + ldr r2, _08029880 + ldr r3, [sp, 0x68] + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r3, _08029884 + 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, _0802987C + ldr r0, [r1] + add r0, r10 + ldrb r0, [r0] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + ldr r2, _08029888 + 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 decimal_int_to_string + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + adds r3, r0, 0 + ldr r2, _0802987C + 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, _0802987C + 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, _08029874 + 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 + .align 2, 0 +_08029870: .4byte 0x082fb45c +_08029874: .4byte 0x085ede5d +_08029878: .4byte 0x00003009 +_0802987C: .4byte 0x02022cf8 +_08029880: .4byte 0x082fb3dc +_08029884: .4byte 0x082fb402 +_08029888: .4byte 0x082fb380 + 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, _080298BC + ldr r1, [r6] + ldr r2, _080298C0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xB + bls _080298B2 + b _08029FA8 +_080298B2: + lsls r0, 2 + ldr r1, _080298C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080298BC: .4byte 0x02022cf8 +_080298C0: .4byte 0x00003014 +_080298C4: .4byte _080298C8 + .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, _0802990C + ldr r1, [r0] + ldr r0, _08029910 + adds r2, r1, r0 + movs r0, 0 + strh r0, [r2] + b _08029F8A + .align 2, 0 +_0802990C: .4byte 0x02022cf8 +_08029910: .4byte 0x0000301c +_08029914: + ldr r6, _0802995C + adds r0, r6, 0 + bl Window_AddFromTemplate + ldr r4, _08029960 + ldr r1, [r4] + ldr r2, _08029964 + mov r8, r2 + add r1, r8 + strb r0, [r1] + movs r0, 0x8 + adds r0, r6 + mov r9, r0 + bl Window_AddFromTemplate + ldr r1, [r4] + ldr r5, _08029968 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + add r0, r8 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl Window_FillTileMap + adds r0, r6, 0 + bl sub_8029174 + mov r0, r9 + bl sub_8029174 + b _08029F88 + .align 2, 0 +_0802995C: .4byte 0x082f7bbc +_08029960: .4byte 0x02022cf8 +_08029964: .4byte 0x00003008 +_08029968: .4byte 0x00003009 +_0802996C: + ldr r4, _08029AB4 + ldr r0, [r4] + ldr r5, _08029AB8 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r4] + ldr r1, _08029ABC + mov r9, r1 + add r0, r9 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _08029AC0 + mov r8, r2 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + mov r1, r8 + bl font_get_width_of_string + 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, _08029AC4 + 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, _08029AB4 + ldr r0, [r0] + ldr r1, _08029ABC + adds r0, r1 + ldrb r0, [r0] + mov r2, r9 + lsls r5, r2, 1 + ldr r2, _08029AC8 + adds r1, r5, r2 + ldrb r3, [r1] + lsls r1, r4, 1 + adds r1, r4 + ldr r2, _08029ACC + 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, _08029AD0 + mov r10, r1 +_08029A36: + mov r0, r9 + adds r1, r7, 0 + bl sub_80276A0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08029AD4 + bl sub_8027A38 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl sub_802778C + ldr r1, _08029AD4 + bl sub_8027A38 + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + movs r0, 0x1 + mov r1, r10 + movs r2, 0x1 + negs r2, r2 + bl font_get_width_of_string + adds r5, r0, 0 + cmp r6, r4 + bne _08029AE0 + cmp r6, 0 + beq _08029AE0 + ldr r0, _08029AB4 + ldr r0, [r0] + ldr r2, _08029ABC + adds r0, r2 + ldrb r0, [r0] + lsls r1, r7, 1 + ldr r2, _08029AD8 + adds r1, r2 + ldrb r2, [r1] + subs r2, r5 + lsls r2, 24 + lsrs r2, 24 + ldr r1, _08029AC8 + add r1, r8 + ldrb r3, [r1] + ldr r1, _08029ADC + 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 + .align 2, 0 +_08029AB4: .4byte 0x02022cf8 +_08029AB8: .4byte 0x00003008 +_08029ABC: .4byte 0x00003009 +_08029AC0: .4byte 0x085edd49 +_08029AC4: .4byte 0x085edd6b +_08029AC8: .4byte 0x082fb3f8 +_08029ACC: .4byte 0x082fb380 +_08029AD0: .4byte 0x02021fc4 +_08029AD4: .4byte 0x0000270f +_08029AD8: .4byte 0x082fb3f0 +_08029ADC: .4byte 0x082fb383 +_08029AE0: + ldr r0, _08029B50 + ldr r0, [r0] + ldr r2, _08029B54 + adds r0, r2 + ldrb r0, [r0] + lsls r1, r7, 1 + ldr r2, _08029B58 + adds r1, r2 + ldrb r3, [r1] + subs r3, r5 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _08029B5C + 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, _08029B60 + 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, _08029B50 + ldr r0, [r4] + ldr r1, _08029B64 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, [r4] + ldr r2, _08029B54 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r1, [r4] + ldr r0, _08029B68 + adds r1, r0 + b _08029F8E + .align 2, 0 +_08029B50: .4byte 0x02022cf8 +_08029B54: .4byte 0x00003009 +_08029B58: .4byte 0x082fb3f0 +_08029B5C: .4byte 0x082fb3f8 +_08029B60: .4byte 0x02021fc4 +_08029B64: .4byte 0x00003008 +_08029B68: .4byte 0x00003014 +_08029B6C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08029B90 + ldr r4, _08029BA8 + ldr r0, [r4] + ldr r1, _08029BAC + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r4] + ldr r2, _08029BB0 + adds r0, r2 + ldrb r0, [r0] + bl Window_WriteStandardTileMap +_08029B90: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl sub_8028C30 + ldr r0, _08029BA8 + ldr r1, [r0] + ldr r0, _08029BB4 + adds r1, r0 + b _08029F8E + .align 2, 0 +_08029BA8: .4byte 0x02022cf8 +_08029BAC: .4byte 0x00003008 +_08029BB0: .4byte 0x00003009 +_08029BB4: .4byte 0x00003014 +_08029BB8: + ldr r4, _08029BF0 + ldr r0, [r4] + ldr r1, _08029BF4 + 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, _08029BF8 + 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 + .align 2, 0 +_08029BF0: .4byte 0x02022cf8 +_08029BF4: .4byte 0x0000301c +_08029BF8: .4byte 0x030022c0 +_08029BFC: + ldr r4, _08029C50 + ldr r0, [r4] + ldr r5, _08029C54 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r4] + ldr r1, _08029C58 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r6, _08029C5C + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r6, 0 + bl font_get_width_of_string + 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 + .align 2, 0 +_08029C50: .4byte 0x02022cf8 +_08029C54: .4byte 0x00003008 +_08029C58: .4byte 0x00003009 +_08029C5C: .4byte 0x085edd86 +_08029C60: + ldr r0, [sp, 0xC] + bl sub_80296A8 + ldr r4, _08029C8C + ldr r0, [r4] + ldr r1, _08029C90 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, [r4] + ldr r2, _08029C94 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r1, [r4] + ldr r0, _08029C98 + adds r1, r0 + b _08029F8E + .align 2, 0 +_08029C8C: .4byte 0x02022cf8 +_08029C90: .4byte 0x00003008 +_08029C94: .4byte 0x00003009 +_08029C98: .4byte 0x00003014 +_08029C9C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08029CC0 + ldr r4, _08029CD0 + ldr r0, [r4] + ldr r1, _08029CD4 + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r4] + ldr r2, _08029CD8 + adds r0, r2 + ldrb r0, [r0] + bl Window_WriteStandardTileMap +_08029CC0: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _08029CD0 + ldr r1, [r0] + ldr r0, _08029CDC + adds r1, r0 + b _08029F8E + .align 2, 0 +_08029CD0: .4byte 0x02022cf8 +_08029CD4: .4byte 0x00003008 +_08029CD8: .4byte 0x00003009 +_08029CDC: .4byte 0x00003014 +_08029CE0: + ldr r4, _08029D28 + ldr r0, [r4] + ldr r1, _08029D2C + 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, _08029D30 + 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, _08029D34 + cmp r0, r1 + bhi _08029D3C + ldr r0, [r4] + ldr r2, _08029D38 + adds r0, r2 + movs r1, 0x7F + strb r1, [r0] + b _08029D4C + .align 2, 0 +_08029D28: .4byte 0x02022cf8 +_08029D2C: .4byte 0x0000301c +_08029D30: .4byte 0x030022c0 +_08029D34: .4byte 0x00000bb7 +_08029D38: .4byte 0x00003014 +_08029D3C: + bl sub_80A2F30 + ldr r1, [r4] + ldr r0, _08029D90 + 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 bg_fill_tilemap_rect + ldr r5, _08029D94 + ldr r0, [r5] + ldr r4, _08029D98 + adds r0, r4 + ldrb r0, [r0] + bl Window_Remove + ldr r6, _08029D9C + adds r0, r6, 0 + bl Window_AddFromTemplate + ldr r1, [r5] + adds r1, r4 + strb r0, [r1] + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_FillTileMap + adds r0, r6, 0 + bl sub_8029174 + b _08029FF8 + .align 2, 0 +_08029D90: .4byte 0x00003014 +_08029D94: .4byte 0x02022cf8 +_08029D98: .4byte 0x00003009 +_08029D9C: .4byte 0x082f7bcc +_08029DA0: + ldr r0, _08029E78 + bl current_map_music_set + ldr r4, _08029E7C + ldr r0, [r4] + ldr r6, _08029E80 + adds r0, r6 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r4] + ldr r1, _08029E84 + mov r10, r1 + add r0, r10 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r5, _08029E88 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r5, 0 + bl font_get_width_of_string + 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, _08029E8C + adds r1, r5, 0 + bl itemid_get_name + movs r0, 0 + adds r1, r5, 0 + bl sub_81AFC0C + ldr r7, _08029E90 + ldr r1, _08029E94 + 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, _08029E98 + adds r0, r7, 0 + bl sub_81AFC28 + b _08029EA8 + .align 2, 0 +_08029E78: .4byte 0x0000016f +_08029E7C: .4byte 0x02022cf8 +_08029E80: .4byte 0x00003008 +_08029E84: .4byte 0x00003009 +_08029E88: .4byte 0x085edd9b +_08029E8C: .4byte 0x02021cc4 +_08029E90: .4byte 0x02021fc4 +_08029E94: .4byte 0x085eddbd +_08029E98: .4byte 0x085edde2 +_08029E9C: + cmp r6, 0x1 + bne _08029EA8 + ldr r1, _08029EF0 + adds r0, r7, 0 + bl sub_81AFC28 +_08029EA8: + ldr r0, _08029EF4 + ldr r0, [r0] + ldr r2, _08029EF8 + adds r0, r2 + ldrb r0, [r0] + ldr r2, _08029EFC + 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, _08029EF4 + ldr r0, [r4] + ldr r1, _08029F00 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, [r4] + ldr r2, _08029EF8 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r1, [r4] + ldr r0, _08029F04 + adds r1, r0 + b _08029F8E + .align 2, 0 +_08029EF0: .4byte 0x085eddfb +_08029EF4: .4byte 0x02022cf8 +_08029EF8: .4byte 0x00003009 +_08029EFC: .4byte 0x02021fc4 +_08029F00: .4byte 0x00003008 +_08029F04: .4byte 0x00003014 +_08029F08: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08029F2C + ldr r4, _08029F48 + ldr r0, [r4] + ldr r1, _08029F4C + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r4] + ldr r2, _08029F50 + adds r0, r2 + ldrb r0, [r0] + bl Window_WriteStandardTileMap +_08029F2C: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _08029F54 + movs r1, 0x14 + movs r2, 0xA + bl sub_80A2FBC + ldr r0, _08029F48 + ldr r1, [r0] + ldr r0, _08029F58 + adds r1, r0 + b _08029F8E + .align 2, 0 +_08029F48: .4byte 0x02022cf8 +_08029F4C: .4byte 0x00003008 +_08029F50: .4byte 0x00003009 +_08029F54: .4byte 0x0000020b +_08029F58: .4byte 0x00003014 +_08029F5C: + ldr r4, _08029F98 + ldr r0, [r4] + ldr r1, _08029F9C + 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, _08029FA0 + 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, _08029FA4 + adds r1, r2 +_08029F8E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08029FF8 + .align 2, 0 +_08029F98: .4byte 0x02022cf8 +_08029F9C: .4byte 0x0000301c +_08029FA0: .4byte 0x030022c0 +_08029FA4: .4byte 0x00003014 +_08029FA8: + ldr r5, _0802A008 + adds r0, r1, r5 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r6] + ldr r4, _0802A00C + adds r0, r4 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl Window_Remove + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + bl Window_Remove + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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 + .align 2, 0 +_0802A008: .4byte 0x00003008 +_0802A00C: .4byte 0x00003009 + 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, _0802A038 + ldr r2, [r1] + ldr r3, _0802A03C + 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 + .align 2, 0 +_0802A038: .4byte 0x02022cf8 +_0802A03C: .4byte 0x00003014 +_0802A040: + cmp r6, 0x2 + bne _0802A046 + b _0802A194 +_0802A046: + cmp r6, 0x3 + bne _0802A04C + b _0802A1D0 +_0802A04C: + b _0802A2FC +_0802A04E: + ldr r0, _0802A0B4 + mov r9, r0 + bl Window_AddFromTemplate + ldr r1, [r7] + ldr r4, _0802A0B8 + adds r1, r4 + strb r0, [r1] + movs r1, 0x8 + add r1, r9 + mov r8, r1 + mov r0, r8 + bl Window_AddFromTemplate + ldr r1, [r7] + ldr r2, _0802A0BC + adds r1, r2 + strb r0, [r1] + ldr r0, [r7] + adds r0, r4 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r7] + ldr r3, _0802A0BC + adds r0, r3 + ldrb r0, [r0] + bl Window_FillTileMap + mov r0, r9 + bl sub_8029174 + mov r0, r8 + bl sub_8029074 + ldr r1, [r7] + ldr r0, _0802A0C0 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r7] + ldr r1, _0802A0C4 + adds r0, r1 + strb r6, [r0] + ldr r0, [r7] + ldr r2, _0802A0C8 + adds r0, r2 + strb r6, [r0] + b _0802A35E + .align 2, 0 +_0802A0B4: .4byte 0x082f7bd4 +_0802A0B8: .4byte 0x00003008 +_0802A0BC: .4byte 0x00003009 +_0802A0C0: .4byte 0x00003014 +_0802A0C4: .4byte 0x00003020 +_0802A0C8: .4byte 0x00003024 +_0802A0CC: + ldr r3, _0802A178 + mov r8, r3 + adds r0, r2, r3 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r7] + ldr r1, _0802A17C + mov r10, r1 + add r0, r10 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + ldr r2, _0802A180 + 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, _0802A184 + 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, _0802A188 + 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, _0802A18C + 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 Window_CopyToVram + ldr r0, [r7] + add r0, r10 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r1, [r7] + ldr r2, _0802A190 + adds r1, r2 + b _0802A2EA + .align 2, 0 +_0802A178: .4byte 0x00003008 +_0802A17C: .4byte 0x00003009 +_0802A180: .4byte 0x085ede18 +_0802A184: .4byte 0x085eae62 +_0802A188: .4byte 0x085eae66 +_0802A18C: .4byte 0x085e8d60 +_0802A190: .4byte 0x00003014 +_0802A194: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802A1B6 + ldr r0, [r7] + ldr r3, _0802A1C4 + adds r0, r3 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r7] + ldr r1, _0802A1C8 + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap +_0802A1B6: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, [r7] + ldr r2, _0802A1CC + adds r1, r2 + b _0802A2EA + .align 2, 0 +_0802A1C4: .4byte 0x00003008 +_0802A1C8: .4byte 0x00003009 +_0802A1CC: .4byte 0x00003014 +_0802A1D0: + ldr r3, _0802A27C + adds r0, r2, r3 + ldrb r5, [r0] + cmp r5, 0 + bne _0802A1DC + movs r5, 0x1 +_0802A1DC: + ldr r0, _0802A280 + mov r8, r0 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + ldr r2, _0802A284 + 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, _0802A288 + 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, _0802A28C + 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 Window_CopyToVram + ldr r0, _0802A290 + 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, _0802A27C + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0 + bne _0802A2E4 + strb r5, [r1] + b _0802A2E4 + .align 2, 0 +_0802A27C: .4byte 0x00003020 +_0802A280: .4byte 0x00003009 +_0802A284: .4byte 0x085eae62 +_0802A288: .4byte 0x085eae66 +_0802A28C: .4byte 0x085e8d60 +_0802A290: .4byte 0x030022c0 +_0802A294: + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0802A2CC + movs r0, 0x5 + bl audio_play + ldr r0, [r7] + ldr r2, _0802A2B8 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x1 + beq _0802A2C2 + cmp r0, 0x1 + bgt _0802A2BC + cmp r0, 0 + beq _0802A2C2 + b _0802A35E + .align 2, 0 +_0802A2B8: .4byte 0x00003020 +_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, _0802A2F4 + adds r0, r3 + movs r1, 0x2 + strb r1, [r0] +_0802A2E4: + ldr r1, [r7] + ldr r0, _0802A2F8 + adds r1, r0 +_0802A2EA: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A35E + .align 2, 0 +_0802A2F4: .4byte 0x00003020 +_0802A2F8: .4byte 0x00003014 +_0802A2FC: + ldr r0, [r7] + ldr r2, _0802A370 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r3, _0802A374 + adds r0, r3 + strb r1, [r0] + ldr r0, [r7] + ldr r6, _0802A378 + adds r0, r6 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r7] + ldr r1, _0802A37C + adds r0, r1 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r7] + adds r0, r6 + ldrb r0, [r0] + bl Window_Remove + ldr r0, [r7] + ldr r2, _0802A37C + adds r0, r2 + ldrb r0, [r0] + bl Window_Remove + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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 + .align 2, 0 +_0802A370: .4byte 0x00003020 +_0802A374: .4byte 0x00003024 +_0802A378: .4byte 0x00003008 +_0802A37C: .4byte 0x00003009 + thumb_func_end sub_802A010 + + thumb_func_start sub_802A380 +sub_802A380: @ 802A380 + push {r4-r6,lr} + sub sp, 0x10 + ldr r5, _0802A39C + ldr r0, [r5] + ldr r6, _0802A3A0 + adds r0, r6 + ldrb r4, [r0] + cmp r4, 0x1 + beq _0802A3D8 + cmp r4, 0x1 + bgt _0802A3A4 + cmp r4, 0 + beq _0802A3AE + b _0802A420 + .align 2, 0 +_0802A39C: .4byte 0x02022cf8 +_0802A3A0: .4byte 0x00003014 +_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, _0802A3D4 + 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 text_box_related_one + b _0802A410 + .align 2, 0 +_0802A3D4: .4byte 0x082c8959 +_0802A3D8: + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, [r5] + ldr r0, _0802A3E8 + adds r1, r0 + b _0802A414 + .align 2, 0 +_0802A3E8: .4byte 0x00003014 +_0802A3EC: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802A448 + ldr r0, _0802A400 + movs r1, 0 + bl AddTask + b _0802A410 + .align 2, 0 +_0802A400: .4byte sub_8153688 + 1 +_0802A404: + ldr r0, _0802A41C + 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 + .align 2, 0 +_0802A41C: .4byte sub_8153688 + 1 +_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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0802A450 + 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 + .align 2, 0 +_0802A450: .4byte 0x02022cf8 + thumb_func_end sub_802A380 + + thumb_func_start sub_802A454 +sub_802A454: @ 802A454 + push {r4-r6,lr} + sub sp, 0xC + ldr r1, _0802A474 + ldr r2, [r1] + ldr r6, _0802A478 + 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 + .align 2, 0 +_0802A474: .4byte 0x02022cf8 +_0802A478: .4byte 0x00003014 +_0802A47C: + cmp r0, 0x2 + beq _0802A4F4 + b _0802A520 +_0802A482: + ldr r4, _0802A4A4 + adds r0, r4, 0 + bl Window_AddFromTemplate + ldr r1, [r5] + ldr r2, _0802A4A8 + adds r1, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r2 + ldrb r0, [r0] + bl Window_FillTileMap + adds r0, r4, 0 + bl sub_8029174 + b _0802A510 + .align 2, 0 +_0802A4A4: .4byte 0x082f7bec +_0802A4A8: .4byte 0x00003008 +_0802A4AC: + ldr r4, _0802A4E8 + adds r0, r2, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + ldr r2, _0802A4EC + 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 Window_CopyToVram + ldr r1, [r5] + ldr r0, _0802A4F0 + adds r1, r0 + b _0802A514 + .align 2, 0 +_0802A4E8: .4byte 0x00003008 +_0802A4EC: .4byte 0x085ede65 +_0802A4F0: .4byte 0x00003014 +_0802A4F4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802A50A + ldr r0, [r5] + ldr r1, _0802A51C + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap +_0802A50A: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_0802A510: + ldr r1, [r5] + adds r1, r6 +_0802A514: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A52C + .align 2, 0 +_0802A51C: .4byte 0x00003008 +_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, _0802A580 + ldr r0, [r5] + ldr r4, _0802A584 + adds r0, r4 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_Remove + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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 + .align 2, 0 +_0802A580: .4byte 0x02022cf8 +_0802A584: .4byte 0x00003008 + thumb_func_end sub_802A534 + + thumb_func_start sub_802A588 +sub_802A588: @ 802A588 + push {r4-r7,lr} + sub sp, 0xC + ldr r0, _0802A5A8 + ldr r1, [r0] + ldr r7, _0802A5AC + 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 + .align 2, 0 +_0802A5A8: .4byte 0x02022cf8 +_0802A5AC: .4byte 0x00003014 +_0802A5B0: + cmp r5, 0x2 + beq _0802A658 + cmp r5, 0x3 + beq _0802A684 + b _0802A6A4 +_0802A5BA: + ldr r4, _0802A600 + adds r0, r4, 0 + bl Window_AddFromTemplate + ldr r1, [r6] + ldr r2, _0802A604 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldrb r0, [r0] + bl Window_FillTileMap + 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, _0802A608 + adds r1, r0, r2 + movs r2, 0 + strh r5, [r1] + ldr r1, _0802A60C + adds r0, r1 + strb r2, [r0] + ldr r0, [r6] + adds r1, 0x4 + adds r0, r1 + strb r2, [r0] + b _0802A6EA + .align 2, 0 +_0802A600: .4byte 0x082f7be4 +_0802A604: .4byte 0x00003008 +_0802A608: .4byte 0x0000301c +_0802A60C: .4byte 0x00003020 +_0802A610: + ldr r4, _0802A64C + adds r0, r1, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ldr r2, _0802A650 + 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 Window_CopyToVram + ldr r1, [r6] + ldr r2, _0802A654 + adds r1, r2 + b _0802A678 + .align 2, 0 +_0802A64C: .4byte 0x00003008 +_0802A650: .4byte 0x085ede2c +_0802A654: .4byte 0x00003014 +_0802A658: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802A66E + ldr r0, [r6] + ldr r1, _0802A680 + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap +_0802A66E: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, [r6] + adds r1, r7 +_0802A678: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A6EA + .align 2, 0 +_0802A680: .4byte 0x00003008 +_0802A684: + ldr r0, _0802A6A0 + 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 + .align 2, 0 +_0802A6A0: .4byte 0x0000301c +_0802A6A4: + ldr r0, [r6] + ldr r1, _0802A6F4 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + ldr r0, [r6] + ldr r4, _0802A6F8 + adds r0, r4 + ldrb r0, [r0] + bl Window_FillTileMap + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + bl Window_Remove + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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 + .align 2, 0 +_0802A6F4: .4byte 0x00003024 +_0802A6F8: .4byte 0x00003008 + thumb_func_end sub_802A588 + + thumb_func_start unused_0 +unused_0: @ 802A6FC + push {r4,lr} + ldr r4, _0802A720 + ldr r0, [r4] + ldr r1, _0802A724 + 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 + .align 2, 0 +_0802A720: .4byte 0x02022cf8 +_0802A724: .4byte 0x00003004 + 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, _0802A750 + ldr r1, [r2] + ldr r3, _0802A754 + 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, _0802A758 + adds r1, r2 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802A750: .4byte 0x02022cf8 +_0802A754: .4byte 0x00003014 +_0802A758: .4byte 0x00003028 + thumb_func_end sub_802A72C + + thumb_func_start sub_802A75C +sub_802A75C: @ 802A75C + ldr r0, _0802A768 + ldr r0, [r0] + ldr r1, _0802A76C + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0802A768: .4byte 0x02022cf8 +_0802A76C: .4byte 0x00003028 + thumb_func_end sub_802A75C + + thumb_func_start sub_802A770 +sub_802A770: @ 802A770 + push {lr} + ldr r0, _0802A788 + 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 + .align 2, 0 +_0802A788: .4byte 0x02022cf8 +_0802A78C: + movs r0, 0 +_0802A78E: + pop {r1} + bx r1 + thumb_func_end sub_802A770 + + thumb_func_start sub_802A794 +sub_802A794: @ 802A794 + ldr r0, _0802A7A0 + ldr r0, [r0] + ldr r1, _0802A7A4 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0802A7A0: .4byte 0x02022cf8 +_0802A7A4: .4byte 0x00003024 + 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, _0802A8D8 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _0802A8DC + 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, _0802A8D8 + 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 lcd_io_set + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0802A8E0 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + bl sub_81971D0 + bl sub_8197200 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r4, _0802A8E4 + ldr r1, [r4] + movs r0, 0x3 + bl bg_set_tilemap + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 6 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802A8D8: .4byte 0x040000d4 +_0802A8DC: .4byte 0x81000800 +_0802A8E0: .4byte 0x082f7ba4 +_0802A8E4: .4byte 0x02022cf8 + thumb_func_end sub_802A7A8 + + thumb_func_start sub_802A8E8 +sub_802A8E8: @ 802A8E8 + push {lr} + sub sp, 0x4 + ldr r0, _0802A904 + ldr r0, [r0] + ldr r2, _0802A908 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x5 + bhi _0802A982 + lsls r0, 2 + ldr r1, _0802A90C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802A904: .4byte 0x02022cf8 +_0802A908: .4byte 0x00003018 +_0802A90C: .4byte _0802A910 + .align 2, 0 +_0802A910: + .4byte _0802A928 + .4byte _0802A938 + .4byte _0802A93E + .4byte _0802A94C + .4byte _0802A964 + .4byte _0802A972 +_0802A928: + ldr r0, _0802A934 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + b _0802A98A + .align 2, 0 +_0802A934: .4byte 0x082f7df0 +_0802A938: + bl reset_temp_tile_data_buffers + b _0802A98A +_0802A93E: + ldr r1, _0802A948 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + b _0802A954 + .align 2, 0 +_0802A948: .4byte 0x082f8084 +_0802A94C: + ldr r1, _0802A960 + 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 + .align 2, 0 +_0802A960: .4byte 0x082f8914 +_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, _0802A9A0 + ldr r1, [r0] + ldr r0, _0802A9A4 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0802A998: + movs r0, 0 +_0802A99A: + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_0802A9A0: .4byte 0x02022cf8 +_0802A9A4: .4byte 0x00003018 + 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, _0802AA20 + ldrb r0, [r0] + cmp r0, 0 + beq _0802AA3C + ldr r5, _0802AA24 + ldr r0, _0802AA28 + bl malloc + str r0, [r5] + cmp r0, 0 + beq _0802AA3C + bl clear_tasks + ldr r0, _0802AA2C + 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, _0802AA30 + adds r1, r2 + adds r0, r1 + movs r1, 0x64 + muls r1, r7 + ldr r2, _0802AA34 + 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, _0802AA38 + bl set_callback2 + b _0802AA42 + .align 2, 0 +_0802AA20: .4byte 0x03003124 +_0802AA24: .4byte 0x02022cfc +_0802AA28: .4byte 0x000083b0 +_0802AA2C: .4byte sub_802ACA0 + 1 +_0802AA30: .4byte 0x000082a8 +_0802AA34: .4byte 0x020244ec +_0802AA38: .4byte sub_802AC6C + 1 +_0802AA3C: + adds r0, r6, 0 + bl set_callback2 +_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, _0802AA5C + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_0802AA5C: .4byte 0x02022cfc + 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, _0802AB80 + movs r6, 0 + movs r5, 0 + ldr r0, _0802AB84 + mov r8, r0 + movs r4, 0x4 +_0802AB32: + ldr r0, [r7] + adds r0, r5 + ldr r1, _0802AB88 + 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, _0802AB8C + adds r1, r2 + strh r0, [r1] + adds r6, 0x28 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _0802AB32 + ldr r0, _0802AB80 + ldr r1, [r0] + ldr r0, _0802AB90 + adds r3, r1, r0 + ldrb r2, [r1, 0x6] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r2, _0802AB94 + adds r0, r2 + adds r1, r0 + str r1, [r3] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802AB80: .4byte 0x02022cfc +_0802AB84: .4byte 0x082fb464 +_0802AB88: .4byte 0x000082a8 +_0802AB8C: .4byte 0x000082f0 +_0802AB90: .4byte 0x000083ac +_0802AB94: .4byte 0x000082e4 + thumb_func_end sub_802AB20 + + thumb_func_start sub_802AB98 +sub_802AB98: @ 802AB98 + push {r4-r7,lr} + movs r5, 0 + ldr r6, _0802ABE8 + movs r4, 0 + movs r3, 0 +_0802ABA2: + ldr r2, [r6] + adds r1, r2, r3 + ldr r7, _0802ABEC + adds r0, r1, r7 + strh r4, [r0] + adds r7, 0x2 + adds r0, r1, r7 + strh r4, [r0] + ldr r0, _0802ABF0 + adds r1, r0 + strh r4, [r1] + ldr r1, _0802ABF4 + adds r0, r2, r1 + adds r0, r3 + str r4, [r0] + subs r7, 0xC + adds r0, r2, r7 + adds r0, r3 + ldr r1, _0802ABF8 + str r1, [r0] + ldr r1, _0802ABFC + 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 + .align 2, 0 +_0802ABE8: .4byte 0x02022cfc +_0802ABEC: .4byte 0x000082f2 +_0802ABF0: .4byte 0x000082f6 +_0802ABF4: .4byte 0x000082e4 +_0802ABF8: .4byte 0x7fffffff +_0802ABFC: .4byte 0x000082f8 + 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, _0802AC18 +_0802AC0A: + ldrh r0, [r2] + cmp r0, r3 + bne _0802AC1C + lsls r0, r1, 16 + asrs r0, 16 + b _0802AC28 + .align 2, 0 +_0802AC18: .4byte 0x082fb464 +_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 copy_super_sprites_to_oam + bl copy_queue_process + pop {r0} + bx r0 + thumb_func_end sub_802AC58 + + thumb_func_start sub_802AC6C +sub_802AC6C: @ 802AC6C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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, _0802AC9C + ldr r1, [r2] + movs r3, 0 + strb r0, [r1, 0x4] + ldr r0, [r2] + strh r3, [r0, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_0802AC9C: .4byte 0x02022cfc + 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, _0802ACC0 + ldr r0, [r1] + ldrh r0, [r0, 0x8] + adds r2, r1, 0 + cmp r0, 0x5 + bls _0802ACB6 + b _0802AE08 +_0802ACB6: + lsls r0, 2 + ldr r1, _0802ACC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802ACC0: .4byte 0x02022cfc +_0802ACC4: .4byte _0802ACC8 + .align 2, 0 +_0802ACC8: + .4byte _0802ACE0 + .4byte _0802AD0C + .4byte _0802AD3C + .4byte _0802AD68 + .4byte _0802ADA4 + .4byte _0802ADD0 +_0802ACE0: + movs r0, 0 + bl SetVBlankCallback + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _0802AD04 + movs r1, 0x5 + bl sub_802BE60 + movs r0, 0x4 + bl sub_80A2F50 + ldr r0, _0802AD08 + ldr r1, [r0] + b _0802ADC0 + .align 2, 0 +_0802AD04: .4byte sub_802BD84 + 1 +_0802AD08: .4byte 0x02022cfc +_0802AD0C: + ldr r0, _0802AD34 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0802AE08 + ldr r4, _0802AD38 + 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 + .align 2, 0 +_0802AD34: .4byte sub_802BD84 + 1 +_0802AD38: .4byte 0x02022cfc +_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, _0802AD60 + movs r1, 0x8 + bl sub_80A2F88 + ldr r0, _0802AD64 + ldr r1, [r0] + b _0802ADC0 + .align 2, 0 +_0802AD60: .4byte 0x0000021a +_0802AD64: .4byte 0x02022cfc +_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 sub_80A1AD4 + ldr r0, _0802AD9C + bl SetVBlankCallback + ldr r0, _0802ADA0 + ldr r1, [r0] + b _0802ADC0 + .align 2, 0 +_0802AD9C: .4byte sub_802AC58 + 1 +_0802ADA0: .4byte 0x02022cfc +_0802ADA4: + bl fade_and_return_progress_probably + ldr r0, _0802ADC8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0802AE08 + ldr r1, _0802ADCC + ldr r0, [r1] + strb r2, [r0, 0x7] + ldr r1, [r1] +_0802ADC0: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802AE08 + .align 2, 0 +_0802ADC8: .4byte 0x02037fd4 +_0802ADCC: .4byte 0x02022cfc +_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, _0802ADF4 + bl sub_802AC84 + b _0802ADFE + .align 2, 0 +_0802ADF4: .4byte sub_802AF80 + 1 +_0802ADF8: + ldr r0, _0802AE10 + bl sub_802AC84 +_0802ADFE: + bl sub_802BE80 + adds r0, r4, 0 + bl remove_task +_0802AE08: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802AE10: .4byte sub_802B194 + 1 + 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, _0802AE2C + ldr r1, [r0] + ldr r0, _0802AE30 + str r0, [r1, 0x30] + movs r0, 0x1 + str r0, [r1, 0x2C] + b _0802AE46 + .align 2, 0 +_0802AE2C: .4byte 0x02022cfc +_0802AE30: .4byte 0x00001111 +_0802AE34: + ldr r0, _0802AE4C + 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 + .align 2, 0 +_0802AE4C: .4byte 0x02022cfc + thumb_func_end sub_802AE14 + + thumb_func_start sub_802AE50 +sub_802AE50: @ 802AE50 + push {r4-r6,lr} + ldr r4, _0802AE9C + 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, _0802AEA0 + 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 + .align 2, 0 +_0802AE9C: .4byte 0x02022cfc +_0802AEA0: .4byte 0x000082fc + 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, _0802AF6C + 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, _0802AF70 + mov r9, r3 + movs r6, 0x28 +_0802AED0: + mov r1, r10 + ldr r0, [r1] + adds r1, r0, r6 + ldr r2, _0802AF74 + 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, _0802AF78 + adds r0, r1 + strh r5, [r0] +_0802AF10: + mov r2, r10 + ldr r1, [r2] + ldr r3, _0802AF7C + 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, _0802AF6C + ldr r0, [r7] + ldrb r0, [r0, 0x5] + cmp r4, r0 + blt _0802AED0 +_0802AF48: + ldr r2, _0802AF6C + 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 + .align 2, 0 +_0802AF6C: .4byte 0x02022cfc +_0802AF70: .4byte 0x0000830c +_0802AF74: .4byte 0x000082f4 +_0802AF78: .4byte 0x000082f6 +_0802AF7C: .4byte 0x000082fc + 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, _0802AFFC + 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, _0802AFFC + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x48 + ldrb r5, [r0] + cmp r5, 0x1 + bne _0802AFEE + ldr r1, _0802B000 + 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, _0802B004 + adds r1, r2 + adds r1, r0 + str r5, [r1] +_0802AFEE: + bl sub_802C1DC + bl sub_802B008 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802AFFC: .4byte 0x02022cfc +_0802B000: .4byte 0x082fb5f4 +_0802B004: .4byte 0x000082fc + thumb_func_end sub_802AF80 + + thumb_func_start sub_802B008 +sub_802B008: @ 802B008 + push {r4,lr} + ldr r4, _0802B038 + ldr r1, [r4] + ldr r0, [r1, 0x2C] + cmp r0, 0 + bne _0802B01E + ldr r2, _0802B03C + adds r0, r1, r2 + adds r1, 0x70 + bl sub_802E138 +_0802B01E: + ldr r1, [r4] + ldr r2, [r1, 0x30] + ldr r0, _0802B040 + 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 + .align 2, 0 +_0802B038: .4byte 0x02022cfc +_0802B03C: .4byte 0x000082e4 +_0802B040: .4byte 0x00001111 + thumb_func_end sub_802B008 + + thumb_func_start sub_802B044 +sub_802B044: @ 802B044 + ldr r2, _0802B070 + 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, _0802B074 + adds r1, r2 + adds r1, r0 + str r3, [r1] + bx lr + .align 2, 0 +_0802B070: .4byte 0x02022cfc +_0802B074: .4byte 0x000082fc + 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, _0802B0F4 + ldr r0, [r4] + ldr r2, _0802B0F8 + adds r1, r0, r2 + ldrh r1, [r1] + mov r8, r1 + ldr r3, _0802B0FC + 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, _0802B100 + 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, _0802B0F4 + 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 + .align 2, 0 +_0802B0F4: .4byte 0x02022cfc +_0802B0F8: .4byte 0x000082f4 +_0802B0FC: .4byte 0x000082e4 +_0802B100: .4byte 0x000082fc +_0802B104: + adds r0, 0x4D + strb r1, [r0] +_0802B108: + ldr r0, _0802B184 + 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, _0802B188 + adds r1, r0 + mov r2, r8 + strh r2, [r1] +_0802B128: + movs r4, 0x1 + ldr r2, _0802B184 + ldr r0, [r2] + ldrb r0, [r0, 0x5] + cmp r4, r0 + bge _0802B176 + adds r7, r2, 0 + ldr r6, _0802B18C + movs r5, 0x28 +_0802B13A: + ldr r1, [r7] + ldrb r3, [r1, 0x6] + cmp r4, r3 + beq _0802B168 + adds r0, r1, r5 + ldr r3, _0802B190 + 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, _0802B188 + 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 + .align 2, 0 +_0802B184: .4byte 0x02022cfc +_0802B188: .4byte 0x000082f6 +_0802B18C: .4byte 0x0000830c +_0802B190: .4byte 0x000082f4 + thumb_func_end sub_802B078 + + thumb_func_start sub_802B194 +sub_802B194: @ 802B194 + push {r4,lr} + bl sub_802B078 + ldr r4, _0802B1F0 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0 + beq _0802B1E0 + ldr r1, _0802B1F4 + 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, _0802B1F8 + 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 + .align 2, 0 +_0802B1F0: .4byte 0x02022cfc +_0802B1F4: .4byte 0x082fb618 +_0802B1F8: .4byte 0x000082fc + thumb_func_end sub_802B194 + + thumb_func_start sub_802B1FC +sub_802B1FC: @ 802B1FC + push {r4,lr} + ldr r4, _0802B23C + 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, _0802B240 + 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, _0802B244 + 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 + .align 2, 0 +_0802B23C: .4byte 0x02022cfc +_0802B240: .4byte 0x000082e4 +_0802B244: .4byte 0x00001111 + thumb_func_end sub_802B1FC + + thumb_func_start sub_802B248 +sub_802B248: @ 802B248 + push {r4,lr} + ldr r4, _0802B25C + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B260 + cmp r0, 0x1 + beq _0802B26E + b _0802B294 + .align 2, 0 +_0802B25C: .4byte 0x02022cfc +_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, _0802B290 + 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 + .align 2, 0 +_0802B290: .4byte 0x02022cfc +_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, _0802B2B0 + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B2B4 + cmp r0, 0x1 + beq _0802B2CA + movs r0, 0x1 + b _0802B2CE + .align 2, 0 +_0802B2B0: .4byte 0x02022cfc +_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, _0802B2E8 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _0802B2EC + cmp r0, 0x1 + beq _0802B300 + b _0802B314 + .align 2, 0 +_0802B2E8: .4byte 0x02022cfc +_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, _0802B330 + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B334 + cmp r0, 0x1 + beq _0802B352 + b _0802B35E + .align 2, 0 +_0802B330: .4byte 0x02022cfc +_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, _0802B38C + 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 + .align 2, 0 +_0802B38C: .4byte 0x02022cfc +_0802B390: + bl sub_802C538 + cmp r0, 0 + beq _0802B39C + movs r0, 0x1 + b _0802B3AC +_0802B39C: + bl sub_802C0B8 + ldr r0, _0802B3B0 + ldr r0, [r0] + adds r0, 0x4C + movs r1, 0x3 + strb r1, [r0] +_0802B3AA: + movs r0, 0 +_0802B3AC: + pop {r1} + bx r1 + .align 2, 0 +_0802B3B0: .4byte 0x02022cfc + 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, _0802B3EC + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0x1 + beq _0802B40C + cmp r0, 0x1 + bgt _0802B3F0 + cmp r0, 0 + beq _0802B3F6 + b _0802B468 + .align 2, 0 +_0802B3EC: .4byte 0x02022cfc +_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, _0802B464 + ldr r1, [r0] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B460: + movs r0, 0 + b _0802B46A + .align 2, 0 +_0802B464: .4byte 0x02022cfc +_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, _0802B488 + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0x1 + beq _0802B4B0 + cmp r0, 0x1 + bgt _0802B48C + cmp r0, 0 + beq _0802B492 + b _0802B4C4 + .align 2, 0 +_0802B488: .4byte 0x02022cfc +_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, _0802B4E4 + ldr r0, [r4] + ldrh r1, [r0, 0x8] + cmp r1, 0x1 + beq _0802B500 + cmp r1, 0x1 + bgt _0802B4E8 + cmp r1, 0 + beq _0802B4F2 + b _0802B560 + .align 2, 0 +_0802B4E4: .4byte 0x02022cfc +_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, _0802B528 + 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 + .align 2, 0 +_0802B528: .4byte 0x02022cfc +_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, _0802B55C + ldr r1, [r0] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B556: + movs r0, 0 + b _0802B562 + .align 2, 0 +_0802B55C: .4byte 0x02022cfc +_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, _0802B57C + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B580 + cmp r0, 0x1 + beq _0802B58E + b _0802B5C0 + .align 2, 0 +_0802B57C: .4byte 0x02022cfc +_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, _0802B5BC + 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 + .align 2, 0 +_0802B5BC: .4byte 0x02022cfc +_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, _0802B5DC + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _0802B5E0 + cmp r0, 0x1 + beq _0802B5F2 + b _0802B61E + .align 2, 0 +_0802B5DC: .4byte 0x02022cfc +_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, _0802B63C + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B640 + cmp r0, 0x1 + beq _0802B656 + b _0802B65A + .align 2, 0 +_0802B63C: .4byte 0x02022cfc +_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, _0802B67C + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0x1 + beq _0802B68C + cmp r0, 0x1 + bgt _0802B680 + cmp r0, 0 + beq _0802B686 + b _0802B6B0 + .align 2, 0 +_0802B67C: .4byte 0x02022cfc +_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 set_callback2 + 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, _0802B6CC + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B6D0 + cmp r0, 0x1 + beq _0802B6E0 + b _0802B6FC + .align 2, 0 +_0802B6CC: .4byte 0x02022cfc +_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, _0802B738 + ldr r0, [r1] + ldrh r0, [r0, 0x8] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0802B7D8 + lsls r0, 2 + ldr r1, _0802B73C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802B738: .4byte 0x02022cfc +_0802B73C: .4byte _0802B740 + .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, _0802B794 + movs r1, 0x6 + bl AddTask + b _0802B7A8 + .align 2, 0 +_0802B794: .4byte sub_8153688 + 1 +_0802B798: + ldr r0, _0802B7B4 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0802B7D8 + bl sub_802DA14 +_0802B7A8: + ldr r0, _0802B7B8 + ldr r1, [r0] +_0802B7AC: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B7D8 + .align 2, 0 +_0802B7B4: .4byte sub_8153688 + 1 +_0802B7B8: .4byte 0x02022cfc +_0802B7BC: + bl sub_802DA44 + cmp r0, 0 + bne _0802B7D8 + ldr r0, _0802B7D4 + ldr r0, [r0] + adds r0, 0x4C + movs r1, 0x4 + strb r1, [r0] + movs r0, 0 + b _0802B7DA + .align 2, 0 +_0802B7D4: .4byte 0x02022cfc +_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, _0802B7F8 + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r4, r1, 0 + cmp r0, 0x7 + bhi _0802B8C4 + lsls r0, 2 + ldr r1, _0802B7FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802B7F8: .4byte 0x02022cfc +_0802B7FC: .4byte _0802B800 + .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, _0802B848 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + bl sub_802DDF4 + ldr r1, [r4] + strh r5, [r1, 0x3C] + b _0802B894 + .align 2, 0 +_0802B848: .4byte 0x02022cfc +_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, _0802B89C + ldr r1, [r0] +_0802B894: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802B8C4 + .align 2, 0 +_0802B89C: .4byte 0x02022cfc +_0802B8A0: + bl sub_802D788 + cmp r0, 0 + bne _0802B8C4 + bl sub_802C270 + bl sub_802BEA0 + ldr r0, _0802B8C0 + ldr r1, [r0] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802B8BA: + movs r0, 0 + b _0802B8C6 + .align 2, 0 +_0802B8C0: .4byte 0x02022cfc +_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, _0802B8E4 + ldr r1, [r5] + ldrh r4, [r1, 0x36] + cmp r4, 0 + beq _0802B8E8 + movs r0, 0 + strh r0, [r1, 0x36] + b _0802B95C + .align 2, 0 +_0802B8E4: .4byte 0x02022cfc +_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, _0802B930 + 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, _0802B934 + ldr r1, [r0] + b _0802B944 + .align 2, 0 +_0802B930: .4byte 0x030022c0 +_0802B934: .4byte 0x02022cfc +_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, _0802B97C + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0802BA50 + lsls r0, 2 + ldr r1, _0802B980 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802B97C: .4byte 0x02022cfc +_0802B980: .4byte _0802B984 + .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, _0802B9F8 + 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, _0802B9FC + ldr r1, [r0] + b _0802BA18 + .align 2, 0 +_0802B9F8: .4byte 0x000082f4 +_0802B9FC: .4byte 0x02022cfc +_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, _0802BA4C + 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 + .align 2, 0 +_0802BA4C: .4byte 0x02022cfc +_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, _0802BA74 + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0802BA68 + b _0802BB7C +_0802BA68: + lsls r0, 2 + ldr r1, _0802BA78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802BA74: .4byte 0x02022cfc +_0802BA78: .4byte _0802BA7C + .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, _0802BACC + ldr r1, [r0] + strh r2, [r1, 0x3C] + b _0802BAF2 + .align 2, 0 +_0802BACC: .4byte 0x02022cfc +_0802BAD0: + ldr r1, [r4] + ldrh r0, [r1, 0x3C] + adds r2, r0, 0x1 + strh r2, [r1, 0x3C] + ldr r0, _0802BAFC + 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 + .align 2, 0 +_0802BAFC: .4byte 0x030022c0 +_0802BB00: + bl sub_802DA44 + cmp r0, 0 + bne _0802BB7C + ldr r4, _0802BB4C + 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 + .align 2, 0 +_0802BB4C: .4byte 0x02022cfc +_0802BB50: + ldr r1, [r4] + movs r0, 0x6 + strh r0, [r1, 0xA] + b _0802BB7C +_0802BB58: + ldr r4, _0802BB6C + ldr r0, [r4] + ldrh r0, [r0, 0x3E] + bl sub_802D8FC +_0802BB62: + ldr r1, [r4] + movs r0, 0x4 + strh r0, [r1, 0xA] + b _0802BB7C + .align 2, 0 +_0802BB6C: .4byte 0x02022cfc +_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, _0802BB9C + ldr r0, [r0] + ldrh r0, [r0, 0xA] + cmp r0, 0x6 + bhi _0802BC58 + lsls r0, 2 + ldr r1, _0802BBA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802BB9C: .4byte 0x02022cfc +_0802BBA0: .4byte _0802BBA4 + .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, _0802BC00 + ldr r0, [r4] + adds r0, 0x45 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x6 + bl sub_802D0C8 + ldr r1, [r4] + b _0802BC30 + .align 2, 0 +_0802BC00: .4byte 0x02022cfc +_0802BC04: + ldr r4, _0802BC18 + ldr r0, [r4] + adds r0, 0x45 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0x6 + bl sub_802D0C8 + ldr r1, [r4] + b _0802BC30 + .align 2, 0 +_0802BC18: .4byte 0x02022cfc +_0802BC1C: + bl sub_802D0F0 + cmp r0, 0 + bne _0802BC58 + b _0802BC2C +_0802BC26: + movs r0, 0x8 +_0802BC28: + bl sub_802D0C8 +_0802BC2C: + ldr r0, _0802BC38 + ldr r1, [r0] +_0802BC30: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BC58 + .align 2, 0 +_0802BC38: .4byte 0x02022cfc +_0802BC3C: + bl sub_802D0F0 + cmp r0, 0 + bne _0802BC58 + ldr r0, _0802BC54 + ldr r1, [r0] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802BC4E: + movs r0, 0 + b _0802BC5A + .align 2, 0 +_0802BC54: .4byte 0x02022cfc +_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, _0802BC7C + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r4, r1, 0 + cmp r0, 0x5 + bhi _0802BD24 + lsls r0, 2 + ldr r1, _0802BC80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802BC7C: .4byte 0x02022cfc +_0802BC80: .4byte _0802BC84 + .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, _0802BCC4 + ldr r1, [r0] + strh r2, [r1, 0x3C] + b _0802BD02 + .align 2, 0 +_0802BCC4: .4byte 0x02022cfc +_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 sub_80A1AD4 + ldr r1, [r4] + b _0802BD02 +_0802BCEE: + ldr r0, _0802BD0C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802BD24 + bl sub_800AC34 +_0802BCFE: + ldr r0, _0802BD10 + ldr r1, [r0] +_0802BD02: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BD24 + .align 2, 0 +_0802BD0C: .4byte 0x02037fd4 +_0802BD10: .4byte 0x02022cfc +_0802BD14: + ldr r0, _0802BD20 + ldrb r0, [r0] + cmp r0, 0 + bne _0802BD24 + movs r0, 0 + b _0802BD26 + .align 2, 0 +_0802BD20: .4byte 0x03003124 +_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, _0802BD48 + ldr r0, [r4] + ldrh r0, [r0, 0xA] + cmp r0, 0x1 + beq _0802BD66 + cmp r0, 0x1 + bgt _0802BD4C + cmp r0, 0 + beq _0802BD52 + b _0802BD7A + .align 2, 0 +_0802BD48: .4byte 0x02022cfc +_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, _0802BDB8 + 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 + .align 2, 0 +_0802BDB8: .4byte 0x03005e08 +_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, _0802BE58 + 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, _0802BE5C + add r1, r9 + adds r0, r7, 0 + bl gf_strcpy + 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 + .align 2, 0 +_0802BE58: .4byte 0x000082a8 +_0802BE5C: .4byte 0x020229f0 + 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, _0802BE7C + ldr r2, [r1] + movs r1, 0xE + bl set_word_task_arg + pop {r0} + bx r0 + .align 2, 0 +_0802BE7C: .4byte 0x02022cfc + thumb_func_end sub_802BE60 + + thumb_func_start sub_802BE80 +sub_802BE80: @ 802BE80 + ldr r0, _0802BE9C + 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 + .align 2, 0 +_0802BE9C: .4byte 0x02022cfc + thumb_func_end sub_802BE80 + + thumb_func_start sub_802BEA0 +sub_802BEA0: @ 802BEA0 + push {r4,lr} + ldr r3, _0802BEDC + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x4A + movs r4, 0 + movs r2, 0 + strh r2, [r1] + ldr r1, _0802BEE0 + 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 + .align 2, 0 +_0802BEDC: .4byte 0x02022cfc +_0802BEE0: .4byte 0x000006ff + thumb_func_end sub_802BEA0 + + thumb_func_start sub_802BEE4 +sub_802BEE4: @ 802BEE4 + push {r4,lr} + ldr r4, _0802BF3C + 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, _0802BF40 + cmp r1, r0 + bls _0802BF16 + ldr r1, _0802BF44 + 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 + .align 2, 0 +_0802BF3C: .4byte 0x02022cfc +_0802BF40: .4byte 0x09fe0000 +_0802BF44: .4byte 0xfffff601 + thumb_func_end sub_802BEE4 + + thumb_func_start sub_802BF48 +sub_802BF48: @ 802BF48 + push {lr} + ldr r0, _0802BF58 + ldr r2, [r0] + ldr r0, [r2, 0x10] + cmp r0, 0 + beq _0802BF5C + movs r0, 0 + b _0802BF72 + .align 2, 0 +_0802BF58: .4byte 0x02022cfc +_0802BF5C: + ldr r3, [r2, 0x1C] + ldrh r1, [r2, 0x34] + ldr r0, _0802BF78 + 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 + .align 2, 0 +_0802BF78: .4byte 0x000005ff + thumb_func_end sub_802BF48 + + thumb_func_start sub_802BF7C +sub_802BF7C: @ 802BF7C + push {r4,lr} + ldr r4, _0802BFAC + 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 + .align 2, 0 +_0802BFAC: .4byte 0x02022cfc +_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, _0802C00C + 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, _0802C010 + 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 + .align 2, 0 +_0802C00C: .4byte 0x082fb63c +_0802C010: .4byte 0x082fb64c +_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, _0802C090 + ldr r4, _0802C094 + 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, _0802C094 + ldr r1, [r0] +_0802C086: + ldr r0, [r1, 0x28] +_0802C088: + str r0, [r1, 0x1C] +_0802C08A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802C090: .4byte 0x082fb63c +_0802C094: .4byte 0x02022cfc + thumb_func_end sub_802BF7C + + thumb_func_start sub_802C098 +sub_802C098: @ 802C098 + ldr r0, _0802C0AC + ldr r2, [r0] + ldr r1, [r2, 0x24] + ldr r0, _0802C0B0 + muls r0, r1 + ldr r1, _0802C0B4 + adds r0, r1 + str r0, [r2, 0x24] + lsrs r0, 16 + bx lr + .align 2, 0 +_0802C0AC: .4byte 0x02022cfc +_0802C0B0: .4byte 0x41c64e6d +_0802C0B4: .4byte 0x00006073 + thumb_func_end sub_802C098 + + thumb_func_start sub_802C0B8 +sub_802C0B8: @ 802C0B8 + push {lr} + ldr r0, _0802C0D4 + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1, 0x10] + movs r0, 0x6 + str r0, [r1, 0x14] + ldr r0, _0802C0D8 + strh r0, [r1, 0x34] + bl sub_802C270 + pop {r0} + bx r0 + .align 2, 0 +_0802C0D4: .4byte 0x02022cfc +_0802C0D8: .4byte 0x000005ff + thumb_func_end sub_802C0B8 + + thumb_func_start sub_802C0DC +sub_802C0DC: @ 802C0DC + ldr r0, _0802C0E4 + ldr r0, [r0] + ldr r0, [r0, 0x10] + bx lr + .align 2, 0 +_0802C0E4: .4byte 0x02022cfc + thumb_func_end sub_802C0DC + + thumb_func_start sub_802C0E8 +sub_802C0E8: @ 802C0E8 + push {r4,r5,lr} + ldr r5, _0802C10C + ldr r4, _0802C110 + 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 + .align 2, 0 +_0802C10C: .4byte 0x02022cfc +_0802C110: .4byte 0x000082f8 + thumb_func_end sub_802C0E8 + + thumb_func_start sub_802C114 +sub_802C114: @ 802C114 + ldr r0, _0802C128 + ldr r0, [r0] + ldr r1, _0802C12C + adds r0, r1 + ldr r1, [r0] + movs r2, 0 + strh r2, [r1, 0x10] + ldr r0, [r0] + strh r2, [r0, 0x12] + bx lr + .align 2, 0 +_0802C128: .4byte 0x02022cfc +_0802C12C: .4byte 0x000083ac + thumb_func_end sub_802C114 + + thumb_func_start sub_802C130 +sub_802C130: @ 802C130 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0802C154 + ldr r2, [r1] + ldrb r3, [r2, 0x6] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r2, r1 + ldr r1, _0802C158 + adds r2, r1 + ldrh r1, [r2] + cmp r1, r0 + beq _0802C15C + movs r0, 0 + b _0802C15E + .align 2, 0 +_0802C154: .4byte 0x02022cfc +_0802C158: .4byte 0x000082f4 +_0802C15C: + movs r0, 0x1 +_0802C15E: + pop {r1} + bx r1 + thumb_func_end sub_802C130 + + thumb_func_start sub_802C164 +sub_802C164: @ 802C164 + ldr r0, _0802C184 + ldr r0, [r0] + ldr r1, _0802C188 + 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 + .align 2, 0 +_0802C184: .4byte 0x02022cfc +_0802C188: .4byte 0x000083ac + thumb_func_end sub_802C164 + + thumb_func_start sub_802C18C +sub_802C18C: @ 802C18C + push {r4,lr} + ldr r0, _0802C1B4 + ldr r2, [r0] + ldr r0, _0802C1B8 + 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 + .align 2, 0 +_0802C1B4: .4byte 0x02022cfc +_0802C1B8: .4byte 0x000083ac + thumb_func_end sub_802C18C + + thumb_func_start sub_802C1BC +sub_802C1BC: @ 802C1BC + ldr r0, _0802C1D4 + ldr r0, [r0] + ldr r1, _0802C1D8 + 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 + .align 2, 0 +_0802C1D4: .4byte 0x02022cfc +_0802C1D8: .4byte 0x000083ac + thumb_func_end sub_802C1BC + + thumb_func_start sub_802C1DC +sub_802C1DC: @ 802C1DC + push {r4,r5,lr} + ldr r4, _0802C238 + 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, _0802C23C + 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, _0802C238 + 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 + .align 2, 0 +_0802C238: .4byte 0x02022cfc +_0802C23C: .4byte 0x082fb654 + thumb_func_end sub_802C1DC + + thumb_func_start sub_802C240 +sub_802C240: @ 802C240 + push {lr} + ldr r0, _0802C25C + 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 + .align 2, 0 +_0802C25C: .4byte 0x02022cfc + thumb_func_end sub_802C240 + + thumb_func_start sub_802C260 +sub_802C260: @ 802C260 + ldr r0, _0802C26C + ldr r0, [r0] + adds r0, 0x46 + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_0802C26C: .4byte 0x02022cfc + thumb_func_end sub_802C260 + + thumb_func_start sub_802C270 +sub_802C270: @ 802C270 + ldr r0, _0802C27C + ldr r0, [r0] + adds r0, 0x46 + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_0802C27C: .4byte 0x02022cfc + 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, _0802C2BC + 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, _0802C2C0 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0x1 + beq _0802C2D4 + cmp r2, 0x1 + bgt _0802C2C4 + cmp r2, 0 + beq _0802C2CA + b _0802C354 + .align 2, 0 +_0802C2BC: .4byte 0x02022cfc +_0802C2C0: .4byte 0x000082f4 +_0802C2C4: + cmp r2, 0x2 + beq _0802C338 + b _0802C354 +_0802C2CA: + adds r0, r5, 0 + movs r1, 0 + bl sub_802DC80 + b _0802C354 +_0802C2D4: + ldr r0, _0802C328 + adds r4, r1, r0 + ldrh r0, [r4] + cmp r0, 0x1 + bne _0802C2F6 + ldr r0, _0802C32C + 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, _0802C330 + adds r0, r2, r1 + adds r0, r7 + ldr r1, _0802C334 + str r1, [r0] + adds r1, r2, 0 + adds r1, 0x9A + add r1, r8 + adds r2, r7 + ldr r0, _0802C32C + adds r2, r0 + ldrh r0, [r2] + strh r0, [r1] +_0802C31E: + adds r0, r5, 0 + bl sub_802C398 + b _0802C354 + .align 2, 0 +_0802C328: .4byte 0x000082f6 +_0802C32C: .4byte 0x000082f2 +_0802C330: .4byte 0x000082e8 +_0802C334: .4byte 0x7fffffff +_0802C338: + ldr r0, _0802C374 + 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 + .align 2, 0 +_0802C374: .4byte 0x000082f6 +_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, _0802C3C4 + ldr r2, [r0] + ldr r0, [r2, 0x68] + cmp r0, 0 + bne _0802C432 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0802C3C8 + adds r0, r1 + adds r5, r2, r0 + ldr r1, [r5, 0x4] + ldr r0, _0802C3CC + cmp r1, r0 + beq _0802C3D0 + adds r0, r1, 0x1 + str r0, [r5, 0x4] + adds r3, r0, 0 + b _0802C3E8 + .align 2, 0 +_0802C3C4: .4byte 0x02022cfc +_0802C3C8: .4byte 0x000082e4 +_0802C3CC: .4byte 0x7fffffff +_0802C3D0: + adds r0, r2, 0 + adds r0, 0x4A + ldrh r1, [r0] + ldrh r0, [r5, 0xE] + subs r3, r1, r0 + ldr r0, _0802C408 + cmp r3, r0 + ble _0802C3E6 + ldr r0, _0802C40C + 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, _0802C410 + 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 + .align 2, 0 +_0802C408: .4byte 0x0000fde7 +_0802C40C: .4byte 0xffff0218 +_0802C410: .4byte 0x082fb65c +_0802C414: + movs r4, 0 +_0802C416: + adds r1, r4, 0 + adds r0, r6, 0 + bl sub_802DC80 + cmp r4, 0 + bne _0802C430 + ldr r0, _0802C438 + 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 + .align 2, 0 +_0802C438: .4byte 0x02022cfc + thumb_func_end sub_802C398 + + thumb_func_start sub_802C43C +sub_802C43C: @ 802C43C + push {r4,r5,lr} + ldr r5, _0802C468 + 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 + .align 2, 0 +_0802C468: .4byte 0x02022cfc +_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, _0802C530 + 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, _0802C534 + 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, _0802C530 + 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, _0802C530 + 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 + .align 2, 0 +_0802C530: .4byte 0x02022cfc +_0802C534: .4byte 0x0000270e + thumb_func_end sub_802C43C + + thumb_func_start sub_802C538 +sub_802C538: @ 802C538 + push {r4,r5,lr} + ldr r5, _0802C56C + ldr r1, [r5] + ldr r0, [r1, 0x14] + cmp r0, 0x6 + bne _0802C582 + ldr r4, _0802C570 + 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 + .align 2, 0 +_0802C56C: .4byte 0x02022cfc +_0802C570: .4byte 0x000083ac +_0802C574: + movs r0, 0 + b _0802C5CA +_0802C578: + bl sub_802C18C + movs r0, 0x3 + bl sub_802AE14 +_0802C582: + ldr r0, _0802C5D0 + ldr r1, [r0] + ldr r0, [r1, 0x14] + cmp r0, 0x7 + bne _0802C5A8 + ldr r0, [r1, 0x18] + cmp r0, 0x6 + bne _0802C5A8 + ldr r2, _0802C5D4 + 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, _0802C5D0 + ldr r0, [r0] + ldrb r1, [r0, 0x5] + cmp r2, r1 + bge _0802C5C8 + adds r3, r1, 0 + ldr r4, _0802C5D8 + 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 + .align 2, 0 +_0802C5D0: .4byte 0x02022cfc +_0802C5D4: .4byte 0x000083ac +_0802C5D8: .4byte 0x000082f4 + thumb_func_end sub_802C538 + + thumb_func_start sub_802C5DC +sub_802C5DC: @ 802C5DC + push {r4,lr} + ldr r0, _0802C610 + ldr r0, [r0] + ldrb r3, [r0, 0x5] + movs r4, 0 + cmp r4, r3 + bge _0802C600 + ldr r1, _0802C614 + 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 + .align 2, 0 +_0802C610: .4byte 0x02022cfc +_0802C614: .4byte 0x000082f8 + thumb_func_end sub_802C5DC + + thumb_func_start sub_802C618 +sub_802C618: @ 802C618 + push {r4,lr} + movs r2, 0 + ldr r0, _0802C638 + ldr r0, [r0] + ldrb r1, [r0, 0x5] + cmp r2, r1 + bge _0802C648 + adds r3, r1, 0 + ldr r4, _0802C63C + adds r1, r0, r4 +_0802C62C: + ldr r0, [r1] + cmp r0, 0x1 + beq _0802C640 + movs r0, 0 + b _0802C64A + .align 2, 0 +_0802C638: .4byte 0x02022cfc +_0802C63C: .4byte 0x000082f8 +_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, _0802C664 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x45 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0802C668 +_0802C660: + movs r0, 0 + b _0802C684 + .align 2, 0 +_0802C664: .4byte 0x02022cfc +_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, _0802C6A8 + ldr r2, [r1] + ldr r1, [r2, 0x78] + adds r1, r0 + str r1, [r2, 0x78] + movs r0, 0x1 + str r0, [r2, 0x5C] + ldr r0, _0802C6AC + cmp r1, r0 + bls _0802C6A2 + adds r0, 0x1 + str r0, [r2, 0x78] +_0802C6A2: + pop {r0} + bx r0 + .align 2, 0 +_0802C6A8: .4byte 0x02022cfc +_0802C6AC: .4byte 0x00018695 + thumb_func_end sub_802C688 + + thumb_func_start sub_802C6B0 +sub_802C6B0: @ 802C6B0 + push {r4-r7,lr} + movs r5, 0 + ldr r1, _0802C6E8 + ldr r0, [r1] + ldrb r4, [r0, 0x5] + movs r2, 0 + cmp r5, r4 + bge _0802C702 + mov r12, r1 + movs r3, 0 + ldr r7, _0802C6EC + 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 + .align 2, 0 +_0802C6E8: .4byte 0x02022cfc +_0802C6EC: .4byte 0x000082e4 +_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, _0802C730 + ldr r3, _0802C734 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0802C728 + ldr r3, _0802C738 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0802C728 + movs r2, 0x1 +_0802C728: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_0802C730: .4byte 0x03005000 +_0802C734: .4byte 0x000009e6 +_0802C738: .4byte 0x00000c1a + 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, _0802C77C + 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 + .align 2, 0 +_0802C77C: .4byte 0x02022cfc + thumb_func_end sub_802C73C + + thumb_func_start sub_802C780 +sub_802C780: @ 802C780 + ldr r0, _0802C78C + ldr r0, [r0] + adds r0, 0x44 + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_0802C78C: .4byte 0x02022cfc + thumb_func_end sub_802C780 + + thumb_func_start sub_802C790 +sub_802C790: @ 802C790 + ldr r1, _0802C79C + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0802C79C: .4byte 0x082fb6ec + thumb_func_end sub_802C790 + + thumb_func_start sub_802C7A0 +sub_802C7A0: @ 802C7A0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _0802C7B8 + ldr r0, [r0] + ldrh r2, [r0, 0xE] + cmp r1, r2 + bls _0802C7B2 + strh r1, [r0, 0xE] +_0802C7B2: + pop {r0} + bx r0 + .align 2, 0 +_0802C7B8: .4byte 0x02022cfc + thumb_func_end sub_802C7A0 + + thumb_func_start sub_802C7BC +sub_802C7BC: @ 802C7BC + push {lr} + ldr r0, _0802C7D0 + ldr r0, [r0] + ldr r1, _0802C7D4 + ldr r2, [r0, 0x78] + ldr r0, [r1] + cmp r2, r0 + bcs _0802C7D8 + movs r0, 0 + b _0802C7DA + .align 2, 0 +_0802C7D0: .4byte 0x02022cfc +_0802C7D4: .4byte 0x082fb714 +_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, _0802C804 + ands r4, r1 + orrs r0, r4 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802C804: .4byte 0x00000fff + 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, _0802C834 + lsrs r1, 15 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_0802C834: .4byte 0x082fb704 + 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, _0802C86C + ldr r0, [r3] + ldr r2, _0802C870 + 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 + .align 2, 0 +_0802C86C: .4byte 0x02022cfc +_0802C870: .4byte 0x082fb714 +_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, _0802C8C4 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + bx lr + .align 2, 0 +_0802C8C4: .4byte 0x02022cfc + thumb_func_end sub_802C8BC + + thumb_func_start sub_802C8C8 +sub_802C8C8: @ 802C8C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0802C8E0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, _0802C8E4 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + bx lr + .align 2, 0 +_0802C8E0: .4byte 0x02022cfc +_0802C8E4: .4byte 0x000082a8 + 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, _0802C904 + 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 + .align 2, 0 +_0802C904: .4byte 0x02022cfc + 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, _0802C954 + 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, _0802C958 + movs r0, 0x1 + b _0802C966 + .align 2, 0 +_0802C954: .4byte 0x020244ec +_0802C958: .4byte 0x020375f0 +_0802C95C: + adds r5, 0x1 + cmp r5, 0x5 + ble _0802C924 + ldr r1, _0802C970 + movs r0, 0 +_0802C966: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802C970: .4byte 0x020375f0 + 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, _0802C9B4 +_0802C97C: + adds r0, r5, 0 + bl gpu_tile_obj_decompress_and_load + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x4 + bls _0802C97C + movs r4, 0 + ldr r5, _0802C9B8 +_0802C98E: + adds r0, r5, 0 + bl gpu_pal_obj_alloc_tag_and_apply + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x1 + bls _0802C98E + movs r0, 0x5 + bl gpu_pal_tags_index_of + strb r0, [r6, 0xE] + movs r0, 0x6 + bl gpu_pal_tags_index_of + strb r0, [r6, 0xF] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802C9B4: .4byte 0x082fbe08 +_0802C9B8: .4byte 0x082fbe30 + 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, _0802CA28 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x80 + lsls r0, 6 + bl malloc + mov r8, r0 + movs r0, 0x80 + lsls r0, 4 + bl malloc + mov r10, r0 + bl sub_802C8BC + lsls r0, 16 + lsrs r0, 16 + cmp r6, r0 + bne _0802CA2C + movs r0, 0x3 + b _0802CA32 + .align 2, 0 +_0802CA28: .4byte 0x082fbe40 +_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, _0802CAE0 + adds r0, r1 + ldr r3, [r7, 0x8] + mov r1, r8 + bl sub_8034628 + mov r3, r8 + str r3, [sp, 0x18] + adds r4, r6, 0 + add r0, sp, 0x18 + ldr r5, _0802CAE4 + lsls r1, r4, 16 + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + 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 gpu_pal_obj_decompress_and_apply + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0802CAF4 + lsls r0, r6, 2 + ldr r2, _0802CAE8 + add r2, r9 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0802CAEC + adds r0, r1 + str r0, [r2] + ldr r0, _0802CAF0 + add r0, r9 + adds r0, r6 + add r1, sp, 0x30 + ldrb r1, [r1] + strb r1, [r0] + b _0802CB00 + .align 2, 0 +_0802CAE0: .4byte 0x08301418 +_0802CAE4: .4byte 0xffff0000 +_0802CAE8: .4byte 0x000081a8 +_0802CAEC: .4byte 0x02020630 +_0802CAF0: .4byte 0x000081fc +_0802CAF4: + lsls r0, r6, 2 + ldr r1, _0802CB10 + 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 + .align 2, 0 +_0802CB10: .4byte 0x000081a8 + 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, _0802CB6C + adds r5, r4, r0 + adds r5, r6 + ldr r0, [r5] + bl sub_802C9BC + ldr r2, [r5] + ldr r0, _0802CB70 + adds r4, r0 + adds r4, r6 + ldr r1, [r4] + ldr r0, _0802CB74 + 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, _0802CB78 + str r1, [r0, 0x1C] + movs r1, 0x1 + bl obj_anim_image_start + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802CB6C: .4byte 0x000081bc +_0802CB70: .4byte 0x000081a8 +_0802CB74: .4byte 0x02020630 +_0802CB78: .4byte sub_802CB7C + 1 + 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, _0802CBEC + str r0, [r2, 0x1C] +_0802CBE6: + pop {r0} + bx r0 + .align 2, 0 +_0802CBEC: .4byte nullsub_12 + 1 + thumb_func_end sub_802CB7C + + thumb_func_start sub_802CBF0 +sub_802CBF0: @ 802CBF0 + push {lr} + lsls r1, 2 + ldr r2, _0802CC10 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + ldr r1, _0802CC14 + str r1, [r2, 0x1C] + movs r1, 0 + strh r1, [r2, 0x26] + ldr r0, [r0] + bl sub_802C9BC + pop {r0} + bx r0 + .align 2, 0 +_0802CC10: .4byte 0x000081a8 +_0802CC14: .4byte sub_802CC40 + 1 + thumb_func_end sub_802CBF0 + + thumb_func_start sub_802CC18 +sub_802CC18: @ 802CC18 + push {lr} + movs r2, 0 + lsls r1, 2 + ldr r3, _0802CC38 + adds r0, r3 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + ldr r0, _0802CC3C + cmp r1, r0 + bne _0802CC30 + movs r2, 0x1 +_0802CC30: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_0802CC38: .4byte 0x000081a8 +_0802CC3C: .4byte sub_802CC40 + 1 + 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, _0802CC80 +_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, _0802CC84 + str r0, [r2, 0x1C] +_0802CC7C: + pop {r0} + bx r0 + .align 2, 0 +_0802CC80: .4byte 0x0000fffe +_0802CC84: .4byte nullsub_12 + 1 + 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, _0802CCA8 + adds r4, r0 + adds r4, r1 + ldr r0, [r4] + bl sub_802C9BC + ldr r1, [r4] + ldr r0, _0802CCAC + str r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802CCA8: .4byte 0x000081a8 +_0802CCAC: .4byte sub_802CD08 + 1 + 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, _0802CCFC + adds r3, r4, r1 + ldr r7, _0802CD00 + ldr r6, _0802CD04 + 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 + .align 2, 0 +_0802CCFC: .4byte 0x000081a8 +_0802CD00: .4byte sub_802CD08 + 1 +_0802CD04: .4byte nullsub_12 + 1 + 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, _0802CD6C + 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 + .align 2, 0 +_0802CD6C: .4byte 0x000081fc + 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, _0802CD90 + adds r4, r0 + adds r4, r1 + ldr r0, [r4] + bl sub_802C9BC + ldr r1, [r4] + ldr r0, _0802CD94 + str r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802CD90: .4byte 0x000081a8 +_0802CD94: .4byte sub_802CDD4 + 1 + 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, _0802CDBC + ldr r0, _0802CDC0 + adds r1, r4, r0 +_0802CDB0: + ldr r0, [r1] + ldr r0, [r0, 0x1C] + cmp r0, r5 + bne _0802CDC4 + movs r0, 0x1 + b _0802CDCE + .align 2, 0 +_0802CDBC: .4byte sub_802CDD4 + 1 +_0802CDC0: .4byte 0x000081a8 +_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, _0802CE34 + 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 + .align 2, 0 +_0802CE34: .4byte 0x08329f40 +_0802CE38: + ldr r0, _0802CE44 + str r0, [r5, 0x1C] +_0802CE3C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802CE44: .4byte nullsub_12 + 1 + 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, _0802CE90 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0802CE88 + ldr r0, _0802CE94 + 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, _0802CE98 + adds r0, r5, r3 + adds r0, r2 + str r1, [r0] +_0802CE88: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802CE90: .4byte 0x082fc00c +_0802CE94: .4byte 0x02020630 +_0802CE98: .4byte 0x000081bc + 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, _0802CF3C +_0802CEA6: + ldr r1, _0802CF40 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + ldr r2, _0802CF44 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r5, 2 + ldr r3, _0802CF48 + adds r2, r7, r3 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0802CF4C + 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, _0802CF40 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + ldr r2, _0802CF44 + lsls r1, r5, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + ldr r2, _0802CF3C + adds r2, r6, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r5, 2 + ldr r3, _0802CF48 + adds r2, r7, r3 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0802CF4C + 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 + .align 2, 0 +_0802CF3C: .4byte 0x082fbe58 +_0802CF40: .4byte 0x082fbeb8 +_0802CF44: .4byte 0x082fbea8 +_0802CF48: .4byte 0x000081d0 +_0802CF4C: .4byte 0x02020630 + 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, _0802D03C + 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, _0802D040 + 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 obj_anim_image_start + adds r6, 0x1 + adds r4, 0x14 + subs r5, 0x1 + cmp r5, 0 + bge _0802CF92 + movs r5, 0x3 + ldr r0, _0802D03C + 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, _0802D040 + 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 obj_anim_image_start + 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 + .align 2, 0 +_0802D03C: .4byte 0x082fbe58 +_0802D040: .4byte 0x000081d0 + 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, _0802D0A0 + str r0, [r4] + bl sub_802D0BC + ldr r0, _0802D0A4 + 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, _0802D0A8 + bl sub_802D108 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802D0A0: .4byte 0x02022d00 +_0802D0A4: .4byte sub_802D12C + 1 +_0802D0A8: .4byte sub_802D150 + 1 + thumb_func_end sub_802D074 + + thumb_func_start sub_802D0AC +sub_802D0AC: @ 802D0AC + push {lr} + bl Window_FreeMemory + 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, _0802D0EC +_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 + .align 2, 0 +_0802D0EC: .4byte 0x082fe18c + thumb_func_end sub_802D0C8 + + thumb_func_start sub_802D0F0 +sub_802D0F0: @ 802D0F0 + ldr r0, _0802D104 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_0802D104: .4byte 0x02022d00 + thumb_func_end sub_802D0F0 + + thumb_func_start sub_802D108 +sub_802D108: @ 802D108 + push {r4,lr} + adds r2, r0, 0 + ldr r4, _0802D128 + 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 + .align 2, 0 +_0802D128: .4byte 0x02022d00 + thumb_func_end sub_802D108 + + thumb_func_start sub_802D12C +sub_802D12C: @ 802D12C + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0802D14C + 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 + .align 2, 0 +_0802D14C: .4byte 0x02022d00 + thumb_func_end sub_802D12C + + thumb_func_start sub_802D150 +sub_802D150: @ 802D150 + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, _0802D16C + 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 + .align 2, 0 +_0802D16C: .4byte 0x02022d00 +_0802D170: + cmp r5, 0x2 + bne _0802D176 + b _0802D2D6 +_0802D176: + b _0802D2DA +_0802D178: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0802D268 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _0802D26C + bl Window_InitFromTemplates + bl reset_temp_tile_data_buffers + ldr r0, [r6] + bl sub_802C974 + bl sub_802DD08 + ldr r0, _0802D270 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0802D274 + str r5, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _0802D278 + 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, _0802D27C + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0802D280 + str r5, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _0802D284 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, _0802D288 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0802D28C + str r5, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _0802D290 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, _0802D294 + 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 bg_set_tilemap + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + 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 gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + bl sub_8199D98 + b _0802D2CC + .align 2, 0 +_0802D268: .4byte 0x082fe164 +_0802D26C: .4byte 0x082fe174 +_0802D270: .4byte 0x082fc044 +_0802D274: .4byte 0x082fc064 +_0802D278: .4byte 0x082fc290 +_0802D27C: .4byte 0x082fc440 +_0802D280: .4byte 0x082fc460 +_0802D284: .4byte 0x082fcdb0 +_0802D288: .4byte 0x082fd168 +_0802D28C: .4byte 0x082fd188 +_0802D290: .4byte 0x082fdc38 +_0802D294: .4byte 0x082fc024 +_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 gpu_sync_bg_show + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_hide +_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, _0802D2FC + ldr r0, [r4] + ldrh r0, [r0, 0x4] + cmp r0, 0x1 + beq _0802D310 + cmp r0, 0x1 + bgt _0802D300 + cmp r0, 0 + beq _0802D30A + b _0802D34A + .align 2, 0 +_0802D2FC: .4byte 0x02022d00 +_0802D300: + cmp r0, 0x2 + beq _0802D322 + cmp r0, 0x3 + beq _0802D33A + b _0802D34A +_0802D30A: + bl sub_802DE1C + b _0802D330 +_0802D310: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D34A + movs r0, 0 + bl sub_802DF70 + b _0802D330 +_0802D322: + bl is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _0802D368 + ldr r0, [r4] + ldrh r0, [r0, 0x4] + cmp r0, 0x1 + beq _0802D37C + cmp r0, 0x1 + bgt _0802D36C + cmp r0, 0 + beq _0802D376 + b _0802D3B6 + .align 2, 0 +_0802D368: .4byte 0x02022d00 +_0802D36C: + cmp r0, 0x2 + beq _0802D38E + cmp r0, 0x3 + beq _0802D3A6 + b _0802D3B6 +_0802D376: + bl sub_802DE1C + b _0802D39C +_0802D37C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D3B6 + movs r0, 0x1 + bl sub_802DF70 + b _0802D39C +_0802D38E: + bl is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _0802D3D8 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0 + beq _0802D3DC + cmp r0, 0x1 + beq _0802D410 + b _0802D43E + .align 2, 0 +_0802D3D8: .4byte 0x02022d00 +_0802D3DC: + movs r4, 0 + cmp r4, r5 + bge _0802D3F8 +_0802D3E2: + ldr r0, _0802D40C + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + ldrb r0, [r0] + bl Window_FillTileMap + adds r4, 0x1 + cmp r4, r5 + blt _0802D3E2 +_0802D3F8: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0802D40C + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D43E + .align 2, 0 +_0802D40C: .4byte 0x02022d00 +_0802D410: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D43E + movs r4, 0 + cmp r4, r5 + bge _0802D436 +_0802D420: + ldr r0, _0802D444 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + ldrb r0, [r0] + bl Window_Remove + adds r4, 0x1 + cmp r4, r5 + blt _0802D420 +_0802D436: + ldr r0, _0802D444 + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1] +_0802D43E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802D444: .4byte 0x02022d00 + thumb_func_end sub_802D3BC + + thumb_func_start sub_802D448 +sub_802D448: @ 802D448 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, _0802D460 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D4A4 + cmp r4, 0x1 + bgt _0802D464 + cmp r4, 0 + beq _0802D46A + b _0802D4EC + .align 2, 0 +_0802D460: .4byte 0x02022d00 +_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, _0802D4A0 + 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 Window_CopyToVram + b _0802D4D2 + .align 2, 0 +_0802D4A0: .4byte 0x085edf2a +_0802D4A4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D4EC + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl Window_WriteStandardTileMap + 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 gpu_copy_wram_bg_tilemap_to_vram +_0802D4D2: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D4EC +_0802D4DC: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0802D50C + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D550 + cmp r4, 0x1 + bgt _0802D510 + cmp r4, 0 + beq _0802D516 + b _0802D58E + .align 2, 0 +_0802D50C: .4byte 0x02022d00 +_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, _0802D54C + 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 Window_CopyToVram + b _0802D574 + .align 2, 0 +_0802D54C: .4byte 0x082c8959 +_0802D550: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D58E + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl Window_WriteStandardTileMap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_0802D574: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D58E +_0802D57E: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0802D5AC + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0 + beq _0802D5B0 + cmp r4, 0x1 + beq _0802D5C8 + b _0802D5DE + .align 2, 0 +_0802D5AC: .4byte 0x02022d00 +_0802D5B0: + bl sub_802DA14 + bl sub_8198C78 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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 is_dma3_queue_busy_with_gpu_copy + 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, _0802D5FC + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D640 + cmp r4, 0x1 + bgt _0802D600 + cmp r4, 0 + beq _0802D606 + b _0802D67E + .align 2, 0 +_0802D5FC: .4byte 0x02022d00 +_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, _0802D63C + 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 Window_CopyToVram + b _0802D664 + .align 2, 0 +_0802D63C: .4byte 0x085edf3e +_0802D640: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D67E + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl Window_WriteStandardTileMap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_0802D664: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D67E +_0802D66E: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0802D6A0 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D6E4 + cmp r4, 0x1 + bgt _0802D6A4 + cmp r4, 0 + beq _0802D6AA + b _0802D722 + .align 2, 0 +_0802D6A0: .4byte 0x02022d00 +_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, _0802D6E0 + 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 Window_CopyToVram + b _0802D708 + .align 2, 0 +_0802D6E0: .4byte 0x085edf6f +_0802D6E4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802D722 + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl Window_WriteStandardTileMap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_0802D708: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D722 +_0802D712: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0802D740 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0 + beq _0802D744 + cmp r4, 0x1 + beq _0802D752 + b _0802D75E + .align 2, 0 +_0802D740: .4byte 0x02022d00 +_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, _0802D784 + 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 + .align 2, 0 +_0802D784: .4byte 0x02022d00 + thumb_func_end sub_802D764 + + thumb_func_start sub_802D788 +sub_802D788: @ 802D788 + push {r4,lr} + ldr r0, _0802D79C + ldr r2, [r0] + ldrb r3, [r2, 0xA] + adds r4, r0, 0 + cmp r3, 0 + beq _0802D7A0 + cmp r3, 0x1 + beq _0802D7DA + b _0802D7DE + .align 2, 0 +_0802D79C: .4byte 0x02022d00 +_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, _0802D878 + 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 decimal_int_to_string + 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, _0802D87C + 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 Window_CopyToVram + ldr r1, [r5] + ldr r0, _0802D880 + strh r0, [r1, 0x14] + strb r4, [r1, 0xD] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802D878: .4byte 0x02022d00 +_0802D87C: .4byte 0x085eded3 +_0802D880: .4byte 0x0000016f + 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, _0802D8F4 + 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, _0802D8F8 + 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 Window_CopyToVram + ldr r0, [r4] + strh r5, [r0, 0x14] + strb r6, [r0, 0xD] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802D8F4: .4byte 0x02022d00 +_0802D8F8: .4byte 0x085edef4 + 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, _0802D96C + 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, _0802D970 + 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 Window_CopyToVram + ldr r0, [r4] + strh r5, [r0, 0x14] + strb r6, [r0, 0xD] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802D96C: .4byte 0x02022d00 +_0802D970: .4byte 0x085edf11 + thumb_func_end sub_802D8FC + + thumb_func_start sub_802D974 +sub_802D974: @ 802D974 + push {r4,lr} + ldr r4, _0802D98C + ldr r0, [r4] + ldrb r0, [r0, 0xD] + cmp r0, 0x1 + beq _0802D9C8 + cmp r0, 0x1 + bgt _0802D990 + cmp r0, 0 + beq _0802D99A + b _0802DA0C + .align 2, 0 +_0802D98C: .4byte 0x02022d00 +_0802D990: + cmp r0, 0x2 + beq _0802D9EE + cmp r0, 0x3 + beq _0802DA02 + b _0802DA0C +_0802D99A: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802DA0C + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl Window_WriteStandardTileMap + ldr r0, [r4] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, [r4] + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] + b _0802DA0C +_0802D9C8: + bl is_dma3_queue_busy_with_gpu_copy + 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, _0802DA08 + ldr r1, [r0] + ldrb r0, [r1, 0xD] + adds r0, 0x1 +_0802DA00: + strb r0, [r1, 0xD] +_0802DA02: + movs r0, 0 + b _0802DA0E + .align 2, 0 +_0802DA08: .4byte 0x02022d00 +_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, _0802DA40 + 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 Window_CopyToVram + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0xD] +_0802DA38: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802DA40: .4byte 0x02022d00 + thumb_func_end sub_802DA14 + + thumb_func_start sub_802DA44 +sub_802DA44: @ 802DA44 + push {r4,lr} + ldr r4, _0802DA54 + ldr r1, [r4] + ldrh r0, [r1, 0x12] + cmp r0, 0xFF + bne _0802DA58 +_0802DA50: + movs r0, 0 + b _0802DA84 + .align 2, 0 +_0802DA54: .4byte 0x02022d00 +_0802DA58: + ldrb r0, [r1, 0xD] + cmp r0, 0 + bne _0802DA7E + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802DA82 + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl Window_Remove + 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, _0802DB04 + ldr r4, [sp] + ands r4, r6 + lsls r0, 24 + lsrs r0, 16 + ldr r5, _0802DB08 + ands r4, r5 + orrs r4, r0 + lsls r1, 24 + lsrs r1, 8 + ldr r0, _0802DB0C + ands r4, r0 + orrs r4, r1 + lsls r2, 24 + ldr r0, _0802DB10 + 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, _0802DB14 + ands r0, r1 + movs r1, 0x86 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl Window_AddFromTemplate + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r4, 0 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802DB04: .4byte 0xffffff00 +_0802DB08: .4byte 0xffff00ff +_0802DB0C: .4byte 0xff00ffff +_0802DB10: .4byte 0x00ffffff +_0802DB14: .4byte 0x0000ffff + 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, _0802DB78 + ldr r2, [sp] + ands r2, r5 + lsls r0, 24 + lsrs r0, 16 + ldr r4, _0802DB7C + ands r2, r4 + orrs r2, r0 + lsls r1, 24 + lsrs r1, 8 + ldr r0, _0802DB80 + ands r2, r0 + orrs r2, r1 + ldr r0, _0802DB84 + 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, _0802DB88 + 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 sub_81996C0 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802DB78: .4byte 0xffffff00 +_0802DB7C: .4byte 0xffff00ff +_0802DB80: .4byte 0xff00ffff +_0802DB84: .4byte 0x00ffffff +_0802DB88: .4byte 0x0000ffff + thumb_func_end sub_802DB18 + + thumb_func_start sub_802DB8C +sub_802DB8C: @ 802DB8C + push {r4,lr} + sub sp, 0x10 + ldr r1, _0802DBEC + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + add r0, sp, 0xC + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, _0802DBF0 + 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, _0802DBF4 + 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 + .align 2, 0 +_0802DBEC: .4byte 0x082fe1dc +_0802DBF0: .4byte 0x085ede7c +_0802DBF4: .4byte 0x085ede84 + 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, _0802DC74 + subs r0, 0x2 + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + movs r6, 0 + cmp r6, r10 + bge _0802DC62 + ldr r0, _0802DC78 + mov r9, r0 + ldr r1, _0802DC7C + 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 + .align 2, 0 +_0802DC74: .4byte 0x082fe260 +_0802DC78: .4byte 0x08300d38 +_0802DC7C: .4byte 0x02022d00 + thumb_func_end sub_802DBF8 + + thumb_func_start sub_802DC80 +sub_802DC80: @ 802DC80 + ldr r2, _0802DC94 + ldr r2, [r2] + lsls r0, 2 + ldr r3, _0802DC98 + adds r2, r3 + adds r2, r0 + ldr r0, [r2] + strh r1, [r0, 0x26] + bx lr + .align 2, 0 +_0802DC94: .4byte 0x02022d00 +_0802DC98: .4byte 0x000081a8 + thumb_func_end sub_802DC80 + + thumb_func_start sub_802DC9C +sub_802DC9C: @ 802DC9C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0802DCC4 + ldr r0, [r0] + adds r1, r4, 0 + bl sub_802CF50 + ldr r0, _0802DCC8 + adds r4, r0 + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 13 + movs r0, 0x2 + movs r2, 0 + bl bg_change_y_offset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802DCC4: .4byte 0x02022d00 +_0802DCC8: .4byte 0x082fe1df + 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, _0802DD04 + 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 + .align 2, 0 +_0802DD04: .4byte 0x02022d00 + 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, _0802DD5C + str r0, [sp, 0x8] + ldr r0, _0802DD60 + 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 + .align 2, 0 +_0802DD5C: .4byte 0x082fe1ec +_0802DD60: .4byte 0x082fe1f4 + 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, _0802DD9C + ldr r0, [r0] + bl sub_802CBF0 + pop {r0} + bx r0 + .align 2, 0 +_0802DD9C: .4byte 0x02022d00 + 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, _0802DDB4 + ldr r0, [r0] + bl sub_802CC88 + pop {r0} + bx r0 + .align 2, 0 +_0802DDB4: .4byte 0x02022d00 + thumb_func_end sub_802DDA0 + + thumb_func_start sub_802DDB8 +sub_802DDB8: @ 802DDB8 + push {lr} + adds r1, r0, 0 + ldr r0, _0802DDC8 + ldr r0, [r0] + bl sub_802CC18 + pop {r1} + bx r1 + .align 2, 0 +_0802DDC8: .4byte 0x02022d00 + thumb_func_end sub_802DDB8 + + thumb_func_start sub_802DDCC +sub_802DDCC: @ 802DDCC + push {lr} + ldr r0, _0802DDDC + ldr r0, [r0] + bl sub_802CCB0 + pop {r0} + bx r0 + .align 2, 0 +_0802DDDC: .4byte 0x02022d00 + thumb_func_end sub_802DDCC + + thumb_func_start sub_802DDE0 +sub_802DDE0: @ 802DDE0 + push {lr} + ldr r0, _0802DDF0 + ldr r0, [r0] + bl sub_802CD3C + pop {r0} + bx r0 + .align 2, 0 +_0802DDF0: .4byte 0x02022d00 + thumb_func_end sub_802DDE0 + + thumb_func_start sub_802DDF4 +sub_802DDF4: @ 802DDF4 + push {lr} + adds r1, r0, 0 + ldr r0, _0802DE04 + ldr r0, [r0] + bl sub_802CD70 + pop {r0} + bx r0 + .align 2, 0 +_0802DE04: .4byte 0x02022d00 + thumb_func_end sub_802DDF4 + + thumb_func_start sub_802DE08 +sub_802DE08: @ 802DE08 + push {lr} + ldr r0, _0802DE18 + ldr r0, [r0] + bl sub_802CD98 + pop {r1} + bx r1 + .align 2, 0 +_0802DE18: .4byte 0x02022d00 + 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, _0802DEBC + subs r0, r7, 0x2 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + ldr r2, _0802DEC0 + ldr r0, [sp] + ands r0, r2 + ldr r1, _0802DEC4 + 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, _0802DEC8 + ands r0, r1 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + ldr r1, _0802DECC + 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, _0802DEC8 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldrb r2, [r4, 0x2] + lsls r2, 16 + ldr r0, _0802DED0 + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, sp + bl Window_AddFromTemplate + ldr r1, _0802DED4 + ldr r1, [r1] + lsls r2, r5, 1 + adds r1, 0x1C + adds r1, r2 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl Window_FillTileMap + 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 gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802DEBC: .4byte 0x082fe234 +_0802DEC0: .4byte 0xffffff00 +_0802DEC4: .4byte 0x00ffffff +_0802DEC8: .4byte 0xffff00ff +_0802DECC: .4byte 0x0000ffff +_0802DED0: .4byte 0xff00ffff +_0802DED4: .4byte 0x02022d00 + 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, _0802DF6C + ldr r0, [r6] + lsls r1, r5, 1 + mov r8, r1 + adds r0, 0x1C + add r0, r8 + ldrb r0, [r0] + movs r1, 0 + bl Window_FastFillPixels + 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 font_get_width_of_string + 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 Window_CopyToVram + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802DF6C: .4byte 0x02022d00 + 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, _0802E008 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + adds r4, 0x1 + cmp r4, r5 + blt _0802DFE4 +_0802DFFA: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802E008: .4byte 0x02022d00 + 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, _0802E050 + ldr r2, [r0] + movs r0, 0 + str r0, [r2, 0x18] + lsrs r1, 25 + lsls r1, 16 + movs r0, 0x1 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + ands r4, r0 + lsls r4, 8 + subs r4, 0x28 + lsls r4, 8 + adds r1, r4, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + bl gpu_sync_bg_show + ldr r0, _0802E054 + movs r1, 0x4 + bl AddTask + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802E050: .4byte 0x02022d00 +_0802E054: .4byte sub_802E090 + 1 + thumb_func_end sub_802E00C + + thumb_func_start sub_802E058 +sub_802E058: @ 802E058 + push {r4,lr} + ldr r4, _0802E068 + ldr r0, [r4] + ldr r0, [r0, 0x18] + cmp r0, 0x1F + bls _0802E06C + movs r0, 0 + b _0802E08A + .align 2, 0 +_0802E068: .4byte 0x02022d00 +_0802E06C: + movs r0, 0x1 + movs r1, 0x80 + movs r2, 0x1 + bl bg_change_y_offset + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r0, 0x1 + str r0, [r1, 0x18] + cmp r0, 0x1F + bls _0802E088 + movs r0, 0x1 + bl gpu_sync_bg_hide +_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, _0802E104 + 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 + .align 2, 0 +_0802E104: .4byte 0x03003090 +_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, _0802E1B4 + 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, _0802E1B8 + 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 + .align 2, 0 +_0802E1B4: .4byte 0x00007fff +_0802E1B8: .4byte 0xffff8000 + 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, _0802E224 + 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 + .align 2, 0 +_0802E224: .4byte 0x03003090 +_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, _0802E2C0 + 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 + .align 2, 0 +_0802E2C0: .4byte 0x03003090 +_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, _0802E31C + 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 + .align 2, 0 +_0802E31C: .4byte 0x03003090 +_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, _0802E338 + ldr r0, [r0] + movs r1, 0xFE + lsls r1, 1 + adds r0, r1 + bx lr + .align 2, 0 +_0802E338: .4byte 0x03005d90 + 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, _0802E3A0 + cmp r4, r0 + bhi _0802E378 + str r4, [r1, 0xC] + movs r2, 0x1 +_0802E378: + ldrh r0, [r1] + cmp r0, r5 + bcs _0802E388 + ldr r0, _0802E3A4 + cmp r5, r0 + bhi _0802E388 + strh r5, [r1] + movs r2, 0x1 +_0802E388: + ldrh r0, [r1, 0x4] + cmp r0, r6 + bcs _0802E398 + ldr r0, _0802E3A4 + cmp r6, r0 + bhi _0802E398 + strh r6, [r1, 0x4] + movs r2, 0x1 +_0802E398: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802E3A0: .4byte 0x00018696 +_0802E3A4: .4byte 0x0000270f + 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, _0802E3C0 + cmp r1, r0 + bhi _0802E3BC + adds r0, r1, 0x1 + strh r0, [r2, 0x6] +_0802E3BC: + pop {r0} + bx r0 + .align 2, 0 +_0802E3C0: .4byte 0x0000270e + thumb_func_end sub_802E3A8 + + thumb_func_start sub_802E3C4 +sub_802E3C4: @ 802E3C4 + push {r4,lr} + ldr r4, _0802E3E0 + 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 + .align 2, 0 +_0802E3E0: .4byte sub_802E3E4 + 1 + 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, _0802E408 + 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 + .align 2, 0 +_0802E408: .4byte 0x03005e08 +_0802E40C: + cmp r0, 0x2 + beq _0802E4B4 + cmp r0, 0x3 + beq _0802E4DC + b _0802E4F6 +_0802E416: + ldr r0, _0802E494 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r1, _0802E498 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r4, r0, 0 + movs r6, 0 + ldr r5, _0802E49C +_0802E430: + ldr r1, [r5] + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + 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, _0802E4A0 + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r4, 24 + ldr r1, _0802E4A4 + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, sp + bl Window_AddFromTemplate + strh r0, [r7, 0x2] + ldrh r0, [r7, 0x2] + adds r1, r4, 0 + bl sub_802E500 + ldrb r0, [r7, 0x2] + movs r1, 0x3 + b _0802E4CA + .align 2, 0 +_0802E494: .4byte 0x082fe270 +_0802E498: .4byte 0x085ede8d +_0802E49C: .4byte 0x082fe278 +_0802E4A0: .4byte 0xffff00ff +_0802E4A4: .4byte 0x00ffffff +_0802E4A8: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802E4F6 + b _0802E4CE +_0802E4B4: + ldr r0, _0802E4D8 + 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 Window_CopyToVram +_0802E4CE: + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + b _0802E4F6 + .align 2, 0 +_0802E4D8: .4byte 0x030022c0 +_0802E4DC: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0802E4F6 + ldrb r0, [r7, 0x2] + bl Window_Remove + 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, _0802E610 + 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 Window_FastFillPixels + ldr r5, _0802E614 + ldr r1, [sp, 0x1C] + lsls r2, r1, 3 + movs r0, 0x1 + adds r1, r5, 0 + bl sub_81DB35C + 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, _0802E618 +_0802E58A: + ldr r1, _0802E61C + 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 decimal_int_to_string + adds r0, r5, 0 + bl sub_802E620 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0 + bl font_get_width_of_string + 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 Window_WriteStandardTileMap + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802E610: .4byte 0x0000021d +_0802E614: .4byte 0x085ede8d +_0802E618: .4byte 0x02021cc4 +_0802E61C: .4byte 0x082fe278 + 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, _0802E67C + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0802E680 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r5, [r0, 0xA] + ldr r0, _0802E684 + 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 + .align 2, 0 +_0802E67C: .4byte sub_802E6D0 + 1 +_0802E680: .4byte 0x03005e00 +_0802E684: .4byte 0x082fe748 + thumb_func_end sub_802E63C + + thumb_func_start sub_802E688 +sub_802E688: @ 802E688 + push {lr} + ldr r0, _0802E6AC + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _0802E6B4 + ldr r0, _0802E6B0 + 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 + .align 2, 0 +_0802E6AC: .4byte sub_802E6D0 + 1 +_0802E6B0: .4byte 0x03005e00 +_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, _0802E6CC + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0802E6CC: .4byte sub_802E6D0 + 1 + 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, _0802E6F4 + 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 + .align 2, 0 +_0802E6F4: .4byte 0x03005e08 +_0802E6F8: + cmp r0, 0x4 + beq _0802E738 + b _0802E752 +_0802E6FE: + ldr r1, _0802E718 + 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 + .align 2, 0 +_0802E718: .4byte 0x082fe748 +_0802E71C: + ldr r0, _0802E734 + 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 + .align 2, 0 +_0802E734: .4byte 0x082fe748 +_0802E738: + ldr r0, _0802E758 + 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 + .align 2, 0 +_0802E758: .4byte 0x082fe748 + 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, _0802E82C + adds r0, r1 + bl gpu_tile_obj_decompress_and_load + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 3 + ldr r1, _0802E830 + adds r0, r1 + bl gpu_pal_obj_alloc_tag_and_apply + 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, _0802E834 + adds r0, r1 + movs r2, 0x12 + ldrsh r1, [r4, r2] + movs r3, 0x14 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0xE] + bl obj_add_from_template_forward_search + 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, _0802E838 +_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 + .align 2, 0 +_0802E82C: .4byte 0x082fe6c8 +_0802E830: .4byte 0x082fe6d8 +_0802E834: .4byte 0x082fe730 +_0802E838: .4byte 0x02020630 + 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, _0802E8BC + 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, _0802E8C0 + adds r0, r5 + movs r1, 0x4 + bl obj_anim_image_start + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0802E8C4 + 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 obj_anim_image_start + 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 + .align 2, 0 +_0802E8BC: .4byte 0x03005e08 +_0802E8C0: .4byte 0x02020630 +_0802E8C4: .4byte 0x0000ffe0 + 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, _0802E8DC + adds r4, r1, r0 + b _0802E8FC + .align 2, 0 +_0802E8DC: .4byte 0x03005e08 +_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, _0802E92C + adds r0, r1 + bl obj_delete_and_free_tiles + 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, _0802E930 + movs r2, 0x6 + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_free_by_tag + ldr r1, _0802E934 + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802E92C: .4byte 0x02020630 +_0802E930: .4byte 0x082fe6c8 +_0802E934: .4byte 0x082fe6d8 + 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, _0802E97C + 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, _0802E980 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E97C: .4byte 0x03005e08 +_0802E980: .4byte _0802E984 + .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 obj_anim_image_start + b _0802EA44 +_0802E9BA: + movs r0, 0x15 + bl audio_play + ldrh r1, [r6, 0x32] + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl obj_anim_image_start + ldr r4, _0802EA00 + 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 + .align 2, 0 +_0802EA00: .4byte 0x02020630 +_0802EA04: + adds r1, r6, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r3, _0802EA40 + 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 + .align 2, 0 +_0802EA40: .4byte 0x02020630 +_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, _0802EAA4 + adds r6, r4, r5 + movs r0, 0x38 + bl audio_play + ldr r2, _0802EAA8 + 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, _0802EAAC + 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 + .align 2, 0 +_0802EAA4: .4byte 0x03005e08 +_0802EAA8: .4byte 0x02020630 +_0802EAAC: .4byte sub_802E938 + 1 + 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, _0802EB04 + adds r4, r1, r0 + ldr r0, _0802EB08 + ldrb r0, [r0] + cmp r0, 0 + beq _0802EB14 + ldr r1, _0802EB0C + ldrh r0, [r1, 0x2] + ldr r5, _0802EB10 + 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 + .align 2, 0 +_0802EB04: .4byte 0x03005e08 +_0802EB08: .4byte 0x03003124 +_0802EB0C: .4byte 0x03003090 +_0802EB10: .4byte 0x00007fff +_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, _0802EB7C + movs r1, 0x50 + str r3, [sp] + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0802EB80 + 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 + .align 2, 0 +_0802EB7C: .4byte sub_802EB98 + 1 +_0802EB80: .4byte 0x03005e00 + thumb_func_end sub_802EB24 + + thumb_func_start sub_802EB84 +sub_802EB84: @ 802EB84 + push {lr} + ldr r0, _0802EB94 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0802EB94: .4byte sub_802EB98 + 1 + 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, _0802EBBC + 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 + .align 2, 0 +_0802EBBC: .4byte 0x03005e08 +_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, _0802EC48 + 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 obj_delete_and_free_tiles +_0802EC3E: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0802EC8A + .align 2, 0 +_0802EC48: .4byte 0x02020630 +_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, _0802EC94 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r0, 0x12 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + ldrh r0, [r5, 0x4] + bl gpu_tile_obj_free_by_tag + ldrh r0, [r5, 0x6] + bl gpu_pal_free_tag + adds r0, r6, 0 + bl remove_task +_0802EC8A: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802EC94: .4byte 0x02020630 + 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, _0802ECBC + adds r4, r1, r0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bls _0802ECB2 + b _0802EDC4 +_0802ECB2: + lsls r0, 2 + ldr r1, _0802ECC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802ECBC: .4byte 0x02020630 +_0802ECC0: .4byte _0802ECC4 + .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 sub_8008258 + 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 obj_anim_image_start + 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 sub_8008258 +_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, _0802EE24 + mov r8, r0 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r5, r4, r0 + ldr r0, _0802EE28 + 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, _0802EE2C + str r0, [r4] + add r3, r8 + str r0, [r3] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802EE24: .4byte 0x02020630 +_0802EE28: .4byte 0x0000ffd8 +_0802EE2C: .4byte sub_802EE5C + 1 + 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, _0802EE54 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, 0x1C + adds r1, r2 + ldr r1, [r1] + ldr r0, _0802EE58 + cmp r1, r0 + bne _0802EE4E + movs r3, 0x1 +_0802EE4E: + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_0802EE54: .4byte 0x02020630 +_0802EE58: .4byte sub_802EE5C + 1 + 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, _0802EE78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802EE78: .4byte _0802EE7C + .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, _0802EEF8 + 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 + .align 2, 0 +_0802EEF8: .4byte 0x08329f40 +_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, _0802EF30 + 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 + .align 2, 0 +_0802EF30: .4byte 0x08329f40 +_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, _0802EF4C + str r0, [r5, 0x1C] +_0802EF46: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802EF4C: .4byte nullsub_12 + 1 + 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, _0802EF98 + ldr r3, [r2, 0x4] + ldr r2, [r2] + str r2, [sp] + str r3, [sp, 0x4] + ldr r2, _0802EF9C + ldr r3, [r2, 0x4] + ldr r2, [r2] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + lsls r0, 16 + ldr r3, _0802EFA0 + ldr r2, [sp, 0x4] + ands r2, r3 + orrs r2, r0 + str r2, [sp, 0x4] + ldr r2, _0802EFA4 + add r4, sp, 0x8 + ldr r0, [r4, 0x4] + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + bl gpu_tile_obj_decompress_and_load + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802EF98: .4byte 0x082febcc +_0802EF9C: .4byte 0x082febd4 +_0802EFA0: .4byte 0x0000ffff +_0802EFA4: .4byte 0xffff0000 + 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, _0802EFF8 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802EFF8: .4byte 0x082fec90 + 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, _0802F0C0 + 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, _0802F0C4 + 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 obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r4, r8 + strh r0, [r4] + ldr r2, _0802F0C8 + 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 obj_anim_image_start + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802F0C0: .4byte 0x082feca8 +_0802F0C4: .4byte 0xffe00000 +_0802F0C8: .4byte 0x02020630 + thumb_func_end sub_802EFFC + + thumb_func_start sub_802F0CC +sub_802F0CC: @ 802F0CC + ldr r2, _0802F0DC + ldr r1, _0802F0E0 + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + bx lr + .align 2, 0 +_0802F0DC: .4byte 0x03000dce +_0802F0E0: .4byte 0x04000208 + thumb_func_end sub_802F0CC + + thumb_func_start sub_802F0E4 +sub_802F0E4: @ 802F0E4 + ldr r0, _0802F0F0 + ldr r1, _0802F0F4 + ldrh r1, [r1] + strh r1, [r0] + bx lr + .align 2, 0 +_0802F0F0: .4byte 0x04000208 +_0802F0F4: .4byte 0x03000dce + thumb_func_end sub_802F0E4 + + thumb_func_start sub_802F0F8 +sub_802F0F8: @ 802F0F8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9F + bhi _0802F10A + movs r3, 0xF + ands r3, r2 + cmp r3, 0x9 + bls _0802F10E +_0802F10A: + movs r0, 0xFF + b _0802F11C +_0802F10E: + lsrs r1, r0, 28 + movs r0, 0xF + ands r1, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, r3 +_0802F11C: + pop {r1} + bx r1 + thumb_func_end sub_802F0F8 + + thumb_func_start sub_802F120 +sub_802F120: @ 802F120 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + ands r0, r4 + cmp r0, 0 + bne _0802F138 + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + cmp r0, 0 + bne _0802F146 +_0802F138: + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, 0 + bl __umodsi3 + cmp r0, 0 + bne _0802F14A +_0802F146: + movs r0, 0x1 + b _0802F14C +_0802F14A: + movs r0, 0 +_0802F14C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802F120 + + thumb_func_start sub_802F154 +sub_802F154: @ 802F154 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r5, 0 + subs r4, r7, 0x1 + cmp r4, 0 + blt _0802F192 +_0802F170: + ldr r1, _0802F1D8 + adds r0, r5, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl sub_802F120 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0802F18C + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0802F18C: + subs r4, 0x1 + cmp r4, 0 + bge _0802F170 +_0802F192: + subs r0, r6, 0x1 + cmp r0, 0 + ble _0802F1AA + ldr r1, _0802F1DC + adds r4, r0, 0 +_0802F19C: + ldm r1!, {r0} + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + subs r4, 0x1 + cmp r4, 0 + bne _0802F19C +_0802F1AA: + cmp r6, 0x2 + bls _0802F1C2 + adds r0, r7, 0 + bl sub_802F120 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0802F1C2 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0802F1C2: + mov r1, r8 + adds r0, r5, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802F1D8: .4byte 0x0000016d +_0802F1DC: .4byte 0x082feccc + thumb_func_end sub_802F154 + + thumb_func_start sub_802F1E0 +sub_802F1E0: @ 802F1E0 + push {r4-r6,lr} + adds r6, r0, 0 + ldrb r0, [r6] + bl sub_802F0F8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r6, 0x1] + bl sub_802F0F8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6, 0x2] + bl sub_802F0F8 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_802F154 + lsls r0, 16 + lsrs r0, 16 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_802F1E0 + + thumb_func_start sub_802F21C +sub_802F21C: @ 802F21C + push {r4,r5,lr} + ldr r5, _0802F248 + movs r0, 0 + strh r0, [r5] + bl sub_802F0CC + bl sub_82E2150 + bl sub_82E2180 + ldr r4, _0802F24C + strb r0, [r4] + bl sub_802F0E4 + ldrb r4, [r4] + movs r0, 0xF + ands r0, r4 + cmp r0, 0x1 + beq _0802F250 + movs r0, 0x1 + strh r0, [r5] + b _0802F26E + .align 2, 0 +_0802F248: .4byte 0x03000db8 +_0802F24C: .4byte 0x03000dcc +_0802F250: + movs r0, 0xF0 + ands r0, r4 + cmp r0, 0 + beq _0802F25A + movs r0, 0x2 +_0802F25A: + strh r0, [r5] + ldr r4, _0802F274 + adds r0, r4, 0 + bl sub_802F2E8 + adds r0, r4, 0 + bl sub_802F2FC + ldr r1, _0802F278 + strh r0, [r1] +_0802F26E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802F274: .4byte 0x03000dc0 +_0802F278: .4byte 0x03000db8 + thumb_func_end sub_802F21C + + thumb_func_start sub_802F27C +sub_802F27C: @ 802F27C + ldr r0, _0802F284 + ldrh r0, [r0] + bx lr + .align 2, 0 +_0802F284: .4byte 0x03000db8 + thumb_func_end sub_802F27C + + thumb_func_start sub_802F288 +sub_802F288: @ 802F288 + push {r4,lr} + adds r2, r0, 0 + ldr r0, _0802F2A4 + ldrh r1, [r0] + movs r0, 0xFF + lsls r0, 4 + ands r0, r1 + cmp r0, 0 + beq _0802F2AC + adds r1, r2, 0 + ldr r0, _0802F2A8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + b _0802F2B2 + .align 2, 0 +_0802F2A4: .4byte 0x03000db8 +_0802F2A8: .4byte 0x082fecc0 +_0802F2AC: + adds r0, r2, 0 + bl sub_802F2E8 +_0802F2B2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802F288 + + thumb_func_start sub_802F2B8 +sub_802F2B8: @ 802F2B8 + push {r4,lr} + adds r4, r0, 0 + bl sub_802F0CC + adds r0, r4, 0 + bl sub_82E2450 + bl sub_802F0E4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802F2B8 + + thumb_func_start sub_802F2D0 +sub_802F2D0: @ 802F2D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_802F0CC + adds r0, r4, 0 + bl sub_82E22DC + bl sub_802F0E4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802F2D0 + + thumb_func_start sub_802F2E8 +sub_802F2E8: @ 802F2E8 + push {r4,lr} + adds r4, r0, 0 + bl sub_802F2D0 + adds r0, r4, 0 + bl sub_802F2B8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802F2E8 + + thumb_func_start sub_802F2FC +sub_802F2FC: @ 802F2FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + ldrb r1, [r7, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + asrs r4, r0, 31 + movs r0, 0x20 + ands r4, r0 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0802F322 + movs r0, 0x10 + orrs r4, r0 +_0802F322: + ldrb r0, [r7] + bl sub_802F0F8 + mov r8, r0 + cmp r0, 0xFF + bne _0802F336 + movs r0, 0x40 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F336: + ldrb r0, [r7, 0x1] + bl sub_802F0F8 + adds r6, r0, 0 + cmp r6, 0xFF + beq _0802F34A + cmp r6, 0 + beq _0802F34A + cmp r6, 0xC + ble _0802F352 +_0802F34A: + movs r0, 0x80 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F352: + ldrb r0, [r7, 0x2] + bl sub_802F0F8 + adds r5, r0, 0 + cmp r5, 0xFF + bne _0802F36A + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F36A: + cmp r6, 0x2 + bne _0802F384 + mov r0, r8 + bl sub_802F120 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0802F380 + ldr r1, [r1, 0x4] + adds r0, r1 + b _0802F38E + .align 2, 0 +_0802F380: .4byte 0x082feccc +_0802F384: + ldr r0, _0802F3F4 + subs r1, r6, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_0802F38E: + cmp r5, r0 + ble _0802F39E + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F39E: + ldrb r0, [r7, 0x4] + bl sub_802F0F8 + adds r5, r0, 0 + cmp r5, 0x18 + ble _0802F3B6 + movs r1, 0x80 + lsls r1, 2 + adds r0, r1, 0 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F3B6: + ldrb r0, [r7, 0x5] + bl sub_802F0F8 + adds r5, r0, 0 + cmp r5, 0x3C + ble _0802F3CE + movs r1, 0x80 + lsls r1, 3 + adds r0, r1, 0 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F3CE: + ldrb r0, [r7, 0x6] + bl sub_802F0F8 + adds r5, r0, 0 + cmp r5, 0x3C + ble _0802F3E6 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + orrs r4, r0 + lsls r0, r4, 16 + lsrs r4, r0, 16 +_0802F3E6: + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802F3F4: .4byte 0x082feccc + thumb_func_end sub_802F2FC + + thumb_func_start sub_802F3F8 +sub_802F3F8: @ 802F3F8 + push {lr} + bl sub_802F0CC + bl sub_82E2258 + bl sub_802F0E4 + pop {r0} + bx r0 + thumb_func_end sub_802F3F8 + + thumb_func_start sub_802F40C +sub_802F40C: @ 802F40C + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + movs r4, 0xF0 + strb r4, [r0] + adds r0, 0x1 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + strb r4, [r0] + adds r0, 0x1 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + movs r1, 0xFF + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802F40C + + thumb_func_start sub_802F444 +sub_802F444: @ 802F444 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8008E20 + movs r4, 0xF0 + strb r4, [r0] + adds r0, 0x1 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8008E20 + strb r4, [r0] + adds r0, 0x1 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8008E20 + movs r1, 0xFF + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802F444 + + thumb_func_start sub_802F47C +sub_802F47C: @ 802F47C + push {lr} + ldr r3, _0802F490 + ldrb r1, [r3, 0x4] + ldrb r2, [r3, 0x5] + ldrb r3, [r3, 0x6] + bl sub_802F444 + pop {r0} + bx r0 + .align 2, 0 +_0802F490: .4byte 0x03000dc0 + thumb_func_end sub_802F47C + + thumb_func_start sub_802F494 +sub_802F494: @ 802F494 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + movs r2, 0x2 + movs r3, 0x4 + bl decimal_int_to_string + movs r4, 0xAE + strb r4, [r0] + adds r0, 0x1 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + strb r4, [r0] + adds r0, 0x1 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + movs r1, 0xFF + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802F494 + + thumb_func_start sub_802F4CC +sub_802F4CC: @ 802F4CC + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + movs r2, 0x2 + movs r3, 0x4 + bl sub_8008E20 + movs r4, 0xAE + strb r4, [r0] + adds r0, 0x1 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8008E20 + strb r4, [r0] + adds r0, 0x1 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8008E20 + movs r1, 0xFF + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802F4CC + + thumb_func_start sub_802F504 +sub_802F504: @ 802F504 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + bl sub_802F1E0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5, 0x6] + bl sub_802F0F8 + ldrb r1, [r6, 0x4] + subs r0, r1 + strb r0, [r7, 0x4] + ldrb r0, [r5, 0x5] + bl sub_802F0F8 + ldrb r1, [r6, 0x3] + subs r0, r1 + strb r0, [r7, 0x3] + ldrb r0, [r5, 0x4] + bl sub_802F0F8 + ldrb r1, [r6, 0x2] + subs r0, r1 + strb r0, [r7, 0x2] + ldrh r0, [r6] + subs r4, r0 + strh r4, [r7] + ldrb r1, [r7, 0x4] + movs r0, 0x4 + ldrsb r0, [r7, r0] + cmp r0, 0 + bge _0802F556 + adds r0, r1, 0 + adds r0, 0x3C + strb r0, [r7, 0x4] + ldrb r0, [r7, 0x3] + subs r0, 0x1 + strb r0, [r7, 0x3] +_0802F556: + ldrb r1, [r7, 0x3] + movs r0, 0x3 + ldrsb r0, [r7, r0] + cmp r0, 0 + bge _0802F56C + adds r0, r1, 0 + adds r0, 0x3C + strb r0, [r7, 0x3] + ldrb r0, [r7, 0x2] + subs r0, 0x1 + strb r0, [r7, 0x2] +_0802F56C: + ldrb r1, [r7, 0x2] + movs r0, 0x2 + ldrsb r0, [r7, r0] + cmp r0, 0 + bge _0802F582 + adds r0, r1, 0 + adds r0, 0x18 + strb r0, [r7, 0x2] + ldrh r0, [r7] + subs r0, 0x1 + strh r0, [r7] +_0802F582: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802F504 + + thumb_func_start sub_802F588 +sub_802F588: @ 802F588 + push {r4,lr} + ldr r4, _0802F5A8 + adds r0, r4, 0 + bl sub_802F288 + ldr r1, _0802F5AC + ldr r0, _0802F5B0 + ldr r2, [r0] + adds r2, 0x98 + adds r0, r4, 0 + bl sub_802F504 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802F5A8: .4byte 0x03000dc0 +_0802F5AC: .4byte 0x03005cf8 +_0802F5B0: .4byte 0x03005d90 + thumb_func_end sub_802F588 + + thumb_func_start sub_802F5B4 +sub_802F5B4: @ 802F5B4 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r0, 0 + adds r1, r3, 0 + movs r3, 0 + bl sub_802F5C8 + pop {r0} + bx r0 + thumb_func_end sub_802F5B4 + + thumb_func_start sub_802F5C8 +sub_802F5C8: @ 802F5C8 + push {r4,r5,lr} + ldr r4, _0802F5F0 + strh r0, [r4] + strb r1, [r4, 0x2] + strb r2, [r4, 0x3] + strb r3, [r4, 0x4] + ldr r5, _0802F5F4 + adds r0, r5, 0 + bl sub_802F288 + ldr r0, _0802F5F8 + ldr r1, [r0] + adds r1, 0x98 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_802F504 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802F5F0: .4byte 0x03005cf8 +_0802F5F4: .4byte 0x03000dc0 +_0802F5F8: .4byte 0x03005d90 + thumb_func_end sub_802F5C8 + + thumb_func_start sub_802F5FC +sub_802F5FC: @ 802F5FC + push {r4-r6,lr} + adds r4, r0, 0 + ldrb r3, [r2, 0x4] + ldrb r0, [r1, 0x4] + subs r5, r3, r0 + strb r5, [r4, 0x4] + ldrb r3, [r2, 0x3] + ldrb r0, [r1, 0x3] + subs r6, r3, r0 + strb r6, [r4, 0x3] + ldrb r0, [r2, 0x2] + ldrb r3, [r1, 0x2] + subs r0, r3 + strb r0, [r4, 0x2] + ldrh r0, [r2] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r4] + lsls r0, r5, 24 + cmp r0, 0 + bge _0802F630 + adds r0, r5, 0 + adds r0, 0x3C + strb r0, [r4, 0x4] + subs r0, r6, 0x1 + strb r0, [r4, 0x3] +_0802F630: + ldrb r1, [r4, 0x3] + movs r0, 0x3 + ldrsb r0, [r4, r0] + cmp r0, 0 + bge _0802F646 + adds r0, r1, 0 + adds r0, 0x3C + strb r0, [r4, 0x3] + ldrb r0, [r4, 0x2] + subs r0, 0x1 + strb r0, [r4, 0x2] +_0802F646: + ldrb r1, [r4, 0x2] + movs r0, 0x2 + ldrsb r0, [r4, r0] + cmp r0, 0 + bge _0802F65C + adds r0, r1, 0 + adds r0, 0x18 + strb r0, [r4, 0x2] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] +_0802F65C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802F5FC + + thumb_func_start sub_802F664 +sub_802F664: @ 802F664 + push {r4,lr} + ldr r4, _0802F698 + adds r0, r4, 0 + bl sub_802F288 + adds r0, r4, 0 + bl sub_802F1E0 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + ldrb r2, [r4, 0x4] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + adds r0, r1 + ldrb r4, [r4, 0x5] + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802F698: .4byte 0x03000dc0 + thumb_func_end sub_802F664 + + thumb_func_start sub_802F69C +sub_802F69C: @ 802F69C + push {lr} + ldr r0, _0802F6AC + bl sub_802F1E0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_0802F6AC: .4byte 0x03000dc0 + thumb_func_end sub_802F69C + + thumb_func_start c2_title_menu_3 +c2_title_menu_3: @ 802F6B0 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end c2_title_menu_3 + + thumb_func_start sub_802F6C8 +sub_802F6C8: @ 802F6C8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_802F6C8 + + thumb_func_start c2_title_menu_2 +c2_title_menu_2: @ 802F6DC + push {lr} + movs r0, 0 + bl init_title_menu + pop {r0} + bx r0 + thumb_func_end c2_title_menu_2 + + thumb_func_start c2_title_menu_2_dupe +c2_title_menu_2_dupe: @ 802F6E8 + push {lr} + movs r0, 0x1 + bl init_title_menu + pop {r0} + bx r0 + thumb_func_end c2_title_menu_2_dupe + + thumb_func_start init_title_menu +init_title_menu: @ 802F6F4 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r1, _0802F7D0 + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _0802F7D4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r5, 0 + str r5, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _0802F7D8 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0x4 + strh r5, [r0] + str r0, [r1] + ldr r0, _0802F7DC + str r0, [r1, 0x4] + ldr r0, _0802F7E0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + ldr r0, _0802F7E4 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0802F7E8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + cmp r4, 0 + beq _0802F7EC + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _0802F7FE + .align 2, 0 +_0802F7D0: .4byte 0x040000d4 +_0802F7D4: .4byte 0x8100c000 +_0802F7D8: .4byte 0x85000100 +_0802F7DC: .4byte 0x05000002 +_0802F7E0: .4byte 0x810001ff +_0802F7E4: .4byte 0x082ff0a0 +_0802F7E8: .4byte 0x082ff0c0 +_0802F7EC: + movs r0, 0x1 + negs r0, r0 + ldr r1, _0802F8BC + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_0802F7FE: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0802F8C0 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _0802F8C4 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r1, _0802F8C8 + movs r0, 0 + bl unknown_title_pattern_data_to_vram + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + bl enable_irqs + ldr r0, _0802F8CC + bl SetVBlankCallback + ldr r0, _0802F8D0 + bl set_callback2 + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_hide + ldr r0, _0802F8D4 + movs r1, 0 + bl AddTask + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0802F8BC: .4byte 0x0000ffff +_0802F8C0: .4byte 0x082ff0e8 +_0802F8C4: .4byte 0x082ff038 +_0802F8C8: .4byte 0x000001d5 +_0802F8CC: .4byte sub_802F6C8 + 1 +_0802F8D0: .4byte c2_title_menu_3 + 1 +_0802F8D4: .4byte task_init_title_menu_graphics + 1 + thumb_func_end init_title_menu + + thumb_func_start task_init_title_menu_graphics +task_init_title_menu_graphics: @ 802F8D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, _0802F95C + mov r8, r0 + adds r4, r7, r0 + ldr r0, _0802F960 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0802F900 + b _0802FA4E +_0802F900: + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x11 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x31 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xC1 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x7 + bl lcd_io_set + bl sub_80093CC + lsls r0, 24 + cmp r0, 0 + beq _0802F946 + movs r0, 0x1 + strh r0, [r4, 0x1E] +_0802F946: + ldr r0, _0802F964 + ldrh r0, [r0] + cmp r0, 0x2 + beq _0802F990 + cmp r0, 0x2 + bgt _0802F968 + cmp r0, 0 + beq _0802F9D0 + cmp r0, 0x1 + beq _0802F972 + b _0802F9D0 + .align 2, 0 +_0802F95C: .4byte 0x03005e08 +_0802F960: .4byte 0x02037fd4 +_0802F964: .4byte 0x03006210 +_0802F968: + cmp r0, 0x4 + beq _0802F9EC + cmp r0, 0xFF + beq _0802F9A4 + b _0802F9D0 +_0802F972: + strh r0, [r4] + bl sub_809D4C4 + cmp r0, 0 + beq _0802F982 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_0802F982: + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _0802F98C + b _0802F9FC + .align 2, 0 +_0802F98C: .4byte task_init_title_menu_graphics_2 + 1 +_0802F990: + ldr r0, _0802F9A0 + bl draw_text_box + strh r5, [r4] + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + b _0802F9FA + .align 2, 0 +_0802F9A0: .4byte 0x085e8405 +_0802F9A4: + ldr r0, _0802F9C8 + bl draw_text_box + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _0802F9CC + str r1, [r0] + movs r0, 0x1 + strh r0, [r4] + bl sub_809D4C4 + cmp r0, 0x1 + bne _0802F9FE + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0802F9FE + .align 2, 0 +_0802F9C8: .4byte 0x085e83c2 +_0802F9CC: .4byte task_init_title_menu_save_file_corrupt + 1 +_0802F9D0: + movs r0, 0 + strh r0, [r4] + ldr r1, _0802F9E4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _0802F9E8 + b _0802F9FC + .align 2, 0 +_0802F9E4: .4byte 0x03005e00 +_0802F9E8: .4byte task_init_title_menu_graphics_2 + 1 +_0802F9EC: + ldr r0, _0802FA20 + bl draw_text_box + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + strh r5, [r0, 0x8] +_0802F9FA: + ldr r1, _0802FA24 +_0802F9FC: + str r1, [r0] +_0802F9FE: + ldr r2, _0802FA28 + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0802FA3E + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + beq _0802FA36 + cmp r0, 0x2 + ble _0802FA2C + cmp r0, 0x3 + beq _0802FA3A + b _0802FA3E + .align 2, 0 +_0802FA20: .4byte 0x085e8440 +_0802FA24: .4byte task_init_title_menu_save_file_corrupt + 1 +_0802FA28: .4byte 0x02022d06 +_0802FA2C: + cmp r0, 0 + blt _0802FA3E + ldrh r0, [r4] + adds r0, 0x1 + b _0802FA3C +_0802FA36: + movs r0, 0x3 + b _0802FA3C +_0802FA3A: + movs r0, 0x4 +_0802FA3C: + strh r0, [r2] +_0802FA3E: + ldrh r1, [r2] + ldr r0, _0802FA58 + ands r0, r1 + strh r0, [r2] + strh r0, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x2 + strh r0, [r4, 0x18] +_0802FA4E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802FA58: .4byte 0x00007fff + thumb_func_end task_init_title_menu_graphics + + thumb_func_start task_init_title_menu_save_file_corrupt +task_init_title_menu_save_file_corrupt: @ 802FA5C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl run_remoboxes + movs r0, 0x7 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0802FA98 + ldr r0, _0802FAA0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0802FA98 + movs r0, 0x7 + bl Window_FillTileMap + ldr r0, _0802FAA4 + bl sub_8032250 + ldr r1, _0802FAA8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0802FAAC + str r1, [r0] +_0802FA98: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802FAA0: .4byte 0x030022c0 +_0802FAA4: .4byte 0x082ff070 +_0802FAA8: .4byte 0x03005e00 +_0802FAAC: .4byte task_init_title_menu_graphics_2 + 1 + thumb_func_end task_init_title_menu_save_file_corrupt + + thumb_func_start task_init_title_menu_graphics_2 +task_init_title_menu_graphics_2: @ 802FAB0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _0802FB1C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802FB3C + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x11 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x31 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xC1 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x7 + bl lcd_io_set + bl sub_802F27C + movs r1, 0xFF + lsls r1, 4 + ands r1, r0 + cmp r1, 0 + bne _0802FB28 + ldr r0, _0802FB20 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0802FB24 + str r0, [r1] + b _0802FB3C + .align 2, 0 +_0802FB1C: .4byte 0x02037fd4 +_0802FB20: .4byte 0x03005e00 +_0802FB24: .4byte task_init_title_menu_graphics_3 + 1 +_0802FB28: + ldr r0, _0802FB44 + bl draw_text_box + ldr r1, _0802FB48 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0802FB4C + str r1, [r0] +_0802FB3C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802FB44: .4byte 0x085e8453 +_0802FB48: .4byte 0x03005e00 +_0802FB4C: .4byte task_init_title_menu_battery_dry + 1 + thumb_func_end task_init_title_menu_graphics_2 + + thumb_func_start task_init_title_menu_battery_dry +task_init_title_menu_battery_dry: @ 802FB50 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl run_remoboxes + movs r0, 0x7 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0802FB8C + ldr r0, _0802FB94 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0802FB8C + movs r0, 0x7 + bl Window_FillTileMap + ldr r0, _0802FB98 + bl sub_8032250 + ldr r1, _0802FB9C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0802FBA0 + str r1, [r0] +_0802FB8C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802FB94: .4byte 0x030022c0 +_0802FB98: .4byte 0x082ff070 +_0802FB9C: .4byte 0x03005e00 +_0802FBA0: .4byte task_init_title_menu_graphics_3 + 1 + thumb_func_end task_init_title_menu_battery_dry + + thumb_func_start task_init_title_menu_graphics_3 +task_init_title_menu_graphics_3: @ 802FBA4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0802FC68 + adds r6, r0, r1 + ldr r0, _0802FC6C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0802FBCE + b _0803006C +_0802FBCE: + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x11 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x31 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xC1 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x7 + bl lcd_io_set + add r0, sp, 0xC + strh r4, [r0] + movs r1, 0xFE + movs r2, 0x2 + bl gpu_pal_apply + add r1, sp, 0xC + ldr r2, _0802FC70 + adds r0, r2, 0 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xFA + movs r2, 0x2 + bl gpu_pal_apply + add r1, sp, 0xC + ldr r2, _0802FC74 + adds r0, r2, 0 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xFB + movs r2, 0x2 + bl gpu_pal_apply + add r1, sp, 0xC + ldr r2, _0802FC78 + adds r0, r2, 0 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xFC + movs r2, 0x2 + bl gpu_pal_apply + ldr r0, _0802FC7C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0802FC84 + add r1, sp, 0xC + ldr r2, _0802FC80 + adds r0, r2, 0 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xF1 + movs r2, 0x2 + bl gpu_pal_apply + b _0802FC96 + .align 2, 0 +_0802FC68: .4byte 0x03005e08 +_0802FC6C: .4byte 0x02037fd4 +_0802FC70: .4byte 0x00007fff +_0802FC74: .4byte 0x0000318c +_0802FC78: .4byte 0x0000675a +_0802FC7C: .4byte 0x03005d90 +_0802FC80: .4byte 0x00007e04 +_0802FC84: + add r1, sp, 0xC + ldr r2, _0802FD28 + adds r0, r2, 0 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xF1 + movs r2, 0x2 + bl gpu_pal_apply +_0802FC96: + ldr r0, _0802FD2C + mov r8, r0 + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + add r0, r8 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r9, r1 + cmp r0, 0x1 + beq _0802FD44 + cmp r0, 0x1 + ble _0802FCBC + cmp r0, 0x2 + bne _0802FCB6 + b _0802FE00 +_0802FCB6: + cmp r0, 0x3 + bne _0802FCBC + b _0802FEFC +_0802FCBC: + movs r0, 0 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x1 + movs r1, 0xAA + bl Window_FastFillPixels + ldr r5, _0802FD30 + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + ldr r0, _0802FD34 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0802FD38 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + ldr r4, _0802FD3C + ldr r5, _0802FD40 + adds r0, r4, 0 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + adds r4, 0x8 + b _0802FED4 + .align 2, 0 +_0802FD28: .4byte 0x0000547f +_0802FD2C: .4byte 0x03005e00 +_0802FD30: .4byte 0x082ff0e0 +_0802FD34: .4byte 0x085e827c +_0802FD38: .4byte 0x085e828e +_0802FD3C: .4byte 0x082ff038 +_0802FD40: .4byte 0x000001d5 +_0802FD44: + movs r0, 0x2 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x3 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x4 + movs r1, 0xAA + bl Window_FastFillPixels + ldr r5, _0802FDE8 + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + ldr r0, _0802FDEC + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0802FDF0 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0802FDF4 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + bl fmt_savegame + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x4 + movs r1, 0x2 + bl Window_CopyToVram + ldr r4, _0802FDF8 + ldr r5, _0802FDFC + adds r0, r4, 0 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + adds r4, 0x10 + b _0802FED4 + .align 2, 0 +_0802FDE8: .4byte 0x082ff0e0 +_0802FDEC: .4byte 0x085e8285 +_0802FDF0: .4byte 0x085e827c +_0802FDF4: .4byte 0x085e828e +_0802FDF8: .4byte 0x082ff048 +_0802FDFC: .4byte 0x000001d5 +_0802FE00: + movs r0, 0x2 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x3 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x4 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x5 + movs r1, 0xAA + bl Window_FastFillPixels + ldr r5, _0802FEE0 + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + ldr r0, _0802FEE4 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0802FEE8 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0802FEEC + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0802FEF0 + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + bl fmt_savegame + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0x5 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x4 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram + ldr r4, _0802FEF4 + ldr r5, _0802FEF8 + adds r0, r4, 0 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r4, 0 + adds r0, 0x10 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + adds r4, 0x18 +_0802FED4: + adds r0, r4, 0 + adds r1, r5, 0 + bl write_textbox_border_to_bg_tilemap + b _0803005E + .align 2, 0 +_0802FEE0: .4byte 0x082ff0e0 +_0802FEE4: .4byte 0x085e8285 +_0802FEE8: .4byte 0x085e827c +_0802FEEC: .4byte 0x085e8295 +_0802FEF0: .4byte 0x085e828e +_0802FEF4: .4byte 0x082ff048 +_0802FEF8: .4byte 0x000001d5 +_0802FEFC: + movs r0, 0x2 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x3 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x4 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x5 + movs r1, 0xAA + bl Window_FastFillPixels + movs r0, 0x6 + movs r1, 0xAA + bl Window_FastFillPixels + ldr r5, _0803007C + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + ldr r0, _08030080 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _08030084 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _08030088 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0803008C + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _08030090 + str r0, [sp, 0x8] + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + bl fmt_savegame + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0x5 + bl Window_WriteStandardTileMap + movs r0, 0x6 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x4 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x6 + movs r1, 0x2 + bl Window_CopyToVram + ldr r5, _08030094 + ldr r4, _08030098 + adds r0, r5, 0 + adds r1, r4, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r5, 0 + adds r0, 0x8 + adds r1, r4, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r5, 0 + adds r0, 0x10 + adds r1, r4, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r5, 0 + adds r0, 0x18 + adds r1, r4, 0 + bl write_textbox_border_to_bg_tilemap + adds r0, r5, 0 + adds r0, 0x20 + adds r1, r4, 0 + bl write_textbox_border_to_bg_tilemap + ldr r0, _0803009C + ldr r4, _080300A0 + adds r1, r4, 0 + bl sub_81AF380 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1A] + movs r0, 0x1A + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r8 + ldr r1, _080300A4 + str r1, [r0] + ldrh r0, [r4] + cmp r0, 0x4 + bne _0803005E + movs r4, 0x80 + lsls r4, 6 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + movs r0, 0x1 + strh r0, [r6, 0x1C] + movs r2, 0x1A + ldrsh r1, [r6, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x26] +_0803005E: + ldr r0, _080300A8 + mov r2, r9 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, _080300AC + str r0, [r1] +_0803006C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803007C: .4byte 0x082ff0e0 +_08030080: .4byte 0x085e8285 +_08030084: .4byte 0x085e827c +_08030088: .4byte 0x085e82a2 +_0803008C: .4byte 0x085e82af +_08030090: .4byte 0x085e828e +_08030094: .4byte 0x082ff048 +_08030098: .4byte 0x000001d5 +_0803009C: .4byte 0x082ff0f4 +_080300A0: .4byte 0x02022d06 +_080300A4: .4byte sub_81AF59C + 1 +_080300A8: .4byte 0x03005e00 +_080300AC: .4byte task_title_menu_highlight_selected_menu_items + 1 + thumb_func_end task_init_title_menu_graphics_3 + + thumb_func_start task_title_menu_highlight_selected_menu_items +task_title_menu_highlight_selected_menu_items: @ 80300B0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080300D8 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x8] + ldrb r1, [r4, 0xA] + movs r3, 0x24 + ldrsh r2, [r4, r3] + bl title_menu_highlight_selected_menu_items + ldr r0, _080300DC + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080300D8: .4byte 0x03005e00 +_080300DC: .4byte task_title_menu_handle_input + 1 + thumb_func_end task_title_menu_highlight_selected_menu_items + + thumb_func_start title_menu_handle_input +title_menu_handle_input: @ 80300E0 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r7, _08030124 + adds r5, r4, r7 + ldr r1, _08030128 + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08030130 + movs r0, 0x5 + bl audio_play + bl sub_80093CC + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, _0803012C + str r1, [r0] + b _08030240 + .align 2, 0 +_08030124: .4byte 0x03005e08 +_08030128: .4byte 0x030022c0 +_0803012C: .4byte title_menu_handle_keypad_a_pressed + 1 +_08030130: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _08030178 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + ldr r1, _08030170 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0xA0 + bl lcd_io_set + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, _08030174 + str r1, [r0] + b _08030240 + .align 2, 0 +_08030170: .4byte 0x0000ffff +_08030174: .4byte sub_8030544 + 1 +_08030178: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _080301CA + movs r0, 0x2 + ldrsh r2, [r5, r0] + cmp r2, 0 + ble _080301CA + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + bne _080301C4 + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080301C4 + cmp r2, 0x1 + bne _080301C4 + movs r4, 0x80 + lsls r4, 6 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl bg_change_y_offset + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2 + bl bg_change_y_offset + movs r2, 0x1A + ldrsh r1, [r5, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r7, r0 + strh r6, [r5, 0x1C] + strh r6, [r0, 0x1E] +_080301C4: + ldrh r0, [r5, 0x2] + subs r0, 0x1 + b _0803022C +_080301CA: + ldrh r1, [r1, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08030240 + movs r0, 0x2 + ldrsh r1, [r5, r0] + movs r2, 0x18 + ldrsh r0, [r5, r2] + subs r0, 0x1 + cmp r1, r0 + bge _08030240 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + bne _08030228 + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x3 + bne _08030228 + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08030228 + movs r4, 0x80 + lsls r4, 6 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + ldr r2, _08030238 + movs r0, 0x1A + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r5, 0x1C] + movs r1, 0x1 + strh r1, [r0, 0x26] +_08030228: + ldrh r0, [r5, 0x2] + adds r0, 0x1 +_0803022C: + strh r0, [r5, 0x2] + ldr r1, _0803023C + strh r0, [r1] + movs r0, 0x1 + b _08030242 + .align 2, 0 +_08030238: .4byte 0x03005e00 +_0803023C: .4byte 0x02022d06 +_08030240: + movs r0, 0 +_08030242: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end title_menu_handle_input + + thumb_func_start task_title_menu_handle_input +task_title_menu_handle_input: @ 803024C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl title_menu_handle_input + lsls r0, 24 + cmp r0, 0 + beq _0803026C + ldr r0, _08030274 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08030278 + str r0, [r1] +_0803026C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030274: .4byte 0x03005e00 +_08030278: .4byte task_title_menu_highlight_selected_menu_items + 1 + thumb_func_end task_title_menu_handle_input + + thumb_func_start title_menu_handle_keypad_a_pressed +title_menu_handle_keypad_a_pressed: @ 803027C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0803031C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08030292 + b _08030536 +_08030292: + ldr r2, _08030320 + 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 + bne _080302B0 + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl sub_81AF620 +_080302B0: + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x1 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x2 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x3 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x4 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x5 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x6 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x7 + movs r1, 0x1 + bl sub_819746C + bl sub_80093CC + lsls r0, 24 + lsrs r2, r0, 24 + movs r3, 0x8 + ldrsh r0, [r4, r3] + cmp r0, 0x1 + beq _08030324 + cmp r0, 0x1 + ble _0803030C + cmp r0, 0x2 + beq _08030336 + cmp r0, 0x3 + beq _08030358 +_0803030C: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08030388 + cmp r0, 0x1 + bne _08030388 + b _080303D8 + .align 2, 0 +_0803031C: .4byte 0x02037fd4 +_08030320: .4byte 0x03005e00 +_08030324: + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _08030388 + cmp r0, 0x1 + ble _08030384 + cmp r0, 0x2 + bne _08030384 + b _080303D8 +_08030336: + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0x1 + beq _08030388 + cmp r0, 0x1 + ble _08030384 + cmp r0, 0x2 + beq _0803034C + cmp r0, 0x3 + beq _080303D8 + b _08030384 +_0803034C: + movs r5, 0x3 + cmp r2, 0 + bne _080303DA + movs r5, 0x6 + strh r2, [r4, 0x8] + b _080303DA +_08030358: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _08030384 + lsls r0, 2 + ldr r1, _0803036C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803036C: .4byte _08030370 + .align 2, 0 +_08030370: + .4byte _08030384 + .4byte _08030388 + .4byte _0803038C + .4byte _080303BC + .4byte _080303D8 +_08030384: + movs r5, 0x1 + b _080303DA +_08030388: + movs r5, 0 + b _080303DA +_0803038C: + ldr r0, _080303A8 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080303AC + movs r5, 0x3 + cmp r2, 0 + bne _080303DA + movs r5, 0x6 + strh r2, [r1, 0x8] + b _080303DA + .align 2, 0 +_080303A8: .4byte 0x03005e00 +_080303AC: + cmp r2, 0 + beq _080303B8 + movs r5, 0x6 + movs r0, 0x1 + strh r0, [r1, 0x8] + b _080303DA +_080303B8: + movs r5, 0x5 + b _080303DA +_080303BC: + cmp r2, 0 + beq _080303D4 + movs r5, 0x6 + ldr r0, _080303D0 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + b _080303DA + .align 2, 0 +_080303D0: .4byte 0x03005e00 +_080303D4: + movs r5, 0x4 + b _080303DA +_080303D8: + movs r5, 0x2 +_080303DA: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + cmp r5, 0x6 + bhi _0803041C + lsls r0, r5, 2 + ldr r1, _080303FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080303FC: .4byte _08030400 + .align 2, 0 +_08030400: + .4byte _0803041C + .4byte _08030444 + .4byte _08030460 + .4byte _08030478 + .4byte _08030480 + .4byte _08030488 + .4byte _0803049C +_0803041C: + ldr r0, _08030434 + movs r1, 0 + strh r1, [r0] + ldr r0, _08030438 + strh r1, [r0] + ldr r1, _0803043C + adds r0, r7, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _08030440 + str r1, [r0] + b _08030514 + .align 2, 0 +_08030434: .4byte 0x02037714 +_08030438: .4byte 0x02037b14 +_0803043C: .4byte 0x03005e00 +_08030440: .4byte task_new_game_prof_birch_speech_1 + 1 +_08030444: + ldr r0, _08030454 + movs r1, 0 + strh r1, [r0] + ldr r0, _08030458 + strh r1, [r0] + ldr r0, _0803045C + b _0803048A + .align 2, 0 +_08030454: .4byte 0x02037714 +_08030458: .4byte 0x02037b14 +_0803045C: .4byte sub_8086230 + 1 +_08030460: + ldr r0, _0803046C + ldr r1, _08030470 + str r1, [r0, 0x8] + ldr r0, _08030474 + b _0803048A + .align 2, 0 +_0803046C: .4byte 0x030022c0 +_08030470: .4byte c2_title_menu_2_dupe + 1 +_08030474: .4byte c2_options_menu + 1 +_08030478: + ldr r0, _0803047C + b _0803048A + .align 2, 0 +_0803047C: .4byte c2_mystery_gift + 1 +_08030480: + ldr r0, _08030484 + b _0803048A + .align 2, 0 +_08030484: .4byte sub_8178974 + 1 +_08030488: + ldr r0, _08030498 +_0803048A: + bl set_callback2 + adds r0, r6, 0 + bl remove_task + b _08030514 + .align 2, 0 +_08030498: .4byte sub_801867C + 1 +_0803049C: + ldr r1, _08030500 + adds r0, r7, r6 + lsls r0, 3 + adds r0, r1 + movs r4, 0 + strh r4, [r0, 0xA] + ldr r1, _08030504 + str r1, [r0] + ldr r0, _08030508 + movs r2, 0xF1 + lsls r2, 1 + adds r0, r2 + ldr r1, _0803050C + strh r1, [r0] + ldr r0, _08030510 + adds r0, r2 + strh r1, [r0] + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _08030536 + .align 2, 0 +_08030500: .4byte 0x03005e00 +_08030504: .4byte sub_80305A4 + 1 +_08030508: .4byte 0x02037714 +_0803050C: .4byte 0x00007fff +_08030510: .4byte 0x02037b14 +_08030514: + bl Window_FreeMemory + cmp r5, 0x2 + beq _08030528 + ldr r1, _08030524 + movs r0, 0 + strh r0, [r1] + b _08030536 + .align 2, 0 +_08030524: .4byte 0x02022d06 +_08030528: + ldr r0, _08030540 + ldrh r1, [r0] + movs r3, 0x80 + lsls r3, 8 + adds r2, r3, 0 + orrs r1, r2 + strh r1, [r0] +_08030536: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08030540: .4byte 0x02022d06 + thumb_func_end title_menu_handle_keypad_a_pressed + + thumb_func_start sub_8030544 +sub_8030544: @ 8030544 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + ldr r0, _08030594 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0803058C + ldr r0, _08030598 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x3 + bne _08030578 + ldrh r0, [r1, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl sub_81AF620 +_08030578: + ldr r0, _0803059C + strh r4, [r0] + bl Window_FreeMemory + ldr r0, _080305A0 + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_0803058C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030594: .4byte 0x02037fd4 +_08030598: .4byte 0x03005e00 +_0803059C: .4byte 0x02022d06 +_080305A0: .4byte c2_title_screen_1 + 1 + thumb_func_end sub_8030544 + + thumb_func_start sub_80305A4 +sub_80305A4: @ 80305A4 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080305C8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0803063C + cmp r1, 0x1 + bgt _080305CC + cmp r1, 0 + beq _080305D6 + b _08030688 + .align 2, 0 +_080305C8: .4byte 0x03005e00 +_080305CC: + cmp r1, 0x2 + beq _0803064C + cmp r1, 0x3 + beq _08030664 + b _08030688 +_080305D6: + 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 bg_fill_tilemap_rect + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08030610 + cmp r0, 0x1 + bgt _080305FC + cmp r0, 0 + beq _08030602 + b _08030622 +_080305FC: + cmp r0, 0x2 + beq _0803061C + b _08030622 +_08030602: + ldr r0, _0803060C + bl draw_text_box + b _08030622 + .align 2, 0 +_0803060C: .4byte 0x085e82be +_08030610: + ldr r0, _08030618 + bl draw_text_box + b _08030622 + .align 2, 0 +_08030618: .4byte 0x085e82e5 +_0803061C: + ldr r0, _08030634 + bl draw_text_box +_08030622: + ldr r0, _08030638 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _08030688 + .align 2, 0 +_08030634: .4byte 0x085e8328 +_08030638: .4byte 0x03005e00 +_0803063C: + ldr r0, _08030648 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + b _08030658 + .align 2, 0 +_08030648: .4byte 0x02037fd4 +_0803064C: + bl run_remoboxes + movs r0, 0x7 + bl a_pressed_maybe + lsls r0, 16 +_08030658: + cmp r0, 0 + bne _08030688 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _08030688 +_08030664: + ldr r0, _08030690 + ldrh r0, [r0, 0x2E] + ands r1, r0 + cmp r1, 0 + beq _08030688 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08030694 + str r0, [r4] +_08030688: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030690: .4byte 0x030022c0 +_08030694: .4byte sub_8030544 + 1 + thumb_func_end sub_80305A4 + + thumb_func_start title_menu_highlight_selected_menu_items +title_menu_highlight_selected_menu_items: @ 8030698 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r1, _080306CC + movs r0, 0x40 + bl lcd_io_set + cmp r5, 0x1 + beq _080306DC + cmp r5, 0x1 + ble _080306BE + cmp r5, 0x2 + beq _08030700 + cmp r5, 0x3 + beq _08030728 +_080306BE: + cmp r4, 0 + beq _080306C6 + cmp r4, 0x1 + beq _080306D4 +_080306C6: + ldr r1, _080306D0 + b _0803078E + .align 2, 0 +_080306CC: .4byte 0x000009e7 +_080306D0: .4byte 0x0000011f +_080306D4: + ldr r1, _080306D8 + b _0803078E + .align 2, 0 +_080306D8: .4byte 0x0000213f +_080306DC: + cmp r4, 0x1 + beq _080306F0 + cmp r4, 0x1 + ble _080306E8 + cmp r4, 0x2 + beq _080306F8 +_080306E8: + ldr r1, _080306EC + b _0803078E + .align 2, 0 +_080306EC: .4byte 0x0000013f +_080306F0: + ldr r1, _080306F4 + b _0803078E + .align 2, 0 +_080306F4: .4byte 0x0000415f +_080306F8: + ldr r1, _080306FC + b _0803078E + .align 2, 0 +_080306FC: .4byte 0x0000617f +_08030700: + cmp r4, 0x1 + beq _08030718 + cmp r4, 0x1 + ble _08030710 + cmp r4, 0x2 + beq _08030720 + cmp r4, 0x3 + beq _0803078C +_08030710: + ldr r1, _08030714 + b _0803078E + .align 2, 0 +_08030714: .4byte 0x0000013f +_08030718: + ldr r1, _0803071C + b _0803078E + .align 2, 0 +_0803071C: .4byte 0x0000415f +_08030720: + ldr r1, _08030724 + b _0803078E + .align 2, 0 +_08030724: .4byte 0x0000617f +_08030728: + cmp r4, 0x4 + bhi _08030750 + lsls r0, r4, 2 + ldr r1, _08030738 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08030738: .4byte _0803073C + .align 2, 0 +_0803073C: + .4byte _08030750 + .4byte _08030758 + .4byte _0803076C + .4byte _08030780 + .4byte _0803079C +_08030750: + ldr r1, _08030754 + b _0803078E + .align 2, 0 +_08030754: .4byte 0x0000013f +_08030758: + cmp r6, 0 + beq _08030764 + ldr r1, _08030760 + b _0803078E + .align 2, 0 +_08030760: .4byte 0x0000213f +_08030764: + ldr r1, _08030768 + b _0803078E + .align 2, 0 +_08030768: .4byte 0x0000415f +_0803076C: + cmp r6, 0 + beq _08030778 + ldr r1, _08030774 + b _0803078E + .align 2, 0 +_08030774: .4byte 0x0000415f +_08030778: + ldr r1, _0803077C + b _0803078E + .align 2, 0 +_0803077C: .4byte 0x0000617f +_08030780: + cmp r6, 0 + beq _0803078C + ldr r1, _08030788 + b _0803078E + .align 2, 0 +_08030788: .4byte 0x0000617f +_0803078C: + ldr r1, _08030798 +_0803078E: + movs r0, 0x44 + bl lcd_io_set + b _080307A4 + .align 2, 0 +_08030798: .4byte 0x0000819f +_0803079C: + ldr r1, _080307AC + movs r0, 0x44 + bl lcd_io_set +_080307A4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080307AC: .4byte 0x0000819f + thumb_func_end title_menu_highlight_selected_menu_items + + thumb_func_start task_new_game_prof_birch_speech_1 +task_new_game_prof_birch_speech_1: @ 80307B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _08030890 + bl bg_init_bg_config_2_from_bg_config_3 + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r0, _08030894 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _08030898 + ldr r1, _0803089C + bl LZ77UnCompVram + ldr r0, _080308A0 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, _080308A4 + movs r1, 0x1 + movs r2, 0x10 + bl gpu_pal_apply + bl remove_some_task + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl dp13_810BB8C + adds r0, r4, 0 + bl sub_803192C + movs r0, 0x1 + negs r0, r0 + movs r5, 0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _080308A8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x10] + ldr r1, _080308AC + str r1, [r0] + movs r1, 0xFF + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + movs r1, 0xD8 + strh r1, [r0, 0x16] + movs r0, 0xBB + lsls r0, 1 + bl song_play_for_text + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030890: .4byte 0x082ff0f0 +_08030894: .4byte 0x082fed3c +_08030898: .4byte 0x082feef0 +_0803089C: .4byte 0x06003800 +_080308A0: .4byte 0x082fecfc +_080308A4: .4byte 0x082ff028 +_080308A8: .4byte 0x03005e00 +_080308AC: .4byte task_new_game_prof_birch_speech_2 + 1 + thumb_func_end task_new_game_prof_birch_speech_1 + + thumb_func_start task_new_game_prof_birch_speech_2 +task_new_game_prof_birch_speech_2: @ 80308B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080308D0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x16] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080308D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x16] + b _0803091A + .align 2, 0 +_080308D0: .4byte 0x03005e00 +_080308D4: + ldrb r0, [r4, 0x18] + ldr r2, _08030920 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x88 + strh r0, [r1, 0x20] + movs r0, 0x3C + strh r0, [r1, 0x22] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + subs r0, 0x41 + ands r0, r2 + strb r0, [r3] + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x1] + adds r0, r5, 0 + movs r1, 0xA + bl sub_8031BAC + adds r0, r5, 0 + movs r1, 0x14 + bl sub_8031D34 + movs r0, 0x50 + strh r0, [r4, 0x16] + ldr r0, _08030924 + str r0, [r4] +_0803091A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030920: .4byte 0x02020630 +_08030924: .4byte task_new_game_prof_birch_speech_3 + 1 + thumb_func_end task_new_game_prof_birch_speech_2 + + thumb_func_start task_new_game_prof_birch_speech_3 +task_new_game_prof_birch_speech_3: @ 8030928 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08030968 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080309B6 + ldr r2, _0803096C + movs r1, 0x18 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldrh r1, [r4, 0x16] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08030970 + subs r0, r1, 0x1 + strh r0, [r4, 0x16] + b _080309B6 + .align 2, 0 +_08030968: .4byte 0x03005e00 +_0803096C: .4byte 0x02020630 +_08030970: + ldr r0, _080309BC + bl Window_InitFromTemplates + movs r0, 0 + movs r1, 0xF3 + bl unknown_title_pattern_data_to_vram + movs r0, 0 + movs r1, 0xFC + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0 + movs r1, 0x1 + bl unknown_rbox_to_vram + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl sub_8032318 + ldr r0, _080309C0 + ldr r1, _080309C4 + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r0, _080309C8 + str r0, [r4] +_080309B6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080309BC: .4byte 0x082ff080 +_080309C0: .4byte 0x02021fc4 +_080309C4: .4byte 0x082c897b +_080309C8: .4byte task_new_game_prof_birch_speech_4 + 1 + thumb_func_end task_new_game_prof_birch_speech_3 + + thumb_func_start task_new_game_prof_birch_speech_4 +task_new_game_prof_birch_speech_4: @ 80309CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08030A10 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08030A0A + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _08030A0A + ldr r1, _08030A14 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08030A18 + str r1, [r0] + ldr r0, _08030A1C + ldr r1, _08030A20 + bl ExpandTextCodes + ldr r1, _08030A24 + movs r0, 0x1 + bl sub_8197A9C + ldr r0, _08030A28 + strb r4, [r0] +_08030A0A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030A10: .4byte 0x02037fd4 +_08030A14: .4byte 0x03005e00 +_08030A18: .4byte task_new_game_prof_birch_speech_5 + 1 +_08030A1C: .4byte 0x02021fc4 +_08030A20: .4byte 0x085e8692 +_08030A24: .4byte sub_80323A0 + 1 +_08030A28: .4byte 0x03000dd0 + thumb_func_end task_new_game_prof_birch_speech_4 + + thumb_func_start task_new_game_prof_birch_speech_5 +task_new_game_prof_birch_speech_5: @ 8030A2C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _08030A58 + ldr r0, _08030A60 + ldr r1, _08030A64 + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r1, _08030A68 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08030A6C + str r1, [r0] +_08030A58: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030A60: .4byte 0x02021fc4 +_08030A64: .4byte 0x082c8a1f +_08030A68: .4byte 0x03005e00 +_08030A6C: .4byte task_new_game_prof_birch_speech_6 + 1 + thumb_func_end task_new_game_prof_birch_speech_5 + + thumb_func_start sub_8030A70 +sub_8030A70: @ 8030A70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _08030AFC + ldr r0, _08030B00 + mov r8, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x1A] + ldr r1, _08030B04 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r5, 0 + movs r1, 0x64 + strh r1, [r2, 0x20] + movs r1, 0x4B + strh r1, [r2, 0x22] + movs r1, 0x3E + adds r1, r2 + mov r12, r1 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + mov r3, r12 + strb r1, [r3] + strh r5, [r2, 0x2E] + ldrb r1, [r2, 0x5] + lsrs r1, 4 + str r5, [sp] + str r5, [sp, 0x4] + movs r2, 0x20 + str r2, [sp, 0x8] + ldr r2, _08030B08 + str r2, [sp, 0xC] + ldr r2, _08030B0C + str r2, [sp, 0x10] + movs r2, 0x70 + movs r3, 0x3A + bl sub_8076438 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + ldr r1, _08030B10 + str r1, [r0] + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r5, [r0, 0x16] + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08030AFC: .4byte 0x03005e00 +_08030B00: .4byte 0x03000dd0 +_08030B04: .4byte 0x02020630 +_08030B08: .4byte 0x0000ffff +_08030B0C: .4byte 0x00000127 +_08030B10: .4byte sub_8030B14 + 1 + thumb_func_end sub_8030A70 + + thumb_func_start sub_8030B14 +sub_8030B14: @ 8030B14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08030B58 + adds r5, r0, r1 + subs r1, 0x8 + mov r8, r1 + ldr r2, _08030B5C + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + mov r1, r8 + adds r6, r0, r1 + movs r0, 0x1A + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08030B60 + adds r3, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + adds r7, r2, 0 + cmp r0, 0 + beq _08030B64 + cmp r0, 0x1 + beq _08030B7C + b _08030B98 + .align 2, 0 +_08030B58: .4byte 0x03005e08 +_08030B5C: .4byte 0x03000dd0 +_08030B60: .4byte 0x02020630 +_08030B64: + ldr r1, [r3, 0x1C] + ldr r0, _08030B78 + cmp r1, r0 + bne _08030BBA + ldrb r1, [r3, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x1] + b _08030B98 + .align 2, 0 +_08030B78: .4byte nullsub_12 + 1 +_08030B7C: + movs r1, 0x16 + ldrsh r0, [r6, r1] + cmp r0, 0x5F + ble _08030BBA + adds r0, r4, 0 + bl remove_task + ldrb r1, [r7] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + b _08030BAA +_08030B98: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r2, _08030BC4 + ldrb r1, [r7] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, r0, r2 +_08030BAA: + ldrh r3, [r2, 0x16] + movs r0, 0x16 + ldrsh r1, [r2, r0] + ldr r0, _08030BC8 + cmp r1, r0 + bgt _08030BBA + adds r0, r3, 0x1 + strh r0, [r2, 0x16] +_08030BBA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08030BC4: .4byte 0x03005e00 +_08030BC8: .4byte 0x00003fff + thumb_func_end sub_8030B14 + + thumb_func_start task_new_game_prof_birch_speech_6 +task_new_game_prof_birch_speech_6: @ 8030BCC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08030BFE + ldr r0, _08030C04 + strb r1, [r0] + ldr r0, _08030C08 + ldr r1, _08030C0C + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r1, _08030C10 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08030C14 + str r1, [r0] +_08030BFE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030C04: .4byte 0x02022d04 +_08030C08: .4byte 0x02021fc4 +_08030C0C: .4byte 0x082c8bd0 +_08030C10: .4byte 0x03005e00 +_08030C14: .4byte task_new_game_prof_birch_speech_7 + 1 + thumb_func_end task_new_game_prof_birch_speech_6 + + thumb_func_start task_new_game_prof_birch_speech_7 +task_new_game_prof_birch_speech_7: @ 8030C18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _08030C7C + ldr r5, _08030C84 + ldr r0, _08030C88 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r1, 0x1] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1, 0x1] + movs r0, 0x1A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + ands r2, r1 + orrs r2, r3 + strb r2, [r0, 0x1] + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8031ACC + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8031C88 + movs r0, 0x40 + strh r0, [r4, 0x16] + ldr r0, _08030C8C + str r0, [r4] +_08030C7C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08030C84: .4byte 0x02020630 +_08030C88: .4byte 0x03005e00 +_08030C8C: .4byte task_new_game_prof_birch_speech_8 + 1 + thumb_func_end task_new_game_prof_birch_speech_7 + + thumb_func_start task_new_game_prof_birch_speech_8 +task_new_game_prof_birch_speech_8: @ 8030C90 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08030CBC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + ldrh r3, [r2, 0x10] + movs r0, 0x10 + ldrsh r1, [r2, r0] + movs r0, 0x3C + negs r0, r0 + cmp r1, r0 + beq _08030CC0 + subs r0, r3, 0x2 + strh r0, [r2, 0x10] + ldrh r1, [r2, 0x10] + movs r0, 0x14 + bl lcd_io_set + b _08030CC8 + .align 2, 0 +_08030CBC: .4byte 0x03005e00 +_08030CC0: + ldr r0, _08030CCC + strh r0, [r2, 0x10] + ldr r0, _08030CD0 + str r0, [r2] +_08030CC8: + pop {r0} + bx r0 + .align 2, 0 +_08030CCC: .4byte 0x0000ffc4 +_08030CD0: .4byte task_new_game_prof_birch_speech_9 + 1 + thumb_func_end task_new_game_prof_birch_speech_8 + + thumb_func_start task_new_game_prof_birch_speech_9 +task_new_game_prof_birch_speech_9: @ 8030CD4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _08030D2C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08030D7A + ldr r2, _08030D30 + movs r0, 0x18 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r7, 0x4 + orrs r1, r7 + strb r1, [r0] + movs r0, 0x1A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r7 + strb r1, [r0] + ldrh r0, [r4, 0x16] + movs r1, 0x16 + ldrsh r6, [r4, r1] + cmp r6, 0 + beq _08030D34 + subs r0, 0x1 + strh r0, [r4, 0x16] + b _08030D7A + .align 2, 0 +_08030D2C: .4byte 0x03005e00 +_08030D30: .4byte 0x02020630 +_08030D34: + ldrb r3, [r4, 0x1C] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + movs r0, 0xB4 + strh r0, [r1, 0x20] + movs r0, 0x3C + strh r0, [r1, 0x22] + movs r2, 0x3E + adds r2, r1 + mov r12, r2 + ldrb r2, [r2] + subs r0, 0x41 + ands r0, r2 + mov r2, r12 + strb r0, [r2] + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r7 + strb r0, [r1, 0x1] + strh r3, [r4, 0xC] + strh r6, [r4, 0x14] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_8031BAC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8031D34 + ldr r0, _08030D80 + str r0, [r4] +_08030D7A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08030D80: .4byte task_new_game_prof_birch_speech_10 + 1 + thumb_func_end task_new_game_prof_birch_speech_9 + + thumb_func_start task_new_game_prof_birch_speech_10 +task_new_game_prof_birch_speech_10: @ 8030D84 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08030DBC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, r1, r2 + movs r1, 0x12 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08030DB8 + ldr r2, _08030DC0 + movs r1, 0xC + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, _08030DC4 + str r0, [r3] +_08030DB8: + pop {r0} + bx r0 + .align 2, 0 +_08030DBC: .4byte 0x03005e00 +_08030DC0: .4byte 0x02020630 +_08030DC4: .4byte task_new_game_prof_birch_speech_11 + 1 + thumb_func_end task_new_game_prof_birch_speech_10 + + thumb_func_start task_new_game_prof_birch_speech_11 +task_new_game_prof_birch_speech_11: @ 8030DC8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_8032318 + ldr r0, _08030DF8 + ldr r1, _08030DFC + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r1, _08030E00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08030E04 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030DF8: .4byte 0x02021fc4 +_08030DFC: .4byte 0x082c8bdd +_08030E00: .4byte 0x03005e00 +_08030E04: .4byte task_new_game_prof_birch_speech_12 + 1 + thumb_func_end task_new_game_prof_birch_speech_11 + + thumb_func_start task_new_game_prof_birch_speech_12 +task_new_game_prof_birch_speech_12: @ 8030E08 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _08030E2A + bl sub_8031D74 + ldr r0, _08030E30 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08030E34 + str r0, [r1] +_08030E2A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030E30: .4byte 0x03005e00 +_08030E34: .4byte task_new_game_prof_birch_speech_13 + 1 + thumb_func_end task_new_game_prof_birch_speech_12 + + thumb_func_start task_new_game_prof_birch_speech_13 +task_new_game_prof_birch_speech_13: @ 8030E38 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8031DB4 + lsls r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _08030E52 + cmp r4, 0x1 + beq _08030E52 + lsls r4, r5, 2 + b _08030E76 +_08030E52: + movs r0, 0x5 + bl audio_play + ldr r0, _08030EC0 + ldr r0, [r0] + strb r4, [r0, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl sub_80322E0 + ldr r1, _08030EC4 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08030EC8 + str r1, [r0] + adds r4, r2, 0 +_08030E76: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _08030EC4 + adds r0, r4, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r3, r0 + beq _08030EB8 + strh r3, [r4, 0x14] + ldr r2, _08030ECC + movs r0, 0xC + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x1] + adds r0, r5, 0 + movs r1, 0 + bl sub_8031ACC + ldr r0, _08030ED0 + str r0, [r4] +_08030EB8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030EC0: .4byte 0x03005d90 +_08030EC4: .4byte 0x03005e00 +_08030EC8: .4byte task_new_game_prof_birch_speech_14 + 1 +_08030ECC: .4byte 0x02020630 +_08030ED0: .4byte sub_8030ED4 + 1 + thumb_func_end task_new_game_prof_birch_speech_13 + + thumb_func_start sub_8030ED4 +sub_8030ED4: @ 8030ED4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08030F04 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + ldrb r5, [r4, 0xC] + movs r2, 0x12 + ldrsh r0, [r4, r2] + adds r7, r1, 0 + cmp r0, 0 + bne _08030F0C + ldr r0, _08030F08 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x4 + strh r0, [r1, 0x20] + b _08030F72 + .align 2, 0 +_08030F04: .4byte 0x03005e00 +_08030F08: .4byte 0x02020630 +_08030F0C: + ldr r3, _08030F2C + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08030F30 + ldrb r5, [r4, 0x1E] + b _08030F32 + .align 2, 0 +_08030F2C: .4byte 0x02020630 +_08030F30: + ldrb r5, [r4, 0x1C] +_08030F32: + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r3 + movs r0, 0xF0 + strh r0, [r2, 0x20] + movs r0, 0x3C + strh r0, [r2, 0x22] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + subs r0, 0x41 + ands r0, r1 + strb r0, [r3] + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r7 + strh r5, [r4, 0xC] + ldrb r1, [r2, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x1] + adds r0, r6, 0 + movs r1, 0 + bl sub_8031BAC + ldr r0, _08030F78 + str r0, [r4] +_08030F72: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08030F78: .4byte sub_8030F7C + 1 + thumb_func_end sub_8030ED4 + + thumb_func_start sub_8030F7C +sub_8030F7C: @ 8030F7C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08030FA8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, r1, r2 + ldrb r1, [r3, 0xC] + ldr r2, _08030FAC + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrh r1, [r2, 0x20] + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, 0xB4 + ble _08030FB0 + subs r0, r1, 0x4 + strh r0, [r2, 0x20] + b _08030FCA + .align 2, 0 +_08030FA8: .4byte 0x03005e00 +_08030FAC: .4byte 0x02020630 +_08030FB0: + movs r0, 0xB4 + strh r0, [r2, 0x20] + movs r1, 0x12 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08030FCA + ldrb r0, [r2, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + strb r1, [r2, 0x1] + ldr r0, _08030FD0 + str r0, [r3] +_08030FCA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030FD0: .4byte task_new_game_prof_birch_speech_13 + 1 + thumb_func_end sub_8030F7C + + thumb_func_start task_new_game_prof_birch_speech_14 +task_new_game_prof_birch_speech_14: @ 8030FD4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_8032318 + ldr r0, _08031004 + ldr r1, _08031008 + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r1, _0803100C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08031010 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031004: .4byte 0x02021fc4 +_08031008: .4byte 0x082c8bff +_0803100C: .4byte 0x03005e00 +_08031010: .4byte task_new_game_prof_birch_speech_15 + 1 + thumb_func_end task_new_game_prof_birch_speech_14 + + thumb_func_start task_new_game_prof_birch_speech_15 +task_new_game_prof_birch_speech_15: @ 8031014 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _08031032 + ldr r0, _08031038 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0803103C + str r0, [r1] +_08031032: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031038: .4byte 0x03005e00 +_0803103C: .4byte task_new_game_prof_birch_speech_16 + 1 + thumb_func_end task_new_game_prof_birch_speech_15 + + thumb_func_start task_new_game_prof_birch_speech_16 +task_new_game_prof_birch_speech_16: @ 8031040 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08031084 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803105C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803107A +_0803105C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08031088 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0803108C + str r1, [r0] +_0803107A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031084: .4byte 0x030022c0 +_08031088: .4byte 0x03005e00 +_0803108C: .4byte task_new_game_prof_birch_speech_17 + 1 + thumb_func_end task_new_game_prof_birch_speech_16 + + thumb_func_start task_new_game_prof_birch_speech_17 +task_new_game_prof_birch_speech_17: @ 8031090 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080310F4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080310EC + bl Window_FreeMemory + ldr r1, _080310F8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x1A] + bl sub_818D820 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + bl set_default_player_name + adds r0, r4, 0 + bl remove_task + ldr r0, _080310FC + ldr r1, [r0] + ldrb r2, [r1, 0x8] + str r5, [sp] + ldr r0, _08031100 + str r0, [sp, 0x4] + movs r0, 0 + movs r3, 0 + bl do_choose_name_or_words_screen +_080310EC: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080310F4: .4byte 0x02037fd4 +_080310F8: .4byte 0x03005e00 +_080310FC: .4byte 0x03005d90 +_08031100: .4byte new_game_prof_birch_speech_part2_start + 1 + thumb_func_end task_new_game_prof_birch_speech_17 + + thumb_func_start task_new_game_prof_birch_speech_part2_2 +task_new_game_prof_birch_speech_part2_2: @ 8031104 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_8032318 + ldr r0, _08031134 + ldr r1, _08031138 + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r1, _0803113C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08031140 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031134: .4byte 0x02021fc4 +_08031138: .4byte 0x082c8c1c +_0803113C: .4byte 0x03005e00 +_08031140: .4byte task_new_game_prof_birch_speech_part2_3 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_2 + + thumb_func_start task_new_game_prof_birch_speech_part2_3 +task_new_game_prof_birch_speech_part2_3: @ 8031144 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _08031178 + movs r0, 0x2 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0xF3 + movs r3, 0xDF + bl sub_80323CC + ldr r1, _08031180 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08031184 + str r1, [r0] +_08031178: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031180: .4byte 0x03005e00 +_08031184: .4byte task_new_game_prof_birch_speech_part2_4 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_3 + + thumb_func_start task_new_game_prof_birch_speech_part2_4 +task_new_game_prof_birch_speech_part2_4: @ 8031188 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080311AE + cmp r1, 0 + bgt _080311A8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080311FC + b _08031210 +_080311A8: + cmp r1, 0x1 + beq _080311FC + b _08031210 +_080311AE: + movs r0, 0x5 + bl audio_play + ldr r2, _080311F0 + ldr r0, _080311F4 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x1] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_8031ACC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8031C88 + ldr r0, _080311F8 + str r0, [r4] + b _08031210 + .align 2, 0 +_080311F0: .4byte 0x02020630 +_080311F4: .4byte 0x03005e00 +_080311F8: .4byte task_new_game_prof_birch_speech_part2_5 + 1 +_080311FC: + movs r0, 0x5 + bl audio_play + ldr r0, _08031218 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _0803121C + str r0, [r1] +_08031210: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031218: .4byte 0x03005e00 +_0803121C: .4byte task_new_game_prof_birch_speech_11 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_4 + + thumb_func_start task_new_game_prof_birch_speech_part2_5 +task_new_game_prof_birch_speech_part2_5: @ 8031220 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08031248 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0803124C + adds r0, r2, 0x2 + strh r0, [r1, 0x10] + ldrh r1, [r1, 0x10] + movs r0, 0x14 + bl lcd_io_set + b _08031250 + .align 2, 0 +_08031248: .4byte 0x03005e00 +_0803124C: + ldr r0, _08031254 + str r0, [r1] +_08031250: + pop {r0} + bx r0 + .align 2, 0 +_08031254: .4byte task_new_game_prof_birch_speech_part2_6 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_5 + + thumb_func_start task_new_game_prof_birch_speech_part2_6 +task_new_game_prof_birch_speech_part2_6: @ 8031258 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08031328 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + movs r1, 0x12 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08031320 + ldr r5, _0803132C + movs r2, 0x1C + ldrsh r1, [r7, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x4 + mov r12, r3 + mov r2, r12 + orrs r1, r2 + strb r1, [r0] + movs r3, 0x1E + ldrsh r1, [r7, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldrb r0, [r7, 0x18] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x88 + strh r0, [r1, 0x20] + movs r0, 0x3C + strh r0, [r1, 0x22] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r4, 0x5 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r3] + ldrb r3, [r1, 0x1] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + mov r3, r12 + orrs r0, r3 + strb r0, [r1, 0x1] + ldrb r1, [r7, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x64 + strh r1, [r0, 0x20] + movs r1, 0x4B + strh r1, [r0, 0x22] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + ands r4, r1 + strb r4, [r3] + ldrb r1, [r0, 0x1] + ands r2, r1 + mov r1, r12 + orrs r2, r1 + strb r2, [r0, 0x1] + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8031BAC + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8031D34 + movs r0, 0 + bl sub_8032318 + ldr r0, _08031330 + ldr r1, _08031334 + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r0, _08031338 + str r0, [r7] +_08031320: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08031328: .4byte 0x03005e00 +_0803132C: .4byte 0x02020630 +_08031330: .4byte 0x02021fc4 +_08031334: .4byte 0x082c8c2a +_08031338: .4byte task_new_game_prof_birch_speech_part2_7 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_6 + + thumb_func_start task_new_game_prof_birch_speech_part2_7 +task_new_game_prof_birch_speech_part2_7: @ 803133C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080313D8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080313D2 + ldr r7, _080313DC + movs r1, 0x18 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x1] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1, 0x1] + movs r1, 0x1A + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1, 0x1] + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _080313D2 + movs r0, 0x18 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r2, [r0, 0x1] + adds r1, r6, 0 + ands r1, r2 + movs r3, 0x4 + orrs r1, r3 + strb r1, [r0, 0x1] + movs r1, 0x1A + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x1] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_8031ACC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8031C88 + movs r0, 0x40 + strh r0, [r4, 0x16] + ldr r0, _080313E0 + str r0, [r4] +_080313D2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080313D8: .4byte 0x03005e00 +_080313DC: .4byte 0x02020630 +_080313E0: .4byte task_new_game_prof_birch_speech_part2_8 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_7 + + thumb_func_start task_new_game_prof_birch_speech_part2_8 +task_new_game_prof_birch_speech_part2_8: @ 80313E4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0803143C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r2, 0x12 + ldrsh r0, [r4, r2] + adds r7, r1, 0 + cmp r0, 0 + beq _080314B0 + ldr r2, _08031440 + movs r3, 0x18 + ldrsh r1, [r4, r3] + 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 r0, 0x1A + ldrsh r1, [r4, r0] + 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] + ldrh r1, [r4, 0x16] + movs r3, 0x16 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08031444 + subs r0, r1, 0x1 + strh r0, [r4, 0x16] + b _080314B0 + .align 2, 0 +_0803143C: .4byte 0x03005e00 +_08031440: .4byte 0x02020630 +_08031444: + ldr r0, _08031454 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _08031458 + ldrb r5, [r4, 0x1E] + b _0803145A + .align 2, 0 +_08031454: .4byte 0x03005d90 +_08031458: + ldrb r5, [r4, 0x1C] +_0803145A: + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r2 + movs r0, 0x78 + strh r0, [r1, 0x20] + movs r0, 0x3C + strh r0, [r1, 0x22] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + subs r0, 0x41 + ands r0, r2 + strb r0, [r3] + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x1] + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r7 + strh r5, [r4, 0xC] + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8031BAC + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8031D34 + ldr r0, _080314B8 + ldr r1, _080314BC + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r0, _080314C0 + str r0, [r4] +_080314B0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080314B8: .4byte 0x02021fc4 +_080314BC: .4byte 0x082c8c7a +_080314C0: .4byte task_new_game_prof_birch_speech_part2_9 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_8 + + thumb_func_start task_new_game_prof_birch_speech_part2_9 +task_new_game_prof_birch_speech_part2_9: @ 80314C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08031568 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + movs r1, 0x12 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0803155C + ldr r7, _0803156C + movs r1, 0xC + ldrsh r0, [r6, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + bl sub_8197224 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0 + bne _0803155C + ldrb r0, [r6, 0xC] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r5, r4, r7 + ldrb r1, [r5, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r0, r7, 0 + adds r0, 0x10 + adds r0, r4, r0 + ldr r1, _08031570 + str r1, [r0] + adds r0, r5, 0 + bl obj_alloc_rotscale_entry + adds r0, r5, 0 + movs r1, 0 + bl sub_8008258 + adds r0, r7, 0 + adds r0, 0x1C + adds r4, r0 + ldr r0, _08031574 + str r0, [r4] + ldr r0, _08031578 + mov r1, r8 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x4 + bl play_sound_effect + ldr r0, _0803157C + str r0, [r6] +_0803155C: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08031568: .4byte 0x03005e00 +_0803156C: .4byte 0x02020630 +_08031570: .4byte 0x082ff114 +_08031574: .4byte sub_80318D8 + 1 +_08031578: .4byte 0x0000ffff +_0803157C: .4byte task_new_game_prof_birch_speech_part2_10 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_9 + + thumb_func_start task_new_game_prof_birch_speech_part2_10 +task_new_game_prof_birch_speech_part2_10: @ 8031580 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080315B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, r1, r2 + ldrb r1, [r3, 0xC] + ldr r2, _080315B4 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080315AA + ldr r0, _080315B8 + str r0, [r3] +_080315AA: + pop {r0} + bx r0 + .align 2, 0 +_080315B0: .4byte 0x03005e00 +_080315B4: .4byte 0x02020630 +_080315B8: .4byte task_new_game_prof_birch_speech_part2_11 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_10 + + thumb_func_start task_new_game_prof_birch_speech_part2_11 +task_new_game_prof_birch_speech_part2_11: @ 80315BC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08031614 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803160A + ldr r0, _08031618 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 3 + adds r4, r0 + ldrb r2, [r4, 0xC] + ldr r1, _0803161C + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, _08031620 + str r1, [r0] + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _08031624 + ldr r1, _08031628 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0803162C + str r0, [r4] +_0803160A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031614: .4byte 0x02037fd4 +_08031618: .4byte 0x03005e00 +_0803161C: .4byte 0x02020630 +_08031620: .4byte nullsub_11 + 1 +_08031624: .4byte 0xffff0000 +_08031628: .4byte 0x0000ffff +_0803162C: .4byte task_new_game_prof_birch_speech_part2_12 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_11 + + thumb_func_start task_new_game_prof_birch_speech_part2_12 +task_new_game_prof_birch_speech_part2_12: @ 8031630 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0803166C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08031666 + bl Window_FreeMemory + ldr r1, _08031670 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x1A] + bl sub_818D820 + bl dp13_810BB8C + ldr r0, _08031674 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08031666: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803166C: .4byte 0x02037fd4 +_08031670: .4byte 0x03005e00 +_08031674: .4byte c2_new_game + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_12 + + thumb_func_start new_game_prof_birch_speech_part2_start +new_game_prof_birch_speech_part2_start: @ 8031678 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r1, _080317A0 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + ldr r0, _080317A4 + bl bg_init_bg_config_2_from_bg_config_3 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + add r0, sp, 0x4 + movs r4, 0 + strh r4, [r0] + ldr r1, _080317A8 + str r0, [r1] + movs r4, 0xC0 + lsls r4, 19 + str r4, [r1, 0x4] + ldr r0, _080317AC + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _080317B0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0x4 + strh r2, [r0] + str r0, [r1] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _080317B4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + ldr r0, _080317B8 + adds r1, r4, 0 + bl LZ77UnCompVram + ldr r0, _080317BC + ldr r1, _080317C0 + bl LZ77UnCompVram + ldr r0, _080317C4 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, _080317C8 + movs r1, 0x1 + movs r2, 0x10 + bl gpu_pal_apply + bl clear_tasks + ldr r0, _080317CC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080317D0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x5 + strh r0, [r4, 0x16] + ldr r0, _080317D4 + strh r0, [r4, 0x10] + bl remove_some_task + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl dp13_810BB8C + adds r0, r5, 0 + bl sub_803192C + ldr r0, _080317D8 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080317DC + movs r0, 0x1 + strh r0, [r4, 0x14] + ldrb r3, [r4, 0x1E] + b _080317E0 + .align 2, 0 +_080317A0: .4byte 0x082ff0e8 +_080317A4: .4byte 0x082ff0f0 +_080317A8: .4byte 0x040000d4 +_080317AC: .4byte 0x8100c000 +_080317B0: .4byte 0x85000100 +_080317B4: .4byte 0x81000200 +_080317B8: .4byte 0x082fed3c +_080317BC: .4byte 0x082feef0 +_080317C0: .4byte 0x06003800 +_080317C4: .4byte 0x082fecfc +_080317C8: .4byte 0x082ff01a +_080317CC: .4byte task_new_game_prof_birch_speech_part2_1 + 1 +_080317D0: .4byte 0x03005e00 +_080317D4: .4byte 0x0000ffc4 +_080317D8: .4byte 0x03005d90 +_080317DC: + strh r0, [r4, 0x14] + ldrb r3, [r4, 0x1C] +_080317E0: + ldr r0, _080318B4 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + movs r4, 0 + movs r0, 0xB4 + strh r0, [r1, 0x20] + movs r0, 0x3C + strh r0, [r1, 0x22] + adds r1, 0x3E + ldrb r2, [r1] + subs r0, 0x41 + ands r0, r2 + strb r0, [r1] + ldr r1, _080318B8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0xC] + ldr r1, _080318BC + movs r0, 0x14 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + ldr r3, _080318C0 + ldrh r2, [r3] + strh r4, [r3] + ldr r4, _080318C4 + ldrh r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + ldr r0, _080318C8 + bl SetVBlankCallback + ldr r0, _080318CC + bl set_callback2 + ldr r0, _080318D0 + bl Window_InitFromTemplates + movs r0, 0 + movs r1, 0xF3 + bl unknown_title_pattern_data_to_vram + movs r0, 0 + movs r1, 0xFC + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080318B4: .4byte 0x02020630 +_080318B8: .4byte 0x03005e00 +_080318BC: .4byte 0x0000ffc4 +_080318C0: .4byte 0x04000208 +_080318C4: .4byte 0x04000200 +_080318C8: .4byte sub_802F6C8 + 1 +_080318CC: .4byte c2_title_menu_3 + 1 +_080318D0: .4byte 0x082ff080 + thumb_func_end new_game_prof_birch_speech_part2_start + + thumb_func_start nullsub_11 +nullsub_11: @ 80318D4 + bx lr + thumb_func_end nullsub_11 + + thumb_func_start sub_80318D8 +sub_80318D8: @ 80318D8 + movs r2, 0x22 + ldrsh r1, [r0, r2] + lsls r1, 16 + movs r3, 0x2E + ldrsh r2, [r0, r3] + adds r1, r2 + movs r2, 0xC0 + lsls r2, 8 + adds r1, r2 + lsrs r2, r1, 16 + strh r2, [r0, 0x22] + strh r1, [r0, 0x2E] + bx lr + thumb_func_end sub_80318D8 + + thumb_func_start sub_80318F4 +sub_80318F4: @ 80318F4 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08031924 + str r0, [sp] + str r1, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, _08031928 + str r0, [sp, 0xC] + adds r0, r2, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_818D3E4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r1} + bx r1 + .align 2, 0 +_08031924: .4byte 0x00000127 +_08031928: .4byte 0x0000ffff + thumb_func_end sub_80318F4 + + thumb_func_start sub_803192C +sub_803192C: @ 803192C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x88 + movs r1, 0x3C + movs r2, 0x1 + bl sub_80B5F44 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08031A4C + mov r9, r1 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + movs r3, 0x1C + add r3, r9 + mov r8, r3 + adds r1, r2, r3 + ldr r7, _08031A50 + str r7, [r1] + add r2, r9 + ldrb r3, [r2, 0x5] + movs r6, 0xD + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x4 + mov r10, r3 + mov r3, r10 + orrs r1, r3 + strb r1, [r2] + ldr r1, _08031A54 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r1 + strh r0, [r5, 0x18] + movs r0, 0x64 + movs r1, 0x4B + bl sub_80318F4 + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + mov r4, r8 + adds r1, r2, r4 + str r7, [r1] + add r2, r9 + ldrb r3, [r2, 0x5] + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + mov r3, r10 + orrs r1, r3 + strb r1, [r2] + strh r0, [r5, 0x1A] + movs r0, 0x3C + bl sub_806EFF0 + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08031A58 + str r4, [sp] + movs r1, 0x78 + movs r2, 0x3C + movs r3, 0 + bl sub_80B5E6C + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + mov r3, r8 + adds r1, r2, r3 + str r7, [r1] + add r2, r9 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + mov r4, r10 + orrs r1, r4 + strb r1, [r3] + ldrb r3, [r2, 0x5] + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x5] + strh r0, [r5, 0x1C] + movs r0, 0x3F + bl sub_806EFF0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08031A58 + movs r2, 0x80 + lsls r2, 4 + adds r4, r1, r2 + str r4, [sp] + movs r1, 0x78 + movs r2, 0x3C + movs r3, 0 + bl sub_80B5E6C + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r8, r2 + mov r3, r8 + str r7, [r3] + add r2, r9 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + mov r4, r10 + orrs r1, r4 + strb r1, [r3] + ldrb r1, [r2, 0x5] + ands r6, r1 + strb r6, [r2, 0x5] + strh r0, [r5, 0x1E] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08031A4C: .4byte 0x02020630 +_08031A50: .4byte nullsub_11 + 1 +_08031A54: .4byte 0x03005e00 +_08031A58: .4byte 0x0201c000 + thumb_func_end sub_803192C + + thumb_func_start waterfall_4_check_if_can_continue +waterfall_4_check_if_can_continue: @ 8031A5C + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, _08031A90 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r4 + ldrh r1, [r2, 0xA] + movs r5, 0xA + ldrsh r0, [r2, r5] + cmp r0, 0 + bne _08031A94 + movs r1, 0x8 + ldrsh r0, [r2, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x1 + strh r0, [r1, 0x12] + adds r0, r3, 0 + bl remove_task + b _08031AC4 + .align 2, 0 +_08031A90: .4byte 0x03005e00 +_08031A94: + ldrh r3, [r2, 0x10] + movs r4, 0x10 + ldrsh r0, [r2, r4] + cmp r0, 0 + beq _08031AA4 + subs r0, r3, 0x1 + strh r0, [r2, 0x10] + b _08031AC4 +_08031AA4: + ldrh r0, [r2, 0xE] + strh r0, [r2, 0x10] + subs r1, 0x1 + strh r1, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r5, 0xC + ldrsh r0, [r2, r5] + lsls r0, 8 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set +_08031AC4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end waterfall_4_check_if_can_continue + + thumb_func_start sub_8031ACC +sub_8031ACC: @ 8031ACC + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x94 + lsls r1, 2 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r0, _08031B34 + mov r8, r0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + movs r6, 0 + strh r6, [r0, 0x12] + ldr r0, _08031B38 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + add r1, r8 + strh r4, [r1, 0x8] + movs r0, 0x10 + strh r0, [r1, 0xA] + strh r6, [r1, 0xC] + strh r5, [r1, 0xE] + strh r5, [r1, 0x10] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08031B34: .4byte 0x03005e00 +_08031B38: .4byte waterfall_4_check_if_can_continue + 1 + thumb_func_end sub_8031ACC + + thumb_func_start sub_8031B3C +sub_8031B3C: @ 8031B3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, _08031B70 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r4 + ldrh r1, [r2, 0xA] + movs r5, 0xA + ldrsh r0, [r2, r5] + cmp r0, 0x10 + bne _08031B74 + movs r1, 0x8 + ldrsh r0, [r2, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x1 + strh r0, [r1, 0x12] + adds r0, r3, 0 + bl remove_task + b _08031BA4 + .align 2, 0 +_08031B70: .4byte 0x03005e00 +_08031B74: + ldrh r3, [r2, 0x10] + movs r4, 0x10 + ldrsh r0, [r2, r4] + cmp r0, 0 + beq _08031B84 + subs r0, r3, 0x1 + strh r0, [r2, 0x10] + b _08031BA4 +_08031B84: + ldrh r0, [r2, 0xE] + strh r0, [r2, 0x10] + adds r1, 0x1 + strh r1, [r2, 0xA] + ldrh r0, [r2, 0xC] + subs r0, 0x1 + strh r0, [r2, 0xC] + movs r5, 0xC + ldrsh r0, [r2, r5] + lsls r0, 8 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set +_08031BA4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8031B3C + + thumb_func_start sub_8031BAC +sub_8031BAC: @ 8031BAC + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x94 + lsls r1, 2 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r0, _08031C14 + mov r8, r0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + movs r6, 0 + strh r6, [r0, 0x12] + ldr r0, _08031C18 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + add r1, r8 + strh r4, [r1, 0x8] + strh r6, [r1, 0xA] + movs r0, 0x10 + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + strh r5, [r1, 0x10] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08031C14: .4byte 0x03005e00 +_08031C18: .4byte sub_8031B3C + 1 + thumb_func_end sub_8031BAC + + thumb_func_start sub_8031C1C +sub_8031C1C: @ 8031C1C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08031C3C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + ldrh r3, [r1, 0xC] + movs r4, 0xC + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08031C40 + subs r0, r3, 0x1 + strh r0, [r1, 0xC] + b _08031C7C + .align 2, 0 +_08031C3C: .4byte 0x03005e00 +_08031C40: + ldrh r3, [r1, 0xA] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r0, 0x8 + bne _08031C52 + adds r0, r2, 0 + bl remove_task + b _08031C7C +_08031C52: + ldrh r2, [r1, 0x10] + movs r4, 0x10 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08031C62 + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + b _08031C7C +_08031C62: + ldrh r0, [r1, 0xE] + strh r0, [r1, 0x10] + adds r0, r3, 0x1 + strh r0, [r1, 0xA] + movs r2, 0xA + ldrsh r0, [r1, r2] + lsls r0, 1 + ldr r1, _08031C84 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x10 + bl gpu_pal_apply +_08031C7C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031C84: .4byte 0x082ff018 + thumb_func_end sub_8031C1C + + thumb_func_start sub_8031C88 +sub_8031C88: @ 8031C88 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08031CC0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08031CC4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x8] + strh r0, [r1, 0xA] + movs r0, 0x8 + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + strh r5, [r1, 0x10] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031CC0: .4byte sub_8031C1C + 1 +_08031CC4: .4byte 0x03005e00 + thumb_func_end sub_8031C88 + + thumb_func_start sub_8031CC8 +sub_8031CC8: @ 8031CC8 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08031CE8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + ldrh r3, [r1, 0xC] + movs r4, 0xC + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08031CEC + subs r0, r3, 0x1 + strh r0, [r1, 0xC] + b _08031D28 + .align 2, 0 +_08031CE8: .4byte 0x03005e00 +_08031CEC: + ldrh r3, [r1, 0xA] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _08031CFE + adds r0, r2, 0 + bl remove_task + b _08031D28 +_08031CFE: + ldrh r2, [r1, 0x10] + movs r4, 0x10 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08031D0E + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + b _08031D28 +_08031D0E: + ldrh r0, [r1, 0xE] + strh r0, [r1, 0x10] + subs r0, r3, 0x1 + strh r0, [r1, 0xA] + movs r2, 0xA + ldrsh r0, [r1, r2] + lsls r0, 1 + ldr r1, _08031D30 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x10 + bl gpu_pal_apply +_08031D28: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031D30: .4byte 0x082ff018 + thumb_func_end sub_8031CC8 + + thumb_func_start sub_8031D34 +sub_8031D34: @ 8031D34 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08031D6C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08031D70 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + movs r0, 0x8 + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + strh r5, [r1, 0x10] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031D6C: .4byte sub_8031CC8 + 1 +_08031D70: .4byte 0x03005e00 + thumb_func_end sub_8031D34 + + thumb_func_start sub_8031D74 +sub_8031D74: @ 8031D74 + push {lr} + ldr r0, _08031DAC + movs r1, 0xF3 + bl write_textbox_border_to_bg_tilemap + movs r0, 0x1 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _08031DB0 + movs r0, 0x1 + movs r1, 0x2 + bl PrintMenuTable + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + pop {r0} + bx r0 + .align 2, 0 +_08031DAC: .4byte 0x082ff088 +_08031DB0: .4byte 0x082ff118 + thumb_func_end sub_8031D74 + + thumb_func_start sub_8031DB4 +sub_8031DB4: @ 8031DB4 + push {lr} + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8031DB4 + + thumb_func_start set_default_player_name +set_default_player_name: @ 8031DC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08031DDC + ldr r0, [r1] + ldrb r0, [r0, 0x8] + adds r5, r1, 0 + cmp r0, 0 + bne _08031DE4 + ldr r1, _08031DE0 + b _08031DE6 + .align 2, 0 +_08031DDC: .4byte 0x03005d90 +_08031DE0: .4byte 0x082ff128 +_08031DE4: + ldr r1, _08031E10 +_08031DE6: + lsls r0, r2, 2 + adds r0, r1 + ldr r3, [r0] + movs r2, 0 + ldr r4, _08031E14 +_08031DF0: + ldr r1, [r4] + adds r1, r2 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _08031DF0 + ldr r1, [r5] + movs r0, 0xFF + strb r0, [r1, 0x7] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031E10: .4byte 0x082ff178 +_08031E14: .4byte 0x03005d90 + thumb_func_end set_default_player_name + + thumb_func_start draw_text_box +draw_text_box: @ 8031E18 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x7 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x7 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0x7 + bl Window_WriteStandardTileMap + movs r0, 0x7 + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, _08031E6C + ldr r1, _08031E70 + bl write_textbox_border_to_bg_tilemap + ldr r1, _08031E74 + movs r0, 0x40 + bl lcd_io_set + ldr r1, _08031E78 + movs r0, 0x44 + bl lcd_io_set + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08031E6C: .4byte 0x082ff070 +_08031E70: .4byte 0x000001d5 +_08031E74: .4byte 0x000009e7 +_08031E78: .4byte 0x0000719f + thumb_func_end draw_text_box + + thumb_func_start fmt_savegame +fmt_savegame: @ 8031E7C + push {lr} + bl fmt_time + bl fmt_pokedex + bl fmt_player + bl fmt_badges + pop {r0} + bx r0 + thumb_func_end fmt_savegame + + thumb_func_start fmt_time +fmt_time: @ 8031E94 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, _08031EE8 + ldr r1, _08031EEC + adds r0, r4, 0 + bl ExpandTextCodes + ldr r6, _08031EF0 + str r6, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x11 + bl box_print + ldr r4, _08031EF4 + ldr r1, [r4] + movs r0, 0x1 + movs r2, 0x64 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + str r5, [sp, 0x4] + ldr r0, [r4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08031EE8: .4byte 0x02021fc4 +_08031EEC: .4byte 0x085edcc3 +_08031EF0: .4byte 0x082ff0e3 +_08031EF4: .4byte 0x03005d90 + thumb_func_end fmt_time + + thumb_func_start fmt_player +fmt_player: @ 8031EF8 + push {r4-r6,lr} + sub sp, 0x2C + ldr r4, _08031F6C + ldr r1, _08031F70 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r6, _08031F74 + str r6, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x6C + movs r3, 0x11 + bl box_print + ldr r4, _08031F78 + ldr r0, [r4] + ldrh r1, [r0, 0xE] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + movs r1, 0xF0 + strb r1, [r0] + adds r0, 0x1 + ldr r1, [r4] + ldrb r1, [r1, 0x10] + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0xD0 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + str r5, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08031F6C: .4byte 0x02021fc4 +_08031F70: .4byte 0x085edcca +_08031F74: .4byte 0x082ff0e3 +_08031F78: .4byte 0x03005d90 + thumb_func_end fmt_player + + thumb_func_start fmt_pokedex +fmt_pokedex: @ 8031F7C + push {r4-r7,lr} + sub sp, 0x2C + ldr r0, _08031FA0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08031FFE + bl sub_809D42C + cmp r0, 0 + beq _08031FA4 + movs r0, 0x1 + bl pokedex_count + b _08031FAA + .align 2, 0 +_08031FA0: .4byte 0x00000861 +_08031FA4: + movs r0, 0x1 + bl sub_80C0844 +_08031FAA: + lsls r0, 16 + lsrs r7, r0, 16 + ldr r4, _08032008 + ldr r1, _0803200C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r6, _08032010 + str r6, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x21 + bl box_print + add r0, sp, 0xC + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x64 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + str r5, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x21 + bl box_print +_08031FFE: + add sp, 0x2C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08032008: .4byte 0x02021fc4 +_0803200C: .4byte 0x085edccf +_08032010: .4byte 0x082ff0e3 + thumb_func_end fmt_pokedex + + thumb_func_start fmt_badges +fmt_badges: @ 8032014 + push {r4-r7,lr} + sub sp, 0x2C + movs r7, 0 + ldr r4, _08032090 +_0803201C: + lsls r0, r4, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08032030 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_08032030: + adds r4, 0x1 + ldr r0, _08032094 + cmp r4, r0 + bls _0803201C + ldr r4, _08032098 + ldr r1, _0803209C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r6, _080320A0 + str r6, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x6C + movs r3, 0x21 + bl box_print + add r0, sp, 0xC + adds r1, r7, 0 + movs r2, 0x2 + movs r3, 0x1 + bl decimal_int_to_string + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0xD0 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + str r5, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x21 + bl box_print + add sp, 0x2C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08032090: .4byte 0x00000867 +_08032094: .4byte 0x0000086e +_08032098: .4byte 0x02021fc4 +_0803209C: .4byte 0x085edcd7 +_080320A0: .4byte 0x082ff0e3 + thumb_func_end fmt_badges + + thumb_func_start unknown_title_pattern_data_to_vram +unknown_title_pattern_data_to_vram: @ 80320A4 + 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, _080320E8 + ldr r0, [r6] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + adds r0, r4, 0 + adds r3, r5, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, [r6] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080320E8: .4byte 0x03005d90 + thumb_func_end unknown_title_pattern_data_to_vram + + thumb_func_start write_textbox_border_to_bg_tilemap +write_textbox_border_to_bg_tilemap: @ 80320EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r0, 0 + lsls r6, r1, 16 + movs r0, 0x80 + lsls r0, 9 + adds r0, r6 + lsrs r0, 16 + mov r9, r0 + movs r1, 0x80 + lsls r1, 10 + adds r1, r6 + lsrs r1, 16 + mov r10, r1 + movs r7, 0xC0 + lsls r7, 10 + adds r1, r6, r7 + lsrs r1, 16 + str r1, [sp, 0x18] + movs r0, 0xA0 + lsls r0, 11 + adds r1, r6, r0 + lsrs r1, 16 + str r1, [sp, 0xC] + movs r7, 0xC0 + lsls r7, 11 + adds r1, r6, r7 + lsrs r1, 16 + str r1, [sp, 0x10] + movs r0, 0xE0 + lsls r0, 11 + adds r1, r6, r0 + lsrs r1, 16 + str r1, [sp, 0x14] + lsrs r1, r6, 16 + movs r7, 0x80 + lsls r7, 12 + adds r6, r7 + lsrs r6, 16 + ldrb r0, [r4] + 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] + movs r7, 0x2 + mov r8, r7 + str r7, [sp, 0x8] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x1] + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldrb r1, [r4, 0x3] + str r1, [sp] + str r5, [sp, 0x4] + str r7, [sp, 0x8] + mov r1, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x3] + ldrb r1, [r4, 0x1] + adds r2, r1 + 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 r7, [sp, 0x8] + mov r1, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + str r5, [sp] + ldrb r1, [r4, 0x4] + str r1, [sp, 0x4] + str r7, [sp, 0x8] + ldr r1, [sp, 0x18] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x3] + ldrb r7, [r4, 0x1] + adds r2, r7 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + str r5, [sp] + ldrb r1, [r4, 0x4] + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + ldr r1, [sp, 0xC] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x4] + ldrb r7, [r4, 0x2] + adds r3, r7 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + ldr r1, [sp, 0x10] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x1] + ldrb r3, [r4, 0x4] + ldrb r7, [r4, 0x2] + adds r3, r7 + lsls r3, 24 + lsrs r3, 24 + ldrb r1, [r4, 0x3] + str r1, [sp] + str r5, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + ldr r1, [sp, 0x14] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + ldrb r2, [r4, 0x3] + ldrb r7, [r4, 0x1] + adds r2, r7 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x4] + ldrb r1, [r4, 0x2] + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r7, r8 + str r7, [sp, 0x8] + adds r1, r6, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r4] + bl gpu_copy_wram_bg_tilemap_to_vram + 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 write_textbox_border_to_bg_tilemap + + thumb_func_start sub_8032250 +sub_8032250: @ 8032250 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + subs r2, r1, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r4, [r6, 0x2] + subs r3, r4, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldrb r5, [r6, 0x3] + adds r1, r5 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + ldrb r1, [r6, 0x4] + adds r4, r1 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + movs r1, 0x2 + str r1, [sp, 0x8] + movs r1, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r0, [r6] + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8032250 + + thumb_func_start sub_8032298 +sub_8032298: @ 8032298 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0x2 + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8032298 + + thumb_func_start sub_80322E0 +sub_80322E0: @ 80322E0 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08032314 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_FillTileMap + cmp r4, 0x1 + bne _0803230E + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0803230E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08032314: .4byte sub_8032298 + 1 + thumb_func_end sub_80322E0 + + thumb_func_start sub_8032318 +sub_8032318: @ 8032318 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x1 + movs r1, 0x6 + bl fbox_get_field + mov r9, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x1 + movs r1, 0 + bl fbox_get_field + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + movs r1, 0x1 + bl fbox_get_field + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x3 + bl Window_GetField + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x4 + bl Window_GetField + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + muls r1, r4 + str r1, [sp] + muls r0, r5 + str r0, [sp, 0x4] + adds r0, r6, 0 + mov r1, r9 + movs r2, 0 + movs r3, 0 + bl Window_FillPixelRect + adds r0, r6, 0 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8032318 + + thumb_func_start sub_80323A0 +sub_80323A0: @ 80323A0 + push {lr} + ldr r0, [r0] + subs r0, 0x2 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080323C0 + ldr r1, _080323C4 + ldrb r0, [r1] + cmp r0, 0 + bne _080323C0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080323C8 + movs r1, 0 + bl AddTask +_080323C0: + pop {r0} + bx r0 + .align 2, 0 +_080323C4: .4byte 0x02022d04 +_080323C8: .4byte sub_8030A70 + 1 + thumb_func_end sub_80323A0 + + thumb_func_start sub_80323CC +sub_80323CC: @ 80323CC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r2 + ldr r6, [sp, 0x34] + ldr r1, [sp, 0x38] + lsls r4, 24 + lsls r5, 24 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + adds r5, r0 + lsrs r5, 24 + movs r0, 0x5 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r3, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + mov r1, r8 + adds r2, r6, 0 + movs r3, 0 + bl sub_81996C0 + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80323CC + + thumb_func_start unknown_rbox_to_vram +unknown_rbox_to_vram: @ 803243C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08032470 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _0803246A + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0803246A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08032470: .4byte sub_8032474 + 1 + thumb_func_end unknown_rbox_to_vram + + thumb_func_start sub_8032474 +sub_8032474: @ 8032474 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + adds r5, r2, 0 + mov r9, r3 + ldr r0, [sp, 0x40] + ldr r6, [sp, 0x44] + mov r2, r8 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r1, 24 + lsls r5, 24 + mov r2, r9 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r6, 24 + lsrs r6, 24 + lsrs r0, r1, 24 + str r0, [sp, 0xC] + movs r2, 0xFE + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x14] + lsrs r0, r5, 24 + mov r10, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + movs r1, 0xFD + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + movs r1, 0xFF + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x80 + lsls r1, 1 + mov r0, r9 + str r0, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08032600 + ldr r7, [sp, 0xC] + add r7, r9 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x81 + lsls r1, 1 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08032604 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08032608 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x83 + lsls r1, 1 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _0803260C + ldr r2, [sp, 0x10] + add r10, r2 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08032610 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x90 + lsls r1, 4 + movs r2, 0x1 + negs r2, r2 + add r9, r2 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08032614 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x1C] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08032618 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08032600: .4byte 0x00000101 +_08032604: .4byte 0x00000103 +_08032608: .4byte 0x00000105 +_0803260C: .4byte 0x000008fd +_08032610: .4byte 0x000008ff +_08032614: .4byte 0x00000901 +_08032618: .4byte 0x00000902 + thumb_func_end sub_8032474 + + thumb_func_start task_new_game_prof_birch_speech_part2_1 +task_new_game_prof_birch_speech_part2_1: @ 803261C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0803264C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x16] + subs r1, r0, 0x1 + strh r1, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + bgt _08032644 + movs r0, 0 + movs r1, 0x1 + bl unknown_rbox_to_vram + ldr r0, _08032650 + str r0, [r4] +_08032644: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803264C: .4byte 0x03005e00 +_08032650: .4byte task_new_game_prof_birch_speech_part2_2 + 1 + thumb_func_end task_new_game_prof_birch_speech_part2_1 + + thumb_func_start battle_wireless_setup_if_required_maybe +battle_wireless_setup_if_required_maybe: @ 8032654 + push {lr} + ldr r0, _0803268C + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08032686 + ldr r0, _08032690 + ldrb r0, [r0] + cmp r0, 0 + beq _0803266E + bl sub_800B488 +_0803266E: + ldr r0, _08032694 + ldrb r0, [r0] + cmp r0, 0 + bne _0803267A + bl sub_8009734 +_0803267A: + ldr r0, _08032698 + movs r1, 0 + bl AddTask + bl sub_8033244 +_08032686: + pop {r0} + bx r0 + .align 2, 0 +_0803268C: .4byte 0x02022fec +_08032690: .4byte 0x030030fc +_08032694: .4byte 0x03003124 +_08032698: .4byte task00_08081A90 + 1 + 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, _08032738 + ldr r1, _0803273C + str r1, [r0] + movs r0, 0 + str r0, [sp, 0x10] + movs r1, 0 + ldr r7, _08032740 + ldr r6, _08032744 + movs r2, 0 + ldr r5, _08032748 + ldr r4, _0803274C + ldr r3, _08032750 +_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, _08032754 + movs r5, 0 + str r5, [r0] + bl sub_80A3934 + bl sub_806E414 + movs r0, 0xF + bl sub_81308C8 + ldr r0, _08032758 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08032728 + bl zero_enemy_party_data + ldr r4, _0803275C + 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, _08032760 + str r5, [r0] + ldr r0, _08032764 + strb r5, [r0] + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08032738: .4byte 0x03005d04 +_0803273C: .4byte nullsub_20 + 1 +_08032740: .4byte 0x03005d60 +_08032744: .4byte 0x020244ac +_08032748: .4byte 0x020244b0 +_0803274C: .4byte nullsub_21 + 1 +_08032750: .4byte 0x02024076 +_08032754: .4byte 0x02024068 +_08032758: .4byte 0x02022fec +_0803275C: .4byte 0x02024744 +_08032760: .4byte 0x02022ff4 +_08032764: .4byte 0x0202428c + thumb_func_end sub_803269C + + thumb_func_start sub_8032768 +sub_8032768: @ 8032768 + push {r4,r5,lr} + ldr r0, _08032780 + 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 + .align 2, 0 +_08032780: .4byte 0x02022fec +_08032784: + movs r0, 0x2 + bl sub_8184DA4 +_0803278A: + ldr r4, _080327AC + 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 + .align 2, 0 +_080327AC: .4byte 0x02022fec +_080327B0: + bl b_setup_bx +_080327B4: + bl sub_8033050 + ldr r0, _08032818 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080327E2 + movs r4, 0 + ldr r0, _0803281C + 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, _08032820 + 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, _08032820 + 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 + .align 2, 0 +_08032818: .4byte 0x02022fec +_0803281C: .4byte 0x0202406c +_08032820: .4byte 0x0202449c + 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, _0803285C + ldr r3, [r0] + movs r5, 0x80 + lsls r5, 15 + ands r5, r3 + cmp r5, 0 + beq _080328E4 + ldr r1, _08032860 + ldr r0, _08032864 + str r0, [r1] + movs r4, 0x80 + lsls r4, 17 + ands r4, r3 + cmp r4, 0 + beq _08032874 + ldr r2, _08032868 + ldr r0, _0803286C + str r0, [r2] + ldr r1, _08032870 + movs r0, 0 + strb r0, [r1] + b _0803287E + .align 2, 0 +_0803285C: .4byte 0x02022fec +_08032860: .4byte 0x03005d04 +_08032864: .4byte sub_8039ECC + 1 +_08032868: .4byte 0x03005d60 +_0803286C: .4byte sub_818994C + 1 +_08032870: .4byte 0x02024076 +_08032874: + ldr r2, _080328C8 + ldr r0, _080328CC + str r0, [r2] + ldr r1, _080328D0 + strb r4, [r1] +_0803287E: + ldr r3, _080328D4 + str r3, [r2, 0x4] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, _080328D8 + str r0, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r1, _080328DC + 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, _080328E0 + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x3 + b _08032A76 + .align 2, 0 +_080328C8: .4byte 0x03005d60 +_080328CC: .4byte sub_805745C + 1 +_080328D0: .4byte 0x02024076 +_080328D4: .4byte sub_805F164 + 1 +_080328D8: .4byte sub_81BADF4 + 1 +_080328DC: .4byte 0x0202406c +_080328E0: .4byte 0x0202406e +_080328E4: + movs r7, 0x1 + adds r0, r3, 0 + ands r0, r7 + cmp r0, 0 + beq _080328F0 + b _080329E0 +_080328F0: + ldr r0, _08032908 + ldr r2, _0803290C + str r2, [r0] + movs r1, 0x80 + ands r1, r3 + mov r12, r2 + cmp r1, 0 + beq _08032918 + ldr r1, _08032910 + ldr r0, _08032914 + b _08032934 + .align 2, 0 +_08032908: .4byte 0x03005d04 +_0803290C: .4byte sub_8039ECC + 1 +_08032910: .4byte 0x03005d60 +_08032914: .4byte sub_815936C + 1 +_08032918: + movs r0, 0x80 + lsls r0, 2 + ands r3, r0 + cmp r3, 0 + beq _08032930 + ldr r1, _08032928 + ldr r0, _0803292C + b _08032934 + .align 2, 0 +_08032928: .4byte 0x03005d60 +_0803292C: .4byte bx_goto_buffer_A_ch0_tbl3 + 1 +_08032930: + ldr r1, _08032990 + ldr r0, _08032994 +_08032934: + str r0, [r1] + mov r10, r1 + ldr r4, _08032998 + movs r0, 0 + mov r9, r0 + mov r1, r9 + strb r1, [r4] + mov r5, r10 + ldr r2, _0803299C + mov r8, r2 + str r2, [r5, 0x4] + movs r6, 0x1 + strb r6, [r4, 0x1] + ldr r2, _080329A0 + movs r7, 0x2 + strb r7, [r2] + ldr r0, _080329A4 + 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, _080329A8 + str r1, [r0] + ldr r0, _080329AC + str r0, [r5] + mov r1, r9 + strb r1, [r4] + ldr r0, _080329B0 + str r0, [r5, 0x4] + strb r6, [r4, 0x1] + strb r7, [r2] + b _08032CB2 + .align 2, 0 +_08032990: .4byte 0x03005d60 +_08032994: .4byte sub_805745C + 1 +_08032998: .4byte 0x02024076 +_0803299C: .4byte sub_805F164 + 1 +_080329A0: .4byte 0x0202406c +_080329A4: .4byte 0x02022fec +_080329A8: .4byte 0x03005d04 +_080329AC: .4byte sub_818994C + 1 +_080329B0: .4byte sub_81864EC + 1 +_080329B4: + ldr r0, _080329C4 + str r0, [r5, 0x4] + strb r1, [r4, 0x1] + ldr r0, _080329C8 + str r0, [r5] + strb r6, [r4] + strb r7, [r2] + b _08032CB2 + .align 2, 0 +_080329C4: .4byte sub_818994C + 1 +_080329C8: .4byte sub_81864EC + 1 +_080329CC: + ldr r0, _080329DC + mov r2, r10 + str r0, [r2] + strb r1, [r4] + mov r0, r8 + str r0, [r2, 0x4] + strb r6, [r4, 0x1] + b _08032CB2 + .align 2, 0 +_080329DC: .4byte sub_818994C + 1 +_080329E0: + ldr r1, _08032A7C + ldr r2, _08032A80 + str r1, [r2] + ldr r2, _08032A84 + ldr r0, _08032A88 + str r0, [r2] + ldr r4, _08032A8C + strb r5, [r4] + ldr r6, _08032A90 + 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, _08032A94 + 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, _08032A7C + ldr r1, _08032A80 + str r0, [r1] + ldr r0, _08032A98 + 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, _08032A9C + strh r5, [r0] + strh r5, [r0, 0x2] + mov r1, r8 +_08032A76: + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + b _08032CB2 + .align 2, 0 +_08032A7C: .4byte sub_8039ECC + 1 +_08032A80: .4byte 0x03005d04 +_08032A84: .4byte 0x03005d60 +_08032A88: .4byte sub_805745C + 1 +_08032A8C: .4byte 0x02024076 +_08032A90: .4byte sub_805F164 + 1 +_08032A94: .4byte 0x0202406c +_08032A98: .4byte sub_818994C + 1 +_08032A9C: .4byte 0x0202406e +_08032AA0: + movs r5, 0x40 + ands r5, r3 + cmp r5, 0 + bne _08032AAA + b _08032C3C +_08032AAA: + ldr r0, _08032AD8 + ldrb r5, [r0] + movs r0, 0 + mov r10, r0 + ldr r1, _08032ADC + mov r12, r1 + adds r7, r4, 0 + mov r8, r0 + ldr r6, _08032AE0 + 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 + .align 2, 0 +_08032AD8: .4byte 0x0203c7b4 +_08032ADC: .4byte 0x020229e8 +_08032AE0: .4byte 0x0202406e +_08032AE4: + cmp r0, 0x3 + bne _08032B06 +_08032AE8: + ldr r0, _08032AF8 + adds r0, r4, r0 + ldrb r0, [r0, 0x18] + movs r1, 0 + bl sub_81B8D64 + b _08032B06 + .align 2, 0 +_08032AF8: .4byte 0x020229e8 +_08032AFC: + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B8D64 +_08032B06: + cmp r10, r5 + bne _08032B56 + ldr r0, _08032B2C + adds r3, r4, r0 + ldrh r1, [r3, 0x18] + lsls r1, 2 + ldr r2, _08032B30 + adds r1, r2 + ldr r2, _08032B34 + 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 + .align 2, 0 +_08032B2C: .4byte 0x020229e8 +_08032B30: .4byte 0x03005d60 +_08032B34: .4byte sub_818994C + 1 +_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, _08032B7C + 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 + .align 2, 0 +_08032B7C: .4byte 0x020229e8 +_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, _08032BB4 + adds r0, r1 + ldr r1, _08032BB8 + str r1, [r0] + ldrh r1, [r2, 0x18] + cmp r1, 0x2 + bgt _08032BBC + cmp r1, 0x1 + bge _08032BD0 + cmp r1, 0 + beq _08032BC0 + b _08032C2C + .align 2, 0 +_08032BB4: .4byte 0x03005d60 +_08032BB8: .4byte sub_818994C + 1 +_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, _08032BF8 + adds r0, r1 + ldr r1, _08032BFC + str r1, [r0] + ldrh r0, [r2, 0x18] + cmp r0, 0x2 + bgt _08032C00 + cmp r0, 0x1 + bge _08032C1C + cmp r0, 0 + beq _08032C04 + b _08032C2C + .align 2, 0 +_08032BF8: .4byte 0x03005d60 +_08032BFC: .4byte sub_81864EC + 1 +_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, _08032C68 + 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, _08032C6C + str r0, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0xC] + mov r1, r8 + strb r1, [r4, 0x3] + b _08032CB2 + .align 2, 0 +_08032C68: .4byte sub_818994C + 1 +_08032C6C: .4byte sub_81864EC + 1 +_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, _08032CA0 + 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, _08032CA4 + str r0, [r2] + strb r7, [r4] + str r0, [r2, 0x8] + mov r1, r8 + strb r1, [r4, 0x2] + b _08032CB2 + .align 2, 0 +_08032CA0: .4byte sub_818994C + 1 +_08032CA4: .4byte sub_81864EC + 1 +_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, _08032CFC + 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, _08032D00 + ldr r0, _08032D04 + str r0, [r1] + ldr r2, _08032D08 + ldr r0, _08032D0C + str r0, [r2] + ldr r1, _08032D10 + strb r3, [r1] + ldr r0, _08032D14 + str r0, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r1, _08032D18 + movs r0, 0x2 + b _0803303A + .align 2, 0 +_08032CFC: .4byte 0x02022fec +_08032D00: .4byte 0x03005d04 +_08032D04: .4byte sub_8039ECC + 1 +_08032D08: .4byte 0x03005d60 +_08032D0C: .4byte sub_805745C + 1 +_08032D10: .4byte 0x02024076 +_08032D14: .4byte sub_8064394 + 1 +_08032D18: .4byte 0x0202406c +_08032D1C: + ldr r2, _08032D34 + ldr r0, _08032D38 + str r0, [r2, 0x4] + ldr r1, _08032D3C + strb r4, [r1, 0x1] + ldr r0, _08032D40 + str r0, [r2] + strb r5, [r1] + ldr r1, _08032D44 + movs r0, 0x2 + b _0803303A + .align 2, 0 +_08032D34: .4byte 0x03005d60 +_08032D38: .4byte sub_805745C + 1 +_08032D3C: .4byte 0x02024076 +_08032D40: .4byte sub_8064394 + 1 +_08032D44: .4byte 0x0202406c +_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, _08032D80 + ldr r0, _08032D84 + str r0, [r1] + ldr r2, _08032D88 + ldr r4, _08032D8C + str r4, [r2] + ldr r1, _08032D90 + movs r0, 0 + strb r0, [r1] + ldr r3, _08032D94 + 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 + .align 2, 0 +_08032D80: .4byte 0x03005d04 +_08032D84: .4byte sub_8039ECC + 1 +_08032D88: .4byte 0x03005d60 +_08032D8C: .4byte sub_805745C + 1 +_08032D90: .4byte 0x02024076 +_08032D94: .4byte sub_8064394 + 1 +_08032D98: + ldr r2, _08032DBC + ldr r0, _08032DC0 + str r0, [r2, 0x4] + ldr r1, _08032DC4 + strb r3, [r1, 0x1] + ldr r3, _08032DC8 + 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, _08032DCC + strb r6, [r0] + b _0803303C + .align 2, 0 +_08032DBC: .4byte 0x03005d60 +_08032DC0: .4byte sub_805745C + 1 +_08032DC4: .4byte 0x02024076 +_08032DC8: .4byte sub_8064394 + 1 +_08032DCC: .4byte 0x0202406c +_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, _08032E00 + ldr r0, _08032E04 + str r0, [r1] + ldr r2, _08032E08 + ldr r0, _08032E0C + str r0, [r2] + ldr r1, _08032E10 + movs r0, 0 + strb r0, [r1] + ldr r3, _08032E14 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r0, _08032E18 + b _08032E2E + .align 2, 0 +_08032E00: .4byte 0x03005d04 +_08032E04: .4byte sub_8039ECC + 1 +_08032E08: .4byte 0x03005d60 +_08032E0C: .4byte sub_805745C + 1 +_08032E10: .4byte 0x02024076 +_08032E14: .4byte sub_805F164 + 1 +_08032E18: .4byte sub_814AEB0 + 1 +_08032E1C: + ldr r2, _08032E70 + ldr r0, _08032E74 + str r0, [r2] + ldr r1, _08032E78 + strb r3, [r1] + ldr r3, _08032E7C + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r0, _08032E80 +_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, _08032E84 + 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, _08032E88 + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x3 + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + b _0803303C + .align 2, 0 +_08032E70: .4byte 0x03005d60 +_08032E74: .4byte sub_814AEB0 + 1 +_08032E78: .4byte 0x02024076 +_08032E7C: .4byte sub_8064394 + 1 +_08032E80: .4byte sub_805745C + 1 +_08032E84: .4byte 0x0202406c +_08032E88: .4byte 0x0202406e +_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, _08032ECC + ldr r0, _08032ED0 + str r0, [r1] +_08032EA4: + movs r0, 0 + mov r10, r0 + ldr r1, _08032ED4 + mov r12, r1 + ldr r7, _08032ED8 + mov r8, r0 + ldr r6, _08032EDC + 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 + .align 2, 0 +_08032ECC: .4byte 0x03005d04 +_08032ED0: .4byte sub_8039ECC + 1 +_08032ED4: .4byte 0x020229e8 +_08032ED8: .4byte 0x02024076 +_08032EDC: .4byte 0x0202406e +_08032EE0: + cmp r0, 0x3 + bne _08032F02 +_08032EE4: + ldr r0, _08032EF4 + adds r0, r4, r0 + ldrb r0, [r0, 0x18] + movs r1, 0 + bl sub_81B8D64 + b _08032F02 + .align 2, 0 +_08032EF4: .4byte 0x020229e8 +_08032EF8: + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B8D64 +_08032F02: + cmp r10, r5 + bne _08032F52 + ldr r0, _08032F28 + adds r3, r4, r0 + ldrh r1, [r3, 0x18] + lsls r1, 2 + ldr r2, _08032F2C + adds r1, r2 + ldr r2, _08032F30 + 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 + .align 2, 0 +_08032F28: .4byte 0x020229e8 +_08032F2C: .4byte 0x03005d60 +_08032F30: .4byte sub_805745C + 1 +_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, _08032F78 + 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 + .align 2, 0 +_08032F78: .4byte 0x020229e8 +_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, _08032FB0 + adds r0, r1 + ldr r1, _08032FB4 + str r1, [r0] + ldrh r1, [r2, 0x18] + cmp r1, 0x2 + bgt _08032FB8 + cmp r1, 0x1 + bge _08032FCC + cmp r1, 0 + beq _08032FBC + b _08033028 + .align 2, 0 +_08032FB0: .4byte 0x03005d60 +_08032FB4: .4byte sub_814AEB0 + 1 +_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, _08032FF4 + adds r0, r1 + ldr r1, _08032FF8 + str r1, [r0] + ldrh r0, [r2, 0x18] + cmp r0, 0x2 + bgt _08032FFC + cmp r0, 0x1 + bge _08033018 + cmp r0, 0 + beq _08033000 + b _08033028 + .align 2, 0 +_08032FF4: .4byte 0x03005d60 +_08032FF8: .4byte sub_8064394 + 1 +_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, _0803304C + 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 + .align 2, 0 +_0803304C: .4byte 0x0202406c + 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, _08033070 + 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 + .align 2, 0 +_08033070: .4byte 0x02022fec +_08033074: + movs r5, 0 + movs r0, 0x1 + add r0, r8 + mov r10, r0 + ldr r0, _080330A0 + 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, _080330A4 + b _080330AA + .align 2, 0 +_080330A0: .4byte 0x02024076 +_080330A4: .4byte 0x020244ec +_080330A8: + ldr r0, _080330E8 +_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, _080330EC + adds r0, r6, r0 + strh r5, [r0] + b _08033178 + .align 2, 0 +_080330E8: .4byte 0x02024744 +_080330EC: .4byte 0x0202406e +_080330F0: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08033118 + ldr r0, _08033114 + 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 + .align 2, 0 +_08033114: .4byte 0x020244ec +_08033118: + ldr r0, _08033168 + 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, _0803316C + 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 + .align 2, 0 +_08033168: .4byte 0x02024744 +_0803316C: .4byte 0x0202406e +_08033170: + adds r7, 0x64 + adds r5, 0x1 + cmp r5, 0x5 + ble _08033088 +_08033178: + mov r8, r10 +_0803317A: + ldr r0, _080331AC + ldrb r0, [r0] + cmp r8, r0 + bge _08033184 + b _08033074 +_08033184: + ldr r0, _080331B0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803319C + ldr r0, _080331B4 + 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 + .align 2, 0 +_080331AC: .4byte 0x0202406c +_080331B0: .4byte 0x02022fec +_080331B4: .4byte 0x0202406e + 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, _080331E0 + 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 + .align 2, 0 +_080331E0: .4byte 0x02022fec +_080331E4: + cmp r5, 0 + beq _080331EE + cmp r5, 0x1 + beq _08033218 + b _08033236 +_080331EE: + movs r3, 0 + cmp r3, r2 + bge _08033236 + ldr r6, _08033210 + ldr r5, _08033214 +_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 + .align 2, 0 +_08033210: .4byte 0x02023064 +_08033214: .4byte 0x02024064 +_08033218: + movs r3, 0 + cmp r3, r2 + bge _08033236 + ldr r6, _0803323C + ldr r5, _08033240 +_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 + .align 2, 0 +_0803323C: .4byte 0x02023864 +_08033240: .4byte 0x02024064 + thumb_func_end dp01_prepare_buffer + + thumb_func_start sub_8033244 +sub_8033244: @ 8033244 + push {r4-r6,lr} + ldr r0, _080332DC + movs r1, 0 + bl AddTask + ldr r2, _080332E0 + strb r0, [r2] + ldr r5, _080332E4 + 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, _080332E8 + movs r1, 0 + bl AddTask + ldr r2, _080332EC + 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, _080332F0 + strb r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080332DC: .4byte task00_wireless_something + 1 +_080332E0: .4byte 0x02022d08 +_080332E4: .4byte 0x03005e00 +_080332E8: .4byte sub_803375C + 1 +_080332EC: .4byte 0x02022d09 +_080332F0: .4byte 0x02022d0a + 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, _08033454 + ldr r3, _08033458 + 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, _0803345C + 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, _08033460 + 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, _08033464 + 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, _08033468 + 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, _0803346C + 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, _08033470 + 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 + .align 2, 0 +_08033454: .4byte 0x03005e00 +_08033458: .4byte 0x02022d08 +_0803345C: .4byte 0x020244a0 +_08033460: .4byte 0x02024064 +_08033464: .4byte 0x0202420b +_08033468: .4byte 0x0202420c +_0803346C: .4byte 0x02024210 +_08033470: .4byte 0x0202420e + 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, _0803349C + 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, _080334A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803349C: .4byte 0x03005e00 +_080334A0: .4byte _080334A4 + .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, _08033500 + 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 + .align 2, 0 +_08033500: .4byte 0x030030fc +_08033504: + ldr r0, _08033518 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0803351C + movs r5, 0x2 + b _0803352A + .align 2, 0 +_08033518: .4byte 0x02022fec +_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, _08033558 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E + .align 2, 0 +_08033558: .4byte 0x03005e00 +_0803355C: + ldr r0, _0803356C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E + .align 2, 0 +_0803356C: .4byte 0x03005e00 +_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, _080335DC + 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 + .align 2, 0 +_080335DC: .4byte 0x020244a0 +_080335E0: + subs r0, 0x1 + strh r0, [r2, 0x22] + b _08033640 +_080335E6: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08033640 + ldr r0, _0803361C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r3, 0x26 + ldrsh r2, [r1, r3] + ldr r0, _08033620 + 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 + .align 2, 0 +_0803361C: .4byte 0x03005e00 +_08033620: .4byte 0x020244a0 +_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, _08033674 + ldrb r0, [r0] + cmp r0, 0 + beq _08033738 + ldr r0, _08033678 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08033738 + bl sub_8011BD0 + movs r4, 0 + ldr r0, _0803367C + mov r10, r0 + b _0803372C + .align 2, 0 +_08033674: .4byte 0x03003124 +_08033678: .4byte 0x02022fec +_0803367C: .4byte 0x020223c4 +_08033680: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08033748 + 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, _0803374C + adds r0, r1 + ldrh r6, [r0] + ldr r7, _08033750 + ldr r4, _08033754 + 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, _08033758 + 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 + .align 2, 0 +_08033748: .4byte 0x0832a328 +_0803374C: .4byte 0x020223c8 +_08033750: .4byte 0x03005e00 +_08033754: .4byte 0x02022d09 +_08033758: .4byte 0x020244a4 + 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, _080337C4 + 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, _080337C8 + 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 + .align 2, 0 +_080337C4: .4byte 0x03005e00 +_080337C8: .4byte 0x020244a4 +_080337CC: + cmp r0, 0x2 + beq _08033874 + b _0803388A +_080337D2: + ldr r2, _0803383C + ldr r1, _08033840 + 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, _08033844 + 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, _08033848 + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0803388A + ldr r2, _0803384C + 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, _08033850 + movs r4, 0x26 + ldrsh r0, [r5, r4] + adds r0, r1 + ldrb r0, [r0, 0x3] + strb r0, [r2] + ldr r2, _08033854 + movs r3, 0x26 + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0, 0x6] + strb r0, [r2] + ldr r2, _08033858 + movs r4, 0x26 + ldrsh r0, [r5, r4] + adds r0, r1 + ldrb r0, [r0, 0x7] + strb r0, [r2] + b _0803388A + .align 2, 0 +_0803383C: .4byte 0x02024068 +_08033840: .4byte 0x0832a328 +_08033844: .4byte 0x02023064 +_08033848: .4byte 0x02022fec +_0803384C: .4byte 0x0202420b +_08033850: .4byte 0x0202420c +_08033854: .4byte 0x02024210 +_08033858: .4byte 0x0202420e +_0803385C: + lsls r0, r4, 9 + ldr r1, _08033870 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x8 + adds r2, r6, 0 + bl memcpy + b _0803388A + .align 2, 0 +_08033870: .4byte 0x02023864 +_08033874: + ldrb r2, [r3, 0x8] + ldr r3, _080338A8 + ldr r1, _080338AC + 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, _080338B0 + 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 + .align 2, 0 +_080338A8: .4byte 0x02024068 +_080338AC: .4byte 0x0832a328 +_080338B0: .4byte 0x03005e00 + 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, _080338D4 + 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 + .align 2, 0 +_080338D4: .4byte 0x02022d10 + 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, _080338FC + 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 + .align 2, 0 +_080338FC: .4byte 0x02022d10 + 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, _0803393C + 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 + .align 2, 0 +_0803393C: .4byte 0x02022d10 + 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, _0803397C + 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 + .align 2, 0 +_0803397C: .4byte 0x02022d10 + 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, _0803399C + 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 + .align 2, 0 +_0803399C: .4byte 0x02022d10 + 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, _080339C0 + 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 + .align 2, 0 +_080339C0: .4byte 0x02022d10 + 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, _080339E0 + movs r2, 0x6 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .align 2, 0 +_080339E0: .4byte 0x02022d10 + 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, _08033A00 + 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 + .align 2, 0 +_08033A00: .4byte 0x02022d10 + 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, _08033A20 + 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 + .align 2, 0 +_08033A20: .4byte 0x02022d10 + 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, _08033A40 + 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 + .align 2, 0 +_08033A40: .4byte 0x02022d10 + 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, _08033A60 + 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 + .align 2, 0 +_08033A60: .4byte 0x02022d10 + 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, _08033A80 + 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 + .align 2, 0 +_08033A80: .4byte 0x02022d10 + 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, _08033AA0 + 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 + .align 2, 0 +_08033AA0: .4byte 0x02022d10 + 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, _08033AC0 + movs r2, 0xD + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .align 2, 0 +_08033AC0: .4byte 0x02022d10 + 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, _08033B08 + 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 + .align 2, 0 +_08033B08: .4byte 0x02022d10 + 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, _08033BA4 + 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, _08033BA8 + ldrh r0, [r0] + strb r0, [r7, 0xC] + ands r6, r0 + lsrs r0, r6, 8 + strb r0, [r7, 0xD] + adds r4, r7, 0 + b _08033BB6 + .align 2, 0 +_08033BA4: .4byte 0x02022d10 +_08033BA8: .4byte 0x020243cc +_08033BAC: + ldr r0, _08033BE0 + 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 + .align 2, 0 +_08033BE0: .4byte 0x02022d10 + 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, _08033CC4 + movs r0, 0x10 + strb r0, [r2] + ldr r0, _08033CC8 + 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, _08033CCC + ldrh r0, [r4] + strh r0, [r2, 0x4] + ldr r0, _08033CD0 + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x2] + ldr r0, _08033CD4 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, _08033CD8 + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldr r0, _08033CDC + ldrb r0, [r0, 0x17] + strb r0, [r1, 0x7] + ldr r0, _08033CE0 + 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, _08033CE4 + ldrb r0, [r0] + strb r0, [r3, 0xA] + ldr r3, _08033CE8 + 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, _08033CEC + mov r8, r0 + adds r2, 0x10 + ldr r0, _08033CF0 + 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, _08033CF4 + mov r2, r12 + adds r2, 0x30 +_08033C88: + adds r1, r5, r3 + ldr r7, _08033CF8 + 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 + .align 2, 0 +_08033CC4: .4byte 0x02022d10 +_08033CC8: .4byte 0x0202433a +_08033CCC: .4byte 0x020241ea +_08033CD0: .4byte 0x020241ec +_08033CD4: .4byte 0x02024208 +_08033CD8: .4byte 0x0202420a +_08033CDC: .4byte 0x02024474 +_08033CE0: .4byte 0x0202449c +_08033CE4: .4byte 0x0202420f +_08033CE8: .4byte 0x0831c898 +_08033CEC: .4byte 0x02022f78 +_08033CF0: .4byte 0x02024084 +_08033CF4: .4byte 0x02022f68 +_08033CF8: .4byte 0x02022f58 + 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, _08033DB8 + 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, _08033DBC + ldrh r0, [r0] + strh r0, [r2, 0x4] + ldr r0, _08033DC0 + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x2] + ldr r0, _08033DC4 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, _08033DC8 + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldr r0, _08033DCC + ldrb r0, [r0, 0x17] + strb r0, [r1, 0x7] + ldr r0, _08033DD0 + ldr r0, [r0] + adds r0, 0x52 + ldrb r0, [r0] + strb r0, [r1, 0x8] + movs r3, 0 + mov r9, r2 + ldr r7, _08033DD4 + mov r8, r7 + mov r4, r9 + adds r4, 0x10 + ldr r0, _08033DD8 + 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, _08033DDC + mov r2, r12 + adds r2, 0x30 +_08033D7C: + adds r1, r5, r3 + ldr r7, _08033DE0 + 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 + .align 2, 0 +_08033DB8: .4byte 0x02022d10 +_08033DBC: .4byte 0x020241ea +_08033DC0: .4byte 0x020241ec +_08033DC4: .4byte 0x02024208 +_08033DC8: .4byte 0x0202420a +_08033DCC: .4byte 0x02024474 +_08033DD0: .4byte 0x0202449c +_08033DD4: .4byte 0x02022f78 +_08033DD8: .4byte 0x02024084 +_08033DDC: .4byte 0x02022f68 +_08033DE0: .4byte 0x02022f58 + 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, _08033E0C + 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 + .align 2, 0 +_08033E0C: .4byte 0x02022d10 + 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, _08033E2C + 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 + .align 2, 0 +_08033E2C: .4byte 0x02022d10 + 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, _08033E68 + 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 + .align 2, 0 +_08033E68: .4byte 0x02022d10 + 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, _08033E9C + 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 + .align 2, 0 +_08033E9C: .4byte 0x02022d10 + 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, _08033ED8 + 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 + .align 2, 0 +_08033ED8: .4byte 0x02022d10 + 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, _08033EF8 + 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 + .align 2, 0 +_08033EF8: .4byte 0x02022d10 + 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, _08033F30 + 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 + .align 2, 0 +_08033F30: .4byte 0x02022d10 + 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, _08033F64 + 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 + .align 2, 0 +_08033F64: .4byte 0x02022d10 + 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, _08033FB8 + 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 + .align 2, 0 +_08033FB8: .4byte 0x02022d10 + 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, _08033FF4 + 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 + .align 2, 0 +_08033FF4: .4byte 0x02022d10 + 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, _08034014 + movs r2, 0x1C + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .align 2, 0 +_08034014: .4byte 0x02022d10 + 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, _0803405C + 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 + .align 2, 0 +_0803405C: .4byte 0x02022d10 + 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, _080340C4 + 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 + .align 2, 0 +_080340C4: .4byte 0x02022d10 + 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, _0803410C + 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 + .align 2, 0 +_0803410C: .4byte 0x02022d10 + 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, _08034154 + 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 + .align 2, 0 +_08034154: .4byte 0x02022d10 + 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, _08034180 + 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 + .align 2, 0 +_08034180: .4byte 0x02022d10 + 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, _080341B8 + 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 + .align 2, 0 +_080341B8: .4byte 0x02022d10 + 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, _080341E4 + 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 + .align 2, 0 +_080341E4: .4byte 0x02022d10 + 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, _08034210 + 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 + .align 2, 0 +_08034210: .4byte 0x02022d10 + 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, _08034230 + 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 + .align 2, 0 +_08034230: .4byte 0x02022d10 + 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, _08034250 + movs r2, 0x26 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .align 2, 0 +_08034250: .4byte 0x02022d10 + 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, _08034270 + 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 + .align 2, 0 +_08034270: .4byte 0x02022d10 + 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, _08034290 + 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 + .align 2, 0 +_08034290: .4byte 0x02022d10 + 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, _080342B0 + 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 + .align 2, 0 +_080342B0: .4byte 0x02022d10 + 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, _080342D0 + 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 + .align 2, 0 +_080342D0: .4byte 0x02022d10 + 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, _080342FC + 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 + .align 2, 0 +_080342FC: .4byte 0x02022d10 + 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, _08034328 + 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 + .align 2, 0 +_08034328: .4byte 0x02022d10 + 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, _08034348 + 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 + .align 2, 0 +_08034348: .4byte 0x02022d10 + 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, _08034368 + movs r2, 0x2E + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .align 2, 0 +_08034368: .4byte 0x02022d10 + 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, _08034388 + 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 + .align 2, 0 +_08034388: .4byte 0x02022d10 + 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, _080343D0 + 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 + .align 2, 0 +_080343D0: .4byte 0x02022d10 + 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, _080343F0 + 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 + .align 2, 0 +_080343F0: .4byte 0x02022d10 + 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, _08034410 + 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 + .align 2, 0 +_08034410: .4byte 0x02022d10 + 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, _08034434 + 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 + .align 2, 0 +_08034434: .4byte 0x02022d10 + 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, _08034460 + 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 + .align 2, 0 +_08034460: .4byte 0x02022d10 + 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, _08034488 + 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 + .align 2, 0 +_08034488: .4byte 0x02022d10 +_0803448C: + strb r2, [r4, 0x2] + strb r2, [r4, 0x3] +_08034490: + ldr r1, _080344A4 + ldrb r2, [r1, 0x2] + adds r2, 0x4 + adds r0, r5, 0 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080344A4: .4byte 0x02022d10 + 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, _080344C4 + movs r2, 0x36 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .align 2, 0 +_080344C4: .4byte 0x02022d10 + 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, _0803450C + movs r0, 0x37 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r0, _08034510 + ldr r1, [r0] + ldr r0, _08034514 + 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 + .align 2, 0 +_0803450C: .4byte 0x02022d10 +_08034510: .4byte 0x03005d90 +_08034514: .4byte 0x00000ca9 + thumb_func_end dp01_build_cmdbuf_x37_a + + thumb_func_start call_LZZUnCompWram +call_LZZUnCompWram: @ 8034518 + push {lr} + bl LZ77UnCompWram + pop {r0} + bx r0 + thumb_func_end call_LZZUnCompWram + + thumb_func_start call_LZZUnCompVram +call_LZZUnCompVram: @ 8034524 + push {lr} + bl LZ77UnCompVram + pop {r0} + bx r0 + thumb_func_end call_LZZUnCompVram + + thumb_func_start gpu_tile_obj_decompress_and_load +gpu_tile_obj_decompress_and_load: @ 8034530 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r5, _08034560 + 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 gpu_tile_obj_alloc_tag_and_copy_to_vram + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08034560: .4byte 0x0201c000 + thumb_func_end gpu_tile_obj_decompress_and_load + + thumb_func_start gpu_tile_obj_decompress_and_load2 +gpu_tile_obj_decompress_and_load2: @ 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 gpu_tile_obj_alloc_tag_and_copy_to_vram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end gpu_tile_obj_decompress_and_load2 + + thumb_func_start gpu_pal_obj_decompress_and_apply +gpu_pal_obj_decompress_and_apply: @ 803458C + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5] + ldr r4, _080345B8 + adds r1, r4, 0 + bl LZ77UnCompWram + str r4, [sp] + ldrh r2, [r5, 0x4] + ldr r1, _080345BC + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080345B8: .4byte 0x0201c000 +_080345BC: .4byte 0xffff0000 + thumb_func_end gpu_pal_obj_decompress_and_apply + + thumb_func_start gpu_pal_obj_decompress_and_apply2 +gpu_pal_obj_decompress_and_apply2: @ 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, _080345EC + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080345EC: .4byte 0xffff0000 + thumb_func_end gpu_pal_obj_decompress_and_apply2 + + thumb_func_start sub_80345F0 +sub_80345F0: @ 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, _0803460C + ldr r0, [r0] + bl LZ77UnCompWram + b _08034618 + .align 2, 0 +_0803460C: .4byte 0x0830a18c +_08034610: + ldr r0, [r3] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034618: + adds r0, r4, 0 + adds r1, r5, 0 + bl duplicate_deoxys_graphics_data + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80345F0 + + thumb_func_start sub_8034628 +sub_8034628: @ 8034628 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, _08034650 + 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 load_poke_gfx_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034650: .4byte 0x0830a18c + thumb_func_end sub_8034628 + + thumb_func_start sub_8034654 +sub_8034654: @ 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, _080346BC + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _080346DC + .align 2, 0 +_080346BC: .4byte 0x083028b8 +_080346C0: + ldr r0, _080346CC + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _080346DC + .align 2, 0 +_080346CC: .4byte 0x0830a18c +_080346D0: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _080346E8 + ldr r0, _080346E4 + ldr r0, [r0] +_080346DC: + adds r1, r4, 0 + bl LZ77UnCompWram + b _080346F0 + .align 2, 0 +_080346E4: .4byte 0x0830a18c +_080346E8: + ldr r0, [r6] + adds r1, r4, 0 + bl LZ77UnCompWram +_080346F0: + adds r0, r4, 0 + adds r1, r7, 0 + bl duplicate_deoxys_graphics_data + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r8 + bl sub_806D664 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8034654 + + thumb_func_start sub_8034710 +sub_8034710: @ 8034710 + push {lr} + ldr r0, [r0] + bl LZ77UnCompWram + pop {r0} + bx r0 + thumb_func_end sub_8034710 + + 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, _08034898 + 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, _0803489C + 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 + .align 2, 0 +_08034898: .4byte 0x00000103 +_0803489C: .4byte 0x00000121 +_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 gpu_tile_obj_decompress_and_load3 +gpu_tile_obj_decompress_and_load3: @ 8034988 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r0, [r0] + lsrs r0, 8 + bl malloc_and_clear + 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 gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r5, 0 + bl free + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end gpu_tile_obj_decompress_and_load3 + + thumb_func_start gpu_pal_obj_decompress_and_apply3 +gpu_pal_obj_decompress_and_apply3: @ 80349C4 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r0, [r0] + lsrs r0, 8 + bl malloc_and_clear + adds r5, r0, 0 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r2, [r4, 0x4] + ldr r1, _08034A04 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_pal_obj_alloc_tag_and_apply + adds r0, r5, 0 + bl free + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08034A04: .4byte 0xffff0000 + thumb_func_end gpu_pal_obj_decompress_and_apply3 + + thumb_func_start LZ77UnCompAnyRam +LZ77UnCompAnyRam: @ 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, _08034A24 + ldr r0, [r0] + bl LZ77UnCompWram + b _08034A30 + .align 2, 0 +_08034A24: .4byte 0x0830a18c +_08034A28: + ldr r0, [r3] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034A30: + adds r0, r4, 0 + adds r1, r5, 0 + bl duplicate_deoxys_graphics_data + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end LZ77UnCompAnyRam + + thumb_func_start load_poke_gfx_probably +load_poke_gfx_probably: @ 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, _08034AA8 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034AC8 + .align 2, 0 +_08034AA8: .4byte 0x083028b8 +_08034AAC: + ldr r0, _08034AB8 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034AC8 + .align 2, 0 +_08034AB8: .4byte 0x0830a18c +_08034ABC: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08034AD4 + ldr r0, _08034AD0 + ldr r0, [r0] +_08034AC8: + adds r1, r4, 0 + bl LZ77UnCompWram + b _08034ADC + .align 2, 0 +_08034AD0: .4byte 0x0830a18c +_08034AD4: + ldr r0, [r6] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034ADC: + adds r0, r4, 0 + adds r1, r7, 0 + bl duplicate_deoxys_graphics_data + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r8 + bl sub_806D664 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end load_poke_gfx_probably + + thumb_func_start help_system_enable_unless_flashback__sp199 +help_system_enable_unless_flashback__sp199: @ 8034AFC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, _08034B24 + 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 load_poke_gfx_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034B24: .4byte 0x0830a18c + thumb_func_end help_system_enable_unless_flashback__sp199 + + 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, _08034B40 + ldr r0, [r0] + bl LZ77UnCompWram + b _08034B4A + .align 2, 0 +_08034B40: .4byte 0x0830a18c +_08034B44: + ldr r0, [r3] + bl LZ77UnCompWram +_08034B4A: + pop {r0} + bx r0 + thumb_func_end sub_8034B28 + + thumb_func_start sub_8034B50 +sub_8034B50: @ 8034B50 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, _08034B78 + 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 sub_8034B7C + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034B78: .4byte 0x0830a18c + thumb_func_end sub_8034B50 + + thumb_func_start sub_8034B7C +sub_8034B7C: @ 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, _08034BE4 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034C04 + .align 2, 0 +_08034BE4: .4byte 0x083028b8 +_08034BE8: + ldr r0, _08034BF4 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034C04 + .align 2, 0 +_08034BF4: .4byte 0x0830a18c +_08034BF8: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08034C10 + ldr r0, _08034C0C + ldr r0, [r0] +_08034C04: + adds r1, r5, 0 + bl LZ77UnCompWram + b _08034C18 + .align 2, 0 +_08034C0C: .4byte 0x0830a18c +_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 sub_806D664 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8034B7C + + thumb_func_start duplicate_deoxys_graphics_data +duplicate_deoxys_graphics_data: @ 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, _08034C50 + adds r1, r3, 0 + bl CpuSet +_08034C4A: + pop {r0} + bx r0 + .align 2, 0 +_08034C50: .4byte 0x04000200 + thumb_func_end duplicate_deoxys_graphics_data + + thumb_func_start sub_8034C54 +sub_8034C54: @ 8034C54 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r5, _08034C74 + ldr r0, [r5] + cmp r0, 0 + beq _08034C64 + bl sub_8034CC8 +_08034C64: + movs r0, 0x8 + bl malloc + str r0, [r5] + cmp r0, 0 + bne _08034C78 + movs r0, 0 + b _08034CC0 + .align 2, 0 +_08034C74: .4byte 0x02022e10 +_08034C78: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + bl malloc + 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, _08034D10 + 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, _08034D10 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl free +_08034CFC: + ldr r4, _08034D10 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] +_08034D08: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034D10: .4byte 0x02022e10 + 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, _08034D8C + 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 gpu_tile_obj_tag_get_range_start + 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, _08034D90 + 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 gpu_tile_obj_alloc_tag_and_copy_to_vram + b _08034DB4 + .align 2, 0 +_08034D8C: .4byte 0x02022e10 +_08034D90: .4byte 0xffff0000 +_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 gpu_tile_obj_decompress_and_load +_08034DB4: + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strh r0, [r1, 0xA] + ldr r0, _08034DD8 + 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, _08034DDC + cmp r1, r0 + bne _08034DE0 +_08034DD4: + movs r0, 0 + b _08034EE8 + .align 2, 0 +_08034DD8: .4byte 0x02022e10 +_08034DDC: .4byte 0x0000ffff +_08034DE0: + ldr r0, [r5, 0xC] + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + ldr r6, _08034EF8 + 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 gpu_pal_obj_alloc_tag_and_apply + 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, _08034EF8 + 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 + .align 2, 0 +_08034EF8: .4byte 0x02022e10 + 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, _0803502C + 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, _08035030 + adds r3, r0, r1 + ldrh r1, [r4, 0xE] + adds r0, r3, 0 + adds r0, 0x38 + strb r1, [r0] + ldr r2, _08035034 + adds r0, r2, 0 + adds r1, r7, 0 + ands r1, r0 + ldrh r2, [r3, 0x3A] + ldr r0, _08035038 + 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, _0803503C + ands r1, r0 + ldrh r2, [r3, 0x3C] + ldr r0, _08035040 + 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, _08035030 + lsls r3, r5, 3 + adds r3, r0 + movs r2, 0xC + ldrsh r1, [r4, r2] + ldrb r0, [r4, 0x8] + subs r1, r0 + ldr r2, _08035034 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x3A] + ldr r0, _08035038 + 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, _0803503C + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x3C] + ldr r0, _08035040 + 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 + .align 2, 0 +_0803502C: .4byte 0x030022f8 +_08035030: .4byte 0x030022c0 +_08035034: .4byte 0x000001ff +_08035038: .4byte 0xfffffe00 +_0803503C: .4byte 0x000003ff +_08035040: .4byte 0xfffffc00 + 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, _08035074 + 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 + .align 2, 0 +_08035074: .4byte 0x02022e10 +_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, _08035134 + 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, _08035138 + adds r0, r2, 0 + ands r1, r0 + ldrh r0, [r6] + ldr r2, _0803513C + 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 + .align 2, 0 +_08035134: .4byte 0x030022c0 +_08035138: .4byte 0x000003ff +_0803513C: .4byte 0xfffffc00 +_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, _0803520C + ldrb r0, [r6, 0x1] + str r0, [r3] + ldr r2, _08035210 + movs r0, 0 + str r0, [r2] + ldr r1, _08035214 + subs r0, 0x1 + str r0, [r1] + adds r7, r3, 0 + mov r10, r1 + ldr r0, _08035218 + 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, _0803521C + adds r0, r1, 0 + ands r3, r0 + ldrh r0, [r2, 0x3C] + ldr r4, _08035220 + 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, _08035210 + ldr r0, [r4] + str r0, [r2] + b _0803523A + .align 2, 0 +_0803520C: .4byte 0x03000dd4 +_08035210: .4byte 0x03000dd8 +_08035214: .4byte 0x03000ddc +_08035218: .4byte 0x030022c0 +_0803521C: .4byte 0x000003ff +_08035220: .4byte 0xfffffc00 +_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, _0803528C + 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, _08035290 + adds r0, r1, 0 + ands r2, r0 + ldrh r1, [r3, 0x3A] + ldr r0, _08035294 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x3A] + b _080352AE + .align 2, 0 +_0803528C: .4byte 0x03000dd8 +_08035290: .4byte 0x000001ff +_08035294: .4byte 0xfffffe00 +_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, _080353A4 + 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, _080353A8 + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r6] + ldr r4, _080353AC + 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, _080353A4 + 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, _080353A4 + adds r0, r2 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _080353C6 + .align 2, 0 +_080353A4: .4byte 0x030022c0 +_080353A8: .4byte 0x000003ff +_080353AC: .4byte 0xfffffc00 +_080353B0: + lsls r2, r3, 3 + ldr r4, _080353D8 + 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 + .align 2, 0 +_080353D8: .4byte 0x030022c0 + thumb_func_end sub_80352C0 + + thumb_func_start sub_80353DC +sub_80353DC: @ 80353DC + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, _08035474 + 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, _08035478 + 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, _08035474 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x10] + bl gpu_tile_obj_free_by_tag +_08035442: + adds r0, r4, 0 + bl sub_80355B4 + cmp r0, 0 + bne _0803545E + ldr r0, _08035474 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x12] + bl gpu_pal_free_tag +_0803545E: + ldr r0, _08035474 + 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 + .align 2, 0 +_08035474: .4byte 0x02022e10 +_08035478: .4byte 0x030022c0 + 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, _080354D0 + 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, _080354D4 + 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 + .align 2, 0 +_080354D0: .4byte 0x02022e10 +_080354D4: .4byte 0x030022c0 +_080354D8: + cmp r1, 0 + beq _080354FA + ldr r1, _08035514 + 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 + .align 2, 0 +_08035514: .4byte 0x030022c0 + 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, _08035544 + 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 + .align 2, 0 +_08035544: .4byte 0x02022e10 +_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, _080355A0 + 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 + .align 2, 0 +_080355A0: .4byte 0x02022e10 +_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, _080355E4 + 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 + .align 2, 0 +_080355E4: .4byte 0x02022e10 +_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, _08035604 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .align 2, 0 +_08035604: .4byte 0x082ff1c8 + thumb_func_end sub_80355F8 + + thumb_func_start sub_8035608 +sub_8035608: @ 8035608 + push {lr} + bl reset_all_obj_data + ldr r0, _0803563C + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08035640 + 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, _08035644 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0803563C: .4byte 0x0831ac88 +_08035640: .4byte 0x02020630 +_08035644: .4byte sub_8035648 + 1 + thumb_func_end sub_8035608 + + thumb_func_start sub_8035648 +sub_8035648: @ 8035648 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + pop {r0} + bx r0 + thumb_func_end sub_8035648 + + thumb_func_start trs_config +trs_config: @ 8035658 + push {r4,lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08035694 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _08035698 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + beq _080356A4 + ldr r0, _0803569C + adds r0, 0x24 + movs r1, 0x1 + strb r1, [r0] + ldr r4, _080356A0 + ldr r1, [r4] + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + movs r0, 0x2 + bl bg_set_tilemap + b _080356AA + .align 2, 0 +_08035694: .4byte 0x0831aa08 +_08035698: .4byte 0x02022fec +_0803569C: .4byte 0x02024474 +_080356A0: .4byte 0x02023060 +_080356A4: + ldr r0, _080356C8 + adds r0, 0x24 + strb r1, [r0] +_080356AA: + ldr r1, _080356CC + ldr r0, _080356C8 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080356C8: .4byte 0x02024474 +_080356CC: .4byte 0x0831aba0 + 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 disable_irqs + movs r0, 0xC5 + bl enable_irqs + bl trs_config + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _08035708 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08035708: .4byte 0x0000b040 + 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, _08035760 + movs r1, 0x50 + movs r2, 0x20 + bl decompress_palette + ldr r0, _08035764 + 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, _08035768 + adds r0, 0xEC + movs r1, 0 + strh r1, [r0] + ldr r1, _0803576C + movs r2, 0x1 + bl CpuSet +_0803575A: + pop {r0} + bx r0 + .align 2, 0 +_08035760: .4byte 0x08d85600 +_08035764: .4byte 0x02022fec +_08035768: .4byte 0x02037714 +_0803576C: .4byte 0x02037c00 + thumb_func_end sub_803570C + + thumb_func_start sub_8035770 +sub_8035770: @ 8035770 + push {r4,r5,lr} + ldr r0, _08035794 + ldr r1, [r0] + ldr r0, _08035798 + ands r0, r1 + cmp r0, 0 + beq _080357B0 + ldr r0, _0803579C + ldr r1, _080357A0 + bl call_LZZUnCompVram + ldr r0, _080357A4 + ldr r1, _080357A8 + bl call_LZZUnCompVram + ldr r0, _080357AC + b _08035A52 + .align 2, 0 +_08035794: .4byte 0x02022fec +_08035798: .4byte 0x023f0902 +_0803579C: .4byte 0x08d7c440 +_080357A0: .4byte 0x06008000 +_080357A4: .4byte 0x08d7ca28 +_080357A8: .4byte 0x0600d000 +_080357AC: .4byte 0x08d7c9ec +_080357B0: + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _080357E4 + ldr r0, _080357D0 + ldr r1, _080357D4 + bl call_LZZUnCompVram + ldr r0, _080357D8 + ldr r1, _080357DC + bl call_LZZUnCompVram + ldr r0, _080357E0 + b _08035A52 + .align 2, 0 +_080357D0: .4byte 0x08d7bb14 +_080357D4: .4byte 0x06008000 +_080357D8: .4byte 0x08d7c154 +_080357DC: .4byte 0x0600d000 +_080357E0: .4byte 0x08d7df30 +_080357E4: + movs r0, 0x80 + lsls r0, 22 + ands r0, r1 + cmp r0, 0 + beq _08035818 + ldr r0, _08035804 + ldr r1, _08035808 + bl call_LZZUnCompVram + ldr r0, _0803580C + ldr r1, _08035810 + bl call_LZZUnCompVram + ldr r0, _08035814 + b _08035A52 + .align 2, 0 +_08035804: .4byte 0x08d7a108 +_08035808: .4byte 0x06008000 +_0803580C: .4byte 0x08d7a720 +_08035810: .4byte 0x0600d000 +_08035814: .4byte 0x08d7def4 +_08035818: + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + beq _0803584C + ldr r0, _08035838 + ldr r1, _0803583C + bl call_LZZUnCompVram + ldr r0, _08035840 + ldr r1, _08035844 + bl call_LZZUnCompVram + ldr r0, _08035848 + b _08035A52 + .align 2, 0 +_08035838: .4byte 0x08d7d590 +_0803583C: .4byte 0x06008000 +_08035840: .4byte 0x08d7dc04 +_08035844: .4byte 0x0600d000 +_08035848: .4byte 0x08d7e234 +_0803584C: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080358C4 + ldr r2, _0803587C + ldr r0, _08035880 + 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, _08035884 + ldr r1, _08035888 + bl call_LZZUnCompVram + ldr r0, _0803588C + ldr r1, _08035890 + bl call_LZZUnCompVram + ldr r0, _08035894 + b _08035A52 + .align 2, 0 +_0803587C: .4byte 0x08310030 +_08035880: .4byte 0x02038bca +_08035884: .4byte 0x08d7c440 +_08035888: .4byte 0x06008000 +_0803588C: .4byte 0x08d7ca28 +_08035890: .4byte 0x0600d000 +_08035894: .4byte 0x08d7dfc4 +_08035898: + cmp r0, 0x26 + bne _080358C4 + ldr r0, _080358B0 + ldr r1, _080358B4 + bl call_LZZUnCompVram + ldr r0, _080358B8 + ldr r1, _080358BC + bl call_LZZUnCompVram + ldr r0, _080358C0 + b _08035A52 + .align 2, 0 +_080358B0: .4byte 0x08d7ccd8 +_080358B4: .4byte 0x06008000 +_080358B8: .4byte 0x08d7d2e0 +_080358BC: .4byte 0x0600d000 +_080358C0: .4byte 0x08d7e1f8 +_080358C4: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _08035904 + lsls r0, 2 + ldr r1, _080358DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080358DC: .4byte _080358E0 + .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, _08035940 + ldr r5, _08035944 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldr r1, _08035948 + bl call_LZZUnCompVram + 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, _0803594C + bl call_LZZUnCompVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, 0x10 + adds r0, r4 + ldr r0, [r0] + b _08035A52 + .align 2, 0 +_08035940: .4byte 0x0831aba8 +_08035944: .4byte 0x02022ff0 +_08035948: .4byte 0x06008000 +_0803594C: .4byte 0x0600d000 +_08035950: + ldr r0, _08035964 + ldr r1, _08035968 + bl call_LZZUnCompVram + ldr r0, _0803596C + ldr r1, _08035970 + bl call_LZZUnCompVram + ldr r0, _08035974 + b _08035A52 + .align 2, 0 +_08035964: .4byte 0x08d7c440 +_08035968: .4byte 0x06008000 +_0803596C: .4byte 0x08d7ca28 +_08035970: .4byte 0x0600d000 +_08035974: .4byte 0x08d7df88 +_08035978: + ldr r0, _0803598C + ldr r1, _08035990 + bl call_LZZUnCompVram + ldr r0, _08035994 + ldr r1, _08035998 + bl call_LZZUnCompVram + ldr r0, _0803599C + b _08035A52 + .align 2, 0 +_0803598C: .4byte 0x08d7ccd8 +_08035990: .4byte 0x06008000 +_08035994: .4byte 0x08d7d2e0 +_08035998: .4byte 0x0600d000 +_0803599C: .4byte 0x08d7e060 +_080359A0: + ldr r0, _080359B4 + ldr r1, _080359B8 + bl call_LZZUnCompVram + ldr r0, _080359BC + ldr r1, _080359C0 + bl call_LZZUnCompVram + ldr r0, _080359C4 + b _08035A52 + .align 2, 0 +_080359B4: .4byte 0x08d7ccd8 +_080359B8: .4byte 0x06008000 +_080359BC: .4byte 0x08d7d2e0 +_080359C0: .4byte 0x0600d000 +_080359C4: .4byte 0x08d7e000 +_080359C8: + ldr r0, _080359DC + ldr r1, _080359E0 + bl call_LZZUnCompVram + ldr r0, _080359E4 + ldr r1, _080359E8 + bl call_LZZUnCompVram + ldr r0, _080359EC + b _08035A52 + .align 2, 0 +_080359DC: .4byte 0x08d7ccd8 +_080359E0: .4byte 0x06008000 +_080359E4: .4byte 0x08d7d2e0 +_080359E8: .4byte 0x0600d000 +_080359EC: .4byte 0x08d7e0cc +_080359F0: + ldr r0, _08035A04 + ldr r1, _08035A08 + bl call_LZZUnCompVram + ldr r0, _08035A0C + ldr r1, _08035A10 + bl call_LZZUnCompVram + ldr r0, _08035A14 + b _08035A52 + .align 2, 0 +_08035A04: .4byte 0x08d7ccd8 +_08035A08: .4byte 0x06008000 +_08035A0C: .4byte 0x08d7d2e0 +_08035A10: .4byte 0x0600d000 +_08035A14: .4byte 0x08d7e11c +_08035A18: + ldr r0, _08035A2C + ldr r1, _08035A30 + bl call_LZZUnCompVram + ldr r0, _08035A34 + ldr r1, _08035A38 + bl call_LZZUnCompVram + ldr r0, _08035A3C + b _08035A52 + .align 2, 0 +_08035A2C: .4byte 0x08d7ccd8 +_08035A30: .4byte 0x06008000 +_08035A34: .4byte 0x08d7d2e0 +_08035A38: .4byte 0x0600d000 +_08035A3C: .4byte 0x08d7e164 +_08035A40: + ldr r0, _08035A5C + ldr r1, _08035A60 + bl call_LZZUnCompVram + ldr r0, _08035A64 + ldr r1, _08035A68 + bl call_LZZUnCompVram + ldr r0, _08035A6C +_08035A52: + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + b _08035A8A + .align 2, 0 +_08035A5C: .4byte 0x08d7ccd8 +_08035A60: .4byte 0x06008000 +_08035A64: .4byte 0x08d7d2e0 +_08035A68: .4byte 0x0600d000 +_08035A6C: .4byte 0x08d7e1a8 +_08035A70: + ldr r0, _08035A90 + ldr r1, _08035A94 + bl call_LZZUnCompVram + ldr r0, _08035A98 + ldr r1, _08035A9C + bl call_LZZUnCompVram + ldr r0, _08035AA0 + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette +_08035A8A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08035A90: .4byte 0x08d7c440 +_08035A94: .4byte 0x06008000 +_08035A98: .4byte 0x08d7ca28 +_08035A9C: .4byte 0x0600d000 +_08035AA0: .4byte 0x08d7c9ec + thumb_func_end sub_8035770 + + thumb_func_start sub_8035AA4 +sub_8035AA4: @ 8035AA4 + push {lr} + ldr r0, _08035AD8 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + ldr r1, _08035ADC + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _08035AE0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + bl sub_803570C + bl sub_8035770 + pop {r0} + bx r0 + .align 2, 0 +_08035AD8: .4byte 0x08c00000 +_08035ADC: .4byte 0x08c00524 +_08035AE0: .4byte 0x08c004e0 + 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, _08035B3C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035BCC + ldr r0, _08035B40 + 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 + .align 2, 0 +_08035B3C: .4byte 0x02022fec +_08035B40: .4byte 0x03005e00 +_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, _08035BC8 + 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 bg_copy_tilemap_rect_simple + mov r0, r8 + bl gpu_copy_wram_bg_tilemap_to_vram + b _08035C36 + .align 2, 0 +_08035BC8: .4byte 0x00006001 +_08035BCC: + ldr r0, _08035BE4 + adds r0, 0x25 + ldrb r0, [r0] + cmp r5, r0 + bne _08035BEC + ldr r1, _08035BE8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0xE] + b _08035BF8 + .align 2, 0 +_08035BE4: .4byte 0x02024474 +_08035BE8: .4byte 0x03005e00 +_08035BEC: + ldr r1, _08035C44 + 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, _08035C48 + 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 bg_copy_tilemap_rect_simple + mov r0, r8 + bl gpu_copy_wram_bg_tilemap_to_vram +_08035C36: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08035C44: .4byte 0x03005e00 +_08035C48: .4byte 0x00006001 + thumb_func_end sub_8035AE4 + + thumb_func_start sub_8035C4C +sub_8035C4C: @ 8035C4C + push {lr} + ldr r0, _08035C60 + ldrb r2, [r0] + cmp r2, 0x3 + bne _08035C68 + ldr r0, _08035C64 + movs r1, 0x15 + bl battle_show_message_maybe + b _08035D68 + .align 2, 0 +_08035C60: .4byte 0x0202433a +_08035C64: .4byte 0x085ccbad +_08035C68: + ldr r0, _08035C98 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035CE2 + cmp r2, 0x1 + bne _08035CAE + ldr r2, _08035C9C + ldr r0, _08035CA0 + 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 + .align 2, 0 +_08035C98: .4byte 0x02022fec +_08035C9C: .4byte 0x020229e8 +_08035CA0: .4byte 0x02024474 +_08035CA4: + cmp r0, 0x2 + beq _08035D36 + cmp r0, 0x3 + bne _08035D68 + b _08035CFC +_08035CAE: + ldr r2, _08035CD0 + ldr r0, _08035CD4 + 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 + .align 2, 0 +_08035CD0: .4byte 0x020229e8 +_08035CD4: .4byte 0x02024474 +_08035CD8: + cmp r0, 0x2 + beq _08035CFC + cmp r0, 0x3 + bne _08035D68 + b _08035D36 +_08035CE2: + cmp r2, 0x1 + bne _08035D20 + ldr r2, _08035D10 + ldr r0, _08035D14 + 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, _08035D18 + movs r1, 0x17 + bl battle_show_message_maybe + ldr r0, _08035D1C + movs r1, 0x16 + bl battle_show_message_maybe + b _08035D68 + .align 2, 0 +_08035D10: .4byte 0x020229e8 +_08035D14: .4byte 0x02024474 +_08035D18: .4byte 0x085ccb9e +_08035D1C: .4byte 0x085ccba5 +_08035D20: + ldr r2, _08035D48 + ldr r0, _08035D4C + 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, _08035D50 + movs r1, 0x16 + bl battle_show_message_maybe + ldr r0, _08035D54 + movs r1, 0x17 + bl battle_show_message_maybe + b _08035D68 + .align 2, 0 +_08035D48: .4byte 0x020229e8 +_08035D4C: .4byte 0x02024474 +_08035D50: .4byte 0x085ccb9e +_08035D54: .4byte 0x085ccba5 +_08035D58: + ldr r0, _08035D6C + movs r1, 0x17 + bl battle_show_message_maybe + ldr r0, _08035D70 + movs r1, 0x16 + bl battle_show_message_maybe +_08035D68: + pop {r0} + bx r0 + .align 2, 0 +_08035D6C: .4byte 0x085ccb9e +_08035D70: .4byte 0x085ccba5 + 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, _08035DA0 + 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 + .align 2, 0 +_08035DA0: .4byte 0x03005e00 +_08035DA4: + cmp r0, 0x2 + bne _08035DAA + b _08035F64 +_08035DAA: + b _08036138 +_08035DAC: + ldr r0, _08035DD4 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035E44 + movs r5, 0 + movs r6, 0x3 +_08035DBC: + ldr r0, _08035DD8 + 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 + .align 2, 0 +_08035DD4: .4byte 0x02022fec +_08035DD8: .4byte 0x020229f0 +_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, _08035EB8 + adds r0, 0x25 + ldrb r5, [r0] + movs r0, 0x1 + adds r6, r5, 0 + eors r6, r0 + adds r1, r6, 0 + ldr r4, _08035EBC + 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, _08035EC0 + 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 + .align 2, 0 +_08035EB8: .4byte 0x02024474 +_08035EBC: .4byte 0x020229e8 +_08035EC0: .4byte 0x03005e00 +_08035EC4: + ldr r0, _08035F40 + bl gpu_pal_alloc_new + lsls r0, 24 + ldr r2, _08035F44 + lsrs r0, 19 + ldr r3, _08035F48 + adds r0, r3 + adds r2, r0, r2 + ldr r1, _08035F4C + adds r0, r1 + ldr r1, _08035F50 + strh r1, [r0] + strh r1, [r2] + ldr r0, _08035F54 + movs r1, 0x6F + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r4, _08035F58 + ldr r1, [r4] + adds r1, 0x7D + strb r0, [r1] + ldr r0, _08035F5C + movs r1, 0x81 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r4] + adds r1, 0x7E + strb r0, [r1] + ldr r3, _08035F60 + 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 + .align 2, 0 +_08035F40: .4byte 0x00002710 +_08035F44: .4byte 0x02037714 +_08035F48: .4byte 0x0000021e +_08035F4C: .4byte 0x02037b14 +_08035F50: .4byte 0x00007fff +_08035F54: .4byte 0x0831a9d0 +_08035F58: .4byte 0x0202449c +_08035F5C: .4byte 0x0831a9e8 +_08035F60: .4byte 0x02020630 +_08035F64: + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08035FCC + ldr r4, _08035FB8 + 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, _08035FBC + 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, _08035FC0 + ldr r2, _08035FC4 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _08035FC8 + strh r1, [r0] + b _08036038 + .align 2, 0 +_08035FB8: .4byte 0x02022e18 +_08035FBC: .4byte 0x02022e1c +_08035FC0: .4byte 0x02022e1a +_08035FC4: .4byte 0x0000ffdc +_08035FC8: .4byte 0x02022e1e +_08035FCC: + ldr r4, _0803605C + 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, _08036060 + 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, _08036064 + 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, _08036068 + 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, _0803606C + 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 + .align 2, 0 +_0803605C: .4byte 0x02022e18 +_08036060: .4byte 0x02022e1a +_08036064: .4byte 0x02022e1c +_08036068: .4byte 0x02022e1e +_0803606C: .4byte 0x03005e00 +_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, _08036144 + ldr r5, _08036148 + 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, _0803614C + adds r0, r7, 0 + ands r1, r0 + ldr r0, _08036150 + 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 + .align 2, 0 +_08036144: .4byte 0x02020630 +_08036148: .4byte 0x0202449c +_0803614C: .4byte 0x000003ff +_08036150: .4byte 0xfffffc00 + thumb_func_end task00_0800F6FC + + thumb_func_start sub_8036154 +sub_8036154: @ 8036154 + push {r4,r5,lr} + ldr r0, _080361D8 + ldr r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08036208 + ldr r0, _080361DC + ldr r1, _080361E0 + bl call_LZZUnCompVram + ldr r0, _080361E4 + ldr r1, _080361E8 + bl call_LZZUnCompVram + ldr r0, _080361EC + movs r1, 0x60 + movs r2, 0x20 + bl decompress_palette + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl gpu_bg_config_set_field + ldr r1, _080361F0 + movs r0, 0xA + bl lcd_io_set + ldr r4, _080361F4 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x48 + movs r1, 0x36 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x36 + bl lcd_io_set + ldr r0, _080361F8 + ldr r2, _080361FC + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _08036200 + strh r1, [r0] + ldr r0, _08036204 + bl gpu_tile_obj_decompress_and_load3 + b _080363AC + .align 2, 0 +_080361D8: .4byte 0x02022fec +_080361DC: .4byte 0x08d778f0 +_080361E0: .4byte 0x06004000 +_080361E4: .4byte 0x08d77b0c +_080361E8: .4byte 0x06010000 +_080361EC: .4byte 0x08d77ae4 +_080361F0: .4byte 0x00005c04 +_080361F4: .4byte 0x08d779d8 +_080361F8: .4byte 0x02022e1a +_080361FC: .4byte 0x0000ff5c +_08036200: .4byte 0x02022e1e +_08036204: .4byte 0x0831aa00 +_08036208: + ldr r0, _08036230 + ands r0, r1 + cmp r0, 0 + beq _0803628C + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _08036224 + ldr r0, _08036234 + ldrh r1, [r0] + ldr r0, _08036238 + cmp r1, r0 + bne _08036248 +_08036224: + ldr r0, _0803623C + ldr r1, _08036240 + bl call_LZZUnCompVram + ldr r0, _08036244 + b _08036382 + .align 2, 0 +_08036230: .4byte 0x023f0902 +_08036234: .4byte 0x02038bce +_08036238: .4byte 0x00000c03 +_0803623C: .4byte 0x08d820d4 +_08036240: .4byte 0x06004000 +_08036244: .4byte 0x08d824e4 +_08036248: + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x2 + bl gpu_bg_config_set_field + ldr r1, _08036284 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _08036288 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080363AC + .align 2, 0 +_08036284: .4byte 0x08d857a8 +_08036288: .4byte 0x08d85a1c +_0803628C: + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _080362B0 + ldr r0, _080362A4 + ldr r1, _080362A8 + bl call_LZZUnCompVram + ldr r0, _080362AC + b _08036382 + .align 2, 0 +_080362A4: .4byte 0x08d81610 +_080362A8: .4byte 0x06004000 +_080362AC: .4byte 0x08d81e2c +_080362B0: + movs r0, 0x80 + lsls r0, 22 + ands r0, r1 + cmp r0, 0 + beq _080362D4 + ldr r0, _080362C8 + ldr r1, _080362CC + bl call_LZZUnCompVram + ldr r0, _080362D0 + b _08036382 + .align 2, 0 +_080362C8: .4byte 0x08d7f9f8 +_080362CC: .4byte 0x06004000 +_080362D0: .4byte 0x08d7fec4 +_080362D4: + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + beq _080362F8 + ldr r0, _080362EC + ldr r1, _080362F0 + bl call_LZZUnCompVram + ldr r0, _080362F4 + b _08036382 + .align 2, 0 +_080362EC: .4byte 0x08d82608 +_080362F0: .4byte 0x06004000 +_080362F4: .4byte 0x08d82c70 +_080362F8: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08036350 + ldr r2, _08036320 + ldr r0, _08036324 + 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, _08036328 + ldr r1, _0803632C + bl call_LZZUnCompVram + ldr r0, _08036330 + b _08036382 + .align 2, 0 +_08036320: .4byte 0x08310030 +_08036324: .4byte 0x02038bca +_08036328: .4byte 0x08d820d4 +_0803632C: .4byte 0x06004000 +_08036330: .4byte 0x08d824e4 +_08036334: + cmp r0, 0x26 + bne _08036350 + ldr r0, _08036344 + ldr r1, _08036348 + bl call_LZZUnCompVram + ldr r0, _0803634C + b _08036382 + .align 2, 0 +_08036344: .4byte 0x08d820d4 +_08036348: .4byte 0x06004000 +_0803634C: .4byte 0x08d824e4 +_08036350: + bl sav1_map_get_battletype + lsls r0, 24 + cmp r0, 0 + bne _0803639C + ldr r4, _0803638C + ldr r5, _08036390 + 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, _08036394 + bl call_LZZUnCompVram + 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, _08036398 + bl call_LZZUnCompVram + b _080363AC + .align 2, 0 +_0803638C: .4byte 0x0831aba8 +_08036390: .4byte 0x02022ff0 +_08036394: .4byte 0x06004000 +_08036398: .4byte 0x0600e000 +_0803639C: + ldr r0, _080363B4 + ldr r1, _080363B8 + bl call_LZZUnCompVram + ldr r0, _080363BC + ldr r1, _080363C0 + bl call_LZZUnCompVram +_080363AC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080363B4: .4byte 0x08d820d4 +_080363B8: .4byte 0x06004000 +_080363BC: .4byte 0x08d824e4 +_080363C0: .4byte 0x0600e000 + 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, _080363DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080363DC: .4byte _080363E0 + .align 2, 0 +_080363E0: + .4byte _080363FC + .4byte _0803640C + .4byte _08036424 + .4byte _08036434 + .4byte _0803652C + .4byte _08036638 + .4byte _08036750 +_080363FC: + ldr r0, _08036408 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + b _08036758 + .align 2, 0 +_08036408: .4byte 0x08c00000 +_0803640C: + ldr r1, _08036420 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + b _08036758 + .align 2, 0 +_08036420: .4byte 0x08c00524 +_08036424: + ldr r0, _08036430 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _08036758 + .align 2, 0 +_08036430: .4byte 0x08c004e0 +_08036434: + ldr r0, _08036450 + ldr r1, [r0] + ldr r0, _08036454 + ands r0, r1 + cmp r0, 0 + bne _08036518 + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _0803645C + ldr r0, _08036458 + b _0803651A + .align 2, 0 +_08036450: .4byte 0x02022fec +_08036454: .4byte 0x023f0902 +_08036458: .4byte 0x08d7bb14 +_0803645C: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _0803648C + ldr r2, _08036480 + ldr r0, _08036484 + 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, _08036488 + b _0803651A + .align 2, 0 +_08036480: .4byte 0x08310030 +_08036484: .4byte 0x02038bca +_08036488: .4byte 0x08d7ccd8 +_0803648C: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080364CC + lsls r0, 2 + ldr r1, _080364A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080364A4: .4byte _080364A8 + .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, _080364E0 + ldr r0, _080364E4 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + b _0803651A + .align 2, 0 +_080364E0: .4byte 0x0831aba8 +_080364E4: .4byte 0x02022ff0 +_080364E8: + ldr r0, _080364EC + b _0803651A + .align 2, 0 +_080364EC: .4byte 0x08d7ccd8 +_080364F0: + ldr r0, _080364F4 + b _0803651A + .align 2, 0 +_080364F4: .4byte 0x08d7ccd8 +_080364F8: + ldr r0, _080364FC + b _0803651A + .align 2, 0 +_080364FC: .4byte 0x08d7ccd8 +_08036500: + ldr r0, _08036504 + b _0803651A + .align 2, 0 +_08036504: .4byte 0x08d7ccd8 +_08036508: + ldr r0, _0803650C + b _0803651A + .align 2, 0 +_0803650C: .4byte 0x08d7ccd8 +_08036510: + ldr r0, _08036514 + b _0803651A + .align 2, 0 +_08036514: .4byte 0x08d7ccd8 +_08036518: + ldr r0, _08036524 +_0803651A: + ldr r1, _08036528 + bl call_LZZUnCompVram + b _08036758 + .align 2, 0 +_08036524: .4byte 0x08d7c440 +_08036528: .4byte 0x06008000 +_0803652C: + ldr r0, _08036550 + ldr r1, [r0] + ldr r0, _08036554 + 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, _08036558 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08036560 + ldr r0, _0803655C + b _08036626 + .align 2, 0 +_08036550: .4byte 0x02022fec +_08036554: .4byte 0x023f0902 +_08036558: .4byte 0x082e9530 +_0803655C: .4byte 0x08d7c154 +_08036560: + ldr r0, _08036564 + b _08036626 + .align 2, 0 +_08036564: .4byte 0x08d7a720 +_08036568: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08036598 + ldr r2, _0803658C + ldr r0, _08036590 + 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, _08036594 + b _08036626 + .align 2, 0 +_0803658C: .4byte 0x08310030 +_08036590: .4byte 0x02038bca +_08036594: .4byte 0x08d7d2e0 +_08036598: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080365D8 + lsls r0, 2 + ldr r1, _080365B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080365B0: .4byte _080365B4 + .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, _080365EC + ldr r0, _080365F0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + b _08036626 + .align 2, 0 +_080365EC: .4byte 0x0831aba8 +_080365F0: .4byte 0x02022ff0 +_080365F4: + ldr r0, _080365F8 + b _08036626 + .align 2, 0 +_080365F8: .4byte 0x08d7d2e0 +_080365FC: + ldr r0, _08036600 + b _08036626 + .align 2, 0 +_08036600: .4byte 0x08d7d2e0 +_08036604: + ldr r0, _08036608 + b _08036626 + .align 2, 0 +_08036608: .4byte 0x08d7d2e0 +_0803660C: + ldr r0, _08036610 + b _08036626 + .align 2, 0 +_08036610: .4byte 0x08d7d2e0 +_08036614: + ldr r0, _08036618 + b _08036626 + .align 2, 0 +_08036618: .4byte 0x08d7d2e0 +_0803661C: + ldr r0, _08036620 + b _08036626 + .align 2, 0 +_08036620: .4byte 0x08d7d2e0 +_08036624: + ldr r0, _08036630 +_08036626: + ldr r1, _08036634 + bl call_LZZUnCompVram + b _08036758 + .align 2, 0 +_08036630: .4byte 0x08d7ca28 +_08036634: .4byte 0x0600d000 +_08036638: + ldr r0, _0803665C + ldr r1, [r0] + ldr r0, _08036660 + 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, _08036664 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803666C + ldr r0, _08036668 + b _08036742 + .align 2, 0 +_0803665C: .4byte 0x02022fec +_08036660: .4byte 0x023f0902 +_08036664: .4byte 0x082e9530 +_08036668: .4byte 0x08d7df30 +_0803666C: + ldr r0, _08036670 + b _08036742 + .align 2, 0 +_08036670: .4byte 0x08d7def4 +_08036674: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080366AC + ldr r2, _08036694 + ldr r0, _08036698 + 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, _0803669C + b _08036742 + .align 2, 0 +_08036694: .4byte 0x08310030 +_08036698: .4byte 0x02038bca +_0803669C: .4byte 0x08d7dfc4 +_080366A0: + cmp r0, 0x26 + bne _080366AC + ldr r0, _080366A8 + b _08036742 + .align 2, 0 +_080366A8: .4byte 0x08d7e1f8 +_080366AC: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080366EC + lsls r0, 2 + ldr r1, _080366C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080366C4: .4byte _080366C8 + .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, _08036700 + ldr r0, _08036704 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + adds r0, r2 + ldr r0, [r0] + b _08036742 + .align 2, 0 +_08036700: .4byte 0x0831aba8 +_08036704: .4byte 0x02022ff0 +_08036708: + ldr r0, _0803670C + b _08036742 + .align 2, 0 +_0803670C: .4byte 0x08d7df88 +_08036710: + ldr r0, _08036714 + b _08036742 + .align 2, 0 +_08036714: .4byte 0x08d7e060 +_08036718: + ldr r0, _0803671C + b _08036742 + .align 2, 0 +_0803671C: .4byte 0x08d7e000 +_08036720: + ldr r0, _08036724 + b _08036742 + .align 2, 0 +_08036724: .4byte 0x08d7e0cc +_08036728: + ldr r0, _0803672C + b _08036742 + .align 2, 0 +_0803672C: .4byte 0x08d7e11c +_08036730: + ldr r0, _08036734 + b _08036742 + .align 2, 0 +_08036734: .4byte 0x08d7e164 +_08036738: + ldr r0, _0803673C + b _08036742 + .align 2, 0 +_0803673C: .4byte 0x08d7e1a8 +_08036740: + ldr r0, _0803674C +_08036742: + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + b _08036758 + .align 2, 0 +_0803674C: .4byte 0x08d7c9ec +_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, _08036794 + 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 + .align 2, 0 +_08036794: .4byte 0x02022fec +_08036798: + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + bne _080367B4 + bl battle_wireless_setup_if_required_maybe + ldr r0, _080367B0 + bl set_callback2 + b _080367BA + .align 2, 0 +_080367B0: .4byte sub_8037ADC + 1 +_080367B4: + ldr r0, _080367C4 + bl set_callback2 +_080367BA: + ldr r1, _080367C8 + movs r0, 0 + strb r0, [r1] + b _080367D0 + .align 2, 0 +_080367C4: .4byte intro_end + 1 +_080367C8: .4byte 0x02024332 +_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, _0803684C + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + ldr r1, _08036850 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + ldr r0, _08036854 + movs r2, 0xF0 + strh r2, [r0] + ldr r0, _08036858 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08036870 + ldr r0, _0803685C + ldrh r1, [r0] + ldr r0, _08036860 + cmp r1, r0 + beq _08036870 + ldr r1, _08036864 + movs r0, 0x9F + strh r0, [r1] + ldr r0, _08036868 + strh r2, [r0] + ldr r1, _0803686C + movs r0, 0x20 + strh r0, [r1] + b _080368BE + .align 2, 0 +_0803684C: .4byte 0x05006000 +_08036850: .4byte 0x00005051 +_08036854: .4byte 0x02022e24 +_08036858: .4byte 0x02022fec +_0803685C: .4byte 0x02038bce +_08036860: .4byte 0x00000c03 +_08036864: .4byte 0x02022e26 +_08036868: .4byte 0x02022e28 +_0803686C: .4byte 0x02022e2a +_08036870: + ldr r0, _08036948 + ldr r2, _0803694C + adds r1, r2, 0 + strh r1, [r0] + bl dp12_8087EA4 + ldr r0, _08036950 + 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, _08036954 + ldr r0, _08036950 + ldr r3, _08036958 + 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, _0803695C + movs r1, 0 + strh r1, [r0] + ldr r0, _08036960 + strh r1, [r0] + ldr r0, _08036964 + strh r1, [r0] + ldr r0, _08036968 + strh r1, [r0] + ldr r0, _0803696C + strh r1, [r0] + ldr r0, _08036970 + strh r1, [r0] + ldr r0, _08036974 + strh r1, [r0] + ldr r0, _08036978 + strh r1, [r0] + bl sub_80B0BD0 + ldr r2, _0803697C + strb r0, [r2] + ldr r4, _08036980 + 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 reset_all_obj_data + bl clear_tasks + bl sub_8036154 + bl gpu_pal_allocator_reset + ldr r1, _08036984 + movs r0, 0x4 + strb r0, [r1] + ldr r0, _08036988 + 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, _0803698C + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _08036994 +_0803693E: + ldr r0, _08036990 + bl set_callback2 + b _080369AE + .align 2, 0 +_08036948: .4byte 0x02022e26 +_0803694C: .4byte 0x00005051 +_08036950: .4byte 0x02038c28 +_08036954: .4byte 0x0831ac70 +_08036958: .4byte 0x0000ff10 +_0803695C: .4byte 0x02022e14 +_08036960: .4byte 0x02022e16 +_08036964: .4byte 0x02022e18 +_08036968: .4byte 0x02022e1a +_0803696C: .4byte 0x02022e1c +_08036970: .4byte 0x02022e1e +_08036974: .4byte 0x02022e20 +_08036978: .4byte 0x02022e22 +_0803697C: .4byte 0x02022ff0 +_08036980: .4byte 0x02022fec +_08036984: .4byte 0x0300301c +_08036988: .4byte vblank_cb_08078BB4 + 1 +_0803698C: .4byte 0x00400040 +_08036990: .4byte sub_8037458 + 1 +_08036994: + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _080369A8 + ldr r0, _080369A4 + bl set_callback2 + b _080369AE + .align 2, 0 +_080369A4: .4byte sub_8037DF4 + 1 +_080369A8: + ldr r0, _08036A2C + bl set_callback2 +_080369AE: + ldr r5, _08036A30 + ldr r0, [r5] + ldr r1, _08036A34 + ands r0, r1 + cmp r0, 0 + bne _080369E8 + ldr r4, _08036A38 + ldr r0, _08036A3C + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80385E8 + 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, _08036A40 + ldrh r1, [r1] + movs r2, 0 + bl sub_80385E8 +_080369E4: + bl sub_806EA68 +_080369E8: + ldr r1, _08036A44 + ldr r2, _08036A48 + adds r1, r2 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r0, _08036A4C + ldr r1, [r0] + ldr r5, _08036A50 + adds r1, r5 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, _08036A54 + 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, _08036A58 + strb r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08036A2C: .4byte sub_8036FAC + 1 +_08036A30: .4byte 0x02022fec +_08036A34: .4byte 0x01000002 +_08036A38: .4byte 0x02024744 +_08036A3C: .4byte 0x02038bca +_08036A40: .4byte 0x02038bcc +_08036A44: .4byte 0x030022c0 +_08036A48: .4byte 0x00000439 +_08036A4C: .4byte 0x03005d90 +_08036A50: .4byte 0x00000ca9 +_08036A54: .4byte 0x020244ec +_08036A58: .4byte 0x02024332 + 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, _08036B34 + 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, _08036B38 + ldr r0, [r4] + movs r1, 0xC1 + lsls r1, 1 + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + ldr r5, _08036B3C + adds r0, r5 + lsrs r1, r6, 8 + strb r1, [r0] + ldr r0, _08036B40 + bl flag_check + 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 + .align 2, 0 +_08036B34: .4byte 0x020244ec +_08036B38: .4byte 0x0202449c +_08036B3C: .4byte 0x00000183 +_08036B40: .4byte 0x000008d2 + thumb_func_end sub_8036A5C + + thumb_func_start sub_8036B44 +sub_8036B44: @ 8036B44 + push {r4-r7,lr} + ldr r0, _08036BAC + 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, _08036BB0 + movs r1, 0xC6 + lsls r1, 1 + adds r5, r1 + adds r6, r7, 0 + ldr r3, _08036BB4 +_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, _08036BB0 + ldr r5, _08036BB8 +_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, _08036BBC + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4, 0x7] + ldr r0, [r7] + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _08036C00 + .align 2, 0 +_08036BAC: .4byte 0x0202449c +_08036BB0: .4byte 0x03005d8c +_08036BB4: .4byte 0x000031f8 +_08036BB8: .4byte 0x00003214 +_08036BBC: .4byte 0x00003226 +_08036BC0: + movs r0, 0xAF + bl berryid_from_itemid + lsls r0, 24 + lsrs r0, 24 + bl sub_80E167C + 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, _08036CC0 + 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, _08036CC4 + ldr r0, _08036CC8 + mov r8, r0 + adds r6, r3, 0 + mov r4, r8 + ldr r2, _08036CCC + 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, _08036CC8 + ldr r2, _08036CD0 + 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, _08036CD4 + 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, _08036CD8 + 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 + .align 2, 0 +_08036CC0: .4byte 0x02022fec +_08036CC4: .4byte 0x02024404 +_08036CC8: .4byte 0x03005d8c +_08036CCC: .4byte 0x000031f8 +_08036CD0: .4byte 0x00003214 +_08036CD4: .4byte 0x00003226 +_08036CD8: .4byte 0x00003227 +_08036CDC: + movs r0, 0xAF + bl berryid_from_itemid + lsls r0, 24 + lsrs r0, 24 + bl sub_80E167C + adds r6, r0, 0 + movs r5, 0 + ldr r4, _08036D48 + 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 + .align 2, 0 +_08036D48: .4byte 0x02024404 +_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, _08036DE4 + mov r12, r0 + ldr r3, _08036DE8 + adds r6, r3, 0 + movs r1, 0x8 + adds r1, r6 + mov r9, r1 +_08036D7C: + lsls r1, r5, 8 + ldr r0, _08036DEC + 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 + .align 2, 0 +_08036DE4: .4byte 0x020229e8 +_08036DE8: .4byte 0x02024404 +_08036DEC: .4byte 0x020223c8 +_08036DF0: + movs r5, 0 + ldr r4, _08036EB0 + mov r9, r4 +_08036DF6: + lsls r0, r5, 8 + ldr r1, _08036EB4 + 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, _08036EB0 + 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 + .align 2, 0 +_08036EB0: .4byte 0x02024404 +_08036EB4: .4byte 0x020223c8 + 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, _08036EE4 + ldrh r2, [r0] + movs r1, 0x80 + lsls r1, 1 + mov r12, r0 + cmp r2, r1 + bne _08036EFC + cmp r3, 0 + bne _08036EEC + ldr r0, _08036EE8 + ldr r1, [r0] + movs r2, 0xC + b _08036EF2 + .align 2, 0 +_08036EE4: .4byte 0x020223c4 +_08036EE8: .4byte 0x02022fec +_08036EEC: + ldr r0, _08036F30 + 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, _08036F34 + 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, _08036F30 + ldr r1, [r0] + movs r2, 0xC + b _08036F3E + .align 2, 0 +_08036F30: .4byte 0x02022fec +_08036F34: .4byte 0x020223c4 +_08036F38: + ldr r0, _08036F94 + 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, _08036F94 + 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 + .align 2, 0 +_08036F94: .4byte 0x02022fec +_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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08036FE4 + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r5, r6, 0 + eors r5, r0 + ldr r0, _08036FE8 + ldrb r0, [r0] + cmp r0, 0x12 + bls _08036FD8 + b _0803744C +_08036FD8: + lsls r0, 2 + ldr r1, _08036FEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08036FE4: .4byte 0x02024474 +_08036FE8: .4byte 0x02024332 +_08036FEC: .4byte _08036FF0 + .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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08037068 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + bl sub_805EF14 + ldr r1, _08037078 + movs r0, 0x1 + strb r0, [r1] +_08037068: + ldr r0, _0803707C + ldrb r0, [r0] + cmp r0, 0 + bne _08037072 + b _0803744C +_08037072: + bl sub_800E0E8 + b _0803744C + .align 2, 0 +_08037078: .4byte 0x02024332 +_0803707C: .4byte 0x030030fc +_08037080: + ldr r2, _08037104 + ldr r1, [r2] + movs r6, 0x2 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _08037124 + ldr r0, _08037108 + ldrb r0, [r0] + cmp r0, 0 + bne _08037098 + b _0803744C +_08037098: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080370EE + ldr r4, _0803710C + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, _08037110 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + ldr r0, _08037114 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _080370D8 + ldr r0, _08037118 + 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, _0803711C + strb r6, [r0] +_080370EE: + ldr r0, _08037120 + ldrb r0, [r0] + cmp r0, 0 + bne _080370F8 + b _0803744C +_080370F8: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _0803744C + .align 2, 0 +_08037104: .4byte 0x02022fec +_08037108: .4byte 0x03003124 +_0803710C: .4byte 0x0202449c +_08037110: .4byte 0x00000181 +_08037114: .4byte 0x02038bca +_08037118: .4byte 0x020229e8 +_0803711C: .4byte 0x02024332 +_08037120: .4byte 0x030030fc +_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, _08037140 + movs r0, 0xF + strb r0, [r1] + bl berry_801017C + b _0803744C + .align 2, 0 +_08037140: .4byte 0x02024332 +_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, _080371C4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080371C8 + 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, _080371CC + 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, _080371D0 + 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, _080371D4 + b _08037446 + .align 2, 0 +_080371C4: .4byte task00_0800F6FC + 1 +_080371C8: .4byte 0x03005e00 +_080371CC: .4byte 0x0202449c +_080371D0: .4byte 0x020223c4 +_080371D4: .4byte 0x02024332 +_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, _080371F8 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, _080371FC + b _08037446 + .align 2, 0 +_080371F8: .4byte 0x020244ec +_080371FC: .4byte 0x02024332 +_08037200: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803720E + b _0803744C +_0803720E: + bl sub_800A5B4 + ldr r0, _08037224 + lsls r1, r5, 8 + ldr r2, _08037228 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, _0803722C + b _08037446 + .align 2, 0 +_08037224: .4byte 0x02024744 +_08037228: .4byte 0x020223c4 +_0803722C: .4byte 0x02024332 +_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, _08037250 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, _08037254 + b _08037446 + .align 2, 0 +_08037250: .4byte 0x020245b4 +_08037254: .4byte 0x02024332 +_08037258: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037266 + b _0803744C +_08037266: + bl sub_800A5B4 + ldr r0, _0803727C + lsls r1, r5, 8 + ldr r2, _08037280 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, _08037284 + b _08037446 + .align 2, 0 +_0803727C: .4byte 0x0202480c +_08037280: .4byte 0x020223c4 +_08037284: .4byte 0x02024332 +_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, _080372A8 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, _080372AC + b _08037446 + .align 2, 0 +_080372A8: .4byte 0x0202467c +_080372AC: .4byte 0x02024332 +_080372B0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080372BE + b _0803744C +_080372BE: + bl sub_800A5B4 + ldr r4, _08037304 + lsls r1, r5, 8 + ldr r0, _08037308 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + ldr r1, _0803730C + adds r0, r4, r1 + bl shedinja_something + ldr r2, _08037310 + 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, _08037314 + b _08037446 + .align 2, 0 +_08037304: .4byte 0x020248d4 +_08037308: .4byte 0x020223c4 +_0803730C: .4byte 0xfffffe70 +_08037310: .4byte 0xfffffed4 +_08037314: .4byte 0x02024332 +_08037318: + bl sub_8032768 + bl sub_8184E58 + ldr r2, _08037360 + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, _08037364 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037372 + movs r3, 0 + ldr r1, _08037368 + 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 + .align 2, 0 +_08037360: .4byte 0x02024332 +_08037364: .4byte 0x02022fec +_08037368: .4byte 0x020229e8 +_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, _08037398 + movs r2, 0x4 + bl link_0800A448 + ldr r1, _0803739C + b _08037446 + .align 2, 0 +_08037398: .4byte 0x0203bd2c +_0803739C: .4byte 0x02024332 +_080373A0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _0803744C + bl sub_800A5B4 + ldr r0, _080373D0 + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080373CA + ldr r0, _080373D4 + lsls r1, r5, 8 + ldr r2, _080373D8 + adds r1, r2 + movs r2, 0x4 + bl memcpy +_080373CA: + ldr r1, _080373DC + b _08037446 + .align 2, 0 +_080373D0: .4byte 0x02022fec +_080373D4: .4byte 0x0203bd2c +_080373D8: .4byte 0x020223c4 +_080373DC: .4byte 0x02024332 +_080373E0: + ldr r0, _08037414 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _0803744C + ldr r2, _08037418 + ldr r1, _0803741C + ldr r0, [r1] + str r0, [r2] + ldr r0, _08037420 + str r0, [r1] + ldr r0, _08037424 + bl set_callback2 + ldr r2, _08037428 + 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 + .align 2, 0 +_08037414: .4byte 0x02024333 +_08037418: .4byte 0x03005d00 +_0803741C: .4byte 0x030022c0 +_08037420: .4byte sub_8039EF0 + 1 +_08037424: .4byte sub_8038420 + 1 +_08037428: .4byte 0x02022fec +_0803742C: + ldr r0, _08037454 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r1, 0x1 + strb r1, [r0, 0x1] +_08037438: + ldr r1, _08037454 + 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 + .align 2, 0 +_08037454: .4byte 0x02024332 + thumb_func_end sub_8036FAC + + thumb_func_start sub_8037458 +sub_8037458: @ 8037458 + push {r4-r7,lr} + sub sp, 0x4 + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08037490 + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r7, r6, 0 + eors r7, r0 + ldr r0, _08037494 + ldrb r0, [r0] + cmp r0, 0x10 + bls _08037486 + b _080379D6 +_08037486: + lsls r0, 2 + ldr r1, _08037498 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037490: .4byte 0x02024474 +_08037494: .4byte 0x02024332 +_08037498: .4byte _0803749C + .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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0803750C + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + bl sub_805EF14 + ldr r1, _080375D8 + movs r0, 0x1 + strb r0, [r1] +_0803750C: + ldr r0, _080375DC + ldrb r0, [r0] + cmp r0, 0 + beq _08037518 + bl sub_800E0E8 +_08037518: + ldr r2, _080375E0 + ldr r1, [r2] + movs r3, 0x2 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080375FC + ldr r0, _080375E4 + ldrb r0, [r0] + cmp r0, 0 + bne _08037530 + b _080379D6 +_08037530: + ldr r6, _080375E8 + 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, _080375EC + ldrh r1, [r4] + bl sub_8162E20 + adds r0, r6, 0 + adds r0, 0x5C + ldr r5, _080375F0 + 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, _080375F4 + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, _080375F8 + 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, _080375D8 + movs r0, 0x2 + strb r0, [r1] +_080375C4: + ldr r0, _080375DC + ldrb r0, [r0] + cmp r0, 0 + bne _080375CE + b _080379D6 +_080375CE: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080379D6 + .align 2, 0 +_080375D8: .4byte 0x02024332 +_080375DC: .4byte 0x030030fc +_080375E0: .4byte 0x02022fec +_080375E4: .4byte 0x03003124 +_080375E8: .4byte 0x020229e8 +_080375EC: .4byte 0x02038bca +_080375F0: .4byte 0x02038bcc +_080375F4: .4byte 0x0202449c +_080375F8: .4byte 0x00000181 +_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, _08037618 + movs r0, 0xD + strb r0, [r1] + bl berry_801017C + b _080379D6 + .align 2, 0 +_08037618: .4byte 0x02024332 +_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, _08037668 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0803766C + 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 + .align 2, 0 +_08037668: .4byte task00_0800F6FC + 1 +_0803766C: .4byte 0x03005e00 +_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, _08037690 +_08037686: + movs r2, 0xC8 + bl link_0800A448 + b _08037986 + .align 2, 0 +_08037690: .4byte 0x020244ec +_08037694: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080376A2 + b _080379D6 +_080376A2: + bl sub_800A5B4 + ldr r0, _080376DC + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _080376E8 + ldr r4, _080376E0 + lsls r1, r7, 8 + ldr r5, _080376E4 + 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 + .align 2, 0 +_080376DC: .4byte 0x020229e8 +_080376E0: .4byte 0x020244ec +_080376E4: .4byte 0x020223c4 +_080376E8: + ldr r4, _08037708 + lsls r1, r6, 8 + ldr r5, _0803770C + 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 + .align 2, 0 +_08037708: .4byte 0x020244ec +_0803770C: .4byte 0x020223c4 +_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, _08037730 + movs r2, 0x64 + bl link_0800A448 + b _08037986 + .align 2, 0 +_08037730: .4byte 0x020245b4 +_08037734: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037742 + b _080379D6 +_08037742: + bl sub_800A5B4 + ldr r0, _0803777C + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _08037788 + ldr r4, _08037780 + lsls r1, r7, 8 + ldr r5, _08037784 + 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 + .align 2, 0 +_0803777C: .4byte 0x020229e8 +_08037780: .4byte 0x020245b4 +_08037784: .4byte 0x020223c4 +_08037788: + ldr r4, _080377A8 + lsls r1, r6, 8 + ldr r5, _080377AC + 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 + .align 2, 0 +_080377A8: .4byte 0x020245b4 +_080377AC: .4byte 0x020223c4 +_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, _080377C8 + b _08037686 + .align 2, 0 +_080377C8: .4byte 0x02024744 +_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, _080377F4 + ldr r1, _080377F8 + movs r2, 0xC8 + b _08037982 + .align 2, 0 +_080377F4: .4byte 0x02024744 +_080377F8: .4byte 0x020223c4 +_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, _08037814 + b _08037686 + .align 2, 0 +_08037814: .4byte 0x0202480c +_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, _08037840 + ldr r1, _08037844 + movs r2, 0xC8 + b _08037982 + .align 2, 0 +_08037840: .4byte 0x0202480c +_08037844: .4byte 0x020223c4 +_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, _08037860 + b _08037686 + .align 2, 0 +_08037860: .4byte 0x020248d4 +_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, _080378F8 + ldr r1, _080378FC + movs r2, 0xC8 + bl memcpy +_0803788A: + ldr r4, _08037900 + 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, _08037904 + 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 + .align 2, 0 +_080378F8: .4byte 0x020248d4 +_080378FC: .4byte 0x020223c4 +_08037900: .4byte 0x020244ec +_08037904: .4byte 0x02024744 +_08037908: + bl sub_8032768 + bl sub_8184E58 + ldr r2, _0803792C + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, _08037930 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037934 + movs r0, 0xE + strb r0, [r2] + b _080379D6 + .align 2, 0 +_0803792C: .4byte 0x02024332 +_08037930: .4byte 0x02022fec +_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, _08037958 + movs r2, 0x4 + bl link_0800A448 + b _08037986 + .align 2, 0 +_08037958: .4byte 0x0203bd2c +_0803795C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _080379D6 + bl sub_800A5B4 + ldr r0, _08037990 + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08037986 + ldr r0, _08037994 + lsls r1, r7, 8 + ldr r2, _08037998 + adds r1, r2 + movs r2, 0x4 +_08037982: + bl memcpy +_08037986: + ldr r1, _0803799C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080379D6 + .align 2, 0 +_08037990: .4byte 0x02022fec +_08037994: .4byte 0x0203bd2c +_08037998: .4byte 0x020223c4 +_0803799C: .4byte 0x02024332 +_080379A0: + ldr r0, _080379E0 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl sub_8166188 + ldr r2, _080379E4 + ldr r1, _080379E8 + ldr r0, [r1] + str r0, [r2] + ldr r0, _080379EC + str r0, [r1] + ldr r0, _080379F0 + bl set_callback2 + ldr r2, _080379F4 + 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 + .align 2, 0 +_080379E0: .4byte 0x02024333 +_080379E4: .4byte 0x03005d00 +_080379E8: .4byte 0x030022c0 +_080379EC: .4byte sub_8039EF0 + 1 +_080379F0: .4byte sub_8038420 + 1 +_080379F4: .4byte 0x02022fec + 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, _08037AD0 + mov r10, r6 +_08037A12: + ldr r1, [sp] + add r1, r8 + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, _08037AD4 + 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 sub_8009370 + 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, _08037AD8 + 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 + .align 2, 0 +_08037AD0: .4byte 0x02022ff8 +_08037AD4: .4byte 0x020244ec +_08037AD8: .4byte 0x02023058 + 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, _08037B40 + 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, _08037B44 + adds r0, 0x25 + movs r2, 0 + mov r8, r2 + strb r7, [r0] + ldr r0, _08037B48 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB4 + str r1, [sp] + adds r0, 0xAC + mov r10, r0 + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + ldr r5, _08037B4C + ldrb r0, [r5] + cmp r0, 0x1 + beq _08037BA4 + cmp r0, 0x1 + bgt _08037B50 + cmp r0, 0 + beq _08037B5E + b _08037D0A + .align 2, 0 +_08037B40: .4byte 0x02022fec +_08037B44: .4byte 0x02024474 +_08037B48: .4byte 0x0202449c +_08037B4C: .4byte 0x02024332 +_08037B50: + cmp r0, 0x2 + bne _08037B56 + b _08037C64 +_08037B56: + cmp r0, 0x3 + bne _08037B5C + b _08037C9E +_08037B5C: + b _08037D0A +_08037B5E: + ldr r0, _08037B9C + 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, _08037BA0 + movs r0, 0x60 + bl malloc + 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 + .align 2, 0 +_08037B9C: .4byte 0x03003124 +_08037BA0: .4byte 0x02023058 +_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, _08037BF0 +_08037BC6: + cmp r5, r7 + beq _08037C1E + mov r2, r9 + cmp r2, 0x4 + bne _08037C14 + ldr r2, _08037BF4 + 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 + .align 2, 0 +_08037BF0: .4byte 0x020223c4 +_08037BF4: .4byte 0x020229e8 +_08037BF8: + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C1E +_08037C04: + ldr r0, _08037C10 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + b _08037C1E + .align 2, 0 +_08037C10: .4byte 0x02022ff8 +_08037C14: + ldr r0, _08037C50 + 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, _08037C54 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, _08037C58 + ldr r0, [r1, 0x8] + ldr r2, [sp] + str r0, [r2] + ldr r0, _08037C5C + ldr r0, [r0] + mov r2, r10 + str r0, [r2] + ldr r0, _08037C60 + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037D0A + .align 2, 0 +_08037C50: .4byte 0x02022ff8 +_08037C54: .4byte 0x02024332 +_08037C58: .4byte 0x030022c0 +_08037C5C: .4byte 0x02022fec +_08037C60: .4byte sub_8037ADC + 1 +_08037C64: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + ldr r0, _08037C90 + 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, _08037C94 + ldrb r0, [r0] + cmp r0, 0 + beq _08037C98 + bl sub_800ADF8 + b _08037D0A + .align 2, 0 +_08037C90: .4byte 0x02037fd4 +_08037C94: .4byte 0x030030fc +_08037C98: + bl sub_800AC34 + b _08037D0A +_08037C9E: + ldr r0, _08037CD4 + 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, _08037CD8 + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, _08037CDC + bl set_callback2 + ldr r4, _08037CE0 + ldr r0, [r4] + bl free + mov r0, r8 + str r0, [r4] + b _08037D0A + .align 2, 0 +_08037CD4: .4byte 0x030030fc +_08037CD8: .4byte 0x030022c0 +_08037CDC: .4byte sub_80367D4 + 1 +_08037CE0: .4byte 0x02023058 +_08037CE4: + ldr r0, _08037D1C + ldrb r5, [r0] + cmp r5, 0 + bne _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, _08037D20 + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, _08037D24 + bl set_callback2 + ldr r4, _08037D28 + 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 + .align 2, 0 +_08037D1C: .4byte 0x03003124 +_08037D20: .4byte 0x030022c0 +_08037D24: .4byte sub_80367D4 + 1 +_08037D28: .4byte 0x02023058 + thumb_func_end sub_8037ADC + + thumb_func_start intro_end +intro_end: @ 8037D2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _08037D5C + ldr r0, [r0] + movs r1, 0xB4 + adds r1, r0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xAC + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + ldr r5, _08037D60 + ldrb r0, [r5] + cmp r0, 0 + beq _08037D64 + cmp r0, 0x1 + beq _08037DA4 + b _08037DD6 + .align 2, 0 +_08037D5C: .4byte 0x0202449c +_08037D60: .4byte 0x02024332 +_08037D64: + ldr r4, _08037D94 + movs r0, 0x60 + bl malloc + str r0, [r4] + movs r0, 0x3 + bl sub_80379F8 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, _08037D98 + ldr r0, [r1, 0x8] + mov r2, r8 + str r0, [r2] + ldr r0, _08037D9C + ldr r0, [r0] + str r0, [r7] + ldr r0, _08037DA0 + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037DD6 + .align 2, 0 +_08037D94: .4byte 0x02023058 +_08037D98: .4byte 0x030022c0 +_08037D9C: .4byte 0x02022fec +_08037DA0: .4byte intro_end + 1 +_08037DA4: + ldr r0, _08037DE0 + 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, _08037DE4 + ldr r0, [r7] + str r0, [r1] + ldr r1, _08037DE8 + mov r2, r8 + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, _08037DEC + bl set_callback2 + ldr r4, _08037DF0 + ldr r0, [r4] + bl free + str r6, [r4] +_08037DD6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08037DE0: .4byte 0x02037fd4 +_08037DE4: .4byte 0x02022fec +_08037DE8: .4byte 0x030022c0 +_08037DEC: .4byte sub_80367D4 + 1 +_08037DF0: .4byte 0x02023058 + 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, _08037E2C + adds r0, 0x25 + strb r7, [r0] + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + ldr r0, _08037E30 + ldrb r0, [r0] + cmp r0, 0xA + bls _08037E20 + b _080383F8 +_08037E20: + lsls r0, 2 + ldr r1, _08037E34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037E2C: .4byte 0x02024474 +_08037E30: .4byte 0x02024332 +_08037E34: .4byte _08037E38 + .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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08037E90 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + bl sub_805EF14 + ldr r1, _08037EA0 + movs r0, 0x1 + strb r0, [r1] +_08037E90: + ldr r0, _08037EA4 + ldrb r0, [r0] + cmp r0, 0 + bne _08037E9A + b _080383F8 +_08037E9A: + bl sub_800E0E8 + b _080383F8 + .align 2, 0 +_08037EA0: .4byte 0x02024332 +_08037EA4: .4byte 0x030030fc +_08037EA8: + ldr r2, _08037F18 + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037F30 + ldr r0, _08037F1C + ldrb r0, [r0] + cmp r0, 0 + bne _08037EBE + b _080383F8 +_08037EBE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037F02 + ldr r4, _08037F20 + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, _08037F24 + 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, _08037F28 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08037F02: + ldr r0, _08037F2C + ldrb r0, [r0] + cmp r0, 0 + bne _08037F0C + b _080383F8 +_08037F0C: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080383F8 + .align 2, 0 +_08037F18: .4byte 0x02022fec +_08037F1C: .4byte 0x03003124 +_08037F20: .4byte 0x0202449c +_08037F24: .4byte 0x00000181 +_08037F28: .4byte 0x02024332 +_08037F2C: .4byte 0x030030fc +_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, _08037F4C + movs r0, 0x7 + strb r0, [r1] + bl berry_801017C + b _080383F8 + .align 2, 0 +_08037F4C: .4byte 0x02024332 +_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, _08037FC4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08037FC8 + 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, _08037FCC + 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, _08037FD0 + 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 + .align 2, 0 +_08037FC4: .4byte task00_0800F6FC + 1 +_08037FC8: .4byte 0x03005e00 +_08037FCC: .4byte 0x020223c4 +_08037FD0: .4byte 0x020229e8 +_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, _08038044 + 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, _08038048 + movs r2, 0xC8 + bl link_0800A448 + b _080383A6 + .align 2, 0 +_08038044: .4byte 0x02024332 +_08038048: .4byte 0x020244ec +_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, _08038084 + movs r5, 0 +_0803806C: + cmp r6, r7 + bne _080380A0 + ldr r0, _08038088 + 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 + .align 2, 0 +_08038084: .4byte 0x020223c4 +_08038088: .4byte 0x020229e8 +_0803808C: + cmp r0, 0x3 + bne _0803812A +_08038090: + ldr r0, _08038094 + b _08038110 + .align 2, 0 +_08038094: .4byte 0x020244ec +_08038098: + ldr r0, _0803809C + b _08038110 + .align 2, 0 +_0803809C: .4byte 0x02024618 +_080380A0: + ldr r2, _080380C0 + 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 + .align 2, 0 +_080380C0: .4byte 0x020229e8 +_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, _080380EC + b _08038110 + .align 2, 0 +_080380EC: .4byte 0x020244ec +_080380F0: + ldr r0, _080380F4 + b _08038110 + .align 2, 0 +_080380F4: .4byte 0x02024618 +_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, _0803811C +_08038110: + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy + b _0803812A + .align 2, 0 +_0803811C: .4byte 0x02024744 +_08038120: + ldr r0, _0803813C + 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 + .align 2, 0 +_0803813C: .4byte 0x02024870 +_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, _08038160 + movs r2, 0x64 + bl link_0800A448 + b _080383A6 + .align 2, 0 +_08038160: .4byte 0x020245b4 +_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, _0803819C + movs r5, 0 +_08038184: + cmp r6, r7 + bne _080381B8 + ldr r0, _080381A0 + 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 + .align 2, 0 +_0803819C: .4byte 0x020223c4 +_080381A0: .4byte 0x020229e8 +_080381A4: + cmp r0, 0x3 + bne _08038242 +_080381A8: + ldr r0, _080381AC + b _08038228 + .align 2, 0 +_080381AC: .4byte 0x020245b4 +_080381B0: + ldr r0, _080381B4 + b _08038228 + .align 2, 0 +_080381B4: .4byte 0x020246e0 +_080381B8: + ldr r2, _080381D8 + 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 + .align 2, 0 +_080381D8: .4byte 0x020229e8 +_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, _08038204 + b _08038228 + .align 2, 0 +_08038204: .4byte 0x020245b4 +_08038208: + ldr r0, _0803820C + b _08038228 + .align 2, 0 +_0803820C: .4byte 0x020246e0 +_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, _08038234 +_08038228: + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + b _08038242 + .align 2, 0 +_08038234: .4byte 0x0202480c +_08038238: + ldr r0, _080382C0 + 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, _080382C4 + 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, _080382C8 + 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 + .align 2, 0 +_080382C0: .4byte 0x02024938 +_080382C4: .4byte 0x020244ec +_080382C8: .4byte 0x02024744 +_080382CC: + bl sub_8032768 + bl sub_8184E58 + ldr r3, _08038314 + movs r0, 0 + strb r0, [r3, 0x1] + strb r0, [r3, 0x2] + ldr r0, _08038318 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038326 + movs r6, 0 + ldr r0, _0803831C + 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 + .align 2, 0 +_08038314: .4byte 0x02024332 +_08038318: .4byte 0x02022fec +_0803831C: .4byte 0x020229e8 +_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, _08038360 + ldr r4, [r0] + movs r0, 0xC0 + lsls r0, 1 + adds r4, r0 + ldr r0, _08038364 + ldr r0, [r0] + str r0, [r4] + ldr r0, _08038368 + 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 + .align 2, 0 +_08038360: .4byte 0x0202449c +_08038364: .4byte 0x02022fec +_08038368: .4byte 0x0203bd2c +_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, _080383B0 + 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, _080383B4 + movs r2, 0x4 + bl memcpy +_080383A6: + ldr r1, _080383B8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080383F8 + .align 2, 0 +_080383B0: .4byte 0x020223c4 +_080383B4: .4byte 0x0203bd2c +_080383B8: .4byte 0x02024332 +_080383BC: + ldr r0, _08038404 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r2, _08038408 + ldr r1, _0803840C + ldr r0, [r1] + str r0, [r2] + ldr r0, _08038410 + str r0, [r1] + ldr r0, _08038414 + bl set_callback2 + ldr r3, _08038418 + ldr r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080383F8 + ldr r0, _0803841C + 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 + .align 2, 0 +_08038404: .4byte 0x02024333 +_08038408: .4byte 0x03005d00 +_0803840C: .4byte 0x030022c0 +_08038410: .4byte sub_8039EF0 + 1 +_08038414: .4byte sub_8038420 + 1 +_08038418: .4byte 0x02022fec +_0803841C: .4byte 0x02038bca + thumb_func_end sub_8037DF4 + + thumb_func_start sub_8038420 +sub_8038420: @ 8038420 + push {lr} + sub sp, 0x4 + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + ldr r0, _08038488 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038482 + ldr r0, _0803848C + 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, _08038490 + ldr r1, _08038494 + 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 sub_80A1AD4 + ldr r0, _08038498 + bl set_callback2 +_08038482: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08038488: .4byte 0x030022c0 +_0803848C: .4byte 0x02022fec +_08038490: .4byte 0x020375f0 +_08038494: .4byte 0x0202433a +_08038498: .4byte sub_80384E4 + 1 + thumb_func_end sub_8038420 + + thumb_func_start sub_803849C +sub_803849C: @ 803849C + push {lr} + ldr r1, _080384D4 + ldr r0, _080384D8 + ldr r0, [r0] + str r0, [r1] + ldr r2, _080384DC + movs r0, 0x3 + strb r0, [r2, 0x15] + ldr r0, _080384E0 + 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 + .align 2, 0 +_080384D4: .4byte 0x030022c0 +_080384D8: .4byte 0x03005d00 +_080384DC: .4byte 0x02039b28 +_080384E0: .4byte 0x00000439 + thumb_func_end sub_803849C + + thumb_func_start sub_80384E4 +sub_80384E4: @ 80384E4 + push {lr} + bl fade_and_return_progress_probably + ldr r0, _08038518 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08038512 + ldr r0, _0803851C + bl MPlayStop_rev01 + ldr r0, _08038520 + bl MPlayStop_rev01 + bl sub_803849C + bl Window_FreeMemory + ldr r0, _08038524 + ldr r0, [r0, 0x8] + bl set_callback2 +_08038512: + pop {r0} + bx r0 + .align 2, 0 +_08038518: .4byte 0x02037fd4 +_0803851C: .4byte 0x030075f0 +_08038520: .4byte 0x03007630 +_08038524: .4byte 0x030022c0 + thumb_func_end sub_80384E4 + + thumb_func_start sub_8038528 +sub_8038528: @ 8038528 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r1, _08038534 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08038534: .4byte sub_8038538 + 1 + thumb_func_end sub_8038528 + + thumb_func_start sub_8038538 +sub_8038538: @ 8038538 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r5, _08038550 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0x1 + beq _0803856C + cmp r1, 0x1 + bgt _08038554 + cmp r1, 0 + beq _0803855A + b _080385DC + .align 2, 0 +_08038550: .4byte 0x0201c000 +_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, _080385C4 + 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 + .align 2, 0 +_080385C4: .4byte 0x00000281 +_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, _080385E4 + bl set_callback2 +_080385DC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080385E4: .4byte sub_8036760 + 1 + thumb_func_end sub_8038538 + + thumb_func_start sub_80385E8 +sub_80385E8: @ 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, _0803865C + ldr r0, [r4] + ldr r1, _08038660 + 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, _08038664 + 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 + .align 2, 0 +_0803865C: .4byte 0x02022fec +_08038660: .4byte 0x043f0908 +_08038664: .4byte 0x08310030 +_08038668: + ldr r1, _08038684 + 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 + .align 2, 0 +_08038684: .4byte 0x08310030 +_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, _08038790 + 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 + .align 2, 0 +_08038790: .4byte 0x083185c8 +_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, _0803884C + 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, _08038850 + adds r2, r0 + adds r0, r5, 0 + bl pokemon_setattr + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038820 + b _080389AC + .align 2, 0 +_0803884C: .4byte 0x083185c8 +_08038850: .4byte 0x0831c89c +_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, _080388E4 + 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 + .align 2, 0 +_080388E4: .4byte 0x083185c8 +_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, _080389F4 + 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, _080389F8 + 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, _080389FC + ldr r0, [sp, 0x18] +_080389B4: + ldr r1, [sp, 0x1C] + cmp r0, r1 + bge _080389BC + b _08038688 +_080389BC: + ldr r2, _08038A00 + ldr r1, _080389FC + 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, _080389FC + 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 + .align 2, 0 +_080389F4: .4byte 0x083185c8 +_080389F8: .4byte 0x0831c89c +_080389FC: .4byte 0x08310030 +_08038A00: .4byte 0x02022fec + thumb_func_end sub_80385E8 + + thumb_func_start sub_8038A04 +sub_8038A04: @ 8038A04 + push {lr} + ldr r0, _08038A24 + 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 lcd_io_set +_08038A1E: + pop {r0} + bx r0 + .align 2, 0 +_08038A24: .4byte 0x04000006 + thumb_func_end sub_8038A04 + + thumb_func_start vblank_cb_08078BB4 +vblank_cb_08078BB4: @ 8038A28 + push {lr} + ldr r0, _08038AC8 + ldr r0, [r0] + ldr r1, _08038ACC + ands r0, r1 + cmp r0, 0 + bne _08038A3A + bl GenerateRandomNumber +_08038A3A: + ldr r0, _08038AD0 + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _08038AD4 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _08038AD8 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _08038ADC + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, _08038AE0 + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + ldr r0, _08038AE4 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + ldr r0, _08038AE8 + ldrh r1, [r0] + movs r0, 0x1C + bl lcd_io_set + ldr r0, _08038AEC + ldrh r1, [r0] + movs r0, 0x1E + bl lcd_io_set + ldr r0, _08038AF0 + ldrh r1, [r0] + movs r0, 0x40 + bl lcd_io_set + ldr r0, _08038AF4 + ldrh r1, [r0] + movs r0, 0x44 + bl lcd_io_set + ldr r0, _08038AF8 + ldrh r1, [r0] + movs r0, 0x42 + bl lcd_io_set + ldr r0, _08038AFC + ldrh r1, [r0] + movs r0, 0x46 + bl lcd_io_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_08038AC8: .4byte 0x02022fec +_08038ACC: .4byte 0x013f0102 +_08038AD0: .4byte 0x02022e14 +_08038AD4: .4byte 0x02022e16 +_08038AD8: .4byte 0x02022e18 +_08038ADC: .4byte 0x02022e1a +_08038AE0: .4byte 0x02022e1c +_08038AE4: .4byte 0x02022e1e +_08038AE8: .4byte 0x02022e20 +_08038AEC: .4byte 0x02022e22 +_08038AF0: .4byte 0x02022e24 +_08038AF4: .4byte 0x02022e26 +_08038AF8: .4byte 0x02022e28 +_08038AFC: .4byte 0x02022e2a + 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, _08038B70 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl obj_delete_and_free_tiles +_08038B6A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08038B70: .4byte 0x00002710 + thumb_func_end sub_8038B04 + + thumb_func_start sub_8038B74 +sub_8038B74: @ 8038B74 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r0, _08038B90 + str r0, [r4, 0x1C] + movs r0, 0x68 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08038B90: .4byte sub_8038B04 + 1 + 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, _08038BDC + adds r0, 0x25 + ldrb r2, [r0] + ldr r0, _08038BE0 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08038C04 + ldr r1, _08038BE4 + 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 + .align 2, 0 +_08038BDC: .4byte 0x02024474 +_08038BE0: .4byte 0x02022fec +_08038BE4: .4byte 0x020229e8 +_08038BE8: + cmp r0, 0x2 + beq _08038C04 + cmp r0, 0x3 + bne _08038C0C +_08038BF0: + ldr r0, _08038BFC + str r0, [sp, 0x4] + ldr r1, _08038C00 + str r1, [sp, 0x8] + b _08038C0C + .align 2, 0 +_08038BFC: .4byte 0x02024744 +_08038C00: .4byte 0x020244ec +_08038C04: + ldr r2, _08038D58 + str r2, [sp, 0x4] + ldr r3, _08038D5C + 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, _08038D60 + 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, _08038D60 + 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 + .align 2, 0 +_08038D58: .4byte 0x020244ec +_08038D5C: .4byte 0x02024744 +_08038D60: .4byte 0x03005e00 + 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, _08038DA0 + ldr r1, [r0] + movs r2, 0x21 + negs r2, r2 + ands r1, r2 + str r1, [r0] + ldr r0, _08038DA4 + ands r0, r1 + cmp r0, 0 + beq _08038DAC + ldr r0, _08038DA8 + ldr r0, [r0, 0x8] + bl set_callback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _08038EB6 + .align 2, 0 +_08038DA0: .4byte 0x02022fec +_08038DA4: .4byte 0x003f0100 +_08038DA8: .4byte 0x030022c0 +_08038DAC: + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _08038EC0 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + ldr r4, _08038EC4 + movs r0, 0x44 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + ldr r1, _08038EC8 + movs r0, 0xF0 + strh r0, [r1] + ldr r0, _08038ECC + strh r4, [r0] + bl dp12_8087EA4 + ldr r0, _08038ED0 + 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, _08038ED0 + ldr r3, _08038ED4 + 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, _08038ED8 + movs r4, 0 + strh r4, [r0] + ldr r0, _08038EDC + strh r4, [r0] + ldr r0, _08038EE0 + strh r4, [r0] + ldr r0, _08038EE4 + strh r4, [r0] + ldr r0, _08038EE8 + strh r4, [r0] + ldr r0, _08038EEC + strh r4, [r0] + ldr r0, _08038EF0 + strh r4, [r0] + ldr r0, _08038EF4 + strh r4, [r0] + bl c2_berry_program_update_menu + ldr r0, _08038EF8 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + bl sub_803570C + bl reset_all_obj_data + bl clear_tasks + bl sub_8036154 + movs r0, 0x4A + movs r1, 0x37 + bl lcd_io_set + bl gpu_pal_allocator_reset + ldr r1, _08038EFC + movs r0, 0x4 + strb r0, [r1] + ldr r0, _08038F00 + bl SetVBlankCallback + ldr r0, _08038F04 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08038F08 + 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, _08038F0C + bl set_callback2 + ldr r0, _08038F10 + strb r4, [r0] +_08038EB6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08038EC0: .4byte 0x05006000 +_08038EC4: .4byte 0x00005051 +_08038EC8: .4byte 0x02022e24 +_08038ECC: .4byte 0x02022e26 +_08038ED0: .4byte 0x02038c28 +_08038ED4: .4byte 0x0000ff10 +_08038ED8: .4byte 0x02022e14 +_08038EDC: .4byte 0x02022e16 +_08038EE0: .4byte 0x02022e18 +_08038EE4: .4byte 0x02022e1a +_08038EE8: .4byte 0x02022e1c +_08038EEC: .4byte 0x02022e1e +_08038EF0: .4byte 0x02022e20 +_08038EF4: .4byte 0x02022e22 +_08038EF8: .4byte 0x08c004e0 +_08038EFC: .4byte 0x0300301c +_08038F00: .4byte vblank_cb_08078BB4 + 1 +_08038F04: .4byte task00_0800F6FC + 1 +_08038F08: .4byte 0x03005e00 +_08038F0C: .4byte sub_8038F14 + 1 +_08038F10: .4byte 0x02024332 + thumb_func_end sub_8038D64 + + thumb_func_start sub_8038F14 +sub_8038F14: @ 8038F14 + push {lr} + bl sub_8038F34 + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + 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, _08038F50 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x9 + bls _08038F44 + b _080391C6 +_08038F44: + lsls r0, r1, 2 + ldr r1, _08038F54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08038F50: .4byte 0x02024332 +_08038F54: .4byte _08038F58 + .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 gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r1, _08038F9C + movs r0, 0xFF + strb r0, [r1, 0x1] + b _08039174 + .align 2, 0 +_08038F9C: .4byte 0x02024332 +_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 sub_80A1AD4 + b _0803910C +_08038FC2: + ldr r0, _08039050 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08038FD0 + b _080391C6 +_08038FD0: + bl sub_8185FAC + ldr r2, _08039054 + ldr r1, _08039058 + 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, _0803905C + 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, _08039060 + cmp r4, r3 + bge _08039022 + ldr r1, _08039064 + 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, _08039068 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080390AC + cmp r4, r3 + bne _080390AC + ldr r0, _0803906C + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08039074 + bl Window_FreeMemory + ldr r0, _08039070 + bl set_callback2 + b _080391C6 + .align 2, 0 +_08039050: .4byte 0x02037fd4 +_08039054: .4byte 0x030022c0 +_08039058: .4byte 0x00000439 +_0803905C: .4byte 0x02022fec +_08039060: .4byte 0x03005d90 +_08039064: .4byte 0x020229e8 +_08039068: .4byte 0x00000ca9 +_0803906C: .4byte 0x000008d2 +_08039070: .4byte sub_80392A8 + 1 +_08039074: + ldr r2, _08039088 + ldr r1, _0803908C + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08039090 + ldr r0, [r2, 0x8] + b _080390B0 + .align 2, 0 +_08039088: .4byte 0x030022c0 +_0803908C: .4byte 0x00000439 +_08039090: + ldr r0, _080390A4 + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + ldr r0, _080390A8 + movs r1, 0x5 + bl AddTask + b _08039172 + .align 2, 0 +_080390A4: .4byte 0x03003124 +_080390A8: .4byte sub_80B3AF8 + 1 +_080390AC: + ldr r0, _080390C4 + ldr r0, [r0, 0x8] +_080390B0: + bl set_callback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _080391C6 + .align 2, 0 +_080390C4: .4byte 0x030022c0 +_080390C8: + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _080390FC + 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 sub_80A1AD4 + b _08039172 + .align 2, 0 +_080390FC: .4byte 0x05006000 +_08039100: + ldr r0, _08039114 + 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 + .align 2, 0 +_08039114: .4byte 0x02037fd4 +_08039118: + ldr r0, _08039128 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080391C6 + b _08039172 + .align 2, 0 +_08039128: .4byte sub_80B3AF8 + 1 +_0803912C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + bl sub_800ADF8 + ldr r0, _08039148 + movs r1, 0 + bl battle_show_message_maybe + b _08039172 + .align 2, 0 +_08039148: .4byte 0x0824978d +_0803914C: + movs r0, 0 + bl a_pressed_maybe + 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, _0803917C + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + bl sub_800AC34 +_08039172: + ldr r1, _08039180 +_08039174: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080391C6 + .align 2, 0 +_0803917C: .4byte 0x030030fc +_08039180: .4byte 0x02024332 +_08039184: + ldr r2, _080391D0 + ldr r1, _080391D4 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _080391A6 + ldr r0, _080391D8 + ldrb r0, [r0] + cmp r0, 0 + bne _080391A6 + ldr r0, _080391DC + ldrb r0, [r0] + cmp r0, 0x1 + beq _080391C6 +_080391A6: + ldr r0, _080391D4 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3, 0x8] + bl set_callback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 +_080391C6: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080391D0: .4byte 0x030022c0 +_080391D4: .4byte 0x00000439 +_080391D8: .4byte 0x030030fc +_080391DC: .4byte 0x03003124 + 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, _080391FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080391FC: .4byte _08039200 + .align 2, 0 +_08039200: + .4byte _0803921C + .4byte _08039230 + .4byte _08039244 + .4byte _08039258 + .4byte _0803926C + .4byte _08039280 + .4byte _08039294 +_0803921C: + ldr r0, _0803922C + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + lsrs r0, 30 + b _080392A0 + .align 2, 0 +_0803922C: .4byte 0x0831aa08 +_08039230: + ldr r0, _08039240 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 30 + b _080392A0 + .align 2, 0 +_08039240: .4byte 0x0831aa08 +_08039244: + ldr r0, _08039254 + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r0, 27 + b _080392A0 + .align 2, 0 +_08039254: .4byte 0x0831aa08 +_08039258: + ldr r0, _08039268 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 29 + lsrs r0, 30 + b _080392A0 + .align 2, 0 +_08039268: .4byte 0x0831aa08 +_0803926C: + ldr r0, _0803927C + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 28 + lsrs r0, 31 + b _080392A0 + .align 2, 0 +_0803927C: .4byte 0x0831aa08 +_08039280: + ldr r0, _08039290 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 26 + lsrs r0, 30 + b _080392A0 + .align 2, 0 +_08039290: .4byte 0x0831aa08 +_08039294: + ldr r0, _080392A4 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + lsls r0, 8 + lsrs r0, 22 +_080392A0: + pop {r1} + bx r1 + .align 2, 0 +_080392A4: .4byte 0x0831aa08 + 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, _08039348 + add r0, sp, 0x4 + bl CpuSet + bl sub_80A1A74 + ldr r0, _0803934C + strh r4, [r0] + ldr r0, _08039350 + strh r4, [r0] + ldr r0, _08039354 + strh r4, [r0] + ldr r0, _08039358 + strh r4, [r0] + ldr r0, _0803935C + strh r4, [r0] + ldr r0, _08039360 + strh r4, [r0] + ldr r0, _08039364 + strh r4, [r0] + ldr r0, _08039368 + strh r4, [r0] + bl c2_berry_program_update_menu + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + bl sub_803570C +_080392FE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080392FE + bl reset_all_obj_data + bl clear_tasks + bl gpu_pal_allocator_reset + ldr r1, _0803936C + movs r0, 0x4 + strb r0, [r1] + ldr r0, _08039370 + bl SetVBlankCallback + ldr r0, _08039374 + bl set_callback2 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _08039378 + strb r4, [r0] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039348: .4byte 0x05006000 +_0803934C: .4byte 0x02022e14 +_08039350: .4byte 0x02022e16 +_08039354: .4byte 0x02022e18 +_08039358: .4byte 0x02022e1a +_0803935C: .4byte 0x02022e1c +_08039360: .4byte 0x02022e1e +_08039364: .4byte 0x02022e20 +_08039368: .4byte 0x02022e22 +_0803936C: .4byte 0x0300301c +_08039370: .4byte vblank_cb_08078BB4 + 1 +_08039374: .4byte sub_803937C + 1 +_08039378: .4byte 0x02024332 + thumb_func_end sub_80392A8 + + thumb_func_start sub_803937C +sub_803937C: @ 803937C + push {lr} + bl sub_803939C + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + 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, _080393B8 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xC + bls _080393AC + b _0803975E +_080393AC: + lsls r0, r1, 2 + ldr r1, _080393BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080393B8: .4byte 0x02024332 +_080393BC: .4byte _080393C0 + .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 gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r1, _08039410 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_08039410: .4byte 0x02024332 +_08039414: + ldr r0, _0803943C + ldr r1, _08039440 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039434 + ldr r0, _08039444 + ldrb r0, [r0] + cmp r0, 0 + bne _08039434 + ldr r0, _08039448 + movs r1, 0x5 + bl AddTask +_08039434: + ldr r1, _0803944C + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_0803943C: .4byte 0x030022c0 +_08039440: .4byte 0x00000439 +_08039444: .4byte 0x03003124 +_08039448: .4byte sub_80B3AF8 + 1 +_0803944C: .4byte 0x02024332 +_08039450: + ldr r0, _08039468 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0803945E + b _0803975E +_0803945E: + ldr r1, _0803946C + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_08039468: .4byte sub_80B3AF8 + 1 +_0803946C: .4byte 0x02024332 +_08039470: + ldr r0, _08039490 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803947E + b _0803975E +_0803947E: + ldr r0, _08039494 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _08039498 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_08039490: .4byte 0x02037fd4 +_08039494: .4byte 0x085cd28f +_08039498: .4byte 0x02024332 +_0803949C: + movs r0, 0 + bl a_pressed_maybe + 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, _080394D0 + movs r1, 0xC + bl battle_show_message_maybe + ldr r4, _080394D4 + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 + b _080396EA + .align 2, 0 +_080394D0: .4byte 0x085ccabb +_080394D4: .4byte 0x02024332 +_080394D8: + ldr r0, _080394FC + 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 + .align 2, 0 +_080394FC: .4byte 0x030022c0 +_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, _0803955C + 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 + .align 2, 0 +_0803955C: .4byte 0x02024332 +_08039560: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803956A + b _0803975E +_0803956A: + movs r0, 0x5 + bl audio_play + ldr r1, _08039578 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_08039578: .4byte 0x02024332 +_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, _080395BC + ldr r1, _080395C0 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395B4 + bl sub_800ADF8 + ldr r0, _080395C4 + movs r1, 0 + bl battle_show_message_maybe +_080395B4: + ldr r1, _080395C8 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_080395BC: .4byte 0x030022c0 +_080395C0: .4byte 0x00000439 +_080395C4: .4byte 0x0824978d +_080395C8: .4byte 0x02024332 +_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, _08039600 + ldr r1, _08039604 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395F6 + ldr r0, _08039608 + ldrb r0, [r0] + cmp r0, 0 + bne _080395F6 + bl sub_800AC34 +_080395F6: + ldr r1, _0803960C + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .align 2, 0 +_08039600: .4byte 0x030022c0 +_08039604: .4byte 0x00000439 +_08039608: .4byte 0x030030fc +_0803960C: .4byte 0x02024332 +_08039610: + ldr r2, _08039664 + ldr r1, _08039668 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _08039634 + ldr r0, _0803966C + ldrb r0, [r0] + cmp r0, 0 + bne _08039634 + ldr r0, _08039670 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08039634 + b _0803975E +_08039634: + ldr r0, _08039668 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _08039674 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039650 + b _0803975E +_08039650: + ldr r0, [r3, 0x8] + bl set_callback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _0803975E + .align 2, 0 +_08039664: .4byte 0x030022c0 +_08039668: .4byte 0x00000439 +_0803966C: .4byte 0x030030fc +_08039670: .4byte 0x03003124 +_08039674: .4byte 0x02037fd4 +_08039678: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _080396A0 + movs r0, 0x37 + bl audio_play + ldr r0, _08039698 +_08039686: + bl sub_814E6F0 + ldr r0, _0803969C + movs r1, 0 + bl battle_show_message_maybe + movs r0, 0x80 + strb r0, [r4, 0x1] + b _080396EA + .align 2, 0 +_08039698: .4byte 0x085cd2cb +_0803969C: .4byte 0x02022e2c +_080396A0: + ldr r0, _080396A4 + b _08039686 + .align 2, 0 +_080396A4: .4byte 0x08242481 +_080396A8: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0803975E + ldr r4, _080396F4 + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803975E + ldr r0, _080396F8 + ldr r1, _080396FC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080396EA + bl sub_800ADF8 + ldr r0, _08039700 + movs r1, 0 + bl battle_show_message_maybe +_080396EA: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0803975E + .align 2, 0 +_080396F4: .4byte 0x02024332 +_080396F8: .4byte 0x030022c0 +_080396FC: .4byte 0x00000439 +_08039700: .4byte 0x0824978d +_08039704: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _0803975E + ldr r0, _0803973C + ldr r1, _08039740 + 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 + .align 2, 0 +_0803973C: .4byte 0x030022c0 +_08039740: .4byte 0x00000439 +_08039744: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] +_0803974A: + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08039768 + 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 + .align 2, 0 +_08039768: .4byte 0x02024332 + 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, _080397BC + 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, _080397C0 + mov r0, sp + bl sub_80092BC + 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 + .align 2, 0 +_080397BC: .4byte 0x0000012f +_080397C0: .4byte 0x0831aca0 + thumb_func_end shedinja_something + + thumb_func_start sub_80397C4 +sub_80397C4: @ 80397C4 + ldr r2, _080397D8 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x3] + lsls r0, 3 + bx lr + .align 2, 0 +_080397D8: .4byte 0x0831aba0 + thumb_func_end sub_80397C4 + + thumb_func_start oac_poke_opponent +oac_poke_opponent: @ 80397DC + push {lr} + sub sp, 0x4 + ldr r1, _08039804 + str r1, [r0, 0x1C] + movs r1, 0 + bl obj_anim_image_start_if_different + movs r0, 0x80 + lsls r0, 10 + ldr r1, _08039808 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0xA + bl sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08039804: .4byte sub_803980C + 1 +_08039808: .4byte 0x00002108 + thumb_func_end oac_poke_opponent + + thumb_func_start sub_803980C +sub_803980C: @ 803980C + push {lr} + adds r2, r0, 0 + ldr r0, _08039830 + 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, _08039834 + str r0, [r2, 0x1C] +_0803982C: + pop {r0} + bx r0 + .align 2, 0 +_08039830: .4byte 0x020243fc +_08039834: .4byte sub_8039838 + 1 + 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, _08039888 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + bl sub_80729D0 + ldr r0, _0803988C + str r0, [r4, 0x1C] + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + movs r0, 0x80 + lsls r0, 10 + ldr r1, _08039890 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0 + bl sub_80A1AD4 +_08039880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039888: .4byte 0x03005d70 +_0803988C: .4byte sub_8039894 + 1 +_08039890: .4byte 0x00002108 + thumb_func_end sub_8039838 + + thumb_func_start sub_8039894 +sub_8039894: @ 8039894 + push {lr} + adds r2, r0, 0 + ldr r0, _080398B4 + 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 + .align 2, 0 +_080398B4: .4byte 0x02037fd4 + 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, _080398CC + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_080398CC: .4byte sub_80398D0 + 1 + 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, _0803992C + str r0, [r3, 0x1C] + ldr r0, _08039930 + str r2, [r0] +_08039924: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803992C: .4byte nullsub_18 + 1 +_08039930: .4byte 0x02022f88 + 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, _08039958 + 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 + .align 2, 0 +_08039958: .4byte 0x020244d0 +_0803995C: + mov r0, r9 + ldrh r4, [r0, 0x32] +_08039960: + ldr r1, _080399C8 + 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, _080399CC + 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 + .align 2, 0 +_080399C8: .4byte 0x0202406e +_080399CC: .4byte 0x02024744 +_080399D0: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080399DA: + ldr r1, _080399E0 + lsls r0, 2 + b _08039A1C + .align 2, 0 +_080399E0: .4byte 0x08300d38 +_080399E4: + ldr r0, _080399FC + cmp r4, r0 + bne _08039A08 + ldr r0, _08039A00 + ldr r1, _08039A04 + adds r1, r6, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _08039A20 + .align 2, 0 +_080399FC: .4byte 0x00000181 +_08039A00: .4byte 0x08525f78 +_08039A04: .4byte 0x020244e4 +_08039A08: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _08039A18 + ldr r0, _08039A14 + b _08039A1E + .align 2, 0 +_08039A14: .4byte 0x08300d38 +_08039A18: + ldr r1, _08039A40 + 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, _08039A44 + str r0, [r1, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08039A40: .4byte 0x08300d38 +_08039A44: .4byte sub_8039A48 + 1 + 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 obj_delete_and_free_tiles + b _08039AC8 +_08039A7C: + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + ldr r1, _08039AD0 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r2, _08039AD4 + 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, _08039AD4 + movs r3, 0x2E + ldrsh r1, [r4, r3] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + bl obj_anim_image_start +_08039AC8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039AD0: .4byte 0x020244d4 +_08039AD4: .4byte 0x020244e4 + 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, _08039AF0 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08039AF0: .4byte sub_8039AF4 + 1 + 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, _08039B54 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08039B54: .4byte nullsub_18 + 1 + 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, _08039BA8 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039B80 + ldr r0, _08039BAC + ldr r0, [r0] + ldr r1, _08039BB0 + 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 obj_anim_image_start +_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 + .align 2, 0 +_08039BA8: .4byte 0x02024280 +_08039BAC: .4byte 0x02022fec +_08039BB0: .4byte 0x02000002 + thumb_func_end sub_8039B58 + + thumb_func_start sub_8039BB4 +sub_8039BB4: @ 8039BB4 + ldr r1, _08039BBC + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08039BBC: .4byte oac_poke_ally_ + 1 + thumb_func_end sub_8039BB4 + + thumb_func_start oac_poke_ally_ +oac_poke_ally_: @ 8039BC0 + push {lr} + adds r2, r0, 0 + ldr r0, _08039BE8 + 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, _08039BEC + str r0, [r2, 0x1C] + strh r1, [r2, 0x30] +_08039BE4: + pop {r0} + bx r0 + .align 2, 0 +_08039BE8: .4byte 0x020243fc +_08039BEC: .4byte nullsub_19 + 1 + thumb_func_end oac_poke_ally_ + + thumb_func_start sub_8039BF0 +sub_8039BF0: @ 8039BF0 + ldr r1, _08039BF8 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08039BF8: .4byte nullsub_19 + 1 + 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, _08039C24 + 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 + .align 2, 0 +_08039C24: .4byte 0x020243fc + 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, _08039C60 + 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 + .align 2, 0 +_08039C60: .4byte 0x020244d0 +_08039C64: + ldr r0, _08039CC0 + 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, _08039CC4 + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + cmp r0, 0x1 + bne _08039CD0 + ldr r0, _08039CC8 + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, _08039CC0 + 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, _08039CCC + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x80 + b _08039CFE + .align 2, 0 +_08039CC0: .4byte 0x020244d0 +_08039CC4: .4byte objc_dp11b_pingpong + 1 +_08039CC8: .4byte 0x03005d70 +_08039CCC: .4byte 0x02020630 +_08039CD0: + ldr r0, _08039D3C + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, _08039D40 + 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, _08039D44 + 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 + .align 2, 0 +_08039D3C: .4byte 0x020241e4 +_08039D40: .4byte 0x020244d0 +_08039D44: .4byte 0x02020630 + 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, _08039D94 + 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, _08039D98 + 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 obj_delete_and_free_tiles + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + b _08039DD6 + .align 2, 0 +_08039D94: .4byte 0x020244d0 +_08039D98: .4byte 0x02020630 +_08039D9C: + ldr r6, _08039DF0 + 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, _08039DF4 + 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 obj_delete_and_free_tiles + 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, _08039DF4 + 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 + .align 2, 0 +_08039DF0: .4byte 0x020244d0 +_08039DF4: .4byte 0x02020630 + 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, _08039E40 + 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 + .align 2, 0 +_08039E40: .4byte 0x02020630 + 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, _08039E80 + str r0, [r4, 0x1C] +_08039E7A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039E80: .4byte nullsub_19 + 1 + thumb_func_end sub_8039E60 + + thumb_func_start sub_8039E84 +sub_8039E84: @ 8039E84 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldr r0, _08039E98 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039E98: .4byte sub_8039E60 + 1 + 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, _08039EC4 + 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 + .align 2, 0 +_08039EC4: .4byte 0x0831ace0 + 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, _08039EE4 + movs r0, 0 + strb r0, [r1, 0x1] + ldr r1, _08039EE8 + ldr r0, _08039EEC + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08039EE4: .4byte 0x02024332 +_08039EE8: .4byte 0x03005d04 +_08039EEC: .4byte bc_8012FAC + 1 + thumb_func_end sub_8039ECC + + thumb_func_start sub_8039EF0 +sub_8039EF0: @ 8039EF0 + push {r4,r5,lr} + ldr r0, _08039F30 + ldr r0, [r0] + bl _call_via_r0 + ldr r1, _08039F34 + movs r0, 0 + strb r0, [r1] + ldr r0, _08039F38 + ldrb r0, [r0] + cmp r0, 0 + beq _08039F2A + ldr r5, _08039F3C + 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, _08039F38 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _08039F0C +_08039F2A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08039F30: .4byte 0x03005d04 +_08039F34: .4byte 0x02024064 +_08039F38: .4byte 0x0202406c +_08039F3C: .4byte 0x03005d60 + 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, _0803A03C + mov r10, r0 + ldr r1, _0803A040 + mov r9, r1 + ldr r0, _0803A044 + mov r8, r0 + ldr r1, _0803A048 + mov r12, r1 + ldr r5, _0803A04C + movs r4, 0 + ldr r7, _0803A050 + ldr r6, _0803A054 +_08039F70: + ldr r0, _0803A058 + 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, _0803A05C + 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, _0803A060 + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + strh r3, [r6] + strh r3, [r7] + ldr r1, _0803A064 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r4 + str r3, [r0] + ldr r1, _0803A068 + 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, _0803A06C + ldr r4, _0803A070 + 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, _0803A074 + strb r1, [r2] + ldr r0, _0803A078 + strb r1, [r0] + ldr r2, _0803A07C + strh r1, [r2] + ldr r1, _0803A080 + movs r2, 0 + movs r3, 0 +_0803A004: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x2B + bls _0803A004 + ldr r2, _0803A084 + movs r0, 0 + str r0, [r2] + ldr r0, _0803A088 + 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, _0803A08C + ldr r0, [r0] + ldrb r1, [r0, 0x15] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803A0AE + movs r0, 0x80 + b _0803A0AC + .align 2, 0 +_0803A03C: .4byte 0x02024260 +_0803A040: .4byte 0x02024258 +_0803A044: .4byte 0x02024250 +_0803A048: .4byte 0x02024248 +_0803A04C: .4byte 0x020242bc +_0803A050: .4byte 0x02024240 +_0803A054: .4byte 0x02024268 +_0803A058: .4byte 0x020242ac +_0803A05C: .4byte 0x02024284 +_0803A060: .4byte 0x02024270 +_0803A064: .4byte 0x020244a8 +_0803A068: .4byte 0x02024230 +_0803A06C: .4byte 0x02024294 +_0803A070: .4byte 0x0202428e +_0803A074: .4byte 0x0202420b +_0803A078: .4byte 0x0202420c +_0803A07C: .4byte 0x020243cc +_0803A080: .4byte 0x020243d0 +_0803A084: .4byte 0x02024280 +_0803A088: .4byte 0x02022fec +_0803A08C: .4byte 0x03005d90 +_0803A090: + ldr r0, _0803A22C + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + bl sub_8185FB8 + lsls r0, 24 + cmp r0, 0 + beq _0803A0AE + ldr r1, _0803A230 + ldr r0, [r1] + movs r1, 0x80 + orrs r0, r1 + ldr r2, _0803A230 +_0803A0AC: + str r0, [r2] +_0803A0AE: + ldr r3, _0803A234 + ldr r0, _0803A238 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0 + strb r0, [r3, 0x1D] + ldr r0, _0803A23C + strb r1, [r0] + ldr r0, _0803A240 + strb r1, [r0] + ldr r0, _0803A244 + str r1, [r0] + ldr r0, _0803A248 + movs r2, 0 + strh r1, [r0] + ldr r1, _0803A24C + 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, _0803A250 + ldr r6, _0803A254 + ldr r7, _0803A258 + ldr r0, _0803A25C + mov r8, r0 + ldr r1, _0803A260 + mov r9, r1 + ldr r2, _0803A264 + mov r10, r2 + ldr r1, _0803A268 + 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, _0803A26C + 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, _0803A270 + 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, _0803A274 + 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, _0803A26C + 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, _0803A278 + strh r0, [r1] + ldr r1, _0803A27C + movs r2, 0 + movs r3, 0 +_0803A1E4: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x43 + bls _0803A1E4 + ldr r0, _0803A264 + bl sub_806EBA4 + ldr r3, _0803A27C + 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, _0803A26C + ldr r0, [r2] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _0803A280 + 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 + .align 2, 0 +_0803A22C: .4byte 0x02000002 +_0803A230: .4byte 0x02024280 +_0803A234: .4byte 0x02024474 +_0803A238: .4byte 0x03005d90 +_0803A23C: .4byte 0x02024212 +_0803A240: .4byte 0x0202433a +_0803A244: .4byte 0x02024068 +_0803A248: .4byte 0x0202432e +_0803A24C: .4byte 0x020244a8 +_0803A250: .4byte 0x0202432c +_0803A254: .4byte 0x020241f0 +_0803A258: .4byte 0x020243fc +_0803A25C: .4byte 0x03005d54 +_0803A260: .4byte 0x02024210 +_0803A264: .4byte 0x02024744 +_0803A268: .4byte 0x02024332 +_0803A26C: .4byte 0x0202449c +_0803A270: .4byte 0x083203cc +_0803A274: .4byte 0x000004fb +_0803A278: .4byte 0x02024330 +_0803A27C: .4byte 0x03005d10 +_0803A280: .4byte 0x000002a1 + 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, _0803A3E8 + ldr r5, _0803A3EC + 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, _0803A3F0 + ldr r3, _0803A3F4 + 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, _0803A3F8 + mov r10, r6 + cmp r0, 0x7F + beq _0803A35C + movs r5, 0 + mov r6, r9 + movs r4, 0x58 + ldr r2, _0803A3FC + 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, _0803A400 + ldrb r7, [r7] + cmp r5, r7 + bge _0803A348 + ldr r0, _0803A404 + mov r8, r0 + ldr r4, _0803A3E8 + ldr r3, _0803A3F8 +_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, _0803A3EC + ldrb r6, [r6] + cmp r0, r6 + bne _0803A31A + ldr r0, _0803A408 + 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, _0803A3EC + 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, _0803A400 + ldrb r0, [r0] + cmp r5, r0 + blt _0803A2F6 +_0803A348: + ldr r1, _0803A3F4 + ldrh r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r2, _0803A3F0 + 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, _0803A3FC + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, _0803A40C + ands r0, r1 + str r0, [r2] + ldrb r1, [r3] + lsls r1, 2 + add r1, r10 + ldr r0, [r1] + ldr r2, _0803A410 + ands r0, r2 + str r0, [r1] + movs r5, 0 + ldr r6, _0803A400 + 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, _0803A3F8 + lsls r0, r5, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A3D0 + ldr r0, _0803A3E8 + 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, _0803A400 + ldrb r0, [r0] + cmp r5, r0 + blt _0803A390 + ldr r6, _0803A3E8 + mov r12, r6 + ldr r7, _0803A3EC + mov r9, r7 + b _0803A430 + .align 2, 0 +_0803A3E8: .4byte 0x020242bc +_0803A3EC: .4byte 0x02024064 +_0803A3F0: .4byte 0x0831c898 +_0803A3F4: .4byte 0x020241ea +_0803A3F8: .4byte 0x020242ac +_0803A3FC: .4byte 0x02024084 +_0803A400: .4byte 0x0202406c +_0803A404: .4byte 0x020240d4 +_0803A408: .4byte 0xfbffffff +_0803A40C: .4byte 0x15100007 +_0803A410: .4byte 0x0003043f +_0803A414: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, _0803A710 + 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, _0803A714 + mov r8, r3 + ldr r6, _0803A718 + mov r10, r6 + ldr r7, _0803A71C + ldrb r7, [r7] + cmp r5, r7 + bge _0803A490 + ldr r3, _0803A720 + ldr r7, _0803A724 + ldr r6, _0803A728 +_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, _0803A72C + ands r1, r0 + str r1, [r4] +_0803A486: + adds r5, 0x1 + ldr r0, _0803A71C + 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, _0803A730 + 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, _0803A734 + ldrh r0, [r7] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, _0803A738 + 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, _0803A73C + 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, _0803A740 + adds r0, r1 + movs r2, 0 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r3, _0803A744 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r6, _0803A748 + adds r0, r6 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r7, _0803A74C + adds r0, r7 + strh r4, [r0] + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + ldr r3, _0803A750 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r1] + ldr r6, _0803A754 + 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, _0803A724 + adds r0, r6 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r7, _0803A71C + 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, _0803A71C + 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, _0803A758 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrb r0, [r3] + lsls r0, 2 + adds r1, r0 + movs r2, 0 + str r2, [r1] + ldr r0, _0803A734 + 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 + .align 2, 0 +_0803A710: .4byte 0x02024084 +_0803A714: .4byte 0x0202449c +_0803A718: .4byte 0x020244ac +_0803A71C: .4byte 0x0202406c +_0803A720: .4byte 0x020240d4 +_0803A724: .4byte 0x0832a328 +_0803A728: .4byte 0x02024064 +_0803A72C: .4byte 0xffff1fff +_0803A730: .4byte 0x020244b0 +_0803A734: .4byte 0x020241ea +_0803A738: .4byte 0x0831c898 +_0803A73C: .4byte 0x0202427c +_0803A740: .4byte 0x02024248 +_0803A744: .4byte 0x02024250 +_0803A748: .4byte 0x02024258 +_0803A74C: .4byte 0x02024260 +_0803A750: .4byte 0x02024240 +_0803A754: .4byte 0x02024270 +_0803A758: .4byte 0x020244a8 + 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, _0803AB20 + ldr r0, _0803AB24 + mov r8, r0 + ldr r1, _0803AB28 + mov r12, r1 + ldr r2, _0803AB2C + mov r9, r2 + ldr r3, _0803AB30 + mov r10, r3 + ldr r7, _0803AB34 + ldr r4, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + ldrb r0, [r3] + lsls r0, 2 + add r0, r8 + str r1, [r0] + movs r5, 0 + ldr r6, _0803AB3C + ldrb r6, [r6] + cmp r5, r6 + bge _0803A830 + adds r3, r2, 0 + movs r4, 0 + ldr r0, _0803AB40 + mov r8, r0 +_0803A7C6: + ldr r1, [r3] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A7E6 + ldr r2, _0803AB44 + adds r0, r4, r2 + ldrb r0, [r0, 0x14] + ldr r6, _0803AB38 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A7E6 + ldr r0, _0803AB48 + ands r1, r0 + str r1, [r3] +_0803A7E6: + ldr r1, _0803AB38 + 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, _0803AB38 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A822 + ldr r0, _0803AB4C + ands r1, r0 + str r1, [r3] +_0803A822: + adds r3, 0x58 + adds r4, 0x1C + adds r5, 0x1 + ldr r0, _0803AB3C + ldrb r0, [r0] + cmp r5, r0 + blt _0803A7C6 +_0803A830: + ldr r1, _0803AB38 + ldrb r0, [r1] + add r0, r9 + movs r1, 0 + strb r1, [r0] + ldr r2, _0803AB38 + ldrb r0, [r2] + add r0, r10 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r3, _0803AB44 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + 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, _0803AB38 + ldrb r0, [r1] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r5, r1 + strb r5, [r0, 0x1] + ldr r2, _0803AB38 + 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, _0803AB38 + 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, _0803AB44 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r3] + lsls r0, 1 + ldr r3, _0803AB50 + adds r0, r3 + movs r3, 0 + strh r2, [r0] + ldr r6, _0803AB38 + ldrb r0, [r6] + lsls r0, 1 + ldr r1, _0803AB54 + adds r0, r1 + strh r2, [r0] + ldrb r0, [r6] + lsls r0, 1 + ldr r6, _0803AB58 + adds r0, r6 + strh r2, [r0] + ldr r1, _0803AB38 + ldrb r0, [r1] + lsls r0, 1 + ldr r6, _0803AB5C + adds r0, r6 + strh r2, [r0] + ldrb r0, [r1] + lsls r0, 1 + ldr r1, _0803AB60 + adds r0, r1 + strh r2, [r0] + ldr r2, _0803AB38 + ldrb r0, [r2] + ldr r6, _0803AB64 + 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, _0803AB38 + 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, _0803AB40 + adds r0, r2 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r3, _0803AB3C + 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, _0803AB3C + ldrb r0, [r0] + cmp r5, r0 + blt _0803AAA4 +_0803AB02: + ldr r0, _0803AB68 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r2, _0803AB38 + ldrb r0, [r2] + lsls r0, 2 + adds r1, r0 + movs r0, 0 + str r0, [r1] + ldr r4, _0803AB20 + ldrb r0, [r2] + movs r3, 0x58 + adds r2, r0, 0 + muls r2, r3 + b _0803AB6C + .align 2, 0 +_0803AB20: .4byte 0x02024084 +_0803AB24: .4byte 0x020242ac +_0803AB28: .4byte 0x0202449c +_0803AB2C: .4byte 0x020244ac +_0803AB30: .4byte 0x020244b0 +_0803AB34: .4byte 0x0202433c +_0803AB38: .4byte 0x02024064 +_0803AB3C: .4byte 0x0202406c +_0803AB40: .4byte 0x0832a328 +_0803AB44: .4byte 0x020242bc +_0803AB48: .4byte 0xfbffffff +_0803AB4C: .4byte 0xffff1fff +_0803AB50: .4byte 0x02024248 +_0803AB54: .4byte 0x02024250 +_0803AB58: .4byte 0x02024258 +_0803AB5C: .4byte 0x02024260 +_0803AB60: .4byte 0x02024240 +_0803AB64: .4byte 0x02024270 +_0803AB68: .4byte 0x020244a8 +_0803AB6C: + adds r2, r4 + ldr r5, _0803ABB8 + 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, _0803ABBC + 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 + .align 2, 0 +_0803ABB8: .4byte 0x083203cc +_0803ABBC: .4byte 0x02024064 + thumb_func_end sub_803A75C + + thumb_func_start bc_8012FAC +bc_8012FAC: @ 803ABC0 + push {r4,r5,lr} + ldr r5, _0803ABD0 + ldrb r0, [r5] + cmp r0, 0 + beq _0803ABD4 + cmp r0, 0x1 + beq _0803ABF8 + b _0803AC2E + .align 2, 0 +_0803ABD0: .4byte 0x02024332 +_0803ABD4: + ldr r4, _0803ABF4 + 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 + .align 2, 0 +_0803ABF4: .4byte 0x02024064 +_0803ABF8: + ldr r0, _0803AC1C + ldr r2, [r0] + cmp r2, 0 + bne _0803AC2E + ldrb r0, [r5, 0x1] + adds r0, 0x1 + strb r0, [r5, 0x1] + ldr r1, _0803AC20 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _0803AC2C + ldr r1, _0803AC24 + ldr r0, _0803AC28 + str r0, [r1] + b _0803AC2E + .align 2, 0 +_0803AC1C: .4byte 0x02024068 +_0803AC20: .4byte 0x0202406c +_0803AC24: .4byte 0x03005d04 +_0803AC28: .4byte bc_load_battlefield + 1 +_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, _0803AC6C + ldr r5, [r0] + cmp r5, 0 + bne _0803AC64 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, _0803AC70 + strb r0, [r4] + ldr r0, _0803AC74 + 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, _0803AC78 + ldr r0, _0803AC7C + str r0, [r1] + ldr r0, _0803AC80 + strb r5, [r0] + strb r5, [r0, 0x1] +_0803AC64: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803AC6C: .4byte 0x02024068 +_0803AC70: .4byte 0x02024064 +_0803AC74: .4byte 0x02022ff0 +_0803AC78: .4byte 0x03005d04 +_0803AC7C: .4byte sub_803AC84 + 1 +_0803AC80: .4byte 0x02024332 + 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, _0803ACE8 + ldr r1, [r0] + cmp r1, 0 + beq _0803AC98 + b _0803AF4E +_0803AC98: + ldr r2, _0803ACEC + strb r1, [r2] + ldr r0, _0803ACF0 + ldrb r0, [r0] + cmp r1, r0 + bcc _0803ACA6 + b _0803AF48 +_0803ACA6: + movs r7, 0x58 + ldr r0, _0803ACF4 + mov r8, r0 + mov r9, r2 + movs r1, 0x48 + add r1, r8 + mov r10, r1 +_0803ACB4: + ldr r0, _0803ACF8 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803ACFC + ldr r4, _0803ACEC + 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 + .align 2, 0 +_0803ACE8: .4byte 0x02024068 +_0803ACEC: .4byte 0x02024064 +_0803ACF0: .4byte 0x0202406c +_0803ACF4: .4byte 0x02024084 +_0803ACF8: .4byte 0x02022fec +_0803ACFC: + mov r1, r9 + ldrb r0, [r1] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + ldr r6, _0803AE44 + ldr r5, _0803AE48 + ldr r4, _0803AE4C +_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, _0803AE50 + 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, _0803AE4C + movs r5, 0x58 + ldr r1, _0803AE54 + 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, _0803AE4C + 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, _0803AE58 + 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, _0803AE5C + ands r0, r1 + cmp r0, 0 + bne _0803AEC0 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl sub_806F01C + b _0803AEC0 + .align 2, 0 +_0803AE44: .4byte 0x083203cc +_0803AE48: .4byte 0x02023864 +_0803AE4C: .4byte 0x02024064 +_0803AE50: .4byte 0x0202449c +_0803AE54: .4byte 0x0202409c +_0803AE58: .4byte 0x02022fec +_0803AE5C: .4byte 0x063f0902 +_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, _0803AF5C + ands r0, r1 + cmp r0, 0 + bne _0803AE96 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl sub_806F01C +_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, _0803AF60 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0803AF64 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, _0803AF68 + strh r0, [r1, 0x20] +_0803AEC0: + ldr r0, _0803AF6C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803AEF6 + ldr r4, _0803AF70 + 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, _0803AF6C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803AF20 + ldr r4, _0803AF70 + 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, _0803AF6C + 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, _0803AF74 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcs _0803AF48 + b _0803ACB4 +_0803AF48: + ldr r1, _0803AF78 + ldr r0, _0803AF7C + str r0, [r1] +_0803AF4E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803AF5C: .4byte 0x063f0902 +_0803AF60: .4byte 0x0202406e +_0803AF64: .4byte 0x02024744 +_0803AF68: .4byte 0x03005d10 +_0803AF6C: .4byte 0x02022fec +_0803AF70: .4byte 0x02024064 +_0803AF74: .4byte 0x0202406c +_0803AF78: .4byte 0x03005d04 +_0803AF7C: .4byte bc_801333C + 1 + 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, _0803AFD8 + ldr r0, [r0] + cmp r0, 0 + beq _0803AF92 + b _0803B10C +_0803AF92: + ldr r0, _0803AFDC + 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, _0803AFE0 + 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, _0803AFE4 + strh r0, [r5] + movs r0, 0 + b _0803AFFA + .align 2, 0 +_0803AFD8: .4byte 0x02024068 +_0803AFDC: .4byte 0x02022fec +_0803AFE0: .4byte 0x02024744 +_0803AFE4: .4byte 0x0000ffff +_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, _0803B054 + 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, _0803B058 + 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, _0803B05C + strh r0, [r5] + movs r0, 0 + b _0803B072 + .align 2, 0 +_0803B054: .4byte 0x02024064 +_0803B058: .4byte 0x020244ec +_0803B05C: .4byte 0x0000ffff +_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, _0803B0A0 + 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, _0803B0A4 + ldr r0, _0803B0A8 + b _0803B10A + .align 2, 0 +_0803B0A0: .4byte 0x02024064 +_0803B0A4: .4byte 0x03005d04 +_0803B0A8: .4byte bc_battle_begin_message + 1 +_0803B0AC: + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0803B0B2: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _0803B0E0 + 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, _0803B0E4 + strh r0, [r5] + movs r0, 0 + b _0803B0FA + .align 2, 0 +_0803B0E0: .4byte 0x020244ec +_0803B0E4: .4byte 0x0000ffff +_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, _0803B118 + ldr r0, _0803B11C +_0803B10A: + str r0, [r1] +_0803B10C: + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803B118: .4byte 0x03005d04 +_0803B11C: .4byte bc_8013568 + 1 + thumb_func_end bc_801333C + + thumb_func_start bc_battle_begin_message +bc_battle_begin_message: @ 803B120 + push {lr} + ldr r0, _0803B148 + ldr r0, [r0] + cmp r0, 0 + bne _0803B142 + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, _0803B14C + strb r0, [r1] + ldrb r1, [r1] + movs r0, 0 + bl b_std_message + ldr r1, _0803B150 + ldr r0, _0803B154 + str r0, [r1] +_0803B142: + pop {r0} + bx r0 + .align 2, 0 +_0803B148: .4byte 0x02024068 +_0803B14C: .4byte 0x02024064 +_0803B150: .4byte 0x03005d04 +_0803B154: .4byte sub_803B180 + 1 + thumb_func_end bc_battle_begin_message + + thumb_func_start bc_8013568 +bc_8013568: @ 803B158 + push {lr} + ldr r0, _0803B174 + ldr r0, [r0] + cmp r0, 0 + bne _0803B170 + ldr r1, _0803B178 + ldr r0, _0803B17C + str r0, [r1] + movs r0, 0 + movs r1, 0 + bl b_std_message +_0803B170: + pop {r0} + bx r0 + .align 2, 0 +_0803B174: .4byte 0x02024068 +_0803B178: .4byte 0x03005d04 +_0803B17C: .4byte sub_803B3CC + 1 + thumb_func_end bc_8013568 + + thumb_func_start sub_803B180 +sub_803B180: @ 803B180 + push {lr} + ldr r0, _0803B1B0 + ldr r0, [r0] + cmp r0, 0 + bne _0803B1D0 + ldr r0, _0803B1B4 + 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 + .align 2, 0 +_0803B1B0: .4byte 0x02024068 +_0803B1B4: .4byte 0x02022fec +_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, _0803B1D4 + ldr r0, _0803B1D8 + str r0, [r1] +_0803B1D0: + pop {r0} + bx r0 + .align 2, 0 +_0803B1D4: .4byte 0x03005d04 +_0803B1D8: .4byte sub_803B25C + 1 + thumb_func_end sub_803B180 + + thumb_func_start sub_803B1DC +sub_803B1DC: @ 803B1DC + push {r4,r5,lr} + ldr r0, _0803B248 + 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, _0803B24C + movs r0, 0 + strb r0, [r1] + ldr r0, _0803B250 + 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, _0803B250 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B20E +_0803B23A: + ldr r1, _0803B254 + ldr r0, _0803B258 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803B248: .4byte 0x02022fec +_0803B24C: .4byte 0x02024064 +_0803B250: .4byte 0x0202406c +_0803B254: .4byte 0x03005d04 +_0803B258: .4byte bc_801362C + 1 + thumb_func_end sub_803B1DC + + thumb_func_start sub_803B25C +sub_803B25C: @ 803B25C + push {r4-r6,lr} + ldr r0, _0803B284 + 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 + .align 2, 0 +_0803B284: .4byte 0x02022fec +_0803B288: + ldr r1, _0803B290 + ldr r0, _0803B294 + b _0803B2F0 + .align 2, 0 +_0803B290: .4byte 0x03005d04 +_0803B294: .4byte sub_803B1DC + 1 +_0803B298: + movs r5, 0x1 +_0803B29A: + ldr r0, _0803B2F8 + ldr r2, [r0] + cmp r2, 0 + bne _0803B2F2 + ldr r0, _0803B2FC + strb r2, [r0] + ldr r1, _0803B300 + 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, _0803B304 + ldr r0, [r0] + ldr r1, _0803B308 + ands r0, r1 + cmp r0, 0 + bne _0803B288 +_0803B2D8: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldr r1, _0803B300 + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0803B2FC + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B2B2 +_0803B2EC: + ldr r1, _0803B30C + ldr r0, _0803B310 +_0803B2F0: + str r0, [r1] +_0803B2F2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803B2F8: .4byte 0x02024068 +_0803B2FC: .4byte 0x02024064 +_0803B300: .4byte 0x0202406c +_0803B304: .4byte 0x02022fec +_0803B308: .4byte 0x00008040 +_0803B30C: .4byte 0x03005d04 +_0803B310: .4byte bc_801362C + 1 + thumb_func_end sub_803B25C + + thumb_func_start bc_801362C +bc_801362C: @ 803B314 + push {r4-r7,lr} + ldr r0, _0803B38C + ldr r1, [r0] + cmp r1, 0 + bne _0803B384 + ldr r2, _0803B390 + strb r1, [r2] + ldr r0, _0803B394 + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B37E + adds r4, r2, 0 + ldr r6, _0803B398 + 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, _0803B39C + ldr r0, [r0] + ldr r1, _0803B3A0 + ands r0, r1 + cmp r0, 0 + bne _0803B36C + ldrb r0, [r4] + muls r0, r5 + adds r0, r6 + ldrh r0, [r0] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r5 + adds r1, r7 + ldr r2, [r1] + movs r1, 0x2 + bl sub_806F01C +_0803B36C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, _0803B394 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B334 +_0803B37E: + ldr r1, _0803B3A4 + ldr r0, _0803B3A8 + str r0, [r1] +_0803B384: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803B38C: .4byte 0x02024068 +_0803B390: .4byte 0x02024064 +_0803B394: .4byte 0x0202406c +_0803B398: .4byte 0x02024084 +_0803B39C: .4byte 0x02022fec +_0803B3A0: .4byte 0x063f0902 +_0803B3A4: .4byte 0x03005d04 +_0803B3A8: .4byte sub_803B3CC + 1 + thumb_func_end bc_801362C + + thumb_func_start sub_803B3AC +sub_803B3AC: @ 803B3AC + push {lr} + ldr r0, _0803B3C0 + ldr r0, [r0] + cmp r0, 0 + bne _0803B3BC + ldr r1, _0803B3C4 + ldr r0, _0803B3C8 + str r0, [r1] +_0803B3BC: + pop {r0} + bx r0 + .align 2, 0 +_0803B3C0: .4byte 0x02024068 +_0803B3C4: .4byte 0x03005d04 +_0803B3C8: .4byte sub_803B3CC + 1 + thumb_func_end sub_803B3AC + + thumb_func_start sub_803B3CC +sub_803B3CC: @ 803B3CC + push {lr} + ldr r0, _0803B41C + ldr r0, [r0] + cmp r0, 0 + bne _0803B418 + ldr r1, _0803B420 + 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, _0803B424 + ldr r0, _0803B428 + str r0, [r1] +_0803B418: + pop {r0} + bx r0 + .align 2, 0 +_0803B41C: .4byte 0x02024068 +_0803B420: .4byte 0x02022fec +_0803B424: .4byte 0x03005d04 +_0803B428: .4byte sub_803B4C8 + 1 + thumb_func_end sub_803B3CC + + thumb_func_start sub_803B42C +sub_803B42C: @ 803B42C + push {r4,r5,lr} + ldr r0, _0803B4B0 + 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, _0803B4B4 + movs r0, 0 + strb r0, [r1] + ldr r0, _0803B4B8 + 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, _0803B4B8 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B45E +_0803B48A: + ldr r2, _0803B4BC + 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, _0803B4C0 + ldr r0, _0803B4C4 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803B4B0: .4byte 0x02022fec +_0803B4B4: .4byte 0x02024064 +_0803B4B8: .4byte 0x0202406c +_0803B4BC: .4byte 0x0202449c +_0803B4C0: .4byte 0x03005d04 +_0803B4C4: .4byte sub_803B628 + 1 + thumb_func_end sub_803B42C + + thumb_func_start sub_803B4C8 +sub_803B4C8: @ 803B4C8 + push {r4-r6,lr} + ldr r0, _0803B4EC + 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 + .align 2, 0 +_0803B4EC: .4byte 0x02022fec +_0803B4F0: + ldr r1, _0803B4F8 + ldr r0, _0803B4FC + b _0803B572 + .align 2, 0 +_0803B4F8: .4byte 0x03005d04 +_0803B4FC: .4byte sub_803B42C + 1 +_0803B500: + movs r6, 0 +_0803B502: + ldr r0, _0803B57C + ldr r2, [r0] + cmp r2, 0 + bne _0803B574 + ldr r0, _0803B580 + strb r2, [r0] + ldr r1, _0803B584 + 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, _0803B588 + 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, _0803B584 + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0803B580 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B51A +_0803B554: + ldr r2, _0803B58C + 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, _0803B590 + ldr r0, _0803B594 +_0803B572: + str r0, [r1] +_0803B574: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803B57C: .4byte 0x02024068 +_0803B580: .4byte 0x02024064 +_0803B584: .4byte 0x0202406c +_0803B588: .4byte 0x02022fec +_0803B58C: .4byte 0x0202449c +_0803B590: .4byte 0x03005d04 +_0803B594: .4byte sub_803B628 + 1 + thumb_func_end sub_803B4C8 + + thumb_func_start sub_803B598 +sub_803B598: @ 803B598 + push {r4,r5,lr} + ldr r0, _0803B60C + ldr r1, [r0] + cmp r1, 0 + bne _0803B606 + ldr r2, _0803B610 + strb r1, [r2] + ldr r0, _0803B614 + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B5E6 + adds r4, r2, 0 + ldr r5, _0803B618 +_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, _0803B614 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B5B2 +_0803B5E6: + ldr r2, _0803B61C + 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, _0803B620 + ldr r0, _0803B624 + str r0, [r1] +_0803B606: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803B60C: .4byte 0x02024068 +_0803B610: .4byte 0x02024064 +_0803B614: .4byte 0x0202406c +_0803B618: .4byte 0x0202406e +_0803B61C: .4byte 0x0202449c +_0803B620: .4byte 0x03005d04 +_0803B624: .4byte sub_803B628 + 1 + 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, _0803B66C + ldr r0, [r0] + cmp r0, 0 + beq _0803B642 + b _0803B8B2 +_0803B642: + ldr r0, _0803B670 + ldr r0, [r0] + adds r0, 0x4C + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6C2 + movs r5, 0 + ldr r1, _0803B674 + mov r10, r1 + ldrb r3, [r1] + cmp r5, r3 + bge _0803B668 + ldr r2, _0803B678 +_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 + .align 2, 0 +_0803B66C: .4byte 0x02024068 +_0803B670: .4byte 0x0202449c +_0803B674: .4byte 0x0202406c +_0803B678: .4byte 0x0202407e +_0803B67C: + adds r4, r5, 0x1 + mov r8, r4 + ldrb r1, [r1] + cmp r8, r1 + bge _0803B6B6 + ldr r6, _0803B6F0 + ldr r1, _0803B6F4 + 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, _0803B6F4 + 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, _0803B6F8 + 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 + .align 2, 0 +_0803B6F0: .4byte 0x0202407e +_0803B6F4: .4byte 0x0202406c +_0803B6F8: .4byte 0x0202449c +_0803B6FC: + ldr r2, _0803B8C4 + ldr r0, [r2] + adds r0, 0x4C + ldr r1, _0803B8C8 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B756 + ldr r5, _0803B8CC + 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, _0803B8C8 + 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, _0803B8C4 + ldr r0, [r2] + adds r0, 0xD9 + ldr r1, _0803B8C8 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B7DA + ldr r5, _0803B8CC + 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, _0803B8C8 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B79A +_0803B7DA: + movs r5, 0 + ldr r1, _0803B8C4 + mov r8, r1 + movs r7, 0x6 + ldr r6, _0803B8D0 + ldr r2, _0803B8D4 + 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, _0803B8C4 + ldr r0, [r0] + adds r0, 0x91 + ldr r1, _0803B8D8 + ldrb r1, [r1] + strb r1, [r0] + ldr r0, _0803B8DC + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0803B8E0 + ldr r0, _0803B8E4 + str r0, [r1] + bl sub_803F988 + ldr r1, _0803B8E8 + movs r2, 0 + adds r0, r1, 0x7 +_0803B834: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B834 + movs r5, 0 + ldr r3, _0803B8C8 + ldr r2, _0803B8C4 + ldr r6, _0803B8EC + ldr r7, _0803B8F0 + ldrb r0, [r3] + cmp r5, r0 + bge _0803B866 + ldr r0, _0803B8F4 + 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, _0803B8F8 + strh r0, [r1] + ldr r0, _0803B8FC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803B8B2 + bl sub_80A369C + ldr r0, _0803B900 + 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 + .align 2, 0 +_0803B8C4: .4byte 0x0202449c +_0803B8C8: .4byte 0x0202406c +_0803B8CC: .4byte 0x0202407e +_0803B8D0: .4byte 0x0202421c +_0803B8D4: .4byte 0x02024274 +_0803B8D8: .4byte 0x02024210 +_0803B8DC: .4byte 0x085cc23e +_0803B8E0: .4byte 0x03005d04 +_0803B8E4: .4byte sub_803BE74 + 1 +_0803B8E8: .4byte 0x02024332 +_0803B8EC: .4byte 0x02024474 +_0803B8F0: .4byte 0x0202427c +_0803B8F4: .4byte 0x02024084 +_0803B8F8: .4byte 0x02024330 +_0803B8FC: .4byte 0x02022fec +_0803B900: .4byte 0x082db8be + thumb_func_end sub_803B628 + + thumb_func_start bc_8013B1C +bc_8013B1C: @ 803B904 + push {r4-r6,lr} + ldr r0, _0803B99C + ldr r0, [r0] + cmp r0, 0 + bne _0803B994 + ldr r1, _0803B9A0 + ldr r0, _0803B9A4 + str r0, [r1] + ldr r3, _0803B9A8 + ldr r1, _0803B9AC + 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, _0803B9B0 + 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, _0803B9A8 + ldrb r0, [r0] + cmp r4, r0 + blt _0803B932 +_0803B96E: + ldr r2, _0803B9B4 + 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, _0803B9B8 + strb r1, [r0] +_0803B994: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803B99C: .4byte 0x02024068 +_0803B9A0: .4byte 0x03005d04 +_0803B9A4: .4byte sub_803B9BC + 1 +_0803B9A8: .4byte 0x0202406c +_0803B9AC: .4byte 0x02024332 +_0803B9B0: .4byte 0x02024084 +_0803B9B4: .4byte 0x0202449c +_0803B9B8: .4byte 0x0202427c + 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, _0803BA60 + 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, _0803BA64 + 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, _0803BA68 + ldr r0, [r2] + ldr r1, _0803BA6C + ands r0, r1 + ldr r1, _0803BA70 + ands r0, r1 + ldr r1, _0803BA74 + ands r0, r1 + ldr r1, _0803BA78 + ands r0, r1 + str r0, [r2] + ldr r0, _0803BA7C + strb r4, [r0, 0x18] + strb r4, [r0, 0x19] + strb r4, [r0, 0x14] + ldr r0, _0803BA80 + str r4, [r0] + ldr r0, _0803BA84 + strb r4, [r0] + ldr r1, _0803BA88 + movs r2, 0 + adds r0, r1, 0x4 +_0803BA40: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803BA40 + ldr r0, _0803BA60 + ldrb r0, [r0] + cmp r0, 0 + beq _0803BA98 + ldr r1, _0803BA8C + movs r0, 0xC + strb r0, [r1] + ldr r1, _0803BA90 + ldr r0, _0803BA94 + str r0, [r1] + b _0803BB78 + .align 2, 0 +_0803BA60: .4byte 0x0202433a +_0803BA64: .4byte 0x0202449c +_0803BA68: .4byte 0x02024280 +_0803BA6C: .4byte 0xfffffdff +_0803BA70: .4byte 0xfff7ffff +_0803BA74: .4byte 0xffbfffff +_0803BA78: .4byte 0xffefffff +_0803BA7C: .4byte 0x02024474 +_0803BA80: .4byte 0x020241f0 +_0803BA84: .4byte 0x0202427c +_0803BA88: .4byte 0x02024332 +_0803BA8C: .4byte 0x02024083 +_0803BA90: .4byte 0x03005d04 +_0803BA94: .4byte bc_bs_exec + 1 +_0803BA98: + ldr r1, _0803BB2C + ldrb r0, [r1, 0x13] + ldr r2, _0803BB30 + 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, _0803BB34 + ldr r0, _0803BB38 + mov r12, r0 + ldr r1, _0803BB3C + mov r9, r1 + ldrb r0, [r4] + cmp r2, r0 + bge _0803BAE0 + ldr r7, _0803BB40 + movs r6, 0xFF + movs r5, 0 + ldr r3, _0803BB44 +_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, _0803BB30 + 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, _0803BB48 + ldr r0, _0803BB4C + str r0, [r1] + bl GenerateRandomNumber + ldr r1, _0803BB50 + strh r0, [r1] + ldr r0, _0803BB54 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + beq _0803BB5C + ldr r0, _0803BB58 + bl b_call_bc_move_exec + b _0803BB78 + .align 2, 0 +_0803BB2C: .4byte 0x03005d10 +_0803BB30: .4byte 0x0202449c +_0803BB34: .4byte 0x0202406c +_0803BB38: .4byte 0x02024210 +_0803BB3C: .4byte 0x085cc23e +_0803BB40: .4byte 0x0202421c +_0803BB44: .4byte 0x02024274 +_0803BB48: .4byte 0x03005d04 +_0803BB4C: .4byte sub_803BE74 + 1 +_0803BB50: .4byte 0x02024330 +_0803BB54: .4byte 0x02022fec +_0803BB58: .4byte 0x082db881 +_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, _0803BB84 + bl b_call_bc_move_exec +_0803BB78: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803BB84: .4byte 0x082db8be + thumb_func_end sub_803B9BC + + thumb_func_start sub_803BB88 +sub_803BB88: @ 803BB88 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _0803BBAC + ldr r0, _0803BBB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803BBB8 + ldr r1, _0803BBB4 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x7] + b _0803BBC2 + .align 2, 0 +_0803BBAC: .4byte 0x02024084 +_0803BBB0: .4byte 0x02024064 +_0803BBB4: .4byte 0x02024404 +_0803BBB8: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r2, r0, 24 +_0803BBC2: + ldr r1, _0803BCD8 + ldr r3, _0803BCDC + ldrb r0, [r3] + strb r0, [r1] + cmp r2, 0x25 + bne _0803BBD0 + b _0803BD4C +_0803BBD0: + ldr r0, _0803BCE0 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803BBDE + b _0803BD4C +_0803BBDE: + ldr r1, _0803BCE4 + 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, _0803BCE8 + 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, _0803BCE4 + 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, _0803BCE4 + ldr r0, _0803BCDC + 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, _0803BCE8 + ldrb r0, [r0] + cmp r5, r0 + blt _0803BC08 +_0803BC86: + ldr r4, _0803BCDC + 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, _0803BCE4 + 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, _0803BCEC + subs r1, r5, 0x1 + strb r1, [r0, 0x17] + ldr r2, _0803BCF0 + adds r0, r1, 0 + muls r0, r3 + adds r0, r6 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, _0803BCF4 + movs r0, 0x2 + b _0803BD90 + .align 2, 0 +_0803BCD8: .4byte 0x0202420f +_0803BCDC: .4byte 0x02024064 +_0803BCE0: .4byte 0x02022fec +_0803BCE4: .4byte 0x02024084 +_0803BCE8: .4byte 0x0202406c +_0803BCEC: .4byte 0x02024474 +_0803BCF0: .4byte 0x0202420a +_0803BCF4: .4byte 0x02024332 +_0803BCF8: + ldr r1, _0803BD2C + ldr r0, _0803BD30 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0803BD34 + ands r0, r1 + cmp r0, 0 + bne _0803BD22 + ldr r1, _0803BD38 + 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, _0803BD3C + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0x1 + b _0803BD92 + .align 2, 0 +_0803BD2C: .4byte 0x02024084 +_0803BD30: .4byte 0x02024064 +_0803BD34: .4byte 0x0400e000 +_0803BD38: .4byte 0x020242ac +_0803BD3C: .4byte 0x02024332 +_0803BD40: + ldr r0, _0803BD50 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0803BD8C +_0803BD4C: + movs r0, 0 + b _0803BD92 + .align 2, 0 +_0803BD50: .4byte 0x02022fec +_0803BD54: + ldr r0, _0803BD64 + strb r5, [r0, 0x17] + ldr r1, _0803BD68 + ldrb r0, [r2] + strb r0, [r1] + ldr r1, _0803BD6C + movs r0, 0x2 + b _0803BD90 + .align 2, 0 +_0803BD64: .4byte 0x02024474 +_0803BD68: .4byte 0x0202420a +_0803BD6C: .4byte 0x02024332 +_0803BD70: + ldr r0, _0803BD80 + strb r5, [r0, 0x17] + ldr r1, _0803BD84 + ldrb r0, [r2] + strb r0, [r1] + ldr r1, _0803BD88 + movs r0, 0x2 + b _0803BD90 + .align 2, 0 +_0803BD80: .4byte 0x02024474 +_0803BD84: .4byte 0x0202420a +_0803BD88: .4byte 0x02024332 +_0803BD8C: + ldr r1, _0803BD9C + movs r0, 0x1 +_0803BD90: + strb r0, [r1, 0x5] +_0803BD92: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803BD9C: .4byte 0x02024332 + 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, _0803BE3C + mov r8, r0 + ldr r1, _0803BE40 + mov r12, r1 + ldr r7, _0803BE44 + 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, _0803BE44 + 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, _0803BE48 + 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, _0803BE40 + 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 + .align 2, 0 +_0803BE3C: .4byte 0x0202406e +_0803BE40: .4byte 0x0203cf00 +_0803BE44: .4byte 0x0202449c +_0803BE48: .4byte 0x02022fec +_0803BE4C: + movs r3, 0 + adds r2, r6, r5 + ldr r4, _0803BE70 +_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 + .align 2, 0 +_0803BE70: .4byte 0x0203cf00 + 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, _0803BE90 + movs r1, 0 + strb r1, [r0, 0x4] + ldr r0, _0803BE94 + strb r1, [r0] + ldr r0, _0803BE98 + bl _0803CD12 + .align 2, 0 +_0803BE90: .4byte 0x02024332 +_0803BE94: .4byte 0x02024064 +_0803BE98: .4byte 0x0202406c +_0803BE9C: + ldr r4, _0803BEC4 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0803BEC8 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _0803BEB8 + bl _0803CD04 +_0803BEB8: + lsls r0, 2 + ldr r1, _0803BECC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803BEC4: .4byte 0x02024064 +_0803BEC8: .4byte 0x02024332 +_0803BECC: .4byte _0803BED0 + .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, _0803BF04 + ldr r0, _0803BF08 + ldrb r0, [r0] + adds r0, r1 + bl _0803CC20 + .align 2, 0 +_0803BF04: .4byte 0x02024332 +_0803BF08: .4byte 0x02024064 +_0803BF0C: + ldr r0, _0803BFA4 + ldrb r1, [r0] + ldr r4, _0803BFA8 + ldr r0, [r4] + adds r1, r0 + adds r1, 0x5C + movs r0, 0x6 + strb r0, [r1] + ldr r0, _0803BFAC + 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, _0803BFB0 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803BF68 + ldr r4, _0803BFB4 + 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, _0803BFA8 + ldr r0, [r0] + adds r0, 0x91 + ldrb r3, [r0] + ldr r1, _0803BFB0 + ldr r4, _0803BFA4 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + beq _0803BFD0 + ldr r0, _0803BFB8 + adds r0, r2, r0 + movs r1, 0xD + strb r1, [r0] + ldr r0, _0803BFAC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BFBC + ldr r0, _0803BFB4 + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x5 + strb r0, [r1] + bl _0803CD04 + .align 2, 0 +_0803BFA4: .4byte 0x02024064 +_0803BFA8: .4byte 0x0202449c +_0803BFAC: .4byte 0x02022fec +_0803BFB0: .4byte 0x0832a328 +_0803BFB4: .4byte 0x02024332 +_0803BFB8: .4byte 0x0202421c +_0803BFBC: + ldr r0, _0803BFCC + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + bl _0803CD04 + .align 2, 0 +_0803BFCC: .4byte 0x02024332 +_0803BFD0: + ldr r1, _0803C000 + 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, _0803C004 + adds r0, r2, r0 + strb r3, [r0] + ldr r1, _0803C008 + ldrb r0, [r4] + bl _0803CC72 + .align 2, 0 +_0803C000: .4byte 0x02024084 +_0803C004: .4byte 0x0202421c +_0803C008: .4byte 0x02024332 +_0803C00C: + ldr r0, _0803C024 + ldrb r1, [r0] + ldr r0, _0803C028 + 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 + .align 2, 0 +_0803C024: .4byte 0x0202421c +_0803C028: .4byte 0x02023864 +_0803C02C: + ldr r3, _0803C090 + ldr r1, _0803C094 + ldr r6, _0803C098 + 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, _0803C09C + lsls r0, r5, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8184FBC + ldr r1, _0803C0A0 + 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, _0803C0A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803C090: .4byte 0x02024068 +_0803C094: .4byte 0x0832a328 +_0803C098: .4byte 0x02024064 +_0803C09C: .4byte 0x02023864 +_0803C0A0: .4byte 0x0202421c +_0803C0A4: .4byte _0803C0A8 + .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, _0803C124 + ldr r3, _0803C128 + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, _0803C12C + 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, _0803C130 + lsls r1, 9 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2, 0xC] + bl _0803CD70 + .align 2, 0 +_0803C124: .4byte 0x02024332 +_0803C128: .4byte 0x02024064 +_0803C12C: .4byte 0x0202449c +_0803C130: .4byte 0x02023864 +_0803C134: + ldr r3, _0803C174 + ldr r5, _0803C178 + 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, _0803C17C + lsls r0, r4, 1 + adds r0, r1 + strh r2, [r0] + ldrb r2, [r5] + ldr r0, _0803C180 + 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, _0803C184 + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + bl _0803CD70 + .align 2, 0 +_0803C174: .4byte 0x020242bc +_0803C178: .4byte 0x02024064 +_0803C17C: .4byte 0x02024274 +_0803C180: .4byte 0x0202449c +_0803C184: .4byte 0x02024332 +_0803C188: + add r2, sp, 0x4 + ldr r3, _0803C228 + 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 move_get_pp_info + mov r2, r10 + adds r1, r2, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0803C1CA + ldr r0, _0803C22C + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + movs r0, 0 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8033E30 + b _0803C42E + .align 2, 0 +_0803C228: .4byte 0x02024084 +_0803C22C: .4byte 0x02022fec +_0803C230: + ldr r0, _0803C254 + ldr r0, [r0] + ldr r1, _0803C258 + ands r0, r1 + cmp r0, 0 + bne _0803C23E + b _0803C48C +_0803C23E: + ldr r4, _0803C25C + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8185008 + ldr r1, _0803C260 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803C264 + b _0803C784 + .align 2, 0 +_0803C254: .4byte 0x02022fec +_0803C258: .4byte 0x021f0902 +_0803C25C: .4byte 0x02024064 +_0803C260: .4byte 0x02024220 +_0803C264: .4byte 0x082db879 +_0803C268: + ldr r5, _0803C2D0 + ldrb r0, [r5] + ldr r3, _0803C2D4 + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, _0803C2D8 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r7, _0803C2DC + 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, _0803C2E0 + ands r1, r0 + cmp r1, 0 + bne _0803C2B8 + ldr r0, _0803C2E4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _0803C2B8 + ldr r0, _0803C2E8 + 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, _0803C2D0 + 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 + .align 2, 0 +_0803C2D0: .4byte 0x02024064 +_0803C2D4: .4byte 0x0202449c +_0803C2D8: .4byte 0x0202406e +_0803C2DC: .4byte 0x02024084 +_0803C2E0: .4byte 0x0400e000 +_0803C2E4: .4byte 0x02022fec +_0803C2E8: .4byte 0x020242ac +_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, _0803C3A0 + 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, _0803C3A4 + 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, _0803C3A8 + ldrb r3, [r0] + ldr r4, _0803C3AC + ldr r0, _0803C3A0 + 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 + .align 2, 0 +_0803C3A0: .4byte 0x02024064 +_0803C3A4: .4byte 0x02024084 +_0803C3A8: .4byte 0x0202420a +_0803C3AC: .4byte 0x0202449c +_0803C3B0: + ldr r0, _0803C3CC + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _0803C3D8 + ldr r0, _0803C3D0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C3D8 + ldr r0, _0803C3D4 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5C + b _0803C3EE + .align 2, 0 +_0803C3CC: .4byte 0x02024064 +_0803C3D0: .4byte 0x0202421c +_0803C3D4: .4byte 0x0202449c +_0803C3D8: + ldrb r0, [r4] + cmp r0, 0x3 + bne _0803C410 + ldr r0, _0803C408 + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0803C410 + ldr r0, _0803C40C + 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 + .align 2, 0 +_0803C408: .4byte 0x0202421c +_0803C40C: .4byte 0x0202449c +_0803C410: + ldr r2, _0803C438 + ldr r0, _0803C43C + 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, _0803C43C + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .align 2, 0 +_0803C438: .4byte 0x0202449c +_0803C43C: .4byte 0x02024064 +_0803C440: + bl sub_806B8B0 + lsls r0, 24 + cmp r0, 0 + bne _0803C44C + b _0803C6C4 +_0803C44C: + ldr r1, _0803C478 + ldr r3, _0803C47C + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803C480 + str r1, [r0] + ldr r0, _0803C484 + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, _0803C488 + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + b _0803C7A0 + .align 2, 0 +_0803C478: .4byte 0x02024220 +_0803C47C: .4byte 0x02024064 +_0803C480: .4byte 0x082dab11 +_0803C484: .4byte 0x02024332 +_0803C488: .4byte 0x0202449c +_0803C48C: + ldr r2, _0803C4AC + ldr r4, _0803C4B0 + 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 + .align 2, 0 +_0803C4AC: .4byte 0x0202449c +_0803C4B0: .4byte 0x02024064 +_0803C4B4: + ldr r4, _0803C544 + ldr r5, _0803C548 + 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, _0803C54C + 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 + .align 2, 0 +_0803C544: .4byte 0x02024332 +_0803C548: .4byte 0x02024064 +_0803C54C: .4byte 0x02024084 +_0803C550: + ldr r4, _0803C58C + 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 + .align 2, 0 +_0803C58C: .4byte 0x0202421c +_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, _0803C620 + 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, _0803C624 + 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 + .align 2, 0 +_0803C620: .4byte 0x0202433c +_0803C624: .4byte 0x020242bc +_0803C628: + ldr r0, _0803C67C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803C690 + ldr r4, _0803C680 + ldr r6, _0803C684 + 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, _0803C688 + ldr r0, _0803C68C + 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 + .align 2, 0 +_0803C67C: .4byte 0x02022fec +_0803C680: .4byte 0x0202421c +_0803C684: .4byte 0x02024064 +_0803C688: .4byte 0x03005d80 +_0803C68C: .4byte 0x0203bd30 +_0803C690: + ldr r0, _0803C6C0 + 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, _0803C6C0 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803CD70 + .align 2, 0 +_0803C6C0: .4byte 0x02024064 +_0803C6C4: + ldr r1, _0803C704 + ldr r2, [r1] + movs r5, 0x8 + adds r0, r2, 0 + ands r0, r5 + adds r3, r1, 0 + cmp r0, 0 + beq _0803C720 + ldr r0, _0803C708 + ands r2, r0 + cmp r2, 0 + beq _0803C720 + ldr r0, _0803C70C + ldr r4, _0803C710 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C720 + ldr r1, _0803C714 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, _0803C718 + str r1, [r0] + ldr r1, _0803C71C + ldrb r0, [r4] + adds r0, r1 + movs r3, 0 + strb r5, [r0] + b _0803C792 + .align 2, 0 +_0803C704: .4byte 0x02022fec +_0803C708: .4byte 0x043f0100 +_0803C70C: .4byte 0x02023864 +_0803C710: .4byte 0x02024064 +_0803C714: .4byte 0x02024220 +_0803C718: .4byte 0x082db9ba +_0803C71C: .4byte 0x02024332 +_0803C720: + ldr r0, [r3] + ldr r1, _0803C74C + ands r0, r1 + cmp r0, 0x8 + bne _0803C760 + ldr r0, _0803C750 + ldr r4, _0803C754 + ldrb r1, [r4] + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C760 + ldr r0, _0803C758 + bl b_call_bc_move_exec + ldr r1, _0803C75C + ldrb r0, [r4] + adds r0, r1 + b _0803CC20 + .align 2, 0 +_0803C74C: .4byte 0x0200000a +_0803C750: .4byte 0x02023864 +_0803C754: .4byte 0x02024064 +_0803C758: .4byte 0x082daafe +_0803C75C: .4byte 0x02024332 +_0803C760: + bl sub_803BB88 + lsls r0, 24 + cmp r0, 0 + beq _0803C7C4 + ldr r0, _0803C7AC + ldr r4, _0803C7B0 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C7C4 + ldr r1, _0803C7B4 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, _0803C7B8 +_0803C784: + str r1, [r0] + ldr r0, _0803C7BC + ldrb r1, [r4] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] +_0803C792: + ldrb r1, [r4] + ldr r2, _0803C7C0 + 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 + .align 2, 0 +_0803C7AC: .4byte 0x02023864 +_0803C7B0: .4byte 0x02024064 +_0803C7B4: .4byte 0x02024220 +_0803C7B8: .4byte 0x082dab0b +_0803C7BC: .4byte 0x02024332 +_0803C7C0: .4byte 0x0202449c +_0803C7C4: + ldr r2, _0803C7D0 + ldr r0, _0803C7D4 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803C7D0: .4byte 0x02024332 +_0803C7D4: .4byte 0x02024064 +_0803C7D8: + ldr r4, _0803C81C + ldr r1, _0803C820 + ldr r3, _0803C824 + 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, _0803C828 + adds r0, r5, r1 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x9 + bls _0803C812 + b _0803CD04 +_0803C812: + lsls r0, 2 + ldr r1, _0803C82C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803C81C: .4byte 0x02024068 +_0803C820: .4byte 0x0832a328 +_0803C824: .4byte 0x02024064 +_0803C828: .4byte 0x0202421c +_0803C82C: .4byte _0803C830 + .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, _0803C874 + 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 + .align 2, 0 +_0803C874: .4byte 0x02023864 +_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, _0803C8C0 + ldr r6, _0803C8C4 + 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, _0803C8C8 + cmp r2, r0 + bne _0803C8D0 + ldr r0, _0803C8CC + adds r0, r3, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r6] + bl sub_8185008 + b _0803CD04 + .align 2, 0 +_0803C8C0: .4byte 0x02023864 +_0803C8C4: .4byte 0x02024064 +_0803C8C8: .4byte 0x0000ffff +_0803C8CC: .4byte 0x02024332 +_0803C8D0: + bl sub_803FB4C + lsls r0, 24 + cmp r0, 0 + beq _0803C91C + ldrb r0, [r6] + movs r1, 0x1 + bl sub_8185008 + ldr r0, _0803C914 + ldrb r1, [r6] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r6] + ldr r2, _0803C918 + 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 + .align 2, 0 +_0803C914: .4byte 0x02024332 +_0803C918: .4byte 0x0202449c +_0803C91C: + ldr r0, _0803C988 + 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, _0803C98C + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x80 + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, _0803C990 + ldrb r2, [r6] + lsls r5, r2, 1 + adds r5, r0 + ldr r3, _0803C994 + 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, _0803C998 + ldrb r1, [r6] + b _0803CB72 + .align 2, 0 +_0803C988: .4byte 0x02022fec +_0803C98C: .4byte 0x0202449c +_0803C990: .4byte 0x02024274 +_0803C994: .4byte 0x02024084 +_0803C998: .4byte 0x02024332 +_0803C99C: + ldr r2, _0803C9C4 + ldr r5, _0803C9C8 + 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, _0803C9CC + strh r3, [r0] + ldr r0, _0803C9D0 + ldrb r1, [r5] + b _0803CB72 + .align 2, 0 +_0803C9C4: .4byte 0x02023864 +_0803C9C8: .4byte 0x02024064 +_0803C9CC: .4byte 0x02024208 +_0803C9D0: .4byte 0x02024332 +_0803C9D4: + ldr r0, _0803C9F8 + ldr r4, _0803C9FC + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x6 + bne _0803CA04 + ldr r0, _0803CA00 + adds r0, r2, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r4] + bl sub_8185008 + b _0803CD04 + .align 2, 0 +_0803C9F8: .4byte 0x02023864 +_0803C9FC: .4byte 0x02024064 +_0803CA00: .4byte 0x02024332 +_0803CA04: + bl sub_803CDF8 + b _0803CB6E +_0803CA0A: + ldr r2, _0803CA20 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, _0803CA24 + ldr r0, _0803CA28 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803CA20: .4byte 0x02024280 +_0803CA24: .4byte 0x02024332 +_0803CA28: .4byte 0x02024064 +_0803CA2C: + ldr r2, _0803CA38 + ldr r0, _0803CA3C + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803CA38: .4byte 0x02024332 +_0803CA3C: .4byte 0x02024064 +_0803CA40: + ldr r2, _0803CA4C + ldr r0, _0803CA50 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803CA4C: .4byte 0x02024332 +_0803CA50: .4byte 0x02024064 +_0803CA54: + ldr r3, _0803CA78 + ldr r0, _0803CA7C + 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, _0803CA80 + adds r1, r4, r1 + b _0803CB74 + .align 2, 0 +_0803CA78: .4byte 0x02023864 +_0803CA7C: .4byte 0x02024064 +_0803CA80: .4byte 0x02024332 +_0803CA84: + ldr r2, _0803CA90 + ldr r0, _0803CA94 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803CA90: .4byte 0x02024332 +_0803CA94: .4byte 0x02024064 +_0803CA98: + ldr r2, _0803CAB0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, _0803CAB4 + ldr r0, _0803CAB8 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803CAB0: .4byte 0x02024280 +_0803CAB4: .4byte 0x02024332 +_0803CAB8: .4byte 0x02024064 +_0803CABC: + ldr r2, _0803CAC8 + ldr r0, _0803CACC + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .align 2, 0 +_0803CAC8: .4byte 0x02024332 +_0803CACC: .4byte 0x02024064 +_0803CAD0: + ldr r3, _0803CB48 + ldr r6, _0803CB4C + ldr r0, _0803CB50 + 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, _0803CB54 + 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, _0803CB58 + 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 + .align 2, 0 +_0803CB48: .4byte 0x02024068 +_0803CB4C: .4byte 0x0832a328 +_0803CB50: .4byte 0x02024064 +_0803CB54: .4byte 0x02022fec +_0803CB58: .4byte 0x0202449c +_0803CB5C: + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8034464 +_0803CB66: + ldr r4, _0803CB7C +_0803CB68: + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803CB6E: + ldr r0, _0803CB80 + ldrb r1, [r4] +_0803CB72: + adds r1, r0 +_0803CB74: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0803CD04 + .align 2, 0 +_0803CB7C: .4byte 0x02024064 +_0803CB80: .4byte 0x02024332 +_0803CB84: + ldr r3, _0803CBB8 + ldr r1, _0803CBBC + ldr r0, _0803CBC0 + 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, _0803CBC4 + ldrb r0, [r1, 0x4] + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0803CD04 + .align 2, 0 +_0803CBB8: .4byte 0x02024068 +_0803CBBC: .4byte 0x0832a328 +_0803CBC0: .4byte 0x02024064 +_0803CBC4: .4byte 0x02024332 +_0803CBC8: + ldr r5, _0803CBE8 + ldrb r2, [r5] + ldr r0, _0803CBEC + ldr r0, [r0] + adds r1, r2, r0 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, _0803CBF0 + adds r0, r2, r0 + adds r1, 0x84 + ldrb r1, [r1] + strb r1, [r0] + b _0803CD04 + .align 2, 0 +_0803CBE8: .4byte 0x02024064 +_0803CBEC: .4byte 0x0202449c +_0803CBF0: .4byte 0x02024332 +_0803CBF4: + ldr r3, _0803CC28 + ldr r1, _0803CC2C + ldr r0, _0803CC30 + 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, _0803CC34 + adds r0, r4, r0 +_0803CC20: + movs r1, 0x1 + strb r1, [r0] + b _0803CD04 + .align 2, 0 +_0803CC28: .4byte 0x02024068 +_0803CC2C: .4byte 0x0832a328 +_0803CC30: .4byte 0x02024064 +_0803CC34: .4byte 0x02024332 +_0803CC38: + ldr r5, _0803CC7C + ldrb r2, [r5] + ldr r4, _0803CC80 + ldr r0, [r4] + adds r0, r2, r0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, _0803CC84 + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xD + bne _0803CC94 + ldr r2, _0803CC88 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r1, _0803CC8C + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r1, _0803CC90 + ldrb r0, [r5] +_0803CC72: + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0803CD04 + .align 2, 0 +_0803CC7C: .4byte 0x02024064 +_0803CC80: .4byte 0x0202449c +_0803CC84: .4byte 0x02023864 +_0803CC88: .4byte 0x02024280 +_0803CC8C: .4byte 0x0202421c +_0803CC90: .4byte 0x02024332 +_0803CC94: + adds r0, r2, 0 + movs r1, 0x1 + bl sub_8185008 + ldr r2, _0803CCB0 + ldrb r0, [r5] + adds r2, r0, r2 + ldr r1, [r4] + adds r0, r1 + adds r0, 0x84 + ldrb r0, [r0] + strb r0, [r2] + b _0803CD04 + .align 2, 0 +_0803CCB0: .4byte 0x02024332 +_0803CCB4: + ldr r0, _0803CD80 + strb r2, [r0] + ldr r7, _0803CD84 + ldr r6, _0803CD88 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r4, [r0] + str r4, [r7] + ldr r3, _0803CD8C + ldr r1, _0803CD90 + 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, _0803CD94 + 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, _0803CD98 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, _0803CD9C + lsls r1, 24 + lsrs r1, 24 +_0803CD12: + adds r5, r0, 0 + ldrb r0, [r5] + cmp r1, r0 + bcs _0803CD1E + bl _0803BE9C +_0803CD1E: + ldr r0, _0803CDA0 + ldrb r0, [r0, 0x4] + ldrb r1, [r5] + cmp r0, r1 + bne _0803CD70 + movs r0, 0x1 + bl sub_818603C + ldr r1, _0803CDA4 + ldr r0, _0803CDA8 + str r0, [r1] + ldr r0, _0803CDAC + 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, _0803CDB0 + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803CD66 + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, _0803CDB4 + ldr r1, [r1] + adds r1, r4, r1 + adds r1, 0x5C + ldrb r1, [r1] + bl sub_80571DC +_0803CD66: + adds r4, 0x1 + ldr r0, _0803CD9C + 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 + .align 2, 0 +_0803CD80: .4byte 0x0202420b +_0803CD84: .4byte 0x02024214 +_0803CD88: .4byte 0x02024220 +_0803CD8C: .4byte 0x02024068 +_0803CD90: .4byte 0x0832a328 +_0803CD94: .4byte 0x0831bd10 +_0803CD98: .4byte 0x02024064 +_0803CD9C: .4byte 0x0202406c +_0803CDA0: .4byte 0x02024332 +_0803CDA4: .4byte 0x03005d04 +_0803CDA8: .4byte sub_803D2E8 + 1 +_0803CDAC: .4byte 0x02022fec +_0803CDB0: .4byte 0x0202421c +_0803CDB4: .4byte 0x0202449c + 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, _0803CDE8 + ldrb r2, [r0] + adds r5, r0, 0 + cmp r3, r2 + bge _0803CDDA + ldr r4, _0803CDEC +_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 + .align 2, 0 +_0803CDE8: .4byte 0x0202406c +_0803CDEC: .4byte 0x02024332 +_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, _0803CECC + ldrb r0, [r7] + ldr r6, _0803CED0 + ldr r1, [r6] + adds r1, r0, r1 + adds r1, 0x5C + ldr r4, _0803CED4 + 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, _0803CED8 + 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 + .align 2, 0 +_0803CECC: .4byte 0x02024064 +_0803CED0: .4byte 0x0202449c +_0803CED4: .4byte 0x02023864 +_0803CED8: .4byte 0x02022fec + 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, _0803CF08 + adds r4, r0, r2 + ldrb r5, [r4] + adds r2, r1, r2 + ldrb r3, [r2] + strb r3, [r4] + strb r5, [r2] + ldr r2, _0803CF0C + 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 + .align 2, 0 +_0803CF08: .4byte 0x0202407a +_0803CF0C: .4byte 0x0202407e + 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, _0803CF90 + 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, _0803CF94 + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CF8C +_0803CF7C: + cmp r3, 0x22 + bne _0803CF98 + ldr r0, _0803CF94 + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CF98 +_0803CF8C: + movs r3, 0x2 + b _0803CF9A + .align 2, 0 +_0803CF90: .4byte 0x02024084 +_0803CF94: .4byte 0x020243cc +_0803CF98: + movs r3, 0x1 +_0803CF9A: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, _0803CFD0 + adds r0, r2 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x21 + bne _0803CFBA + ldr r0, _0803CFD4 + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CFCA +_0803CFBA: + cmp r2, 0x22 + bne _0803CFDA + ldr r0, _0803CFD4 + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CFDA +_0803CFCA: + movs r7, 0x2 + b _0803CFDC + .align 2, 0 +_0803CFD0: .4byte 0x02024084 +_0803CFD4: .4byte 0x020243cc +_0803CFD8: + movs r3, 0x1 +_0803CFDA: + movs r7, 0x1 +_0803CFDC: + ldr r1, _0803D020 + 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, _0803D024 + 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, _0803D028 + 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 + .align 2, 0 +_0803D020: .4byte 0x02024084 +_0803D024: .4byte 0x08329d2e +_0803D028: .4byte 0x02024404 +_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, _0803D0FC + ldr r0, [r0] + ldr r1, _0803D100 + ands r0, r1 + cmp r0, 0 + bne _0803D074 + ldr r0, _0803D104 + bl flag_check + 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, _0803D108 + 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, _0803D10C + 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, _0803D108 + 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, _0803D110 + 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, _0803D114 + 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 + .align 2, 0 +_0803D0FC: .4byte 0x02022fec +_0803D100: .4byte 0x023f0102 +_0803D104: .4byte 0x00000869 +_0803D108: .4byte 0x02024084 +_0803D10C: .4byte 0x02024330 +_0803D110: .4byte 0x08329d2e +_0803D114: .4byte 0x02024404 +_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, _0803D1A4 + ldr r0, [r0] + ldr r1, _0803D1A8 + ands r0, r1 + cmp r0, 0 + bne _0803D15C + ldr r0, _0803D1AC + bl flag_check + 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, _0803D1B0 + 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, _0803D1B4 + 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 + .align 2, 0 +_0803D1A4: .4byte 0x02022fec +_0803D1A8: .4byte 0x023f0102 +_0803D1AC: .4byte 0x00000869 +_0803D1B0: .4byte 0x02024084 +_0803D1B4: .4byte 0x02024330 +_0803D1B8: + ldr r0, _0803D1D8 + mov r3, r9 + adds r1, r3, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0 + bne _0803D208 + ldr r0, _0803D1DC + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D1E0 + movs r3, 0xA5 + b _0803D20A + .align 2, 0 +_0803D1D8: .4byte 0x0202421c +_0803D1DC: .4byte 0x0202433c +_0803D1E0: + ldr r0, _0803D200 + 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, _0803D204 + adds r1, 0xC + adds r0, r1 + ldrh r3, [r0] + b _0803D20A + .align 2, 0 +_0803D200: .4byte 0x0202449c +_0803D204: .4byte 0x02024084 +_0803D208: + movs r3, 0 +_0803D20A: + mov r1, r10 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803D254 + ldr r0, _0803D228 + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D22C + movs r2, 0xA5 + b _0803D256 + .align 2, 0 +_0803D228: .4byte 0x0202433c +_0803D22C: + ldr r0, _0803D24C + 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, _0803D250 + adds r1, 0xC + adds r0, r1 + ldrh r2, [r0] + b _0803D256 + .align 2, 0 +_0803D24C: .4byte 0x0202449c +_0803D250: .4byte 0x02024084 +_0803D254: + movs r2, 0 +_0803D256: + ldr r4, _0803D2A0 + 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 + .align 2, 0 +_0803D2A0: .4byte 0x0831c898 +_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, _0803D33C + ldr r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803D354 + ldr r0, _0803D340 + strb r3, [r0] + ldr r4, _0803D344 + mov r8, r0 + ldrb r0, [r4] + cmp r3, r0 + bcc _0803D310 + b _0803D54A +_0803D310: + ldr r7, _0803D348 + ldr r6, _0803D34C + mov r2, r8 + ldr r5, _0803D350 +_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 + .align 2, 0 +_0803D33C: .4byte 0x02022fec +_0803D340: .4byte 0x02024064 +_0803D344: .4byte 0x0202406c +_0803D348: .4byte 0x0202407a +_0803D34C: .4byte 0x0202421c +_0803D350: .4byte 0x0202407e +_0803D354: + movs r2, 0x2 + ands r1, r2 + cmp r1, 0 + beq _0803D3A4 + ldr r0, _0803D398 + strb r3, [r0] + ldr r1, _0803D39C + mov r8, r0 + adds r2, r1, 0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0803D3C0 + ldr r0, _0803D3A0 + 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, _0803D39C + ldrb r1, [r1] + cmp r0, r1 + bcs _0803D3C0 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803D376 + b _0803D3BE + .align 2, 0 +_0803D398: .4byte 0x02024064 +_0803D39C: .4byte 0x0202406c +_0803D3A0: .4byte 0x0202421c +_0803D3A4: + ldr r1, _0803D428 + ldrb r0, [r1] + ldr r4, _0803D42C + 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, _0803D430 + ldr r1, _0803D428 + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r2, _0803D434 + mov r3, r8 + ldrb r0, [r3] + strb r0, [r2] + movs r3, 0x1 + movs r5, 0 + adds r4, r1, 0 + ldr r7, _0803D438 + mov r10, r7 + ldr r0, _0803D43C + mov r12, r0 + ldr r1, _0803D440 + mov r9, r1 + ldr r7, _0803D444 + ldrb r7, [r7] + cmp r5, r7 + bge _0803D41A + adds r7, r6, 0 + adds r6, r4, 0 + adds r4, r2, 0 + ldr r2, _0803D444 +_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 + .align 2, 0 +_0803D428: .4byte 0x0202421c +_0803D42C: .4byte 0x02024064 +_0803D430: .4byte 0x0202407a +_0803D434: .4byte 0x0202407e +_0803D438: .4byte 0x03005d04 +_0803D43C: .4byte bc_80154A0 + 1 +_0803D440: .4byte 0x0202449c +_0803D444: .4byte 0x0202406c +_0803D448: + movs r0, 0 + mov r7, r8 + strb r0, [r7] + ldr r1, _0803D4D8 + ldrb r0, [r1] + cmp r0, 0 + beq _0803D48E + ldr r6, _0803D4DC + mov r2, r8 + ldr r5, _0803D4E0 + ldr r4, _0803D4E4 +_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, _0803D4D8 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D45E +_0803D48E: + movs r0, 0 + mov r2, r8 + strb r0, [r2] + ldr r4, _0803D4D8 + ldrb r0, [r4] + cmp r0, 0 + beq _0803D4D2 + ldr r6, _0803D4DC + ldr r5, _0803D4E0 + ldr r4, _0803D4E4 +_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, _0803D4D8 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D4A2 +_0803D4D2: + movs r5, 0 + b _0803D540 + .align 2, 0 +_0803D4D8: .4byte 0x0202406c +_0803D4DC: .4byte 0x0202421c +_0803D4E0: .4byte 0x0202407a +_0803D4E4: .4byte 0x0202407e +_0803D4E8: + adds r4, r5, 0x1 + adds r7, r4, 0 + ldrb r1, [r1] + cmp r7, r1 + bge _0803D53E + ldr r6, _0803D568 + lsls r2, r5, 24 + mov r8, r2 +_0803D4F8: + ldr r0, _0803D56C + 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, _0803D570 + ldrb r0, [r0] + cmp r4, r0 + blt _0803D4F8 +_0803D53E: + adds r5, r7, 0 +_0803D540: + ldr r1, _0803D570 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803D4E8 +_0803D54A: + ldr r1, _0803D574 + ldr r0, _0803D578 + str r0, [r1] + ldr r0, _0803D57C + 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 + .align 2, 0 +_0803D568: .4byte 0x0202407a +_0803D56C: .4byte 0x0202407e +_0803D570: .4byte 0x0202406c +_0803D574: .4byte 0x03005d04 +_0803D578: .4byte bc_80154A0 + 1 +_0803D57C: .4byte 0x0202449c + 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, _0803D5D8 + movs r0, 0 + strb r0, [r1] + ldr r0, _0803D5DC + ldrb r2, [r0] + adds r5, r1, 0 + cmp r2, 0 + beq _0803D678 + ldr r7, _0803D5E0 + adds r6, r5, 0 + ldr r0, _0803D5E4 + mov r12, r0 + ldr r1, _0803D5E8 + 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 + .align 2, 0 +_0803D5D8: .4byte 0x02024064 +_0803D5DC: .4byte 0x0202406c +_0803D5E0: .4byte 0x0202433c +_0803D5E4: .4byte 0x020240d4 +_0803D5E8: .4byte 0x020242bc +_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, _0803D690 + 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, _0803D694 + ands r0, r1 + str r0, [r2] +_0803D666: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0803D698 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D5AE +_0803D678: + movs r0, 0 + ldr r2, _0803D69C + 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 + .align 2, 0 +_0803D690: .4byte 0xffbfffff +_0803D694: .4byte 0xfeffffff +_0803D698: .4byte 0x0202406c +_0803D69C: .4byte 0x02024294 + thumb_func_end sub_803D580 + + thumb_func_start sub_803D6A0 +sub_803D6A0: @ 803D6A0 + push {r4-r6,lr} + ldr r2, _0803D6E4 + movs r0, 0 + strb r0, [r2] + ldr r0, _0803D6E8 + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _0803D6DE + adds r3, r2, 0 + movs r4, 0 + ldr r5, _0803D6EC +_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 + .align 2, 0 +_0803D6E4: .4byte 0x02024064 +_0803D6E8: .4byte 0x0202406c +_0803D6EC: .4byte 0x0202437c + thumb_func_end sub_803D6A0 + + thumb_func_start bc_80154A0 +bc_80154A0: @ 803D6F0 + push {r4-r7,lr} + ldr r0, _0803D778 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _0803D7AE + ldr r2, _0803D77C + ldr r0, [r2] + adds r0, 0x48 + ldr r1, _0803D780 + ldrb r0, [r0] + mov r12, r2 + adds r6, r1, 0 + ldrb r1, [r6] + cmp r0, r1 + bcs _0803D7AE + ldr r5, _0803D784 + ldr r4, _0803D788 + 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, _0803D78C + ldrb r3, [r5] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + bne _0803D7A0 + ldr r1, _0803D790 + 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, _0803D794 + 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, _0803D798 + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + blt _0803D7A0 + ldr r0, _0803D79C + bl b_call_bc_move_exec + b _0803D7E8 + .align 2, 0 +_0803D778: .4byte 0x02024280 +_0803D77C: .4byte 0x0202449c +_0803D780: .4byte 0x0202406c +_0803D784: .4byte 0x02024064 +_0803D788: .4byte 0x0202420b +_0803D78C: .4byte 0x02024274 +_0803D790: .4byte 0x02024084 +_0803D794: .4byte 0x020242bc +_0803D798: .4byte 0x0202433c +_0803D79C: .4byte 0x082db1ff +_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, _0803D7F0 + movs r0, 0 + strb r0, [r1] + ldr r1, _0803D7F4 + ldr r0, _0803D7F8 + movs r3, 0 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, _0803D7FC + movs r2, 0 + strh r3, [r0] + ldr r0, _0803D800 + ldr r0, [r0] + strb r2, [r0, 0x13] + ldr r1, _0803D804 + ldr r0, _0803D808 + str r0, [r1] + ldr r0, _0803D80C + strb r2, [r0, 0x3] + strb r2, [r0, 0x4] + ldr r0, _0803D810 + strb r2, [r0, 0x16] + ldr r0, _0803D814 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] +_0803D7E8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803D7F0: .4byte 0x02024082 +_0803D7F4: .4byte 0x02024083 +_0803D7F8: .4byte 0x0202407a +_0803D7FC: .4byte 0x02024400 +_0803D800: .4byte 0x0202449c +_0803D804: .4byte 0x03005d04 +_0803D808: .4byte bc_bs_exec + 1 +_0803D80C: .4byte 0x02024332 +_0803D810: .4byte 0x02024474 +_0803D814: .4byte 0x020244a8 + thumb_func_end bc_80154A0 + + thumb_func_start bc_bs_exec +bc_bs_exec: @ 803D818 + push {r4-r6,lr} + ldr r6, _0803D86C + ldrb r0, [r6] + ldr r2, _0803D870 + cmp r0, 0 + beq _0803D828 + movs r0, 0xC + strb r0, [r2] +_0803D828: + ldr r5, _0803D874 + ldr r0, [r5] + adds r0, 0x4B + ldr r4, _0803D878 + ldrb r1, [r4] + strb r1, [r0] + ldr r1, _0803D87C + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0803D880 + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + bcc _0803D894 + ldr r2, _0803D884 + ldr r0, [r2] + ldr r1, _0803D888 + ands r0, r1 + str r0, [r2] + ldr r3, _0803D88C + ldr r2, _0803D890 + ldrb r1, [r6] + movs r0, 0x7F + ands r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + b _0803D8AC + .align 2, 0 +_0803D86C: .4byte 0x0202433a +_0803D870: .4byte 0x02024083 +_0803D874: .4byte 0x0202449c +_0803D878: .4byte 0x02024082 +_0803D87C: .4byte 0x0831bc0c +_0803D880: .4byte 0x0202406c +_0803D884: .4byte 0x02024280 +_0803D888: .4byte 0xffefffff +_0803D88C: .4byte 0x03005d04 +_0803D890: .4byte 0x0831bc44 +_0803D894: + ldr r0, [r5] + adds r0, 0x4B + ldrb r0, [r0] + cmp r0, r1 + beq _0803D8AC + ldr r2, _0803D8B4 + ldr r0, [r2] + ldr r1, _0803D8B8 + ands r0, r1 + ldr r1, _0803D8BC + ands r0, r1 + str r0, [r2] +_0803D8AC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803D8B4: .4byte 0x02024280 +_0803D8B8: .4byte 0xfffffdff +_0803D8BC: .4byte 0xfff7ffff + thumb_func_end bc_bs_exec + + thumb_func_start sub_803D8C0 +sub_803D8C0: @ 803D8C0 + push {r4,lr} + ldr r1, _0803D8FC + movs r0, 0 + strb r0, [r1] + ldr r1, _0803D900 + ldr r2, [r1] + ldr r0, _0803D904 + ands r0, r2 + cmp r0, 0 + beq _0803D920 + ldr r1, _0803D908 + ldr r4, _0803D90C + ldrb r0, [r4] + strh r0, [r1] + ldr r1, _0803D910 + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _0803D914 + strb r0, [r1] + ldr r1, _0803D918 + ldr r0, _0803D91C + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DAA4 + .align 2, 0 +_0803D8FC: .4byte 0x02024083 +_0803D900: .4byte 0x02022fec +_0803D904: .4byte 0x02000002 +_0803D908: .4byte 0x020375f0 +_0803D90C: .4byte 0x0202433a +_0803D910: .4byte 0x02022f58 +_0803D914: .4byte 0x0202420b +_0803D918: .4byte 0x02024214 +_0803D91C: .4byte 0x082daa35 +_0803D920: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0803D95C + ldr r0, _0803D948 + ands r2, r0 + cmp r2, 0 + beq _0803D95C + bl sub_805EA60 + ldr r1, _0803D94C + ldr r0, _0803D950 + str r0, [r1] + ldr r0, _0803D954 + ldrh r1, [r0] + ldr r0, _0803D958 + cmp r1, r0 + bne _0803D946 + b _0803DA8A +_0803D946: + b _0803DA94 + .align 2, 0 +_0803D948: .4byte 0x043f0900 +_0803D94C: .4byte 0x02024214 +_0803D950: .4byte 0x082daa87 +_0803D954: .4byte 0x02038bca +_0803D958: .4byte 0x000003fe +_0803D95C: + ldr r0, [r1] + movs r1, 0xA + ands r0, r1 + cmp r0, 0x8 + beq _0803D968 + b _0803DA9E +_0803D968: + bl sub_805EA60 + ldr r1, _0803D994 + ldr r0, _0803D998 + str r0, [r1] + ldr r2, _0803D99C + ldr r0, _0803D9A0 + 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, _0803D9A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803D994: .4byte 0x02024214 +_0803D998: .4byte 0x082da92d +_0803D99C: .4byte 0x08310030 +_0803D9A0: .4byte 0x02038bca +_0803D9A4: .4byte _0803D9A8 + .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, _0803DA7C + bl song_play_for_text + b _0803DAA4 + .align 2, 0 +_0803DA7C: .4byte 0x00000163 +_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, _0803DAB0 + ldr r0, _0803DAB4 + str r0, [r1] +_0803DAA4: + ldr r1, _0803DAB8 + ldr r0, _0803DABC + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803DAB0: .4byte 0x02024214 +_0803DAB4: .4byte 0x082da96a +_0803DAB8: .4byte 0x03005d04 +_0803DABC: .4byte sub_803DCD8 + 1 + thumb_func_end sub_803D8C0 + + thumb_func_start sub_803DAC0 +sub_803DAC0: @ 803DAC0 + push {r4,lr} + ldr r1, _0803DB08 + movs r0, 0 + strb r0, [r1] + ldr r0, _0803DB0C + ldr r1, [r0] + ldr r0, _0803DB10 + ands r0, r1 + cmp r0, 0 + beq _0803DB7C + ldr r0, _0803DB14 + ands r1, r0 + cmp r1, 0 + beq _0803DB44 + ldr r3, _0803DB18 + ldrb r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0803DB2C + ldr r1, _0803DB1C + ldr r0, _0803DB20 + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + ldr r0, _0803DB24 + ldr r1, [r0] + ldr r0, _0803DB28 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DB82 + .align 2, 0 +_0803DB08: .4byte 0x02024083 +_0803DB0C: .4byte 0x02022fec +_0803DB10: .4byte 0x02000002 +_0803DB14: .4byte 0x003f0100 +_0803DB18: .4byte 0x0202433a +_0803DB1C: .4byte 0x02024214 +_0803DB20: .4byte 0x082db9c8 +_0803DB24: .4byte 0x03005d90 +_0803DB28: .4byte 0x00000ca9 +_0803DB2C: + ldr r1, _0803DB3C + ldr r0, _0803DB40 + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + b _0803DB82 + .align 2, 0 +_0803DB3C: .4byte 0x02024214 +_0803DB40: .4byte 0x082daa0b +_0803DB44: + ldr r1, _0803DB68 + ldr r4, _0803DB6C + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _0803DB70 + strb r0, [r1] + ldr r1, _0803DB74 + ldr r0, _0803DB78 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DB82 + .align 2, 0 +_0803DB68: .4byte 0x02022f58 +_0803DB6C: .4byte 0x0202433a +_0803DB70: .4byte 0x0202420b +_0803DB74: .4byte 0x02024214 +_0803DB78: .4byte 0x082daa35 +_0803DB7C: + ldr r1, _0803DB90 + ldr r0, _0803DB94 + str r0, [r1] +_0803DB82: + ldr r1, _0803DB98 + ldr r0, _0803DB9C + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803DB90: .4byte 0x02024214 +_0803DB94: .4byte 0x082da96d +_0803DB98: .4byte 0x03005d04 +_0803DB9C: .4byte sub_803DCD8 + 1 + thumb_func_end sub_803DAC0 + + thumb_func_start sub_803DBA0 +sub_803DBA0: @ 803DBA0 + push {lr} + ldr r1, _0803DBDC + movs r0, 0 + strb r0, [r1] + ldr r1, _0803DBE0 + ldr r2, [r1] + ldr r0, _0803DBE4 + ands r0, r2 + cmp r0, 0 + beq _0803DBFC + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803DBFC + ldr r1, _0803DBE8 + ldr r0, _0803DBEC + str r0, [r1] + ldr r1, _0803DBF0 + movs r0, 0x9 + strb r0, [r1] + ldr r0, _0803DBF4 + ldr r1, [r0] + ldr r0, _0803DBF8 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DC6A + .align 2, 0 +_0803DBDC: .4byte 0x02024083 +_0803DBE0: .4byte 0x02022fec +_0803DBE4: .4byte 0x003f0100 +_0803DBE8: .4byte 0x02024214 +_0803DBEC: .4byte 0x082db9c1 +_0803DBF0: .4byte 0x0202433a +_0803DBF4: .4byte 0x03005d90 +_0803DBF8: .4byte 0x00000ca9 +_0803DBFC: + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0803DC24 + ldr r1, _0803DC18 + ldr r0, _0803DC1C + str r0, [r1] + ldr r1, _0803DC20 + movs r0, 0x9 + strb r0, [r1] + b _0803DC6A + .align 2, 0 +_0803DC18: .4byte 0x02024214 +_0803DC1C: .4byte 0x082db9c1 +_0803DC20: .4byte 0x0202433a +_0803DC24: + ldr r1, _0803DC44 + ldr r0, _0803DC48 + 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, _0803DC4C + ldr r0, _0803DC50 + b _0803DC68 + .align 2, 0 +_0803DC44: .4byte 0x0202433c +_0803DC48: .4byte 0x0202420b +_0803DC4C: .4byte 0x02024214 +_0803DC50: .4byte 0x082daaf0 +_0803DC54: + ldr r1, _0803DC5C + ldr r0, _0803DC60 + b _0803DC68 + .align 2, 0 +_0803DC5C: .4byte 0x02024214 +_0803DC60: .4byte 0x082daadb +_0803DC64: + ldr r1, _0803DC74 + ldr r0, _0803DC78 +_0803DC68: + str r0, [r1] +_0803DC6A: + ldr r1, _0803DC7C + ldr r0, _0803DC80 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0803DC74: .4byte 0x02024214 +_0803DC78: .4byte 0x082daae9 +_0803DC7C: .4byte 0x03005d04 +_0803DC80: .4byte sub_803DCD8 + 1 + thumb_func_end sub_803DBA0 + + thumb_func_start bc_80158BC +bc_80158BC: @ 803DC84 + ldr r1, _0803DCB8 + movs r0, 0 + strb r0, [r1] + ldr r1, _0803DCBC + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, _0803DCC0 + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, _0803DCC4 + 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, _0803DCC8 + ldr r0, _0803DCCC + str r0, [r1] + ldr r1, _0803DCD0 + ldr r0, _0803DCD4 + str r0, [r1] + bx lr + .align 2, 0 +_0803DCB8: .4byte 0x02024083 +_0803DCBC: .4byte 0x02022f58 +_0803DCC0: .4byte 0x0202420b +_0803DCC4: .4byte 0x0202406e +_0803DCC8: .4byte 0x02024214 +_0803DCCC: .4byte 0x082daaf7 +_0803DCD0: .4byte 0x03005d04 +_0803DCD4: .4byte sub_803DCD8 + 1 + thumb_func_end bc_80158BC + + thumb_func_start sub_803DCD8 +sub_803DCD8: @ 803DCD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0803DD54 + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803DCEE + b _0803DE10 +_0803DCEE: + ldr r0, _0803DD58 + ldr r1, [r0] + ldr r0, _0803DD5C + ands r1, r0 + cmp r1, 0 + bne _0803DDB6 + ldr r2, _0803DD60 + strb r1, [r2] + ldr r0, _0803DD64 + ldrb r0, [r0] + cmp r1, r0 + bcs _0803DDB2 + adds r5, r2, 0 + ldr r0, _0803DD68 + mov r8, r0 + movs r7, 0x64 + ldr r6, _0803DD6C +_0803DD10: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803DDA0 + ldr r4, _0803DD70 + 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 + .align 2, 0 +_0803DD54: .4byte 0x02024083 +_0803DD58: .4byte 0x02022fec +_0803DD5C: .4byte 0x023f0b92 +_0803DD60: .4byte 0x02024064 +_0803DD64: .4byte 0x0202406c +_0803DD68: .4byte 0x0202406e +_0803DD6C: .4byte 0x020244ec +_0803DD70: .4byte 0x03005d10 +_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, _0803DDF0 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803DD10 +_0803DDB2: + bl sub_80EC728 +_0803DDB6: + ldr r0, _0803DDF4 + ldr r0, [r0] + ldr r1, _0803DDF8 + ands r0, r1 + cmp r0, 0 + bne _0803DDD2 + ldr r0, _0803DDFC + 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, _0803DE00 + ldr r0, _0803DE04 + str r0, [r1] + ldr r1, _0803DE08 + ldr r0, _0803DE0C + str r0, [r1] + b _0803DE2A + .align 2, 0 +_0803DDF0: .4byte 0x0202406c +_0803DDF4: .4byte 0x02022fec +_0803DDF8: .4byte 0x023f0b9a +_0803DDFC: .4byte 0x03005d10 +_0803DE00: .4byte 0x03005d04 +_0803DE04: .4byte sub_803DE40 + 1 +_0803DE08: .4byte 0x030061e8 +_0803DE0C: .4byte sub_8038420 + 1 +_0803DE10: + ldr r0, _0803DE34 + ldr r0, [r0] + cmp r0, 0 + bne _0803DE2A + ldr r1, _0803DE38 + ldr r0, _0803DE3C + 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 + .align 2, 0 +_0803DE34: .4byte 0x02024068 +_0803DE38: .4byte 0x0831bd10 +_0803DE3C: .4byte 0x02024214 + thumb_func_end sub_803DCD8 + + thumb_func_start sub_803DE40 +sub_803DE40: @ 803DE40 + push {lr} + ldr r0, _0803DE6C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803DE86 + bl reset_all_obj_data + ldr r0, _0803DE70 + ldrb r0, [r0] + cmp r0, 0 + beq _0803DE62 + ldr r0, _0803DE74 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803DE80 +_0803DE62: + ldr r1, _0803DE78 + ldr r0, _0803DE7C + str r0, [r1] + b _0803DEA2 + .align 2, 0 +_0803DE6C: .4byte 0x02037fd4 +_0803DE70: .4byte 0x03005d54 +_0803DE74: .4byte 0x0202433a +_0803DE78: .4byte 0x03005d04 +_0803DE7C: .4byte c4_overworld + 1 +_0803DE80: + ldr r1, _0803DEA8 + ldr r0, _0803DEAC + str r0, [r1] +_0803DE86: + bl Window_FreeMemory + ldr r0, _0803DEB0 + 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 + .align 2, 0 +_0803DEA8: .4byte 0x03005d04 +_0803DEAC: .4byte bc_evolution_cutscene + 1 +_0803DEB0: .4byte 0x02022fec + thumb_func_end sub_803DE40 + + thumb_func_start bc_evolution_cutscene +bc_evolution_cutscene: @ 803DEB4 + push {r4-r6,lr} + ldr r0, _0803DF0C + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0 + beq _0803DF2E +_0803DEC0: + movs r6, 0 +_0803DEC2: + ldrb r2, [r3] + ldr r0, _0803DF10 + 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, _0803DF14 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0 + bl sub_806D098 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0803DF20 + bl Window_FreeMemory + ldr r0, _0803DF18 + ldr r1, _0803DF1C + 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 + .align 2, 0 +_0803DF0C: .4byte 0x03005d54 +_0803DF10: .4byte 0x0832a328 +_0803DF14: .4byte 0x020244ec +_0803DF18: .4byte 0x03005d04 +_0803DF1C: .4byte sub_803DF48 + 1 +_0803DF20: + adds r6, 0x1 + ldr r3, _0803DF3C + cmp r6, 0x5 + ble _0803DEC2 + ldrb r0, [r3] + cmp r0, 0 + bne _0803DEC0 +_0803DF2E: + ldr r1, _0803DF40 + ldr r0, _0803DF44 + str r0, [r1] +_0803DF34: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803DF3C: .4byte 0x03005d54 +_0803DF40: .4byte 0x03005d04 +_0803DF44: .4byte c4_overworld + 1 + thumb_func_end bc_evolution_cutscene + + thumb_func_start sub_803DF48 +sub_803DF48: @ 803DF48 + push {lr} + ldr r0, _0803DF60 + ldr r1, [r0, 0x4] + ldr r0, _0803DF64 + cmp r1, r0 + bne _0803DF5A + ldr r1, _0803DF68 + ldr r0, _0803DF6C + str r0, [r1] +_0803DF5A: + pop {r0} + bx r0 + .align 2, 0 +_0803DF60: .4byte 0x030022c0 +_0803DF64: .4byte sub_8038420 + 1 +_0803DF68: .4byte 0x03005d04 +_0803DF6C: .4byte bc_evolution_cutscene + 1 + thumb_func_end sub_803DF48 + + thumb_func_start c4_overworld +c4_overworld: @ 803DF70 + push {r4-r6,lr} + ldr r6, _0803DFF4 + ldr r0, [r6] + movs r5, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803DF8C + ldr r4, _0803DFF8 + adds r0, r4, 0 + bl sub_806DCB4 + adds r0, r4, 0 + bl atkE5_pickupitemcalculation +_0803DF8C: + ldr r4, [r6] + adds r0, r4, 0 + ands r0, r5 + cmp r0, 0 + beq _0803DF9E + ldr r0, _0803DFFC + ldrb r0, [r0] + cmp r0, 0 + bne _0803DFEC +_0803DF9E: + ldr r1, _0803E000 + ldr r5, _0803E004 + ldrb r0, [r5] + strh r0, [r1] + ldr r3, _0803E008 + ldr r0, _0803E00C + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _0803E010 + ldr r0, [r0] + str r0, [r3] + movs r0, 0x80 + lsls r0, 3 + ands r4, r0 + cmp r4, 0 + beq _0803DFDE + ldr r0, _0803E014 + 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, _0803E008 + ldr r0, [r0, 0x8] + bl set_callback2 +_0803DFEC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803DFF4: .4byte 0x02022fec +_0803DFF8: .4byte 0x020244ec +_0803DFFC: .4byte 0x03003124 +_0803E000: .4byte 0x020375f0 +_0803E004: .4byte 0x0202433a +_0803E008: .4byte 0x030022c0 +_0803E00C: .4byte 0x00000439 +_0803E010: .4byte 0x03005d00 +_0803E014: .4byte 0x02024744 + thumb_func_end c4_overworld + + thumb_func_start bc_move_exec_returning +bc_move_exec_returning: @ 803E018 + push {lr} + ldr r0, _0803E054 + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803E060 + ldr r3, _0803E058 + 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, _0803E05C + 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 + .align 2, 0 +_0803E054: .4byte 0x02024083 +_0803E058: .4byte 0x020244a8 +_0803E05C: .4byte 0x03005d04 +_0803E060: + ldr r0, _0803E080 + ldr r0, [r0] + cmp r0, 0 + bne _0803E07A + ldr r1, _0803E084 + ldr r0, _0803E088 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E07A: + pop {r0} + bx r0 + .align 2, 0 +_0803E080: .4byte 0x02024068 +_0803E084: .4byte 0x0831bd10 +_0803E088: .4byte 0x02024214 + thumb_func_end bc_move_exec_returning + + thumb_func_start sub_803E08C +sub_803E08C: @ 803E08C + push {lr} + ldr r0, _0803E0AC + ldr r0, [r0] + cmp r0, 0 + bne _0803E0A8 + ldr r1, _0803E0B0 + ldr r0, _0803E0B4 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E0A8: + pop {r0} + bx r0 + .align 2, 0 +_0803E0AC: .4byte 0x02024068 +_0803E0B0: .4byte 0x0831bd10 +_0803E0B4: .4byte 0x02024214 + 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, _0803E0F8 + ldr r1, _0803E0FC + ldr r0, _0803E100 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r1, _0803E104 + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0x91 + ldrb r2, [r0] + ldr r1, _0803E108 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0803E110 + ldr r1, _0803E10C + movs r0, 0xC + b _0803E83C + .align 2, 0 +_0803E0F8: .4byte 0x0202420b +_0803E0FC: .4byte 0x0202407e +_0803E100: .4byte 0x02024082 +_0803E104: .4byte 0x0202449c +_0803E108: .4byte 0x0832a328 +_0803E10C: .4byte 0x02024083 +_0803E110: + ldr r1, _0803E188 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0803E18C + movs r0, 0x1 + strb r0, [r1, 0xE] + ldr r5, _0803E190 + adds r0, r3, r5 + strb r2, [r0] + ldr r0, _0803E194 + strb r2, [r0] + ldr r0, _0803E198 + strb r2, [r0] + ldr r0, _0803E19C + strb r2, [r0, 0x6] + ldr r2, _0803E1A0 + ldr r0, _0803E1A4 + mov r9, r0 + ldrb r0, [r6] + ldr r3, _0803E1A8 + ldr r1, [r3] + adds r0, r1 + adds r0, 0x80 + ldrb r0, [r0] + mov r5, r9 + strb r0, [r5] + strb r0, [r2] + ldr r1, _0803E1AC + 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, _0803E1B0 + ldr r1, _0803E1B4 + movs r0, 0xA5 + strh r0, [r1] + strh r0, [r2] + ldr r2, _0803E1B8 + 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, _0803E1A8 + ldr r2, [r3] + b _0803E316 + .align 2, 0 +_0803E188: .4byte 0x02024211 +_0803E18C: .4byte 0x02024474 +_0803E190: .4byte 0x000001a3 +_0803E194: .4byte 0x0202427c +_0803E198: .4byte 0x02024212 +_0803E19C: .4byte 0x02024332 +_0803E1A0: .4byte 0x020241e8 +_0803E1A4: .4byte 0x020241e9 +_0803E1A8: .4byte 0x0202449c +_0803E1AC: .4byte 0x0202433c +_0803E1B0: .4byte 0x020241ea +_0803E1B4: .4byte 0x020241ec +_0803E1B8: .4byte 0x02024280 +_0803E1BC: + ldr r5, _0803E1F4 + 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, _0803E1F8 + ldr r2, _0803E1FC + ldr r1, _0803E200 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + b _0803E33C + .align 2, 0 +_0803E1F4: .4byte 0x02024084 +_0803E1F8: .4byte 0x020241ea +_0803E1FC: .4byte 0x020241ec +_0803E200: .4byte 0x02024268 +_0803E204: + ldr r1, _0803E258 + 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, _0803E25C + ldr r0, _0803E260 + 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, _0803E264 + ldr r2, [r3] + b _0803E316 + .align 2, 0 +_0803E258: .4byte 0x020242bc +_0803E25C: .4byte 0x020241ea +_0803E260: .4byte 0x020241ec +_0803E264: .4byte 0x0202449c +_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, _0803E2D0 + ldr r2, _0803E2D4 + 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, _0803E2D8 + ldr r2, [r3] + b _0803E316 + .align 2, 0 +_0803E2D0: .4byte 0x020241ea +_0803E2D4: .4byte 0x020241ec +_0803E2D8: .4byte 0x0202449c +_0803E2DC: + ldr r3, _0803E31C + mov r5, r8 + ldrb r0, [r5] + lsls r0, 1 + ldr r4, _0803E320 + ldrb r2, [r4] + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldr r1, _0803E324 + lsls r2, 1 + adds r2, r1 + ldrh r3, [r0] + ldrh r2, [r2] + cmp r3, r2 + beq _0803E334 + ldr r1, _0803E328 + ldr r0, _0803E32C + strh r3, [r0] + strh r3, [r1] + ldrh r0, [r1] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r4] + ldr r2, _0803E330 + ldr r2, [r2] +_0803E316: + adds r1, r2 + strb r0, [r1, 0xC] + b _0803E33C + .align 2, 0 +_0803E31C: .4byte 0x02024084 +_0803E320: .4byte 0x0202420b +_0803E324: .4byte 0x02024274 +_0803E328: .4byte 0x020241ea +_0803E32C: .4byte 0x020241ec +_0803E330: .4byte 0x0202449c +_0803E334: + ldr r1, _0803E368 + ldr r0, _0803E36C + strh r3, [r0] + strh r3, [r1] +_0803E33C: + ldr r2, _0803E370 + ldr r1, _0803E374 + 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, _0803E378 + ldr r1, _0803E368 + ldrh r1, [r1] + strh r1, [r0, 0x22] + b _0803E384 + .align 2, 0 +_0803E368: .4byte 0x020241ea +_0803E36C: .4byte 0x020241ec +_0803E370: .4byte 0x02024084 +_0803E374: .4byte 0x0202420b +_0803E378: .4byte 0x03005d10 +_0803E37C: + ldr r0, _0803E3E8 + ldr r1, _0803E3EC + 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, _0803E3F0 + 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, _0803E3F4 + ldr r0, _0803E3EC + 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, _0803E3F8 + ldrb r2, [r5, 0x9] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0803E400 + ldr r0, _0803E3FC + strb r2, [r0] + b _0803E76A + .align 2, 0 +_0803E3E8: .4byte 0x03005d10 +_0803E3EC: .4byte 0x020241ea +_0803E3F0: .4byte 0x02024294 +_0803E3F4: .4byte 0x0831c898 +_0803E3F8: .4byte 0x02024084 +_0803E3FC: .4byte 0x0202420c +_0803E400: + ldr r0, _0803E51C + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + ldr r5, _0803E520 + mov r8, r5 + cmp r0, 0 + bne _0803E412 + b _0803E6E0 +_0803E412: + ldr r1, _0803E524 + 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, _0803E528 + ldr r0, _0803E52C + 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, _0803E530 + ldr r2, _0803E520 + ldrb r6, [r2] + ldr r0, _0803E534 + 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, _0803E538 + strb r5, [r1] + ldr r0, _0803E53C + 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, _0803E520 + ldrb r1, [r0] + ldr r0, _0803E534 + ldr r0, [r0] + adds r1, r0 + ldrb r0, [r1, 0xC] + ldrb r1, [r4] + cmp r0, r1 + beq _0803E4CE + ldr r1, _0803E530 + 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, _0803E53C + 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, _0803E528 + ldr r0, _0803E540 + 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, _0803E520 + 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 + .align 2, 0 +_0803E51C: .4byte 0x02022fec +_0803E520: .4byte 0x0202420b +_0803E524: .4byte 0x02024294 +_0803E528: .4byte 0x0831c898 +_0803E52C: .4byte 0x020241ea +_0803E530: .4byte 0x02024084 +_0803E534: .4byte 0x0202449c +_0803E538: .4byte 0x02024064 +_0803E53C: .4byte 0x0202406c +_0803E540: .4byte 0x020241ec +_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, _0803E564 + strb r0, [r1] + b _0803E578 + .align 2, 0 +_0803E564: .4byte 0x0202420c +_0803E568: + ldr r2, _0803E5B0 + ldr r0, _0803E5B4 + ldrb r0, [r0] + ldr r1, _0803E5B8 + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_0803E578: + ldr r7, _0803E5BC + ldrb r0, [r7] + ldr r1, _0803E5C0 + mov r8, r1 + ldr r5, _0803E5B0 + 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, _0803E5B4 + 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 + .align 2, 0 +_0803E5B0: .4byte 0x0202420c +_0803E5B4: .4byte 0x0202420b +_0803E5B8: .4byte 0x0202449c +_0803E5BC: .4byte 0x02024210 +_0803E5C0: .4byte 0x0832a328 +_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, _0803E61C + ldr r0, _0803E620 + ldr r3, [sp] + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r4] + ldrb r0, [r4] + ldr r2, _0803E624 + 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, _0803E628 + 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, _0803E62C + ldrb r0, [r4] + strb r0, [r1] + b _0803E76A + .align 2, 0 +_0803E61C: .4byte 0x02024064 +_0803E620: .4byte 0x0202407e +_0803E624: .4byte 0x02024084 +_0803E628: .4byte 0x0202437c +_0803E62C: .4byte 0x0202420c +_0803E630: + ldr r0, _0803E674 + ldr r0, [r0] + movs r4, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0803E6E0 + ldr r2, _0803E678 + ldr r0, _0803E67C + 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 + .align 2, 0 +_0803E674: .4byte 0x02022fec +_0803E678: .4byte 0x0831c898 +_0803E67C: .4byte 0x020241ec +_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, _0803E6D0 + strb r0, [r1] + ldr r0, _0803E6D4 + ldrb r1, [r0] + ldr r2, _0803E6D8 + ldr r5, _0803E6D0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldr r0, _0803E6DC + 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 + .align 2, 0 +_0803E6D0: .4byte 0x0202420c +_0803E6D4: .4byte 0x02024210 +_0803E6D8: .4byte 0x0832a328 +_0803E6DC: .4byte 0x0202420b +_0803E6E0: + ldr r5, _0803E720 + mov r2, r8 + ldrb r0, [r2] + ldr r1, _0803E724 + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r5] + ldr r6, _0803E728 + ldrb r1, [r6] + ldr r7, _0803E72C + 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 + .align 2, 0 +_0803E720: .4byte 0x0202420c +_0803E724: .4byte 0x0202449c +_0803E728: .4byte 0x02024210 +_0803E72C: .4byte 0x0832a328 +_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, _0803E7A0 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 10 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0803E808 + ldr r0, _0803E7A4 + ldr r4, _0803E7A8 + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsls r0, 27 + cmp r0, 0 + bge _0803E808 + ldr r1, _0803E7AC + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0803E7B4 + ldr r1, _0803E7B0 + movs r0, 0xC + b _0803E83C + .align 2, 0 +_0803E7A0: .4byte 0x02022fec +_0803E7A4: .4byte 0x0202433c +_0803E7A8: .4byte 0x0202420b +_0803E7AC: .4byte 0x02024084 +_0803E7B0: .4byte 0x02024083 +_0803E7B4: + ldr r3, _0803E7E0 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _0803E7EC + ldr r1, _0803E7E4 + movs r2, 0 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, _0803E7E8 + 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 + .align 2, 0 +_0803E7E0: .4byte 0x02024230 +_0803E7E4: .4byte 0x02024332 +_0803E7E8: .4byte 0x02024214 +_0803E7EC: + ldr r1, _0803E7FC + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, _0803E800 + ldr r0, _0803E804 + str r0, [r1] + b _0803E824 + .align 2, 0 +_0803E7FC: .4byte 0x02024332 +_0803E800: .4byte 0x02024214 +_0803E804: .4byte 0x082db6ad +_0803E808: + ldr r4, _0803E850 + ldr r3, _0803E854 + ldr r2, _0803E858 + ldr r0, _0803E85C + 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, _0803E860 + ldrb r0, [r0] + bl sub_81A56E8 +_0803E838: + ldr r1, _0803E864 + 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 + .align 2, 0 +_0803E850: .4byte 0x02024214 +_0803E854: .4byte 0x082d86a8 +_0803E858: .4byte 0x0831c898 +_0803E85C: .4byte 0x020241ea +_0803E860: .4byte 0x0202420b +_0803E864: .4byte 0x02024083 + thumb_func_end sub_803E0B8 + + thumb_func_start bs2_8016374 +bs2_8016374: @ 803E868 + push {r4,lr} + ldr r3, _0803E8D4 + ldr r1, _0803E8D8 + ldr r0, _0803E8DC + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, _0803E8E0 + movs r2, 0 + strh r2, [r0] + ldr r0, _0803E8E4 + strh r2, [r0] + ldr r1, _0803E8E8 + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r1, _0803E8EC + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r2, _0803E8F0 + 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, _0803E8F4 + 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, _0803E8F8 + strb r4, [r0, 0x17] + ldr r1, _0803E8FC + ldr r0, _0803E900 + str r0, [r1] + ldr r1, _0803E904 + movs r0, 0xA + strb r0, [r1] + ldr r1, _0803E908 + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0803E8CE + adds r0, 0x1 + strb r0, [r1, 0x2] +_0803E8CE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803E8D4: .4byte 0x0202420b +_0803E8D8: .4byte 0x0202407e +_0803E8DC: .4byte 0x02024082 +_0803E8E0: .4byte 0x02022e14 +_0803E8E4: .4byte 0x02022e16 +_0803E8E8: .4byte 0x020244ac +_0803E8EC: .4byte 0x020244b0 +_0803E8F0: .4byte 0x02022f58 +_0803E8F4: .4byte 0x0202449c +_0803E8F8: .4byte 0x02024474 +_0803E8FC: .4byte 0x02024214 +_0803E900: .4byte 0x082dab15 +_0803E904: .4byte 0x02024083 +_0803E908: .4byte 0x03005d10 + 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, _0803E96C + ldr r2, _0803E970 + ldr r1, _0803E974 + ldr r0, _0803E978 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r4] + ldr r0, _0803E97C + movs r1, 0 + strh r1, [r0] + ldr r0, _0803E980 + strh r1, [r0] + ldrb r0, [r4] + bl sub_8045868 + ldr r5, _0803E984 + ldr r2, _0803E988 + 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, _0803E98C + ldr r1, _0803E990 + ldrh r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, _0803E994 + mov r10, r0 + b _0803EBF6 + .align 2, 0 +_0803E96C: .4byte 0x0202420b +_0803E970: .4byte 0x0202420c +_0803E974: .4byte 0x0202407e +_0803E978: .4byte 0x02024082 +_0803E97C: .4byte 0x02022e14 +_0803E980: .4byte 0x02022e16 +_0803E984: .4byte 0x02024208 +_0803E988: .4byte 0x02023864 +_0803E98C: .4byte 0x02024214 +_0803E990: .4byte 0x082dbd08 +_0803E994: .4byte 0x02024083 +_0803E998: + adds r0, r3, 0 + subs r0, 0x50 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0803E9C0 + ldr r0, _0803E9B4 + ldr r1, _0803E9B8 + ldr r1, [r1] + str r1, [r0] + ldr r1, _0803E9BC + mov r10, r1 + b _0803EBF6 + .align 2, 0 +_0803E9B4: .4byte 0x02024214 +_0803E9B8: .4byte 0x082dbd54 +_0803E9BC: .4byte 0x02024083 +_0803E9C0: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E9E8 + ldr r0, _0803E9DC + ldr r1, _0803E9E0 + ldr r1, [r1] + str r1, [r0] + ldr r2, _0803E9E4 + mov r10, r2 + b _0803EBF6 + .align 2, 0 +_0803E9DC: .4byte 0x02024214 +_0803E9E0: .4byte 0x082dbd3c +_0803E9E4: .4byte 0x02024083 +_0803E9E8: + ldr r3, _0803EA20 + ldrb r0, [r4] + strb r0, [r3, 0x17] + lsls r0, 24 + lsrs r0, 25 + ldr r2, _0803EA24 + ldr r1, [r2] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + subs r0, 0x1 + mov r8, r4 + ldr r1, _0803EA28 + mov r9, r1 + ldr r6, _0803EA2C + mov r12, r3 + adds r7, r2, 0 + ldr r2, _0803EA30 + mov r10, r2 + cmp r0, 0x4 + bls _0803EA14 + b _0803EBDE +_0803EA14: + lsls r0, 2 + ldr r1, _0803EA34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803EA20: .4byte 0x02024474 +_0803EA24: .4byte 0x0202449c +_0803EA28: .4byte 0x02024214 +_0803EA2C: .4byte 0x082dbd3c +_0803EA30: .4byte 0x02024083 +_0803EA34: .4byte _0803EA38 + .align 2, 0 +_0803EA38: + .4byte _0803EBDE + .4byte _0803EBDE + .4byte _0803EA4C + .4byte _0803EAE0 + .4byte _0803EBB0 +_0803EA4C: + ldr r5, _0803EA84 + movs r0, 0 + strb r0, [r5, 0x5] + ldr r2, _0803EA88 + 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, _0803EA8C + mov r9, r1 + ldr r6, _0803EA90 + ldr r2, _0803EA94 + mov r10, r2 + cmp r0, 0 + bne _0803EA7E + b _0803EBDE +_0803EA7E: + movs r0, 0x5 + strb r0, [r5, 0x5] + b _0803EBDE + .align 2, 0 +_0803EA84: .4byte 0x02024332 +_0803EA88: .4byte 0x0202420b +_0803EA8C: .4byte 0x02024214 +_0803EA90: .4byte 0x082dbd3c +_0803EA94: .4byte 0x02024083 +_0803EA98: + ldr r0, _0803EAD4 + mov r9, r0 + ldr r6, _0803EAD8 + ldr r1, _0803EADC + 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 + .align 2, 0 +_0803EAD4: .4byte 0x02024214 +_0803EAD8: .4byte 0x082dbd3c +_0803EADC: .4byte 0x02024083 +_0803EAE0: + ldr r3, _0803EB14 + movs r0, 0x4 + strb r0, [r3, 0x5] + ldr r2, _0803EB18 + 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, _0803EB1C + mov r9, r2 + ldr r6, _0803EB20 + ldr r0, _0803EB24 + mov r10, r0 + b _0803EBDE + .align 2, 0 +_0803EB14: .4byte 0x02024332 +_0803EB18: .4byte 0x0202420b +_0803EB1C: .4byte 0x02024214 +_0803EB20: .4byte 0x082dbd3c +_0803EB24: .4byte 0x02024083 +_0803EB28: + ldr r3, _0803EB9C + 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, _0803EBA0 + 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, _0803EBA4 + mov r9, r1 + ldr r6, _0803EBA8 + ldr r0, _0803EBAC + 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 + .align 2, 0 +_0803EB9C: .4byte 0x02022f58 +_0803EBA0: .4byte 0x02022f68 +_0803EBA4: .4byte 0x02024214 +_0803EBA8: .4byte 0x082dbd3c +_0803EBAC: .4byte 0x02024083 +_0803EBB0: + ldr r0, _0803EBC4 + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803EBCC + ldr r1, _0803EBC8 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0803EBD0 + .align 2, 0 +_0803EBC4: .4byte 0x02022fec +_0803EBC8: .4byte 0x02024332 +_0803EBCC: + ldr r0, _0803EC0C + strb r1, [r0, 0x5] +_0803EBD0: + ldr r0, _0803EC10 + mov r8, r0 + ldr r1, _0803EC14 + mov r9, r1 + ldr r6, _0803EC18 + ldr r2, _0803EC1C + 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 + .align 2, 0 +_0803EC0C: .4byte 0x02024332 +_0803EC10: .4byte 0x0202420b +_0803EC14: .4byte 0x02024214 +_0803EC18: .4byte 0x082dbd3c +_0803EC1C: .4byte 0x02024083 + 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, _0803EC4C + movs r0, 0x58 + muls r0, r5 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803EC54 + ldr r1, _0803EC50 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + b _0803EC5E + .align 2, 0 +_0803EC4C: .4byte 0x02024084 +_0803EC50: .4byte 0x02024404 +_0803EC54: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r1, r0, 24 +_0803EC5E: + ldr r0, _0803EC8C + strb r5, [r0] + cmp r1, 0x25 + bne _0803EC9C + ldr r2, _0803EC90 + ldr r1, _0803EC94 + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, _0803EC98 + 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 + .align 2, 0 +_0803EC8C: .4byte 0x0202420f +_0803EC90: .4byte 0x02024208 +_0803EC94: .4byte 0x02024084 +_0803EC98: .4byte 0x0202433c +_0803EC9C: + ldr r0, _0803ED28 + 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 sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0803ED38 + ldr r4, _0803ED2C + 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, _0803ED30 + strb r6, [r0] + ldr r0, _0803ED34 + 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 + .align 2, 0 +_0803ED28: .4byte 0x02024084 +_0803ED2C: .4byte 0x0202449c +_0803ED30: .4byte 0x0202420a +_0803ED34: .4byte 0x0202433c +_0803ED38: + ldr r0, _0803ED54 + strb r6, [r0] + ldr r0, _0803ED58 + 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 + .align 2, 0 +_0803ED54: .4byte 0x0202420a +_0803ED58: .4byte 0x0202433c +_0803ED5C: + ldr r1, _0803ED78 + ldr r2, [r1] + ldr r0, _0803ED7C + 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 + .align 2, 0 +_0803ED78: .4byte 0x02022fec +_0803ED7C: .4byte 0x043f0100 +_0803ED80: + ldr r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803EE06 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0803EDBC + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, _0803EDB8 + 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 + .align 2, 0 +_0803EDB8: .4byte 0x02024084 +_0803EDBC: + ldr r3, _0803EE34 + 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, _0803EE38 + 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, _0803EE38 + ldr r1, [r0] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803EE12: + cmp r7, 0 + beq _0803EE24 + ldr r1, _0803EE3C + ldr r0, _0803EE40 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, _0803EE44 + 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 + .align 2, 0 +_0803EE34: .4byte 0x02024084 +_0803EE38: .4byte 0x0202449c +_0803EE3C: .4byte 0x02024082 +_0803EE40: .4byte 0x0202406c +_0803EE44: .4byte 0x0202433a + thumb_func_end sub_803EC20 + + thumb_func_start sub_803EE48 +sub_803EE48: @ 803EE48 + push {r4-r6,lr} + ldr r4, _0803EE98 + ldr r1, _0803EE9C + ldr r5, _0803EEA0 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, _0803EEA4 + ldr r0, [r0] + ldr r1, _0803EEA8 + ands r0, r1 + cmp r0, 0 + beq _0803EF0C + ldr r0, _0803EEAC + ldrb r1, [r0] + strb r1, [r5] + ldr r2, _0803EEB0 + movs r0, 0 + strb r0, [r2] + lsls r1, 24 + cmp r1, 0 + beq _0803EEE0 + adds r4, r2, 0 + ldr r6, _0803EEB4 + ldr r5, _0803EEB8 +_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 + .align 2, 0 +_0803EE98: .4byte 0x0202420b +_0803EE9C: .4byte 0x0202407e +_0803EEA0: .4byte 0x02024082 +_0803EEA4: .4byte 0x02022fec +_0803EEA8: .4byte 0x02000002 +_0803EEAC: .4byte 0x0202406c +_0803EEB0: .4byte 0x02024064 +_0803EEB4: .4byte 0x0202421c +_0803EEB8: .4byte 0x0202433a +_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, _0803EEFC + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803EE7C +_0803EEE0: + ldr r2, _0803EF00 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0803EF04 + ldr r1, [r0] + ldr r0, _0803EF08 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + b _0803EF96 + .align 2, 0 +_0803EEFC: .4byte 0x0202406c +_0803EF00: .4byte 0x0202433a +_0803EF04: .4byte 0x03005d90 +_0803EF08: .4byte 0x00000ca9 +_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, _0803EF3C + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r1, _0803EF40 + ldr r0, _0803EF44 + str r0, [r1] + ldr r1, _0803EF48 + movs r0, 0xA + b _0803EF96 + .align 2, 0 +_0803EF3C: .4byte 0x02024332 +_0803EF40: .4byte 0x02024214 +_0803EF44: .4byte 0x082dab02 +_0803EF48: .4byte 0x02024083 +_0803EF4C: + ldr r1, _0803EF74 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0803EF78 + ands r0, r1 + cmp r0, 0 + beq _0803EF8C + ldr r1, _0803EF7C + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, _0803EF80 + ldr r0, _0803EF84 + str r0, [r1] + ldr r1, _0803EF88 + movs r0, 0xA + b _0803EF96 + .align 2, 0 +_0803EF74: .4byte 0x02024084 +_0803EF78: .4byte 0x0400e000 +_0803EF7C: .4byte 0x02024332 +_0803EF80: .4byte 0x02024214 +_0803EF84: .4byte 0x082dab02 +_0803EF88: .4byte 0x02024083 +_0803EF8C: + ldr r0, _0803EFA0 + ldrb r0, [r0] + strb r0, [r5] + ldr r1, _0803EFA4 + movs r0, 0x6 +_0803EF96: + strb r0, [r1] +_0803EF98: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803EFA0: .4byte 0x0202406c +_0803EFA4: .4byte 0x0202433a + thumb_func_end sub_803EE48 + + thumb_func_start sub_803EFA8 +sub_803EFA8: @ 803EFA8 + ldr r2, _0803EFD0 + ldr r1, _0803EFD4 + ldr r0, _0803EFD8 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, _0803EFDC + movs r1, 0 + strh r1, [r0] + ldr r0, _0803EFE0 + strh r1, [r0] + ldr r1, _0803EFE4 + ldr r0, _0803EFE8 + ldr r0, [r0] + str r0, [r1] + ldr r1, _0803EFEC + movs r0, 0xA + strb r0, [r1] + bx lr + .align 2, 0 +_0803EFD0: .4byte 0x0202420b +_0803EFD4: .4byte 0x0202407e +_0803EFD8: .4byte 0x02024082 +_0803EFDC: .4byte 0x02022e14 +_0803EFE0: .4byte 0x02022e16 +_0803EFE4: .4byte 0x02024214 +_0803EFE8: .4byte 0x082dbd58 +_0803EFEC: .4byte 0x02024083 + thumb_func_end sub_803EFA8 + + thumb_func_start bs5_8016AC0 +bs5_8016AC0: @ 803EFF0 + ldr r2, _0803F028 + ldr r1, _0803F02C + ldr r0, _0803F030 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, _0803F034 + movs r1, 0 + strh r1, [r0] + ldr r0, _0803F038 + strh r1, [r0] + ldr r1, _0803F03C + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + ldr r1, _0803F040 + movs r0, 0x5 + strh r0, [r1] + ldr r1, _0803F044 + ldr r0, _0803F048 + ldr r0, [r0, 0x14] + str r0, [r1] + ldr r1, _0803F04C + movs r0, 0xA + strb r0, [r1] + bx lr + .align 2, 0 +_0803F028: .4byte 0x0202420b +_0803F02C: .4byte 0x0202407e +_0803F030: .4byte 0x02024082 +_0803F034: .4byte 0x02022e14 +_0803F038: .4byte 0x02022e16 +_0803F03C: .4byte 0x0203a04c +_0803F040: .4byte 0x02024208 +_0803F044: .4byte 0x02024214 +_0803F048: .4byte 0x082dbd08 +_0803F04C: .4byte 0x02024083 + thumb_func_end bs5_8016AC0 + + thumb_func_start sub_803F050 +sub_803F050: @ 803F050 + push {r4-r6,lr} + ldr r3, _0803F0D0 + ldr r1, _0803F0D4 + ldr r0, _0803F0D8 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, _0803F0DC + movs r1, 0 + strh r1, [r0] + ldr r0, _0803F0E0 + strh r1, [r0] + ldr r6, _0803F0E4 + ldr r2, _0803F0E8 + 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, _0803F0EC + ldrb r0, [r3] + lsls r0, 9 + adds r2, 0x2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + ldr r1, _0803F0F0 + ldrb r0, [r1, 0x1F] + cmp r0, 0xFE + bhi _0803F096 + adds r0, 0x1 + strb r0, [r1, 0x1F] +_0803F096: + ldr r2, _0803F0F4 + 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, _0803F0F8 + 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 + .align 2, 0 +_0803F0D0: .4byte 0x0202420b +_0803F0D4: .4byte 0x0202407e +_0803F0D8: .4byte 0x02024082 +_0803F0DC: .4byte 0x02022e14 +_0803F0E0: .4byte 0x02022e16 +_0803F0E4: .4byte 0x02024332 +_0803F0E8: .4byte 0x02023864 +_0803F0EC: .4byte 0x02024208 +_0803F0F0: .4byte 0x03005d10 +_0803F0F4: .4byte 0x0202449c +_0803F0F8: .4byte 0x0831bce0 +_0803F0FC: + subs r0, r5, r0 +_0803F0FE: + strb r0, [r3] +_0803F100: + ldr r1, _0803F114 + ldr r0, _0803F118 + ldr r0, [r0, 0x8] + str r0, [r1] + ldr r1, _0803F11C + movs r0, 0xA + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803F114: .4byte 0x02024214 +_0803F118: .4byte 0x082dbd58 +_0803F11C: .4byte 0x02024083 + thumb_func_end sub_803F050 + + thumb_func_start sub_803F120 +sub_803F120: @ 803F120 + push {r4,lr} + ldr r2, _0803F1A0 + ldr r1, _0803F1A4 + ldr r0, _0803F1A8 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, _0803F1AC + movs r4, 0 + strh r4, [r0] + ldr r0, _0803F1B0 + strh r4, [r0] + ldr r3, _0803F1B4 + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7C + ldr r1, _0803F1B8 + 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, _0803F1BC + 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, _0803F1C0 + strb r4, [r0, 0x5] + b _0803F1CA + .align 2, 0 +_0803F1A0: .4byte 0x0202420b +_0803F1A4: .4byte 0x0202407e +_0803F1A8: .4byte 0x02024082 +_0803F1AC: .4byte 0x02022e14 +_0803F1B0: .4byte 0x02022e16 +_0803F1B4: .4byte 0x0202449c +_0803F1B8: .4byte 0x0831bcef +_0803F1BC: .4byte 0x0831bcf3 +_0803F1C0: .4byte 0x02024332 +_0803F1C4: + ldr r1, _0803F1E0 + movs r0, 0x1 + strb r0, [r1, 0x5] +_0803F1CA: + ldr r1, _0803F1E4 + ldr r0, _0803F1E8 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r1, _0803F1EC + movs r0, 0xA + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803F1E0: .4byte 0x02024332 +_0803F1E4: .4byte 0x02024214 +_0803F1E8: .4byte 0x082dbd58 +_0803F1EC: .4byte 0x02024083 + thumb_func_end sub_803F120 + + thumb_func_start bs8_exit_by_flight +bs8_exit_by_flight: @ 803F1F0 + push {r4,lr} + ldr r2, _0803F218 + ldr r1, _0803F21C + ldr r4, _0803F220 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x11 + bl audio_play + ldr r0, _0803F224 + ldrb r0, [r0] + strb r0, [r4] + ldr r1, _0803F228 + movs r0, 0x4 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803F218: .4byte 0x0202420b +_0803F21C: .4byte 0x0202407e +_0803F220: .4byte 0x02024082 +_0803F224: .4byte 0x0202406c +_0803F228: .4byte 0x0202433a + thumb_func_end bs8_exit_by_flight + + thumb_func_start bs9_8016C9C +bs9_8016C9C: @ 803F22C + ldr r3, _0803F278 + ldr r1, _0803F27C + ldr r0, _0803F280 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + strb r2, [r3] + ldr r0, _0803F284 + movs r1, 0 + strh r1, [r0] + ldr r0, _0803F288 + strh r1, [r0] + ldr r1, _0803F28C + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, _0803F290 + 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, _0803F294 + ldr r0, _0803F298 + ldr r0, [r0, 0xC] + str r0, [r1] + ldr r1, _0803F29C + movs r0, 0xA + strb r0, [r1] + ldr r1, _0803F2A0 + movs r0, 0xC + strb r0, [r1, 0x1] + bx lr + .align 2, 0 +_0803F278: .4byte 0x0202420b +_0803F27C: .4byte 0x0202407e +_0803F280: .4byte 0x02024082 +_0803F284: .4byte 0x02022e14 +_0803F288: .4byte 0x02022e16 +_0803F28C: .4byte 0x02022f58 +_0803F290: .4byte 0x0202406e +_0803F294: .4byte 0x02024214 +_0803F298: .4byte 0x082dbd58 +_0803F29C: .4byte 0x02024083 +_0803F2A0: .4byte 0x0202407a + 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, _0803F2C4 + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + ldr r1, _0803F2C8 + movs r0, 0xC + strb r0, [r1] +_0803F2C0: + pop {r0} + bx r0 + .align 2, 0 +_0803F2C4: .4byte 0x0202449c +_0803F2C8: .4byte 0x02024083 + thumb_func_end bsB_exit_by_move + + thumb_func_start bsD_proceed +bsD_proceed: @ 803F2CC + ldr r1, _0803F2EC + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r3, _0803F2F0 + ldr r2, _0803F2F4 + ldrb r0, [r1] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r3] + ldr r2, _0803F2F8 + ldr r0, [r2] + ldr r1, _0803F2FC + ands r0, r1 + str r0, [r2] + bx lr + .align 2, 0 +_0803F2EC: .4byte 0x02024082 +_0803F2F0: .4byte 0x02024083 +_0803F2F4: .4byte 0x0202407a +_0803F2F8: .4byte 0x02024280 +_0803F2FC: .4byte 0xf1e892af + thumb_func_end bsD_proceed + + thumb_func_start bsC_8016D70 +bsC_8016D70: @ 803F300 + push {r4-r6,lr} + ldr r1, _0803F388 + ldr r2, _0803F38C + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + ldr r6, _0803F390 + 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, _0803F394 + ldr r1, _0803F398 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + bl sub_803D6A0 + ldr r2, _0803F39C + ldr r0, [r2] + ldr r1, _0803F3A0 + ands r0, r1 + str r0, [r2] + ldr r0, _0803F3A4 + movs r1, 0 + strh r1, [r0] + ldr r0, _0803F3A8 + movs r4, 0 + str r4, [r0] + ldr r0, _0803F3AC + strb r1, [r0] + ldr r5, _0803F3B0 + strb r1, [r5, 0x18] + strb r1, [r5, 0x19] + ldr r2, _0803F3B4 + ldr r3, _0803F3B8 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r2, _0803F3BC + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r0, [r6] + strb r1, [r0, 0x13] + ldr r0, _0803F3C0 + strh r4, [r0] + strb r1, [r5, 0x14] + ldr r0, _0803F3C4 + strb r1, [r0, 0x3] + strb r1, [r0, 0x4] + strb r1, [r5, 0x16] + ldr r0, _0803F3C8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803F388: .4byte 0x0202407e +_0803F38C: .4byte 0x02024082 +_0803F390: .4byte 0x0202449c +_0803F394: .4byte 0x02024083 +_0803F398: .4byte 0x0202407a +_0803F39C: .4byte 0x02024280 +_0803F3A0: .4byte 0xf1e892af +_0803F3A4: .4byte 0x020241ea +_0803F3A8: .4byte 0x020241f0 +_0803F3AC: .4byte 0x0202427c +_0803F3B0: .4byte 0x02024474 +_0803F3B4: .4byte 0x02024250 +_0803F3B8: .4byte 0x0202420b +_0803F3BC: .4byte 0x02024258 +_0803F3C0: .4byte 0x02024400 +_0803F3C4: .4byte 0x02024332 +_0803F3C8: .4byte 0x020244a8 + 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, _0803F3E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803F3E4: .4byte _0803F3E8 + .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, _0803F42C + ldrb r0, [r0] + b _0803F47A + .align 2, 0 +_0803F42C: .4byte 0x0202420c +_0803F430: + ldr r0, _0803F438 + ldrb r0, [r0] + b _0803F47A + .align 2, 0 +_0803F438: .4byte 0x0202420b +_0803F43C: + ldr r0, _0803F444 + ldrb r0, [r0] + b _0803F47A + .align 2, 0 +_0803F444: .4byte 0x0202420e +_0803F448: + movs r0, 0 + b _0803F47A +_0803F44C: + ldr r0, _0803F454 + ldrb r0, [r0, 0x17] + b _0803F47A + .align 2, 0 +_0803F454: .4byte 0x02024474 +_0803F458: + ldr r0, _0803F460 + ldrb r0, [r0] + b _0803F47A + .align 2, 0 +_0803F460: .4byte 0x0202420d +_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, _0803F4B0 + 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 + .align 2, 0 +_0803F4B0: .4byte 0x02024084 +_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, _0803F53C + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0803F540 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F532 + ldr r4, _0803F544 + 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 + .align 2, 0 +_0803F53C: .4byte 0x020242bc +_0803F540: .4byte 0x0832a328 +_0803F544: .4byte 0x02024064 + 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, _0803F668 + ldrb r0, [r0] + cmp r4, r0 + bge _0803F5F0 + ldr r1, _0803F66C + 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, _0803F66C + 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, _0803F668 + ldrb r0, [r0] + cmp r4, r0 + blt _0803F57E +_0803F5F0: + mov r1, r8 + cmp r1, 0x4 + beq _0803F658 + ldr r6, _0803F66C + 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, _0803F670 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0803F674 + mov r4, r8 + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F658 + ldr r4, _0803F678 + 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 + .align 2, 0 +_0803F668: .4byte 0x0202406c +_0803F66C: .4byte 0x02024084 +_0803F670: .4byte 0x020242bc +_0803F674: .4byte 0x0832a328 +_0803F678: .4byte 0x02024064 + 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, _0803F774 + mov r8, r0 + ldrb r0, [r0] + cmp r1, r0 + bge _0803F6FE + ldr r7, _0803F778 + 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, _0803F77C + 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, _0803F780 + 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, _0803F778 + 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, _0803F784 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0803F788 + lsls r0, r6, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F762 + ldr r4, _0803F78C + 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 + .align 2, 0 +_0803F774: .4byte 0x0202406c +_0803F778: .4byte 0x02024084 +_0803F77C: .4byte 0x02024090 +_0803F780: .4byte 0x020240a8 +_0803F784: .4byte 0x020242bc +_0803F788: .4byte 0x0832a328 +_0803F78C: .4byte 0x02024064 + thumb_func_end sub_803F67C + + thumb_func_start sub_803F790 +sub_803F790: @ 803F790 + push {r4,r5,lr} + ldr r0, _0803F7C0 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F7D0 + movs r2, 0 + ldr r4, _0803F7C4 + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, _0803F7C8 + ldr r5, _0803F7CC +_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 + .align 2, 0 +_0803F7C0: .4byte 0x02022fec +_0803F7C4: .4byte 0x0202406c +_0803F7C8: .4byte 0x02024068 +_0803F7CC: .4byte 0x0832a328 +_0803F7D0: + movs r2, 0 + ldr r4, _0803F7F4 + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, _0803F7F8 + ldr r5, _0803F7FC +_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 + .align 2, 0 +_0803F7F4: .4byte 0x0202406c +_0803F7F8: .4byte 0x02024068 +_0803F7FC: .4byte 0x0832a328 + 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, _0803F828 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F834 + ldr r2, _0803F82C + ldr r1, _0803F830 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _0803F844 + .align 2, 0 +_0803F828: .4byte 0x02022fec +_0803F82C: .4byte 0x02024068 +_0803F830: .4byte 0x0832a328 +_0803F834: + ldr r2, _0803F848 + ldr r1, _0803F84C + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] +_0803F844: + pop {r0} + bx r0 + .align 2, 0 +_0803F848: .4byte 0x02024068 +_0803F84C: .4byte 0x0832a328 + 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, _0803F864 + ldr r1, _0803F868 + lsls r0, r7, 2 + adds r6, r0, r1 + b _0803F87A + .align 2, 0 +_0803F864: .4byte 0x02024068 +_0803F868: .4byte 0x0832a328 +_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, _0803F89C + 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 + .align 2, 0 +_0803F89C: .4byte 0x02024068 + 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, _0803F8F0 + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, _0803F8F4 + ands r1, r2 + ldr r2, _0803F8F8 + ands r1, r2 + movs r2, 0x71 + negs r2, r2 + ands r1, r2 + ldr r2, _0803F8FC + ands r1, r2 + str r1, [r3] + ldr r1, _0803F900 + lsls r2, r0, 2 + adds r2, r1 + ldr r1, [r2] + ldr r3, _0803F904 + ands r1, r3 + str r1, [r2] + ldr r2, _0803F908 + 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 + .align 2, 0 +_0803F8F0: .4byte 0x02024084 +_0803F8F4: .4byte 0xffffefff +_0803F8F8: .4byte 0xfffff3ff +_0803F8FC: .4byte 0xfffffcff +_0803F900: .4byte 0x020242ac +_0803F904: .4byte 0xfffbff3f +_0803F908: .4byte 0x020242bc + thumb_func_end b_cancel_multi_turn_move_maybe + + thumb_func_start sub_803F90C +sub_803F90C: @ 803F90C + push {lr} + lsls r0, 24 + ldr r1, _0803F958 + 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 + .align 2, 0 +_0803F958: .4byte 0x0202433c +_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, _0803F984 + 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 + .align 2, 0 +_0803F984: .4byte 0x02024064 + thumb_func_end b_std_message + + thumb_func_start sub_803F988 +sub_803F988: @ 803F988 + push {r4-r6,lr} + movs r3, 0 + ldr r0, _0803F9DC + strb r3, [r0] + strb r3, [r0, 0x1] + movs r1, 0 + ldr r0, _0803F9E0 + ldrb r2, [r0] + adds r6, r0, 0 + cmp r1, r2 + bge _0803F9B6 + ldr r5, _0803F9E4 + adds r4, r2, 0 + ldr r2, _0803F9E8 +_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, _0803F9DC + 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 + .align 2, 0 +_0803F9DC: .4byte 0x020243fe +_0803F9E0: .4byte 0x0202406c +_0803F9E4: .4byte 0x0832a328 +_0803F9E8: .4byte 0x0202406e + 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, _0803FA5C + adds r0, r1 + strb r4, [r0] + adds r5, r4, 0 + ldr r0, _0803FA60 + ldrb r2, [r0] + mov r8, r1 + cmp r4, r2 + bge _0803FA4A + ldr r0, _0803FA64 + ldrb r7, [r0] + ldr r1, _0803FA68 + adds r6, r2, 0 + ldr r3, _0803FA6C + 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 + .align 2, 0 +_0803FA5C: .4byte 0x020243fe +_0803FA60: .4byte 0x0202406c +_0803FA64: .4byte 0x02024210 +_0803FA68: .4byte 0x0832a328 +_0803FA6C: .4byte 0x0202406e + 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, _0803FAC8 + ldrb r0, [r5] + cmp r3, r0 + bge _0803FAC2 + ldr r0, _0803FACC + mov r12, r0 + movs r7, 0x2 + ldr r6, _0803FAD0 + ldr r1, _0803FAD4 + 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 + .align 2, 0 +_0803FAC8: .4byte 0x0202406c +_0803FACC: .4byte 0x020243fe +_0803FAD0: .4byte 0x0832a328 +_0803FAD4: .4byte 0x0202406e + thumb_func_end sub_803FA70 + + thumb_func_start b_movescr_stack_push +b_movescr_stack_push: @ 803FAD8 + push {r4,lr} + ldr r1, _0803FAF8 + 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 + .align 2, 0 +_0803FAF8: .4byte 0x020244a8 + thumb_func_end b_movescr_stack_push + + thumb_func_start b_movescr_stack_push_cursor +b_movescr_stack_push_cursor: @ 803FAFC + ldr r0, _0803FB1C + 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, _0803FB20 + ldr r0, [r0] + str r0, [r2] + bx lr + .align 2, 0 +_0803FB1C: .4byte 0x020244a8 +_0803FB20: .4byte 0x02024214 + thumb_func_end b_movescr_stack_push_cursor + + thumb_func_start b_movescr_stack_pop_cursor +b_movescr_stack_pop_cursor: @ 803FB24 + ldr r3, _0803FB44 + ldr r0, _0803FB48 + 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 + .align 2, 0 +_0803FB44: .4byte 0x02024214 +_0803FB48: .4byte 0x020244a8 + 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, _0803FBCC + ldr r1, _0803FBD0 + ldr r3, _0803FBD4 + 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, _0803FBD8 + lsls r0, r4, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + ldr r1, _0803FBDC + 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, _0803FBE0 + strb r4, [r0, 0x17] + ldr r0, _0803FBE4 + strh r5, [r0] + ldr r0, _0803FBE8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FBF8 + ldr r1, _0803FBEC + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FBF0 + str r1, [r0] + ldr r0, _0803FBF4 + 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 + .align 2, 0 +_0803FBCC: .4byte 0x02024084 +_0803FBD0: .4byte 0x02023864 +_0803FBD4: .4byte 0x02024064 +_0803FBD8: .4byte 0x0202449c +_0803FBDC: .4byte 0x020242bc +_0803FBE0: .4byte 0x02024474 +_0803FBE4: .4byte 0x020241ea +_0803FBE8: .4byte 0x02022fec +_0803FBEC: .4byte 0x02024230 +_0803FBF0: .4byte 0x082dae2a +_0803FBF4: .4byte 0x0202433c +_0803FBF8: + ldr r0, _0803FC5C + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, _0803FC60 + str r0, [r1] + movs r6, 0x1 +_0803FC06: + ldr r1, _0803FC64 + 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, _0803FC68 + 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, _0803FC6C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FC7C + ldr r1, _0803FC70 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FC74 + str r1, [r0] + ldr r0, _0803FC78 + 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 + .align 2, 0 +_0803FC5C: .4byte 0x02024220 +_0803FC60: .4byte 0x082dae1f +_0803FC64: .4byte 0x02024248 +_0803FC68: .4byte 0x02024084 +_0803FC6C: .4byte 0x02022fec +_0803FC70: .4byte 0x02024230 +_0803FC74: .4byte 0x082db098 +_0803FC78: .4byte 0x0202433c +_0803FC7C: + ldr r1, _0803FCE4 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FCE8 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FC8E: + ldr r3, _0803FCEC +_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, _0803FCF0 + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0803FD1A + ldr r0, _0803FCF4 + strh r5, [r0] + ldr r0, _0803FCF8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FD08 + ldr r1, _0803FCFC + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FD00 + str r1, [r0] + ldr r0, _0803FD04 + 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 + .align 2, 0 +_0803FCE4: .4byte 0x02024220 +_0803FCE8: .4byte 0x082db089 +_0803FCEC: .4byte 0x020242bc +_0803FCF0: .4byte 0x0831c898 +_0803FCF4: .4byte 0x020241ea +_0803FCF8: .4byte 0x02022fec +_0803FCFC: .4byte 0x02024230 +_0803FD00: .4byte 0x082db0af +_0803FD04: .4byte 0x0202433c +_0803FD08: + ldr r1, _0803FD5C + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FD60 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FD1A: + ldr r4, _0803FD64 + ldrb r0, [r4] + adds r1, r5, 0 + bl sub_8040130 + lsls r0, 24 + cmp r0, 0 + beq _0803FD8E + ldr r0, _0803FD68 + strh r5, [r0] + ldr r0, _0803FD6C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FD7C + ldr r1, _0803FD70 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FD74 + str r1, [r0] + ldr r0, _0803FD78 + 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 + .align 2, 0 +_0803FD5C: .4byte 0x02024220 +_0803FD60: .4byte 0x082db0a0 +_0803FD64: .4byte 0x02024064 +_0803FD68: .4byte 0x020241ea +_0803FD6C: .4byte 0x02022fec +_0803FD70: .4byte 0x02024230 +_0803FD74: .4byte 0x082db185 +_0803FD78: .4byte 0x0202433c +_0803FD7C: + ldr r1, _0803FDB0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0803FDB4 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FD8E: + ldr r1, _0803FDB8 + ldr r0, _0803FDBC + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803FDC4 + ldr r1, _0803FDC0 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + b _0803FDCE + .align 2, 0 +_0803FDB0: .4byte 0x02024220 +_0803FDB4: .4byte 0x082db181 +_0803FDB8: .4byte 0x02024084 +_0803FDBC: .4byte 0x02024064 +_0803FDC0: .4byte 0x02024404 +_0803FDC4: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0803FDCE: + ldr r2, _0803FE28 + ldr r1, _0803FE2C + ldrb r0, [r1] + strb r0, [r2] + ldr r0, _0803FE30 + 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, _0803FE34 + cmp r2, r0 + beq _0803FE58 + cmp r2, r5 + beq _0803FE58 + ldr r0, _0803FE38 + strh r1, [r0] + ldr r2, _0803FE3C + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, _0803FE40 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r1, r0 + ldrb r2, [r7] + cmp r1, 0 + beq _0803FE48 + ldr r0, _0803FE44 + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FE58 + .align 2, 0 +_0803FE28: .4byte 0x0202420f +_0803FE2C: .4byte 0x02024064 +_0803FE30: .4byte 0x02024084 +_0803FE34: .4byte 0x0000ffff +_0803FE38: .4byte 0x020241ea +_0803FE3C: .4byte 0x02024208 +_0803FE40: .4byte 0x02022fec +_0803FE44: .4byte 0x0202433c +_0803FE48: + ldr r1, _0803FE94 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, _0803FE98 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FE58: + ldr r0, _0803FE9C + 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, _0803FEA0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FEA8 + ldr r0, _0803FEA4 + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FEB8 + .align 2, 0 +_0803FE94: .4byte 0x02024220 +_0803FE98: .4byte 0x082db812 +_0803FE9C: .4byte 0x02023864 +_0803FEA0: .4byte 0x02022fec +_0803FEA4: .4byte 0x0202433c +_0803FEA8: + ldr r1, _0803FEC4 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, _0803FEC8 + 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 + .align 2, 0 +_0803FEC4: .4byte 0x02024220 +_0803FEC8: .4byte 0x082db076 + 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, _0803FF10 + lsls r0, r7, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r1, r0 + str r1, [sp, 0x4] + ldr r1, _0803FF14 + movs r0, 0x58 + muls r0, r7 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803FF1C + ldr r2, _0803FF18 + lsls r1, r7, 3 + subs r0, r1, r7 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + str r0, [sp] + b _0803FF2E + .align 2, 0 +_0803FF10: .4byte 0x0202449c +_0803FF14: .4byte 0x02024084 +_0803FF18: .4byte 0x02024404 +_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, _080400A8 + strb r7, [r0] + movs r0, 0 + mov r9, r0 + lsls r2, r7, 1 + str r2, [sp, 0xC] + ldr r5, _080400AC + mov r12, r5 + ldr r0, _080400B0 + movs r2, 0x58 + adds r6, r7, 0 + muls r6, r2 + str r6, [sp, 0x8] + ldr r2, _080400B4 + 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, _080400B8 +_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, _080400B4 + adds r0, r1 + mov r12, r0 + ldr r1, _080400BC + 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, _080400AC + 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, _080400C0 + 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, _080400AC + 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, _080400C4 + 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 + .align 2, 0 +_080400A8: .4byte 0x0202420f +_080400AC: .4byte 0x020242bc +_080400B0: .4byte 0x02024084 +_080400B4: .4byte 0x02024090 +_080400B8: .4byte 0x0832a328 +_080400BC: .4byte 0x02024248 +_080400C0: .4byte 0x0831c898 +_080400C4: .4byte 0x0000ffff + thumb_func_end sub_803FECC + + thumb_func_start sub_80400C8 +sub_80400C8: @ 80400C8 + push {r4,lr} + ldr r4, _080400FC + 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, _08040100 + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, _08040104 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08040108 + str r1, [r0] + b _0804011E + .align 2, 0 +_080400FC: .4byte 0x02024064 +_08040100: .4byte 0x0202433c +_08040104: .4byte 0x02024220 +_08040108: .4byte 0x082db072 +_0804010C: + ldr r0, _0804012C + 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 + .align 2, 0 +_0804012C: .4byte 0x0202433c + 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, _080401C4 + ldrb r0, [r0] + cmp r6, r0 + bge _080401B4 + ldr r7, _080401C8 + 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, _080401CC + 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, _080401C4 + 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 + .align 2, 0 +_080401C4: .4byte 0x0202406c +_080401C8: .4byte 0x02024090 +_080401CC: .4byte 0x020242ac + 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, _08040274 + mov r2, r9 + strb r2, [r1] + ldr r0, _08040278 + ldrb r4, [r0] + adds r6, r1, 0 + mov r10, r0 + ldr r7, _0804027C + ldr r3, _08040280 + mov r12, r3 + cmp r9, r4 + bcs _08040224 + ldr r2, _08040284 + ldrb r1, [r2] + ldr r5, _08040288 + 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, _08040284 + ldrb r1, [r2] + ldr r5, _08040288 + 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, _0804028C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08040274: .4byte 0x0202420b +_08040278: .4byte 0x0202406c +_0804027C: .4byte 0x0202420c +_08040280: .4byte 0x0202449c +_08040284: .4byte 0x02024210 +_08040288: .4byte 0x0832a328 +_0804028C: .4byte _08040290 + .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, _080402DC + mov r10, r1 + ldrb r2, [r1] + cmp r5, r2 + bge _080402D6 + ldr r2, _080402E0 +_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 + .align 2, 0 +_080402DC: .4byte 0x0202406c +_080402E0: .4byte 0x0202407e +_080402E4: + adds r4, r5, 0x1 + adds r6, r4, 0 + ldrb r1, [r1] + cmp r6, r1 + bge _08040322 + ldr r7, _080403E0 + ldr r0, _080403E4 + 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, _080403E4 + 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, _080403E8 + 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, _080403EC + mov r8, r3 + movs r7, 0 + ldr r6, _080403F0 + ldr r5, _080403F4 +_0804035A: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, _080403F8 + 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, _080403FC + 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, _08040400 + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, _08040404 + 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, _080403E8 + 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 + .align 2, 0 +_080403E0: .4byte 0x0202407e +_080403E4: .4byte 0x0202406c +_080403E8: .4byte 0x0202449c +_080403EC: .4byte 0x02024064 +_080403F0: .4byte 0x0202420b +_080403F4: .4byte 0x02022f58 +_080403F8: .4byte 0x02024294 +_080403FC: .4byte 0x0202428e +_08040400: .4byte 0x0000fffe +_08040404: .4byte 0x082dacfa +_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, _080404B0 + ldr r5, _080404B4 +_08040422: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, _080404B8 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + strb r0, [r7] + ldr r3, _080404BC + strb r0, [r3] + ldr r0, _080404C0 + 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, _080404C4 + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, _080404C8 + bl b_call_bc_move_exec + ldr r0, _080404CC + 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, _080404D0 + 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 + .align 2, 0 +_080404B0: .4byte 0x0202420b +_080404B4: .4byte 0x02022f58 +_080404B8: .4byte 0x02024294 +_080404BC: .4byte 0x02024064 +_080404C0: .4byte 0x0202428e +_080404C4: .4byte 0x0000fffd +_080404C8: .4byte 0x082dacfa +_080404CC: .4byte 0x02024332 +_080404D0: .4byte 0x0202449c +_080404D4: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bhi _08040570 + ldr r0, _0804058C + mov r10, r0 + movs r2, 0 + mov r8, r2 + ldr r7, _08040590 + ldr r5, _08040594 +_080404EC: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r1, _08040598 + 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, _0804059C + adds r2, r3, r2 + ldrh r0, [r2] + ldr r3, _080405A0 + adds r1, r3, 0 + ands r0, r1 + strh r0, [r2] + ldr r0, _080405A4 + bl b_call_bc_move_exec + ldr r0, _080405A8 + 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, _080405AC + 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 + .align 2, 0 +_0804058C: .4byte 0x02024064 +_08040590: .4byte 0x0202420b +_08040594: .4byte 0x02022f58 +_08040598: .4byte 0x02024294 +_0804059C: .4byte 0x0202428e +_080405A0: .4byte 0x0000feff +_080405A4: .4byte 0x082dacfa +_080405A8: .4byte 0x02024332 +_080405AC: .4byte 0x0202449c +_080405B0: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0804062C + ldr r6, _0804064C + ldr r5, _08040650 +_080405C0: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, _08040654 + 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, _08040658 + 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, _0804065C + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, _08040660 + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804060A: + ldr r2, _08040664 + 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 + .align 2, 0 +_0804064C: .4byte 0x02024064 +_08040650: .4byte 0x0202420b +_08040654: .4byte 0x02024294 +_08040658: .4byte 0x0202428e +_0804065C: .4byte 0x0000ffdf +_08040660: .4byte 0x082dad0b +_08040664: .4byte 0x0202449c +_08040668: + mov r2, r12 + ldr r0, [r2] + adds r0, 0xDB + ldr r1, _080406FC + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080406E8 + ldr r4, _08040700 + ldr r5, _08040704 +_0804067C: + ldr r0, [r2] + adds r0, 0xDB + ldrb r0, [r0] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, _08040708 + 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, _0804070C + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080406C4 + ldr r0, _08040710 + strb r2, [r0] + ldr r0, _08040714 + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080406C4: + ldr r2, _08040718 + 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, _080406FC + 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 + .align 2, 0 +_080406FC: .4byte 0x0202406c +_08040700: .4byte 0x02024064 +_08040704: .4byte 0x0202407e +_08040708: .4byte 0x020243d0 +_0804070C: .4byte 0x02024084 +_08040710: .4byte 0x0202420c +_08040714: .4byte 0x082db0b7 +_08040718: .4byte 0x0202449c +_0804071C: + ldr r3, _08040754 + 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, _08040758 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08040768 + ldr r0, _0804075C + ands r0, r2 + ldr r1, _08040760 + ands r0, r1 + strh r0, [r3] + ldr r1, _08040764 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08040794 + .align 2, 0 +_08040754: .4byte 0x020243cc +_08040758: .4byte 0x020243d0 +_0804075C: .4byte 0x0000fffe +_08040760: .4byte 0x0000fffd +_08040764: .4byte 0x02024332 +_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, _0804078C + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08040794 + .align 2, 0 +_0804078C: .4byte 0x02024332 +_08040790: + ldr r0, _08040798 + strb r1, [r0, 0x5] +_08040794: + ldr r0, _0804079C + b _080408BA + .align 2, 0 +_08040798: .4byte 0x02024332 +_0804079C: .4byte 0x082dac2c +_080407A0: + ldr r3, _080407D4 + 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, _080407D8 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080407E8 + ldr r0, _080407DC + ands r0, r2 + strh r0, [r3] + ldr r1, _080407E0 + ldr r0, _080407E4 + b _080407EC + .align 2, 0 +_080407D4: .4byte 0x020243cc +_080407D8: .4byte 0x020243d0 +_080407DC: .4byte 0x0000fff7 +_080407E0: .4byte 0x02024214 +_080407E4: .4byte 0x082dacc9 +_080407E8: + ldr r1, _08040800 + ldr r0, _08040804 +_080407EC: + str r0, [r1] + adds r3, r1, 0 + ldr r1, _08040808 + movs r2, 0 + movs r0, 0xC + strb r0, [r1, 0x10] + ldr r0, _0804080C + strb r2, [r0, 0x5] + b _080408B8 + .align 2, 0 +_08040800: .4byte 0x02024214 +_08040804: .4byte 0x082dac47 +_08040808: .4byte 0x02024474 +_0804080C: .4byte 0x02024332 +_08040810: + ldr r3, _08040840 + 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, _08040844 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08040854 + ldr r0, _08040848 + ands r0, r2 + strh r0, [r3] + ldr r1, _0804084C + ldr r0, _08040850 + b _08040858 + .align 2, 0 +_08040840: .4byte 0x020243cc +_08040844: .4byte 0x020243d0 +_08040848: .4byte 0x0000ffdf +_0804084C: .4byte 0x02024214 +_08040850: .4byte 0x082dace0 +_08040854: + ldr r1, _08040860 + ldr r0, _08040864 +_08040858: + str r0, [r1] + adds r3, r1, 0 + b _080408B8 + .align 2, 0 +_08040860: .4byte 0x02024214 +_08040864: .4byte 0x082dacd2 +_08040868: + ldr r3, _08040890 + ldrh r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080408C8 + ldr r1, _08040894 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080408A4 + ldr r0, _08040898 + ands r0, r2 + strh r0, [r3] + ldr r1, _0804089C + ldr r0, _080408A0 + b _080408A8 + .align 2, 0 +_08040890: .4byte 0x020243cc +_08040894: .4byte 0x020243d0 +_08040898: .4byte 0x0000ff7f +_0804089C: .4byte 0x02024214 +_080408A0: .4byte 0x082dacc9 +_080408A4: + ldr r1, _080408D8 + ldr r0, _080408DC +_080408A8: + str r0, [r1] + adds r3, r1, 0 + ldr r1, _080408E0 + movs r0, 0xD + strb r0, [r1, 0x10] + ldr r1, _080408E4 + 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, _080408E8 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + mov r12, r2 + b _080408F6 + .align 2, 0 +_080408D8: .4byte 0x02024214 +_080408DC: .4byte 0x082dac47 +_080408E0: .4byte 0x02024474 +_080408E4: .4byte 0x02024332 +_080408E8: .4byte 0x0202449c +_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, _0804091C + ldr r1, [r0] + ldr r0, _08040920 + 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 + .align 2, 0 +_0804091C: .4byte 0x03005d04 +_08040920: .4byte sub_803B9BC + 1 + 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, _08040958 + ldr r0, [r2] + ldr r1, _0804095C + orrs r0, r1 + str r0, [r2] + ldr r5, _08040960 + ldr r2, [r5] + ldr r0, _08040964 + ldrb r1, [r2, 0x1] + adds r7, r5, 0 + mov r8, r0 + ldrb r3, [r0] + cmp r1, r3 + bcc _08040954 + bl _08041338 +_08040954: + bl _0804132E + .align 2, 0 +_08040958: .4byte 0x02024280 +_0804095C: .4byte 0x01000020 +_08040960: .4byte 0x0202449c +_08040964: .4byte 0x0202406c +_08040968: + ldr r3, _0804099C + ldr r4, _080409A0 + ldr r1, _080409A4 + ldr r5, [r5] + ldrb r0, [r5, 0x1] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + strb r0, [r3] + ldr r0, _080409A8 + ldrb r1, [r0] + ldr r2, _080409AC + 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 + .align 2, 0 +_0804099C: .4byte 0x02024064 +_080409A0: .4byte 0x0202420b +_080409A4: .4byte 0x0202407e +_080409A8: .4byte 0x02024210 +_080409AC: .4byte 0x0832a328 +_080409B0: + ldrb r0, [r5] + cmp r0, 0x13 + bls _080409BA + bl _08041312 +_080409BA: + lsls r0, 2 + ldr r1, _080409C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080409C4: .4byte _080409C8 + .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, _08040A68 + 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, _08040A6C + 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, _08040A70 + 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, _08040A74 + bl _080412D0 + .align 2, 0 +_08040A68: .4byte 0x020242ac +_08040A6C: .4byte 0x02024084 +_08040A70: .4byte 0x020241f0 +_08040A74: .4byte 0x082db0ee +_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, _08040B2C + 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, _08040B30 + 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, _08040B34 + strb r5, [r0] + ldr r2, _08040B38 + 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, _08040B3C + strb r5, [r1, 0x10] + ldrb r0, [r4] + strb r0, [r1, 0x11] + ldr r0, _08040B40 + b _080412D0 + .align 2, 0 +_08040B2C: .4byte 0x020242ac +_08040B30: .4byte 0x02024084 +_08040B34: .4byte 0x0202420c +_08040B38: .4byte 0x020241f0 +_08040B3C: .4byte 0x02024474 +_08040B40: .4byte 0x082dad15 +_08040B44: + ldr r2, _08040B80 + 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, _08040B84 + ldrh r0, [r1, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040B7A + movs r0, 0x1 + str r0, [r2] +_08040B7A: + ldr r0, _08040B88 + b _080412D0 + .align 2, 0 +_08040B80: .4byte 0x02024084 +_08040B84: .4byte 0x020241f0 +_08040B88: .4byte 0x082db23d +_08040B8C: + ldr r4, _08040C00 + 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, _08040C04 + 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, _08040C08 + b _080412D0 + .align 2, 0 +_08040C00: .4byte 0x02024084 +_08040C04: .4byte 0x020241f0 +_08040C08: .4byte 0x082db23d +_08040C0C: + ldr r2, _08040C48 + 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, _08040C4C + ldrh r0, [r1, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040C42 + movs r0, 0x1 + str r0, [r2] +_08040C42: + ldr r0, _08040C50 + b _080412D0 + .align 2, 0 +_08040C48: .4byte 0x02024084 +_08040C4C: .4byte 0x020241f0 +_08040C50: .4byte 0x082db25f +_08040C54: + ldr r4, _08040CA0 + 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, _08040CA4 + ldrh r0, [r3, 0x2C] + lsrs r0, 2 + str r0, [r1] + cmp r0, 0 + bne _08040C9A + movs r0, 0x1 + str r0, [r1] +_08040C9A: + ldr r0, _08040CA8 + b _080412D0 + .align 2, 0 +_08040CA0: .4byte 0x02024084 +_08040CA4: .4byte 0x020241f0 +_08040CA8: .4byte 0x082db33f +_08040CAC: + ldr r0, _08040CB4 + ands r2, r0 + str r2, [r5] + b _080412DE + .align 2, 0 +_08040CB4: .4byte 0xf7ffffff +_08040CB8: + ldr r2, _08040CF4 + 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, _08040CF8 + ldrh r0, [r1, 0x2C] + lsrs r0, 2 + str r0, [r2] + cmp r0, 0 + bne _08040CF0 + movs r0, 0x1 + str r0, [r2] +_08040CF0: + ldr r0, _08040CFC + b _080412D0 + .align 2, 0 +_08040CF4: .4byte 0x02024084 +_08040CF8: .4byte 0x020241f0 +_08040CFC: .4byte 0x082db350 +_08040D00: + ldr r3, _08040DA0 + 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, _08040DA4 + 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, _08040DA8 + ldr r0, _08040DAC + 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, _08040DB0 + 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, _08040DB4 + ldr r0, _08040DB8 + str r0, [r1] + ldr r2, _08040DBC + 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 + .align 2, 0 +_08040DA0: .4byte 0x02024084 +_08040DA4: .4byte 0xffffe000 +_08040DA8: .4byte 0x02024474 +_08040DAC: .4byte 0x0202449c +_08040DB0: .4byte 0x02022f58 +_08040DB4: .4byte 0x02024214 +_08040DB8: .4byte 0x082db30e +_08040DBC: .4byte 0x020241f0 +_08040DC0: + ldr r2, _08040DF0 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x2 + strb r0, [r2, 0x1] + ldrb r1, [r6] + ldr r0, _08040DF4 + 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, _08040DF8 + ldr r0, _08040DFC + str r0, [r1] +_08040DEC: + ldr r0, [r1] + b _080412D0 + .align 2, 0 +_08040DF0: .4byte 0x02022f58 +_08040DF4: .4byte 0x0202449c +_08040DF8: .4byte 0x02024214 +_08040DFC: .4byte 0x082db320 +_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, _08040E50 + ands r0, r1 + str r0, [r2] + ldr r1, _08040E54 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, _08040E58 + bl b_call_bc_move_exec + ldr r4, _08040E5C + 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 + .align 2, 0 +_08040E50: .4byte 0xf7ffffff +_08040E54: .4byte 0x02024332 +_08040E58: .4byte 0x082db234 +_08040E5C: .4byte 0x02024064 +_08040E60: + ldr r2, _08040EDC + 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, _08040EE0 + ldr r1, _08040EE4 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + beq _08040EE8 + movs r3, 0x2 + mov r9, r3 + b _08041318 + .align 2, 0 +_08040EDC: .4byte 0x02024084 +_08040EE0: .4byte 0x0202420b +_08040EE4: .4byte 0x0202406c +_08040EE8: + ldr r5, _08040F20 + ldrb r0, [r5] + strb r0, [r2] + ldr r2, _08040F24 + 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, _08040F28 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08040F60 + .align 2, 0 +_08040F20: .4byte 0x02024064 +_08040F24: .4byte 0x02024084 +_08040F28: .4byte 0x02024332 +_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, _08040F50 + strb r4, [r0, 0x5] + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + b _08040F60 + .align 2, 0 +_08040F50: .4byte 0x02024332 +_08040F54: + ldr r1, _08040F74 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r3, 0 + bl b_cancel_multi_turn_move_maybe +_08040F60: + ldr r0, _08040F78 + 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 + .align 2, 0 +_08040F74: .4byte 0x02024332 +_08040F78: .4byte 0x082db2a6 +_08040F7C: + ldr r1, _08040FB4 + 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, _08040FB8 + 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 + .align 2, 0 +_08040FB4: .4byte 0x02024084 +_08040FB8: .4byte 0xfffffc00 +_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, _08041018 + 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, _0804101C + 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, _08041020 + bl b_call_bc_move_exec + b _080412D4 + .align 2, 0 +_08041018: .4byte 0xffffefff +_0804101C: .4byte 0x02024332 +_08041020: .4byte 0x082db2af +_08041024: + ldr r0, _080410A4 + 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, _080410A8 + 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 + .align 2, 0 +_080410A4: .4byte 0x020242bc +_080410A8: .4byte 0x02024084 +_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, _080410E4 + b _080412D0 + .align 2, 0 +_080410E4: .4byte 0x082dae23 +_080410E8: + ldr r3, _08041134 + 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, _08041138 + 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 + .align 2, 0 +_08041134: .4byte 0x020242bc +_08041138: .4byte 0x02024084 +_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, _08041198 + b _080412D0 + .align 2, 0 +_08041198: .4byte 0x082dae37 +_0804119C: + ldr r0, _080411B8 + 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 + .align 2, 0 +_080411B8: .4byte 0x020242ac +_080411BC: + ldr r2, _080411FC + 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, _08041200 + ldrb r2, [r6] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, _08041204 + ands r0, r1 + str r0, [r2] +_080411F6: + ldr r1, [r7] + b _080412E2 + .align 2, 0 +_080411FC: .4byte 0x020242bc +_08041200: .4byte 0x020242ac +_08041204: .4byte 0xfffffdff +_08041208: + ldr r2, _08041234 + 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 + .align 2, 0 +_08041234: .4byte 0x020242bc +_08041238: + ldr r4, _080412EC + 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, _080412F0 + 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, _080412F4 + 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, _080412F8 + ldrb r0, [r6] + strb r0, [r1] + ldr r0, _080412FC +_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, _08041300 + ldr r1, [r0] +_080412E2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08041312 + .align 2, 0 +_080412EC: .4byte 0x020242ac +_080412F0: .4byte 0xfffff800 +_080412F4: .4byte 0x02024084 +_080412F8: .4byte 0x0202420e +_080412FC: .4byte 0x082db378 +_08041300: .4byte 0x0202449c +_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, _08041354 + ldr r2, [r5] + ldr r0, _08041358 + 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, _0804135C + ldr r1, [r0] + ldr r2, _08041360 + 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 + .align 2, 0 +_08041354: .4byte 0x0202449c +_08041358: .4byte 0x0202406c +_0804135C: .4byte 0x02024280 +_08041360: .4byte 0xfeffffdf + 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, _08041398 + ldr r0, [r2] + ldr r1, _0804139C + orrs r0, r1 + str r0, [r2] + ldr r1, _080413A0 + 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 + .align 2, 0 +_08041398: .4byte 0x02024280 +_0804139C: .4byte 0x01000020 +_080413A0: .4byte 0x0202449c +_080413A4: + cmp r0, 0x2 + bne _080413AA + b _0804169A +_080413AA: + b _08041708 +_080413AC: + ldr r2, _080413F0 + adds r0, r3, r2 + ldr r1, _080413F4 + ldrb r0, [r0] + mov r8, r1 + ldrb r7, [r1] + cmp r0, r7 + bcc _080413BE + b _08041532 +_080413BE: + ldr r4, _080413F8 + ldr r5, _080413FC + ldr r7, _08041400 + 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, _08041404 + ldrb r1, [r0] + ldr r2, _08041408 + 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 + .align 2, 0 +_080413F0: .4byte 0x000001a1 +_080413F4: .4byte 0x0202406c +_080413F8: .4byte 0x02024064 +_080413FC: .4byte 0x02022f58 +_08041400: .4byte 0x020243d0 +_08041404: .4byte 0x02024210 +_08041408: .4byte 0x0832a328 +_0804140C: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, _08041450 + 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, _08041454 + 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, _08041458 + strb r3, [r0, 0x5] + b _08041462 + .align 2, 0 +_08041450: .4byte 0x020243d0 +_08041454: .4byte 0x02024084 +_08041458: .4byte 0x02024332 +_0804145C: + ldr r1, _080414FC + 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, _08041500 + ldrb r0, [r4] + strb r0, [r5] + ldr r1, _08041504 + adds r0, r7, 0x4 + ldrb r2, [r4] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r2, _08041508 + ldrb r0, [r4] + lsls r0, 2 + adds r1, r7, 0 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r2, _0804150C + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, _08041510 + str r1, [r0] + ldr r0, _08041514 + 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, _08041518 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + ldr r4, _0804151C + adds r2, r4, 0 + ands r1, r2 + strh r1, [r0] + b _08041664 + .align 2, 0 +_080414FC: .4byte 0x02024332 +_08041500: .4byte 0x0202420c +_08041504: .4byte 0x0202420b +_08041508: .4byte 0x020241f0 +_0804150C: .4byte 0x0202437c +_08041510: .4byte 0x0000ffff +_08041514: .4byte 0x082dafe4 +_08041518: .4byte 0x0202428e +_0804151C: .4byte 0x0000ffbf +_08041520: + ldr r0, [r6] + ldr r2, _08041598 + 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, _08041598 + adds r1, r0, r3 + movs r0, 0 + strb r0, [r1] +_08041548: + adds r3, r6, 0 + ldr r0, [r6] + ldr r2, _08041598 + adds r0, r2 + ldr r1, _0804159C + ldrb r0, [r0] + mov r8, r1 + ldrb r4, [r1] + cmp r0, r4 + bcc _0804155E + b _08041684 +_0804155E: + ldr r5, _080415A0 + ldr r4, _080415A4 + ldr r7, _080415A8 + mov r12, r7 + ldr r0, _080415AC + mov r9, r0 +_0804156A: + ldr r1, _080415B0 + 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, _080415B4 + ldrb r1, [r0] + ldr r2, _080415B8 + 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 + .align 2, 0 +_08041598: .4byte 0x000001a1 +_0804159C: .4byte 0x0202406c +_080415A0: .4byte 0x02024064 +_080415A4: .4byte 0x02022f58 +_080415A8: .4byte 0x020242bc +_080415AC: .4byte 0x0202420b +_080415B0: .4byte 0x0202407e +_080415B4: .4byte 0x02024210 +_080415B8: .4byte 0x0832a328 +_080415BC: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r7, _08041630 + 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, _08041634 + ldr r2, _08041638 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + str r0, [r3] + ldr r1, _0804163C + ldr r0, _08041640 + b _0804165C + .align 2, 0 +_08041630: .4byte 0x020242ac +_08041634: .4byte 0x020241f0 +_08041638: .4byte 0x02024084 +_0804163C: .4byte 0x02024214 +_08041640: .4byte 0x082daf05 +_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, _08041668 + ldr r0, _0804166C +_0804165C: + str r0, [r1] + ldr r0, [r1] + bl b_call_bc_move_exec +_08041664: + movs r0, 0x1 + b _08041714 + .align 2, 0 +_08041668: .4byte 0x02024214 +_0804166C: .4byte 0x082daf20 +_08041670: + adds r3, r6, 0 + ldr r0, [r6] + ldr r2, _080416F0 + 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, _080416F0 + adds r1, r0, r3 + movs r0, 0 + strb r0, [r1] +_0804169A: + ldr r0, _080416F4 + 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, _080416F8 + 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, _080416FC + ldr r0, _08041700 + str r0, [r1] + bl b_call_bc_move_exec + ldr r0, _08041704 + ldr r1, [r0] + movs r4, 0xD0 + lsls r4, 1 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08041664 + .align 2, 0 +_080416F0: .4byte 0x000001a1 +_080416F4: .4byte 0x02022fec +_080416F8: .4byte 0x02024084 +_080416FC: .4byte 0x02024214 +_08041700: .4byte 0x082db8f3 +_08041704: .4byte 0x0202449c +_08041708: + mov r7, r10 + ldr r0, [r7] + ldr r1, _08041724 + 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 + .align 2, 0 +_08041724: .4byte 0xfeffffdf + 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, _08041740 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08041770 + b _08041A0A + .align 2, 0 +_08041740: .4byte 0x02022fec +_08041744: + ldr r0, _08041754 + bl b_call_bc_move_exec + ldr r0, [r5] + adds r0, 0x4D + movs r1, 0x2 + b _08041764 + .align 2, 0 +_08041754: .4byte 0x082da7c4 +_08041758: + ldr r0, _0804176C + 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 + .align 2, 0 +_0804176C: .4byte 0x082da7cd +_08041770: + ldr r0, _0804178C + 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, _08041790 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804178C: .4byte 0x0202449c +_08041790: .4byte _08041794 + .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, _08041880 + ldrb r0, [r0] + cmp r5, r0 + bge _08041806 + ldr r6, _08041884 +_080417D4: + ldrb r0, [r6] + ldr r2, _08041888 + 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, _08041880 + ldrb r0, [r0] + cmp r5, r0 + blt _080417D4 +_08041806: + ldr r0, _0804188C + mov r8, r0 + ldr r1, _08041890 + mov r12, r1 + ldr r2, _08041894 + mov r5, r8 + ldr r7, _08041898 + ldr r6, _0804189C +_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, _08041888 + 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, _08041884 + 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, _08041880 + 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 + .align 2, 0 +_08041880: .4byte 0x0202406c +_08041884: .4byte 0x02024210 +_08041888: .4byte 0x0832a328 +_0804188C: .4byte 0x0202449c +_08041890: .4byte 0x0202420d +_08041894: .4byte 0x0202420c +_08041898: .4byte 0x02024084 +_0804189C: .4byte 0x0202406e +_080418A0: + ldr r0, _080418CC + ldrb r0, [r0] + bl sub_803F9EC + ldr r2, _080418D0 + ldr r1, [r2] + adds r1, 0x4E + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, _080418D4 + 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 + .align 2, 0 +_080418CC: .4byte 0x0202420d +_080418D0: .4byte 0x0202449c +_080418D4: .4byte 0x0202406c +_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, _08041944 + mov r12, r0 + ldr r7, _08041948 + ldr r5, _0804194C + ldr r2, _08041950 + ldr r6, _08041954 +_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, _08041958 + 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, _0804195C + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _08041902 + b _08041978 + .align 2, 0 +_08041944: .4byte 0x0202420d +_08041948: .4byte 0x0202420c +_0804194C: .4byte 0x0202449c +_08041950: .4byte 0x02024084 +_08041954: .4byte 0x0832a328 +_08041958: .4byte 0x02024210 +_0804195C: .4byte 0x0202406c +_08041960: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4E + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, _08041984 + 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 + .align 2, 0 +_08041984: .4byte 0x0202406c +_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, _08041A18 + 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 + .align 2, 0 +_08041A18: .4byte 0x0202449c + 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, _08041A5C + adds r5, r0, 0 + ldrb r0, [r5] + cmp r3, r0 + bge _08041A54 + ldr r4, _08041A60 + movs r6, 0x80 + lsls r6, 16 + ldr r2, _08041A64 +_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, _08041A68 + 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 + .align 2, 0 +_08041A5C: .4byte 0x0202406c +_08041A60: .4byte 0x02024274 +_08041A64: .4byte 0x020240d4 +_08041A68: .4byte 0xff7fffff + 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, _08041A88 + mov r10, r1 + ldr r2, _08041A8C + mov r8, r2 + b _08041A9A + .align 2, 0 +_08041A88: .4byte 0x02024478 +_08041A8C: .4byte 0x0202449c +_08041A90: + mov r3, r9 + cmp r3, 0 + beq _08041A9A + bl _08042388 +_08041A9A: + mov r4, r8 + ldr r0, [r4] + ldr r7, _08041AB8 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xE + bls _08041AAC + bl _08042376 +_08041AAC: + lsls r0, 2 + ldr r1, _08041ABC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08041AB8: .4byte 0x000001a3 +_08041ABC: .4byte _08041AC0 + .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, _08041B30 + ldr r3, _08041B34 + ldrb r2, [r3] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, _08041B38 + ands r0, r1 + str r0, [r2] + ldr r0, _08041B3C + ldrb r2, [r3] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, _08041B40 + ands r0, r1 + str r0, [r2] + mov r1, r8 + ldr r0, [r1] + ldr r2, _08041B44 + adds r1, r0, r2 + bl _08042370 + .align 2, 0 +_08041B30: .4byte 0x02024084 +_08041B34: .4byte 0x0202420b +_08041B38: .4byte 0xfdffffff +_08041B3C: .4byte 0x020242ac +_08041B40: .4byte 0xffffbfff +_08041B44: .4byte 0x000001a3 +_08041B48: + ldr r7, _08041BB0 + ldr r4, _08041BB4 + 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, _08041BB8 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, _08041BBC + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r1, _08041BC0 + ldr r0, _08041BC4 + str r0, [r1] + movs r4, 0x2 + mov r9, r4 + b _08041C6E + .align 2, 0 +_08041BB0: .4byte 0x02024084 +_08041BB4: .4byte 0x0202420b +_08041BB8: .4byte 0xf7ffffff +_08041BBC: .4byte 0x02024332 +_08041BC0: .4byte 0x02024214 +_08041BC4: .4byte 0x082db220 +_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, _08041C38 + ldr r0, _08041C3C + 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, _08041C40 + ldrh r0, [r0] + cmp r0, 0xAD + beq _08041C6E + cmp r0, 0xD6 + beq _08041C6E + ldr r1, _08041C44 + ldr r0, _08041C48 + str r0, [r1] + ldr r2, _08041C4C + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x2 + mov r9, r0 + b _08041C6E + .align 2, 0 +_08041C38: .4byte 0x02024084 +_08041C3C: .4byte 0x0202420b +_08041C40: .4byte 0x020241ea +_08041C44: .4byte 0x02024214 +_08041C48: .4byte 0x082db213 +_08041C4C: .4byte 0x02024280 +_08041C50: + adds r2, 0x50 + adds r2, r1, r2 + ldr r0, [r2] + ldr r1, _08041C78 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r0, _08041C7C + strb r4, [r0, 0x5] + ldr r1, _08041C80 + ldr r0, _08041C84 + str r0, [r1] + movs r1, 0x2 + mov r9, r1 +_08041C6E: + ldr r1, _08041C88 + ldr r0, [r1] + ldr r3, _08041C8C + adds r2, r0, r3 + b _0804216A + .align 2, 0 +_08041C78: .4byte 0xf7ffffff +_08041C7C: .4byte 0x02024332 +_08041C80: .4byte 0x02024214 +_08041C84: .4byte 0x082db220 +_08041C88: .4byte 0x0202449c +_08041C8C: .4byte 0x000001a3 +_08041C90: + ldr r1, _08041CEC + ldr r7, _08041CF0 + 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, _08041CF4 + ldr r0, _08041CF8 + 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, _08041CFC + ldr r0, _08041D00 + str r0, [r1] + ldr r2, _08041D04 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r2] + b _08041D28 + .align 2, 0 +_08041CEC: .4byte 0x02024084 +_08041CF0: .4byte 0x0202420b +_08041CF4: .4byte 0x0831c898 +_08041CF8: .4byte 0x020241ea +_08041CFC: .4byte 0x02024214 +_08041D00: .4byte 0x082db26a +_08041D04: .4byte 0x02024280 +_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, _08041D3C + ldr r0, _08041D40 + str r0, [r1] + ldr r0, _08041D44 + strb r4, [r0, 0x5] +_08041D28: + movs r7, 0x2 + mov r9, r7 + ldr r0, _08041D48 + mov r8, r0 +_08041D30: + mov r1, r8 + ldr r0, [r1] + ldr r2, _08041D4C + adds r1, r0, r2 + b _08042370 + .align 2, 0 +_08041D3C: .4byte 0x02024214 +_08041D40: .4byte 0x082db277 +_08041D44: .4byte 0x02024332 +_08041D48: .4byte 0x0202449c +_08041D4C: .4byte 0x000001a3 +_08041D50: + ldr r1, _08041DA4 + ldr r0, _08041DA8 + 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, _08041DAC + 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, _08041DB0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + ldr r1, _08041DB4 + movs r0, 0 + strb r0, [r1, 0x5] + ldr r1, _08041DB8 + ldr r0, _08041DBC + str r0, [r1] + ldr r2, _08041DC0 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + b _0804215E + .align 2, 0 +_08041DA4: .4byte 0x02024084 +_08041DA8: .4byte 0x0202420b +_08041DAC: .4byte 0x020242bc +_08041DB0: .4byte 0x02024280 +_08041DB4: .4byte 0x02024332 +_08041DB8: .4byte 0x02024214 +_08041DBC: .4byte 0x082db6ad +_08041DC0: .4byte 0x0202427c +_08041DC4: + ldr r1, _08041E1C + ldr r3, _08041E20 + 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, _08041E24 + ands r1, r0 + str r1, [r2] + ldr r2, _08041E28 + 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, _08041E2C + ldr r0, _08041E30 + str r0, [r1] + ldr r2, _08041E34 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r7, 0x1 + mov r9, r7 +_08041E10: + ldr r1, _08041E38 + ldr r0, [r1] + ldr r3, _08041E3C + adds r2, r0, r3 + b _0804216A + .align 2, 0 +_08041E1C: .4byte 0x02024084 +_08041E20: .4byte 0x0202420b +_08041E24: .4byte 0xffbfffff +_08041E28: .4byte 0x020242bc +_08041E2C: .4byte 0x02024214 +_08041E30: .4byte 0x082d9462 +_08041E34: .4byte 0x02024280 +_08041E38: .4byte 0x0202449c +_08041E3C: .4byte 0x000001a3 +_08041E40: + ldr r1, _08041E98 + ldr r3, _08041E9C + 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, _08041EA0 + 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, _08041EA4 + ldr r0, _08041EA8 + str r0, [r1] + ldr r2, _08041EAC + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r4, 0x1 + mov r9, r4 +_08041E8C: + ldr r1, _08041EB0 + ldr r0, [r1] + ldr r7, _08041EB4 + adds r2, r0, r7 + b _0804216A + .align 2, 0 +_08041E98: .4byte 0x02024084 +_08041E9C: .4byte 0x0202420b +_08041EA0: .4byte 0x0202433c +_08041EA4: .4byte 0x02024214 +_08041EA8: .4byte 0x082db29b +_08041EAC: .4byte 0x02024280 +_08041EB0: .4byte 0x0202449c +_08041EB4: .4byte 0x000001a3 +_08041EB8: + ldr r0, _08041F10 + ldr r3, _08041F14 + ldrb r2, [r3] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, _08041F18 + ldrh r1, [r1, 0x4] + ldrh r0, [r0] + cmp r1, r0 + bne _08041F04 + cmp r1, 0 + beq _08041F04 + ldr r0, _08041F1C + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, _08041F20 + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, _08041F24 + ldr r0, _08041F28 + str r0, [r1] + ldr r2, _08041F2C + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x1 + mov r9, r0 +_08041F04: + ldr r1, _08041F30 + ldr r0, [r1] + ldr r3, _08041F34 + adds r2, r0, r3 + b _0804216A + .align 2, 0 +_08041F10: .4byte 0x020242bc +_08041F14: .4byte 0x0202420b +_08041F18: .4byte 0x020241ea +_08041F1C: .4byte 0x0202433c +_08041F20: .4byte 0x02024474 +_08041F24: .4byte 0x02024214 +_08041F28: .4byte 0x082dae14 +_08041F2C: .4byte 0x02024280 +_08041F30: .4byte 0x0202449c +_08041F34: .4byte 0x000001a3 +_08041F38: + ldr r0, _08041F98 + ldr r4, _08041F9C + 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, _08041FA0 + ldr r0, _08041FA4 + 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, _08041FA8 + 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, _08041FAC + ldr r0, _08041FB0 + str r0, [r1] + ldr r2, _08041FB4 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r4, 0x1 + mov r9, r4 +_08041F8C: + ldr r1, _08041FB8 + ldr r0, [r1] + ldr r7, _08041FBC + adds r2, r0, r7 + b _0804216A + .align 2, 0 +_08041F98: .4byte 0x020242bc +_08041F9C: .4byte 0x0202420b +_08041FA0: .4byte 0x0831c898 +_08041FA4: .4byte 0x020241ea +_08041FA8: .4byte 0x0202433c +_08041FAC: .4byte 0x02024214 +_08041FB0: .4byte 0x082db0a4 +_08041FB4: .4byte 0x02024280 +_08041FB8: .4byte 0x0202449c +_08041FBC: .4byte 0x000001a3 +_08041FC0: + ldr r4, _08042008 + ldrb r0, [r4] + ldr r1, _0804200C + ldrh r1, [r1] + bl sub_8040130 + lsls r0, 24 + cmp r0, 0 + beq _08041FFE + ldr r0, _08042010 + 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, _08042014 + ldr r0, _08042018 + str r0, [r1] + ldr r2, _0804201C + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x1 + mov r9, r0 +_08041FFE: + ldr r1, _08042020 + ldr r0, [r1] + ldr r3, _08042024 + adds r2, r0, r3 + b _0804216A + .align 2, 0 +_08042008: .4byte 0x0202420b +_0804200C: .4byte 0x020241ea +_08042010: .4byte 0x0202433c +_08042014: .4byte 0x02024214 +_08042018: .4byte 0x082db176 +_0804201C: .4byte 0x02024280 +_08042020: .4byte 0x0202449c +_08042024: .4byte 0x000001a3 +_08042028: + ldr r7, _08042070 + ldr r5, _08042074 + 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, _08042078 + movs r0, 0 + strb r0, [r1, 0x5] + bl b_movescr_stack_push_cursor + b _080420C6 + .align 2, 0 +_08042070: .4byte 0x02024084 +_08042074: .4byte 0x0202420b +_08042078: .4byte 0x02024332 +_0804207C: + ldr r0, _080420CC + movs r4, 0x1 + strb r1, [r0, 0x5] + ldr r1, _080420D0 + 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, _080420D4 + str r0, [r1] + ldr r0, _080420D8 + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + orrs r0, r4 + strb r0, [r1, 0x1] + ldr r2, _080420DC + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] +_080420C6: + ldr r1, _080420E0 + ldr r0, _080420E4 + b _080420F0 + .align 2, 0 +_080420CC: .4byte 0x02024332 +_080420D0: .4byte 0x0202420c +_080420D4: .4byte 0x020241f0 +_080420D8: .4byte 0x0202433c +_080420DC: .4byte 0x02024280 +_080420E0: .4byte 0x02024214 +_080420E4: .4byte 0x082db2bd +_080420E8: + bl b_movescr_stack_push_cursor + ldr r1, _08042104 + ldr r0, _08042108 +_080420F0: + str r0, [r1] + movs r4, 0x1 + mov r9, r4 + ldr r7, _0804210C + mov r8, r7 +_080420FA: + mov r1, r8 + ldr r0, [r1] + ldr r2, _08042110 + adds r1, r0, r2 + b _08042370 + .align 2, 0 +_08042104: .4byte 0x02024214 +_08042108: .4byte 0x082db300 +_0804210C: .4byte 0x0202449c +_08042110: .4byte 0x000001a3 +_08042114: + ldr r1, _08042174 + ldr r4, _08042178 + 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, _0804217C + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08042180 + ldr r0, _08042184 + str r0, [r1] + ldr r2, _08042188 + 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, _0804218C + ldr r0, [r1] + ldr r4, _08042190 + adds r2, r0, r4 +_0804216A: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + mov r8, r1 + b _08042376 + .align 2, 0 +_08042174: .4byte 0x02024084 +_08042178: .4byte 0x0202420b +_0804217C: .4byte 0x0202433c +_08042180: .4byte 0x02024214 +_08042184: .4byte 0x082db28b +_08042188: .4byte 0x02024280 +_0804218C: .4byte 0x0202449c +_08042190: .4byte 0x000001a3 +_08042194: + ldr r1, _080421CC + ldr r4, _080421D0 + 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, _080421D4 + 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 + .align 2, 0 +_080421CC: .4byte 0x02024084 +_080421D0: .4byte 0x0202420b +_080421D4: .4byte 0x02024474 +_080421D8: + ldr r0, _08042218 + bl b_movescr_stack_push + ldr r2, _0804221C + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + ldr r0, _08042220 + 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, _08042224 + ldr r0, _08042228 + str r0, [r1] + movs r7, 0x1 + mov r9, r7 + ldr r0, _0804222C + mov r8, r0 +_0804220E: + mov r1, r8 + ldr r0, [r1] + ldr r2, _08042230 + adds r1, r0, r2 + b _08042370 + .align 2, 0 +_08042218: .4byte 0x082db334 +_0804221C: .4byte 0x02024280 +_08042220: .4byte 0x0202433c +_08042224: .4byte 0x02024214 +_08042228: .4byte 0x082db327 +_0804222C: .4byte 0x0202449c +_08042230: .4byte 0x000001a3 +_08042234: + ldr r1, _0804226C + ldr r6, _08042270 + 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, _08042274 + 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, _08042278 + ldr r0, _0804227C + b _08042300 + .align 2, 0 +_0804226C: .4byte 0x02024084 +_08042270: .4byte 0x0202420b +_08042274: .4byte 0xffffff00 +_08042278: .4byte 0x02024214 +_0804227C: .4byte 0x082dad71 +_08042280: + ldr r3, _080422D8 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _080422FC + ldr r1, _080422DC + 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, _080422E0 + ldr r1, _080422E4 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, _080422E8 + ldrb r1, [r0] + ldr r2, _080422EC + 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, _080422F0 + ldr r0, _080422F4 + str r0, [r1] + ldr r2, _080422F8 + mov r8, r2 + b _08042302 + .align 2, 0 +_080422D8: .4byte 0x020241f8 +_080422DC: .4byte 0x020241ea +_080422E0: .4byte 0x0202420c +_080422E4: .4byte 0x02024288 +_080422E8: .4byte 0x02024210 +_080422EC: .4byte 0x0832a328 +_080422F0: .4byte 0x02024214 +_080422F4: .4byte 0x082dad7c +_080422F8: .4byte 0x0202449c +_080422FC: + ldr r1, _08042310 + ldr r0, _08042314 +_08042300: + str r0, [r1] +_08042302: + movs r3, 0x1 + mov r9, r3 +_08042306: + mov r4, r8 + ldr r0, [r4] + ldr r7, _08042318 + adds r1, r0, r7 + b _08042370 + .align 2, 0 +_08042310: .4byte 0x02024214 +_08042314: .4byte 0x082dadc4 +_08042318: .4byte 0x000001a3 +_0804231C: + ldr r1, _080423C8 + ldr r0, _080423CC + 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, _080423D0 + ldr r0, _080423D4 + 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, _080423D8 + ldr r0, _080423DC + str r0, [r1] + ldr r1, _080423E0 + movs r0, 0x1 + strb r0, [r1, 0x5] +_08042360: + movs r0, 0x2 + mov r9, r0 + ldr r1, _080423E4 + mov r8, r1 +_08042368: + mov r2, r8 + ldr r0, [r2] + ldr r3, _080423E8 + adds r1, r0, r3 +_08042370: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08042376: + mov r4, r8 + ldr r0, [r4] + ldr r7, _080423E8 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xE + beq _08042388 + bl _08041A90 +_08042388: + mov r0, r9 + cmp r0, 0x2 + bne _080423B4 + ldr r4, _080423EC + ldr r0, _080423CC + ldrb r0, [r0] + strb r0, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, _080423F0 + 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 + .align 2, 0 +_080423C8: .4byte 0x02024084 +_080423CC: .4byte 0x0202420b +_080423D0: .4byte 0x0831c898 +_080423D4: .4byte 0x020241ea +_080423D8: .4byte 0x02024214 +_080423DC: .4byte 0x082db277 +_080423E0: .4byte 0x02024332 +_080423E4: .4byte 0x0202449c +_080423E8: .4byte 0x000001a3 +_080423EC: .4byte 0x02024064 +_080423F0: .4byte 0x020240d0 + 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, _08042420 + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08042424 + movs r0, 0 + b _080426A0 + .align 2, 0 +_08042420: .4byte 0x02022fec +_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, _08042494 + mov r8, r1 + cmp r0, 0 + bne _08042442 + ldr r2, _08042498 + 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 + .align 2, 0 +_08042494: .4byte 0x02024744 +_08042498: .4byte 0x020244ec +_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, _080424CC + mov r8, r2 + adds r0, r4, 0 + bl sub_806D864 + lsls r0, 24 + lsrs r7, r0, 24 + b _08042502 + .align 2, 0 +_080424CC: .4byte 0x020244ec +_080424D0: + ldr r0, _080424E0 + mov r8, r0 + movs r1, 0x1 + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 + b _0804250C + .align 2, 0 +_080424E0: .4byte 0x02024744 +_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, _08042564 + mov r8, r1 + cmp r0, 0 + bne _08042502 + ldr r2, _08042568 + 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 + .align 2, 0 +_08042564: .4byte 0x02024744 +_08042568: .4byte 0x020244ec +_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, _08042598 + 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 + .align 2, 0 +_08042598: .4byte 0x02024744 +_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, _08042604 + mov r8, r2 + b _08042620 + .align 2, 0 +_08042604: .4byte 0x02024744 +_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, _080426B0 + mov r8, r0 +_08042620: + mov r1, r10 + cmp r1, 0x6 + bne _08042630 + ldr r1, _080426B4 + lsls r0, r7, 1 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 +_08042630: + mov r2, r9 + cmp r2, 0x6 + bne _08042640 + ldr r1, _080426B4 + 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, _080426B8 + 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 + .align 2, 0 +_080426B0: .4byte 0x020244ec +_080426B4: .4byte 0x0202406e +_080426B8: .4byte 0x0202449c + 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, _0804272C + movs r0, 0x58 + muls r0, r6 + adds r4, r0, r1 + ldrh r1, [r4] + ldr r0, _08042730 + 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 + .align 2, 0 +_0804272C: .4byte 0x02024084 +_08042730: .4byte 0x00000181 +_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, _08042820 + ldrh r0, [r1] + movs r2, 0xE7 + ands r2, r0 + adds r4, r1, 0 + cmp r2, 0 + bne _08042792 + ldr r1, _08042824 + 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, _08042824 + 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, _08042824 + 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, _08042824 + 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 + .align 2, 0 +_08042820: .4byte 0x020243cc +_08042824: .4byte 0x02024084 + 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, _08042884 + ldr r1, _08042888 + 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, _0804288C + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08042890 + b _080428A4 + .align 2, 0 +_08042884: .4byte 0x0202420b +_08042888: .4byte 0x0202406c +_0804288C: .4byte 0x0202406e +_08042890: .4byte 0x020244ec +_08042894: + ldr r1, _080428D4 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _080428D8 +_080428A4: + adds r7, r1, r0 + ldr r5, _080428DC + ldr r1, _080428E0 + 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, _080428D4 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _080428E4 + b _080428F8 + .align 2, 0 +_080428D4: .4byte 0x0202406e +_080428D8: .4byte 0x02024744 +_080428DC: .4byte 0x0202420c +_080428E0: .4byte 0x0202406c +_080428E4: .4byte 0x020244ec +_080428E8: + ldr r1, _08042948 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0804294C +_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, _08042950 + 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, _08042954 + strb r3, [r0] + adds r7, r0, 0 + b _0804296E + .align 2, 0 +_08042948: .4byte 0x0202406e +_0804294C: .4byte 0x02024744 +_08042950: .4byte 0x02022fec +_08042954: .4byte 0x0202420a +_08042958: + ldr r2, _08042978 + ldr r1, _0804297C + 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 + .align 2, 0 +_08042978: .4byte 0x0202420a +_0804297C: .4byte 0x02024084 +_08042980: + ldr r0, _08042998 + ldrh r5, [r0] +_08042984: + ldr r1, _0804299C + ldr r0, [r1] + ldrb r0, [r0, 0x13] + mov r8, r1 + cmp r0, 0 + beq _080429A0 + movs r3, 0x3F + ands r3, r0 + b _080429AC + .align 2, 0 +_08042998: .4byte 0x020241ea +_0804299C: .4byte 0x0202449c +_080429A0: + ldr r1, _080429C0 + 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, _080429C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080429C0: .4byte 0x0831c898 +_080429C4: .4byte _080429C8 + .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, _08042A4C + ldr r0, _08042A50 + 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 + .align 2, 0 +_08042A4C: .4byte 0x0202420b +_08042A50: .4byte 0x0202406c +_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, _08042AAC + 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, _08042AB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08042AAC: .4byte 0x02022fec +_08042AB0: .4byte _08042AB4 + .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, _08042AFC + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + movs r0, 0x5 + strh r0, [r2] + ldr r1, _08042B00 + movs r0, 0xA + strb r0, [r1, 0x10] + mov r2, r10 + strb r2, [r1, 0x17] + b _08042B42 + .align 2, 0 +_08042AFC: .4byte 0x020243cc +_08042B00: .4byte 0x02024474 +_08042B04: + ldr r3, _08042B20 + ldrh r1, [r3] + movs r2, 0x18 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + strh r2, [r3] + ldr r1, _08042B24 + movs r0, 0xC + strb r0, [r1, 0x10] + mov r3, r10 + strb r3, [r1, 0x17] + b _08042B42 + .align 2, 0 +_08042B20: .4byte 0x020243cc +_08042B24: .4byte 0x02024474 +_08042B28: + ldr r3, _08042B68 + ldrh r1, [r3] + movs r2, 0x60 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + strh r2, [r3] + ldr r1, _08042B6C + 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, _08042B70 + strb r0, [r1, 0x5] + ldr r0, _08042B74 + bl b_push_move_exec + bl _0804441E + .align 2, 0 +_08042B68: .4byte 0x020243cc +_08042B6C: .4byte 0x02024474 +_08042B70: .4byte 0x02024332 +_08042B74: .4byte 0x082dace7 +_08042B78: + ldr r2, _08042B9C + 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, _08042BA0 + bl b_push_move_exec + ldr r0, _08042BA4 + mov r1, r10 + strb r1, [r0, 0x17] + bl _080443D0 + .align 2, 0 +_08042B9C: .4byte 0x020243cc +_08042BA0: .4byte 0x082db430 +_08042BA4: .4byte 0x02024474 +_08042BA8: + ldr r2, _08042BCC + 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, _08042BD0 + bl b_push_move_exec + ldr r0, _08042BD4 + mov r2, r10 + strb r2, [r0, 0x17] + bl _080443D0 + .align 2, 0 +_08042BCC: .4byte 0x020243cc +_08042BD0: .4byte 0x082db470 +_08042BD4: .4byte 0x02024474 +_08042BD8: + ldr r2, _08042BFC + 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, _08042C00 + bl b_push_move_exec + ldr r0, _08042C04 + mov r3, r10 + strb r3, [r0, 0x17] + bl _080443D0 + .align 2, 0 +_08042BFC: .4byte 0x020243cc +_08042C00: .4byte 0x082db52a +_08042C04: .4byte 0x02024474 +_08042C08: + ldr r0, _08042C34 + 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, _08042C38 + 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 + .align 2, 0 +_08042C34: .4byte 0x0202437c +_08042C38: .4byte 0x020242ac +_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, _08042C60 + bl b_push_move_exec + ldr r0, _08042C64 + mov r1, r10 + strb r1, [r0, 0x17] + bl _080442E2 + .align 2, 0 +_08042C60: .4byte 0x082db4a9 +_08042C64: .4byte 0x02024474 +_08042C68: + ldr r0, _08042C9C + 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, _08042CA0 + 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 + .align 2, 0 +_08042C9C: .4byte 0x0202437c +_08042CA0: .4byte 0x020242ac +_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, _08042CD8 + ldrb r0, [r0] + cmp r6, r0 + bcc _08042CB0 + bl _0804441E + .align 2, 0 +_08042CD8: .4byte 0x0202406c +_08042CDC: + ldr r5, _08042D0C + 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, _08042D10 + 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 + .align 2, 0 +_08042D0C: .4byte 0x02024084 +_08042D10: .4byte 0x0202420b +_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, _08042D94 + 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, _08042D98 + bl b_push_move_exec + ldr r1, _08042D9C + 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 + .align 2, 0 +_08042D94: .4byte 0x020243cc +_08042D98: .4byte 0x082db45c +_08042D9C: .4byte 0x020241f0 +_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, _08042E5C + ldr r1, _08042E60 + bl gf_strcpy +_08042DDC: + ldr r0, [r5] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08042DEE + ldr r0, _08042E5C + ldr r1, _08042E64 + bl gf_strcpy +_08042DEE: + ldr r0, [r5] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042E00 + ldr r0, _08042E5C + ldr r1, _08042E68 + bl gf_strcpy +_08042E00: + ldr r0, [r5] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08042E12 + ldr r0, _08042E5C + ldr r1, _08042E6C + bl gf_strcpy +_08042E12: + ldr r0, [r5] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08042E24 + ldr r0, _08042E5C + ldr r1, _08042E70 + bl gf_strcpy +_08042E24: + str r4, [r5] + mov r1, r8 + adds r1, 0x50 + adds r1, r6, r1 + ldr r0, [r1] + ldr r2, _08042E74 + ands r0, r2 + str r0, [r1] + ldr r0, _08042E78 + ldr r4, _08042E7C + mov r3, r10 + strb r3, [r4] + strb r3, [r0, 0x17] + ldr r0, _08042E80 + 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 + .align 2, 0 +_08042E5C: .4byte 0x02022f58 +_08042E60: .4byte 0x0831bc70 +_08042E64: .4byte 0x0831bc78 +_08042E68: .4byte 0x0831bc80 +_08042E6C: .4byte 0x0831bc88 +_08042E70: .4byte 0x0831bc90 +_08042E74: .4byte 0xf7ffffff +_08042E78: .4byte 0x02024474 +_08042E7C: .4byte 0x02024064 +_08042E80: .4byte 0x082db484 +_08042E84: + ldrb r2, [r4, 0x1B] + movs r0, 0x1B + ldrsb r0, [r4, r0] + cmp r0, 0xB + ble _08042E92 + bl _0804441E +_08042E92: + ldr r0, _08042EC4 + 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, _08042EC8 + movs r0, 0x11 + strb r0, [r4, 0x10] + strb r1, [r4, 0x11] + ldr r0, _08042ECC + bl b_push_move_exec + strb r5, [r4, 0x17] + bl _080443D0 + .align 2, 0 +_08042EC4: .4byte 0x020242bc +_08042EC8: .4byte 0x02024474 +_08042ECC: .4byte 0x082db444 +_08042ED0: + ldr r2, _08042EF4 + 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 + .align 2, 0 +_08042EF4: .4byte 0x020242bc +_08042EF8: + ldrb r0, [r7] + cmp r0, 0x2B + beq _08042F02 + bl _0804441E +_08042F02: + movs r4, 0 + ldr r0, _08042F70 + ldrh r2, [r0] + ldr r3, _08042F74 + 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, _08042F74 + cmp r1, r0 + bne _08042F3C + bl _0804441E +_08042F3C: + ldr r1, _08042F78 + ldr r0, _08042F7C + 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, _08042F80 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + str r1, [r0] +_08042F62: + ldr r1, _08042F84 + ldr r0, _08042F88 + str r0, [r1] + movs r0, 0x1 + mov r9, r0 + bl _08044424 + .align 2, 0 +_08042F70: .4byte 0x0831bcf8 +_08042F74: .4byte 0x0000ffff +_08042F78: .4byte 0x02024084 +_08042F7C: .4byte 0x0202420b +_08042F80: .4byte 0x02024280 +_08042F84: .4byte 0x02024214 +_08042F88: .4byte 0x082db61f +_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, _08042FDC + 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, _08042FE0 + ldr r0, _08042FE4 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08042FF0 + ldr r1, _08042FE8 + ldr r0, _08042FEC + b _08042FF4 + .align 2, 0 +_08042FDC: .4byte 0x0831c898 +_08042FE0: .4byte 0x0202433c +_08042FE4: .4byte 0x0202420b +_08042FE8: .4byte 0x02024214 +_08042FEC: .4byte 0x082db56f +_08042FF0: + ldr r1, _08042FFC + ldr r0, _08043000 +_08042FF4: + str r0, [r1] + movs r1, 0x1 + b _08043124 + .align 2, 0 +_08042FFC: .4byte 0x02024214 +_08043000: .4byte 0x082db56e +_08043004: + cmp r3, 0xB + beq _0804300A + b _08043126 +_0804300A: + ldr r0, _08043034 + 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, _08043038 + ldr r0, _0804303C + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08043048 + ldr r1, _08043040 + ldr r0, _08043044 + b _0804304C + .align 2, 0 +_08043034: .4byte 0x0831c898 +_08043038: .4byte 0x0202433c +_0804303C: .4byte 0x0202420b +_08043040: .4byte 0x02024214 +_08043044: .4byte 0x082db56f +_08043048: + ldr r1, _08043054 + ldr r0, _08043058 +_0804304C: + str r0, [r1] + movs r2, 0x1 + mov r9, r2 + b _08043126 + .align 2, 0 +_08043054: .4byte 0x02024214 +_08043058: .4byte 0x082db56e +_0804305C: + cmp r3, 0xA + bne _08043126 + ldr r1, _080430AC + 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, _080430B0 + 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, _080430B4 + strb r3, [r0, 0x5] + ldr r1, _080430B8 + ldr r0, _080430BC + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _080430C8 + ldr r1, _080430C0 + ldr r0, _080430C4 + b _080430CC + .align 2, 0 +_080430AC: .4byte 0x02024084 +_080430B0: .4byte 0x020244a8 +_080430B4: .4byte 0x02024332 +_080430B8: .4byte 0x0202433c +_080430BC: .4byte 0x0202420b +_080430C0: .4byte 0x02024214 +_080430C4: .4byte 0x082db5a8 +_080430C8: + ldr r1, _080430E4 + ldr r0, _080430E8 +_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 + .align 2, 0 +_080430E4: .4byte 0x02024214 +_080430E8: .4byte 0x082db5a7 +_080430EC: + ldr r0, _08043108 + strb r4, [r0, 0x5] + ldr r1, _0804310C + ldr r0, _08043110 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _0804311C + ldr r1, _08043114 + ldr r0, _08043118 + b _08043120 + .align 2, 0 +_08043108: .4byte 0x02024332 +_0804310C: .4byte 0x0202433c +_08043110: .4byte 0x0202420b +_08043114: .4byte 0x02024214 +_08043118: .4byte 0x082db5a8 +_0804311C: + ldr r1, _08043160 + ldr r0, _08043164 +_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, _08043168 + 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, _0804316C + ldr r0, _08043170 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08043178 + ldr r1, _08043160 + ldr r0, _08043174 + str r0, [r1] + bl _0804441E + .align 2, 0 +_08043160: .4byte 0x02024214 +_08043164: .4byte 0x082db5a7 +_08043168: .4byte 0x02024084 +_0804316C: .4byte 0x0202433c +_08043170: .4byte 0x0202420b +_08043174: .4byte 0x082db592 +_08043178: + ldr r1, _08043184 + ldr r0, _08043188 + str r0, [r1] + bl _0804441E + .align 2, 0 +_08043184: .4byte 0x02024214 +_08043188: .4byte 0x082db591 +_0804318C: + ldr r2, _080431A8 + 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 + .align 2, 0 +_080431A8: .4byte 0x020241f0 +_080431AC: + ldrb r0, [r7] + subs r0, 0x9 + cmp r0, 0x2F + bls _080431B8 + bl _0804441E +_080431B8: + lsls r0, 2 + ldr r1, _080431C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080431C4: .4byte _080431C8 + .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, _08043330 + 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, _08043334 + 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, _08043338 + ldr r0, _0804333C + 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, _08043340 + 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, _08043344 + 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, _08043348 + ldr r0, _0804334C + str r0, [r1] + bl _080443D0 + .align 2, 0 +_08043330: .4byte 0x0202427c +_08043334: .4byte 0x0831c898 +_08043338: .4byte 0x0202437c +_0804333C: .4byte 0x0202420c +_08043340: .4byte 0x02024084 +_08043344: .4byte 0x02022f58 +_08043348: .4byte 0x02024214 +_0804334C: .4byte 0x082db64d +_08043350: + ldr r0, _080433E8 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043360 + bl _0804441E +_08043360: + ldr r1, _080433EC + ldr r0, _080433F0 + 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, _080433F4 + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043388 + bl _0804441E +_08043388: + ldr r2, _080433F8 + ldr r0, _080433FC + 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, _08043400 + 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, _08043404 + 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, _08043408 + ldr r0, _0804340C + str r0, [r1] + bl _080443D0 + .align 2, 0 +_080433E8: .4byte 0x0202427c +_080433EC: .4byte 0x02024084 +_080433F0: .4byte 0x0202420b +_080433F4: .4byte 0x0202433c +_080433F8: .4byte 0x0202437c +_080433FC: .4byte 0x0202420c +_08043400: .4byte 0x0831c898 +_08043404: .4byte 0x020241f0 +_08043408: .4byte 0x02024214 +_0804340C: .4byte 0x082db654 +_08043410: + ldr r0, _080434DC + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043420 + bl _0804441E +_08043420: + ldr r1, _080434E0 + ldr r0, _080434E4 + 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, _080434E8 + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043448 + bl _0804441E +_08043448: + ldr r2, _080434EC + ldr r0, _080434F0 + 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, _080434F4 + 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, _080434F8 + movs r4, 0x3 +_080434A4: + bl GenerateRandomNumber + ands r0, r4 + strb r0, [r5, 0x3] + cmp r0, 0 + beq _080434A4 + ldr r1, _080434F8 + 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, _080434FC + ldr r0, _08043500 + str r0, [r1] + ldr r2, _08043504 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .align 2, 0 +_080434DC: .4byte 0x0202427c +_080434E0: .4byte 0x02024084 +_080434E4: .4byte 0x0202420b +_080434E8: .4byte 0x0202433c +_080434EC: .4byte 0x0202437c +_080434F0: .4byte 0x0202420c +_080434F4: .4byte 0x0831c898 +_080434F8: .4byte 0x02024332 +_080434FC: .4byte 0x02024214 +_08043500: .4byte 0x082db67c +_08043504: .4byte 0x02024280 +_08043508: + ldr r0, _080435B8 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043518 + bl _0804441E +_08043518: + ldr r1, _080435BC + ldr r0, _080435C0 + 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, _080435C4 + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043540 + bl _0804441E +_08043540: + ldr r2, _080435C8 + ldr r0, _080435CC + 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, _080435D0 + 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, _080435D4 + movs r0, 0x42 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, _080435D8 + ldr r0, _080435DC + str r0, [r1] + ldr r2, _080435E0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .align 2, 0 +_080435B8: .4byte 0x0202427c +_080435BC: .4byte 0x02024084 +_080435C0: .4byte 0x0202420b +_080435C4: .4byte 0x0202433c +_080435C8: .4byte 0x0202437c +_080435CC: .4byte 0x0202420c +_080435D0: .4byte 0x0831c898 +_080435D4: .4byte 0x02024332 +_080435D8: .4byte 0x02024214 +_080435DC: .4byte 0x082db67c +_080435E0: .4byte 0x02024280 +_080435E4: + ldr r0, _08043694 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080435F4 + bl _0804441E +_080435F4: + ldr r1, _08043698 + ldr r0, _0804369C + 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, _080436A0 + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _0804361C + bl _0804441E +_0804361C: + ldr r2, _080436A4 + ldr r0, _080436A8 + 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, _080436AC + 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, _080436B0 + movs r0, 0x45 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, _080436B4 + ldr r0, _080436B8 + str r0, [r1] + ldr r2, _080436BC + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .align 2, 0 +_08043694: .4byte 0x0202427c +_08043698: .4byte 0x02024084 +_0804369C: .4byte 0x0202420b +_080436A0: .4byte 0x0202433c +_080436A4: .4byte 0x0202437c +_080436A8: .4byte 0x0202420c +_080436AC: .4byte 0x0831c898 +_080436B0: .4byte 0x02024332 +_080436B4: .4byte 0x02024214 +_080436B8: .4byte 0x082db67c +_080436BC: .4byte 0x02024280 +_080436C0: + ldr r0, _08043770 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080436D0 + bl _0804441E +_080436D0: + ldr r1, _08043774 + ldr r0, _08043778 + 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, _0804377C + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _080436F8 + bl _0804441E +_080436F8: + ldr r1, _08043780 + 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, _08043784 + ldr r0, _08043788 + 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, _0804378C + movs r0, 0x43 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, _08043790 + ldr r0, _08043794 + str r0, [r1] + ldr r2, _08043798 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .align 2, 0 +_08043770: .4byte 0x0202427c +_08043774: .4byte 0x02024084 +_08043778: .4byte 0x0202420b +_0804377C: .4byte 0x0202433c +_08043780: .4byte 0x0831c898 +_08043784: .4byte 0x0202437c +_08043788: .4byte 0x0202420c +_0804378C: .4byte 0x02024332 +_08043790: .4byte 0x02024214 +_08043794: .4byte 0x082db67c +_08043798: .4byte 0x02024280 +_0804379C: + ldr r0, _080438E0 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080437AC + bl _0804441E +_080437AC: + ldr r6, _080438E4 + ldr r3, _080438E8 + 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, _080438EC + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _080437D8 + bl _0804441E +_080437D8: + ldr r1, _080438F0 + 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, _080438F4 + ldr r5, _080438F8 + 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, _080438FC + 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, _08043900 + ldr r0, _08043904 + str r0, [r1] + bl _080443D0 + .align 2, 0 +_080438E0: .4byte 0x0202427c +_080438E4: .4byte 0x02024084 +_080438E8: .4byte 0x0202420b +_080438EC: .4byte 0x0202433c +_080438F0: .4byte 0x0831c898 +_080438F4: .4byte 0x0202437c +_080438F8: .4byte 0x0202420c +_080438FC: .4byte 0x0832a328 +_08043900: .4byte 0x02024214 +_08043904: .4byte 0x082db66f +_08043908: + movs r5, 0 + mov r10, r5 + ldr r0, _0804393C + ldrb r0, [r0] + cmp r10, r0 + bcc _08043918 + bl _0804441E +_08043918: + ldr r1, _08043940 + 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, _08043944 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804393C: .4byte 0x0202406c +_08043940: .4byte 0x02024084 +_08043944: .4byte _08043948 + .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, _08043A70 + ands r0, r1 + cmp r0, 0 + bne _08043A6A + b _08043B96 +_08043A6A: + ldr r0, _08043A74 + ldr r1, _08043A78 + b _08043B5C + .align 2, 0 +_08043A70: .4byte 0x00000f88 +_08043A74: .4byte 0x02022f58 +_08043A78: .4byte 0x0831bc70 +_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, _08043AA4 + ldr r1, _08043AA8 + bl gf_strcpy + movs r2, 0x2 + mov r9, r2 + b _08043B9C + .align 2, 0 +_08043AA4: .4byte 0x02022f58 +_08043AA8: .4byte 0x0831bc98 +_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, _08043ACC + ldr r1, _08043AD0 + b _08043B5C + .align 2, 0 +_08043ACC: .4byte 0x02022f58 +_08043AD0: .4byte 0x0831bc80 +_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, _08043B04 + ands r0, r1 + str r0, [r2] + ldr r0, _08043B08 + ldr r1, _08043B0C + bl gf_strcpy + movs r0, 0x1 + mov r9, r0 + b _08043B9C + .align 2, 0 +_08043B04: .4byte 0xf7ffffff +_08043B08: .4byte 0x02022f58 +_08043B0C: .4byte 0x0831bc78 +_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, _08043B38 + ldr r1, _08043B3C + bl gf_strcpy + movs r2, 0x1 + mov r9, r2 + b _08043B9C + .align 2, 0 +_08043B38: .4byte 0x02022f58 +_08043B3C: .4byte 0x0831bc88 +_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, _08043B68 + ldr r1, _08043B6C +_08043B5C: + bl gf_strcpy + movs r5, 0x1 + mov r9, r5 + b _08043B9C + .align 2, 0 +_08043B68: .4byte 0x02022f58 +_08043B6C: .4byte 0x0831bc90 +_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, _08043BAC + ldr r1, _08043BB0 + bl gf_strcpy + 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 + .align 2, 0 +_08043BAC: .4byte 0x02022f58 +_08043BB0: .4byte 0x0831bca0 +_08043BB4: + mov r0, r9 + cmp r0, 0x3 + beq _08043BE8 + b _08043BFC +_08043BBC: + ldr r1, _08043BCC + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x4C + adds r2, r1 + movs r0, 0 + b _08043BFA + .align 2, 0 +_08043BCC: .4byte 0x02024084 +_08043BD0: + ldr r1, _08043BE4 + 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 + .align 2, 0 +_08043BE4: .4byte 0x02024084 +_08043BE8: + ldr r1, _08043C34 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, _08043C38 +_08043BF8: + ands r0, r1 +_08043BFA: + str r0, [r2] +_08043BFC: + bl b_movescr_stack_push_cursor + ldr r1, _08043C3C + ldr r0, _08043C40 + str r0, [r1] + ldr r0, _08043C44 + mov r1, r10 + strb r1, [r0, 0x17] + ldr r4, _08043C48 + strb r1, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, _08043C4C + 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 + .align 2, 0 +_08043C34: .4byte 0x02024084 +_08043C38: .4byte 0xfff0ffff +_08043C3C: .4byte 0x02024214 +_08043C40: .4byte 0x082db68c +_08043C44: .4byte 0x02024474 +_08043C48: .4byte 0x02024064 +_08043C4C: .4byte 0x020240d0 +_08043C50: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, _08043C68 + ldrb r0, [r0] + cmp r10, r0 + bcs _08043C64 + b _08043918 +_08043C64: + bl _0804441E + .align 2, 0 +_08043C68: .4byte 0x0202406c +_08043C6C: + movs r2, 0 + mov r10, r2 + ldr r0, _08043CB4 + ldrb r0, [r0] + cmp r10, r0 + bcc _08043C7A + b _0804441E +_08043C7A: + ldr r4, _08043CB8 +_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, _08043CB4 + ldrb r0, [r0] + cmp r10, r0 + bcc _08043C7C + b _0804441E + .align 2, 0 +_08043CB4: .4byte 0x0202406c +_08043CB8: .4byte 0x02024084 +_08043CBC: + ldrb r0, [r7] + cmp r0, 0x1C + beq _08043CC4 + b _0804441E +_08043CC4: + ldr r4, _08043D24 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + bne _08043CD4 + b _0804441E +_08043CD4: + ldr r0, _08043D28 + 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, _08043D2C + mov r2, r8 + ldr r0, [r2] + adds r0, 0xB2 + ldrb r0, [r0] + adds r0, 0x40 + strb r0, [r1, 0x3] + ldr r1, _08043D30 + ldr r0, _08043D34 + ldrb r0, [r0] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, _08043D38 + ldr r0, _08043D3C + str r0, [r1] + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r4] + b _080443D0 + .align 2, 0 +_08043D24: .4byte 0x02024280 +_08043D28: .4byte 0xffffbfff +_08043D2C: .4byte 0x02024332 +_08043D30: .4byte 0x02024474 +_08043D34: .4byte 0x0202420c +_08043D38: .4byte 0x02024214 +_08043D3C: .4byte 0x082db67f +_08043D40: + ldrb r0, [r7] + cmp r0, 0x1C + beq _08043D48 + b _0804441E +_08043D48: + ldr r4, _08043DA8 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + bne _08043D58 + b _0804441E +_08043D58: + ldr r0, _08043DAC + 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, _08043DB0 + mov r3, r8 + ldr r0, [r3] + adds r0, 0xB2 + ldrb r0, [r0] + strb r0, [r1, 0x3] + ldr r1, _08043DB4 + ldr r0, _08043DB8 + ldrb r0, [r0] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, _08043DBC + ldr r0, _08043DC0 + str r0, [r1] + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r4] + b _080443D0 + .align 2, 0 +_08043DA8: .4byte 0x02024280 +_08043DAC: .4byte 0xffffbfff +_08043DB0: .4byte 0x02024332 +_08043DB4: .4byte 0x02024474 +_08043DB8: .4byte 0x0202420b +_08043DBC: .4byte 0x02024214 +_08043DC0: .4byte 0x082db67f +_08043DC4: + movs r4, 0 + ldr r0, _08043DFC + ldrb r1, [r0] + cmp r4, r1 + blt _08043DD0 + b _0804441E +_08043DD0: + ldr r0, _08043E00 + adds r5, r1, 0 + ldr r2, _08043E04 + 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 + .align 2, 0 +_08043DFC: .4byte 0x0202406c +_08043E00: .4byte 0x02024084 +_08043E04: .4byte 0x020242ac +_08043E08: + movs r4, 0 + ldr r0, _08043EE4 + ldrb r0, [r0] + cmp r4, r0 + blt _08043E14 + b _0804441E +_08043E14: + ldr r5, _08043EE8 + mov r8, r5 + ldr r0, _08043EEC + 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, _08043EF0 + 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, _08043EF4 + 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, _08043EEC + 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, _08043EEC + 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, _08043EF8 + strb r0, [r2] + b _08043FAC + .align 2, 0 +_08043EE4: .4byte 0x0202406c +_08043EE8: .4byte 0x02024064 +_08043EEC: .4byte 0x02024084 +_08043EF0: .4byte 0x020242ac +_08043EF4: .4byte 0x02022fec +_08043EF8: .4byte 0x0202420a +_08043EFC: + ldr r3, _08043F3C + 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 + .align 2, 0 +_08043F3C: .4byte 0x02024084 +_08043F40: + ldr r3, _08043F80 + 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 + .align 2, 0 +_08043F80: .4byte 0x02024084 +_08043F84: + mov r2, r8 + strb r6, [r2] + movs r3, 0x58 + adds r0, r6, 0 + muls r0, r3 + ldr r5, _08043FD8 + 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, _08043FDC + 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, _08043FE0 + ldrb r0, [r0] + cmp r4, r0 + bge _08043FD6 + b _08043E22 +_08043FD6: + b _0804441E + .align 2, 0 +_08043FD8: .4byte 0x02024084 +_08043FDC: .4byte 0x0202420a +_08043FE0: .4byte 0x0202406c +_08043FE4: + movs r4, 0 + ldr r0, _0804401C + ldrb r1, [r0] + cmp r4, r1 + blt _08043FF0 + b _0804441E +_08043FF0: + ldr r0, _08044020 + adds r5, r1, 0 + ldr r2, _08044024 + 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 + .align 2, 0 +_0804401C: .4byte 0x0202406c +_08044020: .4byte 0x02024084 +_08044024: .4byte 0x020242ac +_08044028: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _08044078 + ldrb r0, [r0] + cmp r4, r0 + blt _0804403E + b _0804441E +_0804403E: + ldr r7, _0804407C +_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, _08044080 + strb r6, [r0] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804406A: + adds r4, r3, 0 + ldr r0, _08044078 + ldrb r0, [r0] + cmp r4, r0 + blt _08044040 + b _0804441E + .align 2, 0 +_08044078: .4byte 0x0202406c +_0804407C: .4byte 0x02024084 +_08044080: .4byte 0x0202420a +_08044084: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _080440D4 + ldrb r0, [r0] + cmp r4, r0 + blt _0804409A + b _0804441E +_0804409A: + ldr r7, _080440D8 +_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, _080440DC + strb r6, [r0] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_080440C6: + adds r4, r3, 0 + ldr r0, _080440D4 + ldrb r0, [r0] + cmp r4, r0 + blt _0804409C + b _0804441E + .align 2, 0 +_080440D4: .4byte 0x0202406c +_080440D8: .4byte 0x02024084 +_080440DC: .4byte 0x0202420a +_080440E0: + ldrb r0, [r7] + cmp r0, 0xFD + beq _08044104 + cmp r0, 0xFE + beq _0804413C + movs r4, 0 + ldr r0, _080440FC + adds r5, r0, 0 + ldrb r0, [r5] + cmp r4, r0 + blt _080440F8 + b _0804441E +_080440F8: + ldr r2, _08044100 + b _08044174 + .align 2, 0 +_080440FC: .4byte 0x0202406c +_08044100: .4byte 0x02024084 +_08044104: + movs r4, 0 + ldr r0, _08044134 + ldrb r0, [r0] + cmp r4, r0 + blt _08044110 + b _0804441E +_08044110: + ldr r5, _08044138 + 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 + .align 2, 0 +_08044134: .4byte 0x0202406c +_08044138: .4byte 0x020242ac +_0804413C: + movs r4, 0 + ldr r0, _0804416C + ldrb r0, [r0] + cmp r4, r0 + blt _08044148 + b _0804441E +_08044148: + ldr r5, _08044170 + 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 + .align 2, 0 +_0804416C: .4byte 0x0202406c +_08044170: .4byte 0x020242ac +_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, _080441D4 + ldrb r0, [r0] + cmp r4, r0 + blt _080441A2 + b _0804441E +_080441A2: + ldr r2, _080441D8 + 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 + .align 2, 0 +_080441D4: .4byte 0x0202406c +_080441D8: .4byte 0x02024084 +_080441DC: + movs r4, 0 + ldr r0, _08044214 + ldrb r0, [r0] + cmp r4, r0 + blt _080441E8 + b _0804441E +_080441E8: + ldr r7, _08044218 + adds r1, r0, 0 + movs r5, 0x58 + ldr r2, _0804421C +_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 + .align 2, 0 +_08044214: .4byte 0x0202406c +_08044218: .4byte 0x02024084 +_0804421C: .4byte 0x0202420a +_08044220: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _08044270 + ldrb r0, [r0] + cmp r4, r0 + blt _08044236 + b _0804441E +_08044236: + ldr r7, _08044274 +_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, _08044278 + strb r6, [r0] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08044264: + adds r4, 0x1 + ldr r0, _08044270 + ldrb r0, [r0] + cmp r4, r0 + blt _08044238 + b _0804441E + .align 2, 0 +_08044270: .4byte 0x0202406c +_08044274: .4byte 0x02024084 +_08044278: .4byte 0x0202420a +_0804427C: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _080442CC + ldrb r0, [r0] + cmp r4, r0 + blt _08044292 + b _0804441E +_08044292: + ldr r7, _080442D0 +_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, _080442D4 + strb r6, [r0] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080442C0: + adds r4, 0x1 + ldr r0, _080442CC + ldrb r0, [r0] + cmp r4, r0 + blt _08044294 + b _0804441E + .align 2, 0 +_080442CC: .4byte 0x0202406c +_080442D0: .4byte 0x02024084 +_080442D4: .4byte 0x0202420a +_080442D8: + ldr r0, _080442F0 + bl b_push_move_exec + ldr r0, _080442F4 + strb r6, [r0, 0x17] +_080442E2: + ldr r0, _080442F8 + ldr r0, [r0] + adds r0, 0x7F + mov r1, r9 + subs r1, 0x1 + strb r1, [r0] + b _0804441E + .align 2, 0 +_080442F0: .4byte 0x082db4a9 +_080442F4: .4byte 0x02024474 +_080442F8: .4byte 0x0202449c +_080442FC: + ldr r0, _08044318 + bl b_push_move_exec + ldr r0, _0804431C + mov r5, r10 + strb r5, [r0, 0x17] + ldr r0, _08044320 + ldr r0, [r0] + adds r0, 0x7F + mov r1, r9 + subs r1, 0x1 + strb r1, [r0] + b _0804443A + .align 2, 0 +_08044318: .4byte 0x082db4a9 +_0804431C: .4byte 0x02024474 +_08044320: .4byte 0x0202449c +_08044324: + strb r1, [r7] + ldr r0, [r2] + ldr r1, _08044338 + ands r0, r1 + str r0, [r2] + ldr r0, _0804433C + bl b_push_move_exec + b _080443C8 + .align 2, 0 +_08044338: .4byte 0xfff7ffff +_0804433C: .4byte 0x082db4b8 +_08044340: + ldr r0, _08044390 + bl b_push_move_exec + ldr r1, _08044394 + ldr r0, [sp, 0x18] + adds r1, r0, r1 + ldr r0, [r1] + ldr r2, _08044398 + ands r0, r2 + str r0, [r1] + ldr r0, _0804439C + strb r4, [r0, 0x17] + ldr r1, _080443A0 + movs r4, 0xFD + strb r4, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r2, _080443A4 + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, _080443A8 + 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, _080443AC + strb r4, [r1] + movs r0, 0x9 + strb r0, [r1, 0x1] + ldr r0, _080443B0 + ldrb r0, [r0] + strb r0, [r1, 0x2] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x3] + b _0804441E + .align 2, 0 +_08044390: .4byte 0x082db452 +_08044394: .4byte 0x020242ac +_08044398: .4byte 0xffefffff +_0804439C: .4byte 0x02024474 +_080443A0: .4byte 0x02022f58 +_080443A4: .4byte 0x02024064 +_080443A8: .4byte 0x0202406e +_080443AC: .4byte 0x02022f68 +_080443B0: .4byte 0x0202420a +_080443B4: + strb r1, [r7] + ldr r0, [r2] + ldr r1, _080443DC + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, _080443E0 + ldr r0, _080443E4 + str r0, [r1] +_080443C8: + ldr r0, _080443E8 + 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 + .align 2, 0 +_080443DC: .4byte 0xfff7ffff +_080443E0: .4byte 0x02024214 +_080443E4: .4byte 0x082db4c1 +_080443E8: .4byte 0x0202449c +_080443EC: + movs r4, 0 + ldr r0, _0804444C + ldrb r1, [r0] + cmp r4, r1 + bge _0804441E + ldr r0, _08044450 + adds r2, r1, 0 + adds r1, r0, 0 + adds r1, 0x20 + ldr r3, _08044454 +_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, _08044454 + 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 + .align 2, 0 +_0804444C: .4byte 0x0202406c +_08044450: .4byte 0x02024084 +_08044454: .4byte 0x0202420a + thumb_func_end ability_something + + thumb_func_start b_call_bc_move_exec +b_call_bc_move_exec: @ 8044458 + ldr r1, _08044484 + str r0, [r1] + ldr r0, _08044488 + 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, _0804448C + ldr r0, [r1] + str r0, [r2] + ldr r0, _08044490 + str r0, [r1] + ldr r1, _08044494 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08044484: .4byte 0x02024214 +_08044488: .4byte 0x020244a8 +_0804448C: .4byte 0x03005d04 +_08044490: .4byte bc_move_exec_returning + 1 +_08044494: .4byte 0x02024083 + 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, _080444CC + str r4, [r0] + ldr r0, _080444D0 + 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, _080444D4 + ldr r0, [r1] + str r0, [r2] + ldr r0, _080444D8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080444CC: .4byte 0x02024214 +_080444D0: .4byte 0x020244a8 +_080444D4: .4byte 0x03005d04 +_080444D8: .4byte sub_803E08C + 1 + 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, _08044528 + ldr r1, _0804452C + 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, _08044530 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + ldrb r0, [r0, 0x1A] + b _08044548 + .align 2, 0 +_08044528: .4byte 0x02024208 +_0804452C: .4byte 0x02024084 +_08044530: .4byte 0x02024404 +_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, _08044570 + ldr r0, _08044574 + 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, _08044578 + 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 + .align 2, 0 +_08044570: .4byte 0x02024084 +_08044574: .4byte 0x0202420b +_08044578: .4byte 0x02024404 +_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, _080445C8 + ldr r0, _080445CC + 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, _080445D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080445C8: .4byte 0x02024084 +_080445CC: .4byte 0x0202420c +_080445D0: .4byte _080445D4 + .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, _08044614 + ldr r0, [r0] + adds r0, 0x4A + movs r1, 0x2 + strb r1, [r0] + bl _0804582A + .align 2, 0 +_08044614: .4byte 0x0202449c +_08044618: + ldr r1, _08044670 + 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, _08044674 + strb r7, [r0, 0x17] + ldr r0, _08044678 + strb r7, [r0] + ldr r1, _0804467C + ldr r0, _08044680 + strb r7, [r0] + strb r7, [r1] + ldr r0, _08044684 + bl b_call_bc_move_exec + bl _0804582A + .align 2, 0 +_08044670: .4byte 0x02024084 +_08044674: .4byte 0x02024474 +_08044678: .4byte 0x0202420f +_0804467C: .4byte 0x02024064 +_08044680: .4byte 0x0202420b +_08044684: .4byte 0x082db7ae +_08044688: + ldr r1, _080446B0 + 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, _080446B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080446B0: .4byte 0x02024084 +_080446B4: .4byte _080446B8 + .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, _080447A8 + 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, _080447AC + bl b_call_bc_move_exec + b _08044B02 + .align 2, 0 +_080447A8: .4byte 0x020241f0 +_080447AC: .4byte 0x082db7c4 +_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, _080447D4 + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _080447D8 + b _080447EA + .align 2, 0 +_080447D4: .4byte 0x0202406e +_080447D8: .4byte 0x020244ec +_080447DC: + ldr r1, _08044858 + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0804485C +_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 move_get_pp_info + 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 + .align 2, 0 +_08044858: .4byte 0x0202406e +_0804485C: .4byte 0x02024744 +_08044860: + add r0, sp, 0x4 + strb r1, [r0] +_08044864: + ldr r1, _080448A4 + 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, _080448A8 + 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, _080448AC + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x3 + str r0, [sp, 0xC] + bl _080451DE + .align 2, 0 +_080448A4: .4byte 0x02022f58 +_080448A8: .4byte 0x082db7e1 +_080448AC: .4byte 0x02024064 +_080448B0: + ldr r0, _08044904 + 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, _08044908 + strb r7, [r0, 0x17] + ldr r0, _0804490C + strb r7, [r0] + ldr r1, _08044910 + ldr r0, _08044914 + strb r7, [r0] + strb r7, [r1] + ldr r0, _08044918 + bl b_call_bc_move_exec + bl _080451D6 + .align 2, 0 +_08044904: .4byte 0x02024084 +_08044908: .4byte 0x02024474 +_0804490C: .4byte 0x0202420f +_08044910: .4byte 0x02024064 +_08044914: .4byte 0x0202420b +_08044918: .4byte 0x082db7ae +_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, _08044974 + 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, _08044978 + 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 + .align 2, 0 +_08044974: .4byte 0x020241f0 +_08044978: .4byte 0x082db7f1 +_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, _080449F4 + 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, _080449F8 + 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 + .align 2, 0 +_080449F4: .4byte 0x02022f58 +_080449F8: .4byte 0x020241f0 +_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, _08044A70 + 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, _08044A74 + 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 + .align 2, 0 +_08044A70: .4byte 0x02022f58 +_08044A74: .4byte 0x020241f0 +_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, _08044AF0 + 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, _08044AF4 + 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, _08044AF8 + bl b_call_bc_move_exec + b _08044B02 + .align 2, 0 +_08044AF0: .4byte 0x02022f58 +_08044AF4: .4byte 0x020241f0 +_08044AF8: .4byte 0x082db824 +_08044AFC: + ldr r0, _08044B08 + bl b_call_bc_move_exec +_08044B02: + movs r0, 0x4 + str r0, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044B08: .4byte 0x082db7c4 +_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, _08044B84 + 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, _08044B88 + 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, _08044B8C + bl b_call_bc_move_exec + b _08044B96 + .align 2, 0 +_08044B84: .4byte 0x02022f58 +_08044B88: .4byte 0x020241f0 +_08044B8C: .4byte 0x082db824 +_08044B90: + ldr r0, _08044B9C + bl b_call_bc_move_exec +_08044B96: + movs r3, 0x4 + str r3, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044B9C: .4byte 0x082db7c4 +_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, _08044C18 + 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, _08044C1C + 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, _08044C20 + bl b_call_bc_move_exec + b _08044C2A + .align 2, 0 +_08044C18: .4byte 0x02022f58 +_08044C1C: .4byte 0x020241f0 +_08044C20: .4byte 0x082db824 +_08044C24: + ldr r0, _08044C30 + bl b_call_bc_move_exec +_08044C2A: + movs r2, 0x4 + str r2, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044C30: .4byte 0x082db7c4 +_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, _08044C8C + 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, _08044C90 + 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, _08044C94 + strb r7, [r0] + ldr r1, _08044C98 + movs r0, 0x11 + strb r0, [r1, 0x1A] + movs r0, 0xF + b _08044DF0 + .align 2, 0 +_08044C8C: .4byte 0x02022f58 +_08044C90: .4byte 0x02022f68 +_08044C94: .4byte 0x0202420e +_08044C98: .4byte 0x02024474 +_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, _08044CE4 + 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, _08044CE8 + strb r7, [r0] + ldr r1, _08044CEC + movs r0, 0x12 + strb r0, [r1, 0x1A] + movs r0, 0x10 + b _08044D8A + .align 2, 0 +_08044CE4: .4byte 0x02022f58 +_08044CE8: .4byte 0x0202420e +_08044CEC: .4byte 0x02024474 +_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, _08044D38 + 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, _08044D3C + strb r7, [r0] + ldr r1, _08044D40 + movs r0, 0x13 + strb r0, [r1, 0x1A] + movs r0, 0x11 + b _08044DF0 + .align 2, 0 +_08044D38: .4byte 0x02022f58 +_08044D3C: .4byte 0x0202420e +_08044D40: .4byte 0x02024474 +_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, _08044D9C + 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, _08044DA0 + strb r7, [r0] + ldr r1, _08044DA4 + movs r0, 0x14 + strb r0, [r1, 0x1A] + movs r0, 0x12 +_08044D8A: + strb r0, [r1, 0x10] + strb r6, [r1, 0x11] + ldr r0, _08044DA8 + bl b_call_bc_move_exec + movs r2, 0x5 + str r2, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044D9C: .4byte 0x02022f58 +_08044DA0: .4byte 0x0202420e +_08044DA4: .4byte 0x02024474 +_08044DA8: .4byte 0x082db84e +_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, _08044E00 + 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, _08044E04 + strb r7, [r0] + ldr r1, _08044E08 + movs r0, 0x15 + strb r0, [r1, 0x1A] + movs r0, 0x13 +_08044DF0: + strb r0, [r1, 0x10] + strb r6, [r1, 0x11] + ldr r0, _08044E0C + bl b_call_bc_move_exec + movs r5, 0x5 + str r5, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044E00: .4byte 0x02022f58 +_08044E04: .4byte 0x0202420e +_08044E08: .4byte 0x02024474 +_08044E0C: .4byte 0x082db84e +_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, _08044E58 + bl b_call_bc_move_exec + movs r2, 0x2 + str r2, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044E58: .4byte 0x082db869 +_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, _08044F2C +_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, _08044F30 + 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, _08044F34 + 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, _08044F38 + strb r7, [r0] + ldr r1, _08044F3C + mov r0, r10 + adds r0, 0x21 + strb r0, [r1, 0x1A] + adds r0, 0x6 + strb r0, [r1, 0x10] + strb r2, [r1, 0x11] + ldr r0, _08044F40 + bl b_call_bc_move_exec + movs r0, 0x5 + str r0, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044F2C: .4byte 0x0202409c +_08044F30: .4byte 0x02022f58 +_08044F34: .4byte 0x02022f68 +_08044F38: .4byte 0x0202420e +_08044F3C: .4byte 0x02024474 +_08044F40: .4byte 0x082db84e +_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, _08044F70 + bl b_call_bc_move_exec + movs r1, 0x1 + str r1, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044F70: .4byte 0x082db706 +_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, _08044FA0 + ands r2, r0 + str r2, [r1] + ldr r0, _08044FA4 + bl b_call_bc_move_exec + movs r2, 0x1 + str r2, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044FA0: .4byte 0xfffff077 +_08044FA4: .4byte 0x082db71e +_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, _08044FD4 + bl b_call_bc_move_exec + movs r3, 0x1 + str r3, [sp, 0xC] + b _080451DE + .align 2, 0 +_08044FD4: .4byte 0x082db736 +_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, _08045004 + bl b_call_bc_move_exec + movs r5, 0x1 + str r5, [sp, 0xC] + b _080451DE + .align 2, 0 +_08045004: .4byte 0x082db74e +_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, _0804503C + ands r0, r2 + str r0, [r1] + ldr r0, _08045040 + b _0804518A + .align 2, 0 +_0804503C: .4byte 0xf7ffffff +_08045040: .4byte 0x082db766 +_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, _08045070 + bl b_call_bc_move_exec + movs r1, 0x2 + str r1, [sp, 0xC] + b _080451DE + .align 2, 0 +_08045070: .4byte 0x082db77e +_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, _08045140 + ldr r1, _08045144 + bl gf_strcpy + 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, _08045148 + ands r0, r1 + str r0, [r2] + ldr r0, _08045140 + ldr r1, _0804514C + bl gf_strcpy + movs r2, 0x1 + add r10, r2 +_080450D8: + ldr r0, [r4] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080450EE + ldr r0, _08045140 + ldr r1, _08045150 + bl gf_strcpy + movs r3, 0x1 + add r10, r3 +_080450EE: + ldr r0, [r4] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08045104 + ldr r0, _08045140 + ldr r1, _08045154 + bl gf_strcpy + movs r0, 0x1 + add r10, r0 +_08045104: + ldr r0, [r4] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804511A + ldr r0, _08045140 + ldr r1, _08045158 + bl gf_strcpy + 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, _08045140 + ldr r1, _0804515C + bl gf_strcpy + movs r3, 0x1 + add r10, r3 +_08045132: + mov r5, r10 + cmp r5, 0x1 + bgt _08045164 + ldr r1, _08045160 + movs r0, 0 + b _08045168 + .align 2, 0 +_08045140: .4byte 0x02022f58 +_08045144: .4byte 0x0831bc70 +_08045148: .4byte 0xf7ffffff +_0804514C: .4byte 0x0831bc78 +_08045150: .4byte 0x0831bc80 +_08045154: .4byte 0x0831bc88 +_08045158: .4byte 0x0831bc90 +_0804515C: .4byte 0x0831bc98 +_08045160: .4byte 0x02024332 +_08045164: + ldr r1, _08045194 + movs r0, 0x1 +_08045168: + strb r0, [r1, 0x5] + ldr r2, _08045198 + 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, _0804519C +_0804518A: + bl b_call_bc_move_exec + movs r0, 0x1 + str r0, [sp, 0xC] + b _080451DE + .align 2, 0 +_08045194: .4byte 0x02024332 +_08045198: .4byte 0x02024084 +_0804519C: .4byte 0x082db794 +_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, _080451FC + ands r2, r0 + str r2, [r1] + ldr r0, _08045200 + ldr r1, _08045204 + bl gf_strcpy + ldr r0, _08045208 + bl b_call_bc_move_exec + ldr r1, _0804520C + 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, _08045210 + strb r7, [r0, 0x17] + ldr r0, _08045214 + strb r7, [r0] + ldr r4, _08045218 + ldr r0, _0804521C + strb r7, [r0] + strb r7, [r4] + ldr r3, [sp, 0xC] + cmp r3, 0x1 + beq _08045220 + cmp r3, 0x3 + beq _08045226 + b _0804582A + .align 2, 0 +_080451FC: .4byte 0xfff0ffff +_08045200: .4byte 0x02022f58 +_08045204: .4byte 0x0831bca0 +_08045208: .4byte 0x082db794 +_0804520C: .4byte 0x02024332 +_08045210: .4byte 0x02024474 +_08045214: .4byte 0x0202420f +_08045218: .4byte 0x02024064 +_0804521C: .4byte 0x0202420b +_08045220: + movs r0, 0x58 + muls r0, r7 + b _0804568C +_08045226: + ldr r4, _08045274 + 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, _08045278 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0804527C + 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 + .align 2, 0 +_08045274: .4byte 0x02024084 +_08045278: .4byte 0x020242bc +_0804527C: .4byte 0x0832a328 +_08045280: + movs r7, 0 + ldr r0, _080452B0 + ldrb r0, [r0] + cmp r7, r0 + bcc _0804528C + b _0804582A +_0804528C: + ldr r4, _080452B4 + ldr r1, _080452B8 + 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, _080452BC + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + b _080452D0 + .align 2, 0 +_080452B0: .4byte 0x0202406c +_080452B4: .4byte 0x02024208 +_080452B8: .4byte 0x02024084 +_080452BC: .4byte 0x02024404 +_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, _080452E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080452E4: .4byte _080452E8 + .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, _08045384 + 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, _08045388 + ldr r0, _0804538C + str r0, [r1] + movs r0, 0x1 + str r0, [sp, 0xC] + b _0804567A + .align 2, 0 +_08045384: .4byte 0x02024084 +_08045388: .4byte 0x02024214 +_0804538C: .4byte 0x082db70c +_08045390: + ldr r1, _080453BC + 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, _080453C0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, _080453C4 + ldr r0, _080453C8 + str r0, [r1] + movs r1, 0x1 + str r1, [sp, 0xC] + b _0804567A + .align 2, 0 +_080453BC: .4byte 0x02024084 +_080453C0: .4byte 0xfffff077 +_080453C4: .4byte 0x02024214 +_080453C8: .4byte 0x082db724 +_080453CC: + ldr r1, _080453FC + 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, _08045400 + ldr r0, _08045404 + str r0, [r1] + movs r2, 0x1 + str r2, [sp, 0xC] + b _0804567A + .align 2, 0 +_080453FC: .4byte 0x02024084 +_08045400: .4byte 0x02024214 +_08045404: .4byte 0x082db73c +_08045408: + ldr r1, _08045438 + 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, _0804543C + ldr r0, _08045440 + str r0, [r1] + movs r3, 0x1 + str r3, [sp, 0xC] + b _0804567A + .align 2, 0 +_08045438: .4byte 0x02024084 +_0804543C: .4byte 0x02024214 +_08045440: .4byte 0x082db754 +_08045444: + ldr r2, _0804547C + 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, _08045480 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, _08045484 + ldr r0, _08045488 + b _080455DC + .align 2, 0 +_0804547C: .4byte 0x02024084 +_08045480: .4byte 0xf7ffffff +_08045484: .4byte 0x02024214 +_08045488: .4byte 0x082db76c +_0804548C: + ldr r1, _080454BC + 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, _080454C0 + ldr r0, _080454C4 + str r0, [r1] + movs r0, 0x2 + str r0, [sp, 0xC] + b _0804567A + .align 2, 0 +_080454BC: .4byte 0x02024084 +_080454C0: .4byte 0x02024214 +_080454C4: .4byte 0x082db784 +_080454C8: + ldr r1, _08045504 + 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, _08045508 + ands r1, r0 + str r1, [r2] + ldr r0, _0804550C + ldr r1, _08045510 + bl gf_strcpy + bl b_movescr_stack_push_cursor + ldr r1, _08045514 + movs r0, 0 + strb r0, [r1, 0x5] + ldr r1, _08045518 + ldr r0, _0804551C + str r0, [r1] + movs r1, 0x2 + str r1, [sp, 0xC] + b _0804567A + .align 2, 0 +_08045504: .4byte 0x02024084 +_08045508: .4byte 0xfff0ffff +_0804550C: .4byte 0x02022f58 +_08045510: .4byte 0x0831bca0 +_08045514: .4byte 0x02024332 +_08045518: .4byte 0x02024214 +_0804551C: .4byte 0x082db79a +_08045520: + ldr r4, _080455E4 + 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, _080455E8 + ldr r1, _080455EC + bl gf_strcpy +_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, _080455F0 + ands r0, r1 + str r0, [r2] + ldr r0, _080455E8 + ldr r1, _080455F4 + bl gf_strcpy +_08045578: + ldr r0, [r6] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804558A + ldr r0, _080455E8 + ldr r1, _080455F8 + bl gf_strcpy +_0804558A: + ldr r0, [r6] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804559C + ldr r0, _080455E8 + ldr r1, _080455FC + bl gf_strcpy +_0804559C: + ldr r0, [r6] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080455AE + ldr r0, _080455E8 + ldr r1, _08045600 + bl gf_strcpy +_080455AE: + adds r5, r4 + ldr r0, [r5] + mov r3, r8 + ands r0, r3 + cmp r0, 0 + beq _080455C2 + ldr r0, _080455E8 + ldr r1, _08045604 + bl gf_strcpy +_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, _08045608 + strb r4, [r0, 0x5] + ldr r1, _0804560C + ldr r0, _08045610 +_080455DC: + str r0, [r1] + movs r5, 0x1 + str r5, [sp, 0xC] + b _0804567A + .align 2, 0 +_080455E4: .4byte 0x02024084 +_080455E8: .4byte 0x02022f58 +_080455EC: .4byte 0x0831bc70 +_080455F0: .4byte 0xf7ffffff +_080455F4: .4byte 0x0831bc78 +_080455F8: .4byte 0x0831bc80 +_080455FC: .4byte 0x0831bc88 +_08045600: .4byte 0x0831bc90 +_08045604: .4byte 0x0831bc98 +_08045608: .4byte 0x02024332 +_0804560C: .4byte 0x02024214 +_08045610: .4byte 0x082db79a +_08045614: + ldr r0, _08045660 + 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, _08045664 + strb r7, [r0, 0x17] + ldr r0, _08045668 + strb r7, [r0] + bl b_movescr_stack_push_cursor + ldr r1, _0804566C + ldr r0, _08045670 + str r0, [r1] + b _0804582A + .align 2, 0 +_08045660: .4byte 0x02024084 +_08045664: .4byte 0x02024474 +_08045668: .4byte 0x0202420f +_0804566C: .4byte 0x02024214 +_08045670: .4byte 0x082db7b4 +_08045674: + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _080456B8 +_0804567A: + ldr r0, _080456A8 + strb r7, [r0, 0x17] + ldr r0, _080456AC + strb r7, [r0] + ldr r4, _080456B0 + strb r7, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 +_0804568C: + ldr r1, _080456B4 + 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 + .align 2, 0 +_080456A8: .4byte 0x02024474 +_080456AC: .4byte 0x0202420f +_080456B0: .4byte 0x02024064 +_080456B4: .4byte 0x020240d0 +_080456B8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080456CC + ldrb r0, [r0] + cmp r7, r0 + bcs _080456C8 + b _0804528C +_080456C8: + b _0804582A + .align 2, 0 +_080456CC: .4byte 0x0202406c +_080456D0: + ldr r7, _080456E8 + 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 + .align 2, 0 +_080456E8: .4byte 0x020241f0 +_080456EC: + ldr r0, _08045778 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080456FA + b _0804582A +_080456FA: + ldr r2, _0804577C + ldr r4, _08045780 + 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, _08045784 + ldr r0, _08045788 + 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, _0804578C + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804582A + ldr r1, _08045790 + 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 + .align 2, 0 +_08045778: .4byte 0x0202427c +_0804577C: .4byte 0x0202437c +_08045780: .4byte 0x0202420c +_08045784: .4byte 0x0831c898 +_08045788: .4byte 0x020241ea +_0804578C: .4byte 0x02024084 +_08045790: .4byte 0x02024332 +_08045794: + ldr r0, _0804583C + ldrb r0, [r0] + movs r5, 0x29 + ands r5, r0 + cmp r5, 0 + bne _0804582A + ldr r1, _08045840 + ldr r4, _08045844 + 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, _08045848 + cmp r1, r0 + beq _0804582A + ldr r0, _0804584C + ldrb r3, [r0] + cmp r3, r2 + beq _0804582A + ldr r2, _08045850 + 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, _08045854 + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0] + ldr r0, _08045858 + strb r3, [r0] + ldr r0, _0804585C + 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, _08045860 + ldr r0, _08045864 + 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 + .align 2, 0 +_0804583C: .4byte 0x0202427c +_08045840: .4byte 0x0202437c +_08045844: .4byte 0x0202420c +_08045848: .4byte 0x0000ffff +_0804584C: .4byte 0x0202420b +_08045850: .4byte 0x02024084 +_08045854: .4byte 0x02024208 +_08045858: .4byte 0x0202420f +_0804585C: .4byte 0x02024474 +_08045860: .4byte 0x02024214 +_08045864: .4byte 0x082db7f7 + thumb_func_end berry_effects_maybe + + thumb_func_start sub_8045868 +sub_8045868: @ 8045868 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080458A0 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0 + strb r2, [r1, 0x10] + ldr r1, _080458A4 + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, _080458A8 + ands r1, r2 + str r1, [r3] + ldr r1, _080458AC + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r2, _080458B0 + ands r1, r2 + str r1, [r0] + bx lr + .align 2, 0 +_080458A0: .4byte 0x020242bc +_080458A4: .4byte 0x02024084 +_080458A8: .4byte 0xfdffffff +_080458AC: .4byte 0x020242ac +_080458B0: .4byte 0xffffbfff + thumb_func_end sub_8045868 + + thumb_func_start sub_80458B4 +sub_80458B4: @ 80458B4 + push {lr} + ldr r0, _080458D4 + ldr r0, [r0] + cmp r0, 0 + bne _080458D0 + ldr r1, _080458D8 + ldr r0, _080458DC + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_080458D0: + pop {r0} + bx r0 + .align 2, 0 +_080458D4: .4byte 0x02024068 +_080458D8: .4byte 0x0831bd10 +_080458DC: .4byte 0x02024214 + 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, _0804591C + 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, _08045920 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804591C: .4byte 0x0831c898 +_08045920: .4byte _08045924 + .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, _08045B08 + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08045B0C + 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, _08045B10 + 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, _08045B08 + 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, _08045B14 + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _08045B08 + 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, _08045B18 + ldrb r2, [r0] + ldr r1, _08045B1C + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _08045A6A + ldr r0, _08045B20 + 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, _08045B10 + 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, _08045B24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + orrs r1, r4 + strb r1, [r0] + b _08045C20 + .align 2, 0 +_08045B08: .4byte 0x0202420b +_08045B0C: .4byte 0x02024294 +_08045B10: .4byte 0x02024084 +_08045B14: .4byte 0x0202406c +_08045B18: .4byte 0x02024210 +_08045B1C: .4byte 0x0832a328 +_08045B20: .4byte 0x0831c898 +_08045B24: .4byte 0x0202437c +_08045B28: + ldr r0, _08045B3C + 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 + .align 2, 0 +_08045B3C: .4byte 0x0202420b +_08045B40: + ldr r0, _08045B74 + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08045B78 + 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, _08045B7C + 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 + .align 2, 0 +_08045B74: .4byte 0x0202420b +_08045B78: .4byte 0x02024294 +_08045B7C: .4byte 0x02024084 +_08045B80: + ldr r0, _08045BB4 + 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, _08045BB8 + 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 + .align 2, 0 +_08045BB4: .4byte 0x02022fec +_08045BB8: .4byte 0x0202420b +_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, _08045BF4 + ldrb r1, [r0] + ldr r2, _08045BF8 + 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 + .align 2, 0 +_08045BF4: .4byte 0x02024210 +_08045BF8: .4byte 0x0832a328 +_08045BFC: + ldr r0, _08045C18 + 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 + .align 2, 0 +_08045C18: .4byte 0x0202420b +_08045C1C: + ldr r0, _08045C3C + ldrb r5, [r0] +_08045C20: + ldr r0, _08045C3C + ldrb r0, [r0] + ldr r1, _08045C40 + 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 + .align 2, 0 +_08045C3C: .4byte 0x0202420b +_08045C40: .4byte 0x0202449c + 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, _08045C90 + lsls r4, 1 + adds r5, r4, r0 + ldrh r0, [r5] + movs r7, 0x64 + muls r0, r7 + ldr r6, _08045C94 + 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 + .align 2, 0 +_08045C90: .4byte 0x0202406e +_08045C94: .4byte 0x020244ec +_08045C98: + ldr r0, _08045CB4 + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08045CB8 + adds r0, r1 + movs r1, 0x50 + movs r2, 0 + bl pokemon_getattr +_08045CAE: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08045CB4: .4byte 0x0202406e +_08045CB8: .4byte 0x020244ec + 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, _08045DB0 + ldr r0, [r5] + ldr r1, _08045DB4 + ands r0, r1 + cmp r0, 0 + bne _08045DAC + ldr r4, _08045DB8 + 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, _08045DB0 + ldr r1, [r0] + ldr r0, _08045DBC + ands r0, r1 + cmp r0, 0 + bne _08045DAC + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + cmp r1, 0 + bne _08045DAC + ldr r2, _08045DC0 + ldr r0, _08045DB8 + 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, _08045DC4 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08045DAC + movs r6, 0xA + ldr r0, _08045DC8 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08045D5A + movs r6, 0x1E +_08045D5A: + ldr r0, _08045DCC + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08045D68 + movs r6, 0x32 +_08045D68: + ldr r0, _08045DD0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08045D76 + movs r6, 0x46 +_08045D76: + ldr r5, _08045DC0 + ldr r0, _08045DB8 + 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 + .align 2, 0 +_08045DB0: .4byte 0x02022fec +_08045DB4: .4byte 0x02000002 +_08045DB8: .4byte 0x0202420b +_08045DBC: .4byte 0x003f0100 +_08045DC0: .4byte 0x02024084 +_08045DC4: .4byte 0x0000086e +_08045DC8: .4byte 0x00000868 +_08045DCC: .4byte 0x0000086a +_08045DD0: .4byte 0x0000086c +_08045DD4: + ldr r3, _08045E10 + ldrh r0, [r3] + cmp r0, 0x63 + bne _08045DEA + adds r0, r5, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r1, [r0] + ldr r2, _08045E14 + 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, _08045E18 + ldr r0, _08045E1C + b _08045F7A + .align 2, 0 +_08045E10: .4byte 0x020241ea +_08045E14: .4byte 0xff7fffff +_08045E18: .4byte 0x02024214 +_08045E1C: .4byte 0x082db695 +_08045E20: + bl GenerateRandomNumber + movs r5, 0xFF + adds r1, r5, 0 + ands r1, r0 + ldr r7, _08045EC0 + ldr r2, _08045EC4 + 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, _08045EC8 + ldr r5, _08045ECC + 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, _08045ED0 + 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, _08045ED4 + ldr r3, _08045EC0 + ldr r0, _08045ECC + ldrb r0, [r0] + lsls r0, 1 + ldr r1, _08045EC4 + 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, _08045ED8 + ldr r0, _08045EDC + str r0, [r1] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, _08045EE0 + strb r0, [r1] + ldr r2, _08045EE4 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 14 + b _08045FCA + .align 2, 0 +_08045EC0: .4byte 0x02024084 +_08045EC4: .4byte 0x0202420b +_08045EC8: .4byte 0x0832a328 +_08045ECC: .4byte 0x020241e8 +_08045ED0: .4byte 0x020241e9 +_08045ED4: .4byte 0x020241ee +_08045ED8: .4byte 0x02024214 +_08045EDC: .4byte 0x082db6a5 +_08045EE0: .4byte 0x0202420c +_08045EE4: .4byte 0x02024280 +_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, _08045F58 + 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, _08045F5C + ldr r0, _08045F60 + b _08045F7A + .align 2, 0 +_08045F58: .4byte 0x0202406c +_08045F5C: .4byte 0x02024214 +_08045F60: .4byte 0x082db6d9 +_08045F64: + subs r4, r6 + cmp r4, r6 + blt _08045F8C +_08045F6A: + bl GenerateRandomNumber + ldr r2, _08045F80 + movs r1, 0x3 + ands r1, r0 + strb r1, [r2, 0x5] + ldr r1, _08045F84 + ldr r0, _08045F88 +_08045F7A: + str r0, [r1] + movs r0, 0x1 + b _08045FD0 + .align 2, 0 +_08045F80: .4byte 0x02024332 +_08045F84: .4byte 0x02024214 +_08045F88: .4byte 0x082db6ad +_08045F8C: + ldr r4, _08045FE0 + ldrb r1, [r4] + movs r0, 0x58 + muls r1, r0 + ldr r0, _08045FE4 + 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, _08045FE8 + str r0, [r1] + ldr r1, _08045FEC + ldrb r0, [r4] + strb r0, [r1] + ldr r1, _08045FF0 + ldr r0, _08045FF4 + str r0, [r1] + ldr r2, _08045FF8 + 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 + .align 2, 0 +_08045FE0: .4byte 0x0202420b +_08045FE4: .4byte 0x02024084 +_08045FE8: .4byte 0x020241f0 +_08045FEC: .4byte 0x0202420c +_08045FF0: .4byte 0x02024214 +_08045FF4: .4byte 0x082db6f0 +_08045FF8: .4byte 0x02024280 + 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, _08046018 + ldrb r0, [r0] + cmp r0, 0 + beq _08046020 + ldr r1, _0804601C + movs r0, 0xC + strb r0, [r1] + b _08046398 + .align 2, 0 +_08046018: .4byte 0x0202433a +_0804601C: .4byte 0x02024083 +_08046020: + ldr r2, _08046050 + ldr r0, _08046054 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08046064 + ldr r2, _08046058 + 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, _0804605C + ldr r0, _08046060 + b _08046396 + .align 2, 0 +_08046050: .4byte 0x02024084 +_08046054: .4byte 0x0202420b +_08046058: .4byte 0x02024280 +_0804605C: .4byte 0x02024214 +_08046060: .4byte 0x082d8a4e +_08046064: + bl sub_8041A6C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08046072 + b _08046398 +_08046072: + ldr r0, _080460E0 + 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, _080460E4 + ldr r0, _080460E8 + ldrb r1, [r0] + ldr r3, _080460EC + 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, _080460F0 + cmp r0, 0 + bne _08046108 + ldr r0, _080460F4 + ldrh r0, [r0] + cmp r0, 0xA5 + beq _08046108 + ldr r0, [r5] + ldr r1, _080460F8 + 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, _080460FC + ldr r0, _08046100 + str r0, [r1] + ldr r2, _08046104 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + b _08046398 + .align 2, 0 +_080460E0: .4byte 0x0202420c +_080460E4: .4byte 0x02024084 +_080460E8: .4byte 0x020241e8 +_080460EC: .4byte 0x0202420b +_080460F0: .4byte 0x02024280 +_080460F4: .4byte 0x020241ea +_080460F8: .4byte 0x00800200 +_080460FC: .4byte 0x02024214 +_08046100: .4byte 0x082db07a +_08046104: .4byte 0x0202427c +_08046108: + ldr r0, [r5] + ldr r1, _0804614C + 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 + .align 2, 0 +_0804614C: .4byte 0xff7fffff +_08046150: + ldr r0, _0804615C + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08046398 + .align 2, 0 +_0804615C: .4byte 0x0202427c +_08046160: + ldr r2, _080461C4 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + orrs r0, r1 + str r0, [r2] + ldr r2, _080461C8 + ldr r1, _080461CC + 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, _080461D0 + ldr r0, _080461D4 + 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, _080461D8 + ldrb r0, [r0] + ldr r2, _080461DC + 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, _080461E0 + ldr r0, _080461E4 + b _08046396 + .align 2, 0 +_080461C4: .4byte 0x02024280 +_080461C8: .4byte 0x0202433c +_080461CC: .4byte 0x0202420c +_080461D0: .4byte 0x0831c898 +_080461D4: .4byte 0x020241ea +_080461D8: .4byte 0x0202420b +_080461DC: .4byte 0x00000115 +_080461E0: .4byte 0x02024214 +_080461E4: .4byte 0x082db194 +_080461E8: + movs r2, 0 + ldr r0, _08046264 + ldrb r0, [r0] + cmp r2, r0 + bge _0804622A + ldr r6, _08046268 + ldr r1, _0804626C + mov r12, r1 + adds r5, r0, 0 + ldr r7, _08046270 +_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, _08046274 + 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, _08046278 + 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, _0804627C + movs r0, 0x1F + strb r0, [r4] + bl b_movescr_stack_push_cursor + ldr r1, _08046280 + ldr r0, _08046284 + str r0, [r1] + mov r1, r8 + ldrb r0, [r1] + ldrb r1, [r4] + bl b_history__record_ability_usage_of_player + b _08046398 + .align 2, 0 +_08046264: .4byte 0x0202406c +_08046268: .4byte 0x0202433c +_0804626C: .4byte 0x0831c898 +_08046270: .4byte 0x0202407e +_08046274: .4byte 0x020241ea +_08046278: .4byte 0x0202437c +_0804627C: .4byte 0x0202420a +_08046280: .4byte 0x02024214 +_08046284: .4byte 0x082db53e +_08046288: + lsls r0, r2, 4 + add r0, r9 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08046296 + b _08046390 +_08046296: + ldr r1, _0804632C + ldr r2, _08046330 + 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, _08046334 + ldr r0, _08046338 + 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, _08046334 + ldr r0, _08046338 + 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, _08046338 + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + ldr r2, _0804633C + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08046340 + ldr r3, _08046344 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, _08046348 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r1, _0804634C + movs r0, 0x1 + strb r0, [r1, 0x6] + b _08046390 + .align 2, 0 +_0804632C: .4byte 0x0831c898 +_08046330: .4byte 0x020241ea +_08046334: .4byte 0x02024084 +_08046338: .4byte 0x0202420b +_0804633C: .4byte 0x0202427c +_08046340: .4byte 0x02024250 +_08046344: .4byte 0x0202420c +_08046348: .4byte 0x02024258 +_0804634C: .4byte 0x02024332 +_08046350: + ldr r0, _0804637C + ldrb r0, [r0] + ldr r2, _08046380 + 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, _08046384 + ldrb r0, [r4] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, _08046388 + ldr r0, _0804638C + b _08046396 + .align 2, 0 +_0804637C: .4byte 0x0202420b +_08046380: .4byte 0x00000121 +_08046384: .4byte 0x02024474 +_08046388: .4byte 0x02024214 +_0804638C: .4byte 0x082db1ac +_08046390: + ldr r1, _080463A8 + 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 + .align 2, 0 +_080463A8: .4byte 0x02024214 + 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, _080463F8 + ldr r5, [r1] + adds r4, r5, r0 + ldr r0, _080463FC + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804640C + ldr r1, _08046400 + ldr r3, _08046404 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, _08046408 + 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 + .align 2, 0 +_080463F8: .4byte 0x02024214 +_080463FC: .4byte 0x0202427c +_08046400: .4byte 0x02024250 +_08046404: .4byte 0x0202420c +_08046408: .4byte 0x02024258 +_0804640C: + bl b_feature_update_destiny_bond + ldr r0, _08046434 + 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, _08046438 + str r4, [r0] +_0804642A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08046434: .4byte 0x0202420c +_08046438: .4byte 0x02024214 + thumb_func_end mcmd_jump_if_move_not_executed + + thumb_func_start atk40_801DBA0 +atk40_801DBA0: @ 804643C + push {lr} + ldr r1, _08046484 + ldr r0, _08046488 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0804649C + ldr r2, _0804648C + ldr r0, _08046490 + 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, _08046494 + 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, _08046498 + movs r0, 0x1 + strb r0, [r1, 0x6] + b _080464A4 + .align 2, 0 +_08046484: .4byte 0x0202433c +_08046488: .4byte 0x0202420c +_0804648C: .4byte 0x0831c898 +_08046490: .4byte 0x020241ea +_08046494: .4byte 0x0202427c +_08046498: .4byte 0x02024332 +_0804649C: + ldr r1, _080464A8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080464A4: + pop {r0} + bx r0 + .align 2, 0 +_080464A8: .4byte 0x02024214 + 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, _08046500 + ldr r0, _08046504 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080464F8 + ldr r2, _08046508 + ldr r0, _0804650C + 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, _08046510 + 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, _08046514 + movs r0, 0x1 + strb r0, [r1, 0x6] + movs r4, 0x1 +_080464F8: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08046500: .4byte 0x0202433c +_08046504: .4byte 0x0202420c +_08046508: .4byte 0x0831c898 +_0804650C: .4byte 0x020241ea +_08046510: .4byte 0x0202427c +_08046514: .4byte 0x02024332 + 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, _08046578 + ldr r3, _0804657C + 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, _08046580 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, _08046584 + ldrb r0, [r0, 0x15] + ldrb r1, [r1] + cmp r0, r1 + beq _08046634 +_0804654A: + ldr r0, _08046588 + 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, _0804658C + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08046634 + .align 2, 0 +_08046578: .4byte 0x020242ac +_0804657C: .4byte 0x0202420c +_08046580: .4byte 0x020242bc +_08046584: .4byte 0x0202420b +_08046588: .4byte 0x02024280 +_0804658C: .4byte 0x0202427c +_08046590: + ldr r0, [r2] + ldr r1, _08046640 + 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, _08046644 + 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, _08046648 + 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, _0804664C + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08046622 + ldr r0, _08046650 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x98 + beq _08046634 +_08046622: + ldr r1, _08046650 + 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 + .align 2, 0 +_08046640: .4byte 0xfffeffff +_08046644: .4byte 0xfffdffff +_08046648: .4byte 0xfffbffff +_0804664C: .4byte 0x020243cc +_08046650: .4byte 0x0831c898 +_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, _080466B8 + 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, _080466BC + ldr r3, _080466C0 + 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, _080466C4 + cmp r6, r0 + bne _080466D0 + ldr r1, _080466C8 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, _080466CC + ldrb r0, [r0, 0x15] + ldrb r1, [r1] + cmp r0, r1 + bne _080466D0 + adds r0, r5, 0x7 + str r0, [r7] + b _080469D2 + .align 2, 0 +_080466B8: .4byte 0x02024214 +_080466BC: .4byte 0x020242ac +_080466C0: .4byte 0x0202420c +_080466C4: .4byte 0x0000ffff +_080466C8: .4byte 0x020242bc +_080466CC: .4byte 0x0202420b +_080466D0: + ldrb r0, [r3] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r1, _080466FC + 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 + .align 2, 0 +_080466FC: .4byte 0x000400c0 +_08046700: + movs r0, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _0804670E + b _080469D2 +_0804670E: + ldr r1, _08046718 + ldr r0, [r1] + adds r0, 0x7 + str r0, [r1] + b _080469D2 + .align 2, 0 +_08046718: .4byte 0x02024214 +_0804671C: + cmp r6, 0 + bne _08046724 + ldr r0, _0804673C + ldrh r6, [r0] +_08046724: + ldr r0, _08046740 + 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 + .align 2, 0 +_0804673C: .4byte 0x020241ea +_08046740: .4byte 0x0202449c +_08046744: + ldr r1, _08046798 + 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, _0804679C + ldr r0, _080467A0 + 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, _080467A4 + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + ldrb r5, [r0, 0x1E] + b _080467BE + .align 2, 0 +_08046798: .4byte 0x0831c898 +_0804679C: .4byte 0x02024084 +_080467A0: .4byte 0x0202420c +_080467A4: .4byte 0x0202420b +_080467A8: + ldr r0, _0804690C + 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, _08046910 + 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, _08046914 + 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, _08046918 + 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, _0804691C + ldr r0, _0804690C + 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, _08046920 + ldrb r0, [r0] + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080468B8 + ldr r0, _08046914 + 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, _0804691C + ldr r0, _0804690C + 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, _08046920 + 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, _08046924 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + ldrb r2, [r0, 0x1A] + b _08046944 + .align 2, 0 +_0804690C: .4byte 0x0202420b +_08046910: .4byte 0x0831c898 +_08046914: .4byte 0x020243cc +_08046918: .4byte 0x0831c0f4 +_0804691C: .4byte 0x02024084 +_08046920: .4byte 0x0202420c +_08046924: .4byte 0x02024404 +_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, _080469A8 + ldr r1, _080469AC + 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, _080469B0 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080469B4 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080469C0 + ldr r1, _080469B8 + 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, _080469BC + movs r0, 0x2 + b _080469C4 + .align 2, 0 +_080469A8: .4byte 0x0202420f +_080469AC: .4byte 0x0202420c +_080469B0: .4byte 0x0202427c +_080469B4: .4byte 0x02022fec +_080469B8: .4byte 0x0831c898 +_080469BC: .4byte 0x02024332 +_080469C0: + ldr r1, _080469E4 + 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 + .align 2, 0 +_080469E4: .4byte 0x02024332 + thumb_func_end atk01_accuracycheck + + thumb_func_start atk02_attackstring +atk02_attackstring: @ 80469E8 + push {r4,r5,lr} + ldr r0, _08046A28 + ldr r5, [r0] + cmp r5, 0 + bne _08046A20 + ldr r4, _08046A2C + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + bne _08046A14 + ldr r0, _08046A30 + 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, _08046A34 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, _08046A38 + strb r5, [r0, 0x7] +_08046A20: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08046A28: .4byte 0x02024068 +_08046A2C: .4byte 0x02024280 +_08046A30: .4byte 0x0202420b +_08046A34: .4byte 0x02024214 +_08046A38: .4byte 0x02024332 + 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, _08046A8C + ldr r0, [r0] + cmp r0, 0 + beq _08046A54 + b _08046BEE +_08046A54: + ldr r1, _08046A90 + ldr r2, _08046A94 + 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, _08046A98 + ldr r0, _08046A9C + 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 + .align 2, 0 +_08046A8C: .4byte 0x02024068 +_08046A90: .4byte 0x0202437c +_08046A94: .4byte 0x0202420b +_08046A98: .4byte 0x0831c898 +_08046A9C: .4byte 0x020241ea +_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, _08046B58 + mov r2, r9 + ldrb r0, [r2] + ldrb r7, [r1] + cmp r0, r7 + beq _08046AF6 + ldr r2, _08046B5C + 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, _08046B60 + ldr r4, [r0] + movs r0, 0xA0 + lsls r0, 4 + ands r4, r0 + cmp r4, 0 + bne _08046BDC + ldr r2, _08046B5C + ldr r3, _08046B64 + ldr r1, _08046B68 + 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, _08046B6C + 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 + .align 2, 0 +_08046B58: .4byte 0x0202420c +_08046B5C: .4byte 0x02024084 +_08046B60: .4byte 0x02024280 +_08046B64: .4byte 0x020241e8 +_08046B68: .4byte 0x0202420b +_08046B6C: .4byte 0x0202433c +_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, _08046C00 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _08046C04 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08046BDC + ldr r0, _08046C08 + 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, _08046C0C + ldr r0, [r2] + ldr r1, _08046C10 + ands r0, r1 + str r0, [r2] + ldr r1, _08046C14 + 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 + .align 2, 0 +_08046C00: .4byte 0x020242bc +_08046C04: .4byte 0x0832a328 +_08046C08: .4byte 0x02024064 +_08046C0C: .4byte 0x02024280 +_08046C10: .4byte 0xfffff7ff +_08046C14: .4byte 0x02024214 + thumb_func_end atk03_ppreduce + + thumb_func_start atk04_critcalc +atk04_critcalc: @ 8046C18 + push {r4-r7,lr} + ldr r1, _08046C3C + ldr r0, _08046C40 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + cmp r0, 0xAF + bne _08046C48 + ldr r1, _08046C44 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + b _08046C50 + .align 2, 0 +_08046C3C: .4byte 0x02024084 +_08046C40: .4byte 0x0202420b +_08046C44: .4byte 0x02024404 +_08046C48: + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 +_08046C50: + ldr r1, _08046CDC + ldr r3, _08046CE0 + ldrb r0, [r3] + strb r0, [r1] + ldr r4, _08046CE4 + 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, _08046CE8 + ldr r0, _08046CEC + 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 + .align 2, 0 +_08046CDC: .4byte 0x0202420f +_08046CE0: .4byte 0x0202420b +_08046CE4: .4byte 0x02024084 +_08046CE8: .4byte 0x0831c898 +_08046CEC: .4byte 0x020241ea +_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, _08046D5C + 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, _08046D60 + 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, _08046D64 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + bne _08046D70 + bl GenerateRandomNumber + ldr r2, _08046D68 + 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, _08046D6C + movs r0, 0x2 + b _08046D74 + .align 2, 0 +_08046D5C: .4byte 0x0202420c +_08046D60: .4byte 0x020242ac +_08046D64: .4byte 0x02022fec +_08046D68: .4byte 0x0831c128 +_08046D6C: .4byte 0x02024211 +_08046D70: + ldr r1, _08046D84 + movs r0, 0x1 +_08046D74: + strb r0, [r1] + ldr r1, _08046D88 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08046D84: .4byte 0x02024211 +_08046D88: .4byte 0x02024214 + thumb_func_end atk04_critcalc + + thumb_func_start atk05_cmd5 +atk05_cmd5: @ 8046D8C + push {r4-r7,lr} + sub sp, 0x10 + ldr r4, _08046E44 + ldr r5, _08046E48 + 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, _08046E4C + ldrb r0, [r6] + movs r4, 0x58 + muls r0, r4 + ldr r2, _08046E50 + adds r0, r2 + ldrb r1, [r5] + muls r1, r4 + adds r1, r2 + ldr r7, _08046E54 + ldrh r2, [r7] + ldr r4, _08046E58 + ldrh r4, [r4] + str r4, [sp] + ldr r4, _08046E5C + 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, _08046E60 + ldr r1, _08046E64 + ldrb r1, [r1] + muls r1, r0 + ldr r0, _08046E68 + ldrb r0, [r0, 0xE] + adds r3, r1, 0 + muls r3, r0 + str r3, [r4] + ldr r1, _08046E6C + 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, _08046E70 + 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, _08046E74 + ldr r0, _08046E4C + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _08046E32 + ldr r4, _08046E60 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_08046E32: + ldr r1, _08046E78 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08046E44: .4byte 0x0202428e +_08046E48: .4byte 0x0202420c +_08046E4C: .4byte 0x0202420b +_08046E50: .4byte 0x02024084 +_08046E54: .4byte 0x020241ea +_08046E58: .4byte 0x02024400 +_08046E5C: .4byte 0x0202449c +_08046E60: .4byte 0x020241f0 +_08046E64: .4byte 0x02024211 +_08046E68: .4byte 0x02024474 +_08046E6C: .4byte 0x020242ac +_08046E70: .4byte 0x0831c898 +_08046E74: .4byte 0x0202433c +_08046E78: .4byte 0x02024214 + 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, _08046F34 + 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, _08046F38 + adds r0, r2 + muls r1, r5 + adds r1, r2 + ldr r2, _08046F3C + mov r8, r2 + ldrh r2, [r2] + ldr r6, _08046F40 + ldrh r4, [r6] + str r4, [sp] + ldr r4, _08046F44 + ldr r4, [r4] + ldrb r4, [r4, 0x13] + str r4, [sp, 0x4] + str r7, [sp, 0x8] + str r5, [sp, 0xC] + bl sub_806957C + ldr r4, _08046F48 + movs r1, 0 + strh r1, [r6] + ldr r1, _08046F4C + ldrb r1, [r1] + muls r1, r0 + ldr r0, _08046F50 + ldrb r0, [r0, 0xE] + adds r3, r1, 0 + muls r3, r0 + str r3, [r4] + ldr r1, _08046F54 + 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, _08046F58 + 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, _08046F5C + lsls r1, r7, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + cmp r0, 0 + bge _08046F28 + ldr r4, _08046F48 + 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 + .align 2, 0 +_08046F34: .4byte 0x0202428e +_08046F38: .4byte 0x02024084 +_08046F3C: .4byte 0x020241ea +_08046F40: .4byte 0x02024400 +_08046F44: .4byte 0x0202449c +_08046F48: .4byte 0x020241f0 +_08046F4C: .4byte 0x02024211 +_08046F50: .4byte 0x02024474 +_08046F54: .4byte 0x020242ac +_08046F58: .4byte 0x0831c898 +_08046F5C: .4byte 0x0202433c + 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, _08046F90 + 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 + .align 2, 0 +_08046F90: .4byte 0x020241f0 +_08046F94: + cmp r4, 0x14 + beq _08046FF0 + b _08047032 +_08046F9A: + ldr r2, _08046FAC + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0xFB + ands r0, r1 + movs r1, 0xFD + ands r0, r1 + b _08047030 + .align 2, 0 +_08046FAC: .4byte 0x0202427c +_08046FB0: + ldr r2, _08046FE0 + ldr r0, _08046FE4 + 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, _08046FE8 + 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 + .align 2, 0 +_08046FE0: .4byte 0x0831c898 +_08046FE4: .4byte 0x020241ea +_08046FE8: .4byte 0x0202427c +_08046FEC: + movs r0, 0x4 + b _0804702E +_08046FF0: + ldr r2, _08047020 + ldr r0, _08047024 + 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, _08047028 + 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 + .align 2, 0 +_08047020: .4byte 0x0831c898 +_08047024: .4byte 0x020241ea +_08047028: .4byte 0x0202427c +_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, _08047060 + ldrh r0, [r1] + cmp r0, 0xA5 + bne _0804704C + b _08047260 +_0804704C: + ldr r0, _08047064 + 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 + .align 2, 0 +_08047060: .4byte 0x020241ea +_08047064: .4byte 0x0202449c +_08047068: + ldr r2, _08047100 + 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, _08047104 + ldr r0, _08047108 + 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, _0804710C + 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, _08047110 + 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, _08047114 + strb r0, [r3] + ldr r2, _08047118 + ldrb r0, [r2] + movs r1, 0x9 + orrs r0, r1 + strb r0, [r2] + ldr r1, _0804711C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, _08047120 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r0, _08047124 + mov r1, r8 + strb r1, [r0, 0x6] + ldrb r0, [r4] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player + b _080471C4 + .align 2, 0 +_08047100: .4byte 0x0831c898 +_08047104: .4byte 0x02024084 +_08047108: .4byte 0x0202420b +_0804710C: .4byte 0x020241f0 +_08047110: .4byte 0x0202420c +_08047114: .4byte 0x0202420a +_08047118: .4byte 0x0202427c +_0804711C: .4byte 0x02024250 +_08047120: .4byte 0x02024258 +_08047124: .4byte 0x02024332 +_08047128: + ldr r1, _08047134 + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r1, 0 + b _080471A4 + .align 2, 0 +_08047134: .4byte 0x0831ace8 +_08047138: + adds r3, 0x3 + b _080471A0 +_0804713C: + ldr r5, _08047274 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, r8 + bne _08047198 + adds r1, r3, 0x1 + adds r1, r5 + ldr r2, _08047278 + ldr r7, _0804727C + 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, _08047278 + ldr r4, _0804727C + ldr r2, _08047274 +_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, _08047278 + ldr r5, _0804727C + 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, _08047280 + ldrb r0, [r0] + ldr r7, _08047284 + ldrh r1, [r7] + bl move_weather_interaction + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08047242 + ldr r1, _08047288 + 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, _0804728C + 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, _08047290 + strb r6, [r3] + movs r0, 0x1 + orrs r0, r4 + mov r1, r8 + strb r0, [r1] + ldr r1, _08047294 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, _08047298 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r1, _0804729C + movs r0, 0x3 + strb r0, [r1, 0x6] + ldrb r0, [r5] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player +_08047242: + ldr r0, _08047288 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08047260 + ldr r2, _080472A0 + ldr r0, _08047280 + 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, _080472A4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08047274: .4byte 0x0831ace8 +_08047278: .4byte 0x02024084 +_0804727C: .4byte 0x0202420c +_08047280: .4byte 0x0202420b +_08047284: .4byte 0x020241ea +_08047288: .4byte 0x0202427c +_0804728C: .4byte 0x0831c898 +_08047290: .4byte 0x0202420a +_08047294: .4byte 0x02024250 +_08047298: .4byte 0x02024258 +_0804729C: .4byte 0x02024332 +_080472A0: .4byte 0x0202433c +_080472A4: .4byte 0x02024214 + 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, _080472E8 + ldrh r1, [r0] + mov r9, r0 + cmp r1, 0xA5 + bne _080472C0 + b _08047508 +_080472C0: + ldr r2, _080472EC + 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, _080472F0 + 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 + .align 2, 0 +_080472E8: .4byte 0x020241ea +_080472EC: .4byte 0x0831c898 +_080472F0: .4byte 0x0202449c +_080472F4: + ldrb r1, [r1, 0x2] + mov r12, r1 +_080472F8: + ldr r2, _0804732C + ldr r3, _08047330 + 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, _08047334 + strb r1, [r0] + ldr r0, _08047338 + mov r1, r12 + strb r1, [r0, 0x6] + ldrb r0, [r3] + movs r1, 0x1A + bl b_history__record_ability_usage_of_player + b _08047508 + .align 2, 0 +_0804732C: .4byte 0x02024084 +_08047330: .4byte 0x0202420c +_08047334: .4byte 0x0202420a +_08047338: .4byte 0x02024332 +_0804733C: + ldr r1, _08047348 + adds r0, r5, r1 + ldrb r0, [r0] + adds r4, r1, 0 + b _0804748E + .align 2, 0 +_08047348: .4byte 0x0831ace8 +_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, _08047514 + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08047518 + ldr r0, _0804751C + 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, _08047514 + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08047518 + ldr r0, _0804751C + 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, _0804751C + 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, _08047520 + 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, _08047524 + strb r4, [r0] + ldr r1, _08047528 + 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 + .align 2, 0 +_08047514: .4byte 0x0202427c +_08047518: .4byte 0x0202433c +_0804751C: .4byte 0x0202420b +_08047520: .4byte 0x0831c898 +_08047524: .4byte 0x0202420a +_08047528: .4byte 0x02024332 + 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, _08047560 + 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 + .align 2, 0 +_08047560: .4byte 0x020241f0 +_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, _080475A4 + 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 + .align 2, 0 +_080475A4: .4byte 0x0831c898 +_080475A8: + movs r0, 0x4 + b _080475DA +_080475AC: + ldr r0, _080475D4 + 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 + .align 2, 0 +_080475D4: .4byte 0x0831c898 +_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, _08047684 + 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, _08047688 + 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, _0804768C + 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 + .align 2, 0 +_08047684: .4byte 0x0831c898 +_08047688: .4byte 0x02024084 +_0804768C: .4byte 0x020241f0 +_08047690: + ldr r1, _080476AC + 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 + .align 2, 0 +_080476AC: .4byte 0x0831ace8 +_080476B0: + movs r0, 0x3 + add r8, r0 + b _08047718 +_080476B6: + ldr r7, _080477B0 + 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, _080477B4 + 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, _080477B4 + ldr r2, _080477B0 +_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, _080477B8 + 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 + .align 2, 0 +_080477B0: .4byte 0x0831ace8 +_080477B4: .4byte 0x02024084 +_080477B8: .4byte 0x0831c898 + 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, _080477F8 + 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 + .align 2, 0 +_080477F8: .4byte 0x083203cc +_080477FC: + ldr r2, _08047820 + 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 + .align 2, 0 +_08047820: .4byte 0x0831c898 +_08047824: + ldr r0, _080478B0 + 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, _080478B0 + 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, _080478B4 + 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 + .align 2, 0 +_080478B0: .4byte 0x0831ace8 +_080478B4: .4byte 0x0831c898 + 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, _080478F0 + 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 + .align 2, 0 +_080478F0: .4byte 0x020241f0 + 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, _0804794C + 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, _08047950 + ldr r6, _08047954 + 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, _08047958 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08047976 + .align 2, 0 +_0804794C: .4byte 0x020241f0 +_08047950: .4byte 0x02024084 +_08047954: .4byte 0x0202420c +_08047958: .4byte 0x02024404 +_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, _08047A38 + ldr r5, _08047A3C + 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, _08047A40 + 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, _08047A44 + ldr r3, _08047A3C + 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, _08047A48 + ldr r0, _08047A4C + 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, _08047A50 + lsls r1, r4, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _08047A06 + ldr r0, _08047A40 + 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, _08047A54 + ldr r0, [r2] + cmp r1, r0 + bgt _08047A84 + subs r0, r1, 0x1 + str r0, [r2] + ldr r1, _08047A50 + ldrb r3, [r3] + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _08047A5C + ldr r0, _08047A58 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _08047A84 + .align 2, 0 +_08047A38: .4byte 0x0202420f +_08047A3C: .4byte 0x0202420c +_08047A40: .4byte 0x0202437c +_08047A44: .4byte 0x02024084 +_08047A48: .4byte 0x0831c898 +_08047A4C: .4byte 0x020241ea +_08047A50: .4byte 0x0202433c +_08047A54: .4byte 0x020241f0 +_08047A58: .4byte 0x0202427c +_08047A5C: + ldr r0, _08047A94 + 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, _08047A98 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08047A9C + adds r0, r3, 0 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_08047A84: + ldr r1, _08047AA0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08047A94: .4byte 0x0202437c +_08047A98: .4byte 0x0202427c +_08047A9C: .4byte 0x02024208 +_08047AA0: .4byte 0x02024214 + 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, _08047AFC + 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, _08047B00 + ldr r6, _08047B04 + 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, _08047B08 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08047B26 + .align 2, 0 +_08047AFC: .4byte 0x020241f0 +_08047B00: .4byte 0x02024084 +_08047B04: .4byte 0x0202420c +_08047B08: .4byte 0x02024404 +_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, _08047BCC + ldr r5, _08047BD0 + 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, _08047BD4 + 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, _08047BD8 + ldr r6, _08047BD0 + 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, _08047BDC + lsls r0, r2, 4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + blt _08047BA2 + ldr r0, _08047BD4 + 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, _08047BE0 + 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, _08047BE4 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _08047C10 + .align 2, 0 +_08047BCC: .4byte 0x0202420f +_08047BD0: .4byte 0x0202420c +_08047BD4: .4byte 0x0202437c +_08047BD8: .4byte 0x02024084 +_08047BDC: .4byte 0x0202433c +_08047BE0: .4byte 0x020241f0 +_08047BE4: .4byte 0x0202427c +_08047BE8: + ldr r0, _08047C20 + 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, _08047C24 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08047C28 + adds r0, r3, 0 + muls r0, r7 + adds r0, r4 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_08047C10: + ldr r1, _08047C2C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08047C20: .4byte 0x0202437c +_08047C24: .4byte 0x0202427c +_08047C28: .4byte 0x02024208 +_08047C2C: .4byte 0x02024214 + thumb_func_end atk08_cmd8 + + thumb_func_start atk09_attackanimation +atk09_attackanimation: @ 8047C30 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, _08047C74 + ldr r0, [r0] + cmp r0, 0 + beq _08047C3E + b _08047DB6 +_08047C3E: + ldr r0, _08047C78 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + ldr r5, _08047C7C + cmp r0, 0 + beq _08047C8C + ldrh r0, [r5] + cmp r0, 0x90 + beq _08047C8C + cmp r0, 0xA4 + beq _08047C8C + ldr r4, _08047C80 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08047C84 + str r0, [r4] + ldr r1, _08047C88 + ldrb r0, [r1, 0x18] + adds r0, 0x1 + strb r0, [r1, 0x18] + ldrb r0, [r1, 0x19] + adds r0, 0x1 + strb r0, [r1, 0x19] + b _08047DB6 + .align 2, 0 +_08047C74: .4byte 0x02024068 +_08047C78: .4byte 0x02024280 +_08047C7C: .4byte 0x020241ea +_08047C80: .4byte 0x02024214 +_08047C84: .4byte 0x082dabb9 +_08047C88: .4byte 0x02024474 +_08047C8C: + ldr r2, _08047CF8 + 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, _08047CFC + ldrb r0, [r0, 0x19] + cmp r0, 0 + bne _08047D88 +_08047CBA: + ldr r0, _08047D00 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047DA8 + ldr r1, _08047D04 + ldr r3, _08047D08 + ldrb r0, [r3] + strb r0, [r1] + ldr r2, _08047D0C + ldr r0, _08047D10 + 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, _08047D14 + ldrb r6, [r0] + b _08047D42 + .align 2, 0 +_08047CF8: .4byte 0x0831c898 +_08047CFC: .4byte 0x02024474 +_08047D00: .4byte 0x0202427c +_08047D04: .4byte 0x02024064 +_08047D08: .4byte 0x0202420b +_08047D0C: .4byte 0x02024084 +_08047D10: .4byte 0x0202420c +_08047D14: .4byte 0x02024212 +_08047D18: + ldr r3, _08047D38 + ldrb r0, [r3] + cmp r0, 0x1 + bls _08047D40 + mov r1, r12 + adds r0, r4, r1 + ldrh r2, [r0, 0x28] + ldr r0, _08047D3C + ldr r1, [r0] + movs r6, 0x1 + adds r4, r0, 0 + cmp r2, r1 + ble _08047D44 + ldrb r6, [r3] + b _08047D44 + .align 2, 0 +_08047D38: .4byte 0x02024212 +_08047D3C: .4byte 0x020241f0 +_08047D40: + ldrb r6, [r3] +_08047D42: + ldr r4, _08047D94 +_08047D44: + ldrh r1, [r5] + ldr r5, _08047D98 + ldrb r2, [r5, 0x18] + ldr r0, _08047D9C + 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, _08047DA0 + 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, _08047DA4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _08047DB6 + .align 2, 0 +_08047D94: .4byte 0x020241f0 +_08047D98: .4byte 0x02024474 +_08047D9C: .4byte 0x020244e0 +_08047DA0: .4byte 0x020242bc +_08047DA4: .4byte 0x02024214 +_08047DA8: + ldr r4, _08047DC0 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08047DC4 + str r0, [r4] +_08047DB6: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08047DC0: .4byte 0x02024214 +_08047DC4: .4byte 0x082dabb9 + thumb_func_end atk09_attackanimation + + thumb_func_start sub_8047DC8 +sub_8047DC8: @ 8047DC8 + push {lr} + ldr r0, _08047DE0 + ldr r0, [r0] + cmp r0, 0 + bne _08047DDA + ldr r1, _08047DE4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08047DDA: + pop {r0} + bx r0 + .align 2, 0 +_08047DE0: .4byte 0x02024068 +_08047DE4: .4byte 0x02024214 + thumb_func_end sub_8047DC8 + + thumb_func_start atk0B_graphicalhpupdate +atk0B_graphicalhpupdate: @ 8047DE8 + push {r4,lr} + ldr r0, _08047E4C + ldr r0, [r0] + cmp r0, 0 + bne _08047EAA + ldr r0, _08047E50 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047EA2 + ldr r0, _08047E54 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, _08047E58 + strb r0, [r2] + ldr r1, _08047E5C + 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, _08047E60 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _08047E68 + ldr r0, _08047E64 + 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 + .align 2, 0 +_08047E4C: .4byte 0x02024068 +_08047E50: .4byte 0x0202427c +_08047E54: .4byte 0x02024214 +_08047E58: .4byte 0x02024064 +_08047E5C: .4byte 0x02024084 +_08047E60: .4byte 0x020242bc +_08047E64: .4byte 0x02024280 +_08047E68: + ldr r0, _08047EB0 + ldr r0, [r0] + ldr r1, _08047EB4 + 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, _08047EB8 + 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, _08047EB0 + ldr r0, [r0] + cmp r0, 0 + ble _08047EA2 + ldr r0, _08047EBC + ldrb r1, [r0, 0x5] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x5] +_08047EA2: + ldr r1, _08047EC0 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08047EAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08047EB0: .4byte 0x020241f0 +_08047EB4: .4byte 0x00002710 +_08047EB8: .4byte 0x02024064 +_08047EBC: .4byte 0x03005d10 +_08047EC0: .4byte 0x02024214 + thumb_func_end atk0B_graphicalhpupdate + + thumb_func_start atk0C_datahpupdate +atk0C_datahpupdate: @ 8047EC4 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, _08047EEC + ldr r0, [r0] + cmp r0, 0 + beq _08047ED2 + b _080482A2 +_08047ED2: + ldr r0, _08047EF0 + 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 + .align 2, 0 +_08047EEC: .4byte 0x02024068 +_08047EF0: .4byte 0x0202449c +_08047EF4: + ldr r2, _08047F90 + ldr r0, _08047F94 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r6, [r0, 0x2] +_08047F04: + ldr r0, _08047F98 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08047F12 + b _08048274 +_08047F12: + ldr r0, _08047F9C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r7, _08047FA0 + strb r0, [r7] + ldr r1, _08047FA4 + 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, _08047FA8 + 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, _08047FAC + ldr r3, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r3, r0 + cmp r3, 0 + bne _08048028 + adds r5, r1, 0 + ldr r6, _08047FB0 + ldr r4, [r6] + cmp r5, r4 + blt _08047FBC + ldr r0, _08047FB4 + 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, _08047FB8 + ldr r0, [r6] + str r0, [r1] + b _08047FEC + .align 2, 0 +_08047F90: .4byte 0x0831c898 +_08047F94: .4byte 0x020241ea +_08047F98: .4byte 0x0202427c +_08047F9C: .4byte 0x02024214 +_08047FA0: .4byte 0x02024064 +_08047FA4: .4byte 0x02024084 +_08047FA8: .4byte 0x020242bc +_08047FAC: .4byte 0x02024280 +_08047FB0: .4byte 0x020241f0 +_08047FB4: .4byte 0x0202437c +_08047FB8: .4byte 0x020241f4 +_08047FBC: + ldr r0, _08048014 + 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, _08048018 + 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, _0804801C + 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, _08048020 + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + bl b_movescr_stack_push_cursor + ldr r0, _08048024 + str r0, [r4] + b _080482A2 + .align 2, 0 +_08048014: .4byte 0x0202437c +_08048018: .4byte 0x020241f4 +_0804801C: .4byte 0x02024064 +_08048020: .4byte 0x02024214 +_08048024: .4byte 0x082db6fb +_08048028: + ldr r0, _08048068 + ldr r2, [r0] + ldr r1, _0804806C + ands r2, r1 + str r2, [r0] + ldr r1, _08048070 + ldr r5, [r1] + mov r12, r0 + adds r7, r1, 0 + cmp r5, 0 + bge _0804807C + ldr r4, _08048074 + ldr r2, _08048078 + 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 + .align 2, 0 +_08048068: .4byte 0x02024280 +_0804806C: .4byte 0xfffffeff +_08048070: .4byte 0x020241f0 +_08048074: .4byte 0x02024084 +_08048078: .4byte 0x02024064 +_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, _08048094 + b _080480E0 + .align 2, 0 +_08048094: .4byte 0x02024064 +_08048098: + ldr r0, _080480C0 + ldr r2, _080480C4 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + adds r0, r5 + str r0, [r1] + ldr r0, _080480C8 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + adds r5, r2, 0 + cmp r0, 0 + bne _080480D4 + ldr r1, _080480CC + ldrb r0, [r5] + adds r0, r1 + ldr r1, _080480D0 + b _080480DC + .align 2, 0 +_080480C0: .4byte 0x020241f8 +_080480C4: .4byte 0x02024064 +_080480C8: .4byte 0x02024214 +_080480CC: .4byte 0x02024288 +_080480D0: .4byte 0x0202420b +_080480D4: + ldr r1, _08048100 + ldrb r0, [r5] + adds r0, r1 + ldr r1, _08048104 +_080480DC: + ldrb r1, [r1] + strb r1, [r0] +_080480E0: + ldr r4, _08048108 + 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, _0804810C + str r1, [r0] + adds r7, r0, 0 + b _08048120 + .align 2, 0 +_08048100: .4byte 0x02024288 +_08048104: .4byte 0x0202420c +_08048108: .4byte 0x02024084 +_0804810C: .4byte 0x020241f4 +_08048110: + ldr r2, _08048194 + 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, _08048198 + 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, _0804819C + ldrh r0, [r0] + cmp r0, 0xDC + beq _080481CC + ldr r3, _080481A0 + 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, _080481A4 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _080481AC + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, _080481A8 + b _080481B4 + .align 2, 0 +_08048194: .4byte 0x020241f4 +_08048198: .4byte 0x0202437c +_0804819C: .4byte 0x020241ea +_080481A0: .4byte 0x0202433c +_080481A4: .4byte 0x02024214 +_080481A8: .4byte 0x0202420b +_080481AC: + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, _080481C8 +_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 + .align 2, 0 +_080481C8: .4byte 0x0202420c +_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, _08048214 + 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, _08048218 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08048220 + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, _0804821C + b _08048228 + .align 2, 0 +_08048214: .4byte 0x0202433c +_08048218: .4byte 0x02024214 +_0804821C: .4byte 0x0202420b +_08048220: + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, _08048268 +_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, _0804826C + ands r0, r1 + mov r1, r12 + str r0, [r1] + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + ldr r1, _08048270 + 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 + .align 2, 0 +_08048268: .4byte 0x0202420c +_0804826C: .4byte 0xffefffff +_08048270: .4byte 0x020240ac +_08048274: + ldr r0, _080482AC + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _080482B0 + strb r0, [r1] + ldr r2, _080482B4 + 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, _080482B8 + str r0, [r1] +_0804829A: + ldr r1, _080482AC + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_080482A2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080482AC: .4byte 0x02024214 +_080482B0: .4byte 0x02024064 +_080482B4: .4byte 0x0202437c +_080482B8: .4byte 0x0000ffff + thumb_func_end atk0C_datahpupdate + + thumb_func_start atk0D_critmessage +atk0D_critmessage: @ 80482BC + push {lr} + ldr r0, _080482F8 + ldr r0, [r0] + cmp r0, 0 + bne _080482F2 + ldr r0, _080482FC + ldrb r0, [r0] + cmp r0, 0x2 + bne _080482EA + ldr r0, _08048300 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080482EA + ldr r0, _08048304 + ldrb r1, [r0] + movs r0, 0xD9 + bl b_std_message + ldr r1, _08048308 + movs r0, 0x1 + strb r0, [r1, 0x7] +_080482EA: + ldr r1, _0804830C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080482F2: + pop {r0} + bx r0 + .align 2, 0 +_080482F8: .4byte 0x02024068 +_080482FC: .4byte 0x02024211 +_08048300: .4byte 0x0202427c +_08048304: .4byte 0x0202420b +_08048308: .4byte 0x02024332 +_0804830C: .4byte 0x02024214 + thumb_func_end atk0D_critmessage + + thumb_func_start atk0E_missmessage +atk0E_missmessage: @ 8048310 + push {r4,lr} + ldr r0, _08048348 + ldr r0, [r0] + cmp r0, 0 + bne _080483D0 + ldr r4, _0804834C + ldr r0, _08048350 + ldrb r0, [r0] + strb r0, [r4] + ldr r1, _08048354 + 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 + .align 2, 0 +_08048348: .4byte 0x02024068 +_0804834C: .4byte 0x02024064 +_08048350: .4byte 0x0202420c +_08048354: .4byte 0x0202427c +_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, _080483AC + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _080483C8 + .align 2, 0 +_080483AC: .4byte 0x02024064 +_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, _080483D8 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_080483C8: + ldr r1, _080483DC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080483D0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080483D8: .4byte 0x02024064 +_080483DC: .4byte 0x02024214 + thumb_func_end atk0E_missmessage + + thumb_func_start atk0F_resultmessage +atk0F_resultmessage: @ 80483E0 + push {r4-r7,lr} + movs r3, 0 + ldr r0, _0804841C + ldr r0, [r0] + cmp r0, 0 + beq _080483EE + b _08048580 +_080483EE: + ldr r1, _08048420 + ldrb r2, [r1] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + adds r6, r1, 0 + ldr r7, _08048424 + 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, _08048428 + ldrb r0, [r7, 0x6] + lsls r0, 1 + adds r0, r1 + ldrh r3, [r0] + strb r4, [r7, 0x7] + b _0804856A + .align 2, 0 +_0804841C: .4byte 0x02024068 +_08048420: .4byte 0x0202427c +_08048424: .4byte 0x02024332 +_08048428: .4byte 0x085cc834 +_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, _080484A0 + ldr r2, _080484A4 + ldr r3, _080484A8 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + ldr r1, _080484AC + ldrb r0, [r3] + strb r0, [r1] + movs r0, 0x3F + ands r0, r5 + strb r0, [r6] + bl b_movescr_stack_push_cursor + ldr r1, _080484B0 + ldr r0, _080484B4 + b _0804857E + .align 2, 0 +_080484A0: .4byte 0x02024208 +_080484A4: .4byte 0x02024084 +_080484A8: .4byte 0x0202420c +_080484AC: .4byte 0x0202420f +_080484B0: .4byte 0x02024214 +_080484B4: .4byte 0x082db816 +_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, _080484E8 + ldr r0, _080484EC + b _0804857E + .align 2, 0 +_080484E8: .4byte 0x02024214 +_080484EC: .4byte 0x082db1ce +_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, _08048508 + ldr r0, _0804850C + b _0804857E + .align 2, 0 +_08048508: .4byte 0x02024214 +_0804850C: .4byte 0x082db1c7 +_08048510: + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + beq _08048558 + ldr r4, _08048540 + ldr r2, _08048544 + ldr r3, _08048548 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + ldr r1, _0804854C + ldrb r0, [r3] + strb r0, [r1] + movs r0, 0x3F + ands r0, r5 + strb r0, [r6] + bl b_movescr_stack_push_cursor + ldr r1, _08048550 + ldr r0, _08048554 + b _0804857E + .align 2, 0 +_08048540: .4byte 0x02024208 +_08048544: .4byte 0x02024084 +_08048548: .4byte 0x0202420c +_0804854C: .4byte 0x0202420f +_08048550: .4byte 0x02024214 +_08048554: .4byte 0x082db816 +_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, _08048588 + ldrb r1, [r1] + bl b_std_message +_08048578: + ldr r1, _0804858C + ldr r0, [r1] + adds r0, 0x1 +_0804857E: + str r0, [r1] +_08048580: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08048588: .4byte 0x0202420b +_0804858C: .4byte 0x02024214 + thumb_func_end atk0F_resultmessage + + thumb_func_start atk10_printstring +atk10_printstring: @ 8048590 + push {r4,lr} + ldr r0, _080485C0 + ldr r0, [r0] + cmp r0, 0 + bne _080485BA + ldr r4, _080485C4 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + ldrb r1, [r1, 0x2] + lsls r1, 8 + orrs r0, r1 + ldr r1, _080485C8 + ldrb r1, [r1] + bl b_std_message + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r1, _080485CC + movs r0, 0x1 + strb r0, [r1, 0x7] +_080485BA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080485C0: .4byte 0x02024068 +_080485C4: .4byte 0x02024214 +_080485C8: .4byte 0x0202420b +_080485CC: .4byte 0x02024332 + thumb_func_end atk10_printstring + + thumb_func_start atk11_printstring2 +atk11_printstring2: @ 80485D0 + push {r4,r5,lr} + ldr r5, _08048604 + ldr r0, _08048608 + ldrb r0, [r0] + strb r0, [r5] + ldr r4, _0804860C + 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, _08048610 + movs r0, 0x1 + strb r0, [r1, 0x7] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08048604: .4byte 0x02024064 +_08048608: .4byte 0x0202420b +_0804860C: .4byte 0x02024214 +_08048610: .4byte 0x02024332 + thumb_func_end atk11_printstring2 + + thumb_func_start atk12_waitmessage +atk12_waitmessage: @ 8048614 + push {r4-r6,lr} + ldr r0, _08048630 + ldr r4, [r0] + cmp r4, 0 + bne _08048662 + ldr r6, _08048634 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0804863C + ldr r1, _08048638 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] + b _08048662 + .align 2, 0 +_08048630: .4byte 0x02024068 +_08048634: .4byte 0x02024332 +_08048638: .4byte 0x02024214 +_0804863C: + ldr r5, _08048668 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r3, _0804866C + 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 + .align 2, 0 +_08048668: .4byte 0x02024214 +_0804866C: .4byte 0x0202432c + thumb_func_end atk12_waitmessage + + thumb_func_start atk13_printfromtable +atk13_printfromtable: @ 8048670 + push {r4,r5,lr} + ldr r0, _080486B4 + ldr r0, [r0] + cmp r0, 0 + bne _080486AE + ldr r4, _080486B8 + 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, _080486BC + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _080486C0 + 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 + .align 2, 0 +_080486B4: .4byte 0x02024068 +_080486B8: .4byte 0x02024214 +_080486BC: .4byte 0x02024332 +_080486C0: .4byte 0x0202420b + thumb_func_end atk13_printfromtable + + thumb_func_start atk14_printfromtable2 +atk14_printfromtable2: @ 80486C4 + push {r4-r6,lr} + ldr r0, _08048714 + ldr r0, [r0] + cmp r0, 0 + bne _0804870E + ldr r5, _08048718 + 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, _0804871C + ldrb r0, [r6, 0x5] + lsls r0, 1 + adds r1, r0 + ldr r4, _08048720 + ldr r0, _08048724 + 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 + .align 2, 0 +_08048714: .4byte 0x02024068 +_08048718: .4byte 0x02024214 +_0804871C: .4byte 0x02024332 +_08048720: .4byte 0x02024064 +_08048724: .4byte 0x0202420b + 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, _08048758 + ldrb r3, [r0] + cmp r1, r3 + bge _0804874E + ldr r4, _0804875C + 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 + .align 2, 0 +_08048758: .4byte 0x0202406c +_0804875C: .4byte 0x0202407e + 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, _080487A4 + ldrb r3, [r1, 0x3] + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + beq _080487B8 + ldr r2, _080487A8 + ldr r0, _080487AC + 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, _080487B0 + ldr r0, _080487B4 + b _080487C4 + .align 2, 0 +_080487A4: .4byte 0x02024332 +_080487A8: .4byte 0x0202420e +_080487AC: .4byte 0x0202420b +_080487B0: .4byte 0x02024474 +_080487B4: .4byte 0x0202420c +_080487B8: + ldr r2, _08048808 + ldr r0, _0804880C + ldrb r0, [r0] + strb r0, [r2] + ldr r1, _08048810 + ldr r0, _08048814 +_080487C4: + ldrb r0, [r0] + strb r0, [r1, 0x17] + mov r9, r2 + ldr r2, _08048818 + 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, _0804881C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + bne _08048828 + cmp r5, 0 + bne _08048828 + ldr r1, _08048820 + ldrb r0, [r1, 0x3] + cmp r0, 0x9 + bhi _08048828 + ldr r1, _08048824 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, _08048820 + strb r5, [r2, 0x3] + bl _080499B8 + .align 2, 0 +_08048808: .4byte 0x0202420e +_0804880C: .4byte 0x0202420c +_08048810: .4byte 0x02024474 +_08048814: .4byte 0x0202420b +_08048818: .4byte 0x02024084 +_0804881C: .4byte 0x02024280 +_08048820: .4byte 0x02024332 +_08048824: .4byte 0x02024214 +_08048828: + mov r3, r9 + ldrb r0, [r3] + bl battle_get_per_side_status + ldr r2, _08048870 + 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, _08048874 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + bne _08048880 + cmp r5, 0 + bne _08048880 + ldr r0, _08048878 + ldrb r1, [r0, 0x3] + cmp r1, 0x7 + bhi _08048880 + ldr r1, _0804887C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r4, _08048878 + strb r5, [r4, 0x3] + bl _080499B8 + .align 2, 0 +_08048870: .4byte 0x0202428e +_08048874: .4byte 0x02024280 +_08048878: .4byte 0x02024332 +_0804887C: .4byte 0x02024214 +_08048880: + ldr r3, _080488B4 + ldr r2, _080488B8 + 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, _080488BC + ldrb r0, [r1, 0x3] + cmp r0, 0xB + beq _080488C4 + cmp r0, 0x1F + beq _080488C4 + ldr r1, _080488C0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, _080488BC + strb r4, [r2, 0x3] + bl _080499B8 + .align 2, 0 +_080488B4: .4byte 0x02024084 +_080488B8: .4byte 0x0202420e +_080488BC: .4byte 0x02024332 +_080488C0: .4byte 0x02024214 +_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, _080488F4 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + movs r0, 0 + ldr r4, _080488F8 + strb r0, [r4, 0x3] + bl _080499B8 + .align 2, 0 +_080488F4: .4byte 0x02024214 +_080488F8: .4byte 0x02024332 +_080488FC: + ldr r1, _08048928 + ldrb r0, [r1, 0x3] + cmp r0, 0x6 + bls _08048906 + b _08048F40 +_08048906: + ldr r1, _0804892C + ldr r2, _08048928 + 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 + .align 2, 0 +_08048928: .4byte 0x02024332 +_0804892C: .4byte 0x0831c134 +_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, _080489A4 + movs r1, 0 + strb r1, [r0] + ldr r1, _080489A8 + 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 + .align 2, 0 +_080489A4: .4byte 0x02024064 +_080489A8: .4byte 0x0202406c +_080489AC: + ldr r0, _080489F8 + ldr r2, _080489FC + 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 + .align 2, 0 +_080489F8: .4byte 0x02024064 +_080489FC: .4byte 0x0202406c +_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, _08048A58 + strb r1, [r0] + mov r3, r9 + ldrb r0, [r3] + movs r1, 0x11 + bl b_history__record_ability_usage_of_player + ldr r4, _08048A5C + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08048A60 + str r0, [r4] + ldr r2, _08048A64 + 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, _08048A68 + strb r0, [r4, 0x5] +_08048A4C: + ldr r0, _08048A6C + ands r1, r0 + str r1, [r2] + bl _080499B2 + .align 2, 0 +_08048A58: .4byte 0x0202420a +_08048A5C: .4byte 0x02024214 +_08048A60: .4byte 0x082db5e9 +_08048A64: .4byte 0x02024280 +_08048A68: .4byte 0x02024332 +_08048A6C: .4byte 0xffffdfff +_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, _08048AF8 + 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 + .align 2, 0 +_08048AF8: .4byte 0x02024280 +_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, _08048B44 + strb r1, [r0] + mov r3, r9 + ldrb r0, [r3] + movs r1, 0x29 + bl b_history__record_ability_usage_of_player + ldr r4, _08048B48 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08048B4C + str r0, [r4] + ldr r2, _08048B50 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048B42 + b _08048A46 +_08048B42: + b _08048D20 + .align 2, 0 +_08048B44: .4byte 0x0202420a +_08048B48: .4byte 0x02024214 +_08048B4C: .4byte 0x082db5d1 +_08048B50: .4byte 0x02024280 +_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, _08048B98 + 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, _08048B9C + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08048BA0 + b _08048D72 + .align 2, 0 +_08048B98: .4byte 0x02024280 +_08048B9C: .4byte 0x02024214 +_08048BA0: .4byte 0x082db5d1 +_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, _08048C78 + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08048C26 + movs r2, 0 + str r2, [sp, 0x4] +_08048C26: + ldr r4, _08048C7C + ldr r0, _08048C80 + 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 + .align 2, 0 +_08048C78: .4byte 0x020243cc +_08048C7C: .4byte 0x02024084 +_08048C80: .4byte 0x0202420e +_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, _08048CD4 + strb r2, [r0] + mov r4, r9 + ldrb r0, [r4] + movs r1, 0x7 + bl b_history__record_ability_usage_of_player + ldr r4, _08048CD8 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08048CDC + str r0, [r4] + ldr r2, _08048CE0 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048CE8 + movs r0, 0x1 + ldr r3, _08048CE4 + strb r0, [r3, 0x5] + b _08048A4C + .align 2, 0 +_08048CD4: .4byte 0x0202420a +_08048CD8: .4byte 0x02024214 +_08048CDC: .4byte 0x082db5dd +_08048CE0: .4byte 0x02024280 +_08048CE4: .4byte 0x02024332 +_08048CE8: + ldr r4, _08048CF0 + strb r0, [r4, 0x5] + bl _080499B2 + .align 2, 0 +_08048CF0: .4byte 0x02024332 +_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, _08048D28 + strb r0, [r1, 0x5] + bl _080499B2 + .align 2, 0 +_08048D28: .4byte 0x02024332 +_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, _08048D84 + 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, _08048D88 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08048D8C +_08048D72: + str r0, [r4] + ldr r1, _08048D90 + movs r2, 0 + movs r0, 0x2 + strb r0, [r1, 0x5] + strb r2, [r1, 0x3] + bl _080499B8 + .align 2, 0 +_08048D84: .4byte 0x02024280 +_08048D88: .4byte 0x02024214 +_08048D8C: .4byte 0x082db5e9 +_08048D90: .4byte 0x02024332 +_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, _08048E38 + 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, _08048E3C + ldr r0, [r0] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _08048E40 + ldr r0, _08048E44 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + cmp r3, 0x7 + bne _08048E50 + bl GenerateRandomNumber + ldr r2, _08048E48 + ldr r1, _08048E4C + 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 + .align 2, 0 +_08048E38: .4byte 0x0202427c +_08048E3C: .4byte 0x02024214 +_08048E40: .4byte 0x0831c134 +_08048E44: .4byte 0x02024332 +_08048E48: .4byte 0x02024084 +_08048E4C: .4byte 0x0202420e +_08048E50: + ldr r2, _08048EB4 + ldr r0, _08048EB8 + 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, _08048EBC + ldr r1, _08048EC0 + ldr r5, _08048EC4 + ldrb r0, [r5, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r4, _08048EC8 + ldr r1, _08048EB8 + ldrb r0, [r1] + strb r0, [r4] + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + ldr r1, _08048ECC + 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, _08048ED0 + 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, _08048ED4 + ands r1, r0 + str r1, [r2] + b _08048EDA + .align 2, 0 +_08048EB4: .4byte 0x02024084 +_08048EB8: .4byte 0x0202420e +_08048EBC: .4byte 0x02024214 +_08048EC0: .4byte 0x0831c224 +_08048EC4: .4byte 0x02024332 +_08048EC8: .4byte 0x02024064 +_08048ECC: .4byte 0x020240d0 +_08048ED0: .4byte 0x02024280 +_08048ED4: .4byte 0xffffdfff +_08048ED8: + strb r0, [r5, 0x5] +_08048EDA: + ldr r0, _08048F10 + 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, _08048F14 + ldr r0, [r0] + adds r0, 0xB2 + ldr r2, _08048F10 + ldrb r1, [r2, 0x3] + strb r1, [r0] + ldr r2, _08048F18 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 7 + orrs r0, r1 + str r0, [r2] + bl _080499B8 + .align 2, 0 +_08048F10: .4byte 0x02024332 +_08048F14: .4byte 0x0202449c +_08048F18: .4byte 0x02024280 +_08048F1C: + mov r3, r10 + cmp r3, 0 + beq _08048F26 + bl _080499B8 +_08048F26: + ldr r0, _08048F38 + strb r3, [r0, 0x3] + ldr r1, _08048F3C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bl _080499B8 + .align 2, 0 +_08048F38: .4byte 0x02024332 +_08048F3C: .4byte 0x02024214 +_08048F40: + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, _08048F7C + ldr r0, _08048F80 + 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, _08048F84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08048F7C: .4byte 0x0831c134 +_08048F80: .4byte 0x02024332 +_08048F84: .4byte _08048F88 + .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, _080490C4 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _080490C8 + ldr r0, _080490CC + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _080499B0 + .align 2, 0 +_080490C4: .4byte 0x02024214 +_080490C8: .4byte 0x0831c224 +_080490CC: .4byte 0x02024332 +_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, _08049108 + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + movs r1, 0x27 + bl b_history__record_ability_usage_of_player + ldr r1, _0804910C + ldr r0, _08049110 + str r0, [r1] + bl _080499B2 + .align 2, 0 +_08049108: .4byte 0x0202420a +_0804910C: .4byte 0x02024214 +_08049110: .4byte 0x082db603 +_08049114: + adds r0, r2, 0 + bl sub_8048728 + ldr r1, _08049150 + 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, _08049154 + ldr r0, _08049158 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] + bl _08049994 + .align 2, 0 +_08049150: .4byte 0x02024082 +_08049154: .4byte 0x0831c134 +_08049158: .4byte 0x02024332 +_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, _080491C4 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, _080491C8 + 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, _080491CC + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _080491D0 + ldr r0, _080491D4 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _080499B0 + .align 2, 0 +_080491C4: .4byte 0x02024268 +_080491C8: .4byte 0x020241ea +_080491CC: .4byte 0x02024214 +_080491D0: .4byte 0x0831c224 +_080491D4: .4byte 0x02024332 +_080491D8: + ldr r5, _08049228 + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _08049210 + ldr r4, _0804922C + ldrh r3, [r4] + ldr r2, _08049230 + 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, _08049234 + adds r0, r3, 0 + strh r0, [r4] +_08049210: + ldr r4, _08049238 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _0804923C + ldr r0, _08049240 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .align 2, 0 +_08049228: .4byte 0x0202420b +_0804922C: .4byte 0x0202432e +_08049230: .4byte 0x02024084 +_08049234: .4byte 0x0000ffff +_08049238: .4byte 0x02024214 +_0804923C: .4byte 0x0831c224 +_08049240: .4byte 0x02024332 +_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, _08049278 + 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 + .align 2, 0 +_08049278: .4byte 0x02024332 +_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, _080492B8 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldr r1, _080492BC + ldrh r1, [r1] + strh r1, [r0] + ldr r0, _080492C0 + 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 + .align 2, 0 +_080492B8: .4byte 0x02024268 +_080492BC: .4byte 0x020241ea +_080492C0: .4byte 0x0202433c +_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, _08049374 + ldr r0, [r2] + lsls r1, 1 + adds r1, r0 + ldr r6, _08049378 + 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, _0804937C + ldrb r0, [r0] + strb r0, [r1, 0x14] + ldr r4, _08049380 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _08049384 + ldr r2, _08049388 + ldrb r0, [r2, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4] + strb r5, [r2, 0x5] + ldr r3, _0804938C + 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 + .align 2, 0 +_08049374: .4byte 0x0202449c +_08049378: .4byte 0x020241ea +_0804937C: .4byte 0x0202420b +_08049380: .4byte 0x02024214 +_08049384: .4byte 0x0831c224 +_08049388: .4byte 0x02024332 +_0804938C: .4byte 0x085cc982 +_08049390: + ldr r1, _080493C0 + ldr r0, _080493C4 + 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, _080493C8 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _080493CC + ldr r0, _080493D0 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .align 2, 0 +_080493C0: .4byte 0x020241f0 +_080493C4: .4byte 0x020241f4 +_080493C8: .4byte 0x02024214 +_080493CC: .4byte 0x0831c224 +_080493D0: .4byte 0x02024332 +_080493D4: + ldr r4, _0804940C + 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, _08049410 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, _08049414 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08049418 + b _080499B0 + .align 2, 0 +_0804940C: .4byte 0x02024332 +_08049410: .4byte 0x02024474 +_08049414: .4byte 0x02024214 +_08049418: .4byte 0x082d8cd4 +_0804941C: + movs r0, 0x70 + negs r0, r0 + ldr r4, _08049458 + 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, _0804945C + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, _08049460 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08049464 + b _080499B0 + .align 2, 0 +_08049458: .4byte 0x02024332 +_0804945C: .4byte 0x02024474 +_08049460: .4byte 0x02024214 +_08049464: .4byte 0x082d8d65 +_08049468: + ldr r4, _080494A0 + 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, _080494A4 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, _080494A8 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _080494AC + b _080499B0 + .align 2, 0 +_080494A0: .4byte 0x02024332 +_080494A4: .4byte 0x02024474 +_080494A8: .4byte 0x02024214 +_080494AC: .4byte 0x082d8cd4 +_080494B0: + movs r0, 0x60 + negs r0, r0 + ldr r4, _080494EC + 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, _080494F0 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, _080494F4 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _080494F8 + b _080499B0 + .align 2, 0 +_080494EC: .4byte 0x02024332 +_080494F0: .4byte 0x02024474 +_080494F4: .4byte 0x02024214 +_080494F8: .4byte 0x082d8d65 +_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, _08049538 + 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, _0804953C + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, _08049540 + ldrh r1, [r1] + strh r1, [r0] + b _08049994 + .align 2, 0 +_08049538: .4byte 0x020242bc +_0804953C: .4byte 0x02024268 +_08049540: .4byte 0x020241ea +_08049544: + ldr r0, _08049560 + 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 + .align 2, 0 +_08049560: .4byte 0x0202420b +_08049564: + ldr r5, _0804959C + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _08049574 + b _08049994 +_08049574: + ldr r6, _080495A0 + 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, _080495A4 + ands r0, r1 + cmp r0, 0 + bne _080495D4 + b _08049994 + .align 2, 0 +_0804959C: .4byte 0x02022fec +_080495A0: .4byte 0x0202420b +_080495A4: .4byte 0x0a3f0902 +_080495A8: + ldr r0, [r5] + ldr r1, _08049618 + ands r0, r1 + cmp r0, 0 + bne _080495D4 + ldr r0, _0804961C + adds r0, 0x29 + adds r0, r4, r0 + ldrb r1, [r0] + ldr r3, _08049620 + ldr r2, _08049624 + 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, _08049628 + ldr r1, _0804962C + 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, _08049630 + ldr r0, _08049634 + str r0, [r1] + ldr r1, _08049638 + 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 + .align 2, 0 +_08049618: .4byte 0x0a3f0902 +_0804961C: .4byte 0x020243d0 +_08049620: .4byte 0x0832a328 +_08049624: .4byte 0x0202406e +_08049628: .4byte 0x02024084 +_0804962C: .4byte 0x0202420c +_08049630: .4byte 0x02024214 +_08049634: .4byte 0x082db682 +_08049638: .4byte 0x0202420a +_0804963C: + ldr r4, _08049708 + 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, _0804970C + lsls r0, r2, 1 + adds r0, 0xD0 + ldr r1, [r5] + adds r1, r0 + ldr r2, _08049710 + 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, _08049714 + 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, _08049718 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _0804971C + 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 + .align 2, 0 +_08049708: .4byte 0x0202420b +_0804970C: .4byte 0x0202449c +_08049710: .4byte 0x02024208 +_08049714: .4byte 0x02024064 +_08049718: .4byte 0x02024214 +_0804971C: .4byte 0x082db422 +_08049720: + ldr r3, _08049750 + 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, _08049754 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _08049758 + ldrb r1, [r1] + strb r1, [r0, 0x14] + b _08049994 + .align 2, 0 +_08049750: .4byte 0x0202420c +_08049754: .4byte 0x020242bc +_08049758: .4byte 0x0202420b +_0804975C: + ldr r0, _08049774 + 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 + .align 2, 0 +_08049774: .4byte 0x0202420c +_08049778: + ldr r4, _08049788 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _0804978C + b _080499B0 + .align 2, 0 +_08049788: .4byte 0x02024214 +_0804978C: .4byte 0x082daf27 +_08049790: + ldr r4, _080497A0 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _080497A4 + b _080499B0 + .align 2, 0 +_080497A0: .4byte 0x02024214 +_080497A4: .4byte 0x082dafc3 +_080497A8: + ldr r6, _080497F8 + 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, _080497FC + 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, _08049800 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _08049804 + b _080499B0 + .align 2, 0 +_080497F8: .4byte 0x0202420c +_080497FC: .4byte 0x02024064 +_08049800: .4byte 0x02024214 +_08049804: .4byte 0x082db361 +_08049808: + ldr r4, _08049818 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _0804981C + b _080499B0 + .align 2, 0 +_08049818: .4byte 0x02024214 +_0804981C: .4byte 0x082db117 +_08049820: + ldr r4, _08049850 + ldr r0, _08049854 + 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, _08049858 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, _0804985C + ldr r0, _08049860 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .align 2, 0 +_08049850: .4byte 0x020241f0 +_08049854: .4byte 0x020241f4 +_08049858: .4byte 0x02024214 +_0804985C: .4byte 0x0831c224 +_08049860: .4byte 0x02024332 +_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, _080498B8 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldr r1, _080498BC + 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 + .align 2, 0 +_080498B8: .4byte 0x02024268 +_080498BC: .4byte 0x020241ea +_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, _080498F4 + strb r2, [r0] + ldr r1, _080498F8 + ldr r0, _080498FC + str r0, [r1] + ldrb r0, [r4] + movs r1, 0x3C + bl b_history__record_ability_usage_of_player + b _080499B2 + .align 2, 0 +_080498F4: .4byte 0x0202420a +_080498F8: .4byte 0x02024214 +_080498FC: .4byte 0x082db63f +_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, _08049978 + 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, _0804997C + adds r2, 0x29 + adds r2, r4, r2 + ldr r3, _08049980 + ldr r1, _08049984 + 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, _08049988 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _0804998C + str r0, [r4] + mov r1, r9 + ldrb r0, [r1] + ldr r2, _08049990 + 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 + .align 2, 0 +_08049978: .4byte 0x02024208 +_0804997C: .4byte 0x020243d0 +_08049980: .4byte 0x0832a328 +_08049984: .4byte 0x0202406e +_08049988: .4byte 0x02024214 +_0804998C: .4byte 0x082db168 +_08049990: .4byte 0x0202449c +_08049994: + ldr r1, _080499A0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _080499B2 + .align 2, 0 +_080499A0: .4byte 0x02024214 +_080499A4: + ldr r4, _080499C8 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _080499CC +_080499B0: + str r0, [r4] +_080499B2: + ldr r1, _080499D0 + 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 + .align 2, 0 +_080499C8: .4byte 0x02024214 +_080499CC: .4byte 0x082db1d5 +_080499D0: .4byte 0x02024332 + thumb_func_end sub_8048760 + + thumb_func_start atk15_seteffectwithchancetarget +atk15_seteffectwithchancetarget: @ 80499D4 + push {r4,lr} + ldr r2, _08049A00 + ldr r0, _08049A04 + 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, _08049A08 + ldr r0, _08049A0C + 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 + .align 2, 0 +_08049A00: .4byte 0x02024084 +_08049A04: .4byte 0x0202420b +_08049A08: .4byte 0x0831c898 +_08049A0C: .4byte 0x020241ea +_08049A10: + ldr r2, _08049A40 + ldr r0, _08049A44 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x5] +_08049A20: + ldr r3, _08049A48 + ldrb r2, [r3, 0x3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08049A50 + ldr r0, _08049A4C + 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 + .align 2, 0 +_08049A40: .4byte 0x0831c898 +_08049A44: .4byte 0x020241ea +_08049A48: .4byte 0x02024332 +_08049A4C: .4byte 0x0202427c +_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, _08049A88 + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _08049A9A + ldr r0, _08049A8C + 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 + .align 2, 0 +_08049A88: .4byte 0x02024332 +_08049A8C: .4byte 0x0202427c +_08049A90: + movs r0, 0 + movs r1, 0 + bl sub_8048760 + b _08049AA2 +_08049A9A: + ldr r1, _08049AB4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08049AA2: + ldr r0, _08049AB8 + movs r1, 0 + strb r1, [r0, 0x3] + ldr r0, _08049ABC + strb r1, [r0, 0x16] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08049AB4: .4byte 0x02024214 +_08049AB8: .4byte 0x02024332 +_08049ABC: .4byte 0x02024474 + 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, _08049B04 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, _08049B08 + strb r0, [r2] + ldr r3, _08049B0C + ldrb r0, [r3, 0x3] + cmp r0, 0x6 + bhi _08049B14 + ldr r1, _08049B10 + ldrb r2, [r2] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x4C + b _08049B1E + .align 2, 0 +_08049B04: .4byte 0x02024214 +_08049B08: .4byte 0x02024064 +_08049B0C: .4byte 0x02024332 +_08049B10: .4byte 0x02024084 +_08049B14: + ldr r1, _08049B48 + ldrb r2, [r2] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 +_08049B1E: + adds r2, r1 + ldr r1, _08049B4C + ldrb r0, [r3, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + ldr r0, _08049B50 + movs r2, 0 + strb r2, [r0, 0x3] + ldr r1, _08049B54 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + ldr r0, _08049B58 + strb r2, [r0, 0x16] + pop {r0} + bx r0 + .align 2, 0 +_08049B48: .4byte 0x02024084 +_08049B4C: .4byte 0x0831c134 +_08049B50: .4byte 0x02024332 +_08049B54: .4byte 0x02024214 +_08049B58: .4byte 0x02024474 + 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, _08049BC8 + 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, _08049BCC + strb r0, [r5] + ldr r2, _08049BD0 + ldr r1, _08049BD4 + 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, _08049BD8 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r2, [r0] + ldr r1, _08049BDC + ands r1, r2 + strh r1, [r0] + b _08049E32 + .align 2, 0 +_08049BC8: .4byte 0x02024214 +_08049BCC: .4byte 0x02024064 +_08049BD0: .4byte 0x02024280 +_08049BD4: .4byte 0x0832a328 +_08049BD8: .4byte 0x0202428e +_08049BDC: .4byte 0x0000fdff +_08049BE0: + ldrb r0, [r2, 0x1] + cmp r0, 0x1 + bne _08049C08 + ldr r1, _08049BF8 + ldr r0, _08049BFC + ldrb r0, [r0] + strb r0, [r1] + ldr r0, _08049C00 + ldrb r0, [r0] + mov r9, r0 + ldr r4, _08049C04 + b _08049C18 + .align 2, 0 +_08049BF8: .4byte 0x02024064 +_08049BFC: .4byte 0x0202420b +_08049C00: .4byte 0x0202420c +_08049C04: .4byte 0x082da7aa +_08049C08: + ldr r1, _08049C80 + ldr r0, _08049C84 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, _08049C88 + ldrb r0, [r0] + mov r9, r0 + ldr r4, _08049C8C +_08049C18: + mov r8, r1 + ldr r0, _08049C90 + ldrb r1, [r0] + ldr r2, _08049C94 + 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, _08049C98 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049C42 + b _08049E2C +_08049C42: + ldr r5, _08049C9C + 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, _08049CA0 + ldrb r0, [r1] + cmp r0, 0xFE + bhi _08049C78 + adds r0, 0x1 + strb r0, [r1] +_08049C78: + ldrb r0, [r7] + bl sub_80570F4 + b _08049CCE + .align 2, 0 +_08049C80: .4byte 0x02024064 +_08049C84: .4byte 0x0202420c +_08049C88: .4byte 0x0202420b +_08049C8C: .4byte 0x082da7b7 +_08049C90: .4byte 0x02024210 +_08049C94: .4byte 0x0832a328 +_08049C98: .4byte 0x02024084 +_08049C9C: .4byte 0x02024280 +_08049CA0: .4byte 0x03005d10 +_08049CA4: + ldr r4, _08049DEC + ldrb r0, [r4, 0x1] + cmp r0, 0xFE + bhi _08049CB0 + adds r0, 0x1 + strb r0, [r4, 0x1] +_08049CB0: + ldr r1, _08049DF0 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08049DF4 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x20] +_08049CCE: + ldr r2, _08049DF8 + ldr r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08049D0C + ldr r6, _08049DFC + ldr r0, _08049E00 + 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, _08049E04 + ldr r0, [r4] + bl b_movescr_stack_push + ldr r1, _08049E08 + mov r0, r9 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x28] + str r0, [r1] + ldr r0, _08049E0C + str r0, [r4] +_08049D0C: + ldr r1, _08049E10 + ldr r6, _08049E14 + 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, _08049DF8 + ldr r5, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r5, r0 + cmp r5, 0 + beq _08049D34 + b _08049E32 +_08049D34: + ldr r3, _08049E00 + 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, _08049DFC + 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, _08049E18 + ldrh r0, [r0] + cmp r0, 0xA5 + beq _08049E32 + ldr r0, _08049E1C + 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, _08049E04 + ldr r0, [r5] + bl b_movescr_stack_push + ldr r0, _08049E20 + str r0, [r5] + ldr r5, _08049E24 + 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, _08049E28 + 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 + .align 2, 0 +_08049DEC: .4byte 0x03005d10 +_08049DF0: .4byte 0x0202406e +_08049DF4: .4byte 0x02024744 +_08049DF8: .4byte 0x02024280 +_08049DFC: .4byte 0x02024084 +_08049E00: .4byte 0x0202420b +_08049E04: .4byte 0x02024214 +_08049E08: .4byte 0x020241f0 +_08049E0C: .4byte 0x082dae3e +_08049E10: .4byte 0x020242ac +_08049E14: .4byte 0x0202420c +_08049E18: .4byte 0x020241ea +_08049E1C: .4byte 0x0202449c +_08049E20: .4byte 0x082db18d +_08049E24: .4byte 0x02024064 +_08049E28: .4byte 0x02022f58 +_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, _08049E70 + ldr r0, [r0] + cmp r0, 0 + bne _08049E6A + ldr r5, _08049E74 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _08049E78 + 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 + .align 2, 0 +_08049E70: .4byte 0x02024068 +_08049E74: .4byte 0x02024214 +_08049E78: .4byte 0x02024064 + thumb_func_end sub_8049E40 + + thumb_func_start sub_8049E7C +sub_8049E7C: @ 8049E7C + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _08049EF0 + ldr r5, [r0] + cmp r5, 0 + bne _08049EE8 + ldr r0, _08049EF4 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _08049EF8 + strb r0, [r4] + ldr r0, _08049EFC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08049EB4 + ldr r2, _08049F00 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08049EDC +_08049EB4: + ldr r1, _08049F00 + 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, _08049EF4 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08049EE8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08049EF0: .4byte 0x02024068 +_08049EF4: .4byte 0x02024214 +_08049EF8: .4byte 0x02024064 +_08049EFC: .4byte 0x02022fec +_08049F00: .4byte 0x02024084 + thumb_func_end sub_8049E7C + + thumb_func_start atk1C_jumpifstatus +atk1C_jumpifstatus: @ 8049F04 + push {r4,r5,lr} + ldr r5, _08049F60 + 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, _08049F64 + 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 + .align 2, 0 +_08049F60: .4byte 0x02024214 +_08049F64: .4byte 0x02024084 +_08049F68: + ldr r1, _08049F78 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08049F70: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08049F78: .4byte 0x02024214 + thumb_func_end atk1C_jumpifstatus + + thumb_func_start atk1D_jumpifsecondarystatus +atk1D_jumpifsecondarystatus: @ 8049F7C + push {r4,r5,lr} + ldr r5, _08049FD8 + 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, _08049FDC + 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 + .align 2, 0 +_08049FD8: .4byte 0x02024214 +_08049FDC: .4byte 0x02024084 +_08049FE0: + ldr r1, _08049FF0 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08049FE8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08049FF0: .4byte 0x02024214 + 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, _0804A048 + 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, _0804A04C + 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, _0804A050 + strb r5, [r1] + str r7, [r6] + subs r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + ldrb r1, [r1] + b _0804A0B0 + .align 2, 0 +_0804A048: .4byte 0x02024214 +_0804A04C: .4byte 0x0202420b +_0804A050: .4byte 0x0202420a +_0804A054: + cmp r0, 0x9 + bne _0804A08C + ldr r0, _0804A084 + 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, _0804A088 + strb r5, [r1] + str r7, [r6] + subs r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + ldrb r1, [r1] + b _0804A0B0 + .align 2, 0 +_0804A084: .4byte 0x0202420b +_0804A088: .4byte 0x0202420a +_0804A08C: + ldrb r0, [r2, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0804A0BC + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, r8 + bne _0804A0C8 + ldr r0, _0804A0C0 + strb r1, [r0] + str r7, [r6] + ldrb r1, [r0] + adds r0, r4, 0 +_0804A0B0: + bl b_history__record_ability_usage_of_player + ldr r0, _0804A0C4 + strb r4, [r0, 0x15] + b _0804A0CE + .align 2, 0 +_0804A0BC: .4byte 0x02024084 +_0804A0C0: .4byte 0x0202420a +_0804A0C4: .4byte 0x02024474 +_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, _0804A0F4 + ldr r0, [r0] + ldrb r4, [r0, 0x1] + cmp r4, 0x1 + bne _0804A0FC + ldr r0, _0804A0F8 + ldrb r0, [r0] + bl battle_get_per_side_status + b _0804A106 + .align 2, 0 +_0804A0F4: .4byte 0x02024214 +_0804A0F8: .4byte 0x0202420b +_0804A0FC: + ldr r0, _0804A13C + ldrb r0, [r0] + bl battle_get_per_side_status + movs r4, 0x1 +_0804A106: + ands r4, r0 + ldr r6, _0804A140 + 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, _0804A144 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0804A148 + str r5, [r6] + b _0804A14E + .align 2, 0 +_0804A13C: .4byte 0x0202420c +_0804A140: .4byte 0x02024214 +_0804A144: .4byte 0x0202428e +_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, _0804A188 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0804A18C + 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, _0804A190 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804A188: .4byte 0x02024214 +_0804A18C: .4byte 0x02024084 +_0804A190: .4byte _0804A194 + .align 2, 0 +_0804A194: + .4byte _0804A1AC + .4byte _0804A1BC + .4byte _0804A1CC + .4byte _0804A1DC + .4byte _0804A1EC + .4byte _0804A200 +_0804A1AC: + ldr r0, _0804A1B8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bne _0804A212 + b _0804A20C + .align 2, 0 +_0804A1B8: .4byte 0x02024214 +_0804A1BC: + ldr r0, _0804A1C8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + beq _0804A212 + b _0804A20C + .align 2, 0 +_0804A1C8: .4byte 0x02024214 +_0804A1CC: + ldr r0, _0804A1D8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bls _0804A212 + b _0804A20C + .align 2, 0 +_0804A1D8: .4byte 0x02024214 +_0804A1DC: + ldr r0, _0804A1E8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcs _0804A212 + b _0804A20C + .align 2, 0 +_0804A1E8: .4byte 0x02024214 +_0804A1EC: + ldr r0, _0804A1FC + ldr r0, [r0] + ldrb r0, [r0, 0x4] + ands r2, r0 + cmp r2, 0 + beq _0804A212 + b _0804A20C + .align 2, 0 +_0804A1FC: .4byte 0x02024214 +_0804A200: + ldr r0, _0804A234 + 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, _0804A234 + 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 + .align 2, 0 +_0804A234: .4byte 0x02024214 +_0804A238: + ldr r1, _0804A248 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] +_0804A240: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0804A248: .4byte 0x02024214 + thumb_func_end sub_804A154 + + thumb_func_start atk21_jumpifspecialstatusflag +atk21_jumpifspecialstatusflag: @ 804A24C + push {r4-r6,lr} + ldr r4, _0804A2A0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, _0804A2A4 + 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, _0804A2A8 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + ands r0, r6 + cmp r0, 0 + bne _0804A2C4 + b _0804A2BC + .align 2, 0 +_0804A2A0: .4byte 0x02024214 +_0804A2A4: .4byte 0x02024064 +_0804A2A8: .4byte 0x020242ac +_0804A2AC: + ldr r0, _0804A2C0 + 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 + .align 2, 0 +_0804A2C0: .4byte 0x020242ac +_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, _0804A318 + 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, _0804A31C + 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 + .align 2, 0 +_0804A318: .4byte 0x02024214 +_0804A31C: .4byte 0x02024084 +_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, _0804A374 + ldr r0, [r0] + adds r0, 0x50 + mov r9, r0 + ldr r0, _0804A378 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _0804A37C + strb r0, [r1] + ldr r2, _0804A380 + movs r1, 0x2 + ands r1, r0 + lsls r1, 24 + lsrs r1, 25 + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r0, _0804A384 + ldrb r0, [r0, 0x1C] + cmp r0, 0x6 + bls _0804A368 + bl _0804ACB2 +_0804A368: + lsls r0, 2 + ldr r1, _0804A388 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804A374: .4byte 0x0202449c +_0804A378: .4byte 0x02024214 +_0804A37C: .4byte 0x0202420d +_0804A380: .4byte 0x020243fe +_0804A384: .4byte 0x02024474 +_0804A388: .4byte _0804A38C + .align 2, 0 +_0804A38C: + .4byte _0804A3A8 + .4byte _0804A414 + .4byte _0804A52E + .4byte _0804A850 + .4byte _0804A954 + .4byte _0804AC40 + .4byte _0804AC88 +_0804A3A8: + ldr r4, _0804A3F8 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0804A3BC + bl _0804AC7C +_0804A3BC: + ldr r0, _0804A3FC + ldr r0, [r0] + ldr r1, _0804A400 + ands r0, r1 + cmp r0, 0 + beq _0804A3CC + bl _0804AC7C +_0804A3CC: + ldr r1, _0804A404 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + strb r0, [r1, 0x1C] + ldr r0, _0804A408 + ldr r2, [r0] + adds r2, 0xDF + ldr r3, _0804A40C + ldr r1, _0804A410 + 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 + .align 2, 0 +_0804A3F8: .4byte 0x0202420d +_0804A3FC: .4byte 0x02022fec +_0804A400: .4byte 0x063f0982 +_0804A404: .4byte 0x02024474 +_0804A408: .4byte 0x0202449c +_0804A40C: .4byte 0x0832a328 +_0804A410: .4byte 0x0202406e +_0804A414: + movs r5, 0 + movs r7, 0 +_0804A418: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _0804A468 + 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, _0804A46C + 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, _0804A470 + ldr r0, [r0] + ldr r2, _0804A474 + adds r0, r2 + ldrb r4, [r0] + b _0804A480 + .align 2, 0 +_0804A468: .4byte 0x020244ec +_0804A46C: .4byte 0x0832a328 +_0804A470: .4byte 0x03005d8c +_0804A474: .4byte 0x00003226 +_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, _0804A4EC + ldr r2, _0804A4F0 + ldr r0, _0804A4F4 + 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, _0804A4F8 + 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 + .align 2, 0 +_0804A4EC: .4byte 0x083203cc +_0804A4F0: .4byte 0x02024084 +_0804A4F4: .4byte 0x0202420d +_0804A4F8: .4byte 0x02024402 +_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, _0804A560 + strh r6, [r0] +_0804A516: + ldr r1, _0804A564 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1, 0x1C] + ldr r1, _0804A568 + ldr r0, [r1] + strb r2, [r0, 0x10] + ldr r0, [r1] + adds r0, 0x53 + mov r4, r8 + strb r4, [r0] +_0804A52E: + ldr r0, _0804A56C + ldr r0, [r0] + cmp r0, 0 + beq _0804A538 + b _0804ACB2 +_0804A538: + ldr r0, _0804A568 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804A570 + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0804A57C + ldr r0, _0804A574 + ldr r0, [r0] + ldr r1, _0804A578 + adds r0, r1 + ldrb r4, [r0] + b _0804A584 + .align 2, 0 +_0804A560: .4byte 0x02024402 +_0804A564: .4byte 0x02024474 +_0804A568: .4byte 0x0202449c +_0804A56C: .4byte 0x02024068 +_0804A570: .4byte 0x020244ec +_0804A574: .4byte 0x03005d8c +_0804A578: .4byte 0x00003226 +_0804A57C: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0804A584: + ldr r5, _0804A5A4 + 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, _0804A5A8 + b _0804A5D0 + .align 2, 0 +_0804A5A4: .4byte 0x0202449c +_0804A5A8: .4byte 0x02024474 +_0804A5AC: + ldr r0, [r5] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804A5DC + 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, _0804A5E0 + movs r2, 0 +_0804A5D0: + movs r0, 0x5 + strb r0, [r1, 0x1C] + ldr r0, _0804A5E4 + str r2, [r0] + b _0804ACB2 + .align 2, 0 +_0804A5DC: .4byte 0x020244ec +_0804A5E0: .4byte 0x02024474 +_0804A5E4: .4byte 0x020241f0 +_0804A5E8: + ldr r0, _0804A64C + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0804A616 + ldr r0, _0804A650 + 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, _0804A654 + bl song_play_for_text + ldr r1, [r5] + ldrb r0, [r1, 0x12] + adds r0, 0x1 + strb r0, [r1, 0x12] +_0804A616: + ldr r5, _0804A658 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804A65C + 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, _0804A660 + mov r2, r9 + ldrh r0, [r2] + str r0, [r1] + mov r9, r1 + b _0804A66A + .align 2, 0 +_0804A64C: .4byte 0x02022fec +_0804A650: .4byte 0x02024084 +_0804A654: .4byte 0x00000161 +_0804A658: .4byte 0x0202449c +_0804A65C: .4byte 0x020244ec +_0804A660: .4byte 0x020241f0 +_0804A664: + ldr r0, _0804A6E0 + str r3, [r0] + mov r9, r0 +_0804A66A: + cmp r4, 0x19 + bne _0804A67A + ldr r0, _0804A6E4 + 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, _0804A6E8 + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804A6AA + ldr r4, _0804A6E0 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] +_0804A6AA: + ldr r4, _0804A6EC + ldr r0, [r4] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804A6F0 + 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, _0804A6F4 + ldr r0, _0804A6E0 + mov r9, r0 + b _0804A71A + .align 2, 0 +_0804A6E0: .4byte 0x020241f0 +_0804A6E4: .4byte 0x02024402 +_0804A6E8: .4byte 0x02022fec +_0804A6EC: .4byte 0x0202449c +_0804A6F0: .4byte 0x020244ec +_0804A6F4: .4byte 0x00000149 +_0804A6F8: + ldr r4, _0804A710 + 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 + .align 2, 0 +_0804A710: .4byte 0x020241f0 +_0804A714: + ldr r7, _0804A750 + ldr r1, _0804A754 + mov r9, r1 +_0804A71A: + ldr r0, _0804A758 + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0804A786 + ldr r0, _0804A75C + ldr r1, _0804A760 + ldr r4, [r1] + ldrh r0, [r0, 0x4] + adds r5, r1, 0 + ldr r3, _0804A764 + ldr r2, _0804A768 + 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 + .align 2, 0 +_0804A750: .4byte 0x00000149 +_0804A754: .4byte 0x020241f0 +_0804A758: .4byte 0x02022fec +_0804A75C: .4byte 0x0202406e +_0804A760: .4byte 0x0202449c +_0804A764: .4byte 0x0832a328 +_0804A768: .4byte 0x02024210 +_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, _0804A834 + ldr r0, [r0] + adds r0, 0x8F +_0804A78C: + strb r1, [r0] +_0804A78E: + ldr r1, _0804A838 + movs r2, 0 + mov r12, r2 + movs r3, 0xFD + strb r3, [r1] + movs r5, 0x4 + strb r5, [r1, 0x1] + ldr r6, _0804A834 + 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, _0804A83C + 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, _0804A840 + 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, _0804A844 + adds r0, r1 + ldr r3, _0804A848 + ldr r1, _0804A84C + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r1, [r1] + bl sub_806DADC +_0804A824: + ldr r0, _0804A834 + ldr r1, [r0] + adds r1, 0x53 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + b _0804A92A + .align 2, 0 +_0804A834: .4byte 0x0202449c +_0804A838: .4byte 0x02022f58 +_0804A83C: .4byte 0x02022f68 +_0804A840: .4byte 0x02022f78 +_0804A844: .4byte 0x020244ec +_0804A848: .4byte 0x02024084 +_0804A84C: .4byte 0x0202420d +_0804A850: + ldr r0, _0804A934 + ldr r2, [r0] + cmp r2, 0 + beq _0804A85A + b _0804ACB2 +_0804A85A: + ldr r1, _0804A938 + ldr r7, _0804A93C + 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, _0804A940 + 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, _0804A944 + 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, _0804A948 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x8F + ldrb r0, [r0] + strb r0, [r4] + ldrb r1, [r1, 0x10] + ldr r0, _0804A94C + 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, _0804A950 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + strb r0, [r1, 0x1C] + b _0804ACB2 + .align 2, 0 +_0804A934: .4byte 0x02024068 +_0804A938: .4byte 0x02023864 +_0804A93C: .4byte 0x0202449c +_0804A940: .4byte 0x020244ec +_0804A944: .4byte 0x020244a8 +_0804A948: .4byte 0x02024064 +_0804A94C: .4byte 0x020241f0 +_0804A950: .4byte 0x02024474 +_0804A954: + ldr r0, _0804ABEC + ldr r0, [r0] + cmp r0, 0 + beq _0804A95E + b _0804ACB2 +_0804A95E: + ldr r1, _0804ABF0 + ldr r0, _0804ABF4 + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x8F + ldrb r0, [r0] + strb r0, [r1] + ldr r3, _0804ABF8 + 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, _0804ABFC + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804A9B2 + ldr r0, _0804AC00 + 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, _0804AC04 + adds r0, r1 + adds r1, r2, 0 + bl sub_805E990 +_0804A9B2: + ldr r1, _0804AC08 + movs r3, 0xFD + strb r3, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r6, _0804ABF0 + ldrb r0, [r6] + strb r0, [r1, 0x2] + ldr r4, _0804ABF4 + mov r9, r4 + ldr r2, [r4] + ldrb r0, [r2, 0x10] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r4, _0804AC0C + 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, _0804AC04 + 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, _0804AC10 + ldr r1, _0804AC14 + 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, _0804AC18 + ldr r0, _0804AC1C + str r0, [r1] + ldr r4, _0804AC20 + ldr r2, _0804ABF8 + 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, _0804AC00 + mov r2, r9 + ldr r0, [r2] + ldrb r2, [r0, 0x10] + ldrh r0, [r1] + cmp r0, r2 + bne _0804AB1E + ldr r4, _0804AC24 + 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, _0804AC00 + ldr r7, _0804ABF4 + ldr r1, [r7] + ldrb r2, [r1, 0x10] + ldrh r0, [r0, 0x4] + cmp r0, r2 + beq _0804AB2E + b _0804AC2E +_0804AB2E: + ldr r6, _0804AC24 + movs r4, 0xD8 + adds r4, r6 + mov r8, r4 + ldrh r0, [r4] + cmp r0, 0 + beq _0804AC2E + ldr r0, _0804ABFC + 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, _0804AC04 + 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 + .align 2, 0 +_0804ABEC: .4byte 0x02024068 +_0804ABF0: .4byte 0x02024064 +_0804ABF4: .4byte 0x0202449c +_0804ABF8: .4byte 0x02023864 +_0804ABFC: .4byte 0x02022fec +_0804AC00: .4byte 0x0202406e +_0804AC04: .4byte 0x020244ec +_0804AC08: .4byte 0x02022f58 +_0804AC0C: .4byte 0x02022f68 +_0804AC10: .4byte 0x03005d54 +_0804AC14: .4byte 0x0832a328 +_0804AC18: .4byte 0x02024214 +_0804AC1C: .4byte 0x082dabbd +_0804AC20: .4byte 0x020241f0 +_0804AC24: .4byte 0x02024084 +_0804AC28: + ldr r1, _0804AC38 + movs r0, 0 + str r0, [r1] +_0804AC2E: + ldr r1, _0804AC3C + movs r0, 0x5 + strb r0, [r1, 0x1C] + b _0804ACB2 + .align 2, 0 +_0804AC38: .4byte 0x020241f0 +_0804AC3C: .4byte 0x02024474 +_0804AC40: + ldr r0, _0804AC50 + ldr r0, [r0] + cmp r0, 0 + beq _0804AC58 + ldr r1, _0804AC54 + movs r0, 0x3 + strb r0, [r1, 0x1C] + b _0804ACB2 + .align 2, 0 +_0804AC50: .4byte 0x020241f0 +_0804AC54: .4byte 0x02024474 +_0804AC58: + ldr r2, _0804AC74 + 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, _0804AC78 + movs r0, 0x2 + strb r0, [r1, 0x1C] + b _0804ACB2 + .align 2, 0 +_0804AC74: .4byte 0x0202449c +_0804AC78: .4byte 0x02024474 +_0804AC7C: + ldr r1, _0804AC84 + movs r0, 0x6 + strb r0, [r1, 0x1C] + b _0804ACB2 + .align 2, 0 +_0804AC84: .4byte 0x02024474 +_0804AC88: + ldr r0, _0804ACC0 + ldr r5, [r0] + cmp r5, 0 + bne _0804ACB2 + ldr r4, _0804ACC4 + ldr r2, _0804ACC8 + 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, _0804ACCC + 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 + .align 2, 0 +_0804ACC0: .4byte 0x02024068 +_0804ACC4: .4byte 0x02024084 +_0804ACC8: .4byte 0x0202420d +_0804ACCC: .4byte 0x02024214 + 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, _0804AD34 + ldr r0, [r0] + cmp r0, 0 + beq _0804ACE2 + b _0804AF22 +_0804ACE2: + ldr r0, _0804AD38 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0804AD48 + ldr r0, _0804AD3C + ldrh r1, [r0] + ldr r0, _0804AD40 + cmp r1, r0 + bne _0804AD48 + movs r5, 0 +_0804ACFC: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _0804AD44 + 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 + .align 2, 0 +_0804AD34: .4byte 0x02024068 +_0804AD38: .4byte 0x02022fec +_0804AD3C: .4byte 0x02038bce +_0804AD40: .4byte 0x00000c03 +_0804AD44: .4byte 0x020244ec +_0804AD48: + movs r5, 0 +_0804AD4A: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _0804AEC0 + 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, _0804AEC4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804AD94 + ldr r0, _0804AEC8 + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + ldr r2, _0804AECC + 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, _0804AED0 + 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, _0804AED4 + 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, _0804AEC4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804AE02 + ldr r0, _0804AEC8 + ldr r0, [r0] + ldr r1, _0804AED8 + adds r0, r1 + ldrb r1, [r0] + ldr r2, _0804AECC + 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, _0804AED0 + 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, _0804AEC4 + ldr r1, [r0] + ldr r2, _0804AEDC + ands r1, r2 + mov r8, r0 + cmp r1, 0 + beq _0804AF1A + movs r3, 0 + movs r5, 0 + ldr r0, _0804AEE0 + ldrb r1, [r0] + mov r12, r0 + ldr r7, _0804AEE4 + cmp r3, r1 + bge _0804AE70 + ldr r0, _0804AEE8 + movs r6, 0x80 + lsls r6, 21 + ldr r4, [r0] + adds r2, r1, 0 + ldr r1, _0804AEEC +_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, _0804AEE8 + movs r4, 0x80 + lsls r4, 21 + mov r12, r4 + ldr r6, [r0] + ldr r0, _0804AEEC + 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 + .align 2, 0 +_0804AEC0: .4byte 0x020244ec +_0804AEC4: .4byte 0x02022fec +_0804AEC8: .4byte 0x0202449c +_0804AECC: .4byte 0x0832a328 +_0804AED0: .4byte 0x0202433a +_0804AED4: .4byte 0x02024744 +_0804AED8: .4byte 0x000002a1 +_0804AEDC: .4byte 0x02000002 +_0804AEE0: .4byte 0x0202406c +_0804AEE4: .4byte 0x02024214 +_0804AEE8: .4byte 0x02024280 +_0804AEEC: .4byte 0x0202437c +_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, _0804AF2C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804AF22: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804AF2C: .4byte 0x02024214 + thumb_func_end sub_804ACD0 + + thumb_func_start sub_804AF30 +sub_804AF30: @ 804AF30 + ldr r1, _0804AF58 + movs r0, 0 + strb r0, [r1] + ldr r0, _0804AF5C + movs r2, 0 + movs r1, 0x1 + strb r1, [r0, 0xE] + ldr r0, _0804AF60 + strb r1, [r0] + ldr r0, _0804AF64 + strb r2, [r0, 0x3] + strb r2, [r0, 0x6] + ldr r2, _0804AF68 + ldr r0, [r2] + subs r1, 0x42 + ands r0, r1 + ldr r1, _0804AF6C + ands r0, r1 + str r0, [r2] + bx lr + .align 2, 0 +_0804AF58: .4byte 0x0202427c +_0804AF5C: .4byte 0x02024474 +_0804AF60: .4byte 0x02024211 +_0804AF64: .4byte 0x02024332 +_0804AF68: .4byte 0x02024280 +_0804AF6C: .4byte 0xffffbfff + thumb_func_end sub_804AF30 + + thumb_func_start atk25_cmd25 +atk25_cmd25: @ 804AF70 + push {lr} + bl sub_804AF30 + ldr r1, _0804AF84 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804AF84: .4byte 0x02024214 + thumb_func_end atk25_cmd25 + + thumb_func_start atk26_80225F0_storebyteforjump +atk26_80225F0_storebyteforjump: @ 804AF88 + ldr r3, _0804AF98 + ldr r2, _0804AF9C + ldr r0, [r2] + ldrb r1, [r0, 0x1] + strb r1, [r3] + adds r0, 0x2 + str r0, [r2] + bx lr + .align 2, 0 +_0804AF98: .4byte 0x02024212 +_0804AF9C: .4byte 0x02024214 + thumb_func_end atk26_80225F0_storebyteforjump + + thumb_func_start atk27_cmd27 +atk27_cmd27: @ 804AFA0 + push {lr} + ldr r1, _0804AFBC + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0804AFC4 + ldr r1, _0804AFC0 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0804AFDE + .align 2, 0 +_0804AFBC: .4byte 0x02024212 +_0804AFC0: .4byte 0x02024214 +_0804AFC4: + ldr r3, _0804AFE4 + 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 + .align 2, 0 +_0804AFE4: .4byte 0x02024214 + thumb_func_end atk27_cmd27 + + thumb_func_start atk28_goto +atk28_goto: @ 804AFE8 + ldr r3, _0804B004 + 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 + .align 2, 0 +_0804B004: .4byte 0x02024214 + thumb_func_end atk28_goto + + thumb_func_start atk29_jumpifbyte +atk29_jumpifbyte: @ 804B008 + push {r4-r6,lr} + ldr r3, _0804B04C + 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, _0804B050 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804B04C: .4byte 0x02024214 +_0804B050: .4byte _0804B054 + .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, _0804B0F4 + 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, _0804B0F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804B0F4: .4byte 0x02024214 +_0804B0F8: .4byte _0804B0FC + .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, _0804B1A8 + 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, _0804B1AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804B1A8: .4byte 0x02024214 +_0804B1AC: .4byte _0804B1B0 + .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, _0804B25C + 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 + .align 2, 0 +_0804B25C: .4byte 0x02024214 +_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, _0804B300 + 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 + .align 2, 0 +_0804B300: .4byte 0x02024214 +_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, _0804B334 + 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 + .align 2, 0 +_0804B334: .4byte 0x02024214 + thumb_func_end sub_804B310 + + thumb_func_start sub_804B338 +sub_804B338: @ 804B338 + ldr r3, _0804B360 + 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 + .align 2, 0 +_0804B360: .4byte 0x02024214 + thumb_func_end sub_804B338 + + thumb_func_start sub_804B364 +sub_804B364: @ 804B364 + ldr r3, _0804B38C + 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 + .align 2, 0 +_0804B38C: .4byte 0x02024214 + thumb_func_end sub_804B364 + + thumb_func_start atk31_copyarray +atk31_copyarray: @ 804B390 + push {r4-r6,lr} + ldr r3, _0804B3E0 + 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 + .align 2, 0 +_0804B3E0: .4byte 0x02024214 + thumb_func_end atk31_copyarray + + thumb_func_start atk32_memcpy_with_offset +atk32_memcpy_with_offset: @ 804B3E4 + push {r4-r7,lr} + ldr r3, _0804B44C + 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 + .align 2, 0 +_0804B44C: .4byte 0x02024214 + thumb_func_end atk32_memcpy_with_offset + + thumb_func_start atk33_orbyte +atk33_orbyte: @ 804B450 + ldr r3, _0804B478 + 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 + .align 2, 0 +_0804B478: .4byte 0x02024214 + thumb_func_end atk33_orbyte + + thumb_func_start atk34_orhalfword +atk34_orhalfword: @ 804B47C + push {r4,lr} + ldr r4, _0804B4B0 + 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 + .align 2, 0 +_0804B4B0: .4byte 0x02024214 + thumb_func_end atk34_orhalfword + + thumb_func_start atk35_orword +atk35_orword: @ 804B4B4 + push {r4,lr} + ldr r4, _0804B4F4 + 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 + .align 2, 0 +_0804B4F4: .4byte 0x02024214 + thumb_func_end atk35_orword + + thumb_func_start atk36_bicbyte +atk36_bicbyte: @ 804B4F8 + ldr r3, _0804B520 + 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 + .align 2, 0 +_0804B520: .4byte 0x02024214 + thumb_func_end atk36_bicbyte + + thumb_func_start atk37_bichalfword +atk37_bichalfword: @ 804B524 + push {r4,lr} + ldr r4, _0804B558 + 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 + .align 2, 0 +_0804B558: .4byte 0x02024214 + thumb_func_end atk37_bichalfword + + thumb_func_start atk38_bicword +atk38_bicword: @ 804B55C + push {r4,lr} + ldr r4, _0804B59C + 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 + .align 2, 0 +_0804B59C: .4byte 0x02024214 + thumb_func_end atk38_bicword + + thumb_func_start atk39_pause +atk39_pause: @ 804B5A0 + push {r4,r5,lr} + ldr r0, _0804B5D4 + ldr r4, [r0] + cmp r4, 0 + bne _0804B5CC + ldr r5, _0804B5D8 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r3, _0804B5DC + 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 + .align 2, 0 +_0804B5D4: .4byte 0x02024068 +_0804B5D8: .4byte 0x02024214 +_0804B5DC: .4byte 0x0202432c + thumb_func_end atk39_pause + + thumb_func_start sub_804B5E0 +sub_804B5E0: @ 804B5E0 + push {lr} + ldr r0, _0804B5F8 + ldr r0, [r0] + cmp r0, 0 + bne _0804B5F2 + ldr r1, _0804B5FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804B5F2: + pop {r0} + bx r0 + .align 2, 0 +_0804B5F8: .4byte 0x02024068 +_0804B5FC: .4byte 0x02024214 + thumb_func_end sub_804B5E0 + + thumb_func_start atk3B_8022C68 +atk3B_8022C68: @ 804B600 + push {lr} + ldr r0, _0804B614 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804B620 + ldr r0, _0804B618 + ldr r1, _0804B61C + b _0804B624 + .align 2, 0 +_0804B614: .4byte 0x02024214 +_0804B618: .4byte 0x02024064 +_0804B61C: .4byte 0x0202420c +_0804B620: + ldr r0, _0804B648 + ldr r1, _0804B64C +_0804B624: + ldrb r1, [r1] + strb r1, [r0] + ldr r0, _0804B650 + ldrh r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldr r0, _0804B648 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, _0804B654 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804B648: .4byte 0x02024064 +_0804B64C: .4byte 0x0202420b +_0804B650: .4byte 0x020241f0 +_0804B654: .4byte 0x02024214 + 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, _0804B690 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804B67C + ldr r0, _0804B694 + ldrb r0, [r0] + bl sub_81A5718 +_0804B67C: + ldr r0, _0804B698 + movs r1, 0 + strb r1, [r0] + ldr r0, _0804B69C + strb r1, [r0] + ldr r1, _0804B6A0 + movs r0, 0xB + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804B690: .4byte 0x02022fec +_0804B694: .4byte 0x0202420b +_0804B698: .4byte 0x0202427c +_0804B69C: .4byte 0x02024064 +_0804B6A0: .4byte 0x02024083 + thumb_func_end sub_804B664 + + thumb_func_start atk3E_end2 +atk3E_end2: @ 804B6A4 + ldr r1, _0804B6B4 + movs r0, 0 + strb r0, [r1] + ldr r1, _0804B6B8 + movs r0, 0xB + strb r0, [r1] + bx lr + .align 2, 0 +_0804B6B4: .4byte 0x02024064 +_0804B6B8: .4byte 0x02024083 + thumb_func_end atk3E_end2 + + thumb_func_start atk3F_end3 +atk3F_end3: @ 804B6BC + push {lr} + bl b_movescr_stack_pop_cursor + ldr r3, _0804B6F0 + 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, _0804B6F4 + 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 + .align 2, 0 +_0804B6F0: .4byte 0x020244a8 +_0804B6F4: .4byte 0x03005d04 + thumb_func_end atk3F_end3 + + thumb_func_start atk41_call +atk41_call: @ 804B6F8 + push {r4,lr} + ldr r4, _0804B724 + 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 + .align 2, 0 +_0804B724: .4byte 0x02024214 + thumb_func_end atk41_call + + thumb_func_start atk42_jumpiftype2 +atk42_jumpiftype2: @ 804B728 + push {r4,lr} + ldr r4, _0804B770 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r4] + ldr r2, _0804B774 + 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 + .align 2, 0 +_0804B770: .4byte 0x02024214 +_0804B774: .4byte 0x02024084 +_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, _0804B7BC + 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 + .align 2, 0 +_0804B7BC: .4byte 0x02024214 +_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, _0804B7E4 + ldrb r0, [r0] + ldr r1, _0804B7E8 + ldr r1, [r1] + adds r0, r1 + adds r0, 0x54 + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_0804B7E4: .4byte 0x0202420b +_0804B7E8: .4byte 0x0202449c + thumb_func_end sub_804B7D0 + + thumb_func_start atk46_cmd46 +atk46_cmd46: @ 804B7EC + push {r4-r6,lr} + ldr r5, _0804B840 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, _0804B844 + 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, _0804B840 + 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, _0804B844 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + b _0804B8AA + .align 2, 0 +_0804B840: .4byte 0x02024214 +_0804B844: .4byte 0x02024064 +_0804B848: + ldr r0, _0804B860 + 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, _0804B864 + b _0804B8A8 + .align 2, 0 +_0804B860: .4byte 0x02024280 +_0804B864: .4byte 0x082dabb9 +_0804B868: + adds r0, r4, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0804B894 + ldr r1, _0804B88C + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804B890 + ands r0, r1 + cmp r0, 0 + beq _0804B894 + adds r0, r2, 0x7 + b _0804B8A8 + .align 2, 0 +_0804B88C: .4byte 0x020242ac +_0804B890: .4byte 0x000400c0 +_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, _0804B918 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r7, _0804B91C + 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, _0804B91C + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, _0804B918 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] + b _0804B976 + .align 2, 0 +_0804B918: .4byte 0x02024214 +_0804B91C: .4byte 0x02024064 +_0804B920: + ldr r0, _0804B930 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804B934 + adds r0, r2, 0 + b _0804B972 + .align 2, 0 +_0804B930: .4byte 0x02024280 +_0804B934: + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0804B960 + ldr r1, _0804B958 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804B95C + ands r0, r1 + cmp r0, 0 + beq _0804B960 + adds r0, r2, 0 + b _0804B972 + .align 2, 0 +_0804B958: .4byte 0x020242ac +_0804B95C: .4byte 0x000400c0 +_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, _0804B998 + 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 + .align 2, 0 +_0804B998: .4byte 0x02024474 +_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, _0804B9D4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804B9D4: .4byte 0x02024214 + 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, _0804BA4C + ldr r0, [r5] + ldrb r0, [r0, 0x1] + str r3, [sp] + bl get_battle_side_of_something + ldr r2, _0804BA50 + 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, _0804BA54 + 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, _0804BA4C + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804BA58 + ldr r0, _0804BA50 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7, r0 + b _0804BAA0 + .align 2, 0 +_0804BA4C: .4byte 0x02024214 +_0804BA50: .4byte 0x02024064 +_0804BA54: .4byte 0x0202409c +_0804BA58: + ldr r6, _0804BADC + 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, _0804BAE0 + adds r0, r1 + ldrb r0, [r0, 0x4] + ldr r3, [sp] + cmp r0, 0 + bne _0804BAB2 + ldr r0, _0804BAE4 + 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, _0804BAE8 + 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 + .align 2, 0 +_0804BADC: .4byte 0x02024064 +_0804BAE0: .4byte 0x02024294 +_0804BAE4: .4byte 0x02024084 +_0804BAE8: .4byte 0x02024214 +_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, _0804BB68 + 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 + .align 2, 0 +_0804BB68: .4byte 0x0202409c +_0804BB6C: + cmp r3, 0 + beq _0804BBB4 + ldr r4, _0804BBA8 + 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, _0804BBAC + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, _0804BBB0 + 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, _0804BBB0 + b _0804BBB6 + .align 2, 0 +_0804BBA8: .4byte 0x02024474 +_0804BBAC: .4byte 0x02024064 +_0804BBB0: .4byte 0x02024214 +_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, _0804BC1C + ldrh r1, [r2] + ldr r0, _0804BC20 + movs r3, 0 + str r3, [sp, 0x18] + cmp r1, r0 + beq _0804BBEE + ldrh r2, [r2] + str r2, [sp, 0x18] +_0804BBEE: + ldr r0, _0804BC24 + ldr r0, [r0] + ldrb r4, [r0, 0x1] + str r4, [sp, 0x10] + ldrb r0, [r0, 0x2] + str r0, [sp, 0x14] + ldr r1, _0804BC28 + ldr r0, _0804BC2C + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804BC34 + ldr r1, _0804BC30 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x7] + b _0804BC3E + .align 2, 0 +_0804BC1C: .4byte 0x020241ec +_0804BC20: .4byte 0x0000ffff +_0804BC24: .4byte 0x02024214 +_0804BC28: .4byte 0x02024084 +_0804BC2C: .4byte 0x0202420b +_0804BC30: .4byte 0x02024404 +_0804BC34: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0804BC3E: + str r0, [sp, 0x8] + ldr r1, _0804BC60 + ldr r0, _0804BC64 + 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 + .align 2, 0 +_0804BC60: .4byte 0x0202449c +_0804BC64: .4byte 0x0202420b +_0804BC68: + ldr r4, _0804BC7C + 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 + .align 2, 0 +_0804BC7C: .4byte 0x02024064 +_0804BC80: + ldr r4, _0804BCA4 + 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, _0804BCA8 + ands r0, r2 + str r0, [r1] + b _0804C15A + .align 2, 0 +_0804BCA4: .4byte 0x02024064 +_0804BCA8: .4byte 0xfffbff3f +_0804BCAC: + strb r2, [r7] + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + ldr r0, _0804BCE0 + strb r4, [r0, 0x14] + bl sub_804AF30 + ldr r2, _0804BCE4 + 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, _0804BCE8 + ldr r0, _0804BCEC + bl _0804C5B8 + .align 2, 0 +_0804BCE0: .4byte 0x02024474 +_0804BCE4: .4byte 0x082d86a8 +_0804BCE8: .4byte 0x02024214 +_0804BCEC: .4byte 0x082db87d +_0804BCF0: + ldr r2, _0804BD08 + ldr r0, _0804BD0C + 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, _0804BD10 + mov r12, r1 + b _0804BD1E + .align 2, 0 +_0804BD08: .4byte 0x0831c898 +_0804BD0C: .4byte 0x020241ea +_0804BD10: .4byte 0x02024474 +_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, _0804BD34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804BD34: .4byte _0804BD38 + .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, _0804BE38 + ldr r5, _0804BE3C + 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, _0804BE40 + 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, _0804BE44 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804BDDA + b _0804C184 +_0804BDDA: + ldr r2, _0804BE48 + 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, _0804BE4C + ldr r0, _0804BE50 + 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, _0804BE54 + ldr r0, _0804BE58 + str r0, [r1] + b _0804C0B8 + .align 2, 0 +_0804BE38: .4byte 0x02024084 +_0804BE3C: .4byte 0x0202420c +_0804BE40: .4byte 0x0202420b +_0804BE44: .4byte 0x0202427c +_0804BE48: .4byte 0x0202437c +_0804BE4C: .4byte 0x0831c898 +_0804BE50: .4byte 0x020241ea +_0804BE54: .4byte 0x02024214 +_0804BE58: .4byte 0x082dae0d +_0804BE5C: + ldr r4, _0804BEF8 + ldr r6, _0804BEFC + 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, _0804BF00 + ldrb r0, [r0] + cmp r0, r2 + bne _0804BE90 + b _0804C184 +_0804BE90: + ldr r0, _0804BF04 + 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, _0804BF08 + 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, _0804BF0C + 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, _0804BF10 + ldr r0, _0804BF14 + str r0, [r1] + movs r2, 0x1 + mov r10, r2 + b _0804C184 + .align 2, 0 +_0804BEF8: .4byte 0x02024084 +_0804BEFC: .4byte 0x0202420c +_0804BF00: .4byte 0x0202420b +_0804BF04: .4byte 0x0202437c +_0804BF08: .4byte 0x0202427c +_0804BF0C: .4byte 0x02024064 +_0804BF10: .4byte 0x02024214 +_0804BF14: .4byte 0x082db282 +_0804BF18: + ldr r0, _0804BF38 + 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 + .align 2, 0 +_0804BF38: .4byte 0x0202420c +_0804BF3C: + ldr r0, _0804BF50 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl ability_something + b _0804C0B2 + .align 2, 0 +_0804BF50: .4byte 0x0202420c +_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, _0804BF78 + mov r12, r0 + b _0804C570 + .align 2, 0 +_0804BF78: .4byte 0x02024474 +_0804BF7C: + ldr r0, _0804BF9C + 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 + .align 2, 0 +_0804BF9C: .4byte 0x0202420b +_0804BFA0: + ldr r0, _0804C030 + 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, _0804C034 + 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, _0804C038 + cmp r1, r0 + bne _0804BFE4 +_0804BFCC: + cmp r2, 0xE2 + bne _0804BFDE + ldr r0, _0804C03C + 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, _0804C040 + ldr r3, _0804C044 + 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 + .align 2, 0 +_0804C030: .4byte 0x02024280 +_0804C034: .4byte 0x020241ec +_0804C038: .4byte 0x0000ffff +_0804C03C: .4byte 0x0202427c +_0804C040: .4byte 0x02024084 +_0804C044: .4byte 0x0202420b +_0804C048: + movs r4, 0 + ldr r0, _0804C07C + ldrb r3, [r0] + cmp r4, r3 + blt _0804C054 + b _0804C202 +_0804C054: + ldr r7, _0804C080 + movs r6, 0 + movs r3, 0xD0 + adds r5, r0, 0 + ldr r2, _0804C084 +_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 + .align 2, 0 +_0804C07C: .4byte 0x0202406c +_0804C080: .4byte 0x0202449c +_0804C084: .4byte 0x02024084 +_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, _0804C0A4 + mov r12, r3 + b _0804C570 + .align 2, 0 +_0804C0A4: .4byte 0x02024474 +_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, _0804C0E4 + ldr r0, _0804C0E8 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804C0EC + ands r0, r1 + cmp r0, 0 + bne _0804C0D4 + b _0804C4B6 +_0804C0D4: + ldr r0, _0804C0F0 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804C0E2 + b _0804BC68 +_0804C0E2: + b _0804C4B6 + .align 2, 0 +_0804C0E4: .4byte 0x020242ac +_0804C0E8: .4byte 0x0202420b +_0804C0EC: .4byte 0x000400c0 +_0804C0F0: .4byte 0x02024280 +_0804C0F4: + ldr r0, _0804C164 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C120 + ldr r1, _0804C168 + ldr r0, _0804C16C + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804C170 + 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, _0804C174 + ldr r5, _0804C16C + 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, _0804C168 + ldrb r2, [r5] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, _0804C178 + ands r0, r1 + str r0, [r2] + ldr r2, _0804C17C + 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, _0804C180 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + b _0804C5BA + .align 2, 0 +_0804C164: .4byte 0x0202427c +_0804C168: .4byte 0x020242ac +_0804C16C: .4byte 0x0202420b +_0804C170: .4byte 0x000400c0 +_0804C174: .4byte 0x02024064 +_0804C178: .4byte 0xfffbff3f +_0804C17C: .4byte 0x0202437c +_0804C180: .4byte 0x02024474 +_0804C184: + ldr r1, _0804C190 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + mov r12, r1 + b _0804C570 + .align 2, 0 +_0804C190: .4byte 0x02024474 +_0804C194: + ldr r0, _0804C1C4 + ldr r6, _0804C1C8 + 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, _0804C1CC + ldrb r0, [r0] + cmp r2, r0 + bcs _0804C202 + ldr r5, _0804C1D0 + adds r0, r3, r5 + ldr r0, [r0] + ldr r1, _0804C1D4 + ands r0, r1 + cmp r0, 0 + bne _0804C1C2 + b _0804BC80 +_0804C1C2: + b _0804C202 + .align 2, 0 +_0804C1C4: .4byte 0x0202437c +_0804C1C8: .4byte 0x0202420c +_0804C1CC: .4byte 0x0202406c +_0804C1D0: .4byte 0x020242ac +_0804C1D4: .4byte 0x000400c0 +_0804C1D8: + movs r4, 0 + ldr r0, _0804C20C + ldrb r2, [r0] + cmp r4, r2 + bge _0804C202 + ldr r2, _0804C210 + ldr r5, _0804C214 + adds r3, r0, 0 + ldr r1, _0804C218 +_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 + .align 2, 0 +_0804C20C: .4byte 0x0202406c +_0804C210: .4byte 0x020242bc +_0804C214: .4byte 0xfeffffff +_0804C218: .4byte 0x020240d4 +_0804C21C: + ldr r1, _0804C2D0 + ldr r3, [r1] + movs r0, 0x80 + lsls r0, 5 + ands r0, r3 + ldr r2, _0804C2D4 + mov r9, r2 + adds r5, r1, 0 + cmp r0, 0 + beq _0804C246 + ldr r0, _0804C2D8 + ldrb r2, [r2] + strb r2, [r0] + ldr r1, _0804C2DC + ldrb r0, [r1] + mov r4, r9 + strb r0, [r4] + strb r2, [r1] + ldr r0, _0804C2E0 + 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, _0804C2E4 + mov r2, r9 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r0, _0804C2E8 + ldrh r0, [r0] + strh r0, [r1] +_0804C262: + ldr r0, _0804C2EC + ldrb r1, [r0] + ldr r2, _0804C2F0 + 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, _0804C2F4 + 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, _0804C2F8 + 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, _0804C2FC + lsls r1, r4, 1 + adds r1, r0 + ldr r0, _0804C2E8 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, _0804C300 + mov r3, r9 + ldrb r1, [r3] + lsls r1, 1 + adds r1, r0 + ldr r0, _0804C304 + ldrh r0, [r0] + strh r0, [r1] + b _0804C322 + .align 2, 0 +_0804C2D0: .4byte 0x02024280 +_0804C2D4: .4byte 0x0202420b +_0804C2D8: .4byte 0x02024064 +_0804C2DC: .4byte 0x0202420c +_0804C2E0: .4byte 0xffffefff +_0804C2E4: .4byte 0x02024240 +_0804C2E8: .4byte 0x020241ec +_0804C2EC: .4byte 0x02024210 +_0804C2F0: .4byte 0x0832a328 +_0804C2F4: .4byte 0x0202449c +_0804C2F8: .4byte 0x0831c898 +_0804C2FC: .4byte 0x02024248 +_0804C300: .4byte 0x02024260 +_0804C304: .4byte 0x020241ea +_0804C308: + ldr r1, _0804C370 + lsls r0, r4, 1 + adds r0, r1 + ldr r1, _0804C374 + strh r1, [r0] + ldr r1, _0804C378 + mov r4, r9 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strh r1, [r0] +_0804C322: + ldr r2, _0804C37C + 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, _0804C380 + 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, _0804C384 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C3DC + ldr r0, _0804C388 + ldrh r3, [r0] + ldr r0, _0804C374 + cmp r3, r0 + bne _0804C390 + ldr r1, _0804C38C + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + strh r3, [r0] + b _0804C3E8 + .align 2, 0 +_0804C370: .4byte 0x02024248 +_0804C374: .4byte 0x0000ffff +_0804C378: .4byte 0x02024260 +_0804C37C: .4byte 0x0202420c +_0804C380: .4byte 0x02024270 +_0804C384: .4byte 0x0202427c +_0804C388: .4byte 0x020241ec +_0804C38C: .4byte 0x02024250 +_0804C390: + ldr r0, _0804C3B4 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r4, _0804C3B8 + ldrh r0, [r4] + strh r0, [r1] + ldr r0, [r7] + ldrb r3, [r0, 0x13] + cmp r3, 0 + beq _0804C3C0 + ldr r0, _0804C3BC + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + movs r0, 0x3F + ands r0, r3 + b _0804C3E6 + .align 2, 0 +_0804C3B4: .4byte 0x02024250 +_0804C3B8: .4byte 0x020241ea +_0804C3BC: .4byte 0x02024258 +_0804C3C0: + ldr r0, _0804C3D8 + 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 + .align 2, 0 +_0804C3D8: .4byte 0x02024258 +_0804C3DC: + ldr r0, _0804C3F4 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r0, _0804C3F8 +_0804C3E6: + strh r0, [r1] +_0804C3E8: + mov r4, r12 + ldrb r0, [r4, 0x14] + adds r0, 0x1 + strb r0, [r4, 0x14] + b _0804C570 + .align 2, 0 +_0804C3F4: .4byte 0x02024250 +_0804C3F8: .4byte 0x0000ffff +_0804C3FC: + ldr r0, _0804C4C0 + ldrb r1, [r0] + ldr r7, _0804C4C4 + ldr r2, _0804C4C8 + 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, _0804C4CC + ldr r5, [r6] + adds r0, r5, 0 + adds r0, 0x91 + ldrb r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _0804C4B6 + ldr r1, _0804C4D0 + 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, _0804C4D4 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C4B6 + ldr r4, _0804C4D8 + 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, _0804C4DC + 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, _0804C4E0 + 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 + .align 2, 0 +_0804C4C0: .4byte 0x02024210 +_0804C4C4: .4byte 0x0832a328 +_0804C4C8: .4byte 0x0202420b +_0804C4CC: .4byte 0x0202449c +_0804C4D0: .4byte 0x0831c898 +_0804C4D4: .4byte 0x02024280 +_0804C4D8: .4byte 0x0202420c +_0804C4DC: .4byte 0x0202427c +_0804C4E0: .4byte 0x020241ec +_0804C4E4: + ldr r5, _0804C5CC + ldr r2, [r5] + movs r0, 0x80 + lsls r0, 12 + ands r0, r2 + cmp r0, 0 + bne _0804C568 + ldr r0, _0804C5D0 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804C568 + ldr r1, _0804C5D4 + ldr r0, _0804C5D8 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r0, 0 + blt _0804C568 + ldr r0, _0804C5DC + mov r9, r0 + ldr r1, _0804C5E0 + 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, _0804C5E4 + 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, _0804C5E8 + 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, _0804C5EC + 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, _0804C5F0 + 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 + .align 2, 0 +_0804C5CC: .4byte 0x02024280 +_0804C5D0: .4byte 0x02022fec +_0804C5D4: .4byte 0x0202433c +_0804C5D8: .4byte 0x0202420b +_0804C5DC: .4byte 0x0831c898 +_0804C5E0: .4byte 0x020241ea +_0804C5E4: .4byte 0x0202420c +_0804C5E8: .4byte 0x02024084 +_0804C5EC: .4byte 0x02024474 +_0804C5F0: .4byte 0x02024214 + 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, _0804C658 + ldr r0, _0804C65C + 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, _0804C660 + ldr r3, _0804C664 + 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, _0804C668 + strb r0, [r3] + ldr r2, _0804C66C + ldrb r0, [r2] + movs r1, 0x9 + orrs r0, r1 + strb r0, [r2] + ldr r1, _0804C670 + ldrb r0, [r7] + lsls r0, 1 + adds r0, r1 + strh r4, [r0] + ldr r0, _0804C674 + mov r2, r8 + strb r2, [r0, 0x6] + ldrb r0, [r7] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player + b _0804C76A + .align 2, 0 +_0804C658: .4byte 0x0831c898 +_0804C65C: .4byte 0x020241ea +_0804C660: .4byte 0x02024084 +_0804C664: .4byte 0x0202420c +_0804C668: .4byte 0x0202420a +_0804C66C: .4byte 0x0202427c +_0804C670: .4byte 0x02024250 +_0804C674: .4byte 0x02024332 +_0804C678: + ldr r0, _0804C684 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] + b _0804C76A + .align 2, 0 +_0804C684: .4byte 0x0202427c +_0804C688: + ldr r1, _0804C694 + adds r0, r5, r1 + ldrb r0, [r0] + adds r6, r1, 0 + b _0804C74A + .align 2, 0 +_0804C694: .4byte 0x0831ace8 +_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, _0804C818 + ldr r0, _0804C81C + 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, _0804C820 + ldrb r0, [r0] + ldr r7, _0804C824 + 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, _0804C828 + 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, _0804C82C + strb r6, [r3] + ldr r2, _0804C830 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _0804C834 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + strh r5, [r0] + ldr r1, _0804C838 + movs r0, 0x3 + strb r0, [r1, 0x6] + ldrb r0, [r2] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player +_0804C7E6: + ldr r0, _0804C830 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804C804 + ldr r2, _0804C83C + ldr r0, _0804C820 + 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, _0804C840 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C818: .4byte 0x02024084 +_0804C81C: .4byte 0x0202420c +_0804C820: .4byte 0x0202420b +_0804C824: .4byte 0x020241ea +_0804C828: .4byte 0x0831c898 +_0804C82C: .4byte 0x0202420a +_0804C830: .4byte 0x0202427c +_0804C834: .4byte 0x02024250 +_0804C838: .4byte 0x02024332 +_0804C83C: .4byte 0x0202433c +_0804C840: .4byte 0x02024214 + thumb_func_end atk4A_damagecalc2 + + thumb_func_start atk4B_cmd4b +atk4B_cmd4b: @ 804C844 + push {r4,lr} + ldr r4, _0804C880 + ldr r0, _0804C884 + ldrb r0, [r0] + strb r0, [r4] + ldr r2, _0804C888 + ldr r1, _0804C88C + 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, _0804C890 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804C880: .4byte 0x02024064 +_0804C884: .4byte 0x0202420b +_0804C888: .4byte 0x02024280 +_0804C88C: .4byte 0x0832a328 +_0804C890: .4byte 0x02024214 + thumb_func_end atk4B_cmd4b + + thumb_func_start atk4C_switch1 +atk4C_switch1: @ 804C894 + push {r4,r5,lr} + ldr r0, _0804C8EC + ldr r0, [r0] + cmp r0, 0 + bne _0804C8E4 + ldr r5, _0804C8F0 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804C8F4 + strb r0, [r4] + ldr r3, _0804C8F8 + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r3 + ldr r1, _0804C8FC + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + ldrb r0, [r0] + strh r0, [r2] + ldr r1, _0804C900 + 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 + .align 2, 0 +_0804C8EC: .4byte 0x02024068 +_0804C8F0: .4byte 0x02024214 +_0804C8F4: .4byte 0x02024064 +_0804C8F8: .4byte 0x0202406e +_0804C8FC: .4byte 0x0202449c +_0804C900: .4byte 0x0832a328 + thumb_func_end atk4C_switch1 + + thumb_func_start sub_804C904 +sub_804C904: @ 804C904 + push {r4-r7,lr} + sub sp, 0x58 + ldr r0, _0804CAAC + ldr r0, [r0] + cmp r0, 0 + beq _0804C912 + b _0804CAA4 +_0804C912: + ldr r0, _0804CAB0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804CAB4 + strb r0, [r4] + ldr r6, _0804CAB8 + 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, _0804CABC +_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, _0804CAB8 + ldr r6, _0804CAB4 + ldrb r0, [r6] + movs r7, 0x58 + adds r2, r0, 0 + muls r2, r7 + adds r2, r4 + ldr r3, _0804CAC0 + 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, _0804CAC4 + adds r0, 0x29 + adds r0, r2, r0 + ldrb r1, [r0] + ldr r3, _0804CAC8 + ldr r2, _0804CACC + 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, _0804CAD0 + ldr r0, _0804CAD4 + 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, _0804CAB4 + 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, _0804CAD8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0804CA78 + ldr r4, _0804CAB8 + ldr r0, _0804CAB4 + 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, _0804CADC + ldr r2, [r0] + adds r2, 0x92 + ldr r1, _0804CAC8 + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_0804CA78: + ldr r0, _0804CAE0 + ldr r3, _0804CAB4 + ldrb r2, [r3] + strb r2, [r0, 0x17] + ldr r1, _0804CAE4 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, _0804CACC + 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, _0804CAB0 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804CAA4: + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804CAAC: .4byte 0x02024068 +_0804CAB0: .4byte 0x02024214 +_0804CAB4: .4byte 0x02024064 +_0804CAB8: .4byte 0x02024084 +_0804CABC: .4byte 0x02023864 +_0804CAC0: .4byte 0x083203cc +_0804CAC4: .4byte 0x020243d0 +_0804CAC8: .4byte 0x0832a328 +_0804CACC: .4byte 0x0202406e +_0804CAD0: .4byte 0x0831c898 +_0804CAD4: .4byte 0x020241ea +_0804CAD8: .4byte 0x02022fec +_0804CADC: .4byte 0x0202449c +_0804CAE0: .4byte 0x02024474 +_0804CAE4: .4byte 0x02022f58 + thumb_func_end sub_804C904 + + thumb_func_start atk4E_switch3 +atk4E_switch3: @ 804CAE8 + push {r4-r6,lr} + ldr r0, _0804CB8C + ldr r0, [r0] + cmp r0, 0 + bne _0804CB86 + ldr r0, _0804CB90 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, _0804CB94 + strb r0, [r6] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804CB3E + ldr r0, _0804CB98 + ldr r0, [r0] + ldr r1, _0804CB9C + ands r0, r1 + cmp r0, 0 + bne _0804CB3E + ldr r4, _0804CBA0 + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r0, r4 + ldrh r0, [r0] + bl species_to_pokedex_index + 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 sub_806F01C +_0804CB3E: + ldr r2, _0804CBA4 + ldr r1, _0804CBA8 + ldr r5, _0804CB94 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, _0804CBAC + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrb r1, [r0] + ldr r4, _0804CB90 + 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, _0804CB98 + 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 + .align 2, 0 +_0804CB8C: .4byte 0x02024068 +_0804CB90: .4byte 0x02024214 +_0804CB94: .4byte 0x02024064 +_0804CB98: .4byte 0x02022fec +_0804CB9C: .4byte 0x063f0902 +_0804CBA0: .4byte 0x02024084 +_0804CBA4: .4byte 0x02024210 +_0804CBA8: .4byte 0x0832a328 +_0804CBAC: .4byte 0x0202406e + thumb_func_end atk4E_switch3 + + thumb_func_start atk4F_jumpifcannotswitch +atk4F_jumpifcannotswitch: @ 804CBB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0804CC14 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + movs r0, 0x7F + ands r0, r1 + bl get_battle_side_of_something + ldr r3, _0804CC18 + strb r0, [r3] + ldr r2, [r4] + ldrb r1, [r2, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804CC28 + ldr r1, _0804CC1C + ldrb r3, [r3] + movs r0, 0x58 + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804CC20 + ands r0, r1 + cmp r0, 0 + bne _0804CBFC + ldr r1, _0804CC24 + 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 + .align 2, 0 +_0804CC14: .4byte 0x02024214 +_0804CC18: .4byte 0x02024064 +_0804CC1C: .4byte 0x02024084 +_0804CC20: .4byte 0x0400e000 +_0804CC24: .4byte 0x020242ac +_0804CC28: + ldr r0, _0804CCAC + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0804CCC0 + ldr r5, _0804CCB0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0804CCB4 + mov r8, r1 + cmp r0, 0x1 + bne _0804CC4E + ldr r0, _0804CCB8 + 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, _0804CCBC +_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, _0804CCB0 + 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 + .align 2, 0 +_0804CCAC: .4byte 0x02022fec +_0804CCB0: .4byte 0x02024064 +_0804CCB4: .4byte 0x020244ec +_0804CCB8: .4byte 0x02024744 +_0804CCBC: .4byte 0x0202406e +_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, _0804CCE4 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804CCEC + ldr r0, _0804CCE8 + b _0804CD16 + .align 2, 0 +_0804CCE4: .4byte 0x02024064 +_0804CCE8: .4byte 0x020244ec +_0804CCEC: + ldr r1, _0804CCFC + mov r8, r1 + ldrb r0, [r5] + movs r4, 0x3 + cmp r0, 0x1 + bne _0804CD32 + movs r4, 0 + b _0804CD32 + .align 2, 0 +_0804CCFC: .4byte 0x02024744 +_0804CD00: + ldr r5, _0804CD7C + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0804CD80 + mov r8, r1 + cmp r0, 0x1 + bne _0804CD18 + ldr r0, _0804CD84 +_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, _0804CD88 +_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, _0804CD7C + 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 + .align 2, 0 +_0804CD7C: .4byte 0x02024064 +_0804CD80: .4byte 0x020244ec +_0804CD84: .4byte 0x02024744 +_0804CD88: .4byte 0x0202406e +_0804CD8C: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _0804CE10 + ldr r5, _0804CE04 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804CE10 + ldr r0, _0804CE08 + 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, _0804CE0C +_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, _0804CE04 + 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 + .align 2, 0 +_0804CE04: .4byte 0x02024064 +_0804CE08: .4byte 0x02024744 +_0804CE0C: .4byte 0x0202406e +_0804CE10: + ldr r0, _0804CE40 + 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, _0804CE44 + 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 + .align 2, 0 +_0804CE40: .4byte 0x02024064 +_0804CE44: .4byte 0x02022fec +_0804CE48: + adds r6, r7, 0 +_0804CE4A: + ldr r0, _0804CE50 + mov r8, r0 + b _0804CE82 + .align 2, 0 +_0804CE50: .4byte 0x02024744 +_0804CE54: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0804CE78 + 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 + .align 2, 0 +_0804CE78: .4byte 0x02022fec +_0804CE7C: + adds r6, r7, 0 +_0804CE7E: + ldr r1, _0804CEEC + 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, _0804CEF0 + 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, _0804CEF4 + 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 + .align 2, 0 +_0804CEEC: .4byte 0x020244ec +_0804CEF0: .4byte 0x0202406e +_0804CEF4: .4byte 0x02024214 +_0804CEF8: + ldr r1, _0804CF0C + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] +_0804CF00: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804CF0C: .4byte 0x02024214 + 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, _0804CF78 + ldrb r0, [r5] + ldr r4, _0804CF7C + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x58 + ldr r3, _0804CF80 + 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, _0804CF84 + 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 + .align 2, 0 +_0804CF78: .4byte 0x02024064 +_0804CF7C: .4byte 0x0202449c +_0804CF80: .4byte 0x0202406e +_0804CF84: .4byte 0x0832a328 + 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, _0804D038 + 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, _0804D03C + ldr r0, [r0] + movs r1, 0x41 + ands r1, r0 + cmp r1, 0x1 + beq _0804D0B0 + ldr r1, _0804D040 + strb r7, [r1] + ldr r0, _0804D044 + ldrb r0, [r0] + cmp r7, r0 + bcc _0804CFD8 + b _0804D450 +_0804CFD8: + ldr r7, _0804D048 + ldr r6, _0804D04C + adds r4, r1, 0 + ldr r2, _0804D050 + 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 + .align 2, 0 +_0804D038: .4byte 0x02024214 +_0804D03C: .4byte 0x02022fec +_0804D040: .4byte 0x02024064 +_0804D044: .4byte 0x0202406c +_0804D048: .4byte 0x02024280 +_0804D04C: .4byte 0x0832a328 +_0804D050: .4byte 0x02024210 +_0804D054: + ldr r5, _0804D084 + 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 + .align 2, 0 +_0804D084: .4byte 0x0202437c +_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, _0804D0AC + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0804CFE2 + b _0804D450 + .align 2, 0 +_0804D0AC: .4byte 0x0202406c +_0804D0B0: + ands r0, r1 + cmp r0, 0 + bne _0804D0B8 + b _0804D450 +_0804D0B8: + ldr r0, _0804D110 + mov r8, r0 + ldr r0, [r0] + lsrs r5, r0, 28 + ldr r6, _0804D114 + ldr r0, [r6] + ands r0, r5 + cmp r0, 0 + beq _0804D170 + ldr r4, _0804D118 + 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, _0804D11C + 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 + .align 2, 0 +_0804D110: .4byte 0x02024280 +_0804D114: .4byte 0x0832a328 +_0804D118: .4byte 0x02024064 +_0804D11C: .4byte 0x02024210 +_0804D120: + ldr r6, _0804D154 + 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, _0804D158 + 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 + .align 2, 0 +_0804D154: .4byte 0x0202437c +_0804D158: .4byte 0x0202449c +_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, _0804D1C8 + 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, _0804D1CC + 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, _0804D1D0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, _0804D1D4 + 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 + .align 2, 0 +_0804D1C8: .4byte 0x0832a328 +_0804D1CC: .4byte 0x02024064 +_0804D1D0: .4byte 0x02024210 +_0804D1D4: .4byte 0x02024280 +_0804D1D8: + ldr r6, _0804D20C + 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, _0804D210 + 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 + .align 2, 0 +_0804D20C: .4byte 0x0202437c +_0804D210: .4byte 0x0202449c +_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, _0804D280 + ldr r0, [r6, 0x4] + ands r0, r5 + cmp r0, 0 + beq _0804D2E4 + ldr r4, _0804D284 + 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, _0804D288 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, _0804D28C + 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 + .align 2, 0 +_0804D280: .4byte 0x0832a328 +_0804D284: .4byte 0x02024064 +_0804D288: .4byte 0x02024210 +_0804D28C: .4byte 0x02024280 +_0804D290: + ldr r6, _0804D2C4 + 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, _0804D2C8 + 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 + .align 2, 0 +_0804D2C4: .4byte 0x0202437c +_0804D2C8: .4byte 0x0202449c +_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, _0804D33C + 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, _0804D340 + 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, _0804D344 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, _0804D348 + 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 + .align 2, 0 +_0804D33C: .4byte 0x0832a328 +_0804D340: .4byte 0x02024064 +_0804D344: .4byte 0x02024210 +_0804D348: .4byte 0x02024280 +_0804D34C: + ldr r6, _0804D380 + 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, _0804D384 + 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 + .align 2, 0 +_0804D380: .4byte 0x0202437c +_0804D384: .4byte 0x0202449c +_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, _0804D3D4 + 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, _0804D3D8 + ldrb r1, [r0] + ldr r0, _0804D3DC + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804D3E4 + ldr r1, _0804D3E0 + movs r0, 0x2 + strb r0, [r1] + b _0804D3E8 + .align 2, 0 +_0804D3D4: .4byte 0x0202437c +_0804D3D8: .4byte 0x02024210 +_0804D3DC: .4byte 0x0832a328 +_0804D3E0: .4byte 0x02024064 +_0804D3E4: + ldr r0, _0804D428 + strb r1, [r0] +_0804D3E8: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldr r0, _0804D428 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804D3FA: + ldr r1, _0804D42C + 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, _0804D430 + ldrb r0, [r0] + ldr r1, _0804D434 + ldr r1, [r1, 0x4] + ands r0, r1 + cmp r0, 0 + beq _0804D438 + ldr r1, _0804D428 + movs r0, 0x3 + b _0804D43C + .align 2, 0 +_0804D428: .4byte 0x02024064 +_0804D42C: .4byte 0x0202437c +_0804D430: .4byte 0x02024210 +_0804D434: .4byte 0x0832a328 +_0804D438: + ldr r1, _0804D45C + movs r0, 0x1 +_0804D43C: + strb r0, [r1] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldr r0, _0804D45C + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804D450: + ldr r1, _0804D460 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + b _0804D804 + .align 2, 0 +_0804D45C: .4byte 0x02024064 +_0804D460: .4byte 0x02024214 +_0804D464: + cmp r0, 0x6 + beq _0804D46A + b _0804D658 +_0804D46A: + ldr r0, _0804D4E0 + 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, _0804D4E4 + ldr r0, [r7] + lsrs r5, r0, 28 + ldr r4, _0804D4E8 + 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, _0804D4EC + movs r0, 0x2 + strb r0, [r6] + ldr r0, _0804D4F0 + ldrb r1, [r0, 0x1] + movs r0, 0x2 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D4F8 + ldr r2, _0804D4F4 + 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 + .align 2, 0 +_0804D4E0: .4byte 0x02022fec +_0804D4E4: .4byte 0x02024280 +_0804D4E8: .4byte 0x0832a328 +_0804D4EC: .4byte 0x02024064 +_0804D4F0: .4byte 0x02023864 +_0804D4F4: .4byte 0x02024210 +_0804D4F8: + ldr r4, _0804D588 + 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, _0804D58C + 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, _0804D590 + 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, _0804D594 + movs r0, 0x3 + strb r0, [r5] + ldr r0, _0804D598 + ldr r2, _0804D59C + 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, _0804D5A0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, _0804D5A4 + 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 + .align 2, 0 +_0804D588: .4byte 0x0202437c +_0804D58C: .4byte 0x0202449c +_0804D590: .4byte 0x0832a328 +_0804D594: .4byte 0x02024064 +_0804D598: .4byte 0x02023864 +_0804D59C: .4byte 0x00000201 +_0804D5A0: .4byte 0x02024210 +_0804D5A4: .4byte 0x02024280 +_0804D5A8: + ldr r4, _0804D5E8 + 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, _0804D5EC + 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, _0804D5F0 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + mov r12, r1 + b _0804D5F8 + .align 2, 0 +_0804D5E8: .4byte 0x0202437c +_0804D5EC: .4byte 0x0202449c +_0804D5F0: .4byte 0x02024214 +_0804D5F4: + adds r0, r2, 0x6 + str r0, [r6] +_0804D5F8: + ldr r0, _0804D648 + ldr r0, [r0] + lsrs r5, r0, 28 + ldr r1, _0804D64C + movs r0, 0 + strb r0, [r1] + ldr r4, _0804D650 + ldr r2, [r4] + ands r2, r5 + ldr r6, _0804D654 + 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 + .align 2, 0 +_0804D648: .4byte 0x02024280 +_0804D64C: .4byte 0x0202420d +_0804D650: .4byte 0x0832a328 +_0804D654: .4byte 0x0202406c +_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, _0804D68C + 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 + .align 2, 0 +_0804D68C: .4byte 0x0202437c +_0804D690: + adds r0, r7, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D6E0 + ldr r2, _0804D6D0 + strb r7, [r2] + ldr r3, _0804D6D4 + ldr r4, _0804D6D8 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r3] + orrs r0, r1 + strb r0, [r3] + ldr r3, _0804D6DC + 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 + .align 2, 0 +_0804D6D0: .4byte 0x02024064 +_0804D6D4: .4byte 0x02024210 +_0804D6D8: .4byte 0x0832a328 +_0804D6DC: .4byte 0x02024280 +_0804D6E0: + ldr r4, _0804D7A8 + strb r7, [r4] + ldrb r0, [r4] + ldr r3, _0804D7AC + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, _0804D7B0 + 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, _0804D7B4 + 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, _0804D7B8 + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0804D760 + adds r0, 0x1 + strb r0, [r1, 0x2] +_0804D760: + ldr r0, _0804D7BC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D7C4 + ldr r1, _0804D7A8 + movs r0, 0 + strb r0, [r1] + ldr r0, _0804D7C0 + 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, _0804D7C0 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0804D77C + b _0804D804 + .align 2, 0 +_0804D7A8: .4byte 0x02024064 +_0804D7AC: .4byte 0x0202449c +_0804D7B0: .4byte 0x0202406e +_0804D7B4: .4byte 0x0832a328 +_0804D7B8: .4byte 0x03005d10 +_0804D7BC: .4byte 0x02022fec +_0804D7C0: .4byte 0x0202406c +_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, _0804D814 + strb r0, [r4] + ldr r0, _0804D818 + ldrb r1, [r0] + ldr r2, _0804D81C + 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 + .align 2, 0 +_0804D814: .4byte 0x02024064 +_0804D818: .4byte 0x02024210 +_0804D81C: .4byte 0x0832a328 + thumb_func_end atk50_openpartyscreen + + thumb_func_start atk51_cmd51 +atk51_cmd51: @ 804D820 + push {r4-r7,lr} + ldr r0, _0804D84C + ldr r0, [r0] + cmp r0, 0 + beq _0804D82C + b _0804DA8A +_0804D82C: + ldr r4, _0804D850 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, _0804D854 + 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 + .align 2, 0 +_0804D84C: .4byte 0x02024068 +_0804D850: .4byte 0x02024214 +_0804D854: .4byte 0x02024064 +_0804D858: + cmp r0, 0x2 + beq _0804D8E8 + cmp r0, 0x3 + beq _0804D922 + b _0804DA82 +_0804D862: + movs r6, 0 + ldr r0, _0804D8BC + ldrb r0, [r0] + cmp r6, r0 + blt _0804D86E + b _0804DA82 +_0804D86E: + ldr r7, _0804D8C0 +_0804D870: + ldrb r0, [r7] + cmp r0, 0x22 + bne _0804D8AA + ldr r5, _0804D8C4 + 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, _0804D8C8 + 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, _0804D8BC + ldrb r0, [r0] + cmp r6, r0 + blt _0804D870 + b _0804DA82 + .align 2, 0 +_0804D8BC: .4byte 0x0202406c +_0804D8C0: .4byte 0x02023864 +_0804D8C4: .4byte 0x0202449c +_0804D8C8: .4byte 0x0832a328 +_0804D8CC: + ldr r0, _0804D8E4 + 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 + .align 2, 0 +_0804D8E4: .4byte 0x02022fec +_0804D8E8: + ldr r4, _0804D9FC + ldr r0, [r4] + adds r0, 0x93 + ldrb r1, [r0] + ldr r6, _0804DA00 + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804D922 + ldr r0, _0804DA04 + 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, _0804DA08 + ldr r6, _0804DA04 + ldr r7, _0804DA0C + ldrb r0, [r7] + lsls r0, 9 + adds r2, r6, 0x1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldr r1, _0804D9FC + 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, _0804DA10 + 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 + .align 2, 0 +_0804D9FC: .4byte 0x0202449c +_0804DA00: .4byte 0x0832a328 +_0804DA04: .4byte 0x02023864 +_0804DA08: .4byte 0x02024332 +_0804DA0C: .4byte 0x02024064 +_0804DA10: .4byte 0x02022fec +_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, _0804DA90 + movs r5, 0xFD + strb r5, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r4, _0804DA94 + ldr r3, _0804DA98 + 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, _0804DA9C + strb r5, [r2] + movs r0, 0x7 + strb r0, [r2, 0x1] + ldr r3, _0804DAA0 + ldrb r0, [r3] + strb r0, [r2, 0x2] + ldr r1, _0804DAA4 + 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, _0804DAA8 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] +_0804DA8A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804DA90: .4byte 0x02022f58 +_0804DA94: .4byte 0x02024084 +_0804DA98: .4byte 0x0202420b +_0804DA9C: .4byte 0x02022f68 +_0804DAA0: .4byte 0x02024064 +_0804DAA4: .4byte 0x02023864 +_0804DAA8: .4byte 0x02024214 + 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, _0804DBE4 + mov r9, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804DBE8 + strb r0, [r4] + ldrb r0, [r4] + bl sub_803FA70 + ldr r1, _0804DBEC + mov r8, r1 + ldr r1, _0804DBF0 + 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, _0804DBF4 + 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, _0804DBF8 + 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, _0804DBFC + 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, _0804DC00 + 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, _0804DC04 + 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, _0804DC08 + 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, _0804DC0C + 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, _0804DC10 + str r0, [r7] + b _0804DD8E + .align 2, 0 +_0804DBE4: .4byte 0x02024214 +_0804DBE8: .4byte 0x02024064 +_0804DBEC: .4byte 0x02024280 +_0804DBF0: .4byte 0x0832a328 +_0804DBF4: .4byte 0x0202437c +_0804DBF8: .4byte 0x0202428e +_0804DBFC: .4byte 0x02024084 +_0804DC00: .4byte 0xfdffffff +_0804DC04: .4byte 0x02024294 +_0804DC08: .4byte 0x020241f0 +_0804DC0C: .4byte 0x02024474 +_0804DC10: .4byte 0x082dae90 +_0804DC14: + cmp r0, 0x1 + bne _0804DC24 + ldr r0, _0804DC20 + mov r1, r9 + str r0, [r1] + b _0804DD8E + .align 2, 0 +_0804DC20: .4byte 0x082dae59 +_0804DC24: + ldr r0, _0804DC2C + mov r2, r9 + str r0, [r2] + b _0804DD8E + .align 2, 0 +_0804DC2C: .4byte 0x082daec7 +_0804DC30: + ldr r2, _0804DD2C + ldr r1, _0804DD30 + ldrb r3, [r1] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + adds r5, r1, 0 + ldr r4, _0804DD34 + 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, _0804DD38 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r2, [r0] + ldr r1, _0804DD3C + ands r1, r2 + strh r1, [r0] + movs r4, 0 + ldr r0, _0804DD40 + ldrb r7, [r0] + cmp r4, r7 + bge _0804DCD8 + ldr r6, _0804DD44 + adds r1, r5, 0 + ldr r5, _0804DD48 + 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, _0804DD40 + ldrb r0, [r0] + cmp r4, r0 + bge _0804DD0C + ldr r6, _0804DD4C + ldr r5, _0804DD2C +_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, _0804DD40 + ldrb r0, [r0] + cmp r4, r0 + blt _0804DCE6 +_0804DD0C: + ldr r0, _0804DD50 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x5 + bne _0804DD88 + ldr r0, _0804DD54 + ldr r0, [r0] + lsrs r4, r0, 28 + ldr r1, _0804DD58 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, _0804DD5C + b _0804DD6E + .align 2, 0 +_0804DD2C: .4byte 0x02024084 +_0804DD30: .4byte 0x02024064 +_0804DD34: .4byte 0x020242bc +_0804DD38: .4byte 0x0202428e +_0804DD3C: .4byte 0x0000fdff +_0804DD40: .4byte 0x0202406c +_0804DD44: .4byte 0x0202407e +_0804DD48: .4byte 0x0202407a +_0804DD4C: .4byte 0x0202449c +_0804DD50: .4byte 0x02024214 +_0804DD54: .4byte 0x02024280 +_0804DD58: .4byte 0x0202420d +_0804DD5C: .4byte 0x0832a328 +_0804DD60: + ldr r0, _0804DDA0 + 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, _0804DDA4 + 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 + .align 2, 0 +_0804DDA0: .4byte 0x0202406c +_0804DDA4: .4byte 0x02024210 + thumb_func_end atk52_cmd52 + + thumb_func_start sub_804DDA8 +sub_804DDA8: @ 804DDA8 + push {r4,r5,lr} + ldr r5, _0804DDD0 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl battle_get_side_with_given_state + ldr r4, _0804DDD4 + 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 + .align 2, 0 +_0804DDD0: .4byte 0x02024214 +_0804DDD4: .4byte 0x02024064 + thumb_func_end sub_804DDA8 + + thumb_func_start atk54_802511C +atk54_802511C: @ 804DDD8 + push {r4,r5,lr} + ldr r5, _0804DE08 + ldr r0, _0804DE0C + ldrb r0, [r0] + strb r0, [r5] + ldr r4, _0804DE10 + 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 + .align 2, 0 +_0804DE08: .4byte 0x02024064 +_0804DE0C: .4byte 0x0202420b +_0804DE10: .4byte 0x02024214 + thumb_func_end atk54_802511C + + thumb_func_start sub_804DE14 +sub_804DE14: @ 804DE14 + push {r4,r5,lr} + ldr r5, _0804DE44 + ldr r0, _0804DE48 + ldrb r0, [r0] + strb r0, [r5] + ldr r4, _0804DE4C + 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 + .align 2, 0 +_0804DE44: .4byte 0x02024064 +_0804DE48: .4byte 0x0202420b +_0804DE4C: .4byte 0x02024214 + thumb_func_end sub_804DE14 + + thumb_func_start atk56_8025194 +atk56_8025194: @ 804DE50 + push {r4,r5,lr} + ldr r5, _0804DE78 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804DE7C + 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 + .align 2, 0 +_0804DE78: .4byte 0x02024214 +_0804DE7C: .4byte 0x02024064 + 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, _0804DEAC + strb r0, [r4] + ldr r0, _0804DEB0 + 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, _0804DEB4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804DEAC: .4byte 0x02024064 +_0804DEB0: .4byte 0x0202433a +_0804DEB4: .4byte 0x02024214 + thumb_func_end atk57_80251C4_flee + + thumb_func_start atk58_cmd58 +atk58_cmd58: @ 804DEB8 + push {r4,r5,lr} + ldr r5, _0804DEE4 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804DEE8 + 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 + .align 2, 0 +_0804DEE4: .4byte 0x02024214 +_0804DEE8: .4byte 0x02024064 + thumb_func_end atk58_cmd58 + + thumb_func_start atk59_8025230 +atk59_8025230: @ 804DEEC + push {r4-r7,lr} + ldr r0, _0804DF60 + 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, _0804DF64 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804DF68 + adds r0, r1 + ldrb r1, [r2, 0x9] + bl sub_8069318 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0804DF6C + cmp r5, r0 + bne _0804DF56 + adds r7, r5, 0 +_0804DF3A: + ldr r0, _0804DF64 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804DF68 + 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, _0804DF60 + str r4, [r0] + b _0804E018 + .align 2, 0 +_0804DF60: .4byte 0x02024214 +_0804DF64: .4byte 0x0202449c +_0804DF68: .4byte 0x020244ec +_0804DF6C: .4byte 0x0000fffe +_0804DF70: + ldr r0, _0804DF80 + cmp r5, r0 + bne _0804DF88 + ldr r1, _0804DF84 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] + b _0804E018 + .align 2, 0 +_0804DF80: .4byte 0x0000ffff +_0804DF84: .4byte 0x02024214 +_0804DF88: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _0804E020 + strb r0, [r1] + ldr r2, _0804E024 + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldr r1, _0804E028 + ldr r1, [r1] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804DFC8 + ldr r4, _0804E02C + 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, _0804E030 + 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, _0804E020 + strb r0, [r1] + ldr r2, _0804E024 + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldr r1, _0804E028 + ldr r1, [r1] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E014 + ldr r4, _0804E02C + 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, _0804E034 + str r6, [r0] +_0804E018: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804E020: .4byte 0x02024064 +_0804E024: .4byte 0x0202406e +_0804E028: .4byte 0x0202449c +_0804E02C: .4byte 0x02024084 +_0804E030: .4byte 0x02022fec +_0804E034: .4byte 0x02024214 + 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, _0804E05C + movs r1, 0 + strb r1, [r0] + ldr r0, _0804E060 + ldrb r1, [r0, 0x1F] + adds r2, r0, 0 + cmp r1, 0x6 + bls _0804E052 + b _0804E3B8 +_0804E052: + lsls r0, r1, 2 + ldr r1, _0804E064 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804E05C: .4byte 0x02024064 +_0804E060: .4byte 0x02024474 +_0804E064: .4byte _0804E068 + .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, _0804E0B0 + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, _0804E0B4 + ldrb r0, [r1, 0x1F] + adds r0, 0x1 + strb r0, [r1, 0x1F] + ldr r0, _0804E0B8 + strb r4, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804E3B8 + .align 2, 0 +_0804E0B0: .4byte 0x085ccabb +_0804E0B4: .4byte 0x02024474 +_0804E0B8: .4byte 0x02024332 +_0804E0BC: + ldr r0, _0804E148 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804E0E4 + ldr r4, _0804E14C + 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, _0804E148 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E10C + ldr r4, _0804E14C + 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, _0804E148 + 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, _0804E14C + 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 sub_80A1AD4 + b _0804E192 + .align 2, 0 +_0804E148: .4byte 0x030022c0 +_0804E14C: .4byte 0x02024332 +_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, _0804E19C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E170 + b _0804E3B8 +_0804E170: + bl Window_FreeMemory + ldr r0, _0804E1A0 + ldr r1, _0804E1A4 + ldr r1, [r1] + ldrb r1, [r1, 0x10] + ldr r2, _0804E1A8 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _0804E1AC + ldr r4, _0804E1B0 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 +_0804E192: + ldr r1, _0804E1B4 + ldrb r0, [r1, 0x1F] + adds r0, 0x1 + strb r0, [r1, 0x1F] + b _0804E3B8 + .align 2, 0 +_0804E19C: .4byte 0x02037fd4 +_0804E1A0: .4byte 0x020244ec +_0804E1A4: .4byte 0x0202449c +_0804E1A8: .4byte 0x020244e9 +_0804E1AC: .4byte sub_80A92F8 + 1 +_0804E1B0: .4byte 0x020244e2 +_0804E1B4: .4byte 0x02024474 +_0804E1B8: + ldr r0, _0804E1D8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E1C6 + b _0804E3B8 +_0804E1C6: + ldr r0, _0804E1DC + ldr r1, [r0, 0x4] + ldr r0, _0804E1E0 + cmp r1, r0 + beq _0804E1D2 + b _0804E3B8 +_0804E1D2: + ldrb r0, [r2, 0x1F] + adds r0, 0x1 + b _0804E3B6 + .align 2, 0 +_0804E1D8: .4byte 0x02037fd4 +_0804E1DC: .4byte 0x030022c0 +_0804E1E0: .4byte sub_8038420 + 1 +_0804E1E4: + ldr r0, _0804E214 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E1F2 + b _0804E3B8 +_0804E1F2: + ldr r0, _0804E218 + ldr r1, [r0, 0x4] + ldr r0, _0804E21C + 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, _0804E220 + movs r0, 0x5 + strb r0, [r1, 0x1F] + b _0804E3B8 + .align 2, 0 +_0804E214: .4byte 0x02037fd4 +_0804E218: .4byte 0x030022c0 +_0804E21C: .4byte sub_8038420 + 1 +_0804E220: .4byte 0x02024474 +_0804E224: + ldr r6, _0804E260 + 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, _0804E264 + 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, _0804E268 + ldr r1, _0804E26C + ldrb r1, [r1] + bl b_std_message + ldr r1, _0804E270 + movs r0, 0x6 + strb r0, [r1, 0x1F] + b _0804E3B8 + .align 2, 0 +_0804E260: .4byte 0x0202449c +_0804E264: .4byte 0x020244ec +_0804E268: .4byte 0x0000013f +_0804E26C: .4byte 0x02024064 +_0804E270: .4byte 0x02024474 +_0804E274: + ldr r3, _0804E368 + 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, _0804E36C + 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, _0804E370 + ldrh r1, [r7] + adds r2, r5, 0 + bl sub_80691F4 + ldr r0, _0804E374 + ldr r1, [r6] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E30A + ldr r4, _0804E378 + ldr r0, [r4, 0x50] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E30A + ldr r0, _0804E37C + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0804E380 + 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, _0804E384 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804E3B8 + ldr r2, _0804E374 + ldr r0, _0804E388 + ldr r1, [r0] + ldrh r0, [r2, 0x4] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E3B8 + ldr r4, _0804E378 + 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, _0804E37C + adds r0, 0x50 + ldrb r1, [r0] + lsrs r1, 4 + ldr r2, _0804E380 + 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, _0804E370 + ldrh r1, [r0] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8069234 + b _0804E3B8 + .align 2, 0 +_0804E368: .4byte 0x02024214 +_0804E36C: .4byte 0x02022f68 +_0804E370: .4byte 0x020244e2 +_0804E374: .4byte 0x0202406e +_0804E378: .4byte 0x02024084 +_0804E37C: .4byte 0x020242bc +_0804E380: .4byte 0x0832a328 +_0804E384: .4byte 0x02022fec +_0804E388: .4byte 0x0202449c +_0804E38C: + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r1, _0804E3A8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0804E3B8 + .align 2, 0 +_0804E3A8: .4byte 0x02024214 +_0804E3AC: + ldr r0, _0804E3C4 + 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 + .align 2, 0 +_0804E3C4: .4byte 0x02024068 + thumb_func_end sub_804E038 + + thumb_func_start atk5B_80256E0 +atk5B_80256E0: @ 804E3C8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0804E3DC + ldrb r4, [r5, 0x1F] + cmp r4, 0 + beq _0804E3E0 + cmp r4, 0x1 + beq _0804E410 + b _0804E4FA + .align 2, 0 +_0804E3DC: .4byte 0x02024474 +_0804E3E0: + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, _0804E408 + movs r1, 0xC + bl battle_show_message_maybe + ldrb r0, [r5, 0x1F] + adds r0, 0x1 + strb r0, [r5, 0x1F] + ldr r0, _0804E40C + strb r4, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804E4FA + .align 2, 0 +_0804E408: .4byte 0x085ccabb +_0804E40C: .4byte 0x02024332 +_0804E410: + ldr r0, _0804E498 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804E438 + ldr r4, _0804E49C + 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, _0804E498 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E460 + ldr r4, _0804E49C + 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, _0804E498 + 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, _0804E49C + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0804E4A4 + ldr r3, _0804E4A0 + 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 + .align 2, 0 +_0804E498: .4byte 0x030022c0 +_0804E49C: .4byte 0x02024332 +_0804E4A0: .4byte 0x02024214 +_0804E4A4: + ldr r1, _0804E4C0 + 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 + .align 2, 0 +_0804E4C0: .4byte 0x02024214 +_0804E4C4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804E4FA + movs r0, 0x5 + bl audio_play + ldr r3, _0804E504 + 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 + .align 2, 0 +_0804E504: .4byte 0x02024214 + thumb_func_end atk5B_80256E0 + + thumb_func_start atk5C_cmd5c +atk5C_cmd5c: @ 804E508 + push {r4,lr} + ldr r4, _0804E574 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, _0804E578 + strb r0, [r2] + ldr r0, _0804E57C + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804E58C + ldr r0, _0804E580 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _0804E55A + ldr r1, _0804E584 + 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, _0804E588 + 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, _0804E578 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, _0804E574 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + b _0804E592 + .align 2, 0 +_0804E574: .4byte 0x02024214 +_0804E578: .4byte 0x02024064 +_0804E57C: .4byte 0x0202427c +_0804E580: .4byte 0x02024280 +_0804E584: .4byte 0x02024084 +_0804E588: .4byte 0x020242bc +_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, _0804E5D0 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x94 + ldrb r2, [r0] + ldr r0, _0804E5D4 + ldr r0, [r0] + adds r0, 0x4A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + muls r0, r2 + b _0804E6CA + .align 2, 0 +_0804E5D0: .4byte 0x020244a8 +_0804E5D4: .4byte 0x0202449c +_0804E5D8: + ldr r0, _0804E5F4 + 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 + .align 2, 0 +_0804E5F4: .4byte 0x08310030 +_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, _0804E6A8 + lsls r0, r7, 2 + adds r4, r0, r1 + ldrb r3, [r4] + ldr r0, _0804E6AC + mov r8, r0 + mov r9, r1 + ldr r1, _0804E6B0 + 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 + .align 2, 0 +_0804E6A8: .4byte 0x0831aeb8 +_0804E6AC: .4byte 0x0202449c +_0804E6B0: .4byte 0x02022fec +_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, _0804E74C + ldrh r0, [r0] + bl sub_804E598 + adds r4, r0, 0 + ldr r0, _0804E750 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0804E6FC + ldr r0, _0804E754 + ldrh r0, [r0] + bl sub_804E598 + adds r4, r0 +_0804E6FC: + ldr r0, _0804E758 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl add_money + ldr r1, _0804E75C + 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, _0804E760 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804E74C: .4byte 0x02038bca +_0804E750: .4byte 0x02022fec +_0804E754: .4byte 0x02038bcc +_0804E758: .4byte 0x03005d8c +_0804E75C: .4byte 0x02022f58 +_0804E760: .4byte 0x02024214 + thumb_func_end sub_804E6D8 + + thumb_func_start atk5E_8025A70 +atk5E_8025A70: @ 804E764 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0804E788 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, _0804E78C + strb r0, [r6] + ldr r5, _0804E790 + ldrb r0, [r5] + mov r8, r4 + cmp r0, 0 + beq _0804E794 + cmp r0, 0x1 + beq _0804E7AC + b _0804E800 + .align 2, 0 +_0804E788: .4byte 0x02024214 +_0804E78C: .4byte 0x02024064 +_0804E790: .4byte 0x02024332 +_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, _0804E80C + ldr r0, [r0] + cmp r0, 0 + bne _0804E800 + ldrb r0, [r6] + lsls r0, 9 + ldr r1, _0804E810 + adds r0, r1 + mov r12, r0 + movs r2, 0 + adds r4, r6, 0 + movs r5, 0x58 + ldr r6, _0804E814 + 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 + .align 2, 0 +_0804E80C: .4byte 0x02024068 +_0804E810: .4byte 0x02023868 +_0804E814: .4byte 0x020240a8 + thumb_func_end atk5E_8025A70 + + thumb_func_start atk5F_8025B24 +atk5F_8025B24: @ 804E818 + push {lr} + ldr r0, _0804E840 + ldr r2, _0804E844 + ldrb r3, [r2] + strb r3, [r0] + ldr r1, _0804E848 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + ldr r2, _0804E84C + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 5 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _0804E854 + ldr r0, _0804E850 + ands r1, r0 + b _0804E856 + .align 2, 0 +_0804E840: .4byte 0x02024064 +_0804E844: .4byte 0x0202420b +_0804E848: .4byte 0x0202420c +_0804E84C: .4byte 0x02024280 +_0804E850: .4byte 0xffffefff +_0804E854: + orrs r1, r3 +_0804E856: + str r1, [r2] + ldr r1, _0804E864 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804E864: .4byte 0x02024214 + thumb_func_end atk5F_8025B24 + + thumb_func_start atk60_cmd60 +atk60_cmd60: @ 804E868 + push {lr} + ldr r0, _0804E890 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804E882 + ldr r0, _0804E894 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sav12_xor_increment +_0804E882: + ldr r1, _0804E894 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804E890: .4byte 0x0202420b +_0804E894: .4byte 0x02024214 + 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, _0804E8FC + ldr r0, [r0] + cmp r0, 0 + bne _0804E94C + ldr r0, _0804E900 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _0804E904 + strb r0, [r1] + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _0804E908 + mov r8, r1 + cmp r0, 0 + bne _0804E8CA + ldr r0, _0804E90C + 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, _0804E910 + strh r0, [r5] + movs r0, 0 + b _0804E926 + .align 2, 0 +_0804E8FC: .4byte 0x02024068 +_0804E900: .4byte 0x02024214 +_0804E904: .4byte 0x02024064 +_0804E908: .4byte 0x02024744 +_0804E90C: .4byte 0x020244ec +_0804E910: .4byte 0x0000ffff +_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, _0804E958 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, _0804E95C + 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 + .align 2, 0 +_0804E958: .4byte 0x02024064 +_0804E95C: .4byte 0x02024214 + thumb_func_end atk61_8025BA4 + + thumb_func_start atk62_08025C6C +atk62_08025C6C: @ 804E960 + push {r4,r5,lr} + ldr r5, _0804E988 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804E98C + 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 + .align 2, 0 +_0804E988: .4byte 0x02024214 +_0804E98C: .4byte 0x02024064 + thumb_func_end atk62_08025C6C + + thumb_func_start atk63_jumptoattack +atk63_jumptoattack: @ 804E990 + push {r4,lr} + ldr r0, _0804E9A8 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0 + beq _0804E9B4 + ldr r0, _0804E9AC + ldr r1, _0804E9B0 + ldrh r1, [r1] + strh r1, [r0] + b _0804E9C2 + .align 2, 0 +_0804E9A8: .4byte 0x02024214 +_0804E9AC: .4byte 0x020241ea +_0804E9B0: .4byte 0x020241ee +_0804E9B4: + ldr r2, _0804E9E0 + ldr r1, _0804E9E4 + ldr r0, _0804E9E8 + ldrh r0, [r0] + strh r0, [r1] + strh r0, [r2] + adds r0, r1, 0 +_0804E9C2: + ldr r3, _0804E9EC + ldr r2, _0804E9F0 + 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 + .align 2, 0 +_0804E9E0: .4byte 0x020241ec +_0804E9E4: .4byte 0x020241ea +_0804E9E8: .4byte 0x020241ee +_0804E9EC: .4byte 0x082d86a8 +_0804E9F0: .4byte 0x0831c898 + thumb_func_end atk63_jumptoattack + + thumb_func_start atk64_statusanimation +atk64_statusanimation: @ 804E9F4 + push {r4,lr} + ldr r0, _0804EA64 + ldr r0, [r0] + cmp r0, 0 + bne _0804EA5C + ldr r0, _0804EA68 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804EA6C + strb r0, [r4] + ldr r1, _0804EA70 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804EA74 + ands r0, r1 + cmp r0, 0 + bne _0804EA54 + ldr r0, _0804EA78 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EA54 + ldr r0, _0804EA7C + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EA54 + ldr r1, _0804EA80 + 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, _0804EA68 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804EA5C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804EA64: .4byte 0x02024068 +_0804EA68: .4byte 0x02024214 +_0804EA6C: .4byte 0x02024064 +_0804EA70: .4byte 0x020242ac +_0804EA74: .4byte 0x000400c0 +_0804EA78: .4byte 0x020242bc +_0804EA7C: .4byte 0x02024280 +_0804EA80: .4byte 0x02024084 + thumb_func_end atk64_statusanimation + + thumb_func_start atk65_8025D90 +atk65_8025D90: @ 804EA84 + push {r4,r5,lr} + ldr r0, _0804EB0C + ldr r0, [r0] + cmp r0, 0 + bne _0804EB04 + ldr r4, _0804EB10 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, _0804EB14 + 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, _0804EB18 + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804EB1C + ands r0, r1 + cmp r0, 0 + bne _0804EAFC + ldr r0, _0804EB20 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EAFC + ldr r0, _0804EB24 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EAFC + ldr r1, _0804EB28 + 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, _0804EB10 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] +_0804EB04: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0804EB0C: .4byte 0x02024068 +_0804EB10: .4byte 0x02024214 +_0804EB14: .4byte 0x02024064 +_0804EB18: .4byte 0x020242ac +_0804EB1C: .4byte 0x000400c0 +_0804EB20: .4byte 0x020242bc +_0804EB24: .4byte 0x02024280 +_0804EB28: .4byte 0x02024084 + thumb_func_end atk65_8025D90 + + thumb_func_start atk66_8025E38 +atk66_8025E38: @ 804EB2C + push {r4,r5,lr} + ldr r0, _0804EBA4 + ldr r0, [r0] + cmp r0, 0 + bne _0804EB9E + ldr r4, _0804EBA8 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, _0804EBAC + 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, _0804EBB0 + ldrb r3, [r5] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _0804EBB4 + ands r0, r1 + cmp r0, 0 + bne _0804EB96 + ldr r0, _0804EBB8 + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EB96 + ldr r0, _0804EBBC + 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, _0804EBA8 + ldr r0, [r1] + adds r0, 0x7 + str r0, [r1] +_0804EB9E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0804EBA4: .4byte 0x02024068 +_0804EBA8: .4byte 0x02024214 +_0804EBAC: .4byte 0x02024064 +_0804EBB0: .4byte 0x020242ac +_0804EBB4: .4byte 0x000400c0 +_0804EBB8: .4byte 0x020242bc +_0804EBBC: .4byte 0x02024280 + thumb_func_end atk66_8025E38 + + thumb_func_start atk67_8025ECC +atk67_8025ECC: @ 804EBC0 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0804EBD4 + ldrb r4, [r5] + cmp r4, 0 + beq _0804EBD8 + cmp r4, 0x1 + beq _0804EC04 + b _0804EC96 + .align 2, 0 +_0804EBD4: .4byte 0x02024332 +_0804EBD8: + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, _0804EC00 + 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 + .align 2, 0 +_0804EC00: .4byte 0x085ccabb +_0804EC04: + ldr r0, _0804EC68 + 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, _0804EC68 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804EC52 + ldr r4, _0804EC6C + 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, _0804EC68 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804EC70 + ldr r0, _0804EC6C + movs r4, 0x1 + strb r4, [r0, 0x1] + b _0804EC7A + .align 2, 0 +_0804EC68: .4byte 0x030022c0 +_0804EC6C: .4byte 0x02024332 +_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, _0804ECA0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804EC96: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0804ECA0: .4byte 0x02024214 + thumb_func_end atk67_8025ECC + + thumb_func_start sub_804ECA4 +sub_804ECA4: @ 804ECA4 + push {r4,r5,lr} + movs r1, 0 + ldr r2, _0804ECD0 + ldr r5, _0804ECD4 + ldrb r0, [r2] + cmp r1, r0 + bge _0804ECC2 + ldr r4, _0804ECD8 + 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 + .align 2, 0 +_0804ECD0: .4byte 0x0202406c +_0804ECD4: .4byte 0x02024214 +_0804ECD8: .4byte 0x0202407a + thumb_func_end sub_804ECA4 + + thumb_func_start atk69_8025FE0 +atk69_8025FE0: @ 804ECDC + push {r4-r7,lr} + ldr r7, _0804ED04 + ldr r6, _0804ED08 + 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, _0804ED0C + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _0804ED2A + .align 2, 0 +_0804ED04: .4byte 0x02024084 +_0804ED08: .4byte 0x0202420c +_0804ED0C: .4byte 0x02024404 +_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, _0804EDEC + ldr r5, _0804EDF0 + 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, _0804EDF4 + 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, _0804EDF8 + ldr r3, _0804EDF0 + 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, _0804EDFC + ldr r0, _0804EE00 + 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, _0804EE04 + lsls r1, r4, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0804EDBA + ldr r0, _0804EDF4 + 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, _0804EE08 + ldr r0, [r2] + cmp r1, r0 + bgt _0804EE38 + subs r0, r1, 0x1 + str r0, [r2] + ldr r1, _0804EE04 + ldrb r3, [r3] + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _0804EE10 + ldr r0, _0804EE0C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804EE38 + .align 2, 0 +_0804EDEC: .4byte 0x0202420f +_0804EDF0: .4byte 0x0202420c +_0804EDF4: .4byte 0x0202437c +_0804EDF8: .4byte 0x02024084 +_0804EDFC: .4byte 0x0831c898 +_0804EE00: .4byte 0x020241ea +_0804EE04: .4byte 0x0202433c +_0804EE08: .4byte 0x020241f0 +_0804EE0C: .4byte 0x0202427c +_0804EE10: + ldr r0, _0804EE48 + 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, _0804EE4C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _0804EE50 + adds r0, r3, 0 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_0804EE38: + ldr r1, _0804EE54 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804EE48: .4byte 0x0202437c +_0804EE4C: .4byte 0x0202427c +_0804EE50: .4byte 0x02024208 +_0804EE54: .4byte 0x02024214 + 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, _0804EEB8 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, _0804EEBC + strb r0, [r5] + ldr r1, _0804EEC0 + ldrb r4, [r5] + lsls r0, r4, 1 + adds r0, 0xB8 + ldr r1, [r1] + adds r1, r0 + ldr r2, _0804EEC4 + 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 + .align 2, 0 +_0804EEB8: .4byte 0x02024214 +_0804EEBC: .4byte 0x02024064 +_0804EEC0: .4byte 0x0202449c +_0804EEC4: .4byte 0x02024084 + thumb_func_end atk6A_stash_item_for_side + + thumb_func_start atk6B_end_battle_80261CC +atk6B_end_battle_80261CC: @ 804EEC8 + ldr r1, _0804EEF4 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, _0804EEF8 + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, _0804EEFC + 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, _0804EF00 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_0804EEF4: .4byte 0x02022f58 +_0804EEF8: .4byte 0x0202420b +_0804EEFC: .4byte 0x0202406e +_0804EF00: .4byte 0x02024214 + thumb_func_end atk6B_end_battle_80261CC + + thumb_func_start atk6C_8026208 +atk6C_8026208: @ 804EF04 + push {r4,lr} + sub sp, 0x4 + ldr r0, _0804EF20 + 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 + .align 2, 0 +_0804EF20: .4byte 0x02024474 +_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, _0804EF3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804EF3C: .4byte _0804EF40 + .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, _0804EF8C + movs r0, 0x60 + strh r0, [r1] + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + bl gpu_sync_bg_show + bl sub_804F17C + ldr r1, _0804EF90 + movs r0, 0x2 + strb r0, [r1, 0x1E] + b _0804F0F2 + .align 2, 0 +_0804EF8C: .4byte 0x02022e1e +_0804EF90: .4byte 0x02024474 +_0804EF94: + bl sub_804F1CC + lsls r0, 24 + cmp r0, 0 + beq _0804EFA0 + b _0804F0F2 +_0804EFA0: + ldr r1, _0804EFA8 + movs r0, 0x3 + strb r0, [r1, 0x1E] + b _0804F0F2 + .align 2, 0 +_0804EFA8: .4byte 0x02024474 +_0804EFAC: + ldr r1, _0804EFF4 + movs r0, 0 + strh r0, [r1] + ldr r1, _0804EFF8 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x80 + str r0, [sp] + movs r0, 0x12 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0x13 + bl sub_8056A3C + ldr r1, _0804EFFC + movs r0, 0x4 + strb r0, [r1, 0x1E] + b _0804F0F2 + .align 2, 0 +_0804EFF4: .4byte 0x02022e18 +_0804EFF8: .4byte 0x02022e1a +_0804EFFC: .4byte 0x02024474 +_0804F000: + bl sub_804F100 + movs r0, 0xD + bl Window_WriteStandardTileMap + movs r0, 0xD + movs r1, 0x3 + bl Window_CopyToVram + b _0804F06A +_0804F014: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0804F0F2 + ldr r0, _0804F028 + strh r1, [r0] + b _0804F06A + .align 2, 0 +_0804F028: .4byte 0x02022e1a +_0804F02C: + ldr r0, _0804F048 + 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 Window_CopyToVram + b _0804F06A + .align 2, 0 +_0804F048: .4byte 0x030022c0 +_0804F04C: + ldr r0, _0804F074 + 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, _0804F078 + ldrb r0, [r1, 0x1E] + adds r0, 0x1 + strb r0, [r1, 0x1E] + b _0804F0F2 + .align 2, 0 +_0804F074: .4byte 0x030022c0 +_0804F078: .4byte 0x02024474 +_0804F07C: + bl sub_804F344 + lsls r0, 24 + cmp r0, 0 + bne _0804F0F2 + movs r0, 0xE + bl Window_FillTileMap + movs r0, 0xE + movs r1, 0x1 + bl Window_CopyToVram + movs r0, 0xD + bl Window_FillTileMap + movs r0, 0xD + movs r1, 0x1 + bl Window_CopyToVram + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r1, _0804F0BC + movs r0, 0xA + strb r0, [r1, 0x1E] + b _0804F0F2 + .align 2, 0 +_0804F0BC: .4byte 0x02024474 +_0804F0C0: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0804F0F2 + movs r0, 0 + movs r1, 0x7 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + ldr r1, _0804F0FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804F0F2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804F0FC: .4byte 0x02024214 + thumb_func_end atk6C_8026208 + + thumb_func_start sub_804F100 +sub_804F100: @ 804F100 + push {lr} + sub sp, 0x14 + ldr r0, _0804F138 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804F13C + adds r0, r1 + add r1, sp, 0x8 + bl sub_81D388C + ldr r0, _0804F140 + 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 + .align 2, 0 +_0804F138: .4byte 0x0202449c +_0804F13C: .4byte 0x020244ec +_0804F140: .4byte 0x020244a8 + thumb_func_end sub_804F100 + + thumb_func_start sub_804F144 +sub_804F144: @ 804F144 + push {lr} + sub sp, 0x10 + ldr r0, _0804F174 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0804F178 + 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 + .align 2, 0 +_0804F174: .4byte 0x0202449c +_0804F178: .4byte 0x020244ec + thumb_func_end sub_804F144 + + thumb_func_start sub_804F17C +sub_804F17C: @ 804F17C + push {lr} + ldr r1, _0804F1BC + movs r0, 0 + strh r0, [r1] + ldr r1, _0804F1C0 + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0804F1C4 + movs r1, 0x60 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0804F1C8 + movs r0, 0xE + movs r2, 0 + movs r3, 0 + bl Window_CopyToPixels + movs r0, 0xE + bl Window_WriteStandardTileMap + movs r0, 0xE + movs r1, 0x3 + bl Window_CopyToVram + bl sub_804F384 + pop {r0} + bx r0 + .align 2, 0 +_0804F1BC: .4byte 0x02022e1e +_0804F1C0: .4byte 0x02022e1c +_0804F1C4: .4byte 0x0831c2c8 +_0804F1C8: .4byte 0x0831c2e8 + thumb_func_end sub_804F17C + + thumb_func_start sub_804F1CC +sub_804F1CC: @ 804F1CC + push {r4,r5,lr} + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + beq _0804F1DC + movs r0, 0x1 + b _0804F216 +_0804F1DC: + ldr r4, _0804F1EC + ldrh r1, [r4] + movs r5, 0x80 + lsls r5, 2 + cmp r1, r5 + bne _0804F1F0 + movs r0, 0 + b _0804F216 + .align 2, 0 +_0804F1EC: .4byte 0x02022e1c +_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, _0804F21C + 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 + .align 2, 0 +_0804F21C: .4byte 0x01ff0000 + 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, _0804F2F4 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0804F2F8 + 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, _0804F2FC + adds r1, r5, 0 + bl sub_81B1B44 + 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 remo_copy + 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 decimal_int_to_string + adds r5, r0, 0 + subs r4, r5, r4 + movs r2, 0x4 + subs r2, r4 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0x77 + bl sub_80090FC + adds r5, r0, 0 + cmp r7, 0xFF + beq _0804F320 + cmp r7, 0 + bne _0804F300 + movs r1, 0 + movs r2, 0xC + bl sub_80091EC + adds r5, r0, 0 + movs r1, 0x1 + movs r2, 0xD + bl sub_80091EC + adds r5, r0, 0 + movs r0, 0xB5 + b _0804F318 + .align 2, 0 +_0804F2F4: .4byte 0x0202449c +_0804F2F8: .4byte 0x020244ec +_0804F2FC: .4byte 0x02021fc4 +_0804F300: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xE + bl sub_80091EC + adds r5, r0, 0 + movs r1, 0x1 + movs r2, 0xF + bl sub_80091EC + 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 remo_copy + movs r0, 0xE + movs r1, 0x2 + bl Window_CopyToVram + 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, _0804F358 + ldrh r1, [r0] + movs r3, 0xD0 + lsls r3, 1 + adds r2, r0, 0 + cmp r1, r3 + bne _0804F35C + movs r0, 0 + b _0804F380 + .align 2, 0 +_0804F358: .4byte 0x02022e1c +_0804F35C: + ldrh r0, [r2] + adds r1, r0, 0 + subs r1, 0x10 + ldr r0, _0804F36C + cmp r1, r0 + bgt _0804F370 + strh r3, [r2] + b _0804F372 + .align 2, 0 +_0804F36C: .4byte 0x0000019f +_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, _0804F42C + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0804F430 + 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, _0804F434 + ldr r0, [sp, 0x4] + ands r0, r5 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + ldr r1, _0804F438 + ands r0, r1 + ldr r1, _0804F43C + 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, _0804F440 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _0804F444 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0xA + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0804F448 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, _0804F44C + ldrh r0, [r0] + strh r0, [r1, 0x30] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804F42C: .4byte 0x0202449c +_0804F430: .4byte 0x020244ec +_0804F434: .4byte 0xffff0000 +_0804F438: .4byte 0x0000ffff +_0804F43C: .4byte 0xd75a0000 +_0804F440: .4byte 0x0000d75a +_0804F444: .4byte 0x0831c3c0 +_0804F448: .4byte 0x02020630 +_0804F44C: .4byte 0x02022e1c + thumb_func_end sub_804F384 + + thumb_func_start sub_804F450 +sub_804F450: @ 804F450 + push {r4,lr} + adds r2, r0, 0 + ldr r0, _0804F46C + 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 + .align 2, 0 +_0804F46C: .4byte 0x02022e1c +_0804F470: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0804F48C + adds r0, r2, 0 + bl obj_delete_and_free_tiles + ldr r4, _0804F494 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag +_0804F48C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804F494: .4byte 0x0000d75a + thumb_func_end sub_804F450 + + thumb_func_start sub_804F498 +sub_804F498: @ 804F498 + push {lr} + ldr r3, _0804F4C0 + ldr r0, _0804F4C4 + ldr r0, [r0] + ldrh r1, [r3] + ldrb r2, [r0, 0x10] + cmp r1, r2 + beq _0804F4BA + ldr r0, _0804F4C8 + 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 + .align 2, 0 +_0804F4C0: .4byte 0x0202406e +_0804F4C4: .4byte 0x0202449c +_0804F4C8: .4byte 0x02022fec +_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, _0804F4E8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804F4E8: .4byte 0x02024214 + 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, _0804F504 + strb r0, [r1] + ldr r1, _0804F508 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804F504: .4byte 0x0202420b +_0804F508: .4byte 0x02024214 + thumb_func_end atk6E_state0_side_becomes_attacker + + thumb_func_start atk6F_8026810 +atk6F_8026810: @ 804F50C + push {r4,r5,lr} + ldr r5, _0804F538 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _0804F53C + 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 + .align 2, 0 +_0804F538: .4byte 0x02024214 +_0804F53C: .4byte 0x02024064 + 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, _0804F568 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _0804F56C + strb r0, [r1] + ldrb r0, [r1] + ldr r1, _0804F570 + 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 + .align 2, 0 +_0804F568: .4byte 0x02024214 +_0804F56C: .4byte 0x02024064 +_0804F570: .4byte 0x0202420a + thumb_func_end atk70_record_ability_usage_of_side + + thumb_func_start sub_804F574 +sub_804F574: @ 804F574 + ldr r2, _0804F594 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x2 + strb r0, [r2, 0x1] + ldr r0, _0804F598 + 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 + .align 2, 0 +_0804F594: .4byte 0x02022f68 +_0804F598: .4byte 0x020244e2 + thumb_func_end sub_804F574 + + thumb_func_start atk71_80268A0 +atk71_80268A0: @ 804F59C + push {lr} + bl sub_804F574 + ldr r1, _0804F5B0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804F5B0: .4byte 0x02024214 + thumb_func_end atk71_80268A0 + + thumb_func_start atk72_flee +atk72_flee: @ 804F5B4 + push {lr} + ldr r0, _0804F5E0 + ldrb r0, [r0] + bl sub_803EC20 + lsls r0, 24 + cmp r0, 0 + beq _0804F5E8 + ldr r3, _0804F5E4 + 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 + .align 2, 0 +_0804F5E0: .4byte 0x0202420d +_0804F5E4: .4byte 0x02024214 +_0804F5E8: + ldr r1, _0804F5F4 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804F5F0: + pop {r0} + bx r0 + .align 2, 0 +_0804F5F4: .4byte 0x02024214 + thumb_func_end atk72_flee + + thumb_func_start atk73_cmd73 +atk73_cmd73: @ 804F5F8 + push {r4-r6,lr} + ldr r0, _0804F648 + ldr r4, [r0] + movs r6, 0x1 + ands r4, r6 + cmp r4, 0 + bne _0804F68E + ldr r0, _0804F64C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _0804F650 + strb r0, [r1] + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0804F654 + 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, _0804F658 + ldr r0, [r0] + adds r0, 0xB1 + strb r4, [r0] + b _0804F68E + .align 2, 0 +_0804F648: .4byte 0x02022fec +_0804F64C: .4byte 0x02024214 +_0804F650: .4byte 0x02024064 +_0804F654: .4byte 0x02024084 +_0804F658: .4byte 0x0202449c +_0804F65C: + cmp r0, 0x27 + ble _0804F670 + ldr r0, _0804F66C + ldr r0, [r0] + adds r0, 0xB1 + strb r6, [r0] + b _0804F68E + .align 2, 0 +_0804F66C: .4byte 0x0202449c +_0804F670: + cmp r0, 0x9 + ble _0804F684 + ldr r0, _0804F680 + ldr r0, [r0] + adds r0, 0xB1 + movs r1, 0x2 + b _0804F68C + .align 2, 0 +_0804F680: .4byte 0x0202449c +_0804F684: + ldr r0, _0804F69C + ldr r0, [r0] + adds r0, 0xB1 + movs r1, 0x3 +_0804F68C: + strb r1, [r0] +_0804F68E: + ldr r1, _0804F6A0 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804F69C: .4byte 0x0202449c +_0804F6A0: .4byte 0x02024214 + 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, _0804F708 + ldr r7, [r0] + movs r0, 0x1 + mov r8, r0 + ands r7, r0 + cmp r7, 0 + bne _0804F73E + ldr r0, _0804F70C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + adds r4, r0, 0 + ldr r0, _0804F710 + 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, _0804F714 + ldr r6, [r1] + lsrs r0, 23 + adds r0, r6 + adds r0, 0xA8 + ldrb r5, [r0] + ldr r1, _0804F718 + 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 + .align 2, 0 +_0804F708: .4byte 0x02022fec +_0804F70C: .4byte 0x02024214 +_0804F710: .4byte 0x02024064 +_0804F714: .4byte 0x0202449c +_0804F718: .4byte 0x02024084 +_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, _0804F750 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804F750: .4byte 0x02024214 + thumb_func_end atk74_hp_tresholds_2 + + thumb_func_start atk75_8026A58 +atk75_8026A58: @ 804F754 + push {lr} + sub sp, 0x4 + ldr r2, _0804F794 + ldr r1, _0804F798 + ldrb r0, [r1] + strb r0, [r2] + ldr r2, _0804F79C + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r1, _0804F7A0 + adds r0, r1 + ldr r1, _0804F7A4 + ldrh r1, [r1] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x1 + str r3, [sp] + movs r3, 0 + bl sub_806BD28 + ldr r1, _0804F7A8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0804F794: .4byte 0x020244b8 +_0804F798: .4byte 0x0202420b +_0804F79C: .4byte 0x0202406e +_0804F7A0: .4byte 0x02024744 +_0804F7A4: .4byte 0x02024208 +_0804F7A8: .4byte 0x02024214 + thumb_func_end atk75_8026A58 + + thumb_func_start sub_804F7AC +sub_804F7AC: @ 804F7AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0804F7D4 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _0804F7D8 + strb r0, [r1] + ldr r0, [r4] + ldrb r0, [r0, 0x2] + cmp r0, 0x1A + bls _0804F7CA + b _0804FD70 +_0804F7CA: + lsls r0, 2 + ldr r1, _0804F7DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804F7D4: .4byte 0x02024214 +_0804F7D8: .4byte 0x02024064 +_0804F7DC: .4byte _0804F7E0 + .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, _0804F858 + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + b _0804FD70 + .align 2, 0 +_0804F858: .4byte 0x02024064 +_0804F85C: + ldr r1, _0804F898 + ldr r4, _0804F89C + 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, _0804F8A0 + 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, _0804F8A4 + 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 + .align 2, 0 +_0804F898: .4byte 0x0202420b +_0804F89C: .4byte 0x0202420c +_0804F8A0: .4byte 0x02024294 +_0804F8A4: .4byte 0x02024084 +_0804F8A8: + ldr r0, _0804F8B4 + ldr r1, _0804F8B8 + ldrb r1, [r1] + strb r1, [r0] + b _0804FD70 + .align 2, 0 +_0804F8B4: .4byte 0x0202420c +_0804F8B8: .4byte 0x02024064 +_0804F8BC: + bl sub_803BB88 + ldr r1, _0804F8C8 + strb r0, [r1] + b _0804FD70 + .align 2, 0 +_0804F8C8: .4byte 0x02024332 +_0804F8CC: + ldr r0, _0804F8DC + ldrh r0, [r0] + movs r1, 0 + bl sub_80458E0 + ldr r1, _0804F8E0 + strb r0, [r1] + b _0804FD70 + .align 2, 0 +_0804F8DC: .4byte 0x020241ea +_0804F8E0: .4byte 0x0202420c +_0804F8E4: + ldr r2, _0804F904 + ldr r1, _0804F908 + ldr r0, _0804F90C + 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, _0804F910 + movs r0, 0x1 + strb r0, [r1] + b _0804FD70 + .align 2, 0 +_0804F904: .4byte 0x02024280 +_0804F908: .4byte 0x0832a328 +_0804F90C: .4byte 0x02024064 +_0804F910: .4byte 0x02024332 +_0804F914: + ldr r0, _0804F91C + strb r2, [r0] + b _0804FD70 + .align 2, 0 +_0804F91C: .4byte 0x02024332 +_0804F920: + ldr r4, _0804F950 + ldr r3, _0804F954 + 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 + .align 2, 0 +_0804F950: .4byte 0x0202437c +_0804F954: .4byte 0x02024064 +_0804F958: + ldr r4, _0804F97C + ldr r1, _0804F980 + 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, _0804F984 + movs r0, 0 + b _0804F98C + .align 2, 0 +_0804F97C: .4byte 0x0202406e +_0804F980: .4byte 0x0202449c +_0804F984: .4byte 0x02024064 +_0804F988: + ldr r1, _0804F9D8 + 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, _0804F9DC + 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 + .align 2, 0 +_0804F9D8: .4byte 0x02024064 +_0804F9DC: .4byte 0x02024084 +_0804F9E0: + ldr r0, _0804FA10 + ldr r0, [r0] + movs r1, 0xB + ands r0, r1 + cmp r0, 0x8 + beq _0804F9EE + b _0804FD70 +_0804F9EE: + ldr r1, _0804FA14 + 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, _0804FA18 + ldr r1, [r0] + ldr r2, _0804FA1C + ands r1, r2 + str r1, [r0] + b _0804FD70 + .align 2, 0 +_0804FA10: .4byte 0x02022fec +_0804FA14: .4byte 0x02024084 +_0804FA18: .4byte 0x02024280 +_0804FA1C: .4byte 0xffbfffff +_0804FA20: + ldr r2, _0804FAB0 + mov r8, r2 + movs r0, 0 + strb r0, [r2] + ldr r1, _0804FAB4 + ldr r6, _0804FAB8 + ldrb r0, [r2, 0x1] + strb r0, [r6] + strb r0, [r1, 0x17] + ldr r0, _0804FABC + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x92 + ldrb r3, [r7] + ldr r1, _0804FAC0 + 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, _0804FAC4 + 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 getNature + ldr r1, _0804FAC8 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r0, [r0] + mov r2, r8 + strb r0, [r2, 0x5] + b _0804FD70 + .align 2, 0 +_0804FAB0: .4byte 0x02024332 +_0804FAB4: .4byte 0x02024474 +_0804FAB8: .4byte 0x02024064 +_0804FABC: .4byte 0x0202449c +_0804FAC0: .4byte 0x0832a328 +_0804FAC4: .4byte 0x02024084 +_0804FAC8: .4byte 0x0831c4f8 +_0804FACC: + ldr r4, _0804FAE4 + 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 + .align 2, 0 +_0804FAE4: .4byte 0x02024332 +_0804FAE8: + ldr r0, _0804FB20 + adds r0, 0x80 + movs r1, 0 + strh r1, [r0] + ldr r2, _0804FB24 + ldr r3, _0804FB28 + ldr r1, [r3, 0x4] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, _0804FB2C + ldr r2, [r0] + ldr r0, _0804FB30 + adds r2, r0 + ldr r0, _0804FB34 + ldrh r0, [r0, 0x2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, _0804FB38 + adds r1, 0x34 + ldrb r0, [r1] + movs r2, 0x2 + b _0804FBF4 + .align 2, 0 +_0804FB20: .4byte 0x02024084 +_0804FB24: .4byte 0x02024280 +_0804FB28: .4byte 0x0832a328 +_0804FB2C: .4byte 0x0202449c +_0804FB30: .4byte 0x000002a1 +_0804FB34: .4byte 0x0202406e +_0804FB38: .4byte 0x020242bc +_0804FB3C: + ldr r1, _0804FB7C + movs r0, 0 + strh r0, [r1, 0x28] + ldr r2, _0804FB80 + ldr r3, _0804FB84 + 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, _0804FB88 + ldr r2, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r2, r1 + ldr r0, _0804FB8C + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, _0804FB90 + ldrb r0, [r2, 0x18] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x18] + b _0804FD70 + .align 2, 0 +_0804FB7C: .4byte 0x02024084 +_0804FB80: .4byte 0x02024280 +_0804FB84: .4byte 0x0832a328 +_0804FB88: .4byte 0x0202449c +_0804FB8C: .4byte 0x0202406e +_0804FB90: .4byte 0x020242bc +_0804FB94: + ldr r0, _0804FBFC + movs r1, 0 + strh r1, [r0, 0x28] + adds r0, 0x80 + strh r1, [r0] + ldr r2, _0804FC00 + ldr r3, _0804FC04 + 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, _0804FC08 + ldr r2, [r5] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + ldr r4, _0804FC0C + 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, _0804FC10 + 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, _0804FC14 + 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 + .align 2, 0 +_0804FBFC: .4byte 0x02024084 +_0804FC00: .4byte 0x02024280 +_0804FC04: .4byte 0x0832a328 +_0804FC08: .4byte 0x0202449c +_0804FC0C: .4byte 0x0202406e +_0804FC10: .4byte 0x000002a1 +_0804FC14: .4byte 0x020242bc +_0804FC18: + movs r0, 0 + bl sub_8033E10 + ldr r0, _0804FC28 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0804FD70 + .align 2, 0 +_0804FC28: .4byte 0x02024064 +_0804FC2C: + bl sub_81A5BF8 + b _0804FD70 +_0804FC32: + bl sub_81A5D44 + b _0804FD70 +_0804FC38: + ldr r1, _0804FC54 + ldr r0, _0804FC58 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r0, _0804FC5C + movs r1, 0x16 + bl battle_show_message_maybe + b _0804FD70 + .align 2, 0 +_0804FC54: .4byte 0x085cd1c8 +_0804FC58: .4byte 0x02024214 +_0804FC5C: .4byte 0x02022e2c +_0804FC60: + movs r0, 0x16 + bl a_pressed_maybe + 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, _0804FC84 + movs r0, 0x1 + strb r0, [r4] + ldr r0, _0804FC88 + adds r0, 0x58 + b _0804FCA2 + .align 2, 0 +_0804FC84: .4byte 0x02024064 +_0804FC88: .4byte 0x02024084 +_0804FC8C: + ldr r0, _0804FCB8 + ldrb r0, [r0] + cmp r0, 0x3 + bls _0804FD70 + ldr r4, _0804FCBC + movs r0, 0x3 + strb r0, [r4] + ldr r0, _0804FCC0 + 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 + .align 2, 0 +_0804FCB8: .4byte 0x0202406c +_0804FCBC: .4byte 0x02024064 +_0804FCC0: .4byte 0x02024084 +_0804FCC4: + ldr r0, _0804FCD0 + ldr r1, _0804FCD4 + movs r2, 0x55 + bl MPlayVolumeControl + b _0804FD70 + .align 2, 0 +_0804FCD0: .4byte 0x03007420 +_0804FCD4: .4byte 0x0000ffff +_0804FCD8: + ldr r0, _0804FCE8 + ldr r1, _0804FCEC + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + b _0804FD70 + .align 2, 0 +_0804FCE8: .4byte 0x03007420 +_0804FCEC: .4byte 0x0000ffff +_0804FCF0: + ldr r0, _0804FD0C + ldr r2, [r0] + ldr r0, _0804FD10 + adds r2, r0 + ldr r1, _0804FD14 + ldr r0, _0804FD18 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + b _0804FD70 + .align 2, 0 +_0804FD0C: .4byte 0x0202449c +_0804FD10: .4byte 0x000002a2 +_0804FD14: .4byte 0x0832a328 +_0804FD18: .4byte 0x02024064 +_0804FD1C: + ldr r0, _0804FD2C + ldrb r0, [r0] + bl sub_805725C +_0804FD24: + cmp r0, 0 + bne _0804FD78 + b _0804FD70 + .align 2, 0 +_0804FD2C: .4byte 0x02024064 +_0804FD30: + ldr r0, _0804FD48 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804FD50 + ldr r1, _0804FD4C + movs r0, 0x5 + strb r0, [r1] + b _0804FD70 + .align 2, 0 +_0804FD48: .4byte 0x02024064 +_0804FD4C: .4byte 0x0202433a +_0804FD50: + ldr r1, _0804FD58 + movs r0, 0xA + strb r0, [r1] + b _0804FD70 + .align 2, 0 +_0804FD58: .4byte 0x0202433a +_0804FD5C: + movs r1, 0xCE + lsls r1, 1 + movs r0, 0 + movs r2, 0x1 + bl sub_8034300 + ldr r0, _0804FD84 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804FD70: + ldr r1, _0804FD88 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] +_0804FD78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FD84: .4byte 0x02024064 +_0804FD88: .4byte 0x02024214 + 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, _0804FE58 + ldr r1, _0804FE5C + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldrh r0, [r0] + mov r8, r1 + ldr r7, _0804FE60 + 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, _0804FE64 + ldrb r1, [r0] + ldr r0, _0804FE68 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0804FDCC + movs r6, 0 +_0804FDCC: + ldr r2, _0804FE6C + 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, _0804FE70 + ldr r3, _0804FE74 + 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, _0804FE78 + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r1, _0804FE7C + 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, _0804FE78 + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r1, _0804FE7C + 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 + .align 2, 0 +_0804FE58: .4byte 0x02024260 +_0804FE5C: .4byte 0x0202420b +_0804FE60: .4byte 0x020242bc +_0804FE64: .4byte 0x02024082 +_0804FE68: .4byte 0x0202406c +_0804FE6C: .4byte 0x0831c3d8 +_0804FE70: .4byte 0x0831c898 +_0804FE74: .4byte 0x020241ea +_0804FE78: .4byte 0x0202433c +_0804FE7C: .4byte 0x02024332 +_0804FE80: + ldr r2, _0804FEB4 + ldr r0, _0804FEB8 + 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, _0804FEBC + movs r0, 0x2 + strb r0, [r1, 0x5] + ldr r2, _0804FEC0 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0804FEA2: + ldr r1, _0804FEC4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FEB4: .4byte 0x020242bc +_0804FEB8: .4byte 0x0202420b +_0804FEBC: .4byte 0x02024332 +_0804FEC0: .4byte 0x0202427c +_0804FEC4: .4byte 0x02024214 + thumb_func_end atk77_setprotect + + thumb_func_start atk78_faintifabilitynotdamp +atk78_faintifabilitynotdamp: @ 804FEC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0804FF84 + ldr r2, [r0] + cmp r2, 0 + bne _0804FFCC + ldr r1, _0804FF88 + strb r2, [r1] + ldr r0, _0804FF8C + ldrb r3, [r0] + adds r5, r1, 0 + mov r8, r0 + ldr r6, _0804FF90 + 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, _0804FF94 + ldr r7, _0804FF98 + ldrb r0, [r7] + strb r0, [r4] + ldr r2, _0804FF9C + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r6 + ldrh r0, [r0, 0x28] + str r0, [r2] + ldr r1, _0804FFA0 + 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, _0804FFA4 + 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, _0804FFA8 + adds r4, r0, 0 + ldr r6, _0804FFAC +_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 + .align 2, 0 +_0804FF84: .4byte 0x02024068 +_0804FF88: .4byte 0x0202420c +_0804FF8C: .4byte 0x0202406c +_0804FF90: .4byte 0x02024084 +_0804FF94: .4byte 0x02024064 +_0804FF98: .4byte 0x0202420b +_0804FF9C: .4byte 0x020241f0 +_0804FFA0: .4byte 0x00007fff +_0804FFA4: .4byte 0x02024214 +_0804FFA8: .4byte 0x0832a328 +_0804FFAC: .4byte 0x02024210 +_0804FFB0: + ldr r1, _0804FFD8 + 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, _0804FFDC + ldr r0, _0804FFE0 + str r0, [r1] +_0804FFCC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FFD8: .4byte 0x0202420a +_0804FFDC: .4byte 0x02024214 +_0804FFE0: .4byte 0x082db560 + thumb_func_end atk78_faintifabilitynotdamp + + thumb_func_start atk79_setuserhptozero +atk79_setuserhptozero: @ 804FFE4 + push {r4,lr} + sub sp, 0x4 + ldr r0, _08050030 + ldr r3, [r0] + cmp r3, 0 + bne _08050028 + ldr r4, _08050034 + ldr r0, _08050038 + ldrb r0, [r0] + strb r0, [r4] + ldr r1, _0805003C + 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, _08050040 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08050028: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08050030: .4byte 0x02024068 +_08050034: .4byte 0x02024064 +_08050038: .4byte 0x0202420b +_0805003C: .4byte 0x02024084 +_08050040: .4byte 0x02024214 + thumb_func_end atk79_setuserhptozero + + thumb_func_start sub_8050044 +sub_8050044: @ 8050044 + push {r4-r7,lr} + ldr r3, _080500BC + 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, _080500C0 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _080500DC + ldr r0, _080500C4 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, _080500C8 + lsls r1, 24 + lsrs r1, 24 + adds r3, r0, 0 + ldr r6, _080500CC + ldr r5, _080500D0 + ldr r0, _080500D4 + 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 + .align 2, 0 +_080500BC: .4byte 0x02024214 +_080500C0: .4byte 0x02022fec +_080500C4: .4byte 0x0202420c +_080500C8: .4byte 0x0202420b +_080500CC: .4byte 0x02024210 +_080500D0: .4byte 0x0832a328 +_080500D4: .4byte 0x0202406c +_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, _08050144 + 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, _08050148 + cmp r0, 0x1 + bne _08050110 + ldr r0, _0805014C + ldrb r0, [r0] + strb r0, [r3] +_08050110: + ldr r1, _08050150 + ldr r6, _08050154 + 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 + .align 2, 0 +_08050144: .4byte 0x02024214 +_08050148: .4byte 0x0202420c +_0805014C: .4byte 0x0202420b +_08050150: .4byte 0x020241f0 +_08050154: .4byte 0x02024084 +_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, _08050204 + ldr r0, _08050208 + 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, _08050208 + ldrb r6, [r0] + ldr r2, _0805020C + mov r9, r2 + lsls r4, r6, 3 + mov r2, sp + ldr r0, _08050210 + 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, _08050210 + 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, _0805020C + cmp r3, r0 + beq _08050220 + ldr r2, _08050214 + ldr r0, [r2] + ldr r1, _08050218 + ands r0, r1 + str r0, [r2] + ldr r4, _0805021C + strh r3, [r4] + b _0805024A + .align 2, 0 +_08050204: .4byte 0x0202406c +_08050208: .4byte 0x0202420b +_0805020C: .4byte 0x0000ffff +_08050210: .4byte 0x0202449c +_08050214: .4byte 0x02024280 +_08050218: .4byte 0xfffffbff +_0805021C: .4byte 0x020241ea +_08050220: + mov r0, r8 + cmp r0, 0 + beq _08050290 + ldr r2, _08050274 + ldr r0, [r2] + ldr r1, _08050278 + 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, _0805027C + 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, _08050280 + strb r0, [r1] + ldr r5, _08050284 + ldr r3, _08050288 + ldr r2, _0805028C + 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 + .align 2, 0 +_08050274: .4byte 0x02024280 +_08050278: .4byte 0xfffffbff +_0805027C: .4byte 0x020241ea +_08050280: .4byte 0x0202420c +_08050284: .4byte 0x02024214 +_08050288: .4byte 0x082d86a8 +_0805028C: .4byte 0x0831c898 +_08050290: + ldr r2, _080502C0 + 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, _080502C4 + 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 + .align 2, 0 +_080502C0: .4byte 0x0202437c +_080502C4: .4byte 0x02024214 + thumb_func_end sub_8050164 + + thumb_func_start sub_80502C8 +sub_80502C8: @ 80502C8 + push {lr} + ldr r2, _080502E8 + ldrh r0, [r2] + movs r1, 0x7 + ands r1, r0 + cmp r1, 0 + beq _080502F4 + ldr r2, _080502EC + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _080502F0 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08050304 + .align 2, 0 +_080502E8: .4byte 0x020243cc +_080502EC: .4byte 0x0202427c +_080502F0: .4byte 0x02024332 +_080502F4: + movs r0, 0x1 + strh r0, [r2] + ldr r0, _08050310 + strb r1, [r0, 0x5] + ldr r0, _08050314 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_08050304: + ldr r1, _08050318 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08050310: .4byte 0x02024332 +_08050314: .4byte 0x020243d0 +_08050318: .4byte 0x02024214 + thumb_func_end sub_80502C8 + + thumb_func_start atk7E_setreflect +atk7E_setreflect: @ 805031C + push {r4-r6,lr} + ldr r6, _0805034C + ldrb r0, [r6] + bl battle_get_per_side_status + ldr r4, _08050350 + 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, _08050354 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08050358 + movs r0, 0 + b _080503D0 + .align 2, 0 +_0805034C: .4byte 0x0202420b +_08050350: .4byte 0x0202428e +_08050354: .4byte 0x0202427c +_08050358: .4byte 0x02024332 +_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, _080503C0 + 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, _080503C4 + 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, _080503C8 + strb r1, [r0, 0x5] + b _080503D2 + .align 2, 0 +_080503C0: .4byte 0x02024294 +_080503C4: .4byte 0x02022fec +_080503C8: .4byte 0x02024332 +_080503CC: + ldr r1, _080503E0 + movs r0, 0x1 +_080503D0: + strb r0, [r1, 0x5] +_080503D2: + ldr r1, _080503E4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080503E0: .4byte 0x02024332 +_080503E4: .4byte 0x02024214 + 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, _08050428 + ldrb r5, [r7] + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _0805041A + ldr r0, _0805042C + mov r9, r0 + ldr r1, _08050430 + 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, _08050434 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08050488 + .align 2, 0 +_08050428: .4byte 0x0202427c +_0805042C: .4byte 0x020242ac +_08050430: .4byte 0x0202420c +_08050434: .4byte 0x02024332 +_08050438: + ldr r1, _08050464 + 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, _08050468 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08050488 + .align 2, 0 +_08050464: .4byte 0x02024084 +_08050468: .4byte 0x02024332 +_0805046C: + ldr r0, _0805049C + 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, _080504A0 + strb r3, [r0, 0x5] +_08050488: + ldr r1, _080504A4 + 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 + .align 2, 0 +_0805049C: .4byte 0x0202420b +_080504A0: .4byte 0x02024332 +_080504A4: .4byte 0x02024214 + thumb_func_end sub_80503E8 + + thumb_func_start atk80_manipulatedamage +atk80_manipulatedamage: @ 80504A8 + push {r4,lr} + ldr r1, _080504C0 + 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 + .align 2, 0 +_080504C0: .4byte 0x02024214 +_080504C4: + cmp r2, 0x2 + beq _08050510 + b _08050518 +_080504CA: + ldr r1, _080504D4 + ldr r0, [r1] + negs r0, r0 + b _08050516 + .align 2, 0 +_080504D4: .4byte 0x020241f0 +_080504D8: + ldr r3, _08050504 + 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, _08050508 + ldr r0, _0805050C + 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 + .align 2, 0 +_08050504: .4byte 0x020241f0 +_08050508: .4byte 0x02024084 +_0805050C: .4byte 0x0202420c +_08050510: + ldr r1, _08050524 + 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 + .align 2, 0 +_08050524: .4byte 0x020241f0 + thumb_func_end atk80_manipulatedamage + + thumb_func_start atk81_setrest +atk81_setrest: @ 8050528 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, _08050580 + 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, _08050584 + ldr r2, _08050588 + ldr r0, _0805058C + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r5] + ldr r4, _08050590 + ldr r1, _08050594 + 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 + .align 2, 0 +_08050580: .4byte 0x02024214 +_08050584: .4byte 0x02024064 +_08050588: .4byte 0x0202420c +_0805058C: .4byte 0x0202420b +_08050590: .4byte 0x020241f0 +_08050594: .4byte 0x02024084 +_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, _080505B0 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080505B8 + .align 2, 0 +_080505B0: .4byte 0x02024332 +_080505B4: + ldr r0, _080505F0 + 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, _080505F4 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080505E8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080505F0: .4byte 0x02024332 +_080505F4: .4byte 0x02024214 + thumb_func_end atk81_setrest + + thumb_func_start atk82_jumpifnotfirstturn +atk82_jumpifnotfirstturn: @ 80505F8 + push {r4,r5,lr} + ldr r5, _0805062C + 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, _08050630 + ldr r0, _08050634 + 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 + .align 2, 0 +_0805062C: .4byte 0x02024214 +_08050630: .4byte 0x020242bc +_08050634: .4byte 0x0202420b +_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, _0805064C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_0805064C: .4byte 0x02024214 + 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, _080506A8 + ldrb r1, [r0] + mov r8, r0 + cmp r2, r1 + bge _080506C4 + ldr r0, _080506AC + 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, _080506B0 + ldr r7, _080506B4 +_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, _080506B8 + ldrb r0, [r1] + cmp r0, 0xFF + beq _080506DC + cmp r0, r2 + beq _080506D0 + movs r0, 0x1 + strb r0, [r7, 0x5] + b _080506C4 + .align 2, 0 +_080506A8: .4byte 0x0202406c +_080506AC: .4byte 0x02024084 +_080506B0: .4byte 0x02024474 +_080506B4: .4byte 0x02024332 +_080506B8: .4byte 0x0202420c +_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, _080506D8 + strb r3, [r0, 0x5] + b _080506C4 + .align 2, 0 +_080506D8: .4byte 0x02024332 +_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, _08050718 + 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, _0805071C + ldrb r0, [r6] + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _08050720 + str r4, [r5] + b _08050762 + .align 2, 0 +_08050718: .4byte 0x02024214 +_0805071C: .4byte 0x0202420c +_08050720: + ldr r1, _08050750 + 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, _08050754 + strb r0, [r2] + ldr r1, _08050758 + 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 + .align 2, 0 +_08050750: .4byte 0x02024084 +_08050754: .4byte 0x0202420a +_08050758: .4byte 0x02024332 +_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, _08050790 + ldr r4, _08050794 + 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, _08050798 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _0805079C + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080507CA + .align 2, 0 +_08050790: .4byte 0x020242bc +_08050794: .4byte 0x0202420b +_08050798: .4byte 0x0202427c +_0805079C: .4byte 0x02024332 +_080507A0: + adds r0, 0x1 + movs r3, 0 + strb r0, [r1, 0x9] + ldr r2, _080507D8 + 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, _080507DC + strb r3, [r0, 0x5] +_080507CA: + ldr r1, _080507E0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080507D8: .4byte 0x02022f58 +_080507DC: .4byte 0x02024332 +_080507E0: .4byte 0x02024214 + 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, _0805081C + 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, _08050820 + ldr r6, _08050824 + 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 + .align 2, 0 +_0805081C: .4byte 0x02024214 +_08050820: .4byte 0x020242bc +_08050824: .4byte 0x0202420b +_08050828: + ldr r0, _080508D8 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _080508B0 + ldr r0, _080508DC + mov r8, r0 + ldr r4, _080508E0 + ldr r5, _080508E4 + 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, _080508E8 + adds r0, r2 + ldrb r1, [r5] + muls r1, r4 + adds r1, r2 + ldr r2, _080508EC + 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, _080508F0 + 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, _080508F4 + 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, _080508F8 + ldr r0, _080508FC + 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, _08050900 + 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 + .align 2, 0 +_080508D8: .4byte 0x02024332 +_080508DC: .4byte 0x020241f0 +_080508E0: .4byte 0x0202428e +_080508E4: .4byte 0x0202420c +_080508E8: .4byte 0x02024084 +_080508EC: .4byte 0x020241ea +_080508F0: .4byte 0x02024474 +_080508F4: .4byte 0x0202433c +_080508F8: .4byte 0x020242bc +_080508FC: .4byte 0x0202420b +_08050900: .4byte 0x02024214 + thumb_func_end atk86_stockpiletobasedamage + + thumb_func_start atk87_stockpiletohprecovery +atk87_stockpiletohprecovery: @ 8050904 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, _08050944 + 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, _08050948 + mov r8, r0 + ldr r6, _0805094C + 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, _08050950 + strb r1, [r0, 0x5] + b _080509D0 + .align 2, 0 +_08050944: .4byte 0x02024214 +_08050948: .4byte 0x020242bc +_0805094C: .4byte 0x0202420b +_08050950: .4byte 0x02024332 +_08050954: + ldr r1, _08050978 + 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, _0805097C + ldrb r0, [r6] + strb r0, [r1] + ldr r1, _08050980 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080509D0 + .align 2, 0 +_08050978: .4byte 0x02024084 +_0805097C: .4byte 0x0202420c +_08050980: .4byte 0x02024332 +_08050984: + ldr r5, _080509DC + 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, _080509E0 + 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, _080509E4 + ldrb r0, [r6] + strb r0, [r1] +_080509D0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080509DC: .4byte 0x020241f0 +_080509E0: .4byte 0x02024474 +_080509E4: .4byte 0x0202420c + thumb_func_end atk87_stockpiletohprecovery + + thumb_func_start atk88_negativedamage +atk88_negativedamage: @ 80509E8 + push {lr} + ldr r2, _08050A10 + ldr r0, _08050A14 + 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, _08050A18 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08050A10: .4byte 0x020241f0 +_08050A14: .4byte 0x020241f4 +_08050A18: .4byte 0x02024214 + 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, _08050A48 + ldr r1, _08050A4C + b _08050A54 + .align 2, 0 +_08050A48: .4byte 0x02024064 +_08050A4C: .4byte 0x0202420b +_08050A50: + ldr r0, _08050AF4 + ldr r1, _08050AF8 +_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, _08050AFC + 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, _08050B00 + ldr r1, _08050AF4 + 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, _08050B04 + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050B78 + cmp r5, 0x1 + bne _08050B68 + ldr r4, _08050B08 + ldr r3, _08050AF4 + 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, _08050B0C + mov r4, r8 + str r4, [r0] + b _08050B68 + .align 2, 0 +_08050AF4: .4byte 0x02024064 +_08050AF8: .4byte 0x0202420c +_08050AFC: .4byte 0x02022f58 +_08050B00: .4byte 0x02024294 +_08050B04: .4byte 0x020241ea +_08050B08: .4byte 0x0202437c +_08050B0C: .4byte 0x02024214 +_08050B10: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, _08050B38 + ldr r6, _08050B3C + ldrb r0, [r6] + strb r0, [r1, 0x17] + ldr r1, _08050B40 + ldr r0, _08050B44 + 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 + .align 2, 0 +_08050B38: .4byte 0x02024474 +_08050B3C: .4byte 0x02024064 +_08050B40: .4byte 0x02024214 +_08050B44: .4byte 0x082dae03 +_08050B48: + ldr r0, _08050B6C + 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, _08050B70 + ldr r0, _08050B74 + str r0, [r1] +_08050B68: + movs r0, 0x1 + b _08050E80 + .align 2, 0 +_08050B6C: .4byte 0x020241ea +_08050B70: .4byte 0x02024214 +_08050B74: .4byte 0x082d9f1c +_08050B78: + ldr r2, _08050BC0 + ldr r1, _08050BC4 + 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, _08050BC8 + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050C2C + cmp r5, 0x1 + bne _08050B68 + ldr r4, _08050BCC + 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, _08050BD0 + mov r1, r8 + str r1, [r0] + b _08050B68 + .align 2, 0 +_08050BC0: .4byte 0x02024084 +_08050BC4: .4byte 0x02024064 +_08050BC8: .4byte 0x020241ea +_08050BCC: .4byte 0x0202437c +_08050BD0: .4byte 0x02024214 +_08050BD4: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, _08050C18 + ldr r2, _08050C1C + ldrb r0, [r2] + strb r0, [r1, 0x17] + ldr r1, _08050C20 + ldr r0, _08050C24 + str r0, [r1] + ldr r1, _08050C28 + 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, _08050C1C + 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 + .align 2, 0 +_08050C18: .4byte 0x02024474 +_08050C1C: .4byte 0x02024064 +_08050C20: .4byte 0x02024214 +_08050C24: .4byte 0x082db5c7 +_08050C28: .4byte 0x0202420a +_08050C2C: + ldr r1, _08050C78 + 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, _08050C7C + ldr r3, _08050C78 + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldr r1, _08050C80 + ldr r0, _08050C84 + str r0, [r1] + ldr r1, _08050C88 + 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 + .align 2, 0 +_08050C78: .4byte 0x02024064 +_08050C7C: .4byte 0x02024474 +_08050C80: .4byte 0x02024214 +_08050C84: .4byte 0x082db62f +_08050C88: .4byte 0x0202420a +_08050C8C: + ldr r4, _08050CDC + 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, _08050CE0 + ldr r2, _08050CDC + ldrb r0, [r2] + strb r0, [r1, 0x17] + ldr r1, _08050CE4 + ldr r0, _08050CE8 + str r0, [r1] + ldr r1, _08050CEC + 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 + .align 2, 0 +_08050CDC: .4byte 0x02024064 +_08050CE0: .4byte 0x02024474 +_08050CE4: .4byte 0x02024214 +_08050CE8: .4byte 0x082db62f +_08050CEC: .4byte 0x0202420a +_08050CF0: + ldr r3, _08050D7C + 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, _08050D80 + 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, _08050D7C + 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, _08050D84 + ldrb r0, [r0] + ldr r3, _08050D88 + mov r8, r3 + cmp r0, r2 + bne _08050D76 + movs r1, 0x1 +_08050D76: + mov r4, r8 + strb r1, [r4, 0x5] + b _08050E10 + .align 2, 0 +_08050D7C: .4byte 0x02024064 +_08050D80: .4byte 0x02022f68 +_08050D84: .4byte 0x0202420c +_08050D88: .4byte 0x02024332 +_08050D8C: + asrs r6, r0, 28 + movs r0, 0x7 + ands r6, r0 + ldr r3, _08050DEC + 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, _08050DF0 + ldr r4, _08050DF4 + 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, _08050DF8 + movs r0, 0x2 + strb r0, [r1, 0x5] + mov r8, r1 + b _08050E10 + .align 2, 0 +_08050DEC: .4byte 0x02022f68 +_08050DF0: .4byte 0x02024084 +_08050DF4: .4byte 0x02024064 +_08050DF8: .4byte 0x02024332 +_08050DFC: + movs r1, 0 + ldr r0, _08050E90 + ldrb r0, [r0] + ldr r2, _08050E94 + mov r8, r2 + cmp r0, r3 + bne _08050E0C + movs r1, 0x1 +_08050E0C: + mov r3, r8 + strb r1, [r3, 0x5] +_08050E10: + ldr r2, _08050E98 + 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, _08050E98 + 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, _08050E9C + 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 + .align 2, 0 +_08050E90: .4byte 0x0202420c +_08050E94: .4byte 0x02024332 +_08050E98: .4byte 0x02024064 +_08050E9C: .4byte 0x0202427c + thumb_func_end sub_8050A1C + + thumb_func_start atk89_statbuffchange +atk89_statbuffchange: @ 8050EA0 + push {r4,r5,lr} + ldr r5, _08050EE4 + 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, _08050EE8 + 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 + .align 2, 0 +_08050EE4: .4byte 0x02024214 +_08050EE8: .4byte 0x02024474 + thumb_func_end atk89_statbuffchange + + thumb_func_start atk8A_normalisebuffs +atk8A_normalisebuffs: @ 8050EEC + push {r4-r7,lr} + movs r2, 0 + ldr r0, _08050F34 + ldrb r1, [r0] + ldr r0, _08050F38 + mov r12, r0 + cmp r2, r1 + bge _08050F24 + ldr r0, _08050F3C + 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 + .align 2, 0 +_08050F34: .4byte 0x0202406c +_08050F38: .4byte 0x02024214 +_08050F3C: .4byte 0x02024084 + thumb_func_end atk8A_normalisebuffs + + thumb_func_start atk8B_setbide +atk8B_setbide: @ 8050F40 + push {r4,r5,lr} + ldr r4, _08050F98 + ldr r3, _08050F9C + 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, _08050FA0 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, _08050FA4 + ldrh r1, [r1] + movs r2, 0 + strh r1, [r0] + ldr r1, _08050FA8 + 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, _08050FAC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08050F98: .4byte 0x02024084 +_08050F9C: .4byte 0x0202420b +_08050FA0: .4byte 0x02024268 +_08050FA4: .4byte 0x020241ea +_08050FA8: .4byte 0x020241f8 +_08050FAC: .4byte 0x02024214 + thumb_func_end atk8B_setbide + + thumb_func_start atk8C_confuseifrepeatingattackends +atk8C_confuseifrepeatingattackends: @ 8050FB0 + push {lr} + ldr r1, _08050FE0 + ldr r0, _08050FE4 + 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, _08050FE8 + movs r0, 0x75 + strb r0, [r1, 0x3] +_08050FD2: + ldr r1, _08050FEC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08050FE0: .4byte 0x02024084 +_08050FE4: .4byte 0x0202420b +_08050FE8: .4byte 0x02024332 +_08050FEC: .4byte 0x02024214 + thumb_func_end atk8C_confuseifrepeatingattackends + + thumb_func_start atk8D_setloopcounter +atk8D_setloopcounter: @ 8050FF0 + push {r4,r5,lr} + ldr r0, _08051004 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + cmp r1, 0 + beq _0805100C + ldr r0, _08051008 + strb r1, [r0] + b _08051026 + .align 2, 0 +_08051004: .4byte 0x02024214 +_08051008: .4byte 0x02024212 +_0805100C: + ldr r4, _08051034 + 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, _08051038 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08051034: .4byte 0x02024212 +_08051038: .4byte 0x02024214 + thumb_func_end atk8D_setloopcounter + + thumb_func_start atk8E_cmd8e +atk8E_cmd8e: @ 805103C + ldr r1, _0805105C + 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, _08051060 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_0805105C: .4byte 0x02024474 +_08051060: .4byte 0x02024214 + thumb_func_end atk8E_cmd8e + + thumb_func_start sub_8051064 +sub_8051064: @ 8051064 + push {r4-r7,lr} + ldr r6, _08051098 + ldr r7, _0805109C + ldrb r0, [r7] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + adds r1, 0x2A + ldr r4, _080510A0 + 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, _080510A4 + ldr r1, [r0] + adds r1, r3, r1 + adds r1, 0x58 + ldr r2, _080510A8 + lsls r0, r3, 1 + b _08051108 + .align 2, 0 +_08051098: .4byte 0x02024084 +_0805109C: .4byte 0x0202420b +_080510A0: .4byte 0x0202420c +_080510A4: .4byte 0x0202449c +_080510A8: .4byte 0x0202406e +_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, _080510F8 + 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 + .align 2, 0 +_080510F8: .4byte 0x02024214 +_080510FC: + ldr r0, _0805111C + ldr r1, [r0] + adds r1, r4, r1 + adds r1, 0x58 + ldr r2, _08051120 + lsls r0, r4, 1 +_08051108: + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r1, _08051124 + ldr r0, _08051128 + str r0, [r1] + movs r0, 0x1 +_08051116: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805111C: .4byte 0x0202449c +_08051120: .4byte 0x0202406e +_08051124: .4byte 0x02024214 +_08051128: .4byte 0x082dadd8 + 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, _08051198 + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0805114A + b _08051410 +_0805114A: + ldr r4, _0805119C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _080511A0 + str r1, [sp] + cmp r0, 0 + bne _08051160 + ldr r0, _080511A4 + 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, _080511A8 + 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, _0805119C + 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 + .align 2, 0 +_08051198: .4byte 0x02022fec +_0805119C: .4byte 0x0202420c +_080511A0: .4byte 0x02024744 +_080511A4: .4byte 0x020244ec +_080511A8: .4byte 0x02000100 +_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, _080511C4 + ldrb r1, [r1] + b _0805128E + .align 2, 0 +_080511C4: .4byte 0x0202406e +_080511C8: + movs r0, 0x42 + ands r0, r2 + cmp r0, 0x42 + beq _080511DA + ldr r1, _080511F8 + 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 + .align 2, 0 +_080511F8: .4byte 0x02000040 +_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, _08051214 + ldr r0, _08051218 + ldrb r1, [r0] + b _0805128E + .align 2, 0 +_08051214: .4byte 0x0202406e +_08051218: .4byte 0x0202420c +_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, _0805126C + ldr r0, _08051270 + ldrb r1, [r0] + b _0805128E + .align 2, 0 +_0805126C: .4byte 0x0202406e +_08051270: .4byte 0x0202420c +_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, _080512A0 + 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 + .align 2, 0 +_080512A0: .4byte 0x0202406e +_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, _08051320 + 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, _08051324 + 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 + .align 2, 0 +_08051320: .4byte 0x0202406e +_08051324: .4byte 0x02024214 +_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, _080513FC + ldrb r0, [r4] + ldr r1, _08051400 + 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, _08051404 + 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, _08051408 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _080513C0 + ldr r0, _0805140C + ands r2, r0 + cmp r2, r0 + bne _080513DE +_080513C0: + ldr r5, _080513FC + 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, _08051404 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08051414 + ldr r0, _080513FC + ldrb r0, [r0] + lsls r1, r6, 24 + lsrs r1, 24 + bl sub_80571DC + b _08051414 + .align 2, 0 +_080513FC: .4byte 0x0202420c +_08051400: .4byte 0x0202449c +_08051404: .4byte 0x02022fec +_08051408: .4byte 0x02000100 +_0805140C: .4byte 0x02000040 +_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, _080514B8 + ldr r3, _080514BC + 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, _080514C0 + mov r10, r0 + ldr r5, _080514B8 + mov r12, r5 + ldr r7, _080514BC + 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 + .align 2, 0 +_080514B8: .4byte 0x02024084 +_080514BC: .4byte 0x0202420b +_080514C0: .4byte 0x0831c898 +_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, _08051508 + 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 + .align 2, 0 +_08051508: .4byte 0x02024214 +_0805150C: + movs r7, 0x3 + ldr r5, _08051564 + mov r9, r5 +_08051512: + bl GenerateRandomNumber + adds r3, r0, 0 + ands r3, r7 + cmp r3, r6 + bcs _08051512 + ldr r4, _08051568 + lsls r1, r3, 1 + ldr r3, _0805156C + 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 + .align 2, 0 +_08051564: .4byte 0x0831c898 +_08051568: .4byte 0x02024084 +_0805156C: .4byte 0x0202420b +_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, _080515C0 + 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, _080515C4 + 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 + .align 2, 0 +_080515C0: .4byte 0x02022f58 +_080515C4: .4byte 0x02024214 + thumb_func_end sub_8051424 + + thumb_func_start atk91_givemoney +atk91_givemoney: @ 80515C8 + push {r4,lr} + ldr r0, _08051630 + ldr r0, [r0] + ldr r1, _08051634 + ands r0, r1 + cmp r0, 0 + bne _08051650 + ldr r1, _08051638 + ldrh r0, [r1] + cmp r0, 0 + beq _08051650 + adds r1, r0, 0 + ldr r0, _0805163C + ldr r0, [r0] + adds r0, 0x4A + ldrb r0, [r0] + adds r4, r1, 0 + muls r4, r0 + ldr r0, _08051640 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl add_money + ldr r1, _08051644 + 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, _08051648 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, _0805164C + str r0, [r4] + b _08051658 + .align 2, 0 +_08051630: .4byte 0x02022fec +_08051634: .4byte 0x02000002 +_08051638: .4byte 0x0202432e +_0805163C: .4byte 0x0202449c +_08051640: .4byte 0x03005d8c +_08051644: .4byte 0x02022f58 +_08051648: .4byte 0x02024214 +_0805164C: .4byte 0x082db307 +_08051650: + ldr r1, _08051660 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08051658: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08051660: .4byte 0x02024214 + thumb_func_end atk91_givemoney + + thumb_func_start atk92_setlightscreen +atk92_setlightscreen: @ 8051664 + push {r4-r6,lr} + ldr r5, _08051694 + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r4, _08051698 + 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, _0805169C + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _080516A0 + movs r0, 0 + b _08051718 + .align 2, 0 +_08051694: .4byte 0x0202420b +_08051698: .4byte 0x0202428e +_0805169C: .4byte 0x0202427c +_080516A0: .4byte 0x02024332 +_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, _08051708 + 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, _0805170C + 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, _08051710 + movs r0, 0x4 + b _08051718 + .align 2, 0 +_08051708: .4byte 0x02024294 +_0805170C: .4byte 0x02022fec +_08051710: .4byte 0x02024332 +_08051714: + ldr r1, _08051728 + movs r0, 0x3 +_08051718: + strb r0, [r1, 0x5] + ldr r1, _0805172C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08051728: .4byte 0x02024332 +_0805172C: .4byte 0x02024214 + 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, _0805175C + ldr r6, _08051760 + 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, _08051764 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08051782 + .align 2, 0 +_0805175C: .4byte 0x02024084 +_08051760: .4byte 0x0202420c +_08051764: .4byte 0x02024404 +_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, _080517FC + ldr r5, _08051800 + 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, _08051804 + 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, _08051808 + ldr r2, _08051800 + 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, _0805180C + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08051810 + strb r4, [r0] + ldr r1, _08051814 + ldr r0, _08051818 + str r0, [r1] + mov r1, r9 + ldrb r0, [r1] + movs r1, 0x5 + bl b_history__record_ability_usage_of_player + b _08051A70 + .align 2, 0 +_080517FC: .4byte 0x0202420f +_08051800: .4byte 0x0202420c +_08051804: .4byte 0x0202437c +_08051808: .4byte 0x02024084 +_0805180C: .4byte 0x0202427c +_08051810: .4byte 0x0202420a +_08051814: .4byte 0x02024214 +_08051818: .4byte 0x082db552 +_0805181C: + ldr r1, _08051890 + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x18 + ands r0, r1 + cmp r0, 0 + bne _080518A0 + ldr r1, _08051894 + ldr r0, _08051898 + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r7, _0805189C + 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 + .align 2, 0 +_08051890: .4byte 0x020242ac +_08051894: .4byte 0x0831c898 +_08051898: .4byte 0x020241ea +_0805189C: .4byte 0x0202420b +_080518A0: + ldr r1, _0805196C + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldr r1, _08051970 + 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, _08051974 + ldr r0, _08051978 + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r6, _0805197C + ldrb r0, [r7] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, _08051980 + 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, _0805197C + mov r8, r3 + ldr r0, _08051980 + mov r9, r0 + cmp r4, 0 + beq _08051A08 +_08051942: + ldr r0, _08051984 + 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, _08051988 + movs r0, 0x58 + muls r0, r2 + add r0, r8 + ldrh r0, [r0, 0x28] + subs r0, 0x1 + str r0, [r1] + ldr r2, _0805198C + ldrb r0, [r2] + movs r1, 0x40 + b _080519EE + .align 2, 0 +_0805196C: .4byte 0x020242bc +_08051970: .4byte 0x0202420b +_08051974: .4byte 0x0831c898 +_08051978: .4byte 0x020241ea +_0805197C: .4byte 0x02024084 +_08051980: .4byte 0x0202420c +_08051984: .4byte 0x0202433c +_08051988: .4byte 0x020241f0 +_0805198C: .4byte 0x0202427c +_08051990: + ldr r0, _080519CC + 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, _080519D0 + 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, _080519D4 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _080519D8 + mov r2, r9 + ldrb r0, [r2] + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + b _080519F2 + .align 2, 0 +_080519CC: .4byte 0x0202437c +_080519D0: .4byte 0x020241f0 +_080519D4: .4byte 0x0202427c +_080519D8: .4byte 0x02024208 +_080519DC: + ldr r1, _080519FC + movs r0, 0x58 + muls r0, r2 + add r0, r8 + ldrh r0, [r0, 0x28] + str r0, [r1] + ldr r2, _08051A00 + ldrb r0, [r2] + movs r1, 0x10 +_080519EE: + orrs r0, r1 + strb r0, [r2] +_080519F2: + ldr r1, _08051A04 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08051A70 + .align 2, 0 +_080519FC: .4byte 0x020241f0 +_08051A00: .4byte 0x0202427c +_08051A04: .4byte 0x02024214 +_08051A08: + ldr r2, _08051A3C + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r3, _08051A40 + ldr r0, _08051A44 + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, _08051A48 + 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, _08051A4C + movs r0, 0 + b _08051A54 + .align 2, 0 +_08051A3C: .4byte 0x0202427c +_08051A40: .4byte 0x02024084 +_08051A44: .4byte 0x0202420b +_08051A48: .4byte 0x0202420c +_08051A4C: .4byte 0x02024332 +_08051A50: + ldr r1, _08051A7C + movs r0, 0x1 +_08051A54: + strb r0, [r1, 0x5] + ldr r3, _08051A80 + 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 + .align 2, 0 +_08051A7C: .4byte 0x02024332 +_08051A80: .4byte 0x02024214 + thumb_func_end atk93_ko_move + + thumb_func_start atk94_gethalfcurrentenemyhp +atk94_gethalfcurrentenemyhp: @ 8051A84 + push {lr} + ldr r3, _08051AB0 + ldr r2, _08051AB4 + ldr r0, _08051AB8 + 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, _08051ABC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08051AB0: .4byte 0x020241f0 +_08051AB4: .4byte 0x02024084 +_08051AB8: .4byte 0x0202420c +_08051ABC: .4byte 0x02024214 + thumb_func_end atk94_gethalfcurrentenemyhp + + thumb_func_start sub_8051AC0 +sub_8051AC0: @ 8051AC0 + push {lr} + ldr r2, _08051AE0 + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _08051AEC + ldr r2, _08051AE4 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08051AE8 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08051AFE + .align 2, 0 +_08051AE0: .4byte 0x020243cc +_08051AE4: .4byte 0x0202427c +_08051AE8: .4byte 0x02024332 +_08051AEC: + movs r0, 0x8 + strh r0, [r2] + ldr r1, _08051B0C + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r0, _08051B10 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_08051AFE: + ldr r1, _08051B14 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08051B0C: .4byte 0x02024332 +_08051B10: .4byte 0x020243d0 +_08051B14: .4byte 0x02024214 + 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, _08051BC0 + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + adds r4, r2, 0 + ldr r5, _08051BC4 + cmp r0, 0 + beq _08051BDA + ldr r0, _08051BC8 + 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, _08051BCC + 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, _08051BD0 + ldrh r0, [r3, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08051BDA + movs r0, 0x1 + b _08051BD8 + .align 2, 0 +_08051BC0: .4byte 0x020243cc +_08051BC4: .4byte 0x0202420b +_08051BC8: .4byte 0x02024084 +_08051BCC: .4byte 0x020242ac +_08051BD0: .4byte 0x020241f0 +_08051BD4: + ldr r1, _08051C30 + 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, _08051C34 + 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, _08051C38 + 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, _08051C30 + ldrh r0, [r2, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08051C50 + movs r0, 0x1 + str r0, [r1] + b _08051C50 + .align 2, 0 +_08051C30: .4byte 0x020241f0 +_08051C34: .4byte 0x02024084 +_08051C38: .4byte 0x020242ac +_08051C3C: + ldr r1, _08051C44 + movs r0, 0 + str r0, [r1] + b _08051C50 + .align 2, 0 +_08051C44: .4byte 0x020241f0 +_08051C48: + ldr r1, _08051C7C + movs r0, 0 + str r0, [r1] + ldr r5, _08051C80 +_08051C50: + ldr r0, _08051C84 + ldrb r1, [r0] + ldr r2, _08051C88 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08051C6A + ldr r1, _08051C7C + movs r0, 0 + str r0, [r1] +_08051C6A: + ldr r1, _08051C8C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08051C7C: .4byte 0x020241f0 +_08051C80: .4byte 0x0202420b +_08051C84: .4byte 0x02024210 +_08051C88: .4byte 0x0832a328 +_08051C8C: .4byte 0x02024214 + 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, _08051CBC + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051CC8 + ldr r1, _08051CC0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08051CC4 + b _08051CD8 + .align 2, 0 +_08051CBC: .4byte 0x0202420b +_08051CC0: .4byte 0x0202406e +_08051CC4: .4byte 0x020244ec +_08051CC8: + ldr r1, _08051CFC + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08051D00 +_08051CD8: + adds r5, r1, r0 + ldr r4, _08051D04 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051D0C + ldr r1, _08051CFC + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08051D08 + b _08051D1C + .align 2, 0 +_08051CFC: .4byte 0x0202406e +_08051D00: .4byte 0x02024744 +_08051D04: .4byte 0x0202420c +_08051D08: .4byte 0x020244ec +_08051D0C: + ldr r1, _08051D78 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08051D7C +_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, _08051D80 + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + ldr r1, _08051D84 + adds r0, r1 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0xC + bne _08051D94 + ldr r1, _08051D88 + ldr r0, _08051D8C + str r0, [r1] + ldr r0, _08051D90 + strb r2, [r0] + ldrb r0, [r5] + movs r1, 0xC + bl b_history__record_ability_usage_of_player + b _08051E2C + .align 2, 0 +_08051D78: .4byte 0x0202406e +_08051D7C: .4byte 0x02024744 +_08051D80: .4byte 0x0202420c +_08051D84: .4byte 0x02024084 +_08051D88: .4byte 0x02024214 +_08051D8C: .4byte 0x082db5f5 +_08051D90: .4byte 0x0202420a +_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, _08051E00 + 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, _08051E04 + 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 + .align 2, 0 +_08051E00: .4byte 0x02024084 +_08051E04: .4byte 0x02024214 +_08051E08: + ldrb r0, [r5] + adds r2, r0, 0 + muls r2, r6 + adds r2, r4 + ldr r1, _08051E3C + ldr r0, _08051E40 + 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, _08051E44 + 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 + .align 2, 0 +_08051E3C: .4byte 0x0832a328 +_08051E40: .4byte 0x0202420b +_08051E44: .4byte 0x02024214 + thumb_func_end atk97_tryinfatuatetarget + + thumb_func_start sub_8051E48 +sub_8051E48: @ 8051E48 + push {r4-r7,lr} + ldr r0, _08051E90 + ldr r0, [r0] + cmp r0, 0 + bne _08051F34 + ldr r5, _08051E94 + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x4 + beq _08051EA0 + bl get_battle_side_of_something + ldr r4, _08051E98 + strb r0, [r4] + ldr r3, _08051E9C + 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 + .align 2, 0 +_08051E90: .4byte 0x02024068 +_08051E94: .4byte 0x02024214 +_08051E98: .4byte 0x02024064 +_08051E9C: .4byte 0x02024084 +_08051EA0: + ldr r4, _08051F3C + ldr r5, _08051F40 + ldrb r0, [r5] + strb r0, [r4] + ldr r6, _08051F44 + ldrb r1, [r6] + ldr r7, _08051F48 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08051EDC + ldr r3, _08051F4C + 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, _08051F50 + 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, _08051F4C + 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, _08051F54 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08051F34: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08051F3C: .4byte 0x02024064 +_08051F40: .4byte 0x0202420b +_08051F44: .4byte 0x02024210 +_08051F48: .4byte 0x0832a328 +_08051F4C: .4byte 0x02024084 +_08051F50: .4byte 0x02022fec +_08051F54: .4byte 0x02024214 + thumb_func_end sub_8051E48 + + thumb_func_start atk99_setmisteffect +atk99_setmisteffect: @ 8051F58 + push {r4-r6,lr} + ldr r6, _08051F88 + ldr r4, _08051F8C + 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, _08051F90 + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08051F94 + strb r5, [r0, 0x5] + b _08051FE6 + .align 2, 0 +_08051F88: .4byte 0x02024294 +_08051F8C: .4byte 0x0202420b +_08051F90: .4byte 0x0202427c +_08051F94: .4byte 0x02024332 +_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, _08051FF4 + 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, _08051FF8 + strb r3, [r0, 0x5] +_08051FE6: + ldr r1, _08051FFC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08051FF4: .4byte 0x0202428e +_08051FF8: .4byte 0x02024332 +_08051FFC: .4byte 0x02024214 + thumb_func_end atk99_setmisteffect + + thumb_func_start atk9A_setincreasedcriticalchance +atk9A_setincreasedcriticalchance: @ 8052000 + push {lr} + ldr r1, _08052030 + ldr r0, _08052034 + 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, _08052038 + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r1, _0805203C + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08052048 + .align 2, 0 +_08052030: .4byte 0x02024084 +_08052034: .4byte 0x0202420b +_08052038: .4byte 0x0202427c +_0805203C: .4byte 0x02024332 +_08052040: + orrs r1, r3 + str r1, [r0] + ldr r0, _08052054 + strb r2, [r0, 0x5] +_08052048: + ldr r1, _08052058 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08052054: .4byte 0x02024332 +_08052058: .4byte 0x02024214 + thumb_func_end atk9A_setincreasedcriticalchance + + thumb_func_start atk9B_transformdataexecution +atk9B_transformdataexecution: @ 805205C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, _080520B4 + ldr r2, _080520B8 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080520BC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r7, _080520C0 + ldr r0, _080520C4 + 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, _080520C8 + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + ldr r0, _080520CC + ands r2, r0 + cmp r2, 0 + beq _080520D8 +_080520A2: + ldr r2, _080520D0 + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r1, _080520D4 + movs r0, 0x1 + b _080521EC + .align 2, 0 +_080520B4: .4byte 0x020241ec +_080520B8: .4byte 0x0000ffff +_080520BC: .4byte 0x02024214 +_080520C0: .4byte 0x02024084 +_080520C4: .4byte 0x0202420c +_080520C8: .4byte 0x020242ac +_080520CC: .4byte 0x000400c0 +_080520D0: .4byte 0x0202427c +_080520D4: .4byte 0x02024332 +_080520D8: + ldr r3, _080521AC + ldrb r0, [r3] + adds r1, r0, 0 + muls r1, r6 + adds r1, r5 + ldr r0, [r1] + orrs r0, r4 + str r0, [r1] + ldr r4, _080521B0 + 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, _080521B4 + 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, _080521B8 + 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, _080521BC + ldr r3, _080521C0 + 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 + .align 2, 0 +_080521AC: .4byte 0x0202420b +_080521B0: .4byte 0x020242bc +_080521B4: .4byte 0x02022f58 +_080521B8: .4byte 0x02024064 +_080521BC: .4byte 0x0831c898 +_080521C0: .4byte 0x02024090 +_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, _080521F8 + movs r0, 0 +_080521EC: + strb r0, [r1, 0x5] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080521F8: .4byte 0x02024332 + thumb_func_end atk9B_transformdataexecution + + thumb_func_start sub_80521FC +sub_80521FC: @ 80521FC + push {r4-r7,lr} + ldr r7, _0805222C + ldr r6, _08052230 + 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, _08052234 + movs r0, 0 + str r0, [r1] + ldr r1, _08052238 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08052290 + .align 2, 0 +_0805222C: .4byte 0x02024084 +_08052230: .4byte 0x0202420b +_08052234: .4byte 0x020241f0 +_08052238: .4byte 0x02024332 +_0805223C: + ldr r4, _080522A0 + 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, _080522A4 + ands r0, r2 + str r0, [r1] + ldr r2, _080522A8 + 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, _080522AC + strb r2, [r0, 0x5] + ldr r2, _080522B0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [r2] +_08052290: + ldr r1, _080522B4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080522A0: .4byte 0x020241f0 +_080522A4: .4byte 0xffff1fff +_080522A8: .4byte 0x020242bc +_080522AC: .4byte 0x02024332 +_080522B0: .4byte 0x02024280 +_080522B4: .4byte 0x02024214 + 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, _080522F8 + ldrh r1, [r0] + ldr r4, _080522FC + 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, _080522FC + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080522F8: .4byte 0x0831c3e0 +_080522FC: .4byte 0x0000fffe + 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, _08052378 + ldr r1, _0805237C + adds r7, r1, 0 + strh r7, [r0] + ldr r5, _08052380 + ldr r6, _08052384 + 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, _08052388 + ldr r2, _0805238C + 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, _08052390 + 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 + .align 2, 0 +_08052378: .4byte 0x020241ec +_0805237C: .4byte 0x0000ffff +_08052380: .4byte 0x02024248 +_08052384: .4byte 0x0202420c +_08052388: .4byte 0x02024084 +_0805238C: .4byte 0x0202420b +_08052390: .4byte 0x02024214 +_08052394: + movs r2, 0 + mov r3, r12 + adds r3, 0xC + adds r0, r4, r3 + ldrh r0, [r0] + ldr r4, _08052424 + 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, _08052428 + 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, _0805242C + ldr r3, _08052430 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r4, _08052434 + 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 + .align 2, 0 +_08052424: .4byte 0x02024214 +_08052428: .4byte 0x020241e8 +_0805242C: .4byte 0x02024248 +_08052430: .4byte 0x0202420c +_08052434: .4byte 0x0831c898 +_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, _080524A4 + 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, _080524A8 + 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, _080524AC + 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 + .align 2, 0 +_080524A4: .4byte 0x02022f58 +_080524A8: .4byte 0x020242bc +_080524AC: .4byte 0x0832a328 +_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, _0805255C + movs r6, 0xB1 + lsls r6, 1 + ldr r5, _08052560 + ldr r0, _08052564 + mov r8, r0 +_080524EE: + bl GenerateRandomNumber + ldr r2, _08052568 + 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, _0805255C + ldrh r2, [r4] + ldr r3, _0805256C + subs r0, r5, 0x2 +_08052510: + adds r0, 0x2 + ldrh r1, [r0] + cmp r1, r2 + beq _0805251C + cmp r1, r3 + bne _08052510 +_0805251C: + ldr r0, _0805256C + cmp r1, r0 + bne _080524EE + ldr r2, _08052570 + ldr r0, [r2] + ldr r1, _08052574 + ands r0, r1 + str r0, [r2] + ldr r3, _08052578 + ldr r2, _0805257C + 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, _08052580 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805255C: .4byte 0x020241ea +_08052560: .4byte 0x0831c3e0 +_08052564: .4byte 0x02024214 +_08052568: .4byte 0x000001ff +_0805256C: .4byte 0x0000ffff +_08052570: .4byte 0x02024280 +_08052574: .4byte 0xfffffbff +_08052578: .4byte 0x082d86a8 +_0805257C: .4byte 0x0831c898 +_08052580: .4byte 0x0202420c + thumb_func_end sub_80524DC + + thumb_func_start atk9F_nightshadedamageeffect +atk9F_nightshadedamageeffect: @ 8052584 + ldr r3, _080525A4 + ldr r2, _080525A8 + ldr r0, _080525AC + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r0, [r0] + str r0, [r3] + ldr r1, _080525B0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_080525A4: .4byte 0x020241f0 +_080525A8: .4byte 0x02024084 +_080525AC: .4byte 0x0202420b +_080525B0: .4byte 0x02024214 + 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, _080525F8 + ldr r2, _080525FC + ldr r0, _08052600 + 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, _08052604 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080525F8: .4byte 0x020241f0 +_080525FC: .4byte 0x02024084 +_08052600: .4byte 0x0202420b +_08052604: .4byte 0x02024214 + thumb_func_end atkA0_psywavedamageeffect + + thumb_func_start atkA1_counterdamagecalculator +atkA1_counterdamagecalculator: @ 8052608 + push {r4-r6,lr} + ldr r4, _08052678 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _0805267C + 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, _08052680 + 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, _08052684 + lsls r0, r3, 1 + str r0, [r1] + ldr r1, _08052688 + 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, _0805268C + strb r1, [r0] + b _080526A0 + .align 2, 0 +_08052678: .4byte 0x0202420b +_0805267C: .4byte 0x0202433c +_08052680: .4byte 0x02024084 +_08052684: .4byte 0x020241f0 +_08052688: .4byte 0x02024294 +_0805268C: .4byte 0x0202420c +_08052690: + ldr r2, _080526AC + ldr r1, _080526B0 + ldr r0, _080526B4 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_080526A0: + ldr r1, _080526B8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080526EC + .align 2, 0 +_080526AC: .4byte 0x0202420c +_080526B0: .4byte 0x0202433c +_080526B4: .4byte 0x0202420b +_080526B8: .4byte 0x02024214 +_080526BC: + ldr r2, _080526F4 + ldr r0, _080526F8 + 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, _080526FC + 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 + .align 2, 0 +_080526F4: .4byte 0x0202437c +_080526F8: .4byte 0x0202420b +_080526FC: .4byte 0x02024214 + thumb_func_end atkA1_counterdamagecalculator + + thumb_func_start atkA2_mirrorcoatdamagecalculator +atkA2_mirrorcoatdamagecalculator: @ 8052700 + push {r4-r6,lr} + ldr r4, _08052770 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _08052774 + 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, _08052778 + 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, _0805277C + lsls r0, r3, 1 + str r0, [r1] + ldr r1, _08052780 + 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, _08052784 + strb r1, [r0] + b _08052798 + .align 2, 0 +_08052770: .4byte 0x0202420b +_08052774: .4byte 0x0202433c +_08052778: .4byte 0x02024084 +_0805277C: .4byte 0x020241f0 +_08052780: .4byte 0x02024294 +_08052784: .4byte 0x0202420c +_08052788: + ldr r2, _080527A4 + ldr r1, _080527A8 + ldr r0, _080527AC + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xD] + strb r0, [r2] +_08052798: + ldr r1, _080527B0 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080527E4 + .align 2, 0 +_080527A4: .4byte 0x0202420c +_080527A8: .4byte 0x0202433c +_080527AC: .4byte 0x0202420b +_080527B0: .4byte 0x02024214 +_080527B4: + ldr r2, _080527EC + ldr r0, _080527F0 + 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, _080527F4 + 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 + .align 2, 0 +_080527EC: .4byte 0x0202437c +_080527F0: .4byte 0x0202420b +_080527F4: .4byte 0x02024214 + 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, _080528F8 + ldr r3, _080528FC + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r7, r2, 0 + adds r7, 0xC + adds r0, r7 + ldr r5, _08052900 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r0] + mov r9, r2 + adds r6, r3, 0 + ldr r2, _08052904 + 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, _08052908 + 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, _0805290C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805292A + .align 2, 0 +_080528F8: .4byte 0x02024084 +_080528FC: .4byte 0x0202420c +_08052900: .4byte 0x02024248 +_08052904: .4byte 0x020242bc +_08052908: .4byte 0x02022f58 +_0805290C: .4byte 0x02024214 +_08052910: + ldr r3, _08052938 + 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 + .align 2, 0 +_08052938: .4byte 0x02024214 + 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, _08052A30 + ldr r4, _08052A34 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r6, r3, 0 + adds r6, 0xC + adds r0, r6 + ldr r2, _08052A38 + lsls r1, 1 + adds r1, r2 + ldrh r0, [r0] + mov r10, r3 + mov r8, r2 + ldr r2, _08052A3C + 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, _08052A40 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052A5E + .align 2, 0 +_08052A30: .4byte 0x02024084 +_08052A34: .4byte 0x0202420c +_08052A38: .4byte 0x02024248 +_08052A3C: .4byte 0x020242bc +_08052A40: .4byte 0x02024214 +_08052A44: + ldr r3, _08052A6C + 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 + .align 2, 0 +_08052A6C: .4byte 0x02024214 + thumb_func_end atkA4_setencore + + thumb_func_start sub_8052A70 +sub_8052A70: @ 8052A70 + push {r4-r7,lr} + ldr r6, _08052AF0 + ldr r0, _08052AF4 + 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, _08052AF8 + 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, _08052AFC + subs r1, r3 + str r1, [r4] + ldr r2, _08052B00 + 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, _08052B04 + mov r0, r12 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, _08052B08 + str r1, [r0] + ldr r1, _08052B0C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052B2A + .align 2, 0 +_08052AF0: .4byte 0x02024084 +_08052AF4: .4byte 0x0202420c +_08052AF8: .4byte 0x0202420b +_08052AFC: .4byte 0x020241f0 +_08052B00: .4byte 0x02024474 +_08052B04: .4byte 0x0202437c +_08052B08: .4byte 0x0000ffff +_08052B0C: .4byte 0x02024214 +_08052B10: + ldr r3, _08052B30 + 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 + .align 2, 0 +_08052B30: .4byte 0x02024214 + 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, _08052B9C + ldr r4, _08052BA0 + ldrb r0, [r4] + lsls r0, 1 + adds r2, r0, r1 + ldrh r1, [r2] + cmp r1, 0 + beq _08052B7E + ldr r0, _08052BA4 + cmp r1, r0 + beq _08052B7E + ldrh r0, [r2] + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _08052C1C + ldr r1, _08052BA8 + ldr r2, _08052BAC + 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, _08052BB0 + 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 + .align 2, 0 +_08052B9C: .4byte 0x02024250 +_08052BA0: .4byte 0x0202420b +_08052BA4: .4byte 0x0000ffff +_08052BA8: .4byte 0x02024084 +_08052BAC: .4byte 0x02024270 +_08052BB0: .4byte 0x02024214 +_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, _08052BD8 + 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, _08052BDC + b _08052C0A + .align 2, 0 +_08052BD8: .4byte 0x02022f58 +_08052BDC: .4byte 0x02024214 +_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, _08052C14 + adds r0, r7 + adds r0, 0x22 + strb r2, [r0] + ldr r1, _08052C18 + 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 + .align 2, 0 +_08052C14: .4byte 0x02024084 +_08052C18: .4byte 0x02022f58 +_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, _08052D18 + adds r3, r4, r6 + ldr r1, _08052D1C + ldr r2, _08052D20 + 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, _08052D24 + 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, _08052D28 + cmp r8, r0 + ble _08052C24 + movs r0, 0 + mov r8, r0 + ldr r1, _08052D2C + mov r12, r1 + ldr r3, _08052D18 + 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, _08052D1C + 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, _08052D24 + 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, _08052D30 + 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 + .align 2, 0 +_08052D18: .4byte 0x0831ace8 +_08052D1C: .4byte 0x02024258 +_08052D20: .4byte 0x0202420b +_08052D24: .4byte 0x02024084 +_08052D28: .4byte 0x000003e7 +_08052D2C: .4byte 0x02024214 +_08052D30: .4byte 0x0000014f + thumb_func_end atkA6_settypetorandomresistance + + thumb_func_start atkA7_setalwayshitflag +atkA7_setalwayshitflag: @ 8052D34 + push {r4,lr} + ldr r4, _08052D78 + ldr r3, _08052D7C + 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, _08052D80 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _08052D84 + ldrb r1, [r1] + strb r1, [r0, 0x15] + ldr r1, _08052D88 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08052D78: .4byte 0x020242ac +_08052D7C: .4byte 0x0202420c +_08052D80: .4byte 0x020242bc +_08052D84: .4byte 0x0202420b +_08052D88: .4byte 0x02024214 + 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, _08052EEC + ldr r1, _08052EF0 + adds r5, r1, 0 + strh r5, [r0] + ldr r3, _08052EF4 + ldr r2, _08052EF8 + 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, _08052EFC + ldr r2, _08052F00 + 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, _08052F04 + 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, _08052F08 + 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, _08052F0C + 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, _08052F0C + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, _08052F10 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldr r3, _08052EFC + ldr r2, _08052F00 + 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, _08052F14 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052F32 + .align 2, 0 +_08052EEC: .4byte 0x020241ec +_08052EF0: .4byte 0x0000ffff +_08052EF4: .4byte 0x02024084 +_08052EF8: .4byte 0x0202420b +_08052EFC: .4byte 0x02024240 +_08052F00: .4byte 0x0202420c +_08052F04: .4byte 0x020241e8 +_08052F08: .4byte 0x0831c898 +_08052F0C: .4byte 0x02024064 +_08052F10: .4byte 0x02022f58 +_08052F14: .4byte 0x02024214 +_08052F18: + ldr r3, _08052F44 + 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 + .align 2, 0 +_08052F44: .4byte 0x02024214 + thumb_func_end atkA8_copymovepermanently + + thumb_func_start sub_8052F48 +sub_8052F48: @ 8052F48 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08052F78 + 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 + .align 2, 0 +_08052F78: .4byte 0x0831c898 +_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, _08053004 + 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, _08053008 + 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, _0805300C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 20 + ands r0, r1 + cmp r0, 0 + beq _08053010 + movs r0, 0x1 + b _08053012 + .align 2, 0 +_08053004: .4byte 0x0831c898 +_08053008: .4byte 0x020243cc +_0805300C: .4byte 0x02024280 +_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, _080530A8 + mov r9, r0 + movs r1, 0x58 + mov r8, r1 + ldr r7, _080530AC + 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, _080530B0 + 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, _080530A8 + 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, _080530B4 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805311C + .align 2, 0 +_080530A8: .4byte 0x0202420b +_080530AC: .4byte 0x02024090 +_080530B0: .4byte 0x0832a328 +_080530B4: .4byte 0x02024214 +_080530B8: + movs r7, 0x3 + ldr r4, _0805312C +_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, _08053130 + ldr r2, _08053134 + lsls r1, r5, 1 + ldr r0, _08053138 + 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, _0805313C + strb r5, [r0] + ldr r2, _08053140 + ldr r0, [r2] + ldr r1, _08053144 + ands r0, r1 + str r0, [r2] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, _08053148 + strb r0, [r1] + ldr r3, _0805314C + 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 + .align 2, 0 +_0805312C: .4byte 0x0832a328 +_08053130: .4byte 0x020241ee +_08053134: .4byte 0x02024084 +_08053138: .4byte 0x0202420b +_0805313C: .4byte 0x020241e8 +_08053140: .4byte 0x02024280 +_08053144: .4byte 0xfffffbff +_08053148: .4byte 0x0202420c +_0805314C: .4byte 0x02024214 + thumb_func_end sub_8053018 + + thumb_func_start atkAA_destinybondeffect +atkAA_destinybondeffect: @ 8053150 + ldr r1, _08053174 + ldr r0, _08053178 + 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, _0805317C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08053174: .4byte 0x02024084 +_08053178: .4byte 0x0202420b +_0805317C: .4byte 0x02024214 + 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, _080531D0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080531D4 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _080531D8 + 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, _080531DC + 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 + .align 2, 0 +_080531D0: .4byte 0x0202420b +_080531D4: .4byte 0x0202420c +_080531D8: .4byte 0x02024084 +_080531DC: .4byte 0x02024280 + 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, _080531F4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080531F4: .4byte 0x02024214 + thumb_func_end atkAB_802A458 + + thumb_func_start atkAC_remaininghptopower +atkAC_remaininghptopower: @ 80531F8 + push {lr} + ldr r2, _0805324C + ldr r0, _08053250 + 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, _08053254 + 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, _08053258 + ldr r1, _08053254 + adds r0, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + ldr r1, _0805325C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0805324C: .4byte 0x02024084 +_08053250: .4byte 0x0202420b +_08053254: .4byte 0x0831c408 +_08053258: .4byte 0x02024400 +_0805325C: .4byte 0x02024214 + 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, _080533E0 + ldr r1, _080533E4 + 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, _080533E8 + cmp r2, r0 + bne _08053288 + b _08053408 +_08053288: + movs r7, 0 + ldr r0, _080533EC + 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, _080533EC + 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, _080533F0 + movs r5, 0xFD + strb r5, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldr r2, _080533E0 + 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, _080533F4 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + 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, _080533F8 + mov r3, r8 + ldrb r0, [r3] + strb r0, [r4] + ldr r1, _080533FC + 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, _08053400 + 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, _080533EC + 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, _08053404 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r1, _080533EC + ldr r0, _080533E4 + 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 + .align 2, 0 +_080533E0: .4byte 0x02024248 +_080533E4: .4byte 0x0202420c +_080533E8: .4byte 0x0000ffff +_080533EC: .4byte 0x02024084 +_080533F0: .4byte 0x02022f58 +_080533F4: .4byte 0x02022f68 +_080533F8: .4byte 0x02024064 +_080533FC: .4byte 0x020242bc +_08053400: .4byte 0x0832a328 +_08053404: .4byte 0x02024214 +_08053408: + ldr r3, _08053434 + 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 + .align 2, 0 +_08053434: .4byte 0x02024214 + 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, _080534A8 + ldrh r0, [r0] + cmp r0, 0xD7 + beq _08053454 + b _0805363E +_08053454: + ldr r6, _080534AC + mov r0, r8 + strb r0, [r6, 0x5] + ldr r5, _080534B0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _080534B4 + mov r10, r1 + cmp r0, 0 + bne _08053470 + ldr r2, _080534B8 + mov r10, r2 +_08053470: + ldr r4, _080534BC + 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, _080534C0 + ands r0, r1 + str r0, [r2] + b _080534D4 + .align 2, 0 +_080534A8: .4byte 0x020241ea +_080534AC: .4byte 0x02024332 +_080534B0: .4byte 0x0202420b +_080534B4: .4byte 0x02024744 +_080534B8: .4byte 0x020244ec +_080534BC: .4byte 0x02024084 +_080534C0: .4byte 0xf7ffffff +_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, _08053548 + ldr r0, _0805354C + 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, _08053550 + strb r0, [r1, 0x17] + strb r0, [r7] + ldr r0, _08053554 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805357A + ldr r0, _08053558 + ldrb r2, [r0] + ldr r1, _0805355C + ldrb r3, [r7] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _0805357A + ldr r5, _08053560 + 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, _08053564 + ands r0, r1 + str r0, [r2] + b _0805357A + .align 2, 0 +_08053548: .4byte 0x02024064 +_0805354C: .4byte 0x0202420b +_08053550: .4byte 0x02024474 +_08053554: .4byte 0x02022fec +_08053558: .4byte 0x02024210 +_0805355C: .4byte 0x0832a328 +_08053560: .4byte 0x02024084 +_08053564: .4byte 0xf7ffffff +_08053568: + ldrb r1, [r1] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + ldr r1, _080535C0 + ldrb r0, [r1, 0x5] + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] +_0805357A: + movs r6, 0 + ldr r7, _080535C4 +_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, _080535C8 + ldr r0, _080535CC + 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 + .align 2, 0 +_080535C0: .4byte 0x02024332 +_080535C4: .4byte 0x02024084 +_080535C8: .4byte 0x0202406e +_080535CC: .4byte 0x0202420b +_080535D0: + ldr r0, _08053608 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08053618 + ldr r0, _0805360C + ldrb r3, [r0] + lsls r0, r3, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _08053618 + ldr r0, _08053610 + ldrb r1, [r0] + ldr r2, _08053614 + 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 + .align 2, 0 +_08053608: .4byte 0x02022fec +_0805360C: .4byte 0x02024064 +_08053610: .4byte 0x02024210 +_08053614: .4byte 0x0832a328 +_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, _080536F8 + movs r0, 0x4 + strb r0, [r1, 0x5] + movs r2, 0x3F + mov r8, r2 + ldr r3, _080536FC + ldr r2, _08053700 + 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, _08053704 + 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, _08053708 + strb r0, [r4] + ldr r0, _0805370C + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080536BC + ldr r0, _08053710 + ldrb r2, [r0] + ldr r1, _08053714 + 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, _08053708 + ldr r0, _08053700 + 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, _08053718 + 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 + .align 2, 0 +_080536F8: .4byte 0x02024332 +_080536FC: .4byte 0x02024084 +_08053700: .4byte 0x0202420b +_08053704: .4byte 0xf7ffffff +_08053708: .4byte 0x02024064 +_0805370C: .4byte 0x02022fec +_08053710: .4byte 0x02024210 +_08053714: .4byte 0x0832a328 +_08053718: .4byte 0x02024214 + thumb_func_end atkAE_clearstatusifnotsoundproofed + + thumb_func_start atkAF_cursetarget +atkAF_cursetarget: @ 805371C + push {r4,r5,lr} + ldr r5, _0805375C + ldr r0, _08053760 + 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, _08053764 + 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 + .align 2, 0 +_0805375C: .4byte 0x02024084 +_08053760: .4byte 0x0202420c +_08053764: .4byte 0x02024214 +_08053768: + orrs r2, r3 + str r2, [r1] + ldr r1, _08053794 + ldr r0, _08053798 + 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, _0805379C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805378C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08053794: .4byte 0x020241f0 +_08053798: .4byte 0x0202420b +_0805379C: .4byte 0x02024214 + thumb_func_end atkAF_cursetarget + + thumb_func_start atkB0_setspikes +atkB0_setspikes: @ 80537A0 + push {r4,lr} + ldr r4, _080537F4 + ldrb r0, [r4] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080537F8 + 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, _080537FC + 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, _08053800 + 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 + .align 2, 0 +_080537F4: .4byte 0x0202420b +_080537F8: .4byte 0x02024294 +_080537FC: .4byte 0x0202437c +_08053800: .4byte 0x02024214 +_08053804: + ldr r1, _08053824 + 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, _08053828 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805381E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08053824: .4byte 0x0202428e +_08053828: .4byte 0x02024214 + thumb_func_end atkB0_setspikes + + thumb_func_start atkB1_setforesight +atkB1_setforesight: @ 805382C + ldr r1, _08053850 + ldr r0, _08053854 + 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, _08053858 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08053850: .4byte 0x02024084 +_08053854: .4byte 0x0202420c +_08053858: .4byte 0x02024214 + 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, _080538A0 + adds r7, r0, 0 + ldr r0, _080538A4 + mov r8, r0 + ldrb r1, [r7] + cmp r6, r1 + bge _080538C8 + movs r5, 0x20 + ldr r0, _080538A8 + mov r12, r0 + ldr r0, _080538AC + adds r4, r0, 0 + adds r4, 0xF + ldr r2, _080538B0 +_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 + .align 2, 0 +_080538A0: .4byte 0x0202406c +_080538A4: .4byte 0x0202420b +_080538A8: .4byte 0x02024084 +_080538AC: .4byte 0x020242bc +_080538B0: .4byte 0x020242ac +_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, _080538F4 + ldrb r0, [r0] + cmp r6, r0 + bne _080538FC + ldr r3, _080538F8 + 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 + .align 2, 0 +_080538F4: .4byte 0x0202406c +_080538F8: .4byte 0x02024214 +_080538FC: + ldr r1, _08053910 + 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 + .align 2, 0 +_08053910: .4byte 0x02024214 + 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, _08053938 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08053948 + ldr r0, _0805393C + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + ldr r1, _08053940 + ldr r0, _08053944 + str r0, [r1] + b _08053A60 + .align 2, 0 +_08053938: .4byte 0x0202427c +_0805393C: .4byte 0x0202420b +_08053940: .4byte 0x02024214 +_08053944: .4byte 0x082d8a60 +_08053948: + ldr r2, _08053A6C + ldr r1, _08053A70 + 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, _08053A74 + mov r12, r1 + ldr r2, _08053A78 + 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, _08053A7C + 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, _08053A80 + ands r0, r2 + str r0, [r1] +_080539EE: + ldr r3, _08053A84 + ldr r2, _08053A88 + 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, _08053A8C + 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 + .align 2, 0 +_08053A6C: .4byte 0x02024084 +_08053A70: .4byte 0x0202420b +_08053A74: .4byte 0x020242bc +_08053A78: .4byte 0x020241ea +_08053A7C: .4byte 0x02024268 +_08053A80: .4byte 0xffffefff +_08053A84: .4byte 0x02024400 +_08053A88: .4byte 0x0831c898 +_08053A8C: .4byte 0x02024214 + thumb_func_end atkB3_rolloutdamagecalculation + + thumb_func_start atkB4_jumpifconfusedandattackmaxed +atkB4_jumpifconfusedandattackmaxed: @ 8053A90 + push {r4,r5,lr} + ldr r5, _08053AE0 + ldr r0, _08053AE4 + 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, _08053AE8 + 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 + .align 2, 0 +_08053AE0: .4byte 0x02024084 +_08053AE4: .4byte 0x0202420c +_08053AE8: .4byte 0x02024214 +_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, _08053B20 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08053B34 + ldr r2, _08053B24 + ldr r0, _08053B28 + 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, _08053B2C + ldr r0, _08053B30 + str r0, [r1] + b _08053B8C + .align 2, 0 +_08053B20: .4byte 0x0202427c +_08053B24: .4byte 0x020242bc +_08053B28: .4byte 0x0202420b +_08053B2C: .4byte 0x02024214 +_08053B30: .4byte 0x082d8a60 +_08053B34: + ldr r5, _08053B94 + ldr r4, _08053B98 + 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, _08053B9C + ldr r2, _08053BA0 + ldr r0, _08053BA4 + 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, _08053BA8 + 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 + .align 2, 0 +_08053B94: .4byte 0x020242bc +_08053B98: .4byte 0x0202420b +_08053B9C: .4byte 0x02024400 +_08053BA0: .4byte 0x0831c898 +_08053BA4: .4byte 0x020241ea +_08053BA8: .4byte 0x02024214 + thumb_func_end sub_8053AF8 + + thumb_func_start atkB6_happinesstodamagecalculation +atkB6_happinesstodamagecalculation: @ 8053BAC + push {r4,lr} + ldr r2, _08053BD8 + ldr r0, _08053BDC + 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, _08053BE0 + ldr r2, _08053BE4 + ldr r0, _08053BE8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2B + ldrb r1, [r0] + b _08053C02 + .align 2, 0 +_08053BD8: .4byte 0x0831c898 +_08053BDC: .4byte 0x020241ea +_08053BE0: .4byte 0x02024400 +_08053BE4: .4byte 0x02024084 +_08053BE8: .4byte 0x0202420b +_08053BEC: + ldr r4, _08053C20 + ldr r2, _08053C24 + ldr r0, _08053C28 + 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, _08053C2C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08053C20: .4byte 0x02024400 +_08053C24: .4byte 0x02024084 +_08053C28: .4byte 0x0202420b +_08053C2C: .4byte 0x02024214 + 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, _08053C48 + movs r0, 0x28 + strh r0, [r1] + b _08053C8E + .align 2, 0 +_08053C48: .4byte 0x02024400 +_08053C4C: + cmp r4, 0xB1 + bgt _08053C5C + ldr r1, _08053C58 + movs r0, 0x50 + strh r0, [r1] + b _08053C8E + .align 2, 0 +_08053C58: .4byte 0x02024400 +_08053C5C: + cmp r4, 0xCB + bgt _08053C6C + ldr r1, _08053C68 + movs r0, 0x78 + strh r0, [r1] + b _08053C8E + .align 2, 0 +_08053C68: .4byte 0x02024400 +_08053C6C: + ldr r3, _08053C98 + ldr r2, _08053C9C + ldr r0, _08053CA0 + 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, _08053CA4 + ldr r0, _08053CA8 + b _08053CE6 + .align 2, 0 +_08053C98: .4byte 0x020241f0 +_08053C9C: .4byte 0x02024084 +_08053CA0: .4byte 0x0202420c +_08053CA4: .4byte 0x02024214 +_08053CA8: .4byte 0x082d8a30 +_08053CAC: + ldr r2, _08053CC8 + ldr r0, _08053CCC + 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, _08053CD0 + ldr r0, _08053CD4 + b _08053CE6 + .align 2, 0 +_08053CC8: .4byte 0x02024084 +_08053CCC: .4byte 0x0202420c +_08053CD0: .4byte 0x02024214 +_08053CD4: .4byte 0x082d9efb +_08053CD8: + ldr r2, _08053CF0 + ldrb r1, [r2] + movs r0, 0xF7 + ands r0, r1 + strb r0, [r2] + ldr r1, _08053CF4 + ldr r0, _08053CF8 +_08053CE6: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08053CF0: .4byte 0x0202427c +_08053CF4: .4byte 0x02024214 +_08053CF8: .4byte 0x082d9ee1 + thumb_func_end atkB7_presentdamagecalculation + + thumb_func_start atkB8_setsafeguard +atkB8_setsafeguard: @ 8053CFC + push {r4-r7,lr} + ldr r7, _08053D30 + ldrb r0, [r7] + bl battle_get_per_side_status + ldr r4, _08053D34 + 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, _08053D38 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08053D3C + movs r0, 0 + strb r0, [r1, 0x5] + b _08053D88 + .align 2, 0 +_08053D30: .4byte 0x0202420b +_08053D34: .4byte 0x0202428e +_08053D38: .4byte 0x0202427c +_08053D3C: .4byte 0x02024332 +_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, _08053D98 + 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, _08053D9C + strb r4, [r0, 0x5] +_08053D88: + ldr r1, _08053DA0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08053D98: .4byte 0x02024294 +_08053D9C: .4byte 0x02024332 +_08053DA0: .4byte 0x02024214 + 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, _08053DCC + movs r0, 0xA + strh r0, [r1] + movs r3, 0x4 + b _08053E3C + .align 2, 0 +_08053DCC: .4byte 0x02024400 +_08053DD0: + cmp r3, 0xE + bgt _08053DE4 + ldr r1, _08053DE0 + movs r0, 0x1E + strh r0, [r1] + movs r3, 0x5 + b _08053E3C + .align 2, 0 +_08053DE0: .4byte 0x02024400 +_08053DE4: + cmp r3, 0x22 + bgt _08053DF8 + ldr r1, _08053DF4 + movs r0, 0x32 + strh r0, [r1] + movs r3, 0x6 + b _08053E3C + .align 2, 0 +_08053DF4: .4byte 0x02024400 +_08053DF8: + cmp r3, 0x40 + bgt _08053E0C + ldr r1, _08053E08 + movs r0, 0x46 + strh r0, [r1] + movs r3, 0x7 + b _08053E3C + .align 2, 0 +_08053E08: .4byte 0x02024400 +_08053E0C: + cmp r3, 0x54 + bgt _08053E20 + ldr r1, _08053E1C + movs r0, 0x5A + strh r0, [r1] + movs r3, 0x8 + b _08053E3C + .align 2, 0 +_08053E1C: .4byte 0x02024400 +_08053E20: + cmp r3, 0x5E + bgt _08053E34 + ldr r1, _08053E30 + movs r0, 0x6E + strh r0, [r1] + movs r3, 0x9 + b _08053E3C + .align 2, 0 +_08053E30: .4byte 0x02024400 +_08053E34: + ldr r1, _08053EA8 + movs r0, 0x96 + strh r0, [r1] + movs r3, 0xA +_08053E3C: + ldr r1, _08053EAC + 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, _08053EB0 + strb r2, [r1] + ldr r0, _08053EB4 + ldrb r3, [r0] + adds r6, r1, 0 + ldr r0, _08053EB8 + mov r8, r0 + cmp r2, r3 + bcs _08053E94 + adds r4, r6, 0 + ldr r0, _08053EBC + ldrb r5, [r0] + ldr r1, _08053EC0 + mov r12, r1 + ldr r7, _08053EC4 +_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 + .align 2, 0 +_08053EA8: .4byte 0x02024400 +_08053EAC: .4byte 0x02022f58 +_08053EB0: .4byte 0x0202420c +_08053EB4: .4byte 0x0202406c +_08053EB8: .4byte 0x02024214 +_08053EBC: .4byte 0x0202420b +_08053EC0: .4byte 0x0832a328 +_08053EC4: .4byte 0x02024210 + 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, _08053EEC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08053EF8 + ldr r0, _08053EF0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08053EF4 + movs r0, 0x1 + b _08053F12 + .align 2, 0 +_08053EEC: .4byte 0x02024212 +_08053EF0: .4byte 0x0202420b +_08053EF4: + movs r0, 0 + b _08053F12 +_08053EF8: + ldr r0, _08053F0C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08053F10 + movs r0, 0x3 + b _08053F12 + .align 2, 0 +_08053F0C: .4byte 0x0202420b +_08053F10: + movs r0, 0x2 +_08053F12: + bl battle_get_side_with_given_state + ldr r1, _08053FEC + strb r0, [r1] + ldr r0, _08053FF0 + ldr r1, _08053FEC + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08053F2A + b _08054030 +_08053F2A: + ldr r5, _08053FF4 + ldr r0, _08053FF8 + ldr r1, [r0] + adds r1, r3, r1 + ldrb r2, [r5] + ldrb r1, [r1, 0xC] + cmp r2, r1 + bne _08054030 + ldr r4, _08053FFC + 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, _08054000 + 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, _08054004 + lsls r1, r3, 1 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0xE4 + bne _08054030 + movs r1, 0 + ldr r0, _08054008 + ldr r2, _0805400C + mov r8, r2 + ldr r7, _08054010 + mov r10, r7 + ldr r2, _08054014 + mov r9, r2 + ldr r7, _08054018 + mov r12, r7 + ldrb r2, [r0] + cmp r1, r2 + bge _08053FB6 + ldr r6, _0805401C + ldr r5, _08053FEC + ldr r4, _08054020 + 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, _08053FEC + ldrb r0, [r2] + ldr r7, _08053FF8 + 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, _08054024 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + movs r0, 0x1 + ldr r1, _08054028 + strb r0, [r1, 0x18] + mov r2, r12 + ldr r0, [r2] + ldr r1, _0805402C + ands r0, r1 + str r0, [r2] + b _0805404A + .align 2, 0 +_08053FEC: .4byte 0x0202420c +_08053FF0: .4byte 0x0202421c +_08053FF4: .4byte 0x0202420b +_08053FF8: .4byte 0x0202449c +_08053FFC: .4byte 0x02024084 +_08054000: .4byte 0x020242bc +_08054004: .4byte 0x02024274 +_08054008: .4byte 0x0202406c +_0805400C: .4byte 0x020241ea +_08054010: .4byte 0x020241e8 +_08054014: .4byte 0x020241e9 +_08054018: .4byte 0x02024280 +_0805401C: .4byte 0x0202407e +_08054020: .4byte 0x0202407a +_08054024: .4byte 0x02024214 +_08054028: .4byte 0x02024474 +_0805402C: .4byte 0xfffffbff +_08054030: + ldr r3, _08054058 + 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 + .align 2, 0 +_08054058: .4byte 0x02024214 + thumb_func_end atkBA_802B140 + + thumb_func_start sub_805405C +sub_805405C: @ 805405C + push {lr} + ldr r2, _0805407C + ldrh r1, [r2] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08054088 + ldr r2, _08054080 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08054084 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0805409A + .align 2, 0 +_0805407C: .4byte 0x020243cc +_08054080: .4byte 0x0202427c +_08054084: .4byte 0x02024332 +_08054088: + movs r0, 0x20 + strh r0, [r2] + ldr r1, _080540A8 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r0, _080540AC + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_0805409A: + ldr r1, _080540B0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080540A8: .4byte 0x02024332 +_080540AC: .4byte 0x020243d0 +_080540B0: .4byte 0x02024214 + thumb_func_end sub_805405C + + thumb_func_start atkBC_maxattackhalvehp +atkBC_maxattackhalvehp: @ 80540B4 + push {r4,r5,lr} + ldr r5, _08054100 + ldr r4, _08054104 + 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, _08054108 + 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, _0805410C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805412A + .align 2, 0 +_08054100: .4byte 0x02024084 +_08054104: .4byte 0x0202420b +_08054108: .4byte 0x020241f0 +_0805410C: .4byte 0x02024214 +_08054110: + ldr r3, _08054130 + 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 + .align 2, 0 +_08054130: .4byte 0x02024214 + thumb_func_end atkBC_maxattackhalvehp + + thumb_func_start atkBD_copyfoestats +atkBD_copyfoestats: @ 8054134 + push {r4-r7,lr} + movs r2, 0 + ldr r7, _0805416C + ldr r6, _08054170 + movs r4, 0x58 + ldr r3, _08054174 + ldr r5, _08054178 +_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 + .align 2, 0 +_0805416C: .4byte 0x02024214 +_08054170: .4byte 0x0202420b +_08054174: .4byte 0x0202409c +_08054178: .4byte 0x0202420c + thumb_func_end atkBD_copyfoestats + + thumb_func_start atkBE_breakfree +atkBE_breakfree: @ 805417C + push {r4-r6,lr} + ldr r1, _080541EC + ldr r5, _080541F0 + 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, _080541F4 + ldr r3, _080541F8 + 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, _080541FC + ands r0, r2 + str r0, [r1] + ldrb r0, [r5] + ldr r1, _08054200 + ldr r2, [r1] + adds r0, r2 + ldrb r0, [r0, 0x14] + strb r0, [r3] + ldr r1, _08054204 + 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, _08054208 + ldr r0, _0805420C + b _080542BA + .align 2, 0 +_080541EC: .4byte 0x02024084 +_080541F0: .4byte 0x0202420b +_080541F4: .4byte 0x02024474 +_080541F8: .4byte 0x0202420c +_080541FC: .4byte 0xffff1fff +_08054200: .4byte 0x0202449c +_08054204: .4byte 0x02022f58 +_08054208: .4byte 0x02024214 +_0805420C: .4byte 0x082dafc5 +_08054210: + ldr r4, _08054244 + 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, _08054248 + ldr r0, _0805424C + b _080542BA + .align 2, 0 +_08054244: .4byte 0x020242ac +_08054248: .4byte 0x02024214 +_0805424C: .4byte 0x082dafd6 +_08054250: + adds r0, r2, 0 + bl battle_side_get_owner + ldr r4, _080542A0 + 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, _080542A4 + ands r1, r2 + movs r4, 0 + strh r1, [r0] + ldrb r0, [r5] + bl battle_side_get_owner + ldr r2, _080542A8 + 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, _080542AC + ldr r0, _080542B0 + b _080542BA + .align 2, 0 +_080542A0: .4byte 0x0202428e +_080542A4: .4byte 0x0000ffef +_080542A8: .4byte 0x02024294 +_080542AC: .4byte 0x02024214 +_080542B0: .4byte 0x082dafdd +_080542B4: + ldr r1, _080542C4 + ldr r0, [r1] + adds r0, 0x1 +_080542BA: + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080542C4: .4byte 0x02024214 + thumb_func_end atkBE_breakfree + + thumb_func_start atkBF_setcurled +atkBF_setcurled: @ 80542C8 + ldr r1, _080542EC + ldr r0, _080542F0 + 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, _080542F4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_080542EC: .4byte 0x02024084 +_080542F0: .4byte 0x0202420b +_080542F4: .4byte 0x02024214 + thumb_func_end atkBF_setcurled + + thumb_func_start atkC0_recoverbasedonsunlight +atkC0_recoverbasedonsunlight: @ 80542F8 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _08054364 + ldr r5, _08054368 + ldrb r0, [r5] + strb r0, [r1] + ldr r7, _0805436C + 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, _08054370 + 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, _08054374 + ldr r2, _0805436C + ldr r0, _08054368 + 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 + .align 2, 0 +_08054364: .4byte 0x0202420c +_08054368: .4byte 0x0202420b +_0805436C: .4byte 0x02024084 +_08054370: .4byte 0x020243cc +_08054374: .4byte 0x020241f0 +_08054378: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _080543A4 + ldr r4, _080543A0 + 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 + .align 2, 0 +_080543A0: .4byte 0x020241f0 +_080543A4: + ldr r1, _080543D0 + 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, _080543D4 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080543F2 + .align 2, 0 +_080543D0: .4byte 0x020241f0 +_080543D4: .4byte 0x02024214 +_080543D8: + ldr r3, _080543FC + 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 + .align 2, 0 +_080543FC: .4byte 0x02024214 + 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, _08054510 + ldr r0, _08054514 + 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, _08054518 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + movs r1, 0x3F + bl __divsi3 + adds r0, 0x1E + strh r0, [r5] + ldr r6, _0805451C + 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, _08054520 + 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 + .align 2, 0 +_08054510: .4byte 0x02024084 +_08054514: .4byte 0x0202420b +_08054518: .4byte 0x02024400 +_0805451C: .4byte 0x0202449c +_08054520: .4byte 0x02024214 + thumb_func_end sub_8054400 + + thumb_func_start atkC2_selectnexttarget +atkC2_selectnexttarget: @ 8054524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _08054580 + movs r1, 0 + strb r1, [r0] + ldr r1, _08054584 + ldrb r1, [r1] + adds r6, r0, 0 + ldr r0, _08054588 + mov r8, r0 + cmp r1, 0 + beq _0805456E + adds r3, r6, 0 + ldr r0, _0805458C + ldrb r5, [r0] + ldr r0, _08054590 + mov r12, r0 + adds r4, r1, 0 + ldr r7, _08054594 +_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 + .align 2, 0 +_08054580: .4byte 0x0202420c +_08054584: .4byte 0x0202406c +_08054588: .4byte 0x02024214 +_0805458C: .4byte 0x0202420b +_08054590: .4byte 0x0832a328 +_08054594: .4byte 0x02024210 + 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, _080545D0 + mov r8, r0 + ldr r6, _080545D4 + ldrb r1, [r6] + adds r0, r1, r0 + ldrb r7, [r0] + cmp r7, 0 + beq _080545DC + ldr r3, _080545D8 + 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 + .align 2, 0 +_080545D0: .4byte 0x020243d0 +_080545D4: .4byte 0x0202420c +_080545D8: .4byte 0x02024214 +_080545DC: + adds r0, r1, 0 + bl battle_get_per_side_status + ldr r4, _080546A0 + 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, _080546A4 + mov r9, r1 + ldrh r1, [r1] + strh r1, [r0] + mov r0, r8 + adds r0, 0x4 + ldrb r2, [r6] + adds r0, r2 + ldr r5, _080546A8 + 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, _080546AC + 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, _080546B0 + 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, _080546B4 + cmp r1, r0 + bne _080546BC + ldr r0, _080546B8 + mov r1, r10 + strb r1, [r0, 0x5] + b _080546C4 + .align 2, 0 +_080546A0: .4byte 0x0202428e +_080546A4: .4byte 0x020241ea +_080546A8: .4byte 0x0202420b +_080546AC: .4byte 0x02024084 +_080546B0: .4byte 0x0202433c +_080546B4: .4byte 0x00000161 +_080546B8: .4byte 0x02024332 +_080546BC: + ldr r0, _080546DC + mov r2, sp + ldrb r2, [r2, 0x10] + strb r2, [r0, 0x5] +_080546C4: + ldr r1, _080546E0 + 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 + .align 2, 0 +_080546DC: .4byte 0x02024332 +_080546E0: .4byte 0x02024214 + 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, _08054728 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r7, _0805472C + cmp r0, 0 + bne _080546FE + ldr r7, _08054730 +_080546FE: + ldr r2, _08054734 + ldr r0, _08054738 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08054740 + ldr r3, _0805473C + 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 + .align 2, 0 +_08054728: .4byte 0x0202420b +_0805472C: .4byte 0x02024744 +_08054730: .4byte 0x020244ec +_08054734: .4byte 0x02024084 +_08054738: .4byte 0x0202420c +_0805473C: .4byte 0x02024214 +_08054740: + ldr r6, _0805487C + 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, _0805487C + mov r9, r1 + ldrb r2, [r1] + cmp r2, 0x5 + bhi _080548A8 + ldr r1, _08054880 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r6, _08054884 + ldrb r0, [r6] + strb r0, [r1, 0x2] + strb r2, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, _08054888 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + ldr r2, _0805488C + mov r8, r2 + ldr r5, _08054890 + 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, _08054894 + ldr r0, _08054898 + 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, _0805489C + ldr r1, _080548A0 + 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, _080548A4 + 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 + .align 2, 0 +_0805487C: .4byte 0x02024332 +_08054880: .4byte 0x02022f58 +_08054884: .4byte 0x0202420b +_08054888: .4byte 0x02024214 +_0805488C: .4byte 0x020241f0 +_08054890: .4byte 0x083203cc +_08054894: .4byte 0x0831c898 +_08054898: .4byte 0x020241ea +_0805489C: .4byte 0x02024084 +_080548A0: .4byte 0x0202420c +_080548A4: .4byte 0x0202433c +_080548A8: + mov r0, r8 + cmp r0, 0 + beq _080548C8 + ldr r3, _080548C4 + 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 + .align 2, 0 +_080548C4: .4byte 0x02024214 +_080548C8: + ldr r3, _080548F0 + 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 + .align 2, 0 +_080548F0: .4byte 0x02024214 + thumb_func_end atkC4_802B910 + + thumb_func_start atkC5_hidepreattack +atkC5_hidepreattack: @ 80548F4 + push {lr} + ldr r0, _08054908 + ldrh r1, [r0] + cmp r1, 0x5B + beq _08054934 + cmp r1, 0x5B + bgt _0805490C + cmp r1, 0x13 + beq _08054918 + b _08054960 + .align 2, 0 +_08054908: .4byte 0x020241ea +_0805490C: + ldr r0, _08054928 + cmp r1, r0 + beq _0805494C + adds r0, 0x31 + cmp r1, r0 + bne _08054960 +_08054918: + ldr r2, _0805492C + ldr r0, _08054930 + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x40 + b _0805495C + .align 2, 0 +_08054928: .4byte 0x00000123 +_0805492C: .4byte 0x020242ac +_08054930: .4byte 0x0202420b +_08054934: + ldr r2, _08054944 + ldr r0, _08054948 + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + b _0805495C + .align 2, 0 +_08054944: .4byte 0x020242ac +_08054948: .4byte 0x0202420b +_0805494C: + ldr r2, _0805496C + ldr r0, _08054970 + 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, _08054974 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0805496C: .4byte 0x020242ac +_08054970: .4byte 0x0202420b +_08054974: .4byte 0x02024214 + thumb_func_end atkC5_hidepreattack + + thumb_func_start atkC6_unhidepostattack +atkC6_unhidepostattack: @ 8054978 + push {lr} + ldr r0, _0805498C + ldrh r1, [r0] + cmp r1, 0x5B + beq _080549BC + cmp r1, 0x5B + bgt _08054990 + cmp r1, 0x13 + beq _0805499C + b _080549EA + .align 2, 0 +_0805498C: .4byte 0x020241ea +_08054990: + ldr r0, _080549B0 + cmp r1, r0 + beq _080549D8 + adds r0, 0x31 + cmp r1, r0 + bne _080549EA +_0805499C: + ldr r2, _080549B4 + ldr r0, _080549B8 + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x41 + negs r2, r2 + b _080549E6 + .align 2, 0 +_080549B0: .4byte 0x00000123 +_080549B4: .4byte 0x020242ac +_080549B8: .4byte 0x0202420b +_080549BC: + ldr r2, _080549D0 + ldr r0, _080549D4 + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x81 + negs r2, r2 + b _080549E6 + .align 2, 0 +_080549D0: .4byte 0x020242ac +_080549D4: .4byte 0x0202420b +_080549D8: + ldr r2, _080549F8 + ldr r0, _080549FC + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + ldr r2, _08054A00 +_080549E6: + ands r0, r2 + str r0, [r1] +_080549EA: + ldr r1, _08054A04 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080549F8: .4byte 0x020242ac +_080549FC: .4byte 0x0202420b +_08054A00: .4byte 0xfffbffff +_08054A04: .4byte 0x02024214 + thumb_func_end atkC6_unhidepostattack + + thumb_func_start atkC7_setminimize +atkC7_setminimize: @ 8054A08 + push {lr} + ldr r0, _08054A38 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08054A2C + ldr r2, _08054A3C + ldr r0, _08054A40 + 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, _08054A44 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08054A38: .4byte 0x02024280 +_08054A3C: .4byte 0x020242ac +_08054A40: .4byte 0x0202420b +_08054A44: .4byte 0x02024214 + thumb_func_end atkC7_setminimize + + thumb_func_start sub_8054A48 +sub_8054A48: @ 8054A48 + push {lr} + ldr r3, _08054A6C + ldrh r1, [r3] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08054A78 + ldr r2, _08054A70 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08054A74 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08054A86 + .align 2, 0 +_08054A6C: .4byte 0x020243cc +_08054A70: .4byte 0x0202427c +_08054A74: .4byte 0x02024332 +_08054A78: + strh r2, [r3] + ldr r0, _08054A94 + movs r1, 0x5 + strb r1, [r0, 0x5] + ldr r0, _08054A98 + adds r0, 0x28 + strb r1, [r0] +_08054A86: + ldr r1, _08054A9C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08054A94: .4byte 0x02024332 +_08054A98: .4byte 0x020243d0 +_08054A9C: .4byte 0x02024214 + thumb_func_end sub_8054A48 + + thumb_func_start atkC9_jumpifattackandspecialattackcannotfall +atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 + push {r4,lr} + ldr r2, _08054AE4 + ldr r0, _08054AE8 + 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, _08054AEC + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _08054AF4 + ldr r3, _08054AF0 + 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 + .align 2, 0 +_08054AE4: .4byte 0x02024084 +_08054AE8: .4byte 0x0202420c +_08054AEC: .4byte 0x02024332 +_08054AF0: .4byte 0x02024214 +_08054AF4: + ldr r4, _08054B28 + ldr r0, _08054B2C + ldrb r0, [r0] + strb r0, [r4] + ldr r2, _08054B30 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + str r0, [r2] + ldr r1, _08054B34 + 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, _08054B38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08054B20: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08054B28: .4byte 0x02024064 +_08054B2C: .4byte 0x0202420b +_08054B30: .4byte 0x020241f0 +_08054B34: .4byte 0x00007fff +_08054B38: .4byte 0x02024214 + thumb_func_end atkC9_jumpifattackandspecialattackcannotfall + + thumb_func_start atkCA_setforcedtarget +atkCA_setforcedtarget: @ 8054B3C + push {r4,r5,lr} + ldr r4, _08054B7C + ldrb r0, [r4] + bl battle_side_get_owner + ldr r5, _08054B80 + 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, _08054B84 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08054B7C: .4byte 0x0202420b +_08054B80: .4byte 0x02024294 +_08054B84: .4byte 0x02024214 + thumb_func_end atkCA_setforcedtarget + + thumb_func_start atkCB_setcharge +atkCB_setcharge: @ 8054B88 + push {r4,lr} + ldr r0, _08054BDC + ldr r3, _08054BE0 + 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, _08054BE4 + 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, _08054BE8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08054BDC: .4byte 0x020242ac +_08054BE0: .4byte 0x0202420b +_08054BE4: .4byte 0x020242bc +_08054BE8: .4byte 0x02024214 + thumb_func_end atkCB_setcharge + + thumb_func_start atkCC_callterrainattack +atkCC_callterrainattack: @ 8054BEC + push {r4,lr} + ldr r2, _08054C3C + ldr r0, [r2] + ldr r1, _08054C40 + ands r0, r1 + str r0, [r2] + ldr r4, _08054C44 + ldr r1, _08054C48 + ldr r0, _08054C4C + 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, _08054C50 + strb r0, [r1] + ldr r3, _08054C54 + ldr r2, _08054C58 + 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, _08054C5C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08054C3C: .4byte 0x02024280 +_08054C40: .4byte 0xfffffbff +_08054C44: .4byte 0x020241ea +_08054C48: .4byte 0x0831c414 +_08054C4C: .4byte 0x02022ff0 +_08054C50: .4byte 0x0202420c +_08054C54: .4byte 0x082d86a8 +_08054C58: .4byte 0x0831c898 +_08054C5C: .4byte 0x02024214 + thumb_func_end atkCC_callterrainattack + + thumb_func_start atkCD_cureifburnedparalysedorpoisoned +atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, _08054CAC + ldr r3, _08054CB0 + 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, _08054CB4 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r4, _08054CB8 + 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 + .align 2, 0 +_08054CAC: .4byte 0x02024084 +_08054CB0: .4byte 0x0202420b +_08054CB4: .4byte 0x02024214 +_08054CB8: .4byte 0x02024064 +_08054CBC: + ldr r3, _08054CE0 + 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 + .align 2, 0 +_08054CE0: .4byte 0x02024214 + thumb_func_end atkCD_cureifburnedparalysedorpoisoned + + thumb_func_start atkCE_settorment +atkCE_settorment: @ 8054CE4 + push {lr} + ldr r1, _08054D1C + ldr r0, _08054D20 + 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, _08054D24 + 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 + .align 2, 0 +_08054D1C: .4byte 0x02024084 +_08054D20: .4byte 0x0202420c +_08054D24: .4byte 0x02024214 +_08054D28: + orrs r1, r2 + str r1, [r0] + ldr r1, _08054D38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08054D34: + pop {r0} + bx r0 + .align 2, 0 +_08054D38: .4byte 0x02024214 + thumb_func_end atkCE_settorment + + thumb_func_start atkCF_jumpifnodamage +atkCF_jumpifnodamage: @ 8054D3C + push {lr} + ldr r2, _08054D68 + ldr r0, _08054D6C + 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, _08054D70 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054D8E + .align 2, 0 +_08054D68: .4byte 0x0202433c +_08054D6C: .4byte 0x0202420b +_08054D70: .4byte 0x02024214 +_08054D74: + ldr r3, _08054D94 + 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 + .align 2, 0 +_08054D94: .4byte 0x02024214 + thumb_func_end atkCF_jumpifnodamage + + thumb_func_start atkD0_settaunt +atkD0_settaunt: @ 8054D98 + push {r4,lr} + ldr r4, _08054DDC + ldr r3, _08054DE0 + 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, _08054DE4 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054E02 + .align 2, 0 +_08054DDC: .4byte 0x020242bc +_08054DE0: .4byte 0x0202420c +_08054DE4: .4byte 0x02024214 +_08054DE8: + ldr r3, _08054E08 + 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 + .align 2, 0 +_08054E08: .4byte 0x02024214 + thumb_func_end atkD0_settaunt + + thumb_func_start atkD1_sethelpinghand +atkD1_sethelpinghand: @ 8054E0C + push {r4,lr} + ldr r4, _08054E74 + 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, _08054E78 + strb r0, [r3] + ldr r0, _08054E7C + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08054E90 + ldr r0, _08054E80 + ldrb r1, [r0] + ldr r2, _08054E84 + ldrb r3, [r3] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054E90 + ldr r1, _08054E88 + 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, _08054E8C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054EAA + .align 2, 0 +_08054E74: .4byte 0x0202420b +_08054E78: .4byte 0x0202420c +_08054E7C: .4byte 0x02022fec +_08054E80: .4byte 0x02024210 +_08054E84: .4byte 0x0832a328 +_08054E88: .4byte 0x0202433c +_08054E8C: .4byte 0x02024214 +_08054E90: + ldr r3, _08054EB0 + 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 + .align 2, 0 +_08054EB0: .4byte 0x02024214 + 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, _08054FB8 + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + bne _08054F9A + ldr r0, _08054FBC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08054EE8 + ldr r0, [r4] + ldr r1, _08054FC0 + ands r0, r1 + cmp r0, 0 + beq _08054F9A +_08054EE8: + ldr r6, _08054FBC + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r7, _08054FC4 + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08054FB8 + ldr r0, [r0] + ldr r1, _08054FC0 + ands r0, r1 + cmp r0, 0 + bne _08054F46 + ldr r0, _08054FC8 + adds r2, r0, 0 + adds r2, 0x29 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r4, _08054FCC + ldr r3, _08054FD0 + 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, _08054FD4 + mov r8, r0 + ldr r1, _08054FBC + 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, _08054FC4 + 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, _08054FC4 + 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, _08054FD8 + 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 + .align 2, 0 +_08054FB8: .4byte 0x02022fec +_08054FBC: .4byte 0x0202420b +_08054FC0: .4byte 0x0a3f0902 +_08054FC4: .4byte 0x0202420c +_08054FC8: .4byte 0x020243d0 +_08054FCC: .4byte 0x0832a328 +_08054FD0: .4byte 0x0202406e +_08054FD4: .4byte 0x02024084 +_08054FD8: .4byte 0x02024214 +_08054FDC: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3C + bne _08055010 + ldr r1, _08055004 + ldr r0, _08055008 + str r0, [r1] + ldr r1, _0805500C + 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 + .align 2, 0 +_08055004: .4byte 0x02024214 +_08055008: .4byte 0x082db63f +_0805500C: .4byte 0x0202420a +_08055010: + ldr r3, _080550FC + 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, _08055100 + 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, _08055104 + ldr r3, _08055100 + 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, _08055100 + 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, _08055100 + ldrb r0, [r1] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r3, [r0] + ldr r2, _08055100 + 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, _08055108 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r1, _0805510C + 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, _08055110 + 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, _08055114 + movs r0, 0x2 + b _08055130 + .align 2, 0 +_080550FC: .4byte 0x0202449c +_08055100: .4byte 0x0202420b +_08055104: .4byte 0x02024064 +_08055108: .4byte 0x02024214 +_0805510C: .4byte 0x02022f58 +_08055110: .4byte 0x02022f68 +_08055114: .4byte 0x02024332 +_08055118: + ldrh r0, [r6] + cmp r0, 0 + beq _0805512C + ldr r0, _08055128 + movs r1, 0 + strb r1, [r0, 0x5] + b _08055132 + .align 2, 0 +_08055128: .4byte 0x02024332 +_0805512C: + ldr r1, _08055144 + 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 + .align 2, 0 +_08055144: .4byte 0x02024332 + thumb_func_end sub_8054EB4 + + thumb_func_start sub_8055148 +sub_8055148: @ 8055148 + push {r4,lr} + ldr r3, _08055188 + ldr r4, _0805518C + 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, _08055190 + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + strb r1, [r0] + ldr r1, _08055194 + ldrb r0, [r4] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, _08055198 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080551B6 + .align 2, 0 +_08055188: .4byte 0x02024084 +_0805518C: .4byte 0x0202420c +_08055190: .4byte 0x0202420b +_08055194: .4byte 0x0202420a +_08055198: .4byte 0x02024214 +_0805519C: + ldr r3, _080551BC + 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 + .align 2, 0 +_080551BC: .4byte 0x02024214 + thumb_func_end sub_8055148 + + thumb_func_start atkD4_802C408 +atkD4_802C408: @ 80551C0 + push {r4-r7,lr} + ldr r7, _080551D4 + ldr r2, [r7] + ldrb r3, [r2, 0x1] + cmp r3, 0 + beq _080551D8 + cmp r3, 0x1 + beq _08055210 + b _0805528C + .align 2, 0 +_080551D4: .4byte 0x02024214 +_080551D8: + ldr r1, _08055204 + ldr r4, _08055208 + 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, _0805520C + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x6 + b _0805528A + .align 2, 0 +_08055204: .4byte 0x020243d0 +_08055208: .4byte 0x0202420b +_0805520C: .4byte 0x0202406e +_08055210: + ldr r1, _08055274 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r4, _08055278 + ldrb r0, [r4] + strb r0, [r1, 0x2] + ldr r0, _0805527C + 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, _08055280 + ldr r6, _08055284 + 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 + .align 2, 0 +_08055274: .4byte 0x02022f58 +_08055278: .4byte 0x0202420c +_0805527C: .4byte 0x020243d0 +_08055280: .4byte 0x020241f0 +_08055284: .4byte 0x02024084 +_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, _080552CC + ldr r0, _080552D0 + 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, _080552D4 + 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 + .align 2, 0 +_080552CC: .4byte 0x020242ac +_080552D0: .4byte 0x0202420b +_080552D4: .4byte 0x02024214 +_080552D8: + orrs r1, r3 + str r1, [r2] + ldr r1, _080552E8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080552E4: + pop {r0} + bx r0 + .align 2, 0 +_080552E8: .4byte 0x02024214 + thumb_func_end sub_8055294 + + thumb_func_start atkD6_doubledamagedealtifdamaged +atkD6_doubledamagedealtifdamaged: @ 80552EC + push {lr} + ldr r3, _08055338 + ldr r0, _0805533C + 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, _08055340 + 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, _08055340 + ldrb r0, [r0, 0xD] + ldrb r1, [r1] + cmp r0, r1 + bne _0805532A +_08055324: + ldr r1, _08055344 + movs r0, 0x2 + strb r0, [r1, 0xE] +_0805532A: + ldr r1, _08055348 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08055338: .4byte 0x0202433c +_0805533C: .4byte 0x0202420b +_08055340: .4byte 0x0202420c +_08055344: .4byte 0x02024474 +_08055348: .4byte 0x02024214 + thumb_func_end atkD6_doubledamagedealtifdamaged + + thumb_func_start sub_805534C +sub_805534C: @ 805534C + push {r4,lr} + ldr r1, _08055390 + ldr r0, _08055394 + 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, _08055398 + movs r0, 0x58 + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080553A0 +_08055374: + ldr r3, _0805539C + 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 + .align 2, 0 +_08055390: .4byte 0x020242ac +_08055394: .4byte 0x0202420c +_08055398: .4byte 0x02024084 +_0805539C: .4byte 0x02024214 +_080553A0: + movs r0, 0x80 + lsls r0, 5 + orrs r2, r0 + str r2, [r4] + ldr r1, _080553B8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080553B0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080553B8: .4byte 0x02024214 + thumb_func_end sub_805534C + + thumb_func_start atkD8_setdamagetohealthdifference +atkD8_setdamagetohealthdifference: @ 80553BC + push {lr} + ldr r2, _080553F8 + ldr r0, _080553FC + ldrb r0, [r0] + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + ldr r0, _08055400 + 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, _08055404 + 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 + .align 2, 0 +_080553F8: .4byte 0x02024084 +_080553FC: .4byte 0x0202420c +_08055400: .4byte 0x0202420b +_08055404: .4byte 0x02024214 +_08055408: + ldr r2, _08055420 + ldrh r0, [r3, 0x28] + ldrh r1, [r1, 0x28] + subs r0, r1 + str r0, [r2] + ldr r1, _08055424 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805541A: + pop {r0} + bx r0 + .align 2, 0 +_08055420: .4byte 0x020241f0 +_08055424: .4byte 0x02024214 + thumb_func_end atkD8_setdamagetohealthdifference + + thumb_func_start atkD9_scaledamagebyhealthratio +atkD9_scaledamagebyhealthratio: @ 8055428 + push {r4,lr} + ldr r4, _08055474 + ldrh r0, [r4] + cmp r0, 0 + bne _08055464 + ldr r2, _08055478 + ldr r0, _0805547C + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r3, [r0, 0x1] + ldr r2, _08055480 + ldr r0, _08055484 + 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, _08055488 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08055474: .4byte 0x02024400 +_08055478: .4byte 0x0831c898 +_0805547C: .4byte 0x020241ea +_08055480: .4byte 0x02024084 +_08055484: .4byte 0x0202420b +_08055488: .4byte 0x02024214 + thumb_func_end atkD9_scaledamagebyhealthratio + + thumb_func_start atkDA_abilityswap +atkDA_abilityswap: @ 805548C + push {r4-r6,lr} + ldr r5, _080554F0 + ldr r0, _080554F4 + 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, _080554F8 + 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, _080554F8 + ldrb r0, [r6] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + ldrb r3, [r0] + cmp r3, 0x19 + beq _080554D4 + ldr r0, _080554FC + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08055504 +_080554D4: + ldr r3, _08055500 + 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 + .align 2, 0 +_080554F0: .4byte 0x02024084 +_080554F4: .4byte 0x0202420b +_080554F8: .4byte 0x0202420c +_080554FC: .4byte 0x0202427c +_08055500: .4byte 0x02024214 +_08055504: + ldrb r1, [r2] + strb r3, [r2] + ldrb r0, [r6] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + strb r1, [r0] + ldr r1, _08055520 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805551A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08055520: .4byte 0x02024214 + 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, _08055544 + ldr r4, _08055548 + 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 + .align 2, 0 +_08055544: .4byte 0x020242ac +_08055548: .4byte 0x0202420b +_0805554C: + ldr r0, _0805556C + 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, _08055570 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080555EE + .align 2, 0 +_0805556C: .4byte 0x020242ac +_08055570: .4byte 0x02024214 +_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, _0805561C + mov r9, r7 + ldr r0, _08055620 + 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, _08055624 + ldrb r0, [r0] + cmp r6, r0 + bcc _0805558A +_080555EE: + ldr r0, _08055624 + ldrb r0, [r0] + cmp r6, r0 + bne _08055610 +_080555F6: + ldr r3, _08055628 + 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 + .align 2, 0 +_0805561C: .4byte 0x0202420b +_08055620: .4byte 0x02024084 +_08055624: .4byte 0x0202406c +_08055628: .4byte 0x02024214 + thumb_func_end atkDB_imprisoneffect + + thumb_func_start atkDC_setgrudge +atkDC_setgrudge: @ 805562C + push {lr} + ldr r1, _08055664 + ldr r0, _08055668 + 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, _0805566C + 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 + .align 2, 0 +_08055664: .4byte 0x020242ac +_08055668: .4byte 0x0202420b +_0805566C: .4byte 0x02024214 +_08055670: + orrs r1, r3 + str r1, [r2] + ldr r1, _08055680 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805567C: + pop {r0} + bx r0 + .align 2, 0 +_08055680: .4byte 0x02024214 + 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, _080556E8 + ldrh r0, [r2] + ldr r1, _080556EC + cmp r0, r1 + beq _080556FC + adds r6, r2, 0 + ldr r0, _080556F0 + mov r8, r0 + adds r7, r1, 0 + adds r4, r6, 0 +_080556A0: + ldr r0, _080556F4 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + ldrh r0, [r0] + bl species_to_pokedex_index + 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, _080556EC + cmp r1, r0 + beq _080556FC + ldr r0, _080556F8 + adds r1, r5, 0x1 + lsls r1, 1 + adds r1, r6 + ldrh r1, [r1] + strh r1, [r0] + b _08055702 + .align 2, 0 +_080556E8: .4byte 0x0831c428 +_080556EC: .4byte 0x0000ffff +_080556F0: .4byte 0x02024084 +_080556F4: .4byte 0x0202420c +_080556F8: .4byte 0x02024400 +_080556FC: + ldr r1, _08055714 + movs r0, 0x78 + strh r0, [r1] +_08055702: + ldr r1, _08055718 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08055714: .4byte 0x02024400 +_08055718: .4byte 0x02024214 + 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, _0805583C + ldr r0, [r0] + adds r0, 0x18 + str r0, [sp, 0x4] + ldr r0, _08055840 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + ldr r0, _08055844 + str r0, [sp] + cmp r1, 0 + beq _0805574C + ldr r1, _08055848 + str r1, [sp] +_0805574C: + movs r2, 0 +_0805574E: + ldr r1, _0805584C + ldr r0, _08055840 + 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, _08055850 + 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, _08055854 + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, r8 + beq _080557E2 + cmp r4, r2 + beq _080557D8 + ldr r5, _08055850 + 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, _08055858 + ldr r0, [r2] + ldr r1, _0805585C + ands r0, r1 + str r0, [r2] + ldr r4, _08055860 + 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, _08055864 + strb r0, [r1] + ldr r1, _08055868 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08055886 + .align 2, 0 +_0805583C: .4byte 0x0202449c +_08055840: .4byte 0x0202420b +_08055844: .4byte 0x020244ec +_08055848: .4byte 0x02024744 +_0805584C: .4byte 0x0202406e +_08055850: .4byte 0x0000ffff +_08055854: .4byte 0x0831c3e0 +_08055858: .4byte 0x02024280 +_0805585C: .4byte 0xfffffbff +_08055860: .4byte 0x020241ee +_08055864: .4byte 0x0202420c +_08055868: .4byte 0x02024214 +_0805586C: + ldr r3, _08055898 + 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 + .align 2, 0 +_08055898: .4byte 0x02024214 + thumb_func_end atkDE_asistattackselect + + thumb_func_start atkDF_setmagiccoat +atkDF_setmagiccoat: @ 805589C + push {lr} + ldr r1, _080558E4 + ldr r3, _080558E8 + ldrb r0, [r3] + strb r0, [r1] + ldr r2, _080558EC + 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, _080558F0 + ldrb r1, [r0] + ldr r0, _080558F4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080558FC + ldr r3, _080558F8 + 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 + .align 2, 0 +_080558E4: .4byte 0x0202420c +_080558E8: .4byte 0x0202420b +_080558EC: .4byte 0x0202437c +_080558F0: .4byte 0x02024082 +_080558F4: .4byte 0x0202406c +_080558F8: .4byte 0x02024214 +_080558FC: + ldr r0, _08055918 + ldrb r1, [r3] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1] + ldr r1, _0805591C + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08055914: + pop {r0} + bx r0 + .align 2, 0 +_08055918: .4byte 0x0202433c +_0805591C: .4byte 0x02024214 + thumb_func_end atkDF_setmagiccoat + + thumb_func_start atkE0_setstealstatchange +atkE0_setstealstatchange: @ 8055920 + push {lr} + ldr r2, _08055964 + ldr r3, _08055968 + 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, _0805596C + ldrb r1, [r0] + ldr r0, _08055970 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _08055978 + ldr r3, _08055974 + 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 + .align 2, 0 +_08055964: .4byte 0x0202437c +_08055968: .4byte 0x0202420b +_0805596C: .4byte 0x02024082 +_08055970: .4byte 0x0202406c +_08055974: .4byte 0x02024214 +_08055978: + ldr r0, _08055994 + ldrb r1, [r3] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + ldr r1, _08055998 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805598E: + pop {r0} + bx r0 + .align 2, 0 +_08055994: .4byte 0x0202433c +_08055998: .4byte 0x02024214 + thumb_func_end atkE0_setstealstatchange + + thumb_func_start atkE1_802CBE4 +atkE1_802CBE4: @ 805599C + push {r4-r6,lr} + ldr r4, _08055A40 + ldr r0, _08055A44 + 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, _08055A48 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x9 + strb r0, [r2, 0x1] + ldr r3, _08055A4C + 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, _08055A50 + ldr r1, _08055A54 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bcs _08055A22 + adds r4, r2, 0 + ldr r6, _08055A58 +_080559E2: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + beq _08055A04 + ldr r0, _08055A5C + ldrb r1, [r0] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + ldr r2, _08055A54 + cmp r1, 0 + beq _08055A18 +_08055A04: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, _08055A54 + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + ldrb r1, [r2] + cmp r0, r1 + bcc _080559E2 +_08055A18: + ldr r0, _08055A50 + ldrb r0, [r0] + ldrb r2, [r2] + cmp r0, r2 + bcc _08055A64 +_08055A22: + ldr r3, _08055A60 + 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 + .align 2, 0 +_08055A40: .4byte 0x02024474 +_08055A44: .4byte 0x0202449c +_08055A48: .4byte 0x02022f58 +_08055A4C: .4byte 0x02024084 +_08055A50: .4byte 0x0202420c +_08055A54: .4byte 0x0202406c +_08055A58: .4byte 0x0832a328 +_08055A5C: .4byte 0x02024210 +_08055A60: .4byte 0x02024214 +_08055A64: + ldr r1, _08055A74 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08055A6C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08055A74: .4byte 0x02024214 + thumb_func_end atkE1_802CBE4 + + thumb_func_start atkE2_cmde2 +atkE2_cmde2: @ 8055A78 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _08055AE0 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, _08055AE4 + strb r0, [r4] + ldr r3, _08055AE8 + 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, _08055AEC + ldrb r1, [r4] + ldr r0, _08055AF0 + 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 + .align 2, 0 +_08055AE0: .4byte 0x02024214 +_08055AE4: .4byte 0x02024064 +_08055AE8: .4byte 0x02024084 +_08055AEC: .4byte 0x0832a328 +_08055AF0: .4byte 0x0202449c + thumb_func_end atkE2_cmde2 + + thumb_func_start atkE3_jumpiffainted +atkE3_jumpiffainted: @ 8055AF4 + push {r4,lr} + ldr r4, _08055B30 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, _08055B34 + strb r0, [r1] + ldr r2, _08055B38 + 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 + .align 2, 0 +_08055B30: .4byte 0x02024214 +_08055B34: .4byte 0x02024064 +_08055B38: .4byte 0x02024084 +_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, _08055B5C + ldrb r0, [r0] + cmp r0, 0x7 + bhi _08055BE4 + lsls r0, 2 + ldr r1, _08055B60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08055B5C: .4byte 0x02022ff0 +_08055B60: .4byte _08055B64 + .align 2, 0 +_08055B64: + .4byte _08055B84 + .4byte _08055B90 + .4byte _08055B9C + .4byte _08055BA8 + .4byte _08055BB4 + .4byte _08055BC0 + .4byte _08055BCC + .4byte _08055BD8 +_08055B84: + ldr r1, _08055B8C + movs r0, 0x2 + b _08055BE8 + .align 2, 0 +_08055B8C: .4byte 0x02024332 +_08055B90: + ldr r1, _08055B98 + movs r0, 0x1 + b _08055BE8 + .align 2, 0 +_08055B98: .4byte 0x02024332 +_08055B9C: + ldr r1, _08055BA4 + movs r0, 0x1B + b _08055BE8 + .align 2, 0 +_08055BA4: .4byte 0x02024332 +_08055BA8: + ldr r1, _08055BB0 + movs r0, 0x17 + b _08055BE8 + .align 2, 0 +_08055BB0: .4byte 0x02024332 +_08055BB4: + ldr r1, _08055BBC + movs r0, 0x16 + b _08055BE8 + .align 2, 0 +_08055BBC: .4byte 0x02024332 +_08055BC0: + ldr r1, _08055BC8 + movs r0, 0x18 + b _08055BE8 + .align 2, 0 +_08055BC8: .4byte 0x02024332 +_08055BCC: + ldr r1, _08055BD4 + movs r0, 0x7 + b _08055BE8 + .align 2, 0 +_08055BD4: .4byte 0x02024332 +_08055BD8: + ldr r1, _08055BE0 + movs r0, 0x8 + b _08055BE8 + .align 2, 0 +_08055BE0: .4byte 0x02024332 +_08055BE4: + ldr r1, _08055BF8 + movs r0, 0x5 +_08055BE8: + strb r0, [r1, 0x3] + ldr r1, _08055BFC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08055BF8: .4byte 0x02024332 +_08055BFC: .4byte 0x02024214 + thumb_func_end sub_8055B48 + + thumb_func_start sub_8055C00 +sub_8055C00: @ 8055C00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + bl sub_81A80A8 + lsls r0, 24 + cmp r0, 0 + beq _08055C18 + b _08055DD8 +_08055C18: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _08055CC4 + movs r6, 0 + mov r7, sp + ldr r0, _08055C64 + mov r8, r0 +_08055C2A: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _08055C68 + 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 + .align 2, 0 +_08055C64: .4byte 0x083203cc +_08055C68: .4byte 0x020244ec +_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 sub_81AAAE0 + strh r0, [r7] + movs r0, 0x64 + muls r0, r6 + ldr r1, _08055CC0 + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_08055CB6: + adds r6, 0x1 + cmp r6, 0x5 + ble _08055C2A + b _08055DD8 + .align 2, 0 +_08055CC0: .4byte 0x020244ec +_08055CC4: + movs r6, 0 + movs r1, 0x64 + mov r8, r1 + ldr r7, _08055D08 + 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, _08055D0C + adds r0, r1 + ldrb r0, [r0, 0x17] + b _08055D3C + .align 2, 0 +_08055D08: .4byte 0x020244ec +_08055D0C: .4byte 0x083203cc +_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, _08055D2C + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + b _08055DD0 + .align 2, 0 +_08055D2C: .4byte 0x0831c464 +_08055D30: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + ldr r1, _08055DA0 + 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 + .align 2, 0 +_08055DA0: .4byte 0x083203cc +_08055DA4: + adds r0, r4, 0 + subs r0, 0x62 + cmp r0, 0x1 + bls _08055D10 + adds r2, 0x1 +_08055DAE: + cmp r2, 0x8 + bgt _08055DD0 + ldr r0, _08055DF0 + 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, _08055DF4 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr +_08055DD0: + mov r6, r9 + cmp r6, 0x5 + bgt _08055DD8 + b _08055CCE +_08055DD8: + ldr r1, _08055DF8 + 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 + .align 2, 0 +_08055DF0: .4byte 0x0831c47a +_08055DF4: .4byte 0x0831c440 +_08055DF8: .4byte 0x02024214 + thumb_func_end sub_8055C00 + + thumb_func_start atkE6_castform_transform +atkE6_castform_transform: @ 8055DFC + push {r4,lr} + ldr r4, _08055E50 + ldr r0, _08055E54 + ldrb r0, [r0, 0x17] + strb r0, [r4] + ldr r1, _08055E58 + 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, _08055E5C + 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, _08055E60 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08055E50: .4byte 0x02024064 +_08055E54: .4byte 0x02024474 +_08055E58: .4byte 0x02024084 +_08055E5C: .4byte 0x0202449c +_08055E60: .4byte 0x02024214 + thumb_func_end atkE6_castform_transform + + thumb_func_start atkE7_castform_switch +atkE7_castform_switch: @ 8055E64 + push {r4,lr} + ldr r1, _08055E94 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _08055E98 + ldrb r0, [r0, 0x17] + bl castform_switch + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08055E8E + ldr r0, _08055E9C + bl b_push_move_exec + ldr r0, _08055EA0 + ldr r0, [r0] + adds r0, 0x7F + subs r1, r4, 0x1 + strb r1, [r0] +_08055E8E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08055E94: .4byte 0x02024214 +_08055E98: .4byte 0x02024474 +_08055E9C: .4byte 0x082db4a9 +_08055EA0: .4byte 0x0202449c + thumb_func_end atkE7_castform_switch + + thumb_func_start atkE8_settypebasedhalvers +atkE8_settypebasedhalvers: @ 8055EA4 + push {r4,lr} + movs r4, 0 + ldr r2, _08055EE0 + ldr r0, _08055EE4 + 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, _08055EE8 + ldr r0, _08055EEC + 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, _08055EF0 + strb r4, [r0, 0x5] + b _08055F1C + .align 2, 0 +_08055EE0: .4byte 0x0831c898 +_08055EE4: .4byte 0x020241ea +_08055EE8: .4byte 0x020242ac +_08055EEC: .4byte 0x0202420b +_08055EF0: .4byte 0x02024332 +_08055EF4: + ldr r1, _08055F28 + ldr r0, _08055F2C + 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, _08055F30 + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r4, 0x1 +_08055F18: + cmp r4, 0 + beq _08055F38 +_08055F1C: + ldr r1, _08055F34 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08055F52 + .align 2, 0 +_08055F28: .4byte 0x020242ac +_08055F2C: .4byte 0x0202420b +_08055F30: .4byte 0x02024332 +_08055F34: .4byte 0x02024214 +_08055F38: + ldr r3, _08055F58 + 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 + .align 2, 0 +_08055F58: .4byte 0x02024214 + 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, _08055FAC + ldrb r0, [r2] + cmp r0, 0 + beq _08055F9A + ldr r1, _08055FB0 + movs r0, 0x2 + strb r0, [r1, 0xE] +_08055F9A: + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08055FB8 + ldr r0, _08055FB4 + ldr r1, [r0] + movs r0, 0x8B + b _08055FFA + .align 2, 0 +_08055FAC: .4byte 0x020243cc +_08055FB0: .4byte 0x02024474 +_08055FB4: .4byte 0x0202449c +_08055FB8: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _08055FCC + ldr r0, _08055FC8 + ldr r1, [r0] + movs r0, 0x85 + b _08055FFA + .align 2, 0 +_08055FC8: .4byte 0x0202449c +_08055FCC: + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08055FE0 + ldr r0, _08055FDC + ldr r1, [r0] + movs r0, 0x8A + b _08055FFA + .align 2, 0 +_08055FDC: .4byte 0x0202449c +_08055FE0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08055FF4 + ldr r0, _08055FF0 + ldr r1, [r0] + movs r0, 0x8F + b _08055FFA + .align 2, 0 +_08055FF0: .4byte 0x0202449c +_08055FF4: + ldr r0, _0805600C + ldr r1, [r0] + movs r0, 0x80 +_08055FFA: + strb r0, [r1, 0x13] +_08055FFC: + ldr r1, _08056010 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0805600C: .4byte 0x0202449c +_08056010: .4byte 0x02024214 + thumb_func_end atkE9_seteffectbyweather + + thumb_func_start atkEA_recycleitem +atkEA_recycleitem: @ 8056014 + push {r4-r7,lr} + sub sp, 0x4 + ldr r7, _0805607C + ldr r0, _08056080 + ldrb r0, [r0] + strb r0, [r7] + ldr r1, _08056084 + 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, _08056088 + movs r3, 0x58 + adds r0, r2, 0 + muls r0, r3 + adds r0, r4 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + bne _08056094 + ldr r1, _0805608C + 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, _08056090 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080560AE + .align 2, 0 +_0805607C: .4byte 0x02024064 +_08056080: .4byte 0x0202420b +_08056084: .4byte 0x0202449c +_08056088: .4byte 0x02024084 +_0805608C: .4byte 0x02024208 +_08056090: .4byte 0x02024214 +_08056094: + ldr r3, _080560B8 + 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 + .align 2, 0 +_080560B8: .4byte 0x02024214 + thumb_func_end atkEA_recycleitem + + thumb_func_start atkEB_settypetoterrain +atkEB_settypetoterrain: @ 80560BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0805612C + mov r8, r0 + ldr r7, _08056130 + 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, _08056134 + ldr r4, _08056138 + 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, _0805613C + 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, _08056140 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805615E + .align 2, 0 +_0805612C: .4byte 0x02024084 +_08056130: .4byte 0x0202420b +_08056134: .4byte 0x0831c483 +_08056138: .4byte 0x02022ff0 +_0805613C: .4byte 0x02022f58 +_08056140: .4byte 0x02024214 +_08056144: + ldr r3, _08056168 + 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 + .align 2, 0 +_08056168: .4byte 0x02024214 + thumb_func_end atkEB_settypetoterrain + + thumb_func_start atkEC_802D2A0 +atkEC_802D2A0: @ 805616C + push {r4-r6,lr} + ldr r5, _080561E0 + 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, _080561E4 + strb r0, [r4] + ldr r0, _080561E8 + ldr r0, [r0] + movs r6, 0x1 + ands r0, r6 + cmp r0, 0 + beq _0805620C + ldr r0, _080561EC + ldrb r1, [r0] + ldr r2, _080561F0 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0805620C + ldr r0, _080561F4 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805620C + ldr r1, _080561F8 + lsls r0, r3, 1 + adds r0, r1 + ldrh r2, [r0] + cmp r2, 0xE4 + bne _0805620C + ldr r0, _080561FC + adds r0, r3, r0 + movs r1, 0xB + strb r1, [r0] + ldr r0, _08056200 + strh r2, [r0] + ldr r1, _08056204 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r0, _08056208 + strb r6, [r0, 0x18] + ldrb r1, [r5] + adds r0, 0x20 + strb r1, [r0] + ldrb r0, [r4] + strb r0, [r5] + b _08056226 + .align 2, 0 +_080561E0: .4byte 0x0202420b +_080561E4: .4byte 0x02024064 +_080561E8: .4byte 0x02022fec +_080561EC: .4byte 0x02024210 +_080561F0: .4byte 0x0832a328 +_080561F4: .4byte 0x0202421c +_080561F8: .4byte 0x02024274 +_080561FC: .4byte 0x0202407a +_08056200: .4byte 0x020241ea +_08056204: .4byte 0x02024214 +_08056208: .4byte 0x02024474 +_0805620C: + ldr r3, _0805622C + 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 + .align 2, 0 +_0805622C: .4byte 0x02024214 + thumb_func_end atkEC_802D2A0 + + thumb_func_start atkED_802D364 +atkED_802D364: @ 8056230 + push {r4,lr} + ldr r1, _08056254 + ldr r3, _08056258 + ldrb r0, [r3] + strb r0, [r1] + ldr r2, _0805625C + lsls r0, 24 + lsrs r0, 24 + adds r4, r1, 0 + ldrb r1, [r2] + cmp r0, r1 + bne _08056264 + ldr r1, _08056260 + ldrb r0, [r1, 0x17] + strb r0, [r2] + strb r0, [r3] + b _0805626A + .align 2, 0 +_08056254: .4byte 0x0202420e +_08056258: .4byte 0x0202420b +_0805625C: .4byte 0x0202420c +_08056260: .4byte 0x02024474 +_08056264: + ldr r1, _0805627C + ldrb r0, [r1, 0x17] + strb r0, [r2] +_0805626A: + ldrb r0, [r4] + strb r0, [r1, 0x17] + ldr r1, _08056280 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805627C: .4byte 0x02024474 +_08056280: .4byte 0x02024214 + thumb_func_end atkED_802D364 + + thumb_func_start atkEE_removereflectlightscreen +atkEE_removereflectlightscreen: @ 8056284 + push {r4,lr} + ldr r0, _080562CC + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080562D0 + 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, _080562D4 + adds r2, r3, r2 + ldrh r1, [r2] + ldr r0, _080562D8 + ands r0, r1 + movs r3, 0 + ldr r1, _080562DC + ands r0, r1 + strh r0, [r2] + strb r3, [r4] + strb r3, [r4, 0x2] + ldr r1, _080562E0 + movs r0, 0x1 + strb r0, [r1, 0x18] + strb r0, [r1, 0x19] + b _080562EA + .align 2, 0 +_080562CC: .4byte 0x0202420b +_080562D0: .4byte 0x02024294 +_080562D4: .4byte 0x0202428e +_080562D8: .4byte 0x0000fffe +_080562DC: .4byte 0x0000fffd +_080562E0: .4byte 0x02024474 +_080562E4: + ldr r0, _080562F8 + strb r1, [r0, 0x18] + strb r1, [r0, 0x19] +_080562EA: + ldr r1, _080562FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080562F8: .4byte 0x02024474 +_080562FC: .4byte 0x02024214 + thumb_func_end atkEE_removereflectlightscreen + + thumb_func_start sub_8056300 +sub_8056300: @ 8056300 + push {r4-r6,lr} + movs r4, 0 + ldr r0, _08056340 + ldr r0, [r0] + cmp r0, 0 + beq _0805630E + b _08056696 +_0805630E: + ldr r5, _08056344 + ldr r0, _08056348 + ldrb r0, [r0] + strb r0, [r5] + ldr r6, _0805634C + movs r1, 0x1 + eors r0, r1 + strb r0, [r6] + ldr r0, _08056350 + 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, _08056354 + ldr r0, _08056358 + b _08056694 + .align 2, 0 +_08056340: .4byte 0x02024068 +_08056344: .4byte 0x02024064 +_08056348: .4byte 0x0202420b +_0805634C: .4byte 0x0202420c +_08056350: .4byte 0x02022fec +_08056354: .4byte 0x02024214 +_08056358: .4byte 0x082dbe02 +_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, _0805637C + ldr r0, _08056380 + b _08056694 + .align 2, 0 +_0805637C: .4byte 0x02024214 +_08056380: .4byte 0x082dbdca +_08056384: + ldr r0, _080563A8 + ldrh r0, [r0] + cmp r0, 0x5 + bne _080563B0 + ldr r0, _080563AC + 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 + .align 2, 0 +_080563A8: .4byte 0x02024208 +_080563AC: .4byte 0x0202449c +_080563B0: + ldr r3, _080563E4 + ldr r2, _080563E8 + 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, _080563EC + 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, _080563F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080563E4: .4byte 0x083203cc +_080563E8: .4byte 0x02024084 +_080563EC: .4byte 0x02024208 +_080563F0: .4byte _080563F4 + .align 2, 0 +_080563F4: + .4byte _08056410 + .4byte _08056440 + .4byte _08056452 + .4byte _08056480 + .4byte _080564B0 + .4byte _08056472 + .4byte _08056472 +_08056410: + ldr r2, _08056438 + ldr r0, _0805643C + 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 + .align 2, 0 +_08056438: .4byte 0x02024084 +_0805643C: .4byte 0x0202420c +_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, _08056478 + ldr r0, _0805647C + 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 + .align 2, 0 +_08056478: .4byte 0x02024084 +_0805647C: .4byte 0x0202420c +_08056480: + ldr r2, _080564A8 + ldr r0, _080564AC + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0] + bl species_to_pokedex_index + 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 + .align 2, 0 +_080564A8: .4byte 0x02024084 +_080564AC: .4byte 0x0202420c +_080564B0: + ldr r0, _080564C4 + ldrb r0, [r0, 0x13] + adds r0, 0xA + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x28 + bls _080564D2 + movs r4, 0x28 + b _080564D2 + .align 2, 0 +_080564C4: .4byte 0x03005d10 +_080564C8: + ldr r1, _0805653C + 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, _08056540 + ldr r1, _08056544 + 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, _08056548 + ldrh r0, [r1] + cmp r0, 0x5 + beq _08056564 + cmp r0, 0x1 + bne _08056550 + ldr r0, _0805654C + ldrb r1, [r0, 0x5] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x5] + b _08056564 + .align 2, 0 +_0805653C: .4byte 0x0831c48d +_08056540: .4byte 0x02024084 +_08056544: .4byte 0x0202420c +_08056548: .4byte 0x02024208 +_0805654C: .4byte 0x03005d10 +_08056550: + ldr r0, _080565A8 + 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, _080565AC + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, _080565B0 + ldr r0, _080565B4 + str r0, [r1] + ldr r1, _080565B8 + ldr r0, _080565BC + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080565C0 + adds r0, r1 + ldr r2, _080565C4 + movs r1, 0x26 + bl pokemon_setattr + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08056656 + b _08056680 + .align 2, 0 +_080565A8: .4byte 0x03005d10 +_080565AC: .4byte 0x02024064 +_080565B0: .4byte 0x02024214 +_080565B4: .4byte 0x082dbd84 +_080565B8: .4byte 0x0202406e +_080565BC: .4byte 0x0202420c +_080565C0: .4byte 0x02024744 +_080565C4: .4byte 0x02024208 +_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, _080565F0 + adds r1, r6, 0 + bl __udivsi3 + adds r6, r0, 0 + movs r4, 0 + b _080565FA + .align 2, 0 +_080565F0: .4byte 0x000ffff0 +_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, _08056660 + 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, _08056664 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + cmp r4, 0x4 + bne _0805668C + ldr r1, _08056668 + ldr r0, _0805666C + str r0, [r1] + ldr r1, _08056670 + ldr r0, _08056674 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08056678 + 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, _0805667C + movs r0, 0 + strb r0, [r1, 0x5] + b _08056696 + .align 2, 0 +_08056660: .4byte 0x02024208 +_08056664: .4byte 0x02024064 +_08056668: .4byte 0x02024214 +_0805666C: .4byte 0x082dbd84 +_08056670: .4byte 0x0202406e +_08056674: .4byte 0x0202420c +_08056678: .4byte 0x02024744 +_0805667C: .4byte 0x02024332 +_08056680: + ldr r1, _08056688 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08056696 + .align 2, 0 +_08056688: .4byte 0x02024332 +_0805668C: + ldr r0, _0805669C + strb r4, [r0, 0x5] + ldr r1, _080566A0 + ldr r0, _080566A4 +_08056694: + str r0, [r1] +_08056696: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805669C: .4byte 0x02024332 +_080566A0: .4byte 0x02024214 +_080566A4: .4byte 0x082dbdd4 + 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, _08056718 + mov r9, r0 + ldr r5, _0805671C + 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, _08056720 + 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, _08056724 + strb r1, [r0, 0x5] + ldr r4, _08056728 + ldr r0, _0805672C + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrb r0, [r5] + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + add r0, r8 + ldr r2, _08056730 + movs r1, 0x2 + bl pokemon_getattr + b _0805677E + .align 2, 0 +_08056718: .4byte 0x0202406e +_0805671C: .4byte 0x0202420b +_08056720: .4byte 0x02024744 +_08056724: .4byte 0x02024332 +_08056728: .4byte 0x02021cc4 +_0805672C: .4byte 0x00004036 +_08056730: .4byte 0x02021dc4 +_08056734: + ldr r4, _08056824 + ldr r0, _08056828 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrb r0, [r5] + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + add r0, r8 + ldr r2, _0805682C + movs r1, 0x2 + bl pokemon_getattr + ldr r4, _08056830 + 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 gf_strcpy + ldr r1, _08056834 + movs r0, 0x2 + strb r0, [r1, 0x5] +_0805677E: + ldr r0, _08056838 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08056792 + ldr r1, _08056834 + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] +_08056792: + ldr r0, _0805683C + mov r10, r0 + ldr r1, _08056840 + 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, _08056844 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r5, _08056848 + 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, _0805684C + 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 + .align 2, 0 +_08056824: .4byte 0x02021cc4 +_08056828: .4byte 0x00004036 +_0805682C: .4byte 0x02021dc4 +_08056830: .4byte 0x02021ec4 +_08056834: .4byte 0x02024332 +_08056838: .4byte 0x000008ab +_0805683C: .4byte 0x0202406e +_08056840: .4byte 0x0202420b +_08056844: .4byte 0x02024744 +_08056848: .4byte 0x03005d10 +_0805684C: .4byte 0x02024214 + thumb_func_end atkF0_catch_pokemon + + thumb_func_start atkF1_802D95C +atkF1_802D95C: @ 8056850 + push {r4,r5,lr} + ldr r4, _080568A0 + 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 species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080568A8 + ldr r3, _080568A4 + 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 + .align 2, 0 +_080568A0: .4byte 0x02024744 +_080568A4: .4byte 0x02024214 +_080568A8: + adds r0, r5, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + adds r2, r4, 0 + bl sub_806F01C + ldr r1, _080568C8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080568C2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080568C8: .4byte 0x02024214 + thumb_func_end atkF1_802D95C + + thumb_func_start sub_80568CC +sub_80568CC: @ 80568CC + push {r4,lr} + sub sp, 0x4 + ldr r0, _080568F4 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _080568F8 + ldrb r0, [r0] + cmp r0, 0x5 + bls _080568E8 + b _08056A2C +_080568E8: + lsls r0, 2 + ldr r1, _080568FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080568F4: .4byte 0x02024744 +_080568F8: .4byte 0x02024332 +_080568FC: .4byte _08056900 + .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 sub_80A1AD4 + b _08056A06 +_0805692A: + ldr r0, _08056968 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056938 + b _08056A2C +_08056938: + bl Window_FreeMemory + adds r0, r4, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + ldr r3, _0805696C + ldr r1, _08056970 + 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, _08056974 + strb r0, [r1, 0x1] + b _08056A08 + .align 2, 0 +_08056968: .4byte 0x02037fd4 +_0805696C: .4byte 0x02024084 +_08056970: .4byte 0x0202420c +_08056974: .4byte 0x02024332 +_08056978: + ldr r0, _080569B0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056A2C + ldr r0, _080569B4 + ldr r1, [r0, 0x4] + ldr r0, _080569B8 + cmp r1, r0 + bne _08056A2C + ldr r2, _080569BC + ldr r4, _080569C0 + 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, _080569C4 + bl SetVBlankCallback + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08056A2C + .align 2, 0 +_080569B0: .4byte 0x02037fd4 +_080569B4: .4byte 0x030022c0 +_080569B8: .4byte sub_8038420 + 1 +_080569BC: .4byte 0x03005e00 +_080569C0: .4byte 0x02024332 +_080569C4: .4byte vblank_cb_08078BB4 + 1 +_080569C8: + bl c2_berry_program_update_menu + bl sub_8035AA4 + ldr r1, _080569DC + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + b _08056A06 + .align 2, 0 +_080569DC: .4byte 0x02022e20 +_080569E0: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08056A2C + ldr r0, _08056A10 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_08056A06: + ldr r1, _08056A14 +_08056A08: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08056A2C + .align 2, 0 +_08056A10: .4byte 0x0000ffff +_08056A14: .4byte 0x02024332 +_08056A18: + ldr r0, _08056A34 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056A2C + ldr r1, _08056A38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08056A2C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08056A34: .4byte 0x02037fd4 +_08056A38: .4byte 0x02024214 + 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, _08056A98 + b _08056AFE + .align 2, 0 +_08056A98: .4byte 0x00001022 +_08056A9C: + ldr r2, [sp, 0x1C] + cmp r4, r2 + bne _08056AAC + ldr r0, _08056AA8 + b _08056AFE + .align 2, 0 +_08056AA8: .4byte 0x00001024 +_08056AAC: + ldr r0, _08056AB0 + b _08056AFE + .align 2, 0 +_08056AB0: .4byte 0x00001023 +_08056AB4: + ldr r7, [sp, 0x14] + cmp r6, r7 + bne _08056AE0 + cmp r4, r8 + bne _08056AC8 + ldr r0, _08056AC4 + b _08056AFE + .align 2, 0 +_08056AC4: .4byte 0x00001028 +_08056AC8: + ldr r0, [sp, 0x1C] + cmp r4, r0 + bne _08056AD8 + ldr r0, _08056AD4 + b _08056AFE + .align 2, 0 +_08056AD4: .4byte 0x0000102a +_08056AD8: + ldr r0, _08056ADC + b _08056AFE + .align 2, 0 +_08056ADC: .4byte 0x00001029 +_08056AE0: + cmp r4, r8 + bne _08056AEC + ldr r0, _08056AE8 + b _08056AFE + .align 2, 0 +_08056AE8: .4byte 0x00001025 +_08056AEC: + ldr r2, [sp, 0x1C] + cmp r4, r2 + bne _08056AFC + ldr r0, _08056AF8 + b _08056AFE + .align 2, 0 +_08056AF8: .4byte 0x00001027 +_08056AFC: + ldr r0, _08056B34 +_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 bg_copy_tilemap_rect_simple + b _08056B50 + .align 2, 0 +_08056B34: .4byte 0x00001026 +_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 bg_copy_tilemap_rect_simple +_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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _08056BE8 + 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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08056BE8: .4byte 0x00001016 + 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, _08056C10 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x4 + bls _08056C04 + b _08056E62 +_08056C04: + lsls r0, r1, 2 + ldr r1, _08056C14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08056C10: .4byte 0x02024332 +_08056C14: .4byte _08056C18 + .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, _08056C58 + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, _08056C5C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + strb r4, [r1, 0x1] + movs r0, 0 + bl sub_8056B74 + b _08056E62 + .align 2, 0 +_08056C58: .4byte 0x085ccabb +_08056C5C: .4byte 0x02024332 +_08056C60: + ldr r0, _08056CD8 + 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, _08056CD8 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056CAE + ldr r4, _08056CDC + 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, _08056CD8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08056CE0 + movs r0, 0x5 + bl audio_play + ldr r1, _08056CDC + 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 + .align 2, 0 +_08056CD8: .4byte 0x030022c0 +_08056CDC: .4byte 0x02024332 +_08056CE0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08056CEA + b _08056E62 +_08056CEA: + movs r0, 0x5 + bl audio_play + ldr r1, _08056CF8 +_08056CF2: + movs r0, 0x4 + strb r0, [r1] + b _08056E62 + .align 2, 0 +_08056CF8: .4byte 0x02024332 +_08056CFC: + ldr r0, _08056DB8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056D0A + b _08056E62 +_08056D0A: + ldr r7, _08056DBC + ldr r0, _08056DC0 + 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, _08056DC4 + mov r8, r1 + add r0, r8 + ldr r1, _08056DC8 + ldr r2, [r1] + adds r2, 0x6D + movs r1, 0x2 + bl pokemon_getattr + bl Window_FreeMemory + 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, _08056DC8 + ldr r1, [r2] + adds r1, 0x6D + str r0, [sp] + ldr r0, _08056DCC + str r0, [sp, 0x4] + movs r0, 0x2 + adds r2, r6, 0 + adds r3, r5, 0 + bl do_choose_name_or_words_screen + ldr r1, _08056DD0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08056E62 + .align 2, 0 +_08056DB8: .4byte 0x02037fd4 +_08056DBC: .4byte 0x0202406e +_08056DC0: .4byte 0x0202420b +_08056DC4: .4byte 0x02024744 +_08056DC8: .4byte 0x0202449c +_08056DCC: .4byte sub_8038420 + 1 +_08056DD0: .4byte 0x02024332 +_08056DD4: + ldr r0, _08056E10 + ldr r1, [r0, 0x4] + ldr r0, _08056E14 + cmp r1, r0 + bne _08056E62 + ldr r0, _08056E18 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056E62 + ldr r2, _08056E1C + ldr r0, _08056E20 + 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, _08056E24 + adds r0, r1 + ldr r1, _08056E28 + ldr r2, [r1] + adds r2, 0x6D + movs r1, 0x2 + bl pokemon_setattr + b _08056E48 + .align 2, 0 +_08056E10: .4byte 0x030022c0 +_08056E14: .4byte sub_8038420 + 1 +_08056E18: .4byte 0x02037fd4 +_08056E1C: .4byte 0x0202406e +_08056E20: .4byte 0x0202420b +_08056E24: .4byte 0x02024744 +_08056E28: .4byte 0x0202449c +_08056E2C: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08056E48 + ldr r1, _08056E44 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08056E62 + .align 2, 0 +_08056E44: .4byte 0x02024214 +_08056E48: + ldr r3, _08056E74 + 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 + .align 2, 0 +_08056E74: .4byte 0x02024214 + thumb_func_end atkF3_receive_new_pokemon_maybe + + thumb_func_start sub_8056E78 +sub_8056E78: @ 8056E78 + ldr r2, _08056E98 + ldr r0, _08056E9C + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldr r0, _08056EA0 + ldr r2, [r0] + ldrh r0, [r1, 0x28] + subs r0, r2 + strh r0, [r1, 0x28] + ldr r1, _08056EA4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08056E98: .4byte 0x02024084 +_08056E9C: .4byte 0x0202420b +_08056EA0: .4byte 0x020241f0 +_08056EA4: .4byte 0x02024214 + thumb_func_end sub_8056E78 + + thumb_func_start atkF5_reset_attacker_bd_x4C +atkF5_reset_attacker_bd_x4C: @ 8056EA8 + ldr r1, _08056EC4 + ldr r0, _08056EC8 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + movs r1, 0 + str r1, [r0] + ldr r1, _08056ECC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08056EC4: .4byte 0x02024084 +_08056EC8: .4byte 0x0202420b +_08056ECC: .4byte 0x02024214 + thumb_func_end atkF5_reset_attacker_bd_x4C + + thumb_func_start sub_8056ED0 +sub_8056ED0: @ 8056ED0 + ldr r1, _08056ED8 + movs r0, 0xC + strb r0, [r1] + bx lr + .align 2, 0 +_08056ED8: .4byte 0x02024083 + thumb_func_end sub_8056ED0 + + thumb_func_start sub_8056EDC +sub_8056EDC: @ 8056EDC + ldr r1, _08056EEC + movs r0, 0xC + strb r0, [r1] + ldr r1, _08056EF0 + ldr r0, _08056EF4 + ldrb r0, [r0] + strb r0, [r1] + bx lr + .align 2, 0 +_08056EEC: .4byte 0x02024083 +_08056EF0: .4byte 0x02024082 +_08056EF4: .4byte 0x0202406c + thumb_func_end sub_8056EDC + + thumb_func_start sub_8056EF8 +sub_8056EF8: @ 8056EF8 + push {r4,r5,lr} + ldr r5, _08056F20 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl battle_get_side_with_given_state + ldr r4, _08056F24 + 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 + .align 2, 0 +_08056F20: .4byte 0x02024214 +_08056F24: .4byte 0x02024064 + thumb_func_end sub_8056EF8 + + thumb_func_start sub_8056F28 +sub_8056F28: @ 8056F28 + push {r4-r6,lr} + ldr r5, _08057000 + ldr r6, _08057004 + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _08056F3E + bl sub_81D55D0 +_08056F3E: + ldr r4, _08057008 + movs r0, 0xA9 + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + movs r0, 0x20 + bl malloc_and_clear + str r0, [r5] + movs r0, 0xA0 + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1] + movs r0, 0x10 + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0x4] + movs r0, 0x24 + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0x8] + movs r0, 0x24 + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0xC] + movs r0, 0xC + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0x10] + movs r0, 0x1C + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0x14] + movs r0, 0x54 + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0x18] + movs r0, 0x24 + bl malloc_and_clear + ldr r1, [r5] + str r0, [r1, 0x1C] + ldr r4, _0805700C + movs r5, 0x80 + lsls r5, 5 + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4] + ldr r4, _08057010 + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4] + ldr r4, _08057014 + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + str r0, [r4] + ldr r4, _08057018 + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4] + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 20 + ands r0, r1 + cmp r0, 0 + beq _08056FFA + ldr r0, _0805701C + bl var_get + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08057020 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + ldr r0, _08057024 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + bl create_enemy_party +_08056FFA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08057000: .4byte 0x020244a8 +_08057004: .4byte 0x02022fec +_08057008: .4byte 0x0202449c +_0805700C: .4byte 0x020244a0 +_08057010: .4byte 0x020244a4 +_08057014: .4byte 0x0202305c +_08057018: .4byte 0x02023060 +_0805701C: .4byte 0x00004054 +_08057020: .4byte 0x03005d8c +_08057024: .4byte 0x00001a9c + thumb_func_end sub_8056F28 + + thumb_func_start sub_8057028 +sub_8057028: @ 8057028 + push {r4-r6,lr} + ldr r0, _080570D8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0805703C + bl sub_81D5694 +_0805703C: + ldr r6, _080570DC + ldr r0, [r6] + cmp r0, 0 + beq _080570D0 + ldr r4, _080570E0 + 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, _080570E4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _080570E8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _080570EC + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _080570F0 + ldr r0, [r4] + bl free + str r5, [r4] +_080570D0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080570D8: .4byte 0x02022fec +_080570DC: .4byte 0x020244a8 +_080570E0: .4byte 0x0202449c +_080570E4: .4byte 0x020244a0 +_080570E8: .4byte 0x020244a4 +_080570EC: .4byte 0x0202305c +_080570F0: .4byte 0x02023060 + 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, _08057138 + 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, _0805713C + 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 + .align 2, 0 +_08057138: .4byte 0x02022fec +_0805713C: .4byte 0x02024084 +_08057140: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 +_0805714A: + ldr r2, _0805718C + 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, _08057190 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08057194 + adds r0, r1 + movs r1, 0x8 + bl happiness_algorithm + b _080571CE + .align 2, 0 +_0805718C: .4byte 0x02024084 +_08057190: .4byte 0x0202406e +_08057194: .4byte 0x020244ec +_08057198: + ldr r1, _080571B0 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080571B4 + adds r0, r1 + movs r1, 0x6 + bl happiness_algorithm + b _080571CE + .align 2, 0 +_080571B0: .4byte 0x0202406e +_080571B4: .4byte 0x020244ec +_080571B8: + ldr r1, _080571D4 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080571D8 + adds r0, r1 + movs r1, 0x6 + bl happiness_algorithm +_080571CE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080571D4: .4byte 0x0202406e +_080571D8: .4byte 0x020244ec + 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, _08057250 + lsls r3, r4, 1 + ldr r5, _08057254 + ldr r4, _08057258 +_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, _08057258 + ldr r3, _08057254 +_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 + .align 2, 0 +_08057250: .4byte 0x0202406e +_08057254: .4byte 0x0203cf00 +_08057258: .4byte 0x0202449c + 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, _08057278 + mov r10, r1 + b _08057284 + .align 2, 0 +_08057278: .4byte 0x02024332 +_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, _080572EC + 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, _080572F0 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + movs r0, 0x1 + mov r2, r10 + strb r0, [r2, 0x5] + ldr r1, _080572F4 + ldr r0, _080572F8 + str r0, [r1] + movs r0, 0x2 + mov r8, r0 + b _08057372 + .align 2, 0 +_080572EC: .4byte 0x02024084 +_080572F0: .4byte 0xf7ffffff +_080572F4: .4byte 0x02024214 +_080572F8: .4byte 0x082db220 +_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, _08057348 + 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, _0805734C + ldr r0, _08057350 + str r0, [r1] + movs r1, 0x2 + mov r8, r1 + b _08057372 + .align 2, 0 +_08057348: .4byte 0x02024084 +_0805734C: .4byte 0x02024214 +_08057350: .4byte 0x082db213 +_08057354: + adds r2, 0x50 + adds r2, r1, r2 + ldr r0, [r2] + ldr r1, _08057380 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r0, _08057384 + strb r4, [r0, 0x5] + ldr r1, _08057388 + ldr r0, _0805738C + str r0, [r1] + movs r2, 0x2 + mov r8, r2 +_08057372: + ldr r1, _08057384 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r10, r1 + b _080573FC + .align 2, 0 +_08057380: .4byte 0xf7ffffff +_08057384: .4byte 0x02024332 +_08057388: .4byte 0x02024214 +_0805738C: .4byte 0x082db220 +_08057390: + ldr r1, _080573C8 + 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, _080573CC + ldr r0, _080573D0 + str r0, [r1] + b _080573EC + .align 2, 0 +_080573C8: .4byte 0x02024084 +_080573CC: .4byte 0x02024214 +_080573D0: .4byte 0x082db26a +_080573D4: + ldr r0, [r4] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r4] + bl b_movescr_stack_push_cursor + ldr r1, _08057444 + ldr r0, _08057448 + str r0, [r1] + mov r0, r10 + strb r5, [r0, 0x5] +_080573EC: + movs r1, 0x2 + mov r8, r1 + ldr r2, _0805744C + 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, _08057450 + mov r1, r9 + strb r1, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, _08057454 + 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 + .align 2, 0 +_08057444: .4byte 0x02024214 +_08057448: .4byte 0x082db277 +_0805744C: .4byte 0x02024332 +_08057450: .4byte 0x02024064 +_08057454: .4byte 0x020240d0 + 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, _08057478 + ldr r0, _0805747C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08057480 + str r1, [r0] + ldr r0, _08057484 + movs r1, 0 + strb r1, [r0] + ldr r0, _08057488 + strb r1, [r0] + bx lr + .align 2, 0 +_08057478: .4byte 0x03005d60 +_0805747C: .4byte 0x02024064 +_08057480: .4byte bx_exec_buffer_A_ch0_tbl1 + 1 +_08057484: .4byte 0x020244b9 +_08057488: .4byte 0x020244cc + 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, _080574CC + ldr r4, _080574D0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _080574D4 + str r1, [r0] + ldr r0, _080574D8 + 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, _080574DC + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _080574F2 + .align 2, 0 +_080574CC: .4byte 0x03005d60 +_080574D0: .4byte 0x02024064 +_080574D4: .4byte bx_exec_buffer_A_ch0_tbl1 + 1 +_080574D8: .4byte 0x02022fec +_080574DC: .4byte 0x02023064 +_080574E0: + ldr r2, _080574FC + ldr r1, _08057500 + 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 + .align 2, 0 +_080574FC: .4byte 0x02024068 +_08057500: .4byte 0x0832a328 + 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, _08057538 + ldr r1, _0805753C + ldr r0, _08057540 + 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, _08057544 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0805754C + ldr r0, _08057548 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08057550 + .align 2, 0 +_08057538: .4byte 0x02024068 +_0805753C: .4byte 0x0832a328 +_08057540: .4byte 0x02024064 +_08057544: .4byte 0x02023064 +_08057548: .4byte 0x0831c514 +_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, _0805757C + ldr r1, _08057580 + ldr r0, _08057584 + 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 + .align 2, 0 +_0805757C: .4byte 0x02020630 +_08057580: .4byte 0x020241e4 +_08057584: .4byte 0x02024064 + thumb_func_end bx_0802E404 + + thumb_func_start sub_8057588 +sub_8057588: @ 8057588 + push {r4-r7,lr} + ldr r3, _080575D8 + ldr r4, _080575DC + 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, _080575E0 + ldrh r1, [r0, 0x30] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _080575EC + ldr r0, _080575E4 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _080575EC + ldr r1, _080575E8 + ldrb r0, [r1] + adds r0, 0x1 + b _080575F0 + .align 2, 0 +_080575D8: .4byte 0x02023064 +_080575DC: .4byte 0x02024064 +_080575E0: .4byte 0x030022c0 +_080575E4: .4byte 0x03005d90 +_080575E8: .4byte 0x020244cc +_080575EC: + ldr r1, _08057620 + movs r0, 0 +_080575F0: + strb r0, [r1] + ldr r0, _08057624 + 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, _08057628 + ldr r0, _0805762C + 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 + .align 2, 0 +_08057620: .4byte 0x020244cc +_08057624: .4byte 0x030022c0 +_08057628: .4byte 0x020244ac +_0805762C: .4byte 0x02024064 +_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, _08057690 + ldr r4, _08057694 + 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 + .align 2, 0 +_08057690: .4byte 0x020244ac +_08057694: .4byte 0x02024064 +_08057698: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _080576D8 + ldr r5, _080576D0 + ldr r4, _080576D4 + 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 + .align 2, 0 +_080576D0: .4byte 0x020244ac +_080576D4: .4byte 0x02024064 +_080576D8: + movs r7, 0x40 + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _08057700 + ldr r5, _080576F8 + ldr r4, _080576FC + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080577E8 + b _0805771A + .align 2, 0 +_080576F8: .4byte 0x020244ac +_080576FC: .4byte 0x02024064 +_08057700: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0805774C + ldr r5, _08057744 + ldr r4, _08057748 + 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 + .align 2, 0 +_08057744: .4byte 0x020244ac +_08057748: .4byte 0x02024064 +_0805774C: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0805775A + ldrb r0, [r1] + cmp r0, 0x3B + bls _080577DC +_0805775A: + ldr r4, _080577C8 + ldr r0, [r4] + ands r0, r3 + cmp r0, 0 + beq _080577E8 + ldr r6, _080577CC + 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, _080577D0 + ldrb r1, [r1] + ldr r2, _080577D4 + 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, _080577D8 + 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 + .align 2, 0 +_080577C8: .4byte 0x02022fec +_080577CC: .4byte 0x02024064 +_080577D0: .4byte 0x02024210 +_080577D4: .4byte 0x0832a328 +_080577D8: .4byte 0x02023064 +_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, _08057818 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + ldr r1, _0805781C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08057820 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08057818: .4byte 0x02024064 +_0805781C: .4byte 0x03005d60 +_08057820: .4byte sub_8057824 + 1 + thumb_func_end sub_80577F0 + + thumb_func_start sub_8057824 +sub_8057824: @ 8057824 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _08057884 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldr r0, _08057888 + ldrb r0, [r0] + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl dp11b_obj_instanciate + movs r4, 0 + ldr r0, _0805788C + ldrb r0, [r0] + cmp r0, 0 + beq _08057866 +_0805784A: + ldr r0, _08057888 + 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, _0805788C + ldrb r0, [r0] + cmp r4, r0 + blt _0805784A +_08057866: + ldr r2, _08057890 + ldrh r1, [r2, 0x2C] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _0805789C + ldr r0, _08057894 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _0805789C + ldr r1, _08057898 + ldrb r0, [r1] + adds r0, 0x1 + b _080578A0 + .align 2, 0 +_08057884: .4byte 0x0831c5f8 +_08057888: .4byte 0x03005d74 +_0805788C: .4byte 0x0202406c +_08057890: .4byte 0x030022c0 +_08057894: .4byte 0x03005d90 +_08057898: .4byte 0x020244cc +_0805789C: + ldr r1, _080578F4 + 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, _080578F8 + ldr r1, _080578FC + ldr r4, _08057900 + 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, _08057904 + str r1, [r0] + ldr r1, _08057908 + ldr r0, _0805790C + 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 + .align 2, 0 +_080578F4: .4byte 0x020244cc +_080578F8: .4byte 0x02020630 +_080578FC: .4byte 0x020241e4 +_08057900: .4byte 0x03005d74 +_08057904: .4byte sub_8039B2C + 1 +_08057908: .4byte 0x020244b0 +_0805790C: .4byte 0x02024064 +_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, _08057970 + ldr r1, _08057974 + ldr r5, _08057978 + 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, _0805797C + str r1, [r0] + ldr r1, _08057980 + ldr r4, _08057984 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08057988 + 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 + .align 2, 0 +_08057970: .4byte 0x02020630 +_08057974: .4byte 0x020241e4 +_08057978: .4byte 0x03005d74 +_0805797C: .4byte sub_8039B2C + 1 +_08057980: .4byte 0x03005d60 +_08057984: .4byte 0x02024064 +_08057988: .4byte sub_8057BFC + 1 +_0805798C: + movs r0, 0x60 + ands r0, r2 + cmp r0, 0 + bne _08057996 + b _08057AB0 +_08057996: + movs r0, 0x5 + bl audio_play + ldr r2, _080579C8 + ldr r1, _080579CC + ldr r3, _080579D0 + 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, _080579D4 + 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 + .align 2, 0 +_080579C8: .4byte 0x02020630 +_080579CC: .4byte 0x020241e4 +_080579D0: .4byte 0x03005d74 +_080579D4: .4byte sub_8039B2C + 1 +_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, _08057A24 + 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 + .align 2, 0 +_08057A24: .4byte 0x0202406c +_08057A28: + cmp r0, 0x2 + beq _08057A32 + cmp r0, 0x3 + beq _08057A6E + b _08057A70 +_08057A32: + ldr r2, _08057A90 + ldrb r0, [r2] + ldrb r1, [r5] + cmp r0, r1 + bne _08057A6E + ldr r1, _08057A94 + ldrb r2, [r2] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08057A98 + adds r0, r1 + ldr r1, _08057A9C + adds r2, r1 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + ldr r2, _08057AA0 + 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, _08057AA4 + ldrb r1, [r0] + ldr r2, _08057AA8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + ldr r0, _08057AAC + cmp r1, 0 + beq _08057A88 + movs r4, 0 +_08057A88: + cmp r4, 0 + beq _080579B8 + b _08057BB0 + .align 2, 0 +_08057A90: .4byte 0x02024064 +_08057A94: .4byte 0x0202406e +_08057A98: .4byte 0x020244ec +_08057A9C: .4byte 0x020244b0 +_08057AA0: .4byte 0x0831c898 +_08057AA4: .4byte 0x02024210 +_08057AA8: .4byte 0x0832a328 +_08057AAC: .4byte 0x03005d74 +_08057AB0: + movs r0, 0x90 + ands r0, r2 + cmp r0, 0 + bne _08057ABA + b _08057BC8 +_08057ABA: + movs r0, 0x5 + bl audio_play + ldr r2, _08057AEC + ldr r1, _08057AF0 + ldr r3, _08057AF4 + 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, _08057AF8 + 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 + .align 2, 0 +_08057AEC: .4byte 0x02020630 +_08057AF0: .4byte 0x020241e4 +_08057AF4: .4byte 0x03005d74 +_08057AF8: .4byte sub_8039B2C + 1 +_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, _08057B48 + 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 + .align 2, 0 +_08057B48: .4byte 0x0202406c +_08057B4C: + cmp r0, 0x2 + beq _08057B56 + cmp r0, 0x3 + beq _08057B92 + b _08057B94 +_08057B56: + ldr r2, _08057BD0 + ldrb r0, [r2] + ldrb r1, [r5] + cmp r0, r1 + bne _08057B92 + ldr r1, _08057BD4 + ldrb r2, [r2] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08057BD8 + adds r0, r1 + ldr r1, _08057BDC + adds r2, r1 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + ldr r2, _08057BE0 + 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, _08057BE4 + ldrb r1, [r0] + ldr r2, _08057BE8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + ldr r0, _08057BEC + cmp r1, 0 + beq _08057BAC + movs r4, 0 +_08057BAC: + cmp r4, 0 + beq _08057ADC +_08057BB0: + ldr r2, _08057BF0 + ldr r1, _08057BF4 + 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, _08057BF8 + str r1, [r0] +_08057BC8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08057BD0: .4byte 0x02024064 +_08057BD4: .4byte 0x0202406e +_08057BD8: .4byte 0x020244ec +_08057BDC: .4byte 0x020244b0 +_08057BE0: .4byte 0x0831c898 +_08057BE4: .4byte 0x02024210 +_08057BE8: .4byte 0x0832a328 +_08057BEC: .4byte 0x03005d74 +_08057BF0: .4byte 0x02020630 +_08057BF4: .4byte 0x020241e4 +_08057BF8: .4byte sub_8039AD8 + 1 + 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, _08057C30 + ldrb r0, [r3] + lsls r0, 9 + ldr r1, _08057C34 + adds r6, r0, r1 + ldr r2, _08057C38 + ldrh r1, [r2, 0x2C] + movs r0, 0xF0 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _08057C44 + ldr r0, _08057C3C + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _08057C44 + ldr r1, _08057C40 + ldrb r0, [r1] + adds r0, 0x1 + b _08057C48 + .align 2, 0 +_08057C30: .4byte 0x02024064 +_08057C34: .4byte 0x02023068 +_08057C38: .4byte 0x030022c0 +_08057C3C: .4byte 0x03005d90 +_08057C40: .4byte 0x020244cc +_08057C44: + ldr r1, _08057C8C + 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, _08057C90 + ldr r0, _08057C94 + 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 + .align 2, 0 +_08057C8C: .4byte 0x020244cc +_08057C90: .4byte 0x020244b0 +_08057C94: .4byte 0x02024064 +_08057C98: + ldr r2, _08057CB8 + 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, _08057CBC + ldr r1, _08057CC0 + ldrb r1, [r1] + strb r1, [r0] + b _08057CDE + .align 2, 0 +_08057CB8: .4byte 0x0831c898 +_08057CBC: .4byte 0x03005d74 +_08057CC0: .4byte 0x02024064 +_08057CC4: + ldr r0, _08057D0C + 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, _08057D10 + strb r0, [r1] +_08057CDE: + ldr r5, _08057D14 + ldr r0, _08057D0C + 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 + .align 2, 0 +_08057D0C: .4byte 0x02024064 +_08057D10: .4byte 0x03005d74 +_08057D14: .4byte 0x02023064 +_08057D18: + movs r0, 0x7D + ands r0, r4 + cmp r0, 0 + bne _08057D24 + movs r0, 0x1 + add r8, r0 +_08057D24: + ldr r0, _08057D74 + 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, _08057D78 + strb r0, [r1] + movs r0, 0 + mov r8, r0 +_08057D5A: + ldr r7, _08057D7C + mov r0, r8 + cmp r0, 0 + bne _08057D80 +_08057D62: + ldr r1, _08057D74 + ldrb r0, [r7] + adds r0, r1 + ldrb r2, [r0] + ldr r0, _08057D78 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + b _08057E1C + .align 2, 0 +_08057D74: .4byte 0x020244b0 +_08057D78: .4byte 0x03005d74 +_08057D7C: .4byte 0x02024064 +_08057D80: + ldr r1, _08057D9C + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _08057DA0 + str r1, [r0] + movs r0, 0x12 + ands r4, r0 + cmp r4, 0 + beq _08057DA8 + ldr r1, _08057DA4 + ldrb r0, [r7] + b _08057DD8 + .align 2, 0 +_08057D9C: .4byte 0x03005d60 +_08057DA0: .4byte sub_8057824 + 1 +_08057DA4: .4byte 0x03005d74 +_08057DA8: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, _08057DC8 + ldrb r1, [r1] + ldr r2, _08057DCC + 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 + .align 2, 0 +_08057DC8: .4byte 0x02024210 +_08057DCC: .4byte 0x0832a328 +_08057DD0: + movs r0, 0x1 +_08057DD2: + bl battle_get_side_with_given_state + ldr r1, _08057DF4 +_08057DD8: + strb r0, [r1] + ldr r2, _08057DF8 + ldr r1, _08057DFC + ldr r0, _08057DF4 + 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, _08057E00 + b _08057F9C + .align 2, 0 +_08057DF4: .4byte 0x03005d74 +_08057DF8: .4byte 0x02020630 +_08057DFC: .4byte 0x020241e4 +_08057E00: .4byte sub_8039AD8 + 1 +_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, _08057E2C +_08057E1C: + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl1_exec_completed + b _08057F9E + .align 2, 0 +_08057E2C: .4byte 0x0000ffff +_08057E30: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08057E60 + ldr r4, _08057E5C + 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 + .align 2, 0 +_08057E5C: .4byte 0x020244b0 +_08057E60: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _08057EA4 + ldr r4, _08057E9C + 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, _08057EA0 + 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 + .align 2, 0 +_08057E9C: .4byte 0x020244b0 +_08057EA0: .4byte 0x03005d78 +_08057EA4: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08057ED4 + ldr r4, _08057ED0 + 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 + .align 2, 0 +_08057ED0: .4byte 0x020244b0 +_08057ED4: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08057F30 + ldr r4, _08057F28 + 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, _08057F2C + 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 + .align 2, 0 +_08057F28: .4byte 0x020244b0 +_08057F2C: .4byte 0x03005d78 +_08057F30: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _08057F9E + ldr r0, _08057F68 + ldrb r0, [r0] + cmp r0, 0x1 + bls _08057F9E + ldr r0, _08057F6C + ldr r5, [r0] + ands r5, r6 + cmp r5, 0 + bne _08057F9E + ldr r4, _08057F70 + 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, _08057F74 + strb r5, [r0] + b _08057F80 + .align 2, 0 +_08057F68: .4byte 0x03005d78 +_08057F6C: .4byte 0x02022fec +_08057F70: .4byte 0x020244b0 +_08057F74: .4byte 0x03005d74 +_08057F78: + ldr r1, _08057FA8 + 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, _08057FAC + movs r1, 0xB + bl battle_show_message_maybe + ldr r1, _08057FB0 + ldr r0, _08057FB4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08057FB8 +_08057F9C: + str r1, [r0] +_08057F9E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08057FA8: .4byte 0x03005d74 +_08057FAC: .4byte 0x085ccaca +_08057FB0: .4byte 0x03005d60 +_08057FB4: .4byte 0x02024064 +_08057FB8: .4byte sub_8058138 + 1 + thumb_func_end sub_8057BFC + + thumb_func_start sub_8057FBC +sub_8057FBC: @ 8057FBC + push {r4-r7,lr} + movs r7, 0 + ldr r4, _08058120 + 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, _08058124 + movs r0, 0 + strh r0, [r1] + ldr r1, _08058128 + 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, _0805812C + ldr r4, _08058130 + 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, _08058120 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08058086 + ldr r5, _0805812C + ldr r4, _08058130 + 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, _08058134 + 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, _08058120 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080580C8 + ldr r5, _0805812C + ldr r4, _08058130 + 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, _08058120 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08058116 + ldr r5, _0805812C + ldr r4, _08058130 + 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, _08058134 + 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 + .align 2, 0 +_08058120: .4byte 0x030022c0 +_08058124: .4byte 0x02022e14 +_08058128: .4byte 0x02022e16 +_0805812C: .4byte 0x020244b0 +_08058130: .4byte 0x02024064 +_08058134: .4byte 0x03005d78 + 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, _080584D0 + 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, _080584D4 + mov r10, r0 + ldr r1, _080584D8 + mov r8, r1 + ldrb r1, [r1] + adds r2, r1, r0 + ldr r5, _080584DC + ldrb r0, [r2] + ldrb r3, [r5] + cmp r0, r3 + bne _08058170 + b _080584A8 +_08058170: + lsls r1, 9 + ldr r0, _080584E0 + 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, _080584E4 + adds r6, r0, r2 + ldrb r4, [r6, 0x18] + lsls r3, r4, 24 + lsrs r2, r3, 28 + ldr r0, _080584E8 + 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, _080584E4 + 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, _080584EC + 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, _080584D4 + 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, _080584DC + 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, _080584D8 + 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, _080584F0 + mov r9, r5 + mov r8, r2 + movs r7, 0x64 + ldr r5, _080584F4 + 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, _080584F0 + ldr r0, _080584D8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080584F4 + 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, _080584D4 + ldr r3, _080584D8 + 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, _080584DC + 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, _080584F0 + mov r10, r5 + ldr r0, _080584D8 + mov r9, r0 + movs r1, 0x64 + mov r8, r1 + ldr r7, _080584F4 + 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, _080584F0 + ldr r0, _080584D8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080584F4 + adds r0, r1 + movs r1, 0x15 + ldr r2, [sp, 0x1C] + bl pokemon_setattr +_080584A8: + ldr r1, _080584F8 + ldr r2, _080584D8 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _080584FC + str r1, [r0] + ldr r3, _080584D4 + ldrb r0, [r2] + adds r0, r3 + ldr r1, _080584DC + 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 + .align 2, 0 +_080584D0: .4byte 0x030022c0 +_080584D4: .4byte 0x020244b0 +_080584D8: .4byte 0x02024064 +_080584DC: .4byte 0x03005d74 +_080584E0: .4byte 0x02023068 +_080584E4: .4byte 0x020242bc +_080584E8: .4byte 0x0832a328 +_080584EC: .4byte 0x02024084 +_080584F0: .4byte 0x0202406e +_080584F4: .4byte 0x020244ec +_080584F8: .4byte 0x03005d60 +_080584FC: .4byte sub_8057BFC + 1 +_08058500: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _08058554 + movs r0, 0x5 + bl audio_play + ldr r0, _08058540 + ldrb r0, [r0] + bl battle_menu_cursor_related + ldr r1, _08058544 + ldr r4, _08058548 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + ldr r1, _0805854C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08058550 + str r1, [r0] +_08058532: + bl sub_8059B18 + bl sub_8059B3C + bl sub_8059BB0 + b _080586E8 + .align 2, 0 +_08058540: .4byte 0x03005d74 +_08058544: .4byte 0x020244b0 +_08058548: .4byte 0x02024064 +_0805854C: .4byte 0x03005d60 +_08058550: .4byte sub_8057BFC + 1 +_08058554: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080585A4 + ldr r3, _08058584 + ldrb r2, [r3] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _0805856A + b _080586E8 +_0805856A: + ldr r0, _08058588 + ldr r1, _0805858C + 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 + .align 2, 0 +_08058584: .4byte 0x03005d74 +_08058588: .4byte 0x020244b0 +_0805858C: .4byte 0x02024064 +_08058590: + ldrb r0, [r3] + bl battle_menu_cursor_related +_08058596: + ldr r4, _080585A0 + ldrb r0, [r4] + movs r1, 0x1 + b _0805862C + .align 2, 0 +_080585A0: .4byte 0x03005d74 +_080585A4: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080585E8 + ldr r3, _080585D8 + ldrb r2, [r3] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080585BA + b _080586E8 +_080585BA: + ldr r1, _080585DC + movs r0, 0x1 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcc _080585C8 + b _080586E8 +_080585C8: + ldr r0, _080585E0 + ldr r1, _080585E4 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + cmp r2, r0 + beq _08058578 + b _08058590 + .align 2, 0 +_080585D8: .4byte 0x03005d74 +_080585DC: .4byte 0x03005d78 +_080585E0: .4byte 0x020244b0 +_080585E4: .4byte 0x02024064 +_080585E8: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805865C + ldr r3, _08058614 + ldrb r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080586E8 + ldr r0, _08058618 + ldr r1, _0805861C + 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 + .align 2, 0 +_08058614: .4byte 0x03005d74 +_08058618: .4byte 0x020244b0 +_0805861C: .4byte 0x02024064 +_08058620: + ldrb r0, [r3] + bl battle_menu_cursor_related +_08058626: + ldr r4, _08058650 + ldrb r0, [r4] + movs r1, 0x2 +_0805862C: + eors r0, r1 + strb r0, [r4] + movs r0, 0x5 + bl audio_play + ldr r1, _08058654 + ldr r0, _08058658 + 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 + .align 2, 0 +_08058650: .4byte 0x03005d74 +_08058654: .4byte 0x020244b0 +_08058658: .4byte 0x02024064 +_0805865C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080586E8 + ldr r3, _08058694 + ldrb r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _080586E8 + ldr r1, _08058698 + movs r0, 0x2 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _080586E8 + ldr r0, _0805869C + ldr r1, _080586A0 + 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 + .align 2, 0 +_08058694: .4byte 0x03005d74 +_08058698: .4byte 0x03005d78 +_0805869C: .4byte 0x020244b0 +_080586A0: .4byte 0x02024064 +_080586A4: + ldrb r0, [r3] + bl battle_menu_cursor_related +_080586AA: + ldr r4, _080586D4 + ldrb r0, [r4] + movs r1, 0x2 + eors r0, r1 + strb r0, [r4] + movs r0, 0x5 + bl audio_play + ldr r1, _080586D8 + ldr r0, _080586DC + 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 + .align 2, 0 +_080586D4: .4byte 0x03005d74 +_080586D8: .4byte 0x020244b0 +_080586DC: .4byte 0x02024064 +_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, _08058740 + ldrb r0, [r0] + cmp r0, 0 + bne _0805875C + ldr r0, _08058744 + ldrb r0, [r0] + cmp r0, 0 + bne _08058798 + movs r0, 0x5A + bl m4aSongNumStop + ldr r3, _08058748 + ldr r0, _0805874C + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _08058750 + ldr r0, [r0] + str r0, [r3] + ldr r0, _08058754 + bl set_callback2 + ldr r0, _08058758 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08058738 + bl sub_817E3F4 +_08058738: + bl Window_FreeMemory + b _08058798 + .align 2, 0 +_08058740: .4byte 0x030030fc +_08058744: .4byte 0x03003124 +_08058748: .4byte 0x030022c0 +_0805874C: .4byte 0x00000439 +_08058750: .4byte 0x03005d00 +_08058754: .4byte sub_8038D64 + 1 +_08058758: .4byte 0x0202433a +_0805875C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08058798 + movs r0, 0x5A + bl m4aSongNumStop + ldr r3, _0805879C + ldr r0, _080587A0 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _080587A4 + ldr r0, [r0] + str r0, [r3] + ldr r0, _080587A8 + bl set_callback2 + ldr r0, _080587AC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08058794 + bl sub_817E3F4 +_08058794: + bl Window_FreeMemory +_08058798: + pop {r0} + bx r0 + .align 2, 0 +_0805879C: .4byte 0x030022c0 +_080587A0: .4byte 0x00000439 +_080587A4: .4byte 0x03005d00 +_080587A8: .4byte sub_8038D64 + 1 +_080587AC: .4byte 0x0202433a + thumb_func_end sub_80586F8 + + thumb_func_start sub_80587B0 +sub_80587B0: @ 80587B0 + push {lr} + ldr r0, _080587E4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08058832 + ldr r0, _080587E8 + 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, _080587EC + ldrb r0, [r0] + cmp r0, 0 + bne _080587F0 + bl sub_800AC34 + b _080587F4 + .align 2, 0 +_080587E4: .4byte 0x02037fd4 +_080587E8: .4byte 0x02022fec +_080587EC: .4byte 0x030030fc +_080587F0: + bl sub_800ADF8 +_080587F4: + ldr r1, _08058804 + ldr r0, _08058808 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805880C + str r1, [r0] + b _08058832 + .align 2, 0 +_08058804: .4byte 0x03005d60 +_08058808: .4byte 0x02024064 +_0805880C: .4byte sub_80586F8 + 1 +_08058810: + movs r0, 0x5A + bl m4aSongNumStop + ldr r2, _08058838 + ldr r0, _0805883C + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, _08058840 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl set_callback2 +_08058832: + pop {r0} + bx r0 + .align 2, 0 +_08058838: .4byte 0x030022c0 +_0805883C: .4byte 0x00000439 +_08058840: .4byte 0x03005d00 + thumb_func_end sub_80587B0 + + thumb_func_start sub_8058844 +sub_8058844: @ 8058844 + push {lr} + ldr r2, _0805886C + ldr r1, _08058870 + ldr r0, _08058874 + 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, _08058878 + cmp r1, r0 + bne _08058868 + bl dp01_tbl1_exec_completed +_08058868: + pop {r0} + bx r0 + .align 2, 0 +_0805886C: .4byte 0x02020630 +_08058870: .4byte 0x020241e4 +_08058874: .4byte 0x02024064 +_08058878: .4byte nullsub_12 + 1 + thumb_func_end sub_8058844 + + thumb_func_start sub_805887C +sub_805887C: @ 805887C + push {lr} + ldr r2, _080588A4 + ldr r1, _080588A8 + ldr r0, _080588AC + 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, _080588B0 + cmp r1, r0 + bne _080588A0 + bl dp01_tbl1_exec_completed +_080588A0: + pop {r0} + bx r0 + .align 2, 0 +_080588A4: .4byte 0x02020630 +_080588A8: .4byte 0x020241e4 +_080588AC: .4byte 0x02024064 +_080588B0: .4byte nullsub_12 + 1 + thumb_func_end sub_805887C + + thumb_func_start bx_802F7A0 +bx_802F7A0: @ 80588B4 + push {r4-r6,lr} + ldr r6, _08058910 + ldr r5, _08058914 + ldr r4, _08058918 + 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, _0805891C + cmp r1, r0 + bne _08058908 + ldr r0, _08058920 + 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 obj_delete_and_free_tiles + bl dp01_tbl1_exec_completed +_08058908: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08058910: .4byte 0x02020630 +_08058914: .4byte 0x020241e4 +_08058918: .4byte 0x02024064 +_0805891C: .4byte nullsub_12 + 1 +_08058920: .4byte 0x03005d90 + thumb_func_end bx_802F7A0 + + thumb_func_start sub_8058924 +sub_8058924: @ 8058924 + push {r4,lr} + ldr r4, _08058964 + ldr r1, [r4] + ldr r3, _08058968 + 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 + .align 2, 0 +_08058964: .4byte 0x020244d0 +_08058968: .4byte 0x02024064 + 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, _080589BC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080589D0 +_08058998: + ldr r2, _080589C0 + ldr r1, _080589C4 + ldr r3, _080589C8 + 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, _080589CC + mov r10, r3 + cmp r1, r0 + bne _08058A0A + b _08058A0E + .align 2, 0 +_080589BC: .4byte 0x02022fec +_080589C0: .4byte 0x02020630 +_080589C4: .4byte 0x03005d70 +_080589C8: .4byte 0x02024064 +_080589CC: .4byte nullsub_12 + 1 +_080589D0: + ldr r3, _08058B18 + ldr r6, _08058B1C + ldr r2, _08058B20 + 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, _08058B24 + 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, _08058B28 + 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, _08058B2C + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldr r7, _08058B30 + ldrb r1, [r6] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _08058B34 + 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, _08058B38 + mov r2, r10 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _08058B3C + str r1, [r0] +_08058B08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08058B18: .4byte 0x02020630 +_08058B1C: .4byte 0x03005d70 +_08058B20: .4byte 0x02024064 +_08058B24: .4byte nullsub_12 + 1 +_08058B28: .4byte 0x020244d0 +_08058B2C: .4byte 0x000027f9 +_08058B30: .4byte 0x0202406e +_08058B34: .4byte 0x020244ec +_08058B38: .4byte 0x03005d60 +_08058B3C: .4byte sub_8058924 + 1 + 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, _08058CEC + ldr r0, [r4] + ldr r7, _08058CF0 + 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, _08058CF4 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08058CF8 + 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, _08058CF4 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08058CF8 + 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, _08058CFC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058C38 + ldr r4, _08058D00 + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _08058CF4 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08058CF8 + 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, _08058D00 + ldr r4, _08058CF0 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _08058CF4 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08058CF8 + 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, _08058CEC + ldr r2, [r0] + ldr r0, _08058CF0 + 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, _08058CEC + ldr r0, [r5] + ldr r4, _08058CF0 + 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, _08058CFC + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08058D08 + ldr r0, _08058D04 + bl m4aMPlayContinue + b _08058D14 + .align 2, 0 +_08058CEC: .4byte 0x020244d0 +_08058CF0: .4byte 0x02024064 +_08058CF4: .4byte 0x0202406e +_08058CF8: .4byte 0x020244ec +_08058CFC: .4byte 0x02022fec +_08058D00: .4byte 0x03005d70 +_08058D04: .4byte 0x03007420 +_08058D08: + ldr r0, _08058D88 + ldr r1, _08058D8C + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08058D14: + ldr r0, _08058D90 + ldr r2, [r0] + ldr r0, _08058D94 + 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, _08058D98 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08058DAC +_08058D52: + ldr r2, _08058D9C + ldr r0, _08058DA0 + ldr r1, _08058D94 + 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, _08058DA4 + cmp r3, r0 + bne _08058E0A + ldr r0, _08058DA8 + 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 + .align 2, 0 +_08058D88: .4byte 0x03007420 +_08058D8C: .4byte 0x0000ffff +_08058D90: .4byte 0x020244d0 +_08058D94: .4byte 0x02024064 +_08058D98: .4byte 0x02022fec +_08058D9C: .4byte 0x02020630 +_08058DA0: .4byte 0x03005d7c +_08058DA4: .4byte nullsub_12 + 1 +_08058DA8: .4byte 0x020241e4 +_08058DAC: + ldr r2, _08058EB8 + ldr r7, _08058EBC + ldr r0, _08058EC0 + 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, _08058EC4 + cmp r4, r0 + bne _08058E0A + ldr r6, _08058EC8 + 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, _08058ECC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058E48 + ldr r2, _08058EBC + ldr r0, _08058EC0 + 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, _08058EB8 + adds r0, r1 + bl obj_delete_and_free_tiles +_08058E48: + ldr r1, _08058EBC + ldr r4, _08058EC0 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08058EB8 + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r3, _08058ED0 + 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, _08058ED4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08058ED8 + str r1, [r0] +_08058EAA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08058EB8: .4byte 0x02020630 +_08058EBC: .4byte 0x03005d7c +_08058EC0: .4byte 0x02024064 +_08058EC4: .4byte nullsub_12 + 1 +_08058EC8: .4byte 0x020241e4 +_08058ECC: .4byte 0x02022fec +_08058ED0: .4byte 0x020244d0 +_08058ED4: .4byte 0x03005d60 +_08058ED8: .4byte sub_805896C + 1 + thumb_func_end sub_8058B40 + + thumb_func_start sub_8058EDC +sub_8058EDC: @ 8058EDC + push {r4-r6,lr} + ldr r2, _08058F9C + ldr r0, _08058FA0 + ldr r6, _08058FA4 + 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, _08058FA8 + cmp r4, r0 + bne _08058F94 + ldr r5, _08058FAC + 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, _08058FB0 + 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, _08058FB4 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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, _08058FB8 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _08058FBC + str r0, [r1] +_08058F94: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08058F9C: .4byte 0x02020630 +_08058FA0: .4byte 0x03005d70 +_08058FA4: .4byte 0x02024064 +_08058FA8: .4byte nullsub_12 + 1 +_08058FAC: .4byte 0x020244d0 +_08058FB0: .4byte 0x020241e4 +_08058FB4: .4byte 0x000027f9 +_08058FB8: .4byte 0x03005d60 +_08058FBC: .4byte sub_8058FC0 + 1 + thumb_func_end sub_8058EDC + + thumb_func_start sub_8058FC0 +sub_8058FC0: @ 8058FC0 + push {r4,lr} + ldr r0, _08059014 + ldr r0, [r0] + ldr r4, _08059018 + 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, _0805901C + ldr r1, _08059020 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r2, _08059024 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _08059028 + adds r0, r2 + bl sub_805E990 + bl dp01_tbl1_exec_completed +_0805900E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08059014: .4byte 0x020244d0 +_08059018: .4byte 0x02024064 +_0805901C: .4byte 0x03007420 +_08059020: .4byte 0x0000ffff +_08059024: .4byte 0x0202406e +_08059028: .4byte 0x020244ec + thumb_func_end sub_8058FC0 + + thumb_func_start sub_805902C +sub_805902C: @ 805902C + push {r4-r6,lr} + ldr r6, _080590D8 + ldr r0, [r6] + ldr r5, _080590DC + 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, _080590E0 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _080590E4 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805905E: + ldr r4, _080590E8 + ldr r0, _080590EC + 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, _080590F0 + 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 obj_delete_and_free_tiles + ldr r4, _080590F4 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _080590E0 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _080590E4 + 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, _080590F8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _080590FC + str r1, [r0] +_080590D2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080590D8: .4byte 0x020244d0 +_080590DC: .4byte 0x02024064 +_080590E0: .4byte 0x0202406e +_080590E4: .4byte 0x020244ec +_080590E8: .4byte 0x02020630 +_080590EC: .4byte 0x03005d7c +_080590F0: .4byte nullsub_12 + 1 +_080590F4: .4byte 0x03005d70 +_080590F8: .4byte 0x03005d60 +_080590FC: .4byte sub_8058EDC + 1 + 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, _08059128 + ldr r1, _0805912C + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + adds r0, r4, 0 + bl remove_task +_08059122: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08059128: .4byte 0x03007420 +_0805912C: .4byte 0x0000ffff + thumb_func_end c3_0802FDF4 + + thumb_func_start bx_t1_healthbar_update +bx_t1_healthbar_update: @ 8059130 + push {r4-r6,lr} + ldr r5, _08059170 + ldrb r0, [r5] + ldr r6, _08059174 + 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 + .align 2, 0 +_08059170: .4byte 0x02024064 +_08059174: .4byte 0x03005d70 +_08059178: + ldr r2, _08059198 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0805919C + adds r0, r2 + bl sub_805E990 + bl dp01_tbl1_exec_completed +_08059192: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08059198: .4byte 0x0202406e +_0805919C: .4byte 0x020244ec + thumb_func_end bx_t1_healthbar_update + + thumb_func_start sub_80591A0 +sub_80591A0: @ 80591A0 + push {lr} + movs r0, 0 + bl a_pressed_maybe + 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, _080592B8 + 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, _080592BC + 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, _080592C0 + 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, _080592C4 + adds r4, 0x1 + lsls r4, 2 + ldr r2, _080592C8 + 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, _080592CC + 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, _080592BC + 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, _080592D0 + b _08059316 + .align 2, 0 +_080592B8: .4byte 0x03005e00 +_080592BC: .4byte 0x0202406e +_080592C0: .4byte 0x020244ec +_080592C4: .4byte 0x0831f72c +_080592C8: .4byte 0x083203cc +_080592CC: .4byte 0x02024064 +_080592D0: .4byte sub_8059544 + 1 +_080592D4: + ldr r0, _080592E4 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldr r0, _080592E8 + b _08059318 + .align 2, 0 +_080592E4: .4byte 0x03005e00 +_080592E8: .4byte sub_805965C + 1 +_080592EC: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, _0805930C + ldr r3, [sp, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, _08059310 + str r1, [r0] + mov r0, r9 + bl remove_task + b _0805931A + .align 2, 0 +_0805930C: .4byte 0x03005d60 +_08059310: .4byte sub_80591A0 + 1 +_08059314: + ldr r0, _0805932C +_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 + .align 2, 0 +_0805932C: .4byte sub_8059330 + 1 + 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, _080593E8 + 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, _080593EC + 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, _080593F0 + lsls r1, r4, 2 + ldr r2, _080593F4 + 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, _080593F8 + 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, _080593FC + 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 + .align 2, 0 +_080593E8: .4byte 0x03005e00 +_080593EC: .4byte 0x020244ec +_080593F0: .4byte 0x0831f72c +_080593F4: .4byte 0x083203cc +_080593F8: .4byte 0x03005d70 +_080593FC: .4byte sub_8059400 + 1 + 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, _0805942C + 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 + .align 2, 0 +_0805942C: .4byte 0x03005e00 +_08059430: + ldrb r0, [r6, 0x8] + mov r9, r0 + ldrh r2, [r6, 0xA] + mov r10, r2 + ldrb r7, [r6, 0xC] + ldr r5, _080594F8 + 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, _080594FC + 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, _08059500 + adds r4, 0x1 + lsls r4, 2 + ldr r2, _08059504 + 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, _08059508 + 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, _0805950C + str r0, [r6] + b _0805952C + .align 2, 0 +_080594F8: .4byte 0x03005d70 +_080594FC: .4byte 0x020244ec +_08059500: .4byte 0x0831f72c +_08059504: .4byte 0x083203cc +_08059508: .4byte 0x02024064 +_0805950C: .4byte sub_8059544 + 1 +_08059510: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, _0805953C + lsls r0, r7, 2 + adds r0, r1 + ldr r1, _08059540 + 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 + .align 2, 0 +_0805953C: .4byte 0x03005d60 +_08059540: .4byte sub_80591A0 + 1 + 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, _08059598 + 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, _0805959C + 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, _08059598 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080595A0 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08059598: .4byte 0x03005e00 +_0805959C: .4byte 0x0202406e +_080595A0: .4byte sub_80595A4 + 1 + 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, _08059610 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + ldrb r5, [r2, 0xC] + ldr r0, _08059614 + 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, _08059618 + 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, _0805961C + 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, _08059620 + adds r0, r2, r0 + ldrb r0, [r0] + adds r1, r7, 0 + movs r2, 0 + bl healthbar_draw_field_maybe + b _08059638 + .align 2, 0 +_08059610: .4byte 0x03005e00 +_08059614: .4byte 0x020244d0 +_08059618: .4byte 0x020244ec +_0805961C: .4byte 0x0202406e +_08059620: .4byte 0x03005d70 +_08059624: + ldr r0, _0805964C + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x64 + muls r1, r4 + ldr r2, _08059650 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_08059638: + ldr r0, _08059654 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _08059658 + str r0, [r1] +_08059646: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805964C: .4byte 0x03005d70 +_08059650: .4byte 0x020244ec +_08059654: .4byte 0x03005e00 +_08059658: .4byte sub_805965C + 1 + 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, _08059698 + 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, _0805969C + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + ldrb r0, [r4, 0xC] + ldr r1, _080596A0 + lsls r0, 2 + adds r0, r1 + ldr r1, _080596A4 + str r1, [r0] + adds r0, r5, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08059698: .4byte 0x03005e00 +_0805969C: .4byte 0x020244ec +_080596A0: .4byte 0x03005d60 +_080596A4: .4byte sub_80591A0 + 1 + thumb_func_end sub_805965C + + thumb_func_start sub_80596A8 +sub_80596A8: @ 80596A8 + push {r4-r6,lr} + ldr r6, _0805972C + ldr r5, _08059730 + ldr r4, _08059734 + 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, _08059738 + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805973C + 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 obj_delete_and_free_tiles + ldr r1, _08059740 + 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 + .align 2, 0 +_0805972C: .4byte 0x02020630 +_08059730: .4byte 0x020241e4 +_08059734: .4byte 0x02024064 +_08059738: .4byte 0x0202406e +_0805973C: .4byte 0x020244ec +_08059740: .4byte 0x03005d70 + thumb_func_end sub_80596A8 + + thumb_func_start sub_8059744 +sub_8059744: @ 8059744 + push {r4-r6,lr} + ldr r0, _080597A0 + ldr r0, [r0] + ldr r6, _080597A4 + 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, _080597A8 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _080597AC + 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 obj_delete_and_free_tiles + ldr r1, _080597B0 + 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 + .align 2, 0 +_080597A0: .4byte 0x020244d0 +_080597A4: .4byte 0x02024064 +_080597A8: .4byte 0x020241e4 +_080597AC: .4byte 0x02020630 +_080597B0: .4byte 0x03005d70 + thumb_func_end sub_8059744 + + thumb_func_start sub_80597B4 +sub_80597B4: @ 80597B4 + push {lr} + movs r0, 0 + bl a_pressed_maybe + 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, _08059810 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805980A + ldr r1, _08059814 + ldr r2, _08059818 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805981C + str r1, [r0] + ldr r3, _08059820 + ldr r1, _08059824 + 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 Window_FreeMemory + adds r0, r4, 0 + bl sub_81B89AC +_0805980A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08059810: .4byte 0x02037fd4 +_08059814: .4byte 0x03005d60 +_08059818: .4byte 0x02024064 +_0805981C: .4byte sub_8059828 + 1 +_08059820: .4byte 0x03005e00 +_08059824: .4byte 0x03005d7c + thumb_func_end sub_80597CC + + thumb_func_start sub_8059828 +sub_8059828: @ 8059828 + push {lr} + ldr r0, _08059858 + ldr r1, [r0, 0x4] + ldr r0, _0805985C + cmp r1, r0 + bne _08059898 + ldr r0, _08059860 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08059898 + ldr r0, _08059864 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08059870 + ldr r0, _08059868 + ldrb r1, [r0] + ldr r2, _0805986C + movs r0, 0x1 + bl dp01_build_cmdbuf_x22_a_three_bytes + b _0805987A + .align 2, 0 +_08059858: .4byte 0x030022c0 +_0805985C: .4byte sub_8038420 + 1 +_08059860: .4byte 0x02037fd4 +_08059864: .4byte 0x0203cee8 +_08059868: .4byte 0x0203cee9 +_0805986C: .4byte 0x0203cf00 +_08059870: + movs r0, 0x1 + movs r1, 0x6 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes +_0805987A: + ldr r1, _0805989C + ldr r0, _080598A0 + 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 + .align 2, 0 +_0805989C: .4byte 0x02023064 +_080598A0: .4byte 0x02024064 + thumb_func_end sub_8059828 + + thumb_func_start sub_80598A4 +sub_80598A4: @ 80598A4 + push {lr} + ldr r0, _080598D0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080598CC + ldr r1, _080598D4 + ldr r0, _080598D8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _080598DC + str r1, [r0] + bl nullsub_35 + bl Window_FreeMemory + bl sub_81AABB0 +_080598CC: + pop {r0} + bx r0 + .align 2, 0 +_080598D0: .4byte 0x02037fd4 +_080598D4: .4byte 0x03005d60 +_080598D8: .4byte 0x02024064 +_080598DC: .4byte sub_80598E0 + 1 + thumb_func_end sub_80598A4 + + thumb_func_start sub_80598E0 +sub_80598E0: @ 80598E0 + push {lr} + ldr r0, _0805990C + ldr r1, [r0, 0x4] + ldr r0, _08059910 + cmp r1, r0 + bne _08059906 + ldr r0, _08059914 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08059906 + ldr r0, _08059918 + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl1_exec_completed +_08059906: + pop {r0} + bx r0 + .align 2, 0 +_0805990C: .4byte 0x030022c0 +_08059910: .4byte sub_8038420 + 1 +_08059914: .4byte 0x02037fd4 +_08059918: .4byte 0x0203ce7c + thumb_func_end sub_80598E0 + + thumb_func_start bx_wait_t1 +bx_wait_t1: @ 805991C + push {lr} + ldr r0, _0805994C + ldrb r0, [r0] + cmp r0, 0 + beq _08059942 + ldr r0, _08059950 + ldr r2, [r0] + ldr r0, _08059954 + 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 + .align 2, 0 +_0805994C: .4byte 0x020244b9 +_08059950: .4byte 0x020244d0 +_08059954: .4byte 0x02024064 + thumb_func_end bx_wait_t1 + + thumb_func_start bx_blink_t1 +bx_blink_t1: @ 8059958 + push {r4,lr} + ldr r1, _08059994 + ldr r0, _08059998 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _0805999C + 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, _080599A0 + strb r3, [r0] + bl dp01_tbl1_exec_completed + b _080599CE + .align 2, 0 +_08059994: .4byte 0x020241e4 +_08059998: .4byte 0x02024064 +_0805999C: .4byte 0x02020630 +_080599A0: .4byte 0x020244b9 +_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, _08059A64 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08059A02 + ldr r4, _08059A68 + 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, _08059A64 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08059A2C + ldr r4, _08059A68 + 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, _08059A64 + 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, _08059A68 + 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 + .align 2, 0 +_08059A64: .4byte 0x030022c0 +_08059A68: .4byte 0x03005d74 +_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, _08059AA8 + 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 + .align 2, 0 +_08059AA8: .4byte 0x030022c0 + thumb_func_end sub_80599D4 + + thumb_func_start sub_8059AAC +sub_8059AAC: @ 8059AAC + push {r4-r7,lr} + ldr r0, _08059B04 + ldrb r1, [r0] + lsls r1, 9 + ldr r3, _08059B08 + ldr r2, _08059B0C + movs r0, 0 + strb r0, [r2] + movs r5, 0 + ldr r7, _08059B10 + 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, _08059B14 + adds r1, r0 + adds r0, r7, 0 + bl gf_strcpy + 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 + .align 2, 0 +_08059B04: .4byte 0x02024064 +_08059B08: .4byte 0x02023068 +_08059B0C: .4byte 0x03005d78 +_08059B10: .4byte 0x02022e2c +_08059B14: .4byte 0x0831977c + thumb_func_end sub_8059AAC + + thumb_func_start sub_8059B18 +sub_8059B18: @ 8059B18 + push {r4,lr} + ldr r4, _08059B34 + ldr r1, _08059B38 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + movs r1, 0x7 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08059B34: .4byte 0x02022e2c +_08059B38: .4byte 0x085cca6f + thumb_func_end sub_8059B18 + + thumb_func_start sub_8059B3C +sub_8059B3C: @ 8059B3C + push {r4-r7,lr} + ldr r5, _08059BA0 + ldr r7, _08059BA4 + 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, _08059BA8 + ldr r5, _08059BAC + 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 decimal_int_to_string + 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 decimal_int_to_string + adds r0, r6, 0 + movs r1, 0x9 + bl battle_show_message_maybe +_08059B98: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08059BA0: .4byte 0x02023064 +_08059BA4: .4byte 0x02024064 +_08059BA8: .4byte 0x02022e2c +_08059BAC: .4byte 0x020244b0 + thumb_func_end sub_8059B3C + + thumb_func_start sub_8059BB0 +sub_8059BB0: @ 8059BB0 + push {r4-r6,lr} + ldr r5, _08059C0C + ldrb r4, [r5] + lsls r4, 9 + ldr r0, _08059C10 + adds r4, r0 + ldr r6, _08059C14 + ldr r1, _08059C18 + adds r0, r6, 0 + bl gf_strcpy + 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, _08059C1C + ldr r2, _08059C20 + 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, _08059C24 + adds r1, r2 + bl gf_strcpy + adds r0, r6, 0 + movs r1, 0xA + bl battle_show_message_maybe + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08059C0C: .4byte 0x02024064 +_08059C10: .4byte 0x02023068 +_08059C14: .4byte 0x02022e2c +_08059C18: .4byte 0x085cca73 +_08059C1C: .4byte 0x0831c898 +_08059C20: .4byte 0x020244b0 +_08059C24: .4byte 0x0831ae38 + 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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _08059CB0 + 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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08059CB0: .4byte 0x00001016 + 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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _08059D3C + 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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08059D3C: .4byte 0x00001016 + thumb_func_end sub_8059CF8 + + thumb_func_start sub_8059D40 +sub_8059D40: @ 8059D40 + push {lr} + ldr r0, _08059D4C + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08059D4C: .4byte sub_80A92F8 + 1 + thumb_func_end sub_8059D40 + + thumb_func_start sub_8059D50 +sub_8059D50: @ 8059D50 + push {lr} + ldr r0, _08059D5C + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08059D5C: .4byte sub_80A92F8 + 1 + thumb_func_end sub_8059D50 + + thumb_func_start sub_8059D60 +sub_8059D60: @ 8059D60 + push {lr} + ldr r0, _08059D88 + ldr r2, [r0] + ldr r0, _08059D8C + 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 + .align 2, 0 +_08059D88: .4byte 0x020244d0 +_08059D8C: .4byte 0x02024064 + thumb_func_end sub_8059D60 + + thumb_func_start bx_8030B2C +bx_8030B2C: @ 8059D90 + push {lr} + ldr r0, _08059DB8 + ldr r2, [r0] + ldr r0, _08059DBC + 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 + .align 2, 0 +_08059DB8: .4byte 0x020244d0 +_08059DBC: .4byte 0x02024064 + thumb_func_end bx_8030B2C + + thumb_func_start b_link_standby_message +b_link_standby_message: @ 8059DC0 + push {lr} + ldr r0, _08059DE4 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08059DE0 + ldr r0, _08059DE8 + movs r1, 0 + strh r1, [r0] + ldr r0, _08059DEC + strh r1, [r0] + ldr r0, _08059DF0 + movs r1, 0 + bl battle_show_message_maybe +_08059DE0: + pop {r0} + bx r0 + .align 2, 0 +_08059DE4: .4byte 0x02022fec +_08059DE8: .4byte 0x02022e14 +_08059DEC: .4byte 0x02022e16 +_08059DF0: .4byte 0x085cca29 + 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, _08059E20 + ldr r0, _08059E24 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08059E2C + ldr r0, _08059E28 + 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 + .align 2, 0 +_08059E20: .4byte 0x02023064 +_08059E24: .4byte 0x02024064 +_08059E28: .4byte 0x0202406e +_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, _08059E9C + ldr r3, _08059EA0 + 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, _08059EA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08059E9C: .4byte 0x02023064 +_08059EA0: .4byte 0x02024064 +_08059EA4: .4byte _08059EA8 + .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, _0805A1AC + 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, _0805A1AC + 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, _0805A1B0 + 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, _0805A1B4 + 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, _0805A1B8 + 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 strcpy_limit_10_chars + 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 + .align 2, 0 +_0805A1AC: .4byte 0x020244ec +_0805A1B0: .4byte 0xfffffc1f +_0805A1B4: .4byte 0xfff07fff +_0805A1B8: .4byte 0xfffffe0f +_0805A1BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A1C8 + adds r0, r1 + movs r1, 0xB + b _0805A536 + .align 2, 0 +_0805A1C8: .4byte 0x020244ec +_0805A1CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A1D8 + adds r0, r1 + movs r1, 0xC + b _0805A536 + .align 2, 0 +_0805A1D8: .4byte 0x020244ec +_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, _0805A240 + 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, _0805A240 + 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 + .align 2, 0 +_0805A240: .4byte 0x020244ec +_0805A244: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A25C + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0805A536 + .align 2, 0 +_0805A25C: .4byte 0x020244ec +_0805A260: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _0805A298 + 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, _0805A298 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0805A5FE + .align 2, 0 +_0805A298: .4byte 0x020244ec +_0805A29C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A2B4 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0805A5F6 + .align 2, 0 +_0805A2B4: .4byte 0x020244ec +_0805A2B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A2C4 + adds r0, r1 + movs r1, 0x1 + b _0805A2D2 + .align 2, 0 +_0805A2C4: .4byte 0x020244ec +_0805A2C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A2F4 + 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 + .align 2, 0 +_0805A2F4: .4byte 0x020244ec +_0805A2F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A304 + adds r0, r1 + movs r1, 0x1A + b _0805A5F6 + .align 2, 0 +_0805A304: .4byte 0x020244ec +_0805A308: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A314 + adds r0, r1 + movs r1, 0x1B + b _0805A5F6 + .align 2, 0 +_0805A314: .4byte 0x020244ec +_0805A318: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A324 + adds r0, r1 + movs r1, 0x1C + b _0805A5F6 + .align 2, 0 +_0805A324: .4byte 0x020244ec +_0805A328: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A334 + adds r0, r1 + movs r1, 0x1D + b _0805A5F6 + .align 2, 0 +_0805A334: .4byte 0x020244ec +_0805A338: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A344 + adds r0, r1 + movs r1, 0x1E + b _0805A5F6 + .align 2, 0 +_0805A344: .4byte 0x020244ec +_0805A348: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A354 + adds r0, r1 + movs r1, 0x1F + b _0805A5F6 + .align 2, 0 +_0805A354: .4byte 0x020244ec +_0805A358: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A364 + adds r0, r1 + movs r1, 0x20 + b _0805A5F6 + .align 2, 0 +_0805A364: .4byte 0x020244ec +_0805A368: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A374 + adds r0, r1 + movs r1, 0x22 + b _0805A5F6 + .align 2, 0 +_0805A374: .4byte 0x020244ec +_0805A378: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A384 + adds r0, r1 + movs r1, 0x23 + b _0805A5F6 + .align 2, 0 +_0805A384: .4byte 0x020244ec +_0805A388: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A394 + adds r0, r1 + movs r1, 0x24 + b _0805A5F6 + .align 2, 0 +_0805A394: .4byte 0x020244ec +_0805A398: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A3A4 + adds r0, r1 + movs r1, 0x25 + b _0805A5F6 + .align 2, 0 +_0805A3A4: .4byte 0x020244ec +_0805A3A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A3B4 + adds r0, r1 + movs r1, 0x26 + b _0805A5F6 + .align 2, 0 +_0805A3B4: .4byte 0x020244ec +_0805A3B8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0805A404 + 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 + .align 2, 0 +_0805A404: .4byte 0x020244ec +_0805A408: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A414 + adds r0, r1 + movs r1, 0x27 + b _0805A5F6 + .align 2, 0 +_0805A414: .4byte 0x020244ec +_0805A418: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A424 + adds r0, r1 + movs r1, 0x28 + b _0805A5F6 + .align 2, 0 +_0805A424: .4byte 0x020244ec +_0805A428: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A434 + adds r0, r1 + movs r1, 0x29 + b _0805A5F6 + .align 2, 0 +_0805A434: .4byte 0x020244ec +_0805A438: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A444 + adds r0, r1 + movs r1, 0x2A + b _0805A5F6 + .align 2, 0 +_0805A444: .4byte 0x020244ec +_0805A448: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A454 + adds r0, r1 + movs r1, 0x2B + b _0805A5F6 + .align 2, 0 +_0805A454: .4byte 0x020244ec +_0805A458: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A464 + adds r0, r1 + movs r1, 0x2C + b _0805A5F6 + .align 2, 0 +_0805A464: .4byte 0x020244ec +_0805A468: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A474 + adds r0, r1 + movs r1, 0 + b _0805A492 + .align 2, 0 +_0805A474: .4byte 0x020244ec +_0805A478: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A484 + adds r0, r1 + movs r1, 0x9 + b _0805A536 + .align 2, 0 +_0805A484: .4byte 0x020244ec +_0805A488: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A4B8 + 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 + .align 2, 0 +_0805A4B8: .4byte 0x020244ec +_0805A4BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A4C8 + adds r0, r1 + movs r1, 0x38 + b _0805A5F6 + .align 2, 0 +_0805A4C8: .4byte 0x020244ec +_0805A4CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A4D8 + adds r0, r1 + movs r1, 0x39 + b _0805A536 + .align 2, 0 +_0805A4D8: .4byte 0x020244ec +_0805A4DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A4E8 + adds r0, r1 + movs r1, 0x3A + b _0805A536 + .align 2, 0 +_0805A4E8: .4byte 0x020244ec +_0805A4EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A4F8 + adds r0, r1 + movs r1, 0x3B + b _0805A536 + .align 2, 0 +_0805A4F8: .4byte 0x020244ec +_0805A4FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A508 + adds r0, r1 + movs r1, 0x3C + b _0805A536 + .align 2, 0 +_0805A508: .4byte 0x020244ec +_0805A50C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A518 + adds r0, r1 + movs r1, 0x3D + b _0805A536 + .align 2, 0 +_0805A518: .4byte 0x020244ec +_0805A51C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A528 + adds r0, r1 + movs r1, 0x3E + b _0805A536 + .align 2, 0 +_0805A528: .4byte 0x020244ec +_0805A52C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A548 + 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 + .align 2, 0 +_0805A548: .4byte 0x020244ec +_0805A54C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A558 + adds r0, r1 + movs r1, 0x16 + b _0805A5F6 + .align 2, 0 +_0805A558: .4byte 0x020244ec +_0805A55C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A568 + adds r0, r1 + movs r1, 0x17 + b _0805A5F6 + .align 2, 0 +_0805A568: .4byte 0x020244ec +_0805A56C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A578 + adds r0, r1 + movs r1, 0x18 + b _0805A5F6 + .align 2, 0 +_0805A578: .4byte 0x020244ec +_0805A57C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A588 + adds r0, r1 + movs r1, 0x21 + b _0805A5F6 + .align 2, 0 +_0805A588: .4byte 0x020244ec +_0805A58C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A598 + adds r0, r1 + movs r1, 0x2F + b _0805A5F6 + .align 2, 0 +_0805A598: .4byte 0x020244ec +_0805A59C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A5A8 + adds r0, r1 + movs r1, 0x30 + b _0805A5F6 + .align 2, 0 +_0805A5A8: .4byte 0x020244ec +_0805A5AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A5B8 + adds r0, r1 + movs r1, 0x32 + b _0805A5F6 + .align 2, 0 +_0805A5B8: .4byte 0x020244ec +_0805A5BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A5C8 + adds r0, r1 + movs r1, 0x33 + b _0805A5F6 + .align 2, 0 +_0805A5C8: .4byte 0x020244ec +_0805A5CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A5D8 + adds r0, r1 + movs r1, 0x34 + b _0805A5F6 + .align 2, 0 +_0805A5D8: .4byte 0x020244ec +_0805A5DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A5E8 + adds r0, r1 + movs r1, 0x35 + b _0805A5F6 + .align 2, 0 +_0805A5E8: .4byte 0x020244ec +_0805A5EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A610 + 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 + .align 2, 0 +_0805A610: .4byte 0x020244ec + 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, _0805A68C + ldr r5, _0805A690 + 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, _0805A694 + lsls r1, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + ldr r0, _0805A698 + 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 + .align 2, 0 +_0805A68C: .4byte 0x0202406e +_0805A690: .4byte 0x02024064 +_0805A694: .4byte 0x02023064 +_0805A698: .4byte 0x020244ec + thumb_func_end sub_805A614 + + thumb_func_start dp01t_02_1_setattr +dp01t_02_1_setattr: @ 805A69C + push {r4,r5,lr} + ldr r1, _0805A6C0 + ldr r0, _0805A6C4 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0805A6CC + ldr r0, _0805A6C8 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl dp01_setattr_by_ch1_for_player_pokemon + b _0805A6EA + .align 2, 0 +_0805A6C0: .4byte 0x02023064 +_0805A6C4: .4byte 0x02024064 +_0805A6C8: .4byte 0x0202406e +_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, _0805A72C + ldrb r0, [r0] + lsls r0, 9 + ldr r2, _0805A730 + 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, _0805A734 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805A72C: .4byte 0x02024064 +_0805A730: .4byte 0x02023067 +_0805A734: .4byte _0805A738 + .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, _0805A9BC + 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, _0805A9BC + 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 + .align 2, 0 +_0805A9BC: .4byte 0x020244ec +_0805A9C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A9D8 + adds r0, r1 + ldr r1, _0805A9DC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805A9D8: .4byte 0x020244ec +_0805A9DC: .4byte 0x02024064 +_0805A9E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805A9F8 + adds r0, r1 + ldr r1, _0805A9FC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805A9F8: .4byte 0x020244ec +_0805A9FC: .4byte 0x02024064 +_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, _0805AA54 + 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, _0805AA54 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AA54: .4byte 0x020244ec +_0805AA58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AA74 + adds r0, r1 + ldr r3, _0805AA78 + ldr r1, _0805AA7C + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0805AAFC + .align 2, 0 +_0805AA74: .4byte 0x020244ec +_0805AA78: .4byte 0x02023064 +_0805AA7C: .4byte 0x02024064 +_0805AA80: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0805AADC + adds r4, r0 + ldr r5, _0805AAE0 + 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 + .align 2, 0 +_0805AADC: .4byte 0x020244ec +_0805AAE0: .4byte 0x02024064 +_0805AAE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AB08 + adds r0, r1 + ldr r3, _0805AB0C + ldr r1, _0805AB10 + 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 + .align 2, 0 +_0805AB08: .4byte 0x020244ec +_0805AB0C: .4byte 0x02023064 +_0805AB10: .4byte 0x02024064 +_0805AB14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AB2C + adds r0, r1 + ldr r1, _0805AB30 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AB2C: .4byte 0x020244ec +_0805AB30: .4byte 0x02024064 +_0805AB34: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AB4C + adds r0, r1 + ldr r1, _0805AB50 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AB4C: .4byte 0x020244ec +_0805AB50: .4byte 0x02024064 +_0805AB54: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AB6C + adds r0, r1 + ldr r1, _0805AB70 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AB6C: .4byte 0x020244ec +_0805AB70: .4byte 0x02024064 +_0805AB74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AB8C + adds r0, r1 + ldr r1, _0805AB90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AB8C: .4byte 0x020244ec +_0805AB90: .4byte 0x02024064 +_0805AB94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ABAC + adds r0, r1 + ldr r1, _0805ABB0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ABAC: .4byte 0x020244ec +_0805ABB0: .4byte 0x02024064 +_0805ABB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ABCC + adds r0, r1 + ldr r1, _0805ABD0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ABCC: .4byte 0x020244ec +_0805ABD0: .4byte 0x02024064 +_0805ABD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ABEC + adds r0, r1 + ldr r1, _0805ABF0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ABEC: .4byte 0x020244ec +_0805ABF0: .4byte 0x02024064 +_0805ABF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AC0C + adds r0, r1 + ldr r1, _0805AC10 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AC0C: .4byte 0x020244ec +_0805AC10: .4byte 0x02024064 +_0805AC14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AC2C + adds r0, r1 + ldr r1, _0805AC30 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AC2C: .4byte 0x020244ec +_0805AC30: .4byte 0x02024064 +_0805AC34: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AC4C + adds r0, r1 + ldr r1, _0805AC50 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AC4C: .4byte 0x020244ec +_0805AC50: .4byte 0x02024064 +_0805AC54: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AC6C + adds r0, r1 + ldr r1, _0805AC70 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AC6C: .4byte 0x020244ec +_0805AC70: .4byte 0x02024064 +_0805AC74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AC8C + adds r0, r1 + ldr r1, _0805AC90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AC8C: .4byte 0x020244ec +_0805AC90: .4byte 0x02024064 +_0805AC94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ACAC + adds r0, r1 + ldr r1, _0805ACB0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ACAC: .4byte 0x020244ec +_0805ACB0: .4byte 0x02024064 +_0805ACB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ACCC + adds r0, r1 + ldr r1, _0805ACD0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ACCC: .4byte 0x020244ec +_0805ACD0: .4byte 0x02024064 +_0805ACD4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0805AD3C + adds r4, r0 + ldr r5, _0805AD40 + 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 + .align 2, 0 +_0805AD3C: .4byte 0x020244ec +_0805AD40: .4byte 0x02024064 +_0805AD44: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AD5C + adds r0, r1 + ldr r1, _0805AD60 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AD5C: .4byte 0x020244ec +_0805AD60: .4byte 0x02024064 +_0805AD64: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AD7C + adds r0, r1 + ldr r1, _0805AD80 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AD7C: .4byte 0x020244ec +_0805AD80: .4byte 0x02024064 +_0805AD84: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AD9C + adds r0, r1 + ldr r1, _0805ADA0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AD9C: .4byte 0x020244ec +_0805ADA0: .4byte 0x02024064 +_0805ADA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ADBC + adds r0, r1 + ldr r1, _0805ADC0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ADBC: .4byte 0x020244ec +_0805ADC0: .4byte 0x02024064 +_0805ADC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ADDC + adds r0, r1 + ldr r1, _0805ADE0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ADDC: .4byte 0x020244ec +_0805ADE0: .4byte 0x02024064 +_0805ADE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805ADFC + adds r0, r1 + ldr r1, _0805AE00 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0805ADF4: + movs r1, 0x2C + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805ADFC: .4byte 0x020244ec +_0805AE00: .4byte 0x02024064 +_0805AE04: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AE1C + adds r0, r1 + ldr r1, _0805AE20 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AE1C: .4byte 0x020244ec +_0805AE20: .4byte 0x02024064 +_0805AE24: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AE3C + adds r0, r1 + ldr r1, _0805AE40 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AE3C: .4byte 0x020244ec +_0805AE40: .4byte 0x02024064 +_0805AE44: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AE5C + adds r0, r1 + ldr r1, _0805AE60 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AE5C: .4byte 0x020244ec +_0805AE60: .4byte 0x02024064 +_0805AE64: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AE7C + adds r0, r1 + ldr r1, _0805AE80 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AE7C: .4byte 0x020244ec +_0805AE80: .4byte 0x02024064 +_0805AE84: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AE9C + adds r0, r1 + ldr r1, _0805AEA0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AE9C: .4byte 0x020244ec +_0805AEA0: .4byte 0x02024064 +_0805AEA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AEBC + adds r0, r1 + ldr r1, _0805AEC0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AEBC: .4byte 0x020244ec +_0805AEC0: .4byte 0x02024064 +_0805AEC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AEDC + adds r0, r1 + ldr r1, _0805AEE0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AEDC: .4byte 0x020244ec +_0805AEE0: .4byte 0x02024064 +_0805AEE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AEFC + adds r0, r1 + ldr r1, _0805AF00 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AEFC: .4byte 0x020244ec +_0805AF00: .4byte 0x02024064 +_0805AF04: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AF1C + adds r0, r1 + ldr r1, _0805AF20 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AF1C: .4byte 0x020244ec +_0805AF20: .4byte 0x02024064 +_0805AF24: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AF3C + adds r0, r1 + ldr r1, _0805AF40 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AF3C: .4byte 0x020244ec +_0805AF40: .4byte 0x02024064 +_0805AF44: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AF5C + adds r0, r1 + ldr r1, _0805AF60 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AF5C: .4byte 0x020244ec +_0805AF60: .4byte 0x02024064 +_0805AF64: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AF7C + adds r0, r1 + ldr r1, _0805AF80 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AF7C: .4byte 0x020244ec +_0805AF80: .4byte 0x02024064 +_0805AF84: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AF9C + adds r0, r1 + ldr r1, _0805AFA0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AF9C: .4byte 0x020244ec +_0805AFA0: .4byte 0x02024064 +_0805AFA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AFBC + adds r0, r1 + ldr r1, _0805AFC0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AFBC: .4byte 0x020244ec +_0805AFC0: .4byte 0x02024064 +_0805AFC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AFDC + adds r0, r1 + ldr r1, _0805AFE0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AFDC: .4byte 0x020244ec +_0805AFE0: .4byte 0x02024064 +_0805AFE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805AFFC + adds r0, r1 + ldr r1, _0805B000 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805AFFC: .4byte 0x020244ec +_0805B000: .4byte 0x02024064 +_0805B004: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805B01C + adds r0, r1 + ldr r1, _0805B020 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805B01C: .4byte 0x020244ec +_0805B020: .4byte 0x02024064 +_0805B024: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805B03C + adds r0, r1 + ldr r1, _0805B040 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805B03C: .4byte 0x020244ec +_0805B040: .4byte 0x02024064 +_0805B044: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805B05C + adds r0, r1 + ldr r1, _0805B060 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805B05C: .4byte 0x020244ec +_0805B060: .4byte 0x02024064 +_0805B064: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805B07C + adds r0, r1 + ldr r1, _0805B080 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805B07C: .4byte 0x020244ec +_0805B080: .4byte 0x02024064 +_0805B084: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805B09C + adds r0, r1 + ldr r1, _0805B0A0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0805B0BA + .align 2, 0 +_0805B09C: .4byte 0x020244ec +_0805B0A0: .4byte 0x02024064 +_0805B0A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0805B0E4 + adds r0, r1 + ldr r1, _0805B0E8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0805B0BA: + ldr r2, _0805B0EC + ldr r0, _0805B0E8 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0805B0E4 + 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 + .align 2, 0 +_0805B0E4: .4byte 0x020244ec +_0805B0E8: .4byte 0x02024064 +_0805B0EC: .4byte 0x0202406e + thumb_func_end dp01_setattr_by_ch1_for_player_pokemon + + thumb_func_start sub_805B0F0 +sub_805B0F0: @ 805B0F0 + push {r4-r7,lr} + ldr r1, _0805B154 + ldr r7, _0805B158 + 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, _0805B15C + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _0805B160 + 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 + .align 2, 0 +_0805B154: .4byte 0x0202406e +_0805B158: .4byte 0x02024064 +_0805B15C: .4byte 0x02023064 +_0805B160: .4byte 0x020244ec + thumb_func_end sub_805B0F0 + + thumb_func_start sub_805B164 +sub_805B164: @ 805B164 + push {r4,lr} + ldr r2, _0805B1B0 + ldr r4, _0805B1B4 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0805B1B8 + adds r0, r2 + bl sub_805DD7C + ldr r2, _0805B1BC + ldr r0, _0805B1C0 + 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, _0805B1C4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805B1C8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805B1B0: .4byte 0x0202406e +_0805B1B4: .4byte 0x02024064 +_0805B1B8: .4byte 0x020244ec +_0805B1BC: .4byte 0x02020630 +_0805B1C0: .4byte 0x020241e4 +_0805B1C4: .4byte 0x03005d60 +_0805B1C8: .4byte bx_0802E404 + 1 + thumb_func_end sub_805B164 + + thumb_func_start sub_805B1CC +sub_805B1CC: @ 805B1CC + push {r4-r6,lr} + ldr r5, _0805B238 + ldrb r0, [r5] + ldr r4, _0805B23C + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, _0805B240 + 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, _0805B244 + adds r0, r2 + bl sub_805DD7C + ldr r1, _0805B248 + ldrb r0, [r5] + adds r0, r1 + strb r4, [r0] + ldr r1, _0805B24C + 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, _0805B250 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805B254 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805B238: .4byte 0x02024064 +_0805B23C: .4byte 0x02023064 +_0805B240: .4byte 0x0202406e +_0805B244: .4byte 0x020244ec +_0805B248: .4byte 0x020244ac +_0805B24C: .4byte 0x020244b0 +_0805B250: .4byte 0x03005d60 +_0805B254: .4byte sub_805902C + 1 + 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, _0805B3AC + lsls r2, r6, 1 + adds r2, r0 + ldr r0, _0805B3B0 + 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, _0805B3B4 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0805B3B8 + bl object_new_hidden_with_callback + ldr r1, _0805B3BC + 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, _0805B3C0 + 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 obj_add_from_template_forward_search + ldr r4, _0805B3C4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _0805B3C8 + 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, _0805B3CC + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _0805B3D0 + 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 + .align 2, 0 +_0805B3AC: .4byte 0x0202406e +_0805B3B0: .4byte 0x02023064 +_0805B3B4: .4byte 0x020244ec +_0805B3B8: .4byte sub_805D714 + 1 +_0805B3BC: .4byte 0x03005d7c +_0805B3C0: .4byte 0x0202499c +_0805B3C4: .4byte 0x020241e4 +_0805B3C8: .4byte 0x02020630 +_0805B3CC: .4byte 0x020244e4 +_0805B3D0: .4byte nullsub_12 + 1 + thumb_func_end sub_805B258 + + thumb_func_start sub_805B3D4 +sub_805B3D4: @ 805B3D4 + push {r4-r6,lr} + ldr r1, _0805B408 + ldr r6, _0805B40C + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0805B41C + ldr r0, _0805B410 + 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, _0805B414 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805B418 + str r1, [r0] + b _0805B452 + .align 2, 0 +_0805B408: .4byte 0x02023064 +_0805B40C: .4byte 0x02024064 +_0805B410: .4byte 0x020244d0 +_0805B414: .4byte 0x03005d60 +_0805B418: .4byte sub_805B464 + 1 +_0805B41C: + ldr r5, _0805B458 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0805B45C + 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 obj_delete_and_free_tiles + ldr r1, _0805B460 + 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 + .align 2, 0 +_0805B458: .4byte 0x020241e4 +_0805B45C: .4byte 0x02020630 +_0805B460: .4byte 0x03005d70 + thumb_func_end sub_805B3D4 + + thumb_func_start sub_805B464 +sub_805B464: @ 805B464 + push {r4-r6,lr} + ldr r6, _0805B484 + ldr r4, [r6] + ldr r5, _0805B488 + 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 + .align 2, 0 +_0805B484: .4byte 0x020244d0 +_0805B488: .4byte 0x02024064 +_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, _0805B4E8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805B4EC + str r1, [r0] +_0805B4E2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805B4E8: .4byte 0x03005d60 +_0805B4EC: .4byte sub_8059744 + 1 + 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, _0805B550 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805B5B4 + bl link_get_multiplayer_id + ldr r5, _0805B554 + 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 + .align 2, 0 +_0805B550: .4byte 0x02022fec +_0805B554: .4byte 0x020229e8 +_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, _0805B600 + ldr r0, [r0] + ldrb r4, [r0, 0x8] +_0805B5BA: + ldr r0, _0805B604 + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0805B63C + ldr r0, _0805B608 + 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, _0805B60C + ldrh r1, [r0] + ldr r0, _0805B610 + cmp r1, r0 + beq _0805B618 + movs r0, 0x5A + mov r9, r0 + ldr r1, _0805B614 + b _0805B642 + .align 2, 0 +_0805B600: .4byte 0x03005d90 +_0805B604: .4byte 0x02022fec +_0805B608: .4byte 0x02024064 +_0805B60C: .4byte 0x02038bce +_0805B610: .4byte 0x00000c03 +_0805B614: .4byte 0x083054e0 +_0805B618: + ldr r1, _0805B634 + 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, _0805B638 + b _0805B656 + .align 2, 0 +_0805B634: .4byte 0x08305d2c +_0805B638: .4byte 0x02022fec +_0805B63C: + movs r0, 0x50 + mov r9, r0 + ldr r1, _0805B768 +_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, _0805B76C + ldrh r1, [r0] + ldr r0, _0805B770 + cmp r1, r0 + bne _0805B670 + b _0805B794 +_0805B670: + ldr r0, _0805B774 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r6, _0805B778 + 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, _0805B77C + 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 obj_add_from_template_forward_search + ldr r4, _0805B780 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, _0805B784 + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl gpu_pal_tags_index_of + ldr r5, _0805B788 + 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, _0805B78C + 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, _0805B790 + 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 + .align 2, 0 +_0805B768: .4byte 0x08305d2c +_0805B76C: .4byte 0x02038bce +_0805B770: .4byte 0x00000c03 +_0805B774: .4byte 0x03005d90 +_0805B778: .4byte 0x02024064 +_0805B77C: .4byte 0x0202499c +_0805B780: .4byte 0x020241e4 +_0805B784: .4byte 0x0830593c +_0805B788: .4byte 0x02020630 +_0805B78C: .4byte 0x0000fffe +_0805B790: .4byte sub_805D7AC + 1 +_0805B794: + ldr r5, _0805B844 + 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, _0805B848 + 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 obj_add_from_template_forward_search + ldr r6, _0805B84C + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _0805B850 + 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, _0805B854 + 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, _0805B858 + str r1, [r0] +_0805B82A: + ldr r1, _0805B85C + ldr r0, _0805B844 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805B860 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805B844: .4byte 0x02024064 +_0805B848: .4byte 0x0202499c +_0805B84C: .4byte 0x020241e4 +_0805B850: .4byte 0x02020630 +_0805B854: .4byte 0x0000fffe +_0805B858: .4byte sub_805D7AC + 1 +_0805B85C: .4byte 0x03005d60 +_0805B860: .4byte sub_8058844 + 1 + thumb_func_end sub_805B4F0 + + thumb_func_start dp01t_08_1_8032428 +dp01t_08_1_8032428: @ 805B864 + push {r4-r6,lr} + ldr r0, _0805B8BC + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805B920 + bl link_get_multiplayer_id + ldr r5, _0805B8C0 + 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 + .align 2, 0 +_0805B8BC: .4byte 0x02022fec +_0805B8C0: .4byte 0x020229e8 +_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, _0805B9D0 + ldr r0, [r0] + ldrb r4, [r0, 0x8] +_0805B926: + ldr r5, _0805B9D4 + 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, _0805B9D8 + ldr r1, _0805B9DC + 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 obj_add_from_template_forward_search + ldr r6, _0805B9E0 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _0805B9E4 + 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, _0805B9E8 + 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, _0805B9EC + str r1, [r0] + ldr r1, _0805B9F0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805B9F4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805B9D0: .4byte 0x03005d90 +_0805B9D4: .4byte 0x02024064 +_0805B9D8: .4byte 0x0202499c +_0805B9DC: .4byte 0x08305d2c +_0805B9E0: .4byte 0x020241e4 +_0805B9E4: .4byte 0x02020630 +_0805B9E8: .4byte 0x0000ffa0 +_0805B9EC: .4byte sub_805D7AC + 1 +_0805B9F0: .4byte 0x03005d60 +_0805B9F4: .4byte sub_805887C + 1 + thumb_func_end dp01t_08_1_8032428 + + thumb_func_start sub_805B9F8 +sub_805B9F8: @ 805B9F8 + push {r4-r6,lr} + ldr r5, _0805BA98 + ldr r6, _0805BA9C + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0805BAA0 + 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, _0805BAA4 + 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, _0805BAA8 + 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, _0805BAAC + 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 obj_anim_image_start + ldr r1, _0805BAB0 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805BAB4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805BA98: .4byte 0x020241e4 +_0805BA9C: .4byte 0x02024064 +_0805BAA0: .4byte 0x02020630 +_0805BAA4: .4byte 0x0000ffd8 +_0805BAA8: .4byte sub_80A6EEC + 1 +_0805BAAC: .4byte nullsub_12 + 1 +_0805BAB0: .4byte 0x03005d60 +_0805BAB4: .4byte bx_802F7A0 + 1 + thumb_func_end sub_805B9F8 + + thumb_func_start sub_805BAB8 +sub_805BAB8: @ 805BAB8 + push {r4-r6,lr} + ldr r6, _0805BB04 + ldr r4, [r6] + ldr r5, _0805BB08 + 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 + .align 2, 0 +_0805BB04: .4byte 0x020244d0 +_0805BB08: .4byte 0x02024064 +_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, _0805BB88 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0805BB8C + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, _0805BB90 + ldr r3, _0805BB94 + 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, _0805BB98 + str r1, [r0] + ldr r1, _0805BB9C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805BBA0 + str r1, [r0] +_0805BB82: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805BB88: .4byte 0x0202406e +_0805BB8C: .4byte 0x020244ec +_0805BB90: .4byte 0x02020630 +_0805BB94: .4byte 0x020241e4 +_0805BB98: .4byte sub_8039C00 + 1 +_0805BB9C: .4byte 0x03005d60 +_0805BBA0: .4byte sub_80596A8 + 1 + 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 sub_80A1AD4 + 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, _0805BC04 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, _0805BC08 + movs r0, 0x1 + strb r0, [r1] + ldr r5, _0805BC0C + 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, _0805BC10 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805BC14 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805BC04: .4byte 0x020244d0 +_0805BC08: .4byte 0x020244b9 +_0805BC0C: .4byte 0x02024064 +_0805BC10: .4byte 0x03005d60 +_0805BC14: .4byte bx_wait_t1 + 1 + thumb_func_end sub_805BBC4 + + thumb_func_start sub_805BC18 +sub_805BC18: @ 805BC18 + push {r4,r5,lr} + ldr r1, _0805BC60 + ldr r5, _0805BC64 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, _0805BC68 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, _0805BC6C + 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, _0805BC70 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805BC74 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805BC60: .4byte 0x02023064 +_0805BC64: .4byte 0x02024064 +_0805BC68: .4byte 0x020244d0 +_0805BC6C: .4byte 0x020244b9 +_0805BC70: .4byte 0x03005d60 +_0805BC74: .4byte bx_wait_t1 + 1 + thumb_func_end sub_805BC18 + + thumb_func_start sub_805BC78 +sub_805BC78: @ 805BC78 + push {lr} + ldr r1, _0805BCA0 + ldr r0, _0805BCA4 + 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 + .align 2, 0 +_0805BCA0: .4byte 0x02023064 +_0805BCA4: .4byte 0x02024064 + 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, _0805BD98 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0805BCBE + b _0805BDE4 +_0805BCBE: + ldr r0, _0805BD9C + 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, _0805BDA0 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, _0805BDA4 + 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, _0805BDA8 + 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, _0805BDAC + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, _0805BDB0 + 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, _0805BDB4 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, _0805BDB8 + 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 + .align 2, 0 +_0805BD98: .4byte 0x02024064 +_0805BD9C: .4byte 0x02023064 +_0805BDA0: .4byte 0x02038432 +_0805BDA4: .4byte 0x02038408 +_0805BDA8: .4byte 0x02038404 +_0805BDAC: .4byte 0x0203841a +_0805BDB0: .4byte 0x0203841c +_0805BDB4: .4byte 0x02038400 +_0805BDB8: .4byte 0x020244bc +_0805BDBC: + ldr r0, _0805BDF0 + 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, _0805BDF4 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805BDF8 + 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 + .align 2, 0 +_0805BDF0: .4byte 0x020244d0 +_0805BDF4: .4byte 0x03005d60 +_0805BDF8: .4byte bx_move_anim_1 + 1 + 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, _0805BE48 + ldr r6, _0805BE4C + 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, _0805BE50 + 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 + .align 2, 0 +_0805BE48: .4byte 0x02023064 +_0805BE4C: .4byte 0x02024064 +_0805BE50: .4byte 0x020244d0 +_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, _0805BF24 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0805BF28 + 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, _0805BF2C + ldr r2, [r0] + ldr r0, _0805BF30 + 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 + .align 2, 0 +_0805BF24: .4byte 0x020383f8 +_0805BF28: .4byte 0x020383fd +_0805BF2C: .4byte 0x020244d0 +_0805BF30: .4byte 0x02024064 +_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, _0805BFC4 + movs r1, 0 + strh r1, [r0] + ldr r0, _0805BFC8 + strh r1, [r0] + ldr r5, _0805BFCC + ldrb r4, [r5] + lsls r4, 9 + ldr r0, _0805BFD0 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, _0805BFD4 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0805BFD8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805BFDC + 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 + .align 2, 0 +_0805BFC4: .4byte 0x02022e14 +_0805BFC8: .4byte 0x02022e16 +_0805BFCC: .4byte 0x02024064 +_0805BFD0: .4byte 0x02023066 +_0805BFD4: .4byte 0x02022e2c +_0805BFD8: .4byte 0x03005d60 +_0805BFDC: .4byte sub_80597B4 + 1 + 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, _0805BFF8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805BFFC + bl sub_805BF80 + b _0805C000 + .align 2, 0 +_0805BFF8: .4byte 0x02024064 +_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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805C02A + ldr r0, _0805C030 + strh r1, [r0] + ldr r1, _0805C034 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _0805C038 + ldr r0, _0805C03C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C040 + str r1, [r0] +_0805C02A: + pop {r0} + bx r0 + .align 2, 0 +_0805C030: .4byte 0x02022e14 +_0805C034: .4byte 0x02022e16 +_0805C038: .4byte 0x03005d60 +_0805C03C: .4byte 0x02024064 +_0805C040: .4byte sub_8057588 + 1 + thumb_func_end sub_805C004 + + thumb_func_start dp01t_12_6_battle_menu +dp01t_12_6_battle_menu: @ 805C044 + push {r4,lr} + ldr r1, _0805C094 + ldr r0, _0805C098 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C09C + str r1, [r0] + bl sub_817F2A8 + ldr r0, _0805C0A0 + 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, _0805C0A4 + ldr r0, _0805C098 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, _0805C0A8 + bl sub_814E6F0 + ldr r0, _0805C0AC + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805C094: .4byte 0x03005d60 +_0805C098: .4byte 0x02024064 +_0805C09C: .4byte sub_805C004 + 1 +_0805C0A0: .4byte 0x085cca3a +_0805C0A4: .4byte 0x020244ac +_0805C0A8: .4byte 0x085cc9f3 +_0805C0AC: .4byte 0x02022e2c + thumb_func_end dp01t_12_6_battle_menu + + thumb_func_start sub_805C0B0 +sub_805C0B0: @ 805C0B0 + push {r4,lr} + sub sp, 0x4 + ldr r4, _0805C0F4 + 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, _0805C0F8 + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, _0805C0FC + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl sub_8056B74 + ldr r1, _0805C100 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C104 + str r1, [r0] + b _0805C10C + .align 2, 0 +_0805C0F4: .4byte 0x02024064 +_0805C0F8: .4byte 0x085ccabb +_0805C0FC: .4byte 0x03005d74 +_0805C100: .4byte 0x03005d60 +_0805C104: .4byte sub_80599D4 + 1 +_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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805C13E + ldr r0, _0805C144 + strh r1, [r0] + ldr r1, _0805C148 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _0805C14C + ldr r0, _0805C150 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C154 + str r1, [r0] +_0805C13E: + pop {r0} + bx r0 + .align 2, 0 +_0805C144: .4byte 0x02022e14 +_0805C148: .4byte 0x02022e16 +_0805C14C: .4byte 0x03005d60 +_0805C150: .4byte 0x02024064 +_0805C154: .4byte sub_8057BFC + 1 + thumb_func_end sub_805C114 + + thumb_func_start sub_805C158 +sub_805C158: @ 805C158 + push {lr} + ldr r0, _0805C198 + ldrb r1, [r0] + ldr r0, _0805C19C + 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, _0805C1A0 + ldr r0, _0805C1A4 + 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 + .align 2, 0 +_0805C198: .4byte 0x02024064 +_0805C19C: .4byte 0x0202449c +_0805C1A0: .4byte 0x0203bd30 +_0805C1A4: .4byte 0x03005d80 + 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, _0805C1D8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0805C1EC + ldr r2, _0805C1DC + ldrb r0, [r2] + ldr r1, _0805C1E0 + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + ldr r1, _0805C1E4 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C1E8 + b _0805C1FC + .align 2, 0 +_0805C1D8: .4byte 0x02022fec +_0805C1DC: .4byte 0x02024064 +_0805C1E0: .4byte 0x0202449c +_0805C1E4: .4byte 0x03005d60 +_0805C1E8: .4byte sub_805C158 + 1 +_0805C1EC: + bl sub_805C210 + ldr r1, _0805C204 + ldr r0, _0805C208 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C20C +_0805C1FC: + str r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_0805C204: .4byte 0x03005d60 +_0805C208: .4byte 0x02024064 +_0805C20C: .4byte sub_805C114 + 1 + thumb_func_end dp01t_14_5_move_menu_pokedude + + thumb_func_start sub_805C210 +sub_805C210: @ 805C210 + push {lr} + bl sub_8059AAC + ldr r1, _0805C23C + movs r0, 0xFF + strb r0, [r1] + ldr r1, _0805C240 + ldr r0, _0805C244 + 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 + .align 2, 0 +_0805C23C: .4byte 0x03005d74 +_0805C240: .4byte 0x020244b0 +_0805C244: .4byte 0x02024064 + 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 sub_80A1AD4 + ldr r1, _0805C294 + ldr r2, _0805C298 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C29C + str r1, [r0] + ldr r1, _0805C2A0 + ldrb r0, [r2] + strb r0, [r1] + movs r3, 0 + ldr r5, _0805C2A4 + ldr r4, _0805C2A8 +_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 + .align 2, 0 +_0805C294: .4byte 0x03005d60 +_0805C298: .4byte 0x02024064 +_0805C29C: .4byte sub_80598A4 + 1 +_0805C2A0: .4byte 0x020244b8 +_0805C2A4: .4byte 0x0203cf00 +_0805C2A8: .4byte 0x02023064 + 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, _0805C31C + mov r12, r0 + ldr r1, _0805C320 + mov r8, r1 + ldr r2, _0805C324 + ldr r7, _0805C328 + 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, _0805C32C + 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 + .align 2, 0 +_0805C31C: .4byte 0x0203cf00 +_0805C320: .4byte 0x02023064 +_0805C324: .4byte 0x02024064 +_0805C328: .4byte 0x02022fec +_0805C32C: .4byte 0x0202406e +_0805C330: + ldr r0, _0805C3C8 + movs r1, 0xFF + bl AddTask + ldr r3, _0805C3CC + ldr r4, _0805C3D0 + ldrb r1, [r4] + adds r1, r3 + movs r2, 0 + mov r8, r2 + strb r0, [r1] + ldr r5, _0805C3D4 + 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, _0805C3D8 + 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, _0805C3DC + 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 sub_80A1AD4 + ldr r1, _0805C3E0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C3E4 + str r1, [r0] + ldr r1, _0805C3E8 + ldrb r0, [r4] + strb r0, [r1] +_0805C3BC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805C3C8: .4byte nullsub_4 + 1 +_0805C3CC: .4byte 0x03005d7c +_0805C3D0: .4byte 0x02024064 +_0805C3D4: .4byte 0x03005e00 +_0805C3D8: .4byte 0x02023064 +_0805C3DC: .4byte 0x0202449c +_0805C3E0: .4byte 0x03005d60 +_0805C3E4: .4byte sub_80597CC + 1 +_0805C3E8: .4byte 0x020244b8 + 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 sub_80A1AD4 + 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, _0805C498 + ldr r0, _0805C49C + 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, _0805C4A0 + ldr r0, [r1] + adds r0, r7 + str r0, [r1] +_0805C44A: + ldr r0, _0805C4A4 + cmp r7, r0 + beq _0805C4B4 + ldr r6, _0805C4A8 + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0805C4AC + 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, _0805C4B0 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0805C4F2 + .align 2, 0 +_0805C498: .4byte 0x02023064 +_0805C49C: .4byte 0x02024064 +_0805C4A0: .4byte 0x0203cd70 +_0805C4A4: .4byte 0x00007fff +_0805C4A8: .4byte 0x0202406e +_0805C4AC: .4byte 0x020244ec +_0805C4B0: .4byte 0x03005d70 +_0805C4B4: + ldr r1, _0805C510 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805C514 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, _0805C518 + 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, _0805C51C + ldr r0, _0805C520 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C524 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805C510: .4byte 0x0202406e +_0805C514: .4byte 0x020244ec +_0805C518: .4byte 0x03005d70 +_0805C51C: .4byte 0x03005d60 +_0805C520: .4byte 0x02024064 +_0805C524: .4byte bx_t1_healthbar_update + 1 + thumb_func_end sub_805C410 + + thumb_func_start sub_805C528 +sub_805C528: @ 805C528 + push {r4-r7,lr} + ldr r5, _0805C554 + ldr r6, _0805C558 + 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, _0805C55C + 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 + .align 2, 0 +_0805C554: .4byte 0x02023064 +_0805C558: .4byte 0x02024064 +_0805C55C: .4byte 0x020244ec +_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, _0805C5B4 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0805C5B8 + 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, _0805C5BC + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C5C0 + str r1, [r0] +_0805C5AC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805C5B4: .4byte sub_80591B8 + 1 +_0805C5B8: .4byte 0x03005e00 +_0805C5BC: .4byte 0x03005d60 +_0805C5C0: .4byte nullsub_21 + 1 + thumb_func_end sub_805C528 + + thumb_func_start sub_805C5C4 +sub_805C5C4: @ 805C5C4 + push {r4,lr} + ldr r4, _0805C620 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805C618 + ldr r0, _0805C624 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _0805C628 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0805C62C + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _0805C630 + 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, _0805C634 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C638 + str r1, [r0] +_0805C618: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805C620: .4byte 0x02024064 +_0805C624: .4byte 0x03005d70 +_0805C628: .4byte 0x0202406e +_0805C62C: .4byte 0x020244ec +_0805C630: .4byte 0x020244d0 +_0805C634: .4byte 0x03005d60 +_0805C638: .4byte sub_8059D60 + 1 + thumb_func_end sub_805C5C4 + + thumb_func_start sub_805C63C +sub_805C63C: @ 805C63C + push {r4,r5,lr} + ldr r5, _0805C694 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805C68C + ldr r4, _0805C698 + 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, _0805C69C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C6A0 + str r1, [r0] +_0805C68C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805C694: .4byte 0x02024064 +_0805C698: .4byte 0x02023064 +_0805C69C: .4byte 0x03005d60 +_0805C6A0: .4byte sub_8059D60 + 1 + 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, _0805C700 + mov r8, r0 + ldr r4, _0805C704 + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0805C708 + adds r0, r5 + movs r1, 0x37 + bl pokemon_getattr + ldr r2, _0805C70C + 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 + .align 2, 0 +_0805C700: .4byte 0x0202406e +_0805C704: .4byte 0x02024064 +_0805C708: .4byte 0x020244ec +_0805C70C: .4byte 0x02023064 + 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, _0805C780 + ldr r0, _0805C784 + 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, _0805C788 + 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 + .align 2, 0 +_0805C780: .4byte 0x02023064 +_0805C784: .4byte 0x02024064 +_0805C788: .4byte 0x040000d4 +_0805C78C: + ldr r3, _0805C7C4 + str r2, [r3] + str r5, [r3, 0x4] + ldr r0, _0805C7C8 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + movs r0, 0x80 + lsls r0, 5 + adds r2, r0 + adds r5, r0 + ldr r1, _0805C7CC + 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 + .align 2, 0 +_0805C7C4: .4byte 0x040000d4 +_0805C7C8: .4byte 0x80000800 +_0805C7CC: .4byte 0xfffff000 + thumb_func_end sub_805C71C + + thumb_func_start sub_805C7D0 +sub_805C7D0: @ 805C7D0 + push {lr} + ldr r2, _0805C7F8 + ldr r0, _0805C7FC + 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 + .align 2, 0 +_0805C7F8: .4byte 0x02023064 +_0805C7FC: .4byte 0x02024064 + 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, _0805C874 + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0805C874: .4byte 0x02022d0c + thumb_func_end sub_805C85C + + thumb_func_start sub_805C878 +sub_805C878: @ 805C878 + push {lr} + ldr r3, _0805C8A4 + ldr r1, _0805C8A8 + ldr r0, _0805C8AC + 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 + .align 2, 0 +_0805C8A4: .4byte 0x02022d0c +_0805C8A8: .4byte 0x02023064 +_0805C8AC: .4byte 0x02024064 + thumb_func_end sub_805C878 + + thumb_func_start sub_805C8B0 +sub_805C8B0: @ 805C8B0 + push {lr} + ldr r2, _0805C8C4 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0805C8C4: .4byte 0x02022d0c + thumb_func_end sub_805C8B0 + + thumb_func_start sub_805C8C8 +sub_805C8C8: @ 805C8C8 + push {lr} + ldr r3, _0805C8EC + 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 + .align 2, 0 +_0805C8EC: .4byte 0x02022d0c + thumb_func_end sub_805C8C8 + + thumb_func_start dp01t_29_1_blink +dp01t_29_1_blink: @ 805C8F0 + push {r4,lr} + ldr r3, _0805C918 + ldr r2, _0805C91C + ldr r4, _0805C920 + 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 + .align 2, 0 +_0805C918: .4byte 0x02020630 +_0805C91C: .4byte 0x020241e4 +_0805C920: .4byte 0x02024064 +_0805C924: + ldr r1, _0805C954 + 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, _0805C958 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805C95C + str r1, [r0] +_0805C94E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805C954: .4byte 0x020244b9 +_0805C958: .4byte 0x03005d60 +_0805C95C: .4byte bx_blink_t1 + 1 + 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, _0805C9A8 + 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, _0805C9AC + 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 + .align 2, 0 +_0805C9A8: .4byte 0x02024064 +_0805C9AC: .4byte 0x02023064 + thumb_func_end sub_805C96C + + thumb_func_start sub_805C9B0 +sub_805C9B0: @ 805C9B0 + push {r4,r5,lr} + ldr r4, _0805C9E4 + ldr r5, _0805C9E8 + 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 + .align 2, 0 +_0805C9E4: .4byte 0x02023064 +_0805C9E8: .4byte 0x02024064 +_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, _0805CA40 + ldr r0, _0805CA44 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805CA48 + 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 + .align 2, 0 +_0805CA40: .4byte 0x0202406e +_0805CA44: .4byte 0x02024064 +_0805CA48: .4byte 0x020244ec + thumb_func_end sub_805CA0C + + thumb_func_start dp01t_2E_1_battle_intro +dp01t_2E_1_battle_intro: @ 805CA4C + push {lr} + ldr r1, _0805CA74 + ldr r0, _0805CA78 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _0805CA7C + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0805CA74: .4byte 0x02023064 +_0805CA78: .4byte 0x02024064 +_0805CA7C: .4byte 0x020243fc + 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, _0805CBC0 + ldr r7, _0805CBC4 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0805CBC8 + 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, _0805CBCC + 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, _0805CBD0 + 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, _0805CBD4 + 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 obj_anim_image_start + ldr r0, _0805CBD8 + bl gpu_pal_alloc_new + adds r4, r0, 0 + lsls r4, 24 + ldr r1, _0805CBDC + ldr r0, _0805CBE0 + 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, _0805CBE4 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0805CBE8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r7] + strh r0, [r1, 0x8] + ldr r3, _0805CBEC + 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, _0805CBF0 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _0805CBF4 + 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, _0805CBF8 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805CBFC + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805CBC0: .4byte 0x020241e4 +_0805CBC4: .4byte 0x02024064 +_0805CBC8: .4byte 0x02020630 +_0805CBCC: .4byte 0x0000ffd8 +_0805CBD0: .4byte sub_80A6EEC + 1 +_0805CBD4: .4byte sub_805CC00 + 1 +_0805CBD8: .4byte 0x0000d6f8 +_0805CBDC: .4byte 0x08305d8c +_0805CBE0: .4byte 0x03005d90 +_0805CBE4: .4byte task05_08033660 + 1 +_0805CBE8: .4byte 0x03005e00 +_0805CBEC: .4byte 0x020244d0 +_0805CBF0: .4byte 0x020244b4 +_0805CBF4: .4byte sub_8073C30 + 1 +_0805CBF8: .4byte 0x03005d60 +_0805CBFC: .4byte nullsub_21 + 1 + 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 gpu_pal_tag_by_index + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_free_tag + adds r0, r5, 0 + bl obj_delete_and_free_tiles + ldr r1, _0805CC58 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805CC5C + adds r0, r1 + adds r1, r4, 0 + bl sub_805DD7C + ldr r0, _0805CC60 + adds r4, r0 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0805CC64 + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805CC58: .4byte 0x0202406e +_0805CC5C: .4byte 0x020244ec +_0805CC60: .4byte 0x020241e4 +_0805CC64: .4byte 0x02020630 + 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, _0805CC90 + 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 + .align 2, 0 +_0805CC90: .4byte 0x03005e00 +_0805CC94: + ldr r7, _0805CCD4 + 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, _0805CCD8 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805CCE4 +_0805CCB4: + ldr r0, _0805CCDC + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _0805CCE0 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + b _0805CD38 + .align 2, 0 +_0805CCD4: .4byte 0x02024064 +_0805CCD8: .4byte 0x02022fec +_0805CCDC: .4byte 0x02023064 +_0805CCE0: .4byte 0x0202406e +_0805CCE4: + ldr r4, _0805CD5C + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, _0805CD60 + 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, _0805CD64 + 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, _0805CD68 + ldr r2, _0805CD6C + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805CD70 + 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 + .align 2, 0 +_0805CD5C: .4byte 0x02023064 +_0805CD60: .4byte 0x0202406e +_0805CD64: .4byte 0x020244ec +_0805CD68: .4byte 0x03005d60 +_0805CD6C: .4byte 0x02024064 +_0805CD70: .4byte sub_8058B40 + 1 + thumb_func_end task05_08033660 + + thumb_func_start sub_805CD74 +sub_805CD74: @ 805CD74 + push {r4-r6,lr} + ldr r1, _0805CD9C + ldr r0, _0805CDA0 + 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 + .align 2, 0 +_0805CD9C: .4byte 0x02023064 +_0805CDA0: .4byte 0x02024064 +_0805CDA4: + ldr r6, _0805CE20 + ldr r0, [r6] + ldr r5, _0805CE24 + 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, _0805CE28 + 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, _0805CE2C + 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, _0805CE30 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _0805CE34 + str r0, [r1] +_0805CE18: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805CE20: .4byte 0x020244d0 +_0805CE24: .4byte 0x02024064 +_0805CE28: .4byte 0x02023068 +_0805CE2C: .4byte 0x020244b4 +_0805CE30: .4byte 0x03005d60 +_0805CE34: .4byte sub_805CE38 + 1 + thumb_func_end sub_805CD74 + + thumb_func_start sub_805CE38 +sub_805CE38: @ 805CE38 + push {r4,lr} + ldr r4, _0805CE78 + ldr r0, [r4] + ldr r3, _0805CE7C + 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 + .align 2, 0 +_0805CE78: .4byte 0x020244d0 +_0805CE7C: .4byte 0x02024064 + thumb_func_end sub_805CE38 + + thumb_func_start sub_805CE80 +sub_805CE80: @ 805CE80 + push {lr} + ldr r0, _0805CEBC + ldr r1, [r0] + ldr r0, _0805CEC0 + 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, _0805CEC4 + ldr r0, _0805CEC8 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _0805CECC + str r1, [r0] +_0805CEB2: + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0805CEBC: .4byte 0x020244d0 +_0805CEC0: .4byte 0x02024064 +_0805CEC4: .4byte 0x03005e00 +_0805CEC8: .4byte 0x020244b4 +_0805CECC: .4byte sub_8073C30 + 1 + thumb_func_end sub_805CE80 + + thumb_func_start sub_805CED0 +sub_805CED0: @ 805CED0 + push {r4,lr} + ldr r4, _0805CEF0 + 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 + .align 2, 0 +_0805CEF0: .4byte 0x02024064 + thumb_func_end sub_805CED0 + + thumb_func_start dp01t_33_1_enemy_move +dp01t_33_1_enemy_move: @ 805CEF4 + push {r4,lr} + ldr r4, _0805CF44 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0805CF3A + ldr r3, _0805CF48 + ldr r0, _0805CF4C + 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, _0805CF50 + 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 + .align 2, 0 +_0805CF44: .4byte 0x02024064 +_0805CF48: .4byte 0x02020630 +_0805CF4C: .4byte 0x020241e4 +_0805CF50: .4byte 0x02023064 + 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, _0805CF9C + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805CFB6 + ldr r4, _0805CFA0 + 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 + .align 2, 0 +_0805CF9C: .4byte 0x02024064 +_0805CFA0: .4byte 0x02023064 +_0805CFA4: + ldr r0, _0805CFC0 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _0805CFC4 + str r0, [r1] +_0805CFB0: + adds r0, r6, 0 + bl sub_817E32C +_0805CFB6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805CFC0: .4byte 0x03005d60 +_0805CFC4: .4byte bx_8030B2C + 1 + 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, _0805CFF0 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, _0805CFF4 + 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 + .align 2, 0 +_0805CFF0: .4byte 0x02024064 +_0805CFF4: .4byte 0x02023066 +_0805CFF8: + cmp r0, 0x2 + beq _0805D01C + b _0805D020 +_0805CFFE: + bl b_link_standby_message +_0805D002: + ldr r4, _0805D018 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + b _0805D020 + .align 2, 0 +_0805D018: .4byte 0x02024064 +_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, _0805D04C + ldr r4, _0805D050 + 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 + .align 2, 0 +_0805D04C: .4byte 0x02023064 +_0805D050: .4byte 0x02024064 +_0805D054: + cmp r2, 0x2 + beq _0805D07C + b _0805D084 +_0805D05A: + ldr r0, _0805D06C + adds r0, r3, r0 + strb r2, [r0] + ldr r1, _0805D070 + ldrb r0, [r4] + adds r0, r1 + strb r2, [r0] + b _0805D084 + .align 2, 0 +_0805D06C: .4byte 0x020244ac +_0805D070: .4byte 0x020244b0 +_0805D074: + ldr r0, _0805D078 + b _0805D07E + .align 2, 0 +_0805D078: .4byte 0x020244ac +_0805D07C: + ldr r0, _0805D090 +_0805D07E: + adds r0, r3, r0 + movs r1, 0 + strb r1, [r0] +_0805D084: + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805D090: .4byte 0x020244b0 + thumb_func_end sub_805D02C + + thumb_func_start sub_805D094 +sub_805D094: @ 805D094 + push {r4,r5,lr} + ldr r5, _0805D0F8 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, _0805D0FC + adds r0, r4 + bl sub_81851A8 + ldr r2, _0805D100 + ldrb r0, [r5] + lsls r0, 9 + subs r1, r4, 0x3 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, _0805D104 + ldr r3, [r0] + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x2 + adds r0, r4 + ldrb r0, [r0] + ldr r1, _0805D108 + 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, _0805D10C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805D110 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805D0F8: .4byte 0x02024064 +_0805D0FC: .4byte 0x02023068 +_0805D100: .4byte 0x0202433a +_0805D104: .4byte 0x03005d90 +_0805D108: .4byte 0x00000ca9 +_0805D10C: .4byte 0x03005d60 +_0805D110: .4byte sub_80587B0 + 1 + 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, _0805D154 + movs r0, 0x10 + bl malloc_and_clear + str r0, [r4] + movs r0, 0x10 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1] + movs r0, 0x30 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x10 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x8] + movs r0, 0x50 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805D154: .4byte 0x020244d0 + thumb_func_end dp11_init + + thumb_func_start dp11_free +dp11_free: @ 805D158 + push {r4,r5,lr} + ldr r5, _0805D198 + 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 + .align 2, 0 +_0805D198: .4byte 0x020244d0 + 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, _0805D1FC + ldrb r0, [r4] + lsls r2, r0, 9 + ldr r1, _0805D200 + 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, _0805D204 + ldr r0, [r0] + adds r0, 0x92 + ldrb r1, [r0] + ldr r2, _0805D208 + 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 + .align 2, 0 +_0805D1FC: .4byte 0x02024064 +_0805D200: .4byte 0x02023068 +_0805D204: .4byte 0x0202449c +_0805D208: .4byte 0x0832a328 +_0805D20C: + adds r4, 0x1 +_0805D20E: + cmp r4, r5 + bge _0805D234 + ldr r0, _0805D370 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, _0805D374 + adds r0, r1 + ldr r0, [r0] + bl getNature + lsls r0, 24 + lsrs r0, 22 + adds r0, r4, r0 + ldr r2, _0805D378 + 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, _0805D37C + 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, _0805D380 + 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, _0805D37C + 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, _0805D37C + 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, _0805D384 + cmp r0, r2 + ble _0805D33E + adds r6, 0x1 +_0805D33E: + cmp r6, 0x1 + bgt _0805D346 + cmp r6, 0 + bne _0805D388 +_0805D346: + ldr r5, _0805D37C +_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 + .align 2, 0 +_0805D370: .4byte 0x02024064 +_0805D374: .4byte 0x020240cc +_0805D378: .4byte 0x0831c494 +_0805D37C: .4byte 0x0832a328 +_0805D380: .4byte 0x0202449c +_0805D384: .4byte 0x000001ff +_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, _0805D400 + 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, _0805D404 + ldr r0, _0805D408 + 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 + .align 2, 0 +_0805D400: .4byte 0x0832a328 +_0805D404: .4byte 0x0202433c +_0805D408: .4byte 0x02024064 +_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, _0805D454 + 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, _0805D458 + ldrb r0, [r0] + lsls r0, 8 + b _0805D48A + .align 2, 0 +_0805D454: .4byte 0x0831c898 +_0805D458: .4byte 0x02024064 +_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, _0805D4A4 + 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 + .align 2, 0 +_0805D4A4: .4byte 0x02024064 + thumb_func_end sub_805D19C + + thumb_func_start sub_805D4A8 +sub_805D4A8: @ 805D4A8 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _0805D4CC + 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, _0805D4D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805D4CC: .4byte 0x0831c898 +_0805D4D0: .4byte _0805D4D4 + .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, _0805D628 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805D6FA + ldr r0, _0805D62C + 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 + .align 2, 0 +_0805D628: .4byte 0x02022fec +_0805D62C: .4byte 0x02024064 +_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, _0805D678 + 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, _0805D67C + 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 + .align 2, 0 +_0805D678: .4byte 0x02024084 +_0805D67C: .4byte 0x02024064 +_0805D680: + ldr r4, _0805D6AC + ldr r0, _0805D6B0 + mov r9, r0 + ldrb r0, [r0] + muls r0, r2 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + bl getNature + 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 + .align 2, 0 +_0805D6AC: .4byte 0x0831c604 +_0805D6B0: .4byte 0x02024064 +_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, _0805D710 + 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 + .align 2, 0 +_0805D710: .4byte 0x02024064 + 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, _0805D758 + 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 + .align 2, 0 +_0805D758: .4byte 0x02020630 +_0805D75C: + lsls r0, r3, 27 + cmp r0, 0 + bge _0805D766 + ldr r0, _0805D76C + str r0, [r4, 0x1C] +_0805D766: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805D76C: .4byte nullsub_12 + 1 + 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, _0805D794 + str r0, [r4, 0x1C] + cmp r1, 0 + bne _0805D798 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + b _0805D7A0 + .align 2, 0 +_0805D794: .4byte nullsub_12 + 1 +_0805D798: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_0805D7A0: + adds r0, r4, 0 + bl obj_anim_step + 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, _0805D7D8 + 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, _0805D7DC + b _0805D7E2 + .align 2, 0 +_0805D7D8: .4byte 0x020243fc +_0805D7DC: .4byte sub_805D7EC + 1 +_0805D7E0: + ldr r0, _0805D7E8 +_0805D7E2: + str r0, [r2, 0x1C] +_0805D7E4: + pop {r0} + bx r0 + .align 2, 0 +_0805D7E8: .4byte nullsub_12 + 1 + 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, _0805D804 + str r0, [r1, 0x1C] +_0805D800: + pop {r0} + bx r0 + .align 2, 0 +_0805D804: .4byte nullsub_12 + 1 + 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, _0805D83C + ldr r1, [r6] + ldr r5, _0805D840 + 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 + .align 2, 0 +_0805D83C: .4byte 0x020244d0 +_0805D840: .4byte 0x02024064 +_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, _0805D94C + adds r0, r6, r0 + movs r2, 0x7F + adds r1, r7, 0 + ands r1, r2 + strb r1, [r0] + movs r0, 0x1 + b _0805DA1E + .align 2, 0 +_0805D94C: .4byte 0x020244e4 +_0805D950: + ldr r0, _0805D97C + 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 + .align 2, 0 +_0805D97C: .4byte 0x020244d0 +_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, _0805D9C4 + ldr r0, _0805D9C8 + 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 + .align 2, 0 +_0805D9C4: .4byte 0x02020630 +_0805D9C8: .4byte 0x020241e4 +_0805D9CC: + ldr r0, _0805DA30 + mov r2, r10 + strb r2, [r0] + ldr r0, _0805DA34 + mov r1, sp + ldrb r1, [r1] + strb r1, [r0] + ldr r4, _0805DA38 + ldr r0, [r4] + ldr r0, [r0, 0x8] + strh r7, [r0] + ldr r0, _0805DA3C + adds r1, r5, 0 + movs r2, 0 + bl move_something + ldr r0, _0805DA40 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0805DA44 + 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 + .align 2, 0 +_0805DA30: .4byte 0x02038436 +_0805DA34: .4byte 0x02038437 +_0805DA38: .4byte 0x020244d0 +_0805DA3C: .4byte 0x082c9320 +_0805DA40: .4byte task0A_0803415C + 1 +_0805DA44: .4byte 0x03005e00 + 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, _0805DA90 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0805DA94 + ldrb r0, [r0] + cmp r0, 0 + bne _0805DA8A + ldr r0, _0805DA98 + ldr r2, [r0] + ldr r1, _0805DA9C + 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 + .align 2, 0 +_0805DA90: .4byte 0x020383f8 +_0805DA94: .4byte 0x020383fd +_0805DA98: .4byte 0x020244d0 +_0805DA9C: .4byte 0x03005e00 + 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, _0805DB1C + strb r1, [r0] + ldr r0, _0805DB20 + strb r2, [r0] + ldr r0, _0805DB24 + adds r1, r3, 0 + movs r2, 0 + bl move_something + ldr r0, _0805DB28 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0805DB2C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r0, _0805DB30 + 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 + .align 2, 0 +_0805DB1C: .4byte 0x02038436 +_0805DB20: .4byte 0x02038437 +_0805DB24: .4byte 0x082c937c +_0805DB28: .4byte task0A_08034248 + 1 +_0805DB2C: .4byte 0x03005e00 +_0805DB30: .4byte 0x020244d0 + 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, _0805DB7C + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0805DB80 + ldrb r0, [r0] + cmp r0, 0 + bne _0805DB76 + ldr r0, _0805DB84 + ldr r2, [r0] + ldr r1, _0805DB88 + 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 + .align 2, 0 +_0805DB7C: .4byte 0x020383f8 +_0805DB80: .4byte 0x020383fd +_0805DB84: .4byte 0x020244d0 +_0805DB88: .4byte 0x03005e00 + 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, _0805DBE0 + 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, _0805DBE4 + 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, _0805DBE8 + bl MPlayStop_rev01 + ldr r0, _0805DBEC + bl MPlayStop_rev01 +_0805DBD8: + cmp r5, 0 + beq _0805DBF0 +_0805DBDC: + movs r0, 0x1 + b _0805DC02 + .align 2, 0 +_0805DBE0: .4byte 0x020244d0 +_0805DBE4: .4byte 0x02024064 +_0805DBE8: .4byte 0x030075f0 +_0805DBEC: .4byte 0x03007630 +_0805DBF0: + ldr r0, _0805DC08 + 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 + .align 2, 0 +_0805DC08: .4byte 0x020244d0 + 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, _0805DC4C + 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 + .align 2, 0 +_0805DC4C: .4byte 0x020244d0 +_0805DC50: + ldrh r5, [r2, 0x2] + ldr r0, _0805DCAC + 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, _0805DCB0 + adds r2, r1 + ldr r1, _0805DCB4 + 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 sub_8034B50 + mov r3, r8 + lsls r2, r3, 4 + movs r0, 0x80 + lsls r0, 1 + adds r7, r2, r0 + ldr r0, _0805DCB8 + 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 + .align 2, 0 +_0805DCAC: .4byte 0x020244bc +_0805DCB0: .4byte 0x0830a18c +_0805DCB4: .4byte 0x020244d4 +_0805DCB8: .4byte 0x020244d0 +_0805DCBC: + adds r0, r5, 0 + mov r1, r10 + ldr r2, [sp] + bl species_and_otid_get_pal +_0805DCC6: + adds r6, r0, 0 + ldr r4, _0805DD58 + adds r0, r6, 0 + adds r1, r4, 0 + bl call_LZZUnCompWram + 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, _0805DD5C + cmp r5, r0 + bne _0805DD1A + movs r7, 0x80 + lsls r7, 1 + add r7, r9 + ldr r5, _0805DD60 + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r6, 0 + bl call_LZZUnCompWram + ldr r0, _0805DD64 + 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, _0805DD68 + 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, _0805DD6C + adds r0, r7, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r7, 1 + ldr r0, _0805DD70 + adds r0, r1, r0 + ldr r2, _0805DD74 + adds r1, r2 + ldr r2, _0805DD78 + 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 + .align 2, 0 +_0805DD58: .4byte 0x0201c000 +_0805DD5C: .4byte 0x00000181 +_0805DD60: .4byte 0x0202449c +_0805DD64: .4byte 0x020244e4 +_0805DD68: .4byte 0x020244d0 +_0805DD6C: .4byte 0x00007fff +_0805DD70: .4byte 0x02037b14 +_0805DD74: .4byte 0x02037714 +_0805DD78: .4byte 0x04000008 + 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, _0805DDBC + 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 + .align 2, 0 +_0805DDBC: .4byte 0x020244d0 +_0805DDC0: + ldrh r5, [r2, 0x2] + ldr r0, _0805DE1C + 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, _0805DE20 + 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, _0805DE24 + adds r0, r1 + ldr r1, _0805DE28 + 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 sub_8034B50 + b _0805DE46 + .align 2, 0 +_0805DE1C: .4byte 0x020244bc +_0805DE20: .4byte 0x020244d0 +_0805DE24: .4byte 0x083028b8 +_0805DE28: .4byte 0x020244d4 +_0805DE2C: + lsls r0, r5, 3 + ldr r1, _0805DE68 + adds r0, r1 + ldr r1, _0805DE6C + 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 sub_8034628 +_0805DE46: + mov r2, r8 + lsls r1, r2, 4 + movs r0, 0x80 + lsls r0, 1 + adds r7, r1, r0 + ldr r0, _0805DE70 + 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 + .align 2, 0 +_0805DE68: .4byte 0x083028b8 +_0805DE6C: .4byte 0x020244d4 +_0805DE70: .4byte 0x020244d0 +_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, _0805DF0C + adds r0, r6, 0 + adds r1, r4, 0 + bl call_LZZUnCompWram + 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, _0805DF10 + cmp r5, r0 + bne _0805DED2 + movs r7, 0x80 + lsls r7, 1 + add r7, r9 + ldr r5, _0805DF14 + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r6, 0 + bl call_LZZUnCompWram + ldr r0, _0805DF18 + 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, _0805DF1C + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DEFC + ldr r3, _0805DF20 + adds r0, r7, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r7, 1 + ldr r0, _0805DF24 + adds r0, r1, r0 + ldr r2, _0805DF28 + adds r1, r2 + ldr r2, _0805DF2C + 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 + .align 2, 0 +_0805DF0C: .4byte 0x0201c000 +_0805DF10: .4byte 0x00000181 +_0805DF14: .4byte 0x0202449c +_0805DF18: .4byte 0x020244e4 +_0805DF1C: .4byte 0x020244d0 +_0805DF20: .4byte 0x00007fff +_0805DF24: .4byte 0x02037b14 +_0805DF28: .4byte 0x02037714 +_0805DF2C: .4byte 0x04000008 + 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, _0805DF78 + adds r2, r4, r2 + ldr r1, _0805DF7C + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0 + bl LZ77UnCompAnyRam + ldr r0, _0805DF80 + adds r4, r0 + adds r0, r4, 0 + bl gpu_pal_obj_decompress_and_apply + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805DF78: .4byte 0x08305654 +_0805DF7C: .4byte 0x020244d4 +_0805DF80: .4byte 0x0830593c + 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, _0805DFD4 + adds r2, r5, r2 + ldr r1, _0805DFD8 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0 + bl LZ77UnCompAnyRam + ldr r0, _0805DFDC + 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 + .align 2, 0 +_0805DFD4: .4byte 0x08305d4c +_0805DFD8: .4byte 0x020244d4 +_0805DFDC: .4byte 0x08305d8c + 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, _0805DFF8 + lsrs r0, 13 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + pop {r0} + bx r0 + .align 2, 0 +_0805DFF8: .4byte 0x0830593c + thumb_func_end sub_805DFE4 + + thumb_func_start sub_805DFFC +sub_805DFFC: @ 805DFFC + push {r4-r7,lr} + ldr r4, _0805E028 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + adds r4, 0x8 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805E034 + ldr r0, _0805E02C + bl gpu_tile_obj_decompress_and_load + ldr r0, _0805E030 + bl gpu_tile_obj_decompress_and_load + movs r5, 0x2 + b _0805E056 + .align 2, 0 +_0805E028: .4byte 0x0832c128 +_0805E02C: .4byte 0x0832c0d0 +_0805E030: .4byte 0x0832c0d8 +_0805E034: + ldr r4, _0805E07C + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + ldr r4, _0805E080 + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + movs r5, 0x4 +_0805E056: + movs r4, 0 + cmp r4, r5 + bcs _0805E076 + ldr r7, _0805E084 + ldr r6, _0805E088 +_0805E060: + adds r0, r4, r7 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r6 + bl gpu_tile_obj_decompress_and_load + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0805E060 +_0805E076: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805E07C: .4byte 0x0832c0e0 +_0805E080: .4byte 0x0832c0f0 +_0805E084: .4byte 0x02024076 +_0805E088: .4byte 0x0832c108 + 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, _0805E0B4 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + adds r4, 0x8 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + b _0805E1AE + .align 2, 0 +_0805E0B4: .4byte 0x0832c128 +_0805E0B8: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805E120 + cmp r4, 0x2 + bne _0805E0F0 + ldr r0, _0805E0DC + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0805E0E4 + ldr r0, _0805E0E0 + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E0DC: .4byte 0x02022fec +_0805E0E0: .4byte 0x0832c100 +_0805E0E4: + ldr r0, _0805E0EC + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E0EC: .4byte 0x0832c0d0 +_0805E0F0: + cmp r4, 0x3 + bne _0805E100 + ldr r0, _0805E0FC + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E0FC: .4byte 0x0832c0d8 +_0805E100: + cmp r4, 0x4 + bne _0805E110 + ldr r0, _0805E10C + ldrb r0, [r0] + b _0805E198 + .align 2, 0 +_0805E10C: .4byte 0x02024076 +_0805E110: + cmp r4, 0x5 + bne _0805E1AC + ldr r0, _0805E11C + ldrb r0, [r0, 0x1] + b _0805E198 + .align 2, 0 +_0805E11C: .4byte 0x02024076 +_0805E120: + cmp r4, 0x2 + bne _0805E130 + ldr r0, _0805E12C + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E12C: .4byte 0x0832c0e0 +_0805E130: + cmp r4, 0x3 + bne _0805E140 + ldr r0, _0805E13C + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E13C: .4byte 0x0832c0e8 +_0805E140: + cmp r4, 0x4 + bne _0805E150 + ldr r0, _0805E14C + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E14C: .4byte 0x0832c0f0 +_0805E150: + cmp r4, 0x5 + bne _0805E160 + ldr r0, _0805E15C + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E15C: .4byte 0x0832c0f8 +_0805E160: + cmp r4, 0x6 + bne _0805E170 + ldr r0, _0805E16C + ldrb r0, [r0] + b _0805E198 + .align 2, 0 +_0805E16C: .4byte 0x02024076 +_0805E170: + cmp r4, 0x7 + bne _0805E180 + ldr r0, _0805E17C + ldrb r0, [r0, 0x1] + b _0805E198 + .align 2, 0 +_0805E17C: .4byte 0x02024076 +_0805E180: + cmp r4, 0x8 + bne _0805E190 + ldr r0, _0805E18C + ldrb r0, [r0, 0x2] + b _0805E198 + .align 2, 0 +_0805E18C: .4byte 0x02024076 +_0805E190: + cmp r5, 0x9 + bne _0805E1AC + ldr r0, _0805E1A4 + ldrb r0, [r0, 0x3] +_0805E198: + lsls r0, 3 + ldr r1, _0805E1A8 + adds r0, r1 + bl gpu_tile_obj_decompress_and_load + b _0805E1AE + .align 2, 0 +_0805E1A4: .4byte 0x02024076 +_0805E1A8: .4byte 0x0832c108 +_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, _0805E1D0 + ldr r1, _0805E1D4 + ldr r1, [r1] + movs r2, 0xBA + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + bl call_LZZUnCompWram + pop {r0} + bx r0 + .align 2, 0 +_0805E1D0: .4byte 0x08c093f0 +_0805E1D4: .4byte 0x020244d4 + 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, _0805E1F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805E1F4: .4byte _0805E1F8 + .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, _0805E248 + 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 + .align 2, 0 +_0805E248: .4byte 0x02022fec +_0805E24C: + ldrb r0, [r4] + bl battle_make_oam_normal_battle +_0805E252: + ldr r2, _0805E25C + ldrb r1, [r4] + adds r1, r2 + strb r0, [r1] + b _0805E30E + .align 2, 0 +_0805E25C: .4byte 0x03005d70 +_0805E260: + ldrb r0, [r4] + bl sub_8072B18 + ldr r0, _0805E280 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0805E288 + ldr r0, _0805E284 + adds r0, r1, r0 + ldrb r0, [r0] + movs r1, 0 + bl nullsub_30 + b _0805E30E + .align 2, 0 +_0805E280: .4byte 0x02024076 +_0805E284: .4byte 0x03005d70 +_0805E288: + ldr r0, _0805E298 + adds r0, r1, r0 + ldrb r0, [r0] + movs r1, 0x1 + bl nullsub_30 + b _0805E30E + .align 2, 0 +_0805E298: .4byte 0x03005d70 +_0805E29C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805E2E4 + ldr r0, _0805E2D4 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805E302 + ldr r0, _0805E2D8 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _0805E2DC + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0805E2E0 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + b _0805E302 + .align 2, 0 +_0805E2D4: .4byte 0x02022fec +_0805E2D8: .4byte 0x03005d70 +_0805E2DC: .4byte 0x0202406e +_0805E2E0: .4byte 0x020244ec +_0805E2E4: + ldr r0, _0805E32C + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _0805E330 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0805E334 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_0805E302: + ldr r1, _0805E32C + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 +_0805E30E: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, _0805E338 + 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 + .align 2, 0 +_0805E32C: .4byte 0x03005d70 +_0805E330: .4byte 0x0202406e +_0805E334: .4byte 0x02024744 +_0805E338: .4byte 0x0202406c +_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, _0805E374 + 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 + .align 2, 0 +_0805E374: .4byte 0x020244d0 + thumb_func_end sub_805E350 + + thumb_func_start sub_805E378 +sub_805E378: @ 805E378 + push {lr} + bl sub_805E350 + ldr r0, _0805E390 + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_0805E390: .4byte 0x020244d0 + 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, _0805E3F8 + ldrb r0, [r5] + cmp r4, r0 + bge _0805E3EA + ldr r0, _0805E3FC + mov r9, r0 + movs r0, 0x1 + mov r12, r0 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ldr r7, _0805E400 + ldr r6, _0805E404 +_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 + .align 2, 0 +_0805E3F8: .4byte 0x0202406c +_0805E3FC: .4byte 0x02020630 +_0805E400: .4byte 0x020244d0 +_0805E404: .4byte 0x020241e4 + thumb_func_end sub_805E394 + + thumb_func_start sub_805E408 +sub_805E408: @ 805E408 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0805E43C + ldr r1, [r1] + ldr r1, [r1] + lsls r3, r0, 2 + adds r3, r1 + ldr r2, _0805E440 + ldr r1, _0805E444 + 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 + .align 2, 0 +_0805E43C: .4byte 0x020244d0 +_0805E440: .4byte 0x02020630 +_0805E444: .4byte 0x020241e4 + 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, _0805E4F8 + adds r5, r7, r0 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0805E4FC + mov r8, r1 + add r0, r8 + ldr r4, _0805E500 + ldr r1, [r4] + ldr r1, [r1, 0x8] + ldrb r1, [r1] + bl obj_anim_image_start + lsls r0, r7, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r6, r0, 16 + ldr r2, _0805E504 + 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, _0805E508 + 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, _0805E50C + adds r0, r6, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r6, 1 + ldr r0, _0805E510 + adds r0, r1, r0 + ldr r2, _0805E514 + adds r1, r2 + ldr r2, _0805E518 + 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 + .align 2, 0 +_0805E4F8: .4byte 0x020241e4 +_0805E4FC: .4byte 0x02020630 +_0805E500: .4byte 0x020244d0 +_0805E504: .4byte 0x0202449c +_0805E508: .4byte 0x020244e4 +_0805E50C: .4byte 0x00007fff +_0805E510: .4byte 0x02037b14 +_0805E514: .4byte 0x02037714 +_0805E518: .4byte 0x04000008 +_0805E51C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E558 + movs r0, 0 + mov r10, r0 + ldr r0, _0805E54C + 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, _0805E550 + adds r0, r1 + ldr r1, _0805E554 + ldr r1, [r1] + ldr r1, [r1, 0x4] + ldr r3, [r2, 0x10] + b _0805E5FA + .align 2, 0 +_0805E54C: .4byte 0x02039f34 +_0805E550: .4byte 0x083028b8 +_0805E554: .4byte 0x020244d4 +_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, _0805E584 + ldr r2, [sp] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805E588 + b _0805E59C + .align 2, 0 +_0805E584: .4byte 0x0202406e +_0805E588: .4byte 0x02024744 +_0805E58C: + ldr r1, _0805E604 + ldr r3, [sp] + lsls r0, r3, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805E608 +_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, _0805E604 + lsls r4, r7, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0805E608 + 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, _0805E60C + adds r0, r1 + ldr r1, _0805E610 + ldr r1, [r1] + mov r3, r10 + lsls r2, r3, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + ldr r3, _0805E614 + lsls r2, r7, 2 + adds r2, r3 + ldr r3, [r2] +_0805E5FA: + mov r2, r8 + bl sub_8034B50 + b _0805E662 + .align 2, 0 +_0805E604: .4byte 0x0202406e +_0805E608: .4byte 0x020244ec +_0805E60C: .4byte 0x083028b8 +_0805E610: .4byte 0x020244d4 +_0805E614: .4byte 0x020244bc +_0805E618: + ldr r0, _0805E78C + lsls r4, r7, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0805E790 + 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, _0805E794 + adds r0, r1 + ldr r1, _0805E798 + ldr r1, [r1] + mov r3, r10 + lsls r2, r3, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + ldr r3, _0805E79C + lsls r2, r7, 2 + adds r2, r3 + ldr r3, [r2] + mov r2, r8 + bl sub_8034B50 +_0805E662: + ldr r0, _0805E798 + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 2 + adds r0, 0x4 + adds r0, r1 + ldr r2, [r0] + ldr r0, _0805E7A0 + adds r0, r7 + mov r10, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r3, _0805E7A4 + adds r0, r3 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r0, 17 + ldr r1, _0805E7A8 + adds r0, r1 + ldr r1, _0805E7AC + str r2, [r1] + str r0, [r1, 0x4] + ldr r0, _0805E7B0 + 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, _0805E7B4 + adds r1, r4, 0 + bl call_LZZUnCompWram + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0805E7B8 + cmp r8, r0 + bne _0805E70A + mov r2, r10 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0805E7A4 + adds r1, 0x8 + adds r0, r1 + ldr r1, _0805E7BC + mov r3, r8 + lsls r2, r3, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + ldr r5, _0805E7C0 + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + mov r0, r9 + bl call_LZZUnCompWram + ldr r0, _0805E7C4 + 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, _0805E7C8 + adds r0, r6, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r6, 1 + ldr r0, _0805E7CC + adds r0, r1, r0 + ldr r2, _0805E7D0 + adds r1, r2 + ldr r2, _0805E7D4 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0805E74A + ldr r0, _0805E7D8 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + mov r2, r8 + strh r2, [r0, 0x2] + ldr r0, _0805E7C4 + 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, _0805E7A4 + 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, _0805E7C4 + adds r1, r7, r1 + ldrb r1, [r1] + bl obj_anim_image_start +_0805E77A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805E78C: .4byte 0x0202406e +_0805E790: .4byte 0x02024744 +_0805E794: .4byte 0x0830a18c +_0805E798: .4byte 0x020244d4 +_0805E79C: .4byte 0x020244bc +_0805E7A0: .4byte 0x020241e4 +_0805E7A4: .4byte 0x02020630 +_0805E7A8: .4byte 0x06010000 +_0805E7AC: .4byte 0x040000d4 +_0805E7B0: .4byte 0x84000200 +_0805E7B4: .4byte 0x0201c000 +_0805E7B8: .4byte 0x00000181 +_0805E7BC: .4byte 0x08309aac +_0805E7C0: .4byte 0x0202449c +_0805E7C4: .4byte 0x020244e4 +_0805E7C8: .4byte 0x00007fff +_0805E7CC: .4byte 0x02037b14 +_0805E7D0: .4byte 0x02037714 +_0805E7D4: .4byte 0x04000008 +_0805E7D8: .4byte 0x020244d0 + 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, _0805E810 + b _0805E822 + .align 2, 0 +_0805E810: .4byte 0x08c2d120 +_0805E814: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805E83C + ldr r0, _0805E834 +_0805E822: + ldr r1, _0805E838 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x4 + adds r1, r4 + ldr r1, [r1] + bl call_LZZUnCompVram + b _0805E84E + .align 2, 0 +_0805E834: .4byte 0x08c2cee0 +_0805E838: .4byte 0x020244d4 +_0805E83C: + ldr r0, _0805E884 + ldr r1, _0805E888 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x4 + adds r1, r4 + ldr r1, [r1] + bl call_LZZUnCompVram +_0805E84E: + movs r3, 0x1 + lsls r6, r5, 4 + ldr r7, _0805E88C + ldr r0, _0805E888 + ldr r0, [r0] + adds r0, 0x4 + adds r4, r0, r4 + ldr r2, _0805E890 + ldr r5, _0805E894 +_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 + .align 2, 0 +_0805E884: .4byte 0x08c2d120 +_0805E888: .4byte 0x020244d4 +_0805E88C: .4byte 0x08c2cebc +_0805E890: .4byte 0x040000d4 +_0805E894: .4byte 0x84000200 +_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, _0805E8C8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805E8CC + adds r0, r1 + adds r1, r4, 0 + bl sub_805DC0C + b _0805E8E6 + .align 2, 0 +_0805E8C8: .4byte 0x0202406e +_0805E8CC: .4byte 0x02024744 +_0805E8D0: + ldr r1, _0805E8EC + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805E8F0 + adds r0, r1 + adds r1, r5, 0 + bl sub_805DD7C +_0805E8E6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805E8EC: .4byte 0x0202406e +_0805E8F0: .4byte 0x020244ec + 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, _0805E930 + adds r4, r0, r1 + ldr r0, _0805E934 + adds r0, r6, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + bne _0805E938 + adds r0, r6, 0 + bl sub_80A614C + b _0805E93E + .align 2, 0 +_0805E930: .4byte 0x02020630 +_0805E934: .4byte 0x020244e4 +_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, _0805E970 + 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 + .align 2, 0 +_0805E970: .4byte 0x020244d0 + thumb_func_end sub_805E94C + + thumb_func_start sub_805E974 +sub_805E974: @ 805E974 + lsls r0, 24 + ldr r1, _0805E98C + 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 + .align 2, 0 +_0805E98C: .4byte 0x020244d0 + 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, _0805EA04 + 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 + .align 2, 0 +_0805EA04: .4byte 0x020244d0 +_0805EA08: + ldr r4, _0805EA30 + 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 + .align 2, 0 +_0805EA30: .4byte 0x020244d0 +_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, _0805EAB0 + 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 + .align 2, 0 +_0805EAB0: .4byte 0x020244d0 + 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, _0805EB8C + ldr r1, _0805EB90 + 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, _0805EB94 + 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, _0805EB98 + 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 + .align 2, 0 +_0805EB8C: .4byte 0x030022c0 +_0805EB90: .4byte 0x00000439 +_0805EB94: .4byte 0x0202406e +_0805EB98: .4byte 0x020244ec + 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, _0805EC2C + 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, _0805EC30 + ldr r0, _0805EC34 + 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, _0805EC38 + 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 + .align 2, 0 +_0805EC2C: .4byte 0x0202406c +_0805EC30: .4byte 0x02020630 +_0805EC34: .4byte 0x020241e4 +_0805EC38: .4byte 0x020244d0 +_0805EC3C: + ldrb r0, [r3] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, _0805EC7C + 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, _0805EC80 + 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 + .align 2, 0 +_0805EC7C: .4byte 0x020244d0 +_0805EC80: .4byte 0x0202406c + thumb_func_end sub_805EB9C + + thumb_func_start sub_805EC84 +sub_805EC84: @ 805EC84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0805ED60 + bl gpu_tile_obj_decompress_and_load + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _0805ED64 + 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 obj_add_from_template_forward_search + ldr r6, _0805ED68 + 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, _0805ED6C + 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 obj_add_from_template_forward_search + 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 + .align 2, 0 +_0805ED60: .4byte 0x0831c6a0 +_0805ED64: .4byte 0x0831c6b0 +_0805ED68: .4byte 0x020244d0 +_0805ED6C: .4byte 0x02020630 + thumb_func_end sub_805EC84 + + thumb_func_start sub_805ED70 +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, _0805EDB4 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0805EDB8 + 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, _0805EDBC + str r0, [r5, 0x1C] + b _0805EE36 + .align 2, 0 +_0805EDB4: .4byte 0x020241e4 +_0805EDB8: .4byte 0x02020630 +_0805EDBC: .4byte sub_805EE48 + 1 +_0805EDC0: + ldr r0, _0805EDDC + 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, _0805EDE0 + lsls r4, 2 + b _0805EE06 + .align 2, 0 +_0805EDDC: .4byte 0x020383fd +_0805EDE0: .4byte 0x020244d0 +_0805EDE4: + ldr r2, _0805EE40 + 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, _0805EE44 + 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 + .align 2, 0 +_0805EE40: .4byte 0x020244d0 +_0805EE44: .4byte 0x08305dcc + 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, _0805EEA4 + 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, _0805EEA8 + adds r0, r5, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EEB4 + ldr r2, _0805EEAC + 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, _0805EEB0 + b _0805EECE + .align 2, 0 +_0805EEA4: .4byte 0x020244d0 +_0805EEA8: .4byte 0x08305dcc +_0805EEAC: .4byte 0x02020630 +_0805EEB0: .4byte sub_805ED70 + 1 +_0805EEB4: + ldr r2, _0805EED8 + 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, _0805EEDC +_0805EECE: + str r1, [r0] +_0805EED0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805EED8: .4byte 0x02020630 +_0805EEDC: .4byte sub_805EE48 + 1 + thumb_func_end sub_805EE54 + + thumb_func_start sub_805EEE0 +sub_805EEE0: @ 805EEE0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0805EF08 + ldr r1, _0805EF0C + 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, _0805EF10 + str r1, [r0] + bx lr + .align 2, 0 +_0805EF08: .4byte 0x02020630 +_0805EF0C: .4byte 0x020244d0 +_0805EF10: .4byte sub_805EE48 + 1 + thumb_func_end sub_805EEE0 + + thumb_func_start sub_805EF14 +sub_805EF14: @ 805EF14 + push {r4-r6,lr} + ldr r3, _0805EF80 + 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 + .align 2, 0 +_0805EF80: .4byte 0x06000240 + 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, _0805EFB4 + 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, _0805EFB8 + 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 + .align 2, 0 +_0805EFB4: .4byte 0x020244d0 +_0805EFB8: .4byte 0x020244e4 + 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, _0805F08C + str r6, [r4] + movs r0, 0xC0 + lsls r0, 1 + bl malloc_and_clear + str r0, [r4] + movs r0, 0x80 + lsls r0, 8 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1] +_0805EFE2: + ldr r0, _0805F08C + 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, _0805F090 + 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, _0805F08C + 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, _0805F08C + 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 malloc_and_clear + ldr r1, _0805F08C + 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 + .align 2, 0 +_0805F08C: .4byte 0x020244d4 +_0805F090: .4byte 0x08329d98 + thumb_func_end init_uns_table_pokemon_copy + + thumb_func_start sub_805F094 +sub_805F094: @ 805F094 + push {r4-r6,lr} + ldr r6, _0805F10C + 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 + .align 2, 0 +_0805F10C: .4byte 0x020244d4 + 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, _0805F154 + 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 + .align 2, 0 +_0805F154: .4byte 0x00000fff +_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, _0805F174 + ldr r0, _0805F178 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805F17C + str r1, [r0] + bx lr + .align 2, 0 +_0805F174: .4byte 0x03005d60 +_0805F178: .4byte 0x02024064 +_0805F17C: .4byte bx_exec_buffer_A_ch0_tbl7 + 1 + 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, _0805F1B4 + ldr r1, _0805F1B8 + ldr r0, _0805F1BC + 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, _0805F1C0 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0805F1C8 + ldr r0, _0805F1C4 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _0805F1CC + .align 2, 0 +_0805F1B4: .4byte 0x02024068 +_0805F1B8: .4byte 0x0832a328 +_0805F1BC: .4byte 0x02024064 +_0805F1C0: .4byte 0x02023064 +_0805F1C4: .4byte 0x0831c6c8 +_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, _0805F1F8 + ldr r1, _0805F1FC + ldr r0, _0805F200 + 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, _0805F204 + cmp r1, r0 + bne _0805F1F4 + bl dp01_tbl7_exec_completed +_0805F1F4: + pop {r0} + bx r0 + .align 2, 0 +_0805F1F8: .4byte 0x02020630 +_0805F1FC: .4byte 0x020241e4 +_0805F200: .4byte 0x02024064 +_0805F204: .4byte nullsub_12 + 1 + thumb_func_end sub_805F1D0 + + thumb_func_start sub_805F208 +sub_805F208: @ 805F208 + push {lr} + ldr r2, _0805F230 + ldr r1, _0805F234 + ldr r0, _0805F238 + 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, _0805F23C + cmp r1, r0 + bne _0805F22C + bl dp01_tbl7_exec_completed +_0805F22C: + pop {r0} + bx r0 + .align 2, 0 +_0805F230: .4byte 0x02020630 +_0805F234: .4byte 0x020241e4 +_0805F238: .4byte 0x02024064 +_0805F23C: .4byte nullsub_12 + 1 + thumb_func_end sub_805F208 + + thumb_func_start sub_805F240 +sub_805F240: @ 805F240 + push {r4-r6,lr} + ldr r5, _0805F298 + ldr r6, _0805F29C + ldr r4, _0805F2A0 + 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, _0805F2A4 + 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 obj_delete_and_free_tiles + bl dp01_tbl7_exec_completed +_0805F292: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805F298: .4byte 0x02020630 +_0805F29C: .4byte 0x020241e4 +_0805F2A0: .4byte 0x02024064 +_0805F2A4: .4byte nullsub_12 + 1 + thumb_func_end sub_805F240 + + thumb_func_start sub_805F2A8 +sub_805F2A8: @ 805F2A8 + push {r4,lr} + ldr r4, _0805F2E8 + ldr r1, [r4] + ldr r3, _0805F2EC + 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 + .align 2, 0 +_0805F2E8: .4byte 0x020244d0 +_0805F2EC: .4byte 0x02024064 + 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, _0805F354 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F32C +_0805F31E: + ldr r0, _0805F354 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0805F368 +_0805F32C: + ldr r2, _0805F358 + ldr r1, _0805F35C + ldr r3, _0805F360 + 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, _0805F364 + cmp r1, r0 + bne _0805F34E + movs r1, 0x1 + mov r10, r1 +_0805F34E: + movs r6, 0 + b _0805F3A2 + .align 2, 0 +_0805F354: .4byte 0x02022fec +_0805F358: .4byte 0x02020630 +_0805F35C: .4byte 0x03005d70 +_0805F360: .4byte 0x02024064 +_0805F364: .4byte nullsub_12 + 1 +_0805F368: + ldr r3, _0805F474 + ldr r6, _0805F478 + ldr r2, _0805F47C + 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, _0805F480 + 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, _0805F484 + ldr r1, _0805F488 + mov r8, r1 + ldr r2, [r1] + ldr r7, _0805F47C + 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, _0805F48C + 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, _0805F490 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + b _0805F51A + .align 2, 0 +_0805F474: .4byte 0x02020630 +_0805F478: .4byte 0x03005d70 +_0805F47C: .4byte 0x02024064 +_0805F480: .4byte nullsub_12 + 1 +_0805F484: .4byte 0x020244d8 +_0805F488: .4byte 0x020244d0 +_0805F48C: .4byte 0x020244dc +_0805F490: .4byte 0x000027f9 +_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, _0805F54C + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag +_0805F4E4: + mov r1, r8 + ldr r0, [r1] + ldr r1, _0805F550 + 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, _0805F550 + 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, _0805F554 + ldr r0, [r0] + ldr r3, _0805F550 + 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, _0805F558 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805F55C + str r1, [r0] +_0805F53C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805F54C: .4byte 0x000027f9 +_0805F550: .4byte 0x02024064 +_0805F554: .4byte 0x020244d0 +_0805F558: .4byte 0x03005d60 +_0805F55C: .4byte sub_805F2A8 + 1 + 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, _0805F748 + ldr r0, [r5] + ldr r4, _0805F74C + 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, _0805F750 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0805F754 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805F5A6: + ldr r0, _0805F758 + ldr r0, [r0] + ldr r1, _0805F75C + 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, _0805F750 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0805F754 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_0805F5EE: + ldr r2, _0805F748 + ldr r0, [r2] + ldr r1, _0805F74C + 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, _0805F758 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F684 + ldr r4, _0805F760 + mov r1, r8 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _0805F750 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0805F754 + 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, _0805F760 + ldr r4, _0805F74C + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _0805F750 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0805F754 + 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, _0805F748 + ldr r2, [r3] + ldr r0, _0805F74C + 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, _0805F74C + 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, _0805F758 + 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, _0805F764 + bl m4aMPlayContinue + b _0805F774 + .align 2, 0 +_0805F748: .4byte 0x020244d0 +_0805F74C: .4byte 0x02024064 +_0805F750: .4byte 0x0202406e +_0805F754: .4byte 0x02024744 +_0805F758: .4byte 0x02022fec +_0805F75C: .4byte 0x00008040 +_0805F760: .4byte 0x03005d70 +_0805F764: .4byte 0x03007420 +_0805F768: + ldr r0, _0805F7EC + ldr r1, _0805F7F0 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_0805F774: + ldr r0, _0805F7F4 + ldr r2, [r0] + ldr r0, _0805F7F8 + 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, _0805F7FC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805F810 +_0805F7B2: + ldr r2, _0805F800 + ldr r0, _0805F804 + ldr r1, _0805F7F8 + 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, _0805F808 + cmp r3, r0 + bne _0805F86E + ldr r0, _0805F80C + 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 + .align 2, 0 +_0805F7EC: .4byte 0x03007420 +_0805F7F0: .4byte 0x0000ffff +_0805F7F4: .4byte 0x020244d0 +_0805F7F8: .4byte 0x02024064 +_0805F7FC: .4byte 0x02022fec +_0805F800: .4byte 0x02020630 +_0805F804: .4byte 0x03005d7c +_0805F808: .4byte nullsub_12 + 1 +_0805F80C: .4byte 0x020241e4 +_0805F810: + ldr r2, _0805F968 + ldr r7, _0805F96C + ldr r0, _0805F970 + 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, _0805F974 + cmp r4, r0 + bne _0805F86E + ldr r6, _0805F978 + 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, _0805F97C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F8D2 + ldr r1, _0805F96C + ldr r5, _0805F970 + 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, _0805F968 + adds r0, r1 + bl obj_delete_and_free_tiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, _0805F980 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805F984 + 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, _0805F96C + ldr r4, _0805F970 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0805F968 + adds r0, r1 + bl obj_delete_and_free_tiles + ldrb r5, [r4] + ldr r1, _0805F980 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805F984 + 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, _0805F988 + 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, _0805F98C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805F990 + 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 + .align 2, 0 +_0805F968: .4byte 0x02020630 +_0805F96C: .4byte 0x03005d7c +_0805F970: .4byte 0x02024064 +_0805F974: .4byte nullsub_12 + 1 +_0805F978: .4byte 0x020241e4 +_0805F97C: .4byte 0x02022fec +_0805F980: .4byte 0x0202406e +_0805F984: .4byte 0x02024744 +_0805F988: .4byte 0x020244d0 +_0805F98C: .4byte 0x03005d60 +_0805F990: .4byte sub_805F2F0 + 1 + thumb_func_end sub_805F560 + + thumb_func_start sub_805F994 +sub_805F994: @ 805F994 + push {r4,r5,lr} + ldr r2, _0805FA50 + ldr r0, _0805FA54 + ldr r1, _0805FA58 + 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, _0805FA5C + 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, _0805FA60 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0805FA64 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_0805F9E0: + ldr r2, _0805FA50 + ldr r0, _0805FA54 + ldr r5, _0805FA58 + 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, _0805FA68 + cmp r1, r0 + bne _0805FA48 + ldr r4, _0805FA5C + 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, _0805FA6C + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + bl dp01_tbl7_exec_completed +_0805FA48: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805FA50: .4byte 0x02020630 +_0805FA54: .4byte 0x020241e4 +_0805FA58: .4byte 0x02024064 +_0805FA5C: .4byte 0x020244d0 +_0805FA60: .4byte 0x0202406e +_0805FA64: .4byte 0x02024744 +_0805FA68: .4byte nullsub_12 + 1 +_0805FA6C: .4byte 0x000027f9 + thumb_func_end sub_805F994 + + thumb_func_start sub_805FA70 +sub_805FA70: @ 805FA70 + push {r4-r6,lr} + ldr r6, _0805FAB0 + ldrb r0, [r6] + ldr r5, _0805FAB4 + 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 + .align 2, 0 +_0805FAB0: .4byte 0x02024064 +_0805FAB4: .4byte 0x03005d70 +_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, _0805FAF8 + ldr r0, _0805FAFC + ldr r1, _0805FB00 + 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, _0805FB04 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_0805FAF2: + pop {r0} + bx r0 + .align 2, 0 +_0805FAF8: .4byte 0x02020630 +_0805FAFC: .4byte 0x020241e4 +_0805FB00: .4byte 0x02024064 +_0805FB04: .4byte 0x03005d70 + thumb_func_end sub_805FAC4 + + thumb_func_start sub_805FB08 +sub_805FB08: @ 805FB08 + push {r4-r6,lr} + ldr r0, _0805FB68 + ldr r0, [r0] + ldr r6, _0805FB6C + 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, _0805FB70 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0805FB74 + 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 obj_delete_and_free_tiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, _0805FB78 + 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 + .align 2, 0 +_0805FB68: .4byte 0x020244d0 +_0805FB6C: .4byte 0x02024064 +_0805FB70: .4byte 0x020241e4 +_0805FB74: .4byte 0x02020630 +_0805FB78: .4byte 0x03005d70 + thumb_func_end sub_805FB08 + + thumb_func_start bx_t7_button_a +bx_t7_button_a: @ 805FB7C + push {lr} + movs r0, 0 + bl a_pressed_maybe + 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, _0805FBD0 + ldr r0, _0805FBD4 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _0805FBD8 + 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, _0805FBDC + strb r3, [r0] + bl dp01_tbl7_exec_completed + b _0805FC0A + .align 2, 0 +_0805FBD0: .4byte 0x020241e4 +_0805FBD4: .4byte 0x02024064 +_0805FBD8: .4byte 0x02020630 +_0805FBDC: .4byte 0x020244b9 +_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, _0805FC64 + ldr r0, _0805FC68 + ldr r4, _0805FC6C + 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, _0805FC70 + cmp r1, r0 + bne _0805FC5C + ldr r0, _0805FC74 + 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, _0805FC78 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _0805FC7C + str r0, [r1] +_0805FC5C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805FC64: .4byte 0x02020630 +_0805FC68: .4byte 0x03005d70 +_0805FC6C: .4byte 0x02024064 +_0805FC70: .4byte nullsub_12 + 1 +_0805FC74: .4byte 0x020244d0 +_0805FC78: .4byte 0x03005d60 +_0805FC7C: .4byte bx_803AEDC + 1 + thumb_func_end sub_805FC10 + + thumb_func_start bx_803AEDC +bx_803AEDC: @ 805FC80 + push {r4,lr} + ldr r0, _0805FCE0 + ldr r0, [r0] + ldr r4, _0805FCE4 + 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, _0805FCE8 + ldr r1, _0805FCEC + 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, _0805FCF0 + cmp r1, r0 + beq _0805FCCA + ldr r0, _0805FCF4 + cmp r1, r0 + bne _0805FCDA +_0805FCCA: + ldr r0, _0805FCF8 + ldr r1, _0805FCFC + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl dp01_tbl7_exec_completed +_0805FCDA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0805FCE0: .4byte 0x020244d0 +_0805FCE4: .4byte 0x02024064 +_0805FCE8: .4byte 0x02020630 +_0805FCEC: .4byte 0x020241e4 +_0805FCF0: .4byte nullsub_12 + 1 +_0805FCF4: .4byte nullsub_18 + 1 +_0805FCF8: .4byte 0x03007420 +_0805FCFC: .4byte 0x0000ffff + thumb_func_end bx_803AEDC + + thumb_func_start sub_805FD00 +sub_805FD00: @ 805FD00 + push {r4-r7,lr} + ldr r4, _0805FDC4 + ldr r0, [r4] + ldr r5, _0805FDC8 + 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, _0805FDCC + ldr r6, _0805FDD0 + 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, _0805FDD4 + 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, _0805FDD8 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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 obj_anim_image_start + ldr r4, _0805FDDC + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _0805FDE0 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0805FDE4 + 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, _0805FDE8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805FDEC + str r1, [r0] +_0805FDBC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805FDC4: .4byte 0x020244d0 +_0805FDC8: .4byte 0x02024064 +_0805FDCC: .4byte 0x02020630 +_0805FDD0: .4byte 0x020241e4 +_0805FDD4: .4byte nullsub_12 + 1 +_0805FDD8: .4byte 0x000027f9 +_0805FDDC: .4byte 0x03005d70 +_0805FDE0: .4byte 0x0202406e +_0805FDE4: .4byte 0x02024744 +_0805FDE8: .4byte 0x03005d60 +_0805FDEC: .4byte sub_805FC10 + 1 + thumb_func_end sub_805FD00 + + thumb_func_start sub_805FDF0 +sub_805FDF0: @ 805FDF0 + push {r4-r6,lr} + ldr r6, _0805FE94 + ldr r0, [r6] + ldr r5, _0805FE98 + 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, _0805FE9C + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0805FEA0 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805FE22: + ldr r4, _0805FEA4 + ldr r0, _0805FEA8 + 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, _0805FEAC + 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 obj_delete_and_free_tiles + ldrb r4, [r5] + ldr r1, _0805FE9C + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0805FEA0 + 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, _0805FEB0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805FEB4 + str r1, [r0] +_0805FE8C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805FE94: .4byte 0x020244d0 +_0805FE98: .4byte 0x02024064 +_0805FE9C: .4byte 0x0202406e +_0805FEA0: .4byte 0x02024744 +_0805FEA4: .4byte 0x02020630 +_0805FEA8: .4byte 0x03005d7c +_0805FEAC: .4byte nullsub_12 + 1 +_0805FEB0: .4byte 0x03005d60 +_0805FEB4: .4byte sub_805FD00 + 1 + thumb_func_end sub_805FDF0 + + thumb_func_start sub_805FEB8 +sub_805FEB8: @ 805FEB8 + push {lr} + ldr r0, _0805FEE0 + ldr r2, [r0] + ldr r0, _0805FEE4 + 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 + .align 2, 0 +_0805FEE0: .4byte 0x020244d0 +_0805FEE4: .4byte 0x02024064 + thumb_func_end sub_805FEB8 + + thumb_func_start bx_803B0F4 +bx_803B0F4: @ 805FEE8 + push {lr} + ldr r0, _0805FF10 + ldr r2, [r0] + ldr r0, _0805FF14 + 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 + .align 2, 0 +_0805FF10: .4byte 0x020244d0 +_0805FF14: .4byte 0x02024064 + 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, _0805FF58 + ldr r4, _0805FF5C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0805FF60 + str r1, [r0] + ldr r0, _0805FF64 + 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, _0805FF68 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0805FF7E + .align 2, 0 +_0805FF58: .4byte 0x03005d60 +_0805FF5C: .4byte 0x02024064 +_0805FF60: .4byte bx_exec_buffer_A_ch0_tbl7 + 1 +_0805FF64: .4byte 0x02022fec +_0805FF68: .4byte 0x02023064 +_0805FF6C: + ldr r2, _0805FF88 + ldr r1, _0805FF8C + 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 + .align 2, 0 +_0805FF88: .4byte 0x02024068 +_0805FF8C: .4byte 0x0832a328 + 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, _0805FFBC + ldr r0, _0805FFC0 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0805FFC8 + ldr r0, _0805FFC4 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8060004 + adds r6, r0, 0 + b _0805FFEA + .align 2, 0 +_0805FFBC: .4byte 0x02023064 +_0805FFC0: .4byte 0x02024064 +_0805FFC4: .4byte 0x0202406e +_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, _08060038 + ldr r3, _0806003C + 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, _08060040 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08060038: .4byte 0x02023064 +_0806003C: .4byte 0x02024064 +_08060040: .4byte _08060044 + .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, _08060348 + 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, _08060348 + 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, _0806034C + 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, _08060350 + 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, _08060354 + 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 strcpy_limit_10_chars + 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 + .align 2, 0 +_08060348: .4byte 0x02024744 +_0806034C: .4byte 0xfffffc1f +_08060350: .4byte 0xfff07fff +_08060354: .4byte 0xfffffe0f +_08060358: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060364 + adds r0, r1 + movs r1, 0xB + b _080606D2 + .align 2, 0 +_08060364: .4byte 0x02024744 +_08060368: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060374 + adds r0, r1 + movs r1, 0xC + b _080606D2 + .align 2, 0 +_08060374: .4byte 0x02024744 +_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, _080603DC + 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, _080603DC + 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 + .align 2, 0 +_080603DC: .4byte 0x02024744 +_080603E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080603F8 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _080606D2 + .align 2, 0 +_080603F8: .4byte 0x02024744 +_080603FC: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _08060434 + 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, _08060434 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0806079A + .align 2, 0 +_08060434: .4byte 0x02024744 +_08060438: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060450 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _08060792 + .align 2, 0 +_08060450: .4byte 0x02024744 +_08060454: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060460 + adds r0, r1 + movs r1, 0x1 + b _0806046E + .align 2, 0 +_08060460: .4byte 0x02024744 +_08060464: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060490 + 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 + .align 2, 0 +_08060490: .4byte 0x02024744 +_08060494: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080604A0 + adds r0, r1 + movs r1, 0x1A + b _08060792 + .align 2, 0 +_080604A0: .4byte 0x02024744 +_080604A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080604B0 + adds r0, r1 + movs r1, 0x1B + b _08060792 + .align 2, 0 +_080604B0: .4byte 0x02024744 +_080604B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080604C0 + adds r0, r1 + movs r1, 0x1C + b _08060792 + .align 2, 0 +_080604C0: .4byte 0x02024744 +_080604C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080604D0 + adds r0, r1 + movs r1, 0x1D + b _08060792 + .align 2, 0 +_080604D0: .4byte 0x02024744 +_080604D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080604E0 + adds r0, r1 + movs r1, 0x1E + b _08060792 + .align 2, 0 +_080604E0: .4byte 0x02024744 +_080604E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080604F0 + adds r0, r1 + movs r1, 0x1F + b _08060792 + .align 2, 0 +_080604F0: .4byte 0x02024744 +_080604F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060500 + adds r0, r1 + movs r1, 0x20 + b _08060792 + .align 2, 0 +_08060500: .4byte 0x02024744 +_08060504: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060510 + adds r0, r1 + movs r1, 0x22 + b _08060792 + .align 2, 0 +_08060510: .4byte 0x02024744 +_08060514: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060520 + adds r0, r1 + movs r1, 0x23 + b _08060792 + .align 2, 0 +_08060520: .4byte 0x02024744 +_08060524: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060530 + adds r0, r1 + movs r1, 0x24 + b _08060792 + .align 2, 0 +_08060530: .4byte 0x02024744 +_08060534: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060540 + adds r0, r1 + movs r1, 0x25 + b _08060792 + .align 2, 0 +_08060540: .4byte 0x02024744 +_08060544: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060550 + adds r0, r1 + movs r1, 0x26 + b _08060792 + .align 2, 0 +_08060550: .4byte 0x02024744 +_08060554: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _080605A0 + 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 + .align 2, 0 +_080605A0: .4byte 0x02024744 +_080605A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080605B0 + adds r0, r1 + movs r1, 0x27 + b _08060792 + .align 2, 0 +_080605B0: .4byte 0x02024744 +_080605B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080605C0 + adds r0, r1 + movs r1, 0x28 + b _08060792 + .align 2, 0 +_080605C0: .4byte 0x02024744 +_080605C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080605D0 + adds r0, r1 + movs r1, 0x29 + b _08060792 + .align 2, 0 +_080605D0: .4byte 0x02024744 +_080605D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080605E0 + adds r0, r1 + movs r1, 0x2A + b _08060792 + .align 2, 0 +_080605E0: .4byte 0x02024744 +_080605E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080605F0 + adds r0, r1 + movs r1, 0x2B + b _08060792 + .align 2, 0 +_080605F0: .4byte 0x02024744 +_080605F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060600 + adds r0, r1 + movs r1, 0x2C + b _08060792 + .align 2, 0 +_08060600: .4byte 0x02024744 +_08060604: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060610 + adds r0, r1 + movs r1, 0 + b _0806062E + .align 2, 0 +_08060610: .4byte 0x02024744 +_08060614: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060620 + adds r0, r1 + movs r1, 0x9 + b _080606D2 + .align 2, 0 +_08060620: .4byte 0x02024744 +_08060624: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060654 + 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 + .align 2, 0 +_08060654: .4byte 0x02024744 +_08060658: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060664 + adds r0, r1 + movs r1, 0x38 + b _08060792 + .align 2, 0 +_08060664: .4byte 0x02024744 +_08060668: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060674 + adds r0, r1 + movs r1, 0x39 + b _080606D2 + .align 2, 0 +_08060674: .4byte 0x02024744 +_08060678: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060684 + adds r0, r1 + movs r1, 0x3A + b _080606D2 + .align 2, 0 +_08060684: .4byte 0x02024744 +_08060688: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060694 + adds r0, r1 + movs r1, 0x3B + b _080606D2 + .align 2, 0 +_08060694: .4byte 0x02024744 +_08060698: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080606A4 + adds r0, r1 + movs r1, 0x3C + b _080606D2 + .align 2, 0 +_080606A4: .4byte 0x02024744 +_080606A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080606B4 + adds r0, r1 + movs r1, 0x3D + b _080606D2 + .align 2, 0 +_080606B4: .4byte 0x02024744 +_080606B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080606C4 + adds r0, r1 + movs r1, 0x3E + b _080606D2 + .align 2, 0 +_080606C4: .4byte 0x02024744 +_080606C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080606E4 + 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 + .align 2, 0 +_080606E4: .4byte 0x02024744 +_080606E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080606F4 + adds r0, r1 + movs r1, 0x16 + b _08060792 + .align 2, 0 +_080606F4: .4byte 0x02024744 +_080606F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060704 + adds r0, r1 + movs r1, 0x17 + b _08060792 + .align 2, 0 +_08060704: .4byte 0x02024744 +_08060708: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060714 + adds r0, r1 + movs r1, 0x18 + b _08060792 + .align 2, 0 +_08060714: .4byte 0x02024744 +_08060718: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060724 + adds r0, r1 + movs r1, 0x21 + b _08060792 + .align 2, 0 +_08060724: .4byte 0x02024744 +_08060728: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060734 + adds r0, r1 + movs r1, 0x2F + b _08060792 + .align 2, 0 +_08060734: .4byte 0x02024744 +_08060738: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060744 + adds r0, r1 + movs r1, 0x30 + b _08060792 + .align 2, 0 +_08060744: .4byte 0x02024744 +_08060748: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060754 + adds r0, r1 + movs r1, 0x32 + b _08060792 + .align 2, 0 +_08060754: .4byte 0x02024744 +_08060758: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060764 + adds r0, r1 + movs r1, 0x33 + b _08060792 + .align 2, 0 +_08060764: .4byte 0x02024744 +_08060768: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060774 + adds r0, r1 + movs r1, 0x34 + b _08060792 + .align 2, 0 +_08060774: .4byte 0x02024744 +_08060778: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060784 + adds r0, r1 + movs r1, 0x35 + b _08060792 + .align 2, 0 +_08060784: .4byte 0x02024744 +_08060788: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080607AC + 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 + .align 2, 0 +_080607AC: .4byte 0x02024744 + 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, _08060828 + ldr r5, _0806082C + 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, _08060830 + lsls r1, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + ldr r0, _08060834 + 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 + .align 2, 0 +_08060828: .4byte 0x0202406e +_0806082C: .4byte 0x02024064 +_08060830: .4byte 0x02023064 +_08060834: .4byte 0x02024744 + 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, _0806085C + ldr r0, _08060860 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08060868 + ldr r0, _08060864 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8060890 + b _08060886 + .align 2, 0 +_0806085C: .4byte 0x02023064 +_08060860: .4byte 0x02024064 +_08060864: .4byte 0x0202406e +_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, _080608C8 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, _080608CC + 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, _080608D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080608C8: .4byte 0x02024064 +_080608CC: .4byte 0x02023067 +_080608D0: .4byte _080608D4 + .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, _08060B58 + 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, _08060B58 + 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 + .align 2, 0 +_08060B58: .4byte 0x02024744 +_08060B5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060B74 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060B74: .4byte 0x02024744 +_08060B78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060B90 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060B90: .4byte 0x02024744 +_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, _08060BE4 + 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, _08060BE4 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060BE4: .4byte 0x02024744 +_08060BE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060C00 + adds r0, r1 + ldr r3, _08060C04 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08060C86 + .align 2, 0 +_08060C00: .4byte 0x02024744 +_08060C04: .4byte 0x02023064 +_08060C08: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08060C6C + 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 + .align 2, 0 +_08060C6C: .4byte 0x02024744 +_08060C70: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060C90 + adds r0, r1 + ldr r3, _08060C94 + 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 + .align 2, 0 +_08060C90: .4byte 0x02024744 +_08060C94: .4byte 0x02023064 +_08060C98: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060CB0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060CB0: .4byte 0x02024744 +_08060CB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060CCC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060CCC: .4byte 0x02024744 +_08060CD0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060CE8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060CE8: .4byte 0x02024744 +_08060CEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060D04 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060D04: .4byte 0x02024744 +_08060D08: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060D20 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060D20: .4byte 0x02024744 +_08060D24: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060D3C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060D3C: .4byte 0x02024744 +_08060D40: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060D58 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060D58: .4byte 0x02024744 +_08060D5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060D74 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060D74: .4byte 0x02024744 +_08060D78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060D90 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060D90: .4byte 0x02024744 +_08060D94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060DAC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060DAC: .4byte 0x02024744 +_08060DB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060DC8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060DC8: .4byte 0x02024744 +_08060DCC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060DE4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060DE4: .4byte 0x02024744 +_08060DE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060E00 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060E00: .4byte 0x02024744 +_08060E04: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060E1C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060E1C: .4byte 0x02024744 +_08060E20: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08060E90 + 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 + .align 2, 0 +_08060E90: .4byte 0x02024744 +_08060E94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060EAC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060EAC: .4byte 0x02024744 +_08060EB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060EC8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060EC8: .4byte 0x02024744 +_08060ECC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060EE4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060EE4: .4byte 0x02024744 +_08060EE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060F00 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060F00: .4byte 0x02024744 +_08060F04: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060F1C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060F1C: .4byte 0x02024744 +_08060F20: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060F38 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08060F2E: + movs r1, 0x2C + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060F38: .4byte 0x02024744 +_08060F3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060F54 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060F54: .4byte 0x02024744 +_08060F58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060F70 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060F70: .4byte 0x02024744 +_08060F74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060F8C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060F8C: .4byte 0x02024744 +_08060F90: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060FA8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060FA8: .4byte 0x02024744 +_08060FAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060FC4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060FC4: .4byte 0x02024744 +_08060FC8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060FE0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060FE0: .4byte 0x02024744 +_08060FE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08060FFC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08060FFC: .4byte 0x02024744 +_08061000: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061018 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061018: .4byte 0x02024744 +_0806101C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061034 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061034: .4byte 0x02024744 +_08061038: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061050 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061050: .4byte 0x02024744 +_08061054: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0806106C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _0806119C + .align 2, 0 +_0806106C: .4byte 0x02024744 +_08061070: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061088 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061088: .4byte 0x02024744 +_0806108C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080610A4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_080610A4: .4byte 0x02024744 +_080610A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080610C0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_080610C0: .4byte 0x02024744 +_080610C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080610DC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_080610DC: .4byte 0x02024744 +_080610E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080610F8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _0806119C + .align 2, 0 +_080610F8: .4byte 0x02024744 +_080610FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061114 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061114: .4byte 0x02024744 +_08061118: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061130 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061130: .4byte 0x02024744 +_08061134: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0806114C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_0806114C: .4byte 0x02024744 +_08061150: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061168 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061168: .4byte 0x02024744 +_0806116C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08061184 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _0806119C + .align 2, 0 +_08061184: .4byte 0x02024744 +_08061188: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080611AC + 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 + .align 2, 0 +_080611AC: .4byte 0x02024744 + thumb_func_end sub_8060890 + + thumb_func_start sub_80611B0 +sub_80611B0: @ 80611B0 + push {r4-r7,lr} + ldr r1, _08061214 + ldr r7, _08061218 + 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, _0806121C + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _08061220 + 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 + .align 2, 0 +_08061214: .4byte 0x0202406e +_08061218: .4byte 0x02024064 +_0806121C: .4byte 0x02023064 +_08061220: .4byte 0x02024744 + 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, _08061354 + ldrb r0, [r6] + lsls r0, 1 + ldr r1, _08061358 + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r2, _0806135C + 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, _08061358 + 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, _08061360 + 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 obj_add_from_template_forward_search + ldr r4, _08061364 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, _08061368 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0806136C + 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, _08061370 + adds r2, r1 + ldrb r1, [r2] + bl obj_anim_image_start + ldrb r4, [r6] + lsls r0, r4, 1 + ldr r2, _08061358 + 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, _08061374 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08061378 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08061354: .4byte 0x02024064 +_08061358: .4byte 0x0202406e +_0806135C: .4byte 0x02024744 +_08061360: .4byte 0x0202499c +_08061364: .4byte 0x020241e4 +_08061368: .4byte 0x02020630 +_0806136C: .4byte 0x0000ff10 +_08061370: .4byte 0x020244e4 +_08061374: .4byte 0x03005d60 +_08061378: .4byte sub_805F994 + 1 + thumb_func_end sub_8061224 + + thumb_func_start sub_806137C +sub_806137C: @ 806137C + push {r4,lr} + ldr r4, _080613C4 + ldrb r0, [r4] + ldr r1, _080613C8 + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, _080613CC + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, _080613D0 + 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, _080613D4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _080613D8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080613C4: .4byte 0x02024064 +_080613C8: .4byte 0x0202449c +_080613CC: .4byte 0x0202406e +_080613D0: .4byte 0x02023064 +_080613D4: .4byte 0x03005d60 +_080613D8: .4byte sub_805FDF0 + 1 + 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, _08061544 + lsls r4, r6, 1 + adds r4, r0 + ldr r0, _08061548 + 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, _0806154C + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _08061550 + bl object_new_hidden_with_callback + ldr r1, _08061554 + 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, _08061558 + 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 obj_add_from_template_forward_search + ldr r4, _0806155C + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _08061560 + 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, _08061564 + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _08061568 + 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 + .align 2, 0 +_08061544: .4byte 0x0202406e +_08061548: .4byte 0x02023064 +_0806154C: .4byte 0x02024744 +_08061550: .4byte sub_805D714 + 1 +_08061554: .4byte 0x03005d7c +_08061558: .4byte 0x0202499c +_0806155C: .4byte 0x020241e4 +_08061560: .4byte 0x02020630 +_08061564: .4byte 0x020244e4 +_08061568: .4byte nullsub_12 + 1 + thumb_func_end sub_80613DC + + thumb_func_start sub_806156C +sub_806156C: @ 806156C + push {r4-r6,lr} + ldr r1, _080615A0 + ldr r6, _080615A4 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _080615B4 + ldr r0, _080615A8 + 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, _080615AC + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _080615B0 + str r1, [r0] + b _080615F0 + .align 2, 0 +_080615A0: .4byte 0x02023064 +_080615A4: .4byte 0x02024064 +_080615A8: .4byte 0x020244d0 +_080615AC: .4byte 0x03005d60 +_080615B0: .4byte sub_8061604 + 1 +_080615B4: + ldr r5, _080615F8 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _080615FC + 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 obj_delete_and_free_tiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, _08061600 + 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 + .align 2, 0 +_080615F8: .4byte 0x020241e4 +_080615FC: .4byte 0x02020630 +_08061600: .4byte 0x03005d70 + thumb_func_end sub_806156C + + thumb_func_start sub_8061604 +sub_8061604: @ 8061604 + push {r4-r6,lr} + ldr r6, _08061624 + ldr r4, [r6] + ldr r5, _08061628 + 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 + .align 2, 0 +_08061624: .4byte 0x020244d0 +_08061628: .4byte 0x02024064 +_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, _08061688 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0806168C + str r1, [r0] +_08061682: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08061688: .4byte 0x03005d60 +_0806168C: .4byte sub_805FB08 + 1 + 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, _080616AC + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + beq _080616B0 + bl sub_806B830 + b _0806175A + .align 2, 0 +_080616AC: .4byte 0x02022fec +_080616B0: + ldr r3, _080616C0 + ldrh r1, [r3] + ldr r0, _080616C4 + cmp r1, r0 + bne _080616C8 + bl sub_81A4CB0 + b _0806175A + .align 2, 0 +_080616C0: .4byte 0x02038bca +_080616C4: .4byte 0x000003fe +_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, _080616EC + ldrb r0, [r0] + cmp r0, 0x1 + bne _080616F0 + ldrh r0, [r3] + bl sub_81D5588 + b _0806175A + .align 2, 0 +_080616EC: .4byte 0x02024064 +_080616F0: + ldr r0, _080616FC + ldrh r0, [r0] + bl sub_81D5588 + b _0806175A + .align 2, 0 +_080616FC: .4byte 0x02038bcc +_08061700: + ldrh r0, [r3] + bl sub_81D5588 + b _0806175A +_08061708: + ldr r0, _08061728 + ands r0, r2 + cmp r0, 0 + beq _0806174C + ldr r0, _0806172C + ands r2, r0 + cmp r2, 0 + beq _08061744 + ldr r0, _08061730 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08061734 + ldrh r0, [r3] + bl sub_8162AA0 + b _0806175A + .align 2, 0 +_08061728: .4byte 0x003f0100 +_0806172C: .4byte 0x00808000 +_08061730: .4byte 0x02024064 +_08061734: + ldr r0, _08061740 + ldrh r0, [r0] + bl sub_8162AA0 + b _0806175A + .align 2, 0 +_08061740: .4byte 0x02038bcc +_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, _0806177C + ldrb r0, [r0] + cmp r0, 0x1 + beq _08061788 + ldr r2, _08061780 + ldr r0, _08061784 + ldrh r1, [r0] + b _0806178C + .align 2, 0 +_0806177C: .4byte 0x02024064 +_08061780: .4byte 0x08310030 +_08061784: .4byte 0x02038bcc +_08061788: + ldr r2, _080617B8 + ldrh r1, [r3] +_0806178C: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x3] +_08061796: + ldr r0, _080617BC + ldr r0, [r0] + ldr r1, _080617C0 + ands r0, r1 + cmp r0, 0 + beq _080617C8 + ldr r0, _080617C4 + 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 + .align 2, 0 +_080617B8: .4byte 0x08310030 +_080617BC: .4byte 0x02022fec +_080617C0: .4byte 0x00008040 +_080617C4: .4byte 0x02024064 +_080617C8: + movs r7, 0xB0 +_080617CA: + mov r8, r4 + ldr r5, _080618B0 + 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, _080618B4 + mov r9, r7 + ldr r1, _080618B8 + 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 obj_add_from_template_forward_search + ldr r6, _080618BC + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _080618C0 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _080618C4 + 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, _080618C8 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + 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, _080618CC + str r1, [r0] + ldr r1, _080618D0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _080618D4 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080618B0: .4byte 0x02024064 +_080618B4: .4byte 0x0202499c +_080618B8: .4byte 0x083054e0 +_080618BC: .4byte 0x020241e4 +_080618C0: .4byte 0x02020630 +_080618C4: .4byte 0x0000ff10 +_080618C8: .4byte 0x0830593c +_080618CC: .4byte sub_805D7AC + 1 +_080618D0: .4byte 0x03005d60 +_080618D4: .4byte sub_805F1D0 + 1 + thumb_func_end sub_8061690 + + thumb_func_start sub_80618D8 +sub_80618D8: @ 80618D8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _080618F4 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + beq _080618F8 + bl sub_806B830 + b _080619A2 + .align 2, 0 +_080618F4: .4byte 0x02022fec +_080618F8: + ldr r3, _08061908 + ldrh r1, [r3] + ldr r0, _0806190C + cmp r1, r0 + bne _08061910 + bl sub_81A4CB0 + b _080619A2 + .align 2, 0 +_08061908: .4byte 0x02038bca +_0806190C: .4byte 0x000003fe +_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, _08061934 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08061938 + ldrh r0, [r3] + bl sub_81D5588 + b _080619A2 + .align 2, 0 +_08061934: .4byte 0x02024064 +_08061938: + ldr r0, _08061944 + ldrh r0, [r0] + bl sub_81D5588 + b _080619A2 + .align 2, 0 +_08061944: .4byte 0x02038bcc +_08061948: + ldrh r0, [r3] + bl sub_81D5588 + b _080619A2 +_08061950: + ldr r0, _08061970 + ands r0, r2 + cmp r0, 0 + beq _08061994 + ldr r0, _08061974 + ands r2, r0 + cmp r2, 0 + beq _0806198C + ldr r0, _08061978 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806197C + ldrh r0, [r3] + bl sub_8162AA0 + b _080619A2 + .align 2, 0 +_08061970: .4byte 0x003f0100 +_08061974: .4byte 0x00808000 +_08061978: .4byte 0x02024064 +_0806197C: + ldr r0, _08061988 + ldrh r0, [r0] + bl sub_8162AA0 + b _080619A2 + .align 2, 0 +_08061988: .4byte 0x02038bcc +_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, _080619C4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080619D0 + ldr r2, _080619C8 + ldr r0, _080619CC + ldrh r1, [r0] + b _080619D4 + .align 2, 0 +_080619C4: .4byte 0x02024064 +_080619C8: .4byte 0x08310030 +_080619CC: .4byte 0x02038bcc +_080619D0: + ldr r2, _08061AC4 + 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, _08061AC8 + 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, _08061ACC + ldr r2, _08061AD0 + 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 obj_add_from_template_forward_search + ldr r5, _08061AD4 + ldrb r1, [r6] + adds r1, r5 + strb r0, [r1] + ldr r4, _08061AD8 + 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, _08061ADC + strh r1, [r0, 0x2E] + ldr r1, _08061AE0 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + 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, _08061AE4 + str r1, [r0] + ldr r1, _08061AE8 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08061AEC + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08061AC4: .4byte 0x08310030 +_08061AC8: .4byte 0x02024064 +_08061ACC: .4byte 0x0202499c +_08061AD0: .4byte 0x083054e0 +_08061AD4: .4byte 0x020241e4 +_08061AD8: .4byte 0x02020630 +_08061ADC: .4byte 0x0000fffe +_08061AE0: .4byte 0x0830593c +_08061AE4: .4byte sub_805D7AC + 1 +_08061AE8: .4byte 0x03005d60 +_08061AEC: .4byte sub_805F208 + 1 + thumb_func_end sub_80618D8 + + thumb_func_start sub_8061AF0 +sub_8061AF0: @ 8061AF0 + push {r4-r6,lr} + ldr r6, _08061B80 + ldr r4, _08061B84 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _08061B88 + 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, _08061B8C + 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, _08061B90 + bl oamt_set_x3A_32 + ldr r1, _08061B94 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08061B98 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08061B80: .4byte 0x020241e4 +_08061B84: .4byte 0x02024064 +_08061B88: .4byte 0x02020630 +_08061B8C: .4byte sub_80A6EEC + 1 +_08061B90: .4byte nullsub_12 + 1 +_08061B94: .4byte 0x03005d60 +_08061B98: .4byte sub_805F240 + 1 + thumb_func_end sub_8061AF0 + + thumb_func_start sub_8061B9C +sub_8061B9C: @ 8061B9C + push {r4-r6,lr} + ldr r6, _08061BE8 + ldr r4, [r6] + ldr r5, _08061BEC + 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 + .align 2, 0 +_08061BE8: .4byte 0x020244d0 +_08061BEC: .4byte 0x02024064 +_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, _08061C34 + ldr r1, _08061C38 + 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, _08061C3C + str r1, [r0] + ldr r1, _08061C40 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08061C44 + str r1, [r0] +_08061C2C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08061C34: .4byte 0x02020630 +_08061C38: .4byte 0x020241e4 +_08061C3C: .4byte sub_8039934 + 1 +_08061C40: .4byte 0x03005d60 +_08061C44: .4byte sub_805FAC4 + 1 + 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, _08061D5C + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08061C8A + b _08061D9E +_08061C8A: + ldr r0, _08061D60 + 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, _08061D64 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, _08061D68 + 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, _08061D6C + 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, _08061D70 + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, _08061D74 + 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, _08061D78 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, _08061D7C + 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 + .align 2, 0 +_08061D5C: .4byte 0x02024064 +_08061D60: .4byte 0x02023064 +_08061D64: .4byte 0x02038432 +_08061D68: .4byte 0x02038408 +_08061D6C: .4byte 0x02038404 +_08061D70: .4byte 0x0203841a +_08061D74: .4byte 0x0203841c +_08061D78: .4byte 0x02038400 +_08061D7C: .4byte 0x020244bc +_08061D80: + ldr r0, _08061DA4 + 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, _08061DA8 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08061DAC + str r1, [r0] +_08061D9E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08061DA4: .4byte 0x020244d0 +_08061DA8: .4byte 0x03005d60 +_08061DAC: .4byte bx_move_anim_7 + 1 + 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, _08061DFC + ldr r6, _08061E00 + 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, _08061E04 + 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 + .align 2, 0 +_08061DFC: .4byte 0x02023064 +_08061E00: .4byte 0x02024064 +_08061E04: .4byte 0x020244d0 +_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, _08061ED8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _08061EDC + 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, _08061EE0 + ldr r2, [r0] + ldr r0, _08061EE4 + 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 + .align 2, 0 +_08061ED8: .4byte 0x020383f8 +_08061EDC: .4byte 0x020383fd +_08061EE0: .4byte 0x020244d0 +_08061EE4: .4byte 0x02024064 +_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, _08061F74 + movs r1, 0 + strh r1, [r0] + ldr r0, _08061F78 + strh r1, [r0] + ldr r5, _08061F7C + ldrb r4, [r5] + lsls r4, 9 + ldr r0, _08061F80 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, _08061F84 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _08061F88 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08061F8C + str r1, [r0] + ldrb r0, [r5] + ldrh r1, [r4] + bl sub_81A57E4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08061F74: .4byte 0x02022e14 +_08061F78: .4byte 0x02022e16 +_08061F7C: .4byte 0x02024064 +_08061F80: .4byte 0x02023066 +_08061F84: .4byte 0x02022e2c +_08061F88: .4byte 0x03005d60 +_08061F8C: .4byte bx_t7_button_a + 1 + 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, _08061FE0 + 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 + .align 2, 0 +_08061FE0: .4byte 0x02022fec +_08061FE4: + ldr r0, _08062014 + ldrb r0, [r0] + lsls r0, 9 + ldr r1, _08062018 + 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 + .align 2, 0 +_08062014: .4byte 0x02024064 +_08062018: .4byte 0x02023068 +_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, _0806203C + ldrb r2, [r0] + movs r0, 0x1 + movs r1, 0xF + b _08061FD6 + .align 2, 0 +_0806203C: .4byte 0x0202420c +_08062040: + ldr r3, _080620B0 + 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, _080620B4 + ldr r1, _080620B8 + 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, _080620B4 + strb r0, [r5] + ldr r0, _080620BC + ldrb r1, [r0] + ldr r2, _080620C0 + 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, _080620B4 + 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 + .align 2, 0 +_080620B0: .4byte 0x0831c898 +_080620B4: .4byte 0x0202420c +_080620B8: .4byte 0x02024064 +_080620BC: .4byte 0x02024210 +_080620C0: .4byte 0x0832a328 +_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, _08062100 + 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, _08062104 + 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 + .align 2, 0 +_08062100: .4byte 0x0831c898 +_08062104: .4byte 0x02024064 +_08062108: + ldr r0, _08062138 + 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 + .align 2, 0 +_08062138: .4byte 0x02022fec +_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, _08062180 + ldrb r0, [r0] + lsrs r0, 1 + ldr r1, _08062184 + 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 + .align 2, 0 +_08062180: .4byte 0x02024064 +_08062184: .4byte 0x0202449c + thumb_func_end sub_806215C + + thumb_func_start sub_8062188 +sub_8062188: @ 8062188 + push {r4-r7,lr} + ldr r0, _080621C8 + ldrb r0, [r0] + ldr r1, _080621CC + 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, _080621D0 + 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 + .align 2, 0 +_080621C8: .4byte 0x02024064 +_080621CC: .4byte 0x0202449c +_080621D0: .4byte 0x02022fec +_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, _08062204 + ldr r0, [r0] + ldr r1, _08062208 + ands r0, r1 + cmp r0, 0 + beq _08062214 + ldr r0, _0806220C + ldrb r0, [r0] + cmp r0, 0x1 + bne _08062210 + movs r0, 0 + movs r6, 0x3 + b _08062218 + .align 2, 0 +_08062204: .4byte 0x02022fec +_08062208: .4byte 0x00808000 +_0806220C: .4byte 0x02024064 +_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, _0806224C + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0806221C + ldr r1, _08062250 + 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 + .align 2, 0 +_0806224C: .4byte 0x02024744 +_08062250: .4byte 0x0202406e +_08062254: + ldrb r4, [r1] + movs r0, 0x6 + strb r0, [r1] +_0806225A: + ldr r0, _08062280 + ldrb r0, [r0] + ldr r1, _08062284 + 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 + .align 2, 0 +_08062280: .4byte 0x02024064 +_08062284: .4byte 0x0202449c + 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, _0806230C + ldr r0, _08062310 + 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, _08062314 + cmp r7, r0 + beq _08062324 + ldr r6, _08062318 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0806231C + 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, _08062320 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0806234E + .align 2, 0 +_0806230C: .4byte 0x02023064 +_08062310: .4byte 0x02024064 +_08062314: .4byte 0x00007fff +_08062318: .4byte 0x0202406e +_0806231C: .4byte 0x02024744 +_08062320: .4byte 0x03005d70 +_08062324: + ldr r1, _0806236C + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08062370 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, _08062374 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0806234E: + ldr r1, _08062378 + ldr r0, _0806237C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08062380 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806236C: .4byte 0x0202406e +_08062370: .4byte 0x02024744 +_08062374: .4byte 0x03005d70 +_08062378: .4byte 0x03005d60 +_0806237C: .4byte 0x02024064 +_08062380: .4byte sub_805FA70 + 1 + 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, _080623EC + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _080623E4 + ldr r0, _080623F0 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _080623F4 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _080623F8 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _080623FC + 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, _08062400 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08062404 + str r1, [r0] +_080623E4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080623EC: .4byte 0x02024064 +_080623F0: .4byte 0x03005d70 +_080623F4: .4byte 0x0202406e +_080623F8: .4byte 0x02024744 +_080623FC: .4byte 0x020244d0 +_08062400: .4byte 0x03005d60 +_08062404: .4byte sub_805FEB8 + 1 + thumb_func_end sub_8062390 + + thumb_func_start sub_8062408 +sub_8062408: @ 8062408 + push {r4,r5,lr} + ldr r5, _08062460 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08062458 + ldr r4, _08062464 + 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, _08062468 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0806246C + str r1, [r0] +_08062458: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08062460: .4byte 0x02024064 +_08062464: .4byte 0x02023064 +_08062468: .4byte 0x03005d60 +_0806246C: .4byte sub_805FEB8 + 1 + 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, _080624F4 + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_080624F4: .4byte 0x02022d0c + thumb_func_end sub_80624DC + + thumb_func_start sub_80624F8 +sub_80624F8: @ 80624F8 + push {lr} + ldr r3, _08062524 + ldr r1, _08062528 + ldr r0, _0806252C + 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 + .align 2, 0 +_08062524: .4byte 0x02022d0c +_08062528: .4byte 0x02023064 +_0806252C: .4byte 0x02024064 + thumb_func_end sub_80624F8 + + thumb_func_start sub_8062530 +sub_8062530: @ 8062530 + push {lr} + ldr r2, _08062544 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_08062544: .4byte 0x02022d0c + thumb_func_end sub_8062530 + + thumb_func_start sub_8062548 +sub_8062548: @ 8062548 + push {lr} + ldr r3, _0806256C + 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 + .align 2, 0 +_0806256C: .4byte 0x02022d0c + thumb_func_end sub_8062548 + + thumb_func_start dp01t_29_7_blink +dp01t_29_7_blink: @ 8062570 + push {r4,lr} + ldr r3, _08062598 + ldr r2, _0806259C + ldr r4, _080625A0 + 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 + .align 2, 0 +_08062598: .4byte 0x02020630 +_0806259C: .4byte 0x020241e4 +_080625A0: .4byte 0x02024064 +_080625A4: + ldr r1, _080625D4 + 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, _080625D8 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _080625DC + str r1, [r0] +_080625CE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080625D4: .4byte 0x020244b9 +_080625D8: .4byte 0x03005d60 +_080625DC: .4byte bx_blink_t7 + 1 + 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, _08062628 + 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, _0806262C + 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 + .align 2, 0 +_08062628: .4byte 0x02024064 +_0806262C: .4byte 0x02023064 + thumb_func_end sub_80625EC + + thumb_func_start sub_8062630 +sub_8062630: @ 8062630 + push {r4,r5,lr} + ldr r4, _08062664 + ldr r5, _08062668 + 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 + .align 2, 0 +_08062664: .4byte 0x02023064 +_08062668: .4byte 0x02024064 +_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, _080626BC + ldr r0, _080626C0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080626C4 + 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 + .align 2, 0 +_080626BC: .4byte 0x0202406e +_080626C0: .4byte 0x02024064 +_080626C4: .4byte 0x02024744 + thumb_func_end sub_806268C + + thumb_func_start dp01t_2E_7_battle_intro +dp01t_2E_7_battle_intro: @ 80626C8 + push {lr} + ldr r1, _080626F0 + ldr r0, _080626F4 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _080626F8 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_080626F0: .4byte 0x02023064 +_080626F4: .4byte 0x02024064 +_080626F8: .4byte 0x020243fc + thumb_func_end dp01t_2E_7_battle_intro + + thumb_func_start sub_80626FC +sub_80626FC: @ 80626FC + push {r4-r6,lr} + ldr r5, _080627DC + ldr r6, _080627E0 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _080627E4 + 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, _080627E8 + 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, _080627EC + bl oamt_set_x3A_32 + ldr r0, _080627F0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080627F4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, _080627F8 + 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, _080627FC + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _08062800 + 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, _08062804 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08062808 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080627DC: .4byte 0x020241e4 +_080627E0: .4byte 0x02024064 +_080627E4: .4byte 0x02020630 +_080627E8: .4byte sub_80A6EEC + 1 +_080627EC: .4byte sub_806280C + 1 +_080627F0: .4byte sub_8062828 + 1 +_080627F4: .4byte 0x03005e00 +_080627F8: .4byte 0x020244d0 +_080627FC: .4byte 0x020244b4 +_08062800: .4byte sub_8073C30 + 1 +_08062804: .4byte 0x03005d60 +_08062808: .4byte nullsub_26 + 1 + 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 obj_delete_and_free_tiles + 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, _0806288C + ldrb r0, [r7] + mov r9, r0 + ldr r1, _08062890 + 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, _08062894 + 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, _08062898 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _0806289C + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_80613DC + b _080628E0 + .align 2, 0 +_0806288C: .4byte 0x02024064 +_08062890: .4byte 0x03005e00 +_08062894: .4byte 0x02022fec +_08062898: .4byte 0x02023064 +_0806289C: .4byte 0x0202406e +_080628A0: + ldr r4, _08062904 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, _08062908 + 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, _0806290C + ldr r2, _08062910 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _08062914 + 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 + .align 2, 0 +_08062904: .4byte 0x02023064 +_08062908: .4byte 0x0202406e +_0806290C: .4byte 0x03005d60 +_08062910: .4byte 0x02024064 +_08062914: .4byte sub_805F560 + 1 + thumb_func_end sub_8062828 + + thumb_func_start dp01t_30_7_0803D67C +dp01t_30_7_0803D67C: @ 8062918 + push {r4-r7,lr} + ldr r1, _08062940 + ldr r0, _08062944 + 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 + .align 2, 0 +_08062940: .4byte 0x02023064 +_08062944: .4byte 0x02024064 +_08062948: + ldr r4, _080629A0 + ldr r0, [r4] + ldr r3, _080629A4 + 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, _080629A8 + 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 + .align 2, 0 +_080629A0: .4byte 0x020244d0 +_080629A4: .4byte 0x02024064 +_080629A8: .4byte 0x02023064 +_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, _08062A18 + 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, _08062A1C + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, _08062A20 + 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, _08062A24 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, _08062A28 + str r0, [r1] +_08062A12: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08062A18: .4byte 0x02023068 +_08062A1C: .4byte 0x020244b4 +_08062A20: .4byte 0x020244d0 +_08062A24: .4byte 0x03005d60 +_08062A28: .4byte bx_0803D790_t7 + 1 + thumb_func_end dp01t_30_7_0803D67C + + thumb_func_start bx_0803D790_t7 +bx_0803D790_t7: @ 8062A2C + push {r4,lr} + ldr r4, _08062A6C + ldr r0, [r4] + ldr r3, _08062A70 + 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 + .align 2, 0 +_08062A6C: .4byte 0x020244d0 +_08062A70: .4byte 0x02024064 + thumb_func_end bx_0803D790_t7 + + thumb_func_start sub_8062A74 +sub_8062A74: @ 8062A74 + push {lr} + ldr r0, _08062AB0 + ldr r1, [r0] + ldr r0, _08062AB4 + 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, _08062AB8 + ldr r0, _08062ABC + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _08062AC0 + str r1, [r0] +_08062AA6: + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_08062AB0: .4byte 0x020244d0 +_08062AB4: .4byte 0x02024064 +_08062AB8: .4byte 0x03005e00 +_08062ABC: .4byte 0x020244b4 +_08062AC0: .4byte sub_8073C30 + 1 + 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, _08062B20 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08062B16 + ldr r3, _08062B24 + ldr r0, _08062B28 + 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, _08062B2C + 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 + .align 2, 0 +_08062B20: .4byte 0x02024064 +_08062B24: .4byte 0x02020630 +_08062B28: .4byte 0x020241e4 +_08062B2C: .4byte 0x02023064 + 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, _08062B74 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08062B88 + ldr r5, _08062B78 + 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 + .align 2, 0 +_08062B74: .4byte 0x02024064 +_08062B78: .4byte 0x02023064 +_08062B7C: + ldr r0, _08062B90 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _08062B94 + str r0, [r1] +_08062B88: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08062B90: .4byte 0x03005d60 +_08062B94: .4byte bx_803B0F4 + 1 + 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, _08062BE4 + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _08062BDA + ldr r2, _08062BE8 + ldr r0, _08062BEC + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, _08062BF0 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl set_callback2 +_08062BDA: + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_08062BE4: .4byte 0x02022fec +_08062BE8: .4byte 0x030022c0 +_08062BEC: .4byte 0x00000439 +_08062BF0: .4byte 0x03005d00 + 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, _08062C40 + ldr r0, _08062C44 + 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, _08062C48 + 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, _08062C4C + 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 + .align 2, 0 +_08062C40: .4byte 0x020242ac +_08062C44: .4byte 0x02024064 +_08062C48: .4byte 0x020242bc +_08062C4C: .4byte 0x0202449c +_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, _08062D10 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062C72 + b _08062E2C +_08062C72: + ldr r0, _08062D14 + 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, _08062D18 + 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, _08062D14 + 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, _08062D10 + ldr r0, [r0] + ldr r1, _08062D1C + 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 + .align 2, 0 +_08062D10: .4byte 0x02022fec +_08062D14: .4byte 0x02024064 +_08062D18: .4byte 0x02024084 +_08062D1C: .4byte 0x00808000 +_08062D20: + movs r4, 0x3 + movs r3, 0x6 + str r3, [sp] + b _08062D58 +_08062D28: + ldr r0, _08062D48 + ldrb r0, [r0] + ldr r1, _08062D4C + 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 + .align 2, 0 +_08062D48: .4byte 0x02024064 +_08062D4C: .4byte 0x0202449c +_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, _08062E40 + mov r9, r1 + cmp r0, 0 + bne _08062D6C + ldr r3, _08062E44 + 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, _08062E48 + ldr r0, _08062E4C + 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, _08062E50 + 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 + .align 2, 0 +_08062E40: .4byte 0x02024744 +_08062E44: .4byte 0x020244ec +_08062E48: .4byte 0x0202406e +_08062E4C: .4byte 0x02024064 +_08062E50: .4byte 0x02024084 + 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, _08062EE8 + ldr r5, _08062EEC + ldrb r3, [r5] + lsls r0, r3, 1 + adds r4, r0, r1 + ldrh r1, [r4] + cmp r1, 0 + bne _08062E94 + b _080630AC +_08062E94: + ldr r0, _08062EF0 + cmp r1, r0 + bne _08062E9C + b _080630AC +_08062E9C: + ldr r2, _08062EF4 + 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, _08062EF8 + 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, _08062EFC + ldrb r1, [r1] + ldr r2, _08062F00 + 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 + .align 2, 0 +_08062EE8: .4byte 0x02024250 +_08062EEC: .4byte 0x02024064 +_08062EF0: .4byte 0x0000ffff +_08062EF4: .4byte 0x0831c898 +_08062EF8: .4byte 0x02022fec +_08062EFC: .4byte 0x02024210 +_08062F00: .4byte 0x0832a328 +_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, _08062F40 + ldr r1, _08062F44 + ldr r2, _08062F48 + 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 + .align 2, 0 +_08062F40: .4byte 0x0831c898 +_08062F44: .4byte 0x02024250 +_08062F48: .4byte 0x02024064 +_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, _08062F90 + 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, _08062F94 + ldr r0, [r0] + ldr r1, _08062F98 + 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 + .align 2, 0 +_08062F90: .4byte 0x02024084 +_08062F94: .4byte 0x02022fec +_08062F98: .4byte 0x00808000 +_08062F9C: + movs r4, 0x3 + movs r1, 0x6 + mov r10, r1 + b _08062FD2 +_08062FA4: + ldr r0, _08062FC4 + ldrb r0, [r0] + ldr r1, _08062FC8 + 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 + .align 2, 0 +_08062FC4: .4byte 0x02024064 +_08062FC8: .4byte 0x0202449c +_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, _08063074 + str r1, [sp, 0x4] + cmp r0, 0 + bne _08062FE6 + ldr r2, _08063078 + str r2, [sp, 0x4] +_08062FE6: + adds r5, r4, 0 + cmp r5, r10 + bge _080630AC + ldr r0, _0806307C + 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, _08063080 + 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, _08063084 + 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 + .align 2, 0 +_08063074: .4byte 0x02024744 +_08063078: .4byte 0x020244ec +_0806307C: .4byte 0x083203cc +_08063080: .4byte 0x0202406e +_08063084: .4byte 0x0202449c +_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, _08063118 + ldr r5, _0806311C + 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, _08063120 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + beq _08063106 + ldr r0, _08063124 + cmp r1, r0 + bne _08063128 +_08063106: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063128 + ldrb r0, [r5] + b _08063190 + .align 2, 0 +_08063118: .4byte 0x02024084 +_0806311C: .4byte 0x02024064 +_08063120: .4byte 0x02024250 +_08063124: .4byte 0x0000ffff +_08063128: + ldr r2, _08063154 + ldr r1, _08063158 + ldr r4, _0806315C + 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 + .align 2, 0 +_08063154: .4byte 0x0831c898 +_08063158: .4byte 0x02024250 +_0806315C: .4byte 0x02024064 +_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, _080631B4 + ldrb r0, [r0] +_08063190: + ldr r1, _080631B8 + 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 + .align 2, 0 +_080631B4: .4byte 0x02024064 +_080631B8: .4byte 0x0202449c + 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, _08063264 + 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, _08063268 + ldrb r1, [r0] + ldr r2, _0806326C + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08063256 + movs r4, 0 + ldr r6, _08063270 + 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, _08063264 + 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, _08063274 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806327C + b _080632FA + .align 2, 0 +_08063264: .4byte 0x02024064 +_08063268: .4byte 0x02024210 +_0806326C: .4byte 0x0832a328 +_08063270: .4byte 0x02024084 +_08063274: .4byte 0x02022fec +_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, _0806330C + ldrb r1, [r0] + ldr r2, _08063310 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080632FA + movs r4, 0 + ldr r6, _08063314 + 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, _08063318 + 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 + .align 2, 0 +_0806330C: .4byte 0x02024210 +_08063310: .4byte 0x0832a328 +_08063314: .4byte 0x02024084 +_08063318: .4byte 0x02024064 + 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, _0806335C + ldr r0, _08063360 + 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 + .align 2, 0 +_0806335C: .4byte 0x02024084 +_08063360: .4byte 0x02024064 + 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, _080633F4 + ldr r1, _080633F8 + 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, _080633FC + cmp r2, r0 + bne _08063398 + b _080635EE +_08063398: + ldr r0, _08063400 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080633A4 + b _080635EE +_080633A4: + ldr r2, _08063404 + 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, _08063408 + 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, _0806340C + ldrb r1, [r1] + ldr r2, _08063410 + 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 + .align 2, 0 +_080633F4: .4byte 0x02024250 +_080633F8: .4byte 0x02024064 +_080633FC: .4byte 0x0000ffff +_08063400: .4byte 0x02024270 +_08063404: .4byte 0x0831c898 +_08063408: .4byte 0x02022fec +_0806340C: .4byte 0x02024210 +_08063410: .4byte 0x0832a328 +_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, _08063454 + ldr r0, [r0] + ldr r1, _08063458 + ands r0, r1 + cmp r0, 0 + beq _08063490 + ldr r2, _0806345C + 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 + .align 2, 0 +_08063454: .4byte 0x02022fec +_08063458: .4byte 0x00808000 +_0806345C: .4byte 0x02024064 +_08063460: + movs r4, 0x3 + movs r1, 0x6 + str r1, [sp, 0x8] + b _08063498 +_08063468: + ldr r0, _08063488 + ldrb r0, [r0] + ldr r1, _0806348C + 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 + .align 2, 0 +_08063488: .4byte 0x02024064 +_0806348C: .4byte 0x0202449c +_08063490: + movs r4, 0 + movs r0, 0x6 + str r0, [sp, 0x8] + ldr r5, _080634B0 +_08063498: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _080634B4 + str r1, [sp, 0xC] + cmp r0, 0 + bne _080634AC + ldr r2, _080634B8 + str r2, [sp, 0xC] +_080634AC: + adds r6, r4, 0 + b _080635E6 + .align 2, 0 +_080634B0: .4byte 0x02024064 +_080634B4: .4byte 0x02024744 +_080634B8: .4byte 0x020244ec +_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, _0806354C + 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, _08063550 + 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, _08063554 + adds r0, r1 + ldrb r2, [r0, 0x17] + b _08063564 + .align 2, 0 +_0806354C: .4byte 0x0202406e +_08063550: .4byte 0x0202449c +_08063554: .4byte 0x083203cc +_08063558: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r2, _08063600 + adds r0, r2 + ldrb r2, [r0, 0x16] +_08063564: + ldr r1, _08063604 + ldr r5, _08063608 + 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, _0806360C + 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, _08063610 + 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 + .align 2, 0 +_08063600: .4byte 0x083203cc +_08063604: .4byte 0x02024250 +_08063608: .4byte 0x02024064 +_0806360C: .4byte 0x02024270 +_08063610: .4byte 0x02024084 + 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, _080636FC + ldr r4, _08063700 + 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, _08063704 + ands r0, r1 + cmp r0, 0 + beq _0806363E + b _0806386C +_0806363E: + ldr r0, _08063708 + 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, _0806370C + 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, _08063710 + ldrb r1, [r1] + ldr r2, _08063714 + 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 + .align 2, 0 +_080636FC: .4byte 0x02024084 +_08063700: .4byte 0x02024064 +_08063704: .4byte 0x0400e000 +_08063708: .4byte 0x020242ac +_0806370C: .4byte 0x02022fec +_08063710: .4byte 0x02024210 +_08063714: .4byte 0x0832a328 +_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, _08063754 + ldr r0, [r0] + ldr r1, _08063758 + ands r0, r1 + cmp r0, 0 + beq _08063768 + ldr r2, _0806375C + 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 + .align 2, 0 +_08063754: .4byte 0x02022fec +_08063758: .4byte 0x00808000 +_0806375C: .4byte 0x02024064 +_08063760: + movs r4, 0x3 + movs r0, 0x6 + mov r8, r0 + b _08063770 +_08063768: + movs r4, 0 + movs r1, 0x6 + mov r8, r1 + ldr r2, _08063858 +_08063770: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _0806385C + mov r9, r1 + cmp r0, 0 + bne _08063784 + ldr r0, _08063860 + 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, _08063864 + 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, _08063868 + 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 + .align 2, 0 +_08063858: .4byte 0x02024064 +_0806385C: .4byte 0x02024744 +_08063860: .4byte 0x020244ec +_08063864: .4byte 0x0202406e +_08063868: .4byte 0x0202449c +_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, _080638FC + 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, _08063900 + mov r8, r1 + cmp r0, 0 + bne _080638A8 + ldr r2, _08063904 + mov r8, r2 +_080638A8: + ldr r7, _08063908 + 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, _0806390C + 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 + .align 2, 0 +_080638FC: .4byte 0x02024064 +_08063900: .4byte 0x02024744 +_08063904: .4byte 0x020244ec +_08063908: .4byte 0x02022fec +_0806390C: .4byte 0x0202449c +_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, _08063948 + ldr r0, [r0] + ldr r1, _0806394C + ands r0, r1 + cmp r0, 0 + beq _08063958 + ldr r0, _08063950 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063954 + movs r0, 0 + movs r7, 0x3 + b _0806395C + .align 2, 0 +_08063948: .4byte 0x02022fec +_0806394C: .4byte 0x00808000 +_08063950: .4byte 0x02024064 +_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, _080639D0 + 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, _080639D4 + 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, _080639D8 + ldrb r0, [r0] + ldr r2, _080639D4 + ldr r1, [r2] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + strb r4, [r0] +_080639B8: + ldr r0, _080639D8 + 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 + .align 2, 0 +_080639D0: .4byte 0x0202406e +_080639D4: .4byte 0x0202449c +_080639D8: .4byte 0x02024064 +_080639DC: + bl sub_8063EE0 + lsls r0, 24 + cmp r0, 0 + bne _080639F8 +_080639E6: + ldr r0, _08063A04 + 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 + .align 2, 0 +_08063A04: .4byte 0x02024064 + 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, _08063A8C + 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 + .align 2, 0 +_08063A8C: .4byte 0x0831ace8 + 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, _08063AD0 + ldrb r2, [r4] + ldr r0, _08063AD4 + 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, _08063AD8 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + beq _08063AE0 + ldr r1, _08063ADC + lsls r0, r2, 1 + adds r0, r1 + ldrb r0, [r0] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _08063E50 + .align 2, 0 +_08063AD0: .4byte 0x02024064 +_08063AD4: .4byte 0x0202449c +_08063AD8: .4byte 0x02022fec +_08063ADC: .4byte 0x0202406e +_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, _08063B18 + ldrb r1, [r1] + ldr r2, _08063B1C + 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 + .align 2, 0 +_08063B18: .4byte 0x02024210 +_08063B1C: .4byte 0x0832a328 +_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, _08063B64 + ldrb r1, [r0] + ldr r2, _08063B68 + 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 + .align 2, 0 +_08063B64: .4byte 0x02024210 +_08063B68: .4byte 0x0832a328 +_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, _08063BAC + ldr r0, [r0] + ldr r1, _08063BB0 + ands r0, r1 + cmp r0, 0 + beq _08063BC2 + ldr r2, _08063BB4 + 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 + .align 2, 0 +_08063BAC: .4byte 0x02022fec +_08063BB0: .4byte 0x00808000 +_08063BB4: .4byte 0x02024064 +_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, _08063CB8 +_08063BCC: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, _08063CBC + str r4, [sp, 0x20] + cmp r0, 0 + bne _08063BE0 + ldr r0, _08063CC0 + 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, _08063CC4 + 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, _08063CC8 + 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, _08063CCC + 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, _08063CD0 + 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, _08063CD4 + 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 + .align 2, 0 +_08063CB8: .4byte 0x02024064 +_08063CBC: .4byte 0x02024744 +_08063CC0: .4byte 0x020244ec +_08063CC4: .4byte 0x0832a328 +_08063CC8: .4byte 0x0202406e +_08063CCC: .4byte 0x0202449c +_08063CD0: .4byte 0x083203cc +_08063CD4: .4byte 0x02024084 +_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, _08063D4C + 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, _08063D50 + adds r0, r1 + ldr r0, [r0] + mov r2, r9 + orrs r2, r0 + lsls r0, r2, 24 + lsrs r0, 24 + mov r9, r0 + b _08063D58 + .align 2, 0 +_08063D4C: .4byte 0x02024064 +_08063D50: .4byte 0x0832a328 +_08063D54: + movs r4, 0x3F + mov r9, r4 +_08063D58: + mov r0, r9 + cmp r0, 0x3F + beq _08063D60 + b _08063BE4 +_08063D60: + ldr r0, _08063E60 + movs r1, 0 + strh r1, [r0] + ldr r0, _08063E64 + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, _08063E68 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, _08063E6C + strb r1, [r0] + ldr r0, _08063E70 + 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, _08063E74 + 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, _08063E64 + 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, _08063E78 + mov r8, r0 + ldr r6, _08063E7C +_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, _08063E80 + 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 + .align 2, 0 +_08063E60: .4byte 0x02024400 +_08063E64: .4byte 0x0202449c +_08063E68: .4byte 0x02024474 +_08063E6C: .4byte 0x0202427c +_08063E70: .4byte 0x02024211 +_08063E74: .4byte 0x0202406e +_08063E78: .4byte 0x020241f0 +_08063E7C: .4byte 0x02024064 +_08063E80: .4byte 0x0831c898 + 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, _08063FC8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08063F12 + ldr r0, _08063FCC + 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, _08063FCC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r5, _08063FD0 + cmp r0, 0 + bne _08063F24 + ldr r5, _08063FD4 +_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, _08063FD8 + 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, _08063FDC + 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, _08063FE0 + ldr r0, [r0] + ldr r1, _08063FE4 + adds r5, r0, r1 + b _08063FEA + .align 2, 0 +_08063FC8: .4byte 0x02022fec +_08063FCC: .4byte 0x02024064 +_08063FD0: .4byte 0x02024744 +_08063FD4: .4byte 0x020244ec +_08063FD8: .4byte 0x020244a8 +_08063FDC: .4byte 0x0831e58c +_08063FE0: .4byte 0x03005d8c +_08063FE4: .4byte 0x00003214 +_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, _08064024 + ldrb r1, [r4] + lsrs r1, 1 + ldr r3, _08064028 + 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, _0806402C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08064024: .4byte 0x02024064 +_08064028: .4byte 0x0202449c +_0806402C: .4byte _08064030 + .align 2, 0 +_08064030: + .4byte _08064048 + .4byte _08064074 + .4byte _080640BC + .4byte _08064214 + .4byte _080642F4 + .4byte _0806437C +_08064048: + ldr r2, _0806406C + ldr r0, _08064070 + 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 + .align 2, 0 +_0806406C: .4byte 0x02024084 +_08064070: .4byte 0x02024064 +_08064074: + mov r0, r9 + movs r1, 0x4 + movs r2, 0x4 + bl _0806CDDC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08064088 + b _08064324 +_08064088: + ldr r2, _080640B4 + ldr r0, _080640B8 + 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 + .align 2, 0 +_080640B4: .4byte 0x02024084 +_080640B8: .4byte 0x02024064 +_080640BC: + ldr r3, _08064208 + ldrb r0, [r3] + lsrs r0, 1 + ldr r2, _0806420C + 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, _08064210 + 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, _08064210 + 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, _08064210 + 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, _08064210 + 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, _08064210 + 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, _08064210 + 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 + .align 2, 0 +_08064208: .4byte 0x02024064 +_0806420C: .4byte 0x0202449c +_08064210: .4byte 0x02024084 +_08064214: + ldr r4, _080642E8 + ldrb r0, [r4] + lsrs r0, 1 + ldr r3, _080642EC + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + movs r1, 0 + strb r1, [r0] + ldr r1, _080642F0 + 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 + .align 2, 0 +_080642E8: .4byte 0x02024064 +_080642EC: .4byte 0x0202449c +_080642F0: .4byte 0x020242bc +_080642F4: + ldr r4, _0806435C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08064360 + 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, _08064364 + 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, _0806435C + ldrb r0, [r0] + lsrs r0, 1 + ldr r1, _08064368 + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC0 + mov r1, r9 + strb r1, [r0] + ldr r0, _0806436C + 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 + .align 2, 0 +_0806435C: .4byte 0x02024064 +_08064360: .4byte 0x020242bc +_08064364: .4byte 0x02024294 +_08064368: .4byte 0x0202449c +_0806436C: .4byte 0x020244a8 +_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, _080643A4 + ldr r0, _080643A8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _080643AC + str r1, [r0] + bx lr + .align 2, 0 +_080643A4: .4byte 0x03005d60 +_080643A8: .4byte 0x02024064 +_080643AC: .4byte sub_80643B0 + 1 + thumb_func_end sub_8064394 + + thumb_func_start sub_80643B0 +sub_80643B0: @ 80643B0 + push {lr} + ldr r2, _080643E4 + ldr r1, _080643E8 + ldr r0, _080643EC + 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, _080643F0 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _080643F8 + ldr r0, _080643F4 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _080643FC + .align 2, 0 +_080643E4: .4byte 0x02024068 +_080643E8: .4byte 0x0832a328 +_080643EC: .4byte 0x02024064 +_080643F0: .4byte 0x02023064 +_080643F4: .4byte 0x0831c7b4 +_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, _08064428 + ldr r1, _0806442C + ldr r0, _08064430 + 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, _08064434 + cmp r1, r0 + bne _08064424 + bl sub_8065068 +_08064424: + pop {r0} + bx r0 + .align 2, 0 +_08064428: .4byte 0x02020630 +_0806442C: .4byte 0x020241e4 +_08064430: .4byte 0x02024064 +_08064434: .4byte nullsub_12 + 1 + thumb_func_end sub_8064400 + + thumb_func_start sub_8064438 +sub_8064438: @ 8064438 + push {lr} + ldr r2, _08064460 + ldr r1, _08064464 + ldr r0, _08064468 + 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, _0806446C + cmp r1, r0 + bne _0806445C + bl sub_8065068 +_0806445C: + pop {r0} + bx r0 + .align 2, 0 +_08064460: .4byte 0x02020630 +_08064464: .4byte 0x020241e4 +_08064468: .4byte 0x02024064 +_0806446C: .4byte nullsub_12 + 1 + thumb_func_end sub_8064438 + + thumb_func_start sub_8064470 +sub_8064470: @ 8064470 + push {r4-r6,lr} + ldr r5, _080644C8 + ldr r6, _080644CC + ldr r4, _080644D0 + 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, _080644D4 + 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 obj_delete_and_free_tiles + bl sub_8065068 +_080644C2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080644C8: .4byte 0x02020630 +_080644CC: .4byte 0x020241e4 +_080644D0: .4byte 0x02024064 +_080644D4: .4byte nullsub_12 + 1 + thumb_func_end sub_8064470 + + thumb_func_start sub_80644D8 +sub_80644D8: @ 80644D8 + push {r4,lr} + ldr r4, _08064518 + ldr r1, [r4] + ldr r3, _0806451C + 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 + .align 2, 0 +_08064518: .4byte 0x020244d0 +_0806451C: .4byte 0x02024064 + 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, _08064570 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064584 +_0806454C: + ldr r2, _08064574 + ldr r1, _08064578 + ldr r3, _0806457C + 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, _08064580 + adds r7, r3, 0 + cmp r1, r0 + bne _080645C2 + b _080645CA + .align 2, 0 +_08064570: .4byte 0x02022fec +_08064574: .4byte 0x02020630 +_08064578: .4byte 0x03005d70 +_0806457C: .4byte 0x02024064 +_08064580: .4byte nullsub_12 + 1 +_08064584: + ldr r3, _08064684 + ldr r6, _08064688 + ldr r2, _0806468C + 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, _08064690 + 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, _08064694 + mov r12, r1 + ldr r0, [r1] + ldr r7, _0806468C + 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, _08064698 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + b _080646F2 + .align 2, 0 +_08064684: .4byte 0x02020630 +_08064688: .4byte 0x03005d70 +_0806468C: .4byte 0x02024064 +_08064690: .4byte nullsub_12 + 1 +_08064694: .4byte 0x020244d0 +_08064698: .4byte 0x000027f9 +_0806469C: + ldr r3, _08064720 + 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, _08064724 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag +_080646F2: + ldr r0, _08064720 + ldr r0, [r0] + ldr r3, _08064728 + 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, _0806472C + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, _08064730 + str r1, [r0] +_08064714: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064720: .4byte 0x020244d0 +_08064724: .4byte 0x000027f9 +_08064728: .4byte 0x02024064 +_0806472C: .4byte 0x03005d60 +_08064730: .4byte sub_80644D8 + 1 + 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, _08064914 + ldr r0, [r5] + ldr r4, _08064918 + 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, _0806491C + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08064920 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08064776: + ldr r0, _08064924 + 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, _0806491C + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08064920 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_080647B4: + ldr r3, _08064914 + ldr r0, [r3] + ldr r2, _08064918 + 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, _08064924 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0806484A + ldr r4, _08064928 + mov r1, r9 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _0806491C + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08064920 + 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, _08064928 + ldr r4, _08064918 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _0806491C + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08064920 + 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, _08064914 + ldr r0, [r4] + ldr r3, _08064918 + 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, _08064924 + 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, _0806492C + bl m4aMPlayContinue + b _0806493C + .align 2, 0 +_08064914: .4byte 0x020244d0 +_08064918: .4byte 0x02024064 +_0806491C: .4byte 0x0202406e +_08064920: .4byte 0x02024744 +_08064924: .4byte 0x02022fec +_08064928: .4byte 0x03005d70 +_0806492C: .4byte 0x03007420 +_08064930: + ldr r0, _08064AD0 + ldr r1, _08064AD4 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_0806493C: + ldr r0, _08064AD8 + ldr r2, [r0] + ldr r0, _08064ADC + 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, _08064AE0 + ldr r0, _08064AE4 + ldr r5, _08064ADC + 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, _08064AE8 + cmp r4, r0 + beq _08064982 + b _08064AC0 +_08064982: + ldr r0, _08064AEC + 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, _08064AF0 + 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, _08064AD8 + 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, _08064AF0 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08064A3A + ldr r1, _08064AE4 + ldr r5, _08064ADC + 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, _08064AE0 + adds r0, r1 + bl obj_delete_and_free_tiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, _08064AF4 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08064AF8 + 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, _08064AE4 + ldr r4, _08064ADC + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08064AE0 + adds r0, r1 + bl obj_delete_and_free_tiles + ldrb r5, [r4] + ldr r1, _08064AF4 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08064AF8 + 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, _08064AD8 + 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, _08064AFC + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08064B00 + str r1, [r0] +_08064AC0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064AD0: .4byte 0x03007420 +_08064AD4: .4byte 0x0000ffff +_08064AD8: .4byte 0x020244d0 +_08064ADC: .4byte 0x02024064 +_08064AE0: .4byte 0x02020630 +_08064AE4: .4byte 0x03005d7c +_08064AE8: .4byte nullsub_12 + 1 +_08064AEC: .4byte 0x020241e4 +_08064AF0: .4byte 0x02022fec +_08064AF4: .4byte 0x0202406e +_08064AF8: .4byte 0x02024744 +_08064AFC: .4byte 0x03005d60 +_08064B00: .4byte sub_8064520 + 1 + thumb_func_end sub_8064734 + + thumb_func_start sub_8064B04 +sub_8064B04: @ 8064B04 + push {r4-r7,lr} + ldr r4, _08064B60 + ldr r0, _08064B64 + ldr r7, _08064B68 + 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, _08064B6C + cmp r1, r0 + bne _08064BB6 + adds r0, r2, r4 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08064BB6 + ldr r6, _08064B70 + 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, _08064B74 + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08064B78 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 + b _08064BB6 + .align 2, 0 +_08064B60: .4byte 0x02020630 +_08064B64: .4byte 0x020241e4 +_08064B68: .4byte 0x02024064 +_08064B6C: .4byte nullsub_12 + 1 +_08064B70: .4byte 0x020244d0 +_08064B74: .4byte 0x0202406e +_08064B78: .4byte 0x02024744 +_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, _08064BBC + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + bl sub_8065068 +_08064BB6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064BBC: .4byte 0x000027f9 + thumb_func_end sub_8064B04 + + thumb_func_start sub_8064BC0 +sub_8064BC0: @ 8064BC0 + push {r4-r6,lr} + ldr r6, _08064C00 + ldrb r0, [r6] + ldr r5, _08064C04 + 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 + .align 2, 0 +_08064C00: .4byte 0x02024064 +_08064C04: .4byte 0x03005d70 +_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, _08064C48 + ldr r0, _08064C4C + ldr r1, _08064C50 + 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, _08064C54 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_08064C42: + pop {r0} + bx r0 + .align 2, 0 +_08064C48: .4byte 0x02020630 +_08064C4C: .4byte 0x020241e4 +_08064C50: .4byte 0x02024064 +_08064C54: .4byte 0x03005d70 + thumb_func_end sub_8064C14 + + thumb_func_start sub_8064C58 +sub_8064C58: @ 8064C58 + push {r4-r6,lr} + ldr r0, _08064CB8 + ldr r0, [r0] + ldr r6, _08064CBC + 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, _08064CC0 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08064CC4 + 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 obj_delete_and_free_tiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, _08064CC8 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_08064CB2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08064CB8: .4byte 0x020244d0 +_08064CBC: .4byte 0x02024064 +_08064CC0: .4byte 0x020241e4 +_08064CC4: .4byte 0x02020630 +_08064CC8: .4byte 0x03005d70 + thumb_func_end sub_8064C58 + + thumb_func_start sub_8064CCC +sub_8064CCC: @ 8064CCC + push {lr} + movs r0, 0 + bl a_pressed_maybe + 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, _08064D20 + ldr r0, _08064D24 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _08064D28 + 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, _08064D2C + strb r3, [r0] + bl sub_8065068 + b _08064D5A + .align 2, 0 +_08064D20: .4byte 0x020241e4 +_08064D24: .4byte 0x02024064 +_08064D28: .4byte 0x02020630 +_08064D2C: .4byte 0x020244b9 +_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, _08064DB4 + ldr r0, _08064DB8 + ldr r4, _08064DBC + 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, _08064DC0 + cmp r1, r0 + bne _08064DAC + ldr r0, _08064DC4 + 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, _08064DC8 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _08064DCC + str r0, [r1] +_08064DAC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08064DB4: .4byte 0x02020630 +_08064DB8: .4byte 0x03005d70 +_08064DBC: .4byte 0x02024064 +_08064DC0: .4byte nullsub_12 + 1 +_08064DC4: .4byte 0x020244d0 +_08064DC8: .4byte 0x03005d60 +_08064DCC: .4byte sub_8064DD0 + 1 + thumb_func_end sub_8064D60 + + thumb_func_start sub_8064DD0 +sub_8064DD0: @ 8064DD0 + push {r4,lr} + ldr r0, _08064E30 + ldr r0, [r0] + ldr r4, _08064E34 + 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, _08064E38 + ldr r1, _08064E3C + 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, _08064E40 + cmp r1, r0 + beq _08064E1A + ldr r0, _08064E44 + cmp r1, r0 + bne _08064E2A +_08064E1A: + ldr r0, _08064E48 + ldr r1, _08064E4C + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl sub_8065068 +_08064E2A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08064E30: .4byte 0x020244d0 +_08064E34: .4byte 0x02024064 +_08064E38: .4byte 0x02020630 +_08064E3C: .4byte 0x020241e4 +_08064E40: .4byte nullsub_12 + 1 +_08064E44: .4byte nullsub_18 + 1 +_08064E48: .4byte 0x03007420 +_08064E4C: .4byte 0x0000ffff + thumb_func_end sub_8064DD0 + + thumb_func_start sub_8064E50 +sub_8064E50: @ 8064E50 + push {r4-r7,lr} + ldr r4, _08064F14 + ldr r0, [r4] + ldr r5, _08064F18 + 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, _08064F1C + ldr r6, _08064F20 + 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, _08064F24 + 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, _08064F28 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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 obj_anim_image_start + ldr r4, _08064F2C + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _08064F30 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08064F34 + 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, _08064F38 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08064F3C + str r1, [r0] +_08064F0C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064F14: .4byte 0x020244d0 +_08064F18: .4byte 0x02024064 +_08064F1C: .4byte 0x02020630 +_08064F20: .4byte 0x020241e4 +_08064F24: .4byte nullsub_12 + 1 +_08064F28: .4byte 0x000027f9 +_08064F2C: .4byte 0x03005d70 +_08064F30: .4byte 0x0202406e +_08064F34: .4byte 0x02024744 +_08064F38: .4byte 0x03005d60 +_08064F3C: .4byte sub_8064D60 + 1 + thumb_func_end sub_8064E50 + + thumb_func_start sub_8064F40 +sub_8064F40: @ 8064F40 + push {r4-r6,lr} + ldr r6, _08064FE4 + ldr r0, [r6] + ldr r5, _08064FE8 + 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, _08064FEC + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08064FF0 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08064F72: + ldr r4, _08064FF4 + ldr r0, _08064FF8 + 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, _08064FFC + 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 obj_delete_and_free_tiles + ldrb r4, [r5] + ldr r1, _08064FEC + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08064FF0 + 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, _08065000 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08065004 + str r1, [r0] +_08064FDC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08064FE4: .4byte 0x020244d0 +_08064FE8: .4byte 0x02024064 +_08064FEC: .4byte 0x0202406e +_08064FF0: .4byte 0x02024744 +_08064FF4: .4byte 0x02020630 +_08064FF8: .4byte 0x03005d7c +_08064FFC: .4byte nullsub_12 + 1 +_08065000: .4byte 0x03005d60 +_08065004: .4byte sub_8064E50 + 1 + thumb_func_end sub_8064F40 + + thumb_func_start sub_8065008 +sub_8065008: @ 8065008 + push {lr} + ldr r0, _08065030 + ldr r2, [r0] + ldr r0, _08065034 + 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 + .align 2, 0 +_08065030: .4byte 0x020244d0 +_08065034: .4byte 0x02024064 + thumb_func_end sub_8065008 + + thumb_func_start sub_8065038 +sub_8065038: @ 8065038 + push {lr} + ldr r0, _08065060 + ldr r2, [r0] + ldr r0, _08065064 + 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 + .align 2, 0 +_08065060: .4byte 0x020244d0 +_08065064: .4byte 0x02024064 + thumb_func_end sub_8065038 + + thumb_func_start sub_8065068 +sub_8065068: @ 8065068 + push {r4,lr} + sub sp, 0x4 + ldr r1, _080650A8 + ldr r4, _080650AC + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _080650B0 + str r1, [r0] + ldr r0, _080650B4 + 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, _080650B8 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _080650CE + .align 2, 0 +_080650A8: .4byte 0x03005d60 +_080650AC: .4byte 0x02024064 +_080650B0: .4byte sub_80643B0 + 1 +_080650B4: .4byte 0x02022fec +_080650B8: .4byte 0x02023064 +_080650BC: + ldr r2, _080650D8 + ldr r1, _080650DC + 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 + .align 2, 0 +_080650D8: .4byte 0x02024068 +_080650DC: .4byte 0x0832a328 + 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, _0806510C + ldr r0, _08065110 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08065118 + ldr r0, _08065114 + 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 + .align 2, 0 +_0806510C: .4byte 0x02023064 +_08065110: .4byte 0x02024064 +_08065114: .4byte 0x0202406e +_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, _08065188 + ldr r3, _0806518C + 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, _08065190 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08065188: .4byte 0x02023064 +_0806518C: .4byte 0x02024064 +_08065190: .4byte _08065194 + .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, _08065498 + 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, _08065498 + 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, _0806549C + 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, _080654A0 + 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, _080654A4 + 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 strcpy_limit_10_chars + 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 + .align 2, 0 +_08065498: .4byte 0x02024744 +_0806549C: .4byte 0xfffffc1f +_080654A0: .4byte 0xfff07fff +_080654A4: .4byte 0xfffffe0f +_080654A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080654B4 + adds r0, r1 + movs r1, 0xB + b _08065822 + .align 2, 0 +_080654B4: .4byte 0x02024744 +_080654B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080654C4 + adds r0, r1 + movs r1, 0xC + b _08065822 + .align 2, 0 +_080654C4: .4byte 0x02024744 +_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, _0806552C + 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, _0806552C + 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 + .align 2, 0 +_0806552C: .4byte 0x02024744 +_08065530: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065548 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _08065822 + .align 2, 0 +_08065548: .4byte 0x02024744 +_0806554C: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _08065584 + 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, _08065584 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _080658EA + .align 2, 0 +_08065584: .4byte 0x02024744 +_08065588: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080655A0 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _080658E2 + .align 2, 0 +_080655A0: .4byte 0x02024744 +_080655A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080655B0 + adds r0, r1 + movs r1, 0x1 + b _080655BE + .align 2, 0 +_080655B0: .4byte 0x02024744 +_080655B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080655E0 + 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 + .align 2, 0 +_080655E0: .4byte 0x02024744 +_080655E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080655F0 + adds r0, r1 + movs r1, 0x1A + b _080658E2 + .align 2, 0 +_080655F0: .4byte 0x02024744 +_080655F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065600 + adds r0, r1 + movs r1, 0x1B + b _080658E2 + .align 2, 0 +_08065600: .4byte 0x02024744 +_08065604: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065610 + adds r0, r1 + movs r1, 0x1C + b _080658E2 + .align 2, 0 +_08065610: .4byte 0x02024744 +_08065614: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065620 + adds r0, r1 + movs r1, 0x1D + b _080658E2 + .align 2, 0 +_08065620: .4byte 0x02024744 +_08065624: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065630 + adds r0, r1 + movs r1, 0x1E + b _080658E2 + .align 2, 0 +_08065630: .4byte 0x02024744 +_08065634: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065640 + adds r0, r1 + movs r1, 0x1F + b _080658E2 + .align 2, 0 +_08065640: .4byte 0x02024744 +_08065644: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065650 + adds r0, r1 + movs r1, 0x20 + b _080658E2 + .align 2, 0 +_08065650: .4byte 0x02024744 +_08065654: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065660 + adds r0, r1 + movs r1, 0x22 + b _080658E2 + .align 2, 0 +_08065660: .4byte 0x02024744 +_08065664: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065670 + adds r0, r1 + movs r1, 0x23 + b _080658E2 + .align 2, 0 +_08065670: .4byte 0x02024744 +_08065674: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065680 + adds r0, r1 + movs r1, 0x24 + b _080658E2 + .align 2, 0 +_08065680: .4byte 0x02024744 +_08065684: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065690 + adds r0, r1 + movs r1, 0x25 + b _080658E2 + .align 2, 0 +_08065690: .4byte 0x02024744 +_08065694: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080656A0 + adds r0, r1 + movs r1, 0x26 + b _080658E2 + .align 2, 0 +_080656A0: .4byte 0x02024744 +_080656A4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _080656F0 + 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 + .align 2, 0 +_080656F0: .4byte 0x02024744 +_080656F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065700 + adds r0, r1 + movs r1, 0x27 + b _080658E2 + .align 2, 0 +_08065700: .4byte 0x02024744 +_08065704: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065710 + adds r0, r1 + movs r1, 0x28 + b _080658E2 + .align 2, 0 +_08065710: .4byte 0x02024744 +_08065714: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065720 + adds r0, r1 + movs r1, 0x29 + b _080658E2 + .align 2, 0 +_08065720: .4byte 0x02024744 +_08065724: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065730 + adds r0, r1 + movs r1, 0x2A + b _080658E2 + .align 2, 0 +_08065730: .4byte 0x02024744 +_08065734: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065740 + adds r0, r1 + movs r1, 0x2B + b _080658E2 + .align 2, 0 +_08065740: .4byte 0x02024744 +_08065744: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065750 + adds r0, r1 + movs r1, 0x2C + b _080658E2 + .align 2, 0 +_08065750: .4byte 0x02024744 +_08065754: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065760 + adds r0, r1 + movs r1, 0 + b _0806577E + .align 2, 0 +_08065760: .4byte 0x02024744 +_08065764: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065770 + adds r0, r1 + movs r1, 0x9 + b _08065822 + .align 2, 0 +_08065770: .4byte 0x02024744 +_08065774: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080657A4 + 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 + .align 2, 0 +_080657A4: .4byte 0x02024744 +_080657A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080657B4 + adds r0, r1 + movs r1, 0x38 + b _080658E2 + .align 2, 0 +_080657B4: .4byte 0x02024744 +_080657B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080657C4 + adds r0, r1 + movs r1, 0x39 + b _08065822 + .align 2, 0 +_080657C4: .4byte 0x02024744 +_080657C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080657D4 + adds r0, r1 + movs r1, 0x3A + b _08065822 + .align 2, 0 +_080657D4: .4byte 0x02024744 +_080657D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080657E4 + adds r0, r1 + movs r1, 0x3B + b _08065822 + .align 2, 0 +_080657E4: .4byte 0x02024744 +_080657E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080657F4 + adds r0, r1 + movs r1, 0x3C + b _08065822 + .align 2, 0 +_080657F4: .4byte 0x02024744 +_080657F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065804 + adds r0, r1 + movs r1, 0x3D + b _08065822 + .align 2, 0 +_08065804: .4byte 0x02024744 +_08065808: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065814 + adds r0, r1 + movs r1, 0x3E + b _08065822 + .align 2, 0 +_08065814: .4byte 0x02024744 +_08065818: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065834 + 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 + .align 2, 0 +_08065834: .4byte 0x02024744 +_08065838: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065844 + adds r0, r1 + movs r1, 0x16 + b _080658E2 + .align 2, 0 +_08065844: .4byte 0x02024744 +_08065848: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065854 + adds r0, r1 + movs r1, 0x17 + b _080658E2 + .align 2, 0 +_08065854: .4byte 0x02024744 +_08065858: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065864 + adds r0, r1 + movs r1, 0x18 + b _080658E2 + .align 2, 0 +_08065864: .4byte 0x02024744 +_08065868: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065874 + adds r0, r1 + movs r1, 0x21 + b _080658E2 + .align 2, 0 +_08065874: .4byte 0x02024744 +_08065878: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065884 + adds r0, r1 + movs r1, 0x2F + b _080658E2 + .align 2, 0 +_08065884: .4byte 0x02024744 +_08065888: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065894 + adds r0, r1 + movs r1, 0x30 + b _080658E2 + .align 2, 0 +_08065894: .4byte 0x02024744 +_08065898: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080658A4 + adds r0, r1 + movs r1, 0x32 + b _080658E2 + .align 2, 0 +_080658A4: .4byte 0x02024744 +_080658A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080658B4 + adds r0, r1 + movs r1, 0x33 + b _080658E2 + .align 2, 0 +_080658B4: .4byte 0x02024744 +_080658B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080658C4 + adds r0, r1 + movs r1, 0x34 + b _080658E2 + .align 2, 0 +_080658C4: .4byte 0x02024744 +_080658C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080658D4 + adds r0, r1 + movs r1, 0x35 + b _080658E2 + .align 2, 0 +_080658D4: .4byte 0x02024744 +_080658D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080658FC + 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 + .align 2, 0 +_080658FC: .4byte 0x02024744 + 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, _08065930 + ldr r0, _08065934 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0806593C + ldr r0, _08065938 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8065964 + b _0806595A + .align 2, 0 +_08065930: .4byte 0x02023064 +_08065934: .4byte 0x02024064 +_08065938: .4byte 0x0202406e +_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, _0806599C + ldrb r0, [r3] + lsls r0, 9 + ldr r2, _080659A0 + 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, _080659A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806599C: .4byte 0x02024064 +_080659A0: .4byte 0x02023067 +_080659A4: .4byte _080659A8 + .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, _08065C2C + 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, _08065C2C + 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 + .align 2, 0 +_08065C2C: .4byte 0x02024744 +_08065C30: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065C48 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065C48: .4byte 0x02024744 +_08065C4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065C64 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065C64: .4byte 0x02024744 +_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, _08065CB8 + 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, _08065CB8 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065CB8: .4byte 0x02024744 +_08065CBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065CD4 + adds r0, r1 + ldr r3, _08065CD8 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08065D5A + .align 2, 0 +_08065CD4: .4byte 0x02024744 +_08065CD8: .4byte 0x02023064 +_08065CDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08065D40 + 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 + .align 2, 0 +_08065D40: .4byte 0x02024744 +_08065D44: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065D64 + adds r0, r1 + ldr r3, _08065D68 + 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 + .align 2, 0 +_08065D64: .4byte 0x02024744 +_08065D68: .4byte 0x02023064 +_08065D6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065D84 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065D84: .4byte 0x02024744 +_08065D88: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065DA0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065DA0: .4byte 0x02024744 +_08065DA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065DBC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065DBC: .4byte 0x02024744 +_08065DC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065DD8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065DD8: .4byte 0x02024744 +_08065DDC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065DF4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065DF4: .4byte 0x02024744 +_08065DF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065E10 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065E10: .4byte 0x02024744 +_08065E14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065E2C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065E2C: .4byte 0x02024744 +_08065E30: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065E48 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065E48: .4byte 0x02024744 +_08065E4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065E64 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065E64: .4byte 0x02024744 +_08065E68: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065E80 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065E80: .4byte 0x02024744 +_08065E84: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065E9C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065E9C: .4byte 0x02024744 +_08065EA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065EB8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065EB8: .4byte 0x02024744 +_08065EBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065ED4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065ED4: .4byte 0x02024744 +_08065ED8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065EF0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065EF0: .4byte 0x02024744 +_08065EF4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08065F64 + 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 + .align 2, 0 +_08065F64: .4byte 0x02024744 +_08065F68: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065F80 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065F80: .4byte 0x02024744 +_08065F84: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065F9C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065F9C: .4byte 0x02024744 +_08065FA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065FB8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065FB8: .4byte 0x02024744 +_08065FBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065FD4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065FD4: .4byte 0x02024744 +_08065FD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08065FF0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08065FF0: .4byte 0x02024744 +_08065FF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0806600C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08066002: + movs r1, 0x2C + bl pokemon_setattr + b _08066270 + .align 2, 0 +_0806600C: .4byte 0x02024744 +_08066010: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066028 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066028: .4byte 0x02024744 +_0806602C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066044 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066044: .4byte 0x02024744 +_08066048: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066060 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066060: .4byte 0x02024744 +_08066064: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0806607C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_0806607C: .4byte 0x02024744 +_08066080: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066098 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066098: .4byte 0x02024744 +_0806609C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080660B4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _08066270 + .align 2, 0 +_080660B4: .4byte 0x02024744 +_080660B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080660D0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _08066270 + .align 2, 0 +_080660D0: .4byte 0x02024744 +_080660D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080660EC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _08066270 + .align 2, 0 +_080660EC: .4byte 0x02024744 +_080660F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066108 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066108: .4byte 0x02024744 +_0806610C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066124 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066124: .4byte 0x02024744 +_08066128: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066140 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066140: .4byte 0x02024744 +_08066144: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0806615C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_0806615C: .4byte 0x02024744 +_08066160: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066178 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066178: .4byte 0x02024744 +_0806617C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066194 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066194: .4byte 0x02024744 +_08066198: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080661B0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_080661B0: .4byte 0x02024744 +_080661B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080661CC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _08066270 + .align 2, 0 +_080661CC: .4byte 0x02024744 +_080661D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _080661E8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_080661E8: .4byte 0x02024744 +_080661EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066204 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066204: .4byte 0x02024744 +_08066208: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066220 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066220: .4byte 0x02024744 +_08066224: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0806623C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_0806623C: .4byte 0x02024744 +_08066240: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066258 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _08066270 + .align 2, 0 +_08066258: .4byte 0x02024744 +_0806625C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08066280 + 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 + .align 2, 0 +_08066280: .4byte 0x02024744 + thumb_func_end sub_8065964 + + thumb_func_start sub_8066284 +sub_8066284: @ 8066284 + push {r4-r7,lr} + ldr r1, _080662E8 + ldr r7, _080662EC + 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, _080662F0 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _080662F4 + 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 + .align 2, 0 +_080662E8: .4byte 0x0202406e +_080662EC: .4byte 0x02024064 +_080662F0: .4byte 0x02023064 +_080662F4: .4byte 0x02024744 + 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, _08066420 + ldr r6, _08066424 + 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, _08066428 + 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, _0806642C + 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 obj_add_from_template_forward_search + ldr r4, _08066430 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, _08066434 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08066438 + 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, _0806643C + adds r2, r1 + ldrb r1, [r2] + bl obj_anim_image_start + 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, _08066440 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066444 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066420: .4byte 0x0202406e +_08066424: .4byte 0x02024064 +_08066428: .4byte 0x02024744 +_0806642C: .4byte 0x0202499c +_08066430: .4byte 0x020241e4 +_08066434: .4byte 0x02020630 +_08066438: .4byte 0x0000ff10 +_0806643C: .4byte 0x020244e4 +_08066440: .4byte 0x03005d60 +_08066444: .4byte sub_8064B04 + 1 + thumb_func_end sub_80662F8 + + thumb_func_start sub_8066448 +sub_8066448: @ 8066448 + push {r4,lr} + ldr r1, _08066480 + ldr r4, _08066484 + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, _08066488 + 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, _0806648C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066490 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08066480: .4byte 0x0202406e +_08066484: .4byte 0x02024064 +_08066488: .4byte 0x02023064 +_0806648C: .4byte 0x03005d60 +_08066490: .4byte sub_8064F40 + 1 + 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, _080665FC + lsls r4, r6, 1 + adds r4, r0 + ldr r0, _08066600 + 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, _08066604 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _08066608 + bl object_new_hidden_with_callback + ldr r1, _0806660C + 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, _08066610 + 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 obj_add_from_template_forward_search + ldr r4, _08066614 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _08066618 + 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, _0806661C + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _08066620 + 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 + .align 2, 0 +_080665FC: .4byte 0x0202406e +_08066600: .4byte 0x02023064 +_08066604: .4byte 0x02024744 +_08066608: .4byte sub_805D714 + 1 +_0806660C: .4byte 0x03005d7c +_08066610: .4byte 0x0202499c +_08066614: .4byte 0x020241e4 +_08066618: .4byte 0x02020630 +_0806661C: .4byte 0x020244e4 +_08066620: .4byte nullsub_12 + 1 + thumb_func_end sub_8066494 + + thumb_func_start sub_8066624 +sub_8066624: @ 8066624 + push {r4-r6,lr} + ldr r1, _08066658 + ldr r6, _0806665C + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0806666C + ldr r0, _08066660 + 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, _08066664 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066668 + str r1, [r0] + b _080666A8 + .align 2, 0 +_08066658: .4byte 0x02023064 +_0806665C: .4byte 0x02024064 +_08066660: .4byte 0x020244d0 +_08066664: .4byte 0x03005d60 +_08066668: .4byte sub_80666BC + 1 +_0806666C: + ldr r5, _080666B0 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _080666B4 + 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 obj_delete_and_free_tiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, _080666B8 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_080666A8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080666B0: .4byte 0x020241e4 +_080666B4: .4byte 0x02020630 +_080666B8: .4byte 0x03005d70 + thumb_func_end sub_8066624 + + thumb_func_start sub_80666BC +sub_80666BC: @ 80666BC + push {r4-r6,lr} + ldr r6, _080666DC + ldr r4, [r6] + ldr r5, _080666E0 + 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 + .align 2, 0 +_080666DC: .4byte 0x020244d0 +_080666E0: .4byte 0x02024064 +_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, _08066740 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066744 + str r1, [r0] +_0806673A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08066740: .4byte 0x03005d60 +_08066744: .4byte sub_8064C58 + 1 + 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, _08066788 + ldr r0, [r4] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08066840 + ldr r5, _0806678C + 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, _08066790 + b _08066796 + .align 2, 0 +_08066788: .4byte 0x02022fec +_0806678C: .4byte 0x02024064 +_08066790: .4byte 0x02038bca +_08066794: + ldr r0, _080667A4 +_08066796: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + b _0806694C + .align 2, 0 +_080667A4: .4byte 0x02038bcc +_080667A8: + ldrb r0, [r5] + bl sub_806D864 + ldr r6, _080667F0 + 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 + .align 2, 0 +_080667F0: .4byte 0x020229e8 +_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, _08066854 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _08066858 + bl sub_8068B48 + b _08066948 + .align 2, 0 +_08066854: .4byte 0x02038bca +_08066858: + bl link_get_multiplayer_id + ldr r6, _080668B4 + 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, _080668B8 + adds r0, 0x4F + ldrb r0, [r0] + b _0806694C + .align 2, 0 +_080668B4: .4byte 0x020229e8 +_080668B8: .4byte 0x0831f578 +_080668BC: + ldr r0, _080668C4 + adds r0, 0x4E + ldrb r0, [r0] + b _0806694C + .align 2, 0 +_080668C4: .4byte 0x0831f578 +_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, _08066920 + adds r0, 0x51 + ldrb r0, [r0] + b _0806694C + .align 2, 0 +_08066920: .4byte 0x0831f578 +_08066924: + ldr r0, _0806692C + adds r0, 0x50 + ldrb r0, [r0] + b _0806694C + .align 2, 0 +_0806692C: .4byte 0x0831f578 +_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, _08066A30 + 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, _08066A34 + mov r9, r7 + ldr r1, _08066A38 + 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 obj_add_from_template_forward_search + ldr r6, _08066A3C + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _08066A40 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08066A44 + 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, _08066A48 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + 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, _08066A4C + str r1, [r0] + ldr r1, _08066A50 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066A54 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066A30: .4byte 0x02024064 +_08066A34: .4byte 0x0202499c +_08066A38: .4byte 0x083054e0 +_08066A3C: .4byte 0x020241e4 +_08066A40: .4byte 0x02020630 +_08066A44: .4byte 0x0000ff10 +_08066A48: .4byte 0x0830593c +_08066A4C: .4byte sub_805D7AC + 1 +_08066A50: .4byte 0x03005d60 +_08066A54: .4byte sub_8064400 + 1 + thumb_func_end sub_8066748 + + thumb_func_start sub_8066A58 +sub_8066A58: @ 8066A58 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _08066A6C + ldrb r0, [r0] + cmp r0, 0x1 + bne _08066A74 + ldr r0, _08066A70 + b _08066A76 + .align 2, 0 +_08066A6C: .4byte 0x02024064 +_08066A70: .4byte 0x02038bca +_08066A74: + ldr r0, _08066B68 +_08066A76: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, _08066B6C + 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, _08066B70 + ldr r2, _08066B74 + 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 obj_add_from_template_forward_search + ldr r5, _08066B78 + ldrb r1, [r6] + adds r1, r5 + strb r0, [r1] + ldr r4, _08066B7C + 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, _08066B80 + strh r1, [r0, 0x2E] + ldr r1, _08066B84 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + 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, _08066B88 + str r1, [r0] + ldr r1, _08066B8C + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066B90 + str r1, [r0] + bl sub_8065068 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08066B68: .4byte 0x02038bcc +_08066B6C: .4byte 0x02024064 +_08066B70: .4byte 0x0202499c +_08066B74: .4byte 0x083054e0 +_08066B78: .4byte 0x020241e4 +_08066B7C: .4byte 0x02020630 +_08066B80: .4byte 0x0000fffe +_08066B84: .4byte 0x0830593c +_08066B88: .4byte sub_805D7AC + 1 +_08066B8C: .4byte 0x03005d60 +_08066B90: .4byte sub_8064438 + 1 + thumb_func_end sub_8066A58 + + thumb_func_start sub_8066B94 +sub_8066B94: @ 8066B94 + push {r4-r6,lr} + ldr r6, _08066C24 + ldr r4, _08066C28 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _08066C2C + 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, _08066C30 + 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, _08066C34 + bl oamt_set_x3A_32 + ldr r1, _08066C38 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066C3C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08066C24: .4byte 0x020241e4 +_08066C28: .4byte 0x02024064 +_08066C2C: .4byte 0x02020630 +_08066C30: .4byte sub_80A6EEC + 1 +_08066C34: .4byte nullsub_12 + 1 +_08066C38: .4byte 0x03005d60 +_08066C3C: .4byte sub_8064470 + 1 + thumb_func_end sub_8066B94 + + thumb_func_start sub_8066C40 +sub_8066C40: @ 8066C40 + push {r4-r6,lr} + ldr r6, _08066C8C + ldr r4, [r6] + ldr r5, _08066C90 + 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 + .align 2, 0 +_08066C8C: .4byte 0x020244d0 +_08066C90: .4byte 0x02024064 +_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, _08066CD8 + ldr r1, _08066CDC + 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, _08066CE0 + str r1, [r0] + ldr r1, _08066CE4 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066CE8 + str r1, [r0] +_08066CD0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08066CD8: .4byte 0x02020630 +_08066CDC: .4byte 0x020241e4 +_08066CE0: .4byte sub_8039934 + 1 +_08066CE4: .4byte 0x03005d60 +_08066CE8: .4byte sub_8064C14 + 1 + 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, _08066E0C + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08066D32 + b _08066E58 +_08066D32: + ldr r0, _08066E10 + 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, _08066E14 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, _08066E18 + 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, _08066E1C + 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, _08066E20 + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, _08066E24 + 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, _08066E28 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, _08066E2C + 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 + .align 2, 0 +_08066E0C: .4byte 0x02024064 +_08066E10: .4byte 0x02023064 +_08066E14: .4byte 0x02038432 +_08066E18: .4byte 0x02038408 +_08066E1C: .4byte 0x02038404 +_08066E20: .4byte 0x0203841a +_08066E24: .4byte 0x0203841c +_08066E28: .4byte 0x02038400 +_08066E2C: .4byte 0x020244bc +_08066E30: + ldr r0, _08066E64 + 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, _08066E68 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08066E6C + 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 + .align 2, 0 +_08066E64: .4byte 0x020244d0 +_08066E68: .4byte 0x03005d60 +_08066E6C: .4byte sub_8066E70 + 1 + 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, _08066EBC + ldr r6, _08066EC0 + 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, _08066EC4 + 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 + .align 2, 0 +_08066EBC: .4byte 0x02023064 +_08066EC0: .4byte 0x02024064 +_08066EC4: .4byte 0x020244d0 +_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, _08066F98 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _08066F9C + 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, _08066FA0 + ldr r2, [r0] + ldr r0, _08066FA4 + 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 + .align 2, 0 +_08066F98: .4byte 0x020383f8 +_08066F9C: .4byte 0x020383fd +_08066FA0: .4byte 0x020244d0 +_08066FA4: .4byte 0x02024064 +_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, _08067030 + movs r1, 0 + strh r1, [r0] + ldr r0, _08067034 + strh r1, [r0] + ldr r5, _08067038 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, _0806703C + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, _08067040 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _08067044 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08067048 + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08067030: .4byte 0x02022e14 +_08067034: .4byte 0x02022e16 +_08067038: .4byte 0x02024064 +_0806703C: .4byte 0x02023066 +_08067040: .4byte 0x02022e2c +_08067044: .4byte 0x03005d60 +_08067048: .4byte sub_8064CCC + 1 + 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, _08067118 + ldr r0, _0806711C + 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, _08067120 + cmp r7, r0 + beq _08067130 + ldr r6, _08067124 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _08067128 + 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, _0806712C + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0806715A + .align 2, 0 +_08067118: .4byte 0x02023064 +_0806711C: .4byte 0x02024064 +_08067120: .4byte 0x00007fff +_08067124: .4byte 0x0202406e +_08067128: .4byte 0x02024744 +_0806712C: .4byte 0x03005d70 +_08067130: + ldr r1, _08067178 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0806717C + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, _08067180 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0806715A: + ldr r1, _08067184 + ldr r0, _08067188 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0806718C + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067178: .4byte 0x0202406e +_0806717C: .4byte 0x02024744 +_08067180: .4byte 0x03005d70 +_08067184: .4byte 0x03005d60 +_08067188: .4byte 0x02024064 +_0806718C: .4byte sub_8064BC0 + 1 + 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, _080671F8 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _080671F0 + ldr r0, _080671FC + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _08067200 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08067204 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _08067208 + 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, _0806720C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08067210 + str r1, [r0] +_080671F0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080671F8: .4byte 0x02024064 +_080671FC: .4byte 0x03005d70 +_08067200: .4byte 0x0202406e +_08067204: .4byte 0x02024744 +_08067208: .4byte 0x020244d0 +_0806720C: .4byte 0x03005d60 +_08067210: .4byte sub_8065008 + 1 + thumb_func_end sub_806719C + + thumb_func_start sub_8067214 +sub_8067214: @ 8067214 + push {r4,r5,lr} + ldr r5, _0806726C + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08067264 + ldr r4, _08067270 + 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, _08067274 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08067278 + str r1, [r0] +_08067264: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806726C: .4byte 0x02024064 +_08067270: .4byte 0x02023064 +_08067274: .4byte 0x03005d60 +_08067278: .4byte sub_8065008 + 1 + 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, _08067300 + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .align 2, 0 +_08067300: .4byte 0x02022d0c + thumb_func_end sub_80672E8 + + thumb_func_start sub_8067304 +sub_8067304: @ 8067304 + push {lr} + ldr r3, _08067330 + ldr r1, _08067334 + ldr r0, _08067338 + 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 + .align 2, 0 +_08067330: .4byte 0x02022d0c +_08067334: .4byte 0x02023064 +_08067338: .4byte 0x02024064 + thumb_func_end sub_8067304 + + thumb_func_start sub_806733C +sub_806733C: @ 806733C + push {lr} + ldr r2, _08067350 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .align 2, 0 +_08067350: .4byte 0x02022d0c + thumb_func_end sub_806733C + + thumb_func_start sub_8067354 +sub_8067354: @ 8067354 + push {lr} + ldr r3, _08067378 + 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 + .align 2, 0 +_08067378: .4byte 0x02022d0c + thumb_func_end sub_8067354 + + thumb_func_start sub_806737C +sub_806737C: @ 806737C + push {r4,lr} + ldr r3, _080673A4 + ldr r2, _080673A8 + ldr r4, _080673AC + 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 + .align 2, 0 +_080673A4: .4byte 0x02020630 +_080673A8: .4byte 0x020241e4 +_080673AC: .4byte 0x02024064 +_080673B0: + ldr r1, _080673E0 + 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, _080673E4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _080673E8 + str r1, [r0] +_080673DA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080673E0: .4byte 0x020244b9 +_080673E4: .4byte 0x03005d60 +_080673E8: .4byte sub_8064CE4 + 1 + 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, _08067434 + 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, _08067438 + 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 + .align 2, 0 +_08067434: .4byte 0x02024064 +_08067438: .4byte 0x02023064 + thumb_func_end sub_80673F8 + + thumb_func_start sub_806743C +sub_806743C: @ 806743C + push {r4,r5,lr} + ldr r4, _08067470 + ldr r5, _08067474 + 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 + .align 2, 0 +_08067470: .4byte 0x02023064 +_08067474: .4byte 0x02024064 +_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, _080674C8 + ldr r0, _080674CC + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080674D0 + 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 + .align 2, 0 +_080674C8: .4byte 0x0202406e +_080674CC: .4byte 0x02024064 +_080674D0: .4byte 0x02024744 + thumb_func_end sub_8067498 + + thumb_func_start sub_80674D4 +sub_80674D4: @ 80674D4 + push {lr} + ldr r1, _080674FC + ldr r0, _08067500 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _08067504 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .align 2, 0 +_080674FC: .4byte 0x02023064 +_08067500: .4byte 0x02024064 +_08067504: .4byte 0x020243fc + thumb_func_end sub_80674D4 + + thumb_func_start sub_8067508 +sub_8067508: @ 8067508 + push {r4-r6,lr} + ldr r5, _080675E8 + ldr r6, _080675EC + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _080675F0 + 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, _080675F4 + 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, _080675F8 + bl oamt_set_x3A_32 + ldr r0, _080675FC + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08067600 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, _08067604 + 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, _08067608 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _0806760C + 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, _08067610 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08067614 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080675E8: .4byte 0x020241e4 +_080675EC: .4byte 0x02024064 +_080675F0: .4byte 0x02020630 +_080675F4: .4byte sub_80A6EEC + 1 +_080675F8: .4byte sub_80676FC + 1 +_080675FC: .4byte c3_08038DC4 + 1 +_08067600: .4byte 0x03005e00 +_08067604: .4byte 0x020244d0 +_08067608: .4byte 0x020244b4 +_0806760C: .4byte sub_8073C30 + 1 +_08067610: .4byte 0x03005d60 +_08067614: .4byte nullsub_28 + 1 + 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, _08067670 + ldrb r0, [r7] + mov r9, r0 + ldr r1, _08067674 + 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, _08067678 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08067684 +_08067652: + ldr r0, _0806767C + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _08067680 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_8066494 + b _080676C4 + .align 2, 0 +_08067670: .4byte 0x02024064 +_08067674: .4byte 0x03005e00 +_08067678: .4byte 0x02022fec +_0806767C: .4byte 0x02023064 +_08067680: .4byte 0x0202406e +_08067684: + ldr r4, _080676E8 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, _080676EC + 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, _080676F0 + ldr r2, _080676F4 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _080676F8 + 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 + .align 2, 0 +_080676E8: .4byte 0x02023064 +_080676EC: .4byte 0x0202406e +_080676F0: .4byte 0x03005d60 +_080676F4: .4byte 0x02024064 +_080676F8: .4byte sub_8064734 + 1 + 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 obj_delete_and_free_tiles + 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, _08067740 + ldr r0, _08067744 + 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 + .align 2, 0 +_08067740: .4byte 0x02023064 +_08067744: .4byte 0x02024064 +_08067748: + ldr r4, _080677A0 + ldr r0, [r4] + ldr r3, _080677A4 + 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, _080677A8 + 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 + .align 2, 0 +_080677A0: .4byte 0x020244d0 +_080677A4: .4byte 0x02024064 +_080677A8: .4byte 0x02023064 +_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, _08067818 + 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, _0806781C + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, _08067820 + 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, _08067824 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, _08067828 + str r0, [r1] +_08067812: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067818: .4byte 0x02023068 +_0806781C: .4byte 0x020244b4 +_08067820: .4byte 0x020244d0 +_08067824: .4byte 0x03005d60 +_08067828: .4byte sub_806782C + 1 + thumb_func_end sub_8067718 + + thumb_func_start sub_806782C +sub_806782C: @ 806782C + push {r4,lr} + ldr r4, _0806786C + ldr r0, [r4] + ldr r3, _08067870 + 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 + .align 2, 0 +_0806786C: .4byte 0x020244d0 +_08067870: .4byte 0x02024064 + thumb_func_end sub_806782C + + thumb_func_start sub_8067874 +sub_8067874: @ 8067874 + push {lr} + ldr r0, _080678B0 + ldr r1, [r0] + ldr r0, _080678B4 + 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, _080678B8 + ldr r0, _080678BC + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _080678C0 + str r1, [r0] +_080678A6: + bl sub_8065068 + pop {r0} + bx r0 + .align 2, 0 +_080678B0: .4byte 0x020244d0 +_080678B4: .4byte 0x02024064 +_080678B8: .4byte 0x03005e00 +_080678BC: .4byte 0x020244b4 +_080678C0: .4byte sub_8073C30 + 1 + 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, _08067920 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08067916 + ldr r3, _08067924 + ldr r0, _08067928 + 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, _0806792C + 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 + .align 2, 0 +_08067920: .4byte 0x02024064 +_08067924: .4byte 0x02020630 +_08067928: .4byte 0x020241e4 +_0806792C: .4byte 0x02023064 + thumb_func_end sub_80678D0 + + thumb_func_start sub_8067930 +sub_8067930: @ 8067930 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _08067978 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08067992 + ldr r4, _0806797C + 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 + .align 2, 0 +_08067978: .4byte 0x02024064 +_0806797C: .4byte 0x02023064 +_08067980: + ldr r0, _0806799C + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _080679A0 + str r0, [r1] +_0806798C: + adds r0, r6, 0 + bl sub_817E32C +_08067992: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0806799C: .4byte 0x03005d60 +_080679A0: .4byte sub_8065038 + 1 + thumb_func_end sub_8067930 + + thumb_func_start sub_80679A4 +sub_80679A4: @ 80679A4 + push {lr} + ldr r0, _080679BC + ldrb r0, [r0] + lsls r0, 9 + ldr r1, _080679C0 + adds r0, r1 + bl sub_81851A8 + bl sub_8065068 + pop {r0} + bx r0 + .align 2, 0 +_080679BC: .4byte 0x02024064 +_080679C0: .4byte 0x02023066 + 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, _080679F4 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, _080679F8 + 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, _080679FC + strb r2, [r0] + b _08067A08 + .align 2, 0 +_080679F4: .4byte 0x02024064 +_080679F8: .4byte 0x02023068 +_080679FC: .4byte 0x0202433a +_08067A00: + ldr r0, _08067A54 + movs r1, 0x3 + eors r1, r2 + strb r1, [r0] +_08067A08: + ldr r0, _08067A58 + ldr r3, [r0] + ldr r1, _08067A5C + ldr r4, _08067A60 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08067A64 + 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, _08067A68 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08067A6C + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08067A54: .4byte 0x0202433a +_08067A58: .4byte 0x03005d90 +_08067A5C: .4byte 0x02023064 +_08067A60: .4byte 0x02024064 +_08067A64: .4byte 0x00000ca9 +_08067A68: .4byte 0x03005d60 +_08067A6C: .4byte sub_80587B0 + 1 + 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 +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 +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 +zero_player_party_data: @ 8067B0C + push {r4,r5,lr} + ldr r4, _08067B28 + 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 + .align 2, 0 +_08067B28: .4byte 0x020244ec + 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, _08067B48 + 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 + .align 2, 0 +_08067B48: .4byte 0x02024744 + thumb_func_end zero_enemy_party_data + + thumb_func_start create_pokemon_set_level +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 +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, _08067C5C + mov r8, r2 + ldr r6, _08067C60 +_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 + .align 2, 0 +_08067C5C: .4byte 0xffff0000 +_08067C60: .4byte 0x0000ffff +_08067C64: + mov r0, r10 + cmp r0, 0x1 + bne _08067C70 + ldr r0, [sp, 0x4C] + str r0, [sp, 0x18] + b _08067C8A +_08067C70: + ldr r0, _08067DB4 + 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 get_pokemon_name + adds r0, r7, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr_encrypted + ldr r2, _08067DB8 + adds r0, r7, 0 + movs r1, 0x3 + bl pokemon_setattr_encrypted + ldr r5, _08067DB4 + 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, _08067DBC + 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, _08067DC0 + 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, _08067DC4 + 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 + .align 2, 0 +_08067DB4: .4byte 0x03005d90 +_08067DB8: .4byte 0x082e9531 +_08067DBC: .4byte 0x083203cc +_08067DC0: .4byte 0x0831f72c +_08067DC4: .4byte 0x082e9530 +_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, _08067E8C + 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 + .align 2, 0 +_08067E8C: .4byte 0x083203cc + 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 getNature + 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 getNature + 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 getNature + 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 gf_strcpy + 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 sub_8009370 + 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, _0806836C + ldr r0, [r0] + ldr r1, _08068370 + 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 + .align 2, 0 +_0806836C: .4byte 0x03005d90 +_08068370: .4byte 0x00000ca9 +_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 gf_strcpy + 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 sub_8009370 + 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, _08068630 + 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 + .align 2, 0 +_08068630: .4byte 0x08610970 + 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 getNature + 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, _0806889C + 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, _080688A0 + 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, _080688A4 + 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 + .align 2, 0 +_0806889C: .4byte 0xfffffc1f +_080688A0: .4byte 0xfff07fff +_080688A4: .4byte 0xfffffe0f + 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, _08068910 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08068910: .4byte _08068914 + .align 2, 0 +_08068914: + .4byte _080689CE + .4byte _0806892C + .4byte _08068A00 + .4byte _08068958 + .4byte _08068A00 + .4byte _08068990 +_0806892C: + ldr r0, _0806894C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080689CE + ldr r0, _08068950 + ldr r1, _08068954 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080689CE + b _080689B6 + .align 2, 0 +_0806894C: .4byte 0x02022fec +_08068950: .4byte 0x030022c0 +_08068954: .4byte 0x00000439 +_08068958: + ldr r0, _08068984 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080689CE + ldr r0, _08068988 + ldr r1, _0806898C + 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 + .align 2, 0 +_08068984: .4byte 0x02022fec +_08068988: .4byte 0x030022c0 +_0806898C: .4byte 0x00000439 +_08068990: + ldr r0, _080689D4 + ldr r2, [r0] + movs r3, 0x2 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _080689E4 + ldr r0, _080689D8 + ldr r1, _080689DC + 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, _080689E0 + 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 + .align 2, 0 +_080689D4: .4byte 0x02022fec +_080689D8: .4byte 0x030022c0 +_080689DC: .4byte 0x00000439 +_080689E0: .4byte 0x020229e8 +_080689E4: + ldr r0, _08068A08 + ldr r1, _08068A0C + 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 + .align 2, 0 +_08068A08: .4byte 0x030022c0 +_08068A0C: .4byte 0x00000439 + 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, _08068A38 + 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 + .align 2, 0 +_08068A38: .4byte 0x02022fec +_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, _08068AA0 + 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 get_nature + 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 + .align 2, 0 +_08068AA0: .4byte 0x08329d48 + 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, _08068B44 + 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 + .align 2, 0 +_08068B44: .4byte 0x020244ec + thumb_func_end sub_8068AA4 + + thumb_func_start sub_8068B48 +sub_8068B48: @ 8068B48 + push {lr} + ldr r0, _08068B64 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08068B6C + ldr r0, _08068B68 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + b _08068B78 + .align 2, 0 +_08068B64: .4byte 0x02022fec +_08068B68: .4byte 0x0203c7b4 +_08068B6C: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 +_08068B78: + ldr r3, _08068BA8 + 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, _08068BAC + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + bl sub_806EFF0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_08068BA8: .4byte 0x020229e8 +_08068BAC: .4byte 0x08329d54 + thumb_func_end sub_8068B48 + + thumb_func_start sub_8068BB0 +sub_8068BB0: @ 8068BB0 + push {lr} + ldr r0, _08068BCC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08068BD4 + ldr r0, _08068BD0 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + b _08068BE0 + .align 2, 0 +_08068BCC: .4byte 0x02022fec +_08068BD0: .4byte 0x0203c7b4 +_08068BD4: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 +_08068BE0: + ldr r3, _08068C0C + 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, _08068C10 + ldr r0, _08068C14 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_08068C0C: .4byte 0x020229e8 +_08068C10: .4byte 0x0831f5ca +_08068C14: .4byte 0x08329d54 + thumb_func_end sub_8068BB0 + + thumb_func_start sub_8068C18 +sub_8068C18: @ 8068C18 + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, _08068C68 + ldrh r5, [r0] + ldr r0, _08068C6C + ldrh r4, [r0] + ldr r0, _08068C70 + ldrh r6, [r0] + bl zero_enemy_party_data + ldr r7, _08068C74 + 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 + .align 2, 0 +_08068C68: .4byte 0x020375e0 +_08068C6C: .4byte 0x020375e2 +_08068C70: .4byte 0x020375e4 +_08068C74: .4byte 0x02024744 + thumb_func_end sub_8068C18 + + thumb_func_start pokemon_calc_checksum +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, _08068DF4 + cmp r7, r0 + bne _08068DF8 + movs r0, 0x1 + str r0, [sp, 0x4] + lsls r6, r7, 3 + b _08068E26 + .align 2, 0 +_08068DF4: .4byte 0x0000012f +_08068DF8: + ldr r1, _08068FC4 + 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, _08068FC8 + 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, _08068FC4 + 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 get_nature + 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 get_nature + 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 get_nature + 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 get_nature + 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 get_nature + 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, _08068FCC + 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 + .align 2, 0 +_08068FC4: .4byte 0x083203cc +_08068FC8: .4byte 0x02024474 +_08068FCC: .4byte 0x0000012f +_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, _080690B8 + ldr r1, _080690BC + 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 + .align 2, 0 +_080690B8: .4byte 0x0831f72c +_080690BC: .4byte 0x083203cc + 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, _08069124 + ldr r1, _08069128 + 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 + .align 2, 0 +_08069124: .4byte 0x0831f72c +_08069128: .4byte 0x083203cc + 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, _08069188 + adds r2, r0 + adds r0, r7, 0 + bl pokemon_setattr_encrypted + ldrh r0, [r6] + b _080691A4 + .align 2, 0 +_08069188: .4byte 0x0831c89c +_0806918C: + ldrh r1, [r6] + cmp r0, r1 + bne _0806919C + ldr r0, _08069198 + b _080691A4 + .align 2, 0 +_08069198: .4byte 0x0000fffe +_0806919C: + adds r5, 0x1 + cmp r5, 0x3 + ble _0806914E + ldr r0, _080691AC +_080691A4: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080691AC: .4byte 0x0000ffff + 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, _080691DC + 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 + .align 2, 0 +_080691DC: .4byte 0x0831c898 +_080691E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _080691CA + ldr r0, _080691F0 +_080691EA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080691F0: .4byte 0x0000ffff + 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, _08069230 + adds r2, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08069230: .4byte 0x0831c89c + 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, _08069260 + 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 + .align 2, 0 +_08069260: .4byte 0x0831c898 + 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, _0806930C + lsls r6, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + ldrh r1, [r0] + ldr r2, _08069310 + lsrs r0, r2, 16 + cmp r1, r0 + beq _080692FC + mov r9, r2 + movs r3, 0 +_080692AE: + ldr r0, _0806930C + 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, _08069314 + 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 + .align 2, 0 +_0806930C: .4byte 0x0832937c +_08069310: .4byte 0xffff0000 +_08069314: .4byte 0x000001ff + 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, _0806939C + mov r1, sp + ldrb r1, [r1] + strb r1, [r4] + ldr r2, _080693A0 + 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, _080693A4 + 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 + .align 2, 0 +_0806939C: .4byte 0x020244e8 +_080693A0: .4byte 0x0832937c +_080693A4: .4byte 0x0000ffff +_080693A8: + adds r0, r6, 0 + ands r0, r1 + cmp r0, r4 + bne _08069384 +_080693B0: + ldr r3, _08069414 + mov r1, r9 + lsls r4, r1, 2 + adds r1, r4, r3 + ldr r2, _08069418 + 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, _0806941C + mov r0, r12 + adds r1, r3, r0 + ldrb r0, [r6] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _08069420 + 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 + .align 2, 0 +_08069414: .4byte 0x0832937c +_08069418: .4byte 0x020244e8 +_0806941C: .4byte 0x020244e2 +_08069420: .4byte 0x000001ff + 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, _080694CC + 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 + .align 2, 0 +_080694CC: .4byte 0x0831c898 + 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, _08069578 + 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 + .align 2, 0 +_08069578: .4byte 0x0831c898 + 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, _080695CC + ldr r1, _080695D0 + 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 + .align 2, 0 +_080695CC: .4byte 0x020244e0 +_080695D0: .4byte 0x0831c898 +_080695D4: + ldr r0, _080695F0 + strh r3, [r0] +_080695D8: + cmp r7, 0 + bne _080695F8 + ldr r1, _080695F4 + 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 + .align 2, 0 +_080695F0: .4byte 0x020244e0 +_080695F4: .4byte 0x0831c898 +_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, _08069630 + 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 + .align 2, 0 +_08069630: .4byte 0x02024404 +_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, _08069668 + 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 + .align 2, 0 +_08069668: .4byte 0x02024404 +_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, _08069764 + 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, _08069768 + 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, _0806976C + 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, _08069770 + 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 + .align 2, 0 +_08069764: .4byte 0x00000867 +_08069768: .4byte 0x0000086b +_0806976C: .4byte 0x0000086d +_08069770: .4byte 0x08329d74 +_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, _08069A78 + ldr r0, [r0] + ldr r1, _08069A7C + ands r0, r1 + cmp r0, 0 + bne _080697C6 + ldr r1, _08069A80 + 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, _08069A78 + ldr r0, [r0] + ldr r1, _08069A7C + ands r0, r1 + cmp r0, 0 + bne _080697FC + ldr r1, _08069A80 + 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, _08069A84 + 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, _08069A84 + 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, _08069A88 + 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, _08069A88 + 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, _08069A88 + 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, _08069A88 + 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, _08069A88 + 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, _08069A88 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_08069A3E: + ldr r2, _08069A8C + ldr r0, _08069A90 + 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, _08069A94 + 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, _08069A98 + b _08069AA6 + .align 2, 0 +_08069A78: .4byte 0x02022fec +_08069A7C: .4byte 0x003f0100 +_08069A80: .4byte 0xfffffe69 +_08069A84: .4byte 0x00000175 +_08069A88: .4byte 0x020244e0 +_08069A8C: .4byte 0x0831c898 +_08069A90: .4byte 0x020241ea +_08069A94: .4byte 0x02024211 +_08069A98: .4byte 0x08329d2e +_08069A9C: + adds r5, r7, 0 + b _08069ABE +_08069AA0: + ldr r2, _08069AF0 + 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, _08069AF4 + 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, _08069AF0 + ldr r3, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r3, r0] + b _08069B04 + .align 2, 0 +_08069AF0: .4byte 0x08329d2e +_08069AF4: .4byte 0x020244e0 +_08069AF8: + ldr r3, [sp, 0x18] + b _08069B1E +_08069AFC: + ldr r2, _08069B7C + 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, _08069B80 + 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 + .align 2, 0 +_08069B7C: .4byte 0x08329d2e +_08069B80: .4byte 0x02022fec +_08069B84: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069B8A: + ldr r0, _08069BE8 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069BBC + ldr r0, _08069BEC + 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, _08069BF0 + 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, _08069BF4 + b _08069C02 + .align 2, 0 +_08069BE8: .4byte 0x02022fec +_08069BEC: .4byte 0x0831c898 +_08069BF0: .4byte 0x02024211 +_08069BF4: .4byte 0x08329d2e +_08069BF8: + mov r5, r8 + b _08069C1A +_08069BFC: + ldr r2, _08069C48 + 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, _08069C4C + 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, _08069C48 + b _08069C5C + .align 2, 0 +_08069C48: .4byte 0x08329d2e +_08069C4C: .4byte 0x020244e0 +_08069C50: + ldr r3, [sp, 0x1C] + b _08069C76 +_08069C54: + ldr r2, _08069CBC + 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, _08069CC0 + 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 + .align 2, 0 +_08069CBC: .4byte 0x08329d2e +_08069CC0: .4byte 0x02022fec +_08069CC4: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069CCA: + ldr r0, _08069D44 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069CFC + ldr r0, _08069D48 + 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, _08069D4C + 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 + .align 2, 0 +_08069D44: .4byte 0x02022fec +_08069D48: .4byte 0x0831c898 +_08069D4C: .4byte 0x020243cc +_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, _08069D94 + 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 + .align 2, 0 +_08069D94: .4byte 0x020241ea +_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, _08069DE8 + 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 + .align 2, 0 +_08069DE8: .4byte 0x020244a8 + 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, _08069E34 + ldrb r3, [r0] + ldr r4, _08069E38 + ldr r2, _08069E3C +_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 + .align 2, 0 +_08069E34: .4byte 0x02024064 +_08069E38: .4byte 0x02024210 +_08069E3C: .4byte 0x0832a328 +_08069E40: + movs r5, 0 +_08069E42: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, _08069E7C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08069E74 + ldr r0, _08069E80 + ldrb r1, [r0] + ldr r2, _08069E84 + 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 + .align 2, 0 +_08069E7C: .4byte 0x0202420b +_08069E80: .4byte 0x02024210 +_08069E84: .4byte 0x0832a328 +_08069E88: + movs r5, 0 +_08069E8A: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, _08069ECC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08069EBC + ldr r0, _08069ED0 + ldrb r1, [r0] + ldr r2, _08069ED4 + 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 + .align 2, 0 +_08069ECC: .4byte 0x0202420c +_08069ED0: .4byte 0x02024210 +_08069ED4: .4byte 0x0832a328 + 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, _08069F20 + ldr r0, [r4] + ldr r1, _08069F24 + 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, _08069F28 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _08069F1C +_08069F10: + adds r0, r5, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08069F2C +_08069F1C: + movs r0, 0 + b _08069F2E + .align 2, 0 +_08069F20: .4byte 0x02022fec +_08069F24: .4byte 0x023f0902 +_08069F28: .4byte 0x02038bca +_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, _08069F58 + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + bne _08069F5C + adds r0, r4, 0 + b _08069FA6 + .align 2, 0 +_08069F58: .4byte 0x02022fec +_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, _08069F98 + ldrb r1, [r0] + ldr r2, _08069F9C + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069FA0 + adds r0, r4, 0 + b _08069FA6 + .align 2, 0 +_08069F98: .4byte 0x02024210 +_08069F9C: .4byte 0x0832a328 +_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, _0806A014 + 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, _0806A014 + 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 + .align 2, 0 +_0806A014: .4byte 0x083203cc +_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, _0806A05C + 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 + .align 2, 0 +_0806A05C: .4byte 0x083203cc +_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, _0806A094 + ldr r2, [r0] + cmp r2, 0 + beq _0806A09C + ldr r0, _0806A098 + 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 + .align 2, 0 +_0806A094: .4byte 0x020244d4 +_0806A098: .4byte 0x0202499c +_0806A09C: + ldr r1, _0806A0AC + ldr r0, [r1] + cmp r0, 0 + beq _0806A0B4 + ldr r3, _0806A0B0 + ldr r2, [r0, 0xC] + b _0806A0C8 + .align 2, 0 +_0806A0AC: .4byte 0x020249b4 +_0806A0B0: .4byte 0x0202499c +_0806A0B4: + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _0806A0C4 + ldr r3, _0806A0C0 + ldr r2, [r0, 0xC] + b _0806A0C8 + .align 2, 0 +_0806A0C0: .4byte 0x0202499c +_0806A0C4: + ldr r3, _0806A0EC + ldr r2, _0806A0F0 +_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, _0806A0F4 + str r0, [r2, 0x8] + b _0806A122 + .align 2, 0 +_0806A0EC: .4byte 0x0202499c +_0806A0F0: .4byte 0x08329d98 +_0806A0F4: .4byte 0x082ff70c +_0806A0F8: + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bls _0806A118 + ldr r0, _0806A110 + ldr r3, _0806A114 + adds r1, r5, r3 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x8] + b _0806A122 + .align 2, 0 +_0806A110: .4byte 0x08309aac +_0806A114: .4byte 0xfffffe0c +_0806A118: + ldr r0, _0806A128 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r3, 0x8] +_0806A122: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A128: .4byte 0x08309aac + 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, _0806A164 + strh r4, [r0, 0x2] + adds r5, r0, 0 + cmp r3, 0 + beq _0806A144 + cmp r3, 0x2 + bne _0806A170 +_0806A144: + ldr r2, _0806A168 + 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, _0806A16C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + b _0806A1B0 + .align 2, 0 +_0806A164: .4byte 0x0202499c +_0806A168: .4byte 0x08329df8 +_0806A16C: .4byte 0x08305d0c +_0806A170: + ldr r0, _0806A190 + 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 + .align 2, 0 +_0806A190: .4byte 0x020244d4 +_0806A194: + ldr r0, _0806A1B8 + 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, _0806A1BC + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] +_0806A1B0: + str r0, [r5, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0806A1B8: .4byte 0x08329d98 +_0806A1BC: .4byte 0x0830536c + 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, _0806A1EC + ldr r2, [r0] + cmp r2, 0 + beq _0806A1F4 + ldr r0, _0806A1F0 + 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 + .align 2, 0 +_0806A1EC: .4byte 0x020244d4 +_0806A1F0: .4byte 0x0202499c +_0806A1F4: + ldr r3, _0806A21C + ldr r2, _0806A220 + 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, _0806A224 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r3, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0806A21C: .4byte 0x0202499c +_0806A220: .4byte 0x08329d98 +_0806A224: .4byte 0x0830536c + thumb_func_end sub_806A1C0 + + thumb_func_start pokemon_encrypt +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 +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 +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, _0806A294 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806A294: .4byte _0806A298 + .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 +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, _0806A534 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806A534: .4byte _0806A538 + .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 +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, _0806A704 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806A704: .4byte _0806A708 + .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, _0806A898 + 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 + .align 2, 0 +_0806A898: .4byte 0x085ccb90 +_0806A89C: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806A8BC + ldr r1, _0806A8B8 + adds r0, r6, 0 + bl gf_strcpy + adds r0, r6, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r4, r0, 16 + b _0806AC8C + .align 2, 0 +_0806A8B8: .4byte 0x085e8264 +_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, _0806AB68 + cmp r0, r1 + bne _0806AB34 + b _0806AC8C +_0806AB34: + mov r2, r10 + ldrh r5, [r2] + adds r7, r1, 0 + adds r2, r6, 0 + ldr r1, _0806AB6C +_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 + .align 2, 0 +_0806AB68: .4byte 0x00000163 +_0806AB6C: .4byte 0x0832a328 +_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 +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, _0806ACC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806ACC4: .4byte _0806ACC8 + .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 +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, _0806AE30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806AE30: .4byte _0806AE34 + .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, _0806B120 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x2] + b _0806B3D8 + .align 2, 0 +_0806B120: .4byte 0xfffff87f +_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, _0806B174 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + b _0806B3D8 + .align 2, 0 +_0806B174: .4byte 0xfffffc1f +_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, _0806B1A4 + ands r0, r1 + orrs r0, r2 + str r0, [r5, 0x4] + b _0806B3D8 + .align 2, 0 +_0806B1A4: .4byte 0xfff07fff +_0806B1A8: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 4 + ldrh r2, [r5, 0x6] + ldr r0, _0806B1BC + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + b _0806B3D8 + .align 2, 0 +_0806B1BC: .4byte 0xfffffe0f +_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, _0806B24C + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x8] + b _0806B3D8 + .align 2, 0 +_0806B24C: .4byte 0xfffffe3f +_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, _0806B3FC + 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, _0806B400 + 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, _0806B404 + 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 + .align 2, 0 +_0806B3FC: .4byte 0xfffffc1f +_0806B400: .4byte 0xfff07fff +_0806B404: .4byte 0xfffffe0f + thumb_func_end pokemon_setattr_encrypted + + thumb_func_start memcpy_pokemon +memcpy_pokemon: @ 806B408 + push {lr} + bl memcpy + pop {r0} + bx r0 + thumb_func_end memcpy_pokemon + + thumb_func_start pokemon_catch +pokemon_catch: @ 806B414 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, _0806B440 + 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 + .align 2, 0 +_0806B440: .4byte 0x03005d90 +_0806B444: + adds r5, 0x1 +_0806B446: + cmp r5, 0x5 + bgt _0806B480 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _0806B478 + 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, _0806B47C + adds r0, r5, 0x1 + strb r0, [r1] + movs r0, 0 + b _0806B48A + .align 2, 0 +_0806B478: .4byte 0x020244ec +_0806B47C: .4byte 0x020244e9 +_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 +pokemon_add_to_pc: @ 806B490 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + ldr r0, _0806B504 + bl var_get + 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, _0806B508 + strh r5, [r0] + ldr r0, _0806B50C + strh r6, [r0] + bl get_unknown_box_id + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + beq _0806B4F4 + ldr r0, _0806B510 + bl flag_clear +_0806B4F4: + lsls r1, r5, 16 + ldr r0, _0806B504 + lsrs r1, 16 + bl var_set + movs r0, 0x1 + b _0806B530 + .align 2, 0 +_0806B504: .4byte 0x00004036 +_0806B508: .4byte 0x020375f6 +_0806B50C: .4byte 0x020375f8 +_0806B510: .4byte 0x000008d7 +_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 +calc_player_party_count: @ 806B53C + push {r4,lr} + ldr r0, _0806B548 + movs r1, 0 + strb r1, [r0] + b _0806B554 + .align 2, 0 +_0806B548: .4byte 0x020244e9 +_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, _0806B57C + 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 + .align 2, 0 +_0806B57C: .4byte 0x020244ec + thumb_func_end calc_player_party_count + + thumb_func_start calc_enemy_party_count +calc_enemy_party_count: @ 806B580 + push {r4,lr} + ldr r0, _0806B58C + movs r1, 0 + strb r1, [r0] + b _0806B598 + .align 2, 0 +_0806B58C: .4byte 0x020244ea +_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, _0806B5C0 + 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 + .align 2, 0 +_0806B5C0: .4byte 0x02024744 + 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, _0806B630 + 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, _0806B634 + 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, _0806B630 + 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 + .align 2, 0 +_0806B630: .4byte 0x020244e9 +_0806B634: .4byte 0x020244ec + thumb_func_end sub_806B5C4 + + thumb_func_start sub_806B638 +sub_806B638: @ 806B638 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_0806B63E: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _0806B680 + 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 + .align 2, 0 +_0806B680: .4byte 0x020244ec +_0806B684: + movs r0, 0 + cmp r6, 0x1 + bgt _0806B68C + movs r0, 0x2 +_0806B68C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806B638 + + thumb_func_start sub_806B694 +sub_806B694: @ 806B694 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + cmp r1, 0 + beq _0806B6B8 + ldr r2, _0806B6B0 + ldr r1, _0806B6B4 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x17] + b _0806B6C6 + .align 2, 0 +_0806B6B0: .4byte 0x0202420a +_0806B6B4: .4byte 0x083203cc +_0806B6B8: + ldr r2, _0806B6D0 + ldr r1, _0806B6D4 + 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 + .align 2, 0 +_0806B6D0: .4byte 0x0202420a +_0806B6D4: .4byte 0x083203cc + thumb_func_end sub_806B694 + + thumb_func_start sub_806B6D8 +sub_806B6D8: @ 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 sub_806B6D8 + + 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, _0806B824 + ldr r0, [r4] + ldr r0, [r0] + adds r1, r5, 0 + movs r2, 0xA0 + bl memcpy + movs r0, 0 + mov r9, r0 +_0806B730: + ldr r1, _0806B824 + 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, _0806B828 + 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, _0806B824 + 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, _0806B824 + 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, _0806B828 + 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, _0806B824 + 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, _0806B824 + 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, _0806B82C + 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 + .align 2, 0 +_0806B824: .4byte 0x020244a8 +_0806B828: .4byte 0x02024744 +_0806B82C: .4byte 0x0831c89c + thumb_func_end create_enemy_party + + thumb_func_start sub_806B830 +sub_806B830: @ 806B830 + push {r4,r5,lr} + ldr r5, _0806B864 + ldr r0, _0806B868 + 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, _0806B86C + adds r0, r1 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0806B864: .4byte 0x08329eb8 +_0806B868: .4byte 0x020244a8 +_0806B86C: .4byte 0x0831f578 + thumb_func_end sub_806B830 + + thumb_func_start sub_806B870 +sub_806B870: @ 806B870 + push {r4,r5,lr} + ldr r5, _0806B8A4 + ldr r0, _0806B8A8 + 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, _0806B8AC + adds r0, r1 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0806B8A4: .4byte 0x08329eb8 +_0806B8A8: .4byte 0x020244a8 +_0806B8AC: .4byte 0x0831f5ca + 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, _0806B8CC + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B8D0 + movs r0, 0 + b _0806B8DE + .align 2, 0 +_0806B8CC: .4byte 0x020244ec +_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 get_pokemon_name +get_pokemon_name: @ 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, _0806B930 + movs r0, 0xB + muls r0, r5 + adds r3, r0, r7 + adds r2, r6, 0 + b _0806B93A + .align 2, 0 +_0806B930: .4byte 0x083185c8 +_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 get_pokemon_name + + thumb_func_start move_get_pp_info +move_get_pp_info: @ 806B960 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r2, 24 + lsrs r2, 24 + ldr r4, _0806B9A0 + lsls r3, r0, 1 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + ldrb r4, [r3, 0x4] + ldr r0, _0806B9A4 + 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 + .align 2, 0 +_0806B9A0: .4byte 0x0831c898 +_0806B9A4: .4byte 0x08329d22 + thumb_func_end move_get_pp_info + + 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, _0806B9E0 + 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 + .align 2, 0 +_0806B9E0: .4byte 0x08329d26 + thumb_func_end sub_806B9A8 + + thumb_func_start sub_806B9E4 +sub_806B9E4: @ 806B9E4 + lsls r1, 24 + lsrs r1, 24 + adds r0, 0x3B + ldr r2, _0806B9F8 + adds r1, r2 + ldrb r2, [r0] + ldrb r1, [r1] + ands r1, r2 + strb r1, [r0] + bx lr + .align 2, 0 +_0806B9F8: .4byte 0x08329d26 + 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, _0806BCE8 + adds r5, r0 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, _0806BCEC + 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, _0806BCE8 + 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, _0806BCF0 + 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, _0806BCF4 + 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, _0806BCF8 + 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, _0806BCFC + 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 strcpy_limit_10_chars + 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, _0806BD00 + 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 + .align 2, 0 +_0806BCE8: .4byte 0x020244ec +_0806BCEC: .4byte 0x02024084 +_0806BCF0: .4byte 0xfffffc1f +_0806BCF4: .4byte 0xfff07fff +_0806BCF8: .4byte 0xfffffe0f +_0806BCFC: .4byte 0x083203cc +_0806BD00: .4byte 0x0202449c + thumb_func_end battle_data_fill + + thumb_func_start sub_806BD04 +sub_806BD04: @ 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 sub_806BD28 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806BD04 + + thumb_func_start sub_806BD28 +sub_806BD28: @ 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, _0806BD98 + ldr r1, _0806BD9C + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BDA8 + ldr r2, _0806BDA0 + ldr r0, _0806BDA4 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + b _0806BDC4 + .align 2, 0 +_0806BD98: .4byte 0x030022c0 +_0806BD9C: .4byte 0x00000439 +_0806BDA0: .4byte 0x02024404 +_0806BDA4: .4byte 0x020244b8 +_0806BDA8: + ldr r0, _0806BDB4 + ldr r0, [r0] + ldr r2, _0806BDB8 + adds r0, r2 + ldrb r0, [r0] + b _0806BDC4 + .align 2, 0 +_0806BDB4: .4byte 0x03005d8c +_0806BDB8: .4byte 0x00003226 +_0806BDBC: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806BDC4: + str r0, [sp, 0x34] + ldr r1, _0806BE20 + ldr r0, _0806BE24 + ldrb r2, [r0] + strb r2, [r1] + ldr r0, _0806BE28 + ldr r3, _0806BE2C + 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, _0806BE30 + 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, _0806BE34 + ldr r4, [sp, 0xC] + subs r4, 0xD + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + ldr r2, _0806BE38 + 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 + .align 2, 0 +_0806BE20: .4byte 0x0202420f +_0806BE24: .4byte 0x020244b8 +_0806BE28: .4byte 0x030022c0 +_0806BE2C: .4byte 0x00000439 +_0806BE30: .4byte 0x02024064 +_0806BE34: .4byte 0x0202406c +_0806BE38: .4byte 0x0202406e +_0806BE3C: + ldr r1, [sp, 0x1C] + adds r1, 0x2 + str r1, [sp, 0x1C] + ldr r0, _0806BE60 + 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 + .align 2, 0 +_0806BE60: .4byte 0x0202406c +_0806BE64: + ldr r0, _0806BE8C + 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, _0806BE90 + 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 + .align 2, 0 +_0806BE8C: .4byte 0x02024064 +_0806BE90: .4byte 0x0831e58c +_0806BE94: + ldr r1, [sp, 0xC] + cmp r1, 0xAF + bne _0806BEF6 +_0806BE9A: + ldr r0, _0806BEBC + ldr r2, _0806BEC0 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BECC + ldr r0, _0806BEC4 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _0806BEC8 + adds r0, r1 + b _0806BEF6 + .align 2, 0 +_0806BEBC: .4byte 0x030022c0 +_0806BEC0: .4byte 0x00000439 +_0806BEC4: .4byte 0x02024064 +_0806BEC8: .4byte 0x0202440c +_0806BECC: + ldr r0, _0806BED8 + ldr r0, [r0] + ldr r3, _0806BEDC + adds r3, r0, r3 + str r3, [sp, 0x24] + b _0806BEF8 + .align 2, 0 +_0806BED8: .4byte 0x03005d8c +_0806BEDC: .4byte 0x00003214 +_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, _0806BF10 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806BF10: .4byte _0806BF14 + .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, _0806BFE8 + ldr r5, _0806BFEC + 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, _0806BFF0 + 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, _0806BFF4 + 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, _0806BFF0 + ldr r0, _0806BFF8 + 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, _0806BFF0 + ldr r5, _0806BFF8 + 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 + .align 2, 0 +_0806BFE8: .4byte 0x030022c0 +_0806BFEC: .4byte 0x00000439 +_0806BFF0: .4byte 0x02024084 +_0806BFF4: .4byte 0xfff0ffff +_0806BFF8: .4byte 0x02024064 +_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, _0806C084 + ldr r5, _0806C088 + 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, _0806C084 + ldr r5, _0806C088 + 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 + .align 2, 0 +_0806C084: .4byte 0x02024084 +_0806C088: .4byte 0x02024064 +_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, _0806C118 + ldr r5, _0806C11C + 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, _0806C118 + ldr r5, _0806C11C + 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 + .align 2, 0 +_0806C118: .4byte 0x02024084 +_0806C11C: .4byte 0x02024064 +_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, _0806C2DC + ldr r4, _0806C2E0 + 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, _0806C2E4 + 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, _0806C2E8 + 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 pokemon_clear_ailments + lsls r0, 24 + cmp r0, 0 + bne _0806C206 + ldr r1, [sp, 0x38] + cmp r1, 0x4 + beq _0806C202 + ldr r1, _0806C2EC + 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, _0806C2F0 + 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, _0806C2F4 + mov r0, r8 + ldr r1, [sp, 0x10] + ldr r3, [sp, 0x38] + bl pokemon_clear_ailments + 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 pokemon_clear_ailments + 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 pokemon_clear_ailments + 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 pokemon_clear_ailments + 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, _0806C2F8 + ldr r5, _0806C2FC + 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, _0806C2EC + 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 + .align 2, 0 +_0806C2DC: .4byte 0x02024294 +_0806C2E0: .4byte 0x02024064 +_0806C2E4: .4byte 0x0831f72c +_0806C2E8: .4byte 0x083203cc +_0806C2EC: .4byte 0x02024084 +_0806C2F0: .4byte 0xf7ffffff +_0806C2F4: .4byte 0x00000f88 +_0806C2F8: .4byte 0x030022c0 +_0806C2FC: .4byte 0x00000439 +_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, _0806C404 + 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 move_get_pp_info + 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, _0806C408 + 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 move_get_pp_info + 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, _0806C40C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806C404: .4byte 0x08329d22 +_0806C408: .4byte 0x08329d2a +_0806C40C: .4byte _0806C410 + .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, _0806C47C + 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, _0806C480 + 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 + .align 2, 0 +_0806C47C: .4byte 0x08329ec2 +_0806C480: .4byte 0x000001fd +_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, _0806C4D8 + 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 + .align 2, 0 +_0806C4D8: .4byte 0x08329ec2 +_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, _0806C544 + ldr r2, _0806C548 + 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, _0806C54C + ldr r1, _0806C550 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, _0806C554 + 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, _0806C558 + ldrb r0, [r0] + b _0806C574 + .align 2, 0 +_0806C544: .4byte 0x030022c0 +_0806C548: .4byte 0x00000439 +_0806C54C: .4byte 0x02024210 +_0806C550: .4byte 0x0832a328 +_0806C554: .4byte 0x0202406e +_0806C558: .4byte 0x02024064 +_0806C55C: + ldr r3, _0806C58C + ldr r1, _0806C590 + ldr r2, _0806C594 + 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, _0806C598 + ldrb r0, [r1, 0x4] + cmp r0, 0xFE + bhi _0806C5B2 + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0806C5B2 + .align 2, 0 +_0806C58C: .4byte 0x02024210 +_0806C590: .4byte 0x0832a328 +_0806C594: .4byte 0x02024064 +_0806C598: .4byte 0x03005d10 +_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, _0806C6CC + 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, _0806C6D0 + ldr r1, _0806C6D4 + 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, _0806C6D8 + 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, _0806C6DC + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806C6EC + ldr r1, _0806C6E0 + 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 + .align 2, 0 +_0806C6CC: .4byte 0x02024474 +_0806C6D0: .4byte 0x030022c0 +_0806C6D4: .4byte 0x00000439 +_0806C6D8: .4byte 0x02024084 +_0806C6DC: .4byte 0x02024064 +_0806C6E0: .4byte 0x03005d10 +_0806C6E4: + ldr r1, _0806C6FC + 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 + .align 2, 0 +_0806C6FC: .4byte 0x020241f0 +_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 move_get_pp_info + 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 move_get_pp_info + 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 move_get_pp_info + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C7CC: + mov r0, r8 + mov r1, r9 + mov r2, sp + bl pokemon_setattr + ldr r0, _0806C844 + ldr r1, _0806C848 + 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, _0806C84C + 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, _0806C850 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0806C854 + 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 + .align 2, 0 +_0806C844: .4byte 0x030022c0 +_0806C848: .4byte 0x00000439 +_0806C84C: .4byte 0x02024084 +_0806C850: .4byte 0x020242bc +_0806C854: .4byte 0x0832a328 +_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 move_get_pp_info + 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 move_get_pp_info + 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 move_get_pp_info + 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, _0806C980 + ldr r1, _0806C984 + 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, _0806C988 + 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, _0806C98C + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _0806C990 + 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 + .align 2, 0 +_0806C980: .4byte 0x030022c0 +_0806C984: .4byte 0x00000439 +_0806C988: .4byte 0x02024084 +_0806C98C: .4byte 0x020242bc +_0806C990: .4byte 0x0832a328 +_0806C994: + mov r0, r8 + movs r1, 0x2 + ldr r2, [sp, 0xC] + bl sub_806D098 + 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, _0806C9F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806C9F4: .4byte _0806C9F8 + .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, _0806CA68 + 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, _0806CA6C + 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 + .align 2, 0 +_0806CA68: .4byte 0x08329ec2 +_0806CA6C: .4byte 0x000001fd +_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, _0806CAB4 + 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 + .align 2, 0 +_0806CAB4: .4byte 0x08329ec2 +_0806CAB8: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, _0806CB88 + 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 move_get_pp_info + 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, _0806CB8C + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r2, [r1] + ands r2, r0 + str r2, [sp] + ldr r0, _0806CB90 + 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 move_get_pp_info + 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 + .align 2, 0 +_0806CB88: .4byte 0x08329d22 +_0806CB8C: .4byte 0x08329d26 +_0806CB90: .4byte 0x08329d2a +_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 sub_806BD28 + + thumb_func_start pokemon_clear_ailments +pokemon_clear_ailments: @ 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, _0806CDC4 + ldr r1, _0806CDC8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806CDBE + cmp r6, 0x4 + beq _0806CDBE + ldr r0, _0806CDCC + 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 + .align 2, 0 +_0806CDC4: .4byte 0x030022c0 +_0806CDC8: .4byte 0x00000439 +_0806CDCC: .4byte 0x02024084 +_0806CDD0: + movs r0, 0x1 +_0806CDD2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_clear_ailments + + thumb_func_start sub_806CDDA +sub_806CDDA: @ 806CDDA +_0806CDDC: + 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, _0806CE04 + 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 + .align 2, 0 +_0806CE04: .4byte 0x0831e58c +_0806CE08: + cmp r3, 0xAF + bne _0806CE1A +_0806CE0C: + ldr r0, _0806CE2C + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _0806CE30 + 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 + .align 2, 0 +_0806CE2C: .4byte 0x02024064 +_0806CE30: .4byte 0x0202440c +_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, _0806CE6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806CE6C: .4byte _0806CE70 + .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_806CDDA + + thumb_func_start sub_806CF24 +sub_806CF24: @ 806CF24 + push {lr} + ldr r2, _0806CF58 + ldr r1, _0806CF5C + ldrb r1, [r1] + strb r1, [r2] + ldr r3, _0806CF60 + ldr r2, _0806CF64 + ldr r1, _0806CF68 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r3, 0 + bl gf_strcpy + ldr r0, _0806CF6C + ldr r1, _0806CF70 + bl gf_strcpy + ldr r0, _0806CF74 + bl sub_814E6F0 + pop {r0} + bx r0 + .align 2, 0 +_0806CF58: .4byte 0x0202420c +_0806CF5C: .4byte 0x020244b8 +_0806CF60: .4byte 0x02022f58 +_0806CF64: .4byte 0x085cbe00 +_0806CF68: .4byte 0x08329ec8 +_0806CF6C: .4byte 0x02022f68 +_0806CF70: .4byte 0x085cb38a +_0806CF74: .4byte 0x085cb3aa + 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, _0806CFA8 + ldr r1, _0806CFAC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806CFB8 + ldr r2, _0806CFB0 + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _0806CFB4 + adds r7, r0, r1 + b _0806CFD8 + .align 2, 0 +_0806CFA8: .4byte 0x030022c0 +_0806CFAC: .4byte 0x00000439 +_0806CFB0: .4byte 0x020244b8 +_0806CFB4: .4byte 0x0202440c +_0806CFB8: + ldr r0, _0806CFC4 + ldr r0, [r0] + ldr r1, _0806CFC8 + adds r7, r0, r1 + b _0806CFD6 + .align 2, 0 +_0806CFC4: .4byte 0x03005d8c +_0806CFC8: .4byte 0x00003214 +_0806CFCC: + ldr r1, _0806D010 + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r7, [r0] +_0806CFD6: + ldr r2, _0806D014 +_0806CFD8: + ldr r1, _0806D018 + ldrb r0, [r2] + strb r0, [r1] + movs r5, 0 + ldr r0, _0806D01C + 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 + .align 2, 0 +_0806D010: .4byte 0x0831e58c +_0806D014: .4byte 0x020244b8 +_0806D018: .4byte 0x0202420f +_0806D01C: .4byte 0x0202420b +_0806D020: + ldr r0, _0806D05C + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + ldr r0, _0806D060 + bl sub_814E6F0 +_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, _0806D064 + ldr r0, _0806D05C + ldrb r0, [r0] + strb r0, [r1] + ldr r0, _0806D068 + bl sub_814E6F0 +_0806D04E: + ldr r0, _0806D06C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806D05C: .4byte 0x020244b8 +_0806D060: .4byte 0x085ca459 +_0806D064: .4byte 0x0202420b +_0806D068: .4byte 0x085ca424 +_0806D06C: .4byte 0x02022e2c + thumb_func_end sub_806CF78 + + thumb_func_start get_nature +get_nature: @ 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 get_nature + + thumb_func_start getNature +getNature: @ 806D088 + push {lr} + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end getNature + + thumb_func_start sub_806D098 +sub_806D098: @ 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, _0806D104 + ldr r0, [r0] + ldr r1, _0806D108 + adds r0, r1 + ldrb r0, [r0] + b _0806D114 + .align 2, 0 +_0806D104: .4byte 0x03005d8c +_0806D108: .4byte 0x00003226 +_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, _0806D140 + lsls r6, r7, 2 + b _0806D38E + .align 2, 0 +_0806D140: .4byte 0x0832531c +_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, _0806D190 + 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, _0806D194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806D190: .4byte 0x0832531c +_0806D194: .4byte _0806D198 + .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 sub_802F588 + ldr r0, _0806D204 + 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 + .align 2, 0 +_0806D204: .4byte 0x03005cf8 +_0806D208: + bl sub_802F588 + ldr r0, _0806D230 + 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, _0806D234 + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r0, r1 +_0806D228: + ldrh r0, [r0, 0x4] + mov r10, r0 + b _0806D332 + .align 2, 0 +_0806D230: .4byte 0x03005cf8 +_0806D234: .4byte 0x0832531c +_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, _0806D384 + 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 + .align 2, 0 +_0806D384: .4byte 0x0832531c +_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 sub_806D098 + + thumb_func_start sub_806D3C0 +sub_806D3C0: @ 806D3C0 + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D404 + movs r1, 0 + ldr r3, _0806D3FC + 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, _0806D400 + cmp r1, r0 + beq _0806D404 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D406 + .align 2, 0 +_0806D3FC: .4byte 0x0831d94c +_0806D400: .4byte 0x0000019b +_0806D404: + movs r0, 0 +_0806D406: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806D3C0 + + thumb_func_start poke_something_2 +poke_something_2: @ 806D40C + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D450 + movs r1, 0 + ldr r3, _0806D448 + 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, _0806D44C + cmp r1, r0 + beq _0806D450 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D452 + .align 2, 0 +_0806D448: .4byte 0x0831dc82 +_0806D44C: .4byte 0x0000019b +_0806D450: + movs r0, 0 +_0806D452: + pop {r4} + pop {r1} + bx r1 + thumb_func_end poke_something_2 + + thumb_func_start sub_806D458 +sub_806D458: @ 806D458 + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D49C + movs r1, 0 + ldr r3, _0806D494 + 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, _0806D498 + cmp r1, r0 + beq _0806D49C + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D49E + .align 2, 0 +_0806D494: .4byte 0x0831dfb8 +_0806D498: .4byte 0x0000019b +_0806D49C: + movs r0, 0 +_0806D49E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806D458 + + thumb_func_start species_to_pokedex_index +species_to_pokedex_index: @ 806D4A4 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D4C0 + ldr r0, _0806D4BC + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D4C2 + .align 2, 0 +_0806D4BC: .4byte 0x0831dc82 +_0806D4C0: + movs r0, 0 +_0806D4C2: + pop {r1} + bx r1 + thumb_func_end species_to_pokedex_index + + thumb_func_start sub_806D4C8 +sub_806D4C8: @ 806D4C8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D4E4 + ldr r0, _0806D4E0 + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D4E6 + .align 2, 0 +_0806D4E0: .4byte 0x0831d94c +_0806D4E4: + movs r0, 0 +_0806D4E6: + pop {r1} + bx r1 + thumb_func_end sub_806D4C8 + + thumb_func_start sub_806D4EC +sub_806D4EC: @ 806D4EC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D508 + ldr r0, _0806D504 + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D50A + .align 2, 0 +_0806D504: .4byte 0x0831dfb8 +_0806D508: + movs r0, 0 +_0806D50A: + pop {r1} + bx r1 + thumb_func_end sub_806D4EC + + 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, _0806D530 + cmp r1, r0 + bls _0806D53C + ldr r0, _0806D534 + ldr r2, _0806D538 + adds r1, r2 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D53E + .align 2, 0 +_0806D530: .4byte 0x00000113 +_0806D534: .4byte 0x0831f61c +_0806D538: .4byte 0xfffffeec +_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, _0806D614 + 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, _0806D618 + 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, _0806D61C + 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 + .align 2, 0 +_0806D614: .4byte 0x020244d4 +_0806D618: .4byte 0x0831e2f0 +_0806D61C: .4byte 0x0831e2f2 +_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 sub_806D664 +sub_806D664: @ 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, _0806D72C + 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, _0806D730 + 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 + .align 2, 0 +_0806D72C: .4byte 0x0831e2f0 +_0806D730: .4byte 0x0831e2f2 +_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 sub_806D664 + + 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, _0806D7E4 + 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, _0806D7E8 + adds r0, r4 + mov r1, r9 + bl sub_8008C44 + 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 + .align 2, 0 +_0806D7E4: .4byte 0x02021cc4 +_0806D7E8: .4byte 0x083185c8 + thumb_func_end sub_806D778 + + thumb_func_start sub_806D7EC +sub_806D7EC: @ 806D7EC + push {r4,r5,lr} + movs r5, 0 + ldr r4, _0806D814 + 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 + .align 2, 0 +_0806D814: .4byte 0x020229e8 +_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, _0806D850 + 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 + .align 2, 0 +_0806D850: .4byte 0x020229e8 +_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, _0806D870 + b _0806D87C + .align 2, 0 +_0806D870: .4byte 0x020229e8 +_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 sub_806D888 +sub_806D888: @ 806D888 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_81A9E40 + 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, _0806D8C0 + 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 + .align 2, 0 +_0806D8C0: .4byte 0x08310030 +_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 sub_806D888 + + 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, _0806D914 + 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 + .align 2, 0 +_0806D914: .4byte 0x0831e818 +_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, _0806D980 + ldr r1, _0806D984 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806D98C + ldr r0, _0806D988 + ldrb r4, [r0, 0x7] + b _0806D9A8 + .align 2, 0 +_0806D980: .4byte 0x030022c0 +_0806D984: .4byte 0x00000439 +_0806D988: .4byte 0x02024404 +_0806D98C: + ldr r0, _0806D998 + ldr r0, [r0] + ldr r1, _0806D99C + adds r0, r1 + ldrb r4, [r0] + b _0806D9A8 + .align 2, 0 +_0806D998: .4byte 0x03005d8c +_0806D99C: .4byte 0x00003226 +_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, _0806DACC + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806DAC2 + ldr r2, _0806DAD0 + ldr r0, _0806DAD4 + 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, _0806DAD8 + 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 + .align 2, 0 +_0806DACC: .4byte 0x02022fec +_0806DAD0: .4byte 0x08310030 +_0806DAD4: .4byte 0x02038bca +_0806DAD8: .4byte 0x08329ece + 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, _0806DB34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806DB34: .4byte _0806DB38 + .align 2, 0 +_0806DB38: + .4byte _0806DB50 + .4byte _0806DB64 + .4byte _0806DB78 + .4byte _0806DB8C + .4byte _0806DBA0 + .4byte _0806DBB4 +_0806DB50: + ldr r0, _0806DB60 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 30 + b _0806DBC2 + .align 2, 0 +_0806DB60: .4byte 0x083203cc +_0806DB64: + ldr r0, _0806DB74 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + b _0806DBC0 + .align 2, 0 +_0806DB74: .4byte 0x083203cc +_0806DB78: + ldr r0, _0806DB88 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 26 + b _0806DBC2 + .align 2, 0 +_0806DB88: .4byte 0x083203cc +_0806DB8C: + ldr r0, _0806DB9C + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsrs r0, 6 + b _0806DBC4 + .align 2, 0 +_0806DB9C: .4byte 0x083203cc +_0806DBA0: + ldr r0, _0806DBB0 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xB] + lsls r0, 30 + b _0806DBC2 + .align 2, 0 +_0806DBB0: .4byte 0x083203cc +_0806DBB4: + ldr r0, _0806DBF0 + 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, _0806DBF4 + ldr r1, _0806DBF8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806DC00 + ldr r0, _0806DBFC + ldrb r0, [r0, 0x7] + b _0806DC1C + .align 2, 0 +_0806DBF0: .4byte 0x083203cc +_0806DBF4: .4byte 0x030022c0 +_0806DBF8: .4byte 0x00000439 +_0806DBFC: .4byte 0x02024404 +_0806DC00: + ldr r0, _0806DC0C + ldr r0, [r0] + ldr r2, _0806DC10 + adds r0, r2 + ldrb r0, [r0] + b _0806DC1C + .align 2, 0 +_0806DC0C: .4byte 0x03005d8c +_0806DC10: .4byte 0x00003226 +_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, _0806DC88 + cmp r7, r0 + bhi _0806DC7A + b _0806DB14 +_0806DC7A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806DC88: .4byte 0x000001fd + 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, _0806DD78 + 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 + .align 2, 0 +_0806DD78: .4byte 0x0832a328 + 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, _0806DE90 + 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 + .align 2, 0 +_0806DE90: .4byte 0x020244ec +_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, _0806DEC0 + 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 + .align 2, 0 +_0806DEC0: .4byte 0x020244ec + thumb_func_end sub_806DE44 + + thumb_func_start atkE5_pickupitemcalculation +atkE5_pickupitemcalculation: @ 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 atkE5_pickupitemcalculation + + 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, _0806DFF0 + ldr r2, _0806DFF4 + 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 + .align 2, 0 +_0806DFF0: .4byte 0x0831f72c +_0806DFF4: .4byte 0x083203cc +_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, _0806E048 + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + ands r0, r2 + b _0806E05A + .align 2, 0 +_0806E048: .4byte 0x0831e898 +_0806E04C: + movs r1, 0x1 + lsls r1, r5 + ldr r2, _0806E060 + lsls r0, r3, 3 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 +_0806E05A: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0806E060: .4byte 0x0831e898 + 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, _0806E098 + lsls r1, r3, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + ands r0, r2 + b _0806E0AA + .align 2, 0 +_0806E098: .4byte 0x0831e898 +_0806E09C: + movs r1, 0x1 + lsls r1, r2 + ldr r2, _0806E0B0 + lsls r0, r4, 3 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 +_0806E0AA: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0806E0B0: .4byte 0x0831e898 + 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, _0806E1F8 + lsls r1, r7, 2 + adds r2, r1, r6 + ldr r3, [r2] + ldrh r0, [r3] + ldr r4, _0806E1FC + 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, _0806E200 + ands r0, r3 + cmp r1, r0 + beq _0806E168 + ldr r0, [sp, 0x14] + ldr r1, _0806E1F8 + adds r6, r0, r1 + ldr r2, _0806E200 + 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, _0806E200 + ands r0, r1 + cmp r2, r0 + beq _0806E1AC + ldr r1, [sp, 0x14] + ldr r2, _0806E1F8 + adds r6, r1, r2 + ldr r0, _0806E200 + 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, _0806E200 + 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, _0806E1FC + 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 + .align 2, 0 +_0806E1F8: .4byte 0x0832937c +_0806E1FC: .4byte 0x0000ffff +_0806E200: .4byte 0x000001ff + 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, _0806E250 + lsrs r0, 14 + adds r0, r1 + ldr r2, [r0] + ldrh r0, [r2] + ldr r1, _0806E254 + cmp r0, r1 + beq _0806E248 + ldr r0, _0806E258 + 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 + .align 2, 0 +_0806E250: .4byte 0x0832937c +_0806E254: .4byte 0x0000ffff +_0806E258: .4byte 0x000001ff + 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, _0806E3B4 + ldr r2, [sp, 0x38] + adds r1, r2, r3 + ldr r0, [r1] + ldrh r0, [r0] + ldr r2, _0806E3B8 + 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, _0806E3BC + ands r0, r3 + cmp r1, r0 + beq _0806E322 + ldr r0, [sp, 0x38] + ldr r1, _0806E3B4 + adds r6, r0, r1 + ldr r2, _0806E3BC + 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, _0806E3BC + ands r0, r1 + add r1, sp, 0x8 + cmp r2, r0 + beq _0806E368 + ldr r2, [sp, 0x38] + ldr r0, _0806E3B4 + adds r6, r2, r0 + ldr r2, _0806E3BC + 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, _0806E3BC + 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, _0806E3B8 + 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 + .align 2, 0 +_0806E3B4: .4byte 0x0832937c +_0806E3B8: .4byte 0x0000ffff +_0806E3BC: .4byte 0x000001ff + 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 species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + b _0806E3F2 +_0806E3DA: + adds r0, r4, 0 + bl sub_806D4C8 + adds r4, r0, 0 + cmp r4, 0xCA + bls _0806E3F0 + ldr r0, _0806E3EC + b _0806E3F2 + .align 2, 0 +_0806E3EC: .4byte 0x0000ffff +_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 sub_806D4C8 + 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, _0806E428 + movs r2, 0 + adds r0, r1, 0x3 +_0806E41C: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0806E41C + pop {r0} + bx r0 + .align 2, 0 +_0806E428: .4byte 0x020244e4 + thumb_func_end sub_806E414 + + thumb_func_start song_id_for_battle +song_id_for_battle: @ 806E42C + push {lr} + ldr r0, _0806E444 + 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 + .align 2, 0 +_0806E444: .4byte 0x02022fec +_0806E448: + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + beq _0806E45C + ldr r0, _0806E458 + b _0806E646 + .align 2, 0 +_0806E458: .4byte 0x000001df +_0806E45C: + ldr r0, _0806E488 + 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, _0806E48C + ands r0, r1 + cmp r0, 0 + beq _0806E494 + ldr r0, _0806E490 + ldrh r0, [r0] + bl sub_8162BD8 + lsls r0, 24 + lsrs r0, 24 + b _0806E4B2 + .align 2, 0 +_0806E488: .4byte 0x02000002 +_0806E48C: .4byte 0x003f0100 +_0806E490: .4byte 0x02038bca +_0806E494: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0806E4A2 + movs r0, 0xA + b _0806E4B2 +_0806E4A2: + ldr r2, _0806E4C4 + ldr r0, _0806E4C8 + 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, _0806E4CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0806E4C4: .4byte 0x08310030 +_0806E4C8: .4byte 0x02038bca +_0806E4CC: .4byte _0806E4D0 + .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, _0806E5CC + b _0806E646 + .align 2, 0 +_0806E5CC: .4byte 0x000001e3 +_0806E5D0: + ldr r0, _0806E5D4 + b _0806E646 + .align 2, 0 +_0806E5D4: .4byte 0x000001db +_0806E5D8: + ldr r0, _0806E5DC + b _0806E646 + .align 2, 0 +_0806E5DC: .4byte 0x000001dd +_0806E5E0: + movs r0, 0xEF + lsls r0, 1 + b _0806E646 +_0806E5E6: + ldr r0, _0806E5F8 + ldr r0, [r0] + ldr r1, _0806E5FC + ands r0, r1 + cmp r0, 0 + beq _0806E604 +_0806E5F2: + ldr r0, _0806E600 + b _0806E646 + .align 2, 0 +_0806E5F8: .4byte 0x02022fec +_0806E5FC: .4byte 0x003f0100 +_0806E600: .4byte 0x000001e1 +_0806E604: + ldr r0, _0806E620 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0806E624 + adds r0, r1 + ldr r1, _0806E628 + bl sub_8008C44 + cmp r0, 0 + beq _0806E63C + b _0806E5F2 + .align 2, 0 +_0806E620: .4byte 0x02038bca +_0806E624: .4byte 0x08310034 +_0806E628: .4byte 0x085ccb98 +_0806E62C: + movs r0, 0xF1 + lsls r0, 1 + b _0806E646 +_0806E632: + ldr r0, _0806E638 + b _0806E646 + .align 2, 0 +_0806E638: .4byte 0x000001d7 +_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, _0806E6C4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0806E6C8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0806E6C4: .4byte sub_806E6CC + 1 +_0806E6C8: .4byte 0x03005e00 + 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, _0806E6EC + 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 + .align 2, 0 +_0806E6EC: .4byte 0x03005e00 +_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, _0806E758 + ldr r0, [r0] + b _0806E788 + .align 2, 0 +_0806E758: .4byte 0x08303678 +_0806E75C: + lsrs r0, r1, 16 + ldr r2, _0806E778 + 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, _0806E77C + lsls r1, r4, 3 + b _0806E784 + .align 2, 0 +_0806E778: .4byte 0x0000ffff +_0806E77C: .4byte 0x08303678 +_0806E780: + ldr r0, _0806E790 + lsls r1, r5, 3 +_0806E784: + adds r1, r0 + ldr r0, [r1] +_0806E788: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0806E790: .4byte 0x08304438 + 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, _0806E7EC + 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, _0806E7F0 + b _0806E7F8 + .align 2, 0 +_0806E7EC: .4byte 0x0000ffff +_0806E7F0: .4byte 0x08303678 +_0806E7F4: + lsls r0, r4, 3 + ldr r1, _0806E800 +_0806E7F8: + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0806E800: .4byte 0x08304438 + 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, _0806E828 + ldrh r0, [r2] + ldr r1, _0806E82C + 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 + .align 2, 0 +_0806E828: .4byte 0x08329eea +_0806E82C: .4byte 0x0000ffff +_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, _0806E854 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x19] + lsrs r0, 7 + bx lr + .align 2, 0 +_0806E854: .4byte 0x083203cc + thumb_func_end sub_806E840 + + thumb_func_start sub_806E858 +sub_806E858: @ 806E858 + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl get_nature + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0806E87C + 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 + .align 2, 0 +_0806E87C: .4byte 0x085b25a0 + thumb_func_end sub_806E858 + + thumb_func_start sub_806E880 +sub_806E880: @ 806E880 + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl getNature + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0806E8A4 + 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 + .align 2, 0 +_0806E8A4: .4byte 0x085b25a0 + 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, _0806E918 + 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 + .align 2, 0 +_0806E918: .4byte 0x03005d90 +_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 move_get_pp_info + 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, _0806E9D8 + ldr r5, _0806E9DC + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0xB0 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, _0806E9E0 + 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, _0806E9E4 + ldr r0, [r5] + adds r0, 0x49 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + b _0806E9F6 + .align 2, 0 +_0806E9D8: .4byte 0x0202420a +_0806E9DC: .4byte 0x0202449c +_0806E9E0: .4byte 0x02022f58 +_0806E9E4: .4byte 0x0202406e +_0806E9E8: + ldr r1, _0806EA2C + 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, _0806EA30 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + ldr r1, _0806EA34 + ldrb r0, [r1] + strb r0, [r4, 0x2] + ldr r2, _0806EA2C + 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, _0806EA38 + ldr r1, _0806EA3C + bl sub_814E764 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806EA2C: .4byte 0x0202406e +_0806EA30: .4byte 0x02022f68 +_0806EA34: .4byte 0x020244b8 +_0806EA38: .4byte 0x085cb2a1 +_0806EA3C: .4byte 0x02021fc4 + 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, _0806EA54 +_0806EA4A: + ldrh r0, [r2] + cmp r0, r3 + bne _0806EA58 + adds r0, r1, 0 + b _0806EA62 + .align 2, 0 +_0806EA54: .4byte 0x08329efc +_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, _0806EAEC + ldr r0, [r0] + ldr r1, _0806EAF0 + 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, _0806EAF4 + 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, _0806EAF8 + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806EAC6 + adds r0, r5, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + bne _0806EAC6 + movs r2, 0x14 + mov r8, r2 + movs r7, 0x50 +_0806EAC6: + ldr r0, _0806EAFC + 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, _0806EAF4 + lsls r2, 2 + ldr r1, _0806EB00 + b _0806EB6C + .align 2, 0 +_0806EAEC: .4byte 0x02022fec +_0806EAF0: .4byte 0x00302008 +_0806EAF4: .4byte 0x02024744 +_0806EAF8: .4byte 0x020244ec +_0806EAFC: .4byte 0x02037318 +_0806EB00: .4byte 0x08329efe +_0806EB04: + cmp r6, r8 + bcc _0806EB90 + cmp r6, r7 + bcs _0806EB18 + ldr r0, _0806EB14 + lsls r2, r4, 3 + b _0806EB66 + .align 2, 0 +_0806EB14: .4byte 0x02024744 +_0806EB18: + ldr r0, _0806EB24 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + ldr r1, _0806EB28 + b _0806EB6C + .align 2, 0 +_0806EB24: .4byte 0x02024744 +_0806EB28: .4byte 0x083203da +_0806EB2C: + ldr r0, _0806EB54 + 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, _0806EB58 + mov r2, r12 + adds r2, 0xC + adds r2, r5, r2 + b _0806EB6E + .align 2, 0 +_0806EB54: .4byte 0x083203cc +_0806EB58: .4byte 0x02024744 +_0806EB5C: + cmp r6, r8 + bcc _0806EB90 + cmp r6, r7 + bcs _0806EB80 + ldr r0, _0806EB78 +_0806EB66: + subs r2, r4 + lsls r2, 2 + ldr r1, _0806EB7C +_0806EB6C: + adds r2, r1 +_0806EB6E: + movs r1, 0xC + bl pokemon_setattr + b _0806EB90 + .align 2, 0 +_0806EB78: .4byte 0x02024744 +_0806EB7C: .4byte 0x083203d8 +_0806EB80: + ldr r0, _0806EB9C + subs r2, r4 + lsls r2, 2 + ldr r1, _0806EBA0 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr +_0806EB90: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806EB9C: .4byte 0x02024744 +_0806EBA0: .4byte 0x083203da + 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, _0806EBF4 + 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 + .align 2, 0 +_0806EBF4: .4byte 0x0000ffff + thumb_func_end sub_806EBD0 + + thumb_func_start sub_806EBF8 +sub_806EBF8: @ 806EBF8 + push {r4,lr} + ldr r0, _0806EC18 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0806EC3C + ldr r2, _0806EC1C + ldrh r1, [r2] + ldr r0, _0806EC20 + cmp r1, r0 + bne _0806EC28 + ldr r0, _0806EC24 + b _0806EC64 + .align 2, 0 +_0806EC18: .4byte 0x02022fec +_0806EC1C: .4byte 0x02038bce +_0806EC20: .4byte 0x00000c03 +_0806EC24: .4byte 0x08317dd4 +_0806EC28: + ldr r4, _0806EC38 + ldrh r1, [r2] + adds r0, r4, 0 + bl sub_8162E20 + adds r0, r4, 0 + b _0806EC64 + .align 2, 0 +_0806EC38: .4byte 0x02021cc4 +_0806EC3C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0806EC6C + 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 + .align 2, 0 +_0806EC6C: .4byte 0x020229e8 + 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, _0806ECA8 + 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 + .align 2, 0 +_0806ECA8: .4byte 0x03005e00 + 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, _0806ECE8 + 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 + .align 2, 0 +_0806ECE8: .4byte 0x03005e00 + 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, _0806ED24 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806ED30 + ldr r0, _0806ED28 + ldr r0, [r0] + ldr r1, _0806ED2C + 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 + .align 2, 0 +_0806ED24: .4byte 0x02024280 +_0806ED28: .4byte 0x02022fec +_0806ED2C: .4byte 0x02000002 +_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, _0806ED80 + b _0806EDFA + .align 2, 0 +_0806ED80: .4byte nullsub_12 + 1 +_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 obj_anim_image_start +_0806EDA6: + ldr r0, _0806EDDC + subs r4, 0x1 + adds r6, r4, r0 + ldrb r0, [r6] + cmp r0, 0 + beq _0806EDEC + ldr r0, _0806EDE0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0806EDE4 + 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, _0806EDE8 + adds r0, r4, r0 + ldrb r0, [r0] + strh r0, [r1, 0xC] + ldrb r0, [r6] + strh r0, [r1, 0xE] + b _0806EDF8 + .align 2, 0 +_0806EDDC: .4byte 0x08329b87 +_0806EDE0: .4byte sub_806EC70 + 1 +_0806EDE4: .4byte 0x03005e00 +_0806EDE8: .4byte 0x083299ec +_0806EDEC: + ldr r0, _0806EE04 + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_817F544 +_0806EDF8: + ldr r0, _0806EE08 +_0806EDFA: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0806EE04: .4byte 0x083299ec +_0806EE08: .4byte nullsub_18 + 1 + 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 obj_anim_image_start +_0806EE2E: + ldr r0, _0806EE70 + subs r4, 0x1 + adds r6, r4, r0 + ldrb r0, [r6] + cmp r0, 0 + beq _0806EE80 + ldr r0, _0806EE74 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0806EE78 + 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, _0806EE7C + 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 + .align 2, 0 +_0806EE70: .4byte 0x08329b87 +_0806EE74: .4byte sub_806ECAC + 1 +_0806EE78: .4byte 0x03005e00 +_0806EE7C: .4byte 0x083299ec +_0806EE80: + ldr r0, _0806EE94 + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_817F578 +_0806EE8C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0806EE94: .4byte 0x083299ec + thumb_func_end sub_806EE0C + + thumb_func_start sub_806EE98 +sub_806EE98: @ 806EE98 + push {lr} + ldr r0, _0806EEB0 + 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 + .align 2, 0 +_0806EEB0: .4byte sub_806ECAC + 1 + 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, _0806EED8 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806EEE8 + ldr r0, _0806EEDC + ldr r0, [r0] + ldr r1, _0806EEE0 + ands r0, r1 + cmp r0, 0 + bne _0806EEE8 + ldr r0, _0806EEE4 + b _0806EEFC + .align 2, 0 +_0806EED8: .4byte 0x02024280 +_0806EEDC: .4byte 0x02022fec +_0806EEE0: .4byte 0x02000002 +_0806EEE4: .4byte nullsub_12 + 1 +_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, _0806EF04 +_0806EEFC: + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0806EF04: .4byte nullsub_18 + 1 + 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, _0806EF34 + 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 + .align 2, 0 +_0806EF34: .4byte 0x020229e8 +_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, _0806EF80 + 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 + .align 2, 0 +_0806EF80: .4byte 0x020229e8 + 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, _0806EFAC + 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 + .align 2, 0 +_0806EFAC: .4byte 0x020229e8 +_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 sub_806EFF0 +sub_806EFF0: @ 806EFF0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0806EFFC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0806EFFC: .4byte 0x0831f578 + thumb_func_end sub_806EFF0 + + 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 sub_806EFF0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_806F000 + + thumb_func_start sub_806F01C +sub_806F01C: @ 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 poke_something_2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _0806F05C + ldr r0, _0806F078 + ldr r0, [r0] + str r7, [r0, 0x1C] +_0806F05C: + adds r0, r6, 0 + bl poke_something_2 + lsls r0, 16 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806F072 + ldr r0, _0806F078 + ldr r0, [r0] + str r7, [r0, 0x20] +_0806F072: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806F078: .4byte 0x03005d90 + thumb_func_end sub_806F01C + + thumb_func_start sub_806F07C +sub_806F07C: @ 806F07C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _0806F0A4 + cmp r2, r0 + bls _0806F08A + movs r2, 0 +_0806F08A: + ldr r1, _0806F0A8 + 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, _0806F0AC + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_0806F0A4: .4byte 0x00000356 +_0806F0A8: .4byte 0x08310030 +_0806F0AC: .4byte 0x0830fcd4 + thumb_func_end sub_806F07C + + thumb_func_start sub_806F0B0 +sub_806F0B0: @ 806F0B0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _0806F0CC + cmp r1, r0 + bls _0806F0BE + movs r1, 0 +_0806F0BE: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0806F0D0 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_0806F0CC: .4byte 0x00000356 +_0806F0D0: .4byte 0x08310034 + 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, _0806F100 + 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 + .align 2, 0 +_0806F100: .4byte 0x00000181 + thumb_func_end sub_806F0D4 + + thumb_func_start sub_806F104 +sub_806F104: @ 806F104 + push {lr} + ldr r2, _0806F148 + ldr r1, _0806F14C + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806F122 + ldr r0, _0806F150 + ldr r0, [r0] + ldr r1, _0806F154 + ands r0, r1 + cmp r0, 0 + bne _0806F144 +_0806F122: + ldr r1, _0806F14C + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806F158 + bl sub_81A80A8 + lsls r0, 24 + cmp r0, 0 + bne _0806F144 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0806F158 +_0806F144: + movs r0, 0x1 + b _0806F15A + .align 2, 0 +_0806F148: .4byte 0x030022c0 +_0806F14C: .4byte 0x00000439 +_0806F150: .4byte 0x02022fec +_0806F154: .4byte 0x003f0100 +_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, _0806F1F8 + 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 + .align 2, 0 +_0806F1F8: .4byte 0x08329d98 + 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, _0806F2A4 + 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, _0806F2A8 + 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 + .align 2, 0 +_0806F2A4: .4byte 0x08329f28 +_0806F2A8: .4byte 0x082ff70c + 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 malloc_and_clear + 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 malloc_and_clear + str r0, [r4, 0x4] + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 23 + bl malloc_and_clear + 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 malloc_and_clear + str r0, [r4, 0xC] + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + ldrb r0, [r4, 0x1] + lsls r0, 3 + muls r0, r1 + bl malloc_and_clear + 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, _0806F478 + add r0, r8 + str r4, [r0] +_0806F468: + ldr r0, _0806F478 + add r0, r8 + ldr r0, [r0] +_0806F46E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806F478: .4byte 0x020249b4 + 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, _0806F4A4 + 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 + .align 2, 0 +_0806F4A4: .4byte 0x020249b4 +_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, _0806F518 + 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 + .align 2, 0 +_0806F518: .4byte 0x020249b4 +_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 +sine: @ 806F534 + lsls r1, 16 + asrs r1, 16 + ldr r2, _0806F54C + 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 + .align 2, 0 +_0806F54C: .4byte 0x08329f40 + thumb_func_end sine + + thumb_func_start cosine +cosine: @ 806F550 + lsls r1, 16 + asrs r1, 16 + ldr r2, _0806F56C + 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 + .align 2, 0 +_0806F56C: .4byte 0x08329f40 + thumb_func_end cosine + + thumb_func_start sine2 +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, _0806F5A4 + lsls r4, 1 + adds r4, r1 + ldrh r1, [r4] + cmp r0, 0 + bne _0806F5A8 + lsls r0, r1, 16 + b _0806F5AC + .align 2, 0 +_0806F5A4: .4byte 0x0832a1c0 +_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 +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 +GenerateRandomNumber: @ 806F5CC + ldr r2, _0806F5E8 + ldr r1, [r2] + ldr r0, _0806F5EC + muls r0, r1 + ldr r1, _0806F5F0 + adds r0, r1 + str r0, [r2] + ldr r2, _0806F5F4 + ldr r1, [r2] + adds r1, 0x1 + str r1, [r2] + lsrs r0, 16 + bx lr + .align 2, 0 +_0806F5E8: .4byte 0x03005d80 +_0806F5EC: .4byte 0x41c64e6d +_0806F5F0: .4byte 0x00006073 +_0806F5F4: .4byte 0x020249c0 + thumb_func_end GenerateRandomNumber + + thumb_func_start SeedRng +SeedRng: @ 806F5F8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0806F608 + str r0, [r1] + ldr r1, _0806F60C + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_0806F608: .4byte 0x03005d80 +_0806F60C: .4byte 0x020249bc + thumb_func_end SeedRng + + thumb_func_start SeedRng2 +SeedRng2: @ 806F610 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0806F61C + str r0, [r1] + bx lr + .align 2, 0 +_0806F61C: .4byte 0x03005d84 + thumb_func_end SeedRng2 + + thumb_func_start GenerateRandomNumber2 +GenerateRandomNumber2: @ 806F620 + ldr r2, _0806F634 + ldr r1, [r2] + ldr r0, _0806F638 + muls r0, r1 + ldr r1, _0806F63C + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .align 2, 0 +_0806F634: .4byte 0x03005d84 +_0806F638: .4byte 0x41c64e6d +_0806F63C: .4byte 0x00006073 + 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, _0806F674 + movs r1, 0xF8 + movs r2, 0xA8 + movs r3, 0xE + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0806F678 + 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 + .align 2, 0 +_0806F674: .4byte 0x0832a3a8 +_0806F678: .4byte 0x02020630 + 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, _0806F73C + 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 + .align 2, 0 +_0806F73C: .4byte 0x0832a3c0 +_0806F740: + movs r5, 0 + adds r0, 0x1 + str r0, [sp, 0x30] + b _0806F874 +_0806F748: + ldrh r0, [r4] + ldr r2, _0806F780 + 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, _0806F784 + bl CpuSet + adds r4, 0x2 + str r4, [sp, 0x2C] + adds r7, 0x20 + mov r10, r7 + adds r5, 0x1 + mov r9, r5 + b _0806F86A + .align 2, 0 +_0806F780: .4byte 0x000003ff +_0806F784: .4byte 0x04000008 +_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, _0806F7C8 + bl CpuSet + adds r4, 0x1 + lsls r4, 24 + lsrs r1, r4, 24 + asrs r4, 24 + cmp r4, 0x7 + ble _0806F7A0 + b _0806F86A + .align 2, 0 +_0806F7C8: .4byte 0x04000001 +_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, _0806F85C + bl CpuSet + adds r4, 0x1 + lsls r4, 24 + lsrs r1, r4, 24 + asrs r4, 24 + cmp r4, 0x7 + ble _0806F836 + b _0806F86A + .align 2, 0 +_0806F85C: .4byte 0x04000001 +_0806F860: + mov r0, sp + adds r1, r7, 0 + ldr r2, _0806F8A4 + 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 + .align 2, 0 +_0806F8A4: .4byte 0x04000008 + 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, _0806F900 + movs r3, 0 + cmp r3, r4 + bge _0806F91C + movs r6, 0x1 + ldr r0, _0806F904 + 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 + .align 2, 0 +_0806F900: .4byte 0x00001121 +_0806F904: .4byte 0x00008408 +_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, _0806F964 + movs r3, 0 + cmp r3, r4 + bcs _0806F956 + ldr r6, _0806F968 +_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 + .align 2, 0 +_0806F964: .4byte 0x00001121 +_0806F968: .4byte 0x0832a3d8 + 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, _0806FA24 + mov r10, r0 + ldr r1, _0806FA28 + 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 + .align 2, 0 +_0806FA24: .4byte 0x02037714 +_0806FA28: .4byte 0x02037b14 + 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 strcpy_limit_10_chars + 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 strcpy_limit_10_chars + 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 +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 +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, _0806FBE8 + ldr r1, [r1] + bl gf_strcpy + adds r4, r5, 0 + adds r4, 0x7C + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_get_nick + adds r0, r4, 0 + bl sub_8009370 + 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, _0806FBEC + 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, _0806FBF0 + 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 + .align 2, 0 +_0806FBE8: .4byte 0x03005d90 +_0806FBEC: .4byte 0x03005d8c +_0806FBF0: .4byte 0x00002be0 + thumb_func_end sub_806FB38 + + thumb_func_start daycare_send +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, _0806FC3C + adds r0, r1 + ldr r1, _0806FC40 + ldr r1, [r1] + ldr r2, _0806FC44 + adds r1, r2 + bl daycare_send + pop {r0} + bx r0 + .align 2, 0 +_0806FC3C: .4byte 0x020244ec +_0806FC40: .4byte 0x03005d8c +_0806FC44: .4byte 0x00003030 + 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, _0806FCC0 +_0806FCAC: + adds r0, r4, 0 + bl sub_806DF74 + lsls r0, 24 + cmp r0, 0 + beq _0806FCE8 + movs r6, 0x1 + adds r5, 0x1 + b _0806FCD4 + .align 2, 0 +_0806FCC0: .4byte 0x0000ffff +_0806FCC4: + movs r6, 0 + cmp r0, r7 + bne _0806FCD4 + ldr r0, _0806FCF4 + 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 + .align 2, 0 +_0806FCF4: .4byte 0x020244e2 + 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, _0806FD94 + 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, _0806FD98 + 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 + .align 2, 0 +_0806FD94: .4byte 0x02021cc4 +_0806FD98: .4byte 0x020244ec + 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, _0806FDE0 + ldr r0, [r0] + ldr r1, _0806FDE4 + adds r0, r1 + ldr r1, _0806FDE8 + ldrb r1, [r1] + bl sub_806FD9C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_0806FDE0: .4byte 0x03005d8c +_0806FDE4: .4byte 0x00003030 +_0806FDE8: .4byte 0x020375e0 + 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, _0806FE80 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _0806FE84 + adds r0, r5, 0 + bl pokemon_get_nick_ + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0806FE80: .4byte 0x02021dc4 +_0806FE84: .4byte 0x02021cc4 + 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, _0806FEB8 + adds r0, r5, 0 + bl pokemon_get_nick_ + movs r0, 0x64 + muls r4, r0 + adds r4, 0x64 + ldr r0, _0806FEBC + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl decimal_int_to_string + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0806FEB8: .4byte 0x02021cc4 +_0806FEBC: .4byte 0x02021dc4 + 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, _0806FEF4 + ldr r0, [r0] + ldr r1, _0806FEF8 + adds r0, r1 + ldr r1, _0806FEFC + ldrb r1, [r1] + bl sub_806FEC0 + ldr r1, _0806FF00 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0806FEF4: .4byte 0x03005d8c +_0806FEF8: .4byte 0x00003030 +_0806FEFC: .4byte 0x020375e0 +_0806FF00: .4byte 0x020375e2 + thumb_func_end sub_806FED8 + + thumb_func_start sub_806FF04 +sub_806FF04: @ 806FF04 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0806FF24 + ldr r2, [r1] + ldr r1, _0806FF28 + adds r3, r2, r1 + ldr r1, [r3] + adds r1, r0 + str r1, [r3] + ldr r1, _0806FF2C + adds r2, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r2] + bx lr + .align 2, 0 +_0806FF24: .4byte 0x03005d8c +_0806FF28: .4byte 0x000030b8 +_0806FF2C: .4byte 0x00003144 + thumb_func_end sub_806FF04 + + thumb_func_start sub_806FF30 +sub_806FF30: @ 806FF30 + push {r4-r6,lr} + ldr r6, _0806FF54 + ldr r5, _0806FF58 + ldrh r0, [r5] + movs r4, 0x8C + adds r1, r0, 0 + muls r1, r4 + ldr r0, _0806FF5C + 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 + .align 2, 0 +_0806FF54: .4byte 0x03005d8c +_0806FF58: .4byte 0x020375e0 +_0806FF5C: .4byte 0x00003030 +_0806FF60: + ldrh r0, [r5] + adds r1, r0, 0 + muls r1, r4 + ldr r0, _0806FF7C + 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 + .align 2, 0 +_0806FF7C: .4byte 0x00003030 + 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, _08070030 + 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 + .align 2, 0 +_08070030: .4byte 0x0832531c +_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, _08070080 + 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 + .align 2, 0 +_08070080: .4byte 0x0000019b + 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, _08070104 + 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, _08070104 + cmp r0, r1 + bls _08070108 +_080700FE: + movs r0, 0x1 + negs r0, r0 + b _0807010A + .align 2, 0 +_08070104: .4byte 0x7ffe0000 +_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, _08070158 + 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, _0807015C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + orrs r4, r0 + str r4, [r5] + b _080701AC + .align 2, 0 +_08070158: .4byte 0x030022c0 +_0807015C: .4byte 0x0000fffe +_08070160: + movs r0, 0x8C + muls r0, r1 + adds r0, r5, r0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + bl getNature + 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 getNature + 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 flag_set + 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 flag_set + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80701B8 + + thumb_func_start sub_80701E0 +sub_80701E0: @ 80701E0 + push {lr} + ldr r0, _080701F4 + ldr r0, [r0] + ldr r1, _080701F8 + adds r0, r1 + bl sub_8070114 + pop {r0} + bx r0 + .align 2, 0 +_080701F4: .4byte 0x03005d8c +_080701F8: .4byte 0x00003030 + thumb_func_end sub_80701E0 + + thumb_func_start sub_80701FC +sub_80701FC: @ 80701FC + push {lr} + ldr r0, _08070210 + ldr r0, [r0] + ldr r1, _08070214 + adds r0, r1 + bl sub_80701B8 + pop {r0} + bx r0 + .align 2, 0 +_08070210: .4byte 0x03005d8c +_08070214: .4byte 0x00003030 + 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, _080702E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080702E8: .4byte _080702EC + .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, _080703F0 + ldrh r1, [r5] + ldr r7, _080703F4 + adds r0, r3, r7 + cmp r1, r0 + bne _080703F8 + movs r4, 0x1 + b _0807041A + .align 2, 0 +_080703F0: .4byte 0x0832add8 +_080703F4: .4byte 0x00004e20 +_080703F8: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _08070464 + ldr r5, _08070468 + cmp r2, r0 + bhi _0807041A + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r7, _0807046C + 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, _0807046C + 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 + .align 2, 0 +_08070464: .4byte 0x00000471 +_08070468: .4byte 0x0832add8 +_0807046C: .4byte 0x00004e20 + 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, _08070574 + movs r2, 0 + ldr r4, _08070578 + ldr r3, _0807057C +_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, _08070580 + 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, _08070584 + 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, _08070584 + bl sub_806E204 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r6, 0 + ldr r1, _08070578 + 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, _08070574 + adds r4, r1 + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080704F2 + ldr r1, _08070580 + adds r0, r7, 0 + bl pokemon_get_eggmoves + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 +_0807052E: + ldr r0, _08070578 + 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, _08070588 +_08070546: + ldr r0, _08070580 + 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 + .align 2, 0 +_08070574: .4byte 0x02024a4c +_08070578: .4byte 0x02024a28 +_0807057C: .4byte 0x02024a30 +_08070580: .4byte 0x02024a38 +_08070584: .4byte 0x020249c4 +_08070588: .4byte 0x0000ffff +_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, _080706C0 + 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, _080706C0 + adds r4, r2, r0 + ldr r6, _080706C4 + mov r9, r0 +_080705C2: + ldr r3, _080706C8 + adds r0, r5, r3 + lsls r0, 16 + lsrs r0, 16 + bl sub_81B6CFC + 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, _080706CC + mov r10, r3 + cmp r0, 0 + beq _08070672 + mov r4, r9 + ldr r0, _080706D0 + 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, _080706C4 +_0807068A: + ldr r1, _080706D4 + 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 + .align 2, 0 +_080706C0: .4byte 0x02024a28 +_080706C4: .4byte 0x0000ffff +_080706C8: .4byte 0x00000121 +_080706CC: .4byte 0x02024a30 +_080706D0: .4byte 0x02024a4c +_080706D4: .4byte 0x020249c4 +_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, _0807070C + 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 + .align 2, 0 +_0807070C: .4byte 0x02024a30 + 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, _0807073C + ldr r0, [r0] + ldr r1, _08070740 + adds r0, r1 + bl sub_8070710 + pop {r0} + bx r0 + .align 2, 0 +_0807073C: .4byte 0x03005d8c +_08070740: .4byte 0x00003030 + 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, _080707E8 + cmp r0, r1 + bne _080707E2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8069424 +_080707E2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080707E8: .4byte 0xffff0000 + 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, _080708C4 + 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 + .align 2, 0 +_080708C4: .4byte 0x00000183 + 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, _08070950 + 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 + .align 2, 0 +_08070950: .4byte 0x020244ec + 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, _08070A04 + adds r0, r7, 0 + movs r1, 0x2 + bl pokemon_setattr + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 2 + ldr r0, _08070A08 + 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 + .align 2, 0 +_08070A04: .4byte 0x0832b708 +_08070A08: .4byte 0x083203dd + 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, _08070AA0 + adds r0, r6, 0 + movs r1, 0x2 + bl pokemon_setattr + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 2 + ldr r0, _08070AA4 + 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 + .align 2, 0 +_08070AA0: .4byte 0x0832b708 +_08070AA4: .4byte 0x083203dd + thumb_func_end sub_8070A0C + + thumb_func_start sp0B8_daycare +sp0B8_daycare: @ 8070AA8 + push {lr} + ldr r0, _08070ABC + ldr r0, [r0] + ldr r1, _08070AC0 + adds r0, r1 + bl sub_80708C8 + pop {r0} + bx r0 + .align 2, 0 +_08070ABC: .4byte 0x03005d8c +_08070AC0: .4byte 0x00003030 + 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, _08070B8C + 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, _08070B90 + ldrb r0, [r0] + cmp r5, r0 + bcs _08070BC0 + ldr r4, _08070B94 +_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 + .align 2, 0 +_08070B8C: .4byte 0x0000ffff +_08070B90: .4byte 0x020244e9 +_08070B94: .4byte 0x020244ec +_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, _08070BB0 + strh r5, [r0] + movs r0, 0x1 + b _08070BC2 + .align 2, 0 +_08070BB0: .4byte 0x020375e0 +_08070BB4: + adds r4, 0x64 + adds r5, 0x1 + ldr r0, _08070BCC + ldrb r0, [r0] + cmp r5, r0 + bcc _08070B5C +_08070BC0: + movs r0, 0 +_08070BC2: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08070BCC: .4byte 0x020244e9 + thumb_func_end sub_8070AC4 + + thumb_func_start sub_8070BD0 +sub_8070BD0: @ 8070BD0 + push {lr} + ldr r0, _08070BE8 + ldr r0, [r0] + ldr r1, _08070BEC + adds r0, r1 + bl sub_8070AC4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08070BE8: .4byte 0x03005d8c +_08070BEC: .4byte 0x00003030 + 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, _08070C4C + adds r0, r4, 0 + bl pokemon_get_nick_ + adds r0, r4, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr_encrypted + ldr r0, _08070C50 + mov r1, sp + bl gf_strcpy +_08070C2E: + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070C44 + ldr r1, _08070C54 + adds r0, r4, 0 + bl pokemon_get_nick_ +_08070C44: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08070C4C: .4byte 0x02021cc4 +_08070C50: .4byte 0x02021ec4 +_08070C54: .4byte 0x02021dc4 + 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, _08070C8C + adds r0, r4 + ldr r1, _08070C90 + 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 + .align 2, 0 +_08070C8C: .4byte 0x020244ec +_08070C90: .4byte 0x02021cc4 + thumb_func_end sub_8070C58 + + thumb_func_start sp0B5_daycare +sp0B5_daycare: @ 8070C94 + push {lr} + ldr r0, _08070CA8 + ldr r0, [r0] + ldr r1, _08070CAC + adds r0, r1 + bl sub_8070C04 + pop {r0} + bx r0 + .align 2, 0 +_08070CA8: .4byte 0x03005d8c +_08070CAC: .4byte 0x00003030 + thumb_func_end sp0B5_daycare + + thumb_func_start sp0B6_daycare +sp0B6_daycare: @ 8070CB0 + push {r4,lr} + ldr r4, _08070CC8 + ldr r0, [r4] + ldr r1, _08070CCC + adds r0, r1 + bl sub_8070BF0 + lsls r0, 24 + cmp r0, 0 + beq _08070CD0 + movs r0, 0x1 + b _08070CF2 + .align 2, 0 +_08070CC8: .4byte 0x03005d8c +_08070CCC: .4byte 0x00003030 +_08070CD0: + ldr r0, [r4] + ldr r1, _08070CE8 + adds r0, r1 + bl daycare_count_pokemon + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08070CEC + movs r0, 0 + b _08070CF2 + .align 2, 0 +_08070CE8: .4byte 0x00003030 +_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, _08070D14 + ldr r0, [r0] + ldr r1, _08070D18 + 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 + .align 2, 0 +_08070D14: .4byte 0x03005d8c +_08070D18: .4byte 0x00003030 + 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, _08070E00 + 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 + .align 2, 0 +_08070E00: .4byte 0x083203cc +_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, _08070E84 + ldr r0, [r0] + ldr r1, _08070E88 + adds r0, r1 + bl daycare_relationship_score + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08070E84: .4byte 0x03005d8c +_08070E88: .4byte 0x00003030 + 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, _08070EC4 + ldr r2, _08070EC8 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_08070EC4: .4byte 0x02021fc4 +_08070EC8: .4byte 0x0832b6f8 + 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, _08070F64 + b _08070F86 + .align 2, 0 +_08070F64: .4byte 0x0832dac7 +_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, _08070F80 + b _08070F86 + .align 2, 0 +_08070F80: .4byte 0x0832dac9 +_08070F84: + ldr r1, _08070F94 +_08070F86: + adds r0, r4, 0 + bl gf_strcat + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08070F94: .4byte 0x0832dacb + 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 gf_strcpy + ldr r4, _08071030 + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcat + adds r0, r7, 0 + mov r1, r9 + bl gf_strcat + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcat + ldr r1, _08071034 + adds r0, r7, 0 + bl gf_strcat + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08071030: .4byte 0x085ef881 +_08071034: .4byte 0x085ef883 + 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, _08071094 + bl gf_strcat + 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 decimal_int_to_string + adds r0, r4, 0 + mov r1, sp + bl gf_strcat + adds r0, r4, 0 + ldr r1, _08071098 + bl gf_strcat + 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 + .align 2, 0 +_08071094: .4byte 0x085ef888 +_08071098: .4byte 0x085ef881 + 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, _0807110C + 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 remo_copy + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807110C: .4byte 0x03003014 + 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, _080711B4 + mov r0, sp + bl gf_strcpy + 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 decimal_int_to_string + mov r0, sp + adds r1, r4, 0 + bl gf_strcat + movs r0, 0x1 + mov r1, sp + movs r2, 0x70 + bl sub_81DB368 + 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 + .align 2, 0 +_080711B4: .4byte 0x085ef888 + 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, _080711FC + mov r8, r0 + ldr r0, [r0] + ldr r4, _08071200 + 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 + .align 2, 0 +_080711FC: .4byte 0x03005d8c +_08071200: .4byte 0x00003030 + 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, _08071234 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0x8] + bl sub_81AE604 + adds r1, r0, 0 + ldr r0, _08071238 + 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 + .align 2, 0 +_08071234: .4byte 0x03005e00 +_08071238: .4byte 0x030022c0 +_0807123C: + ldr r0, _08071244 + strh r1, [r0] + b _0807124E + .align 2, 0 +_08071244: .4byte 0x020375f0 +_08071248: + ldr r1, _0807127C + movs r0, 0x2 + strh r0, [r1] +_0807124E: + ldr r0, _08071280 + 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 Window_Remove + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + b _080712B4 + .align 2, 0 +_0807127C: .4byte 0x020375f0 +_08071280: .4byte 0x03005e00 +_08071284: + movs r1, 0x2 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _080712B4 + ldr r0, _080712BC + 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 Window_Remove + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080712B4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080712BC: .4byte 0x020375f0 + thumb_func_end c3_080469FC + + thumb_func_start sub_80712C0 +sub_80712C0: @ 80712C0 + push {r4,r5,lr} + sub sp, 0x18 + ldr r0, _08071320 + bl Window_AddFromTemplate + 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, _08071324 + 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 calls_per_item_funcs_in_list_outer + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08071328 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0807132C + 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 + .align 2, 0 +_08071320: .4byte 0x0832b6c0 +_08071324: .4byte 0x0832b6e0 +_08071328: .4byte c3_080469FC + 1 +_0807132C: .4byte 0x03005e00 + thumb_func_end sub_80712C0 + + thumb_func_start sub_8071330 +sub_8071330: @ 8071330 + push {lr} + bl sub_81B9328 + ldr r1, _08071340 + ldr r0, _08071344 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_08071340: .4byte 0x030022c0 +_08071344: .4byte c2_exit_to_overworld_2_switch + 1 + 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, _0807156C + adds r5, r0 + ldr r1, _08071570 + 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 get_pokemon_name + adds r0, r5, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl species_to_pokedex_index + 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, _08071574 + 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 + .align 2, 0 +_0807156C: .4byte 0x020244ec +_08071570: .4byte 0x02024744 +_08071574: .4byte 0x02021cc4 + thumb_func_end sub_80714B8 + + thumb_func_start sub_8071578 +sub_8071578: @ 8071578 + push {lr} + ldr r0, _08071588 + ldrb r0, [r0] + bl sub_80714B8 + pop {r0} + bx r0 + .align 2, 0 +_08071588: .4byte 0x020375e0 + 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 sub_80092BC + adds r5, r4, 0 + adds r5, 0x74 + cmp r0, 0 + bne _080715CE + ldr r0, _080715F8 + ldr r0, [r0] + adds r1, r5, 0 + bl sub_80092BC + cmp r0, 0 + beq _08071608 +_080715CE: + ldr r0, _080715FC + mov r1, sp + bl gf_strcpy + ldr r0, _08071600 + adds r4, 0x87 + ldrb r2, [r4] + lsls r2, 28 + lsrs r2, 28 + adds r1, r5, 0 + bl sub_81DB5E8 + ldr r0, _08071604 + ldrb r2, [r4] + lsrs r2, 4 + adds r1, r6, 0 + bl sub_81DB5E8 + movs r0, 0x1 + b _0807160A + .align 2, 0 +_080715F8: .4byte 0x03005d90 +_080715FC: .4byte 0x02021cc4 +_08071600: .4byte 0x02021dc4 +_08071604: .4byte 0x02021ec4 +_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, _08071630 + ldr r0, [r0] + ldr r1, _08071634 + adds r0, r1 + ldr r1, _08071638 + ldrb r1, [r1] + bl sub_807158C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08071630: .4byte 0x03005d8c +_08071634: .4byte 0x00003030 +_08071638: .4byte 0x020375e0 + 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, _08071684 + 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, _08071684 + adds r5, r1, r0 + movs r4, 0x3 +_0807167A: + cmp r6, 0 + beq _08071688 + cmp r6, 0x1 + beq _080716D8 + b _08071712 + .align 2, 0 +_08071684: .4byte 0x020244ec +_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, _080716D0 + adds r0, r1 + ldr r1, _080716D4 + 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 sub_8034B50 + adds r0, r5, 0 + bl sub_806E794 + bl gpu_pal_obj_decompress_and_apply + mov r0, r9 + strh r4, [r0] + b _08071712 + .align 2, 0 +_080716D0: .4byte 0x0830a18c +_080716D4: .4byte 0x020244d4 +_080716D8: + adds r0, r5, 0 + bl sub_806E794 + ldrh r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_806A068 + ldr r0, _08071720 + movs r1, 0x78 + movs r2, 0x4B + movs r3, 0x6 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _08071724 + 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, _08071728 + str r0, [r1] +_08071712: + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08071720: .4byte 0x0202499c +_08071724: .4byte 0x02020630 +_08071728: .4byte nullsub_12 + 1 + thumb_func_end sub_807163C + + thumb_func_start sub_807172C +sub_807172C: @ 807172C + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + 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, _0807175C + movs r1, 0xA + bl AddTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .align 2, 0 +_0807175C: .4byte sub_8071760 + 1 + 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, _08071790 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08071788 + bl overworld_free_bg_tilemaps + ldr r0, _08071794 + bl set_callback2 + ldr r1, _08071798 + ldr r0, _0807179C + str r0, [r1] + adds r0, r4, 0 + bl remove_task +_08071788: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08071790: .4byte 0x02037fd4 +_08071794: .4byte c1_hatching_egg + 1 +_08071798: .4byte 0x03005dac +_0807179C: .4byte sub_80AF168 + 1 + thumb_func_end sub_8071760 + + thumb_func_start c1_hatching_egg +c1_hatching_egg: @ 80717A0 + push {r4,lr} + sub sp, 0x4 + ldr r0, _080717C0 + 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, _080717C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080717C0: .4byte 0x030022c0 +_080717C4: .4byte _080717C8 + .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 lcd_io_set + ldr r4, _080718A4 + movs r0, 0x14 + bl malloc + str r0, [r4] + bl init_uns_table_pokemon_copy + ldr r2, [r4] + ldr r0, _080718A8 + ldrh r0, [r0] + movs r1, 0 + strb r0, [r2, 0x4] + ldr r0, [r4] + strb r1, [r0, 0x7] + ldr r0, _080718AC + bl SetVBlankCallback + bl current_map_music_get + ldr r1, _080718B0 + strh r0, [r1] + bl reset_temp_tile_data_buffers + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080718B4 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x80 + lsls r0, 5 + bl malloc + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + movs r0, 0x80 + lsls r0, 6 + bl malloc + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + bl TextBox_ResetSomeField + bl sub_80A1A74 + bl gpu_pal_allocator_reset + bl reset_all_obj_data + bl clear_tasks + bl remove_some_task + bl SoundVSyncOn_rev01 + b _080719A6 + .align 2, 0 +_080718A4: .4byte 0x03000de0 +_080718A8: .4byte 0x020375e0 +_080718AC: .4byte sub_807172C + 1 +_080718B0: .4byte 0x020375e2 +_080718B4: .4byte 0x0832c064 +_080718B8: + ldr r0, _080718C8 + bl Window_InitFromTemplates + ldr r0, _080718CC + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x8] + b _080719A6 + .align 2, 0 +_080718C8: .4byte 0x0832c06c +_080718CC: .4byte 0x03000de0 +_080718D0: + ldr r1, _080718F8 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _080718FC + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r0, _08071900 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + b _080719A6 + .align 2, 0 +_080718F8: .4byte 0x08c00000 +_080718FC: .4byte 0x08c00524 +_08071900: .4byte 0x08c004e0 +_08071904: + ldr r0, _08071918 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807191C + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _08071920 + bl gpu_pal_obj_alloc_tag_and_apply + b _080719A6 + .align 2, 0 +_08071918: .4byte 0x0832bfe4 +_0807191C: .4byte 0x0832bfec +_08071920: .4byte 0x0832bff4 +_08071924: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _08071938 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + bl sub_80714B8 + b _080719A6 + .align 2, 0 +_08071938: .4byte 0x03000de0 +_0807193C: + ldr r0, _08071950 + ldr r3, [r0] + ldrb r2, [r3, 0x4] + adds r3, 0xC + movs r0, 0 + movs r1, 0 + bl sub_807163C + b _080719A6 + .align 2, 0 +_08071950: .4byte 0x03000de0 +_08071954: + ldr r4, _0807196C + 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 + .align 2, 0 +_0807196C: .4byte 0x03000de0 +_08071970: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _080719B8 + movs r1, 0x10 + movs r2, 0xA0 + bl gpu_pal_apply + ldr r1, _080719BC + movs r2, 0xA1 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _080719C0 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram +_080719A6: + ldr r1, _080719C4 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080719D6 + .align 2, 0 +_080719B8: .4byte 0x08dd7300 +_080719BC: .4byte 0x08dd7360 +_080719C0: .4byte 0x08331f60 +_080719C4: .4byte 0x030022c0 +_080719C8: + ldr r0, _080719F4 + bl set_callback2 + ldr r0, _080719F8 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x2] +_080719D6: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080719F4: .4byte sub_8071A94 + 1 +_080719F8: .4byte 0x03000de0 + thumb_func_end c1_hatching_egg + + thumb_func_start sub_80719FC +sub_80719FC: @ 80719FC + push {lr} + ldr r0, _08071A28 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08071A2C + adds r0, r1 + ldr r2, _08071A30 + movs r1, 0x2 + bl pokemon_setattr + bl sub_805F094 + ldr r0, _08071A34 + ldr r0, [r0] + bl free + ldr r0, _08071A38 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08071A28: .4byte 0x020375e0 +_08071A2C: .4byte 0x020244ec +_08071A30: .4byte 0x02021ec4 +_08071A34: .4byte 0x03000de0 +_08071A38: .4byte c2_exit_to_overworld_2_switch + 1 + 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, _08071A8C + 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, _08071A90 + 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 + .align 2, 0 +_08071A8C: .4byte 0x03005e00 +_08071A90: .4byte 0x00000179 + 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, _08071AB8 + ldr r0, [r1] + ldrb r0, [r0, 0x2] + adds r5, r1, 0 + cmp r0, 0xC + bls _08071AAC + b _08071E06 +_08071AAC: + lsls r0, 2 + ldr r1, _08071ABC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08071AB8: .4byte 0x03000de0 +_08071ABC: .4byte _08071AC0 + .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 sub_80A1AD4 + ldr r0, _08071B34 + movs r1, 0x78 + movs r2, 0x4B + movs r3, 0x5 + bl obj_add_from_template_forward_search + ldr r4, _08071B38 + ldr r1, [r4] + strb r0, [r1] + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + ldr r1, [r4] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r0, _08071B3C + movs r1, 0x5 + bl AddTask + b _08071E06 + .align 2, 0 +_08071B34: .4byte 0x0832bffc +_08071B38: .4byte 0x03000de0 +_08071B3C: .4byte c3_080472E4 + 1 +_08071B40: + ldr r0, _08071B64 + 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 Window_FastFillPixels + ldr r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + b _08071DC8 + .align 2, 0 +_08071B64: .4byte 0x02037fd4 +_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, _08071B98 + ldr r0, [r5] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _08071B9C + str r1, [r0] + b _08071E06 + .align 2, 0 +_08071B98: .4byte 0x02020630 +_08071B9C: .4byte sub_8071E34 + 1 +_08071BA0: + ldr r4, _08071BEC + 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, _08071BF0 + cmp r1, r0 + beq _08071BBC + b _08071E06 +_08071BBC: + ldrb r1, [r2, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08071BF4 + 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 + .align 2, 0 +_08071BEC: .4byte 0x02020630 +_08071BF0: .4byte nullsub_12 + 1 +_08071BF4: .4byte 0x020244ec +_08071BF8: + ldr r2, _08071C1C + 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, _08071C20 + cmp r1, r0 + beq _08071C12 + b _08071E06 +_08071C12: + ldrb r0, [r3, 0x2] + adds r0, 0x1 + strb r0, [r3, 0x2] + b _08071E06 + .align 2, 0 +_08071C1C: .4byte 0x02020630 +_08071C20: .4byte nullsub_12 + 1 +_08071C24: + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08071C74 + adds r0, r1 + ldr r1, _08071C78 + bl pokemon_get_nick + ldr r4, _08071C7C + ldr r1, _08071C80 + adds r0, r4, 0 + bl ExpandTextCodes + 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, _08071C84 + 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 Window_WriteStandardTileMap + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0x3 + bl Window_CopyToVram + b _08071E06 + .align 2, 0 +_08071C74: .4byte 0x020244ec +_08071C78: .4byte 0x02021cc4 +_08071C7C: .4byte 0x02021fc4 +_08071C80: .4byte 0x085ed5a5 +_08071C84: .4byte 0x00000173 +_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, _08071CD8 + adds r0, r1 + ldr r1, _08071CDC + bl pokemon_get_nick + ldr r4, _08071CE0 + ldr r1, _08071CE4 + adds r0, r4, 0 + bl ExpandTextCodes + 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 + .align 2, 0 +_08071CD8: .4byte 0x020244ec +_08071CDC: .4byte 0x02021cc4 +_08071CE0: .4byte 0x02021fc4 +_08071CE4: .4byte 0x085ed5be +_08071CE8: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + bl a_pressed_maybe + 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, _08071D18 + adds r1, r4, 0 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + ldr r1, [r5] + b _08071DC8 + .align 2, 0 +_08071D18: .4byte 0x0832c07c +_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, _08071DA4 + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + movs r6, 0x64 + muls r0, r6 + ldr r5, _08071DA8 + adds r0, r5 + ldr r1, _08071DAC + 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, _08071DB0 + 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 + .align 2, 0 +_08071DA4: .4byte 0x03000de0 +_08071DA8: .4byte 0x020244ec +_08071DAC: .4byte 0x02021ec4 +_08071DB0: .4byte sub_80719FC + 1 +_08071DB4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_08071DC4: + ldr r0, _08071DD0 + ldr r1, [r0] +_08071DC8: + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + b _08071E06 + .align 2, 0 +_08071DD0: .4byte 0x03000de0 +_08071DD4: + ldr r0, _08071E28 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08071E06 + bl sub_805F094 + ldr r4, _08071E2C + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl Window_Remove + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + ldr r0, [r4] + bl free + ldr r0, _08071E30 + bl set_callback2 +_08071E06: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + 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 + .align 2, 0 +_08071E28: .4byte 0x02037fd4 +_08071E2C: .4byte 0x03000de0 +_08071E30: .4byte c2_exit_to_overworld_2_switch + 1 + 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, _08071E50 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x2E] + b _08071E84 + .align 2, 0 +_08071E50: .4byte sub_8071E8C + 1 +_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 obj_anim_image_start + 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, _08071EB8 + str r0, [r4, 0x1C] + strh r1, [r4, 0x2E] + strh r1, [r4, 0x32] + b _08071EE8 + .align 2, 0 +_08071EB8: .4byte sub_8071EF0 + 1 +_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 obj_anim_image_start +_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, _08071F4C + str r0, [r4, 0x1C] + strh r5, [r4, 0x2E] + ldr r4, _08071F50 + ldr r0, [r4] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08071F54 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + ldr r3, _08071F58 + 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 + .align 2, 0 +_08071F4C: .4byte sub_8071FA4 + 1 +_08071F50: .4byte 0x03000de0 +_08071F54: .4byte 0x020244ec +_08071F58: .4byte 0x02020630 +_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 obj_anim_image_start + 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, _08071FC4 + str r0, [r1, 0x1C] + movs r0, 0 + strh r0, [r1, 0x2E] +_08071FBE: + pop {r0} + bx r0 + .align 2, 0 +_08071FC4: .4byte sub_8071FC8 + 1 + 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, _0807203C + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_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, _08072040 + 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, _08072044 + str r0, [r5, 0x1C] + strh r4, [r5, 0x2E] +_08072032: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807203C: .4byte 0x0000ffff +_08072040: .4byte 0x02037fd4 +_08072044: .4byte sub_8072048 + 1 + 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, _080720D8 + ldr r3, _080720DC + 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 sub_8008258 +_08072084: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x8 + bne _0807209E + movs r1, 0x1 + negs r1, r1 + ldr r0, _080720E0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_0807209E: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x9 + bgt _080720BC + ldr r2, _080720D8 + ldr r0, _080720DC + 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, _080720E4 + str r0, [r5, 0x1C] +_080720CA: + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080720D8: .4byte 0x02020630 +_080720DC: .4byte 0x03000de0 +_080720E0: .4byte 0x0000ffff +_080720E4: .4byte nullsub_12 + 1 + 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 obj_delete_and_free_tiles +_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, _0807218C + ldr r0, _08072190 + 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 + .align 2, 0 +_0807218C: .4byte 0x0832c084 +_08072190: .4byte 0x03000de0 + 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, _0807220C + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x4 + bl obj_add_from_template_forward_search + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08072210 + 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 obj_anim_image_start + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807220C: .4byte 0x0832c04c +_08072210: .4byte 0x02020630 + 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 Window_FastFillPixels + ldr r3, _08072288 + 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 sub_8199EEC + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08072288: .4byte 0x03000de0 + 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, _080722C8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080722CC + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x28 + beq _080722C4 + cmp r0, 0x31 + bne _080722CC +_080722C4: + movs r0, 0x2 + b _080722D8 + .align 2, 0 +_080722C8: .4byte 0x020244ec +_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, _08072564 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _08072568 + 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, _0807256C + adds r0, r4, 0 + ands r1, r0 + ldr r0, _08072570 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + b _080725BA + .align 2, 0 +_08072564: .4byte 0x0832c140 +_08072568: .4byte 0x02020630 +_0807256C: .4byte 0x000003ff +_08072570: .4byte 0xfffffc00 +_08072574: + ldr r4, _080725DC + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080725E0 + 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, _080725E4 + adds r0, r5, 0 + ands r1, r0 + ldr r0, _080725E8 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + movs r0, 0x2 + str r0, [sp] +_080725BA: + ldr r2, _080725E0 + 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, _080725EC + str r1, [r0] + b _08072718 + .align 2, 0 +_080725DC: .4byte 0x0832c170 +_080725E0: .4byte 0x02020630 +_080725E4: .4byte 0x000003ff +_080725E8: .4byte 0xfffffc00 +_080725EC: .4byte sub_8072924 + 1 +_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, _08072680 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_backward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _08072684 + 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, _08072688 + adds r0, r5, 0 + ands r1, r0 + ldr r0, _0807268C + mov r5, r8 + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r4, 0x1C + adds r2, r4 + ldr r0, _08072690 + str r0, [r2] + movs r0, 0x1 + b _08072716 + .align 2, 0 +_08072680: .4byte 0x0832c140 +_08072684: .4byte 0x02020630 +_08072688: .4byte 0x000003ff +_0807268C: .4byte 0xfffffc00 +_08072690: .4byte sub_8072924 + 1 +_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, _080727DC + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_backward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _080727E0 + 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, _080727E4 + adds r0, r5, 0 + ands r1, r0 + ldr r0, _080727E8 + mov r5, r8 + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r4, 0x1C + adds r2, r4 + ldr r0, _080727EC + str r0, [r2] + movs r0, 0x2 +_08072716: + str r0, [sp] +_08072718: + ldr r0, _080727F0 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, _080727F4 + adds r0, r1 + movs r1, 0x8C + movs r2, 0x3C + movs r3, 0 + bl obj_add_from_template_backward_search + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, _080727E0 + 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, _080727F8 + adds r1, r0 + adds r0, r4, 0 + bl obj_set_f18_to_r0_f42_to_40 + 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, _080727FC + adds r1, r2 + ldr r2, _08072800 + 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 + .align 2, 0 +_080727DC: .4byte 0x0832c170 +_080727E0: .4byte 0x02020630 +_080727E4: .4byte 0x000003ff +_080727E8: .4byte 0xfffffc00 +_080727EC: .4byte sub_8072924 + 1 +_080727F0: .4byte 0x02024076 +_080727F4: .4byte 0x0832c1c0 +_080727F8: .4byte 0x0832c28c +_080727FC: .4byte 0x06010000 +_08072800: .4byte 0x04000010 + 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, _08072890 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08072894 + 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, _08072898 + adds r1, r7, 0 + ands r2, r1 + ldr r1, _0807289C + 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, _080728A0 + str r0, [r3] + adds r0, r6, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08072890: .4byte 0x0832c1a0 +_08072894: .4byte 0x02020630 +_08072898: .4byte 0x000003ff +_0807289C: .4byte 0xfffffc00 +_080728A0: .4byte sub_8072924 + 1 + thumb_func_end battle_make_oam_safari_battle + + thumb_func_start sub_80728A4 +sub_80728A4: @ 80728A4 + lsls r0, 24 + lsrs r0, 19 + ldr r1, _080728B0 + adds r0, r1 + bx lr + .align 2, 0 +_080728B0: .4byte 0x08c11bdc + 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, _080728E0 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x10 + b _08072906 + .align 2, 0 +_080728E0: .4byte 0x02020630 +_080728E4: + ldr r2, _080728F4 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x10 + b _08072906 + .align 2, 0 +_080728F4: .4byte 0x02020630 +_080728F8: + ldr r2, _08072920 + 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 + .align 2, 0 +_08072920: .4byte 0x02020630 + 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, _08072948 + 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 + .align 2, 0 +_08072948: .4byte 0x02020630 + 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, _0807297C + 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, _08072980 + str r0, [r4, 0x10] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807297C: .4byte 0x020244d0 +_08072980: .4byte 0xffff8000 + thumb_func_end sub_807294C + + thumb_func_start sub_8072984 +sub_8072984: @ 8072984 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080729CC + 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 + .align 2, 0 +_080729CC: .4byte 0x02020630 + 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, _08072A20 + 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 + .align 2, 0 +_08072A20: .4byte 0x02020630 + thumb_func_end sub_80729D0 + + thumb_func_start sub_8072A24 +sub_8072A24: @ 8072A24 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08072A40 + 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 + .align 2, 0 +_08072A40: .4byte 0x02020630 + 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, _08072A80 + 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 obj_delete_and_free_tiles + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + adds r0, r4, 0 + bl obj_delete_and_free_tiles + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08072A80: .4byte 0x02020630 + 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, _08072B0C + mov r8, r1 + ldrb r2, [r1] + cmp r6, r2 + bge _08072B00 + ldr r1, _08072B10 + mov r12, r1 + movs r1, 0x3 + ands r0, r1 + lsls r5, r0, 2 + movs r7, 0xD + negs r7, r7 + ldr r2, _08072B14 + 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 + .align 2, 0 +_08072B0C: .4byte 0x0202406c +_08072B10: .4byte 0x02020630 +_08072B14: .4byte 0x03005d70 + 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, _08072B90 + 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 + .align 2, 0 +_08072B90: .4byte 0x03005d70 + 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 decimal_int_to_string + 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, _08072C0C + 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, _08072C10 + adds r1, r4, r2 + cmp r0, 0 + bne _08072C1C + ldr r0, _08072C14 + adds r1, r4, r0 + b _08072C1C + .align 2, 0 +_08072C0C: .4byte 0x02020630 +_08072C10: .4byte 0x06010420 +_08072C14: .4byte 0x06010820 +_08072C18: + ldr r2, _08072C34 + 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 + .align 2, 0 +_08072C34: .4byte 0x06010400 + 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, _08072CB0 + 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 decimal_int_to_string + 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, _08072CB4 + adds r0, r5, r1 + adds r1, r4, 0 + b _08072CF8 + .align 2, 0 +_08072CB0: .4byte 0x02020630 +_08072CB4: .4byte 0x06010b40 +_08072CB8: + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + 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, _08072D08 + adds r0, r5, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8075170 + ldr r2, _08072D0C + 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 + .align 2, 0 +_08072D08: .4byte 0x060103e0 +_08072D0C: .4byte 0x06010b00 +_08072D10: + ldr r1, _08072D58 + add r0, sp, 0x4 + movs r2, 0x14 + bl memcpy + ldr r1, _08072D5C + 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 + .align 2, 0 +_08072D58: .4byte 0x0832c3c4 +_08072D5C: .4byte 0x02020630 +_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 decimal_int_to_string + ldr r0, _08072DFC + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x9 + add r2, sp, 0x4 + bl font_render_some + movs r4, 0 + ldr r1, _08072E00 + mov r2, r10 + adds r0, r2, r7 + lsls r0, 2 + adds r5, r0, r1 +_08072DB8: + ldr r0, _08072DFC + 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, _08072E04 + adds r1, r2 + ldr r2, _08072E08 + 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 + .align 2, 0 +_08072DFC: .4byte 0x020244d4 +_08072E00: .4byte 0x02020630 +_08072E04: .4byte 0x06010000 +_08072E08: .4byte 0x04000008 + 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, _08072EC4 + 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, _08072EC8 + 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, _08072ECC + 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 decimal_int_to_string + 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, _08072ED0 + 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, _08072ED4 + adds r1, r2 + ldr r2, _08072ED8 + bl CpuSet + b _080730B8 + .align 2, 0 +_08072EC4: .4byte 0x02020630 +_08072EC8: .4byte 0x020244d0 +_08072ECC: .4byte 0x06010000 +_08072ED0: .4byte 0x060100c0 +_08072ED4: .4byte 0x06010680 +_08072ED8: .4byte 0x04000008 +_08072EDC: + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + 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, _08072F24 + adds r0, r5, r3 + adds r1, r4, 0 + movs r2, 0x3 + bl sub_8075170 + ldr r0, [sp, 0x28] + bl sub_807512C + b _080730B8 + .align 2, 0 +_08072F24: .4byte 0x06010060 +_08072F28: + ldr r1, _08072FD8 + 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, _08072FDC + 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 decimal_int_to_string + mov r3, r8 + cmp r3, 0 + bne _08072F82 + ldr r1, _08072FE0 + bl gf_strcpy +_08072F82: + ldr r0, _08072FE4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x9 + add r2, sp, 0x4 + bl font_render_some + 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, _08072FE4 + 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, _08072FE8 + adds r1, r3 + ldr r2, _08072FEC + bl CpuSet + b _0807301A + .align 2, 0 +_08072FD8: .4byte 0x0832c3d8 +_08072FDC: .4byte 0x020244d0 +_08072FE0: .4byte 0x085e8d3e +_08072FE4: .4byte 0x020244d4 +_08072FE8: .4byte 0x06010000 +_08072FEC: .4byte 0x04000008 +_08072FF0: + ldr r0, _0807306C + 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, _08073070 + adds r1, r2 + ldr r2, _08073074 + 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, _0807306C + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + adds r0, 0xE0 + ldr r1, _08073078 + 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, _0807307C + adds r1, r5 + ldr r2, _08073074 + 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, _08073080 + bl CpuSet + b _080730B8 + .align 2, 0 +_0807306C: .4byte 0x020244d4 +_08073070: .4byte 0x06010020 +_08073074: .4byte 0x04000008 +_08073078: .4byte 0x02020630 +_0807307C: .4byte 0x06010000 +_08073080: .4byte 0x05000008 +_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, _080730C8 + 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, _080730CC + adds r1, r2 + ldr r2, _080730D0 + 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 + .align 2, 0 +_080730C8: .4byte 0x02020630 +_080730CC: .4byte 0x06010000 +_080730D0: .4byte 0x04000008 + 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, _0807317C + mov r0, sp + movs r2, 0x14 + bl memcpy + ldr r1, _08073180 + 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, _08073184 + 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 get_nature + lsls r0, 24 + mov r4, sp + adds r4, 0x6 + ldr r1, _08073188 + lsrs r0, 22 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcpy + adds r0, r6, 0 + movs r1, 0x9 + mov r2, sp + bl font_render_some + 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 + .align 2, 0 +_0807317C: .4byte 0x0832c3c4 +_08073180: .4byte 0x02020630 +_08073184: .4byte 0x020244d4 +_08073188: .4byte 0x0861cb50 +_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, _080732C0 + 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, _080732C4 + ldr r2, _080732C0 + 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, _080732C8 + 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, _080732C8 + 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, _080732C4 + 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, _080732CC + ldr r0, [r5] + adds r0, 0x7C + ldrb r1, [r0] + mov r0, sp + adds r0, 0x6 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, [r5] + adds r0, 0x7B + ldrb r1, [r0] + ldr r0, [sp, 0x1C] + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0xBA + strb r0, [r1, 0x8] + ldr r5, _080732D0 + ldr r0, [r5] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + movs r1, 0x9 + mov r2, sp + bl font_render_some + 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, _080732C8 + adds r1, r2 + ldr r2, _080732C0 + bl CpuSet + b _080732F4 + .align 2, 0 +_080732C0: .4byte 0x04000008 +_080732C4: .4byte 0x02020630 +_080732C8: .4byte 0x06010000 +_080732CC: .4byte 0x0202449c +_080732D0: .4byte 0x020244d4 +_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, _0807330C + adds r1, r2 + ldr r2, _08073310 + 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 + .align 2, 0 +_0807330C: .4byte 0x060100c0 +_08073310: .4byte 0x04000008 + 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, _08073440 + ldrb r0, [r0] + cmp r9, r0 + blt _0807332E + b _080735BA +_0807332E: + ldr r1, _08073444 + mov r10, r1 + ldr r2, _08073448 + mov r8, r2 +_08073336: + ldr r0, _0807344C + 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, _08073450 + 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, _08073454 + 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, _08073458 + 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, _0807345C + adds r1, r2 + mov r0, sp + ldr r2, _08073460 + bl CpuSet + ldrb r4, [r6] + mov r1, r8 + ldrh r0, [r1] + movs r2, 0x64 + muls r0, r2 + ldr r1, _08073464 + 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, _08073464 + b _08073536 + .align 2, 0 +_08073440: .4byte 0x0202406c +_08073444: .4byte 0x02020630 +_08073448: .4byte 0x0202406e +_0807344C: .4byte 0x03005d70 +_08073450: .4byte nullsub_12 + 1 +_08073454: .4byte 0x020244d0 +_08073458: .4byte 0x02022fec +_0807345C: .4byte 0x06010000 +_08073460: .4byte 0x05000040 +_08073464: .4byte 0x020244ec +_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, _080734A4 + 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, _080734A8 + adds r1, r2 + ldr r2, _080734AC + bl CpuSet + b _08073592 + .align 2, 0 +_080734A4: .4byte 0x020244ec +_080734A8: .4byte 0x06010680 +_080734AC: .4byte 0x04000008 +_080734B0: + cmp r4, 0x1 + bne _0807355C + ldr r0, _080734D4 + 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, _080734D8 + adds r1, r2 + bl sub_80730D4 + b _08073592 + .align 2, 0 +_080734D4: .4byte 0x02022fec +_080734D8: .4byte 0x02024744 +_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, _08073550 + adds r1, r0 + mov r0, sp + ldr r2, _08073554 + bl CpuSet + ldrb r4, [r6] + mov r1, r8 + ldrh r0, [r1] + movs r2, 0x64 + muls r0, r2 + ldr r1, _08073558 + 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, _08073558 +_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 + .align 2, 0 +_08073550: .4byte 0x06010000 +_08073554: .4byte 0x05000040 +_08073558: .4byte 0x02024744 +_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, _080735CC + adds r1, r4 + movs r2, 0x5 + bl healthbar_draw_field_maybe + ldr r0, _080735D0 + 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, _080735D4 + 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, _080735D8 + 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 + .align 2, 0 +_080735CC: .4byte 0x02024744 +_080735D0: .4byte 0x02022fec +_080735D4: .4byte 0x03005d70 +_080735D8: .4byte 0x0202406c + 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, _0807362C + mov r8, r2 + b _0807366C + .align 2, 0 +_0807362C: .4byte 0x0000fffb +_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, _08073658 + mov r10, r6 + movs r0, 0x5 + mov r8, r0 + b _0807366C + .align 2, 0 +_08073658: .4byte 0x0000ff9c +_0807365C: + movs r1, 0x1 + mov r9, r1 + movs r5, 0x68 + movs r4, 0x28 + ldr r2, _080736E0 + mov r10, r2 + movs r3, 0x5 + mov r8, r3 +_0807366C: + ldr r0, _080736E4 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _080736E8 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _080736EC + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _080736F0 + bl gpu_pal_obj_alloc_tag_and_apply + mov r0, r9 + lsls r6, r0, 1 + adds r0, r6, r0 + lsls r0, 3 + ldr r1, _080736F4 + adds r0, r1 + lsls r5, 16 + asrs r1, r5, 16 + lsls r4, 16 + asrs r2, r4, 16 + movs r3, 0xA + bl obj_add_from_template_forward_search + 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, _080736F8 + adds r7, r0, r1 + ldr r1, _080736FC + adds r0, r7, 0 + bl obj_set_f18_to_r0_f42_to_40 + 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 + .align 2, 0 +_080736E0: .4byte 0x0000ff9c +_080736E4: .4byte 0x0832c334 +_080736E8: .4byte 0x0832c34c +_080736EC: .4byte 0x0832c33c +_080736F0: .4byte 0x0832c344 +_080736F4: .4byte 0x0832c364 +_080736F8: .4byte 0x02020630 +_080736FC: .4byte 0x0832c2c4 +_08073700: + ldrh r0, [r7, 0x20] + adds r0, 0x60 + strh r0, [r7, 0x20] +_08073706: + movs r0, 0 + mov r8, r0 + ldr r1, _080737B4 + 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, _080737B8 + ldr r3, [sp, 0x20] + ldr r1, _080737BC + 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 obj_add_from_template_backward_search + 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, _080737C0 + adds r1, r2 + ldr r0, _080737C4 + str r0, [r1] +_0807374C: + ldr r4, _080737B4 + 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 + .align 2, 0 +_080737B4: .4byte 0x02020630 +_080737B8: .4byte 0x0832c394 +_080737BC: .4byte 0xfffc0000 +_080737C0: .4byte 0x0202064c +_080737C4: .4byte sub_80741C8 + 1 +_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, _08073890 +_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, _08073894 + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + cmp r1, 0 + beq _080738F4 + ldr r5, _08073898 + mov r10, r5 + ldr r6, _0807389C + ldr r0, _080738A0 + adds r7, r0, 0 + ldr r1, _080738A4 + 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 + .align 2, 0 +_08073890: .4byte 0x0000ff88 +_08073894: .4byte 0x02022fec +_08073898: .4byte 0x0000ffff +_0807389C: .4byte 0x02020630 +_080738A0: .4byte 0x000003ff +_080738A4: .4byte 0xfffffc00 +_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, _08073948 + mov r8, r2 + ldr r3, _0807394C + mov r9, r3 + ldr r5, _08073950 + mov r12, r5 + ldr r6, [sp, 0xC] + mov r5, sp +_0807390A: + ldrh r0, [r6] + ldr r1, _08073954 + 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 + .align 2, 0 +_08073948: .4byte 0x02020630 +_0807394C: .4byte 0x000003ff +_08073950: .4byte 0xfffffc00 +_08073954: .4byte 0x0000ffff +_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, _080739AC + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _080739B8 + ldr r0, _080739B0 + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r0, r2 + ldrb r1, [r0] + ldr r2, _080739B4 + 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 + .align 2, 0 +_080739AC: .4byte 0x02022fec +_080739B0: .4byte 0x0202449c +_080739B4: .4byte 0x0832a328 +_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, _08073A40 + ldr r1, [r0] + ldr r2, _08073A44 + ands r1, r2 + cmp r1, 0 + beq _08073AA4 + ldr r1, _08073A48 + mov r10, r1 + ldr r6, _08073A4C + ldr r2, _08073A50 + adds r7, r2, 0 + ldr r3, _08073A54 + 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 + .align 2, 0 +_08073A40: .4byte 0x02022fec +_08073A44: .4byte 0x00008040 +_08073A48: .4byte 0x0000ffff +_08073A4C: .4byte 0x02020630 +_08073A50: .4byte 0x000003ff +_08073A54: .4byte 0xfffffc00 +_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, _08073AF8 + mov r9, r5 + ldr r6, _08073AFC + mov r12, r6 + ldr r0, _08073B00 + mov r10, r0 + ldr r6, [sp, 0xC] + mov r5, sp + adds r5, 0x5 +_08073ABC: + ldrh r0, [r6] + ldr r1, _08073B04 + 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 + .align 2, 0 +_08073AF8: .4byte 0x02020630 +_08073AFC: .4byte 0x000003ff +_08073B00: .4byte 0xfffffc00 +_08073B04: .4byte 0x0000ffff +_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, _08073B5C + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08073B6C + ldr r2, _08073B60 + ldr r0, [r2] + ldr r3, _08073B64 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r7, 2 + ldr r2, _08073B68 + 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 + .align 2, 0 +_08073B5C: .4byte 0x02022fec +_08073B60: .4byte 0x0202449c +_08073B64: .4byte 0x000002a1 +_08073B68: .4byte 0x0832a328 +_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, _08073C24 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _08073C28 + 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, _08073C2C + 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 + .align 2, 0 +_08073C24: .4byte nullsub_4 + 1 +_08073C28: .4byte 0x03005e00 +_08073C2C: .4byte 0x020244d0 + 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, _08073D40 + 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 lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldr r1, _08073D40 + 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, _08073D44 + 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, _08073D48 + str r1, [r0] + ldr r2, _08073D44 + mov r12, r2 + b _08073D82 + .align 2, 0 +_08073D40: .4byte 0x03005e00 +_08073D44: .4byte 0x02020630 +_08073D48: .4byte sub_8074158 + 1 +_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, _08073DC8 + str r1, [r0] + ldr r0, _08073DCC + 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, _08073DD0 + str r1, [r3] + ldr r1, _08073DD4 + bl obj_set_f18_to_r0_f42_to_40 + ldr r1, _08073DD8 + ldr r0, [sp, 0xC] + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, _08073DDC + str r1, [r0] + b _08073DEE + .align 2, 0 +_08073DC8: .4byte sub_8074158 + 1 +_08073DCC: .4byte 0x02020630 +_08073DD0: .4byte sub_8074090 + 1 +_08073DD4: .4byte 0x0832c2cc +_08073DD8: .4byte 0x03005e00 +_08073DDC: .4byte task_battle_throw_own_ball + 1 +_08073DE0: + ldr r0, _08073E00 + ldr r1, [sp, 0xC] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, _08073E04 + 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 + .align 2, 0 +_08073E00: .4byte 0x03005e00 +_08073E04: .4byte sub_8073F98 + 1 + 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, _08073E5C + 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 lcd_io_set +_08073E48: + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08073E54 + ldr r0, _08073E60 + str r0, [r4] +_08073E54: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08073E5C: .4byte 0x03005e00 +_08073E60: .4byte sub_8073E64 + 1 + 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, _08073EF0 + 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, _08073EF4 + 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, _08073EF8 + adds r0, r4 + bl obj_delete_and_free_resources + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_resources + b _08073F32 + .align 2, 0 +_08073EF0: .4byte 0x03005e00 +_08073EF4: .4byte 0x020244d0 +_08073EF8: .4byte 0x02020630 +_08073EFC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r5, _08073F50 + adds r4, r5 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + 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 obj_delete_and_free_tiles +_08073F32: + movs r4, 0x1 + ldr r5, _08073F50 +_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 obj_delete_and_free_tiles + adds r4, 0x1 + cmp r4, 0x5 + ble _08073F36 + b _08073F8A + .align 2, 0 +_08073F50: .4byte 0x02020630 +_08073F54: + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _08073F8A + ldr r0, _08073F94 + 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 lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl remove_task +_08073F8A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08073F94: .4byte 0x020244d0 + 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, _08073FD0 + 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 lcd_io_set + b _0807406A + .align 2, 0 +_08073FD0: .4byte 0x03005e00 +_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, _08074030 + adds r0, r4 + bl obj_delete_and_free_resources + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_resources + 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 obj_delete_and_free_tiles + adds r5, 0x1 + cmp r5, 0x5 + ble _08074016 + b _0807406A + .align 2, 0 +_08074030: .4byte 0x02020630 +_08074034: + movs r0, 0x3 + negs r0, r0 + cmp r2, r0 + bne _0807406A + ldr r0, _08074074 + 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 lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl remove_task +_0807406A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08074074: .4byte 0x020244d0 + 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, _08074108 + 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 + .align 2, 0 +_08074108: .4byte 0x0000fff0 +_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, _08074154 + str r0, [r4, 0x1C] +_0807414E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08074154: .4byte nullsub_12 + 1 + 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, _0807418C + 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 + .align 2, 0 +_0807418C: .4byte 0x0000fff0 +_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, _080741C4 + str r0, [r3, 0x1C] +_080741BC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080741C4: .4byte nullsub_12 + 1 + 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, _080741E4 + 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 + .align 2, 0 +_080741E4: .4byte 0x02020630 + 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, _08074258 + ldr r1, _0807425C + adds r0, r5, 0 + bl gf_strcpy + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + add r0, sp, 0x4 + bl get_end_of_string_ptr_limit_10_chars + adds r0, r5, 0 + add r1, sp, 0x4 + bl gf_strcat + 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, _08074260 + adds r1, r0 + add r0, sp, 0x4 + bl sub_8008C44 + cmp r0, 0 + bne _0807424A + movs r6, 0x64 +_0807424A: + cmp r6, 0 + beq _08074268 + cmp r6, 0xFE + beq _08074270 + ldr r1, _08074264 + b _08074272 + .align 2, 0 +_08074258: .4byte 0x02022e2c +_0807425C: .4byte 0x085ed228 +_08074260: .4byte 0x083185c8 +_08074264: .4byte 0x085ed238 +_08074268: + ldr r1, _0807426C + b _08074272 + .align 2, 0 +_0807426C: .4byte 0x085ed22e +_08074270: + ldr r1, _080742D8 +_08074272: + adds r0, r5, 0 + bl gf_strcpy + ldr r0, _080742DC + 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, _080742E0 + 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, _080742E4 + adds r0, r4, r1 + adds r1, r6, 0 + movs r2, 0x6 + bl sub_8075198 + bl battle_type_is_double + lsls r0, 24 + ldr r1, _080742E8 + adds r5, r4, r1 + cmp r0, 0 + bne _080742C8 + ldr r0, _080742EC + adds r5, r4, r0 +_080742C8: + adds r1, r6, 0 + adds r1, 0xC0 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8075198 + b _080742FC + .align 2, 0 +_080742D8: .4byte 0x085ed233 +_080742DC: .4byte 0x02022e2c +_080742E0: .4byte 0x02020630 +_080742E4: .4byte 0x06010040 +_080742E8: .4byte 0x06010400 +_080742EC: .4byte 0x06010800 +_080742F0: + ldr r1, _0807430C + 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 + .align 2, 0 +_0807430C: .4byte 0x06010020 + 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, _080743AC + 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, _080743B0 + 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, _080743B4 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080743B8 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl species_to_pokedex_index + 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, _080743BC + adds r1, r2 + ldr r2, _080743C0 + bl CpuSet + b _080743E6 + .align 2, 0 +_080743AC: .4byte 0x02022fec +_080743B0: .4byte 0x02020630 +_080743B4: .4byte 0x0202406e +_080743B8: .4byte 0x02024744 +_080743BC: .4byte 0x06010000 +_080743C0: .4byte 0x04000008 +_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, _080743F0 + adds r1, r0 + ldr r2, _080743F4 + mov r0, sp + bl CpuSet +_080743E6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080743F0: .4byte 0x06010000 +_080743F4: .4byte 0x05000008 + 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, _0807445C + 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, _08074460 + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08074464 + 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 + .align 2, 0 +_0807445C: .4byte 0x02020630 +_08074460: .4byte 0x0202406e +_08074464: .4byte 0x020244ec +_08074468: + ldr r1, _080744A4 + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080744A8 + 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 + .align 2, 0 +_080744A4: .4byte 0x0202406e +_080744A8: .4byte 0x02024744 +_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, _080745A4 + 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, _080745A8 + adds r1, r3 + adds r0, r6, 0 + ldr r2, _080745AC + bl CpuSet + adds r4, 0x1 + cmp r4, 0x2 + ble _08074542 + ldr r0, _080745B0 + 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, _080745A4 + 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, _080745A8 + adds r1, r2 + ldr r2, _080745B4 + bl CpuSet +_08074598: + mov r0, r9 + movs r1, 0x1 + bl sub_8074310 + b _0807467A + .align 2, 0 +_080745A4: .4byte 0x02020630 +_080745A8: .4byte 0x06010000 +_080745AC: .4byte 0x04000008 +_080745B0: .4byte 0x020244d0 +_080745B4: .4byte 0x04000010 +_080745B8: + mov r1, r9 + lsls r5, r1, 4 + add r5, r9 + lsls r5, 2 + ldr r2, _08074688 + adds r5, r2 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + lsls r4, 4 + adds r4, 0xC + adds r4, r7 + ldr r1, _0807468C + 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, _08074690 + adds r0, r4, r0 + ldr r1, _08074694 + 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, _08074698 + mov r8, r2 + add r1, r8 + ldr r2, _0807469C + 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, _080746A0 + 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, _08074688 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + add r1, r8 + ldr r5, _080746A4 + 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 + .align 2, 0 +_08074688: .4byte 0x02020630 +_0807468C: .4byte 0x0832c3ec +_08074690: .4byte 0x02037914 +_08074694: .4byte 0x05000200 +_08074698: .4byte 0x06010000 +_0807469C: .4byte 0x04000018 +_080746A0: .4byte 0x020244d0 +_080746A4: .4byte 0x04000008 + 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, _080746C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080746C4: .4byte _080746C8 + .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, _080747C8 + 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, _080747CC + 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, _080747D0 + adds r0, r4, r1 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_8075198 + ldr r0, _080747D4 + 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 + .align 2, 0 +_080747C8: .4byte 0x085ccb2c +_080747CC: .4byte 0x02020630 +_080747D0: .4byte 0x06010040 +_080747D4: .4byte 0x06010800 + 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, _0807484C + add r0, sp, 0x4 + bl gf_strcpy + ldr r1, _08074850 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0 + add r1, sp, 0x4 + movs r2, 0x2F + bl sub_81DB368 + 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, _08074854 + 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, _08074858 + adds r0, r4, r1 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80751E4 + ldr r0, _0807485C + 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 + .align 2, 0 +_0807484C: .4byte 0x085ccb3c +_08074850: .4byte 0x0203a04c +_08074854: .4byte 0x02020630 +_08074858: .4byte 0x060102c0 +_0807485C: .4byte 0x06010a00 + 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, _08074A0C + 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, _08074A0C + 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, _08074A10 + mov r12, r0 + lsls r1, r4, 2 + ldr r2, _08074A14 + 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 + .align 2, 0 +_08074A0C: .4byte 0x02020630 +_08074A10: .4byte 0x0831f72c +_08074A14: .4byte 0x083203cc +_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, _08074AE8 + 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 + .align 2, 0 +_08074AE8: .4byte 0x020244d0 +_08074AEC: + ldr r2, _08074B98 + 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, _08074B98 + 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, _08074B98 + 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 + .align 2, 0 +_08074B98: .4byte 0x020244d0 + 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, _08074C4C + 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, _08074C50 + mov r8, r0 +_08074BFA: + ldr r0, _08074C4C + 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, _08074C54 + adds r1, r2 + ldr r2, _08074C58 + bl CpuSet + b _08074C8A + .align 2, 0 +_08074C4C: .4byte 0x020244d0 +_08074C50: .4byte 0x02020630 +_08074C54: .4byte 0x06010000 +_08074C58: .4byte 0x04000008 +_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, _08074C98 + adds r1, r4 + ldr r2, _08074C9C + bl CpuSet +_08074C8A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08074BFA + b _08074D9E + .align 2, 0 +_08074C98: .4byte 0x06010040 +_08074C9C: .4byte 0x04000008 +_08074CA0: + ldr r0, _08074D44 + 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, _08074D48 + lsls r0, r6, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08074D4C + 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, _08074D50 + 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, _08074D44 + 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, _08074D54 + adds r1, r2 + ldr r2, _08074D58 + bl CpuSet + b _08074D94 + .align 2, 0 +_08074D44: .4byte 0x020244d0 +_08074D48: .4byte 0x0202406e +_08074D4C: .4byte 0x020244ec +_08074D50: .4byte 0x02020630 +_08074D54: .4byte 0x06010000 +_08074D58: .4byte 0x04000008 +_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, _08074DAC + 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, _08074DB0 + adds r1, r2 + ldr r2, _08074DB4 + 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 + .align 2, 0 +_08074DAC: .4byte 0x020244d0 +_08074DB0: .4byte 0x06010b80 +_08074DB4: .4byte 0x04000008 + 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, _08074DE4 + cmp r1, r0 + bne _08074DEA + cmp r7, r2 + bge _08074DE8 + lsls r0, r4, 8 + str r0, [r5] + b _08074DEA + .align 2, 0 +_08074DE4: .4byte 0xffff8000 +_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, _08075128 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl Window_AddFromTemplate + 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 Window_FastFillPixels + 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 sub_8199EEC + str r4, [r7] + adds r0, r6, 0 + movs r1, 0x7 + bl Window_GetField + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08075128: .4byte 0x0832c3f8 + thumb_func_end write_to_rbox + + thumb_func_start sub_807512C +sub_807512C: @ 807512C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + 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, _0807516C + 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 + .align 2, 0 +_0807516C: .4byte 0x001fffff + 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, _08075194 + ands r2, r1 + movs r1, 0x80 + lsls r1, 19 + orrs r2, r1 + adds r1, r3, 0 + bl CpuSet + pop {r0} + bx r0 + .align 2, 0 +_08075194: .4byte 0x001fffff + 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, _080751DC + 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, _080751E0 + bl CpuSet + adds r6, 0x20 + adds r5, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _080751BC +_080751D4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080751DC: .4byte 0x001fffff +_080751E0: .4byte 0x04000003 + 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, _08075218 + 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 + .align 2, 0 +_08075218: .4byte 0x001fffff + 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, _08075354 + ldrh r0, [r5, 0x6] + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + ldr r1, _08075358 + cmp r0, r1 + bne _0807524E + adds r0, r5, 0 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _0807535C + bl gpu_pal_obj_decompress_and_apply3 +_0807524E: + ldr r0, _08075360 + 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, _08075364 + adds r5, r0 + strh r4, [r5, 0x30] + ldr r0, _08075368 + mov r9, r0 + lsls r6, 16 + asrs r0, r6, 16 + mov r10, r0 + ldr r0, _0807536C + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08075364 + 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 obj_anim_step + mov r0, r9 + mov r1, r10 + adds r2, r4, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _08075364 + 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 obj_anim_image_start + adds r0, r4, 0 + bl obj_anim_step + mov r0, r9 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _08075364 + 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 obj_anim_image_start + adds r0, r4, 0 + bl obj_anim_step + mov r0, r9 + mov r1, r10 + adds r2, r7, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _08075364 + 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 obj_anim_image_start + adds r0, r4, 0 + bl obj_anim_step + mov r0, r8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08075354: .4byte 0x0831c620 +_08075358: .4byte 0xffff0000 +_0807535C: .4byte 0x0831c628 +_08075360: .4byte sub_8075370 + 1 +_08075364: .4byte 0x02020630 +_08075368: .4byte 0x0831c688 +_0807536C: .4byte 0xfff00000 + 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, _0807539C + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_free_by_tag + ldr r0, _080753A0 + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080753A4 + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _080753A8 + .align 2, 0 +_0807539C: .4byte 0x0831c620 +_080753A0: .4byte 0x0831c628 +_080753A4: + ldr r0, _080753B0 + str r0, [r4, 0x1C] +_080753A8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080753B0: .4byte nullsub_12 + 1 + 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, _080753E4 + 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 obj_delete_and_free_tiles +_080753DE: + pop {r0} + bx r0 + .align 2, 0 +_080753E4: .4byte 0x02020630 + 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, _0807543C + movs r0, 0x1 + strb r0, [r1] + ldr r0, _08075440 + ldr r0, [r0] + ldr r6, _08075444 + 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, _08075448 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0807544C + 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 + .align 2, 0 +_0807543C: .4byte 0x020244b9 +_08075440: .4byte 0x020244d0 +_08075444: .4byte 0x02024064 +_08075448: .4byte sub_8075450 + 1 +_0807544C: .4byte 0x03005e00 + 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, _08075484 + 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 + .align 2, 0 +_08075484: .4byte 0x03005e00 +_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, _080754AC + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080754B0 + b _080754C2 + .align 2, 0 +_080754AC: .4byte 0x0202406e +_080754B0: .4byte 0x02024744 +_080754B4: + ldr r1, _08075530 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08075534 +_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, _08075538 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _0807553C + 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, _08075540 + 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, _08075544 + str r1, [r0] + b _08075592 + .align 2, 0 +_08075530: .4byte 0x0202406e +_08075534: .4byte 0x020244ec +_08075538: .4byte 0x0832c588 +_0807553C: .4byte 0x02020630 +_08075540: .4byte 0x0202420c +_08075544: .4byte sub_80761B4 + 1 +_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, _0807557C + strb r5, [r0] + movs r3, 0 + strh r3, [r4, 0x2E] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, _08075580 + str r1, [r0] + b _08075592 + .align 2, 0 +_0807557C: .4byte 0x0202420c +_08075580: .4byte sub_8076398 + 1 +_08075584: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, _080755B0 + strb r0, [r1] + movs r0, 0x1 + str r0, [sp] +_08075592: + ldr r0, _080755B4 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r4, r1, r0 + ldr r5, _080755B0 + ldrb r0, [r5] + strh r0, [r4, 0x3A] + ldr r2, [sp] + cmp r2, 0 + bne _080755B8 + mov r0, r10 + bl remove_task + b _08075602 + .align 2, 0 +_080755B0: .4byte 0x0202420c +_080755B4: .4byte 0x02020630 +_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, _08075614 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + mov r3, r10 + strh r3, [r4, 0x6] + ldr r1, _08075618 + 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, _0807561C + 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 + .align 2, 0 +_08075614: .4byte 0x0000ffd8 +_08075618: .4byte 0x03005e00 +_0807561C: .4byte nullsub_4 + 1 + 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, _080756CC + 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 obj_anim_image_start + 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, _080756D0 + str r0, [r7, 0x1C] +_080756C0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080756CC: .4byte 0x03005e00 +_080756D0: .4byte sub_80756D4 + 1 + thumb_func_end objc_0804ABD4 + + thumb_func_start sub_80756D4 +sub_80756D4: @ 80756D4 + ldr r1, _080756DC + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_080756DC: .4byte sub_80756E0 + 1 + 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, _08075740 + str r0, [r6, 0x1C] + ldr r5, _08075744 + 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, _08075748 + adds r0, r4 + movs r1, 0x2 + bl sub_8008258 + 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 obj_anim_step + 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 + .align 2, 0 +_08075740: .4byte sub_807574C + 1 +_08075744: .4byte 0x020241e4 +_08075748: .4byte 0x02020630 + 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, _080757B0 + ldr r5, _080757B4 + 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 obj_anim_image_start + 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, _080757B8 + str r0, [r4, 0x1C] + b _080757DC + .align 2, 0 +_080757B0: .4byte 0x02020630 +_080757B4: .4byte 0x020241e4 +_080757B8: .4byte sub_80757E4 + 1 +_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, _08075834 + str r0, [r4, 0x1C] +_0807582C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08075834: .4byte sub_8075838 + 1 + 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, _08075898 + 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 + .align 2, 0 +_08075898: .4byte 0x00000101 +_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, _08075914 + 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, _08075918 + str r0, [r4, 0x1C] + b _08075926 + .align 2, 0 +_08075914: .4byte 0xffffff00 +_08075918: .4byte sub_8075D14 + 1 +_0807591C: + ldr r0, _0807592C + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_08075926: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807592C: .4byte sub_8075930 + 1 + 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 sub_8008258 + ldr r0, _0807596C + str r0, [r4, 0x1C] + movs r0, 0x17 + bl audio_play +_08075964: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807596C: .4byte sub_8075970 + 1 + 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, _08075988 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08075988: .4byte _0807598C + .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, _08075A44 + str r0, [r4, 0x1C] + b _08075AB6 + .align 2, 0 +_08075A44: .4byte sub_8075D14 + 1 +_08075A48: + cmp r1, 0x4 + bne _08075A5C + cmp r0, 0x3 + bne _08075A5C + ldr r0, _08075A58 + str r0, [r4, 0x1C] + b _08075A62 + .align 2, 0 +_08075A58: .4byte sub_8075FB4 + 1 +_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, _08075AA4 + ands r0, r1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_8008258 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08075AA8 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8008258 + b _08075AB0 + .align 2, 0 +_08075AA4: .4byte 0xffffff00 +_08075AA8: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_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, _08075AFC + 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, _08075B00 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08075AFC: .4byte 0x03005e00 +_08075B00: .4byte _08075B04 + .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, _08075BB0 + 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 + .align 2, 0 +_08075BB0: .4byte 0x02020630 +_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, _08075BF4 + 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 + .align 2, 0 +_08075BF4: .4byte 0x03005e00 +_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, _08075C50 + 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 + .align 2, 0 +_08075C50: .4byte 0x020244d0 +_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, _08075CA4 + 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 + .align 2, 0 +_08075CA4: .4byte 0x03005e00 +_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, _08075D10 + 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 + .align 2, 0 +_08075D10: .4byte 0x020244d0 + 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 obj_anim_image_start + 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, _08075DAC + str r0, [r6, 0x1C] + ldr r0, _08075DB0 + ldr r1, _08075DB4 + 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, _08075DB8 + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08075DBC + adds r7, r1, r0 + movs r4, 0x19 + mov r10, r4 + b _08075DD4 + .align 2, 0 +_08075DAC: .4byte sub_8075FD4 + 1 +_08075DB0: .4byte 0x030022c0 +_08075DB4: .4byte 0x00000439 +_08075DB8: .4byte 0x0202406e +_08075DBC: .4byte 0x02024744 +_08075DC0: + ldr r0, _08075E38 + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08075E3C + 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, _08075E40 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08075E56 + ldr r0, _08075E44 + 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, _08075E48 + bl MPlayStop_rev01 + b _08075E56 + .align 2, 0 +_08075E38: .4byte 0x0202406e +_08075E3C: .4byte 0x020244ec +_08075E40: .4byte 0x020244d0 +_08075E44: .4byte 0x02022fec +_08075E48: .4byte 0x03007420 +_08075E4C: + ldr r0, _08075E74 + ldr r1, _08075E78 + movs r2, 0x80 + bl MPlayVolumeControl +_08075E56: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E70 + ldr r0, _08075E7C + 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 + .align 2, 0 +_08075E74: .4byte 0x03007420 +_08075E78: .4byte 0x0000ffff +_08075E7C: .4byte 0x020244d0 +_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, _08075F38 + 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, _08075F3C + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08075F40 + 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, _08075F44 + 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, _08075F44 + 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, _08075F48 + adds r0, r5 + movs r1, 0x1 + bl sub_8008258 + 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, _08075F4C + b _08075F66 + .align 2, 0 +_08075F38: .4byte 0x020244d0 +_08075F3C: .4byte c3_0804B070 + 1 +_08075F40: .4byte 0x03005e00 +_08075F44: .4byte 0x020241e4 +_08075F48: .4byte 0x02020630 +_08075F4C: .4byte sub_8039B58 + 1 +_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, _08075FA8 +_08075F66: + str r1, [r0] + ldr r5, _08075FAC + 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, _08075FB0 + adds r0, r4 + bl obj_anim_step + 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 + .align 2, 0 +_08075FA8: .4byte sub_8039E44 + 1 +_08075FAC: .4byte 0x020241e4 +_08075FB0: .4byte 0x02020630 + 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, _08075FD0 + str r1, [r0, 0x1C] + movs r1, 0 + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + bx lr + .align 2, 0 +_08075FD0: .4byte sub_80760F8 + 1 + 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, _08076038 + ldr r0, _0807603C + 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 sub_8008258 + movs r7, 0x1 + b _0807605C + .align 2, 0 +_08076038: .4byte 0x02020630 +_0807603C: .4byte 0x020241e4 +_08076040: + ldr r2, _080760E4 + 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, _080760E8 + ldr r0, _080760EC + 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, _080760F0 + strb r2, [r0] + ldr r4, _080760F4 + 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 obj_delete_and_free_tiles + 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 + .align 2, 0 +_080760E4: .4byte 0xfffffee0 +_080760E8: .4byte 0x02020630 +_080760EC: .4byte 0x020241e4 +_080760F0: .4byte 0x020244b9 +_080760F4: .4byte 0x020244d0 + 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, _08076128 + movs r1, 0 + strb r1, [r0] + bl m4aMPlayAllStop + ldr r0, _0807612C + bl audio_play + b _08076196 + .align 2, 0 +_08076128: .4byte 0x020244b9 +_0807612C: .4byte 0x00000173 +_08076130: + ldr r0, _0807619C + cmp r1, r0 + bne _08076196 + ldr r5, _080761A0 + ldr r4, _080761A4 + 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 obj_delete_and_free_tiles + adds r0, r6, 0 + bl obj_delete_and_free_resources + ldr r0, _080761A8 + ldr r1, _080761AC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08076196 + ldr r0, _080761B0 + 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 + .align 2, 0 +_0807619C: .4byte 0x0000013b +_080761A0: .4byte 0x02020630 +_080761A4: .4byte 0x020241e4 +_080761A8: .4byte 0x030022c0 +_080761AC: .4byte 0x00000439 +_080761B0: .4byte 0x020244d0 + 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, _080761FC + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + strh r0, [r4, 0x6] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _08076200 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080761FC: .4byte 0x0000ffe2 +_08076200: .4byte sub_8076204 + 1 + 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 sub_8008258 +_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, _08076350 + 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, _08076354 + b _0807635A + .align 2, 0 +_08076350: .4byte 0x020244d0 +_08076354: .4byte sub_8076374 + 1 +_08076358: + ldr r0, _08076370 +_0807635A: + str r0, [r5, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl sub_8008258 +_08076364: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076370: .4byte sub_8075D14 + 1 + 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, _08076394 + str r0, [r2, 0x1C] +_0807638E: + pop {r0} + bx r0 + .align 2, 0 +_08076394: .4byte sub_8075D14 + 1 + 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, _080763E0 + 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, _080763E4 + b _080763EA + .align 2, 0 +_080763E0: .4byte 0x020244d0 +_080763E4: .4byte sub_8076374 + 1 +_080763E8: + ldr r0, _080763F4 +_080763EA: + str r0, [r5, 0x1C] +_080763EC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080763F4: .4byte sub_8075D14 + 1 + 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, _08076510 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _08076514 + bl gpu_pal_obj_decompress_and_apply3 + ldr r0, _08076518 + mov r1, r9 + mov r2, r10 + adds r3, r4, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0807651C + 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, _08076520 + 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 + .align 2, 0 +_08076510: .4byte 0x0832c400 +_08076514: .4byte 0x0832c460 +_08076518: .4byte 0x0832c588 +_0807651C: .4byte 0x02020630 +_08076520: .4byte sub_8076524 + 1 + 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 obj_anim_image_start + 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, _080765C8 + str r0, [r6, 0x1C] + ldr r0, _080765CC + 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 sub_8008258 + adds r0, r4, 0 + bl obj_anim_step + movs r0, 0x80 + lsls r0, 5 + strh r0, [r4, 0x30] + strh r5, [r6, 0x3C] + b _080765D4 + .align 2, 0 +_080765C8: .4byte sub_80765E0 + 1 +_080765CC: .4byte 0x02020630 +_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, _080766A4 + 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 sub_8008258 + 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, _080766A8 + 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 + .align 2, 0 +_080766A4: .4byte 0x02020630 +_080766A8: .4byte 0x08329f40 +_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, _080766F8 + 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 + .align 2, 0 +_080766F8: .4byte 0x02020630 +_080766FC: + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 +_08076708: + adds r0, r4, 0 + bl obj_delete_and_free_resources +_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, _080767C0 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _080767C4 + bl gpu_pal_obj_decompress_and_apply3 + ldr r0, _080767C8 + adds r1, r6, 0 + mov r2, r8 + adds r3, r4, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080767CC + 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, _080767D0 + str r1, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080767C0: .4byte 0x0832c400 +_080767C4: .4byte 0x0832c460 +_080767C8: .4byte 0x0832c588 +_080767CC: .4byte 0x02020630 +_080767D0: .4byte sub_80767D4 + 1 + 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 obj_anim_image_start + 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, _08076864 + str r0, [r4, 0x1C] + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r0, _08076868 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8008258 + adds r0, r4, 0 + bl obj_anim_step + strh r5, [r4, 0x30] + b _08076870 + .align 2, 0 +_08076864: .4byte sub_807687C + 1 +_08076868: .4byte 0x02020630 +_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, _080768D0 + 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 obj_anim_image_start + 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, _080768D4 + str r0, [r5, 0x1C] + b _080768E8 + .align 2, 0 +_080768D0: .4byte 0x02020630 +_080768D4: .4byte sub_80768F0 + 1 +_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, _08076908 + str r0, [r2, 0x1C] +_08076904: + pop {r0} + bx r0 + .align 2, 0 +_08076908: .4byte nullsub_12 + 1 + thumb_func_end sub_80768F0 + + thumb_func_start obj_delete_and_free_associated_resources_ +obj_delete_and_free_associated_resources_: @ 807690C + push {lr} + bl obj_delete_and_free_resources + 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, _08076998 + adds r0, r5, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, _0807699C + 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, _080769A0 + 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, _080769A4 + str r0, [r4, 0x1C] +_08076990: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08076998: .4byte 0x03005d70 +_0807699C: .4byte 0x02020630 +_080769A0: .4byte sub_80769CC + 1 +_080769A4: .4byte sub_80769A8 + 1 + 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, _080769C8 + str r0, [r1, 0x1C] +_080769C2: + pop {r0} + bx r0 + .align 2, 0 +_080769C8: .4byte sub_80769CC + 1 + 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, _080769F0 + str r0, [r2, 0x1C] +_080769EA: + pop {r0} + bx r0 + .align 2, 0 +_080769F0: .4byte nullsub_12 + 1 + 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, _08076A2C + adds r0, r5, 0 + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08076A30 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r3, r1, r2 + movs r0, 0x1 + strh r0, [r3, 0x2E] + ldr r0, _08076A34 + 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 + .align 2, 0 +_08076A2C: .4byte oamc_804BEB4 + 1 +_08076A30: .4byte 0x02020630 +_08076A34: .4byte 0x03005d70 + 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, _08076A74 + 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 obj_delete_and_free_tiles +_08076A70: + pop {r0} + bx r0 + .align 2, 0 +_08076A74: .4byte 0x02020630 + 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, _08076AD4 + lsls r6, r4, 3 + adds r5, r6, r0 + ldrh r0, [r5, 0x6] + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + ldr r1, _08076AD8 + cmp r0, r1 + bne _08076AA0 + adds r0, r5, 0 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _08076ADC + adds r0, r6, r0 + bl gpu_pal_obj_decompress_and_apply3 +_08076AA0: + cmp r4, 0x6 + beq _08076ACC + cmp r4, 0x6 + blt _08076AB0 + cmp r4, 0xB + bgt _08076AB0 + cmp r4, 0xA + bge _08076ACC +_08076AB0: + ldr r1, _08076AD4 + lsls r0, r4, 3 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_tag_get_range_start + adds r1, r0, 0 + lsls r1, 16 + ldr r0, _08076AE0 + lsrs r1, 11 + ldr r2, _08076AE4 + adds r1, r2 + bl call_LZZUnCompVram +_08076ACC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08076AD4: .4byte 0x0832c400 +_08076AD8: .4byte 0xffff0000 +_08076ADC: .4byte 0x0832c460 +_08076AE0: .4byte 0x08c02300 +_08076AE4: .4byte 0x06010100 + 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, _08076B0C + lsrs r4, 21 + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_free_by_tag + ldr r0, _08076B10 + adds r4, r0 + ldrh r0, [r4, 0x4] + bl gpu_pal_free_tag + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08076B0C: .4byte 0x0832c400 +_08076B10: .4byte 0x0832c460 + 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, _08076B38 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08076B3C + b _08076B4E + .align 2, 0 +_08076B38: .4byte 0x0202406e +_08076B3C: .4byte 0x02024744 +_08076B40: + ldr r1, _08076B60 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08076B64 +_08076B4E: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08076B60: .4byte 0x0202406e +_08076B64: .4byte 0x020244ec + thumb_func_end sub_8076B14 + + thumb_func_start flash_timeout_start_on_timer_2_when_flash_present +flash_timeout_start_on_timer_2_when_flash_present: @ 8076B68 + push {lr} + bl IdentifyFlash + lsls r0, 16 + cmp r0, 0 + bne _08076B84 + ldr r1, _08076B80 + movs r0, 0x1 + str r0, [r1] + bl flash_timeout_start_on_timer_2 + b _08076B8A + .align 2, 0 +_08076B80: .4byte 0x03005d88 +_08076B84: + ldr r1, _08076B90 + movs r0, 0 + str r0, [r1] +_08076B8A: + pop {r0} + bx r0 + .align 2, 0 +_08076B90: .4byte 0x03005d88 + thumb_func_end flash_timeout_start_on_timer_2_when_flash_present + + thumb_func_start memclr_stdsav2 +memclr_stdsav2: @ 8076B94 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _08076BB0 + ldr r2, _08076BB4 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08076BB0: .4byte 0x02024a54 +_08076BB4: .4byte 0x010007d6 + 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, _08076BD4 + ldr r2, _08076BD8 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08076BD4: .4byte 0x02025a00 +_08076BD8: .4byte 0x01001f04 + thumb_func_end clear_sav1 + + thumb_func_start sub_8076BDC +sub_8076BDC: @ 8076BDC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, _08076C14 + bl GenerateRandomNumber + adds r4, r0 + movs r0, 0x7C + ands r4, r0 + ldr r1, _08076C18 + ldr r0, _08076C1C + adds r0, r4, r0 + str r0, [r1] + ldr r0, _08076C20 + adds r0, r4, r0 + str r0, [r5] + ldr r1, _08076C24 + ldr r0, _08076C28 + adds r4, r0 + str r4, [r1] + bl init_bag_pockets + bl sub_81617F4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08076C14: .4byte 0x03005d8c +_08076C18: .4byte 0x03005d90 +_08076C1C: .4byte 0x02024a54 +_08076C20: .4byte 0x02025a00 +_08076C24: .4byte 0x03005d94 +_08076C28: .4byte 0x02029808 + thumb_func_end sub_8076BDC + + 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, _08076CF8 + 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, _08076CFC + str r0, [r1] + ldr r4, _08076D00 + ldr r0, _08076D04 + ldr r1, [r0] + ldr r6, _08076D08 + adds r0, r4, 0 + adds r2, r6, 0 + bl memcpy + ldr r1, _08076D0C + mov r10, r1 + ldr r1, [r1] + ldr r7, _08076D10 + ldr r0, _08076D14 + adds r2, r7, 0 + bl memcpy + ldr r0, _08076D18 + mov r8, r0 + ldr r1, [r0] + ldr r0, _08076D1C + mov r9, r0 + ldr r0, _08076D20 + 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 sub_8076BDC + ldr r1, _08076D04 + ldr r0, [r1] + adds r1, r4, 0 + adds r2, r6, 0 + bl memcpy + mov r1, r10 + ldr r0, [r1] + ldr r1, _08076D14 + adds r2, r7, 0 + bl memcpy + mov r1, r8 + ldr r0, [r1] + ldr r1, _08076D20 + mov r2, r9 + bl memcpy + movs r1, 0xE0 + lsls r1, 9 + adds r0, r4, 0 + bl init_malloc + 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_randomize_position + ldr r1, _08076D04 + 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 + .align 2, 0 +_08076CF8: .4byte 0x030022c0 +_08076CFC: .4byte 0x0203cf5c +_08076D00: .4byte 0x02000000 +_08076D04: .4byte 0x03005d90 +_08076D08: .4byte 0x00000f2c +_08076D0C: .4byte 0x03005d8c +_08076D10: .4byte 0x00003d88 +_08076D14: .4byte 0x02000f2c +_08076D18: .4byte 0x03005d94 +_08076D1C: .4byte 0x000083d0 +_08076D20: .4byte 0x02004cb4 + thumb_func_end saveblock_randomize_and_relocate + + thumb_func_start sav2_x1_query_bit1 +sav2_x1_query_bit1: @ 8076D24 + ldr r0, _08076D30 + ldr r0, [r0] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_08076D30: .4byte 0x03005d90 + thumb_func_end sav2_x1_query_bit1 + + thumb_func_start sav2_x9_clear_bit1 +sav2_x9_clear_bit1: @ 8076D34 + ldr r0, _08076D44 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] + bx lr + .align 2, 0 +_08076D44: .4byte 0x03005d90 + thumb_func_end sav2_x9_clear_bit1 + + thumb_func_start sub_8076D48 +sub_8076D48: @ 8076D48 + ldr r0, _08076D58 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + bx lr + .align 2, 0 +_08076D58: .4byte 0x03005d90 + thumb_func_end sub_8076D48 + + thumb_func_start sub_8076D5C +sub_8076D5C: @ 8076D5C + push {lr} + movs r0, 0 + bl sub_8084FAC + ldr r0, _08076D74 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .align 2, 0 +_08076D74: .4byte 0x03005d90 + thumb_func_end sub_8076D5C + + thumb_func_start sav2_gender2_inplace_and_xFE +sav2_gender2_inplace_and_xFE: @ 8076D78 + ldr r0, _08076D88 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] + bx lr + .align 2, 0 +_08076D88: .4byte 0x03005d90 + thumb_func_end sav2_gender2_inplace_and_xFE + + thumb_func_start copy_player_party_to_sav1 +copy_player_party_to_sav1: @ 8076D8C + push {r4,lr} + ldr r0, _08076DC8 + ldr r0, [r0] + ldr r1, _08076DCC + ldrb r1, [r1] + movs r2, 0x8D + lsls r2, 2 + adds r0, r2 + strb r1, [r0] + movs r4, 0 +_08076DA0: + ldr r0, _08076DC8 + ldr r0, [r0] + movs r1, 0x64 + muls r1, r4 + adds r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r0, r2 + ldr r2, _08076DD0 + adds r1, r2 + movs r2, 0x64 + bl memcpy + adds r4, 0x1 + cmp r4, 0x5 + ble _08076DA0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08076DC8: .4byte 0x03005d8c +_08076DCC: .4byte 0x020244e9 +_08076DD0: .4byte 0x020244ec + 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, _08076E10 + ldr r0, _08076E14 + ldr r0, [r0] + movs r2, 0x8D + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + movs r4, 0 + ldr r5, _08076E18 +_08076DEA: + movs r0, 0x64 + adds r2, r4, 0 + muls r2, r0 + adds r0, r2, r5 + ldr r1, _08076E14 + 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 + .align 2, 0 +_08076E10: .4byte 0x020244e9 +_08076E14: .4byte 0x03005d8c +_08076E18: .4byte 0x020244ec + 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, _08076E5C + mov r12, r0 + movs r5, 0xA3 + lsls r5, 4 + mov r8, r5 + ldr r4, _08076E60 + 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 + .align 2, 0 +_08076E5C: .4byte 0x03005d8c +_08076E60: .4byte 0x02037350 + 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, _08076EA4 + mov r12, r0 + movs r5, 0xA3 + lsls r5, 4 + mov r8, r5 + ldr r4, _08076EA8 + 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 + .align 2, 0 +_08076EA4: .4byte 0x03005d8c +_08076EA8: .4byte 0x02037350 + 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 sub_8076ECC +sub_8076ECC: @ 8076ECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r2, 0 + ldr r0, _08076FCC + mov r12, r0 + ldr r1, _08076FD0 + mov r10, r1 + ldr r5, _08076FD4 + movs r3, 0xAC + lsls r3, 3 + ldr r4, _08076FD8 +_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, _08076FD8 + ldr r5, _08076FD4 + 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, _08076FD8 + ldr r5, _08076FD4 + 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, _08076FD8 + ldr r5, _08076FD4 + 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, _08076FD8 + ldr r5, _08076FD4 + 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, _08076FD8 + ldr r1, _08076FD4 + mov r8, r1 + movs r5, 0xBA + lsls r5, 2 + adds r4, r0, r5 + movs r3, 0 + ldr r6, _08076FDC + 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 + .align 2, 0 +_08076FCC: .4byte 0x02032180 +_08076FD0: .4byte 0x03005d90 +_08076FD4: .4byte 0x03005d8c +_08076FD8: .4byte 0x02031c58 +_08076FDC: .4byte 0x00002be0 + thumb_func_end sub_8076ECC + + thumb_func_start sub_8076FE0 +sub_8076FE0: @ 8076FE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r2, 0 + ldr r0, _080770EC + mov r8, r0 + ldr r1, _080770F0 + mov r12, r1 + ldr r5, _080770F4 + movs r3, 0xAC + lsls r3, 3 + ldr r4, _080770F8 +_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, _080770F4 + movs r4, 0xBB + lsls r4, 3 + ldr r0, _080770F8 + 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, _080770F4 + movs r4, 0xCA + lsls r4, 3 + ldr r0, _080770F8 + 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, _080770F4 + movs r4, 0xD2 + lsls r4, 3 + ldr r0, _080770F8 + 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, _080770F4 + movs r4, 0xF2 + lsls r4, 3 + ldr r0, _080770F8 + 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, _080770F4 + mov r9, r0 + ldr r1, _080770FC + mov r10, r1 + ldr r4, _080770F8 + 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 + .align 2, 0 +_080770EC: .4byte 0x03005d90 +_080770F0: .4byte 0x02032180 +_080770F4: .4byte 0x03005d8c +_080770F8: .4byte 0x02031c58 +_080770FC: .4byte 0x00002be0 + thumb_func_end sub_8076FE0 + + thumb_func_start apply_u16_xor_crypto +apply_u16_xor_crypto: @ 8077100 + ldr r2, _08077114 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + ldrh r3, [r0] + eors r2, r3 + eors r2, r1 + strh r2, [r0] + bx lr + .align 2, 0 +_08077114: .4byte 0x03005d90 + thumb_func_end apply_u16_xor_crypto + + thumb_func_start apply_u32_xor_crypto +apply_u32_xor_crypto: @ 8077118 + ldr r2, _0807712C + ldr r3, [r2] + adds r3, 0xAC + ldr r2, [r0] + ldr r3, [r3] + eors r2, r3 + eors r2, r1 + str r2, [r0] + bx lr + .align 2, 0 +_0807712C: .4byte 0x03005d90 + thumb_func_end apply_u32_xor_crypto + + thumb_func_start saveblock_randomize_position +saveblock_randomize_position: @ 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, _08077168 + 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, _0807716C + adds r0, r1 + adds r1, r4, 0 + bl apply_u16_xor_crypto + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08077168: .4byte 0x03005d8c +_0807716C: .4byte 0x00000494 + thumb_func_end saveblock_randomize_position + + thumb_func_start sub_8077170 +sub_8077170: @ 8077170 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + ldr r0, _08077190 + 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 + .align 2, 0 +_08077190: .4byte 0x02022c2c +_08077194: + ldr r0, _080771A8 + ldrb r0, [r0] + movs r1, 0x54 + adds r2, r4, 0 + bl rfu_NI_setSendData + movs r0, 0x1 +_080771A2: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080771A8: .4byte 0x03004140 + 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, _080771E0 + ldrb r0, [r0] + cmp r0, 0x1D + bne _080771F0 + ldr r4, _080771E4 + ldr r0, _080771E8 + 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 + .align 2, 0 +_080771E0: .4byte 0x02022c2c +_080771E4: .4byte 0x03007880 +_080771E8: .4byte 0x03004140 +_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, _08077228 + ldrb r1, [r0] + movs r0, 0xC + bl rfu_clearSlot + b _08077230 + .align 2, 0 +_08077228: .4byte 0x03004140 +_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, _0807724C + ldrb r1, [r0] + movs r0, 0xC + bl rfu_clearSlot + b _08077258 + .align 2, 0 +_0807724C: .4byte 0x03004140 +_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, _08077278 + ldrb r0, [r0] + cmp r0, 0 + beq _08077280 + ldr r0, _0807727C + ldrb r0, [r0] + cmp r0, 0x1D + bne _08077280 + movs r0, 0x1 + b _08077282 + .align 2, 0 +_08077278: .4byte 0x030030fc +_0807727C: .4byte 0x02022c2c +_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 reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + bl sub_80A1A74 + ldr r2, _08077394 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r0, _08077398 + bl SetVBlankCallback + ldr r4, _0807739C + 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 gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080773A0 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _080773A4 + ldr r1, [r0] + movs r0, 0x8F + lsls r0, 4 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r0, _080773A8 + bl Window_InitFromTemplates + lsls r0, 16 + cmp r0, 0 + beq _0807738C + bl TextBox_ResetSomeField + movs r5, 0 +_08077310: + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_FillTileMap + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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, _080773A4 + 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 + .align 2, 0 +_08077394: .4byte 0x02037fd4 +_08077398: .4byte sub_807811C + 1 +_0807739C: .4byte 0x0860f074 +_080773A0: .4byte 0x0832dee4 +_080773A4: .4byte 0x0203229c +_080773A8: .4byte 0x0832def4 + thumb_func_end sub_80772A4 + + thumb_func_start sub_80773AC +sub_80773AC: @ 80773AC + push {lr} + ldr r0, _080773C4 + bl set_callback2 + ldr r0, _080773C8 + movs r1, 0 + str r1, [r0] + ldr r0, _080773CC + strb r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080773C4: .4byte sub_80773D0 + 1 +_080773C8: .4byte 0x030022c0 +_080773CC: .4byte 0x020244ea + 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, _080773F4 + 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, _080773F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080773F4: .4byte 0x030022c0 +_080773F8: .4byte _080773FC + .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, _08077490 + ldr r0, _08077494 + bl malloc_and_clear + str r0, [r4] + bl sub_80772A4 + ldr r4, _08077498 + movs r0, 0xE0 + lsls r0, 4 + bl malloc_and_clear + str r0, [r4] + movs r6, 0 + ldr r2, _0807749C +_08077476: + lsls r1, r6, 8 + ldr r0, [r4] + adds r0, r1 + stm r2!, {r0} + adds r6, 0x1 + cmp r6, 0xD + ble _08077476 + ldr r1, _080774A0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .align 2, 0 +_08077490: .4byte 0x0203229c +_08077494: .4byte 0x000010f0 +_08077498: .4byte 0x02032184 +_0807749C: .4byte 0x02032188 +_080774A0: .4byte 0x030022c0 +_080774A4: + ldr r2, _0807750C + 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, _08077510 + 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 gpu_sync_bg_show + ldr r0, _08077514 + ldrb r2, [r0] + cmp r2, 0 + bne _0807754C + ldr r1, _08077518 + ldr r5, _0807751C + adds r0, r5, 0 + strh r0, [r1] + ldr r0, _08077520 + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + ldr r0, _08077524 + ldrb r0, [r0] + cmp r0, 0 + beq _08077528 + bl sub_800B488 + bl sub_8009734 + bl sub_8011BA4 + b _08077B46 + .align 2, 0 +_0807750C: .4byte 0x02037fd4 +_08077510: .4byte 0x02024744 +_08077514: .4byte 0x03003124 +_08077518: .4byte 0x020229c6 +_0807751C: .4byte 0x00001122 +_08077520: .4byte 0x0203229c +_08077524: .4byte 0x030030fc +_08077528: + bl sub_8009734 + ldr r0, _08077544 + movs r7, 0x87 + lsls r7, 3 + adds r0, r7 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, _08077548 + movs r1, 0x1 + bl AddTask + b _08077B46 + .align 2, 0 +_08077544: .4byte 0x030022c0 +_08077548: .4byte task00_08081A90 + 1 +_0807754C: + ldr r0, _0807755C + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _08077B46 + .align 2, 0 +_0807755C: .4byte 0x030022c0 +_08077560: + ldr r2, _08077588 + 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 + .align 2, 0 +_08077588: .4byte 0x0203229c +_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, _080775D0 + 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, _080775D4 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .align 2, 0 +_080775D0: .4byte 0x0203229c +_080775D4: .4byte 0x030022c0 +_080775D8: + ldr r1, _080775E4 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .align 2, 0 +_080775E4: .4byte 0x030022c0 +_080775E8: + ldr r0, _08077638 + 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, _0807763C + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, _08077640 + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + ldr r0, _08077644 + ldrb r0, [r0] + cmp r0, 0 + bne _0807762A + b _08077B46 +_0807762A: + movs r0, 0x1 + bl sub_801048C + bl sub_800ADF8 + b _08077B46 + .align 2, 0 +_08077638: .4byte 0x03003124 +_0807763C: .4byte 0x030022c0 +_08077640: .4byte 0x0203229c +_08077644: .4byte 0x030030fc +_08077648: + ldr r0, _08077678 + ldrb r0, [r0] + cmp r0, 0 + beq _08077680 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + bne _0807765C + b _08077B46 +_0807765C: + ldr r1, _0807767C + 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 + .align 2, 0 +_08077678: .4byte 0x030030fc +_0807767C: .4byte 0x030022c0 +_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, _080776A4 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .align 2, 0 +_080776A4: .4byte 0x030022c0 +_080776A8: + bl calc_enemy_party_count + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + ldr r2, _080777C4 + ldr r0, [r2] + ldr r1, _080777C8 + ldrb r1, [r1] + adds r0, 0x36 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _080777CC + 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, _080777D0 +_080776E2: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _080777D4 + 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, _080777D8 + 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, _080777DC + 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, _080777C4 + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bge _080777B8 + ldr r0, _080777D0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xC +_08077756: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _080777E0 + 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, _080777D8 + 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, _080777DC + 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, _080777E4 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .align 2, 0 +_080777C4: .4byte 0x0203229c +_080777C8: .4byte 0x020244e9 +_080777CC: .4byte 0x020244ea +_080777D0: .4byte 0x0832de24 +_080777D4: .4byte 0x020244ec +_080777D8: .4byte 0xfff40000 +_080777DC: .4byte sub_80D3014 + 1 +_080777E0: .4byte 0x02024744 +_080777E4: .4byte 0x030022c0 +_080777E8: + bl sub_81B5D30 + ldr r0, _08077808 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0 + bl sub_81B5D4C + ldr r1, _0807780C + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .align 2, 0 +_08077808: .4byte 0x0203229c +_0807780C: .4byte 0x030022c0 +_08077810: + ldr r0, _0807782C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0x1 + bl sub_81B5D4C + ldr r1, _08077830 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _08077B22 + .align 2, 0 +_0807782C: .4byte 0x0203229c +_08077830: .4byte 0x030022c0 +_08077834: + ldr r0, _080778A4 + ldr r0, [r0] + ldr r5, _080778A8 + 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, _080778AC + adds r0, r1 + ldr r1, [r5, 0xC] + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r4, _080778B0 + 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, _080778B4 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, _080778B8 + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + b _08077B46 + .align 2, 0 +_080778A4: .4byte 0x03005d90 +_080778A8: .4byte 0x02032188 +_080778AC: .4byte 0x020229f0 +_080778B0: .4byte 0x0832de94 +_080778B4: .4byte 0x030022c0 +_080778B8: .4byte 0x0203229c +_080778BC: + bl sub_807A1F0 + lsls r0, 24 + cmp r0, 0 + bne _080778C8 + b _08077B46 +_080778C8: + b _08077B1A +_080778CA: + ldr r0, _08077960 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x78 + bl sub_81DB35C + movs r6, 0 + add r5, sp, 0x10 + adds r4, r0, 0 + adds r4, 0x10 +_080778DE: + add r1, sp, 0x10 + ldr r0, _08077964 + 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 obj_add_from_template_forward_search + 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, _08077968 + adds r1, r0 + movs r0, 0x1 + movs r2, 0x78 + bl sub_81DB35C + movs r6, 0 + add r5, sp, 0x10 + adds r4, r0, 0 + adds r4, 0x88 +_0807792C: + add r1, sp, 0x10 + ldr r0, _08077964 + 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 obj_add_from_template_forward_search + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _0807792C + ldr r1, _0807796C + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .align 2, 0 +_08077960: .4byte 0x03005d90 +_08077964: .4byte 0x0832dcac +_08077968: .4byte 0x020229f0 +_0807796C: .4byte 0x030022c0 +_08077970: + ldr r4, _08077A2C + 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 obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + movs r6, 0 + add r4, sp, 0x10 + movs r5, 0xC0 + lsls r5, 13 +_080779BC: + add r1, sp, 0x10 + ldr r0, _08077A2C + 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 obj_add_from_template_forward_search + movs r0, 0x80 + lsls r0, 14 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x5 + ble _080779BC + ldr r0, _08077A30 + ldr r2, _08077A34 + 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 obj_add_from_template_forward_search + ldr r2, _08077A38 + ldr r1, [r2] + adds r1, 0x34 + movs r3, 0 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x35 + strb r3, [r0] + ldr r1, _08077A3C + 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 + .align 2, 0 +_08077A2C: .4byte 0x0832dcac +_08077A30: .4byte 0x0832dc94 +_08077A34: .4byte 0x0832de24 +_08077A38: .4byte 0x0203229c +_08077A3C: .4byte 0x030022c0 +_08077A40: + movs r0, 0 + bl sub_807A320 + movs r0, 0 + bl sub_8079BE0 + ldr r2, _08077A74 + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + bl sub_8078388 + ldr r1, _08077A78 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, _08077A7C + bl song_play_for_text + b _08077B46 + .align 2, 0 +_08077A74: .4byte 0x0203229c +_08077A78: .4byte 0x030022c0 +_08077A7C: .4byte 0x000001b3 +_08077A80: + movs r0, 0x1 + bl sub_807A320 + movs r0, 0x1 + bl sub_8079BE0 + ldr r1, _08077AA4 + 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 + .align 2, 0 +_08077AA4: .4byte 0x030022c0 +_08077AA8: + movs r0, 0x1 + bl sub_80782B8 + ldr r1, _08077AB8 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .align 2, 0 +_08077AB8: .4byte 0x030022c0 +_08077ABC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _08077AD8 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .align 2, 0 +_08077AD8: .4byte 0x030022c0 +_08077ADC: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0x2 + bl sub_80782B8 + ldr r1, _08077AF8 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _08077B22 + .align 2, 0 +_08077AF8: .4byte 0x030022c0 +_08077AFC: + movs r0, 0 + bl sub_807A468 + ldr r1, _08077B0C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08077B22 + .align 2, 0 +_08077B0C: .4byte 0x030022c0 +_08077B10: + movs r0, 0x1 + bl sub_807A468 + bl sub_807A53C +_08077B1A: + ldr r1, _08077B2C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_08077B22: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08077B46 + .align 2, 0 +_08077B2C: .4byte 0x030022c0 +_08077B30: + ldr r0, _08077B68 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08077B46 + ldr r0, _08077B6C + str r0, [r3] + ldr r0, _08077B70 + bl set_callback2 +_08077B46: + bl run_remoboxes + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077B68: .4byte 0x02037fd4 +_08077B6C: .4byte sub_8078C34 + 1 +_08077B70: .4byte sub_807825C + 1 + 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, _08077B98 + 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, _08077B9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08077B98: .4byte 0x030022c0 +_08077B9C: .4byte _08077BA0 + .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, _08077C0C + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .align 2, 0 +_08077C0C: .4byte 0x030022c0 +_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, _08077C38 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .align 2, 0 +_08077C38: .4byte 0x030022c0 +_08077C3C: + ldr r0, _08077C5C + ldrb r0, [r0] + cmp r0, 0 + beq _08077C50 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_08077C50: + ldr r1, _08077C60 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .align 2, 0 +_08077C5C: .4byte 0x030030fc +_08077C60: .4byte 0x030022c0 +_08077C64: + movs r5, 0x87 + lsls r5, 3 + adds r1, r2, r5 + b _080780D8 +_08077C6C: + bl calc_enemy_party_count + ldr r4, _08077D8C + ldr r0, [r4] + ldr r1, _08077D90 + ldrb r1, [r1] + adds r0, 0x36 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _08077D94 + ldrb r1, [r1] + adds r0, 0x37 + strb r1, [r0] + movs r0, 0 + bl Window_FillTileMap + 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, _08077D98 +_08077CA8: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _08077D9C + 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, _08077DA0 + 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, _08077DA4 + 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, _08077D8C + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bge _08077D80 + ldr r0, _08077D98 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xC +_08077D1E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _08077DA8 + 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, _08077DA0 + 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, _08077DA4 + 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, _08077DAC + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .align 2, 0 +_08077D8C: .4byte 0x0203229c +_08077D90: .4byte 0x020244e9 +_08077D94: .4byte 0x020244ea +_08077D98: .4byte 0x0832de24 +_08077D9C: .4byte 0x020244ec +_08077DA0: .4byte 0xfff40000 +_08077DA4: .4byte sub_80D3014 + 1 +_08077DA8: .4byte 0x02024744 +_08077DAC: .4byte 0x030022c0 +_08077DB0: + bl sub_81B5D30 + ldr r0, _08077DD0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0 + bl sub_81B5D4C + ldr r1, _08077DD4 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .align 2, 0 +_08077DD0: .4byte 0x0203229c +_08077DD4: .4byte 0x030022c0 +_08077DD8: + ldr r0, _08077DF4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0x1 + bl sub_81B5D4C + ldr r1, _08077DF8 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _080780D8 + .align 2, 0 +_08077DF4: .4byte 0x0203229c +_08077DF8: .4byte 0x030022c0 +_08077DFC: + ldr r0, _08077E6C + ldr r0, [r0] + ldr r5, _08077E70 + 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, _08077E74 + adds r0, r1 + ldr r1, [r5, 0xC] + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r4, _08077E78 + 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, _08077E7C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08077E58: + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, _08077E80 + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + b _080780F6 + .align 2, 0 +_08077E6C: .4byte 0x03005d90 +_08077E70: .4byte 0x02032188 +_08077E74: .4byte 0x020229f0 +_08077E78: .4byte 0x0832de94 +_08077E7C: .4byte 0x030022c0 +_08077E80: .4byte 0x0203229c +_08077E84: + bl sub_807A1F0 + lsls r0, 24 + cmp r0, 0 + bne _08077E90 + b _080780F6 +_08077E90: + ldr r1, _08077E9C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .align 2, 0 +_08077E9C: .4byte 0x030022c0 +_08077EA0: + ldr r0, _08077F38 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x78 + bl sub_81DB35C + movs r6, 0 + add r5, sp, 0xC + adds r4, r0, 0 + adds r4, 0x10 +_08077EB4: + add r1, sp, 0xC + ldr r0, _08077F3C + 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 obj_add_from_template_forward_search + 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, _08077F40 + adds r1, r0 + movs r0, 0x1 + movs r2, 0x78 + bl sub_81DB35C + movs r6, 0 + add r5, sp, 0xC + adds r4, r0, 0 + adds r4, 0x88 +_08077F02: + add r1, sp, 0xC + ldr r0, _08077F3C + 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 obj_add_from_template_forward_search + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _08077F02 + ldr r1, _08077F44 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .align 2, 0 +_08077F38: .4byte 0x03005d90 +_08077F3C: .4byte 0x0832dcac +_08077F40: .4byte 0x020229f0 +_08077F44: .4byte 0x030022c0 +_08077F48: + ldr r4, _08077FD8 + 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 obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + movs r6, 0 + add r4, sp, 0xC + movs r5, 0xC0 + lsls r5, 13 +_08077F94: + add r1, sp, 0xC + ldr r0, _08077FD8 + 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 obj_add_from_template_forward_search + movs r0, 0x80 + lsls r0, 14 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x5 + ble _08077F94 + ldr r0, _08077FDC + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x35 + ldrb r1, [r2] + adds r4, r0, 0 + cmp r1, 0x5 + bhi _08077FE4 + ldr r0, _08077FE0 + ldrb r0, [r0] + b _08077FEA + .align 2, 0 +_08077FD8: .4byte 0x0832dcac +_08077FDC: .4byte 0x0203229c +_08077FE0: .4byte 0x0203cf20 +_08077FE4: + ldr r0, _08078028 + ldrb r0, [r0] + adds r0, 0x6 +_08077FEA: + strb r0, [r2] + ldr r0, _0807802C + ldr r3, _08078030 + 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 obj_add_from_template_forward_search + ldr r1, [r4] + adds r1, 0x34 + strb r0, [r1] + ldr r0, _08078034 + movs r7, 0x87 + lsls r7, 3 + adds r0, r7 + movs r1, 0x10 + strb r1, [r0] + b _080780F6 + .align 2, 0 +_08078028: .4byte 0x0203cf20 +_0807802C: .4byte 0x0832dc94 +_08078030: .4byte 0x0832de24 +_08078034: .4byte 0x030022c0 +_08078038: + movs r0, 0 + bl sub_80782B8 + b _080780D0 +_08078040: + movs r0, 0x1 + bl sub_80782B8 + ldr r2, _08078060 + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + bl sub_8078388 + ldr r1, _08078064 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .align 2, 0 +_08078060: .4byte 0x0203229c +_08078064: .4byte 0x030022c0 +_08078068: + ldr r2, _0807809C + 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 sub_80A1AD4 + ldr r1, _080780A0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .align 2, 0 +_0807809C: .4byte 0x02037fd4 +_080780A0: .4byte 0x030022c0 +_080780A4: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0x2 + bl sub_80782B8 + ldr r1, _080780C0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .align 2, 0 +_080780C0: .4byte 0x030022c0 +_080780C4: + movs r7, 0x87 + lsls r7, 3 + adds r1, r2, r7 + b _080780D8 +_080780CC: + bl sub_807A53C +_080780D0: + ldr r1, _080780E0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080780D8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080780F6 + .align 2, 0 +_080780E0: .4byte 0x030022c0 +_080780E4: + ldr r0, _08078114 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080780F6 + ldr r0, _08078118 + bl set_callback2 +_080780F6: + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078114: .4byte 0x02037fd4 +_08078118: .4byte sub_807825C + 1 + thumb_func_end sub_8077B74 + + thumb_func_start sub_807811C +sub_807811C: @ 807811C + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + 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, _08078168 + 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 sub_80A1AD4 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xA + strb r1, [r0] +_08078160: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08078168: .4byte 0x0203229c + thumb_func_end sub_8078130 + + thumb_func_start sub_807816C +sub_807816C: @ 807816C + push {r4,lr} + ldr r0, _080781A4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080781C2 + ldr r1, _080781A8 + ldr r4, _080781AC + 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, _080781B0 + ldrb r0, [r0] + cmp r0, 0 + beq _080781B4 + adds r1, r2, 0 + adds r1, 0x6F + movs r0, 0x10 + strb r0, [r1] + b _080781C2 + .align 2, 0 +_080781A4: .4byte 0x02037fd4 +_080781A8: .4byte 0x02032298 +_080781AC: .4byte 0x0203229c +_080781B0: .4byte 0x030030fc +_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, _08078208 + ldr r0, _0807820C + str r0, [r5, 0x8] + ldr r0, _08078210 + ldrb r0, [r0] + cmp r0, 0 + beq _08078220 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + beq _08078244 + ldr r0, _08078214 + ldr r0, [r0] + bl free + bl Window_FreeMemory + ldr r0, _08078218 + ldr r0, [r0] + bl free + movs r0, 0 + str r0, [r5] + bl sub_800E084 + ldr r0, _0807821C + bl set_callback2 + b _08078244 + .align 2, 0 +_08078208: .4byte 0x030022c0 +_0807820C: .4byte sub_80773AC + 1 +_08078210: .4byte 0x030030fc +_08078214: .4byte 0x02032184 +_08078218: .4byte 0x0203229c +_0807821C: .4byte sub_807AE50 + 1 +_08078220: + ldr r0, _0807824C + ldrb r4, [r0] + cmp r4, 0 + bne _08078244 + ldr r0, _08078250 + ldr r0, [r0] + bl free + bl Window_FreeMemory + ldr r0, _08078254 + ldr r0, [r0] + bl free + str r4, [r5] + ldr r0, _08078258 + bl set_callback2 +_08078244: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807824C: .4byte 0x03003124 +_08078250: .4byte 0x02032184 +_08078254: .4byte 0x0203229c +_08078258: .4byte sub_807AE50 + 1 + 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, _080782B4 + ldr r2, [r4] + ldrb r1, [r2] + adds r0, r1, 0x1 + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x18 + bl lcd_io_set + 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 lcd_io_set + bl sub_8197224 + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080782B4: .4byte 0x0203229c + 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, _08078314 + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r1, _08078318 + movs r2, 0x94 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _0807831C + 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 bg_copy_tilemap_rect_simple + ldr r1, _08078320 + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x2 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + b _0807837E + .align 2, 0 +_08078314: .4byte 0x08ddb3e4 +_08078318: .4byte 0x08ddb464 +_0807831C: .4byte 0x08ddcf04 +_08078320: .4byte 0x0832cabc +_08078324: + ldr r1, _08078348 + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x3 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + movs r0, 0 + bl sub_8079E44 + movs r0, 0x1 + bl sub_8079E44 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0807837E + .align 2, 0 +_08078348: .4byte 0x0832d2bc +_0807834C: + movs r5, 0x80 + lsls r5, 21 + movs r4, 0x3 +_08078352: + lsrs r0, r5, 24 + movs r1, 0 + bl lcd_io_set + movs r0, 0x80 + lsls r0, 18 + adds r5, r0 + subs r4, 0x1 + cmp r4, 0 + bge _08078352 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_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, _080783D8 + mov r8, r5 + ldr r0, _080783DC + 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 + .align 2, 0 +_080783D8: .4byte 0x0203229c +_080783DC: .4byte 0x02020630 +_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, _0807847C + ldr r0, [r0] + adds r0, 0x69 + ldrb r0, [r0] + cmp r0, 0x15 + bls _08078472 + b _080787AA +_08078472: + lsls r0, 2 + ldr r1, _08078480 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807847C: .4byte 0x0203229c +_08078480: .4byte _08078484 + .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, _080784FC + ldr r1, _08078500 + movs r2, 0xC8 + bl sub_8078438 + ldr r3, _08078504 + 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 + .align 2, 0 +_080784FC: .4byte 0x020228c4 +_08078500: .4byte 0x020244ec +_08078504: .4byte 0x0203229c +_08078508: + bl sub_80771BC + cmp r0, 0 + bne _08078512 + b _080787AA +_08078512: + bl sub_8077200 + cmp r0, 0 + bne _08078524 + ldr r0, _08078520 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_08078520: .4byte 0x0203229c +_08078524: + bl sub_8077210 + ldr r0, _08078530 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_08078530: .4byte 0x0203229c +_08078534: + cmp r5, 0 + bne _0807853E + movs r0, 0x1 + bl sub_80771AC +_0807853E: + ldr r0, _08078544 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_08078544: .4byte 0x0203229c +_08078548: + bl sub_8077200 + cmp r0, 0x3 + beq _08078552 + b _080787AA +_08078552: + ldr r0, _08078570 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, _08078574 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, _08078578 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_08078570: .4byte 0x02024744 +_08078574: .4byte 0x020223c4 +_08078578: .4byte 0x0203229c +_0807857C: + ldr r0, _0807858C + ldr r1, _08078590 + movs r2, 0xC8 + bl sub_8078438 + ldr r0, _08078594 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_0807858C: .4byte 0x020228c4 +_08078590: .4byte 0x020245b4 +_08078594: .4byte 0x0203229c +_08078598: + cmp r5, 0 + bne _080785A2 + movs r0, 0x1 + bl sub_80771AC +_080785A2: + ldr r0, _080785A8 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_080785A8: .4byte 0x0203229c +_080785AC: + bl sub_8077200 + cmp r0, 0x3 + beq _080785B6 + b _080787AA +_080785B6: + ldr r0, _080785D4 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, _080785D8 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, _080785DC + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_080785D4: .4byte 0x0202480c +_080785D8: .4byte 0x020223c4 +_080785DC: .4byte 0x0203229c +_080785E0: + ldr r0, _080785F0 + ldr r1, _080785F4 + movs r2, 0xC8 + bl sub_8078438 + ldr r0, _080785F8 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_080785F0: .4byte 0x020228c4 +_080785F4: .4byte 0x0202467c +_080785F8: .4byte 0x0203229c +_080785FC: + cmp r5, 0 + bne _08078606 + movs r0, 0x1 + bl sub_80771AC +_08078606: + ldr r0, _0807860C + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_0807860C: .4byte 0x0203229c +_08078610: + bl sub_8077200 + cmp r0, 0x3 + beq _0807861A + b _080787AA +_0807861A: + ldr r0, _08078638 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, _0807863C + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, _08078640 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_08078638: .4byte 0x020248d4 +_0807863C: .4byte 0x020223c4 +_08078640: .4byte 0x0203229c +_08078644: + ldr r0, _0807865C + ldr r1, _08078660 + ldr r1, [r1] + ldr r2, _08078664 + adds r1, r2 + movs r2, 0xDC + bl sub_8078438 + ldr r0, _08078668 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_0807865C: .4byte 0x020228c4 +_08078660: .4byte 0x03005d8c +_08078664: .4byte 0x00002be0 +_08078668: .4byte 0x0203229c +_0807866C: + cmp r5, 0 + bne _08078676 + movs r0, 0x3 + bl sub_80771AC +_08078676: + ldr r0, _0807867C + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_0807867C: .4byte 0x0203229c +_08078680: + bl sub_8077200 + cmp r0, 0x3 + beq _0807868A + b _080787AA +_0807868A: + ldr r0, _080786A8 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, _080786AC + adds r1, r2 + movs r2, 0xD8 + bl sub_8078438 + bl sub_8077210 + ldr r0, _080786B0 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_080786A8: .4byte 0x020321c0 +_080786AC: .4byte 0x020223c4 +_080786B0: .4byte 0x0203229c +_080786B4: + ldr r0, _080786CC + ldr r1, _080786D0 + ldr r1, [r1] + ldr r2, _080786D4 + adds r1, r2 + movs r2, 0xB + bl sub_8078438 + ldr r0, _080786D8 + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_080786CC: .4byte 0x020228c4 +_080786D0: .4byte 0x03005d8c +_080786D4: .4byte 0x000031a8 +_080786D8: .4byte 0x0203229c +_080786DC: + cmp r5, 0 + bne _080786E6 + movs r0, 0x4 + bl sub_80771AC +_080786E6: + ldr r0, _080786EC + ldr r1, [r0] + b _080787A2 + .align 2, 0 +_080786EC: .4byte 0x0203229c +_080786F0: + bl sub_8077200 + cmp r0, 0x3 + bne _080787AA + ldr r4, _08078718 + ldr r0, [r4] + adds r0, 0xA9 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, _0807871C + adds r1, r2 + movs r2, 0xB + bl sub_8078438 + bl sub_8077210 + ldr r1, [r4] + b _080787A2 + .align 2, 0 +_08078718: .4byte 0x0203229c +_0807871C: .4byte 0x020223c4 +_08078720: + ldr r4, _08078774 + ldr r6, _08078778 + 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, _0807877C + bl sub_80092BC + cmp r0, 0 + bne _08078766 + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, _08078780 + bl pokemon_setattr +_08078766: + adds r4, 0x64 + subs r5, 0x1 + cmp r5, 0 + bge _08078726 + movs r0, 0x1 + b _080787AC + .align 2, 0 +_08078774: .4byte 0x02024744 +_08078778: .4byte 0x0000012f +_0807877C: .4byte 0x0832df94 +_08078780: .4byte 0x083192cd +_08078784: + ldr r2, _080787B4 + 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 + .align 2, 0 +_080787B4: .4byte 0x0203229c + thumb_func_end shedinja_maker_maybe + + thumb_func_start sub_80787B8 +sub_80787B8: @ 80787B8 + push {lr} + ldr r0, _080787D4 + ldr r1, _080787D8 + ldr r1, [r1] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, _080787DC + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + pop {r0} + bx r0 + .align 2, 0 +_080787D4: .4byte 0x0832dae5 +_080787D8: .4byte 0x0203229c +_080787DC: .4byte 0x06010000 + 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, _08078808 + ldrh r1, [r0] + ldr r0, _0807880C + cmp r1, r0 + beq _08078844 + cmp r1, r0 + bgt _08078814 + ldr r0, _08078810 + cmp r1, r0 + beq _08078834 + b _0807885E + .align 2, 0 +_08078808: .4byte 0x020223c4 +_0807880C: .4byte 0x0000bbbb +_08078810: .4byte 0x0000aabb +_08078814: + ldr r0, _08078828 + cmp r1, r0 + beq _08078854 + ldr r0, _0807882C + cmp r1, r0 + bne _0807885E + ldr r0, _08078830 + ldr r0, [r0] + adds r0, 0x78 + b _0807885A + .align 2, 0 +_08078828: .4byte 0x0000bbcc +_0807882C: .4byte 0x0000eeaa +_08078830: .4byte 0x0203229c +_08078834: + ldr r0, _08078840 + ldr r0, [r0] + adds r0, 0x78 + strb r2, [r0] + b _0807885E + .align 2, 0 +_08078840: .4byte 0x0203229c +_08078844: + ldr r0, _08078850 + ldr r0, [r0] + adds r0, 0x7A + strb r2, [r0] + b _0807885E + .align 2, 0 +_08078850: .4byte 0x0203229c +_08078854: + ldr r0, _0807888C + 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, _08078890 + movs r1, 0x80 + lsls r1, 1 + adds r0, r3, r1 + ldrh r1, [r0] + ldr r0, _08078894 + cmp r1, r0 + beq _080788D8 + cmp r1, r0 + bgt _0807889C + ldr r0, _08078898 + cmp r1, r0 + beq _080788BC + b _080788F0 + .align 2, 0 +_0807888C: .4byte 0x0203229c +_08078890: .4byte 0x020223c4 +_08078894: .4byte 0x0000bbbb +_08078898: .4byte 0x0000aabb +_0807889C: + ldr r0, _080788B0 + cmp r1, r0 + beq _080788E8 + ldr r0, _080788B4 + cmp r1, r0 + bne _080788F0 + ldr r0, _080788B8 + ldr r0, [r0] + adds r0, 0x79 + b _080788EE + .align 2, 0 +_080788B0: .4byte 0x0000bbcc +_080788B4: .4byte 0x0000eeaa +_080788B8: .4byte 0x0203229c +_080788BC: + ldr r2, _080788D4 + 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 + .align 2, 0 +_080788D4: .4byte 0x0203229c +_080788D8: + ldr r0, _080788E4 + ldr r0, [r0] + adds r0, 0x7B +_080788DE: + movs r1, 0x1 + strb r1, [r0] + b _080788F0 + .align 2, 0 +_080788E4: .4byte 0x0203229c +_080788E8: + ldr r0, _080788FC + ldr r0, [r0] + adds r0, 0x7B +_080788EE: + strb r2, [r0] +_080788F0: + movs r0, 0x1 + bl sub_8077234 +_080788F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080788FC: .4byte 0x0203229c + 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, _0807892C + ldrh r1, [r2] + ldr r0, _08078930 + cmp r1, r0 + beq _080789CC + cmp r1, r0 + bgt _0807893C + ldr r0, _08078934 + cmp r1, r0 + beq _080789AC + ldr r0, _08078938 + cmp r1, r0 + beq _08078978 + b _080789DC + .align 2, 0 +_0807892C: .4byte 0x020223c4 +_08078930: .4byte 0x0000ddee +_08078934: .4byte 0x0000ccdd +_08078938: .4byte 0x0000dddd +_0807893C: + ldr r0, _0807894C + cmp r1, r0 + beq _08078950 + adds r0, 0x11 + cmp r1, r0 + beq _08078974 + b _080789DC + .align 2, 0 +_0807894C: .4byte 0x0000eebb +_08078950: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x4 + bl sub_807A19C + ldr r0, _08078970 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xB + b _080789DA + .align 2, 0 +_08078970: .4byte 0x0203229c +_08078974: + movs r0, 0x5 + b _080789CE +_08078978: + ldr r4, _080789A8 + 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 + .align 2, 0 +_080789A8: .4byte 0x0203229c +_080789AC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080789C8 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xA + b _080789DA + .align 2, 0 +_080789C8: .4byte 0x0203229c +_080789CC: + movs r0, 0x1 +_080789CE: + bl sub_807A19C + ldr r0, _080789F8 + 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 + .align 2, 0 +_080789F8: .4byte 0x0203229c + thumb_func_end sub_8078900 + + thumb_func_start sub_80789FC +sub_80789FC: @ 80789FC + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _08078A58 + 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, _08078A5C + 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, _08078A60 + 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 + .align 2, 0 +_08078A58: .4byte 0x0203229c +_08078A5C: .4byte 0x00000101 +_08078A60: .4byte 0x0000dddd +_08078A64: + ldr r0, _08078AAC + 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, _08078AB0 + 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 + .align 2, 0 +_08078AAC: .4byte 0x00000201 +_08078AB0: .4byte 0x0000eecc +_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, _08078AFC + 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 + .align 2, 0 +_08078AFC: .4byte 0x0000ddee +_08078B00: + ldr r0, _08078BE4 + cmp r1, r0 + bne _08078B44 + adds r1, r2, 0 + adds r1, 0x80 + movs r5, 0 + movs r4, 0 + ldr r0, _08078BE8 + 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 sub_80A1AD4 + 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, _08078BEC + 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, _08078BF0 + cmp r1, r0 + bne _08078B92 + adds r1, r3, 0 + adds r1, 0x80 + movs r4, 0 + movs r2, 0 + ldr r0, _08078BF4 + 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, _08078BF8 + 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 + .align 2, 0 +_08078BE4: .4byte 0x00000202 +_08078BE8: .4byte 0x0000eebb +_08078BEC: .4byte 0x0203229c +_08078BF0: .4byte 0x00000101 +_08078BF4: .4byte 0x0000ccdd +_08078BF8: .4byte 0x0000ddee + 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, _08078C30 + ldr r0, [r0] + adds r0, 0x80 + adds r1, r3, 0 + bl sub_8078BFC + pop {r0} + bx r0 + .align 2, 0 +_08078C30: .4byte 0x0203229c + 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, _08078CA0 + ldr r3, [r2] + ldr r4, _08078CA4 + 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 + .align 2, 0 +_08078CA0: .4byte 0x0203229c +_08078CA4: .4byte 0x0832dcec +_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, _08078D08 + ldr r0, [r5] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08078D0C + adds r0, r4 + movs r1, 0x1 + bl obj_anim_image_start + 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 + .align 2, 0 +_08078D08: .4byte 0x0203229c +_08078D0C: .4byte 0x02020630 +_08078D10: + ldr r4, _08078D6C + ldr r0, [r4] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _08078D70 + adds r0, r5 + movs r1, 0 + bl obj_anim_image_start + ldr r4, [r4] + adds r4, 0x34 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r2, _08078D74 + 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 + .align 2, 0 +_08078D6C: .4byte 0x0203229c +_08078D70: .4byte 0x02020630 +_08078D74: .4byte 0x0832de24 + thumb_func_end sub_8078CB8 + + thumb_func_start sub_8078D78 +sub_8078D78: @ 8078D78 + push {r4,lr} + movs r0, 0 + bl sub_807A19C + ldr r4, _08078DA4 + 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, _08078DA8 + ldr r1, [r4] + adds r1, 0x35 + ldrb r1, [r1] + bl sub_8078C10 + b _08078DB4 + .align 2, 0 +_08078DA4: .4byte 0x0203229c +_08078DA8: .4byte 0x0000aabb +_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, _08078DDC + ldrh r1, [r0, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08078DE4 + ldr r0, _08078DE0 + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0 + bl sub_8078CB8 + b _08078E30 + .align 2, 0 +_08078DDC: .4byte 0x030022c0 +_08078DE0: .4byte 0x0203229c +_08078DE4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08078E00 + ldr r0, _08078DFC + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x1 + bl sub_8078CB8 + b _08078E30 + .align 2, 0 +_08078DFC: .4byte 0x0203229c +_08078E00: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08078E1C + ldr r0, _08078E18 + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x2 + bl sub_8078CB8 + b _08078E30 + .align 2, 0 +_08078E18: .4byte 0x0203229c +_08078E1C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08078E30 + ldr r0, _08078E8C + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x3 + bl sub_8078CB8 +_08078E30: + ldr r0, _08078E90 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08078EE4 + movs r0, 0x5 + bl audio_play + ldr r4, _08078E8C + 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 Window_FastFillPixels + ldr r2, _08078E94 + movs r0, 0x1 + movs r1, 0x2 + bl PrintMenuTable + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x1 + strb r1, [r0] + b _08078EE4 + .align 2, 0 +_08078E8C: .4byte 0x0203229c +_08078E90: .4byte 0x030022c0 +_08078E94: .4byte 0x0832deac +_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 sub_80A1AD4 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x2 + strb r1, [r0] + b _08078EE4 +_08078EB6: + cmp r0, 0xC + bne _08078EE4 + ldr r0, _08078EEC + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x4 + strb r1, [r0] + ldr r0, _08078EF0 + ldr r0, [r0, 0x10] + ldr r1, [r4] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, _08078EF4 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 +_08078EE4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08078EEC: .4byte 0x0832df8c +_08078EF0: .4byte 0x0832de94 +_08078EF4: .4byte 0x06010000 + thumb_func_end sub_8078DBC + + thumb_func_start sub_8078EF8 +sub_8078EF8: @ 8078EF8 + push {lr} + bl sub_8079F74 + ldr r3, _08078F40 + ldr r0, [r3] + adds r0, 0x6F + movs r1, 0 + strb r1, [r0] + ldr r2, _08078F44 + 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, _08078F48 + ldr r0, [r0, 0x4] + ldr r1, [r3] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, _08078F4C + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + pop {r0} + bx r0 + .align 2, 0 +_08078F40: .4byte 0x0203229c +_08078F44: .4byte 0x02020630 +_08078F48: .4byte 0x0832de94 +_08078F4C: .4byte 0x06010000 + 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 sub_80A1AD4 + ldr r0, _08078F98 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x2 + b _08079028 + .align 2, 0 +_08078F98: .4byte 0x0203229c +_08078F9C: + ldr r0, _08078FBC + ldr r1, _08078FC0 + ldrb r1, [r1] + ldr r2, _08078FC4 + ldr r2, [r2] + adds r2, 0x35 + ldrb r2, [r2] + bl sub_807A5F4 + cmp r0, 0x5 + bhi _0807902A + lsls r0, 2 + ldr r1, _08078FC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08078FBC: .4byte 0x020244ec +_08078FC0: .4byte 0x020244e9 +_08078FC4: .4byte 0x0203229c +_08078FC8: .4byte _08078FCC + .align 2, 0 +_08078FCC: + .4byte _08078FE4 + .4byte _0807900C + .4byte _08079012 + .4byte _08079018 + .4byte _08079012 + .4byte _08079018 +_08078FE4: + bl sub_8078D78 + ldr r2, _08079004 + ldr r0, _08079008 + 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 + .align 2, 0 +_08079004: .4byte 0x02020630 +_08079008: .4byte 0x0203229c +_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, _08079030 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x8 +_08079028: + strb r1, [r0] +_0807902A: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08079030: .4byte 0x0203229c + thumb_func_end sub_8078F50 + + thumb_func_start sub_8079034 +sub_8079034: @ 8079034 + push {lr} + ldr r0, _08079058 + 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 + .align 2, 0 +_08079058: .4byte 0x030022c0 + thumb_func_end sub_8079034 + + thumb_func_start sub_807905C +sub_807905C: @ 807905C + push {lr} + sub sp, 0x4 + ldr r0, _08079094 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080790C4 + ldr r0, _08079098 + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x35 + ldrb r2, [r3] + cmp r2, 0x5 + bhi _080790A4 + ldr r1, _0807909C + ldrb r2, [r3] + adds r0, 0x36 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _080790A0 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _080790C0 + .align 2, 0 +_08079094: .4byte 0x02037fd4 +_08079098: .4byte 0x0203229c +_0807909C: .4byte 0x020244ec +_080790A0: .4byte sub_8077B74 + 1 +_080790A4: + ldr r1, _080790CC + 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, _080790D0 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC +_080790C0: + bl Window_FreeMemory +_080790C4: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080790CC: .4byte 0x02024744 +_080790D0: .4byte sub_8077B74 + 1 + 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, _0807915C + 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, _08079160 + 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 + .align 2, 0 +_0807915C: .4byte 0x02024744 +_08079160: .4byte 0x0203229c +_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, _080791CC + 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 + .align 2, 0 +_080791CC: .4byte 0x0203229c +_080791D0: + cmp r0, 0x2 + beq _08079200 + b _0807920C +_080791D6: + movs r0, 0x3 + movs r1, 0x3 + bl sub_807A048 + ldr r0, _080791E4 + b _080791F2 + .align 2, 0 +_080791E4: .4byte 0x0000bbcc +_080791E8: + movs r0, 0x3 + movs r1, 0x1 + bl sub_807A048 + ldr r0, _080791FC +_080791F2: + movs r1, 0 + bl sub_8078C10 + b _0807920C + .align 2, 0 +_080791FC: .4byte 0x0000bbbb +_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, _0807924C + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + b _08079258 + .align 2, 0 +_0807924C: .4byte 0x0203229c +_08079250: + ldr r0, _08079264 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x11 +_08079258: + strb r1, [r0] + movs r0, 0x11 + bl Window_WriteStandardTileMap + b _08079290 + .align 2, 0 +_08079264: .4byte 0x0203229c +_08079268: + movs r0, 0x3 + movs r1, 0x1 + bl sub_807A048 + bl sub_80771BC + cmp r0, 0 + beq _08079280 + ldr r0, _08079294 + movs r1, 0 + bl sub_8078C10 +_08079280: + ldr r0, _08079298 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + movs r0, 0x11 + bl Window_WriteStandardTileMap +_08079290: + pop {r0} + bx r0 + .align 2, 0 +_08079294: .4byte 0x0000bbcc +_08079298: .4byte 0x0203229c + thumb_func_end sub_8079218 + + thumb_func_start sub_807929C +sub_807929C: @ 807929C + push {r4-r6,lr} + movs r5, 0 + ldr r0, _080792E0 + 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 Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x1 + bl Window_CopyToVram + movs r0, 0x80 + lsls r0, 17 + adds r6, r0 + adds r5, 0x1 + ldr r0, _080792E0 + 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 + .align 2, 0 +_080792E0: .4byte 0x0203229c + 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, _08079340 + movs r1, 0 + bl sub_8078C10 + ldr r2, _08079344 + ldr r3, _08079348 + 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 + .align 2, 0 +_08079340: .4byte 0x0000eeaa +_08079344: .4byte 0x02020630 +_08079348: .4byte 0x0203229c +_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, _08079394 + 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, _08079394 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x7 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08079394: .4byte 0x0203229c + thumb_func_end sub_807935C + + thumb_func_start sub_8079398 +sub_8079398: @ 8079398 + push {r4,lr} + ldr r4, _080793BC + ldr r0, [r4] + adds r0, 0x74 + ldrh r1, [r0] + ldr r0, _080793C0 + 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 + .align 2, 0 +_080793BC: .4byte 0x0203229c +_080793C0: .4byte 0x00000505 + thumb_func_end sub_8079398 + + thumb_func_start sub_80793C4 +sub_80793C4: @ 80793C4 + push {r4,lr} + ldr r4, _08079400 + 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, _08079404 + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + 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 + .align 2, 0 +_08079400: .4byte 0x0203229c +_08079404: .4byte 0x0832df8c + thumb_func_end sub_80793C4 + + thumb_func_start sub_8079408 +sub_8079408: @ 8079408 + push {r4-r6,lr} + ldr r0, _08079484 + 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 Window_FastFillPixels + 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, _08079488 + ldr r0, [r2] + adds r0, 0x6F + movs r1, 0 + strb r1, [r0] + ldr r3, _0807948C + 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 + .align 2, 0 +_08079484: .4byte 0x030022c0 +_08079488: .4byte 0x0203229c +_0807948C: .4byte 0x02020630 + thumb_func_end sub_8079408 + + thumb_func_start sub_8079490 +sub_8079490: @ 8079490 + push {lr} + ldr r0, _080794AC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080794C4 + ldr r0, _080794B0 + ldrb r0, [r0] + cmp r0, 0 + beq _080794B4 + bl sub_800ADF8 + b _080794BA + .align 2, 0 +_080794AC: .4byte 0x02037fd4 +_080794B0: .4byte 0x030030fc +_080794B4: + movs r0, 0xC + bl sub_800ABF4 +_080794BA: + ldr r0, _080794C8 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xC + strb r1, [r0] +_080794C4: + pop {r0} + bx r0 + .align 2, 0 +_080794C8: .4byte 0x0203229c + thumb_func_end sub_8079490 + + thumb_func_start sub_80794CC +sub_80794CC: @ 80794CC + push {lr} + ldr r0, _08079508 + 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, _0807950C + ldr r0, [r0] + bl free + ldr r0, _08079510 + ldr r0, [r0] + bl free + bl Window_FreeMemory + bl sub_800E084 + ldr r0, _08079514 + bl set_callback2 + b _0807953A + .align 2, 0 +_08079508: .4byte 0x030030fc +_0807950C: .4byte 0x02032184 +_08079510: .4byte 0x0203229c +_08079514: .4byte c2_8056854 + 1 +_08079518: + ldr r0, _08079540 + ldrb r0, [r0] + cmp r0, 0 + bne _0807953A + ldr r0, _08079544 + ldr r0, [r0] + bl free + ldr r0, _08079548 + ldr r0, [r0] + bl free + bl Window_FreeMemory + ldr r0, _0807954C + bl set_callback2 +_0807953A: + pop {r0} + bx r0 + .align 2, 0 +_08079540: .4byte 0x03003124 +_08079544: .4byte 0x02032184 +_08079548: .4byte 0x0203229c +_0807954C: .4byte c2_8056854 + 1 + 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, _08079578 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xD + strb r1, [r0] +_08079574: + pop {r0} + bx r0 + .align 2, 0 +_08079578: .4byte 0x0203229c + thumb_func_end sub_8079550 + + thumb_func_start sub_807957C +sub_807957C: @ 807957C + push {lr} + ldr r0, _080795A0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807959C + ldr r0, _080795A4 + movs r1, 0 + bl sub_8078C10 + ldr r0, _080795A8 + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] +_0807959C: + pop {r0} + bx r0 + .align 2, 0 +_080795A0: .4byte 0x030022c0 +_080795A4: .4byte 0x0000bbcc +_080795A8: .4byte 0x0203229c + thumb_func_end sub_807957C + + thumb_func_start sub_80795AC +sub_80795AC: @ 80795AC + push {lr} + ldr r0, _080795C4 + ldr r0, [r0] + adds r0, 0x6F + ldrb r0, [r0] + cmp r0, 0x11 + bhi _08079678 + lsls r0, 2 + ldr r1, _080795C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080795C4: .4byte 0x0203229c +_080795C8: .4byte _080795CC + .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, _080796B0 + 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 + .align 2, 0 +_080796B0: .4byte 0x0203229c + 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, _08079704 + 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 + .align 2, 0 +_08079704: .4byte 0x0203229c +_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, _08079870 + mov r8, r0 + ldr r4, _08079874 + 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 Window_FillTileMap + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08079772 + ldr r1, _08079870 + mov r8, r1 + ldr r2, _08079874 + 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, _08079874 + 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, _08079878 + 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, _0807987C + bl oamt_set_x3A_32 + ldr r2, _08079874 + 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, _08079880 + 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 bg_copy_tilemap_rect_simple + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, [sp, 0x60] + cmp r1, 0 + beq _08079868 + b _08079A24 +_08079868: + bl sub_8079F74 + b _08079A24 + .align 2, 0 +_08079870: .4byte 0x02020630 +_08079874: .4byte 0x0203229c +_08079878: .4byte 0x0832de24 +_0807987C: .4byte sub_80D3014 + 1 +_08079880: .4byte 0x0832c8be +_08079884: + ldr r2, _080798B4 + 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, _080798B8 + cmp r1, r0 + beq _080798AC + b _08079A24 +_080798AC: + movs r0, 0x3 + strb r0, [r3] + b _08079A24 + .align 2, 0 +_080798B4: .4byte 0x02020630 +_080798B8: .4byte sub_80D3014 + 1 +_080798BC: + ldr r1, _080799D8 + 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 bg_copy_tilemap_rect_simple + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r6, _080799DC + ldr r1, _080799E0 + 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, _080799E4 + 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, _080799E8 + 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 sub_8199EEC + adds r0, r5, 0 + bl Window_WriteStandardTileMap + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _080799E0 + ldr r1, [r0] + b _08079A1A + .align 2, 0 +_080799D8: .4byte 0x0832c6c0 +_080799DC: .4byte 0x02020630 +_080799E0: .4byte 0x0203229c +_080799E4: .4byte 0x0832de24 +_080799E8: .4byte 0x0832dee0 +_080799EC: + ldr r0, _08079A34 + 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, _08079A38 + 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 + .align 2, 0 +_08079A34: .4byte 0x0832df99 +_08079A38: .4byte 0x0203229c + 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, _08079A60 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _08079A74 + .align 2, 0 +_08079A60: .4byte 0x020244ec +_08079A64: + movs r0, 0x64 + muls r0, r2 + ldr r1, _08079AA0 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_08079A74: + adds r0, r4, 0 + mov r1, sp + bl strcpy_limit_10_chars + movs r0, 0 + movs r1, 0x2 + bl fbox_get_field + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + adds r1, r4, 0 + bl font_get_width_of_string + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08079AA0: .4byte 0x02024744 + 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, _08079AEC + 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, _08079AF0 + mov r9, r0 + ldr r2, _08079AF4 + mov r8, r2 +_08079ADE: + cmp r7, 0 + bne _08079AF8 + adds r1, r4, 0 + adds r1, 0xD + mov r2, r9 + b _08079AFE + .align 2, 0 +_08079AEC: .4byte 0x0203229c +_08079AF0: .4byte 0x020244ec +_08079AF4: .4byte 0x02024744 +_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, _08079B50 + adds r0, r6, 0 + bl gf_strcpy + 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, _08079B54 + adds r1, r0 + adds r0, r6, 0 + bl gf_strcat +_08079B3C: + adds r0, r6, 0 + ldr r1, _08079B58 + bl gf_strcat + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08079B20 + b _08079B6C + .align 2, 0 +_08079B50: .4byte 0x0832dabc +_08079B54: .4byte 0x0831977c +_08079B58: .4byte 0x0832dad2 +_08079B5C: + ldr r1, _08079B7C + adds r0, r6, 0 + bl gf_strcpy + ldr r1, _08079B80 + adds r0, r6, 0 + bl gf_strcat +_08079B6C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08079B7C: .4byte 0x0832dabc +_08079B80: .4byte 0x0832dadf + 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 sub_81DB35C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _08079BDC + 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 Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08079BDC: .4byte 0x0832dee0 + 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, _08079C40 + cmp r6, 0 + bne _08079BF0 + ldr r7, _08079C44 +_08079BF0: + movs r4, 0 + ldr r0, _08079C48 + 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 strcpy_limit_10_chars + 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, _08079C48 + 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 + .align 2, 0 +_08079C40: .4byte 0x02024744 +_08079C44: .4byte 0x020244ec +_08079C48: .4byte 0x0203229c + 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, _08079CA8 + 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 bg_copy_tilemap_rect_simple + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + mov r0, r8 + cmp r0, 0 + bne _08079CB0 + movs r0, 0x64 + muls r0, r7 + ldr r1, _08079CAC + b _08079CB6 + .align 2, 0 +_08079CA8: .4byte 0x08ddd704 +_08079CAC: .4byte 0x020244ec +_08079CB0: + movs r0, 0x64 + muls r0, r7 + ldr r1, _08079D2C +_08079CB6: + adds r0, r1 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _08079D30 + 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 + .align 2, 0 +_08079D2C: .4byte 0x02024744 +_08079D30: .4byte 0x0203229c +_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, _08079D90 + 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 + .align 2, 0 +_08079D90: .4byte 0x0203229c +_08079D94: + mov r0, r8 + cmp r0, 0 + bne _08079DC0 + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, _08079DBC + 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 + .align 2, 0 +_08079DBC: .4byte 0x020244ec +_08079DC0: + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, _08079DEC + 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 + .align 2, 0 +_08079DEC: .4byte 0x02024744 +_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, _08079E40 + 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 + .align 2, 0 +_08079E40: .4byte 0x0203229c + 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, _08079E9C + 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, _08079EA0 + lsls r0, 2 + adds r5, r0, r1 + ldr r1, _08079EA4 + 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, _08079E9C + 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 + .align 2, 0 +_08079E9C: .4byte 0x0203229c +_08079EA0: .4byte 0x0832de3e +_08079EA4: .4byte 0x0832de56 + 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, _08079F68 + ldr r0, [r3] + adds r0, 0x36 + add r0, r12 + ldrb r0, [r0] + cmp r7, r0 + bge _08079F5A + ldr r6, _08079F6C + mov r9, r3 + mov r1, r12 + lsls r0, r1, 1 + add r0, r12 + lsls r2, r0, 1 + mov r10, r2 + ldr r1, _08079F70 + 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 + .align 2, 0 +_08079F68: .4byte 0x0203229c +_08079F6C: .4byte 0x02020630 +_08079F70: .4byte 0x0832de24 + 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, _08079FF0 + 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 bg_copy_tilemap_rect_simple + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + adds r0, r4, 0 + bl sub_8079E44 + adds r0, r4, 0 + bl sub_8079BE0 + adds r0, r4, 0 + bl sub_8079EA8 + ldr r0, _08079FF4 + ldr r0, [r0, 0x4] + ldr r5, _08079FF8 + ldr r1, [r5] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, _08079FFC + 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 + .align 2, 0 +_08079FF0: .4byte 0x0832c8be +_08079FF4: .4byte 0x0832de94 +_08079FF8: .4byte 0x0203229c +_08079FFC: .4byte 0x06010000 + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + 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, _0807A088 + 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, _0807A08C + 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 + .align 2, 0 +_0807A088: .4byte 0x0203229c +_0807A08C: .4byte 0x000008d2 +_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, _0807A0C0 + 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 + .align 2, 0 +_0807A0C0: .4byte 0x0203229c + thumb_func_end sub_807A09C + + thumb_func_start sub_807A0C4 +sub_807A0C4: @ 807A0C4 + push {r4,r5,lr} + movs r4, 0 + ldr r3, _0807A0F0 +_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, _0807A0F4 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0807A0F8 + subs r0, 0x1 + strh r0, [r1] + b _0807A18C + .align 2, 0 +_0807A0F0: .4byte 0x0203229c +_0807A0F4: .4byte 0x000008d2 +_0807A0F8: + ldr r1, _0807A10C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0807A17A + lsls r0, 2 + ldr r1, _0807A110 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A10C: .4byte 0x000008d4 +_0807A110: .4byte _0807A114 + .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, _0807A148 + ldr r0, [r0] + adds r0, 0x80 + movs r1, 0x14 + bl sub_8077170 + b _0807A17A + .align 2, 0 +_0807A148: .4byte 0x0203229c +_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, _0807A198 + 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 + .align 2, 0 +_0807A198: .4byte 0x0203229c + 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 Window_FastFillPixels + ldr r0, _0807A1EC + 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 Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807A1EC: .4byte 0x0832debc + thumb_func_end sub_807A19C + + thumb_func_start sub_807A1F0 +sub_807A1F0: @ 807A1F0 + push {r4,lr} + sub sp, 0x8 + ldr r0, _0807A240 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xA8 + ldrb r1, [r3] + adds r4, r0, 0 + cmp r1, 0xD + bhi _0807A22C + ldr r1, _0807A244 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + ldr r0, _0807A248 + 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, _0807A24C + 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, _0807A250 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A240: .4byte 0x0203229c +_0807A244: .4byte 0x02032188 +_0807A248: .4byte 0xffff0000 +_0807A24C: .4byte 0x0000ffff +_0807A250: .4byte _0807A254 + .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 gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r1, _0807A2B4 + ldr r1, [r1] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + b _0807A2DE + .align 2, 0 +_0807A2B4: .4byte 0x0203229c +_0807A2B8: + mov r0, sp + b _0807A2D6 +_0807A2BC: + ldr r0, _0807A2C4 + bl gpu_pal_obj_alloc_tag_and_apply + b _0807A2DA + .align 2, 0 +_0807A2C4: .4byte 0x0832dce4 +_0807A2C8: + ldr r0, _0807A2D0 + bl gpu_pal_obj_alloc_tag_and_apply + b _0807A2DA + .align 2, 0 +_0807A2D0: .4byte 0x0832dc44 +_0807A2D4: + ldr r0, _0807A2E8 +_0807A2D6: + bl gpu_tile_obj_alloc_tag_and_copy_to_vram +_0807A2DA: + ldr r0, _0807A2EC + ldr r1, [r0] +_0807A2DE: + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807A2FC + .align 2, 0 +_0807A2E8: .4byte 0x0832dc3c +_0807A2EC: .4byte 0x0203229c +_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, _0807A378 + 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, _0807A37C + 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 + .align 2, 0 +_0807A378: .4byte 0x0203229c +_0807A37C: .4byte 0x020244ec +_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, _0807A3C8 + 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 + .align 2, 0 +_0807A3C8: .4byte 0x0203229c +_0807A3CC: + movs r7, 0 + ldr r1, _0807A40C + 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, _0807A410 + 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 + .align 2, 0 +_0807A40C: .4byte 0x0203229c +_0807A410: .4byte 0x02024744 +_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, _0807A464 + 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 + .align 2, 0 +_0807A464: .4byte 0x0203229c + 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, _0807A4D0 + 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, _0807A4D4 + 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 + .align 2, 0 +_0807A4D0: .4byte 0x0203229c +_0807A4D4: .4byte 0x020244ec +_0807A4D8: + movs r6, 0 + ldr r1, _0807A534 + 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, _0807A538 + 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 + .align 2, 0 +_0807A534: .4byte 0x0203229c +_0807A538: .4byte 0x02024744 + 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, _0807A5A8 + 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, _0807A5AC + 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 + .align 2, 0 +_0807A5A8: .4byte 0x0203229c +_0807A5AC: .4byte 0x02020630 + thumb_func_end sub_807A53C + + thumb_func_start sub_807A5B0 +sub_807A5B0: @ 807A5B0 + push {r4,r5,lr} + movs r3, 0 + ldr r5, _0807A5E8 + ldr r4, _0807A5EC +_0807A5B8: + ldr r0, [r5] + adds r0, r4 + adds r2, r0, r3 + ldrb r0, [r2] + cmp r0, 0 + bne _0807A5DA + ldr r0, _0807A5F0 + 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 + .align 2, 0 +_0807A5E8: .4byte 0x03005d8c +_0807A5EC: .4byte 0x000031a8 +_0807A5F0: .4byte 0x0203229c + 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, _0807A69C + 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 + .align 2, 0 +_0807A69C: .4byte 0x020229e8 +_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, _0807A7A8 + ldrb r0, [r0] + cmp r0, 0 + beq _0807A7B4 + movs r4, 0 + bl link_get_multiplayer_id + ldr r5, _0807A7AC + 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 + .align 2, 0 +_0807A7A8: .4byte 0x03003124 +_0807A7AC: .4byte 0x020229e8 +_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, _0807A868 + 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 + .align 2, 0 +_0807A868: .4byte 0x083203cc +_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, _0807A964 + 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, _0807A964 + ldrb r0, [r0] + cmp r5, r0 + blt _0807A934 +_0807A95A: + movs r7, 0 + movs r6, 0x1 + movs r5, 0 + ldr r4, _0807A968 + b _0807A980 + .align 2, 0 +_0807A964: .4byte 0x020244e9 +_0807A968: .4byte 0x020229e8 +_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, _0807A9DC + 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 + .align 2, 0 +_0807A9DC: .4byte 0x020229e8 +_0807A9E0: + ldr r0, [r4] + cmp r0, 0 + bne _0807A9EA + movs r0, 0x3 + b _0807AA1A +_0807A9EA: + movs r2, 0 + movs r5, 0 + ldr r0, _0807AA14 + 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 + .align 2, 0 +_0807AA14: .4byte 0x020244e9 +_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, _0807AAB8 + 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 + .align 2, 0 +_0807AAB8: .4byte 0x08338ea4 + 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 obj_delete_and_free_tiles +_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 obj_delete_and_free_tiles +_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, _0807ABC8 + 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 lcd_io_set + add r0, sp, 0x10 + ldrh r1, [r0, 0x2] + movs r0, 0x22 + bl lcd_io_set + add r0, sp, 0x10 + ldrh r1, [r0, 0x4] + movs r0, 0x24 + bl lcd_io_set + add r0, sp, 0x10 + ldrh r1, [r0, 0x6] + movs r0, 0x26 + bl lcd_io_set + ldr r1, [sp, 0x18] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x28 + bl lcd_io_set + ldr r1, [sp, 0x18] + lsrs r1, 16 + movs r0, 0x2A + bl lcd_io_set + ldr r1, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2C + bl lcd_io_set + ldr r1, [sp, 0x1C] + lsrs r1, 16 + movs r0, 0x2E + bl lcd_io_set + add sp, 0x20 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807ABC8: .4byte 0x020322a0 + thumb_func_end sub_807AB28 + + thumb_func_start sub_807ABCC +sub_807ABCC: @ 807ABCC + push {r4,lr} + ldr r4, _0807AC14 + ldr r0, [r4] + adds r0, 0xE0 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, [r4] + adds r0, 0xE2 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + movs r0, 0 + bl lcd_io_get + 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 lcd_io_set + ldr r0, [r4] + adds r0, 0xE6 + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + b _0807AC1C + .align 2, 0 +_0807AC14: .4byte 0x020322a0 +_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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _0807AC60 + 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 + .align 2, 0 +_0807AC60: .4byte 0x020322a0 + thumb_func_end sub_807AC3C + + thumb_func_start sub_807AC64 +sub_807AC64: @ 807AC64 + push {r4,r5,lr} + ldr r0, _0807AC88 + 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 + .align 2, 0 +_0807AC88: .4byte 0x020322a0 +_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, _0807ACD8 + bl set_callback2 + 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 + .align 2, 0 +_0807ACD8: .4byte c2_800ACD4 + 1 + thumb_func_end sub_807AC64 + + thumb_func_start sub_807ACDC +sub_807ACDC: @ 807ACDC + push {lr} + ldr r0, _0807ACEC + ldrb r0, [r0] + cmp r0, 0 + bne _0807ACF0 + movs r0, 0 + b _0807ACF8 + .align 2, 0 +_0807ACEC: .4byte 0x03003124 +_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, _0807AD4C + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0807AD50 + adds r1, r0 + mov r8, r1 + movs r4, 0x1 +_0807AD22: + cmp r6, 0x1 + bne _0807AD40 + ldr r0, _0807AD4C + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, _0807AD54 + adds r1, r0 + mov r8, r1 + movs r4, 0x3 +_0807AD40: + cmp r5, 0 + beq _0807AD58 + cmp r5, 0x1 + beq _0807ADE0 + b _0807AE36 + .align 2, 0 +_0807AD4C: .4byte 0x02032298 +_0807AD50: .4byte 0x020244ec +_0807AD54: .4byte 0x02024744 +_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, _0807AD8C + adds r0, r1 + ldr r1, _0807AD90 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + adds r3, r7, 0 + bl help_system_enable_unless_flashback__sp199 + movs r4, 0 + b _0807ADB2 + .align 2, 0 +_0807AD8C: .4byte 0x0830a18c +_0807AD90: .4byte 0x020244d4 +_0807AD94: + lsls r0, r5, 3 + ldr r1, _0807ADD4 + adds r0, r1 + ldr r1, _0807ADD8 + 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 sub_8034B50 +_0807ADB2: + mov r0, r8 + bl sub_806E794 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _0807ADDC + 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 + .align 2, 0 +_0807ADD4: .4byte 0x0830a18c +_0807ADD8: .4byte 0x020244d4 +_0807ADDC: .4byte 0x020322a0 +_0807ADE0: + mov r0, r8 + bl sub_806E794 + ldrh r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_806A068 + ldr r0, _0807AE40 + movs r1, 0x78 + movs r2, 0x3C + movs r3, 0x6 + bl obj_add_from_template_forward_search + ldr r4, _0807AE44 + ldr r1, [r4] + adds r1, 0x8E + adds r1, r6 + strb r0, [r1] + ldr r3, _0807AE48 + 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, _0807AE4C + str r1, [r0] +_0807AE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807AE40: .4byte 0x0202499c +_0807AE44: .4byte 0x020322a0 +_0807AE48: .4byte 0x02020630 +_0807AE4C: .4byte nullsub_12 + 1 + thumb_func_end sub_807ACFC + + thumb_func_start sub_807AE50 +sub_807AE50: @ 807AE50 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _0807AE70 + 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, _0807AE74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807AE70: .4byte 0x030022c0 +_0807AE74: .4byte _0807AE78 + .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, _0807AF40 + ldrb r0, [r0] + cmp r0, 0 + bne _0807AEC0 + ldr r1, _0807AF44 + ldr r2, _0807AF48 + adds r0, r2, 0 + strh r0, [r1] + bl sub_80097E8 +_0807AEC0: + ldr r4, _0807AF4C + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4] + bl init_uns_table_pokemon_copy + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _0807AF50 + bl SetVBlankCallback + bl sub_807B170 + bl sub_807AC3C + ldr r1, _0807AF54 + 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 + .align 2, 0 +_0807AF40: .4byte 0x03003124 +_0807AF44: .4byte 0x020229c6 +_0807AF48: .4byte 0x00001144 +_0807AF4C: .4byte 0x020322a0 +_0807AF50: .4byte sub_807AC24 + 1 +_0807AF54: .4byte 0x030022c0 +_0807AF58: + ldr r0, _0807AF84 + ldrb r5, [r0] + cmp r5, 0 + bne _0807AF90 + ldr r4, _0807AF88 + ldr r0, [r4] + adds r0, 0xFA + movs r1, 0x1 + strb r1, [r0] + bl sub_8009734 + ldr r1, _0807AF8C + 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 + .align 2, 0 +_0807AF84: .4byte 0x03003124 +_0807AF88: .4byte 0x020322a0 +_0807AF8C: .4byte 0x030022c0 +_0807AF90: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x4 + strb r0, [r1] + b _0807B116 +_0807AF9C: + ldr r0, _0807AFB8 + 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 + .align 2, 0 +_0807AFB8: .4byte 0x020322a0 +_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, _0807AFF8 + 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, _0807AFFC + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .align 2, 0 +_0807AFF8: .4byte 0x020322a0 +_0807AFFC: .4byte 0x030022c0 +_0807B000: + bl sub_807AC64 + b _0807B116 +_0807B006: + bl sub_807AC64 + ldr r0, _0807B02C + 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, _0807B030 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .align 2, 0 +_0807B02C: .4byte 0x03003124 +_0807B030: .4byte 0x030022c0 +_0807B034: + ldr r2, _0807B054 + 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 + .align 2, 0 +_0807B054: .4byte 0x020322a0 +_0807B058: + movs r0, 0 + movs r1, 0x1 + bl sub_807ACFC + ldr r1, _0807B06C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .align 2, 0 +_0807B06C: .4byte 0x030022c0 +_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, _0807B090 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .align 2, 0 +_0807B090: .4byte 0x030022c0 +_0807B094: + bl sub_807BA94 + ldr r0, _0807B0A8 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807B0AC + bl gpu_pal_obj_alloc_tag_and_apply + b _0807B0DC + .align 2, 0 +_0807B0A8: .4byte 0x08338d18 +_0807B0AC: .4byte 0x08338d20 +_0807B0B0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0 + bl gpu_sync_bg_show + ldr r1, _0807B0D0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .align 2, 0 +_0807B0D0: .4byte 0x030022c0 +_0807B0D4: + bl sub_807B140 + bl sub_807BAD8 +_0807B0DC: + ldr r1, _0807B0EC + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_0807B0E4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807B116 + .align 2, 0 +_0807B0EC: .4byte 0x030022c0 +_0807B0F0: + ldr r0, _0807B134 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807B116 + ldr r0, _0807B138 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B110 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0807B110: + ldr r0, _0807B13C + bl set_callback2 +_0807B116: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807B134: .4byte 0x02037fd4 +_0807B138: .4byte 0x030030fc +_0807B13C: .4byte sub_807EA2C + 1 + 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 Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + 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 lcd_io_set + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0807B258 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + adds r0, r5, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + adds r0, r5, 0 + bl malloc + adds r1, r0, 0 + movs r0, 0x3 + bl bg_set_tilemap + bl TextBox_ResetSomeField + ldr r0, _0807B25C + 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, _0807B260 + mov r8, r0 + ldr r4, _0807B264 + adds r1, r4, 0 + bl call_LZZUnCompWram + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r6, _0807B268 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + ldr r0, _0807B26C + bl Window_InitFromTemplates + 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 call_LZZUnCompWram + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + 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 + .align 2, 0 +_0807B258: .4byte 0x08339014 +_0807B25C: .4byte 0x08c00000 +_0807B260: .4byte 0x08c00524 +_0807B264: .4byte 0x0201c000 +_0807B268: .4byte 0x08c004e0 +_0807B26C: .4byte 0x08338ffc + 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, _0807B294 + 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, _0807B298 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807B294: .4byte 0x030022c0 +_0807B298: .4byte _0807B29C + .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, _0807B38C + ldr r0, _0807B390 + ldrh r0, [r0] + movs r6, 0 + strb r0, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r4, _0807B394 + ldr r0, _0807B398 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcpy + ldr r5, _0807B39C + adds r0, r5, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + adds r0, 0x1C + mov r1, sp + bl gf_strcpy + 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, _0807B3A0 + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + bl malloc_and_clear + str r0, [r4] + bl init_uns_table_pokemon_copy + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _0807B3A4 + 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, _0807B3A8 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _0807B43E + .align 2, 0 +_0807B38C: .4byte 0x02032298 +_0807B390: .4byte 0x020375e2 +_0807B394: .4byte 0x020229f0 +_0807B398: .4byte 0x03005d90 +_0807B39C: .4byte 0x02024744 +_0807B3A0: .4byte 0x020322a0 +_0807B3A4: .4byte sub_807AC24 + 1 +_0807B3A8: .4byte 0x030022c0 +_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 gpu_sync_bg_show + b _0807B424 +_0807B3D0: + movs r0, 0x1 + movs r1, 0x1 + bl sub_807ACFC + movs r0, 0 + movs r1, 0xFF + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + b _0807B424 +_0807B3F0: + bl sub_807BA94 + ldr r0, _0807B404 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807B408 + bl gpu_pal_obj_alloc_tag_and_apply + b _0807B424 + .align 2, 0 +_0807B404: .4byte 0x08338d18 +_0807B408: .4byte 0x08338d20 +_0807B40C: + movs r0, 0 + bl gpu_sync_bg_show + b _0807B424 +_0807B414: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0 + bl sub_807B62C + bl sub_807BAD8 +_0807B424: + ldr r1, _0807B434 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807B43E + .align 2, 0 +_0807B434: .4byte 0x030022c0 +_0807B438: + ldr r0, _0807B460 + bl set_callback2 +_0807B43E: + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807B460: .4byte sub_807B60C + 1 + 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, _0807B4C0 + 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 species_to_pokedex_index + 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 sub_806F01C +_0807B4B8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807B4C0: .4byte 0x020244ec + 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, _0807B59C + 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, _0807B5A0 + 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, _0807B5A4 + lsls r1, r6, 3 + adds r1, r6 + lsls r1, 2 + ldr r2, _0807B5A8 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 + bl sub_80D439C +_0807B52A: + ldr r4, _0807B5AC + 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, _0807B5B0 + adds r1, r0 + adds r0, r7, 0 + bl sub_80D460C +_0807B57C: + mov r0, r9 + bl sub_807B464 + ldr r0, _0807B5B4 + 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 + .align 2, 0 +_0807B59C: .4byte 0x020244ec +_0807B5A0: .4byte 0x02024744 +_0807B5A4: .4byte 0x03005d8c +_0807B5A8: .4byte 0x00002be0 +_0807B5AC: .4byte 0x020322a0 +_0807B5B0: .4byte 0x020321c0 +_0807B5B4: .4byte 0x03003124 + thumb_func_end sub_807B4D0 + + thumb_func_start sub_807B5B8 +sub_807B5B8: @ 807B5B8 + push {r4,lr} + ldr r4, _0807B5CC + ldr r0, [r4] + adds r0, 0x93 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807B5D0 + cmp r0, 0x2 + beq _0807B5F6 + b _0807B600 + .align 2, 0 +_0807B5CC: .4byte 0x020322a0 +_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, _0807B608 + ldr r0, [r0] + adds r0, 0x93 + movs r1, 0 + strb r1, [r0] +_0807B600: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807B608: .4byte 0x020322a0 + thumb_func_end sub_807B5B8 + + thumb_func_start sub_807B60C +sub_807B60C: @ 807B60C + push {lr} + bl sub_807BBC8 + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + 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, _0807B644 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807B644: .4byte _0807B648 + .align 2, 0 +_0807B648: + .4byte _0807B668 + .4byte _0807B6DC + .4byte _0807B784 + .4byte _0807B7F8 + .4byte _0807B840 + .4byte _0807B90C + .4byte _0807B924 + .4byte _0807B9FC +_0807B668: + ldr r0, _0807B6C0 + 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 lcd_io_set + ldr r1, _0807B6C4 + movs r0, 0xC + bl lcd_io_set + ldr r0, _0807B6C8 + movs r1, 0x10 + movs r2, 0x60 + bl gpu_pal_apply + ldr r3, _0807B6CC + ldr r4, _0807B6D0 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, _0807B6D4 + ldr r6, _0807B6D8 + 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 + .align 2, 0 +_0807B6C0: .4byte 0x020322a0 +_0807B6C4: .4byte 0x00005206 +_0807B6C8: .4byte 0x08dd7300 +_0807B6CC: .4byte 0x08dd7360 +_0807B6D0: .4byte 0x06004000 +_0807B6D4: .4byte 0x040000d4 +_0807B6D8: .4byte 0x80000800 +_0807B6DC: + ldr r4, _0807B714 + 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 lcd_io_set + ldr r1, _0807B718 + movs r0, 0xA + bl lcd_io_set + ldr r1, _0807B71C + movs r0, 0xC + bl lcd_io_set + ldr r0, [r4] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B724 + ldr r1, _0807B720 + b _0807B726 + .align 2, 0 +_0807B714: .4byte 0x020322a0 +_0807B718: .4byte 0x00008502 +_0807B71C: .4byte 0x00009206 +_0807B720: .4byte 0x083369a0 +_0807B724: + ldr r1, _0807B770 +_0807B726: + ldr r2, _0807B774 + ldr r0, _0807B778 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807B77C + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r3, _0807B780 + movs r4, 0xC0 + lsls r4, 19 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, _0807B778 + ldr r6, _0807B77C + 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 + .align 2, 0 +_0807B770: .4byte 0x083359a0 +_0807B774: .4byte 0x06002800 +_0807B778: .4byte 0x040000d4 +_0807B77C: .4byte 0x80000800 +_0807B780: .4byte 0x08dd7360 +_0807B784: + ldr r0, _0807B7B0 + 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, _0807B7B4 + movs r0, 0 + bl lcd_io_set + ldr r0, _0807B7B8 + ldr r1, _0807B7BC + bl LZ77UnCompVram + movs r0, 0x8 + b _0807B7DA + .align 2, 0 +_0807B7B0: .4byte 0x020322a0 +_0807B7B4: .4byte 0x00001241 +_0807B7B8: .4byte 0x083379a0 +_0807B7BC: .4byte 0x06002800 +_0807B7C0: + ldr r1, _0807B7E4 + movs r0, 0 + bl lcd_io_set + ldr r1, _0807B7E8 + ldr r2, _0807B7EC + ldr r0, _0807B7F0 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807B7F4 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x1 +_0807B7DA: + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _0807BA68 + .align 2, 0 +_0807B7E4: .4byte 0x00001241 +_0807B7E8: .4byte 0x0832ffc0 +_0807B7EC: .4byte 0x06002800 +_0807B7F0: .4byte 0x040000d4 +_0807B7F4: .4byte 0x80000400 +_0807B7F8: + ldr r0, _0807B828 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0807B82C + ldr r1, _0807B830 + bl LZ77UnCompVram + ldr r0, _0807B834 + ldr r1, _0807B838 + bl LZ77UnCompVram + ldr r0, _0807B83C + ldr r0, [r0] + adds r0, 0xE4 + movs r1, 0x50 + strh r1, [r0] + movs r1, 0xB2 + lsls r1, 5 +_0807B820: + movs r0, 0 + bl lcd_io_set + b _0807BA68 + .align 2, 0 +_0807B828: .4byte 0x08337ea0 +_0807B82C: .4byte 0x08337ec0 +_0807B830: .4byte 0x06004000 +_0807B834: .4byte 0x08338550 +_0807B838: .4byte 0x06009000 +_0807B83C: .4byte 0x020322a0 +_0807B840: + ldr r1, _0807B8C4 + movs r0, 0 + bl lcd_io_set + ldr r1, _0807B8C8 + movs r0, 0xC + bl lcd_io_set + ldr r0, _0807B8CC + 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, _0807B8D0 + ldr r4, _0807B8D4 + movs r5, 0xA1 + lsls r5, 6 + ldr r1, _0807B8D8 + ldr r6, _0807B8DC + 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, _0807B8CC + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B8EC + ldr r1, _0807B8E0 + ldr r2, _0807B8E4 + ldr r0, _0807B8D8 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807B8E8 + b _0807BA64 + .align 2, 0 +_0807B8C4: .4byte 0x00001441 +_0807B8C8: .4byte 0x00001287 +_0807B8CC: .4byte 0x020322a0 +_0807B8D0: .4byte 0x08332f60 +_0807B8D4: .4byte 0x06004000 +_0807B8D8: .4byte 0x040000d4 +_0807B8DC: .4byte 0x80000800 +_0807B8E0: .4byte 0x083357a0 +_0807B8E4: .4byte 0x06009000 +_0807B8E8: .4byte 0x80000080 +_0807B8EC: + ldr r1, _0807B8FC + ldr r2, _0807B900 + ldr r0, _0807B904 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807B908 + b _0807BA64 + .align 2, 0 +_0807B8FC: .4byte 0x083358a0 +_0807B900: .4byte 0x06009000 +_0807B904: .4byte 0x040000d4 +_0807B908: .4byte 0x80000080 +_0807B90C: + ldr r0, _0807B920 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xE0 + movs r2, 0 + strh r2, [r1] + adds r0, 0xE2 + strh r2, [r0] + b _0807BA68 + .align 2, 0 +_0807B920: .4byte 0x020322a0 +_0807B924: + ldr r1, _0807B9B4 + movs r0, 0 + bl lcd_io_set + ldr r1, _0807B9B8 + movs r0, 0xC + bl lcd_io_set + ldr r0, _0807B9BC + 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, _0807B9C0 + ldr r4, _0807B9C4 + movs r5, 0xA1 + lsls r5, 6 + ldr r1, _0807B9C8 + ldr r6, _0807B9CC + 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, _0807B9BC + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B9DC + ldr r1, _0807B9D0 + ldr r2, _0807B9D4 + ldr r0, _0807B9C8 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807B9D8 + b _0807BA64 + .align 2, 0 +_0807B9B4: .4byte 0x00001441 +_0807B9B8: .4byte 0x00001287 +_0807B9BC: .4byte 0x020322a0 +_0807B9C0: .4byte 0x08332f60 +_0807B9C4: .4byte 0x06004000 +_0807B9C8: .4byte 0x040000d4 +_0807B9CC: .4byte 0x80000800 +_0807B9D0: .4byte 0x083357a0 +_0807B9D4: .4byte 0x06009000 +_0807B9D8: .4byte 0x80000080 +_0807B9DC: + ldr r1, _0807B9EC + ldr r2, _0807B9F0 + ldr r0, _0807B9F4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807B9F8 + b _0807BA64 + .align 2, 0 +_0807B9EC: .4byte 0x083358a0 +_0807B9F0: .4byte 0x06009000 +_0807B9F4: .4byte 0x040000d4 +_0807B9F8: .4byte 0x80000080 +_0807B9FC: + ldr r0, _0807BA70 + 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 lcd_io_set + ldr r1, _0807BA74 + movs r0, 0xC + bl lcd_io_set + ldr r0, _0807BA78 + movs r1, 0x10 + movs r2, 0x60 + bl gpu_pal_apply + ldr r3, _0807BA7C + ldr r4, _0807BA80 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, _0807BA84 + ldr r6, _0807BA88 + 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, _0807BA8C + ldr r2, _0807BA90 + ldr r0, _0807BA84 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0807BA88 +_0807BA64: + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] +_0807BA68: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807BA70: .4byte 0x020322a0 +_0807BA74: .4byte 0x00005206 +_0807BA78: .4byte 0x08dd7300 +_0807BA7C: .4byte 0x08dd7360 +_0807BA80: .4byte 0x06004000 +_0807BA84: .4byte 0x040000d4 +_0807BA88: .4byte 0x80000800 +_0807BA8C: .4byte 0x08331f60 +_0807BA90: .4byte 0x06009000 + thumb_func_end sub_807B62C + + thumb_func_start sub_807BA94 +sub_807BA94: @ 807BA94 + push {lr} + ldr r0, _0807BAC0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807BAC4 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807BAC8 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807BACC + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807BAD0 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _0807BAD4 + bl gpu_pal_obj_alloc_tag_and_apply + pop {r0} + bx r0 + .align 2, 0 +_0807BAC0: .4byte 0x08338d70 +_0807BAC4: .4byte 0x08338dc0 +_0807BAC8: .4byte 0x08338df4 +_0807BACC: .4byte 0x08338e6c +_0807BAD0: .4byte 0x08338d78 +_0807BAD4: .4byte 0x08338d80 + thumb_func_end sub_807BA94 + + thumb_func_start sub_807BAD8 +sub_807BAD8: @ 807BAD8 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, _0807BB48 + ldr r0, [r0] + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807BB68 + bl link_get_multiplayer_id + lsls r0, 24 + ldr r3, _0807BB4C + movs r2, 0x80 + lsls r2, 17 + eors r2, r0 + lsrs r2, 24 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, _0807BB50 + adds r1, r0 + adds r0, r3, 0 + bl gf_strcpy + ldr r5, _0807BB54 + ldrb r0, [r5, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x64 + muls r0, r4 + ldr r1, _0807BB58 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _0807BB5C + mov r1, sp + bl strcpy_limit_10_chars + ldrb r0, [r5] + muls r0, r4 + ldr r1, _0807BB60 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _0807BB64 + mov r1, sp + bl strcpy_limit_10_chars + b _0807BBA4 + .align 2, 0 +_0807BB48: .4byte 0x020322a0 +_0807BB4C: .4byte 0x02021cc4 +_0807BB50: .4byte 0x020229f0 +_0807BB54: .4byte 0x02032298 +_0807BB58: .4byte 0x02024744 +_0807BB5C: .4byte 0x02021ec4 +_0807BB60: .4byte 0x020244ec +_0807BB64: .4byte 0x02021dc4 +_0807BB68: + ldr r0, _0807BBAC + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, _0807BBB0 + adds r4, r0 + ldr r0, _0807BBB4 + adds r1, r4, 0 + adds r1, 0x2B + bl gf_strcpy + ldr r0, _0807BBB8 + adds r1, r4, 0 + bl strcpy_limit_10_chars + ldr r0, _0807BBBC + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0807BBC0 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _0807BBC4 + mov r1, sp + bl strcpy_limit_10_chars +_0807BBA4: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807BBAC: .4byte 0x020375e0 +_0807BBB0: .4byte 0x08338ed0 +_0807BBB4: .4byte 0x02021cc4 +_0807BBB8: .4byte 0x02021ec4 +_0807BBBC: .4byte 0x020375e2 +_0807BBC0: .4byte 0x020244ec +_0807BBC4: .4byte 0x02021dc4 + thumb_func_end sub_807BAD8 + + thumb_func_start sub_807BBC8 +sub_807BBC8: @ 807BBC8 + push {lr} + ldr r0, _0807BBDC + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _0807BBE0 + bl sub_807CFC8 + b _0807BBE4 + .align 2, 0 +_0807BBDC: .4byte 0x020322a0 +_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, _0807BC10 + ldr r1, [r0] + adds r1, 0x94 + ldrh r5, [r1] + ldr r1, _0807BC14 + adds r7, r0, 0 + cmp r5, r1 + bls _0807BC04 + bl _0807CFB4 +_0807BC04: + lsls r0, r5, 2 + ldr r1, _0807BC18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807BC10: .4byte 0x020322a0 +_0807BC14: .4byte 0x0000010b +_0807BC18: .4byte _0807BC1C + .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, _0807C0B4 + 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, _0807C0B8 + strh r1, [r0, 0x24] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, _0807C0BC + 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, _0807C0C0 + bl current_map_music_set + bl _0807CFB4 + .align 2, 0 +_0807C0B4: .4byte 0x02020630 +_0807C0B8: .4byte 0x0000ff4c +_0807C0BC: .4byte 0x08300d38 +_0807C0C0: .4byte 0x00000179 +_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, _0807C0F4 + 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 + .align 2, 0 +_0807C0F4: .4byte 0x02020630 +_0807C0F8: + ldr r2, _0807C11C + 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 + .align 2, 0 +_0807C11C: .4byte 0x02020630 +_0807C120: + ldr r4, _0807C15C + ldr r1, _0807C160 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r4, _0807C164 + 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 + .align 2, 0 +_0807C15C: .4byte 0x02021fc4 +_0807C160: .4byte 0x085ee942 +_0807C164: .4byte 0x020322a0 +_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, _0807C1CC + 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, _0807C1D0 + 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, _0807C1D4 + ldr r1, _0807C1D8 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + bl _0807CFB4 + .align 2, 0 +_0807C1CC: .4byte 0x02020630 +_0807C1D0: .4byte 0x000fffff +_0807C1D4: .4byte 0x02021fc4 +_0807C1D8: .4byte 0x085ee959 +_0807C1DC: + ldr r5, _0807C238 + 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, _0807C23C + cmp r1, r0 + beq _0807C1FC + bl _0807CFB4 +_0807C1FC: + ldr r0, _0807C240 + movs r1, 0x78 + movs r2, 0x20 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _0807C244 + str r1, [r0] + adds r2, 0xD2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + ldr r1, [r7] + bl _0807CF4C + .align 2, 0 +_0807C238: .4byte 0x02020630 +_0807C23C: .4byte nullsub_12 + 1 +_0807C240: .4byte 0x08338d28 +_0807C244: .4byte sub_807E5D8 + 1 +_0807C248: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0807C268 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x14 + strh r1, [r0] + bl _0807CFB4 + .align 2, 0 +_0807C268: .4byte 0x020322a0 +_0807C26C: + ldr r0, _0807C298 + 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 Window_FastFillPixels + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + bl _0807CF48 + .align 2, 0 +_0807C298: .4byte 0x02037fd4 +_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, _0807C2CC + 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 + .align 2, 0 +_0807C2CC: .4byte 0x02037fd4 +_0807C2D0: + ldr r4, _0807C2EC + 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 + .align 2, 0 +_0807C2EC: .4byte 0x020322a0 +_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, _0807C314 + ldr r4, [r0] + bl _0807CB5C + .align 2, 0 +_0807C314: .4byte 0x020322a0 +_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, _0807C344 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r7] + bl _0807CF4C + .align 2, 0 +_0807C344: .4byte 0x08338e74 +_0807C348: + ldr r2, _0807C388 + 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 obj_delete_and_free_tiles + movs r1, 0xC8 + lsls r1, 3 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0807C38C + movs r0, 0x52 + bl lcd_io_set + ldr r1, [r7] + bl _0807CF4C + .align 2, 0 +_0807C388: .4byte 0x02020630 +_0807C38C: .4byte 0x0000040c +_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, _0807C3DC + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r1, 0x92 + strb r0, [r1] + bl _0807CFB4 + .align 2, 0 +_0807C3DC: .4byte 0x08338dfc +_0807C3E0: + ldr r0, _0807C424 + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0x3 + bl obj_add_from_template_forward_search + ldr r4, _0807C428 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + ldr r0, _0807C42C + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _0807C430 + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + ldr r1, [r4] + bl _0807CF4C + .align 2, 0 +_0807C424: .4byte 0x08338d88 +_0807C428: .4byte 0x020322a0 +_0807C42C: .4byte 0x08338dc8 +_0807C430: .4byte 0x02020630 +_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, _0807C45C + movs r0, 0 + bl lcd_io_set + bl _0807CFB4 + .align 2, 0 +_0807C45C: .4byte 0x00001241 +_0807C460: + ldr r2, _0807C4B4 + 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 + .align 2, 0 +_0807C4B4: .4byte 0x02020630 +_0807C4B8: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0807C4D8 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1E + strh r1, [r0] + bl _0807CFB4 + .align 2, 0 +_0807C4D8: .4byte 0x020322a0 +_0807C4DC: + ldr r0, _0807C520 + 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, _0807C524 + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r0, 0x2 + bl sub_807B62C + ldr r1, [r7] + bl _0807CF4C + .align 2, 0 +_0807C520: .4byte 0x02037fd4 +_0807C524: .4byte 0x02020630 +_0807C528: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r5, _0807C56C + adds r0, r5, 0 + movs r1, 0x6F + movs r2, 0xAA + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r4, _0807C570 + 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 obj_add_from_template_forward_search + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r4] + bl _0807CF4C + .align 2, 0 +_0807C56C: .4byte 0x08338dc8 +_0807C570: .4byte 0x020322a0 +_0807C574: + ldr r0, _0807C5C4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807C592 + movs r0, 0x2E + bl audio_play + ldr r0, _0807C5C8 + ldr r1, [r0] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807C592: + ldr r3, _0807C5CC + ldr r0, _0807C5C8 + 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 + .align 2, 0 +_0807C5C4: .4byte 0x02037fd4 +_0807C5C8: .4byte 0x020322a0 +_0807C5CC: .4byte 0x02020630 +_0807C5D0: + ldr r5, _0807C62C + 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 + .align 2, 0 +_0807C62C: .4byte 0x02020630 +_0807C630: + ldr r2, _0807C640 + movs r0, 0x1 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807CF48 + .align 2, 0 +_0807C640: .4byte 0x0000ffff +_0807C644: + ldr r2, _0807C654 + movs r0, 0x1 + movs r1, 0 + bl sub_80A2A20 + bl _0807CF48 + .align 2, 0 +_0807C654: .4byte 0x0000ffff +_0807C658: + ldr r2, _0807C668 + movs r0, 0x1 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807CF48 + .align 2, 0 +_0807C668: .4byte 0x0000ffff +_0807C66C: + ldr r5, _0807C6D8 + ldr r0, [r5] + adds r0, 0xF0 + ldrh r0, [r0] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0807C6E4 + ldr r4, _0807C6DC + 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, _0807C6E0 + 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 oam_center + 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 sub_8008258 + b _0807C6FA + .align 2, 0 +_0807C6D8: .4byte 0x020322a0 +_0807C6DC: .4byte 0x02020630 +_0807C6E0: .4byte 0x08338ecc +_0807C6E4: + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0807C788 + adds r0, r1 + movs r1, 0 + bl sub_8008258 +_0807C6FA: + ldr r5, _0807C78C + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0807C788 + adds r0, r4 + movs r1, 0 + bl sub_8008258 + 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, _0807C790 + 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 + .align 2, 0 +_0807C788: .4byte 0x02020630 +_0807C78C: .4byte 0x020322a0 +_0807C790: .4byte 0x0000ffe0 +_0807C794: + ldr r4, _0807C85C + 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, _0807C860 + movs r0, 0x1 + movs r1, 0 + bl sub_80A2A20 + b _0807CFB4 + .align 2, 0 +_0807C85C: .4byte 0x02020630 +_0807C860: .4byte 0x0000ffff +_0807C864: + ldr r4, _0807C8E8 + 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 sub_80A1AD4 + 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 obj_delete_and_free_tiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + b _0807CFB4 + .align 2, 0 +_0807C8E8: .4byte 0x02020630 +_0807C8EC: + ldr r0, _0807C954 + 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, _0807C958 + movs r4, 0x14 + negs r4, r4 + movs r1, 0x80 + adds r2, r4, 0 + movs r3, 0x3 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r1, 0x90 + strb r0, [r1] + ldr r0, _0807C95C + movs r1, 0x80 + adds r2, r4, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _0807C960 + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + b _0807CFB4 + .align 2, 0 +_0807C954: .4byte 0x02037fd4 +_0807C958: .4byte 0x08338d88 +_0807C95C: .4byte 0x08338dc8 +_0807C960: .4byte 0x02020630 +_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 lcd_io_set + ldr r0, _0807C990 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C98C + b _0807CFB4 +_0807C98C: + b _0807CF48 + .align 2, 0 +_0807C990: .4byte 0x02037fd4 +_0807C994: + ldr r2, _0807C9E0 + 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 + .align 2, 0 +_0807C9E0: .4byte 0x02020630 +_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, _0807CA3C + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + 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 + .align 2, 0 +_0807CA3C: .4byte 0x02020630 +_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, _0807CABC + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r1, 0x92 + strb r0, [r1] + ldr r2, _0807CAC0 + 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, _0807CAC4 + str r1, [r0] + b _0807CFB4 + .align 2, 0 +_0807CABC: .4byte 0x08338dfc +_0807CAC0: .4byte 0x02020630 +_0807CAC4: .4byte sub_807AAE0 + 1 +_0807CAC8: + ldr r0, _0807CAE8 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r2, _0807CAEC + ldr r1, [r2] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0x32 + strh r1, [r0] + b _0807CFB4 + .align 2, 0 +_0807CAE8: .4byte 0x08338e74 +_0807CAEC: .4byte 0x020322a0 +_0807CAF0: + ldr r2, _0807CB2C + 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 obj_delete_and_free_tiles + 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 + .align 2, 0 +_0807CB2C: .4byte 0x02020630 +_0807CB30: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xEA + ldrh r3, [r2] + ldr r0, _0807CB48 + cmp r3, r0 + bhi _0807CB4C + adds r0, r3, 0 + adds r0, 0x34 + strh r0, [r2] + b _0807CB5A + .align 2, 0 +_0807CB48: .4byte 0x000003ff +_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 sub_80A1AD4 + ldr r0, _0807CB8C + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x3C + strh r1, [r0] + b _0807CFB4 + .align 2, 0 +_0807CB8C: .4byte 0x020322a0 +_0807CB90: + ldr r4, _0807CBB4 + 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 + .align 2, 0 +_0807CBB4: .4byte 0x02037fd4 +_0807CBB8: + ldr r2, _0807CBD0 + 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 + .align 2, 0 +_0807CBD0: .4byte 0x02037fd4 +_0807CBD4: + movs r1, 0xA2 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _0807CBF0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807CBEC + b _0807CFB4 +_0807CBEC: + b _0807CF48 + .align 2, 0 +_0807CBF0: .4byte 0x02037fd4 +_0807CBF4: + ldr r0, _0807CC88 + movs r2, 0x8 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r5, _0807CC8C + ldr r1, [r5] + adds r1, 0xD3 + movs r6, 0 + strb r0, [r1] + ldr r4, _0807CC90 + 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, _0807CC94 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl obj_anim_image_start + 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 sub_8008258 + 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, _0807CC98 + 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 + .align 2, 0 +_0807CC88: .4byte 0x08338d28 +_0807CC8C: .4byte 0x020322a0 +_0807CC90: .4byte 0x02020630 +_0807CC94: .4byte sub_807E6AC + 1 +_0807CC98: .4byte 0x0000ffff +_0807CC9C: + ldr r2, _0807CCC8 + 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, _0807CCCC + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, [r7] + b _0807CF4C + .align 2, 0 +_0807CCC8: .4byte 0x02020630 +_0807CCCC: .4byte 0x0000ffff +_0807CCD0: + ldr r2, _0807CD0C + 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, _0807CD10 + cmp r1, r0 + beq _0807CCEE + b _0807CFB4 +_0807CCEE: + adds r0, r3, 0 + adds r0, 0xF2 + ldrh r2, [r0] + lsls r0, r2, 3 + ldr r1, _0807CD14 + adds r0, r1 + ldr r1, _0807CD18 + ldr r1, [r1] + ldr r1, [r1, 0x10] + ldr r3, [r3, 0x6C] + bl help_system_enable_unless_flashback__sp199 + ldr r1, [r7] + b _0807CF4C + .align 2, 0 +_0807CD0C: .4byte 0x02020630 +_0807CD10: .4byte nullsub_12 + 1 +_0807CD14: .4byte 0x0830a18c +_0807CD18: .4byte 0x020244d4 +_0807CD1C: + ldr r4, _0807CDD0 + 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, _0807CDD4 + 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 obj_anim_image_start + 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, _0807CDD8 + 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 obj_delete_and_free_tiles + ldr r1, [r7] + b _0807CF4C + .align 2, 0 +_0807CDD0: .4byte 0x02020630 +_0807CDD4: .4byte 0x08300d38 +_0807CDD8: .4byte 0x000fffff +_0807CDDC: + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r4, _0807CE0C + ldr r1, _0807CE10 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, _0807CE14 + 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 + .align 2, 0 +_0807CE0C: .4byte 0x02021fc4 +_0807CE10: .4byte 0x085ee966 +_0807CE14: .4byte 0x020322a0 +_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, _0807CE34 + strh r1, [r0] + str r2, [r3, 0x64] + b _0807CFB4 + .align 2, 0 +_0807CE34: .4byte 0x0000010b +_0807CE38: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0807CE44 + b _0807CFB4 +_0807CE44: + ldr r0, _0807CE50 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x44 + strh r1, [r0] + b _0807CFB4 + .align 2, 0 +_0807CE50: .4byte 0x020322a0 +_0807CE54: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bne _0807CE66 + ldr r0, _0807CE94 + 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, _0807CE98 + ldr r1, _0807CE9C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, [r7] + str r5, [r0, 0x64] + b _0807CFB4 + .align 2, 0 +_0807CE94: .4byte 0x00000173 +_0807CE98: .4byte 0x02021fc4 +_0807CE9C: .4byte 0x085ee977 +_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, _0807CED8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807CFB4 + adds r1, r2, 0 + b _0807CF4C + .align 2, 0 +_0807CED8: .4byte 0x030022c0 +_0807CEDC: + ldr r0, _0807CF20 + ldrb r0, [r0] + movs r1, 0 + bl sub_807B4D0 + ldr r1, _0807CF24 + ldr r0, _0807CF28 + str r0, [r1] + ldr r7, _0807CF2C + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0807CF30 + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl sub_806D098 + 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, _0807CF34 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807CF48 + .align 2, 0 +_0807CF20: .4byte 0x020375e2 +_0807CF24: .4byte 0x030061e8 +_0807CF28: .4byte sub_807B60C + 1 +_0807CF2C: .4byte 0x02032298 +_0807CF30: .4byte 0x020244ec +_0807CF34: .4byte 0x020322a0 +_0807CF38: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_0807CF44: + bl sub_80A1AD4 +_0807CF48: + ldr r0, _0807CF58 + ldr r1, [r0] +_0807CF4C: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0807CFB4 + .align 2, 0 +_0807CF58: .4byte 0x020322a0 +_0807CF5C: + ldr r0, _0807CFC0 + 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 Window_FreeMemory + movs r0, 0x3 + bl bg_get_tilemap + bl free + movs r0, 0x1 + bl bg_get_tilemap + bl free + movs r0, 0 + bl bg_get_tilemap + bl free + bl sub_805F094 + ldr r0, [r7] + bl free + str r4, [r7] +_0807CFAA: + ldr r0, _0807CFC4 + bl set_callback2 + bl sub_807E784 +_0807CFB4: + movs r0, 0 +_0807CFB6: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807CFC0: .4byte 0x02037fd4 +_0807CFC4: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_807BBEC + + thumb_func_start sub_807CFC8 +sub_807CFC8: @ 807CFC8 + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, _0807CFEC + ldr r1, [r0] + adds r1, 0x94 + ldrh r5, [r1] + ldr r1, _0807CFF0 + adds r7, r0, 0 + cmp r5, r1 + bls _0807CFE0 + bl _0807E400 +_0807CFE0: + lsls r0, r5, 2 + ldr r1, _0807CFF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807CFEC: .4byte 0x020322a0 +_0807CFF0: .4byte 0x0000010b +_0807CFF4: .4byte _0807CFF8 + .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, _0807D490 + 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, _0807D494 + strh r1, [r0, 0x24] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, _0807D498 + 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, _0807D49C + bl current_map_music_set + bl _0807E400 + .align 2, 0 +_0807D490: .4byte 0x02020630 +_0807D494: .4byte 0x0000ff4c +_0807D498: .4byte 0x08300d38 +_0807D49C: .4byte 0x00000179 +_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, _0807D4D0 + 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 + .align 2, 0 +_0807D4D0: .4byte 0x02020630 +_0807D4D4: + ldr r2, _0807D4F8 + 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 + .align 2, 0 +_0807D4F8: .4byte 0x02020630 +_0807D4FC: + ldr r4, _0807D538 + ldr r1, _0807D53C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r4, _0807D540 + 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 + .align 2, 0 +_0807D538: .4byte 0x02021fc4 +_0807D53C: .4byte 0x085ee942 +_0807D540: .4byte 0x020322a0 +_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, _0807D5A8 + 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, _0807D5AC + 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, _0807D5B0 + ldr r1, _0807D5B4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + bl _0807E400 + .align 2, 0 +_0807D5A8: .4byte 0x02020630 +_0807D5AC: .4byte 0x000fffff +_0807D5B0: .4byte 0x02021fc4 +_0807D5B4: .4byte 0x085ee959 +_0807D5B8: + ldr r5, _0807D614 + 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, _0807D618 + cmp r1, r0 + beq _0807D5D8 + bl _0807E400 +_0807D5D8: + ldr r0, _0807D61C + movs r1, 0x78 + movs r2, 0x20 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _0807D620 + str r1, [r0] + adds r2, 0xD2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + ldr r1, [r7] + bl _0807E398 + .align 2, 0 +_0807D614: .4byte 0x02020630 +_0807D618: .4byte nullsub_12 + 1 +_0807D61C: .4byte 0x08338d28 +_0807D620: .4byte sub_807E5D8 + 1 +_0807D624: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0807D644 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x14 + strh r1, [r0] + bl _0807E400 + .align 2, 0 +_0807D644: .4byte 0x020322a0 +_0807D648: + ldr r0, _0807D674 + 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 Window_FastFillPixels + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + bl _0807E394 + .align 2, 0 +_0807D674: .4byte 0x02037fd4 +_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, _0807D6A8 + 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 + .align 2, 0 +_0807D6A8: .4byte 0x02037fd4 +_0807D6AC: + ldr r4, _0807D6C8 + 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 + .align 2, 0 +_0807D6C8: .4byte 0x020322a0 +_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, _0807D6F0 + ldr r4, [r0] + bl _0807DFA8 + .align 2, 0 +_0807D6F0: .4byte 0x020322a0 +_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, _0807D724 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r7] + bl _0807E398 + .align 2, 0 +_0807D724: .4byte 0x08338e8c +_0807D728: + ldr r2, _0807D770 + 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 obj_delete_and_free_tiles + ldr r1, _0807D774 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 3 + movs r0, 0x52 + bl lcd_io_set + ldr r0, _0807D778 + movs r1, 0x5 + bl AddTask + ldr r1, [r7] + bl _0807E398 + .align 2, 0 +_0807D770: .4byte 0x02020630 +_0807D774: .4byte 0x00000452 +_0807D778: .4byte c3_08054588 + 1 +_0807D77C: + ldr r0, _0807D79C + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0807D78C + bl _0807E400 +_0807D78C: + ldr r0, _0807D7A0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1A + strh r1, [r0] + bl _0807E400 + .align 2, 0 +_0807D79C: .4byte c3_08054588 + 1 +_0807D7A0: .4byte 0x020322a0 +_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, _0807D81C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x3 + bl obj_add_from_template_forward_search + ldr r4, _0807D820 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + ldr r5, _0807D824 + 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, _0807D828 + str r1, [r0] + ldr r0, _0807D82C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + ldr r1, [r4] + bl _0807E398 + .align 2, 0 +_0807D81C: .4byte 0x08338d88 +_0807D820: .4byte 0x020322a0 +_0807D824: .4byte 0x02020630 +_0807D828: .4byte sub_807AA4C + 1 +_0807D82C: .4byte 0x08338dc8 +_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, _0807D858 + movs r0, 0 + bl lcd_io_set + bl _0807E400 + .align 2, 0 +_0807D858: .4byte 0x00001241 +_0807D85C: + ldr r2, _0807D8B0 + 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 + .align 2, 0 +_0807D8B0: .4byte 0x02020630 +_0807D8B4: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0807D8D4 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1E + strh r1, [r0] + bl _0807E400 + .align 2, 0 +_0807D8D4: .4byte 0x020322a0 +_0807D8D8: + ldr r0, _0807D91C + 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, _0807D920 + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r0, 0x2 + bl sub_807B62C + ldr r1, [r7] + bl _0807E398 + .align 2, 0 +_0807D91C: .4byte 0x02037fd4 +_0807D920: .4byte 0x02020630 +_0807D924: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r5, _0807D968 + adds r0, r5, 0 + movs r1, 0x6F + movs r2, 0xAA + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r4, _0807D96C + 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 obj_add_from_template_forward_search + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r4] + bl _0807E398 + .align 2, 0 +_0807D968: .4byte 0x08338dc8 +_0807D96C: .4byte 0x020322a0 +_0807D970: + ldr r0, _0807D9C0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807D98E + movs r0, 0x2E + bl audio_play + ldr r0, _0807D9C4 + ldr r1, [r0] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807D98E: + ldr r3, _0807D9C8 + ldr r0, _0807D9C4 + 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 + .align 2, 0 +_0807D9C0: .4byte 0x02037fd4 +_0807D9C4: .4byte 0x020322a0 +_0807D9C8: .4byte 0x02020630 +_0807D9CC: + ldr r5, _0807DA30 + 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, _0807DA34 + b _0807DC5A + .align 2, 0 +_0807DA30: .4byte 0x02020630 +_0807DA34: .4byte c3_0805465C + 1 +_0807DA38: + ldr r2, _0807DA48 + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .align 2, 0 +_0807DA48: .4byte 0x0000ffff +_0807DA4C: + ldr r2, _0807DA5C + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .align 2, 0 +_0807DA5C: .4byte 0x0000ffff +_0807DA60: + ldr r2, _0807DA70 + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .align 2, 0 +_0807DA70: .4byte 0x0000ffff +_0807DA74: + ldr r5, _0807DAE0 + ldr r0, [r5] + adds r0, 0xF0 + ldrh r0, [r0] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0807DAEC + ldr r4, _0807DAE4 + 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, _0807DAE8 + 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 oam_center + 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 sub_8008258 + b _0807DB02 + .align 2, 0 +_0807DAE0: .4byte 0x020322a0 +_0807DAE4: .4byte 0x02020630 +_0807DAE8: .4byte 0x08338ecc +_0807DAEC: + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0807DB90 + adds r0, r1 + movs r1, 0 + bl sub_8008258 +_0807DB02: + ldr r5, _0807DB94 + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0807DB90 + adds r0, r4 + movs r1, 0 + bl sub_8008258 + 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, _0807DB98 + 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 + .align 2, 0 +_0807DB90: .4byte 0x02020630 +_0807DB94: .4byte 0x020322a0 +_0807DB98: .4byte 0x0000ffe0 +_0807DB9C: + ldr r4, _0807DC64 + 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, _0807DC68 +_0807DC5A: + movs r1, 0x5 + bl AddTask + b _0807E400 + .align 2, 0 +_0807DC64: .4byte 0x02020630 +_0807DC68: .4byte sub_807F39C + 1 +_0807DC6C: + ldr r4, _0807DCF0 + 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 sub_80A1AD4 + 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 obj_delete_and_free_tiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + b _0807E400 + .align 2, 0 +_0807DCF0: .4byte 0x02020630 +_0807DCF4: + ldr r0, _0807DD80 + 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, _0807DD84 + movs r4, 0x14 + negs r4, r4 + movs r1, 0x78 + adds r2, r4, 0 + movs r3, 0x3 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r1, 0x90 + strb r0, [r1] + ldr r5, _0807DD88 + 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, _0807DD8C + str r1, [r0] + ldr r0, _0807DD90 + movs r1, 0x78 + adds r2, r4, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + b _0807E400 + .align 2, 0 +_0807DD80: .4byte 0x02037fd4 +_0807DD84: .4byte 0x08338d88 +_0807DD88: .4byte 0x02020630 +_0807DD8C: .4byte sub_807AA4C + 1 +_0807DD90: .4byte 0x08338dc8 +_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 lcd_io_set + ldr r0, _0807DDC0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DDBC + b _0807E400 +_0807DDBC: + b _0807E394 + .align 2, 0 +_0807DDC0: .4byte 0x02037fd4 +_0807DDC4: + ldr r2, _0807DE18 + 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 + .align 2, 0 +_0807DE18: .4byte 0x02020630 +_0807DE1C: + movs r1, 0xB2 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r4, _0807DE78 + 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, _0807DE7C + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0807DE80 + 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 + .align 2, 0 +_0807DE78: .4byte 0x020322a0 +_0807DE7C: .4byte c3_08054588 + 1 +_0807DE80: .4byte 0x03005e00 +_0807DE84: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0807DEBC + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + 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 + .align 2, 0 +_0807DEBC: .4byte 0x02020630 +_0807DEC0: + ldr r0, _0807DEE0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0807DED0 + b _0807E400 +_0807DED0: + ldr r0, _0807DEE4 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x94 + movs r0, 0x2E + strh r0, [r1] + str r3, [r2, 0x64] + b _0807E400 + .align 2, 0 +_0807DEE0: .4byte c3_08054588 + 1 +_0807DEE4: .4byte 0x020322a0 +_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, _0807DF34 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r2, _0807DF38 + ldr r1, [r2] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0x32 + strh r1, [r0] + b _0807E400 + .align 2, 0 +_0807DF34: .4byte 0x08338e74 +_0807DF38: .4byte 0x020322a0 +_0807DF3C: + ldr r2, _0807DF78 + 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 obj_delete_and_free_tiles + 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 + .align 2, 0 +_0807DF78: .4byte 0x02020630 +_0807DF7C: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xEA + ldrh r3, [r2] + ldr r0, _0807DF94 + cmp r3, r0 + bhi _0807DF98 + adds r0, r3, 0 + adds r0, 0x34 + strh r0, [r2] + b _0807DFA6 + .align 2, 0 +_0807DF94: .4byte 0x000003ff +_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 sub_80A1AD4 + ldr r0, _0807DFD8 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x3C + strh r1, [r0] + b _0807E400 + .align 2, 0 +_0807DFD8: .4byte 0x020322a0 +_0807DFDC: + ldr r4, _0807E000 + 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 + .align 2, 0 +_0807E000: .4byte 0x02037fd4 +_0807E004: + ldr r2, _0807E01C + 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 + .align 2, 0 +_0807E01C: .4byte 0x02037fd4 +_0807E020: + movs r1, 0xA2 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _0807E03C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807E038 + b _0807E400 +_0807E038: + b _0807E394 + .align 2, 0 +_0807E03C: .4byte 0x02037fd4 +_0807E040: + ldr r0, _0807E0D4 + movs r2, 0x8 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r5, _0807E0D8 + ldr r1, [r5] + adds r1, 0xD3 + movs r6, 0 + strb r0, [r1] + ldr r4, _0807E0DC + 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, _0807E0E0 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl obj_anim_image_start + 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 sub_8008258 + 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, _0807E0E4 + 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 + .align 2, 0 +_0807E0D4: .4byte 0x08338d28 +_0807E0D8: .4byte 0x020322a0 +_0807E0DC: .4byte 0x02020630 +_0807E0E0: .4byte sub_807E6AC + 1 +_0807E0E4: .4byte 0x0000ffff +_0807E0E8: + ldr r2, _0807E114 + 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, _0807E118 + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, [r7] + b _0807E398 + .align 2, 0 +_0807E114: .4byte 0x02020630 +_0807E118: .4byte 0x0000ffff +_0807E11C: + ldr r2, _0807E158 + 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, _0807E15C + cmp r1, r0 + beq _0807E13A + b _0807E400 +_0807E13A: + adds r0, r3, 0 + adds r0, 0xF2 + ldrh r2, [r0] + lsls r0, r2, 3 + ldr r1, _0807E160 + adds r0, r1 + ldr r1, _0807E164 + ldr r1, [r1] + ldr r1, [r1, 0x10] + ldr r3, [r3, 0x6C] + bl help_system_enable_unless_flashback__sp199 + ldr r1, [r7] + b _0807E398 + .align 2, 0 +_0807E158: .4byte 0x02020630 +_0807E15C: .4byte nullsub_12 + 1 +_0807E160: .4byte 0x0830a18c +_0807E164: .4byte 0x020244d4 +_0807E168: + ldr r4, _0807E21C + 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, _0807E220 + 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 obj_anim_image_start + 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, _0807E224 + 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 obj_delete_and_free_tiles + ldr r1, [r7] + b _0807E398 + .align 2, 0 +_0807E21C: .4byte 0x02020630 +_0807E220: .4byte 0x08300d38 +_0807E224: .4byte 0x000fffff +_0807E228: + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r4, _0807E258 + ldr r1, _0807E25C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, _0807E260 + 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 + .align 2, 0 +_0807E258: .4byte 0x02021fc4 +_0807E25C: .4byte 0x085ee966 +_0807E260: .4byte 0x020322a0 +_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, _0807E280 + strh r1, [r0] + str r2, [r3, 0x64] + b _0807E400 + .align 2, 0 +_0807E280: .4byte 0x0000010b +_0807E284: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0807E290 + b _0807E400 +_0807E290: + ldr r0, _0807E29C + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x44 + strh r1, [r0] + b _0807E400 + .align 2, 0 +_0807E29C: .4byte 0x020322a0 +_0807E2A0: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bne _0807E2B2 + ldr r0, _0807E2E0 + 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, _0807E2E4 + ldr r1, _0807E2E8 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, [r7] + str r5, [r0, 0x64] + b _0807E400 + .align 2, 0 +_0807E2E0: .4byte 0x00000173 +_0807E2E4: .4byte 0x02021fc4 +_0807E2E8: .4byte 0x085ee977 +_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, _0807E324 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807E400 + adds r1, r2, 0 + b _0807E398 + .align 2, 0 +_0807E324: .4byte 0x030022c0 +_0807E328: + ldr r0, _0807E36C + ldrb r0, [r0] + movs r1, 0 + bl sub_807B4D0 + ldr r1, _0807E370 + ldr r0, _0807E374 + str r0, [r1] + ldr r7, _0807E378 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0807E37C + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl sub_806D098 + 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, _0807E380 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807E394 + .align 2, 0 +_0807E36C: .4byte 0x020375e2 +_0807E370: .4byte 0x030061e8 +_0807E374: .4byte sub_807B60C + 1 +_0807E378: .4byte 0x02032298 +_0807E37C: .4byte 0x020244ec +_0807E380: .4byte 0x020322a0 +_0807E384: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_0807E390: + bl sub_80A1AD4 +_0807E394: + ldr r0, _0807E3A4 + ldr r1, [r0] +_0807E398: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0807E400 + .align 2, 0 +_0807E3A4: .4byte 0x020322a0 +_0807E3A8: + ldr r0, _0807E40C + 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 Window_FreeMemory + movs r0, 0x3 + bl bg_get_tilemap + bl free + movs r0, 0x1 + bl bg_get_tilemap + bl free + movs r0, 0 + bl bg_get_tilemap + bl free + bl sub_805F094 + ldr r0, [r7] + bl free + str r4, [r7] +_0807E3F6: + ldr r0, _0807E410 + bl set_callback2 + bl sub_807E784 +_0807E400: + movs r0, 0 +_0807E402: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807E40C: .4byte 0x02037fd4 +_0807E410: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_807CFC8 + + thumb_func_start c2_08053788 +c2_08053788: @ 807E414 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0807E430 + 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 + .align 2, 0 +_0807E430: .4byte 0x030022c0 +_0807E434: + movs r0, 0x4 + strb r0, [r1] + ldr r1, _0807E440 + movs r0, 0x1 + b _0807E4B2 + .align 2, 0 +_0807E440: .4byte 0x03002700 +_0807E444: + ldr r0, _0807E480 + ldr r1, _0807E484 + mov r8, r1 + str r1, [r0] + ldr r7, _0807E488 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0807E48C + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl sub_806D098 + 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, _0807E490 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807E4AE + .align 2, 0 +_0807E480: .4byte 0x030061e8 +_0807E484: .4byte sub_807EB50 + 1 +_0807E488: .4byte 0x02032298 +_0807E48C: .4byte 0x020244ec +_0807E490: .4byte 0x020322a0 +_0807E494: + bl sub_8077260 + cmp r0, 0 + beq _0807E4A8 + ldr r0, _0807E4A4 + bl set_callback2 + b _0807E4AE + .align 2, 0 +_0807E4A4: .4byte sub_807F464 + 1 +_0807E4A8: + mov r0, r8 + bl set_callback2 +_0807E4AE: + ldr r1, _0807E4D8 + movs r0, 0xFF +_0807E4B2: + strb r0, [r1] +_0807E4B4: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807E4C2 + bl run_active_tasks +_0807E4C2: + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E4D8: .4byte 0x02032298 + 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, _0807E548 + ldrh r1, [r4] + ldr r0, _0807E54C + cmp r1, r0 + bne _0807E504 + ldr r0, _0807E550 + bl set_callback2 +_0807E504: + ldrh r1, [r4] + ldr r0, _0807E554 + cmp r1, r0 + bne _0807E514 + ldr r0, _0807E558 + 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, _0807E548 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _0807E554 + cmp r1, r0 + bne _0807E53C + ldr r0, _0807E558 + 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 + .align 2, 0 +_0807E548: .4byte 0x020223c4 +_0807E54C: .4byte 0x0000dcba +_0807E550: .4byte c2_08053788 + 1 +_0807E554: .4byte 0x0000abcd +_0807E558: .4byte 0x020322a0 + 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, _0807E5D4 + str r0, [r5, 0x1C] +_0807E5CE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807E5D4: .4byte nullsub_12 + 1 + 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, _0807E640 + 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, _0807E644 + 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, _0807E648 + str r2, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0807E636: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807E640: .4byte 0x08339024 +_0807E644: .4byte sub_807E64C + 1 +_0807E648: .4byte 0x0000ffff + 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 sub_8008258 +_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, _0807E6A4 + 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 obj_delete_and_free_tiles + ldr r0, _0807E6A8 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0xE + strh r1, [r0] +_0807E69E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807E6A4: .4byte 0x08339024 +_0807E6A8: .4byte 0x020322a0 + 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, _0807E734 + 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, _0807E738 + str r0, [r4, 0x1C] +_0807E72C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807E734: .4byte 0x08339024 +_0807E738: .4byte nullsub_12 + 1 + thumb_func_end sub_807E6AC + + thumb_func_start sub_807E73C +sub_807E73C: @ 807E73C + push {r4-r6,lr} + ldr r0, _0807E770 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, _0807E774 + adds r4, r0 + ldr r0, _0807E778 + ldrh r1, [r4, 0x38] + movs r6, 0xB + muls r1, r6 + ldr r5, _0807E77C + adds r1, r5 + bl gf_strcpy + ldr r0, _0807E780 + ldrh r1, [r4, 0xC] + muls r1, r6 + adds r1, r5 + bl gf_strcpy + ldrh r0, [r4, 0x38] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0807E770: .4byte 0x020375e0 +_0807E774: .4byte 0x08338ed0 +_0807E778: .4byte 0x02021cc4 +_0807E77C: .4byte 0x083185c8 +_0807E780: .4byte 0x02021dc4 + thumb_func_end sub_807E73C + + thumb_func_start sub_807E784 +sub_807E784: @ 807E784 + push {r4,lr} + sub sp, 0x20 + ldr r0, _0807E7CC + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, _0807E7D0 + adds r4, r0 + ldr r0, _0807E7D4 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0807E7D8 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _0807E7DC + mov r1, sp + bl strcpy_limit_10_chars + ldr r0, _0807E7E0 + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, _0807E7E4 + adds r1, r2 + bl gf_strcpy + add sp, 0x20 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807E7CC: .4byte 0x020375e0 +_0807E7D0: .4byte 0x08338ed0 +_0807E7D4: .4byte 0x020375e2 +_0807E7D8: .4byte 0x020244ec +_0807E7DC: .4byte 0x02021cc4 +_0807E7E0: .4byte 0x02021dc4 +_0807E7E4: .4byte 0x083185c8 + 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, _0807E944 + adds r5, r2, r1 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0807E948 + 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, _0807E94C + 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, _0807E950 + 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 + .align 2, 0 +_0807E944: .4byte 0x08338ed0 +_0807E948: .4byte 0x020244ec +_0807E94C: .4byte 0x02024744 +_0807E950: .4byte 0x020321c0 +_0807E954: + adds r2, r5, 0 + adds r2, 0x28 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_setattr +_0807E960: + ldr r0, _0807E970 + bl pokemon_calc_effective_stats + add sp, 0x38 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E970: .4byte 0x02024744 + 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, _0807E9D0 + 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 gf_strcpy + 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 + .align 2, 0 +_0807E9D0: .4byte 0x08338fc0 + thumb_func_end sub_807E974 + + thumb_func_start sub_807E9D4 +sub_807E9D4: @ 807E9D4 + push {r4-r6,lr} + ldr r6, _0807EA00 + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0807EA04 + 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 + .align 2, 0 +_0807EA00: .4byte 0x020375e2 +_0807EA04: .4byte 0x020244ec +_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, _0807EA24 + ldrb r0, [r0] + ldr r1, _0807EA28 + ldrb r1, [r1] + bl sub_807E7E8 + pop {r0} + bx r0 + .align 2, 0 +_0807EA24: .4byte 0x020375e2 +_0807EA28: .4byte 0x020375e0 + 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, _0807EAB8 + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0807EABC + adds r0, r4 + bl obj_delete_and_free_tiles + 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, _0807EAC0 + 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, _0807EAC4 + strh r1, [r2] + adds r0, 0x93 + strb r6, [r0] +_0807EA90: + ldr r0, _0807EAC8 + bl set_callback2 +_0807EA96: + bl sub_807B5B8 + bl sub_807E4DC + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807EAB8: .4byte 0x020322a0 +_0807EABC: .4byte 0x02020630 +_0807EAC0: .4byte 0x02032298 +_0807EAC4: .4byte 0x0000abcd +_0807EAC8: .4byte sub_807EACC + 1 + 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, _0807EAE8 + bl set_callback2 + b _0807EB2C + .align 2, 0 +_0807EAE8: .4byte c2_08053788 + 1 +_0807EAEC: + bl sub_807E4DC + cmp r4, 0 + bne _0807EB2C + ldr r4, _0807EB44 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x72 + ldrh r1, [r0] + ldr r0, _0807EB48 + cmp r1, r0 + bne _0807EB2C + adds r1, r2, 0 + adds r1, 0x74 + ldr r0, _0807EB4C + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807EB44: .4byte 0x020322a0 +_0807EB48: .4byte 0x00000101 +_0807EB4C: .4byte 0x0000dcba + thumb_func_end sub_807EACC + + thumb_func_start sub_807EB50 +sub_807EB50: @ 807EB50 + push {r4,lr} + sub sp, 0x4 + ldr r1, _0807EB70 + 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, _0807EB74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807EB70: .4byte 0x030022c0 +_0807EB74: .4byte _0807EB78 + .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, _0807ED24 + ldr r1, _0807ED28 + b _0807EDA6 + .align 2, 0 +_0807ED24: .4byte 0x02021fc4 +_0807ED28: .4byte 0x085ef6d2 +_0807ED2C: + movs r0, 0 + bl sub_8077288 + ldr r0, _0807ED40 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x64 + b _0807EE88 + .align 2, 0 +_0807ED40: .4byte 0x030022c0 +_0807ED44: + ldr r0, _0807ED74 + 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, _0807ED78 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + b _0807ED8E + .align 2, 0 +_0807ED74: .4byte 0x020322a0 +_0807ED78: .4byte 0x030022c0 +_0807ED7C: + bl sub_8077294 + cmp r0, 0 + bne _0807ED86 + b _0807F03A +_0807ED86: + ldr r0, _0807ED94 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 +_0807ED8E: + movs r1, 0x2 + strb r1, [r0] + b _0807F03A + .align 2, 0 +_0807ED94: .4byte 0x030022c0 +_0807ED98: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x32 + strb r0, [r1] + ldr r4, _0807EDB8 + ldr r1, _0807EDBC +_0807EDA6: + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + b _0807F03A + .align 2, 0 +_0807EDB8: .4byte 0x02021fc4 +_0807EDBC: .4byte 0x082c8959 +_0807EDC0: + bl in_trade_center + cmp r0, 0 + bne _0807EDCE + movs r0, 0x15 + bl sav12_xor_increment +_0807EDCE: + ldr r0, _0807EE10 + ldrb r0, [r0] + cmp r0, 0 + beq _0807EDF6 + ldr r4, _0807EE14 + 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, _0807EE18 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + b _0807EE8A + .align 2, 0 +_0807EE10: .4byte 0x030030fc +_0807EE14: .4byte 0x020229e8 +_0807EE18: .4byte 0x030022c0 +_0807EE1C: + ldr r0, _0807EE34 + 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 + .align 2, 0 +_0807EE34: .4byte 0x020322a0 +_0807EE38: + bl sub_81533AC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0807EE5C + bl sav2_gender2_inplace_and_xFE + ldr r0, _0807EE58 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0807F03A + .align 2, 0 +_0807EE58: .4byte 0x030022c0 +_0807EE5C: + ldr r0, _0807EE70 + ldr r0, [r0] + str r1, [r0, 0x64] + ldr r0, _0807EE74 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x33 + strb r1, [r0] + b _0807F03A + .align 2, 0 +_0807EE70: .4byte 0x020322a0 +_0807EE74: .4byte 0x030022c0 +_0807EE78: + bl sub_81533E0 + ldr r0, _0807EE94 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x28 +_0807EE88: + strb r1, [r0] +_0807EE8A: + ldr r0, _0807EE98 + ldr r0, [r0] + str r2, [r0, 0x64] + b _0807F03A + .align 2, 0 +_0807EE94: .4byte 0x030022c0 +_0807EE98: .4byte 0x020322a0 +_0807EE9C: + ldr r4, _0807EED0 + 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 + .align 2, 0 +_0807EED0: .4byte 0x020322a0 +_0807EED4: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0807EEDA: + ldr r0, _0807EEE8 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x29 + strb r1, [r0] + b _0807F03A + .align 2, 0 +_0807EEE8: .4byte 0x030022c0 +_0807EEEC: + ldr r0, _0807EF0C + ldr r1, [r0] + ldr r0, [r1, 0x64] + cmp r0, 0 + bne _0807EF14 + movs r0, 0x1 + bl sub_8077288 + ldr r0, _0807EF10 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2A + strb r1, [r0] + b _0807F03A + .align 2, 0 +_0807EF0C: .4byte 0x020322a0 +_0807EF10: .4byte 0x030022c0 +_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, _0807EF38 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x5 + strb r1, [r0] + b _0807F03A + .align 2, 0 +_0807EF38: .4byte 0x030022c0 +_0807EF3C: + ldr r0, _0807EF60 + 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 + .align 2, 0 +_0807EF60: .4byte 0x020322a0 +_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 sub_80A1AD4 + b _0807EFDC +_0807EF7E: + ldr r0, _0807EF9C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F03A + movs r0, 0x3 + bl play_sound_effect + ldr r1, _0807EFA0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0807EFE4 + .align 2, 0 +_0807EF9C: .4byte 0x02037fd4 +_0807EFA0: .4byte 0x030022c0 +_0807EFA4: + bl sub_80A3258 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807F03A + ldr r0, _0807EFCC + ldrb r0, [r0] + cmp r0, 0 + beq _0807EFD8 + ldr r0, _0807EFD0 + ldr r1, [r0, 0x8] + ldr r0, _0807EFD4 + cmp r1, r0 + bne _0807EFD8 + movs r0, 0x3 + bl sub_8077288 + b _0807EFDC + .align 2, 0 +_0807EFCC: .4byte 0x030030fc +_0807EFD0: .4byte 0x030022c0 +_0807EFD4: .4byte sub_80773AC + 1 +_0807EFD8: + bl sub_800AC34 +_0807EFDC: + ldr r1, _0807EFEC + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0807EFE4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807F03A + .align 2, 0 +_0807EFEC: .4byte 0x030022c0 +_0807EFF0: + ldr r0, _0807F018 + ldrb r0, [r0] + cmp r0, 0 + beq _0807F028 + ldr r1, [r2, 0x8] + ldr r0, _0807F01C + cmp r1, r0 + bne _0807F028 + bl sub_8077294 + cmp r0, 0 + beq _0807F03A + ldr r0, _0807F020 + movs r1, 0 + strb r1, [r0] + ldr r0, _0807F024 + bl set_callback2 + b _0807F03A + .align 2, 0 +_0807F018: .4byte 0x030030fc +_0807F01C: .4byte sub_80773AC + 1 +_0807F020: .4byte 0x03002700 +_0807F024: .4byte c2_080543C4 + 1 +_0807F028: + ldr r0, _0807F05C + ldrb r1, [r0] + cmp r1, 0 + bne _0807F03A + ldr r0, _0807F060 + strb r1, [r0] + ldr r0, _0807F064 + bl set_callback2 +_0807F03A: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807F048 + bl run_active_tasks +_0807F048: + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807F05C: .4byte 0x03003124 +_0807F060: .4byte 0x03002700 +_0807F064: .4byte c2_080543C4 + 1 + thumb_func_end sub_807EB50 + + thumb_func_start c2_080543C4 +c2_080543C4: @ 807F068 + push {r4,r5,lr} + ldr r0, _0807F0D4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0807F0BE + bl Window_FreeMemory + movs r0, 0x3 + bl bg_get_tilemap + bl free + movs r0, 0x1 + bl bg_get_tilemap + bl free + movs r0, 0 + bl bg_get_tilemap + bl free + bl sub_805F094 + ldr r4, _0807F0D8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r0, _0807F0DC + ldrb r0, [r0] + cmp r0, 0 + beq _0807F0B6 + bl sub_800E084 +_0807F0B6: + ldr r0, _0807F0E0 + ldr r0, [r0, 0x8] + bl set_callback2 +_0807F0BE: + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807F0D4: .4byte 0x02037fd4 +_0807F0D8: .4byte 0x020322a0 +_0807F0DC: .4byte 0x030030fc +_0807F0E0: .4byte 0x030022c0 + 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, _0807F10C + movs r1, 0xA + bl AddTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0807F10C: .4byte sub_807F110 + 1 + 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, _0807F13C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F134 + ldr r0, _0807F140 + bl set_callback2 + ldr r1, _0807F144 + ldr r0, _0807F148 + str r0, [r1] + adds r0, r4, 0 + bl remove_task +_0807F134: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807F13C: .4byte 0x02037fd4 +_0807F140: .4byte sub_807B270 + 1 +_0807F144: .4byte 0x03005dac +_0807F148: .4byte sub_80AF168 + 1 + 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, _0807F190 + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0807F194 + 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, _0807F198 + bl flag_set +_0807F18A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807F190: .4byte 0x02032298 +_0807F194: .4byte 0x02024744 +_0807F198: .4byte 0x0000089b + 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 Window_FastFillPixels + ldr r2, _0807F20C + 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 sub_8199EEC + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807F20C: .4byte 0x020322a0 + 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, _0807F248 + adds r4, r0, r1 + ldr r1, _0807F24C + 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, _0807F250 + adds r0, r1 + b _0807F25E + .align 2, 0 +_0807F248: .4byte 0x03005e08 +_0807F24C: .4byte 0x08339090 +_0807F250: .4byte 0x08337aa0 +_0807F254: + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _0807F26C +_0807F25C: + ldr r0, _0807F268 +_0807F25E: + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + b _0807F27A + .align 2, 0 +_0807F268: .4byte 0x08337ea0 +_0807F26C: + lsls r0, r2, 1 + ldr r1, _0807F2D0 + adds r0, r1 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply +_0807F27A: + ldr r0, _0807F2D4 + 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, _0807F2D4 + 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 + .align 2, 0 +_0807F2D0: .4byte 0x08337ca0 +_0807F2D4: .4byte 0x08339090 +_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, _0807F394 + adds r5, r0, r1 + movs r0, 0 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _0807F336 + ldr r2, _0807F398 + 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 lcd_io_set_bits + movs r0, 0x4A + movs r1, 0x10 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x13 + bl lcd_io_set +_0807F336: + ldr r4, _0807F398 + 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 lcd_io_set + 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 lcd_io_set + 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 + .align 2, 0 +_0807F394: .4byte 0x03005e08 +_0807F398: .4byte 0x020322a0 + 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, _0807F440 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0807F3D8 + ldr r2, _0807F444 + 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 lcd_io_set + movs r0, 0x48 + movs r1, 0x13 + bl lcd_io_set +_0807F3D8: + ldr r4, _0807F444 + 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 lcd_io_set + 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 lcd_io_set + 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, _0807F448 + movs r0, 0x8 + movs r1, 0 + bl sub_80A2A20 + b _0807F45C + .align 2, 0 +_0807F440: .4byte 0x03005e08 +_0807F444: .4byte 0x020322a0 +_0807F448: .4byte 0x0000ffff +_0807F44C: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + 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, _0807F484 + 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, _0807F488 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807F484: .4byte 0x030022c0 +_0807F488: .4byte _0807F48C + .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, _0807F4E0 + ldr r1, _0807F4E4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + b _0807F70C + .align 2, 0 +_0807F4E0: .4byte 0x02021fc4 +_0807F4E4: .4byte 0x085ef6d2 +_0807F4E8: + movs r0, 0 + bl sub_8077288 + ldr r0, _0807F4FC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + b _0807F5BC + .align 2, 0 +_0807F4FC: .4byte 0x030022c0 +_0807F500: + bl sub_8077294 + cmp r0, 0 + bne _0807F50A + b _0807F70C +_0807F50A: + ldr r0, _0807F540 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r5, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r4, _0807F544 + ldr r1, _0807F548 + adds r0, r4, 0 + bl ExpandTextCodes + 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, _0807F54C + ldr r0, [r0] + str r5, [r0, 0x64] + b _0807F70C + .align 2, 0 +_0807F540: .4byte 0x030022c0 +_0807F544: .4byte 0x02021fc4 +_0807F548: .4byte 0x082c8959 +_0807F54C: .4byte 0x020322a0 +_0807F550: + ldr r0, _0807F56C + 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 + .align 2, 0 +_0807F56C: .4byte 0x020322a0 +_0807F570: + bl sub_81533AC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0807F590 + ldr r0, _0807F58C + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F58C: .4byte 0x030022c0 +_0807F590: + ldr r0, _0807F5A4 + ldr r0, [r0] + str r1, [r0, 0x64] + ldr r0, _0807F5A8 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F5A4: .4byte 0x020322a0 +_0807F5A8: .4byte 0x030022c0 +_0807F5AC: + bl sub_81533E0 + ldr r0, _0807F5C8 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x6 +_0807F5BC: + strb r1, [r0] + ldr r0, _0807F5CC + ldr r0, [r0] + str r2, [r0, 0x64] + b _0807F70C + .align 2, 0 +_0807F5C8: .4byte 0x030022c0 +_0807F5CC: .4byte 0x020322a0 +_0807F5D0: + ldr r4, _0807F604 + 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 + .align 2, 0 +_0807F604: .4byte 0x020322a0 +_0807F608: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0807F60E: + ldr r0, _0807F61C + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x7 + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F61C: .4byte 0x030022c0 +_0807F620: + ldr r0, _0807F640 + ldr r1, [r0] + ldr r0, [r1, 0x64] + cmp r0, 0 + bne _0807F648 + movs r0, 0x1 + bl sub_8077288 + ldr r0, _0807F644 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F640: .4byte 0x020322a0 +_0807F644: .4byte 0x030022c0 +_0807F648: + subs r0, 0x1 + str r0, [r1, 0x64] + b _0807F70C +_0807F64E: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + bl sub_8153408 + ldr r0, _0807F668 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x9 + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F668: .4byte 0x030022c0 +_0807F66C: + ldr r0, _0807F690 + 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 + .align 2, 0 +_0807F690: .4byte 0x020322a0 +_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 sub_80A1AD4 + ldr r0, _0807F6C0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0xB + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F6C0: .4byte 0x030022c0 +_0807F6C4: + ldr r0, _0807F6F0 + 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, _0807F6F4 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0xC + strb r1, [r0] + b _0807F70C + .align 2, 0 +_0807F6F0: .4byte 0x02037fd4 +_0807F6F4: .4byte 0x030022c0 +_0807F6F8: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + ldr r0, _0807F730 + movs r1, 0 + strb r1, [r0] + ldr r0, _0807F734 + bl set_callback2 +_0807F70C: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807F71A + bl run_active_tasks +_0807F71A: + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807F730: .4byte 0x03002700 +_0807F734: .4byte c2_080543C4 + 1 + thumb_func_end sub_807F464 + + thumb_func_start sub_807F738 +sub_807F738: @ 807F738 + push {lr} + ldr r0, _0807F758 + ldr r1, _0807F75C + ldr r2, _0807F760 + 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 + .align 2, 0 +_0807F758: .4byte 0x03007630 +_0807F75C: .4byte 0x0000ffff +_0807F760: .4byte 0x020322a4 + thumb_func_end sub_807F738 + + thumb_func_start sub_807F764 +sub_807F764: @ 807F764 + push {r4,lr} + sub sp, 0x10 + bl sub_8082DF4 + ldr r0, _0807F7D4 + 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 call_gpu_bg_affine_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807F7D4: .4byte 0x020322a4 + thumb_func_end sub_807F764 + + thumb_func_start sub_807F7D8 +sub_807F7D8: @ 807F7D8 + push {r4,r5,lr} + ldr r1, _0807F7F4 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x9 + bls _0807F7E8 + b _0807F9C8 +_0807F7E8: + lsls r0, 2 + ldr r1, _0807F7F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807F7F4: .4byte 0x020322a4 +_0807F7F8: .4byte _0807F7FC + .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, _0807F848 + adds r0, r5, 0 + bl sub_8034974 + adds r0, 0x64 + bl malloc_and_clear + adds r1, r0, 0 + ldr r4, _0807F84C + ldr r0, [r4] + ldr r2, _0807F850 + adds r0, r2 + str r1, [r0] + adds r0, r5, 0 + bl call_LZZUnCompWram + ldr r1, [r4] + b _0807F966 + .align 2, 0 +_0807F848: .4byte 0x08d91598 +_0807F84C: .4byte 0x020322a4 +_0807F850: .4byte 0x000011bc +_0807F854: + ldr r1, _0807F878 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0807F87C + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + b _0807F962 + .align 2, 0 +_0807F878: .4byte 0x083390f4 +_0807F87C: .4byte 0x083390d4 +_0807F880: + ldr r0, [r5] + ldr r1, _0807F8A4 + adds r0, r1 + ldr r4, [r0] + ldr r0, _0807F8A8 + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x2 + adds r1, r4, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, [r5] + b _0807F966 + .align 2, 0 +_0807F8A4: .4byte 0x000011bc +_0807F8A8: .4byte 0x08d91598 +_0807F8AC: + ldr r0, _0807F8C0 + ldr r1, [r5] + ldr r2, _0807F8C4 + adds r1, r2 + ldr r1, [r1] + bl call_LZZUnCompWram + ldr r1, [r5] + b _0807F966 + .align 2, 0 +_0807F8C0: .4byte 0x08d91db8 +_0807F8C4: .4byte 0x000011bc +_0807F8C8: + ldr r0, [r5] + ldr r1, _0807F8EC + adds r0, r1 + ldr r4, [r0] + ldr r0, _0807F8F0 + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r4, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, [r5] + b _0807F966 + .align 2, 0 +_0807F8EC: .4byte 0x000011bc +_0807F8F0: .4byte 0x08d91db8 +_0807F8F4: + ldr r0, _0807F908 + ldr r1, [r5] + ldr r2, _0807F90C + adds r1, r2 + ldr r1, [r1] + bl call_LZZUnCompWram + ldr r1, [r5] + b _0807F966 + .align 2, 0 +_0807F908: .4byte 0x08d927ec +_0807F90C: .4byte 0x000011bc +_0807F910: + ldr r0, [r5] + ldr r1, _0807F938 + adds r0, r1 + ldr r4, [r0] + ldr r0, _0807F93C + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r4, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, [r5] + b _0807F966 + .align 2, 0 +_0807F938: .4byte 0x000011bc +_0807F93C: .4byte 0x08d927ec +_0807F940: + ldr r0, _0807F94C + movs r1, 0x80 + movs r2, 0x20 + bl gpu_pal_apply + b _0807F962 + .align 2, 0 +_0807F94C: .4byte 0x083394f4 +_0807F950: + ldr r0, _0807F970 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807F974 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807F978 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram +_0807F962: + ldr r0, _0807F97C + ldr r1, [r0] +_0807F966: + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _0807F9C8 + .align 2, 0 +_0807F970: .4byte 0x08339ac0 +_0807F974: .4byte 0x08339bd8 +_0807F978: .4byte 0x08339b38 +_0807F97C: .4byte 0x020322a4 +_0807F980: + ldr r0, _0807F9B0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807F9B4 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0807F9B8 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _0807F9BC + bl gpu_pal_obj_alloc_tag_and_apply + ldr r4, _0807F9C0 + ldr r0, [r4] + ldr r2, _0807F9C4 + adds r0, r2 + ldr r0, [r0] + bl free + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _0807F9CA + .align 2, 0 +_0807F9B0: .4byte 0x08339c24 +_0807F9B4: .4byte 0x08339c58 +_0807F9B8: .4byte 0x08339ad0 +_0807F9BC: .4byte 0x08339ac8 +_0807F9C0: .4byte 0x020322a4 +_0807F9C4: .4byte 0x000011bc +_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 bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set_bits + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + 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, _0807FA7C + bl Window_InitFromTemplates + lsls r0, 16 + cmp r0, 0 + beq _0807FA74 + bl TextBox_ResetSomeField + movs r4, 0 +_0807FA4A: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + 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 bg_fill_tilemap_rect + movs r0, 0xE0 + bl sub_81978B0 +_0807FA74: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807FA7C: .4byte 0x08339980 + thumb_func_end sub_807FA34 + + thumb_func_start sub_807FA80 +sub_807FA80: @ 807FA80 + push {r4,lr} + ldr r4, _0807FABC + ldr r0, [r4] + cmp r0, 0 + bne _0807FA94 + movs r0, 0x8F + lsls r0, 5 + bl malloc_and_clear + 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, _0807FAC0 + ldrb r0, [r0] + bl sub_807FE54 + ldr r0, _0807FAC4 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807FABC: .4byte 0x020322a4 +_0807FAC0: .4byte 0x020375e0 +_0807FAC4: .4byte sub_807FAC8 + 1 + thumb_func_end sub_807FA80 + + thumb_func_start sub_807FAC8 +sub_807FAC8: @ 807FAC8 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, _0807FAE4 + ldr r0, [r1] + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x6 + bls _0807FADA + b _0807FCE2 +_0807FADA: + lsls r0, 2 + ldr r1, _0807FAE8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807FAE4: .4byte 0x020322a4 +_0807FAE8: .4byte _0807FAEC + .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 lcd_io_set + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0807FBA0 + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _0807FBA4 + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _0807FBA8 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + 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 + .align 2, 0 +_0807FBA0: .4byte 0x08339974 +_0807FBA4: .4byte 0x020322a4 +_0807FBA8: .4byte 0x000009b8 +_0807FBAC: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _0807FBB8 + b _0807FCE2 +_0807FBB8: + movs r4, 0 + ldr r5, _0807FC1C + ldr r6, _0807FC20 +_0807FBBE: + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldr r0, _0807FC24 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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, _0807FC28 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0807FBBE + ldr r0, _0807FC2C + ldrb r0, [r0] + cmp r0, 0 + beq _0807FC14 + ldr r0, _0807FC30 + ldrb r0, [r0] + cmp r0, 0 + beq _0807FC14 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0807FC14: + ldr r0, _0807FC34 + bl SetVBlankCallback + b _0807FCA0 + .align 2, 0 +_0807FC1C: .4byte 0x083399c8 +_0807FC20: .4byte 0x020322a4 +_0807FC24: .4byte 0x08339ad8 +_0807FC28: .4byte 0x02020630 +_0807FC2C: .4byte 0x03003124 +_0807FC30: .4byte 0x030030fc +_0807FC34: .4byte sub_807F764 + 1 +_0807FC38: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + bl sub_8082D28 + b _0807FCA0 +_0807FC4E: + bl sub_807F9D0 + ldr r0, _0807FC60 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807FCE2 + b _0807FCA0 + .align 2, 0 +_0807FC60: .4byte 0x02037fd4 +_0807FC64: + ldr r4, [r6] + ldr r0, _0807FC88 + adds r4, r0 + ldr r5, _0807FC8C + 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 + .align 2, 0 +_0807FC88: .4byte 0x000011b8 +_0807FC8C: .4byte 0x0833973a +_0807FC90: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0807FCA0: + ldr r0, _0807FCAC + ldr r1, [r0] +_0807FCA4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807FCE2 + .align 2, 0 +_0807FCAC: .4byte 0x020322a4 +_0807FCB0: + ldr r0, _0807FCFC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807FCE2 + bl Window_FreeMemory + movs r0, 0x2 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0 + bl SetVBlankCallback + ldr r0, _0807FD00 + bl sub_81AABF0 + ldr r0, _0807FD04 + ldr r0, [r0] + strb r4, [r0] +_0807FCE2: + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807FCFC: .4byte 0x02037fd4 +_0807FD00: .4byte sub_807FFA4 + 1 +_0807FD04: .4byte 0x020322a4 + 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 obj_delete_and_free_tiles + 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, _0807FD8C + str r1, [r0, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807FD8C: .4byte sub_807FD08 + 1 + 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, _0807FE0C + add r8, r0 + ldr r5, _0807FE10 + 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 + .align 2, 0 +_0807FE0C: .4byte 0x02020630 +_0807FE10: .4byte 0x08339c78 + 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 sub_80E167C + adds r4, r0, 0 + strh r5, [r6] + adds r0, r6, 0x2 + adds r1, r4, 0 + bl gf_strcpy + 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, _0807FE78 + strb r5, [r0] + b _0807FF88 + .align 2, 0 +_0807FE78: .4byte 0x03005d98 +_0807FE7C: + ldr r0, _0807FEB4 + strb r5, [r0] + ldr r0, _0807FEB8 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x2 + strb r1, [r0] + ldr r4, _0807FEBC + ldr r0, _0807FEC0 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0xD0 + lsls r0, 2 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _0807FEC8 + adds r0, r4, 0 + adds r0, 0x1C + ldr r1, _0807FEC4 + ldr r1, [r1, 0xC] + bl gf_strcpy + b _0807FED4 + .align 2, 0 +_0807FEB4: .4byte 0x03005d98 +_0807FEB8: .4byte 0x020322a4 +_0807FEBC: .4byte 0x020229f0 +_0807FEC0: .4byte 0x03005d90 +_0807FEC4: .4byte 0x083397d0 +_0807FEC8: + adds r0, r4, 0 + adds r0, 0x1C + ldr r1, _0807FEE0 + ldr r1, [r1] + bl gf_strcpy +_0807FED4: + ldr r1, _0807FEE4 + movs r0, 0x2 + strh r0, [r1, 0x1A] + strh r0, [r1, 0x36] + b _0807FF88 + .align 2, 0 +_0807FEE0: .4byte 0x083397d0 +_0807FEE4: .4byte 0x020229e8 +_0807FEE8: + ldr r0, _0807FF28 + strb r5, [r0] + ldr r0, _0807FF2C + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x3 + strb r1, [r0] + ldr r6, _0807FF30 + ldr r0, _0807FF34 + ldr r1, [r0] + adds r0, r6, 0 + bl gf_strcpy + adds r0, r6, 0 + adds r0, 0x1C + ldr r4, _0807FF38 + ldr r1, [r4, 0x10] + bl gf_strcpy + adds r0, r6, 0 + adds r0, 0x38 + ldr r1, [r4, 0x8] + bl gf_strcpy + adds r0, r6, 0 + subs r0, 0x8 + strh r5, [r0, 0x1A] + strh r5, [r0, 0x36] + adds r0, 0x52 + strh r5, [r0] + b _0807FF88 + .align 2, 0 +_0807FF28: .4byte 0x03005d98 +_0807FF2C: .4byte 0x020322a4 +_0807FF30: .4byte 0x020229f0 +_0807FF34: .4byte 0x03005d90 +_0807FF38: .4byte 0x083397d0 +_0807FF3C: + ldr r0, _0807FF90 + strb r5, [r0] + ldr r0, _0807FF94 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x4 + strb r1, [r0] + ldr r5, _0807FF98 + ldr r0, _0807FF9C + ldr r1, [r0] + adds r0, r5, 0 + bl gf_strcpy + adds r0, r5, 0 + adds r0, 0x1C + ldr r4, _0807FFA0 + ldr r1, [r4, 0x14] + bl gf_strcpy + adds r0, r5, 0 + adds r0, 0x38 + ldr r1, [r4, 0x4] + bl gf_strcpy + adds r0, r5, 0 + adds r0, 0x54 + ldr r1, [r4, 0x8] + bl gf_strcpy + 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 + .align 2, 0 +_0807FF90: .4byte 0x03005d98 +_0807FF94: .4byte 0x020322a4 +_0807FF98: .4byte 0x020229f0 +_0807FF9C: .4byte 0x03005d90 +_0807FFA0: .4byte 0x083397d0 + thumb_func_end sub_807FE54 + + thumb_func_start sub_807FFA4 +sub_807FFA4: @ 807FFA4 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0 + bl lcd_io_set + ldr r4, _0807FFFC + ldr r0, [r4] + cmp r0, 0 + bne _0807FFC0 + movs r0, 0x8F + lsls r0, 5 + bl malloc_and_clear + 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, _08080000 + 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, _08080004 + bl set_callback2 + b _0808000E + .align 2, 0 +_0807FFFC: .4byte 0x020322a4 +_08080000: .4byte 0x020375e0 +_08080004: .4byte sub_8080018 + 1 +_08080008: + ldr r0, _08080014 + bl set_callback2 +_0808000E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08080014: .4byte sub_80808D4 + 1 + thumb_func_end sub_807FFA4 + + thumb_func_start sub_8080018 +sub_8080018: @ 8080018 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _08080034 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x15 + bls _0808002A + b _08080546 +_0808002A: + lsls r0, 2 + ldr r1, _08080038 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08080034: .4byte 0x020322a4 +_08080038: .4byte _0808003C + .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, _080800F4 + ldr r2, _080800F8 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, _080800FC + 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, _080800FC + 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 + .align 2, 0 +_080800F4: .4byte 0x020229c6 +_080800F8: .4byte 0x00004422 +_080800FC: .4byte 0x020322a4 +_08080100: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _0808010C + b _08080546 +_0808010C: + ldr r0, _0808011C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_8082D28 + b _08080546 + .align 2, 0 +_0808011C: .4byte 0x020322a4 +_08080120: + movs r5, 0 + ldr r4, _08080184 + ldr r6, _08080188 +_08080126: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, _0808018C + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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, _08080190 + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08080126 + ldr r0, _08080194 + ldrb r0, [r0] + cmp r0, 0 + bne _0808016A + b _080804F8 +_0808016A: + ldr r0, _08080198 + 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 + .align 2, 0 +_08080184: .4byte 0x083399c8 +_08080188: .4byte 0x020322a4 +_0808018C: .4byte 0x08339ad8 +_08080190: .4byte 0x02020630 +_08080194: .4byte 0x03003124 +_08080198: .4byte 0x030030fc +_0808019C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _080804F8 +_080801AE: + bl sub_807F9D0 + ldr r0, _080801C4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080801C0 + b _08080546 +_080801C0: + b _080804F8 + .align 2, 0 +_080801C4: .4byte 0x02037fd4 +_080801C8: + ldr r4, _080801EC + ldr r0, [r4] + ldr r3, _080801F0 + adds r0, r3 + ldr r1, _080801F4 + 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 + .align 2, 0 +_080801EC: .4byte 0x020322a4 +_080801F0: .4byte 0x000011b8 +_080801F4: .4byte 0x0833981a +_080801F8: + ldr r4, _0808023C + 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, _08080240 + ldrh r1, [r1] + bl sub_807FE14 + ldr r0, _08080244 + 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 + .align 2, 0 +_0808023C: .4byte 0x020322a4 +_08080240: .4byte 0x0203ce7c +_08080244: .4byte 0x020228c4 +_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, _080802A8 + 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 + .align 2, 0 +_080802A8: .4byte 0x020322a4 +_080802AC: + ldr r0, [r7] + lsls r4, r5, 4 + adds r0, r4, r0 + adds r0, r6 + lsls r1, r5, 8 + ldr r2, _080802E8 + 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 + .align 2, 0 +_080802E8: .4byte 0x020223c4 +_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, _08080354 + 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, _08080358 + 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, _08080354 + 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 + .align 2, 0 +_08080354: .4byte 0x020322a4 +_08080358: .4byte 0x083399d0 +_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, _080803AC + ldr r1, _080803B0 + 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, _080803B4 + adds r1, r3, 0 + ldrh r0, [r0] + adds r1, r0 + adds r2, 0x4A + strh r1, [r2] + b _080803BE + .align 2, 0 +_080803AC: .4byte 0x083399dc +_080803B0: .4byte 0x083399e4 +_080803B4: .4byte 0xffffa800 +_080803B8: + ldrb r0, [r3] + subs r0, 0x1 + strb r0, [r3] +_080803BE: + ldr r0, _080803D0 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] + b _08080546 + .align 2, 0 +_080803D0: .4byte 0x020322a4 +_080803D4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080803E0 + b _08080546 +_080803E0: + ldr r2, _08080404 + 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 gpu_sync_bg_show + b _08080546 + .align 2, 0 +_08080404: .4byte 0x020322a4 +_08080408: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_set_bits + ldr r4, _08080490 + 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 lcd_io_set_bits + 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, _08080494 + ldr r1, _08080498 + 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 + .align 2, 0 +_08080490: .4byte 0x020322a4 +_08080494: .4byte 0x083399dc +_08080498: .4byte 0x083399e4 +_0808049C: + bl sub_8083380 + lsls r0, 24 + cmp r0, 0 + beq _080804BA + ldr r0, _080804CC + 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, _080804CC + ldr r0, [r0] +_080804BE: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + bl sub_8082CB4 + b _08080546 + .align 2, 0 +_080804CC: .4byte 0x020322a4 +_080804D0: + ldr r0, _080804E0 + movs r2, 0x10 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x3 + bl obj_add_from_template_forward_search + b _080804F8 + .align 2, 0 +_080804E0: .4byte 0x08339c2c +_080804E4: + bl sub_800ADF8 + b _080804F8 +_080804EA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08080546 + bl sub_800A418 +_080804F8: + ldr r0, _08080504 + ldr r1, [r0] +_080804FC: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08080546 + .align 2, 0 +_08080504: .4byte 0x020322a4 +_08080508: + ldr r5, _0808057C + 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, _08080580 + bl set_callback2 + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08080584 + 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, _0808057C + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808057C: .4byte 0x020322a4 +_08080580: .4byte sub_8081898 + 1 +_08080584: .4byte 0x00000193 + thumb_func_end sub_8080018 + + thumb_func_start sub_8080588 +sub_8080588: @ 8080588 + push {r4,lr} + movs r0, 0 + movs r1, 0 + bl lcd_io_set + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + ldr r0, _08080614 + bl SetVBlankCallback + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08080618 + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _0808061C + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r3, _08080620 + adds r1, r3 + movs r0, 0x2 + bl bg_set_tilemap + 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 + .align 2, 0 +_08080614: .4byte sub_807F764 + 1 +_08080618: .4byte 0x08339974 +_0808061C: .4byte 0x020322a4 +_08080620: .4byte 0x000009b8 + 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, _08080660 + ldr r0, [r0] + lsrs r1, 23 + adds r0, 0x96 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08080664 + 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 + .align 2, 0 +_08080660: .4byte 0x020322a4 +_08080664: .4byte 0x083399e7 +_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, _08080740 + 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 flag_check + lsls r0, 24 + cmp r0, 0 + bne _0808071A + ldr r0, _08080744 + 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, _08080748 + 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 + .align 2, 0 +_08080740: .4byte 0x08339ca0 +_08080744: .4byte 0x020375e0 +_08080748: .4byte 0x08339cbe + thumb_func_end sub_8080674 + + thumb_func_start sub_808074C +sub_808074C: @ 808074C + push {r4-r7,lr} + movs r4, 0 + ldr r7, _080807B4 + movs r6, 0xFF + ldr r5, _080807B8 +_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, _080807B4 +_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 + .align 2, 0 +_080807B4: .4byte 0x020322a4 +_080807B8: .4byte 0x083399d0 + 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, _08080880 + 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, _08080884 + 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, _08080888 + adds r0, r1 + mov r1, r8 + lsrs r4, r1, 24 + adds r1, r4, 0 + bl obj_anim_image_start + 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, _0808088C + adds r1, r0 + add r0, sp, 0x8 + bl gf_strcpy + movs r0, 0x1 + add r1, sp, 0x8 + movs r2, 0x38 + bl sub_81DB35C + 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 + .align 2, 0 +_08080880: .4byte 0x03003124 +_08080884: .4byte 0x020322a4 +_08080888: .4byte 0x02020630 +_0808088C: .4byte 0x020229f0 +_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 Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram +_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, _080808F0 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x15 + bls _080808E6 + b _08080DAE +_080808E6: + lsls r0, 2 + ldr r1, _080808F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080808F0: .4byte 0x020322a4 +_080808F4: .4byte _080808F8 + .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, _080809D4 + ldrh r1, [r4] + movs r0, 0 + bl sub_8082FDC + ldr r5, _080809D8 + 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, _080809DC + 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, _080809D8 + 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, _080809E0 + adds r0, r1, 0 + mov r2, r12 + strh r0, [r2] + ldr r1, [r4] + b _08080CB2 + .align 2, 0 +_080809D4: .4byte 0x0203ce7c +_080809D8: .4byte 0x020322a4 +_080809DC: .4byte 0x020229c6 +_080809E0: .4byte 0x00004422 +_080809E4: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _080809F0 + b _08080DAE +_080809F0: + ldr r0, _08080A00 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_8082D28 + b _08080DAE + .align 2, 0 +_08080A00: .4byte 0x020322a4 +_08080A04: + movs r4, 0 + ldr r5, _08080A48 + ldr r6, _08080A4C +_08080A0A: + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldr r0, _08080A50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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, _08080A54 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08080A0A + b _08080CAE + .align 2, 0 +_08080A48: .4byte 0x083399c8 +_08080A4C: .4byte 0x020322a4 +_08080A50: .4byte 0x08339ad8 +_08080A54: .4byte 0x02020630 +_08080A58: + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _08080A80 + 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 + .align 2, 0 +_08080A80: .4byte 0x020322a4 +_08080A84: + ldr r4, _08080AB4 + 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, _08080AB8 + 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 + .align 2, 0 +_08080AB4: .4byte 0x020322a4 +_08080AB8: .4byte 0x02037fd4 +_08080ABC: + ldr r2, _08080AD4 + 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 + .align 2, 0 +_08080AD4: .4byte 0x020322a4 +_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, _08080B34 + ldr r0, _08080B38 + 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, _08080B38 + 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 + .align 2, 0 +_08080B34: .4byte 0x083399d0 +_08080B38: .4byte 0x020322a4 +_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, _08080B88 + ldr r1, _08080B8C + ldrb r0, [r4] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldr r2, _08080B90 + 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 + .align 2, 0 +_08080B88: .4byte 0x083399dc +_08080B8C: .4byte 0x083399e4 +_08080B90: .4byte 0xffffa800 +_08080B94: + ldrb r0, [r3] + subs r0, 0x1 +_08080B98: + strb r0, [r3] + ldr r0, _08080BAC + ldr r0, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + movs r1, 0 + str r1, [r0] + b _08080DAE + .align 2, 0 +_08080BAC: .4byte 0x020322a4 +_08080BB0: + ldr r4, _08080BD8 + 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 gpu_sync_bg_show + b _08080DAE + .align 2, 0 +_08080BD8: .4byte 0x020322a4 +_08080BDC: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_set_bits + ldr r4, _08080C6C + 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, _08080C70 + ldr r1, _08080C74 + 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 lcd_io_set_bits + 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 + .align 2, 0 +_08080C6C: .4byte 0x020322a4 +_08080C70: .4byte 0x083399dc +_08080C74: .4byte 0x083399e4 +_08080C78: + bl sub_8083380 + lsls r0, 24 + cmp r0, 0 + beq _08080C8C + ldr r0, _08080C9C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08080C8C: + ldr r0, _08080C9C + ldr r0, [r0] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + bl sub_8082CB4 + b _08080DAE + .align 2, 0 +_08080C9C: .4byte 0x020322a4 +_08080CA0: + ldr r0, _08080CBC + movs r2, 0x10 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x3 + bl obj_add_from_template_forward_search +_08080CAE: + ldr r0, _08080CC0 + ldr r1, [r0] +_08080CB2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08080DAE + .align 2, 0 +_08080CBC: .4byte 0x08339c2c +_08080CC0: .4byte 0x020322a4 +_08080CC4: + bl sub_8080DF8 + ldr r5, _08080D1C + 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, _08080D20 + adds r0, r4, r2 + strb r3, [r0] + ldr r0, [r5] + adds r0, 0x72 + strb r3, [r0] + ldr r0, _08080D24 + bl set_callback2 + ldr r0, _08080D28 + ldrh r0, [r0] + cmp r0, 0x1 + bne _08080D44 + movs r0, 0xD0 + lsls r0, 2 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08080D30 + ldr r0, _08080D2C + movs r1, 0xA + bl AddTask + ldr r1, [r5] + movs r3, 0x90 + lsls r3, 1 + adds r1, r3 + b _08080D42 + .align 2, 0 +_08080D1C: .4byte 0x020322a4 +_08080D20: .4byte 0x00000123 +_08080D24: .4byte sub_8081898 + 1 +_08080D28: .4byte 0x020375e0 +_08080D2C: .4byte sub_8081224 + 1 +_08080D30: + ldr r0, _08080DE8 + 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, _08080DEC + 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, _08080DE8 +_08080D5A: + ldm r6!, {r0} + lsrs r1, r5, 24 + bl AddTask + ldr r1, _08080DF0 + 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, _08080DEC + ldrh r0, [r0] + cmp r4, r0 + blt _08080D5A +_08080D80: + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08080DF4 + cmp r0, r4 + beq _08080D9E + bl current_map_music_get + ldr r1, _08080DF0 + 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, _08080DF0 + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080DE8: .4byte 0x083399ec +_08080DEC: .4byte 0x020375e0 +_08080DF0: .4byte 0x020322a4 +_08080DF4: .4byte 0x00000193 + thumb_func_end sub_80808D4 + + thumb_func_start sub_8080DF8 +sub_8080DF8: @ 8080DF8 + push {lr} + ldr r3, _08080E18 + movs r0, 0 + ldr r1, _08080E1C + 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 + .align 2, 0 +_08080E18: .4byte 0x03003110 +_08080E1C: .4byte 0x03003090 + 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, _08080E60 + 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, _08080E64 + movs r4, 0xC + ldrsh r1, [r2, r4] + lsls r1, 4 + adds r0, 0x4 + adds r1, r0 + ldr r0, _08080E68 + strh r0, [r1] + adds r0, r3, 0 + bl remove_task +_08080E58: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08080E60: .4byte 0x03005e00 +_08080E64: .4byte 0x03003090 +_08080E68: .4byte 0x00002345 + 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, _08080E9C + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08080EA0 + 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 + .align 2, 0 +_08080E9C: .4byte sub_8080E20 + 1 +_08080EA0: .4byte 0x03005e00 + 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, _08080F10 + 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, _08080F14 + 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, _08080F18 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08080F9A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08080F1C + 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, _08080F20 + cmp r2, r0 + bgt _08080F40 + cmp r1, 0x4B + bls _08080F2C + ldr r1, _08080F24 + ldr r0, _08080F28 + b _08080F30 + .align 2, 0 +_08080F10: .4byte 0x020322a4 +_08080F14: .4byte 0x03005e00 +_08080F18: .4byte 0x00000123 +_08080F1C: .4byte 0x0000028f +_08080F20: .4byte 0x000001f3 +_08080F24: .4byte 0x03003090 +_08080F28: .4byte 0x00004523 +_08080F2C: + ldr r1, _08080F38 + ldr r0, _08080F3C +_08080F30: + strh r0, [r1, 0x14] + ldr r0, _08080F3C + b _08080F9E + .align 2, 0 +_08080F38: .4byte 0x03003090 +_08080F3C: .4byte 0x00005432 +_08080F40: + ldr r0, _08080F5C + 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, _08080F60 + ldr r0, _08080F64 + b _08080F9E + .align 2, 0 +_08080F5C: .4byte 0x000005db +_08080F60: .4byte 0x03003090 +_08080F64: .4byte 0x00005432 +_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, _08080F84 + ldr r0, _08080F88 + b _08080F9E + .align 2, 0 +_08080F84: .4byte 0x03003090 +_08080F88: .4byte 0x00005432 +_08080F8C: + cmp r3, 0x1D + bhi _08080FA0 +_08080F90: + movs r0, 0x1 + movs r1, 0x5 + bl sub_8080E6C + b _08080FA0 +_08080F9A: + ldr r1, _08080FAC + ldr r0, _08080FB0 +_08080F9E: + strh r0, [r1, 0x14] +_08080FA0: + ldr r0, _08080FB4 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08080FC4 + .align 2, 0 +_08080FAC: .4byte 0x03003090 +_08080FB0: .4byte 0x00004523 +_08080FB4: .4byte 0x03005e00 +_08080FB8: + ldr r0, _08080FCC + 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 + .align 2, 0 +_08080FCC: .4byte 0x03005e00 + 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, _08081054 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldr r1, _08081058 + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x9A + ldrb r1, [r1] + lsrs r2, r0, 8 + ldr r0, _0808105C + 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, _08081060 + 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, _08081064 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080810CC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08081068 + 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, _0808106C + cmp r1, r0 + bgt _08081088 + cmp r2, 0x42 + bls _08081078 + ldr r1, _08081070 + ldr r0, _08081074 + strh r0, [r1, 0x24] + b _080810B0 + .align 2, 0 +_08081054: .4byte 0x020322a4 +_08081058: .4byte 0x0000ffff +_0808105C: .4byte 0x083399e7 +_08081060: .4byte 0x03005e00 +_08081064: .4byte 0x00000123 +_08081068: .4byte 0x0000028f +_0808106C: .4byte 0x000001f3 +_08081070: .4byte 0x03003090 +_08081074: .4byte 0x00004523 +_08081078: + ldr r1, _08081080 + ldr r0, _08081084 + strh r0, [r1, 0x24] + b _080810B0 + .align 2, 0 +_08081080: .4byte 0x03003090 +_08081084: .4byte 0x00005432 +_08081088: + cmp r2, 0x41 + bls _08081092 + ldr r1, _080810BC + ldr r0, _080810C0 + 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, _080810BC + ldr r0, _080810C4 + strh r0, [r1, 0x24] +_080810A4: + cmp r3, 0x9 + bhi _080810B0 + movs r0, 0x2 + movs r1, 0x5 + bl sub_8080E6C +_080810B0: + ldr r0, _080810C8 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _080810EC + .align 2, 0 +_080810BC: .4byte 0x03003090 +_080810C0: .4byte 0x00004523 +_080810C4: .4byte 0x00005432 +_080810C8: .4byte 0x03005e00 +_080810CC: + ldr r0, _080810D8 + ldr r1, _080810DC + strh r1, [r0, 0x24] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _080810EE + .align 2, 0 +_080810D8: .4byte 0x03003090 +_080810DC: .4byte 0x00004523 +_080810E0: + ldr r0, _080810F4 + 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 + .align 2, 0 +_080810F4: .4byte 0x03005e00 + 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, _08081178 + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldr r1, _0808117C + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x9C + ldrb r1, [r1] + lsrs r2, r0, 8 + ldr r0, _08081180 + 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, _08081184 + 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, _08081188 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080811F8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0808118C + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r5] + adds r0, 0x4C + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r0, _08081190 + cmp r1, r0 + bgt _080811AC + cmp r2, 0x58 + bls _0808119C + ldr r1, _08081194 + ldr r0, _08081198 + strh r0, [r1, 0x34] + b _080811DE + .align 2, 0 +_08081178: .4byte 0x020322a4 +_0808117C: .4byte 0x0000ffff +_08081180: .4byte 0x083399e7 +_08081184: .4byte 0x03005e00 +_08081188: .4byte 0x00000123 +_0808118C: .4byte 0x0000028f +_08081190: .4byte 0x000001f3 +_08081194: .4byte 0x03003090 +_08081198: .4byte 0x00004523 +_0808119C: + ldr r1, _080811A4 + ldr r0, _080811A8 + strh r0, [r1, 0x34] + b _080811DE + .align 2, 0 +_080811A4: .4byte 0x03003090 +_080811A8: .4byte 0x00005432 +_080811AC: + cmp r2, 0x3C + bls _080811C0 + ldr r1, _080811B8 + ldr r0, _080811BC + b _080811D0 + .align 2, 0 +_080811B8: .4byte 0x03003090 +_080811BC: .4byte 0x00004523 +_080811C0: + adds r0, r2, 0 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080811D2 + ldr r1, _080811EC + ldr r0, _080811F0 +_080811D0: + strh r0, [r1, 0x34] +_080811D2: + cmp r2, 0x4 + bhi _080811DE + movs r0, 0x3 + movs r1, 0x5 + bl sub_8080E6C +_080811DE: + ldr r0, _080811F4 + adds r1, r6, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08081218 + .align 2, 0 +_080811EC: .4byte 0x03003090 +_080811F0: .4byte 0x00005432 +_080811F4: .4byte 0x03005e00 +_080811F8: + ldr r0, _08081204 + ldr r1, _08081208 + strh r1, [r0, 0x34] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _0808121A + .align 2, 0 +_08081204: .4byte 0x03003090 +_08081208: .4byte 0x00004523 +_0808120C: + ldr r0, _08081220 + 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 + .align 2, 0 +_08081220: .4byte 0x03005e00 + 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, _08081260 + 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, _08081264 + 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, _08081268 + ldr r1, _0808126C + strh r1, [r0, 0x14] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _0808127E + .align 2, 0 +_08081260: .4byte 0x020322a4 +_08081264: .4byte 0x03005e00 +_08081268: .4byte 0x03003090 +_0808126C: .4byte 0x00004523 +_08081270: + ldr r0, _08081284 + 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 + .align 2, 0 +_08081284: .4byte 0x03005e00 + 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, _080812FC + ldr r4, _08081300 + lsrs r1, 23 + adds r2, r1, r4 + ldrb r6, [r2] + ldr r5, _08081304 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + ldr r0, _08081308 + cmp r7, r0 + bne _08081314 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r5, _0808130C + adds r0, r4, r5 + movs r1, 0x2 + bl obj_anim_image_start + adds r5, 0x1C + adds r4, r5 + ldr r0, _08081310 + str r0, [r4] + movs r0, 0x28 + bl audio_play + b _08081358 + .align 2, 0 +_080812FC: .4byte 0x08339b40 +_08081300: .4byte 0x083399c8 +_08081304: .4byte 0x083399c0 +_08081308: .4byte 0x00004523 +_0808130C: .4byte 0x02020630 +_08081310: .4byte sub_8082F9C + 1 +_08081314: + ldr r0, _08081334 + cmp r7, r0 + bne _0808133C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08081338 + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start + movs r0, 0x1F + bl audio_play + b _08081358 + .align 2, 0 +_08081334: .4byte 0x00005432 +_08081338: .4byte 0x02020630 +_0808133C: + ldr r0, _08081368 + cmp r8, r0 + bne _08081358 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, _0808136C + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + movs r0, 0x20 + bl audio_play +_08081358: + bl sub_8082E84 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08081368: .4byte 0x00002345 +_0808136C: .4byte 0x02020630 + 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, _08081390 + cmp r4, r0 + beq _080813A4 + cmp r4, r0 + bgt _08081398 + ldr r0, _08081394 + cmp r4, r0 + beq _08081474 + b _080814A0 + .align 2, 0 +_08081390: .4byte 0x00004523 +_08081394: .4byte 0x00002345 +_08081398: + ldr r0, _080813A0 + cmp r5, r0 + beq _0808143C + b _080814A0 + .align 2, 0 +_080813A0: .4byte 0x00005432 +_080813A4: + ldr r7, _080813D4 + ldr r4, [r7] + adds r5, r4, 0 + adds r5, 0x4C + ldrh r6, [r5] + movs r0, 0 + ldrsh r1, [r5, r0] + ldr r0, _080813D8 + cmp r1, r0 + bgt _080813E0 + ldr r1, _080813DC + 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 + .align 2, 0 +_080813D4: .4byte 0x020322a4 +_080813D8: .4byte 0x000005db +_080813DC: .4byte 0x08339cc3 +_080813E0: + ldr r1, _08081438 + 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 + .align 2, 0 +_08081438: .4byte 0x08339cc3 +_0808143C: + ldr r0, _08081468 + ldr r2, [r0] + adds r4, r2, 0 + adds r4, 0x4C + ldrh r5, [r4] + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, _0808146C + cmp r1, r0 + bgt _080814A0 + ldr r1, _08081470 + 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 + .align 2, 0 +_08081468: .4byte 0x020322a4 +_0808146C: .4byte 0x000005db +_08081470: .4byte 0x08339cc3 +_08081474: + ldr r0, _080814A8 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x4C + ldr r1, _080814AC + 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 + .align 2, 0 +_080814A8: .4byte 0x020322a4 +_080814AC: .4byte 0x08339cc3 + 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, _080814DC + ldrb r0, [r0] + cmp r0, 0 + beq _080814E4 + ldr r0, _080814E0 + 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 + .align 2, 0 +_080814DC: .4byte 0x03003124 +_080814E0: .4byte 0x030030fc +_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, _080815D4 + ldrh r0, [r0] + cmp r0, 0 + beq _0808153C + ldr r3, _080815D8 + ldrh r0, [r3, 0x4] + ldr r2, _080815DC + cmp r0, 0 + beq _0808151C + movs r1, 0 + strh r0, [r2, 0x4] + ldr r0, _080815E0 + strh r0, [r2] + strh r1, [r3, 0x4] +_0808151C: + ldr r0, _080815DC + ldr r3, _080815E0 + 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, _080815E4 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + blt _0808154C + b _080816F6 +_0808154C: + ldr r0, _080815DC + 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, _080815E8 + mov r10, r0 +_08081562: + mov r1, r8 + ldrh r0, [r1] + ldr r1, _080815E0 + movs r2, 0x88 + lsls r2, 7 + bl sub_80814B0 + cmp r0, 0 + bne _08081576 + b _080816D2 +_08081576: + ldr r6, _080815E4 + 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, _080815EC + 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, _080815F0 + cmp r1, r0 + bls _080815BA + movs r0, 0xFA + lsls r0, 2 + strh r0, [r4] +_080815BA: + lsls r1, r5, 24 + lsrs r1, 24 + ldr r0, _080815EC + 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 + .align 2, 0 +_080815D4: .4byte 0x020375e0 +_080815D8: .4byte 0x03003110 +_080815DC: .4byte 0x03003090 +_080815E0: .4byte 0x00004444 +_080815E4: .4byte 0x020322a4 +_080815E8: .4byte 0x00005432 +_080815EC: .4byte 0x00004523 +_080815F0: .4byte 0x03e70000 +_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, _080816AC + 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, _080816B0 + cmp r2, r0 + bhi _08081660 + adds r0, r2, 0x1 +_0808165E: + strh r0, [r1] +_08081660: + mov r0, r8 + ldrh r1, [r0, 0x4] + ldr r0, _080816AC + cmp r1, r0 + beq _08081678 +_0808166A: + ldr r1, [sp] + ldrh r0, [r1] + ldr r2, _080816B4 + cmp r0, r2 + beq _08081678 + cmp r0, r10 + bne _080816D2 +_08081678: + ldr r0, _080816B8 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x4C + movs r0, 0 + ldrsh r1, [r2, r0] + ldr r0, _080816BC + cmp r1, r0 + ble _080816C8 + adds r0, r1, 0 + ldr r2, _080816C0 + 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, _080816C4 + bl MPlayTempoControl + b _080816D2 + .align 2, 0 +_080816AC: .4byte 0x00002345 +_080816B0: .4byte 0x000003e6 +_080816B4: .4byte 0x00004523 +_080816B8: .4byte 0x020322a4 +_080816BC: .4byte 0x000005dc +_080816C0: .4byte 0xfffffd12 +_080816C4: .4byte 0x03007420 +_080816C8: + ldr r0, _08081734 + 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, _08081738 + ldr r0, [r0] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + bge _080816F6 + b _08081562 +_080816F6: + ldr r0, _0808173C + ldrh r0, [r0] + cmp r0, 0 + beq _08081722 + movs r7, 0 + ldr r3, _08081738 + ldr r0, [r3] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + bge _08081722 + movs r2, 0 + ldr r1, _08081740 +_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 + .align 2, 0 +_08081734: .4byte 0x03007420 +_08081738: .4byte 0x020322a4 +_0808173C: .4byte 0x020375e0 +_08081740: .4byte 0x03003090 + 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, _08081794 + ldrb r0, [r0] + cmp r0, 0 + beq _0808175A + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 +_0808175A: + ldr r3, _08081798 + 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, _0808179C + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _080817A8 + ldr r2, _080817A0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080817B6 + ldrh r2, [r2, 0x28] + ldr r1, _080817A4 + adds r0, r1, 0 + ands r0, r2 + cmp r0, r1 + beq _080817B6 + b _080817BA + .align 2, 0 +_08081794: .4byte 0x03003124 +_08081798: .4byte 0x020322a4 +_0808179C: .4byte 0x03005d90 +_080817A0: .4byte 0x030022c0 +_080817A4: .4byte 0x00000201 +_080817A8: + ldr r0, _080817FC + 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, _08081800 + 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, _08081804 + adds r0, r1 + adds r1, r5, 0x4 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + 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, _08081808 + ldr r0, _0808180C + b _08081828 + .align 2, 0 +_080817FC: .4byte 0x030022c0 +_08081800: .4byte 0x020322a4 +_08081804: .4byte 0x02020630 +_08081808: .4byte 0x03003110 +_0808180C: .4byte 0x00004523 +_08081810: + cmp r0, 0x1 + bne _08081824 + ldr r1, _0808181C + ldr r0, _08081820 + b _08081828 + .align 2, 0 +_0808181C: .4byte 0x03003110 +_08081820: .4byte 0x00005432 +_08081824: + ldr r1, _08081884 + ldr r0, _08081888 +_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, _0808188C + ldrb r0, [r0] + cmp r0, 0 + beq _0808187E + ldr r0, _08081890 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _0808187E + ldr r0, [r3] + ldr r1, _08081894 + adds r2, r0, r1 + ldrb r0, [r2] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2] +_0808187E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08081884: .4byte 0x03003110 +_08081888: .4byte 0x00002345 +_0808188C: .4byte 0x020322d5 +_08081890: .4byte 0x030022c0 +_08081894: .4byte 0x00000123 + thumb_func_end sub_8081744 + + thumb_func_start sub_8081898 +sub_8081898: @ 8081898 + push {r4-r6,lr} + bl sub_8082D28 + ldr r4, _08081950 + ldr r0, [r4] + movs r1, 0x82 + lsls r1, 1 + adds r2, r0, r1 + ldr r1, [r2] + ldr r0, _08081954 + 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, _08081958 + cmp r1, r0 + bls _0808191A + adds r0, r2, r5 + strh r6, [r0] + movs r0, 0x1 + strb r0, [r3] + ldr r0, _0808195C + bl set_callback2 +_0808191A: + ldr r0, _08081950 + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08081950: .4byte 0x020322a4 +_08081954: .4byte 0x00057e03 +_08081958: .4byte 0x000003e7 +_0808195C: .4byte sub_8081FC8 + 1 + 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 sub_8008C44 + cmp r0, 0 + bne _080819B0 + ldr r0, [r4, 0x8] + ldr r2, _080819A8 + ands r0, r2 + ldr r1, [r5, 0x8] + ands r1, r2 + cmp r0, r1 + bne _080819B0 + ldr r0, [r4, 0xC] + ldr r2, _080819AC + ands r0, r2 + ldr r1, [r5, 0xC] + ands r1, r2 + cmp r0, r1 + bne _080819B0 +_080819A2: + movs r0, 0x1 + b _080819B2 + .align 2, 0 +_080819A8: .4byte 0xffffff00 +_080819AC: .4byte 0x00ffffff +_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, _08081B34 + 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 + .align 2, 0 +_08081B34: .4byte 0x03000df8 +_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, _08081BB8 + strh r0, [r1] + bx lr + .align 2, 0 +_08081BB8: .4byte 0x03000e04 + thumb_func_end sub_8081BB0 + + thumb_func_start sub_8081BBC +sub_8081BBC: @ 8081BBC + ldr r0, _08081BC4 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08081BC4: .4byte 0x03000e04 + thumb_func_end sub_8081BBC + + thumb_func_start sub_8081BC8 +sub_8081BC8: @ 8081BC8 + ldr r1, _08081BD0 + strh r0, [r1] + bx lr + .align 2, 0 +_08081BD0: .4byte 0x03000e06 + thumb_func_end sub_8081BC8 + + thumb_func_start sub_8081BD4 +sub_8081BD4: @ 8081BD4 + ldr r0, _08081BDC + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08081BDC: .4byte 0x03000e06 + 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, _08081C9C + 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, _08081C9C + 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, _08081C9C + 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 + .align 2, 0 +_08081C9C: .4byte 0x03000de8 +_08081CA0: + subs r0, r2, r3 + strh r0, [r1] +_08081CA4: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081C8A + ldr r1, _08081D84 + ldr r2, _08081D88 + 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, _08081D8C + ldr r0, [sp, 0x8] + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + adds r3, r0, 0 + adds r3, 0x64 + ldr r4, _08081D90 + 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, _08081D84 + ldr r2, _08081D94 + 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, _08081D84 + 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, _08081D98 + 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 + .align 2, 0 +_08081D84: .4byte 0x03000de8 +_08081D88: .4byte 0x020322a8 +_08081D8C: .4byte 0x0000014d +_08081D90: .4byte 0x020322d0 +_08081D94: .4byte 0x020322bc +_08081D98: .4byte 0x08339cc8 +_08081D9C: + strh r2, [r1] +_08081D9E: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + ble _08081D74 +_08081DA6: + ldr r7, _08081E00 + 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 + .align 2, 0 +_08081E00: .4byte 0x03000de8 + 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, _08081E40 + 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, _08081E44 + cmp r1, r5 + bhi _08081E48 + movs r2, 0x5 + b _08081E9A + .align 2, 0 +_08081E40: .4byte 0x020322a4 +_08081E44: .4byte 0x00000383 +_08081E48: + ldr r3, _08081E5C + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + ldr r3, _08081E60 + cmp r0, r3 + bhi _08081E64 + movs r2, 0x4 + b _08081E9A + .align 2, 0 +_08081E5C: .4byte 0xfffffc7c +_08081E60: .4byte 0x00000257 +_08081E64: + ldr r6, _08081E74 + adds r0, r1, r6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r3 + bhi _08081E78 + movs r2, 0x3 + b _08081E9A + .align 2, 0 +_08081E74: .4byte 0xfffffa24 +_08081E78: + ldr r3, _08081E88 + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bhi _08081E8C + movs r2, 0x2 + b _08081E9A + .align 2, 0 +_08081E88: .4byte 0xfffff7cc +_08081E8C: + ldr r6, _08081EB8 + adds r0, r1, r6 + lsls r0, 16 + ldr r1, _08081EBC + 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, _08081EC0 + b _08081F7C + .align 2, 0 +_08081EB8: .4byte 0xfffff31c +_08081EBC: .4byte 0x012b0000 +_08081EC0: .4byte 0x0000ffff +_08081EC4: + adds r0, r4, 0 + subs r0, 0x64 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081ED8 + ldr r2, _08081ED4 + b _08081F7C + .align 2, 0 +_08081ED4: .4byte 0x0000fffe +_08081ED8: + adds r0, r4, 0 + subs r0, 0x96 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081EEC + ldr r2, _08081EE8 + b _08081F7C + .align 2, 0 +_08081EE8: .4byte 0x0000fffd +_08081EEC: + adds r0, r4, 0 + subs r0, 0xC8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F00 + ldr r2, _08081EFC + b _08081F7C + .align 2, 0 +_08081EFC: .4byte 0x0000fffc +_08081F00: + adds r0, r4, 0 + subs r0, 0xFA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F14 + ldr r2, _08081F10 + b _08081F7C + .align 2, 0 +_08081F10: .4byte 0x0000fffb +_08081F14: + ldr r1, _08081F24 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F2C + ldr r2, _08081F28 + b _08081F7C + .align 2, 0 +_08081F24: .4byte 0xfffffea2 +_08081F28: .4byte 0x0000fffa +_08081F2C: + ldr r3, _08081F3C + adds r0, r4, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F44 + ldr r2, _08081F40 + b _08081F7C + .align 2, 0 +_08081F3C: .4byte 0xfffffe70 +_08081F40: .4byte 0x0000fff9 +_08081F44: + ldr r6, _08081F54 + adds r0, r4, r6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F5C + ldr r2, _08081F58 + b _08081F7C + .align 2, 0 +_08081F54: .4byte 0xfffffe0c +_08081F58: .4byte 0x0000fff8 +_08081F5C: + ldr r1, _08081F6C + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F74 + ldr r2, _08081F70 + b _08081F7C + .align 2, 0 +_08081F6C: .4byte 0xfffffdda +_08081F70: .4byte 0x0000fff7 +_08081F74: + ldr r0, _08081F8C + cmp r4, r0 + bls _08081F7C + ldr r2, _08081F90 +_08081F7C: + lsls r0, r2, 16 + asrs r0, 16 + bl sub_8081BB0 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08081F8C: .4byte 0x00000257 +_08081F90: .4byte 0x0000fff6 + thumb_func_end sub_8081E20 + + thumb_func_start sub_8081F94 +sub_8081F94: @ 8081F94 + push {lr} + adds r1, r0, 0 + ldr r0, _08081FB0 + ldrb r0, [r0] + cmp r0, 0 + beq _08081FB8 + ldr r0, _08081FB4 + ldrb r0, [r0] + cmp r0, 0 + beq _08081FB8 + movs r2, 0xBC + lsls r2, 6 + b _08081FBA + .align 2, 0 +_08081FB0: .4byte 0x03003124 +_08081FB4: .4byte 0x030030fc +_08081FB8: + ldr r2, _08081FC4 +_08081FBA: + adds r0, r2, 0 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08081FC4: .4byte 0x00002fff + thumb_func_end sub_8081F94 + + thumb_func_start sub_8081FC8 +sub_8081FC8: @ 8081FC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _08081FFC + 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, _08082000 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08081FFC: .4byte 0x020322a4 +_08082000: .4byte _08082004 + .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, _08082048 + movs r1, 0x80 + lsls r1, 1 + bl MPlayTempoControl + movs r4, 0 + b _08082064 + .align 2, 0 +_08082048: .4byte 0x03007420 +_0808204C: + ldr r0, _08082070 + 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, _08082074 + ldrh r0, [r0] + cmp r4, r0 + bcc _0808204C + b _08082458 + .align 2, 0 +_08082070: .4byte 0x020322a4 +_08082074: .4byte 0x020375e0 +_08082078: + ldr r4, _080820A8 + 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, _080820AC + ldrb r0, [r0] + cmp r0, 0 + beq _080820B0 + adds r1, 0x17 + ldrb r0, [r1] + adds r0, 0x1 + b _080820B6 + .align 2, 0 +_080820A8: .4byte 0x020322a4 +_080820AC: .4byte 0x03003124 +_080820B0: + adds r1, r2, 0 + adds r1, 0x63 + movs r0, 0x5 +_080820B6: + strb r0, [r1] + ldr r0, _080820CC + ldr r1, [r0] + movs r0, 0 + strb r0, [r1] + ldr r0, _080820D0 + bl MPlayStop_rev01 +_080820C6: + bl sub_807F738 + b _0808249E + .align 2, 0 +_080820CC: .4byte 0x020322a4 +_080820D0: .4byte 0x03007630 +_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, _08082178 + ldrb r0, [r0] + cmp r0, 0 + beq _0808218C + ldr r0, _0808217C + ldrb r0, [r0] + cmp r0, 0 + beq _0808218C + ldr r3, _08082180 + 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, _08082184 + adds r1, r2 + strh r0, [r1] + movs r4, 0 + mov r8, r3 + mov r12, r8 + ldr r7, _08082188 + 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 + .align 2, 0 +_08082178: .4byte 0x03003124 +_0808217C: .4byte 0x030030fc +_08082180: .4byte 0x020322a4 +_08082184: .4byte 0x000011c4 +_08082188: .4byte 0x000011c8 +_0808218C: + ldr r4, _080821C4 + 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 + .align 2, 0 +_080821C4: .4byte 0x020322a4 +_080821C8: + bl sub_800A550 + lsls r0, 24 + cmp r0, 0 + bne _080821D4 + b _0808249E +_080821D4: + bl sub_800A5B4 + ldr r5, _08082244 + ldr r1, [r5] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, _08082248 + ldrb r0, [r0] + cmp r0, 0 + beq _08082254 + ldr r0, _0808224C + ldrb r0, [r0] + cmp r0, 0 + beq _08082254 + ldr r2, _08082250 + 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 + .align 2, 0 +_08082244: .4byte 0x020322a4 +_08082248: .4byte 0x03003124 +_0808224C: .4byte 0x030030fc +_08082250: .4byte 0x020223c4 +_08082254: + ldr r2, _08082270 + ldr r0, _08082274 + 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 + .align 2, 0 +_08082270: .4byte 0x020223c4 +_08082274: .4byte 0x020322a4 +_08082278: + bl sub_8083B08 + lsls r0, 24 + cmp r0, 0 + bne _08082284 + b _0808249E +_08082284: + b _08082458 +_08082286: + bl sub_8083450 + lsls r0, 24 + cmp r0, 0 + bne _08082292 + b _0808249E +_08082292: + ldr r0, _080822A4 + ldrb r0, [r0] + cmp r0, 0 + bne _080822A8 + movs r0, 0x22 + bl sav12_xor_increment + b _08082458 + .align 2, 0 +_080822A4: .4byte 0x03005d98 +_080822A8: + movs r0, 0x21 + bl sav12_xor_increment + b _08082458 +_080822B0: + ldr r6, _080822D8 + ldr r4, [r6] + ldr r5, _080822DC + adds r4, r5 + ldr r5, _080822E0 + 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 + .align 2, 0 +_080822D8: .4byte 0x020322a4 +_080822DC: .4byte 0x000011b8 +_080822E0: .4byte 0x08339831 +_080822E4: + ldr r4, _08082300 + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0 + strb r1, [r0] + ldr r0, _08082304 + movs r1, 0x1 + movs r2, 0xD + movs r3, 0 + bl sub_81996C0 + ldr r1, [r4] + b _0808245C + .align 2, 0 +_08082300: .4byte 0x020322a4 +_08082304: .4byte 0x083399b8 +_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, _08082368 + 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, _08082368 + 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 Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0808235C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0808233E + b _0808249E + .align 2, 0 +_08082368: .4byte 0x020322a4 +_0808236C: + ldr r1, _080823AC + 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, _080823AC + 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 Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0808239E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082380 + b _0808249E + .align 2, 0 +_080823AC: .4byte 0x020322a4 +_080823B0: + ldr r6, _080823E0 + adds r0, r6, 0 + bl sub_8081F94 + ldr r4, _080823E4 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x9E + ldrb r5, [r0] + cmp r5, 0 + bne _0808241C + movs r0, 0x4 + bl sub_80D66EC + lsls r0, 24 + cmp r0, 0 + bne _080823EC + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0x2 + strh r1, [r0] + ldr r0, _080823E8 + b _08082414 + .align 2, 0 +_080823E0: .4byte 0x03003110 +_080823E4: .4byte 0x020322a4 +_080823E8: .4byte 0x00009999 +_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, _08082408 + b _08082414 + .align 2, 0 +_08082408: .4byte 0x0000aaaa +_0808240C: + ldr r0, [r4] + adds r0, 0x70 + strh r5, [r0] + ldr r0, _08082418 +_08082414: + strh r0, [r6, 0x2] + b _08082458 + .align 2, 0 +_08082418: .4byte 0x00007779 +_0808241C: + adds r1, r2, 0 + adds r1, 0x70 + movs r0, 0x1 + strh r0, [r1] + ldr r0, _0808242C + strh r0, [r6, 0x2] + subs r1, 0xD + b _0808245E + .align 2, 0 +_0808242C: .4byte 0x00008888 +_08082430: + ldr r0, _0808244C + ldrb r0, [r0] + cmp r0, 0 + beq _08082458 + ldr r0, _08082450 + bl set_callback2 + ldr r2, _08082454 + ldr r0, [r2] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + b _0808249C + .align 2, 0 +_0808244C: .4byte 0x03005d98 +_08082450: .4byte sub_8082924 + 1 +_08082454: .4byte 0x020322a4 +_08082458: + ldr r0, _08082468 + ldr r1, [r0] +_0808245C: + adds r1, 0x63 +_0808245E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0808249E + .align 2, 0 +_08082468: .4byte 0x020322a4 +_0808246C: + ldr r6, _080824EC + ldr r4, [r6] + ldr r0, _080824F0 + adds r4, r0 + ldr r5, _080824F4 + 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, _080824F8 + bl set_callback2 + 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, _080824EC + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080824EC: .4byte 0x020322a4 +_080824F0: .4byte 0x000011b8 +_080824F4: .4byte 0x0833981a +_080824F8: .4byte sub_8082644 + 1 + thumb_func_end sub_8081FC8 + + thumb_func_start sub_80824FC +sub_80824FC: @ 80824FC + push {r4,lr} + ldr r1, _0808251C + 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, _08082520 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0808251C: .4byte 0x020322a4 +_08082520: .4byte _08082524 + .align 2, 0 +_08082524: + .4byte _08082540 + .4byte _08082558 + .4byte _08082584 + .4byte _08082594 + .4byte _080825BA + .4byte _08082600 + .4byte _0808261A +_08082540: + bl sub_800ADF8 + ldr r0, _08082554 + ldr r2, [r0] + movs r3, 0xD0 + lsls r3, 1 + adds r1, r2, r3 + movs r0, 0x1 + b _0808260C + .align 2, 0 +_08082554: .4byte 0x020322a4 +_08082558: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0808263C + ldr r0, _0808257C + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, _08082580 + movs r0, 0x1 + strb r0, [r1] + b _0808263C + .align 2, 0 +_0808257C: .4byte 0x020322a4 +_08082580: .4byte 0x03002700 +_08082584: + bl sub_8153430 + ldr r0, _08082590 + ldr r2, [r0] + b _08082602 + .align 2, 0 +_08082590: .4byte 0x020322a4 +_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, _080825E0 + ldr r0, [r0] + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + movs r1, 0x5 + str r1, [r0] + b _0808263C + .align 2, 0 +_080825E0: .4byte 0x020322a4 +_080825E4: + ldr r0, _080825FC + 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 + .align 2, 0 +_080825FC: .4byte 0x020322a4 +_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, _08082638 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _0808263E + .align 2, 0 +_08082638: .4byte 0x03002700 +_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, _08082664 + 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, _08082668 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08082664: .4byte 0x020322a4 +_08082668: .4byte _0808266C + .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, _080826CC + cmp r2, r0 + bne _080826B0 + b _080827A2 +_080826B0: + ldr r0, _080826D0 + cmp r2, r0 + beq _080826B8 + b _080828DC +_080826B8: + adds r0, r1, 0 + adds r0, 0x6C + ldrh r2, [r0] + ldr r0, _080826D4 + cmp r2, r0 + bne _080826D8 + adds r1, 0x63 + movs r0, 0x2 + strb r0, [r1] + b _080828DC + .align 2, 0 +_080826CC: .4byte 0x00002222 +_080826D0: .4byte 0x00001111 +_080826D4: .4byte 0x00009999 +_080826D8: + ldr r0, _080826E8 + cmp r2, r0 + bne _080827A2 + adds r1, 0x63 + movs r0, 0x1 + strb r0, [r1] + b _080828DC + .align 2, 0 +_080826E8: .4byte 0x0000aaaa +_080826EC: + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0x3 + strb r1, [r0] + ldr r4, _08082710 + ldr r0, [r6] + adds r0, 0x6E + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, _08082714 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _08082718 + b _08082740 + .align 2, 0 +_08082710: .4byte 0x02021fc4 +_08082714: .4byte 0x020229f0 +_08082718: .4byte 0x083398dd +_0808271C: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, _08082748 + ldr r0, [r6] + adds r0, 0x6E + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, _0808274C + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _08082750 +_08082740: + adds r0, r4, 0 + bl gf_strcat + b _080828DC + .align 2, 0 +_08082748: .4byte 0x02021fc4 +_0808274C: .4byte 0x020229f0 +_08082750: .4byte 0x083398b0 +_08082754: + ldr r4, [r6] + ldr r0, _08082784 + adds r4, r0 + ldr r5, _08082788 + 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 + .align 2, 0 +_08082784: .4byte 0x000011b8 +_08082788: .4byte 0x02021fc4 +_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, _080827C0 + adds r0, r1 + ldr r1, _080827C4 + movs r2, 0 + bl sub_808417C + bl sub_800ADF8 + b _080828BA + .align 2, 0 +_080827C0: .4byte 0x000011b8 +_080827C4: .4byte 0x085ee42d +_080827C8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080827D4 + b _080828DC +_080827D4: + ldr r3, _080827F8 + 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 + .align 2, 0 +_080827F8: .4byte 0x020322a4 +_080827FC: + bl sub_80824FC + lsls r0, 24 + cmp r0, 0 + beq _080828DC + movs r0, 0x37 + bl audio_play + ldr r0, _08082814 + ldr r1, [r0] + b _080828BC + .align 2, 0 +_08082814: .4byte 0x020322a4 +_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 sub_80A1AD4 + ldr r0, _08082848 + ldr r1, [r0] + b _080828BC + .align 2, 0 +_08082848: .4byte 0x020322a4 +_0808284C: + ldr r0, _0808288C + 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, _08082890 + cmp r1, r0 + bne _08082898 + bl Window_FreeMemory + movs r0, 0x2 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + ldr r0, [r6] + bl free + str r4, [r6] + ldr r0, _08082894 + bl set_callback2 + b _080828DC + .align 2, 0 +_0808288C: .4byte 0x02037fd4 +_08082890: .4byte 0x00002222 +_08082894: .4byte sub_807FA80 + 1 +_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, _08082918 + ldrb r4, [r0] + cmp r4, 0 + bne _080828DC + ldr r0, [r6] + bl free + str r4, [r6] + ldr r0, _0808291C + bl set_callback2 +_080828DC: + bl sub_8082AD4 + ldr r0, _08082920 + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08082918: .4byte 0x03003124 +_0808291C: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_08082920: .4byte 0x020322a4 + thumb_func_end sub_8082644 + + thumb_func_start sub_8082924 +sub_8082924: @ 8082924 + push {r4-r6,lr} + ldr r1, _08082940 + 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, _08082944 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08082940: .4byte 0x020322a4 +_08082944: .4byte _08082948 + .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, _080829C8 + adds r0, r1 + strh r2, [r0] + ldr r0, _080829CC + ldr r1, _080829D0 + bl gf_strcpy + b _08082A92 + .align 2, 0 +_080829C8: .4byte 0x000011b8 +_080829CC: .4byte 0x02021fc4 +_080829D0: .4byte 0x08339896 +_080829D4: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, [r6] + ldr r1, _080829F4 + adds r0, r1 + strh r2, [r0] + ldr r0, _080829F8 + ldr r1, _080829FC + bl gf_strcpy + b _08082A92 + .align 2, 0 +_080829F4: .4byte 0x000011b8 +_080829F8: .4byte 0x02021fc4 +_080829FC: .4byte 0x08339858 +_08082A00: + ldr r4, [r6] + ldr r2, _08082A28 + adds r4, r2 + ldr r5, _08082A2C + 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 + .align 2, 0 +_08082A28: .4byte 0x000011b8 +_08082A2C: .4byte 0x02021fc4 +_08082A30: + movs r0, 0x3 + bl sub_80A2390 + ldr r0, _08082A44 + ldr r1, [r0] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08082A92 + .align 2, 0 +_08082A44: .4byte 0x020322a4 +_08082A48: + ldr r0, _08082A68 + 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, _08082A6C + bl set_callback2 + b _08082A76 + .align 2, 0 +_08082A68: .4byte 0x02037fd4 +_08082A6C: .4byte sub_807FA80 + 1 +_08082A70: + ldr r0, _08082ACC + bl set_callback2 +_08082A76: + bl Window_FreeMemory + movs r0, 0x2 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + ldr r4, _08082AD0 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] +_08082A92: + bl sub_8082AD4 + ldr r0, _08082AD0 + 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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08082ACC: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_08082AD0: .4byte 0x020322a4 + thumb_func_end sub_8082924 + + thumb_func_start sub_8082AD4 +sub_8082AD4: @ 8082AD4 + push {r4-r7,lr} + ldr r0, _08082B0C + ldrb r0, [r0] + cmp r0, 0 + bne _08082AE0 + b _08082CA4 +_08082AE0: + ldr r4, _08082B10 + ldrh r0, [r4] + ldr r1, _08082B14 + movs r2, 0xBC + lsls r2, 6 + bl sub_80814B0 + cmp r0, 0 + beq _08082B66 + ldrh r1, [r4, 0x2] + ldr r0, _08082B18 + cmp r1, r0 + bne _08082B58 + ldrh r3, [r4, 0x4] + ldr r0, _08082B1C + cmp r3, r0 + beq _08082B38 + cmp r3, r0 + bgt _08082B24 + ldr r0, _08082B20 + b _08082B26 + .align 2, 0 +_08082B0C: .4byte 0x03003124 +_08082B10: .4byte 0x03003090 +_08082B14: .4byte 0x00002fff +_08082B18: .4byte 0x00001111 +_08082B1C: .4byte 0x00009999 +_08082B20: .4byte 0x00008888 +_08082B24: + ldr r0, _08082B30 +_08082B26: + cmp r3, r0 + beq _08082B38 + ldr r2, _08082B34 + b _08082B48 + .align 2, 0 +_08082B30: .4byte 0x0000aaaa +_08082B34: .4byte 0x020322a4 +_08082B38: + ldr r2, _08082B50 + 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, _08082B54 + b _08082B64 + .align 2, 0 +_08082B50: .4byte 0x020322a4 +_08082B54: .4byte 0x00001111 +_08082B58: + ldr r0, _08082B90 + cmp r1, r0 + bne _08082B66 + ldr r0, _08082B94 + 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, _08082B94 + ldr r0, [r2] + adds r0, 0x64 + ldrh r1, [r0] + ldr r0, _08082B98 + cmp r1, r0 + bne _08082B82 + b _08082CA4 +_08082B82: + ldr r0, _08082B90 + cmp r1, r0 + bne _08082B8A + b _08082CA4 +_08082B8A: + movs r5, 0 + adds r7, r2, 0 + b _08082BF4 + .align 2, 0 +_08082B90: .4byte 0x00002222 +_08082B94: .4byte 0x020322a4 +_08082B98: .4byte 0x00001111 +_08082B9C: + ldr r6, _08082BC8 + lsls r4, r5, 4 + adds r0, r4, r6 + ldrh r0, [r0] + ldr r1, _08082BCC + 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, _08082BD0 + cmp r2, r0 + beq _08082BE4 + cmp r2, r0 + bgt _08082BD8 + ldr r0, _08082BD4 + b _08082BE0 + .align 2, 0 +_08082BC8: .4byte 0x03003090 +_08082BCC: .4byte 0x00002fff +_08082BD0: .4byte 0x00008888 +_08082BD4: .4byte 0x00007779 +_08082BD8: + ldr r0, _08082C04 + cmp r2, r0 + beq _08082BE4 + ldr r0, _08082C08 +_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 + .align 2, 0 +_08082C04: .4byte 0x00009999 +_08082C08: .4byte 0x0000aaaa +_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, _08082C40 + 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, _08082C44 + b _08082C4E + .align 2, 0 +_08082C40: .4byte 0x020322a4 +_08082C44: .4byte 0x00007779 +_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, _08082C84 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r4 + beq _08082C48 +_08082C6A: + ldr r4, _08082C88 + adds r0, r4, 0 + bl sub_8081F94 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08082C90 + ldr r0, _08082C8C + strh r0, [r4, 0x2] + b _08082CA4 + .align 2, 0 +_08082C84: .4byte 0x020322a4 +_08082C88: .4byte 0x03003110 +_08082C8C: .4byte 0x00002222 +_08082C90: + ldr r0, _08082CAC + strh r0, [r4, 0x2] + ldr r0, _08082CB0 + 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 + .align 2, 0 +_08082CAC: .4byte 0x00001111 +_08082CB0: .4byte 0x020322a4 + 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, _08082D14 + 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 + .align 2, 0 +_08082D14: .4byte 0x020322a4 + thumb_func_end sub_8082CB4 + + thumb_func_start sub_8082D18 +sub_8082D18: @ 8082D18 + ldr r0, _08082D24 + ldr r0, [r0] + adds r0, 0x4A + ldrh r0, [r0] + bx lr + .align 2, 0 +_08082D24: .4byte 0x020322a4 + thumb_func_end sub_8082D18 + + thumb_func_start sub_8082D28 +sub_8082D28: @ 8082D28 + push {r4,lr} + movs r1, 0 + ldr r4, _08082D80 + ldrb r0, [r4] + cmp r0, 0 + beq _08082D3C + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r1, r0, 24 +_08082D3C: + ldr r0, _08082D84 + ldrb r0, [r0] + cmp r0, 0 + beq _08082DCC + ldrb r0, [r4] + cmp r0, 0 + beq _08082DCC + cmp r1, 0 + bne _08082D90 + ldr r0, _08082D88 + 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, _08082D8C + 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 + .align 2, 0 +_08082D80: .4byte 0x03003124 +_08082D84: .4byte 0x030030fc +_08082D88: .4byte 0x020322a4 +_08082D8C: .4byte 0x03003110 +_08082D90: + ldr r3, _08082DC4 + 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, _08082DC8 + 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 + .align 2, 0 +_08082DC4: .4byte 0x03003090 +_08082DC8: .4byte 0x020322a4 +_08082DCC: + ldr r0, _08082DF0 + 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 + .align 2, 0 +_08082DF0: .4byte 0x020322a4 + thumb_func_end sub_8082D28 + + thumb_func_start sub_8082DF4 +sub_8082DF4: @ 8082DF4 + push {r4-r6,lr} + ldr r4, _08082E38 + ldr r0, [r4] + movs r6, 0x8E + lsls r6, 1 + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, [r4] + movs r5, 0x8F + lsls r5, 1 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, [r4] + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08082E38: .4byte 0x020322a4 + 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 obj_delete_and_free_tiles +_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, _08082F50 + mov r9, r0 + ldr r2, _08082F54 + mov r10, r2 + adds r6, r1, 0x1 + movs r3, 0x1F + mov r8, r3 + movs r7, 0x10 +_08082EB0: + bl GenerateRandomNumber + ldr r1, _08082F58 + 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, _08082F5C + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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, _08082F60 + adds r5, r3 + ldr r0, _08082F64 + 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 + .align 2, 0 +_08082F50: .4byte 0x08329f40 +_08082F54: .4byte 0x02020630 +_08082F58: .4byte 0x020322a4 +_08082F5C: .4byte 0x08339be0 +_08082F60: .4byte 0x0202064c +_08082F64: .4byte sub_8082E3C + 1 + 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 obj_delete_and_free_tiles +_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, _08082FD8 + 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 obj_delete_and_free_tiles +_08082FD4: + pop {r0} + bx r0 + .align 2, 0 +_08082FD8: .4byte 0x0000fff4 + 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, _0808300C + 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 + .align 2, 0 +_0808300C: .4byte 0x020322a4 + 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 obj_delete_and_free_tiles + ldr r0, _0808309C + movs r2, 0x14 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x2 + bl obj_add_from_template_forward_search + b _080830B2 + .align 2, 0 +_0808309C: .4byte 0x08339c60 +_080830A0: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _080830BC + strh r0, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start +_080830B2: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080830BC: .4byte 0x0000fff0 + 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, _0808313C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08083130: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808313C: .4byte 0x020322a4 + 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, _0808316C + 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 + .align 2, 0 +_0808316C: .4byte 0x020322a4 + 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, _08083200 + 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, _08083204 + 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, _08083208 + 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, _0808320C + 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 + .align 2, 0 +_08083200: .4byte 0x06006000 +_08083204: .4byte 0x000080e9 +_08083208: .4byte 0xffff80e1 +_0808320C: .4byte 0x000080e1 + thumb_func_end sub_8083170 + + thumb_func_start sub_8083210 +sub_8083210: @ 8083210 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08083228 + muls r0, r1 + cmp r0, 0 + bge _08083222 + ldr r1, _0808322C + adds r0, r1 +_08083222: + asrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_08083228: .4byte 0x00057e40 +_0808322C: .4byte 0x0000ffff + 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, _080832B0 + 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, _080832B4 + mov r0, sp + ldr r3, _080832B8 + 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 + .align 2, 0 +_080832B0: .4byte 0x020322a4 +_080832B4: .4byte 0x06006458 +_080832B8: .4byte 0x00008072 + 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, _08083330 + 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 + .align 2, 0 +_08083330: .4byte 0x020322a4 + 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, _080833D8 + 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 + .align 2, 0 +_080833D8: .4byte 0x020322a4 +_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, _08083414 + 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 + .align 2, 0 +_08083414: .4byte 0x020322a4 + thumb_func_end sub_80833F8 + + thumb_func_start sub_8083418 +sub_8083418: @ 8083418 + push {lr} + ldr r0, _08083444 + ldr r2, [r0] + ldr r0, _08083448 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 1 + ldr r3, _0808344C + 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 + .align 2, 0 +_08083444: .4byte 0x03005d8c +_08083448: .4byte 0x020322a4 +_0808344C: .4byte 0x000009bc + thumb_func_end sub_8083418 + + thumb_func_start sub_8083450 +sub_8083450: @ 8083450 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, _08083474 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0808346A + b _08083898 +_0808346A: + lsls r0, 2 + ldr r1, _08083478 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08083474: .4byte 0x020322a4 +_08083478: .4byte _0808347C + .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, _08083510 + ldr r0, [r4] + adds r0, 0x46 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08083514 + adds r0, r1 + bl obj_delete_and_free_tiles + 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 + .align 2, 0 +_08083510: .4byte 0x020322a4 +_08083514: .4byte 0x02020630 +_08083518: + ldr r4, _08083760 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xA8 + bl sub_81DB35C + 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, _08083764 + 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 decimal_int_to_string + ldr r0, [r7] + adds r0, 0x9F + ldr r1, _08083768 + bl gf_strcat + ldr r0, [r7] + adds r0, 0x9F + ldr r1, _0808376C + bl gf_strcat + ldr r0, [r7] + adds r0, 0x9F + lsls r4, r5, 3 + subs r4, r5 + lsls r4, 2 + ldr r3, _08083770 + adds r1, r4, r3 + bl gf_strcat + 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 gf_strcpy + ldr r0, [r7] + adds r0, 0x9F + ldr r2, _08083774 + adds r4, r2 + ldrb r1, [r4, 0x1A] + bl sub_8009308 + ldr r0, [r7] + adds r0, 0x9F + ldr r1, _08083778 + bl gf_strcat + 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, _0808377C + 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, _08083764 + 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 decimal_int_to_string + ldr r0, [r6] + adds r0, 0x9F + ldr r1, _08083768 + bl gf_strcat + 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 decimal_int_to_string + ldr r0, [r6] + adds r0, 0x9F + ldr r1, [sp, 0x48] + bl gf_strcat + ldr r0, [r6] + adds r0, 0x9F + ldr r1, _08083780 + bl gf_strcat + ldr r1, [r6] + adds r1, 0x9F + movs r0, 0x1 + movs r2, 0xA8 + bl sub_81DB368 + 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, _08083784 + 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 decimal_int_to_string + ldr r0, [r6] + adds r0, 0x9F + ldr r1, _08083788 + bl gf_strcat + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, [r6] + adds r0, 0x9F + ldr r1, _0808378C + bl gf_strcat + ldr r1, [r6] + adds r1, 0x9F + movs r0, 0x1 + movs r2, 0xA8 + bl sub_81DB368 + 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 Window_CopyToVram + b _08083898 + .align 2, 0 +_08083760: .4byte 0x083398f5 +_08083764: .4byte 0x020322a4 +_08083768: .4byte 0x08339941 +_0808376C: .4byte 0x085e8d5e +_08083770: .4byte 0x020229f0 +_08083774: .4byte 0x020229e8 +_08083778: .4byte 0x08339914 +_0808377C: .4byte 0x0833992e +_08083780: .4byte 0x0833993c +_08083784: .4byte 0x0833991b +_08083788: .4byte 0x08339921 +_0808378C: .4byte 0x08339928 +_08083790: + ldr r0, _080837A4 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808379E + b _08083898 +_0808379E: + ldr r1, [r4] + b _08083854 + .align 2, 0 +_080837A4: .4byte 0x030022c0 +_080837A8: + movs r0, 0x5 + movs r1, 0x1 + bl sub_8198070 + movs r6, 0 + add r7, sp, 0x40 + ldr r5, _0808385C +_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 Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram +_080837EA: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080837B6 + bl sub_8081E20 + ldr r4, _0808385C + 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, _08083860 + movs r1, 0x6 + bl AddTask + bl sub_80EECEC + ldr r0, _08083864 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 + adds r0, r7, 0 + bl sub_8136F2C + ldr r1, [r4] + ldr r3, _08083868 + adds r2, r1, r3 + movs r0, 0 + strh r0, [r2] +_08083854: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08083898 + .align 2, 0 +_0808385C: .4byte 0x020322a4 +_08083860: .4byte sub_8083F3C + 1 +_08083864: .4byte 0x0203ce7c +_08083868: .4byte 0x000011b8 +_0808386C: + ldr r4, [r4] + ldr r0, _08083894 + 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 sub_8083418 + movs r0, 0x1 + b _0808389A + .align 2, 0 +_08083894: .4byte 0x000011b8 +_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 sub_8083450 + + 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, _08083940 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl gf_strcpy + ldr r1, _08083944 + adds r0, r6, 0 + bl gf_strcat + ldr r1, _08083948 + adds r0, r6, 0 + bl gf_strcat + 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, _0808394C + adds r0, r6, 0 + bl gf_strcat + mov r0, sp + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r6, 0 + mov r1, sp + bl gf_strcat + ldr r1, _08083950 + adds r0, r6, 0 + bl gf_strcat + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r6, 0 + mov r1, sp + bl gf_strcat + ldr r1, _08083954 + adds r0, r6, 0 + bl gf_strcat + ldr r1, _08083958 + adds r0, r6, 0 + bl gf_strcat + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08083940: .4byte 0x085b262c +_08083944: .4byte 0x0833979d +_08083948: .4byte 0x08339943 +_0808394C: .4byte 0x0833994f +_08083950: .4byte 0x0833995d +_08083954: .4byte 0x08339970 +_08083958: .4byte 0x0833979b + 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, _080839D0 + ldr r0, [r2] + adds r0, 0x7C + adds r1, r2, 0 + add r3, sp, 0x4 + mov r10, r3 + b _080839E4 + .align 2, 0 +_080839D0: .4byte 0x020322a4 +_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, _08083AAC + 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, _08083AB0 + ldrb r0, [r0] + cmp r0, 0 + bne _08083AB4 + movs r3, 0 + b _08083ABC + .align 2, 0 +_08083AAC: .4byte 0x020322a4 +_08083AB0: .4byte 0x03003124 +_08083AB4: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r3, r0, 24 +_08083ABC: + movs r5, 0 + ldr r1, _08083B04 + 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 + .align 2, 0 +_08083B04: .4byte 0x020322a4 + 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, _08083B2C + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x6 + bls _08083B22 + b _08083E12 +_08083B22: + lsls r0, 2 + ldr r1, _08083B30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08083B2C: .4byte 0x020322a4 +_08083B30: .4byte _08083B34 + .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, _08083DA8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xA8 + bl sub_81DB35C + 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, _08083DAC + mov r8, r1 + mov r0, r8 + movs r1, 0x80 + movs r2, 0x34 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r7, _08083DB0 + 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, _08083DB4 + adds r0, r6 + movs r1, 0x3 + bl obj_anim_image_start + 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, _08083DB8 + str r4, [r0] + mov r0, r8 + movs r1, 0xA0 + movs r2, 0x34 + movs r3, 0 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + 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 obj_anim_image_start + 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 decimal_int_to_string + ldr r0, [r7] + adds r0, 0x9F + ldr r1, _08083DBC + bl gf_strcat + ldr r0, [r7] + adds r0, 0x9F + ldr r1, _08083DC0 + bl gf_strcat + ldr r0, [r7] + adds r0, 0x9F + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + ldr r2, _08083DC4 + adds r1, r2 + bl gf_strcat + 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 decimal_int_to_string + 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 decimal_int_to_string + 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 decimal_int_to_string + 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 Window_WriteStandardTileMap + movs r0, 0x5 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08083DB0 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + b _08083DF8 + .align 2, 0 +_08083DA8: .4byte 0x08339947 +_08083DAC: .4byte 0x08339b40 +_08083DB0: .4byte 0x020322a4 +_08083DB4: .4byte 0x02020630 +_08083DB8: .4byte nullsub_12 + 1 +_08083DBC: .4byte 0x08339941 +_08083DC0: .4byte 0x085e8d5e +_08083DC4: .4byte 0x020229f0 +_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, _08083E00 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08083E12 + movs r0, 0x5 + bl audio_play + ldr r0, _08083E04 + ldr r1, [r0] +_08083DF8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08083E12 + .align 2, 0 +_08083E00: .4byte 0x030022c0 +_08083E04: .4byte 0x020322a4 +_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 sub_8083E24 +sub_8083E24: @ 8083E24 + push {r4-r7,lr} + sub sp, 0x34 + ldr r0, _08083F1C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + ldr r5, _08083F20 + add r0, sp, 0x2C + bl Window_AddFromTemplate + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r6, _08083F24 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0x90 + bl sub_81DB35C + 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, _08083F28 + 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, _08083F2C + ldr r0, [r0] + lsls r1, r6, 1 + ldr r2, _08083F30 + 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 decimal_int_to_string + adds r5, r0, 0 + ldr r1, _08083F34 + bl gf_strcat + 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 decimal_int_to_string + adds r5, r0, 0 + ldr r1, _08083F38 + bl gf_strcat + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x8C + bl sub_81DB368 + adds r3, r0, 0 + ldr r4, _08083F20 + 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 Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x34 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08083F1C: .4byte 0x08339d14 +_08083F20: .4byte 0x0203ab74 +_08083F24: .4byte 0x085ee44f +_08083F28: .4byte 0x085ee473 +_08083F2C: .4byte 0x03005d8c +_08083F30: .4byte 0x000009bc +_08083F34: .4byte 0x08339941 +_08083F38: .4byte 0x0833993c + thumb_func_end sub_8083E24 + + thumb_func_start sub_8083F3C +sub_8083F3C: @ 8083F3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _08083F88 + 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, _08083F8C + 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, _08083F90 + 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 + .align 2, 0 +_08083F88: .4byte 0x03005e00 +_08083F8C: .4byte 0x0000016f +_08083F90: .4byte 0x020322a4 + 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, _0808404C + ldrb r0, [r0] + cmp r0, 0 + beq _080840C4 + ldr r0, _08084050 + 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, _08084054 + adds r1, r5 + adds r0, r7, 0 + bl gf_strcpy + 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 + .align 2, 0 +_0808404C: .4byte 0x03003124 +_08084050: .4byte 0x020322a4 +_08084054: .4byte 0x020229f0 +_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, _080840C0 + adds r1, r5 + adds r0, r7, 0 + bl gf_strcpy + 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 + .align 2, 0 +_080840C0: .4byte 0x020229f0 +_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 Window_FastFillPixels +_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 sub_8199EEC + 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 Window_WriteStandardTileMap + movs r0, 0x4 + movs r1, 0x3 + bl Window_CopyToVram + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _080841DA +_080841C6: + movs r0, 0x4 + bl a_pressed_maybe + 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, _08084200 + movs r0, 0 + strb r0, [r1] + ldr r2, _08084204 + 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 + .align 2, 0 +_08084200: .4byte 0x03000e08 +_08084204: .4byte 0x03005d90 + thumb_func_end reset_playtime + + thumb_func_start set_max_playtime_if_appropriate +set_max_playtime_if_appropriate: @ 8084208 + push {lr} + ldr r1, _08084224 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _08084228 + ldr r0, [r0] + ldrh r1, [r0, 0xE] + ldr r0, _0808422C + cmp r1, r0 + bls _08084220 + bl set_max_playtime +_08084220: + pop {r0} + bx r0 + .align 2, 0 +_08084224: .4byte 0x03000e08 +_08084228: .4byte 0x03005d90 +_0808422C: .4byte 0x000003e7 + thumb_func_end set_max_playtime_if_appropriate + + thumb_func_start sub_8084230 +sub_8084230: @ 8084230 + ldr r1, _08084238 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08084238: .4byte 0x03000e08 + thumb_func_end sub_8084230 + + thumb_func_start gametime_increment +gametime_increment: @ 808423C + push {lr} + ldr r0, _08084298 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08084294 + ldr r2, _0808429C + 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, _080842A0 + cmp r1, r0 + bls _08084294 + bl set_max_playtime +_08084294: + pop {r0} + bx r0 + .align 2, 0 +_08084298: .4byte 0x03000e08 +_0808429C: .4byte 0x03005d90 +_080842A0: .4byte 0x03e70000 + thumb_func_end gametime_increment + + thumb_func_start set_max_playtime +set_max_playtime: @ 80842A4 + ldr r1, _080842C0 + movs r0, 0x2 + strb r0, [r1] + ldr r2, _080842C4 + ldr r3, [r2] + ldr r0, _080842C8 + 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 + .align 2, 0 +_080842C0: .4byte 0x03000e08 +_080842C4: .4byte 0x03005d90 +_080842C8: .4byte 0x000003e7 + thumb_func_end set_max_playtime + + thumb_func_start write_word_to_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 get_trainer_id_hi + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + ldr r0, _08084338 + ldr r1, [r0] + adds r1, 0xA + adds r0, r4, 0 + bl write_word_to_mem + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08084338: .4byte 0x03005d90 + thumb_func_end set_player_trainer_id + + thumb_func_start init_options +init_options: @ 808433C + ldr r3, _0808438C + 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 + .align 2, 0 +_0808438C: .4byte 0x03005d90 + thumb_func_end init_options + + thumb_func_start sub_8084390 +sub_8084390: @ 8084390 + push {r4,lr} + ldr r1, _080843B8 + movs r0, 0 + strb r0, [r1] + ldr r4, _080843BC + 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 + .align 2, 0 +_080843B8: .4byte 0x030060b0 +_080843BC: .4byte 0x03005d90 + 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, _080843F4 + mov r12, r0 + ldr r4, _080843F8 + ldr r3, _080843FC +_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 + .align 2, 0 +_080843F4: .4byte 0x03005d8c +_080843F8: .4byte 0x00002e90 +_080843FC: .4byte 0x08339d1c + 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, _08084438 + ldr r1, [r4] + ldr r0, _0808443C + adds r1, r0 + ldr r2, _08084440 + mov r0, sp + bl CpuSet + ldr r0, [r4] + ldr r1, _08084444 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, _08084448 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08084438: .4byte 0x03005d90 +_0808443C: .4byte 0x0000064c +_08084440: .4byte 0x05000238 +_08084444: .4byte 0x00000ee1 +_08084448: .4byte 0x00000ee9 + 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, _0808449C + 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 + .align 2, 0 +_0808449C: .4byte 0x020322d4 + thumb_func_end sub_808447C + + thumb_func_start new_game_init_data +new_game_init_data: @ 80844A0 + push {r4,r5,lr} + ldr r0, _080845AC + ldrh r0, [r0] + cmp r0, 0 + beq _080844AE + cmp r0, 0x2 + bne _080844B2 +_080844AE: + bl sub_802F3F8 +_080844B2: + ldr r1, _080845B0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, _080845B4 + 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 sub_80EC21C + bl sub_80E8B28 + bl sub_80E1794 + ldr r4, _080845B8 + ldr r0, [r4] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, _080845BC + bl encrypt_money + movs r0, 0 + bl sub_8145C58 + bl sub_80D766C + bl sub_80847A8 + bl sub_80843C0 + bl sub_813C1F8 + bl sub_80F9A7C + bl sub_80F9AD4 + ldr r0, _080845C0 + strb r5, [r0] + bl zero_player_party_data + bl sub_80C7770 + bl sub_8161B34 + bl sub_8161B60 + ldr r0, [r4] + ldr r1, _080845C4 + 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, _080845C8 + 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 + .align 2, 0 +_080845AC: .4byte 0x03006210 +_080845B0: .4byte 0x020322d4 +_080845B4: .4byte 0x03005d90 +_080845B8: .4byte 0x03005d8c +_080845BC: .4byte 0x00000bb8 +_080845C0: .4byte 0x020244e9 +_080845C4: .4byte 0x00000496 +_080845C8: .4byte 0x082715de + thumb_func_end new_game_init_data + + 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, _08084618 + ldr r1, [r4] + movs r0, 0xF6 + lsls r0, 1 + adds r1, r0 + ldr r6, _0808461C + 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 + .align 2, 0 +_08084618: .4byte 0x03005d90 +_0808461C: .4byte 0x01000008 + thumb_func_end sub_80845CC + + thumb_func_start sub_8084620 +sub_8084620: @ 8084620 + push {r4,lr} + ldr r0, _08084658 + bl script_env_2_execute_new_script + ldr r0, _0808465C + ldr r4, [r0] + movs r0, 0x92 + lsls r0, 3 + adds r4, r0 + adds r0, r4, 0 + bl decrypt_money + adds r1, r0, 0 + lsrs r1, 1 + adds r0, r4, 0 + bl encrypt_money + 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 + .align 2, 0 +_08084658: .4byte 0x08271857 +_0808465C: .4byte 0x03005d8c + 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, _08084688 + bl flag_clear + ldr r0, _0808468C + bl flag_clear + ldr r0, _08084690 + bl flag_clear + ldr r0, _08084694 + bl flag_clear + ldr r0, _08084698 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_08084688: .4byte 0x0000088b +_0808468C: .4byte 0x0000088d +_08084690: .4byte 0x0000088c +_08084694: .4byte 0x00000889 +_08084698: .4byte 0x00000888 + thumb_func_end flag_var_implications_of_teleport_ + + thumb_func_start new_game +new_game: @ 808469C + push {lr} + bl player_avatar_init_params_reset + ldr r0, _080846CC + bl flag_clear + ldr r0, _080846D0 + bl flag_clear + ldr r0, _080846D4 + bl flag_clear + ldr r0, _080846D8 + bl flag_clear + ldr r0, _080846DC + bl flag_clear + ldr r0, _080846E0 + bl script_env_2_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080846CC: .4byte 0x0000088b +_080846D0: .4byte 0x0000088d +_080846D4: .4byte 0x0000088c +_080846D8: .4byte 0x00000889 +_080846DC: .4byte 0x00000888 +_080846E0: .4byte 0x08271862 + thumb_func_end new_game + + thumb_func_start flagmods_08054D70 +flagmods_08054D70: @ 80846E4 + push {lr} + bl player_avatar_init_params_reset + ldr r0, _0808470C + bl flag_clear + ldr r0, _08084710 + bl flag_clear + ldr r0, _08084714 + bl flag_clear + ldr r0, _08084718 + bl flag_clear + ldr r0, _0808471C + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0808470C: .4byte 0x0000088b +_08084710: .4byte 0x0000088d +_08084714: .4byte 0x0000088c +_08084718: .4byte 0x00000889 +_0808471C: .4byte 0x00000888 + thumb_func_end flagmods_08054D70 + + thumb_func_start sub_8084720 +sub_8084720: @ 8084720 + push {r4,lr} + bl player_avatar_init_params_reset + ldr r0, _0808476C + bl flag_clear + ldr r0, _08084770 + bl flag_clear + ldr r0, _08084774 + bl flag_clear + ldr r0, _08084778 + bl flag_clear + ldr r0, _0808477C + bl flag_clear + ldr r4, _08084780 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _08084764 + adds r0, r4, 0 + movs r1, 0 + bl var_set + ldr r0, _08084784 + movs r1, 0 + bl var_set +_08084764: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808476C: .4byte 0x0000088b +_08084770: .4byte 0x0000088d +_08084774: .4byte 0x0000088c +_08084778: .4byte 0x00000889 +_0808477C: .4byte 0x00000888 +_08084780: .4byte 0x00004039 +_08084784: .4byte 0x00004037 + thumb_func_end sub_8084720 + + thumb_func_start sub_8084788 +sub_8084788: @ 8084788 + push {lr} + ldr r0, _080847A4 + bl flag_clear + bl sub_8085B2C + bl wild_pokemon_reroll + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D00 + pop {r0} + bx r0 + .align 2, 0 +_080847A4: .4byte 0x0000088c + 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 +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, _080847E0 + cmp r1, r0 + bhi _080847E4 + adds r1, 0x1 + b _080847E6 + .align 2, 0 +_080847E0: .4byte 0x00fffffe +_080847E4: + ldr r1, _080847F4 +_080847E6: + adds r0, r4, 0 + bl sav12_xor_set +_080847EC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080847F4: .4byte 0x00ffffff + 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, _0808481C + ldr r2, [r0] + lsls r0, r1, 2 + ldr r1, _08084820 + adds r2, r1 + adds r2, r0 + ldr r0, _08084824 + ldr r1, [r0] + adds r1, 0xAC + ldr r0, [r2] + ldr r1, [r1] + eors r0, r1 + b _0808482A + .align 2, 0 +_0808481C: .4byte 0x03005d8c +_08084820: .4byte 0x0000159c +_08084824: .4byte 0x03005d90 +_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, _08084858 + ldr r1, [r0] + lsls r0, r2, 2 + ldr r2, _0808485C + adds r1, r2 + adds r1, r0 + ldr r0, _08084860 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + eors r0, r3 + str r0, [r1] +_08084854: + pop {r0} + bx r0 + .align 2, 0 +_08084858: .4byte 0x03005d8c +_0808485C: .4byte 0x0000159c +_08084860: .4byte 0x03005d90 + 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, _0808488C +_0808486C: + lsls r1, r4, 2 + ldr r0, _08084890 + 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 + .align 2, 0 +_0808488C: .4byte 0x03005d8c +_08084890: .4byte 0x0000159c + thumb_func_end sub_8084864 + + thumb_func_start sub_8084894 +sub_8084894: @ 8084894 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r5, _080848D4 + ldr r1, [r5] + movs r4, 0xC7 + lsls r4, 4 + adds r1, r4 + ldr r2, _080848D8 + mov r0, sp + bl CpuSet + ldr r0, _080848DC + 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 + .align 2, 0 +_080848D4: .4byte 0x03005d8c +_080848D8: .4byte 0x05000180 +_080848DC: .4byte 0x02037318 + thumb_func_end sub_8084894 + + thumb_func_start sub_80848E0 +sub_80848E0: @ 80848E0 + push {lr} + ldr r0, _08084908 + ldr r1, [r0, 0x4] + ldr r0, _0808490C + 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 + .align 2, 0 +_08084908: .4byte 0x02037318 +_0808490C: .4byte 0x03005d8c + thumb_func_end sub_80848E0 + + thumb_func_start sub_8084910 +sub_8084910: @ 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, _08084938 + 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 + .align 2, 0 +_08084938: .4byte 0x03005d8c +_0808493C: + adds r3, 0x18 + adds r1, 0x1 + cmp r1, 0x3F + ble _0808492A +_08084944: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8084910 + + thumb_func_start sub_808494C +sub_808494C: @ 808494C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _0808496C + 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 + .align 2, 0 +_0808496C: .4byte 0x03005d8c +_08084970: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, 0x3F + ble _08084962 +_08084978: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808494C + + 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, _080849A4 + ldr r0, [r4] + bl copy_map_tileset1_tileset2_to_vram + ldr r0, [r4] + bl apply_map_tileset1_tileset2_palette + bl cur_mapdata_full_redraw + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080849A4: .4byte 0x02037318 + thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw + + thumb_func_start get_mapdata_header +get_mapdata_header: @ 80849A8 + push {lr} + ldr r0, _080849B8 + ldr r0, [r0] + ldrh r1, [r0, 0x32] + cmp r1, 0 + bne _080849BC + movs r0, 0 + b _080849C6 + .align 2, 0 +_080849B8: .4byte 0x03005d8c +_080849BC: + ldr r0, _080849CC + subs r1, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_080849C6: + pop {r1} + bx r1 + .align 2, 0 +_080849CC: .4byte 0x08481dd4 + thumb_func_end get_mapdata_header + + thumb_func_start warp_shift +warp_shift: @ 80849D0 + ldr r3, _080849FC + ldr r0, _08084A00 + ldr r2, [r0] + ldr r0, [r2, 0x4] + ldr r1, [r2, 0x8] + str r0, [r3] + str r1, [r3, 0x4] + ldr r0, _08084A04 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2, 0x4] + str r1, [r2, 0x8] + ldr r2, _08084A08 + ldr r0, _08084A0C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, _08084A10 + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_080849FC: .4byte 0x020322dc +_08084A00: .4byte 0x03005d8c +_08084A04: .4byte 0x020322e4 +_08084A08: .4byte 0x020322ec +_08084A0C: .4byte 0x08339d3c +_08084A10: .4byte 0x020322f4 + thumb_func_end warp_shift + + thumb_func_start set_warp2_warp3_to_neg_1 +set_warp2_warp3_to_neg_1: @ 8084A14 + ldr r2, _08084A28 + ldr r0, _08084A2C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, _08084A30 + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_08084A28: .4byte 0x020322ec +_08084A2C: .4byte 0x08339d3c +_08084A30: .4byte 0x020322f4 + thumb_func_end set_warp2_warp3_to_neg_1 + + thumb_func_start warp_set +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 +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 +get_mapheader_by_bank_and_number: @ 8084A90 + lsls r0, 16 + lsls r1, 16 + ldr r2, _08084AA4 + lsrs r0, 14 + adds r0, r2 + ldr r0, [r0] + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + bx lr + .align 2, 0 +_08084AA4: .4byte 0x08486578 + thumb_func_end get_mapheader_by_bank_and_number + + thumb_func_start warp1_get_mapheader +warp1_get_mapheader: @ 8084AA8 + push {lr} + ldr r1, _08084AC8 + 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 + .align 2, 0 +_08084AC8: .4byte 0x020322e4 + thumb_func_end warp1_get_mapheader + + thumb_func_start 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, _08084B10 + ldr r4, _08084B14 + ldrb r0, [r4, 0x14] + strh r0, [r1] + ldr r5, _08084B18 + 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 + .align 2, 0 +_08084B10: .4byte 0x020322fc +_08084B14: .4byte 0x02037318 +_08084B18: .4byte 0x03005d8c + 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, _08084B54 + ldr r0, _08084B58 + 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 + .align 2, 0 +_08084B54: .4byte 0x02037318 +_08084B58: .4byte 0x03005d8c + thumb_func_end set_current_map_header_from_sav1 + + thumb_func_start update_camera_pos_from_warpid +update_camera_pos_from_warpid: @ 8084B5C + push {r4,r5,lr} + ldr r0, _08084B8C + ldr r2, [r0] + movs r1, 0x6 + ldrsb r1, [r2, r1] + adds r4, r0, 0 + cmp r1, 0 + blt _08084B94 + ldr r3, _08084B90 + 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 + .align 2, 0 +_08084B8C: .4byte 0x03005d8c +_08084B90: .4byte 0x02037318 +_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, _08084BD4 + 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 + .align 2, 0 +_08084BD4: .4byte 0x02037318 + 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 +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, _08084C24 + 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 + .align 2, 0 +_08084C24: .4byte 0x020322e4 + thumb_func_end warp1_set + + thumb_func_start warp1_set_2 +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 +saved_warp2_set: @ 8084C48 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _08084C78 + 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 + .align 2, 0 +_08084C78: .4byte 0x03005d8c + 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, _08084CB0 + 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 + .align 2, 0 +_08084CB0: .4byte 0x03005d8c + 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, _08084CC4 + ldr r0, _08084CC8 + ldr r0, [r0] + ldr r1, [r0, 0x18] + ldr r0, [r0, 0x14] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_08084CC4: .4byte 0x020322e4 +_08084CC8: .4byte 0x03005d8c + thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 + + thumb_func_start sub_8084CCC +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 +copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 + ldr r2, _08084D14 + ldr r0, _08084D18 + ldr r0, [r0] + ldr r1, [r0, 0x20] + ldr r0, [r0, 0x1C] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_08084D14: .4byte 0x020322e4 +_08084D18: .4byte 0x03005d8c + 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, _08084D58 + 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 + .align 2, 0 +_08084D58: .4byte 0x03005d8c + 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, _08084DCC + 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, _08084DD0 + 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 + .align 2, 0 +_08084DCC: .4byte 0x020322e4 +_08084DD0: .4byte 0x03005d8c + 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, _08084E10 + 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 + .align 2, 0 +_08084E10: .4byte 0x03005d8c + thumb_func_end sub_8084DD4 + + thumb_func_start sub_8084E14 +sub_8084E14: @ 8084E14 + ldr r2, _08084E24 + ldr r0, _08084E28 + ldr r0, [r0] + ldr r1, [r0, 0x28] + ldr r0, [r0, 0x24] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_08084E24: .4byte 0x020322e4 +_08084E28: .4byte 0x03005d8c + 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, _08084E64 + 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 + .align 2, 0 +_08084E64: .4byte 0x020322ec + thumb_func_end sub_8084E2C + + thumb_func_start warp1_set_to_warp2 +warp1_set_to_warp2: @ 8084E68 + ldr r2, _08084E78 + ldr r0, _08084E7C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_08084E78: .4byte 0x020322e4 +_08084E7C: .4byte 0x020322ec + 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, _08084EB8 + 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 + .align 2, 0 +_08084EB8: .4byte 0x020322f4 + 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, _08084EE4 + adds r0, r4, 0 + bl warp_data_is_not_neg_1 + cmp r0, 0x1 + bne _08084EF0 + ldr r2, _08084EE8 + ldr r0, _08084EEC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + b _08084F0A + .align 2, 0 +_08084EE4: .4byte 0x020322f4 +_08084EE8: .4byte 0x020322e4 +_08084EEC: .4byte 0x020322dc +_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, _08084F24 + ldr r0, _08084F28 + ldr r0, [r0] + ldr r1, [r0, 0x10] + ldr r0, [r0, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_08084F24: .4byte 0x020322e4 +_08084F28: .4byte 0x03005d8c + 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, _08084F68 + 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 + .align 2, 0 +_08084F68: .4byte 0x03005d8c + 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, _08084FA8 + 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 + .align 2, 0 +_08084FA8: .4byte 0x03005d8c + thumb_func_end sub_8084F6C + + thumb_func_start sub_8084FAC +sub_8084FAC: @ 8084FAC + ldr r0, _08084FBC + ldr r2, [r0] + ldr r0, [r2, 0x14] + ldr r1, [r2, 0x18] + str r0, [r2, 0xC] + str r1, [r2, 0x10] + bx lr + .align 2, 0 +_08084FBC: .4byte 0x03005d8c + 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, _08084FD4 + ldr r0, [r0, 0xC] + ldr r3, [r0] + ldr r1, [r0, 0x4] + cmp r1, 0 + bne _08084FDC + b _08084FF0 + .align 2, 0 +_08084FD4: .4byte 0x02037318 +_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, _08085044 + bl warp_data_is_not_neg_1 + cmp r0, 0 + beq _08085048 + movs r0, 0 + b _0808504E + .align 2, 0 +_08085044: .4byte 0x020322ec +_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, _08085158 + 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 sub_8084894 + 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_x2C + bl mapheader_run_script_with_tag_x3 + bl sub_8087D54 + 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, _08085158 + ldrb r0, [r2, 0x14] + cmp r0, 0x3A + bne _0808514C + ldr r1, _0808515C + ldrh r1, [r1] + cmp r0, r1 + beq _08085150 +_0808514C: + bl sub_80D47E4 +_08085150: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08085158: .4byte 0x02037318 +_0808515C: .4byte 0x020322fc + 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, _08085184 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080851A2 + ldr r0, _08085188 + ldrh r1, [r0, 0x12] + ldr r0, _0808518C + cmp r1, r0 + bne _08085190 + bl sub_81AA1D8 + b _080851A2 + .align 2, 0 +_08085184: .4byte 0x020322d8 +_08085188: .4byte 0x02037318 +_0808518C: .4byte 0x00000169 +_08085190: + bl sub_81D6074 + cmp r0, 0 + beq _0808519E + bl sub_81D5DF8 + b _080851A2 +_0808519E: + bl sub_8084894 +_080851A2: + ldr r4, _08085224 + 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, _08085228 + 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, _0808522C + bl flag_clear +_08085200: + bl update_sav1_flash_used_on_map + bl sav1_reset_x2C + 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, _08085230 + cmp r1, r0 + bne _08085234 + movs r0, 0 + bl sub_8087DAC + b _08085246 + .align 2, 0 +_08085224: .4byte 0x02037318 +_08085228: .4byte 0x03005d8c +_0808522C: .4byte 0x00000888 +_08085230: .4byte 0x00000169 +_08085234: + bl sub_81D6074 + cmp r0, 0 + beq _08085242 + bl sub_8087DE4 + b _08085246 +_08085242: + bl sub_8087D54 +_08085246: + cmp r7, 0x1 + beq _0808525E + cmp r6, 0 + beq _0808525E + ldr r1, _08085264 + ldr r0, [r1] + ldr r1, [r1, 0x4] + bl per_step_2 + movs r0, 0x1 + bl sub_80E9238 +_0808525E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08085264: .4byte 0x03005dc0 + thumb_func_end mli0_load_map + + thumb_func_start player_avatar_init_params_reset +player_avatar_init_params_reset: @ 8085268 + ldr r1, _08085274 + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r0, [r1] + bx lr + .align 2, 0 +_08085274: .4byte 0x02032300 + 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__sp1AA + ldr r4, _08085294 + strb r0, [r4, 0x1] + movs r0, 0x2 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _08085298 + movs r0, 0x2 + b _080852CA + .align 2, 0 +_08085294: .4byte 0x02032300 +_08085298: + movs r0, 0x4 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _080852A8 + movs r0, 0x4 + b _080852CA +_080852A8: + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _080852B8 + movs r0, 0x8 + b _080852CA +_080852B8: + movs r0, 0x10 + bl walkrun_bitfield_and_r0 + 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, _08085320 + 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, _08085324 + 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, _08085328 + ands r7, r1 + orrs r7, r0 + str r7, [r6] + adds r0, r6, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08085320: .4byte 0x02032300 +_08085324: .4byte 0xffffff00 +_08085328: .4byte 0xffff00ff + 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, _08085350 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08085382 +_08085348: + cmp r4, 0x5 + bne _08085354 + movs r0, 0x10 + b _08085384 + .align 2, 0 +_08085350: .4byte 0x0000088d +_08085354: + lsls r0, r5, 24 + lsrs r0, 24 + bl is_tile_grass_maybe + 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, _080853EC + bl flag_check + 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 is_tile_x65_warp_arrow_down + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080853F0 +_080853E8: + movs r0, 0x2 + b _08085448 + .align 2, 0 +_080853EC: .4byte 0x0000088d +_080853F0: + adds r0, r5, 0 + bl sub_8088FD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl is_tile_x63_warp_arrow_left + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085410 +_0808540C: + movs r0, 0x4 + b _08085448 +_08085410: + adds r0, r5, 0 + bl is_tile_x62_warp_arrow_right + 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 is_tile_x61_warp + 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, _08085470 + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x7 + movs r2, 0x2 + ldrsh r1, [r1, r2] + adds r1, 0x7 + bl cur_mapdata_block_get_role_at + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_08085470: .4byte 0x03005d8c + 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, _08085488 + ldrb r1, [r0, 0x1A] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808548C + movs r0, 0x1 + b _0808548E + .align 2, 0 +_08085488: .4byte 0x02037318 +_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, _080854A8 + ldrb r1, [r0, 0x15] + cmp r1, 0 + bne _080854B0 + ldr r0, _080854AC + ldr r0, [r0] + adds r0, 0x30 + strb r1, [r0] + b _080854DE + .align 2, 0 +_080854A8: .4byte 0x02037318 +_080854AC: .4byte 0x03005d8c +_080854B0: + ldr r0, _080854C8 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080854D0 + ldr r0, _080854CC + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0x1 + strb r1, [r0] + b _080854DE + .align 2, 0 +_080854C8: .4byte 0x00000888 +_080854CC: .4byte 0x03005d8c +_080854D0: + ldr r0, _080854E4 + ldr r1, [r0] + ldr r0, _080854E8 + ldr r0, [r0] + subs r0, 0x1 + adds r1, 0x30 + strb r0, [r1] +_080854DE: + pop {r0} + bx r0 + .align 2, 0 +_080854E4: .4byte 0x03005d8c +_080854E8: .4byte 0x0854fe78 + 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, _0808550C + ldr r0, [r0] + cmp r1, r0 + ble _080854FE +_080854FC: + movs r1, 0 +_080854FE: + ldr r0, _08085510 + ldr r0, [r0] + adds r0, 0x30 + strb r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_0808550C: .4byte 0x0854fe78 +_08085510: .4byte 0x03005d8c + thumb_func_end sub_80854EC + + thumb_func_start sav1_get_flash_used_on_map +sav1_get_flash_used_on_map: @ 8085514 + ldr r0, _08085520 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08085520: .4byte 0x03005d8c + thumb_func_end sav1_get_flash_used_on_map + + thumb_func_start sub_8085524 +sub_8085524: @ 8085524 + push {lr} + ldr r1, _08085538 + ldr r1, [r1] + strh r0, [r1, 0x32] + bl get_mapdata_header + ldr r1, _0808553C + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08085538: .4byte 0x03005d8c +_0808553C: .4byte 0x02037318 + thumb_func_end sub_8085524 + + thumb_func_start sub_8085540 +sub_8085540: @ 8085540 + ldr r1, _08085548 + strb r0, [r1] + bx lr + .align 2, 0 +_08085548: .4byte 0x020322d8 + thumb_func_end sub_8085540 + + thumb_func_start sub_808554C +sub_808554C: @ 808554C + ldr r0, _08085554 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08085554: .4byte 0x020322d8 + thumb_func_end sub_808554C + + thumb_func_start sub_8085558 +sub_8085558: @ 8085558 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080855A4 + bl flag_check + 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, _080855A8 + bl var_get + 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 + .align 2, 0 +_080855A4: .4byte 0x0000088a +_080855A8: .4byte 0x0000405e +_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, _080855DC + bl var_get + 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 + .align 2, 0 +_080855DC: .4byte 0x000040ca +_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, _0808560C + bl var_get + 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 + .align 2, 0 +_0808560C: .4byte 0x000040b3 +_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, _08085650 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _0808564C + adds r0, r4, 0 + bl var_get + 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 + .align 2, 0 +_08085650: .4byte 0x0000405d +_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, _08085670 + b _080856CE + .align 2, 0 +_08085670: .4byte 0x0000ffff +_08085674: + adds r0, r4, 0 + bl sub_8085558 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0808568C + ldr r0, _08085688 + b _080856CE + .align 2, 0 +_08085688: .4byte 0x000001bb +_0808568C: + adds r0, r4, 0 + bl sub_8085618 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080856A4 + ldr r0, _080856A0 + b _080856CE + .align 2, 0 +_080856A0: .4byte 0x000001b9 +_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, _080856F4 + 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, _080856F8 + b _08085730 + .align 2, 0 +_080856F4: .4byte 0x03005d8c +_080856F8: .4byte 0x00000199 +_080856FC: + ldr r4, _08085714 + ldr r0, [r4] + adds r0, 0x4 + bl warp_target_get_music + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08085718 + cmp r1, r0 + beq _0808571C + adds r0, r1, 0 + b _08085730 + .align 2, 0 +_08085714: .4byte 0x03005d8c +_08085718: .4byte 0x00007fff +_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, _08085750 + bl warp_target_get_music + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08085754 + cmp r1, r0 + beq _08085758 + adds r0, r1, 0 + b _08085774 + .align 2, 0 +_08085750: .4byte 0x020322e4 +_08085754: .4byte 0x00007fff +_08085758: + ldr r0, _0808576C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + beq _08085770 + subs r0, 0x6E + b _08085774 + .align 2, 0 +_0808576C: .4byte 0x03005d8c +_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, _080857A8 + cmp r4, r0 + beq _080857D6 + ldr r0, _080857AC + cmp r4, r0 + beq _080857D6 + ldr r0, _080857B0 + ldr r1, [r0] + ldrh r0, [r1, 0x2C] + cmp r0, 0 + beq _080857B4 + adds r4, r0, 0 + b _080857D6 + .align 2, 0 +_080857A8: .4byte 0x000001bb +_080857AC: .4byte 0x0000ffff +_080857B0: .4byte 0x03005d8c +_080857B4: + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080857C8 + ldr r4, _080857C4 + b _080857D6 + .align 2, 0 +_080857C4: .4byte 0x0000019b +_080857C8: + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _080857D6 + ldr r4, _080857F0 +_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 + .align 2, 0 +_080857F0: .4byte 0x0000016d + thumb_func_end sub_8085784 + + thumb_func_start sav1_set_x2C +sav1_set_x2C: @ 80857F4 + ldr r1, _080857FC + ldr r1, [r1] + strh r0, [r1, 0x2C] + bx lr + .align 2, 0 +_080857FC: .4byte 0x03005d8c + thumb_func_end sav1_set_x2C + + thumb_func_start sav1_reset_x2C +sav1_reset_x2C: @ 8085800 + ldr r0, _0808580C + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2C] + bx lr + .align 2, 0 +_0808580C: .4byte 0x03005d8c + thumb_func_end sav1_reset_x2C + + thumb_func_start sub_8085810 +sub_8085810: @ 8085810 + push {r4-r6,lr} + ldr r0, _08085874 + bl flag_check + 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, _08085878 + cmp r4, r0 + beq _08085856 + ldr r0, _0808587C + cmp r4, r0 + beq _08085856 + ldr r0, _08085880 + cmp r5, r0 + beq _08085890 + ldr r6, _08085884 + cmp r5, r6 + beq _08085890 + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _08085856 + adds r4, r6, 0 +_08085856: + cmp r4, r5 + beq _08085890 + movs r0, 0x6 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _08085888 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x4 + bl sub_80A2FBC + b _08085890 + .align 2, 0 +_08085874: .4byte 0x00004001 +_08085878: .4byte 0x000001bb +_0808587C: .4byte 0x0000ffff +_08085880: .4byte 0x0000019b +_08085884: .4byte 0x0000016d +_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, _080858EC + cmp r1, r0 + beq _080858E4 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80A2F88 +_080858E4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080858EC: .4byte 0x000001bb + 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, _08085984 + bl flag_check + 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, _08085988 + cmp r5, r0 + bne _08085972 + ldr r0, _0808598C + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _08085972 + ldr r0, _08085990 + ldr r0, [r0] + ldr r1, _08085994 + ldrh r2, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 3 + cmp r2, r0 + bne _08085972 + ldr r3, _08085998 + ldrh r0, [r3] + ands r1, r0 + cmp r1, r2 + bne _08085972 + ldr r1, [r3, 0x4] + ldr r0, _0808599C + 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 + .align 2, 0 +_08085984: .4byte 0x00004001 +_08085988: .4byte 0x0000016d +_0808598C: .4byte 0x000040ca +_08085990: .4byte 0x03005d8c +_08085994: .4byte 0x0000ffff +_08085998: .4byte 0x020322e4 +_0808599C: .4byte 0x0035001d + 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 player_get_pos_to + ldr r0, _08085A34 + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_tile_grass_maybe + 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, _08085A38 + 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 + .align 2, 0 +_08085A34: .4byte 0x02032306 +_08085A38: .4byte 0x02032304 + 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, _08085A5C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08085A5C: .4byte _08085A60 + .align 2, 0 +_08085A60: + .4byte _08085A74 + .4byte _08085A88 + .4byte _08085AA4 + .4byte _08085B0C + .4byte _08085B20 +_08085A74: + ldr r0, _08085A80 + ldrh r0, [r0] + cmp r0, 0 + bne _08085A84 + movs r0, 0x4 + b _08085B1E + .align 2, 0 +_08085A80: .4byte 0x02032304 +_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, _08085B08 + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _08085AB6 + adds r0, r4, 0 + bl sub_806B6D8 + 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 + .align 2, 0 +_08085B08: .4byte 0x020244ec +_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, _08085B54 + 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, _08085B58 + movs r0, 0x1 + strb r0, [r1] + bl sub_80B582C + b _08085B62 + .align 2, 0 +_08085B54: .4byte 0x03005d8c +_08085B58: .4byte 0x02032306 +_08085B5C: + ldr r0, _08085B6C + bl wild_pokemon_rand_for_map +_08085B62: + ldr r1, _08085B70 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08085B6C: .4byte 0x02032306 +_08085B70: .4byte 0x02032304 + thumb_func_end sub_8085B2C + + thumb_func_start get_map_light_level_by_bank_and_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 +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, _08085BB8 + ldr r0, [r0] + adds r0, 0x4 + bl get_map_light_level_from_warp + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08085BB8: .4byte 0x03005d8c + 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, _08085BCC + bl get_map_light_level_from_warp + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08085BCC: .4byte 0x020322dc + 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, _08085C54 + 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 + .align 2, 0 +_08085C54: .4byte 0x03005d8c + 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, _08085C7C + 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 + .align 2, 0 +_08085C7C: .4byte 0x03005d8c + thumb_func_end sav1_map_get_name + + thumb_func_start sav1_map_get_battletype +sav1_map_get_battletype: @ 8085C80 + push {lr} + ldr r0, _08085CA4 + 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 + .align 2, 0 +_08085CA4: .4byte 0x03005d8c + thumb_func_end sav1_map_get_battletype + + thumb_func_start overworld_bg_setup +overworld_bg_setup: @ 8085CA8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r1, _08085D24 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0x1 + movs r1, 0x5 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x5 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0x1 + bl gpu_bg_config_set_field + ldr r0, _08085D28 + mov r8, r0 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc_and_clear + mov r1, r8 + str r0, [r1] + ldr r6, _08085D2C + adds r0, r4, 0 + bl malloc_and_clear + str r0, [r6] + ldr r5, _08085D30 + adds r0, r4, 0 + bl malloc_and_clear + str r0, [r5] + mov r0, r8 + ldr r1, [r0] + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r6] + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r5] + movs r0, 0x3 + bl bg_set_tilemap + bl sub_81971D0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08085D24: .4byte 0x08339dac +_08085D28: .4byte 0x03005da0 +_08085D2C: .4byte 0x03005d9c +_08085D30: .4byte 0x03005da4 + 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, _08085D74 + ldr r0, [r4] + cmp r0, 0 + beq _08085D4E + bl free + movs r0, 0 + str r0, [r4] +_08085D4E: + ldr r4, _08085D78 + ldr r0, [r4] + cmp r0, 0 + beq _08085D5E + bl free + movs r0, 0 + str r0, [r4] +_08085D5E: + ldr r4, _08085D7C + ldr r0, [r4] + cmp r0, 0 + beq _08085D6E + bl free + movs r0, 0 + str r0, [r4] +_08085D6E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08085D74: .4byte 0x03005da4 +_08085D78: .4byte 0x03005d9c +_08085D7C: .4byte 0x03005da0 + thumb_func_end overworld_free_bg_tilemaps + + thumb_func_start flag_clear_is_in_safari_zone_ +flag_clear_is_in_safari_zone_: @ 8085D80 + push {lr} + bl flag_clear_is_in_safari_zone + pop {r0} + bx r0 + thumb_func_end flag_clear_is_in_safari_zone_ + + thumb_func_start is_c1_link_related_active +is_c1_link_related_active: @ 8085D8C + push {lr} + ldr r0, _08085D9C + ldr r1, [r0] + ldr r0, _08085DA0 + cmp r1, r0 + beq _08085DA4 + movs r0, 0 + b _08085DA6 + .align 2, 0 +_08085D9C: .4byte 0x030022c0 +_08085DA0: .4byte c1_link_related + 1 +_08085DA4: + movs r0, 0x1 +_08085DA6: + pop {r1} + bx r1 + thumb_func_end is_c1_link_related_active + + thumb_func_start c1_overworld_normal +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 call_203AE8C + 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, _08085E1C + ldr r1, [r2, 0x4] + ldr r0, _08085E20 + cmp r1, r0 + bne _08085E18 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x2C] + bl c1_overworld_normal +_08085E18: + pop {r0} + bx r0 + .align 2, 0 +_08085E1C: .4byte 0x030022c0 +_08085E20: .4byte c2_overworld + 1 + thumb_func_end c1_overworld + + thumb_func_start c2_overworld_basic +c2_overworld_basic: @ 8085E24 + push {lr} + bl script_env_2_run_current_script + bl run_active_tasks + bl call_obj_callbacks + bl camera_update + bl sub_808A314 + bl obj_sync_something + 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, _08085E84 + 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 set_vblank_callback_8086390 +_08085E7C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08085E84: .4byte 0x02037fd4 + thumb_func_end c2_overworld + + thumb_func_start set_callback1 +set_callback1: @ 8085E88 + ldr r1, _08085E90 + str r0, [r1] + bx lr + .align 2, 0 +_08085E90: .4byte 0x030022c0 + thumb_func_end set_callback1 + + thumb_func_start sub_8085E94 +sub_8085E94: @ 8085E94 + ldr r1, _08085E9C + str r0, [r1] + bx lr + .align 2, 0 +_08085E9C: .4byte 0x03000e0c + thumb_func_end sub_8085E94 + + thumb_func_start map_post_load_hook_exec +map_post_load_hook_exec: @ 8085EA0 + push {r4,lr} + ldr r4, _08085EB8 + 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 + .align 2, 0 +_08085EB8: .4byte 0x03005db0 +_08085EBC: + movs r1, 0 + str r1, [r4] + ldr r0, _08085EC8 + str r1, [r0] + b _08085EEA + .align 2, 0 +_08085EC8: .4byte 0x03005dac +_08085ECC: + ldr r0, _08085EDC + ldr r0, [r0] + cmp r0, 0 + beq _08085EE0 + bl _call_via_r0 + b _08085EE4 + .align 2, 0 +_08085EDC: .4byte 0x03005dac +_08085EE0: + bl mapldr_default +_08085EE4: + ldr r1, _08085EF4 + movs r0, 0 + str r0, [r1] +_08085EEA: + movs r0, 0x1 +_08085EEC: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08085EF4: .4byte 0x03005dac + thumb_func_end map_post_load_hook_exec + + thumb_func_start c2_new_game +c2_new_game: @ 8085EF8 + push {lr} + bl sub_808631C + bl sub_80A2F30 + bl flag_clear_is_in_safari_zone_ + bl new_game_init_data + bl player_avatar_init_params_reset + bl set_max_playtime_if_appropriate + bl script_env_1_init + bl script_env_2_disable + ldr r1, _08085F40 + ldr r0, _08085F44 + str r0, [r1] + ldr r1, _08085F48 + movs r0, 0 + str r0, [r1] + ldr r0, _08085F4C + bl do_load_map_stuff_loop + bl set_vblank_callback_8086390 + ldr r0, _08085F50 + bl set_callback1 + ldr r0, _08085F54 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08085F40: .4byte 0x03005dac +_08085F44: .4byte sub_80FB4E0 + 1 +_08085F48: .4byte 0x03005db0 +_08085F4C: .4byte 0x030026f8 +_08085F50: .4byte c1_overworld + 1 +_08085F54: .4byte c2_overworld + 1 + thumb_func_end c2_new_game + + thumb_func_start c2_whiteout +c2_whiteout: @ 8085F58 + push {lr} + sub sp, 0x4 + ldr r1, _08085FB8 + 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 flag_clear_is_in_safari_zone_ + bl sub_8084620 + bl player_avatar_init_params_reset + bl script_env_1_init + bl script_env_2_disable + ldr r1, _08085FBC + ldr r0, _08085FC0 + str r0, [r1] + mov r1, sp + movs r0, 0 + strb r0, [r1] + mov r0, sp + bl do_load_map_stuff_loop + bl set_vblank_callback_8086390 + ldr r0, _08085FC4 + bl set_callback1 + ldr r0, _08085FC8 + bl set_callback2 +_08085FB0: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08085FB8: .4byte 0x030022c0 +_08085FBC: .4byte 0x03005dac +_08085FC0: .4byte sub_80AF3C8 + 1 +_08085FC4: .4byte c1_overworld + 1 +_08085FC8: .4byte c2_overworld + 1 + 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, _08085FF0 + bl set_callback2 + ldr r1, _08085FF4 + ldr r0, _08085FF8 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_08085FF0: .4byte c2_change_map + 1 +_08085FF4: .4byte 0x030022c0 +_08085FF8: .4byte c2_load_new_map_2 + 1 + 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, _08086018 + bl do_load_map_stuff_loop + bl set_vblank_callback_8086390 + ldr r0, _0808601C + bl set_callback1 + ldr r0, _08086020 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08086018: .4byte 0x030026f8 +_0808601C: .4byte c1_overworld + 1 +_08086020: .4byte c2_overworld + 1 + thumb_func_end c2_load_new_map_2 + + thumb_func_start sub_8086024 +sub_8086024: @ 8086024 + push {r4,lr} + ldr r0, _08086068 + 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 set_vblank_callback_8086390 + ldr r0, _0808606C + bl set_callback1 + ldr r0, _08086070 + bl set_callback2 +_08086062: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08086068: .4byte 0x030022c0 +_0808606C: .4byte c1_overworld + 1 +_08086070: .4byte c2_overworld + 1 + thumb_func_end sub_8086024 + + thumb_func_start sub_8086074 +sub_8086074: @ 8086074 + push {lr} + bl sub_808631C + ldr r0, _0808608C + ldr r1, _08086090 + str r1, [r0] + ldr r0, _08086094 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0808608C: .4byte 0x03005dac +_08086090: .4byte sub_80AF314 + 1 +_08086094: .4byte c2_80567AC + 1 + thumb_func_end sub_8086074 + + thumb_func_start c2_80567AC +c2_80567AC: @ 8086098 + push {lr} + ldr r0, _080860BC + bl map_loading_iteration_3 + cmp r0, 0 + beq _080860B8 + bl set_vblank_callback_8086390 + ldr r0, _080860C0 + bl set_callback1 + bl sub_8086C2C + ldr r0, _080860C4 + bl set_callback2 +_080860B8: + pop {r0} + bx r0 + .align 2, 0 +_080860BC: .4byte 0x030026f8 +_080860C0: .4byte c1_link_related + 1 +_080860C4: .4byte c2_overworld + 1 + 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, _080860DC + bl set_callback2 + b _080860EA + .align 2, 0 +_080860DC: .4byte c2_exit_to_overworld_2_link + 1 +_080860E0: + bl sub_808631C + ldr r0, _080860F0 + bl set_callback2 +_080860EA: + pop {r0} + bx r0 + .align 2, 0 +_080860F0: .4byte c2_exit_to_overworld_2_local + 1 + 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, _08086110 + bl sub_8086638 + cmp r0, 0 + beq _0808610A + bl set_vblank_callback_8086390 + ldr r0, _08086114 + bl set_callback2 +_0808610A: + pop {r0} + bx r0 + .align 2, 0 +_08086110: .4byte 0x030026f8 +_08086114: .4byte c2_overworld + 1 + 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, _08086138 + bl map_loading_iteration_2_link + cmp r0, 0 + beq _08086132 + ldr r0, _0808613C + bl set_callback2 +_08086132: + pop {r0} + bx r0 + .align 2, 0 +_08086138: .4byte 0x030026f8 +_0808613C: .4byte c2_overworld + 1 + 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, _08086164 + bl set_callback1 + bl sub_8086C2C + ldr r0, _08086168 + ldrb r0, [r0] + cmp r0, 0 + beq _08086174 + ldr r1, _0808616C + ldr r0, _08086170 + b _08086178 + .align 2, 0 +_08086164: .4byte c1_link_related + 1 +_08086168: .4byte 0x030030fc +_0808616C: .4byte 0x03005dac +_08086170: .4byte sub_80AF314 + 1 +_08086174: + ldr r1, _0808618C + ldr r0, _08086190 +_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 + .align 2, 0 +_0808618C: .4byte 0x03005dac +_08086190: .4byte sub_80AF214 + 1 + thumb_func_end c2_8056854 + + thumb_func_start sub_8086194 +sub_8086194: @ 8086194 + push {lr} + bl sub_808631C + ldr r1, _080861A8 + ldr r0, _080861AC + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .align 2, 0 +_080861A8: .4byte 0x03005db0 +_080861AC: .4byte sub_80AF6A4 + 1 + thumb_func_end sub_8086194 + + thumb_func_start sub_80861B0 +sub_80861B0: @ 80861B0 + push {lr} + bl sub_808631C + ldr r1, _080861C4 + ldr r0, _080861C8 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .align 2, 0 +_080861C4: .4byte 0x03005dac +_080861C8: .4byte sub_80AF188 + 1 + 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, _080861E0 + ldr r0, _080861E4 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .align 2, 0 +_080861E0: .4byte 0x03005dac +_080861E4: .4byte sub_80AF168 + 1 + 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, _080861FC + ldr r0, _08086200 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .align 2, 0 +_080861FC: .4byte 0x03005dac +_08086200: .4byte sub_80AF3C8 + 1 + thumb_func_end sub_80861E8 + + thumb_func_start sub_8086204 +sub_8086204: @ 8086204 + push {lr} + ldr r0, _0808622C + 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 sub_80D47E4 +_08086222: + bl sub_80AF3C8 + pop {r0} + bx r0 + .align 2, 0 +_0808622C: .4byte 0x02037318 + thumb_func_end sub_8086204 + + thumb_func_start sub_8086230 +sub_8086230: @ 8086230 + push {r4,lr} + bl sub_808631C + bl sub_80A2F30 + bl flag_clear_is_in_safari_zone_ + ldr r0, _0808626C + 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 sub_81D609C + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08086270 + ldrh r1, [r0, 0x12] + ldr r0, _08086274 + cmp r1, r0 + bne _08086278 + bl sub_81AA2F8 + b _0808628A + .align 2, 0 +_0808626C: .4byte 0x03006210 +_08086270: .4byte 0x02037318 +_08086274: .4byte 0x00000169 +_08086278: + cmp r4, 0 + beq _08086286 + cmp r4, 0x6 + beq _08086286 + bl sub_81D5F48 + b _0808628A +_08086286: + bl sub_80848E0 +_0808628A: + bl sub_809757C + bl sub_809E7B0 + bl sub_8084788 + ldr r0, _080862A8 + ldrh r1, [r0, 0x12] + ldr r0, _080862AC + cmp r1, r0 + bne _080862B0 + movs r0, 0x1 + bl sub_8087DAC + b _080862BE + .align 2, 0 +_080862A8: .4byte 0x02037318 +_080862AC: .4byte 0x00000169 +_080862B0: + cmp r4, 0 + beq _080862BA + bl sub_8087DE4 + 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, _080862F0 + bl set_callback2 + b _08086308 + .align 2, 0 +_080862F0: .4byte c2_load_new_map + 1 +_080862F4: + bl sub_80EDB44 + ldr r0, _08086310 + ldr r1, _08086314 + str r1, [r0] + ldr r0, _08086318 + bl set_callback1 + bl c2_exit_to_overworld_2_switch +_08086308: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08086310: .4byte 0x03005dac +_08086314: .4byte sub_8086204 + 1 +_08086318: .4byte c1_overworld + 1 + thumb_func_end sub_8086230 + + thumb_func_start 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, _08086344 + ldrb r0, [r0] + cmp r0, 0 + beq _08086348 + movs r0, 0xC5 + bl enable_irqs + movs r0, 0x2 + bl disable_irqs + b _08086362 + .align 2, 0 +_08086344: .4byte 0x030030fc +_08086348: + ldr r4, _08086374 + ldrh r3, [r4] + strh r0, [r4] + ldr r2, _08086378 + ldrh r1, [r2] + ldr r0, _0808637C + 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 + .align 2, 0 +_08086374: .4byte 0x04000208 +_08086378: .4byte 0x04000200 +_0808637C: .4byte 0x0000fffd + thumb_func_end sub_808631C + + thumb_func_start set_vblank_callback_8086390 +set_vblank_callback_8086390: @ 8086380 + push {lr} + ldr r0, _0808638C + bl SetVBlankCallback + pop {r0} + bx r0 + .align 2, 0 +_0808638C: .4byte vblank_cb_8086390 + 1 + thumb_func_end set_vblank_callback_8086390 + + thumb_func_start vblank_cb_8086390 +vblank_cb_8086390: @ 8086390 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl sub_80BA0A8 + bl sub_8089BA4 + bl copy_pal_bg_faded_to_pal_ram + bl sub_80A09D0 + pop {r0} + bx r0 + thumb_func_end vblank_cb_8086390 + + 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, _080863D0 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + b _080863F0 + .align 2, 0 +_080863D0: .4byte 0x08339dbc +_080863D4: + bl sav1_get_flash_used_on_map + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080863F0 + bl sub_80B00E8 + ldr r2, _080863F4 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 +_080863F0: + pop {r0} + bx r0 + .align 2, 0 +_080863F4: .4byte 0x08339dbc + 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, _08086410 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08086410: .4byte _08086414 + .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, _080864A4 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086506 + .align 2, 0 +_080864A4: .4byte 0x02037318 +_080864A8: + ldr r0, _080864B4 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086506 + .align 2, 0 +_080864B4: .4byte 0x02037318 +_080864B8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08086512 + ldr r0, _080864D0 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086506 + .align 2, 0 +_080864D0: .4byte 0x02037318 +_080864D4: + bl cur_mapdata_full_redraw + b _08086506 +_080864DA: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086506 +_080864E0: + ldr r0, _080864F8 + ldrb r0, [r0] + cmp r0, 0 + beq _08086506 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08086506 + .align 2, 0 +_080864F8: .4byte 0x030030fc +_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 +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, _08086534 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08086534: .4byte _08086538 + .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, _080865B8 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086622 + .align 2, 0 +_080865B8: .4byte 0x02037318 +_080865BC: + ldr r0, _080865C8 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086622 + .align 2, 0 +_080865C8: .4byte 0x02037318 +_080865CC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808662E + ldr r0, _080865E4 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086622 + .align 2, 0 +_080865E4: .4byte 0x02037318 +_080865E8: + bl cur_mapdata_full_redraw + b _08086622 +_080865EE: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086622 +_080865F4: + ldr r0, _08086614 + 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 sub_80D47E4 + b _08086622 + .align 2, 0 +_08086614: .4byte 0x02037318 +_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, _080866B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080866B0: .4byte _080866B4 + .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, _08086730 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086792 + .align 2, 0 +_08086730: .4byte 0x02037318 +_08086734: + ldr r0, _08086740 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086792 + .align 2, 0 +_08086740: .4byte 0x02037318 +_08086744: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080867A8 + ldr r0, _0808675C + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086792 + .align 2, 0 +_0808675C: .4byte 0x02037318 +_08086760: + bl cur_mapdata_full_redraw + b _08086792 +_08086766: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086792 +_0808676C: + ldr r0, _08086784 + ldrb r0, [r0] + cmp r0, 0 + beq _08086792 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08086792 + .align 2, 0 +_08086784: .4byte 0x030030fc +_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 set_vblank_callback_8086390 + 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 lcd_io_set + bl remove_some_task + ldr r2, _08086850 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _08086854 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, _08086858 + 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, _0808685C + 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 reset_super_sprites + bl copy_super_sprites_to_oam + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08086850: .4byte 0x05000002 +_08086854: .4byte 0x040000d4 +_08086858: .4byte 0x810001ff +_0808685C: .4byte 0x81000800 + 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 lcd_io_set + ldr r1, _08086970 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08086974 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0x40 + movs r1, 0xFF + bl lcd_io_set + movs r0, 0x44 + movs r1, 0xFF + bl lcd_io_set + ldr r4, _08086978 + movs r0, 0x42 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x46 + adds r1, r4, 0 + bl lcd_io_set + ldr r0, _0808697C + 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 lcd_io_set + ldr r1, _08086980 + movs r0, 0x52 + bl lcd_io_set + 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 bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r1, _08086984 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + bl sub_8098128 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08086970: .4byte 0x00001f1f +_08086974: .4byte 0x00000101 +_08086978: .4byte 0x0000ffff +_0808697C: .4byte 0x082ec7c4 +_08086980: .4byte 0x0000070d +_08086984: .4byte 0x00007060 + 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 reset_all_obj_data + bl sub_80A1A74 + bl dp12_8087EA4 + bl dp13_810BB8C + bl clear_all_callback6 + bl sub_808A2E4 + 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 oe_active_list_clear + 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, _080869FC + movs r1, 0 + strh r1, [r0] + ldr r0, _08086A00 + strh r1, [r0] + bl sub_808D438 + movs r0, 0 + movs r1, 0 + bl npc_culling_maybe + bl mapheader_run_first_tag4_script_list_match + pop {r0} + bx r0 + .align 2, 0 +_080869FC: .4byte 0x03005dec +_08086A00: .4byte 0x03005de8 + 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, _08086A5C + movs r1, 0 + strh r1, [r0] + ldr r0, _08086A60 + 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, _08086A64 + ldr r3, [r3] + ldrb r3, [r3, 0x8] + bl player_avatar_init + ldrb r0, [r5] + bl walkrun_set_bike_bits + bl player_avatar_init_params_reset + movs r0, 0 + movs r1, 0 + bl npc_culling_maybe + bl mapheader_run_first_tag4_script_list_match + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08086A5C: .4byte 0x03005dec +_08086A60: .4byte 0x03005de8 +_08086A64: .4byte 0x03005d90 + 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, _08086AA4 + ldr r3, _08086AA8 + 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 sub_808A134 + pop {r0} + bx r0 + .align 2, 0 +_08086AA4: .4byte 0x02037350 +_08086AA8: .4byte 0x02037590 + thumb_func_end sub_8086A80 + + thumb_func_start sub_8086AAC +sub_8086AAC: @ 8086AAC + push {lr} + ldr r0, _08086AC4 + ldrb r0, [r0] + bl sub_8087858 + lsls r0, 24 + lsrs r0, 24 + bl sub_808A134 + pop {r0} + bx r0 + .align 2, 0 +_08086AC4: .4byte 0x03005db4 + thumb_func_end sub_8086AAC + + thumb_func_start sub_8086AC8 +sub_8086AC8: @ 8086AC8 + push {lr} + ldr r0, _08086AE0 + ldrb r0, [r0] + bl sub_8087858 + lsls r0, 24 + lsrs r0, 24 + bl sub_808A134 + pop {r0} + bx r0 + .align 2, 0 +_08086AE0: .4byte 0x03005db4 + 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, _08086B10 + 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 + .align 2, 0 +_08086B10: .4byte 0x03005db4 + 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, _08086B90 + ldrb r1, [r0] + ldrh r0, [r2] + subs r0, r1 + strh r0, [r3] + movs r6, 0 + ldr r0, _08086B94 + mov r8, r4 + ldrb r0, [r0] + cmp r6, r0 + bcs _08086B7E + ldr r7, _08086B98 +_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, _08086B94 + 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 + .align 2, 0 +_08086B90: .4byte 0x03005db4 +_08086B94: .4byte 0x03005db8 +_08086B98: .4byte 0x020229e8 + thumb_func_end sub_8086B14 + + thumb_func_start sub_8086B9C +sub_8086B9C: @ 8086B9C + push {r4,r5,lr} + movs r4, 0 + ldr r0, _08086BD0 + ldrb r0, [r0] + cmp r4, r0 + bcs _08086BCA + ldr r5, _08086BD4 +_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, _08086BD0 + ldrb r0, [r0] + cmp r4, r0 + bcc _08086BAA +_08086BCA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08086BD0: .4byte 0x03005db8 +_08086BD4: .4byte 0x020229e8 + thumb_func_end sub_8086B9C + + thumb_func_start c1_link_related +c1_link_related: @ 8086BD8 + push {r4,lr} + ldr r0, _08086C1C + 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, _08086C20 + ldrb r4, [r0] + ldr r0, _08086C24 + adds r1, r4, 0 + bl sub_8086F38 + ldr r0, _08086C28 + 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 + .align 2, 0 +_08086C1C: .4byte 0x030030fc +_08086C20: .4byte 0x03005db4 +_08086C24: .4byte 0x03003020 +_08086C28: .4byte 0x03000e14 + thumb_func_end c1_link_related + + thumb_func_start sub_8086C2C +sub_8086C2C: @ 8086C2C + push {lr} + bl sub_8086C90 + ldr r0, _08086C3C + bl c1_link_related_func_set + pop {r0} + bx r0 + .align 2, 0 +_08086C3C: .4byte sub_80870B0 + 1 + thumb_func_end sub_8086C2C + + thumb_func_start sub_8086C40 +sub_8086C40: @ 8086C40 + push {lr} + ldr r0, _08086C4C + bl sub_808709C + pop {r0} + bx r0 + .align 2, 0 +_08086C4C: .4byte 0x03003020 + thumb_func_end sub_8086C40 + + thumb_func_start c1_link_related_func_set +c1_link_related_func_set: @ 8086C50 + ldr r2, _08086C5C + movs r1, 0 + strb r1, [r2] + ldr r1, _08086C60 + str r0, [r1] + bx lr + .align 2, 0 +_08086C5C: .4byte 0x03000e19 +_08086C60: .4byte 0x03000e14 + thumb_func_end c1_link_related_func_set + + thumb_func_start sub_8086C64 +sub_8086C64: @ 8086C64 + push {lr} + ldr r0, _08086C88 + ldrb r0, [r0] + cmp r0, 0 + beq _08086C82 + ldr r1, _08086C8C + 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 + .align 2, 0 +_08086C88: .4byte 0x030030fc +_08086C8C: .4byte 0x03000e19 + thumb_func_end sub_8086C64 + + thumb_func_start sub_8086C90 +sub_8086C90: @ 8086C90 + push {lr} + ldr r1, _08086CA4 + movs r2, 0x80 + adds r0, r1, 0x3 +_08086C98: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08086C98 + pop {r0} + bx r0 + .align 2, 0 +_08086CA4: .4byte 0x03000e10 + 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, _08086CC8 + ldrb r2, [r0] + movs r1, 0 + cmp r1, r2 + bge _08086CD6 + ldr r4, _08086CCC +_08086CBA: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _08086CD0 + movs r0, 0 + b _08086CD8 + .align 2, 0 +_08086CC8: .4byte 0x03005db8 +_08086CCC: .4byte 0x03000e10 +_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, _08086D00 + ldrb r2, [r0] + movs r1, 0 + cmp r1, r2 + bge _08086D0E + ldr r4, _08086D04 +_08086CF2: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _08086D08 + movs r0, 0x1 + b _08086D10 + .align 2, 0 +_08086D00: .4byte 0x03005db8 +_08086D04: .4byte 0x03000e10 +_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, _08086D68 + 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, _08086D6C + bl c1_link_related_func_set + adds r0, r4, 0 + bl sub_8087530 + b _08086F26 + .align 2, 0 +_08086D68: .4byte 0x03000e10 +_08086D6C: .4byte sub_80870F8 + 1 +_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, _08086D94 + bl c1_link_related_func_set + bl sub_8087584 + b _08086F26 + .align 2, 0 +_08086D94: .4byte sub_80870F8 + 1 +_08086D98: + mov r0, r8 + subs r0, 0x12 + cmp r0, 0xA + bls _08086DA2 + b _08086EB2 +_08086DA2: + lsls r0, 2 + ldr r1, _08086DAC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08086DAC: .4byte _08086DB0 + .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, _08086E00 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086E04 + bl c1_link_related_func_set + bl sub_808751C + b _08086EB2 + .align 2, 0 +_08086E00: .4byte 0x03000e10 +_08086E04: .4byte sub_80870F8 + 1 +_08086E08: + adds r0, r6, 0 + bl sub_8087388 + cmp r0, 0x1 + bne _08086EB2 + ldr r0, _08086E2C + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086E30 + bl c1_link_related_func_set + bl sub_808754C + b _08086EB2 + .align 2, 0 +_08086E2C: .4byte 0x03000e10 +_08086E30: .4byte sub_80870F8 + 1 +_08086E34: + adds r0, r6, 0 + bl sub_80873B4 + adds r4, r0, 0 + cmp r4, 0 + beq _08086EB2 + ldr r0, _08086E5C + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086E60 + bl c1_link_related_func_set + adds r0, r4, 0 + bl sub_8087568 + b _08086EB2 + .align 2, 0 +_08086E5C: .4byte 0x03000e10 +_08086E60: .4byte sub_80870F8 + 1 +_08086E64: + adds r0, r6, 0 + bl sub_8087340 + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086E88 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086E8C + bl c1_link_related_func_set + bl sub_8087510 + b _08086EB2 + .align 2, 0 +_08086E88: .4byte 0x03000e10 +_08086E8C: .4byte sub_808711C + 1 +_08086E90: + adds r0, r6, 0 + bl sub_8087340 + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086EC4 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, _08086EC8 + 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 + .align 2, 0 +_08086EC4: .4byte 0x03000e10 +_08086EC8: .4byte sub_8087140 + 1 +_08086ECC: + mov r1, r8 + cmp r1, 0x1A + beq _08086EF8 + cmp r1, 0x1D + beq _08086F18 + b _08086F26 +_08086ED8: + ldr r0, _08086EE4 + adds r0, r7, r0 + movs r1, 0x83 + strb r1, [r0] + b _08086F26 + .align 2, 0 +_08086EE4: .4byte 0x03000e10 +_08086EE8: + ldr r0, _08086EF4 + adds r0, r7, r0 + movs r1, 0x82 + strb r1, [r0] + b _08086F26 + .align 2, 0 +_08086EF4: .4byte 0x03000e10 +_08086EF8: + ldr r0, _08086F10 + adds r0, r7, r0 + movs r1, 0x80 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086F26 + ldr r0, _08086F14 + bl c1_link_related_func_set + b _08086F26 + .align 2, 0 +_08086F10: .4byte 0x03000e10 +_08086F14: .4byte sub_80870B0 + 1 +_08086F18: + ldr r0, _08086F34 + 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 + .align 2, 0 +_08086F34: .4byte 0x03000e10 + 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, _08086F9C + 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 + .align 2, 0 +_08086F9C: .4byte 0x03000e10 + 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, _08086FB8 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0xC + bhi _08086FC0 + ldr r0, _08086FBC + strh r4, [r0] + b _08086FC6 + .align 2, 0 +_08086FB8: .4byte 0xffef0000 +_08086FBC: .4byte 0x03005da8 +_08086FC0: + ldr r1, _08087004 + movs r0, 0x11 + strh r0, [r1] +_08086FC6: + ldr r0, _08087008 + 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, _08087004 + movs r0, 0 + strh r0, [r1] +_08086FFC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08087004: .4byte 0x03005da8 +_08087008: .4byte 0x030030fc + thumb_func_end sub_8086FA0 + + thumb_func_start sub_808700C +sub_808700C: @ 808700C + push {lr} + ldr r2, _08087020 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08087024 + movs r0, 0x13 + b _08087064 + .align 2, 0 +_08087020: .4byte 0x030022c0 +_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, _08087118 + bl c1_link_related_func_set +_08087110: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08087118: .4byte sub_80870EC + 1 + 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, _0808713C + bl c1_link_related_func_set +_08087134: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0808713C: .4byte sub_80870EC + 1 + 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, _08087160 + bl c1_link_related_func_set +_08087158: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08087160: .4byte sub_80870EC + 1 + 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, _08087194 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x82 + bne _080871A0 + ldr r0, _08087198 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080871A4 + ldr r0, _0808719C + bl c1_link_related_func_set + movs r0, 0x1D + b _080871A6 + .align 2, 0 +_08087194: .4byte 0x03000e10 +_08087198: .4byte 0x030022c0 +_0808719C: .4byte sub_8087164 + 1 +_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, _080871BC + bl c1_link_related_func_set + movs r0, 0x16 + pop {r1} + bx r1 + .align 2, 0 +_080871BC: .4byte sub_8087170 + 1 + 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, _080871F0 + 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, _080871F4 + bl script_env_1_execute_new_script + ldr r0, _080871F8 + bl c1_link_related_func_set +_080871EA: + movs r0, 0x11 + pop {r1} + bx r1 + .align 2, 0 +_080871F0: .4byte 0x03000e10 +_080871F4: .4byte 0x08277513 +_080871F8: .4byte sub_80871C0 + 1 + thumb_func_end sub_80871C4 + + thumb_func_start sub_80871FC +sub_80871FC: @ 80871FC + push {lr} + ldr r0, _0808720C + bl c1_link_related_func_set + movs r0, 0x17 + pop {r1} + bx r1 + .align 2, 0 +_0808720C: .4byte sub_80871C4 + 1 + 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, _08087254 + ldr r2, [r0] + ldr r1, _08087258 + adds r3, r0, 0 + cmp r2, r1 + bne _0808723A + ldr r1, _0808725C + ldr r0, _08087260 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x82 + bne _08087272 +_0808723A: + ldr r1, [r3] + ldr r0, _08087264 + cmp r1, r0 + bne _08087268 + ldr r1, _0808725C + ldr r0, _08087260 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x81 + bne _08087268 +_08087250: + movs r0, 0x2 + b _08087278 + .align 2, 0 +_08087254: .4byte 0x03000e14 +_08087258: .4byte sub_8087170 + 1 +_0808725C: .4byte 0x03000e10 +_08087260: .4byte 0x03005db4 +_08087264: .4byte sub_8087164 + 1 +_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, _08087298 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08087298: .4byte sub_80871AC + 1 + thumb_func_end sub_8087288 + + thumb_func_start sub_808729C +sub_808729C: @ 808729C + push {lr} + ldr r0, _080872AC + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080872AC: .4byte sub_80870F8 + 1 + thumb_func_end sub_808729C + + thumb_func_start sub_80872B0 +sub_80872B0: @ 80872B0 + push {lr} + ldr r0, _080872C0 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080872C0: .4byte sub_80871FC + 1 + thumb_func_end sub_80872B0 + + thumb_func_start sub_80872C4 +sub_80872C4: @ 80872C4 + push {lr} + ldr r0, _080872D4 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080872D4: .4byte sub_8087210 + 1 + 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, _0808733C + 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 cur_mapdata_block_get_role_at + strh r0, [r6, 0xC] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808733C: .4byte 0x02032308 + 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 is_tile_x65_warp_arrow_down + 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, _08087438 + 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, _0808743C + 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, _08087440 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldr r2, _08087444 + 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, _08087448 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x80 + beq _08087450 +_08087434: + ldr r0, _0808744C + b _08087476 + .align 2, 0 +_08087438: .4byte 0x08339d64 +_0808743C: .4byte 0xffff0000 +_08087440: .4byte 0x0000ffff +_08087444: .4byte 0xffffff00 +_08087448: .4byte 0x03000e10 +_0808744C: .4byte 0x0827749c +_08087450: + adds r0, r2, 0 + bl sub_80B39D4 + cmp r0, 0 + bne _08087464 + ldr r0, _08087460 + b _08087476 + .align 2, 0 +_08087460: .4byte 0x0827747e +_08087464: + ldr r0, _08087468 + b _08087476 + .align 2, 0 +_08087468: .4byte 0x0827748d +_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, _080874CC + cmp r1, r0 + beq _080874C6 + ldr r0, _080874D0 + cmp r1, r0 + beq _08087508 + ldr r0, _080874D4 + cmp r1, r0 + beq _080874C6 + ldr r0, _080874D8 + cmp r1, r0 + beq _08087508 + ldr r0, _080874DC + cmp r1, r0 + beq _080874C6 + ldr r0, _080874E0 + cmp r1, r0 + beq _08087508 + ldr r0, _080874E4 + cmp r1, r0 + beq _080874C6 + ldr r0, _080874E8 + cmp r1, r0 + beq _08087508 + ldr r0, _080874EC + cmp r1, r0 + beq _080874C6 + ldr r0, _080874F0 + cmp r1, r0 + beq _08087508 + ldr r0, _080874F4 + cmp r1, r0 + bne _080874F8 +_080874C6: + movs r0, 0xA + b _0808750A + .align 2, 0 +_080874CC: .4byte 0x08277388 +_080874D0: .4byte 0x082773a3 +_080874D4: .4byte 0x082773be +_080874D8: .4byte 0x082773d9 +_080874DC: .4byte 0x0827741d +_080874E0: .4byte 0x08277432 +_080874E4: .4byte 0x08277447 +_080874E8: .4byte 0x0827745c +_080874EC: .4byte 0x08277374 +_080874F0: .4byte 0x0827737e +_080874F4: .4byte 0x082773f5 +_080874F8: + ldr r0, _08087504 + cmp r1, r0 + beq _08087508 + movs r0, 0 + b _0808750A + .align 2, 0 +_08087504: .4byte 0x082773ff +_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, _08087564 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_08087564: .4byte 0x082774ef + 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, _08087594 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_08087594: .4byte 0x08277509 + 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, _080875B4 + movs r0, 0x1 + b _080875BC + .align 2, 0 +_080875B4: .4byte 0x03000e18 +_080875B8: + ldr r1, _080875C4 + movs r0, 0 +_080875BC: + strb r0, [r1] + ldrb r0, [r1] +_080875C0: + pop {r1} + bx r1 + .align 2, 0 +_080875C4: .4byte 0x03000e18 + 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, _08087618 + ldr r1, [r0] + ldr r0, _0808761C + cmp r1, r0 + beq _08087614 + ldr r0, _08087620 + cmp r1, r0 + bne _0808762C + ldr r0, _08087624 + ldrb r2, [r0] + movs r1, 0 + strb r1, [r0] + cmp r2, 0x1 + beq _08087614 + ldr r2, _08087628 + 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 + .align 2, 0 +_08087618: .4byte 0x03000e14 +_0808761C: .4byte sub_808711C + 1 +_08087620: .4byte sub_80870F8 + 1 +_08087624: .4byte 0x03000e18 +_08087628: .4byte 0x02037fd4 +_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, _0808765C + ldr r1, [r0] + ldr r0, _08087660 + cmp r1, r0 + beq _08087664 +_08087658: + movs r0, 0 + b _08087666 + .align 2, 0 +_0808765C: .4byte 0x03000e14 +_08087660: .4byte sub_8087140 + 1 +_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, _08087684 + ldrb r0, [r0] + cmp r0, 0 + bne _08087688 + bl sub_8009F3C + cmp r0, 0 + beq _08087688 + movs r0, 0x1 + b _0808768A + .align 2, 0 +_08087684: .4byte 0x030030fc +_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, _080876A4 + ldrb r0, [r0] + cmp r0, 0 + bne _080876B0 + ldr r0, _080876A8 + ldr r1, _080876AC + adds r0, r1 + ldrb r0, [r0] + b _080876B8 + .align 2, 0 +_080876A4: .4byte 0x030030fc +_080876A8: .4byte 0x03003170 +_080876AC: .4byte 0x00000339 +_080876B0: + ldr r0, _080876BC + ldr r1, _080876C0 + adds r0, r1 + ldrb r0, [r0] +_080876B8: + pop {r1} + bx r1 + .align 2, 0 +_080876BC: .4byte 0x03005000 +_080876C0: .4byte 0x00000c1a + 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, _080876DC + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_080876DC: .4byte 0x02032308 + 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, _08087794 + adds r4, r0 + lsls r5, r6, 3 + adds r5, r6 + lsls r5, 2 + ldr r0, _08087798 + 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 + .align 2, 0 +_08087794: .4byte 0x02032308 +_08087798: .4byte 0x02037350 + 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 sub_8096DB8 + 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, _08087804 + 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, _08087808 + adds r1, r0 + strb r2, [r1, 0x19] +_080877FE: + pop {r0} + bx r0 + .align 2, 0 +_08087804: .4byte 0x02032308 +_08087808: .4byte 0x02037350 + 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, _0808784C + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08087850 + 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, _08087854 + adds r0, r1 + bl obj_delete_and_free_tiles +_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 + .align 2, 0 +_0808784C: .4byte 0x02032308 +_08087850: .4byte 0x02037350 +_08087854: .4byte 0x02020630 + thumb_func_end sub_808780C + + thumb_func_start sub_8087858 +sub_8087858: @ 8087858 + lsls r0, 24 + ldr r1, _08087870 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08087874 + adds r0, r1 + ldrb r0, [r0, 0x4] + bx lr + .align 2, 0 +_08087870: .4byte 0x02032308 +_08087874: .4byte 0x02037350 + thumb_func_end sub_8087858 + + thumb_func_start sub_8087878 +sub_8087878: @ 8087878 + lsls r0, 24 + ldr r3, _08087898 + lsrs r0, 22 + adds r0, r3 + ldrb r3, [r0, 0x2] + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r3, _0808789C + adds r0, r3 + ldrh r3, [r0, 0x10] + strh r3, [r1] + ldrh r0, [r0, 0x12] + strh r0, [r2] + bx lr + .align 2, 0 +_08087898: .4byte 0x02032308 +_0808789C: .4byte 0x02037350 + thumb_func_end sub_8087878 + + thumb_func_start sub_80878A0 +sub_80878A0: @ 80878A0 + lsls r0, 24 + ldr r1, _080878B8 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080878BC + adds r0, r1 + ldrb r0, [r0, 0x19] + bx lr + .align 2, 0 +_080878B8: .4byte 0x02032308 +_080878BC: .4byte 0x02037350 + thumb_func_end sub_80878A0 + + thumb_func_start sub_80878C0 +sub_80878C0: @ 80878C0 + lsls r0, 24 + ldr r1, _080878DC + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080878E0 + adds r0, r1 + ldrb r0, [r0, 0xB] + lsls r0, 28 + lsrs r0, 28 + bx lr + .align 2, 0 +_080878DC: .4byte 0x02032308 +_080878E0: .4byte 0x02037350 + thumb_func_end sub_80878C0 + + thumb_func_start sub_80878E4 +sub_80878E4: @ 80878E4 + lsls r0, 24 + ldr r1, _08087904 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08087908 + adds r0, r1 + adds r0, 0x21 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x10 + subs r0, r1 + bx lr + .align 2, 0 +_08087904: .4byte 0x02032308 +_08087908: .4byte 0x02037350 + thumb_func_end sub_80878E4 + + thumb_func_start sub_808790C +sub_808790C: @ 808790C + push {r4-r6,lr} + movs r2, 0 + ldr r5, _08087950 + 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, _08087954 + 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 + .align 2, 0 +_08087950: .4byte 0x02032308 +_08087954: .4byte 0x02037350 +_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, _0808799C + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080879A0 + 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 + .align 2, 0 +_0808799C: .4byte 0x02032308 +_080879A0: .4byte 0x02037350 +_080879A4: + ldr r4, _080879D0 + ldr r1, _080879D4 + 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 + .align 2, 0 +_080879D0: .4byte 0x08339e00 +_080879D4: .4byte 0x08339dc8 + thumb_func_end sub_808796C + + thumb_func_start sub_80879D8 +sub_80879D8: @ 80879D8 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldr r4, _080879F4 + 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 + .align 2, 0 +_080879F4: .4byte 0x08339dd4 + 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, _08087A18 + 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 + .align 2, 0 +_08087A18: .4byte 0x08339dd4 + 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 npc_move_direction_hypothetical + 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 sub_8096DB8 + 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 numbers_move_direction + 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, _08087AFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08087AFC: .4byte _08087B00 + .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, _08087BA4 + 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 + .align 2, 0 +_08087BA4: .4byte 0x02037350 +_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 cur_mapdata_get_middle2bit_at + 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, _08087C00 + adds r2, r0 + ldrb r1, [r2, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08087C04 + 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, _08087C08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08087C00: .4byte 0x02032308 +_08087C04: .4byte 0x02037350 +_08087C08: .4byte _08087C0C + .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, _08087C84 + movs r2, 0 + str r2, [sp] + movs r3, 0 + bl sub_808DD68 + strb r0, [r4, 0x4] +_08087C56: + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08087C88 + 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 + .align 2, 0 +_08087C84: .4byte sub_8087C8C + 1 +_08087C88: .4byte 0x02020630 + 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, _08087CF0 + adds r4, r0 + ldrb r1, [r4, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08087CF4 + 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 npc_y_height_related + ldrb r0, [r6, 0xB] + lsrs r0, 4 + bl sub_8096DA8 + 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 npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + b _08087D0A + .align 2, 0 +_08087CF0: .4byte 0x02032308 +_08087CF4: .4byte 0x02037350 +_08087CF8: + ldrb r0, [r6, 0x19] + bl an_run_any__impl_pulse + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start_if_different +_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 sub_8087D54 +sub_8087D54: @ 8087D54 + push {r4,lr} + ldr r4, _08087D70 + 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 + .align 2, 0 +_08087D70: .4byte 0x02037318 + thumb_func_end sub_8087D54 + + thumb_func_start sub_8087D74 +sub_8087D74: @ 8087D74 + push {r4,lr} + ldr r4, _08087DA4 + 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, _08087DA8 + ldr r0, [r1] + ldr r1, [r1, 0x4] + bl per_step_2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08087DA4: .4byte 0x02037318 +_08087DA8: .4byte 0x03005dc0 + thumb_func_end sub_8087D74 + + thumb_func_start sub_8087DAC +sub_8087DAC: @ 8087DAC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08087DD8 + str r0, [sp] + ldr r5, _08087DDC + ldr r2, _08087DE0 + 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 + .align 2, 0 +_08087DD8: .4byte 0x03ff03ff +_08087DDC: .4byte 0x02032318 +_08087DE0: .4byte 0x01001400 + thumb_func_end sub_8087DAC + + thumb_func_start sub_8087DE4 +sub_8087DE4: @ 8087DE4 + push {r4,lr} + sub sp, 0x4 + ldr r0, _08087E08 + str r0, [sp] + ldr r4, _08087E0C + ldr r2, _08087E10 + 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 + .align 2, 0 +_08087E08: .4byte 0x03ff03ff +_08087E0C: .4byte 0x02032318 +_08087E10: .4byte 0x01001400 + thumb_func_end sub_8087DE4 + + thumb_func_start mapheader_copy_mapdata_with_padding +mapheader_copy_mapdata_with_padding: @ 8087E14 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r5, [r6] + ldr r0, _08087E60 + str r0, [sp] + ldr r4, _08087E64 + ldr r2, _08087E68 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + ldr r2, _08087E6C + 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 + .align 2, 0 +_08087E60: .4byte 0x03ff03ff +_08087E64: .4byte 0x02032318 +_08087E68: .4byte 0x01001400 +_08087E6C: .4byte 0x03005dc0 + thumb_func_end mapheader_copy_mapdata_with_padding + + thumb_func_start map_copy_with_padding +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, _08087EC4 + 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 + .align 2, 0 +_08087EC4: .4byte 0x03005dc0 + thumb_func_end map_copy_with_padding + + thumb_func_start mapheader_copy_mapdata_of_adjacent_maps +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, _08087F00 + ldr r0, _08087F04 + 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 + .align 2, 0 +_08087F00: .4byte 0x02037340 +_08087F04: .4byte 0x08486ef8 +_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, _08087FB0 + 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, _08087FB4 + 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, _08087FB0 + 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 + .align 2, 0 +_08087FB0: .4byte 0x03005dc0 +_08087FB4: .4byte 0x001fffff + 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, _08087FE8 + ldr r3, [r0] + cmp r2, r3 + bge _08087FE2 + adds r3, r2, 0 +_08087FE2: + movs r2, 0 + b _08087FFC + .align 2, 0 +_08087FE8: .4byte 0x03005dc0 +_08087FEC: + movs r6, 0 + adds r0, r2, r4 + ldr r1, _0808801C + 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 + .align 2, 0 +_0808801C: .4byte 0x03005dc0 + 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, _0808804C + ldr r3, [r0] + cmp r2, r3 + bge _08088046 + adds r3, r2, 0 +_08088046: + movs r2, 0 + b _08088060 + .align 2, 0 +_0808804C: .4byte 0x03005dc0 +_08088050: + movs r6, 0 + adds r0, r2, r4 + ldr r1, _0808807C + 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 + .align 2, 0 +_0808807C: .4byte 0x03005dc0 + 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, _080880AC + ldr r3, [r0, 0x4] + cmp r1, r3 + bge _080880A6 + adds r3, r1, 0 +_080880A6: + movs r2, 0 + b _080880C0 + .align 2, 0 +_080880AC: .4byte 0x03005dc0 +_080880B0: + movs r6, 0 + adds r0, r2, r4 + ldr r1, _080880DC + 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 + .align 2, 0 +_080880DC: .4byte 0x03005dc0 + 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, _08088110 + ldr r3, [r0, 0x4] + cmp r1, r3 + bge _0808810A + adds r3, r1, 0 +_0808810A: + movs r2, 0 + b _08088124 + .align 2, 0 +_08088110: .4byte 0x03005dc0 +_08088114: + movs r6, 0 + adds r0, r2, r4 + ldr r1, _08088140 + 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 + .align 2, 0 +_08088140: .4byte 0x03005dc0 + thumb_func_end sub_80880E0 + + thumb_func_start cur_mapdata_get_upper4bit_at +cur_mapdata_get_upper4bit_at: @ 8088144 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + blt _08088174 + ldr r1, _08088170 + 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 + .align 2, 0 +_08088170: .4byte 0x03005dc0 +_08088174: + ldr r0, _080881A0 + 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, _080881A4 + cmp r1, r0 + beq _080881A8 + lsrs r0, r1, 12 + b _080881AA + .align 2, 0 +_080881A0: .4byte 0x02037318 +_080881A4: .4byte 0x000003ff +_080881A8: + movs r0, 0 +_080881AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_get_upper4bit_at + + thumb_func_start cur_mapdata_get_middle2bit_at +cur_mapdata_get_middle2bit_at: @ 80881B0 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + blt _080881E0 + ldr r1, _080881DC + 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 + .align 2, 0 +_080881DC: .4byte 0x03005dc0 +_080881E0: + ldr r0, _08088214 + 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, _08088218 + cmp r1, r0 + beq _0808821C + movs r0, 0xC0 + lsls r0, 4 + ands r1, r0 + lsrs r0, r1, 10 + b _0808821E + .align 2, 0 +_08088214: .4byte 0x02037318 +_08088218: .4byte 0x000003ff +_0808821C: + movs r0, 0x1 +_0808821E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_get_middle2bit_at + + thumb_func_start cur_mapdata_get_blockid_at +cur_mapdata_get_blockid_at: @ 8088224 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + cmp r5, 0 + blt _08088254 + ldr r1, _08088250 + 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 + .align 2, 0 +_08088250: .4byte 0x03005dc0 +_08088254: + ldr r0, _08088284 + 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, _08088288 + cmp r4, r0 + beq _0808828C + ands r4, r0 + adds r0, r4, 0 + b _080882B0 + .align 2, 0 +_08088284: .4byte 0x02037318 +_08088288: .4byte 0x000003ff +_0808828C: + ldr r0, _080882B8 + 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 + .align 2, 0 +_080882B8: .4byte 0x02037318 + thumb_func_end cur_mapdata_get_blockid_at + + thumb_func_start cur_mapdata_block_get_role_at +cur_mapdata_block_get_role_at: @ 80882BC + push {lr} + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r0, 16 + bl cur_mapdata_get_behaviour_by_blockid + adds r1, r0, 0 + movs r0, 0xFF + ands r0, r1 + pop {r1} + bx r1 + thumb_func_end cur_mapdata_block_get_role_at + + thumb_func_start cur_mapdata_block_get_bgs_at +cur_mapdata_block_get_bgs_at: @ 80882D4 + push {lr} + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r0, 16 + bl cur_mapdata_get_behaviour_by_blockid + adds r1, r0, 0 + movs r0, 0xF0 + lsls r0, 8 + ands r0, r1 + lsrs r0, 12 + pop {r1} + bx r1 + thumb_func_end cur_mapdata_block_get_bgs_at + + thumb_func_start setmaptile_0 +setmaptile_0: @ 80882F0 + push {r4,r5,lr} + adds r3, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + cmp r3, 0 + blt _08088328 + ldr r2, _08088330 + 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, _08088334 + ands r0, r5 + orrs r2, r0 + strh r2, [r1] +_08088328: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088330: .4byte 0x03005dc0 +_08088334: .4byte 0x00000fff + thumb_func_end setmaptile_0 + + thumb_func_start sub_8088338 +sub_8088338: @ 8088338 + push {r4,r5,lr} + adds r3, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + cmp r3, 0 + blt _08088364 + ldr r2, _0808836C + 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 + .align 2, 0 +_0808836C: .4byte 0x03005dc0 + thumb_func_end sub_8088338 + + thumb_func_start cur_mapdata_get_behaviour_by_blockid +cur_mapdata_get_behaviour_by_blockid: @ 8088370 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + ldr r0, _0808838C + cmp r2, r0 + bhi _08088394 + ldr r0, _08088390 + ldr r0, [r0] + ldr r0, [r0, 0x10] + ldr r1, [r0, 0x10] + lsls r0, r2, 1 + b _080883B2 + .align 2, 0 +_0808838C: .4byte 0x000001ff +_08088390: .4byte 0x02037318 +_08088394: + ldr r0, _080883A0 + cmp r2, r0 + bls _080883A4 + movs r0, 0xFF + b _080883B6 + .align 2, 0 +_080883A0: .4byte 0x000003ff +_080883A4: + ldr r0, _080883BC + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x10] + lsls r0, r3, 1 + adds r0, r1 + ldr r1, _080883C0 +_080883B2: + adds r0, r1 + ldrh r0, [r0] +_080883B6: + pop {r1} + bx r1 + .align 2, 0 +_080883BC: .4byte 0x02037318 +_080883C0: .4byte 0xfffffc00 + thumb_func_end cur_mapdata_get_behaviour_by_blockid + + 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, _0808842C + ldr r1, [r0] + adds r4, r1, 0 + adds r4, 0x34 + ldr r0, _08088430 + 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, _08088434 + 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 + .align 2, 0 +_0808842C: .4byte 0x03005d8c +_08088430: .4byte 0x03005dc0 +_08088434: .4byte 0x02032318 + 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, _08088464 + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x34 + ldr r4, _08088468 +_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 + .align 2, 0 +_08088464: .4byte 0x03005d8c +_08088468: .4byte 0x000001ff +_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, _08088494 + ldr r1, [r0] + adds r1, 0x34 + ldr r2, _08088498 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08088494: .4byte 0x03005d8c +_08088498: .4byte 0x01000100 + 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, _080884E4 + ldr r0, [r4] + adds r7, r0, 0 + adds r7, 0x34 + bl sub_8088438 + cmp r0, 0 + bne _080885AC + ldr r0, _080884E8 + 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 + .align 2, 0 +_080884E4: .4byte 0x03005d8c +_080884E8: .4byte 0x03005dc0 +_080884EC: + mov r0, r8 + adds r0, 0xD + movs r1, 0xFF + mov r9, r1 + cmp r6, r0 + bne _08088508 + ldr r0, _080885BC + 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, _080885C0 + 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, _080885BC + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r6, r0 + bge _08088598 + asrs r0, r4, 16 + asrs r1, r7, 16 + bl task00_bag_acit_10 +_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 + .align 2, 0 +_080885BC: .4byte 0x02037318 +_080885C0: .4byte 0x02032318 + 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, _0808860C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x34 + str r0, [sp, 0x4] + ldr r0, _08088610 + 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 + .align 2, 0 +_0808860C: .4byte 0x03005d8c +_08088610: .4byte 0x03005dc0 +_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, _08088698 + 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 + .align 2, 0 +_08088698: .4byte 0x02032318 + thumb_func_end sub_80885C4 + + thumb_func_start mapborder_visible_from_position +mapborder_visible_from_position: @ 808869C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + cmp r4, 0 + blt _080886D8 + ldr r1, _080886D0 + 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, _080886D4 + cmp r1, r0 + beq _08088770 + b _08088700 + .align 2, 0 +_080886D0: .4byte 0x03005dc0 +_080886D4: .4byte 0x000003ff +_080886D8: + ldr r0, _0808871C + 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, _08088720 + cmp r0, r1 + beq _08088770 +_08088700: + ldr r1, _08088724 + ldr r0, [r1] + subs r0, 0x8 + cmp r4, r0 + blt _0808872C + ldr r0, _08088728 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x4 + b _08088782 + .align 2, 0 +_0808871C: .4byte 0x02037318 +_08088720: .4byte 0x000003ff +_08088724: .4byte 0x03005dc0 +_08088728: .4byte 0x02037340 +_0808872C: + cmp r4, 0x6 + bgt _08088744 + ldr r0, _08088740 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x3 + b _08088782 + .align 2, 0 +_08088740: .4byte 0x02037340 +_08088744: + ldr r0, [r1, 0x4] + subs r0, 0x7 + cmp r5, r0 + blt _08088760 + ldr r0, _0808875C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x1 + b _08088782 + .align 2, 0 +_0808875C: .4byte 0x02037340 +_08088760: + cmp r5, 0x6 + bgt _08088780 + ldr r0, _08088778 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0808877C +_08088770: + movs r0, 0x1 + negs r0, r0 + b _08088782 + .align 2, 0 +_08088778: .4byte 0x02037340 +_0808877C: + movs r0, 0x2 + b _08088782 +_08088780: + movs r0, 0 +_08088782: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end mapborder_visible_from_position + + thumb_func_start sub_8088788 +sub_8088788: @ 8088788 + push {r4,lr} + adds r3, r1, 0 + ldr r1, _080887AC + 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 mapborder_visible_from_position + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080887AC: .4byte 0x03005d8c + thumb_func_end sub_8088788 + + thumb_func_start sub_80887B0 +sub_80887B0: @ 80887B0 + push {r4,r5,lr} + ldr r1, _080887E8 + ldr r4, [r1] + movs r1, 0 + ldrsh r3, [r4, r1] + ldr r2, _080887EC + 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 mapborder_visible_from_position + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080887F0 + movs r0, 0x1 + b _080887F2 + .align 2, 0 +_080887E8: .4byte 0x03005d8c +_080887EC: .4byte 0x08339d64 +_080887F0: + movs r0, 0 +_080887F2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80887B0 + + 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, _08088830 + ldr r1, [r0] + negs r0, r6 + strh r0, [r1] + ldr r2, [r5, 0x4] + ldrh r0, [r1, 0x2] + subs r0, r2 + b _08088870 + .align 2, 0 +_08088830: .4byte 0x03005d8c +_08088834: + ldr r0, _08088848 + 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 + .align 2, 0 +_08088848: .4byte 0x03005d8c +_0808884C: + ldr r0, _0808885C + ldr r1, [r0] + ldr r2, [r5, 0x4] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + negs r0, r7 + b _08088870 + .align 2, 0 +_0808885C: .4byte 0x03005d8c +_08088860: + ldr r0, _08088878 + 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 + .align 2, 0 +_08088878: .4byte 0x03005d8c + thumb_func_end sub_80887F8 + + thumb_func_start camera_move_maybe +camera_move_maybe: @ 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, _080888BC + ldrb r0, [r1] + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + ldr r2, _080888BC + strb r1, [r2] + mov r0, r10 + mov r1, r9 + bl sub_8088788 + adds r7, r0, 0 + adds r0, r7, 0x1 + cmp r0, 0x1 + bhi _080888C4 + ldr r0, _080888C0 + 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 + .align 2, 0 +_080888BC: .4byte 0x02037334 +_080888C0: .4byte 0x03005d8c +_080888C4: + bl save_serialize_map + bl sub_81BE72C + ldr r1, _08088948 + 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, _0808894C + ldrb r0, [r1] + movs r1, 0x1 + orrs r0, r1 + ldr r2, _0808894C + strb r0, [r2] + ldr r0, _08088948 + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + subs r5, r0 + ldr r0, _0808894C + str r5, [r0, 0x4] + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r6, r0 + ldr r0, _0808894C + 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, _0808894C + 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 + .align 2, 0 +_08088948: .4byte 0x03005d8c +_0808894C: .4byte 0x02037334 + thumb_func_end camera_move_maybe + + 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, _0808898C + 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 + .align 2, 0 +_0808898C: .4byte 0x02037318 +_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, _080889DC + ldr r0, [r0] + ldr r1, [r0] + ldr r0, [r2] + ldr r2, [r0] + ldr r3, [r5, 0x4] + adds r0, r7, 0 + b _080889F2 + .align 2, 0 +_080889DC: .4byte 0x02037318 +_080889E0: + cmp r6, 0x4 + bgt _08088A00 + ldr r0, _080889FC + 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 + .align 2, 0 +_080889FC: .4byte 0x02037318 +_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, _08088AAC + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _08088AB4 + b _08088B2A + .align 2, 0 +_08088AAC: .4byte 0x02037318 +_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, _08088B54 + ldr r2, [r2] + subs r0, 0x7 + strh r0, [r2] + subs r1, 0x7 + strh r1, [r2, 0x2] + bx lr + .align 2, 0 +_08088B54: .4byte 0x03005d8c + thumb_func_end sub_8088B3C + + thumb_func_start sav1_camera_get_focus_coords +sav1_camera_get_focus_coords: @ 8088B58 + ldr r2, _08088B6C + ldr r3, [r2] + ldrh r2, [r3] + adds r2, 0x7 + strh r2, [r0] + ldrh r0, [r3, 0x2] + adds r0, 0x7 + strh r0, [r1] + bx lr + .align 2, 0 +_08088B6C: .4byte 0x03005d8c + thumb_func_end sav1_camera_get_focus_coords + + thumb_func_start sub_8088B70 +sub_8088B70: @ 8088B70 + ldr r2, _08088B7C + ldr r2, [r2] + strh r0, [r2] + strh r1, [r2, 0x2] + bx lr + .align 2, 0 +_08088B7C: .4byte 0x03005d8c + thumb_func_end sub_8088B70 + + thumb_func_start sub_8088B80 +sub_8088B80: @ 8088B80 + ldr r2, _08088B90 + ldr r3, [r2] + ldrh r2, [r3] + strh r2, [r0] + ldrh r0, [r3, 0x2] + strh r0, [r1] + bx lr + .align 2, 0 +_08088B90: .4byte 0x03005d8c + thumb_func_end sub_8088B80 + + 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, _08088BD0 + 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 + .align 2, 0 +_08088BD0: .4byte 0x03005dc0 +_08088BD4: + muls r1, r3 + adds r1, r4, r1 + ldr r0, [r2, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r2, [r1] + ldr r0, _08088BEC + ands r0, r2 + strh r0, [r1] +_08088BE6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088BEC: .4byte 0x0000f3ff + 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, _08088C28 + 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 + .align 2, 0 +_08088C28: .4byte 0x000003ff +_08088C2C: + movs r0, 0x1 +_08088C2E: + pop {r1} + bx r1 + thumb_func_end sub_8088BF0 + + thumb_func_start copy_tileset_patterns_to_vram +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 gpu_copy_bg_tile_pattern_data_to_vram + 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 +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 gpu_copy_bg_tile_pattern_data_to_vram + 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 +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 +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 +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 +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 +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 +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 +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 +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 sub_8088DEC +sub_8088DEC: @ 8088DEC + movs r0, 0x1 + bx lr + thumb_func_end sub_8088DEC + + thumb_func_start sub_8088DF0 +sub_8088DF0: @ 8088DF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08088E08 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08088E0C + movs r0, 0 + b _08088E0E + .align 2, 0 +_08088E08: .4byte 0x08486efc +_08088E0C: + movs r0, 0x1 +_08088E0E: + pop {r1} + bx r1 + thumb_func_end sub_8088DF0 + + thumb_func_start is_tile_x38 +is_tile_x38: @ 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 is_tile_x38 + + thumb_func_start is_tile_x39 +is_tile_x39: @ 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 is_tile_x39 + + thumb_func_start is_tile_x3A +is_tile_x3A: @ 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 is_tile_x3A + + thumb_func_start is_tile_x3B +is_tile_x3B: @ 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 is_tile_x3B + + 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 is_x21_or_x2B +is_x21_or_x2B: @ 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 is_x21_or_x2B + + thumb_func_start zero_0 +zero_0: @ 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 zero_0 + + thumb_func_start is_water_tile_2 +is_water_tile_2: @ 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 is_water_tile_2 + + thumb_func_start is_tile_x23_2 +is_tile_x23_2: @ 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 is_tile_x23_2 + + 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 is_tile_TODO +is_tile_TODO: @ 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 is_tile_TODO + + 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 is_tile_x61_warp +is_tile_x61_warp: @ 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 is_tile_x61_warp + + 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 is_tile_grass_maybe +is_tile_grass_maybe: @ 8088F88 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08088FA0 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08088FA4 + movs r0, 0 + b _08088FA6 + .align 2, 0 +_08088FA0: .4byte 0x08486efc +_08088FA4: + movs r0, 0x1 +_08088FA6: + pop {r1} + bx r1 + thumb_func_end is_tile_grass_maybe + + thumb_func_start is_tile_x62_warp_arrow_right +is_tile_x62_warp_arrow_right: @ 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 is_tile_x62_warp_arrow_right + + thumb_func_start is_tile_x63_warp_arrow_left +is_tile_x63_warp_arrow_left: @ 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 is_tile_x63_warp_arrow_left + + thumb_func_start sub_8088FD4 +sub_8088FD4: @ 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 sub_8088FD4 + + thumb_func_start is_tile_x65_warp_arrow_down +is_tile_x65_warp_arrow_down: @ 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 is_tile_x65_warp_arrow_down + + 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 is_tile_x62_warp_arrow_right + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl is_tile_x63_warp_arrow_left + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl sub_8088FD4 + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl is_tile_x65_warp_arrow_down + 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 sub_808908C +sub_808908C: @ 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 sub_808908C + + thumb_func_start is_tile_x48_slide_around +is_tile_x48_slide_around: @ 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 is_tile_x48_slide_around + + thumb_func_start sub_80890B4 +sub_80890B4: @ 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 sub_80890B4 + + thumb_func_start task00_0800DE4C +task00_0800DE4C: @ 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 task00_0800DE4C + + thumb_func_start is_tile_x43_walk_down +is_tile_x43_walk_down: @ 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 is_tile_x43_walk_down + + thumb_func_start is_tile_x41_walk_left +is_tile_x41_walk_left: @ 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 is_tile_x41_walk_left + + thumb_func_start is_tile_x40_walk_right +is_tile_x40_walk_right: @ 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 is_tile_x40_walk_right + + thumb_func_start is_tile_x52_run_up +is_tile_x52_run_up: @ 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 is_tile_x52_run_up + + thumb_func_start is_tile_x53_run_down +is_tile_x53_run_down: @ 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 is_tile_x53_run_down + + thumb_func_start is_tile_x51_run_left +is_tile_x51_run_left: @ 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 is_tile_x51_run_left + + thumb_func_start is_tile_x50_run_right +is_tile_x50_run_right: @ 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 is_tile_x50_run_right + + thumb_func_start is_tile_x46_slide_up +is_tile_x46_slide_up: @ 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 is_tile_x46_slide_up + + thumb_func_start is_tile_x47_slide_down +is_tile_x47_slide_down: @ 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 is_tile_x47_slide_down + + thumb_func_start is_tile_x45_slide_left +is_tile_x45_slide_left: @ 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 is_tile_x45_slide_left + + thumb_func_start is_tile_x44_slide_right +is_tile_x44_slide_right: @ 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 is_tile_x44_slide_right + + thumb_func_start is_tile_x80 +is_tile_x80: @ 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 is_tile_x80 + + thumb_func_start is_tile_x86_and_npcunk2_is_x2 +is_tile_x86_and_npcunk2_is_x2: @ 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 is_tile_x86_and_npcunk2_is_x2 + + thumb_func_start IsMetatileComputer +IsMetatileComputer: @ 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 IsMetatileComputer + + 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 is_tile_x10_or_x16 +is_tile_x10_or_x16: @ 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 is_tile_x10_or_x16 + + thumb_func_start is_tile_x16_clear_water +is_tile_x16_clear_water: @ 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 is_tile_x16_clear_water + + thumb_func_start is_tile_x02_or_xD1 +is_tile_x02_or_xD1: @ 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 is_tile_x02_or_xD1 + + thumb_func_start is_tile_tallgrass +is_tile_tallgrass: @ 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 is_tile_tallgrass + + thumb_func_start is_tile_xA0 +is_tile_xA0: @ 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 is_tile_xA0 + + thumb_func_start sub_8089484 +sub_8089484: @ 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 sub_8089484 + + thumb_func_start sub_8089498 +sub_8089498: @ 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 sub_8089498 + + 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 is_tile_grass_maybe + 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 is_tile_grass_maybe + 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 sub_80895E8 +sub_80895E8: @ 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 sub_80895E8 + + 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 is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + beq _08089682 + adds r0, r4, 0 + bl is_tile_x13_waterfall + 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 sub_808968C +sub_808968C: @ 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 sub_808968C + + thumb_func_start sub_80896B0 +sub_80896B0: @ 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 sub_80896B0 + + thumb_func_start sub_80896D4 +sub_80896D4: @ 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 sub_80896D4 + + thumb_func_start sub_80896F4 +sub_80896F4: @ 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 sub_80896F4 + + thumb_func_start sub_8089714 +sub_8089714: @ 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 sub_8089714 + + thumb_func_start is_tile_halfwater +is_tile_halfwater: @ 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 is_tile_halfwater + + thumb_func_start is_tile_x13_waterfall +is_tile_x13_waterfall: @ 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 is_tile_x13_waterfall + + thumb_func_start sub_8089750 +sub_8089750: @ 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 sub_8089750 + + 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 is_tile_x17 +is_tile_x17: @ 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 is_tile_x17 + + 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 sub_8089848 +sub_8089848: @ 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 sub_8089848 + + thumb_func_start sub_808985C +sub_808985C: @ 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 sub_808985C + + 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 sub_8089898 +sub_8089898: @ 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 sub_8089898 + + 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 block_field_1_weird_index +block_field_1_weird_index: @ 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 block_field_1_weird_index + + 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 sub_8089940 +sub_8089940: @ 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 sub_8089940 + + thumb_func_start sub_8089954 +sub_8089954: @ 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 sub_8089954 + + thumb_func_start sub_8089968 +sub_8089968: @ 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 sub_8089968 + + thumb_func_start sub_808997C +sub_808997C: @ 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 sub_808997C + + thumb_func_start sub_8089990 +sub_8089990: @ 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 sub_8089990 + + thumb_func_start sub_80899A4 +sub_80899A4: @ 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 sub_80899A4 + + thumb_func_start it_tile_x22 +it_tile_x22: @ 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 it_tile_x22 + + thumb_func_start sub_80899D0 +sub_80899D0: @ 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 is_tile_x17 + 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 sub_80899D0 + + 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 is_tile_x8F +is_tile_x8F: @ 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 is_tile_x8F + + thumb_func_start sub_8089B1C +sub_8089B1C: @ 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 sub_8089B1C + + thumb_func_start sub_8089B30 +sub_8089B30: @ 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 sub_8089B30 + + thumb_func_start sub_8089B44 +sub_8089B44: @ 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 sub_8089B44 + + thumb_func_start move_tilemap_camera_to_upper_left_corner_ +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 +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 +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 +move_tilemap_camera_to_upper_left_corner: @ 8089B94 + push {lr} + ldr r0, _08089BA0 + bl move_tilemap_camera_to_upper_left_corner_ + pop {r0} + bx r0 + .align 2, 0 +_08089BA0: .4byte 0x03000e20 + thumb_func_end move_tilemap_camera_to_upper_left_corner + + thumb_func_start sub_8089BA4 +sub_8089BA4: @ 8089BA4 + push {r4,r5,lr} + ldr r1, _08089BFC + ldr r0, _08089C00 + movs r2, 0 + ldrsh r5, [r0, r2] + ldrb r0, [r1] + adds r5, r0 + ldr r0, _08089C04 + 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 lcd_io_set + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x16 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x18 + adds r1, r5, 0 + bl lcd_io_set + movs r0, 0x1A + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x1C + adds r1, r5, 0 + bl lcd_io_set + movs r0, 0x1E + adds r1, r4, 0 + bl lcd_io_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089BFC: .4byte 0x03000e20 +_08089C00: .4byte 0x03000e28 +_08089C04: .4byte 0x03000e2a + thumb_func_end sub_8089BA4 + + thumb_func_start sub_8089C08 +sub_8089C08: @ 8089C08 + push {r4,lr} + ldr r3, _08089C28 + ldr r2, _08089C2C + ldrh r2, [r2] + ldrb r4, [r3] + adds r2, r4 + strh r2, [r0] + ldr r0, _08089C30 + ldrh r0, [r0] + ldrb r3, [r3, 0x1] + adds r0, r3 + adds r0, 0x8 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08089C28: .4byte 0x03000e20 +_08089C2C: .4byte 0x03000e28 +_08089C30: .4byte 0x03000e2a + thumb_func_end sub_8089C08 + + thumb_func_start cur_mapdata_full_redraw +cur_mapdata_full_redraw: @ 8089C34 + push {lr} + ldr r0, _08089C54 + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + ldr r2, _08089C58 + ldr r2, [r2] + bl cur_mapdata_redraw_all_blocks_at + ldr r1, _08089C5C + movs r0, 0x1 + strb r0, [r1, 0x4] + pop {r0} + bx r0 + .align 2, 0 +_08089C54: .4byte 0x03005d8c +_08089C58: .4byte 0x02037318 +_08089C5C: .4byte 0x03000e20 + thumb_func_end cur_mapdata_full_redraw + + thumb_func_start cur_mapdata_redraw_all_blocks_at +cur_mapdata_redraw_all_blocks_at: @ 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, _08089CE0 + 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, _08089CE0 + 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 cur_mapdata_draw_block_at_internal + 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 + .align 2, 0 +_08089CE0: .4byte 0x03000e20 + thumb_func_end cur_mapdata_redraw_all_blocks_at + + thumb_func_start cur_mapheader_draw_map_slice +cur_mapheader_draw_map_slice: @ 8089CE4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r0, _08089D2C + ldr r4, [r0] + cmp r6, 0 + ble _08089CFC + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapheader_draw_map_slice_left +_08089CFC: + cmp r6, 0 + bge _08089D08 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapheader_draw_map_slice_right +_08089D08: + cmp r7, 0 + ble _08089D14 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapheader_draw_map_slice_above +_08089D14: + cmp r7, 0 + bge _08089D20 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapheader_draw_map_slice_below +_08089D20: + movs r0, 0x1 + strb r0, [r5, 0x4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08089D2C: .4byte 0x02037318 + thumb_func_end cur_mapheader_draw_map_slice + + thumb_func_start cur_mapheader_draw_map_slice_above +cur_mapheader_draw_map_slice_above: @ 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, _08089D8C + 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 cur_mapdata_draw_block_at_internal + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089D4C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08089D8C: .4byte 0x03005d8c + thumb_func_end cur_mapheader_draw_map_slice_above + + thumb_func_start cur_mapheader_draw_map_slice_below +cur_mapheader_draw_map_slice_below: @ 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, _08089DD8 + 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 cur_mapdata_draw_block_at_internal + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089D9C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08089DD8: .4byte 0x03005d8c + thumb_func_end cur_mapheader_draw_map_slice_below + + thumb_func_start cur_mapheader_draw_map_slice_right +cur_mapheader_draw_map_slice_right: @ 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, _08089E30 + 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 cur_mapdata_draw_block_at_internal + 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 + .align 2, 0 +_08089E30: .4byte 0x03005d8c + thumb_func_end cur_mapheader_draw_map_slice_right + + thumb_func_start cur_mapheader_draw_map_slice_left +cur_mapheader_draw_map_slice_left: @ 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, _08089E9C + 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 cur_mapdata_draw_block_at_internal + 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 + .align 2, 0 +_08089E9C: .4byte 0x03005d8c + thumb_func_end cur_mapheader_draw_map_slice_left + + thumb_func_start cur_mapdata_draw_block_at +cur_mapdata_draw_block_at: @ 8089EA0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r6, _08089ED4 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl map_pos_to_screenspace + adds r1, r0, 0 + cmp r1, 0 + blt _08089ECC + ldr r0, _08089ED8 + ldr r0, [r0] + lsls r1, 16 + lsrs r1, 16 + adds r2, r4, 0 + adds r3, r5, 0 + bl cur_mapdata_draw_block_at_internal + movs r0, 0x1 + strb r0, [r6, 0x4] +_08089ECC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08089ED4: .4byte 0x03000e20 +_08089ED8: .4byte 0x02037318 + thumb_func_end cur_mapdata_draw_block_at + + thumb_func_start overworld_draw_block_type1_on_map_coord +overworld_draw_block_type1_on_map_coord: @ 8089EDC + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r6, _08089F0C + adds r0, r6, 0 + adds r1, r3, 0 + adds r2, r4, 0 + bl map_pos_to_screenspace + cmp r0, 0 + blt _08089F04 + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r5, 0 + bl overworld_draw_block + movs r0, 0x1 + strb r0, [r6, 0x4] +_08089F04: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08089F0C: .4byte 0x03000e20 + thumb_func_end overworld_draw_block_type1_on_map_coord + + thumb_func_start cur_mapdata_draw_block_at_internal +cur_mapdata_draw_block_at_internal: @ 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 cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x80 + lsls r0, 3 + cmp r4, r0 + bls _08089F38 + movs r4, 0 +_08089F38: + ldr r0, _08089F44 + cmp r4, r0 + bhi _08089F48 + ldr r0, [r5, 0x10] + ldr r5, [r0, 0xC] + b _08089F54 + .align 2, 0 +_08089F44: .4byte 0x000001ff +_08089F48: + ldr r0, [r5, 0x14] + ldr r5, [r0, 0xC] + ldr r1, _08089F74 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_08089F54: + adds r0, r6, 0 + adds r1, r7, 0 + bl cur_mapdata_block_get_bgs_at + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + adds r1, r5, r1 + mov r2, r8 + bl overworld_draw_block + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08089F74: .4byte 0xfffffe00 + thumb_func_end cur_mapdata_draw_block_at_internal + + thumb_func_start overworld_draw_block +overworld_draw_block: @ 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, _08089FC8 + 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, _08089FCC + 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 + .align 2, 0 +_08089FC8: .4byte 0x03005da4 +_08089FCC: .4byte 0x03005d9c +_08089FD0: + ldr r0, _0808A024 + 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, _0808A028 + 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, _0808A02C + 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 + .align 2, 0 +_0808A024: .4byte 0x03005da4 +_0808A028: .4byte 0x03005d9c +_0808A02C: .4byte 0x03005da0 +_0808A030: + ldr r0, _0808A09C + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldr r1, _0808A0A0 + 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, _0808A0A4 + 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, _0808A0A8 + 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 + .align 2, 0 +_0808A09C: .4byte 0x03005da4 +_0808A0A0: .4byte 0x00003014 +_0808A0A4: .4byte 0x03005d9c +_0808A0A8: .4byte 0x03005da0 + thumb_func_end overworld_draw_block + + thumb_func_start map_pos_to_screenspace +map_pos_to_screenspace: @ 808A0AC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _0808A0DC + 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 + .align 2, 0 +_0808A0DC: .4byte 0x03005d8c +_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 map_pos_to_screenspace + + thumb_func_start sub_808A0F4 +sub_808A0F4: @ 808A0F4 + push {lr} + adds r3, r0, 0 + ldr r2, [r3, 0x4] + cmp r2, 0 + beq _0808A114 + ldr r1, _0808A118 + 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 + .align 2, 0 +_0808A118: .4byte 0x02020630 + thumb_func_end sub_808A0F4 + + thumb_func_start clear_all_callback6 +clear_all_callback6: @ 808A11C + ldr r1, _0808A130 + 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 + .align 2, 0 +_0808A130: .4byte 0x03005dd0 + thumb_func_end clear_all_callback6 + + thumb_func_start sub_808A134 +sub_808A134: @ 808A134 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _0808A168 + ldr r1, [r4, 0x4] + cmp r1, 0 + beq _0808A150 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808A16C + adds r0, r1 + bl obj_delete_and_free_tiles +_0808A150: + adds r0, r5, 0 + bl sub_808ED34 + lsls r0, 24 + lsrs r0, 24 + str r0, [r4, 0x4] + ldr r0, _0808A170 + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808A168: .4byte 0x03005dd0 +_0808A16C: .4byte 0x02020630 +_0808A170: .4byte sub_808A0F4 + 1 + thumb_func_end sub_808A134 + + thumb_func_start camera_update +camera_update: @ 808A174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r6, _0808A274 + 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, _0808A274 + 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 camera_move_maybe + adds r0, r4, 0 + adds r1, r5, 0 + bl overworld_rebase + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBEA8 + bl sub_80E1D6C + ldr r6, _0808A278 + 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 cur_mapheader_draw_map_slice +_0808A24E: + ldr r0, _0808A278 + adds r1, r7, 0 + mov r2, r8 + bl coords8_add + ldr r1, _0808A27C + ldrh r0, [r1] + subs r0, r7 + strh r0, [r1] + ldr r1, _0808A280 + ldrh r0, [r1] + mov r2, r8 + subs r0, r2 + strh r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808A274: .4byte 0x03005dd0 +_0808A278: .4byte 0x03000e20 +_0808A27C: .4byte 0x03005dec +_0808A280: .4byte 0x03005de8 + thumb_func_end camera_update + + thumb_func_start camera_move_and_redraw +camera_move_and_redraw: @ 808A284 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl camera_move_maybe + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + bl overworld_rebase + bl cur_mapdata_full_redraw + ldr r1, _0808A2B8 + lsls r4, 4 + ldrh r0, [r1] + subs r0, r4 + strh r0, [r1] + ldr r1, _0808A2BC + lsls r5, 4 + ldrh r0, [r1] + subs r0, r5 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A2B8: .4byte 0x03005dec +_0808A2BC: .4byte 0x03005de8 + thumb_func_end camera_move_and_redraw + + thumb_func_start sub_808A2C0 +sub_808A2C0: @ 808A2C0 + ldr r1, _0808A2C8 + str r0, [r1] + bx lr + .align 2, 0 +_0808A2C8: .4byte 0x03000e30 + thumb_func_end sub_808A2C0 + + thumb_func_start sub_808A2CC +sub_808A2CC: @ 808A2CC + ldr r2, _0808A2DC + strh r0, [r2] + ldr r0, _0808A2E0 + lsls r1, 16 + asrs r1, 16 + adds r1, 0x20 + strh r1, [r0] + bx lr + .align 2, 0 +_0808A2DC: .4byte 0x03000e28 +_0808A2E0: .4byte 0x03000e2a + thumb_func_end sub_808A2CC + + thumb_func_start sub_808A2E4 +sub_808A2E4: @ 808A2E4 + ldr r1, _0808A300 + ldr r0, _0808A304 + str r0, [r1] + ldr r1, _0808A308 + movs r0, 0 + strb r0, [r1] + ldr r1, _0808A30C + movs r0, 0 + strh r0, [r1] + ldr r1, _0808A310 + movs r0, 0x20 + strh r0, [r1] + bx lr + .align 2, 0 +_0808A300: .4byte 0x03000e30 +_0808A304: .4byte nu_805AE74 + 1 +_0808A308: .4byte 0x03000e2c +_0808A30C: .4byte 0x03000e28 +_0808A310: .4byte 0x03000e2a + thumb_func_end sub_808A2E4 + + thumb_func_start sub_808A314 +sub_808A314: @ 808A314 + push {lr} + ldr r0, _0808A344 + ldr r0, [r0] + cmp r0, 0 + beq _0808A322 + bl _call_via_r0 +_0808A322: + ldr r2, _0808A348 + ldr r0, _0808A34C + ldr r1, _0808A350 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2] + ldr r2, _0808A354 + ldr r0, _0808A358 + ldr r1, _0808A35C + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + subs r0, 0x8 + strh r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_0808A344: .4byte 0x03000e30 +_0808A348: .4byte 0x02021bbc +_0808A34C: .4byte 0x03005dec +_0808A350: .4byte 0x03000e28 +_0808A354: .4byte 0x02021bbe +_0808A358: .4byte 0x03005de8 +_0808A35C: .4byte 0x03000e2a + thumb_func_end sub_808A314 + + thumb_func_start nu_805AE74 +nu_805AE74: @ 808A360 + push {lr} + ldr r0, _0808A370 + ldrb r0, [r0] + cmp r0, 0 + bne _0808A374 + bl sub_808A2E4 + b _0808A3FC + .align 2, 0 +_0808A370: .4byte 0x02037348 +_0808A374: + ldr r0, _0808A38C + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + bne _0808A394 + ldr r0, _0808A390 + ldrb r1, [r0] + movs r2, 0x1 + eors r1, r2 + strb r1, [r0] + cmp r1, 0 + beq _0808A3FC + b _0808A39A + .align 2, 0 +_0808A38C: .4byte 0x02037590 +_0808A390: .4byte 0x03000e2c +_0808A394: + ldr r1, _0808A3BC + movs r0, 0 + strb r0, [r1] +_0808A39A: + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808A3C4 + ldr r2, _0808A3C0 + 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 + .align 2, 0 +_0808A3BC: .4byte 0x03000e2c +_0808A3C0: .4byte 0x03000e2a +_0808A3C4: + cmp r0, 0x1 + bne _0808A3E0 + ldr r1, _0808A3DC + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x47 + bgt _0808A3FC + adds r0, r2, 0x2 + strh r0, [r1] + b _0808A3FC + .align 2, 0 +_0808A3DC: .4byte 0x03000e2a +_0808A3E0: + ldr r2, _0808A3F0 + ldrh r0, [r2] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x1F + bgt _0808A3F4 + adds r0, 0x2 + b _0808A3FA + .align 2, 0 +_0808A3F0: .4byte 0x03000e2a +_0808A3F4: + cmp r1, 0x20 + ble _0808A3FC + subs r0, 0x2 +_0808A3FA: + strh r0, [r2] +_0808A3FC: + pop {r0} + bx r0 + thumb_func_end nu_805AE74 + + 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, _0808A41C + movs r2, 0x80 + bl CpuFastSet + b _0808A42E + .align 2, 0 +_0808A41C: .4byte 0x06007e00 +_0808A420: + ldrh r1, [r1, 0x2] + ldr r0, [r2, 0x4] + adds r0, r1 + ldr r1, _0808A434 + movs r2, 0x40 + bl CpuFastSet +_0808A42E: + pop {r0} + bx r0 + .align 2, 0 +_0808A434: .4byte 0x06007f00 + 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 overworld_draw_block_type1_on_map_coord + 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 overworld_draw_block_type1_on_map_coord + 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 overworld_draw_block_type1_on_map_coord + 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 overworld_draw_block_type1_on_map_coord + 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 overworld_draw_block_type1_on_map_coord + 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 overworld_draw_block_type1_on_map_coord +_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 cur_mapdata_draw_block_at + adds r0, r5, 0 + adds r1, r6, 0 + bl cur_mapdata_draw_block_at + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + bne _0808A562 + adds r4, r5, 0x1 + adds r0, r4, 0 + adds r1, r7, 0 + bl cur_mapdata_draw_block_at + adds r0, r4, 0 + adds r1, r6, 0 + bl cur_mapdata_draw_block_at +_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, _0808A5A4 + 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, _0808A5A8 + ldrh r1, [r0] + adds r1, 0x7 + ldr r0, _0808A5AC + ldrh r2, [r0] + adds r2, 0x7 + adds r0, r4, 0 + bl sub_808A530 + b _0808A5E2 + .align 2, 0 +_0808A5A4: .4byte 0x0000ffff +_0808A5A8: .4byte 0x020375e0 +_0808A5AC: .4byte 0x020375e2 +_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, _0808A5E8 + ldrh r1, [r0] + adds r1, 0x7 + ldr r0, _0808A5EC + 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 + .align 2, 0 +_0808A5E8: .4byte 0x020375e0 +_0808A5EC: .4byte 0x020375e2 + 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, _0808A688 + 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 + .align 2, 0 +_0808A688: .4byte 0x03005e08 + 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, _0808A710 + 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, _0808A714 + 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 + .align 2, 0 +_0808A710: .4byte task50_overworld_door + 1 +_0808A714: .4byte 0x03005e08 +_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 cur_mapdata_get_blockid_at + 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, _0808A770 + 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 + .align 2, 0 +_0808A770: .4byte 0x08496f8c + thumb_func_end sub_808A734 + + thumb_func_start task_overworld_door_add_for_opening_door_at +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 cur_mapdata_get_blockid_at + 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, _0808A7AC + adds r0, r2, 0 + b _0808A7B4 + .align 2, 0 +_0808A7AC: .4byte 0x08496f8c +_0808A7B0: + ldr r1, _0808A7C8 + 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 + .align 2, 0 +_0808A7C8: .4byte 0x08496fb4 + 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 cur_mapdata_get_blockid_at + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + cmp r0, 0 + beq _0808A800 + ldr r1, _0808A7FC + adds r2, r5, 0 + adds r3, r6, 0 + bl task_overworld_door_add_if_inactive + lsls r0, 24 + asrs r0, 24 + b _0808A804 + .align 2, 0 +_0808A7FC: .4byte 0x08496fa0 +_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 cur_mapdata_get_blockid_at + 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, _0808A850 + adds r1, r3, 0 + bl task_overworld_door_add_for_opening_door_at + pop {r0} + bx r0 + .align 2, 0 +_0808A850: .4byte 0x08497174 + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A876 + ldr r0, _0808A87C + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A734 +_0808A876: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A87C: .4byte 0x08497174 + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A8A2 + ldr r0, _0808A8A8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A728 +_0808A8A2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A8A8: .4byte 0x08497174 + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A8D8 + ldr r0, _0808A8D4 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A7CC + lsls r0, 24 + asrs r0, 24 + b _0808A8DC + .align 2, 0 +_0808A8D4: .4byte 0x08497174 +_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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A910 + ldr r0, _0808A90C + 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 + .align 2, 0 +_0808A90C: .4byte 0x08497174 +_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, _0808A92C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808A92C: .4byte task50_overworld_door + 1 + 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, _0808A950 + 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 + .align 2, 0 +_0808A950: .4byte 0x08497174 +_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, _0808A984 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0808A990 + ldr r0, _0808A988 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _0808A98C + cmp r1, r0 + bne _0808A990 + movs r0, 0x1 + b _0808A992 + .align 2, 0 +_0808A984: .4byte 0x00004002 +_0808A988: .4byte 0x03005d8c +_0808A98C: .4byte 0x0000101a +_0808A990: + movs r0, 0 +_0808A992: + pop {r1} + bx r1 + thumb_func_end sub_808A964 + + thumb_func_start sub_808A998 +sub_808A998: @ 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, _0808A9B4 + adds r0, r2 + ldr r2, _0808A9B8 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808A9B4: .4byte 0x02037350 +_0808A9B8: .4byte sub_808A9BC + 1 + thumb_func_end sub_808A998 + + thumb_func_start sub_808A9BC +sub_808A9BC: @ 808A9BC + movs r0, 0 + bx lr + thumb_func_end sub_808A9BC + + thumb_func_start player_step +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, _0808AA30 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808AA34 + 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 sub_808AA38 + lsls r0, 24 + cmp r0, 0 + bne _0808AA26 + adds r0, r5, 0 + bl npc_clear_strange_bits + bl bike_related + bl sub_808AB14 + lsls r0, 24 + cmp r0, 0 + bne _0808AA26 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + bl player_step_by_keypad + bl walkrun_clear_x20_when_running_fast +_0808AA26: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808AA30: .4byte 0x02037590 +_0808AA34: .4byte 0x02037350 + thumb_func_end player_step + + thumb_func_start sub_808AA38 +sub_808AA38: @ 808AA38 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r6, r5, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _0808AA92 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + bne _0808AA92 + adds r0, r4, 0 + bl npc_get_state_or_xFF + 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 rom_npc_by_local_id_and_map_get_trainer_flag + 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 sub_808AA38 + + thumb_func_start npc_clear_strange_bits +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, _0808AABC + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bx lr + .align 2, 0 +_0808AABC: .4byte 0x02037590 + thumb_func_end npc_clear_strange_bits + + thumb_func_start player_step_by_keypad +player_step_by_keypad: @ 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, _0808AAE4 + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0808AAE8 + adds r0, r3, 0 + adds r1, r4, 0 + bl dp04_initiate_movement + b _0808AAF0 + .align 2, 0 +_0808AAE4: .4byte 0x02037590 +_0808AAE8: + adds r0, r3, 0 + adds r1, r2, 0 + bl dp04_continue_movement +_0808AAF0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end player_step_by_keypad + + thumb_func_start walkrun_clear_x20_when_running_fast +walkrun_clear_x20_when_running_fast: @ 808AAF8 + push {lr} + ldr r2, _0808AB10 + 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 + .align 2, 0 +_0808AB10: .4byte 0x02037590 + thumb_func_end walkrun_clear_x20_when_running_fast + + thumb_func_start sub_808AB14 +sub_808AB14: @ 808AB14 + push {r4,lr} + ldr r4, _0808AB34 + bl sub_808AB38 + 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 + .align 2, 0 +_0808AB34: .4byte 0x08497444 + thumb_func_end sub_808AB14 + + thumb_func_start sub_808AB38 +sub_808AB38: @ 808AB38 + push {r4-r6,lr} + ldr r3, _0808AB74 + ldrb r1, [r3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0808AB8A + ldr r2, _0808AB78 + 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, _0808AB7C +_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 + .align 2, 0 +_0808AB74: .4byte 0x02037590 +_0808AB78: .4byte 0x02037350 +_0808AB7C: .4byte 0x084973fc +_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 sub_808AB38 + + thumb_func_start sub_808AB94 +sub_808AB94: @ 808AB94 + push {r4,lr} + ldr r4, _0808ABD8 + 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, _0808ABDC + 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 npc_set_direction + ldrb r1, [r4] + movs r0, 0xBF + ands r0, r1 + strb r0, [r4] +_0808ABCE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0808ABD8: .4byte 0x02037590 +_0808ABDC: .4byte 0x02037350 + thumb_func_end sub_808AB94 + + thumb_func_start sub_808ABE0 +sub_808ABE0: @ 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, _0808AC20 + adds r0, r5, 0 + bl sub_808AFBC + 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 sub_808AB94 + cmp r4, 0x4 + bhi _0808AC24 + movs r0, 0 + b _0808AC48 + .align 2, 0 +_0808AC20: .4byte 0x02037590 +_0808AC24: + cmp r7, 0x6 + bne _0808AC2E + adds r0, r5, 0 + bl npc_use_some_d2s_and_sound +_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 sub_808ABE0 + + thumb_func_start sub_808AC58 +sub_808AC58: @ 808AC58 + push {lr} + adds r1, r0, 0 + ldr r0, _0808AC84 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, _0808AC88 + 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 sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808AC84: .4byte 0x02037590 +_0808AC88: .4byte 0x02037350 + thumb_func_end sub_808AC58 + + thumb_func_start sub_808AC8C +sub_808AC8C: @ 808AC8C + push {lr} + ldr r0, _0808AC9C + bl sub_808AC58 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808AC9C: .4byte sub_808B738 + 1 + thumb_func_end sub_808AC8C + + thumb_func_start sub_808ACA0 +sub_808ACA0: @ 808ACA0 + push {lr} + ldr r1, _0808ACB4 + movs r0, 0x1 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ACB4: .4byte sub_808B720 + 1 + thumb_func_end sub_808ACA0 + + thumb_func_start sub_808ACB8 +sub_808ACB8: @ 808ACB8 + push {lr} + ldr r1, _0808ACCC + movs r0, 0x2 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ACCC: .4byte sub_808B720 + 1 + thumb_func_end sub_808ACB8 + + thumb_func_start sub_808ACD0 +sub_808ACD0: @ 808ACD0 + push {lr} + ldr r1, _0808ACE4 + movs r0, 0x3 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ACE4: .4byte sub_808B720 + 1 + thumb_func_end sub_808ACD0 + + thumb_func_start sub_808ACE8 +sub_808ACE8: @ 808ACE8 + push {lr} + ldr r1, _0808ACFC + movs r0, 0x4 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ACFC: .4byte sub_808B720 + 1 + thumb_func_end sub_808ACE8 + + thumb_func_start sub_808AD00 +sub_808AD00: @ 808AD00 + push {lr} + ldr r1, _0808AD14 + movs r0, 0x1 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808AD14: .4byte sub_808B750 + 1 + thumb_func_end sub_808AD00 + + thumb_func_start sub_808AD18 +sub_808AD18: @ 808AD18 + push {lr} + ldr r1, _0808AD2C + movs r0, 0x2 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808AD2C: .4byte sub_808B750 + 1 + thumb_func_end sub_808AD18 + + thumb_func_start sub_808AD30 +sub_808AD30: @ 808AD30 + push {lr} + ldr r1, _0808AD44 + movs r0, 0x3 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808AD44: .4byte sub_808B750 + 1 + thumb_func_end sub_808AD30 + + thumb_func_start sub_808AD48 +sub_808AD48: @ 808AD48 + push {lr} + ldr r1, _0808AD5C + movs r0, 0x4 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808AD5C: .4byte sub_808B750 + 1 + thumb_func_end sub_808AD48 + + thumb_func_start sub_808AD60 +sub_808AD60: @ 808AD60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0808AD90 + ldrb r3, [r2, 0x5] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 2 + ldr r3, _0808AD94 + adds r2, r3 + ldrb r3, [r2, 0x1] + movs r4, 0x4 + orrs r3, r4 + movs r4, 0x2 + orrs r3, r4 + strb r3, [r2, 0x1] + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0808AD90: .4byte 0x02037590 +_0808AD94: .4byte 0x02037350 + thumb_func_end sub_808AD60 + + thumb_func_start sub_808AD98 +sub_808AD98: @ 808AD98 + push {lr} + ldr r1, _0808ADAC + movs r0, 0x1 + bl sub_808AD60 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ADAC: .4byte sub_808B738 + 1 + thumb_func_end sub_808AD98 + + thumb_func_start sub_808ADB0 +sub_808ADB0: @ 808ADB0 + push {lr} + ldr r1, _0808ADC4 + movs r0, 0x2 + bl sub_808AD60 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ADC4: .4byte sub_808B738 + 1 + thumb_func_end sub_808ADB0 + + thumb_func_start sub_808ADC8 +sub_808ADC8: @ 808ADC8 + push {lr} + ldr r1, _0808ADDC + movs r0, 0x3 + bl sub_808AD60 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ADDC: .4byte sub_808B738 + 1 + thumb_func_end sub_808ADC8 + + thumb_func_start sub_808ADE0 +sub_808ADE0: @ 808ADE0 + push {lr} + ldr r1, _0808ADF4 + movs r0, 0x4 + bl sub_808AD60 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808ADF4: .4byte sub_808B738 + 1 + thumb_func_end sub_808ADE0 + + thumb_func_start sub_808ADF8 +sub_808ADF8: @ 808ADF8 + push {lr} + bl sub_808C4D8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_808ADF8 + + thumb_func_start sub_808AE04 +sub_808AE04: @ 808AE04 + push {lr} + bl sub_808C5B0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_808AE04 + + thumb_func_start sub_808AE10 +sub_808AE10: @ 808AE10 + push {r4,lr} + ldr r0, _0808AE54 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808AE58 + 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, _0808AE5C + movs r0, 0x1 + bl sub_808ABE0 + lsls r0, 24 + lsrs r0, 24 + b _0808AE62 + .align 2, 0 +_0808AE54: .4byte 0x02037590 +_0808AE58: .4byte 0x02037350 +_0808AE5C: .4byte sub_808B738 + 1 +_0808AE60: + movs r0, 0 +_0808AE62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808AE10 + + thumb_func_start dp04_continue_movement +dp04_continue_movement: @ 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, _0808AE94 + adds r0, r4, 0 + bl walkrun_accelerate + 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 + .align 2, 0 +_0808AE94: .4byte 0x08497490 + thumb_func_end dp04_continue_movement + + thumb_func_start walkrun_accelerate +walkrun_accelerate: @ 808AE98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0808AEB0 + ldr r0, _0808AEAC + strb r4, [r0, 0x2] + movs r0, 0 + b _0808AED2 + .align 2, 0 +_0808AEAC: .4byte 0x02037590 +_0808AEB0: + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0808AECC + ldr r1, _0808AEC8 + ldrb r0, [r1, 0x2] + cmp r0, 0x2 + beq _0808AECC + movs r0, 0x1 + b _0808AED0 + .align 2, 0 +_0808AEC8: .4byte 0x02037590 +_0808AECC: + ldr r1, _0808AED8 + movs r0, 0x2 +_0808AED0: + strb r0, [r1, 0x2] +_0808AED2: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0808AED8: .4byte 0x02037590 + thumb_func_end walkrun_accelerate + + thumb_func_start dp04_look1 +dp04_look1: @ 808AEDC + push {lr} + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl player_npc_use_look1 + pop {r0} + bx r0 + thumb_func_end dp04_look1 + + thumb_func_start sub_808AEF0 +sub_808AEF0: @ 808AEF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_808B828 + pop {r0} + bx r0 + thumb_func_end sub_808AEF0 + + thumb_func_start sub_808AF00 +sub_808AF00: @ 808AF00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + adds r0, r5, 0 + bl sub_808AFBC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0808AF4E + cmp r4, 0x6 + bne _0808AF24 + adds r0, r5, 0 + bl npc_use_some_d2s_and_sound + b _0808AFB6 +_0808AF24: + cmp r4, 0x4 + bne _0808AF3C + adds r0, r5, 0 + bl sub_808B324 + lsls r0, 24 + cmp r0, 0 + beq _0808AF3C + adds r0, r5, 0 + bl sub_808B7F8 + b _0808AFB6 +_0808AF3C: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0808AFB6 + adds r0, r5, 0 + bl npc_use_some_d2s_and_conditional_sound + b _0808AFB6 +_0808AF4E: + ldr r4, _0808AF64 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808AF68 + adds r0, r5, 0 + bl sub_808B738 + b _0808AFB6 + .align 2, 0 +_0808AF64: .4byte 0x02037590 +_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 flag_check + lsls r0, 24 + cmp r0, 0 + beq _0808AFB0 + ldr r2, _0808AFAC + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + bl is_tile_to_run_on + cmp r0, 0 + bne _0808AFB0 + adds r0, r5, 0 + bl sub_808B780 + ldrb r1, [r4] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r4] + b _0808AFB6 + .align 2, 0 +_0808AFAC: .4byte 0x02037350 +_0808AFB0: + adds r0, r5, 0 + bl sub_808B720 +_0808AFB6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_808AF00 + + thumb_func_start sub_808AFBC +sub_808AFBC: @ 808AFBC + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _0808B020 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808B024 + 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 numbers_move_direction + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + 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_808B094 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808B020: .4byte 0x02037590 +_0808B024: .4byte 0x02037350 + thumb_func_end sub_808AFBC + + 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, _0808B08C + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808B090 + 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 numbers_move_direction + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + 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 + .align 2, 0 +_0808B08C: .4byte 0x02037590 +_0808B090: .4byte 0x02037350 + thumb_func_end sub_808B028 + + thumb_func_start sub_808B094 +sub_808B094: @ 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 sub_808B214 + 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 sub_80FBEF0 + 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 sub_808B2E4 +_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 sub_808B094 + + 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 sub_808B2E4 +_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 +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, _0808B208 + 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 cur_mapdata_get_upper4bit_at + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808B20C + lsrs r0, r5, 16 + lsrs r1, r4, 16 + movs r2, 0x3 + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bne _0808B20C + adds r0, r6, 0 + bl sub_808C750 + movs r0, 0x1 + b _0808B20E + .align 2, 0 +_0808B208: .4byte 0x02037590 +_0808B20C: + movs r0, 0 +_0808B20E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808B1BC + + thumb_func_start sub_808B214 +sub_808B214: @ 808B214 + push {lr} + lsls r2, 24 + lsrs r2, 24 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl cur_mapdata_role_x38_to_x3B__by_direction + 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 sub_808B214 + + 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, _0808B2D0 + bl flag_check + 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 npc_id_by_pos + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x10 + beq _0808B2D8 + ldr r0, _0808B2D4 + 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 numbers_move_direction + 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 cur_mapdata_block_get_role_at + 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 + .align 2, 0 +_0808B2D0: .4byte 0x00000889 +_0808B2D4: .4byte 0x02037350 +_0808B2D8: + movs r0, 0 +_0808B2DA: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808B238 + + thumb_func_start sub_808B2E4 +sub_808B2E4: @ 808B2E4 + push {r4-r7,lr} + adds r6, r3, 0 + lsls r2, 24 + lsrs r5, r2, 24 + movs r4, 0 + ldr r7, _0808B30C +_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, _0808B310 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r6] + b _0808B31E + .align 2, 0 +_0808B30C: .4byte 0x0849749c +_0808B310: .4byte 0x084974b0 +_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 sub_808B2E4 + + thumb_func_start sub_808B324 +sub_808B324: @ 808B324 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808B3B8 + ldrb r2, [r1, 0x5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + ldr r5, _0808B3BC + 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 numbers_move_direction + movs r0, 0x1 + movs r1, 0x39 + movs r2, 0x1A + bl get_npc_id_by_local_id + 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 + .align 2, 0 +_0808B3B8: .4byte 0x02037590 +_0808B3BC: .4byte 0x02037350 +_0808B3C0: + movs r0, 0 +_0808B3C2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808B324 + + thumb_func_start walkrun_set_bike_bits +walkrun_set_bike_bits: @ 808B3CC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0808B3E4 + ldrb r1, [r2, 0x1] + orrs r0, r1 + strb r0, [r2, 0x1] + bl bike_related + pop {r0} + bx r0 + .align 2, 0 +_0808B3E4: .4byte 0x02037590 + thumb_func_end walkrun_set_bike_bits + + thumb_func_start bike_related +bike_related: @ 808B3E8 + push {r4,r5,lr} + ldr r0, _0808B430 + 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, _0808B434 + lsls r2, r5, 2 + adds r2, r0 + ldr r0, _0808B430 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808B438 + 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, _0808B430 + movs r0, 0 + strb r0, [r1, 0x1] +_0808B428: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808B430: .4byte 0x02037590 +_0808B434: .4byte 0x084974b8 +_0808B438: .4byte 0x02037350 + thumb_func_end bike_related + + thumb_func_start nullsub_32 +nullsub_32: @ 808B43C + bx lr + thumb_func_end nullsub_32 + + thumb_func_start sub_808B440 +sub_808B440: @ 808B440 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + movs r0, 0x1 + bl sub_808BF14 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B440 + + thumb_func_start sub_808B46C +sub_808B46C: @ 808B46C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + movs r0, 0x2 + bl sub_808BF14 + movs r0, 0 + movs r1, 0 + bl sub_811A0D0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B46C + + thumb_func_start sub_808B4A0 +sub_808B4A0: @ 808B4A0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + movs r0, 0x4 + bl sub_808BF14 + movs r0, 0 + movs r1, 0 + bl sub_811A0D0 + bl sub_811A188 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B4A0 + + thumb_func_start sub_808B4D8 +sub_808B4D8: @ 808B4D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + movs r0, 0x8 + bl sub_808BF14 + ldr r1, _0808B52C + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + ldr r0, _0808B530 + ldrb r0, [r0, 0x5] + str r0, [r1, 0x8] + movs r0, 0x8 + bl oe_exec + lsls r0, 24 + lsrs r0, 24 + strb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808B52C: .4byte 0x02038c08 +_0808B530: .4byte 0x02037590 + thumb_func_end sub_808B4D8 + + thumb_func_start sub_808B534 +sub_808B534: @ 808B534 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + movs r0, 0x10 + bl sub_808BF14 + ldrb r0, [r4, 0x4] + bl sub_8155800 + strb r0, [r4, 0x1A] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B534 + + thumb_func_start sub_808B568 +sub_808B568: @ 808B568 + ldr r2, _0808B574 + ldrb r1, [r2] + movs r0, 0x20 + orrs r0, r1 + strb r0, [r2] + bx lr + .align 2, 0 +_0808B574: .4byte 0x02037590 + thumb_func_end sub_808B568 + + thumb_func_start sub_808B578 +sub_808B578: @ 808B578 + push {r4,lr} + ldr r4, _0808B5A4 + movs r0, 0 + strb r0, [r4, 0x3] + bl player_bits_x42 + lsls r0, 24 + cmp r0, 0 + beq _0808B5B6 + bl sub_808B660 + lsls r0, 24 + cmp r0, 0 + bne _0808B5A8 + bl sub_808B5BC + lsls r0, 24 + cmp r0, 0 + bne _0808B5B6 + movs r0, 0x1 + b _0808B5B4 + .align 2, 0 +_0808B5A4: .4byte 0x02037590 +_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 sub_808B5BC +sub_808B5BC: @ 808B5BC + push {lr} + ldr r2, _0808B608 + ldr r0, _0808B60C + 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 + .align 2, 0 +_0808B608: .4byte 0x02037350 +_0808B60C: .4byte 0x02037590 +_0808B610: + movs r0, 0 +_0808B612: + pop {r1} + bx r1 + thumb_func_end sub_808B5BC + + thumb_func_start sub_808B618 +sub_808B618: @ 808B618 + push {lr} + bl sub_808B5BC + lsls r0, 24 + cmp r0, 0 + beq _0808B634 + ldr r0, _0808B630 + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + beq _0808B634 + movs r0, 0x1 + b _0808B636 + .align 2, 0 +_0808B630: .4byte 0x02037590 +_0808B634: + movs r0, 0 +_0808B636: + pop {r1} + bx r1 + thumb_func_end sub_808B618 + + thumb_func_start player_bits_x42 +player_bits_x42: @ 808B63C + push {lr} + ldr r0, _0808B658 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808B65C + adds r0, r1 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808B658: .4byte 0x02037590 +_0808B65C: .4byte 0x02037350 + thumb_func_end player_bits_x42 + + thumb_func_start sub_808B660 +sub_808B660: @ 808B660 + push {lr} + ldr r0, _0808B67C + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808B680 + adds r0, r1 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808B67C: .4byte 0x02037590 +_0808B680: .4byte 0x02037350 + thumb_func_end sub_808B660 + + thumb_func_start player_set_x22 +player_set_x22: @ 808B684 + ldr r3, _0808B698 + ldr r1, _0808B69C + 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 + .align 2, 0 +_0808B698: .4byte 0x02037350 +_0808B69C: .4byte 0x02037590 + thumb_func_end player_set_x22 + + thumb_func_start player_get_x22 +player_get_x22: @ 808B6A0 + ldr r2, _0808B6B4 + ldr r0, _0808B6B8 + 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 + .align 2, 0 +_0808B6B4: .4byte 0x02037350 +_0808B6B8: .4byte 0x02037590 + 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, _0808B6DC + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, _0808B6E0 + adds r0, r2 + bl sub_8093208 + pop {r0} + bx r0 + .align 2, 0 +_0808B6DC: .4byte 0x02037590 +_0808B6E0: .4byte 0x02037350 + thumb_func_end sub_808B6BC + + thumb_func_start player_npc_set_state_and_x22_etc +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 player_bits_x42 + lsls r0, 24 + cmp r0, 0 + bne _0808B712 + adds r0, r4, 0 + bl player_set_x22 + ldr r0, _0808B718 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808B71C + adds r0, r1 + adds r1, r5, 0 + bl npc_set_state_2 +_0808B712: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808B718: .4byte 0x02037590 +_0808B71C: .4byte 0x02037350 + thumb_func_end player_npc_set_state_and_x22_etc + + thumb_func_start sub_808B720 +sub_808B720: @ 808B720 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8093388 + 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_808B720 + + thumb_func_start sub_808B738 +sub_808B738: @ 808B738 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80933B4 + 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_808B738 + + thumb_func_start sub_808B750 +sub_808B750: @ 808B750 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80933E0 + 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_808B750 + + thumb_func_start sub_808B768 +sub_808B768: @ 808B768 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_809340C + 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_808B768 + + thumb_func_start sub_808B780 +sub_808B780: @ 808B780 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8093464 + 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_808B780 + + thumb_func_start tile_sound_react +tile_sound_react: @ 808B798 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl tile_conditional_sound + adds r0, r4, 0 + bl d2s_08064244 + 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 tile_sound_react + + thumb_func_start sub_808B7BC +sub_808B7BC: @ 808B7BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl d2s_08064244 + 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_808B7BC + + thumb_func_start npc_use_some_d2s_and_conditional_sound +npc_use_some_d2s_and_conditional_sound: @ 808B7D4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl tile_conditional_sound + adds r0, r4, 0 + bl sub_809356C + 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 npc_use_some_d2s_and_conditional_sound + + thumb_func_start sub_808B7F8 +sub_808B7F8: @ 808B7F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_809356C + 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_808B7F8 + + thumb_func_start player_npc_use_look1 +player_npc_use_look1: @ 808B810 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl d2s_look1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end player_npc_use_look1 + + thumb_func_start sub_808B828 +sub_808B828: @ 808B828 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80935C4 + 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_808B828 + + thumb_func_start npc_use_some_d2s_and_sound +npc_use_some_d2s_and_sound: @ 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 d2s_08064110 + 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 npc_use_some_d2s_and_sound + + thumb_func_start sub_808B864 +sub_808B864: @ 808B864 + push {r4,lr} + ldr r4, _0808B8A0 + 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, _0808B8A4 + 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 d2s_look1 + lsls r0, 24 + lsrs r0, 24 + bl sub_808B6BC +_0808B89A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808B8A0: .4byte 0x02037590 +_0808B8A4: .4byte 0x02037350 + 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 tile_conditional_sound +tile_conditional_sound: @ 808B9EC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _0808BA5C + ldr r0, _0808BA60 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + ldr r2, _0808BA64 + 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 player_get_pos_to + movs r0, 0x2 + mov r1, sp + adds r2, r4, 0 + bl numbers_move_direction + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + 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 + .align 2, 0 +_0808BA5C: .4byte 0x02037350 +_0808BA60: .4byte 0x02037590 +_0808BA64: .4byte 0x084974d8 + thumb_func_end tile_conditional_sound + + thumb_func_start player_get_pos_to_plus_one_step_in_direction_player_is_facing +player_get_pos_to_plus_one_step_in_direction_player_is_facing: @ 808BA68 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r3, _0808BAA4 + ldr r2, _0808BAA8 + 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__sp1AA + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl numbers_move_direction + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808BAA4: .4byte 0x02037350 +_0808BAA8: .4byte 0x02037590 + thumb_func_end player_get_pos_to_plus_one_step_in_direction_player_is_facing + + thumb_func_start player_get_pos_to +player_get_pos_to: @ 808BAAC + push {r4,r5,lr} + ldr r5, _0808BAD4 + ldr r4, _0808BAD8 + 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 + .align 2, 0 +_0808BAD4: .4byte 0x02037350 +_0808BAD8: .4byte 0x02037590 + thumb_func_end player_get_pos_to + + 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, _0808BB30 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808BB34 + adds r3, r0, r1 + ldrb r1, [r3] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + beq _0808BAFC + b _0808BC24 +_0808BAFC: + ldr r2, _0808BB38 + 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, _0808BB3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0808BB30: .4byte 0x02037590 +_0808BB34: .4byte 0x02037350 +_0808BB38: .4byte 0x02020630 +_0808BB3C: .4byte _0808BB40 + .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__sp1AA +player_get_direction__sp1AA: @ 808BC38 + ldr r2, _0808BC50 + ldr r0, _0808BC54 + 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 + .align 2, 0 +_0808BC50: .4byte 0x02037350 +_0808BC54: .4byte 0x02037590 + thumb_func_end player_get_direction__sp1AA + + thumb_func_start player_get_direction_upper_4bits +player_get_direction_upper_4bits: @ 808BC58 + ldr r2, _0808BC6C + ldr r0, _0808BC70 + 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 + .align 2, 0 +_0808BC6C: .4byte 0x02037350 +_0808BC70: .4byte 0x02037590 + thumb_func_end player_get_direction_upper_4bits + + thumb_func_start player_get_height +player_get_height: @ 808BC74 + ldr r2, _0808BC88 + ldr r0, _0808BC8C + 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 + .align 2, 0 +_0808BC88: .4byte 0x02037350 +_0808BC8C: .4byte 0x02037590 + thumb_func_end player_get_height + + thumb_func_start sub_808BC90 +sub_808BC90: @ 808BC90 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _0808BCB8 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808BCBC + 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 + .align 2, 0 +_0808BCB8: .4byte 0x02037590 +_0808BCBC: .4byte 0x02037350 + thumb_func_end sub_808BC90 + + thumb_func_start walkrun_bitfield_and_r0 +walkrun_bitfield_and_r0: @ 808BCC0 + ldr r1, _0808BCCC + ldrb r1, [r1] + ands r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_0808BCCC: .4byte 0x02037590 + thumb_func_end walkrun_bitfield_and_r0 + + thumb_func_start sub_808BCD0 +sub_808BCD0: @ 808BCD0 + ldr r0, _0808BCD8 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0808BCD8: .4byte 0x02037590 + thumb_func_end sub_808BCD0 + + thumb_func_start sub_808BCDC +sub_808BCDC: @ 808BCDC + ldr r0, _0808BCE4 + ldrb r0, [r0, 0x4] + bx lr + .align 2, 0 +_0808BCE4: .4byte 0x02037590 + thumb_func_end sub_808BCDC + + thumb_func_start sub_808BCE8 +sub_808BCE8: @ 808BCE8 + push {lr} + bl sub_808AB94 + pop {r0} + bx r0 + thumb_func_end sub_808BCE8 + + thumb_func_start sub_808BCF4 +sub_808BCF4: @ 808BCF4 + push {r4,lr} + ldr r0, _0808BD34 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808BD38 + 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 npc_set_direction + movs r0, 0x6 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _0808BD2C + bl sub_811A188 + movs r0, 0 + bl sub_811A114 +_0808BD2C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808BD34: .4byte 0x02037590 +_0808BD38: .4byte 0x02037350 + thumb_func_end sub_808BCF4 + + thumb_func_start sub_808BD3C +sub_808BD3C: @ 808BD3C + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0808BD50 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .align 2, 0 +_0808BD50: .4byte 0x084974e8 + thumb_func_end sub_808BD3C + + thumb_func_start sub_808BD54 +sub_808BD54: @ 808BD54 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0808BD68 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .align 2, 0 +_0808BD68: .4byte 0x084974f8 + thumb_func_end sub_808BD54 + + thumb_func_start sub_808BD6C +sub_808BD6C: @ 808BD6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808BD78 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0808BD78: .4byte 0x08497508 + thumb_func_end sub_808BD6C + + thumb_func_start sub_808BD7C +sub_808BD7C: @ 808BD7C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808BD88 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0808BD88: .4byte 0x0849750a + thumb_func_end sub_808BD7C + + thumb_func_start sub_808BD8C +sub_808BD8C: @ 808BD8C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808BDA4 + ldrb r1, [r1, 0x7] + bl sub_808BD54 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808BDA4: .4byte 0x02037590 + thumb_func_end sub_808BD8C + + 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 sub_808BDD4 +sub_808BDD4: @ 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 sub_808BDD4 + + thumb_func_start party_has_pokemon_with_surf +party_has_pokemon_with_surf: @ 808BE00 + push {r4,r5,lr} + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + 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, _0808BE4C + 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 + .align 2, 0 +_0808BE4C: .4byte 0x020244ec + thumb_func_end party_has_pokemon_with_surf + + thumb_func_start sub_808BE50 +sub_808BE50: @ 808BE50 + push {lr} + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808BE6E + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + 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 sub_808BE50 + + thumb_func_start sub_808BE74 +sub_808BE74: @ 808BE74 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _0808BEEC + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808BEF0 + 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 numbers_move_direction + 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 player_get_height + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl block_field_1_weird_index + lsls r0, 24 + cmp r0, 0 + beq _0808BEF4 + movs r0, 0x1 + b _0808BEF6 + .align 2, 0 +_0808BEEC: .4byte 0x02037590 +_0808BEF0: .4byte 0x02037350 +_0808BEF4: + movs r0, 0 +_0808BEF6: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808BE74 + + thumb_func_start walkrun_state_clear +walkrun_state_clear: @ 808BF00 + push {lr} + ldr r0, _0808BF10 + movs r1, 0 + movs r2, 0x24 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_0808BF10: .4byte 0x02037590 + thumb_func_end walkrun_state_clear + + thumb_func_start sub_808BF14 +sub_808BF14: @ 808BF14 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0808BF28 + ldrb r2, [r3] + movs r1, 0xE0 + ands r1, r2 + orrs r0, r1 + strb r0, [r3] + bx lr + .align 2, 0 +_0808BF28: .4byte 0x02037590 + thumb_func_end sub_808BF14 + + thumb_func_start sub_808BF2C +sub_808BF2C: @ 808BF2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + ldr r3, _0808BF54 + 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 + .align 2, 0 +_0808BF54: .4byte 0x0849750c +_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 sub_808BF2C + + thumb_func_start sub_808BF6C +sub_808BF6C: @ 808BF6C + push {r4-r6,lr} + ldr r0, _0808BF94 + ldrb r5, [r0] + movs r2, 0 + ldr r3, _0808BF98 + 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 + .align 2, 0 +_0808BF94: .4byte 0x02037590 +_0808BF98: .4byte 0x0849750c +_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 sub_808BF6C + + thumb_func_start sub_808BFB0 +sub_808BFB0: @ 808BFB0 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0808BFDC + ldrb r1, [r5, 0x7] + bl sub_808BF2C + lsls r0, 24 + lsrs r0, 24 + orrs r0, r4 + ldrb r1, [r5, 0x1] + orrs r0, r1 + strb r0, [r5, 0x1] + bl bike_related + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808BFDC: .4byte 0x02037590 + thumb_func_end sub_808BFB0 + + thumb_func_start player_avatar_init +player_avatar_init: @ 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 sub_808BD54 + 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 player_avatar_instanciate_maybe + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 3 + adds r4, r5 + lsls r4, 2 + ldr r0, _0808C0A0 + 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 npc_turn + bl walkrun_state_clear + ldr r0, _0808C0A4 + 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 sub_808BF14 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C0A0: .4byte 0x02037350 +_0808C0A4: .4byte 0x02037590 + thumb_func_end player_avatar_init + + thumb_func_start sub_808C0A8 +sub_808C0A8: @ 808C0A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, _0808C108 + ldr r5, _0808C10C + 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 walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _0808C100 + ldr r2, _0808C110 + 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 + .align 2, 0 +_0808C108: .4byte 0x02037350 +_0808C10C: .4byte 0x02037590 +_0808C110: .4byte 0x02020630 + thumb_func_end sub_808C0A8 + + thumb_func_start sub_808C114 +sub_808C114: @ 808C114 + push {r4,r5,lr} + ldr r5, _0808C150 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C154 + adds r4, r0 + movs r0, 0x5 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808C158 + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808C150: .4byte 0x02037590 +_0808C154: .4byte 0x02037350 +_0808C158: .4byte 0x02020630 + 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, _0808C1A8 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C1AC + adds r4, r0 + movs r0, 0x6 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C1B0 + 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 obj_anim_image_start + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C1A8: .4byte 0x02037590 +_0808C1AC: .4byte 0x02037350 +_0808C1B0: .4byte 0x02020630 + 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, _0808C21C + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C220 + adds r4, r0 + movs r0, 0x2 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C224 + 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 obj_anim_image_start + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + bl obj_anim_image_seek + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C21C: .4byte 0x02037590 +_0808C220: .4byte 0x02037350 +_0808C224: .4byte 0x02020630 + 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, _0808C274 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C278 + adds r4, r0 + movs r0, 0x7 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808C27C + adds r4, r0 + adds r0, r5, 0 + bl npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C274: .4byte 0x02037590 +_0808C278: .4byte 0x02037350 +_0808C27C: .4byte 0x02020630 + 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, _0808C2E4 + 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 numbers_move_direction + 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 + .align 2, 0 +_0808C2E4: .4byte 0x08497520 +_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, _0808C344 + adds r0, r6, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0808C348 + 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 + .align 2, 0 +_0808C344: .4byte taskFF_bump_boulder + 1 +_0808C348: .4byte 0x03005e00 + 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, _0808C394 + ldr r2, _0808C398 + ldr r5, _0808C39C + 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, _0808C3A0 + 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 + .align 2, 0 +_0808C394: .4byte 0x08497530 +_0808C398: .4byte 0x03005e00 +_0808C39C: .4byte 0x02037350 +_0808C3A0: .4byte 0x02037590 + 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, _0808C3C0 + 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 + .align 2, 0 +_0808C3C0: .4byte 0x02037590 + thumb_func_end sub_808C3A4 + + thumb_func_start sub_808C3C4 +sub_808C3C4: @ 808C3C4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r5, 0 + bl npc_is_state_set_and_valid + lsls r0, 24 + cmp r0, 0 + beq _0808C3DE + adds r0, r5, 0 + bl sub_8093284 +_0808C3DE: + adds r0, r4, 0 + bl npc_is_state_set_and_valid + lsls r0, 24 + cmp r0, 0 + beq _0808C3F0 + adds r0, r4, 0 + bl sub_8093284 +_0808C3F0: + adds r0, r5, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + bne _0808C472 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + bne _0808C472 + adds r0, r5, 0 + bl sub_8093284 + adds r0, r4, 0 + bl sub_8093284 + ldrb r0, [r6, 0xC] + bl d2s_08064244 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_state_2 + ldrb r0, [r6, 0xC] + bl d2s_walk + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldr r2, _0808C47C + 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, _0808C480 + 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 oe_exec + 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 + .align 2, 0 +_0808C47C: .4byte 0x02038c08 +_0808C480: .4byte 0x02020630 + thumb_func_end sub_808C3C4 + + 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 npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + cmp r0, 0 + beq _0808C4C6 + adds r0, r5, 0 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + cmp r0, 0 + beq _0808C4C6 + adds r0, r4, 0 + bl sub_8093284 + adds r0, r5, 0 + bl sub_8093284 + ldr r1, _0808C4D0 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + ldr r0, _0808C4D4 + 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 + .align 2, 0 +_0808C4D0: .4byte 0x02037590 +_0808C4D4: .4byte taskFF_bump_boulder + 1 + thumb_func_end sub_808C484 + + thumb_func_start sub_808C4D8 +sub_808C4D8: @ 808C4D8 + push {r4,lr} + ldr r4, _0808C4F4 + 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 + .align 2, 0 +_0808C4F4: .4byte sub_808C4F8 + 1 + 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, _0808C534 + ldr r2, _0808C538 + 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, _0808C53C + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _0808C540 + 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 + .align 2, 0 +_0808C534: .4byte 0x0849753c +_0808C538: .4byte 0x03005e00 +_0808C53C: .4byte 0x02037590 +_0808C540: .4byte 0x02037350 + 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, _0808C5A8 + movs r0, 0x1 + strb r0, [r5, 0x6] + adds r0, r4, 0 + bl sub_8093284 + 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 npc_set_state_2 + 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, _0808C5AC + 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 + .align 2, 0 +_0808C5A8: .4byte 0x02037590 +_0808C5AC: .4byte sub_808C4F8 + 1 + thumb_func_end sub_808C544 + + thumb_func_start sub_808C5B0 +sub_808C5B0: @ 808C5B0 + push {r4,lr} + ldr r4, _0808C5CC + 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 + .align 2, 0 +_0808C5CC: .4byte sub_808C5D0 + 1 + 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, _0808C60C + ldr r2, _0808C610 + 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, _0808C614 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _0808C618 + 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 + .align 2, 0 +_0808C60C: .4byte 0x08497540 +_0808C610: .4byte 0x03005e00 +_0808C614: .4byte 0x02037590 +_0808C618: .4byte 0x02037350 + 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, _0808C640 + 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 + .align 2, 0 +_0808C640: .4byte 0x02037590 + 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, _0808C6B8 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r5, 0 + bl sub_8093284 + 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 d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_state_2 + 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 direction_reversed + 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 + .align 2, 0 +_0808C6B8: .4byte 0x08497550 + 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, _0808C6F8 + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + bl sub_8093284 + 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 npc_set_state_2 + movs r0, 0x1 + strh r0, [r5, 0x8] +_0808C6EC: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808C6F8: .4byte 0x08497554 + 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 sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _0808C740 + ldrb r0, [r4, 0xA] + bl direction_reversed + lsls r0, 24 + lsrs r0, 24 + bl d2s_walk + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_state_2 + bl script_env_2_disable + ldr r1, _0808C748 + movs r0, 0 + strb r0, [r1, 0x6] + ldr r0, _0808C74C + 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 + .align 2, 0 +_0808C748: .4byte 0x02037590 +_0808C74C: .4byte sub_808C5D0 + 1 + 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_x2C + bl sub_8085898 + ldr r2, _0808C79C + 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, _0808C7A0 + adds r0, r5, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0808C7A4 + 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 + .align 2, 0 +_0808C79C: .4byte 0x02037590 +_0808C7A0: .4byte taskFF_0805D1D4 + 1 +_0808C7A4: .4byte 0x03005e00 + 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, _0808C804 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808C808 + adds r5, r0, r1 + adds r0, r5, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _0808C7D4 + adds r0, r5, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _0808C7FC +_0808C7D4: + ldrb r0, [r5, 0x1A] + movs r1, 0x2 + bl sub_81555AC + ldr r0, _0808C80C + 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 npc_set_state_2 + ldr r0, _0808C810 + str r0, [r4] +_0808C7FC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C804: .4byte 0x02037590 +_0808C808: .4byte 0x02037350 +_0808C80C: .4byte 0x03005e00 +_0808C810: .4byte sub_808C814 + 1 + 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, _0808C880 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808C884 + adds r4, r0, r1 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _0808C87A + movs r0, 0 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + 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, _0808C888 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl remove_task +_0808C87A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C880: .4byte 0x02037590 +_0808C884: .4byte 0x02037350 +_0808C888: .4byte 0x02020630 + thumb_func_end sub_808C814 + + thumb_func_start fishing_start +fishing_start: @ 808C88C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0808C8B8 + adds r0, r5, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0808C8BC + 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 + .align 2, 0 +_0808C8B8: .4byte sub_808C8C0 + 1 +_0808C8BC: .4byte 0x03005e00 + thumb_func_end fishing_start + + thumb_func_start sub_808C8C0 +sub_808C8C0: @ 808C8C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0808C8F0 + ldr r2, _0808C8F4 + 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 + .align 2, 0 +_0808C8F0: .4byte 0x0849755c +_0808C8F4: .4byte 0x03005e00 + thumb_func_end sub_808C8C0 + + thumb_func_start sub_808C8F8 +sub_808C8F8: @ 808C8F8 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, _0808C914 + 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 + .align 2, 0 +_0808C914: .4byte 0x02037590 + thumb_func_end sub_808C8F8 + + thumb_func_start fish1 +fish1: @ 808C918 + push {r4-r6,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r1, _0808C9A0 + mov r0, sp + movs r2, 0x6 + bl memcpy + add r4, sp, 0x8 + ldr r1, _0808C9A4 + 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, _0808C9A8 + ldr r2, _0808C9AC + 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 npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + 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 + .align 2, 0 +_0808C9A0: .4byte 0x0849759c +_0808C9A4: .4byte 0x084975a2 +_0808C9A8: .4byte 0x02037350 +_0808C9AC: .4byte 0x02037590 + 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 sub_808C9D4 +sub_808C9D4: @ 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 sub_808C9D4 + + thumb_func_start sub_808CA20 +sub_808CA20: @ 808CA20 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, _0808CA5C + 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, _0808CA60 + 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 + .align 2, 0 +_0808CA5C: .4byte 0x084975a8 +_0808CA60: .4byte 0x030022c0 +_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 sub_808CA20 + + thumb_func_start sub_808CABC +sub_808CABC: @ 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 sub_80B56FC + lsls r0, 24 + cmp r0, 0 + bne _0808CADC + movs r0, 0xB + strh r0, [r5, 0x8] + b _0808CB5C +_0808CADC: + ldr r4, _0808CB2C + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _0808CB14 + adds r0, r4, 0 + bl sub_806B6D8 + 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 + .align 2, 0 +_0808CB2C: .4byte 0x020244ec +_0808CB30: + movs r6, 0x1 +_0808CB32: + cmp r6, 0x1 + bne _0808CB5C + ldr r0, _0808CB64 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808CB68 + adds r4, r0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A2C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start +_0808CB5C: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808CB64: .4byte 0x02037590 +_0808CB68: .4byte 0x02020630 + thumb_func_end sub_808CABC + + thumb_func_start sub_808CB6C +sub_808CB6C: @ 808CB6C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + bl sub_808CF78 + ldr r2, _0808CBA0 + 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 + .align 2, 0 +_0808CBA0: .4byte 0x085ee8f7 + thumb_func_end sub_808CB6C + + thumb_func_start fish7 +fish7: @ 808CBA4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _0808CBD8 + 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 + .align 2, 0 +_0808CBD8: .4byte 0x084975aa +_0808CBDC: + ldr r0, _0808CBF8 + 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 + .align 2, 0 +_0808CBF8: .4byte 0x030022c0 + thumb_func_end fish7 + + thumb_func_start fish8 +fish8: @ 808CBFC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, _0808CC60 + 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 + .align 2, 0 +_0808CC60: .4byte 0x084975b0 + thumb_func_end fish8 + + thumb_func_start sub_808CC64 +sub_808CC64: @ 808CC64 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + bl sub_808CF78 + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _0808CCA4 + 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 text_box_related_one + 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 + .align 2, 0 +_0808CCA4: .4byte 0x085ee903 + thumb_func_end sub_808CC64 + + 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 run_remoboxes + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0808CD58 + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _0808CD50 + ldr r7, _0808CD44 + ldrb r0, [r7, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808CD48 + mov r8, r0 + add r4, r8 + ldrh r1, [r5, 0x24] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + 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, _0808CD4C + 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 + .align 2, 0 +_0808CD44: .4byte 0x02037590 +_0808CD48: .4byte 0x02037350 +_0808CD4C: .4byte 0x02020630 +_0808CD50: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0808CD80 +_0808CD58: + ldr r1, _0808CD8C + 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, _0808CD90 + 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 + .align 2, 0 +_0808CD8C: .4byte 0x02037590 +_0808CD90: .4byte sub_808C8C0 + 1 + thumb_func_end fishA_wait_for_a_pressed + + thumb_func_start sub_808CD94 +sub_808CD94: @ 808CD94 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + bl sub_808CF78 + ldr r0, _0808CDF8 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808CDFC + adds r4, r0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A1C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _0808CE00 + 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 text_box_related_one + movs r0, 0xD + strh r0, [r5, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808CDF8: .4byte 0x02037590 +_0808CDFC: .4byte 0x02020630 +_0808CE00: .4byte 0x085ee91e + thumb_func_end sub_808CD94 + + thumb_func_start sub_808CE04 +sub_808CE04: @ 808CE04 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + bl sub_808CF78 + ldr r0, _0808CE68 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0808CE6C + adds r4, r0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A1C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _0808CE70 + 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 text_box_related_one + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808CE68: .4byte 0x02037590 +_0808CE6C: .4byte 0x02020630 +_0808CE70: .4byte 0x085ee933 + thumb_func_end sub_808CE04 + + thumb_func_start sub_808CE74 +sub_808CE74: @ 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 sub_808CE74 + + thumb_func_start sub_808CE8C +sub_808CE8C: @ 808CE8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_808CF78 + ldr r7, _0808CF20 + ldr r5, _0808CF24 + 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, _0808CF28 + mov r8, r0 + add r4, r8 + ldrh r1, [r6, 0x24] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl npc_turn + 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 + .align 2, 0 +_0808CF20: .4byte 0x02020630 +_0808CF24: .4byte 0x02037590 +_0808CF28: .4byte 0x02037350 + thumb_func_end sub_808CE8C + + thumb_func_start fishF +fishF: @ 808CF2C + push {lr} + bl run_remoboxes + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _0808CF68 + ldr r0, _0808CF70 + 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, _0808CF74 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0808CF68: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0808CF70: .4byte 0x02037590 +_0808CF74: .4byte sub_808C8C0 + 1 + thumb_func_end fishF + + thumb_func_start sub_808CF78 +sub_808CF78: @ 808CF78 + push {r4-r7,lr} + ldr r0, _0808D064 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808D068 + adds r4, r0, r1 + adds r0, r4, 0 + bl obj_anim_step + 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__sp1AA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808D022 + ldr r0, _0808D06C + strh r0, [r4, 0x24] +_0808D022: + cmp r5, 0x5 + bne _0808D02A + ldr r0, _0808D06C + 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, _0808D064 + ldrb r1, [r3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808D05E + ldr r2, _0808D070 + 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 + .align 2, 0 +_0808D064: .4byte 0x02037590 +_0808D068: .4byte 0x02020630 +_0808D06C: .4byte 0x0000fff8 +_0808D070: .4byte 0x02037350 + thumb_func_end sub_808CF78 + + thumb_func_start sub_808D074 +sub_808D074: @ 808D074 + ldr r1, _0808D07C + strb r0, [r1] + bx lr + .align 2, 0 +_0808D07C: .4byte 0x0203734c + thumb_func_end sub_808D074 + + thumb_func_start sub_808D080 +sub_808D080: @ 808D080 + push {lr} + ldr r1, _0808D090 + ldrb r0, [r1] + cmp r0, 0 + bne _0808D08C + movs r0, 0x1 +_0808D08C: + pop {r1} + bx r1 + .align 2, 0 +_0808D090: .4byte 0x0203734c + 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, _0808D0D8 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808D0DC + adds r4, r0, r1 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808D0E0 + adds r7, r0, r1 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0808D0E4 + 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 + .align 2, 0 +_0808D0D8: .4byte 0x02037590 +_0808D0DC: .4byte 0x02037350 +_0808D0E0: .4byte 0x02020630 +_0808D0E4: .4byte 0x03005e08 +_0808D0E8: + cmp r6, 0x2 + beq _0808D184 + b _0808D18A +_0808D0EE: + adds r0, r4, 0 + bl sub_8093284 + 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 sub_808EEDC + 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, _0808D180 + 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 + .align 2, 0 +_0808D180: .4byte 0x03005de8 +_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, _0808D1B0 + 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 + .align 2, 0 +_0808D1B0: .4byte sub_808D1FC + 1 + thumb_func_end sub_808D194 + + thumb_func_start sub_808D1B4 +sub_808D1B4: @ 808D1B4 + push {lr} + ldr r0, _0808D1C4 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808D1C4: .4byte sub_808D1FC + 1 + thumb_func_end sub_808D1B4 + + thumb_func_start sub_808D1C8 +sub_808D1C8: @ 808D1C8 + push {r4,lr} + ldr r4, _0808D1E4 + 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 + .align 2, 0 +_0808D1E4: .4byte sub_808D094 + 1 + thumb_func_end sub_808D1C8 + + thumb_func_start sub_808D1E8 +sub_808D1E8: @ 808D1E8 + push {lr} + ldr r0, _0808D1F8 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0808D1F8: .4byte sub_808D094 + 1 + 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, _0808D244 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808D248 + adds r4, r0, r1 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808D24C + adds r7, r0, r1 + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _0808D250 + 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 + .align 2, 0 +_0808D244: .4byte 0x02037590 +_0808D248: .4byte 0x02037350 +_0808D24C: .4byte 0x02020630 +_0808D250: .4byte 0x03005e08 +_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, _0808D318 + movs r3, 0xA + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0] + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8093208 + 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 sub_808EEDC + 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 + .align 2, 0 +_0808D318: .4byte 0x084975bc +_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 sub_808EE8C + 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 npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + cmp r0, 0 + beq _0808D3E4 + ldr r4, _0808D3E0 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r0, r4 + ldrb r0, [r0] + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_8093208 + movs r0, 0 + strh r0, [r6] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r0, r4 + ldrb r0, [r0] + b _0808D3EA + .align 2, 0 +_0808D3E0: .4byte 0x084975bc +_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, _0808D434 +_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 + .align 2, 0 +_0808D434: .4byte 0x02037350 + 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 walkrun_state_clear + 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, _0808D4EC + ldr r0, [r0, 0x54] + mov r9, r0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1F + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808D4F0 + 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 sub_8008258 + 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 obj_add_from_template_backward_search + 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 sub_8008258 + 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 + .align 2, 0 +_0808D4EC: .4byte 0x085059f8 +_0808D4F0: .4byte 0x02020630 + thumb_func_end sub_808D450 + + thumb_func_start sub_808D4F4 +sub_808D4F4: @ 808D4F4 + push {lr} + movs r1, 0 + ldr r2, _0808D500 + ldrb r0, [r2] + b _0808D518 + .align 2, 0 +_0808D500: .4byte 0x02037350 +_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 get_npc_id_by_local_id +get_npc_id_by_local_id: @ 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 npc_id_by_local_id_ignore_map + b _0808D540 +_0808D53C: + bl npc_id_by_local_id_and_map +_0808D540: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end get_npc_id_by_local_id + + thumb_func_start npc_id_by_local_id_and_map_ret_success +npc_id_by_local_id_and_map_ret_success: @ 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 get_npc_id_by_local_id + 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 npc_id_by_local_id_and_map_ret_success + + thumb_func_start npc_id_by_pos +npc_id_by_pos: @ 808D574 + push {r4-r6,lr} + movs r3, 0 + ldr r5, _0808D5B4 + 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 + .align 2, 0 +_0808D5B4: .4byte 0x02037350 + thumb_func_end npc_id_by_pos + + thumb_func_start npc_id_by_local_id_and_map +npc_id_by_local_id_and_map: @ 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, _0808D5F0 +_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 + .align 2, 0 +_0808D5F0: .4byte 0x02037350 +_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 npc_id_by_local_id_and_map + + thumb_func_start npc_id_by_local_id_ignore_map +npc_id_by_local_id_ignore_map: @ 808D608 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, _0808D62C +_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 + .align 2, 0 +_0808D62C: .4byte 0x02037350 +_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 npc_id_by_local_id_ignore_map + + thumb_func_start sub_808D644 +sub_808D644: @ 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 sub_808D810 + 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, _0808D770 + 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, _0808D774 + 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 npc_set_direction + adds r0, r4, 0 + bl sub_808E6DC + ldr r1, _0808D778 + 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 + .align 2, 0 +_0808D770: .4byte 0x02037350 +_0808D774: .4byte 0x085055cd +_0808D778: .4byte 0x0850557c + thumb_func_end sub_808D644 + + 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, _0808D7A4 + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0808D7FE + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0808D7A8 + bl sub_81AAA40 + lsls r0, 24 + lsrs r6, r0, 24 + b _0808D7CA + .align 2, 0 +_0808D7A4: .4byte 0x02037318 +_0808D7A8: + bl sub_81D6074 + 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 sub_808D644 + 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, _0808D80C +_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 flag_check + 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 + .align 2, 0 +_0808D80C: .4byte 0x03005d8c + thumb_func_end sub_808D77C + + thumb_func_start sub_808D810 +sub_808D810: @ 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, _0808D86C + 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 + .align 2, 0 +_0808D86C: .4byte 0x02037350 +_0808D870: + mov r0, r12 + strb r2, [r0] + ldr r1, _0808D8AC +_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 + .align 2, 0 +_0808D8AC: .4byte 0x02037350 + thumb_func_end sub_808D810 + + thumb_func_start npc_hide +npc_hide: @ 808D8B0 + push {lr} + ldrb r2, [r0] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bl npc_delete_obj_and_free_tiles_for_npc_type + pop {r0} + bx r0 + thumb_func_end npc_hide + + thumb_func_start npc_hide_by_local_id_and_map +npc_hide_by_local_id_and_map: @ 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _0808D902 + mov r0, sp + ldrb r0, [r0] + bl rom_npc_id_in_script_by_npc_id + lsls r0, 16 + lsrs r0, 16 + bl flag_set + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808D908 + adds r0, r1 + bl npc_hide +_0808D902: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0808D908: .4byte 0x02037350 + thumb_func_end npc_hide_by_local_id_and_map + + thumb_func_start npc_delete_obj_and_free_tiles_for_npc_type +npc_delete_obj_and_free_tiles_for_npc_type: @ 808D90C + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrb r0, [r4, 0x5] + bl npc_get_type + ldrh r2, [r0, 0x6] + ldr r1, _0808D950 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + ldr r2, _0808D954 + 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 obj_delete_and_free_tiles + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808D950: .4byte 0xffff0000 +_0808D954: .4byte 0x02020630 + thumb_func_end npc_delete_obj_and_free_tiles_for_npc_type + + thumb_func_start npc_hide_all_but_player +npc_hide_all_but_player: @ 808D958 + push {r4,lr} + movs r4, 0 +_0808D95C: + ldr r0, _0808D984 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _0808D972 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + ldr r1, _0808D988 + adds r0, r1 + bl npc_hide +_0808D972: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808D95C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808D984: .4byte 0x02037590 +_0808D988: .4byte 0x02037350 + thumb_func_end npc_hide_all_but_player + + thumb_func_start npc_spawn_with_provided_template +npc_spawn_with_provided_template: @ 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 sub_808D644 + 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, _0808D9F0 + adds r6, r0, r1 + ldrb r0, [r6, 0x5] + bl npc_get_type + 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 + .align 2, 0 +_0808D9F0: .4byte 0x02037350 +_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, _0808DA5C + adds r0, r1, 0 + mov r2, r8 + strh r0, [r2, 0x2] + mov r0, r8 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + bne _0808DA64 + ldr r0, _0808DA60 + 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 + .align 2, 0 +_0808DA5C: .4byte 0x0000ffff +_0808DA60: .4byte 0x02037350 +_0808DA64: + mov r1, r8 + lsls r0, r1, 4 + add r0, r8 + lsls r0, 2 + ldr r1, _0808DB3C + 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 npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start +_0808DB16: + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r4, 0 + movs r2, 0x1 + bl npc_y_height_related + 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 + .align 2, 0 +_0808DB3C: .4byte 0x02020630 + thumb_func_end npc_spawn_with_provided_template + + thumb_func_start npc_instanciation_something +npc_instanciation_something: @ 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 npc_get_type + adds r7, r0, 0 + add r2, sp, 0x20 + mov r0, r9 + add r1, sp, 0x8 + bl rom_npc_to_template + ldrh r3, [r7, 0x6] + ldr r2, _0808DBB8 + 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 npc_spawn_with_provided_template + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + cmp r2, 0x10 + bne _0808DBBC + movs r0, 0x10 + b _0808DBF2 + .align 2, 0 +_0808DBB8: .4byte 0xffff0000 +_0808DBBC: + ldr r4, _0808DC00 + ldr r1, _0808DC04 + 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 obj_set_f18_to_r0_f42_to_40 +_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 + .align 2, 0 +_0808DC00: .4byte 0x02020630 +_0808DC04: .4byte 0x02037350 + thumb_func_end npc_instanciation_something + + thumb_func_start player_avatar_instanciate_maybe +player_avatar_instanciate_maybe: @ 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 sub_809312C + ldr r0, _0808DC40 + 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 npc_instanciation_something + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808DC40: .4byte 0x03005d8c + thumb_func_end player_avatar_instanciate_maybe + + thumb_func_start sub_808DC44 +sub_808DC44: @ 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, _0808DCA8 + 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 player_avatar_instanciate_maybe + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808DCA8: .4byte 0xfff90000 + thumb_func_end sub_808DC44 + + 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 rom_npc_by_local_id_and_map + adds r5, r0, 0 + cmp r5, 0 + beq _0808DCF2 + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_809312C + 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 npc_instanciation_something + 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 sub_808DCFC +sub_808DCFC: @ 808DCFC + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + bl npc_get_type + 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 sub_808DCFC + + thumb_func_start npc_to_objtemplate__with_indexed_objfunc +npc_to_objtemplate__with_indexed_objfunc: @ 808DD30 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + ldr r4, _0808DD4C + lsrs r1, 14 + adds r1, r4 + ldr r1, [r1] + bl sub_808DCFC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808DD4C: .4byte 0x08505438 + thumb_func_end npc_to_objtemplate__with_indexed_objfunc + + thumb_func_start rom_npc_to_template +rom_npc_to_template: @ 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 npc_to_objtemplate__with_indexed_objfunc + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end rom_npc_to_template + + thumb_func_start sub_808DD68 +sub_808DD68: @ 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 malloc + adds r6, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl sub_808DCFC + ldrh r1, [r6, 0x2] + ldr r0, _0808DE04 + 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 obj_add_from_template_forward_search + 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, _0808DE08 + adds r4, r0 + adds r0, r4, 0 + bl obj_set_f18_to_r0_f42_to_40 + 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 + .align 2, 0 +_0808DE04: .4byte 0x0000ffff +_0808DE08: .4byte 0x02020630 + thumb_func_end sub_808DD68 + + 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 npc_get_type + adds r4, r0, 0 + ldr r1, _0808DF0C + add r3, sp, 0x1C + adds r0, r5, 0 + mov r2, sp + bl sub_808DCFC + mov r1, sp + ldr r2, _0808DF10 + 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 obj_add_from_template_backward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0808DF6C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, _0808DF14 + 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 + .align 2, 0 +_0808DF0C: .4byte sub_8097AC8 + 1 +_0808DF10: .4byte 0x0000ffff +_0808DF14: .4byte 0x02020630 +_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 obj_set_f18_to_r0_f42_to_40 + 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 sub_8096D5C + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_y_height_related + mov r0, r10 + bl npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start +_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 npc_culling_maybe +npc_culling_maybe: @ 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, _0808DFD8 + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _0808E078 + ldr r0, _0808DFDC + 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 sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0808DFE0 + bl sub_81AAA40 + lsls r0, 24 + lsrs r6, r0, 24 + b _0808DFF0 + .align 2, 0 +_0808DFD8: .4byte 0x02037318 +_0808DFDC: .4byte 0x03005d8c +_0808DFE0: + bl sub_81D6074 + 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, _0808E088 + 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 flag_check + lsls r0, 24 + cmp r0, 0 + bne _0808E06E + ldr r3, _0808E088 + 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 npc_instanciation_something +_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 + .align 2, 0 +_0808E088: .4byte 0x03005d8c + thumb_func_end npc_culling_maybe + + thumb_func_start sub_808E08C +sub_808E08C: @ 808E08C + push {r4-r6,lr} + movs r3, 0 + ldr r6, _0808E0E0 +_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, _0808E0E4 + adds r2, r0, r1 + ldr r0, [r2] + ldr r1, _0808E0E8 + ands r0, r1 + cmp r0, 0x1 + bne _0808E0D2 + adds r0, r2, 0 + bl sub_808E0EC +_0808E0D2: + lsls r0, r5, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808E092 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808E0E0: .4byte 0x02032308 +_0808E0E4: .4byte 0x02037350 +_0808E0E8: .4byte 0x00010001 + thumb_func_end sub_808E08C + + thumb_func_start sub_808E0EC +sub_808E0EC: @ 808E0EC + push {r4-r7,lr} + adds r3, r0, 0 + ldr r0, _0808E168 + 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 npc_hide +_0808E160: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808E168: .4byte 0x03005d8c + thumb_func_end sub_808E0EC + + 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 walkrun_state_clear + movs r6, 0 + ldr r7, _0808E1B4 + 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 + .align 2, 0 +_0808E1B4: .4byte 0x02037350 + 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, _0808E248 +_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, _0808E24C + adds r6, r0, r1 + movs r0, 0 + str r0, [sp, 0x20] + ldrb r0, [r6, 0x5] + bl npc_get_type + adds r5, r0, 0 + ldrh r2, [r5, 0x6] + ldr r1, _0808E250 + 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 npc_to_objtemplate__with_indexed_objfunc + str r4, [sp, 0xC] + mov r1, sp + ldr r2, _0808E254 + 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 + .align 2, 0 +_0808E248: .4byte 0x02032308 +_0808E24C: .4byte 0x02037350 +_0808E250: .4byte 0xffff0000 +_0808E254: .4byte 0x0000ffff +_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, _0808E384 + adds r0, r2, 0 + strh r0, [r1, 0x2] + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x40 + beq _0808E374 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _0808E388 + 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 sub_808E3C4 + bl sub_8154228 + strb r0, [r6, 0x1B] +_0808E312: + ldr r1, [sp, 0x20] + cmp r1, 0 + beq _0808E31E + adds r0, r4, 0 + bl obj_set_f18_to_r0_f42_to_40 +_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 npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start +_0808E362: + adds r0, r6, 0 + bl sub_808E38C + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r4, 0 + movs r2, 0x1 + bl npc_y_height_related +_0808E374: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808E384: .4byte 0x0000ffff +_0808E388: .4byte 0x02020630 + thumb_func_end sub_808E1B8 + + thumb_func_start sub_808E38C +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 rom_npc_by_local_id_and_map_get_trainer_flag + pop {r0} + bx r0 + thumb_func_end sub_808E38C + + thumb_func_start sub_808E3C4 +sub_808E3C4: @ 808E3C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0808E3F0 + strb r0, [r5, 0x5] + strb r1, [r5, 0x4] + ldr r1, _0808E3F4 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldrb r0, [r4, 0x5] + bl sub_808BDD4 + strb r0, [r5, 0x7] + ldrb r0, [r4, 0x5] + movs r1, 0x20 + bl sub_808BFB0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808E3F0: .4byte 0x02037590 +_0808E3F4: .4byte 0x02037350 + thumb_func_end sub_808E3C4 + + thumb_func_start sub_808E3F8 +sub_808E3F8: @ 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 npc_get_type + adds r6, r0, 0 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808E430 + 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 + .align 2, 0 +_0808E430: .4byte 0x02020630 +_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 sub_808EE8C +_0808E4F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808E3F8 + + 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 npc_id_by_local_id_and_map_ret_success + 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, _0808E540 + adds r0, r1 + adds r1, r4, 0 + bl sub_808E3F8 +_0808E538: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808E540: .4byte 0x02037350 + thumb_func_end sub_808E504 + + thumb_func_start npc_turn +npc_turn: @ 808E544 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + bl npc_set_direction + 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, _0808E590 + adds r4, r5 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl obj_anim_image_seek +_0808E58A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808E590: .4byte 0x02020630 + thumb_func_end npc_turn + + thumb_func_start npc_turn_by_local_id_and_map +npc_turn_by_local_id_and_map: @ 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 npc_id_by_local_id_and_map_ret_success + 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, _0808E5D0 + adds r0, r1 + adds r1, r4, 0 + bl npc_turn +_0808E5C8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808E5D0: .4byte 0x02037350 + thumb_func_end npc_turn_by_local_id_and_map + + 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, _0808E5F0 + adds r0, r2 + bl npc_turn + pop {r0} + bx r0 + .align 2, 0 +_0808E5F0: .4byte 0x02037350 + thumb_func_end sub_808E5D4 + + thumb_func_start sub_808E5F4 +sub_808E5F4: @ 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 sub_80E19C8 + 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 sub_80E19AC + 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, _0808E688 + lsls r4, 2 + adds r0, r4, r0 + ldr r0, [r0] + adds r0, r6 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_808E3F8 + ldr r0, _0808E68C + adds r0, r4, r0 + ldr r0, [r0] + str r0, [r7, 0xC] + ldr r0, _0808E690 + 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 obj_anim_image_start +_0808E680: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808E688: .4byte 0x0850c908 +_0808E68C: .4byte 0x0850c7b0 +_0808E690: .4byte 0x0850c85c + thumb_func_end sub_808E5F4 + + thumb_func_start npc_get_type +npc_get_type: @ 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 var_load_x4010_plus_r0 + adds r1, r0, 0 +_0808E6AC: + cmp r1, 0x45 + bne _0808E6C4 + bl sub_81201C8 + lsls r0, 24 + ldr r1, _0808E6C0 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + b _0808E6D2 + .align 2, 0 +_0808E6C0: .4byte 0x085059dc +_0808E6C4: + cmp r1, 0xEE + bls _0808E6CA + movs r1, 0x5 +_0808E6CA: + ldr r0, _0808E6D8 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_0808E6D2: + pop {r1} + bx r1 + .align 2, 0 +_0808E6D8: .4byte 0x08505620 + thumb_func_end npc_get_type + + thumb_func_start sub_808E6DC +sub_808E6DC: @ 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 var_load_x4010_plus_r0 + strb r0, [r4, 0x5] +_0808E6F2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808E6DC + + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _0808E73A + ldr r2, _0808E744 + 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 + .align 2, 0 +_0808E744: .4byte 0x02037350 + thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20 + + thumb_func_start npc_get_local_id_and_mapnumbers +npc_get_local_id_and_mapnumbers: @ 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 npc_get_local_id_and_mapnumbers + + thumb_func_start sub_808E75C +sub_808E75C: @ 808E75C + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl npc_id_by_pos + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _0808E784 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808E788 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0808E784: + pop {r0} + bx r0 + .align 2, 0 +_0808E788: .4byte 0x02037350 + 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 npc_id_by_local_id_and_map_ret_success + 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, _0808E7DC + adds r2, r0 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808E7E0 + 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 + .align 2, 0 +_0808E7DC: .4byte 0x02037350 +_0808E7E0: .4byte 0x02020630 + 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 npc_id_by_local_id_and_map_ret_success + 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, _0808E828 + 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 + .align 2, 0 +_0808E828: .4byte 0x02037350 + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _0808E870 + ldr r2, _0808E878 + 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, _0808E87C + adds r0, r1 + strh r5, [r0, 0x24] + strh r4, [r0, 0x26] +_0808E870: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808E878: .4byte 0x02037350 +_0808E87C: .4byte 0x02020630 + 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 gpu_pal_allocator_reset + ldr r1, _0808E890 + movs r0, 0xC + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0808E890: .4byte 0x0300301c + 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 npc_pal_idx_for_given_tag + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0808E8B8 + cmp r1, r0 + beq _0808E8B2 + lsls r0, r1, 3 + ldr r1, _0808E8BC + adds r0, r1 + bl sub_808E8F4 +_0808E8B2: + pop {r0} + bx r0 + .align 2, 0 +_0808E8B8: .4byte 0x000011ff +_0808E8BC: .4byte 0x0850bbc8 + 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, _0808E8F0 + 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 + .align 2, 0 +_0808E8F0: .4byte 0x000011ff + thumb_func_end sub_808E8C0 + + thumb_func_start sub_808E8F4 +sub_808E8F4: @ 808E8F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _0808E912 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + 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 +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 npc_pal_idx_for_given_tag + lsls r0, 24 + ldr r1, _0808E950 + 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 + .align 2, 0 +_0808E950: .4byte 0x0850bbc8 + thumb_func_end pal_patch_for_npc + + thumb_func_start pal_patch_for_npc_range +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 npc_pal_idx_for_given_tag +npc_pal_idx_for_given_tag: @ 808E980 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r0, _0808E9A8 + ldrh r1, [r0, 0x4] + ldr r3, _0808E9AC + 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 + .align 2, 0 +_0808E9A8: .4byte 0x0850bbc8 +_0808E9AC: .4byte 0x000011ff +_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 npc_pal_idx_for_given_tag + + thumb_func_start npc_load_two_palettes__no_record +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, _0808EA10 + ldrh r0, [r1] + ldr r2, _0808EA14 + cmp r0, r2 + beq _0808EA30 + ldr r0, _0808EA18 + 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, _0808EA1C + 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 + .align 2, 0 +_0808EA10: .4byte 0x0850bd00 +_0808EA14: .4byte 0x000011ff +_0808EA18: .4byte 0x084975c4 +_0808EA1C: .4byte 0x020375b4 +_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 +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, _0808EA84 + strh r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl pal_patch_for_npc + movs r3, 0 + ldr r1, _0808EA88 + ldrh r0, [r1] + ldr r2, _0808EA8C + cmp r0, r2 + beq _0808EAA8 + ldr r0, _0808EA90 + 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, _0808EA94 + 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 + .align 2, 0 +_0808EA84: .4byte 0x020375b6 +_0808EA88: .4byte 0x0850bd78 +_0808EA8C: .4byte 0x000011ff +_0808EA90: .4byte 0x084975c4 +_0808EA94: .4byte 0x020375b4 +_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 +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 +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, _0808EBA4 + adds r7, r0, r1 + ldrb r0, [r6, 0x5] + bl npc_get_type + 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 sub_808EE8C +_0808EB9A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808EBA4: .4byte 0x02020630 + 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 npc_id_by_local_id_and_map_ret_success + 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, _0808EBF8 + 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 + .align 2, 0 +_0808EBF8: .4byte 0x02037350 + thumb_func_end sub_808EBA8 + + thumb_func_start npc_coords_shift_still +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 npcs_rebase +npcs_rebase: @ 808EC10 + push {r4,r5,lr} + ldr r2, _0808EC70 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808EC68 + movs r3, 0 + ldr r5, _0808EC74 + 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 + .align 2, 0 +_0808EC70: .4byte 0x02037334 +_0808EC74: .4byte 0x02037350 + thumb_func_end npcs_rebase + + thumb_func_start npc_id_by_pos_and_height +npc_id_by_pos_and_height: @ 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, _0808ECC4 + 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 npc_does_height_match + lsls r0, 24 + cmp r0, 0 + beq _0808ECC8 + adds r0, r4, 0 + b _0808ECD4 + .align 2, 0 +_0808ECC4: .4byte 0x02037350 +_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 npc_id_by_pos_and_height + + thumb_func_start npc_does_height_match +npc_does_height_match: @ 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 npc_does_height_match + + thumb_func_start overworld_rebase +overworld_rebase: @ 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 npcs_rebase + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_culling_maybe + bl sub_808E08C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end overworld_rebase + + thumb_func_start sub_808ED34 +sub_808ED34: @ 808ED34 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0808ED70 + movs r1, 0 + movs r2, 0 + movs r3, 0x4 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0808ED74 + 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 + .align 2, 0 +_0808ED70: .4byte 0x084975d4 +_0808ED74: .4byte 0x02020630 + thumb_func_end sub_808ED34 + + thumb_func_start oac_0805F994 +oac_0805F994: @ 808ED78 + push {r4,r5,lr} + sub sp, 0xC + mov r2, sp + ldr r1, _0808ED9C + 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 + .align 2, 0 +_0808ED9C: .4byte 0x084975ec + thumb_func_end oac_0805F994 + + thumb_func_start sub_808EDA0 +sub_808EDA0: @ 808EDA0 + push {lr} + ldr r3, _0808EDD8 + 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 sub_808EDDC + pop {r0} + bx r0 + .align 2, 0 +_0808EDD8: .4byte 0x02020630 + thumb_func_end sub_808EDA0 + + thumb_func_start sub_808EDDC +sub_808EDDC: @ 808EDDC + push {r4,r5,lr} + ldr r3, _0808EE10 + 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 + .align 2, 0 +_0808EE10: .4byte 0x02020630 + thumb_func_end sub_808EDDC + + thumb_func_start sub_808EE14 +sub_808EE14: @ 808EE14 + push {r4,lr} + ldr r4, _0808EE40 + 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 + .align 2, 0 +_0808EE40: .4byte 0x02020630 + thumb_func_end sub_808EE14 + + thumb_func_start find_obj_using_oac_0805F994 +find_obj_using_oac_0805F994: @ 808EE44 + push {r4,r5,lr} + movs r3, 0 + ldr r4, _0808EE70 + 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, _0808EE74 + cmp r1, r0 + bne _0808EE78 + adds r0, r2, 0 + b _0808EE84 + .align 2, 0 +_0808EE70: .4byte 0x02020630 +_0808EE74: .4byte oac_0805F994 + 1 +_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 find_obj_using_oac_0805F994 + + thumb_func_start sub_808EE8C +sub_808EE8C: @ 808EE8C + push {lr} + bl find_obj_using_oac_0805F994 + 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 sub_808EE8C + + thumb_func_start sub_808EEA8 +sub_808EEA8: @ 808EEA8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl find_obj_using_oac_0805F994 + cmp r0, 0 + beq _0808EEBC + strh r4, [r0, 0x2E] + bl sub_808EE8C +_0808EEBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808EEA8 + + thumb_func_start sub_808EEC4 +sub_808EEC4: @ 808EEC4 + push {lr} + bl find_obj_using_oac_0805F994 + 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 sub_808EEC4 + + thumb_func_start sub_808EEDC +sub_808EEDC: @ 808EEDC + push {lr} + bl find_obj_using_oac_0805F994 + movs r1, 0x2 + strh r1, [r0, 0x30] + pop {r0} + bx r0 + thumb_func_end sub_808EEDC + + 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, _0808EF34 +_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 + .align 2, 0 +_0808EF34: .4byte 0x02020630 +_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, _0808EFA4 + 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 + .align 2, 0 +_0808EFA4: .4byte 0x02020630 +_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 npc_set_direction +npc_set_direction: @ 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 npc_set_direction + + thumb_func_start npc_script_by_local_id_and_map +npc_script_by_local_id_and_map: @ 808F004 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl rom_npc_by_local_id_and_map + ldr r0, [r0, 0x10] + pop {r1} + bx r1 + thumb_func_end npc_script_by_local_id_and_map + + thumb_func_start npc_get_script_by_npc_id +npc_get_script_by_npc_id: @ 808F01C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808F03C + 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 npc_script_by_local_id_and_map + pop {r1} + bx r1 + .align 2, 0 +_0808F03C: .4byte 0x02037350 + thumb_func_end npc_get_script_by_npc_id + + thumb_func_start rom_npc_id_in_script_by_local_id_and_map +rom_npc_id_in_script_by_local_id_and_map: @ 808F040 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl rom_npc_by_local_id_and_map + ldrh r0, [r0, 0x14] + pop {r1} + bx r1 + thumb_func_end rom_npc_id_in_script_by_local_id_and_map + + thumb_func_start rom_npc_id_in_script_by_npc_id +rom_npc_id_in_script_by_npc_id: @ 808F058 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808F07C + 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 rom_npc_id_in_script_by_local_id_and_map + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_0808F07C: .4byte 0x02037350 + thumb_func_end rom_npc_id_in_script_by_npc_id + + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _0808F0B4 + ldr r2, _0808F0B0 + 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 + .align 2, 0 +_0808F0B0: .4byte 0x02037350 +_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, _0808F0D0 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x7] + bx lr + .align 2, 0 +_0808F0D0: .4byte 0x02037350 + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _0808F108 + ldr r2, _0808F104 + 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 + .align 2, 0 +_0808F104: .4byte 0x02037350 +_0808F108: + movs r0, 0xFF +_0808F10A: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_808F0D4 + + thumb_func_start sub_808F110 +sub_808F110: @ 808F110 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0808F124 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x1D] + bx lr + .align 2, 0 +_0808F124: .4byte 0x02037350 + thumb_func_end sub_808F110 + + thumb_func_start rom_npc_by_local_id_and_map +rom_npc_by_local_id_and_map: @ 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, _0808F158 + 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, _0808F15C + ldr r0, [r0, 0x4] + b _0808F16C + .align 2, 0 +_0808F158: .4byte 0x03005d8c +_0808F15C: .4byte 0x02037318 +_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 rom_npc_by_nr + pop {r4} + pop {r1} + bx r1 + thumb_func_end rom_npc_by_local_id_and_map + + thumb_func_start rom_npc_by_nr +rom_npc_by_nr: @ 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 rom_npc_by_nr + + thumb_func_start sub_808F1B4 +sub_808F1B4: @ 808F1B4 + push {r4,r5,lr} + adds r3, r0, 0 + ldrb r0, [r3, 0x9] + ldr r1, _0808F1D4 + 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 + .align 2, 0 +_0808F1D4: .4byte 0x03005d8c +_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 +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 +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 npc_id_by_local_id_and_map_ret_success + 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, _0808F288 + adds r0, r1 + bl sub_808F208 +_0808F282: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0808F288: .4byte 0x02037350 + 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 npc_id_by_local_id_and_map_ret_success + 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, _0808F2CC + adds r0, r1 + ldr r1, _0808F2D0 + bl sub_808F228 + b _0808F2E8 + .align 2, 0 +_0808F2CC: .4byte 0x02037350 +_0808F2D0: .4byte 0x082766a2 +_0808F2D4: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0808F2F0 + adds r0, r1 + ldr r1, _0808F2F4 + bl sub_808F228 +_0808F2E8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808F2F0: .4byte 0x02037350 +_0808F2F4: .4byte 0x082766a6 + 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, _0808F330 + ldr r2, _0808F334 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, _0808F338 + strb r4, [r2] + cmp r4, 0x1 + bne _0808F344 + ldr r1, _0808F33C + 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, _0808F340 + movs r0, 0x8 + strb r0, [r1] + b _0808F356 + .align 2, 0 +_0808F330: .4byte 0x020375b6 +_0808F334: .4byte 0x000011ff +_0808F338: .4byte 0x020375b4 +_0808F33C: .4byte 0x0850be38 +_0808F340: .4byte 0x0300301c +_0808F344: + ldr r0, _0808F35C + 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 + .align 2, 0 +_0808F35C: .4byte 0x0850be38 + 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, _0808F37C + ldr r0, _0808F380 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + b _0808F390 + .align 2, 0 +_0808F37C: .4byte 0x0850be38 +_0808F380: .4byte 0x020375b4 +_0808F384: + adds r1, r4, 0x4 + adds r1, r2, r1 + ldr r0, _0808F398 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 +_0808F390: + adds r0, r1 + ldrh r0, [r0] + b _0808F3CE + .align 2, 0 +_0808F398: .4byte 0x020375b4 +_0808F39C: + movs r3, 0 + ldr r0, _0808F3D4 + ldrh r1, [r0] + ldr r2, _0808F3D8 + adds r4, r0, 0 + cmp r1, r2 + beq _0808F3CC + adds r6, r4, 0 + ldr r0, _0808F3DC + 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, _0808F3D8 +_0808F3CE: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808F3D4: .4byte 0x0850bd78 +_0808F3D8: .4byte 0x000011ff +_0808F3DC: .4byte 0x020375b6 + thumb_func_end npc_paltag_by_palslot + + thumb_func_start sub_808F3E0 +sub_808F3E0: @ 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, _0808F3FC + adds r0, r2 + ldr r2, _0808F400 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808F3FC: .4byte 0x02037350 +_0808F400: .4byte sub_808F404 + 1 + thumb_func_end sub_808F3E0 + + thumb_func_start sub_808F404 +sub_808F404: @ 808F404 + movs r0, 0 + bx lr + thumb_func_end sub_808F404 + + thumb_func_start sub_808F408 +sub_808F408: @ 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, _0808F424 + adds r0, r2 + ldr r2, _0808F428 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808F424: .4byte 0x02037350 +_0808F428: .4byte sub_808F42C + 1 + thumb_func_end sub_808F408 + + thumb_func_start sub_808F42C +sub_808F42C: @ 808F42C + push {r4,lr} + ldr r3, _0808F448 + 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 + .align 2, 0 +_0808F448: .4byte 0x0850d6f4 + thumb_func_end sub_808F42C + + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0808F4C0 + ldr r5, _0808F4BC + 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 + .align 2, 0 +_0808F4BC: .4byte 0x0850d6dc +_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, _0808F530 + 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 npc_set_direction + 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 + .align 2, 0 +_0808F530: .4byte 0x0850d710 + 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 sub_8093388 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player +npc_is_trainer_and_within_sight_distance_blocks_of_player: @ 808F58C + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r0, 0x80 + bl walkrun_bitfield_and_r0 + 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 player_get_pos_to + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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 player_get_pos_to + 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, _0808F940 + 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 + .align 2, 0 +_0808F940: .4byte 0x0850d714 + thumb_func_end sub_808F8BC + + thumb_func_start sub_808F944 +sub_808F944: @ 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, _0808F960 + adds r0, r2 + ldr r2, _0808F964 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808F960: .4byte 0x02037350 +_0808F964: .4byte sub_808F968 + 1 + thumb_func_end sub_808F944 + + thumb_func_start sub_808F968 +sub_808F968: @ 808F968 + push {r4,lr} + ldr r3, _0808F984 + 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 + .align 2, 0 +_0808F984: .4byte 0x0850d740 + thumb_func_end sub_808F968 + + thumb_func_start sub_808F988 +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 +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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 +sub_808F9C8: @ 808F9C8 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0808F9FE + ldr r4, _0808FA08 + 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 + .align 2, 0 +_0808FA08: .4byte 0x0850d6dc + thumb_func_end sub_808F9C8 + + thumb_func_start sub_808FA0C +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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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 +sub_808FA3C: @ 808FA3C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, _0808FA80 + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808FA80: .4byte 0x0850d710 + thumb_func_end sub_808FA3C + + thumb_func_start sub_808FA84 +sub_808FA84: @ 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, _0808FAA0 + adds r0, r2 + ldr r2, _0808FAA4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808FAA0: .4byte 0x02037350 +_0808FAA4: .4byte sub_808FAA8 + 1 + thumb_func_end sub_808FA84 + + thumb_func_start sub_808FAA8 +sub_808FAA8: @ 808FAA8 + push {r4,lr} + ldr r3, _0808FAC4 + 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 + .align 2, 0 +_0808FAC4: .4byte 0x0850d754 + thumb_func_end sub_808FAA8 + + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 +sub_808FB08: @ 808FB08 + push {r4-r6,lr} + adds r6, r1, 0 + bl npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0808FB3C + ldr r5, _0808FB38 + 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 + .align 2, 0 +_0808FB38: .4byte 0x0850d6dc +_0808FB3C: + movs r0, 0 +_0808FB3E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808FB08 + + thumb_func_start sub_808FB44 +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 +sub_808FB64: @ 808FB64 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, _0808FBAC + 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 npc_set_direction + 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 + .align 2, 0 +_0808FBAC: .4byte 0x0850d770 + 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 sub_8093388 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + 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 sub_808FC08 +sub_808FC08: @ 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, _0808FC24 + adds r0, r2 + ldr r2, _0808FC28 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808FC24: .4byte 0x02037350 +_0808FC28: .4byte sub_808FC2C + 1 + thumb_func_end sub_808FC08 + + thumb_func_start sub_808FC2C +sub_808FC2C: @ 808FC2C + push {r4,lr} + ldr r3, _0808FC48 + 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 + .align 2, 0 +_0808FC48: .4byte 0x0850d774 + thumb_func_end sub_808FC2C + + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0808FCC0 + ldr r5, _0808FCBC + 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 + .align 2, 0 +_0808FCBC: .4byte 0x0850d6dc +_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, _0808FD30 + 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 npc_set_direction + 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 + .align 2, 0 +_0808FD30: .4byte 0x0850d790 + 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 sub_8093388 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + 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 sub_808FD8C +sub_808FD8C: @ 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, _0808FDA8 + adds r0, r2 + ldr r2, _0808FDAC + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0808FDA8: .4byte 0x02037350 +_0808FDAC: .4byte sub_808FDB0 + 1 + thumb_func_end sub_808FD8C + + thumb_func_start sub_808FDB0 +sub_808FDB0: @ 808FDB0 + push {r4,lr} + ldr r3, _0808FDCC + 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 + .align 2, 0 +_0808FDCC: .4byte 0x0850d794 + thumb_func_end sub_808FDB0 + + thumb_func_start sub_808FDD0 +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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FDD0 + + thumb_func_start sub_808FDFC +sub_808FDFC: @ 808FDFC + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_exec_an + 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 +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 sub_808FE2C +sub_808FE2C: @ 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, _0808FE68 + 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 sub_808E5F4 + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + orrs r0, r1 + strh r0, [r4, 0x3C] +_0808FE58: + ldr r2, _0808FE6C + adds r0, r5, 0 + adds r1, r4, 0 + bl meta_step + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808FE68: .4byte 0x02037350 +_0808FE6C: .4byte sub_808FE70 + 1 + thumb_func_end sub_808FE2C + + thumb_func_start sub_808FE70 +sub_808FE70: @ 808FE70 + push {r4,lr} + ldr r3, _0808FE8C + 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 + .align 2, 0 +_0808FE8C: .4byte 0x0850d7a0 + thumb_func_end sub_808FE70 + + thumb_func_start sub_808FE90 +sub_808FE90: @ 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 sub_80E19C8 + 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, _0808FEFC + 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 oe_exec + strb r7, [r6] +_0808FEF6: + movs r0, 0 + b _0808FF42 + .align 2, 0 +_0808FEFC: .4byte 0x02038c08 +_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 sub_808E5F4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x39 + bl npc_set_state_and_pq_record + 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 sub_808FE90 + + thumb_func_start sub_808FF48 +sub_808FF48: @ 808FF48 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_exec_an + 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 sub_808FF68 +sub_808FF68: @ 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, _0808FFB0 + 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 oe_exec + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0808FFB0: .4byte 0x02038c08 + thumb_func_end sub_808FF68 + + thumb_func_start sub_808FFB4 +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 sub_808E5F4 + 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 +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 sub_8090050 +sub_8090050: @ 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, _0809006C + adds r0, r2 + ldr r2, _08090070 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0809006C: .4byte 0x02037350 +_08090070: .4byte sub_8090074 + 1 + thumb_func_end sub_8090050 + + thumb_func_start sub_8090074 +sub_8090074: @ 8090074 + push {r4,lr} + ldr r3, _08090090 + 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 + .align 2, 0 +_08090090: .4byte 0x0850d7b4 + thumb_func_end sub_8090074 + + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0809010A + ldr r4, _08090114 + 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 + .align 2, 0 +_08090114: .4byte 0x0850d6dc + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _0809018C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809018C: .4byte 0x0850d770 + thumb_func_end sub_8090148 + + thumb_func_start sub_8090190 +sub_8090190: @ 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, _080901AC + adds r0, r2 + ldr r2, _080901B0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080901AC: .4byte 0x02037350 +_080901B0: .4byte sub_80901B4 + 1 + thumb_func_end sub_8090190 + + thumb_func_start sub_80901B4 +sub_80901B4: @ 80901B4 + push {r4,lr} + ldr r3, _080901D0 + 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 + .align 2, 0 +_080901D0: .4byte 0x0850d7c8 + thumb_func_end sub_80901B4 + + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0809024A + ldr r4, _08090254 + 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 + .align 2, 0 +_08090254: .4byte 0x0850d6dc + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _080902CC + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080902CC: .4byte 0x0850d790 + thumb_func_end sub_8090288 + + thumb_func_start sub_80902D0 +sub_80902D0: @ 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, _080902EC + adds r0, r2 + ldr r2, _080902F0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080902EC: .4byte 0x02037350 +_080902F0: .4byte sub_80902F4 + 1 + thumb_func_end sub_80902D0 + + thumb_func_start sub_80902F4 +sub_80902F4: @ 80902F4 + push {r4,lr} + ldr r3, _08090310 + 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 + .align 2, 0 +_08090310: .4byte 0x0850d7dc + thumb_func_end sub_80902F4 + + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0809038A + ldr r4, _08090394 + 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 + .align 2, 0 +_08090394: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _0809040C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809040C: .4byte 0x0850d7f0 + thumb_func_end sub_80903C8 + + thumb_func_start sub_8090410 +sub_8090410: @ 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, _0809042C + adds r0, r2 + ldr r2, _08090430 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0809042C: .4byte 0x02037350 +_08090430: .4byte sub_8090434 + 1 + thumb_func_end sub_8090410 + + thumb_func_start sub_8090434 +sub_8090434: @ 8090434 + push {r4,lr} + ldr r3, _08090450 + 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 + .align 2, 0 +_08090450: .4byte 0x0850d7f4 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _080904CA + ldr r4, _080904D4 + 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 + .align 2, 0 +_080904D4: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _0809054C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809054C: .4byte 0x0850d808 + thumb_func_end sub_8090508 + + thumb_func_start sub_8090550 +sub_8090550: @ 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, _0809056C + adds r0, r2 + ldr r2, _08090570 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0809056C: .4byte 0x02037350 +_08090570: .4byte sub_8090574 + 1 + thumb_func_end sub_8090550 + + thumb_func_start sub_8090574 +sub_8090574: @ 8090574 + push {r4,lr} + ldr r3, _08090590 + 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 + .align 2, 0 +_08090590: .4byte 0x0850d80c + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0809060A + ldr r4, _08090614 + 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 + .align 2, 0 +_08090614: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _0809068C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809068C: .4byte 0x0850d820 + thumb_func_end sub_8090648 + + thumb_func_start sub_8090690 +sub_8090690: @ 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, _080906AC + adds r0, r2 + ldr r2, _080906B0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080906AC: .4byte 0x02037350 +_080906B0: .4byte sub_80906B4 + 1 + thumb_func_end sub_8090690 + + thumb_func_start sub_80906B4 +sub_80906B4: @ 80906B4 + push {r4,lr} + ldr r3, _080906D0 + 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 + .align 2, 0 +_080906D0: .4byte 0x0850d824 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0809074A + ldr r4, _08090754 + 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 + .align 2, 0 +_08090754: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _080907CC + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080907CC: .4byte 0x0850d838 + thumb_func_end sub_8090788 + + thumb_func_start sub_80907D0 +sub_80907D0: @ 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, _080907EC + adds r0, r2 + ldr r2, _080907F0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080907EC: .4byte 0x02037350 +_080907F0: .4byte sub_80907F4 + 1 + thumb_func_end sub_80907D0 + + thumb_func_start sub_80907F4 +sub_80907F4: @ 80907F4 + push {r4,lr} + ldr r3, _08090810 + 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 + .align 2, 0 +_08090810: .4byte 0x0850d83c + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _0809088A + ldr r4, _08090894 + 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 + .align 2, 0 +_08090894: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _0809090C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809090C: .4byte 0x0850d850 + thumb_func_end sub_80908C8 + + thumb_func_start sub_8090910 +sub_8090910: @ 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, _0809092C + adds r0, r2 + ldr r2, _08090930 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0809092C: .4byte 0x02037350 +_08090930: .4byte sub_8090934 + 1 + thumb_func_end sub_8090910 + + thumb_func_start sub_8090934 +sub_8090934: @ 8090934 + push {r4,lr} + ldr r3, _08090950 + 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 + .align 2, 0 +_08090950: .4byte 0x0850d854 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _080909CA + ldr r4, _080909D4 + 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 + .align 2, 0 +_080909D4: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _08090A4C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090A4C: .4byte 0x0850d868 + thumb_func_end sub_8090A08 + + thumb_func_start sub_8090A50 +sub_8090A50: @ 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, _08090A6C + adds r0, r2 + ldr r2, _08090A70 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08090A6C: .4byte 0x02037350 +_08090A70: .4byte sub_8090A74 + 1 + thumb_func_end sub_8090A50 + + thumb_func_start sub_8090A74 +sub_8090A74: @ 8090A74 + push {r4,lr} + ldr r3, _08090A90 + 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 + .align 2, 0 +_08090A90: .4byte 0x0850d86c + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _08090B0A + ldr r4, _08090B14 + 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 + .align 2, 0 +_08090B14: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _08090B8C + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090B8C: .4byte 0x0850d880 + thumb_func_end sub_8090B48 + + thumb_func_start sub_8090B90 +sub_8090B90: @ 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, _08090BAC + adds r0, r2 + ldr r2, _08090BB0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08090BAC: .4byte 0x02037350 +_08090BB0: .4byte sub_8090BB4 + 1 + thumb_func_end sub_8090B90 + + thumb_func_start sub_8090BB4 +sub_8090BB4: @ 8090BB4 + push {r4,lr} + ldr r3, _08090BD0 + 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 + .align 2, 0 +_08090BD0: .4byte 0x0850d884 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + lsls r0, 24 + cmp r0, 0 + beq _08090C4A + ldr r4, _08090C54 + 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 + .align 2, 0 +_08090C54: .4byte 0x0850d6ec + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _08090CCC + 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 npc_set_direction + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090CCC: .4byte 0x0850d898 + thumb_func_end sub_8090C88 + + thumb_func_start sub_8090CD0 +sub_8090CD0: @ 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, _08090CEC + adds r0, r2 + ldr r2, _08090CF0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08090CEC: .4byte 0x02037350 +_08090CF0: .4byte sub_8090CF4 + 1 + thumb_func_end sub_8090CD0 + + thumb_func_start sub_8090CF4 +sub_8090CF4: @ 8090CF4 + push {r4,lr} + ldr r3, _08090D10 + 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 + .align 2, 0 +_08090D10: .4byte 0x0850d89c + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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 +sub_8090D90: @ 8090D90 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, _08090DD0 + 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 npc_set_direction + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090DD0: .4byte 0x0850d8ac + thumb_func_end sub_8090D90 + + thumb_func_start sub_8090DD4 +sub_8090DD4: @ 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, _08090DF0 + adds r0, r2 + ldr r2, _08090DF4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08090DF0: .4byte 0x02037350 +_08090DF4: .4byte sub_8090DF8 + 1 + thumb_func_end sub_8090DD4 + + thumb_func_start sub_8090DF8 +sub_8090DF8: @ 8090DF8 + push {r4,lr} + ldr r3, _08090E14 + 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 + .align 2, 0 +_08090E14: .4byte 0x0850d8b4 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + 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 npc_is_trainer_and_within_sight_distance_blocks_of_player + 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, _08090ED4 + 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 npc_set_direction + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090ED4: .4byte 0x0850d8c4 + thumb_func_end sub_8090E94 + + thumb_func_start sub_8090ED8 +sub_8090ED8: @ 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, _08090EF4 + adds r0, r2 + ldr r2, _08090EF8 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08090EF4: .4byte 0x02037350 +_08090EF8: .4byte sub_8090EFC + 1 + thumb_func_end sub_8090ED8 + + thumb_func_start sub_8090EFC +sub_8090EFC: @ 8090EFC + push {r4,lr} + ldr r3, _08090F18 + 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 + .align 2, 0 +_08090F18: .4byte 0x0850d8cc + 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 +sub_8090F30: @ 8090F30 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08090F64 + 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 direction_reversed + lsls r0, 24 + lsrs r1, r0, 24 +_08090F52: + adds r0, r4, 0 + bl npc_set_direction + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090F64: .4byte 0x085055cd + thumb_func_end sub_8090F30 + + thumb_func_start sub_8090F68 +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 direction_reversed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_direction +_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 sub_8093388 + 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 direction_reversed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_direction + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8093388 + 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 d2s_08064244 + lsls r0, 24 + lsrs r6, r0, 24 +_08091000: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl npc_set_state_and_pq_record + 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 +sub_8091020: @ 8091020 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_obj_exec_an + 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 +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 sub_809105C +sub_809105C: @ 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 npc_set_direction + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8093388 + 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 npc_set_direction + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8093388 + 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 d2s_08064244 + lsls r0, 24 + lsrs r6, r0, 24 +_080910EA: + adds r0, r4, 0 + mov r1, r8 + adds r2, r6, 0 + bl npc_set_state_and_pq_record + 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 sub_809105C + + thumb_func_start sub_8091110 +sub_8091110: @ 8091110 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_obj_exec_an + 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 sub_8091138 +sub_8091138: @ 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, _08091154 + adds r0, r2 + ldr r2, _08091158 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091154: .4byte 0x02037350 +_08091158: .4byte sub_809115C + 1 + thumb_func_end sub_8091138 + + thumb_func_start sub_809115C +sub_809115C: @ 809115C + push {r4,lr} + ldr r3, _08091178 + 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 + .align 2, 0 +_08091178: .4byte 0x0850d8dc + 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, _080911C0 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080911C0: .4byte 0x0850d8e8 + thumb_func_end sub_809117C + + thumb_func_start sub_80911C4 +sub_80911C4: @ 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, _080911E0 + adds r0, r2 + ldr r2, _080911E4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080911E0: .4byte 0x02037350 +_080911E4: .4byte sub_80911E8 + 1 + thumb_func_end sub_80911C4 + + thumb_func_start sub_80911E8 +sub_80911E8: @ 80911E8 + push {r4,lr} + ldr r3, _08091204 + 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 + .align 2, 0 +_08091204: .4byte 0x0850d8ec + 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, _0809124C + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809124C: .4byte 0x0850d8f8 + thumb_func_end sub_8091208 + + thumb_func_start sub_8091250 +sub_8091250: @ 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, _0809126C + adds r0, r2 + ldr r2, _08091270 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0809126C: .4byte 0x02037350 +_08091270: .4byte sub_8091274 + 1 + thumb_func_end sub_8091250 + + thumb_func_start sub_8091274 +sub_8091274: @ 8091274 + push {r4,lr} + ldr r3, _08091290 + 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 + .align 2, 0 +_08091290: .4byte 0x0850d8fc + 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, _080912D8 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080912D8: .4byte 0x0850d908 + thumb_func_end sub_8091294 + + thumb_func_start sub_80912DC +sub_80912DC: @ 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, _080912F8 + adds r0, r2 + ldr r2, _080912FC + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080912F8: .4byte 0x02037350 +_080912FC: .4byte sub_8091300 + 1 + thumb_func_end sub_80912DC + + thumb_func_start sub_8091300 +sub_8091300: @ 8091300 + push {r4,lr} + ldr r3, _0809131C + 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 + .align 2, 0 +_0809131C: .4byte 0x0850d90c + 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, _08091364 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091364: .4byte 0x0850d918 + thumb_func_end sub_8091320 + + thumb_func_start sub_8091368 +sub_8091368: @ 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, _08091384 + adds r0, r2 + ldr r2, _08091388 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091384: .4byte 0x02037350 +_08091388: .4byte sub_809138C + 1 + thumb_func_end sub_8091368 + + thumb_func_start sub_809138C +sub_809138C: @ 809138C + push {r4,lr} + ldr r3, _080913A8 + 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 + .align 2, 0 +_080913A8: .4byte 0x0850d91c + thumb_func_end sub_809138C + + thumb_func_start sub_80913AC +sub_80913AC: @ 80913AC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, _080913F0 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080913F0: .4byte 0x0850d928 + thumb_func_end sub_80913AC + + thumb_func_start sub_80913F4 +sub_80913F4: @ 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, _08091410 + adds r0, r2 + ldr r2, _08091414 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091410: .4byte 0x02037350 +_08091414: .4byte sub_8091418 + 1 + thumb_func_end sub_80913F4 + + thumb_func_start sub_8091418 +sub_8091418: @ 8091418 + push {r4,lr} + ldr r3, _08091434 + 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 + .align 2, 0 +_08091434: .4byte 0x0850d92c + 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, _0809147C + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809147C: .4byte 0x0850d938 + thumb_func_end sub_8091438 + + thumb_func_start sub_8091480 +sub_8091480: @ 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, _0809149C + adds r0, r2 + ldr r2, _080914A0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_0809149C: .4byte 0x02037350 +_080914A0: .4byte sub_80914A4 + 1 + thumb_func_end sub_8091480 + + thumb_func_start sub_80914A4 +sub_80914A4: @ 80914A4 + push {r4,lr} + ldr r3, _080914C0 + 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 + .align 2, 0 +_080914C0: .4byte 0x0850d93c + 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, _08091508 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091508: .4byte 0x0850d710 + thumb_func_end sub_80914C4 + + thumb_func_start sub_809150C +sub_809150C: @ 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, _08091528 + adds r0, r2 + ldr r2, _0809152C + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091528: .4byte 0x02037350 +_0809152C: .4byte sub_8091530 + 1 + thumb_func_end sub_809150C + + thumb_func_start sub_8091530 +sub_8091530: @ 8091530 + push {r4,lr} + ldr r3, _0809154C + 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 + .align 2, 0 +_0809154C: .4byte 0x0850d948 + 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, _08091594 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091594: .4byte 0x0850d954 + thumb_func_end sub_8091550 + + thumb_func_start sub_8091598 +sub_8091598: @ 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, _080915B4 + adds r0, r2 + ldr r2, _080915B8 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080915B4: .4byte 0x02037350 +_080915B8: .4byte sub_80915BC + 1 + thumb_func_end sub_8091598 + + thumb_func_start sub_80915BC +sub_80915BC: @ 80915BC + push {r4,lr} + ldr r3, _080915D8 + 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 + .align 2, 0 +_080915D8: .4byte 0x0850d958 + 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, _08091620 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091620: .4byte 0x0850d964 + thumb_func_end sub_80915DC + + thumb_func_start sub_8091624 +sub_8091624: @ 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, _08091640 + adds r0, r2 + ldr r2, _08091644 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091640: .4byte 0x02037350 +_08091644: .4byte sub_8091648 + 1 + thumb_func_end sub_8091624 + + thumb_func_start sub_8091648 +sub_8091648: @ 8091648 + push {r4,lr} + ldr r3, _08091664 + 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 + .align 2, 0 +_08091664: .4byte 0x0850d968 + 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, _080916AC + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080916AC: .4byte 0x0850d974 + thumb_func_end sub_8091668 + + thumb_func_start sub_80916B0 +sub_80916B0: @ 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, _080916CC + adds r0, r2 + ldr r2, _080916D0 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080916CC: .4byte 0x02037350 +_080916D0: .4byte sub_80916D4 + 1 + thumb_func_end sub_80916B0 + + thumb_func_start sub_80916D4 +sub_80916D4: @ 80916D4 + push {r4,lr} + ldr r3, _080916F0 + 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 + .align 2, 0 +_080916F0: .4byte 0x0850d978 + 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, _08091738 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091738: .4byte 0x0850d984 + thumb_func_end sub_80916F4 + + thumb_func_start sub_809173C +sub_809173C: @ 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, _08091758 + adds r0, r2 + ldr r2, _0809175C + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091758: .4byte 0x02037350 +_0809175C: .4byte sub_8091760 + 1 + thumb_func_end sub_809173C + + thumb_func_start sub_8091760 +sub_8091760: @ 8091760 + push {r4,lr} + ldr r3, _0809177C + 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 + .align 2, 0 +_0809177C: .4byte 0x0850d988 + 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, _080917C4 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080917C4: .4byte 0x0850d994 + thumb_func_end sub_8091780 + + thumb_func_start sub_80917C8 +sub_80917C8: @ 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, _080917E4 + adds r0, r2 + ldr r2, _080917E8 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080917E4: .4byte 0x02037350 +_080917E8: .4byte sub_80917EC + 1 + thumb_func_end sub_80917C8 + + thumb_func_start sub_80917EC +sub_80917EC: @ 80917EC + push {r4,lr} + ldr r3, _08091808 + 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 + .align 2, 0 +_08091808: .4byte 0x0850d998 + 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, _08091850 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091850: .4byte 0x0850d9a4 + thumb_func_end sub_809180C + + thumb_func_start sub_8091854 +sub_8091854: @ 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, _08091870 + adds r0, r2 + ldr r2, _08091874 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091870: .4byte 0x02037350 +_08091874: .4byte sub_8091878 + 1 + thumb_func_end sub_8091854 + + thumb_func_start sub_8091878 +sub_8091878: @ 8091878 + push {r4,lr} + ldr r3, _08091894 + 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 + .align 2, 0 +_08091894: .4byte 0x0850d9a8 + 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, _080918DC + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080918DC: .4byte 0x0850d9b4 + thumb_func_end sub_8091898 + + thumb_func_start sub_80918E0 +sub_80918E0: @ 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, _080918FC + adds r0, r2 + ldr r2, _08091900 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080918FC: .4byte 0x02037350 +_08091900: .4byte sub_8091904 + 1 + thumb_func_end sub_80918E0 + + thumb_func_start sub_8091904 +sub_8091904: @ 8091904 + push {r4,lr} + ldr r3, _08091920 + 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 + .align 2, 0 +_08091920: .4byte 0x0850d9b8 + 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, _08091968 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091968: .4byte 0x0850d9c4 + thumb_func_end sub_8091924 + + thumb_func_start sub_809196C +sub_809196C: @ 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, _08091988 + adds r0, r2 + ldr r2, _0809198C + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091988: .4byte 0x02037350 +_0809198C: .4byte sub_8091990 + 1 + thumb_func_end sub_809196C + + thumb_func_start sub_8091990 +sub_8091990: @ 8091990 + push {r4,lr} + ldr r3, _080919AC + 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 + .align 2, 0 +_080919AC: .4byte 0x0850d9c8 + 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, _080919F4 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080919F4: .4byte 0x0850d9d4 + thumb_func_end sub_80919B0 + + thumb_func_start sub_80919F8 +sub_80919F8: @ 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, _08091A14 + adds r0, r2 + ldr r2, _08091A18 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091A14: .4byte 0x02037350 +_08091A18: .4byte sub_8091A1C + 1 + thumb_func_end sub_80919F8 + + thumb_func_start sub_8091A1C +sub_8091A1C: @ 8091A1C + push {r4,lr} + ldr r3, _08091A38 + 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 + .align 2, 0 +_08091A38: .4byte 0x0850d9d8 + 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, _08091A80 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091A80: .4byte 0x0850d9e4 + thumb_func_end sub_8091A3C + + thumb_func_start sub_8091A84 +sub_8091A84: @ 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, _08091AA0 + adds r0, r2 + ldr r2, _08091AA4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091AA0: .4byte 0x02037350 +_08091AA4: .4byte sub_8091AA8 + 1 + thumb_func_end sub_8091A84 + + thumb_func_start sub_8091AA8 +sub_8091AA8: @ 8091AA8 + push {r4,lr} + ldr r3, _08091AC4 + 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 + .align 2, 0 +_08091AC4: .4byte 0x0850d9e8 + 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, _08091B0C + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091B0C: .4byte 0x0850d9f4 + thumb_func_end sub_8091AC8 + + thumb_func_start sub_8091B10 +sub_8091B10: @ 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, _08091B2C + adds r0, r2 + ldr r2, _08091B30 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091B2C: .4byte 0x02037350 +_08091B30: .4byte sub_8091B34 + 1 + thumb_func_end sub_8091B10 + + thumb_func_start sub_8091B34 +sub_8091B34: @ 8091B34 + push {r4,lr} + ldr r3, _08091B50 + 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 + .align 2, 0 +_08091B50: .4byte 0x0850d9f8 + 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, _08091B98 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091B98: .4byte 0x0850da04 + thumb_func_end sub_8091B54 + + thumb_func_start sub_8091B9C +sub_8091B9C: @ 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, _08091BB8 + adds r0, r2 + ldr r2, _08091BBC + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091BB8: .4byte 0x02037350 +_08091BBC: .4byte sub_8091BC0 + 1 + thumb_func_end sub_8091B9C + + thumb_func_start sub_8091BC0 +sub_8091BC0: @ 8091BC0 + push {r4,lr} + ldr r3, _08091BDC + 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 + .align 2, 0 +_08091BDC: .4byte 0x0850da08 + 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, _08091C24 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091C24: .4byte 0x0850da14 + thumb_func_end sub_8091BE0 + + thumb_func_start sub_8091C28 +sub_8091C28: @ 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, _08091C44 + adds r0, r2 + ldr r2, _08091C48 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091C44: .4byte 0x02037350 +_08091C48: .4byte sub_8091C4C + 1 + thumb_func_end sub_8091C28 + + thumb_func_start sub_8091C4C +sub_8091C4C: @ 8091C4C + push {r4,lr} + ldr r3, _08091C68 + 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 + .align 2, 0 +_08091C68: .4byte 0x0850da18 + 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, _08091CB0 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091CB0: .4byte 0x0850da24 + thumb_func_end sub_8091C6C + + thumb_func_start sub_8091CB4 +sub_8091CB4: @ 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, _08091CD0 + adds r0, r2 + ldr r2, _08091CD4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091CD0: .4byte 0x02037350 +_08091CD4: .4byte sub_8091CD8 + 1 + thumb_func_end sub_8091CB4 + + thumb_func_start sub_8091CD8 +sub_8091CD8: @ 8091CD8 + push {r4,lr} + ldr r3, _08091CF4 + 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 + .align 2, 0 +_08091CF4: .4byte 0x0850da28 + 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, _08091D3C + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091D3C: .4byte 0x0850da34 + thumb_func_end sub_8091CF8 + + thumb_func_start sub_8091D40 +sub_8091D40: @ 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, _08091D5C + adds r0, r2 + ldr r2, _08091D60 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091D5C: .4byte 0x02037350 +_08091D60: .4byte sub_8091D64 + 1 + thumb_func_end sub_8091D40 + + thumb_func_start sub_8091D64 +sub_8091D64: @ 8091D64 + push {r4,lr} + ldr r3, _08091D80 + 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 + .align 2, 0 +_08091D80: .4byte 0x0850da38 + 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, _08091DC8 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091DC8: .4byte 0x0850da44 + thumb_func_end sub_8091D84 + + thumb_func_start sub_8091DCC +sub_8091DCC: @ 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, _08091DE8 + adds r0, r2 + ldr r2, _08091DEC + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091DE8: .4byte 0x02037350 +_08091DEC: .4byte sub_8091DF0 + 1 + thumb_func_end sub_8091DCC + + thumb_func_start sub_8091DF0 +sub_8091DF0: @ 8091DF0 + push {r4,lr} + ldr r3, _08091E0C + 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 + .align 2, 0 +_08091E0C: .4byte 0x0850da48 + 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, _08091E54 + 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 sub_809105C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08091E54: .4byte 0x0850da54 + thumb_func_end sub_8091E10 + + thumb_func_start sub_8091E58 +sub_8091E58: @ 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, _08091E74 + adds r0, r2 + ldr r2, _08091E78 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08091E74: .4byte 0x02037350 +_08091E78: .4byte sub_8091E7C + 1 + thumb_func_end sub_8091E58 + + thumb_func_start sub_8091E7C +sub_8091E7C: @ 8091E7C + push {r4,lr} + ldr r3, _08091E98 + 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 + .align 2, 0 +_08091E98: .4byte 0x0850da58 + thumb_func_end sub_8091E7C + + thumb_func_start mss_npc_reset_oampriv3_1_unk2_unk3 +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__sp1AA + 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 +sub_8091EC0: @ 8091EC0 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + ldr r2, _08091EE4 + ldr r3, _08091EE8 + 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 + .align 2, 0 +_08091EE4: .4byte 0x02037350 +_08091EE8: .4byte 0x02037590 +_08091EEC: + ldr r5, _08091F1C + bl player_get_x22 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, r5 + bl player_get_direction_upper_4bits + 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 + .align 2, 0 +_08091F1C: .4byte 0x0850da64 + 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 npc_obj_exec_an + 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, _08091F90 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 + .align 2, 0 +_08091F90: .4byte 0x085055cd + 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 sub_81D49E8 + 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, _08091FF8 + 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 npc_move_direction_hypothetical + adds r0, r5, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record + b _08092084 + .align 2, 0 +_08091FF8: .4byte 0x085055cd +_08091FFC: + ldr r1, _080920A0 + 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 npc_move_direction_hypothetical + adds r0, r5, 0 + bl sub_8093388 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _08092084 +_08092070: + adds r0, r5, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record +_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 + .align 2, 0 +_080920A0: .4byte 0x085055cd + 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, _08092158 + 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 npc_move_direction_hypothetical + adds r0, r6, 0 + bl sub_80933B4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _0809213E +_0809212A: + adds r0, r6, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record +_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 + .align 2, 0 +_08092158: .4byte 0x085055cd + 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, _08092210 + 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 npc_move_direction_hypothetical + adds r0, r6, 0 + bl sub_809340C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080921F6 +_080921E2: + adds r0, r6, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record +_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 + .align 2, 0 +_08092210: .4byte 0x085055cd + 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, _080922C8 + 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 npc_move_direction_hypothetical + 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 npc_set_state_and_pq_record + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080922AE +_0809229A: + adds r0, r6, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record +_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 + .align 2, 0 +_080922C8: .4byte 0x085055cd + 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, _08092310 + 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 npc_set_state_and_pq_record + 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 + .align 2, 0 +_08092310: .4byte 0x085055cd + 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, _080923C8 + 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 npc_move_direction_hypothetical + 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 npc_set_state_and_pq_record + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080923AE +_0809239A: + adds r0, r6, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record +_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 + .align 2, 0 +_080923C8: .4byte 0x085055cd + 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, _08092490 + 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 d2s_08064110 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _08092474 +_08092460: + adds r0, r6, 0 + bl d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl npc_set_state_and_pq_record +_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 + .align 2, 0 +_08092490: .4byte 0x085055cd + thumb_func_end oac_hopping + + thumb_func_start sub_8092494 +sub_8092494: @ 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, _080924B0 + adds r0, r2 + ldr r2, _080924B4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080924B0: .4byte 0x02037350 +_080924B4: .4byte sub_80924B8 + 1 + thumb_func_end sub_8092494 + + thumb_func_start sub_80924B8 +sub_80924B8: @ 80924B8 + push {r4,lr} + ldr r3, _080924D4 + 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 + .align 2, 0 +_080924D4: .4byte 0x0850da90 + 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, _080924FC + ldr r3, _08092500 + 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 + .align 2, 0 +_080924FC: .4byte 0x02037350 +_08092500: .4byte 0x02037590 +_08092504: + ldr r5, _08092534 + bl player_get_x22 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, r5 + bl player_get_direction_upper_4bits + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08092538 + 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 + .align 2, 0 +_08092534: .4byte 0x0850da64 +_08092538: .4byte sub_8088E64 + 1 + thumb_func_end mss_08062EA4 + + thumb_func_start sub_809253C +sub_809253C: @ 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, _080925A0 + 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, _080925A4 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl npc_get_local_id_and_mapnumbers + movs r0, 0x1C + bl oe_exec + 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, _080925A0 + adds r0, r1 + ldr r2, _080925A8 + adds r1, r5, 0 + bl meta_step + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080925A0: .4byte 0x02037350 +_080925A4: .4byte 0x02038c08 +_080925A8: .4byte sub_80925AC + 1 + thumb_func_end sub_809253C + + 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 sub_80925B8 +sub_80925B8: @ 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, _0809261C + 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, _08092620 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl npc_get_local_id_and_mapnumbers + movs r0, 0x1D + bl oe_exec + 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, _0809261C + adds r0, r1 + ldr r2, _08092624 + adds r1, r5, 0 + bl meta_step + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0809261C: .4byte 0x02037350 +_08092620: .4byte 0x02038c08 +_08092624: .4byte sub_80925AC + 1 + thumb_func_end sub_80925B8 + + thumb_func_start sub_8092628 +sub_8092628: @ 8092628 + push {r4,lr} + adds r3, r0, 0 + movs r1, 0x3C + ldrsh r0, [r3, r1] + ldr r4, _08092684 + 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, _08092688 + adds r1, r3, 0 + bl meta_step + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08092684: .4byte 0x02037350 +_08092688: .4byte sub_809268C + 1 + thumb_func_end sub_8092628 + + thumb_func_start sub_809268C +sub_809268C: @ 809268C + push {r4,lr} + ldr r3, _080926A8 + 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 + .align 2, 0 +_080926A8: .4byte 0x0850da9c + 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 +sub_80926B8: @ 80926B8 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_exec_an + 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 sub_80926D4 +sub_80926D4: @ 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, _080926F0 + adds r0, r2 + ldr r2, _080926F4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080926F0: .4byte 0x02037350 +_080926F4: .4byte sub_80926F8 + 1 + thumb_func_end sub_80926D4 + + thumb_func_start sub_80926F8 +sub_80926F8: @ 80926F8 + push {r4,lr} + ldr r3, _08092714 + 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 + .align 2, 0 +_08092714: .4byte 0x0850daa0 + 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 d2s_08064244 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092718 + + thumb_func_start sub_8092744 +sub_8092744: @ 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, _08092760 + adds r0, r2 + ldr r2, _08092764 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08092760: .4byte 0x02037350 +_08092764: .4byte sub_8092768 + 1 + thumb_func_end sub_8092744 + + thumb_func_start sub_8092768 +sub_8092768: @ 8092768 + push {r4,lr} + ldr r3, _08092784 + 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 + .align 2, 0 +_08092784: .4byte 0x0850daa8 + 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 sub_809356C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092788 + + thumb_func_start sub_80927B4 +sub_80927B4: @ 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, _080927D0 + adds r0, r2 + ldr r2, _080927D4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080927D0: .4byte 0x02037350 +_080927D4: .4byte sub_80927D8 + 1 + thumb_func_end sub_80927B4 + + thumb_func_start sub_80927D8 +sub_80927D8: @ 80927D8 + push {r4,lr} + ldr r3, _080927F4 + 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 + .align 2, 0 +_080927F4: .4byte 0x0850dab0 + thumb_func_end sub_80927D8 + + thumb_func_start sub_80927F8 +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 sub_80935C4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80927F8 + + thumb_func_start sub_8092824 +sub_8092824: @ 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, _08092840 + adds r0, r2 + ldr r2, _08092844 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_08092840: .4byte 0x02037350 +_08092844: .4byte sub_8092848 + 1 + thumb_func_end sub_8092824 + + thumb_func_start sub_8092848 +sub_8092848: @ 8092848 + push {r4,lr} + ldr r3, _08092864 + 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 + .align 2, 0 +_08092864: .4byte 0x0850dab8 + 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 sub_80935F0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092868 + + thumb_func_start sub_8092894 +sub_8092894: @ 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, _080928B0 + adds r0, r2 + ldr r2, _080928B4 + bl meta_step + pop {r0} + bx r0 + .align 2, 0 +_080928B0: .4byte 0x02037350 +_080928B4: .4byte sub_80928B8 + 1 + thumb_func_end sub_8092894 + + thumb_func_start sub_80928B8 +sub_80928B8: @ 80928B8 + push {r4,lr} + ldr r3, _080928D4 + 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 + .align 2, 0 +_080928D4: .4byte 0x0850dac0 + 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 d2s_look1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_set_state_and_pq_record + 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 npc_obj_exec_an + 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 +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 npc_direction_to_obj_anim_image_number +npc_direction_to_obj_anim_image_number: @ 809295C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092968 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092968: .4byte 0x0850dacc + thumb_func_end npc_direction_to_obj_anim_image_number + + thumb_func_start an_run_any__impl_pulse +an_run_any__impl_pulse: @ 809296C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092978 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092978: .4byte 0x0850dad5 + thumb_func_end an_run_any__impl_pulse + + thumb_func_start sub_809297C +sub_809297C: @ 809297C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092988 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092988: .4byte 0x0850dade + thumb_func_end sub_809297C + + thumb_func_start sub_809298C +sub_809298C: @ 809298C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092998 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092998: .4byte 0x0850dae7 + thumb_func_end sub_809298C + + thumb_func_start sub_809299C +sub_809299C: @ 809299C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080929A8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080929A8: .4byte 0x0850daf0 + thumb_func_end sub_809299C + + thumb_func_start sub_80929AC +sub_80929AC: @ 80929AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080929B8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080929B8: .4byte 0x0850daf9 + thumb_func_end sub_80929AC + + thumb_func_start sub_80929BC +sub_80929BC: @ 80929BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080929C8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080929C8: .4byte 0x0850db02 + thumb_func_end sub_80929BC + + thumb_func_start sub_80929CC +sub_80929CC: @ 80929CC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080929D8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080929D8: .4byte 0x0850db0b + thumb_func_end sub_80929CC + + thumb_func_start sub_80929DC +sub_80929DC: @ 80929DC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080929E8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080929E8: .4byte 0x0850db14 + thumb_func_end sub_80929DC + + thumb_func_start sub_80929EC +sub_80929EC: @ 80929EC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080929F8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080929F8: .4byte 0x0850db1d + thumb_func_end sub_80929EC + + thumb_func_start sub_80929FC +sub_80929FC: @ 80929FC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092A08 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092A08: .4byte 0x0850db26 + thumb_func_end sub_80929FC + + thumb_func_start sub_8092A0C +sub_8092A0C: @ 8092A0C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092A18 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092A18: .4byte 0x0850db2f + thumb_func_end sub_8092A0C + + thumb_func_start sub_8092A1C +sub_8092A1C: @ 8092A1C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092A28 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092A28: .4byte 0x0850db38 + thumb_func_end sub_8092A1C + + thumb_func_start sub_8092A2C +sub_8092A2C: @ 8092A2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092A38 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092A38: .4byte 0x0850db41 + thumb_func_end sub_8092A2C + + thumb_func_start sub_8092A3C +sub_8092A3C: @ 8092A3C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092A48 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092A48: .4byte 0x0850db4a + thumb_func_end sub_8092A3C + + thumb_func_start sub_8092A4C +sub_8092A4C: @ 8092A4C + push {lr} + adds r2, r0, 0 + ldr r1, _08092A54 + b _08092A64 + .align 2, 0 +_08092A54: .4byte 0x085094ac +_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 +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 obj_anim_image_seek +_08092AB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_apply_anim_looping + + thumb_func_start obj_npc_animation_step +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 obj_anim_image_seek +_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, _08092B70 + 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, _08092B74 + 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 + .align 2, 0 +_08092B70: .4byte 0x02020630 +_08092B74: .4byte 0x08505438 + 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, _08092B84 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092B84: .4byte 0x0850db53 + 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 numbers_move_direction + 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 +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 npc_is_outside_of_rectangle_or_map + lsls r0, 24 + cmp r0, 0 + beq _08092BFE + movs r0, 0x1 + b _08092C7E +_08092BFE: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_middle2bit_at + lsls r0, 24 + cmp r0, 0 + bne _08092C40 + adds r0, r5, 0 + adds r1, r4, 0 + bl mapborder_visible_from_position + 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 tile_x30_to_x37_related + lsls r0, 24 + cmp r0, 0 + bne _08092C40 + ldrb r0, [r6, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _08092C44 + mov r0, r8 + bl sub_80887B0 + 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 cur_mapdata_height_mismatch + 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 is_there_a_npc_to_interact_with + 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 npc_is_outside_of_rectangle_or_map + 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 cur_mapdata_get_middle2bit_at + lsls r0, 24 + cmp r0, 0 + bne _08092D04 + adds r0, r6, 0 + adds r1, r5, 0 + bl mapborder_visible_from_position + 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 tile_x30_to_x37_related + lsls r0, 24 + cmp r0, 0 + bne _08092D04 + ldrb r0, [r7, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _08092D08 + mov r0, r8 + bl sub_80887B0 + 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 cur_mapdata_height_mismatch + 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 is_there_a_npc_to_interact_with + 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 npc_is_outside_of_rectangle_or_map +npc_is_outside_of_rectangle_or_map: @ 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 npc_is_outside_of_rectangle_or_map + + thumb_func_start tile_x30_to_x37_related +tile_x30_to_x37_related: @ 8092DC8 + push {r4-r7,lr} + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 24 + ldr r1, _08092E10 + 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, _08092E14 + adds r4, r5, r4 + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + bl cur_mapdata_block_get_role_at + 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 + .align 2, 0 +_08092E10: .4byte 0x0850db5c +_08092E14: .4byte 0x0850db6c +_08092E18: + movs r0, 0 +_08092E1A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end tile_x30_to_x37_related + + thumb_func_start is_there_a_npc_to_interact_with +is_there_a_npc_to_interact_with: @ 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, _08092E84 + 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 r0r1_zero_or_same + lsls r0, 24 + cmp r0, 0 + beq _08092E88 + movs r0, 0x1 + b _08092E94 + .align 2, 0 +_08092E84: .4byte 0x02037350 +_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 is_there_a_npc_to_interact_with + + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08092EE8 + ldr r3, _08092EE0 + ldr r2, _08092EE4 + 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 + .align 2, 0 +_08092EE0: .4byte 0x02020630 +_08092EE4: .4byte 0x02037350 +_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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08092F2E + ldr r3, _08092F34 + ldr r2, _08092F38 + 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 + .align 2, 0 +_08092F34: .4byte 0x02020630 +_08092F38: .4byte 0x02037350 + thumb_func_end sub_8092EF0 + + thumb_func_start numbers_move_direction +numbers_move_direction: @ 8092F3C + push {r4,lr} + lsls r0, 24 + ldr r3, _08092F5C + 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 + .align 2, 0 +_08092F5C: .4byte 0x0850db7c + thumb_func_end numbers_move_direction + + thumb_func_start sub_8092F60 +sub_8092F60: @ 8092F60 + push {r4,lr} + lsls r0, 24 + ldr r3, _08092F84 + 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 + .align 2, 0 +_08092F84: .4byte 0x0850db7c + 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, _08092FEC + 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 + .align 2, 0 +_08092FEC: .4byte 0x0850db7c + thumb_func_end sub_8092F88 + + thumb_func_start sub_8092FF0 +sub_8092FF0: @ 8092FF0 + push {r4,r5,lr} + ldr r5, _0809302C + 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, _08093030 + ldrh r0, [r2] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2] + ldr r1, _08093034 + ldrh r0, [r3] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809302C: .4byte 0x03005d8c +_08093030: .4byte 0x03005dec +_08093034: .4byte 0x03005de8 + 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, _080930CC + ldrh r0, [r0] + negs r0, r0 + ldr r1, _080930D0 + ldr r2, [r1, 0x10] + subs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _080930D4 + 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, _080930D8 + 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, _080930D8 + adds r0, r1 + lsrs r4, r0, 16 +_08093098: + ldr r2, _080930DC + 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 + .align 2, 0 +_080930CC: .4byte 0x03005dec +_080930D0: .4byte 0x03005dd0 +_080930D4: .4byte 0x03005de8 +_080930D8: .4byte 0xfff00000 +_080930DC: .4byte 0x03005d8c + 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 sub_809312C +sub_809312C: @ 809312C + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2] + strh r0, [r1] + ldr r3, _08093168 + 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 + .align 2, 0 +_08093168: .4byte 0x03005dd0 + thumb_func_end sub_809312C + + thumb_func_start npc_move_direction_hypothetical +npc_move_direction_hypothetical: @ 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 numbers_move_direction + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_move_direction_hypothetical + + thumb_func_start npc_is_visible_or_is_x40 +npc_is_visible_or_is_x40: @ 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 npc_is_visible_or_is_x40 + + thumb_func_start npc_is_state_set_and_valid +npc_is_state_set_and_valid: @ 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 npc_is_state_set_and_valid + + thumb_func_start npc_set_state_2 +npc_set_state_2: @ 80931C0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl npc_is_visible_or_is_x40 + 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, _080931FC + 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 + .align 2, 0 +_080931FC: .4byte 0x02020630 +_08093200: + movs r0, 0x1 +_08093202: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end npc_set_state_2 + + thumb_func_start sub_8093208 +sub_8093208: @ 8093208 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + adds r0, r5, 0 + adds r1, r4, 0 + bl npc_set_state_2 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8093208 + + thumb_func_start npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos +npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos: @ 8093224 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + bge _08093236 + adds r0, r1, 0 + bl rom_npc_by_local_id_and_map_get_trainer_flag +_08093236: + pop {r0} + bx r0 + thumb_func_end npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + + thumb_func_start rom_npc_by_local_id_and_map_get_trainer_flag +rom_npc_by_local_id_and_map_get_trainer_flag: @ 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, _0809326C + 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 + .align 2, 0 +_0809326C: .4byte 0x02020630 + thumb_func_end rom_npc_by_local_id_and_map_get_trainer_flag + + thumb_func_start npc_get_bit7_or_const_x10_when_inactive +npc_get_bit7_or_const_x10_when_inactive: @ 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 npc_get_bit7_or_const_x10_when_inactive + + thumb_func_start sub_8093284 +sub_8093284: @ 8093284 + push {r4,r5,lr} + adds r5, r0, 0 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0809329E + cmp r4, 0x10 + beq _0809329E + adds r0, r5, 0 + bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos +_0809329E: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093284 + + thumb_func_start npc_get_state_or_xFF +npc_get_state_or_xFF: @ 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 npc_get_state_or_xFF + + thumb_func_start meta_step +meta_step: @ 80932C0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl dp03_something_2 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80964E8 + adds r0, r4, 0 + bl npc_is_state_set_and_valid + lsls r0, 24 + cmp r0, 0 + beq _080932EA + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_obj_exec_an_2 + 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 dp03_something + adds r0, r4, 0 + adds r1, r5, 0 + bl ground_effects + 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 npc_y_height_related_ + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end meta_step + + thumb_func_start d2s_look1 +d2s_look1: @ 8093330 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093358 + 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 + .align 2, 0 +_08093358: .4byte 0x0850dba0 + thumb_func_end d2s_look1 + + thumb_func_start d2s_walk +d2s_walk: @ 809335C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093384 + 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 + .align 2, 0 +_08093384: .4byte 0x0850dba5 + thumb_func_end d2s_walk + + thumb_func_start sub_8093388 +sub_8093388: @ 8093388 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080933B0 + 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 + .align 2, 0 +_080933B0: .4byte 0x0850dbaa + thumb_func_end sub_8093388 + + thumb_func_start sub_80933B4 +sub_80933B4: @ 80933B4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080933DC + 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 + .align 2, 0 +_080933DC: .4byte 0x0850dbaf + thumb_func_end sub_80933B4 + + thumb_func_start sub_80933E0 +sub_80933E0: @ 80933E0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093408 + 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 + .align 2, 0 +_08093408: .4byte 0x0850dbb4 + thumb_func_end sub_80933E0 + + thumb_func_start sub_809340C +sub_809340C: @ 809340C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093434 + 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 + .align 2, 0 +_08093434: .4byte 0x0850dbb9 + thumb_func_end sub_809340C + + thumb_func_start sub_8093438 +sub_8093438: @ 8093438 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093460 + 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 + .align 2, 0 +_08093460: .4byte 0x0850dbbe + thumb_func_end sub_8093438 + + thumb_func_start sub_8093464 +sub_8093464: @ 8093464 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0809348C + 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 + .align 2, 0 +_0809348C: .4byte 0x0850dbc3 + thumb_func_end sub_8093464 + + thumb_func_start d2s_08064110 +d2s_08064110: @ 8093490 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080934B8 + 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 + .align 2, 0 +_080934B8: .4byte 0x0850dbc8 + thumb_func_end d2s_08064110 + + thumb_func_start sub_80934BC +sub_80934BC: @ 80934BC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080934E4 + 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 + .align 2, 0 +_080934E4: .4byte 0x0850dbcd + thumb_func_end sub_80934BC + + thumb_func_start sub_80934E8 +sub_80934E8: @ 80934E8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093510 + 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 + .align 2, 0 +_08093510: .4byte 0x0850dbd2 + thumb_func_end sub_80934E8 + + thumb_func_start sub_8093514 +sub_8093514: @ 8093514 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0809353C + 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 + .align 2, 0 +_0809353C: .4byte 0x0850dbd7 + thumb_func_end sub_8093514 + + thumb_func_start sub_8093540 +sub_8093540: @ 8093540 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093568 + 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 + .align 2, 0 +_08093568: .4byte 0x0850dbdc + thumb_func_end sub_8093540 + + thumb_func_start sub_809356C +sub_809356C: @ 809356C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093594 + 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 + .align 2, 0 +_08093594: .4byte 0x0850dbe1 + thumb_func_end sub_809356C + + thumb_func_start d2s_08064244 +d2s_08064244: @ 8093598 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080935C0 + 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 + .align 2, 0 +_080935C0: .4byte 0x0850dbe6 + thumb_func_end d2s_08064244 + + thumb_func_start sub_80935C4 +sub_80935C4: @ 80935C4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080935EC + 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 + .align 2, 0 +_080935EC: .4byte 0x0850dbeb + thumb_func_end sub_80935C4 + + thumb_func_start sub_80935F0 +sub_80935F0: @ 80935F0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093618 + 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 + .align 2, 0 +_08093618: .4byte 0x0850dbf0 + thumb_func_end sub_80935F0 + + thumb_func_start npc_reciprocate_look +npc_reciprocate_look: @ 809361C + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + bl direction_reversed + lsls r0, 24 + lsrs r0, 24 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end npc_reciprocate_look + + thumb_func_start sub_8093648 +sub_8093648: @ 8093648 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093670 + 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 + .align 2, 0 +_08093670: .4byte 0x0850dbf5 + 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, _0809369C + 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 + .align 2, 0 +_0809369C: .4byte 0x0850dbfa + 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, _080936C8 + 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 + .align 2, 0 +_080936C8: .4byte 0x0850dbff + 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, _080936F4 + 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 + .align 2, 0 +_080936F4: .4byte 0x0850dc04 + 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, _08093720 + 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 + .align 2, 0 +_08093720: .4byte 0x0850dc09 + 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, _0809374C + 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 + .align 2, 0 +_0809374C: .4byte 0x0850dc0e + 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, _08093778 + 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 + .align 2, 0 +_08093778: .4byte 0x0850dc13 + 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, _080937A4 + 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 + .align 2, 0 +_080937A4: .4byte 0x0850dc18 + 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, _080937D0 + 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 + .align 2, 0 +_080937D0: .4byte 0x0850dc1d + 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, _080937FC + 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 + .align 2, 0 +_080937FC: .4byte 0x0850dc22 + thumb_func_end d2s_08064034 + + thumb_func_start direction_reversed +direction_reversed: @ 8093800 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08093824 + 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 + .align 2, 0 +_08093824: .4byte 0x0850dc27 +_08093828: + adds r0, r4, 0 +_0809382A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end direction_reversed + + thumb_func_start zffu_offset_calc +zffu_offset_calc: @ 8093834 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08093848 + lsrs r0, 22 + subs r0, 0x5 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .align 2, 0 +_08093848: .4byte 0x0850dc2f + 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, _08093888 + lsls r1, r4, 2 + subs r1, 0x5 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] +_08093882: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08093888: .4byte 0x0850dc3f + thumb_func_end state_to_direction + + thumb_func_start npc_obj_exec_an_2 +npc_obj_exec_an_2: @ 809388C + push {r4,lr} + adds r4, r0, 0 + ldr r2, _080938C0 + 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 + .align 2, 0 +_080938C0: .4byte 0x0850dc50 + thumb_func_end npc_obj_exec_an_2 + + thumb_func_start npc_obj_exec_an +npc_obj_exec_an: @ 80938C4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, _080938F0 + 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 + .align 2, 0 +_080938F0: .4byte 0x0850dc50 +_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 npc_obj_exec_an + + thumb_func_start npc_set_state_and_pq_record +npc_set_state_and_pq_record: @ 8093904 + movs r3, 0 + strb r2, [r0, 0x1C] + strh r3, [r1, 0x32] + bx lr + thumb_func_end npc_set_state_and_pq_record + + thumb_func_start an_look_any +an_look_any: @ 809390C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r1, r2, 24 + lsrs r1, 24 + bl npc_set_direction + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl an_run_any__impl_pulse + 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 +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 npc_set_direction + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl numbers_move_direction + 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, _08093A28 + 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 + .align 2, 0 +_08093A28: .4byte 0x020375b8 + thumb_func_end npc_apply_direction + + thumb_func_start an_run_any +an_run_any: @ 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, _08093A84 + 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 + .align 2, 0 +_08093A84: .4byte 0x0850dee8 + thumb_func_end an_run_any + + thumb_func_start sub_8093A88 +sub_8093A88: @ 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 sub_8092A3C + 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_8093A88 + + thumb_func_start npc_obj_ministep_stop_on_arrival +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 +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 npc_set_direction + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl numbers_move_direction + 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 +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 an_run_any__impl_pulse + 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 +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 +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 +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 an_run_any + 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 +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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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, _0809407C + 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 npc_set_direction + 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 + .align 2, 0 +_0809407C: .4byte 0x0850dfbc + 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 an_run_any__impl_pulse + 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 do_animation_x03 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end maybe_shadow_1 + + thumb_func_start sub_80940C4 +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, _08094150 + 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 + .align 2, 0 +_08094150: .4byte 0x0850dfc2 +_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, _08094198 + bl sub_80940C4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08094198: .4byte sub_809785C + 1 + thumb_func_end sub_8094188 + + thumb_func_start sub_809419C +sub_809419C: @ 809419C + push {lr} + ldr r2, _080941AC + bl sub_80940C4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080941AC: .4byte sub_80978E4 + 1 + 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 direction_reversed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_direction + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl an_run_any__impl_pulse + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 npc_set_direction + 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 +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 +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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 an_run_any__impl_pulse + 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 sub_809297C + 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 sub_809297C + 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 sub_809297C + 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 sub_809297C + 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 sub_809298C + 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 sub_809298C + 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 sub_809298C + 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 sub_809298C + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 an_run_any + 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 sub_8094C80 +sub_8094C80: @ 8094C80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8093A88 + 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 sub_8094C80 + + thumb_func_start sub_8094CA0 +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 sub_8094CC0 +sub_8094CC0: @ 8094CC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl sub_8093A88 + 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 sub_8094CC0 + + 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 sub_8094D00 +sub_8094D00: @ 8094D00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl sub_8093A88 + 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 sub_8094D00 + + 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 sub_8094D40 +sub_8094D40: @ 8094D40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8093A88 + 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 sub_8094D40 + + 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 npc_set_direction + 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 obj_anim_image_start + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08094F82 + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + ldr r4, _08094F90 + 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 + .align 2, 0 +_08094F90: .4byte 0x02037350 + 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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08094FE6 + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + ldr r4, _08094FF4 + 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 direction_reversed + 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 + .align 2, 0 +_08094FF4: .4byte 0x02037350 + 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, _0809544C + ldrb r2, [r0, 0x6] + adds r2, r3 + ldrb r2, [r2] + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809544C: .4byte 0x085055cd + 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 +sub_8095490: @ 8095490 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl npc_get_type + 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 sub_80954DC +sub_80954DC: @ 80954DC + push {r4,lr} + adds r4, r1, 0 + ldr r1, _080954FC + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl npc_get_local_id_and_mapnumbers + movs r0, 0 + bl oe_exec + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080954FC: .4byte 0x02038c08 + thumb_func_end sub_80954DC + + thumb_func_start sub_8095500 +sub_8095500: @ 8095500 + push {r4,lr} + adds r4, r1, 0 + ldr r1, _08095520 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl npc_get_local_id_and_mapnumbers + movs r0, 0x21 + bl oe_exec + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08095520: .4byte 0x02038c08 + thumb_func_end sub_8095500 + + thumb_func_start sub_8095524 +sub_8095524: @ 8095524 + push {r4,lr} + adds r4, r1, 0 + ldr r1, _08095544 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl npc_get_local_id_and_mapnumbers + movs r0, 0x2E + bl oe_exec + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08095544: .4byte 0x02038c08 + thumb_func_end sub_8095524 + + 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 oam_center + 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 sub_8008284 + 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 an_run_any + 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 an_run_any + 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 npc_set_direction + 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 obj_anim_image_start_if_different + adds r0, r6, 0 + bl do_animation_x03 + 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 obj_anim_image_start + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_seek + 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 obj_anim_image_start + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_seek + 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 +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 +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 +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 +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 npc_get_type + 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, _0809658C + 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, _08096590 + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + b _080965BC + .align 2, 0 +_0809658C: .4byte 0x02021bbc +_08096590: .4byte 0x02021bbe +_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 +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 dp03_build_bits_2 +dp03_build_bits_2: @ 8096638 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_update_tile_attributes + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_water + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_normal_grass__bit_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_tall_grass_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_unknown_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_unknown_2 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_tiny_grass + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_8067EBC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp03_build_bits_2 + + thumb_func_start dp03_build_bits_1 +dp03_build_bits_1: @ 8096680 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_update_tile_attributes + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_water + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_normal_grass__bit_2 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_tall_grass_0 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_sand + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_unknown_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_unknown_2 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_splash + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_tiny_grass + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_8067EBC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp03_build_bits_1 + + thumb_func_start npc_analyze_ground +npc_analyze_ground: @ 80966D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_update_tile_attributes + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_unknown_2 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_unknown_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_splash + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_8067E4C + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_tiny_grass + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_8067EBC + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_bubbles + adds r0, r4, 0 + adds r1, r5, 0 + bl dp03_build_bits_by_block_behaviour + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end npc_analyze_ground + + thumb_func_start npc_update_tile_attributes +npc_update_tile_attributes: @ 8096728 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + strb r0, [r4, 0x1F] + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + strb r0, [r4, 0x1E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_update_tile_attributes + + thumb_func_start dp03_build_bits_water +dp03_build_bits_water: @ 8096750 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08096794 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + adds r0, r4, 0 + bl npcs_and_water_something + 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 + .align 2, 0 +_08096794: .4byte 0x0850e5dc +_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 dp03_build_bits_water + + thumb_func_start dp03_build_bits_normal_grass__bit_1 +dp03_build_bits_normal_grass__bit_1: @ 80967AC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl is_tile_x02_or_xD1 + 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 dp03_build_bits_normal_grass__bit_1 + + thumb_func_start dp03_build_bits_normal_grass__bit_2 +dp03_build_bits_normal_grass__bit_2: @ 80967CC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl is_tile_x02_or_xD1 + 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 dp03_build_bits_normal_grass__bit_2 + + thumb_func_start dp03_build_bits_tall_grass_1 +dp03_build_bits_tall_grass_1: @ 80967EC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl is_tile_tallgrass + 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 dp03_build_bits_tall_grass_1 + + thumb_func_start dp03_build_bits_tall_grass_0 +dp03_build_bits_tall_grass_0: @ 809680C + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl is_tile_tallgrass + 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 dp03_build_bits_tall_grass_0 + + thumb_func_start dp03_build_bits_sand +dp03_build_bits_sand: @ 809682C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1F] + bl zero_0 + 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 is_x21_or_x2B + lsls r0, 24 + cmp r0, 0 + bne _0809685E + ldrb r0, [r4, 0x1F] + bl sub_8089498 + 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 dp03_build_bits_sand + + thumb_func_start dp03_build_bits_unknown_1 +dp03_build_bits_unknown_1: @ 809686C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl zero_0 + lsls r0, 24 + cmp r0, 0 + beq _080968AA + ldrb r0, [r4, 0x1F] + bl zero_0 + 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 dp03_build_bits_unknown_1 + + thumb_func_start dp03_build_bits_unknown_2 +dp03_build_bits_unknown_2: @ 80968BC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl sub_80895E8 + lsls r0, 24 + cmp r0, 0 + beq _080968DA + ldrb r0, [r4, 0x1F] + bl sub_80895E8 + lsls r0, 24 + cmp r0, 0 + bne _080968F2 +_080968DA: + ldrb r0, [r4, 0x1E] + bl is_tile_x17 + lsls r0, 24 + cmp r0, 0 + beq _08096910 + ldrb r0, [r4, 0x1F] + bl is_tile_x17 + 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 dp03_build_bits_unknown_2 + + thumb_func_start dp03_build_bits_splash +dp03_build_bits_splash: @ 8096920 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl is_tile_x16_clear_water + lsls r0, 24 + cmp r0, 0 + beq _08096948 + ldrb r0, [r4, 0x1F] + bl is_tile_x16_clear_water + 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 dp03_build_bits_splash + + thumb_func_start dp03_build_bits_8067E4C +dp03_build_bits_8067E4C: @ 8096950 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl is_tile_x10_or_x16 + 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 dp03_build_bits_8067E4C + + thumb_func_start dp03_build_bits_tiny_grass +dp03_build_bits_tiny_grass: @ 8096970 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl sub_8089714 + lsls r0, 24 + cmp r0, 0 + beq _080969AE + ldrb r0, [r4, 0x1F] + bl sub_8089714 + 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 dp03_build_bits_tiny_grass + + thumb_func_start dp03_build_bits_8067EBC +dp03_build_bits_8067EBC: @ 80969C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl is_tile_halfwater + lsls r0, 24 + cmp r0, 0 + beq _080969FE + ldrb r0, [r4, 0x1F] + bl is_tile_halfwater + 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 dp03_build_bits_8067EBC + + thumb_func_start dp03_build_bits_bubbles +dp03_build_bits_bubbles: @ 8096A10 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl it_tile_x22 + 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 dp03_build_bits_bubbles + + thumb_func_start dp03_build_bits_by_block_behaviour +dp03_build_bits_by_block_behaviour: @ 8096A30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r0, [r7] + ldr r1, _08096A6C + ands r0, r1 + cmp r0, 0x20 + bne _08096A82 + movs r5, 0 + ldr r0, _08096A70 + 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, _08096A74 + adds r0, r4, r0 + ldr r1, [r6] + ldr r0, [r0] + orrs r1, r0 + str r1, [r6] + b _08096A82 + .align 2, 0 +_08096A6C: .4byte 0x02000020 +_08096A70: .4byte 0x0850e5e4 +_08096A74: .4byte 0x0850e5fc +_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 dp03_build_bits_by_block_behaviour + + thumb_func_start npcs_and_water_something +npcs_and_water_something: @ 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 npc_get_type + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_reflective_tile + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_reflective_tile + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_reflective_tile + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_reflective_tile + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_reflective_tile + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_reflective_tile + 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 npcs_and_water_something + + thumb_func_start is_reflective_tile +is_reflective_tile: @ 8096BDC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_tile_x23_2 + lsls r0, 24 + cmp r0, 0 + beq _08096BF2 + movs r0, 0x1 + b _08096C04 +_08096BF2: + adds r0, r4, 0 + bl is_water_tile_2 + 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 is_reflective_tile + + thumb_func_start cur_mapdata_role_x38_to_x3B__by_direction +cur_mapdata_role_x38_to_x3B__by_direction: @ 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08096C58 + 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 + .align 2, 0 +_08096C58: .4byte 0x0850e614 +_08096C5C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 +_08096C62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_role_x38_to_x3B__by_direction + + thumb_func_start npc_shuffle_bits_in_tall_grass +npc_shuffle_bits_in_tall_grass: @ 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 is_tile_tallgrass + lsls r0, 24 + cmp r0, 0 + beq _08096CBC + ldrb r0, [r5, 0x1F] + bl is_tile_tallgrass + 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 sub_8096DA8 + 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 npc_shuffle_bits_in_tall_grass + + thumb_func_start cur_mapdata_height_mismatch +cur_mapdata_height_mismatch: @ 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 cur_mapdata_get_upper4bit_at + 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 cur_mapdata_height_mismatch + + thumb_func_start sub_8096D00 +sub_8096D00: @ 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 sub_8096DB8 + ldr r1, _08096D54 + 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, _08096D58 + 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 + .align 2, 0 +_08096D54: .4byte 0x0850e644 +_08096D58: .4byte 0x0850e634 + thumb_func_end sub_8096D00 + + thumb_func_start sub_8096D5C +sub_8096D5C: @ 8096D5C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08096DA0 + 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, _08096DA4 + 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 + .align 2, 0 +_08096DA0: .4byte 0x0850e644 +_08096DA4: .4byte 0x0850e634 + thumb_func_end sub_8096D5C + + thumb_func_start sub_8096DA8 +sub_8096DA8: @ 8096DA8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08096DB4 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08096DB4: .4byte 0x0850e634 + thumb_func_end sub_8096DA8 + + thumb_func_start sub_8096DB8 +sub_8096DB8: @ 8096DB8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_upper4bit_at + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_upper4bit_at + 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 sub_8096DB8 + + thumb_func_start npc_y_height_related +npc_y_height_related: @ 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, _08096E4C + 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, _08096E50 + 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 + .align 2, 0 +_08096E4C: .4byte 0x02021bbe +_08096E50: .4byte 0x0850e624 + thumb_func_end npc_y_height_related + + thumb_func_start npc_y_height_related_ +npc_y_height_related_: @ 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 npc_y_height_related +_08096E6A: + pop {r0} + bx r0 + thumb_func_end npc_y_height_related_ + + thumb_func_start r0r1_zero_or_same +r0r1_zero_or_same: @ 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 r0r1_zero_or_same + + thumb_func_start dp03_step_grass_normal +dp03_step_grass_normal: @ 8096E90 + push {lr} + ldr r3, _08096ED4 + 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, _08096ED8 + 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 oe_exec + pop {r0} + bx r0 + .align 2, 0 +_08096ED4: .4byte 0x02038c08 +_08096ED8: .4byte 0x03005d8c + thumb_func_end dp03_step_grass_normal + + thumb_func_start dp03_step_grass_elastic +dp03_step_grass_elastic: @ 8096EDC + push {lr} + ldr r3, _08096F20 + 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, _08096F24 + 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 oe_exec + pop {r0} + bx r0 + .align 2, 0 +_08096F20: .4byte 0x02038c08 +_08096F24: .4byte 0x03005d8c + thumb_func_end dp03_step_grass_elastic + + thumb_func_start dp03_step_grass_tall_1 +dp03_step_grass_tall_1: @ 8096F28 + push {lr} + ldr r3, _08096F6C + 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, _08096F70 + 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 oe_exec + pop {r0} + bx r0 + .align 2, 0 +_08096F6C: .4byte 0x02038c08 +_08096F70: .4byte 0x03005d8c + thumb_func_end dp03_step_grass_tall_1 + + thumb_func_start dp03_step_grass_tall_0 +dp03_step_grass_tall_0: @ 8096F74 + push {lr} + ldr r3, _08096FB8 + 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, _08096FBC + 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 oe_exec + pop {r0} + bx r0 + .align 2, 0 +_08096FB8: .4byte 0x02038c08 +_08096FBC: .4byte 0x03005d8c + thumb_func_end dp03_step_grass_tall_0 + + thumb_func_start dp03_step_water_reflection_0 +dp03_step_water_reflection_0: @ 8096FC0 + push {lr} + movs r2, 0 + bl dp03_step_water_reflection + pop {r0} + bx r0 + thumb_func_end dp03_step_water_reflection_0 + + thumb_func_start sub_8096FCC +sub_8096FCC: @ 8096FCC + push {lr} + movs r2, 0x1 + bl dp03_step_water_reflection + pop {r0} + bx r0 + thumb_func_end sub_8096FCC + + thumb_func_start sub_8096FD8 +sub_8096FD8: @ 8096FD8 + push {lr} + adds r1, r0, 0 + movs r0, 0x22 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end sub_8096FD8 + + thumb_func_start sub_8096FE8 +sub_8096FE8: @ 8096FE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl npc_get_type + ldr r1, _08097010 + 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 + .align 2, 0 +_08097010: .4byte 0x0850e654 + thumb_func_end sub_8096FE8 + + thumb_func_start dp03_step_sand_heavy +dp03_step_sand_heavy: @ 8097014 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl npc_get_type + ldr r1, _0809703C + 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 + .align 2, 0 +_0809703C: .4byte 0x0850e654 + thumb_func_end dp03_step_sand_heavy + + thumb_func_start nullsub_93 +nullsub_93: @ 8097040 + bx lr + thumb_func_end nullsub_93 + + thumb_func_start sub_8097044 +sub_8097044: @ 8097044 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r2, 24 + lsrs r4, 24 + ldr r1, _0809708C + mov r0, sp + movs r2, 0x4 + bl memcpy + ldr r1, _08097090 + 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 oe_exec + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809708C: .4byte 0x0850e660 +_08097090: .4byte 0x02038c08 + thumb_func_end sub_8097044 + + thumb_func_start sub_8097094 +sub_8097094: @ 8097094 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x10] + ldr r0, [r4, 0x14] + cmp r1, r0 + beq _080970D6 + ldr r2, _080970DC + 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, _080970E0 + 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 oe_exec +_080970D6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080970DC: .4byte 0x02038c08 +_080970E0: .4byte 0x0850e664 + thumb_func_end sub_8097094 + + thumb_func_start sub_80970E4 +sub_80970E4: @ 80970E4 + push {lr} + bl sub_8097E14 + pop {r0} + bx r0 + thumb_func_end sub_80970E4 + + thumb_func_start dp03_step_splash_small +dp03_step_splash_small: @ 80970F0 + push {lr} + adds r1, r0, 0 + movs r0, 0xF + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end dp03_step_splash_small + + thumb_func_start sub_8097100 +sub_8097100: @ 8097100 + push {lr} + adds r1, r0, 0 + movs r0, 0x27 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end sub_8097100 + + thumb_func_start dp03_step_grass_thin +dp03_step_grass_thin: @ 8097110 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, _08097164 + 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 oe_exec + 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 dp03_step_grass_normal +_0809715A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08097164: .4byte 0x02038c08 + thumb_func_end dp03_step_grass_thin + + thumb_func_start dp03_step_grass_heavy +dp03_step_grass_heavy: @ 8097168 + push {lr} + ldr r2, _0809718C + 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 oe_exec + pop {r0} + bx r0 + .align 2, 0 +_0809718C: .4byte 0x02038c08 + thumb_func_end dp03_step_grass_heavy + + thumb_func_start dp03_step_bike_splash_probably +dp03_step_bike_splash_probably: @ 8097190 + push {r4,lr} + ldr r3, _080971BC + 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 oe_exec + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080971BC: .4byte 0x02038c08 + thumb_func_end dp03_step_bike_splash_probably + + thumb_func_start dp03_step_drop_water +dp03_step_drop_water: @ 80971C0 + push {r4,lr} + ldr r3, _080971EC + 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 oe_exec + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080971EC: .4byte 0x02038c08 + thumb_func_end dp03_step_drop_water + + thumb_func_start dp03_step_dust +dp03_step_dust: @ 80971F0 + push {r4,lr} + ldr r3, _0809721C + 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 oe_exec + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809721C: .4byte 0x02038c08 + thumb_func_end dp03_step_dust + + thumb_func_start dp03_step_grass_tiny +dp03_step_grass_tiny: @ 8097220 + push {lr} + adds r1, r0, 0 + movs r0, 0x29 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end dp03_step_grass_tiny + + thumb_func_start sub_8097230 +sub_8097230: @ 8097230 + push {lr} + adds r1, r0, 0 + movs r0, 0x2A + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end sub_8097230 + + thumb_func_start dp03_step_bubbles +dp03_step_bubbles: @ 8097240 + push {lr} + ldr r2, _0809725C + 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 oe_exec + pop {r0} + bx r0 + .align 2, 0 +_0809725C: .4byte 0x02038c08 + thumb_func_end dp03_step_bubbles + + thumb_func_start ground_call_by_bits +ground_call_by_bits: @ 8097260 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + bl sub_81D49E8 + 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, _080972B8 + 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 + .align 2, 0 +_080972B8: .4byte 0x0850e674 + thumb_func_end ground_call_by_bits + + thumb_func_start sub_80972BC +sub_80972BC: @ 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, _080972F0 + ands r0, r1 + str r0, [r3] +_080972EA: + pop {r0} + bx r0 + .align 2, 0 +_080972F0: .4byte 0xfff9f7bd + thumb_func_end sub_80972BC + + thumb_func_start ground_bits_filter_small_splashes +ground_bits_filter_small_splashes: @ 80972F4 + push {lr} + adds r2, r1, 0 + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08097308 + ldr r0, [r2] + ldr r1, _0809730C + ands r0, r1 + str r0, [r2] +_08097308: + pop {r0} + bx r0 + .align 2, 0 +_0809730C: .4byte 0xfffffbff + thumb_func_end ground_bits_filter_small_splashes + + thumb_func_start dp03_something_2 +dp03_something_2: @ 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 sub_8096D00 + adds r0, r4, 0 + mov r1, sp + bl dp03_build_bits_2 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_shuffle_bits_in_tall_grass + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl ground_call_by_bits + 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 dp03_something_2 + + thumb_func_start dp03_something +dp03_something: @ 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 sub_8096D00 + adds r0, r4, 0 + mov r1, sp + bl dp03_build_bits_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_shuffle_bits_in_tall_grass + adds r0, r4, 0 + mov r1, sp + bl sub_80972BC + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl ground_call_by_bits + 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 dp03_something + + thumb_func_start ground_effects +ground_effects: @ 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 sub_8096D00 + adds r0, r4, 0 + mov r1, sp + bl npc_analyze_ground + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_shuffle_bits_in_tall_grass + adds r0, r4, 0 + mov r1, sp + bl ground_bits_filter_small_splashes + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl ground_call_by_bits + 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 ground_effects + + thumb_func_start sub_8097404 +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, _08097488 + 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 + .align 2, 0 +_08097488: .4byte 0x02020630 +_0809748C: + movs r0, 0x1 +_0809748E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8097404 + + thumb_func_start player_bitmagic +player_bitmagic: @ 8097494 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080974C8 +_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, _080974CC + 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 + .align 2, 0 +_080974C8: .4byte 0x02037350 +_080974CC: .4byte 0x02037590 + 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, _0809750C +_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, _08097510 + 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 + .align 2, 0 +_0809750C: .4byte 0x02037350 +_08097510: .4byte 0x02037590 + thumb_func_end sub_80974D0 + + thumb_func_start npc_sync_anim_pause_bits +npc_sync_anim_pause_bits: @ 8097514 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r2, [r5] + ldr r1, _08097574 + 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, _08097578 + 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 + .align 2, 0 +_08097574: .4byte 0x00000101 +_08097578: .4byte 0x02020630 + 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, _080975A8 +_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 + .align 2, 0 +_080975A8: .4byte 0x02037350 + thumb_func_end sub_809757C + + thumb_func_start little_step +little_step: @ 80975AC + lsls r1, 24 + ldr r2, _080975C8 + 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 + .align 2, 0 +_080975C8: .4byte 0x0850db7c + thumb_func_end little_step + + thumb_func_start double_little_steps +double_little_steps: @ 80975CC + lsls r1, 24 + ldr r2, _080975EC + 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 + .align 2, 0 +_080975EC: .4byte 0x0850db7c + thumb_func_end double_little_steps + + thumb_func_start triple_little_steps +triple_little_steps: @ 80975F0 + lsls r1, 24 + ldr r2, _08097614 + 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 + .align 2, 0 +_08097614: .4byte 0x0850db7c + thumb_func_end triple_little_steps + + thumb_func_start quad_little_steps +quad_little_steps: @ 8097618 + lsls r1, 24 + ldr r2, _08097638 + 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 + .align 2, 0 +_08097638: .4byte 0x0850db7c + thumb_func_end quad_little_steps + + thumb_func_start oct_little_steps +oct_little_steps: @ 809763C + lsls r1, 24 + ldr r2, _0809765C + 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 + .align 2, 0 +_0809765C: .4byte 0x0850db7c + thumb_func_end oct_little_steps + + thumb_func_start oamt_npc_ministep_reset +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 +obj_npc_ministep: @ 8097674 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _080976CC + 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, _080976D0 + 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 + .align 2, 0 +_080976CC: .4byte 0x0850e768 +_080976D0: .4byte 0x0850e754 +_080976D4: + movs r0, 0 +_080976D6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end obj_npc_ministep + + thumb_func_start sub_80976DC +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 +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, _08097738 + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bx lr + .align 2, 0 +_08097738: .4byte 0x0850e7ba + thumb_func_end sub_8097728 + + thumb_func_start sub_809773C +sub_809773C: @ 809773C + ldr r1, _0809774C + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bx lr + .align 2, 0 +_0809774C: .4byte 0x0850e772 + 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, _08097838 + 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 + .align 2, 0 +_08097838: .4byte 0x0850e834 + 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, _080978DC + mov r0, sp + movs r2, 0x6 + bl memcpy + add r5, sp, 0x8 + ldr r1, _080978E0 + 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 + .align 2, 0 +_080978DC: .4byte 0x0850e840 +_080978E0: .4byte 0x0850e846 + 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, _08097970 + mov r0, sp + movs r2, 0x6 + bl memcpy + add r4, sp, 0x8 + ldr r1, _08097974 + 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 + .align 2, 0 +_08097970: .4byte 0x0850e84a +_08097974: .4byte 0x0850e850 + thumb_func_end sub_80978E4 + + thumb_func_start sub_8097978 +sub_8097978: @ 8097978 + strh r1, [r0, 0x34] + bx lr + thumb_func_end sub_8097978 + + thumb_func_start sub_809797C +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 obj_anim_image_seek + 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, _08097A34 + 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, _08097A38 + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r2, r3, 0 + b _08097A6A + .align 2, 0 +_08097A34: .4byte 0x02021bbc +_08097A38: .4byte 0x02021bbe +_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 npc_y_height_related + 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, _08097B24 + 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, _08097B28 + cmp r1, r0 + bne _08097B16 + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_08097B16: + adds r5, 0x44 + subs r4, 0x1 + cmp r4, 0 + bge _08097AF6 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08097B24: .4byte 0x02020630 +_08097B28: .4byte sub_8097AC8 + 1 + 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, _08097B60 + 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, _08097B64 + 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 + .align 2, 0 +_08097B60: .4byte 0x02020630 +_08097B64: .4byte sub_8097AC8 + 1 +_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, _08097BB0 + adds r4, r0 + adds r0, r5, 0 + bl npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start +_08097BAA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08097BB0: .4byte 0x02020630 + 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, _08097C18 + adds r4, r0, r1 + adds r0, r5, 0 + bl npc_get_type + 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, _08097C1C + 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 + .align 2, 0 +_08097C18: .4byte 0x02020630 +_08097C1C: .4byte 0xfffffc00 +_08097C20: + adds r0, r4, 0 + bl obj_set_f18_to_r0_f42_to_40 + 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 obj_anim_image_start +_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, _08097C70 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x32] + b _08097C80 + .align 2, 0 +_08097C70: .4byte 0x02020630 +_08097C74: + ldr r1, _08097C88 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x32] +_08097C80: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08097C88: .4byte 0x02020630 + 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, _08097CC0 + 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 + .align 2, 0 +_08097CC0: .4byte 0x02020630 + 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, _08097CF0 + 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 + .align 2, 0 +_08097CF0: .4byte 0x02020630 + 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, _08097D64 + 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 + .align 2, 0 +_08097D64: .4byte 0x0000ff60 + 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, _08097DC4 + 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 + .align 2, 0 +_08097DC4: .4byte 0x02020630 +_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, _08097DF4 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl npc_get_local_id_and_mapnumbers + adds r0, r4, 0 + bl oe_exec + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08097DF4: .4byte 0x02038c08 + thumb_func_end oe_exec_and_other_stuff + + thumb_func_start do_animation_x03 +do_animation_x03: @ 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 do_animation_x03 + + thumb_func_start sub_8097E14 +sub_8097E14: @ 8097E14 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x5] + bl npc_get_type + ldr r2, _08097E4C + 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 oe_exec + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08097E4C: .4byte 0x02038c08 + thumb_func_end sub_8097E14 + + 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, _08097E7C + ldr r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + bne _08097E80 + movs r0, 0x14 + bl malloc_and_clear + str r0, [r6] + ldrb r1, [r4, 0x8] + strb r1, [r0] + ldr r1, [r6] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _08097ECC + .align 2, 0 +_08097E7C: .4byte 0x020375b8 +_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, _08097F74 + 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 npc_get_type + 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 + .align 2, 0 +_08097F74: .4byte 0x020375b8 + thumb_func_end sub_8097EF0 + + thumb_func_start sub_8097F78 +sub_8097F78: @ 8097F78 + push {lr} + movs r2, 0 + ldr r1, _08097F90 + 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 + .align 2, 0 +_08097F90: .4byte 0x020375b8 +_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, _08097FD8 + 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, _08097FDC + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r6, 0 + bl sub_806F67C + strb r5, [r6, 0x1B] + ldr r0, _08097FE0 + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08097FD8: .4byte sub_8097FE4 + 1 +_08097FDC: .4byte 0x03005e00 +_08097FE0: .4byte 0x0000ffff + 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, _0809803C + 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, _08098040 + 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 + .align 2, 0 +_0809803C: .4byte 0x03005e00 +_08098040: .4byte 0x02020630 + 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, _08098070 + 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 + .align 2, 0 +_08098070: .4byte 0x03005e00 + 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, _080980B8 +_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, _080980BC + 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 + .align 2, 0 +_080980B8: .4byte 0x02037350 +_080980BC: .4byte 0x02037590 + 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, _08098104 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0 + bx lr + .align 2, 0 +_08098104: .4byte 0x0000ff60 + 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, _0809814C + movs r0, 0 + strb r0, [r1] + ldr r2, _08098150 + 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 + .align 2, 0 +_0809814C: .4byte 0x020375bc +_08098150: .4byte 0x03003014 + 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, _08098178 + 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 + .align 2, 0 +_08098178: .4byte 0x03005e00 +_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, _080981B8 + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl remove_task +_080981B0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080981B8: .4byte 0x020375bc + thumb_func_end sub_8098154 + + thumb_func_start task_add_textbox +task_add_textbox: @ 80981BC + push {lr} + ldr r0, _080981CC + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080981CC: .4byte sub_8098154 + 1 + thumb_func_end task_add_textbox + + thumb_func_start task_del_textbox +task_del_textbox: @ 80981D0 + push {lr} + ldr r0, _080981E8 + 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 + .align 2, 0 +_080981E8: .4byte sub_8098154 + 1 + 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, _08098208 + 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 + .align 2, 0 +_08098208: .4byte 0x020375bc +_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, _08098234 + strb r1, [r0] + adds r0, r4, 0 + bl remove_task +_0809822E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08098234: .4byte 0x020375bc + thumb_func_end sub_8098214 + + thumb_func_start sub_8098238 +sub_8098238: @ 8098238 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08098264 + ldrb r0, [r5] + cmp r0, 0 + bne _08098270 + ldr r0, _08098268 + adds r1, r4, 0 + bl ExpandTextCodes + ldr r0, _0809826C + movs r1, 0 + bl AddTask + adds r0, r4, 0 + bl sub_8196080 + movs r0, 0x2 + strb r0, [r5] + movs r0, 0x1 + b _08098272 + .align 2, 0 +_08098264: .4byte 0x020375bc +_08098268: .4byte 0x02021fc4 +_0809826C: .4byte sub_8098214 + 1 +_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, _08098294 + 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 + .align 2, 0 +_08098294: .4byte 0x020375bc +_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, _080982B4 + movs r1, 0x3 + strb r1, [r2] + movs r1, 0x1 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_080982B4: .4byte 0x020375bc + thumb_func_end sub_80982A0 + + thumb_func_start sub_80982B8 +sub_80982B8: @ 80982B8 + push {lr} + ldr r1, _080982D0 + 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 + .align 2, 0 +_080982D0: .4byte 0x020375bc +_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, _08098300 + adds r1, r2, 0 + bl ExpandTextCodes + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl get_map_name + bl task_add_textbox + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08098300: .4byte 0x02021fc4 + 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 get_map_name + 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, _0809832C + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0809832C: .4byte 0x020375bc + thumb_func_end textbox_close + + thumb_func_start textbox_any_visible +textbox_any_visible: @ 8098330 + ldr r0, _08098338 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08098338: .4byte 0x020375bc + thumb_func_end textbox_any_visible + + thumb_func_start sub_809833C +sub_809833C: @ 809833C + push {lr} + ldr r0, _0809834C + ldrb r0, [r0] + cmp r0, 0 + beq _08098350 + movs r0, 0 + b _08098352 + .align 2, 0 +_0809834C: .4byte 0x020375bc +_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, _08098370 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08098370: .4byte 0x020375bc + thumb_func_end sub_8098358 + + thumb_func_start sub_8098374 +sub_8098374: @ 8098374 + push {lr} + bl task_del_textbox + ldr r1, _08098384 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08098384: .4byte 0x020375bc + thumb_func_end sub_8098374 + + thumb_func_start walkrun_is_standing_still +walkrun_is_standing_still: @ 8098388 + push {lr} + ldr r0, _08098398 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _0809839C + movs r0, 0x1 + b _0809839E + .align 2, 0 +_08098398: .4byte 0x02037590 +_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, _080983DC + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080983E0 + bl sub_808BCF4 + movs r0, 0x1 + b _080983E2 + .align 2, 0 +_080983DC: .4byte sub_80983A4 + 1 +_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, _080983FC + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080983FC: .4byte sub_80983A4 + 1 + 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, _08098470 + 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, _08098474 + ldr r0, _08098478 + 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 + .align 2, 0 +_08098470: .4byte 0x03005e00 +_08098474: .4byte 0x02037350 +_08098478: .4byte 0x03005df0 + thumb_func_end sub_8098400 + + thumb_func_start sub_809847C +sub_809847C: @ 809847C + push {lr} + ldr r0, _08098494 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _08098498 + bl sub_808BCF4 + movs r0, 0x1 + b _0809849A + .align 2, 0 +_08098494: .4byte sub_8098400 + 1 +_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, _080984E4 + ldrb r0, [r4] + bl sub_80974D0 + ldr r0, _080984E8 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _080984EC + 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, _080984F0 + 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 + .align 2, 0 +_080984E4: .4byte 0x03005df0 +_080984E8: .4byte sub_8098400 + 1 +_080984EC: .4byte 0x02037350 +_080984F0: .4byte 0x03005e00 + 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 get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08098520 + adds r0, r1 + bl sub_8093284 + bl sub_80D338C + bl sub_809757C + pop {r0} + bx r0 + .align 2, 0 +_08098520: .4byte 0x02037350 + thumb_func_end sub_80984F4 + + thumb_func_start sub_8098524 +sub_8098524: @ 8098524 + push {r4,lr} + ldr r4, _0809856C + ldr r0, _08098570 + 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 sub_8093284 +_08098542: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_8093284 + bl sub_80D338C + bl sub_809757C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809856C: .4byte 0x02037350 +_08098570: .4byte 0x03005df0 + thumb_func_end sub_8098524 + + thumb_func_start sub_8098574 +sub_8098574: @ 8098574 + push {lr} + ldr r0, _08098590 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08098594 + adds r0, r1 + ldr r1, _08098598 + ldrb r1, [r1] + bl npc_reciprocate_look + pop {r0} + bx r0 + .align 2, 0 +_08098590: .4byte 0x03005df0 +_08098594: .4byte 0x02037350 +_08098598: .4byte 0x020375f4 + thumb_func_end sub_8098574 + + thumb_func_start sub_809859C +sub_809859C: @ 809859C + push {lr} + ldr r0, _080985B4 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080985B8 + adds r0, r1 + bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + pop {r0} + bx r0 + .align 2, 0 +_080985B4: .4byte 0x03005df0 +_080985B8: .4byte 0x02037350 + 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, _08098628 + 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, _0809862C + 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 + .align 2, 0 +_08098628: .4byte 0x03005e00 +_0809862C: .4byte 0x02037350 + 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, _080986D0 + 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, _080986D4 + adds r0, r7, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080986D8 + 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, _080986DC + 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 + .align 2, 0 +_080986D0: .4byte 0x030060a8 +_080986D4: .4byte sub_80985BC + 1 +_080986D8: .4byte 0x03005e00 +_080986DC: .4byte 0x02037350 +_080986E0: + adds r0, r4, 0 + bl sub_80974D0 + ldr r0, _08098728 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0809872C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + strh r4, [r5, 0xC] + ldr r1, _08098730 + 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 + .align 2, 0 +_08098728: .4byte sub_80985BC + 1 +_0809872C: .4byte 0x03005e00 +_08098730: .4byte 0x02037350 + thumb_func_end sub_8098630 + + thumb_func_start sub_8098734 +sub_8098734: @ 8098734 + push {lr} + ldr r0, _0809874C + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _08098750 + bl sub_808BCF4 + movs r0, 0x1 + b _08098752 + .align 2, 0 +_0809874C: .4byte sub_80985BC + 1 +_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, _0809876C + adds r0, r1 + b _08098772 + .align 2, 0 +_0809876C: .4byte 0x0851021c +_08098770: + ldr r0, _08098778 +_08098772: + pop {r1} + bx r1 + .align 2, 0 +_08098778: .4byte 0x0851021c + thumb_func_end sub_8098758 + + thumb_func_start copy_textbox_border_tile_patterns_to_vram +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 Window_GetField + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080987B8 + movs r2, 0xE0 + lsls r2, 1 + adds r3, r4, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + bl sub_8098C64 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080987B8: .4byte 0x08ddd748 + 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 Window_GetField + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08098828 + lsls r4, 3 + adds r1, r4, r5 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + adds r3, r6, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + 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 + .align 2, 0 +_08098828: .4byte 0x0851021c + 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, _08098854 + ldr r1, [r1] + ldrb r1, [r1, 0x14] + lsrs r1, 3 + adds r2, r4, 0 + bl sub_80987D4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08098854: .4byte 0x03005d90 + 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 Window_GetField + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl Window_GetField + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl Window_GetField + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + adds r0, r4, 0 + movs r1, 0x3 + bl Window_GetField + mov r9, r0 + mov r2, r9 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + adds r0, r4, 0 + movs r1, 0x4 + bl Window_GetField + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Window_GetField + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl Window_GetField + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl Window_GetField + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + adds r0, r4, 0 + movs r1, 0x3 + bl Window_GetField + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0x4 + bl Window_GetField + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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 Window_GetField + mov r9, r0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r6, 0 + movs r1, 0x1 + bl Window_GetField + mov r8, r0 + mov r1, r8 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + adds r0, r6, 0 + movs r1, 0x2 + bl Window_GetField + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x3 + bl Window_GetField + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x4 + bl Window_GetField + 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 Bg_FillWramTileMapRectWithTileAndPalette + 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, _08098C2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08098C2C: .4byte _08098C30 + .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, _08098C60 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_08098C60: .4byte 0x0851017c + thumb_func_end stdpal_get + + thumb_func_start sub_8098C64 +sub_8098C64: @ 8098C64 + ldr r0, _08098C68 + bx lr + .align 2, 0 +_08098C68: .4byte 0x08ddd728 + 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, _08098CB0 + ldr r5, _08098CB4 + 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 gpu_copy_bg_tile_pattern_data_to_vram + 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 + .align 2, 0 +_08098CB0: .4byte 0x0851021c +_08098CB4: .4byte 0x03005d90 + thumb_func_end sub_8098C6C + + thumb_func_start script_env_init +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 +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 +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 +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, _08098D68 + ldr r0, [r0] + cmp r2, r0 + bne _08098D6C +_08098D64: + swi 0x2 + b _08098D64 + .align 2, 0 +_08098D68: .4byte 0x085102bc +_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 +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 +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 +script_jump: @ 8098DE4 + str r1, [r0, 0x8] + bx lr + thumb_func_end script_jump + + thumb_func_start script_call +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 +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 +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 +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, _08098E5C + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_08098E5C: .4byte 0x03000f2c + thumb_func_end script_env_2_enable + + thumb_func_start script_env_2_disable +script_env_2_disable: @ 8098E60 + ldr r1, _08098E68 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08098E68: .4byte 0x03000f2c + thumb_func_end script_env_2_disable + + thumb_func_start script_env_2_is_enabled +script_env_2_is_enabled: @ 8098E6C + ldr r0, _08098E74 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08098E74: .4byte 0x03000f2c + thumb_func_end script_env_2_is_enabled + + thumb_func_start script_env_context_is_running +script_env_context_is_running: @ 8098E78 + push {lr} + ldr r0, _08098E88 + ldrb r0, [r0] + cmp r0, 0 + beq _08098E8C + movs r0, 0 + b _08098E8E + .align 2, 0 +_08098E88: .4byte 0x03000e38 +_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, _08098EAC + ldr r1, _08098EB0 + ldr r2, _08098EB4 + bl script_env_init + ldr r1, _08098EB8 + movs r0, 0x2 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08098EAC: .4byte 0x03000e40 +_08098EB0: .4byte 0x081db67c +_08098EB4: .4byte 0x081dba08 +_08098EB8: .4byte 0x03000e38 + 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, _08098EE0 + ldrb r0, [r4] + cmp r0, 0x2 + beq _08098EF0 + cmp r0, 0x1 + beq _08098EF0 + bl script_env_2_enable + ldr r0, _08098EE4 + bl script_main_handler + lsls r0, 24 + cmp r0, 0 + beq _08098EE8 + movs r0, 0x1 + b _08098EF2 + .align 2, 0 +_08098EE0: .4byte 0x03000e38 +_08098EE4: .4byte 0x03000e40 +_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, _08098F20 + ldr r1, _08098F24 + ldr r2, _08098F28 + 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, _08098F2C + movs r0, 0 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08098F20: .4byte 0x03000e40 +_08098F24: .4byte 0x081db67c +_08098F28: .4byte 0x081dba08 +_08098F2C: .4byte 0x03000e38 + 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, _08098F38 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_08098F38: .4byte 0x03000e38 + 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, _08098F4C + movs r0, 0 + strb r0, [r1] + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_08098F4C: .4byte 0x03000e38 + thumb_func_end script_env_2_enable_and_set_ctx_running + + thumb_func_start script_env_2_execute_new_script +script_env_2_execute_new_script: @ 8098F50 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08098F7C + ldr r1, _08098F80 + ldr r2, _08098F84 + adds r0, r4, 0 + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script +_08098F68: + ldr r0, _08098F7C + bl script_main_handler + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08098F68 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08098F7C: .4byte 0x03000eb8 +_08098F80: .4byte 0x081db67c +_08098F84: .4byte 0x081dba08 + 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, _08098FA0 + ldr r2, [r0, 0x8] + cmp r2, 0 + beq _08098F9C +_08098F96: + ldrb r0, [r2] + cmp r0, 0 + bne _08098FA4 +_08098F9C: + movs r0, 0 + b _08098FC2 + .align 2, 0 +_08098FA0: .4byte 0x02037318 +_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 +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 var_get + adds r4, r0, 0 + adds r0, r5, 0 + bl var_get + 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 +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 +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, _080990C8 + ldr r0, [r0] + ldr r1, _080990CC + adds r0, r1 + movs r1, 0xFA + lsls r1, 2 + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080990C8: .4byte 0x03005d8c +_080990CC: .4byte 0x0000372c + thumb_func_end sub_80990AC + + thumb_func_start killram +killram: @ 80990D0 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r0, _080990F0 + ldr r1, [r0] + ldr r0, _080990F4 + adds r1, r0 + ldr r2, _080990F8 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080990F0: .4byte 0x03005d8c +_080990F4: .4byte 0x00003728 +_080990F8: .4byte 0x050000fb + 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, _08099160 + mov r10, r0 + ldr r5, [r0] + ldr r1, _08099164 + adds r4, r5, r1 + bl killram + ldr r0, _08099168 + 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, _0809916C + adds r0, r5, r1 + ldr r1, [sp] + mov r2, r8 + bl memcpy + bl sub_80990AC + mov r2, r10 + ldr r1, [r2] + ldr r2, _08099170 + adds r1, r2 + str r0, [r1] + movs r0, 0x1 + b _08099176 + .align 2, 0 +_08099160: .4byte 0x03005d8c +_08099164: .4byte 0x0000372c +_08099168: .4byte 0x000003e3 +_0809916C: .4byte 0x00003730 +_08099170: .4byte 0x00003728 +_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 +sub_8099188: @ 8099188 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r6, _080991D8 + ldr r5, [r6] + ldr r0, _080991DC + adds r2, r5, r0 + ldr r7, _080991E0 + 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, _080991E4 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _080991EC + str r4, [r7] + ldr r1, _080991E8 + adds r0, r5, r1 + b _080991F2 + .align 2, 0 +_080991D8: .4byte 0x03005d8c +_080991DC: .4byte 0x0000372c +_080991E0: .4byte 0x020375c0 +_080991E4: .4byte 0x00003728 +_080991E8: .4byte 0x00003730 +_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, _08099230 + ldr r0, [r4] + ldr r2, _08099234 + 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, _08099238 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _0809923C + movs r0, 0x1 + b _0809923E + .align 2, 0 +_08099230: .4byte 0x03005d8c +_08099234: .4byte 0x0000372c +_08099238: .4byte 0x00003728 +_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, _08099284 + ldr r5, [r6] + ldr r0, _08099288 + 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, _0809928C + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _08099294 + ldr r1, _08099290 + adds r0, r5, r1 + b _0809929A + .align 2, 0 +_08099284: .4byte 0x03005d8c +_08099288: .4byte 0x0000372c +_0809928C: .4byte 0x00003728 +_08099290: .4byte 0x00003730 +_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, _080992C8 + 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 + .align 2, 0 +_080992C8: .4byte 0x000003e3 + 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, _08099314 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08099314: .4byte 0x081dba64 + 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 var_get_pointer + adds r6, r0, 0 + ldr r4, _08099348 + 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 + .align 2, 0 +_08099348: .4byte 0x081dba64 + 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 +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, _080993DC + 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 + .align 2, 0 +_080993DC: .4byte 0x085102c0 + 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, _08099418 + 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 + .align 2, 0 +_08099418: .4byte 0x085102c0 + thumb_func_end s07_if_call + + thumb_func_start sB8_set_virtual_address +sB8_set_virtual_address: @ 809941C + push {r4,lr} + ldr r4, [r0, 0x8] + subs r4, 0x1 + bl script_read_word + ldr r1, _08099434 + subs r0, r4 + str r0, [r1] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099434: .4byte 0x020375c4 + thumb_func_end sB8_set_virtual_address + + thumb_func_start sB9_virtual_jump +sB9_virtual_jump: @ 8099438 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, _08099458 + ldr r0, [r0] + subs r1, r0 + adds r0, r4, 0 + bl script_jump + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099458: .4byte 0x020375c4 + 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, _0809947C + ldr r0, [r0] + subs r1, r0 + adds r0, r4, 0 + bl script_call + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809947C: .4byte 0x020375c4 + 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, _080994BC + ldr r1, [r1] + subs r2, r0, r1 + ldr r1, _080994C0 + 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 + .align 2, 0 +_080994BC: .4byte 0x020375c4 +_080994C0: .4byte 0x085102c0 + 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, _08099500 + ldr r1, [r1] + subs r2, r0, r1 + ldr r1, _08099504 + 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 + .align 2, 0 +_08099500: .4byte 0x020375c4 +_08099504: .4byte 0x085102c0 + 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, _08099530 + adds r1, r0 + ldr r0, _08099534 + cmp r1, r0 + bcs _08099528 + ldr r1, [r1] + adds r0, r2, 0 + bl script_jump +_08099528: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08099530: .4byte 0x081dc2a0 +_08099534: .4byte 0x081dc2cc + 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, _08099560 + adds r1, r0 + ldr r0, _08099564 + cmp r1, r0 + bcs _08099558 + ldr r1, [r1] + adds r0, r2, 0 + bl script_call +_08099558: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08099560: .4byte 0x081dc2a0 +_08099564: .4byte 0x081dc2cc + 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, _080995A8 + 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, _080995AC + adds r1, r0, r1 + ldr r0, _080995B0 + 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 + .align 2, 0 +_080995A8: .4byte 0x085102c0 +_080995AC: .4byte 0x081dc2a0 +_080995B0: .4byte 0x081dc2cc + 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, _080995F4 + 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, _080995F8 + adds r1, r0, r1 + ldr r0, _080995FC + 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 + .align 2, 0 +_080995F4: .4byte 0x085102c0 +_080995F8: .4byte 0x081dc2a0 +_080995FC: .4byte 0x081dc2cc + thumb_func_end s0B_callstd_if + + thumb_func_start s0C_restore_execution_after_sCF +s0C_restore_execution_after_sCF: @ 8099600 + push {lr} + ldr r1, _08099610 + ldr r1, [r1] + bl script_jump + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08099610: .4byte 0x020375c0 + 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 +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 +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 +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 +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 +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 var_get_pointer + 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 var_get_pointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get_pointer + 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 var_get_pointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 var_get_pointer + 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 var_get_pointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get_pointer + 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 var_get_pointer + 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 var_get_pointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, _0809999C + 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 + .align 2, 0 +_0809999C: .4byte 0x020375f0 + 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 var_get + 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 var_get + adds r1, r0, 0 + ldr r5, _080999E0 + 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 + .align 2, 0 +_080999E0: .4byte 0x020375f0 + 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 var_get + 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 var_get + adds r1, r0, 0 + ldr r5, _08099A24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D6AA4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08099A24: .4byte 0x020375f0 + 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 var_get + 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 var_get + adds r1, r0, 0 + ldr r5, _08099A68 + 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 + .align 2, 0 +_08099A68: .4byte 0x020375f0 + 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 var_get + 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 var_get + adds r1, r0, 0 + ldr r5, _08099AAC + 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 + .align 2, 0 +_08099AAC: .4byte 0x020375f0 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08099AD8 + bl sub_80D6C68 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099AD8: .4byte 0x020375f0 + 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 var_get + 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 var_get + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r5, _08099B1C + 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 + .align 2, 0 +_08099B1C: .4byte 0x020375f0 + 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 var_get + 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 var_get + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r5, _08099B60 + 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 + .align 2, 0 +_08099B60: .4byte 0x020375f0 + 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 var_get + ldr r4, _08099B8C + lsls r0, 24 + lsrs r0, 24 + bl sub_8161960 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099B8C: .4byte 0x020375f0 + 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 var_get + ldr r4, _08099BB8 + 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 + .align 2, 0 +_08099BB8: .4byte 0x020375f0 + 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 var_get + ldr r4, _08099BE4 + 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 + .align 2, 0 +_08099BE4: .4byte 0x020375f0 + 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 var_get + ldr r4, _08099C10 + 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 + .align 2, 0 +_08099C10: .4byte 0x020375f0 + thumb_func_end sub_8099BE8 + + thumb_func_start s29_flag_set +s29_flag_set: @ 8099C14 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl flag_set + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s29_flag_set + + thumb_func_start s2A_flag_clear +s2A_flag_clear: @ 8099C28 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl flag_clear + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2A_flag_clear + + thumb_func_start s2B_flag_check +s2B_flag_check: @ 8099C3C + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl flag_check + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s2B_flag_check + + thumb_func_start sC3_unknown +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 +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 +s99_unknown: @ 8099C8C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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, _08099CBC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08099CC0 + movs r0, 0 + b _08099CC2 + .align 2, 0 +_08099CBC: .4byte 0x02037fd4 +_08099CC0: + movs r0, 0x1 +_08099CC2: + pop {r1} + bx r1 + thumb_func_end sub_8099CA8 + + thumb_func_start s97_screen_special_effect +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, _08099CEC + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099CEC: .4byte sub_8099CA8 + 1 + thumb_func_end s97_screen_special_effect + + thumb_func_start s98_refade_with_timer +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, _08099D1C + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099D1C: .4byte sub_8099CA8 + 1 + thumb_func_end s98_refade_with_timer + + thumb_func_start sub_8099D20 +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, _08099D54 + ldr r1, _08099D58 + ldr r2, _08099D5C + bl CpuSet + adds r0, r4, 0 + movs r1, 0 + bl fade_screen + b _08099D72 + .align 2, 0 +_08099D54: .4byte 0x02037714 +_08099D58: .4byte 0x02037fe8 +_08099D5C: .4byte 0x04000100 +_08099D60: + ldr r0, _08099D84 + ldr r1, _08099D88 + ldr r2, _08099D8C + bl CpuSet + adds r0, r4, 0 + movs r1, 0 + bl fade_screen +_08099D72: + ldr r1, _08099D90 + adds r0, r5, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08099D84: .4byte 0x02037fe8 +_08099D88: .4byte 0x02037714 +_08099D8C: .4byte 0x04000100 +_08099D90: .4byte sub_8099CA8 + 1 + thumb_func_end sub_8099D20 + + thumb_func_start s28_pause_asm +s28_pause_asm: @ 8099D94 + push {lr} + ldr r1, _08099DA8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _08099DAC + movs r0, 0 + b _08099DAE + .align 2, 0 +_08099DA8: .4byte 0x020375c8 +_08099DAC: + movs r0, 0x1 +_08099DAE: + pop {r1} + bx r1 + thumb_func_end s28_pause_asm + + thumb_func_start s28_pause +s28_pause: @ 8099DB4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + ldr r1, _08099DD0 + strh r0, [r1] + ldr r1, _08099DD4 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08099DD0: .4byte 0x020375c8 +_08099DD4: .4byte s28_pause_asm + 1 + thumb_func_end s28_pause + + thumb_func_start s2C_unknown +s2C_unknown: @ 8099DD8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 var_get + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_802F5B4 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s2C_unknown + + thumb_func_start s2D_unknown +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 +s2E_unknown: @ 8099E1C + push {lr} + bl sub_802F588 + ldr r2, _08099E44 + ldr r1, _08099E48 + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r2] + ldr r2, _08099E4C + movs r0, 0x3 + ldrsb r0, [r1, r0] + strh r0, [r2] + ldr r2, _08099E50 + movs r0, 0x4 + ldrsb r0, [r1, r0] + strh r0, [r2] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08099E44: .4byte 0x020375d8 +_08099E48: .4byte 0x03005cf8 +_08099E4C: .4byte 0x020375da +_08099E50: .4byte 0x020375dc + thumb_func_end s2E_unknown + + thumb_func_start sA4_set_weather_data +sA4_set_weather_data: @ 8099E54 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 +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 +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 +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 +sA7_set_new_map_footer: @ 8099EA0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 +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 var_get + 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 var_get + 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 +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 var_get + 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 var_get + 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 +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 var_get + 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 var_get + 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 player_get_pos_to + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 +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 var_get_pointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get_pointer + ldr r2, _0809A494 + 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 + .align 2, 0 +_0809A494: .4byte 0x03005d8c + 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, _0809A4B0 + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809A4B0: .4byte 0x020375f0 + 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, _0809A4F0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809A4F0: .4byte s30_music_check_asm + 1 + 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, _0809A528 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809A528: .4byte s32_fanfare_wait_asm + 1 + thumb_func_end s32_fanfare_wait + + thumb_func_start s33_play_music +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_x2C +_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_x2C + 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, _0809A5C0 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809A5C0: .4byte sub_80A3200 + 1 + 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 var_get + 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, _0809A624 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + ldr r0, _0809A628 + strh r4, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809A624: .4byte 0x03005d8c +_0809A628: .4byte 0x020375ca + 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 var_get + 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, _0809A66C + strh r4, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809A66C: .4byte 0x020375ca + thumb_func_end s50_execute_movement_remote + + thumb_func_start s51a_0806B288 +s51a_0806B288: @ 809A670 + push {lr} + ldr r0, _0809A68C + ldrb r0, [r0] + ldr r1, _0809A690 + ldrb r1, [r1] + ldr r2, _0809A694 + ldrb r2, [r2] + bl sub_80D3340 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0809A68C: .4byte 0x020375ca +_0809A690: .4byte 0x020375ce +_0809A694: .4byte 0x020375cc + 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 var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0809A6B4 + ldr r0, _0809A6D8 + strh r1, [r0] +_0809A6B4: + ldr r1, _0809A6DC + ldr r0, _0809A6E0 + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + strh r0, [r1] + ldr r1, _0809A6E4 + movs r0, 0x5 + ldrsb r0, [r2, r0] + strh r0, [r1] + ldr r1, _0809A6E8 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809A6D8: .4byte 0x020375ca +_0809A6DC: .4byte 0x020375cc +_0809A6E0: .4byte 0x03005d8c +_0809A6E4: .4byte 0x020375ce +_0809A6E8: .4byte s51a_0806B288 + 1 + 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 var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0809A708 + ldr r0, _0809A730 + 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, _0809A734 + strh r2, [r0] + ldr r0, _0809A738 + strh r1, [r0] + ldr r1, _0809A73C + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809A730: .4byte 0x020375ca +_0809A734: .4byte 0x020375cc +_0809A738: .4byte 0x020375ce +_0809A73C: .4byte s51a_0806B288 + 1 + 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 var_get + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809A764 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl npc_hide_by_local_id_and_map + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809A764: .4byte 0x03005d8c + 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 var_get + 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 npc_hide_by_local_id_and_map + 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 var_get + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809A7BC + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809A7BC: .4byte 0x03005d8c + 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 var_get + 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 var_get + 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 var_get + 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 var_get + lsls r5, 24 + lsrs r5, 24 + ldr r1, _0809A854 + 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 + .align 2, 0 +_0809A854: .4byte 0x03005d8c + 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 var_get + 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 var_get + 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 var_get + 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 sub_8084910 + 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 var_get + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809A8D4 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809A8D4: .4byte 0x03005d8c + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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, _0809A9D4 + ldr r0, _0809A9D8 + 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__sp1AA + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_reciprocate_look +_0809A9CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809A9D4: .4byte 0x02037350 +_0809A9D8: .4byte 0x03005df0 + 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 var_get + ldr r1, [r4, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809AA0C + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl npc_turn_by_local_id_and_map + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809AA0C: .4byte 0x03005d8c + 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 var_get + ldr r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_808494C + 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 var_get + 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 var_get + 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, _0809AAE0 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + b _0809AAE6 + .align 2, 0 +_0809AAE0: .4byte sub_80983C4 + 1 +_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, _0809AB20 + ldr r0, _0809AB24 + 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, _0809AB28 + adds r0, r4, 0 + bl script_setup_asm_script + b _0809AB38 + .align 2, 0 +_0809AB20: .4byte 0x02037350 +_0809AB24: .4byte 0x03005df0 +_0809AB28: .4byte sub_809847C + 1 +_0809AB2C: + bl sub_80983E8 + ldr r1, _0809AB40 + adds r0, r4, 0 + bl script_setup_asm_script +_0809AB38: + movs r0, 0x1 +_0809AB3A: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809AB40: .4byte sub_80983C4 + 1 + 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 get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0809AB78 + adds r0, r1 + bl sub_8093284 + bl sub_80D338C + bl sub_809757C + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809AB78: .4byte 0x02037350 + thumb_func_end s6B_release + + thumb_func_start s6C_release_2 +s6C_release_2: @ 809AB7C + push {r4,lr} + bl textbox_close + ldr r4, _0809ABCC + ldr r0, _0809ABD0 + 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 sub_8093284 +_0809AB9E: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_8093284 + bl sub_80D338C + bl sub_809757C + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809ABCC: .4byte 0x02037350 +_0809ABD0: .4byte 0x03005df0 + 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, _0809AC38 + 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 + .align 2, 0 +_0809AC38: .4byte 0x03003014 + thumb_func_end s9B_unknown + + thumb_func_start s78_braille_msgbox +s78_braille_msgbox: @ 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 s78_braille_msgbox + + thumb_func_start sub_809AC78 +sub_809AC78: @ 809AC78 + push {lr} + ldr r1, _0809AC88 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809AC88: .4byte sub_809833C + 1 + 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, _0809ACB4 + 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 + .align 2, 0 +_0809ACB4: .4byte 0x030022c0 +_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, _0809ACD0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809ACD0: .4byte sub_809AC98 + 1 + 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 sub_809AD00 +sub_809AD00: @ 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 sub_80E1E08 + 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 sub_809AD00 + + 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 var_get + 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, _0809AF8C + adds r1, 0x6 + adds r0, r4, 0 + bl ExpandTextCodes + movs r2, 0x1 + negs r2, r2 + movs r0, 0x6 + adds r1, r4, 0 + bl font_get_width_of_string + 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, _0809AF90 + mov r0, r8 + bl Window_AddFromTemplate + 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 Window_WriteStandardTileMap + ldrb r0, [r5] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r5] + ldr r2, _0809AF8C + 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 Window_CopyToVram + movs r0, 0 + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0809AF8C: .4byte 0x02021fc4 +_0809AF90: .4byte 0x03000f30 + 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, _0809AFB8 + ldr r1, [r1] + subs r0, r1 + bl box_related_two__2 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809AFB8: .4byte 0x020375c4 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0809AFF4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + movs r1, 0xB + muls r1, r0 + ldr r0, _0809AFF8 + adds r1, r0 + adds r0, r2, 0 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809AFF4: .4byte 0x085102d4 +_0809AFF8: .4byte 0x083185c8 + 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, _0809B03C + 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, _0809B040 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, _0809B044 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B03C: .4byte 0x085102d4 +_0809B040: .4byte 0x020244ec +_0809B044: .4byte 0x083185c8 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0809B088 + adds r0, r1 + ldr r1, _0809B08C + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B088: .4byte 0x020244ec +_0809B08C: .4byte 0x085102d4 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0809B0C0 + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl itemid_get_name + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B0C0: .4byte 0x085102d4 + 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 var_get + 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 var_get + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r0, _0809B110 + 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 + .align 2, 0 +_0809B110: .4byte 0x085102d4 + 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 var_get + adds r1, r0, 0 + lsls r1, 16 + ldr r0, _0809B148 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsrs r1, 11 + ldr r2, _0809B14C + adds r1, r2 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B148: .4byte 0x085102d4 +_0809B14C: .4byte 0x085a5c09 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0809B188 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + movs r1, 0xD + muls r1, r0 + ldr r0, _0809B18C + adds r1, r0 + adds r0, r2, 0 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B188: .4byte 0x085102d4 +_0809B18C: .4byte 0x0831977c + 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 var_get + 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, _0809B1D0 + lsls r5, 2 + adds r5, r0 + ldr r0, [r5] + adds r1, r4, 0 + movs r2, 0 + bl decimal_int_to_string + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809B1D0: .4byte 0x085102d4 + 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 var_get + lsls r0, 16 + ldr r1, _0809B20C + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + ldr r1, _0809B210 + lsrs r0, 14 + adds r0, r1 + ldr r1, [r0] + adds r0, r2, 0 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B20C: .4byte 0x085102d4 +_0809B210: .4byte 0x0858baf0 + 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 var_get + adds r1, r0, 0 + ldr r0, _0809B244 + 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 + .align 2, 0 +_0809B244: .4byte 0x085102d4 + 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, _0809B26C + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B26C: .4byte 0x085102d4 + 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, _0809B28C + ldr r0, [r0] + subs r1, r0 + ldr r0, _0809B290 + bl ExpandTextCodes + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809B28C: .4byte 0x020375c4 +_0809B290: .4byte 0x02021fc4 + 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, _0809B2C0 + ldr r0, [r0] + subs r1, r0 + ldr r0, _0809B2C4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B2C0: .4byte 0x020375c4 +_0809B2C4: .4byte 0x085102d4 + 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 var_get + ldr r1, _0809B300 + 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 gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B300: .4byte 0x085102d4 + 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 var_get + 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 var_get + 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, _0809B380 + 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 + .align 2, 0 +_0809B380: .4byte 0x020375f0 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, _0809B3AC + bl sub_80F92C8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B3AC: .4byte 0x020375f0 + 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, _0809B3F0 + movs r0, 0x6 + strh r0, [r1] + movs r6, 0 + b _0809B42A + .align 2, 0 +_0809B3F0: .4byte 0x020375f0 +_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, _0809B41C + strh r6, [r0] + ldr r0, _0809B420 + strh r5, [r0] + b _0809B44A + .align 2, 0 +_0809B41C: .4byte 0x020375f0 +_0809B420: .4byte 0x020375e0 +_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, _0809B454 + 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 + .align 2, 0 +_0809B454: .4byte 0x020244ec + thumb_func_end sub_809B3DC + + thumb_func_start s90_add_money +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, _0809B488 + 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 + .align 2, 0 +_0809B488: .4byte 0x03005d8c + thumb_func_end s90_add_money + + thumb_func_start s91_subtract_money +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, _0809B4BC + 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 + .align 2, 0 +_0809B4BC: .4byte 0x03005d8c + thumb_func_end s91_subtract_money + + thumb_func_start s92_check_money +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, _0809B4F8 + ldr r0, _0809B4FC + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl is_money_greater_than + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_0809B4EE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B4F8: .4byte 0x020375f0 +_0809B4FC: .4byte 0x03005d8c + thumb_func_end s92_check_money + + thumb_func_start s93_display_money +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, _0809B538 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl decrypt_money + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E52EC +_0809B530: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809B538: .4byte 0x03005d8c + 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 +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, _0809B574 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl decrypt_money + bl sub_80E52D4 +_0809B56E: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809B574: .4byte 0x03005d8c + 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 sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8145BAC + 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 sub_8145C14 + 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 sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + bl sub_8145B54 + 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 battle_configure_by_script + 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 +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 var_get + 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 var_get + 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 var_get + 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 sub_80E1284 + 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 sub_80E12A8 + 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 sub_80E12C8 + 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 var_get + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809B718 + bl sub_812A540 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809B718: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end s89_open_casino_game1 + + thumb_func_start sub_809B71C +sub_809B71C: @ 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 sub_80E191C + b _0809B750 +_0809B744: + adds r0, r5, 0 + adds r1, r3, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_80E191C +_0809B750: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809B71C + + thumb_func_start sub_809B758 +sub_809B758: @ 809B758 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + ldr r4, _0809B780 + lsls r0, 24 + lsrs r0, 24 + bl sub_80EF038 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B780: .4byte 0x020375f0 + 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, _0809B7C8 + ldrb r0, [r0] + bl sub_80F84C4 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809B7C8: .4byte 0x02039f2c + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0809B7F0 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl oe_exec + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809B7F0: .4byte 0x020375d0 + 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 var_get + ldr r1, _0809B820 + lsls r4, 2 + adds r4, r1 + lsls r0, 16 + asrs r0, 16 + str r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B820: .4byte 0x02038c08 + thumb_func_end s9D_set_HM_animation_data + + thumb_func_start sub_809B824 +sub_809B824: @ 809B824 + push {lr} + ldr r0, _0809B838 + ldrb r0, [r0] + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + beq _0809B83C + movs r0, 0 + b _0809B83E + .align 2, 0 +_0809B838: .4byte 0x020375d0 +_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 var_get + ldr r1, _0809B868 + strh r0, [r1] + ldr r1, _0809B86C + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809B868: .4byte 0x020375d0 +_0809B86C: .4byte sub_809B824 + 1 + 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 var_get + 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, _0809B89C + ldr r0, _0809B8A0 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + strh r0, [r1] + movs r0, 0 + bx lr + .align 2, 0 +_0809B89C: .4byte 0x020375f0 +_0809B8A0: .4byte 0x03005d90 + 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 var_get + 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 var_get + 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, _0809B8EC + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809B8EC: .4byte sub_80A3678 + 1 + 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 var_get + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 setmaptile_0 + 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 setmaptile_0 +_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 var_get + 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 var_get + 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 var_get + 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 var_get + 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, _0809BA34 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0809BA34: .4byte sub_809BA0C + 1 + 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 var_get + 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 var_get + 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 var_get + 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 var_get + 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 var_get + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + 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 var_get_pointer + adds r4, r0, 0 + bl sub_8145C30 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + bl sub_8145C80 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809BB48 + ldr r1, _0809BB44 + movs r0, 0 + b _0809BB4C + .align 2, 0 +_0809BB44: .4byte 0x020375f0 +_0809BB48: + ldr r1, _0809BB54 + movs r0, 0x1 +_0809BB4C: + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809BB54: .4byte 0x020375f0 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + bl sub_8145CCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809BB80 + ldr r1, _0809BB7C + movs r0, 0 + b _0809BB84 + .align 2, 0 +_0809BB7C: .4byte 0x020375f0 +_0809BB80: + ldr r1, _0809BB8C + movs r0, 0x1 +_0809BB84: + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809BB8C: .4byte 0x020375f0 + 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 var_get + lsls r0, 24 + lsrs r0, 24 + bl sub_81A89A0 + ldr r1, _0809BBB0 + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809BBB0: .4byte 0x020375ca + 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 sub_809BBC0 +sub_809BBC0: @ 809BBC0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sub_81A8934 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809BBC0 + + 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, _0809BBF8 + strb r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809BBF8: .4byte 0x03005df0 + 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, _0809BC38 + ldr r0, _0809BC3C + 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, _0809BC40 + adds r0, r4, 0 + bl script_setup_asm_script +_0809BC2E: + movs r0, 0x1 +_0809BC30: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809BC38: .4byte 0x02037350 +_0809BC3C: .4byte 0x03005df0 +_0809BC40: .4byte sub_8098734 + 1 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0809BC78 + adds r0, r1 + movs r1, 0x50 + mov r2, sp + bl pokemon_setattr + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_0809BC78: .4byte 0x020244ec + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, _0809BCAC + movs r1, 0x64 + muls r0, r1 + ldr r1, _0809BCB0 + adds r0, r1 + movs r1, 0x50 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809BCAC: .4byte 0x020375f0 +_0809BCB0: .4byte 0x020244ec + 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, _0809BCD8 + 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 + .align 2, 0 +_0809BCD8: .4byte 0x020375c0 + 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 var_get + 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 var_get + 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__sp1AA + 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 var_get + 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, _0809BDB0 + 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 + .align 2, 0 +_0809BDB0: .4byte 0x020244ec + thumb_func_end sub_809BD70 + + thumb_func_start sub_809BDB4 +sub_809BDB4: @ 809BDB4 + push {r4,lr} + ldr r4, _0809BDCC + ldrb r0, [r4] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809BDCC: .4byte 0x03000f30 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0809BE08 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + bl sub_806F07C + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809BE08: .4byte 0x085102d4 + 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 var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0809BE44 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + bl sub_806F0B0 + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809BE44: .4byte 0x085102d4 + thumb_func_end sub_809BE0C + + thumb_func_start sub_809BE48 +sub_809BE48: @ 809BE48 + ldr r1, _0809BE50 + strh r0, [r1] + bx lr + .align 2, 0 +_0809BE50: .4byte 0x020375ca + 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 var_get + 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 var_get + 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 +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, _0809BFD8 + 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 + .align 2, 0 +_0809BFD8: .4byte 0x02037590 +_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 +sub_809C014: @ 809C014 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, _0809C154 + movs r1, 0 + strh r1, [r0] + ldr r0, _0809C158 + strb r1, [r0] + bl player_get_direction__sp1AA + 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 cur_mapdata_block_get_role_at + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_80B3BE8 + 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 cur_mapdata_block_get_role_at + 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 + .align 2, 0 +_0809C154: .4byte 0x020375f2 +_0809C158: .4byte 0x03005df0 +_0809C15C: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0809C170 + bl sub_81AD520 + 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 player_get_pos_to + bl player_get_height + 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 player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_upper4bit_at + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0809C1C6 + bl player_get_height +_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 player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + 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 onpress_a_get_script + adds r4, r0, 0 + cmp r4, 0 + bne _0809C214 + movs r0, 0 + b _0809C24C +_0809C214: + ldr r0, _0809C254 + cmp r4, r0 + beq _0809C244 + ldr r0, _0809C258 + cmp r4, r0 + beq _0809C244 + ldr r0, _0809C25C + cmp r4, r0 + beq _0809C244 + ldr r0, _0809C260 + cmp r4, r0 + beq _0809C244 + ldr r0, _0809C264 + cmp r4, r0 + beq _0809C244 + ldr r0, _0809C268 + cmp r4, r0 + beq _0809C244 + ldr r0, _0809C26C + 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 + .align 2, 0 +_0809C254: .4byte 0x081f860d +_0809C258: .4byte 0x081f9553 +_0809C25C: .4byte 0x0823b4bb +_0809C260: .4byte 0x0823b589 +_0809C264: .4byte 0x082766a2 +_0809C268: .4byte 0x082766a6 +_0809C26C: .4byte 0x08271d92 + thumb_func_end sub_809C1FC + + thumb_func_start onpress_a_get_script +onpress_a_get_script: @ 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 sub_809C384 + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_809C458 + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_809C538 + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_809C7EC + cmp r0, 0 + bne _0809C2BC + movs r0, 0 +_0809C2BC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end onpress_a_get_script + + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x80 + lsls r0, 24 + cmp r0, 0 + bne _0809C2F0 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + b _0809C30E +_0809C2F0: + ldr r1, _0809C334 + 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 npc_id_by_pos_and_height + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x10 + beq _0809C32E + ldr r1, _0809C338 + 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 + .align 2, 0 +_0809C334: .4byte 0x08339d64 +_0809C338: .4byte 0x02037350 +_0809C33C: + movs r4, 0 + ldr r1, _0809C374 +_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, _0809C378 + strb r3, [r0] + ldr r1, _0809C37C + adds r0, r2, r3 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x8] + strh r0, [r1] + ldr r0, _0809C380 + strh r6, [r0] + adds r0, r3, 0 + bl npc_get_script_by_npc_id +_0809C36E: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0809C374: .4byte 0x02032308 +_0809C378: .4byte 0x03005df0 +_0809C37C: .4byte 0x020375f2 +_0809C380: .4byte 0x020375f4 + thumb_func_end sub_809C2C8 + + thumb_func_start sub_809C384 +sub_809C384: @ 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 npc_id_by_pos_and_height + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _0809C3B4 + ldr r1, _0809C404 + 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 is_tile_x80 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C400 + ldr r1, _0809C408 + 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 npc_id_by_pos_and_height + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _0809C400 + ldr r1, _0809C404 + 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 + .align 2, 0 +_0809C404: .4byte 0x02037350 +_0809C408: .4byte 0x08339d64 +_0809C40C: + ldr r0, _0809C430 + strb r4, [r0] + ldr r1, _0809C434 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + strh r0, [r1] + ldr r0, _0809C438 + strh r7, [r0] + bl sub_81D6074 + cmp r0, 0x1 + bne _0809C43C + bl sub_81D62AC + b _0809C442 + .align 2, 0 +_0809C430: .4byte 0x03005df0 +_0809C434: .4byte 0x020375f2 +_0809C438: .4byte 0x020375f4 +_0809C43C: + adds r0, r4, 0 + bl npc_get_script_by_npc_id +_0809C442: + adds r1, r0, 0 + ldr r0, _0809C454 + ldrb r0, [r0] + bl sub_8099188 + adds r1, r0, 0 +_0809C44E: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0809C454: .4byte 0x020375f2 + thumb_func_end sub_809C384 + + thumb_func_start sub_809C458 +sub_809C458: @ 809C458 + push {r4,r5,lr} + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, _0809C488 + 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 sub_809D11C + cmp r0, 0 + beq _0809C4CC + ldr r2, [r0, 0x8] + cmp r2, 0 + bne _0809C490 + ldr r0, _0809C48C + b _0809C532 + .align 2, 0 +_0809C488: .4byte 0x02037318 +_0809C48C: .4byte 0x082c8436 +_0809C490: + ldrb r0, [r0, 0x5] + cmp r0, 0x8 + bhi _0809C530 + lsls r0, 2 + ldr r1, _0809C4A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809C4A0: .4byte _0809C4A4 + .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, _0809C504 + lsrs r0, r2, 16 + movs r3, 0xFA + lsls r3, 1 + adds r0, r3 + strh r0, [r1] + ldr r0, _0809C508 + strh r2, [r0] + ldrh r0, [r1] + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C4CC + ldr r0, _0809C50C + b _0809C532 + .align 2, 0 +_0809C504: .4byte 0x020375e0 +_0809C508: .4byte 0x020375e2 +_0809C50C: .4byte 0x08271cb7 +_0809C510: + cmp r5, 0x2 + bne _0809C4CC + ldr r0, _0809C528 + strh r2, [r0] + bl sub_80E9680 + lsls r0, 24 + cmp r0, 0 + beq _0809C4CC + ldr r0, _0809C52C + b _0809C532 + .align 2, 0 +_0809C528: .4byte 0x020375e0 +_0809C52C: .4byte 0x082759f1 +_0809C530: + adds r0, r2, 0 +_0809C532: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809C458 + + thumb_func_start sub_809C538 +sub_809C538: @ 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 is_tile_x86_and_npcunk2_is_x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C55C + ldr r0, _0809C558 + b _0809C7E4 + .align 2, 0 +_0809C558: .4byte 0x0827ee0b +_0809C55C: + adds r0, r5, 0 + bl IsMetatileComputer + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C574 + ldr r0, _0809C570 + b _0809C7E4 + .align 2, 0 +_0809C570: .4byte 0x08271d92 +_0809C574: + adds r0, r5, 0 + bl is_tile_x8B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C58C + ldr r0, _0809C588 + b _0809C7E4 + .align 2, 0 +_0809C588: .4byte 0x081e615d +_0809C58C: + adds r0, r5, 0 + bl is_tile_xEA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5A4 + ldr r0, _0809C5A0 + b _0809C7E4 + .align 2, 0 +_0809C5A0: .4byte 0x082393f9 +_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, _0809C5C8 + b _0809C7E4 + .align 2, 0 +_0809C5C8: .4byte 0x082a4bac +_0809C5CC: + adds r0, r5, 0 + bl is_tile_x8C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5E4 + ldr r0, _0809C5E0 + b _0809C7E4 + .align 2, 0 +_0809C5E0: .4byte 0x0826a22a +_0809C5E4: + adds r0, r5, 0 + bl is_tile_x85 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5FC + ldr r0, _0809C5F8 + b _0809C7E4 + .align 2, 0 +_0809C5F8: .4byte 0x0827208f +_0809C5FC: + adds r0, r5, 0 + bl sub_8089A1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C614 + ldr r0, _0809C610 + b _0809C7E4 + .align 2, 0 +_0809C610: .4byte 0x08292de5 +_0809C614: + adds r0, r5, 0 + bl sub_8089A30 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C62C + ldr r0, _0809C628 + b _0809C7E4 + .align 2, 0 +_0809C628: .4byte 0x082725ce +_0809C62C: + adds r0, r5, 0 + bl sub_8089A44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C644 + ldr r0, _0809C640 + b _0809C7E4 + .align 2, 0 +_0809C640: .4byte 0x082725d7 +_0809C644: + adds r0, r5, 0 + bl sub_8089A58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C65C + ldr r0, _0809C658 + b _0809C7E4 + .align 2, 0 +_0809C658: .4byte 0x082725e0 +_0809C65C: + adds r0, r5, 0 + bl sub_8089A6C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C674 + ldr r0, _0809C670 + b _0809C7E4 + .align 2, 0 +_0809C670: .4byte 0x082725e9 +_0809C674: + adds r0, r5, 0 + bl sub_8089A80 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C68C + ldr r0, _0809C688 + b _0809C7E4 + .align 2, 0 +_0809C688: .4byte 0x082725f2 +_0809C68C: + adds r0, r5, 0 + bl sub_8089A94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6A4 + ldr r0, _0809C6A0 + b _0809C7E4 + .align 2, 0 +_0809C6A0: .4byte 0x082725fb +_0809C6A4: + adds r0, r5, 0 + bl sub_8089AA8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6BC + ldr r0, _0809C6B8 + b _0809C7E4 + .align 2, 0 +_0809C6B8: .4byte 0x08272604 +_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, _0809C6D0 + b _0809C7E4 + .align 2, 0 +_0809C6D0: .4byte 0x08277b8a +_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, _0809C6E8 + b _0809C7E4 + .align 2, 0 +_0809C6E8: .4byte 0x08277365 +_0809C6EC: + adds r0, r5, 0 + bl is_tile_x8F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C704 + ldr r0, _0809C700 + b _0809C7E4 + .align 2, 0 +_0809C700: .4byte 0x0827381b +_0809C704: + adds r0, r5, 0 + bl sub_8089B44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C71C + ldr r0, _0809C718 + b _0809C7E4 + .align 2, 0 +_0809C718: .4byte 0x082c8393 +_0809C71C: + movs r4, 0x4 + ldrsb r4, [r6, r4] + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl cur_mapdata_get_upper4bit_at + 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, _0809C748 + b _0809C7E4 + .align 2, 0 +_0809C748: .4byte 0x0823b4bb +_0809C74C: + adds r0, r5, 0 + bl sub_808929C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C764 + ldr r0, _0809C760 + b _0809C7E4 + .align 2, 0 +_0809C760: .4byte 0x0823b589 +_0809C764: + adds r0, r5, 0 + bl sub_80893DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C77C + ldr r0, _0809C778 + b _0809C7E4 + .align 2, 0 +_0809C778: .4byte 0x0823b684 +_0809C77C: + adds r0, r5, 0 + bl sub_80893F0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C794 + ldr r0, _0809C790 + b _0809C7E4 + .align 2, 0 +_0809C790: .4byte 0x0823b68c +_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 sub_809C538 + + thumb_func_start sub_809C7EC +sub_809C7EC: @ 809C7EC + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, _0809C81C + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + bl party_has_pokemon_with_surf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + bl sub_808BE74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + ldr r0, _0809C820 + b _0809C862 + .align 2, 0 +_0809C81C: .4byte 0x0000086b +_0809C820: .4byte 0x08271ea0 +_0809C824: + adds r0, r4, 0 + bl is_tile_x13_waterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C860 + ldr r0, _0809C850 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C858 + bl sub_808BE50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C858 + ldr r0, _0809C854 + b _0809C862 + .align 2, 0 +_0809C850: .4byte 0x0000086e +_0809C854: .4byte 0x08290a49 +_0809C858: + ldr r0, _0809C85C + b _0809C862 + .align 2, 0 +_0809C85C: .4byte 0x08290a83 +_0809C860: + movs r0, 0 +_0809C862: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809C7EC + + thumb_func_start sub_809C868 +sub_809C868: @ 809C868 + push {lr} + ldr r0, _0809C88C + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0809C894 + bl sub_809D1E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0809C894 + ldr r0, _0809C890 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C896 + .align 2, 0 +_0809C88C: .4byte 0x0000086d +_0809C890: .4byte 0x08290b0f +_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, _0809C8C8 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0809C8D4 + ldr r0, _0809C8CC + 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, _0809C8D0 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C8D6 + .align 2, 0 +_0809C8C8: .4byte 0x0000086d +_0809C8CC: .4byte 0x02037318 +_0809C8D0: .4byte 0x08290b5a +_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, _0809C960 + 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 + .align 2, 0 +_0809C960: .4byte 0x02037318 +_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, _0809C984 + b _0809C996 + .align 2, 0 +_0809C984: .4byte 0x082a8337 +_0809C988: + adds r0, r4, 0 + bl sub_8089ABC + lsls r0, 24 + cmp r0, 0 + beq _0809C9A4 + ldr r0, _0809C9A0 +_0809C996: + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C9EA + .align 2, 0 +_0809C9A0: .4byte 0x08252be8 +_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 player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + 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 in_trade_center + cmp r0, 0x1 + bne _0809CA04 + b _0809CB24 +_0809CA04: + bl sub_80B215C + bl happiness_algorithm_step + bl sub_81D4998 + ldr r0, _0809CA40 + 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, _0809CA44 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CA40: .4byte 0x02037590 +_0809CA44: .4byte 0x082736bc +_0809CA48: + bl sub_8070BD0 + lsls r0, 24 + cmp r0, 0 + beq _0809CA64 + movs r0, 0xD + bl sav12_xor_increment + ldr r0, _0809CA60 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CA60: .4byte 0x08291fc0 +_0809CA64: + bl sub_813B3B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA7C + ldr r0, _0809CA78 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CA78: .4byte 0x08273d1f +_0809CA7C: + bl sub_8179A04 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA94 + ldr r0, _0809CA90 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CA90: .4byte 0x08238eaf +_0809CA94: + bl is_tile_that_overrides_player_control + cmp r0, 0x1 + bne _0809CAA8 + ldr r0, _0809CAA4 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CAA4: .4byte 0x081df7ba +_0809CAA8: + bl sub_8138120 + cmp r0, 0x1 + bne _0809CABC + ldr r0, _0809CAB8 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CAB8: .4byte 0x081f49ec +_0809CABC: + bl sub_8138168 + cmp r0, 0x1 + bne _0809CAD0 + ldr r0, _0809CACC + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CACC: .4byte 0x081fa4d6 +_0809CAD0: + bl sub_81381B0 + cmp r0, 0x1 + bne _0809CAE4 + ldr r0, _0809CAE0 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CAE0: .4byte 0x0821307b +_0809CAE4: + bl sub_81381F8 + cmp r0, 0x1 + bne _0809CAF8 + ldr r0, _0809CAF4 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CAF4: .4byte 0x08224175 +_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, _0809CB18 + bl script_env_1_execute_new_script + b _0809CB28 + .align 2, 0 +_0809CB18: .4byte 0x0823c050 +_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, _0809CB40 + movs r1, 0 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_0809CB40: .4byte 0x0000402a + thumb_func_end sub_809CB30 + + thumb_func_start happiness_algorithm_step +happiness_algorithm_step: @ 809CB44 + push {r4,r5,lr} + ldr r0, _0809CB78 + bl var_get_pointer + 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, _0809CB7C + 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 + .align 2, 0 +_0809CB78: .4byte 0x0000402a +_0809CB7C: .4byte 0x020244ec + thumb_func_end happiness_algorithm_step + + thumb_func_start overworld_poison_timer_set +overworld_poison_timer_set: @ 809CB80 + push {lr} + ldr r0, _0809CB90 + movs r1, 0 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_0809CB90: .4byte 0x0000402b + thumb_func_end overworld_poison_timer_set + + thumb_func_start overworld_poison_step +overworld_poison_step: @ 809CB94 + push {lr} + ldr r0, _0809CBCC + ldrb r0, [r0, 0x17] + cmp r0, 0x9 + beq _0809CBD4 + ldr r0, _0809CBD0 + bl var_get_pointer + 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 + .align 2, 0 +_0809CBCC: .4byte 0x02037318 +_0809CBD0: .4byte 0x0000402b +_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, _0809CBE4 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_0809CBE4: .4byte 0x020375d4 + 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, _0809CC04 + ldrb r0, [r6] + cmp r0, 0x3 + bhi _0809CC0C + adds r0, 0x1 + strb r0, [r6] + ldr r0, _0809CC08 + strh r4, [r0] + movs r0, 0 + b _0809CC30 + .align 2, 0 +_0809CC04: .4byte 0x020375d4 +_0809CC08: .4byte 0x020375d6 +_0809CC0C: + ldr r5, _0809CC24 + 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 + .align 2, 0 +_0809CC24: .4byte 0x020375d6 +_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, _0809CC8C + 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 + .align 2, 0 +_0809CC8C: .4byte 0x02037318 +_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, _0809CCF4 + 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 is_tile_TODO + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CCF8 + adds r0, r4, 0 + bl sub_80AF80C + movs r0, 0x1 + b _0809CD8C + .align 2, 0 +_0809CCF4: .4byte 0x02037318 +_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 sub_8089898 + 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, _0809CD68 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809CD8C + .align 2, 0 +_0809CD68: .4byte 0x082a8350 +_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 is_tile_x61_warp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl is_tile_TODO + 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 sub_8089898 + 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 sub_8088FD4 + b _0809CE7E +_0809CE62: + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x65_warp_arrow_down + b _0809CE7E +_0809CE6C: + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x63_warp_arrow_left + b _0809CE7E +_0809CE76: + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x62_warp_arrow_right +_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 sub_81D609C + 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, _0809CEE4 + ldr r0, [r0, 0x4] + ldr r5, [r0, 0x8] + b _0809CF0E + .align 2, 0 +_0809CEE4: .4byte 0x02037318 +_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, _0809CF1C + 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 + .align 2, 0 +_0809CF1C: .4byte 0x02037318 +_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, _0809CF74 + 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 + .align 2, 0 +_0809CF74: .4byte 0x03005d8c + 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, _0809CFAC + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl sub_80E9668 + movs r0, 0x1 + b _0809CFFE + .align 2, 0 +_0809CFAC: .4byte 0x02037318 +_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, _0809CFF8 + 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 + .align 2, 0 +_0809CFF8: .4byte 0x02037318 +_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_alternative__deprecated + b _0809D082 +_0809D062: + ldrh r0, [r4, 0x6] + cmp r0, 0 + beq _0809D07C + ldrh r0, [r4, 0x6] + bl var_get + 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, _0809D118 + 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 + .align 2, 0 +_0809D118: .4byte 0x02037318 + thumb_func_end sub_809D0F4 + + thumb_func_start sub_809D11C +sub_809D11C: @ 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 sub_809D11C + + 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, _0809D1A0 + 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 + .align 2, 0 +_0809D1A0: .4byte 0x02037318 +_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 player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0809D240 + 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 + .align 2, 0 +_0809D240: .4byte 0x02037318 +_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 sub_809D280 +sub_809D280: @ 809D280 + push {r4,r5,lr} + sub sp, 0x8 + bl player_get_direction_upper_4bits + 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 cur_mapdata_block_get_role_at + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + adds r2, r4, 0 + bl sub_809C384 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809D280 + + thumb_func_start sub_809D2BC +sub_809D2BC: @ 809D2BC + push {r4,lr} + sub sp, 0x8 + bl player_get_direction_upper_4bits + 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 cur_mapdata_block_get_role_at + ldr r4, _0809D2FC + 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 + .align 2, 0 +_0809D2FC: .4byte 0x02037318 + thumb_func_end sub_809D2BC + + thumb_func_start sub_809D300 +sub_809D300: @ 809D300 + push {r4,lr} + ldr r4, _0809D334 + ldr r0, [r4] + ldr r1, _0809D338 + adds r0, r1 + movs r2, 0x96 + lsls r2, 1 + movs r1, 0 + bl memset + ldr r0, [r4] + ldr r1, _0809D33C + adds r0, r1 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl memset + ldr r0, _0809D340 + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809D334: .4byte 0x03005d8c +_0809D338: .4byte 0x00001270 +_0809D33C: .4byte 0x0000139c +_0809D340: .4byte 0x020375fc + thumb_func_end sub_809D300 + + thumb_func_start sub_809D344 +sub_809D344: @ 809D344 + push {lr} + ldr r0, _0809D384 + ldr r0, [r0] + ldr r1, _0809D388 + adds r2, r0, r1 + movs r1, 0 + str r1, [r2] + ldr r1, _0809D38C + adds r0, r1 + movs r1, 0 + movs r2, 0x20 + bl memset + ldr r0, _0809D390 + bl flag_clear + ldr r0, _0809D394 + bl flag_clear + ldr r0, _0809D398 + bl flag_clear + ldr r0, _0809D39C + bl flag_clear + movs r0, 0x88 + lsls r0, 4 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0809D384: .4byte 0x03005d8c +_0809D388: .4byte 0x00001270 +_0809D38C: .4byte 0x0000139c +_0809D390: .4byte 0x000008ad +_0809D394: .4byte 0x000008ae +_0809D398: .4byte 0x00000889 +_0809D39C: .4byte 0x000008c1 + thumb_func_end sub_809D344 + + thumb_func_start sub_809D3A0 +sub_809D3A0: @ 809D3A0 + push {lr} + ldr r0, _0809D3B8 + ldr r0, [r0] + ldr r1, _0809D3BC + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_0809D3B8: .4byte 0x03005d8c +_0809D3BC: .4byte 0x00001394 + thumb_func_end sub_809D3A0 + + thumb_func_start sub_809D3C0 +sub_809D3C0: @ 809D3C0 + push {lr} + ldr r0, _0809D3DC + bl var_get_pointer + ldr r1, _0809D3E0 + ldr r2, [r1] + movs r1, 0 + strb r1, [r2, 0x1A] + strh r1, [r0] + ldr r0, _0809D3E4 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0809D3DC: .4byte 0x00004046 +_0809D3E0: .4byte 0x03005d90 +_0809D3E4: .4byte 0x00000896 + thumb_func_end sub_809D3C0 + + thumb_func_start sub_809D3E8 +sub_809D3E8: @ 809D3E8 + push {r4,r5,lr} + ldr r0, _0809D41C + bl var_get_pointer + ldr r4, _0809D420 + ldr r2, [r4] + movs r5, 0 + movs r1, 0xDA + strb r1, [r2, 0x1A] + ldr r2, _0809D424 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _0809D428 + bl flag_set + 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 + .align 2, 0 +_0809D41C: .4byte 0x00004046 +_0809D420: .4byte 0x03005d90 +_0809D424: .4byte 0x00000302 +_0809D428: .4byte 0x00000896 + thumb_func_end sub_809D3E8 + + thumb_func_start sub_809D42C +sub_809D42C: @ 809D42C + push {lr} + ldr r0, _0809D458 + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + cmp r0, 0xDA + bne _0809D468 + ldr r0, _0809D45C + bl var_get + lsls r0, 16 + ldr r1, _0809D460 + cmp r0, r1 + bne _0809D468 + ldr r0, _0809D464 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0809D468 + movs r0, 0x1 + b _0809D46A + .align 2, 0 +_0809D458: .4byte 0x03005d90 +_0809D45C: .4byte 0x00004046 +_0809D460: .4byte 0x03020000 +_0809D464: .4byte 0x00000896 +_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, _0809D47C + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0809D47C: .4byte 0x000008ac + thumb_func_end sub_809D470 + + thumb_func_start sub_809D480 +sub_809D480: @ 809D480 + push {lr} + ldr r0, _0809D48C + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_0809D48C: .4byte 0x000008ac + thumb_func_end sub_809D480 + + thumb_func_start sub_809D490 +sub_809D490: @ 809D490 + push {lr} + ldr r0, _0809D4A0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0809D4A0: .4byte 0x000008ac + thumb_func_end sub_809D490 + + thumb_func_start sub_809D4A4 +sub_809D4A4: @ 809D4A4 + push {lr} + ldr r0, _0809D4B0 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0809D4B0: .4byte 0x000008db + thumb_func_end sub_809D4A4 + + thumb_func_start sub_809D4B4 +sub_809D4B4: @ 809D4B4 + push {lr} + ldr r0, _0809D4C0 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_0809D4C0: .4byte 0x000008db + thumb_func_end sub_809D4B4 + + thumb_func_start sub_809D4C4 +sub_809D4C4: @ 809D4C4 + push {lr} + ldr r0, _0809D4D4 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0809D4D4: .4byte 0x000008db + thumb_func_end sub_809D4C4 + + thumb_func_start sub_809D4D8 +sub_809D4D8: @ 809D4D8 + push {lr} + movs r0, 0xF2 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D550 + bl flag_clear + movs r0, 0xF3 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D554 + bl flag_clear + movs r0, 0xF4 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D558 + bl flag_clear + movs r0, 0xF5 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D55C + bl flag_clear + movs r0, 0xF6 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D560 + bl flag_clear + movs r0, 0xF7 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D564 + bl flag_clear + movs r0, 0xF8 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D568 + bl flag_clear + movs r0, 0xF9 + lsls r0, 1 + bl flag_clear + ldr r0, _0809D56C + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0809D550: .4byte 0x000001e5 +_0809D554: .4byte 0x000001e7 +_0809D558: .4byte 0x000001e9 +_0809D55C: .4byte 0x000001eb +_0809D560: .4byte 0x000001ed +_0809D564: .4byte 0x000001ef +_0809D568: .4byte 0x000001f1 +_0809D56C: .4byte 0x000001f3 + thumb_func_end sub_809D4D8 + + thumb_func_start sub_809D570 +sub_809D570: @ 809D570 + push {lr} + ldr r0, _0809D5B8 + movs r1, 0 + bl var_set + ldr r0, _0809D5BC + movs r1, 0 + bl var_set + ldr r0, _0809D5C0 + movs r1, 0 + bl var_set + ldr r0, _0809D5C4 + movs r1, 0 + bl var_set + ldr r0, _0809D5C8 + movs r1, 0 + bl var_set + ldr r0, _0809D5CC + movs r1, 0 + bl var_set + ldr r0, _0809D5D0 + movs r1, 0 + bl var_set + ldr r0, _0809D5D4 + movs r1, 0 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_0809D5B8: .4byte 0x000040dd +_0809D5BC: .4byte 0x000040de +_0809D5C0: .4byte 0x000040df +_0809D5C4: .4byte 0x000040e0 +_0809D5C8: .4byte 0x000040e1 +_0809D5CC: .4byte 0x000040e2 +_0809D5D0: .4byte 0x000040e3 +_0809D5D4: .4byte 0x000040e4 + thumb_func_end sub_809D570 + + thumb_func_start sub_809D5D8 +sub_809D5D8: @ 809D5D8 + push {lr} + ldr r0, _0809D5EC + movs r1, 0 + bl var_set + ldr r0, _0809D5F0 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_0809D5EC: .4byte 0x0000402c +_0809D5F0: .4byte 0x000008c2 + thumb_func_end sub_809D5D8 + + thumb_func_start sub_809D5F4 +sub_809D5F4: @ 809D5F4 + push {lr} + ldr r0, _0809D60C + movs r1, 0x92 + lsls r1, 4 + bl var_set + ldr r0, _0809D610 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_0809D60C: .4byte 0x0000402c +_0809D610: .4byte 0x000008c2 + thumb_func_end sub_809D5F4 + + thumb_func_start sub_809D614 +sub_809D614: @ 809D614 + push {lr} + ldr r0, _0809D638 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0809D640 + ldr r0, _0809D63C + bl var_get + lsls r0, 16 + movs r1, 0x92 + lsls r1, 20 + cmp r0, r1 + bne _0809D640 + movs r0, 0x1 + b _0809D642 + .align 2, 0 +_0809D638: .4byte 0x000008c2 +_0809D63C: .4byte 0x0000402c +_0809D640: + movs r0, 0 +_0809D642: + pop {r1} + bx r1 + thumb_func_end sub_809D614 + + thumb_func_start var_get_pointer +var_get_pointer: @ 809D648 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, _0809D65C + cmp r1, r0 + bhi _0809D660 + movs r0, 0 + b _0809D688 + .align 2, 0 +_0809D65C: .4byte 0x00003fff +_0809D660: + lsls r0, r1, 16 + cmp r0, 0 + bge _0809D67C + ldr r0, _0809D674 + ldr r2, _0809D678 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + b _0809D688 + .align 2, 0 +_0809D674: .4byte 0x081dba0c +_0809D678: .4byte 0xffff8000 +_0809D67C: + ldr r0, _0809D68C + lsls r1, r2, 1 + ldr r2, _0809D690 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 +_0809D688: + pop {r1} + bx r1 + .align 2, 0 +_0809D68C: .4byte 0x03005d8c +_0809D690: .4byte 0xffff939c + thumb_func_end var_get_pointer + + thumb_func_start var_get +var_get: @ 809D694 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl var_get_pointer + 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 var_get + + thumb_func_start var_set +var_set: @ 809D6B0 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + bl var_get_pointer + 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 var_set + + thumb_func_start var_load_x4010_plus_r0 +var_load_x4010_plus_r0: @ 809D6D0 + push {lr} + lsls r0, 24 + lsrs r0, 8 + ldr r1, _0809D6E8 + adds r0, r1 + lsrs r0, 16 + bl var_get + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0809D6E8: .4byte 0x40100000 + thumb_func_end var_load_x4010_plus_r0 + + thumb_func_start flag_get_pointer +flag_get_pointer: @ 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, _0809D710 + cmp r2, r0 + bhi _0809D71C + ldr r0, _0809D714 + lsrs r1, 19 + ldr r2, _0809D718 + adds r1, r2 + ldr r0, [r0] + b _0809D72C + .align 2, 0 +_0809D710: .4byte 0x00003fff +_0809D714: .4byte 0x03005d8c +_0809D718: .4byte 0x00001270 +_0809D71C: + ldr r1, _0809D734 + adds r0, r3, r1 + cmp r0, 0 + bge _0809D728 + ldr r2, _0809D738 + adds r0, r3, r2 +_0809D728: + asrs r0, 3 + ldr r1, _0809D73C +_0809D72C: + adds r0, r1 +_0809D72E: + pop {r1} + bx r1 + .align 2, 0 +_0809D734: .4byte 0xffffc000 +_0809D738: .4byte 0xffffc007 +_0809D73C: .4byte 0x020375fc + thumb_func_end flag_get_pointer + + thumb_func_start flag_set +flag_set: @ 809D740 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl flag_get_pointer + 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 flag_set + + thumb_func_start flag_clear +flag_clear: @ 809D768 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl flag_get_pointer + 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 flag_clear + + thumb_func_start flag_check +flag_check: @ 809D790 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl flag_get_pointer + 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 flag_check + + 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_alternative__deprecated +trigger_activate_alternative__deprecated: @ 809D858 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + ldr r3, _0809D878 +_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 + .align 2, 0 +_0809D878: .4byte 0x085102e0 +_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_alternative__deprecated + + thumb_func_start task_per_step_callback_manager +task_per_step_callback_manager: @ 809D88C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0809D8B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, _0809D8B4 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0809D8B0: .4byte 0x03005e00 +_0809D8B4: .4byte 0x08510348 + 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, _0809D8E4 + 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 + .align 2, 0 +_0809D8E4: .4byte 0x030022c0 +_0809D8E8: + ldr r0, _0809D904 + 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 + .align 2, 0 +_0809D904: .4byte 0x030022c0 + 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, _0809D938 + 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 + .align 2, 0 +_0809D938: .4byte 0x03005e08 + 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, _0809D998 + 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, _0809D99C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] +_0809D966: + ldr r4, _0809D9A0 + 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, _0809D9A4 + 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 + .align 2, 0 +_0809D998: .4byte task_per_step_callback_manager + 1 +_0809D99C: .4byte 0x03005e00 +_0809D9A0: .4byte sub_809E638 + 1 +_0809D9A4: .4byte sub_809D908 + 1 + 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, _0809D9E0 + 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, _0809D9E4 + 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 + .align 2, 0 +_0809D9E0: .4byte task_per_step_callback_manager + 1 +_0809D9E4: .4byte 0x03005e08 +_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, _0809DA20 + bl get_task_id_by_function + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0809DA24 + 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, _0809DA28 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] +_0809DA1A: + pop {r0} + bx r0 + .align 2, 0 +_0809DA20: .4byte task_per_step_callback_manager + 1 +_0809DA24: .4byte sub_809D908 + 1 +_0809DA28: .4byte 0x03005e08 + 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 cur_mapdata_block_get_role_at + 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 setmaptile_0 + 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 cur_mapdata_draw_block_at +_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 setmaptile_0 + 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 cur_mapdata_draw_block_at +_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, _0809DB30 + 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 + .align 2, 0 +_0809DB30: .4byte 0x08510368 + 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, _0809DB54 + 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 + .align 2, 0 +_0809DB54: .4byte 0x08510388 + 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, _0809DB78 + 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 + .align 2, 0 +_0809DB78: .4byte 0x085103a8 + 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 cur_mapdata_block_get_role_at + 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 cur_mapdata_block_get_role_at + 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, _0809DCE8 + adds r4, r1, r0 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl player_get_pos_to + 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 + .align 2, 0 +_0809DCE8: .4byte 0x03005e08 +_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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x17 + 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 player_get_height + 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 cur_mapdata_get_blockid_at + adds r1, r0, 0 + ldr r0, _0809DE64 + cmp r1, r0 + beq _0809DE68 + adds r0, 0x8 + cmp r1, r0 + beq _0809DE78 + b _0809DE82 + .align 2, 0 +_0809DE64: .4byte 0x0000024e +_0809DE68: + ldr r2, _0809DE74 + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 + b _0809DE82 + .align 2, 0 +_0809DE74: .4byte 0x0000024f +_0809DE78: + ldr r2, _0809DE88 + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 +_0809DE82: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809DE88: .4byte 0x00000257 + 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 player_get_height + 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 cur_mapdata_get_blockid_at + adds r1, r0, 0 + ldr r0, _0809DEC8 + cmp r1, r0 + beq _0809DECC + adds r0, 0x8 + cmp r1, r0 + beq _0809DEDC + b _0809DEE6 + .align 2, 0 +_0809DEC8: .4byte 0x0000024f +_0809DECC: + ldr r2, _0809DED8 + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 + b _0809DEE6 + .align 2, 0 +_0809DED8: .4byte 0x0000024e +_0809DEDC: + ldr r2, _0809DEEC + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 +_0809DEE6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809DEEC: .4byte 0x00000256 + 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, _0809DF2C + adds r6, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + 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 + .align 2, 0 +_0809DF2C: .4byte 0x03005e08 +_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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089750 + 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 cur_mapdata_draw_block_at + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089750 + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089750 + lsls r0, 24 + lsrs r7, r0, 24 + bl player_get_height + 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 cur_mapdata_draw_block_at + 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 cur_mapdata_draw_block_at +_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, _0809E090 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809E090: .4byte _0809E094 + .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 cur_mapdata_draw_block_at + 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 cur_mapdata_draw_block_at + 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, _0809E138 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xA + bhi _0809E144 + lsls r0, r1, 16 + asrs r1, r0, 16 + ldr r2, _0809E13C + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xD + bhi _0809E144 + ldr r0, _0809E140 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0809E144 + movs r0, 0x1 + b _0809E146 + .align 2, 0 +_0809E138: .4byte 0xfffd0000 +_0809E13C: .4byte 0xfffa0000 +_0809E140: .4byte 0x085103c8 +_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, _0809E180 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + bl var_get_pointer + 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 + .align 2, 0 +_0809E180: .4byte 0x085103c8 + 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, _0809E1BC + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + bl var_get + 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 + .align 2, 0 +_0809E1BC: .4byte 0x085103c8 +_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, _0809E21C + 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, _0809E220 + bl setmaptile_0 +_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 + .align 2, 0 +_0809E21C: .4byte 0x02037318 +_0809E220: .4byte 0x0000020e + 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, _0809E248 + 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 + .align 2, 0 +_0809E248: .4byte 0x03005e08 +_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 player_get_pos_to + 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 player_get_pos_to + 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 cur_mapdata_block_get_role_at + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0809E2DC + bl var_get_pointer + 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 + .align 2, 0 +_0809E2DC: .4byte 0x00004022 +_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, _0809E35C + bl setmaptile_0 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + 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 + .align 2, 0 +_0809E35C: .4byte 0x0000020e +_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, _0809E3B0 + bl setmaptile_0 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at +_0809E3A2: + movs r0, 0x1 + strh r0, [r5, 0x2] +_0809E3A6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809E3B0: .4byte 0x00000206 + 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, _0809E438 + adds r5, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089484 + 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 cur_mapdata_get_blockid_at + ldr r1, _0809E43C + cmp r0, r1 + bne _0809E444 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, _0809E440 + movs r3, 0x4 + bl ash + b _0809E456 + .align 2, 0 +_0809E438: .4byte 0x03005e08 +_0809E43C: .4byte 0x0000020a +_0809E440: .4byte 0x00000212 +_0809E444: + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, _0809E484 + 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, _0809E488 + bl var_get_pointer + adds r2, r0, 0 + ldrh r1, [r2] + ldr r0, _0809E48C + cmp r1, r0 + bhi _0809E47A + adds r0, r1, 0x1 + strh r0, [r2] +_0809E47A: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809E484: .4byte 0x00000206 +_0809E488: .4byte 0x00004048 +_0809E48C: .4byte 0x0000270e + 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 cur_mapdata_get_blockid_at + ldr r1, _0809E4C4 + ldr r2, _0809E4C8 + cmp r0, r1 + bne _0809E4AC + subs r2, 0x31 +_0809E4AC: + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_draw_block_at + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809E4C4: .4byte 0x0000022f +_0809E4C8: .4byte 0x00000237 + 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, _0809E5B4 + adds r5, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + 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, _0809E5B8 + movs r1, 0 + bl var_set +_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, _0809E5B8 + movs r1, 0 + bl var_set +_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 + .align 2, 0 +_0809E5B4: .4byte 0x03005e08 +_0809E5B8: .4byte 0x00004022 +_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, _0809E634 + 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 setmaptile_0 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_draw_block_at + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0xE8 + bl setmaptile_0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809E634: .4byte 0x085103fc + 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, _0809E680 + adds r4, r1, r0 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl player_get_pos_to + ldr r0, _0809E684 + 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 + .align 2, 0 +_0809E680: .4byte 0x03005e08 +_0809E684: .4byte 0x03005d8c +_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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089940 + 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, _0809E724 + 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 + .align 2, 0 +_0809E724: .4byte 0x02037334 +_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, _0809E7A0 + bl flag_set + bl sub_802F588 + ldr r0, _0809E7A4 + ldr r2, [r0] + adds r2, 0xA0 + ldr r3, _0809E7A8 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, _0809E7AC + ldrh r1, [r3] + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_0809E7A0: .4byte 0x00000895 +_0809E7A4: .4byte 0x03005d90 +_0809E7A8: .4byte 0x03005cf8 +_0809E7AC: .4byte 0x00004040 + thumb_func_end sub_809E778 + + thumb_func_start sub_809E7B0 +sub_809E7B0: @ 809E7B0 + push {r4,lr} + ldr r0, _0809E7E0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0809E7DA + bl sub_813B9C0 + lsls r0, 24 + cmp r0, 0 + bne _0809E7DA + bl sub_802F588 + ldr r4, _0809E7E4 + adds r0, r4, 0 + bl sub_809E7E8 + adds r0, r4, 0 + bl sub_809E858 +_0809E7DA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809E7E0: .4byte 0x00000895 +_0809E7E4: .4byte 0x03005cf8 + thumb_func_end sub_809E7B0 + + thumb_func_start sub_809E7E8 +sub_809E7E8: @ 809E7E8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _0809E854 + bl var_get_pointer + 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 + .align 2, 0 +_0809E854: .4byte 0x00004040 + 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, _0809E8B0 + ldr r1, [r6] + adds r1, 0xA0 + mov r0, sp + adds r2, r5, 0 + bl sub_802F5FC + 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 sub_80E1870 + 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 + .align 2, 0 +_0809E8B0: .4byte 0x03005d90 + thumb_func_end sub_809E858 + + thumb_func_start sub_809E8B4 +sub_809E8B4: @ 809E8B4 + push {lr} + bl sub_809E778 + ldr r0, _0809E8C4 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0809E8C4: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_809E8B4 + + thumb_func_start sub_809E8C8 +sub_809E8C8: @ 809E8C8 + push {lr} + ldr r0, _0809E8DC + bl set_callback2 + ldr r1, _0809E8E0 + ldr r0, _0809E8E4 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_0809E8DC: .4byte sub_81349F4 + 1 +_0809E8E0: .4byte 0x030022c0 +_0809E8E4: .4byte sub_809E8B4 + 1 + thumb_func_end sub_809E8C8 + + thumb_func_start sub_809E8E8 +sub_809E8E8: @ 809E8E8 + push {lr} + adds r3, r0, 0 + ldr r2, _0809E918 + 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, _0809E91C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809E918: .4byte 0x03005e00 +_0809E91C: .4byte _0809E920 + .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 obj_delete_and_free_tiles +_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, _0809EA34 + 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, _0809EA38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809EA34: .4byte 0x03005e00 +_0809EA38: .4byte _0809EA3C + .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 obj_delete_and_free_tiles +_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, _0809EB74 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _0809EB78 + mov r8, r0 + movs r1, 0x35 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + ldr r6, _0809EB7C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r6, 0 + adds r4, 0x1C + adds r2, r0, r4 + ldr r1, _0809EB80 + str r1, [r2] + adds r0, r6 + strh r5, [r0, 0x2E] + ldr r1, _0809EB84 + strh r1, [r0, 0x30] + mov r0, r8 + movs r1, 0x35 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r4 + ldr r1, _0809EB88 + 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 + .align 2, 0 +_0809EB74: .4byte 0x085104c4 +_0809EB78: .4byte 0x085104f0 +_0809EB7C: .4byte 0x02020630 +_0809EB80: .4byte sub_809E8E8 + 1 +_0809EB84: .4byte 0x0000ffff +_0809EB88: .4byte sub_809EA04 + 1 + thumb_func_end sub_809EB04 + + thumb_func_start sub_809EB8C +sub_809EB8C: @ 809EB8C + push {lr} + ldr r0, _0809EB9C + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + pop {r0} + bx r0 + .align 2, 0 +_0809EB9C: .4byte 0x085104c4 + 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 Window_Remove + 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, _0809ECA4 + ldr r4, _0809ECA8 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcpy + adds r7, r0, 0 + ldr r1, _0809ECAC + bl gf_strcpy + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcpy + adds r7, r0, 0 + ldr r5, _0809ECB0 + adds r1, r5, 0 + bl gf_strcpy + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcpy + adds r7, r0, 0 + adds r1, r5, 0 + bl gf_strcpy + adds r7, r0, 0 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcpy + ldr r2, _0809ECA4 + 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 + .align 2, 0 +_0809ECA4: .4byte 0x02021fc4 +_0809ECA8: .4byte 0x02021cc4 +_0809ECAC: .4byte 0x085ee68a +_0809ECB0: .4byte 0x085ee68e + 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, _0809ED34 + 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 + .align 2, 0 +_0809ED34: .4byte 0x085ee690 + 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, _0809EDB4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + bx lr + .align 2, 0 +_0809EDB4: .4byte 0x03005e00 + 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, _0809EDE0 + adds r0, r4, r5 + ldrb r0, [r0, 0x10] + bl sub_809EBA0 + bl sub_809EB8C + subs r5, 0x8 + adds r4, r5 + ldr r0, _0809EDE4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809EDE0: .4byte 0x03005e08 +_0809EDE4: .4byte sub_809EDA0 + 1 + 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, _0809EE2C + mov r8, r0 + adds r5, r7, r0 + ldrb r4, [r5, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + ldr r1, _0809EE30 + adds r2, r0, r1 + ldr r1, _0809EE34 + 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, _0809EE38 + str r1, [r0] + movs r0, 0 + strh r0, [r5, 0x2] + movs r0, 0x6 + b _0809EE5C + .align 2, 0 +_0809EE2C: .4byte 0x03005e08 +_0809EE30: .4byte 0x0851041c +_0809EE34: .4byte 0x030022c0 +_0809EE38: .4byte sub_809EDB8 + 1 +_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, _0809EEA8 + 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, _0809EEAC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _0809EEB0 + str r1, [r0] + strh r4, [r5, 0x2] + movs r0, 0x6 + strh r0, [r5, 0x4] + b _0809EEF4 + .align 2, 0 +_0809EEA8: .4byte 0x03005cf8 +_0809EEAC: .4byte 0x03005e00 +_0809EEB0: .4byte sub_809EDB8 + 1 +_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 Window_CopyToVram +_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, _0809EF78 + mov r9, r0 + adds r5, r6, r0 + movs r0, 0 + strh r0, [r5] + ldr r1, _0809EF7C + 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, _0809EF80 + bl Window_AddFromTemplate + 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, _0809EF84 + str r0, [r6] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0809EF78: .4byte 0x03005e08 +_0809EF7C: .4byte 0x03005cf8 +_0809EF80: .4byte 0x08510420 +_0809EF84: .4byte sub_809EDE8 + 1 + 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 lcd_io_set + movs r0, 0 + bl SetVBlankCallback + movs r2, 0xA0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _0809F030 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, _0809F034 + 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, _0809F038 + 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 reset_super_sprites + bl copy_super_sprites_to_oam + bl remove_some_task + bl dp12_8087EA4 + bl reset_all_obj_data + bl clear_tasks + bl sub_80A1A74 + bl sub_809F048 + ldr r0, _0809F03C + bl SetVBlankCallback + ldr r0, _0809F040 + bl set_callback2 + ldr r0, _0809F044 + movs r1, 0x50 + bl AddTask + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809F030: .4byte 0x040000d4 +_0809F034: .4byte 0x81000200 +_0809F038: .4byte 0x81000800 +_0809F03C: .4byte sub_809F0AC + 1 +_0809F040: .4byte sub_809F090 + 1 +_0809F044: .4byte sub_809F200 + 1 + 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 gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0809F088 + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + ldr r0, _0809F08C + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + bl sub_81973A4 + pop {r0} + bx r0 + .align 2, 0 +_0809F088: .4byte 0x08510404 +_0809F08C: .4byte 0x08510408 + thumb_func_end sub_809F048 + + thumb_func_start sub_809F090 +sub_809F090: @ 809F090 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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 copy_queue_process + bl copy_super_sprites_to_oam + 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, _0809F118 + adds r6, r0, r1 + movs r0, 0 + ldrsh r5, [r6, r0] + cmp r5, 0 + beq _0809F11C + cmp r5, 0x1 + beq _0809F1B2 + b _0809F1F8 + .align 2, 0 +_0809F118: .4byte 0x03005e08 +_0809F11C: + movs r2, 0x85 + lsls r2, 2 + movs r0, 0 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, _0809F1CC + 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, _0809F1D0 + 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, _0809F1D4 + 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, _0809F1D8 + 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, _0809F1DC + bl sub_809F0C0 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] +_0809F1B2: + ldr r0, _0809F1E0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809F1E4 + adds r0, r7, 0 + bl remove_task + bl do_reset + b _0809F1F8 + .align 2, 0 +_0809F1CC: .4byte 0x085eca0d +_0809F1D0: .4byte 0x03005cf8 +_0809F1D4: .4byte 0x085eca22 +_0809F1D8: .4byte 0x03005d90 +_0809F1DC: .4byte 0x085ec9ec +_0809F1E0: .4byte 0x030022c0 +_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, _0809F228 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + bls _0809F21C + b _0809F404 +_0809F21C: + lsls r0, 2 + ldr r1, _0809F22C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809F228: .4byte 0x03005e08 +_0809F22C: .4byte _0809F230 + .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, _0809F264 + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + strh r0, [r5] + b _0809F404 + .align 2, 0 +_0809F264: .4byte 0x0000ffff +_0809F268: + ldr r0, _0809F290 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809F276 + b _0809F404 +_0809F276: + ldr r0, _0809F294 + ldrh r0, [r0] + cmp r0, 0 + beq _0809F282 + cmp r0, 0x2 + bne _0809F29C +_0809F282: + ldr r0, _0809F298 + bl sub_809F0C0 + movs r0, 0x5 + strh r0, [r5] + b _0809F404 + .align 2, 0 +_0809F290: .4byte 0x02037fd4 +_0809F294: .4byte 0x03006210 +_0809F298: .4byte 0x085ecaa7 +_0809F29C: + bl sub_802F588 + ldr r0, _0809F2B0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + b _0809F334 + .align 2, 0 +_0809F2B0: .4byte sub_809F0F8 + 1 +_0809F2B4: + ldr r2, _0809F2FC + 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, _0809F300 + bl sub_809F0C0 + ldr r2, _0809F304 + ldr r0, _0809F308 + ldr r0, [r0] + adds r0, 0xA0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, _0809F30C + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + movs r0, 0x3 + strh r0, [r5] + b _0809F404 + .align 2, 0 +_0809F2FC: .4byte 0x03005e00 +_0809F300: .4byte 0x085eca38 +_0809F304: .4byte 0x03005cf8 +_0809F308: .4byte 0x03005d90 +_0809F30C: .4byte sub_809EF00 + 1 +_0809F310: + ldr r2, _0809F33C + 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 + .align 2, 0 +_0809F33C: .4byte 0x03005e00 +_0809F340: + ldrb r0, [r5, 0x2] + bl remove_task + bl sub_802F3F8 + ldr r4, _0809F388 + 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 sub_802F5C8 + ldr r0, _0809F38C + ldr r2, [r0] + adds r2, 0xA0 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, _0809F390 + ldrh r1, [r4] + bl var_set + bl sub_809D5D8 + ldr r0, _0809F394 + bl sub_809F0C0 + movs r0, 0x4 + strh r0, [r5] + b _0809F404 + .align 2, 0 +_0809F388: .4byte 0x03005cf8 +_0809F38C: .4byte 0x03005d90 +_0809F390: .4byte 0x00004040 +_0809F394: .4byte 0x085eca4f +_0809F398: + movs r0, 0 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F3B8 + ldr r0, _0809F3B4 + bl sub_809F0C0 + movs r0, 0x49 + bl audio_play + b _0809F3C4 + .align 2, 0 +_0809F3B4: .4byte 0x085eca8a +_0809F3B8: + ldr r0, _0809F40C + bl sub_809F0C0 + movs r0, 0x16 + bl audio_play +_0809F3C4: + movs r0, 0x5 + strh r0, [r5] +_0809F3C8: + ldr r0, _0809F410 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809F404 + movs r0, 0x1 + negs r0, r0 + ldr r1, _0809F414 + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x6 + strh r0, [r5] +_0809F3EA: + ldr r0, _0809F418 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0809F404 + adds r0, r4, 0 + bl remove_task + bl Window_FreeMemory + bl do_reset +_0809F404: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809F40C: .4byte 0x085eca9a +_0809F410: .4byte 0x030022c0 +_0809F414: .4byte 0x0000ffff +_0809F418: .4byte 0x02037fd4 + thumb_func_end sub_809F200 + + thumb_func_start sub_809F41C +sub_809F41C: @ 809F41C + push {lr} + ldr r0, _0809F438 + bl flag_set + movs r0, 0x86 + lsls r0, 4 + bl flag_set + ldr r0, _0809F43C + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_0809F438: .4byte 0x00000861 +_0809F43C: .4byte 0x00000862 + thumb_func_end sub_809F41C + + thumb_func_start start_menu_compose +start_menu_compose: @ 809F440 + push {lr} + ldr r0, _0809F458 + movs r1, 0 + strb r1, [r0] + bl is_c1_link_related_active + cmp r0, 0x1 + bne _0809F45C + bl sub_809F568 + b _0809F4AC + .align 2, 0 +_0809F458: .4byte 0x0203760f +_0809F45C: + bl in_trade_center + cmp r0, 0x1 + bne _0809F46A + bl sub_809F5A4 + b _0809F4AC +_0809F46A: + bl flag_check_is_in_safari_zone + cmp r0, 0x1 + bne _0809F478 + bl sub_809F538 + b _0809F4AC +_0809F478: + bl sub_81A80A8 + lsls r0, 24 + cmp r0, 0 + beq _0809F488 + bl sub_809F5E0 + b _0809F4AC +_0809F488: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0809F498 + bl sub_809F604 + b _0809F4AC +_0809F498: + bl sub_813994C + lsls r0, 24 + cmp r0, 0 + beq _0809F4A8 + bl sub_809F634 + b _0809F4AC +_0809F4A8: + bl sub_809F4CC +_0809F4AC: + pop {r0} + bx r0 + thumb_func_end start_menu_compose + + thumb_func_start sub_809F4B0 +sub_809F4B0: @ 809F4B0 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0809F4C4 + ldr r1, _0809F4C8 + bl append_byte + pop {r0} + bx r0 + .align 2, 0 +_0809F4C4: .4byte 0x02037610 +_0809F4C8: .4byte 0x0203760f + thumb_func_end sub_809F4B0 + + thumb_func_start sub_809F4CC +sub_809F4CC: @ 809F4CC + push {lr} + ldr r0, _0809F530 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F4E2 + movs r0, 0 + bl sub_809F4B0 +_0809F4E2: + movs r0, 0x86 + lsls r0, 4 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F4F8 + movs r0, 0x1 + bl sub_809F4B0 +_0809F4F8: + movs r0, 0x2 + bl sub_809F4B0 + ldr r0, _0809F534 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F512 + movs r0, 0x3 + bl sub_809F4B0 +_0809F512: + movs r0, 0x4 + bl sub_809F4B0 + movs r0, 0x5 + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + .align 2, 0 +_0809F530: .4byte 0x00000861 +_0809F534: .4byte 0x00000862 + thumb_func_end sub_809F4CC + + thumb_func_start sub_809F538 +sub_809F538: @ 809F538 + push {lr} + movs r0, 0x8 + bl sub_809F4B0 + movs r0, 0 + bl sub_809F4B0 + movs r0, 0x1 + bl sub_809F4B0 + movs r0, 0x2 + bl sub_809F4B0 + movs r0, 0x4 + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + thumb_func_end sub_809F538 + + thumb_func_start sub_809F568 +sub_809F568: @ 809F568 + push {lr} + movs r0, 0x1 + bl sub_809F4B0 + movs r0, 0x2 + bl sub_809F4B0 + ldr r0, _0809F5A0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F58A + movs r0, 0x3 + bl sub_809F4B0 +_0809F58A: + movs r0, 0x9 + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + .align 2, 0 +_0809F5A0: .4byte 0x00000862 + thumb_func_end sub_809F568 + + thumb_func_start sub_809F5A4 +sub_809F5A4: @ 809F5A4 + push {lr} + movs r0, 0x1 + bl sub_809F4B0 + movs r0, 0x2 + bl sub_809F4B0 + ldr r0, _0809F5DC + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F5C6 + movs r0, 0x3 + bl sub_809F4B0 +_0809F5C6: + movs r0, 0x4 + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + .align 2, 0 +_0809F5DC: .4byte 0x00000862 + thumb_func_end sub_809F5A4 + + thumb_func_start sub_809F5E0 +sub_809F5E0: @ 809F5E0 + push {lr} + movs r0, 0 + bl sub_809F4B0 + movs r0, 0x1 + bl sub_809F4B0 + movs r0, 0x4 + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + thumb_func_end sub_809F5E0 + + thumb_func_start sub_809F604 +sub_809F604: @ 809F604 + push {lr} + movs r0, 0x1 + bl sub_809F4B0 + movs r0, 0xC + bl sub_809F4B0 + movs r0, 0x4 + bl sub_809F4B0 + movs r0, 0xA + bl sub_809F4B0 + movs r0, 0xB + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + thumb_func_end sub_809F604 + + thumb_func_start sub_809F634 +sub_809F634: @ 809F634 + push {lr} + movs r0, 0x1 + bl sub_809F4B0 + movs r0, 0x4 + bl sub_809F4B0 + movs r0, 0x6 + bl sub_809F4B0 + movs r0, 0x7 + bl sub_809F4B0 + pop {r0} + bx r0 + thumb_func_end sub_809F634 + + thumb_func_start sub_809F654 +sub_809F654: @ 809F654 + push {r4,r5,lr} + sub sp, 0xC + ldr r4, _0809F6B0 + ldr r0, _0809F6B4 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldr r0, _0809F6B8 + ldr r1, _0809F6BC + ldrb r1, [r1] + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r5, _0809F6C0 + ldr r1, _0809F6C4 + adds r0, r5, 0 + bl ExpandTextCodes + 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 Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809F6B0: .4byte 0x0203760c +_0809F6B4: .4byte 0x08510508 +_0809F6B8: .4byte 0x02021cc4 +_0809F6BC: .4byte 0x0203a04c +_0809F6C0: .4byte 0x02021fc4 +_0809F6C4: .4byte 0x085ee6ff + thumb_func_end sub_809F654 + + thumb_func_start sub_809F6C8 +sub_809F6C8: @ 809F6C8 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _0809F6E0 + ldr r0, [r0] + ldr r1, _0809F6E4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x7 + bne _0809F6F0 + ldr r4, _0809F6E8 + ldr r0, _0809F6EC + b _0809F6F4 + .align 2, 0 +_0809F6E0: .4byte 0x03005d90 +_0809F6E4: .4byte 0x00000cb2 +_0809F6E8: .4byte 0x0203760d +_0809F6EC: .4byte 0x08510538 +_0809F6F0: + ldr r4, _0809F754 + ldr r0, _0809F758 +_0809F6F4: + bl Window_AddFromTemplate + strb r0, [r4] + ldr r4, _0809F754 + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldr r0, _0809F75C + ldr r2, _0809F760 + ldr r1, _0809F764 + ldr r1, [r1] + ldr r3, _0809F768 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r5, _0809F76C + ldr r1, _0809F770 + adds r0, r5, 0 + bl ExpandTextCodes + 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 Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809F754: .4byte 0x0203760d +_0809F758: .4byte 0x08510530 +_0809F75C: .4byte 0x02021cc4 +_0809F760: .4byte 0x08510510 +_0809F764: .4byte 0x03005d90 +_0809F768: .4byte 0x00000cb2 +_0809F76C: .4byte 0x02021fc4 +_0809F770: .4byte 0x085ee716 + thumb_func_end sub_809F6C8 + + thumb_func_start sub_809F774 +sub_809F774: @ 809F774 + push {r4,lr} + bl flag_check_is_in_safari_zone + cmp r0, 0 + beq _0809F796 + ldr r4, _0809F7B8 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r4] + bl Window_Remove +_0809F796: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0809F7B0 + ldr r4, _0809F7BC + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove +_0809F7B0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809F7B8: .4byte 0x0203760c +_0809F7BC: .4byte 0x0203760d + thumb_func_end sub_809F774 + + thumb_func_start sub_809F7C0 +sub_809F7C0: @ 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, _0809F818 + mov r9, r0 + ldr r1, _0809F81C + mov r10, r1 +_0809F7DA: + ldr r0, _0809F820 + 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, _0809F824 + adds r7, r2, 0 + cmp r1, r0 + bne _0809F828 + bl sub_8197A08 + 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 + .align 2, 0 +_0809F818: .4byte 0x08510540 +_0809F81C: .4byte 0x02021fc4 +_0809F820: .4byte 0x02037610 +_0809F824: .4byte sub_809FC8C + 1 +_0809F828: + mov r1, r9 + adds r0, r3, r1 + ldr r1, [r0] + mov r0, r10 + bl ExpandTextCodes + bl sub_8197A08 + 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, _0809F878 + 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 + .align 2, 0 +_0809F878: .4byte 0x0203760f +_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 sub_809F7C0 + + thumb_func_start sub_809F894 +sub_809F894: @ 809F894 + push {r4,lr} + sub sp, 0xC + ldr r0, _0809F8B0 + movs r1, 0 + ldrsb r1, [r0, r1] + adds r2, r0, 0 + cmp r1, 0x5 + bhi _0809F98C + lsls r0, r1, 2 + ldr r1, _0809F8B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809F8B0: .4byte 0x02037619 +_0809F8B4: .4byte _0809F8B8 + .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 start_menu_compose + ldr r1, _0809F8E0 + b _0809F940 + .align 2, 0 +_0809F8E0: .4byte 0x02037619 +_0809F8E4: + bl sub_81973A4 + ldr r0, _0809F904 + ldrb r0, [r0] + bl sub_81979C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81973FC + ldr r1, _0809F908 + movs r0, 0 + strb r0, [r1, 0x1] + b _0809F940 + .align 2, 0 +_0809F904: .4byte 0x0203760f +_0809F908: .4byte 0x02037619 +_0809F90C: + bl flag_check_is_in_safari_zone + cmp r0, 0 + beq _0809F918 + bl sub_809F654 +_0809F918: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0809F926 + bl sub_809F6C8 +_0809F926: + ldr r1, _0809F92C + b _0809F940 + .align 2, 0 +_0809F92C: .4byte 0x02037619 +_0809F930: + ldr r4, _0809F948 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_809F7C0 + cmp r0, 0 + beq _0809F98C + subs r1, r4, 0x1 +_0809F940: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0809F98C + .align 2, 0 +_0809F948: .4byte 0x0203761a +_0809F94C: + bl sub_8197A08 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x10 + str r1, [sp] + ldr r1, _0809F984 + ldrb r1, [r1] + str r1, [sp, 0x4] + ldr r4, _0809F988 + ldrb r1, [r4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x9 + bl sub_81983AC + strb r0, [r4] + bl sub_8197A08 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl Window_CopyToVram + movs r0, 0x1 + b _0809F98E + .align 2, 0 +_0809F984: .4byte 0x0203760f +_0809F988: .4byte 0x0203760e +_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, _0809F9B0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] +_0809F9A2: + bl sub_809F894 + cmp r0, 0 + beq _0809F9A2 + pop {r0} + bx r0 + .align 2, 0 +_0809F9B0: .4byte 0x02037619 + 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, _0809F9F8 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + ldr r4, _0809F9FC + 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 + .align 2, 0 +_0809F9F8: .4byte 0x02037619 +_0809F9FC: .4byte task50_startmenu + 1 + 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, _0809FA28 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + ldr r1, _0809FA2C + ldr r0, _0809FA30 + str r0, [r1] + bx lr + .align 2, 0 +_0809FA28: .4byte 0x02037619 +_0809FA2C: .4byte 0x03005db0 +_0809FA30: .4byte sub_809FA00 + 1 + 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, _0809FA54 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809FA58 + cmp r0, 0x1 + beq _0809FA7C + b _0809FA92 + .align 2, 0 +_0809FA54: .4byte 0x03005e00 +_0809FA58: + bl in_trade_center + cmp r0, 0x1 + bne _0809FA64 + bl var_800D_set_xB +_0809FA64: + ldr r1, _0809FA74 + ldr r0, _0809FA78 + str r0, [r1] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0809FA92 + .align 2, 0 +_0809FA74: .4byte 0x03005df4 +_0809FA78: .4byte sub_809FAC4 + 1 +_0809FA7C: + ldr r0, _0809FA98 + 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 + .align 2, 0 +_0809FA98: .4byte 0x03005df4 + 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, _0809FAC0 + bl sub_809F9D0 + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_0809FAC0: .4byte sub_809FA34 + 1 + thumb_func_end sub_809FA9C + + thumb_func_start sub_809FAC4 +sub_809FAC4: @ 809FAC4 + push {r4,lr} + ldr r4, _0809FB70 + 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, _0809FB74 + 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, _0809FB74 + 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, _0809FB78 + ldr r2, _0809FB7C + ldr r0, _0809FB74 + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + ldr r0, _0809FB80 + cmp r1, r0 + bne _0809FB34 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + cmp r0, 0 + beq _0809FBA0 +_0809FB34: + ldr r3, _0809FB84 + ldr r1, _0809FB78 + ldr r2, _0809FB7C + ldr r0, _0809FB74 + 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, _0809FB88 + cmp r1, r0 + beq _0809FBA0 + ldr r0, _0809FB8C + cmp r1, r0 + beq _0809FBA0 + ldr r0, _0809FB90 + cmp r1, r0 + beq _0809FBA0 + ldr r0, _0809FB94 + cmp r1, r0 + beq _0809FBA0 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _0809FBA0 + .align 2, 0 +_0809FB70: .4byte 0x030022c0 +_0809FB74: .4byte 0x0203760e +_0809FB78: .4byte 0x08510540 +_0809FB7C: .4byte 0x02037610 +_0809FB80: .4byte sm_pokedex + 1 +_0809FB84: .4byte 0x03005df4 +_0809FB88: .4byte sub_809FCFC + 1 +_0809FB8C: .4byte sub_809FD64 + 1 +_0809FB90: .4byte sub_809FD74 + 1 +_0809FB94: .4byte sub_809FDC0 + 1 +_0809FB98: + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + bne _0809FBA4 +_0809FBA0: + movs r0, 0 + b _0809FBAE +_0809FBA4: + bl sub_809F774 + bl sub_80A0934 + movs r0, 0x1 +_0809FBAE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809FAC4 + + thumb_func_start sm_pokedex +sm_pokedex: @ 809FBB4 + push {lr} + ldr r0, _0809FBC8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FBCC + movs r0, 0 + b _0809FBE6 + .align 2, 0 +_0809FBC8: .4byte 0x02037fd4 +_0809FBCC: + movs r0, 0x29 + bl sav12_xor_increment + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + ldr r0, _0809FBEC + bl set_callback2 + movs r0, 0x1 +_0809FBE6: + pop {r1} + bx r1 + .align 2, 0 +_0809FBEC: .4byte sub_80BB534 + 1 + thumb_func_end sm_pokedex + + thumb_func_start sub_809FBF0 +sub_809FBF0: @ 809FBF0 + push {lr} + ldr r0, _0809FC04 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC08 + movs r0, 0 + b _0809FC1C + .align 2, 0 +_0809FC04: .4byte 0x02037fd4 +_0809FC08: + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + ldr r0, _0809FC20 + bl set_callback2 + movs r0, 0x1 +_0809FC1C: + pop {r1} + bx r1 + .align 2, 0 +_0809FC20: .4byte sub_81B7F34 + 1 + thumb_func_end sub_809FBF0 + + thumb_func_start sub_809FC24 +sub_809FC24: @ 809FC24 + push {lr} + ldr r0, _0809FC38 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC3C + movs r0, 0 + b _0809FC50 + .align 2, 0 +_0809FC38: .4byte 0x02037fd4 +_0809FC3C: + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + ldr r0, _0809FC54 + bl set_callback2 + movs r0, 0x1 +_0809FC50: + pop {r1} + bx r1 + .align 2, 0 +_0809FC54: .4byte c2_bag + 1 + thumb_func_end sub_809FC24 + + thumb_func_start sub_809FC58 +sub_809FC58: @ 809FC58 + push {lr} + ldr r0, _0809FC6C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC70 + movs r0, 0 + b _0809FC84 + .align 2, 0 +_0809FC6C: .4byte 0x02037fd4 +_0809FC70: + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + ldr r0, _0809FC88 + bl set_callback2 + movs r0, 0x1 +_0809FC84: + pop {r1} + bx r1 + .align 2, 0 +_0809FC88: .4byte sub_81C7250 + 1 + thumb_func_end sub_809FC58 + + thumb_func_start sub_809FC8C +sub_809FC8C: @ 809FC8C + push {lr} + ldr r0, _0809FCC0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0809FCF4 + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + bl is_c1_link_related_active + cmp r0, 0 + bne _0809FCB6 + bl in_trade_center + cmp r0, 0 + beq _0809FCC8 +_0809FCB6: + ldr r0, _0809FCC4 + bl sub_80C4DDC + b _0809FCEA + .align 2, 0 +_0809FCC0: .4byte 0x02037fd4 +_0809FCC4: .4byte sub_8086194 + 1 +_0809FCC8: + ldr r0, _0809FCDC + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0809FCE4 + ldr r0, _0809FCE0 + bl sub_80C51C4 + b _0809FCEA + .align 2, 0 +_0809FCDC: .4byte 0x000008d2 +_0809FCE0: .4byte sub_8086194 + 1 +_0809FCE4: + ldr r0, _0809FCF0 + bl sub_80C4DDC +_0809FCEA: + movs r0, 0x1 + b _0809FCF6 + .align 2, 0 +_0809FCF0: .4byte sub_8086194 + 1 +_0809FCF4: + movs r0, 0 +_0809FCF6: + pop {r1} + bx r1 + thumb_func_end sub_809FC8C + + thumb_func_start sub_809FCFC +sub_809FCFC: @ 809FCFC + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _0809FD0C + bl sub_809F774 +_0809FD0C: + ldr r1, _0809FD18 + ldr r0, _0809FD1C + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809FD18: .4byte 0x03005df4 +_0809FD1C: .4byte sub_809FE28 + 1 + thumb_func_end sub_809FCFC + + thumb_func_start sub_809FD20 +sub_809FD20: @ 809FD20 + push {lr} + ldr r0, _0809FD34 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FD38 + movs r0, 0 + b _0809FD52 + .align 2, 0 +_0809FD34: .4byte 0x02037fd4 +_0809FD38: + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + ldr r0, _0809FD58 + bl set_callback2 + ldr r1, _0809FD5C + ldr r0, _0809FD60 + str r0, [r1, 0x8] + movs r0, 0x1 +_0809FD52: + pop {r1} + bx r1 + .align 2, 0 +_0809FD58: .4byte c2_options_menu + 1 +_0809FD5C: .4byte 0x030022c0 +_0809FD60: .4byte sub_8086194 + 1 + thumb_func_end sub_809FD20 + + thumb_func_start sub_809FD64 +sub_809FD64: @ 809FD64 + push {lr} + bl sub_809F774 + bl sub_80A0934 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809FD64 + + thumb_func_start sub_809FD74 +sub_809FD74: @ 809FD74 + push {lr} + bl sub_809F774 + bl sub_80A0934 + bl sub_80FC180 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809FD74 + + thumb_func_start sub_809FD88 +sub_809FD88: @ 809FD88 + push {lr} + ldr r0, _0809FD9C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FDA0 + movs r0, 0 + b _0809FDB4 + .align 2, 0 +_0809FD9C: .4byte 0x02037fd4 +_0809FDA0: + bl play_some_sound + bl overworld_free_bg_tilemaps + ldr r0, _0809FDB8 + ldrb r0, [r0] + ldr r1, _0809FDBC + bl sub_80C4E74 + movs r0, 0x1 +_0809FDB4: + pop {r1} + bx r1 + .align 2, 0 +_0809FDB8: .4byte 0x03005db4 +_0809FDBC: .4byte sub_8086194 + 1 + thumb_func_end sub_809FD88 + + thumb_func_start sub_809FDC0 +sub_809FDC0: @ 809FDC0 + ldr r1, _0809FDCC + ldr r0, _0809FDD0 + str r0, [r1] + movs r0, 0 + bx lr + .align 2, 0 +_0809FDCC: .4byte 0x03005df4 +_0809FDD0: .4byte sub_809FE9C + 1 + thumb_func_end sub_809FDC0 + + thumb_func_start atk17_seteffectuser +atk17_seteffectuser: @ 809FDD4 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_8197DF8 + bl sub_80984F4 + ldr r0, _0809FDF0 + bl sub_809F9D0 + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_0809FDF0: .4byte sub_809FA34 + 1 + thumb_func_end atk17_seteffectuser + + thumb_func_start sub_809FDF4 +sub_809FDF4: @ 809FDF4 + push {lr} + ldr r0, _0809FE08 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FE0C + movs r0, 0 + b _0809FE20 + .align 2, 0 +_0809FE08: .4byte 0x02037fd4 +_0809FE0C: + bl play_some_sound + bl sub_809F774 + bl overworld_free_bg_tilemaps + ldr r0, _0809FE24 + bl set_callback2 + movs r0, 0x1 +_0809FE20: + pop {r1} + bx r1 + .align 2, 0 +_0809FE24: .4byte sub_81C4EFC + 1 + thumb_func_end sub_809FDF4 + + thumb_func_start sub_809FE28 +sub_809FE28: @ 809FE28 + push {lr} + bl sub_809FF28 + ldr r1, _0809FE3C + ldr r0, _0809FE40 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809FE3C: .4byte 0x03005df4 +_0809FE40: .4byte sub_809FE44 + 1 + 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, _0809FE74 + ldr r0, _0809FE78 + str r0, [r1] + b _0809FE94 + .align 2, 0 +_0809FE74: .4byte 0x03005df4 +_0809FE78: .4byte sub_809FAC4 + 1 +_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, _0809FEB0 + ldr r0, _0809FEB4 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809FEB0: .4byte 0x03005df4 +_0809FEB4: .4byte sub_809FED4 + 1 + thumb_func_end sub_809FE9C + + thumb_func_start sub_809FEB8 +sub_809FEB8: @ 809FEB8 + push {lr} + bl sub_809F998 + ldr r1, _0809FECC + ldr r0, _0809FED0 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809FECC: .4byte 0x03005df4 +_0809FED0: .4byte sub_809FAC4 + 1 + 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 sub_809F774 + ldr r1, _0809FEF8 + ldr r0, _0809FEFC + str r0, [r1] + b _0809FF20 + .align 2, 0 +_0809FEF8: .4byte 0x03005df4 +_0809FEFC: .4byte sub_809FEB8 + 1 +_0809FF00: + movs r0, 0 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_80984F4 + bl script_env_2_disable + ldr r0, _0809FF1C + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809FF22 + .align 2, 0 +_0809FF1C: .4byte 0x08252c88 +_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, _0809FF40 + ldr r0, _0809FF44 + str r0, [r1] + ldr r1, _0809FF48 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0809FF40: .4byte 0x0203761c +_0809FF44: .4byte sub_80A00A0 + 1 +_0809FF48: .4byte 0x02037621 + 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, _0809FF70 + movs r0, 0 + strb r0, [r1] + ldr r0, _0809FF74 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + b _0809FF7A + .align 2, 0 +_0809FF70: .4byte 0x02037621 +_0809FF74: .4byte 0x0203761c +_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, _0809FF94 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_0809FF94: .4byte task50_save_game + 1 + 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, _0809FFC4 + adds r1, r2, 0 + bl ExpandTextCodes + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + movs r0, 0x1 + bl sub_8197310 + ldr r1, _0809FFC8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0809FFCC + str r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809FFC4: .4byte 0x02021fc4 +_0809FFC8: .4byte 0x02037621 +_0809FFCC: .4byte 0x0203761c + 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, _0809FFF8 + movs r0, 0 + strh r0, [r1] + b _080A0000 + .align 2, 0 +_0809FFF8: .4byte 0x020375f0 +_0809FFFC: + ldr r0, _080A0010 + 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 + .align 2, 0 +_080A0010: .4byte 0x020375f0 + 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, _080A0038 + movs r0, 0x3C + strb r0, [r1] + bx lr + .align 2, 0 +_080A0038: .4byte 0x02037620 + thumb_func_end sub_80A0030 + + thumb_func_start sub_80A003C +sub_80A003C: @ 80A003C + push {lr} + ldr r1, _080A005C + ldrb r0, [r1] + subs r2, r0, 0x1 + strb r2, [r1] + ldr r0, _080A0060 + 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 + .align 2, 0 +_080A005C: .4byte 0x02037620 +_080A0060: .4byte 0x030022c0 +_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, _080A008C + ldrb r0, [r1] + cmp r0, 0 + bne _080A0094 + ldr r0, _080A0090 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A0098 + movs r0, 0x1 + b _080A009A + .align 2, 0 +_080A008C: .4byte 0x02037620 +_080A0090: .4byte 0x030022c0 +_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 sub_8197A08 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_819746C + bl sub_8197A14 + bl sub_80A06B4 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080A00D4 + ldr r0, _080A00CC + ldr r1, _080A00D0 + bl sub_809FF98 + b _080A00DC + .align 2, 0 +_080A00CC: .4byte 0x08252ca7 +_080A00D0: .4byte sub_80A00EC + 1 +_080A00D4: + ldr r0, _080A00E4 + ldr r1, _080A00E8 + bl sub_809FF98 +_080A00DC: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A00E4: .4byte 0x082c87b4 +_080A00E8: .4byte sub_80A00EC + 1 + thumb_func_end sub_80A00A0 + + thumb_func_start sub_80A00EC +sub_80A00EC: @ 80A00EC + push {lr} + bl sub_8197930 + ldr r1, _080A0100 + ldr r0, _080A0104 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A0100: .4byte 0x0203761c +_080A0104: .4byte sub_80A0108 + 1 + 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, _080A0148 + ldrh r0, [r0] + cmp r0, 0 + beq _080A0136 + cmp r0, 0x2 + bne _080A013E +_080A0136: + ldr r0, _080A014C + ldrb r0, [r0] + cmp r0, 0 + bne _080A0158 +_080A013E: + ldr r1, _080A0150 + ldr r0, _080A0154 + str r0, [r1] + b _080A0174 + .align 2, 0 +_080A0148: .4byte 0x03006210 +_080A014C: .4byte 0x020322d4 +_080A0150: .4byte 0x0203761c +_080A0154: .4byte sub_80A017C + 1 +_080A0158: + ldr r1, _080A0160 + ldr r0, _080A0164 + str r0, [r1] + b _080A0174 + .align 2, 0 +_080A0160: .4byte 0x0203761c +_080A0164: .4byte sub_80A0234 + 1 +_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, _080A0190 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080A019C + ldr r0, _080A0194 + ldr r1, _080A0198 + bl sub_809FF98 + b _080A01A4 + .align 2, 0 +_080A0190: .4byte 0x020322d4 +_080A0194: .4byte 0x082c8845 +_080A0198: .4byte sub_80A01B4 + 1 +_080A019C: + ldr r0, _080A01AC + ldr r1, _080A01B0 + bl sub_809FF98 +_080A01A4: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A01AC: .4byte 0x082c87d5 +_080A01B0: .4byte sub_80A01D0 + 1 + thumb_func_end sub_80A017C + + thumb_func_start sub_80A01B4 +sub_80A01B4: @ 80A01B4 + push {lr} + movs r0, 0x1 + bl sub_8197948 + ldr r1, _080A01C8 + ldr r0, _080A01CC + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A01C8: .4byte 0x0203761c +_080A01CC: .4byte sub_80A01EC + 1 + thumb_func_end sub_80A01B4 + + thumb_func_start sub_80A01D0 +sub_80A01D0: @ 80A01D0 + push {lr} + bl sub_8197930 + ldr r1, _080A01E4 + ldr r0, _080A01E8 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A01E4: .4byte 0x0203761c +_080A01E8: .4byte sub_80A01EC + 1 + 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, _080A0218 + ldr r0, _080A021C + str r0, [r1] + b _080A022C + .align 2, 0 +_080A0218: .4byte 0x0203761c +_080A021C: .4byte sub_80A0234 + 1 +_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, _080A0244 + ldr r1, _080A0248 + bl sub_809FF98 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A0244: .4byte 0x082c8810 +_080A0248: .4byte sub_80A024C + 1 + 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, _080A0270 + 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 + .align 2, 0 +_080A0270: .4byte 0x020322d4 +_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, _080A028C + ldr r1, _080A0290 + bl sub_809FF98 + b _080A029C + .align 2, 0 +_080A028C: .4byte 0x082c8832 +_080A0290: .4byte sub_80A02B0 + 1 +_080A0294: + ldr r0, _080A02A8 + ldr r1, _080A02AC + bl sub_809FF98 +_080A029C: + bl sub_80A0030 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080A02A8: .4byte 0x082c892a +_080A02AC: .4byte sub_80A02FC + 1 + thumb_func_end sub_80A024C + + thumb_func_start sub_80A02B0 +sub_80A02B0: @ 80A02B0 + push {lr} + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _080A02CA + movs r0, 0x37 + bl audio_play + ldr r1, _080A02D0 + ldr r0, _080A02D4 + str r0, [r1] +_080A02CA: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A02D0: .4byte 0x0203761c +_080A02D4: .4byte sub_80A02D8 + 1 + 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 a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _080A0316 + movs r0, 0x16 + bl audio_play + ldr r1, _080A031C + ldr r0, _080A0320 + str r0, [r1] +_080A0316: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A031C: .4byte 0x0203761c +_080A0320: .4byte sub_80A0324 + 1 + 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, _080A0350 + ldr r0, _080A0354 + str r0, [r1] + ldr r1, _080A0358 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_080A0350: .4byte 0x0203761c +_080A0354: .4byte sub_80A035C + 1 +_080A0358: .4byte 0x02037621 + thumb_func_end sub_80A0340 + + thumb_func_start sub_80A035C +sub_80A035C: @ 80A035C + push {lr} + bl sub_8197A08 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_819746C + bl sub_8197A14 + ldr r0, _080A0380 + ldr r1, _080A0384 + bl sub_809FF98 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A0380: .4byte 0x08252cfb +_080A0384: .4byte sub_80A0388 + 1 + thumb_func_end sub_80A035C + + thumb_func_start sub_80A0388 +sub_80A0388: @ 80A0388 + push {lr} + movs r0, 0x1 + bl sub_8197948 + ldr r1, _080A039C + ldr r0, _080A03A0 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A039C: .4byte 0x0203761c +_080A03A0: .4byte sub_80A03A4 + 1 + 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, _080A0400 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A0400: .4byte _080A0404 + .align 2, 0 +_080A0404: + .4byte _080A0418 + .4byte _080A0490 + .4byte _080A04A2 + .4byte _080A04D4 + .4byte _080A04F8 +_080A0418: + movs r0, 0 + movs r1, 0 + bl lcd_io_set + 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, _080A0484 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, _080A0488 + 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, _080A048C + 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 + .align 2, 0 +_080A0484: .4byte 0x040000d4 +_080A0488: .4byte 0x81000200 +_080A048C: .4byte 0x81000800 +_080A0490: + bl reset_all_obj_data + bl clear_tasks + bl sub_80A1A74 + bl dp12_8087EA4 + b _080A04FC +_080A04A2: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080A04CC + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + ldr r0, _080A04D0 + bl Window_InitFromTemplates + movs r0, 0 + movs r1, 0x8 + movs r2, 0xE0 + bl box_border_load_tiles_and_pal + movs r0, 0xF0 + bl sub_81978B0 + b _080A04FC + .align 2, 0 +_080A04CC: .4byte 0x085105a8 +_080A04D0: .4byte 0x085105ac +_080A04D4: + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _080A04F4 + bl SetVBlankCallback + movs r0, 0x1 + bl enable_irqs + b _080A04FC + .align 2, 0 +_080A04F4: .4byte sub_80A03D8 + 1 +_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, _080A0534 + bl sub_80A03E4 + cmp r0, 0 + beq _080A052E + ldr r0, _080A0538 + movs r1, 0x50 + bl AddTask + ldr r0, _080A053C + bl set_callback2 +_080A052E: + pop {r0} + bx r0 + .align 2, 0 +_080A0534: .4byte 0x030026f8 +_080A0538: .4byte sub_80A0550 + 1 +_080A053C: .4byte sub_80A0540 + 1 + thumb_func_end sub_80A0514 + + thumb_func_start sub_80A0540 +sub_80A0540: @ 80A0540 + push {lr} + bl run_active_tasks + 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, _080A0584 + adds r5, r0, r1 + ldr r0, _080A0588 + 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, _080A058C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A0584: .4byte 0x03005e08 +_080A0588: .4byte 0x02037fd4 +_080A058C: .4byte _080A0590 + .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 Window_FastFillPixels + ldr r2, _080A0614 + 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 text_box_related_one + movs r0, 0 + movs r1, 0x8 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080A0618 + ldrb r0, [r0] + cmp r0, 0 + beq _080A0620 + bl in_trade_center + cmp r0, 0 + beq _080A0620 + bl sub_800A07C + cmp r0, 0 + beq _080A061C + strh r6, [r5] + b _080A06A8 + .align 2, 0 +_080A0614: .4byte 0x082c8959 +_080A0618: .4byte 0x030030fc +_080A061C: + movs r0, 0x5 + b _080A06A6 +_080A0620: + ldr r0, _080A062C + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + b _080A06A6 + .align 2, 0 +_080A062C: .4byte 0x03002700 +_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, _080A0658 + movs r0, 0 + strb r0, [r1] + b _080A06A8 + .align 2, 0 +_080A0658: .4byte 0x03002700 +_080A065C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x4 + b _080A06A6 +_080A0670: + bl Window_FreeMemory + ldr r0, _080A0684 + ldr r0, [r0, 0x8] + bl set_callback2 + adds r0, r4, 0 + bl remove_task + b _080A06A8 + .align 2, 0 +_080A0684: .4byte 0x030022c0 +_080A0688: + ldr r0, _080A0694 + movs r1, 0x5 + bl AddTask + movs r0, 0x6 + b _080A06A6 + .align 2, 0 +_080A0694: .4byte sub_8153688 + 1 +_080A0698: + ldr r0, _080A06B0 + 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 + .align 2, 0 +_080A06B0: .4byte sub_8153688 + 1 + 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, _080A0860 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + ldr r0, _080A0864 + mov r10, r0 + bl flag_check + 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, _080A0868 + ldr r0, [sp, 0x10] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x10] +_080A06EC: + ldr r6, _080A086C + add r0, sp, 0xC + bl Window_AddFromTemplate + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldr r0, _080A0870 + 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, _080A0874 + 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, _080A0878 + 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 sub_81DB368 + 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, _080A087C + 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 sub_81DB368 + 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 flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A0802 + movs r4, 0x31 + ldrb r0, [r6] + ldr r2, _080A0880 + 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 sub_81DB368 + 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, _080A0884 + 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 sub_81DB368 + 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 Window_CopyToVram + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A0860: .4byte 0x085105bc +_080A0864: .4byte 0x00000861 +_080A0868: .4byte 0xffffff00 +_080A086C: .4byte 0x02037622 +_080A0870: .4byte 0x03005d90 +_080A0874: .4byte 0x02021fc4 +_080A0878: .4byte 0x085eed26 +_080A087C: .4byte 0x085eed2d +_080A0880: .4byte 0x085eed34 +_080A0884: .4byte 0x085eed3c + thumb_func_end sub_80A06B4 + + thumb_func_start sub_80A0888 +sub_80A0888: @ 80A0888 + push {r4,lr} + ldr r4, _080A08A0 + ldrb r0, [r4] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A08A0: .4byte 0x02037622 + 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, _080A08C8 + 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 + .align 2, 0 +_080A08C8: .4byte sub_8153688 + 1 + thumb_func_end sub_80A08A4 + + thumb_func_start sub_80A08CC +sub_80A08CC: @ 80A08CC + push {r4,r5,lr} + ldr r0, _080A0908 + movs r1, 0x5 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080A090C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0xC] + ldr r0, _080A0910 + 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 + .align 2, 0 +_080A0908: .4byte sub_8153688 + 1 +_080A090C: .4byte 0x03005e00 +_080A0910: .4byte sub_80A08A4 + 1 + thumb_func_end sub_80A08CC + + thumb_func_start sub_80A0914 +sub_80A0914: @ 80A0914 + push {lr} + bl sub_8197A08 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl sub_8197A14 + 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 + + thumb_func_start sub_80A0954 +sub_80A0954: @ 80A0954 + push {lr} + sub sp, 0x4 + ldr r1, _080A0974 + movs r0, 0 + strb r0, [r1] + movs r0, 0 + str r0, [sp] + ldr r1, _080A0978 + ldr r2, _080A097C + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080A0974: .4byte 0x03000f34 +_080A0978: .4byte 0x02037624 +_080A097C: .4byte 0x0500003c + thumb_func_end sub_80A0954 + + thumb_func_start sub_80A0980 +sub_80A0980: @ 80A0980 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r3, _080A09C8 + ldrb r0, [r3] + cmp r0, 0x13 + bhi _080A09C0 + ldr r2, _080A09CC + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + str r4, [r0] + ldrb r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0x4 + adds r0, r1 + str r5, [r0] + ldrb r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x8] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_080A09C0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A09C8: .4byte 0x03000f34 +_080A09CC: .4byte 0x02037624 + thumb_func_end sub_80A0980 + + thumb_func_start sub_80A09D0 +sub_80A09D0: @ 80A09D0 + push {r4-r6,lr} + movs r3, 0 + ldr r4, _080A0A0C + adds r6, r4, 0 + ldrb r0, [r4] + cmp r3, r0 + bge _080A0A02 + ldr r2, _080A0A10 + ldr r1, _080A0A14 + movs r5, 0x80 + lsls r5, 24 +_080A09E6: + ldr r0, [r1] + str r0, [r2] + ldr r0, [r1, 0x4] + str r0, [r2, 0x4] + ldrh r0, [r1, 0x8] + lsrs r0, 1 + orrs r0, r5 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + adds r1, 0xC + adds r3, 0x1 + ldrb r0, [r4] + cmp r3, r0 + blt _080A09E6 +_080A0A02: + movs r0, 0 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A0A0C: .4byte 0x03000f34 +_080A0A10: .4byte 0x040000d4 +_080A0A14: .4byte 0x02037624 + thumb_func_end sub_80A09D0 + + thumb_func_start cur_mapheader_run_tileset_funcs_after_some_cpuset +cur_mapheader_run_tileset_funcs_after_some_cpuset: @ 80A0A18 + push {lr} + bl sub_80A0954 + bl cur_mapheader_run_tileset1_func + bl cur_mapheader_run_tileset2_func + pop {r0} + bx r0 + thumb_func_end cur_mapheader_run_tileset_funcs_after_some_cpuset + + thumb_func_start sub_80A0A2C +sub_80A0A2C: @ 80A0A2C + push {lr} + bl cur_mapheader_run_tileset2_func + pop {r0} + bx r0 + thumb_func_end sub_80A0A2C + + thumb_func_start sub_80A0A38 +sub_80A0A38: @ 80A0A38 + push {r4,lr} + bl sub_80A0954 + ldr r2, _080A0A90 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + ldr r1, _080A0A94 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bcc _080A0A56 + movs r0, 0 + strh r0, [r2] +_080A0A56: + ldr r4, _080A0A98 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r1, _080A0A9C + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bcc _080A0A6E + movs r0, 0 + strh r0, [r4] +_080A0A6E: + ldr r0, _080A0AA0 + ldr r1, [r0] + cmp r1, 0 + beq _080A0A7C + ldrh r0, [r2] + bl _call_via_r1 +_080A0A7C: + ldr r0, _080A0AA4 + ldr r1, [r0] + cmp r1, 0 + beq _080A0A8A + ldrh r0, [r4] + bl _call_via_r1 +_080A0A8A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A0A90: .4byte 0x03000f36 +_080A0A94: .4byte 0x03000f38 +_080A0A98: .4byte 0x03000f3a +_080A0A9C: .4byte 0x03000f3c +_080A0AA0: .4byte 0x03000f40 +_080A0AA4: .4byte 0x03000f44 + thumb_func_end sub_80A0A38 + + thumb_func_start cur_mapheader_run_tileset1_func +cur_mapheader_run_tileset1_func: @ 80A0AA8 + push {lr} + ldr r0, _080A0AD4 + movs r1, 0 + strh r1, [r0] + ldr r0, _080A0AD8 + strh r1, [r0] + ldr r1, _080A0ADC + movs r0, 0 + str r0, [r1] + ldr r0, _080A0AE0 + ldr r0, [r0] + ldr r0, [r0, 0x10] + cmp r0, 0 + beq _080A0ACE + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _080A0ACE + bl _call_via_r0 +_080A0ACE: + pop {r0} + bx r0 + .align 2, 0 +_080A0AD4: .4byte 0x03000f36 +_080A0AD8: .4byte 0x03000f38 +_080A0ADC: .4byte 0x03000f40 +_080A0AE0: .4byte 0x02037318 + thumb_func_end cur_mapheader_run_tileset1_func + + thumb_func_start cur_mapheader_run_tileset2_func +cur_mapheader_run_tileset2_func: @ 80A0AE4 + push {lr} + ldr r0, _080A0B10 + movs r1, 0 + strh r1, [r0] + ldr r0, _080A0B14 + strh r1, [r0] + ldr r1, _080A0B18 + movs r0, 0 + str r0, [r1] + ldr r0, _080A0B1C + ldr r0, [r0] + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _080A0B0A + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _080A0B0A + bl _call_via_r0 +_080A0B0A: + pop {r0} + bx r0 + .align 2, 0 +_080A0B10: .4byte 0x03000f3a +_080A0B14: .4byte 0x03000f3c +_080A0B18: .4byte 0x03000f44 +_080A0B1C: .4byte 0x02037318 + thumb_func_end cur_mapheader_run_tileset2_func + + thumb_func_start sub_80A0B20 +sub_80A0B20: @ 80A0B20 + ldr r1, _080A0B38 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0B3C + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080A0B40 + ldr r0, _080A0B44 + str r0, [r1] + bx lr + .align 2, 0 +_080A0B38: .4byte 0x03000f36 +_080A0B3C: .4byte 0x03000f38 +_080A0B40: .4byte 0x03000f40 +_080A0B44: .4byte sub_80A0B70 + 1 + thumb_func_end sub_80A0B20 + + thumb_func_start sub_80A0B48 +sub_80A0B48: @ 80A0B48 + ldr r1, _080A0B60 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0B64 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080A0B68 + ldr r0, _080A0B6C + str r0, [r1] + bx lr + .align 2, 0 +_080A0B60: .4byte 0x03000f36 +_080A0B64: .4byte 0x03000f38 +_080A0B68: .4byte 0x03000f40 +_080A0B6C: .4byte sub_80A0BB4 + 1 + thumb_func_end sub_80A0B48 + + thumb_func_start sub_80A0B70 +sub_80A0B70: @ 80A0B70 + push {r4,r5,lr} + lsls r5, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r5 + lsrs r4, r0, 16 + cmp r4, 0 + bne _080A0B86 + lsrs r0, r5, 20 + bl sub_80A0BCC +_080A0B86: + cmp r4, 0x1 + bne _080A0B90 + lsrs r0, r5, 20 + bl sub_80A0BF4 +_080A0B90: + cmp r4, 0x2 + bne _080A0B9A + lsrs r0, r5, 20 + bl sub_80A0C1C +_080A0B9A: + cmp r4, 0x3 + bne _080A0BA4 + lsrs r0, r5, 20 + bl sub_80A0C44 +_080A0BA4: + cmp r4, 0x4 + bne _080A0BAE + lsrs r0, r5, 20 + bl sub_80A12AC +_080A0BAE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A0B70 + + thumb_func_start sub_80A0BB4 +sub_80A0BB4: @ 80A0BB4 + push {lr} + lsls r1, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + bne _080A0BC8 + lsrs r0, r1, 19 + bl sub_80A1688 +_080A0BC8: + pop {r0} + bx r0 + thumb_func_end sub_80A0BB4 + + thumb_func_start sub_80A0BCC +sub_80A0BCC: @ 80A0BCC + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A0BEC + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A0BF0 + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A0BEC: .4byte 0x08510764 +_080A0BF0: .4byte 0x06003f80 + thumb_func_end sub_80A0BCC + + thumb_func_start sub_80A0BF4 +sub_80A0BF4: @ 80A0BF4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + ands r0, r1 + ldr r1, _080A0C14 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A0C18 + movs r2, 0xF0 + lsls r2, 2 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A0C14: .4byte 0x08512574 +_080A0C18: .4byte 0x06003600 + thumb_func_end sub_80A0BF4 + + thumb_func_start sub_80A0C1C +sub_80A0C1C: @ 80A0C1C + push {lr} + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + ldr r0, _080A0C3C + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A0C40 + movs r2, 0xA0 + lsls r2, 1 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A0C3C: .4byte 0x08512e54 +_080A0C40: .4byte 0x06003a00 + thumb_func_end sub_80A0C1C + + thumb_func_start sub_80A0C44 +sub_80A0C44: @ 80A0C44 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A0C64 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A0C68 + movs r2, 0xC0 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A0C64: .4byte 0x08513174 +_080A0C68: .4byte 0x06003e00 + thumb_func_end sub_80A0C44 + + thumb_func_start sub_80A0C6C +sub_80A0C6C: @ 80A0C6C + ldr r1, _080A0C84 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0C88 + ldr r0, _080A0C8C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0C90 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0C84: .4byte 0x03000f3a +_080A0C88: .4byte 0x03000f3c +_080A0C8C: .4byte 0x03000f38 +_080A0C90: .4byte 0x03000f44 + thumb_func_end sub_80A0C6C + + thumb_func_start sub_80A0C94 +sub_80A0C94: @ 80A0C94 + ldr r1, _080A0CAC + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0CB0 + ldr r0, _080A0CB4 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0CB8 + ldr r0, _080A0CBC + str r0, [r1] + bx lr + .align 2, 0 +_080A0CAC: .4byte 0x03000f3a +_080A0CB0: .4byte 0x03000f3c +_080A0CB4: .4byte 0x03000f38 +_080A0CB8: .4byte 0x03000f44 +_080A0CBC: .4byte sub_80A103C + 1 + thumb_func_end sub_80A0C94 + + thumb_func_start sub_80A0CC0 +sub_80A0CC0: @ 80A0CC0 + ldr r1, _080A0CD8 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0CDC + ldr r0, _080A0CE0 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0CE4 + ldr r0, _080A0CE8 + str r0, [r1] + bx lr + .align 2, 0 +_080A0CD8: .4byte 0x03000f3a +_080A0CDC: .4byte 0x03000f3c +_080A0CE0: .4byte 0x03000f38 +_080A0CE4: .4byte 0x03000f44 +_080A0CE8: .4byte sub_80A10B8 + 1 + thumb_func_end sub_80A0CC0 + + thumb_func_start sub_80A0CEC +sub_80A0CEC: @ 80A0CEC + ldr r1, _080A0D04 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0D08 + ldr r0, _080A0D0C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0D10 + ldr r0, _080A0D14 + str r0, [r1] + bx lr + .align 2, 0 +_080A0D04: .4byte 0x03000f3a +_080A0D08: .4byte 0x03000f3c +_080A0D0C: .4byte 0x03000f38 +_080A0D10: .4byte 0x03000f44 +_080A0D14: .4byte sub_80A10D0 + 1 + thumb_func_end sub_80A0CEC + + thumb_func_start sub_80A0D18 +sub_80A0D18: @ 80A0D18 + ldr r1, _080A0D30 + ldr r0, _080A0D34 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0D38 + ldr r0, _080A0D3C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0D40 + ldr r0, _080A0D44 + str r0, [r1] + bx lr + .align 2, 0 +_080A0D30: .4byte 0x03000f3a +_080A0D34: .4byte 0x03000f36 +_080A0D38: .4byte 0x03000f3c +_080A0D3C: .4byte 0x03000f38 +_080A0D40: .4byte 0x03000f44 +_080A0D44: .4byte sub_80A10E8 + 1 + thumb_func_end sub_80A0D18 + + thumb_func_start sub_80A0D48 +sub_80A0D48: @ 80A0D48 + ldr r1, _080A0D60 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0D64 + ldr r0, _080A0D68 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0D6C + ldr r0, _080A0D70 + str r0, [r1] + bx lr + .align 2, 0 +_080A0D60: .4byte 0x03000f3a +_080A0D64: .4byte 0x03000f3c +_080A0D68: .4byte 0x03000f38 +_080A0D6C: .4byte 0x03000f44 +_080A0D70: .4byte sub_80A115C + 1 + thumb_func_end sub_80A0D48 + + thumb_func_start sub_80A0D74 +sub_80A0D74: @ 80A0D74 + ldr r1, _080A0D8C + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0D90 + ldr r0, _080A0D94 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0D98 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0D8C: .4byte 0x03000f3a +_080A0D90: .4byte 0x03000f3c +_080A0D94: .4byte 0x03000f38 +_080A0D98: .4byte 0x03000f44 + thumb_func_end sub_80A0D74 + + thumb_func_start sub_80A0D9C +sub_80A0D9C: @ 80A0D9C + ldr r1, _080A0DB4 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0DB8 + ldr r0, _080A0DBC + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0DC0 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0DB4: .4byte 0x03000f3a +_080A0DB8: .4byte 0x03000f3c +_080A0DBC: .4byte 0x03000f38 +_080A0DC0: .4byte 0x03000f44 + thumb_func_end sub_80A0D9C + + thumb_func_start sub_80A0DC4 +sub_80A0DC4: @ 80A0DC4 + ldr r1, _080A0DDC + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0DE0 + ldr r0, _080A0DE4 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0DE8 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0DDC: .4byte 0x03000f3a +_080A0DE0: .4byte 0x03000f3c +_080A0DE4: .4byte 0x03000f38 +_080A0DE8: .4byte 0x03000f44 + thumb_func_end sub_80A0DC4 + + thumb_func_start sub_80A0DEC +sub_80A0DEC: @ 80A0DEC + ldr r1, _080A0E04 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0E08 + ldr r0, _080A0E0C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0E10 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0E04: .4byte 0x03000f3a +_080A0E08: .4byte 0x03000f3c +_080A0E0C: .4byte 0x03000f38 +_080A0E10: .4byte 0x03000f44 + thumb_func_end sub_80A0DEC + + thumb_func_start sub_80A0E14 +sub_80A0E14: @ 80A0E14 + ldr r1, _080A0E2C + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0E30 + ldr r0, _080A0E34 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0E38 + ldr r0, _080A0E3C + str r0, [r1] + bx lr + .align 2, 0 +_080A0E2C: .4byte 0x03000f3a +_080A0E30: .4byte 0x03000f3c +_080A0E34: .4byte 0x03000f38 +_080A0E38: .4byte 0x03000f44 +_080A0E3C: .4byte sub_80A1188 + 1 + thumb_func_end sub_80A0E14 + + thumb_func_start sub_80A0E40 +sub_80A0E40: @ 80A0E40 + ldr r1, _080A0E58 + ldr r0, _080A0E5C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0E60 + ldr r0, _080A0E64 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0E68 + ldr r0, _080A0E6C + str r0, [r1] + bx lr + .align 2, 0 +_080A0E58: .4byte 0x03000f3a +_080A0E5C: .4byte 0x03000f36 +_080A0E60: .4byte 0x03000f3c +_080A0E64: .4byte 0x03000f38 +_080A0E68: .4byte 0x03000f44 +_080A0E6C: .4byte sub_80A11FC + 1 + thumb_func_end sub_80A0E40 + + thumb_func_start sub_80A0E70 +sub_80A0E70: @ 80A0E70 + ldr r1, _080A0E88 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0E8C + ldr r0, _080A0E90 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0E94 + ldr r0, _080A0E98 + str r0, [r1] + bx lr + .align 2, 0 +_080A0E88: .4byte 0x03000f3a +_080A0E8C: .4byte 0x03000f3c +_080A0E90: .4byte 0x03000f38 +_080A0E94: .4byte 0x03000f44 +_080A0E98: .4byte sub_80A122C + 1 + thumb_func_end sub_80A0E70 + + thumb_func_start sub_80A0E9C +sub_80A0E9C: @ 80A0E9C + ldr r1, _080A0EB4 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0EB8 + ldr r0, _080A0EBC + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0EC0 + ldr r0, _080A0EC4 + str r0, [r1] + bx lr + .align 2, 0 +_080A0EB4: .4byte 0x03000f3a +_080A0EB8: .4byte 0x03000f3c +_080A0EBC: .4byte 0x03000f38 +_080A0EC0: .4byte 0x03000f44 +_080A0EC4: .4byte sub_80A127C + 1 + thumb_func_end sub_80A0E9C + + thumb_func_start sub_80A0EC8 +sub_80A0EC8: @ 80A0EC8 + ldr r1, _080A0EE0 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0EE4 + ldr r0, _080A0EE8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0EEC + ldr r0, _080A0EF0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0EE0: .4byte 0x03000f3a +_080A0EE4: .4byte 0x03000f3c +_080A0EE8: .4byte 0x03000f38 +_080A0EEC: .4byte 0x03000f44 +_080A0EF0: .4byte sub_80A1294 + 1 + thumb_func_end sub_80A0EC8 + + thumb_func_start sub_80A0EF4 +sub_80A0EF4: @ 80A0EF4 + ldr r1, _080A0F08 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0F0C + movs r0, 0x80 + strh r0, [r1] + ldr r1, _080A0F10 + ldr r0, _080A0F14 + str r0, [r1] + bx lr + .align 2, 0 +_080A0F08: .4byte 0x03000f3a +_080A0F0C: .4byte 0x03000f3c +_080A0F10: .4byte 0x03000f44 +_080A0F14: .4byte sub_80A1244 + 1 + thumb_func_end sub_80A0EF4 + + thumb_func_start Tileset28AnimationHeader +Tileset28AnimationHeader: @ 80A0F18 + ldr r1, _080A0F2C + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0F30 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, _080A0F34 + ldr r0, _080A0F38 + str r0, [r1] + bx lr + .align 2, 0 +_080A0F2C: .4byte 0x03000f3a +_080A0F30: .4byte 0x03000f3c +_080A0F34: .4byte 0x03000f44 +_080A0F38: .4byte sub_80A15D8 + 1 + thumb_func_end Tileset28AnimationHeader + + thumb_func_start sub_80A0F3C +sub_80A0F3C: @ 80A0F3C + ldr r1, _080A0F54 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0F58 + ldr r0, _080A0F5C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0F60 + ldr r0, _080A0F64 + str r0, [r1] + bx lr + .align 2, 0 +_080A0F54: .4byte 0x03000f3a +_080A0F58: .4byte 0x03000f3c +_080A0F5C: .4byte 0x03000f38 +_080A0F60: .4byte 0x03000f44 +_080A0F64: .4byte sub_80A1260 + 1 + thumb_func_end sub_80A0F3C + + thumb_func_start sub_80A0F68 +sub_80A0F68: @ 80A0F68 + ldr r1, _080A0F7C + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0F80 + movs r0, 0x80 + strh r0, [r1] + ldr r1, _080A0F84 + ldr r0, _080A0F88 + str r0, [r1] + bx lr + .align 2, 0 +_080A0F7C: .4byte 0x03000f3a +_080A0F80: .4byte 0x03000f3c +_080A0F84: .4byte 0x03000f44 +_080A0F88: .4byte sub_80A15F0 + 1 + thumb_func_end sub_80A0F68 + + thumb_func_start sub_80A0F8C +sub_80A0F8C: @ 80A0F8C + ldr r1, _080A0FA4 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0FA8 + ldr r0, _080A0FAC + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0FB0 + ldr r0, _080A0FB4 + str r0, [r1] + bx lr + .align 2, 0 +_080A0FA4: .4byte 0x03000f3a +_080A0FA8: .4byte 0x03000f3c +_080A0FAC: .4byte 0x03000f38 +_080A0FB0: .4byte 0x03000f44 +_080A0FB4: .4byte sub_80A15C0 + 1 + thumb_func_end sub_80A0F8C + + thumb_func_start sub_80A0FB8 +sub_80A0FB8: @ 80A0FB8 + ldr r1, _080A0FD0 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A0FD4 + ldr r0, _080A0FD8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A0FDC + ldr r0, _080A0FE0 + str r0, [r1] + bx lr + .align 2, 0 +_080A0FD0: .4byte 0x03000f3a +_080A0FD4: .4byte 0x03000f3c +_080A0FD8: .4byte 0x03000f38 +_080A0FDC: .4byte 0x03000f44 +_080A0FE0: .4byte sub_80A161C + 1 + thumb_func_end sub_80A0FB8 + + thumb_func_start sub_80A0FE4 +sub_80A0FE4: @ 80A0FE4 + ldr r1, _080A0FFC + movs r0, 0 + strh r0, [r1] + ldr r1, _080A1000 + ldr r0, _080A1004 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A1008 + ldr r0, _080A100C + str r0, [r1] + bx lr + .align 2, 0 +_080A0FFC: .4byte 0x03000f3a +_080A1000: .4byte 0x03000f3c +_080A1004: .4byte 0x03000f38 +_080A1008: .4byte 0x03000f44 +_080A100C: .4byte sub_80A1634 + 1 + thumb_func_end sub_80A0FE4 + + thumb_func_start sub_80A1010 +sub_80A1010: @ 80A1010 + ldr r1, _080A1028 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A102C + ldr r0, _080A1030 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _080A1034 + ldr r0, _080A1038 + str r0, [r1] + bx lr + .align 2, 0 +_080A1028: .4byte 0x03000f3a +_080A102C: .4byte 0x03000f3c +_080A1030: .4byte 0x03000f38 +_080A1034: .4byte 0x03000f44 +_080A1038: .4byte sub_80A1658 + 1 + thumb_func_end sub_80A1010 + + thumb_func_start sub_80A103C +sub_80A103C: @ 80A103C + push {r4-r6,lr} + lsls r5, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r5 + lsrs r6, r0, 16 + cmp r6, 0 + bne _080A105C + lsrs r4, r5, 19 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A1434 + adds r0, r4, 0 + bl sub_80A1470 +_080A105C: + cmp r6, 0x1 + bne _080A1068 + lsrs r0, r5, 19 + movs r1, 0x1 + bl sub_80A1434 +_080A1068: + cmp r6, 0x2 + bne _080A1074 + lsrs r0, r5, 19 + movs r1, 0x2 + bl sub_80A1434 +_080A1074: + cmp r6, 0x3 + bne _080A1080 + lsrs r0, r5, 19 + movs r1, 0x3 + bl sub_80A1434 +_080A1080: + cmp r6, 0x4 + bne _080A108C + lsrs r0, r5, 19 + movs r1, 0x4 + bl sub_80A1434 +_080A108C: + cmp r6, 0x5 + bne _080A1098 + lsrs r0, r5, 19 + movs r1, 0x5 + bl sub_80A1434 +_080A1098: + cmp r6, 0x6 + bne _080A10A4 + lsrs r0, r5, 19 + movs r1, 0x6 + bl sub_80A1434 +_080A10A4: + cmp r6, 0x7 + bne _080A10B0 + lsrs r0, r5, 19 + movs r1, 0x7 + bl sub_80A1434 +_080A10B0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A103C + + thumb_func_start sub_80A10B8 +sub_80A10B8: @ 80A10B8 + push {lr} + lsls r1, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + bne _080A10CC + lsrs r0, r1, 19 + bl sub_80A1520 +_080A10CC: + pop {r0} + bx r0 + thumb_func_end sub_80A10B8 + + thumb_func_start sub_80A10D0 +sub_80A10D0: @ 80A10D0 + push {lr} + lsls r1, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + bne _080A10E4 + lsrs r0, r1, 20 + bl sub_80A1598 +_080A10E4: + pop {r0} + bx r0 + thumb_func_end sub_80A10D0 + + thumb_func_start sub_80A10E8 +sub_80A10E8: @ 80A10E8 + push {r4,r5,lr} + lsls r4, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r4 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080A1100 + lsrs r0, r4, 19 + movs r1, 0 + bl sub_80A1394 +_080A1100: + cmp r5, 0x1 + bne _080A110C + lsrs r0, r4, 19 + movs r1, 0x1 + bl sub_80A1394 +_080A110C: + cmp r5, 0x2 + bne _080A1118 + lsrs r0, r4, 19 + movs r1, 0x2 + bl sub_80A1394 +_080A1118: + cmp r5, 0x3 + bne _080A1124 + lsrs r0, r4, 19 + movs r1, 0x3 + bl sub_80A1394 +_080A1124: + cmp r5, 0x4 + bne _080A1130 + lsrs r0, r4, 19 + movs r1, 0x4 + bl sub_80A1394 +_080A1130: + cmp r5, 0x5 + bne _080A113C + lsrs r0, r4, 19 + movs r1, 0x5 + bl sub_80A1394 +_080A113C: + cmp r5, 0x6 + bne _080A1148 + lsrs r0, r4, 19 + movs r1, 0x6 + bl sub_80A1394 +_080A1148: + cmp r5, 0x7 + bne _080A1154 + lsrs r0, r4, 19 + movs r1, 0x7 + bl sub_80A1394 +_080A1154: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A10E8 + + thumb_func_start sub_80A115C +sub_80A115C: @ 80A115C + push {r4,r5,lr} + lsls r4, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r4 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080A1176 + lsrs r0, r4, 20 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A12D4 +_080A1176: + cmp r5, 0x1 + bne _080A1180 + lsrs r0, r4, 20 + bl sub_80A1498 +_080A1180: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A115C + + thumb_func_start sub_80A1188 +sub_80A1188: @ 80A1188 + push {r4,r5,lr} + lsls r4, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r4 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080A11A0 + lsrs r0, r4, 19 + movs r1, 0 + bl sub_80A14C0 +_080A11A0: + cmp r5, 0x1 + bne _080A11AC + lsrs r0, r4, 19 + movs r1, 0x1 + bl sub_80A14C0 +_080A11AC: + cmp r5, 0x2 + bne _080A11B8 + lsrs r0, r4, 19 + movs r1, 0x2 + bl sub_80A14C0 +_080A11B8: + cmp r5, 0x3 + bne _080A11C4 + lsrs r0, r4, 19 + movs r1, 0x3 + bl sub_80A14C0 +_080A11C4: + cmp r5, 0x4 + bne _080A11D0 + lsrs r0, r4, 19 + movs r1, 0x4 + bl sub_80A14C0 +_080A11D0: + cmp r5, 0x5 + bne _080A11DC + lsrs r0, r4, 19 + movs r1, 0x5 + bl sub_80A14C0 +_080A11DC: + cmp r5, 0x6 + bne _080A11E8 + lsrs r0, r4, 19 + movs r1, 0x6 + bl sub_80A14C0 +_080A11E8: + cmp r5, 0x7 + bne _080A11F4 + lsrs r0, r4, 19 + movs r1, 0x7 + bl sub_80A14C0 +_080A11F4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A1188 + + thumb_func_start sub_80A11FC +sub_80A11FC: @ 80A11FC + push {r4,r5,lr} + lsls r4, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r4 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080A1216 + lsrs r0, r4, 20 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A131C +_080A1216: + cmp r5, 0x1 + bne _080A1224 + lsrs r0, r4, 20 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A136C +_080A1224: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A11FC + + thumb_func_start sub_80A122C +sub_80A122C: @ 80A122C + push {lr} + lsls r1, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + bne _080A1240 + lsrs r0, r1, 20 + bl sub_80A1798 +_080A1240: + pop {r0} + bx r0 + thumb_func_end sub_80A122C + + thumb_func_start sub_80A1244 +sub_80A1244: @ 80A1244 + push {lr} + lsls r1, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + bne _080A125C + lsrs r0, r1, 20 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A1344 +_080A125C: + pop {r0} + bx r0 + thumb_func_end sub_80A1244 + + thumb_func_start sub_80A1260 +sub_80A1260: @ 80A1260 + push {lr} + lsls r1, r0, 16 + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + lsrs r0, 16 + cmp r0, 0x1 + bne _080A1276 + lsrs r0, r1, 20 + bl sub_80A14F8 +_080A1276: + pop {r0} + bx r0 + thumb_func_end sub_80A1260 + + thumb_func_start sub_80A127C +sub_80A127C: @ 80A127C + push {lr} + lsls r1, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + bne _080A1290 + lsrs r0, r1, 19 + bl sub_80A1548 +_080A1290: + pop {r0} + bx r0 + thumb_func_end sub_80A127C + + thumb_func_start sub_80A1294 +sub_80A1294: @ 80A1294 + push {lr} + lsls r1, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + bne _080A12A8 + lsrs r0, r1, 19 + bl sub_80A1570 +_080A12A8: + pop {r0} + bx r0 + thumb_func_end sub_80A1294 + + thumb_func_start sub_80A12AC +sub_80A12AC: @ 80A12AC + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A12CC + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A12D0 + movs r2, 0xA0 + lsls r2, 1 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A12CC: .4byte 0x08513684 +_080A12D0: .4byte 0x06003c00 + thumb_func_end sub_80A12AC + + thumb_func_start sub_80A12D4 +sub_80A12D4: @ 80A12D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 + ands r0, r4 + ldr r5, _080A1310 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + ldr r1, _080A1314 + movs r2, 0x80 + bl sub_80A0980 + adds r1, r4, 0x2 + adds r0, r1, 0 + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 22 + adds r0, r5 + ldr r0, [r0] + ldr r1, _080A1318 + movs r2, 0x80 + bl sub_80A0980 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A1310: .4byte 0x08513894 +_080A1314: .4byte 0x06006400 +_080A1318: .4byte 0x06006480 + thumb_func_end sub_80A12D4 + + thumb_func_start sub_80A131C +sub_80A131C: @ 80A131C + push {lr} + lsls r0, 24 + movs r1, 0xC0 + lsls r1, 18 + ands r1, r0 + ldr r0, _080A133C + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A1340 + movs r2, 0xF0 + lsls r2, 2 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A133C: .4byte 0x085143e4 +_080A1340: .4byte 0x06007a00 + thumb_func_end sub_80A131C + + thumb_func_start sub_80A1344 +sub_80A1344: @ 80A1344 + push {lr} + lsls r0, 24 + movs r1, 0xC0 + lsls r1, 18 + ands r1, r0 + ldr r0, _080A1364 + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A1368 + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1364: .4byte 0x085145f4 +_080A1368: .4byte 0x06007e00 + thumb_func_end sub_80A1344 + + thumb_func_start sub_80A136C +sub_80A136C: @ 80A136C + push {lr} + lsls r0, 24 + movs r1, 0xE0 + lsls r1, 19 + ands r1, r0 + ldr r0, _080A138C + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A1390 + movs r2, 0x80 + lsls r2, 1 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A138C: .4byte 0x08514e04 +_080A1390: .4byte 0x06007e00 + thumb_func_end sub_80A136C + + thumb_func_start sub_80A1394 +sub_80A1394: @ 80A1394 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + subs r0, r5, r6 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xB + bhi _080A13F0 + adds r0, r5, 0 + movs r1, 0xC + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + ldr r0, _080A13E0 + lsrs r4, 14 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, _080A13E4 + lsls r5, r6, 2 + adds r1, r5, r1 + ldr r1, [r1] + movs r2, 0x80 + bl sub_80A0980 + ldr r0, _080A13E8 + adds r4, r0 + ldr r0, [r4] + ldr r1, _080A13EC + adds r5, r1 + ldr r1, [r5] + movs r2, 0x80 + bl sub_80A0980 + b _080A141C + .align 2, 0 +_080A13E0: .4byte 0x08515384 +_080A13E4: .4byte 0x08515344 +_080A13E8: .4byte 0x085153b4 +_080A13EC: .4byte 0x08515364 +_080A13F0: + movs r0, 0x3 + ands r5, r0 + ldr r0, _080A1424 + lsls r5, 2 + adds r0, r5, r0 + ldr r0, [r0] + ldr r1, _080A1428 + lsls r4, r6, 2 + adds r1, r4, r1 + ldr r1, [r1] + movs r2, 0x80 + bl sub_80A0980 + ldr r0, _080A142C + adds r5, r0 + ldr r0, [r5] + ldr r1, _080A1430 + adds r4, r1 + ldr r1, [r4] + movs r2, 0x80 + bl sub_80A0980 +_080A141C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A1424: .4byte 0x085153e4 +_080A1428: .4byte 0x08515344 +_080A142C: .4byte 0x085153f4 +_080A1430: .4byte 0x08515364 + thumb_func_end sub_80A1394 + + thumb_func_start sub_80A1434 +sub_80A1434: @ 80A1434 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + subs r0, r3 + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + ldr r0, _080A1468 + lsrs r1, 14 + adds r1, r0 + ldr r2, [r1] + cmp r2, 0 + beq _080A1464 + ldr r0, _080A146C + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0x80 + bl sub_80A0980 +_080A1464: + pop {r0} + bx r0 + .align 2, 0 +_080A1468: .4byte 0x08515824 +_080A146C: .4byte 0x08515804 + thumb_func_end sub_80A1434 + + thumb_func_start sub_80A1470 +sub_80A1470: @ 80A1470 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + ldr r1, _080A1490 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A1494 + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1490: .4byte 0x08515964 +_080A1494: .4byte 0x06007800 + thumb_func_end sub_80A1470 + + thumb_func_start sub_80A1498 +sub_80A1498: @ 80A1498 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A14B8 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A14BC + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A14B8: .4byte 0x08515d8c +_080A14BC: .4byte 0x06005400 + thumb_func_end sub_80A1498 + + thumb_func_start sub_80A14C0 +sub_80A14C0: @ 80A14C0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1 + lsls r0, 16 + movs r2, 0xE0 + lsls r2, 11 + ands r2, r0 + ldr r0, _080A14F0 + lsrs r2, 14 + adds r2, r0 + ldr r0, [r2] + ldr r2, _080A14F4 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A14F0: .4byte 0x085161dc +_080A14F4: .4byte 0x085161bc + thumb_func_end sub_80A14C0 + + thumb_func_start sub_80A14F8 +sub_80A14F8: @ 80A14F8 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A1518 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A151C + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1518: .4byte 0x08515d8c +_080A151C: .4byte 0x06007400 + thumb_func_end sub_80A14F8 + + thumb_func_start sub_80A1520 +sub_80A1520: @ 80A1520 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A1540 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A1544 + movs r2, 0xC0 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1540: .4byte 0x085164fc +_080A1544: .4byte 0x06005540 + thumb_func_end sub_80A1520 + + thumb_func_start sub_80A1548 +sub_80A1548: @ 80A1548 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A1568 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A156C + movs r2, 0xC0 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1568: .4byte 0x0851680c +_080A156C: .4byte 0x06005b40 + thumb_func_end sub_80A1548 + + thumb_func_start sub_80A1570 +sub_80A1570: @ 80A1570 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A1590 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A1594 + movs r2, 0xC0 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1590: .4byte 0x08516b1c +_080A1594: .4byte 0x06005b40 + thumb_func_end sub_80A1570 + + thumb_func_start sub_80A1598 +sub_80A1598: @ 80A1598 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A15B8 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A15BC + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A15B8: .4byte 0x08516d2c +_080A15BC: .4byte 0x06005c00 + thumb_func_end sub_80A1598 + + thumb_func_start sub_80A15C0 +sub_80A15C0: @ 80A15C0 + push {lr} + lsls r2, r0, 16 + lsrs r0, r2, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A15D4 + lsrs r0, r2, 17 + bl sub_80A1748 +_080A15D4: + pop {r0} + bx r0 + thumb_func_end sub_80A15C0 + + thumb_func_start sub_80A15D8 +sub_80A15D8: @ 80A15D8 + push {lr} + lsls r1, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + bne _080A15EC + lsrs r0, r1, 19 + bl sub_80A16B0 +_080A15EC: + pop {r0} + bx r0 + thumb_func_end sub_80A15D8 + + thumb_func_start sub_80A15F0 +sub_80A15F0: @ 80A15F0 + push {r4,r5,lr} + lsls r4, r0, 16 + lsrs r0, r4, 16 + adds r5, r0, 0 + movs r0, 0x3F + ands r0, r5 + cmp r0, 0x1 + bne _080A1606 + lsrs r0, r4, 22 + bl sub_80A1720 +_080A1606: + movs r0, 0x7 + ands r0, r5 + cmp r0, 0x1 + bne _080A1614 + lsrs r0, r4, 19 + bl sub_80A16F8 +_080A1614: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A15F0 + + thumb_func_start sub_80A161C +sub_80A161C: @ 80A161C + push {lr} + lsls r1, r0, 16 + movs r0, 0xC0 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + bne _080A1630 + lsrs r0, r1, 18 + bl sub_80A1770 +_080A1630: + pop {r0} + bx r0 + thumb_func_end sub_80A161C + + thumb_func_start sub_80A1634 +sub_80A1634: @ 80A1634 + push {r4,lr} + lsls r4, r0, 16 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r4 + cmp r0, 0 + bne _080A1650 + lsrs r4, 19 + adds r0, r4, 0 + bl sub_80A17C0 + adds r0, r4, 0 + bl sub_80A17EC +_080A1650: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A1634 + + thumb_func_start sub_80A1658 +sub_80A1658: @ 80A1658 + push {lr} + lsls r1, r0, 16 + movs r0, 0xC0 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + bne _080A166C + lsrs r0, r1, 18 + bl sub_80A1818 +_080A166C: + pop {r0} + bx r0 + thumb_func_end sub_80A1658 + + thumb_func_start sub_80A1670 +sub_80A1670: @ 80A1670 + push {lr} + lsls r1, r0, 16 + movs r0, 0xC0 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + bne _080A1684 + lsrs r0, r1, 18 + bl sub_80A1884 +_080A1684: + pop {r0} + bx r0 + thumb_func_end sub_80A1670 + + thumb_func_start sub_80A1688 +sub_80A1688: @ 80A1688 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + ldr r1, _080A16A8 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A16AC + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A16A8: .4byte 0x08516e3c +_080A16AC: .4byte 0x06003e00 + thumb_func_end sub_80A1688 + + thumb_func_start sub_80A16B0 +sub_80A16B0: @ 80A16B0 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + ldr r0, _080A16E8 + lsrs r4, 14 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, _080A16EC + movs r2, 0xC0 + lsls r2, 1 + bl sub_80A0980 + ldr r0, _080A16F0 + adds r4, r0 + ldr r0, [r4] + ldr r1, _080A16F4 + movs r2, 0xA0 + lsls r2, 2 + bl sub_80A0980 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A16E8: .4byte 0x08517a44 +_080A16EC: .4byte 0x06007e00 +_080A16F0: .4byte 0x08517a50 +_080A16F4: .4byte 0x06007a00 + thumb_func_end sub_80A16B0 + + thumb_func_start sub_80A16F8 +sub_80A16F8: @ 80A16F8 + push {lr} + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + ldr r0, _080A1718 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A171C + movs r2, 0x20 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1718: .4byte 0x08517bfc +_080A171C: .4byte 0x06007f00 + thumb_func_end sub_80A16F8 + + thumb_func_start sub_80A1720 +sub_80A1720: @ 80A1720 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + ldr r1, _080A1740 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A1744 + movs r2, 0x80 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1740: .4byte 0x08517c0c +_080A1744: .4byte 0x06007c00 + thumb_func_end sub_80A1720 + + thumb_func_start sub_80A1748 +sub_80A1748: @ 80A1748 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + ldr r1, _080A1768 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A176C + movs r2, 0x80 + lsls r2, 2 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1768: .4byte 0x08518034 +_080A176C: .4byte 0x06005200 + thumb_func_end sub_80A1748 + + thumb_func_start sub_80A1770 +sub_80A1770: @ 80A1770 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + ldr r1, _080A1790 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A1794 + movs r2, 0x90 + lsls r2, 1 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1790: .4byte 0x0851829c +_080A1794: .4byte 0x06007e00 + thumb_func_end sub_80A1770 + + thumb_func_start sub_80A1798 +sub_80A1798: @ 80A1798 + push {lr} + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + ldr r0, _080A17B8 + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + ldr r1, _080A17BC + movs r2, 0xC0 + lsls r2, 4 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A17B8: .4byte 0x085202c4 +_080A17BC: .4byte 0x06005e00 + thumb_func_end sub_80A1798 + + thumb_func_start sub_80A17C0 +sub_80A17C0: @ 80A17C0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + ldr r1, _080A17E4 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A17E8 + movs r2, 0x80 + lsls r2, 1 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A17E4: .4byte 0x08524864 +_080A17E8: .4byte 0x060052e0 + thumb_func_end sub_80A17C0 + + thumb_func_start sub_80A17EC +sub_80A17EC: @ 80A17EC + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + ldr r1, _080A1810 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A1814 + movs r2, 0x80 + lsls r2, 1 + bl sub_80A0980 + pop {r0} + bx r0 + .align 2, 0 +_080A1810: .4byte 0x08524870 +_080A1814: .4byte 0x060050e0 + thumb_func_end sub_80A17EC + + thumb_func_start sub_80A1818 +sub_80A1818: @ 80A1818 + push {lr} + lsls r0, 16 + ldr r2, _080A1868 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 14 + adds r1, r2 + ldr r0, [r1] + ldr r1, _080A186C + movs r2, 0x10 + bl CpuSet + ldr r0, _080A1870 + ldrh r2, [r0, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r0, 0x6] + lsls r3, 17 + lsrs r3, 17 + movs r0, 0x80 + movs r1, 0x10 + bl pal_fade_1 + ldr r0, _080A1874 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080A1862 + ldr r1, _080A1878 + ldr r0, _080A187C + str r0, [r1] + ldr r1, _080A1880 + movs r0, 0x20 + strh r0, [r1] +_080A1862: + pop {r0} + bx r0 + .align 2, 0 +_080A1868: .4byte 0x0852487c +_080A186C: .4byte 0x02037814 +_080A1870: .4byte 0x02037fd4 +_080A1874: .4byte sub_8149DFC + 1 +_080A1878: .4byte 0x03000f44 +_080A187C: .4byte sub_80A1670 + 1 +_080A1880: .4byte 0x03000f3c + thumb_func_end sub_80A1818 + + thumb_func_start sub_80A1884 +sub_80A1884: @ 80A1884 + push {lr} + lsls r0, 16 + ldr r2, _080A18DC + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 14 + adds r1, r2 + ldr r0, [r1] + ldr r1, _080A18E0 + movs r2, 0x10 + bl CpuSet + ldr r0, _080A18E4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080A18D6 + ldr r0, _080A18E8 + ldrh r2, [r0, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r0, 0x6] + lsls r3, 17 + lsrs r3, 17 + movs r0, 0x80 + movs r1, 0x10 + bl pal_fade_1 + ldr r1, _080A18EC + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _080A18D6 + ldr r0, _080A18F0 + str r1, [r0] +_080A18D6: + pop {r0} + bx r0 + .align 2, 0 +_080A18DC: .4byte 0x0852487c +_080A18E0: .4byte 0x02037814 +_080A18E4: .4byte sub_8149DFC + 1 +_080A18E8: .4byte 0x02037fd4 +_080A18EC: .4byte 0x03000f3c +_080A18F0: .4byte 0x03000f44 + thumb_func_end sub_80A1884 + + thumb_func_start decompress_palette +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, _080A192C + adds r1, r6, 0 + bl call_LZZUnCompWram + lsls r4, 1 + ldr r1, _080A1930 + adds r1, r4, r1 + lsrs r5, 17 + adds r0, r6, 0 + adds r2, r5, 0 + bl CpuSet + ldr r0, _080A1934 + adds r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A192C: .4byte 0x02037fe8 +_080A1930: .4byte 0x02037714 +_080A1934: .4byte 0x02037b14 + thumb_func_end decompress_palette + + thumb_func_start gpu_pal_apply +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, _080A1968 + adds r1, r4, r1 + lsrs r5, 17 + adds r2, r5, 0 + bl CpuSet + ldr r0, _080A196C + adds r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A1968: .4byte 0x02037714 +_080A196C: .4byte 0x02037b14 + 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, _080A19B8 + 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, _080A19BC + adds r4, r1 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A19B8: .4byte 0x02037714 +_080A19BC: .4byte 0x02037b14 + thumb_func_end rboxid_80040B8 + + thumb_func_start copy_pal_bg_faded_to_pal_ram +copy_pal_bg_faded_to_pal_ram: @ 80A19C0 + push {r4,r5,lr} + ldr r4, _080A1A08 + 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, _080A1A0C + movs r2, 0xA0 + lsls r2, 19 + ldr r0, _080A1A10 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _080A1A14 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r0, _080A1A18 + 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 + .align 2, 0 +_080A1A08: .4byte 0x02037fd4 +_080A1A0C: .4byte 0x02037b14 +_080A1A10: .4byte 0x040000d4 +_080A1A14: .4byte 0x80000200 +_080A1A18: .4byte 0x02037fe4 + thumb_func_end copy_pal_bg_faded_to_pal_ram + + thumb_func_start fade_and_return_progress_probably +fade_and_return_progress_probably: @ 80A1A1C + push {lr} + ldr r0, _080A1A2C + ldr r0, [r0] + cmp r0, 0 + beq _080A1A30 + movs r0, 0xFF + b _080A1A68 + .align 2, 0 +_080A1A2C: .4byte 0x02037fe4 +_080A1A30: + ldr r0, _080A1A44 + ldrb r0, [r0, 0x9] + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _080A1A48 + bl pal_fade__0 + b _080A1A56 + .align 2, 0 +_080A1A44: .4byte 0x02037fd4 +_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, _080A1A6C + ldr r0, _080A1A70 + ldr r0, [r0] + movs r1, 0 + orrs r0, r1 + str r0, [r2] + adds r0, r3, 0 +_080A1A68: + pop {r1} + bx r1 + .align 2, 0 +_080A1A6C: .4byte 0x02037fe4 +_080A1A70: .4byte 0x02037fd4 + 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, _080A1AC8 + ldr r6, _080A1ACC + ldr r5, _080A1AD0 +_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 + .align 2, 0 +_080A1AC8: .4byte 0x02037714 +_080A1ACC: .4byte 0x02037b14 +_080A1AD0: .4byte 0x000001ff + thumb_func_end sub_80A1A94 + + thumb_func_start sub_80A1AD4 +sub_80A1AD4: @ 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, _080A1B04 + ldrb r1, [r5, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1B08 + movs r0, 0 + b _080A1C00 + .align 2, 0 +_080A1B04: .4byte 0x02037fd4 +_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, _080A1BA4 + 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, _080A1BA8 + mov r0, r8 + ands r1, r0 + ldrh r2, [r5, 0x6] + ldr r0, _080A1BAC + 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 + .align 2, 0 +_080A1BA4: .4byte 0xfffff83f +_080A1BA8: .4byte 0x00007fff +_080A1BAC: .4byte 0xffff8000 +_080A1BB0: + movs r0, 0x40 + orrs r3, r0 +_080A1BB4: + strb r3, [r5, 0x8] + bl fade_and_return_progress_probably + ldr r4, _080A1C0C + ldrb r1, [r4, 0x8] + lsrs r5, r1, 7 + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x8] + ldr r0, _080A1C10 + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _080A1C14 + bl CpuSet + ldr r1, _080A1C18 + 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, _080A1C0C + 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 + .align 2, 0 +_080A1C0C: .4byte 0x02037fd4 +_080A1C10: .4byte 0x02037b14 +_080A1C14: .4byte 0x04000100 +_080A1C18: .4byte 0x02037fe4 + thumb_func_end sub_80A1AD4 + + 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 sub_80A1AD4 + 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, _080A1CBC + 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 + .align 2, 0 +_080A1CBC: .4byte 0x02037f14 +_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, _080A1D68 + mov r12, r0 + ldr r7, _080A1D6C +_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, _080A1D70 + ands r1, r0 + lsls r1, 11 + ldr r0, _080A1D74 + 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 + .align 2, 0 +_080A1D68: .4byte 0x02037714 +_080A1D6C: .4byte 0x02037b14 +_080A1D70: .4byte 0x000003ff +_080A1D74: .4byte 0xffe007ff +_080A1D78: + lsrs r0, r2, 27 + cmp r6, r0 + bcs _080A1DC4 + ldr r3, _080A1E30 +_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, _080A1E34 + ands r1, r0 + lsls r1, 11 + ldr r0, _080A1E38 + 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, _080A1E38 + 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, _080A1E3C + 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 + .align 2, 0 +_080A1E30: .4byte 0x02037b14 +_080A1E34: .4byte 0x000003ff +_080A1E38: .4byte 0xffe007ff +_080A1E3C: .4byte 0xfffff01f + thumb_func_end sub_80A1CDC + + thumb_func_start sub_80A1E40 +sub_80A1E40: @ 80A1E40 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r3, _080A1E98 + 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 + .align 2, 0 +_080A1E98: .4byte 0x02037fd4 +_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, _080A1EFC +_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 + .align 2, 0 +_080A1EFC: .4byte 0x02037b14 + 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, _080A1F38 + 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, _080A1F3C + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x4] + b _080A1F54 + .align 2, 0 +_080A1F38: .4byte 0xfffff01f +_080A1F3C: .4byte 0xffe007ff +_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, _080A1FBC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, _080A1FC0 + 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, _080A1FC4 + ands r0, r2 + strh r0, [r1, 0x4] + ldr r0, [r1, 0x4] + ldr r2, _080A1FC8 + ands r0, r2 + str r0, [r1, 0x4] + ldrh r2, [r1, 0x6] + ldr r0, _080A1FCC + 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 + .align 2, 0 +_080A1FBC: .4byte 0x02037f14 +_080A1FC0: .4byte 0x0852488c +_080A1FC4: .4byte 0xfffff803 +_080A1FC8: .4byte 0xffe007ff +_080A1FCC: .4byte 0xfffff01f + thumb_func_end palslot_dead_struct_update + + thumb_func_start pal_fade_control_reset_maybe +pal_fade_control_reset_maybe: @ 80A1FD0 + ldr r2, _080A2038 + 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, _080A203C + 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, _080A2040 + 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, _080A2044 + 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 + .align 2, 0 +_080A2038: .4byte 0x02037fd4 +_080A203C: .4byte 0xfffff83f +_080A2040: .4byte 0xffff8000 +_080A2044: .4byte 0xfffe0fff + 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, _080A2070 + 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 + .align 2, 0 +_080A2070: .4byte 0x02037f14 + 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, _080A20A0 + 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 + .align 2, 0 +_080A20A0: .4byte 0x02037f14 + 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, _080A20C4 +_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 + .align 2, 0 +_080A20C4: .4byte 0x02037f14 +_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, _080A20EC + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A20F0 + movs r0, 0 + b _080A220C + .align 2, 0 +_080A20EC: .4byte 0x02037fd4 +_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, _080A2148 + ldrb r1, [r2, 0xA] + movs r0, 0x4 + ands r0, r1 + adds r7, r2, 0 + cmp r0, 0 + bne _080A214C + ldrh r4, [r7] + b _080A2152 + .align 2, 0 +_080A2148: .4byte 0x02037fd4 +_080A214C: + ldrh r4, [r7, 0x2] + movs r5, 0x80 + lsls r5, 1 +_080A2152: + cmp r4, 0 + beq _080A2184 + ldr r7, _080A21C0 + 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 + .align 2, 0 +_080A21C0: .4byte 0x02037fd4 +_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, _080A2214 + 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 + .align 2, 0 +_080A2214: .4byte 0xfffff83f + 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, _080A225C +_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 + .align 2, 0 +_080A225C: .4byte 0x02037b14 + 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, _080A232C + 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, _080A2330 + 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 + .align 2, 0 +_080A232C: .4byte 0x02037b14 +_080A2330: .4byte 0xfffffc1f + 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, _080A2388 + mov r8, r0 + ldr r0, _080A238C + 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 + .align 2, 0 +_080A2388: .4byte 0x02037b14 +_080A238C: .4byte 0x02037714 + thumb_func_end sub_80A2334 + + thumb_func_start sub_80A2390 +sub_80A2390: @ 80A2390 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080A23B0 + 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 + .align 2, 0 +_080A23B0: .4byte 0x02037fd4 + 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, _080A2428 + 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, _080A242C + ldr r2, _080A2430 + mov r0, sp + bl CpuSet +_080A2406: + cmp r4, 0 + bne _080A241C + mov r0, sp + adds r0, 0x2 + ldr r2, _080A2434 + adds r1, r2, 0 + strh r1, [r0] + ldr r1, _080A242C + ldr r2, _080A2430 + bl CpuSet +_080A241C: + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A2428: .4byte 0x02037fd4 +_080A242C: .4byte 0x02037b14 +_080A2430: .4byte 0x01000200 +_080A2434: .4byte 0x00007fff + 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, _080A2454 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A2458 + movs r0, 0 + b _080A2792 + .align 2, 0 +_080A2454: .4byte 0x02037fd4 +_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, _080A249C + 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 + .align 2, 0 +_080A249C: .4byte 0x02037fd4 +_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, _080A253C + 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, _080A2540 + 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 + .align 2, 0 +_080A253C: .4byte 0x02037714 +_080A2540: .4byte 0x02037b14 +_080A2544: + adds r7, r2, 0 + cmp r7, r10 + bcc _080A254C + b _080A2694 +_080A254C: + lsls r1, r7, 1 + ldr r0, _080A25A4 + 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 + .align 2, 0 +_080A25A4: .4byte 0x02037b14 +_080A25A8: + adds r7, r2, 0 + cmp r7, r10 + bcs _080A2694 +_080A25AE: + lsls r2, r7, 1 + ldr r0, _080A2628 + 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, _080A262C + 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 + .align 2, 0 +_080A2628: .4byte 0x02037714 +_080A262C: .4byte 0x02037b14 +_080A2630: + adds r7, r2, 0 + cmp r7, r10 + bcs _080A2694 + ldr r4, _080A26BC + 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, _080A26C0 + 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, _080A26C0 + strb r3, [r1, 0xA] + movs r0, 0x4 + ands r0, r3 + cmp r0, 0 + beq _080A26C4 + ldrb r0, [r1, 0x7] + b _080A2790 + .align 2, 0 +_080A26BC: .4byte 0x02037b14 +_080A26C0: .4byte 0x02037fd4 +_080A26C4: + ldr r2, _080A26E0 + 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, _080A26E4 + ands r0, r4 + ldr r3, _080A26E0 + strh r0, [r3, 0x4] + b _080A26FE + .align 2, 0 +_080A26E0: .4byte 0x02037fd4 +_080A26E4: .4byte 0xfffff83f +_080A26E8: + lsrs r1, r5, 27 + lsrs r0, r2, 28 + subs r1, r0 + movs r0, 0x1F + ands r1, r0 + lsls r1, 6 + ldr r0, _080A2724 + ands r0, r4 + orrs r0, r1 + ldr r4, _080A2728 + strh r0, [r4, 0x4] +_080A26FE: + ldr r1, _080A2728 + ldrh r0, [r1, 0x4] + movs r1, 0xF8 + lsls r1, 3 + ands r1, r0 + cmp r1, 0 + bne _080A278C + ldr r2, _080A2728 + 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 + .align 2, 0 +_080A2724: .4byte 0xfffff83f +_080A2728: .4byte 0x02037fd4 +_080A272C: + cmp r0, 0x2 + beq _080A2736 + cmp r0, 0x3 + beq _080A276C + b _080A2778 +_080A2736: + ldr r0, _080A2744 + ldr r1, _080A2748 + ldr r2, _080A274C + bl CpuSet + b _080A2778 + .align 2, 0 +_080A2744: .4byte 0x02037714 +_080A2748: .4byte 0x02037b14 +_080A274C: .4byte 0x04000100 +_080A2750: + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + ldr r1, _080A2764 + ldr r2, _080A2768 + mov r0, sp + bl CpuSet + b _080A2778 + .align 2, 0 +_080A2764: .4byte 0x02037b14 +_080A2768: .4byte 0x05000100 +_080A276C: + str r1, [sp, 0x4] + add r0, sp, 0x4 + ldr r1, _080A27A4 + ldr r2, _080A27A8 + bl CpuSet +_080A2778: + ldr r2, _080A27AC + 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, _080A27AC + 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 + .align 2, 0 +_080A27A4: .4byte 0x02037b14 +_080A27A8: .4byte 0x05000100 +_080A27AC: .4byte 0x02037fd4 + 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, _080A2838 + 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, _080A283C + 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 + .align 2, 0 +_080A2838: .4byte 0x02037fd4 +_080A283C: .4byte 0xfffff83f +_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, _080A2860 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + bne _080A2864 + movs r0, 0 + b _080A295C + .align 2, 0 +_080A2860: .4byte 0x02037fd4 +_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, _080A28E0 + 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 + .align 2, 0 +_080A28E0: .4byte 0xfffff83f +_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, _080A2964 + 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, _080A2964 + 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 + .align 2, 0 +_080A2964: .4byte 0xfffff83f + thumb_func_end pal_fade__2 + + thumb_func_start sub_80A2968 +sub_80A2968: @ 80A2968 + push {r4,lr} + ldr r4, _080A29B4 + ldrh r1, [r4] + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r4, 0x4] + lsls r1, 21 + lsrs r1, 27 + movs r0, 0x54 + bl lcd_io_set + 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, _080A29B8 + 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 + .align 2, 0 +_080A29B4: .4byte 0x02037fd4 +_080A29B8: .4byte 0xfffff83f + thumb_func_end sub_80A2968 + + thumb_func_start sub_80A29BC +sub_80A29BC: @ 80A29BC + push {r4,lr} + ldr r3, _080A29F4 + 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, _080A29F8 + ands r0, r1 + str r0, [r3, 0x8] + b _080A2A10 + .align 2, 0 +_080A29F4: .4byte 0x02037fd4 +_080A29F8: .4byte 0xfffe0fff +_080A29FC: + lsls r0, r2, 15 + lsrs r0, 27 + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + lsls r0, 12 + ldr r1, _080A2A14 + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] +_080A2A10: + movs r0, 0x1 + b _080A2A1A + .align 2, 0 +_080A2A14: .4byte 0xfffe0fff +_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, _080A2A80 + ldr r5, _080A2A84 + ldr r3, _080A2A88 + str r4, [r3] + str r5, [r3, 0x4] + ldr r4, _080A2A8C + str r4, [r3, 0x8] + ldr r3, [r3, 0x8] + bl sub_80A2A20 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A2A80: .4byte 0x02037714 +_080A2A84: .4byte 0x02037b14 +_080A2A88: .4byte 0x040000d4 +_080A2A8C: .4byte 0x84000100 + 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, _080A2B3C + 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 + .align 2, 0 +_080A2B3C: .4byte 0x0852489c + 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, _080A2BA8 + 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 + .align 2, 0 +_080A2BA8: .4byte 0x00000133 + 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, _080A2C9C + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080A2CA0 + 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 + .align 2, 0 +_080A2C9C: .4byte sub_80A2D54 + 1 +_080A2CA0: .4byte 0x03005e00 +_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, _080A2CF4 + 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, _080A2CF4 + 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 + .align 2, 0 +_080A2CF4: .4byte 0x03005e00 + 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, _080A2D1C + ldr r1, _080A2D20 +_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 + .align 2, 0 +_080A2D1C: .4byte sub_80A2D54 + 1 +_080A2D20: .4byte 0x03005e00 +_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, _080A2D50 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080A2D38 + pop {r0} + bx r0 + .align 2, 0 +_080A2D50: .4byte sub_80A2D54 + 1 + 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, _080A2DA8 + 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 + .align 2, 0 +_080A2DA8: .4byte 0x03005e08 +_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, _080A2DE4 + movs r0, 0 + strb r0, [r1] + bl map_music_set_to_zero + pop {r0} + bx r0 + .align 2, 0 +_080A2DE4: .4byte 0x03005df8 + thumb_func_end sound_sources_off + + thumb_func_start sound_something +sound_something: @ 80A2DE8 + push {r4,r5,lr} + ldr r0, _080A2E00 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0x7 + bhi _080A2ECA + lsls r0, r1, 2 + ldr r1, _080A2E04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A2E00: .4byte 0x03000f4c +_080A2E04: .4byte _080A2E08 + .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, _080A2E38 + ldrh r0, [r0] + bl song_play_for_text + b _080A2ECA + .align 2, 0 +_080A2E38: .4byte 0x03000f48 +_080A2E3C: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r0, _080A2E54 + movs r1, 0 + strh r1, [r0] + ldr r0, _080A2E58 + strb r1, [r0] + b _080A2ECA + .align 2, 0 +_080A2E54: .4byte 0x03000f4a +_080A2E58: .4byte 0x03000f4c +_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, _080A2E8C + ldr r1, _080A2E90 + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, _080A2E94 + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r2] + bl song_play_for_text + b _080A2ECA + .align 2, 0 +_080A2E8C: .4byte 0x03000f48 +_080A2E90: .4byte 0x03000f4a +_080A2E94: .4byte 0x03000f4c +_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, _080A2ED0 + ldrh r0, [r4] + ldr r5, _080A2ED4 + ldrb r1, [r5] + bl sub_80A3194 + ldr r1, _080A2ED8 + ldrh r0, [r4] + strh r0, [r1] + movs r2, 0 + strh r2, [r4] + ldr r1, _080A2EDC + movs r0, 0x2 + strb r0, [r1] + strb r2, [r5] +_080A2ECA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A2ED0: .4byte 0x03000f4a +_080A2ED4: .4byte 0x03000f4d +_080A2ED8: .4byte 0x03000f48 +_080A2EDC: .4byte 0x03000f4c + thumb_func_end sound_something + + thumb_func_start map_music_set_to_zero +map_music_set_to_zero: @ 80A2EE0 + ldr r0, _080A2EF4 + movs r1, 0 + strh r1, [r0] + ldr r0, _080A2EF8 + strh r1, [r0] + ldr r0, _080A2EFC + strb r1, [r0] + ldr r0, _080A2F00 + strb r1, [r0] + bx lr + .align 2, 0 +_080A2EF4: .4byte 0x03000f48 +_080A2EF8: .4byte 0x03000f4a +_080A2EFC: .4byte 0x03000f4c +_080A2F00: .4byte 0x03000f4d + thumb_func_end map_music_set_to_zero + + thumb_func_start current_map_music_get +current_map_music_get: @ 80A2F04 + ldr r0, _080A2F0C + ldrh r0, [r0] + bx lr + .align 2, 0 +_080A2F0C: .4byte 0x03000f48 + thumb_func_end current_map_music_get + + thumb_func_start current_map_music_set +current_map_music_set: @ 80A2F10 + ldr r1, _080A2F24 + strh r0, [r1] + ldr r1, _080A2F28 + movs r0, 0 + strh r0, [r1] + ldr r1, _080A2F2C + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_080A2F24: .4byte 0x03000f48 +_080A2F28: .4byte 0x03000f4a +_080A2F2C: .4byte 0x03000f4c + thumb_func_end current_map_music_set + + thumb_func_start sub_80A2F30 +sub_80A2F30: @ 80A2F30 + ldr r0, _080A2F44 + movs r1, 0 + strh r1, [r0] + ldr r0, _080A2F48 + strh r1, [r0] + ldr r1, _080A2F4C + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_080A2F44: .4byte 0x03000f48 +_080A2F48: .4byte 0x03000f4a +_080A2F4C: .4byte 0x03000f4c + 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, _080A2F7C + movs r1, 0 + strh r1, [r0] + ldr r0, _080A2F80 + strh r1, [r0] + ldr r1, _080A2F84 + movs r0, 0x5 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A2F7C: .4byte 0x03000f48 +_080A2F80: .4byte 0x03000f4a +_080A2F84: .4byte 0x03000f4c + 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, _080A2FB0 + movs r0, 0 + strh r0, [r1] + ldr r0, _080A2FB4 + strh r4, [r0] + ldr r1, _080A2FB8 + movs r0, 0x6 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A2FB0: .4byte 0x03000f48 +_080A2FB4: .4byte 0x03000f4a +_080A2FB8: .4byte 0x03000f4c + 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, _080A2FF0 + movs r0, 0 + strh r0, [r1] + ldr r0, _080A2FF4 + strh r4, [r0] + ldr r1, _080A2FF8 + movs r0, 0x7 + strb r0, [r1] + ldr r0, _080A2FFC + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A2FF0: .4byte 0x03000f48 +_080A2FF4: .4byte 0x03000f4a +_080A2FF8: .4byte 0x03000f4c +_080A2FFC: .4byte 0x03000f4d + 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, _080A302C + strh r4, [r0] + ldr r0, _080A3030 + movs r2, 0 + strh r2, [r0] + ldr r1, _080A3034 + movs r0, 0x2 + strb r0, [r1] + ldr r0, _080A3038 + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A302C: .4byte 0x03000f48 +_080A3030: .4byte 0x03000f4a +_080A3034: .4byte 0x03000f4c +_080A3038: .4byte 0x03000f4d + thumb_func_end sub_80A3000 + + thumb_func_start sub_80A303C +sub_80A303C: @ 80A303C + push {lr} + ldr r0, _080A3054 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080A3058 + cmp r0, 0x5 + beq _080A3058 + cmp r0, 0x7 + beq _080A3058 + movs r0, 0x1 + b _080A305A + .align 2, 0 +_080A3054: .4byte 0x03000f4c +_080A3058: + movs r0, 0 +_080A305A: + pop {r1} + bx r1 + thumb_func_end sub_80A303C + + thumb_func_start pause_music_for_sound_maybe +pause_music_for_sound_maybe: @ 80A3060 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080A3088 + bl MPlayStop_rev01 + ldr r0, _080A308C + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4] + ldr r2, _080A3090 + ldrh r1, [r4, 0x2] + strh r1, [r2] + bl m4aSongNumStart + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A3088: .4byte 0x03007420 +_080A308C: .4byte 0x085248bc +_080A3090: .4byte 0x03000f4e + 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, _080A30AC + ldrh r0, [r2] + cmp r0, 0 + beq _080A30B0 + subs r0, 0x1 + strh r0, [r2] + movs r0, 0 + b _080A30C8 + .align 2, 0 +_080A30AC: .4byte 0x03000f4e +_080A30B0: + cmp r1, 0 + bne _080A30C0 + ldr r0, _080A30BC + bl m4aMPlayContinue + b _080A30C6 + .align 2, 0 +_080A30BC: .4byte 0x03007420 +_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, _080A30E0 + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0] + bl m4aSongNumStop + pop {r0} + bx r0 + .align 2, 0 +_080A30E0: .4byte 0x085248bc + thumb_func_end sub_80A30CC + + thumb_func_start fanfare_play +fanfare_play: @ 80A30E4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0 + ldr r2, _080A3104 +_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 + .align 2, 0 +_080A3104: .4byte 0x085248bc +_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, _080A3134 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A3138 + movs r0, 0x1 + b _080A313A + .align 2, 0 +_080A3134: .4byte task50_overworld_fanfare + 1 +_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, _080A3154 + ldrh r0, [r1] + cmp r0, 0 + beq _080A3158 + subs r0, 0x1 + strh r0, [r1] + b _080A3164 + .align 2, 0 +_080A3154: .4byte 0x03000f4e +_080A3158: + ldr r0, _080A316C + bl m4aMPlayContinue + adds r0, r4, 0 + bl remove_task +_080A3164: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A316C: .4byte 0x03007420 + thumb_func_end task50_overworld_fanfare + + thumb_func_start task_add_50_overworld_fanfare_if_not_running +task_add_50_overworld_fanfare_if_not_running: @ 80A3170 + push {r4,lr} + ldr r4, _080A3190 + 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 + .align 2, 0 +_080A3190: .4byte task50_overworld_fanfare + 1 + 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, _080A31DC + ldrb r0, [r0] + cmp r0, 0 + beq _080A31A8 + movs r5, 0 +_080A31A8: + ldr r6, _080A31E0 + cmp r5, r6 + bne _080A31B0 + movs r5, 0 +_080A31B0: + adds r0, r5, 0 + bl m4aSongNumStart + ldr r4, _080A31E4 + 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 + .align 2, 0 +_080A31DC: .4byte 0x03005df8 +_080A31E0: .4byte 0x0000ffff +_080A31E4: .4byte 0x03007420 + 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, _080A31FC + bl sub_82E0308 + pop {r0} + bx r0 + .align 2, 0 +_080A31FC: .4byte 0x03007420 + thumb_func_end sub_80A31E8 + + thumb_func_start sub_80A3200 +sub_80A3200: @ 80A3200 + push {lr} + ldr r0, _080A3218 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A3220 + ldr r0, _080A321C + ands r1, r0 + cmp r1, 0 + beq _080A3220 + movs r0, 0 + b _080A3222 + .align 2, 0 +_080A3218: .4byte 0x03007420 +_080A321C: .4byte 0x0000ffff +_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, _080A323C + bl sub_82E0328 + pop {r0} + bx r0 + .align 2, 0 +_080A323C: .4byte 0x03007420 + thumb_func_end sub_80A3228 + + thumb_func_start play_sound_effect +play_sound_effect: @ 80A3240 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080A3254 + bl m4aMPlayFadeOut + pop {r0} + bx r0 + .align 2, 0 +_080A3254: .4byte 0x03007420 + thumb_func_end play_sound_effect + + thumb_func_start sub_80A3258 +sub_80A3258: @ 80A3258 + push {lr} + ldr r0, _080A3268 + ldrh r0, [r0, 0x4] + cmp r0, 0 + beq _080A326C + movs r0, 0 + b _080A326E + .align 2, 0 +_080A3268: .4byte 0x03007420 +_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, _080A32B4 + ldr r1, _080A32B8 + 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, _080A32BC + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A32B4: .4byte 0x03007420 +_080A32B8: .4byte 0x0000ffff +_080A32BC: .4byte 0x020383ec + 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, _080A3338 + ldr r1, _080A333C + 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, _080A3340 + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 +_080A332E: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A3338: .4byte 0x03007420 +_080A333C: .4byte 0x0000ffff +_080A3340: .4byte 0x020383ec + 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, _080A339C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080A3384 + ldr r0, _080A33A0 + ldr r1, _080A33A4 + 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 + .align 2, 0 +_080A339C: .4byte 0x02022fec +_080A33A0: .4byte 0x03007420 +_080A33A4: .4byte 0x0000ffff + 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, _080A33F8 + ldr r1, _080A33FC + 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, _080A3400 + movs r0, 0x2 + strb r0, [r1] +_080A33EE: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A33F8: .4byte 0x03007420 +_080A33FC: .4byte 0x0000ffff +_080A3400: .4byte 0x020383ec + 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, _080A3440 + ldr r1, _080A3444 + 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, _080A3448 + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A3440: .4byte 0x03007420 +_080A3444: .4byte 0x0000ffff +_080A3448: .4byte 0x020383ec + 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, _080A3494 + 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, _080A3498 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A3494: .4byte 0xffff0000 +_080A3498: .4byte _080A349C + .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, _080A34E0 + movs r1, 0x14 + b _080A3504 + .align 2, 0 +_080A34E0: .4byte 0x00003cf0 +_080A34E4: + movs r6, 0x32 + movs r5, 0xC8 + ldr r4, _080A34F4 + movs r3, 0x14 + mov r8, r3 + movs r2, 0x5A + b _080A3562 + .align 2, 0 +_080A34F4: .4byte 0x00003db8 +_080A34F8: + movs r6, 0x19 + movs r0, 0x1 + mov r9, r0 + movs r5, 0x64 + ldr r4, _080A350C + movs r1, 0xC0 +_080A3504: + mov r8, r1 + movs r2, 0x5A + b _080A3562 + .align 2, 0 +_080A350C: .4byte 0x00003cf0 +_080A3510: + movs r5, 0xC8 + ldr r4, _080A3518 + b _080A3562 + .align 2, 0 +_080A3518: .4byte 0x00003868 +_080A351C: + movs r5, 0xDC + ldr r4, _080A3528 + movs r3, 0xC0 + mov r8, r3 + movs r2, 0x46 + b _080A3562 + .align 2, 0 +_080A3528: .4byte 0x00003cc3 +_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, _080A354C + b _080A3562 + .align 2, 0 +_080A354C: .4byte 0x00003b60 +_080A3550: + movs r6, 0x64 + movs r5, 0xE1 + ldr r4, _080A3558 + b _080A3562 + .align 2, 0 +_080A3558: .4byte 0x00003b60 +_080A355C: + movs r6, 0x14 + movs r5, 0xE1 +_080A3560: + ldr r4, _080A35BC +_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 + .align 2, 0 +_080A35BC: .4byte 0x00003a98 +_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, _080A35DC + b _080A3654 + .align 2, 0 +_080A35DC: .4byte 0x0869ef24 +_080A35E0: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A35EC + b _080A3654 + .align 2, 0 +_080A35EC: .4byte 0x0869dcf4 +_080A35F0: + mov r3, r9 + cmp r3, 0 + beq _080A3604 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A3600 + b _080A3654 + .align 2, 0 +_080A3600: .4byte 0x0869f524 +_080A3604: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A3610 + b _080A3654 + .align 2, 0 +_080A3610: .4byte 0x0869e2f4 +_080A3614: + mov r0, r9 + cmp r0, 0 + beq _080A3628 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A3624 + b _080A3654 + .align 2, 0 +_080A3624: .4byte 0x0869fb24 +_080A3628: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A3634 + b _080A3654 + .align 2, 0 +_080A3634: .4byte 0x0869e8f4 +_080A3638: + mov r3, r9 + cmp r3, 0 + beq _080A364C + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A3648 + b _080A3654 + .align 2, 0 +_080A3648: .4byte 0x086a0124 +_080A364C: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A3670 +_080A3654: + adds r0, r1 + bl sub_82E1674 + ldr r1, _080A3674 + 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 + .align 2, 0 +_080A3670: .4byte 0x0869eef4 +_080A3674: .4byte 0x020383e8 + thumb_func_end sub_80A344C + + thumb_func_start sub_80A3678 +sub_80A3678: @ 80A3678 + push {lr} + ldr r0, _080A3690 + 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 + .align 2, 0 +_080A3690: .4byte sub_80A370C + 1 +_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, _080A36B0 + ldr r0, [r0] + bl MPlayStop_rev01 + bl sub_8000964 + pop {r0} + bx r0 + .align 2, 0 +_080A36B0: .4byte 0x020383e8 + thumb_func_end sub_80A369C + + thumb_func_start sub_80A36B4 +sub_80A36B4: @ 80A36B4 + push {lr} + ldr r0, _080A36C4 + ldr r0, [r0] + bl MPlayStop_rev01 + pop {r0} + bx r0 + .align 2, 0 +_080A36C4: .4byte 0x020383e8 + thumb_func_end sub_80A36B4 + + thumb_func_start sub_80A36C8 +sub_80A36C8: @ 80A36C8 + push {lr} + ldr r0, _080A36E0 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A36E4 + bl sub_8000964 + movs r0, 0 + b _080A36E6 + .align 2, 0 +_080A36E0: .4byte 0x020383e8 +_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, _080A3700 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A3704 + movs r0, 0 + b _080A3706 + .align 2, 0 +_080A3700: .4byte 0x020383e8 +_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, _080A3720 + ldrb r0, [r1] + cmp r0, 0 + beq _080A3724 + subs r0, 0x1 + strb r0, [r1] + b _080A3742 + .align 2, 0 +_080A3720: .4byte 0x020383ec +_080A3724: + ldr r0, _080A3748 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A3742 + ldr r0, _080A374C + ldr r1, _080A3750 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + adds r0, r4, 0 + bl remove_task +_080A3742: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A3748: .4byte 0x020383e8 +_080A374C: .4byte 0x03007420 +_080A3750: .4byte 0x0000ffff + thumb_func_end sub_80A370C + + thumb_func_start sub_80A3754 +sub_80A3754: @ 80A3754 + push {r4,lr} + ldr r4, _080A3774 + 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 + .align 2, 0 +_080A3774: .4byte sub_80A370C + 1 + 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, _080A379C + ldrb r0, [r0] + cmp r0, 0 + beq _080A3788 + movs r1, 0 +_080A3788: + ldr r0, _080A37A0 + cmp r1, r0 + bne _080A3790 + movs r1, 0 +_080A3790: + adds r0, r1, 0 + bl m4aSongNumStart + pop {r0} + bx r0 + .align 2, 0 +_080A379C: .4byte 0x03005df8 +_080A37A0: .4byte 0x0000ffff + 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, _080A37FC + adds r0, r6, 0 + bl m4aMPlayImmInit + ldr r0, _080A3800 + mov r8, r0 + bl m4aMPlayImmInit + ldr r5, _080A3804 + 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 + .align 2, 0 +_080A37FC: .4byte 0x030075f0 +_080A3800: .4byte 0x03007630 +_080A3804: .4byte 0x0000ffff + 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, _080A3834 + adds r0, r5, 0 + bl m4aMPlayImmInit + ldr r1, _080A3838 + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A3834: .4byte 0x030075f0 +_080A3838: .4byte 0x0000ffff + 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, _080A3868 + adds r0, r5, 0 + bl m4aMPlayImmInit + ldr r1, _080A386C + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A3868: .4byte 0x03007630 +_080A386C: .4byte 0x0000ffff + thumb_func_end sub_80A383C + + thumb_func_start sub_80A3870 +sub_80A3870: @ 80A3870 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _080A3894 + ldr r5, _080A3898 + lsls r4, 24 + asrs r4, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + ldr r0, _080A389C + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A3894: .4byte 0x030075f0 +_080A3898: .4byte 0x0000ffff +_080A389C: .4byte 0x03007630 + thumb_func_end sub_80A3870 + + thumb_func_start mplay_has_finished_maybe +mplay_has_finished_maybe: @ 80A38A0 + push {lr} + ldr r0, _080A38D0 + ldr r1, [r0, 0x4] + movs r2, 0x80 + lsls r2, 24 + adds r3, r0, 0 + cmp r1, 0 + bge _080A38BA + ldr r0, _080A38D4 + ldr r0, [r0, 0x4] + ands r0, r2 + cmp r0, 0 + bne _080A38CC +_080A38BA: + ldr r1, _080A38D8 + ldrh r0, [r3, 0x4] + cmp r0, 0 + bne _080A38DC + ldr r0, _080A38D4 + ldr r0, [r0, 0x4] + ands r0, r1 + cmp r0, 0 + bne _080A38DC +_080A38CC: + movs r0, 0 + b _080A38DE + .align 2, 0 +_080A38D0: .4byte 0x030075f0 +_080A38D4: .4byte 0x03007630 +_080A38D8: .4byte 0x0000ffff +_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, _080A38FC + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A3904 + ldr r0, _080A3900 + ands r1, r0 + cmp r1, 0 + beq _080A3904 + movs r0, 0x1 + b _080A3906 + .align 2, 0 +_080A38FC: .4byte 0x03007420 +_080A3900: .4byte 0x0000ffff +_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, _080A3924 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A392C + ldr r0, _080A3928 + ands r1, r0 + cmp r1, 0 + beq _080A392C + movs r0, 0x1 + b _080A392E + .align 2, 0 +_080A3924: .4byte 0x03007800 +_080A3928: .4byte 0x0000ffff +_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, _080A39C8 + movs r1, 0 + strb r1, [r0] + ldr r0, _080A39CC + strb r1, [r0] + ldr r0, _080A39D0 + strb r1, [r0] + ldr r0, _080A39D4 + strb r1, [r0] + ldr r0, _080A39D8 + movs r1, 0 + str r1, [r0] + ldr r0, _080A39DC + str r1, [r0] + ldr r0, _080A39E0 + movs r2, 0 + strh r1, [r0] + ldr r0, _080A39E4 + strb r2, [r0] + ldr r4, _080A39E8 + ldr r5, _080A39EC + ldr r6, _080A39F0 + ldr r7, _080A39F4 + ldr r0, _080A39F8 + mov r12, r0 + ldr r1, _080A39FC + mov r8, r1 + ldr r0, _080A3A00 + mov r9, r0 + ldr r1, _080A3A04 + adds r3, r1, 0 + ldr r1, _080A3A08 + 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, _080A3A0C + 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 + .align 2, 0 +_080A39C8: .4byte 0x020383fc +_080A39CC: .4byte 0x020383fd +_080A39D0: .4byte 0x020383fe +_080A39D4: .4byte 0x020383ff +_080A39D8: .4byte 0x02038400 +_080A39DC: .4byte 0x02038404 +_080A39E0: .4byte 0x02038408 +_080A39E4: .4byte 0x0203841a +_080A39E8: .4byte 0x02038430 +_080A39EC: .4byte 0x02038432 +_080A39F0: .4byte 0x02038433 +_080A39F4: .4byte 0x02038434 +_080A39F8: .4byte 0x02038436 +_080A39FC: .4byte 0x02038437 +_080A3A00: .4byte 0x02038440 +_080A3A04: .4byte 0x0000ffff +_080A3A08: .4byte 0x0203840a +_080A3A0C: .4byte 0x0203841e + 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, _080A3A34 + ldr r0, _080A3A38 + ldrb r0, [r0] + strb r0, [r2] + ldr r2, _080A3A3C + ldr r0, _080A3A40 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, _080A3A44 + movs r2, 0x1 + bl move_something + pop {r0} + bx r0 + .align 2, 0 +_080A3A34: .4byte 0x02038436 +_080A3A38: .4byte 0x0202420b +_080A3A3C: .4byte 0x02038437 +_080A3A40: .4byte 0x0202420c +_080A3A44: .4byte 0x082c8d6c + 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, _080A3A9C + movs r7, 0x64 + ldr r5, _080A3AA0 +_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, _080A3AA4 + b _080A3AAE + .align 2, 0 +_080A3A9C: .4byte 0x0202406e +_080A3AA0: .4byte 0x02038438 +_080A3AA4: .4byte 0x02024744 +_080A3AA8: + ldrh r0, [r6] + muls r0, r7 + ldr r1, _080A3AD0 +_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, _080A3AD4 + ldr r5, _080A3AD8 + ldr r1, _080A3ADC + mov r12, r1 + ldr r7, _080A3AE0 + ldr r6, _080A3AE4 + b _080A3B10 + .align 2, 0 +_080A3AD0: .4byte 0x020244ec +_080A3AD4: .4byte 0x02038434 +_080A3AD8: .4byte 0x02038430 +_080A3ADC: .4byte 0x020383fd +_080A3AE0: .4byte 0x020383f8 +_080A3AE4: .4byte move_anim_execute + 1 +_080A3AE8: + ldr r3, _080A3B1C + ldr r5, _080A3B20 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r1, _080A3B24 + mov r12, r1 + ldr r7, _080A3B28 + ldr r6, _080A3B2C + ldr r2, _080A3B30 + ldr r1, _080A3B34 + 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 + .align 2, 0 +_080A3B1C: .4byte 0x02038434 +_080A3B20: .4byte 0x02038430 +_080A3B24: .4byte 0x020383fd +_080A3B28: .4byte 0x020383f8 +_080A3B2C: .4byte move_anim_execute + 1 +_080A3B30: .4byte 0x02039f34 +_080A3B34: .4byte 0x02038438 +_080A3B38: + mov r1, r8 + strh r1, [r3] +_080A3B3C: + ldr r1, _080A3B90 + 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, _080A3B94 + str r0, [r1] + movs r0, 0x1 + mov r1, r12 + strb r0, [r1] + movs r0, 0 + ldr r1, _080A3B98 + strb r0, [r1] + str r6, [r7] + ldr r0, _080A3B9C + adds r2, r0, 0 + ldr r1, _080A3BA0 + 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, _080A3BA4 + b _080A3BAA + .align 2, 0 +_080A3B90: .4byte 0x0203841e +_080A3B94: .4byte 0x020383f0 +_080A3B98: .4byte 0x020383fc +_080A3B9C: .4byte 0x0000ffff +_080A3BA0: .4byte 0x0203840a +_080A3BA4: .4byte 0x082c8d64 +_080A3BA8: + adds r4, 0x1 +_080A3BAA: + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, _080A3BE4 + cmp r0, r1 + beq _080A3BC2 + cmp r8, r0 + bne _080A3BA8 + ldr r0, _080A3BE8 + movs r2, 0x80 + bl MPlayVolumeControl +_080A3BC2: + ldr r0, _080A3BEC + movs r1, 0 + strh r1, [r0] + ldr r0, _080A3BF0 + strh r1, [r0] + ldr r0, _080A3BF4 + strh r1, [r0] + ldr r0, _080A3BF8 + 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 + .align 2, 0 +_080A3BE4: .4byte 0x0000ffff +_080A3BE8: .4byte 0x03007420 +_080A3BEC: .4byte 0x02022e24 +_080A3BF0: .4byte 0x02022e26 +_080A3BF4: .4byte 0x02022e28 +_080A3BF8: .4byte 0x02022e2a + 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 obj_delete_and_free_tiles + ldr r1, _080A3C18 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A3C18: .4byte 0x020383fe + 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, _080A3C34 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080A3C34: .4byte 0x020383fe + 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, _080A3C50 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080A3C50: .4byte 0x020383ff + 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, _080A3C6C + ldr r1, _080A3C70 +_080A3C60: + ldrh r0, [r1] + cmp r0, r4 + bne _080A3C74 + strh r3, [r1] + b _080A3C7C + .align 2, 0 +_080A3C6C: .4byte 0x0000ffff +_080A3C70: .4byte 0x0203840a +_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, _080A3CA0 + adds r4, r0, 0 + ldr r1, _080A3CA4 +_080A3C92: + ldrh r0, [r1] + cmp r0, r3 + bne _080A3CA8 + orrs r0, r4 + strh r0, [r1] + b _080A3CB0 + .align 2, 0 +_080A3CA0: .4byte 0x0000ffff +_080A3CA4: .4byte 0x0203840a +_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, _080A3CD0 + ldrb r1, [r2] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + bgt _080A3CDC + ldr r0, _080A3CD4 + ldr r1, _080A3CD8 + str r1, [r0] + movs r0, 0 + b _080A3CDE + .align 2, 0 +_080A3CD0: .4byte 0x020383fc +_080A3CD4: .4byte 0x020383f8 +_080A3CD8: .4byte move_anim_execute + 1 +_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, _080A3D14 +_080A3CE8: + ldr r0, _080A3D18 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _080A3D1C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080A3D0C + ldr r0, _080A3D20 + ldrb r0, [r0] + cmp r0, 0 + bne _080A3CE8 +_080A3D0C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A3D14: .4byte 0x08525e98 +_080A3D18: .4byte 0x020383f0 +_080A3D1C: .4byte 0x020383fc +_080A3D20: .4byte 0x020383fd + thumb_func_end move_anim_execute + + thumb_func_start ma00_load_graphics +ma00_load_graphics: @ 80A3D24 + push {r4-r6,lr} + ldr r6, _080A3D70 + 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, _080A3D74 + adds r0, r5, r0 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _080A3D78 + adds r5, r0 + adds r0, r5, 0 + bl gpu_pal_obj_decompress_and_apply3 + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + ldr r0, _080A3D7C + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C54 + ldr r1, _080A3D80 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _080A3D84 + ldr r0, _080A3D88 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A3D70: .4byte 0x020383f0 +_080A3D74: .4byte 0x085112c4 +_080A3D78: .4byte 0x08511bcc +_080A3D7C: .4byte 0xffffd8f0 +_080A3D80: .4byte 0x020383fc +_080A3D84: .4byte 0x020383f8 +_080A3D88: .4byte move_anim_waiter + 1 + thumb_func_end ma00_load_graphics + + thumb_func_start ma01_080728D0 +ma01_080728D0: @ 80A3D8C + push {r4-r6,lr} + ldr r6, _080A3DCC + 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, _080A3DD0 + ldr r0, _080A3DD4 + adds r4, r0 + lsls r0, r4, 3 + adds r0, r1 + ldrh r5, [r0, 0x6] + adds r0, r5, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r5, 0 + bl gpu_pal_free_tag + 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 + .align 2, 0 +_080A3DCC: .4byte 0x020383f0 +_080A3DD0: .4byte 0x08524b44 +_080A3DD4: .4byte 0xffffd8f0 + thumb_func_end ma01_080728D0 + + thumb_func_start ma02_instanciate_template +ma02_instanciate_template: @ 80A3DD8 + push {r4-r7,lr} + ldr r5, _080A3E40 + 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, _080A3E44 + 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 + .align 2, 0 +_080A3E40: .4byte 0x020383f0 +_080A3E44: .4byte 0x0203841e +_080A3E48: + negs r0, r4 +_080A3E4A: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080A3E54 + b _080A3E6A + .align 2, 0 +_080A3E54: .4byte 0x02038437 +_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, _080A3EC0 +_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, _080A3EC4 + 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 obj_add_from_template_call_callback_once + ldr r1, _080A3EC8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A3EC0: .4byte 0x02038436 +_080A3EC4: .4byte 0x02038437 +_080A3EC8: .4byte 0x020383fe + thumb_func_end ma02_instanciate_template + + thumb_func_start sub_80A3ECC +sub_80A3ECC: @ 80A3ECC + push {r4-r7,lr} + ldr r4, _080A3F3C + 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, _080A3F40 + 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, _080A3F44 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A3F3C: .4byte 0x020383f0 +_080A3F40: .4byte 0x0203841e +_080A3F44: .4byte 0x020383fe + thumb_func_end sub_80A3ECC + + thumb_func_start ma04_wait_countdown +ma04_wait_countdown: @ 80A3F48 + push {r4,lr} + ldr r1, _080A3F78 + ldr r0, [r1] + adds r2, r0, 0x1 + str r2, [r1] + ldr r3, _080A3F7C + 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, _080A3F80 + ldr r0, _080A3F84 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A3F78: .4byte 0x020383f0 +_080A3F7C: .4byte 0x020383fc +_080A3F80: .4byte 0x020383f8 +_080A3F84: .4byte move_anim_waiter + 1 + thumb_func_end ma04_wait_countdown + + thumb_func_start sub_80A3F88 +sub_80A3F88: @ 80A3F88 + push {lr} + ldr r0, _080A3FA0 + ldrb r2, [r0] + cmp r2, 0 + bne _080A3FAC + ldr r0, _080A3FA4 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, _080A3FA8 + strb r2, [r0] + b _080A3FB2 + .align 2, 0 +_080A3FA0: .4byte 0x020383fe +_080A3FA4: .4byte 0x020383f0 +_080A3FA8: .4byte 0x020383fc +_080A3FAC: + ldr r1, _080A3FB8 + movs r0, 0x1 + strb r0, [r1] +_080A3FB2: + pop {r0} + bx r0 + .align 2, 0 +_080A3FB8: .4byte 0x020383fc + 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, _080A3FF4 + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r0, _080A3FF8 + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r1, _080A3FFC + ldrb r0, [r1] + cmp r0, 0xFF + bne _080A3FEC + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _080A4004 +_080A3FEC: + ldr r1, _080A4000 + movs r0, 0 + strh r0, [r1] + b _080A401E + .align 2, 0 +_080A3FF4: .4byte 0x020383fe +_080A3FF8: .4byte 0x020383ff +_080A3FFC: .4byte 0x02038430 +_080A4000: .4byte 0x0203842e +_080A4004: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _080A403C + ldr r1, _080A4028 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bhi _080A4030 +_080A401E: + ldr r1, _080A402C + movs r0, 0x1 + strb r0, [r1] + b _080A40A2 + .align 2, 0 +_080A4028: .4byte 0x0203842e +_080A402C: .4byte 0x020383fc +_080A4030: + ldr r0, _080A40AC + bl MPlayStop_rev01 + ldr r0, _080A40B0 + bl MPlayStop_rev01 +_080A403C: + ldr r1, _080A40B4 + movs r0, 0 + strh r0, [r1] + movs r5, 0 + ldr r7, _080A40B8 + ldr r6, _080A40BC + ldr r4, _080A40C0 +_080A404A: + ldrh r0, [r4] + cmp r0, r7 + beq _080A406E + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl gpu_tile_obj_free_by_tag + ldrh r0, [r4] + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl gpu_pal_free_tag + 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, _080A40C4 + ldr r1, _080A40B8 + 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, _080A40C8 + mov r1, r8 + strb r1, [r0] +_080A40A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A40AC: .4byte 0x030075f0 +_080A40B0: .4byte 0x03007630 +_080A40B4: .4byte 0x0203842e +_080A40B8: .4byte 0x0000ffff +_080A40BC: .4byte 0x08524b44 +_080A40C0: .4byte 0x0203840a +_080A40C4: .4byte 0x03007420 +_080A40C8: .4byte 0x020383fd + thumb_func_end sub_80A3FC4 + + thumb_func_start ma09_play_sound +ma09_play_sound: @ 80A40CC + push {r4,lr} + ldr r4, _080A40F0 + 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 + .align 2, 0 +_080A40F0: .4byte 0x020383f0 + 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, _080A413C + mov r8, r1 + adds r6, r0, r1 + ldr r1, _080A4140 + movs r2, 0 + ldrsh r0, [r6, r2] + adds r0, r1 + ldrb r5, [r0] + ldr r1, _080A4144 + 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 + .align 2, 0 +_080A413C: .4byte 0x03005e08 +_080A4140: .4byte 0x020241e4 +_080A4144: .4byte 0x02020630 +_080A4148: + ldr r0, _080A4184 + 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, _080A4188 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, _080A418C + b _080A4198 + .align 2, 0 +_080A4184: .4byte task_pA_ma0A_obj_to_bg_pal + 1 +_080A4188: .4byte 0x02022e18 +_080A418C: .4byte 0x02022e1a +_080A4190: + ldr r0, _080A41C8 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, _080A41CC +_080A4198: + ldrh r0, [r0] + strh r0, [r1, 0x10] + ldr r1, _080A41D0 + 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, _080A41D4 + 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 + .align 2, 0 +_080A41C8: .4byte 0x02022e1c +_080A41CC: .4byte 0x02022e1e +_080A41D0: .4byte 0x03005e00 +_080A41D4: .4byte 0x02038430 + thumb_func_end sub_80A40F4 + + thumb_func_start sub_80A41D8 +sub_80A41D8: @ 80A41D8 + push {r4,r5,lr} + ldr r1, _080A41F0 + 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, _080A41F4 + b _080A41FA + .align 2, 0 +_080A41F0: .4byte 0x020383f0 +_080A41F4: .4byte 0x02038437 +_080A41F8: + ldr r0, _080A422C +_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 + .align 2, 0 +_080A422C: .4byte 0x02038436 +_080A4230: + movs r5, 0x1 +_080A4232: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, _080A4298 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080A429C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, _080A42A0 + 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 + .align 2, 0 +_080A4298: .4byte sub_80A40F4 + 1 +_080A429C: .4byte 0x020383fe +_080A42A0: .4byte 0x03005e00 +_080A42A4: + movs r5, 0x1 +_080A42A6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, _080A42F4 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080A42F8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, _080A42FC + 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, _080A4300 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, _080A4304 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _080A4308 + ldr r0, _080A430C + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A42F4: .4byte sub_80A40F4 + 1 +_080A42F8: .4byte 0x020383fe +_080A42FC: .4byte 0x03005e00 +_080A4300: .4byte 0x020383f0 +_080A4304: .4byte 0x020383fc +_080A4308: .4byte 0x020383f8 +_080A430C: .4byte move_anim_waiter + 1 + 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, _080A432C + ldrb r0, [r0] + cmp r4, r0 + beq _080A4374 + b _080A4384 + .align 2, 0 +_080A432C: .4byte 0x02038436 +_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, _080A4378 + 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, _080A437C + ldr r0, _080A4380 + 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 + .align 2, 0 +_080A4378: .4byte 0x020244d0 +_080A437C: .4byte 0x02020630 +_080A4380: .4byte 0x020241e4 +_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, _080A43D4 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldr r1, _080A43D8 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl dma3_transfer_queue_add_fill + b _080A43F8 + .align 2, 0 +_080A43D4: .4byte 0x06008000 +_080A43D8: .4byte 0x0600f000 +_080A43DC: + ldr r1, _080A44F8 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldr r1, _080A44FC + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl dma3_transfer_queue_add_fill +_080A43F8: + add r0, sp, 0x10 + bl sub_80A6B30 + add r0, sp, 0x20 + movs r1, 0 + strh r1, [r0] + ldr r1, [sp, 0x10] + ldr r2, _080A4500 + bl CpuSet + mov r0, sp + adds r0, 0x22 + movs r1, 0xFF + strh r1, [r0] + ldr r1, [sp, 0x14] + ldr r2, _080A4504 + 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, _080A4508 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r5, _080A450C + ldr r0, _080A4510 + 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, _080A4514 + 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, _080A4518 + ldr r2, _080A4510 + 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, _080A4508 + 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, _080A450C + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldrh r1, [r5] + movs r0, 0x16 + bl lcd_io_set + lsls r4, r6, 5 + ldr r0, _080A451C + 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, _080A4520 + adds r0, r4, 0 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4524 + movs r3, 0 + b _080A452E + .align 2, 0 +_080A44F8: .4byte 0x06004000 +_080A44FC: .4byte 0x0600e000 +_080A4500: .4byte 0x01000800 +_080A4504: .4byte 0x01000400 +_080A4508: .4byte 0x020241e4 +_080A450C: .4byte 0x02022e18 +_080A4510: .4byte 0x02020630 +_080A4514: .4byte 0x02039f34 +_080A4518: .4byte 0x02022e1a +_080A451C: .4byte 0x02037914 +_080A4520: .4byte 0x04000008 +_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, _080A4674 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldr r1, _080A4678 + movs r7, 0x80 + lsls r7, 5 + movs r0, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + 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, _080A467C + 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, _080A4680 + 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, _080A4684 + adds r2, r5, r0 + ldrb r4, [r2] + ldr r5, _080A4688 + ldr r3, _080A468C + 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, _080A4690 + 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 lcd_io_set + ldrh r1, [r4] + movs r0, 0x1A + bl lcd_io_set + lsls r4, r6, 5 + ldr r0, _080A4694 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x90 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080A4698 + ldr r2, _080A469C + 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 + .align 2, 0 +_080A4674: .4byte 0x06006000 +_080A4678: .4byte 0x0600f000 +_080A467C: .4byte 0x01000800 +_080A4680: .4byte 0x01000400 +_080A4684: .4byte 0x020241e4 +_080A4688: .4byte 0x02022e1c +_080A468C: .4byte 0x02020630 +_080A4690: .4byte 0x02022e1e +_080A4694: .4byte 0x02037914 +_080A4698: .4byte 0x05000120 +_080A469C: .4byte 0x04000008 + thumb_func_end sub_80A438C + + thumb_func_start sub_80A46A0 +sub_80A46A0: @ 80A46A0 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, _080A471C + 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 + .align 2, 0 +_080A471C: .4byte 0x02039f34 + 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, _080A4778 +_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 + .align 2, 0 +_080A4778: .4byte 0x00000fff + 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, _080A47B0 + movs r1, 0 + strh r1, [r0] + ldr r0, _080A47B4 + strh r1, [r0] + b _080A47C6 + .align 2, 0 +_080A47B0: .4byte 0x02022e18 +_080A47B4: .4byte 0x02022e1a +_080A47B8: + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, _080A47D0 + strh r4, [r0] + ldr r0, _080A47D4 + strh r4, [r0] +_080A47C6: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A47D0: .4byte 0x02022e1c +_080A47D4: .4byte 0x02022e1e + thumb_func_end sub_80A477C + + thumb_func_start task_pA_ma0A_obj_to_bg_pal +task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A4854 + 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, _080A4858 + 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, _080A485C + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, _080A4860 + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r2, _080A4864 + adds r0, r2 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 5 + ldr r3, _080A4868 + adds r2, r3 + adds r1, r2 + ldr r2, _080A486C + bl CpuSet + b _080A4896 + .align 2, 0 +_080A4854: .4byte 0x03005e00 +_080A4858: .4byte 0x02020630 +_080A485C: .4byte 0x02022e18 +_080A4860: .4byte 0x02022e1a +_080A4864: .4byte 0x02037d14 +_080A4868: .4byte 0xfffffe00 +_080A486C: .4byte 0x04000008 +_080A4870: + ldr r1, _080A48A0 + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, _080A48A4 + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r1, _080A48A8 + adds r0, r1 + subs r1, 0xE0 + ldr r2, _080A48AC + bl CpuSet +_080A4896: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A48A0: .4byte 0x02022e1c +_080A48A4: .4byte 0x02022e1e +_080A48A8: .4byte 0x02037d14 +_080A48AC: .4byte 0x04000008 + thumb_func_end task_pA_ma0A_obj_to_bg_pal + + thumb_func_start ma0B_0807324C +ma0B_0807324C: @ 80A48B0 + push {r4,r5,lr} + ldr r0, _080A48C4 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r4, [r2, 0x1] + cmp r4, 0 + bne _080A48C8 + movs r4, 0x2 + b _080A48D2 + .align 2, 0 +_080A48C4: .4byte 0x020383f0 +_080A48C8: + cmp r4, 0x1 + bne _080A48CE + movs r4, 0x3 +_080A48CE: + cmp r4, 0 + beq _080A48D6 +_080A48D2: + cmp r4, 0x2 + bne _080A48E0 +_080A48D6: + ldr r0, _080A48DC + b _080A48E2 + .align 2, 0 +_080A48DC: .4byte 0x02038436 +_080A48E0: + ldr r0, _080A4938 +_080A48E2: + ldrb r5, [r0] + ldr r3, _080A493C + ldrb r0, [r3] + cmp r0, 0xFF + beq _080A4908 + ldr r2, _080A4940 + ldr r0, _080A4944 + 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, _080A4940 + ldr r2, _080A4944 + 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 + .align 2, 0 +_080A4938: .4byte 0x02038437 +_080A493C: .4byte 0x02038430 +_080A4940: .4byte 0x02020630 +_080A4944: .4byte 0x020241e4 +_080A4948: + movs r4, 0 +_080A494A: + ldr r0, _080A4974 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A4978 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xC] + ldr r1, _080A497C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A4974: .4byte sub_80A4980 + 1 +_080A4978: .4byte 0x03005e00 +_080A497C: .4byte 0x020383f0 + 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, _080A49C0 + 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 + .align 2, 0 +_080A49C0: .4byte 0x03005e00 +_080A49C4: + movs r4, 0x1 +_080A49C6: + ldr r6, _080A4A10 + 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, _080A4A14 + 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 + .align 2, 0 +_080A4A10: .4byte 0x02038430 +_080A4A14: .4byte 0x03005e00 + thumb_func_end sub_80A4980 + + thumb_func_start sub_80A4A18 +sub_80A4A18: @ 80A4A18 + push {r4,r5,lr} + ldr r0, _080A4A2C + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4A30 + movs r5, 0x2 + b _080A4A3A + .align 2, 0 +_080A4A2C: .4byte 0x020383f0 +_080A4A30: + cmp r5, 0x1 + bne _080A4A36 + movs r5, 0x3 +_080A4A36: + cmp r5, 0 + beq _080A4A3E +_080A4A3A: + cmp r5, 0x2 + bne _080A4A48 +_080A4A3E: + ldr r0, _080A4A44 + b _080A4A4A + .align 2, 0 +_080A4A44: .4byte 0x02038436 +_080A4A48: + ldr r0, _080A4A7C +_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 + .align 2, 0 +_080A4A7C: .4byte 0x02038437 +_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, _080A4AD8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A4AD8: .4byte 0x020383f0 + thumb_func_end sub_80A4A18 + + thumb_func_start ma23_8073484 +ma23_8073484: @ 80A4ADC + push {r4-r6,lr} + ldr r0, _080A4AF0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4AF4 + movs r5, 0x2 + b _080A4AFE + .align 2, 0 +_080A4AF0: .4byte 0x020383f0 +_080A4AF4: + cmp r5, 0x1 + bne _080A4AFA + movs r5, 0x3 +_080A4AFA: + cmp r5, 0 + beq _080A4B02 +_080A4AFE: + cmp r5, 0x2 + bne _080A4B0C +_080A4B02: + ldr r0, _080A4B08 + b _080A4B0E + .align 2, 0 +_080A4B08: .4byte 0x02038436 +_080A4B0C: + ldr r0, _080A4B6C +_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, _080A4B70 + ldr r0, _080A4B74 + 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, _080A4B70 + ldr r0, _080A4B74 + 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 + .align 2, 0 +_080A4B6C: .4byte 0x02038437 +_080A4B70: .4byte 0x02020630 +_080A4B74: .4byte 0x020241e4 +_080A4B78: + movs r5, 0 +_080A4B7A: + ldr r0, _080A4BA4 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A4BA8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r6, [r1, 0xC] + ldr r1, _080A4BAC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A4BA4: .4byte sub_80A4BB0 + 1 +_080A4BA8: .4byte 0x03005e00 +_080A4BAC: .4byte 0x020383f0 + 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, _080A4BF4 + 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 + .align 2, 0 +_080A4BF4: .4byte 0x03005e00 +_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, _080A4C44 + 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 + .align 2, 0 +_080A4C44: .4byte 0x03005e00 + 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, _080A4C7C + 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 lcd_io_set + orrs r5, r4 + movs r0, 0x52 + adds r1, r5, 0 + bl lcd_io_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A4C7C: .4byte 0x020383f0 + 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, _080A4CA4 + 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 lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080A4CA4: .4byte 0x020383f0 + thumb_func_end ma1E_set_BLDCNT + + thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA +ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 + push {lr} + ldr r1, _080A4CC8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080A4CC8: .4byte 0x020383f0 + thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA + + thumb_func_start ma0E_call +ma0E_call: @ 80A4CCC + push {r4,lr} + ldr r4, _080A4CF8 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldr r2, _080A4CFC + 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 + .align 2, 0 +_080A4CF8: .4byte 0x020383f0 +_080A4CFC: .4byte 0x020383f4 + thumb_func_end ma0E_call + + thumb_func_start sub_80A4D00 +sub_80A4D00: @ 80A4D00 + ldr r0, _080A4D0C + ldr r1, _080A4D10 + ldr r1, [r1] + str r1, [r0] + bx lr + .align 2, 0 +_080A4D0C: .4byte 0x020383f0 +_080A4D10: .4byte 0x020383f4 + thumb_func_end sub_80A4D00 + + thumb_func_start ma10_080736AC +ma10_080736AC: @ 80A4D14 + push {r4,r5,lr} + ldr r5, _080A4D40 + 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, _080A4D44 + lsls r2, 1 + adds r2, r0 + strh r4, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A4D40: .4byte 0x020383f0 +_080A4D44: .4byte 0x0203841e + thumb_func_end ma10_080736AC + + thumb_func_start ma11_if_else +ma11_if_else: @ 80A4D48 + push {lr} + ldr r3, _080A4D80 + ldr r2, [r3] + adds r0, r2, 0x1 + str r0, [r3] + ldr r0, _080A4D84 + 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 + .align 2, 0 +_080A4D80: .4byte 0x020383f0 +_080A4D84: .4byte 0x02038432 + thumb_func_end ma11_if_else + + thumb_func_start ma12_cond_if +ma12_cond_if: @ 80A4D88 + push {r4,r5,lr} + ldr r5, _080A4DB8 + ldr r4, [r5] + adds r2, r4, 0x1 + str r2, [r5] + ldrb r1, [r4, 0x1] + adds r3, r2, 0x1 + str r3, [r5] + ldr r0, _080A4DBC + 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 + .align 2, 0 +_080A4DB8: .4byte 0x020383f0 +_080A4DBC: .4byte 0x02038432 +_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, _080A4DEC + 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 + .align 2, 0 +_080A4DEC: .4byte 0x020383f0 + thumb_func_end ma13_goto + + thumb_func_start sub_80A4DF0 +sub_80A4DF0: @ 80A4DF0 + push {lr} + ldr r0, _080A4E08 + ldr r1, _080A4E0C + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A4E10 + movs r0, 0 + b _080A4E12 + .align 2, 0 +_080A4E08: .4byte 0x030022c0 +_080A4E0C: .4byte 0x00000439 +_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, _080A4E4C + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r4, [r2, 0x1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _080A4E50 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A4E54 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r1, _080A4E58 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A4E4C: .4byte 0x020383f0 +_080A4E50: .4byte task_p5_load_battle_screen_elements + 1 +_080A4E54: .4byte 0x03005e00 +_080A4E58: .4byte 0x02038433 + 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, _080A4E9C + 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, _080A4EA0 + 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, _080A4EA4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] + b _080A4EDA + .align 2, 0 +_080A4E9C: .4byte 0x020383f0 +_080A4EA0: .4byte task_p5_load_battle_screen_elements + 1 +_080A4EA4: .4byte 0x03005e00 +_080A4EA8: + ldr r0, _080A4EC4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A4ECC + ldr r1, _080A4EC8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x8] + b _080A4EDA + .align 2, 0 +_080A4EC4: .4byte 0x02038437 +_080A4EC8: .4byte 0x03005e00 +_080A4ECC: + ldr r1, _080A4EEC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + mov r1, r8 + strh r1, [r0, 0x8] +_080A4EDA: + ldr r1, _080A4EF0 + movs r0, 0x1 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A4EEC: .4byte 0x03005e00 +_080A4EF0: .4byte 0x02038433 + 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, _080A4F28 + 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 + .align 2, 0 +_080A4F28: .4byte 0x03005e00 +_080A4F2C: + ldr r2, _080A4F48 + 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, _080A4F4C + movs r0, 0x2 + strb r0, [r1] + b _080A4F94 + .align 2, 0 +_080A4F48: .4byte 0x02037fd4 +_080A4F4C: .4byte 0x02038433 +_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, _080A4F90 + 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 + .align 2, 0 +_080A4F90: .4byte 0x03005e00 +_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, _080A4FC4 + strb r4, [r0] +_080A4FBC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A4FC4: .4byte 0x02038433 + 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, _080A5038 + 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, _080A503C + adds r1, r5, 0 + bl call_LZZUnCompWram + 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, _080A5040 + ldr r0, _080A5044 + str r5, [r0] + str r1, [r0, 0x4] + ldr r1, _080A5048 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + adds r0, r4, r6 + ldr r0, [r0] + ldr r1, _080A504C + bl call_LZZUnCompVram + 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 + .align 2, 0 +_080A5038: .4byte 0x08525d54 +_080A503C: .4byte 0x0201c000 +_080A5040: .4byte 0x0600d000 +_080A5044: .4byte 0x040000d4 +_080A5048: .4byte 0x84000200 +_080A504C: .4byte 0x06002000 +_080A5050: + ldr r5, _080A5084 + 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, _080A5088 + bl call_LZZUnCompVram + adds r0, r4, r5 + ldr r0, [r0] + ldr r1, _080A508C + bl call_LZZUnCompVram + 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 + .align 2, 0 +_080A5084: .4byte 0x08525d54 +_080A5088: .4byte 0x0600d000 +_080A508C: .4byte 0x06008000 + 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 sub_8035770 +_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, _080A50DC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _080A50E0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A50E4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _080A50E8 + strh r0, [r1, 0x8] + ldr r1, _080A50EC + movs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080A50DC: .4byte 0x020383f0 +_080A50E0: .4byte task_p5_load_battle_screen_elements + 1 +_080A50E4: .4byte 0x03005e00 +_080A50E8: .4byte 0x0000ffff +_080A50EC: .4byte 0x02038433 + 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, _080A5108 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080A5114 + ldr r1, _080A510C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, _080A5110 + movs r0, 0 + b _080A5118 + .align 2, 0 +_080A5108: .4byte 0x02038433 +_080A510C: .4byte 0x020383f0 +_080A5110: .4byte 0x020383fc +_080A5114: + ldr r1, _080A5120 + movs r0, 0x1 +_080A5118: + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080A5120: .4byte 0x020383fc + thumb_func_end ma16_wait_for_battle_screen_elements_s2 + + thumb_func_start sub_80A5124 +sub_80A5124: @ 80A5124 + push {lr} + ldr r0, _080A513C + ldrb r2, [r0] + cmp r2, 0 + bne _080A5148 + ldr r0, _080A5140 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, _080A5144 + strb r2, [r0] + b _080A514E + .align 2, 0 +_080A513C: .4byte 0x02038433 +_080A5140: .4byte 0x020383f0 +_080A5144: .4byte 0x020383fc +_080A5148: + ldr r1, _080A5154 + movs r0, 0x1 + strb r0, [r1] +_080A514E: + pop {r0} + bx r0 + .align 2, 0 +_080A5154: .4byte 0x020383fc + thumb_func_end sub_80A5124 + + thumb_func_start ma18_load_background_probably +ma18_load_background_probably: @ 80A5158 + push {r4,lr} + ldr r4, _080A5174 + 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 + .align 2, 0 +_080A5174: .4byte 0x020383f0 + 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, _080A51B8 + ldr r1, [r0] + ldr r0, _080A51BC + 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 + .align 2, 0 +_080A51B8: .4byte 0x020244d0 +_080A51BC: .4byte 0x02038436 +_080A51C0: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A51E8 + ldr r0, _080A51E0 + ldr r1, _080A51E4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080A524C + cmp r0, 0x2 + bne _080A524C + cmp r4, 0x3F + beq _080A525E + b _080A524C + .align 2, 0 +_080A51E0: .4byte 0x02038436 +_080A51E4: .4byte 0x02038437 +_080A51E8: + ldr r0, _080A5210 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5226 + ldr r0, _080A5214 + 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 + .align 2, 0 +_080A5210: .4byte 0x02038436 +_080A5214: .4byte 0x02038437 +_080A5218: + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + beq _080A5252 + negs r0, r1 + lsls r0, 24 + b _080A5250 +_080A5226: + ldr r0, _080A5248 + 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 + .align 2, 0 +_080A5248: .4byte 0x02038437 +_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, _080A52B8 + ldr r1, [r0] + ldr r0, _080A52BC + 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 + .align 2, 0 +_080A52B8: .4byte 0x020244d0 +_080A52BC: .4byte 0x02038436 +_080A52C0: + ldr r0, _080A52E8 + 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 + .align 2, 0 +_080A52E8: .4byte 0x02038436 + 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, _080A5310 +_080A5306: + lsls r0, r1, 16 + asrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080A5310: .4byte 0x0000ffc0 + 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, _080A5388 + 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 + .align 2, 0 +_080A5388: .4byte 0x020383f0 + thumb_func_end ma19_08073BC8 + + thumb_func_start ma1A_8073C00 +ma1A_8073C00: @ 80A538C + push {r4,lr} + ldr r4, _080A53B4 + 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 + .align 2, 0 +_080A53B4: .4byte 0x020383f0 + 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, _080A5468 + 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, _080A546C + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A5470 + 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, _080A5474 + 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 + .align 2, 0 +_080A5468: .4byte 0x020383f0 +_080A546C: .4byte c3_08073CEC + 1 +_080A5470: .4byte 0x03005e00 +_080A5474: .4byte 0x020383ff + 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, _080A54BC + 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 + .align 2, 0 +_080A54BC: .4byte 0x03005e00 +_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, _080A5504 + 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 + .align 2, 0 +_080A5504: .4byte 0x020383ff + 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, _080A558C + 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, _080A5590 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A5594 + 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, _080A5598 + 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 + .align 2, 0 +_080A558C: .4byte 0x020383f0 +_080A5590: .4byte c3_08073CEC + 1 +_080A5594: .4byte 0x03005e00 +_080A5598: .4byte 0x020383ff + 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, _080A564C + 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, _080A5650 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A5654 + 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, _080A5658 + 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 + .align 2, 0 +_080A564C: .4byte 0x020383f0 +_080A5650: .4byte c3_08073CEC + 1 +_080A5654: .4byte 0x03005e00 +_080A5658: .4byte 0x020383ff + 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, _080A56D4 + 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, _080A56D8 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A56DC + 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, _080A56E0 + 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 + .align 2, 0 +_080A56D4: .4byte 0x020383f0 +_080A56D8: .4byte sub_80A56E4 + 1 +_080A56DC: .4byte 0x03005e00 +_080A56E0: .4byte 0x020383ff + 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, _080A5738 + 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, _080A573C + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A5732: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A5738: .4byte 0x03005e00 +_080A573C: .4byte 0x020383ff + thumb_func_end sub_80A56E4 + + thumb_func_start ma1D_08073FB4 +ma1D_08073FB4: @ 80A5740 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r6, _080A57A4 + 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, _080A57A8 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A57AC + 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, _080A57B0 + 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 + .align 2, 0 +_080A57A4: .4byte 0x020383f0 +_080A57A8: .4byte sub_80A57B4 + 1 +_080A57AC: .4byte 0x03005e00 +_080A57B0: .4byte 0x020383ff + 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, _080A57F0 + 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, _080A57F4 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A57E8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A57F0: .4byte 0x03005e00 +_080A57F4: .4byte 0x020383ff + thumb_func_end sub_80A57B4 + + thumb_func_start sub_80A57F8 +sub_80A57F8: @ 80A57F8 + push {r4-r6,lr} + ldr r4, _080A5860 + 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, _080A5864 + 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, _080A5868 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A5860: .4byte 0x020383f0 +_080A5864: .4byte 0x0203841e +_080A5868: .4byte 0x020383ff + thumb_func_end sub_80A57F8 + + thumb_func_start ma20_wait_for_something +ma20_wait_for_something: @ 80A586C + push {r4,r5,lr} + ldr r0, _080A58A4 + 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, _080A58A8 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bls _080A58BA + ldr r0, _080A58AC + bl MPlayStop_rev01 + ldr r0, _080A58B0 + bl MPlayStop_rev01 + strh r5, [r4] + b _080A58DE + .align 2, 0 +_080A58A4: .4byte 0x020383ff +_080A58A8: .4byte 0x0203842e +_080A58AC: .4byte 0x030075f0 +_080A58B0: .4byte 0x03007630 +_080A58B4: + ldr r1, _080A58C4 + movs r0, 0 + strh r0, [r1] +_080A58BA: + ldr r1, _080A58C8 + movs r0, 0x1 + strb r0, [r1] + b _080A58DE + .align 2, 0 +_080A58C4: .4byte 0x0203842e +_080A58C8: .4byte 0x020383fc +_080A58CC: + ldr r0, _080A58E4 + movs r2, 0 + strh r1, [r0] + ldr r1, _080A58E8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _080A58EC + strb r2, [r0] +_080A58DE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A58E4: .4byte 0x0203842e +_080A58E8: .4byte 0x020383f0 +_080A58EC: .4byte 0x020383fc + thumb_func_end ma20_wait_for_something + + thumb_func_start ma21_08074164 +ma21_08074164: @ 80A58F0 + push {r4-r6,lr} + ldr r5, _080A5930 + 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, _080A5934 + 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 + .align 2, 0 +_080A5930: .4byte 0x020383f0 +_080A5934: .4byte 0x0203841e +_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, _080A5974 + 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 + .align 2, 0 +_080A5974: .4byte 0x020383f0 +_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, _080A5998 + ldr r1, [r0] + ldrb r2, [r1, 0x1] + adds r1, 0x2 + str r1, [r0] + cmp r2, 0 + beq _080A59A0 + ldr r0, _080A599C + b _080A59A2 + .align 2, 0 +_080A5998: .4byte 0x020383f0 +_080A599C: .4byte 0x02038437 +_080A59A0: + ldr r0, _080A59D8 +_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 + .align 2, 0 +_080A59D8: .4byte 0x02038436 + thumb_func_end sub_80A5984 + + thumb_func_start sub_80A59DC +sub_80A59DC: @ 80A59DC + push {lr} + ldr r0, _080A5A08 + 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 + .align 2, 0 +_080A5A08: .4byte 0x020383f0 + thumb_func_end sub_80A59DC + + thumb_func_start sub_80A5A0C +sub_80A5A0C: @ 80A5A0C + push {r4-r7,lr} + ldr r1, _080A5A3C + ldr r0, [r1] + ldrb r6, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + ldr r7, _080A5A40 + ldrb r0, [r7] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, _080A5A44 + 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 + .align 2, 0 +_080A5A3C: .4byte 0x020383f0 +_080A5A40: .4byte 0x02038436 +_080A5A44: .4byte 0x02038437 +_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, _080A5AB4 + 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, _080A5AB8 + 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 + .align 2, 0 +_080A5AB4: .4byte 0x020383f0 +_080A5AB8: .4byte 0x02020630 + thumb_func_end ma2B_make_side_invisible + + thumb_func_start ma2C_make_side_visible +ma2C_make_side_visible: @ 80A5ABC + push {r4,lr} + ldr r4, _080A5AF4 + 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, _080A5AF8 + 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 + .align 2, 0 +_080A5AF4: .4byte 0x020383f0 +_080A5AF8: .4byte 0x02020630 + thumb_func_end ma2C_make_side_visible + + thumb_func_start sub_80A5AFC +sub_80A5AFC: @ 80A5AFC + push {r4-r7,lr} + ldr r1, _080A5B48 + 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, _080A5B4C + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, _080A5B50 + 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 + .align 2, 0 +_080A5B48: .4byte 0x020383f0 +_080A5B4C: .4byte 0x02038436 +_080A5B50: .4byte 0x02038437 +_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, _080A5B9C + 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 + .align 2, 0 +_080A5B9C: .4byte 0x02020630 +_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, _080A5BF8 + 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, _080A5BFC + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, _080A5C00 + 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 + .align 2, 0 +_080A5BF8: .4byte 0x020383f0 +_080A5BFC: .4byte 0x02038436 +_080A5C00: .4byte 0x02038437 +_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, _080A5C40 + 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 + .align 2, 0 +_080A5C40: .4byte 0x02020630 + thumb_func_end sub_80A5BAC + + thumb_func_start ma2F_stop_music +ma2F_stop_music: @ 80A5C44 + push {lr} + ldr r0, _080A5C60 + bl MPlayStop_rev01 + ldr r0, _080A5C64 + bl MPlayStop_rev01 + ldr r1, _080A5C68 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080A5C60: .4byte 0x030075f0 +_080A5C64: .4byte 0x03007630 +_080A5C68: .4byte 0x020383f0 + 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, _080A5C98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A5C98: .4byte _080A5C9C + .align 2, 0 +_080A5C9C: + .4byte _080A5CB0 + .4byte _080A5CD8 + .4byte _080A5CB0 + .4byte _080A5D00 + .4byte _080A5D00 +_080A5CB0: + ldr r4, _080A5CD0 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 22 + ldr r1, _080A5CD4 + ldr r1, [r1] + movs r2, 0x1 + ands r1, r2 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + b _080A5DB0 + .align 2, 0 +_080A5CD0: .4byte 0x08525f58 +_080A5CD4: .4byte 0x02022fec +_080A5CD8: + ldr r4, _080A5CF8 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 22 + ldr r1, _080A5CFC + ldr r1, [r1] + movs r2, 0x1 + ands r1, r2 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x1] + b _080A5DB0 + .align 2, 0 +_080A5CF8: .4byte 0x08525f58 +_080A5CFC: .4byte 0x02022fec +_080A5D00: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5D28 + ldr r0, _080A5D20 + 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 + .align 2, 0 +_080A5D20: .4byte 0x02039f34 +_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, _080A5D54 + 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, _080A5D58 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A5D5C + b _080A5D7E + .align 2, 0 +_080A5D54: .4byte 0x020244d0 +_080A5D58: .4byte 0x0202406e +_080A5D5C: .4byte 0x02024744 +_080A5D60: + ldr r0, _080A5D8C + 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, _080A5D90 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A5D94 +_080A5D7E: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + b _080A5D9A + .align 2, 0 +_080A5D8C: .4byte 0x020244d0 +_080A5D90: .4byte 0x0202406e +_080A5D94: .4byte 0x020244ec +_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, _080A5DFC + 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 + .align 2, 0 +_080A5DFC: .4byte 0x02039f34 +_080A5E00: + ldr r2, [r2, 0x8] + b _080A5E42 +_080A5E04: + ldr r0, _080A5E30 + 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, _080A5E34 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A5E38 + adds r0, r1 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + b _080A5E42 + .align 2, 0 +_080A5E30: .4byte 0x020244d0 +_080A5E34: .4byte 0x0202406e +_080A5E38: .4byte 0x020244ec +_080A5E3C: + ldr r0, _080A5E78 + 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 + .align 2, 0 +_080A5E78: .4byte 0x020244bc +_080A5E7C: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A5E86: + ldr r1, _080A5E8C + lsls r0, 2 + b _080A5F90 + .align 2, 0 +_080A5E8C: .4byte 0x083021d8 +_080A5E90: + ldr r0, _080A5EA4 + cmp r5, r0 + bne _080A5EB0 + ldr r0, _080A5EA8 + ldr r1, _080A5EAC + adds r1, r4, r1 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + b _080A5F94 + .align 2, 0 +_080A5EA4: .4byte 0x00000181 +_080A5EA8: .4byte 0x08525f8c +_080A5EAC: .4byte 0x020244e4 +_080A5EB0: + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + bls _080A5EC0 + ldr r0, _080A5EBC + b _080A5F92 + .align 2, 0 +_080A5EBC: .4byte 0x083021d8 +_080A5EC0: + ldr r1, _080A5EC4 + b _080A5F8E + .align 2, 0 +_080A5EC4: .4byte 0x083021d8 +_080A5EC8: + cmp r5, 0xC9 + bne _080A5F58 + ldr r0, _080A5EF8 + 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, _080A5EFC + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A5F00 + adds r0, r1 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + b _080A5F0A + .align 2, 0 +_080A5EF8: .4byte 0x020244d0 +_080A5EFC: .4byte 0x0202406e +_080A5F00: .4byte 0x02024744 +_080A5F04: + ldr r0, _080A5F40 + 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 + .align 2, 0 +_080A5F40: .4byte 0x020244bc +_080A5F44: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A5F4E: + ldr r1, _080A5F54 + lsls r0, 2 + b _080A5F90 + .align 2, 0 +_080A5F54: .4byte 0x08300d38 +_080A5F58: + ldr r0, _080A5F70 + cmp r5, r0 + bne _080A5F7C + ldr r0, _080A5F74 + ldr r1, _080A5F78 + adds r1, r4, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _080A5F94 + .align 2, 0 +_080A5F70: .4byte 0x00000181 +_080A5F74: .4byte 0x08525f78 +_080A5F78: .4byte 0x020244e4 +_080A5F7C: + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + bls _080A5F8C + ldr r0, _080A5F88 + b _080A5F92 + .align 2, 0 +_080A5F88: .4byte 0x08300d38 +_080A5F8C: + ldr r1, _080A5F9C +_080A5F8E: + lsls r0, r5, 2 +_080A5F90: + adds r0, r1 +_080A5F92: + ldrb r0, [r0, 0x1] +_080A5F94: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080A5F9C: .4byte 0x08300d38 + 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, _080A5FDC + cmp r4, r0 + bne _080A5FE8 + ldr r0, _080A5FE0 + ldr r1, _080A5FE4 + adds r1, r6, r1 + ldrb r1, [r1] + adds r1, r0 + ldrb r5, [r1] + b _080A5FFE + .align 2, 0 +_080A5FDC: .4byte 0x00000181 +_080A5FE0: .4byte 0x08525f88 +_080A5FE4: .4byte 0x020244e4 +_080A5FE8: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _080A5FF8 + ldr r0, _080A5FF4 + b _080A5FFC + .align 2, 0 +_080A5FF4: .4byte 0x08305dcc +_080A5FF8: + ldr r0, _080A6008 + adds r0, r7, r0 +_080A5FFC: + ldrb r5, [r0] +_080A5FFE: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A6008: .4byte 0x08305dcc + 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, _080A60A4 + lsls r0, 24 + lsrs r0, 22 + ldr r1, _080A60A8 + 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 + .align 2, 0 +_080A60A4: .4byte 0x08525f58 +_080A60A8: .4byte 0x02022fec + 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, _080A60E0 + 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 + .align 2, 0 +_080A60E0: .4byte 0x02039f34 +_080A60E4: + ldrh r1, [r2] + b _080A610E +_080A60E8: + ldr r0, _080A6104 + 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, _080A6108 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + b _080A610E + .align 2, 0 +_080A6104: .4byte 0x020244d0 +_080A6108: .4byte 0x02038438 +_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, _080A61D8 + 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, _080A61DC + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A61E0 + b _080A6202 + .align 2, 0 +_080A61D8: .4byte 0x020244d0 +_080A61DC: .4byte 0x0202406e +_080A61E0: .4byte 0x02024744 +_080A61E4: + ldr r0, _080A6210 + 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, _080A6214 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A6218 +_080A6202: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + b _080A621E + .align 2, 0 +_080A6210: .4byte 0x020244d0 +_080A6214: .4byte 0x0202406e +_080A6218: .4byte 0x020244ec +_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, _080A6260 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A62B6 + ldr r1, _080A6264 + ldrb r0, [r4] + b _080A62C6 + .align 2, 0 +_080A6260: .4byte 0x02038436 +_080A6264: .4byte 0x020241e4 +_080A6268: + cmp r0, 0x1 + bne _080A6288 + ldr r4, _080A6280 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A62B6 + ldr r1, _080A6284 + ldrb r0, [r4] + b _080A62C6 + .align 2, 0 +_080A6280: .4byte 0x02038437 +_080A6284: .4byte 0x020241e4 +_080A6288: + cmp r1, 0x2 + bne _080A62A4 + ldr r5, _080A62A0 + 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 + .align 2, 0 +_080A62A0: .4byte 0x02038436 +_080A62A4: + ldr r5, _080A62BC + 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 + .align 2, 0 +_080A62BC: .4byte 0x02038437 +_080A62C0: + ldr r1, _080A62D0 + ldrb r0, [r5] + eors r0, r4 +_080A62C6: + adds r0, r1 + ldrb r0, [r0] +_080A62CA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080A62D0: .4byte 0x020241e4 + 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, _080A6328 + b _080A6334 + .align 2, 0 +_080A6328: .4byte 0xffffff00 +_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, _080A63A4 + b _080A63B0 + .align 2, 0 +_080A63A4: .4byte 0xffffff00 +_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, _080A640C + b _080A6418 + .align 2, 0 +_080A640C: .4byte 0xffffff00 +_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, _080A642C + b _080A6438 + .align 2, 0 +_080A642C: .4byte 0xffffff00 +_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, _080A648C + b _080A6498 + .align 2, 0 +_080A648C: .4byte 0xffffff00 +_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, _080A64E8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A64E8: .4byte sub_80A653C + 1 + 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, _080A6628 + 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, _080A662C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A6628: .4byte 0x02038437 +_080A662C: .4byte sub_80A64D0 + 1 + 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, _080A6670 + 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 + .align 2, 0 +_080A6670: .4byte 0x02020630 +_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, _080A66CC + 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 + .align 2, 0 +_080A66CC: .4byte 0x02020630 +_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, _080A679C + 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, _080A67A0 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A679C: .4byte 0x02038436 +_080A67A0: .4byte sub_80A64D0 + 1 + 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 lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + 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 lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + 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, _080A6860 + 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 + .align 2, 0 +_080A6860: .4byte 0x02038436 + 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, _080A689C + ldrb r0, [r7] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080A68A0 + 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 + .align 2, 0 +_080A689C: .4byte 0x02038436 +_080A68A0: .4byte 0x02038437 +_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, _080A69C4 + 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, _080A69C8 + 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 + .align 2, 0 +_080A69C4: .4byte 0x02038437 +_080A69C8: .4byte 0x0203841e + 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, _080A69EC + 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 + .align 2, 0 +_080A69EC: .4byte 0x02038436 +_080A69F0: + ldr r4, _080A6A28 + 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, _080A6A2C + 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 + .align 2, 0 +_080A6A28: .4byte 0x02038436 +_080A6A2C: .4byte 0x0203841e + 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, _080A6A40 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_080A6A40: .4byte 0x02024076 + 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, _080A6A50 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080A6A50: .4byte 0x02024076 + 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, _080A6A88 + ldrb r2, [r0] + cmp r1, r2 + bcs _080A6A7E + ldr r4, _080A6A8C + 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 + .align 2, 0 +_080A6A88: .4byte 0x0202406c +_080A6A8C: .4byte 0x02024076 + 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, _080A6AB4 + ldrb r0, [r0] + cmp r0, r4 + beq _080A6B0A + ldr r0, _080A6AB8 + ldrb r0, [r0] + cmp r0, r4 + beq _080A6B0A + b _080A6B18 + .align 2, 0 +_080A6AB4: .4byte 0x02038436 +_080A6AB8: .4byte 0x02038437 +_080A6ABC: + ldr r0, _080A6AE4 + 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, _080A6AE8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A6AEC + b _080A6AFE + .align 2, 0 +_080A6AE4: .4byte 0x02024076 +_080A6AE8: .4byte 0x0202406e +_080A6AEC: .4byte 0x02024744 +_080A6AF0: + ldr r1, _080A6B10 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A6B14 +_080A6AFE: + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080A6B18 +_080A6B0A: + movs r0, 0x1 + b _080A6B1A + .align 2, 0 +_080A6B10: .4byte 0x0202406e +_080A6B14: .4byte 0x020244ec +_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, _080A6B2C + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_080A6B2C: .4byte 0x02022fec + 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, _080A6B5C + ldr r0, [r0] + str r0, [r4] + ldr r0, _080A6B60 + 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 + .align 2, 0 +_080A6B5C: .4byte 0x0202305c +_080A6B60: .4byte 0x02023060 +_080A6B64: + ldr r0, _080A6B88 + ldr r0, [r0] + str r0, [r4] + ldr r0, _080A6B8C + 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 + .align 2, 0 +_080A6B88: .4byte 0x0202305c +_080A6B8C: .4byte 0x02023060 + 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, _080A6BBC + ldr r0, [r0] + str r0, [r4] + ldr r0, _080A6BC0 + 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 + .align 2, 0 +_080A6BBC: .4byte 0x0202305c +_080A6BC0: .4byte 0x02023060 +_080A6BC4: + cmp r5, 0x1 + bne _080A6BD0 + adds r0, r4, 0 + bl sub_80A6B30 + b _080A6BEC +_080A6BD0: + ldr r0, _080A6BF4 + ldr r0, [r0] + str r0, [r4] + ldr r0, _080A6BF8 + 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 + .align 2, 0 +_080A6BF4: .4byte 0x0202305c +_080A6BF8: .4byte 0x02023060 + thumb_func_end sub_80A6B90 + + thumb_func_start sub_80A6BFC +sub_80A6BFC: @ 80A6BFC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _080A6C28 + ldr r0, [r0] + str r0, [r4] + ldr r0, _080A6C2C + 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 + .align 2, 0 +_080A6C28: .4byte 0x0202305c +_080A6C2C: .4byte 0x02023060 +_080A6C30: + ldr r0, _080A6C4C + 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 + .align 2, 0 +_080A6C4C: .4byte 0x02038436 +_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, _080A6CBC + 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 gpu_copy_bg_tile_pattern_data_to_vram + 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 Bg_FillWramTileMapRectWithTileAndPalette + add r0, sp, 0xC + ldrb r0, [r0, 0x9] + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x20 + pop {r0} + bx r0 + .align 2, 0 +_080A6CBC: .4byte 0x05000800 + 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, _080A6D08 + ldr r1, [r4] + ldr r2, _080A6D0C + mov r0, sp + bl CpuSet + ldr r1, [r4] + mov r0, r8 + bl call_LZZUnCompWram + 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 gpu_copy_bg_tile_pattern_data_to_vram + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A6D08: .4byte 0x0202305c +_080A6D0C: .4byte 0x05000800 + 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 Bg_FillWramTileMapRectWithTileAndPalette + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + 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 gpu_copy_wram_bg_tilemap_to_vram + 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 gpu_copy_wram_bg_tilemap_to_vram + 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, _080A6E10 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A6E10: .4byte sub_80A65A8 + 1 + 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, _080A6EC8 + ands r6, r0 +_080A6EBC: + mov r3, r9 + cmp r3, 0 + beq _080A6ECC + movs r0, 0x1 + orrs r5, r0 + b _080A6ED0 + .align 2, 0 +_080A6EC8: .4byte 0x0000fffe +_080A6ECC: + ldr r0, _080A6EE8 + 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 + .align 2, 0 +_080A6EE8: .4byte 0x0000fffe + 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, _080A6F10 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A6F10: .4byte sub_80A6F98 + 1 + 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, _080A6F38 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A6F38: .4byte sub_80A6FB4 + 1 + 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, _080A7024 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A7024: .4byte sub_80A6F98 + 1 + 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, _080A709C + ands r6, r0 +_080A7090: + mov r3, r9 + cmp r3, 0 + beq _080A70A0 + movs r0, 0x1 + orrs r5, r0 + b _080A70A4 + .align 2, 0 +_080A709C: .4byte 0x0000fffe +_080A70A0: + ldr r0, _080A70BC + 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 + .align 2, 0 +_080A70BC: .4byte 0x0000fffe + 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, _080A70E4 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A70E4: .4byte sub_80A7144 + 1 + 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, _080A71B0 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A71B0: .4byte sub_80A7144 + 1 + 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, _080A722C + 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, _080A7230 + 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 _082E709C + ldr r0, _080A7234 + 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 + .align 2, 0 +_080A722C: .4byte 0xffff0000 +_080A7230: .4byte 0x02020630 +_080A7234: .4byte 0x02021bc0 + 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, _080A7264 + 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 + .align 2, 0 +_080A7264: .4byte 0x02020630 +_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, _080A733C + 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, _080A733C + 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, _080A7340 + 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, _080A733C + 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 oam_center + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A733C: .4byte 0x02020630 +_080A7340: .4byte 0x020244d0 + 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, _080A739C + 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 oam_center + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A739C: .4byte 0x02020630 + thumb_func_end sub_80A7344 + + thumb_func_start sub_80A73A0 +sub_80A73A0: @ 80A73A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A73D8 + 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, _080A73DC + 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 + .align 2, 0 +_080A73D8: .4byte 0x02020630 +_080A73DC: .4byte 0x02021bc0 + 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 oam_center +_080A742E: + ldr r6, _080A7494 + 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 _082E709C + ldr r0, _080A7498 + 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 + .align 2, 0 +_080A7494: .4byte 0xffff0000 +_080A7498: .4byte 0x02021bc0 + 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 oam_center + 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, _080A757C + ldr r1, _080A7580 + 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, _080A7584 + 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 + .align 2, 0 +_080A757C: .4byte 0x02037714 +_080A7580: .4byte 0x02037b14 +_080A7584: .4byte 0xfffffc1f +_080A7588: + lsls r1, r0, 1 + ldr r0, _080A75A0 + adds r0, r1, r0 + ldr r2, _080A75A4 + adds r1, r2 + ldr r2, _080A75A8 + bl CpuSet +_080A7598: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A75A0: .4byte 0x02037714 +_080A75A4: .4byte 0x02037b14 +_080A75A8: .4byte 0x04000008 + 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, _080A768C + 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, _080A7690 + 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, _080A768C + 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, _080A7690 + 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 + .align 2, 0 +_080A768C: .4byte 0x02038436 +_080A7690: .4byte 0x02038437 +_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, _080A77F4 + 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 + .align 2, 0 +_080A77F4: .4byte 0x0203841e +_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, _080A7898 + 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, _080A789C + 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, _080A78A0 + 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, _080A78A4 + str r0, [r5, 0x1C] + ldr r1, _080A78A8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A7898: .4byte 0x0203841e +_080A789C: .4byte 0x02038436 +_080A78A0: .4byte 0x02038437 +_080A78A4: .4byte sub_80A6EEC + 1 +_080A78A8: .4byte move_anim_8072740 + 1 + 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, _080A790C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A78CC + ldr r1, _080A7910 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080A78CC: + ldr r4, _080A7910 + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, _080A7914 + 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, _080A7918 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A790C: .4byte 0x02038436 +_080A7910: .4byte 0x0203841e +_080A7914: .4byte 0x02038437 +_080A7918: .4byte sub_80A791C + 1 + 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, _080A794C + movs r2, 0xC + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _080A7950 + movs r4, 0x1 + movs r7, 0x3 + b _080A7954 + .align 2, 0 +_080A794C: .4byte 0x0203841e +_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, _080A7968 + b _080A7976 + .align 2, 0 +_080A7968: .4byte 0x02038436 +_080A796C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80A6980 + ldr r0, _080A79D4 +_080A7976: + ldrb r6, [r0] + ldr r0, _080A79D8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A798E + ldr r1, _080A79DC + 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, _080A79DC + 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, _080A79E0 + str r0, [r5, 0x1C] + ldr r1, _080A79E4 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A79D4: .4byte 0x02038437 +_080A79D8: .4byte 0x02038436 +_080A79DC: .4byte 0x0203841e +_080A79E0: .4byte sub_80A6EEC + 1 +_080A79E4: .4byte move_anim_8072740 + 1 + 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, _080A7A44 + 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 + .align 2, 0 +_080A7A44: .4byte 0x02020630 +_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 obj_delete_and_free_tiles + 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, _080A7AEC + 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, _080A7AF0 +_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, _080A7AF0 +_080A7AA8: + ldr r0, _080A7AF4 + 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 lcd_io_set + ldr r0, _080A7AF8 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A7AEC: .4byte 0x0203841e +_080A7AF0: .4byte 0x0000ffff +_080A7AF4: .4byte 0x03005e00 +_080A7AF8: .4byte sub_80A7AFC + 1 + 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, _080A7B48 + 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 + .align 2, 0 +_080A7B48: .4byte 0x03005e00 +_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 lcd_io_set + 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, _080A7BB8 + 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 + .align 2, 0 +_080A7BB8: .4byte 0x0203841e +_080A7BBC: + ldr r1, _080A7BE8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, _080A7BEC + 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, _080A7BF0 + adds r2, r3, 0 + adds r1, r2 + strh r1, [r0, 0x8] + bl sub_80A7BF4 +_080A7BE2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A7BE8: .4byte 0x03005e00 +_080A7BEC: .4byte 0x02020630 +_080A7BF0: .4byte 0x00000101 + thumb_func_end sub_80A7B98 + + thumb_func_start sub_80A7BF4 +sub_80A7BF4: @ 80A7BF4 + ldr r3, _080A7C14 + 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, _080A7C18 + str r1, [r0] + bx lr + .align 2, 0 +_080A7C14: .4byte 0x0203841e +_080A7C18: .4byte sub_80A7C1C + 1 + 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, _080A7C74 + 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 + .align 2, 0 +_080A7C74: .4byte 0x03005e00 +_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, _080A7CD4 + ldrh r0, [r0] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080A7CD8 + adds r0, r4, 0 + bl move_anim_task_del + b _080A7CEE + .align 2, 0 +_080A7CD4: .4byte 0x0203841e +_080A7CD8: + ldr r1, _080A7CF4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + lsls r1, r2, 4 + ldr r2, _080A7CF8 + adds r1, r2 + strh r1, [r0, 0x8] + bl sub_80A7BF4 +_080A7CEE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A7CF4: .4byte 0x03005e00 +_080A7CF8: .4byte 0x00000101 + 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, _080A7DD4 + 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, _080A7DD8 + 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 + .align 2, 0 +_080A7DD4: .4byte 0x02038444 +_080A7DD8: .4byte 0x00007ffe +_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, _080A7E2C + ldr r5, _080A7E30 +_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 + .align 2, 0 +_080A7E2C: .4byte 0x02038444 +_080A7E30: .4byte 0x00007ffd +_080A7E34: + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + b _080A7E62 +_080A7E3C: + ldr r2, _080A7E5C + 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 + .align 2, 0 +_080A7E5C: .4byte 0x02020630 +_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, _080A7EB8 + 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, _080A7EBC + 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 + .align 2, 0 +_080A7EB8: .4byte 0x02020630 +_080A7EBC: .4byte 0x02021bc0 + 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, _080A7F10 + 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, _080A7F14 + 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 + .align 2, 0 +_080A7F10: .4byte 0x02020630 +_080A7F14: .4byte 0x02021bc0 + 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, _080A7F60 + 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, _080A7F64 + ldr r7, _080A7F68 + ldr r0, _080A7F6C + 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, _080A7F70 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r2, [r0] + ldr r1, _080A7F74 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + b _080A8042 + .align 2, 0 +_080A7F60: .4byte 0x02020630 +_080A7F64: .4byte 0x020241e4 +_080A7F68: .4byte 0x00000181 +_080A7F6C: .4byte 0x020244e4 +_080A7F70: .4byte 0x02039f34 +_080A7F74: .4byte 0x083021d8 +_080A7F78: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A7FD8 + ldr r0, _080A7FB4 + 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, _080A7FB8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A7FBC + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r2, r0, 16 + b _080A7FC2 + .align 2, 0 +_080A7FB4: .4byte 0x020244d0 +_080A7FB8: .4byte 0x0202406e +_080A7FBC: .4byte 0x020244ec +_080A7FC0: + ldrh r2, [r1, 0x2] +_080A7FC2: + cmp r2, r7 + bne _080A7FD0 + ldr r0, _080A7FCC + b _080A8018 + .align 2, 0 +_080A7FCC: .4byte 0x08525f8c +_080A7FD0: + ldr r0, _080A7FD4 + b _080A8026 + .align 2, 0 +_080A7FD4: .4byte 0x083021d8 +_080A7FD8: + ldr r0, _080A8004 + 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, _080A8008 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A800C + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r2, r0, 16 + b _080A8012 + .align 2, 0 +_080A8004: .4byte 0x020244d0 +_080A8008: .4byte 0x0202406e +_080A800C: .4byte 0x02024744 +_080A8010: + ldrh r2, [r1, 0x2] +_080A8012: + cmp r2, r7 + bne _080A8024 + ldr r0, _080A8020 +_080A8018: + ldrb r1, [r6] + adds r1, r0 + ldrb r0, [r1] + b _080A8042 + .align 2, 0 +_080A8020: .4byte 0x08525f88 +_080A8024: + ldr r0, _080A8030 +_080A8026: + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _080A8042 + .align 2, 0 +_080A8030: .4byte 0x08300d38 +_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, _080A813C + 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 + .align 2, 0 +_080A813C: .4byte 0x02020630 + thumb_func_end sub_80A80C8 + + thumb_func_start sub_80A8140 +sub_80A8140: @ 80A8140 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080A816C + 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, _080A8170 + strh r1, [r0, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_080A816C: .4byte 0x0203841a +_080A8170: .4byte 0x0203841e + 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, _080A8268 + ldrb r0, [r6] + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A81B4 + ldr r2, _080A826C + ldr r1, _080A8270 + 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, _080A8274 + mov r8, r0 + ldrb r0, [r0] + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A81EC + ldr r2, _080A826C + ldr r1, _080A8270 + 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, _080A826C + ldr r1, _080A8270 + 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, _080A826C + ldr r1, _080A8270 + 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 + .align 2, 0 +_080A8268: .4byte 0x02038437 +_080A826C: .4byte 0x02020630 +_080A8270: .4byte 0x020241e4 +_080A8274: .4byte 0x02038436 + thumb_func_end sub_80A8174 + + thumb_func_start sub_80A8278 +sub_80A8278: @ 80A8278 + push {r4-r6,lr} + movs r5, 0 + ldr r0, _080A82D8 + ldrb r0, [r0] + cmp r5, r0 + bge _080A82D2 + ldr r6, _080A82DC +_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, _080A82E0 + 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, _080A82D8 + ldrb r0, [r0] + cmp r5, r0 + blt _080A8286 +_080A82D2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A82D8: .4byte 0x0202406c +_080A82DC: .4byte 0x02020630 +_080A82E0: .4byte 0x020241e4 + 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, _080A8474 + adds r0, r1 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + ldr r1, _080A8478 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x2] + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080A847C + 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 malloc_and_clear + 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, _080A8480 + 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, _080A8484 + adds r0, r1 + ldr r1, _080A847C + ldr r1, [r1] + movs r3, 0xBE + lsls r3, 1 + adds r1, r3 + ldr r1, [r1] + movs r2, 0x1 + b _080A850A + .align 2, 0 +_080A8474: .4byte 0x08525fc0 +_080A8478: .4byte 0x08525f90 +_080A847C: .4byte 0x020244d4 +_080A8480: .4byte 0x020244d0 +_080A8484: .4byte 0x0830a18c +_080A8488: + lsls r0, r6, 3 + ldr r1, _080A84A8 + adds r0, r1 + ldr r1, _080A84AC + 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 load_poke_gfx_probably + b _080A8540 + .align 2, 0 +_080A84A8: .4byte 0x0830a18c +_080A84AC: .4byte 0x020244d4 +_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, _080A8518 + 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, _080A851C + adds r0, r1 + ldr r1, _080A8520 + 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 sub_8034B7C + b _080A8540 + .align 2, 0 +_080A8518: .4byte 0x020244d0 +_080A851C: .4byte 0x083028b8 +_080A8520: .4byte 0x020244d4 +_080A8524: + lsls r0, r6, 3 + ldr r1, _080A858C + adds r0, r1 + ldr r1, _080A8590 + 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 load_poke_gfx_probably +_080A8540: + ldr r5, _080A8590 + 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, _080A8594 + adds r1, r3 + movs r2, 0x80 + lsls r2, 4 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + 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, _080A8598 + adds r0, r1 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + ldr r3, _080A859C + b _080A85B2 + .align 2, 0 +_080A858C: .4byte 0x083028b8 +_080A8590: .4byte 0x020244d4 +_080A8594: .4byte 0x06010000 +_080A8598: .4byte 0x08525f90 +_080A859C: .4byte 0x08300d38 +_080A85A0: + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + ldr r1, _080A8600 + adds r0, r1 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + ldr r3, _080A8604 +_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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A85EE + ldr r3, _080A8608 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r1, r0, r1 + ldr r2, _080A860C + str r2, [r1] + adds r0, r3 + movs r1, 0 + bl sub_8008258 +_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 + .align 2, 0 +_080A8600: .4byte 0x08525f90 +_080A8604: .4byte 0x083021d8 +_080A8608: .4byte 0x02020630 +_080A860C: .4byte 0x082ff6c0 + thumb_func_end sub_80A8394 + + thumb_func_start sub_80A8610 +sub_80A8610: @ 80A8610 + push {lr} + bl obj_delete_and_free_resources + 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, _080A8650 + 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 + .align 2, 0 +_080A8650: .4byte 0x02039f34 +_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, _080A86A0 + b _080A8864 + .align 2, 0 +_080A86A0: .4byte 0x083021d8 +_080A86A4: + ldr r0, _080A86BC + 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, _080A86C0 + b _080A8864 + .align 2, 0 +_080A86BC: .4byte 0x00000181 +_080A86C0: .4byte 0x083021d8 +_080A86C4: + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A8790 + ldr r0, _080A8710 + 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, _080A8714 + mov r1, r8 + lsls r4, r1, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080A8718 + 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 + .align 2, 0 +_080A8710: .4byte 0x020244d0 +_080A8714: .4byte 0x0202406e +_080A8718: .4byte 0x020244ec +_080A871C: + ldrh r7, [r1, 0x2] + ldr r0, _080A875C + 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 + .align 2, 0 +_080A875C: .4byte 0x020244bc +_080A8760: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A876A: + lsls r1, r0, 2 + ldr r0, _080A8770 + b _080A8864 + .align 2, 0 +_080A8770: .4byte 0x083021d8 +_080A8774: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bls _080A8784 +_080A877C: + ldr r4, _080A8780 + b _080A8866 + .align 2, 0 +_080A8780: .4byte 0x083021d8 +_080A8784: + lsls r1, r7, 2 + ldr r0, _080A878C + b _080A8864 + .align 2, 0 +_080A878C: .4byte 0x083021d8 +_080A8790: + ldr r0, _080A87D0 + 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, _080A87D4 + mov r1, r8 + lsls r4, r1, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080A87D8 + 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 + .align 2, 0 +_080A87D0: .4byte 0x020244d0 +_080A87D4: .4byte 0x0202406e +_080A87D8: .4byte 0x02024744 +_080A87DC: + ldrh r7, [r1, 0x2] + ldr r0, _080A881C + 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 + .align 2, 0 +_080A881C: .4byte 0x020244bc +_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, _080A8844 + cmp r7, r0 + bne _080A8850 +_080A8834: + ldr r0, _080A8848 + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + ldr r1, _080A884C + adds r4, r0, r1 + b _080A8866 + .align 2, 0 +_080A8844: .4byte 0x00000181 +_080A8848: .4byte 0x020244e4 +_080A884C: .4byte 0x08525f78 +_080A8850: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bls _080A8860 + ldr r4, _080A885C + b _080A8866 + .align 2, 0 +_080A885C: .4byte 0x08300d38 +_080A8860: + lsls r1, r7, 2 +_080A8862: + ldr r0, _080A8878 +_080A8864: + adds r4, r1, r0 +_080A8866: + mov r0, r9 + cmp r0, 0x6 + bhi _080A8916 + lsls r0, 2 + ldr r1, _080A887C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A8878: .4byte 0x08300d38 +_080A887C: .4byte _080A8880 + .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, _080A8A60 + 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, _080A8A64 + 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, _080A8A68 + 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 + .align 2, 0 +_080A8A60: .4byte nullsub_12 + 1 +_080A8A64: .4byte 0x02020630 +_080A8A68: .4byte 0xfffffc00 + 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, _080A8AA4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A8AAC + ldr r2, _080A8AA8 + 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 + .align 2, 0 +_080A8AA4: .4byte 0x02038436 +_080A8AA8: .4byte 0x0203841e +_080A8AAC: + ldr r1, _080A8AE0 + 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, _080A8AE4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _080A8AE8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A8AE0: .4byte 0x0203841e +_080A8AE4: .4byte move_anim_8074EE0 + 1 +_080A8AE8: .4byte sub_80A66DC + 1 + thumb_func_end sub_80A8A6C + + thumb_func_start sub_80A8AEC +sub_80A8AEC: @ 80A8AEC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080A8B14 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A8B1C + ldr r2, _080A8B18 + 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 + .align 2, 0 +_080A8B14: .4byte 0x02038436 +_080A8B18: .4byte 0x0203841e +_080A8B1C: + ldr r1, _080A8B58 + 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 obj_anim_image_start + ldr r1, _080A8B5C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _080A8B60 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A8B58: .4byte 0x0203841e +_080A8B5C: .4byte move_anim_8074EE0 + 1 +_080A8B60: .4byte sub_80A66DC + 1 + 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, _080A8B88 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A8B90 + ldr r0, _080A8B8C + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _080A8B9C + .align 2, 0 +_080A8B88: .4byte 0x02038436 +_080A8B8C: .4byte 0x0203841e +_080A8B90: + ldr r1, _080A8BB8 + 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, _080A8BBC + str r0, [r4, 0x1C] + ldr r1, _080A8BC0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A8BB8: .4byte 0x0203841e +_080A8BBC: .4byte sub_80A67D8 + 1 +_080A8BC0: .4byte move_anim_8072740 + 1 + 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, _080A8C58 + 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, _080A8C5C + 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, _080A8C60 + 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, _080A8C64 + bl gpu_pal_alloc_new + 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 + .align 2, 0 +_080A8C58: .4byte 0x03005e00 +_080A8C5C: .4byte 0x02038436 +_080A8C60: .4byte 0x02020630 +_080A8C64: .4byte 0x00002771 +_080A8C68: + movs r0, 0x3 +_080A8C6A: + strh r0, [r5, 0x14] + lsls r0, r4, 1 + ldr r1, _080A8C98 + adds r0, r1 + lsls r1, r6, 1 + ldr r2, _080A8C9C + adds r1, r2 + ldr r2, _080A8CA0 + bl CpuSet + ldr r0, _080A8CA4 + ldrb r2, [r0, 0x2] + ldrh r3, [r0] + adds r0, r6, 0 + movs r1, 0x10 + bl pal_fade_1 + ldr r0, _080A8CA8 + str r0, [r5] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A8C98: .4byte 0x02037714 +_080A8C9C: .4byte 0x02037b14 +_080A8CA0: .4byte 0x04000008 +_080A8CA4: .4byte 0x0203841e +_080A8CA8: .4byte sub_80A8CAC + 1 + 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, _080A8CD0 + 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 + .align 2, 0 +_080A8CD0: .4byte 0x03005e00 +_080A8CD4: + cmp r0, 0x2 + beq _080A8D58 + b _080A8D6C +_080A8CDA: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A8D78 + ldr r2, _080A8D0C + 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 + .align 2, 0 +_080A8D0C: .4byte 0x02020630 +_080A8D10: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A8D78 + ldr r3, _080A8D54 + 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 + .align 2, 0 +_080A8D54: .4byte 0x02020630 +_080A8D58: + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080A8D6C + ldr r0, _080A8D74 + bl gpu_pal_free_tag + adds r0, r5, 0 + bl move_anim_task_del +_080A8D6C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A8D74: .4byte 0x00002771 + 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, _080A8DF4 + 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, _080A8DF8 + 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 + .align 2, 0 +_080A8DF4: .4byte 0x02020630 +_080A8DF8: .4byte sub_80A8DFC + 1 + 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, _080A8E2C + 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 + .align 2, 0 +_080A8E2C: .4byte 0x03005e00 + thumb_func_end sub_80A8DFC + + thumb_func_start sub_80A8E30 +sub_80A8E30: @ 80A8E30 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _080A8E64 + 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 + .align 2, 0 +_080A8E64: .4byte 0x02038436 +_080A8E68: + ldr r0, _080A8E7C +_080A8E6A: + strh r0, [r5, 0x2E] + ldr r0, _080A8E80 + strh r0, [r5, 0x30] + ldr r0, _080A8E84 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A8E7C: .4byte 0x0000fff6 +_080A8E80: .4byte 0x0000ffd8 +_080A8E84: .4byte sub_80A8E88 + 1 + 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, _080A8F1C + 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, _080A8F20 + 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 + .align 2, 0 +_080A8F1C: .4byte 0x0203841e +_080A8F20: .4byte 0x02038437 +_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, _080A8F48 + str r0, [r4, 0x1C] + ldr r1, _080A8F4C + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A8F48: .4byte sub_80A6EEC + 1 +_080A8F4C: .4byte move_anim_8072740 + 1 + thumb_func_end sub_80A8EE4 + + thumb_func_start clear_tasks +clear_tasks: @ 80A8F50 + push {r4-r7,lr} + movs r4, 0 + ldr r6, _080A8FA4 + adds r7, r6, 0 + adds r7, 0x8 +_080A8F5A: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r6 + movs r1, 0 + strb r1, [r2, 0x4] + ldr r1, _080A8FA8 + str r1, [r2] + strb r4, [r2, 0x5] + adds r4, 0x1 + strb r4, [r2, 0x6] + movs r1, 0x1 + negs r1, r1 + adds r5, r1, 0 + movs r1, 0xFF + strb r1, [r2, 0x7] + adds r0, r7 + movs r1, 0 + movs r2, 0x20 + bl memset + lsls r4, 24 + lsrs r4, 24 + cmp r4, 0xF + bls _080A8F5A + ldr r0, _080A8FA4 + movs r1, 0xFE + strb r1, [r0, 0x5] + ldr r1, _080A8FAC + adds r0, r1 + ldrb r1, [r0] + orrs r1, r5 + strb r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A8FA4: .4byte 0x03005e00 +_080A8FA8: .4byte nullsub_4 + 1 +_080A8FAC: .4byte 0x0000025e + thumb_func_end clear_tasks + + thumb_func_start AddTask +AddTask: @ 80A8FB0 + push {r4-r7,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r6, 0 + ldr r7, _080A8FEC +_080A8FBC: + lsls r0, r6, 2 + adds r0, r6 + lsls r5, r0, 3 + adds r4, r5, r7 + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _080A8FF0 + str r2, [r4] + strb r1, [r4, 0x7] + adds r0, r6, 0 + bl insert_task_in_order_by_priority + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r5, r0 + movs r1, 0 + movs r2, 0x20 + bl memset + movs r0, 0x1 + strb r0, [r4, 0x4] + adds r0, r6, 0 + b _080A8FFC + .align 2, 0 +_080A8FEC: .4byte 0x03005e00 +_080A8FF0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bls _080A8FBC + movs r0, 0 +_080A8FFC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddTask + + thumb_func_start insert_task_in_order_by_priority +insert_task_in_order_by_priority: @ 80A9004 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + bl get_first_active_task + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + bne _080A9034 + ldr r1, _080A9030 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFE + strb r1, [r0, 0x5] + movs r1, 0xFF + strb r1, [r0, 0x6] + b _080A9090 + .align 2, 0 +_080A9030: .4byte 0x03005e00 +_080A9034: + ldr r6, _080A9070 + lsls r0, r4, 2 + mov r12, r0 + mov r8, r6 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r6 +_080A9042: + lsls r0, r1, 2 + adds r0, r1 + lsls r5, r0, 3 + mov r7, r8 + adds r3, r5, r7 + ldrb r0, [r2, 0x7] + ldrb r7, [r3, 0x7] + cmp r0, r7 + bcs _080A9074 + ldrb r0, [r3, 0x5] + strb r0, [r2, 0x5] + strb r1, [r2, 0x6] + ldrb r0, [r3, 0x5] + cmp r0, 0xFE + beq _080A906C + adds r1, r0, 0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r8 + strb r4, [r0, 0x6] +_080A906C: + strb r4, [r3, 0x5] + b _080A9090 + .align 2, 0 +_080A9070: .4byte 0x03005e00 +_080A9074: + ldrb r0, [r3, 0x6] + cmp r0, 0xFF + beq _080A907E + adds r1, r0, 0 + b _080A9042 +_080A907E: + mov r2, r12 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r6 + strb r1, [r0, 0x5] + adds r2, r5, r6 + ldrb r1, [r2, 0x6] + strb r1, [r0, 0x6] + strb r4, [r2, 0x6] +_080A9090: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end insert_task_in_order_by_priority + + thumb_func_start remove_task +remove_task: @ 80A909C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080A90D0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r4 + ldrb r0, [r2, 0x4] + cmp r0, 0 + beq _080A9106 + movs r0, 0 + strb r0, [r2, 0x4] + ldrb r3, [r2, 0x5] + cmp r3, 0xFE + bne _080A90D4 + ldrb r0, [r2, 0x6] + cmp r0, 0xFF + beq _080A9106 + adds r1, r0, 0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strb r3, [r0, 0x5] + b _080A9106 + .align 2, 0 +_080A90D0: .4byte 0x03005e00 +_080A90D4: + ldrb r3, [r2, 0x6] + adds r0, r3, 0 + cmp r0, 0xFF + bne _080A90EC + ldrb r0, [r2, 0x5] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0xFF + strb r0, [r1, 0x6] + b _080A9106 +_080A90EC: + ldrb r1, [r2, 0x5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strb r3, [r0, 0x6] + ldrb r1, [r2, 0x6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r2, 0x5] + strb r1, [r0, 0x5] +_080A9106: + pop {r4} + pop {r0} + bx r0 + thumb_func_end remove_task + + thumb_func_start run_active_tasks +run_active_tasks: @ 80A910C + push {r4,r5,lr} + bl get_first_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _080A9130 + ldr r5, _080A9138 +_080A911C: + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r5 + ldr r1, [r4] + bl _call_via_r1 + ldrb r0, [r4, 0x6] + cmp r0, 0xFF + bne _080A911C +_080A9130: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A9138: .4byte 0x03005e00 + thumb_func_end run_active_tasks + + thumb_func_start get_first_active_task +get_first_active_task: @ 80A913C + push {lr} + movs r2, 0 + ldr r0, _080A9174 + ldrb r1, [r0, 0x4] + adds r3, r0, 0 + cmp r1, 0x1 + bne _080A9150 + ldrb r0, [r3, 0x5] + cmp r0, 0xFE + beq _080A916E +_080A9150: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bhi _080A916E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r3 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bne _080A9150 + ldrb r0, [r1, 0x5] + cmp r0, 0xFE + bne _080A9150 +_080A916E: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A9174: .4byte 0x03005e00 + thumb_func_end get_first_active_task + + thumb_func_start nullsub_4 +nullsub_4: @ 80A9178 + bx lr + thumb_func_end nullsub_4 + + thumb_func_start set_task_function_and_args_14_15 +set_task_function_and_args_14_15: @ 80A917C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080A91AC + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + adds r0, r3, 0 + adds r0, 0x1C + adds r4, r5, 0 + adds r4, 0x8 + adds r0, r4 + strh r2, [r0] + adds r0, r3, 0 + adds r0, 0x1E + adds r0, r4 + lsrs r2, 16 + strh r2, [r0] + adds r3, r5 + str r1, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A91AC: .4byte 0x03005e00 + thumb_func_end set_task_function_and_args_14_15 + + thumb_func_start set_task_function_to_args_14_15 +set_task_function_to_args_14_15: @ 80A91B0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080A91E0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r3 + adds r0, r1, 0 + adds r0, 0x1C + adds r3, 0x8 + adds r0, r3 + ldrh r2, [r0] + adds r1, 0x1E + adds r1, r3 + movs r3, 0 + ldrsh r0, [r1, r3] + lsls r0, 16 + orrs r2, r0 + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A91E0: .4byte 0x03005e00 + thumb_func_end set_task_function_to_args_14_15 + + thumb_func_start is_function_an_active_task +is_function_an_active_task: @ 80A91E4 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r4, _080A9204 +_080A91EC: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r4 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bne _080A9208 + ldr r0, [r1] + cmp r0, r3 + bne _080A9208 + movs r0, 0x1 + b _080A9214 + .align 2, 0 +_080A9204: .4byte 0x03005e00 +_080A9208: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080A91EC + movs r0, 0 +_080A9214: + pop {r4} + pop {r1} + bx r1 + thumb_func_end is_function_an_active_task + + thumb_func_start get_task_id_by_function +get_task_id_by_function: @ 80A921C + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, _080A9238 +_080A9224: + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bne _080A923C + ldr r0, [r1] + cmp r0, r3 + bne _080A923C + lsls r0, r2, 24 + lsrs r0, 24 + b _080A9246 + .align 2, 0 +_080A9238: .4byte 0x03005e00 +_080A923C: + adds r1, 0x28 + adds r2, 0x1 + cmp r2, 0xF + ble _080A9224 + movs r0, 0xFF +_080A9246: + pop {r1} + bx r1 + thumb_func_end get_task_id_by_function + + thumb_func_start sub_80A924C +sub_80A924C: @ 80A924C + push {lr} + movs r2, 0 + movs r1, 0 + ldr r3, _080A9278 +_080A9254: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + bne _080A9268 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080A9268: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080A9254 + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A9278: .4byte 0x03005e00 + thumb_func_end sub_80A924C + + thumb_func_start set_word_task_arg +set_word_task_arg: @ 80A927C + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + cmp r3, 0xE + bhi _080A92AA + ldr r2, _080A92B0 + lsls r0, r3, 1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r0, r1 + adds r2, 0x8 + adds r0, r2 + strh r5, [r0] + adds r0, r3, 0x1 + lsls r0, 1 + adds r0, r1 + adds r0, r2 + lsrs r1, r5, 16 + strh r1, [r0] +_080A92AA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A92B0: .4byte 0x03005e00 + thumb_func_end set_word_task_arg + + thumb_func_start get_word_task_arg +get_word_task_arg: @ 80A92B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0xE + bls _080A92C6 + movs r0, 0 + b _080A92E8 +_080A92C6: + ldr r3, _080A92F0 + lsls r0, r1, 1 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + adds r0, r2 + adds r3, 0x8 + adds r0, r3 + ldrh r0, [r0] + adds r1, 0x1 + lsls r1, 1 + adds r1, r2 + adds r1, r3 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 16 + orrs r0, r1 +_080A92E8: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080A92F0: .4byte 0x03005e00 + thumb_func_end get_word_task_arg + + thumb_func_start nullsub_35 +nullsub_35: @ 80A92F4 + bx lr + thumb_func_end nullsub_35 + + thumb_func_start sub_80A92F8 +sub_80A92F8: @ 80A92F8 + push {lr} + ldr r2, _080A9330 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + ldr r0, _080A9334 + adds r2, r0, 0 + adds r2, 0x21 + movs r1, 0 + strb r1, [r2] + adds r0, 0x22 + strb r1, [r0] + ldr r0, _080A9338 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080A9330: .4byte 0x02037fd4 +_080A9334: .4byte 0x02024474 +_080A9338: .4byte c2_80777E8 + 1 + thumb_func_end sub_80A92F8 + + thumb_func_start c2_80777E8 +c2_80777E8: @ 80A933C + push {r4-r7,lr} + sub sp, 0x8 + ldr r0, _080A9358 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x13 + bls _080A934C + b _080A95A4 +_080A934C: + lsls r0, 2 + ldr r1, _080A935C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A9358: .4byte 0x02024474 +_080A935C: .4byte _080A9360 + .align 2, 0 +_080A9360: + .4byte _080A93B0 + .4byte _080A942C + .4byte _080A9444 + .4byte _080A944A + .4byte _080A9450 + .4byte _080A9460 + .4byte _080A9466 + .4byte _080A948E + .4byte _080A9492 + .4byte _080A9496 + .4byte _080A949A + .4byte _080A94B8 + .4byte _080A94C0 + .4byte _080A94C8 + .4byte _080A94D0 + .4byte _080A94D8 + .4byte _080A94E0 + .4byte _080A94E8 + .4byte _080A94F0 + .4byte _080A94F8 +_080A93B0: + bl dp12_8087EA4 + bl trs_config + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + bl sub_80A1A74 + ldr r0, _080A940C + movs r1, 0 + strh r1, [r0] + ldr r0, _080A9410 + strh r1, [r0] + ldr r0, _080A9414 + strh r1, [r0] + ldr r0, _080A9418 + strh r1, [r0] + ldr r0, _080A941C + strh r1, [r0] + ldr r0, _080A9420 + strh r1, [r0] + ldr r0, _080A9424 + strh r1, [r0] + ldr r0, _080A9428 + strh r1, [r0] + b _080A95D2 + .align 2, 0 +_080A940C: .4byte 0x02022e14 +_080A9410: .4byte 0x02022e16 +_080A9414: .4byte 0x02022e18 +_080A9418: .4byte 0x02022e1a +_080A941C: .4byte 0x02022e1c +_080A9420: .4byte 0x02022e1e +_080A9424: .4byte 0x02022e20 +_080A9428: .4byte 0x02022e22 +_080A942C: + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _080A9440 + add r0, sp, 0x4 + bl CpuFastSet + b _080A95D2 + .align 2, 0 +_080A9440: .4byte 0x01006000 +_080A9444: + bl sub_8035AA4 + b _080A95D2 +_080A944A: + bl reset_all_obj_data + b _080A95D2 +_080A9450: + bl gpu_pal_allocator_reset + ldr r1, _080A945C + movs r0, 0x4 + strb r0, [r1] + b _080A95D2 + .align 2, 0 +_080A945C: .4byte 0x0300301c +_080A9460: + bl sub_805E350 + b _080A95D2 +_080A9466: + ldr r5, _080A9480 + adds r4, r5, 0 + adds r4, 0x22 + ldrb r0, [r4] + bl sub_805E08C + lsls r0, 24 + cmp r0, 0 + beq _080A9484 + movs r0, 0 + strb r0, [r4] + b _080A95D2 + .align 2, 0 +_080A9480: .4byte 0x02024474 +_080A9484: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r1, r5, 0 + b _080A94AA +_080A948E: + movs r0, 0 + b _080A949C +_080A9492: + movs r0, 0x1 + b _080A949C +_080A9496: + movs r0, 0x2 + b _080A949C +_080A949A: + movs r0, 0x3 +_080A949C: + bl sub_80A9614 + lsls r0, 24 + cmp r0, 0 + beq _080A94A8 + b _080A95D2 +_080A94A8: + ldr r1, _080A94B4 +_080A94AA: + adds r1, 0x21 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + b _080A95D2 + .align 2, 0 +_080A94B4: .4byte 0x02024474 +_080A94B8: + movs r0, 0 + bl sub_80A9708 + b _080A95D2 +_080A94C0: + movs r0, 0x1 + bl sub_80A9708 + b _080A95D2 +_080A94C8: + movs r0, 0x2 + bl sub_80A9708 + b _080A95D2 +_080A94D0: + movs r0, 0x3 + bl sub_80A9708 + b _080A95D2 +_080A94D8: + movs r0, 0 + bl sub_80A9ADC + b _080A95D2 +_080A94E0: + movs r0, 0x1 + bl sub_80A9ADC + b _080A95D2 +_080A94E8: + movs r0, 0x2 + bl sub_80A9ADC + b _080A95D2 +_080A94F0: + movs r0, 0x3 + bl sub_80A9ADC + b _080A95D2 +_080A94F8: + bl sub_805EC84 + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r7, _080A958C + lsls r0, r4, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080A9590 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A955C + movs r0, 0x3 + bl battle_get_side_with_given_state + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_080A955C: + ldr r1, _080A9594 + ldr r0, _080A9598 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, _080A959C + ldrb r0, [r0] + cmp r0, 0 + beq _080A95D2 + ldr r0, _080A95A0 + ldrb r0, [r0] + cmp r0, 0 + beq _080A95D2 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080A95D2 + .align 2, 0 +_080A958C: .4byte 0x0202406e +_080A9590: .4byte 0x02024744 +_080A9594: .4byte 0x020244ac +_080A9598: .4byte 0x020244b8 +_080A959C: .4byte 0x030030fc +_080A95A0: .4byte 0x03003124 +_080A95A4: + ldr r0, _080A95E4 + bl SetVBlankCallback + bl sub_80A95F4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r2, _080A95E8 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, _080A95EC + bl set_callback2 + bl sub_805EF14 +_080A95D2: + ldr r1, _080A95F0 + adds r1, 0x21 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A95E4: .4byte vblank_cb_08078BB4 + 1 +_080A95E8: .4byte 0x02037fd4 +_080A95EC: .4byte sub_8038420 + 1 +_080A95F0: .4byte 0x02024474 + thumb_func_end c2_80777E8 + + thumb_func_start sub_80A95F4 +sub_80A95F4: @ 80A95F4 + ldr r3, _080A960C + ldrb r2, [r3] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + ldr r2, _080A9610 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + bx lr + .align 2, 0 +_080A960C: .4byte 0x0400000a +_080A9610: .4byte 0x0400000c + thumb_func_end sub_80A95F4 + + thumb_func_start sub_80A9614 +sub_80A9614: @ 80A9614 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080A965C + ldrb r0, [r0] + cmp r4, r0 + bcs _080A96FC + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A9676 + ldr r0, _080A9660 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A966C + ldr r1, _080A9664 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A9668 + adds r0, r1 + adds r1, r4, 0 + bl sub_805DC0C + b _080A96F4 + .align 2, 0 +_080A965C: .4byte 0x0202406c +_080A9660: .4byte 0x020244d0 +_080A9664: .4byte 0x0202406e +_080A9668: .4byte 0x02024744 +_080A966C: + adds r0, r4, 0 + movs r1, 0 + bl sub_805E7DC + b _080A96F4 +_080A9676: + ldr r0, _080A9690 + ldr r1, [r0] + movs r2, 0x80 + ands r1, r2 + cmp r1, 0 + beq _080A9698 + cmp r4, 0 + bne _080A9698 + ldr r0, _080A9694 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + b _080A96AA + .align 2, 0 +_080A9690: .4byte 0x02022fec +_080A9694: .4byte 0x03005d90 +_080A9698: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080A96B2 + cmp r4, 0 + bne _080A96B2 + movs r0, 0x6 +_080A96AA: + movs r1, 0 + bl sub_805DF84 + b _080A96F4 +_080A96B2: + ldr r0, _080A96E0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A96EC + ldr r1, _080A96E4 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A96E8 + adds r0, r1 + adds r1, r4, 0 + bl sub_805DD7C + b _080A96F4 + .align 2, 0 +_080A96E0: .4byte 0x020244d0 +_080A96E4: .4byte 0x0202406e +_080A96E8: .4byte 0x020244ec +_080A96EC: + adds r0, r4, 0 + movs r1, 0 + bl sub_805E7DC +_080A96F4: + ldr r0, _080A9704 + adds r0, 0x22 + movs r1, 0 + strb r1, [r0] +_080A96FC: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080A9704: .4byte 0x02024474 + thumb_func_end sub_80A9614 + + thumb_func_start sub_80A9708 +sub_80A9708: @ 80A9708 + 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 + ldr r0, _080A9740 + ldrb r0, [r0] + cmp r7, r0 + bcc _080A9722 + b _080A9AA0 +_080A9722: + ldr r0, _080A9744 + ldr r0, [r0] + ldr r0, [r0] + lsls r2, r7, 2 + adds r0, r2, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + str r2, [sp] + cmp r0, 0 + beq _080A9748 + adds r0, r7, 0 + bl sub_80A614C + b _080A974E + .align 2, 0 +_080A9740: .4byte 0x0202406c +_080A9744: .4byte 0x020244d0 +_080A9748: + adds r0, r7, 0 + bl sub_80A6138 +_080A974E: + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A9762 + b _080A986C +_080A9762: + ldr r1, _080A984C + lsls r0, r7, 1 + adds r6, r0, r1 + ldrh r0, [r6] + movs r1, 0x64 + mov r10, r1 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + ldr r1, _080A9850 + mov r9, r1 + add r0, r9 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A9786 + b _080A9AA0 +_080A9786: + ldrh r0, [r6] + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r5, _080A9854 + adds r0, r7, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl obj_add_from_template_forward_search + ldr r1, _080A9858 + adds r4, r7, r1 + strb r0, [r4] + ldr r5, _080A985C + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r7, 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 r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _080A9860 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + ldrh r0, [r6] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + strh r0, [r1, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _080A9864 + adds r1, r7, r1 + ldrb r1, [r1] + bl obj_anim_image_start + ldr r0, _080A9868 + ldr r0, [r0] + ldr r0, [r0] + ldr r2, [sp] + adds r0, r2, r0 + b _080A9A50 + .align 2, 0 +_080A984C: .4byte 0x0202406e +_080A9850: .4byte 0x02024744 +_080A9854: .4byte 0x0202499c +_080A9858: .4byte 0x020241e4 +_080A985C: .4byte 0x02020630 +_080A9860: .4byte nullsub_12 + 1 +_080A9864: .4byte 0x020244e4 +_080A9868: .4byte 0x020244d0 +_080A986C: + ldr r0, _080A98C0 + ldr r1, [r0] + movs r2, 0x80 + ands r1, r2 + cmp r1, 0 + beq _080A98D0 + cmp r7, 0 + bne _080A98D0 + ldr r5, _080A98C4 + ldr r0, [r5] + ldrb r4, [r0, 0x8] + movs r0, 0 + 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, _080A98C8 + ldr r1, _080A98CC + ldr r0, [r5] + ldrb r0, [r0, 0x8] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 15 + adds r4, r0 + asrs r4, 16 + movs r0, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + b _080A9914 + .align 2, 0 +_080A98C0: .4byte 0x02022fec +_080A98C4: .4byte 0x03005d90 +_080A98C8: .4byte 0x0202499c +_080A98CC: .4byte 0x08305d2c +_080A98D0: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080A9968 + cmp r7, 0 + bne _080A9968 + movs r0, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x6 + bl template_build_for_pokemon_or_trainer + ldr r5, _080A9954 + ldr r0, _080A9958 + ldrb r0, [r0, 0x18] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r4, r1 + asrs r4, 16 + movs r0, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 +_080A9914: + movs r1, 0x50 + adds r2, r4, 0 + bl obj_add_from_template_forward_search + ldr r3, _080A995C + strb r0, [r3] + ldr r4, _080A9960 + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _080A9964 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x2E] + b _080A9A70 + .align 2, 0 +_080A9954: .4byte 0x0202499c +_080A9958: .4byte 0x08305d2c +_080A995C: .4byte 0x020241e4 +_080A9960: .4byte 0x02020630 +_080A9964: .4byte nullsub_12 + 1 +_080A9968: + ldr r1, _080A9AB0 + lsls r0, r7, 1 + adds r6, r0, r1 + ldrh r0, [r6] + movs r2, 0x64 + mov r10, r2 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, _080A9AB4 + mov r9, r2 + add r0, r9 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A998C + b _080A9AA0 +_080A998C: + ldrh r0, [r6] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r5, _080A9AB8 + adds r0, r7, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl obj_add_from_template_forward_search + ldr r1, _080A9ABC + adds r4, r7, r1 + strb r0, [r4] + ldr r5, _080A9AC0 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r7, 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 r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _080A9AC4 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + ldrh r0, [r6] + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + strh r0, [r1, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _080A9AC8 + adds r1, r7, r1 + ldrb r1, [r1] + bl obj_anim_image_start + ldr r0, _080A9ACC + ldr r0, [r0] + ldr r0, [r0] + ldr r1, [sp] + adds r0, r1, r0 +_080A9A50: + ldrh r1, [r0, 0x2] + ldr r0, _080A9AD0 + cmp r1, r0 + bne _080A9A70 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r1, r0 + ldr r0, _080A9AD4 + ldr r2, _080A9AD8 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] +_080A9A70: + ldr r1, _080A9AC0 + ldr r0, _080A9ABC + adds r0, r7, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r0, _080A9ACC + ldr r0, [r0] + ldr r0, [r0] + ldr r1, [sp] + adds r0, r1, r0 + ldr r1, [r0] + lsls r1, 31 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_080A9AA0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A9AB0: .4byte 0x0202406e +_080A9AB4: .4byte 0x020244ec +_080A9AB8: .4byte 0x0202499c +_080A9ABC: .4byte 0x020241e4 +_080A9AC0: .4byte 0x02020630 +_080A9AC4: .4byte nullsub_12 + 1 +_080A9AC8: .4byte 0x020244e4 +_080A9ACC: .4byte 0x020244d0 +_080A9AD0: .4byte 0x00000181 +_080A9AD4: .4byte 0x08309aac +_080A9AD8: .4byte 0x00000604 + thumb_func_end sub_80A9708 + + thumb_func_start sub_80A9ADC +sub_80A9ADC: @ 80A9ADC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080A9B04 + ldrb r0, [r0] + cmp r5, r0 + bcc _080A9AEC + b _080A9C5E +_080A9AEC: + ldr r0, _080A9B08 + ldr r1, [r0] + movs r2, 0x80 + ands r1, r2 + cmp r1, 0 + beq _080A9B0C + cmp r5, 0 + bne _080A9B0C + bl battle_make_oam_safari_battle + b _080A9B24 + .align 2, 0 +_080A9B04: .4byte 0x0202406c +_080A9B08: .4byte 0x02022fec +_080A9B0C: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080A9B1E + cmp r5, 0 + bne _080A9B1E + b _080A9C5E +_080A9B1E: + adds r0, r5, 0 + bl battle_make_oam_normal_battle +_080A9B24: + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080A9B60 + adds r4, r5, r0 + strb r6, [r4] + adds r0, r5, 0 + bl sub_8072B18 + adds r0, r6, 0 + bl sub_80729D0 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A9B6C + ldrb r0, [r4] + ldr r1, _080A9B64 + lsls r4, r5, 1 + adds r1, r4, r1 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _080A9B68 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + b _080A9BB8 + .align 2, 0 +_080A9B60: .4byte 0x03005d70 +_080A9B64: .4byte 0x0202406e +_080A9B68: .4byte 0x02024744 +_080A9B6C: + ldr r0, _080A9B94 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A9BA0 + ldrb r0, [r4] + ldr r1, _080A9B98 + lsls r4, r5, 1 + adds r1, r4, r1 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _080A9B9C + adds r1, r2 + movs r2, 0xA + bl healthbar_draw_field_maybe + b _080A9BB8 + .align 2, 0 +_080A9B94: .4byte 0x02022fec +_080A9B98: .4byte 0x0202406e +_080A9B9C: .4byte 0x020244ec +_080A9BA0: + ldrb r0, [r4] + ldr r1, _080A9BE4 + lsls r4, r5, 1 + adds r1, r4, r1 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _080A9BE8 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_080A9BB8: + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _080A9BD4 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080A9BF0 +_080A9BD4: + ldr r0, _080A9BEC + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x1 + bl nullsub_30 + b _080A9BFC + .align 2, 0 +_080A9BE4: .4byte 0x0202406e +_080A9BE8: .4byte 0x020244ec +_080A9BEC: .4byte 0x03005d70 +_080A9BF0: + ldr r0, _080A9C28 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0 + bl nullsub_30 +_080A9BFC: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A9C34 + ldr r0, _080A9C2C + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A9C30 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A9C5E + adds r0, r6, 0 + bl sub_8072984 + b _080A9C5E + .align 2, 0 +_080A9C28: .4byte 0x03005d70 +_080A9C2C: .4byte 0x0202406e +_080A9C30: .4byte 0x02024744 +_080A9C34: + ldr r0, _080A9C64 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A9C5E + ldr r0, _080A9C68 + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080A9C6C + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A9C5E + adds r0, r6, 0 + bl sub_8072984 +_080A9C5E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A9C64: .4byte 0x02022fec +_080A9C68: .4byte 0x0202406e +_080A9C6C: .4byte 0x020244ec + thumb_func_end sub_80A9ADC + + thumb_func_start sub_80A9C70 +sub_80A9C70: @ 80A9C70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080A9D14 + adds r0, r4, r0 + ldrb r6, [r0] + ldr r0, _080A9D18 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _080A9D1C + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _080A9D20 + bl gpu_pal_obj_decompress_and_apply3 + ldr r1, _080A9D24 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + strh r4, [r1, 0x8] + cmp r5, 0 + beq _080A9D30 + movs r0, 0x1F + strh r0, [r1, 0xA] + movs r5, 0 + lsls r0, r6, 4 + ldr r7, _080A9D28 + adds r0, r6 + lsls r0, 2 + adds r6, r0, r7 +_080A9CC4: + movs r0, 0x20 + ldrsh r1, [r6, r0] + ldrh r2, [r6, 0x22] + adds r2, 0x20 + lsls r2, 16 + asrs r2, 16 + ldr r0, _080A9D2C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r1, r0, 4 + adds r0, r1 + strh r0, [r3, 0x2E] + movs r0, 0xFF + lsls r0, 8 + strh r0, [r3, 0x30] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + cmp r5, 0x4 + bls _080A9D08 + movs r0, 0x15 + strh r0, [r3, 0x3A] +_080A9D08: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _080A9CC4 + b _080A9D90 + .align 2, 0 +_080A9D14: .4byte 0x020241e4 +_080A9D18: .4byte sub_80A9DB4 + 1 +_080A9D1C: .4byte 0x08524f84 +_080A9D20: .4byte 0x0852588c +_080A9D24: .4byte 0x03005e00 +_080A9D28: .4byte 0x02020630 +_080A9D2C: .4byte 0x0853ef60 +_080A9D30: + movs r0, 0xF8 + lsls r0, 7 + strh r0, [r1, 0xA] + movs r5, 0 + lsls r0, r6, 4 + ldr r7, _080A9DAC + adds r0, r6 + lsls r0, 2 + adds r6, r0, r7 +_080A9D42: + movs r2, 0x20 + ldrsh r1, [r6, r2] + ldrh r2, [r6, 0x22] + subs r2, 0x20 + lsls r2, 16 + asrs r2, 16 + ldr r0, _080A9DB0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r1, r0, 4 + adds r0, r1 + strh r0, [r3, 0x2E] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r3, 0x30] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + cmp r5, 0x4 + bls _080A9D86 + movs r0, 0x15 + strh r0, [r3, 0x3A] +_080A9D86: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _080A9D42 +_080A9D90: + ldr r0, _080A9DAC + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A9DAC: .4byte 0x02020630 +_080A9DB0: .4byte 0x0853ef60 + thumb_func_end sub_80A9C70 + + thumb_func_start sub_80A9DB4 +sub_80A9DB4: @ 80A9DB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080A9E0C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x2 + bne _080A9E3A + movs r0, 0 + strh r0, [r4, 0xC] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldrb r2, [r4, 0x10] + ldrh r3, [r4, 0xA] + movs r1, 0x10 + bl pal_fade_1 + ldrh r2, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080A9E10 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080A9E3E + movs r0, 0x1 + eors r0, r2 + strh r0, [r4, 0x12] + b _080A9E3E + .align 2, 0 +_080A9E0C: .4byte 0x03005e00 +_080A9E10: + ldrh r1, [r4, 0x10] + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _080A9E3E + strh r1, [r4, 0x10] + movs r0, 0x1 + eors r0, r2 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080A9E3E + adds r0, r5, 0 + bl remove_task + b _080A9E3E +_080A9E3A: + adds r0, r1, 0x1 + strh r0, [r4, 0xC] +_080A9E3E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A9DB4 + + thumb_func_start sub_80A9E44 +sub_80A9E44: @ 80A9E44 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x3A] + movs r3, 0x3A + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080A9E70 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r3] + ldr r1, _080A9E6C + str r1, [r2, 0x1C] + adds r0, r2, 0 + bl _call_via_r1 + b _080A9E74 + .align 2, 0 +_080A9E6C: .4byte sub_80A9E78 + 1 +_080A9E70: + subs r0, r1, 0x1 + strh r0, [r2, 0x3A] +_080A9E74: + pop {r0} + bx r0 + thumb_func_end sub_80A9E44 + + thumb_func_start sub_80A9E78 +sub_80A9E78: @ 80A9E78 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x7F + bgt _080A9EA4 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D + b _080A9EAA +_080A9EA4: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F +_080A9EAA: + strb r0, [r1] + ldrh r0, [r4, 0x2E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x34 + bne _080A9EEC + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A9EE6 + adds r0, r4, 0 + bl obj_delete_and_free_resources + b _080A9EEC +_080A9EE6: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_080A9EEC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A9E78 + + thumb_func_start sub_80A9EF4 +sub_80A9EF4: @ 80A9EF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _080A9FA4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + ldr r1, _080A9FA8 + adds r0, r1 + lsrs r5, r0, 16 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + ldr r1, _080A9FAC + adds r0, r1 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A9F32 + lsls r0, r5, 16 + ldr r1, _080A9FB0 + adds r0, r1 + lsrs r5, r0, 16 +_080A9F32: + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + ldr r0, _080A9FB4 + lsls r1, r5, 16 + asrs r1, 16 + lsls r2, r4, 16 + asrs r2, 16 + movs r3, 0x4 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080A9FB8 + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + ldr r1, _080A9FBC + cmp r0, r1 + bne _080A9F7C + ldr r1, _080A9FC0 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A9F7C: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _080A9FC0 + adds r0, r1 + ldr r1, _080A9FC4 + bl obj_set_f18_to_r0_f42_to_40 + ldr r1, _080A9FC8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x26] + ldr r1, _080A9FCC + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A9FA4: .4byte 0x02038437 +_080A9FA8: .4byte 0xffe00000 +_080A9FAC: .4byte 0xffdc0000 +_080A9FB0: .4byte 0xfffa0000 +_080A9FB4: .4byte 0x0853ef48 +_080A9FB8: .4byte 0x0000271a +_080A9FBC: .4byte 0xffff0000 +_080A9FC0: .4byte 0x02020630 +_080A9FC4: .4byte 0x0853ef40 +_080A9FC8: .4byte 0x03005e00 +_080A9FCC: .4byte sub_80A9FD0 + 1 + thumb_func_end sub_80A9EF4 + + thumb_func_start sub_80A9FD0 +sub_80A9FD0: @ 80A9FD0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080A9FFC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + adds r2, r0, 0 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _080AA004 + ldr r0, _080AA000 + str r0, [r1] + movs r0, 0 + strh r0, [r1, 0xA] + b _080AA01A + .align 2, 0 +_080A9FFC: .4byte 0x03005e00 +_080AA000: .4byte sub_80AA020 + 1 +_080AA004: + lsls r0, r2, 24 + lsrs r0, 24 + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set +_080AA01A: + pop {r0} + bx r0 + thumb_func_end sub_80A9FD0 + + thumb_func_start sub_80AA020 +sub_80AA020: @ 80AA020 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080AA0B8 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080AA0BC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + adds r1, r0, 0x1 + strh r1, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + ble _080AA0B0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + movs r6, 0 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080AA0B0 + ldr r3, _080AA0C0 + lsls r2, 4 + mov r12, r2 + ldr r1, _080AA0C4 + add r1, r12 + lsls r1, 1 + adds r1, r3 + ldrh r4, [r1] + movs r2, 0x87 + lsls r2, 1 + add r2, r12 + lsls r2, 1 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r1] + ldr r0, _080AA0C8 + add r0, r12 + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + strh r1, [r2] + strh r4, [r0] + strh r6, [r5, 0xC] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080AA0B0 + strh r6, [r5, 0xE] + strh r6, [r5, 0xA] + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080AA0B0 + movs r0, 0x9 + strh r0, [r5, 0xA] + ldr r0, _080AA0CC + str r0, [r5] +_080AA0B0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AA0B8: .4byte 0x0000271a +_080AA0BC: .4byte 0x03005e00 +_080AA0C0: .4byte 0x02037b14 +_080AA0C4: .4byte 0x0000010d +_080AA0C8: .4byte 0x0000010f +_080AA0CC: .4byte sub_80AA0D0 + 1 + thumb_func_end sub_80AA020 + + thumb_func_start sub_80AA0D0 +sub_80AA0D0: @ 80AA0D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080AA100 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + ldrh r0, [r2, 0xA] + subs r0, 0x1 + adds r3, r0, 0 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080AA108 + ldr r0, _080AA104 + str r0, [r2] + movs r0, 0 + strh r0, [r2, 0xA] + b _080AA11E + .align 2, 0 +_080AA100: .4byte 0x03005e00 +_080AA104: .4byte sub_80AA124 + 1 +_080AA108: + lsls r0, r3, 24 + lsrs r0, 24 + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set +_080AA11E: + pop {r0} + bx r0 + thumb_func_end sub_80AA0D0 + + thumb_func_start sub_80AA124 +sub_80AA124: @ 80AA124 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, _080AA164 + lsls r0, r4, 2 + adds r0, r4 + 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, 0x25 + bne _080AA16C + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080AA168 + adds r4, r0 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _080AA186 + .align 2, 0 +_080AA164: .4byte 0x03005e00 +_080AA168: .4byte 0x02020630 +_080AA16C: + cmp r0, 0x27 + bne _080AA186 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_task_del +_080AA186: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AA124 + + thumb_func_start sub_80AA18C +sub_80AA18C: @ 80AA18C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r0, _080AA1B0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrh r0, [r0] + subs r0, 0xF + cmp r0, 0x2B + bls _080AA1A4 + b _080AA328 +_080AA1A4: + lsls r0, 2 + ldr r1, _080AA1B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AA1B0: .4byte 0x020244d0 +_080AA1B4: .4byte _080AA1B8 + .align 2, 0 +_080AA1B8: + .4byte _080AA268 + .4byte _080AA26E + .4byte _080AA274 + .4byte _080AA27A + .4byte _080AA280 + .4byte _080AA286 + .4byte _080AA28C + .4byte _080AA292 + .4byte _080AA298 + .4byte _080AA29E + .4byte _080AA2A4 + .4byte _080AA2AA + .4byte _080AA2B0 + .4byte _080AA2B6 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA2BC + .4byte _080AA2C0 + .4byte _080AA2C4 + .4byte _080AA2C8 + .4byte _080AA2CC + .4byte _080AA2D0 + .4byte _080AA2D4 + .4byte _080AA2D8 + .4byte _080AA2E0 + .4byte _080AA2E8 + .4byte _080AA2F0 + .4byte _080AA2F8 + .4byte _080AA300 + .4byte _080AA308 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA310 + .4byte _080AA314 + .4byte _080AA318 + .4byte _080AA320 +_080AA268: + movs r5, 0 + movs r2, 0 + b _080AA330 +_080AA26E: + movs r5, 0 + movs r2, 0x1 + b _080AA330 +_080AA274: + movs r5, 0 + movs r2, 0x3 + b _080AA330 +_080AA27A: + movs r5, 0 + movs r2, 0x5 + b _080AA330 +_080AA280: + movs r5, 0 + movs r2, 0x6 + b _080AA330 +_080AA286: + movs r5, 0 + movs r2, 0x2 + b _080AA330 +_080AA28C: + movs r5, 0 + movs r2, 0x4 + b _080AA330 +_080AA292: + movs r5, 0x1 + movs r2, 0 + b _080AA330 +_080AA298: + movs r5, 0x1 + movs r2, 0x1 + b _080AA330 +_080AA29E: + movs r5, 0x1 + movs r2, 0x3 + b _080AA330 +_080AA2A4: + movs r5, 0x1 + movs r2, 0x5 + b _080AA330 +_080AA2AA: + movs r5, 0x1 + movs r2, 0x6 + b _080AA330 +_080AA2B0: + movs r5, 0x1 + movs r2, 0x2 + b _080AA330 +_080AA2B6: + movs r5, 0x1 + movs r2, 0x4 + b _080AA330 +_080AA2BC: + movs r5, 0 + b _080AA2DA +_080AA2C0: + movs r5, 0 + b _080AA2E2 +_080AA2C4: + movs r5, 0 + b _080AA2EA +_080AA2C8: + movs r5, 0 + b _080AA2F2 +_080AA2CC: + movs r5, 0 + b _080AA2FA +_080AA2D0: + movs r5, 0 + b _080AA302 +_080AA2D4: + movs r5, 0 + b _080AA30A +_080AA2D8: + movs r5, 0x1 +_080AA2DA: + movs r2, 0 + movs r3, 0x1 + b _080AA330 +_080AA2E0: + movs r5, 0x1 +_080AA2E2: + movs r2, 0x1 + movs r3, 0x1 + b _080AA330 +_080AA2E8: + movs r5, 0x1 +_080AA2EA: + movs r2, 0x3 + movs r3, 0x1 + b _080AA330 +_080AA2F0: + movs r5, 0x1 +_080AA2F2: + movs r2, 0x5 + movs r3, 0x1 + b _080AA330 +_080AA2F8: + movs r5, 0x1 +_080AA2FA: + movs r2, 0x6 + movs r3, 0x1 + b _080AA330 +_080AA300: + movs r5, 0x1 +_080AA302: + movs r2, 0x2 + movs r3, 0x1 + b _080AA330 +_080AA308: + movs r5, 0x1 +_080AA30A: + movs r2, 0x4 + movs r3, 0x1 + b _080AA330 +_080AA310: + movs r5, 0 + b _080AA31A +_080AA314: + movs r5, 0 + b _080AA322 +_080AA318: + movs r5, 0x1 +_080AA31A: + movs r2, 0xFF + movs r3, 0 + b _080AA330 +_080AA320: + movs r5, 0x1 +_080AA322: + movs r2, 0xFF + movs r3, 0x1 + b _080AA330 +_080AA328: + adds r0, r4, 0 + bl move_anim_task_del + b _080AA352 +_080AA330: + ldr r0, _080AA358 + movs r1, 0 + strh r5, [r0] + strh r2, [r0, 0x2] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + strh r3, [r0, 0x8] + ldr r1, _080AA35C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080AA360 + str r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 +_080AA352: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AA358: .4byte 0x0203841e +_080AA35C: .4byte 0x03005e00 +_080AA360: .4byte sub_8116EB4 + 1 + thumb_func_end sub_80AA18C + + thumb_func_start move_anim_start_t2 +move_anim_start_t2: @ 80AA364 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080AA3A0 + strb r4, [r0] + ldr r0, _080AA3A4 + strb r4, [r0] + ldr r0, _080AA3A8 + movs r2, 0 + bl move_something + ldr r0, _080AA3AC + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080AA3B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AA3A0: .4byte 0x02038436 +_080AA3A4: .4byte 0x02038437 +_080AA3A8: .4byte 0x082c92fc +_080AA3AC: .4byte task0A_80788BC + 1 +_080AA3B0: .4byte 0x03005e00 + thumb_func_end move_anim_start_t2 + + thumb_func_start task0A_80788BC +task0A_80788BC: @ 80AA3B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080AA3FC + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _080AA400 + ldrb r0, [r0] + cmp r0, 0 + bne _080AA3F6 + ldr r0, _080AA404 + ldr r2, [r0] + ldr r1, _080AA408 + 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, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl remove_task +_080AA3F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AA3FC: .4byte 0x020383f8 +_080AA400: .4byte 0x020383fd +_080AA404: .4byte 0x020244d0 +_080AA408: .4byte 0x03005e00 + thumb_func_end task0A_80788BC + + thumb_func_start sub_80AA40C +sub_80AA40C: @ 80AA40C + push {lr} + adds r3, r0, 0 + ldr r2, _080AA438 + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080AA43C + ldrb r0, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x42 + strh r0, [r3, 0x22] + b _080AA46A + .align 2, 0 +_080AA438: .4byte 0x03005e00 +_080AA43C: + ldrh r1, [r3, 0x22] + movs r2, 0x22 + ldrsh r0, [r3, r2] + cmp r0, 0x42 + beq _080AA44A + adds r0, r1, 0x1 + strh r0, [r3, 0x22] +_080AA44A: + ldrh r1, [r3, 0x2E] + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080AA458 + subs r0, r1, 0x1 + strh r0, [r3, 0x2E] +_080AA458: + ldr r0, _080AA470 + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x52 + bl lcd_io_set +_080AA46A: + pop {r0} + bx r0 + .align 2, 0 +_080AA470: .4byte 0x0853ff70 + thumb_func_end sub_80AA40C + + thumb_func_start sub_80AA474 +sub_80AA474: @ 80AA474 + push {lr} + adds r3, r0, 0 + ldr r2, _080AA49C + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080AA4A0 + ldrb r0, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x42 + b _080AA4AC + .align 2, 0 +_080AA49C: .4byte 0x03005e00 +_080AA4A0: + ldrh r1, [r3, 0x22] + movs r2, 0x22 + ldrsh r0, [r3, r2] + cmp r0, 0x42 + beq _080AA4AE + adds r0, r1, 0x1 +_080AA4AC: + strh r0, [r3, 0x22] +_080AA4AE: + pop {r0} + bx r0 + thumb_func_end sub_80AA474 + + thumb_func_start sub_80AA4B4 +sub_80AA4B4: @ 80AA4B4 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _080AA4DC + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080AA4DC + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _080AA4E8 +_080AA4DC: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_080AA4E8: + pop {r0} + bx r0 + thumb_func_end sub_80AA4B4 + + thumb_func_start sub_80AA4EC +sub_80AA4EC: @ 80AA4EC + push {r4-r7,lr} + lsls r0, 16 + ldr r2, _080AA53C + adds r0, r2 + lsrs r0, 16 + movs r6, 0 + lsls r7, r1, 16 +_080AA4FA: + lsls r5, r0, 16 + asrs r5, 16 + ldr r0, _080AA540 + adds r1, r5, 0 + asrs r2, r7, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080AA544 + adds r4, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl obj_anim_image_start + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, 0x20 + lsls r5, 16 + lsrs r0, r5, 16 + cmp r6, 0x4 + bls _080AA4FA + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AA53C: .4byte 0xffc00000 +_080AA540: .4byte 0x085400d8 +_080AA544: .4byte 0x02020630 + thumb_func_end sub_80AA4EC + + thumb_func_start sub_80AA548 +sub_80AA548: @ 80AA548 + push {r4-r6,lr} + lsls r0, 16 + ldr r2, _080AA598 + adds r0, r2 + lsrs r0, 16 + movs r5, 0 + lsls r6, r1, 16 +_080AA556: + lsls r4, r0, 16 + asrs r4, 16 + ldr r0, _080AA59C + adds r1, r4, 0 + asrs r2, r6, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _080AA5A0 + adds r2, r0 + adds r1, r5, 0x5 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl obj_anim_image_start + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x20 + lsls r4, 16 + lsrs r0, r4, 16 + cmp r5, 0x4 + bls _080AA556 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AA598: .4byte 0xffc00000 +_080AA59C: .4byte 0x085400d8 +_080AA5A0: .4byte 0x02020630 + thumb_func_end sub_80AA548 + + thumb_func_start title_screen_logo_shine_obj_callback_type1 +title_screen_logo_shine_obj_callback_type1: @ 80AA5A4 + push {r4,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x20] + movs r0, 0x20 + ldrsh r1, [r3, r0] + ldr r0, _080AA5DC + cmp r1, r0 + bgt _080AA63C + movs r4, 0x2E + ldrsh r0, [r3, r4] + adds r4, r2, 0 + cmp r0, 0 + beq _080AA630 + cmp r1, 0x77 + bgt _080AA5E0 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0x1E + bgt _080AA5F8 + adds r1, 0x1 + strh r1, [r3, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x1E + bgt _080AA5F8 + adds r0, r1, 0x1 + b _080AA5F6 + .align 2, 0 +_080AA5DC: .4byte 0x0000010f +_080AA5E0: + ldrh r1, [r3, 0x30] + movs r4, 0x30 + ldrsh r0, [r3, r4] + cmp r0, 0 + beq _080AA5F8 + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + beq _080AA5F8 + subs r0, r1, 0x2 +_080AA5F6: + strh r0, [r3, 0x30] +_080AA5F8: + ldrh r1, [r3, 0x30] + movs r0, 0x1F + ands r0, r1 + lsls r2, r0, 10 + lsls r1, r0, 5 + adds r2, r1 + orrs r2, r0 + movs r1, 0x20 + ldrsh r0, [r3, r1] + ldrh r4, [r3, 0x20] + cmp r0, 0x84 + beq _080AA61C + cmp r0, 0x88 + beq _080AA61C + cmp r0, 0x8C + beq _080AA61C + cmp r0, 0x90 + bne _080AA62C +_080AA61C: + ldr r1, _080AA624 + ldr r0, _080AA628 + strh r0, [r1] + b _080AA630 + .align 2, 0 +_080AA624: .4byte 0x02037b14 +_080AA628: .4byte 0x000033f8 +_080AA62C: + ldr r0, _080AA638 + strh r2, [r0] +_080AA630: + adds r0, r4, 0x4 + strh r0, [r3, 0x20] + b _080AA648 + .align 2, 0 +_080AA638: .4byte 0x02037b14 +_080AA63C: + ldr r1, _080AA650 + movs r0, 0 + strh r0, [r1] + adds r0, r3, 0 + bl obj_delete_and_free_tiles +_080AA648: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AA650: .4byte 0x02037b14 + thumb_func_end title_screen_logo_shine_obj_callback_type1 + + thumb_func_start title_screen_logo_shine_obj_callback_type2 +title_screen_logo_shine_obj_callback_type2: @ 80AA654 + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x20] + movs r0, 0x20 + ldrsh r1, [r2, r0] + ldr r0, _080AA66C + cmp r1, r0 + bgt _080AA670 + adds r0, r3, 0 + adds r0, 0x8 + strh r0, [r2, 0x20] + b _080AA676 + .align 2, 0 +_080AA66C: .4byte 0x0000010f +_080AA670: + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_080AA676: + pop {r0} + bx r0 + thumb_func_end title_screen_logo_shine_obj_callback_type2 + + thumb_func_start title_screen_add_logo_shine_obj +title_screen_add_logo_shine_obj: @ 80AA67C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + beq _080AA6D0 + cmp r5, 0x1 + bgt _080AA698 + cmp r5, 0 + beq _080AA69C + b _080AA766 +_080AA698: + cmp r5, 0x2 + bne _080AA766 +_080AA69C: + ldr r0, _080AA6C8 + movs r1, 0 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080AA6CC + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + strh r5, [r0, 0x2E] + b _080AA766 + .align 2, 0 +_080AA6C8: .4byte 0x08540124 +_080AA6CC: .4byte 0x02020630 +_080AA6D0: + ldr r0, _080AA774 + mov r9, r0 + movs r1, 0 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + ldr r6, _080AA778 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x1] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x8 + mov r8, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x1] + strh r5, [r1, 0x2E] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + mov r0, r9 + movs r1, 0 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r0, r1, r5 + ldr r2, _080AA77C + mov r10, r2 + str r2, [r0] + adds r1, r6 + ldrb r2, [r1, 0x1] + adds r0, r4, 0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x1] + movs r1, 0x50 + negs r1, r1 + mov r0, r9 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r5 + mov r1, r10 + str r1, [r5] + adds r0, r6 + ldrb r1, [r0, 0x1] + ands r4, r1 + mov r2, r8 + orrs r4, r2 + strb r4, [r0, 0x1] +_080AA766: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AA774: .4byte 0x08540124 +_080AA778: .4byte 0x02020630 +_080AA77C: .4byte title_screen_logo_shine_obj_callback_type2 + 1 + thumb_func_end title_screen_add_logo_shine_obj + + thumb_func_start title_screen_vblank_callback +title_screen_vblank_callback: @ 80AA780 + push {lr} + bl sub_80BA0A8 + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + ldr r0, _080AA7A0 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080AA7A0: .4byte 0x02022e1a + thumb_func_end title_screen_vblank_callback + + thumb_func_start c2_title_screen_1 +c2_title_screen_1: @ 80AA7A4 + push {r4,lr} + sub sp, 0x14 + ldr r0, _080AA7C0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080AA7E0 + lsls r0, 2 + ldr r1, _080AA7C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AA7C0: .4byte 0x030022c0 +_080AA7C4: .4byte _080AA7C8 + .align 2, 0 +_080AA7C8: + .4byte _080AA7E0 + .4byte _080AA8C4 + .4byte _080AA998 + .4byte _080AA9E0 + .4byte _080AAA14 + .4byte _080AAAF0 +_080AA7E0: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _080AA8A8 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + add r1, sp, 0xC + movs r0, 0 + strh r0, [r1] + ldr r1, _080AA8AC + add r0, sp, 0xC + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _080AA8B0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x10] + add r0, sp, 0x10 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _080AA8B4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0xC + strh r2, [r0] + str r0, [r1] + ldr r0, _080AA8B8 + str r0, [r1, 0x4] + ldr r0, _080AA8BC + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + ldr r0, _080AA8C0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _080AAB1E + .align 2, 0 +_080AA8A8: .4byte 0x00007fff +_080AA8AC: .4byte 0x040000d4 +_080AA8B0: .4byte 0x8100c000 +_080AA8B4: .4byte 0x85000100 +_080AA8B8: .4byte 0x05000002 +_080AA8BC: .4byte 0x810001ff +_080AA8C0: .4byte 0x030022c0 +_080AA8C4: + ldr r0, _080AA94C + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _080AA950 + ldr r1, _080AA954 + bl LZ77UnCompVram + ldr r0, _080AA958 + movs r2, 0xF0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + ldr r0, _080AA95C + ldr r1, _080AA960 + bl LZ77UnCompVram + ldr r0, _080AA964 + ldr r1, _080AA968 + bl LZ77UnCompVram + ldr r0, _080AA96C + ldr r1, _080AA970 + bl LZ77UnCompVram + ldr r0, _080AA974 + ldr r1, _080AA978 + bl LZ77UnCompVram + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _080AA97C + movs r0, 0x9 + strb r0, [r1] + ldr r0, _080AA980 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080AA984 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080AA988 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080AA98C + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080AA990 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _080AA994 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0] + b _080AAB1E + .align 2, 0 +_080AA94C: .4byte 0x08dde690 +_080AA950: .4byte 0x08de0644 +_080AA954: .4byte 0x06004800 +_080AA958: .4byte 0x08dde258 +_080AA95C: .4byte 0x0853f058 +_080AA960: .4byte 0x06008000 +_080AA964: .4byte 0x0853f83c +_080AA968: .4byte 0x0600d000 +_080AA96C: .4byte 0x0853fc8c +_080AA970: .4byte 0x0600c000 +_080AA974: .4byte 0x08dde458 +_080AA978: .4byte 0x0600d800 +_080AA97C: .4byte 0x0300301c +_080AA980: .4byte 0x08540048 +_080AA984: .4byte 0x085400f0 +_080AA988: .4byte 0x0854013c +_080AA98C: .4byte 0x08dde438 +_080AA990: .4byte 0x08540100 +_080AA994: .4byte 0x030022c0 +_080AA998: + ldr r0, _080AA9D0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080AA9D4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, _080AA9D8 + strh r0, [r1, 0xC] + subs r0, 0x10 + strh r0, [r1, 0xE] + ldr r0, _080AA9DC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + b _080AAB1E + .align 2, 0 +_080AA9D0: .4byte task_title_screen_1 + 1 +_080AA9D4: .4byte 0x03005e00 +_080AA9D8: .4byte 0x0000fff0 +_080AA9DC: .4byte 0x030022c0 +_080AA9E0: + movs r0, 0x1 + negs r0, r0 + ldr r1, _080AAA08 + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080AAA0C + bl SetVBlankCallback + ldr r0, _080AAA10 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x4 + strb r1, [r0] + b _080AAB1E + .align 2, 0 +_080AAA08: .4byte 0x0000ffff +_080AAA0C: .4byte title_screen_vblank_callback + 1 +_080AAA10: .4byte 0x030022c0 +_080AAA14: + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x78 + movs r1, 0x50 + movs r3, 0 + bl sub_816F2A8 + movs r1, 0xE3 + lsls r1, 8 + movs r0, 0x28 + bl lcd_io_set + ldr r4, _080AAACC + movs r0, 0x2A + adds r1, r4, 0 + bl lcd_io_set + movs r1, 0xE0 + lsls r1, 8 + movs r0, 0x2C + bl lcd_io_set + movs r0, 0x2E + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + ldr r1, _080AAAD0 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _080AAAD4 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0x50 + movs r1, 0x84 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0xC + bl lcd_io_set + ldr r1, _080AAAD8 + movs r0, 0x8 + bl lcd_io_set + ldr r1, _080AAADC + movs r0, 0xA + bl lcd_io_set + ldr r1, _080AAAE0 + movs r0, 0xC + bl lcd_io_set + movs r0, 0x1 + bl enable_irqs + ldr r1, _080AAAE4 + movs r0, 0 + bl lcd_io_set + ldr r0, _080AAAE8 + bl m4aSongNumStart + ldr r0, _080AAAEC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _080AAB1E + .align 2, 0 +_080AAACC: .4byte 0x0000ffff +_080AAAD0: .4byte 0x00001f1f +_080AAAD4: .4byte 0x00003f1f +_080AAAD8: .4byte 0x00001a0b +_080AAADC: .4byte 0x00001b0e +_080AAAE0: .4byte 0x00004981 +_080AAAE4: .4byte 0x0000b441 +_080AAAE8: .4byte 0x0000019d +_080AAAEC: .4byte 0x030022c0 +_080AAAF0: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080AAB1E + movs r0, 0 + bl title_screen_add_logo_shine_obj + str r4, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x4 + movs r3, 0x4 + bl sub_80BA384 + ldr r0, _080AAB28 + bl set_callback2 +_080AAB1E: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AAB28: .4byte c2_title_screen_2 + 1 + thumb_func_end c2_title_screen_1 + + thumb_func_start c2_title_screen_2 +c2_title_screen_2: @ 80AAB2C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end c2_title_screen_2 + + thumb_func_start task_title_screen_1 +task_title_screen_1: @ 80AAB44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080AAB98 + ldrh r1, [r0, 0x2E] + movs r0, 0xF + ands r0, r1 + ldr r6, _080AAB9C + cmp r0, 0 + bne _080AAB6A + lsls r0, r5, 2 + adds r1, r0, r5 + lsls r1, 3 + adds r1, r6 + movs r2, 0xA + ldrsh r1, [r1, r2] + adds r4, r0, 0 + cmp r1, 0 + beq _080AAB7C +_080AAB6A: + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r6 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0xA] + strh r2, [r0, 0x8] + adds r4, r3, 0 +_080AAB7C: + adds r0, r4, r5 + lsls r0, 3 + adds r6, r0, r6 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080AABC0 + ldrh r0, [r6, 0x8] + cmp r0, 0xB0 + bne _080AABA0 + movs r0, 0x1 + bl title_screen_add_logo_shine_obj + b _080AABAA + .align 2, 0 +_080AAB98: .4byte 0x030022c0 +_080AAB9C: .4byte 0x03005e00 +_080AABA0: + cmp r0, 0x40 + bne _080AABAA + movs r0, 0x2 + bl title_screen_add_logo_shine_obj +_080AABAA: + ldr r0, _080AABBC + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + subs r0, 0x1 + strh r0, [r1, 0x8] + b _080AAC32 + .align 2, 0 +_080AABBC: .4byte 0x03005e00 +_080AABC0: + ldr r1, _080AAC38 + movs r0, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + ldr r1, _080AAC3C + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r0, _080AAC40 + movs r1, 0x62 + movs r2, 0x2 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080AAC44 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r0, 0x40 + strh r0, [r1, 0x2E] + strh r5, [r1, 0x30] + ldr r0, _080AAC48 + movs r1, 0xA2 + movs r2, 0x2 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + strh r5, [r1, 0x30] + movs r0, 0x90 + strh r0, [r6, 0x8] + ldr r0, _080AAC4C + str r0, [r6] +_080AAC32: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AAC38: .4byte 0x00001441 +_080AAC3C: .4byte 0x00003f50 +_080AAC40: .4byte 0x08540018 +_080AAC44: .4byte 0x02020630 +_080AAC48: .4byte 0x08540030 +_080AAC4C: .4byte task_title_screen_2 + 1 + thumb_func_end task_title_screen_1 + + thumb_func_start task_title_screen_2 +task_title_screen_2: @ 80AAC50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080AACA0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF + ands r0, r1 + ldr r2, _080AACA4 + cmp r0, 0 + bne _080AAC76 + lsls r0, r4, 2 + adds r1, r0, r4 + lsls r1, 3 + adds r1, r2 + movs r3, 0xA + ldrsh r1, [r1, r3] + adds r6, r0, 0 + cmp r1, 0 + beq _080AAC88 +_080AAC76: + lsls r3, r4, 2 + adds r0, r3, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0xA] + strh r2, [r0, 0x8] + adds r6, r3, 0 +_080AAC88: + ldr r1, _080AACA4 + adds r0, r6, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + movs r1, 0x8 + ldrsh r7, [r5, r1] + cmp r7, 0 + beq _080AACA8 + subs r0, 0x1 + strh r0, [r5, 0x8] + b _080AACE2 + .align 2, 0 +_080AACA0: .4byte 0x030022c0 +_080AACA4: .4byte 0x03005e00 +_080AACA8: + movs r0, 0x1 + strh r0, [r5, 0xA] + ldr r1, _080AAD50 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _080AAD54 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _080AAD58 + movs r0, 0 + bl lcd_io_set + movs r0, 0x80 + movs r1, 0x6C + bl sub_80AA4EC + movs r0, 0x80 + movs r1, 0x94 + bl sub_80AA548 + strh r7, [r5, 0x10] + ldr r0, _080AAD5C + str r0, [r5] +_080AACE2: + ldr r2, _080AAD60 + adds r0, r6, r4 + lsls r0, 3 + adds r3, r0, r2 + ldrh r1, [r3, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080AAD02 + ldrh r1, [r3, 0xC] + movs r5, 0xC + ldrsh r0, [r3, r5] + cmp r0, 0 + beq _080AAD02 + adds r0, r1, 0x1 + strh r0, [r3, 0xC] +_080AAD02: + adds r0, r6, r4 + lsls r0, 3 + adds r3, r0, r2 + ldrh r1, [r3, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080AAD20 + ldrh r1, [r3, 0xE] + movs r5, 0xE + ldrsh r0, [r3, r5] + cmp r0, 0 + beq _080AAD20 + adds r0, r1, 0x1 + strh r0, [r3, 0xE] +_080AAD20: + adds r4, r6, r4 + lsls r4, 3 + adds r4, r2 + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r5, r1, 8 + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x2C + bl lcd_io_set + lsrs r5, 16 + movs r0, 0x2E + adds r1, r5, 0 + bl lcd_io_set + movs r0, 0xF + strh r0, [r4, 0x12] + movs r0, 0x6 + strh r0, [r4, 0x14] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AAD50: .4byte 0x00002142 +_080AAD54: .4byte 0x00000f06 +_080AAD58: .4byte 0x00001741 +_080AAD5C: .4byte task_title_screen_3 + 1 +_080AAD60: .4byte 0x03005e00 + thumb_func_end task_title_screen_2 + + thumb_func_start task_title_screen_3 +task_title_screen_3: @ 80AAD64 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _080AADA4 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080AAD84 + movs r0, 0x8 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080AADB0 +_080AAD84: + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + ldr r1, _080AADA8 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080AADAC + bl set_callback2 + b _080AAE98 + .align 2, 0 +_080AADA4: .4byte 0x030022c0 +_080AADA8: .4byte 0x0000ffff +_080AADAC: .4byte c2_title_menu_1 + 1 +_080AADB0: + ldrh r1, [r2, 0x2C] + movs r0, 0x46 + ands r0, r1 + cmp r0, 0x46 + bne _080AADC8 + ldr r0, _080AADC4 + bl set_callback2 + b _080AAE98 + .align 2, 0 +_080AADC4: .4byte c2_clear_save_data_screen_1 + 1 +_080AADC8: + movs r0, 0x26 + ands r0, r1 + cmp r0, 0x26 + bne _080AADFC + bl sub_809D614 + cmp r0, 0x1 + bne _080AADFC + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080AADF8 + bl set_callback2 + b _080AAE98 + .align 2, 0 +_080AADF8: .4byte c2_reset_rtc_screen_1 + 1 +_080AADFC: + ldr r0, _080AAE28 + ldrh r1, [r0, 0x2C] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0x6 + bne _080AAE30 + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080AAE2C + bl set_callback2 + b _080AAE98 + .align 2, 0 +_080AAE28: .4byte 0x030022c0 +_080AAE2C: .4byte c2_berry_program_update_screen_1 + 1 +_080AAE30: + movs r0, 0x2C + movs r1, 0 + bl lcd_io_set + movs r0, 0x2E + movs r1, 0 + bl lcd_io_set + ldr r1, _080AAEA0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080AAE72 + ldrh r0, [r3, 0x10] + adds r0, 0x1 + strh r0, [r3, 0x10] + ldr r2, _080AAEA4 + movs r1, 0x10 + ldrsh r0, [r3, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r2] + ldr r1, _080AAEA8 + movs r0, 0 + strh r0, [r1] +_080AAE72: + ldrb r0, [r3, 0x8] + bl title_screen_update_rayquaza_ring_palette + ldr r0, _080AAEAC + ldr r1, _080AAEB0 + ldrh r0, [r0, 0x4] + cmp r0, 0 + bne _080AAE98 + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080AAEB4 + bl set_callback2 +_080AAE98: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AAEA0: .4byte 0x03005e00 +_080AAEA4: .4byte 0x02022e1a +_080AAEA8: .4byte 0x02022e18 +_080AAEAC: .4byte 0x03007420 +_080AAEB0: .4byte 0x0000ffff +_080AAEB4: .4byte c2_show_copyright_and_intro_again_1 + 1 + thumb_func_end task_title_screen_3 + + thumb_func_start c2_title_menu_1 +c2_title_menu_1: @ 80AAEB8 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAECA + ldr r0, _080AAED0 + bl set_callback2 +_080AAECA: + pop {r0} + bx r0 + .align 2, 0 +_080AAED0: .4byte c2_title_menu_2 + 1 + thumb_func_end c2_title_menu_1 + + thumb_func_start c2_show_copyright_and_intro_again_1 +c2_show_copyright_and_intro_again_1: @ 80AAED4 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAEE6 + ldr r0, _080AAEEC + bl set_callback2 +_080AAEE6: + pop {r0} + bx r0 + .align 2, 0 +_080AAEEC: .4byte c2_show_copyright_and_intro_again_2 + 1 + thumb_func_end c2_show_copyright_and_intro_again_1 + + thumb_func_start c2_clear_save_data_screen_1 +c2_clear_save_data_screen_1: @ 80AAEF0 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAF02 + ldr r0, _080AAF08 + bl set_callback2 +_080AAF02: + pop {r0} + bx r0 + .align 2, 0 +_080AAF08: .4byte c2_clear_save_data_screen_2 + 1 + thumb_func_end c2_clear_save_data_screen_1 + + thumb_func_start c2_reset_rtc_screen_1 +c2_reset_rtc_screen_1: @ 80AAF0C + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAF1E + ldr r0, _080AAF24 + bl set_callback2 +_080AAF1E: + pop {r0} + bx r0 + .align 2, 0 +_080AAF24: .4byte sub_809EF88 + 1 + thumb_func_end c2_reset_rtc_screen_1 + + thumb_func_start c2_berry_program_update_screen_1 +c2_berry_program_update_screen_1: @ 80AAF28 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAF3E + bl m4aMPlayAllStop + ldr r0, _080AAF44 + bl set_callback2 +_080AAF3E: + pop {r0} + bx r0 + .align 2, 0 +_080AAF44: .4byte sub_81BF384 + 1 + thumb_func_end c2_berry_program_update_screen_1 + + thumb_func_start title_screen_update_rayquaza_ring_palette +title_screen_update_rayquaza_ring_palette: @ 80AAF48 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080AAF9C + adds r0, r1, 0 + movs r1, 0x80 + bl cosine + lsls r0, 16 + asrs r0, 16 + adds r2, r0, 0 + adds r2, 0x80 + lsls r0, r2, 5 + subs r0, r2 + cmp r0, 0 + bge _080AAF72 + adds r0, 0xFF +_080AAF72: + asrs r0, 8 + movs r3, 0x1F + subs r1, r3, r0 + movs r0, 0x16 + muls r0, r2 + cmp r0, 0 + bge _080AAF82 + adds r0, 0xFF +_080AAF82: + asrs r0, 8 + subs r0, r3, r0 + lsls r0, 5 + orrs r1, r0 + movs r0, 0xC0 + lsls r0, 6 + orrs r1, r0 + mov r0, sp + strh r1, [r0] + movs r1, 0xEF + movs r2, 0x2 + bl gpu_pal_apply +_080AAF9C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end title_screen_update_rayquaza_ring_palette + + thumb_func_start sub_80AAFA4 +sub_80AAFA4: @ 80AAFA4 + push {r4-r6,lr} + ldr r0, _080AB068 + bl is_function_an_active_task + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080AB060 + movs r0, 0x90 + lsls r0, 5 + bl gpu_pal_alloc_new + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080AB06C + lsls r1, r5, 5 + ldr r2, _080AB070 + adds r1, r2 + ldr r2, _080AB074 + bl CpuSet + bl sub_80AB294 + ldr r4, _080AB078 + ldr r1, _080AB07C + adds r0, r4, r1 + strb r5, [r0] + ldr r0, _080AB080 + bl gpu_pal_alloc_new + ldr r2, _080AB084 + adds r1, r4, r2 + strb r0, [r1] + ldr r1, _080AB088 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x4 + adds r0, r4, r2 + strb r6, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0xC + adds r0, r4, r2 + strb r6, [r0] + adds r1, 0x22 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x17 + adds r0, r4, r2 + strb r6, [r0] + adds r1, 0x24 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x1B + adds r0, r4, r2 + strb r6, [r0] + subs r1, 0xD + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x18 + adds r0, r4, r2 + strb r6, [r0] + subs r1, 0x1D + adds r0, r4, r1 + strb r6, [r0] + movs r0, 0x10 + movs r1, 0 + bl sub_80AC124 + movs r2, 0xDA + lsls r2, 3 + adds r0, r4, r2 + strb r6, [r0] + ldr r0, _080AB08C + adds r1, r4, r0 + movs r0, 0x3 + strb r0, [r1] + movs r1, 0xD9 + lsls r1, 3 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x3 + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080AB090 + movs r1, 0x50 + bl AddTask + ldr r1, _080AB094 + adds r4, r1 + strb r0, [r4] +_080AB060: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AB068: .4byte sub_80AB1B0 + 1 +_080AB06C: .4byte 0x0854c270 +_080AB070: .4byte 0x02037914 +_080AB074: .4byte 0x04000008 +_080AB078: .4byte 0x02038454 +_080AB07C: .4byte 0x000006d5 +_080AB080: .4byte 0x00001201 +_080AB084: .4byte 0x000006d4 +_080AB088: .4byte 0x000006da +_080AB08C: .4byte 0x000006c6 +_080AB090: .4byte sub_80AB160 + 1 +_080AB094: .4byte 0x000006c9 + thumb_func_end sub_80AAFA4 + + thumb_func_start weather_set +weather_set: @ 80AB098 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + beq _080AB0AE + cmp r4, 0x5 + beq _080AB0AE + cmp r4, 0xD + beq _080AB0AE + bl play_some_sound +_080AB0AE: + ldr r1, _080AB0F0 + ldr r2, _080AB0F4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, r4 + beq _080AB0D2 + movs r3, 0xDA + lsls r3, 3 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r4 + bne _080AB0D2 + ldr r0, _080AB0F8 + lsls r1, r4, 4 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_080AB0D2: + ldr r1, _080AB0F0 + ldr r2, _080AB0FC + adds r0, r1, r2 + movs r2, 0 + strb r2, [r0] + ldr r3, _080AB0F4 + adds r0, r1, r3 + strb r4, [r0] + ldr r0, _080AB100 + adds r1, r0 + strh r2, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AB0F0: .4byte 0x02038454 +_080AB0F4: .4byte 0x000006d1 +_080AB0F8: .4byte 0x0854c150 +_080AB0FC: .4byte 0x000006d3 +_080AB100: .4byte 0x000006ce + thumb_func_end weather_set + + thumb_func_start sub_80AB104 +sub_80AB104: @ 80AB104 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl play_some_sound + ldr r0, _080AB128 + movs r2, 0xDA + lsls r2, 3 + adds r1, r0, r2 + strb r4, [r1] + ldr r1, _080AB12C + adds r0, r1 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AB128: .4byte 0x02038454 +_080AB12C: .4byte 0x000006d1 + thumb_func_end sub_80AB104 + + thumb_func_start sub_80AB130 +sub_80AB130: @ 80AB130 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl play_some_sound + ldr r1, _080AB15C + movs r2, 0xDA + lsls r2, 3 + adds r0, r1, r2 + strb r4, [r0] + adds r2, 0x1 + adds r0, r1, r2 + strb r4, [r0] + movs r0, 0xD9 + lsls r0, 3 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AB15C: .4byte 0x02038454 + thumb_func_end sub_80AB130 + + thumb_func_start sub_80AB160 +sub_80AB160: @ 80AB160 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _080AB1A0 + movs r1, 0xD9 + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080AB198 + ldr r1, _080AB1A4 + movs r3, 0xDA + lsls r3, 3 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r1, _080AB1A8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080AB1AC + str r1, [r0] +_080AB198: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AB1A0: .4byte 0x02038454 +_080AB1A4: .4byte 0x0854c150 +_080AB1A8: .4byte 0x03005e00 +_080AB1AC: .4byte sub_80AB1B0 + 1 + thumb_func_end sub_80AB160 + + thumb_func_start sub_80AB1B0 +sub_80AB1B0: @ 80AB1B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r5, _080AB218 + movs r0, 0xDA + lsls r0, 3 + adds r6, r5, r0 + ldr r1, _080AB21C + adds r7, r5, r1 + ldrb r0, [r6] + ldrb r2, [r7] + cmp r0, r2 + beq _080AB22C + ldr r0, _080AB220 + mov r9, r0 + ldrb r0, [r6] + lsls r0, 4 + mov r1, r9 + adds r1, 0xC + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080AB23C + ldr r1, _080AB224 + adds r1, r5 + mov r8, r1 + ldrb r0, [r1] + cmp r0, 0x2 + beq _080AB23C + ldrb r0, [r7] + lsls r0, 4 + add r0, r9 + ldr r0, [r0] + bl _call_via_r0 + ldr r2, _080AB228 + adds r0, r5, r2 + strb r4, [r0] + mov r0, r8 + strb r4, [r0] + ldrb r0, [r7] + strb r0, [r6] + adds r2, 0x10 + adds r1, r5, r2 + movs r0, 0x1 + strb r0, [r1] + b _080AB23C + .align 2, 0 +_080AB218: .4byte 0x02038454 +_080AB21C: .4byte 0x000006d1 +_080AB220: .4byte 0x0854c150 +_080AB224: .4byte 0x000006c6 +_080AB228: .4byte 0x000006c3 +_080AB22C: + ldr r0, _080AB25C + ldrb r1, [r6] + lsls r1, 4 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_080AB23C: + ldr r1, _080AB260 + ldr r0, _080AB264 + ldr r2, _080AB268 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AB25C: .4byte 0x0854c150 +_080AB260: .4byte 0x0854c240 +_080AB264: .4byte 0x02038454 +_080AB268: .4byte 0x000006c6 + thumb_func_end sub_80AB1B0 + + thumb_func_start sub_80AB26C +sub_80AB26C: @ 80AB26C + ldr r0, _080AB280 + ldr r2, _080AB284 + adds r1, r0, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, _080AB288 + adds r0, r1 + strb r2, [r0] + bx lr + .align 2, 0 +_080AB280: .4byte 0x02038454 +_080AB284: .4byte 0x000006c1 +_080AB288: .4byte 0x000006c2 + thumb_func_end sub_80AB26C + + thumb_func_start nullsub_36 +nullsub_36: @ 80AB28C + bx lr + thumb_func_end nullsub_36 + + thumb_func_start sub_80AB290 +sub_80AB290: @ 80AB290 + movs r0, 0 + bx lr + thumb_func_end sub_80AB290 + + thumb_func_start sub_80AB294 +sub_80AB294: @ 80AB294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, _080AB2D4 + ldr r0, _080AB2D8 + str r0, [r1] + movs r0, 0 + mov r12, r0 + ldr r1, _080AB2DC + mov r10, r1 +_080AB2AC: + mov r7, r10 + mov r0, r12 + cmp r0, 0 + bne _080AB2B8 + ldr r1, _080AB2E0 + adds r7, r1 +_080AB2B8: + movs r5, 0 + movs r0, 0x1 + add r0, r12 + mov r9, r0 +_080AB2C0: + lsls r1, r5, 8 + lsls r0, r5, 24 + lsrs r2, r0, 16 + mov r0, r12 + cmp r0, 0 + bne _080AB2E4 + adds r0, r1, 0 + lsls r0, 12 + lsrs r4, r0, 16 + b _080AB2E6 + .align 2, 0 +_080AB2D4: .4byte 0x03000f50 +_080AB2D8: .4byte 0x0854c250 +_080AB2DC: .4byte 0x020388b4 +_080AB2E0: .4byte 0xfffffda0 +_080AB2E4: + movs r4, 0 +_080AB2E6: + movs r3, 0 + adds r1, r5, 0x1 + mov r8, r1 +_080AB2EC: + subs r1, r2, r4 + lsls r1, 16 + lsrs r2, r1, 16 + lsls r0, r3, 5 + adds r0, r7 + adds r0, r5 + lsrs r1, 24 + strb r1, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x2 + bls _080AB2EC + adds r6, r2, 0 + movs r0, 0xF8 + lsls r0, 5 + subs r0, r2 + cmp r0, 0 + bge _080AB314 + adds r0, 0xF +_080AB314: + lsls r0, 12 + lsrs r4, r0, 16 + cmp r5, 0xB + bhi _080AB35E + cmp r3, 0x12 + bhi _080AB384 +_080AB320: + adds r0, r2, r4 + lsls r0, 16 + lsrs r2, r0, 16 + subs r0, r2, r6 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + ble _080AB33C + lsrs r0, 31 + adds r0, r1, r0 + asrs r0, 1 + subs r0, r2, r0 + lsls r0, 16 + lsrs r2, r0, 16 +_080AB33C: + lsls r0, r3, 5 + adds r0, r7 + adds r1, r0, r5 + lsrs r0, r2, 8 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _080AB352 + movs r0, 0x1F + strb r0, [r1] +_080AB352: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x12 + bls _080AB320 + b _080AB384 +_080AB35E: + cmp r3, 0x12 + bhi _080AB384 + movs r6, 0x1F +_080AB364: + adds r1, r2, r4 + lsls r1, 16 + lsrs r2, r1, 16 + lsls r0, r3, 5 + adds r0, r7 + adds r0, r5 + lsrs r1, 24 + strb r1, [r0] + cmp r1, 0x1F + bls _080AB37A + strb r6, [r0] +_080AB37A: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x12 + bls _080AB364 +_080AB384: + mov r1, r8 + lsls r0, r1, 16 + lsrs r5, r0, 16 + cmp r5, 0x1F + bls _080AB2C0 + mov r1, r9 + lsls r0, r1, 16 + lsrs r0, 16 + mov r12, r0 + cmp r0, 0x1 + bls _080AB2AC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AB294 + + thumb_func_start sub_80AB3A8 +sub_80AB3A8: @ 80AB3A8 + push {r4-r7,lr} + ldr r0, _080AB3D8 + ldr r1, _080AB3DC + adds r2, r0, r1 + ldrb r1, [r2] + adds r3, r0, 0 + cmp r1, 0x2 + beq _080AB42C + movs r7, 0xD8 + lsls r7, 3 + adds r4, r3, r7 + ldr r1, _080AB3E0 + adds r0, r3, r1 + ldrb r7, [r4] + mov r12, r7 + movs r6, 0 + ldrsb r6, [r4, r6] + movs r5, 0 + ldrsb r5, [r0, r5] + cmp r6, r5 + bne _080AB3E4 + movs r0, 0x3 + strb r0, [r2] + b _080AB42C + .align 2, 0 +_080AB3D8: .4byte 0x02038454 +_080AB3DC: .4byte 0x000006c6 +_080AB3E0: .4byte 0x000006c1 +_080AB3E4: + ldr r0, _080AB40C + adds r2, r3, r0 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r7, _080AB410 + adds r1, r3, r7 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _080AB42C + movs r0, 0 + strb r0, [r2] + mov r0, r12 + cmp r6, r5 + bge _080AB414 + adds r0, 0x1 + b _080AB418 + .align 2, 0 +_080AB40C: .4byte 0x000006c3 +_080AB410: .4byte 0x000006c2 +_080AB414: + mov r0, r12 + subs r0, 0x1 +_080AB418: + strb r0, [r4] + movs r1, 0xD8 + lsls r1, 3 + adds r0, r3, r1 + movs r2, 0 + ldrsb r2, [r0, r2] + movs r0, 0 + movs r1, 0x20 + bl pal_fade_2 +_080AB42C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AB3A8 + + thumb_func_start sub_80AB434 +sub_80AB434: @ 80AB434 + push {lr} + ldr r2, _080AB46C + ldr r0, _080AB470 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080AB452 + ldr r3, _080AB474 + adds r1, r2, r3 + movs r0, 0 + strb r0, [r1] +_080AB452: + movs r1, 0xDA + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + subs r0, 0x3 + cmp r0, 0xA + bhi _080AB51C + lsls r0, 2 + ldr r1, _080AB478 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AB46C: .4byte 0x02038454 +_080AB470: .4byte 0x000006cb +_080AB474: .4byte 0x000006ca +_080AB478: .4byte _080AB47C + .align 2, 0 +_080AB47C: + .4byte _080AB4A8 + .4byte _080AB4A8 + .4byte _080AB4A8 + .4byte _080AB4F4 + .4byte _080AB51C + .4byte _080AB51C + .4byte _080AB51C + .4byte _080AB51C + .4byte _080AB4A8 + .4byte _080AB4D0 + .4byte _080AB4A8 +_080AB4A8: + bl sub_80AB54C + lsls r0, 24 + cmp r0, 0 + bne _080AB53C + ldr r0, _080AB4C8 + movs r2, 0xD8 + lsls r2, 3 + adds r1, r0, r2 + movs r2, 0x3 + strb r2, [r1] + ldr r3, _080AB4CC + adds r0, r3 + strb r2, [r0] + b _080AB53C + .align 2, 0 +_080AB4C8: .4byte 0x02038454 +_080AB4CC: .4byte 0x000006c6 +_080AB4D0: + bl sub_80AB5AC + lsls r0, 24 + cmp r0, 0 + bne _080AB53C + ldr r1, _080AB4EC + movs r0, 0xD8 + lsls r0, 3 + adds r2, r1, r0 + movs r0, 0xFA + strb r0, [r2] + ldr r2, _080AB4F0 + adds r1, r2 + b _080AB538 + .align 2, 0 +_080AB4EC: .4byte 0x02038454 +_080AB4F0: .4byte 0x000006c6 +_080AB4F4: + bl sub_80AB604 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080AB53C + ldr r0, _080AB514 + movs r3, 0xD8 + lsls r3, 3 + adds r1, r0, r3 + strb r2, [r1] + ldr r1, _080AB518 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + b _080AB53C + .align 2, 0 +_080AB514: .4byte 0x02038454 +_080AB518: .4byte 0x000006c6 +_080AB51C: + ldr r0, _080AB540 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080AB53C + ldr r3, _080AB544 + adds r0, r2, r3 + ldrb r1, [r0] + subs r3, 0x1 + adds r0, r2, r3 + strb r1, [r0] + ldr r0, _080AB548 + adds r1, r2, r0 +_080AB538: + movs r0, 0x3 + strb r0, [r1] +_080AB53C: + pop {r0} + bx r0 + .align 2, 0 +_080AB540: .4byte 0x02037fd4 +_080AB544: .4byte 0x000006c1 +_080AB548: .4byte 0x000006c6 + thumb_func_end sub_80AB434 + + thumb_func_start sub_80AB54C +sub_80AB54C: @ 80AB54C + push {r4,lr} + sub sp, 0x4 + ldr r2, _080AB588 + ldr r0, _080AB58C + adds r4, r2, r0 + ldrb r0, [r4] + cmp r0, 0x10 + beq _080AB5A2 + adds r1, r0, 0x1 + strb r1, [r4] + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xF + bhi _080AB594 + movs r3, 0x10 + subs r3, r1 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _080AB590 + adds r0, r2, r1 + ldrh r0, [r0] + str r0, [sp] + movs r0, 0 + movs r1, 0x20 + movs r2, 0x3 + bl sub_80AB848 + movs r0, 0x1 + b _080AB5A4 + .align 2, 0 +_080AB588: .4byte 0x02038454 +_080AB58C: .4byte 0x000006c7 +_080AB590: .4byte 0x000006c4 +_080AB594: + movs r0, 0 + movs r1, 0x20 + movs r2, 0x3 + bl pal_fade_2 + movs r0, 0x10 + strb r0, [r4] +_080AB5A2: + movs r0, 0 +_080AB5A4: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AB54C + + thumb_func_start sub_80AB5AC +sub_80AB5AC: @ 80AB5AC + push {r4,lr} + ldr r2, _080AB5E0 + ldr r0, _080AB5E4 + adds r4, r2, r0 + ldrb r0, [r4] + cmp r0, 0x10 + beq _080AB5FC + adds r3, r0, 0x1 + strb r3, [r4] + lsls r0, r3, 24 + lsrs r0, 24 + cmp r0, 0xF + bhi _080AB5EC + movs r0, 0x6 + negs r0, r0 + movs r1, 0x10 + subs r1, r3 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080AB5E8 + adds r2, r3 + ldrh r2, [r2] + bl sub_80AB990 + movs r0, 0x1 + b _080AB5FE + .align 2, 0 +_080AB5E0: .4byte 0x02038454 +_080AB5E4: .4byte 0x000006c7 +_080AB5E8: .4byte 0x000006c4 +_080AB5EC: + movs r2, 0x6 + negs r2, r2 + movs r0, 0 + movs r1, 0x20 + bl pal_fade_2 + movs r0, 0x10 + strb r0, [r4] +_080AB5FC: + movs r0, 0 +_080AB5FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AB5AC + + thumb_func_start sub_80AB604 +sub_80AB604: @ 80AB604 + push {lr} + ldr r2, _080AB62C + ldr r1, _080AB630 + adds r0, r2, r1 + ldrb r1, [r0] + cmp r1, 0x10 + beq _080AB638 + adds r1, 0x1 + strb r1, [r0] + movs r0, 0x10 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080AB634 + adds r1, r2, r3 + ldrh r1, [r1] + bl sub_80ABAB0 + movs r0, 0x1 + b _080AB63A + .align 2, 0 +_080AB62C: .4byte 0x02038454 +_080AB630: .4byte 0x000006c7 +_080AB634: .4byte 0x000006c4 +_080AB638: + movs r0, 0 +_080AB63A: + pop {r1} + bx r1 + thumb_func_end sub_80AB604 + + thumb_func_start nullsub_94 +nullsub_94: @ 80AB640 + bx lr + thumb_func_end nullsub_94 + + thumb_func_start pal_fade_2 +pal_fade_2: @ 80AB644 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + asrs r0, r2, 24 + cmp r0, 0 + ble _080AB754 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r6, r3, 4 + adds r0, r1, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r4, r9 + bcc _080AB67C + b _080AB82E +_080AB67C: + ldr r1, [sp] + lsls r0, r1, 24 + asrs r0, 19 + str r0, [sp, 0x4] +_080AB684: + ldr r0, _080AB6B4 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB6C0 + lsls r1, r6, 1 + ldr r0, _080AB6B8 + adds r0, r1, r0 + ldr r2, _080AB6BC + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + mov r2, r9 + lsls r2, 16 + mov r8, r2 + adds r4, 0x1 + mov r12, r4 + b _080AB73E + .align 2, 0 +_080AB6B4: .4byte 0x03000f50 +_080AB6B8: .4byte 0x02037714 +_080AB6BC: .4byte 0x02037b14 +_080AB6C0: + cmp r0, 0x2 + beq _080AB6D4 + adds r1, r4, 0 + subs r1, 0x10 + ldr r2, _080AB6D8 + ldr r3, _080AB6DC + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _080AB6E4 +_080AB6D4: + ldr r0, _080AB6E0 + b _080AB6EA + .align 2, 0 +_080AB6D8: .4byte 0x02038454 +_080AB6DC: .4byte 0x000006d5 +_080AB6E0: .4byte 0x020388b4 +_080AB6E4: + movs r3, 0x80 + lsls r3, 2 + adds r0, r2, r3 +_080AB6EA: + ldr r1, [sp, 0x4] + adds r5, r1, r0 + movs r7, 0 + mov r2, r9 + lsls r2, 16 + mov r8, r2 + adds r4, 0x1 + mov r12, r4 + ldr r3, _080AB74C + mov r10, r3 +_080AB6FE: + adds r2, r6, 0 + lsls r0, r2, 1 + ldr r1, _080AB750 + adds r0, r1 + ldr r1, [r0] + lsls r0, r1, 27 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r4, [r0] + lsls r0, r1, 22 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r1, 17 + lsrs r1, 27 + adds r1, r5, r1 + ldrb r1, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r2, 1 + add r2, r10 + lsls r1, 10 + lsls r3, 5 + orrs r1, r3 + orrs r1, r4 + strh r1, [r2] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0xF + bls _080AB6FE +_080AB73E: + mov r2, r12 + lsls r0, r2, 16 + lsrs r4, r0, 16 + cmp r0, r8 + bcc _080AB684 + b _080AB82E + .align 2, 0 +_080AB74C: .4byte 0x02037b14 +_080AB750: .4byte 0x02037714 +_080AB754: + cmp r0, 0 + bge _080AB81C + mvns r0, r0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r6, r3, 4 + adds r0, r1, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r4, r3, 0 + cmp r4, r9 + bcs _080AB82E +_080AB770: + ldr r0, _080AB7A0 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB7AC + lsls r1, r6, 1 + ldr r0, _080AB7A4 + adds r0, r1, r0 + ldr r2, _080AB7A8 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + mov r3, r9 + lsls r3, 16 + mov r8, r3 + adds r4, 0x1 + mov r12, r4 + b _080AB804 + .align 2, 0 +_080AB7A0: .4byte 0x03000f50 +_080AB7A4: .4byte 0x02037714 +_080AB7A8: .4byte 0x02037b14 +_080AB7AC: + movs r7, 0 + mov r0, r9 + lsls r0, 16 + mov r8, r0 + adds r4, 0x1 + mov r12, r4 + ldr r1, _080AB810 + mov r10, r1 + ldr r2, [sp] + lsls r0, r2, 24 + asrs r5, r0, 11 +_080AB7C2: + lsls r0, r6, 1 + ldr r3, _080AB814 + adds r4, r0, r3 + ldr r1, _080AB818 + adds r0, r1 + ldrh r3, [r0] + lsls r3, 16 + lsrs r0, r3, 17 + movs r1, 0xF + ands r0, r1 + lsrs r1, r3, 18 + movs r2, 0xF0 + ands r1, r2 + orrs r0, r1 + lsrs r3, 19 + movs r2, 0xF0 + lsls r2, 4 + adds r1, r2, 0 + ands r3, r1 + orrs r0, r3 + lsls r0, 1 + adds r0, r5 + add r0, r10 + ldrh r0, [r0] + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0xF + bls _080AB7C2 +_080AB804: + mov r3, r12 + lsls r0, r3, 16 + lsrs r4, r0, 16 + cmp r0, r8 + bcc _080AB770 + b _080AB82E + .align 2, 0 +_080AB810: .4byte 0x0854014c +_080AB814: .4byte 0x02037b14 +_080AB818: .4byte 0x02037714 +_080AB81C: + lsls r1, r4, 5 + ldr r0, _080AB840 + adds r0, r1, r0 + ldr r2, _080AB844 + adds r1, r2 + mov r3, r9 + lsls r2, r3, 3 + bl CpuFastSet +_080AB82E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AB840: .4byte 0x02037714 +_080AB844: .4byte 0x02037b14 + thumb_func_end pal_fade_2 + + thumb_func_start sub_80AB848 +sub_80AB848: @ 80AB848 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + mov r1, sp + strh r4, [r1] + ldr r1, [sp] + lsls r3, r1, 27 + lsrs r3, 27 + str r3, [sp, 0x4] + lsls r3, r1, 22 + lsrs r3, 27 + str r3, [sp, 0x8] + lsls r1, 17 + lsrs r1, 27 + str r1, [sp, 0xC] + lsls r6, r0, 4 + mov r3, r10 + adds r1, r3, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + movs r1, 0xFF + lsls r1, 24 + adds r2, r1 + lsrs r2, 24 + adds r4, r0, 0 + cmp r4, r10 + bcs _080AB974 + lsls r0, r2, 24 + asrs r0, 19 + str r0, [sp, 0x10] +_080AB8A0: + ldr r0, _080AB8D0 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB8D4 + mov r0, sp + ldrh r3, [r0] + adds r0, r6, 0 + movs r1, 0x10 + mov r2, r8 + bl pal_fade_1 + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + mov r3, r10 + lsls r3, 16 + mov r9, r3 + adds r4, 0x1 + mov r12, r4 + b _080AB96A + .align 2, 0 +_080AB8D0: .4byte 0x03000f50 +_080AB8D4: + cmp r0, 0x1 + bne _080AB8E4 + ldr r0, _080AB8E0 + ldr r1, [sp, 0x10] + adds r5, r1, r0 + b _080AB8EA + .align 2, 0 +_080AB8E0: .4byte 0x02038654 +_080AB8E4: + ldr r0, _080AB984 + ldr r3, [sp, 0x10] + adds r5, r3, r0 +_080AB8EA: + movs r7, 0 + mov r0, r10 + lsls r0, 16 + mov r9, r0 + adds r4, 0x1 + mov r12, r4 +_080AB8F6: + adds r4, r6, 0 + lsls r0, r4, 1 + ldr r1, _080AB988 + adds r0, r1 + ldr r1, [r0] + lsls r0, r1, 27 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r0, r1, 22 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r2, [r0] + lsls r1, 17 + lsrs r1, 27 + adds r1, r5, r1 + ldrb r1, [r1] + ldr r6, [sp, 0x4] + subs r0, r6, r3 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + asrs r0, 4 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldr r6, [sp, 0x8] + subs r0, r6, r2 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + asrs r0, 4 + adds r2, r0 + lsls r2, 24 + ldr r6, [sp, 0xC] + subs r0, r6, r1 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + asrs r0, 4 + adds r1, r0 + lsls r1, 24 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r4, 1 + ldr r0, _080AB98C + adds r4, r0 + lsrs r1, 14 + lsrs r2, 19 + orrs r1, r2 + orrs r1, r3 + strh r1, [r4] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0xF + bls _080AB8F6 +_080AB96A: + mov r1, r12 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r0, r9 + bcc _080AB8A0 +_080AB974: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AB984: .4byte 0x020388b4 +_080AB988: .4byte 0x02037714 +_080AB98C: .4byte 0x02037b14 + thumb_func_end sub_80AB848 + + thumb_func_start sub_80AB990 +sub_80AB990: @ 80AB990 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r1, 24 + lsrs r6, r1, 24 + mov r1, sp + strh r2, [r1] + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + eors r0, r1 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, [sp] + lsls r1, r0, 27 + lsrs r1, 27 + str r1, [sp, 0x8] + lsls r1, r0, 22 + lsrs r1, 27 + str r1, [sp, 0xC] + lsls r0, 17 + lsrs r0, 27 + mov r10, r0 + movs r5, 0 + movs r4, 0 +_080AB9C8: + ldr r0, _080AB9F0 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB9F4 + mov r0, sp + ldrh r3, [r0] + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r6, 0 + bl pal_fade_1 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + mov r8, r4 + b _080ABA8A + .align 2, 0 +_080AB9F0: .4byte 0x03000f50 +_080AB9F4: + movs r0, 0 + mov r12, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 24 + adds r4, 0x1 + mov r8, r4 + movs r7, 0x1E + asrs r0, 11 + mov r9, r0 +_080ABA06: + adds r4, r5, 0 + lsls r0, r4, 1 + ldr r5, _080ABAA4 + adds r0, r5 + ldr r0, [r0] + lsls r2, r0, 27 + lsrs r2, 27 + lsls r1, r0, 22 + lsrs r1, 27 + lsls r0, 17 + lsrs r0, 27 + ands r0, r7 + lsls r0, 7 + ands r1, r7 + lsls r1, 3 + orrs r0, r1 + ands r2, r7 + lsls r0, 1 + orrs r0, r2 + add r0, r9 + ldr r1, _080ABAA8 + adds r0, r1 + ldr r1, [r0] + lsls r3, r1, 27 + lsrs r3, 27 + lsls r2, r1, 22 + lsrs r2, 27 + lsls r1, 17 + lsrs r1, 27 + ldr r5, [sp, 0x8] + subs r0, r5, r3 + muls r0, r6 + asrs r0, 4 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldr r5, [sp, 0xC] + subs r0, r5, r2 + muls r0, r6 + asrs r0, 4 + adds r2, r0 + lsls r2, 24 + mov r5, r10 + subs r0, r5, r1 + muls r0, r6 + asrs r0, 4 + adds r1, r0 + lsls r1, 24 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r4, 1 + ldr r0, _080ABAAC + adds r4, r0 + lsrs r1, 14 + lsrs r2, 19 + orrs r1, r2 + orrs r1, r3 + strh r1, [r4] + mov r0, r12 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + cmp r0, 0xF + bls _080ABA06 +_080ABA8A: + mov r1, r8 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bls _080AB9C8 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ABAA4: .4byte 0x02037714 +_080ABAA8: .4byte 0x0854014c +_080ABAAC: .4byte 0x02037b14 + thumb_func_end sub_80AB990 + + thumb_func_start sub_80ABAB0 +sub_80ABAB0: @ 80ABAB0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r3, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r3, 16 + lsrs r3, 16 + mov r0, sp + strh r3, [r0] + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + adds r2, r7, 0 + bl pal_fade_1 + ldr r0, [sp] + lsls r1, r0, 27 + lsrs r1, 27 + str r1, [sp, 0x4] + lsls r1, r0, 22 + lsrs r1, 27 + str r1, [sp, 0x8] + lsls r0, 17 + lsrs r0, 27 + mov r10, r0 + movs r4, 0x10 +_080ABAEC: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80ABC00 + lsls r0, 24 + cmp r0, 0 + beq _080ABB9C + adds r0, r4, 0x1 + lsls r1, r0, 20 + lsrs r1, 16 + mov r12, r1 + lsls r1, r4, 20 + lsrs r6, r1, 16 + mov r9, r0 + cmp r6, r12 + bcs _080ABBB0 + movs r0, 0x1C + mov r8, r0 +_080ABB10: + lsls r5, r6, 1 + ldr r0, _080ABB94 + adds r0, r5, r0 + ldr r2, [r0] + lsls r4, r2, 27 + lsrs r4, 27 + lsls r3, r2, 22 + lsrs r3, 27 + lsls r2, 17 + lsrs r2, 27 + mov r0, r8 + subs r1, r0, r4 + lsls r0, r1, 1 + adds r0, r1 + asrs r0, 2 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x1F + subs r1, r3 + lsls r0, r1, 1 + adds r0, r1 + asrs r0, 2 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + subs r1, r0, r2 + lsls r0, r1, 1 + adds r0, r1 + asrs r0, 2 + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, [sp, 0x4] + subs r0, r1, r4 + muls r0, r7 + asrs r0, 4 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, [sp, 0x8] + subs r0, r1, r3 + muls r0, r7 + asrs r0, 4 + adds r3, r0 + lsls r3, 24 + mov r1, r10 + subs r0, r1, r2 + muls r0, r7 + asrs r0, 4 + adds r2, r0 + lsls r2, 24 + ldr r0, _080ABB98 + adds r5, r0 + lsrs r2, 14 + lsrs r3, 19 + orrs r2, r3 + orrs r2, r4 + strh r2, [r5] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r12 + bcc _080ABB10 + b _080ABBB0 + .align 2, 0 +_080ABB94: .4byte 0x02037714 +_080ABB98: .4byte 0x02037b14 +_080ABB9C: + lsls r0, r4, 20 + lsrs r0, 16 + mov r1, sp + ldrh r3, [r1] + movs r1, 0x10 + adds r2, r7, 0 + bl pal_fade_1 + adds r4, 0x1 + mov r9, r4 +_080ABBB0: + mov r1, r9 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bls _080ABAEC + 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_80ABAB0 + + thumb_func_start sub_80ABBCC +sub_80ABBCC: @ 80ABBCC + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, _080ABBF4 + ldr r0, _080ABBF8 + adds r1, r3, r0 + ldrb r0, [r1] + cmp r0, 0x5 + bhi _080ABBEE + ldr r4, _080ABBFC + adds r0, r3, r4 + ldrb r3, [r1] + adds r0, r3 + strb r2, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080ABBEE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ABBF4: .4byte 0x02038454 +_080ABBF8: .4byte 0x000006fa +_080ABBFC: .4byte 0x000006f4 + thumb_func_end sub_80ABBCC + + thumb_func_start sub_80ABC00 +sub_80ABC00: @ 80ABC00 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r2, _080ABC28 + ldr r4, _080ABC2C + adds r0, r2, r4 + ldrb r0, [r0] + cmp r1, r0 + bcs _080ABC3E + ldr r5, _080ABC30 + adds r4, r2, r5 + adds r2, r0, 0 +_080ABC1A: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _080ABC34 + movs r0, 0x1 + b _080ABC40 + .align 2, 0 +_080ABC28: .4byte 0x02038454 +_080ABC2C: .4byte 0x000006fa +_080ABC30: .4byte 0x000006f4 +_080ABC34: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bcc _080ABC1A +_080ABC3E: + movs r0, 0 +_080ABC40: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80ABC00 + + thumb_func_start sub_80ABC48 +sub_80ABC48: @ 80ABC48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _080ABC74 + ldr r1, _080ABC78 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _080ABC6E + lsls r2, r4, 24 + asrs r2, 24 + movs r0, 0 + movs r1, 0x20 + bl pal_fade_2 + movs r1, 0xD8 + lsls r1, 3 + adds r0, r5, r1 + strb r4, [r0] +_080ABC6E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ABC74: .4byte 0x02038454 +_080ABC78: .4byte 0x000006c6 + thumb_func_end sub_80ABC48 + + thumb_func_start sub_80ABC7C +sub_80ABC7C: @ 80ABC7C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r3, _080ABCC4 + ldr r0, _080ABCC8 + adds r2, r3, r0 + ldrb r0, [r2] + cmp r0, 0x3 + bne _080ABCBC + movs r1, 0 + strb r1, [r2] + movs r2, 0xD8 + lsls r2, 3 + adds r0, r3, r2 + strb r4, [r0] + adds r2, 0x1 + adds r0, r3, r2 + strb r5, [r0] + adds r2, 0x2 + adds r0, r3, r2 + strb r1, [r0] + ldr r1, _080ABCCC + adds r0, r3, r1 + strb r6, [r0] + lsls r0, r4, 24 + asrs r0, 24 + bl sub_80ABC48 +_080ABCBC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ABCC4: .4byte 0x02038454 +_080ABCC8: .4byte 0x000006c6 +_080ABCCC: .4byte 0x000006c2 + thumb_func_end sub_80ABC7C + + thumb_func_start fade_screen +fade_screen: @ 80ABCD0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0x1 + beq _080ABD08 + cmp r0, 0x1 + bgt _080ABCEC + cmp r0, 0 + beq _080ABCF6 + b _080ABDE4 +_080ABCEC: + cmp r2, 0x2 + beq _080ABCFC + cmp r2, 0x3 + beq _080ABD0C + b _080ABDE4 +_080ABCF6: + movs r4, 0 + movs r1, 0 + b _080ABD10 +_080ABCFC: + ldr r4, _080ABD04 + movs r1, 0 + b _080ABD10 + .align 2, 0 +_080ABD04: .4byte 0x0000ffff +_080ABD08: + movs r4, 0 + b _080ABD0E +_080ABD0C: + ldr r4, _080ABD30 +_080ABD0E: + movs r1, 0x1 +_080ABD10: + ldr r0, _080ABD34 + movs r2, 0xDA + lsls r2, 3 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x3 + blt _080ABD38 + cmp r0, 0x6 + ble _080ABD2A + cmp r0, 0xD + bgt _080ABD38 + cmp r0, 0xB + blt _080ABD38 +_080ABD2A: + movs r2, 0x1 + b _080ABD3A + .align 2, 0 +_080ABD30: .4byte 0x0000ffff +_080ABD34: .4byte 0x02038454 +_080ABD38: + movs r2, 0 +_080ABD3A: + cmp r1, 0 + beq _080ABD7C + cmp r2, 0 + beq _080ABD4E + ldr r0, _080ABD6C + ldr r1, _080ABD70 + movs r2, 0x80 + lsls r2, 1 + bl CpuFastSet +_080ABD4E: + movs r0, 0x1 + negs r0, r0 + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080ABD74 + ldr r3, _080ABD78 + adds r0, r3 + movs r1, 0x2 + strb r1, [r0] + b _080ABDE4 + .align 2, 0 +_080ABD6C: .4byte 0x02037b14 +_080ABD70: .4byte 0x02037714 +_080ABD74: .4byte 0x02038454 +_080ABD78: .4byte 0x000006c6 +_080ABD7C: + ldr r1, _080ABD94 + ldr r3, _080ABD98 + adds r0, r1, r3 + strh r4, [r0] + cmp r2, 0 + beq _080ABDA0 + ldr r0, _080ABD9C + adds r1, r0 + movs r0, 0 + strb r0, [r1] + b _080ABDB2 + .align 2, 0 +_080ABD94: .4byte 0x02038454 +_080ABD98: .4byte 0x000006c4 +_080ABD9C: .4byte 0x000006c7 +_080ABDA0: + movs r0, 0x1 + negs r0, r0 + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_080ABDB2: + ldr r4, _080ABDEC + ldr r1, _080ABDF0 + adds r0, r4, r1 + movs r1, 0 + movs r5, 0x1 + strb r5, [r0] + ldr r2, _080ABDF4 + adds r0, r4, r2 + strb r5, [r0] + ldr r3, _080ABDF8 + adds r0, r4, r3 + strb r1, [r0] + movs r1, 0xE6 + lsls r1, 3 + adds r0, r4, r1 + ldrb r0, [r0] + adds r2, 0x68 + adds r1, r4, r2 + ldrb r1, [r1] + bl sub_80AC124 + movs r3, 0xD9 + lsls r3, 3 + adds r4, r3 + strb r5, [r4] +_080ABDE4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ABDEC: .4byte 0x02038454 +_080ABDF0: .4byte 0x000006c6 +_080ABDF4: .4byte 0x000006ca +_080ABDF8: .4byte 0x000006cb + thumb_func_end fade_screen + + thumb_func_start sub_80ABDFC +sub_80ABDFC: @ 80ABDFC + ldr r0, _080ABE10 + ldr r1, _080ABE14 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_080ABE10: .4byte 0x02038454 +_080ABE14: .4byte 0x000006c6 + thumb_func_end sub_80ABDFC + + thumb_func_start sub_80ABE18 +sub_80ABE18: @ 80ABE18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 8 + movs r1, 0x80 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 + ldr r5, _080ABE58 + ldr r2, _080ABE5C + adds r0, r5, r2 + ldrb r0, [r0] + adds r1, r5, 0 + cmp r0, 0x1 + beq _080ABE60 + cmp r0, 0x2 + beq _080ABEAC + adds r2, 0xA + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080ABEE4 + lsls r0, r4, 24 + lsrs r0, 24 + subs r2, 0x10 + adds r1, r2 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x1 + bl pal_fade_2 + b _080ABEF4 + .align 2, 0 +_080ABE58: .4byte 0x02038454 +_080ABE5C: .4byte 0x000006c6 +_080ABE60: + ldr r2, _080ABEA0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080ABEF4 + adds r2, 0x6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080ABE7C + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80ABBCC +_080ABE7C: + lsls r0, r4, 20 + lsrs r4, r0, 16 + movs r2, 0 + ldr r6, _080ABEA4 + ldr r0, _080ABEA8 + adds r3, r5, r0 +_080ABE88: + adds r0, r4, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r3] + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _080ABE88 + b _080ABEF4 + .align 2, 0 +_080ABEA0: .4byte 0x000006ca +_080ABEA4: .4byte 0x02037b14 +_080ABEA8: .4byte 0x000006c4 +_080ABEAC: + lsls r0, r4, 20 + lsrs r4, r0, 16 + lsls r1, r4, 1 + ldr r0, _080ABED8 + adds r0, r1, r0 + ldr r2, _080ABEDC + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + ldr r0, _080ABEE0 + ldrh r2, [r0, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r0, 0x6] + lsls r3, 17 + lsrs r3, 17 + adds r0, r4, 0 + movs r1, 0x10 + bl pal_fade_1 + b _080ABEF4 + .align 2, 0 +_080ABED8: .4byte 0x02037b14 +_080ABEDC: .4byte 0x02037714 +_080ABEE0: .4byte 0x02037fd4 +_080ABEE4: + lsls r0, r4, 20 + lsrs r4, r0, 16 + ldr r3, _080ABEFC + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0xC + bl pal_fade_1 +_080ABEF4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ABEFC: .4byte 0x000073fc + thumb_func_end sub_80ABE18 + + thumb_func_start sub_80ABF00 +sub_80ABF00: @ 80ABF00 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080ABF1C + movs r2, 0xD8 + lsls r2, 3 + adds r1, r2 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x1 + bl pal_fade_2 + pop {r0} + bx r0 + .align 2, 0 +_080ABF1C: .4byte 0x02038454 + thumb_func_end sub_80ABF00 + + thumb_func_start sub_80ABF20 +sub_80ABF20: @ 80ABF20 + push {lr} + ldr r1, _080ABF34 + ldr r2, _080ABF38 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080ABF3C + movs r0, 0 + b _080ABF42 + .align 2, 0 +_080ABF34: .4byte 0x02038454 +_080ABF38: .4byte 0x000006c6 +_080ABF3C: + ldr r2, _080ABF48 + adds r0, r1, r2 + ldrb r0, [r0] +_080ABF42: + pop {r1} + bx r1 + .align 2, 0 +_080ABF48: .4byte 0x000006ca + thumb_func_end sub_80ABF20 + + thumb_func_start sub_80ABF4C +sub_80ABF4C: @ 80ABF4C + push {r4,lr} + ldr r4, _080ABF74 + ldr r1, _080ABF78 + adds r4, r1 + ldrb r1, [r4] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + ldrb r0, [r4] + bl sub_80ABE18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ABF74: .4byte 0x02038454 +_080ABF78: .4byte 0x000006d4 + thumb_func_end sub_80ABF4C + + thumb_func_start sub_80ABF7C +sub_80ABF7C: @ 80ABF7C + movs r2, 0x20 + strb r2, [r0] + strb r2, [r1] + bx lr + thumb_func_end sub_80ABF7C + + thumb_func_start sub_80ABF84 +sub_80ABF84: @ 80ABF84 + ldr r0, _080ABF98 + ldr r2, _080ABF9C + adds r1, r0, r2 + movs r2, 0x1 + strb r2, [r1] + ldr r1, _080ABFA0 + adds r0, r1 + strb r2, [r0] + bx lr + .align 2, 0 +_080ABF98: .4byte 0x02038454 +_080ABF9C: .4byte 0x0000074d +_080ABFA0: .4byte 0x0000074e + thumb_func_end sub_80ABF84 + + thumb_func_start sub_80ABFA4 +sub_80ABFA4: @ 80ABFA4 + push {r4,lr} + ldr r1, _080ABFCC + ldr r0, _080ABFD0 + adds r4, r1, r0 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x1F + bgt _080ABFD8 + ldr r0, _080ABFD4 + adds r1, r0 + adds r0, r4, 0 + bl sub_80ABF7C + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x1F + bgt _080ABFD8 + movs r0, 0x1 + b _080ABFDA + .align 2, 0 +_080ABFCC: .4byte 0x02038454 +_080ABFD0: .4byte 0x0000074d +_080ABFD4: .4byte 0x0000074e +_080ABFD8: + movs r0, 0 +_080ABFDA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ABFA4 + + thumb_func_start sub_80ABFE0 +sub_80ABFE0: @ 80ABFE0 + push {lr} + lsls r0, 24 + asrs r0, 24 + mvns r0, r0 + bl sub_80ABC48 + pop {r0} + bx r0 + thumb_func_end sub_80ABFE0 + + thumb_func_start sub_80ABFF0 +sub_80ABFF0: @ 80ABFF0 + ldr r1, _080AC010 + ldr r2, _080AC014 + adds r0, r1, r2 + movs r2, 0 + strh r2, [r0] + movs r3, 0xE8 + lsls r3, 3 + adds r0, r1, r3 + strh r2, [r0] + adds r3, 0x2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _080AC018 + adds r1, r0 + strh r2, [r1] + bx lr + .align 2, 0 +_080AC010: .4byte 0x02038454 +_080AC014: .4byte 0x0000073c +_080AC018: .4byte 0x0000073e + thumb_func_end sub_80ABFF0 + + thumb_func_start sub_80AC01C +sub_80AC01C: @ 80AC01C + push {r4-r7,lr} + ldr r5, _080AC038 + ldr r0, _080AC03C + adds r7, r5, r0 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0x1 + beq _080AC090 + cmp r1, 0x1 + bgt _080AC040 + cmp r1, 0 + beq _080AC046 + b _080AC118 + .align 2, 0 +_080AC038: .4byte 0x02038454 +_080AC03C: .4byte 0x00000742 +_080AC040: + cmp r1, 0x2 + beq _080AC0E4 + b _080AC118 +_080AC046: + movs r3, 0xE8 + lsls r3, 3 + adds r6, r5, r3 + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080AC118 + strh r1, [r6] + ldr r0, _080AC088 + adds r4, r5, r0 + ldrh r0, [r4] + adds r1, r0, 0x1 + strh r1, [r4] + lsls r0, 24 + asrs r0, 24 + bl sub_80ABFE0 + ldrh r1, [r4] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0x5 + ble _080AC118 + ldr r3, _080AC08C + adds r0, r5, r3 + strh r1, [r0] + movs r0, 0x1 + strh r0, [r7] + movs r0, 0x3C + strh r0, [r6] + b _080AC118 + .align 2, 0 +_080AC088: .4byte 0x0000073c +_080AC08C: .4byte 0x0000073e +_080AC090: + movs r0, 0xE8 + lsls r0, 3 + adds r2, r5, r0 + ldrh r0, [r2] + adds r0, 0x3 + movs r1, 0x7F + ands r0, r1 + strh r0, [r2] + ldr r1, _080AC0D8 + movs r3, 0 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + subs r0, 0x1 + asrs r0, 6 + adds r0, 0x2 + ldr r2, _080AC0DC + adds r6, r5, r2 + adds r2, r0, 0 + strh r0, [r6] + ldr r3, _080AC0E0 + adds r4, r5, r3 + movs r3, 0 + ldrsh r1, [r4, r3] + cmp r0, r1 + beq _080AC0D0 + lsls r0, r2, 24 + asrs r0, 24 + bl sub_80ABFE0 +_080AC0D0: + ldrh r0, [r6] + strh r0, [r4] + b _080AC118 + .align 2, 0 +_080AC0D8: .4byte 0x08329f40 +_080AC0DC: .4byte 0x0000073c +_080AC0E0: .4byte 0x0000073e +_080AC0E4: + movs r0, 0xE8 + lsls r0, 3 + adds r1, r5, r0 + ldrh r0, [r1] + adds r0, 0x1 + movs r6, 0 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080AC118 + strh r6, [r1] + ldr r1, _080AC120 + adds r4, r5, r1 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 24 + asrs r0, 24 + bl sub_80ABFE0 + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bne _080AC118 + strh r6, [r7] +_080AC118: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AC120: .4byte 0x0000073c + thumb_func_end sub_80AC01C + + thumb_func_start sub_80AC124 +sub_80AC124: @ 80AC124 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080AC15C + movs r4, 0xE6 + lsls r4, 3 + adds r2, r3, r4 + strh r0, [r2] + adds r4, 0x2 + adds r2, r3, r4 + strh r1, [r2] + adds r4, 0x2 + adds r2, r3, r4 + strh r0, [r2] + ldr r2, _080AC160 + adds r3, r2 + strh r1, [r3] + lsls r1, 8 + orrs r1, r0 + movs r0, 0x52 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC15C: .4byte 0x02038454 +_080AC160: .4byte 0x00000736 + thumb_func_end sub_80AC124 + + thumb_func_start sub_80AC164 +sub_80AC164: @ 80AC164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080AC198 + ldr r5, _080AC19C + adds r4, r3, r5 + movs r5, 0 + strh r0, [r4] + ldr r4, _080AC1A0 + adds r0, r3, r4 + strh r1, [r0] + ldr r1, _080AC1A4 + adds r0, r3, r1 + strb r2, [r0] + adds r4, 0x3 + adds r0, r3, r4 + strb r5, [r0] + movs r0, 0xE7 + lsls r0, 3 + adds r3, r0 + strb r5, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AC198: .4byte 0x02038454 +_080AC19C: .4byte 0x00000734 +_080AC1A0: .4byte 0x00000736 +_080AC1A4: .4byte 0x0000073a + thumb_func_end sub_80AC164 + + thumb_func_start sub_80AC1A8 +sub_80AC1A8: @ 80AC1A8 + push {r4-r6,lr} + ldr r0, _080AC200 + movs r1, 0xE6 + lsls r1, 3 + adds r3, r0, r1 + ldr r2, [r3] + ldr r6, _080AC204 + adds r4, r0, r6 + ldr r1, [r4] + adds r5, r0, 0 + cmp r2, r1 + beq _080AC26C + ldr r0, _080AC208 + adds r2, r5, r0 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r6, _080AC20C + adds r1, r5, r6 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bls _080AC238 + movs r0, 0 + strb r0, [r2] + movs r0, 0xE7 + lsls r0, 3 + adds r1, r5, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080AC210 + ldrh r1, [r3] + adds r2, r1, 0 + ldrh r0, [r4] + cmp r2, r0 + bcs _080AC230 + adds r0, r1, 0x1 + b _080AC236 + .align 2, 0 +_080AC200: .4byte 0x02038454 +_080AC204: .4byte 0x00000734 +_080AC208: .4byte 0x00000739 +_080AC20C: .4byte 0x0000073a +_080AC210: + ldr r1, _080AC228 + adds r3, r5, r1 + ldr r2, _080AC22C + adds r0, r5, r2 + ldrh r1, [r3] + adds r2, r1, 0 + ldrh r0, [r0] + cmp r2, r0 + bcs _080AC230 + adds r0, r1, 0x1 + b _080AC236 + .align 2, 0 +_080AC228: .4byte 0x00000732 +_080AC22C: .4byte 0x00000736 +_080AC230: + cmp r2, r0 + bls _080AC238 + subs r0, r1, 0x1 +_080AC236: + strh r0, [r3] +_080AC238: + ldr r6, _080AC264 + adds r0, r5, r6 + ldrh r1, [r0] + lsls r1, 8 + movs r0, 0xE6 + lsls r0, 3 + adds r4, r5, r0 + ldrh r0, [r4] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r1, [r4] + ldr r2, _080AC268 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _080AC26C + movs r0, 0 + b _080AC26E + .align 2, 0 +_080AC264: .4byte 0x00000732 +_080AC268: .4byte 0x00000734 +_080AC26C: + movs r0, 0x1 +_080AC26E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80AC1A8 + + thumb_func_start sub_80AC274 +sub_80AC274: @ 80AC274 + push {lr} + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x9 + bhi _080AC306 + lsls r0, 2 + ldr r1, _080AC28C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AC28C: .4byte _080AC290 + .align 2, 0 +_080AC290: + .4byte _080AC2B8 + .4byte _080AC2C0 + .4byte _080AC2C8 + .4byte _080AC2D0 + .4byte _080AC2D8 + .4byte _080AC2E0 + .4byte _080AC2E8 + .4byte _080AC2F0 + .4byte _080AC2F8 + .4byte _080AC300 +_080AC2B8: + movs r0, 0x1 + bl sub_80AEDF0 + b _080AC306 +_080AC2C0: + movs r0, 0x2 + bl sub_80AEDF0 + b _080AC306 +_080AC2C8: + movs r0, 0x3 + bl sub_80AEDF0 + b _080AC306 +_080AC2D0: + movs r0, 0x4 + bl sub_80AEDF0 + b _080AC306 +_080AC2D8: + movs r0, 0x5 + bl sub_80AEDF0 + b _080AC306 +_080AC2E0: + movs r0, 0x6 + bl sub_80AEDF0 + b _080AC306 +_080AC2E8: + movs r0, 0x9 + bl sub_80AEDF0 + b _080AC306 +_080AC2F0: + movs r0, 0x7 + bl sub_80AEDF0 + b _080AC306 +_080AC2F8: + movs r0, 0x8 + bl sub_80AEDF0 + b _080AC306 +_080AC300: + movs r0, 0xB + bl sub_80AEDF0 +_080AC306: + pop {r0} + bx r0 + thumb_func_end sub_80AC274 + + thumb_func_start weather_get_current +weather_get_current: @ 80AC30C + ldr r0, _080AC318 + movs r1, 0xDA + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080AC318: .4byte 0x02038454 + thumb_func_end weather_get_current + + thumb_func_start sub_80AC31C +sub_80AC31C: @ 80AC31C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _080AC33C + ldr r3, _080AC340 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080AC36E + cmp r2, 0x53 + beq _080AC354 + cmp r2, 0x53 + bgt _080AC344 + cmp r2, 0x51 + beq _080AC360 + b _080AC36E + .align 2, 0 +_080AC33C: .4byte 0x02038454 +_080AC340: .4byte 0x000006c6 +_080AC344: + cmp r2, 0x55 + bne _080AC36E + ldr r0, _080AC350 + adds r1, r0 + movs r0, 0 + b _080AC366 + .align 2, 0 +_080AC350: .4byte 0x000006dd +_080AC354: + ldr r3, _080AC35C + adds r1, r3 + movs r0, 0x1 + b _080AC366 + .align 2, 0 +_080AC35C: .4byte 0x000006dd +_080AC360: + ldr r0, _080AC374 + adds r1, r0 + movs r0, 0x2 +_080AC366: + strb r0, [r1] + adds r0, r2, 0 + bl audio_play +_080AC36E: + pop {r0} + bx r0 + .align 2, 0 +_080AC374: .4byte 0x000006dd + thumb_func_end sub_80AC31C + + thumb_func_start play_some_sound +play_some_sound: @ 80AC378 + push {lr} + bl sub_80A390C + lsls r0, 24 + cmp r0, 0 + beq _080AC3B6 + ldr r0, _080AC3A0 + ldr r1, _080AC3A4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080AC3A8 + cmp r0, 0x1 + bgt _080AC3B0 + cmp r0, 0 + bne _080AC3B0 + movs r0, 0x56 + bl audio_play + b _080AC3B6 + .align 2, 0 +_080AC3A0: .4byte 0x02038454 +_080AC3A4: .4byte 0x000006dd +_080AC3A8: + movs r0, 0x54 + bl audio_play + b _080AC3B6 +_080AC3B0: + movs r0, 0x52 + bl audio_play +_080AC3B6: + pop {r0} + bx r0 + thumb_func_end play_some_sound + + thumb_func_start sub_80AC3BC +sub_80AC3BC: @ 80AC3BC + ldr r0, _080AC3C8 + ldr r1, _080AC3CC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080AC3C8: .4byte 0x02038454 +_080AC3CC: .4byte 0x000006d3 + thumb_func_end sub_80AC3BC + + thumb_func_start sub_80AC3D0 +sub_80AC3D0: @ 80AC3D0 + ldr r0, _080AC3DC + ldr r1, _080AC3E0 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + bx lr + .align 2, 0 +_080AC3DC: .4byte 0x02038454 +_080AC3E0: .4byte 0x000006c6 + thumb_func_end sub_80AC3D0 + + thumb_func_start sub_80AC3E4 +sub_80AC3E4: @ 80AC3E4 + ldr r0, _080AC3F0 + ldr r1, _080AC3F4 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + bx lr + .align 2, 0 +_080AC3F0: .4byte 0x02038454 +_080AC3F4: .4byte 0x000006c6 + thumb_func_end sub_80AC3E4 + + thumb_func_start sub_80AC3F8 +sub_80AC3F8: @ 80AC3F8 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080AC41C + ldr r5, _080AC420 + adds r1, r5, 0 + movs r2, 0x10 + bl CpuSet + adds r4, r5 + movs r0, 0 + strb r0, [r4] + ldr r0, _080AC424 + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AC41C: .4byte 0x0854c250 +_080AC420: .4byte 0x02038ba4 +_080AC424: .4byte 0x03000f50 + thumb_func_end sub_80AC3F8 + + thumb_func_start sub_80AC428 +sub_80AC428: @ 80AC428 + ldr r1, _080AC430 + ldr r0, _080AC434 + str r0, [r1] + bx lr + .align 2, 0 +_080AC430: .4byte 0x03000f50 +_080AC434: .4byte 0x0854c250 + thumb_func_end sub_80AC428 + + thumb_func_start sub_80AC438 +sub_80AC438: @ 80AC438 + push {lr} + ldr r0, _080AC470 + ldr r0, [r0] + ldr r2, _080AC474 + adds r1, r0, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, _080AC478 + adds r3, r0, r1 + movs r1, 0x14 + strb r1, [r3] + ldr r3, _080AC47C + adds r1, r0, r3 + strb r2, [r1] + subs r3, 0x6 + adds r1, r0, r3 + strh r2, [r1] + ldr r1, _080AC480 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC46C + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080AC46C: + pop {r0} + bx r0 + .align 2, 0 +_080AC470: .4byte 0x0854c14c +_080AC474: .4byte 0x000006c1 +_080AC478: .4byte 0x000006c2 +_080AC47C: .4byte 0x000006d2 +_080AC480: .4byte 0x000006de + thumb_func_end sub_80AC438 + + thumb_func_start sub_80AC484 +sub_80AC484: @ 80AC484 + push {r4,lr} + bl sub_80AC438 + ldr r0, _080AC4AC + ldr r1, [r0] + ldr r2, _080AC4B0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC4A4 + adds r4, r1, r2 +_080AC49A: + bl sub_80AC4B4 + ldrb r0, [r4] + cmp r0, 0 + beq _080AC49A +_080AC4A4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC4AC: .4byte 0x0854c14c +_080AC4B0: .4byte 0x000006d2 + thumb_func_end sub_80AC484 + + thumb_func_start sub_80AC4B4 +sub_80AC4B4: @ 80AC4B4 + push {r4,r5,lr} + ldr r0, _080AC4D0 + ldr r5, [r0] + ldr r0, _080AC4D4 + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AC4E4 + cmp r0, 0x1 + bgt _080AC4D8 + cmp r0, 0 + beq _080AC4DE + b _080AC508 + .align 2, 0 +_080AC4D0: .4byte 0x0854c14c +_080AC4D4: .4byte 0x000006cc +_080AC4D8: + cmp r0, 0x2 + beq _080AC4F0 + b _080AC508 +_080AC4DE: + bl sub_80AC594 + b _080AC502 +_080AC4E4: + movs r0, 0xC + movs r1, 0x8 + movs r2, 0x1 + bl sub_80AC164 + b _080AC502 +_080AC4F0: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AC508 + ldr r0, _080AC510 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080AC502: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AC508: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AC510: .4byte 0x000006d2 + thumb_func_end sub_80AC4B4 + + thumb_func_start sub_80AC514 +sub_80AC514: @ 80AC514 + push {r4,lr} + ldr r0, _080AC52C + ldr r0, [r0] + ldr r1, _080AC530 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0 + beq _080AC534 + cmp r0, 0x1 + beq _080AC540 + movs r0, 0 + b _080AC556 + .align 2, 0 +_080AC52C: .4byte 0x0854c14c +_080AC530: .4byte 0x000006ce +_080AC534: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1 + bl sub_80AC164 + b _080AC54E +_080AC540: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AC554 + bl sub_80AC660 +_080AC54E: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AC554: + movs r0, 0x1 +_080AC556: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AC514 + + thumb_func_start sub_80AC55C +sub_80AC55C: @ 80AC55C + ldr r0, _080AC574 + ldr r1, [r0] + ldr r0, _080AC578 + adds r2, r1, r0 + movs r0, 0 + strb r0, [r2] + ldr r0, _080AC57C + adds r1, r0 + movs r0, 0x14 + strb r0, [r1] + bx lr + .align 2, 0 +_080AC574: .4byte 0x0854c14c +_080AC578: .4byte 0x000006c1 +_080AC57C: .4byte 0x000006c2 + thumb_func_end sub_80AC55C + + thumb_func_start sub_80AC580 +sub_80AC580: @ 80AC580 + push {lr} + bl sub_80AC55C + pop {r0} + bx r0 + thumb_func_end sub_80AC580 + + thumb_func_start nullsub_95 +nullsub_95: @ 80AC58C + bx lr + thumb_func_end nullsub_95 + + thumb_func_start sub_80AC590 +sub_80AC590: @ 80AC590 + movs r0, 0 + bx lr + thumb_func_end sub_80AC590 + + thumb_func_start sub_80AC594 +sub_80AC594: @ 80AC594 + push {r4,r5,lr} + ldr r0, _080AC60C + ldr r0, [r0] + ldr r1, _080AC610 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080AC650 + ldr r0, _080AC614 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _080AC618 + bl sub_80ABF4C + movs r5, 0 +_080AC5B2: + ldr r0, _080AC61C + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _080AC628 + ldr r0, _080AC60C + ldr r1, [r0] + lsls r2, r5, 2 + movs r0, 0xFA + lsls r0, 1 + adds r1, r0 + adds r1, r2 + lsls r4, r3, 4 + adds r4, r3 + lsls r4, 2 + ldr r0, _080AC620 + adds r4, r0 + str r4, [r1] + ldr r0, _080AC624 + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r2, 0x2] + adds r1, 0x7 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8093038 + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + b _080AC63A + .align 2, 0 +_080AC60C: .4byte 0x0854c14c +_080AC610: .4byte 0x000006de +_080AC614: .4byte 0x0854fb5c +_080AC618: .4byte 0x0854c290 +_080AC61C: .4byte 0x0854fb78 +_080AC620: .4byte 0x02020630 +_080AC624: .4byte 0x0854fb50 +_080AC628: + ldr r0, _080AC658 + ldr r1, [r0] + lsls r0, r5, 2 + movs r2, 0xFA + lsls r2, 1 + adds r1, r2 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080AC63A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x2 + bls _080AC5B2 + ldr r0, _080AC658 + ldr r0, [r0] + ldr r1, _080AC65C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AC650: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AC658: .4byte 0x0854c14c +_080AC65C: .4byte 0x000006de + thumb_func_end sub_80AC594 + + thumb_func_start sub_80AC660 +sub_80AC660: @ 80AC660 + push {r4,r5,lr} + ldr r0, _080AC6AC + ldr r1, [r0] + ldr r2, _080AC6B0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AC6A4 + movs r4, 0 + movs r0, 0xFA + lsls r0, 1 + adds r5, r1, r0 +_080AC678: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AC686 + bl obj_delete_and_free_tiles +_080AC686: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _080AC678 + movs r0, 0x90 + lsls r0, 5 + bl gpu_tile_obj_free_by_tag + ldr r0, _080AC6AC + ldr r0, [r0] + ldr r1, _080AC6B0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AC6A4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AC6AC: .4byte 0x0854c14c +_080AC6B0: .4byte 0x000006de + thumb_func_end sub_80AC660 + + thumb_func_start sub_80AC6B4 +sub_80AC6B4: @ 80AC6B4 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + movs r1, 0x1 + ands r0, r1 + strh r0, [r2, 0x2E] + cmp r0, 0 + beq _080AC6CC + ldrh r0, [r2, 0x20] + subs r0, 0x1 + strh r0, [r2, 0x20] +_080AC6CC: + pop {r0} + bx r0 + thumb_func_end sub_80AC6B4 + + thumb_func_start sub_80AC6D0 +sub_80AC6D0: @ 80AC6D0 + ldr r0, _080AC6F4 + ldr r1, [r0] + ldr r0, _080AC6F8 + adds r3, r1, r0 + movs r2, 0 + movs r0, 0 + strh r0, [r3] + ldr r3, _080AC6FC + adds r0, r1, r3 + strb r2, [r0] + subs r3, 0x11 + adds r0, r1, r3 + strb r2, [r0] + ldr r0, _080AC700 + adds r1, r0 + strb r2, [r1] + bx lr + .align 2, 0 +_080AC6F4: .4byte 0x0854c14c +_080AC6F8: .4byte 0x000006cc +_080AC6FC: .4byte 0x000006d2 +_080AC700: .4byte 0x000006c2 + thumb_func_end sub_80AC6D0 + + thumb_func_start sub_80AC704 +sub_80AC704: @ 80AC704 + push {r4,lr} + bl sub_80AC6D0 + ldr r0, _080AC72C + ldr r1, [r0] + ldr r2, _080AC730 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC724 + adds r4, r1, r2 +_080AC71A: + bl sub_80AC734 + ldrb r0, [r4] + cmp r0, 0 + beq _080AC71A +_080AC724: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC72C: .4byte 0x0854c14c +_080AC730: .4byte 0x000006d2 + thumb_func_end sub_80AC704 + + thumb_func_start sub_80AC734 +sub_80AC734: @ 80AC734 + push {lr} + ldr r1, _080AC750 + ldr r0, [r1] + ldr r2, _080AC754 + adds r0, r2 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080AC810 + lsls r0, 2 + ldr r1, _080AC758 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AC750: .4byte 0x0854c14c +_080AC754: .4byte 0x000006cc +_080AC758: .4byte _080AC75C + .align 2, 0 +_080AC75C: + .4byte _080AC770 + .4byte _080AC78C + .4byte _080AC7A4 + .4byte _080AC7C0 + .4byte _080AC7D8 +_080AC770: + ldr r1, [r2] + ldr r2, _080AC784 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AC814 + ldr r0, _080AC788 + adds r1, r0 + b _080AC7F8 + .align 2, 0 +_080AC784: .4byte 0x000006c6 +_080AC788: .4byte 0x000006cc +_080AC78C: + bl sub_80ABF84 + ldr r0, _080AC79C + ldr r1, [r0] + ldr r2, _080AC7A0 + adds r1, r2 + b _080AC7F8 + .align 2, 0 +_080AC79C: .4byte 0x0854c14c +_080AC7A0: .4byte 0x000006cc +_080AC7A4: + bl sub_80ABFA4 + lsls r0, 24 + cmp r0, 0 + bne _080AC814 + ldr r0, _080AC7B8 + ldr r1, [r0] + ldr r0, _080AC7BC + adds r1, r0 + b _080AC7F8 + .align 2, 0 +_080AC7B8: .4byte 0x0854c14c +_080AC7BC: .4byte 0x000006cc +_080AC7C0: + bl sub_80ABFF0 + ldr r0, _080AC7D0 + ldr r1, [r0] + ldr r2, _080AC7D4 + adds r1, r2 + b _080AC7F8 + .align 2, 0 +_080AC7D0: .4byte 0x0854c14c +_080AC7D4: .4byte 0x000006cc +_080AC7D8: + bl sub_80AC01C + ldr r0, _080AC800 + ldr r2, [r0] + ldr r1, _080AC804 + adds r0, r2, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + bne _080AC814 + ldr r0, _080AC808 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080AC80C + adds r1, r2, r0 +_080AC7F8: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080AC814 + .align 2, 0 +_080AC800: .4byte 0x0854c14c +_080AC804: .4byte 0x0000073c +_080AC808: .4byte 0x000006d2 +_080AC80C: .4byte 0x000006cc +_080AC810: + bl sub_80AC01C +_080AC814: + pop {r0} + bx r0 + thumb_func_end sub_80AC734 + + thumb_func_start sub_80AC818 +sub_80AC818: @ 80AC818 + movs r0, 0 + bx lr + thumb_func_end sub_80AC818 + + thumb_func_start sub_80AC81C +sub_80AC81C: @ 80AC81C + push {lr} + ldr r0, _080AC82C + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AC82C: .4byte task50_0807B6D4 + 1 + thumb_func_end sub_80AC81C + + thumb_func_start task50_0807B6D4 +task50_0807B6D4: @ 80AC830 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AC854 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _080AC922 + lsls r0, 2 + ldr r1, _080AC858 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AC854: .4byte 0x03005e00 +_080AC858: .4byte _080AC85C + .align 2, 0 +_080AC85C: + .4byte _080AC870 + .4byte _080AC89A + .4byte _080AC8C8 + .4byte _080AC8F8 + .4byte _080AC918 +_080AC870: + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + ldr r0, _080AC8C0 + ldrh r0, [r0] + strh r0, [r4, 0xE] + ldr r1, _080AC8C4 + movs r0, 0x48 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0x9E + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080AC89A: + ldrh r0, [r4, 0xA] + adds r0, 0x3 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _080AC8AC + movs r0, 0x10 + strh r0, [r4, 0xA] +_080AC8AC: + ldrh r1, [r4, 0xA] + movs r0, 0x54 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xF + ble _080AC922 + b _080AC910 + .align 2, 0 +_080AC8C0: .4byte 0x04000048 +_080AC8C4: .4byte 0x00003f3f +_080AC8C8: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080AC922 + strh r1, [r4, 0xC] + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _080AC8EE + strh r1, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080AC8EE: + ldrh r1, [r4, 0xA] + movs r0, 0x54 + bl lcd_io_set + b _080AC922 +_080AC8F8: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl lcd_io_set +_080AC910: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AC922 +_080AC918: + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl remove_task +_080AC922: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task50_0807B6D4 + + thumb_func_start sub_80AC928 +sub_80AC928: @ 80AC928 + push {r4,lr} + ldr r0, _080AC978 + ldr r1, [r0] + ldr r2, _080AC97C + adds r0, r1, r2 + movs r3, 0 + movs r2, 0 + strh r2, [r0] + ldr r4, _080AC980 + adds r0, r1, r4 + strb r3, [r0] + adds r4, 0x4 + adds r0, r1, r4 + strh r2, [r0] + ldr r0, _080AC984 + adds r2, r1, r0 + movs r0, 0x8 + strb r0, [r2] + ldr r2, _080AC988 + adds r0, r1, r2 + strb r3, [r0] + adds r4, 0x3 + adds r2, r1, r4 + movs r0, 0xA + strb r0, [r2] + ldr r0, _080AC98C + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + ldr r2, _080AC990 + adds r1, r2 + movs r0, 0x14 + strb r0, [r1] + movs r0, 0x55 + bl sub_80AC31C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC978: .4byte 0x0854c14c +_080AC97C: .4byte 0x000006cc +_080AC980: .4byte 0x000006d2 +_080AC984: .4byte 0x000006db +_080AC988: .4byte 0x000006dc +_080AC98C: .4byte 0x000006c1 +_080AC990: .4byte 0x000006c2 + thumb_func_end sub_80AC928 + + thumb_func_start sub_80AC994 +sub_80AC994: @ 80AC994 + push {r4,lr} + bl sub_80AC928 + ldr r0, _080AC9BC + ldr r1, [r0] + ldr r2, _080AC9C0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC9B4 + adds r4, r1, r2 +_080AC9AA: + bl sub_80AC9C4 + ldrb r0, [r4] + cmp r0, 0 + beq _080AC9AA +_080AC9B4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC9BC: .4byte 0x0854c14c +_080AC9C0: .4byte 0x000006d2 + thumb_func_end sub_80AC994 + + thumb_func_start sub_80AC9C4 +sub_80AC9C4: @ 80AC9C4 + push {r4,r5,lr} + ldr r0, _080AC9E0 + ldr r5, [r0] + ldr r0, _080AC9E4 + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AC9F4 + cmp r0, 0x1 + bgt _080AC9E8 + cmp r0, 0 + beq _080AC9EE + b _080ACA18 + .align 2, 0 +_080AC9E0: .4byte 0x0854c14c +_080AC9E4: .4byte 0x000006cc +_080AC9E8: + cmp r0, 0x2 + beq _080ACA00 + b _080ACA18 +_080AC9EE: + bl sub_80ACD68 + b _080ACA12 +_080AC9F4: + bl sub_80ACD78 + lsls r0, 24 + cmp r0, 0 + bne _080ACA18 + b _080ACA12 +_080ACA00: + bl sub_80ACEAC + lsls r0, 24 + cmp r0, 0 + bne _080ACA18 + ldr r0, _080ACA20 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080ACA12: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080ACA18: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ACA20: .4byte 0x000006d2 + thumb_func_end sub_80AC9C4 + + thumb_func_start sub_80ACA24 +sub_80ACA24: @ 80ACA24 + push {r4,r5,lr} + ldr r0, _080ACA40 + ldr r2, [r0] + ldr r1, _080ACA44 + adds r3, r2, r1 + ldrh r1, [r3] + adds r4, r0, 0 + cmp r1, 0 + beq _080ACA48 + cmp r1, 0x1 + beq _080ACA7C + movs r0, 0 + b _080ACAAA + .align 2, 0 +_080ACA40: .4byte 0x0854c14c +_080ACA44: .4byte 0x000006ce +_080ACA48: + ldr r5, _080ACA68 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080ACA5A + cmp r0, 0x5 + beq _080ACA5A + cmp r0, 0xD + bne _080ACA70 +_080ACA5A: + ldr r0, [r4] + ldr r1, _080ACA6C + adds r0, r1 + movs r1, 0xFF + strh r1, [r0] + movs r0, 0 + b _080ACAAA + .align 2, 0 +_080ACA68: .4byte 0x000006d1 +_080ACA6C: .4byte 0x000006ce +_080ACA70: + ldr r4, _080ACA9C + adds r0, r2, r4 + strb r1, [r0] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_080ACA7C: + bl sub_80ACEAC + lsls r0, 24 + cmp r0, 0 + bne _080ACAA8 + bl sub_80ACF38 + ldr r0, _080ACAA0 + ldr r1, [r0] + ldr r5, _080ACAA4 + adds r1, r5 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + b _080ACAAA + .align 2, 0 +_080ACA9C: .4byte 0x000006d9 +_080ACAA0: .4byte 0x0854c14c +_080ACAA4: .4byte 0x000006ce +_080ACAA8: + movs r0, 0x1 +_080ACAAA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80ACA24 + + thumb_func_start sub_80ACAB0 +sub_80ACAB0: @ 80ACAB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r1, 0x30 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _080ACAC4 + ldr r0, _080ACB68 + strh r0, [r7, 0x30] +_080ACAC4: + movs r2, 0x30 + ldrsh r1, [r7, r2] + ldr r0, _080ACB6C + muls r0, r1 + ldr r3, _080ACB70 + adds r0, r3 + lsls r0, 1 + lsrs r0, 17 + movs r1, 0x96 + lsls r1, 2 + bl __umodsi3 + movs r1, 0 + mov r8, r1 + strh r0, [r7, 0x30] + ldr r1, _080ACB74 + ldr r0, _080ACB78 + ldr r5, [r0] + ldr r2, _080ACB7C + adds r5, r2 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldrh r6, [r0] + movs r3, 0x30 + ldrsh r0, [r7, r3] + movs r1, 0x1E + bl __modsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r0, r4, 3 + strh r0, [r7, 0x32] + movs r1, 0x30 + ldrsh r0, [r7, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + lsls r4, 7 + strh r4, [r7, 0x32] + asrs r0, 9 + strh r0, [r7, 0x34] + ldr r2, _080ACB80 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + muls r1, r6 + subs r4, r1 + strh r4, [r7, 0x32] + ldrb r1, [r5] + lsls r1, 2 + adds r2, 0x2 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + muls r1, r6 + subs r0, r1 + strh r0, [r7, 0x34] + adds r0, r7, 0 + movs r1, 0 + bl obj_anim_image_start + mov r3, r8 + strh r3, [r7, 0x36] + adds r2, r7, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + strh r6, [r7, 0x2E] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACB68: .4byte 0x00000169 +_080ACB6C: .4byte 0x41c64e6d +_080ACB70: .4byte 0x00003039 +_080ACB74: .4byte 0x0854fc4c +_080ACB78: .4byte 0x0854c14c +_080ACB7C: .4byte 0x000006dc +_080ACB80: .4byte 0x0854fc44 + thumb_func_end sub_80ACAB0 + + thumb_func_start sub_80ACB84 +sub_80ACB84: @ 80ACB84 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x36 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080ACC60 + ldr r3, _080ACBF8 + ldr r4, _080ACBFC + ldr r2, [r4] + ldr r0, _080ACC00 + adds r2, r0 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0] + ldrh r0, [r5, 0x32] + adds r1, r0 + strh r1, [r5, 0x32] + ldrb r0, [r2] + lsls r0, 2 + adds r3, 0x2 + adds r0, r3 + ldrh r0, [r0] + ldrh r2, [r5, 0x34] + adds r0, r2 + strh r0, [r5, 0x34] + lsls r1, 16 + asrs r1, 20 + strh r1, [r5, 0x20] + lsls r0, 16 + asrs r2, r0, 20 + strh r2, [r5, 0x22] + movs r3, 0x38 + ldrsh r0, [r5, r3] + adds r3, r4, 0 + cmp r0, 0 + beq _080ACC04 + adds r0, r1, 0 + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _080ACC04 + adds r1, r2, 0 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _080ACC04 + cmp r1, 0xB0 + bgt _080ACC04 + adds r0, r5, 0 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + b _080ACC0E + .align 2, 0 +_080ACBF8: .4byte 0x0854fc44 +_080ACBFC: .4byte 0x0854c14c +_080ACC00: .4byte 0x000006dc +_080ACC04: + adds r0, r5, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 +_080ACC0E: + strb r1, [r0] + adds r4, r0, 0 + ldrh r0, [r5, 0x2E] + subs r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080ACC80 + ldr r0, [r3] + ldr r1, _080ACC54 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + movs r0, 0x1 + strh r0, [r5, 0x36] + ldr r1, _080ACC58 + ldrh r0, [r5, 0x20] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r5, 0x20] + ldr r1, _080ACC5C + ldrh r0, [r5, 0x22] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + b _080ACC80 + .align 2, 0 +_080ACC54: .4byte 0x000006dc +_080ACC58: .4byte 0x02021bbc +_080ACC5C: .4byte 0x02021bbe +_080ACC60: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080ACC80 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl sub_80ACAB0 +_080ACC80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80ACB84 + + thumb_func_start sub_80ACC88 +sub_80ACC88: @ 80ACC88 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080ACCA8 + adds r0, r4, 0 + bl sub_80ACAB0 + ldr r0, _080ACCA4 + str r0, [r4, 0x1C] + b _080ACCAC + .align 2, 0 +_080ACCA4: .4byte sub_80ACB84 + 1 +_080ACCA8: + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] +_080ACCAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80ACC88 + + thumb_func_start sub_80ACCB4 +sub_80ACCB4: @ 80ACCB4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + lsls r5, r1, 16 + lsrs r5, 16 + ldr r2, _080ACD38 + ldr r0, _080ACD3C + ldr r0, [r0] + ldr r1, _080ACD40 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0, r2 + ldrh r1, [r1] + mov r8, r1 + adds r2, 0x2 + adds r0, r2 + ldrh r4, [r0] + add r4, r8 + adds r0, r5, 0 + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 16 + lsrs r4, r0, 16 + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _080ACD44 + cmp r6, r0 + beq _080ACD12 + adds r5, r0, 0 +_080ACD02: + adds r0, r7, 0 + bl sub_80ACAB0 + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r5 + bne _080ACD02 +_080ACD12: + cmp r4, r8 + bcs _080ACD48 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _080ACD44 + cmp r4, r0 + beq _080ACD34 + adds r5, r0, 0 +_080ACD24: + adds r0, r7, 0 + bl sub_80ACB84 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bne _080ACD24 +_080ACD34: + movs r0, 0 + b _080ACD5C + .align 2, 0 +_080ACD38: .4byte 0x0854fc4c +_080ACD3C: .4byte 0x0854c14c +_080ACD40: .4byte 0x000006dc +_080ACD44: .4byte 0x0000ffff +_080ACD48: + mov r1, r8 + subs r0, r4, r1 + strh r0, [r7, 0x2E] + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_080ACD5C: + strh r0, [r7, 0x3A] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80ACCB4 + + thumb_func_start sub_80ACD68 +sub_80ACD68: @ 80ACD68 + push {lr} + ldr r0, _080ACD74 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + pop {r0} + bx r0 + .align 2, 0 +_080ACD74: .4byte 0x0854fc54 + thumb_func_end sub_80ACD68 + + thumb_func_start sub_80ACD78 +sub_80ACD78: @ 80ACD78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _080ACE24 + ldr r4, [r0] + ldr r0, _080ACE28 + adds r2, r4, r0 + ldrb r0, [r2] + cmp r0, 0x18 + bne _080ACD92 + b _080ACE98 +_080ACD92: + ldrb r7, [r2] + ldr r0, _080ACE2C + ldr r2, _080ACE30 + lsls r6, r7, 2 + adds r2, r6, r2 + movs r3, 0 + ldrsh r1, [r2, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + movs r3, 0x4E + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _080ACE40 + ldr r3, _080ACE34 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r3 + movs r0, 0 + strh r0, [r1, 0x38] + lsls r2, r7, 3 + adds r0, r2, r7 + lsls r0, 4 + adds r0, r7 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + ldr r1, _080ACE38 + mov r10, r6 + mov r9, r3 + mov r12, r4 + mov r8, r2 + cmp r0, r1 + ble _080ACDF6 + adds r2, r1, 0 +_080ACDDE: + adds r0, r4, r5 + lsls r0, 2 + ldr r6, _080ACE34 + adds r0, r6 + ldr r3, _080ACE3C + ldrh r6, [r0, 0x30] + adds r1, r3, r6 + strh r1, [r0, 0x30] + lsls r1, 16 + asrs r1, 16 + cmp r1, r2 + bgt _080ACDDE +_080ACDF6: + mov r0, r12 + adds r4, r0, r5 + lsls r4, 2 + add r4, r9 + adds r0, r4, 0 + bl sub_80ACAB0 + mov r3, r8 + adds r1, r3, r7 + adds r0, r4, 0 + bl sub_80ACCB4 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080ACE24 + ldr r0, [r0] + add r0, r10 + str r4, [r0] + b _080ACE46 + .align 2, 0 +_080ACE24: .4byte 0x0854c14c +_080ACE28: .4byte 0x000006da +_080ACE2C: .4byte 0x0854fc2c +_080ACE30: .4byte 0x0854fb90 +_080ACE34: .4byte 0x02020630 +_080ACE38: .4byte 0x00000257 +_080ACE3C: .4byte 0xfffffda8 +_080ACE40: + adds r1, r4, r6 + movs r0, 0 + str r0, [r1] +_080ACE46: + ldr r0, _080ACE7C + ldr r2, [r0] + ldr r6, _080ACE80 + adds r1, r2, r6 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x18 + bne _080ACE9C + movs r3, 0 + adds r1, r2, 0 + ldr r5, _080ACE84 + ldr r4, _080ACE88 +_080ACE64: + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r2, [r0] + cmp r2, 0 + beq _080ACE8E + movs r6, 0x3A + ldrsh r0, [r2, r6] + cmp r0, 0 + bne _080ACE8C + str r5, [r2, 0x1C] + b _080ACE8E + .align 2, 0 +_080ACE7C: .4byte 0x0854c14c +_080ACE80: .4byte 0x000006da +_080ACE84: .4byte sub_80ACB84 + 1 +_080ACE88: .4byte sub_80ACC88 + 1 +_080ACE8C: + str r4, [r2, 0x1C] +_080ACE8E: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x17 + bls _080ACE64 +_080ACE98: + movs r0, 0 + b _080ACE9E +_080ACE9C: + movs r0, 0x1 +_080ACE9E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ACD78 + + thumb_func_start sub_80ACEAC +sub_80ACEAC: @ 80ACEAC + push {r4-r7,lr} + ldr r0, _080ACEC8 + ldr r3, [r0] + movs r0, 0xDB + lsls r0, 3 + adds r4, r3, r0 + ldr r1, _080ACECC + adds r5, r3, r1 + ldrb r0, [r4] + ldrb r7, [r5] + cmp r0, r7 + bne _080ACED0 + movs r0, 0 + b _080ACF32 + .align 2, 0 +_080ACEC8: .4byte 0x0854c14c +_080ACECC: .4byte 0x000006d9 +_080ACED0: + ldr r0, _080ACF08 + adds r2, r3, r0 + ldrh r0, [r2] + adds r0, 0x1 + movs r6, 0 + strh r0, [r2] + ldr r7, _080ACF0C + adds r1, r3, r7 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bls _080ACF30 + strh r6, [r2] + ldrb r0, [r4] + adds r1, r0, 0 + ldrb r5, [r5] + cmp r1, r5 + bcs _080ACF10 + adds r0, 0x1 + strb r0, [r4] + lsls r0, r1, 2 + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x38] + b _080ACF30 + .align 2, 0 +_080ACF08: .4byte 0x000006d6 +_080ACF0C: .4byte 0x000006db +_080ACF10: + subs r0, 0x1 + strb r0, [r4] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3, r0 + ldr r0, [r0] + strh r6, [r0, 0x38] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3, r0 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_080ACF30: + movs r0, 0x1 +_080ACF32: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ACEAC + + thumb_func_start sub_80ACF38 +sub_80ACF38: @ 80ACF38 + push {r4-r7,lr} + movs r4, 0 + ldr r0, _080ACF80 + ldr r2, [r0] + ldr r3, _080ACF84 + adds r1, r2, r3 + adds r7, r0, 0 + ldrb r1, [r1] + cmp r4, r1 + bcs _080ACF6A + adds r5, r2, 0 + adds r6, r5, r3 +_080ACF50: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080ACF5E + bl obj_delete_and_free_tiles +_080ACF5E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r6] + cmp r4, r0 + bcc _080ACF50 +_080ACF6A: + ldr r0, [r7] + ldr r1, _080ACF84 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, _080ACF88 + bl gpu_tile_obj_free_by_tag + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACF80: .4byte 0x0854c14c +_080ACF84: .4byte 0x000006da +_080ACF88: .4byte 0x00001206 + thumb_func_end sub_80ACF38 + + thumb_func_start sub_80ACF8C +sub_80ACF8C: @ 80ACF8C + push {r4,lr} + ldr r0, _080ACFC8 + ldr r1, [r0] + ldr r2, _080ACFCC + adds r0, r1, r2 + movs r2, 0 + movs r3, 0 + strh r3, [r0] + ldr r4, _080ACFD0 + adds r0, r1, r4 + strb r2, [r0] + ldr r0, _080ACFD4 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + subs r4, 0x10 + adds r2, r1, r4 + movs r0, 0x14 + strb r0, [r2] + ldr r0, _080ACFD8 + adds r2, r1, r0 + movs r0, 0x10 + strb r0, [r2] + movs r2, 0xDC + lsls r2, 3 + adds r1, r2 + strh r3, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ACFC8: .4byte 0x0854c14c +_080ACFCC: .4byte 0x000006cc +_080ACFD0: .4byte 0x000006d2 +_080ACFD4: .4byte 0x000006c1 +_080ACFD8: .4byte 0x000006e5 + thumb_func_end sub_80ACF8C + + thumb_func_start sub_80ACFDC +sub_80ACFDC: @ 80ACFDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_80ACF8C + ldr r2, _080AD03C + ldr r1, [r2] + ldr r3, _080AD040 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD032 + mov r8, r2 + adds r7, r1, r3 +_080ACFF8: + bl snowflakes_progress2 + movs r4, 0 + mov r1, r8 + ldr r0, [r1] + ldr r3, _080AD044 + adds r0, r3 + ldrb r0, [r0] + cmp r4, r0 + bcs _080AD02C + ldr r0, _080AD03C + ldr r5, [r0] + adds r6, r5, r3 +_080AD012: + lsls r1, r4, 2 + adds r0, r5, 0 + adds r0, 0x60 + adds r0, r1 + ldr r0, [r0] + bl sub_80AD30C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r6] + cmp r4, r0 + bcc _080AD012 +_080AD02C: + ldrb r0, [r7] + cmp r0, 0 + beq _080ACFF8 +_080AD032: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AD03C: .4byte 0x0854c14c +_080AD040: .4byte 0x000006d2 +_080AD044: .4byte 0x000006e4 + thumb_func_end sub_80ACFDC + + thumb_func_start snowflakes_progress2 +snowflakes_progress2: @ 80AD048 + push {r4,r5,lr} + ldr r0, _080AD078 + ldr r5, [r0] + ldr r0, _080AD07C + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0 + bne _080AD070 + bl snowflakes_progress + lsls r0, 24 + cmp r0, 0 + bne _080AD070 + ldr r0, _080AD080 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AD070: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AD078: .4byte 0x0854c14c +_080AD07C: .4byte 0x000006cc +_080AD080: .4byte 0x000006d2 + thumb_func_end snowflakes_progress2 + + thumb_func_start sub_80AD084 +sub_80AD084: @ 80AD084 + push {r4,lr} + ldr r0, _080AD09C + ldr r2, [r0] + ldr r0, _080AD0A0 + adds r3, r2, r0 + ldrh r1, [r3] + cmp r1, 0 + beq _080AD0A4 + cmp r1, 0x1 + beq _080AD0B6 + movs r0, 0 + b _080AD0E2 + .align 2, 0 +_080AD09C: .4byte 0x0854c14c +_080AD0A0: .4byte 0x000006ce +_080AD0A4: + ldr r4, _080AD0D4 + adds r0, r2, r4 + strb r1, [r0] + subs r4, 0x5 + adds r0, r2, r4 + strh r1, [r0] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_080AD0B6: + bl snowflakes_progress + lsls r0, 24 + cmp r0, 0 + bne _080AD0E0 + ldr r0, _080AD0D8 + ldr r1, [r0] + ldr r0, _080AD0DC + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + b _080AD0E2 + .align 2, 0 +_080AD0D4: .4byte 0x000006e5 +_080AD0D8: .4byte 0x0854c14c +_080AD0DC: .4byte 0x000006ce +_080AD0E0: + movs r0, 0x1 +_080AD0E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AD084 + + thumb_func_start snowflakes_progress +snowflakes_progress: @ 80AD0E8 + push {r4,lr} + ldr r0, _080AD104 + ldr r1, [r0] + ldr r0, _080AD108 + adds r3, r1, r0 + ldr r4, _080AD10C + adds r2, r1, r4 + ldrb r0, [r3] + ldrb r4, [r2] + cmp r0, r4 + bne _080AD110 + movs r0, 0 + b _080AD152 + .align 2, 0 +_080AD104: .4byte 0x0854c14c +_080AD108: .4byte 0x000006e4 +_080AD10C: .4byte 0x000006e5 +_080AD110: + movs r0, 0xDC + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x24 + bls _080AD13A + movs r0, 0 + strh r0, [r1] + ldrb r0, [r3] + ldrb r2, [r2] + cmp r0, r2 + bcs _080AD136 + bl snowflake_add + b _080AD13A +_080AD136: + bl snowflake_remove +_080AD13A: + ldr r0, _080AD158 + ldr r0, [r0] + ldr r2, _080AD15C + adds r1, r0, r2 + ldr r4, _080AD160 + adds r0, r4 + ldrb r1, [r1] + ldrb r0, [r0] + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_080AD152: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080AD158: .4byte 0x0854c14c +_080AD15C: .4byte 0x000006e4 +_080AD160: .4byte 0x000006e5 + thumb_func_end snowflakes_progress + + thumb_func_start snowflake_add +snowflake_add: @ 80AD164 + push {r4-r6,lr} + ldr r0, _080AD1B8 + movs r1, 0 + movs r2, 0 + movs r3, 0x4E + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080AD1C8 + ldr r0, _080AD1BC + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + ldr r0, _080AD1C0 + ldr r5, [r0] + ldr r0, _080AD1C4 + adds r6, r5, r0 + ldrb r0, [r6] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_80AD204 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + adds r1, r0, 0x1 + strb r1, [r6] + lsls r0, 24 + lsrs r0, 22 + adds r5, 0x60 + adds r5, r0 + str r4, [r5] + movs r0, 0x1 + b _080AD1CA + .align 2, 0 +_080AD1B8: .4byte 0x0854fc8c +_080AD1BC: .4byte 0x02020630 +_080AD1C0: .4byte 0x0854c14c +_080AD1C4: .4byte 0x000006e4 +_080AD1C8: + movs r0, 0 +_080AD1CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end snowflake_add + + thumb_func_start snowflake_remove +snowflake_remove: @ 80AD1D0 + push {lr} + ldr r0, _080AD1E4 + ldr r1, [r0] + ldr r0, _080AD1E8 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + bne _080AD1EC + movs r0, 0 + b _080AD200 + .align 2, 0 +_080AD1E4: .4byte 0x0854c14c +_080AD1E8: .4byte 0x000006e4 +_080AD1EC: + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 22 + adds r1, 0x60 + adds r1, r0 + ldr r0, [r1] + bl obj_delete_and_free_tiles + movs r0, 0x1 +_080AD200: + pop {r1} + bx r1 + thumb_func_end snowflake_remove + + thumb_func_start sub_80AD204 +sub_80AD204: @ 80AD204 + push {r4-r7,lr} + adds r5, r0, 0 + bl GenerateRandomNumber + movs r1, 0x36 + ldrsh r2, [r5, r1] + lsls r1, r2, 2 + adds r1, r2 + movs r2, 0x7 + ands r1, r2 + lsls r4, r1, 4 + subs r4, r1 + lsls r4, 1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, _080AD2A8 + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + movs r2, 0x3 + negs r2, r2 + adds r1, r2, 0 + subs r1, r0 + movs r7, 0 + strh r1, [r5, 0x22] + ldr r1, _080AD2AC + adds r0, r5, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + subs r4, r0 + strh r4, [r5, 0x20] + movs r1, 0x22 + ldrsh r0, [r5, r1] + lsls r0, 7 + strh r0, [r5, 0x2E] + strh r7, [r5, 0x24] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r6, r0, 0 + movs r4, 0x3 + ands r4, r6 + lsls r0, r4, 2 + adds r0, r4 + adds r0, 0x40 + strh r0, [r5, 0x30] + strh r0, [r5, 0x3C] + movs r1, 0x1 + bics r1, r6 + adds r0, r5, 0 + bl obj_anim_image_start + strh r7, [r5, 0x34] + movs r0, 0x1 + cmp r4, 0 + bne _080AD294 + movs r0, 0x2 +_080AD294: + strh r0, [r5, 0x32] + movs r0, 0x1F + ands r0, r6 + adds r0, 0xD2 + strh r0, [r5, 0x3A] + strh r7, [r5, 0x38] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AD2A8: .4byte 0x02021bbe +_080AD2AC: .4byte 0x02021bbc + thumb_func_end sub_80AD204 + + thumb_func_start sub_80AD2B0 +sub_80AD2B0: @ 80AD2B0 + push {r4,lr} + adds r3, r0, 0 + ldr r0, _080AD2FC + ldr r0, [r0] + ldr r1, _080AD300 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x12 + bls _080AD2F6 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _080AD304 + str r0, [r3, 0x1C] + ldr r1, _080AD308 + adds r0, r3, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + movs r1, 0xFA + subs r1, r0 + movs r2, 0 + strh r1, [r3, 0x22] + movs r1, 0x22 + ldrsh r0, [r3, r1] + lsls r0, 7 + strh r0, [r3, 0x2E] + strh r2, [r4] +_080AD2F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AD2FC: .4byte 0x0854c14c +_080AD300: .4byte 0x000006e2 +_080AD304: .4byte sub_80AD30C + 1 +_080AD308: .4byte 0x02021bbe + thumb_func_end sub_80AD2B0 + + thumb_func_start sub_80AD30C +sub_80AD30C: @ 80AD30C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 23 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x34] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + ldr r1, _080AD384 + movs r3, 0x34 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080AD33E + adds r0, 0x3F +_080AD33E: + asrs r0, 6 + strh r0, [r4, 0x24] + adds r0, r4, 0 + adds r0, 0x28 + movs r5, 0 + ldrsb r5, [r0, r5] + ldrh r0, [r4, 0x20] + adds r0, r5 + ldr r1, _080AD388 + ldrh r1, [r1] + adds r3, r1, r0 + ldr r2, _080AD38C + adds r0, r2, 0 + ands r3, r0 + adds r2, r3, 0 + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _080AD370 + ldr r3, _080AD390 + adds r0, r3, 0 + orrs r2, r0 + lsls r0, r2, 16 + lsrs r3, r0, 16 +_080AD370: + lsls r0, r3, 16 + asrs r0, 16 + movs r2, 0x3 + negs r2, r2 + cmp r0, r2 + bge _080AD394 + adds r1, r5 + movs r0, 0xF2 + subs r0, r1 + b _080AD39C + .align 2, 0 +_080AD384: .4byte 0x08329f40 +_080AD388: .4byte 0x02021bbc +_080AD38C: .4byte 0x000001ff +_080AD390: .4byte 0xffffff00 +_080AD394: + cmp r0, 0xF2 + ble _080AD39E + adds r0, r1, r5 + subs r0, r2, r0 +_080AD39C: + strh r0, [r4, 0x20] +_080AD39E: + adds r0, r4, 0 + adds r0, 0x29 + movs r3, 0 + ldrsb r3, [r0, r3] + ldrh r0, [r4, 0x22] + adds r0, r3 + ldr r1, _080AD3DC + ldrh r1, [r1] + adds r2, r1, r0 + movs r0, 0xFF + ands r2, r0 + adds r0, r2, 0 + subs r0, 0xA4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _080AD3E0 + adds r1, r3 + movs r0, 0xFA + subs r0, r1 + movs r1, 0 + strh r0, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + lsls r0, 7 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x38] + movs r0, 0xDC + strh r0, [r4, 0x3A] + b _080AD40C + .align 2, 0 +_080AD3DC: .4byte 0x02021bbe +_080AD3E0: + adds r0, r2, 0 + subs r0, 0xF3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _080AD40C + movs r1, 0 + movs r0, 0xA3 + strh r0, [r4, 0x22] + lsls r0, 7 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x38] + movs r0, 0xDC + strh r0, [r4, 0x3A] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080AD440 + str r0, [r4, 0x1C] +_080AD40C: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x3A + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _080AD438 + adds r0, r4, 0 + bl sub_80AD204 + movs r0, 0xFA + strh r0, [r4, 0x22] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080AD440 + str r0, [r4, 0x1C] +_080AD438: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AD440: .4byte sub_80AD2B0 + 1 + thumb_func_end sub_80AD30C + + thumb_func_start sub_80AD444 +sub_80AD444: @ 80AD444 + push {r4,r5,lr} + ldr r0, _080AD49C + ldr r1, [r0] + ldr r2, _080AD4A0 + adds r0, r1, r2 + movs r3, 0 + movs r2, 0 + strh r2, [r0] + ldr r5, _080AD4A4 + adds r4, r1, r5 + strb r3, [r4] + adds r5, 0x4 + adds r0, r1, r5 + strh r2, [r0] + ldr r0, _080AD4A8 + adds r2, r1, r0 + movs r0, 0x4 + strb r0, [r2] + ldr r2, _080AD4AC + adds r0, r1, r2 + strb r3, [r0] + adds r5, 0x3 + adds r2, r1, r5 + movs r0, 0x10 + strb r0, [r2] + ldr r0, _080AD4B0 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + subs r5, 0x17 + adds r2, r1, r5 + movs r0, 0x14 + strb r0, [r2] + strb r3, [r4] + ldr r0, _080AD4B4 + adds r1, r0 + strb r3, [r1] + movs r0, 0x51 + bl sub_80AC31C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AD49C: .4byte 0x0854c14c +_080AD4A0: .4byte 0x000006cc +_080AD4A4: .4byte 0x000006d2 +_080AD4A8: .4byte 0x000006db +_080AD4AC: .4byte 0x000006dc +_080AD4B0: .4byte 0x000006c1 +_080AD4B4: .4byte 0x000006ed + thumb_func_end sub_80AD444 + + thumb_func_start sub_80AD4B8 +sub_80AD4B8: @ 80AD4B8 + push {r4,lr} + bl sub_80AD444 + ldr r0, _080AD4E0 + ldr r1, [r0] + ldr r2, _080AD4E4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD4D8 + adds r4, r1, r2 +_080AD4CE: + bl sub_80AD584 + ldrb r0, [r4] + cmp r0, 0 + beq _080AD4CE +_080AD4D8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AD4E0: .4byte 0x0854c14c +_080AD4E4: .4byte 0x000006d2 + thumb_func_end sub_80AD4B8 + + thumb_func_start sub_80AD4E8 +sub_80AD4E8: @ 80AD4E8 + push {r4,r5,lr} + ldr r0, _080AD53C + ldr r1, [r0] + ldr r2, _080AD540 + adds r0, r1, r2 + movs r4, 0 + movs r2, 0 + strh r2, [r0] + ldr r5, _080AD544 + adds r3, r1, r5 + strb r4, [r3] + adds r5, 0x4 + adds r0, r1, r5 + strh r2, [r0] + ldr r0, _080AD548 + adds r2, r1, r0 + movs r0, 0x4 + strb r0, [r2] + adds r5, 0x6 + adds r2, r1, r5 + movs r0, 0x1 + strb r0, [r2] + ldr r0, _080AD54C + adds r2, r1, r0 + movs r0, 0x18 + strb r0, [r2] + subs r5, 0x1B + adds r2, r1, r5 + movs r0, 0x3 + strb r0, [r2] + ldr r0, _080AD550 + adds r1, r0 + movs r0, 0x14 + strb r0, [r1] + strb r4, [r3] + movs r0, 0x53 + bl sub_80AC31C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AD53C: .4byte 0x0854c14c +_080AD540: .4byte 0x000006cc +_080AD544: .4byte 0x000006d2 +_080AD548: .4byte 0x000006db +_080AD54C: .4byte 0x000006d9 +_080AD550: .4byte 0x000006c2 + thumb_func_end sub_80AD4E8 + + thumb_func_start sub_80AD554 +sub_80AD554: @ 80AD554 + push {r4,lr} + bl sub_80AD4E8 + ldr r0, _080AD57C + ldr r1, [r0] + ldr r2, _080AD580 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD574 + adds r4, r1, r2 +_080AD56A: + bl sub_80AD584 + ldrb r0, [r4] + cmp r0, 0 + beq _080AD56A +_080AD574: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AD57C: .4byte 0x0854c14c +_080AD580: .4byte 0x000006d2 + thumb_func_end sub_80AD554 + + thumb_func_start sub_80AD584 +sub_80AD584: @ 80AD584 + push {r4,r5,lr} + bl sub_80AD9F8 + ldr r0, _080AD5A4 + ldr r0, [r0] + ldr r1, _080AD5A8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _080AD59A + b _080AD8FA +_080AD59A: + lsls r0, 2 + ldr r1, _080AD5AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AD5A4: .4byte 0x0854c14c +_080AD5A8: .4byte 0x000006cc +_080AD5AC: .4byte _080AD5B0 + .align 2, 0 +_080AD5B0: + .4byte _080AD5EC + .4byte _080AD608 + .4byte _080AD62C + .4byte _080AD65C + .4byte _080AD680 + .4byte _080AD6B0 + .4byte _080AD6E0 + .4byte _080AD70C + .4byte _080AD72A + .4byte _080AD788 + .4byte _080AD80C + .4byte _080AD834 + .4byte _080AD864 + .4byte _080AD8A8 + .4byte _080AD8DC +_080AD5EC: + bl sub_80ACD68 + ldr r0, _080AD600 + ldr r1, [r0] + ldr r2, _080AD604 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .align 2, 0 +_080AD600: .4byte 0x0854c14c +_080AD604: .4byte 0x000006cc +_080AD608: + bl sub_80ACD78 + lsls r0, 24 + cmp r0, 0 + beq _080AD614 + b _080AD8FA +_080AD614: + ldr r0, _080AD624 + ldr r1, [r0] + ldr r3, _080AD628 + adds r1, r3 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .align 2, 0 +_080AD624: .4byte 0x0854c14c +_080AD628: .4byte 0x000006cc +_080AD62C: + bl sub_80ACEAC + lsls r0, 24 + cmp r0, 0 + beq _080AD638 + b _080AD8FA +_080AD638: + ldr r0, _080AD650 + ldr r1, [r0] + ldr r0, _080AD654 + adds r2, r1, r0 + movs r0, 0x1 + strb r0, [r2] + ldr r2, _080AD658 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .align 2, 0 +_080AD650: .4byte 0x0854c14c +_080AD654: .4byte 0x000006d2 +_080AD658: .4byte 0x000006cc +_080AD65C: + ldr r0, _080AD674 + ldr r1, [r0] + ldr r3, _080AD678 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD66C + b _080AD8FA +_080AD66C: + ldr r0, _080AD67C + adds r1, r0 + movs r0, 0x6 + b _080AD8F8 + .align 2, 0 +_080AD674: .4byte 0x0854c14c +_080AD678: .4byte 0x000006c6 +_080AD67C: .4byte 0x000006cc +_080AD680: + ldr r0, _080AD6D0 + ldr r4, [r0] + ldr r2, _080AD6D4 + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r5, 0xB4 + lsls r5, 1 + adds r1, r5, 0 + bl __umodsi3 + adds r0, r5 + ldr r3, _080AD6D8 + adds r1, r4, r3 + strh r0, [r1] + ldr r0, _080AD6DC + adds r4, r0 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AD6B0: + ldr r0, _080AD6D0 + ldr r2, [r0] + ldr r3, _080AD6D8 + adds r1, r2, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080AD6C6 + b _080AD8FA +_080AD6C6: + ldr r0, _080AD6DC + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .align 2, 0 +_080AD6D0: .4byte 0x0854c14c +_080AD6D4: .4byte 0x000006ea +_080AD6D8: .4byte 0x000006e6 +_080AD6DC: .4byte 0x000006cc +_080AD6E0: + ldr r0, _080AD700 + ldr r4, [r0] + ldr r1, _080AD704 + adds r0, r4, r1 + movs r5, 0x1 + strb r5, [r0] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ands r0, r5 + ldr r2, _080AD708 + adds r1, r4, r2 + strb r0, [r1] + b _080AD768 + .align 2, 0 +_080AD700: .4byte 0x0854c14c +_080AD704: .4byte 0x000006ea +_080AD708: .4byte 0x000006eb +_080AD70C: + bl GenerateRandomNumber + ldr r1, _080AD774 + ldr r2, [r1] + movs r1, 0x1 + ands r1, r0 + adds r1, 0x1 + ldr r3, _080AD778 + adds r0, r2, r3 + strb r1, [r0] + ldr r0, _080AD77C + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_080AD72A: + movs r0, 0x13 + bl sub_80ABC48 + ldr r0, _080AD774 + ldr r1, [r0] + ldr r2, _080AD780 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD74E + ldr r3, _080AD778 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080AD74E + movs r0, 0x14 + bl sub_80AD9BC +_080AD74E: + bl GenerateRandomNumber + ldr r1, _080AD774 + ldr r4, [r1] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, 0x6 + ldr r2, _080AD784 + adds r1, r4, r2 + strh r0, [r1] +_080AD768: + ldr r3, _080AD77C + adds r4, r3 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AD8FA + .align 2, 0 +_080AD774: .4byte 0x0854c14c +_080AD778: .4byte 0x000006ec +_080AD77C: .4byte 0x000006cc +_080AD780: .4byte 0x000006eb +_080AD784: .4byte 0x000006e6 +_080AD788: + ldr r0, _080AD7D4 + ldr r4, [r0] + ldr r0, _080AD7D8 + adds r5, r4, r0 + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + beq _080AD79E + b _080AD8FA +_080AD79E: + movs r0, 0x3 + bl sub_80ABC48 + ldr r2, _080AD7DC + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r3, _080AD7E0 + adds r1, r4, r3 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + beq _080AD7E8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r0, 0x3C + strh r0, [r5] + ldr r0, _080AD7E4 + adds r1, r4, r0 + movs r0, 0xA + b _080AD8F8 + .align 2, 0 +_080AD7D4: .4byte 0x0854c14c +_080AD7D8: .4byte 0x000006e6 +_080AD7DC: .4byte 0x000006ea +_080AD7E0: .4byte 0x000006ec +_080AD7E4: .4byte 0x000006cc +_080AD7E8: + ldr r1, _080AD7F8 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD800 + ldr r2, _080AD7FC + adds r1, r4, r2 + b _080AD8F6 + .align 2, 0 +_080AD7F8: .4byte 0x000006eb +_080AD7FC: .4byte 0x000006cc +_080AD800: + ldr r3, _080AD808 + adds r1, r4, r3 + movs r0, 0xB + b _080AD8F8 + .align 2, 0 +_080AD808: .4byte 0x000006cc +_080AD80C: + ldr r0, _080AD828 + ldr r2, [r0] + ldr r0, _080AD82C + adds r1, r2, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080AD8FA + ldr r3, _080AD830 + adds r1, r2, r3 + movs r0, 0x8 + b _080AD8F8 + .align 2, 0 +_080AD828: .4byte 0x0854c14c +_080AD82C: .4byte 0x000006e6 +_080AD830: .4byte 0x000006cc +_080AD834: + bl GenerateRandomNumber + ldr r1, _080AD858 + ldr r2, [r1] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r0, 0x3C + ldr r3, _080AD85C + adds r1, r2, r3 + strh r0, [r1] + ldr r0, _080AD860 + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _080AD8FA + .align 2, 0 +_080AD858: .4byte 0x0854c14c +_080AD85C: .4byte 0x000006e6 +_080AD860: .4byte 0x000006cc +_080AD864: + ldr r0, _080AD89C + ldr r5, [r0] + ldr r1, _080AD8A0 + adds r4, r5, r1 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bne _080AD8FA + movs r0, 0x64 + bl sub_80AD9BC + movs r0, 0x13 + bl sub_80ABC48 + bl GenerateRandomNumber + movs r1, 0xF + ands r1, r0 + adds r1, 0x1E + strh r1, [r4] + ldr r2, _080AD8A4 + adds r1, r5, r2 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .align 2, 0 +_080AD89C: .4byte 0x0854c14c +_080AD8A0: .4byte 0x000006e6 +_080AD8A4: .4byte 0x000006cc +_080AD8A8: + ldr r0, _080AD8D0 + ldr r4, [r0] + ldr r3, _080AD8D4 + adds r1, r4, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080AD8FA + movs r0, 0x13 + movs r1, 0x3 + movs r2, 0x5 + bl sub_80ABC7C + ldr r0, _080AD8D8 + adds r1, r4, r0 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .align 2, 0 +_080AD8D0: .4byte 0x0854c14c +_080AD8D4: .4byte 0x000006e6 +_080AD8D8: .4byte 0x000006cc +_080AD8DC: + ldr r0, _080AD900 + ldr r2, [r0] + ldr r1, _080AD904 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _080AD8FA + ldr r3, _080AD908 + adds r1, r2, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080AD90C + adds r1, r2, r0 +_080AD8F6: + movs r0, 0x4 +_080AD8F8: + strh r0, [r1] +_080AD8FA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AD900: .4byte 0x0854c14c +_080AD904: .4byte 0x000006c6 +_080AD908: .4byte 0x000006ea +_080AD90C: .4byte 0x000006cc + thumb_func_end sub_80AD584 + + thumb_func_start sub_80AD910 +sub_80AD910: @ 80AD910 + push {r4-r6,lr} + ldr r0, _080AD92C + ldr r6, [r0] + ldr r0, _080AD930 + adds r5, r6, r0 + ldrh r1, [r5] + cmp r1, 0x1 + beq _080AD946 + cmp r1, 0x1 + bgt _080AD934 + cmp r1, 0 + beq _080AD93A + b _080AD9AC + .align 2, 0 +_080AD92C: .4byte 0x0854c14c +_080AD930: .4byte 0x000006ce +_080AD934: + cmp r1, 0x2 + beq _080AD990 + b _080AD9AC +_080AD93A: + ldr r2, _080AD980 + adds r0, r6, r2 + strb r1, [r0] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080AD946: + bl sub_80AD584 + ldr r0, _080AD984 + ldr r2, [r0] + ldr r1, _080AD980 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080AD9B4 + subs r1, 0x19 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080AD9AC + cmp r0, 0x5 + beq _080AD9AC + cmp r0, 0xD + beq _080AD9AC + ldr r0, _080AD988 + adds r1, r2, r0 + movs r0, 0 + strb r0, [r1] + ldr r0, _080AD98C + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080AD9B4 + .align 2, 0 +_080AD980: .4byte 0x000006ea +_080AD984: .4byte 0x0854c14c +_080AD988: .4byte 0x000006d9 +_080AD98C: .4byte 0x000006ce +_080AD990: + bl sub_80ACEAC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080AD9B4 + bl sub_80ACF38 + ldr r1, _080AD9B0 + adds r0, r6, r1 + strb r4, [r0] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080AD9AC: + movs r0, 0 + b _080AD9B6 + .align 2, 0 +_080AD9B0: .4byte 0x000006ed +_080AD9B4: + movs r0, 0x1 +_080AD9B6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80AD910 + + thumb_func_start sub_80AD9BC +sub_80AD9BC: @ 80AD9BC + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _080AD9F0 + ldr r4, [r0] + ldr r0, _080AD9F4 + adds r5, r4, r0 + ldrb r0, [r5] + cmp r0, 0 + bne _080AD9EA + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __umodsi3 + movs r2, 0xDD + lsls r2, 3 + adds r1, r4, r2 + strh r0, [r1] + movs r0, 0x1 + strb r0, [r5] +_080AD9EA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AD9F0: .4byte 0x0854c14c +_080AD9F4: .4byte 0x000006ed + thumb_func_end sub_80AD9BC + + thumb_func_start sub_80AD9F8 +sub_80AD9F8: @ 80AD9F8 + push {r4,lr} + ldr r0, _080ADA30 + ldr r1, [r0] + ldr r2, _080ADA34 + adds r0, r1, r2 + ldrb r4, [r0] + cmp r4, 0x1 + bne _080ADA58 + movs r0, 0xDD + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080ADA54 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080ADA58 + bl GenerateRandomNumber + ands r4, r0 + cmp r4, 0 + beq _080ADA38 + movs r0, 0x57 + bl audio_play + b _080ADA3E + .align 2, 0 +_080ADA30: .4byte 0x0854c14c +_080ADA34: .4byte 0x000006ed +_080ADA38: + movs r0, 0x58 + bl audio_play +_080ADA3E: + ldr r0, _080ADA4C + ldr r0, [r0] + ldr r1, _080ADA50 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + b _080ADA58 + .align 2, 0 +_080ADA4C: .4byte 0x0854c14c +_080ADA50: .4byte 0x000006ed +_080ADA54: + subs r0, 0x1 + strh r0, [r1] +_080ADA58: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AD9F8 + + thumb_func_start sub_80ADA60 +sub_80ADA60: @ 80ADA60 + push {lr} + ldr r0, _080ADAAC + ldr r3, [r0] + ldr r0, _080ADAB0 + adds r1, r3, r0 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + ldr r1, _080ADAB4 + adds r0, r3, r1 + strb r2, [r0] + subs r1, 0x11 + adds r0, r3, r1 + strb r2, [r0] + ldr r2, _080ADAB8 + adds r1, r3, r2 + movs r0, 0x14 + strb r0, [r1] + ldr r1, _080ADABC + adds r0, r3, r1 + ldrb r1, [r0] + cmp r1, 0 + bne _080ADAA8 + adds r2, 0x2E + adds r0, r3, r2 + strh r1, [r0] + adds r2, 0x2 + adds r0, r3, r2 + strh r1, [r0] + subs r2, 0x4 + adds r0, r3, r2 + strh r1, [r0] + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080ADAA8: + pop {r0} + bx r0 + .align 2, 0 +_080ADAAC: .4byte 0x0854c14c +_080ADAB0: .4byte 0x000006cc +_080ADAB4: .4byte 0x000006d2 +_080ADAB8: .4byte 0x000006c2 +_080ADABC: .4byte 0x000006fb + thumb_func_end sub_80ADA60 + + thumb_func_start sub_80ADAC0 +sub_80ADAC0: @ 80ADAC0 + push {r4,lr} + bl sub_80ADA60 + ldr r0, _080ADAE8 + ldr r1, [r0] + ldr r2, _080ADAEC + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADAE0 + adds r4, r1, r2 +_080ADAD6: + bl sub_80ADAF0 + ldrb r0, [r4] + cmp r0, 0 + beq _080ADAD6 +_080ADAE0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ADAE8: .4byte 0x0854c14c +_080ADAEC: .4byte 0x000006d2 + thumb_func_end sub_80ADAC0 + + thumb_func_start sub_80ADAF0 +sub_80ADAF0: @ 80ADAF0 + push {r4-r6,lr} + ldr r0, _080ADB3C + ldr r6, [r0] + ldr r0, _080ADB40 + ldr r1, _080ADB44 + adds r2, r6, r1 + ldrh r0, [r0] + ldrh r1, [r2] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + ldr r3, _080ADB48 + adds r1, r6, r3 + strh r0, [r1] + movs r0, 0xDE + lsls r0, 3 + adds r1, r6, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _080ADB2A + movs r0, 0 + strh r0, [r1] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_080ADB2A: + ldr r1, _080ADB4C + adds r5, r6, r1 + ldrh r4, [r5] + cmp r4, 0 + beq _080ADB50 + cmp r4, 0x1 + beq _080ADB90 + b _080ADBA6 + .align 2, 0 +_080ADB3C: .4byte 0x0854c14c +_080ADB40: .4byte 0x02021bbc +_080ADB44: .4byte 0x000006f2 +_080ADB48: .4byte 0x000006ee +_080ADB4C: .4byte 0x000006cc +_080ADB50: + bl sub_80ADCAC + movs r3, 0xDA + lsls r3, 3 + adds r0, r6, r3 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080ADB6C + movs r0, 0xC + movs r1, 0x8 + movs r2, 0x3 + bl sub_80AC164 + b _080ADB76 +_080ADB6C: + movs r0, 0x4 + movs r1, 0x10 + movs r2, 0 + bl sub_80AC164 +_080ADB76: + ldr r0, _080ADB88 + ldr r1, [r0] + ldr r0, _080ADB8C + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080ADBA6 + .align 2, 0 +_080ADB88: .4byte 0x0854c14c +_080ADB8C: .4byte 0x000006cc +_080ADB90: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADBA6 + ldr r1, _080ADBAC + adds r0, r6, r1 + strb r4, [r0] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080ADBA6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ADBAC: .4byte 0x000006d2 + thumb_func_end sub_80ADAF0 + + thumb_func_start sub_80ADBB0 +sub_80ADBB0: @ 80ADBB0 + push {r4,lr} + ldr r0, _080ADC00 + ldr r2, [r0] + ldr r0, _080ADC04 + ldr r1, _080ADC08 + adds r3, r2, r1 + ldrh r0, [r0] + ldrh r1, [r3] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + ldr r4, _080ADC0C + adds r1, r2, r4 + strh r0, [r1] + movs r0, 0xDE + lsls r0, 3 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _080ADBEA + movs r0, 0 + strh r0, [r1] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_080ADBEA: + ldr r1, _080ADC10 + adds r4, r2, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080ADC26 + cmp r0, 0x1 + bgt _080ADC14 + cmp r0, 0 + beq _080ADC1A + b _080ADC3E + .align 2, 0 +_080ADC00: .4byte 0x0854c14c +_080ADC04: .4byte 0x02021bbc +_080ADC08: .4byte 0x000006f2 +_080ADC0C: .4byte 0x000006ee +_080ADC10: .4byte 0x000006ce +_080ADC14: + cmp r0, 0x2 + beq _080ADC32 + b _080ADC3E +_080ADC1A: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x3 + bl sub_80AC164 + b _080ADC36 +_080ADC26: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADC42 + b _080ADC36 +_080ADC32: + bl sub_80ADD68 +_080ADC36: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080ADC42 +_080ADC3E: + movs r0, 0 + b _080ADC44 +_080ADC42: + movs r0, 0x1 +_080ADC44: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ADBB0 + + thumb_func_start sub_80ADC4C +sub_80ADC4C: @ 80ADC4C + push {r4,lr} + adds r3, r0, 0 + ldr r0, _080ADC98 + ldrb r0, [r0] + strh r0, [r3, 0x26] + ldr r0, _080ADC9C + ldr r0, [r0] + ldr r1, _080ADCA0 + adds r2, r0, r1 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x2E + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, _080ADCA4 + cmp r1, r0 + ble _080ADC90 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x2E + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, _080ADCA8 + ands r1, r0 + strh r1, [r3, 0x20] +_080ADC90: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ADC98: .4byte 0x02021bbe +_080ADC9C: .4byte 0x0854c14c +_080ADCA0: .4byte 0x000006ee +_080ADCA4: .4byte 0x010f0000 +_080ADCA8: .4byte 0x000001ff + thumb_func_end sub_80ADC4C + + thumb_func_start sub_80ADCAC +sub_80ADCAC: @ 80ADCAC + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _080ADD20 + ldr r0, [r0] + ldr r1, _080ADD24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADD56 + ldr r0, _080ADD28 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r5, 0 +_080ADCD0: + ldr r0, _080ADD2C + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080ADD34 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080ADD30 + adds r4, r0 + adds r0, r5, 0 + movs r1, 0x5 + bl __umodsi3 + strh r0, [r4, 0x2E] + lsls r0, 16 + lsrs r0, 10 + adds r0, 0x20 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 10 + adds r0, 0x20 + strh r0, [r4, 0x22] + ldr r2, _080ADD20 + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, 0xA0 + adds r0, r1 + str r4, [r0] + b _080ADD42 + .align 2, 0 +_080ADD20: .4byte 0x0854c14c +_080ADD24: .4byte 0x000006fb +_080ADD28: .4byte 0x0854fd30 +_080ADD2C: .4byte 0x0854fd18 +_080ADD30: .4byte 0x02020630 +_080ADD34: + ldr r2, _080ADD60 + ldr r1, [r2] + lsls r0, r5, 2 + adds r1, 0xA0 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080ADD42: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x13 + bls _080ADCD0 + ldr r0, [r2] + ldr r1, _080ADD64 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080ADD56: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ADD60: .4byte 0x0854c14c +_080ADD64: .4byte 0x000006fb + thumb_func_end sub_80ADCAC + + thumb_func_start sub_80ADD68 +sub_80ADD68: @ 80ADD68 + push {r4,r5,lr} + ldr r0, _080ADDB0 + ldr r1, [r0] + ldr r2, _080ADDB4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080ADDA8 + movs r4, 0 + adds r5, r1, 0 + adds r5, 0xA0 +_080ADD7E: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080ADD8C + bl obj_delete_and_free_tiles +_080ADD8C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080ADD7E + ldr r0, _080ADDB8 + bl gpu_tile_obj_free_by_tag + ldr r0, _080ADDB0 + ldr r0, [r0] + ldr r1, _080ADDB4 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080ADDA8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ADDB0: .4byte 0x0854c14c +_080ADDB4: .4byte 0x000006fb +_080ADDB8: .4byte 0x00001201 + thumb_func_end sub_80ADD68 + + thumb_func_start sub_80ADDBC +sub_80ADDBC: @ 80ADDBC + push {lr} + ldr r0, _080ADE08 + ldr r1, [r0] + ldr r0, _080ADE0C + adds r2, r1, r0 + movs r3, 0 + movs r0, 0 + strh r0, [r2] + ldr r2, _080ADE10 + adds r0, r1, r2 + strb r3, [r0] + subs r2, 0x11 + adds r0, r1, r2 + strb r3, [r0] + ldr r3, _080ADE14 + adds r0, r1, r3 + movs r2, 0x14 + strb r2, [r0] + adds r3, 0x3C + adds r0, r1, r3 + strh r2, [r0] + movs r0, 0xE0 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _080ADE04 + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x52 + bl lcd_io_set +_080ADE04: + pop {r0} + bx r0 + .align 2, 0 +_080ADE08: .4byte 0x0854c14c +_080ADE0C: .4byte 0x000006cc +_080ADE10: .4byte 0x000006d2 +_080ADE14: .4byte 0x000006c2 + thumb_func_end sub_80ADDBC + + thumb_func_start sub_80ADE18 +sub_80ADE18: @ 80ADE18 + push {r4,lr} + bl sub_80ADDBC + ldr r0, _080ADE40 + ldr r1, [r0] + ldr r2, _080ADE44 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADE38 + adds r4, r1, r2 +_080ADE2E: + bl sub_80ADE48 + ldrb r0, [r4] + cmp r0, 0 + beq _080ADE2E +_080ADE38: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ADE40: .4byte 0x0854c14c +_080ADE44: .4byte 0x000006d2 + thumb_func_end sub_80ADE18 + + thumb_func_start sub_80ADE48 +sub_80ADE48: @ 80ADE48 + push {r4,r5,lr} + ldr r2, _080ADE8C + ldr r1, [r2] + ldr r0, _080ADE90 + ldrh r0, [r0] + ldr r3, _080ADE94 + ands r3, r0 + ldr r0, _080ADE98 + adds r1, r0 + strh r3, [r1] + cmp r3, 0xEF + bls _080ADE74 + adds r4, r1, 0 + adds r1, r3, 0 +_080ADE64: + adds r3, r1, 0 + subs r3, 0xF0 + adds r1, r3, 0 + lsls r0, r3, 16 + lsrs r0, 16 + cmp r0, 0xEF + bhi _080ADE64 + strh r3, [r4] +_080ADE74: + ldr r5, [r2] + ldr r1, _080ADE9C + adds r4, r5, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080ADEAC + cmp r0, 0x1 + bgt _080ADEA0 + cmp r0, 0 + beq _080ADEA6 + b _080ADEE8 + .align 2, 0 +_080ADE8C: .4byte 0x0854c14c +_080ADE90: .4byte 0x02021bbc +_080ADE94: .4byte 0x000001ff +_080ADE98: .4byte 0x000006fc +_080ADE9C: .4byte 0x000006cc +_080ADEA0: + cmp r0, 0x2 + beq _080ADEC8 + b _080ADEE8 +_080ADEA6: + bl sub_80ADF5C + b _080ADEDA +_080ADEAC: + movs r1, 0xE0 + lsls r1, 3 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADEBC + bl sub_80ADF6C +_080ADEBC: + movs r0, 0x10 + movs r1, 0 + movs r2, 0x1 + bl sub_80AC164 + b _080ADEDA +_080ADEC8: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADEEC + ldr r0, _080ADEE4 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080ADEDA: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080ADEEC + .align 2, 0 +_080ADEE4: .4byte 0x000006d2 +_080ADEE8: + bl sub_80AC1A8 +_080ADEEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80ADE48 + + thumb_func_start sub_80ADEF4 +sub_80ADEF4: @ 80ADEF4 + push {r4,lr} + ldr r0, _080ADF10 + ldr r0, [r0] + ldr r1, _080ADF14 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080ADF2A + cmp r0, 0x1 + bgt _080ADF18 + cmp r0, 0 + beq _080ADF1E + b _080ADF4E + .align 2, 0 +_080ADF10: .4byte 0x0854c14c +_080ADF14: .4byte 0x000006ce +_080ADF18: + cmp r0, 0x2 + beq _080ADF40 + b _080ADF4E +_080ADF1E: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1 + bl sub_80AC164 + b _080ADF38 +_080ADF2A: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADF52 + bl sub_80AE014 +_080ADF38: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080ADF52 +_080ADF40: + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080ADF4E: + movs r0, 0 + b _080ADF54 +_080ADF52: + movs r0, 0x1 +_080ADF54: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ADEF4 + + thumb_func_start sub_80ADF5C +sub_80ADF5C: @ 80ADF5C + push {lr} + ldr r0, _080ADF68 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + pop {r0} + bx r0 + .align 2, 0 +_080ADF68: .4byte 0x0854fd38 + thumb_func_end sub_80ADF5C + + thumb_func_start sub_80ADF6C +sub_80ADF6C: @ 80ADF6C + push {r4,r5,lr} + ldr r0, _080ADFD8 + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE008 + movs r5, 0 +_080ADF80: + ldr r0, _080ADFDC + movs r1, 0 + movs r2, 0 + movs r3, 0x4E + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080ADFE4 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080ADFE0 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r0, r5, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x34] + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 6 + adds r0, 0x20 + strh r0, [r4, 0x2E] + ldr r2, _080ADFD8 + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, 0xF0 + adds r0, r1 + str r4, [r0] + b _080ADFF2 + .align 2, 0 +_080ADFD8: .4byte 0x0854c14c +_080ADFDC: .4byte 0x0854fd58 +_080ADFE0: .4byte 0x02020630 +_080ADFE4: + ldr r2, _080AE010 + ldr r1, [r2] + lsls r0, r5, 2 + adds r1, 0xF0 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080ADFF2: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080ADF80 + ldr r0, [r2] + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AE008: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE010: .4byte 0x0854c14c + thumb_func_end sub_80ADF6C + + thumb_func_start sub_80AE014 +sub_80AE014: @ 80AE014 + push {r4,r5,lr} + ldr r0, _080AE060 + ldr r1, [r0] + movs r2, 0xE0 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE058 + movs r4, 0 + adds r5, r1, 0 + adds r5, 0xF0 +_080AE02C: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE03A + bl obj_delete_and_free_tiles +_080AE03A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080AE02C + ldr r0, _080AE064 + bl gpu_tile_obj_free_by_tag + ldr r0, _080AE060 + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AE058: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE060: .4byte 0x0854c14c +_080AE064: .4byte 0x00001202 + thumb_func_end sub_80AE014 + + thumb_func_start sub_80AE068 +sub_80AE068: @ 80AE068 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080AE084 + movs r0, 0 + strh r0, [r3, 0x30] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] +_080AE084: + ldr r1, _080AE0D0 + ldrh r0, [r3, 0x2E] + ldrh r1, [r1] + adds r0, r1 + strh r0, [r3, 0x22] + ldr r0, _080AE0D4 + ldr r0, [r0] + ldr r1, _080AE0D8 + adds r2, r0, r1 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x32 + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, _080AE0DC + cmp r1, r0 + ble _080AE0C8 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x32 + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, _080AE0E0 + ands r1, r0 + strh r1, [r3, 0x20] +_080AE0C8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE0D0: .4byte 0x02021bbe +_080AE0D4: .4byte 0x0854c14c +_080AE0D8: .4byte 0x000006fc +_080AE0DC: .4byte 0x010f0000 +_080AE0E0: .4byte 0x000001ff + thumb_func_end sub_80AE068 + + thumb_func_start sub_80AE0E4 +sub_80AE0E4: @ 80AE0E4 + push {r4,lr} + ldr r0, _080AE154 + ldr r3, [r0] + ldr r1, _080AE158 + adds r0, r3, r1 + movs r1, 0 + movs r2, 0 + strh r2, [r0] + ldr r4, _080AE15C + adds r0, r3, r4 + strb r1, [r0] + subs r4, 0x11 + adds r0, r3, r4 + strb r1, [r0] + ldr r0, _080AE160 + adds r1, r3, r0 + movs r0, 0x14 + strb r0, [r1] + movs r1, 0xDE + lsls r1, 3 + adds r0, r3, r1 + strh r2, [r0] + adds r4, 0x31 + adds r1, r3, r4 + movs r0, 0x1 + strh r0, [r1] + ldr r1, _080AE164 + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0 + bne _080AE14E + adds r4, 0x2A + adds r0, r3, r4 + strh r2, [r0] + subs r1, 0x6 + adds r0, r3, r1 + strh r2, [r0] + adds r4, 0x4 + adds r0, r3, r4 + strh r2, [r0] + adds r1, 0x4 + adds r0, r3, r1 + strh r2, [r0] + subs r4, 0x8 + adds r0, r3, r4 + strh r2, [r0] + subs r1, 0x8 + adds r0, r3, r1 + strh r2, [r0] + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080AE14E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE154: .4byte 0x0854c14c +_080AE158: .4byte 0x000006cc +_080AE15C: .4byte 0x000006d2 +_080AE160: .4byte 0x000006c2 +_080AE164: .4byte 0x00000724 + thumb_func_end sub_80AE0E4 + + thumb_func_start sub_80AE168 +sub_80AE168: @ 80AE168 + push {r4,lr} + bl sub_80AE0E4 + ldr r0, _080AE190 + ldr r1, [r0] + ldr r2, _080AE194 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE188 + adds r4, r1, r2 +_080AE17E: + bl sub_80AE198 + ldrb r0, [r4] + cmp r0, 0 + beq _080AE17E +_080AE188: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE190: .4byte 0x0854c14c +_080AE194: .4byte 0x000006d2 + thumb_func_end sub_80AE168 + + thumb_func_start sub_80AE198 +sub_80AE198: @ 80AE198 + push {r4,r5,lr} + bl sub_80AE25C + ldr r0, _080AE1B8 + ldr r5, [r0] + ldr r0, _080AE1BC + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE1CC + cmp r0, 0x1 + bgt _080AE1C0 + cmp r0, 0 + beq _080AE1C6 + b _080AE1F0 + .align 2, 0 +_080AE1B8: .4byte 0x0854c14c +_080AE1BC: .4byte 0x000006cc +_080AE1C0: + cmp r0, 0x2 + beq _080AE1D8 + b _080AE1F0 +_080AE1C6: + bl sub_80AE2F0 + b _080AE1EA +_080AE1CC: + movs r0, 0xC + movs r1, 0x8 + movs r2, 0x8 + bl sub_80AC164 + b _080AE1EA +_080AE1D8: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE1F0 + ldr r0, _080AE1F8 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080AE1EA: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AE1F0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE1F8: .4byte 0x000006d2 + thumb_func_end sub_80AE198 + + thumb_func_start sub_80AE1FC +sub_80AE1FC: @ 80AE1FC + push {r4,lr} + bl sub_80AE25C + ldr r0, _080AE21C + ldr r0, [r0] + ldr r1, _080AE220 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE236 + cmp r0, 0x1 + bgt _080AE224 + cmp r0, 0 + beq _080AE22A + b _080AE24E + .align 2, 0 +_080AE21C: .4byte 0x0854c14c +_080AE220: .4byte 0x000006ce +_080AE224: + cmp r0, 0x2 + beq _080AE242 + b _080AE24E +_080AE22A: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1 + bl sub_80AC164 + b _080AE246 +_080AE236: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE252 + b _080AE246 +_080AE242: + bl sub_80AE3A8 +_080AE246: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AE252 +_080AE24E: + movs r0, 0 + b _080AE254 +_080AE252: + movs r0, 0x1 +_080AE254: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AE1FC + + thumb_func_start sub_80AE25C +sub_80AE25C: @ 80AE25C + push {r4,r5,lr} + ldr r0, _080AE2D4 + ldr r3, [r0] + ldr r0, _080AE2D8 + adds r2, r3, r0 + ldrh r0, [r2] + adds r0, 0x1 + movs r5, 0 + strh r0, [r2] + ldr r1, _080AE2DC + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080AE288 + movs r0, 0xE4 + lsls r0, 3 + adds r1, r3, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + strh r5, [r2] +_080AE288: + ldr r1, _080AE2E0 + adds r2, r3, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + ands r0, r4 + cmp r0, 0x4 + bls _080AE2A4 + ldr r0, _080AE2E4 + adds r1, r3, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + strh r5, [r2] +_080AE2A4: + ldr r0, _080AE2E8 + movs r2, 0xE4 + lsls r2, 3 + adds r1, r3, r2 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + subs r2, 0x8 + adds r1, r3, r2 + strh r0, [r1] + ldr r1, _080AE2EC + adds r2, 0xA + adds r0, r3, r2 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + subs r2, 0x8 + adds r1, r3, r2 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE2D4: .4byte 0x0854c14c +_080AE2D8: .4byte 0x0000071c +_080AE2DC: .4byte 0x0000ffff +_080AE2E0: .4byte 0x0000071e +_080AE2E4: .4byte 0x00000722 +_080AE2E8: .4byte 0x02021bbc +_080AE2EC: .4byte 0x02021bbe + thumb_func_end sub_80AE25C + + thumb_func_start sub_80AE2F0 +sub_80AE2F0: @ 80AE2F0 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, _080AE35C + ldr r0, [r0] + ldr r1, _080AE360 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE396 + ldr r0, _080AE364 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r6, 0 +_080AE314: + adds r0, r6, 0 + movs r1, 0x5 + bl __udivsi3 + adds r5, r0, 0 + lsls r2, r5, 22 + asrs r2, 16 + ldr r0, _080AE368 + movs r1, 0 + movs r3, 0xFF + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080AE370 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080AE36C + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x30] + ldr r2, _080AE35C + ldr r0, [r2] + lsls r1, r6, 2 + movs r3, 0xA0 + lsls r3, 1 + adds r0, r3 + adds r0, r1 + str r4, [r0] + b _080AE382 + .align 2, 0 +_080AE35C: .4byte 0x0854c14c +_080AE360: .4byte 0x00000724 +_080AE364: .4byte 0x0854fd70 +_080AE368: .4byte 0x0854fd8c +_080AE36C: .4byte 0x02020630 +_080AE370: + ldr r2, _080AE3A0 + ldr r1, [r2] + lsls r0, r6, 2 + movs r3, 0xA0 + lsls r3, 1 + adds r1, r3 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080AE382: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bls _080AE314 + ldr r0, [r2] + ldr r1, _080AE3A4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AE396: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AE3A0: .4byte 0x0854c14c +_080AE3A4: .4byte 0x00000724 + thumb_func_end sub_80AE2F0 + + thumb_func_start sub_80AE3A8 +sub_80AE3A8: @ 80AE3A8 + push {r4,r5,lr} + ldr r0, _080AE3F0 + ldr r1, [r0] + ldr r2, _080AE3F4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE3EA + movs r4, 0 + movs r0, 0xA0 + lsls r0, 1 + adds r5, r1, r0 +_080AE3C0: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE3CE + bl obj_delete_and_free_tiles +_080AE3CE: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080AE3C0 + ldr r0, _080AE3F8 + bl gpu_tile_obj_free_by_tag + ldr r0, _080AE3F0 + ldr r0, [r0] + ldr r1, _080AE3F4 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AE3EA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE3F0: .4byte 0x0854c14c +_080AE3F4: .4byte 0x00000724 +_080AE3F8: .4byte 0x00001203 + thumb_func_end sub_80AE3A8 + + thumb_func_start sub_80AE3FC +sub_80AE3FC: @ 80AE3FC + push {r4,lr} + adds r3, r0, 0 + ldr r0, _080AE44C + ldr r1, [r0] + ldr r2, _080AE450 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r3, 0x26] + movs r4, 0xE3 + lsls r4, 3 + adds r2, r1, r4 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x2E + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, _080AE454 + cmp r1, r0 + ble _080AE444 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x2E + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, _080AE458 + ands r1, r0 + strh r1, [r3, 0x20] +_080AE444: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE44C: .4byte 0x0854c14c +_080AE450: .4byte 0x0000071a +_080AE454: .4byte 0x010f0000 +_080AE458: .4byte 0x000001ff + thumb_func_end sub_80AE3FC + + thumb_func_start sub_80AE45C +sub_80AE45C: @ 80AE45C + push {r4,lr} + ldr r0, _080AE4C0 + ldr r3, [r0] + ldr r0, _080AE4C4 + adds r1, r3, r0 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + ldr r1, _080AE4C8 + adds r0, r3, r1 + strb r2, [r0] + ldr r4, _080AE4CC + adds r0, r3, r4 + strb r2, [r0] + ldr r0, _080AE4D0 + adds r1, r3, r0 + movs r0, 0x14 + strb r0, [r1] + ldr r1, _080AE4D4 + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0 + bne _080AE4B8 + adds r4, 0x43 + adds r1, r3, r4 + adds r4, 0x4 + adds r0, r3, r4 + str r2, [r0] + str r2, [r1] + ldr r0, _080AE4D8 + adds r1, r3, r0 + movs r0, 0x8 + strh r0, [r1] + adds r4, 0xC + adds r0, r3, r4 + strh r2, [r0] + ldrh r2, [r1] + cmp r2, 0x5F + bls _080AE4B0 + movs r0, 0x80 + subs r0, r2 + strh r0, [r1] +_080AE4B0: + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080AE4B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE4C0: .4byte 0x0854c14c +_080AE4C4: .4byte 0x000006cc +_080AE4C8: .4byte 0x000006d2 +_080AE4CC: .4byte 0x000006c1 +_080AE4D0: .4byte 0x000006c2 +_080AE4D4: .4byte 0x00000716 +_080AE4D8: .4byte 0x00000712 + thumb_func_end sub_80AE45C + + thumb_func_start sub_80AE4DC +sub_80AE4DC: @ 80AE4DC + push {r4,lr} + bl sub_80AE45C + ldr r0, _080AE504 + ldr r1, [r0] + ldr r2, _080AE508 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE4FC + adds r4, r1, r2 +_080AE4F2: + bl sub_80AE50C + ldrb r0, [r4] + cmp r0, 0 + beq _080AE4F2 +_080AE4FC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE504: .4byte 0x0854c14c +_080AE508: .4byte 0x000006d2 + thumb_func_end sub_80AE4DC + + thumb_func_start sub_80AE50C +sub_80AE50C: @ 80AE50C + push {r4,r5,lr} + bl sub_80AE624 + bl sub_80AE5EC + ldr r0, _080AE53C + ldr r5, [r0] + ldr r0, _080AE540 + adds r1, r5, r0 + ldrh r0, [r1] + cmp r0, 0x5F + bls _080AE528 + movs r0, 0x20 + strh r0, [r1] +_080AE528: + ldr r0, _080AE544 + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE558 + cmp r0, 0x1 + bgt _080AE548 + cmp r0, 0 + beq _080AE54E + b _080AE57C + .align 2, 0 +_080AE53C: .4byte 0x0854c14c +_080AE540: .4byte 0x00000712 +_080AE544: .4byte 0x000006cc +_080AE548: + cmp r0, 0x2 + beq _080AE564 + b _080AE57C +_080AE54E: + bl sub_80AE738 + bl sub_80AE7F8 + b _080AE576 +_080AE558: + movs r0, 0x10 + movs r1, 0 + movs r2, 0 + bl sub_80AC164 + b _080AE576 +_080AE564: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE57C + ldr r0, _080AE584 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080AE576: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AE57C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE584: .4byte 0x000006d2 + thumb_func_end sub_80AE50C + + thumb_func_start sub_80AE588 +sub_80AE588: @ 80AE588 + push {r4,lr} + bl sub_80AE624 + bl sub_80AE5EC + ldr r0, _080AE5AC + ldr r0, [r0] + ldr r1, _080AE5B0 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE5C6 + cmp r0, 0x1 + bgt _080AE5B4 + cmp r0, 0 + beq _080AE5BA + b _080AE5DE + .align 2, 0 +_080AE5AC: .4byte 0x0854c14c +_080AE5B0: .4byte 0x000006ce +_080AE5B4: + cmp r0, 0x2 + beq _080AE5D2 + b _080AE5DE +_080AE5BA: + movs r0, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80AC164 + b _080AE5D6 +_080AE5C6: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE5E2 + b _080AE5D6 +_080AE5D2: + bl sub_80AE6A4 +_080AE5D6: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AE5E2 +_080AE5DE: + movs r0, 0 + b _080AE5E4 +_080AE5E2: + movs r0, 0x1 +_080AE5E4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AE588 + + thumb_func_start sub_80AE5EC +sub_80AE5EC: @ 80AE5EC + push {lr} + ldr r0, _080AE618 + ldr r2, [r0] + ldr r0, _080AE61C + adds r3, r2, r0 + ldrh r0, [r3] + adds r1, r0, 0x1 + strh r1, [r3] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bls _080AE612 + ldr r1, _080AE620 + adds r0, r2, r1 + ldrh r1, [r0] + adds r1, 0x1 + movs r2, 0 + strh r1, [r0] + strh r2, [r3] +_080AE612: + pop {r0} + bx r0 + .align 2, 0 +_080AE618: .4byte 0x0854c14c +_080AE61C: .4byte 0x00000714 +_080AE620: .4byte 0x00000712 + thumb_func_end sub_80AE5EC + + thumb_func_start sub_80AE624 +sub_80AE624: @ 80AE624 + push {r4-r6,lr} + ldr r0, _080AE688 + ldr r2, [r0] + ldr r0, _080AE68C + adds r4, r2, r0 + ldr r6, _080AE690 + ldr r1, _080AE694 + adds r5, r2, r1 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r6 + movs r3, 0 + ldrsh r1, [r0, r3] + lsls r1, 2 + ldr r0, [r4] + subs r0, r1 + str r0, [r4] + movs r0, 0xE1 + lsls r0, 3 + adds r3, r2, r0 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r6 + movs r5, 0 + ldrsh r1, [r0, r5] + ldr r0, [r3] + subs r0, r1 + str r0, [r3] + ldr r1, _080AE698 + ldr r0, [r4] + lsrs r0, 8 + ldrh r1, [r1] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + ldr r4, _080AE69C + adds r1, r2, r4 + strh r0, [r1] + ldr r1, _080AE6A0 + ldr r0, [r3] + lsrs r0, 8 + ldrh r1, [r1] + adds r0, r1 + movs r5, 0xE2 + lsls r5, 3 + adds r2, r5 + strh r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AE688: .4byte 0x0854c14c +_080AE68C: .4byte 0x00000704 +_080AE690: .4byte 0x08329f40 +_080AE694: .4byte 0x00000712 +_080AE698: .4byte 0x02021bbc +_080AE69C: .4byte 0x0000070e +_080AE6A0: .4byte 0x02021bbe + thumb_func_end sub_80AE624 + + thumb_func_start sub_80AE6A4 +sub_80AE6A4: @ 80AE6A4 + push {r4,r5,lr} + ldr r0, _080AE728 + ldr r1, [r0] + ldr r2, _080AE72C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE6E6 + movs r4, 0 + movs r0, 0xC8 + lsls r0, 1 + adds r5, r1, r0 +_080AE6BC: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE6CA + bl obj_delete_and_free_tiles +_080AE6CA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080AE6BC + ldr r0, _080AE728 + ldr r0, [r0] + ldr r1, _080AE72C + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, _080AE730 + bl gpu_tile_obj_free_by_tag +_080AE6E6: + ldr r0, _080AE728 + ldr r1, [r0] + ldr r2, _080AE734 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE720 + movs r4, 0 + movs r0, 0xF0 + lsls r0, 1 + adds r5, r1, r0 +_080AE6FC: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE70A + bl obj_delete_and_free_tiles +_080AE70A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _080AE6FC + ldr r0, _080AE728 + ldr r0, [r0] + ldr r1, _080AE734 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AE720: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE728: .4byte 0x0854c14c +_080AE72C: .4byte 0x00000716 +_080AE730: .4byte 0x00001204 +_080AE734: .4byte 0x00000717 + thumb_func_end sub_80AE6A4 + + thumb_func_start sub_80AE738 +sub_80AE738: @ 80AE738 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, _080AE7A8 + ldr r0, [r0] + ldr r1, _080AE7AC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE7E6 + ldr r0, _080AE7B0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _080AE7B4 + bl sub_80ABF4C + movs r7, 0 +_080AE758: + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + adds r6, r0, 0 + lsls r2, r6, 22 + asrs r2, 16 + ldr r0, _080AE7B8 + movs r1, 0 + movs r3, 0x1 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080AE7C0 + ldr r2, _080AE7A8 + ldr r5, [r2] + lsls r0, r7, 2 + movs r3, 0xC8 + lsls r3, 1 + adds r5, r3 + adds r5, r0 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r0, _080AE7BC + adds r4, r0 + str r4, [r5] + adds r0, r7, 0 + movs r1, 0x5 + str r2, [sp] + bl __umodsi3 + strh r0, [r4, 0x2E] + ldr r0, [r5] + strh r6, [r0, 0x30] + ldr r2, [sp] + b _080AE7D2 + .align 2, 0 +_080AE7A8: .4byte 0x0854c14c +_080AE7AC: .4byte 0x00000716 +_080AE7B0: .4byte 0x0854fddc +_080AE7B4: .4byte 0x0854c2b0 +_080AE7B8: .4byte 0x0854fdc4 +_080AE7BC: .4byte 0x02020630 +_080AE7C0: + ldr r2, _080AE7F0 + ldr r1, [r2] + lsls r0, r7, 2 + movs r3, 0xC8 + lsls r3, 1 + adds r1, r3 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080AE7D2: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x13 + bls _080AE758 + ldr r0, [r2] + ldr r1, _080AE7F4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AE7E6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AE7F0: .4byte 0x0854c14c +_080AE7F4: .4byte 0x00000716 + thumb_func_end sub_80AE738 + + thumb_func_start sub_80AE7F8 +sub_80AE7F8: @ 80AE7F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _080AE8A0 + ldr r0, [r4] + ldr r1, _080AE8A4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE8E4 + movs r7, 0 + mov r9, r4 + movs r2, 0 + mov r10, r2 +_080AE818: + lsls r0, r7, 1 + mov r8, r0 + adds r6, r0, r7 + lsls r5, r6, 4 + adds r1, r5, 0 + adds r1, 0x18 + lsls r1, 16 + asrs r1, 16 + ldr r0, _080AE8A8 + movs r2, 0xD0 + movs r3, 0x1 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080AE8BC + mov r2, r9 + ldr r4, [r2] + lsls r0, r7, 2 + movs r2, 0xF0 + lsls r2, 1 + adds r4, r2 + adds r4, r0 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + ldr r0, _080AE8AC + adds r2, r0 + str r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x3] + ldr r1, [r4] + adds r0, r6, r5 + strh r0, [r1, 0x30] + ldr r1, [r4] + movs r0, 0x8 + strh r0, [r1, 0x2E] + ldr r0, [r4] + mov r1, r10 + strh r1, [r0, 0x32] + ldr r1, [r4] + ldr r0, _080AE8B0 + strh r0, [r1, 0x36] + ldr r1, [r4] + ldr r0, _080AE8B4 + add r0, r8 + ldrh r0, [r0] + strh r0, [r1, 0x34] + ldr r0, [r4] + movs r1, 0x1 + bl obj_anim_image_start + ldr r0, [r4] + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl oam_center + ldr r1, [r4] + ldr r0, _080AE8B8 + str r0, [r1, 0x1C] + b _080AE8CE + .align 2, 0 +_080AE8A0: .4byte 0x0854c14c +_080AE8A4: .4byte 0x00000717 +_080AE8A8: .4byte 0x0854fdc4 +_080AE8AC: .4byte 0x02020630 +_080AE8B0: .4byte 0x00006730 +_080AE8B4: .4byte 0x0854fde4 +_080AE8B8: .4byte sub_80AE958 + 1 +_080AE8BC: + mov r2, r9 + ldr r0, [r2] + lsls r1, r7, 2 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r2 + adds r0, r1 + mov r1, r10 + str r1, [r0] +_080AE8CE: + mov r2, r9 + ldr r0, [r2] + ldr r1, _080AE8F4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x4 + bls _080AE818 +_080AE8E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AE8F4: .4byte 0x00000717 + thumb_func_end sub_80AE7F8 + + thumb_func_start sub_80AE8F8 +sub_80AE8F8: @ 80AE8F8 + push {r4,lr} + adds r3, r0, 0 + ldr r0, _080AE948 + ldr r1, [r0] + movs r2, 0xE2 + lsls r2, 3 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r3, 0x26] + ldr r4, _080AE94C + adds r2, r1, r4 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x2E + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, _080AE950 + cmp r1, r0 + ble _080AE940 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x2E + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, _080AE954 + ands r1, r0 + strh r1, [r3, 0x20] +_080AE940: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AE948: .4byte 0x0854c14c +_080AE94C: .4byte 0x0000070e +_080AE950: .4byte 0x010f0000 +_080AE954: .4byte 0x000001ff + thumb_func_end sub_80AE8F8 + + thumb_func_start sub_80AE958 +sub_80AE958: @ 80AE958 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x34] + subs r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080AE972 + ldr r0, _080AE978 + str r0, [r2, 0x1C] +_080AE972: + pop {r0} + bx r0 + .align 2, 0 +_080AE978: .4byte sub_80AE97C + 1 + thumb_func_end sub_80AE958 + + thumb_func_start sub_80AE97C +sub_80AE97C: @ 80AE97C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x22] + subs r0, 0x1 + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + negs r1, r1 + cmp r0, r1 + bge _080AE99A + movs r0, 0xD0 + strh r0, [r5, 0x22] + movs r0, 0x4 + strh r0, [r5, 0x2E] +_080AE99A: + movs r0, 0x2E + ldrsh r4, [r5, r0] + ldr r3, _080AE9EC + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r2, r4, 0 + muls r2, r0 + adds r1, 0x40 + lsls r1, 1 + adds r1, r3 + movs r3, 0 + ldrsh r0, [r1, r3] + muls r0, r4 + lsrs r2, 8 + strh r2, [r5, 0x24] + lsrs r0, 8 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x30] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080AE9E6 + movs r0, 0 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_080AE9E6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AE9EC: .4byte 0x08329f40 + thumb_func_end sub_80AE97C + + thumb_func_start sub_80AE9F0 +sub_80AE9F0: @ 80AE9F0 + ldr r0, _080AEA10 + ldr r1, [r0] + ldr r0, _080AEA14 + adds r2, r1, r0 + movs r0, 0 + strh r0, [r2] + ldr r0, _080AEA18 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + ldr r0, _080AEA1C + adds r1, r0 + movs r0, 0x14 + strb r0, [r1] + bx lr + .align 2, 0 +_080AEA10: .4byte 0x0854c14c +_080AEA14: .4byte 0x000006cc +_080AEA18: .4byte 0x000006c1 +_080AEA1C: .4byte 0x000006c2 + thumb_func_end sub_80AE9F0 + + thumb_func_start sub_80AEA20 +sub_80AEA20: @ 80AEA20 + push {lr} + bl sub_80AE9F0 + pop {r0} + bx r0 + thumb_func_end sub_80AEA20 + + thumb_func_start nullsub_96 +nullsub_96: @ 80AEA2C + bx lr + thumb_func_end nullsub_96 + + thumb_func_start sub_80AEA30 +sub_80AEA30: @ 80AEA30 + movs r0, 0 + bx lr + thumb_func_end sub_80AEA30 + + thumb_func_start sub_80AEA34 +sub_80AEA34: @ 80AEA34 + push {r4,r5,lr} + bl sub_80ADA60 + ldr r0, _080AEA74 + ldr r4, [r0] + ldr r1, _080AEA78 + adds r0, r4, r1 + ldrb r5, [r0] + cmp r5, 0 + bne _080AEA6C + ldr r0, _080AEA7C + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r2, 0xE5 + lsls r2, 3 + adds r0, r4, r2 + strh r5, [r0] + ldr r0, _080AEA80 + ldrb r1, [r0] + subs r2, 0x2 + adds r0, r4, r2 + strh r1, [r0] + ldr r1, _080AEA84 + adds r0, r4, r1 + strh r5, [r0] + adds r2, 0x6 + adds r0, r4, r2 + strh r5, [r0] +_080AEA6C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AEA74: .4byte 0x0854c14c +_080AEA78: .4byte 0x0000072e +_080AEA7C: .4byte 0x0854fdf8 +_080AEA80: .4byte 0x0854fdf0 +_080AEA84: .4byte 0x0000072a + thumb_func_end sub_80AEA34 + + thumb_func_start sub_80AEA88 +sub_80AEA88: @ 80AEA88 + push {r4,lr} + bl sub_80AEA34 + ldr r0, _080AEAB0 + ldr r1, [r0] + ldr r2, _080AEAB4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AEAA8 + adds r4, r1, r2 +_080AEA9E: + bl sub_80AEAB8 + ldrb r0, [r4] + cmp r0, 0 + beq _080AEA9E +_080AEAA8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AEAB0: .4byte 0x0854c14c +_080AEAB4: .4byte 0x000006d2 + thumb_func_end sub_80AEA88 + + thumb_func_start sub_80AEAB8 +sub_80AEAB8: @ 80AEAB8 + push {r4-r7,lr} + bl sub_80ADAF0 + ldr r0, _080AEB18 + ldr r5, [r0] + ldr r0, _080AEB1C + adds r4, r5, r0 + ldrh r0, [r4] + adds r0, 0x1 + movs r6, 0 + strh r0, [r4] + ldr r1, _080AEB20 + adds r7, r1, 0 + ldr r2, _080AEB24 + movs r1, 0xE5 + lsls r1, 3 + adds r3, r5, r1 + ldrh r1, [r3] + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bls _080AEB10 + strh r6, [r4] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] + ands r0, r7 + cmp r0, 0x7 + bls _080AEAF8 + strh r6, [r3] +_080AEAF8: + ldr r0, _080AEB28 + adds r4, r5, r0 + ldrh r0, [r4] + bl sub_80AEB48 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ands r0, r7 + cmp r0, 0xC + bls _080AEB10 + strh r6, [r4] +_080AEB10: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AEB18: .4byte 0x0854c14c +_080AEB1C: .4byte 0x00000726 +_080AEB20: .4byte 0x0000ffff +_080AEB24: .4byte 0x0854fdf0 +_080AEB28: .4byte 0x0000072a + thumb_func_end sub_80AEAB8 + + thumb_func_start sub_80AEB2C +sub_80AEB2C: @ 80AEB2C + push {lr} + bl sub_80ADBB0 + lsls r0, 24 + cmp r0, 0 + beq _080AEB3C + movs r0, 0x1 + b _080AEB42 +_080AEB3C: + bl sub_80AEBD0 + movs r0, 0 +_080AEB42: + pop {r1} + bx r1 + thumb_func_end sub_80AEB2C + + thumb_func_start sub_80AEB48 +sub_80AEB48: @ 80AEB48 + push {r4,lr} + lsls r0, 16 + ldr r1, _080AEBB8 + lsrs r0, 14 + adds r3, r0, r1 + adds r1, 0x2 + adds r0, r1 + ldr r1, _080AEBBC + ldrh r2, [r0] + ldrh r0, [r1] + subs r2, r0 + ldr r0, _080AEBC0 + movs r4, 0 + ldrsh r1, [r3, r4] + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080AEBB0 + ldr r0, _080AEBC4 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x5] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + movs r0, 0 + strh r0, [r1, 0x2E] + strh r0, [r1, 0x30] + strh r0, [r1, 0x32] + ldr r0, _080AEBC8 + ldr r1, [r0] + ldr r0, _080AEBCC + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080AEBB0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AEBB8: .4byte 0x0854fe00 +_080AEBBC: .4byte 0x02021bbe +_080AEBC0: .4byte 0x0854fe44 +_080AEBC4: .4byte 0x02020630 +_080AEBC8: .4byte 0x0854c14c +_080AEBCC: .4byte 0x0000072c + thumb_func_end sub_80AEB48 + + thumb_func_start sub_80AEBD0 +sub_80AEBD0: @ 80AEBD0 + push {r4,r5,lr} + ldr r0, _080AEC20 + ldr r0, [r0] + ldr r1, _080AEC24 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080AEC1A + movs r4, 0 + ldr r5, _080AEC28 +_080AEBE4: + lsls r0, r4, 4 + adds r0, r4 + lsls r2, r0, 2 + adds r0, r5, 0 + adds r0, 0x14 + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, _080AEC2C + cmp r1, r0 + bne _080AEBFE + adds r0, r2, r5 + bl obj_delete_and_free_tiles +_080AEBFE: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3F + bls _080AEBE4 + ldr r0, _080AEC30 + bl gpu_tile_obj_free_by_tag + ldr r0, _080AEC20 + ldr r0, [r0] + ldr r1, _080AEC24 + adds r0, r1 + movs r1, 0 + strh r1, [r0] +_080AEC1A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AEC20: .4byte 0x0854c14c +_080AEC24: .4byte 0x0000072c +_080AEC28: .4byte 0x02020630 +_080AEC2C: .4byte 0x0854fe44 +_080AEC30: .4byte 0x00001205 + thumb_func_end sub_80AEBD0 + + thumb_func_start unc_0807DAB4 +unc_0807DAB4: @ 80AEC34 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + movs r2, 0 + adds r0, 0x2 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080AEC74 + strh r2, [r1, 0x2E] + movs r3, 0x30 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _080AEC66 + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080AEC74 + movs r0, 0x1 + strh r0, [r1, 0x30] + b _080AEC74 +_080AEC66: + ldrh r0, [r1, 0x24] + subs r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + cmp r0, 0 + bgt _080AEC74 + strh r2, [r1, 0x30] +_080AEC74: + ldrh r0, [r1, 0x22] + subs r0, 0x3 + strh r0, [r1, 0x22] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x77 + ble _080AEC8E + adds r0, r1, 0 + bl obj_delete_and_free_tiles +_080AEC8E: + pop {r0} + bx r0 + thumb_func_end unc_0807DAB4 + + thumb_func_start sub_80AEC94 +sub_80AEC94: @ 80AEC94 + ldr r2, _080AECA0 + strb r0, [r2] + ldr r0, _080AECA4 + strh r1, [r0] + bx lr + .align 2, 0 +_080AECA0: .4byte 0x02038bc4 +_080AECA4: .4byte 0x02038bc6 + thumb_func_end sub_80AEC94 + + thumb_func_start sub_80AECA8 +sub_80AECA8: @ 80AECA8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080AECC8 + adds r4, r1, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080AECCC + cmp r0, 0x1 + beq _080AECF8 + b _080AED1C + .align 2, 0 +_080AECC8: .4byte 0x03005e08 +_080AECCC: + ldrh r0, [r4, 0x1E] + subs r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + cmp r0, 0 + bgt _080AED1C + ldrb r0, [r4, 0x2] + bl weather_set + ldr r1, _080AECF4 + ldrh r0, [r4, 0x2] + strb r0, [r1] + movs r1, 0x96 + lsls r1, 2 + adds r0, r1, 0 + strh r0, [r4, 0x1E] + ldrh r0, [r4] + adds r0, 0x1 + b _080AED1A + .align 2, 0 +_080AECF4: .4byte 0x02038bc4 +_080AECF8: + ldrh r0, [r4, 0x1E] + subs r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + cmp r0, 0 + bgt _080AED1C + ldrb r0, [r4, 0x4] + bl weather_set + ldr r1, _080AED24 + ldrh r0, [r4, 0x4] + strb r0, [r1] + movs r1, 0x96 + lsls r1, 2 + adds r0, r1, 0 + strh r0, [r4, 0x1E] + movs r0, 0 +_080AED1A: + strh r0, [r4] +_080AED1C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AED24: .4byte 0x02038bc4 + thumb_func_end sub_80AECA8 + + thumb_func_start bag_add_task0_by_acit +bag_add_task0_by_acit: @ 80AED28 + push {lr} + ldr r0, _080AED54 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080AED58 + adds r1, r0 + movs r2, 0x96 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1, 0x1E] + ldr r3, _080AED5C + ldrb r2, [r3] + cmp r2, 0xD + bne _080AED60 + movs r0, 0xC + b _080AED66 + .align 2, 0 +_080AED54: .4byte sub_80AECA8 + 1 +_080AED58: .4byte 0x03005e08 +_080AED5C: .4byte 0x02038bc4 +_080AED60: + cmp r2, 0xC + bne _080AED6C + movs r0, 0xD +_080AED66: + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + b _080AED78 +_080AED6C: + movs r0, 0xD + strb r0, [r3] + movs r0, 0xC + strh r0, [r1, 0x2] + movs r0, 0xD + strh r0, [r1, 0x4] +_080AED78: + pop {r0} + bx r0 + thumb_func_end bag_add_task0_by_acit + + thumb_func_start sub_80AED7C +sub_80AED7C: @ 80AED7C + push {r4,r5,lr} + ldr r4, _080AEDA8 + ldr r1, [r4] + adds r1, 0x2E + ldrb r5, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_80AEEE8 + ldr r1, [r4] + adds r1, 0x2E + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x2E + ldrb r0, [r0] + adds r1, r5, 0 + bl sub_80AEFDC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AEDA8: .4byte 0x03005d8c + thumb_func_end sub_80AED7C + + thumb_func_start sav1_get_weather_probably +sav1_get_weather_probably: @ 80AEDAC + ldr r0, _080AEDB8 + ldr r0, [r0] + adds r0, 0x2E + ldrb r0, [r0] + bx lr + .align 2, 0 +_080AEDB8: .4byte 0x03005d8c + thumb_func_end sav1_get_weather_probably + + thumb_func_start sub_80AEDBC +sub_80AEDBC: @ 80AEDBC + push {r4,r5,lr} + ldr r4, _080AEDE8 + ldr r0, [r4] + adds r0, 0x2E + ldrb r5, [r0] + ldr r0, _080AEDEC + ldrb r0, [r0, 0x16] + bl sub_80AEEE8 + ldr r1, [r4] + adds r1, 0x2E + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x2E + ldrb r0, [r0] + adds r1, r5, 0 + bl sub_80AEFDC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AEDE8: .4byte 0x03005d8c +_080AEDEC: .4byte 0x02037318 + thumb_func_end sub_80AEDBC + + thumb_func_start sub_80AEDF0 +sub_80AEDF0: @ 80AEDF0 + push {lr} + bl sub_80AED7C + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + bl weather_set + pop {r0} + bx r0 + thumb_func_end sub_80AEDF0 + + thumb_func_start sub_80AEE08 +sub_80AEE08: @ 80AEE08 + push {lr} + bl sub_80AED7C + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + bl sub_80AB104 + pop {r0} + bx r0 + thumb_func_end sub_80AEE08 + + thumb_func_start sub_80AEE20 +sub_80AEE20: @ 80AEE20 + push {r4,r5,lr} + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bne _080AEE4C + ldr r0, _080AEE44 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080AEE3E + bl bag_add_task0_by_acit +_080AEE3E: + ldr r0, _080AEE48 + ldrb r4, [r0] + b _080AEE6E + .align 2, 0 +_080AEE44: .4byte sub_80AECA8 + 1 +_080AEE48: .4byte 0x02038bc4 +_080AEE4C: + ldr r5, _080AEE7C + adds r0, r5, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _080AEE68 + adds r0, r5, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080AEE68: + ldr r1, _080AEE80 + movs r0, 0xD + strb r0, [r1] +_080AEE6E: + adds r0, r4, 0 + bl weather_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AEE7C: .4byte sub_80AECA8 + 1 +_080AEE80: .4byte 0x02038bc4 + thumb_func_end sub_80AEE20 + + thumb_func_start sub_80AEE84 +sub_80AEE84: @ 80AEE84 + push {r4,r5,lr} + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bne _080AEEB0 + ldr r0, _080AEEA8 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080AEEA2 + bl bag_add_task0_by_acit +_080AEEA2: + ldr r0, _080AEEAC + ldrb r4, [r0] + b _080AEED2 + .align 2, 0 +_080AEEA8: .4byte sub_80AECA8 + 1 +_080AEEAC: .4byte 0x02038bc4 +_080AEEB0: + ldr r5, _080AEEE0 + adds r0, r5, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _080AEECC + adds r0, r5, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080AEECC: + ldr r1, _080AEEE4 + movs r0, 0xD + strb r0, [r1] +_080AEED2: + adds r0, r4, 0 + bl sub_80AB104 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AEEE0: .4byte sub_80AECA8 + 1 +_080AEEE4: .4byte 0x02038bc4 + thumb_func_end sub_80AEE84 + + thumb_func_start sub_80AEEE8 +sub_80AEEE8: @ 80AEEE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + bhi _080AEFB4 + lsls r0, 2 + ldr r1, _080AEEFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AEEFC: .4byte _080AEF00 + .align 2, 0 +_080AEF00: + .4byte _080AEFB4 + .4byte _080AEF58 + .4byte _080AEF5C + .4byte _080AEF60 + .4byte _080AEF64 + .4byte _080AEF68 + .4byte _080AEF6C + .4byte _080AEF70 + .4byte _080AEF74 + .4byte _080AEF78 + .4byte _080AEF7C + .4byte _080AEF80 + .4byte _080AEF84 + .4byte _080AEF88 + .4byte _080AEF8C + .4byte _080AEF90 + .4byte _080AEFB4 + .4byte _080AEFB4 + .4byte _080AEFB4 + .4byte _080AEFB4 + .4byte _080AEF94 + .4byte _080AEF9C +_080AEF58: + movs r0, 0x1 + b _080AEFB6 +_080AEF5C: + movs r0, 0x2 + b _080AEFB6 +_080AEF60: + movs r0, 0x3 + b _080AEFB6 +_080AEF64: + movs r0, 0x4 + b _080AEFB6 +_080AEF68: + movs r0, 0x5 + b _080AEFB6 +_080AEF6C: + movs r0, 0x6 + b _080AEFB6 +_080AEF70: + movs r0, 0x7 + b _080AEFB6 +_080AEF74: + movs r0, 0x8 + b _080AEFB6 +_080AEF78: + movs r0, 0x9 + b _080AEFB6 +_080AEF7C: + movs r0, 0xA + b _080AEFB6 +_080AEF80: + movs r0, 0xB + b _080AEFB6 +_080AEF84: + movs r0, 0xC + b _080AEFB6 +_080AEF88: + movs r0, 0xD + b _080AEFB6 +_080AEF8C: + movs r0, 0xE + b _080AEFB6 +_080AEF90: + movs r0, 0xF + b _080AEFB6 +_080AEF94: + ldr r1, _080AEF98 + b _080AEF9E + .align 2, 0 +_080AEF98: .4byte 0x0854fe5c +_080AEF9C: + ldr r1, _080AEFAC +_080AEF9E: + ldr r0, _080AEFB0 + ldr r0, [r0] + adds r0, 0x2F + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + b _080AEFB6 + .align 2, 0 +_080AEFAC: .4byte 0x0854fe60 +_080AEFB0: .4byte 0x03005d8c +_080AEFB4: + movs r0, 0 +_080AEFB6: + pop {r1} + bx r1 + thumb_func_end sub_80AEEE8 + + thumb_func_start sub_80AEFBC +sub_80AEFBC: @ 80AEFBC + lsls r0, 16 + ldr r1, _080AEFD8 + ldr r2, [r1] + adds r2, 0x2F + lsrs r0, 16 + ldrb r1, [r2] + adds r0, r1 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 16 + strb r1, [r2] + bx lr + .align 2, 0 +_080AEFD8: .4byte 0x03005d8c + thumb_func_end sub_80AEFBC + + thumb_func_start sub_80AEFDC +sub_80AEFDC: @ 80AEFDC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r0, 24 + cmp r0, r1 + beq _080AEFF6 + cmp r2, 0x3 + beq _080AEFF0 + cmp r2, 0x5 + bne _080AEFF6 +_080AEFF0: + movs r0, 0x28 + bl sav12_xor_increment +_080AEFF6: + pop {r0} + bx r0 + thumb_func_end sub_80AEFDC + + thumb_func_start palette_bg_faded_fill_white +palette_bg_faded_fill_white: @ 80AEFFC + push {lr} + sub sp, 0x4 + ldr r0, _080AF014 + str r0, [sp] + ldr r1, _080AF018 + ldr r2, _080AF01C + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080AF014: .4byte 0x7fff7fff +_080AF018: .4byte 0x02037b14 +_080AF01C: .4byte 0x01000100 + thumb_func_end palette_bg_faded_fill_white + + thumb_func_start palette_bg_faded_fill_black +palette_bg_faded_fill_black: @ 80AF020 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r1, _080AF038 + ldr r2, _080AF03C + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080AF038: .4byte 0x02037b14 +_080AF03C: .4byte 0x01000100 + thumb_func_end palette_bg_faded_fill_black + + thumb_func_start pal_fill_for_maplights +pal_fill_for_maplights: @ 80AF040 + push {r4,lr} + bl get_map_light_from_warp0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sav1_map_get_light_level + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl fade_type_for_given_maplight_pair + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080AF06A + cmp r0, 0x1 + beq _080AF078 + b _080AF084 +_080AF06A: + bl palette_bg_faded_fill_black + movs r0, 0 + movs r1, 0 + bl fade_screen + b _080AF084 +_080AF078: + bl palette_bg_faded_fill_white + movs r0, 0x2 + movs r1, 0 + bl fade_screen +_080AF084: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pal_fill_for_maplights + + thumb_func_start sub_80AF08C +sub_80AF08C: @ 80AF08C + push {lr} + bl palette_bg_faded_fill_white + movs r0, 0x2 + movs r1, 0x8 + bl fade_screen + pop {r0} + bx r0 + thumb_func_end sub_80AF08C + + thumb_func_start pal_fill_black +pal_fill_black: @ 80AF0A0 + push {lr} + bl palette_bg_faded_fill_black + movs r0, 0 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + thumb_func_end pal_fill_black + + thumb_func_start sub_80AF0B4 +sub_80AF0B4: @ 80AF0B4 + push {r4,lr} + bl sav1_map_get_light_level + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl warp1_get_mapheader + ldrb r1, [r0, 0x17] + adds r0, r4, 0 + bl sub_8137360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080AF0DA + cmp r0, 0x1 + beq _080AF0E4 + b _080AF0EC +_080AF0DA: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _080AF0EC +_080AF0E4: + movs r0, 0x3 + movs r1, 0 + bl fade_screen +_080AF0EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF0B4 + + thumb_func_start sub_80AF0F4 +sub_80AF0F4: @ 80AF0F4 + push {lr} + lsls r0, 24 + movs r1, 0 + cmp r0, 0 + bne _080AF100 + movs r1, 0x1 +_080AF100: + adds r0, r1, 0 + bl sub_808C0A8 + pop {r0} + bx r0 + thumb_func_end sub_80AF0F4 + + thumb_func_start task0A_nop_for_a_while +task0A_nop_for_a_while: @ 80AF10C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF120 + adds r0, r4, 0 + bl remove_task +_080AF120: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task0A_nop_for_a_while + + thumb_func_start sub_80AF128 +sub_80AF128: @ 80AF128 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl pal_fill_black + ldr r0, _080AF144 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF144: .4byte task0A_nop_for_a_while + 1 + thumb_func_end sub_80AF128 + + thumb_func_start task0A_asap_script_env_2_enable_and_set_ctx_running +task0A_asap_script_env_2_enable_and_set_ctx_running: @ 80AF148 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF160 + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080AF160: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task0A_asap_script_env_2_enable_and_set_ctx_running + + thumb_func_start sub_80AF168 +sub_80AF168: @ 80AF168 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl pal_fill_black + ldr r0, _080AF184 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF184: .4byte task0A_asap_script_env_2_enable_and_set_ctx_running + 1 + thumb_func_end sub_80AF168 + + thumb_func_start sub_80AF188 +sub_80AF188: @ 80AF188 + push {lr} + bl script_env_2_enable + bl pal_fill_black + ldr r0, _080AF1A0 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF1A0: .4byte task0A_asap_script_env_2_enable_and_set_ctx_running + 1 + thumb_func_end sub_80AF188 + + thumb_func_start task_mpl_807DD60 +task_mpl_807DD60: @ 80AF1A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r2, _080AF1C8 + adds r4, r0, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF1DE + cmp r0, 0x1 + bgt _080AF1CC + cmp r0, 0 + beq _080AF1D2 + b _080AF20E + .align 2, 0 +_080AF1C8: .4byte 0x03005e00 +_080AF1CC: + cmp r0, 0x2 + beq _080AF1FC + b _080AF20E +_080AF1D2: + bl sub_80B3050 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + b _080AF1F4 +_080AF1DE: + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AF20E + bl pal_fill_for_maplights +_080AF1F4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF20E +_080AF1FC: + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF20E + bl script_env_2_disable + adds r0, r5, 0 + bl remove_task +_080AF20E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_mpl_807DD60 + + thumb_func_start sub_80AF214 +sub_80AF214: @ 80AF214 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl palette_bg_faded_fill_black + ldr r0, _080AF230 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF230: .4byte task_mpl_807DD60 + 1 + thumb_func_end sub_80AF214 + + thumb_func_start sub_80AF234 +sub_80AF234: @ 80AF234 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AF258 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF268 + cmp r0, 0x1 + bgt _080AF25C + cmp r0, 0 + beq _080AF262 + b _080AF2AE + .align 2, 0 +_080AF258: .4byte 0x03005e00 +_080AF25C: + cmp r0, 0x2 + beq _080AF298 + b _080AF2AE +_080AF262: + bl sub_800ADF8 + b _080AF290 +_080AF268: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080AF28C + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + movs r1, 0xE1 + lsls r1, 19 + cmp r0, r1 + ble _080AF2AE + movs r0, 0xC0 + lsls r0, 7 + bl sub_8011170 + b _080AF2AE +_080AF28C: + bl pal_fill_for_maplights +_080AF290: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF2AE +_080AF298: + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF2AE + bl sub_8009F18 + bl script_env_2_disable + adds r0, r5, 0 + bl remove_task +_080AF2AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AF234 + + thumb_func_start sub_80AF2B4 +sub_80AF2B4: @ 80AF2B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AF2D8 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF2E8 + cmp r0, 0x1 + bgt _080AF2DC + cmp r0, 0 + beq _080AF2E2 + b _080AF30C + .align 2, 0 +_080AF2D8: .4byte 0x03005e00 +_080AF2DC: + cmp r0, 0x2 + beq _080AF2FA + b _080AF30C +_080AF2E2: + bl sub_800ADF8 + b _080AF2F2 +_080AF2E8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080AF30C +_080AF2F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF30C +_080AF2FA: + bl sub_8009F18 + bl sub_8086C2C + bl script_env_2_disable + adds r0, r5, 0 + bl remove_task +_080AF30C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AF2B4 + + thumb_func_start sub_80AF314 +sub_80AF314: @ 80AF314 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl palette_bg_faded_fill_black + ldr r0, _080AF330 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF330: .4byte sub_80AF234 + 1 + thumb_func_end sub_80AF314 + + thumb_func_start sub_80AF334 +sub_80AF334: @ 80AF334 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088EFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080AF36C + ldr r1, _080AF368 + b _080AF37E + .align 2, 0 +_080AF368: .4byte sub_80AF438 + 1 +_080AF36C: + adds r0, r4, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080AF390 + cmp r0, 0x1 + bne _080AF37E + ldr r1, _080AF394 +_080AF37E: + adds r0, r1, 0 + movs r1, 0xA + bl AddTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AF390: .4byte task_map_chg_seq_0807E2CC + 1 +_080AF394: .4byte task_map_chg_seq_0807E20C + 1 + thumb_func_end sub_80AF334 + + thumb_func_start mapldr_default +mapldr_default: @ 80AF398 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl sub_80AF334 + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end mapldr_default + + thumb_func_start sub_80AF3B0 +sub_80AF3B0: @ 80AF3B0 + push {lr} + bl sub_8085784 + bl sub_80AF08C + bl sub_80AF334 + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_80AF3B0 + + thumb_func_start sub_80AF3C8 +sub_80AF3C8: @ 80AF3C8 + push {lr} + bl sub_81D6534 + cmp r0, 0 + bne _080AF3D6 + bl sub_8085784 +_080AF3D6: + bl pal_fill_black + bl sub_80AF334 + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_80AF3C8 + + thumb_func_start sub_80AF3E8 +sub_80AF3E8: @ 80AF3E8 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + movs r0, 0x2E + bl audio_play + ldr r0, _080AF408 + movs r1, 0xA + bl AddTask + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_080AF408: .4byte task0A_mpl_807E31C + 1 + thumb_func_end sub_80AF3E8 + + thumb_func_start sub_80AF40C +sub_80AF40C: @ 80AF40C + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + movs r0, 0x2E + bl audio_play + ldr r0, _080AF434 + movs r1, 0xA + bl AddTask + bl script_env_2_enable + movs r0, 0xE + bl sub_8085540 + pop {r0} + bx r0 + .align 2, 0 +_080AF434: .4byte task_map_chg_seq_0807E2CC + 1 + thumb_func_end sub_80AF40C + + thumb_func_start sub_80AF438 +sub_80AF438: @ 80AF438 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080AF464 + adds r5, r0, r1 + adds r6, r5, 0 + adds r6, 0xC + adds r7, r5, 0 + adds r7, 0xE + movs r2, 0x8 + ldrsh r0, [r5, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080AF54A + lsls r0, 2 + ldr r1, _080AF468 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AF464: .4byte 0x03005e00 +_080AF468: .4byte _080AF46C + .align 2, 0 +_080AF46C: + .4byte _080AF480 + .4byte _080AF4A4 + .4byte _080AF4DC + .4byte _080AF520 + .4byte _080AF540 +_080AF480: + movs r0, 0 + bl sub_80AF0F4 + bl player_bitmagic + adds r0, r6, 0 + adds r1, r7, 0 + bl player_get_pos_to + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_808A854 + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AF54A +_080AF4A4: + bl sub_80AF71C + cmp r0, 0 + beq _080AF54A + movs r0, 0x1 + bl sub_80AF0F4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080AF4D8 + adds r0, r1 + movs r1, 0x8 + bl npc_set_state_2 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AF54A + .align 2, 0 +_080AF4D8: .4byte 0x02037350 +_080AF4DC: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AF54A + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_808A8AC + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080AF51C + adds r0, r1 + bl sub_8093284 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AF54A + .align 2, 0 +_080AF51C: .4byte 0x02037350 +_080AF520: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AF536 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AF54A +_080AF536: + bl sub_809757C + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080AF54A +_080AF540: + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task +_080AF54A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AF438 + + thumb_func_start task_map_chg_seq_0807E20C +task_map_chg_seq_0807E20C: @ 80AF550 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080AF57C + adds r5, r0, r1 + adds r6, r5, 0 + adds r6, 0xC + adds r7, r5, 0 + adds r7, 0xE + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080AF5A2 + cmp r0, 0x1 + bgt _080AF580 + cmp r0, 0 + beq _080AF58A + b _080AF60A + .align 2, 0 +_080AF57C: .4byte 0x03005e00 +_080AF580: + cmp r0, 0x2 + beq _080AF5EC + cmp r0, 0x3 + beq _080AF600 + b _080AF60A +_080AF58A: + movs r0, 0 + bl sub_80AF0F4 + bl player_bitmagic + adds r0, r6, 0 + adds r1, r7, 0 + bl player_get_pos_to + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AF60A +_080AF5A2: + bl sub_80AF71C + cmp r0, 0 + beq _080AF60A + movs r0, 0x1 + bl sub_80AF0F4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080AF5E8 + adds r4, r0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl sub_8093388 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AF60A + .align 2, 0 +_080AF5E8: .4byte 0x02037350 +_080AF5EC: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AF60A + bl sub_809757C + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AF60A +_080AF600: + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task +_080AF60A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task_map_chg_seq_0807E20C + + thumb_func_start task_map_chg_seq_0807E2CC +task_map_chg_seq_0807E2CC: @ 80AF610 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080AF630 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080AF634 + cmp r0, 0x1 + beq _080AF644 + b _080AF65A + .align 2, 0 +_080AF630: .4byte 0x03005e00 +_080AF634: + bl player_bitmagic + bl script_env_2_enable + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF65A +_080AF644: + bl sub_80AF71C + cmp r0, 0 + beq _080AF65A + bl sub_809757C + bl script_env_2_disable + adds r0, r5, 0 + bl remove_task +_080AF65A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_map_chg_seq_0807E2CC + + thumb_func_start sub_80AF660 +sub_80AF660: @ 80AF660 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF67C + adds r0, r4, 0 + bl remove_task + ldr r0, _080AF684 + movs r1, 0x50 + bl AddTask +_080AF67C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AF684: .4byte sub_809FA34 + 1 + thumb_func_end sub_80AF660 + + thumb_func_start sub_80AF688 +sub_80AF688: @ 80AF688 + push {lr} + bl pal_fill_black + ldr r0, _080AF6A0 + movs r1, 0x50 + bl AddTask + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_080AF6A0: .4byte sub_80AF660 + 1 + thumb_func_end sub_80AF688 + + thumb_func_start sub_80AF6A4 +sub_80AF6A4: @ 80AF6A4 + push {lr} + bl sub_809FA18 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80AF6A4 + + thumb_func_start task_mpl_807E3C8 +task_mpl_807E3C8: @ 80AF6B0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF6CC + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task + bl sub_80984F4 +_080AF6CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_mpl_807E3C8 + + thumb_func_start sub_80AF6D4 +sub_80AF6D4: @ 80AF6D4 + push {lr} + bl script_env_2_enable + bl pal_fill_black + ldr r0, _080AF6EC + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF6EC: .4byte task_mpl_807E3C8 + 1 + thumb_func_end sub_80AF6D4 + + thumb_func_start sub_80AF6F0 +sub_80AF6F0: @ 80AF6F0 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl pal_fill_black + ldr r0, _080AF70C + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF70C: .4byte task_mpl_807E3C8 + 1 + thumb_func_end sub_80AF6F0 + + thumb_func_start sub_80AF710 +sub_80AF710: @ 80AF710 + ldr r0, _080AF718 + ldrb r0, [r0, 0x7] + lsrs r0, 7 + bx lr + .align 2, 0 +_080AF718: .4byte 0x02037fd4 + thumb_func_end sub_80AF710 + + thumb_func_start sub_80AF71C +sub_80AF71C: @ 80AF71C + push {lr} + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080AF72E + movs r0, 0 + b _080AF730 +_080AF72E: + movs r0, 0x1 +_080AF730: + pop {r1} + bx r1 + thumb_func_end sub_80AF71C + + thumb_func_start sub_80AF734 +sub_80AF734: @ 80AF734 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0x9 + bl audio_play + ldr r0, _080AF760 + ldr r1, _080AF764 + str r1, [r0] + ldr r0, _080AF768 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF760: .4byte 0x03005dac +_080AF764: .4byte mapldr_default + 1 +_080AF768: .4byte sub_80AFA0C + 1 + thumb_func_end sub_80AF734 + + thumb_func_start sp13E_warp_to_last_warp +sp13E_warp_to_last_warp: @ 80AF76C + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + ldr r0, _080AF790 + ldr r1, _080AF794 + str r1, [r0] + ldr r0, _080AF798 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF790: .4byte 0x03005dac +_080AF794: .4byte mapldr_default + 1 +_080AF798: .4byte sub_80AFA0C + 1 + thumb_func_end sp13E_warp_to_last_warp + + thumb_func_start sub_80AF79C +sub_80AF79C: @ 80AF79C + push {lr} + bl script_env_2_enable + bl music_something + movs r0, 0x3 + movs r1, 0x8 + bl fade_screen + bl play_some_sound + ldr r0, _080AF7C4 + ldr r1, _080AF7C8 + str r1, [r0] + ldr r0, _080AF7CC + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF7C4: .4byte 0x03005dac +_080AF7C8: .4byte sub_80AF3B0 + 1 +_080AF7CC: .4byte sub_80AFA0C + 1 + thumb_func_end sub_80AF79C + + thumb_func_start sub_80AF7D0 +sub_80AF7D0: @ 80AF7D0 + push {lr} + bl script_env_2_enable + ldr r0, _080AF7E8 + ldr r1, _080AF7EC + str r1, [r0] + ldr r0, _080AF7F0 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF7E8: .4byte 0x03005dac +_080AF7EC: .4byte mapldr_default + 1 +_080AF7F0: .4byte sub_80AFA88 + 1 + thumb_func_end sub_80AF7D0 + + thumb_func_start sp13F_fall_to_last_warp +sp13F_fall_to_last_warp: @ 80AF7F4 + push {lr} + bl sp13E_warp_to_last_warp + ldr r1, _080AF804 + ldr r0, _080AF808 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080AF804: .4byte 0x03005dac +_080AF808: .4byte sub_80B6B68 + 1 + thumb_func_end sp13F_fall_to_last_warp + + thumb_func_start sub_80AF80C +sub_80AF80C: @ 80AF80C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + adds r0, r4, 0 + movs r1, 0xA + bl sub_80B6E4C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF80C + + thumb_func_start sub_80AF828 +sub_80AF828: @ 80AF828 + push {lr} + bl script_env_2_enable + movs r0, 0xA + bl sub_80B75D8 + pop {r0} + bx r0 + thumb_func_end sub_80AF828 + + thumb_func_start sub_80AF838 +sub_80AF838: @ 80AF838 + push {lr} + bl script_env_2_enable + movs r0, 0xA + bl sub_80B7A74 + pop {r0} + bx r0 + thumb_func_end sub_80AF838 + + thumb_func_start sub_80AF848 +sub_80AF848: @ 80AF848 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + movs r0, 0x2D + bl audio_play + ldr r0, _080AF870 + movs r1, 0xA + bl AddTask + ldr r1, _080AF874 + ldr r0, _080AF878 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080AF870: .4byte sub_80AFA0C + 1 +_080AF874: .4byte 0x03005dac +_080AF878: .4byte sub_80AF3E8 + 1 + thumb_func_end sub_80AF848 + + thumb_func_start sub_80AF87C +sub_80AF87C: @ 80AF87C + push {lr} + movs r0, 0x1 + bl sub_8085540 + bl script_env_2_enable + bl save_serialize_npcs + bl music_something + bl sub_80AF0B4 + movs r0, 0x2D + bl audio_play + ldr r0, _080AF8AC + movs r1, 0xA + bl AddTask + ldr r1, _080AF8B0 + ldr r0, _080AF8B4 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080AF8AC: .4byte sub_80AFA0C + 1 +_080AF8B0: .4byte 0x03005dac +_080AF8B4: .4byte sub_80AF40C + 1 + thumb_func_end sub_80AF87C + + thumb_func_start sub_80AF8B8 +sub_80AF8B8: @ 80AF8B8 + push {lr} + bl script_env_2_enable + bl sub_80AF0B4 + ldr r0, _080AF8D4 + movs r1, 0xA + bl AddTask + ldr r1, _080AF8D8 + ldr r0, _080AF8DC + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080AF8D4: .4byte sub_80AFA0C + 1 +_080AF8D8: .4byte 0x03005dac +_080AF8DC: .4byte sub_80FB768 + 1 + thumb_func_end sub_80AF8B8 + + thumb_func_start sub_80AF8E0 +sub_80AF8E0: @ 80AF8E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AF904 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF914 + cmp r0, 0x1 + bgt _080AF908 + cmp r0, 0 + beq _080AF90E + b _080AF93E + .align 2, 0 +_080AF904: .4byte 0x03005e00 +_080AF908: + cmp r0, 0x2 + beq _080AF92E + b _080AF93E +_080AF90E: + bl script_env_2_enable + b _080AF926 +_080AF914: + bl sub_80AF710 + cmp r0, 0 + bne _080AF93E + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AF93E +_080AF926: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF93E +_080AF92E: + bl warp_in + ldr r0, _080AF944 + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_080AF93E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AF944: .4byte sub_8086074 + 1 + thumb_func_end sub_80AF8E0 + + thumb_func_start sub_80AF948 +sub_80AF948: @ 80AF948 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + movs r0, 0x9 + bl audio_play + ldr r0, _080AF968 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AF968: .4byte sub_80AF8E0 + 1 + thumb_func_end sub_80AF948 + + thumb_func_start sub_80AF96C +sub_80AF96C: @ 80AF96C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AF990 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF9B2 + cmp r0, 0x1 + bgt _080AF994 + cmp r0, 0 + beq _080AF99A + b _080AF9E8 + .align 2, 0 +_080AF990: .4byte 0x03005e08 +_080AF994: + cmp r0, 0x2 + beq _080AF9D0 + b _080AF9E8 +_080AF99A: + bl sub_8009FAC + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl music_something + movs r0, 0x9 + bl audio_play + b _080AF9C8 +_080AF9B2: + bl sub_80AF710 + cmp r0, 0 + bne _080AF9E8 + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AF9E8 + bl sub_800AC34 +_080AF9C8: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AF9E8 +_080AF9D0: + ldr r0, _080AF9F0 + ldrb r0, [r0] + cmp r0, 0 + bne _080AF9E8 + bl warp_in + ldr r0, _080AF9F4 + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_080AF9E8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AF9F0: .4byte 0x03003124 +_080AF9F4: .4byte c2_load_new_map + 1 + thumb_func_end sub_80AF96C + + thumb_func_start sub_80AF9F8 +sub_80AF9F8: @ 80AF9F8 + push {lr} + ldr r0, _080AFA08 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AFA08: .4byte sub_80AF96C + 1 + thumb_func_end sub_80AF9F8 + + thumb_func_start sub_80AFA0C +sub_80AFA0C: @ 80AFA0C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _080AFA30 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080AFA44 + cmp r5, 0x1 + bgt _080AFA34 + cmp r5, 0 + beq _080AFA3A + b _080AFA7C + .align 2, 0 +_080AFA30: .4byte 0x03005e00 +_080AFA34: + cmp r5, 0x2 + beq _080AFA6C + b _080AFA7C +_080AFA3A: + bl player_bitmagic + bl script_env_2_enable + b _080AFA64 +_080AFA44: + bl sub_80AF710 + cmp r0, 0 + bne _080AFA7C + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080AFA5A + bl sub_81BE72C + strh r5, [r4, 0xA] +_080AFA5A: + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AFA7C +_080AFA64: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AFA7C +_080AFA6C: + bl warp_in + ldr r0, _080AFA84 + bl set_callback2 + adds r0, r6, 0 + bl remove_task +_080AFA7C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AFA84: .4byte c2_load_new_map + 1 + thumb_func_end sub_80AFA0C + + thumb_func_start sub_80AFA88 +sub_80AFA88: @ 80AFA88 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080AFAB8 + adds r5, r1, r0 + adds r4, r5, 0 + adds r4, 0xC + adds r6, r5, 0 + adds r6, 0xE + movs r2, 0x8 + ldrsh r1, [r5, r2] + adds r2, r0, 0 + cmp r1, 0x4 + bls _080AFAAC + b _080AFBE8 +_080AFAAC: + lsls r0, r1, 2 + ldr r1, _080AFABC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AFAB8: .4byte 0x03005e00 +_080AFABC: .4byte _080AFAC0 + .align 2, 0 +_080AFAC0: + .4byte _080AFAD4 + .4byte _080AFB10 + .4byte _080AFB6C + .4byte _080AFBB8 + .4byte _080AFBD4 +_080AFAD4: + bl player_bitmagic + adds r0, r4, 0 + adds r1, r6, 0 + bl player_get_pos_to + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl cur_mapdata_get_door_sound_at + lsls r0, 16 + lsrs r0, 16 + bl audio_play + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl task_overworld_door_add_if_role_69_for_opening_door_at + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AFBE8 +_080AFB10: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AFB26 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AFBE8 +_080AFB26: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r4, _080AFB68 + adds r0, r4 + bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x9 + bl npc_set_state_2 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AFBE8 + .align 2, 0 +_080AFB68: .4byte 0x02037350 +_080AFB6C: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AFBE8 + movs r2, 0 + ldrsh r0, [r4, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl sub_808A8AC + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080AFBB4 + adds r0, r1 + bl sub_8093284 + movs r0, 0 + bl sub_80AF0F4 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AFBE8 + .align 2, 0 +_080AFBB4: .4byte 0x02037350 +_080AFBB8: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AFBCE + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AFBE8 +_080AFBCE: + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080AFBE8 +_080AFBD4: + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, _080AFBF0 + str r0, [r5] +_080AFBE8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AFBF0: .4byte sub_80AFA0C + 1 + thumb_func_end sub_80AFA88 + + thumb_func_start task0A_fade_n_map_maybe +task0A_fade_n_map_maybe: @ 80AFBF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AFC18 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFC2C + cmp r0, 0x1 + bgt _080AFC1C + cmp r0, 0 + beq _080AFC22 + b _080AFC56 + .align 2, 0 +_080AFC18: .4byte 0x03005e00 +_080AFC1C: + cmp r0, 0x2 + beq _080AFC46 + b _080AFC56 +_080AFC22: + bl player_bitmagic + bl script_env_2_enable + b _080AFC3E +_080AFC2C: + bl sub_80AF710 + cmp r0, 0 + bne _080AFC56 + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AFC56 +_080AFC3E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AFC56 +_080AFC46: + bl warp_in + ldr r0, _080AFC5C + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_080AFC56: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AFC5C: .4byte sub_8086024 + 1 + thumb_func_end task0A_fade_n_map_maybe + + thumb_func_start sub_80AFC60 +sub_80AFC60: @ 80AFC60 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0x9 + bl audio_play + ldr r0, _080AFC8C + ldr r1, _080AFC90 + str r1, [r0] + ldr r0, _080AFC94 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080AFC8C: .4byte 0x03005dac +_080AFC90: .4byte sub_80AF3C8 + 1 +_080AFC94: .4byte task0A_fade_n_map_maybe + 1 + thumb_func_end sub_80AFC60 + + thumb_func_start sub_80AFC98 +sub_80AFC98: @ 80AFC98 + push {lr} + cmp r1, 0xA0 + bhi _080AFCC0 + cmp r2, 0 + bge _080AFCA4 + movs r2, 0 +_080AFCA4: + cmp r2, 0xFF + ble _080AFCAA + movs r2, 0xFF +_080AFCAA: + cmp r3, 0 + bge _080AFCB0 + movs r3, 0 +_080AFCB0: + cmp r3, 0xFF + ble _080AFCB6 + movs r3, 0xFF +_080AFCB6: + lsls r1, 1 + adds r1, r0 + lsls r0, r2, 8 + orrs r0, r3 + strh r0, [r1] +_080AFCC0: + pop {r0} + bx r0 + thumb_func_end sub_80AFC98 + + thumb_func_start sub_80AFCC4 +sub_80AFCC4: @ 80AFCC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + mov r10, r1 + mov r9, r2 + adds r6, r3, 0 + mov r8, r6 + movs r7, 0 + cmp r6, 0 + blt _080AFD40 +_080AFCE0: + mov r0, r9 + subs r1, r0, r7 + mov r0, r10 + subs r4, r0, r6 + adds r5, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + adds r1, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + subs r1, r0, r6 + mov r0, r10 + subs r4, r0, r7 + adds r5, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + adds r1, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r1, r8 + adds r1, 0x1 + lsls r0, r7, 1 + subs r1, r0 + mov r8, r1 + adds r7, 0x1 + cmp r1, 0 + bge _080AFD3C + subs r1, r6, 0x1 + lsls r0, r1, 1 + add r8, r0 + adds r6, r1, 0 +_080AFD3C: + cmp r6, r7 + bge _080AFCE0 +_080AFD40: + 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_80AFCC4 + + thumb_func_start sub_80AFD50 +sub_80AFD50: @ 80AFD50 + push {lr} + cmp r1, 0xA0 + bhi _080AFD78 + cmp r2, 0 + bge _080AFD5C + movs r2, 0 +_080AFD5C: + cmp r2, 0xF0 + ble _080AFD62 + movs r2, 0xF0 +_080AFD62: + cmp r3, 0 + bge _080AFD68 + movs r3, 0 +_080AFD68: + cmp r3, 0xF0 + ble _080AFD6E + movs r3, 0xF0 +_080AFD6E: + lsls r1, 1 + adds r1, r0 + lsls r0, r2, 8 + orrs r0, r3 + strh r0, [r1] +_080AFD78: + pop {r0} + bx r0 + thumb_func_end sub_80AFD50 + + thumb_func_start sub_80AFD7C +sub_80AFD7C: @ 80AFD7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + mov r10, r1 + mov r9, r2 + adds r6, r3, 0 + mov r8, r6 + movs r7, 0 + cmp r6, 0 + blt _080AFDF8 +_080AFD98: + mov r0, r9 + subs r1, r0, r7 + mov r0, r10 + subs r4, r0, r6 + adds r5, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + adds r1, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + subs r1, r0, r6 + mov r0, r10 + subs r4, r0, r7 + adds r5, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + adds r1, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r1, r8 + adds r1, 0x1 + lsls r0, r7, 1 + subs r1, r0 + mov r8, r1 + adds r7, 0x1 + cmp r1, 0 + bge _080AFDF4 + subs r1, r6, 0x1 + lsls r0, r1, 1 + add r8, r0 + adds r6, r1, 0 +_080AFDF4: + cmp r6, r7 + bge _080AFD98 +_080AFDF8: + 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_80AFD7C + + thumb_func_start sub_80AFE08 +sub_80AFE08: @ 80AFE08 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AFE2C + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFE64 + cmp r0, 0x1 + bgt _080AFE30 + cmp r0, 0 + beq _080AFE36 + b _080AFEC6 + .align 2, 0 +_080AFE2C: .4byte 0x03005e08 +_080AFE30: + cmp r0, 0x2 + beq _080AFEBC + b _080AFEC6 +_080AFE36: + ldr r0, _080AFE5C + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, _080AFE60 + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_80AFCC4 + movs r0, 0x1 + strh r0, [r4] + b _080AFEC6 + .align 2, 0 +_080AFE5C: .4byte 0x02039b28 +_080AFE60: .4byte 0x02038c28 +_080AFE64: + ldr r0, _080AFEAC + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, _080AFEB0 + adds r0, r1 + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r6, 0x6 + ldrsh r3, [r4, r6] + bl sub_80AFCC4 + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080AFEC6 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _080AFEB4 + bl remove_some_task + movs r0, 0x2 + strh r0, [r4] + b _080AFEC6 + .align 2, 0 +_080AFEAC: .4byte 0x02039b28 +_080AFEB0: .4byte 0x02038c28 +_080AFEB4: + adds r0, r5, 0 + bl remove_task + b _080AFEC6 +_080AFEBC: + bl dp12_8087EA4 + adds r0, r5, 0 + bl remove_task +_080AFEC6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80AFE08 + + thumb_func_start sub_80AFECC +sub_80AFECC: @ 80AFECC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080AFEF0 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFF28 + cmp r0, 0x1 + bgt _080AFEF4 + cmp r0, 0 + beq _080AFEFA + b _080AFF8A + .align 2, 0 +_080AFEF0: .4byte 0x03005e08 +_080AFEF4: + cmp r0, 0x2 + beq _080AFF80 + b _080AFF8A +_080AFEFA: + ldr r0, _080AFF20 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, _080AFF24 + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_80AFD7C + movs r0, 0x1 + strh r0, [r4] + b _080AFF8A + .align 2, 0 +_080AFF20: .4byte 0x02039b28 +_080AFF24: .4byte 0x02038c28 +_080AFF28: + ldr r0, _080AFF70 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, _080AFF74 + adds r0, r1 + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r6, 0x6 + ldrsh r3, [r4, r6] + bl sub_80AFD7C + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080AFF8A + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _080AFF78 + bl remove_some_task + movs r0, 0x2 + strh r0, [r4] + b _080AFF8A + .align 2, 0 +_080AFF70: .4byte 0x02039b28 +_080AFF74: .4byte 0x02038c28 +_080AFF78: + adds r0, r5, 0 + bl remove_task + b _080AFF8A +_080AFF80: + bl dp12_8087EA4 + adds r0, r5, 0 + bl remove_task +_080AFF8A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80AFECC + + thumb_func_start sub_80AFF90 +sub_80AFF90: @ 80AFF90 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080AFFB4 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080AFFAC + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_080AFFAC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AFFB4: .4byte sub_80AFE08 + 1 + thumb_func_end sub_80AFF90 + + thumb_func_start sub_80AFFB8 +sub_80AFFB8: @ 80AFFB8 + push {r4,lr} + ldr r4, _080AFFD8 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080AFFD0 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask +_080AFFD0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AFFD8: .4byte sub_80AFF90 + 1 + thumb_func_end sub_80AFFB8 + + thumb_func_start sub_80AFFDC +sub_80AFFDC: @ 80AFFDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r6, [sp, 0x1C] + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080B0020 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _080B0024 + adds r1, r0, r1 + strh r5, [r1, 0x6] + strh r4, [r1, 0x8] + mov r0, r8 + strh r0, [r1, 0x2] + mov r0, r9 + strh r0, [r1, 0x4] + strh r6, [r1, 0xC] + cmp r5, r4 + bge _080B0028 + strh r7, [r1, 0xA] + b _080B002C + .align 2, 0 +_080B0020: .4byte sub_80AFE08 + 1 +_080B0024: .4byte 0x03005e08 +_080B0028: + negs r0, r7 + strh r0, [r1, 0xA] +_080B002C: + adds r0, r2, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AFFDC + + thumb_func_start sub_80B003C +sub_80B003C: @ 80B003C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r6, [sp, 0x1C] + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080B0080 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _080B0084 + adds r1, r0, r1 + strh r5, [r1, 0x6] + strh r4, [r1, 0x8] + mov r0, r8 + strh r0, [r1, 0x2] + mov r0, r9 + strh r0, [r1, 0x4] + strh r6, [r1, 0xC] + cmp r5, r4 + bge _080B0088 + strh r7, [r1, 0xA] + b _080B008C + .align 2, 0 +_080B0080: .4byte sub_80AFECC + 1 +_080B0084: .4byte 0x03005e08 +_080B0088: + negs r0, r7 + strh r0, [r1, 0xA] +_080B008C: + adds r0, r2, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B003C + + thumb_func_start sub_80B009C +sub_80B009C: @ 80B009C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sav1_get_flash_used_on_map + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r4, 0 + bne _080B00B6 + movs r5, 0x1 +_080B00B6: + ldr r1, _080B00E4 + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] + lsls r0, r4, 1 + adds r0, r1 + ldrh r3, [r0] + str r5, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x78 + movs r1, 0x50 + bl sub_80AFFDC + bl sub_80AFFB8 + bl script_env_2_enable + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B00E4: .4byte 0x0854fe64 + thumb_func_end sub_80B009C + + thumb_func_start sub_80B00E8 +sub_80B00E8: @ 80B00E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080B0116 + ldr r4, _080B011C + ldr r1, _080B0120 + lsls r0, 1 + adds r0, r1 + ldrh r3, [r0] + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x50 + bl sub_80AFCC4 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet +_080B0116: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B011C: .4byte 0x02038c28 +_080B0120: .4byte 0x0854fe64 + thumb_func_end sub_80B00E8 + + thumb_func_start door_upload_tiles +door_upload_tiles: @ 80B0124 + push {r4,lr} + ldr r4, _080B0154 + ldr r0, _080B0158 + ldr r0, [r0] + ldr r1, _080B015C + adds r0, r1 + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x50 + bl sub_80AFCC4 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B0154: .4byte 0x02038c28 +_080B0158: .4byte 0x03005d90 +_080B015C: .4byte 0x00000e68 + thumb_func_end door_upload_tiles + + thumb_func_start task0A_mpl_807E31C +task0A_mpl_807E31C: @ 80B0160 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080B0180 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B0184 + cmp r0, 0x1 + beq _080B0198 + b _080B01B6 + .align 2, 0 +_080B0180: .4byte 0x03005e00 +_080B0184: + bl player_bitmagic + bl script_env_2_enable + bl sub_808D194 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B01B6 +_080B0198: + bl sub_80AF71C + cmp r0, 0 + beq _080B01B6 + bl sub_808D1B4 + cmp r0, 0x1 + beq _080B01B6 + bl sub_809757C + bl script_env_2_disable + adds r0, r5, 0 + bl remove_task +_080B01B6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task0A_mpl_807E31C + + thumb_func_start sub_80B01BC +sub_80B01BC: @ 80B01BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B01E0 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B0202 + cmp r0, 0x1 + bgt _080B01E4 + cmp r0, 0 + beq _080B01EE + b _080B023A + .align 2, 0 +_080B01E0: .4byte 0x03005e00 +_080B01E4: + cmp r0, 0x2 + beq _080B0210 + cmp r0, 0x3 + beq _080B022A + b _080B023A +_080B01EE: + bl player_bitmagic + bl script_env_2_enable + movs r0, 0x2D + bl audio_play + bl sub_808D1C8 + b _080B0222 +_080B0202: + bl sub_808D1E8 + cmp r0, 0 + bne _080B023A + bl sub_80AF0B4 + b _080B0222 +_080B0210: + bl sub_80AF710 + cmp r0, 0 + bne _080B023A + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080B023A +_080B0222: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B023A +_080B022A: + bl warp_in + ldr r0, _080B0240 + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_080B023A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B0240: .4byte c2_load_new_map + 1 + thumb_func_end sub_80B01BC + + thumb_func_start sub_80B0244 +sub_80B0244: @ 80B0244 + push {lr} + bl script_env_2_enable + ldr r0, _080B025C + movs r1, 0xA + bl AddTask + ldr r1, _080B0260 + ldr r0, _080B0264 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080B025C: .4byte sub_80AFA0C + 1 +_080B0260: .4byte 0x03005dac +_080B0264: .4byte sub_80AF3E8 + 1 + thumb_func_end sub_80B0244 + + thumb_func_start sub_80B0268 +sub_80B0268: @ 80B0268 + push {lr} + bl script_env_2_enable + ldr r0, _080B0280 + ldr r1, _080B0284 + str r1, [r0] + ldr r0, _080B0288 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B0280: .4byte 0x03005dac +_080B0284: .4byte mapldr_default + 1 +_080B0288: .4byte sub_80B01BC + 1 + thumb_func_end sub_80B0268 + + thumb_func_start sub_80B028C +sub_80B028C: @ 80B028C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + bne _080B029A + movs r1, 0x1F + b _080B02A0 +_080B029A: + movs r0, 0xF8 + lsls r0, 7 + adds r1, r0, 0 +_080B02A0: + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r4, 0xF0 + lsls r4, 16 +_080B02AA: + lsrs r1, r4, 16 + mov r0, sp + movs r2, 0x2 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0xF + ble _080B02AA + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B028C + + thumb_func_start sub_80B02C8 +sub_80B02C8: @ 80B02C8 + push {r4,r5,lr} + lsls r0, 16 + ldr r2, _080B02E8 + ldrh r1, [r2] + lsls r1, 24 + lsrs r5, r1, 24 + ldrh r1, [r2] + lsrs r4, r1, 8 + cmp r0, 0 + beq _080B02EC + cmp r5, 0 + beq _080B02F6 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + b _080B02F6 + .align 2, 0 +_080B02E8: .4byte 0x04000052 +_080B02EC: + cmp r4, 0xF + bhi _080B02F6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B02F6: + lsls r1, r4, 8 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + cmp r5, 0 + bne _080B0310 + cmp r4, 0x10 + bne _080B0310 + movs r0, 0x1 + b _080B0312 +_080B0310: + movs r0, 0 +_080B0312: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B02C8 + + thumb_func_start sub_80B0318 +sub_80B0318: @ 80B0318 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080B0340 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x7 + bls _080B0334 + b _080B052C +_080B0334: + lsls r0, 2 + ldr r1, _080B0344 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B0340: .4byte 0x03005e08 +_080B0344: .4byte _080B0348 + .align 2, 0 +_080B0348: + .4byte _080B0368 + .4byte _080B0424 + .4byte _080B0450 + .4byte _080B046C + .4byte _080B0482 + .4byte _080B04F2 + .4byte _080B04AC + .4byte _080B04BA +_080B0368: + movs r0, 0x80 + lsls r0, 19 + ldrh r0, [r0] + strh r0, [r5, 0xC] + ldr r0, _080B0404 + ldrh r0, [r0] + strh r0, [r5, 0xE] + ldr r0, _080B0408 + ldrh r0, [r0] + strh r0, [r5, 0x10] + ldr r0, _080B040C + ldrh r0, [r0] + strh r0, [r5, 0x12] + ldr r0, _080B0410 + ldrh r0, [r0] + strh r0, [r5, 0x14] + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl lcd_io_clear_bits + ldr r0, _080B0414 + ldrh r1, [r0] + movs r0, 0x50 + bl lcd_io_set_bits + ldr r1, _080B0418 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x1E + bl lcd_io_set + movs r0, 0x14 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1E + bl sub_8199C30 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r4, _080B041C + movs r2, 0x4 + ldrsh r1, [r5, r2] + movs r0, 0x6 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + movs r3, 0x1 + bl sub_80AFD7C + movs r2, 0xF0 + lsls r2, 3 + adds r1, r4, r2 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet + ldr r2, _080B0420 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + movs r0, 0x1 + strh r0, [r5] + b _080B052C + .align 2, 0 +_080B0404: .4byte 0x04000050 +_080B0408: .4byte 0x04000052 +_080B040C: .4byte 0x04000048 +_080B0410: .4byte 0x0400004a +_080B0414: .4byte 0x082ec7cc +_080B0418: .4byte 0x0000070c +_080B041C: .4byte 0x02038c28 +_080B0420: .4byte 0x0854fe7c +_080B0424: + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + ldrb r0, [r5, 0x2] + bl sub_80B028C + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + movs r2, 0x1 + str r2, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r3, 0xA0 + bl sub_80B003C + strh r4, [r5] + b _080B052C +_080B0450: + ldr r0, _080B0468 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080B052C + bl script_env_2_enable_and_set_ctx_running + movs r0, 0x3 + strh r0, [r5] + b _080B052C + .align 2, 0 +_080B0468: .4byte sub_80AFECC + 1 +_080B046C: + bl sub_808A2E4 + movs r0, 0 + bl sub_808A2C0 + movs r0, 0 + strh r0, [r5, 0xA] + movs r0, 0x4 + strh r0, [r5, 0x8] + strh r0, [r5] + b _080B052C +_080B0482: + ldrh r0, [r5, 0x8] + subs r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _080B052C + movs r0, 0x4 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xA] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0xA] + movs r1, 0x4 + negs r1, r1 + cmp r0, 0 + beq _080B04A4 + movs r1, 0x4 +_080B04A4: + movs r0, 0 + bl sub_808A2CC + b _080B052C +_080B04AC: + bl sub_808A2E4 + movs r0, 0x8 + strh r0, [r5, 0x8] + movs r0, 0x7 + strh r0, [r5] + b _080B052C +_080B04BA: + ldrh r0, [r5, 0x8] + subs r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _080B052C + movs r0, 0x8 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xA] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0xA] + ldrh r0, [r5, 0xA] + bl sub_80B02C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B052C + movs r0, 0x5 + strh r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + b _080B052C +_080B04F2: + movs r0, 0x40 + movs r1, 0xFF + bl lcd_io_set + ldrh r1, [r5, 0xC] + movs r0, 0 + bl lcd_io_set + ldrh r1, [r5, 0xE] + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r5, 0x10] + movs r0, 0x52 + bl lcd_io_set + ldrh r1, [r5, 0x12] + movs r0, 0x48 + bl lcd_io_set + ldrh r1, [r5, 0x14] + movs r0, 0x4A + bl lcd_io_set + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_080B052C: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B0318 + + thumb_func_start sub_80B0534 +sub_80B0534: @ 80B0534 + push {lr} + ldr r0, _080B055C + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B0560 + adds r1, r0 + ldr r0, _080B0564 + ldrh r0, [r0] + cmp r0, 0 + bne _080B0568 + strh r0, [r1, 0x2] + movs r0, 0x68 + b _080B0580 + .align 2, 0 +_080B055C: .4byte sub_80B0318 + 1 +_080B0560: .4byte 0x03005e08 +_080B0564: .4byte 0x020375f0 +_080B0568: + cmp r0, 0x1 + bne _080B0572 + strh r0, [r1, 0x2] + movs r0, 0x88 + b _080B0580 +_080B0572: + cmp r0, 0x2 + bne _080B057A + movs r0, 0 + b _080B057C +_080B057A: + movs r0, 0x1 +_080B057C: + strh r0, [r1, 0x2] + movs r0, 0x78 +_080B0580: + strh r0, [r1, 0x4] + movs r0, 0x50 + strh r0, [r1, 0x6] + pop {r0} + bx r0 + thumb_func_end sub_80B0534 + + thumb_func_start sub_80B058C +sub_80B058C: @ 80B058C + push {lr} + ldr r0, _080B05AC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B05B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_080B05AC: .4byte sub_80B0318 + 1 +_080B05B0: .4byte 0x03005e00 + thumb_func_end sub_80B058C + + thumb_func_start sub_80B05B4 +sub_80B05B4: @ 80B05B4 + push {lr} + bl sub_80859B0 + ldr r0, _080B05C8 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B05C8: .4byte task50_0807F0C8 + 1 + thumb_func_end sub_80B05B4 + + thumb_func_start task50_0807F0C8 +task50_0807F0C8: @ 80B05CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B05E8 + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080B05E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task50_0807F0C8 + + thumb_func_start task01_battle_start +task01_battle_start: @ 80B05F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B0610 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B0614 + cmp r0, 0x1 + beq _080B062E + b _080B0652 + .align 2, 0 +_080B0610: .4byte 0x03005e08 +_080B0614: + bl c3_80A0DD8_is_running + cmp r0, 0 + bne _080B0652 + ldrb r0, [r4, 0x2] + bl sub_8145EF4 + bl sub_81BE72C + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080B0652 +_080B062E: + bl sub_8145F20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B0652 + bl overworld_free_bg_tilemaps + ldr r0, _080B0658 + bl set_callback2 + bl prev_quest_postbuffer_cursor_backup_reset + bl overworld_poison_timer_set + adds r0, r5, 0 + bl remove_task +_080B0652: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B0658: .4byte sub_8036760 + 1 + thumb_func_end task01_battle_start + + thumb_func_start task_add_01_battle_start +task_add_01_battle_start: @ 80B065C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080B0690 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B0694 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + adds r0, r5, 0 + bl current_map_music_set__default_for_battle + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B0690: .4byte task01_battle_start + 1 +_080B0694: .4byte 0x03005e00 + thumb_func_end task_add_01_battle_start + + thumb_func_start sub_80B0698 +sub_80B0698: @ 80B0698 + push {lr} + bl flag_check_is_in_safari_zone + cmp r0, 0 + beq _080B06A8 + bl sub_80B077C + b _080B06AC +_080B06A8: + bl sub_80B06BC +_080B06AC: + pop {r0} + bx r0 + thumb_func_end sub_80B0698 + + thumb_func_start sub_80B06B0 +sub_80B06B0: @ 80B06B0 + push {lr} + bl sub_80B07B4 + pop {r0} + bx r0 + thumb_func_end sub_80B06B0 + + thumb_func_start sub_80B06BC +sub_80B06BC: @ 80B06BC + push {r4,lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, _080B071C + ldr r0, _080B0720 + str r0, [r1, 0x8] + ldr r4, _080B0724 + movs r0, 0 + str r0, [r4] + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B06F2 + ldr r0, _080B0728 + movs r1, 0 + bl var_set + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 14 + orrs r0, r1 + str r0, [r4] +_080B06F2: + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B071C: .4byte 0x030022c0 +_080B0720: .4byte sub_80B0AF8 + 1 +_080B0724: .4byte 0x02022fec +_080B0728: .4byte 0x0000400e + thumb_func_end sub_80B06BC + + thumb_func_start sub_80B072C +sub_80B072C: @ 80B072C + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, _080B0770 + ldr r0, _080B0774 + str r0, [r1, 0x8] + ldr r1, _080B0778 + movs r0, 0x80 + lsls r0, 3 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .align 2, 0 +_080B0770: .4byte 0x030022c0 +_080B0774: .4byte sub_80B0AF8 + 1 +_080B0778: .4byte 0x02022fec + thumb_func_end sub_80B072C + + thumb_func_start sub_80B077C +sub_80B077C: @ 80B077C + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, _080B07A8 + ldr r0, _080B07AC + str r0, [r1, 0x8] + ldr r1, _080B07B0 + movs r0, 0x80 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + pop {r0} + bx r0 + .align 2, 0 +_080B07A8: .4byte 0x030022c0 +_080B07AC: .4byte sub_80FC190 + 1 +_080B07B0: .4byte 0x02022fec + thumb_func_end sub_80B077C + + thumb_func_start sub_80B07B4 +sub_80B07B4: @ 80B07B4 + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, _080B07F8 + ldr r0, _080B07FC + str r0, [r1, 0x8] + ldr r1, _080B0800 + movs r0, 0x80 + lsls r0, 13 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .align 2, 0 +_080B07F8: .4byte 0x030022c0 +_080B07FC: .4byte sub_80B0AF8 + 1 +_080B0800: .4byte 0x02022fec + thumb_func_end sub_80B07B4 + + thumb_func_start task_add_01_battle_start_with_music_and_stats +task_add_01_battle_start_with_music_and_stats: @ 80B0804 + push {lr} + bl sub_80B0F34 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x9 + bl sav12_xor_increment + bl sub_80B1234 + pop {r0} + bx r0 + thumb_func_end task_add_01_battle_start_with_music_and_stats + + thumb_func_start sub_80B0828 +sub_80B0828: @ 80B0828 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B0846 + movs r0, 0xA + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + b _080B0856 +_080B0846: + movs r0, 0xB + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start +_080B0856: + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x9 + bl sav12_xor_increment + bl sub_80B1234 + pop {r0} + bx r0 + thumb_func_end sub_80B0828 + + thumb_func_start sub_80B086C +sub_80B086C: @ 80B086C + push {lr} + ldr r0, _080B0898 + movs r1, 0xC4 + lsls r1, 1 + movs r2, 0x5 + bl sub_8067FF8 + bl script_env_2_enable + ldr r1, _080B089C + ldr r0, _080B08A0 + str r0, [r1, 0x8] + ldr r1, _080B08A4 + movs r0, 0x80 + lsls r0, 2 + str r0, [r1] + movs r0, 0x8 + movs r1, 0 + bl task_add_01_battle_start + pop {r0} + bx r0 + .align 2, 0 +_080B0898: .4byte 0x02024744 +_080B089C: .4byte 0x030022c0 +_080B08A0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_080B08A4: .4byte 0x02022fec + thumb_func_end sub_80B086C + + thumb_func_start sub_80B08A8 +sub_80B08A8: @ 80B08A8 + push {lr} + bl script_env_2_enable + ldr r1, _080B08E0 + ldr r0, _080B08E4 + str r0, [r1, 0x8] + ldr r1, _080B08E8 + movs r0, 0 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .align 2, 0 +_080B08E0: .4byte 0x030022c0 +_080B08E4: .4byte sub_80B0B6C + 1 +_080B08E8: .4byte 0x02022fec + thumb_func_end sub_80B08A8 + + thumb_func_start sub_80B08EC +sub_80B08EC: @ 80B08EC + push {lr} + bl script_env_2_enable + ldr r1, _080B0928 + ldr r0, _080B092C + str r0, [r1, 0x8] + ldr r1, _080B0930 + movs r0, 0x80 + lsls r0, 6 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .align 2, 0 +_080B0928: .4byte 0x030022c0 +_080B092C: .4byte sub_80B0B6C + 1 +_080B0930: .4byte 0x02022fec + thumb_func_end sub_80B08EC + + thumb_func_start sub_80B0934 +sub_80B0934: @ 80B0934 + push {r4,lr} + bl script_env_2_enable + ldr r1, _080B0974 + ldr r0, _080B0978 + str r0, [r1, 0x8] + ldr r4, _080B097C + movs r0, 0x80 + lsls r0, 6 + str r0, [r4] + ldr r0, _080B0980 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCA + lsls r0, 1 + cmp r1, r0 + beq _080B09B8 + cmp r1, r0 + bhi _080B0988 + cmp r1, 0x97 + beq _080B09F4 + cmp r1, 0x97 + bcc _080B099A + cmp r1, 0xFA + bhi _080B099A + cmp r1, 0xF9 + bcc _080B099A + ldr r1, _080B0984 + b _080B09E6 + .align 2, 0 +_080B0974: .4byte 0x030022c0 +_080B0978: .4byte sub_80B0B6C + 1 +_080B097C: .4byte 0x02022fec +_080B0980: .4byte 0x02024744 +_080B0984: .4byte 0x00000229 +_080B0988: + movs r0, 0xCB + lsls r0, 1 + cmp r1, r0 + beq _080B09CE + cmp r1, r0 + bcc _080B099A + adds r0, 0x4 + cmp r1, r0 + beq _080B09E4 +_080B099A: + ldr r2, _080B09B4 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 21 + orrs r0, r1 + str r0, [r2] + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0x17 + bl task_add_01_battle_start + b _080B09FE + .align 2, 0 +_080B09B4: .4byte 0x02022fec +_080B09B8: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 22 + orrs r0, r1 + str r0, [r4] + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0x16 + bl task_add_01_battle_start + b _080B09FE +_080B09CE: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 23 + orrs r0, r1 + str r0, [r4] + movs r1, 0xEB + lsls r1, 1 + movs r0, 0x18 + bl task_add_01_battle_start + b _080B09FE +_080B09E4: + ldr r1, _080B09F0 +_080B09E6: + movs r0, 0 + bl task_add_01_battle_start + b _080B09FE + .align 2, 0 +_080B09F0: .4byte 0x00000227 +_080B09F4: + movs r1, 0xEC + lsls r1, 1 + movs r0, 0xA + bl task_add_01_battle_start +_080B09FE: + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B0934 + + thumb_func_start sub_80B0A18 +sub_80B0A18: @ 80B0A18 + push {lr} + bl script_env_2_enable + ldr r1, _080B0A40 + ldr r0, _080B0A44 + str r0, [r1, 0x8] + ldr r1, _080B0A48 + movs r0, 0xC0 + lsls r0, 6 + str r0, [r1] + ldr r0, _080B0A4C + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B0A50 + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0xB + bl task_add_01_battle_start + b _080B0A5A + .align 2, 0 +_080B0A40: .4byte 0x030022c0 +_080B0A44: .4byte sub_80B0B6C + 1 +_080B0A48: .4byte 0x02022fec +_080B0A4C: .4byte 0x082e9530 +_080B0A50: + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0x6 + bl task_add_01_battle_start +_080B0A5A: + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + thumb_func_end sub_80B0A18 + + thumb_func_start sub_80B0A74 +sub_80B0A74: @ 80B0A74 + push {lr} + bl script_env_2_enable + ldr r1, _080B0AAC + ldr r0, _080B0AB0 + str r0, [r1, 0x8] + ldr r1, _080B0AB4 + movs r0, 0xC0 + lsls r0, 7 + str r0, [r1] + ldr r0, _080B0AB8 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + movs r0, 0xC9 + lsls r0, 1 + cmp r1, r0 + beq _080B0ACC + cmp r1, r0 + bgt _080B0ABC + subs r0, 0x1 + cmp r1, r0 + beq _080B0AC8 + b _080B0AD4 + .align 2, 0 +_080B0AAC: .4byte 0x030022c0 +_080B0AB0: .4byte sub_80B0B6C + 1 +_080B0AB4: .4byte 0x02022fec +_080B0AB8: .4byte 0x02024744 +_080B0ABC: + ldr r0, _080B0AC4 + cmp r2, r0 + beq _080B0AD0 + b _080B0AD4 + .align 2, 0 +_080B0AC4: .4byte 0x00000193 +_080B0AC8: + movs r0, 0x15 + b _080B0AD6 +_080B0ACC: + movs r0, 0x13 + b _080B0AD6 +_080B0AD0: + movs r0, 0x14 + b _080B0AD6 +_080B0AD4: + movs r0, 0xA +_080B0AD6: + ldr r1, _080B0AF4 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .align 2, 0 +_080B0AF4: .4byte 0x000001df + thumb_func_end sub_80B0A74 + + thumb_func_start sub_80B0AF8 +sub_80B0AF8: @ 80B0AF8 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _080B0B40 + mov r0, sp + bl CpuSet + movs r0, 0 + movs r1, 0x80 + bl reset_super_sprites + ldr r0, _080B0B44 + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B0B4C + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080B0B4C + bl sub_81A80A8 + lsls r0, 24 + cmp r0, 0 + bne _080B0B4C + ldr r0, _080B0B48 + bl set_callback2 + b _080B0B58 + .align 2, 0 +_080B0B40: .4byte 0x01000100 +_080B0B44: .4byte 0x0202433a +_080B0B48: .4byte c2_whiteout + 1 +_080B0B4C: + ldr r0, _080B0B60 + bl set_callback2 + ldr r1, _080B0B64 + ldr r0, _080B0B68 + str r0, [r1] +_080B0B58: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080B0B60: .4byte c2_exit_to_overworld_2_switch + 1 +_080B0B64: .4byte 0x03005dac +_080B0B68: .4byte sub_80AF6F0 + 1 + thumb_func_end sub_80B0AF8 + + thumb_func_start sub_80B0B6C +sub_80B0B6C: @ 80B0B6C + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _080B0BA8 + mov r0, sp + bl CpuSet + movs r0, 0 + movs r1, 0x80 + bl reset_super_sprites + ldr r0, _080B0BAC + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B0BC0 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B0BB4 + ldr r0, _080B0BB0 + bl set_callback2 + b _080B0BC6 + .align 2, 0 +_080B0BA8: .4byte 0x01000100 +_080B0BAC: .4byte 0x0202433a +_080B0BB0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_080B0BB4: + ldr r0, _080B0BBC + bl set_callback2 + b _080B0BC6 + .align 2, 0 +_080B0BBC: .4byte c2_whiteout + 1 +_080B0BC0: + ldr r0, _080B0BCC + bl set_callback2 +_080B0BC6: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080B0BCC: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80B0B6C + + thumb_func_start sub_80B0BD0 +sub_80B0BD0: @ 80B0BD0 + push {r4,r5,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_tile_x02_or_xD1 + lsls r0, 24 + cmp r0, 0 + beq _080B0C06 + movs r0, 0 + b _080B0D1A +_080B0C06: + adds r0, r4, 0 + bl is_tile_tallgrass + lsls r0, 24 + cmp r0, 0 + beq _080B0C16 + movs r0, 0x1 + b _080B0D1A +_080B0C16: + adds r0, r4, 0 + bl is_x21_or_x2B + lsls r0, 24 + cmp r0, 0 + bne _080B0D18 + ldr r0, _080B0C38 + ldrb r0, [r0, 0x17] + subs r0, 0x1 + cmp r0, 0x8 + bhi _080B0C9C + lsls r0, 2 + ldr r1, _080B0C3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B0C38: .4byte 0x02037318 +_080B0C3C: .4byte _080B0C40 + .align 2, 0 +_080B0C40: + .4byte _080B0C9C + .4byte _080B0C9C + .4byte _080B0C9C + .4byte _080B0C64 + .4byte _080B0C88 + .4byte _080B0C8C + .4byte _080B0C9C + .4byte _080B0C74 + .4byte _080B0C74 +_080B0C64: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089588 + lsls r0, 24 + cmp r0, 0 + beq _080B0C78 +_080B0C74: + movs r0, 0x8 + b _080B0D1A +_080B0C78: + adds r0, r4, 0 + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + bne _080B0CE0 + movs r0, 0x7 + b _080B0D1A +_080B0C88: + movs r0, 0x3 + b _080B0D1A +_080B0C8C: + lsls r0, r5, 24 + lsrs r0, 24 + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + bne _080B0CF2 + b _080B0D10 +_080B0C9C: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_808962C + lsls r0, 24 + cmp r0, 0 + bne _080B0CF2 + adds r0, r4, 0 + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + bne _080B0CE0 + adds r0, r4, 0 + bl sub_808959C + lsls r0, 24 + cmp r0, 0 + beq _080B0CC8 + movs r0, 0x6 + b _080B0D1A +_080B0CC8: + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _080B0CF6 + adds r0, r4, 0 + bl sub_80894D4 + lsls r0, 24 + cmp r0, 0 + beq _080B0CE4 +_080B0CE0: + movs r0, 0x5 + b _080B0D1A +_080B0CE4: + adds r0, r4, 0 + bl sub_80894AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B0CF6 +_080B0CF2: + movs r0, 0x4 + b _080B0D1A +_080B0CF6: + ldr r0, _080B0D14 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 5 + cmp r1, r0 + beq _080B0D18 + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + beq _080B0D18 +_080B0D10: + movs r0, 0x9 + b _080B0D1A + .align 2, 0 +_080B0D14: .4byte 0x03005d8c +_080B0D18: + movs r0, 0x2 +_080B0D1A: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B0BD0 + + thumb_func_start sub_80B0D24 +sub_80B0D24: @ 80B0D24 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 16 + lsrs r4, r0, 16 + bl sav1_get_flash_used_on_map + lsls r0, 24 + cmp r0, 0 + beq _080B0D54 + movs r0, 0x2 + b _080B0D7E +_080B0D54: + lsls r0, r4, 24 + lsrs r0, 24 + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + bne _080B0D7C + ldr r0, _080B0D74 + ldrb r0, [r0, 0x17] + cmp r0, 0x4 + beq _080B0D78 + cmp r0, 0x5 + beq _080B0D7C + movs r0, 0 + b _080B0D7E + .align 2, 0 +_080B0D74: .4byte 0x02037318 +_080B0D78: + movs r0, 0x1 + b _080B0D7E +_080B0D7C: + movs r0, 0x3 +_080B0D7E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B0D24 + + thumb_func_start sub_80B0D88 +sub_80B0D88: @ 80B0D88 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + movs r6, 0 +_080B0D92: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, _080B0DE4 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _080B0DD6 + cmp r1, 0 + beq _080B0DD6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080B0DD6 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r0, r7, r0 + lsls r0, 24 + lsrs r7, r0, 24 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080B0DDC +_080B0DD6: + adds r6, 0x1 + cmp r6, 0x5 + ble _080B0D92 +_080B0DDC: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B0DE4: .4byte 0x020244ec + thumb_func_end sub_80B0D88 + + thumb_func_start sub_80B0DE8 +sub_80B0DE8: @ 80B0DE8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r5, _080B0E1C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r5 + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r4 + bcs _080B0E08 + adds r4, r0, 0 +_080B0E08: + movs r3, 0 + ldrb r0, [r2] + cmp r0, 0x1 + beq _080B0E50 + cmp r0, 0x1 + bgt _080B0E20 + cmp r0, 0 + beq _080B0E2A + b _080B0EC0 + .align 2, 0 +_080B0E1C: .4byte 0x08310030 +_080B0E20: + cmp r0, 0x2 + beq _080B0E76 + cmp r0, 0x3 + beq _080B0E9C + b _080B0EC0 +_080B0E2A: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0E38: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0E38 + b _080B0EC0 +_080B0E50: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0E5E: + lsls r0, r2, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0E5E + b _080B0EC0 +_080B0E76: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0E84: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0E84 + b _080B0EC0 +_080B0E9C: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0EAA: + lsls r0, r2, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0EAA +_080B0EC0: + adds r0, r3, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B0DE8 + + thumb_func_start sub_80B0EC8 +sub_80B0EC8: @ 80B0EC8 + push {r4-r6,lr} + bl sub_80B0D24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, _080B0F00 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_80B0D88 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcs _080B0F10 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B0F04 + movs r0, 0 + b _080B0F2E + .align 2, 0 +_080B0F00: .4byte 0x02024744 +_080B0F04: + ldr r0, _080B0F0C + lsls r1, r5, 1 + b _080B0F20 + .align 2, 0 +_080B0F0C: .4byte 0x0854fe88 +_080B0F10: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080B0F2C + ldr r0, _080B0F28 + lsls r1, r6, 1 + adds r0, 0x1 +_080B0F20: + adds r1, r0 + ldrb r0, [r1] + b _080B0F2E + .align 2, 0 +_080B0F28: .4byte 0x0854fe88 +_080B0F2C: + movs r0, 0xA +_080B0F2E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B0EC8 + + thumb_func_start sub_80B0F34 +sub_80B0F34: @ 80B0F34 + push {r4-r6,lr} + ldr r4, _080B0F60 + ldrh r1, [r4] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _080B0F98 + ldr r1, _080B0F64 + ldrh r2, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x1] + cmp r1, 0x1F + bne _080B0F94 + adds r1, r2, 0 + ldr r0, _080B0F68 + cmp r1, r0 + bne _080B0F6C + movs r0, 0xC + b _080B1000 + .align 2, 0 +_080B0F60: .4byte 0x02038bca +_080B0F64: .4byte 0x08310030 +_080B0F68: .4byte 0x00000105 +_080B0F6C: + movs r0, 0x83 + lsls r0, 1 + cmp r1, r0 + bne _080B0F78 + movs r0, 0xD + b _080B1000 +_080B0F78: + ldr r0, _080B0F84 + cmp r1, r0 + bne _080B0F88 + movs r0, 0xE + b _080B1000 + .align 2, 0 +_080B0F84: .4byte 0x00000107 +_080B0F88: + movs r0, 0x84 + lsls r0, 1 + cmp r1, r0 + bne _080B0F98 + movs r0, 0xF + b _080B1000 +_080B0F94: + cmp r1, 0x26 + bne _080B0F9C +_080B0F98: + movs r0, 0x10 + b _080B1000 +_080B0F9C: + cmp r1, 0x9 + beq _080B0FA8 + cmp r1, 0x35 + beq _080B0FA8 + cmp r1, 0x31 + bne _080B0FAC +_080B0FA8: + movs r0, 0x12 + b _080B1000 +_080B0FAC: + cmp r1, 0x3 + beq _080B0FB8 + cmp r1, 0xD + beq _080B0FB8 + cmp r1, 0xB + bne _080B0FBC +_080B0FB8: + movs r0, 0x11 + b _080B1000 +_080B0FBC: + ldrb r0, [r0, 0x18] + movs r5, 0x1 + cmp r0, 0x1 + bne _080B0FC6 + movs r5, 0x2 +_080B0FC6: + bl sub_80B0D24 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4] + adds r1, r5, 0 + bl sub_80B0DE8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80B0D88 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _080B0FF8 + ldr r0, _080B0FF4 + lsls r1, r6, 1 + adds r0, 0x1 + b _080B0FFC + .align 2, 0 +_080B0FF4: .4byte 0x0854fe90 +_080B0FF8: + ldr r0, _080B1008 + lsls r1, r6, 1 +_080B0FFC: + adds r1, r0 + ldrb r0, [r1] +_080B1000: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B1008: .4byte 0x0854fe90 + thumb_func_end sub_80B0F34 + + thumb_func_start sub_80B100C +sub_80B100C: @ 80B100C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B103C + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_80B0D88 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcs _080B1090 + cmp r5, 0xA + beq _080B1048 + cmp r5, 0xA + bgt _080B1040 + cmp r5, 0x3 + beq _080B105C + b _080B106C + .align 2, 0 +_080B103C: .4byte 0x02024744 +_080B1040: + cmp r5, 0xD + bgt _080B106C + movs r0, 0x4 + b _080B1120 +_080B1048: + ldr r4, _080B1058 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + b _080B1114 + .align 2, 0 +_080B1058: .4byte 0x0854fea4 +_080B105C: + ldr r4, _080B1068 + bl GenerateRandomNumber + ands r5, r0 + lsls r0, r5, 16 + b _080B111A + .align 2, 0 +_080B1068: .4byte 0x0854fea7 +_080B106C: + ldr r0, _080B1088 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + beq _080B10EC + ldr r4, _080B108C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + b _080B1112 + .align 2, 0 +_080B1088: .4byte 0x000040ce +_080B108C: .4byte 0x0854fe98 +_080B1090: + cmp r5, 0xA + beq _080B10A6 + cmp r5, 0xA + bgt _080B109E + cmp r5, 0x3 + beq _080B10B8 + b _080B10C8 +_080B109E: + cmp r5, 0xD + bgt _080B10C8 + movs r0, 0x3 + b _080B1120 +_080B10A6: + ldr r4, _080B10B4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + b _080B1114 + .align 2, 0 +_080B10B4: .4byte 0x0854fea4 +_080B10B8: + ldr r4, _080B10C4 + bl GenerateRandomNumber + ands r5, r0 + lsls r0, r5, 16 + b _080B111A + .align 2, 0 +_080B10C4: .4byte 0x0854fea7 +_080B10C8: + ldr r0, _080B10E4 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + beq _080B10EC + ldr r4, _080B10E8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + b _080B1112 + .align 2, 0 +_080B10E4: .4byte 0x000040ce +_080B10E8: .4byte 0x0854fe98 +_080B10EC: + ldr r0, _080B1128 + ldr r1, [r0] + ldr r2, _080B112C + adds r0, r1, r2 + ldrh r0, [r0] + lsls r2, r0, 2 + ldr r3, _080B1130 + adds r1, r3 + adds r2, r1, r2 + lsls r0, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080B1134 +_080B1112: + movs r1, 0xC +_080B1114: + bl __umodsi3 + lsls r0, 16 +_080B111A: + lsrs r0, 16 + adds r0, r4 + ldrb r0, [r0] +_080B1120: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B1128: .4byte 0x03005d90 +_080B112C: .4byte 0x00000cb2 +_080B1130: .4byte 0x00000cb4 +_080B1134: .4byte 0x0854fe98 + thumb_func_end sub_80B100C + + thumb_func_start sub_80B1138 +sub_80B1138: @ 80B1138 + push {lr} + ldr r0, _080B114C + bl set_callback2 + ldr r1, _080B1150 + ldr r0, _080B1154 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_080B114C: .4byte set_256color_bg_bg0 + 1 +_080B1150: .4byte 0x030022c0 +_080B1154: .4byte sub_80B1158 + 1 + thumb_func_end sub_80B1138 + + thumb_func_start sub_80B1158 +sub_80B1158: @ 80B1158 + push {lr} + sub sp, 0x8 + ldr r0, _080B119C + bl var_get_pointer + ldr r2, _080B11A0 + ldrh r1, [r2] + strh r1, [r0] + ldrh r0, [r2] + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x5 + movs r2, 0 + movs r3, 0 + bl sub_80F9244 + bl clear_tasks + bl sub_806E64C + ldr r0, _080B11A4 + bl set_callback2 + movs r0, 0 + bl sub_8145F10 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080B119C: .4byte 0x00004023 +_080B11A0: .4byte 0x020375f0 +_080B11A4: .4byte sub_80B11A8 + 1 + thumb_func_end sub_80B1158 + + thumb_func_start sub_80B11A8 +sub_80B11A8: @ 80B11A8 + push {lr} + bl fade_and_return_progress_probably + bl run_active_tasks + bl sub_8145F20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B11F0 + ldr r1, _080B11F4 + movs r0, 0x10 + str r0, [r1] + ldr r1, _080B11F8 + ldr r0, _080B11FC + str r0, [r1, 0x8] + bl Window_FreeMemory + ldr r0, _080B1200 + bl set_callback2 + bl prev_quest_postbuffer_cursor_backup_reset + bl overworld_poison_timer_set + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 +_080B11F0: + pop {r0} + bx r0 + .align 2, 0 +_080B11F4: .4byte 0x02022fec +_080B11F8: .4byte 0x030022c0 +_080B11FC: .4byte sub_80B1204 + 1 +_080B1200: .4byte sub_8036760 + 1 + thumb_func_end sub_80B11A8 + + thumb_func_start sub_80B1204 +sub_80B1204: @ 80B1204 + push {lr} + bl sav1_reset_x2C + ldr r0, _080B1214 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080B1214: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80B1204 + + thumb_func_start sub_80B1218 +sub_80B1218: @ 80B1218 + push {lr} + movs r0, 0x8 + bl sub_80847F8 + movs r1, 0x3C + bl __umodsi3 + cmp r0, 0 + bne _080B122E + bl sub_81DA57C +_080B122E: + pop {r0} + bx r0 + thumb_func_end sub_80B1218 + + thumb_func_start sub_80B1234 +sub_80B1234: @ 80B1234 + push {lr} + movs r0, 0x9 + bl sub_80847F8 + movs r1, 0x14 + bl __umodsi3 + cmp r0, 0 + bne _080B124A + bl sub_81DA57C +_080B124A: + pop {r0} + bx r0 + thumb_func_end sub_80B1234 + + thumb_func_start sub_80B1250 +sub_80B1250: @ 80B1250 + adds r2, r0, 0 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + orrs r0, r1 + bx lr + thumb_func_end sub_80B1250 + + thumb_func_start sub_80B1268 +sub_80B1268: @ 80B1268 + adds r1, r0, 0 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + lsls r1, 8 + orrs r0, r1 + bx lr + thumb_func_end sub_80B1268 + + thumb_func_start ldrb +ldrb: @ 80B1274 + ldrb r0, [r0] + bx lr + thumb_func_end ldrb + + thumb_func_start trainerflag_opponent +trainerflag_opponent: @ 80B1278 + ldr r1, _080B128C + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_080B128C: .4byte 0x02038bca + thumb_func_end trainerflag_opponent + + thumb_func_start sub_80B1290 +sub_80B1290: @ 80B1290 + ldr r1, _080B12A4 + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_080B12A4: .4byte 0x02038bcc + thumb_func_end sub_80B1290 + + thumb_func_start battle_exit_is_player_defeat +battle_exit_is_player_defeat: @ 80B12A8 + push {lr} + subs r0, 0x1 + cmp r0, 0x6 + bhi _080B12E0 + lsls r0, 2 + ldr r1, _080B12BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B12BC: .4byte _080B12C0 + .align 2, 0 +_080B12C0: + .4byte _080B12E0 + .4byte _080B12DC + .4byte _080B12DC + .4byte _080B12E0 + .4byte _080B12E0 + .4byte _080B12E0 + .4byte _080B12E0 +_080B12DC: + movs r0, 0x1 + b _080B12E2 +_080B12E0: + movs r0, 0 +_080B12E2: + pop {r1} + bx r1 + thumb_func_end battle_exit_is_player_defeat + + thumb_func_start sub_80B12E8 +sub_80B12E8: @ 80B12E8 + ldr r0, _080B12F4 + movs r1, 0 + strh r1, [r0] + ldr r0, _080B12F8 + strh r1, [r0] + bx lr + .align 2, 0 +_080B12F4: .4byte 0x02038bca +_080B12F8: .4byte 0x02038bcc + thumb_func_end sub_80B12E8 + + thumb_func_start sub_80B12FC +sub_80B12FC: @ 80B12FC + push {lr} + ldr r0, _080B1318 + movs r1, 0 + strh r1, [r0] + ldr r0, _080B131C + ldrb r1, [r0] + cmp r1, 0 + bne _080B132C + ldr r0, _080B1320 + str r1, [r0] + ldr r0, _080B1324 + str r1, [r0] + ldr r0, _080B1328 + b _080B1338 + .align 2, 0 +_080B1318: .4byte 0x02038bc8 +_080B131C: .4byte 0x02038bfc +_080B1320: .4byte 0x02038bd4 +_080B1324: .4byte 0x02038bdc +_080B1328: .4byte 0x02038bf0 +_080B132C: + ldr r0, _080B1354 + movs r1, 0 + str r1, [r0] + ldr r0, _080B1358 + str r1, [r0] + ldr r0, _080B135C +_080B1338: + str r1, [r0] + ldr r1, _080B1360 + movs r0, 0 + strh r0, [r1] + ldr r0, _080B1364 + movs r1, 0 + str r1, [r0] + ldr r0, _080B1368 + str r1, [r0] + ldr r0, _080B136C + str r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080B1354: .4byte 0x02038bd8 +_080B1358: .4byte 0x02038be0 +_080B135C: .4byte 0x02038bf4 +_080B1360: .4byte 0x02038bd0 +_080B1364: .4byte 0x02038be4 +_080B1368: .4byte 0x02038be8 +_080B136C: .4byte 0x02038bec + thumb_func_end sub_80B12FC + + thumb_func_start battle_load_arguments +battle_load_arguments: @ 80B1370 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 +_080B1376: + ldrb r0, [r4, 0x4] + cmp r0, 0x6 + bhi _080B13E8 + lsls r0, 2 + ldr r1, _080B1388 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B1388: .4byte _080B138C + .align 2, 0 +_080B138C: + .4byte _080B13A8 + .4byte _080B13B6 + .4byte _080B13C4 + .4byte _080B13D2 + .4byte _080B13DA + .4byte _080B13E2 + .4byte _080B13EC +_080B13A8: + adds r0, r5, 0 + bl ldrb + ldr r1, [r4] + strb r0, [r1] + adds r5, 0x1 + b _080B13E8 +_080B13B6: + adds r0, r5, 0 + bl sub_80B1268 + ldr r1, [r4] + strh r0, [r1] + adds r5, 0x2 + b _080B13E8 +_080B13C4: + adds r0, r5, 0 + bl sub_80B1250 + ldr r1, [r4] + str r0, [r1] + adds r5, 0x4 + b _080B13E8 +_080B13D2: + ldr r1, [r4] + movs r0, 0 + strb r0, [r1] + b _080B13E8 +_080B13DA: + ldr r1, [r4] + movs r0, 0 + strh r0, [r1] + b _080B13E8 +_080B13E2: + ldr r1, [r4] + movs r0, 0 + str r0, [r1] +_080B13E8: + adds r4, 0x8 + b _080B1376 +_080B13EC: + ldr r0, [r4] + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end battle_load_arguments + + thumb_func_start battle_80801F0 +battle_80801F0: @ 80B13F8 + push {lr} + ldr r0, _080B1420 + ldrh r1, [r0] + cmp r1, 0 + beq _080B141A + ldr r0, _080B1424 + strh r1, [r0] + lsls r0, r1, 24 + lsrs r0, 24 + ldr r1, _080B1428 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl get_npc_id_by_local_id + ldr r1, _080B142C + strb r0, [r1] +_080B141A: + pop {r0} + bx r0 + .align 2, 0 +_080B1420: .4byte 0x02038bd0 +_080B1424: .4byte 0x020375f2 +_080B1428: .4byte 0x03005d8c +_080B142C: .4byte 0x03005df0 + thumb_func_end battle_80801F0 + + thumb_func_start battle_configure_by_script +battle_configure_by_script: @ 80B1430 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80B12FC + ldr r4, _080B145C + adds r0, r5, 0 + bl ldrb + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldrh r0, [r4] + subs r0, 0x1 + cmp r0, 0xB + bls _080B1450 + b _080B15F4 +_080B1450: + lsls r0, 2 + ldr r1, _080B1460 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B145C: .4byte 0x02038bc8 +_080B1460: .4byte _080B1464 + .align 2, 0 +_080B1464: + .4byte _080B14CC + .4byte _080B14B0 + .4byte _080B1494 + .4byte _080B14A8 + .4byte _080B1514 + .4byte _080B14D4 + .4byte _080B14EC + .4byte _080B14D4 + .4byte _080B153C + .4byte _080B1590 + .4byte _080B1598 + .4byte _080B15A8 +_080B1494: + ldr r0, _080B14A0 + adds r1, r5, 0 + bl battle_load_arguments + ldr r0, _080B14A4 + b _080B161E + .align 2, 0 +_080B14A0: .4byte 0x0854ff84 +_080B14A4: .4byte 0x082713c2 +_080B14A8: + ldr r0, _080B14AC + b _080B14D6 + .align 2, 0 +_080B14AC: .4byte 0x0854ff3c +_080B14B0: + ldr r0, _080B14BC + ldrb r0, [r0] + cmp r0, 0 + bne _080B14C4 + ldr r0, _080B14C0 + b _080B15FE + .align 2, 0 +_080B14BC: .4byte 0x02038bfc +_080B14C0: .4byte 0x0854fef4 +_080B14C4: + ldr r0, _080B14C8 + b _080B1616 + .align 2, 0 +_080B14C8: .4byte 0x0855005c +_080B14CC: + ldr r0, _080B14D0 + b _080B15FE + .align 2, 0 +_080B14D0: .4byte 0x0854fef4 +_080B14D4: + ldr r0, _080B14E4 +_080B14D6: + adds r1, r5, 0 + bl battle_load_arguments + bl battle_80801F0 + ldr r0, _080B14E8 + b _080B161E + .align 2, 0 +_080B14E4: .4byte 0x0854ffcc +_080B14E8: .4byte 0x0827138a +_080B14EC: + ldr r0, _080B1508 + adds r1, r5, 0 + bl battle_load_arguments + bl battle_80801F0 + ldr r4, _080B150C + ldrh r0, [r4] + bl sub_80B2234 + strh r0, [r4] + ldr r0, _080B1510 + b _080B161E + .align 2, 0 +_080B1508: .4byte 0x0854ff3c +_080B150C: .4byte 0x02038bca +_080B1510: .4byte 0x082713f8 +_080B1514: + ldr r0, _080B1530 + adds r1, r5, 0 + bl battle_load_arguments + bl battle_80801F0 + ldr r4, _080B1534 + ldrh r0, [r4] + bl sub_80B2234 + strh r0, [r4] + ldr r0, _080B1538 + b _080B161E + .align 2, 0 +_080B1530: .4byte 0x0854feac +_080B1534: .4byte 0x02038bca +_080B1538: .4byte 0x082713d1 +_080B153C: + ldr r0, _080B155C + ldrb r0, [r0] + cmp r0, 0 + bne _080B156C + ldr r0, _080B1560 + adds r1, r5, 0 + bl battle_load_arguments + bl battle_80801F0 + ldr r0, _080B1564 + ldrb r0, [r0] + bl sub_81A9AA8 + ldr r1, _080B1568 + b _080B157E + .align 2, 0 +_080B155C: .4byte 0x02038bfc +_080B1560: .4byte 0x0854feac +_080B1564: .4byte 0x020375f2 +_080B1568: .4byte 0x02038bca +_080B156C: + ldr r0, _080B1584 + adds r1, r5, 0 + bl battle_load_arguments + ldr r0, _080B1588 + ldrb r0, [r0] + bl sub_81A9AA8 +_080B157C: + ldr r1, _080B158C +_080B157E: + strh r0, [r1] + b _080B161C + .align 2, 0 +_080B1584: .4byte 0x08550014 +_080B1588: .4byte 0x020375f2 +_080B158C: .4byte 0x02038bcc +_080B1590: + ldr r0, _080B1594 + b _080B159A + .align 2, 0 +_080B1594: .4byte 0x0854feac +_080B1598: + ldr r0, _080B15A4 +_080B159A: + adds r1, r5, 0 + bl battle_load_arguments + movs r0, 0 + b _080B161E + .align 2, 0 +_080B15A4: .4byte 0x08550014 +_080B15A8: + ldr r0, _080B15C8 + ldrb r0, [r0] + cmp r0, 0 + bne _080B15D8 + ldr r0, _080B15CC + adds r1, r5, 0 + bl battle_load_arguments + bl battle_80801F0 + ldr r0, _080B15D0 + ldrb r0, [r0] + bl battle_init + ldr r1, _080B15D4 + b _080B157E + .align 2, 0 +_080B15C8: .4byte 0x02038bfc +_080B15CC: .4byte 0x0854feac +_080B15D0: .4byte 0x020375f2 +_080B15D4: .4byte 0x02038bca +_080B15D8: + ldr r0, _080B15EC + adds r1, r5, 0 + bl battle_load_arguments + ldr r0, _080B15F0 + ldrb r0, [r0] + bl battle_init + b _080B157C + .align 2, 0 +_080B15EC: .4byte 0x08550014 +_080B15F0: .4byte 0x020375f2 +_080B15F4: + ldr r0, _080B160C + ldrb r0, [r0] + cmp r0, 0 + bne _080B1614 + ldr r0, _080B1610 +_080B15FE: + adds r1, r5, 0 + bl battle_load_arguments + bl battle_80801F0 + b _080B161C + .align 2, 0 +_080B160C: .4byte 0x02038bfc +_080B1610: .4byte 0x0854feac +_080B1614: + ldr r0, _080B1624 +_080B1616: + adds r1, r5, 0 + bl battle_load_arguments +_080B161C: + ldr r0, _080B1628 +_080B161E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B1624: .4byte 0x08550014 +_080B1628: .4byte 0x08271362 + thumb_func_end battle_configure_by_script + + thumb_func_start sub_80B162C +sub_80B162C: @ 80B162C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B1660 + strb r0, [r2] + ldr r4, _080B1664 + ldr r3, _080B1668 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r0, [r2, 0x8] + strh r0, [r4] + adds r1, 0x1 + adds r0, r1, 0 + bl battle_configure_by_script + ldr r0, _080B166C + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B1660: .4byte 0x03005df0 +_080B1664: .4byte 0x020375f2 +_080B1668: .4byte 0x02037350 +_080B166C: .4byte 0x08271354 + thumb_func_end sub_80B162C + + thumb_func_start sub_80B1670 +sub_80B1670: @ 80B1670 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B1698 + strb r0, [r2] + ldr r4, _080B169C + ldr r3, _080B16A0 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r0, [r2, 0x8] + strh r0, [r4] + adds r1, 0x1 + adds r0, r1, 0 + bl battle_configure_by_script + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B1698: .4byte 0x03005df0 +_080B169C: .4byte 0x020375f2 +_080B16A0: .4byte 0x02037350 + thumb_func_end sub_80B1670 + + thumb_func_start sub_80B16A4 +sub_80B16A4: @ 80B16A4 + push {lr} + ldr r0, _080B16B4 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_080B16B4: .4byte 0x08271354 + thumb_func_end sub_80B16A4 + + thumb_func_start sub_80B16B8 +sub_80B16B8: @ 80B16B8 + push {lr} + adds r0, 0x2 + bl sub_80B1268 + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80B16B8 + + thumb_func_start sub_80B16D8 +sub_80B16D8: @ 80B16D8 + push {r4,lr} + ldr r0, _080B1704 + ldrb r0, [r0] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B1708 + adds r4, r0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_running_behaviour_etc + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B1704: .4byte 0x03005df0 +_080B1708: .4byte 0x02037350 + thumb_func_end sub_80B16D8 + + thumb_func_start sub_80B170C +sub_80B170C: @ 80B170C + ldr r0, _080B1714 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080B1714: .4byte 0x02038bc8 + thumb_func_end sub_80B170C + + thumb_func_start sub_80B1718 +sub_80B1718: @ 80B1718 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B1734 + ldr r0, _080B1730 + ldrb r0, [r0] + bl sub_81A9AC4 + b _080B1752 + .align 2, 0 +_080B1730: .4byte 0x03005df0 +_080B1734: + bl sub_81D6074 + cmp r0, 0 + bne _080B174A + bl trainerflag_opponent + lsls r0, 16 + lsrs r0, 16 + bl flag_check + b _080B1752 +_080B174A: + ldr r0, _080B175C + ldrb r0, [r0] + bl sub_81D619C +_080B1752: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080B175C: .4byte 0x03005df0 + thumb_func_end sub_80B1718 + + thumb_func_start rom_npc_set_flag_for_script_id +rom_npc_set_flag_for_script_id: @ 80B1760 + push {lr} + ldr r0, _080B1788 + ldrh r0, [r0] + cmp r0, 0 + beq _080B1776 + bl sub_80B1290 + lsls r0, 16 + lsrs r0, 16 + bl flag_set +_080B1776: + bl trainerflag_opponent + lsls r0, 16 + lsrs r0, 16 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_080B1788: .4byte 0x02038bcc + thumb_func_end rom_npc_set_flag_for_script_id + + thumb_func_start sub_80B178C +sub_80B178C: @ 80B178C + push {lr} + bl trainerflag_opponent + lsls r0, 16 + lsrs r0, 16 + bl flag_set + pop {r0} + bx r0 + thumb_func_end sub_80B178C + + thumb_func_start trainer_flag_check +trainer_flag_check: @ 80B17A0 + push {lr} + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end trainer_flag_check + + thumb_func_start trainer_flag_set +trainer_flag_set: @ 80B17B8 + push {lr} + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl flag_set + pop {r0} + bx r0 + thumb_func_end trainer_flag_set + + thumb_func_start trainer_flag_clear +trainer_flag_clear: @ 80B17CC + push {lr} + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl flag_clear + pop {r0} + bx r0 + thumb_func_end trainer_flag_clear + + thumb_func_start sub_80B17E0 +sub_80B17E0: @ 80B17E0 + push {r4,lr} + ldr r0, _080B17F0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B17FC + ldr r1, _080B17F4 + ldr r0, _080B17F8 + b _080B1800 + .align 2, 0 +_080B17F0: .4byte 0x030060a8 +_080B17F4: .4byte 0x02022fec +_080B17F8: .4byte 0x00008009 +_080B17FC: + ldr r1, _080B1854 + movs r0, 0x8 +_080B1800: + str r0, [r1] + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B1884 + ldr r0, _080B1858 + movs r1, 0 + bl var_set + ldr r2, _080B1854 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 14 + orrs r0, r1 + str r0, [r2] + ldr r0, _080B185C + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B1864 + movs r0, 0x1 + bl sub_816306C + ldr r4, _080B1860 + adds r0, r4, 0 + bl zero_pokemon_struct + adds r0, r4, 0 + adds r0, 0x64 + bl zero_pokemon_struct + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl zero_pokemon_struct + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl zero_pokemon_struct + b _080B187A + .align 2, 0 +_080B1854: .4byte 0x02022fec +_080B1858: .4byte 0x0000400e +_080B185C: .4byte 0x030060a8 +_080B1860: .4byte 0x020247a8 +_080B1864: + movs r0, 0x1 + bl sub_8163048 + ldr r4, _080B1880 + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + adds r0, r4, 0 + bl zero_pokemon_struct +_080B187A: + bl sub_81A9B04 + b _080B18B8 + .align 2, 0 +_080B1880: .4byte 0x020247a8 +_080B1884: + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B18B8 + ldr r2, _080B18A8 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 19 + orrs r0, r1 + str r0, [r2] + ldr r0, _080B18AC + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B18B0 + bl sub_81D639C + b _080B18B4 + .align 2, 0 +_080B18A8: .4byte 0x02022fec +_080B18AC: .4byte 0x030060a8 +_080B18B0: + bl sub_81D6384 +_080B18B4: + bl sub_81D61E8 +_080B18B8: + ldr r1, _080B18F0 + ldr r2, _080B18F4 + ldrb r0, [r2] + strb r0, [r1] + movs r1, 0 + strb r1, [r2] + ldr r0, _080B18F8 + strb r1, [r0] + ldr r1, _080B18FC + movs r0, 0 + strh r0, [r1] + ldr r1, _080B1900 + ldr r0, _080B1904 + str r0, [r1, 0x8] + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080B18E8 + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B1908 +_080B18E8: + bl sub_80B0828 + b _080B190C + .align 2, 0 +_080B18F0: .4byte 0x02038bf9 +_080B18F4: .4byte 0x030060a8 +_080B18F8: .4byte 0x02038bf8 +_080B18FC: .4byte 0x03006080 +_080B1900: .4byte 0x030022c0 +_080B1904: .4byte sub_80B1918 + 1 +_080B1908: + bl task_add_01_battle_start_with_music_and_stats +_080B190C: + bl script_env_2_set_ctx_paused + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B17E0 + + thumb_func_start sub_80B1918 +sub_80B1918: @ 80B1918 + push {lr} + ldr r0, _080B1950 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _080B1946 + ldr r0, _080B1954 + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B1968 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080B1946 + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B195C +_080B1946: + ldr r0, _080B1958 + bl set_callback2 + b _080B198A + .align 2, 0 +_080B1950: .4byte 0x02038bca +_080B1954: .4byte 0x0202433a +_080B1958: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_080B195C: + ldr r0, _080B1964 + bl set_callback2 + b _080B198A + .align 2, 0 +_080B1964: .4byte c2_whiteout + 1 +_080B1968: + ldr r0, _080B1990 + bl set_callback2 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080B198A + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + bne _080B198A + bl sub_80B20BC + bl rom_npc_set_flag_for_script_id +_080B198A: + pop {r0} + bx r0 + .align 2, 0 +_080B1990: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80B1918 + + thumb_func_start sub_80B1994 +sub_80B1994: @ 80B1994 + push {lr} + ldr r0, _080B19AC + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _080B19B4 + ldr r0, _080B19B0 + bl set_callback2 + b _080B19E2 + .align 2, 0 +_080B19AC: .4byte 0x02038bca +_080B19B0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_080B19B4: + ldr r0, _080B19C8 + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B19D0 + ldr r0, _080B19CC + bl set_callback2 + b _080B19E2 + .align 2, 0 +_080B19C8: .4byte 0x0202433a +_080B19CC: .4byte c2_whiteout + 1 +_080B19D0: + ldr r0, _080B19E8 + bl set_callback2 + bl sub_80B20BC + bl rom_npc_set_flag_for_script_id + bl sub_80B22BC +_080B19E2: + pop {r0} + bx r0 + .align 2, 0 +_080B19E8: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80B1994 + + thumb_func_start sub_80B19EC +sub_80B19EC: @ 80B19EC + push {lr} + ldr r1, _080B1A08 + movs r0, 0x8 + str r0, [r1] + ldr r1, _080B1A0C + ldr r0, _080B1A10 + str r0, [r1, 0x8] + bl task_add_01_battle_start_with_music_and_stats + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .align 2, 0 +_080B1A08: .4byte 0x02022fec +_080B1A0C: .4byte 0x030022c0 +_080B1A10: .4byte sub_80B1994 + 1 + thumb_func_end sub_80B19EC + + thumb_func_start sub_80B1A14 +sub_80B1A14: @ 80B1A14 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B1A7C + ldr r0, _080B1A3C + ldrb r0, [r0] + cmp r0, 0x1 + bhi _080B1A44 + ldr r0, _080B1A40 + ldrb r0, [r0] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r0, 16 + bl sub_81A9EDC + b _080B1AD8 + .align 2, 0 +_080B1A3C: .4byte 0x030060a8 +_080B1A40: .4byte 0x020375f2 +_080B1A44: + ldr r3, _080B1A70 + ldr r2, _080B1A74 + ldr r0, _080B1A78 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r0, 16 + bl sub_81A9EDC + b _080B1AD8 + .align 2, 0 +_080B1A70: .4byte 0x02037350 +_080B1A74: .4byte 0x03006090 +_080B1A78: .4byte 0x02038bfc +_080B1A7C: + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B1AEC + ldr r0, _080B1AA4 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _080B1AAC + ldr r0, _080B1AA8 + ldrb r0, [r0] + bl battle_init + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2 + bl sub_81D572C + b _080B1AD8 + .align 2, 0 +_080B1AA4: .4byte 0x030060a8 +_080B1AA8: .4byte 0x020375f2 +_080B1AAC: + ldr r3, _080B1AE0 + ldr r2, _080B1AE4 + ldr r0, _080B1AE8 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + bl battle_init + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2 + bl sub_81D572C +_080B1AD8: + bl sub_80982B8 + b _080B1AF4 + .align 2, 0 +_080B1AE0: .4byte 0x02037350 +_080B1AE4: .4byte 0x03006090 +_080B1AE8: .4byte 0x02038bfc +_080B1AEC: + bl sub_80B1C7C + bl box_related_two__2 +_080B1AF4: + pop {r0} + bx r0 + thumb_func_end sub_80B1A14 + + thumb_func_start sub_80B1AF8 +sub_80B1AF8: @ 80B1AF8 + push {lr} + ldr r0, _080B1B08 + ldr r0, [r0] + cmp r0, 0 + bne _080B1B04 + ldr r0, _080B1B0C +_080B1B04: + pop {r1} + bx r1 + .align 2, 0 +_080B1B08: .4byte 0x02038bec +_080B1B0C: .4byte 0x082c8436 + thumb_func_end sub_80B1AF8 + + thumb_func_start sub_80B1B10 +sub_80B1B10: @ 80B1B10 + push {lr} + ldr r1, _080B1B30 + ldrb r2, [r1] + cmp r2, 0 + beq _080B1B3C + movs r0, 0 + strb r0, [r1] + ldr r0, _080B1B34 + ldr r2, [r0] + cmp r2, 0 + beq _080B1B54 + ldr r1, _080B1B38 + movs r0, 0x1 + strh r0, [r1] + adds r0, r2, 0 + b _080B1B56 + .align 2, 0 +_080B1B30: .4byte 0x02038bf8 +_080B1B34: .4byte 0x02038bf4 +_080B1B38: .4byte 0x03006080 +_080B1B3C: + ldr r0, _080B1B4C + ldr r1, [r0] + cmp r1, 0 + beq _080B1B54 + ldr r0, _080B1B50 + strh r2, [r0] + adds r0, r1, 0 + b _080B1B56 + .align 2, 0 +_080B1B4C: .4byte 0x02038bf0 +_080B1B50: .4byte 0x03006080 +_080B1B54: + ldr r0, _080B1B5C +_080B1B56: + pop {r1} + bx r1 + .align 2, 0 +_080B1B5C: .4byte 0x082742e6 + thumb_func_end sub_80B1B10 + + thumb_func_start sub_80B1B60 +sub_80B1B60: @ 80B1B60 + push {lr} + bl sub_80B1D18 + bl box_related_two__2 + pop {r0} + bx r0 + thumb_func_end sub_80B1B60 + + thumb_func_start sub_80B1B70 +sub_80B1B70: @ 80B1B70 + push {lr} + ldr r0, _080B1B80 + ldrb r0, [r0] + cmp r0, 0 + bne _080B1B88 + ldr r0, _080B1B84 + b _080B1B8A + .align 2, 0 +_080B1B80: .4byte 0x02038bfc +_080B1B84: .4byte 0x02038bca +_080B1B88: + ldr r0, _080B1BB0 +_080B1B8A: + ldrh r1, [r0] + ldr r0, _080B1BB4 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080B1C62 + cmp r0, 0x8 + beq _080B1C62 + adds r0, r1, 0 + bl sub_806D888 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bhi _080B1C5C + lsls r0, 2 + ldr r1, _080B1BB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B1BB0: .4byte 0x02038bcc +_080B1BB4: .4byte 0x02038bc8 +_080B1BB8: .4byte _080B1BBC + .align 2, 0 +_080B1BBC: + .4byte _080B1BF4 + .4byte _080B1BFA + .4byte _080B1C04 + .4byte _080B1C5C + .4byte _080B1C0C + .4byte _080B1C12 + .4byte _080B1C1C + .4byte _080B1C24 + .4byte _080B1C2C + .4byte _080B1C34 + .4byte _080B1C3C + .4byte _080B1C42 + .4byte _080B1C4C + .4byte _080B1C54 +_080B1BF4: + movs r0, 0xBE + lsls r0, 1 + b _080B1C5E +_080B1BFA: + ldr r0, _080B1C00 + b _080B1C5E + .align 2, 0 +_080B1C00: .4byte 0x00000197 +_080B1C04: + ldr r0, _080B1C08 + b _080B1C5E + .align 2, 0 +_080B1C08: .4byte 0x0000017b +_080B1C0C: + movs r0, 0xD0 + lsls r0, 1 + b _080B1C5E +_080B1C12: + ldr r0, _080B1C18 + b _080B1C5E + .align 2, 0 +_080B1C18: .4byte 0x000001a1 +_080B1C1C: + ldr r0, _080B1C20 + b _080B1C5E + .align 2, 0 +_080B1C20: .4byte 0x000001a3 +_080B1C24: + ldr r0, _080B1C28 + b _080B1C5E + .align 2, 0 +_080B1C28: .4byte 0x000001b9 +_080B1C2C: + ldr r0, _080B1C30 + b _080B1C5E + .align 2, 0 +_080B1C30: .4byte 0x00000181 +_080B1C34: + ldr r0, _080B1C38 + b _080B1C5E + .align 2, 0 +_080B1C38: .4byte 0x000001c1 +_080B1C3C: + movs r0, 0xE1 + lsls r0, 1 + b _080B1C5E +_080B1C42: + ldr r0, _080B1C48 + b _080B1C5E + .align 2, 0 +_080B1C48: .4byte 0x000001c3 +_080B1C4C: + ldr r0, _080B1C50 + b _080B1C5E + .align 2, 0 +_080B1C50: .4byte 0x000001c5 +_080B1C54: + ldr r0, _080B1C58 + b _080B1C5E + .align 2, 0 +_080B1C58: .4byte 0x0000018d +_080B1C5C: + ldr r0, _080B1C68 +_080B1C5E: + bl current_map_music_set +_080B1C62: + pop {r0} + bx r0 + .align 2, 0 +_080B1C68: .4byte 0x000001a7 + thumb_func_end sub_80B1B70 + + thumb_func_start sub_80B1C6C +sub_80B1C6C: @ 80B1C6C + push {lr} + cmp r0, 0 + bne _080B1C74 + ldr r0, _080B1C78 +_080B1C74: + pop {r1} + bx r1 + .align 2, 0 +_080B1C78: .4byte 0x085e8d03 + thumb_func_end sub_80B1C6C + + thumb_func_start sub_80B1C7C +sub_80B1C7C: @ 80B1C7C + push {lr} + ldr r0, _080B1C8C + ldrb r0, [r0] + cmp r0, 0 + beq _080B1C94 + ldr r0, _080B1C90 + b _080B1C96 + .align 2, 0 +_080B1C8C: .4byte 0x02038bfc +_080B1C90: .4byte 0x02038bd8 +_080B1C94: + ldr r0, _080B1CA0 +_080B1C96: + ldr r0, [r0] + bl sub_80B1C6C + pop {r1} + bx r1 + .align 2, 0 +_080B1CA0: .4byte 0x02038bd4 + thumb_func_end sub_80B1C7C + + thumb_func_start sub_80B1CA4 +sub_80B1CA4: @ 80B1CA4 + push {r4,lr} + ldr r0, _080B1CB8 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _080B1CBC + bl sub_80EA250 + b _080B1CC0 + .align 2, 0 +_080B1CB8: .4byte 0x02038bca +_080B1CBC: + ldr r0, _080B1CD8 + ldr r0, [r0] +_080B1CC0: + ldr r4, _080B1CDC + bl sub_80B1C6C + adds r1, r0, 0 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B1CD8: .4byte 0x02038bdc +_080B1CDC: .4byte 0x02021fc4 + thumb_func_end sub_80B1CA4 + + thumb_func_start sub_80B1CE0 +sub_80B1CE0: @ 80B1CE0 + push {r4,lr} + ldr r4, _080B1CFC + ldr r0, _080B1D00 + ldr r0, [r0] + bl sub_80B1C6C + adds r1, r0, 0 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B1CFC: .4byte 0x02021fc4 +_080B1D00: .4byte 0x02038be0 + thumb_func_end sub_80B1CE0 + + thumb_func_start sub_80B1D04 +sub_80B1D04: @ 80B1D04 + push {lr} + ldr r0, _080B1D14 + ldr r0, [r0] + bl sub_80B1C6C + pop {r1} + bx r1 + .align 2, 0 +_080B1D14: .4byte 0x02038be4 + thumb_func_end sub_80B1D04 + + thumb_func_start sub_80B1D18 +sub_80B1D18: @ 80B1D18 + push {lr} + ldr r0, _080B1D28 + ldr r0, [r0] + bl sub_80B1C6C + pop {r1} + bx r1 + .align 2, 0 +_080B1D28: .4byte 0x02038be8 + thumb_func_end sub_80B1D18 + + thumb_func_start sub_80B1D2C +sub_80B1D2C: @ 80B1D2C + push {lr} + lsls r1, 16 + lsrs r1, 16 + movs r3, 0 + adds r2, r0, 0 +_080B1D36: + ldrh r0, [r2] + cmp r0, r1 + bne _080B1D40 + adds r0, r3, 0 + b _080B1D4C +_080B1D40: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x4D + ble _080B1D36 + movs r0, 0x1 + negs r0, r0 +_080B1D4C: + pop {r1} + bx r1 + thumb_func_end sub_80B1D2C + + thumb_func_start sub_80B1D50 +sub_80B1D50: @ 80B1D50 + push {r4,r5,lr} + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + adds r2, r0, 0 +_080B1D5A: + movs r1, 0 + ldrh r0, [r2] + cmp r0, 0 + beq _080B1D80 + movs r3, 0 +_080B1D64: + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, r5 + bne _080B1D70 + adds r0, r4, 0 + b _080B1D8C +_080B1D70: + adds r3, 0x2 + adds r1, 0x1 + cmp r1, 0x4 + bgt _080B1D80 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080B1D64 +_080B1D80: + adds r2, 0x10 + adds r4, 0x1 + cmp r4, 0x4D + ble _080B1D5A + movs r0, 0x1 + negs r0, r0 +_080B1D8C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B1D50 + + thumb_func_start sub_80B1D94 +sub_80B1D94: @ 80B1D94 + push {lr} + cmp r0, 0x48 + ble _080B1D9E + movs r0, 0x1 + b _080B1DB8 +_080B1D9E: + cmp r0, 0x40 + bne _080B1DB6 + movs r0, 0x7E + bl flag_check + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _080B1DB2 + movs r1, 0x1 +_080B1DB2: + adds r0, r1, 0 + b _080B1DB8 +_080B1DB6: + movs r0, 0 +_080B1DB8: + pop {r1} + bx r1 + thumb_func_end sub_80B1D94 + + thumb_func_start sub_80B1DBC +sub_80B1DBC: @ 80B1DBC + push {r4-r6,lr} + adds r6, r1, 0 + movs r5, 0x1 + lsls r1, r6, 4 + adds r1, r0 + adds r4, r1, 0x2 + b _080B1DCE +_080B1DCA: + adds r4, 0x2 + adds r5, 0x1 +_080B1DCE: + cmp r5, 0x4 + bgt _080B1DE2 + ldrh r0, [r4] + cmp r0, 0 + beq _080B1DE2 + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + bne _080B1DCA +_080B1DE2: + ldr r0, _080B1DF4 + ldr r0, [r0] + ldr r1, _080B1DF8 + adds r0, r1 + adds r0, r6 + strb r5, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B1DF4: .4byte 0x03005d8c +_080B1DF8: .4byte 0x000009ca + thumb_func_end sub_80B1DBC + + thumb_func_start sub_80B1DFC +sub_80B1DFC: @ 80B1DFC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + movs r7, 0 + movs r5, 0 + adds r4, r6, 0 + adds r4, 0xA +_080B1E1A: + ldrh r0, [r4] + cmp r0, r9 + bne _080B1E74 + ldrh r0, [r4, 0x2] + cmp r0, r8 + bne _080B1E74 + adds r0, r5, 0 + bl sub_80B1D94 + cmp r0, 0 + bne _080B1E74 + ldr r0, _080B1E8C + ldr r0, [r0] + ldr r1, _080B1E90 + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080B1E72 + movs r1, 0xAE + lsls r1, 1 + adds r0, r5, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B1E74 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bhi _080B1E74 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80B1DBC +_080B1E72: + movs r7, 0x1 +_080B1E74: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x40 + ble _080B1E1A + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B1E8C: .4byte 0x03005d8c +_080B1E90: .4byte 0x000009ca + thumb_func_end sub_80B1DFC + + thumb_func_start sub_80B1E94 +sub_80B1E94: @ 80B1E94 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _080B1EBC + lsls r0, r4, 4 + adds r0, r5 + ldrh r0, [r0] + bl trainer_flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B1EB4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80B1DBC +_080B1EB4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B1EBC: .4byte 0x085500a4 + thumb_func_end sub_80B1E94 + + thumb_func_start sub_80B1EC0 +sub_80B1EC0: @ 80B1EC0 + push {r4-r6,lr} + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0 + adds r3, r0, 0 + adds r3, 0xA + ldr r5, _080B1EF0 +_080B1ED2: + ldrh r0, [r3] + cmp r0, r4 + bne _080B1EF8 + ldrh r0, [r3, 0x2] + cmp r0, r2 + bne _080B1EF8 + ldr r0, [r5] + ldr r6, _080B1EF4 + adds r0, r6 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080B1EF8 + movs r0, 0x1 + b _080B1F02 + .align 2, 0 +_080B1EF0: .4byte 0x03005d8c +_080B1EF4: .4byte 0x000009ca +_080B1EF8: + adds r3, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _080B1ED2 + movs r0, 0 +_080B1F02: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B1EC0 + + thumb_func_start sub_80B1F08 +sub_80B1F08: @ 80B1F08 + push {r4,lr} + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0 + adds r3, r0, 0 + adds r3, 0xA +_080B1F18: + ldrh r0, [r3] + cmp r0, r4 + bne _080B1F28 + ldrh r0, [r3, 0x2] + cmp r0, r2 + bne _080B1F28 + movs r0, 0x1 + b _080B1F32 +_080B1F28: + adds r3, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _080B1F18 + movs r0, 0 +_080B1F32: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B1F08 + + thumb_func_start sub_80B1F38 +sub_80B1F38: @ 80B1F38 + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B1F6C + cmp r1, 0x63 + bgt _080B1F6C + ldr r0, _080B1F64 + ldr r0, [r0] + ldr r2, _080B1F68 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080B1F6C + movs r0, 0x1 + b _080B1F6E + .align 2, 0 +_080B1F64: .4byte 0x03005d8c +_080B1F68: .4byte 0x000009ca +_080B1F6C: + movs r0, 0 +_080B1F6E: + pop {r1} + bx r1 + thumb_func_end sub_80B1F38 + + thumb_func_start sub_80B1F74 +sub_80B1F74: @ 80B1F74 + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D50 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B1FA8 + cmp r1, 0x63 + bgt _080B1FA8 + ldr r0, _080B1FA0 + ldr r0, [r0] + ldr r2, _080B1FA4 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080B1FA8 + movs r0, 0x1 + b _080B1FAA + .align 2, 0 +_080B1FA0: .4byte 0x03005d8c +_080B1FA4: .4byte 0x000009ca +_080B1FA8: + movs r0, 0 +_080B1FAA: + pop {r1} + bx r1 + thumb_func_end sub_80B1F74 + + thumb_func_start sub_80B1FB0 +sub_80B1FB0: @ 80B1FB0 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B1FD8 + movs r0, 0 + b _080B1FFE +_080B1FCA: + subs r0, r6, 0x1 + lsls r0, 1 + adds r0, r7, r0 + ldrh r0, [r0] + b _080B1FFE +_080B1FD4: + ldrh r0, [r5] + b _080B1FFE +_080B1FD8: + lsls r0, r1, 4 + adds r7, r4, r0 + movs r6, 0x1 + adds r5, r7, 0x2 + adds r4, r5, 0 +_080B1FE2: + ldrh r0, [r4] + cmp r0, 0 + beq _080B1FCA + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B1FD4 + adds r4, 0x2 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + ble _080B1FE2 + ldrh r0, [r7, 0x8] +_080B1FFE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B1FB0 + + thumb_func_start sub_80B2004 +sub_80B2004: @ 80B2004 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B2032 + movs r0, 0 + b _080B2054 +_080B201E: + subs r0, r5, 0x1 + lsls r0, 1 + adds r0, r6, r0 + ldrh r0, [r0] + b _080B2054 +_080B2028: + subs r0, r5, 0x1 + lsls r0, 1 + adds r0, r6, r0 + ldrh r0, [r0] + b _080B2054 +_080B2032: + lsls r0, r1, 4 + adds r6, r4, r0 + movs r5, 0x1 + adds r4, r6, 0x2 +_080B203A: + ldrh r0, [r4] + cmp r0, 0 + beq _080B201E + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B2028 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _080B203A + ldrh r0, [r6, 0x8] +_080B2054: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B2004 + + thumb_func_start sub_80B205C +sub_80B205C: @ 80B205C + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D50 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B207E + ldr r0, _080B2084 + ldr r0, [r0] + ldr r2, _080B2088 + adds r0, r2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080B207E: + pop {r0} + bx r0 + .align 2, 0 +_080B2084: .4byte 0x03005d8c +_080B2088: .4byte 0x000009ca + thumb_func_end sub_80B205C + + thumb_func_start sub_80B208C +sub_80B208C: @ 80B208C + push {r4,lr} + adds r3, r0, 0 + movs r1, 0 + movs r4, 0xAE + lsls r4, 1 + ldr r2, _080B20A4 +_080B2098: + ldrh r0, [r2] + cmp r0, r3 + bne _080B20A8 + adds r0, r1, r4 + b _080B20B2 + .align 2, 0 +_080B20A4: .4byte 0x085500a4 +_080B20A8: + adds r2, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _080B2098 + ldr r0, _080B20B8 +_080B20B2: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B20B8: .4byte 0x0000ffff + thumb_func_end sub_80B208C + + thumb_func_start sub_80B20BC +sub_80B20BC: @ 80B20BC + push {lr} + ldr r0, _080B20E8 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B20E2 + ldr r0, _080B20EC + ldrh r0, [r0] + bl sub_80B208C + adds r1, r0, 0 + ldr r0, _080B20F0 + cmp r1, r0 + beq _080B20E2 + lsls r0, r1, 16 + lsrs r0, 16 + bl flag_set +_080B20E2: + pop {r0} + bx r0 + .align 2, 0 +_080B20E8: .4byte 0x0000012f +_080B20EC: .4byte 0x02038bca +_080B20F0: .4byte 0x0000ffff + thumb_func_end sub_80B20BC + + thumb_func_start sub_80B20F4 +sub_80B20F4: @ 80B20F4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B211E + lsls r0, r1, 4 + adds r0, r4 + ldrh r0, [r0, 0x2] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B211E + movs r0, 0x1 + b _080B2120 +_080B211E: + movs r0, 0 +_080B2120: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B20F4 + + thumb_func_start sub_80B2128 +sub_80B2128: @ 80B2128 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + ldr r4, _080B2148 +_080B2130: + ldrh r0, [r4] + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B214C + adds r6, 0x1 + cmp r6, 0x4 + ble _080B214C + movs r0, 0x1 + b _080B2156 + .align 2, 0 +_080B2148: .4byte 0x08550584 +_080B214C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x7 + bls _080B2130 + movs r0, 0 +_080B2156: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B2128 + + thumb_func_start sub_80B215C +sub_80B215C: @ 80B215C + push {lr} + bl sub_80B2128 + cmp r0, 0 + beq _080B2184 + ldr r0, _080B2178 + ldr r0, [r0] + ldr r2, _080B217C + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0xFE + bls _080B2180 + movs r0, 0xFF + b _080B2182 + .align 2, 0 +_080B2178: .4byte 0x03005d8c +_080B217C: .4byte 0x000009c8 +_080B2180: + adds r0, 0x1 +_080B2182: + strh r0, [r1] +_080B2184: + pop {r0} + bx r0 + thumb_func_end sub_80B215C + + thumb_func_start sub_80B2188 +sub_80B2188: @ 80B2188 + push {lr} + bl sub_80B2128 + cmp r0, 0 + beq _080B21AC + ldr r0, _080B21A4 + ldr r0, [r0] + ldr r1, _080B21A8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFE + bls _080B21AC + movs r0, 0x1 + b _080B21AE + .align 2, 0 +_080B21A4: .4byte 0x03005d8c +_080B21A8: .4byte 0x000009c8 +_080B21AC: + movs r0, 0 +_080B21AE: + pop {r1} + bx r1 + thumb_func_end sub_80B2188 + + thumb_func_start sub_80B21B4 +sub_80B21B4: @ 80B21B4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + bl sub_80B2188 + cmp r0, 0 + beq _080B21E0 + ldr r0, _080B21E8 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80B1DFC + cmp r0, 0x1 + bne _080B21E0 + ldr r0, _080B21EC + ldr r0, [r0] + ldr r1, _080B21F0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] +_080B21E0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B21E8: .4byte 0x085500a4 +_080B21EC: .4byte 0x03005d8c +_080B21F0: .4byte 0x000009c8 + thumb_func_end sub_80B21B4 + + thumb_func_start sub_80B21F4 +sub_80B21F4: @ 80B21F4 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, _080B2210 + adds r1, r3, 0 + bl sub_80B1EC0 + pop {r1} + bx r1 + .align 2, 0 +_080B2210: .4byte 0x085500a4 + thumb_func_end sub_80B21F4 + + thumb_func_start sub_80B2214 +sub_80B2214: @ 80B2214 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, _080B2230 + adds r1, r3, 0 + bl sub_80B1F08 + pop {r1} + bx r1 + .align 2, 0 +_080B2230: .4byte 0x085500a4 + thumb_func_end sub_80B2214 + + thumb_func_start sub_80B2234 +sub_80B2234: @ 80B2234 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _080B224C + bl sub_80B1FB0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080B224C: .4byte 0x085500a4 + thumb_func_end sub_80B2234 + + thumb_func_start sub_80B2250 +sub_80B2250: @ 80B2250 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _080B2268 + bl sub_80B2004 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080B2268: .4byte 0x085500a4 + thumb_func_end sub_80B2250 + + thumb_func_start sub_80B226C +sub_80B226C: @ 80B226C + push {r4,r5,lr} + ldr r5, _080B2290 + ldr r4, _080B2294 + ldrh r1, [r4] + adds r0, r5, 0 + bl sub_80B1F38 + lsls r0, 24 + cmp r0, 0 + bne _080B2298 + ldrh r1, [r4] + adds r0, r5, 0 + bl sub_80B20F4 + lsls r0, 24 + lsrs r0, 24 + b _080B229A + .align 2, 0 +_080B2290: .4byte 0x085500a4 +_080B2294: .4byte 0x02038bca +_080B2298: + movs r0, 0x1 +_080B229A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B226C + + thumb_func_start sub_80B22A0 +sub_80B22A0: @ 80B22A0 + push {lr} + ldr r0, _080B22B4 + ldr r1, _080B22B8 + ldrh r1, [r1] + bl sub_80B1F74 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080B22B4: .4byte 0x085500a4 +_080B22B8: .4byte 0x02038bca + thumb_func_end sub_80B22A0 + + thumb_func_start sub_80B22BC +sub_80B22BC: @ 80B22BC + push {lr} + ldr r0, _080B22D0 + ldr r1, _080B22D4 + ldrh r1, [r1] + bl sub_80B205C + bl rom_npc_set_flag_for_script_id + pop {r0} + bx r0 + .align 2, 0 +_080B22D0: .4byte 0x085500a4 +_080B22D4: .4byte 0x02038bca + thumb_func_end sub_80B22BC + + thumb_func_start sub_80B22D8 +sub_80B22D8: @ 80B22D8 + push {lr} + ldr r1, _080B22F4 + ldrb r0, [r1] + cmp r0, 0x1 + bls _080B2300 + movs r0, 0 + strb r0, [r1] + ldr r1, _080B22F8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _080B22FC + movs r0, 0x1 + b _080B230A + .align 2, 0 +_080B22F4: .4byte 0x02038bf9 +_080B22F8: .4byte 0x02038bf8 +_080B22FC: .4byte 0x020375f0 +_080B2300: + ldr r1, _080B2310 + movs r0, 0 + strb r0, [r1] + ldr r1, _080B2314 + movs r0, 0 +_080B230A: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080B2310: .4byte 0x02038bf8 +_080B2314: .4byte 0x020375f0 + thumb_func_end sub_80B22D8 + + thumb_func_start sub_80B2318 +sub_80B2318: @ 80B2318 + push {r4-r7,lr} + lsls r0, 16 + ldr r7, _080B2334 + lsrs r4, r0, 12 + adds r6, r4, r7 + ldrh r0, [r6] + bl trainer_flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B2338 + movs r0, 0 + b _080B2364 + .align 2, 0 +_080B2334: .4byte 0x085500a4 +_080B2338: + movs r5, 0x1 + adds r0, r4, 0x2 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _080B2360 + adds r4, r6, 0x2 +_080B2346: + ldrh r0, [r4] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B2360 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + bgt _080B2360 + ldrh r0, [r4] + cmp r0, 0 + bne _080B2346 +_080B2360: + lsls r0, r5, 16 + lsrs r0, 16 +_080B2364: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B2318 + + thumb_func_start sub_80B236C +sub_80B236C: @ 80B236C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r4, _080B23A8 + adds r0, r4, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080B23A0 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B23AC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0xA] + strh r5, [r1, 0xC] +_080B23A0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B23A8: .4byte sub_80B2634 + 1 +_080B23AC: .4byte 0x03005e00 + thumb_func_end sub_80B236C + + thumb_func_start sub_80B23B0 +sub_80B23B0: @ 80B23B0 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _080B2410 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r5, _080B2414 + ldr r1, _080B2418 + adds r0, r5, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x58 + bl sub_81DB35C + 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 + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B2410: .4byte 0x02021cc4 +_080B2414: .4byte 0x02021fc4 +_080B2418: .4byte 0x085ee667 + thumb_func_end sub_80B23B0 + + thumb_func_start sub_80B241C +sub_80B241C: @ 80B241C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_819746C + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B241C + + thumb_func_start sub_80B243C +sub_80B243C: @ 80B243C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B2464 + adds r4, r1, r0 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r5, r0 + beq _080B2472 + cmp r5, 0x1 + bhi _080B2468 + ldrh r0, [r4, 0xA] + bl sub_80B241C + b _080B2470 + .align 2, 0 +_080B2464: .4byte 0x03005e08 +_080B2468: + ldrh r0, [r4, 0xA] + adds r1, r5, 0 + bl sub_80B23B0 +_080B2470: + strh r5, [r4, 0x6] +_080B2472: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B243C + + thumb_func_start sub_80B2478 +sub_80B2478: @ 80B2478 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_800A0C8 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x6 + bhi _080B24F0 + lsls r0, 2 + ldr r1, _080B249C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B249C: .4byte _080B24A0 + .align 2, 0 +_080B24A0: + .4byte _080B24BC + .4byte _080B24F0 + .4byte _080B24C0 + .4byte _080B24C4 + .4byte _080B24C8 + .4byte _080B24CC + .4byte _080B24EC +_080B24BC: + movs r0, 0x1 + b _080B24F2 +_080B24C0: + movs r0, 0x3 + b _080B24F2 +_080B24C4: + movs r0, 0x7 + b _080B24F2 +_080B24C8: + movs r0, 0x9 + b _080B24F2 +_080B24CC: + ldr r4, _080B24E8 + bl sub_800ABAC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + movs r0, 0x4 + b _080B24F2 + .align 2, 0 +_080B24E8: .4byte 0x02021cc4 +_080B24EC: + movs r0, 0xA + b _080B24F2 +_080B24F0: + movs r0, 0 +_080B24F2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B2478 + + thumb_func_start sub_80B24F8 +sub_80B24F8: @ 80B24F8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800B33C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B250E + movs r0, 0 + b _080B251E +_080B250E: + ldr r0, _080B2524 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B2528 + str r0, [r1] + movs r0, 0x1 +_080B251E: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B2524: .4byte 0x03005e00 +_080B2528: .4byte sub_80B2D2C + 1 + thumb_func_end sub_80B24F8 + + thumb_func_start sub_80B252C +sub_80B252C: @ 80B252C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080B2560 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080B2570 + bl sub_800B320 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080B2570 + ldr r0, _080B2564 + strh r1, [r0] + ldr r1, _080B2568 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080B256C + str r1, [r0] + movs r0, 0x1 + b _080B2572 + .align 2, 0 +_080B2560: .4byte 0x030022c0 +_080B2564: .4byte 0x020229c6 +_080B2568: .4byte 0x03005e00 +_080B256C: .4byte sub_80B2CEC + 1 +_080B2570: + movs r0, 0 +_080B2572: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B252C + + thumb_func_start sub_80B2578 +sub_80B2578: @ 80B2578 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800B320 + lsls r0, 24 + cmp r0, 0 + beq _080B258E + movs r0, 0x1 + bl sub_800B330 +_080B258E: + ldr r0, _080B25A0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080B25A4 + movs r0, 0 + b _080B25BA + .align 2, 0 +_080B25A0: .4byte 0x030022c0 +_080B25A4: + ldr r1, _080B25C0 + movs r0, 0 + strh r0, [r1] + ldr r1, _080B25C4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080B25C8 + str r1, [r0] + movs r0, 0x1 +_080B25BA: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B25C0: .4byte 0x020229c6 +_080B25C4: .4byte 0x03005e00 +_080B25C8: .4byte sub_80B2CEC + 1 + thumb_func_end sub_80B2578 + + thumb_func_start sub_80B25CC +sub_80B25CC: @ 80B25CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800B2E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B25E2 + movs r0, 0 + b _080B25F2 +_080B25E2: + ldr r0, _080B25F8 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B25FC + str r0, [r1] + movs r0, 0x1 +_080B25F2: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B25F8: .4byte 0x03005e00 +_080B25FC: .4byte sub_80B2D2C + 1 + thumb_func_end sub_80B25CC + + thumb_func_start sub_80B2600 +sub_80B2600: @ 80B2600 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080B2630 + lsls r1, r4, 2 + adds r1, r4 + 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, 0xA + bne _080B262A + movs r0, 0x2 + bl sub_800A4D8 + adds r0, r4, 0 + bl remove_task +_080B262A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B2630: .4byte 0x03005e00 + thumb_func_end sub_80B2600 + + thumb_func_start sub_80B2634 +sub_80B2634: @ 80B2634 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B2664 + adds r4, r1, r0 + movs r3, 0 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _080B266C + bl sub_800A0AC + bl sub_800AB98 + bl sub_800A2BC + ldr r0, _080B2668 + bl Window_AddFromTemplate + strh r0, [r4, 0xA] + b _080B2678 + .align 2, 0 +_080B2664: .4byte 0x03005e08 +_080B2668: .4byte 0x08550594 +_080B266C: + cmp r2, 0x9 + ble _080B2678 + subs r0, 0x8 + adds r0, r1, r0 + ldr r1, _080B2684 + str r1, [r0] +_080B2678: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B2684: .4byte sub_80B2688 + 1 + thumb_func_end sub_80B2634 + + thumb_func_start sub_80B2688 +sub_80B2688: @ 80B2688 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800ABAC + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B26FC + adds r0, r4, 0 + bl sub_80B2578 + cmp r0, 0x1 + beq _080B26FC + cmp r5, 0x1 + bls _080B26FC + movs r0, 0x1 + bl sub_800B330 + ldr r1, _080B26E0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0 + strh r0, [r4, 0xE] + bl sub_800ABBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B26EC + movs r0, 0x15 + bl audio_play + ldr r0, _080B26E4 + bl box_related_two__3 + ldr r0, _080B26E8 + b _080B26FA + .align 2, 0 +_080B26E0: .4byte 0x03005e00 +_080B26E4: .4byte 0x082780b3 +_080B26E8: .4byte sub_80B270C + 1 +_080B26EC: + movs r0, 0x16 + bl audio_play + ldr r0, _080B2704 + bl box_related_two__3 + ldr r0, _080B2708 +_080B26FA: + str r0, [r4] +_080B26FC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B2704: .4byte 0x08278131 +_080B2708: .4byte sub_80B2918 + 1 + thumb_func_end sub_80B2688 + + thumb_func_start sub_80B270C +sub_80B270C: @ 80B270C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B274C + adds r0, r4, 0 + bl sub_80B25CC + cmp r0, 0x1 + beq _080B274C + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B274C + bl textbox_any_visible + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080B274C + ldr r0, _080B2754 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0xE] + ldr r0, _080B2758 + str r0, [r1] +_080B274C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B2754: .4byte 0x03005e00 +_080B2758: .4byte sub_80B275C + 1 + thumb_func_end sub_80B270C + + thumb_func_start sub_80B275C +sub_80B275C: @ 80B275C + 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 + mov r8, r0 + ldr r0, _080B27F0 + mov r9, r0 + mov r7, r8 + add r7, r9 + bl sub_800ABAC + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B27E4 + adds r0, r4, 0 + bl sub_80B25CC + cmp r0, 0x1 + beq _080B27E4 + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B27E4 + adds r6, r5, 0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80B243C + ldr r0, _080B27F4 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B27E4 + movs r1, 0x2 + ldrsh r0, [r7, r1] + cmp r5, r0 + blt _080B27E4 + adds r0, r6, 0 + bl sub_800AA04 + ldrh r0, [r7, 0xA] + bl sub_80B241C + ldr r0, _080B27F8 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r0, _080B27FC + bl box_related_two__3 + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, _080B2800 + str r1, [r0] +_080B27E4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B27F0: .4byte 0x03005e08 +_080B27F4: .4byte 0x030022c0 +_080B27F8: .4byte 0x02021cc4 +_080B27FC: .4byte 0x082780f2 +_080B2800: .4byte sub_80B2804 + 1 + thumb_func_end sub_80B275C + + thumb_func_start sub_80B2804 +sub_80B2804: @ 80B2804 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + adds r0, r5, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B2898 + adds r0, r5, 0 + bl sub_80B25CC + cmp r0, 0x1 + beq _080B2898 + adds r0, r5, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B2898 + bl textbox_any_visible + lsls r0, 24 + cmp r0, 0 + bne _080B2898 + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B2852 + ldr r0, _080B2868 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080B2878 +_080B2852: + ldr r0, _080B286C + bl box_related_two__3 + ldr r1, _080B2870 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080B2874 + str r1, [r0] + b _080B2898 + .align 2, 0 +_080B2868: .4byte 0x030022c0 +_080B286C: .4byte 0x082780b3 +_080B2870: .4byte 0x03005e00 +_080B2874: .4byte sub_80B270C + 1 +_080B2878: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B2898 + movs r0, 0x5 + bl audio_play + bl sub_800A620 + ldr r0, _080B28A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B28A4 + str r0, [r1] +_080B2898: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B28A0: .4byte 0x03005e00 +_080B28A4: .4byte sub_80B28A8 + 1 + thumb_func_end sub_80B2804 + + thumb_func_start sub_80B28A8 +sub_80B28A8: @ 80B28A8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080B28EC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrb r7, [r5, 0xA] + ldrb r6, [r5, 0xC] + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B290A + adds r0, r4, 0 + bl sub_80B2D6C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B290A + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080B28F4 + ldr r0, _080B28F0 + b _080B2908 + .align 2, 0 +_080B28EC: .4byte 0x03005e00 +_080B28F0: .4byte sub_80B2D2C + 1 +_080B28F4: + ldr r4, _080B2910 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80B2478 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _080B290A + ldr r0, _080B2914 +_080B2908: + str r0, [r5] +_080B290A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B2910: .4byte 0x020375f0 +_080B2914: .4byte sub_80B2A08 + 1 + thumb_func_end sub_80B28A8 + + thumb_func_start sub_80B2918 +sub_80B2918: @ 80B2918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080B2970 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r7, r0, r1 + ldrb r6, [r7, 0xA] + ldrb r5, [r7, 0xC] + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B29E6 + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B29E6 + ldr r4, _080B2974 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80B2478 + adds r1, r0, 0 + strh r1, [r4] + lsls r0, r1, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _080B29E6 + subs r0, r1, 0x3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080B297C + bl sub_800AC34 + bl textbox_close + ldr r0, _080B2978 + b _080B29E4 + .align 2, 0 +_080B2970: .4byte 0x03005e00 +_080B2974: .4byte 0x020375f0 +_080B2978: .4byte sub_80B2CB0 + 1 +_080B297C: + cmp r2, 0x7 + beq _080B2984 + cmp r2, 0x9 + bne _080B2994 +_080B2984: + bl sub_80097E8 + bl textbox_close + ldr r0, _080B2990 + b _080B29E4 + .align 2, 0 +_080B2990: .4byte sub_80B2CB0 + 1 +_080B2994: + bl sub_800ABAC + ldr r4, _080B29F0 + strb r0, [r4] + bl link_get_multiplayer_id + ldr r1, _080B29F4 + strb r0, [r1] + ldrb r0, [r4] + bl sub_800AA04 + ldr r4, _080B29F8 + adds r0, r4, 0 + bl sub_80C30A4 + ldr r0, _080B29FC + mov r8, r0 + ldrb r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080B2A00 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r4, 0 + adds r1, 0x54 + strh r0, [r1] + mov r1, r8 + ldrb r0, [r1, 0x1] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, 0x56 + strh r0, [r4] + ldr r0, _080B2A04 +_080B29E4: + str r0, [r7] +_080B29E6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B29F0: .4byte 0x03005db8 +_080B29F4: .4byte 0x03005db4 +_080B29F8: .4byte 0x020228c4 +_080B29FC: .4byte 0x0203cef8 +_080B2A00: .4byte 0x02024488 +_080B2A04: .4byte sub_80B2C30 + 1 + thumb_func_end sub_80B2918 + + thumb_func_start sub_80B2A08 +sub_80B2A08: @ 80B2A08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B2ACE + ldr r0, _080B2A34 + ldrh r0, [r0] + cmp r0, 0x4 + bne _080B2A38 + bl sub_800A064 + cmp r0, 0 + bne _080B2A4A + bl sub_800AC34 + b _080B2A4E + .align 2, 0 +_080B2A34: .4byte 0x020375f0 +_080B2A38: + cmp r0, 0x3 + bne _080B2A42 + bl sub_800AC34 + b _080B2A4E +_080B2A42: + cmp r0, 0x7 + beq _080B2A4A + cmp r0, 0x9 + bne _080B2A6C +_080B2A4A: + bl sub_80097E8 +_080B2A4E: + bl textbox_close + ldr r0, _080B2A64 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B2A68 + str r0, [r1] + b _080B2ACE + .align 2, 0 +_080B2A64: .4byte 0x03005e00 +_080B2A68: .4byte sub_80B2CB0 + 1 +_080B2A6C: + bl sub_800ABAC + ldr r4, _080B2AD8 + strb r0, [r4] + bl link_get_multiplayer_id + ldr r1, _080B2ADC + strb r0, [r1] + ldrb r0, [r4] + bl sub_800AA04 + ldr r4, _080B2AE0 + adds r0, r4, 0 + bl sub_80C30A4 + ldr r0, _080B2AE4 + mov r8, r0 + ldrb r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080B2AE8 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r4, 0 + adds r1, 0x54 + strh r0, [r1] + mov r1, r8 + ldrb r0, [r1, 0x1] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, 0x56 + strh r0, [r4] + ldr r1, _080B2AEC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _080B2AF0 + str r1, [r0] + movs r0, 0x2 + bl sub_800A4D8 +_080B2ACE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B2AD8: .4byte 0x03005db8 +_080B2ADC: .4byte 0x03005db4 +_080B2AE0: .4byte 0x020228c4 +_080B2AE4: .4byte 0x0203cef8 +_080B2AE8: .4byte 0x02024488 +_080B2AEC: .4byte 0x03005e00 +_080B2AF0: .4byte sub_80B2C30 + 1 + thumb_func_end sub_80B2A08 + + thumb_func_start sub_80B2AF4 +sub_80B2AF4: @ 80B2AF4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r0, [sp] + str r1, [sp, 0x4] + movs r2, 0 + movs r7, 0 + ldr r1, _080B2B84 + movs r0, 0xFF + strb r0, [r1] + ldr r1, _080B2B88 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + movs r1, 0 + movs r0, 0xB + mov r10, r0 + ldr r0, _080B2B8C + mov r9, r0 +_080B2B20: + lsls r0, r1, 1 + adds r1, 0x1 + mov r8, r1 + ldr r1, [sp] + adds r4, r0, r1 + ldr r5, [sp, 0x4] + movs r6, 0x1 +_080B2B2E: + ldrh r0, [r4] + ldrh r1, [r5] + cmp r0, r1 + bne _080B2B5E + cmp r7, 0 + bne _080B2B48 + mov r1, r10 + muls r1, r0 + add r1, r9 + ldr r0, _080B2B84 + bl gf_strcpy + movs r2, 0x1 +_080B2B48: + cmp r7, 0x1 + bne _080B2B5C + ldrh r0, [r4] + mov r1, r10 + muls r1, r0 + add r1, r9 + ldr r0, _080B2B88 + bl gf_strcpy + movs r2, 0x1 +_080B2B5C: + adds r7, 0x1 +_080B2B5E: + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _080B2B2E + mov r1, r8 + cmp r1, 0x1 + ble _080B2B20 + ldr r0, _080B2B90 + strh r7, [r0] + adds r0, r2, 0 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B2B84: .4byte 0x02021cc4 +_080B2B88: .4byte 0x02021dc4 +_080B2B8C: .4byte 0x083185c8 +_080B2B90: .4byte 0x020375e2 + thumb_func_end sub_80B2AF4 + + thumb_func_start task_map_chg_seq_0807EC34 +task_map_chg_seq_0807EC34: @ 80B2B94 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _080B2BD8 + ldrh r0, [r5] + cmp r0, 0x1 + bne _080B2C10 + ldr r0, _080B2BDC + ldrh r2, [r0] + ldr r0, _080B2BE0 + cmp r2, r0 + beq _080B2BB2 + adds r0, 0x11 + cmp r2, r0 + bne _080B2BEC +_080B2BB2: + adds r0, r1, 0 + adds r0, 0x54 + adds r1, 0xB8 + bl sub_80B2AF4 + cmp r0, 0 + beq _080B2BEC + movs r0, 0xB + strh r0, [r5] + bl sub_800AC34 + ldr r1, _080B2BE4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080B2BE8 + str r1, [r0] + b _080B2C22 + .align 2, 0 +_080B2BD8: .4byte 0x02039b58 +_080B2BDC: .4byte 0x020229c6 +_080B2BE0: .4byte 0x00002266 +_080B2BE4: .4byte 0x03005e00 +_080B2BE8: .4byte sub_80B2CB0 + 1 +_080B2BEC: + ldr r1, _080B2C0C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x12] + bl sub_80B241C + bl script_env_2_enable_and_set_ctx_running + lsls r0, r4, 24 + lsrs r0, 24 + bl remove_task + b _080B2C22 + .align 2, 0 +_080B2C0C: .4byte 0x03005e00 +_080B2C10: + bl sub_800AC34 + ldr r0, _080B2C28 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B2C2C + str r0, [r1] +_080B2C22: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B2C28: .4byte 0x03005e00 +_080B2C2C: .4byte sub_80B2CB0 + 1 + thumb_func_end task_map_chg_seq_0807EC34 + + thumb_func_start sub_80B2C30 +sub_80B2C30: @ 80B2C30 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B2C9C + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9A8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B2C9C + movs r4, 0 + ldr r6, _080B2C58 + b _080B2C7E + .align 2, 0 +_080B2C58: .4byte 0x020229e8 +_080B2C5C: + movs r0, 0x64 + muls r0, r4 + ldr r1, _080B2CA4 + adds r0, r1 + lsls r1, r4, 8 + ldr r2, _080B2CA8 + adds r1, r2 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + adds r2, r6 + ldrb r2, [r2] + bl sub_80C3120 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B2C7E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _080B2C5C + movs r0, 0 + bl sub_800B330 + bl sub_800A5B4 + ldr r0, _080B2CAC + adds r1, r5, 0 + bl task_map_chg_seq_0807EC34 +_080B2C9C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B2CA4: .4byte 0x02039b58 +_080B2CA8: .4byte 0x020223c4 +_080B2CAC: .4byte 0x020375f0 + thumb_func_end sub_80B2C30 + + thumb_func_start sub_80B2CB0 +sub_80B2CB0: @ 80B2CB0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080B2CE4 + ldrb r0, [r0] + cmp r0, 0 + bne _080B2CDE + ldr r0, _080B2CE8 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x12] + bl sub_80B241C + bl script_env_2_enable_and_set_ctx_running + ldrb r0, [r4, 0x12] + bl Window_Remove + adds r0, r5, 0 + bl remove_task +_080B2CDE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B2CE4: .4byte 0x03003124 +_080B2CE8: .4byte 0x03005e00 + thumb_func_end sub_80B2CB0 + + thumb_func_start sub_80B2CEC +sub_80B2CEC: @ 80B2CEC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _080B2D24 + movs r0, 0x5 + strh r0, [r1] + ldr r0, _080B2D28 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x12] + bl sub_80B241C + bl sub_8098374 + ldrb r0, [r4, 0x12] + bl Window_Remove + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B2D24: .4byte 0x020375f0 +_080B2D28: .4byte 0x03005e00 + thumb_func_end sub_80B2CEC + + thumb_func_start sub_80B2D2C +sub_80B2D2C: @ 80B2D2C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _080B2D64 + movs r0, 0x6 + strh r0, [r1] + ldr r0, _080B2D68 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x12] + bl sub_80B241C + ldrb r0, [r4, 0x12] + bl Window_Remove + bl textbox_close + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B2D64: .4byte 0x020375f0 +_080B2D68: .4byte 0x03005e00 + thumb_func_end sub_80B2D2C + + thumb_func_start sub_80B2D6C +sub_80B2D6C: @ 80B2D6C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B2D90 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + strh r0, [r2, 0x10] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 18 + cmp r0, r1 + bgt _080B2D94 + movs r0, 0 + b _080B2D9A + .align 2, 0 +_080B2D90: .4byte 0x03005e00 +_080B2D94: + ldr r0, _080B2DA0 + str r0, [r2] + movs r0, 0x1 +_080B2D9A: + pop {r1} + bx r1 + .align 2, 0 +_080B2DA0: .4byte sub_80B2D2C + 1 + thumb_func_end sub_80B2D6C + + thumb_func_start sub_80B2DA4 +sub_80B2DA4: @ 80B2DA4 + push {r4,lr} + movs r3, 0x2 + movs r2, 0x2 + ldr r0, _080B2DBC + ldrh r0, [r0] + cmp r0, 0x2 + beq _080B2DDC + cmp r0, 0x2 + bgt _080B2DC0 + cmp r0, 0x1 + beq _080B2DCA + b _080B2E34 + .align 2, 0 +_080B2DBC: .4byte 0x020375e0 +_080B2DC0: + cmp r0, 0x5 + beq _080B2DEC + cmp r0, 0x9 + beq _080B2E00 + b _080B2E34 +_080B2DCA: + movs r3, 0x2 + ldr r1, _080B2DD4 + ldr r4, _080B2DD8 + b _080B2E30 + .align 2, 0 +_080B2DD4: .4byte 0x020229c6 +_080B2DD8: .4byte 0x00002233 +_080B2DDC: + movs r3, 0x2 + ldr r1, _080B2DE4 + ldr r4, _080B2DE8 + b _080B2E30 + .align 2, 0 +_080B2DE4: .4byte 0x020229c6 +_080B2DE8: .4byte 0x00002244 +_080B2DEC: + movs r3, 0x4 + movs r2, 0x4 + ldr r1, _080B2DF8 + ldr r4, _080B2DFC + b _080B2E30 + .align 2, 0 +_080B2DF8: .4byte 0x020229c6 +_080B2DFC: .4byte 0x00002255 +_080B2E00: + movs r3, 0x2 + ldr r0, _080B2E1C + ldr r0, [r0] + ldr r1, _080B2E20 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B2E2C + ldr r1, _080B2E24 + ldr r4, _080B2E28 + b _080B2E30 + .align 2, 0 +_080B2E1C: .4byte 0x03005d90 +_080B2E20: .4byte 0x00000ca9 +_080B2E24: .4byte 0x020229c6 +_080B2E28: .4byte 0x00002266 +_080B2E2C: + ldr r1, _080B2E44 + ldr r4, _080B2E48 +_080B2E30: + adds r0, r4, 0 + strh r0, [r1] +_080B2E34: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_80B236C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B2E44: .4byte 0x020229c6 +_080B2E48: .4byte 0x00002277 + thumb_func_end sub_80B2DA4 + + thumb_func_start sub_80B2E4C +sub_80B2E4C: @ 80B2E4C + push {lr} + ldr r1, _080B2E68 + ldr r2, _080B2E6C + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080B2E70 + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x2 + bl sub_80B236C + pop {r0} + bx r0 + .align 2, 0 +_080B2E68: .4byte 0x020229c6 +_080B2E6C: .4byte 0x00001133 +_080B2E70: .4byte 0x02022fec + thumb_func_end sub_80B2E4C + + thumb_func_start sub_80B2E74 +sub_80B2E74: @ 80B2E74 + push {lr} + ldr r1, _080B2E98 + movs r0, 0 + strh r0, [r1] + ldr r1, _080B2E9C + ldr r2, _080B2EA0 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080B2EA4 + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .align 2, 0 +_080B2E98: .4byte 0x020375f0 +_080B2E9C: .4byte 0x020229c6 +_080B2EA0: .4byte 0x00003311 +_080B2EA4: .4byte 0x02022fec + thumb_func_end sub_80B2E74 + + thumb_func_start sub_80B2EA8 +sub_80B2EA8: @ 80B2EA8 + push {r4,lr} + ldr r4, _080B2EDC + adds r0, r4, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080B2ED4 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080B2EE0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] +_080B2ED4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B2EDC: .4byte sub_80B2EE4 + 1 +_080B2EE0: .4byte 0x03005e00 + thumb_func_end sub_80B2EA8 + + thumb_func_start sub_80B2EE4 +sub_80B2EE4: @ 80B2EE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080B2F08 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B2F0C + cmp r0, 0x1 + beq _080B2FB4 + b _080B2FC6 + .align 2, 0 +_080B2F08: .4byte 0x03005e00 +_080B2F0C: + ldr r0, _080B2F3C + ldrh r0, [r0] + cmp r0, 0x1 + bne _080B2FA8 + movs r7, 0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + bl sub_8009FCC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r7, r5 + bge _080B2F74 + ldr r0, _080B2F40 + ldrb r2, [r0] + ldrh r3, [r0, 0x1A] + subs r1, r2, 0x1 + mov r12, r0 + cmp r1, 0x1 + bhi _080B2F4A + b _080B2F6E + .align 2, 0 +_080B2F3C: .4byte 0x020375f0 +_080B2F40: .4byte 0x020229e8 +_080B2F44: + movs r1, 0x1 + mov r8, r1 + b _080B2F56 +_080B2F4A: + cmp r2, 0x3 + bne _080B2F56 + cmp r3, 0x1 + bne _080B2F56 + movs r0, 0x1 + mov r9, r0 +_080B2F56: + adds r4, 0x1 + cmp r4, r5 + bge _080B2F74 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r12 + ldrb r2, [r0] + ldrh r3, [r0, 0x1A] + subs r0, r2, 0x1 + cmp r0, 0x1 + bhi _080B2F4A +_080B2F6E: + cmp r3, 0x1 + bne _080B2F44 + movs r7, 0x1 +_080B2F74: + mov r1, r8 + cmp r1, 0 + beq _080B2F82 + mov r0, r9 + cmp r0, 0 + beq _080B2F82 + movs r7, 0x1 +_080B2F82: + cmp r7, 0 + beq _080B2FA8 + ldr r1, _080B2FA0 + movs r0, 0xC + strh r0, [r1] + bl sub_800AD10 + ldr r1, _080B2FA4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _080B2FC6 + .align 2, 0 +_080B2FA0: .4byte 0x020375f0 +_080B2FA4: .4byte 0x03005e00 +_080B2FA8: + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl remove_task + b _080B2FC6 +_080B2FB4: + ldr r0, _080B2FD4 + ldrb r0, [r0] + cmp r0, 0 + bne _080B2FC6 + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl remove_task +_080B2FC6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B2FD4: .4byte 0x03003124 + thumb_func_end sub_80B2EE4 + + thumb_func_start sub_80B2FD8 +sub_80B2FD8: @ 80B2FD8 + push {lr} + ldr r1, _080B2FF4 + ldr r2, _080B2FF8 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080B2FFC + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .align 2, 0 +_080B2FF4: .4byte 0x020229c6 +_080B2FF8: .4byte 0x00004411 +_080B2FFC: .4byte 0x02022fec + thumb_func_end sub_80B2FD8 + + thumb_func_start sub_80B3000 +sub_80B3000: @ 80B3000 + push {lr} + ldr r1, _080B301C + ldr r2, _080B3020 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080B3024 + movs r0, 0 + str r0, [r1] + movs r0, 0x4 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .align 2, 0 +_080B301C: .4byte 0x020229c6 +_080B3020: .4byte 0x00006601 +_080B3024: .4byte 0x02022fec + thumb_func_end sub_80B3000 + + thumb_func_start sub_80B3028 +sub_80B3028: @ 80B3028 + push {lr} + ldr r1, _080B3044 + ldr r2, _080B3048 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080B304C + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .align 2, 0 +_080B3044: .4byte 0x020229c6 +_080B3048: .4byte 0x00006602 +_080B304C: .4byte 0x02022fec + thumb_func_end sub_80B3028 + + thumb_func_start sub_80B3050 +sub_80B3050: @ 80B3050 + push {lr} + ldr r0, _080B3064 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _080B3068 + movs r0, 0xFF + b _080B3134 + .align 2, 0 +_080B3064: .4byte sub_80B3144 + 1 +_080B3068: + ldr r0, _080B307C + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0x8 + bhi _080B3128 + lsls r0, 2 + ldr r1, _080B3080 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B307C: .4byte 0x020375e0 +_080B3080: .4byte _080B3084 + .align 2, 0 +_080B3084: + .4byte _080B30A8 + .4byte _080B30B8 + .4byte _080B3110 + .4byte _080B3120 + .4byte _080B30C8 + .4byte _080B3128 + .4byte _080B3128 + .4byte _080B3128 + .4byte _080B30D8 +_080B30A8: + ldr r1, _080B30B0 + ldr r2, _080B30B4 + b _080B3124 + .align 2, 0 +_080B30B0: .4byte 0x020229c6 +_080B30B4: .4byte 0x00002233 +_080B30B8: + ldr r1, _080B30C0 + ldr r2, _080B30C4 + b _080B3124 + .align 2, 0 +_080B30C0: .4byte 0x020229c6 +_080B30C4: .4byte 0x00002244 +_080B30C8: + ldr r1, _080B30D0 + ldr r2, _080B30D4 + b _080B3124 + .align 2, 0 +_080B30D0: .4byte 0x020229c6 +_080B30D4: .4byte 0x00002255 +_080B30D8: + ldr r0, _080B30F0 + ldr r0, [r0] + ldr r1, _080B30F4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B3100 + ldr r1, _080B30F8 + ldr r2, _080B30FC + b _080B3124 + .align 2, 0 +_080B30F0: .4byte 0x03005d90 +_080B30F4: .4byte 0x00000ca9 +_080B30F8: .4byte 0x020229c6 +_080B30FC: .4byte 0x00002266 +_080B3100: + ldr r1, _080B3108 + ldr r2, _080B310C + b _080B3124 + .align 2, 0 +_080B3108: .4byte 0x020229c6 +_080B310C: .4byte 0x00002277 +_080B3110: + ldr r1, _080B3118 + ldr r2, _080B311C + b _080B3124 + .align 2, 0 +_080B3118: .4byte 0x020229c6 +_080B311C: .4byte 0x00001111 +_080B3120: + ldr r1, _080B3138 + ldr r2, _080B313C +_080B3124: + adds r0, r2, 0 + strh r0, [r1] +_080B3128: + ldr r0, _080B3140 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 +_080B3134: + pop {r1} + bx r1 + .align 2, 0 +_080B3138: .4byte 0x020229c6 +_080B313C: .4byte 0x00003322 +_080B3140: .4byte sub_80B3144 + 1 + thumb_func_end sub_80B3050 + + thumb_func_start sub_80B3144 +sub_80B3144: @ 80B3144 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B3170 + adds r4, r1, r0 + movs r3, 0 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _080B3178 + bl sub_8009734 + bl sub_800A2BC + ldr r0, _080B3174 + movs r1, 0x50 + bl AddTask + b _080B3184 + .align 2, 0 +_080B3170: .4byte 0x03005e08 +_080B3174: .4byte task00_08081A90 + 1 +_080B3178: + cmp r2, 0x9 + ble _080B3184 + subs r0, 0x8 + adds r0, r1, r0 + ldr r1, _080B3190 + str r1, [r0] +_080B3184: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B3190: .4byte sub_80B3194 + 1 + thumb_func_end sub_80B3144 + + thumb_func_start sub_80B3194 +sub_80B3194: @ 80B3194 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080B31DA + bl sub_800ABBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B31CC + ldr r0, _080B31C4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B31C8 + b _080B31D8 + .align 2, 0 +_080B31C4: .4byte 0x03005e00 +_080B31C8: .4byte sub_80B31E8 + 1 +_080B31CC: + ldr r0, _080B31E0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B31E4 +_080B31D8: + str r0, [r1] +_080B31DA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B31E0: .4byte 0x03005e00 +_080B31E4: .4byte sub_80B3220 + 1 + thumb_func_end sub_80B3194 + + thumb_func_start sub_80B31E8 +sub_80B31E8: @ 80B31E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B3212 + bl sub_800A620 + ldr r0, _080B3218 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080B321C + str r0, [r1] +_080B3212: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B3218: .4byte 0x03005e00 +_080B321C: .4byte sub_80B3220 + 1 + thumb_func_end sub_80B31E8 + + thumb_func_start sub_80B3220 +sub_80B3220: @ 80B3220 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080B3250 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B3248 + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B3248 + bl sub_800AB18 + bl sub_8009F18 + adds r0, r4, 0 + bl remove_task +_080B3248: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B3250: .4byte 0x03003124 + thumb_func_end sub_80B3220 + + thumb_func_start sub_80B3254 +sub_80B3254: @ 80B3254 + push {lr} + bl sub_809FF80 + pop {r0} + bx r0 + thumb_func_end sub_80B3254 + + thumb_func_start sub_80B3260 +sub_80B3260: @ 80B3260 + push {lr} + cmp r0, 0x2 + beq _080B3284 + cmp r0, 0x2 + bgt _080B3270 + cmp r0, 0x1 + beq _080B327A + b _080B32A6 +_080B3270: + cmp r0, 0x5 + beq _080B3290 + cmp r0, 0x9 + beq _080B32A0 + b _080B32A6 +_080B327A: + ldr r1, _080B3280 + movs r0, 0xA + b _080B32A4 + .align 2, 0 +_080B3280: .4byte 0x02022fec +_080B3284: + ldr r1, _080B328C + movs r0, 0xB + b _080B32A4 + .align 2, 0 +_080B328C: .4byte 0x02022fec +_080B3290: + bl sub_80F94E8 + ldr r1, _080B329C + movs r0, 0x4B + b _080B32A4 + .align 2, 0 +_080B329C: .4byte 0x02022fec +_080B32A0: + ldr r1, _080B32AC + ldr r0, _080B32B0 +_080B32A4: + str r0, [r1] +_080B32A6: + pop {r0} + bx r0 + .align 2, 0 +_080B32AC: .4byte 0x02022fec +_080B32B0: .4byte 0x0000014b + thumb_func_end sub_80B3260 + + thumb_func_start sub_80B32B4 +sub_80B32B4: @ 80B32B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B32D8 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _080B33A0 + lsls r0, 2 + ldr r1, _080B32DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B32D8: .4byte 0x03005e00 +_080B32DC: .4byte _080B32E0 + .align 2, 0 +_080B32E0: + .4byte _080B32F8 + .4byte _080B3318 + .4byte _080B3328 + .4byte _080B3338 + .4byte _080B333E + .4byte _080B3354 +_080B32F8: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _080B3310 + ldr r2, _080B3314 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009FAC + b _080B3346 + .align 2, 0 +_080B3310: .4byte 0x020229c6 +_080B3314: .4byte 0x00002211 +_080B3318: + ldr r0, _080B3324 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + b _080B3342 + .align 2, 0 +_080B3324: .4byte 0x02037fd4 +_080B3328: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B33A0 + b _080B3346 +_080B3338: + bl sub_800AC34 + b _080B3346 +_080B333E: + ldr r0, _080B3350 + ldrb r0, [r0] +_080B3342: + cmp r0, 0 + bne _080B33A0 +_080B3346: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B33A0 + .align 2, 0 +_080B3350: .4byte 0x03003124 +_080B3354: + ldr r0, _080B3368 + ldr r0, [r0, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B3370 + ldr r0, _080B336C + bl current_map_music_set__default_for_battle + b _080B3378 + .align 2, 0 +_080B3368: .4byte 0x020229e8 +_080B336C: .4byte 0x000001dd +_080B3370: + movs r0, 0xEE + lsls r0, 1 + bl current_map_music_set__default_for_battle +_080B3378: + ldr r0, _080B33A8 + ldrh r0, [r0] + bl sub_80B3260 + bl overworld_free_bg_tilemaps + ldr r1, _080B33AC + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _080B33B0 + bl set_callback2 + ldr r1, _080B33B4 + ldr r0, _080B33B8 + str r0, [r1, 0x8] + adds r0, r5, 0 + bl remove_task +_080B33A0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B33A8: .4byte 0x020375e0 +_080B33AC: .4byte 0x02038bca +_080B33B0: .4byte sub_8036760 + 1 +_080B33B4: .4byte 0x030022c0 +_080B33B8: .4byte sub_80B360C + 1 + thumb_func_end sub_80B32B4 + + thumb_func_start sub_80B33BC +sub_80B33BC: @ 80B33BC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080B33E0 + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + bls _080B33D6 + b _080B3532 +_080B33D6: + lsls r0, 2 + ldr r1, _080B33E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B33E0: .4byte 0x03005e08 +_080B33E4: .4byte _080B33E8 + .align 2, 0 +_080B33E8: + .4byte _080B3408 + .4byte _080B342C + .4byte _080B3444 + .4byte _080B3458 + .4byte _080B34B0 + .4byte _080B34C4 + .4byte _080B34CE + .4byte _080B34DE +_080B3408: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _080B3424 + ldr r2, _080B3428 + adds r1, r2, 0 + strh r1, [r0] + bl sub_8009FAC + movs r0, 0x1 + strh r0, [r6] + b _080B3532 + .align 2, 0 +_080B3424: .4byte 0x020229c6 +_080B3428: .4byte 0x00002211 +_080B342C: + ldr r0, _080B3440 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080B343A + b _080B3532 +_080B343A: + movs r0, 0x2 + strh r0, [r6] + b _080B3532 + .align 2, 0 +_080B3440: .4byte 0x02037fd4 +_080B3444: + ldr r1, _080B3454 + movs r0, 0 + movs r2, 0x1C + bl link_0800A448 + movs r0, 0x3 + strh r0, [r6] + b _080B3532 + .align 2, 0 +_080B3454: .4byte 0x020229cc +_080B3458: + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B3532 + movs r4, 0 + ldr r5, _080B3470 + b _080B349A + .align 2, 0 +_080B3470: .4byte 0x020229e8 +_080B3474: + lsls r1, r4, 8 + ldr r2, _080B34AC + adds r0, r5, 0 + adds r1, r2 + 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 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_800A5EC + adds r5, 0x1C + adds r4, 0x1 +_080B349A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _080B3474 + movs r0, 0x4 + strh r0, [r6] + b _080B3532 + .align 2, 0 +_080B34AC: .4byte 0x020223c4 +_080B34B0: + ldrh r0, [r6, 0x2] + adds r0, 0x1 + strh r0, [r6, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B3532 + movs r0, 0x5 + strh r0, [r6] + b _080B3532 +_080B34C4: + bl sub_800ADF8 + movs r0, 0x6 + strh r0, [r6] + b _080B3532 +_080B34CE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080B3532 + movs r0, 0x7 + strh r0, [r6] + b _080B3532 +_080B34DE: + ldr r0, _080B34F4 + ldr r0, [r0, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B34FC + ldr r0, _080B34F8 + bl current_map_music_set__default_for_battle + b _080B3504 + .align 2, 0 +_080B34F4: .4byte 0x020229e8 +_080B34F8: .4byte 0x000001dd +_080B34FC: + movs r0, 0xEE + lsls r0, 1 + bl current_map_music_set__default_for_battle +_080B3504: + ldr r1, _080B3538 + ldr r0, _080B353C + str r0, [r1, 0x14] + ldr r0, _080B3540 + ldrh r0, [r0] + bl sub_80B3260 + bl overworld_free_bg_tilemaps + ldr r1, _080B3544 + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _080B3548 + bl set_callback2 + ldr r1, _080B354C + ldr r0, _080B3550 + str r0, [r1, 0x8] + adds r0, r4, 0 + bl remove_task +_080B3532: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B3538: .4byte 0x020229e8 +_080B353C: .4byte 0x00002211 +_080B3540: .4byte 0x020375e0 +_080B3544: .4byte 0x02038bca +_080B3548: .4byte sub_8036760 + 1 +_080B354C: .4byte 0x030022c0 +_080B3550: .4byte sub_80B360C + 1 + thumb_func_end sub_80B33BC + + thumb_func_start sub_80B3554 +sub_80B3554: @ 80B3554 + push {r4,lr} + ldr r0, _080B3570 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080B35E0 + cmp r0, 0x1 + bgt _080B3574 + cmp r0, 0 + beq _080B357A + b _080B35FE + .align 2, 0 +_080B3570: .4byte 0x030022c0 +_080B3574: + cmp r0, 0x2 + beq _080B35F8 + b _080B35FE +_080B357A: + bl sub_8009FCC + lsls r0, 24 + lsrs r3, r0, 24 + movs r4, 0 + movs r2, 0 + cmp r4, r3 + bge _080B35AC + ldr r1, _080B35C0 + ldrb r0, [r1] + subs r0, 0x4 + cmp r0, 0x1 + bls _080B35B0 +_080B3594: + adds r2, 0x1 + cmp r2, r3 + bge _080B35AC + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x4 + cmp r0, 0x1 + bhi _080B3594 + movs r4, 0x1 +_080B35AC: + cmp r4, 0 + beq _080B35C8 +_080B35B0: + ldr r0, _080B35C4 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + b _080B35FE + .align 2, 0 +_080B35C0: .4byte 0x020229e8 +_080B35C4: .4byte 0x030022c0 +_080B35C8: + bl sub_800AC34 + ldr r0, _080B35DC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _080B35FE + .align 2, 0 +_080B35DC: .4byte 0x030022c0 +_080B35E0: + ldr r0, _080B35F0 + ldrb r0, [r0] + cmp r0, 0 + bne _080B35FE + ldr r0, _080B35F4 + bl set_callback2 + b _080B35FE + .align 2, 0 +_080B35F0: .4byte 0x03003124 +_080B35F4: .4byte c2_exit_to_overworld_2_switch + 1 +_080B35F8: + ldr r0, _080B3608 + bl set_callback2 +_080B35FE: + bl run_active_tasks + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B3608: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_80B3554 + + thumb_func_start sub_80B360C +sub_80B360C: @ 80B360C + push {r4,r5,lr} + ldr r2, _080B365C + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + bl call_map_music_set_to_zero + bl copy_player_party_from_sav1 + bl sub_8076FE0 + bl sub_813BF10 + ldr r0, _080B3660 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080B36B2 + ldr r0, _080B3664 + ldrb r0, [r0] + movs r5, 0x1 + eors r0, r5 + bl sub_813C2A0 + ldr r0, _080B3668 + ldrb r0, [r0] + cmp r0, 0 + beq _080B36B2 + ldr r0, _080B366C + ldrb r0, [r0] + cmp r0, 0x1 + beq _080B3670 + cmp r0, 0x2 + beq _080B3694 + b _080B36B2 + .align 2, 0 +_080B365C: .4byte 0x02022fec +_080B3660: .4byte 0x020375e0 +_080B3664: .4byte 0x03005db4 +_080B3668: .4byte 0x030030fc +_080B366C: .4byte 0x0202433a +_080B3670: + ldr r4, _080B3690 + 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 r4, 0x4 + adds r1, r4 + ldr r1, [r1] + movs r0, 0 + bl sub_801B990 + b _080B36B2 + .align 2, 0 +_080B3690: .4byte 0x020229e8 +_080B3694: + ldr r4, _080B36C0 + 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 r4, 0x4 + adds r1, r4 + ldr r1, [r1] + movs r0, 0x1 + bl sub_801B990 +_080B36B2: + bl in_trade_center + cmp r0, 0x1 + bne _080B36CC + ldr r1, _080B36C4 + ldr r0, _080B36C8 + b _080B36D0 + .align 2, 0 +_080B36C0: .4byte 0x020229e8 +_080B36C4: .4byte 0x030022c0 +_080B36C8: .4byte sub_80B3554 + 1 +_080B36CC: + ldr r1, _080B36E0 + ldr r0, _080B36E4 +_080B36D0: + str r0, [r1, 0x8] + ldr r0, _080B36E8 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B36E0: .4byte 0x030022c0 +_080B36E4: .4byte c2_8056854 + 1 +_080B36E8: .4byte sub_80A0514 + 1 + thumb_func_end sub_80B360C + + thumb_func_start sub_80B36EC +sub_80B36EC: @ 80B36EC + push {lr} + ldr r0, _080B3718 + ldrh r1, [r0] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080B3706 + adds r0, r1, 0 + cmp r0, 0x5 + beq _080B3706 + cmp r0, 0x9 + bne _080B370E +_080B3706: + bl copy_player_party_from_sav1 + bl sub_8076FE0 +_080B370E: + movs r0, 0x7F + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + pop {r0} + bx r0 + .align 2, 0 +_080B3718: .4byte 0x020375e0 + thumb_func_end sub_80B36EC + + thumb_func_start sub_80B371C +sub_80B371C: @ 80B371C + push {lr} + bl sub_80872B0 + pop {r0} + bx r0 + thumb_func_end sub_80B371C + + thumb_func_start sub_80B3728 +sub_80B3728: @ 80B3728 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080B374C + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080B376C + cmp r0, 0x1 + bgt _080B3750 + cmp r0, 0 + beq _080B375A + b _080B37CC + .align 2, 0 +_080B374C: .4byte 0x03005e00 +_080B3750: + cmp r0, 0x2 + beq _080B378C + cmp r0, 0x3 + beq _080B37B8 + b _080B37CC +_080B375A: + ldr r0, _080B3768 + bl box_related_two__2 + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080B37CC + .align 2, 0 +_080B3768: .4byte 0x08278091 +_080B376C: + bl sub_809833C + lsls r0, 24 + cmp r0, 0 + beq _080B37CC + bl sub_8087288 + ldr r0, _080B3788 + ldrb r0, [r0] + bl sub_8009628 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080B37CC + .align 2, 0 +_080B3788: .4byte 0x020375e2 +_080B378C: + bl sub_8087214 + cmp r0, 0x1 + beq _080B379E + cmp r0, 0x1 + bcc _080B37CC + cmp r0, 0x2 + beq _080B37B2 + b _080B37CC +_080B379E: + bl textbox_close + movs r0, 0 + strh r0, [r5, 0x8] + bl sub_80872C4 + adds r0, r4, 0 + bl set_task_function_to_args_14_15 + b _080B37CC +_080B37B2: + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080B37CC +_080B37B8: + bl sub_808729C + movs r0, 0x1 + bl sub_8197AE8 + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080B37CC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B3728 + + thumb_func_start sub_80B37D4 +sub_80B37D4: @ 80B37D4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _080B37F8 + 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 + bl script_env_2_set_ctx_paused + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B37F8: .4byte sub_80B3728 + 1 + thumb_func_end sub_80B37D4 + + thumb_func_start sub_80B37FC +sub_80B37FC: @ 80B37FC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B3820 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B3840 + cmp r0, 0x1 + bgt _080B3824 + cmp r0, 0 + beq _080B382E + b _080B3884 + .align 2, 0 +_080B3820: .4byte 0x03005e00 +_080B3824: + cmp r0, 0x2 + beq _080B3854 + cmp r0, 0x3 + beq _080B3870 + b _080B3884 +_080B382E: + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl sub_8009FAC + b _080B3864 +_080B3840: + ldr r0, _080B3850 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B3884 + b _080B3864 + .align 2, 0 +_080B3850: .4byte 0x02037fd4 +_080B3854: + ldr r1, _080B386C + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + bl m4aMPlayAllStop + bl sub_800AC34 +_080B3864: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B3884 + .align 2, 0 +_080B386C: .4byte 0x02032298 +_080B3870: + ldr r0, _080B388C + ldrb r0, [r0] + cmp r0, 0 + bne _080B3884 + ldr r0, _080B3890 + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_080B3884: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B388C: .4byte 0x03003124 +_080B3890: .4byte sub_80773AC + 1 + thumb_func_end sub_80B37FC + + thumb_func_start sub_80B3894 +sub_80B3894: @ 80B3894 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B38B8 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B38D8 + cmp r0, 0x1 + bgt _080B38BC + cmp r0, 0 + beq _080B38C6 + b _080B391C + .align 2, 0 +_080B38B8: .4byte 0x03005e08 +_080B38BC: + cmp r0, 0x2 + beq _080B38EC + cmp r0, 0x3 + beq _080B3908 + b _080B391C +_080B38C6: + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl Rfu_set_zero + b _080B38FC +_080B38D8: + ldr r0, _080B38E8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B391C + b _080B38FC + .align 2, 0 +_080B38E8: .4byte 0x02037fd4 +_080B38EC: + ldr r1, _080B3904 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + bl m4aMPlayAllStop + bl sub_800ADF8 +_080B38FC: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080B391C + .align 2, 0 +_080B3904: .4byte 0x02032298 +_080B3908: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080B391C + bl sub_8013F78 + adds r0, r5, 0 + bl remove_task +_080B391C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B3894 + + thumb_func_start sub_80B3924 +sub_80B3924: @ 80B3924 + push {lr} + ldr r0, _080B3938 + ldrb r0, [r0] + cmp r0, 0 + beq _080B3940 + ldr r0, _080B393C + bl sub_80B37D4 + b _080B3946 + .align 2, 0 +_080B3938: .4byte 0x030030fc +_080B393C: .4byte sub_80B3894 + 1 +_080B3940: + ldr r0, _080B394C + bl sub_80B37D4 +_080B3946: + pop {r0} + bx r0 + .align 2, 0 +_080B394C: .4byte sub_80B37FC + 1 + thumb_func_end sub_80B3924 + + thumb_func_start sub_80B3950 +sub_80B3950: @ 80B3950 + push {lr} + ldr r0, _080B3960 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B3960: .4byte sub_80B37FC + 1 + thumb_func_end sub_80B3950 + + thumb_func_start nullsub_37 +nullsub_37: @ 80B3964 + bx lr + thumb_func_end nullsub_37 + + thumb_func_start sub_80B3968 +sub_80B3968: @ 80B3968 + push {lr} + ldr r1, _080B3984 + ldr r2, _080B3988 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _080B398C + ldrb r0, [r0] + cmp r0, 0 + beq _080B3994 + ldr r0, _080B3990 + bl sub_80B37D4 + b _080B399A + .align 2, 0 +_080B3984: .4byte 0x020229c6 +_080B3988: .4byte 0x00002211 +_080B398C: .4byte 0x030030fc +_080B3990: .4byte sub_80B33BC + 1 +_080B3994: + ldr r0, _080B39A0 + bl sub_80B37D4 +_080B399A: + pop {r0} + bx r0 + .align 2, 0 +_080B39A0: .4byte sub_80B32B4 + 1 + thumb_func_end sub_80B3968 + + thumb_func_start sub_80B39A4 +sub_80B39A4: @ 80B39A4 + push {lr} + ldr r0, _080B39B8 + movs r1, 0x50 + bl AddTask + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .align 2, 0 +_080B39B8: .4byte sub_80B3728 + 1 + thumb_func_end sub_80B39A4 + + thumb_func_start sp02A_crash_sound +sp02A_crash_sound: @ 80B39BC + push {lr} + ldr r0, _080B39CC + ldrb r0, [r0] + ldr r1, _080B39D0 + bl sub_80C4E74 + pop {r0} + bx r0 + .align 2, 0 +_080B39CC: .4byte 0x020375e4 +_080B39D0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sp02A_crash_sound + + thumb_func_start sub_80B39D4 +sub_80B39D4: @ 80B39D4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080B3A14 + strh r4, [r0] + ldr r0, _080B3A18 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + ldr r2, _080B3A1C + adds r1, r2 + bl gf_strcpy + adds r0, r4, 0 + bl sub_80C4904 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080B3A28 + ldr r0, _080B3A20 + ldr r2, _080B3A24 + subs r1, 0x1 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + movs r0, 0x1 + b _080B3A2A + .align 2, 0 +_080B3A14: .4byte 0x020375e4 +_080B3A18: .4byte 0x02021cc4 +_080B3A1C: .4byte 0x020229f0 +_080B3A20: .4byte 0x02021dc4 +_080B3A24: .4byte 0x0855059c +_080B3A28: + movs r0, 0 +_080B3A2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B39D4 + + thumb_func_start task00_08081A90 +task00_08081A90: @ 80B3A30 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080B3A90 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + movs r0, 0x96 + lsls r0, 17 + cmp r1, r0 + ble _080B3A62 + bl sub_80097E8 + ldr r0, _080B3A94 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_080B3A62: + ldr r0, _080B3A98 + ldrb r0, [r0] + cmp r0, 0 + beq _080B3AA6 + ldr r0, _080B3A9C + ldrb r0, [r0] + cmp r0, 0 + bne _080B3AA0 + bl sub_800AA60 + lsls r0, 24 + cmp r0, 0 + bne _080B3A86 + bl sub_80097E8 + ldr r0, _080B3A94 + bl set_callback2 +_080B3A86: + adds r0, r4, 0 + bl remove_task + b _080B3AA6 + .align 2, 0 +_080B3A90: .4byte 0x03005e00 +_080B3A94: .4byte c2_800ACD4 + 1 +_080B3A98: .4byte 0x03003124 +_080B3A9C: .4byte 0x030030fc +_080B3AA0: + adds r0, r5, 0 + bl remove_task +_080B3AA6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task00_08081A90 + + thumb_func_start sub_80B3AAC +sub_80B3AAC: @ 80B3AAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080B3ACC + ldrb r0, [r0] + cmp r0, 0 + bne _080B3AC4 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_080B3AC4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B3ACC: .4byte 0x03003124 + thumb_func_end sub_80B3AAC + + thumb_func_start sub_80B3AD0 +sub_80B3AD0: @ 80B3AD0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800AC34 + ldr r1, _080B3AF0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080B3AF4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B3AF0: .4byte 0x03005e00 +_080B3AF4: .4byte sub_80B3AAC + 1 + thumb_func_end sub_80B3AD0 + + thumb_func_start sub_80B3AF8 +sub_80B3AF8: @ 80B3AF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080B3B1C + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080B3B54 + cmp r0, 0x1 + bgt _080B3B20 + cmp r0, 0 + beq _080B3B2A + b _080B3BB8 + .align 2, 0 +_080B3B1C: .4byte 0x03005e08 +_080B3B20: + cmp r0, 0x2 + beq _080B3B68 + cmp r0, 0x3 + beq _080B3B9E + b _080B3BB8 +_080B3B2A: + ldr r0, _080B3B3C + ldrb r0, [r0] + cmp r0, 0 + beq _080B3B40 + adds r0, r4, 0 + bl remove_task + b _080B3BB8 + .align 2, 0 +_080B3B3C: .4byte 0x030030fc +_080B3B40: + bl sub_8009734 + ldr r0, _080B3B50 + movs r1, 0x1 + bl AddTask + b _080B3B96 + .align 2, 0 +_080B3B50: .4byte task00_08081A90 + 1 +_080B3B54: + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080B3BB8 + movs r0, 0 + strh r0, [r5, 0x2] + b _080B3B96 +_080B3B68: + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcc _080B3BB8 + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _080B3B96 + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _080B3BB8 + bl sub_800A620 +_080B3B96: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _080B3BB8 +_080B3B9E: + ldr r0, _080B3BC0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B3BB8 + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B3BB8 + adds r0, r4, 0 + bl remove_task +_080B3BB8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B3BC0: .4byte 0x03003124 + thumb_func_end sub_80B3AF8 + + thumb_func_start sub_80B3BC4 +sub_80B3BC4: @ 80B3BC4 + push {lr} + ldr r0, _080B3BDC + ldrb r0, [r0] + cmp r0, 0 + bne _080B3BD6 + ldr r1, _080B3BE0 + ldr r2, _080B3BE4 + adds r0, r2, 0 + strh r0, [r1] +_080B3BD6: + pop {r0} + bx r0 + .align 2, 0 +_080B3BDC: .4byte 0x030030fc +_080B3BE0: .4byte 0x020229c6 +_080B3BE4: .4byte 0x00002288 + thumb_func_end sub_80B3BC4 + + thumb_func_start sub_80B3BE8 +sub_80B3BE8: @ 80B3BE8 + push {r4-r7,lr} + ldr r0, _080B3C74 + movs r1, 0 + strb r1, [r0] + ldr r0, _080B3C78 + strb r1, [r0] + movs r4, 0 + ldr r6, _080B3C7C +_080B3BF8: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r6 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080B3C38 + ldrb r0, [r1, 0x7] + cmp r0, 0x1 + beq _080B3C12 + cmp r0, 0x3 + bne _080B3C38 +_080B3C12: + adds r0, r4, 0 + bl sub_80B3D00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080B3C42 + cmp r0, 0 + beq _080B3C38 + ldr r0, _080B3C74 + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0x1 + bhi _080B3C88 + bl sub_806B638 + lsls r0, 24 + cmp r0, 0 + bne _080B3C42 +_080B3C38: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080B3BF8 +_080B3C42: + ldr r0, _080B3C74 + ldrb r4, [r0] + adds r5, r0, 0 + cmp r4, 0x1 + bne _080B3C88 + bl sub_80B12E8 + ldr r2, _080B3C80 + ldrb r0, [r5] + subs r0, 0x1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldr r1, [r1] + bl sub_80B162C + ldr r0, _080B3C84 + strb r4, [r0] + movs r0, 0x1 + b _080B3CF4 + .align 2, 0 +_080B3C74: .4byte 0x030060a8 +_080B3C78: .4byte 0x02038bfc +_080B3C7C: .4byte 0x02037350 +_080B3C80: .4byte 0x03006090 +_080B3C84: .4byte 0x030060ac +_080B3C88: + ldrb r0, [r5] + cmp r0, 0x2 + bne _080B3CEC + bl sub_80B12E8 + movs r4, 0 + ldrb r5, [r5] + cmp r4, r5 + bcs _080B3CC6 + ldr r6, _080B3CDC + adds r7, r6, 0x4 + ldr r5, _080B3CE0 +_080B3CA0: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r0, r1, r6 + ldrb r0, [r0] + adds r1, r7 + ldr r1, [r1] + bl sub_80B1670 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r0, _080B3CE4 + ldrb r0, [r0] + cmp r4, r0 + bcc _080B3CA0 +_080B3CC6: + bl sub_80B16A4 + ldr r1, _080B3CE0 + movs r0, 0 + strb r0, [r1] + ldr r1, _080B3CE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _080B3CF4 + .align 2, 0 +_080B3CDC: .4byte 0x03006090 +_080B3CE0: .4byte 0x02038bfc +_080B3CE4: .4byte 0x030060a8 +_080B3CE8: .4byte 0x030060ac +_080B3CEC: + ldr r1, _080B3CFC + movs r0, 0 + strb r0, [r1] + movs r0, 0 +_080B3CF4: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B3CFC: .4byte 0x030060ac + thumb_func_end sub_80B3BE8 + + thumb_func_start sub_80B3D00 +sub_80B3D00: @ 80B3D00 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + mov r9, r0 + bl sub_81D6074 + cmp r0, 0x1 + bne _080B3D1E + bl sub_81D62AC + b _080B3D24 +_080B3D1E: + adds r0, r5, 0 + bl npc_get_script_by_npc_id +_080B3D24: + adds r7, r0, 0 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080B3D3E + adds r0, r5, 0 + bl sub_81A9AC4 +_080B3D36: + lsls r0, 24 +_080B3D38: + cmp r0, 0 + beq _080B3D56 + b _080B3DE0 +_080B3D3E: + bl sub_81D6074 + cmp r0, 0x1 + bne _080B3D4E + adds r0, r5, 0 + bl sub_81D619C + b _080B3D36 +_080B3D4E: + adds r0, r7, 0 + bl sub_80B16B8 + b _080B3D38 +_080B3D56: + lsls r4, r5, 3 + adds r0, r4, r5 + lsls r0, 2 + ldr r1, _080B3DD4 + adds r0, r1 + bl sub_80B3DF0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r4 + cmp r6, 0 + beq _080B3DE0 + ldrb r0, [r7, 0x1] + cmp r0, 0x4 + beq _080B3D7C + cmp r0, 0x7 + beq _080B3D7C + cmp r0, 0x6 + bne _080B3D8A +_080B3D7C: + bl sub_806B638 + lsls r0, 24 + cmp r0, 0 + bne _080B3DE0 + movs r1, 0x2 + mov r9, r1 +_080B3D8A: + ldr r2, _080B3DD8 + ldr r4, _080B3DDC + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r5, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0x4 + adds r0, r1 + str r7, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r6, [r0, 0x1] + mov r1, r8 + adds r0, r1, r5 + lsls r0, 2 + ldr r1, _080B3DD4 + adds r0, r1 + subs r1, r6, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl sub_80B406C + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + mov r0, r9 + b _080B3DE2 + .align 2, 0 +_080B3DD4: .4byte 0x02037350 +_080B3DD8: .4byte 0x03006090 +_080B3DDC: .4byte 0x030060a8 +_080B3DE0: + movs r0, 0 +_080B3DE2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B3D00 + + thumb_func_start sub_80B3DF0 +sub_80B3DF0: @ 80B3DF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + ldrb r0, [r7, 0x7] + mov r8, r4 + cmp r0, 0x1 + bne _080B3E50 + ldr r1, _080B3E48 + ldrb r0, [r7, 0x18] + lsls r0, 28 + lsrs r0, 26 + subs r0, 0x4 + adds r0, r1 + ldrb r1, [r7, 0x1D] + mov r2, sp + movs r3, 0 + ldrsh r2, [r2, r3] + movs r5, 0 + ldrsh r3, [r4, r5] + ldr r4, [r0] + adds r0, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r2, [r7, 0x18] + lsls r2, 28 + lsrs r2, 28 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80B3FB0 + lsls r0, 24 + lsrs r0, 24 + b _080B3E90 + .align 2, 0 +_080B3E48: .4byte 0x0855072c +_080B3E4C: + adds r0, r6, 0 + b _080B3E90 +_080B3E50: + movs r5, 0 +_080B3E52: + ldr r0, _080B3E9C + lsls r4, r5, 2 + adds r4, r0 + ldrb r1, [r7, 0x1D] + mov r0, sp + movs r6, 0 + ldrsh r2, [r0, r6] + mov r0, r8 + movs r6, 0 + ldrsh r3, [r0, r6] + ldr r4, [r4] + adds r0, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80B3FB0 + lsls r0, 24 + cmp r0, 0 + bne _080B3E4C + adds r5, r4, 0 + cmp r5, 0x3 + bls _080B3E52 + movs r0, 0 +_080B3E90: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B3E9C: .4byte 0x0855072c + thumb_func_end sub_80B3DF0 + + thumb_func_start sub_80B3EA0 +sub_80B3EA0: @ 80B3EA0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsls r2, 16 + asrs r2, 16 + cmp r0, r2 + bne _080B3EDA + lsls r0, r5, 16 + asrs r2, r0, 16 + ldrh r3, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r2, r0 + ble _080B3EDA + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + adds r1, r0 + cmp r2, r1 + bgt _080B3EDA + subs r0, r5, r3 + lsls r0, 24 + lsrs r0, 24 + b _080B3EDC +_080B3EDA: + movs r0, 0 +_080B3EDC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B3EA0 + + thumb_func_start sub_80B3EE4 +sub_80B3EE4: @ 80B3EE4 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsls r2, 16 + asrs r2, 16 + cmp r0, r2 + bne _080B3F1E + lsls r0, r5, 16 + asrs r2, r0, 16 + ldrh r3, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r2, r0 + bge _080B3F1E + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + subs r1, r0 + cmp r2, r1 + blt _080B3F1E + subs r0, r3, r5 + lsls r0, 24 + lsrs r0, 24 + b _080B3F20 +_080B3F1E: + movs r0, 0 +_080B3F20: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B3EE4 + + thumb_func_start sub_80B3F28 +sub_80B3F28: @ 80B3F28 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r3, 16 + asrs r3, 16 + cmp r0, r3 + bne _080B3F62 + lsls r0, r5, 16 + asrs r3, r0, 16 + ldrh r2, [r4, 0x10] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _080B3F62 + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + subs r1, r0 + cmp r3, r1 + blt _080B3F62 + subs r0, r2, r5 + lsls r0, 24 + lsrs r0, 24 + b _080B3F64 +_080B3F62: + movs r0, 0 +_080B3F64: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B3F28 + + thumb_func_start sub_80B3F6C +sub_80B3F6C: @ 80B3F6C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r3, 16 + asrs r3, 16 + cmp r0, r3 + bne _080B3FA6 + lsls r0, r5, 16 + asrs r3, r0, 16 + ldrh r2, [r4, 0x10] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + ble _080B3FA6 + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + adds r1, r0 + cmp r3, r1 + bgt _080B3FA6 + subs r0, r5, r2 + lsls r0, 24 + lsrs r0, 24 + b _080B3FA8 +_080B3FA6: + movs r0, 0 +_080B3FA8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B3F6C + + thumb_func_start sub_80B3FB0 +sub_80B3FB0: @ 80B3FB0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r1, 0 + beq _080B4056 + 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, r7, 0 + mov r1, sp + adds r2, r4, 0 + bl numbers_move_direction + movs r5, 0 + mov r8, r4 + mov r4, r9 + subs r4, 0x1 + cmp r5, r4 + bge _080B4028 +_080B3FEE: + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + adds r0, r6, 0 + adds r3, r7, 0 + bl sub_8092C8C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080B4014 + movs r0, 0x2 + negs r0, r0 + ands r1, r0 + cmp r1, 0 + bne _080B4056 +_080B4014: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r7, 0 + mov r1, sp + mov r2, r8 + bl numbers_move_direction + cmp r5, r4 + blt _080B3FEE +_080B4028: + ldrb r4, [r6, 0x19] + lsls r5, r4, 28 + lsrs r5, 28 + lsrs r4, 4 + movs r0, 0 + strb r0, [r6, 0x19] + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + adds r0, r6, 0 + adds r3, r7, 0 + bl npc_block_way + lsls r0, 24 + lsrs r1, r0, 24 + lsls r4, 4 + orrs r5, r4 + strb r5, [r6, 0x19] + cmp r1, 0x4 + beq _080B405A +_080B4056: + movs r0, 0 + b _080B405C +_080B405A: + mov r0, r9 +_080B405C: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B3FB0 + + thumb_func_start sub_80B406C +sub_80B406C: @ 80B406C + push {r4,r5,lr} + lsls r5, r1, 24 + lsrs r5, 24 + ldr r0, _080B40B8 + movs r1, 0x50 + bl AddTask + ldr r4, _080B40BC + ldr r3, _080B40C0 + ldrb r2, [r3] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strb r0, [r1, 0x8] + ldrb r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x8] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B40C4 + adds r1, r0 + strh r5, [r1, 0xE] + ldrb r2, [r3] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0] + strh r0, [r1, 0x16] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B40B8: .4byte c3_8081EDC + 1 +_080B40BC: .4byte 0x03006090 +_080B40C0: .4byte 0x030060a8 +_080B40C4: .4byte 0x03005e00 + thumb_func_end sub_80B406C + + thumb_func_start sub_80B40C8 +sub_80B40C8: @ 80B40C8 + push {r4,r5,lr} + adds r2, r0, 0 + ldr r0, _080B40DC + ldrb r0, [r0] + cmp r0, 0 + bne _080B40E4 + ldr r0, _080B40E0 + ldrb r5, [r0, 0x8] + b _080B40E8 + .align 2, 0 +_080B40DC: .4byte 0x02038bfc +_080B40E0: .4byte 0x03006090 +_080B40E4: + ldr r0, _080B410C + ldrb r5, [r0, 0x14] +_080B40E8: + ldr r4, _080B4110 + adds r0, r5, 0 + adds r1, r4, 0 + bl set_task_function_and_args_14_15 + ldr r1, _080B4114 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + adds r0, r5, 0 + bl _call_via_r4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B410C: .4byte 0x03006090 +_080B4110: .4byte c3_8081EDC + 1 +_080B4114: .4byte 0x03005e00 + thumb_func_end sub_80B40C8 + + thumb_func_start c3_8081EDC +c3_8081EDC: @ 80B4118 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _080B4148 + adds r4, r0, r1 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B414C + adds r5, r0, r1 + ldrb r0, [r5] + lsls r0, 31 + cmp r0, 0 + bne _080B4150 + adds r0, r6, 0 + bl set_task_function_to_args_14_15 + b _080B416C + .align 2, 0 +_080B4148: .4byte 0x03005e00 +_080B414C: .4byte 0x02037350 +_080B4150: + ldr r7, _080B4174 +_080B4152: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r7 + ldr r3, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B4152 +_080B416C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B4174: .4byte 0x0855073c + thumb_func_end c3_8081EDC + + thumb_func_start sub_80B4178 +sub_80B4178: @ 80B4178 + movs r0, 0 + bx lr + thumb_func_end sub_80B4178 + + thumb_func_start sub_80B417C +sub_80B417C: @ 80B417C + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + ldr r1, _080B41BC + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl npc_get_local_id_and_mapnumbers + movs r0, 0 + bl oe_exec + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B41BC: .4byte 0x02038c08 + thumb_func_end sub_80B417C + + thumb_func_start sub_80B41C0 +sub_80B41C0: @ 80B41C0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + beq _080B41D6 + movs r0, 0 + b _080B41F8 +_080B41D6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r0, [r5, 0x6] + subs r0, 0x39 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080B41EC + movs r0, 0x6 + strh r0, [r4, 0x8] +_080B41EC: + ldrb r0, [r5, 0x6] + cmp r0, 0x3F + bne _080B41F6 + movs r0, 0x8 + strh r0, [r4, 0x8] +_080B41F6: + movs r0, 0x1 +_080B41F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B41C0 + + thumb_func_start sub_80B4200 +sub_80B4200: @ 80B4200 + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B421E + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B4252 +_080B421E: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080B4244 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_8093388 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] + b _080B4252 +_080B4244: + adds r0, r4, 0 + movs r1, 0x3E + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B4252: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B4200 + + thumb_func_start sub_80B425C +sub_80B425C: @ 80B425C + push {r4-r6,lr} + adds r6, r1, 0 + adds r5, r2, 0 + adds r0, r5, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B427A + adds r0, r5, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B4308 +_080B427A: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_running_behaviour_etc + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_808F23C + adds r0, r5, 0 + bl sub_808F208 + ldr r0, _080B4310 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B4314 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B42D2 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B4308 +_080B42D2: + bl sub_808BCE8 + ldr r0, _080B4310 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B4314 + adds r4, r0 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl direction_reversed + lsls r0, 24 + lsrs r0, 24 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B4308: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B4310: .4byte 0x02037590 +_080B4314: .4byte 0x02037350 + thumb_func_end sub_80B425C + + thumb_func_start sub_80B4318 +sub_80B4318: @ 80B4318 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080B4354 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B4358 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B4344 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B434A +_080B4344: + adds r0, r5, 0 + bl set_task_function_to_args_14_15 +_080B434A: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B4354: .4byte 0x02037590 +_080B4358: .4byte 0x02037350 + thumb_func_end sub_80B4318 + + thumb_func_start sub_80B435C +sub_80B435C: @ 80B435C + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B437A + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B4388 +_080B437A: + adds r0, r4, 0 + movs r1, 0x59 + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B4388: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B435C + + thumb_func_start sub_80B4390 +sub_80B4390: @ 80B4390 + push {r4,lr} + adds r4, r1, 0 + adds r0, r2, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B43A4 + movs r0, 0x3 + strh r0, [r4, 0x8] +_080B43A4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B4390 + + thumb_func_start sub_80B43AC +sub_80B43AC: @ 80B43AC + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B43CA + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B43D8 +_080B43CA: + adds r0, r4, 0 + movs r1, 0x3E + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B43D8: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B43AC + + thumb_func_start sub_80B43E0 +sub_80B43E0: @ 80B43E0 + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + cmp r0, 0 + beq _080B4426 + ldr r2, _080B4430 + movs r1, 0x10 + ldrsh r0, [r4, r1] + str r0, [r2] + movs r1, 0x12 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + ldr r3, _080B4434 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r2, 0x8] + movs r0, 0x2 + str r0, [r2, 0xC] + movs r0, 0x31 + bl oe_exec + strh r0, [r5, 0x10] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B4426: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B4430: .4byte 0x02038c08 +_080B4434: .4byte 0x02020630 + thumb_func_end sub_80B43E0 + + thumb_func_start sub_80B4438 +sub_80B4438: @ 80B4438 + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + ldr r2, _080B44A8 + movs r1, 0x10 + ldrsh r0, [r5, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x2B + ldrb r0, [r1] + cmp r0, 0x2 + bne _080B44A0 + ldrb r1, [r4, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x3] + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r1, [r4, 0x4] + 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] + adds r0, r4, 0 + bl sub_8093284 + 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 npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B44A0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B44A8: .4byte 0x02020630 + thumb_func_end sub_80B4438 + + thumb_func_start sub_80B44AC +sub_80B44AC: @ 80B44AC + push {r4,lr} + adds r4, r1, 0 + movs r0, 0x31 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B44C0 + movs r0, 0x3 + strh r0, [r4, 0x8] +_080B44C0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B44AC + + thumb_func_start sub_80B44C8 +sub_80B44C8: @ 80B44C8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B455C + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0xA + mov r1, sp + bl sub_806F684 + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B44FA + ldr r0, [sp] + bl rom_npc_by_local_id_and_map_get_trainer_flag + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_080B44FA: + ldr r1, _080B4560 + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r2, [sp] + ldr r3, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl _call_via_r3 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + bne _080B4564 + movs r0, 0x31 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B4564 + ldr r4, [sp] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_running_behaviour_etc + ldr r4, [sp] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808F23C + adds r0, r5, 0 + bl remove_task + b _080B456E + .align 2, 0 +_080B455C: .4byte 0x03005e00 +_080B4560: .4byte 0x0855076c +_080B4564: + ldr r2, [sp] + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] +_080B456E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B44C8 + + thumb_func_start sub_80B4578 +sub_80B4578: @ 80B4578 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B45A4 + movs r1, 0 + bl AddTask + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _080B45A8 + adds r0, r1 + adds r0, 0x2 + adds r1, r4, 0 + bl sub_806F67C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B45A4: .4byte sub_80B44C8 + 1 +_080B45A8: .4byte 0x03005e08 + thumb_func_end sub_80B4578 + + thumb_func_start sub_80B45AC +sub_80B45AC: @ 80B45AC + push {lr} + ldr r0, _080B45B8 + bl sub_80B40C8 + pop {r0} + bx r0 + .align 2, 0 +_080B45B8: .4byte sub_80B45BC + 1 + thumb_func_end sub_80B45AC + + thumb_func_start sub_80B45BC +sub_80B45BC: @ 80B45BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80B45BC + + thumb_func_start sub_80B45D0 +sub_80B45D0: @ 80B45D0 + push {lr} + ldr r0, _080B45FC + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B4610 + ldr r1, _080B4600 + ldrb r0, [r1] + cmp r0, 0 + bne _080B460C + adds r0, 0x1 + strb r0, [r1] + ldr r1, _080B4604 + movs r0, 0x1 + strh r0, [r1] + bl sub_809757C + ldr r0, _080B4608 + ldrb r0, [r0, 0xC] + bl sub_80974D0 + b _080B4616 + .align 2, 0 +_080B45FC: .4byte 0x030060a8 +_080B4600: .4byte 0x02038bfc +_080B4604: .4byte 0x020375f0 +_080B4608: .4byte 0x03006090 +_080B460C: + movs r0, 0 + strb r0, [r1] +_080B4610: + ldr r1, _080B461C + movs r0, 0 + strh r0, [r1] +_080B4616: + pop {r0} + bx r0 + .align 2, 0 +_080B461C: .4byte 0x020375f0 + thumb_func_end sub_80B45D0 + + thumb_func_start oei_exclamation_mark +oei_exclamation_mark: @ 80B4620 + push {lr} + ldr r0, _080B4650 + movs r1, 0 + movs r2, 0 + movs r3, 0x53 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080B4648 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B4654 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_80B46D8 +_080B4648: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B4650: .4byte 0x085507b4 +_080B4654: .4byte 0x02020630 + thumb_func_end oei_exclamation_mark + + thumb_func_start sub_80B4658 +sub_80B4658: @ 80B4658 + push {lr} + ldr r0, _080B4688 + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080B4680 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B468C + adds r0, r1 + movs r1, 0x21 + movs r2, 0x1 + bl sub_80B46D8 +_080B4680: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B4688: .4byte 0x085507b4 +_080B468C: .4byte 0x02020630 + thumb_func_end sub_80B4658 + + thumb_func_start sub_80B4690 +sub_80B4690: @ 80B4690 + push {r4,lr} + ldr r0, _080B46D0 + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080B46C6 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B46D4 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2E + movs r2, 0 + bl sub_80B46D8 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x5] +_080B46C6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B46D0: .4byte 0x085507cc +_080B46D4: .4byte 0x02020630 + thumb_func_end sub_80B4690 + + thumb_func_start sub_80B46D8 +sub_80B46D8: @ 80B46D8 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldrb r4, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + ands r3, r4 + movs r4, 0x4 + orrs r3, r4 + strb r3, [r0, 0x5] + movs r3, 0x3E + adds r3, r0 + mov r12, r3 + ldrb r3, [r3] + movs r4, 0x2 + orrs r3, r4 + mov r4, r12 + strb r3, [r4] + ldr r4, _080B471C + ldr r3, [r4] + strh r3, [r0, 0x2E] + ldr r3, [r4, 0x4] + strh r3, [r0, 0x30] + ldr r3, [r4, 0x8] + strh r3, [r0, 0x32] + ldr r3, _080B4720 + strh r3, [r0, 0x34] + strh r1, [r0, 0x3C] + adds r1, r2, 0 + bl obj_anim_image_start + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B471C: .4byte 0x02038c08 +_080B4720: .4byte 0x0000fffb + thumb_func_end sub_80B46D8 + + thumb_func_start objc_exclamation_mark_probably +objc_exclamation_mark_probably: @ 80B4724 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _080B4756 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B4764 +_080B4756: + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl oe_stop + b _080B47B2 +_080B4764: + ldr r2, _080B47A8 + 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 + ldr r0, _080B47AC + adds r1, r0 + ldrh r3, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r2, r3, r0 + strh r2, [r4, 0x36] + ldrh r0, [r1, 0x20] + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0x10 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x24] + strh r0, [r4, 0x24] + ldrh r0, [r1, 0x26] + adds r0, r2 + strh r0, [r4, 0x26] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _080B47B0 + adds r0, r3, 0x1 + strh r0, [r4, 0x34] + b _080B47B2 + .align 2, 0 +_080B47A8: .4byte 0x02037350 +_080B47AC: .4byte 0x02020630 +_080B47B0: + strh r2, [r4, 0x34] +_080B47B2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end objc_exclamation_mark_probably + + thumb_func_start sub_80B47BC +sub_80B47BC: @ 80B47BC + push {lr} + ldr r0, _080B47CC + ldrb r0, [r0] + cmp r0, 0 + beq _080B47D4 + ldr r0, _080B47D0 + ldrb r0, [r0, 0xC] + b _080B47D8 + .align 2, 0 +_080B47CC: .4byte 0x02038bfc +_080B47D0: .4byte 0x03006090 +_080B47D4: + ldr r0, _080B47DC + ldrb r0, [r0] +_080B47D8: + pop {r1} + bx r1 + .align 2, 0 +_080B47DC: .4byte 0x03006090 + thumb_func_end sub_80B47BC + + thumb_func_start sub_80B47E0 +sub_80B47E0: @ 80B47E0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080B47EE + movs r0, 0 + b _080B4800 +_080B47EE: + cmp r0, 0 + beq _080B47FC + ldr r0, _080B47F8 + ldrb r0, [r0, 0xC] + b _080B4800 + .align 2, 0 +_080B47F8: .4byte 0x03006090 +_080B47FC: + ldr r0, _080B4804 + ldrb r0, [r0] +_080B4800: + pop {r1} + bx r1 + .align 2, 0 +_080B4804: .4byte 0x03006090 + thumb_func_end sub_80B47E0 + + thumb_func_start sub_80B4808 +sub_80B4808: @ 80B4808 + push {lr} + ldr r0, _080B4858 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B4870 + ldr r2, _080B485C + ldr r0, _080B4860 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B4864 + adds r0, r1 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl direction_reversed + lsls r0, 24 + lsrs r0, 24 + bl d2s_look1 + ldr r3, _080B4868 + strb r0, [r3] + movs r0, 0xFE + strb r0, [r3, 0x1] + ldr r0, _080B486C + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0xFF + bl exec_movement + b _080B489E + .align 2, 0 +_080B4858: .4byte 0x030060ac +_080B485C: .4byte 0x03006090 +_080B4860: .4byte 0x03006080 +_080B4864: .4byte 0x02037350 +_080B4868: .4byte 0x03006084 +_080B486C: .4byte 0x03005d8c +_080B4870: + ldr r0, _080B48A8 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B48AC + adds r0, r1 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl d2s_look1 + ldr r3, _080B48B0 + strb r0, [r3] + movs r0, 0xFE + strb r0, [r3, 0x1] + ldr r0, _080B48B4 + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0xFF + bl exec_movement +_080B489E: + movs r0, 0xFF + bl sub_809BE48 + pop {r0} + bx r0 + .align 2, 0 +_080B48A8: .4byte 0x02037590 +_080B48AC: .4byte 0x02037350 +_080B48B0: .4byte 0x03006084 +_080B48B4: .4byte 0x03005d8c + thumb_func_end sub_80B4808 + + thumb_func_start sub_80B48B8 +sub_80B48B8: @ 80B48B8 + ldr r1, _080B48C0 + strb r0, [r1] + bx lr + .align 2, 0 +_080B48C0: .4byte 0x02038c00 + thumb_func_end sub_80B48B8 + + thumb_func_start sub_80B48C4 +sub_80B48C4: @ 80B48C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + ldr r3, _080B494C + lsls r1, r2, 1 + adds r1, r2 + lsls r2, r1, 1 + adds r2, r3 + adds r0, r1, 0x1 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + mov r9, r0 + adds r1, 0x2 + lsls r1, 1 + adds r1, r3 + ldrh r6, [r1] + ldrh r5, [r2] + cmp r5, r9 + bhi _080B496E + ldr r0, _080B4950 + mov r10, r0 +_080B4906: + movs r4, 0 + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0] + cmp r4, r0 + bge _080B4964 + ldr r1, [sp] + lsls r0, r1, 16 + asrs r0, 16 + mov r8, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r7, r0, 16 +_080B4920: + adds r0, r4, 0x7 + adds r1, r5, 0x7 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089660 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B4954 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r8, r4 + bne _080B4954 + cmp r7, r5 + bne _080B4954 + adds r0, r6, 0 + b _080B4974 + .align 2, 0 +_080B494C: .4byte 0x08553a7c +_080B4950: .4byte 0x02037318 +_080B4954: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0] + cmp r4, r0 + blt _080B4920 +_080B4964: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r9 + bls _080B4906 +_080B496E: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 +_080B4974: + 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_80B48C4 + + thumb_func_start sub_80B4984 +sub_80B4984: @ 80B4984 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + movs r7, 0 + ldr r0, _080B49FC + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x88 + lsls r0, 6 + cmp r1, r0 + bne _080B4A7A + add r5, sp, 0xC + mov r4, sp + adds r4, 0xE + adds r0, r5, 0 + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + ldrh r0, [r5] + subs r0, 0x7 + strh r0, [r5] + ldrh r0, [r4] + subs r0, 0x7 + strh r0, [r4] + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, _080B4A00 + mov r9, r5 + mov r8, r4 + ldrh r2, [r0, 0x6] + cmp r1, r2 + blt _080B49D0 + ldrh r3, [r0, 0x8] + cmp r1, r3 + bgt _080B49D0 + movs r7, 0x1 +_080B49D0: + mov r2, r8 + movs r3, 0 + ldrsh r1, [r2, r3] + ldrh r2, [r0, 0xC] + cmp r1, r2 + blt _080B49E4 + ldrh r0, [r0, 0xE] + cmp r1, r0 + bgt _080B49E4 + movs r7, 0x2 +_080B49E4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bls _080B4A08 + b _080B4A7A + .align 2, 0 +_080B49FC: .4byte 0x03005d8c +_080B4A00: .4byte 0x08553a7c +_080B4A04: + movs r0, 0x1 + b _080B4A7C +_080B4A08: + ldr r0, _080B4A8C + ldr r0, [r0] + ldr r3, _080B4A90 + adds r0, r3 + ldrh r0, [r0] + bl sub_80B4AB8 + movs r5, 0 + ldr r6, _080B4A94 +_080B4A1A: + bl sub_80B4A98 + lsls r1, r5, 1 + mov r2, sp + adds r4, r2, r1 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __umodsi3 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bne _080B4A38 + strh r6, [r4] +_080B4A38: + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080B4A4A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080B4A4A: + cmp r5, 0x6 + bne _080B4A1A + mov r3, r9 + movs r1, 0 + ldrsh r0, [r3, r1] + mov r2, r8 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r2, r7, 0 + bl sub_80B48C4 + lsls r0, 16 + lsrs r1, r0, 16 + movs r5, 0 +_080B4A66: + lsls r0, r5, 1 + add r0, sp + ldrh r0, [r0] + cmp r1, r0 + beq _080B4A04 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _080B4A66 +_080B4A7A: + movs r0, 0 +_080B4A7C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B4A8C: .4byte 0x03005d8c +_080B4A90: .4byte 0x00002e6a +_080B4A94: .4byte 0x000001bf + thumb_func_end sub_80B4984 + + thumb_func_start sub_80B4A98 +sub_80B4A98: @ 80B4A98 + ldr r2, _080B4AAC + ldr r1, [r2] + ldr r0, _080B4AB0 + muls r0, r1 + ldr r1, _080B4AB4 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .align 2, 0 +_080B4AAC: .4byte 0x02038c04 +_080B4AB0: .4byte 0x41c64e6d +_080B4AB4: .4byte 0x00003039 + thumb_func_end sub_80B4A98 + + thumb_func_start sub_80B4AB8 +sub_80B4AB8: @ 80B4AB8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080B4AC4 + str r0, [r1] + bx lr + .align 2, 0 +_080B4AC4: .4byte 0x02038c04 + thumb_func_end sub_80B4AB8 + + thumb_func_start wild_pokemon_rand_grass +wild_pokemon_rand_grass: @ 80B4AC8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _080B4AE4 + movs r0, 0 + b _080B4B7E +_080B4AE4: + adds r0, r1, 0 + subs r0, 0x14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080B4AF4 + movs r0, 0x1 + b _080B4B7E +_080B4AF4: + adds r0, r1, 0 + subs r0, 0x28 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B04 + movs r0, 0x2 + b _080B4B7E +_080B4B04: + adds r0, r1, 0 + subs r0, 0x32 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B14 + movs r0, 0x3 + b _080B4B7E +_080B4B14: + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B24 + movs r0, 0x4 + b _080B4B7E +_080B4B24: + adds r0, r1, 0 + subs r0, 0x46 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B34 + movs r0, 0x5 + b _080B4B7E +_080B4B34: + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080B4B44 + movs r0, 0x6 + b _080B4B7E +_080B4B44: + adds r0, r1, 0 + subs r0, 0x55 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080B4B54 + movs r0, 0x7 + b _080B4B7E +_080B4B54: + adds r0, r1, 0 + subs r0, 0x5A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080B4B64 + movs r0, 0x8 + b _080B4B7E +_080B4B64: + adds r0, r1, 0 + subs r0, 0x5E + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080B4B74 + movs r0, 0x9 + b _080B4B7E +_080B4B74: + cmp r1, 0x62 + beq _080B4B7C + movs r0, 0xB + b _080B4B7E +_080B4B7C: + movs r0, 0xA +_080B4B7E: + pop {r1} + bx r1 + thumb_func_end wild_pokemon_rand_grass + + thumb_func_start wild_pokemon_rand_water +wild_pokemon_rand_water: @ 80B4B84 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r1, 0x3B + bhi _080B4BA2 + movs r0, 0 + b _080B4BD4 +_080B4BA2: + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1D + bhi _080B4BB2 + movs r0, 0x1 + b _080B4BD4 +_080B4BB2: + adds r0, r1, 0 + subs r0, 0x5A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080B4BC2 + movs r0, 0x2 + b _080B4BD4 +_080B4BC2: + adds r0, r2, 0 + subs r0, 0x5F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _080B4BD2 + movs r0, 0x4 + b _080B4BD4 +_080B4BD2: + movs r0, 0x3 +_080B4BD4: + pop {r1} + bx r1 + thumb_func_end wild_pokemon_rand_water + + thumb_func_start sub_80B4BD8 +sub_80B4BD8: @ 80B4BD8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + movs r5, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0x1 + beq _080B4C12 + cmp r4, 0x1 + bgt _080B4C02 + cmp r4, 0 + beq _080B4C08 + b _080B4C6C +_080B4C02: + cmp r6, 0x2 + beq _080B4C36 + b _080B4C6C +_080B4C08: + movs r5, 0x1 + cmp r1, 0x45 + bhi _080B4C6C + movs r5, 0 + b _080B4C6C +_080B4C12: + cmp r1, 0x3B + bhi _080B4C18 + movs r5, 0x2 +_080B4C18: + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080B4C26 + movs r5, 0x3 +_080B4C26: + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080B4C6C + movs r5, 0x4 + b _080B4C6C +_080B4C36: + cmp r1, 0x27 + bhi _080B4C3C + movs r5, 0x5 +_080B4C3C: + adds r0, r1, 0 + subs r0, 0x28 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x27 + bhi _080B4C4A + movs r5, 0x6 +_080B4C4A: + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + bhi _080B4C58 + movs r5, 0x7 +_080B4C58: + adds r0, r1, 0 + subs r0, 0x5F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080B4C66 + movs r5, 0x8 +_080B4C66: + cmp r1, 0x63 + bne _080B4C6C + movs r5, 0x9 +_080B4C6C: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B4BD8 + + thumb_func_start sub_80B4C74 +sub_80B4C74: @ 80B4C74 + push {r4-r7,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + ldrb r1, [r4] + cmp r0, r1 + bcc _080B4C86 + ldrb r7, [r4] + adds r6, r0, 0 + b _080B4C8A +_080B4C86: + ldrb r7, [r4, 0x1] + ldrb r6, [r4] +_080B4C8A: + subs r4, r6, r7 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _080B4CDC + adds r0, r5, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B4CEA + adds r0, r5, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x37 + beq _080B4CC8 + cmp r0, 0x48 + beq _080B4CC8 + cmp r0, 0x2E + bne _080B4CEA +_080B4CC8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B4CE0 + adds r0, r6, 0 + b _080B4CF0 + .align 2, 0 +_080B4CDC: .4byte 0x020244ec +_080B4CE0: + cmp r4, 0 + beq _080B4CEA + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B4CEA: + adds r0, r7, r4 + lsls r0, 24 + lsrs r0, 24 +_080B4CF0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B4C74 + + thumb_func_start get_wild_data_index_for_map +get_wild_data_index_for_map: @ 80B4CF8 + push {r4-r6,lr} + movs r4, 0 + ldr r0, _080B4D48 + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0xFF + beq _080B4D6C + ldr r6, _080B4D4C +_080B4D08: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r5 + ldrb r1, [r3] + ldr r0, _080B4D50 + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080B4D58 + ldrb r1, [r3, 0x1] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080B4D58 + ldrh r0, [r2, 0x4] + cmp r0, r6 + bne _080B4D44 + ldr r0, _080B4D54 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _080B4D3E + movs r0, 0 +_080B4D3E: + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_080B4D44: + adds r0, r4, 0 + b _080B4D6E + .align 2, 0 +_080B4D48: .4byte 0x08552d48 +_080B4D4C: .4byte 0x00006a18 +_080B4D50: .4byte 0x03005d8c +_080B4D54: .4byte 0x0000403e +_080B4D58: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080B4D08 +_080B4D6C: + ldr r0, _080B4D74 +_080B4D6E: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B4D74: .4byte 0x0000ffff + thumb_func_end get_wild_data_index_for_map + + thumb_func_start sub_80B4D78 +sub_80B4D78: @ 80B4D78 + push {r4-r7,lr} + sub sp, 0x1C + bl flag_check_is_in_safari_zone + cmp r0, 0x1 + bne _080B4E0E + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4F + bhi _080B4E0E + bl sub_80FC3B8 + adds r7, r0, 0 + cmp r7, 0 + beq _080B4E0E + movs r5, 0 +_080B4DA6: + mov r1, sp + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x18 + bls _080B4DA6 + movs r5, 0 +_080B4DB8: + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + adds r6, r1, 0 + cmp r4, 0x18 + bhi _080B4DE8 + add r5, sp +_080B4DC6: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080B4DDE + ldrb r2, [r5] + mov r0, sp + adds r1, r0, r4 + ldrb r0, [r1] + strb r0, [r5] + strb r2, [r1] +_080B4DDE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x18 + bls _080B4DC6 +_080B4DE8: + lsls r0, r6, 24 + lsrs r5, r0, 24 + cmp r5, 0x17 + bls _080B4DB8 + movs r5, 0 +_080B4DF2: + mov r1, sp + adds r4, r1, r5 + ldrb r0, [r4] + adds r1, r7, 0 + bl sub_8136FE4 + lsls r0, 16 + cmp r0, 0 + bgt _080B4E48 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x18 + bls _080B4DF2 +_080B4E0E: + ldr r4, _080B4E44 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B4E4C + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1C + bne _080B4E4C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B4E4C + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + b _080B4E54 + .align 2, 0 +_080B4E44: .4byte 0x020244ec +_080B4E48: + ldrb r0, [r4] + b _080B4E5E +_080B4E4C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 +_080B4E54: + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 +_080B4E5E: + add sp, 0x1C + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B4D78 + + thumb_func_start sub_80B4E68 +sub_80B4E68: @ 80B4E68 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + bl zero_enemy_party_data + movs r2, 0x1 + ldr r1, _080B4EF8 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _080B4E96 + cmp r0, 0 + blt _080B4E98 + cmp r0, 0xFF + bgt _080B4E98 + cmp r0, 0xFE + blt _080B4E98 +_080B4E96: + movs r2, 0 +_080B4E98: + cmp r2, 0 + beq _080B4F28 + ldr r5, _080B4EFC + adds r0, r5, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B4F28 + adds r0, r5, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x38 + bne _080B4F28 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080B4F28 + 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 r1, r0, 0 + adds r0, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFE + bne _080B4F00 + movs r4, 0 + b _080B4F02 + .align 2, 0 +_080B4EF8: .4byte 0x083203cc +_080B4EFC: .4byte 0x020244ec +_080B4F00: + movs r4, 0xFE +_080B4F02: + bl sub_80B4D78 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080B4F24 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x20 + bl sub_8067EF8 + b _080B4F40 + .align 2, 0 +_080B4F24: .4byte 0x02024744 +_080B4F28: + bl sub_80B4D78 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080B4F48 + str r0, [sp] + adds r0, r1, 0 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x20 + bl pokemon_make_with_nature +_080B4F40: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B4F48: .4byte 0x02024744 + thumb_func_end sub_80B4E68 + + thumb_func_start sub_80B4F4C +sub_80B4F4C: @ 80B4F4C + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + adds r4, r3, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r1, 0 + mov r0, sp + strb r1, [r0] + cmp r3, 0x1 + beq _080B4FA0 + cmp r3, 0x1 + bgt _080B4F70 + cmp r3, 0 + beq _080B4F76 + b _080B4FBA +_080B4F70: + cmp r4, 0x2 + beq _080B4FB2 + b _080B4FBA +_080B4F76: + ldr r0, [r5, 0x4] + movs r1, 0x8 + movs r2, 0x2A + mov r3, sp + bl sub_80B5A50 + lsls r0, 24 + cmp r0, 0 + bne _080B4FBA + ldr r0, [r5, 0x4] + movs r1, 0xD + movs r2, 0x9 + mov r3, sp + bl sub_80B5A50 + lsls r0, 24 + cmp r0, 0 + bne _080B4FBA + bl wild_pokemon_rand_grass + b _080B4FB6 +_080B4FA0: + ldr r0, [r5, 0x4] + movs r1, 0xD + movs r2, 0x9 + mov r3, sp + bl sub_80B5A50 + lsls r0, 24 + cmp r0, 0 + bne _080B4FBA +_080B4FB2: + bl wild_pokemon_rand_water +_080B4FB6: + mov r1, sp + strb r0, [r1] +_080B4FBA: + mov r0, sp + ldrb r1, [r0] + lsls r1, 2 + ldr r0, [r5, 0x4] + adds r0, r1 + bl sub_80B4C74 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 + ands r0, r6 + cmp r0, 0 + beq _080B4FE0 + adds r0, r4, 0 + bl sub_80B58CC + lsls r0, 24 + cmp r0, 0 + beq _080B5000 +_080B4FE0: + ldr r0, _080B5004 + ldrh r1, [r0, 0x12] + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + beq _080B5008 + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _080B5008 + adds r0, r4, 0 + bl sub_80B5934 + lsls r0, 24 + cmp r0, 0 + bne _080B5008 +_080B5000: + movs r0, 0 + b _080B501C + .align 2, 0 +_080B5004: .4byte 0x02037318 +_080B5008: + mov r0, sp + ldrb r0, [r0] + ldr r1, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + adds r1, r4, 0 + bl sub_80B4E68 + movs r0, 0x1 +_080B501C: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B4F4C + + thumb_func_start sub_80B5024 +sub_80B5024: @ 80B5024 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80B4BD8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + ldr r0, [r5, 0x4] + adds r0, r4 + bl sub_80B4C74 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, [r5, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x2] + bl sub_80B4E68 + ldr r0, [r5, 0x4] + adds r4, r0 + ldrh r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5024 + + thumb_func_start sub_80B505C +sub_80B505C: @ 80B505C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B508C + ldr r0, _080B5084 + ldr r0, [r0] + ldr r1, _080B5088 + adds r0, r1 + ldrb r0, [r0] + bl sub_80B58CC + lsls r0, 24 + cmp r0, 0 + bne _080B508C + movs r0, 0 + b _080B50C6 + .align 2, 0 +_080B5084: .4byte 0x03005d8c +_080B5088: .4byte 0x00002b94 +_080B508C: + ldr r0, _080B50CC + ldr r1, [r0] + ldr r2, _080B50D0 + adds r0, r1, r2 + ldrh r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldrb r1, [r1] + bl sub_80B4E68 + movs r4, 0 +_080B50A2: + ldr r0, _080B50CC + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _080B50D4 + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, _080B50D8 + bl sub_80691F4 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080B50A2 + movs r0, 0x1 +_080B50C6: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B50CC: .4byte 0x03005d8c +_080B50D0: .4byte 0x00002b90 +_080B50D4: .4byte 0x00002b98 +_080B50D8: .4byte 0x02024744 + thumb_func_end sub_80B505C + + thumb_func_start sub_80B50DC +sub_80B50DC: @ 80B50DC + push {r4,lr} + ldr r4, _080B512C + ldr r2, [r4] + ldr r1, _080B5130 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080B513C + movs r1, 0x5 + ldrsb r1, [r2, r1] + ldr r3, _080B5134 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _080B513C + movs r1, 0x4 + ldrsb r1, [r2, r1] + adds r3, 0x1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _080B513C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + ldr r1, [r4] + ldr r2, _080B5138 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bcs _080B513C + movs r0, 0x1 + b _080B513E + .align 2, 0 +_080B512C: .4byte 0x03005d8c +_080B5130: .4byte 0x00002b90 +_080B5134: .4byte 0x00002b92 +_080B5138: .4byte 0x00002ba1 +_080B513C: + movs r0, 0 +_080B513E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B50DC + + thumb_func_start sub_80B5144 +sub_80B5144: @ 80B5144 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB4 + lsls r1, 4 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcc _080B5168 + movs r0, 0 + b _080B516A +_080B5168: + movs r0, 0x1 +_080B516A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B5144 + + thumb_func_start sub_80B5170 +sub_80B5170: @ 80B5170 + push {r4,lr} + sub sp, 0x4 + str r0, [sp] + lsls r1, 24 + lsrs r4, r1, 24 + lsls r0, 4 + str r0, [sp] + movs r0, 0x6 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _080B519A + ldr r1, [sp] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + movs r1, 0x64 + bl __udivsi3 + str r0, [sp] +_080B519A: + mov r0, sp + bl sub_80B5AB0 + mov r0, sp + bl sub_80B5AF0 + cmp r4, 0 + bne _080B5216 + ldr r4, _080B51DC + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B5216 + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B51E8 + ldr r0, _080B51E0 + ldrh r1, [r0, 0x12] + ldr r0, _080B51E4 + cmp r1, r0 + bne _080B5210 + ldr r1, [sp] + lsls r0, r1, 1 + adds r0, r1 + lsrs r0, 2 + b _080B5214 + .align 2, 0 +_080B51DC: .4byte 0x020244ec +_080B51E0: .4byte 0x02037318 +_080B51E4: .4byte 0x00000169 +_080B51E8: + cmp r0, 0x23 + bne _080B51F2 + ldr r0, [sp] + lsls r0, 1 + b _080B5214 +_080B51F2: + cmp r0, 0x49 + beq _080B5210 + cmp r0, 0x47 + bne _080B5200 + ldr r0, [sp] + lsls r0, 1 + b _080B5214 +_080B5200: + cmp r0, 0x8 + bne _080B5216 + ldr r0, _080B5238 + ldr r0, [r0] + adds r0, 0x2E + ldrb r0, [r0] + cmp r0, 0x8 + bne _080B5216 +_080B5210: + ldr r0, [sp] + lsrs r0, 1 +_080B5214: + str r0, [sp] +_080B5216: + ldr r0, [sp] + movs r1, 0xB4 + lsls r1, 4 + cmp r0, r1 + bls _080B5222 + str r1, [sp] +_080B5222: + ldr r0, [sp] + lsls r0, 16 + lsrs r0, 16 + bl sub_80B5144 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B5238: .4byte 0x03005d8c + thumb_func_end sub_80B5170 + + thumb_func_start sub_80B523C +sub_80B523C: @ 80B523C + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3B + bhi _080B5258 + movs r0, 0x1 + b _080B525A +_080B5258: + movs r0, 0 +_080B525A: + pop {r1} + bx r1 + thumb_func_end sub_80B523C + + thumb_func_start sub_80B5260 +sub_80B5260: @ 80B5260 + push {lr} + ldr r0, _080B527C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 3 + cmp r1, r0 + bne _080B5280 + movs r0, 0x53 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + b _080B5282 + .align 2, 0 +_080B527C: .4byte 0x03005d8c +_080B5280: + movs r0, 0 +_080B5282: + pop {r1} + bx r1 + thumb_func_end sub_80B5260 + + thumb_func_start is_it_battle_time_2 +is_it_battle_time_2: @ 80B5288 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r6, r0, 16 + mov r9, r6 + lsls r1, 16 + lsrs r7, r1, 16 + mov r8, r7 + ldr r0, _080B5320 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B52A6 + b _080B54FE +_080B52A6: + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _080B5324 + cmp r5, r0 + bne _080B539C + ldr r0, _080B5328 + ldrh r1, [r0, 0x12] + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + bne _080B5330 + bl sub_81A7D00 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r7, r6 + beq _080B52D8 + bl sub_80B523C + lsls r0, 24 + cmp r0, 0 + bne _080B52D8 + b _080B54FE +_080B52D8: + ldr r1, _080B532C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, 0x4 + adds r4, r0, r1 + ldr r0, [r4] + ldrb r0, [r0] + movs r1, 0 + bl sub_80B5170 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B52F8 + b _080B54FE +_080B52F8: + ldr r0, [r4] + movs r1, 0 + movs r2, 0x2 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B530C + b _080B54FE +_080B530C: + movs r0, 0x1 + bl sub_81A7B90 + cmp r0, 0 + bne _080B5318 + b _080B54FE +_080B5318: + bl sub_80B06B0 + movs r0, 0x1 + b _080B5500 + .align 2, 0 +_080B5320: .4byte 0x02038c00 +_080B5324: .4byte 0x0000ffff +_080B5328: .4byte 0x02037318 +_080B532C: .4byte 0x08553a14 +_080B5330: + ldr r0, _080B538C + cmp r1, r0 + beq _080B5338 + b _080B54FE +_080B5338: + ldr r0, _080B5390 + ldr r0, [r0] + ldr r1, _080B5394 + adds r0, r1 + ldrh r5, [r0] + cmp r7, r6 + beq _080B5352 + bl sub_80B523C + lsls r0, 24 + cmp r0, 0 + bne _080B5352 + b _080B54FE +_080B5352: + ldr r1, _080B5398 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, 0x4 + adds r4, r0, r1 + ldr r0, [r4] + ldrb r0, [r0] + movs r1, 0 + bl sub_80B5170 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B5372 + b _080B54FE +_080B5372: + ldr r0, [r4] + movs r1, 0 + movs r2, 0x2 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B5386 + b _080B54FE +_080B5386: + bl sub_81A9C04 + b _080B54F6 + .align 2, 0 +_080B538C: .4byte 0x00000169 +_080B5390: .4byte 0x03005d90 +_080B5394: .4byte 0x00000cb2 +_080B5398: .4byte 0x08553894 +_080B539C: + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_808952C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B543C + ldr r1, _080B5438 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + adds r4, r2, 0 + cmp r0, 0 + bne _080B53C4 + b _080B54FE +_080B53C4: + cmp r7, r6 + beq _080B53D4 + bl sub_80B523C + lsls r0, 24 + cmp r0, 0 + bne _080B53D4 + b _080B54FE +_080B53D4: + ldr r1, _080B5438 + adds r0, r4, r5 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0] + movs r1, 0 + bl sub_80B5170 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B53F2 + b _080B54FE +_080B53F2: + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54BA + bl sub_80B50DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5418 + movs r0, 0x3 + bl sub_80B505C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54F6 +_080B5418: + ldr r1, _080B5438 + adds r0, r4, r5 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x3 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54F6 + b _080B54FE + .align 2, 0 +_080B5438: .4byte 0x08552d48 +_080B543C: + adds r0, r4, 0 + bl sub_8089558 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B5464 + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _080B54FE + adds r0, r4, 0 + bl sub_80894AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54FE +_080B5464: + bl sub_80B5260 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54FE + ldr r1, _080B54D8 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + adds r4, r2, 0 + cmp r0, 0 + beq _080B54FE + cmp r8, r9 + beq _080B5492 + bl sub_80B523C + lsls r0, 24 + cmp r0, 0 + beq _080B54FE +_080B5492: + ldr r1, _080B54D8 + adds r0, r4, r5 + lsls r0, 2 + adds r1, 0x8 + adds r4, r0, r1 + ldr r0, [r4] + ldrb r0, [r0] + movs r1, 0 + bl sub_80B5170 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54FE + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54E4 +_080B54BA: + ldr r0, _080B54DC + ldr r0, [r0] + ldr r1, _080B54E0 + adds r0, r1 + ldrb r0, [r0, 0xC] + bl sub_80B58CC + lsls r0, 24 + cmp r0, 0 + beq _080B54FE + bl sub_80B072C + movs r0, 0x1 + b _080B5500 + .align 2, 0 +_080B54D8: .4byte 0x08552d48 +_080B54DC: .4byte 0x03005d8c +_080B54E0: .4byte 0x000031dc +_080B54E4: + ldr r0, [r4] + movs r1, 0x1 + movs r2, 0x3 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54FE +_080B54F6: + bl sub_80B0698 + movs r0, 0x1 + b _080B5500 +_080B54FE: + movs r0, 0 +_080B5500: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end is_it_battle_time_2 + + thumb_func_start sub_80B550C +sub_80B550C: @ 80B550C + push {r4,lr} + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _080B555C + cmp r2, r0 + beq _080B5568 + ldr r1, _080B5560 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r1, 0xC + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B5554 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80B5170 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5568 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0x3 + bl sub_80B4F4C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _080B5568 + bl sub_80B0698 +_080B5554: + ldr r0, _080B5564 + strh r4, [r0] + b _080B556E + .align 2, 0 +_080B555C: .4byte 0x0000ffff +_080B5560: .4byte 0x08552d48 +_080B5564: .4byte 0x020375f0 +_080B5568: + ldr r1, _080B5574 + movs r0, 0 + strh r0, [r1] +_080B556E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B5574: .4byte 0x020375f0 + thumb_func_end sub_80B550C + + thumb_func_start sub_80B5578 +sub_80B5578: @ 80B5578 + push {r4,r5,lr} + sub sp, 0x4 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl player_get_pos_to + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _080B55D8 + cmp r4, r0 + bne _080B562C + ldr r0, _080B55DC + ldrh r1, [r0, 0x12] + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + bne _080B55E4 + bl sub_81A7D00 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080B55E0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B55CA + b _080B56F2 +_080B55CA: + movs r0, 0 + bl sub_81A7B90 + bl sub_80B06B0 + movs r0, 0x1 + b _080B56F4 + .align 2, 0 +_080B55D8: .4byte 0x0000ffff +_080B55DC: .4byte 0x02037318 +_080B55E0: .4byte 0x08553a14 +_080B55E4: + ldr r0, _080B561C + cmp r1, r0 + beq _080B55EC + b _080B56F2 +_080B55EC: + ldr r0, _080B5620 + ldr r0, [r0] + ldr r1, _080B5624 + adds r0, r1 + ldrh r4, [r0] + ldr r1, _080B5628 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B56F2 + bl sub_81A9C04 + b _080B56EA + .align 2, 0 +_080B561C: .4byte 0x00000169 +_080B5620: .4byte 0x03005d90 +_080B5624: .4byte 0x00000cb2 +_080B5628: .4byte 0x08553894 +_080B562C: + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_808952C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B568C + ldr r1, _080B567C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B56F2 + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B56D4 + bl sub_80B50DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5680 + movs r0, 0 + bl sub_80B505C + b _080B56EA + .align 2, 0 +_080B567C: .4byte 0x08552d48 +_080B5680: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_80B4F4C + b _080B56EA +_080B568C: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089558 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B56F2 + bl sub_80B5260 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B56F2 + ldr r1, _080B56DC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B56F2 + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B56E0 +_080B56D4: + bl sub_80B072C + movs r0, 0x1 + b _080B56F4 + .align 2, 0 +_080B56DC: .4byte 0x08552d48 +_080B56E0: + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80B4F4C +_080B56EA: + bl sub_80B0698 + movs r0, 0x1 + b _080B56F4 +_080B56F2: + movs r0, 0 +_080B56F4: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5578 + + thumb_func_start sub_80B56FC +sub_80B56FC: @ 80B56FC + push {lr} + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _080B5724 + cmp r2, r0 + beq _080B572C + ldr r0, _080B5728 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0x10 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _080B572C + movs r0, 0x1 + b _080B572E + .align 2, 0 +_080B5724: .4byte 0x0000ffff +_080B5728: .4byte 0x08552d48 +_080B572C: + movs r0, 0 +_080B572E: + pop {r1} + bx r1 + thumb_func_end sub_80B56FC + + thumb_func_start sub_80B5734 +sub_80B5734: @ 80B5734 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80B4984 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5764 + ldr r4, _080B5760 + adds r0, r4, 0 + bl sub_80B4C74 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrh r4, [r4, 0x2] + adds r0, r4, 0 + bl sub_80B4E68 + b _080B5784 + .align 2, 0 +_080B5760: .4byte 0x08553a78 +_080B5764: + ldr r4, _080B579C + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r4, 0x10 + adds r1, r4 + ldr r0, [r1] + adds r1, r5, 0 + bl sub_80B5024 + lsls r0, 16 + lsrs r4, r0, 16 +_080B5784: + movs r0, 0xC + bl sav12_xor_increment + adds r0, r4, 0 + bl sub_80EDA3C + bl sub_80B0698 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B579C: .4byte 0x08552d48 + thumb_func_end sub_80B5734 + + thumb_func_start wild_pokemon_rand_for_map +wild_pokemon_rand_for_map: @ 80B57A0 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0 + strb r0, [r6] + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _080B57D8 + cmp r3, r0 + beq _080B57D2 + ldr r2, _080B57DC + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r5, [r0] + adds r2, 0x8 + adds r1, r2 + ldr r4, [r1] + cmp r5, 0 + bne _080B57E0 + cmp r4, 0 + bne _080B57E6 +_080B57D2: + movs r0, 0 + b _080B5826 + .align 2, 0 +_080B57D8: .4byte 0x0000ffff +_080B57DC: .4byte 0x08552d48 +_080B57E0: + cmp r4, 0 + bne _080B57F4 + b _080B5818 +_080B57E6: + movs r0, 0x1 + strb r0, [r6] + bl wild_pokemon_rand_water + lsls r0, 24 + ldr r1, [r4, 0x4] + b _080B5820 +_080B57F4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4F + bls _080B5818 + movs r0, 0x1 + strb r0, [r6] + bl wild_pokemon_rand_water + lsls r0, 24 + ldr r1, [r4, 0x4] + b _080B5820 +_080B5818: + bl wild_pokemon_rand_grass + lsls r0, 24 + ldr r1, [r5, 0x4] +_080B5820: + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] +_080B5826: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end wild_pokemon_rand_for_map + + thumb_func_start sub_80B582C +sub_80B582C: @ 80B582C + push {r4,lr} + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _080B5860 + cmp r2, r0 + beq _080B5868 + ldr r1, _080B5864 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B5868 + bl wild_pokemon_rand_water + lsls r0, 24 + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + b _080B586A + .align 2, 0 +_080B5860: .4byte 0x0000ffff +_080B5864: .4byte 0x08552d48 +_080B5868: + movs r0, 0 +_080B586A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B582C + + thumb_func_start sub_80B5870 +sub_80B5870: @ 80B5870 + push {r4,r5,lr} + bl sub_81A80A8 + lsls r0, 24 + cmp r0, 0 + bne _080B58C4 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080B58C4 + bl in_trade_center + cmp r0, 0x1 + beq _080B58C4 + ldr r5, _080B58BC + adds r0, r5, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080B58C4 + subs r4, r0, 0x1 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl var_set + cmp r4, 0 + bne _080B58C4 + ldr r0, _080B58C0 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _080B58C6 + .align 2, 0 +_080B58BC: .4byte 0x00004021 +_080B58C0: .4byte 0x082a4b2a +_080B58C4: + movs r0, 0 +_080B58C6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5870 + + thumb_func_start sub_80B58CC +sub_80B58CC: @ 80B58CC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080B5918 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080B5912 + movs r5, 0 +_080B58E0: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _080B591C + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080B5920 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080B5920 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bcc _080B592A +_080B5912: + movs r0, 0x1 + b _080B592C + .align 2, 0 +_080B5918: .4byte 0x00004021 +_080B591C: .4byte 0x020244ec +_080B5920: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _080B58E0 +_080B592A: + movs r0, 0 +_080B592C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B58CC + + thumb_func_start sub_80B5934 +sub_80B5934: @ 80B5934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080B5984 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B5988 + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _080B595A + cmp r0, 0x16 + bne _080B5988 +_080B595A: + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _080B5988 + subs r0, 0x5 + cmp r5, r0 + bgt _080B5988 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B5988 + movs r0, 0 + b _080B598A + .align 2, 0 +_080B5984: .4byte 0x020244ec +_080B5988: + movs r0, 0x1 +_080B598A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5934 + + thumb_func_start sub_80B5990 +sub_80B5990: @ 80B5990 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r7, sp + mov r12, r0 + mov r8, r3 + lsls r1, 24 + lsrs r1, 24 + str r1, [r7] + lsls r2, 24 + lsrs r2, 24 + mov r9, sp + adds r0, r2, 0x3 + lsrs r0, 2 + lsls r0, 2 + mov r1, sp + subs r1, r0 + mov sp, r1 + mov r5, sp + movs r3, 0 + cmp r3, r2 + bcs _080B59D2 + movs r1, 0 +_080B59C4: + adds r0, r5, r3 + strb r1, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _080B59C4 +_080B59D2: + movs r4, 0 + movs r3, 0 + cmp r4, r2 + bcs _080B5A12 + ldr r6, _080B5A20 + mov r10, r6 +_080B59DE: + lsls r0, r3, 2 + add r0, r12 + ldrh r1, [r0, 0x2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r6, r10 + adds r1, r0, r6 + ldrb r0, [r1, 0x6] + ldr r6, [r7] + cmp r0, r6 + beq _080B59FC + ldrb r0, [r1, 0x7] + cmp r0, r6 + bne _080B5A08 +_080B59FC: + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r1, r5, r1 + strb r3, [r1] +_080B5A08: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _080B59DE +_080B5A12: + cmp r4, 0 + beq _080B5A1A + cmp r4, r2 + bne _080B5A24 +_080B5A1A: + movs r0, 0 + b _080B5A3C + .align 2, 0 +_080B5A20: .4byte 0x083203cc +_080B5A24: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + movs r0, 0x1 +_080B5A3C: + mov sp, r9 + 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_80B5990 + + thumb_func_start sub_80B5A50 +sub_80B5A50: @ 80B5A50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + mov r8, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, _080B5AA0 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B5AA4 + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _080B5AA4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B5AA4 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0xC + mov r3, r8 + bl sub_80B5990 + lsls r0, 24 + lsrs r0, 24 + b _080B5AA6 + .align 2, 0 +_080B5AA0: .4byte 0x020244ec +_080B5AA4: + movs r0, 0 +_080B5AA6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B5A50 + + thumb_func_start sub_80B5AB0 +sub_80B5AB0: @ 80B5AB0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B5ACC + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5AD0 + ldr r0, [r4] + lsrs r1, r0, 1 + adds r0, r1 + b _080B5AE2 + .align 2, 0 +_080B5ACC: .4byte 0x000008ad +_080B5AD0: + ldr r0, _080B5AEC + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5AE4 + ldr r0, [r4] + lsrs r0, 1 +_080B5AE2: + str r0, [r4] +_080B5AE4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B5AEC: .4byte 0x000008ae + thumb_func_end sub_80B5AB0 + + thumb_func_start sub_80B5AF0 +sub_80B5AF0: @ 80B5AF0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B5B14 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0xBE + bne _080B5B0C + ldr r0, [r4] + lsls r0, 1 + movs r1, 0x3 + bl __udivsi3 + str r0, [r4] +_080B5B0C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B5B14: .4byte 0x020244ec + thumb_func_end sub_80B5AF0 + + thumb_func_start oe_exec +oe_exec: @ 80B5B18 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl oe_active_list_add + ldr r0, _080B5B58 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + str r0, [sp] + add r4, sp, 0x4 + ldr r5, _080B5B5C +_080B5B36: + ldr r0, [sp] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r5 + ldr r2, [r0] + mov r0, sp + adds r1, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080B5B36 + ldr r0, [sp, 0x4] + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B5B58: .4byte 0x082db9d4 +_080B5B5C: .4byte 0x0855c1f0 + thumb_func_end oe_exec + + thumb_func_start oec00_load_gfx +oec00_load_gfx: @ 80B5B60 + push {lr} + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl oec00_load_gfx_impl + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end oec00_load_gfx + + thumb_func_start sub_80B5B74 +sub_80B5B74: @ 80B5B74 + push {lr} + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl sub_80B5C6C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80B5B74 + + thumb_func_start sub_80B5B88 +sub_80B5B88: @ 80B5B88 + push {lr} + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl sub_80B5C94 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80B5B88 + + thumb_func_start sub_80B5B9C +sub_80B5B9C: @ 80B5B9C + push {lr} + ldr r2, [r0] + adds r2, 0x1 + str r2, [r0] + bl oec03_call_asm_impl + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80B5B9C + + thumb_func_start sub_80B5BB0 +sub_80B5BB0: @ 80B5BB0 + movs r0, 0 + bx lr + thumb_func_end sub_80B5BB0 + + thumb_func_start sub_80B5BB4 +sub_80B5BB4: @ 80B5BB4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + bl oec00_load_gfx_impl + adds r0, r4, 0 + bl sub_80B5C6C + adds r0, r4, 0 + adds r1, r5, 0 + bl oec03_call_asm_impl + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5BB4 + + thumb_func_start sub_80B5BDC +sub_80B5BDC: @ 80B5BDC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + bl oec00_load_gfx_impl + adds r0, r4, 0 + adds r1, r5, 0 + bl oec03_call_asm_impl + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5BDC + + thumb_func_start sub_80B5C00 +sub_80B5C00: @ 80B5C00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + bl sub_80B5C6C + adds r0, r4, 0 + adds r1, r5, 0 + bl oec03_call_asm_impl + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5C00 + + thumb_func_start oe_read_word +oe_read_word: @ 80B5C24 + ldr r2, [r0] + 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 + bx lr + thumb_func_end oe_read_word + + thumb_func_start oec00_load_gfx_impl +oec00_load_gfx_impl: @ 80B5C3C + push {r4,r5,lr} + adds r4, r0, 0 + bl oe_read_word + adds r5, r0, 0 + ldrh r0, [r5, 0x6] + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + ldr r1, _080B5C68 + cmp r0, r1 + bne _080B5C5A + adds r0, r5, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram +_080B5C5A: + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B5C68: .4byte 0xffff0000 + thumb_func_end oec00_load_gfx_impl + + thumb_func_start sub_80B5C6C +sub_80B5C6C: @ 80B5C6C + push {r4,r5,lr} + adds r5, r0, 0 + bl oe_read_word + adds r4, r0, 0 + bl gpu_pal_obj_alloc_tag_and_apply + ldrh r0, [r4, 0x4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + bl sub_80ABE18 + ldr r0, [r5] + adds r0, 0x4 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B5C6C + + thumb_func_start sub_80B5C94 +sub_80B5C94: @ 80B5C94 + push {r4,lr} + adds r4, r0, 0 + bl oe_read_word + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B5C94 + + thumb_func_start oec03_call_asm_impl +oec03_call_asm_impl: @ 80B5CAC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl oe_read_word + bl _call_via_r0 + str r0, [r5] + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end oec03_call_asm_impl + + thumb_func_start oe_stop_ +oe_stop_: @ 80B5CC8 + push {r4,r5,lr} + adds r1, r0, 0 + adds r1, 0x40 + ldrh r5, [r1] + ldrb r4, [r0, 0x5] + lsrs r4, 4 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl gpu_tile_obj_free_by_ado_when_unused_maybe + adds r0, r4, 0 + bl gpu_pal_free_by_index_when_unused + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end oe_stop_ + + thumb_func_start oe_stop +oe_stop: @ 80B5CEC + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl oe_stop_ + adds r0, r4, 0 + bl oe_active_list_remove + pop {r4} + pop {r0} + bx r0 + thumb_func_end oe_stop + + thumb_func_start gpu_tile_obj_free_by_ado_when_unused_maybe +gpu_tile_obj_free_by_ado_when_unused_maybe: @ 80B5D04 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl gpu_tile_obj_tag_get_by_range_start + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _080B5D60 + cmp r3, r0 + beq _080B5D58 + movs r2, 0 + ldr r5, _080B5D64 +_080B5D1E: + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r5 + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080B5D48 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + bge _080B5D48 + adds r0, r1, 0 + adds r0, 0x40 + ldrh r0, [r0] + cmp r4, r0 + beq _080B5D58 +_080B5D48: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _080B5D1E + adds r0, r3, 0 + bl gpu_tile_obj_free_by_tag +_080B5D58: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B5D60: .4byte 0x0000ffff +_080B5D64: .4byte 0x02020630 + thumb_func_end gpu_tile_obj_free_by_ado_when_unused_maybe + + thumb_func_start gpu_pal_free_by_index_when_unused +gpu_pal_free_by_index_when_unused: @ 80B5D68 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl gpu_pal_tag_by_index + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _080B5DB8 + cmp r5, r0 + beq _080B5DB0 + movs r2, 0 + ldr r6, _080B5DBC + adds r3, r4, 0 +_080B5D84: + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080B5DA0 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + cmp r0, r3 + beq _080B5DB0 +_080B5DA0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _080B5D84 + adds r0, r5, 0 + bl gpu_pal_free_tag +_080B5DB0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B5DB8: .4byte 0x0000ffff +_080B5DBC: .4byte 0x02020630 + thumb_func_end gpu_pal_free_by_index_when_unused + + thumb_func_start oe_active_list_clear +oe_active_list_clear: @ 80B5DC0 + push {r4,lr} + movs r2, 0 + ldr r4, _080B5DE0 + movs r3, 0xFF +_080B5DC8: + 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, 0x1F + bls _080B5DC8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B5DE0: .4byte 0x03000f58 + thumb_func_end oe_active_list_clear + + thumb_func_start oe_active_list_add +oe_active_list_add: @ 80B5DE4 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, _080B5DFC +_080B5DEE: + adds r1, r2, r4 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080B5E00 + strb r3, [r1] + b _080B5E0A + .align 2, 0 +_080B5DFC: .4byte 0x03000f58 +_080B5E00: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080B5DEE +_080B5E0A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end oe_active_list_add + + thumb_func_start oe_active_list_remove +oe_active_list_remove: @ 80B5E10 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, _080B5E2C + movs r5, 0xFF +_080B5E1C: + adds r1, r2, r4 + ldrb r0, [r1] + cmp r0, r3 + bne _080B5E30 + orrs r0, r5 + strb r0, [r1] + b _080B5E3A + .align 2, 0 +_080B5E2C: .4byte 0x03000f58 +_080B5E30: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080B5E1C +_080B5E3A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end oe_active_list_remove + + thumb_func_start oe_active_list_contains +oe_active_list_contains: @ 80B5E40 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _080B5E58 +_080B5E4A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _080B5E5C + movs r0, 0x1 + b _080B5E68 + .align 2, 0 +_080B5E58: .4byte 0x03000f58 +_080B5E5C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _080B5E4A + movs r0, 0 +_080B5E68: + pop {r1} + bx r1 + thumb_func_end oe_active_list_contains + + thumb_func_start sub_80B5E6C +sub_80B5E6C: @ 80B5E6C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r9, r3 + ldr r7, [sp, 0x34] + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsrs r4, 21 + ldr r3, _080B5EF4 + mov r8, r3 + add r8, r4 + mov r0, r8 + adds r1, r7, 0 + bl gpu_pal_obj_decompress_and_apply2 + ldr r0, _080B5EF8 + adds r4, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl gpu_tile_obj_decompress_and_load2 + mov r1, sp + ldrh r0, [r4, 0x6] + movs r2, 0 + strh r0, [r1] + mov r3, r8 + ldrh r0, [r3, 0x4] + strh r0, [r1, 0x2] + ldr r0, _080B5EFC + str r0, [sp, 0x4] + ldr r0, _080B5F00 + str r0, [sp, 0x8] + str r2, [sp, 0xC] + ldr r0, _080B5F04 + str r0, [sp, 0x10] + ldr r0, _080B5F08 + str r0, [sp, 0x14] + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + mov r0, sp + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, r9 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B5EF4: .4byte 0x0830593c +_080B5EF8: .4byte 0x08305654 +_080B5EFC: .4byte 0x0855c210 +_080B5F00: .4byte 0x082ec69c +_080B5F04: .4byte 0x082ec6a8 +_080B5F08: .4byte nullsub_12 + 1 + thumb_func_end sub_80B5E6C + + thumb_func_start sub_80B5F0C +sub_80B5F0C: @ 80B5F0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r1, r2, 0 + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080B5F3C + lsrs r4, 21 + adds r0, r4, r0 + ldr r0, [r0] + bl call_LZZUnCompVram + ldr r0, _080B5F40 + adds r4, r0 + ldr r0, [r4] + adds r1, r5, 0 + movs r2, 0x20 + bl decompress_palette + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B5F3C: .4byte 0x08305654 +_080B5F40: .4byte 0x0830593c + thumb_func_end sub_80B5F0C + + thumb_func_start sub_80B5F44 +sub_80B5F44: @ 80B5F44 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _080B5F7C + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _080B5F80 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B5F7C: .4byte 0x0855c230 +_080B5F80: .4byte 0x0855c244 + thumb_func_end sub_80B5F44 + + thumb_func_start sub_80B5F84 +sub_80B5F84: @ 80B5F84 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 8 + lsls r1, 16 + asrs r1, 16 + str r1, [sp] + lsls r2, 16 + asrs r2, 16 + str r2, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + ldr r1, _080B5FD4 + lsls r4, r0, 3 + adds r4, r1 + ldrh r1, [r4, 0x4] + str r1, [sp, 0xC] + movs r1, 0 + adds r2, r3, 0 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x4] + bl gpu_pal_tags_index_of + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl sub_80AC3F8 + ldr r0, _080B5FD8 + cmp r5, r0 + beq _080B5FDC + lsls r0, r5, 24 + lsrs r0, 24 + b _080B5FDE + .align 2, 0 +_080B5FD4: .4byte 0x08303678 +_080B5FD8: .4byte 0x0000ffff +_080B5FDC: + movs r0, 0x40 +_080B5FDE: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5F84 + + thumb_func_start sub_80B5FE8 +sub_80B5FE8: @ 80B5FE8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + adds r6, r0, 0 + mov r9, r1 + mov r10, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x2C] + lsls r6, 16 + lsrs r6, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl sub_806E7CC + mov r8, r0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r1, r8 + ldrh r0, [r1, 0x4] + str r0, [sp, 0xC] + adds r0, r6, 0 + mov r1, r9 + mov r2, r10 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r4, r0, 16 + mov r1, r8 + ldrh r0, [r1, 0x4] + bl gpu_pal_tags_index_of + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl sub_80AC3F8 + ldr r0, _080B6058 + cmp r4, r0 + beq _080B605C + lsls r0, r4, 24 + lsrs r0, 24 + b _080B605E + .align 2, 0 +_080B6058: .4byte 0x0000ffff +_080B605C: + movs r0, 0x40 +_080B605E: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B5FE8 + + thumb_func_start sub_80B6070 +sub_80B6070: @ 80B6070 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_80AC428 + ldrb r0, [r4, 0x1] + lsls r0, 30 + cmp r0, 0 + beq _080B608E + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry +_080B608E: + adds r0, r5, 0 + bl sub_818D820 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B6070 + + thumb_func_start sub_80B609C +sub_80B609C: @ 80B609C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, _080B6120 + lsrs r0, 15 + adds r4, r0, r4 + ldrh r4, [r4] + movs r5, 0x1F + mov r9, r5 + mov r8, r4 + mov r6, r8 + ands r6, r5 + mov r8, r6 + movs r6, 0xF8 + lsls r6, 2 + ands r6, r4 + lsrs r6, 5 + movs r5, 0xF8 + lsls r5, 7 + ands r4, r5 + lsrs r4, 10 + mov r7, r9 + mov r5, r8 + subs r7, r5 + mov r12, r7 + mov r7, r12 + muls r7, r1 + adds r1, r7, 0 + asrs r1, 4 + add r8, r1 + mov r5, r9 + subs r1, r5, r6 + muls r1, r2 + asrs r1, 4 + adds r6, r1 + subs r5, r4 + mov r9, r5 + mov r1, r9 + muls r1, r3 + asrs r1, 4 + adds r4, r1 + mov r7, r8 + lsls r7, 16 + lsls r6, 21 + orrs r6, r7 + lsls r4, 26 + orrs r4, r6 + lsrs r4, 16 + ldr r1, _080B6124 + adds r0, r1 + strh r4, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B6120: .4byte 0x02037714 +_080B6124: .4byte 0x02037b14 + thumb_func_end sub_80B609C + + thumb_func_start sub_80B6128 +sub_80B6128: @ 80B6128 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, _080B6198 + lsrs r0, 15 + adds r4, r0, r4 + ldrh r4, [r4] + movs r5, 0x1F + mov r8, r5 + mov r6, r8 + ands r6, r4 + mov r8, r6 + movs r5, 0xF8 + lsls r5, 2 + ands r5, r4 + lsrs r5, 5 + movs r6, 0xF8 + lsls r6, 7 + ands r4, r6 + lsrs r4, 10 + mov r6, r8 + muls r6, r1 + adds r1, r6, 0 + asrs r1, 4 + mov r6, r8 + subs r6, r1 + adds r1, r5, 0 + muls r1, r2 + asrs r1, 4 + subs r5, r1 + adds r1, r4, 0 + muls r1, r3 + asrs r1, 4 + subs r4, r1 + lsls r6, 16 + lsls r5, 21 + orrs r5, r6 + lsls r4, 26 + orrs r4, r5 + lsrs r4, 16 + ldr r1, _080B619C + adds r0, r1 + strh r4, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B6198: .4byte 0x02037714 +_080B619C: .4byte 0x02037b14 + thumb_func_end sub_80B6128 + + thumb_func_start sub_80B61A0 +sub_80B61A0: @ 80B61A0 + push {r4,lr} + bl calc_player_party_count + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080B61DC + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B61E0 + adds r1, r0 + strh r4, [r1, 0xA] + movs r0, 0x5D + strh r0, [r1, 0xC] + movs r0, 0x24 + strh r0, [r1, 0xE] + movs r0, 0x7C + strh r0, [r1, 0x10] + movs r0, 0x18 + strh r0, [r1, 0x12] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B61DC: .4byte sub_80B61E4 + 1 +_080B61E0: .4byte 0x03005e00 + thumb_func_end sub_80B61A0 + + thumb_func_start sub_80B61E4 +sub_80B61E4: @ 80B61E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B620C + adds r1, r0 + ldr r2, _080B6210 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_080B620C: .4byte 0x03005e00 +_080B6210: .4byte 0x0855c364 + thumb_func_end sub_80B61E4 + + thumb_func_start sub_80B6214 +sub_80B6214: @ 80B6214 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r3, 0xE + ldrsh r2, [r4, r3] + movs r3, 0x1 + bl sub_80B646C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl sub_80B6850 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B6214 + + thumb_func_start sub_80B6250 +sub_80B6250: @ 80B6250 + push {r4,lr} + adds r2, r0, 0 + ldr r3, _080B6288 + movs r1, 0x14 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r4, 0x2E + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _080B6282 + movs r0, 0x16 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_080B6282: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B6288: .4byte 0x02020630 + thumb_func_end sub_80B6250 + + thumb_func_start sub_80B628C +sub_80B628C: @ 80B628C + push {lr} + adds r3, r0, 0 + ldr r2, _080B62B0 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B62AC + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B62AC: + pop {r0} + bx r0 + .align 2, 0 +_080B62B0: .4byte 0x02020630 + thumb_func_end sub_80B628C + + thumb_func_start sub_80B62B4 +sub_80B62B4: @ 80B62B4 + push {lr} + ldr r2, _080B62EC + movs r3, 0x14 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x6 + ble _080B62E6 + adds r0, r1, 0 + bl obj_delete_and_free_tiles + movs r0, 0x19 + bl oe_active_list_remove + ldr r0, _080B62F0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B62E6: + pop {r0} + bx r0 + .align 2, 0 +_080B62EC: .4byte 0x02020630 +_080B62F0: .4byte sub_80B61E4 + 1 + thumb_func_end sub_80B62B4 + + thumb_func_start sub_80B62F4 +sub_80B62F4: @ 80B62F4 + push {r4,lr} + bl calc_player_party_count + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080B6328 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B632C + adds r1, r0 + strh r4, [r1, 0xA] + movs r0, 0x75 + strh r0, [r1, 0xC] + movs r0, 0x34 + strh r0, [r1, 0xE] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B6328: .4byte sub_80B6330 + 1 +_080B632C: .4byte 0x03005e00 + thumb_func_end sub_80B62F4 + + thumb_func_start sub_80B6330 +sub_80B6330: @ 80B6330 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B6358 + adds r1, r0 + ldr r2, _080B635C + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_080B6358: .4byte 0x03005e00 +_080B635C: .4byte 0x0855c374 + thumb_func_end sub_80B6330 + + thumb_func_start sub_80B6360 +sub_80B6360: @ 80B6360 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r3, 0xE + ldrsh r2, [r4, r3] + movs r3, 0 + bl sub_80B646C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldr r0, _080B63D0 + bl get_task_id_by_function + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x18 + movs r3, 0 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0x48 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0xA8 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B63D0: .4byte sub_80B6330 + 1 + thumb_func_end sub_80B6360 + + thumb_func_start sub_80B63D4 +sub_80B63D4: @ 80B63D4 + push {lr} + adds r3, r0, 0 + ldr r2, _080B6400 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x1 + ble _080B63FA + ldrh r0, [r3, 0x26] + adds r0, 0x1 + strh r0, [r3, 0x26] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B63FA: + pop {r0} + bx r0 + .align 2, 0 +_080B6400: .4byte 0x02020630 + thumb_func_end sub_80B63D4 + + thumb_func_start sub_80B6404 +sub_80B6404: @ 80B6404 + push {lr} + adds r3, r0, 0 + ldr r2, _080B6428 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B6424 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B6424: + pop {r0} + bx r0 + .align 2, 0 +_080B6428: .4byte 0x02020630 + thumb_func_end sub_80B6404 + + thumb_func_start sub_80B642C +sub_80B642C: @ 80B642C + push {lr} + ldr r2, _080B6464 + movs r3, 0x14 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x6 + ble _080B645E + adds r0, r1, 0 + bl obj_delete_and_free_tiles + movs r0, 0x3E + bl oe_active_list_remove + ldr r0, _080B6468 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B645E: + pop {r0} + bx r0 + .align 2, 0 +_080B6464: .4byte 0x02020630 +_080B6468: .4byte sub_80B6330 + 1 + thumb_func_end sub_80B642C + + thumb_func_start sub_80B646C +sub_80B646C: @ 80B646C + 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, 16 + lsrs r0, 16 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, _080B64B8 + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, _080B64BC + adds r1, r2 + strh r4, [r1, 0x24] + strh r5, [r1, 0x26] + strh r6, [r1, 0x38] + mov r2, r8 + strh r2, [r1, 0x3A] + strh r0, [r1, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B64B8: .4byte sub_80B64C0 + 1 +_080B64BC: .4byte 0x02020630 + thumb_func_end sub_80B646C + + thumb_func_start sub_80B64C0 +sub_80B64C0: @ 80B64C0 + push {lr} + ldr r2, _080B64D8 + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B64D8: .4byte 0x0855c384 + thumb_func_end sub_80B64C0 + + thumb_func_start sub_80B64DC +sub_80B64DC: @ 80B64DC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B64F4 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B6550 +_080B64F4: + movs r0, 0x19 + strh r0, [r4, 0x30] + ldr r0, _080B6568 + ldr r1, _080B656C + movs r2, 0x32 + ldrsh r3, [r4, r2] + lsls r3, 2 + adds r3, r1 + ldrh r1, [r4, 0x24] + ldrh r2, [r3] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x26] + ldrh r3, [r3, 0x2] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B6570 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldrh r0, [r4, 0x3C] + strh r0, [r1, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + movs r0, 0x17 + bl audio_play +_080B6550: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6562 + movs r0, 0x20 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080B6562: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B6568: .4byte 0x0855c304 +_080B656C: .4byte 0x0855c3a4 +_080B6570: .4byte 0x02020630 + thumb_func_end sub_80B64DC + + thumb_func_start sub_80B6574 +sub_80B6574: @ 80B6574 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080B65A4 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + movs r0, 0x8 + strh r0, [r1, 0x30] + strh r2, [r1, 0x32] + strh r2, [r1, 0x34] + movs r2, 0x38 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080B65A4 + movs r0, 0xB8 + lsls r0, 1 + bl fanfare_play +_080B65A4: + pop {r0} + bx r0 + thumb_func_end sub_80B6574 + + thumb_func_start sub_80B65A8 +sub_80B65A8: @ 80B65A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldrh r0, [r7, 0x30] + subs r0, 0x1 + strh r0, [r7, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B65D8 + movs r0, 0x8 + strh r0, [r7, 0x30] + ldrh r0, [r7, 0x32] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r7, 0x32] + cmp r0, 0 + bne _080B65D8 + ldrh r0, [r7, 0x34] + adds r0, 0x1 + strh r0, [r7, 0x34] +_080B65D8: + ldrh r4, [r7, 0x32] + adds r4, 0x3 + movs r0, 0x3 + mov r8, r0 + mov r1, r8 + ands r4, r1 + ldr r3, _080B66D0 + mov r10, r3 + mov r0, r10 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x84 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r6, _080B66D4 + adds r1, r4, r6 + ldrb r1, [r1] + ldr r5, _080B66D8 + adds r2, r4, r5 + ldrb r2, [r2] + ldr r3, _080B66DC + mov r9, r3 + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + adds r4, 0x2 + mov r0, r8 + ands r4, r0 + mov r0, r10 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x83 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r4, r6 + ldrb r1, [r1] + adds r2, r4, r5 + ldrb r2, [r2] + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + adds r4, 0x1 + mov r3, r8 + ands r4, r3 + mov r0, r10 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x81 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r4, r6 + ldrb r1, [r1] + adds r2, r4, r5 + ldrb r2, [r2] + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r3, _080B66E0 + adds r0, r3 + lsrs r0, 16 + adds r6, r4, r6 + ldrb r6, [r6] + adds r5, r4, r5 + ldrb r5, [r5] + add r4, r9 + ldrb r4, [r4] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r10 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r1, _080B66E4 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + movs r3, 0x34 + ldrsh r0, [r7, r3] + cmp r0, 0x2 + ble _080B66C2 + ldrh r0, [r7, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r7, 0x2E] + movs r0, 0x8 + strh r0, [r7, 0x30] + strh r1, [r7, 0x32] +_080B66C2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B66D0: .4byte 0x00001007 +_080B66D4: .4byte 0x0855c3bc +_080B66D8: .4byte 0x0855c3c0 +_080B66DC: .4byte 0x0855c3c4 +_080B66E0: .4byte 0x01050000 +_080B66E4: .4byte 0x01030000 + thumb_func_end sub_80B65A8 + + thumb_func_start sub_80B66E8 +sub_80B66E8: @ 80B66E8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B6718 + movs r0, 0x8 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r2, 0x32] + cmp r0, 0x3 + bne _080B6718 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + movs r0, 0x1E + strh r0, [r2, 0x30] +_080B6718: + ldrh r4, [r2, 0x32] + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080B67C4 + mov r8, r0 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x84 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r1, _080B67C8 + adds r1, r4, r1 + ldrb r6, [r1] + ldr r1, _080B67CC + adds r1, r4, r1 + ldrb r5, [r1] + ldr r1, _080B67D0 + adds r4, r1 + ldrb r4, [r4] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x83 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x81 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r1, _080B67D4 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r1, _080B67D8 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B67C4: .4byte 0x00001007 +_080B67C8: .4byte 0x0855c3bc +_080B67CC: .4byte 0x0855c3c0 +_080B67D0: .4byte 0x0855c3c4 +_080B67D4: .4byte 0x01050000 +_080B67D8: .4byte 0x01030000 + thumb_func_end sub_80B66E8 + + thumb_func_start sub_80B67DC +sub_80B67DC: @ 80B67DC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B67F2 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_080B67F2: + pop {r0} + bx r0 + thumb_func_end sub_80B67DC + + thumb_func_start sub_80B67F8 +sub_80B67F8: @ 80B67F8 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] + bx lr + thumb_func_end sub_80B67F8 + + thumb_func_start sub_80B6800 +sub_80B6800: @ 80B6800 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B6816 + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080B681C +_080B6816: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080B681C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B6800 + + thumb_func_start nullsub_97 +nullsub_97: @ 80B6824 + bx lr + thumb_func_end nullsub_97 + + thumb_func_start sub_80B6828 +sub_80B6828: @ 80B6828 + push {lr} + adds r3, r0, 0 + ldr r2, _080B684C + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B6848 + adds r0, r3, 0 + bl oe_stop_ +_080B6848: + pop {r0} + bx r0 + .align 2, 0 +_080B684C: .4byte 0x02020630 + thumb_func_end sub_80B6828 + + thumb_func_start sub_80B6850 +sub_80B6850: @ 80B6850 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _080B68A0 + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _080B68A4 + 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] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldr r1, _080B68A8 + bl obj_set_f18_to_r0_f42_to_40 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B68A0: .4byte 0x0855c31c +_080B68A4: .4byte 0x02020630 +_080B68A8: .4byte 0x0855c2ac + thumb_func_end sub_80B6850 + + thumb_func_start sub_80B68AC +sub_80B68AC: @ 80B68AC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B68D0 + movs r0, 0 + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start +_080B68D0: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B68E4 + adds r0, r4, 0 + bl oe_stop_ +_080B68E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B68AC + + thumb_func_start sub_80B68EC +sub_80B68EC: @ 80B68EC + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + cmp r3, 0 + bne _080B6934 + ldr r0, _080B6928 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _080B692C + adds r0, r1 + ldr r1, _080B6930 + bl obj_set_f18_to_r0_f42_to_40 + b _080B6948 + .align 2, 0 +_080B6928: .4byte 0x0855c334 +_080B692C: .4byte 0x02020630 +_080B6930: .4byte 0x0855c2c4 +_080B6934: + ldr r0, _080B6968 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r4, r0, 24 +_080B6948: + ldr r1, _080B696C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B6968: .4byte 0x0855c34c +_080B696C: .4byte 0x02020630 + thumb_func_end sub_80B68EC + + thumb_func_start sub_80B6970 +sub_80B6970: @ 80B6970 + push {lr} + adds r3, r0, 0 + ldr r2, _080B69D8 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B69C6 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080B699E + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B69C0 +_080B699E: + movs r0, 0x10 + strh r0, [r3, 0x30] + 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] +_080B69C0: + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] +_080B69C6: + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r0, 0x7F + ble _080B69D4 + adds r0, r3, 0 + bl oe_stop_ +_080B69D4: + pop {r0} + bx r0 + .align 2, 0 +_080B69D8: .4byte 0x03005e00 + thumb_func_end sub_80B6970 + + thumb_func_start sub_80B69DC +sub_80B69DC: @ 80B69DC + push {lr} + ldr r0, _080B69F0 + bl set_callback2 + ldr r1, _080B69F4 + ldr r0, _080B69F8 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080B69F0: .4byte c2_exit_to_overworld_2_switch + 1 +_080B69F4: .4byte 0x03005dac +_080B69F8: .4byte mapldr_080842E8 + 1 + thumb_func_end sub_80B69DC + + thumb_func_start mapldr_080842E8 +mapldr_080842E8: @ 80B69FC + push {lr} + bl pal_fill_black + ldr r0, _080B6A1C + movs r1, 0 + bl AddTask + bl script_env_2_enable + bl player_bitmagic + ldr r1, _080B6A20 + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080B6A1C: .4byte task00_8084310 + 1 +_080B6A20: .4byte 0x03005dac + thumb_func_end mapldr_080842E8 + + thumb_func_start task00_8084310 +task00_8084310: @ 80B6A24 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B6A90 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r6, [r4, r0] + cmp r6, 0 + bne _080B6A64 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B6A8A + bl brm_get_pokemon_selection + ldr r1, _080B6A94 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + cmp r0, 0x5 + ble _080B6A58 + str r6, [r1] +_080B6A58: + movs r0, 0x1F + bl oe_exec + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6A64: + movs r0, 0x1F + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B6A8A + bl flag_var_implications_of_teleport_ + bl warp_in + ldr r0, _080B6A98 + bl set_callback2 + ldr r1, _080B6A9C + ldr r0, _080B6AA0 + str r0, [r1] + adds r0, r5, 0 + bl remove_task +_080B6A8A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B6A90: .4byte 0x03005e00 +_080B6A94: .4byte 0x02038c08 +_080B6A98: .4byte c2_load_new_map + 1 +_080B6A9C: .4byte 0x03005dac +_080B6AA0: .4byte mapldr_08084390 + 1 + thumb_func_end task00_8084310 + + thumb_func_start mapldr_08084390 +mapldr_08084390: @ 80B6AA4 + push {r4,lr} + bl sub_8085784 + bl pal_fill_black + ldr r0, _080B6AFC + movs r1, 0 + bl AddTask + ldr r4, _080B6B00 + ldr r3, _080B6B04 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B6AE6 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x3 + bl npc_turn +_080B6AE6: + bl script_env_2_enable + bl player_bitmagic + ldr r1, _080B6B08 + movs r0, 0 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B6AFC: .4byte c3_080843F8 + 1 +_080B6B00: .4byte 0x02037350 +_080B6B04: .4byte 0x02037590 +_080B6B08: .4byte 0x03005dac + thumb_func_end mapldr_08084390 + + thumb_func_start c3_080843F8 +c3_080843F8: @ 80B6B0C + 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, _080B6B60 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6B3E + ldr r0, _080B6B64 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B6B58 + movs r0, 0x20 + bl oe_exec + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6B3E: + movs r0, 0x20 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B6B58 + bl script_env_2_disable + bl sub_809757C + adds r0, r5, 0 + bl remove_task +_080B6B58: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B6B60: .4byte 0x03005e00 +_080B6B64: .4byte 0x02037fd4 + thumb_func_end c3_080843F8 + + thumb_func_start sub_80B6B68 +sub_80B6B68: @ 80B6B68 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r0, _080B6B8C + movs r1, 0 + bl AddTask + ldr r1, _080B6B90 + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080B6B8C: .4byte sub_80B6B94 + 1 +_080B6B90: .4byte 0x03005dac + thumb_func_end sub_80B6B68 + + thumb_func_start sub_80B6B94 +sub_80B6B94: @ 80B6B94 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B6BC4 + adds r4, r1, r0 + ldr r5, _080B6BC8 +_080B6BA6: + 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 _080B6BA6 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B6BC4: .4byte 0x03005e00 +_080B6BC8: .4byte 0x0855c3c8 + thumb_func_end sub_80B6B94 + + thumb_func_start sub_80B6BCC +sub_80B6BCC: @ 80B6BCC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r9, r0 + ldr r6, _080B6C68 + ldrb r0, [r6, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, _080B6C6C + mov r8, r0 + add r5, r8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B6C70 + adds r4, r0 + bl sub_808EEDC + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_state_2 + adds r3, r4, 0 + adds r3, 0x42 + ldrb r0, [r3] + lsrs r0, 6 + mov r1, r9 + strh r0, [r1, 0x10] + ldrb r0, [r5, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r5, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r1, [r3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3] + mov r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B6C68: .4byte 0x02037590 +_080B6C6C: .4byte 0x02037350 +_080B6C70: .4byte 0x02020630 + thumb_func_end sub_80B6BCC + + thumb_func_start sub_80B6C74 +sub_80B6C74: @ 80B6C74 + push {r4,lr} + adds r4, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B6C88 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6C88: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6C74 + + thumb_func_start sub_80B6C90 +sub_80B6C90: @ 80B6C90 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _080B6CF4 + ldrb r0, [r6, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _080B6CF8 + adds r2, r0 + adds r0, r2, 0 + adds r0, 0x29 + movs r4, 0 + ldrsb r4, [r0, r4] + lsls r0, r4, 17 + negs r0, r0 + ldrh r1, [r2, 0x22] + ldr r3, _080B6CFC + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + movs r1, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r5, 0xA] + strh r1, [r5, 0xC] + ldr r2, _080B6D00 + ldrb r0, [r6, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x2B + bl audio_play + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B6CF4: .4byte 0x02037590 +_080B6CF8: .4byte 0x02020630 +_080B6CFC: .4byte 0x02021bbe +_080B6D00: .4byte 0x02037350 + thumb_func_end sub_80B6C90 + + thumb_func_start sub_80B6D04 +sub_80B6D04: @ 80B6D04 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r2, _080B6DB0 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B6DB4 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B6DB8 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r2, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bgt _080B6D46 + ldrh r1, [r4, 0xC] + adds r0, r2, r1 + strh r0, [r4, 0xC] + movs r1, 0xF + ands r0, r1 + cmp r0, 0 + beq _080B6D46 + lsls r0, r2, 1 + strh r0, [r4, 0xA] +_080B6D46: + ldrh r2, [r4, 0xE] + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6D84 + movs r0, 0x26 + ldrsh r1, [r5, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _080B6D84 + adds r0, r2, 0x1 + strh r0, [r4, 0xE] + ldrb r1, [r6, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r6, 0x3] + ldrb r1, [r4, 0x10] + adds r3, r5, 0 + adds r3, 0x42 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] +_080B6D84: + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080B6DA8 + movs r0, 0xD6 + bl audio_play + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6] + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6DA8: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B6DB0: .4byte 0x02037590 +_080B6DB4: .4byte 0x02037350 +_080B6DB8: .4byte 0x02020630 + thumb_func_end sub_80B6D04 + + thumb_func_start sub_80B6DBC +sub_80B6DBC: @ 80B6DBC + push {lr} + ldrh r1, [r0, 0x8] + adds r1, 0x1 + movs r2, 0 + strh r1, [r0, 0x8] + movs r1, 0x4 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r0, 0 + bl sub_808A2C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80B6DBC + + thumb_func_start sub_80B6DD8 +sub_80B6DD8: @ 80B6DD8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl sub_808A2CC + ldrh r0, [r4, 0xA] + negs r2, r0 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B6E00 + lsls r0, r2, 16 + asrs r0, 17 + strh r0, [r4, 0xA] +_080B6E00: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6E0E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6E0E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6DD8 + + thumb_func_start sub_80B6E18 +sub_80B6E18: @ 80B6E18 + push {lr} + ldr r1, _080B6E44 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + bl sub_808EE8C + bl sub_809757C + bl sub_808A2E4 + ldr r0, _080B6E48 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B6E44: .4byte 0x02037590 +_080B6E48: .4byte sub_80B6B94 + 1 + thumb_func_end sub_80B6E18 + + thumb_func_start sub_80B6E4C +sub_80B6E4C: @ 80B6E4C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080B6E80 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B6E84 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xA] + cmp r4, 0x6A + bne _080B6E78 + movs r0, 0x1 + strh r0, [r1, 0xA] +_080B6E78: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B6E80: .4byte sub_80B6E88 + 1 +_080B6E84: .4byte 0x03005e00 + thumb_func_end sub_80B6E4C + + thumb_func_start sub_80B6E88 +sub_80B6E88: @ 80B6E88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B6EB8 + adds r4, r1, r0 + ldr r5, _080B6EBC +_080B6E9A: + 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 _080B6E9A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B6EB8: .4byte 0x03005e00 +_080B6EBC: .4byte 0x0855c3e4 + thumb_func_end sub_80B6E88 + + thumb_func_start sub_80B6EC0 +sub_80B6EC0: @ 80B6EC0 + push {r4,lr} + adds r4, r0, 0 + bl player_bitmagic + bl sub_808EEDC + ldrb r0, [r4, 0xA] + bl sub_80E1558 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6EC0 + + thumb_func_start sub_80B6EE0 +sub_80B6EE0: @ 80B6EE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B6F48 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B6F4C + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B6F0A + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B6F3E +_080B6F0A: + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] + strh r1, [r5, 0xE] + ldrb r0, [r5, 0xA] + cmp r0, 0 + bne _080B6F38 + movs r0, 0x4 + strh r0, [r5, 0x8] +_080B6F38: + movs r0, 0x50 + bl audio_play +_080B6F3E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B6F48: .4byte 0x02037590 +_080B6F4C: .4byte 0x02037350 + thumb_func_end sub_80B6EE0 + + thumb_func_start sub_80B6F50 +sub_80B6F50: @ 80B6F50 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B6FB8 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080B6F6A + bl sub_80B7050 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6F6A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6F50 + + thumb_func_start sub_80B6F74 +sub_80B6F74: @ 80B6F74 + push {lr} + bl sub_80B6FB8 + bl sub_80B7060 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80B6F74 + + thumb_func_start sub_80B6F84 +sub_80B6F84: @ 80B6F84 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B7004 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080B6F9E + bl sub_80B7050 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6F9E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6F84 + + thumb_func_start sub_80B6FA8 +sub_80B6FA8: @ 80B6FA8 + push {lr} + bl sub_80B7004 + bl sub_80B7060 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80B6FA8 + + thumb_func_start sub_80B6FB8 +sub_80B6FB8: @ 80B6FB8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B6FFC + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B7000 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B6FF6 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] +_080B6FF6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B6FFC: .4byte 0x02037590 +_080B7000: .4byte 0x02020630 + thumb_func_end sub_80B6FB8 + + thumb_func_start sub_80B7004 +sub_80B7004: @ 80B7004 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B7048 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B704C + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B7042 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] +_080B7042: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B7048: .4byte 0x02037590 +_080B704C: .4byte 0x02020630 + thumb_func_end sub_80B7004 + + thumb_func_start sub_80B7050 +sub_80B7050: @ 80B7050 + push {lr} + bl music_something + bl sub_80AF0B4 + pop {r0} + bx r0 + thumb_func_end sub_80B7050 + + thumb_func_start sub_80B7060 +sub_80B7060: @ 80B7060 + push {lr} + ldr r0, _080B70A0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B709C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B709C + bl sub_80E1570 + bl warp_in + ldr r1, _080B70A4 + ldr r0, _080B70A8 + str r0, [r1] + ldr r0, _080B70AC + bl set_callback2 + ldr r0, _080B70B0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B709C: + pop {r0} + bx r0 + .align 2, 0 +_080B70A0: .4byte 0x02037fd4 +_080B70A4: .4byte 0x03005dac +_080B70A8: .4byte sub_80B70B4 + 1 +_080B70AC: .4byte c2_load_new_map + 1 +_080B70B0: .4byte sub_80B6E88 + 1 + thumb_func_end sub_80B7060 + + thumb_func_start sub_80B70B4 +sub_80B70B4: @ 80B70B4 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + ldr r0, _080B70D4 + movs r1, 0 + bl AddTask + ldr r1, _080B70D8 + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080B70D4: .4byte sub_80B70DC + 1 +_080B70D8: .4byte 0x03005dac + thumb_func_end sub_80B70B4 + + thumb_func_start sub_80B70DC +sub_80B70DC: @ 80B70DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080B710C + adds r4, r1, r0 + ldr r5, _080B7110 +_080B70EE: + 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 _080B70EE + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B710C: .4byte 0x03005e00 +_080B7110: .4byte 0x0855c3fc + thumb_func_end sub_80B70DC + + thumb_func_start sub_80B7114 +sub_80B7114: @ 80B7114 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + bl sub_808EEDC + ldr r0, _080B7174 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B7178 + adds r4, r0 + movs r0, 0x4 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x10 + strh r0, [r5, 0xA] + cmp r1, 0x6B + bne _080B717C + movs r1, 0x1 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080B717E + .align 2, 0 +_080B7174: .4byte 0x02037590 +_080B7178: .4byte 0x02037350 +_080B717C: + movs r1, 0 +_080B717E: + adds r0, r1, 0 + bl sub_80E1558 + movs r0, 0x1 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7114 + + thumb_func_start sub_80B7190 +sub_80B7190: @ 80B7190 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B71C8 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B71CC + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B71C8: .4byte 0x02037590 +_080B71CC: .4byte 0x02020630 + thumb_func_end sub_80B7190 + + thumb_func_start sub_80B71D0 +sub_80B71D0: @ 80B71D0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _080B7228 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B722C + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x84 + bl cosine + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x94 + bl sine + strh r0, [r5, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B720E + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_080B720E: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B721E + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + movs r0, 0x5 + strh r0, [r4, 0x8] +_080B721E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7228: .4byte 0x02037590 +_080B722C: .4byte 0x02020630 + thumb_func_end sub_80B71D0 + + thumb_func_start sub_80B7230 +sub_80B7230: @ 80B7230 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B7268 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B726C + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7268: .4byte 0x02037590 +_080B726C: .4byte 0x02020630 + thumb_func_end sub_80B7230 + + thumb_func_start sub_80B7270 +sub_80B7270: @ 80B7270 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _080B72C8 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B72CC + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x7C + bl cosine + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x76 + bl sine + strh r0, [r5, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B72AE + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_080B72AE: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B72C0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B72C0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B72C8: .4byte 0x02037590 +_080B72CC: .4byte 0x02020630 + thumb_func_end sub_80B7270 + + thumb_func_start sub_80B72D0 +sub_80B72D0: @ 80B72D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80E1584 + lsls r0, 24 + cmp r0, 0 + bne _080B72EC + bl sub_80E1570 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _080B72EE +_080B72EC: + movs r0, 0 +_080B72EE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B72D0 + + thumb_func_start sub_80B72F4 +sub_80B72F4: @ 80B72F4 + push {r4,lr} + ldr r0, _080B7340 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B7344 + adds r4, r0, r1 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B7338 + bl sub_808EE8C + bl script_env_2_disable + movs r0, 0x4 + bl sub_8093388 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldr r0, _080B7348 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B7338: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B7340: .4byte 0x02037590 +_080B7344: .4byte 0x02037350 +_080B7348: .4byte sub_80B70DC + 1 + thumb_func_end sub_80B72F4 + + thumb_func_start oei_waterfall +oei_waterfall: @ 80B734C + push {r4,lr} + ldr r4, _080B7378 + adds r0, r4, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B737C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _080B7380 + ldr r2, [r2] + strh r2, [r1, 0xA] + bl _call_via_r4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B7378: .4byte sub_80B7384 + 1 +_080B737C: .4byte 0x03005e00 +_080B7380: .4byte 0x02038c08 + thumb_func_end oei_waterfall + + thumb_func_start sub_80B7384 +sub_80B7384: @ 80B7384 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080B73C0 + ldr r2, _080B73C4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7396: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, _080B73C8 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B73CC + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080B7396 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B73C0: .4byte 0x0855c418 +_080B73C4: .4byte 0x03005e00 +_080B73C8: .4byte 0x02037590 +_080B73CC: .4byte 0x02037350 + thumb_func_end sub_80B7384 + + thumb_func_start sub_80B73D0 +sub_80B73D0: @ 80B73D0 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, _080B73EC + 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 + .align 2, 0 +_080B73EC: .4byte 0x02037590 + thumb_func_end sub_80B73D0 + + thumb_func_start waterfall_1_do_anim_probably +waterfall_1_do_anim_probably: @ 80B73F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl script_env_2_enable + adds r0, r5, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + bne _080B7420 + adds r0, r5, 0 + bl sub_8093284 + ldr r1, _080B7428 + movs r2, 0xA + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl oe_exec + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B7420: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7428: .4byte 0x02038c08 + thumb_func_end waterfall_1_do_anim_probably + + thumb_func_start waterfall_2_wait_anim_finish_probably +waterfall_2_wait_anim_finish_probably: @ 80B742C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B7446 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _080B7448 +_080B7446: + movs r0, 0 +_080B7448: + pop {r4} + pop {r1} + bx r1 + thumb_func_end waterfall_2_wait_anim_finish_probably + + thumb_func_start sub_80B7450 +sub_80B7450: @ 80B7450 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0x2 + bl d2s_walk + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7450 + + thumb_func_start sub_80B7478 +sub_80B7478: @ 80B7478 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + bne _080B748E + movs r0, 0 + b _080B74CA +_080B748E: + ldrb r0, [r4, 0x1E] + bl is_tile_x13_waterfall + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080B74C4 + bl script_env_2_disable + ldr r0, _080B74BC + strb r4, [r0, 0x6] + ldr r0, _080B74C0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0x2B + bl oe_active_list_remove + movs r0, 0 + b _080B74CA + .align 2, 0 +_080B74BC: .4byte 0x02037590 +_080B74C0: .4byte sub_80B7384 + 1 +_080B74C4: + movs r0, 0x3 + strh r0, [r5, 0x8] + movs r0, 0x1 +_080B74CA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7478 + + thumb_func_start sub_80B74D0 +sub_80B74D0: @ 80B74D0 + push {r4,lr} + ldr r4, _080B7500 + adds r0, r4, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B7504 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r3, _080B7508 + ldr r2, [r3] + strh r2, [r1, 0x26] + ldr r2, [r3, 0x4] + strh r2, [r1, 0x24] + bl _call_via_r4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B7500: .4byte sub_80B750C + 1 +_080B7504: .4byte 0x03005e00 +_080B7508: .4byte 0x02038c08 + thumb_func_end sub_80B74D0 + + thumb_func_start sub_80B750C +sub_80B750C: @ 80B750C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080B753C + ldr r2, _080B7540 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B751E: + 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 _080B751E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B753C: .4byte 0x0855c42c +_080B7540: .4byte 0x03005e00 + thumb_func_end sub_80B750C + + thumb_func_start dive_1_lock +dive_1_lock: @ 80B7544 + ldr r2, _080B7554 + movs r1, 0x1 + strb r1, [r2, 0x6] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + movs r0, 0 + bx lr + .align 2, 0 +_080B7554: .4byte 0x02037590 + thumb_func_end dive_1_lock + + thumb_func_start dive_2_unknown +dive_2_unknown: @ 80B7558 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, _080B757C + movs r2, 0x26 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl oe_exec + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B757C: .4byte 0x02038c08 + thumb_func_end dive_2_unknown + + thumb_func_start dive_3_unknown +dive_3_unknown: @ 80B7580 + push {lr} + sub sp, 0x8 + mov r1, sp + adds r1, 0x2 + mov r0, sp + bl player_get_pos_to + movs r0, 0x6 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B75C4 + ldr r2, _080B75CC + ldr r0, _080B75D0 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1E] + mov r0, sp + bl dive_warp + ldr r0, _080B75D4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0x2C + bl oe_active_list_remove +_080B75C4: + movs r0, 0 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_080B75CC: .4byte 0x02037350 +_080B75D0: .4byte 0x02037590 +_080B75D4: .4byte sub_80B750C + 1 + thumb_func_end dive_3_unknown + + thumb_func_start sub_80B75D8 +sub_80B75D8: @ 80B75D8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080B75EC + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B75EC: .4byte sub_80B75F0 + 1 + thumb_func_end sub_80B75D8 + + thumb_func_start sub_80B75F0 +sub_80B75F0: @ 80B75F0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080B7638 + ldr r2, _080B763C + ldr r5, _080B7640 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7604: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B7644 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _080B7648 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B7604 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B7638: .4byte 0x0855c438 +_080B763C: .4byte 0x03005e00 +_080B7640: .4byte 0x02037590 +_080B7644: .4byte 0x02037350 +_080B7648: .4byte 0x02020630 + thumb_func_end sub_80B75F0 + + thumb_func_start sub_80B764C +sub_80B764C: @ 80B764C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl player_bitmagic + bl sub_808EEDC + movs r0, 0 + bl sub_808A2C0 + ldr r0, _080B7680 + movs r2, 0x1 + strb r2, [r0, 0x6] + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + strh r2, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7680: .4byte 0x02037590 + thumb_func_end sub_80B764C + + thumb_func_start sub_80B7684 +sub_80B7684: @ 80B7684 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl sub_808A2CC + ldrh r0, [r4, 0xA] + negs r0, r0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080B76B0 + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B76B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B7684 + + thumb_func_start sub_80B76B8 +sub_80B76B8: @ 80B76B8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r4, 0xE] + ldr r3, _080B7700 + movs r5, 0x10 + ldrsh r0, [r1, r5] + str r0, [r3] + movs r5, 0x12 + ldrsh r0, [r1, r5] + str r0, [r3, 0x4] + adds r0, r2, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r3, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x32 + bl oe_exec + movs r0, 0xB2 + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7700: .4byte 0x02038c08 + thumb_func_end sub_80B76B8 + + thumb_func_start sub_80B7704 +sub_80B7704: @ 80B7704 + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl sub_808A2CC + ldrh r0, [r4, 0xA] + negs r2, r0 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x11 + bgt _080B773E + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _080B7750 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _080B7750 + lsls r0, r2, 1 + b _080B774E +_080B773E: + movs r0, 0x4 + ands r1, r0 + cmp r1, 0 + bne _080B7750 + lsls r0, r2, 16 + cmp r0, 0 + ble _080B7750 + asrs r0, 17 +_080B774E: + strh r0, [r4, 0xA] +_080B7750: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x6 + ble _080B779C + adds r0, r5, 0 + adds r0, 0x29 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r2, r1, 17 + negs r2, r2 + movs r7, 0x26 + ldrsh r3, [r5, r7] + movs r7, 0x22 + ldrsh r0, [r5, r7] + adds r0, r1 + ldr r1, _080B7794 + movs r7, 0 + ldrsh r1, [r1, r7] + adds r0, r1 + asrs r2, 16 + adds r0, r2 + cmn r3, r0 + ble _080B7798 + ldrh r0, [r5, 0x26] + ldrh r1, [r4, 0xE] + subs r0, r1 + strh r0, [r5, 0x26] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080B779C + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + b _080B779C + .align 2, 0 +_080B7794: .4byte 0x02021bbe +_080B7798: + movs r0, 0x1 + strh r0, [r4, 0x10] +_080B779C: + ldrh r2, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B77DA + movs r7, 0x26 + ldrsh r1, [r5, r7] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _080B77DA + adds r0, r2, 0x1 + strh r0, [r4, 0x12] + ldrb r0, [r6, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r6, 0x3] + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B77DA: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B77F0 + movs r7, 0x10 + ldrsh r0, [r4, r7] + cmp r0, 0 + beq _080B77F0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B77F0: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B7704 + + thumb_func_start sub_80B77F8 +sub_80B77F8: @ 80B77F8 + push {r4,lr} + adds r4, r0, 0 + bl music_something + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B77F8 + + thumb_func_start sub_80B7814 +sub_80B7814: @ 80B7814 + push {lr} + ldr r0, _080B7854 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B784C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B784C + bl warp_in + ldr r1, _080B7858 + ldr r0, _080B785C + str r0, [r1] + ldr r0, _080B7860 + bl set_callback2 + ldr r0, _080B7864 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B784C: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B7854: .4byte 0x02037fd4 +_080B7858: .4byte 0x03005dac +_080B785C: .4byte mapldr_080851BC + 1 +_080B7860: .4byte c2_load_new_map + 1 +_080B7864: .4byte sub_80B75F0 + 1 + thumb_func_end sub_80B7814 + + thumb_func_start mapldr_080851BC +mapldr_080851BC: @ 80B7868 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + ldr r0, _080B7888 + movs r1, 0 + str r1, [r0] + ldr r0, _080B788C + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B7888: .4byte 0x03005dac +_080B788C: .4byte sub_80B7890 + 1 + thumb_func_end mapldr_080851BC + + thumb_func_start sub_80B7890 +sub_80B7890: @ 80B7890 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080B78D8 + ldr r2, _080B78DC + ldr r5, _080B78E0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B78A4: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B78E4 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _080B78E8 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B78A4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B78D8: .4byte 0x0855c450 +_080B78DC: .4byte 0x03005e00 +_080B78E0: .4byte 0x02037590 +_080B78E4: .4byte 0x02037350 +_080B78E8: .4byte 0x02020630 + thumb_func_end sub_80B7890 + + thumb_func_start sub_80B78EC +sub_80B78EC: @ 80B78EC + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_808EEDC + bl player_bitmagic + ldr r1, _080B7918 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7918: .4byte 0x02037590 + thumb_func_end sub_80B78EC + + thumb_func_start sub_80B791C +sub_80B791C: @ 80B791C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B795C + ldr r1, _080B7964 + movs r2, 0x10 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r5, r2] + str r0, [r1, 0x4] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r6, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x31 + bl oe_exec + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B795C: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B7964: .4byte 0x02038c08 + thumb_func_end sub_80B791C + + thumb_func_start sub_80B7968 +sub_80B7968: @ 80B7968 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + movs r0, 0xA + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B79B8 + adds r0, r1 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bls _080B79B0 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + bl sub_808EE8C + movs r0, 0xAF + bl audio_play + movs r0, 0x4 + bl sub_8093514 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 +_080B79B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B79B8: .4byte 0x02020630 + thumb_func_end sub_80B7968 + + thumb_func_start sub_80B79BC +sub_80B79BC: @ 80B79BC + push {lr} + adds r0, r1, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B79E6 + ldr r1, _080B79EC + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + bl sub_809757C + ldr r0, _080B79F0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B79E6: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B79EC: .4byte 0x02037590 +_080B79F0: .4byte sub_80B7890 + 1 + thumb_func_end sub_80B79BC + + thumb_func_start sub_80B79F4 +sub_80B79F4: @ 80B79F4 + push {r4,lr} + ldr r4, _080B7A4C + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _080B7A50 + adds r0, 0x84 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080B7A54 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3 + ldrb r3, [r4, 0xC] + ands r3, r1 + lsls r3, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B7A4C: .4byte 0x02038c08 +_080B7A50: .4byte 0x085059f8 +_080B7A54: .4byte 0x02020630 + thumb_func_end sub_80B79F4 + + thumb_func_start sub_80B7A58 +sub_80B7A58: @ 80B7A58 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B7A70 + adds r0, r2, 0 + movs r1, 0x32 + bl oe_stop +_080B7A70: + pop {r0} + bx r0 + thumb_func_end sub_80B7A58 + + thumb_func_start sub_80B7A74 +sub_80B7A74: @ 80B7A74 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080B7A88 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B7A88: .4byte sub_80B7A8C + 1 + thumb_func_end sub_80B7A74 + + thumb_func_start sub_80B7A8C +sub_80B7A8C: @ 80B7A8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080B7AD4 + ldr r2, _080B7AD8 + ldr r5, _080B7ADC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7AA0: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B7AE0 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _080B7AE4 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B7AA0 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B7AD4: .4byte 0x0855c460 +_080B7AD8: .4byte 0x03005e00 +_080B7ADC: .4byte 0x02037590 +_080B7AE0: .4byte 0x02037350 +_080B7AE4: .4byte 0x02020630 + thumb_func_end sub_80B7A8C + + thumb_func_start sub_80B7AE8 +sub_80B7AE8: @ 80B7AE8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl player_bitmagic + bl sub_808EEDC + ldr r1, _080B7B14 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r0, [r4, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080B7B14: .4byte 0x02037590 + thumb_func_end sub_80B7AE8 + + thumb_func_start sub_80B7B18 +sub_80B7B18: @ 80B7B18 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B7B8C + ldrh r1, [r5, 0xA] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r0, 0x3 + ble _080B7B6C + ldr r1, _080B7B68 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r6, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x31 + bl oe_exec + strh r0, [r5, 0xA] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080B7B8C + .align 2, 0 +_080B7B68: .4byte 0x02038c08 +_080B7B6C: + adds r0, r1, 0x1 + strh r0, [r5, 0xA] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80935F0 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + movs r0, 0x27 + bl audio_play +_080B7B8C: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B7B18 + + thumb_func_start sub_80B7B94 +sub_80B7B94: @ 80B7B94 + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r2, _080B7BC8 + movs r0, 0xA + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B7BBE + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B7BBE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B7BC8: .4byte 0x02020630 + thumb_func_end sub_80B7B94 + + thumb_func_start sub_80B7BCC +sub_80B7BCC: @ 80B7BCC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x31 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B7BEA + bl music_something + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B7BEA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B7BCC + + thumb_func_start sub_80B7BF4 +sub_80B7BF4: @ 80B7BF4 + push {lr} + ldr r0, _080B7C34 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B7C2C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B7C2C + bl warp_in + ldr r1, _080B7C38 + ldr r0, _080B7C3C + str r0, [r1] + ldr r0, _080B7C40 + bl set_callback2 + ldr r0, _080B7C44 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B7C2C: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B7C34: .4byte 0x02037fd4 +_080B7C38: .4byte 0x03005dac +_080B7C3C: .4byte sub_80B6B68 + 1 +_080B7C40: .4byte c2_load_new_map + 1 +_080B7C44: .4byte sub_80B7A8C + 1 + thumb_func_end sub_80B7BF4 + + thumb_func_start sub_80B7C48 +sub_80B7C48: @ 80B7C48 + push {r4,lr} + ldr r4, _080B7CA0 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _080B7CA4 + adds r0, 0x80 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080B7CA8 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3 + ldrb r3, [r4, 0xC] + ands r3, r1 + lsls r3, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B7CA0: .4byte 0x02038c08 +_080B7CA4: .4byte 0x085059f8 +_080B7CA8: .4byte 0x02020630 + thumb_func_end sub_80B7C48 + + thumb_func_start sub_80B7CAC +sub_80B7CAC: @ 80B7CAC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B7CC4 + adds r0, r2, 0 + movs r1, 0x31 + bl oe_stop +_080B7CC4: + pop {r0} + bx r0 + thumb_func_end sub_80B7CAC + + thumb_func_start sub_80B7CC8 +sub_80B7CC8: @ 80B7CC8 + push {lr} + bl script_env_2_enable + bl player_bitmagic + ldr r0, _080B7CE0 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B7CE0: .4byte sub_80B7CE4 + 1 + thumb_func_end sub_80B7CC8 + + thumb_func_start sub_80B7CE4 +sub_80B7CE4: @ 80B7CE4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B7D0C + ldr r2, _080B7D10 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B7D0C: .4byte 0x0855c474 +_080B7D10: .4byte 0x03005e00 + thumb_func_end sub_80B7CE4 + + thumb_func_start sub_80B7D14 +sub_80B7D14: @ 80B7D14 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x40 + strh r0, [r4, 0x24] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B7D14 + + thumb_func_start sub_80B7D34 +sub_80B7D34: @ 80B7D34 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080B7DD8 + mov r0, sp + movs r2, 0x5 + bl memcpy + ldrh r1, [r4, 0x24] + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B7D60 + subs r0, r1, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _080B7D60 + bl music_something + bl sub_80AF0B4 +_080B7D60: + ldr r0, _080B7DDC + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B7DE0 + adds r5, r0, r1 + adds r0, r5, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B7D86 + adds r0, r5, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B7E40 +_080B7D86: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B7DF8 + ldr r0, _080B7DE4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B7DF8 + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B7DF8 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_direction + bl sub_8084E14 + bl warp_in + ldr r1, _080B7DE8 + ldr r0, _080B7DEC + str r0, [r1] + ldr r0, _080B7DF0 + bl set_callback2 + ldr r0, _080B7DF4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _080B7E40 + .align 2, 0 +_080B7DD8: .4byte 0x0855c47c +_080B7DDC: .4byte 0x02037590 +_080B7DE0: .4byte 0x02037350 +_080B7DE4: .4byte 0x02037fd4 +_080B7DE8: .4byte 0x03005dac +_080B7DEC: .4byte mapldr_080859D4 + 1 +_080B7DF0: .4byte c2_load_new_map + 1 +_080B7DF4: .4byte sub_80B7CE4 + 1 +_080B7DF8: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B7E0C + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B7E40 +_080B7E0C: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r0, [r0] + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_state_2 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0xB + bgt _080B7E34 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] +_080B7E34: + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 18 + movs r0, 0x8 + asrs r0, r1 + strh r0, [r4, 0xA] +_080B7E40: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B7D34 + + thumb_func_start mapldr_080859D4 +mapldr_080859D4: @ 80B7E48 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r1, _080B7E84 + movs r0, 0 + str r0, [r1] + ldr r2, _080B7E88 + ldr r0, _080B7E8C + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, _080B7E90 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B7E84: .4byte 0x03005dac +_080B7E88: .4byte 0x02037350 +_080B7E8C: .4byte 0x02037590 +_080B7E90: .4byte sub_80B7E94 + 1 + thumb_func_end mapldr_080859D4 + + thumb_func_start sub_80B7E94 +sub_80B7E94: @ 80B7E94 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B7EBC + ldr r2, _080B7EC0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B7EBC: .4byte 0x0855c484 +_080B7EC0: .4byte 0x03005e00 + thumb_func_end sub_80B7E94 + + thumb_func_start sub_80B7EC4 +sub_80B7EC4: @ 80B7EC4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B7EE2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] +_080B7EE2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B7EC4 + + thumb_func_start sub_80B7EE8 +sub_80B7EE8: @ 80B7EE8 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, _080B7F6C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, _080B7F70 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B7F74 + adds r6, r0, r1 + ldrh r1, [r5, 0xA] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B7F1A + subs r0, r1, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B7FAC +_080B7F1A: + adds r0, r6, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B7F32 + adds r0, r6, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B7FC0 +_080B7F32: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B7F7C + movs r2, 0x26 + ldrsh r4, [r5, r2] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080B7F7C + ldrb r1, [r6, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r6, 0x1] + bl script_env_2_disable + bl sub_809757C + ldr r0, _080B7F78 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _080B7FC0 + .align 2, 0 +_080B7F6C: .4byte 0x0855c47c +_080B7F70: .4byte 0x02037590 +_080B7F74: .4byte 0x02037350 +_080B7F78: .4byte sub_80B7E94 + 1 +_080B7F7C: + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r0, [r0] + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl npc_set_state_2 + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x1F + bgt _080B7FA4 + adds r0, r1, 0x1 + strh r0, [r5, 0xC] +_080B7FA4: + ldrh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 18 + strh r0, [r5, 0xA] +_080B7FAC: + ldrb r2, [r6, 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, [r6, 0x1] +_080B7FC0: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80B7EE8 + + thumb_func_start sub_80B7FC8 +sub_80B7FC8: @ 80B7FC8 + push {lr} + ldr r0, _080B7FD8 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B7FD8: .4byte sub_80B7FDC + 1 + thumb_func_end sub_80B7FC8 + + thumb_func_start sub_80B7FDC +sub_80B7FDC: @ 80B7FDC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B8004 + ldr r2, _080B8008 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B8004: .4byte 0x0855c48c +_080B8008: .4byte 0x03005e00 + thumb_func_end sub_80B7FDC + + thumb_func_start sub_80B800C +sub_80B800C: @ 80B800C + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + bl player_bitmagic + bl sub_808EEDC + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B800C + + thumb_func_start sub_80B8034 +sub_80B8034: @ 80B8034 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080B80B8 + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, _080B80BC + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B80C0 + adds r5, r0, r1 + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B8066 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B8080 +_080B8066: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r5, 0 + bl npc_turn + movs r0, 0x8 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_080B8080: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x7 + ble _080B80AE + movs r2, 0x26 + ldrsh r1, [r4, r2] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + cmp r1, r0 + bne _080B80AE + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x4 + strh r0, [r4, 0xA] + movs r0, 0x8 + strh r0, [r4, 0xC] + movs r0, 0x1 + strh r0, [r4, 0xE] + movs r0, 0x2D + bl audio_play +_080B80AE: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B80B8: .4byte 0x0855c47c +_080B80BC: .4byte 0x02037590 +_080B80C0: .4byte 0x02037350 + thumb_func_end sub_80B8034 + + thumb_func_start sub_80B80C4 +sub_80B80C4: @ 80B80C4 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080B8188 + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r2, _080B818C + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8190 + adds r3, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8194 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _080B810E + movs r0, 0x4 + strh r0, [r4, 0xA] + ldrb r0, [r3, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r3, 0 + bl npc_turn +_080B810E: + ldrh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + subs r0, r1 + strh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + ldrh r2, [r4, 0x10] + adds r0, r1, r2 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080B813A + movs r0, 0x4 + strh r0, [r4, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080B813A + lsls r0, r1, 1 + strh r0, [r4, 0xE] +_080B813A: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _080B8168 + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080B8168 + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B8168: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0xA7 + ble _080B817E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl music_something + bl sub_80AF0B4 +_080B817E: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B8188: .4byte 0x0855c47c +_080B818C: .4byte 0x02037590 +_080B8190: .4byte 0x02037350 +_080B8194: .4byte 0x02020630 + thumb_func_end sub_80B80C4 + + thumb_func_start sub_80B8198 +sub_80B8198: @ 80B8198 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B81EC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B81E6 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B81B8 + bl sub_81BE72C + movs r0, 0x1 + strh r0, [r4, 0x12] +_080B81B8: + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B81E6 + bl copy_saved_warp3_bank_and_enter_x_to_warp1 + bl warp_in + ldr r0, _080B81F0 + bl set_callback2 + ldr r1, _080B81F4 + ldr r0, _080B81F8 + str r0, [r1] + ldr r0, _080B81FC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B81E6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B81EC: .4byte 0x02037fd4 +_080B81F0: .4byte c2_load_new_map + 1 +_080B81F4: .4byte 0x03005dac +_080B81F8: .4byte mapldr_08085D88 + 1 +_080B81FC: .4byte sub_80B7FDC + 1 + thumb_func_end sub_80B8198 + + thumb_func_start mapldr_08085D88 +mapldr_08085D88: @ 80B8200 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r1, _080B8240 + movs r0, 0 + str r0, [r1] + ldr r2, _080B8244 + ldr r0, _080B8248 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + bl sub_808EEDC + ldr r0, _080B824C + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080B8240: .4byte 0x03005dac +_080B8244: .4byte 0x02037350 +_080B8248: .4byte 0x02037590 +_080B824C: .4byte sub_80B8250 + 1 + thumb_func_end mapldr_08085D88 + + thumb_func_start sub_80B8250 +sub_80B8250: @ 80B8250 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B8278 + ldr r2, _080B827C + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B8278: .4byte 0x0855c49c +_080B827C: .4byte 0x03005e00 + thumb_func_end sub_80B8250 + + thumb_func_start sub_80B8280 +sub_80B8280: @ 80B8280 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B82F6 + ldr r5, _080B82FC + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _080B8300 + adds r2, r0 + adds r0, r2, 0 + adds r0, 0x29 + movs r4, 0 + ldrsb r4, [r0, r4] + lsls r0, r4, 17 + negs r0, r0 + ldrh r1, [r2, 0x22] + ldr r3, _080B8304 + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + strh r0, [r2, 0x26] + ldr r3, _080B8308 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r3, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r3 + strb r0, [r1, 0x1] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0x8 + strh r0, [r6, 0xA] + movs r0, 0x1 + strh r0, [r6, 0xC] + adds r2, 0x42 + ldrb r0, [r2] + lsrs r0, 6 + strh r0, [r6, 0x24] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + movs r0, 0x2D + bl audio_play +_080B82F6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B82FC: .4byte 0x02037590 +_080B8300: .4byte 0x02020630 +_080B8304: .4byte 0x02021bbe +_080B8308: .4byte 0x02037350 + thumb_func_end sub_80B8280 + + thumb_func_start sub_80B830C +sub_80B830C: @ 80B830C + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080B8374 + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r2, _080B8378 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B837C + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8380 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + blt _080B8384 + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080B83AA + adds r0, r1, 0x1 + strh r0, [r4, 0x22] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + ldrh r1, [r4, 0x24] + adds r3, r5, 0 + adds r3, 0x42 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _080B83AA + .align 2, 0 +_080B8374: .4byte 0x0855c47c +_080B8378: .4byte 0x02037590 +_080B837C: .4byte 0x02037350 +_080B8380: .4byte 0x02020630 +_080B8384: + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080B83AA + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B83AA: + ldrh r2, [r5, 0x26] + movs r3, 0x26 + ldrsh r1, [r5, r3] + movs r0, 0x30 + negs r0, r0 + cmp r1, r0 + blt _080B83CE + ldrh r1, [r4, 0xA] + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0x1 + ble _080B83CE + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _080B83CE + subs r0, r1, 0x1 + strh r0, [r4, 0xA] +_080B83CE: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + movs r7, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B83F0 + movs r0, 0x4 + strh r0, [r4, 0xC] + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r6, 0 + bl npc_turn +_080B83F0: + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080B8406 + strh r7, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + strh r0, [r4, 0xA] + strh r7, [r4, 0xC] +_080B8406: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80B830C + + thumb_func_start sub_80B8410 +sub_80B8410: @ 80B8410 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080B848C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, _080B8490 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8494 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B8484 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r5, 0 + bl npc_turn + movs r0, 0x8 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080B8484 + movs r0, 0x24 + ldrsh r1, [r4, r0] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + cmp r1, r0 + bne _080B8484 + bl script_env_2_disable + bl sub_808EE8C + bl sub_809757C + ldr r0, _080B8498 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B8484: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B848C: .4byte 0x0855c47c +_080B8490: .4byte 0x02037590 +_080B8494: .4byte 0x02037350 +_080B8498: .4byte sub_80B8250 + 1 + thumb_func_end sub_80B8410 + + thumb_func_start sub_80B849C +sub_80B849C: @ 80B849C + push {r4,lr} + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B84BC + ldr r0, _080B84B8 + b _080B84BE + .align 2, 0 +_080B84B8: .4byte sub_80B8554 + 1 +_080B84BC: + ldr r0, _080B84EC +_080B84BE: + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _080B84F0 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80B8C60 + ldr r2, _080B84F4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x26] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B84EC: .4byte sub_80B88B4 + 1 +_080B84F0: .4byte 0x02038c08 +_080B84F4: .4byte 0x03005e00 + thumb_func_end sub_80B849C + + thumb_func_start sub_80B84F8 +sub_80B84F8: @ 80B84F8 + push {r4-r6,lr} + ldr r5, _080B854C + ldr r0, [r5] + movs r6, 0x80 + lsls r6, 24 + ands r6, r0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, _080B8550 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + str 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] + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + movs r0, 0x6 + bl oe_exec + movs r0, 0x3B + bl oe_active_list_remove + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B854C: .4byte 0x02038c08 +_080B8550: .4byte 0x020244ec + thumb_func_end sub_80B84F8 + + thumb_func_start sub_80B8554 +sub_80B8554: @ 80B8554 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B857C + ldr r2, _080B8580 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B857C: .4byte 0x0855c4a8 +_080B8580: .4byte 0x03005e00 + thumb_func_end sub_80B8554 + + thumb_func_start sub_80B8584 +sub_80B8584: @ 80B8584 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B85E0 + ldrh r0, [r0] + strh r0, [r4, 0x1E] + ldr r0, _080B85E4 + ldrh r0, [r0] + strh r0, [r4, 0x20] + adds r0, r4, 0 + adds r0, 0x22 + ldr r1, _080B85E8 + ldr r1, [r1, 0xC] + bl sub_806F67C + ldr r1, _080B85EC + strh r1, [r4, 0xA] + ldr r0, _080B85F0 + strh r0, [r4, 0xC] + movs r0, 0x3F + strh r0, [r4, 0xE] + movs r0, 0x3E + strh r0, [r4, 0x10] + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0xC] + movs r0, 0x44 + bl lcd_io_set + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl lcd_io_set + ldrh r1, [r4, 0x10] + movs r0, 0x4A + bl lcd_io_set + ldr r0, _080B85F4 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B85E0: .4byte 0x04000048 +_080B85E4: .4byte 0x0400004a +_080B85E8: .4byte 0x030022c0 +_080B85EC: .4byte 0x0000f0f1 +_080B85F0: .4byte 0x00005051 +_080B85F4: .4byte sub_80B880C + 1 + thumb_func_end sub_80B8584 + + thumb_func_start sub_80B85F8 +sub_80B85F8: @ 80B85F8 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, _080B8650 + ldrh r1, [r0] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + ldrh r4, [r0] + lsrs r4, 8 + lsls r4, 27 + lsrs r4, 16 + ldr r0, _080B8654 + movs r5, 0xC0 + lsls r5, 19 + adds r1, r5 + movs r2, 0x80 + lsls r2, 1 + bl CpuSet + movs r0, 0 + str r0, [sp] + adds r5, r4, r5 + ldr r2, _080B8658 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + ldr r0, _080B865C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + bl sub_80B8874 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B8650: .4byte 0x04000008 +_080B8654: .4byte 0x0855ae50 +_080B8658: .4byte 0x05000200 +_080B865C: .4byte 0x0855b050 + thumb_func_end sub_80B85F8 + + thumb_func_start sub_80B8660 +sub_80B8660: @ 80B8660 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldrh r6, [r3, 0xA] + ldrh r2, [r3, 0xC] + movs r7, 0xFF + lsrs r1, r6, 8 + subs r1, 0x10 + lsls r1, 16 + lsrs r0, r2, 8 + subs r0, 0x2 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + ands r0, r2 + adds r5, r0, 0x2 + lsrs r2, r1, 16 + cmp r1, 0 + bge _080B868C + movs r2, 0 +_080B868C: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0x27 + bgt _080B8696 + movs r4, 0x28 +_080B8696: + cmp r5, 0x78 + ble _080B869C + movs r5, 0x78 +_080B869C: + lsls r2, 16 + asrs r2, 16 + lsls r1, r2, 8 + adds r0, r7, 0 + ands r0, r6 + orrs r1, r0 + strh r1, [r3, 0xA] + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r4, 8 + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3, 0xC] + cmp r2, 0 + bne _080B86DC + cmp r4, 0x28 + bne _080B86DC + cmp r1, 0x78 + bne _080B86DC + ldr r2, _080B86E4 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _080B86E8 + str r1, [r0] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B86DC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B86E4: .4byte 0x02020630 +_080B86E8: .4byte sub_80B8CC0 + 1 + thumb_func_end sub_80B8660 + + thumb_func_start sub_80B86EC +sub_80B86EC: @ 80B86EC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldr r2, _080B8718 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B8712 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B8712: + pop {r0} + bx r0 + .align 2, 0 +_080B8718: .4byte 0x02020630 + thumb_func_end sub_80B86EC + + thumb_func_start sub_80B871C +sub_80B871C: @ 80B871C + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldrh r2, [r3, 0xC] + lsls r1, r2, 16 + movs r0, 0xFF + asrs r1, 24 + adds r1, 0x6 + lsls r1, 16 + ands r0, r2 + subs r0, 0x6 + lsls r0, 16 + lsrs r2, r0, 16 + lsrs r4, r1, 16 + asrs r1, 16 + cmp r1, 0x50 + ble _080B8744 + movs r4, 0x50 +_080B8744: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x50 + bgt _080B874E + movs r2, 0x51 +_080B874E: + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r0, 8 + lsls r2, 16 + asrs r2, 16 + orrs r1, r2 + strh r1, [r3, 0xC] + cmp r0, 0x50 + bne _080B876A + cmp r2, 0x51 + bne _080B876A + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B876A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B871C + + thumb_func_start sub_80B8770 +sub_80B8770: @ 80B8770 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, _080B87B0 + ldrh r1, [r0] + lsrs r1, 8 + lsls r1, 27 + lsrs r1, 16 + movs r0, 0 + str r0, [sp] + movs r0, 0xC0 + lsls r0, 19 + adds r1, r0 + ldr r2, _080B87B4 + mov r0, sp + bl CpuSet + movs r0, 0xF1 + strh r0, [r4, 0xA] + movs r0, 0xA1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x1E] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B87B0: .4byte 0x04000008 +_080B87B4: .4byte 0x05000200 + thumb_func_end sub_80B8770 + + thumb_func_start overworld_bg_setup_2 +overworld_bg_setup_2: @ 80B87B8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x22 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + bl SetVBlankCallback + bl sub_8197200 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8804 + adds r0, r1 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + bl sub_80B6070 + movs r0, 0x6 + bl oe_active_list_remove + ldr r0, _080B8808 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B8804: .4byte 0x02020630 +_080B8808: .4byte sub_80B8554 + 1 + thumb_func_end overworld_bg_setup_2 + + thumb_func_start sub_80B880C +sub_80B880C: @ 80B880C + push {r4,lr} + sub sp, 0x4 + ldr r0, _080B886C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _080B8870 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + bl _call_via_r0 + ldrh r1, [r4, 0xA] + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0xC] + movs r0, 0x44 + bl lcd_io_set + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl lcd_io_set + ldrh r1, [r4, 0x10] + movs r0, 0x4A + bl lcd_io_set + ldrh r1, [r4, 0x12] + movs r0, 0x10 + bl lcd_io_set + ldrh r1, [r4, 0x14] + movs r0, 0x12 + bl lcd_io_set + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B886C: .4byte sub_80B8554 + 1 +_080B8870: .4byte 0x03005e00 + thumb_func_end sub_80B880C + + thumb_func_start sub_80B8874 +sub_80B8874: @ 80B8874 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080B88A8 + adds r2, r0, r1 + movs r1, 0 + ldr r5, _080B88AC + movs r0, 0xF0 + lsls r0, 8 + adds r4, r0, 0 + ldr r3, _080B88B0 +_080B888A: + lsls r0, r1, 1 + adds r0, r5 + ldrh r0, [r0] + orrs r0, r4 + strh r0, [r2] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, 0x2 + cmp r1, r3 + bls _080B888A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B88A8: .4byte 0x06000140 +_080B88AC: .4byte 0x0855b070 +_080B88B0: .4byte 0x0000013f + thumb_func_end sub_80B8874 + + thumb_func_start sub_80B88B4 +sub_80B88B4: @ 80B88B4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B88DC + ldr r2, _080B88E0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B88DC: .4byte 0x0855c4c4 +_080B88E0: .4byte 0x03005e00 + thumb_func_end sub_80B88B4 + + thumb_func_start sub_80B88E4 +sub_80B88E4: @ 80B88E4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0xA] + movs r0, 0x10 + bl lcd_io_set + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl lcd_io_set + adds r0, r4, 0 + adds r0, 0x22 + ldr r1, _080B8918 + ldr r1, [r1, 0xC] + bl sub_806F67C + ldr r0, _080B891C + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B8918: .4byte 0x030022c0 +_080B891C: .4byte sub_80B8AE0 + 1 + thumb_func_end sub_80B88E4 + + thumb_func_start sub_80B8920 +sub_80B8920: @ 80B8920 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, _080B897C + ldrh r1, [r0] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + ldrh r4, [r0] + lsrs r4, 8 + lsls r4, 27 + lsrs r4, 16 + movs r0, 0 + mov r8, r0 + strh r4, [r6, 0x20] + ldr r0, _080B8980 + movs r5, 0xC0 + lsls r5, 19 + adds r1, r5 + movs r2, 0x40 + bl CpuSet + mov r0, r8 + str r0, [sp] + adds r4, r5 + ldr r2, _080B8984 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + ldr r0, _080B8988 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B897C: .4byte 0x04000008 +_080B8980: .4byte 0x0855b2f0 +_080B8984: .4byte 0x05000200 +_080B8988: .4byte 0x0855b370 + thumb_func_end sub_80B8920 + + thumb_func_start sub_80B898C +sub_80B898C: @ 80B898C + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B38 + lsls r0, 24 + cmp r0, 0 + beq _080B89C4 + movs r0, 0x42 + movs r1, 0xF0 + bl lcd_io_set + ldr r1, _080B89D0 + movs r0, 0x46 + bl lcd_io_set + ldr r2, _080B89D4 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _080B89D8 + str r1, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B89C4: + adds r0, r4, 0 + bl sub_80B8B28 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B89D0: .4byte 0x00002878 +_080B89D4: .4byte 0x02020630 +_080B89D8: .4byte sub_80B8CC0 + 1 + thumb_func_end sub_80B898C + + thumb_func_start sub_80B89DC +sub_80B89DC: @ 80B89DC + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B28 + ldr r2, _080B8A08 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B8A00 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8A00: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B8A08: .4byte 0x02020630 + thumb_func_end sub_80B89DC + + thumb_func_start sub_80B8A0C +sub_80B8A0C: @ 80B8A0C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80B8B28 + ldrh r1, [r4, 0xA] + movs r0, 0x7 + ands r0, r1 + movs r1, 0 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldr r5, _080B8A40 + movs r0, 0x42 + adds r1, r5, 0 + bl lcd_io_set + movs r0, 0x46 + adds r1, r5, 0 + bl lcd_io_set + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B8A40: .4byte 0x0000ffff + thumb_func_end sub_80B8A0C + + thumb_func_start sub_80B8A44 +sub_80B8A44: @ 80B8A44 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B28 + adds r0, r4, 0 + bl sub_80B8BF0 + lsls r0, 24 + cmp r0, 0 + beq _080B8A5E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8A5E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B8A44 + + thumb_func_start sub_80B8A64 +sub_80B8A64: @ 80B8A64 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, _080B8AD0 + ldrh r1, [r0] + lsrs r1, 8 + lsls r1, 27 + lsrs r1, 16 + movs r0, 0 + str r0, [sp] + movs r0, 0xC0 + lsls r0, 19 + adds r1, r0 + ldr r2, _080B8AD4 + mov r0, sp + bl CpuSet + adds r0, r4, 0 + adds r0, 0x22 + add r1, sp, 0x4 + bl sub_806F684 + ldr r0, [sp, 0x4] + bl SetVBlankCallback + bl sub_8197200 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8AD8 + adds r0, r1 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + bl sub_80B6070 + movs r0, 0x6 + bl oe_active_list_remove + ldr r0, _080B8ADC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B8AD0: .4byte 0x04000008 +_080B8AD4: .4byte 0x05000200 +_080B8AD8: .4byte 0x02020630 +_080B8ADC: .4byte sub_80B88B4 + 1 + thumb_func_end sub_80B8A64 + + thumb_func_start sub_80B8AE0 +sub_80B8AE0: @ 80B8AE0 + push {r4,lr} + sub sp, 0x4 + ldr r0, _080B8B20 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _080B8B24 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + bl _call_via_r0 + ldrh r1, [r4, 0xA] + movs r0, 0x10 + bl lcd_io_set + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl lcd_io_set + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B8B20: .4byte sub_80B88B4 + 1 +_080B8B24: .4byte 0x03005e00 + thumb_func_end sub_80B8AE0 + + thumb_func_start sub_80B8B28 +sub_80B8B28: @ 80B8B28 + ldrh r1, [r0, 0xA] + subs r1, 0x10 + strh r1, [r0, 0xA] + ldrh r1, [r0, 0xE] + adds r1, 0x10 + strh r1, [r0, 0xE] + bx lr + thumb_func_end sub_80B8B28 + + thumb_func_start sub_80B8B38 +sub_80B8B38: @ 80B8B38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r2, [r5, 0x10] + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B8B54 + movs r0, 0x1 + b _080B8BD8 +_080B8B54: + ldrh r0, [r5, 0xE] + lsls r0, 16 + asrs r3, r0, 19 + movs r1, 0x1F + ands r3, r1 + movs r4, 0x10 + ldrsh r0, [r5, r4] + cmp r3, r0 + blt _080B8BD6 + movs r0, 0x20 + subs r3, r0, r3 + ands r3, r1 + subs r0, r2 + mov r12, r0 + mov r7, r12 + ands r7, r1 + mov r12, r7 + ldrh r0, [r5, 0x20] + ldr r1, _080B8BE8 + adds r1, r0 + mov r8, r1 + movs r4, 0 + ldr r7, _080B8BEC + mov r10, r7 + movs r0, 0xF0 + lsls r0, 8 + mov r9, r0 + adds r1, r3, 0x1 + movs r0, 0x1F + ands r1, r0 + str r1, [sp] + mov r6, r12 + adds r6, 0x1 + ands r6, r0 +_080B8B98: + lsls r1, r4, 5 + adds r2, r1, r3 + lsls r2, 1 + add r2, r8 + mov r7, r12 + adds r0, r7, r1 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r7, r9 + orrs r0, r7 + strh r0, [r2] + ldr r0, [sp] + adds r2, r1, r0 + lsls r2, 1 + add r2, r8 + adds r1, r6, r1 + lsls r1, 1 + add r1, r10 + ldrh r0, [r1] + mov r1, r9 + orrs r0, r1 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bls _080B8B98 + ldrh r0, [r5, 0x10] + adds r0, 0x2 + strh r0, [r5, 0x10] +_080B8BD6: + movs r0, 0 +_080B8BD8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B8BE8: .4byte 0x06000140 +_080B8BEC: .4byte 0x0855b390 + thumb_func_end sub_80B8B38 + + thumb_func_start sub_80B8BF0 +sub_80B8BF0: @ 80B8BF0 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B8C00 + movs r0, 0x1 + b _080B8C54 +_080B8C00: + ldrh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 19 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r2, r0 + blt _080B8C52 + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r2, r0, 19 + movs r0, 0x1F + ands r2, r0 + ldrh r0, [r5, 0x20] + ldr r1, _080B8C5C + adds r6, r0, r1 + movs r3, 0 + movs r0, 0xF0 + lsls r0, 8 + adds r7, r0, 0 + adds r4, r2, 0x1 + movs r0, 0x1F + ands r4, r0 +_080B8C30: + lsls r0, r3, 5 + adds r1, r0, r2 + lsls r1, 1 + adds r1, r6 + strh r7, [r1] + adds r0, r4 + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x9 + bls _080B8C30 + ldrh r0, [r5, 0x10] + adds r0, 0x2 + strh r0, [r5, 0x10] +_080B8C52: + movs r0, 0 +_080B8C54: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B8C5C: .4byte 0x06000140 + thumb_func_end sub_80B8BF0 + + thumb_func_start sub_80B8C60 +sub_80B8C60: @ 80B8C60 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r5, 0x80 + lsls r5, 24 + ands r5, r6 + lsrs r5, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080B8CB4 + ands r6, r0 + lsls r0, r6, 16 + lsrs r0, 16 + movs r3, 0xA0 + lsls r3, 1 + movs r4, 0x50 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + bl sub_80B5FE8 + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, _080B8CB8 + adds r2, r1 + ldr r1, _080B8CBC + str r1, [r2, 0x1C] + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x5] + strh r6, [r2, 0x2E] + strh r5, [r2, 0x3A] + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080B8CB4: .4byte 0x7fffffff +_080B8CB8: .4byte 0x02020630 +_080B8CBC: .4byte nullsub_12 + 1 + thumb_func_end sub_80B8C60 + + thumb_func_start sub_80B8CC0 +sub_80B8CC0: @ 80B8CC0 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x20] + subs r0, 0x14 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bgt _080B8D00 + movs r0, 0x78 + strh r0, [r1, 0x20] + movs r0, 0x1E + strh r0, [r1, 0x30] + ldr r0, _080B8CF4 + str r0, [r1, 0x1C] + movs r2, 0x3A + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080B8CF8 + ldrh r0, [r1, 0x2E] + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + b _080B8D00 + .align 2, 0 +_080B8CF4: .4byte sub_80B8D04 + 1 +_080B8CF8: + ldrh r0, [r1, 0x2E] + movs r1, 0 + bl cry_related +_080B8D00: + pop {r0} + bx r0 + thumb_func_end sub_80B8CC0 + + thumb_func_start sub_80B8D04 +sub_80B8D04: @ 80B8D04 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B8D18 + ldr r0, _080B8D1C + str r0, [r1, 0x1C] +_080B8D18: + pop {r0} + bx r0 + .align 2, 0 +_080B8D1C: .4byte sub_80B8D20 + 1 + thumb_func_end sub_80B8D04 + + thumb_func_start sub_80B8D20 +sub_80B8D20: @ 80B8D20 + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x20] + movs r0, 0x20 + ldrsh r1, [r2, r0] + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + bge _080B8D38 + movs r0, 0x1 + strh r0, [r2, 0x3C] + b _080B8D3E +_080B8D38: + adds r0, r3, 0 + subs r0, 0x14 + strh r0, [r2, 0x20] +_080B8D3E: + pop {r0} + bx r0 + thumb_func_end sub_80B8D20 + + thumb_func_start sub_80B8D44 +sub_80B8D44: @ 80B8D44 + push {lr} + ldr r0, _080B8D74 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B8D78 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _080B8D7C + ldr r0, [r0] + strh r0, [r1, 0x26] + bl sav1_reset_x2C + ldr r0, _080B8D80 + bl sub_80858C4 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B8D74: .4byte sub_80B8D84 + 1 +_080B8D78: .4byte 0x03005e00 +_080B8D7C: .4byte 0x02038c08 +_080B8D80: .4byte 0x0000016d + thumb_func_end sub_80B8D44 + + thumb_func_start sub_80B8D84 +sub_80B8D84: @ 80B8D84 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B8DAC + ldr r2, _080B8DB0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B8DAC: .4byte 0x0855c4e0 +_080B8DB0: .4byte 0x03005e00 + thumb_func_end sub_80B8D84 + + thumb_func_start sub_80B8DB4 +sub_80B8DB4: @ 80B8DB4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + bl script_env_2_enable + bl player_bitmagic + ldr r5, _080B8E0C + movs r0, 0x1 + strb r0, [r5, 0x6] + movs r0, 0x8 + bl sub_808BF14 + adds r6, r4, 0 + adds r6, 0xA + movs r0, 0xC + adds r0, r4 + mov r8, r0 + adds r0, r6, 0 + mov r1, r8 + bl player_get_pos_to + ldr r2, _080B8E10 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsrs r0, 4 + adds r1, r6, 0 + mov r2, r8 + bl numbers_move_direction + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B8E0C: .4byte 0x02037590 +_080B8E10: .4byte 0x02037350 + thumb_func_end sub_80B8DB4 + + thumb_func_start sub_80B8E14 +sub_80B8E14: @ 80B8E14 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B8E58 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8E5C + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B8E3E + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B8E50 +_080B8E3E: + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B8E50: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B8E58: .4byte 0x02037590 +_080B8E5C: .4byte 0x02037350 + thumb_func_end sub_80B8E14 + + thumb_func_start sub_80B8E60 +sub_80B8E60: @ 80B8E60 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B8E9C + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8EA0 + adds r0, r1 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + cmp r0, 0 + beq _080B8E96 + ldr r2, _080B8EA4 + movs r1, 0x26 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r2] + movs r0, 0x3B + bl oe_exec + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8E96: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B8E9C: .4byte 0x02037590 +_080B8EA0: .4byte 0x02037350 +_080B8EA4: .4byte 0x02038c08 + thumb_func_end sub_80B8E60 + + thumb_func_start sub_80B8EA8 +sub_80B8EA8: @ 80B8EA8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0x6 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B8F12 + ldr r5, _080B8F18 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B8F1C + adds r4, r0 + movs r0, 0x3 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + adds r0, r4, 0 + bl sub_8093284 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8093540 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldr r1, _080B8F20 + movs r2, 0xA + ldrsh r0, [r6, r2] + str r0, [r1] + movs r2, 0xC + ldrsh r0, [r6, r2] + str r0, [r1, 0x4] + ldrb r0, [r5, 0x5] + str r0, [r1, 0x8] + movs r0, 0x8 + bl oe_exec + strb r0, [r4, 0x1A] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B8F12: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B8F18: .4byte 0x02037590 +_080B8F1C: .4byte 0x02037350 +_080B8F20: .4byte 0x02038c08 + thumb_func_end sub_80B8EA8 + + thumb_func_start sub_80B8F24 +sub_80B8F24: @ 80B8F24 + push {r4,r5,lr} + ldr r5, _080B8F8C + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B8F90 + adds r4, r0, r1 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B8F84 + movs r0, 0 + strb r0, [r5, 0x6] + ldrb r1, [r5] + movs r0, 0xDF + ands r0, r1 + strb r0, [r5] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl d2s_look1 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldrb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC + bl sub_809757C + bl script_env_2_disable + movs r0, 0x9 + bl oe_active_list_remove + ldr r0, _080B8F94 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B8F84: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B8F8C: .4byte 0x02037590 +_080B8F90: .4byte 0x02037350 +_080B8F94: .4byte sub_80B8D84 + 1 + thumb_func_end sub_80B8F24 + + thumb_func_start sub_80B8F98 +sub_80B8F98: @ 80B8F98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080B909C + adds r0, 0x90 + ldr r0, [r0] + movs r2, 0x18 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, r0, 4 + add r1, r8 + lsls r1, 2 + ldr r0, _080B90A0 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + movs r2, 0xF + ands r0, r2 + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r2, 0 + strh r2, [r1, 0x2E] + strh r2, [r1, 0x30] + strh r2, [r1, 0x32] + ldr r0, _080B90A4 + strh r0, [r1, 0x34] + ldrh r0, [r1, 0x22] + strh r0, [r1, 0x36] + strh r2, [r1, 0x38] + ldr r1, _080B90A8 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _080B90AC + movs r0, 0x52 + bl lcd_io_set + ldr r1, _080B90B0 + movs r0, 0x48 + bl lcd_io_set + ldr r0, _080B90B4 + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x12 + movs r1, 0x78 + bl lcd_io_set + movs r4, 0x3 + ldr r7, _080B90B8 + ldr r0, _080B90BC + adds r6, r0, 0 +_080B901A: + movs r2, 0xC + lsls r0, r4, 1 + lsls r5, r4, 5 + adds r0, r4 + lsls r3, r0, 1 +_080B9024: + adds r0, r5, r2 + lsls r0, 1 + adds r0, r7 + adds r1, r2, r6 + adds r1, r3, r1 + adds r1, 0x1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _080B9024 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xE + bls _080B901A + movs r0, 0 + ldr r5, _080B90C0 +_080B904A: + movs r4, 0 + adds r7, r0, 0x1 + lsls r6, r0, 5 +_080B9050: + lsls r1, r4, 2 + adds r1, r6, r1 + ldr r0, _080B90C4 + adds r3, r1, r0 + adds r0, r1, 0x1 + adds r0, r5 + ldrb r2, [r0] + lsls r2, 8 + adds r0, r1, r5 + ldrb r0, [r0] + adds r0, r2 + strh r0, [r3] + ldr r0, _080B90C8 + adds r3, r1, r0 + adds r0, r1, 0x3 + adds r0, r5 + ldrb r2, [r0] + lsls r2, 8 + adds r1, 0x2 + adds r1, r5 + ldrb r0, [r1] + adds r0, r2 + strh r0, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _080B9050 + lsls r0, r7, 24 + lsrs r0, 24 + cmp r0, 0x59 + bls _080B904A + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B909C: .4byte 0x085059f8 +_080B90A0: .4byte 0x02020630 +_080B90A4: .4byte 0x0000ffff +_080B90A8: .4byte 0x00003e41 +_080B90AC: .4byte 0x00000e0e +_080B90B0: .4byte 0x00003f3f +_080B90B4: .4byte 0x0855b610 +_080B90B8: .4byte 0x0600f800 +_080B90BC: .4byte 0x0000bff4 +_080B90C0: .4byte 0x0855b630 +_080B90C4: .4byte 0x06008020 +_080B90C8: .4byte 0x06008022 + thumb_func_end sub_80B8F98 + + thumb_func_start sub_80B90CC +sub_80B90CC: @ 80B90CC + push {r4,lr} + ldr r0, _080B9118 + ldr r0, [r0, 0x68] + movs r1, 0x78 + movs r2, 0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + ldr r0, _080B911C + adds r2, r0 + ldrb r1, [r2, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0xD + negs r1, r1 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, _080B9120 + str r0, [r2, 0x1C] + ldr r0, _080B9124 + ldr r0, [r0] + strh r0, [r2, 0x30] + movs r0, 0x9E + bl audio_play + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080B9118: .4byte 0x085059f8 +_080B911C: .4byte 0x02020630 +_080B9120: .4byte sub_80B9128 + 1 +_080B9124: .4byte 0x02038c08 + thumb_func_end sub_80B90CC + + thumb_func_start sub_80B9128 +sub_80B9128: @ 80B9128 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x8C + bl cosine + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B918A + movs r2, 0x30 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B91A0 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r1, 0x22] + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] +_080B918A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080B919A + adds r0, r4, 0 + movs r1, 0x1E + bl oe_stop +_080B919A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B91A0: .4byte 0x02020630 + thumb_func_end sub_80B9128 + + thumb_func_start sub_80B91A4 +sub_80B91A4: @ 80B91A4 + push {lr} + ldr r0, _080B91C8 + movs r1, 0xFE + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B91CC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _080B91D0 + ldr r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B91C8: .4byte sub_80B91D4 + 1 +_080B91CC: .4byte 0x03005e00 +_080B91D0: .4byte 0x02038c08 + thumb_func_end sub_80B91A4 + + thumb_func_start sub_80B91D4 +sub_80B91D4: @ 80B91D4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B91FC + ldr r2, _080B9200 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B91FC: .4byte 0x0855c4f4 +_080B9200: .4byte 0x03005e00 + thumb_func_end sub_80B91D4 + + thumb_func_start sub_80B9204 +sub_80B9204: @ 80B9204 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _080B9254 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9258 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B922E + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B924C +_080B922E: + ldrb r0, [r6] + strh r0, [r5, 0x26] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl sub_808BF14 + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl npc_set_state_2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B924C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B9254: .4byte 0x02037590 +_080B9258: .4byte 0x02037350 + thumb_func_end sub_80B9204 + + thumb_func_start sub_80B925C +sub_80B925C: @ 80B925C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B9294 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9298 + adds r0, r1 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B928C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r1, _080B929C + movs r2, 0xA + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl oe_exec +_080B928C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9294: .4byte 0x02037590 +_080B9298: .4byte 0x02037350 +_080B929C: .4byte 0x02038c08 + thumb_func_end sub_80B925C + + thumb_func_start sub_80B92A0 +sub_80B92A0: @ 80B92A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080B92E8 + ldr r0, _080B92F0 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B92F4 + adds r5, r0, r1 + ldrh r1, [r4, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B92D8 + ldrb r0, [r5, 0x1A] + movs r1, 0x2 + bl sub_81555AC + ldrb r0, [r5, 0x1A] + movs r1, 0 + bl sub_81555D8 +_080B92D8: + bl sub_80B94C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B92E8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B92F0: .4byte 0x02037590 +_080B92F4: .4byte 0x02037350 + thumb_func_end sub_80B92A0 + + thumb_func_start sub_80B92F8 +sub_80B92F8: @ 80B92F8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B932C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xC] + movs r0, 0x1 + bl walkrun_set_bike_bits + ldr r0, _080B9334 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9338 + adds r0, r1 + movs r1, 0x2 + bl npc_set_state_2 +_080B932C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9334: .4byte 0x02037590 +_080B9338: .4byte 0x02037350 + thumb_func_end sub_80B92F8 + + thumb_func_start sub_80B933C +sub_80B933C: @ 80B933C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B9388 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B938C + adds r2, r0, r1 + ldrh r1, [r4, 0xC] + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080B9362 + subs r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B9380 +_080B9362: + adds r0, r2, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B9380 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x9E + bl audio_play + ldrb r0, [r4, 0xA] + bl sub_80B9524 +_080B9380: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9388: .4byte 0x02037590 +_080B938C: .4byte 0x02037350 + thumb_func_end sub_80B933C + + thumb_func_start sub_80B9390 +sub_80B9390: @ 80B9390 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080B9406 + ldr r0, _080B940C + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9410 + adds r4, r0, r1 + movs r0, 0x3 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, _080B9414 + adds r0, r6 + movs r1, 0x16 + bl obj_anim_image_start + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + movs r1, 0x48 + bl npc_set_state_2 + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B93FC + ldrb r1, [r4, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_delete_and_free_tiles +_080B93FC: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + strh r0, [r5, 0xC] +_080B9406: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B940C: .4byte 0x02037590 +_080B9410: .4byte 0x02037350 +_080B9414: .4byte 0x02020630 + thumb_func_end sub_80B9390 + + thumb_func_start sub_80B9418 +sub_80B9418: @ 80B9418 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080B9464 + ldr r0, _080B946C + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9470 + adds r4, r0 + adds r0, r4, 0 + bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + ldrb r1, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] + ldrb r0, [r5, 0xA] + ldrb r1, [r4, 0x4] + bl sub_80B9560 + bl sub_808EEDC + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B9464: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B946C: .4byte 0x02037590 +_080B9470: .4byte 0x02037350 + thumb_func_end sub_80B9418 + + thumb_func_start sub_80B9474 +sub_80B9474: @ 80B9474 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B948E + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B948E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B9474 + + thumb_func_start sub_80B9494 +sub_80B9494: @ 80B9494 + push {lr} + ldr r0, _080B94BC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B94B6 + movs r0, 0x1F + bl oe_active_list_remove + ldr r0, _080B94C0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B94B6: + pop {r0} + bx r0 + .align 2, 0 +_080B94BC: .4byte 0x02037fd4 +_080B94C0: .4byte sub_80B91D4 + 1 + thumb_func_end sub_80B9494 + + thumb_func_start sub_80B94C4 +sub_80B94C4: @ 80B94C4 + push {lr} + ldr r0, _080B94FC + ldr r0, [r0, 0x68] + movs r1, 0xFF + movs r2, 0xB4 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, _080B9500 + adds r2, r1 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + movs r3, 0xD + negs r3, r3 + ands r1, r3 + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x5] + ldr r1, _080B9504 + str r1, [r2, 0x1C] + pop {r1} + bx r1 + .align 2, 0 +_080B94FC: .4byte 0x085059f8 +_080B9500: .4byte 0x02020630 +_080B9504: .4byte sub_80B957C + 1 + thumb_func_end sub_80B94C4 + + thumb_func_start sub_80B9508 +sub_80B9508: @ 80B9508 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B9520 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_080B9520: .4byte 0x02020630 + thumb_func_end sub_80B9508 + + thumb_func_start sub_80B9524 +sub_80B9524: @ 80B9524 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9558 + adds r4, r0 + ldr r0, _080B955C + str r0, [r4, 0x1C] + movs r1, 0 + movs r0, 0x78 + strh r0, [r4, 0x20] + strh r1, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x2E + movs r2, 0x10 + bl memset + movs r0, 0x40 + strh r0, [r4, 0x3A] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9558: .4byte 0x02020630 +_080B955C: .4byte sub_80B963C + 1 + thumb_func_end sub_80B9524 + + thumb_func_start sub_80B9560 +sub_80B9560: @ 80B9560 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B9578 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + strh r1, [r2, 0x3A] + bx lr + .align 2, 0 +_080B9578: .4byte 0x02020630 + thumb_func_end sub_80B9560 + + thumb_func_start sub_80B957C +sub_80B957C: @ 80B957C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9628 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B95C0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _080B9630 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0 + bl sub_8008258 + movs r0, 0x76 + strh r0, [r4, 0x20] + ldr r0, _080B9634 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x40 + strh r0, [r4, 0x30] + adds r0, 0xC0 + strh r0, [r4, 0x32] +_080B95C0: + ldrh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl sine + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x32] + movs r0, 0x32 + ldrsh r1, [r4, r0] + ldr r0, _080B9638 + cmp r1, r0 + bgt _080B95F6 + adds r0, r2, 0 + adds r0, 0x60 + strh r0, [r4, 0x32] +_080B95F6: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x81 + ble _080B9628 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + 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 oam_center +_080B9628: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9630: .4byte 0x0855c548 +_080B9634: .4byte 0x0000ffd0 +_080B9638: .4byte 0x000007ff + thumb_func_end sub_80B957C + + thumb_func_start sub_80B963C +sub_80B963C: @ 80B963C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x8C + bl cosine + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _080B969A + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B96AC + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r1, 0x22] + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] +_080B969A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080B96A6 + movs r0, 0x1 + strh r0, [r4, 0x3C] +_080B96A6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B96AC: .4byte 0x02020630 + thumb_func_end sub_80B963C + + thumb_func_start sub_80B96B0 +sub_80B96B0: @ 80B96B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9784 + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080B96FA + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _080B978C + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + movs r0, 0x5E + strh r0, [r4, 0x20] + ldr r0, _080B9790 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0xF0 + strh r0, [r4, 0x30] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0x80 + strh r0, [r4, 0x36] +_080B96FA: + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r2, r1 + ldrh r0, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x30] + movs r3, 0x30 + ldrsh r0, [r4, r3] + movs r1, 0x20 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl sine + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r2, 0x80 + lsls r2, 1 + cmp r0, r2 + ble _080B973C + ldrh r0, [r4, 0x36] + subs r0, r1, r0 + strh r0, [r4, 0x32] +_080B973C: + ldrh r1, [r4, 0x36] + movs r3, 0x36 + ldrsh r0, [r4, r3] + cmp r0, 0xFF + bgt _080B974C + adds r0, r1, 0 + adds r0, 0x18 + strh r0, [r4, 0x36] +_080B974C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + bgt _080B9756 + strh r2, [r4, 0x32] +_080B9756: + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + ble _080B9784 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080B9784: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B978C: .4byte 0x0855c548 +_080B9790: .4byte 0x0000ffe0 + thumb_func_end sub_80B96B0 + + thumb_func_start sub_80B9794 +sub_80B9794: @ 80B9794 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80B9524 + ldr r1, _080B97B8 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, _080B97BC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B97B8: .4byte 0x02020630 +_080B97BC: .4byte sub_80B96B0 + 1 + thumb_func_end sub_80B9794 + + thumb_func_start sub_80B97C0 +sub_80B97C0: @ 80B97C0 + push {lr} + ldr r0, _080B97D0 + movs r1, 0xFE + bl AddTask + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080B97D0: .4byte sub_80B97D4 + 1 + thumb_func_end sub_80B97C0 + + thumb_func_start sub_80B97D4 +sub_80B97D4: @ 80B97D4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080B97FC + ldr r2, _080B9800 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080B97FC: .4byte 0x0855c550 +_080B9800: .4byte 0x03005e00 + thumb_func_end sub_80B97D4 + + thumb_func_start sub_80B9804 +sub_80B9804: @ 80B9804 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _080B98AC + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B98B0 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080B982E + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B98A6 +_080B982E: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x11 + strh r0, [r5, 0xC] + ldrb r0, [r6] + strh r0, [r5, 0x26] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl sub_808BF14 + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B9856 + ldrb r0, [r4, 0x1A] + movs r1, 0 + bl sub_81555AC +_080B9856: + movs r0, 0x3 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + bl sub_808EEDC + adds r0, r4, 0 + movs r1, 0x3 + bl npc_turn + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B98B4 + adds r0, r1 + movs r1, 0x16 + bl obj_anim_image_start + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + bl sub_80B94C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + bl sub_80B9524 + ldrb r0, [r5, 0xA] + ldrb r1, [r4, 0x4] + bl sub_80B9560 +_080B98A6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B98AC: .4byte 0x02037590 +_080B98B0: .4byte 0x02037350 +_080B98B4: .4byte 0x02020630 + thumb_func_end sub_80B9804 + + thumb_func_start sub_80B98B8 +sub_80B98B8: @ 80B98B8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B98D0 + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B9910 +_080B98D0: + ldr r0, _080B9918 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B991C + adds r0, r1 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9920 + adds r4, r0 + ldrb r0, [r5, 0xA] + movs r1, 0x40 + bl sub_80B9560 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] +_080B9910: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B9918: .4byte 0x02037590 +_080B991C: .4byte 0x02037350 +_080B9920: .4byte 0x02020630 + thumb_func_end sub_80B98B8 + + thumb_func_start sub_80B9924 +sub_80B9924: @ 80B9924 + push {r4,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, _080B996C + mov r0, sp + movs r2, 0x24 + bl memcpy + ldr r0, _080B9970 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080B9974 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r1, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _080B9962 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B9962: + add sp, 0x24 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B996C: .4byte 0x0855c56c +_080B9970: .4byte 0x02037590 +_080B9974: .4byte 0x02020630 + thumb_func_end sub_80B9924 + + thumb_func_start sub_80B9978 +sub_80B9978: @ 80B9978 + push {r4-r6,lr} + adds r6, r0, 0 + ldrb r0, [r6, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B99DC + ldr r0, _080B99E4 + ldrb r0, [r0, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, _080B99E8 + adds r5, r0 + ldrb r0, [r5, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B99EC + adds r4, r0 + ldrb r1, [r5, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x10 + ldrsh r1, [r5, r0] + movs r0, 0x12 + ldrsh r2, [r5, r0] + adds r0, r5, 0 + bl sub_808EB08 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + bl sub_808C114 + adds r0, r5, 0 + movs r1, 0x39 + bl npc_set_state_2 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B99DC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080B99E4: .4byte 0x02037590 +_080B99E8: .4byte 0x02037350 +_080B99EC: .4byte 0x02020630 + thumb_func_end sub_80B9978 + + thumb_func_start sub_80B99F0 +sub_80B99F0: @ 80B99F0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080B9A20 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9A24 + adds r0, r1 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080B9A18 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r0, [r4, 0xA] + bl sub_80B9794 +_080B9A18: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9A20: .4byte 0x02037590 +_080B9A24: .4byte 0x02037350 + thumb_func_end sub_80B99F0 + + thumb_func_start sub_80B9A28 +sub_80B9A28: @ 80B9A28 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B9A54 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9A5C + adds r0, r1 + bl obj_delete_and_free_tiles + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xA] +_080B9A54: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9A5C: .4byte 0x02020630 + thumb_func_end sub_80B9A28 + + thumb_func_start fishE +fishE: @ 80B9A60 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xA] + subs r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B9ACA + ldr r6, _080B9AD0 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9AD4 + adds r4, r0, r1 + movs r7, 0 + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B9A94 + movs r7, 0x3 + ldrb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC +_080B9A94: + adds r0, r7, 0 + bl sub_808BD8C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + adds r0, r4, 0 + movs r1, 0x1 + bl npc_turn + ldrh r0, [r5, 0x26] + strb r0, [r6] + movs r0, 0 + strb r0, [r6, 0x6] + movs r0, 0x20 + bl oe_active_list_remove + ldr r0, _080B9AD8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_080B9ACA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B9AD0: .4byte 0x02037590 +_080B9AD4: .4byte 0x02037350 +_080B9AD8: .4byte sub_80B97D4 + 1 + thumb_func_end fishE + + thumb_func_start sub_80B9ADC +sub_80B9ADC: @ 80B9ADC + push {r4,lr} + sub sp, 0x4 + ldr r4, _080B9B20 + ldrb r0, [r4] + ldrb r1, [r4, 0x4] + ldrb r2, [r4, 0x8] + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _080B9B2C + ldr r0, _080B9B24 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B9B28 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, sp + ldrb r0, [r0] + strh r0, [r1, 0xC] + ldr r0, [r4] + strh r0, [r1, 0x14] + ldr r0, [r4, 0x4] + strh r0, [r1, 0x16] + ldr r0, [r4, 0x8] + strh r0, [r1, 0x18] + b _080B9B32 + .align 2, 0 +_080B9B20: .4byte 0x02038c08 +_080B9B24: .4byte sub_80B9BE8 + 1 +_080B9B28: .4byte 0x03005e00 +_080B9B2C: + movs r0, 0x41 + bl oe_active_list_remove +_080B9B32: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B9ADC + + thumb_func_start sub_80B9B3C +sub_80B9B3C: @ 80B9B3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080B9B74 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B9B78 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B9B7C + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B9B7C + subs r0, r1, 0x1 + b _080B9B7A + .align 2, 0 +_080B9B74: .4byte 0x03005e08 +_080B9B78: + movs r0, 0x4 +_080B9B7A: + strh r0, [r4, 0xA] +_080B9B7C: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _080B9BB6 + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B9BAC + ldrh r1, [r4, 0xA] + negs r1, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_808A2CC + b _080B9BB6 +_080B9BAC: + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl sub_808A2CC +_080B9BB6: + bl sub_808A314 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9BC8 + adds r0, r5, 0 + bl remove_task +_080B9BC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B9B3C + + thumb_func_start sub_80B9BD0 +sub_80B9BD0: @ 80B9BD0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080B9BE4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x16] + bx lr + .align 2, 0 +_080B9BE4: .4byte 0x03005e00 + thumb_func_end sub_80B9BD0 + + thumb_func_start sub_80B9BE8 +sub_80B9BE8: @ 80B9BE8 + 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, _080B9C20 + adds r4, r0 + bl sub_808A2E4 + movs r0, 0 + bl sub_808A2C0 + ldr r1, _080B9C24 + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B9C20: .4byte 0x03005e08 +_080B9C24: .4byte 0x0855c590 + thumb_func_end sub_80B9BE8 + + thumb_func_start sub_80B9C28 +sub_80B9C28: @ 80B9C28 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B9C50 + movs r1, 0x5A + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x58 + bl audio_play + strh r4, [r5, 0xA] + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B9C50: .4byte sub_80B9B3C + 1 + thumb_func_end sub_80B9C28 + + thumb_func_start sub_80B9C54 +sub_80B9C54: @ 80B9C54 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + ldrh r0, [r7, 0x6] + adds r0, 0x1 + strh r0, [r7, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + ble _080B9CC2 + ldr r2, _080B9CCC + movs r1, 0x4 + ldrsh r0, [r7, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9CD0 + adds r4, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x1] + ldr r6, _080B9CD4 + ldr r5, _080B9CD8 + adds r0, r6, 0 + movs r1, 0x10 + adds r2, r5, 0 + bl sub_80A2A20 + str r5, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + adds r0, r4, 0 + bl sub_80B9D24 + movs r0, 0x57 + bl audio_play + ldrb r0, [r7, 0xA] + bl sub_80B9BD0 + movs r0, 0 + strh r0, [r7, 0x6] + ldrh r0, [r7, 0x2] + adds r0, 0x1 + strh r0, [r7, 0x2] +_080B9CC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B9CCC: .4byte 0x02037350 +_080B9CD0: .4byte 0x02020630 +_080B9CD4: .4byte 0x0000ffff +_080B9CD8: .4byte 0x00007fff + thumb_func_end sub_80B9C54 + + thumb_func_start sub_80B9CDC +sub_80B9CDC: @ 80B9CDC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _080B9D1C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B9D16 + ldr r0, _080B9D20 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080B9D16 + bl sub_808A2E4 + ldrb r0, [r4, 0xC] + ldrb r1, [r4, 0xE] + ldrb r2, [r4, 0x10] + bl npc_hide_by_local_id_and_map + movs r0, 0x41 + bl oe_active_list_remove + adds r0, r5, 0 + bl remove_task +_080B9D16: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080B9D1C: .4byte 0x02037fd4 +_080B9D20: .4byte sub_80B9B3C + 1 + thumb_func_end sub_80B9CDC + + thumb_func_start sub_80B9D24 +sub_80B9D24: @ 80B9D24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, _080B9DA8 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r2, r0 + movs r1, 0x24 + ldrsh r0, [r6, r1] + adds r2, r0 + ldr r0, _080B9DAC + movs r3, 0 + ldrsh r0, [r0, r3] + movs r3, 0x22 + ldrsh r1, [r6, r3] + adds r0, r1 + movs r3, 0x26 + ldrsh r1, [r6, r3] + adds r0, r1 + subs r0, 0x4 + movs r5, 0 + lsls r2, 16 + mov r8, r2 + lsls r7, r0, 16 +_080B9D5A: + ldr r0, _080B9DB0 + mov r2, r8 + asrs r1, r2, 16 + asrs r2, r7, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080B9D96 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9DB4 + adds r4, r0 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + strh r5, [r4, 0x2E] + ldrb r1, [r6, 0x5] + lsrs r1, 4 + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] +_080B9D96: + adds r5, 0x1 + cmp r5, 0x3 + ble _080B9D5A + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B9DA8: .4byte 0x03005dec +_080B9DAC: .4byte 0x03005de8 +_080B9DB0: .4byte 0x0855c5ec +_080B9DB4: .4byte 0x02020630 + thumb_func_end sub_80B9D24 + + thumb_func_start sub_80B9DB8 +sub_80B9DB8: @ 80B9DB8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _080B9DE4 + cmp r0, 0x1 + bgt _080B9DCE + cmp r0, 0 + beq _080B9DD8 + b _080B9E02 +_080B9DCE: + cmp r0, 0x2 + beq _080B9DF0 + cmp r0, 0x3 + beq _080B9DF6 + b _080B9E02 +_080B9DD8: + ldrh r0, [r1, 0x20] + subs r0, 0x10 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0xC + b _080B9E00 +_080B9DE4: + ldrh r0, [r1, 0x20] + adds r0, 0x10 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0xC + b _080B9E00 +_080B9DF0: + ldrh r0, [r1, 0x20] + subs r0, 0x10 + b _080B9DFA +_080B9DF6: + ldrh r0, [r1, 0x20] + adds r0, 0x10 +_080B9DFA: + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + adds r0, 0xC +_080B9E00: + strh r0, [r1, 0x22] +_080B9E02: + ldrh r0, [r1, 0x20] + adds r0, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF8 + bhi _080B9E1E + movs r0, 0x22 + ldrsh r2, [r1, r0] + movs r0, 0x4 + negs r0, r0 + cmp r2, r0 + blt _080B9E1E + cmp r2, 0xA4 + ble _080B9E24 +_080B9E1E: + adds r0, r1, 0 + bl obj_delete_and_free_tiles +_080B9E24: + pop {r0} + bx r0 + thumb_func_end sub_80B9DB8 + + thumb_func_start sub_80B9E28 +sub_80B9E28: @ 80B9E28 + push {r4-r7,lr} + sub sp, 0x4 + ldr r7, _080B9EC8 + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _080B9EBE + mov r0, sp + ldrb r0, [r0] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9ECC + adds r4, r0 + movs r0, 0x10 + ldrsh r5, [r4, r0] + subs r5, 0x7 + movs r0, 0x12 + ldrsh r6, [r4, r0] + subs r6, 0x7 + ldr r1, [r7, 0xC] + subs r5, r1, r5 + lsls r5, 4 + ldr r2, [r7, 0x10] + subs r6, r2, r6 + lsls r6, 4 + adds r1, 0x7 + lsls r1, 16 + asrs r1, 16 + adds r2, 0x7 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + bl npc_coords_shift + ldr r0, _080B9ED0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080B9ED4 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldrb r0, [r4, 0x4] + strh r0, [r2, 0xA] + ldr r3, _080B9ED8 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + adds r0, r5 + strh r0, [r2, 0xC] + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x22] + adds r0, r6 + strh r0, [r2, 0xE] + ldr r0, [r7, 0x14] + strh r0, [r2, 0x18] + mov r0, sp + ldrb r0, [r0] + strh r0, [r2, 0x1A] +_080B9EBE: + movs r0, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080B9EC8: .4byte 0x02038c08 +_080B9ECC: .4byte 0x02037350 +_080B9ED0: .4byte sub_80B9EDC + 1 +_080B9ED4: .4byte 0x03005e00 +_080B9ED8: .4byte 0x02020630 + thumb_func_end sub_80B9E28 + + thumb_func_start sub_80B9EDC +sub_80B9EDC: @ 80B9EDC + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _080B9F08 + adds r5, r0, r1 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080B9F0C + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080B9F10 + cmp r0, 0x1 + beq _080B9F4E + b _080B9FAC + .align 2, 0 +_080B9F08: .4byte 0x03005e08 +_080B9F0C: .4byte 0x02020630 +_080B9F10: + ldrh r0, [r6, 0x20] + lsls r0, 4 + strh r0, [r5, 0x8] + ldrh r0, [r6, 0x22] + lsls r0, 4 + strh r0, [r5, 0xA] + movs r2, 0x4 + ldrsh r0, [r5, r2] + lsls r0, 4 + movs r2, 0x8 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0xC] + movs r1, 0x6 + ldrsh r0, [r5, r1] + lsls r0, 4 + movs r2, 0xA + ldrsh r1, [r5, r2] + subs r0, r1 + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0xE] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080B9F4E: + ldrh r1, [r5, 0x10] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B9F7C + subs r0, r1, 0x1 + strh r0, [r5, 0x10] + ldrh r1, [r5, 0xC] + ldrh r0, [r5, 0x8] + adds r1, r0 + strh r1, [r5, 0x8] + ldrh r0, [r5, 0xE] + ldrh r2, [r5, 0xA] + adds r0, r2 + strh r0, [r5, 0xA] + lsls r1, 16 + asrs r1, 20 + strh r1, [r6, 0x20] + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 20 + strh r0, [r6, 0x22] + b _080B9FAC +_080B9F7C: + movs r1, 0x12 + ldrsh r0, [r5, r1] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _080B9FB4 + adds r4, r0 + ldrh r0, [r5, 0x4] + strh r0, [r6, 0x20] + ldrh r0, [r5, 0x6] + strh r0, [r6, 0x22] + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x42 + bl oe_active_list_remove + adds r0, r7, 0 + bl remove_task +_080B9FAC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B9FB4: .4byte 0x02037350 + thumb_func_end sub_80B9EDC + + thumb_func_start remove_some_task +remove_some_task: @ 80B9FB8 + push {r4,lr} + ldr r4, _080B9FE8 + movs r0, 0 + strb r0, [r4, 0x15] + ldr r1, _080B9FEC + ldrh r2, [r1, 0xA] + ldr r0, _080B9FF0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _080B9FF4 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldrb r0, [r4, 0x18] + cmp r0, 0xFF + beq _080B9FE2 + bl remove_task + movs r0, 0xFF + strb r0, [r4, 0x18] +_080B9FE2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B9FE8: .4byte 0x02039b28 +_080B9FEC: .4byte 0x040000b0 +_080B9FF0: .4byte 0x0000c5ff +_080B9FF4: .4byte 0x00007fff + thumb_func_end remove_some_task + + thumb_func_start dp12_8087EA4 +dp12_8087EA4: @ 80B9FF8 + push {r4,lr} + sub sp, 0x4 + mov r0, sp + movs r4, 0 + strh r4, [r0] + ldr r1, _080BA02C + ldr r2, _080BA030 + bl CpuSet + ldr r0, _080BA034 + movs r1, 0 + str r1, [r0] + str r1, [r0, 0x4] + str r1, [r0, 0x8] + str r1, [r0, 0xC] + strb r4, [r0, 0x14] + strb r4, [r0, 0x15] + strb r4, [r0, 0x16] + strb r4, [r0, 0x17] + movs r1, 0xFF + strb r1, [r0, 0x18] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BA02C: .4byte 0x02038c28 +_080BA030: .4byte 0x01000780 +_080BA034: .4byte 0x02039b28 + thumb_func_end dp12_8087EA4 + + thumb_func_start sub_80BA038 +sub_80BA038: @ 80BA038 + push {lr} + sub sp, 0xC + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r0, _080BA05C + cmp r1, r0 + bne _080BA06C + ldr r0, _080BA060 + ldr r1, _080BA064 + str r1, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + str r1, [r0, 0x4] + ldr r1, _080BA068 + b _080BA07C + .align 2, 0 +_080BA05C: .4byte 0xa2600001 +_080BA060: .4byte 0x02039b28 +_080BA064: .4byte 0x02038c2a +_080BA068: .4byte sub_80BA134 + 1 +_080BA06C: + ldr r0, _080BA09C + ldr r1, _080BA0A0 + str r1, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + str r1, [r0, 0x4] + ldr r1, _080BA0A4 +_080BA07C: + str r1, [r0, 0x10] + adds r1, r0, 0 + ldr r0, [sp, 0x4] + str r0, [r1, 0xC] + ldr r0, [sp] + str r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x8] + strb r0, [r1, 0x15] + mov r0, sp + ldrb r0, [r0, 0x9] + strb r0, [r1, 0x16] + strb r0, [r1, 0x17] + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_080BA09C: .4byte 0x02039b28 +_080BA0A0: .4byte 0x02038c2c +_080BA0A4: .4byte sub_80BA154 + 1 + thumb_func_end sub_80BA038 + + thumb_func_start sub_80BA0A8 +sub_80BA0A8: @ 80BA0A8 + push {r4,lr} + ldr r4, _080BA0D8 + ldrb r0, [r4, 0x15] + cmp r0, 0 + beq _080BA122 + cmp r0, 0x3 + bne _080BA0EC + movs r0, 0 + strb r0, [r4, 0x15] + ldr r1, _080BA0DC + ldrh r2, [r1, 0xA] + ldr r0, _080BA0E0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _080BA0E4 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r1, _080BA0E8 + movs r0, 0x1 + strb r0, [r1] + b _080BA122 + .align 2, 0 +_080BA0D8: .4byte 0x02039b28 +_080BA0DC: .4byte 0x040000b0 +_080BA0E0: .4byte 0x0000c5ff +_080BA0E4: .4byte 0x00007fff +_080BA0E8: .4byte 0x02039b44 +_080BA0EC: + ldr r1, _080BA128 + ldrh r2, [r1, 0xA] + ldr r0, _080BA12C + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _080BA130 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldrb r0, [r4, 0x14] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + ldr r0, [r4, 0x8] + str r0, [r1, 0x4] + ldr r0, [r4, 0xC] + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, [r4, 0x10] + bl _call_via_r0 + ldrb r0, [r4, 0x14] + movs r1, 0x1 + eors r0, r1 + strb r0, [r4, 0x14] +_080BA122: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BA128: .4byte 0x040000b0 +_080BA12C: .4byte 0x0000c5ff +_080BA130: .4byte 0x00007fff + thumb_func_end sub_80BA0A8 + + thumb_func_start sub_80BA134 +sub_80BA134: @ 80BA134 + ldr r0, _080BA14C + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, _080BA150 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_080BA14C: .4byte 0x02039b28 +_080BA150: .4byte 0x02038c28 + thumb_func_end sub_80BA134 + + thumb_func_start sub_80BA154 +sub_80BA154: @ 80BA154 + ldr r0, _080BA16C + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, _080BA170 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bx lr + .align 2, 0 +_080BA16C: .4byte 0x02039b28 +_080BA170: .4byte 0x02038c28 + thumb_func_end sub_80BA154 + + thumb_func_start task00_for_dp12 +task00_for_dp12: @ 80BA174 + 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 r6, 0 + ldr r0, _080BA19C + ldrb r0, [r0] + cmp r0, 0 + beq _080BA1A4 + mov r0, r12 + bl remove_task + ldr r1, _080BA1A0 + movs r0, 0xFF + strb r0, [r1, 0x18] + b _080BA324 + .align 2, 0 +_080BA19C: .4byte 0x02039b44 +_080BA1A0: .4byte 0x02039b28 +_080BA1A4: + ldr r1, _080BA1D0 + mov r0, r12 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x16 + ldrsh r0, [r3, r4] + mov r10, r1 + mov r9, r2 + cmp r0, 0 + beq _080BA250 + movs r1, 0x14 + ldrsh r0, [r3, r1] + cmp r0, 0xE + bhi _080BA250 + lsls r0, 2 + ldr r1, _080BA1D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BA1D0: .4byte 0x03005e00 +_080BA1D4: .4byte _080BA1D8 + .align 2, 0 +_080BA1D8: + .4byte _080BA214 + .4byte _080BA250 + .4byte _080BA21C + .4byte _080BA250 + .4byte _080BA224 + .4byte _080BA250 + .4byte _080BA22C + .4byte _080BA250 + .4byte _080BA234 + .4byte _080BA250 + .4byte _080BA23C + .4byte _080BA250 + .4byte _080BA244 + .4byte _080BA250 + .4byte _080BA24C +_080BA214: + ldr r0, _080BA218 + b _080BA24E + .align 2, 0 +_080BA218: .4byte 0x02022e14 +_080BA21C: + ldr r0, _080BA220 + b _080BA24E + .align 2, 0 +_080BA220: .4byte 0x02022e16 +_080BA224: + ldr r0, _080BA228 + b _080BA24E + .align 2, 0 +_080BA228: .4byte 0x02022e18 +_080BA22C: + ldr r0, _080BA230 + b _080BA24E + .align 2, 0 +_080BA230: .4byte 0x02022e1a +_080BA234: + ldr r0, _080BA238 + b _080BA24E + .align 2, 0 +_080BA238: .4byte 0x02022e1c +_080BA23C: + ldr r0, _080BA240 + b _080BA24E + .align 2, 0 +_080BA240: .4byte 0x02022e1e +_080BA244: + ldr r0, _080BA248 + b _080BA24E + .align 2, 0 +_080BA248: .4byte 0x02022e20 +_080BA24C: + ldr r0, _080BA2B0 +_080BA24E: + ldrh r6, [r0] +_080BA250: + mov r0, r9 + add r0, r12 + lsls r0, 3 + mov r2, r10 + adds r1, r0, r2 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BA2BC + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + movs r4, 0xE + ldrsh r0, [r1, r4] + movs r3, 0xA0 + lsls r3, 1 + adds r2, r0, r3 + movs r4, 0x8 + ldrsh r3, [r1, r4] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r3, r0 + bge _080BA324 + ldr r5, _080BA2B4 + ldr r0, _080BA2B8 + mov r8, r0 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 +_080BA28A: + lsls r2, r3, 1 + mov r0, r8 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r5 + ldrh r0, [r4] + adds r0, r6 + strh r0, [r2] + adds r4, 0x2 + adds r3, 0x1 + movs r1, 0xA + ldrsh r0, [r7, r1] + cmp r3, r0 + blt _080BA28A + b _080BA324 + .align 2, 0 +_080BA2B0: .4byte 0x02022e22 +_080BA2B4: .4byte 0x02038c28 +_080BA2B8: .4byte 0x02039b28 +_080BA2BC: + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x10] + movs r2, 0xE + ldrsh r0, [r1, r2] + movs r3, 0xA0 + lsls r3, 1 + adds r2, r0, r3 + movs r4, 0x8 + ldrsh r3, [r1, r4] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r3, r0 + bge _080BA304 + ldr r5, _080BA334 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 + ldr r0, _080BA338 + mov r8, r0 +_080BA2E2: + lsls r2, r3, 1 + mov r0, r8 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r5 + ldrh r0, [r4] + adds r0, r6 + strh r0, [r2] + adds r4, 0x2 + adds r3, 0x1 + movs r1, 0xA + ldrsh r0, [r7, r1] + cmp r3, r0 + blt _080BA2E2 +_080BA304: + mov r0, r9 + add r0, r12 + lsls r0, 3 + mov r3, r10 + adds r2, r0, r3 + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xC + ldrsh r1, [r2, r4] + cmp r0, r1 + bne _080BA324 + movs r0, 0 + strh r0, [r2, 0xE] +_080BA324: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BA334: .4byte 0x02038c28 +_080BA338: .4byte 0x02039b28 + thumb_func_end task00_for_dp12 + + thumb_func_start sub_80BA33C +sub_80BA33C: @ 80BA33C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0 + movs r2, 0 + ldr r0, _080BA380 + mov r12, r0 +_080BA350: + lsls r0, r1, 1 + adds r3, r0, r6 + lsls r0, r2, 1 + add r0, r12 + movs r7, 0 + ldrsh r0, [r0, r7] + muls r0, r4 + cmp r0, 0 + bge _080BA364 + adds r0, 0xFF +_080BA364: + asrs r0, 8 + strh r0, [r3] + adds r0, r2, r5 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xFF + bls _080BA350 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BA380: .4byte 0x08329f40 + thumb_func_end sub_80BA33C + + thumb_func_start sub_80BA384 +sub_80BA384: @ 80BA384 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r5, r0, 0 + str r1, [sp, 0x10] + ldr r0, [sp, 0x40] + mov r8, r0 + ldr r1, [sp, 0x44] + mov r9, r1 + ldr r0, [sp, 0x48] + mov r10, r0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, [sp, 0x10] + lsls r1, 24 + str r1, [sp, 0x14] + lsrs r0, r1, 24 + str r0, [sp, 0xC] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, r3, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl dp12_8087EA4 + ldr r0, _080BA490 + add r0, r9 + str r0, [sp] + ldr r0, _080BA494 + str r0, [sp, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + movs r1, 0 + strb r1, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, _080BA498 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BA49C + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + strh r5, [r4, 0x8] + mov r3, sp + ldrh r3, [r3, 0xC] + strh r3, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + ldr r1, [sp, 0x18] + bl __divsi3 + strh r0, [r4, 0xC] + movs r0, 0 + strh r0, [r4, 0xE] + mov r1, r8 + strh r1, [r4, 0x10] + strh r1, [r4, 0x12] + mov r3, r9 + strh r3, [r4, 0x14] + mov r0, r10 + strh r0, [r4, 0x16] + ldr r0, _080BA4A0 + strb r7, [r0, 0x18] + ldr r0, _080BA4A4 + movs r1, 0 + strb r1, [r0] + ldr r4, _080BA4A8 + ldr r3, [sp, 0xC] + subs r6, r3, r5 + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r4, 0 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + bl sub_80BA33C + ldr r0, [sp, 0xC] + cmp r5, r0 + bge _080BA47E + ldr r1, _080BA4AC + adds r2, r4, r1 + lsls r1, r5, 1 + movs r3, 0xF0 + lsls r3, 3 + adds r0, r1, r3 + adds r3, r0, r2 + adds r1, r2 + adds r2, r4, 0 + adds r5, r6, 0 +_080BA46A: + ldrh r0, [r2] + strh r0, [r1] + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080BA46A +_080BA47E: + adds r0, r7, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080BA490: .4byte 0x04000010 +_080BA494: .4byte 0xa2600001 +_080BA498: .4byte task00_for_dp12 + 1 +_080BA49C: .4byte 0x03005e00 +_080BA4A0: .4byte 0x02039b28 +_080BA4A4: .4byte 0x02039b44 +_080BA4A8: .4byte 0x02038ea8 +_080BA4AC: .4byte 0xfffffd80 + thumb_func_end sub_80BA384 + + thumb_func_start sub_80BA4B0 +sub_80BA4B0: @ 80BA4B0 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80BA4B0 + + thumb_func_start sub_80BA4C8 +sub_80BA4C8: @ 80BA4C8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80BA4C8 + + thumb_func_start c2_options_menu +c2_options_menu: @ 80BA4DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r1, _080BA500 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xB + bhi _080BA538 + lsls r0, 2 + ldr r1, _080BA504 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BA500: .4byte 0x030022c0 +_080BA504: .4byte _080BA508 + .align 2, 0 +_080BA508: + .4byte _080BA538 + .4byte _080BA54C + .4byte _080BA69C + .4byte _080BA6BC + .4byte _080BA6E0 + .4byte _080BA718 + .4byte _080BA728 + .4byte _080BA740 + .4byte _080BA748 + .4byte _080BA760 + .4byte _080BA774 + .4byte _080BA80C +_080BA538: + movs r0, 0 + bl SetVBlankCallback + ldr r1, _080BA548 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .align 2, 0 +_080BA548: .4byte 0x030022c0 +_080BA54C: + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r1, sp, 0x8 + mov r8, r1 + add r2, sp, 0x4 + movs r6, 0 + ldr r1, _080BA68C + movs r5, 0x80 + lsls r5, 5 + ldr r7, _080BA690 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080BA56A: + strh r6, [r2] + add r0, sp, 0x4 + 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 _080BA56A + strh r6, [r2] + add r2, sp, 0x4 + 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, 0x8] + ldr r2, _080BA68C + 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 + add r0, sp, 0x4 + 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 lcd_io_set + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080BA694 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _080BA698 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x1 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x23 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xC1 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x4 + bl lcd_io_set + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + b _080BA7EC + .align 2, 0 +_080BA68C: .4byte 0x040000d4 +_080BA690: .4byte 0x81000800 +_080BA694: .4byte 0x0855c698 +_080BA698: .4byte 0x0855c680 +_080BA69C: + bl sub_80A1A74 + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + ldr r1, _080BA6B8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .align 2, 0 +_080BA6B8: .4byte 0x030022c0 +_080BA6BC: + ldr r0, _080BA6DC + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r3, 0xD1 + lsls r3, 1 + movs r0, 0x1 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _080BA7EC + .align 2, 0 +_080BA6DC: .4byte 0x03005d90 +_080BA6E0: + ldr r0, _080BA70C + movs r1, 0 + movs r2, 0x2 + bl gpu_pal_apply + ldr r0, _080BA710 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080BA714 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .align 2, 0 +_080BA70C: .4byte 0x0855c6a0 +_080BA710: .4byte 0x03005d90 +_080BA714: .4byte 0x030022c0 +_080BA718: + ldr r0, _080BA724 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + b _080BA7EC + .align 2, 0 +_080BA724: .4byte 0x0855c604 +_080BA728: + movs r0, 0 + bl Window_WriteStandardTileMap + bl sub_80BB0D0 + ldr r1, _080BA73C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .align 2, 0 +_080BA73C: .4byte 0x030022c0 +_080BA740: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _080BA7F4 +_080BA748: + movs r0, 0x1 + bl Window_WriteStandardTileMap + bl sub_80BB104 + ldr r1, _080BA770 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080BA760: + bl sub_80BB154 + ldr r1, _080BA770 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .align 2, 0 +_080BA770: .4byte 0x030022c0 +_080BA774: + ldr r0, _080BA7FC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080BA800 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _080BA804 + ldr r2, [r0] + ldrb r0, [r2, 0x14] + lsls r0, 29 + lsrs r0, 29 + strh r0, [r4, 0xA] + ldrb r1, [r2, 0x15] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r4, 0xC] + ldrb r1, [r2, 0x15] + lsls r1, 30 + lsrs r1, 31 + strh r1, [r4, 0xE] + ldrb r1, [r2, 0x15] + lsls r1, 31 + lsrs r1, 31 + strh r1, [r4, 0x10] + ldrb r1, [r2, 0x13] + strh r1, [r4, 0x12] + ldrb r1, [r2, 0x14] + lsrs r1, 3 + strh r1, [r4, 0x14] + bl sub_80BAC38 + ldrb r0, [r4, 0xC] + bl sub_80BAD08 + ldrb r0, [r4, 0xE] + bl sub_80BAD84 + ldrb r0, [r4, 0x10] + bl sub_80BAE08 + ldrb r0, [r4, 0x12] + bl sub_80BB028 + ldrb r0, [r4, 0x14] + bl sub_80BAF0C + ldrb r0, [r4, 0x8] + bl sub_80BAB38 + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram +_080BA7EC: + ldr r1, _080BA808 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080BA7F4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BA828 + .align 2, 0 +_080BA7FC: .4byte sub_80BA83C + 1 +_080BA800: .4byte 0x03005e00 +_080BA804: .4byte 0x03005d90 +_080BA808: .4byte 0x030022c0 +_080BA80C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080BA834 + bl SetVBlankCallback + ldr r0, _080BA838 + bl set_callback2 +_080BA828: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BA834: .4byte sub_80BA4C8 + 1 +_080BA838: .4byte sub_80BA4B0 + 1 + thumb_func_end c2_options_menu + + thumb_func_start sub_80BA83C +sub_80BA83C: @ 80BA83C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BA860 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BA85C + ldr r0, _080BA864 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BA868 + str r0, [r1] +_080BA85C: + pop {r0} + bx r0 + .align 2, 0 +_080BA860: .4byte 0x02037fd4 +_080BA864: .4byte 0x03005e00 +_080BA868: .4byte sub_80BA86C + 1 + thumb_func_end sub_80BA83C + + thumb_func_start sub_80BA86C +sub_80BA86C: @ 80BA86C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BA894 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080BA89C + ldr r0, _080BA898 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x6 + beq _080BA892 + b _080BAA5A +_080BA892: + b _080BA8AE + .align 2, 0 +_080BA894: .4byte 0x030022c0 +_080BA898: .4byte 0x03005e00 +_080BA89C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080BA8BC + ldr r0, _080BA8B4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 +_080BA8AE: + ldr r0, _080BA8B8 + str r0, [r1] + b _080BAA5A + .align 2, 0 +_080BA8B4: .4byte 0x03005e00 +_080BA8B8: .4byte sub_80BAA64 + 1 +_080BA8BC: + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _080BA8EC + ldr r1, _080BA8E4 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r5, [r3, 0x8] + movs r6, 0x8 + ldrsh r0, [r3, r6] + adds r7, r1, 0 + cmp r0, 0 + ble _080BA8E8 + subs r0, r5, 0x1 + b _080BA90C + .align 2, 0 +_080BA8E4: .4byte 0x03005e00 +_080BA8E8: + movs r0, 0x6 + b _080BA90C +_080BA8EC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BA924 + ldr r1, _080BA910 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r5, [r3, 0x8] + movs r7, 0x8 + ldrsh r0, [r3, r7] + adds r7, r1, 0 + cmp r0, 0x5 + bgt _080BA914 + adds r0, r5, 0x1 +_080BA90C: + strh r0, [r3, 0x8] + b _080BA916 + .align 2, 0 +_080BA910: .4byte 0x03005e00 +_080BA914: + strh r6, [r3, 0x8] +_080BA916: + adds r0, r2, r4 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0, 0x8] + bl sub_80BAB38 + b _080BAA5A +_080BA924: + ldr r0, _080BA944 + lsls r2, r4, 2 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + adds r7, r0, 0 + cmp r1, 0x5 + bls _080BA93A + b _080BAA5A +_080BA93A: + lsls r0, r1, 2 + ldr r1, _080BA948 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BA944: .4byte 0x03005e00 +_080BA948: .4byte _080BA94C + .align 2, 0 +_080BA94C: + .4byte _080BA964 + .4byte _080BA98A + .4byte _080BA9B0 + .4byte _080BA9D6 + .4byte _080BA9FC + .4byte _080BAA22 +_080BA964: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0xA] + adds r0, r5, 0 + bl sub_80BABDC + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0xA] + movs r6, 0xA + ldrsh r0, [r4, r6] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAC38 + b _080BAA46 +_080BA98A: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0xC] + adds r0, r5, 0 + bl sub_80BACE0 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0xC] + movs r7, 0xC + ldrsh r0, [r4, r7] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAD08 + b _080BAA46 +_080BA9B0: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0xE] + adds r0, r5, 0 + bl sub_80BAD5C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAD84 + b _080BAA46 +_080BA9D6: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0x10] + adds r0, r5, 0 + bl sub_80BADD8 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0x10] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAE08 + b _080BAA46 +_080BA9FC: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0x12] + adds r0, r5, 0 + bl sub_80BAFCC + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0x12] + movs r6, 0x12 + ldrsh r0, [r4, r6] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BB028 + b _080BAA46 +_080BAA22: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0x14] + adds r0, r5, 0 + bl sub_80BAE5C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0x14] + movs r7, 0x14 + ldrsh r0, [r4, r7] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAF0C +_080BAA46: + ldr r1, _080BAA60 + ldrb r0, [r1] + cmp r0, 0 + beq _080BAA5A + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram +_080BAA5A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BAA60: .4byte 0x02039b48 + thumb_func_end sub_80BA86C + + thumb_func_start sub_80BAA64 +sub_80BAA64: @ 80BAA64 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080BAAFC + ldr r3, [r6] + ldr r1, _080BAB00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0x7 + ldrb r1, [r4, 0xA] + ands r1, r0 + ldrb r2, [r3, 0x14] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x14] + ldr r3, [r6] + movs r5, 0x1 + ldrb r1, [r4, 0xC] + ands r1, r5 + lsls r1, 2 + ldrb r2, [r3, 0x15] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r3, [r6] + ldrb r1, [r4, 0xE] + ands r1, r5 + lsls r1, 1 + ldrb r2, [r3, 0x15] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r3, [r6] + ldrb r1, [r4, 0x10] + ands r1, r5 + ldrb r2, [r3, 0x15] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r1, [r6] + ldrh r0, [r4, 0x12] + movs r5, 0 + strb r0, [r1, 0x13] + ldr r3, [r6] + ldrb r1, [r4, 0x14] + lsls r1, 3 + ldrb r2, [r3, 0x14] + movs r0, 0x7 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x14] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BAB04 + str r0, [r4] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BAAFC: .4byte 0x03005d90 +_080BAB00: .4byte 0x03005e00 +_080BAB04: .4byte sub_80BAB08 + 1 + thumb_func_end sub_80BAA64 + + thumb_func_start sub_80BAB08 +sub_80BAB08: @ 80BAB08 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BAB30 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BAB2C + adds r0, r2, 0 + bl remove_task + bl Window_FreeMemory + ldr r0, _080BAB34 + ldr r0, [r0, 0x8] + bl set_callback2 +_080BAB2C: + pop {r0} + bx r0 + .align 2, 0 +_080BAB30: .4byte 0x02037fd4 +_080BAB34: .4byte 0x030022c0 + thumb_func_end sub_80BAB08 + + thumb_func_start sub_80BAB38 +sub_80BAB38: @ 80BAB38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x87 + lsls r1, 5 + movs r0, 0x40 + bl lcd_io_set + lsls r4, 4 + adds r1, r4, 0 + adds r1, 0x28 + lsls r1, 8 + adds r4, 0x38 + orrs r1, r4 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80BAB38 + + thumb_func_start sub_80BAB68 +sub_80BAB68: @ 80BAB68 + push {r4-r6,lr} + sub sp, 0x1C + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r2, 0 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _080BABA0 +_080BAB84: + mov r0, sp + adds r0, r2 + adds r0, 0xC + strb r1, [r0] + adds r4, 0x1 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _080BABA0 + cmp r2, 0xE + bls _080BAB84 +_080BABA0: + cmp r3, 0 + beq _080BABAE + add r1, sp, 0xC + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x5] +_080BABAE: + mov r1, sp + adds r1, r2 + adds r1, 0xC + movs r0, 0xFF + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + add r2, sp, 0xC + adds r3, r6, 0 + bl Print + add sp, 0x1C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80BAB68 + + thumb_func_start sub_80BABDC +sub_80BABDC: @ 80BABDC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _080BABFC + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BAC08 + cmp r3, 0x1 + bhi _080BAC00 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BAC02 + .align 2, 0 +_080BABFC: .4byte 0x030022c0 +_080BAC00: + movs r3, 0 +_080BAC02: + ldr r1, _080BAC20 + movs r0, 0x1 + strb r0, [r1] +_080BAC08: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BAC2C + cmp r3, 0 + beq _080BAC24 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BAC26 + .align 2, 0 +_080BAC20: .4byte 0x02039b48 +_080BAC24: + movs r3, 0x2 +_080BAC26: + ldr r1, _080BAC34 + movs r0, 0x1 + strb r0, [r1] +_080BAC2C: + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_080BAC34: .4byte 0x02039b48 + thumb_func_end sub_80BABDC + + thumb_func_start sub_80BAC38 +sub_80BAC38: @ 80BAC38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, _080BACD4 + mov r0, sp + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x68 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl font_get_width_of_string + adds r4, r0, 0 + ldr r0, _080BACD8 + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl font_get_width_of_string + adds r5, r0, 0 + ldr r6, _080BACDC + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0 + bl font_get_width_of_string + subs r5, 0x5E + subs r4, r5 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r4, 0x68 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0xC6 + bl sub_81DB368 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x2] + adds r0, r6, 0 + movs r2, 0 + bl sub_80BAB68 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BACD4: .4byte 0x085ee5d4 +_080BACD8: .4byte 0x085ee5df +_080BACDC: .4byte 0x085ee5e9 + thumb_func_end sub_80BAC38 + + thumb_func_start sub_80BACE0 +sub_80BACE0: @ 80BACE0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BAD00 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080BACFA + movs r1, 0x1 + eors r2, r1 + ldr r0, _080BAD04 + strb r1, [r0] +_080BACFA: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_080BAD00: .4byte 0x030022c0 +_080BAD04: .4byte 0x02039b48 + thumb_func_end sub_80BACE0 + + thumb_func_start sub_80BAD08 +sub_80BAD08: @ 80BAD08 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080BAD54 + mov r1, sp + ldrb r3, [r1] + movs r1, 0x68 + movs r2, 0x10 + bl sub_80BAB68 + ldr r4, _080BAD58 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC6 + bl sub_81DB368 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r4, 0 + movs r2, 0x10 + bl sub_80BAB68 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BAD54: .4byte 0x085ee5f4 +_080BAD58: .4byte 0x085ee5fd + thumb_func_end sub_80BAD08 + + thumb_func_start sub_80BAD5C +sub_80BAD5C: @ 80BAD5C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BAD7C + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080BAD76 + movs r1, 0x1 + eors r2, r1 + ldr r0, _080BAD80 + strb r1, [r0] +_080BAD76: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_080BAD7C: .4byte 0x030022c0 +_080BAD80: .4byte 0x02039b48 + thumb_func_end sub_80BAD5C + + thumb_func_start sub_80BAD84 +sub_80BAD84: @ 80BAD84 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080BADD0 + mov r1, sp + ldrb r3, [r1] + movs r1, 0x68 + movs r2, 0x20 + bl sub_80BAB68 + ldr r4, _080BADD4 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC6 + bl sub_81DB368 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r4, 0 + movs r2, 0x20 + bl sub_80BAB68 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BADD0: .4byte 0x085ee607 +_080BADD4: .4byte 0x085ee613 + thumb_func_end sub_80BAD84 + + thumb_func_start sub_80BADD8 +sub_80BADD8: @ 80BADD8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080BAE00 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080BADF8 + movs r4, 0x1 + eors r5, r4 + adds r0, r5, 0 + bl sub_82E1810 + ldr r0, _080BAE04 + strb r4, [r0] +_080BADF8: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080BAE00: .4byte 0x030022c0 +_080BAE04: .4byte 0x02039b48 + thumb_func_end sub_80BADD8 + + thumb_func_start sub_80BAE08 +sub_80BAE08: @ 80BAE08 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080BAE54 + mov r1, sp + ldrb r3, [r1] + movs r1, 0x68 + movs r2, 0x30 + bl sub_80BAB68 + ldr r4, _080BAE58 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC6 + bl sub_81DB368 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r4, 0 + movs r2, 0x30 + bl sub_80BAB68 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BAE54: .4byte 0x085ee61d +_080BAE58: .4byte 0x085ee628 + thumb_func_end sub_80BAE08 + + thumb_func_start sub_80BAE5C +sub_80BAE5C: @ 80BAE5C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BAE7C + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BAEAE + cmp r4, 0x12 + bhi _080BAE80 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + b _080BAE82 + .align 2, 0 +_080BAE7C: .4byte 0x030022c0 +_080BAE80: + movs r4, 0 +_080BAE82: + adds r0, r4, 0 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r3, 0xD1 + lsls r3, 1 + movs r0, 0x1 + bl gpu_copy_bg_tile_pattern_data_to_vram + adds r0, r4, 0 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080BAEC8 + movs r0, 0x1 + strb r0, [r1] +_080BAEAE: + ldr r0, _080BAECC + ldrh r1, [r0, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BAEFE + cmp r4, 0 + beq _080BAED0 + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + b _080BAED2 + .align 2, 0 +_080BAEC8: .4byte 0x02039b48 +_080BAECC: .4byte 0x030022c0 +_080BAED0: + movs r4, 0x13 +_080BAED2: + adds r0, r4, 0 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r3, 0xD1 + lsls r3, 1 + movs r0, 0x1 + bl gpu_copy_bg_tile_pattern_data_to_vram + adds r0, r4, 0 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080BAF08 + movs r0, 0x1 + strb r0, [r1] +_080BAEFE: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080BAF08: .4byte 0x02039b48 + thumb_func_end sub_80BAE5C + + thumb_func_start sub_80BAF0C +sub_80BAF0C: @ 80BAF0C + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, _080BAF78 + ldrb r0, [r1] + ldr r7, _080BAF7C + cmp r0, 0xFF + beq _080BAF44 + adds r2, r1, 0 +_080BAF28: + mov r0, sp + adds r1, r0, r5 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080BAF44 + cmp r5, 0x5 + bls _080BAF28 +_080BAF44: + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + adds r2, r0, 0 + lsls r0, r2, 24 + cmp r0, 0 + beq _080BAF80 + mov r0, sp + adds r1, r0, r5 + adds r0, r2, 0 + adds r0, 0xA1 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r1, sp + adds r4, r1, r5 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] + b _080BAF9E + .align 2, 0 +_080BAF78: .4byte 0x085ee640 +_080BAF7C: .4byte 0x085ee635 +_080BAF80: + mov r0, sp + adds r4, r0, r5 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, sp + adds r1, r0, r5 + movs r0, 0x77 + strb r0, [r1] +_080BAF9E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, sp + adds r1, r0, r5 + movs r0, 0xFF + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x68 + movs r2, 0x50 + movs r3, 0 + bl sub_80BAB68 + mov r0, sp + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0x1 + bl sub_80BAB68 + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80BAF0C + + thumb_func_start sub_80BAFCC +sub_80BAFCC: @ 80BAFCC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _080BAFEC + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BAFF8 + cmp r3, 0x1 + bhi _080BAFF0 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BAFF2 + .align 2, 0 +_080BAFEC: .4byte 0x030022c0 +_080BAFF0: + movs r3, 0 +_080BAFF2: + ldr r1, _080BB010 + movs r0, 0x1 + strb r0, [r1] +_080BAFF8: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BB01C + cmp r3, 0 + beq _080BB014 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BB016 + .align 2, 0 +_080BB010: .4byte 0x02039b48 +_080BB014: + movs r3, 0x2 +_080BB016: + ldr r1, _080BB024 + movs r0, 0x1 + strb r0, [r1] +_080BB01C: + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_080BB024: .4byte 0x02039b48 + thumb_func_end sub_80BAFCC + + thumb_func_start sub_80BB028 +sub_80BB028: @ 80BB028 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, _080BB0C4 + mov r0, sp + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x68 + movs r2, 0x40 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl font_get_width_of_string + adds r4, r0, 0 + ldr r0, _080BB0C8 + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl font_get_width_of_string + adds r5, r0, 0 + ldr r6, _080BB0CC + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0 + bl font_get_width_of_string + subs r5, 0x5E + subs r4, r5 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r4, 0x68 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0x40 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0xC6 + bl sub_81DB368 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x2] + adds r0, r6, 0 + movs r2, 0x40 + bl sub_80BAB68 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BB0C4: .4byte 0x085ee647 +_080BB0C8: .4byte 0x085ee654 +_080BB0CC: .4byte 0x085ee65d + thumb_func_end sub_80BB028 + + thumb_func_start sub_80BB0D0 +sub_80BB0D0: @ 80BB0D0 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _080BB100 + 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, 0x8 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_080BB100: .4byte 0x085ee589 + thumb_func_end sub_80BB0D0 + + thumb_func_start sub_80BB104 +sub_80BB104: @ 80BB104 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x1 + movs r1, 0x11 + bl Window_FastFillPixels + movs r4, 0 + ldr r5, _080BB150 +_080BB114: + lsls r0, r4, 2 + adds r0, r5 + ldr r2, [r0] + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x8 + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080BB114 + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BB150: .4byte 0x0855c664 + thumb_func_end sub_80BB104 + + thumb_func_start sub_80BB154 +sub_80BB154: @ 80BB154 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0x7 + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD1 + lsls r1, 1 + movs r2, 0x1 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1B + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, _080BB2C0 + movs r2, 0x2 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD2 + lsls r1, 1 + movs r2, 0x1C + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + movs r6, 0x2 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, _080BB2C4 + movs r2, 0x1 + movs r3, 0x1 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, _080BB2C8 + movs r2, 0x1C + movs r3, 0x1 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r7, 0xD4 + lsls r7, 1 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x3 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _080BB2CC + mov r10, r0 + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r10 + movs r2, 0x2 + movs r3, 0x3 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0xD5 + lsls r0, 1 + mov r9, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r9 + movs r2, 0x1C + movs r3, 0x3 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD1 + lsls r1, 1 + movs r2, 0x1 + movs r3, 0x4 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1A + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, _080BB2C0 + movs r2, 0x2 + movs r3, 0x4 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD2 + lsls r1, 1 + movs r2, 0x1C + movs r3, 0x4 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + movs r6, 0x12 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, _080BB2C4 + movs r2, 0x1 + movs r3, 0x5 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, _080BB2C8 + movs r2, 0x1C + movs r3, 0x5 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r10 + movs r2, 0x2 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r9 + movs r2, 0x1C + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BB2C0: .4byte 0x000001a3 +_080BB2C4: .4byte 0x000001a5 +_080BB2C8: .4byte 0x000001a7 +_080BB2CC: .4byte 0x000001a9 + thumb_func_end sub_80BB154 + + thumb_func_start sub_80BB2D0 +sub_80BB2D0: @ 80BB2D0 + push {r4-r6,lr} + ldr r0, _080BB33C + movs r2, 0 + strh r2, [r0] + ldr r1, _080BB340 + movs r0, 0x40 + strb r0, [r1] + ldr r0, _080BB344 + strb r2, [r0] + ldr r4, _080BB348 + ldr r0, [r4] + movs r1, 0 + strb r2, [r0, 0x19] + ldr r0, [r4] + strb r2, [r0, 0x18] + ldr r0, [r4] + strb r2, [r0, 0x1A] + ldr r0, [r4] + strb r2, [r0, 0x1B] + ldr r0, [r4] + str r1, [r0, 0x1C] + str r1, [r0, 0x20] + str r1, [r0, 0x24] + bl sub_809D3C0 + movs r1, 0 + movs r2, 0 + ldr r3, _080BB34C + ldr r6, _080BB350 + ldr r5, _080BB354 +_080BB30C: + ldr r0, [r4] + adds r0, 0x28 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x5C + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r0, r6 + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r0, r5 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x33 + bls _080BB30C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BB33C: .4byte 0x02039b50 +_080BB340: .4byte 0x02039b52 +_080BB344: .4byte 0x030060b0 +_080BB348: .4byte 0x03005d90 +_080BB34C: .4byte 0x03005d8c +_080BB350: .4byte 0x00000988 +_080BB354: .4byte 0x00003b24 + thumb_func_end sub_80BB2D0 + + thumb_func_start sub_80BB358 +sub_80BB358: @ 80BB358 + ldr r1, _080BB368 + movs r0, 0 + strh r0, [r1] + ldr r1, _080BB36C + movs r0, 0x40 + strb r0, [r1] + bx lr + .align 2, 0 +_080BB368: .4byte 0x02039b50 +_080BB36C: .4byte 0x02039b52 + thumb_func_end sub_80BB358 + + thumb_func_start sub_80BB370 +sub_80BB370: @ 80BB370 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80BB370 + + thumb_func_start sub_80BB384 +sub_80BB384: @ 80BB384 + push {r4-r7,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r0, _080BB4F8 + adds r7, r0, 0 + movs r1, 0x2 + negs r1, r1 + mov r12, r1 + movs r6, 0x3 + negs r6, r6 + ldr r5, _080BB4FC +_080BB39A: + lsls r1, r3, 2 + adds r1, r4, r1 + ldrh r0, [r1] + orrs r0, r7 + strh r0, [r1] + ldrb r2, [r1, 0x2] + mov r0, r12 + ands r0, r2 + ands r0, r6 + strb r0, [r1, 0x2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r5 + bls _080BB39A + movs r2, 0xC1 + lsls r2, 3 + adds r0, r4, r2 + movs r2, 0 + strh r2, [r0] + ldr r0, _080BB500 + adds r3, r4, r0 + ldrb r1, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldr r1, _080BB504 + adds r0, r4, r1 + strh r2, [r0] + ldr r3, _080BB508 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + movs r3, 0 + ldr r0, _080BB50C + adds r2, r4, r0 + ldr r1, _080BB4F8 + adds r5, r1, 0 +_080BB416: + lsls r0, r3, 1 + adds r0, r2, r0 + ldrh r1, [r0] + orrs r1, r5 + strh r1, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BB416 + movs r2, 0xC5 + lsls r2, 3 + adds r0, r4, r2 + movs r2, 0 + movs r1, 0 + strh r1, [r0] + ldr r3, _080BB510 + adds r0, r4, r3 + strh r1, [r0] + adds r3, 0x2 + adds r0, r4, r3 + strb r2, [r0] + adds r3, 0x1 + adds r0, r4, r3 + strb r2, [r0] + adds r3, 0x1 + adds r0, r4, r3 + strb r2, [r0] + adds r3, 0x1 + adds r0, r4, r3 + strb r2, [r0] + movs r2, 0xC6 + lsls r2, 3 + adds r0, r4, r2 + strh r1, [r0] + adds r3, 0x3 + adds r0, r4, r3 + strh r1, [r0] + adds r2, 0x4 + adds r0, r4, r2 + strh r1, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r1, [r0] + adds r2, 0x4 + adds r0, r4, r2 + strh r1, [r0] + movs r3, 0 + ldr r0, _080BB514 + adds r1, r4, r0 + movs r2, 0 +_080BB47C: + lsls r0, r3, 1 + adds r0, r1, r0 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BB47C + ldr r1, _080BB518 + adds r0, r4, r1 + movs r1, 0 + strb r1, [r0] + ldr r2, _080BB51C + adds r0, r4, r2 + strb r1, [r0] + ldr r0, _080BB520 + adds r3, r4, r0 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldr r2, _080BB524 + adds r0, r4, r2 + strb r1, [r0] + ldr r3, _080BB528 + adds r0, r4, r3 + strb r1, [r0] + adds r2, 0x2 + adds r0, r4, r2 + strb r1, [r0] + adds r3, 0x2 + adds r0, r4, r3 + strh r1, [r0] + adds r2, 0x3 + adds r0, r4, r2 + strh r1, [r0] + movs r3, 0 + ldr r0, _080BB52C + adds r1, r4, r0 + movs r2, 0 +_080BB4CE: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _080BB4CE + movs r3, 0 + ldr r2, _080BB530 + adds r1, r4, r2 + movs r2, 0 +_080BB4E4: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _080BB4E4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BB4F8: .4byte 0x0000ffff +_080BB4FC: .4byte 0x00000181 +_080BB500: .4byte 0x0000060a +_080BB504: .4byte 0x0000060c +_080BB508: .4byte 0x0000060e +_080BB50C: .4byte 0x0000061e +_080BB510: .4byte 0x0000062a +_080BB514: .4byte 0x0000063a +_080BB518: .4byte 0x0000064a +_080BB51C: .4byte 0x0000064b +_080BB520: .4byte 0x0000064c +_080BB524: .4byte 0x0000064d +_080BB528: .4byte 0x0000064e +_080BB52C: .4byte 0x00000654 +_080BB530: .4byte 0x0000065c + thumb_func_end sub_80BB384 + + thumb_func_start sub_80BB534 +sub_80BB534: @ 80BB534 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r0, _080BB5F0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0x1 + beq _080BB5FC + cmp r0, 0x1 + ble _080BB558 + cmp r0, 0x2 + beq _080BB628 + cmp r0, 0x3 + bne _080BB558 + b _080BB71C +_080BB558: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl sub_80C09B0 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r2, sp, 0x4 + mov r8, r2 + mov r2, sp + movs r6, 0 + ldr r1, _080BB5F4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _080BB5F8 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080BB582: + 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 _080BB582 + strh r6, [r2] + mov r2, sp + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r3, r12 + orrs r0, r3 + 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, _080BB5F4 + 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] + ldr r0, _080BB5F0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080BB74C + .align 2, 0 +_080BB5F0: .4byte 0x030022c0 +_080BB5F4: .4byte 0x040000d4 +_080BB5F8: .4byte 0x81000800 +_080BB5FC: + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl sub_80A1A74 + bl gpu_pal_allocator_reset + ldr r1, _080BB624 + movs r0, 0x8 + strb r0, [r1] + bl dp13_810BB8C + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080BB74C + .align 2, 0 +_080BB624: .4byte 0x0300301c +_080BB628: + ldr r4, _080BB6A8 + ldr r0, _080BB6AC + bl malloc_and_clear + str r0, [r4] + bl sub_80BB384 + ldr r0, _080BB6B0 + movs r1, 0 + bl AddTask + ldr r1, [r4] + ldr r5, _080BB6B4 + ldr r0, [r5] + ldrb r0, [r0, 0x19] + ldr r3, _080BB6B8 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BB65E + ldr r0, [r4] + ldr r2, _080BB6B8 + adds r0, r2 + strh r1, [r0] +_080BB65E: + ldr r1, [r4] + ldr r0, [r5] + ldrb r2, [r0, 0x18] + ldr r3, _080BB6BC + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _080BB6C0 + ldrh r2, [r0] + subs r3, 0x8 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _080BB6C4 + ldrb r0, [r0] + ldr r2, _080BB6C8 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r3, 0x3F + adds r0, r3 + movs r1, 0 + strb r1, [r0] + bl sub_809D42C + cmp r0, 0 + bne _080BB6D0 + movs r0, 0 + bl sub_80C0844 + ldr r1, [r4] + ldr r2, _080BB6CC + adds r1, r2 + strh r0, [r1] + movs r0, 0x1 + bl sub_80C0844 + b _080BB6E4 + .align 2, 0 +_080BB6A8: .4byte 0x02039b4c +_080BB6AC: .4byte 0x00000664 +_080BB6B0: .4byte sub_80BB78C + 1 +_080BB6B4: .4byte 0x03005d90 +_080BB6B8: .4byte 0x00000612 +_080BB6BC: .4byte 0x00000616 +_080BB6C0: .4byte 0x02039b50 +_080BB6C4: .4byte 0x02039b52 +_080BB6C8: .4byte 0x0000062c +_080BB6CC: .4byte 0x0000061a +_080BB6D0: + movs r0, 0 + bl pokedex_count + ldr r1, [r4] + ldr r2, _080BB708 + adds r1, r2 + strh r0, [r1] + movs r0, 0x1 + bl pokedex_count +_080BB6E4: + ldr r1, [r4] + ldr r3, _080BB70C + adds r1, r3 + strh r0, [r1] + ldr r0, _080BB710 + ldr r0, [r0] + ldr r1, _080BB714 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + ldr r1, _080BB718 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BB74C + .align 2, 0 +_080BB708: .4byte 0x0000061a +_080BB70C: .4byte 0x0000061c +_080BB710: .4byte 0x02039b4c +_080BB714: .4byte 0x0000062d +_080BB718: .4byte 0x030022c0 +_080BB71C: + movs r0, 0x1 + bl enable_irqs + ldr r0, _080BB758 + bl SetVBlankCallback + ldr r0, _080BB75C + bl set_callback2 + ldr r0, _080BB760 + ldr r1, [r0] + ldr r3, _080BB764 + adds r0, r1, r3 + ldrb r0, [r0] + ldr r2, _080BB768 + adds r1, r2 + ldrb r1, [r1] + bl sub_80BC8D4 + ldr r0, _080BB76C + ldr r1, _080BB770 + movs r2, 0x80 + bl MPlayVolumeControl +_080BB74C: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BB758: .4byte sub_80BB370 + 1 +_080BB75C: .4byte sub_80BB774 + 1 +_080BB760: .4byte 0x02039b4c +_080BB764: .4byte 0x00000612 +_080BB768: .4byte 0x00000616 +_080BB76C: .4byte 0x03007420 +_080BB770: .4byte 0x0000ffff + thumb_func_end sub_80BB534 + + thumb_func_start sub_80BB774 +sub_80BB774: @ 80BB774 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80BB774 + + thumb_func_start sub_80BB78C +sub_80BB78C: @ 80BB78C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BB7C4 + ldr r1, [r0] + ldr r0, _080BB7C8 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0 + bl sub_80BC514 + lsls r0, 24 + cmp r0, 0 + beq _080BB7BE + ldr r0, _080BB7CC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BB7D0 + str r0, [r1] +_080BB7BE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BB7C4: .4byte 0x02039b4c +_080BB7C8: .4byte 0x0000064c +_080BB7CC: .4byte 0x03005e00 +_080BB7D0: .4byte sub_80BB7D4 + 1 + thumb_func_end sub_80BB78C + + thumb_func_start sub_80BB7D4 +sub_80BB7D4: @ 80BB7D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _080BB808 + ldr r0, [r7] + ldr r4, _080BB80C + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r3, [r7] + adds r1, r3, r4 + ldrh r0, [r1] + movs r4, 0 + ldrsh r2, [r1, r4] + mov r8, r2 + cmp r2, 0 + beq _080BB810 + subs r0, 0x8 + strh r0, [r1] + b _080BBA06 + .align 2, 0 +_080BB808: .4byte 0x02039b4c +_080BB80C: .4byte 0x00000652 +_080BB810: + ldr r2, _080BB888 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r9, r0 + ands r0, r1 + cmp r0, 0 + beq _080BB8A4 + ldr r1, _080BB88C + adds r0, r3, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3, r0 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BB8A4 + bl sub_80BD8D0 + ldr r4, _080BB890 + ldr r0, [r7] + ldr r5, _080BB894 + adds r0, r5 + ldrh 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 + mov r0, r9 + lsls r0, r1 + mvns r0, r0 + mov r2, r8 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, [r7] + adds r0, r5 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, _080BB898 + str r1, [r0] + ldr r1, _080BB89C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BB8A0 + str r1, [r0] + movs r0, 0x15 + b _080BB976 + .align 2, 0 +_080BB888: .4byte 0x030022c0 +_080BB88C: .4byte 0x0000060e +_080BB890: .4byte 0x02020630 +_080BB894: .4byte 0x00000626 +_080BB898: .4byte sub_80BE470 + 1 +_080BB89C: .4byte 0x03005e00 +_080BB8A0: .4byte sub_80BBBF4 + 1 +_080BB8A4: + ldrh r2, [r2, 0x2E] + movs r0, 0x8 + ands r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080BB8FC + ldr r3, _080BB8E8 + ldr r1, [r3] + ldr r4, _080BB8EC + adds r0, r1, r4 + movs r2, 0 + strh r2, [r0] + ldr r0, _080BB8F0 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + strh r2, [r0] + ldr r1, _080BB8F4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BB8F8 + str r1, [r0] + movs r0, 0x5 + bl audio_play + b _080BBA06 + .align 2, 0 +_080BB8E8: .4byte 0x02039b4c +_080BB8EC: .4byte 0x00000652 +_080BB8F0: .4byte 0x0000064f +_080BB8F4: .4byte 0x03005e00 +_080BB8F8: .4byte sub_80BBA78 + 1 +_080BB8FC: + movs r0, 0x4 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080BB9A0 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + bl sub_80C1258 + ldr r1, _080BB980 + lsls r3, r6, 2 + adds r3, r6 + lsls r3, 3 + adds r3, r1 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r3, 0x8] + ldr r1, _080BB984 + ldr r0, [r1] + ldr r4, _080BB988 + adds r0, r4 + strb r2, [r0] + ldr r0, [r1] + ldr r2, _080BB98C + adds r1, r0, r2 + ldrb r2, [r1] + subs r4, 0x24 + adds r1, r0, r4 + strh r2, [r1] + ldr r2, _080BB990 + adds r1, r0, r2 + ldrh r2, [r1] + subs r4, 0x1A + adds r1, r0, r4 + strh r2, [r1] + ldr r2, _080BB994 + adds r1, r0, r2 + ldrh r2, [r1] + adds r4, 0x4 + adds r1, r0, r4 + strh r2, [r1] + ldr r2, _080BB998 + adds r1, r0, r2 + ldrh r1, [r1] + adds r4, 0x4 + adds r0, r4 + strh r1, [r0] + ldr r0, _080BB99C + str r0, [r3] + movs r0, 0x2 +_080BB976: + bl audio_play + bl sub_80BC890 + b _080BBA06 + .align 2, 0 +_080BB980: .4byte 0x03005e00 +_080BB984: .4byte 0x02039b4c +_080BB988: .4byte 0x0000064e +_080BB98C: .4byte 0x0000062c +_080BB990: .4byte 0x0000060e +_080BB994: .4byte 0x00000612 +_080BB998: .4byte 0x00000616 +_080BB99C: .4byte sub_80BBD1C + 1 +_080BB9A0: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080BB9D8 + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080BB9D0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BB9D4 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BBA06 + .align 2, 0 +_080BB9D0: .4byte 0x03005e00 +_080BB9D4: .4byte sub_80BBDE8 + 1 +_080BB9D8: + ldr r5, _080BBA14 + ldr r0, [r5] + ldr r4, _080BBA18 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD69C + ldr r1, [r5] + adds r4, r1, r4 + strh r0, [r4] + ldr r0, _080BBA1C + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080BBA06 + ldr r0, _080BBA20 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BBA24 + str r0, [r1] +_080BBA06: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BBA14: .4byte 0x02039b4c +_080BBA18: .4byte 0x0000060e +_080BBA1C: .4byte 0x0000062e +_080BBA20: .4byte 0x03005e00 +_080BBA24: .4byte sub_80BBA28 + 1 + thumb_func_end sub_80BB7D4 + + thumb_func_start sub_80BBA28 +sub_80BBA28: @ 80BBA28 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BBA64 + ldr r2, [r0] + ldr r1, _080BBA68 + adds r0, r2, r1 + ldrb r0, [r0] + ldr r3, _080BBA6C + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x2 + adds r2, r3 + ldrb r2, [r2] + bl sub_80BD404 + lsls r0, 24 + cmp r0, 0 + beq _080BBA5C + ldr r0, _080BBA70 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BBA74 + str r0, [r1] +_080BBA5C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BBA64: .4byte 0x02039b4c +_080BBA68: .4byte 0x0000062f +_080BBA6C: .4byte 0x00000634 +_080BBA70: .4byte 0x03005e00 +_080BBA74: .4byte sub_80BB7D4 + 1 + thumb_func_end sub_80BBA28 + + thumb_func_start sub_80BBA78 +sub_80BBA78: @ 80BBA78 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, _080BBAA8 + ldr r0, [r6] + ldr r4, _080BBAAC + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r3, [r6] + adds r1, r3, r4 + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0x50 + beq _080BBAB0 + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r1] + b _080BBBE8 + .align 2, 0 +_080BBAA8: .4byte 0x02039b4c +_080BBAAC: .4byte 0x00000652 +_080BBAB0: + ldr r5, _080BBAD8 + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080BBB58 + movs r2, 0xCA + lsls r2, 3 + adds r0, r3, r2 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080BBADC + cmp r0, 0x1 + ble _080BBB20 + cmp r0, 0x2 + beq _080BBAF4 + cmp r0, 0x3 + beq _080BBB34 + b _080BBB20 + .align 2, 0 +_080BBAD8: .4byte 0x030022c0 +_080BBADC: + ldr r4, _080BBAEC + adds r1, r3, r4 + movs r0, 0 + strh r0, [r1] + ldr r0, _080BBAF0 + adds r1, r3, r0 + movs r0, 0x40 + b _080BBB0C + .align 2, 0 +_080BBAEC: .4byte 0x0000060e +_080BBAF0: .4byte 0x0000062c +_080BBAF4: + ldr r1, _080BBB28 + adds r2, r3, r1 + ldrh r0, [r2] + subs r0, 0x1 + ldr r4, _080BBB2C + adds r1, r3, r4 + strh r0, [r1] + ldrh r0, [r2] + lsls r0, 4 + adds r0, 0x30 + ldr r2, _080BBB30 + adds r1, r3, r2 +_080BBB0C: + strb r0, [r1] + bl sub_80BDA40 + ldr r0, [r6] + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD2B4 + ldrh r1, [r5, 0x2E] +_080BBB20: + movs r0, 0x8 + orrs r0, r1 + strh r0, [r5, 0x2E] + b _080BBB58 + .align 2, 0 +_080BBB28: .4byte 0x0000060c +_080BBB2C: .4byte 0x0000060e +_080BBB30: .4byte 0x0000062c +_080BBB34: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080BBB80 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BBB84 + str r1, [r0] + movs r0, 0x3 + bl audio_play +_080BBB58: + ldr r2, _080BBB88 + ldrh r1, [r2, 0x2E] + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + beq _080BBB98 + ldr r0, _080BBB8C + ldr r0, [r0] + ldr r3, _080BBB90 + adds r0, r3 + movs r1, 0 + strb r1, [r0] + ldr r1, _080BBB80 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BBB94 + str r1, [r0] + b _080BBBB6 + .align 2, 0 +_080BBB80: .4byte 0x03005e00 +_080BBB84: .4byte sub_80BBDE8 + 1 +_080BBB88: .4byte 0x030022c0 +_080BBB8C: .4byte 0x02039b4c +_080BBB90: .4byte 0x0000064f +_080BBB94: .4byte sub_80BB7D4 + 1 +_080BBB98: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BBBC4 + ldr r0, _080BBBC0 + ldr r0, [r0] + movs r4, 0xCA + lsls r4, 3 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _080BBBC4 + subs r0, 0x1 + strh r0, [r1] +_080BBBB6: + movs r0, 0x5 + bl audio_play + b _080BBBE8 + .align 2, 0 +_080BBBC0: .4byte 0x02039b4c +_080BBBC4: + ldrh r1, [r2, 0x30] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BBBE8 + ldr r0, _080BBBF0 + ldr r0, [r0] + movs r2, 0xCA + lsls r2, 3 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0x2 + bhi _080BBBE8 + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x5 + bl audio_play +_080BBBE8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BBBF0: .4byte 0x02039b4c + thumb_func_end sub_80BBA78 + + thumb_func_start sub_80BBBF4 +sub_80BBBF4: @ 80BBBF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _080BBC58 + ldr r5, _080BBC5C + ldr r3, [r5] + ldr r6, _080BBC60 + adds r0, r3, r6 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0x30 + bne _080BBC52 + movs r2, 0x22 + ldrsh r0, [r1, r2] + cmp r0, 0x38 + bne _080BBC52 + ldr r1, _080BBC64 + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, _080BBC68 + adds r0, r3, r2 + strb r1, [r0] + ldr r1, [r5] + subs r2, 0x3D + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1, r0 + adds r1, r6 + ldrb r1, [r1] + bl sub_80BE91C + ldr r2, _080BBC6C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r0, _080BBC70 + str r0, [r1] +_080BBC52: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BBC58: .4byte 0x02020630 +_080BBC5C: .4byte 0x02039b4c +_080BBC60: .4byte 0x00000626 +_080BBC64: .4byte 0x0000064a +_080BBC68: .4byte 0x0000064b +_080BBC6C: .4byte 0x03005e00 +_080BBC70: .4byte sub_80BBC74 + 1 + thumb_func_end sub_80BBBF4 + + thumb_func_start sub_80BBC74 +sub_80BBC74: @ 80BBC74 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080BBCD0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080BBCE0 + ldr r5, _080BBCD4 + ldr r0, [r5] + ldr r1, _080BBCD8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080BBCFC + ldrb r0, [r4, 0x8] + bl sub_80BE9C4 + lsls r0, 24 + cmp r0, 0 + bne _080BBCFC + bl sub_80BD930 + lsls r0, 24 + cmp r0, 0 + beq _080BBCFC + ldr r0, [r5] + ldr r2, _080BBCDC + adds r1, r0, r2 + ldrh r1, [r1] + lsls r1, 2 + adds r0, r1 + ldrb r1, [r4, 0x8] + bl sub_80BE9F8 + b _080BBCFC + .align 2, 0 +_080BBCD0: .4byte 0x03005e00 +_080BBCD4: .4byte 0x02039b4c +_080BBCD8: .4byte 0x0000064a +_080BBCDC: .4byte 0x0000060e +_080BBCE0: + ldr r2, _080BBD04 + ldr r0, _080BBD08 + ldr r1, [r0] + ldr r3, _080BBD0C + adds r0, r1, r3 + ldrh r0, [r0] + strh r0, [r2] + ldr r2, _080BBD10 + ldr r0, _080BBD14 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + ldr r0, _080BBD18 + str r0, [r4] +_080BBCFC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BBD04: .4byte 0x02039b50 +_080BBD08: .4byte 0x02039b4c +_080BBD0C: .4byte 0x0000060e +_080BBD10: .4byte 0x02039b52 +_080BBD14: .4byte 0x0000062c +_080BBD18: .4byte sub_80BB78C + 1 + thumb_func_end sub_80BBC74 + + thumb_func_start sub_80BBD1C +sub_80BBD1C: @ 80BBD1C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080BBD64 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x4] + cmp r4, 0 + bne _080BBDCA + bl sub_80BDA40 + ldr r5, _080BBD68 + ldr r2, [r5] + ldr r1, _080BBD6C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080BBD7C + ldr r3, _080BBD70 + adds r0, r2, r3 + strh r4, [r0] + ldr r0, _080BBD74 + adds r1, r2, r0 + movs r0, 0x40 + strb r0, [r1] + ldr r0, _080BBD78 + b _080BBDC8 + .align 2, 0 +_080BBD64: .4byte 0x03005e00 +_080BBD68: .4byte 0x02039b4c +_080BBD6C: .4byte 0x0000064e +_080BBD70: .4byte 0x0000060e +_080BBD74: .4byte 0x0000062c +_080BBD78: .4byte sub_80BBE70 + 1 +_080BBD7C: + ldr r1, _080BBDD0 + adds r0, r2, r1 + ldrh r1, [r0] + ldr r3, _080BBDD4 + adds r0, r2, r3 + strb r1, [r0] + ldr r1, [r5] + movs r2, 0xC2 + lsls r2, 3 + adds r0, r1, r2 + ldrh r2, [r0] + subs r3, 0x1E + adds r0, r1, r3 + strh r2, [r0] + ldr r2, _080BBDD8 + adds r0, r1, r2 + ldrh r0, [r0] + adds r3, 0x4 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BBDB6 + ldr r0, [r5] + ldr r2, _080BBDDC + adds r0, r2 + strh r1, [r0] +_080BBDB6: + ldr r0, [r5] + movs r3, 0xC3 + lsls r3, 3 + adds r1, r0, r3 + ldrh r1, [r1] + ldr r2, _080BBDE0 + adds r0, r2 + strh r1, [r0] + ldr r0, _080BBDE4 +_080BBDC8: + str r0, [r6] +_080BBDCA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BBDD0: .4byte 0x0000062a +_080BBDD4: .4byte 0x0000062c +_080BBDD8: .4byte 0x00000614 +_080BBDDC: .4byte 0x00000612 +_080BBDE0: .4byte 0x00000616 +_080BBDE4: .4byte sub_80BB78C + 1 + thumb_func_end sub_80BBD1C + + thumb_func_start sub_80BBDE8 +sub_80BBDE8: @ 80BBDE8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080BBE50 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BBE4A + ldr r4, _080BBE54 + ldr r0, [r4] + ldr r5, _080BBE58 + ldr r1, [r5] + ldr r2, _080BBE5C + adds r1, r2 + ldrh r1, [r1] + strb r1, [r0, 0x19] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BBE18 + ldr r0, [r4] + strb r1, [r0, 0x19] +_080BBE18: + ldr r1, [r4] + ldr r0, [r5] + ldr r2, _080BBE60 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x18] + bl sub_80BDA40 + bl sub_80BC890 + adds r0, r6, 0 + bl remove_task + ldr r0, _080BBE64 + bl set_callback2 + ldr r0, _080BBE68 + ldr r1, _080BBE6C + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, [r5] + bl free +_080BBE4A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BBE50: .4byte 0x02037fd4 +_080BBE54: .4byte 0x03005d90 +_080BBE58: .4byte 0x02039b4c +_080BBE5C: .4byte 0x00000612 +_080BBE60: .4byte 0x00000616 +_080BBE64: .4byte sub_8086194 + 1 +_080BBE68: .4byte 0x03007420 +_080BBE6C: .4byte 0x0000ffff + thumb_func_end sub_80BBDE8 + + thumb_func_start sub_80BBE70 +sub_80BBE70: @ 80BBE70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BBEA8 + ldr r1, [r0] + ldr r0, _080BBEAC + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + movs r0, 0x3 + bl sub_80BC514 + lsls r0, 24 + cmp r0, 0 + beq _080BBEA0 + ldr r0, _080BBEB0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BBEB4 + str r0, [r1] +_080BBEA0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BBEA8: .4byte 0x02039b4c +_080BBEAC: .4byte 0x0000064c +_080BBEB0: .4byte 0x03005e00 +_080BBEB4: .4byte sub_80BBEB8 + 1 + thumb_func_end sub_80BBE70 + + thumb_func_start sub_80BBEB8 +sub_80BBEB8: @ 80BBEB8 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _080BBEE4 + ldr r0, [r5] + ldr r4, _080BBEE8 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r3, [r5] + adds r1, r3, r4 + ldrh r0, [r1] + movs r2, 0 + ldrsh r4, [r1, r2] + cmp r4, 0 + beq _080BBEEC + subs r0, 0x8 + strh r0, [r1] + b _080BC08A + .align 2, 0 +_080BBEE4: .4byte 0x02039b4c +_080BBEE8: .4byte 0x00000652 +_080BBEEC: + ldr r2, _080BBF54 + ldrh r1, [r2, 0x2E] + movs r7, 0x1 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080BBF70 + ldr r1, _080BBF58 + adds r0, r3, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3, r0 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BBF70 + bl sub_80BD8D0 + ldr r3, _080BBF5C + ldr r0, [r5] + ldr r2, _080BBF60 + adds r0, r2 + ldrh r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r0, r2, r3 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + adds r0, r7, 0 + lsls r0, r1 + adds r3, 0x1C + adds r2, r3 + ldr r1, _080BBF64 + str r1, [r2] + mvns r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080BBF68 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BBF6C + str r1, [r0] + movs r0, 0x15 + b _080BC00A + .align 2, 0 +_080BBF54: .4byte 0x030022c0 +_080BBF58: .4byte 0x0000060e +_080BBF5C: .4byte 0x02020630 +_080BBF60: .4byte 0x00000626 +_080BBF64: .4byte sub_80BE470 + 1 +_080BBF68: .4byte 0x03005e00 +_080BBF6C: .4byte sub_80BC2D4 + 1 +_080BBF70: + ldrh r2, [r2, 0x2E] + movs r0, 0x8 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080BBFC8 + ldr r3, _080BBFB4 + ldr r1, [r3] + ldr r2, _080BBFB8 + adds r0, r1, r2 + movs r2, 0 + strh r2, [r0] + ldr r0, _080BBFBC + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + strh r2, [r0] + ldr r1, _080BBFC0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BBFC4 + str r1, [r0] + movs r0, 0x5 + bl audio_play + b _080BC08A + .align 2, 0 +_080BBFB4: .4byte 0x02039b4c +_080BBFB8: .4byte 0x00000652 +_080BBFBC: .4byte 0x0000064f +_080BBFC0: .4byte 0x03005e00 +_080BBFC4: .4byte sub_80BC0F8 + 1 +_080BBFC8: + movs r0, 0x4 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080BC024 + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + bl sub_80C1258 + ldr r2, _080BC014 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x8] + ldr r0, _080BC018 + ldr r0, [r0] + ldr r3, _080BC01C + adds r0, r3 + strb r2, [r0] + ldr r0, _080BC020 + str r0, [r1] + movs r0, 0x2 +_080BC00A: + bl audio_play + bl sub_80BC890 + b _080BC08A + .align 2, 0 +_080BC014: .4byte 0x03005e00 +_080BC018: .4byte 0x02039b4c +_080BC01C: .4byte 0x0000064e +_080BC020: .4byte sub_80BBD1C + 1 +_080BC024: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080BC05C + movs r0, 0x1 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080BC054 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BC058 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BC08A + .align 2, 0 +_080BC054: .4byte 0x03005e00 +_080BC058: .4byte sub_80BC3DC + 1 +_080BC05C: + ldr r5, _080BC094 + ldr r0, [r5] + ldr r4, _080BC098 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD69C + ldr r1, [r5] + adds r4, r1, r4 + strh r0, [r4] + ldr r0, _080BC09C + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080BC08A + ldr r0, _080BC0A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BC0A4 + str r0, [r1] +_080BC08A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BC094: .4byte 0x02039b4c +_080BC098: .4byte 0x0000060e +_080BC09C: .4byte 0x0000062e +_080BC0A0: .4byte 0x03005e00 +_080BC0A4: .4byte sub_80BC0A8 + 1 + thumb_func_end sub_80BBEB8 + + thumb_func_start sub_80BC0A8 +sub_80BC0A8: @ 80BC0A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BC0E4 + ldr r2, [r0] + ldr r1, _080BC0E8 + adds r0, r2, r1 + ldrb r0, [r0] + ldr r3, _080BC0EC + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x2 + adds r2, r3 + ldrb r2, [r2] + bl sub_80BD404 + lsls r0, 24 + cmp r0, 0 + beq _080BC0DC + ldr r0, _080BC0F0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BC0F4 + str r0, [r1] +_080BC0DC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BC0E4: .4byte 0x02039b4c +_080BC0E8: .4byte 0x0000062f +_080BC0EC: .4byte 0x00000634 +_080BC0F0: .4byte 0x03005e00 +_080BC0F4: .4byte sub_80BBEB8 + 1 + thumb_func_end sub_80BC0A8 + + thumb_func_start sub_80BC0F8 +sub_80BC0F8: @ 80BC0F8 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _080BC128 + ldr r0, [r5] + ldr r4, _080BC12C + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r5, [r5] + adds r1, r5, r4 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x60 + beq _080BC130 + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r1] + b _080BC2C8 + .align 2, 0 +_080BC128: .4byte 0x02039b4c +_080BC12C: .4byte 0x00000652 +_080BC130: + ldr r0, _080BC154 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080BC13E + b _080BC238 +_080BC13E: + movs r1, 0xCA + lsls r1, 3 + adds r0, r5, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080BC1C2 + lsls r0, 2 + ldr r1, _080BC158 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BC154: .4byte 0x030022c0 +_080BC158: .4byte _080BC15C + .align 2, 0 +_080BC15C: + .4byte _080BC1C2 + .4byte _080BC170 + .4byte _080BC194 + .4byte _080BC1E4 + .4byte _080BC214 +_080BC170: + ldr r5, _080BC188 + ldr r1, [r5] + ldr r4, _080BC18C + adds r2, r1, r4 + movs r0, 0 + strh r0, [r2] + ldr r2, _080BC190 + adds r1, r2 + movs r0, 0x40 + strb r0, [r1] + b _080BC1B2 + .align 2, 0 +_080BC188: .4byte 0x02039b4c +_080BC18C: .4byte 0x0000060e +_080BC190: .4byte 0x0000062c +_080BC194: + ldr r5, _080BC1D0 + ldr r2, [r5] + ldr r0, _080BC1D4 + adds r3, r2, r0 + ldrh r0, [r3] + subs r0, 0x1 + ldr r4, _080BC1D8 + adds r1, r2, r4 + strh r0, [r1] + ldrh r0, [r3] + lsls r0, 4 + adds r0, 0x30 + ldr r1, _080BC1DC + adds r2, r1 + strb r0, [r2] +_080BC1B2: + bl sub_80BDA40 + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD2B4 +_080BC1C2: + ldr r2, _080BC1E0 + ldrh r1, [r2, 0x2E] + movs r0, 0x8 + orrs r0, r1 + strh r0, [r2, 0x2E] + b _080BC238 + .align 2, 0 +_080BC1D0: .4byte 0x02039b4c +_080BC1D4: .4byte 0x0000060c +_080BC1D8: .4byte 0x0000060e +_080BC1DC: .4byte 0x0000062c +_080BC1E0: .4byte 0x030022c0 +_080BC1E4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080BC20C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BC210 + str r1, [r0] + movs r0, 0x34 + bl audio_play + b _080BC238 + .align 2, 0 +_080BC20C: .4byte 0x03005e00 +_080BC210: .4byte sub_80BC3DC + 1 +_080BC214: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080BC260 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BC264 + str r1, [r0] + movs r0, 0x3 + bl audio_play +_080BC238: + ldr r2, _080BC268 + ldrh r1, [r2, 0x2E] + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + beq _080BC278 + ldr r0, _080BC26C + ldr r0, [r0] + ldr r2, _080BC270 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r1, _080BC260 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BC274 + str r1, [r0] + b _080BC296 + .align 2, 0 +_080BC260: .4byte 0x03005e00 +_080BC264: .4byte sub_80BC47C + 1 +_080BC268: .4byte 0x030022c0 +_080BC26C: .4byte 0x02039b4c +_080BC270: .4byte 0x0000064f +_080BC274: .4byte sub_80BBEB8 + 1 +_080BC278: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BC2A4 + ldr r0, _080BC2A0 + ldr r0, [r0] + movs r3, 0xCA + lsls r3, 3 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, 0 + beq _080BC2A4 + subs r0, 0x1 + strh r0, [r1] +_080BC296: + movs r0, 0x5 + bl audio_play + b _080BC2C8 + .align 2, 0 +_080BC2A0: .4byte 0x02039b4c +_080BC2A4: + ldrh r1, [r2, 0x30] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BC2C8 + ldr r0, _080BC2D0 + ldr r0, [r0] + movs r2, 0xCA + lsls r2, 3 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0x3 + bhi _080BC2C8 + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x5 + bl audio_play +_080BC2C8: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BC2D0: .4byte 0x02039b4c + thumb_func_end sub_80BC0F8 + + thumb_func_start sub_80BC2D4 +sub_80BC2D4: @ 80BC2D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _080BC340 + ldr r5, _080BC344 + ldr r3, [r5] + ldr r4, _080BC348 + adds r0, r3, r4 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0x30 + bne _080BC33A + movs r2, 0x22 + ldrsh r0, [r1, r2] + cmp r0, 0x38 + bne _080BC33A + ldr r1, _080BC34C + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, _080BC350 + adds r0, r3, r2 + strb r1, [r0] + ldr r1, [r5] + subs r2, 0x3D + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1, r0 + adds r1, r4 + ldrb r1, [r1] + bl sub_80BE91C + ldr r2, _080BC354 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r0, [r5] + adds r0, r4 + ldr r2, _080BC358 + strh r2, [r0] + ldr r0, _080BC35C + str r0, [r1] +_080BC33A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BC340: .4byte 0x02020630 +_080BC344: .4byte 0x02039b4c +_080BC348: .4byte 0x00000626 +_080BC34C: .4byte 0x0000064a +_080BC350: .4byte 0x0000064b +_080BC354: .4byte 0x03005e00 +_080BC358: .4byte 0x0000ffff +_080BC35C: .4byte sub_80BC360 + 1 + thumb_func_end sub_80BC2D4 + + thumb_func_start sub_80BC360 +sub_80BC360: @ 80BC360 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080BC3BC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080BC3CC + ldr r5, _080BC3C0 + ldr r0, [r5] + ldr r1, _080BC3C4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080BC3D0 + ldrb r0, [r4, 0x8] + bl sub_80BE9C4 + lsls r0, 24 + cmp r0, 0 + bne _080BC3D0 + bl sub_80BD930 + lsls r0, 24 + cmp r0, 0 + beq _080BC3D0 + ldr r0, [r5] + ldr r2, _080BC3C8 + adds r1, r0, r2 + ldrh r1, [r1] + lsls r1, 2 + adds r0, r1 + ldrb r1, [r4, 0x8] + bl sub_80BE9F8 + b _080BC3D0 + .align 2, 0 +_080BC3BC: .4byte 0x03005e00 +_080BC3C0: .4byte 0x02039b4c +_080BC3C4: .4byte 0x0000064a +_080BC3C8: .4byte 0x0000060e +_080BC3CC: + ldr r0, _080BC3D8 + str r0, [r4] +_080BC3D0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BC3D8: .4byte sub_80BBE70 + 1 + thumb_func_end sub_80BC360 + + thumb_func_start sub_80BC3DC +sub_80BC3DC: @ 80BC3DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080BC458 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BC450 + ldr r4, _080BC45C + ldr r0, [r4] + ldr r2, _080BC460 + adds r1, r0, r2 + ldrh r1, [r1] + ldr r3, _080BC464 + adds r0, r3 + strb r1, [r0] + ldr r1, [r4] + subs r2, 0x1A + adds r0, r1, r2 + ldrh r2, [r0] + subs r3, 0x1E + adds r0, r1, r3 + strh r2, [r0] + ldr r2, _080BC468 + adds r0, r1, r2 + ldrh r0, [r0] + adds r3, 0x4 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BC42A + ldr r0, [r4] + ldr r2, _080BC46C + adds r0, r2 + strh r1, [r0] +_080BC42A: + ldr r0, [r4] + movs r3, 0xC3 + lsls r3, 3 + adds r1, r0, r3 + ldrh r1, [r1] + ldr r2, _080BC470 + adds r0, r2 + strh r1, [r0] + ldr r1, _080BC474 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BC478 + str r1, [r0] + bl sub_80BDA40 + bl sub_80BC890 +_080BC450: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BC458: .4byte 0x02037fd4 +_080BC45C: .4byte 0x02039b4c +_080BC460: .4byte 0x0000062a +_080BC464: .4byte 0x0000062c +_080BC468: .4byte 0x00000614 +_080BC46C: .4byte 0x00000612 +_080BC470: .4byte 0x00000616 +_080BC474: .4byte 0x03005e00 +_080BC478: .4byte sub_80BB78C + 1 + thumb_func_end sub_80BC3DC + + thumb_func_start sub_80BC47C +sub_80BC47C: @ 80BC47C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080BC4F0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BC4E8 + ldr r4, _080BC4F4 + ldr r0, [r4] + ldr r2, _080BC4F8 + adds r1, r0, r2 + ldrh r1, [r1] + ldr r3, _080BC4FC + adds r0, r3 + strb r1, [r0] + ldr r1, [r4] + subs r2, 0x1A + adds r0, r1, r2 + ldrh r2, [r0] + subs r3, 0x1E + adds r0, r1, r3 + strh r2, [r0] + ldr r2, _080BC500 + adds r0, r1, r2 + ldrh r0, [r0] + adds r3, 0x4 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BC4CA + ldr r0, [r4] + ldr r2, _080BC504 + adds r0, r2 + strh r1, [r0] +_080BC4CA: + ldr r0, [r4] + movs r3, 0xC3 + lsls r3, 3 + adds r1, r0, r3 + ldrh r1, [r1] + ldr r2, _080BC508 + adds r0, r2 + strh r1, [r0] + ldr r1, _080BC50C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BC510 + str r1, [r0] +_080BC4E8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BC4F0: .4byte 0x02037fd4 +_080BC4F4: .4byte 0x02039b4c +_080BC4F8: .4byte 0x0000062a +_080BC4FC: .4byte 0x0000062c +_080BC500: .4byte 0x00000614 +_080BC504: .4byte 0x00000612 +_080BC508: .4byte 0x00000616 +_080BC50C: .4byte 0x03005e00 +_080BC510: .4byte sub_80BBDE8 + 1 + thumb_func_end sub_80BC47C + + thumb_func_start sub_80BC514 +sub_80BC514: @ 80BC514 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080BC538 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + bhi _080BC55C + lsls r0, 2 + ldr r1, _080BC53C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BC538: .4byte 0x030022c0 +_080BC53C: .4byte _080BC540 + .align 2, 0 +_080BC540: + .4byte _080BC55C + .4byte _080BC6CC + .4byte _080BC6FC + .4byte _080BC704 + .4byte _080BC768 + .4byte _080BC790 + .4byte _080BC818 +_080BC55C: + ldr r0, _080BC61C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _080BC56E + b _080BC838 +_080BC56E: + movs r0, 0 + bl SetVBlankCallback + ldr r4, _080BC620 + ldr r0, [r4] + ldr r1, _080BC624 + adds r0, r1 + strb r5, [r0] + movs r0, 0 + bl sub_80C09B0 + ldr r0, [r4] + ldr r2, _080BC628 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1A + bl lcd_io_set + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080BC62C + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x3 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x2 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + ldr r1, _080BC630 + movs r2, 0x80 + lsls r2, 6 + str r6, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _080BC634 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _080BC638 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + cmp r5, 0 + bne _080BC640 + ldr r1, _080BC63C + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0 + movs r2, 0 + bl gpu_copy_to_wram_bg_tile_map + b _080BC64E + .align 2, 0 +_080BC61C: .4byte 0x02037fd4 +_080BC620: .4byte 0x02039b4c +_080BC624: .4byte 0x0000064a +_080BC628: .4byte 0x0000062d +_080BC62C: .4byte 0x0855d298 +_080BC630: .4byte 0x08dc1934 +_080BC634: .4byte 0x08dc2c5c +_080BC638: .4byte 0x08dc2dac +_080BC63C: .4byte 0x08dc2a08 +_080BC640: + ldr r1, _080BC668 + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0 + movs r2, 0 + bl gpu_copy_to_wram_bg_tile_map +_080BC64E: + bl sub_80A1A74 + cmp r5, 0 + bne _080BC674 + ldr r3, _080BC66C + ldr r1, [r3] + ldr r0, _080BC670 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + b _080BC682 + .align 2, 0 +_080BC668: .4byte 0x08dc2b1c +_080BC66C: .4byte 0x02039b4c +_080BC670: .4byte 0x0000064c +_080BC674: + ldr r3, _080BC6BC + ldr r1, [r3] + ldr r2, _080BC6C0 + adds r1, r2 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 +_080BC682: + strb r0, [r1] + ldr r0, [r3] + ldr r1, _080BC6C0 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + ldr r0, _080BC6C4 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _080BC6C8 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080BC838 + .align 2, 0 +_080BC6BC: .4byte 0x02039b4c +_080BC6C0: .4byte 0x0000064c +_080BC6C4: .4byte 0x0855d2a8 +_080BC6C8: .4byte 0x030022c0 +_080BC6CC: + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _080BC6F0 + movs r0, 0x8 + strb r0, [r1] + ldr r0, _080BC6F4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080BC6F8 + bl gpu_pal_obj_alloc_and_load_multiple + adds r0, r5, 0 + bl sub_80BDB7C + b _080BC7F8 + .align 2, 0 +_080BC6F0: .4byte 0x0300301c +_080BC6F4: .4byte 0x0855d26c +_080BC6F8: .4byte 0x0855d27c +_080BC6FC: + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _080BC800 +_080BC704: + cmp r5, 0 + bne _080BC71C + ldr r0, _080BC758 + ldr r1, [r0] + ldr r2, _080BC75C + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldrb r1, [r1] + bl sub_80BC8D4 +_080BC71C: + ldr r4, _080BC758 + ldr r0, [r4] + ldr r1, _080BC760 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD2B4 + ldr r0, [r4] + ldr r2, _080BC764 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r2, 0x3 + adds r0, r2 + strh r1, [r0] + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080BC7F8 + .align 2, 0 +_080BC758: .4byte 0x02039b4c +_080BC75C: .4byte 0x00000612 +_080BC760: .4byte 0x0000060e +_080BC764: .4byte 0x0000064f +_080BC768: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080BC788 + bl SetVBlankCallback + ldr r1, _080BC78C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080BC800 + .align 2, 0 +_080BC788: .4byte sub_80BB370 + 1 +_080BC78C: .4byte 0x030022c0 +_080BC790: + ldr r1, _080BC808 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _080BC80C + movs r0, 0x4A + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _080BC810 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_080BC7F8: + ldr r1, _080BC814 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080BC800: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BC838 + .align 2, 0 +_080BC808: .4byte 0x00003f3f +_080BC80C: .4byte 0x00001d3f +_080BC810: .4byte 0x00009040 +_080BC814: .4byte 0x030022c0 +_080BC818: + ldr r0, _080BC834 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080BC838 + movs r1, 0x87 + lsls r1, 3 + adds r0, r3, r1 + strb r2, [r0] + movs r0, 0x1 + b _080BC83A + .align 2, 0 +_080BC834: .4byte 0x02037fd4 +_080BC838: + movs r0, 0 +_080BC83A: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80BC514 + + thumb_func_start sub_80BC844 +sub_80BC844: @ 80BC844 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080BC858 + ldr r0, _080BC854 + b _080BC862 + .align 2, 0 +_080BC854: .4byte 0x08dc17b6 +_080BC858: + bl sub_809D42C + cmp r0, 0 + bne _080BC870 + ldr r0, _080BC86C +_080BC862: + movs r1, 0x1 + movs r2, 0xBE + bl gpu_pal_apply + b _080BC87A + .align 2, 0 +_080BC86C: .4byte 0x08dc16f6 +_080BC870: + ldr r0, _080BC88C + movs r1, 0x1 + movs r2, 0xBE + bl gpu_pal_apply +_080BC87A: + bl sub_8098C64 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_080BC88C: .4byte 0x08dc1876 + thumb_func_end sub_80BC844 + + thumb_func_start sub_80BC890 +sub_80BC890: @ 80BC890 + push {lr} + bl Window_FreeMemory + movs r0, 0 + bl bg_get_tilemap + cmp r0, 0 + beq _080BC8A4 + bl free +_080BC8A4: + movs r0, 0x1 + bl bg_get_tilemap + cmp r0, 0 + beq _080BC8B2 + bl free +_080BC8B2: + movs r0, 0x2 + bl bg_get_tilemap + cmp r0, 0 + beq _080BC8C0 + bl free +_080BC8C0: + movs r0, 0x3 + bl bg_get_tilemap + cmp r0, 0 + beq _080BC8CE + bl free +_080BC8CE: + pop {r0} + bx r0 + thumb_func_end sub_80BC890 + + thumb_func_start sub_80BC8D4 +sub_80BC8D4: @ 80BC8D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, _080BC908 + ldr r0, [r0] + ldr r1, _080BC90C + adds r0, r1 + movs r5, 0 + strh r5, [r0] + cmp r4, 0 + beq _080BC8FC + cmp r4, 0x1 + beq _080BC910 +_080BC8FC: + mov r1, sp + movs r0, 0xCA + strh r0, [r1] + movs r0, 0x1 + strh r0, [r1, 0x2] + b _080BC92C + .align 2, 0 +_080BC908: .4byte 0x02039b4c +_080BC90C: .4byte 0x0000060c +_080BC910: + bl sub_809D42C + cmp r0, 0 + beq _080BC924 + mov r0, sp + movs r1, 0xC1 + lsls r1, 1 + strh r1, [r0] + strh r5, [r0, 0x2] + b _080BC92C +_080BC924: + mov r0, sp + movs r1, 0xCA + strh r1, [r0] + strh r4, [r0, 0x2] +_080BC92C: + cmp r6, 0x5 + bls _080BC932 + b _080BCDB4 +_080BC932: + lsls r0, r6, 2 + ldr r1, _080BC93C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BC93C: .4byte _080BC940 + .align 2, 0 +_080BC940: + .4byte _080BC958 + .4byte _080BCACC + .4byte _080BCB78 + .4byte _080BCC08 + .4byte _080BCCA0 + .4byte _080BCD30 +_080BC958: + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _080BCA00 + movs r4, 0 + mov r0, sp + ldrh r0, [r0] + cmp r4, r0 + blt _080BC96C + b _080BCDB4 +_080BC96C: + mov r5, sp + ldr r2, _080BC9F8 + mov r8, r2 + movs r3, 0x1 + mov r9, r3 +_080BC976: + lsls r4, 16 + asrs r4, 16 + adds r7, r4, 0x1 + mov r10, r7 + lsls r0, r7, 16 + lsrs r6, r0, 16 + adds r0, r6, 0 + bl sub_806D4EC + strh r0, [r5, 0x4] + mov r2, r8 + ldr r1, [r2] + lsls r4, 2 + adds r1, r4 + strh r0, [r1] + ldrh r0, [r5, 0x4] + movs r1, 0 + bl pokedex_flag_operation + mov r3, r8 + ldr r2, [r3] + adds r2, r4 + mov r3, r9 + ands r3, r0 + ldrb r0, [r2, 0x2] + movs r7, 0x2 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x2] + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + mov r1, r8 + ldr r3, [r1] + adds r3, r4 + mov r2, r9 + ands r2, r0 + lsls r2, 1 + ldrb r0, [r3, 0x2] + subs r7, 0x1 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x2] + mov r0, r8 + ldr r1, [r0] + adds r4, r1, r4 + ldrb r0, [r4, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BC9EA + ldr r2, _080BC9FC + adds r0, r1, r2 + mov r3, r10 + strh r3, [r0] +_080BC9EA: + adds r4, r6, 0 + lsls r0, r4, 16 + asrs r0, 16 + ldrh r7, [r5] + cmp r0, r7 + blt _080BC976 + b _080BCDB4 + .align 2, 0 +_080BC9F8: .4byte 0x02039b4c +_080BC9FC: .4byte 0x0000060c +_080BCA00: + movs r4, 0 + movs r5, 0 + mov r10, r5 + mov r0, sp + ldrh r0, [r0] + cmp r4, r0 + blt _080BCA10 + b _080BCDB4 +_080BCA10: + mov r6, sp + ldr r0, _080BCAC4 + mov r8, r0 + movs r1, 0x1 + mov r9, r1 +_080BCA1A: + lsls r4, 16 + asrs r0, r4, 16 + adds r0, 0x1 + strh r0, [r6, 0x4] + ldrh r0, [r6, 0x4] + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + adds r7, r4, 0 + cmp r0, 0 + beq _080BCA36 + movs r2, 0x1 + mov r10, r2 +_080BCA36: + mov r3, r10 + cmp r3, 0 + beq _080BCAB2 + mov r4, r8 + ldr r1, [r4] + lsls r0, r5, 16 + asrs r5, r0, 16 + lsls r4, r5, 2 + adds r1, r4 + ldrh r0, [r6, 0x4] + strh r0, [r1] + ldrh r0, [r6, 0x4] + movs r1, 0 + bl pokedex_flag_operation + mov r1, r8 + ldr r2, [r1] + adds r2, r4 + mov r3, r9 + ands r3, r0 + mov r12, r3 + ldrb r0, [r2, 0x2] + movs r3, 0x2 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strb r0, [r2, 0x2] + ldrh r0, [r6, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + mov r2, r8 + ldr r3, [r2] + adds r3, r4 + mov r2, r9 + ands r2, r0 + lsls r2, 1 + mov r12, r2 + ldrb r0, [r3, 0x2] + movs r2, 0x3 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strb r0, [r3, 0x2] + mov r3, r8 + ldr r2, [r3] + adds r4, r2, r4 + ldrb r0, [r4, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BCAAC + adds r1, r5, 0x1 + ldr r4, _080BCAC8 + adds r0, r2, r4 + strh r1, [r0] +_080BCAAC: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080BCAB2: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + asrs r0, 16 + ldrh r2, [r6] + cmp r0, r2 + blt _080BCA1A + b _080BCDB4 + .align 2, 0 +_080BCAC4: .4byte 0x02039b4c +_080BCAC8: .4byte 0x0000060c +_080BCACC: + movs r4, 0 + mov r5, sp + ldr r3, _080BCB6C + mov r8, r3 + ldr r6, _080BCB70 + movs r7, 0x1 + mov r9, r7 +_080BCADA: + ldr r1, _080BCB74 + lsls r4, 16 + asrs r0, r4, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl sub_806D458 + lsls r0, 16 + lsrs r0, 16 + adds r7, r4, 0 + ldrh r1, [r5] + cmp r0, r1 + bhi _080BCB58 + ldrh r0, [r5, 0x4] + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCB58 + mov r3, r8 + ldr r2, [r3] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + mov r4, r9 + orrs r0, r4 + strb r0, [r2, 0x2] + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + mov r1, r8 + ldr r3, [r1] + adds r1, r3, r6 + ldrh r1, [r1] + lsls r1, 2 + adds r3, r1 + mov r2, r9 + ands r2, r0 + lsls r2, 1 + ldrb r0, [r3, 0x2] + movs r4, 0x3 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x2] + mov r0, r8 + ldr r1, [r0] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCB58: + movs r2, 0x80 + lsls r2, 9 + adds r1, r7, r2 + lsrs r4, r1, 16 + movs r0, 0xCD + lsls r0, 17 + cmp r1, r0 + ble _080BCADA + b _080BCDB4 + .align 2, 0 +_080BCB6C: .4byte 0x02039b4c +_080BCB70: .4byte 0x0000060c +_080BCB74: .4byte 0x0855c6a4 +_080BCB78: + ldr r4, _080BCBF4 + lsls r0, r4, 16 + mov r5, sp + ldr r7, _080BCBF8 + ldr r6, _080BCBFC +_080BCB82: + ldr r1, _080BCC00 + asrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl sub_806D458 + lsls r0, 16 + lsrs r0, 16 + ldrh r3, [r5] + cmp r0, r3 + bhi _080BCBE2 + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCBE2 + ldr r2, [r7] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r2, [r7] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r7] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCBE2: + lsls r0, r4, 16 + ldr r4, _080BCC04 + adds r0, r4 + lsrs r4, r0, 16 + lsls r0, r4, 16 + cmp r0, 0 + bge _080BCB82 + b _080BCDB4 + .align 2, 0 +_080BCBF4: .4byte 0x00000181 +_080BCBF8: .4byte 0x02039b4c +_080BCBFC: .4byte 0x0000060c +_080BCC00: .4byte 0x0855c9da +_080BCC04: .4byte 0xffff0000 +_080BCC08: + movs r4, 0 + mov r5, sp + ldr r7, _080BCC90 + mov r8, r7 + ldr r6, _080BCC94 + ldr r0, _080BCC98 + mov r9, r0 +_080BCC16: + ldr r1, _080BCC9C + lsls r4, 16 + asrs r0, r4, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl sub_806D458 + lsls r0, 16 + lsrs r0, 16 + adds r7, r4, 0 + ldrh r1, [r5] + cmp r0, r1 + bhi _080BCC7E + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCC7E + mov r3, r8 + ldr r2, [r3] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + mov r4, r8 + ldr r2, [r4] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r4] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCC7E: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, r9 + ble _080BCC16 + b _080BCDB4 + .align 2, 0 +_080BCC90: .4byte 0x02039b4c +_080BCC94: .4byte 0x0000060c +_080BCC98: .4byte 0x00000181 +_080BCC9C: .4byte 0x0855c9da +_080BCCA0: + ldr r4, _080BCD1C + lsls r0, r4, 16 + mov r5, sp + ldr r7, _080BCD20 + ldr r6, _080BCD24 +_080BCCAA: + ldr r1, _080BCD28 + asrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl sub_806D458 + lsls r0, 16 + lsrs r0, 16 + ldrh r2, [r5] + cmp r0, r2 + bhi _080BCD0A + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCD0A + ldr r2, [r7] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r2, [r7] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r7] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCD0A: + lsls r0, r4, 16 + ldr r3, _080BCD2C + adds r0, r3 + lsrs r4, r0, 16 + lsls r0, r4, 16 + cmp r0, 0 + bge _080BCCAA + b _080BCDB4 + .align 2, 0 +_080BCD1C: .4byte 0x00000181 +_080BCD20: .4byte 0x02039b4c +_080BCD24: .4byte 0x0000060c +_080BCD28: .4byte 0x0855ccde +_080BCD2C: .4byte 0xffff0000 +_080BCD30: + movs r4, 0 + mov r5, sp + ldr r7, _080BCE18 + mov r8, r7 + ldr r6, _080BCE1C + ldr r0, _080BCE20 + mov r9, r0 +_080BCD3E: + ldr r1, _080BCE24 + lsls r4, 16 + asrs r0, r4, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl sub_806D458 + lsls r0, 16 + lsrs r0, 16 + adds r7, r4, 0 + ldrh r1, [r5] + cmp r0, r1 + bhi _080BCDA6 + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCDA6 + mov r3, r8 + ldr r2, [r3] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + mov r4, r8 + ldr r2, [r4] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r4] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCDA6: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, r9 + ble _080BCD3E +_080BCDB4: + ldr r1, _080BCE18 + ldr r0, [r1] + ldr r2, _080BCE1C + adds r0, r2 + ldrh r4, [r0] + lsls r3, r4, 16 + asrs r0, r3, 16 + ldr r2, _080BCE20 + cmp r0, r2 + bgt _080BCE08 + adds r5, r1, 0 + movs r4, 0x2 + negs r4, r4 + mov r9, r4 + movs r7, 0x3 + negs r7, r7 + mov r8, r7 + adds r7, r2, 0 + ldr r0, _080BCE28 + adds r6, r0, 0 +_080BCDDC: + ldr r1, [r5] + asrs r3, 16 + lsls r4, r3, 2 + adds r1, r4 + ldrh r0, [r1] + orrs r0, r6 + strh r0, [r1] + ldrb r2, [r1, 0x2] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x2] + ldr r1, [r5] + adds r1, r4 + ldrb r2, [r1, 0x2] + mov r0, r8 + ands r0, r2 + strb r0, [r1, 0x2] + adds r3, 0x1 + lsls r3, 16 + asrs r0, r3, 16 + cmp r0, r7 + ble _080BCDDC +_080BCE08: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BCE18: .4byte 0x02039b4c +_080BCE1C: .4byte 0x0000060c +_080BCE20: .4byte 0x00000181 +_080BCE24: .4byte 0x0855ccde +_080BCE28: .4byte 0x0000ffff + thumb_func_end sub_80BC8D4 + + thumb_func_start sub_80BCE2C +sub_80BCE2C: @ 80BCE2C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r3 + ldr r3, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r3, 24 + add r4, sp, 0x14 + movs r6, 0 + strb r6, [r4] + adds r5, r4, 0 + movs r4, 0xF + strb r4, [r5, 0x1] + movs r4, 0x3 + strb r4, [r5, 0x2] + mov r4, r8 + lsls r4, 27 + lsrs r4, 24 + mov r8, r4 + lsrs r3, 21 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0xC] + str r2, [sp, 0x10] + mov r2, r8 + bl sub_8199EEC + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80BCE2C + + thumb_func_start sub_80BCE84 +sub_80BCE84: @ 80BCE84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r7, r2, 16 + cmp r0, 0x1 + beq _080BCF7C + cmp r0, 0x1 + ble _080BCEA8 + cmp r0, 0x2 + bne _080BCEA8 + b _080BD074 +_080BCEA8: + subs r0, r1, 0x5 + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0 + mov r9, r0 +_080BCEB2: + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r10, r0 + ldr r1, _080BCEE4 + cmp r5, r1 + bhi _080BCED2 + ldr r2, _080BCEE8 + mov r8, r2 + ldr r0, [r2] + mov r3, r10 + asrs r6, r3, 14 + adds r0, r6 + ldrh r0, [r0] + ldr r1, _080BCEEC + cmp r0, r1 + bne _080BCEF0 +_080BCED2: + mov r2, r9 + lsls r1, r2, 25 + lsrs r1, 24 + movs r0, 0x11 + adds r2, r7, 0 + bl sub_80BD28C + b _080BCF64 + .align 2, 0 +_080BCEE4: .4byte 0x00000181 +_080BCEE8: .4byte 0x02039b4c +_080BCEEC: .4byte 0x0000ffff +_080BCEF0: + mov r3, r9 + lsls r0, r3, 25 + lsrs r4, r0, 24 + movs r0, 0x11 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_80BD28C + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BCF42 + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + mov r3, r8 + ldr r0, [r3] + adds r0, r6 + ldrh r0, [r0] + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C + b _080BCF64 +_080BCF42: + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + movs r0, 0 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + movs r0, 0 + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C +_080BCF64: + movs r0, 0x80 + lsls r0, 9 + add r0, r10 + lsrs r1, r0, 16 + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0xA + bls _080BCEB2 + b _080BD13E +_080BCF7C: + subs r0, r1, 0x5 + lsls r1, r0, 16 + lsrs r5, r1, 16 + ldr r0, _080BCFAC + ldr r2, _080BCFB0 + cmp r5, r0 + bhi _080BCF9A + adds r6, r2, 0 + ldr r3, [r6] + asrs r4, r1, 14 + adds r0, r3, r4 + ldrh r1, [r0] + ldr r0, _080BCFB4 + cmp r1, r0 + bne _080BCFB8 +_080BCF9A: + ldr r0, [r2] + movs r1, 0xC6 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r1, 25 + b _080BD0B2 + .align 2, 0 +_080BCFAC: .4byte 0x00000181 +_080BCFB0: .4byte 0x02039b4c +_080BCFB4: .4byte 0x0000ffff +_080BCFB8: + movs r1, 0xC6 + lsls r1, 3 + adds r0, r3, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r1, 25 + lsrs r1, 24 + movs r0, 0x11 + adds r2, r7, 0 + bl sub_80BD28C + ldr r1, [r6] + adds r0, r1, r4 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BD028 + movs r3, 0xC6 + lsls r3, 3 + adds r0, r1, r3 + movs r1, 0 + ldrsh r2, [r0, r1] + lsls r2, 25 + lsrs r2, 24 + adds r0, r5, 0 + movs r1, 0x12 + adds r3, r7, 0 + bl sub_80BD154 + ldr r1, [r6] + adds r0, r1, r4 + ldrb r0, [r0, 0x2] + lsls r0, 30 + lsrs r0, 31 + movs r2, 0xC6 + lsls r2, 3 + adds r1, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + lsls r2, 25 + lsrs r2, 24 + movs r1, 0x11 + adds r3, r7, 0 + bl sub_80BD1F4 + ldr r1, [r6] + adds r0, r1, r4 + ldrh r0, [r0] + movs r2, 0xC6 + lsls r2, 3 + adds r1, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + lsls r2, 25 + lsrs r2, 24 + b _080BD06C +_080BD028: + movs r2, 0xC6 + lsls r2, 3 + adds r0, r1, r2 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r2, 25 + lsrs r2, 24 + adds r0, r5, 0 + movs r1, 0x12 + adds r3, r7, 0 + bl sub_80BD154 + ldr r0, [r6] + movs r1, 0xC6 + lsls r1, 3 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r2, 25 + lsrs r2, 24 + movs r0, 0 + movs r1, 0x11 + adds r3, r7, 0 + bl sub_80BD1F4 + ldr r0, [r6] + movs r1, 0xC6 + lsls r1, 3 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r2, 25 + lsrs r2, 24 + movs r0, 0 +_080BD06C: + movs r1, 0x16 + bl sub_80BD23C + b _080BD13E +_080BD074: + adds r0, r1, 0x5 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _080BD0C0 + mov r8, r0 + ldr r3, [r0] + movs r2, 0xC6 + lsls r2, 3 + adds r0, r3, r2 + ldrh r0, [r0] + adds r0, 0xA + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _080BD09A + adds r0, r2, 0 + subs r0, 0x10 + lsls r0, 16 + lsrs r2, r0, 16 +_080BD09A: + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, _080BD0C4 + cmp r5, r0 + bhi _080BD0B0 + asrs r6, r1, 14 + adds r0, r3, r6 + ldrh r1, [r0] + ldr r0, _080BD0C8 + cmp r1, r0 + bne _080BD0CC +_080BD0B0: + lsls r1, r2, 25 +_080BD0B2: + lsrs r1, 24 + movs r0, 0x11 + adds r2, r7, 0 + bl sub_80BD28C + b _080BD13E + .align 2, 0 +_080BD0C0: .4byte 0x02039b4c +_080BD0C4: .4byte 0x00000181 +_080BD0C8: .4byte 0x0000ffff +_080BD0CC: + lsls r0, r2, 25 + lsrs r4, r0, 24 + movs r0, 0x11 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_80BD28C + mov r3, r8 + ldr r0, [r3] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BD11C + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + ldrh r0, [r0] + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C + b _080BD13E +_080BD11C: + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + movs r0, 0 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + movs r0, 0 + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C +_080BD13E: + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80BCE84 + + thumb_func_start sub_80BD154 +sub_80BD154: @ 80BD154 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r1, _080BD1E8 + add r0, sp, 0x4 + movs r2, 0x6 + bl memcpy + ldr r0, _080BD1EC + ldr r0, [r0] + lsls r4, 2 + adds r4, r0, r4 + ldrh r6, [r4] + ldr r1, _080BD1F0 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080BD194 + adds r0, r6, 0 + bl sub_806D458 + lsls r0, 16 + lsrs r6, r0, 16 +_080BD194: + add r4, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4, 0x2] + add r5, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x3] + add r5, sp, 0x4 + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + str r7, [sp] + movs r0, 0 + movs r1, 0x7 + add r2, sp, 0x4 + mov r3, r8 + bl sub_80BCE2C + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BD1E8: .4byte 0x0855d2b8 +_080BD1EC: .4byte 0x02039b4c +_080BD1F0: .4byte 0x00000612 + thumb_func_end sub_80BD154 + + thumb_func_start sub_80BD1F4 +sub_80BD1F4: @ 80BD1F4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r0, 0 + beq _080BD220 + ldr r1, _080BD21C + lsls r2, r3, 3 + lsls r3, r4, 3 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0 + bl Window_CopyWholePixelBlockToWindow + b _080BD234 + .align 2, 0 +_080BD21C: .4byte 0x0855d2be +_080BD220: + lsls r2, r3, 3 + lsls r3, r4, 3 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + bl Window_FillPixelRect +_080BD234: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80BD1F4 + + thumb_func_start sub_80BD23C +sub_80BD23C: @ 80BD23C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + bl poke_something_2 + adds r1, r0, 0 + cmp r1, 0 + beq _080BD264 + movs r0, 0xB + muls r1, r0 + ldr r0, _080BD260 + adds r4, r1, r0 + b _080BD266 + .align 2, 0 +_080BD260: .4byte 0x083185c8 +_080BD264: + ldr r4, _080BD288 +_080BD266: + str r5, [sp] + movs r0, 0 + movs r1, 0x7 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_80BCE2C + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080BD288: .4byte 0x0855d2fe + thumb_func_end sub_80BD23C + + thumb_func_start sub_80BD28C +sub_80BD28C: @ 80BD28C + push {lr} + sub sp, 0x8 + adds r2, r0, 0 + adds r3, r1, 0 + lsls r2, 24 + lsls r3, 24 + lsrs r2, 21 + lsrs r3, 21 + movs r0, 0x60 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + bl Window_FillPixelRect + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80BD28C + + thumb_func_start sub_80BD2B4 +sub_80BD2B4: @ 80BD2B4 + 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 r2, _080BD3DC + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + movs r2, 0 + ldr r7, _080BD3E0 + adds r5, r7, 0 + ldr r4, _080BD3E4 + ldr r0, _080BD3E8 + adds r3, r0, 0 +_080BD2DA: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080BD2DA + ldr r0, [r7] + ldr r1, _080BD3EC + adds r0, r1 + ldr r1, _080BD3E8 + strh r1, [r0] + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080BD3E8 + cmp r0, r4 + beq _080BD334 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _080BD3F0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _080BD3F4 + str r2, [r1] + adds r0, r3 + ldr r1, _080BD3F8 + strh r1, [r0, 0x38] +_080BD334: + adds r0, r6, 0 + bl sub_80BDA8C + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + beq _080BD366 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _080BD3F0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _080BD3F4 + str r2, [r1] + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x38] +_080BD366: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + beq _080BD39C + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _080BD3F0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _080BD3F4 + str r2, [r1] + adds r0, r3 + movs r1, 0x20 + strh r1, [r0, 0x38] +_080BD39C: + movs r0, 0 + adds r1, r6, 0 + mov r2, r8 + bl sub_80BCE84 + ldr r0, [r7] + ldr r2, _080BD3FC + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1A + bl lcd_io_set + ldr r0, [r7] + movs r2, 0xC6 + lsls r2, 3 + adds r1, r0, r2 + movs r2, 0 + strh r2, [r1] + ldr r1, _080BD400 + adds r0, r1 + strh r2, [r0] + ldr r2, _080BD3DC + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BD3DC: .4byte 0x02037fd4 +_080BD3E0: .4byte 0x02039b4c +_080BD3E4: .4byte 0x0000061e +_080BD3E8: .4byte 0x0000ffff +_080BD3EC: .4byte 0x00000626 +_080BD3F0: .4byte 0x02020630 +_080BD3F4: .4byte sub_80BE4E0 + 1 +_080BD3F8: .4byte 0x0000ffe0 +_080BD3FC: .4byte 0x0000062d +_080BD400: .4byte 0x00000632 + thumb_func_end sub_80BD2B4 + + thumb_func_start sub_80BD404 +sub_80BD404: @ 80BD404 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _080BD438 + ldr r1, [r0] + ldr r3, _080BD43C + adds r2, r1, r3 + ldrb r3, [r2] + adds r7, r0, 0 + cmp r3, 0 + bne _080BD428 + b _080BD578 +_080BD428: + subs r0, r3, 0x1 + strb r0, [r2] + cmp r4, 0x1 + beq _080BD440 + cmp r4, 0x2 + beq _080BD4DC + b _080BD558 + .align 2, 0 +_080BD438: .4byte 0x02039b4c +_080BD43C: .4byte 0x0000062e +_080BD440: + movs r3, 0 + ldr r4, _080BD4C0 + mov r12, r4 + ldr r0, _080BD4C4 + mov r8, r0 + adds r2, r7, 0 +_080BD44C: + ldr r0, [r2] + lsls r1, r3, 1 + ldr r4, _080BD4C8 + adds r0, r4 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r12 + beq _080BD46A + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x38] + adds r0, r5 + strh r0, [r1, 0x38] +_080BD46A: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BD44C + ldr r4, [r7] + ldr r1, _080BD4CC + adds r0, r4, r1 + ldrb r0, [r0] + subs r0, r6, r0 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, _080BD4D0 + adds r0, r4, r3 + ldr r1, _080BD4D4 + adds r4, r1 + movs r3, 0 + ldrsh r1, [r4, r3] + lsls r1, 4 + ldrb r0, [r0] + adds r1, r0 + subs r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + ldr r0, [r7] + ldr r4, _080BD4D8 + adds r2, r0, r4 + movs r1, 0xC5 + lsls r1, 3 + adds r0, r1 + ldrb r1, [r0] + ldrb r0, [r2] + subs r0, r1 + strb r0, [r2] + b _080BD558 + .align 2, 0 +_080BD4C0: .4byte 0x0000ffff +_080BD4C4: .4byte 0x02020630 +_080BD4C8: .4byte 0x0000061e +_080BD4CC: .4byte 0x0000062e +_080BD4D0: .4byte 0x0000062d +_080BD4D4: .4byte 0x00000632 +_080BD4D8: .4byte 0x0000062c +_080BD4DC: + movs r3, 0 + ldr r2, _080BD55C + mov r12, r2 + ldr r4, _080BD560 + mov r8, r4 + adds r2, r7, 0 +_080BD4E8: + ldr r0, [r2] + lsls r1, r3, 1 + ldr r4, _080BD564 + adds r0, r4 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r12 + beq _080BD506 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x38] + subs r0, r5 + strh r0, [r1, 0x38] +_080BD506: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BD4E8 + ldr r4, [r7] + ldr r1, _080BD568 + adds r0, r4, r1 + ldrb r0, [r0] + subs r0, r6, r0 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, _080BD56C + adds r0, r4, r3 + ldr r1, _080BD570 + adds r4, r1 + movs r3, 0 + ldrsh r1, [r4, r3] + lsls r1, 4 + ldrb r0, [r0] + adds r1, r0 + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + ldr r0, [r7] + ldr r4, _080BD574 + adds r1, r0, r4 + movs r2, 0xC5 + lsls r2, 3 + adds r0, r2 + ldrb r0, [r0] + ldrb r3, [r1] + adds r0, r3 + strb r0, [r1] +_080BD558: + movs r0, 0 + b _080BD598 + .align 2, 0 +_080BD55C: .4byte 0x0000ffff +_080BD560: .4byte 0x02020630 +_080BD564: .4byte 0x0000061e +_080BD568: .4byte 0x0000062e +_080BD56C: .4byte 0x0000062d +_080BD570: .4byte 0x00000632 +_080BD574: .4byte 0x0000062c +_080BD578: + ldr r4, _080BD5A4 + adds r2, r1, r4 + movs r3, 0xC6 + lsls r3, 3 + adds r0, r1, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + lsls r1, 4 + ldrb r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + movs r0, 0x1 +_080BD598: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080BD5A4: .4byte 0x0000062d + thumb_func_end sub_80BD404 + + thumb_func_start sub_80BD5A8 +sub_80BD5A8: @ 80BD5A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + ldr r4, _080BD5D0 + ldr r0, [r4] + movs r5, 0xC6 + lsls r5, 3 + adds r1, r0, r5 + ldrh r1, [r1] + ldr r6, _080BD5D4 + adds r0, r6 + strh r1, [r0] + cmp r2, 0x1 + beq _080BD5D8 + cmp r2, 0x2 + beq _080BD638 + b _080BD694 + .align 2, 0 +_080BD5D0: .4byte 0x02039b4c +_080BD5D4: .4byte 0x00000632 +_080BD5D8: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _080BD624 + cmp r1, r0 + beq _080BD612 + adds r0, r1, 0 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _080BD628 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _080BD62C + str r2, [r1] + adds r0, r3 + ldr r1, _080BD630 + strh r1, [r0, 0x38] +_080BD612: + ldr r0, [r4] + adds r1, r0, r5 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _080BD634 + subs r0, r2, 0x1 + b _080BD692 + .align 2, 0 +_080BD624: .4byte 0x0000ffff +_080BD628: .4byte 0x02020630 +_080BD62C: .4byte sub_80BE4E0 + 1 +_080BD630: .4byte 0x0000ffc0 +_080BD634: + movs r0, 0xF + b _080BD692 +_080BD638: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _080BD684 + cmp r1, r0 + beq _080BD672 + adds r0, r1, 0 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _080BD688 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _080BD68C + str r2, [r1] + adds r0, r3 + movs r1, 0x40 + strh r1, [r0, 0x38] +_080BD672: + ldr r0, [r4] + adds r1, r0, r5 + ldrh r2, [r1] + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0xE + bgt _080BD690 + adds r0, r2, 0x1 + b _080BD692 + .align 2, 0 +_080BD684: .4byte 0x0000ffff +_080BD688: .4byte 0x02020630 +_080BD68C: .4byte sub_80BE4E0 + 1 +_080BD690: + movs r0, 0 +_080BD692: + strh r0, [r1] +_080BD694: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80BD5A8 + + thumb_func_start sub_80BD69C +sub_80BD69C: @ 80BD69C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0 + mov r10, r0 + ldr r2, _080BD6F0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BD6FC + cmp r7, 0 + beq _080BD6FC + movs r1, 0x1 + mov r10, r1 + ldr r0, _080BD6F4 + ldr r0, [r0] + ldr r2, _080BD6F8 + adds r0, r2 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + movs r0, 0x1 + adds r1, r7, 0 + bl sub_80BD5A8 + movs r0, 0x1 + b _080BD734 + .align 2, 0 +_080BD6F0: .4byte 0x030022c0 +_080BD6F4: .4byte 0x02039b4c +_080BD6F8: .4byte 0x0000060c +_080BD6FC: + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BD74C + ldr r0, _080BD744 + ldr r0, [r0] + ldr r3, _080BD748 + adds r0, r3 + ldrh r0, [r0] + subs r0, 0x1 + cmp r7, r0 + bge _080BD74C + movs r1, 0x2 + mov r10, r1 + lsls r3, r0, 16 + lsrs r3, 16 + movs r0, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + movs r0, 0x2 + adds r1, r7, 0 + bl sub_80BD5A8 + movs r0, 0x2 +_080BD734: + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80BCE84 + movs r0, 0x6C + bl audio_play + b _080BD81A + .align 2, 0 +_080BD744: .4byte 0x02039b4c +_080BD748: .4byte 0x0000060c +_080BD74C: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BD7B4 + cmp r7, 0 + beq _080BD7B4 + adds r6, r7, 0 + movs r4, 0 +_080BD75E: + ldr r5, _080BD7A8 + ldr r0, [r5] + ldr r2, _080BD7AC + adds r0, r2 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080BD75E + ldr r1, [r5] + ldr r3, _080BD7B0 + adds r1, r3 + subs r0, r7, r6 + lsls r0, 4 + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + bl sub_80BDA40 + adds r0, r7, 0 + movs r1, 0xE + bl sub_80BD2B4 + movs r0, 0x6D + bl audio_play + b _080BD81A + .align 2, 0 +_080BD7A8: .4byte 0x02039b4c +_080BD7AC: .4byte 0x0000060c +_080BD7B0: .4byte 0x0000062c +_080BD7B4: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BD81A + ldr r0, _080BD830 + ldr r0, [r0] + ldr r3, _080BD834 + adds r0, r3 + ldrh r0, [r0] + subs r0, 0x1 + cmp r7, r0 + bge _080BD81A + adds r6, r7, 0 + movs r4, 0 +_080BD7D2: + ldr r5, _080BD830 + ldr r0, [r5] + ldr r1, _080BD834 + adds r0, r1 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080BD7D2 + ldr r1, [r5] + ldr r2, _080BD838 + adds r1, r2 + subs r0, r7, r6 + lsls r0, 4 + ldrb r3, [r1] + adds r0, r3 + strb r0, [r1] + bl sub_80BDA40 + adds r0, r7, 0 + movs r1, 0xE + bl sub_80BD2B4 + movs r0, 0x6D + bl audio_play +_080BD81A: + mov r0, r10 + cmp r0, 0 + bne _080BD83C + ldr r0, _080BD830 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 3 + adds r0, r1 + mov r2, r10 + strh r2, [r0] + b _080BD8A2 + .align 2, 0 +_080BD830: .4byte 0x02039b4c +_080BD834: .4byte 0x0000060c +_080BD838: .4byte 0x0000062c +_080BD83C: + ldr r1, _080BD8B4 + ldr r6, _080BD8B8 + ldr r2, [r6] + movs r3, 0xC7 + lsls r3, 3 + mov r9, r3 + adds r0, r2, r3 + ldrh r0, [r0] + lsrs r0, 2 + adds r1, r0, r1 + ldrb r5, [r1] + ldr r1, _080BD8BC + adds r0, r1 + ldrb r3, [r0] + ldr r0, _080BD8C0 + adds r2, r0 + strb r3, [r2] + ldr r1, [r6] + ldr r2, _080BD8C4 + mov r8, r2 + adds r0, r1, r2 + strh r3, [r0] + ldr r4, _080BD8C8 + adds r0, r1, r4 + strh r5, [r0] + ldr r3, _080BD8CC + adds r1, r3 + mov r0, r10 + strb r0, [r1] + ldr r2, [r6] + lsrs r5, 1 + movs r1, 0xC5 + lsls r1, 3 + adds r0, r2, r1 + strh r5, [r0] + adds r3, r2, r3 + ldrb r0, [r3] + adds r4, r2, r4 + ldrb r1, [r4] + add r2, r8 + ldrb r2, [r2] + bl sub_80BD404 + ldr r0, [r6] + mov r2, r9 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0xB + bhi _080BD8A2 + adds r0, 0x1 + strh r0, [r1] +_080BD8A2: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080BD8B4: .4byte 0x0855d28c +_080BD8B8: .4byte 0x02039b4c +_080BD8BC: .4byte 0x0855d291 +_080BD8C0: .4byte 0x0000062e +_080BD8C4: .4byte 0x00000636 +_080BD8C8: .4byte 0x00000634 +_080BD8CC: .4byte 0x0000062f + thumb_func_end sub_80BD69C + + thumb_func_start sub_80BD8D0 +sub_80BD8D0: @ 80BD8D0 + push {r4-r7,lr} + movs r4, 0 + ldr r0, _080BD91C + mov r12, r0 + ldr r6, _080BD920 + ldr r5, _080BD924 +_080BD8DC: + mov r1, r12 + ldr r3, [r1] + lsls r1, r4, 1 + ldr r2, _080BD928 + adds r0, r3, r2 + adds r0, r1 + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r6 + movs r7, 0x24 + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _080BD90C + movs r7, 0x26 + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _080BD90C + cmp r2, r5 + beq _080BD90C + ldr r1, _080BD92C + adds r0, r3, r1 + strh r2, [r0] +_080BD90C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080BD8DC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BD91C: .4byte 0x02039b4c +_080BD920: .4byte 0x02020630 +_080BD924: .4byte 0x0000ffff +_080BD928: .4byte 0x0000061e +_080BD92C: .4byte 0x00000626 + thumb_func_end sub_80BD8D0 + + thumb_func_start sub_80BD930 +sub_80BD930: @ 80BD930 + push {r4-r6,lr} + ldr r3, _080BD990 + ldr r0, [r3] + ldr r1, _080BD994 + adds r0, r1 + ldrh r4, [r0] + ldr r2, _080BD998 + ldrh r1, [r2, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BD9B8 + cmp r4, 0 + beq _080BD9B8 + adds r2, r4, 0 + adds r5, r3, 0 +_080BD950: + ldr r0, [r5] + ldr r1, _080BD99C + adds r0, r1 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + adds r1, r2, 0 + movs r2, 0 + bl sub_80C0E0C + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + bne _080BD9A0 + cmp r2, 0 + bne _080BD950 +_080BD97E: + ldr r0, _080BD990 + ldr r1, [r0] + ldr r0, _080BD994 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, r4 + bne _080BD9A4 + b _080BDA38 + .align 2, 0 +_080BD990: .4byte 0x02039b4c +_080BD994: .4byte 0x0000060e +_080BD998: .4byte 0x030022c0 +_080BD99C: .4byte 0x0000060c +_080BD9A0: + adds r4, r2, 0 + b _080BD97E +_080BD9A4: + strh r4, [r2] + ldr r0, _080BD9B0 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x10 + b _080BDA20 + .align 2, 0 +_080BD9B0: .4byte 0x0000062c +_080BD9B4: + adds r4, r2, 0 + b _080BDA08 +_080BD9B8: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BDA38 + ldr r0, [r3] + ldr r1, _080BDA28 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r4, r0 + bge _080BDA38 + adds r2, r4, 0 + adds r6, r3, 0 + adds r5, r1, 0 +_080BD9D6: + ldr r0, [r6] + adds r0, r5 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0 + adds r1, r2, 0 + movs r2, 0 + bl sub_80C0E0C + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r6] + lsls r0, r2, 2 + adds r0, r1, r0 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + bne _080BD9B4 + adds r0, r1, r5 + ldrh r0, [r0] + subs r0, 0x1 + cmp r2, r0 + blt _080BD9D6 +_080BDA08: + ldr r0, _080BDA2C + ldr r1, [r0] + ldr r0, _080BDA30 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, r4 + beq _080BDA38 + strh r4, [r2] + ldr r0, _080BDA34 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x10 +_080BDA20: + strb r0, [r1] + movs r0, 0x1 + b _080BDA3A + .align 2, 0 +_080BDA28: .4byte 0x0000060c +_080BDA2C: .4byte 0x02039b4c +_080BDA30: .4byte 0x0000060e +_080BDA34: .4byte 0x0000062c +_080BDA38: + movs r0, 0 +_080BDA3A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80BD930 + + thumb_func_start sub_80BDA40 +sub_80BDA40: @ 80BDA40 + push {r4-r7,lr} + movs r5, 0 + ldr r6, _080BDA80 + ldr r7, _080BDA84 +_080BDA48: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, _080BDA88 + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r7 + beq _080BDA6C + bl sub_818D820 + ldr r1, [r6] + ldr r0, _080BDA88 + adds r1, r0 + adds r1, r4 + ldrh r2, [r1] + adds r0, r7, 0 + orrs r0, r2 + strh r0, [r1] +_080BDA6C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _080BDA48 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080BDA80: .4byte 0x02039b4c +_080BDA84: .4byte 0x0000ffff +_080BDA88: .4byte 0x0000061e + thumb_func_end sub_80BDA40 + + thumb_func_start sub_80BDA8C +sub_80BDA8C: @ 80BDA8C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _080BDAAC + cmp r2, r0 + bhi _080BDAA8 + ldr r0, _080BDAB0 + ldr r1, [r0] + lsls r0, r2, 2 + adds r2, r1, r0 + ldrh r1, [r2] + ldr r0, _080BDAB4 + cmp r1, r0 + bne _080BDAB8 +_080BDAA8: + ldr r0, _080BDAB4 + b _080BDAC6 + .align 2, 0 +_080BDAAC: .4byte 0x00000181 +_080BDAB0: .4byte 0x02039b4c +_080BDAB4: .4byte 0x0000ffff +_080BDAB8: + ldrb r0, [r2, 0x2] + lsls r0, 31 + cmp r0, 0 + bne _080BDAC4 + movs r0, 0 + b _080BDAC6 +_080BDAC4: + ldrh r0, [r2] +_080BDAC6: + pop {r1} + bx r1 + thumb_func_end sub_80BDA8C + + thumb_func_start sub_80BDACC +sub_80BDACC: @ 80BDACC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r2, 16 + lsrs r2, 16 + movs r6, 0 + ldr r0, _080BDB50 + mov r9, r0 + ldr r3, _080BDB54 + lsls r1, 16 +_080BDAE8: + mov r4, r9 + ldr r0, [r4] + lsls r7, r6, 1 + ldr r4, _080BDB58 + adds r0, r4 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r3 + bne _080BDB60 + lsls r2, 16 + mov r0, r8 + asrs r1, 16 + asrs r2, 16 + adds r3, r6, 0 + bl sub_80C0E9C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080BDB5C + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r4, r0 + ldrb r1, [r4, 0x1] + movs r2, 0x4 + negs r2, r2 + adds r0, r2, 0 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strb r1, [r4, 0x1] + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0 + strh r0, [r4, 0x2E] + strh r6, [r4, 0x30] + mov r0, r8 + bl poke_something_2 + strh r0, [r4, 0x32] + mov r4, r9 + ldr r0, [r4] + ldr r1, _080BDB58 + adds r0, r1 + adds r0, r7 + strh r5, [r0] + adds r0, r5, 0 + b _080BDB6C + .align 2, 0 +_080BDB50: .4byte 0x02039b4c +_080BDB54: .4byte 0x0000ffff +_080BDB58: .4byte 0x0000061e +_080BDB5C: .4byte 0x02020630 +_080BDB60: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _080BDAE8 + ldr r0, _080BDB78 +_080BDB6C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080BDB78: .4byte 0x0000ffff + thumb_func_end sub_80BDACC + + thumb_func_start sub_80BDB7C +sub_80BDB7C: @ 80BDB7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, _080BDD48 + adds r0, r4, 0 + movs r1, 0xB8 + movs r2, 0x4 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080BDD4C + mov r10, r1 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0 + strh r1, [r0, 0x30] + adds r0, r4, 0 + movs r1, 0xB8 + movs r2, 0x9C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0x30] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r0, _080BDD50 + movs r1, 0xE6 + movs r2, 0x14 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r5, _080BDD54 + adds r0, r5, 0 + movs r1, 0x10 + movs r2, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r0, r5, 0 + movs r1, 0x30 + movs r2, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x3 + bl obj_anim_image_start + adds r0, r5, 0 + movs r1, 0x10 + movs r2, 0x90 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r10 + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start + movs r0, 0x80 + mov r9, r0 + mov r1, r9 + strh r1, [r4, 0x32] + adds r0, r5, 0 + movs r1, 0x30 + movs r2, 0x90 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl obj_anim_image_start + ldr r6, _080BDD58 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + add r1, r10 + ldrb r2, [r1, 0x1] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r5, 0x1 + orrs r0, r5 + strb r0, [r1, 0x1] + ldrb r2, [r1, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + movs r2, 0x3C + orrs r0, r2 + strb r0, [r1, 0x3] + movs r0, 0x1E + strh r0, [r1, 0x2E] + movs r0, 0 + strh r0, [r1, 0x30] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + add r1, r10 + ldrb r0, [r1, 0x1] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0x1] + ldrb r0, [r1, 0x3] + movs r2, 0x3E + orrs r0, r2 + strb r0, [r1, 0x3] + movs r0, 0x1F + strh r0, [r1, 0x2E] + mov r0, r9 + strh r0, [r1, 0x30] + mov r1, r8 + cmp r1, 0 + beq _080BDCCC + b _080BE414 +_080BDCCC: + bl sub_809D42C + cmp r0, 0 + beq _080BDCD6 + b _080BDF4C +_080BDCD6: + ldr r4, _080BDD5C + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x28 + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x48 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl obj_anim_image_start + movs r0, 0 + mov r8, r0 + ldr r0, _080BDD60 + movs r1, 0x18 + movs r2, 0x30 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BDD64 + ldr r0, [r0] + ldr r1, _080BDD68 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r1, r10 + adds r4, r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + beq _080BDD6C + movs r0, 0x1 + mov r8, r0 + b _080BDD78 + .align 2, 0 +_080BDD48: .4byte 0x0855d1ac +_080BDD4C: .4byte 0x02020630 +_080BDD50: .4byte 0x0855d194 +_080BDD54: .4byte 0x0855d1c4 +_080BDD58: .4byte 0x0855d1dc +_080BDD5C: .4byte 0x0855d1f4 +_080BDD60: .4byte 0x0855d224 +_080BDD64: .4byte 0x02039b4c +_080BDD68: .4byte 0x0000061a +_080BDD6C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDD78: + ldr r0, _080BDDC4 + movs r1, 0x20 + movs r2, 0x30 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BDDC8 + ldr r0, [r0] + ldr r1, _080BDDCC + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BDDB0 + mov r0, r8 + cmp r0, 0 + beq _080BDDD4 +_080BDDB0: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080BDDD0 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BDDE8 + .align 2, 0 +_080BDDC4: .4byte 0x0855d224 +_080BDDC8: .4byte 0x02039b4c +_080BDDCC: .4byte 0x0000061a +_080BDDD0: .4byte 0x02020630 +_080BDDD4: + ldr r1, _080BDE6C + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDDE8: + ldr r6, _080BDE70 + adds r0, r6, 0 + movs r1, 0x28 + movs r2, 0x30 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, _080BDE74 + ldr r0, [r5] + ldr r1, _080BDE78 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, _080BDE6C + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + movs r0, 0 + mov r8, r0 + adds r0, r6, 0 + movs r1, 0x18 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r5] + ldr r1, _080BDE7C + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + beq _080BDE80 + movs r0, 0x1 + mov r8, r0 + b _080BDE8C + .align 2, 0 +_080BDE6C: .4byte 0x02020630 +_080BDE70: .4byte 0x0855d224 +_080BDE74: .4byte 0x02039b4c +_080BDE78: .4byte 0x0000061a +_080BDE7C: .4byte 0x0000061c +_080BDE80: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDE8C: + ldr r0, _080BDED8 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BDEDC + ldr r0, [r0] + ldr r1, _080BDEE0 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BDEC4 + mov r0, r8 + cmp r0, 0 + beq _080BDEE8 +_080BDEC4: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080BDEE4 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BDEFC + .align 2, 0 +_080BDED8: .4byte 0x0855d224 +_080BDEDC: .4byte 0x02039b4c +_080BDEE0: .4byte 0x0000061c +_080BDEE4: .4byte 0x02020630 +_080BDEE8: + ldr r1, _080BDF3C + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDEFC: + ldr r0, _080BDF40 + movs r1, 0x28 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BDF44 + ldr r0, [r0] + ldr r1, _080BDF48 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r2, _080BDF3C + adds r0, r2 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BE3E2 + .align 2, 0 +_080BDF3C: .4byte 0x02020630 +_080BDF40: .4byte 0x0855d224 +_080BDF44: .4byte 0x02039b4c +_080BDF48: .4byte 0x0000061c +_080BDF4C: + ldr r4, _080BE018 + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x28 + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x4C + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl obj_anim_image_start + ldr r4, _080BE01C + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x2D + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x37 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl obj_anim_image_start + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x51 + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x5B + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl obj_anim_image_start + movs r0, 0 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + mov r8, r0 + ldr r0, _080BE020 + movs r1, 0x28 + movs r2, 0x2D + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r1, r10 + adds r4, r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + beq _080BE024 + movs r0, 0x1 + mov r8, r0 + b _080BE030 + .align 2, 0 +_080BE018: .4byte 0x0855d1f4 +_080BE01C: .4byte 0x0855d20c +_080BE020: .4byte 0x0855d23c +_080BE024: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE030: + ldr r0, _080BE074 + movs r1, 0x30 + movs r2, 0x2D + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE060 + mov r1, r8 + cmp r1, 0 + beq _080BE07C +_080BE060: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080BE078 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BE090 + .align 2, 0 +_080BE074: .4byte 0x0855d23c +_080BE078: .4byte 0x02020630 +_080BE07C: + ldr r1, _080BE10C + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE090: + ldr r5, _080BE110 + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0x2D + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, _080BE10C + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + movs r0, 0 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0x37 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BE114 + ldr r0, [r0] + ldr r1, _080BE118 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + beq _080BE11C + movs r0, 0x1 + mov r8, r0 + b _080BE128 + .align 2, 0 +_080BE10C: .4byte 0x02020630 +_080BE110: .4byte 0x0855d23c +_080BE114: .4byte 0x02039b4c +_080BE118: .4byte 0x0000061a +_080BE11C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE128: + ldr r0, _080BE174 + movs r1, 0x30 + movs r2, 0x37 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BE178 + ldr r0, [r0] + ldr r1, _080BE17C + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE160 + mov r0, r8 + cmp r0, 0 + beq _080BE184 +_080BE160: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080BE180 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BE198 + .align 2, 0 +_080BE174: .4byte 0x0855d23c +_080BE178: .4byte 0x02039b4c +_080BE17C: .4byte 0x0000061a +_080BE180: .4byte 0x02020630 +_080BE184: + ldr r1, _080BE220 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE198: + ldr r5, _080BE224 + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0x37 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BE228 + ldr r0, [r0] + ldr r1, _080BE22C + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, _080BE220 + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + movs r0, 0x1 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0x51 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + beq _080BE230 + movs r1, 0x1 + mov r8, r1 + b _080BE23C + .align 2, 0 +_080BE220: .4byte 0x02020630 +_080BE224: .4byte 0x0855d23c +_080BE228: .4byte 0x02039b4c +_080BE22C: .4byte 0x0000061a +_080BE230: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE23C: + ldr r0, _080BE280 + movs r1, 0x30 + movs r2, 0x51 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE26C + mov r0, r8 + cmp r0, 0 + beq _080BE288 +_080BE26C: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080BE284 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BE29C + .align 2, 0 +_080BE280: .4byte 0x0855d23c +_080BE284: .4byte 0x02020630 +_080BE288: + ldr r1, _080BE318 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE29C: + ldr r5, _080BE31C + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0x51 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, _080BE318 + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + movs r1, 0 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0x5B + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BE320 + ldr r0, [r0] + ldr r1, _080BE324 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + cmp r5, 0 + beq _080BE328 + movs r0, 0x1 + mov r8, r0 + b _080BE334 + .align 2, 0 +_080BE318: .4byte 0x02020630 +_080BE31C: .4byte 0x0855d23c +_080BE320: .4byte 0x02039b4c +_080BE324: .4byte 0x0000061c +_080BE328: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE334: + ldr r0, _080BE380 + movs r1, 0x30 + movs r2, 0x5B + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BE384 + ldr r0, [r0] + ldr r1, _080BE388 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE36C + mov r0, r8 + cmp r0, 0 + beq _080BE390 +_080BE36C: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080BE38C + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + b _080BE3A4 + .align 2, 0 +_080BE380: .4byte 0x0855d23c +_080BE384: .4byte 0x02039b4c +_080BE388: .4byte 0x0000061c +_080BE38C: .4byte 0x02020630 +_080BE390: + ldr r1, _080BE400 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE3A4: + ldr r0, _080BE404 + movs r1, 0x38 + movs r2, 0x5B + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080BE408 + ldr r0, [r0] + ldr r1, _080BE40C + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r2, _080BE400 + adds r0, r2 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start +_080BE3E2: + ldr r0, _080BE410 + movs r1, 0x88 + movs r2, 0x60 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080BE400 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + b _080BE42C + .align 2, 0 +_080BE400: .4byte 0x02020630 +_080BE404: .4byte 0x0855d23c +_080BE408: .4byte 0x02039b4c +_080BE40C: .4byte 0x0000061c +_080BE410: .4byte 0x0855d254 +_080BE414: + ldr r0, _080BE444 + movs r1, 0x88 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 +_080BE42C: + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BE444: .4byte 0x0855d254 + thumb_func_end sub_80BDB7C + + thumb_func_start nullsub_38 +nullsub_38: @ 80BE448 + bx lr + thumb_func_end nullsub_38 + + thumb_func_start sub_80BE44C +sub_80BE44C: @ 80BE44C + push {lr} + adds r1, r0, 0 + ldr r0, _080BE468 + ldr r0, [r0] + ldr r2, _080BE46C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE464 + adds r0, r1, 0 + bl obj_delete_and_free_tiles +_080BE464: + pop {r0} + bx r0 + .align 2, 0 +_080BE468: .4byte 0x02039b4c +_080BE46C: .4byte 0x0000064a + thumb_func_end sub_80BE44C + + thumb_func_start sub_80BE470 +sub_80BE470: @ 80BE470 + push {lr} + adds r2, r0, 0 + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x5] + ldrb r1, [r2, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1] + movs r0, 0 + strh r0, [r2, 0x24] + strh r0, [r2, 0x26] + ldr r1, [r2, 0x20] + ldr r0, _080BE4D0 + cmp r1, r0 + beq _080BE4D4 + ldrh r1, [r2, 0x20] + movs r3, 0x20 + ldrsh r0, [r2, r3] + cmp r0, 0x30 + ble _080BE4A4 + subs r0, r1, 0x1 + strh r0, [r2, 0x20] +_080BE4A4: + ldrh r1, [r2, 0x20] + movs r3, 0x20 + ldrsh r0, [r2, r3] + cmp r0, 0x2F + bgt _080BE4B2 + adds r0, r1, 0x1 + strh r0, [r2, 0x20] +_080BE4B2: + ldrh r1, [r2, 0x22] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r0, 0x38 + ble _080BE4C0 + subs r0, r1, 0x1 + strh r0, [r2, 0x22] +_080BE4C0: + ldrh r1, [r2, 0x22] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r0, 0x37 + bgt _080BE4D8 + adds r0, r1, 0x1 + strh r0, [r2, 0x22] + b _080BE4D8 + .align 2, 0 +_080BE4D0: .4byte 0x00380030 +_080BE4D4: + ldr r0, _080BE4DC + str r0, [r2, 0x1C] +_080BE4D8: + pop {r0} + bx r0 + .align 2, 0 +_080BE4DC: .4byte nullsub_38 + 1 + thumb_func_end sub_80BE470 + + thumb_func_start sub_80BE4E0 +sub_80BE4E0: @ 80BE4E0 + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _080BE514 + ldr r1, [r7] + ldr r2, _080BE518 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE520 + cmp r0, 0x3 + beq _080BE520 + lsls r5, r6, 1 + ldr r4, _080BE51C + adds r0, r1, r4 + adds r0, r5 + ldrh r0, [r0] + bl sub_818D820 + ldr r0, [r7] + adds r0, r4 + adds r0, r5 + b _080BE5EC + .align 2, 0 +_080BE514: .4byte 0x02039b4c +_080BE518: .4byte 0x0000064a +_080BE51C: .4byte 0x0000061e +_080BE520: + ldr r2, _080BE5AC + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r0, 23 + adds r0, r2 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0x4C + muls r0, r1 + cmp r0, 0 + bge _080BE538 + adds r0, 0xFF +_080BE538: + asrs r0, 8 + strh r0, [r4, 0x26] + movs r1, 0x38 + ldrsh r0, [r4, r1] + adds r0, 0x40 + lsls r0, 1 + adds r0, r2 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r2, r0, 0 + ldr r0, _080BE5B0 + cmp r2, r0 + bls _080BE55C + adds r2, r0, 0 +_080BE55C: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x80 + lsls r1, 1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + adds r1, r6, 0x1 + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrh r0, [r4, 0x38] + adds r0, 0x3F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7E + bhi _080BE5B4 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + movs r0, 0x1 + strh r0, [r4, 0x2E] + b _080BE5C0 + .align 2, 0 +_080BE5AC: .4byte 0x08329f40 +_080BE5B0: .4byte 0x0000ffff +_080BE5B4: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080BE5C0: + ldrh r0, [r4, 0x38] + adds r0, 0x3F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7E + bls _080BE5F0 + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080BE5F0 + ldr r5, _080BE5F8 + ldr r0, [r5] + lsls r6, 1 + ldr r4, _080BE5FC + adds r0, r4 + adds r0, r6 + ldrh r0, [r0] + bl sub_818D820 + ldr r0, [r5] + adds r0, r4 + adds r0, r6 +_080BE5EC: + ldr r1, _080BE600 + strh r1, [r0] +_080BE5F0: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BE5F8: .4byte 0x02039b4c +_080BE5FC: .4byte 0x0000061e +_080BE600: .4byte 0x0000ffff + thumb_func_end sub_80BE4E0 + + thumb_func_start sub_80BE604 +sub_80BE604: @ 80BE604 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _080BE624 + ldr r0, [r1] + ldr r2, _080BE628 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE62C + cmp r0, 0x3 + beq _080BE62C + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _080BE648 + .align 2, 0 +_080BE624: .4byte 0x02039b4c +_080BE628: .4byte 0x0000064a +_080BE62C: + ldr r2, [r1] + ldr r1, _080BE650 + adds r0, r2, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 3 + ldr r1, _080BE654 + adds r2, r1 + ldrh r1, [r2] + subs r1, 0x1 + bl __divsi3 + strh r0, [r4, 0x26] +_080BE648: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BE650: .4byte 0x0000060e +_080BE654: .4byte 0x0000060c + thumb_func_end sub_80BE604 + + thumb_func_start sub_80BE658 +sub_80BE658: @ 80BE658 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r1, _080BE678 + ldr r0, [r1] + ldr r2, _080BE67C + adds r0, r2 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _080BE680 + cmp r0, 0x3 + beq _080BE680 + adds r0, r3, 0 + bl obj_delete_and_free_tiles + b _080BE750 + .align 2, 0 +_080BE678: .4byte 0x02039b4c +_080BE67C: .4byte 0x0000064a +_080BE680: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080BE6C2 + ldr r0, [r5] + ldr r2, _080BE6A8 + adds r1, r0, r2 + ldrh r1, [r1] + subs r2, 0x2 + adds r0, r2 + ldrh r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080BE6AC + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _080BE6B8 + .align 2, 0 +_080BE6A8: .4byte 0x0000060e +_080BE6AC: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_080BE6B8: + strb r1, [r0] + adds r2, r0, 0 + ldrh r1, [r3, 0x32] + lsls r0, r1, 24 + b _080BE6F8 +_080BE6C2: + ldr r0, [r5] + ldr r1, _080BE6DC + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080BE6E0 + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _080BE6EC + .align 2, 0 +_080BE6DC: .4byte 0x0000060e +_080BE6E0: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_080BE6EC: + strb r1, [r0] + adds r2, r0, 0 + ldrh r1, [r3, 0x32] + adds r0, r1, 0 + subs r0, 0x80 + lsls r0, 24 +_080BE6F8: + lsrs r0, 24 + adds r4, r1, 0 + ldr r1, _080BE740 + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080BE70C + adds r0, 0x3F +_080BE70C: + asrs r0, 6 + strh r0, [r3, 0x26] + adds r0, r4, 0 + adds r0, 0x8 + strh r0, [r3, 0x32] + ldr r1, [r5] + ldr r3, _080BE744 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080BE748 + adds r3, 0x3 + adds r0, r1, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080BE748 + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080BE748 + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + b _080BE74E + .align 2, 0 +_080BE740: .4byte 0x08329f40 +_080BE744: .4byte 0x0000064f +_080BE748: + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 +_080BE74E: + strb r0, [r2] +_080BE750: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80BE658 + + thumb_func_start sub_80BE758 +sub_80BE758: @ 80BE758 + push {lr} + adds r1, r0, 0 + ldr r0, _080BE778 + ldr r0, [r0] + ldr r2, _080BE77C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE774 + cmp r0, 0x3 + beq _080BE774 + adds r0, r1, 0 + bl obj_delete_and_free_tiles +_080BE774: + pop {r0} + bx r0 + .align 2, 0 +_080BE778: .4byte 0x02039b4c +_080BE77C: .4byte 0x0000064a + thumb_func_end sub_80BE758 + + thumb_func_start sub_80BE780 +sub_80BE780: @ 80BE780 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r1, _080BE7A4 + ldr r0, [r1] + ldr r2, _080BE7A8 + adds r0, r2 + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0 + beq _080BE7AC + cmp r0, 0x3 + beq _080BE7AC + adds r0, r6, 0 + bl obj_delete_and_free_tiles + b _080BE824 + .align 2, 0 +_080BE7A4: .4byte 0x02039b4c +_080BE7A8: .4byte 0x0000064a +_080BE7AC: + ldr r0, [r7] + ldr r5, _080BE82C + adds r0, r5 + ldrb r1, [r0] + ldrh r0, [r6, 0x30] + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r4, _080BE830 + lsls r0, r1, 1 + adds r0, r4 + ldrh r3, [r0] + adds r1, 0x40 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r6, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r1] + lsls r3, 16 + lsrs r2, r3, 16 + negs r3, r3 + lsrs r3, 16 + str r1, [sp] + bl rotscale_set_direct + ldr r1, [r7] + adds r1, r5 + ldrh r0, [r6, 0x30] + adds r0, 0x40 + ldrb r1, [r1] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r4 + ldrh r3, [r1] + adds r0, 0x40 + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _080BE80C + adds r0, 0xFF +_080BE80C: + asrs r0, 8 + strh r0, [r6, 0x24] + lsls r1, r3, 16 + asrs r1, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _080BE820 + adds r0, 0xFF +_080BE820: + asrs r0, 8 + strh r0, [r6, 0x26] +_080BE824: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BE82C: .4byte 0x0000062c +_080BE830: .4byte 0x08329f40 + thumb_func_end sub_80BE780 + + thumb_func_start sub_80BE834 +sub_80BE834: @ 80BE834 + push {r4,lr} + adds r3, r0, 0 + ldr r1, _080BE854 + ldr r0, [r1] + ldr r2, _080BE858 + adds r0, r2 + ldrb r2, [r0] + cmp r2, 0 + beq _080BE85C + cmp r2, 0x3 + beq _080BE85C + adds r0, r3, 0 + bl obj_delete_and_free_tiles + b _080BE8D4 + .align 2, 0 +_080BE854: .4byte 0x02039b4c +_080BE858: .4byte 0x0000064a +_080BE85C: + ldr r4, [r1] + ldr r1, _080BE8BC + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x60 + cmp r0, 0 + bne _080BE86C + movs r1, 0x50 +_080BE86C: + ldr r2, _080BE8C0 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE8C8 + adds r2, 0x3 + adds r0, r4, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r1 + bne _080BE8C8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0xCA + lsls r1, 3 + adds r0, r4, r1 + ldrh r0, [r0] + lsls r0, 4 + strh r0, [r3, 0x26] + ldr r1, _080BE8C4 + ldrh r2, [r3, 0x32] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080BE8B0 + adds r0, 0x3F +_080BE8B0: + asrs r0, 6 + strh r0, [r3, 0x24] + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r3, 0x32] + b _080BE8D4 + .align 2, 0 +_080BE8BC: .4byte 0x0000064a +_080BE8C0: .4byte 0x0000064f +_080BE8C4: .4byte 0x08329f40 +_080BE8C8: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE8D4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80BE834 + + thumb_func_start sub_80BE8DC +sub_80BE8DC: @ 80BE8DC + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + add r1, sp, 0x14 + movs r4, 0 + strb r4, [r1] + adds r2, r1, 0 + movs r1, 0xF + strb r1, [r2, 0x1] + movs r1, 0x3 + strb r1, [r2, 0x2] + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + subs r1, 0x4 + str r1, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl sub_8199EEC + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80BE8DC + + thumb_func_start sub_80BE91C +sub_80BE91C: @ 80BE91C + push {r4,r5,lr} + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, _080BE9B0 + str r0, [r1] + ldr r0, _080BE9B4 + movs r1, 0 + bl AddTask + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _080BE9B8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x8] + movs r1, 0x1 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + strh r4, [r0, 0x10] + movs r1, 0xFF + strh r1, [r0, 0x12] + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080BE9BC + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x3 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x2 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + ldr r0, _080BE9C0 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080BE9B0: .4byte 0x02039b54 +_080BE9B4: .4byte sub_80BEA24 + 1 +_080BE9B8: .4byte 0x03005e00 +_080BE9BC: .4byte 0x0856e630 +_080BE9C0: .4byte 0x0856e640 + thumb_func_end sub_80BE91C + + thumb_func_start sub_80BE9C4 +sub_80BE9C4: @ 80BE9C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080BE9E8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080BE9F0 + ldr r1, [r1] + ldr r0, _080BE9EC + cmp r1, r0 + bne _080BE9F0 + movs r0, 0 + b _080BE9F2 + .align 2, 0 +_080BE9E8: .4byte 0x03005e00 +_080BE9EC: .4byte sub_80BEDF4 + 1 +_080BE9F0: + movs r0, 0x1 +_080BE9F2: + pop {r1} + bx r1 + thumb_func_end sub_80BE9C4 + + thumb_func_start sub_80BE9F8 +sub_80BE9F8: @ 80BE9F8 + adds r2, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + ldr r1, _080BEA1C + str r2, [r1] + ldr r2, _080BEA20 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + movs r2, 0x1 + strh r2, [r1, 0x8] + strh r3, [r1, 0xA] + strh r3, [r1, 0xC] + strh r3, [r1, 0xE] + bx lr + .align 2, 0 +_080BEA1C: .4byte 0x02039b54 +_080BEA20: .4byte 0x03005e00 + thumb_func_end sub_80BE9F8 + + thumb_func_start sub_80BEA24 +sub_80BEA24: @ 80BEA24 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080BEA48 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0xA + bhi _080BEA7C + lsls r0, 2 + ldr r1, _080BEA4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BEA48: .4byte 0x030022c0 +_080BEA4C: .4byte _080BEA50 + .align 2, 0 +_080BEA50: + .4byte _080BEA7C + .4byte _080BEAF0 + .4byte _080BEB50 + .4byte _080BEB90 + .4byte _080BEB98 + .4byte _080BEC08 + .4byte _080BEC60 + .4byte _080BECBC + .4byte _080BED04 + .4byte _080BED5E + .4byte _080BED7C +_080BEA7C: + ldr r0, _080BEADC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BEA8A + b _080BEDA0 +_080BEA8A: + ldr r0, _080BEAE0 + ldr r0, [r0] + ldr r3, _080BEAE4 + adds r0, r3 + movs r6, 0x1 + strb r6, [r0] + ldr r1, _080BEAE8 + ldr r0, [r5, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r2, 0 + ldr r1, _080BEAEC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BEABA + movs r2, 0x80 + lsls r2, 5 +_080BEABA: + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BEACA + movs r1, 0x80 + lsls r1, 2 + adds r0, r1, 0 + orrs r2, r0 +_080BEACA: + adds r0, r2, 0 + bl sub_80C09B0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r5, r2 + strb r6, [r0] + b _080BEDA0 + .align 2, 0 +_080BEADC: .4byte 0x02037fd4 +_080BEAE0: .4byte 0x02039b4c +_080BEAE4: .4byte 0x0000064a +_080BEAE8: .4byte 0x030060b4 +_080BEAEC: .4byte 0x03005e00 +_080BEAF0: + ldr r1, _080BEB40 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _080BEB44 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r0, _080BEB48 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0x1 + bl sub_80C0D30 + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + ldr r1, _080BEB4C + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .align 2, 0 +_080BEB40: .4byte 0x08dc1934 +_080BEB44: .4byte 0x08dc3080 +_080BEB48: .4byte 0x02039b54 +_080BEB4C: .4byte 0x030022c0 +_080BEB50: + movs r0, 0xD + bl sub_80BFCDC + ldr r4, _080BEB80 + ldr r0, [r4] + ldr r1, _080BEB84 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0xD + bl sub_80BFD0C + ldr r0, [r4] + ldr r2, _080BEB88 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + ldr r1, _080BEB8C + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .align 2, 0 +_080BEB80: .4byte 0x02039b4c +_080BEB84: .4byte 0x0000064d +_080BEB88: .4byte 0x0000064c +_080BEB8C: .4byte 0x030022c0 +_080BEB90: + movs r0, 0x87 + lsls r0, 3 + adds r1, r5, r0 + b _080BED70 +_080BEB98: + ldr r4, _080BEBF4 + ldr r3, [r4] + ldrh r0, [r3] + ldr r1, _080BEBF8 + ldr r1, [r1] + ldr r2, _080BEBFC + adds r1, r2 + ldrh r2, [r1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + ldr r2, [r3] + lsls r2, 14 + lsrs r2, 31 + movs r3, 0 + bl sub_80C020C + ldr r0, [r4] + ldrb r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080BEBD0 + ldr r0, _080BEC00 + movs r1, 0x31 + movs r2, 0x1E + bl gpu_pal_apply +_080BEBD0: + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, _080BEC04 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .align 2, 0 +_080BEBF4: .4byte 0x02039b54 +_080BEBF8: .4byte 0x02039b4c +_080BEBFC: .4byte 0x00000612 +_080BEC00: .4byte 0x02037716 +_080BEC04: .4byte 0x030022c0 +_080BEC08: + ldr r0, _080BEC50 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080BEC44 + ldr r0, _080BEC54 + ldr r0, [r0] + ldrh r0, [r0] + movs r1, 0x30 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0E9C + strh r0, [r4, 0x10] + ldr r2, _080BEC58 + movs r3, 0x10 + ldrsh r0, [r4, r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_080BEC44: + ldr r1, _080BEC5C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BED70 + .align 2, 0 +_080BEC50: .4byte 0x03005e00 +_080BEC54: .4byte 0x02039b54 +_080BEC58: .4byte 0x02020630 +_080BEC5C: .4byte 0x030022c0 +_080BEC60: + movs r3, 0 + ldr r0, _080BECB0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080BEC76 + movs r3, 0x14 +_080BEC76: + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080BEC98 + ldr r2, _080BECB4 + movs r0, 0x10 + ldrsh r1, [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 + orrs r3, r0 +_080BEC98: + mvns r0, r3 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080BECB8 + ldr r0, [r0] + bl SetVBlankCallback + b _080BED68 + .align 2, 0 +_080BECB0: .4byte 0x03005e00 +_080BECB4: .4byte 0x02020630 +_080BECB8: .4byte 0x030060b4 +_080BECBC: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r1, _080BED00 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .align 2, 0 +_080BED00: .4byte 0x030022c0 +_080BED04: + ldr r0, _080BED4C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BEDA0 + movs r0, 0x87 + lsls r0, 3 + adds r2, r5, r0 + ldrb r0, [r2] + adds r3, r0, 0x1 + strb r3, [r2] + ldr r1, _080BED50 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080BED58 + bl sub_80A369C + ldr r0, _080BED54 + ldr r0, [r0] + ldrh r0, [r0] + bl poke_something_2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + b _080BEDA0 + .align 2, 0 +_080BED4C: .4byte 0x02037fd4 +_080BED50: .4byte 0x03005e00 +_080BED54: .4byte 0x02039b54 +_080BED58: + adds r0, r3, 0x1 + strb r0, [r2] + b _080BEDA0 +_080BED5E: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _080BEDA0 +_080BED68: + ldr r1, _080BED78 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080BED70: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BEDA0 + .align 2, 0 +_080BED78: .4byte 0x030022c0 +_080BED7C: + ldr r1, _080BEDA8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + ldr r1, _080BEDAC + str r1, [r0] + movs r3, 0x87 + lsls r3, 3 + adds r0, r5, r3 + strb r2, [r0] +_080BEDA0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080BEDA8: .4byte 0x03005e00 +_080BEDAC: .4byte sub_80BEDF4 + 1 + thumb_func_end sub_80BEA24 + + thumb_func_start sub_80BEDB0 +sub_80BEDB0: @ 80BEDB0 + push {lr} + bl Window_FreeMemory + movs r0, 0 + bl bg_get_tilemap + cmp r0, 0 + beq _080BEDC4 + bl free +_080BEDC4: + movs r0, 0x1 + bl bg_get_tilemap + cmp r0, 0 + beq _080BEDD2 + bl free +_080BEDD2: + movs r0, 0x2 + bl bg_get_tilemap + cmp r0, 0 + beq _080BEDE0 + bl free +_080BEDE0: + movs r0, 0x3 + bl bg_get_tilemap + cmp r0, 0 + beq _080BEDEE + bl free +_080BEDEE: + pop {r0} + bx r0 + thumb_func_end sub_80BEDB0 + + thumb_func_start sub_80BEDF4 +sub_80BEDF4: @ 80BEDF4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080BEE2C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _080BEE34 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BEE30 + str r0, [r4] + movs r0, 0x6C + bl audio_play + b _080BEFBA + .align 2, 0 +_080BEE2C: .4byte 0x03005e00 +_080BEE30: .4byte sub_80BF038 + 1 +_080BEE34: + ldr r1, _080BEE4C + ldrh r2, [r1, 0x2E] + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080BEE50 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + b _080BEF0E + .align 2, 0 +_080BEE4C: .4byte 0x030022c0 +_080BEE50: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080BEF28 + ldr r5, _080BEE70 + ldr r0, [r5] + ldr r1, _080BEE74 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0x1 + beq _080BEEA0 + cmp r1, 0x1 + bgt _080BEE78 + cmp r1, 0 + beq _080BEE82 + b _080BEFBA + .align 2, 0 +_080BEE70: .4byte 0x02039b4c +_080BEE74: .4byte 0x0000064d +_080BEE78: + cmp r1, 0x2 + beq _080BEEC0 + cmp r1, 0x3 + beq _080BEF08 + b _080BEFBA +_080BEE82: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, [r5] + ldr r3, _080BEE9C + adds r0, r3 + movs r1, 0x1 + b _080BEEF0 + .align 2, 0 +_080BEE9C: .4byte 0x0000064e +_080BEEA0: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, [r5] + ldr r1, _080BEEBC + adds r0, r1 + movs r1, 0x2 + b _080BEEF0 + .align 2, 0 +_080BEEBC: .4byte 0x0000064e +_080BEEC0: + ldr r0, _080BEED4 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + ands r1, r0 + cmp r1, 0 + bne _080BEED8 + movs r0, 0x20 + bl audio_play + b _080BEFBA + .align 2, 0 +_080BEED4: .4byte 0x02039b54 +_080BEED8: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, [r5] + ldr r3, _080BEF00 + adds r0, r3 + movs r1, 0x3 +_080BEEF0: + strb r1, [r0] + ldr r0, _080BEF04 + str r0, [r4] + movs r0, 0x15 + bl audio_play + b _080BEFBA + .align 2, 0 +_080BEF00: .4byte 0x0000064e +_080BEF04: .4byte sub_80BEFD0 + 1 +_080BEF08: + movs r0, 0x1 + negs r0, r0 + str r3, [sp] +_080BEF0E: + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BEF24 + str r0, [r4] + movs r0, 0x3 + bl audio_play + b _080BEFBA + .align 2, 0 +_080BEF24: .4byte sub_80BF070 + 1 +_080BEF28: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080BEF44 + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _080BEF78 + ldr r0, _080BEF6C + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BEF78 +_080BEF44: + ldr r3, _080BEF70 + ldr r0, [r3] + ldr r4, _080BEF74 + adds r2, r0, r4 + ldrb r0, [r2] + cmp r0, 0 + beq _080BEF78 + subs r0, 0x1 + strb r0, [r2] + ldr r0, [r3] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0xD + bl sub_80BFD0C + movs r0, 0x6D + bl audio_play + b _080BEFBA + .align 2, 0 +_080BEF6C: .4byte 0x03005d90 +_080BEF70: .4byte 0x02039b4c +_080BEF74: .4byte 0x0000064d +_080BEF78: + ldrh r1, [r1, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080BEF96 + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080BEFBA + ldr r0, _080BEFC4 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BEFBA +_080BEF96: + ldr r2, _080BEFC8 + ldr r0, [r2] + ldr r3, _080BEFCC + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _080BEFBA + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + movs r1, 0xD + bl sub_80BFD0C + movs r0, 0x6D + bl audio_play +_080BEFBA: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BEFC4: .4byte 0x03005d90 +_080BEFC8: .4byte 0x02039b4c +_080BEFCC: .4byte 0x0000064d + thumb_func_end sub_80BEDF4 + + thumb_func_start sub_80BEFD0 +sub_80BEFD0: @ 80BEFD0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BF00C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF02C + ldr r1, _080BF010 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldr r0, _080BF014 + ldr r0, [r0] + ldr r1, _080BF018 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080BF020 + cmp r0, 0x2 + ble _080BF008 + cmp r0, 0x3 + beq _080BF028 +_080BF008: + ldr r0, _080BF01C + b _080BF02A + .align 2, 0 +_080BF00C: .4byte 0x02037fd4 +_080BF010: .4byte 0x03005e00 +_080BF014: .4byte 0x02039b4c +_080BF018: .4byte 0x0000064e +_080BF01C: .4byte sub_80BF0AC + 1 +_080BF020: + ldr r0, _080BF024 + b _080BF02A + .align 2, 0 +_080BF024: .4byte sub_80BF250 + 1 +_080BF028: + ldr r0, _080BF034 +_080BF02A: + str r0, [r4] +_080BF02C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BF034: .4byte sub_80BF82C + 1 + thumb_func_end sub_80BEFD0 + + thumb_func_start sub_80BF038 +sub_80BF038: @ 80BF038 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BF064 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF05E + ldr r0, _080BF068 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldr r0, _080BF06C + str r0, [r4] +_080BF05E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BF064: .4byte 0x02037fd4 +_080BF068: .4byte 0x03005e00 +_080BF06C: .4byte sub_80BEA24 + 1 + thumb_func_end sub_80BF038 + + thumb_func_start sub_80BF070 +sub_80BF070: @ 80BF070 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BF0A4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF09C + ldr r0, _080BF0A8 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + bl sub_818D820 + bl sub_80BEDB0 + adds r0, r4, 0 + bl remove_task +_080BF09C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BF0A4: .4byte 0x02037fd4 +_080BF0A8: .4byte 0x03005e00 + thumb_func_end sub_80BF070 + + thumb_func_start sub_80BF0AC +sub_80BF0AC: @ 80BF0AC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _080BF108 + movs r0, 0x87 + lsls r0, 3 + adds r7, r2, r0 + ldrb r0, [r7] + cmp r0, 0x1 + beq _080BF120 + cmp r0, 0x1 + ble _080BF0C8 + cmp r0, 0x2 + beq _080BF15C +_080BF0C8: + ldr r0, _080BF10C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080BF196 + ldr r4, _080BF110 + ldr r0, [r4] + ldr r1, _080BF114 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + ldr r1, _080BF118 + ldr r0, [r2, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 2 + bl sub_80C09B0 + ldr r0, [r4] + ldr r1, _080BF11C + adds r0, r1 + strb r5, [r0] + movs r0, 0x1 + strb r0, [r7] + b _080BF196 + .align 2, 0 +_080BF108: .4byte 0x030022c0 +_080BF10C: .4byte 0x02037fd4 +_080BF110: .4byte 0x02039b4c +_080BF114: .4byte 0x0000064a +_080BF118: .4byte 0x030060b4 +_080BF11C: .4byte 0x0000064d +_080BF120: + movs r0, 0xD + bl sub_80BFCF4 + movs r0, 0 + movs r1, 0xD + bl sub_80BFD7C + ldr r0, _080BF154 + ldr r0, [r0] + ldr r1, _080BF158 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + movs r1, 0xD0 + lsls r1, 4 + movs r0, 0xA + bl lcd_io_set + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _080BF196 + .align 2, 0 +_080BF154: .4byte 0x02039b4c +_080BF158: .4byte 0x0000064c +_080BF15C: + ldr r0, _080BF19C + ldr r0, [r0] + ldrh r0, [r0] + bl poke_something_2 + lsls r0, 16 + lsrs r0, 16 + ldr r5, _080BF1A0 + ldr r1, [r5] + ldr r4, _080BF1A4 + adds r1, r4 + bl sub_813D3D8 + ldr r0, _080BF1A8 + ldr r0, [r0] + bl SetVBlankCallback + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + strb r1, [r0] + strb r1, [r7] + ldr r1, _080BF1AC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BF1B0 + str r1, [r0] +_080BF196: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BF19C: .4byte 0x02039b54 +_080BF1A0: .4byte 0x02039b4c +_080BF1A4: .4byte 0x0000064e +_080BF1A8: .4byte 0x030060b4 +_080BF1AC: .4byte 0x03005e00 +_080BF1B0: .4byte sub_80BF1B4 + 1 + thumb_func_end sub_80BF0AC + + thumb_func_start sub_80BF1B4 +sub_80BF1B4: @ 80BF1B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BF1DC + ldr r0, [r0] + ldr r1, _080BF1E0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080BF1D6 + ldr r0, _080BF1E4 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BF1E8 + str r0, [r1] +_080BF1D6: + pop {r0} + bx r0 + .align 2, 0 +_080BF1DC: .4byte 0x02039b4c +_080BF1E0: .4byte 0x0000064e +_080BF1E4: .4byte 0x03005e00 +_080BF1E8: .4byte sub_80BF1EC + 1 + thumb_func_end sub_80BF1B4 + + thumb_func_start sub_80BF1EC +sub_80BF1EC: @ 80BF1EC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BF220 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF242 + ldr r0, _080BF224 + ldr r0, [r0] + ldr r1, _080BF228 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080BF210 + cmp r0, 0x2 + beq _080BF234 +_080BF210: + ldr r0, _080BF22C + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BF230 + b _080BF240 + .align 2, 0 +_080BF220: .4byte 0x02037fd4 +_080BF224: .4byte 0x02039b4c +_080BF228: .4byte 0x0000064e +_080BF22C: .4byte 0x03005e00 +_080BF230: .4byte sub_80BEA24 + 1 +_080BF234: + ldr r0, _080BF248 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080BF24C +_080BF240: + str r0, [r1] +_080BF242: + pop {r0} + bx r0 + .align 2, 0 +_080BF248: .4byte 0x03005e00 +_080BF24C: .4byte sub_80BF250 + 1 + thumb_func_end sub_80BF1EC + + thumb_func_start sub_80BF250 +sub_80BF250: @ 80BF250 + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080BF274 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xA + bhi _080BF2A8 + lsls r0, 2 + ldr r1, _080BF278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BF274: .4byte 0x030022c0 +_080BF278: .4byte _080BF27C + .align 2, 0 +_080BF27C: + .4byte _080BF2A8 + .4byte _080BF310 + .4byte _080BF360 + .4byte _080BF38C + .4byte _080BF3A0 + .4byte _080BF3D0 + .4byte _080BF41C + .4byte _080BF498 + .4byte _080BF514 + .4byte _080BF540 + .4byte _080BF590 +_080BF2A8: + ldr r0, _080BF2F4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BF2B6 + b _080BF5B2 +_080BF2B6: + ldr r0, _080BF2F8 + bl MPlayStop_rev01 + ldr r5, _080BF2FC + ldr r0, [r5] + ldr r3, _080BF300 + adds r0, r3 + movs r1, 0x6 + strb r1, [r0] + ldr r1, _080BF304 + ldr r4, _080BF308 + ldr r0, [r4, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 2 + bl sub_80C09B0 + ldr r0, [r5] + ldr r1, _080BF30C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r2, 0x87 + lsls r2, 3 + adds r4, r2 + strb r1, [r4] + b _080BF5B2 + .align 2, 0 +_080BF2F4: .4byte 0x02037fd4 +_080BF2F8: .4byte 0x03007420 +_080BF2FC: .4byte 0x02039b4c +_080BF300: .4byte 0x0000064a +_080BF304: .4byte 0x030060b4 +_080BF308: .4byte 0x030022c0 +_080BF30C: .4byte 0x0000064d +_080BF310: + ldr r1, _080BF354 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _080BF358 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + ldr r1, _080BF35C + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BF582 + .align 2, 0 +_080BF354: .4byte 0x08dc1934 +_080BF358: .4byte 0x08dc3198 +_080BF35C: .4byte 0x030022c0 +_080BF360: + movs r0, 0xD + bl sub_80BFCF4 + movs r0, 0x1 + movs r1, 0xD + bl sub_80BFD7C + ldr r0, _080BF384 + ldr r0, [r0] + ldr r4, _080BF388 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + b _080BF57A + .align 2, 0 +_080BF384: .4byte 0x02039b4c +_080BF388: .4byte 0x0000064c +_080BF38C: + bl sub_80A1A74 + ldr r1, _080BF39C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080BF582 + .align 2, 0 +_080BF39C: .4byte 0x030022c0 +_080BF3A0: + ldr r0, _080BF3C4 + movs r1, 0x52 + movs r2, 0x21 + bl sub_80BE8DC + ldr r0, _080BF3C8 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0 + movs r2, 0x52 + movs r3, 0x31 + bl sub_80C0B44 + ldr r1, _080BF3CC + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BF582 + .align 2, 0 +_080BF3C4: .4byte 0x085e871b +_080BF3C8: .4byte 0x02039b54 +_080BF3CC: .4byte 0x030022c0 +_080BF3D0: + ldr r0, _080BF40C + ldr r0, [r0] + ldrh r0, [r0] + movs r1, 0x30 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0E9C + ldr r2, _080BF410 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + strh r0, [r1, 0x10] + ldr r2, _080BF414 + movs r4, 0x10 + ldrsh r0, [r1, r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, _080BF418 + strb r3, [r0] + b _080BF57A + .align 2, 0 +_080BF40C: .4byte 0x02039b54 +_080BF410: .4byte 0x03005e00 +_080BF414: .4byte 0x02020630 +_080BF418: .4byte 0x030061ec +_080BF41C: + ldr r1, _080BF478 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, _080BF47C + orrs r0, r1 + ldr r1, _080BF480 + ands r0, r1 + movs r1, 0xF8 + lsls r1, 13 + orrs r0, r1 + ldr r1, _080BF484 + ands r0, r1 + movs r1, 0x80 + lsls r1, 20 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r1, _080BF488 + ldr r0, [sp, 0x8] + ands r0, r1 + movs r1, 0xF0 + lsls r1, 5 + orrs r0, r1 + ldr r1, _080BF48C + ands r0, r1 + movs r1, 0xC + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + movs r1, 0x2 + bl sub_8145354 + lsls r0, 24 + cmp r0, 0 + bne _080BF462 + b _080BF5B2 +_080BF462: + ldr r1, _080BF490 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, _080BF494 + strb r2, [r0] + b _080BF5B2 + .align 2, 0 +_080BF478: .4byte 0xffff0000 +_080BF47C: .4byte 0x00004020 +_080BF480: .4byte 0xff00ffff +_080BF484: .4byte 0x00ffffff +_080BF488: .4byte 0xffff00ff +_080BF48C: .4byte 0xffffff00 +_080BF490: .4byte 0x030022c0 +_080BF494: .4byte 0x030061ec +_080BF498: + ldr r1, _080BF504 + ldr r0, [sp, 0xC] + ands r0, r1 + movs r1, 0x90 + lsls r1, 20 + orrs r0, r1 + str r0, [sp, 0xC] + ldr r2, _080BF508 + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r2 + movs r2, 0x12 + orrs r1, r2 + ldr r2, _080BF50C + ands r1, r2 + movs r2, 0xC0 + lsls r2, 2 + orrs r1, r2 + str r1, [r0, 0x4] + movs r1, 0x3 + bl sub_8145850 + lsls r0, 24 + cmp r0, 0 + beq _080BF4D8 + ldr r1, _080BF510 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080BF4D8: + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080BF5B2 + .align 2, 0 +_080BF504: .4byte 0x00ffffff +_080BF508: .4byte 0xffffff00 +_080BF50C: .4byte 0xffff00ff +_080BF510: .4byte 0x030022c0 +_080BF514: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080BF538 + ldr r0, [r0] + bl SetVBlankCallback + ldr r1, _080BF53C + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _080BF582 + .align 2, 0 +_080BF538: .4byte 0x030060b4 +_080BF53C: .4byte 0x030022c0 +_080BF540: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_080BF57A: + ldr r1, _080BF58C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080BF582: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BF5B2 + .align 2, 0 +_080BF58C: .4byte 0x030022c0 +_080BF590: + ldr r0, _080BF5BC + ldr r0, [r0] + ldr r1, _080BF5C0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r3, 0x87 + lsls r3, 3 + adds r0, r2, r3 + strb r1, [r0] + ldr r1, _080BF5C4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BF5C8 + str r1, [r0] +_080BF5B2: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BF5BC: .4byte 0x02039b4c +_080BF5C0: .4byte 0x0000064e +_080BF5C4: .4byte 0x03005e00 +_080BF5C8: .4byte sub_80BF5CC + 1 + thumb_func_end sub_80BF250 + + thumb_func_start sub_80BF5CC +sub_80BF5CC: @ 80BF5CC + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + bl sub_814545C + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + beq _080BF5EC + movs r0, 0x1 + bl sub_80BF7FC + b _080BF5F2 +_080BF5EC: + movs r0, 0 + bl sub_80BF7FC +_080BF5F2: + ldr r1, _080BF61C + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + adds r5, r1, 0 + cmp r0, 0 + beq _080BF624 + movs r0, 0x1 + bl sub_80BF7FC + ldr r0, _080BF620 + ldr r0, [r0] + ldrh r0, [r0] + bl poke_something_2 + lsls r0, 16 + lsrs r0, 16 + bl sub_8145534 + b _080BF772 + .align 2, 0 +_080BF61C: .4byte 0x030022c0 +_080BF620: .4byte 0x02039b54 +_080BF624: + ldr r0, _080BF67C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080BF636 + b _080BF772 +_080BF636: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080BF694 + movs r0, 0x15 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BF680 + bl m4aMPlayContinue + ldr r0, _080BF684 + ldr r0, [r0] + ldr r1, _080BF688 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _080BF68C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BF690 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BF772 + .align 2, 0 +_080BF67C: .4byte 0x02037fd4 +_080BF680: .4byte 0x03007420 +_080BF684: .4byte 0x02039b4c +_080BF688: .4byte 0x0000064e +_080BF68C: .4byte 0x03005e00 +_080BF690: .4byte sub_80BF790 + 1 +_080BF694: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080BF6B0 + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _080BF700 + ldr r0, _080BF6E8 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BF700 +_080BF6B0: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BF6EC + bl m4aMPlayContinue + ldr r0, _080BF6F0 + ldr r0, [r0] + ldr r1, _080BF6F4 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r1, _080BF6F8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BF6FC + str r1, [r0] + movs r0, 0x6D + bl audio_play + b _080BF772 + .align 2, 0 +_080BF6E8: .4byte 0x03005d90 +_080BF6EC: .4byte 0x03007420 +_080BF6F0: .4byte 0x02039b4c +_080BF6F4: .4byte 0x0000064e +_080BF6F8: .4byte 0x03005e00 +_080BF6FC: .4byte sub_80BF790 + 1 +_080BF700: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080BF71E + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080BF772 + ldr r0, _080BF734 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BF772 +_080BF71E: + ldr r0, _080BF738 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080BF73C + movs r0, 0x20 + bl audio_play + b _080BF772 + .align 2, 0 +_080BF734: .4byte 0x03005d90 +_080BF738: .4byte 0x02039b54 +_080BF73C: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BF77C + bl m4aMPlayContinue + ldr r0, _080BF780 + ldr r0, [r0] + ldr r1, _080BF784 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r1, _080BF788 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BF78C + str r1, [r0] + movs r0, 0x6D + bl audio_play +_080BF772: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BF77C: .4byte 0x03007420 +_080BF780: .4byte 0x02039b4c +_080BF784: .4byte 0x0000064e +_080BF788: .4byte 0x03005e00 +_080BF78C: .4byte sub_80BF790 + 1 + thumb_func_end sub_80BF5CC + + thumb_func_start sub_80BF790 +sub_80BF790: @ 80BF790 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080BF7D0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF7F0 + bl sub_8145914 + ldr r1, _080BF7D4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldr r0, _080BF7D8 + ldr r0, [r0] + ldr r1, _080BF7DC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080BF7E4 + cmp r0, 0x2 + ble _080BF7CC + cmp r0, 0x3 + beq _080BF7EC +_080BF7CC: + ldr r0, _080BF7E0 + b _080BF7EE + .align 2, 0 +_080BF7D0: .4byte 0x02037fd4 +_080BF7D4: .4byte 0x03005e00 +_080BF7D8: .4byte 0x02039b4c +_080BF7DC: .4byte 0x0000064e +_080BF7E0: .4byte sub_80BEA24 + 1 +_080BF7E4: + ldr r0, _080BF7E8 + b _080BF7EE + .align 2, 0 +_080BF7E8: .4byte sub_80BF0AC + 1 +_080BF7EC: + ldr r0, _080BF7F8 +_080BF7EE: + str r0, [r4] +_080BF7F0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BF7F8: .4byte sub_80BF82C + 1 + thumb_func_end sub_80BF790 + + thumb_func_start sub_80BF7FC +sub_80BF7FC: @ 80BF7FC + push {lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + beq _080BF810 + ldr r1, _080BF80C + b _080BF812 + .align 2, 0 +_080BF80C: .4byte 0x00000392 +_080BF810: + ldr r1, _080BF828 +_080BF812: + mov r0, sp + strh r1, [r0] + mov r0, sp + movs r1, 0x5D + movs r2, 0x2 + bl gpu_pal_apply + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080BF828: .4byte 0x000002af + thumb_func_end sub_80BF7FC + + thumb_func_start sub_80BF82C +sub_80BF82C: @ 80BF82C + push {r4-r7,lr} + sub sp, 0x44 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080BF850 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x9 + bhi _080BF880 + lsls r0, 2 + ldr r1, _080BF854 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BF850: .4byte 0x030022c0 +_080BF854: .4byte _080BF858 + .align 2, 0 +_080BF858: + .4byte _080BF880 + .4byte _080BF8D8 + .4byte _080BF910 + .4byte _080BF93C + .4byte _080BF97C + .4byte _080BF982 + .4byte _080BFA34 + .4byte _080BFAE8 + .4byte _080BFB14 + .4byte _080BFB64 +_080BF880: + ldr r0, _080BF8C4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BF88E + b _080BFB94 +_080BF88E: + ldr r4, _080BF8C8 + ldr r0, [r4] + ldr r1, _080BF8CC + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + ldr r1, _080BF8D0 + ldr r0, [r5, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 2 + bl sub_80C09B0 + ldr r0, [r4] + ldr r2, _080BF8D4 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0x87 + lsls r0, 3 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] + b _080BFB94 + .align 2, 0 +_080BF8C4: .4byte 0x02037fd4 +_080BF8C8: .4byte 0x02039b4c +_080BF8CC: .4byte 0x0000064a +_080BF8D0: .4byte 0x030060b4 +_080BF8D4: .4byte 0x0000064d +_080BF8D8: + ldr r1, _080BF908 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _080BF90C + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + b _080BFB4E + .align 2, 0 +_080BF908: .4byte 0x08dc1934 +_080BF90C: .4byte 0x08dc2e6c +_080BF910: + movs r0, 0xD + bl sub_80BFCF4 + movs r0, 0x2 + movs r1, 0xD + bl sub_80BFD7C + ldr r0, _080BF934 + ldr r0, [r0] + ldr r1, _080BF938 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + b _080BFB4E + .align 2, 0 +_080BF934: .4byte 0x02039b4c +_080BF938: .4byte 0x0000064c +_080BF93C: + ldr r1, _080BF970 + add r0, sp, 0x4 + bl gf_strcpy + ldr r0, _080BF974 + ldr r1, [r0] + add r0, sp, 0x4 + bl gf_strcat + movs r0, 0x1 + add r1, sp, 0x4 + movs r2, 0xF0 + bl sub_81DB35C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + add r0, sp, 0x4 + movs r2, 0x79 + bl sub_80BE8DC + ldr r1, _080BF978 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BFB56 + .align 2, 0 +_080BF970: .4byte 0x085e8723 +_080BF974: .4byte 0x03005d90 +_080BF978: .4byte 0x030022c0 +_080BF97C: + bl sub_80A1A74 + b _080BFB4E +_080BF982: + ldr r0, _080BFA18 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x98 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0EF8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080BFA1C + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + adds r4, r0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x5] + ldr r2, _080BFA20 + ldr r0, _080BFA24 + ldr r1, [r0] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r0, [r0, 0x1C] + strh r0, [r4, 0x26] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r1, [r0, 0x1A] + str r1, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldr r0, _080BFA28 + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r1, 0x10 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080BFA2C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x12] + ldr r1, _080BFA30 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BFB56 + .align 2, 0 +_080BFA18: .4byte 0x03005d90 +_080BFA1C: .4byte 0x02020630 +_080BFA20: .4byte 0x0856b5b0 +_080BFA24: .4byte 0x02039b54 +_080BFA28: .4byte 0x0856e610 +_080BFA2C: .4byte 0x03005e00 +_080BFA30: .4byte 0x030022c0 +_080BFA34: + ldr r5, _080BFAD4 + ldr r0, [r5] + ldrh r0, [r0] + movs r1, 0x58 + movs r2, 0x38 + movs r3, 0x1 + bl sub_80C0E9C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080BFAD8 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + adds r4, r0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x5] + ldr r2, _080BFADC + ldr r1, [r5] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r0, [r0, 0x18] + strh r0, [r4, 0x26] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r1, [r0, 0x16] + str r1, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldr r0, _080BFAE0 + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r1, 0x10 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080BFAE4 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x10] + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080BFB4E + .align 2, 0 +_080BFAD4: .4byte 0x02039b54 +_080BFAD8: .4byte 0x02020630 +_080BFADC: .4byte 0x0856b5b0 +_080BFAE0: .4byte 0x0856e610 +_080BFAE4: .4byte 0x03005e00 +_080BFAE8: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080BFB0C + ldr r0, [r0] + bl SetVBlankCallback + ldr r1, _080BFB10 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BFB56 + .align 2, 0 +_080BFB0C: .4byte 0x030060b4 +_080BFB10: .4byte 0x030022c0 +_080BFB14: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_080BFB4E: + ldr r1, _080BFB60 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080BFB56: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BFB94 + .align 2, 0 +_080BFB60: .4byte 0x030022c0 +_080BFB64: + ldr r0, _080BFB9C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080BFB94 + ldr r0, _080BFBA0 + ldr r0, [r0] + ldr r1, _080BFBA4 + adds r0, r1 + strb r2, [r0] + movs r1, 0x87 + lsls r1, 3 + adds r0, r5, r1 + strb r2, [r0] + ldr r1, _080BFBA8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BFBAC + str r1, [r0] +_080BFB94: + add sp, 0x44 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BFB9C: .4byte 0x02037fd4 +_080BFBA0: .4byte 0x02039b4c +_080BFBA4: .4byte 0x0000064e +_080BFBA8: .4byte 0x03005e00 +_080BFBAC: .4byte sub_80BFBB0 + 1 + thumb_func_end sub_80BF82C + + thumb_func_start sub_80BFBB0 +sub_80BFBB0: @ 80BFBB0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _080BFBFC + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _080BFC10 + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BFC00 + ldr r0, [r0] + ldr r1, _080BFC04 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _080BFC08 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BFC0C + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BFC5C + .align 2, 0 +_080BFBFC: .4byte 0x030022c0 +_080BFC00: .4byte 0x02039b4c +_080BFC04: .4byte 0x0000064e +_080BFC08: .4byte 0x03005e00 +_080BFC0C: .4byte sub_80BFC78 + 1 +_080BFC10: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080BFC2C + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080BFC5C + ldr r0, _080BFC64 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BFC5C +_080BFC2C: + movs r0, 0x15 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080BFC68 + ldr r0, [r0] + ldr r1, _080BFC6C + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r1, _080BFC70 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080BFC74 + str r1, [r0] + movs r0, 0x6D + bl audio_play +_080BFC5C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080BFC64: .4byte 0x03005d90 +_080BFC68: .4byte 0x02039b4c +_080BFC6C: .4byte 0x0000064e +_080BFC70: .4byte 0x03005e00 +_080BFC74: .4byte sub_80BFC78 + 1 + thumb_func_end sub_80BFBB0 + + thumb_func_start sub_80BFC78 +sub_80BFC78: @ 80BFC78 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080BFCB8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BFCD0 + ldr r1, _080BFCBC + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldrh r0, [r4, 0x12] + bl sub_818D8F0 + ldr r0, _080BFCC0 + ldr r0, [r0] + ldr r1, _080BFCC4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080BFCB2 + cmp r0, 0x2 + beq _080BFCCC +_080BFCB2: + ldr r0, _080BFCC8 + b _080BFCCE + .align 2, 0 +_080BFCB8: .4byte 0x02037fd4 +_080BFCBC: .4byte 0x03005e00 +_080BFCC0: .4byte 0x02039b4c +_080BFCC4: .4byte 0x0000064e +_080BFCC8: .4byte sub_80BEA24 + 1 +_080BFCCC: + ldr r0, _080BFCD8 +_080BFCCE: + str r0, [r4] +_080BFCD0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080BFCD8: .4byte sub_80BF250 + 1 + thumb_func_end sub_80BFC78 + + thumb_func_start sub_80BFCDC +sub_80BFCDC: @ 80BFCDC + push {lr} + ldr r1, _080BFCF0 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + pop {r0} + bx r0 + .align 2, 0 +_080BFCF0: .4byte 0x08dc2f5c + thumb_func_end sub_80BFCDC + + thumb_func_start sub_80BFCF4 +sub_80BFCF4: @ 80BFCF4 + push {lr} + ldr r1, _080BFD08 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + pop {r0} + bx r0 + .align 2, 0 +_080BFD08: .4byte 0x08dc2fec + thumb_func_end sub_80BFCF4 + + thumb_func_start sub_80BFD0C +sub_80BFD0C: @ 80BFD0C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + bl bg_get_tilemap + adds r7, r0, 0 + movs r1, 0 +_080BFD22: + lsls r0, r1, 3 + subs r0, r1 + adds r0, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0x80 + lsls r3, 7 + cmp r1, r8 + bne _080BFD38 + movs r3, 0x80 + lsls r3, 6 +_080BFD38: + movs r2, 0 + adds r6, r1, 0x1 + ldr r4, _080BFD78 +_080BFD3E: + adds r1, r5, r2 + lsls r1, 1 + adds r1, r7 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r1, 0x40 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _080BFD3E + lsls r0, r6, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080BFD22 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BFD78: .4byte 0x00000fff + thumb_func_end sub_80BFD0C + + thumb_func_start sub_80BFD7C +sub_80BFD7C: @ 80BFD7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + bl bg_get_tilemap + adds r7, r0, 0 + movs r1, 0 +_080BFD92: + lsls r0, r1, 3 + subs r0, r1 + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r1, r8 + beq _080BFDA4 + cmp r1, 0x3 + bne _080BFDAA +_080BFDA4: + movs r3, 0x80 + lsls r3, 6 + b _080BFDAE +_080BFDAA: + movs r3, 0x80 + lsls r3, 7 +_080BFDAE: + movs r2, 0 + adds r5, r1, 0x1 + ldr r4, _080BFDF0 +_080BFDB4: + adds r1, r6, r2 + lsls r1, 1 + adds r1, r7 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r1, 0x40 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _080BFDB4 + lsls r0, r5, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080BFD92 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080BFDF0: .4byte 0x00000fff + thumb_func_end sub_80BFD7C + + thumb_func_start sub_80BFDF4 +sub_80BFDF4: @ 80BFDF4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _080BFE30 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080BFE34 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r4, [r1, 0xA] + strh r5, [r1, 0x20] + lsrs r5, 16 + strh r5, [r1, 0x22] + strh r6, [r1, 0x24] + lsrs r6, 16 + strh r6, [r1, 0x26] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080BFE30: .4byte sub_80BFE38 + 1 +_080BFE34: .4byte 0x03005e00 + thumb_func_end sub_80BFDF4 + + thumb_func_start sub_80BFE38 +sub_80BFE38: @ 80BFE38 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080BFE60 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0xA] + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x6 + bhi _080BFE84 + lsls r0, 2 + ldr r1, _080BFE64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080BFE60: .4byte 0x03005e00 +_080BFE64: .4byte _080BFE68 + .align 2, 0 +_080BFE68: + .4byte _080BFE84 + .4byte _080BFF0C + .4byte _080BFF78 + .4byte _080BFF82 + .4byte _080BFFA8 + .4byte _080C0000 + .4byte _080C0044 +_080BFE84: + ldr r0, _080BFEF4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BFE92 + b _080C0074 +_080BFE92: + ldr r1, _080BFEF8 + ldr r0, _080BFEFC + ldr r0, [r0, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 1 + bl sub_80C09B0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080BFF00 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x3 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r0, _080BFF04 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r1, _080BFF08 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _080C0074 + .align 2, 0 +_080BFEF4: .4byte 0x02037fd4 +_080BFEF8: .4byte 0x030060b4 +_080BFEFC: .4byte 0x030022c0 +_080BFF00: .4byte 0x0856e668 +_080BFF04: .4byte 0x0856e670 +_080BFF08: .4byte 0x03005e00 +_080BFF0C: + ldr r1, _080BFF6C + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _080BFF70 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r0, _080BFF74 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r1, [r4, 0xA] + movs r0, 0x1 + bl sub_80C0D30 + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + bl sub_80A1A74 + movs r0, 0 + bl sub_80BC844 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080C0074 + .align 2, 0 +_080BFF6C: .4byte 0x08dc1934 +_080BFF70: .4byte 0x08dc3080 +_080BFF74: .4byte 0x03005e00 +_080BFF78: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + b _080C0038 +_080BFF82: + bl sub_809D42C + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80C020C + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080C002E +_080BFFA8: + adds r0, r4, 0 + movs r1, 0x30 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0E9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080BFFF4 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080BFFF8 + ldr r0, [r0] + bl SetVBlankCallback + ldr r1, _080BFFFC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0xE] + b _080C0038 + .align 2, 0 +_080BFFF4: .4byte 0x02020630 +_080BFFF8: .4byte 0x030060b4 +_080BFFFC: .4byte 0x03005e00 +_080C0000: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_080C002E: + ldr r1, _080C0040 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 +_080C0038: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080C0074 + .align 2, 0 +_080C0040: .4byte 0x03005e00 +_080C0044: + ldr r0, _080C007C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080C0074 + adds r0, r4, 0 + bl poke_something_2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl cry_related + ldr r1, _080C0080 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xC] + ldr r1, _080C0084 + str r1, [r0] +_080C0074: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C007C: .4byte 0x02037fd4 +_080C0080: .4byte 0x03005e00 +_080C0084: .4byte sub_80C0088 + 1 + thumb_func_end sub_80BFE38 + + thumb_func_start sub_80C0088 +sub_80C0088: @ 80C0088 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080C00D0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080C00E8 + ldr r0, _080C00D4 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r3, _080C00D8 + ldr r0, _080C00DC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0xE + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r2, _080C00E0 + str r2, [r0] + ldr r0, _080C00E4 + str r0, [r1] + b _080C011E + .align 2, 0 +_080C00D0: .4byte 0x030022c0 +_080C00D4: .4byte 0x0000ffff +_080C00D8: .4byte 0x02020630 +_080C00DC: .4byte 0x03005e00 +_080C00E0: .4byte sub_80C01CC + 1 +_080C00E4: .4byte blockset_load_palette_to_gpu + 1 +_080C00E8: + ldr r1, _080C010C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + adds r1, 0x1 + strh r1, [r0, 0xC] + movs r0, 0x10 + ands r1, r0 + cmp r1, 0 + beq _080C0114 + ldr r0, _080C0110 + movs r1, 0x31 + movs r2, 0xE + bl gpu_pal_apply + b _080C011E + .align 2, 0 +_080C010C: .4byte 0x03005e00 +_080C0110: .4byte 0x08dc16f6 +_080C0114: + ldr r0, _080C0128 + movs r1, 0x31 + movs r2, 0xE + bl gpu_pal_apply +_080C011E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C0128: .4byte 0x08dc1756 + thumb_func_end sub_80C0088 + + thumb_func_start blockset_load_palette_to_gpu +blockset_load_palette_to_gpu: @ 80C012C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080C01C0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080C01BA + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + bl Window_FreeMemory + movs r0, 0x2 + bl bg_get_tilemap + cmp r0, 0 + beq _080C015A + bl free +_080C015A: + movs r0, 0x3 + bl bg_get_tilemap + cmp r0, 0 + beq _080C0168 + bl free +_080C0168: + ldr r0, _080C01C4 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + bl poke_something_2 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x22] + lsls r1, 16 + ldrh r2, [r4, 0x20] + orrs r1, r2 + ldrh r2, [r4, 0x26] + lsls r2, 16 + ldrh r3, [r4, 0x24] + orrs r2, r3 + ldr r5, _080C01C8 + movs r3, 0xE + ldrsh r4, [r4, r3] + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r3, 0x5] + lsrs r4, 4 + bl species_and_otid_get_pal + lsls r4, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r4, r1 + adds r1, r4, 0 + movs r2, 0x20 + bl decompress_palette + adds r0, r6, 0 + bl remove_task +_080C01BA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C01C0: .4byte 0x02037fd4 +_080C01C4: .4byte 0x03005e00 +_080C01C8: .4byte 0x02020630 + thumb_func_end blockset_load_palette_to_gpu + + thumb_func_start sub_80C01CC +sub_80C01CC: @ 80C01CC + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x77 + bgt _080C01DE + adds r0, r2, 0x2 + strh r0, [r1, 0x20] +_080C01DE: + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x78 + ble _080C01EC + subs r0, r2, 0x2 + strh r0, [r1, 0x20] +_080C01EC: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x4F + bgt _080C01FA + adds r0, r2, 0x1 + strh r0, [r1, 0x22] +_080C01FA: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x50 + ble _080C0208 + subs r0, r2, 0x1 + strh r0, [r1, 0x22] +_080C0208: + pop {r0} + bx r0 + thumb_func_end sub_80C01CC + + thumb_func_start sub_80C020C +sub_80C020C: @ 80C020C + push {r4-r7,lr} + sub sp, 0x30 + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + cmp r3, 0 + beq _080C0234 + ldr r4, _080C0248 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + bl sub_81DB35C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_80BE8DC +_080C0234: + cmp r5, 0 + bne _080C024C + lsls r4, r6, 16 + lsrs r0, r4, 16 + bl sub_806D458 + lsls r0, 16 + lsrs r5, r0, 16 + b _080C0250 + .align 2, 0 +_080C0248: .4byte 0x085e8735 +_080C024C: + adds r5, r6, 0 + lsls r4, r6, 16 +_080C0250: + ldr r1, _080C0284 + mov r0, sp + bl gf_strcpy + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl decimal_int_to_string + mov r0, sp + movs r1, 0x60 + movs r2, 0x19 + bl sub_80BE8DC + lsrs r0, r4, 16 + bl poke_something_2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080C028C + movs r0, 0xB + muls r1, r0 + ldr r0, _080C0288 + adds r0, r1, r0 + b _080C028E + .align 2, 0 +_080C0284: .4byte 0x085e8d4f +_080C0288: .4byte 0x083185c8 +_080C028C: + ldr r0, _080C02A8 +_080C028E: + movs r1, 0x84 + movs r2, 0x19 + bl sub_80BE8DC + cmp r7, 0 + beq _080C02AC + add r4, sp, 0x10 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81DB468 + adds r0, r4, 0 + b _080C02AE + .align 2, 0 +_080C02A8: .4byte 0x0856e688 +_080C02AC: + ldr r0, _080C02EC +_080C02AE: + movs r1, 0x64 + movs r2, 0x29 + bl sub_80BE8DC + ldr r0, _080C02F0 + movs r1, 0x60 + movs r2, 0x39 + bl sub_80BE8DC + ldr r0, _080C02F4 + movs r1, 0x60 + movs r2, 0x49 + bl sub_80BE8DC + cmp r7, 0 + beq _080C02FC + ldr r0, _080C02F8 + lsls r4, r6, 5 + adds r4, r0 + ldrh r0, [r4, 0xC] + movs r1, 0x81 + movs r2, 0x39 + bl sub_80C0354 + ldrh r0, [r4, 0xE] + movs r1, 0x81 + movs r2, 0x49 + bl sub_80C0460 + b _080C0310 + .align 2, 0 +_080C02EC: .4byte 0x085e86b8 +_080C02F0: .4byte 0x085e8755 +_080C02F4: .4byte 0x085e8758 +_080C02F8: .4byte 0x0856b5b0 +_080C02FC: + ldr r0, _080C0320 + movs r1, 0x81 + movs r2, 0x39 + bl sub_80BE8DC + ldr r0, _080C0324 + movs r1, 0x81 + movs r2, 0x49 + bl sub_80BE8DC +_080C0310: + cmp r7, 0 + beq _080C032C + ldr r0, _080C0328 + lsls r1, r6, 5 + adds r0, 0x10 + adds r1, r0 + ldr r4, [r1] + b _080C032E + .align 2, 0 +_080C0320: .4byte 0x085e86c6 +_080C0324: .4byte 0x085e86d0 +_080C0328: .4byte 0x0856b5b0 +_080C032C: + ldr r4, _080C0350 +_080C032E: + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + bl sub_81DB35C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x5F + bl sub_80BE8DC + add sp, 0x30 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C0350: .4byte 0x0855d30c + thumb_func_end sub_80C020C + + thumb_func_start sub_80C0354 +sub_80C0354: @ 80C0354 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, _080C03D0 + muls r0, r1 + movs r1, 0xFE + bl __divsi3 + adds r7, r0, 0 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x4 + bls _080C0386 + adds r7, 0xA +_080C0386: + adds r0, r7, 0 + movs r1, 0x78 + bl __udivsi3 + adds r6, r0, 0 + lsls r0, r6, 4 + subs r0, r6 + lsls r0, 3 + subs r0, r7, r0 + movs r1, 0xA + bl __udivsi3 + adds r7, r0, 0 + mov r1, sp + movs r0, 0xFC + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x13 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + adds r2, r0, 0 + cmp r2, 0 + bne _080C03D4 + mov r1, sp + adds r1, 0x2 + movs r0, 0x12 + strb r0, [r1] + movs r5, 0x4 + adds r1, 0x1 + adds r0, r6, 0 + adds r0, 0xA1 + strb r0, [r1] + b _080C03F4 + .align 2, 0 +_080C03D0: .4byte 0x00002710 +_080C03D4: + mov r1, sp + adds r1, 0x2 + movs r0, 0xC + strb r0, [r1] + adds r1, 0x1 + adds r0, r2, 0 + adds r0, 0xA1 + strb r0, [r1] + movs r5, 0x5 + add r4, sp, 0x4 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] +_080C03F4: + adds r1, r5, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + add r1, sp + movs r0, 0xB4 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + mov r0, sp + adds r4, r0, r2 + adds r0, r7, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, sp + adds r4, r1, r6 + adds r0, r7, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + adds r2, r1, r5 + movs r1, 0xB2 + strb r1, [r2] + mov r2, sp + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + mov r0, sp + mov r1, r9 + mov r2, r8 + bl sub_80BE8DC + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C0354 + + thumb_func_start sub_80C0460 +sub_80C0460: @ 80C0460 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + ldr r5, _080C04B8 + muls r0, r5 + ldr r1, _080C04BC + bl __divsi3 + adds r7, r0, 0 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x4 + bls _080C0494 + adds r7, 0xA +_080C0494: + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r0, r7, 0 + adds r1, r5, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA1 + bne _080C04C0 + movs r6, 0x1 + mov r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C04C6 + .align 2, 0 +_080C04B8: .4byte 0x000186a0 +_080C04BC: .4byte 0x000011b8 +_080C04C0: + movs r1, 0x1 + mov r8, r1 + movs r6, 0x1 +_080C04C6: + ldr r1, _080C04FC + adds r0, r7, 0 + bl __umodsi3 + adds r7, r0, 0 + mov r4, sp + adds r4, 0x1 + ldr r1, _080C0500 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA1 + bne _080C0504 + mov r2, r8 + cmp r2, 0 + bne _080C0504 + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + add r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C050E + .align 2, 0 +_080C04FC: .4byte 0x000186a0 +_080C0500: .4byte 0x00002710 +_080C0504: + movs r3, 0x1 + mov r8, r3 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080C050E: + ldr r1, _080C0548 + adds r0, r7, 0 + bl __umodsi3 + adds r7, r0, 0 + mov r0, sp + adds r4, r0, r6 + movs r1, 0xFA + lsls r1, 2 + adds r0, r7, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA1 + bne _080C054C + mov r1, r8 + cmp r1, 0 + bne _080C054C + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + add r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C0552 + .align 2, 0 +_080C0548: .4byte 0x00002710 +_080C054C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080C0552: + movs r1, 0xFA + lsls r1, 2 + adds r0, r7, 0 + bl __umodsi3 + adds r7, r0, 0 + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r6, 0 + mov r2, sp + adds r4, r2, r1 + adds r0, r7, 0 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + movs r3, 0 + mov r9, r3 + strb r0, [r4] + adds r0, r7, 0 + movs r1, 0x64 + bl __umodsi3 + adds r7, r0, 0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r6, 0 + mov r2, sp + adds r0, r2, r5 + movs r3, 0xAD + mov r8, r3 + mov r2, r8 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r6, 0 + mov r3, sp + adds r4, r3, r1 + adds r0, r7, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r6, 0 + mov r2, sp + adds r0, r2, r5 + mov r3, r9 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, r6, 0 + add r1, sp + movs r0, 0xE0 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r3, r6, 0 + mov r0, sp + adds r1, r0, r2 + movs r0, 0xD6 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, r6, 0 + mov r0, sp + adds r1, r0, r3 + movs r0, 0xE7 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r3, sp + adds r1, r3, r2 + mov r2, r8 + strb r2, [r1] + adds r1, r3, r0 + movs r0, 0xFF + strb r0, [r1] + mov r0, sp + mov r1, r10 + ldr r2, [sp, 0x10] + bl sub_80BE8DC + 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_80C0460 + + thumb_func_start sub_80C0620 +sub_80C0620: @ 80C0620 + lsls r0, 16 + lsrs r0, 11 + ldr r1, _080C062C + adds r0, r1 + bx lr + .align 2, 0 +_080C062C: .4byte 0x0856b5b0 + thumb_func_end sub_80C0620 + + thumb_func_start sub_80C0630 +sub_80C0630: @ 80C0630 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _080C0646 + cmp r1, 0x1 + beq _080C0654 + movs r0, 0x1 + b _080C065C +_080C0646: + ldr r0, _080C0650 + lsls r1, r2, 5 + adds r1, r0 + ldrh r0, [r1, 0xC] + b _080C065C + .align 2, 0 +_080C0650: .4byte 0x0856b5b0 +_080C0654: + ldr r0, _080C0660 + lsls r1, r2, 5 + adds r1, r0 + ldrh r0, [r1, 0xE] +_080C065C: + pop {r1} + bx r1 + .align 2, 0 +_080C0660: .4byte 0x0856b5b0 + thumb_func_end sub_80C0630 + + thumb_func_start pokedex_flag_operation +pokedex_flag_operation: @ 80C0664 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + adds r3, r2, 0 + ldr r1, _080C0698 + adds r0, r1 + lsrs r1, r0, 16 + lsrs r0, 19 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x7 + ands r1, r0 + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r5, r0, 24 + movs r6, 0 + cmp r2, 0x1 + beq _080C06FC + cmp r2, 0x1 + bgt _080C069C + cmp r2, 0 + beq _080C06AA + b _080C07E8 + .align 2, 0 +_080C0698: .4byte 0xffff0000 +_080C069C: + cmp r3, 0x2 + bne _080C06A2 + b _080C079C +_080C06A2: + cmp r3, 0x3 + bne _080C06A8 + b _080C07D8 +_080C06A8: + b _080C07E8 +_080C06AA: + ldr r1, _080C06EC + ldr r0, [r1] + adds r0, 0x5C + adds r0, r4 + ldrb r2, [r0] + ands r2, r5 + adds r7, r1, 0 + cmp r2, 0 + bne _080C06BE + b _080C07E8 +_080C06BE: + ldr r0, _080C06F0 + ldr r3, [r0] + ldr r6, _080C06F4 + adds r1, r3, r6 + adds r1, r4 + ldrb r1, [r1] + ands r1, r5 + adds r6, r0, 0 + cmp r2, r1 + bne _080C06E0 + ldr r1, _080C06F8 + adds r0, r3, r1 + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + cmp r2, r0 + beq _080C073E +_080C06E0: + ldr r1, [r7] + adds r1, 0x5C + adds r1, r4 + mvns r3, r5 + b _080C076A + .align 2, 0 +_080C06EC: .4byte 0x03005d90 +_080C06F0: .4byte 0x03005d8c +_080C06F4: .4byte 0x00000988 +_080C06F8: .4byte 0x00003b24 +_080C06FC: + ldr r1, _080C0744 + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0x28 + adds r0, r4 + ldrb r2, [r0] + ands r2, r5 + adds r7, r1, 0 + cmp r2, 0 + beq _080C07E8 + adds r0, r3, 0 + adds r0, 0x5C + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + ldr r6, _080C0748 + cmp r2, r0 + bne _080C0754 + ldr r1, [r6] + ldr r3, _080C074C + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + cmp r2, r0 + bne _080C0754 + ldr r3, _080C0750 + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + cmp r2, r0 + bne _080C0754 +_080C073E: + movs r6, 0x1 + b _080C07E8 + .align 2, 0 +_080C0744: .4byte 0x03005d90 +_080C0748: .4byte 0x03005d8c +_080C074C: .4byte 0x00000988 +_080C0750: .4byte 0x00003b24 +_080C0754: + ldr r1, [r7] + adds r1, 0x28 + adds r1, r4 + mvns r3, r5 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r7] + adds r1, 0x5C + adds r1, r4 +_080C076A: + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r6] + ldr r0, _080C0794 + adds r1, r0 + adds r1, r4 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r6] + ldr r1, _080C0798 + adds r0, r1 + adds r0, r4 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + movs r6, 0 + b _080C07E8 + .align 2, 0 +_080C0794: .4byte 0x00000988 +_080C0798: .4byte 0x00003b24 +_080C079C: + ldr r0, _080C07C8 + ldr r1, [r0] + adds r1, 0x5C + adds r1, r4 + ldrb r2, [r1] + adds r0, r5, 0 + orrs r0, r2 + strb r0, [r1] + ldr r3, _080C07CC + ldr r1, [r3] + ldr r0, _080C07D0 + adds r1, r0 + adds r1, r4 + ldrb r2, [r1] + adds r0, r5, 0 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + ldr r3, _080C07D4 + adds r1, r3 + b _080C07DE + .align 2, 0 +_080C07C8: .4byte 0x03005d90 +_080C07CC: .4byte 0x03005d8c +_080C07D0: .4byte 0x00000988 +_080C07D4: .4byte 0x00003b24 +_080C07D8: + ldr r0, _080C07F0 + ldr r1, [r0] + adds r1, 0x28 +_080C07DE: + adds r1, r4 + ldrb r2, [r1] + adds r0, r5, 0 + orrs r0, r2 + strb r0, [r1] +_080C07E8: + adds r0, r6, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080C07F0: .4byte 0x03005d90 + thumb_func_end pokedex_flag_operation + + thumb_func_start pokedex_count +pokedex_count: @ 80C07F4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 + ldr r7, _080C080C +_080C0800: + cmp r6, 0 + beq _080C0810 + cmp r6, 0x1 + beq _080C081A + adds r4, r0, 0x1 + b _080C0832 + .align 2, 0 +_080C080C: .4byte 0x00000181 +_080C0810: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0 + b _080C0822 +_080C081A: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0x1 +_080C0822: + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C0832 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C0832: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, r7 + bls _080C0800 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end pokedex_count + + thumb_func_start sub_80C0844 +sub_80C0844: @ 80C0844 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 +_080C084E: + cmp r6, 0 + beq _080C085A + cmp r6, 0x1 + beq _080C086C + adds r4, r0, 0x1 + b _080C088C +_080C085A: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_806D4EC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + b _080C087C +_080C086C: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_806D4EC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 +_080C087C: + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C088C + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C088C: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bls _080C084E + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80C0844 + + thumb_func_start sub_80C089C +sub_80C089C: @ 80C089C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 +_080C08A6: + cmp r6, 0 + beq _080C08B2 + cmp r6, 0x1 + beq _080C08BC + adds r4, r0, 0x1 + b _080C08D4 +_080C08B2: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0 + b _080C08C4 +_080C08BC: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0x1 +_080C08C4: + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C08D4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C08D4: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0x96 + bls _080C08A6 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80C089C + + thumb_func_start sub_80C08E4 +sub_80C08E4: @ 80C08E4 + push {r4,lr} + movs r0, 0 +_080C08E8: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806D4EC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _080C0908 + movs r0, 0 + b _080C0910 +_080C0908: + adds r0, r4, 0 + cmp r0, 0xC7 + bls _080C08E8 + movs r0, 0x1 +_080C0910: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C08E4 + + thumb_func_start sub_80C0918 +sub_80C0918: @ 80C0918 + push {r4,lr} + movs r0, 0 +_080C091C: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _080C0934 + movs r0, 0 + b _080C093C +_080C0934: + adds r0, r4, 0 + cmp r0, 0x95 + bls _080C091C + movs r0, 0x1 +_080C093C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C0918 + + thumb_func_start sub_80C0944 +sub_80C0944: @ 80C0944 + push {r4,r5,lr} + movs r0, 0 +_080C0948: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C0996 + adds r0, r4, 0 + cmp r0, 0x95 + bls _080C0948 + movs r0, 0x97 +_080C0964: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C0996 + adds r0, r4, 0 + cmp r0, 0xF7 + bls _080C0964 + movs r0, 0xFB + ldr r5, _080C099C +_080C0982: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _080C09A0 +_080C0996: + movs r0, 0 + b _080C09A8 + .align 2, 0 +_080C099C: .4byte 0x0000017f +_080C09A0: + adds r0, r4, 0 + cmp r0, r5 + bls _080C0982 + movs r0, 0x1 +_080C09A8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C0944 + + thumb_func_start sub_80C09B0 +sub_80C09B0: @ 80C09B0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C09E2 + movs r0, 0 + bl lcd_io_clear_bits + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set +_080C09E2: + movs r1, 0x80 + lsls r1, 2 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C0A0C + movs r0, 0 + bl lcd_io_clear_bits + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set +_080C0A0C: + movs r1, 0x80 + lsls r1, 3 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C0A36 + movs r0, 0 + bl lcd_io_clear_bits + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set +_080C0A36: + movs r1, 0x80 + lsls r1, 4 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C0A60 + movs r0, 0 + bl lcd_io_clear_bits + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set +_080C0A60: + movs r1, 0x80 + lsls r1, 5 + ands r5, r1 + cmp r5, 0 + bne _080C0A7E + movs r0, 0 + bl lcd_io_clear_bits + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _080C0A84 + movs r0, 0x8 + strb r0, [r1] +_080C0A7E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C0A84: .4byte 0x0300301c + thumb_func_end sub_80C09B0 + + thumb_func_start sub_80C0A88 +sub_80C0A88: @ 80C0A88 + push {r4-r6,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + add r4, sp, 0x14 + movs r6, 0 + strb r6, [r4] + adds r5, r4, 0 + movs r4, 0xF + strb r4, [r5, 0x1] + movs r4, 0x3 + strb r4, [r5, 0x2] + str r6, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + subs r4, 0x4 + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl sub_8199EEC + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C0A88 + + thumb_func_start sub_80C0AC4 +sub_80C0AC4: @ 80C0AC4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + mov r9, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r5, sp + adds r0, r4, 0 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5] + mov r5, sp + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x1] + mov r5, sp + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x3] + adds r0, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_80C0A88 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C0AC4 + + thumb_func_start sub_80C0B44 +sub_80C0B44: @ 80C0B44 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + movs r4, 0 + movs r2, 0xFF +_080C0B62: + mov r1, sp + adds r0, r1, r4 + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xA + bls _080C0B62 + adds r0, r5, 0 + bl poke_something_2 + adds r5, r0, 0 + cmp r5, 0 + beq _080C0BC0 + movs r4, 0 + ldr r2, _080C0BBC + movs r0, 0xB + adds r1, r5, 0 + muls r1, r0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080C0BD4 + adds r3, r2, 0 + adds r2, r1, 0 +_080C0B98: + mov r0, sp + adds r1, r0, r4 + adds r0, r4, r2 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, r2 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080C0BD4 + cmp r4, 0x9 + bls _080C0B98 + b _080C0BD4 + .align 2, 0 +_080C0BBC: .4byte 0x083185c8 +_080C0BC0: + movs r4, 0 + movs r1, 0xAE +_080C0BC4: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080C0BC4 +_080C0BD4: + mov r0, r8 + mov r1, sp + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80C0A88 + adds r0, r4, 0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80C0B44 + + thumb_func_start sub_80C0BF0 +sub_80C0BF0: @ 80C0BF0 + push {r4-r7,lr} + sub sp, 0xC + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + lsls r3, 24 + lsrs r5, r3, 24 + movs r2, 0 + movs r1, 0 +_080C0C08: + mov r3, sp + adds r0, r3, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _080C0C08 + movs r3, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _080C0C32 +_080C0C20: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080C0C32 + cmp r3, 0xA + bls _080C0C20 +_080C0C32: + movs r2, 0 + cmp r2, r3 + bcs _080C0C52 +_080C0C38: + adds r0, r2, 0 + adds r0, 0xB + subs r0, r3 + mov r7, sp + adds r1, r7, r0 + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _080C0C38 +_080C0C52: + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0xB] + adds r0, r6, 0 + mov r2, r12 + adds r3, r5, 0 + bl sub_80C0A88 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C0BF0 + + thumb_func_start sub_80C0C6C +sub_80C0C6C: @ 80C0C6C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + movs r5, 0 + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080C0CA2 + mov r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C0CAA +_080C0CA2: + mov r1, sp + adds r0, 0xA1 + strb r0, [r1] + movs r5, 0x1 +_080C0CAA: + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080C0CD0 + cmp r5, 0 + bne _080C0CD0 + mov r1, sp + movs r0, 0x77 + b _080C0CD4 +_080C0CD0: + mov r1, sp + adds r0, 0xA1 +_080C0CD4: + strb r0, [r1, 0x1] + mov r5, sp + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + mov r1, sp + movs r0, 0xAD + strb r0, [r1, 0x3] + mov r5, sp + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x5] + mov r0, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80C0A88 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C0C6C + + thumb_func_start sub_80C0D30 +sub_80C0D30: @ 80C0D30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x80 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, _080C0DBC + adds r0, r1, 0 + bl poke_something_2 + lsls r0, 16 + lsrs r0, 14 + adds r0, r4 + ldr r0, [r0] + mov r12, r0 + movs r5, 0 + movs r1, 0 + movs r7, 0x2 +_080C0D5A: + mov r2, r12 + adds r0, r2, r1 + ldrb r3, [r0] + movs r4, 0 + adds r6, r1, 0x1 +_080C0D64: + lsls r2, r4, 1 + adds r1, r3, 0 + asrs r1, r2 + movs r0, 0x1 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r1, r0, 31 + ands r1, r7 + adds r0, r7, 0 + lsls r0, r2 + ands r0, r3 + cmp r0, 0 + beq _080C0D84 + movs r0, 0x20 + orrs r1, r0 +_080C0D84: + mov r2, sp + adds r0, r2, r5 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080C0D64 + lsls r0, r6, 16 + lsrs r1, r0, 16 + cmp r1, 0x1F + bls _080C0D5A + mov r0, r8 + mov r1, sp + movs r2, 0x80 + movs r3, 0 + bl Window_CopyToPixels + add sp, 0x80 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C0DBC: .4byte 0x0856e694 + thumb_func_end sub_80C0D30 + + thumb_func_start sub_80C0DC0 +sub_80C0DC0: @ 80C0DC0 + push {r4,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r0, 5 + ldr r2, _080C0DFC + adds r3, r0, r2 + movs r4, 0xF0 + lsls r4, 8 + adds r2, r1, r4 + strh r2, [r3] + ldr r2, _080C0E00 + adds r3, r0, r2 + adds r4, 0x1 + adds r2, r1, r4 + strh r2, [r3] + ldr r2, _080C0E04 + adds r3, r0, r2 + adds r4, 0x1 + adds r2, r1, r4 + strh r2, [r3] + ldr r2, _080C0E08 + adds r0, r2 + adds r4, 0x1 + adds r1, r4 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C0DFC: .4byte 0x06000232 +_080C0E00: .4byte 0x06000234 +_080C0E04: .4byte 0x06000272 +_080C0E08: .4byte 0x06000274 + thumb_func_end sub_80C0DC0 + + thumb_func_start sub_80C0E0C +sub_80C0E0C: @ 80C0E0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + cmp r4, 0x1 + beq _080C0E38 + cmp r4, 0x1 + bgt _080C0E2E + cmp r4, 0 + beq _080C0E40 + b _080C0E60 +_080C0E2E: + cmp r5, 0x2 + beq _080C0E52 + cmp r5, 0x3 + beq _080C0E46 + b _080C0E60 +_080C0E38: + cmp r0, r2 + bls _080C0E60 + subs r0, 0x1 + b _080C0E58 +_080C0E40: + cmp r0, r3 + bcs _080C0E60 + b _080C0E56 +_080C0E46: + cmp r0, r2 + bls _080C0E4E + subs r0, 0x1 + b _080C0E58 +_080C0E4E: + adds r0, r3, 0 + b _080C0E60 +_080C0E52: + cmp r0, r3 + bcs _080C0E5E +_080C0E56: + adds r0, 0x1 +_080C0E58: + lsls r0, 16 + lsrs r0, 16 + b _080C0E60 +_080C0E5E: + adds r0, r2, 0 +_080C0E60: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C0E0C + + thumb_func_start sub_80C0E68 +sub_80C0E68: @ 80C0E68 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xC9 + beq _080C0E88 + movs r0, 0x9A + lsls r0, 1 + cmp r1, r0 + bne _080C0E94 + ldr r0, _080C0E84 + ldr r0, [r0] + ldr r0, [r0, 0x20] + b _080C0E96 + .align 2, 0 +_080C0E84: .4byte 0x03005d90 +_080C0E88: + ldr r0, _080C0E90 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + b _080C0E96 + .align 2, 0 +_080C0E90: .4byte 0x03005d90 +_080C0E94: + movs r0, 0 +_080C0E96: + pop {r1} + bx r1 + thumb_func_end sub_80C0E68 + + thumb_func_start sub_80C0E9C +sub_80C0E9C: @ 80C0E9C + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + bl poke_something_2 + adds r1, r0, 0 + adds r0, r1, 0 + str r1, [sp, 0x10] + bl sub_80C0E68 + adds r2, r0, 0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x8] + ldr r0, _080C0EF4 + str r0, [sp, 0xC] + ldr r1, [sp, 0x10] + adds r0, r1, 0 + movs r1, 0x8 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080C0EF4: .4byte 0x0000ffff + thumb_func_end sub_80C0E9C + + thumb_func_start sub_80C0EF8 +sub_80C0EF8: @ 80C0EF8 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + ldr r1, _080C0F2C + str r1, [sp, 0x4] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_818D8AC + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080C0F2C: .4byte 0x0000ffff + thumb_func_end sub_80C0EF8 + + thumb_func_start sub_80C0F30 +sub_80C0F30: @ 80C0F30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x8] + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + bl sub_80BC8D4 + movs r5, 0 + movs r6, 0 + ldr r4, _080C1140 + ldr r3, _080C1144 +_080C0F6A: + ldr r2, [r3] + lsls r0, r5, 2 + adds r1, r2, r0 + ldrb r0, [r1, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080C0F86 + lsls r0, r6, 2 + adds r0, r2, r0 + ldr r1, [r1] + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C0F86: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r4 + bls _080C0F6A + ldr r1, _080C1144 + ldr r0, [r1] + ldr r2, _080C1148 + adds r0, r2 + adds r1, r6, 0 + strh r6, [r0] + cmp r7, 0xFF + beq _080C103C + movs r5, 0 + lsls r0, r1, 16 + movs r6, 0 + cmp r0, 0 + beq _080C1032 + lsls r7, 2 + ldr r0, _080C114C + adds r0, 0x3 + adds r0, r7, r0 + str r0, [sp, 0xC] + ldr r0, _080C114C + adds r0, r7 + mov r9, r0 +_080C0FBA: + ldr r1, _080C1144 + ldr r0, [r1] + lsls r4, r5, 2 + adds r0, r4 + ldrh r0, [r0] + bl poke_something_2 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _080C1150 + movs r0, 0xB + muls r0, r2 + adds r0, r1 + ldrb r2, [r0] + adds r3, r2, 0 + mov r0, r9 + ldrb r0, [r0] + cmp r2, r0 + bcc _080C0FF2 + mov r1, r9 + ldrb r0, [r1] + ldr r1, _080C114C + adds r1, 0x1 + adds r1, r7, r1 + ldrb r1, [r1] + adds r0, r1 + cmp r2, r0 + blt _080C100A +_080C0FF2: + ldr r0, _080C114C + adds r0, 0x2 + adds r0, r7, r0 + ldrb r2, [r0] + cmp r3, r2 + bcc _080C101E + ldrb r1, [r0] + ldr r2, [sp, 0xC] + ldrb r0, [r2] + adds r1, r0 + cmp r3, r1 + bge _080C101E +_080C100A: + ldr r2, _080C1144 + ldr r0, [r2] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C101E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _080C1144 + ldr r0, [r1] + ldr r2, _080C1148 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C0FBA +_080C1032: + ldr r1, _080C1144 + ldr r0, [r1] + ldr r2, _080C1148 + adds r0, r2 + strh r6, [r0] +_080C103C: + ldr r0, [sp, 0x4] + cmp r0, 0xFF + beq _080C10AC + movs r5, 0 + movs r6, 0 + ldr r1, _080C1144 + ldr r0, [r1] + ldr r2, _080C1148 + adds r0, r2 + ldrh r0, [r0] + cmp r6, r0 + bcs _080C10A2 + adds r7, r1, 0 + ldr r0, _080C1154 + mov r8, r0 +_080C105A: + ldr r0, [r7] + lsls r4, r5, 2 + adds r0, r4 + ldrh r0, [r0] + bl poke_something_2 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x19] + lsls r0, 25 + lsrs r0, 25 + ldr r1, [sp, 0x4] + cmp r1, r0 + bne _080C1090 + ldr r0, [r7] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C1090: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r7] + ldr r2, _080C1148 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C105A +_080C10A2: + ldr r1, _080C1144 + ldr r0, [r1] + ldr r2, _080C1148 + adds r0, r2 + strh r6, [r0] +_080C10AC: + ldr r0, [sp, 0x8] + cmp r0, 0xFF + bne _080C10C2 + mov r1, r10 + cmp r1, 0xFF + bne _080C10BA + b _080C11DE +_080C10BA: + mov r2, r10 + str r2, [sp, 0x8] + movs r0, 0xFF + mov r10, r0 +_080C10C2: + mov r1, r10 + cmp r1, 0xFF + bne _080C1158 + movs r5, 0 + movs r6, 0 + ldr r2, _080C1144 + ldr r0, [r2] + ldr r1, _080C1148 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + bcs _080C11D4 + adds r3, r2, 0 + mov r7, sp + mov r8, r2 +_080C10E0: + ldr r0, [r3] + lsls r4, r5, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x2] + lsls r0, 30 + cmp r0, 0 + bge _080C112A + ldrh r0, [r1] + str r3, [sp, 0x10] + bl poke_something_2 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _080C1154 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + strb r1, [r7] + ldrb r0, [r0, 0x7] + strb r0, [r7, 0x1] + ldr r3, [sp, 0x10] + ldr r2, [sp, 0x8] + cmp r1, r2 + beq _080C1118 + cmp r0, r2 + bne _080C112A +_080C1118: + ldr r0, [r3] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C112A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r1, r8 + ldr r0, [r1] + ldr r2, _080C1148 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C10E0 + b _080C11D4 + .align 2, 0 +_080C1140: .4byte 0x00000181 +_080C1144: .4byte 0x02039b4c +_080C1148: .4byte 0x0000060c +_080C114C: .4byte 0x0856ed08 +_080C1150: .4byte 0x083185c8 +_080C1154: .4byte 0x083203cc +_080C1158: + movs r5, 0 + movs r6, 0 + ldr r1, _080C1244 + ldr r0, [r1] + ldr r2, _080C1248 + adds r0, r2 + ldrh r0, [r0] + cmp r6, r0 + bcs _080C11D4 + mov r7, sp +_080C116C: + ldr r0, [r1] + lsls r1, r5, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x2] + lsls r0, 30 + adds r4, r1, 0 + cmp r0, 0 + bge _080C11C0 + ldrh r0, [r2] + bl poke_something_2 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _080C124C + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + strb r1, [r7] + ldrb r0, [r0, 0x7] + strb r0, [r7, 0x1] + ldr r2, [sp, 0x8] + cmp r1, r2 + bne _080C11A2 + cmp r0, r10 + beq _080C11AC +_080C11A2: + cmp r1, r10 + bne _080C11C0 + ldr r1, [sp, 0x8] + cmp r0, r1 + bne _080C11C0 +_080C11AC: + ldr r2, _080C1244 + ldr r0, [r2] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C11C0: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _080C1244 + ldr r0, [r1] + ldr r2, _080C1248 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C116C +_080C11D4: + ldr r1, _080C1244 + ldr r0, [r1] + ldr r2, _080C1248 + adds r0, r2 + strh r6, [r0] +_080C11DE: + ldr r1, _080C1244 + ldr r0, [r1] + ldr r2, _080C1248 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _080C1232 + adds r5, r0, 0 + ldr r0, _080C1250 + cmp r5, r0 + bhi _080C1232 + ldr r4, _080C1244 + movs r1, 0x2 + negs r1, r1 + mov r10, r1 + movs r2, 0x3 + negs r2, r2 + mov r9, r2 + mov r8, r0 + ldr r0, _080C1254 + adds r7, r0, 0 +_080C1208: + ldr r1, [r4] + lsls r3, r5, 2 + adds r1, r3 + ldrh r0, [r1] + orrs r0, r7 + strh r0, [r1] + ldrb r2, [r1, 0x2] + mov r0, r10 + ands r0, r2 + strb r0, [r1, 0x2] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1, 0x2] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x2] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bls _080C1208 +_080C1232: + adds r0, r6, 0 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080C1244: .4byte 0x02039b4c +_080C1248: .4byte 0x0000060c +_080C124C: .4byte 0x083203cc +_080C1250: .4byte 0x00000181 +_080C1254: .4byte 0x0000ffff + thumb_func_end sub_80C0F30 + + thumb_func_start sub_80C1258 +sub_80C1258: @ 80C1258 + push {lr} + ldr r0, _080C126C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080C126C: .4byte sub_80C12E0 + 1 + thumb_func_end sub_80C1258 + + thumb_func_start sub_80C1270 +sub_80C1270: @ 80C1270 + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r1, 0 + adds r3, r2, 0 + add r1, sp, 0x14 + movs r4, 0 + strb r4, [r1] + adds r2, r1, 0 + movs r1, 0xF + strb r1, [r2, 0x1] + movs r1, 0x2 + strb r1, [r2, 0x2] + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + subs r1, 0x3 + str r1, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl sub_8199EEC + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C1270 + + thumb_func_start sub_80C12B0 +sub_80C12B0: @ 80C12B0 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Window_FillPixelRect + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C12B0 + + thumb_func_start sub_80C12E0 +sub_80C12E0: @ 80C12E0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080C1304 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x4 + bhi _080C1320 + lsls r0, 2 + ldr r1, _080C1308 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C1304: .4byte 0x030022c0 +_080C1308: .4byte _080C130C + .align 2, 0 +_080C130C: + .4byte _080C1320 + .4byte _080C1414 + .4byte _080C1480 + .4byte _080C14A0 + .4byte _080C14F0 +_080C1320: + ldr r0, _080C13C8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080C1332 + b _080C1516 +_080C1332: + ldr r0, _080C13CC + ldr r0, [r0] + ldr r1, _080C13D0 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0 + bl sub_80C09B0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080C13D4 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x3 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x2 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + adds r0, r4, 0 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + ldr r0, _080C13D8 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + bl Window_WriteStandardTileMap + ldr r1, _080C13DC + movs r2, 0x80 + lsls r2, 6 + str r5, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + bl sub_809D42C + cmp r0, 0 + bne _080C13E4 + ldr r1, _080C13E0 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + b _080C13F0 + .align 2, 0 +_080C13C8: .4byte 0x02037fd4 +_080C13CC: .4byte 0x02039b4c +_080C13D0: .4byte 0x0000064a +_080C13D4: .4byte 0x0856eff8 +_080C13D8: .4byte 0x0856f008 +_080C13DC: .4byte 0x08dc3304 +_080C13E0: .4byte 0x08dc3a0c +_080C13E4: + ldr r1, _080C1408 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map +_080C13F0: + ldr r0, _080C140C + movs r1, 0x1 + movs r2, 0x7E + bl gpu_pal_apply + ldr r0, _080C1410 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080C1516 + .align 2, 0 +_080C1408: .4byte 0x08dc3870 +_080C140C: .4byte 0x08dc3286 +_080C1410: .4byte 0x030022c0 +_080C1414: + ldr r0, _080C1474 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080C1478 + bl gpu_pal_obj_alloc_and_load_multiple + adds r0, r4, 0 + bl sub_80C2594 + movs r1, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r2, r0, 3 + ldr r5, _080C147C + movs r3, 0 +_080C1432: + lsls r0, r1, 1 + adds r0, r2 + adds r0, r5 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _080C1432 + adds r0, r4, 0 + bl sub_80C23B8 + movs r0, 0 + bl sub_80C2040 + adds r0, r4, 0 + bl sub_80C20F8 + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080C14DA + .align 2, 0 +_080C1474: .4byte 0x0855d26c +_080C1478: .4byte 0x0855d27c +_080C147C: .4byte 0x03005e08 +_080C1480: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _080C149C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080C14E2 + .align 2, 0 +_080C149C: .4byte 0x030022c0 +_080C14A0: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_080C14DA: + ldr r1, _080C14EC + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080C14E2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C1516 + .align 2, 0 +_080C14EC: .4byte 0x030022c0 +_080C14F0: + ldr r0, _080C1520 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080C1516 + ldr r1, _080C1524 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080C1528 + str r1, [r0] + movs r1, 0x87 + lsls r1, 3 + adds r0, r3, r1 + strb r2, [r0] +_080C1516: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C1520: .4byte 0x02037fd4 +_080C1524: .4byte 0x03005e00 +_080C1528: .4byte sub_80C1570 + 1 + thumb_func_end sub_80C12E0 + + thumb_func_start sub_80C152C +sub_80C152C: @ 80C152C + push {lr} + bl Window_FreeMemory + movs r0, 0 + bl bg_get_tilemap + cmp r0, 0 + beq _080C1540 + bl free +_080C1540: + movs r0, 0x1 + bl bg_get_tilemap + cmp r0, 0 + beq _080C154E + bl free +_080C154E: + movs r0, 0x2 + bl bg_get_tilemap + cmp r0, 0 + beq _080C155C + bl free +_080C155C: + movs r0, 0x3 + bl bg_get_tilemap + cmp r0, 0 + beq _080C156A + bl free +_080C156A: + pop {r0} + bx r0 + thumb_func_end sub_80C152C + + thumb_func_start sub_80C1570 +sub_80C1570: @ 80C1570 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080C15A8 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + ldrb r0, [r5, 0x8] + bl sub_80C2040 + adds r0, r4, 0 + bl sub_80C20F8 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _080C15AC + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C15A8: .4byte 0x03005e00 +_080C15AC: .4byte sub_80C15B0 + 1 + thumb_func_end sub_80C1570 + + thumb_func_start sub_80C15B0 +sub_80C15B0: @ 80C15B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080C15D8 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C15E4 + movs r0, 0x3 + bl audio_play + ldr r0, _080C15DC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080C15E0 + str r0, [r1] + b _080C16BC + .align 2, 0 +_080C15D8: .4byte 0x030022c0 +_080C15DC: .4byte 0x03005e00 +_080C15E0: .4byte sub_80C1D38 + 1 +_080C15E4: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1640 + ldr r1, _080C1608 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r4, [r5, r0] + cmp r4, 0x1 + beq _080C161C + cmp r4, 0x1 + bgt _080C160C + cmp r4, 0 + beq _080C1612 + b _080C16BC + .align 2, 0 +_080C1608: .4byte 0x03005e00 +_080C160C: + cmp r4, 0x2 + beq _080C1630 + b _080C16BC +_080C1612: + movs r0, 0x15 + bl audio_play + strh r4, [r5, 0xA] + b _080C1626 +_080C161C: + movs r0, 0x15 + bl audio_play + movs r0, 0x4 + strh r0, [r5, 0xA] +_080C1626: + ldr r0, _080C162C + str r0, [r5] + b _080C16BC + .align 2, 0 +_080C162C: .4byte sub_80C16CC + 1 +_080C1630: + movs r0, 0x3 + bl audio_play + ldr r0, _080C163C + str r0, [r5] + b _080C16BC + .align 2, 0 +_080C163C: .4byte sub_80C1D38 + 1 +_080C1640: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C167C + ldr r0, _080C16C4 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _080C167C + movs r0, 0x6D + bl audio_play + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C2040 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C167C: + ldr r0, _080C16C8 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C16BC + ldr r0, _080C16C4 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bgt _080C16BC + movs r0, 0x6D + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C2040 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C16BC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C16C4: .4byte 0x03005e00 +_080C16C8: .4byte 0x030022c0 + thumb_func_end sub_80C15B0 + + thumb_func_start sub_80C16CC +sub_80C16CC: @ 80C16CC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080C1704 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + ldrb r0, [r5, 0x8] + ldrb r1, [r5, 0xA] + bl sub_80C2064 + adds r0, r4, 0 + bl sub_80C20F8 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _080C1708 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C1704: .4byte 0x03005e00 +_080C1708: .4byte sub_80C170C + 1 + thumb_func_end sub_80C16CC + + thumb_func_start sub_80C170C +sub_80C170C: @ 80C170C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080C1734 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080C1740 + bl sub_809D42C + ldr r6, _080C1738 + cmp r0, 0 + bne _080C174C + ldr r6, _080C173C + b _080C174C + .align 2, 0 +_080C1734: .4byte 0x03005e00 +_080C1738: .4byte 0x0856edb8 +_080C173C: .4byte 0x0856edf0 +_080C1740: + bl sub_809D42C + ldr r6, _080C1778 + cmp r0, 0 + bne _080C174C + ldr r6, _080C177C +_080C174C: + ldr r0, _080C1780 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080C178C + movs r0, 0x17 + bl audio_play + adds r0, r5, 0 + bl sub_80C23B8 + ldr r0, _080C1784 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080C1788 + str r0, [r1] + b _080C1994 + .align 2, 0 +_080C1778: .4byte 0x0856ed9c +_080C177C: .4byte 0x0856edd4 +_080C1780: .4byte 0x030022c0 +_080C1784: .4byte 0x03005e00 +_080C1788: .4byte sub_80C1570 + 1 +_080C178C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1870 + ldr r0, _080C181C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r6, r1, r0 + movs r2, 0xA + ldrsh r0, [r6, r2] + cmp r0, 0x6 + bne _080C1860 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080C183C + ldr r1, _080C1820 + movs r0, 0x40 + strb r0, [r1] + ldr r7, _080C1824 + ldr r1, [r7] + ldr r0, _080C1828 + adds r2, r1, r0 + movs r0, 0x40 + strh r0, [r2] + ldr r0, _080C182C + strh r3, [r0] + movs r2, 0xC2 + lsls r2, 3 + adds r1, r2 + strh r3, [r1] + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80C2318 + ldr r4, _080C1830 + ldr r1, [r4] + strb r0, [r1, 0x19] + bl sub_809D42C + cmp r0, 0 + bne _080C17E8 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x19] +_080C17E8: + ldr r0, [r7] + ldr r1, [r4] + ldrb r1, [r1, 0x19] + ldr r2, _080C1834 + adds r0, r2 + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80C2318 + ldr r1, [r4] + strb r0, [r1, 0x18] + ldr r0, [r7] + ldr r1, [r4] + ldrb r1, [r1, 0x18] + movs r2, 0xC3 + lsls r2, 3 + adds r0, r2 + strh r1, [r0] + movs r0, 0x3 + bl audio_play + ldr r0, _080C1838 + str r0, [r6] + b _080C1994 + .align 2, 0 +_080C181C: .4byte 0x03005e00 +_080C1820: .4byte 0x02039b52 +_080C1824: .4byte 0x02039b4c +_080C1828: .4byte 0x0000062a +_080C182C: .4byte 0x02039b50 +_080C1830: .4byte 0x03005d90 +_080C1834: .4byte 0x00000614 +_080C1838: .4byte sub_80C1D38 + 1 +_080C183C: + ldr r0, _080C1858 + bl sub_80C2618 + ldr r0, _080C185C + str r0, [r6] + movs r0, 0x70 + bl audio_play + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + b _080C1994 + .align 2, 0 +_080C1858: .4byte 0x085e875b +_080C185C: .4byte sub_80C19A4 + 1 +_080C1860: + movs r0, 0x15 + bl audio_play + ldr r0, _080C186C + str r0, [r6] + b _080C1994 + .align 2, 0 +_080C186C: .4byte sub_80C1B64 + 1 +_080C1870: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C18B6 + ldr r1, _080C199C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080C18B6 + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C18B6: + ldr r0, _080C19A0 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C1900 + ldr r1, _080C199C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x1] + cmp r0, 0xFF + beq _080C1900 + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x1] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C1900: + ldr r0, _080C19A0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C194A + ldr r1, _080C199C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + cmp r0, 0xFF + beq _080C194A + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x2] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C194A: + ldr r0, _080C19A0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C1994 + ldr r1, _080C199C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + cmp r0, 0xFF + beq _080C1994 + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x3] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C1994: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C199C: .4byte 0x03005e00 +_080C19A0: .4byte 0x030022c0 + thumb_func_end sub_80C170C + + thumb_func_start sub_80C19A4 +sub_80C19A4: @ 80C19A4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80C2318 + mov r10, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80C2318 + mov r9, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r5, 0 + movs r1, 0 + bl sub_80C2318 + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80C2318 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80C2318 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80C2318 + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r9 + mov r2, r8 + adds r3, r6, 0 + bl sub_80C0F30 + ldr r1, _080C1A44 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080C1A48 + str r1, [r0] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C1A44: .4byte 0x03005e00 +_080C1A48: .4byte sub_80C1A4C + 1 + thumb_func_end sub_80C19A4 + + thumb_func_start sub_80C1A4C +sub_80C1A4C: @ 80C1A4C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080C1AA6 + ldr r0, _080C1A78 + ldr r0, [r0] + ldr r1, _080C1A7C + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C1A84 + movs r0, 0x1F + bl audio_play + ldr r0, _080C1A80 + bl sub_80C2618 + b _080C1A90 + .align 2, 0 +_080C1A78: .4byte 0x02039b4c +_080C1A7C: .4byte 0x0000060c +_080C1A80: .4byte 0x085e8773 +_080C1A84: + movs r0, 0x20 + bl audio_play + ldr r0, _080C1AAC + bl sub_80C2618 +_080C1A90: + ldr r0, _080C1AB0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080C1AB4 + str r0, [r1] + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram +_080C1AA6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C1AAC: .4byte 0x085e8785 +_080C1AB0: .4byte 0x03005e00 +_080C1AB4: .4byte sub_80C1AB8 + 1 + thumb_func_end sub_80C1A4C + + thumb_func_start sub_80C1AB8 +sub_80C1AB8: @ 80C1AB8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r2, r4, 0 + ldr r0, _080C1B20 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1B54 + ldr r5, _080C1B24 + ldr r1, [r5] + ldr r3, _080C1B28 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080C1B40 + ldr r0, _080C1B2C + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x5 + bl sub_80C2318 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080C1B30 + adds r1, r2 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80C2318 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080C1B34 + adds r1, r3 + strh r0, [r1] + ldr r1, _080C1B38 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080C1B3C + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080C1B54 + .align 2, 0 +_080C1B20: .4byte 0x030022c0 +_080C1B24: .4byte 0x02039b4c +_080C1B28: .4byte 0x0000060c +_080C1B2C: .4byte 0x0000064e +_080C1B30: .4byte 0x00000612 +_080C1B34: .4byte 0x00000616 +_080C1B38: .4byte 0x03005e00 +_080C1B3C: .4byte sub_80C1D38 + 1 +_080C1B40: + ldr r0, _080C1B5C + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080C1B60 + str r0, [r1] + movs r0, 0x17 + bl audio_play +_080C1B54: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C1B5C: .4byte 0x03005e00 +_080C1B60: .4byte sub_80C16CC + 1 + thumb_func_end sub_80C1AB8 + + thumb_func_start sub_80C1B64 +sub_80C1B64: @ 80C1B64 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + bl sub_80C21D4 + ldr r2, _080C1BC0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r6, r1, r2 + ldrb r0, [r6, 0xA] + adds r2, 0x8 + adds r1, r2 + ldr r2, _080C1BC4 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x4] + lsls r4, 1 + adds r4, r1, r4 + ldrb r0, [r0, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r4] + strh r0, [r6, 0x24] + ldrh r0, [r1] + strh r0, [r6, 0x26] + adds r0, r5, 0 + bl sub_80C2294 + ldrh r0, [r4] + bl sub_80C2650 + ldr r0, _080C1BC8 + str r0, [r6] + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C1BC0: .4byte 0x03005e00 +_080C1BC4: .4byte 0x0856efc8 +_080C1BC8: .4byte sub_80C1BCC + 1 + thumb_func_end sub_80C1B64 + + thumb_func_start sub_80C1BCC +sub_80C1BCC: @ 80C1BCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, _080C1C24 + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 3 + adds r5, r2, r3 + ldrb r1, [r5, 0xA] + ldr r0, _080C1C28 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + mov r8, r0 + adds r3, 0x8 + adds r2, r3 + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r4, r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 1 + adds r6, r2, r0 + ldrh r0, [r1, 0x6] + subs r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _080C1C2C + mov r12, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1C30 + movs r0, 0x15 + bl audio_play + bl sub_80C267C + movs r0, 0x1 + bl sub_80C21D4 + b _080C1C50 + .align 2, 0 +_080C1C24: .4byte 0x03005e00 +_080C1C28: .4byte 0x0856efc8 +_080C1C2C: .4byte 0x030022c0 +_080C1C30: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C1C68 + movs r0, 0x17 + bl audio_play + bl sub_80C267C + movs r0, 0x1 + bl sub_80C21D4 + ldrh r0, [r5, 0x24] + strh r0, [r4] + ldrh r0, [r5, 0x26] + strh r0, [r6] +_080C1C50: + ldr r0, _080C1C64 + str r0, [r5] + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080C1D2E + .align 2, 0 +_080C1C64: .4byte sub_80C16CC + 1 +_080C1C68: + movs r3, 0 + mov r0, r12 + ldrh r1, [r0, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C1CCA + ldrh r0, [r4] + cmp r0, 0 + beq _080C1C8E + bl sub_80C2638 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r4] + bl sub_80C2650 + b _080C1CAA +_080C1C8E: + ldrh r0, [r6] + cmp r0, 0 + beq _080C1CA6 + subs r0, 0x1 + strh r0, [r6] + adds r0, r7, 0 + bl sub_80C2294 + ldrh r0, [r4] + bl sub_80C2650 + movs r3, 0x1 +_080C1CA6: + cmp r3, 0 + beq _080C1D2E +_080C1CAA: + movs r0, 0x5 + bl audio_play + ldrh r0, [r4] + ldrh r1, [r6] + adds r0, r1 + lsls r0, 3 + add r0, r8 + ldr r0, [r0] + bl sub_80C2618 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + b _080C1D2E +_080C1CCA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C1D2E + ldrh r0, [r4] + cmp r0, 0x4 + bhi _080C1CEE + cmp r0, r2 + bcs _080C1CEE + bl sub_80C2638 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldrh r0, [r4] + bl sub_80C2650 + b _080C1D10 +_080C1CEE: + cmp r2, 0x5 + bls _080C1D0C + ldrh r1, [r6] + subs r0, r2, 0x5 + cmp r1, r0 + bge _080C1D0C + adds r0, r1, 0x1 + strh r0, [r6] + adds r0, r7, 0 + bl sub_80C2294 + movs r0, 0x5 + bl sub_80C2650 + movs r3, 0x1 +_080C1D0C: + cmp r3, 0 + beq _080C1D2E +_080C1D10: + movs r0, 0x5 + bl audio_play + ldrh r0, [r4] + ldrh r1, [r6] + adds r0, r1 + lsls r0, 3 + add r0, r8 + ldr r0, [r0] + bl sub_80C2618 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram +_080C1D2E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C1BCC + + thumb_func_start sub_80C1D38 +sub_80C1D38: @ 80C1D38 + 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 sub_80A1AD4 + ldr r1, _080C1D68 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080C1D6C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C1D68: .4byte 0x03005e00 +_080C1D6C: .4byte sub_80C1D70 + 1 + thumb_func_end sub_80C1D38 + + thumb_func_start sub_80C1D70 +sub_80C1D70: @ 80C1D70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080C1D94 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080C1D8C + bl sub_80C152C + adds r0, r4, 0 + bl remove_task +_080C1D8C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C1D94: .4byte 0x02037fd4 + thumb_func_end sub_80C1D70 + + thumb_func_start sub_80C1D98 +sub_80C1D98: @ 80C1D98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3 + bl bg_get_tilemap + adds r2, r0, 0 + movs r3, 0 + cmp r3, r4 + bcs _080C1DEC + lsls r0, r5, 6 + adds r7, r0, r2 + ldr r5, _080C1DF8 + lsls r2, r6, 12 +_080C1DC8: + mov r0, r8 + adds r1, r0, r3 + lsls r1, 1 + adds r1, r7 + ldrh r0, [r1] + ands r0, r5 + orrs r0, r2 + strh r0, [r1] + adds r1, 0x40 + ldrh r0, [r1] + ands r0, r5 + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _080C1DC8 +_080C1DEC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C1DF8: .4byte 0x00000fff + thumb_func_end sub_80C1D98 + + thumb_func_start sub_80C1DFC +sub_80C1DFC: @ 80C1DFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + ands r5, r0 + ands r2, r0 + lsls r2, 1 + orrs r5, r2 + cmp r4, 0xA + bhi _080C1EE8 + lsls r0, r4, 2 + ldr r1, _080C1E24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C1E24: .4byte _080C1E28 + .align 2, 0 +_080C1E28: + .4byte _080C1E54 + .4byte _080C1E54 + .4byte _080C1E54 + .4byte _080C1E64 + .4byte _080C1E64 + .4byte _080C1E7C + .4byte _080C1E7C + .4byte _080C1E64 + .4byte _080C1E64 + .4byte _080C1EA4 + .4byte _080C1E94 +_080C1E54: + ldr r1, _080C1E60 + lsls r0, r4, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + b _080C1EC2 + .align 2, 0 +_080C1E60: .4byte 0x0856ed30 +_080C1E64: + ldr r2, _080C1E90 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + ldrb r3, [r0, 0x6] + adds r0, r5, 0 + bl sub_80C1D98 +_080C1E7C: + ldr r2, _080C1E90 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x7] + ldrb r2, [r0, 0x8] + ldrb r3, [r0, 0x9] + b _080C1EC4 + .align 2, 0 +_080C1E90: .4byte 0x0856ed48 +_080C1E94: + ldr r0, _080C1EA0 + ldrb r1, [r0, 0x1C] + ldrb r2, [r0, 0x1D] + ldrb r3, [r0, 0x1E] + b _080C1EC4 + .align 2, 0 +_080C1EA0: .4byte 0x0856ed48 +_080C1EA4: + bl sub_809D42C + cmp r0, 0 + bne _080C1ED0 + ldr r2, _080C1ECC + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + subs r2, 0x2 + lsls r2, 24 + lsrs r2, 24 +_080C1EC2: + ldrb r3, [r0, 0x6] +_080C1EC4: + adds r0, r5, 0 + bl sub_80C1D98 + b _080C1EE8 + .align 2, 0 +_080C1ECC: .4byte 0x0856ed48 +_080C1ED0: + ldr r2, _080C1EF0 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + ldrb r3, [r0, 0x6] + adds r0, r5, 0 + bl sub_80C1D98 +_080C1EE8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C1EF0: .4byte 0x0856ed48 + thumb_func_end sub_80C1DFC + + thumb_func_start sub_80C1EF4 +sub_80C1EF4: @ 80C1EF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _080C1F5E + cmp r0, 0x1 + bgt _080C1F0A + cmp r0, 0 + beq _080C1F10 + b _080C203C +_080C1F0A: + cmp r1, 0x2 + beq _080C1FCE + b _080C203C +_080C1F10: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0xA + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0 + b _080C1FAA +_080C1F5E: + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0xA + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0x1 +_080C1FAA: + bl sub_80C1DFC + movs r0, 0x7 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x8 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x9 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + b _080C203C +_080C1FCE: + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0xA + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x9 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC +_080C203C: + pop {r0} + bx r0 + thumb_func_end sub_80C1EF4 + + thumb_func_start sub_80C2040 +sub_80C2040: @ 80C2040 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80C1EF4 + ldr r0, _080C2060 + lsls r4, 3 + adds r4, r0 + ldr r0, [r4] + bl sub_80C2618 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C2060: .4byte 0x0856ed30 + thumb_func_end sub_80C2040 + + thumb_func_start sub_80C2064 +sub_80C2064: @ 80C2064 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_80C1EF4 + cmp r4, 0x6 + bhi _080C20DE + lsls r0, r4, 2 + ldr r1, _080C2080 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C2080: .4byte _080C2084 + .align 2, 0 +_080C2084: + .4byte _080C20A0 + .4byte _080C20A4 + .4byte _080C20A8 + .4byte _080C20B6 + .4byte _080C20C4 + .4byte _080C20C8 + .4byte _080C20D4 +_080C20A0: + movs r0, 0x3 + b _080C20CA +_080C20A4: + movs r0, 0x4 + b _080C20CA +_080C20A8: + movs r0, 0xA + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x5 + b _080C20CA +_080C20B6: + movs r0, 0xA + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x6 + b _080C20CA +_080C20C4: + movs r0, 0x7 + b _080C20CA +_080C20C8: + movs r0, 0x8 +_080C20CA: + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + b _080C20DE +_080C20D4: + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC +_080C20DE: + ldr r0, _080C20F4 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_80C2618 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C20F4: .4byte 0x0856ed48 + thumb_func_end sub_80C2064 + + thumb_func_start sub_80C20F8 +sub_80C20F8: @ 80C20F8 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x28 + movs r1, 0x10 + movs r2, 0x60 + movs r3, 0x50 + bl sub_80C12B0 + ldr r1, _080C21BC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x16] + ldrh r1, [r5, 0x14] + adds r0, r1 + lsls r0, 16 + ldr r1, _080C21C0 + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x11 + bl sub_80C1270 + ldrh r0, [r5, 0x1A] + ldrh r1, [r5, 0x18] + adds r0, r1 + lsls r0, 16 + ldr r1, _080C21C4 + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x21 + bl sub_80C1270 + ldrh r0, [r5, 0x1E] + ldrh r1, [r5, 0x1C] + adds r0, r1 + lsls r0, 16 + ldr r4, _080C21C8 + lsrs r0, 13 + adds r4, 0x4 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x31 + bl sub_80C1270 + ldrh r0, [r5, 0x22] + ldrh r1, [r5, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r0, 13 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x5D + movs r2, 0x31 + bl sub_80C1270 + ldrh r0, [r5, 0x12] + ldrh r1, [r5, 0x10] + adds r0, r1 + lsls r0, 16 + ldr r1, _080C21CC + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x41 + bl sub_80C1270 + bl sub_809D42C + cmp r0, 0 + beq _080C21B6 + ldrh r0, [r5, 0xE] + ldrh r5, [r5, 0xC] + adds r0, r5 + lsls r0, 16 + ldr r1, _080C21D0 + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x51 + bl sub_80C1270 +_080C21B6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C21BC: .4byte 0x03005e00 +_080C21C0: .4byte 0x0856ee5c +_080C21C4: .4byte 0x0856eeb4 +_080C21C8: .4byte 0x0856ef14 +_080C21CC: .4byte 0x0856ee24 +_080C21D0: .4byte 0x0856ee0c + thumb_func_end sub_80C20F8 + + thumb_func_start sub_80C21D4 +sub_80C21D4: @ 80C21D4 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3 + bl bg_get_tilemap + adds r5, r0, 0 + cmp r4, 0 + bne _080C2268 + ldr r1, _080C2258 + adds r0, r1, 0 + strh r0, [r5, 0x22] + movs r1, 0x12 + ldr r0, _080C225C + adds r2, r0, 0 +_080C21F4: + lsls r0, r1, 1 + adds r0, r5 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1E + bls _080C21F4 + movs r2, 0x1 + ldr r1, _080C2260 + adds r6, r1, 0 + movs r4, 0x2 +_080C220C: + lsls r0, r2, 6 + adds r0, r5 + strh r6, [r0, 0x22] + movs r1, 0x12 + adds r3, r2, 0x1 + adds r2, r0, 0 +_080C2218: + lsls r0, r1, 1 + adds r0, r2 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1E + bls _080C2218 + lsls r0, r3, 16 + lsrs r2, r0, 16 + cmp r2, 0xC + bls _080C220C + ldr r2, _080C2264 + adds r1, r5, r2 + adds r2, 0xA9 + adds r0, r2, 0 + strh r0, [r1] + movs r1, 0x12 + movs r3, 0xD0 + lsls r3, 2 + movs r2, 0xD +_080C2242: + lsls r0, r1, 1 + adds r0, r5 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1E + bls _080C2242 + b _080C228C + .align 2, 0 +_080C2258: .4byte 0x00000c0b +_080C225C: .4byte 0x0000080d +_080C2260: .4byte 0x0000040a +_080C2264: .4byte 0x00000362 +_080C2268: + movs r2, 0 + movs r4, 0x4F +_080C226C: + movs r1, 0x11 + lsls r0, r2, 6 + adds r3, r2, 0x1 + adds r2, r0, r5 +_080C2274: + lsls r0, r1, 1 + adds r0, r2 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1D + bls _080C2274 + lsls r0, r3, 16 + lsrs r2, r0, 16 + cmp r2, 0xD + bls _080C226C +_080C228C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C21D4 + + thumb_func_start sub_80C2294 +sub_80C2294: @ 80C2294 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080C22D0 + ldr r3, _080C22D4 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r0, r2, r3 + movs r5, 0xA + ldrsh r1, [r0, r5] + lsls r1, 3 + adds r1, r4 + ldr r6, [r1] + adds r3, 0x8 + adds r2, r3 + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r0, r2 + mov r8, r0 + ldrb r0, [r1, 0x5] + lsls r0, 1 + adds r7, r2, r0 + bl sub_80C267C + movs r5, 0 + ldrh r4, [r7] + b _080C22F2 + .align 2, 0 +_080C22D0: .4byte 0x0856efc8 +_080C22D4: .4byte 0x03005e00 +_080C22D8: + adds r0, r1, r6 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl sub_80C2668 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x5 + bhi _080C22FC +_080C22F2: + lsls r1, r4, 3 + adds r0, r1, r6 + ldr r0, [r0, 0x4] + cmp r0, 0 + bne _080C22D8 +_080C22FC: + mov r1, r8 + ldrh r0, [r1] + ldrh r1, [r7] + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldr r0, [r0] + bl sub_80C2618 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C2294 + + thumb_func_start sub_80C2318 +sub_80C2318: @ 80C2318 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080C2358 + adds r1, r0 + ldr r2, _080C235C + lsls r0, r3, 3 + adds r0, r2 + ldrb r2, [r0, 0x4] + lsls r2, 1 + adds r2, r1, r2 + ldrb r0, [r0, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r3, 0x5 + bhi _080C237C + lsls r0, r3, 2 + ldr r1, _080C2360 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C2358: .4byte 0x03005e08 +_080C235C: .4byte 0x0856efc8 +_080C2360: .4byte _080C2364 + .align 2, 0 +_080C2364: + .4byte _080C2390 + .4byte _080C239A + .4byte _080C23AA + .4byte _080C23AA + .4byte _080C2388 + .4byte _080C2380 +_080C237C: + movs r0, 0 + b _080C23B0 +_080C2380: + ldr r0, _080C2384 + b _080C23AC + .align 2, 0 +_080C2384: .4byte 0x0856efac +_080C2388: + ldr r0, _080C238C + b _080C23AC + .align 2, 0 +_080C238C: .4byte 0x0856efae +_080C2390: + cmp r2, 0 + beq _080C239E + lsls r0, r2, 24 + lsrs r0, 24 + b _080C23B0 +_080C239A: + cmp r2, 0 + bne _080C23A2 +_080C239E: + movs r0, 0xFF + b _080C23B0 +_080C23A2: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _080C23B0 +_080C23AA: + ldr r0, _080C23B4 +_080C23AC: + adds r0, r2, r0 + ldrb r0, [r0] +_080C23B0: + pop {r1} + bx r1 + .align 2, 0 +_080C23B4: .4byte 0x0856efb4 + thumb_func_end sub_80C2318 + + thumb_func_start sub_80C23B8 +sub_80C23B8: @ 80C23B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080C23D8 + ldr r0, [r1] + ldr r2, _080C23DC + adds r0, r2 + ldrh r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _080C23D2 + cmp r0, 0x1 + beq _080C23E0 +_080C23D2: + movs r3, 0 + b _080C23E2 + .align 2, 0 +_080C23D8: .4byte 0x02039b4c +_080C23DC: .4byte 0x00000614 +_080C23E0: + movs r3, 0x1 +_080C23E2: + ldr r1, _080C2408 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0xC] + ldr r0, [r5] + movs r3, 0xC3 + lsls r3, 3 + adds r0, r3 + ldrh r0, [r0] + adds r5, r1, 0 + cmp r0, 0x5 + bhi _080C2428 + lsls r0, 2 + ldr r1, _080C240C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C2408: .4byte 0x03005e00 +_080C240C: .4byte _080C2410 + .align 2, 0 +_080C2410: + .4byte _080C2428 + .4byte _080C242C + .4byte _080C2430 + .4byte _080C2434 + .4byte _080C2438 + .4byte _080C243C +_080C2428: + movs r3, 0 + b _080C243E +_080C242C: + movs r3, 0x1 + b _080C243E +_080C2430: + movs r3, 0x2 + b _080C243E +_080C2434: + movs r3, 0x3 + b _080C243E +_080C2438: + movs r3, 0x4 + b _080C243E +_080C243C: + movs r3, 0x5 +_080C243E: + adds r0, r2, r4 + lsls r0, 3 + adds r0, r5 + strh r3, [r0, 0x10] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C23B8 + + thumb_func_start sub_80C244C +sub_80C244C: @ 80C244C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080C2484 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r3 + ldrb r2, [r0, 0xA] + adds r3, 0x8 + adds r1, r3 + ldr r0, _080C2488 + lsls r2, 3 + adds r2, r0 + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r2, 0x6] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _080C248C + ldrh r0, [r1] + cmp r0, 0 + beq _080C248C + movs r0, 0 + b _080C248E + .align 2, 0 +_080C2484: .4byte 0x03005e00 +_080C2488: .4byte 0x0856efc8 +_080C248C: + movs r0, 0x1 +_080C248E: + pop {r1} + bx r1 + thumb_func_end sub_80C244C + + thumb_func_start sub_80C2494 +sub_80C2494: @ 80C2494 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080C24D0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r3 + ldrb r2, [r0, 0xA] + adds r3, 0x8 + adds r1, r3 + ldr r0, _080C24D4 + lsls r2, 3 + adds r2, r0 + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r2, 0x6] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _080C24D8 + ldrh r1, [r1] + subs r0, 0x5 + cmp r1, r0 + bge _080C24D8 + movs r0, 0 + b _080C24DA + .align 2, 0 +_080C24D0: .4byte 0x03005e00 +_080C24D4: .4byte 0x0856efc8 +_080C24D8: + movs r0, 0x1 +_080C24DA: + pop {r1} + bx r1 + thumb_func_end sub_80C2494 + + thumb_func_start sub_80C24E0 +sub_80C24E0: @ 80C24E0 + push {r4,lr} + adds r4, r0, 0 + ldr r2, _080C2520 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, [r0] + ldr r0, _080C2524 + cmp r1, r0 + bne _080C2580 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080C2528 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C2494 + lsls r0, 24 + cmp r0, 0 + beq _080C2544 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _080C2550 + .align 2, 0 +_080C2520: .4byte 0x03005e00 +_080C2524: .4byte sub_80C1BCC + 1 +_080C2528: + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C244C + lsls r0, 24 + cmp r0, 0 + beq _080C2544 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _080C2550 +_080C2544: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_080C2550: + strb r0, [r2] + ldrh r2, [r4, 0x32] + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 7 + adds r0, r2, r0 + lsls r0, 24 + ldr r1, _080C257C + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080C256E + adds r0, 0x7F +_080C256E: + asrs r0, 7 + strh r0, [r4, 0x26] + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r4, 0x32] + b _080C258C + .align 2, 0 +_080C257C: .4byte 0x08329f40 +_080C2580: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080C258C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C24E0 + + thumb_func_start sub_80C2594 +sub_80C2594: @ 80C2594 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _080C260C + adds r0, r6, 0 + movs r1, 0xB8 + movs r2, 0x4 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080C2610 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r0, r1, r4 + movs r2, 0 + strh r5, [r0, 0x2E] + strh r2, [r0, 0x30] + movs r0, 0x1C + adds r0, r4 + mov r9, r0 + add r1, r9 + ldr r0, _080C2614 + mov r8, r0 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0xB8 + movs r2, 0x6C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r4 + strh r5, [r4, 0x2E] + movs r0, 0x1 + strh r0, [r4, 0x30] + adds r4, 0x3F + ldrb r0, [r4] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r4] + add r1, r9 + mov r0, r8 + str r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C260C: .4byte 0x0855d1ac +_080C2610: .4byte 0x02020630 +_080C2614: .4byte sub_80C24E0 + 1 + thumb_func_end sub_80C2594 + + thumb_func_start sub_80C2618 +sub_80C2618: @ 80C2618 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x8 + movs r1, 0x78 + movs r2, 0xE0 + movs r3, 0x20 + bl sub_80C12B0 + adds r0, r4, 0 + movs r1, 0x8 + movs r2, 0x79 + bl sub_80C1270 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C2618 + + thumb_func_start sub_80C2638 +sub_80C2638: @ 80C2638 + push {lr} + adds r1, r0, 0 + lsls r1, 4 + adds r1, 0x8 + movs r0, 0x90 + movs r2, 0x8 + movs r3, 0x10 + bl sub_80C12B0 + pop {r0} + bx r0 + thumb_func_end sub_80C2638 + + thumb_func_start sub_80C2650 +sub_80C2650: @ 80C2650 + push {lr} + adds r2, r0, 0 + ldr r0, _080C2664 + lsls r2, 4 + adds r2, 0x9 + movs r1, 0x90 + bl sub_80C1270 + pop {r0} + bx r0 + .align 2, 0 +_080C2664: .4byte 0x085e8b3a + thumb_func_end sub_80C2650 + + thumb_func_start sub_80C2668 +sub_80C2668: @ 80C2668 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + lsls r2, 4 + adds r2, 0x9 + movs r1, 0x98 + bl sub_80C1270 + pop {r0} + bx r0 + thumb_func_end sub_80C2668 + + thumb_func_start sub_80C267C +sub_80C267C: @ 80C267C + push {lr} + movs r0, 0x90 + movs r1, 0x8 + movs r2, 0x60 + movs r3, 0x60 + bl sub_80C12B0 + pop {r0} + bx r0 + thumb_func_end sub_80C267C + + thumb_func_start sub_80C2690 +sub_80C2690: @ 80C2690 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80C48C8 + ldr r0, _080C26C4 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080C26C0 + ldr r1, _080C26C8 + ldr r0, _080C26CC + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _080C26D0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_080C26C0: + pop {r0} + bx r0 + .align 2, 0 +_080C26C4: .4byte 0x02039ce8 +_080C26C8: .4byte 0x040000d4 +_080C26CC: .4byte 0x02038c28 +_080C26D0: .4byte 0x800000a0 + thumb_func_end sub_80C2690 + + thumb_func_start sub_80C26D4 +sub_80C26D4: @ 80C26D4 + push {r4,lr} + ldr r4, _080C2700 + ldrh r3, [r4] + movs r0, 0 + strh r0, [r4] + ldr r1, _080C2704 + ldr r0, _080C2708 + ldrh r2, [r0] + movs r0, 0xFF + ands r0, r2 + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _080C270C + strh r1, [r0] + strh r3, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C2700: .4byte 0x04000208 +_080C2704: .4byte 0x02038c28 +_080C2708: .4byte 0x04000006 +_080C270C: .4byte 0x04000012 + thumb_func_end sub_80C26D4 + + thumb_func_start sub_80C2710 +sub_80C2710: @ 80C2710 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80C2710 + + thumb_func_start sub_80C2728 +sub_80C2728: @ 80C2728 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080C275C + ldr r0, [r5] + movs r1, 0xA6 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl set_callback2 + bl Window_FreeMemory + ldr r0, [r5] + bl free + movs r0, 0 + str r0, [r5] + adds r0, r4, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C275C: .4byte 0x02039ce8 + thumb_func_end sub_80C2728 + + thumb_func_start sub_80C2760 +sub_80C2760: @ 80C2760 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080C2780 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x10 + bls _080C2776 + b _080C2ACA +_080C2776: + lsls r0, 2 + ldr r1, _080C2784 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C2780: .4byte 0x02039ce8 +_080C2784: .4byte _080C2788 + .align 2, 0 +_080C2788: + .4byte _080C27CC + .4byte _080C27E2 + .4byte _080C27F0 + .4byte _080C27F8 + .4byte _080C280C + .4byte _080C2820 + .4byte _080C2830 + .4byte _080C2836 + .4byte _080C289C + .4byte _080C28C8 + .4byte _080C28E4 + .4byte _080C299C + .4byte _080C2970 + .4byte _080C2AAA + .4byte _080C2A98 + .4byte _080C2A2C + .4byte _080C2A68 +_080C27CC: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + beq _080C27D8 + b _080C2ACA +_080C27D8: + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + b _080C28D4 +_080C27E2: + bl sub_80C3438 + lsls r0, 24 + cmp r0, 0 + bne _080C27EE + b _080C2ACA +_080C27EE: + b _080C28D4 +_080C27F0: + movs r0, 0x1 + bl sub_80C438C + b _080C28D4 +_080C27F8: + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + bl sub_80C4FF0 + movs r0, 0x2 + bl sub_80C438C + b _080C28D4 +_080C280C: + ldr r0, [r4] + ldr r1, _080C281C + adds r0, r1 + bl sub_80C4550 + ldr r1, [r4] + b _080C28D8 + .align 2, 0 +_080C281C: .4byte 0x00000ef8 +_080C2820: + ldr r0, [r4] + movs r2, 0xB3 + lsls r2, 3 + adds r0, r2 + bl sub_80C45C0 + ldr r1, [r4] + b _080C28D8 +_080C2830: + bl sub_80C4630 + b _080C28D4 +_080C2836: + ldr r0, _080C2888 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C2852 + ldr r0, _080C288C + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C2852 + bl sub_800E0E8 + movs r0, 0xE6 + movs r1, 0x96 + bl sub_800DFB4 +_080C2852: + movs r6, 0x1 + negs r6, r6 + ldr r4, _080C2890 + ldr r0, [r4] + ldr r5, _080C2894 + adds r0, r5 + ldrh r2, [r0] + adds r0, r6, 0 + movs r1, 0x10 + bl sub_80A2A20 + ldr r0, [r4] + adds r0, r5 + ldrh r0, [r0] + str r0, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080C2898 + bl SetVBlankCallback + ldr r1, [r4] + b _080C28D8 + .align 2, 0 +_080C2888: .4byte 0x030030fc +_080C288C: .4byte 0x03003124 +_080C2890: .4byte 0x02039ce8 +_080C2894: .4byte 0x0000052c +_080C2898: .4byte sub_80C2690 + 1 +_080C289C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _080C28A8 + b _080C2ACA +_080C28A8: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + beq _080C28B4 + b _080C2ACA +_080C28B4: + movs r0, 0xFB + bl audio_play + ldr r0, _080C28C4 + ldr r1, [r0] + movs r0, 0xA + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C28C4: .4byte 0x02039ce8 +_080C28C8: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _080C28D4 + b _080C2ACA +_080C28D4: + ldr r0, _080C28E0 + ldr r1, [r0] +_080C28D8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C28E0: .4byte 0x02039ce8 +_080C28E4: + ldr r0, _080C292C + ldrb r5, [r0] + cmp r5, 0 + bne _080C290A + ldr r0, [r4] + ldr r1, _080C2930 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C290A + bl sub_80C3880 + movs r0, 0x1 + bl sub_80C438C + ldr r0, [r4] + ldr r2, _080C2930 + adds r0, r2 + strb r5, [r0] +_080C290A: + ldr r0, _080C2934 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C293C + bl sub_80C4918 + movs r0, 0xF9 + bl audio_play + ldr r0, _080C2938 + ldr r1, [r0] + movs r0, 0xC + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C292C: .4byte 0x03003124 +_080C2930: .4byte 0x00000529 +_080C2934: .4byte 0x030022c0 +_080C2938: .4byte 0x02039ce8 +_080C293C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080C2946 + b _080C2ACA +_080C2946: + ldr r0, _080C2968 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2960 + ldr r4, _080C296C + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _080C2960 + bl in_trade_center + cmp r0, 0x1 + beq _080C2A14 +_080C2960: + movs r0, 0x1 + negs r0, r0 + ldr r4, _080C296C + b _080C2A74 + .align 2, 0 +_080C2968: .4byte 0x03003124 +_080C296C: .4byte 0x02039ce8 +_080C2970: + bl sub_80C4940 + lsls r0, 24 + cmp r0, 0 + bne _080C297C + b _080C2ACA +_080C297C: + bl sub_8087598 + cmp r0, 0x1 + bne _080C2986 + b _080C2ACA +_080C2986: + movs r0, 0xFB + bl audio_play + ldr r0, _080C2998 + ldr r1, [r0] + movs r0, 0xB + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C2998: .4byte 0x02039ce8 +_080C299C: + ldr r0, _080C29D0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C29F4 + ldr r0, _080C29D4 + ldrb r0, [r0] + cmp r0, 0 + beq _080C29DC + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _080C29C0 + bl in_trade_center + cmp r0, 0x1 + beq _080C2A14 +_080C29C0: + ldr r0, _080C29D4 + ldrb r0, [r0] + cmp r0, 0 + beq _080C29DC + movs r0, 0x1 + negs r0, r0 + ldr r4, _080C29D8 + b _080C2A74 + .align 2, 0 +_080C29D0: .4byte 0x030022c0 +_080C29D4: .4byte 0x03003124 +_080C29D8: .4byte 0x02039ce8 +_080C29DC: + bl sub_80C4918 + ldr r0, _080C29F0 + ldr r1, [r0] + movs r0, 0xD + strb r0, [r1] + movs r0, 0xF9 + bl audio_play + b _080C2ACA + .align 2, 0 +_080C29F0: .4byte 0x02039ce8 +_080C29F4: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C2ACA + ldr r0, _080C2A1C + ldrb r0, [r0] + cmp r0, 0 + beq _080C2A20 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _080C2A20 + bl in_trade_center + cmp r0, 0x1 + bne _080C2A20 +_080C2A14: + ldr r1, [r4] + movs r0, 0xF + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C2A1C: .4byte 0x03003124 +_080C2A20: + movs r0, 0x1 + negs r0, r0 + ldr r4, _080C2A28 + b _080C2A74 + .align 2, 0 +_080C2A28: .4byte 0x02039ce8 +_080C2A2C: + bl sub_800AC34 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + ldr r2, _080C2A60 + 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, 0x3 + bl Window_CopyToVram + ldr r0, _080C2A64 + ldr r1, [r0] + movs r0, 0x10 + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C2A60: .4byte 0x085ed042 +_080C2A64: .4byte 0x02039ce8 +_080C2A68: + ldr r0, _080C2A90 + ldrb r0, [r0] + cmp r0, 0 + bne _080C2ACA + movs r0, 0x1 + negs r0, r0 +_080C2A74: + ldr r1, [r4] + ldr r2, _080C2A94 + adds r1, r2 + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r4] + movs r0, 0xE + strb r0, [r1] + b _080C2ACA + .align 2, 0 +_080C2A90: .4byte 0x03003124 +_080C2A94: .4byte 0x0000052c +_080C2A98: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C2ACA + adds r0, r5, 0 + bl sub_80C2728 + b _080C2ACA +_080C2AAA: + bl sub_80C4940 + lsls r0, 24 + cmp r0, 0 + beq _080C2ACA + bl sub_8087598 + cmp r0, 0x1 + beq _080C2ACA + ldr r0, _080C2AD4 + ldr r1, [r0] + movs r0, 0xA + strb r0, [r1] + movs r0, 0xFB + bl audio_play +_080C2ACA: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C2AD4: .4byte 0x02039ce8 + thumb_func_end sub_80C2760 + + thumb_func_start sub_80C2AD8 +sub_80C2AD8: @ 80C2AD8 + push {lr} + ldr r0, _080C2AF0 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + cmp r0, 0x5 + bls _080C2AE6 + b _080C2C64 +_080C2AE6: + lsls r0, 2 + ldr r1, _080C2AF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C2AF0: .4byte 0x02039ce8 +_080C2AF4: .4byte _080C2AF8 + .align 2, 0 +_080C2AF8: + .4byte _080C2B10 + .4byte _080C2B44 + .4byte _080C2B78 + .4byte _080C2BD0 + .4byte _080C2C04 + .4byte _080C2C38 +_080C2B10: + ldr r0, _080C2B24 + ldr r1, [r0] + ldr r2, _080C2B28 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2B34 + ldr r0, _080C2B2C + ldr r2, _080C2B30 + b _080C2C4A + .align 2, 0 +_080C2B24: .4byte 0x02039ce8 +_080C2B28: .4byte 0x0000052a +_080C2B2C: .4byte 0x08dd1f78 +_080C2B30: .4byte 0x00000ef8 +_080C2B34: + ldr r0, _080C2B3C + ldr r2, _080C2B40 + b _080C2C4A + .align 2, 0 +_080C2B3C: .4byte 0x08dd2ae0 +_080C2B40: .4byte 0x00000ef8 +_080C2B44: + ldr r0, _080C2B58 + ldr r1, [r0] + ldr r2, _080C2B5C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2B68 + ldr r0, _080C2B60 + ldr r2, _080C2B64 + b _080C2C4A + .align 2, 0 +_080C2B58: .4byte 0x02039ce8 +_080C2B5C: .4byte 0x0000052a +_080C2B60: .4byte 0x08dd21b0 +_080C2B64: .4byte 0x00000a48 +_080C2B68: + ldr r0, _080C2B70 + ldr r2, _080C2B74 + b _080C2C4A + .align 2, 0 +_080C2B70: .4byte 0x08dd2d30 +_080C2B74: .4byte 0x00000a48 +_080C2B78: + ldr r0, _080C2B94 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + cmp r0, 0 + bne _080C2BAC + ldr r2, _080C2B98 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2BA0 + ldr r0, _080C2B9C + adds r2, 0x6E + b _080C2C4A + .align 2, 0 +_080C2B94: .4byte 0x02039ce8 +_080C2B98: .4byte 0x0000052a +_080C2B9C: .4byte 0x08dd2010 +_080C2BA0: + ldr r0, _080C2BA8 + movs r2, 0xB3 + lsls r2, 3 + b _080C2C4A + .align 2, 0 +_080C2BA8: .4byte 0x08dd2b78 +_080C2BAC: + ldr r2, _080C2BBC + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2BC4 + ldr r0, _080C2BC0 + adds r2, 0x6E + b _080C2C4A + .align 2, 0 +_080C2BBC: .4byte 0x0000052a +_080C2BC0: .4byte 0x08dd228c +_080C2BC4: + ldr r0, _080C2BCC + movs r2, 0xB3 + lsls r2, 3 + b _080C2C4A + .align 2, 0 +_080C2BCC: .4byte 0x08dd2e5c +_080C2BD0: + ldr r0, _080C2BE4 + ldr r1, [r0] + ldr r2, _080C2BE8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2BF4 + ldr r0, _080C2BEC + ldr r2, _080C2BF0 + b _080C2C4A + .align 2, 0 +_080C2BE4: .4byte 0x02039ce8 +_080C2BE8: .4byte 0x0000052a +_080C2BEC: .4byte 0x0856f5cc +_080C2BF0: .4byte 0x000013a8 +_080C2BF4: + ldr r0, _080C2BFC + ldr r2, _080C2C00 + b _080C2C4A + .align 2, 0 +_080C2BFC: .4byte 0x0856f814 +_080C2C00: .4byte 0x000013a8 +_080C2C04: + ldr r0, _080C2C18 + ldr r1, [r0] + ldr r2, _080C2C1C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2C28 + ldr r0, _080C2C20 + ldr r2, _080C2C24 + b _080C2C4A + .align 2, 0 +_080C2C18: .4byte 0x02039ce8 +_080C2C1C: .4byte 0x0000052a +_080C2C20: .4byte 0x08dd1ab8 +_080C2C24: .4byte 0x000019a8 +_080C2C28: + ldr r0, _080C2C30 + ldr r2, _080C2C34 + b _080C2C4A + .align 2, 0 +_080C2C30: .4byte 0x08dd246c +_080C2C34: .4byte 0x000019a8 +_080C2C38: + ldr r0, _080C2C54 + ldr r1, [r0] + ldr r2, _080C2C58 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C2C6C + ldr r0, _080C2C5C + ldr r2, _080C2C60 +_080C2C4A: + adds r1, r2 + bl LZ77UnCompWram + b _080C2C6C + .align 2, 0 +_080C2C54: .4byte 0x02039ce8 +_080C2C58: .4byte 0x0000052a +_080C2C5C: .4byte 0x0856f018 +_080C2C60: .4byte 0x000017a8 +_080C2C64: + movs r0, 0 + strb r0, [r1, 0x2] + movs r0, 0x1 + b _080C2C78 +_080C2C6C: + ldr r0, _080C2C7C + ldr r1, [r0] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0 +_080C2C78: + pop {r1} + bx r1 + .align 2, 0 +_080C2C7C: .4byte 0x02039ce8 + thumb_func_end sub_80C2AD8 + + thumb_func_start sub_80C2C80 +sub_80C2C80: @ 80C2C80 + push {lr} + sub sp, 0x8 + ldr r1, _080C2CA0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0xA + bls _080C2C96 + b _080C2DD8 +_080C2C96: + lsls r0, 2 + ldr r1, _080C2CA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C2CA0: .4byte 0x030022c0 +_080C2CA4: .4byte _080C2CA8 + .align 2, 0 +_080C2CA8: + .4byte _080C2CD4 + .4byte _080C2CEC + .4byte _080C2D14 + .4byte _080C2D50 + .4byte _080C2D6A + .4byte _080C2D74 + .4byte _080C2D88 + .4byte _080C2D8E + .4byte _080C2DA0 + .4byte _080C2DA6 + .4byte _080C2DB8 +_080C2CD4: + bl sub_80C334C + bl sub_80C3414 + ldr r1, _080C2CE8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .align 2, 0 +_080C2CE8: .4byte 0x030022c0 +_080C2CEC: + movs r1, 0xE0 + lsls r1, 19 + movs r0, 0 + str r0, [sp] + ldr r0, _080C2D0C + mov r2, sp + str r2, [r0] + str r1, [r0, 0x4] + ldr r1, _080C2D10 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x87 + lsls r0, 3 + adds r1, r3, r0 + b _080C2DCC + .align 2, 0 +_080C2D0C: .4byte 0x040000d4 +_080C2D10: .4byte 0x85000100 +_080C2D14: + ldr r0, _080C2D40 + ldr r0, [r0] + ldr r1, _080C2D44 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080C2D36 + movs r2, 0xA0 + lsls r2, 19 + add r1, sp, 0x4 + strh r0, [r1] + ldr r0, _080C2D48 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _080C2D4C + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] +_080C2D36: + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _080C2DCC + .align 2, 0 +_080C2D40: .4byte 0x02039ce8 +_080C2D44: .4byte 0x0000052c +_080C2D48: .4byte 0x040000d4 +_080C2D4C: .4byte 0x81000200 +_080C2D50: + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl sub_80A1A74 + ldr r1, _080C2D70 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C2D6A: + bl sub_80C3388 + b _080C2DC4 + .align 2, 0 +_080C2D70: .4byte 0x030022c0 +_080C2D74: + bl sub_80C41D8 + ldr r1, _080C2D84 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .align 2, 0 +_080C2D84: .4byte 0x030022c0 +_080C2D88: + bl sub_80C2AD8 + b _080C2DBC +_080C2D8E: + bl sub_80C4330 + ldr r1, _080C2D9C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .align 2, 0 +_080C2D9C: .4byte 0x030022c0 +_080C2DA0: + bl sub_80C3278 + b _080C2DC4 +_080C2DA6: + bl sub_80C3548 + ldr r1, _080C2DB4 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .align 2, 0 +_080C2DB4: .4byte 0x030022c0 +_080C2DB8: + bl sub_80C43A8 +_080C2DBC: + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080C2DDC +_080C2DC4: + ldr r1, _080C2DD4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080C2DCC: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C2DDC + .align 2, 0 +_080C2DD4: .4byte 0x030022c0 +_080C2DD8: + bl sub_80C3404 +_080C2DDC: + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80C2C80 + + thumb_func_start sav12_xor_get_clamped_above +sav12_xor_get_clamped_above: @ 80C2DE4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_80847F8 + cmp r0, r4 + bls _080C2DF6 + adds r0, r4, 0 +_080C2DF6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav12_xor_get_clamped_above + + thumb_func_start sub_80C2DFC +sub_80C2DFC: @ 80C2DFC + push {r4,r5,lr} + movs r5, 0 +_080C2E00: + lsls r4, r5, 1 + ldr r1, _080C2E24 + adds r0, r4, r1 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080C2E1E + ldr r1, _080C2E28 + adds r0, r4, r1 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080C2E2C +_080C2E1E: + movs r0, 0 + b _080C2E38 + .align 2, 0 +_080C2E24: .4byte 0x000008c4 +_080C2E28: .4byte 0x000008c5 +_080C2E2C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080C2E00 + movs r0, 0x1 +_080C2E38: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C2DFC + + thumb_func_start sub_80C2E40 +sub_80C2E40: @ 80C2E40 + push {r4,lr} + movs r0, 0xA + bl sub_80847F8 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + bl sub_80C08E4 + lsls r0, 16 + cmp r0, 0 + beq _080C2E5A + adds r4, 0x1 +_080C2E5A: + bl sub_80F8940 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080C2E6C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080C2E6C: + bl sub_80C2DFC + lsls r0, 24 + cmp r0, 0 + beq _080C2E7C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080C2E7C: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C2E40 + + thumb_func_start sub_80C2E84 +sub_80C2E84: @ 80C2E84 + push {lr} + adds r1, r0, 0 + movs r2, 0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + bne _080C2E96 + ldr r0, [r1, 0x8] + cmp r0, 0 + beq _080C2E98 +_080C2E96: + movs r2, 0x1 +_080C2E98: + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _080C2EA4 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080C2EA4: + ldrh r0, [r1, 0x1A] + cmp r0, 0x31 + bls _080C2EB0 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080C2EB0: + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _080C2EBC + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080C2EBC: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80C2E84 + + thumb_func_start sub_80C2EC4 +sub_80C2EC4: @ 80C2EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r6, _080C2FA4 + ldr r1, [r6] + ldrb r0, [r1, 0x8] + strb r0, [r5] + ldrh r0, [r1, 0xE] + strh r0, [r5, 0x10] + ldrb r0, [r1, 0x10] + strh r0, [r5, 0x12] + movs r0, 0x1 + bl sub_80847F8 + adds r4, r0, 0 + movs r0, 0xA + bl sub_80847F8 + cmp r0, 0 + bne _080C2EF6 + movs r4, 0 +_080C2EF6: + lsrs r0, r4, 16 + strh r0, [r5, 0x6] + lsrs r1, r4, 8 + movs r2, 0xFF + ands r1, r2 + strh r1, [r5, 0x8] + ands r4, r2 + strh r4, [r5, 0xA] + ldr r1, _080C2FA8 + cmp r0, r1 + bls _080C2F14 + strh r1, [r5, 0x6] + movs r0, 0x3B + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] +_080C2F14: + ldr r0, _080C2FAC + bl flag_check + strb r0, [r5, 0x2] + bl sub_80C08E4 + strb r0, [r5, 0x3] + bl sub_80C376C + strh r0, [r5, 0xC] + ldr r0, [r6] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + strh r0, [r5, 0xE] + ldr r4, _080C2FB0 + movs r0, 0x17 + adds r1, r4, 0 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x14] + movs r0, 0x18 + adds r1, r4, 0 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x16] + ldr r1, _080C2FB4 + movs r0, 0x15 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x20] + ldr r4, _080C2FB8 + ldr r0, [r4] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl decrypt_money + str r0, [r5, 0x24] + movs r2, 0 + adds r7, r5, 0 + adds r7, 0x30 + adds r6, r5, 0 + adds r6, 0x28 + ldr r0, [r4] + ldr r1, _080C2FBC + adds r3, r0, r1 +_080C2F74: + lsls r0, r2, 1 + adds r1, r6, r0 + adds r0, r3, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080C2F74 + ldr r0, _080C2FA4 + ldr r1, [r0] + adds r0, r7, 0 + bl gf_strcpy + mov r0, r8 + cmp r0, 0x1 + beq _080C3004 + cmp r0, 0x1 + bgt _080C2FC0 + cmp r0, 0 + beq _080C2FCC + b _080C3014 + .align 2, 0 +_080C2FA4: .4byte 0x03005d90 +_080C2FA8: .4byte 0x000003e7 +_080C2FAC: .4byte 0x00000861 +_080C2FB0: .4byte 0x0000270f +_080C2FB4: .4byte 0x0000ffff +_080C2FB8: .4byte 0x03005d8c +_080C2FBC: .4byte 0x00002bb0 +_080C2FC0: + mov r1, r8 + cmp r1, 0x2 + bne _080C3014 + movs r0, 0 + strh r0, [r5, 0x18] + strh r0, [r5, 0x1A] +_080C2FCC: + ldr r1, _080C2FFC + movs r0, 0x23 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x1C] + ldr r1, _080C3000 + movs r0, 0x22 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x1E] + bl sub_80F8940 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080C2FF0 + movs r0, 0x1 + strb r0, [r5, 0x4] +_080C2FF0: + adds r0, r5, 0 + bl sub_80C2E84 + strb r0, [r5, 0x1] + b _080C3014 + .align 2, 0 +_080C2FFC: .4byte 0x000003e7 +_080C3000: .4byte 0x0000ffff +_080C3004: + movs r1, 0 + movs r0, 0 + strh r0, [r5, 0x18] + strh r0, [r5, 0x1A] + strh r0, [r5, 0x1C] + strh r0, [r5, 0x1E] + strb r1, [r5, 0x4] + strb r1, [r5, 0x1] +_080C3014: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C2EC4 + + thumb_func_start sub_80C3020 +sub_80C3020: @ 80C3020 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x64 + bl memset + adds r1, r4, 0 + adds r1, 0x38 + movs r0, 0x3 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80C2EC4 + bl sub_80C2DFC + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r1, 0x60 + strh r0, [r1] + ldr r0, _080C3078 + ldr r0, [r0] + ldr r2, _080C307C + adds r0, r2 + ldrh r0, [r0] + adds r2, r4, 0 + adds r2, 0x62 + strh r0, [r2] + ldrh r0, [r1] + cmp r0, 0 + beq _080C3066 + ldrb r0, [r4, 0x1] + adds r0, 0x1 + strb r0, [r4, 0x1] +_080C3066: + ldrb r0, [r4] + cmp r0, 0x1 + bne _080C3084 + ldr r2, _080C3080 + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 + adds r0, 0x8 + b _080C308C + .align 2, 0 +_080C3078: .4byte 0x03005d90 +_080C307C: .4byte 0x00000eba +_080C3080: .4byte 0x08329d54 +_080C3084: + ldr r2, _080C30A0 + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 +_080C308C: + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + adds r0, r4, 0 + adds r0, 0x4F + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C30A0: .4byte 0x08329d54 + thumb_func_end sub_80C3020 + + thumb_func_start sub_80C30A4 +sub_80C30A4: @ 80C30A4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + adds r1, r4, 0 + adds r1, 0x38 + movs r0, 0x3 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80C2EC4 + bl sub_80C2DFC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x3A] + ldr r1, _080C30F4 + ldr r1, [r1] + ldr r2, _080C30F8 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r4, 0x3C] + cmp r0, 0 + beq _080C30E0 + ldrb r0, [r4, 0x1] + adds r0, 0x1 + strb r0, [r4, 0x1] +_080C30E0: + ldrb r0, [r4] + cmp r0, 0x1 + bne _080C3100 + ldr r2, _080C30FC + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 + adds r0, 0x8 + b _080C3108 + .align 2, 0 +_080C30F4: .4byte 0x03005d90 +_080C30F8: .4byte 0x00000eba +_080C30FC: .4byte 0x08329d54 +_080C3100: + ldr r2, _080C311C + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 +_080C3108: + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + adds r0, r4, 0 + adds r0, 0x4F + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C311C: .4byte 0x08329d54 + thumb_func_end sub_80C30A4 + + thumb_func_start sub_80C3120 +sub_80C3120: @ 80C3120 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + movs r1, 0 + movs r2, 0x64 + bl memset + adds r0, r5, 0 + adds r0, 0x38 + strb r4, [r0] + adds r0, r4, 0 + bl sub_80C4FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080C3162 + cmp r0, 0x1 + bgt _080C3150 + cmp r0, 0 + beq _080C3156 + b _080C318A +_080C3150: + cmp r0, 0x2 + beq _080C316E + b _080C318A +_080C3156: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x60 + bl memcpy + b _080C318A +_080C3162: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x38 + bl memcpy + b _080C318A +_080C316E: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x60 + bl memcpy + movs r0, 0 + str r0, [r5, 0x3C] + ldrh r1, [r6, 0x3A] + adds r0, r5, 0 + adds r0, 0x60 + strh r1, [r0] + ldrh r1, [r6, 0x3C] + adds r0, 0x2 + strh r1, [r0] +_080C318A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C3120 + + thumb_func_start sub_80C3190 +sub_80C3190: @ 80C3190 + push {r4,r5,lr} + ldr r4, _080C3258 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0xA] + ldr r0, [r4] + strb r1, [r0, 0xB] + ldr r0, [r4] + strb r1, [r0, 0xC] + ldr r0, [r4] + strb r1, [r0, 0xD] + ldr r0, [r4] + strb r1, [r0, 0xE] + ldr r0, [r4] + strb r1, [r0, 0xF] + ldr r0, [r4] + strb r1, [r0, 0x10] + ldr r0, [r4] + adds r0, 0x11 + movs r2, 0x8 + bl memset + ldr r1, [r4] + ldr r2, _080C325C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C31CE + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] +_080C31CE: + ldr r1, [r4] + ldr r3, _080C3260 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080C31E4 + ldr r2, _080C3264 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C31EA +_080C31E4: + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] +_080C31EA: + ldr r2, _080C3258 + ldr r1, [r2] + movs r3, 0xA9 + lsls r3, 3 + adds r0, r1, r3 + ldr r0, [r0] + cmp r0, 0 + beq _080C3200 + ldrb r0, [r1, 0xC] + adds r0, 0x1 + strb r0, [r1, 0xC] +_080C3200: + ldr r1, [r2] + ldr r3, _080C3268 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080C3212 + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] +_080C3212: + ldr r1, [r2] + ldr r2, _080C326C + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C3224 + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] +_080C3224: + movs r5, 0 + ldr r4, _080C3270 +_080C3228: + lsls r0, r4, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080C3244 + ldr r0, _080C3258 + ldr r1, [r0] + adds r1, 0x11 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C3244: + adds r4, 0x1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080C3274 + cmp r4, r0 + bls _080C3228 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C3258: .4byte 0x02039ce8 +_080C325C: .4byte 0x00000536 +_080C3260: .4byte 0x0000053a +_080C3264: .4byte 0x0000053c +_080C3268: .4byte 0x00000554 +_080C326C: .4byte 0x0000054c +_080C3270: .4byte 0x00000867 +_080C3274: .4byte 0x0000086e + thumb_func_end sub_80C3190 + + thumb_func_start sub_80C3278 +sub_80C3278: @ 80C3278 + push {lr} + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0xC1 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x1E + bl lcd_io_set + movs r0, 0x44 + movs r1, 0xA0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + ldr r0, _080C32DC + ldrb r0, [r0] + cmp r0, 0 + beq _080C32E0 + movs r0, 0xC7 + bl enable_irqs + b _080C32E6 + .align 2, 0 +_080C32DC: .4byte 0x03003124 +_080C32E0: + movs r0, 0x3 + bl enable_irqs +_080C32E6: + pop {r0} + bx r0 + thumb_func_end sub_80C3278 + + thumb_func_start sub_80C32EC +sub_80C32EC: @ 80C32EC + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x28 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bgt _080C3306 + movs r2, 0 +_080C3306: + ldr r4, _080C3344 + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x54 + bl lcd_io_set + ldr r0, [r4] + ldr r1, _080C3348 + adds r0, r1 + ldrh r2, [r0] + lsls r1, r2, 8 + movs r0, 0xA0 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3344: .4byte 0x02039ce8 +_080C3348: .4byte 0x00007ca8 + thumb_func_end sub_80C32EC + + thumb_func_start sub_80C334C +sub_80C334C: @ 80C334C + push {lr} + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end sub_80C334C + + thumb_func_start sub_80C3388 +sub_80C3388: @ 80C3388 + push {lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080C33FC + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _080C3400 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + bl sub_81973A4 + pop {r0} + bx r0 + .align 2, 0 +_080C33FC: .4byte 0x0856fab4 +_080C3400: .4byte 0x0856fac4 + thumb_func_end sub_80C3388 + + thumb_func_start sub_80C3404 +sub_80C3404: @ 80C3404 + push {lr} + ldr r0, _080C3410 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080C3410: .4byte sub_80C2710 + 1 + thumb_func_end sub_80C3404 + + thumb_func_start sub_80C3414 +sub_80C3414: @ 80C3414 + push {lr} + bl clear_tasks + bl remove_some_task + ldr r0, _080C3434 + movs r1, 0 + bl AddTask + bl sub_80C4EE4 + bl sub_80C3190 + pop {r0} + bx r0 + .align 2, 0 +_080C3434: .4byte sub_80C2760 + 1 + thumb_func_end sub_80C3414 + + thumb_func_start sub_80C3438 +sub_80C3438: @ 80C3438 + push {lr} + ldr r0, _080C3450 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + cmp r0, 0x5 + bhi _080C3494 + lsls r0, 2 + ldr r1, _080C3454 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C3450: .4byte 0x02039ce8 +_080C3454: .4byte _080C3458 + .align 2, 0 +_080C3458: + .4byte _080C3470 + .4byte _080C3476 + .4byte _080C347C + .4byte _080C3482 + .4byte _080C3488 + .4byte _080C348E +_080C3470: + bl sub_80C3574 + b _080C349C +_080C3476: + bl sub_80C3608 + b _080C349C +_080C347C: + bl sub_80C3684 + b _080C349C +_080C3482: + bl sub_80C378C + b _080C349C +_080C3488: + bl sub_80C3880 + b _080C349C +_080C348E: + bl sub_80C3A18 + b _080C349C +_080C3494: + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _080C34A8 +_080C349C: + ldr r0, _080C34AC + ldr r1, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0 +_080C34A8: + pop {r1} + bx r1 + .align 2, 0 +_080C34AC: .4byte 0x02039ce8 + thumb_func_end sub_80C3438 + + thumb_func_start sub_80C34B0 +sub_80C34B0: @ 80C34B0 + push {lr} + ldr r0, _080C34C8 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + cmp r0, 0x7 + bhi _080C352C + lsls r0, 2 + ldr r1, _080C34CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C34C8: .4byte 0x02039ce8 +_080C34CC: .4byte _080C34D0 + .align 2, 0 +_080C34D0: + .4byte _080C34F0 + .4byte _080C34F6 + .4byte _080C34FC + .4byte _080C3502 + .4byte _080C3508 + .4byte _080C3512 + .4byte _080C351C + .4byte _080C3526 +_080C34F0: + bl sub_80C3B50 + b _080C3534 +_080C34F6: + bl sub_80C3CCC + b _080C3534 +_080C34FC: + bl sub_80C3D60 + b _080C3534 +_080C3502: + bl sub_80C3DF0 + b _080C3534 +_080C3508: + bl sub_80C3E58 + bl sub_80C3F64 + b _080C3534 +_080C3512: + bl sub_80C3ED4 + bl sub_80C3FE0 + b _080C3534 +_080C351C: + bl sub_80C4140 + bl sub_80C40CC + b _080C3534 +_080C3526: + bl sub_80C42A4 + b _080C3534 +_080C352C: + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _080C3540 +_080C3534: + ldr r0, _080C3544 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0 +_080C3540: + pop {r1} + bx r1 + .align 2, 0 +_080C3544: .4byte 0x02039ce8 + thumb_func_end sub_80C34B0 + + thumb_func_start sub_80C3548 +sub_80C3548: @ 80C3548 + push {lr} + bl sub_80C3AF0 + bl sub_80C3BC4 + bl sub_80C3CF4 + bl sub_80C3DC0 + bl sub_80C3E20 + bl sub_80C3E98 + bl sub_80C3F14 + bl sub_80C3FA4 + bl sub_80C4020 + pop {r0} + bx r0 + thumb_func_end sub_80C3548 + + thumb_func_start sub_80C3574 +sub_80C3574: @ 80C3574 + push {r4,r5,lr} + sub sp, 0x2C + ldr r1, _080C35C8 + add r0, sp, 0xC + bl gf_strcpy + adds r5, r0, 0 + ldr r4, _080C35CC + ldr r1, [r4] + ldr r0, _080C35D0 + adds r1, r0 + adds r0, r5, 0 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _080C35D4 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8009308 + ldr r0, [r4] + ldr r1, _080C35D8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C35E0 + ldr r0, _080C35DC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x1C + bl box_print + b _080C35FA + .align 2, 0 +_080C35C8: .4byte 0x085ecf71 +_080C35CC: .4byte 0x02039ce8 +_080C35D0: .4byte 0x00000564 +_080C35D4: .4byte 0x00007caa +_080C35D8: .4byte 0x0000052a +_080C35DC: .4byte 0x0856fb0c +_080C35E0: + ldr r0, _080C3604 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x21 + bl box_print +_080C35FA: + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C3604: .4byte 0x0856fb0c + thumb_func_end sub_80C3574 + + thumb_func_start sub_80C3608 +sub_80C3608: @ 80C3608 + push {r4,lr} + sub sp, 0x2C + ldr r1, _080C3640 + add r0, sp, 0xC + bl gf_strcpy + ldr r4, _080C3644 + ldr r1, [r4] + ldr r2, _080C3648 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x5 + bl decimal_int_to_string + ldr r0, [r4] + ldr r1, _080C364C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3650 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x50 + bl sub_81DB35C + adds r0, 0x84 + b _080C365C + .align 2, 0 +_080C3640: .4byte 0x085ecf78 +_080C3644: .4byte 0x02039ce8 +_080C3648: .4byte 0x00000542 +_080C364C: .4byte 0x0000052a +_080C3650: + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x60 + bl sub_81DB35C + adds r0, 0x78 +_080C365C: + movs r3, 0x9 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _080C3680 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print + add sp, 0x2C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3680: .4byte 0x0856fb0c + thumb_func_end sub_80C3608 + + thumb_func_start sub_80C3684 +sub_80C3684: @ 80C3684 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _080C36B4 + ldr r0, [r0] + ldr r1, _080C36B8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C36C4 + ldr r0, _080C36BC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C36C0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x38 + bl box_print + b _080C36DE + .align 2, 0 +_080C36B4: .4byte 0x02039ce8 +_080C36B8: .4byte 0x0000052b +_080C36BC: .4byte 0x0856fb0c +_080C36C0: .4byte 0x085ecf7e +_080C36C4: + ldr r0, _080C3718 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C371C + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x39 + bl box_print +_080C36DE: + ldr r0, _080C3720 + ldr r4, _080C3724 + ldr r1, [r4] + movs r2, 0xAB + lsls r2, 3 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + ldr r5, _080C3728 + ldr r1, _080C372C + adds r0, r5, 0 + bl ExpandTextCodes + ldr r0, [r4] + ldr r1, _080C3730 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3734 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x90 + bl sub_81DB368 + movs r3, 0x38 + b _080C3740 + .align 2, 0 +_080C3718: .4byte 0x0856fb0c +_080C371C: .4byte 0x085ecf7e +_080C3720: .4byte 0x02021cc4 +_080C3724: .4byte 0x02039ce8 +_080C3728: .4byte 0x02021fc4 +_080C372C: .4byte 0x085e969c +_080C3730: .4byte 0x0000052b +_080C3734: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl sub_81DB368 + movs r3, 0x39 +_080C3740: + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _080C3764 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C3768 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C3764: .4byte 0x0856fb0c +_080C3768: .4byte 0x02021fc4 + thumb_func_end sub_80C3684 + + thumb_func_start sub_80C376C +sub_80C376C: @ 80C376C + push {lr} + bl sub_809D42C + cmp r0, 0 + bne _080C377E + movs r0, 0x1 + bl sub_80C0844 + b _080C3784 +_080C377E: + movs r0, 0x1 + bl pokedex_count +_080C3784: + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80C376C + + thumb_func_start sub_80C378C +sub_80C378C: @ 80C378C + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _080C37C8 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080C386E + ldr r0, _080C37CC + ldr r0, [r0] + ldr r1, _080C37D0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C37DC + ldr r0, _080C37D4 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C37D8 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x48 + bl box_print + b _080C37F6 + .align 2, 0 +_080C37C8: .4byte 0x00000861 +_080C37CC: .4byte 0x02039ce8 +_080C37D0: .4byte 0x0000052b +_080C37D4: .4byte 0x0856fb0c +_080C37D8: .4byte 0x085ecf86 +_080C37DC: + ldr r0, _080C3830 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C3834 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x49 + bl box_print +_080C37F6: + ldr r5, _080C3838 + ldr r4, _080C383C + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 3 + adds r0, r1 + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r1, _080C3840 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _080C3844 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3848 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x90 + bl sub_81DB368 + movs r3, 0x48 + b _080C3854 + .align 2, 0 +_080C3830: .4byte 0x0856fb0c +_080C3834: .4byte 0x085ecf86 +_080C3838: .4byte 0x02021fc4 +_080C383C: .4byte 0x02039ce8 +_080C3840: .4byte 0x085ecf8e +_080C3844: .4byte 0x0000052b +_080C3848: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl sub_81DB368 + movs r3, 0x49 +_080C3854: + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _080C3878 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C387C + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print +_080C386E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C3878: .4byte 0x0856fb0c +_080C387C: .4byte 0x02021fc4 + thumb_func_end sub_80C378C + + thumb_func_start sub_80C3880 +sub_80C3880: @ 80C3880 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, _080C38B8 + ldr r0, [r0] + ldr r1, _080C38BC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C38C8 + ldr r0, _080C38C0 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C38C4 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x58 + bl box_print + b _080C38E2 + .align 2, 0 +_080C38B8: .4byte 0x02039ce8 +_080C38BC: .4byte 0x0000052b +_080C38C0: .4byte 0x0856fb0c +_080C38C4: .4byte 0x085ecf99 +_080C38C8: + ldr r0, _080C38FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _080C3900 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x59 + bl box_print +_080C38E2: + ldr r0, _080C3904 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _080C390C + ldr r2, _080C3908 + adds r0, r1, r2 + ldrh r5, [r0] + adds r2, 0x2 + adds r0, r1, r2 + ldrh r6, [r0] + b _080C3914 + .align 2, 0 +_080C38FC: .4byte 0x0856fb0c +_080C3900: .4byte 0x085ecf99 +_080C3904: .4byte 0x02039ce8 +_080C3908: .4byte 0x00000544 +_080C390C: + ldr r0, _080C3944 + ldr r0, [r0] + ldrh r5, [r0, 0xE] + ldrb r6, [r0, 0x10] +_080C3914: + ldr r0, _080C3948 + cmp r5, r0 + bls _080C391C + adds r5, r0, 0 +_080C391C: + cmp r6, 0x3B + bls _080C3922 + movs r6, 0x3B +_080C3922: + ldr r1, _080C394C + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + mov r10, r0 + ldr r0, _080C3950 + ldr r0, [r0] + ldr r1, _080C3954 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3958 + movs r7, 0x90 + movs r4, 0x58 + b _080C395C + .align 2, 0 +_080C3944: .4byte 0x03005d90 +_080C3948: .4byte 0x000003e7 +_080C394C: .4byte 0x085ecf8f +_080C3950: .4byte 0x02039ce8 +_080C3954: .4byte 0x0000052b +_080C3958: + movs r7, 0x80 + movs r4, 0x59 +_080C395C: + mov r0, r10 + adds r0, 0x1E + subs r7, r0 + lsls r2, r7, 16 + lsrs r2, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + adds r3, r4, 0 + bl Window_FillPixelRect + ldr r2, _080C3A04 + mov r9, r2 + mov r0, r9 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + lsls r2, r7, 24 + lsrs r2, 24 + ldr r0, _080C3A08 + mov r8, r0 + str r0, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + adds r7, 0x12 + lsls r2, r7, 24 + lsrs r2, 24 + ldr r1, _080C3A0C + ldr r0, _080C3A10 + ldr r0, [r0] + ldrb r0, [r0, 0x7] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + str r5, [sp, 0x4] + ldr r0, _080C3A14 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + add r7, r10 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + lsls r2, r7, 24 + lsrs r2, 24 + mov r0, r8 + str r0, [sp] + str r5, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C3A04: .4byte 0x02021fc4 +_080C3A08: .4byte 0x0856fb0c +_080C3A0C: .4byte 0x0856fb40 +_080C3A10: .4byte 0x02039ce8 +_080C3A14: .4byte 0x085ecf8f + thumb_func_end sub_80C3880 + + thumb_func_start sub_80C3A18 +sub_80C3A18: @ 80C3A18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r7, _080C3ADC + ldr r1, [r7] + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _080C3ACE + ldr r0, _080C3AE0 + mov r8, r0 + ldr r4, _080C3AE4 + adds r0, r1, r4 + ldrb r0, [r0] + add r0, r8 + ldrb r3, [r0] + ldr r6, _080C3AE8 + str r6, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x19 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x8 + bl box_print + ldr r1, [r7] + adds r1, 0x19 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r2, r0, 0 + adds r2, 0xE + lsls r2, 24 + lsrs r2, 24 + ldr r1, [r7] + adds r0, r1, r4 + ldrb r0, [r0] + add r0, r8 + ldrb r3, [r0] + str r6, [sp] + str r5, [sp, 0x4] + adds r1, 0x26 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print + ldr r0, _080C3AEC + mov r8, r0 + ldr r1, [r7] + adds r0, r1, r4 + ldrb r0, [r0] + add r0, r8 + ldrb r3, [r0] + str r6, [sp] + str r5, [sp, 0x4] + adds r1, 0x33 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x8 + bl box_print + ldr r1, [r7] + adds r1, 0x33 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r2, r0, 0 + adds r2, 0xE + lsls r2, 24 + lsrs r2, 24 + ldr r1, [r7] + adds r4, r1, r4 + ldrb r0, [r4] + add r0, r8 + ldrb r3, [r0] + str r6, [sp] + str r5, [sp, 0x4] + adds r1, 0x40 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print +_080C3ACE: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C3ADC: .4byte 0x02039ce8 +_080C3AE0: .4byte 0x0856fb48 +_080C3AE4: .4byte 0x0000052b +_080C3AE8: .4byte 0x0856fb0c +_080C3AEC: .4byte 0x0856fb4a + thumb_func_end sub_80C3A18 + + thumb_func_start sub_80C3AF0 +sub_80C3AF0: @ 80C3AF0 + push {r4,lr} + ldr r4, _080C3B38 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4D + ldr r2, _080C3B3C + adds r1, r2 + bl gf_strcpy + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4D + ldr r2, _080C3B40 + adds r1, r2 + ldrb r1, [r1] + bl sub_8009308 + ldr r1, [r4] + ldr r2, _080C3B44 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3B30 + ldr r0, _080C3B48 + adds r1, 0x4D + bl gf_strcpy + ldr r0, [r4] + adds r0, 0x4D + ldr r1, _080C3B4C + bl ExpandTextCodes +_080C3B30: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3B38: .4byte 0x02039ce8 +_080C3B3C: .4byte 0x00000564 +_080C3B40: .4byte 0x00007caa +_080C3B44: .4byte 0x0000052a +_080C3B48: .4byte 0x02021cc4 +_080C3B4C: .4byte 0x085ecfa6 + thumb_func_end sub_80C3AF0 + + thumb_func_start sub_80C3B50 +sub_80C3B50: @ 80C3B50 + push {r4,lr} + sub sp, 0xC + ldr r4, _080C3B80 + ldr r1, [r4] + ldr r2, _080C3B84 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3B8C + ldr r0, _080C3B88 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x4D + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x88 + movs r3, 0x9 + bl box_print + b _080C3BB6 + .align 2, 0 +_080C3B80: .4byte 0x02039ce8 +_080C3B84: .4byte 0x0000052b +_080C3B88: .4byte 0x0856fb0c +_080C3B8C: + adds r1, 0x4D + movs r0, 0x1 + movs r2, 0xD8 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _080C3BC0 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, [r4] + adds r0, 0x4D + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x9 + bl box_print +_080C3BB6: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3BC0: .4byte 0x0856fb0c + thumb_func_end sub_80C3B50 + + thumb_func_start sub_80C3BC4 +sub_80C3BC4: @ 80C3BC4 + push {r4,lr} + ldr r4, _080C3C14 + ldr r1, [r4] + ldrb r0, [r1, 0xB] + cmp r0, 0 + beq _080C3C0E + ldr r0, _080C3C18 + ldr r2, _080C3C1C + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, _080C3C20 + ldr r1, [r4] + ldr r2, _080C3C24 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _080C3C28 + ldr r1, [r4] + ldr r2, _080C3C2C + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, [r4] + adds r0, 0x93 + ldr r1, _080C3C30 + bl ExpandTextCodes +_080C3C0E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3C14: .4byte 0x02039ce8 +_080C3C18: .4byte 0x02021cc4 +_080C3C1C: .4byte 0x0000053a +_080C3C20: .4byte 0x02021dc4 +_080C3C24: .4byte 0x0000053c +_080C3C28: .4byte 0x02021ec4 +_080C3C2C: .4byte 0x0000053e +_080C3C30: .4byte 0x0856fb4c + thumb_func_end sub_80C3BC4 + + thumb_func_start sub_80C3C34 +sub_80C3C34: @ 80C3C34 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xC + adds r4, r0, 0 + mov r9, r2 + mov r10, r3 + ldr r2, _080C3CB8 + ldr r6, _080C3CBC + ldr r0, [r6] + ldr r5, _080C3CC0 + adds r0, r5 + ldrb r0, [r0] + adds r0, r2 + ldrb r2, [r0] + lsls r4, 28 + movs r0, 0x84 + lsls r0, 22 + adds r4, r0 + lsrs r4, 24 + ldr r0, _080C3CC4 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + ldr r1, _080C3CC8 + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + movs r0, 0x1 + mov r1, r9 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r0, r10 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C3CB8: .4byte 0x0856fb55 +_080C3CBC: .4byte 0x02039ce8 +_080C3CC0: .4byte 0x0000052b +_080C3CC4: .4byte 0x0856fb0c +_080C3CC8: .4byte 0x0856fb57 + thumb_func_end sub_80C3C34 + + thumb_func_start sub_80C3CCC +sub_80C3CCC: @ 80C3CCC + push {lr} + ldr r0, _080C3CE8 + ldr r2, [r0] + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _080C3CE4 + ldr r1, _080C3CEC + adds r2, 0x93 + ldr r3, _080C3CF0 + movs r0, 0 + bl sub_80C3C34 +_080C3CE4: + pop {r0} + bx r0 + .align 2, 0 +_080C3CE8: .4byte 0x02039ce8 +_080C3CEC: .4byte 0x085ecfb8 +_080C3CF0: .4byte 0x0856fb0f + thumb_func_end sub_80C3CCC + + thumb_func_start sub_80C3CF4 +sub_80C3CF4: @ 80C3CF4 + push {r4,lr} + ldr r4, _080C3D48 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _080C3D40 + adds r0, r1, 0 + adds r0, 0xD9 + ldr r2, _080C3D4C + ldr r3, _080C3D50 + adds r1, r3 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r1, [r4] + ldr r2, _080C3D54 + adds r0, r1, r2 + movs r3, 0xA9 + lsls r3, 3 + adds r1, r3 + ldrh r1, [r1] + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r1, [r4] + ldr r2, _080C3D58 + adds r0, r1, r2 + ldr r3, _080C3D5C + adds r1, r3 + ldrh r1, [r1] + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string +_080C3D40: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3D48: .4byte 0x02039ce8 +_080C3D4C: .4byte 0x0856fb5c +_080C3D50: .4byte 0x0000052a +_080C3D54: .4byte 0x00000165 +_080C3D58: .4byte 0x000001ab +_080C3D5C: .4byte 0x0000054a + thumb_func_end sub_80C3CF4 + + thumb_func_start sub_80C3D60 +sub_80C3D60: @ 80C3D60 + push {r4,r5,lr} + ldr r5, _080C3DA0 + ldr r1, [r5] + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _080C3D9A + ldr r0, _080C3DA4 + ldr r2, _080C3DA8 + adds r1, r2 + bl gf_strcpy + ldr r0, _080C3DAC + ldr r1, [r5] + ldr r2, _080C3DB0 + adds r1, r2 + bl gf_strcpy + ldr r4, _080C3DB4 + ldr r1, _080C3DB8 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r1, [r5] + adds r1, 0xD9 + ldr r3, _080C3DBC + movs r0, 0x1 + adds r2, r4, 0 + bl sub_80C3C34 +_080C3D9A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C3DA0: .4byte 0x02039ce8 +_080C3DA4: .4byte 0x02021cc4 +_080C3DA8: .4byte 0x00000165 +_080C3DAC: .4byte 0x02021dc4 +_080C3DB0: .4byte 0x000001ab +_080C3DB4: .4byte 0x02021fc4 +_080C3DB8: .4byte 0x085ecfed +_080C3DBC: .4byte 0x0856fb0c + thumb_func_end sub_80C3D60 + + thumb_func_start sub_80C3DC0 +sub_80C3DC0: @ 80C3DC0 + push {lr} + ldr r0, _080C3DE4 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080C3DDE + ldr r2, _080C3DE8 + adds r0, r1, r2 + ldr r2, _080C3DEC + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string +_080C3DDE: + pop {r0} + bx r0 + .align 2, 0 +_080C3DE4: .4byte 0x02039ce8 +_080C3DE8: .4byte 0x00000237 +_080C3DEC: .4byte 0x00000554 + thumb_func_end sub_80C3DC0 + + thumb_func_start sub_80C3DF0 +sub_80C3DF0: @ 80C3DF0 + push {lr} + ldr r0, _080C3E10 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + beq _080C3E0A + ldr r1, _080C3E14 + ldr r0, _080C3E18 + adds r2, r0 + ldr r3, _080C3E1C + movs r0, 0x2 + bl sub_80C3C34 +_080C3E0A: + pop {r0} + bx r0 + .align 2, 0 +_080C3E10: .4byte 0x02039ce8 +_080C3E14: .4byte 0x085ed010 +_080C3E18: .4byte 0x00000237 +_080C3E1C: .4byte 0x0856fb0f + thumb_func_end sub_80C3DF0 + + thumb_func_start sub_80C3E20 +sub_80C3E20: @ 80C3E20 + push {lr} + ldr r0, _080C3E4C + ldr r2, [r0] + ldr r1, _080C3E50 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3E48 + movs r3, 0xAE + lsls r3, 3 + adds r0, r2, r3 + ldr r1, [r0] + cmp r1, 0 + beq _080C3E48 + ldr r3, _080C3E54 + adds r0, r2, r3 + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string +_080C3E48: + pop {r0} + bx r0 + .align 2, 0 +_080C3E4C: .4byte 0x02039ce8 +_080C3E50: .4byte 0x0000052a +_080C3E54: .4byte 0x000002c3 + thumb_func_end sub_80C3E20 + + thumb_func_start sub_80C3E58 +sub_80C3E58: @ 80C3E58 + push {lr} + ldr r0, _080C3E84 + ldr r2, [r0] + ldr r1, _080C3E88 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3E80 + adds r1, 0x46 + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C3E80 + ldr r1, _080C3E8C + ldr r0, _080C3E90 + adds r2, r0 + ldr r3, _080C3E94 + movs r0, 0x4 + bl sub_80C3C34 +_080C3E80: + pop {r0} + bx r0 + .align 2, 0 +_080C3E84: .4byte 0x02039ce8 +_080C3E88: .4byte 0x0000052a +_080C3E8C: .4byte 0x085ed036 +_080C3E90: .4byte 0x000002c3 +_080C3E94: .4byte 0x0856fb0f + thumb_func_end sub_80C3E58 + + thumb_func_start sub_80C3E98 +sub_80C3E98: @ 80C3E98 + push {lr} + ldr r0, _080C3EC4 + ldr r2, [r0] + ldr r1, _080C3EC8 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3EBE + ldr r3, _080C3ECC + adds r0, r2, r3 + ldr r1, [r0] + cmp r1, 0 + beq _080C3EBE + ldr r3, _080C3ED0 + adds r0, r2, r3 + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string +_080C3EBE: + pop {r0} + bx r0 + .align 2, 0 +_080C3EC4: .4byte 0x02039ce8 +_080C3EC8: .4byte 0x0000052a +_080C3ECC: .4byte 0x00000574 +_080C3ED0: .4byte 0x0000034f + thumb_func_end sub_80C3E98 + + thumb_func_start sub_80C3ED4 +sub_80C3ED4: @ 80C3ED4 + push {lr} + ldr r0, _080C3F00 + ldr r2, [r0] + ldr r1, _080C3F04 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3EFC + adds r1, 0x4A + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C3EFC + ldr r1, _080C3F08 + ldr r0, _080C3F0C + adds r2, r0 + ldr r3, _080C3F10 + movs r0, 0x3 + bl sub_80C3C34 +_080C3EFC: + pop {r0} + bx r0 + .align 2, 0 +_080C3F00: .4byte 0x02039ce8 +_080C3F04: .4byte 0x0000052a +_080C3F08: .4byte 0x085ed01f +_080C3F0C: .4byte 0x0000034f +_080C3F10: .4byte 0x0856fb0f + thumb_func_end sub_80C3ED4 + + thumb_func_start sub_80C3F14 +sub_80C3F14: @ 80C3F14 + push {r4,lr} + ldr r4, _080C3F4C + ldr r1, [r4] + ldr r2, _080C3F50 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3F46 + ldr r0, _080C3F54 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080C3F46 + ldr r0, _080C3F58 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string + ldr r0, [r4] + ldr r1, _080C3F5C + adds r0, r1 + ldr r1, _080C3F60 + bl ExpandTextCodes +_080C3F46: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C3F4C: .4byte 0x02039ce8 +_080C3F50: .4byte 0x0000052a +_080C3F54: .4byte 0x00000552 +_080C3F58: .4byte 0x02021cc4 +_080C3F5C: .4byte 0x00000395 +_080C3F60: .4byte 0x085ed096 + thumb_func_end sub_80C3F14 + + thumb_func_start sub_80C3F64 +sub_80C3F64: @ 80C3F64 + push {lr} + ldr r0, _080C3F90 + ldr r2, [r0] + ldr r1, _080C3F94 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3F8C + adds r1, 0x28 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C3F8C + ldr r1, _080C3F98 + ldr r0, _080C3F9C + adds r2, r0 + ldr r3, _080C3FA0 + movs r0, 0x3 + bl sub_80C3C34 +_080C3F8C: + pop {r0} + bx r0 + .align 2, 0 +_080C3F90: .4byte 0x02039ce8 +_080C3F94: .4byte 0x0000052a +_080C3F98: .4byte 0x085ed085 +_080C3F9C: .4byte 0x00000395 +_080C3FA0: .4byte 0x0856fb0f + thumb_func_end sub_80C3F64 + + thumb_func_start sub_80C3FA4 +sub_80C3FA4: @ 80C3FA4 + push {lr} + ldr r0, _080C3FD4 + ldr r1, [r0] + ldr r2, _080C3FD8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3FCE + movs r3, 0xAA + lsls r3, 3 + adds r2, r1, r3 + ldrh r0, [r2] + cmp r0, 0 + beq _080C3FCE + ldr r3, _080C3FDC + adds r0, r1, r3 + ldrh r1, [r2] + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string +_080C3FCE: + pop {r0} + bx r0 + .align 2, 0 +_080C3FD4: .4byte 0x02039ce8 +_080C3FD8: .4byte 0x0000052a +_080C3FDC: .4byte 0x000003db + thumb_func_end sub_80C3FA4 + + thumb_func_start sub_80C3FE0 +sub_80C3FE0: @ 80C3FE0 + push {lr} + ldr r0, _080C400C + ldr r2, [r0] + ldr r1, _080C4010 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C4008 + adds r1, 0x26 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C4008 + ldr r1, _080C4014 + ldr r0, _080C4018 + adds r2, r0 + ldr r3, _080C401C + movs r0, 0x4 + bl sub_80C3C34 +_080C4008: + pop {r0} + bx r0 + .align 2, 0 +_080C400C: .4byte 0x02039ce8 +_080C4010: .4byte 0x0000052a +_080C4014: .4byte 0x085ed09f +_080C4018: .4byte 0x000003db +_080C401C: .4byte 0x0856fb0f + thumb_func_end sub_80C3FE0 + + thumb_func_start sub_80C4020 +sub_80C4020: @ 80C4020 + push {r4,lr} + ldr r4, _080C403C + ldr r1, [r4] + ldr r2, _080C4040 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C4044 + cmp r0, 0x1 + ble _080C40B6 + cmp r0, 0x2 + beq _080C4094 + b _080C40B6 + .align 2, 0 +_080C403C: .4byte 0x02039ce8 +_080C4040: .4byte 0x0000052a +_080C4044: + ldrb r0, [r1, 0xD] + cmp r0, 0 + beq _080C40B6 + ldr r0, _080C407C + ldr r2, _080C4080 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r0, _080C4084 + ldr r1, [r4] + ldr r2, _080C4088 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r0, [r4] + ldr r1, _080C408C + adds r0, r1 + ldr r1, _080C4090 + bl ExpandTextCodes + b _080C40B6 + .align 2, 0 +_080C407C: .4byte 0x02021cc4 +_080C4080: .4byte 0x0000054c +_080C4084: .4byte 0x02021dc4 +_080C4088: .4byte 0x0000054e +_080C408C: .4byte 0x00000421 +_080C4090: .4byte 0x085ed0e0 +_080C4094: + ldr r2, _080C40BC + adds r1, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _080C40B6 + ldr r0, _080C40C0 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x5 + bl decimal_int_to_string + ldr r0, [r4] + ldr r1, _080C40C4 + adds r0, r1 + ldr r1, _080C40C8 + bl ExpandTextCodes +_080C40B6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C40BC: .4byte 0x00000596 +_080C40C0: .4byte 0x02021cc4 +_080C40C4: .4byte 0x00000421 +_080C40C8: .4byte 0x085ed0c8 + thumb_func_end sub_80C4020 + + thumb_func_start sub_80C40CC +sub_80C40CC: @ 80C40CC + push {lr} + ldr r0, _080C40E8 + ldr r2, [r0] + ldr r1, _080C40EC + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C40F0 + cmp r0, 0x1 + ble _080C412C + cmp r0, 0x2 + beq _080C4114 + b _080C412C + .align 2, 0 +_080C40E8: .4byte 0x02039ce8 +_080C40EC: .4byte 0x0000052a +_080C40F0: + ldrb r0, [r2, 0xD] + cmp r0, 0 + beq _080C412C + ldr r1, _080C4108 + ldr r0, _080C410C + adds r2, r0 + ldr r3, _080C4110 + movs r0, 0x5 + bl sub_80C3C34 + b _080C412C + .align 2, 0 +_080C4108: .4byte 0x085ed0d3 +_080C410C: .4byte 0x00000421 +_080C4110: .4byte 0x0856fb0c +_080C4114: + ldr r1, _080C4130 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C412C + ldr r1, _080C4134 + ldr r0, _080C4138 + adds r2, r0 + ldr r3, _080C413C + movs r0, 0x5 + bl sub_80C3C34 +_080C412C: + pop {r0} + bx r0 + .align 2, 0 +_080C4130: .4byte 0x00000596 +_080C4134: .4byte 0x085ed0b6 +_080C4138: .4byte 0x00000421 +_080C413C: .4byte 0x0856fb0f + thumb_func_end sub_80C40CC + + thumb_func_start sub_80C4140 +sub_80C4140: @ 80C4140 + push {r4,r5,lr} + sub sp, 0x20 + ldr r1, _080C41C8 + add r0, sp, 0x10 + movs r2, 0x6 + bl memcpy + add r4, sp, 0x18 + ldr r1, _080C41CC + adds r0, r4, 0 + movs r2, 0x6 + bl memcpy + ldr r0, _080C41D0 + ldr r0, [r0] + ldr r1, _080C41D4 + adds r0, r1 + ldrb r0, [r0] + adds r5, r4, 0 + cmp r0, 0 + bne _080C41C0 + movs r4, 0 +_080C416C: + ldr r0, _080C41D0 + ldr r0, [r0] + lsls r1, r4, 1 + movs r2, 0xB1 + lsls r2, 3 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _080C41B6 + bl sub_80D30A0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 20 + movs r2, 0xE0 + lsls r2, 16 + adds r1, r2 + lsrs r1, 16 + adds r2, r5, r4 + ldrb r2, [r2] + adds r2, 0x3 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x4 + str r3, [sp] + str r3, [sp, 0x4] + add r0, sp + adds r0, 0x10 + ldrb r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x3 + movs r3, 0xF + bl bg_write_sequence_to_wram_tile_map_rect +_080C41B6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080C416C +_080C41C0: + add sp, 0x20 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C41C8: .4byte 0x0856fb68 +_080C41CC: .4byte 0x0856fb6e +_080C41D0: .4byte 0x02039ce8 +_080C41D4: .4byte 0x0000052a + thumb_func_end sub_80C4140 + + thumb_func_start sub_80C41D8 +sub_80C41D8: @ 80C41D8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _080C4208 + ldr r4, _080C420C + ldr r1, [r4] + movs r5, 0x8D + lsls r5, 3 + adds r1, r5 + movs r2, 0x60 + bl CpuSet + ldr r4, [r4] + ldr r1, _080C4210 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C4214 + cmp r0, 0x1 + ble _080C424A + cmp r0, 0x2 + beq _080C422A + cmp r0, 0x3 + beq _080C4242 + b _080C424A + .align 2, 0 +_080C4208: .4byte 0x08dde1f8 +_080C420C: .4byte 0x02039ce8 +_080C4210: .4byte 0x00000582 +_080C4214: + movs r2, 0x8D + lsls r2, 3 + adds r0, r4, r2 + movs r1, 0 + str r1, [sp] + movs r1, 0x60 + movs r2, 0 + movs r3, 0 + bl sub_80A2BAC + b _080C424A +_080C422A: + adds r0, r4, r5 + movs r2, 0xFA + lsls r2, 1 + movs r3, 0xA5 + lsls r3, 1 + movs r1, 0x9B + lsls r1, 1 + str r1, [sp] + movs r1, 0x60 + bl sub_80A2BAC + b _080C424A +_080C4242: + adds r0, r4, r5 + movs r1, 0x60 + bl TintPalette_SepiaTone +_080C424A: + ldr r0, _080C42A0 + ldr r0, [r0] + movs r1, 0x8D + lsls r1, 3 + adds r0, r1 + movs r1, 0x50 + movs r2, 0xC0 + bl gpu_pal_apply + movs r4, 0 +_080C425E: + ldr r0, _080C42A0 + ldr r0, [r0] + lsls r1, r4, 1 + movs r2, 0xB1 + lsls r2, 3 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _080C428E + movs r1, 0 + bl sub_80D3020 + adds r1, r0, 0 + lsls r3, r4, 20 + movs r0, 0x80 + lsls r0, 14 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x80 + lsls r2, 2 + bl gpu_copy_bg_tile_pattern_data_to_vram +_080C428E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080C425E + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C42A0: .4byte 0x02039ce8 + thumb_func_end sub_80C41D8 + + thumb_func_start sub_80C42A4 +sub_80C42A4: @ 80C42A4 + push {r4,lr} + sub sp, 0x14 + ldr r1, _080C4320 + add r0, sp, 0x10 + movs r2, 0x4 + bl memcpy + ldr r0, _080C4324 + ldr r1, [r0] + ldr r2, _080C4328 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C4316 + adds r2, 0x56 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C4316 + movs r4, 0 +_080C42CC: + ldr r0, _080C4324 + ldr r0, [r0] + ldr r1, _080C432C + adds r0, r1 + adds r0, r4 + ldrb r3, [r0] + cmp r3, 0 + beq _080C430C + lsls r1, r4, 18 + movs r2, 0xA0 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + lsls r2, r4, 1 + adds r2, r4 + adds r2, 0x2 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + subs r0, r3, 0x1 + add r0, sp + adds r0, 0x10 + ldrb r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x3 + movs r3, 0x2 + bl bg_write_sequence_to_wram_tile_map_rect +_080C430C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C42CC +_080C4316: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C4320: .4byte 0x0856fb74 +_080C4324: .4byte 0x02039ce8 +_080C4328: .4byte 0x0000052a +_080C432C: .4byte 0x00000584 + thumb_func_end sub_80C42A4 + + thumb_func_start sub_80C4330 +sub_80C4330: @ 80C4330 + push {lr} + ldr r0, _080C4374 + movs r1, 0xB0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080C4378 + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080C437C + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080C4380 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080C4384 + ldr r1, [r0] + ldr r0, _080C4388 + adds r1, r0 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x3 + movs r3, 0x80 + bl gpu_copy_bg_tile_pattern_data_to_vram + pop {r0} + bx r0 + .align 2, 0 +_080C4374: .4byte 0x0856f54c +_080C4378: .4byte 0x0856f56c +_080C437C: .4byte 0x0856f58c +_080C4380: .4byte 0x0856f5ac +_080C4384: .4byte 0x02039ce8 +_080C4388: .4byte 0x000017a8 + thumb_func_end sub_80C4330 + + thumb_func_start sub_80C438C +sub_80C438C: @ 80C438C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C438C + + thumb_func_start sub_80C43A8 +sub_80C43A8: @ 80C43A8 + push {r4,lr} + sub sp, 0x8 + ldr r0, _080C43C4 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0x4 + bls _080C43B8 + b _080C4532 +_080C43B8: + lsls r0, 2 + ldr r1, _080C43C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C43C4: .4byte 0x02039ce8 +_080C43C8: .4byte _080C43CC + .align 2, 0 +_080C43CC: + .4byte _080C43E0 + .4byte _080C43F8 + .4byte _080C4418 + .4byte _080C44D8 + .4byte _080C4500 +_080C43E0: + ldr r0, _080C43F0 + ldr r1, [r0] + ldr r0, _080C43F4 + adds r1, r0 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x3 + b _080C4406 + .align 2, 0 +_080C43F0: .4byte 0x02039ce8 +_080C43F4: .4byte 0x000013a8 +_080C43F8: + ldr r0, _080C4410 + ldr r1, [r0] + ldr r3, _080C4414 + adds r1, r3 + movs r2, 0xC0 + lsls r2, 5 + movs r0, 0 +_080C4406: + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _080C4536 + .align 2, 0 +_080C4410: .4byte 0x02039ce8 +_080C4414: .4byte 0x000019a8 +_080C4418: + ldr r4, _080C4460 + ldr r2, [r4] + ldr r1, _080C4464 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C447C + ldr r1, _080C4468 + ldr r3, _080C446C + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, _080C4470 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r4] + ldr r1, _080C4474 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C44B2 + ldr r0, _080C4478 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + b _080C44B2 + .align 2, 0 +_080C4460: .4byte 0x02039ce8 +_080C4464: .4byte 0x0000052a +_080C4468: .4byte 0x0856fae4 +_080C446C: .4byte 0x00000535 +_080C4470: .4byte 0x0856f4ec +_080C4474: .4byte 0x00000534 +_080C4478: .4byte 0x0856f4ac +_080C447C: + ldr r1, _080C44C0 + ldr r3, _080C44C4 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, _080C44C8 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r4] + ldr r1, _080C44CC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C44B2 + ldr r0, _080C44D0 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply +_080C44B2: + ldr r0, _080C44D4 + movs r1, 0x40 + movs r2, 0x20 + bl gpu_pal_apply + b _080C4536 + .align 2, 0 +_080C44C0: .4byte 0x0856faf8 +_080C44C4: .4byte 0x00000535 +_080C44C8: .4byte 0x0856f50c +_080C44CC: .4byte 0x00000534 +_080C44D0: .4byte 0x0856f4cc +_080C44D4: .4byte 0x0856f52c +_080C44D8: + ldr r4, _080C44F4 + ldr r1, [r4] + ldr r3, _080C44F8 + adds r1, r3 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _080C44FC + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + b _080C4536 + .align 2, 0 +_080C44F4: .4byte 0x02039ce8 +_080C44F8: .4byte 0x00003ca8 +_080C44FC: .4byte 0x00005ca8 +_080C4500: + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect +_080C4532: + movs r0, 0x1 + b _080C4542 +_080C4536: + ldr r0, _080C454C + ldr r1, [r0] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + movs r0, 0 +_080C4542: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080C454C: .4byte 0x02039ce8 + thumb_func_end sub_80C43A8 + + thumb_func_start sub_80C4550 +sub_80C4550: @ 80C4550 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, _080C4588 + ldr r0, [r0] + ldr r1, _080C458C + adds r6, r0, r1 + movs r1, 0 +_080C455E: + movs r2, 0 + lsls r5, r1, 16 + asrs r1, r5, 16 + lsls r3, r1, 5 + lsls r0, r1, 4 + subs r0, r1 + lsls r4, r0, 1 +_080C456C: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r2, r0, 0 + cmp r1, 0x1D + bgt _080C4590 + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + adds r1, r4, r1 + lsls r1, 1 + adds r1, r7 + ldrh r1, [r1] + b _080C4598 + .align 2, 0 +_080C4588: .4byte 0x02039ce8 +_080C458C: .4byte 0x00005ca8 +_080C4590: + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r7] +_080C4598: + strh r1, [r0] + movs r1, 0x80 + lsls r1, 9 + adds r0, r2, r1 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x1F + ble _080C456C + adds r0, r5, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080C455E + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C4550 + + thumb_func_start sub_80C45C0 +sub_80C45C0: @ 80C45C0 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, _080C45F8 + ldr r0, [r0] + ldr r1, _080C45FC + adds r6, r0, r1 + movs r1, 0 +_080C45CE: + movs r2, 0 + lsls r5, r1, 16 + asrs r1, r5, 16 + lsls r3, r1, 5 + lsls r0, r1, 4 + subs r0, r1 + lsls r4, r0, 1 +_080C45DC: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r2, r0, 0 + cmp r1, 0x1D + bgt _080C4600 + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + adds r1, r4, r1 + lsls r1, 1 + adds r1, r7 + ldrh r1, [r1] + b _080C4608 + .align 2, 0 +_080C45F8: .4byte 0x02039ce8 +_080C45FC: .4byte 0x00003ca8 +_080C4600: + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r7] +_080C4608: + strh r1, [r0] + movs r1, 0x80 + lsls r1, 9 + adds r0, r2, r1 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x1F + ble _080C45DC + adds r0, r5, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080C45CE + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C45C0 + + thumb_func_start sub_80C4630 +sub_80C4630: @ 80C4630 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0xC0 + mov r8, r0 + movs r2, 0x3 + mov r10, r2 + ldr r2, _080C473C + ldr r4, _080C4740 + ldr r1, [r4] + ldr r3, _080C4744 + adds r0, r1, r3 + ldrb r0, [r0] + adds r0, r2 + ldrb r3, [r0] + ldr r0, _080C4748 + adds r1, r0 + ldrb r0, [r1] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x4 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8F + movs r2, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + bne _080C4724 + movs r2, 0x4 + mov r9, r2 + movs r2, 0 + movs r6, 0x1 +_080C467E: + ldr r0, _080C4740 + ldr r1, [r0] + lsls r0, r2, 16 + asrs r7, r0, 16 + adds r1, 0x11 + adds r1, r7 + ldrb r0, [r1] + cmp r0, 0 + beq _080C4700 + mov r3, r9 + lsls r5, r3, 24 + lsrs r5, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + movs r0, 0x3 + mov r1, r8 + adds r2, r5, 0 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r1, r8 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + mov r4, r9 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + movs r0, 0x3 + adds r2, r4, 0 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r1, r8 + adds r1, 0x10 + lsls r1, 16 + lsrs r1, 16 + str r6, [sp] + str r6, [sp, 0x4] + mov r3, r10 + str r3, [sp, 0x8] + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0x10 + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r1, r8 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + movs r0, 0x3 + adds r2, r4, 0 + movs r3, 0x10 + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C4700: + adds r0, r7, 0x1 + lsls r0, 16 + mov r1, r8 + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + mov r2, r9 + lsls r1, r2, 16 + movs r3, 0xC0 + lsls r3, 10 + adds r1, r3 + lsrs r1, 16 + mov r9, r1 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080C467E +_080C4724: + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C473C: .4byte 0x0856fb78 +_080C4740: .4byte 0x02039ce8 +_080C4744: .4byte 0x0000052b +_080C4748: .4byte 0x00000535 + thumb_func_end sub_80C4630 + + thumb_func_start sub_80C474C +sub_80C474C: @ 80C474C + push {r4-r6,lr} + sub sp, 0xC + ldr r6, _080C47F4 + ldr r1, [r6] + ldr r2, _080C47F8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C4800 + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080C478A + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0x9 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xA + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C478A: + ldr r0, [r6] + movs r1, 0xAE + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C47BE + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x15 + movs r3, 0xD + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x15 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C47BE: + ldr r0, [r6] + ldr r2, _080C47FC + adds r0, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C48B8 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0xB + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xC + bl Bg_FillWramTileMapRectWithTileAndPalette + b _080C48B8 + .align 2, 0 +_080C47F4: .4byte 0x02039ce8 +_080C47F8: .4byte 0x0000052a +_080C47FC: .4byte 0x00000574 +_080C4800: + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080C482E + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0x9 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xA + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C482E: + ldr r0, [r6] + movs r1, 0xAA + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C4864 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0xD + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C4864: + ldr r0, [r6] + ldrb r0, [r0, 0xD] + cmp r0, 0 + beq _080C48B8 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x11 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x11 + movs r3, 0x10 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8C + movs r2, 0x1B + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9C + movs r2, 0x1B + movs r3, 0x10 + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C48B8: + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C474C + + thumb_func_start sub_80C48C8 +sub_80C48C8: @ 80C48C8 + push {lr} + ldr r3, _080C48FC + ldr r1, [r3] + ldrb r0, [r1, 0x6] + adds r0, 0x1 + strb r0, [r1, 0x6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3C + bls _080C48F6 + ldr r1, [r3] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r2, [r3] + ldrb r0, [r2, 0x7] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2, 0x7] + ldr r0, [r3] + ldr r1, _080C4900 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080C48F6: + pop {r0} + bx r0 + .align 2, 0 +_080C48FC: .4byte 0x02039ce8 +_080C4900: .4byte 0x00000529 + thumb_func_end sub_80C48C8 + + thumb_func_start sub_80C4904 +sub_80C4904: @ 80C4904 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080C4914 + movs r1, 0x64 + muls r0, r1 + adds r0, r2 + ldrb r0, [r0, 0x1] + bx lr + .align 2, 0 +_080C4914: .4byte 0x02039b58 + thumb_func_end sub_80C4904 + + thumb_func_start sub_80C4918 +sub_80C4918: @ 80C4918 + push {r4,lr} + ldr r4, _080C4938 + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + ldr r0, _080C493C + bl SetHBlankCallback + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C4938: .4byte sub_80C4960 + 1 +_080C493C: .4byte sub_80C26D4 + 1 + thumb_func_end sub_80C4918 + + thumb_func_start sub_80C4940 +sub_80C4940: @ 80C4940 + push {lr} + ldr r0, _080C4954 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080C4958 + movs r0, 0 + b _080C495A + .align 2, 0 +_080C4954: .4byte sub_80C4960 + 1 +_080C4958: + movs r0, 0x1 +_080C495A: + pop {r1} + bx r1 + thumb_func_end sub_80C4940 + + thumb_func_start sub_80C4960 +sub_80C4960: @ 80C4960 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080C4990 + ldr r2, _080C4994 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080C4972: + 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 _080C4972 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C4990: .4byte 0x0856fb28 +_080C4994: .4byte 0x03005e00 + thumb_func_end sub_80C4960 + + thumb_func_start sub_80C4998 +sub_80C4998: @ 80C4998 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + bl remove_some_task + bl dp12_8087EA4 + movs r1, 0 + ldr r0, _080C49D4 + movs r2, 0 + movs r3, 0xF0 + lsls r3, 3 + adds r0, r3 +_080C49BC: + strh r2, [r0] + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + bls _080C49BC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080C49D4: .4byte 0x02038c28 + thumb_func_end sub_80C4998 + + thumb_func_start sub_80C49D8 +sub_80C49D8: @ 80C49D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + ldr r0, _080C4A04 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x9] + mov r0, r8 + ldrh r1, [r0, 0xA] + movs r2, 0xA + ldrsh r0, [r0, r2] + cmp r0, 0x4C + ble _080C4A08 + movs r0, 0x4D + mov r3, r8 + strh r0, [r3, 0xA] + b _080C4A0E + .align 2, 0 +_080C4A04: .4byte 0x02039ce8 +_080C4A08: + adds r0, r1, 0x7 + mov r4, r8 + strh r0, [r4, 0xA] +_080C4A0E: + ldr r0, _080C4AF8 + ldr r0, [r0] + mov r2, r8 + ldrh r1, [r2, 0xA] + ldr r3, _080C4AFC + adds r0, r3 + strh r1, [r0] + ldrh r0, [r2, 0xA] + bl sub_80C32EC + mov r4, r8 + movs r0, 0xA + ldrsh r7, [r4, r0] + movs r0, 0xA0 + subs r0, r7 + mov r9, r0 + subs r4, r0, r7 + negs r0, r7 + lsls r6, r0, 16 + movs r0, 0xA0 + lsls r0, 16 + adds r1, r4, 0 + bl __udivsi3 + adds r5, r0, 0 + ldr r1, _080C4B00 + adds r5, r1 + adds r0, r5, 0 + muls r0, r4 + adds r0, r6, r0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + bl __udivsi3 + mov r10, r0 + lsls r5, 1 + movs r2, 0 + cmp r2, r7 + bcs _080C4A78 + ldr r3, _080C4B04 +_080C4A60: + lsls r0, r2, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r3 + negs r2, r0 + strh r2, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, r7 + bcc _080C4A60 +_080C4A78: + lsls r1, r2, 16 + mov r3, r9 + lsls r0, r3, 16 + asrs r3, r0, 16 + ldr r4, _080C4AF8 + mov r9, r4 + ldr r4, [sp] + lsrs r7, r4, 16 + cmp r1, r0 + bge _080C4AB0 + ldr r0, _080C4B04 + mov r12, r0 + adds r4, r3, 0 +_080C4A92: + lsrs r3, r6, 16 + adds r6, r5 + mov r2, r10 + subs r5, r2 + asrs r0, r1, 16 + lsls r1, r0, 1 + add r1, r12 + strh r3, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r4 + blt _080C4A92 +_080C4AB0: + adds r3, r7, 0 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _080C4ACE + ldr r2, _080C4B04 +_080C4ABC: + asrs r0, r1, 16 + lsls r1, r0, 1 + adds r1, r2 + strh r3, [r1] + adds r0, 0x1 + lsls r1, r0, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _080C4ABC +_080C4ACE: + mov r3, r9 + ldr r0, [r3] + movs r1, 0x1 + strb r1, [r0, 0x9] + mov r4, r8 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x4C + ble _080C4AE6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080C4AE6: + movs r0, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080C4AF8: .4byte 0x02039ce8 +_080C4AFC: .4byte 0x00007ca8 +_080C4B00: .4byte 0xffff0000 +_080C4B04: .4byte 0x02038c28 + thumb_func_end sub_80C49D8 + + thumb_func_start sub_80C4B08 +sub_80C4B08: @ 80C4B08 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r4, _080C4B34 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x9] + bl sub_8087598 + adds r2, r4, 0 + cmp r0, 0x1 + beq _080C4C08 +_080C4B20: + ldr r3, [r2] + ldrb r0, [r3, 0x4] + cmp r0, 0x4 + bhi _080C4BE4 + lsls r0, 2 + ldr r1, _080C4B38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C4B34: .4byte 0x02039ce8 +_080C4B38: .4byte _080C4B3C + .align 2, 0 +_080C4B3C: + .4byte _080C4B50 + .4byte _080C4B6C + .4byte _080C4B8C + .4byte _080C4BB0 + .4byte _080C4BCE +_080C4B50: + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + b _080C4BF6 +_080C4B6C: + ldr r0, [r2] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080C4B80 + bl sub_80C34B0 + lsls r0, 24 + cmp r0, 0 + bne _080C4BF6 + b _080C4C08 +_080C4B80: + bl sub_80C3438 + lsls r0, 24 + cmp r0, 0 + bne _080C4BF6 + b _080C4C08 +_080C4B8C: + ldr r0, _080C4BA0 + ldr r1, [r0] + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _080C4BA8 + ldr r2, _080C4BA4 + adds r0, r1, r2 + bl sub_80C45C0 + b _080C4BF6 + .align 2, 0 +_080C4BA0: .4byte 0x02039ce8 +_080C4BA4: .4byte 0x00000a48 +_080C4BA8: + movs r0, 0x1 + bl sub_80C438C + b _080C4BF6 +_080C4BB0: + ldr r0, _080C4BC0 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080C4BC4 + bl sub_80C474C + b _080C4BF6 + .align 2, 0 +_080C4BC0: .4byte 0x02039ce8 +_080C4BC4: + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + b _080C4BF6 +_080C4BCE: + ldr r0, _080C4BE0 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080C4BF6 + bl sub_80C4FF0 + b _080C4BF6 + .align 2, 0 +_080C4BE0: .4byte 0x02039ce8 +_080C4BE4: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x8] + movs r0, 0x1 + strb r0, [r3, 0x9] + ldr r0, [r2] + strb r1, [r0, 0x4] + b _080C4C08 +_080C4BF6: + ldr r2, _080C4C14 + ldr r1, [r2] + ldrb r0, [r1, 0x4] + adds r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, _080C4C18 + ldrb r0, [r0] + cmp r0, 0 + beq _080C4B20 +_080C4C08: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080C4C14: .4byte 0x02039ce8 +_080C4C18: .4byte 0x03003124 + thumb_func_end sub_80C4B08 + + thumb_func_start sub_80C4C1C +sub_80C4C1C: @ 80C4C1C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _080C4C7C + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x9] + ldr r0, [r4] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080C4C50 + movs r0, 0x2 + bl sub_80C438C + ldr r0, [r4] + ldr r1, _080C4C80 + adds r0, r1 + bl sub_80C4550 + ldr r0, [r4] + movs r1, 0xB3 + lsls r1, 3 + adds r0, r1 + bl sub_80C45C0 + bl sub_80C4630 +_080C4C50: + movs r0, 0x1 + bl sub_80C438C + ldr r2, [r4] + ldrb r0, [r2, 0x8] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2, 0x8] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0xFA + bl audio_play + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080C4C7C: .4byte 0x02039ce8 +_080C4C80: .4byte 0x00000ef8 + thumb_func_end sub_80C4C1C + + thumb_func_start sub_80C4C84 +sub_80C4C84: @ 80C4C84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + ldr r0, _080C4CAC + ldr r0, [r0] + movs r2, 0 + strb r2, [r0, 0x9] + mov r0, r8 + ldrh r1, [r0, 0xA] + movs r3, 0xA + ldrsh r0, [r0, r3] + cmp r0, 0x5 + bgt _080C4CB0 + mov r4, r8 + strh r2, [r4, 0xA] + b _080C4CB6 + .align 2, 0 +_080C4CAC: .4byte 0x02039ce8 +_080C4CB0: + subs r0, r1, 0x5 + mov r1, r8 + strh r0, [r1, 0xA] +_080C4CB6: + ldr r0, _080C4DA0 + ldr r0, [r0] + mov r2, r8 + ldrh r1, [r2, 0xA] + ldr r3, _080C4DA4 + adds r0, r3 + strh r1, [r0] + ldrh r0, [r2, 0xA] + bl sub_80C32EC + mov r4, r8 + movs r0, 0xA + ldrsh r7, [r4, r0] + movs r0, 0xA0 + subs r0, r7 + mov r9, r0 + subs r4, r0, r7 + negs r0, r7 + lsls r6, r0, 16 + movs r0, 0xA0 + lsls r0, 16 + adds r1, r4, 0 + bl __udivsi3 + adds r5, r0, 0 + ldr r1, _080C4DA8 + adds r5, r1 + adds r0, r5, 0 + muls r0, r4 + adds r0, r6, r0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + bl __udivsi3 + mov r10, r0 + lsrs r5, 1 + movs r2, 0 + cmp r2, r7 + bcs _080C4D20 + ldr r3, _080C4DAC +_080C4D08: + lsls r0, r2, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r3 + negs r2, r0 + strh r2, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, r7 + bcc _080C4D08 +_080C4D20: + lsls r1, r2, 16 + mov r3, r9 + lsls r0, r3, 16 + asrs r3, r0, 16 + ldr r4, _080C4DA0 + mov r9, r4 + ldr r4, [sp] + lsrs r7, r4, 16 + cmp r1, r0 + bge _080C4D56 + ldr r0, _080C4DAC + mov r12, r0 + adds r4, r3, 0 +_080C4D3A: + lsrs r3, r6, 16 + adds r6, r5 + add r5, r10 + asrs r0, r1, 16 + lsls r1, r0, 1 + add r1, r12 + strh r3, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r4 + blt _080C4D3A +_080C4D56: + adds r3, r7, 0 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _080C4D74 + ldr r2, _080C4DAC +_080C4D62: + asrs r0, r1, 16 + lsls r1, r0, 1 + adds r1, r2 + strh r3, [r1] + adds r0, 0x1 + lsls r1, r0, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _080C4D62 +_080C4D74: + mov r1, r9 + ldr r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x9] + mov r2, r8 + movs r3, 0xA + ldrsh r0, [r2, r3] + cmp r0, 0 + bgt _080C4D8C + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_080C4D8C: + movs r0, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080C4DA0: .4byte 0x02039ce8 +_080C4DA4: .4byte 0x00007ca8 +_080C4DA8: .4byte 0xffff0000 +_080C4DAC: .4byte 0x02038c28 + thumb_func_end sub_80C4C84 + + thumb_func_start sub_80C4DB0 +sub_80C4DB0: @ 80C4DB0 + push {lr} + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0 + bl SetHBlankCallback + ldr r0, _080C4DD8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080C4DD8: .4byte sub_80C4960 + 1 + thumb_func_end sub_80C4DB0 + + thumb_func_start sub_80C4DDC +sub_80C4DDC: @ 80C4DDC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _080C4E04 + ldr r0, _080C4E08 + bl malloc_and_clear + adds r1, r0, 0 + str r1, [r4] + movs r2, 0xA6 + lsls r2, 3 + adds r0, r1, r2 + str r5, [r0] + ldr r0, _080C4E0C + cmp r5, r0 + bne _080C4E18 + ldr r0, _080C4E10 + adds r1, r0 + ldr r0, _080C4E14 + b _080C4E1E + .align 2, 0 +_080C4E04: .4byte 0x02039ce8 +_080C4E08: .4byte 0x00007cac +_080C4E0C: .4byte sub_80C5868 + 1 +_080C4E10: .4byte 0x0000052c +_080C4E14: .4byte 0x00007fff +_080C4E18: + ldr r2, _080C4E34 + adds r1, r2 + movs r0, 0 +_080C4E1E: + strh r0, [r1] + bl in_trade_center + adds r3, r0, 0 + cmp r3, 0x1 + bne _080C4E3C + ldr r1, _080C4E38 + ldr r0, [r1] + strb r3, [r0, 0x5] + adds r2, r1, 0 + b _080C4E44 + .align 2, 0 +_080C4E34: .4byte 0x0000052c +_080C4E38: .4byte 0x02039ce8 +_080C4E3C: + ldr r2, _080C4E64 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x5] +_080C4E44: + ldr r0, [r2] + ldr r1, _080C4E68 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _080C4E6C + adds r0, r2 + bl sub_80C3020 + ldr r0, _080C4E70 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C4E64: .4byte 0x02039ce8 +_080C4E68: .4byte 0x00007caa +_080C4E6C: .4byte 0x00000534 +_080C4E70: .4byte sub_80C2C80 + 1 + thumb_func_end sub_80C4DDC + + thumb_func_start sub_80C4E74 +sub_80C4E74: @ 80C4E74 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080C4EC8 + ldr r0, _080C4ECC + bl malloc_and_clear + str r0, [r5] + movs r2, 0xA6 + lsls r2, 3 + adds r1, r0, r2 + str r6, [r1] + movs r1, 0x1 + strb r1, [r0, 0x5] + ldr r0, [r5] + ldr r1, _080C4ED0 + adds r0, r1 + ldr r2, _080C4ED4 + movs r1, 0x64 + muls r1, r4 + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r1, [r5] + ldr r2, _080C4ED8 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x1A] + ldr r2, _080C4EDC + adds r1, r2 + strb r0, [r1] + ldr r0, _080C4EE0 + bl set_callback2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C4EC8: .4byte 0x02039ce8 +_080C4ECC: .4byte 0x00007cac +_080C4ED0: .4byte 0x00000534 +_080C4ED4: .4byte 0x02039b58 +_080C4ED8: .4byte 0x020229e8 +_080C4EDC: .4byte 0x00007caa +_080C4EE0: .4byte sub_80C2C80 + 1 + thumb_func_end sub_80C4E74 + + thumb_func_start sub_80C4EE4 +sub_80C4EE4: @ 80C4EE4 + push {r4,r5,lr} + ldr r4, _080C4F40 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0] + ldr r2, [r4] + ldr r0, _080C4F44 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + strb r0, [r2, 0x6] + ldr r0, [r4] + strb r1, [r0, 0x7] + ldr r0, [r4] + strb r1, [r0, 0x8] + ldr r0, [r4] + movs r2, 0xA5 + lsls r2, 3 + adds r0, r2 + strb r1, [r0] + bl sub_80C4F50 + ldr r1, [r4] + ldr r3, _080C4F48 + adds r1, r3 + strb r0, [r1] + movs r5, 0 +_080C4F18: + movs r0, 0xD + muls r0, r5 + adds r0, 0x19 + ldr r1, [r4] + adds r0, r1, r0 + lsls r2, r5, 1 + ldr r3, _080C4F4C + adds r1, r3 + adds r1, r2 + ldrh r1, [r1] + bl sub_811EBBC + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080C4F18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C4F40: .4byte 0x02039ce8 +_080C4F44: .4byte 0x03005d90 +_080C4F48: .4byte 0x0000052a +_080C4F4C: .4byte 0x0000055c + thumb_func_end sub_80C4EE4 + + thumb_func_start sub_80C4F50 +sub_80C4F50: @ 80C4F50 + push {lr} + ldr r0, _080C4F6C + ldr r1, [r0] + cmp r1, 0 + bne _080C4F7C + ldr r0, _080C4F70 + ldrb r1, [r0] + subs r0, r1, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080C4F74 + movs r0, 0 + b _080C4FC2 + .align 2, 0 +_080C4F6C: .4byte 0x02039ce8 +_080C4F70: .4byte 0x082e9530 +_080C4F74: + cmp r1, 0x3 + beq _080C4FC0 + movs r0, 0x1 + b _080C4FC2 +_080C4F7C: + ldr r2, _080C4F98 + adds r0, r1, r2 + ldrb r2, [r0] + subs r0, r2, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080C4FA0 + ldr r0, _080C4F9C + adds r1, r0 + movs r0, 0 + strb r0, [r1] + b _080C4FC2 + .align 2, 0 +_080C4F98: .4byte 0x0000056c +_080C4F9C: .4byte 0x0000052b +_080C4FA0: + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _080C4FB8 + ldr r2, _080C4FB4 + adds r1, r2 + movs r0, 0x1 + strb r0, [r1] + b _080C4FC2 + .align 2, 0 +_080C4FB4: .4byte 0x0000052b +_080C4FB8: + ldr r0, _080C4FC8 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_080C4FC0: + movs r0, 0x2 +_080C4FC2: + pop {r1} + bx r1 + .align 2, 0 +_080C4FC8: .4byte 0x0000052b + thumb_func_end sub_80C4F50 + + thumb_func_start sub_80C4FCC +sub_80C4FCC: @ 80C4FCC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFC + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080C4FE2 + movs r0, 0 + b _080C4FEC +_080C4FE2: + cmp r1, 0x3 + beq _080C4FEA + movs r0, 0x1 + b _080C4FEC +_080C4FEA: + movs r0, 0x2 +_080C4FEC: + pop {r1} + bx r1 + thumb_func_end sub_80C4FCC + + thumb_func_start sub_80C4FF0 +sub_80C4FF0: @ 80C4FF0 + push {r4-r6,lr} + sub sp, 0x8 + bl in_trade_center + cmp r0, 0x1 + bne _080C5060 + ldr r0, _080C5048 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C5060 + ldr r5, _080C504C + ldr r0, [r5] + ldr r1, _080C5050 + adds r0, r1 + ldrb r0, [r0] + bl sub_806EFF0 + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080C5054 + ldr r1, [r5] + ldr r3, _080C5058 + adds r2, r1, r3 + ldrb r3, [r2] + lsls r3, 1 + ldr r2, _080C505C + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r3, r1 + adds r1, r3, r4 + ldrb r2, [r1] + adds r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + movs r1, 0x8 + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D938 + b _080C50AE + .align 2, 0 +_080C5048: .4byte 0x03003124 +_080C504C: .4byte 0x02039ce8 +_080C5050: .4byte 0x00000583 +_080C5054: .4byte 0x0856fb18 +_080C5058: .4byte 0x00000534 +_080C505C: .4byte 0x0000052b +_080C5060: + ldr r2, _080C50B8 + ldr r6, _080C50BC + ldr r0, [r6] + ldr r5, _080C50C0 + adds r1, r0, r5 + ldr r3, _080C50C4 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 1 + ldrb r1, [r1] + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + bl sub_806EFF0 + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080C50C8 + ldr r1, [r6] + adds r5, r1, r5 + ldrb r3, [r5] + lsls r3, 1 + ldr r2, _080C50CC + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r3, r1 + adds r1, r3, r4 + ldrb r2, [r1] + adds r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + movs r1, 0x8 + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D938 +_080C50AE: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C50B8: .4byte 0x0856fb20 +_080C50BC: .4byte 0x02039ce8 +_080C50C0: .4byte 0x00000534 +_080C50C4: .4byte 0x0000052a +_080C50C8: .4byte 0x0856fb18 +_080C50CC: .4byte 0x0000052b + thumb_func_end sub_80C4FF0 + + thumb_func_start sub_80C50D0 +sub_80C50D0: @ 80C50D0 + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _080C51BC + mov r0, sp + bl CpuSet + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x4 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _080C51C0 + bl CpuSet + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080C51BC: .4byte 0x0100c000 +_080C51C0: .4byte 0x05000100 + thumb_func_end sub_80C50D0 + + thumb_func_start sub_80C51C4 +sub_80C51C4: @ 80C51C4 + push {lr} + bl sub_80C51F0 + ldr r0, _080C51D4 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080C51D4: .4byte sub_80C544C + 1 + thumb_func_end sub_80C51C4 + + thumb_func_start sub_80C51D8 +sub_80C51D8: @ 80C51D8 + push {lr} + ldr r0, _080C51EC + ldr r0, [r0] + ldr r0, [r0] + bl set_callback2 + bl sub_80C52E4 + pop {r0} + bx r0 + .align 2, 0 +_080C51EC: .4byte 0x02039cec + thumb_func_end sub_80C51D8 + + thumb_func_start sub_80C51F0 +sub_80C51F0: @ 80C51F0 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, _080C5200 + ldr r0, [r5] + cmp r0, 0 + beq _080C5204 + movs r0, 0x1 + b _080C52C8 + .align 2, 0 +_080C5200: .4byte 0x02039cec +_080C5204: + movs r0, 0x18 + bl malloc_and_clear + str r0, [r5] + cmp r0, 0 + bne _080C5214 + movs r0, 0x2 + b _080C52C8 +_080C5214: + str r4, [r0] + bl sav1_map_get_name + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3A + beq _080C5232 + cmp r4, 0xCA + beq _080C5232 + ldr r0, [r5] + movs r1, 0xB0 + strh r1, [r0, 0x8] + movs r1, 0x68 + strh r1, [r0, 0xA] + b _080C5240 +_080C5232: + ldr r2, _080C52D0 + ldr r1, [r2] + movs r0, 0xB0 + strh r0, [r1, 0x8] + movs r0, 0x30 + strh r0, [r1, 0xA] + adds r5, r2, 0 +_080C5240: + ldr r1, [r5] + ldr r0, _080C52D4 + ldr r0, [r0] + ldr r2, _080C52D8 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1, 0x6] + bl sub_8185290 + ldr r3, [r5] + movs r1, 0x1 + ands r0, r1 + ldrb r2, [r3, 0xE] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xE] + ldr r2, [r5] + ldrb r1, [r2, 0xE] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xE] + bl sub_80C2E40 + ldr r3, [r5] + lsls r0, 4 + ldrb r2, [r3, 0xE] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xE] + movs r4, 0 + adds r6, r5, 0 +_080C5286: + lsls r5, r4, 1 + ldr r1, _080C52DC + adds r0, r5, r1 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080C52A2 + ldr r1, [r6] + adds r1, 0xF + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C52A2: + ldr r2, _080C52E0 + adds r0, r5, r2 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080C52BC + ldr r1, [r6] + adds r1, 0xF + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C52BC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080C5286 + movs r0, 0 +_080C52C8: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080C52D0: .4byte 0x02039cec +_080C52D4: .4byte 0x03005d90 +_080C52D8: .4byte 0x00000eb8 +_080C52DC: .4byte 0x000008c4 +_080C52E0: .4byte 0x000008c5 + thumb_func_end sub_80C51F0 + + thumb_func_start sub_80C52E4 +sub_80C52E4: @ 80C52E4 + push {r4,lr} + ldr r4, _080C5304 + ldr r0, [r4] + cmp r0, 0 + beq _080C5308 + movs r1, 0 + movs r2, 0x18 + bl memset + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + b _080C530A + .align 2, 0 +_080C5304: .4byte 0x02039cec +_080C5308: + movs r0, 0x1 +_080C530A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C52E4 + + thumb_func_start sub_80C5310 +sub_80C5310: @ 80C5310 + push {r4,lr} + ldr r4, _080C5320 + ldr r0, [r4] + cmp r0, 0 + beq _080C5324 + movs r0, 0x1 + b _080C533A + .align 2, 0 +_080C5320: .4byte 0x02039cf0 +_080C5324: + ldr r0, _080C5334 + bl malloc_and_clear + str r0, [r4] + cmp r0, 0 + beq _080C5338 + movs r0, 0 + b _080C533A + .align 2, 0 +_080C5334: .4byte 0x00002434 +_080C5338: + movs r0, 0x2 +_080C533A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C5310 + + thumb_func_start sub_80C5340 +sub_80C5340: @ 80C5340 + push {r4,lr} + bl Window_FreeMemory + ldr r4, _080C5354 + ldr r0, [r4] + cmp r0, 0 + bne _080C5358 + movs r0, 0x1 + b _080C53A0 + .align 2, 0 +_080C5354: .4byte 0x02039cf0 +_080C5358: + ldr r0, [r0, 0x28] + cmp r0, 0 + beq _080C5368 + bl free + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x28] +_080C5368: + ldr r0, [r4] + ldr r0, [r0, 0x24] + cmp r0, 0 + beq _080C537A + bl free + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x24] +_080C537A: + ldr r0, [r4] + ldr r0, [r0, 0x20] + cmp r0, 0 + beq _080C538C + bl free + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x20] +_080C538C: + ldr r0, [r4] + ldr r2, _080C53A8 + movs r1, 0 + bl memset + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] +_080C53A0: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080C53A8: .4byte 0x00002434 + thumb_func_end sub_80C5340 + + thumb_func_start pokemon_details +pokemon_details: @ 80C53AC + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, _080C542C + ldr r6, [r0] + adds r0, r6, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _080C5416 + ldr r3, _080C5430 + ldr r0, _080C5434 + ldr r0, [r0] + ldrb r4, [r0, 0xE] + lsls r4, 28 + lsrs r0, r4, 29 + subs r0, 0x1 + lsls r0, 2 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r1, 8 + lsrs r0, r4, 29 + subs r0, 0x1 + lsls r0, 2 + adds r5, r3, 0x2 + adds r0, r5 + movs r7, 0 + ldrsh r2, [r0, r7] + lsls r2, 8 + lsrs r0, r4, 29 + subs r0, 0x1 + lsls r0, 2 + adds r0, r3 + movs r7, 0 + ldrsh r3, [r0, r7] + lsrs r4, 29 + subs r4, 0x1 + lsls r4, 2 + adds r4, r5 + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp] + movs r7, 0x2E + ldrsh r0, [r6, r7] + str r0, [sp, 0x4] + movs r4, 0x30 + ldrsh r0, [r6, r4] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + bl call_gpu_bg_affine_set +_080C5416: + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C542C: .4byte 0x02039cf0 +_080C5430: .4byte 0x085713e0 +_080C5434: .4byte 0x02039cec + thumb_func_end pokemon_details + + thumb_func_start sub_80C5438 +sub_80C5438: @ 80C5438 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + pop {r0} + bx r0 + thumb_func_end sub_80C5438 + + thumb_func_start sub_80C544C +sub_80C544C: @ 80C544C + push {lr} + bl sub_80C5484 + cmp r0, 0 + beq _080C5464 + ldr r0, _080C5468 + movs r1, 0 + bl AddTask + ldr r0, _080C546C + bl set_callback2 +_080C5464: + pop {r0} + bx r0 + .align 2, 0 +_080C5468: .4byte sub_80C5A48 + 1 +_080C546C: .4byte sub_80C5438 + 1 + thumb_func_end sub_80C544C + + thumb_func_start sub_80C5470 +sub_80C5470: @ 80C5470 + push {lr} + bl sub_80C570C + cmp r0, 0 + beq _080C547E + bl sub_80C51D8 +_080C547E: + pop {r0} + bx r0 + thumb_func_end sub_80C5470 + + thumb_func_start sub_80C5484 +sub_80C5484: @ 80C5484 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp, 0x8] + ldr r0, _080C54A4 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0xA + bls _080C5498 + b _080C56F4 +_080C5498: + lsls r0, 2 + ldr r1, _080C54A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C54A4: .4byte 0x02039cec +_080C54A8: .4byte _080C54AC + .align 2, 0 +_080C54AC: + .4byte _080C54D8 + .4byte _080C54EE + .4byte _080C54F4 + .4byte _080C550A + .4byte _080C5510 + .4byte _080C5560 + .4byte _080C5570 + .4byte _080C55D0 + .4byte _080C5624 + .4byte _080C5684 + .4byte _080C56D0 +_080C54D8: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl vblank_hblank_handler_set_zero + movs r0, 0x2 + bl disable_irqs + b _080C56F4 +_080C54EE: + bl sub_80C50D0 + b _080C56F4 +_080C54F4: + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl sub_80A1A74 + bl reset_temp_tile_data_buffers + b _080C56F4 +_080C550A: + bl sub_80C5310 + b _080C56F4 +_080C5510: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080C5550 + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _080C5554 + ldr r1, [r4] + adds r1, 0x32 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _080C5558 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _080C555C + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + movs r0, 0x2 + movs r1, 0x6 + movs r2, 0x1 + bl gpu_bg_config_set_field + b _080C56F4 + .align 2, 0 +_080C5550: .4byte 0x085713e8 +_080C5554: .4byte 0x02039cf0 +_080C5558: .4byte 0x00001032 +_080C555C: .4byte 0x00002032 +_080C5560: + ldr r0, _080C556C + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + b _080C56F4 + .align 2, 0 +_080C556C: .4byte 0x08571400 +_080C5570: + ldr r0, _080C55B8 + add r1, sp, 0x8 + bl malloc_and_decompress + ldr r4, _080C55BC + ldr r1, [r4] + str r0, [r1, 0x20] + ldr r0, _080C55C0 + add r1, sp, 0x8 + bl malloc_and_decompress + ldr r1, [r4] + str r0, [r1, 0x24] + ldr r0, _080C55C4 + add r1, sp, 0x8 + bl malloc_and_decompress + ldr r1, [r4] + str r0, [r1, 0x28] + ldr r1, _080C55C8 + 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, _080C55CC + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _080C56F4 + .align 2, 0 +_080C55B8: .4byte 0x085712f8 +_080C55BC: .4byte 0x02039cf0 +_080C55C0: .4byte 0x08571060 +_080C55C4: .4byte 0x085712c0 +_080C55C8: .4byte 0x08de08c8 +_080C55CC: .4byte 0x08de2084 +_080C55D0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _080C55DC + b _080C56FE +_080C55DC: + 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 bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080C56F4 +_080C5624: + ldr r4, _080C567C + movs r2, 0xD0 + lsls r2, 1 + adds r0, r4, 0 + movs r1, 0 + bl gpu_pal_apply + ldr r5, _080C5680 + ldr r0, [r5] + ldrb r0, [r0, 0xE] + lsrs r0, 4 + lsls r0, 5 + adds r4, 0x20 + adds r0, r4 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + bl stdpal_get + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_80C629C + ldr r1, [r5] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0xD] + bl sub_80C6104 + ldr r5, [r5] + ldrb r0, [r5, 0xE] + movs r1, 0xE + ands r1, r0 + cmp r1, 0x2 + beq _080C5674 + cmp r1, 0x4 + bne _080C56F4 +_080C5674: + movs r0, 0 + strh r0, [r5, 0x4] + movs r0, 0x1 + b _080C5700 + .align 2, 0 +_080C567C: .4byte 0x08de07c8 +_080C5680: .4byte 0x02039cec +_080C5684: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + bl sub_80C62DC + ldr r0, _080C56CC + bl SetVBlankCallback + 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 sub_80A1AD4 + b _080C56F4 + .align 2, 0 +_080C56CC: .4byte pokemon_details + 1 +_080C56D0: + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C56FE + ldr r0, _080C56F0 + ldr r0, [r0] + strh r1, [r0, 0x4] + movs r0, 0x1 + b _080C5700 + .align 2, 0 +_080C56F0: .4byte 0x02039cec +_080C56F4: + ldr r0, _080C5708 + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] +_080C56FE: + movs r0, 0 +_080C5700: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080C5708: .4byte 0x02039cec + thumb_func_end sub_80C5484 + + thumb_func_start sub_80C570C +sub_80C570C: @ 80C570C + push {lr} + sub sp, 0x4 + ldr r1, _080C5728 + ldr r0, [r1] + ldrh r0, [r0, 0x4] + adds r2, r1, 0 + cmp r0, 0x5 + bhi _080C57E4 + lsls r0, 2 + ldr r1, _080C572C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C5728: .4byte 0x02039cec +_080C572C: .4byte _080C5730 + .align 2, 0 +_080C5730: + .4byte _080C5748 + .4byte _080C5770 + .4byte _080C577C + .4byte _080C57A6 + .4byte _080C57AC + .4byte _080C57BE +_080C5748: + ldr r0, [r2] + ldrb r0, [r0, 0xE] + movs r1, 0xE + ands r1, r0 + cmp r1, 0x2 + beq _080C576A + cmp r1, 0x4 + beq _080C576A + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _080C57E4 +_080C576A: + ldr r1, [r2] + movs r0, 0x2 + b _080C57EC +_080C5770: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _080C57E4 + b _080C57EE +_080C577C: + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl vblank_hblank_handler_set_zero + b _080C57E4 +_080C57A6: + bl sub_80C63FC + b _080C57E4 +_080C57AC: + bl sub_80C50D0 + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + b _080C57E4 +_080C57BE: + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x2 + bl bg_unset_tilemap + bl sub_80C5340 + ldr r0, _080C57E0 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x4] + movs r0, 0x1 + b _080C57F0 + .align 2, 0 +_080C57E0: .4byte 0x02039cec +_080C57E4: + ldr r0, _080C57F8 + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 +_080C57EC: + strh r0, [r1, 0x4] +_080C57EE: + movs r0, 0 +_080C57F0: + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_080C57F8: .4byte 0x02039cec + thumb_func_end sub_80C570C + + thumb_func_start sub_80C57FC +sub_80C57FC: @ 80C57FC + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r4, 0 + ldr r7, _080C584C + lsls r1, 16 + asrs r5, r1, 16 +_080C580A: + lsls r0, r4, 3 + adds r3, r0, r7 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, r5 + bgt _080C5854 + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, r5 + blt _080C5854 + movs r0, 0x4 + ldrsh r1, [r3, r0] + lsls r0, r6, 16 + asrs r2, r0, 16 + cmp r1, r2 + bgt _080C5854 + movs r1, 0x6 + ldrsh r0, [r3, r1] + cmp r0, r2 + blt _080C5854 + cmp r4, 0x5 + bls _080C5842 + ldr r0, _080C5850 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080C585E +_080C5842: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _080C5860 + .align 2, 0 +_080C584C: .4byte 0x08571454 +_080C5850: .4byte 0x02039cec +_080C5854: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xC + bls _080C580A +_080C585E: + movs r0, 0 +_080C5860: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80C57FC + + thumb_func_start sub_80C5868 +sub_80C5868: @ 80C5868 + push {lr} + bl sub_80C5484 + cmp r0, 0 + beq _080C58C6 + ldr r1, _080C58A0 + ldr r0, [r1] + ldrb r0, [r0, 0xE] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0x1 + blt _080C58AC + cmp r0, 0x2 + bgt _080C58AC + ldr r0, _080C58A4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080C58A8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + b _080C58C0 + .align 2, 0 +_080C58A0: .4byte 0x02039cec +_080C58A4: .4byte sub_80C5BD8 + 1 +_080C58A8: .4byte 0x03005e00 +_080C58AC: + ldr r2, [r1] + ldrb r1, [r2, 0xE] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xE] + ldr r0, _080C58CC + movs r1, 0 + bl AddTask +_080C58C0: + ldr r0, _080C58D0 + bl set_callback2 +_080C58C6: + pop {r0} + bx r0 + .align 2, 0 +_080C58CC: .4byte sub_80C5A48 + 1 +_080C58D0: .4byte sub_80C5438 + 1 + thumb_func_end sub_80C5868 + + thumb_func_start sub_80C58D4 +sub_80C58D4: @ 80C58D4 + push {r4,lr} + ldr r4, _080C590C + ldr r0, [r4] + bl sub_80C51F0 + ldr r0, _080C5910 + ldr r1, [r0] + ldrh r0, [r4, 0x4] + strh r0, [r1, 0x8] + ldrh r0, [r4, 0x6] + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + bl sub_81A9E40 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080C5914 + cmp r0, 0x2 + beq _080C591C + bl sub_8085784 + b _080C5924 + .align 2, 0 +_080C590C: .4byte 0x02039cf8 +_080C5910: .4byte 0x02039cec +_080C5914: + ldr r0, _080C5918 + b _080C5920 + .align 2, 0 +_080C5918: .4byte 0x000001cd +_080C591C: + movs r0, 0xE7 + lsls r0, 1 +_080C5920: + bl song_play_for_text +_080C5924: + ldr r0, _080C5930 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C5930: .4byte sub_80C5868 + 1 + thumb_func_end sub_80C58D4 + + thumb_func_start sub_80C5934 +sub_80C5934: @ 80C5934 + push {lr} + bl sub_80C570C + cmp r0, 0 + beq _080C599A + ldr r0, _080C5958 + ldr r2, [r0] + ldrb r0, [r2, 0xE] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0x2 + beq _080C5994 + cmp r0, 0x2 + bgt _080C595C + cmp r0, 0x1 + beq _080C5962 + b _080C599A + .align 2, 0 +_080C5958: .4byte 0x02039cec +_080C595C: + cmp r0, 0x3 + beq _080C5970 + b _080C599A +_080C5962: + ldr r0, _080C596C + bl sub_80C6454 + b _080C599A + .align 2, 0 +_080C596C: .4byte sub_80C5868 + 1 +_080C5970: + ldr r1, _080C598C + ldr r0, [r2] + str r0, [r1] + ldrh r0, [r2, 0x8] + strh r0, [r1, 0x4] + ldrh r0, [r2, 0xA] + strh r0, [r1, 0x6] + bl sub_80C52E4 + ldr r0, _080C5990 + bl sub_8185E24 + b _080C599A + .align 2, 0 +_080C598C: .4byte 0x02039cf8 +_080C5990: .4byte sub_80C58D4 + 1 +_080C5994: + ldr r0, _080C59A0 + bl sub_80C4DDC +_080C599A: + pop {r0} + bx r0 + .align 2, 0 +_080C59A0: .4byte sub_80C5868 + 1 + thumb_func_end sub_80C5934 + + thumb_func_start sub_80C59A4 +sub_80C59A4: @ 80C59A4 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x1 + blt _080C59CC + cmp r1, 0x2 + ble _080C59F4 + cmp r1, 0x3 + bne _080C59CC + ldr r0, _080C59D0 + ldr r2, [r0] + ldrb r1, [r2, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080C59D4 +_080C59CC: + movs r0, 0 + b _080C5A30 + .align 2, 0 +_080C59D0: .4byte 0x02039cec +_080C59D4: + movs r0, 0xF + negs r0, r0 + ands r0, r1 + movs r1, 0x6 + orrs r0, r1 + strb r0, [r2, 0xE] + adds r0, r3, 0 + bl remove_task + ldr r0, _080C59F0 + bl set_callback2 + b _080C5A1A + .align 2, 0 +_080C59F0: .4byte sub_80C5934 + 1 +_080C59F4: + ldr r0, _080C5A38 + ldr r3, [r0] + movs r0, 0x7 + ands r2, r0 + lsls r2, 1 + ldrb r1, [r3, 0xE] + subs r0, 0x16 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0xE] + ldr r1, _080C5A3C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080C5A40 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0x8] +_080C5A1A: + ldr r0, _080C5A38 + ldr r2, [r0] + ldr r0, _080C5A44 + ldr r1, [r0] + ldr r0, [r1] + ldrh r0, [r0, 0x20] + strh r0, [r2, 0x8] + ldr r0, [r1] + ldrh r0, [r0, 0x22] + strh r0, [r2, 0xA] + movs r0, 0x1 +_080C5A30: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080C5A38: .4byte 0x02039cec +_080C5A3C: .4byte 0x03005e00 +_080C5A40: .4byte sub_80C5BD8 + 1 +_080C5A44: .4byte 0x02039cf0 + thumb_func_end sub_80C59A4 + + thumb_func_start sub_80C5A48 +sub_80C5A48: @ 80C5A48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r2, _080C5B3C + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C5A80 + ldr r0, _080C5B40 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x22] + movs r7, 0x22 + ldrsh r0, [r1, r7] + cmp r0, 0x8 + ble _080C5A80 + subs r0, r3, 0x2 + strh r0, [r1, 0x22] + ldr r1, [r4] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x7 + bgt _080C5A7E + movs r0, 0x2 + strh r0, [r1, 0x22] +_080C5A7E: + movs r5, 0x1 +_080C5A80: + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C5AAE + ldr r0, _080C5B40 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x22] + movs r7, 0x22 + ldrsh r0, [r1, r7] + cmp r0, 0x87 + bgt _080C5AAE + adds r0, r3, 0x2 + strh r0, [r1, 0x22] + ldr r1, [r4] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x88 + ble _080C5AAC + movs r0, 0x88 + strh r0, [r1, 0x22] +_080C5AAC: + movs r5, 0x1 +_080C5AAE: + ldrh r1, [r2, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C5ADC + ldr r0, _080C5B40 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x20] + movs r7, 0x20 + ldrsh r0, [r1, r7] + cmp r0, 0x5 + ble _080C5ADC + subs r0, r3, 0x2 + strh r0, [r1, 0x20] + ldr r1, [r4] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x4 + bgt _080C5ADA + movs r0, 0x5 + strh r0, [r1, 0x20] +_080C5ADA: + movs r5, 0x1 +_080C5ADC: + ldrh r1, [r2, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C5B0A + ldr r0, _080C5B40 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x20] + movs r7, 0x20 + ldrsh r0, [r1, r7] + cmp r0, 0xE7 + bgt _080C5B0A + adds r0, r3, 0x2 + strh r0, [r1, 0x20] + ldr r1, [r4] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0xE8 + ble _080C5B08 + movs r0, 0xE8 + strh r0, [r1, 0x20] +_080C5B08: + movs r5, 0x1 +_080C5B0A: + cmp r5, 0 + bne _080C5B88 + ldr r4, _080C5B44 + ldr r0, [r4] + ldrb r3, [r0, 0xC] + cmp r3, 0 + beq _080C5B5E + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C5B5E + cmp r3, 0x3 + bhi _080C5B48 + movs r0, 0x5 + bl audio_play + ldr r0, [r4] + ldrb r1, [r0, 0xC] + adds r0, r6, 0 + bl sub_80C59A4 + cmp r0, 0 + bne _080C5BCA + b _080C5B5E + .align 2, 0 +_080C5B3C: .4byte 0x030022c0 +_080C5B40: .4byte 0x02039cf0 +_080C5B44: .4byte 0x02039cec +_080C5B48: + cmp r3, 0x4 + bne _080C5B5E + movs r0, 0x3 + bl audio_play + ldr r0, _080C5B80 + bl set_callback2 + adds r0, r6, 0 + bl remove_task +_080C5B5E: + ldr r0, _080C5B84 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C5BCA + movs r0, 0x3 + bl audio_play + ldr r0, _080C5B80 + bl set_callback2 + adds r0, r6, 0 + bl remove_task + b _080C5BCA + .align 2, 0 +_080C5B80: .4byte sub_80C5470 + 1 +_080C5B84: .4byte 0x030022c0 +_080C5B88: + ldr r0, _080C5BD0 + ldr r0, [r0] + ldr r1, [r0] + ldrh r0, [r1, 0x20] + subs r0, 0x5 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r1, 0x22] + adds r1, 0x5 + lsls r1, 16 + asrs r1, 16 + bl sub_80C57FC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080C5BD4 + ldr r0, [r4] + ldrb r0, [r0, 0xC] + cmp r0, r5 + beq _080C5BCA + adds r0, r5, 0 + bl sub_80C5ED0 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + strb r0, [r1, 0xD] + ldr r0, [r4] + strb r5, [r0, 0xC] + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0xD] + bl sub_80C6104 +_080C5BCA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C5BD0: .4byte 0x02039cf0 +_080C5BD4: .4byte 0x02039cec + thumb_func_end sub_80C5A48 + + thumb_func_start sub_80C5BD8 +sub_80C5BD8: @ 80C5BD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r5, r0, 3 + ldr r0, _080C5C04 + mov r8, r0 + adds r6, r5, r0 + ldr r7, _080C5C08 + ldr r0, [r7] + ldrh r0, [r0, 0x4] + cmp r0, 0x1 + beq _080C5CD4 + cmp r0, 0x1 + bgt _080C5C0C + cmp r0, 0 + beq _080C5C14 + b _080C5D9C + .align 2, 0 +_080C5C04: .4byte 0x03005e08 +_080C5C08: .4byte 0x02039cec +_080C5C0C: + cmp r0, 0x2 + bne _080C5C12 + b _080C5D2A +_080C5C12: + b _080C5D9C +_080C5C14: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080C5C4C + movs r0, 0x1 + movs r1, 0 + bl sub_80C5F58 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r6, 0x2] + strh r0, [r6, 0x4] + movs r0, 0x15 + strh r0, [r6, 0x6] + strh r0, [r6, 0x8] + movs r0, 0x1 + negs r0, r0 + ldr r1, _080C5C48 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _080C5CA4 + .align 2, 0 +_080C5C48: .4byte 0x00007fff +_080C5C4C: + movs r1, 0xFE + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r6, 0x2] + strh r0, [r6, 0x4] + movs r1, 0x15 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r6, 0x6] + strh r0, [r6, 0x8] + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + bl sub_80C62DC + ldr r0, _080C5CC8 + bl SetVBlankCallback + movs r5, 0x1 + negs r5, r5 + ldr r4, _080C5CCC + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r4, 0 + bl sub_80A2A20 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_080C5CA4: + ldr r4, _080C5CD0 + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] + movs r1, 0x2 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r1, [r4] + strh r0, [r1, 0x2E] + movs r1, 0x4 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r1, [r4] + strh r0, [r1, 0x30] + b _080C5D9C + .align 2, 0 +_080C5CC8: .4byte pokemon_details + 1 +_080C5CCC: .4byte 0x00007fff +_080C5CD0: .4byte 0x02039cf0 +_080C5CD4: + bl fade_and_return_progress_probably + ldrh r0, [r6, 0x6] + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r6, 0x2] + ldrh r0, [r6, 0x8] + ldrh r1, [r6, 0x4] + adds r0, r1 + strh r0, [r6, 0x4] + movs r1, 0x2 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r4, _080C5D18 + ldr r1, [r4] + strh r0, [r1, 0x2E] + movs r1, 0x4 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r1, [r4] + strh r0, [r1, 0x30] + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080C5D1C + movs r0, 0x2 + ldrsh r1, [r6, r0] + movs r0, 0xFE + lsls r0, 1 + cmp r1, r0 + ble _080C5DA6 + b _080C5D9C + .align 2, 0 +_080C5D18: .4byte 0x02039cf0 +_080C5D1C: + movs r0, 0x2 + ldrsh r1, [r6, r0] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _080C5DA6 + b _080C5D9C +_080C5D2A: + ldr r0, _080C5D5C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x2C + ldrb r0, [r1] + cmp r0, 0 + beq _080C5D3C + movs r0, 0 + strb r0, [r1] +_080C5D3C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C5DA6 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080C5D64 + adds r0, r4, 0 + bl remove_task + ldr r0, _080C5D60 + bl set_callback2 + b _080C5D82 + .align 2, 0 +_080C5D5C: .4byte 0x02039cf0 +_080C5D60: .4byte sub_80C5934 + 1 +_080C5D64: + movs r0, 0 + movs r1, 0 + bl sub_80C5F58 + ldr r2, [r7] + ldrb r1, [r2, 0xE] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xE] + mov r0, r8 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, _080C5D94 + str r1, [r0] +_080C5D82: + movs r0, 0x2 + movs r1, 0x6 + movs r2, 0 + bl gpu_bg_config_set_field + ldr r0, _080C5D98 + ldr r1, [r0] + movs r0, 0 + b _080C5DA4 + .align 2, 0 +_080C5D94: .4byte sub_80C5A48 + 1 +_080C5D98: .4byte 0x02039cec +_080C5D9C: + ldr r0, _080C5DB4 + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 +_080C5DA4: + strh r0, [r1, 0x4] +_080C5DA6: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C5DB4: .4byte 0x02039cec + thumb_func_end sub_80C5BD8 + + thumb_func_start sub_80C5DB8 +sub_80C5DB8: @ 80C5DB8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r4, 0 +_080C5DC2: + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080C5DC2 + ldr r4, _080C5EB8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x60 + bl sub_81DB35C + lsls r2, r0, 24 + lsrs r2, 24 + ldr r6, _080C5EBC + str r6, [sp] + movs r0, 0 + mov r8, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x5 + bl box_print + ldr r4, _080C5EC0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x60 + bl sub_81DB35C + lsls r2, r0, 24 + lsrs r2, 24 + str r6, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x5 + bl box_print + str r6, [sp] + mov r0, r8 + str r0, [sp, 0x4] + ldr r0, _080C5EC4 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x8 + movs r2, 0x5 + movs r3, 0x4 + bl box_print + ldr r4, _080C5EC8 + ldr r5, _080C5ECC + ldr r0, [r5] + ldrh r1, [r0, 0x6] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl decimal_int_to_string + movs r0, 0x8 + adds r1, r4, 0 + movs r2, 0x5B + bl sub_81DB368 + lsls r2, r0, 24 + lsrs r2, 24 + str r6, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x8 + movs r3, 0x10 + bl box_print + ldr r1, [r5] + ldrh r0, [r1, 0x8] + subs r0, 0x5 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r1, 0xA] + adds r1, 0x5 + lsls r1, 16 + asrs r1, 16 + bl sub_80C57FC + ldr r1, [r5] + strb r0, [r1, 0xC] + ldr r0, [r5] + mov r1, r8 + strb r1, [r0, 0xD] + ldr r0, [r5] + ldrb r0, [r0, 0xC] + bl sub_80C5ED0 + movs r4, 0 +_080C5E92: + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080C5E92 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C5EB8: .4byte 0x085ed8ff +_080C5EBC: .4byte 0x08571448 +_080C5EC0: .4byte 0x085ed90e +_080C5EC4: .4byte 0x085ed91c +_080C5EC8: .4byte 0x02021fc4 +_080C5ECC: .4byte 0x02039cec + thumb_func_end sub_80C5DB8 + + thumb_func_start sub_80C5ED0 +sub_80C5ED0: @ 80C5ED0 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 + movs r1, 0 + bl Window_FastFillPixels + cmp r4, 0x3 + bne _080C5F18 + ldr r0, _080C5F0C + ldr r0, [r0] + ldrb r0, [r0, 0xE] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _080C5F18 + ldr r0, _080C5F10 + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, _080C5F14 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0 + bl box_print + b _080C5F3A + .align 2, 0 +_080C5F0C: .4byte 0x02039cec +_080C5F10: .4byte 0x0857144b +_080C5F14: .4byte 0x08571614 +_080C5F18: + cmp r4, 0 + beq _080C5F3A + ldr r0, _080C5F50 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r1, _080C5F54 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0 + bl box_print +_080C5F3A: + movs r0, 0x3 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C5F50: .4byte 0x0857144b +_080C5F54: .4byte 0x08571614 + thumb_func_end sub_80C5ED0 + + thumb_func_start sub_80C5F58 +sub_80C5F58: @ 80C5F58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, _080C5F7C + ldr r0, [r0] + ldrb r0, [r0, 0xE] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0x1 + beq _080C5F80 + cmp r0, 0x2 + beq _080C5FC2 + b _080C60EE + .align 2, 0 +_080C5F7C: .4byte 0x02039cec +_080C5F80: + cmp r2, 0 + beq _080C5FA8 + ldr r0, _080C5FA4 + ldr r0, [r0] + ldr r1, [r0, 0x20] + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r2, 0x10 + movs r3, 0x3 + bl bg_copy_tilemap_rect_simple + b _080C6004 + .align 2, 0 +_080C5FA4: .4byte 0x02039cf0 +_080C5FA8: + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x10 + movs r3, 0x3 + bl Bg_FillWramTileMapRectWithTileAndPalette + b _080C6004 +_080C5FC2: + cmp r2, 0 + beq _080C5FEC + ldr r0, _080C5FE8 + ldr r0, [r0] + ldr r1, [r0, 0x20] + adds r1, 0x54 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r2, 0x10 + movs r3, 0xA + bl bg_copy_tilemap_rect_simple + b _080C6004 + .align 2, 0 +_080C5FE8: .4byte 0x02039cf0 +_080C5FEC: + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x10 + movs r3, 0xA + bl Bg_FillWramTileMapRectWithTileAndPalette +_080C6004: + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + cmp r7, 0 + beq _080C6084 + movs r4, 0xFE + lsls r4, 1 + adds r0, r4, 0 + bl sub_8151624 + adds r6, r0, 0 + lsls r6, 16 + asrs r6, 16 + adds r0, r4, 0 + bl sub_8151624 + lsls r0, 16 + asrs r0, 16 + ldr r5, _080C607C + ldr r1, _080C6080 + ldr r1, [r1] + ldrb r4, [r1, 0xE] + lsls r4, 28 + lsrs r1, r4, 29 + subs r1, 0x1 + lsls r1, 2 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 8 + lsrs r2, r4, 29 + subs r2, 0x1 + lsls r2, 2 + adds r3, r5, 0x2 + mov r8, r3 + add r2, r8 + movs r3, 0 + ldrsh r2, [r2, r3] + lsls r2, 8 + lsrs r3, r4, 29 + subs r3, 0x1 + lsls r3, 2 + adds r3, r5 + movs r5, 0 + ldrsh r3, [r3, r5] + lsrs r4, 29 + subs r4, 0x1 + lsls r4, 2 + add r4, r8 + movs r5, 0 + ldrsh r4, [r4, r5] + str r4, [sp] + str r6, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + bl call_gpu_bg_affine_set + b _080C60EE + .align 2, 0 +_080C607C: .4byte 0x085713e0 +_080C6080: .4byte 0x02039cec +_080C6084: + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + bl sub_8151624 + adds r6, r0, 0 + lsls r6, 16 + asrs r6, 16 + adds r0, r4, 0 + bl sub_8151624 + lsls r0, 16 + asrs r0, 16 + ldr r5, _080C60FC + ldr r1, _080C6100 + ldr r1, [r1] + ldrb r4, [r1, 0xE] + lsls r4, 28 + lsrs r1, r4, 29 + subs r1, 0x1 + lsls r1, 2 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 8 + lsrs r2, r4, 29 + subs r2, 0x1 + lsls r2, 2 + adds r3, r5, 0x2 + mov r8, r3 + add r2, r8 + movs r3, 0 + ldrsh r2, [r2, r3] + lsls r2, 8 + lsrs r3, r4, 29 + subs r3, 0x1 + lsls r3, 2 + adds r3, r5 + movs r5, 0 + ldrsh r3, [r3, r5] + lsrs r4, 29 + subs r4, 0x1 + lsls r4, 2 + add r4, r8 + movs r5, 0 + ldrsh r4, [r4, r5] + str r4, [sp] + str r6, [sp, 0x4] + str r0, [sp, 0x8] + str r7, [sp, 0xC] + movs r0, 0x2 + bl call_gpu_bg_affine_set +_080C60EE: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C60FC: .4byte 0x085713e0 +_080C6100: .4byte 0x02039cec + thumb_func_end sub_80C5F58 + + thumb_func_start sub_80C6104 +sub_80C6104: @ 80C6104 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r5, 0x2 + beq _080C614C + cmp r5, 0x2 + bgt _080C611E + cmp r5, 0x1 + beq _080C6128 + b _080C61C4 +_080C611E: + cmp r5, 0x3 + beq _080C6170 + cmp r5, 0x4 + beq _080C61A4 + b _080C61C4 +_080C6128: + ldr r0, _080C6148 + ldr r0, [r0] + ldr r1, [r0, 0x24] + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + movs r3, 0x3 + bl bg_copy_tilemap_rect_simple + b _080C61CE + .align 2, 0 +_080C6148: .4byte 0x02039cf0 +_080C614C: + ldr r0, _080C616C + ldr r0, [r0] + ldr r1, [r0, 0x24] + movs r0, 0xA8 + lsls r0, 1 + adds r1, r0 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + b _080C6192 + .align 2, 0 +_080C616C: .4byte 0x02039cf0 +_080C6170: + ldr r0, _080C619C + ldr r0, [r0] + ldrb r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C61C4 + ldr r0, _080C61A0 + ldr r0, [r0] + ldr r1, [r0, 0x28] + movs r0, 0xC + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x2 +_080C6192: + movs r3, 0xA + bl bg_copy_tilemap_rect_simple + b _080C61CE + .align 2, 0 +_080C619C: .4byte 0x02039cec +_080C61A0: .4byte 0x02039cf0 +_080C61A4: + ldr r1, _080C61C0 + movs r0, 0x9 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x15 + movs r3, 0 + bl bg_copy_tilemap_rect_simple + b _080C61CE + .align 2, 0 +_080C61C0: .4byte 0x08de3350 +_080C61C4: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080C6294 +_080C61CE: + cmp r4, 0x2 + beq _080C620C + cmp r4, 0x2 + bgt _080C61DC + cmp r4, 0x1 + beq _080C61E6 + b _080C6284 +_080C61DC: + cmp r4, 0x3 + beq _080C6230 + cmp r4, 0x4 + beq _080C6264 + b _080C6284 +_080C61E6: + ldr r0, _080C6208 + ldr r0, [r0] + ldr r1, [r0, 0x24] + adds r1, 0xA8 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + movs r3, 0x3 + bl bg_copy_tilemap_rect_simple + b _080C628E + .align 2, 0 +_080C6208: .4byte 0x02039cf0 +_080C620C: + ldr r0, _080C622C + ldr r0, [r0] + ldr r1, [r0, 0x24] + movs r0, 0xFC + lsls r0, 1 + adds r1, r0 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + b _080C6254 + .align 2, 0 +_080C622C: .4byte 0x02039cf0 +_080C6230: + ldr r0, _080C625C + ldr r0, [r0] + ldrb r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C6294 + ldr r0, _080C6260 + ldr r0, [r0] + ldr r1, [r0, 0x28] + adds r1, 0x48 + movs r0, 0xC + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x2 +_080C6254: + movs r3, 0xA + bl bg_copy_tilemap_rect_simple + b _080C628E + .align 2, 0 +_080C625C: .4byte 0x02039cec +_080C6260: .4byte 0x02039cf0 +_080C6264: + ldr r1, _080C6280 + movs r0, 0x9 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x15 + movs r3, 0 + bl bg_copy_tilemap_rect_simple + b _080C628E + .align 2, 0 +_080C6280: .4byte 0x08de3374 +_080C6284: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080C6294 +_080C628E: + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram +_080C6294: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C6104 + + thumb_func_start sub_80C629C +sub_80C629C: @ 80C629C + push {r4,lr} + ldr r1, _080C62D4 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r4, _080C62D8 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0xD] + bl sub_80C6104 + ldr r0, [r4] + ldrb r1, [r0, 0xE] + lsls r1, 28 + lsrs r1, 29 + movs r0, 0x1 + bl sub_80C5F58 + bl sub_80C5DB8 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C62D4: .4byte 0x08de3060 +_080C62D8: .4byte 0x02039cec + thumb_func_end sub_80C629C + + thumb_func_start sub_80C62DC +sub_80C62DC: @ 80C62DC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + movs r5, 0 + bl gpu_pal_allocator_reset + bl rotscale_reset_all + ldr r0, _080C63D8 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r4, _080C63DC + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x10 + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080C63E0 + ldr r1, _080C63E4 + ldr r2, [r1] + movs r3, 0x8 + ldrsh r1, [r2, r3] + movs r6, 0xA + ldrsh r2, [r2, r6] + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080C63E8 + ldr r2, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080C63EC + adds r1, r0 + str r1, [r2] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + mov r8, sp + mov r9, r3 +_080C633C: + ldr r0, _080C63E4 + ldr r0, [r0] + adds r0, 0xF + adds r2, r0, r5 + ldrb r0, [r2] + adds r4, r5, 0x1 + cmp r0, 0 + beq _080C63C2 + mov r1, sp + ldr r0, _080C63F0 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + mov r7, r8 + ldrh r0, [r7, 0x2] + ldr r1, _080C63F4 + adds r0, r1 + ldrb r2, [r2] + adds r0, r2 + strh r0, [r7, 0x2] + ldr r1, _080C63F8 + adds r0, r5, 0x6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x4] + adds r1, 0x8 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r0] + adds r2, 0x6 + lsls r2, 16 + asrs r2, 16 + lsls r3, r4, 24 + lsrs r3, 24 + mov r0, sp + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r3, r9 + ldr r2, [r3] + lsls r3, r5, 2 + adds r2, 0x4 + adds r2, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080C63EC + adds r1, r0 + str r1, [r2] + ldrb r2, [r1, 0x5] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r2, r0 + movs r0, 0x8 + orrs r2, r0 + strb r2, [r1, 0x5] + mov r7, r9 + ldr r0, [r7] + adds r0, 0x4 + adds r0, r3 + ldr r0, [r0] + adds r1, r5, 0 + bl obj_anim_image_start +_080C63C2: + lsls r0, r4, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080C633C + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C63D8: .4byte 0x085714e4 +_080C63DC: .4byte 0x085714bc +_080C63E0: .4byte 0x085715b4 +_080C63E4: .4byte 0x02039cec +_080C63E8: .4byte 0x02039cf0 +_080C63EC: .4byte 0x02020630 +_080C63F0: .4byte 0x085715e4 +_080C63F4: .4byte 0x0000ffff +_080C63F8: .4byte 0x08571454 + thumb_func_end sub_80C62DC + + thumb_func_start sub_80C63FC +sub_80C63FC: @ 80C63FC + push {r4-r6,lr} + movs r5, 0 + ldr r4, _080C644C + ldr r0, [r4] + ldr r0, [r0] + bl obj_delete_and_free_tiles + ldr r0, [r4] + str r5, [r0] + adds r6, r4, 0 +_080C6410: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0x4 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080C642C + bl obj_delete_and_free_tiles + ldr r0, [r6] + adds r0, 0x4 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080C642C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080C6410 + bl gpu_pal_allocator_reset + movs r0, 0x2 + bl gpu_tile_obj_free_by_tag + movs r0, 0 + bl gpu_tile_obj_free_by_tag + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C644C: .4byte 0x02039cf0 + thumb_func_end sub_80C63FC + + thumb_func_start nullsub_39 +nullsub_39: @ 80C6450 + bx lr + thumb_func_end nullsub_39 + + thumb_func_start sub_80C6454 +sub_80C6454: @ 80C6454 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _080C6488 + ldr r0, [r5] + cmp r0, 0 + beq _080C6466 + adds r0, r4, 0 + bl set_callback2 +_080C6466: + ldr r0, _080C648C + bl malloc_and_clear + str r0, [r5] + str r4, [r0] + bl clear_tasks + ldr r0, _080C6490 + movs r1, 0 + bl AddTask + ldr r0, _080C6494 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C6488: .4byte 0x02039cf4 +_080C648C: .4byte 0x00003014 +_080C6490: .4byte sub_80C67BC + 1 +_080C6494: .4byte sub_80C5438 + 1 + thumb_func_end sub_80C6454 + + thumb_func_start sub_80C6498 +sub_80C6498: @ 80C6498 + push {r4,lr} + bl clear_tasks + ldr r4, _080C64C4 + ldr r0, [r4] + ldr r0, [r0] + bl set_callback2 + ldr r0, [r4] + ldr r2, _080C64C8 + movs r1, 0 + bl memset + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C64C4: .4byte 0x02039cf4 +_080C64C8: .4byte 0x00003014 + thumb_func_end sub_80C6498 + + thumb_func_start sub_80C64CC +sub_80C64CC: @ 80C64CC + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _080C64E8 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0x7 + bls _080C64DC + b _080C6694 +_080C64DC: + lsls r0, 2 + ldr r1, _080C64EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C64E8: .4byte 0x02039cec +_080C64EC: .4byte _080C64F0 + .align 2, 0 +_080C64F0: + .4byte _080C6510 + .4byte _080C6520 + .4byte _080C6526 + .4byte _080C6538 + .4byte _080C65C0 + .4byte _080C65E8 + .4byte _080C6628 + .4byte _080C6678 +_080C6510: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl vblank_hblank_handler_set_zero + b _080C6694 +_080C6520: + bl sub_80C50D0 + b _080C6694 +_080C6526: + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl sub_80A1A74 + bl reset_temp_tile_data_buffers + b _080C6694 +_080C6538: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080C65B0 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _080C65B4 + ldr r1, [r4] + adds r1, 0x12 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _080C65B8 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _080C65BC + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + 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 bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080C6618 + .align 2, 0 +_080C65B0: .4byte 0x085713f4 +_080C65B4: .4byte 0x02039cf4 +_080C65B8: .4byte 0x00001012 +_080C65BC: .4byte 0x00002012 +_080C65C0: + ldr r0, _080C65E0 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + bl sub_80C6B94 + ldr r1, _080C65E4 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _080C6694 + .align 2, 0 +_080C65E0: .4byte 0x08571428 +_080C65E4: .4byte 0x0856fbbc +_080C65E8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _080C669E + ldr r0, _080C6620 + movs r2, 0xD0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + movs r0, 0 + bl stdpal_get + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _080C6624 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map +_080C6618: + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080C6694 + .align 2, 0 +_080C6620: .4byte 0x08de07c8 +_080C6624: .4byte 0x08570e00 +_080C6628: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + bl sub_80C6974 + ldr r0, _080C6670 + bl SetVBlankCallback + movs r5, 0x1 + negs r5, r5 + ldr r4, _080C6674 + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r4, 0 + bl sub_80A2A20 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _080C6694 + .align 2, 0 +_080C6670: .4byte pokemon_details + 1 +_080C6674: .4byte 0x00007fff +_080C6678: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C669E + ldr r0, _080C6690 + ldr r0, [r0] + strh r1, [r0, 0x4] + movs r0, 0x1 + b _080C66A0 + .align 2, 0 +_080C6690: .4byte 0x02039cec +_080C6694: + ldr r0, _080C66A8 + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] +_080C669E: + movs r0, 0 +_080C66A0: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080C66A8: .4byte 0x02039cec + thumb_func_end sub_80C64CC + + thumb_func_start sub_80C66AC +sub_80C66AC: @ 80C66AC + push {r4,lr} + sub sp, 0x4 + ldr r0, _080C66C4 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0x5 + bhi _080C67A4 + lsls r0, 2 + ldr r1, _080C66C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C66C4: .4byte 0x02039cec +_080C66C8: .4byte _080C66CC + .align 2, 0 +_080C66CC: + .4byte _080C66E4 + .4byte _080C66FC + .4byte _080C6722 + .4byte _080C6732 + .4byte _080C6774 + .4byte _080C6782 +_080C66E4: + movs r0, 0x1 + negs r0, r0 + ldr r1, _080C66F8 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _080C67A4 + .align 2, 0 +_080C66F8: .4byte 0x00007fff +_080C66FC: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C67AE + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + b _080C67A4 +_080C6722: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl vblank_hblank_handler_set_zero + b _080C67A4 +_080C6732: + ldr r4, _080C6770 + ldr r0, [r4] + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _080C6746 + bl obj_delete_and_free_tiles + movs r0, 0 + bl gpu_tile_obj_free_by_tag +_080C6746: + ldr r0, [r4] + ldr r0, [r0, 0xC] + cmp r0, 0 + beq _080C6758 + bl obj_delete_and_free_tiles + movs r0, 0x1 + bl gpu_tile_obj_free_by_tag +_080C6758: + ldr r0, [r4] + ldr r0, [r0, 0x8] + cmp r0, 0 + beq _080C676A + bl obj_delete_and_free_tiles + movs r0, 0x4 + bl gpu_tile_obj_free_by_tag +_080C676A: + bl Window_FreeMemory + b _080C67A4 + .align 2, 0 +_080C6770: .4byte 0x02039cf4 +_080C6774: + bl sub_80C50D0 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + b _080C67A4 +_080C6782: + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x2 + bl bg_unset_tilemap + ldr r0, _080C67A0 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x4] + movs r0, 0x1 + b _080C67B0 + .align 2, 0 +_080C67A0: .4byte 0x02039cec +_080C67A4: + ldr r0, _080C67B8 + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] +_080C67AE: + movs r0, 0 +_080C67B0: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080C67B8: .4byte 0x02039cec + thumb_func_end sub_80C66AC + + thumb_func_start sub_80C67BC +sub_80C67BC: @ 80C67BC + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _080C67E0 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _080C67D6 + b _080C68DA +_080C67D6: + lsls r0, 2 + ldr r1, _080C67E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C67E0: .4byte 0x03005e08 +_080C67E4: .4byte _080C67E8 + .align 2, 0 +_080C67E8: + .4byte _080C6800 + .4byte _080C6806 + .4byte _080C686C + .4byte _080C6894 + .4byte _080C68C4 + .4byte _080C68CE +_080C6800: + bl sub_80C64CC + b _080C68C8 +_080C6806: + ldr r0, _080C6820 + ldrh r1, [r0, 0x2E] + movs r2, 0x2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080C6824 + movs r0, 0x3 + bl audio_play + movs r0, 0x4 + b _080C68DE + .align 2, 0 +_080C6820: .4byte 0x030022c0 +_080C6824: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C6848 + ldr r0, _080C6840 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x5 + bls _080C6844 + movs r0, 0 + bl sub_80C6C70 + b _080C68E0 + .align 2, 0 +_080C6840: .4byte 0x02039cf4 +_080C6844: + strh r2, [r4] + b _080C68E0 +_080C6848: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C68E0 + ldr r0, _080C6864 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _080C6868 + movs r0, 0x1 + bl sub_80C6C70 + b _080C68E0 + .align 2, 0 +_080C6864: .4byte 0x02039cf4 +_080C6868: + movs r0, 0x3 + b _080C68DE +_080C686C: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080C6882 + movs r0, 0 + bl sub_80C6C70 + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x1 + b _080C68DE +_080C6882: + ldr r0, _080C6890 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrh r0, [r1, 0x22] + adds r0, 0x4 + b _080C68B4 + .align 2, 0 +_080C6890: .4byte 0x02039cf4 +_080C6894: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080C68AA + movs r0, 0x1 + bl sub_80C6C70 + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x1 + b _080C68DE +_080C68AA: + ldr r0, _080C68C0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrh r0, [r1, 0x22] + subs r0, 0x4 +_080C68B4: + strh r0, [r1, 0x22] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + b _080C68E0 + .align 2, 0 +_080C68C0: .4byte 0x02039cf4 +_080C68C4: + bl sub_80C66AC +_080C68C8: + cmp r0, 0 + bne _080C68DA + b _080C68E0 +_080C68CE: + adds r0, r2, 0 + bl remove_task + bl sub_80C6498 + b _080C68E0 +_080C68DA: + ldrh r0, [r4] + adds r0, 0x1 +_080C68DE: + strh r0, [r4] +_080C68E0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C67BC + + thumb_func_start sub_80C68E8 +sub_80C68E8: @ 80C68E8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, _080C6908 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x3 + bls _080C6904 + adds r0, r1, 0 + subs r0, 0xF + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C690C +_080C6904: + movs r0, 0x1 + b _080C696E + .align 2, 0 +_080C6908: .4byte 0xfffb0000 +_080C690C: + adds r0, r1, 0 + subs r0, 0x12 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _080C691C + movs r0, 0x2 + b _080C696E +_080C691C: + adds r0, r1, 0 + subs r0, 0x16 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C692C + movs r0, 0x3 + b _080C696E +_080C692C: + adds r0, r1, 0 + subs r0, 0x1C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C693C + movs r0, 0x4 + b _080C696E +_080C693C: + adds r0, r1, 0 + subs r0, 0x1F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C694C + movs r0, 0x5 + b _080C696E +_080C694C: + adds r0, r1, 0 + subs r0, 0x22 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _080C695C + movs r0, 0x6 + b _080C696E +_080C695C: + adds r0, r1, 0 + subs r0, 0x19 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080C696C + movs r0, 0 + b _080C696E +_080C696C: + movs r0, 0x7 +_080C696E: + pop {r1} + bx r1 + thumb_func_end sub_80C68E8 + + thumb_func_start sub_80C6974 +sub_80C6974: @ 80C6974 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + movs r7, 0 + bl gpu_pal_allocator_reset + ldr r0, _080C6A7C + bl gpu_pal_obj_alloc_and_load_multiple + ldr r6, _080C6A80 + adds r0, r6, 0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080C6A84 + mov r8, r0 + ldr r4, _080C6A88 + ldr r0, [r4] + ldrb r2, [r0, 0x10] + lsls r2, 4 + adds r2, 0x8 + mov r0, r8 + movs r1, 0x9B + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + ldr r2, _080C6A8C + mov r9, r2 + add r1, r9 + str r1, [r0, 0x4] + ldrb r2, [r1, 0x5] + movs r5, 0xD + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, 0x3F + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0x1 + bl obj_anim_image_start + adds r6, 0x8 + adds r0, r6, 0 + bl gpu_tile_obj_decompress_and_load + movs r3, 0x18 + add r8, r3 + ldr r6, _080C6A90 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + lsls r0, 4 + adds r0, r6 + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r3, 0xA + ldrsh r2, [r0, r3] + mov r0, r8 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, [r4] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + add r0, r9 + str r0, [r1, 0xC] + ldrb r1, [r0, 0x5] + ands r5, r1 + strb r5, [r0, 0x5] + ldr r1, [r4] + ldr r0, [r1, 0xC] + ldrb r1, [r1, 0x10] + lsls r1, 4 + adds r1, r6 + ldrb r1, [r1, 0xC] + bl obj_anim_image_start + bl sav1_map_get_name + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3A + beq _080C6A40 + cmp r5, 0xCA + beq _080C6A40 + b _080C6B7A +_080C6A40: + ldr r4, _080C6A94 + ldr r2, [r4] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, 0x4 + beq _080C6A52 + cmp r0, 0xE + bne _080C6A98 + movs r7, 0x37 +_080C6A52: + lsls r0, r7, 16 + asrs r0, 16 + ldrh r6, [r2] + adds r0, r6 + ldrh r4, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6A66 + adds r0, 0x7 +_080C6A66: + lsls r0, 13 + lsrs r7, r0, 16 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6A74 + adds r0, 0x7 +_080C6A74: + lsls r0, 13 + lsrs r4, r0, 16 + movs r5, 0 + b _080C6AF2 + .align 2, 0 +_080C6A7C: .4byte 0x085714e4 +_080C6A80: .4byte 0x085714bc +_080C6A84: .4byte 0x085715b4 +_080C6A88: .4byte 0x02039cf4 +_080C6A8C: .4byte 0x02020630 +_080C6A90: .4byte 0x08571650 +_080C6A94: .4byte 0x03005d8c +_080C6A98: + lsls r0, 16 + lsrs r0, 16 + bl sub_80C68E8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080C6AB4 + subs r0, r5, 0x1 + lsls r0, 4 + adds r0, r6 + ldrh r7, [r0, 0x8] + ldrh r4, [r0, 0xA] + b _080C6AF2 +_080C6AB4: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x25 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bne _080C6ACE + ldrh r0, [r1, 0x28] + adds r0, 0x37 + lsls r0, 16 + lsrs r7, r0, 16 + b _080C6AD0 +_080C6ACE: + ldrh r7, [r1, 0x28] +_080C6AD0: + ldr r0, _080C6B1C + ldr r0, [r0] + ldrh r4, [r0, 0x2A] + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6AE0 + adds r0, 0x7 +_080C6AE0: + lsls r0, 13 + lsrs r7, r0, 16 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6AEE + adds r0, 0x7 +_080C6AEE: + lsls r0, 13 + lsrs r4, r0, 16 +_080C6AF2: + ldr r0, _080C6B20 + bl gpu_tile_obj_decompress_and_load + mov r1, sp + ldr r0, _080C6B24 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r1, sp + ldr r0, _080C6B28 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + adds r0, 0x4 + strh r0, [r1, 0x2] + cmp r5, 0 + beq _080C6B2C + lsls r1, r7, 16 + asrs r1, 16 + lsls r2, r4, 16 + b _080C6B3E + .align 2, 0 +_080C6B1C: .4byte 0x03005d8c +_080C6B20: .4byte 0x085714d4 +_080C6B24: .4byte 0x085715fc +_080C6B28: .4byte 0x03005d90 +_080C6B2C: + lsls r1, r7, 19 + lsls r2, r4, 19 + movs r0, 0xA0 + lsls r0, 13 + adds r1, r0 + asrs r1, 16 + movs r3, 0x90 + lsls r3, 14 + adds r2, r3 +_080C6B3E: + asrs r2, 16 + mov r0, sp + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, _080C6B88 + ldr r2, [r4] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + ldr r0, _080C6B8C + adds r1, r0 + str r1, [r2, 0x8] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, _080C6B90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080C6B7A + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r1, 0x1 + bl obj_anim_image_start +_080C6B7A: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C6B88: .4byte 0x02039cf4 +_080C6B8C: .4byte 0x02020630 +_080C6B90: .4byte 0x03005d90 + thumb_func_end sub_80C6974 + + thumb_func_start sub_80C6B94 +sub_80C6B94: @ 80C6B94 + push {r4-r6,lr} + sub sp, 0xC + movs r4, 0 +_080C6B9A: + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C6B9A + movs r4, 0 + movs r6, 0 + ldr r5, _080C6BE4 +_080C6BB8: + ldr r0, _080C6BE8 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r4, r0 + bne _080C6BF0 + lsls r1, r4, 4 + adds r3, r1, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _080C6BEC + str r0, [sp] + str r6, [sp, 0x4] + adds r1, r5 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print + b _080C6C0E + .align 2, 0 +_080C6BE4: .4byte 0x08571650 +_080C6BE8: .4byte 0x02039cf4 +_080C6BEC: .4byte 0x0857144e +_080C6BF0: + lsls r1, r4, 4 + adds r3, r1, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _080C6C60 + str r0, [sp] + str r6, [sp, 0x4] + adds r1, r5 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print +_080C6C0E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080C6BB8 + ldr r0, _080C6C64 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r1, _080C6C68 + ldr r0, _080C6C6C + ldr r0, [r0] + ldrb r0, [r0, 0x10] + lsls r0, 4 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0 + bl box_print + movs r4, 0 +_080C6C40: + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C6C40 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C6C60: .4byte 0x0857144b +_080C6C64: .4byte 0x08571448 +_080C6C68: .4byte 0x08571650 +_080C6C6C: .4byte 0x02039cf4 + thumb_func_end sub_80C6B94 + + thumb_func_start sub_80C6C70 +sub_80C6C70: @ 80C6C70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + lsls r0, 24 + cmp r0, 0 + beq _080C6C8C + ldr r0, _080C6C88 + ldr r4, [r0] + ldrb r5, [r4, 0x10] + adds r0, r5, 0x6 + b _080C6C94 + .align 2, 0 +_080C6C88: .4byte 0x02039cf4 +_080C6C8C: + ldr r0, _080C6D74 + ldr r4, [r0] + ldrb r5, [r4, 0x10] + adds r0, r5, 0x1 +_080C6C94: + movs r1, 0x7 + bl __modsi3 + strb r0, [r4, 0x10] + lsls r0, r5, 4 + adds r3, r0, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r6, _080C6D78 + str r6, [sp] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x4] + ldr r4, _080C6D7C + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print + ldr r5, _080C6D74 + ldr r1, [r5] + ldrb r3, [r1, 0x10] + lsls r3, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0x3 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print + ldr r1, [r5] + ldr r2, [r1, 0x4] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, 0x8 + strh r0, [r2, 0x22] + ldr r0, [r1, 0xC] + ldrb r1, [r1, 0x10] + lsls r1, 4 + adds r1, r4 + ldrb r1, [r1, 0xC] + bl obj_anim_image_start + ldr r1, [r5] + ldr r2, [r1, 0xC] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0, 0x8] + strh r0, [r2, 0x20] + ldr r2, [r1, 0xC] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0, 0xA] + strh r0, [r2, 0x22] + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + subs r6, 0x3 + str r6, [sp] + mov r1, r8 + str r1, [sp, 0x4] + ldr r0, [r5] + ldrb r0, [r0, 0x10] + lsls r0, 4 + adds r4, 0x4 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0 + bl box_print + movs r4, 0 +_080C6D4A: + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C6D4A + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x6C + bl audio_play + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C6D74: .4byte 0x02039cf4 +_080C6D78: .4byte 0x0857144b +_080C6D7C: .4byte 0x08571650 + thumb_func_end sub_80C6C70 + + thumb_func_start sub_80C6D80 +sub_80C6D80: @ 80C6D80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r0, [sp, 0x24] + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x28] + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x1C] + str r1, [sp, 0x20] + ldr r1, _080C6DFC + ldr r0, [sp, 0x1C] + ands r0, r1 + movs r1, 0xC0 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0x1C] + ldr r1, _080C6E00 + add r5, sp, 0x1C + ldr r0, [r5, 0x4] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [r5, 0x4] + adds r0, r5, 0 + bl Window_AddFromTemplate + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r4, r0, 24 + lsrs r4, 24 + mov r0, r9 + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + movs r1, 0x7 + bl Window_GetField + adds r6, r0, 0 + ldrb r0, [r5, 0x3] + lsls r0, 5 + adds r0, r6 + mov r8, r0 + ldr r1, [sp, 0x28] + cmp r1, 0 + bne _080C6E04 + add r0, sp, 0x14 + b _080C6E08 + .align 2, 0 +_080C6DFC: .4byte 0x00ffffff +_080C6E00: .4byte 0xffffff00 +_080C6E04: + add r0, sp, 0x14 + mov r1, r9 +_080C6E08: + strb r1, [r0] + add r1, sp, 0x14 + movs r2, 0 + movs r0, 0xF + strb r0, [r1, 0x1] + movs r0, 0xE + strb r0, [r1, 0x2] + mov r0, r10 + lsls r4, r0, 24 + lsrs r0, r4, 24 + str r2, [sp] + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0xC] + ldr r1, [sp, 0x24] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl sub_8199EEC + ldr r0, [sp, 0x4C] + mov r10, r4 + cmp r0, 0x6 + bls _080C6E3E + movs r0, 0x6 +_080C6E3E: + ldr r4, [sp, 0x4C] + subs r4, 0x6 + cmp r0, 0 + ble _080C6E70 + adds r5, r0, 0 +_080C6E48: + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x40 + bl CpuSet + adds r1, r7, 0 + adds r1, 0x80 + mov r0, r8 + movs r2, 0x40 + bl CpuSet + adds r6, 0x80 + movs r2, 0x80 + add r8, r2 + movs r0, 0x80 + lsls r0, 1 + adds r7, r0 + subs r5, 0x1 + cmp r5, 0 + bne _080C6E48 +_080C6E70: + cmp r4, 0 + ble _080C6E90 + add r0, sp, 0x18 + mov r2, r9 + lsls r1, r2, 4 + orrs r1, r2 + strh r1, [r0] + lsls r2, r4, 7 + ldr r1, _080C6EA8 + ands r2, r1 + movs r1, 0x80 + lsls r1, 17 + orrs r2, r1 + adds r1, r7, 0 + bl CpuSet +_080C6E90: + mov r1, r10 + lsrs r0, r1, 24 + bl Window_Remove + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C6EA8: .4byte 0x001fffff + thumb_func_end sub_80C6D80 + + thumb_func_start sub_80C6EAC +sub_80C6EAC: @ 80C6EAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r0, [sp, 0x20] + str r1, [sp, 0x24] + adds r6, r3, 0 + ldr r0, [sp, 0x4C] + mov r9, r0 + ldr r1, [sp, 0x50] + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x28] + lsls r6, 24 + lsrs r6, 24 + mov r2, r9 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + ldr r0, [sp, 0x20] + bl sub_80091CC + lsls r0, 24 + ldr r2, _080C6F98 + ldr r1, [sp, 0x18] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x18] + ldr r1, _080C6F9C + add r2, sp, 0x18 + mov r8, r2 + ldr r0, [r2, 0x4] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r5, [sp, 0x18] + lsrs r5, 24 + lsls r5, 5 + mov r0, r8 + bl Window_AddFromTemplate + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, r6, 4 + orrs r1, r6 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + movs r1, 0x7 + bl Window_GetField + adds r7, r0, 0 + mov r0, r8 + ldrb r0, [r0, 0x3] + lsls r0, 5 + mov r8, r0 + add r8, r7 + add r0, sp, 0x14 + movs r1, 0 + strb r6, [r0] + mov r2, r9 + strb r2, [r0, 0x1] + mov r2, r10 + strb r2, [r0, 0x2] + str r1, [sp] + str r1, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + ldr r0, [sp, 0x20] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x2 + bl sub_8199EEC + lsrs r5, 1 + adds r0, r7, 0 + ldr r1, [sp, 0x24] + adds r2, r5, 0 + bl CpuSet + ldr r2, [sp, 0x24] + ldr r0, [sp, 0x28] + adds r1, r2, r0 + mov r0, r8 + adds r2, r5, 0 + bl CpuSet + adds r0, r4, 0 + bl Window_Remove + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C6F98: .4byte 0x00ffffff +_080C6F9C: .4byte 0xffffff00 + thumb_func_end sub_80C6EAC + + thumb_func_start sub_80C6FA0 +sub_80C6FA0: @ 80C6FA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r5, 0 +_080C6FAA: + lsls r1, r4, 24 + lsrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl get_pokemon_data_from_any_box + cmp r0, 0 + beq _080C6FC0 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C6FC0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bls _080C6FAA + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80C6FA0 + + thumb_func_start sub_80C6FD4 +sub_80C6FD4: @ 80C6FD4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_080C6FDC: + lsls r1, r4, 24 + lsrs r1, 24 + adds r0, r5, 0 + movs r2, 0xB + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _080C6FF2 + lsls r0, r4, 16 + asrs r0, 16 + b _080C7000 +_080C6FF2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bls _080C6FDC + movs r0, 0x1 + negs r0, r0 +_080C7000: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C6FD4 + + thumb_func_start sub_80C7008 +sub_80C7008: @ 80C7008 + push {r4-r6,lr} + movs r5, 0 + movs r6, 0 +_080C700E: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _080C704C + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080C7036 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080C7036 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C7036: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080C700E + lsls r0, r6, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080C704C: .4byte 0x020244ec + thumb_func_end sub_80C7008 + + thumb_func_start sub_80C7050 +sub_80C7050: @ 80C7050 + push {r4-r7,lr} + lsls r0, 24 + movs r5, 0 + movs r6, 0 + lsrs r7, r0, 24 +_080C705A: + cmp r5, r7 + beq _080C7092 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _080C70A8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080C7092 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080C7092 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080C7092 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C7092: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080C705A + lsls r0, r6, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080C70A8: .4byte 0x020244ec + thumb_func_end sub_80C7050 + + thumb_func_start sub_80C70AC +sub_80C70AC: @ 80C70AC + push {lr} + ldr r0, _080C70C0 + ldrb r0, [r0] + bl sub_80C7050 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080C70C0: .4byte 0x020375e0 + thumb_func_end sub_80C70AC + + thumb_func_start sub_80C70C4 +sub_80C70C4: @ 80C70C4 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_080C70CA: + movs r0, 0x64 + muls r0, r4 + ldr r1, _080C70F8 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080C70E2 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C70E2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _080C70CA + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080C70F8: .4byte 0x020244ec + thumb_func_end sub_80C70C4 + + thumb_func_start sub_80C70FC +sub_80C70FC: @ 80C70FC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r2, 16 + lsrs r4, 16 + bl gf_strcpy + adds r1, r0, 0 + adds r5, r4 + cmp r1, r5 + bcs _080C711A + movs r0, 0 +_080C7112: + strb r0, [r1] + adds r1, 0x1 + cmp r1, r5 + bcc _080C7112 +_080C711A: + movs r0, 0xFF + strb r0, [r1] + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C70FC + + thumb_func_start sub_80C7128 +sub_80C7128: @ 80C7128 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r7, r3, 0 + ldr r5, [sp, 0x1C] + ldr r4, [sp, 0x20] + ldr r0, [sp, 0x24] + mov r9, r0 + ldr r0, [sp, 0x28] + ldr r3, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r0, r9 + lsls r0, 17 + mov r9, r0 + lsrs r2, 11 + adds r2, r1 + lsls r2, 1 + adds r6, r2 + adds r0, r4, 0 + muls r0, r3 + adds r0, r5 + lsls r0, 1 + adds r7, r0 + movs r4, 0 + cmp r4, r8 + bcs _080C7198 + mov r0, r9 + lsrs r0, 1 + mov r9, r0 + lsls r5, r3, 1 +_080C717E: + adds r0, r7, 0 + adds r1, r6, 0 + mov r3, r9 + lsrs r2, r3, 16 + bl CpuSet + adds r6, 0x40 + adds r7, r5 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r8 + bcc _080C717E +_080C7198: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C7128 + + thumb_func_start sub_80C71A4 +sub_80C71A4: @ 80C71A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [sp, 0x28] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsrs r2, 11 + adds r2, r1 + lsls r2, 1 + adds r4, r2 + lsls r3, 17 + lsrs r0, r3, 16 + str r0, [sp, 0x4] + movs r0, 0 + cmp r0, r10 + bcs _080C724E + movs r6, 0x80 + lsls r6, 5 + mov r5, sp + ldr r7, _080C7210 + lsrs r3, 17 + mov r9, r3 + mov r1, r9 + movs r2, 0x81 + lsls r2, 24 + orrs r1, r2 + mov r9, r1 +_080C71EA: + adds r3, r4, 0 + ldr r2, [sp, 0x4] + movs r1, 0x40 + adds r1, r4 + mov r8, r1 + adds r0, 0x1 + mov r12, r0 + cmp r2, r6 + bhi _080C7214 + movs r0, 0 + strh r0, [r5] + mov r2, sp + str r2, [r7] + str r4, [r7, 0x4] + mov r0, r9 + str r0, [r7, 0x8] + ldr r0, [r7, 0x8] + b _080C7242 + .align 2, 0 +_080C7210: .4byte 0x040000d4 +_080C7214: + movs r4, 0 + strh r4, [r5] + ldr r1, _080C7260 + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + ldr r0, _080C7264 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r6 + subs r2, r6 + cmp r2, r6 + bhi _080C7214 + strh r4, [r5] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + lsrs r0, r2, 1 + movs r2, 0x81 + lsls r2, 24 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_080C7242: + mov r4, r8 + mov r1, r12 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, r10 + bcc _080C71EA +_080C724E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C7260: .4byte 0x040000d4 +_080C7264: .4byte 0x81000800 + thumb_func_end sub_80C71A4 + + thumb_func_start c3_0808C39C +c3_0808C39C: @ 80C7268 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080C7290 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _080C7284 + b _080C756A +_080C7284: + lsls r0, 2 + ldr r1, _080C7294 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C7290: .4byte 0x03005e00 +_080C7294: .4byte _080C7298 + .align 2, 0 +_080C7298: + .4byte _080C72AC + .4byte _080C730C + .4byte _080C7320 + .4byte _080C746A + .4byte _080C7544 +_080C72AC: + ldrb r0, [r5, 0xA] + adds r1, r5, 0 + adds r1, 0x26 + bl sub_80C75FC + bl sub_81973A4 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, _080C7308 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + 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, 0xFF + bl text_box_related_one + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl Window_CopyToVram + b _080C7318 + .align 2, 0 +_080C7308: .4byte 0x085716c0 +_080C730C: + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + bne _080C7318 + b _080C756A +_080C7318: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080C756A +_080C7320: + bl ProcessMenuInput + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xC] + movs r3, 0xC + ldrsh r1, [r5, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C73D0 + cmp r1, r0 + bgt _080C7342 + subs r0, 0x1 + cmp r1, r0 + beq _080C7348 + b _080C73F6 +_080C7342: + cmp r1, 0x4 + beq _080C73D0 + b _080C73F6 +_080C7348: + ldrh r3, [r5, 0xA] + strh r3, [r5, 0xE] + ldr r2, _080C73C8 + ldrh r1, [r2, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C7366 + subs r0, r3, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bge _080C7366 + movs r0, 0x4 + strh r0, [r5, 0xE] +_080C7366: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C7382 + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080C7382 + movs r0, 0 + strh r0, [r5, 0xE] +_080C7382: + lsls r0, r3, 16 + asrs r0, 16 + ldrh r2, [r5, 0xE] + movs r3, 0xE + ldrsh r1, [r5, r3] + cmp r0, r1 + bne _080C7392 + b _080C756A +_080C7392: + movs r4, 0 + strh r2, [r5, 0xA] + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, _080C73CC + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + 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 text_box_related_one + b _080C756A + .align 2, 0 +_080C73C8: .4byte 0x030022c0 +_080C73CC: .4byte 0x085716c0 +_080C73D0: + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + adds r0, r4, 0 + bl remove_task + b _080C756A +_080C73F6: + movs r3, 0xC + ldrsh r4, [r5, r3] + cmp r4, 0 + bne _080C7428 + bl sub_80C70C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _080C7428 + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _080C7424 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r4, 0x3 + str r4, [sp, 0xC] + b _080C7532 + .align 2, 0 +_080C7424: .4byte 0x085ebcad +_080C7428: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080C745C + bl sub_80C70C4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _080C745C + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _080C7458 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r4, 0x3 + str r4, [sp, 0xC] + b _080C7532 + .align 2, 0 +_080C7458: .4byte 0x085ebc89 +_080C745C: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080C756A +_080C746A: + ldr r0, _080C7494 + ldrh r1, [r0, 0x2E] + movs r7, 0x3 + adds r4, r7, 0 + ands r4, r1 + cmp r4, 0 + beq _080C749C + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, _080C7498 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + b _080C7528 + .align 2, 0 +_080C7494: .4byte 0x030022c0 +_080C7498: .4byte 0x085716c0 +_080C749C: + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _080C74E8 + ldrh r0, [r5, 0xA] + subs r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _080C74B8 + movs r0, 0x4 + strh r0, [r5, 0xA] +_080C74B8: + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursor + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, _080C74E4 + movs r3, 0xA + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + str r4, [sp] + b _080C7528 + .align 2, 0 +_080C74E4: .4byte 0x085716c0 +_080C74E8: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C756A + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _080C7500 + strh r6, [r5, 0xA] +_080C7500: + movs r0, 0x1 + bl MoveMenuCursor + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, _080C7540 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + str r6, [sp] +_080C7528: + movs r4, 0x2 + str r4, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r7, [sp, 0xC] +_080C7532: + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl text_box_related_one + strh r4, [r5, 0x8] + b _080C756A + .align 2, 0 +_080C7540: .4byte 0x085716c0 +_080C7544: + ldr r0, _080C7574 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080C756A + bl overworld_free_bg_tilemaps + ldrb r0, [r5, 0xC] + bl sub_80C7D74 + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + adds r0, r4, 0 + bl remove_task +_080C756A: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C7574: .4byte 0x02037fd4 + thumb_func_end c3_0808C39C + + thumb_func_start sub_80C7578 +sub_80C7578: @ 80C7578 + push {lr} + ldr r0, _080C75A0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080C75A4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_080C75A0: .4byte c3_0808C39C + 1 +_080C75A4: .4byte 0x03005e00 + thumb_func_end sub_80C7578 + + thumb_func_start mapldr_0808C6D8 +mapldr_0808C6D8: @ 80C75A8 + push {r4,r5,lr} + ldr r0, _080C75EC + ldr r5, [r0, 0xC] + movs r0, 0 + bl SetVBlankCallback + ldr r4, _080C75F0 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080C75F4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + ldr r2, _080C75F8 + ldrb r2, [r2] + strh r2, [r1, 0xA] + bl _call_via_r4 + adds r0, r5, 0 + bl SetVBlankCallback + bl pal_fill_black + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C75EC: .4byte 0x030022c0 +_080C75F0: .4byte c3_0808C39C + 1 +_080C75F4: .4byte 0x03005e00 +_080C75F8: .4byte 0x02039d00 + thumb_func_end mapldr_0808C6D8 + + thumb_func_start sub_80C75FC +sub_80C75FC: @ 80C75FC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r6, r0, 0 + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _080C766C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, _080C7670 + mov r8, r0 + movs r1, 0x5 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _080C7674 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl Window_AddFromTemplate + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_81973FC + adds r0, r4, 0 + movs r1, 0x5 + mov r2, r8 + bl PrintMenuTable + adds r0, r4, 0 + movs r1, 0x5 + adds r2, r6, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + mov r0, r9 + strh r5, [r0] + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C766C: .4byte 0x085716e8 +_080C7670: .4byte 0x085716c0 +_080C7674: .4byte 0x00ffffff + thumb_func_end sub_80C75FC + + thumb_func_start sub_80C7678 +sub_80C7678: @ 80C7678 + push {lr} + bl sub_80CAEA0 + ldr r1, _080C7694 + strb r0, [r1] + ldr r1, _080C7698 + ldr r0, _080C769C + str r0, [r1] + ldr r0, _080C76A0 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080C7694: .4byte 0x02039d00 +_080C7698: .4byte 0x03005dac +_080C769C: .4byte mapldr_0808C6D8 + 1 +_080C76A0: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_80C7678 + + thumb_func_start sub_80C76A4 +sub_80C76A4: @ 80C76A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r0, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + adds r4, r3, 0 + ldr r2, _080C7708 + cmp r3, 0x1 + bhi _080C76C6 + movs r2, 0x1 + cmp r3, 0x1 + beq _080C76CA +_080C76C6: + cmp r4, 0x3 + bne _080C7714 +_080C76CA: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080C7760 + cmp r1, r7 + bgt _080C7760 +_080C76E2: + asrs r4, r0, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + add r0, r8 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080C770C + asrs r0, r6, 16 + adds r0, r4, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080C7760 + cmp r2, r7 + ble _080C76E2 + b _080C7760 + .align 2, 0 +_080C7708: .4byte 0x0000ffff +_080C770C: + adds r0, r4, 0 + b _080C7764 +_080C7710: + adds r0, r5, 0 + b _080C7764 +_080C7714: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080C7760 + cmp r1, r7 + bgt _080C7760 +_080C772C: + asrs r5, r0, 16 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 4 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080C7750 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080C7710 +_080C7750: + asrs r0, r6, 16 + adds r0, r5, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080C7760 + cmp r2, r7 + ble _080C772C +_080C7760: + movs r0, 0x1 + negs r0, r0 +_080C7764: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80C76A4 + + thumb_func_start sub_80C7770 +sub_80C7770: @ 80C7770 + push {r4-r6,lr} + movs r0, 0 + bl sub_80D1D18 + movs r5, 0 +_080C777A: + movs r4, 0 + lsls r6, r5, 24 +_080C777E: + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl sub_80D2018 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bls _080C777E + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xD + bls _080C777A + movs r5, 0 +_080C779E: + lsls r0, r5, 24 + lsrs r0, 24 + bl sav3_get_box_name + ldr r1, _080C77E4 + bl gf_strcpy + adds r4, r5, 0x1 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + lsls r4, 16 + lsrs r5, r4, 16 + cmp r5, 0xD + bls _080C779E + movs r5, 0 +_080C77C2: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x3 + ands r1, r5 + bl sub_80D2120 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xD + bls _080C77C2 + bl sub_80D242C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C77E4: .4byte 0x085ebcc1 + thumb_func_end sub_80C7770 + + thumb_func_start sub_80C77E8 +sub_80C77E8: @ 80C77E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + adds r7, r2, 0 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + ldr r0, _080C787C + str r0, [sp, 0x18] + ldr r1, _080C7880 + add r4, sp, 0x18 + ldr r0, [r4, 0x4] + ands r0, r1 + orrs r0, r7 + str r0, [r4, 0x4] + mov r1, sp + ldr r0, _080C7884 + str r0, [sp] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1, 0x4] + strh r6, [r1, 0x6] + ldr r0, _080C7888 + str r0, [sp, 0x8] + movs r0, 0xC0 + lsls r0, 1 + strh r0, [r1, 0xC] + adds r0, r6, 0x1 + strh r0, [r1, 0xE] + add r0, sp, 0x10 + movs r1, 0 + movs r2, 0x8 + bl memset + ldr r0, [sp, 0x38] + cmp r0, 0 + beq _080C7846 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply +_080C7846: + mov r0, sp + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _080C788C + str r5, [r0] + movs r1, 0x90 + lsls r1, 2 + adds r0, r5, r1 + strh r6, [r0] + adds r1, 0x2 + adds r0, r5, r1 + strh r7, [r0] + adds r1, 0x4 + adds r0, r5, r1 + mov r1, r8 + strb r1, [r0] + movs r1, 0x8F + lsls r1, 2 + adds r0, r5, r1 + ldr r1, [sp, 0x38] + str r1, [r0] + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C787C: .4byte 0x0857173c +_080C7880: .4byte 0xffff0000 +_080C7884: .4byte 0x0857175c +_080C7888: .4byte 0x08571f5c +_080C788C: .4byte 0x02039d04 + thumb_func_end sub_80C77E8 + + thumb_func_start sub_80C7890 +sub_80C7890: @ 80C7890 + push {r4,r5,lr} + ldr r5, _080C78D0 + ldr r1, [r5] + movs r2, 0x8F + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C78AC + adds r2, 0x6 + adds r0, r1, r2 + ldrh r0, [r0] + bl gpu_pal_free_tag +_080C78AC: + ldr r0, [r5] + movs r4, 0x90 + lsls r4, 2 + adds r0, r4 + ldrh r0, [r0] + bl gpu_tile_obj_free_by_tag + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl gpu_tile_obj_free_by_tag + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C78D0: .4byte 0x02039d04 + thumb_func_end sub_80C7890 + + thumb_func_start sub_80C78D4 +sub_80C78D4: @ 80C78D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80C7958 + pop {r0} + bx r0 + thumb_func_end sub_80C78D4 + + thumb_func_start sub_80C78E4 +sub_80C78E4: @ 80C78E4 + push {lr} + bl sub_80C7B14 + pop {r0} + bx r0 + thumb_func_end sub_80C78E4 + + thumb_func_start sub_80C78F0 +sub_80C78F0: @ 80C78F0 + push {lr} + ldr r0, _080C7908 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C790C + movs r0, 0x5 + bl audio_play + movs r0, 0xC9 + b _080C7954 + .align 2, 0 +_080C7908: .4byte 0x030022c0 +_080C790C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C792C + movs r0, 0x5 + bl audio_play + ldr r0, _080C7928 + ldr r0, [r0] + movs r1, 0x91 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + b _080C7954 + .align 2, 0 +_080C7928: .4byte 0x02039d04 +_080C792C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C7940 + movs r0, 0x5 + bl audio_play + bl sub_80C7BB4 + b _080C7952 +_080C7940: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C7952 + movs r0, 0x5 + bl audio_play + bl sub_80C7B80 +_080C7952: + movs r0, 0xC8 +_080C7954: + pop {r1} + bx r1 + thumb_func_end sub_80C78F0 + + thumb_func_start sub_80C7958 +sub_80C7958: @ 80C7958 + push {r4-r6,lr} + sub sp, 0x3C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x34] + str r1, [sp, 0x38] + movs r1, 0xC0 + lsls r1, 24 + ldr r0, [sp, 0x34] + orrs r0, r1 + str r0, [sp, 0x34] + ldr r1, _080C7AEC + add r4, sp, 0x34 + ldr r0, [r4, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r4, 0x4] + add r1, sp, 0x1C + movs r2, 0 + strh r2, [r1] + mov r0, sp + adds r0, 0x1E + strh r2, [r0] + str r4, [sp, 0x20] + ldr r0, _080C7AF0 + str r0, [sp, 0x24] + str r2, [sp, 0x28] + ldr r0, _080C7AF4 + str r0, [sp, 0x2C] + ldr r0, _080C7AF8 + str r0, [sp, 0x30] + add r0, sp, 0x4 + movs r2, 0x18 + bl memcpy + ldr r6, _080C7AFC + ldr r0, [r6] + movs r1, 0x91 + lsls r1, 2 + adds r0, r1 + strb r5, [r0] + add r2, sp, 0x4 + ldr r1, [r6] + movs r5, 0x90 + lsls r5, 2 + adds r0, r1, r5 + ldrh r0, [r0] + strh r0, [r2] + ldr r3, _080C7B00 + adds r1, r3 + ldrh r0, [r1] + strh r0, [r2, 0x2] + adds r0, r2, 0 + movs r1, 0xA0 + movs r2, 0x60 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080C7B04 + adds r0, r1 + str r0, [r3] + ldrb r2, [r4, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + ands r1, r0 + movs r0, 0x40 + orrs r1, r0 + strb r1, [r4, 0x3] + add r1, sp, 0x4 + adds r3, r5 + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r1] + ldr r0, _080C7B08 + str r0, [sp, 0xC] + movs r4, 0 +_080C7A10: + ldr r0, [r6] + ldr r1, _080C7B0C + adds r0, r1 + ldrb r3, [r0] + add r0, sp, 0x4 + movs r1, 0x7C + movs r2, 0x50 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, [r6] + lsls r3, r4, 2 + adds r2, 0x4 + adds r2, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080C7B04 + adds r1, r0, r1 + str r1, [r2] + movs r5, 0 + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _080C7A4A + movs r0, 0xC4 + strh r0, [r1, 0x20] + movs r5, 0x2 +_080C7A4A: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080C7A6E + ldr r1, [r6] + adds r1, 0x4 + adds r1, r3 + ldr r2, [r1] + movs r0, 0x70 + strh r0, [r2, 0x22] + ldr r2, [r1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C7A6E: + ldr r0, [r6] + adds r0, 0x4 + adds r0, r3 + ldr r0, [r0] + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080C7A10 + movs r4, 0 + ldr r5, _080C7AFC +_080C7A8C: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 19 + movs r3, 0xF8 + lsls r3, 15 + adds r0, r3 + lsrs r0, 16 + lsls r2, r4, 24 + lsrs r2, 24 + ldr r1, [r5] + ldr r3, _080C7B0C + adds r1, r3 + ldrb r1, [r1] + str r1, [sp] + movs r1, 0x58 + movs r3, 0 + bl sub_80CD2E8 + adds r2, r0, 0 + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, 0x20 + adds r0, r1 + str r2, [r0] + cmp r2, 0 + beq _080C7AD4 + movs r1, 0x1 + cmp r4, 0 + bne _080C7ACC + movs r3, 0x1 + negs r3, r3 + adds r1, r3, 0 +_080C7ACC: + strh r1, [r2, 0x2E] + ldr r1, [r0] + ldr r0, _080C7B10 + str r0, [r1, 0x1C] +_080C7AD4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080C7A8C + bl sub_80C7BE4 + add sp, 0x3C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C7AEC: .4byte 0xffff0fff +_080C7AF0: .4byte 0x082ec69c +_080C7AF4: .4byte 0x082ec6a8 +_080C7AF8: .4byte nullsub_12 + 1 +_080C7AFC: .4byte 0x02039d04 +_080C7B00: .4byte 0x00000242 +_080C7B04: .4byte 0x02020630 +_080C7B08: .4byte 0x08571710 +_080C7B0C: .4byte 0x00000246 +_080C7B10: .4byte sub_80C7CF4 + 1 + thumb_func_end sub_80C7958 + + thumb_func_start sub_80C7B14 +sub_80C7B14: @ 80C7B14 + push {r4-r6,lr} + ldr r4, _080C7B7C + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _080C7B2A + bl obj_delete_and_free_tiles + ldr r1, [r4] + movs r0, 0 + str r0, [r1] +_080C7B2A: + movs r5, 0 + adds r6, r4, 0 +_080C7B2E: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0x4 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080C7B4A + bl obj_delete_and_free_tiles + ldr r0, [r6] + adds r0, 0x4 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080C7B4A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _080C7B2E + movs r5, 0 +_080C7B56: + ldr r0, _080C7B7C + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, 0x20 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C7B6A + bl obj_delete_and_free_tiles +_080C7B6A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _080C7B56 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C7B7C: .4byte 0x02039d04 + thumb_func_end sub_80C7B14 + + thumb_func_start sub_80C7B80 +sub_80C7B80: @ 80C7B80 + push {lr} + ldr r2, _080C7BB0 + ldr r1, [r2] + movs r0, 0x91 + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bls _080C7BA6 + ldr r0, [r2] + movs r1, 0x91 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080C7BA6: + bl sub_80C7BE4 + pop {r0} + bx r0 + .align 2, 0 +_080C7BB0: .4byte 0x02039d04 + thumb_func_end sub_80C7B80 + + thumb_func_start sub_80C7BB4 +sub_80C7BB4: @ 80C7BB4 + push {lr} + ldr r0, _080C7BCC + ldr r2, [r0] + movs r1, 0x91 + lsls r1, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C7BD0 + subs r1, r0, 0x1 + b _080C7BD2 + .align 2, 0 +_080C7BCC: .4byte 0x02039d04 +_080C7BD0: + movs r1, 0xD +_080C7BD2: + movs r3, 0x91 + lsls r3, 2 + adds r0, r2, r3 + strb r1, [r0] + bl sub_80C7BE4 + pop {r0} + bx r0 + thumb_func_end sub_80C7BB4 + + thumb_func_start sub_80C7BE4 +sub_80C7BE4: @ 80C7BE4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x24 + ldr r0, _080C7CE0 + mov r9, r0 + ldr r0, [r0] + movs r4, 0x91 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sav3_get_box_name + mov r10, r0 + mov r1, r9 + ldr r0, [r1] + adds r0, r4 + ldrb r0, [r0] + bl sub_80C6FA0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + add r4, sp, 0x1C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0x8 + strb r0, [r4, 0x3] + movs r0, 0x4 + strb r0, [r4, 0x4] + adds r0, r4, 0 + bl Window_AddFromTemplate + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x44 + bl Window_FastFillPixels + movs r0, 0x1 + mov r1, r10 + movs r2, 0x40 + bl sub_81DB35C + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _080C7CE4 + mov r8, r0 + str r0, [sp] + movs r6, 0x1 + negs r6, r6 + str r6, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add r0, sp, 0xC + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _080C7CE8 + add r0, sp, 0xC + bl gf_strcat + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x40 + bl sub_81DB35C + lsls r2, r0, 24 + lsrs r2, 24 + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + adds r0, r4, 0 + movs r1, 0x7 + bl Window_GetField + adds r5, r0, 0 + mov r1, r9 + ldr r0, [r1] + movs r1, 0x90 + lsls r1, 2 + adds r0, r1 + ldrh r0, [r0] + bl gpu_tile_obj_tag_get_range_start + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 11 + ldr r0, _080C7CEC + adds r1, r0 + ldr r2, _080C7CF0 + adds r0, r5, 0 + bl CpuSet + adds r0, r4, 0 + bl Window_Remove + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080C7CE0: .4byte 0x02039d04 +_080C7CE4: .4byte 0x08571734 +_080C7CE8: .4byte 0x08571737 +_080C7CEC: .4byte 0x06010100 +_080C7CF0: .4byte 0x04000100 + thumb_func_end sub_80C7BE4 + + thumb_func_start sub_80C7CF4 +sub_80C7CF4: @ 80C7CF4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _080C7D24 + strh r2, [r1, 0x30] + ldrh r0, [r1, 0x2E] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080C7D24 + strh r2, [r1, 0x32] + strh r2, [r1, 0x24] +_080C7D24: + pop {r0} + bx r0 + thumb_func_end sub_80C7CF4 + + thumb_func_start sub_80C7D28 +sub_80C7D28: @ 80C7D28 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl sub_80D2AA4 + bl copy_pal_bg_faded_to_pal_ram + ldr r0, _080C7D50 + ldr r0, [r0] + movs r1, 0xB3 + lsls r1, 2 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080C7D50: .4byte 0x02039d08 + thumb_func_end sub_80C7D28 + + thumb_func_start c2_Box +c2_Box: @ 80C7D54 + push {lr} + bl run_active_tasks + bl do_scheduled_bg_tilemap_copies_to_vram + bl sub_80CA028 + bl sub_80CAA14 + bl call_obj_callbacks + bl obj_sync_something + pop {r0} + bx r0 + thumb_func_end c2_Box + + thumb_func_start sub_80C7D74 +sub_80C7D74: @ 80C7D74 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl clear_tasks + ldr r0, _080C7D98 + strb r5, [r0] + ldr r4, _080C7D9C + ldr r0, _080C7DA0 + bl malloc + str r0, [r4] + cmp r0, 0 + bne _080C7DA8 + ldr r0, _080C7DA4 + bl set_callback2 + b _080C7DD4 + .align 2, 0 +_080C7D98: .4byte 0x02039d0d +_080C7D9C: .4byte 0x02039d08 +_080C7DA0: .4byte 0x000062c4 +_080C7DA4: .4byte sub_80C7678 + 1 +_080C7DA8: + movs r2, 0 + strb r5, [r0, 0x1] + ldr r0, [r4] + strb r2, [r0, 0x3] + ldr r0, _080C7DDC + movs r1, 0 + strh r2, [r0] + ldr r0, [r4] + strb r1, [r0] + ldr r0, _080C7DE0 + movs r1, 0x3 + bl AddTask + ldr r1, [r4] + strb r0, [r1, 0x4] + bl get_preferred_box + ldr r1, _080C7DE4 + strb r0, [r1] + ldr r0, _080C7DE8 + bl set_callback2 +_080C7DD4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C7DDC: .4byte 0x02039d12 +_080C7DE0: .4byte task_box_related_3 + 1 +_080C7DE4: .4byte 0x02039d10 +_080C7DE8: .4byte c2_Box + 1 + thumb_func_end sub_80C7D74 + + thumb_func_start c2_808CE60 +c2_808CE60: @ 80C7DEC + push {r4,lr} + bl clear_tasks + ldr r4, _080C7E0C + ldr r0, _080C7E10 + bl malloc + adds r1, r0, 0 + str r1, [r4] + cmp r1, 0 + bne _080C7E18 + ldr r0, _080C7E14 + bl set_callback2 + b _080C7E3C + .align 2, 0 +_080C7E0C: .4byte 0x02039d08 +_080C7E10: .4byte 0x000062c4 +_080C7E14: .4byte sub_80C7678 + 1 +_080C7E18: + ldr r0, _080C7E44 + ldrb r0, [r0] + movs r2, 0 + strb r0, [r1, 0x1] + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x3] + ldr r0, [r4] + strb r2, [r0] + ldr r0, _080C7E48 + movs r1, 0x3 + bl AddTask + ldr r1, [r4] + strb r0, [r1, 0x4] + ldr r0, _080C7E4C + bl set_callback2 +_080C7E3C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C7E44: .4byte 0x02039d0d +_080C7E48: .4byte task_box_related_3 + 1 +_080C7E4C: .4byte c2_Box + 1 + thumb_func_end c2_808CE60 + + thumb_func_start sub_80C7E50 +sub_80C7E50: @ 80C7E50 + push {lr} + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end sub_80C7E50 + + thumb_func_start sub_80C7E98 +sub_80C7E98: @ 80C7E98 + push {r4,lr} + sub sp, 0x4 + bl sub_80A1A74 + bl reset_all_obj_data + bl gpu_tile_obj_tags_reset + bl gpu_pal_allocator_reset + bl dma3_transfer_queue_clear + ldr r1, _080C7F08 + movs r2, 0xA0 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1] + ldr r4, _080C7F0C + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + adds r1, 0x10 + movs r2, 0x8 + bl sub_80D2A90 + ldr r1, _080C7F10 + movs r0, 0x14 + strh r0, [r1] + bl clear_scheduled_bg_copies_to_vram + movs r0, 0x3 + bl sub_80D259C + ldr r2, _080C7F14 + movs r0, 0x4 + str r0, [sp] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x8 + bl sub_80D2644 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80D2770 + ldr r0, [r4] + ldr r1, _080C7F18 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C7F08: .4byte 0x02021b3a +_080C7F0C: .4byte 0x02039d08 +_080C7F10: .4byte 0x030022b0 +_080C7F14: .4byte 0x0857239c +_080C7F18: .4byte 0x000002c7 + thumb_func_end sub_80C7E98 + + thumb_func_start sub_80C7F1C +sub_80C7F1C: @ 80C7F1C + push {lr} + bl sub_80CDC0C + ldr r2, _080C7F40 + movs r1, 0 + ldr r0, _080C7F44 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080C7F32 + movs r1, 0x1 +_080C7F32: + strb r1, [r2] + ldr r1, _080C7F48 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080C7F40: .4byte 0x02039d0c +_080C7F44: .4byte 0x02039d08 +_080C7F48: .4byte 0x02039d0e + thumb_func_end sub_80C7F1C + + thumb_func_start sub_80C7F4C +sub_80C7F4C: @ 80C7F4C + push {lr} + ldr r0, _080C7F78 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080C7F6A + movs r1, 0xFC + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _080C7F7C + movs r0, 0x52 + bl lcd_io_set +_080C7F6A: + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080C7F78: .4byte 0x02039d08 +_080C7F7C: .4byte 0x00000b07 + thumb_func_end sub_80C7F4C + + thumb_func_start add_to_c3_somehow +add_to_c3_somehow: @ 80C7F80 + push {r4,lr} + ldr r4, _080C7FA0 + ldr r1, _080C7FA4 + ldr r3, [r1] + ldrb r2, [r3, 0x4] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r4 + str r0, [r1] + movs r0, 0 + strb r0, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C7FA0: .4byte 0x03005e00 +_080C7FA4: .4byte 0x02039d08 + thumb_func_end add_to_c3_somehow + + thumb_func_start task_box_related_3 +task_box_related_3: @ 80C7FA8 + push {lr} + sub sp, 0x4 + ldr r0, _080C7FC4 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xA + bls _080C7FB8 + b _080C81A2 +_080C7FB8: + lsls r0, 2 + ldr r1, _080C7FC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C7FC4: .4byte 0x02039d08 +_080C7FC8: .4byte _080C7FCC + .align 2, 0 +_080C7FCC: + .4byte _080C7FF8 + .4byte _080C8050 + .4byte _080C805E + .4byte _080C808C + .4byte _080C80A8 + .4byte _080C80C6 + .4byte _080C80E6 + .4byte _080C80EC + .4byte _080C80F2 + .4byte _080C8100 + .4byte _080C814A +_080C7FF8: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + bl sub_80C7E98 + ldr r0, _080C8028 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _080C8046 + ldr r0, _080C802C + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C8036 + cmp r0, 0x1 + bgt _080C8030 + cmp r0, 0 + beq _080C803C + b _080C8046 + .align 2, 0 +_080C8028: .4byte 0x02039d08 +_080C802C: .4byte 0x02039d0f +_080C8030: + cmp r0, 0x2 + beq _080C8042 + b _080C8046 +_080C8036: + bl sub_80CE790 + b _080C8046 +_080C803C: + bl sub_80CE8E4 + b _080C8046 +_080C8042: + bl sub_80C9F6C +_080C8046: + bl sub_80CA044 + bl sub_80CA0C8 + b _080C8198 +_080C8050: + bl sub_80CA0A4 + lsls r0, 24 + cmp r0, 0 + beq _080C805C + b _080C8198 +_080C805C: + b _080C80D0 +_080C805E: + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_FillTileMap + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _080C8088 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0xB + movs r2, 0xE0 + bl sub_809882C + b _080C8198 + .align 2, 0 +_080C8088: .4byte 0x05000080 +_080C808C: + bl sub_80C7E50 + ldr r0, _080C80A4 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _080C809C + b _080C8198 +_080C809C: + bl sub_80C7F1C + b _080C8198 + .align 2, 0 +_080C80A4: .4byte 0x02039d08 +_080C80A8: + bl sub_80CAF04 + ldr r0, _080C80BC + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + bne _080C80C0 + bl sub_80CD36C + b _080C8198 + .align 2, 0 +_080C80BC: .4byte 0x02039d08 +_080C80C0: + bl sub_80CD3EC + b _080C8198 +_080C80C6: + bl sub_80D0164 + lsls r0, 24 + cmp r0, 0 + bne _080C80DC +_080C80D0: + ldr r0, _080C80D8 + bl add_to_c3_somehow + b _080C81A2 + .align 2, 0 +_080C80D8: .4byte sub_80C9E50 + 1 +_080C80DC: + bl sub_80C9FEC + bl sub_80CAC1C + b _080C8198 +_080C80E6: + bl sub_80CA0D8 + b _080C8198 +_080C80EC: + bl sub_80CA704 + b _080C8198 +_080C80F2: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sub_80CC32C + b _080C8198 +_080C8100: + bl sub_80CC35C + lsls r0, 24 + cmp r0, 0 + bne _080C81A2 + ldr r0, _080C8130 + ldr r2, [r0] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + beq _080C8140 + ldr r1, _080C8134 + adds r0, r2, r1 + movs r1, 0xD + strh r1, [r0] + ldr r1, _080C8138 + adds r2, r1 + ldr r1, _080C813C + strh r1, [r2] + bl sub_811F90C + bl sub_811FA90 + b _080C8198 + .align 2, 0 +_080C8130: .4byte 0x02039d08 +_080C8134: .4byte 0x00000da4 +_080C8138: .4byte 0x00000da6 +_080C813C: .4byte 0x0000dace +_080C8140: + bl sub_80D0C60 + bl sub_80CAEAC + b _080C8198 +_080C814A: + bl sub_80C7F4C + ldr r0, _080C816C + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + bne _080C8174 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _080C8170 + bl add_to_c3_somehow + b _080C8186 + .align 2, 0 +_080C816C: .4byte 0x02039d08 +_080C8170: .4byte sub_80C81AC + 1 +_080C8174: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _080C8190 + bl add_to_c3_somehow +_080C8186: + ldr r0, _080C8194 + bl SetVBlankCallback + b _080C81A2 + .align 2, 0 +_080C8190: .4byte box_related_2 + 1 +_080C8194: .4byte sub_80C7D28 + 1 +_080C8198: + ldr r0, _080C81A8 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C81A2: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080C81A8: .4byte 0x02039d08 + thumb_func_end task_box_related_3 + + thumb_func_start sub_80C81AC +sub_80C81AC: @ 80C81AC + push {r4,lr} + ldr r4, _080C81C0 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C81C4 + cmp r0, 0x1 + beq _080C81DE + b _080C81EE + .align 2, 0 +_080C81C0: .4byte 0x02039d08 +_080C81C4: + movs r0, 0x2 + bl audio_play + movs r0, 0x14 + movs r1, 0 + movs r2, 0x1 + bl sub_80F9BCC + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C81EE +_080C81DE: + bl sub_80F9C1C + lsls r0, 24 + cmp r0, 0 + bne _080C81EE + ldr r0, _080C81F4 + bl add_to_c3_somehow +_080C81EE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C81F4: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C81AC + + thumb_func_start box_related_2 +box_related_2: @ 80C81F8 + push {r4,lr} + sub sp, 0x4 + ldr r4, _080C8210 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C8230 + cmp r0, 0x1 + bgt _080C8214 + cmp r0, 0 + beq _080C821E + b _080C82A0 + .align 2, 0 +_080C8210: .4byte 0x02039d08 +_080C8214: + cmp r0, 0x2 + beq _080C8268 + cmp r0, 0x3 + beq _080C8290 + b _080C82A0 +_080C821E: + movs r1, 0x1 + negs r1, r1 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _080C8282 +_080C8230: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C82A0 + ldr r0, _080C8254 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080C825C + ldr r0, _080C8258 + ldrh r0, [r0] + cmp r0, 0 + beq _080C825C + movs r0, 0x1C + bl sub_80CAC58 + b _080C8282 + .align 2, 0 +_080C8254: .4byte 0x02039d0f +_080C8258: .4byte 0x0203ce7c +_080C825C: + ldr r0, _080C8264 + bl add_to_c3_somehow + b _080C82A0 + .align 2, 0 +_080C8264: .4byte task_pokemon_box_related + 1 +_080C8268: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C82A0 + ldr r0, _080C828C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080C82A0 + bl sub_80CADC4 +_080C8282: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C82A0 + .align 2, 0 +_080C828C: .4byte 0x030022c0 +_080C8290: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C82A0 + ldr r0, _080C82A8 + bl add_to_c3_somehow +_080C82A0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C82A8: .4byte task_pokemon_box_related + 1 + thumb_func_end box_related_2 + + thumb_func_start task_pokemon_box_related +task_pokemon_box_related: @ 80C82AC + push {r4,r5,lr} + ldr r0, _080C82C4 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xB + bls _080C82BA + b _080C879E +_080C82BA: + lsls r0, 2 + ldr r1, _080C82C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C82C4: .4byte 0x02039d08 +_080C82C8: .4byte _080C82CC + .align 2, 0 +_080C82CC: + .4byte _080C82FC + .4byte _080C861C + .4byte _080C865C + .4byte _080C86B4 + .4byte _080C86D8 + .4byte _080C86E2 + .4byte _080C86FC + .4byte _080C871C + .4byte _080C8722 + .4byte _080C8738 + .4byte _080C8764 + .4byte _080C878C +_080C82FC: + bl sub_80CF9EC + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x19 + bls _080C830C + b _080C879E +_080C830C: + lsls r0, 2 + ldr r1, _080C8318 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C8318: .4byte _080C831C + .align 2, 0 +_080C831C: + .4byte _080C8384 + .4byte _080C879E + .4byte _080C879E + .4byte _080C8414 + .4byte _080C8398 + .4byte _080C83CC + .4byte _080C842C + .4byte _080C8440 + .4byte _080C844C + .4byte _080C8484 + .4byte _080C84C8 + .4byte _080C854C + .4byte _080C850C + .4byte _080C851E + .4byte _080C8560 + .4byte _080C8574 + .4byte _080C8588 + .4byte _080C859C + .4byte _080C8420 + .4byte _080C85B0 + .4byte _080C85D0 + .4byte _080C85BA + .4byte _080C85DA + .4byte _080C8614 + .4byte _080C85DE + .4byte _080C85F8 +_080C8384: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8394 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C8394: .4byte 0x02039d08 +_080C8398: + ldr r4, _080C83B8 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080C83BC + movs r0, 0x10 + bl sub_80CAC58 + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C83B8: .4byte 0x02039d08 +_080C83BC: + bl sub_80CDC0C + ldr r0, _080C83C8 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C83C8: .4byte sub_80C87A8 + 1 +_080C83CC: + ldr r4, _080C83F8 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _080C8400 + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + beq _080C8406 + ldr r0, [r4] + ldr r1, _080C83FC + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080C83F4 + b _080C84E6 +_080C83F4: + b _080C8406 + .align 2, 0 +_080C83F8: .4byte 0x02039d08 +_080C83FC: .4byte 0x00000ce6 +_080C8400: + cmp r0, 0x3 + beq _080C8406 + b _080C879E +_080C8406: + ldr r0, _080C8410 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8410: .4byte sub_80C87E8 + 1 +_080C8414: + ldr r0, _080C841C + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C841C: .4byte sub_80C9BE8 + 1 +_080C8420: + ldr r0, _080C8428 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8428: .4byte sub_80C9D1C + 1 +_080C842C: + movs r0, 0x5 + bl audio_play + ldr r0, _080C843C + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C843C: .4byte box_related + 1 +_080C8440: + ldr r0, _080C8448 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8448: .4byte sub_80C8864 + 1 +_080C844C: + movs r0, 0x5 + bl audio_play + bl get_preferred_box + ldr r4, _080C847C + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + ldr r2, _080C8480 + adds r1, r2 + strh r0, [r1] + cmp r0, 0xD + ble _080C846E + movs r0, 0 + strh r0, [r1] +_080C846E: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + beq _080C84BC + adds r0, r1, r2 + b _080C8776 + .align 2, 0 +_080C847C: .4byte 0x02039d08 +_080C8480: .4byte 0x000002ca +_080C8484: + movs r0, 0x5 + bl audio_play + bl get_preferred_box + ldr r4, _080C84B4 + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + ldr r2, _080C84B8 + adds r1, r2 + strh r0, [r1] + cmp r0, 0 + bge _080C84A6 + movs r0, 0xD + strh r0, [r1] +_080C84A6: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + beq _080C84BC + adds r0, r1, r2 + b _080C8776 + .align 2, 0 +_080C84B4: .4byte 0x02039d08 +_080C84B8: .4byte 0x000002ca +_080C84BC: + bl sub_80CFEA8 + ldr r1, [r4] + movs r0, 0xA + strb r0, [r1] + b _080C879E +_080C84C8: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8528 + ldr r4, _080C84F0 + ldr r0, [r4] + ldr r1, _080C84F4 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080C84F8 +_080C84E6: + ldr r1, [r4] + movs r0, 0x5 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C84F0: .4byte 0x02039d08 +_080C84F4: .4byte 0x00000ce6 +_080C84F8: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8508 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8508: .4byte sub_80C8D78 + 1 +_080C850C: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8528 + movs r0, 0x5 + bl audio_play + b _080C872C +_080C851E: + bl sub_80CEA6C + lsls r0, 24 + cmp r0, 0 + bne _080C8538 +_080C8528: + ldr r0, _080C8534 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C8534: .4byte 0x02039d08 +_080C8538: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8548 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8548: .4byte c3_0808DC50 + 1 +_080C854C: + movs r0, 0x5 + bl audio_play + ldr r0, _080C855C + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C855C: .4byte sub_80C8C90 + 1 +_080C8560: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8570 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8570: .4byte sub_80C8BEC + 1 +_080C8574: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8584 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8584: .4byte sub_80C9128 + 1 +_080C8588: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8598 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8598: .4byte sub_80C91DC + 1 +_080C859C: + movs r0, 0x5 + bl audio_play + ldr r0, _080C85AC + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C85AC: .4byte sub_80C93B0 + 1 +_080C85B0: + movs r0, 0x5 + bl audio_play + movs r0, 0 + b _080C8600 +_080C85BA: + movs r0, 0x1 + bl sub_80D01D0 + ldr r0, _080C85CC + ldr r1, [r0] + movs r0, 0x8 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C85CC: .4byte 0x02039d08 +_080C85D0: + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + b _080C85E6 +_080C85DA: + movs r0, 0x3 + b _080C8600 +_080C85DE: + movs r0, 0x5 + bl audio_play + movs r0, 0x4 +_080C85E6: + bl sub_80D01D0 + ldr r0, _080C85F4 + ldr r1, [r0] + movs r0, 0x9 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C85F4: .4byte 0x02039d08 +_080C85F8: + movs r0, 0x5 + bl audio_play + movs r0, 0x5 +_080C8600: + bl sub_80D01D0 + ldr r0, _080C8610 + ldr r1, [r0] + movs r0, 0x7 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C8610: .4byte 0x02039d08 +_080C8614: + movs r0, 0x20 + bl audio_play + b _080C879E +_080C861C: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + beq _080C8628 + b _080C879E +_080C8628: + bl sub_80CEAF8 + lsls r0, 24 + cmp r0, 0 + beq _080C8638 + bl sub_80CA9C0 + b _080C863C +_080C8638: + bl sub_80CA9EC +_080C863C: + ldr r4, _080C8654 + ldr r0, [r4] + ldr r1, _080C8658 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C864E + bl BoxSetMosaic +_080C864E: + ldr r1, [r4] + b _080C86C8 + .align 2, 0 +_080C8654: .4byte 0x02039d08 +_080C8658: .4byte 0x00000cea +_080C865C: + bl sub_80CC54C + lsls r0, 24 + cmp r0, 0 + beq _080C8668 + b _080C879E +_080C8668: + ldr r0, _080C86A8 + ldr r0, [r0] + ldr r1, _080C86AC + adds r0, r1 + ldrb r0, [r0] + bl sub_80D1D18 + ldr r0, _080C86B0 + ldrb r0, [r0] + cmp r0, 0 + bne _080C8690 + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + bne _080C8690 + bl sub_80CE00C + bl BoxSetMosaic +_080C8690: + ldr r4, _080C86A8 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + bne _080C86C8 + bl sub_80CFECC + ldr r1, [r4] + movs r0, 0xB + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C86A8: .4byte 0x02039d08 +_080C86AC: .4byte 0x000002ca +_080C86B0: .4byte 0x02039d0c +_080C86B4: + ldr r0, _080C86D0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C879E + bl sub_80CADC4 + ldr r0, _080C86D4 + ldr r1, [r0] +_080C86C8: + movs r0, 0 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C86D0: .4byte 0x030022c0 +_080C86D4: .4byte 0x02039d08 +_080C86D8: + movs r0, 0x20 + bl audio_play + movs r0, 0xD + b _080C86EA +_080C86E2: + movs r0, 0x20 + bl audio_play + movs r0, 0x16 +_080C86EA: + bl sub_80CAC58 + ldr r0, _080C86F8 + ldr r1, [r0] + movs r0, 0x6 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C86F8: .4byte 0x02039d08 +_080C86FC: + ldr r0, _080C8714 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C879E + bl sub_80CADC4 + ldr r0, _080C8718 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8714: .4byte 0x030022c0 +_080C8718: .4byte task_pokemon_box_related + 1 +_080C871C: + bl sub_80D01E4 + b _080C8790 +_080C8722: + bl sub_80D01E4 + lsls r0, 24 + cmp r0, 0 + bne _080C879E +_080C872C: + ldr r0, _080C8734 + bl add_to_c3_somehow + b _080C879E + .align 2, 0 +_080C8734: .4byte sub_80C8B90 + 1 +_080C8738: + bl sub_80D01E4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080C879E + ldr r5, _080C875C + ldr r0, [r5] + ldr r1, _080C8760 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8756 + bl BoxSetMosaic +_080C8756: + ldr r0, [r5] + strb r4, [r0] + b _080C879E + .align 2, 0 +_080C875C: .4byte 0x02039d08 +_080C8760: .4byte 0x00000cea +_080C8764: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C879E + ldr r4, _080C8784 + ldr r0, [r4] + ldr r1, _080C8788 + adds r0, r1 +_080C8776: + ldrb r0, [r0] + bl sub_80CC464 + ldr r1, [r4] + movs r0, 0x2 + strb r0, [r1] + b _080C879E + .align 2, 0 +_080C8784: .4byte 0x02039d08 +_080C8788: .4byte 0x000002ca +_080C878C: + bl sub_80D1218 +_080C8790: + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C879E + ldr r0, _080C87A4 + ldr r0, [r0] + strb r1, [r0] +_080C879E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C87A4: .4byte 0x02039d08 + thumb_func_end task_pokemon_box_related + + thumb_func_start sub_80C87A8 +sub_80C87A8: @ 80C87A8 + push {r4,lr} + ldr r4, _080C87BC + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C87C0 + cmp r0, 0x1 + beq _080C87CE + b _080C87DE + .align 2, 0 +_080C87BC: .4byte 0x02039d08 +_080C87C0: + bl sub_80CAB4C + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C87DE +_080C87CE: + bl sub_80CAB70 + lsls r0, 24 + cmp r0, 0 + bne _080C87DE + ldr r0, _080C87E4 + bl add_to_c3_somehow +_080C87DE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C87E4: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C87A8 + + thumb_func_start sub_80C87E8 +sub_80C87E8: @ 80C87E8 + push {r4,lr} + ldr r4, _080C8800 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C8816 + cmp r0, 0x1 + bgt _080C8804 + cmp r0, 0 + beq _080C880A + b _080C8856 + .align 2, 0 +_080C8800: .4byte 0x02039d08 +_080C8804: + cmp r0, 0x2 + beq _080C8836 + b _080C8856 +_080C880A: + movs r0, 0x5 + bl audio_play + bl sub_80CA888 + b _080C882C +_080C8816: + bl sub_80CA8C8 + lsls r0, 24 + cmp r0, 0 + bne _080C8856 + bl sub_80CDC2C + lsls r0, 24 + lsrs r0, 24 + bl sub_80CDBF8 +_080C882C: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8856 +_080C8836: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + bne _080C8856 + ldr r0, [r4] + ldr r1, _080C885C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8850 + bl BoxSetMosaic +_080C8850: + ldr r0, _080C8860 + bl add_to_c3_somehow +_080C8856: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C885C: .4byte 0x00000cea +_080C8860: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C87E8 + + thumb_func_start sub_80C8864 +sub_80C8864: @ 80C8864 + push {r4,lr} + ldr r0, _080C887C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + bls _080C8872 + b _080C8B82 +_080C8872: + lsls r0, 2 + ldr r1, _080C8880 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C887C: .4byte 0x02039d08 +_080C8880: .4byte _080C8884 + .align 2, 0 +_080C8884: + .4byte _080C88A0 + .4byte _080C8904 + .4byte _080C8920 + .4byte _080C8B3C + .4byte _080C8B50 + .4byte _080C8B46 + .4byte _080C8B6C +_080C88A0: + bl sub_80CA2B8 + lsls r0, 24 + cmp r0, 0 + beq _080C88AC + b _080C8B82 +_080C88AC: + movs r0, 0x5 + bl audio_play + ldr r4, _080C88C4 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + beq _080C88C8 + movs r0, 0x4 + bl sub_80CAC58 + b _080C88F2 + .align 2, 0 +_080C88C4: .4byte 0x02039d08 +_080C88C8: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080C88DE + ldr r0, [r4] + ldr r1, _080C88E8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C88EC +_080C88DE: + movs r0, 0x17 + bl sub_80CAC58 + b _080C88F2 + .align 2, 0 +_080C88E8: .4byte 0x00000ce6 +_080C88EC: + movs r0, 0x18 + bl sub_80CAC58 +_080C88F2: + bl sub_80CFFD0 + ldr r0, _080C8900 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C8B82 + .align 2, 0 +_080C8900: .4byte 0x02039d08 +_080C8904: + bl sub_80D00A8 + lsls r0, 24 + cmp r0, 0 + beq _080C8910 + b _080C8B82 +_080C8910: + ldr r0, _080C891C + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C8B82 + .align 2, 0 +_080C891C: .4byte 0x02039d08 +_080C8920: + bl sub_80D00AC + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x12 + bls _080C8930 + b _080C8B82 +_080C8930: + lsls r0, 2 + ldr r1, _080C893C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C893C: .4byte _080C8940 + .align 2, 0 +_080C8940: + .4byte _080C898C + .4byte _080C898C + .4byte _080C8A0C + .4byte _080C89F4 + .4byte _080C899C + .4byte _080C89D4 + .4byte _080C89BC + .4byte _080C8AAC + .4byte _080C8A48 + .4byte _080C8AC0 + .4byte _080C8B82 + .4byte _080C8B82 + .4byte _080C8B82 + .4byte _080C8AD4 + .4byte _080C8AE8 + .4byte _080C8B1C + .4byte _080C8B08 + .4byte _080C8AFC + .4byte _080C8B30 +_080C898C: + bl sub_80CADC4 + ldr r0, _080C8998 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8998: .4byte task_pokemon_box_related + 1 +_080C899C: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8A52 + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C89B8 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C89B8: .4byte sub_80C8B90 + 1 +_080C89BC: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C89D0 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C89D0: .4byte sub_80C8BEC + 1 +_080C89D4: + bl sub_80CEA6C + lsls r0, 24 + cmp r0, 0 + beq _080C8A52 + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C89F0 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C89F0: .4byte c3_0808DC50 + 1 +_080C89F4: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C8A08 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8A08: .4byte sub_80C8C90 + 1 +_080C8A0C: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8A52 + ldr r4, _080C8A3C + ldr r0, [r4] + ldr r2, _080C8A40 + adds r0, r2 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080C8A8C + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C8A44 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8A3C: .4byte 0x02039d08 +_080C8A40: .4byte 0x00000ce6 +_080C8A44: .4byte sub_80C8D78 + 1 +_080C8A48: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + beq _080C8A60 +_080C8A52: + ldr r0, _080C8A5C + ldr r1, [r0] + movs r0, 0x3 + strb r0, [r1] + b _080C8B82 + .align 2, 0 +_080C8A5C: .4byte 0x02039d08 +_080C8A60: + ldr r4, _080C8A74 + ldr r1, [r4] + ldr r2, _080C8A78 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8A7C + movs r0, 0x5 + strb r0, [r1] + b _080C8B82 + .align 2, 0 +_080C8A74: .4byte 0x02039d08 +_080C8A78: .4byte 0x00000ced +_080C8A7C: + ldr r2, _080C8A94 + adds r0, r1, r2 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080C8A98 +_080C8A8C: + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1] + b _080C8B82 + .align 2, 0 +_080C8A94: .4byte 0x00000ce6 +_080C8A98: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8AA8 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8AA8: .4byte sub_80C8EB4 + 1 +_080C8AAC: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8ABC + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8ABC: .4byte sub_80C9B28 + 1 +_080C8AC0: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8AD0 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8AD0: .4byte sub_80C90A4 + 1 +_080C8AD4: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8AE4 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8AE4: .4byte sub_80C9128 + 1 +_080C8AE8: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8AF8 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8AF8: .4byte sub_80C91DC + 1 +_080C8AFC: + ldr r0, _080C8B04 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8B04: .4byte sub_80C9298 + 1 +_080C8B08: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8B18 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8B18: .4byte sub_80C93B0 + 1 +_080C8B1C: + movs r0, 0x5 + bl audio_play + ldr r0, _080C8B2C + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8B2C: .4byte sub_80C9B88 + 1 +_080C8B30: + ldr r0, _080C8B38 + bl add_to_c3_somehow + b _080C8B82 + .align 2, 0 +_080C8B38: .4byte sub_80C9498 + 1 +_080C8B3C: + movs r0, 0x20 + bl audio_play + movs r0, 0xD + b _080C8B58 +_080C8B46: + movs r0, 0x20 + bl audio_play + movs r0, 0x11 + b _080C8B58 +_080C8B50: + movs r0, 0x20 + bl audio_play + movs r0, 0x16 +_080C8B58: + bl sub_80CAC58 + ldr r0, _080C8B68 + ldr r1, [r0] + movs r0, 0x6 + strb r0, [r1] + b _080C8B82 + .align 2, 0 +_080C8B68: .4byte 0x02039d08 +_080C8B6C: + ldr r0, _080C8B88 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C8B82 + bl sub_80CADC4 + ldr r0, _080C8B8C + bl add_to_c3_somehow +_080C8B82: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C8B88: .4byte 0x030022c0 +_080C8B8C: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C8864 + + thumb_func_start sub_80C8B90 +sub_80C8B90: @ 80C8B90 + push {r4,lr} + ldr r4, _080C8BA4 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C8BA8 + cmp r0, 0x1 + beq _080C8BB8 + b _080C8BE2 + .align 2, 0 +_080C8BA4: .4byte 0x02039d08 +_080C8BA8: + movs r0, 0 + bl sub_80CDC38 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8BE2 +_080C8BB8: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8BE2 + ldr r0, _080C8BD4 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8BDC + ldr r0, _080C8BD8 + bl add_to_c3_somehow + b _080C8BE2 + .align 2, 0 +_080C8BD4: .4byte 0x02039d0c +_080C8BD8: .4byte sub_80C9670 + 1 +_080C8BDC: + ldr r0, _080C8BE8 + bl add_to_c3_somehow +_080C8BE2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C8BE8: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C8B90 + + thumb_func_start sub_80C8BEC +sub_80C8BEC: @ 80C8BEC + push {r4,lr} + ldr r4, _080C8C00 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C8C04 + cmp r0, 0x1 + beq _080C8C14 + b _080C8C3E + .align 2, 0 +_080C8C00: .4byte 0x02039d08 +_080C8C04: + movs r0, 0x1 + bl sub_80CDC38 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8C3E +_080C8C14: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8C3E + ldr r0, _080C8C30 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8C38 + ldr r0, _080C8C34 + bl add_to_c3_somehow + b _080C8C3E + .align 2, 0 +_080C8C30: .4byte 0x02039d0c +_080C8C34: .4byte sub_80C9670 + 1 +_080C8C38: + ldr r0, _080C8C44 + bl add_to_c3_somehow +_080C8C3E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C8C44: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C8BEC + + thumb_func_start c3_0808DC50 +c3_0808DC50: @ 80C8C48 + push {r4,lr} + ldr r4, _080C8C5C + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C8C60 + cmp r0, 0x1 + beq _080C8C70 + b _080C8C84 + .align 2, 0 +_080C8C5C: .4byte 0x02039d08 +_080C8C60: + movs r0, 0x2 + bl sub_80CDC38 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8C84 +_080C8C70: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8C84 + bl BoxSetMosaic + ldr r0, _080C8C8C + bl add_to_c3_somehow +_080C8C84: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C8C8C: .4byte task_pokemon_box_related + 1 + thumb_func_end c3_0808DC50 + + thumb_func_start sub_80C8C90 +sub_80C8C90: @ 80C8C90 + push {lr} + ldr r0, _080C8CA8 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080C8D6E + lsls r0, 2 + ldr r1, _080C8CAC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C8CA8: .4byte 0x02039d08 +_080C8CAC: .4byte _080C8CB0 + .align 2, 0 +_080C8CB0: + .4byte _080C8CC8 + .4byte _080C8D00 + .4byte _080C8D20 + .4byte _080C8D36 + .4byte _080C8D48 + .4byte _080C8D68 +_080C8CC8: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _080C8CE8 + movs r0, 0xE + bl sub_80CAC58 + ldr r0, _080C8CE4 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C8D6E + .align 2, 0 +_080C8CE4: .4byte 0x02039d08 +_080C8CE8: + bl sub_80CDC18 + movs r0, 0 + bl sub_80CDC38 + ldr r0, _080C8CFC + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C8D6E + .align 2, 0 +_080C8CFC: .4byte 0x02039d08 +_080C8D00: + ldr r0, _080C8D18 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C8D6E + bl sub_80CADC4 + ldr r0, _080C8D1C + bl add_to_c3_somehow + b _080C8D6E + .align 2, 0 +_080C8D18: .4byte 0x030022c0 +_080C8D1C: .4byte task_pokemon_box_related + 1 +_080C8D20: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8D6E + movs r0, 0x1 + bl sub_80CC0D4 + bl sub_80CAB4C + b _080C8D56 +_080C8D36: + bl sub_80CAB70 + lsls r0, 24 + cmp r0, 0 + bne _080C8D6E + movs r0, 0x1 + bl sub_80CDC38 + b _080C8D56 +_080C8D48: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8D6E + bl sub_80CAB20 +_080C8D56: + ldr r0, _080C8D64 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8D6E + .align 2, 0 +_080C8D64: .4byte 0x02039d08 +_080C8D68: + ldr r0, _080C8D74 + bl add_to_c3_somehow +_080C8D6E: + pop {r0} + bx r0 + .align 2, 0 +_080C8D74: .4byte sub_80C87E8 + 1 + thumb_func_end sub_80C8C90 + + thumb_func_start sub_80C8D78 +sub_80C8D78: @ 80C8D78 + push {r4,lr} + sub sp, 0x4 + ldr r0, _080C8D94 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bls _080C8D88 + b _080C8EA2 +_080C8D88: + lsls r0, 2 + ldr r1, _080C8D98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C8D94: .4byte 0x02039d08 +_080C8D98: .4byte _080C8D9C + .align 2, 0 +_080C8D9C: + .4byte _080C8DB0 + .4byte _080C8DEC + .4byte _080C8E4C + .4byte _080C8E64 + .4byte _080C8E88 +_080C8DB0: + movs r0, 0x6 + bl sub_80CAC58 + ldr r4, _080C8DDC + ldr r0, [r4] + ldr r1, _080C8DE0 + adds r0, r1 + ldr r2, _080C8DE4 + movs r1, 0 + str r1, [sp] + movs r1, 0xA + movs r3, 0x3 + bl sub_80C77E8 + ldr r0, _080C8DE8 + ldrb r0, [r0] + bl sub_80C78D4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + b _080C8EA0 + .align 2, 0 +_080C8DDC: .4byte 0x02039d08 +_080C8DE0: .4byte 0x00001e5c +_080C8DE4: .4byte 0x0000dac7 +_080C8DE8: .4byte 0x02039d0e +_080C8DEC: + bl sub_80C78F0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0xC8 + beq _080C8EA2 + cmp r0, 0xC9 + bne _080C8E0C + bl sub_80CADC4 + bl sub_80C78E4 + bl sub_80C7890 + b _080C8E7A +_080C8E0C: + adds r0, r4, 0 + bl sub_80CE19C + lsls r0, 24 + cmp r0, 0 + beq _080C8E38 + ldr r0, _080C8E30 + strb r4, [r0] + bl sub_80CADC4 + bl sub_80C78E4 + bl sub_80C7890 + ldr r0, _080C8E34 + ldr r1, [r0] + movs r0, 0x2 + b _080C8EA0 + .align 2, 0 +_080C8E30: .4byte 0x02039d0e +_080C8E34: .4byte 0x02039d08 +_080C8E38: + movs r0, 0x8 + bl sub_80CAC58 + ldr r0, _080C8E48 + ldr r1, [r0] + movs r0, 0x4 + b _080C8EA0 + .align 2, 0 +_080C8E48: .4byte 0x02039d08 +_080C8E4C: + bl party_compaction + bl sub_80CB950 + ldr r0, _080C8E60 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _080C8EA0 + .align 2, 0 +_080C8E60: .4byte 0x02039d08 +_080C8E64: + bl sub_80CB9BC + lsls r0, 24 + cmp r0, 0 + bne _080C8EA2 + bl sub_80CE22C + bl BoxSetMosaic + bl sub_80CAB20 +_080C8E7A: + ldr r0, _080C8E84 + bl add_to_c3_somehow + b _080C8EA2 + .align 2, 0 +_080C8E84: .4byte task_pokemon_box_related + 1 +_080C8E88: + ldr r0, _080C8EAC + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C8EA2 + movs r0, 0x6 + bl sub_80CAC58 + ldr r0, _080C8EB0 + ldr r1, [r0] + movs r0, 0x1 +_080C8EA0: + strb r0, [r1] +_080C8EA2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C8EAC: .4byte 0x030022c0 +_080C8EB0: .4byte 0x02039d08 + thumb_func_end sub_80C8D78 + + thumb_func_start sub_80C8EB4 +sub_80C8EB4: @ 80C8EB4 + push {lr} + ldr r0, _080C8ECC + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xD + bls _080C8EC2 + b _080C9096 +_080C8EC2: + lsls r0, 2 + ldr r1, _080C8ED0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C8ECC: .4byte 0x02039d08 +_080C8ED0: .4byte _080C8ED4 + .align 2, 0 +_080C8ED4: + .4byte _080C8F0C + .4byte _080C8F22 + .4byte _080C8F5A + .4byte _080C8F80 + .4byte _080C8F8C + .4byte _080C8FA4 + .4byte _080C8FE0 + .4byte _080C8FF8 + .4byte _080C9004 + .4byte _080C9008 + .4byte _080C901C + .4byte _080C9038 + .4byte _080C904A + .4byte _080C9080 +_080C8F0C: + movs r0, 0x9 + bl sub_80CAC58 + movs r0, 0x1 + bl sub_80CAD9C + ldr r0, _080C8F3C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C8F22: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C8F4C + cmp r1, 0 + bgt _080C8F40 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C8F46 + b _080C9096 + .align 2, 0 +_080C8F3C: .4byte 0x02039d08 +_080C8F40: + cmp r1, 0x1 + beq _080C8F46 + b _080C9096 +_080C8F46: + bl sub_80CADC4 + b _080C8FF8 +_080C8F4C: + bl sub_80CADC4 + bl sub_80CE3A0 + bl sub_80CE250 + b _080C905C +_080C8F5A: + bl sub_80CE580 + bl sub_80CE2A8 + lsls r0, 24 + cmp r0, 0 + beq _080C8F6A + b _080C9096 +_080C8F6A: + b _080C8F72 +_080C8F6C: + cmp r0, 0 + bne _080C8F72 + b _080C9070 +_080C8F72: + bl sub_80CE580 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080C8F6C + b _080C905C +_080C8F80: + bl sub_80CE2D8 + bl sub_80CA230 + movs r0, 0xA + b _080C9058 +_080C8F8C: + ldr r0, _080C8FA0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + bne _080C8F9A + b _080C9096 +_080C8F9A: + movs r0, 0xB + b _080C9058 + .align 2, 0 +_080C8FA0: .4byte 0x030022c0 +_080C8FA4: + ldr r0, _080C8FC8 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + bl sub_80CADC4 + ldr r0, _080C8FCC + ldrb r0, [r0] + cmp r0, 0 + beq _080C8FD0 + bl party_compaction + bl sub_80CB950 + b _080C905C + .align 2, 0 +_080C8FC8: .4byte 0x030022c0 +_080C8FCC: .4byte 0x02039d0c +_080C8FD0: + ldr r0, _080C8FDC + ldr r1, [r0] + movs r0, 0x7 + strb r0, [r1] + b _080C9096 + .align 2, 0 +_080C8FDC: .4byte 0x02039d08 +_080C8FE0: + bl sub_80CB9BC + lsls r0, 24 + cmp r0, 0 + bne _080C9096 + bl sub_80CE00C + bl BoxSetMosaic + bl sub_80CAB20 + b _080C905C +_080C8FF8: + ldr r0, _080C9000 + bl add_to_c3_somehow + b _080C9096 + .align 2, 0 +_080C9000: .4byte task_pokemon_box_related + 1 +_080C9004: + movs r0, 0xA + b _080C9058 +_080C9008: + ldr r0, _080C9018 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + movs r0, 0x15 + b _080C9058 + .align 2, 0 +_080C9018: .4byte 0x030022c0 +_080C901C: + ldr r0, _080C9034 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + bl sub_80CADC4 + bl sub_80CC064 + b _080C905C + .align 2, 0 +_080C9034: .4byte 0x030022c0 +_080C9038: + bl sub_80CC0A0 + lsls r0, 24 + cmp r0, 0 + bne _080C9096 + bl sub_80CE324 + movs r0, 0x13 + b _080C9058 +_080C904A: + ldr r0, _080C9068 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + movs r0, 0x14 +_080C9058: + bl sub_80CAC58 +_080C905C: + ldr r0, _080C906C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9096 + .align 2, 0 +_080C9068: .4byte 0x030022c0 +_080C906C: .4byte 0x02039d08 +_080C9070: + ldr r0, _080C907C + ldr r1, [r0] + movs r0, 0x8 + strb r0, [r1] + b _080C9096 + .align 2, 0 +_080C907C: .4byte 0x02039d08 +_080C9080: + ldr r0, _080C909C + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + bl sub_80CADC4 + ldr r0, _080C90A0 + bl add_to_c3_somehow +_080C9096: + pop {r0} + bx r0 + .align 2, 0 +_080C909C: .4byte 0x030022c0 +_080C90A0: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C8EB4 + + thumb_func_start sub_80C90A4 +sub_80C90A4: @ 80C90A4 + push {r4,lr} + ldr r4, _080C90B8 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C90BC + cmp r0, 0x1 + beq _080C90F0 + b _080C9118 + .align 2, 0 +_080C90B8: .4byte 0x02039d08 +_080C90BC: + movs r0, 0xC + bl sub_80CAC58 + ldr r0, [r4] + ldr r2, _080C90E8 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r3, _080C90EC + adds r0, r3 + strb r1, [r0] + ldr r0, [r4] + adds r0, r2 + ldrb r0, [r0] + movs r1, 0xB0 + movs r2, 0x10 + bl sub_811FAA4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9118 + .align 2, 0 +_080C90E8: .4byte 0x00000ceb +_080C90EC: .4byte 0x00000da8 +_080C90F0: + bl sub_811FBA4 + lsls r0, 24 + cmp r0, 0 + bne _080C9118 + bl sub_811FAF8 + bl sub_80CADC4 + ldr r0, [r4] + ldr r1, _080C9120 + adds r0, r1 + ldrb r0, [r0] + bl sub_80CE9A8 + bl sub_80CA230 + ldr r0, _080C9124 + bl add_to_c3_somehow +_080C9118: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9120: .4byte 0x00000da8 +_080C9124: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C90A4 + + thumb_func_start sub_80C9128 +sub_80C9128: @ 80C9128 + push {r4,r5,lr} + ldr r5, _080C9140 + ldr r0, [r5] + ldrb r1, [r0] + cmp r1, 0x1 + beq _080C9174 + cmp r1, 0x1 + bgt _080C9144 + cmp r1, 0 + beq _080C914E + b _080C91D2 + .align 2, 0 +_080C9140: .4byte 0x02039d08 +_080C9144: + cmp r1, 0x2 + beq _080C919C + cmp r1, 0x3 + beq _080C91C2 + b _080C91D2 +_080C914E: + ldr r1, _080C9164 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080C9168 + bl sub_80CADC4 + b _080C91B8 + .align 2, 0 +_080C9164: .4byte 0x00000ce6 +_080C9168: + ldr r0, _080C9170 + bl add_to_c3_somehow + b _080C91D2 + .align 2, 0 +_080C9170: .4byte sub_80C96B8 + 1 +_080C9174: + movs r0, 0x2 + bl sub_80CFE54 + ldr r0, _080C9198 + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D0E90 + b _080C91B8 + .align 2, 0 +_080C9198: .4byte 0x02039d0c +_080C919C: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C91D2 + movs r0, 0x3 + bl sub_80CFE54 + bl sub_80CADC4 + bl sub_80CE00C + bl sub_80CA4FC +_080C91B8: + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C91D2 +_080C91C2: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C91D2 + ldr r0, _080C91D8 + bl add_to_c3_somehow +_080C91D2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C91D8: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C9128 + + thumb_func_start sub_80C91DC +sub_80C91DC: @ 80C91DC + push {r4,lr} + ldr r0, _080C91F4 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bhi _080C928C + lsls r0, 2 + ldr r1, _080C91F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C91F4: .4byte 0x02039d08 +_080C91F8: .4byte _080C91FC + .align 2, 0 +_080C91FC: + .4byte _080C9264 + .4byte _080C9210 + .4byte _080C9238 + .4byte _080C9258 + .4byte _080C927C +_080C9210: + movs r0, 0x2 + bl sub_80CFE54 + ldr r0, _080C9234 + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D1080 + b _080C9268 + .align 2, 0 +_080C9234: .4byte 0x02039d0c +_080C9238: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C928C + movs r0, 0 + bl sub_80CFE54 + bl sub_80CE00C + bl sub_80CA4FC + movs r0, 0x1C + bl sub_80CAC58 + b _080C9268 +_080C9258: + ldr r0, _080C9274 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C928C +_080C9264: + bl sub_80CADC4 +_080C9268: + ldr r0, _080C9278 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C928C + .align 2, 0 +_080C9274: .4byte 0x030022c0 +_080C9278: .4byte 0x02039d08 +_080C927C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C928C + ldr r0, _080C9294 + bl add_to_c3_somehow +_080C928C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9294: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C91DC + + thumb_func_start sub_80C9298 +sub_80C9298: @ 80C9298 + push {r4,r5,lr} + ldr r1, _080C92B4 + ldr r0, [r1] + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x4 + bls _080C92A8 + b _080C93A2 +_080C92A8: + lsls r0, 2 + ldr r1, _080C92B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C92B4: .4byte 0x02039d08 +_080C92B8: .4byte _080C92BC + .align 2, 0 +_080C92BC: + .4byte _080C92D0 + .4byte _080C9328 + .4byte _080C9348 + .4byte _080C938C + .4byte _080C9374 +_080C92D0: + ldr r0, [r5] + ldr r1, _080C92F8 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _080C92FC + movs r0, 0x20 + bl audio_play + movs r0, 0x1A + bl sub_80CAC58 + ldr r1, [r5] + movs r0, 0x3 + strb r0, [r1] + b _080C93A2 + .align 2, 0 +_080C92F8: .4byte 0x00000ce6 +_080C92FC: + movs r0, 0x5 + bl audio_play + ldr r0, _080C9324 + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D1114 + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1] + b _080C93A2 + .align 2, 0 +_080C9324: .4byte 0x02039d0c +_080C9328: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C93A2 + movs r0, 0x19 + bl sub_80CAC58 + ldr r0, _080C9344 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C93A2 + .align 2, 0 +_080C9344: .4byte 0x02039d08 +_080C9348: + ldr r0, _080C936C + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C93A2 + bl sub_80CADC4 + bl sub_80CE00C + bl sub_80CA4FC + ldr r0, _080C9370 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] + b _080C93A2 + .align 2, 0 +_080C936C: .4byte 0x030022c0 +_080C9370: .4byte 0x02039d08 +_080C9374: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C93A2 + ldr r0, _080C9388 + bl add_to_c3_somehow + b _080C93A2 + .align 2, 0 +_080C9388: .4byte task_pokemon_box_related + 1 +_080C938C: + ldr r0, _080C93A8 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C93A2 + bl sub_80CADC4 + ldr r0, _080C93AC + bl add_to_c3_somehow +_080C93A2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C93A8: .4byte 0x030022c0 +_080C93AC: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C9298 + + thumb_func_start sub_80C93B0 +sub_80C93B0: @ 80C93B0 + push {r4,lr} + ldr r1, _080C93C8 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _080C948C + lsls r0, 2 + ldr r1, _080C93CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C93C8: .4byte 0x02039d08 +_080C93CC: .4byte _080C93D0 + .align 2, 0 +_080C93D0: + .4byte _080C93E4 + .4byte _080C9410 + .4byte _080C9438 + .4byte _080C9458 + .4byte _080C947C +_080C93E4: + ldr r0, [r4] + ldr r1, _080C9400 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080C9404 + bl sub_80CADC4 + ldr r1, [r4] + b _080C946C + .align 2, 0 +_080C9400: .4byte 0x00000ce6 +_080C9404: + ldr r0, _080C940C + bl add_to_c3_somehow + b _080C948C + .align 2, 0 +_080C940C: .4byte sub_80C96B8 + 1 +_080C9410: + movs r0, 0x2 + bl sub_80CFE54 + ldr r0, _080C9434 + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D0FAC + b _080C9468 + .align 2, 0 +_080C9434: .4byte 0x02039d0c +_080C9438: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C948C + movs r0, 0x3 + bl sub_80CFE54 + bl sub_80CE00C + bl sub_80CA4FC + movs r0, 0x1D + bl sub_80CAC58 + b _080C9468 +_080C9458: + ldr r0, _080C9474 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C948C + bl sub_80CADC4 +_080C9468: + ldr r0, _080C9478 + ldr r1, [r0] +_080C946C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C948C + .align 2, 0 +_080C9474: .4byte 0x030022c0 +_080C9478: .4byte 0x02039d08 +_080C947C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C948C + ldr r0, _080C9494 + bl add_to_c3_somehow +_080C948C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9494: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C93B0 + + thumb_func_start sub_80C9498 +sub_80C9498: @ 80C9498 + push {lr} + ldr r0, _080C94B0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + bhi _080C9544 + lsls r0, 2 + ldr r1, _080C94B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C94B0: .4byte 0x02039d08 +_080C94B4: .4byte _080C94B8 + .align 2, 0 +_080C94B8: + .4byte _080C94D4 + .4byte _080C94DA + .4byte _080C94F4 + .4byte _080C94FA + .4byte _080C9500 + .4byte _080C9518 + .4byte _080C9534 +_080C94D4: + bl sub_80CADC4 + b _080C9522 +_080C94DA: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C9544 + movs r0, 0x6 + bl audio_play + bl sub_80D17B4 + bl sub_80D1818 + b _080C9522 +_080C94F4: + bl sub_80D184C + b _080C951C +_080C94FA: + bl is_dma3_queue_busy_with_gpu_copy + b _080C951C +_080C9500: + ldr r0, _080C9514 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9544 + movs r0, 0x6 + bl audio_play + b _080C9522 + .align 2, 0 +_080C9514: .4byte 0x030022c0 +_080C9518: + bl sub_80D18E4 +_080C951C: + lsls r0, 24 + cmp r0, 0 + bne _080C9544 +_080C9522: + ldr r0, _080C9530 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9544 + .align 2, 0 +_080C9530: .4byte 0x02039d08 +_080C9534: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C9544 + ldr r0, _080C9548 + bl add_to_c3_somehow +_080C9544: + pop {r0} + bx r0 + .align 2, 0 +_080C9548: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C9498 + + thumb_func_start sub_80C954C +sub_80C954C: @ 80C954C + push {r4,lr} + ldr r0, _080C9564 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bls _080C955A + b _080C9664 +_080C955A: + lsls r0, 2 + ldr r1, _080C9568 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C9564: .4byte 0x02039d08 +_080C9568: .4byte _080C956C + .align 2, 0 +_080C956C: + .4byte _080C9584 + .4byte _080C95A4 + .4byte _080C9602 + .4byte _080C9624 + .4byte _080C9638 + .4byte _080C9654 +_080C9584: + movs r0, 0x5 + bl audio_play + movs r0, 0x1B + bl sub_80CAC58 + movs r0, 0 + bl sub_80CAD9C + ldr r0, _080C95A0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C9664 + .align 2, 0 +_080C95A0: .4byte 0x02039d08 +_080C95A4: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C95C8 + cmp r1, 0 + bgt _080C95BE + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C95C2 + b _080C9664 +_080C95BE: + cmp r1, 0x1 + bne _080C9664 +_080C95C2: + bl sub_80CADC4 + b _080C9648 +_080C95C8: + ldr r4, _080C95EC + ldr r0, [r4] + ldr r1, _080C95F0 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080C95F4 + bl sub_80CADC4 + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1] + b _080C9664 + .align 2, 0 +_080C95EC: .4byte 0x02039d08 +_080C95F0: .4byte 0x00002234 +_080C95F4: + movs r0, 0x1A + bl sub_80CAC58 + ldr r1, [r4] + movs r0, 0x2 + strb r0, [r1] + b _080C9664 +_080C9602: + ldr r0, _080C961C + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9664 + bl sub_80CADC4 + ldr r0, _080C9620 + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] + b _080C9664 + .align 2, 0 +_080C961C: .4byte 0x030022c0 +_080C9620: .4byte 0x02039d08 +_080C9624: + bl sub_80D1194 + ldr r0, _080C9634 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] + b _080C9664 + .align 2, 0 +_080C9634: .4byte 0x02039d08 +_080C9638: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C9664 + movs r0, 0 + bl sub_80CFE54 +_080C9648: + ldr r0, _080C9650 + bl add_to_c3_somehow + b _080C9664 + .align 2, 0 +_080C9650: .4byte task_pokemon_box_related + 1 +_080C9654: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C9664 + ldr r0, _080C966C + bl add_to_c3_somehow +_080C9664: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C966C: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C954C + + thumb_func_start sub_80C9670 +sub_80C9670: @ 80C9670 + push {r4,lr} + ldr r4, _080C9684 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C9688 + cmp r0, 0x1 + beq _080C969A + b _080C96AE + .align 2, 0 +_080C9684: .4byte 0x02039d08 +_080C9688: + bl party_compaction + bl sub_80CB950 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C96AE +_080C969A: + bl sub_80CB9BC + lsls r0, 24 + cmp r0, 0 + bne _080C96AE + bl sub_80CAB20 + ldr r0, _080C96B4 + bl add_to_c3_somehow +_080C96AE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C96B4: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C9670 + + thumb_func_start sub_80C96B8 +sub_80C96B8: @ 80C96B8 + push {r4,lr} + ldr r4, _080C96D0 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C96E6 + cmp r0, 0x1 + bgt _080C96D4 + cmp r0, 0 + beq _080C96DE + b _080C9720 + .align 2, 0 +_080C96D0: .4byte 0x02039d08 +_080C96D4: + cmp r0, 0x2 + beq _080C96F2 + cmp r0, 0x3 + beq _080C9710 + b _080C9720 +_080C96DE: + movs r0, 0x1E + bl sub_80CAC58 + b _080C9702 +_080C96E6: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C9720 + b _080C9702 +_080C96F2: + ldr r0, _080C970C + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9720 + bl sub_80CADC4 +_080C9702: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9720 + .align 2, 0 +_080C970C: .4byte 0x030022c0 +_080C9710: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C9720 + ldr r0, _080C9728 + bl add_to_c3_somehow +_080C9720: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9728: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C96B8 + + thumb_func_start box_related +box_related: @ 80C972C + push {r4,lr} + ldr r4, _080C9744 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C9762 + cmp r0, 0x1 + bgt _080C9748 + cmp r0, 0 + beq _080C974E + b _080C9818 + .align 2, 0 +_080C9744: .4byte 0x02039d08 +_080C9748: + cmp r0, 0x2 + beq _080C9774 + b _080C9818 +_080C974E: + movs r0, 0x1 + bl sub_80CAC58 + bl sub_80CFFD0 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9818 +_080C9762: + bl sub_80D00A8 + lsls r0, 24 + cmp r0, 0 + bne _080C9818 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C9774: + bl sub_80D00AC + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bhi _080C9818 + lsls r0, 2 + ldr r1, _080C978C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C978C: .4byte _080C9790 + .align 2, 0 +_080C9790: + .4byte _080C97C4 + .4byte _080C97C4 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9808 + .4byte _080C97F0 + .4byte _080C97DC +_080C97C4: + movs r0, 0x1 + bl sub_80CD1A8 + bl sub_80CADC4 + ldr r0, _080C97D8 + bl add_to_c3_somehow + b _080C9818 + .align 2, 0 +_080C97D8: .4byte task_pokemon_box_related + 1 +_080C97DC: + movs r0, 0x5 + bl audio_play + ldr r0, _080C97EC + bl add_to_c3_somehow + b _080C9818 + .align 2, 0 +_080C97EC: .4byte sub_80C9AC8 + 1 +_080C97F0: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C9804 + bl add_to_c3_somehow + b _080C9818 + .align 2, 0 +_080C9804: .4byte sub_80C9824 + 1 +_080C9808: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, _080C9820 + bl add_to_c3_somehow +_080C9818: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9820: .4byte sub_80C99D8 + 1 + thumb_func_end box_related + + thumb_func_start sub_80C9824 +sub_80C9824: @ 80C9824 + push {r4,r5,lr} + ldr r0, _080C983C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + bls _080C9832 + b _080C99CC +_080C9832: + lsls r0, 2 + ldr r1, _080C9840 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C983C: .4byte 0x02039d08 +_080C9840: .4byte _080C9844 + .align 2, 0 +_080C9844: + .4byte _080C9860 + .4byte _080C9878 + .4byte _080C9894 + .4byte _080C990C + .4byte _080C993C + .4byte _080C9990 + .4byte _080C99AC +_080C9860: + bl sub_80CADD8 + movs r0, 0x2 + bl sub_80CAC58 + ldr r0, _080C9874 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA + .align 2, 0 +_080C9874: .4byte 0x02039d08 +_080C9878: + bl sub_80D00A8 + lsls r0, 24 + cmp r0, 0 + beq _080C9884 + b _080C99CC +_080C9884: + ldr r0, _080C9890 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA + .align 2, 0 +_080C9890: .4byte 0x02039d08 +_080C9894: + bl sub_80D00AC + ldr r4, _080C98B8 + ldr r1, [r4] + ldr r5, _080C98BC + adds r1, r5 + strh r0, [r1] + movs r0, 0 + ldrsh r1, [r1, r0] + cmp r1, 0x15 + bgt _080C98C0 + cmp r1, 0x12 + bge _080C98D2 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C98C6 + b _080C99CC + .align 2, 0 +_080C98B8: .4byte 0x02039d08 +_080C98BC: .4byte 0x0000078e +_080C98C0: + cmp r1, 0x16 + beq _080C98EC + b _080C99CC +_080C98C6: + movs r0, 0x1 + bl sub_80CD1A8 + bl sub_80CADC4 + b _080C99A0 +_080C98D2: + movs r0, 0x5 + bl audio_play + bl sub_80D013C + ldr r1, [r4] + adds r2, r1, r5 + ldrh r0, [r2] + subs r0, 0x12 + strh r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA +_080C98EC: + movs r0, 0x5 + bl audio_play + ldr r0, [r4] + movs r1, 0xF2 + lsls r1, 3 + adds r0, r1 + movs r1, 0x10 + strh r1, [r0] + bl sub_80D013C + bl sub_80CADC4 + ldr r1, [r4] + movs r0, 0x6 + b _080C99CA +_080C990C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C99CC + ldr r4, _080C9934 + ldr r0, [r4] + ldr r1, _080C9938 + adds r0, r1 + ldrb r0, [r0] + bl sub_80CAE0C + movs r0, 0x3 + bl sub_80CAC58 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA + .align 2, 0 +_080C9934: .4byte 0x02039d08 +_080C9938: .4byte 0x0000078e +_080C993C: + bl sub_80D00AC + ldr r4, _080C9968 + ldr r1, [r4] + movs r5, 0xF2 + lsls r5, 3 + adds r1, r5 + strh r0, [r1] + movs r0, 0 + ldrsh r1, [r1, r0] + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080C99CC + adds r0, 0x1 + cmp r1, r0 + bne _080C996C + bl sub_80CADC4 + ldr r1, [r4] + movs r0, 0 + b _080C99CA + .align 2, 0 +_080C9968: .4byte 0x02039d08 +_080C996C: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r1, [r4] + adds r1, r5 + ldrh r0, [r1] + subs r0, 0x17 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_80CC680 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA +_080C9990: + bl sub_80CC6B0 + lsls r0, 24 + cmp r0, 0 + bne _080C99CC + movs r0, 0x1 + bl sub_80CD1A8 +_080C99A0: + ldr r0, _080C99A8 + bl add_to_c3_somehow + b _080C99CC + .align 2, 0 +_080C99A8: .4byte task_pokemon_box_related + 1 +_080C99AC: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080C99CC + ldr r4, _080C99D4 + ldr r0, [r4] + movs r1, 0xF2 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + bl sub_80CC680 + ldr r1, [r4] + movs r0, 0x5 +_080C99CA: + strb r0, [r1] +_080C99CC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C99D4: .4byte 0x02039d08 + thumb_func_end sub_80C9824 + + thumb_func_start sub_80C99D8 +sub_80C99D8: @ 80C99D8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _080C99F0 + ldr r0, [r5] + ldrb r4, [r0] + cmp r4, 0x1 + beq _080C9A2C + cmp r4, 0x1 + bgt _080C99F4 + cmp r4, 0 + beq _080C99FE + b _080C9AB8 + .align 2, 0 +_080C99F0: .4byte 0x02039d08 +_080C99F4: + cmp r4, 0x2 + beq _080C9A84 + cmp r4, 0x3 + beq _080C9A9C + b _080C9AB8 +_080C99FE: + movs r0, 0x5 + bl sub_80CAC58 + ldr r0, [r5] + ldr r1, _080C9A24 + adds r0, r1 + ldr r2, _080C9A28 + str r4, [sp] + movs r1, 0xA + movs r3, 0x3 + bl sub_80C77E8 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sub_80C78D4 + b _080C9A8E + .align 2, 0 +_080C9A24: .4byte 0x00001e5c +_080C9A28: .4byte 0x0000dac7 +_080C9A2C: + bl sub_80C78F0 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080C9A7C + adds r1, r2 + strh r0, [r1] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xC8 + beq _080C9AB8 + bl sub_80CADC4 + bl sub_80C78E4 + bl sub_80C7890 + ldr r0, [r5] + ldr r2, _080C9A7C + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xC9 + beq _080C9A6C + adds r4, r0, 0 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080C9A8E +_080C9A6C: + movs r0, 0x1 + bl sub_80CD1A8 + ldr r0, _080C9A80 + bl add_to_c3_somehow + b _080C9AB8 + .align 2, 0 +_080C9A7C: .4byte 0x000002ca +_080C9A80: .4byte task_pokemon_box_related + 1 +_080C9A84: + ldr r1, _080C9A98 + adds r0, r1 + ldrb r0, [r0] + bl sub_80CC464 +_080C9A8E: + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9AB8 + .align 2, 0 +_080C9A98: .4byte 0x000002ca +_080C9A9C: + bl sub_80CC54C + lsls r0, 24 + cmp r0, 0 + bne _080C9AB8 + ldr r0, [r5] + ldr r2, _080C9AC0 + adds r0, r2 + ldrb r0, [r0] + bl sub_80D1D18 + ldr r0, _080C9AC4 + bl add_to_c3_somehow +_080C9AB8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C9AC0: .4byte 0x000002ca +_080C9AC4: .4byte task_pokemon_box_related + 1 + thumb_func_end sub_80C99D8 + + thumb_func_start sub_80C9AC8 +sub_80C9AC8: @ 80C9AC8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _080C9ADC + ldr r0, [r5] + ldrb r4, [r0] + cmp r4, 0 + beq _080C9AE0 + cmp r4, 0x1 + beq _080C9AFE + b _080C9B18 + .align 2, 0 +_080C9ADC: .4byte 0x02039d08 +_080C9AE0: + bl sub_80CE760 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9B18 +_080C9AFE: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C9B18 + ldr r0, _080C9B20 + strb r4, [r0] + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x2] + ldr r0, _080C9B24 + bl add_to_c3_somehow +_080C9B18: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C9B20: .4byte 0x02039d0f +_080C9B24: .4byte sub_80C9E50 + 1 + thumb_func_end sub_80C9AC8 + + thumb_func_start sub_80C9B28 +sub_80C9B28: @ 80C9B28 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _080C9B3C + ldr r0, [r5] + ldrb r4, [r0] + cmp r4, 0 + beq _080C9B40 + cmp r4, 0x1 + beq _080C9B5E + b _080C9B78 + .align 2, 0 +_080C9B3C: .4byte 0x02039d08 +_080C9B40: + bl sub_80CE7E8 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9B78 +_080C9B5E: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C9B78 + ldr r0, _080C9B80 + strb r1, [r0] + ldr r0, [r5] + strb r4, [r0, 0x2] + ldr r0, _080C9B84 + bl add_to_c3_somehow +_080C9B78: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080C9B80: .4byte 0x02039d0f +_080C9B84: .4byte sub_80C9E50 + 1 + thumb_func_end sub_80C9B28 + + thumb_func_start sub_80C9B88 +sub_80C9B88: @ 80C9B88 + push {r4,lr} + sub sp, 0x4 + ldr r4, _080C9B9C + ldr r0, [r4] + ldrb r1, [r0] + cmp r1, 0 + beq _080C9BA0 + cmp r1, 0x1 + beq _080C9BBA + b _080C9BD6 + .align 2, 0 +_080C9B9C: .4byte 0x02039d08 +_080C9BA0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9BD6 +_080C9BBA: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C9BD6 + ldr r1, _080C9BE0 + movs r0, 0x2 + strb r0, [r1] + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1, 0x2] + ldr r0, _080C9BE4 + bl add_to_c3_somehow +_080C9BD6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9BE0: .4byte 0x02039d0f +_080C9BE4: .4byte sub_80C9E50 + 1 + thumb_func_end sub_80C9B88 + + thumb_func_start sub_80C9BE8 +sub_80C9BE8: @ 80C9BE8 + push {r4,lr} + ldr r0, _080C9C00 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bls _080C9BF6 + b _080C9D08 +_080C9BF6: + lsls r0, 2 + ldr r1, _080C9C04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C9C00: .4byte 0x02039d08 +_080C9C04: .4byte _080C9C08 + .align 2, 0 +_080C9C08: + .4byte _080C9C1C + .4byte _080C9C78 + .4byte _080C9C8C + .4byte _080C9CC8 + .4byte _080C9CE4 +_080C9C1C: + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + beq _080C9C40 + movs r0, 0x20 + bl audio_play + movs r0, 0xF + bl sub_80CAC58 + ldr r0, _080C9C3C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C9D08 + .align 2, 0 +_080C9C3C: .4byte 0x02039d08 +_080C9C40: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080C9C58 + ldr r0, _080C9C54 + bl add_to_c3_somehow + b _080C9D08 + .align 2, 0 +_080C9C54: .4byte sub_80C954C + 1 +_080C9C58: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_80CAC58 + movs r0, 0 + bl sub_80CAD9C + ldr r0, _080C9C74 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C9D08 + .align 2, 0 +_080C9C74: .4byte 0x02039d08 +_080C9C78: + ldr r0, _080C9C88 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9D08 + b _080C9CAA + .align 2, 0 +_080C9C88: .4byte 0x030022c0 +_080C9C8C: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C9CBC + cmp r1, 0 + bgt _080C9CA6 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C9CAA + b _080C9D08 +_080C9CA6: + cmp r1, 0x1 + bne _080C9D08 +_080C9CAA: + bl sub_80CADC4 + ldr r0, _080C9CB8 + bl add_to_c3_somehow + b _080C9D08 + .align 2, 0 +_080C9CB8: .4byte task_pokemon_box_related + 1 +_080C9CBC: + movs r0, 0x3 + bl audio_play + bl sub_80CADC4 + b _080C9CD2 +_080C9CC8: + movs r0, 0x14 + movs r1, 0 + movs r2, 0x1 + bl sub_80F9BF4 +_080C9CD2: + ldr r0, _080C9CE0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9D08 + .align 2, 0 +_080C9CE0: .4byte 0x02039d08 +_080C9CE4: + bl sub_80F9C30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080C9D08 + bl sub_80CABE0 + bl calc_player_party_count + ldr r1, _080C9D10 + strb r0, [r1] + ldr r0, _080C9D14 + ldr r0, [r0] + strb r4, [r0, 0x2] + ldr r0, _080C9D18 + bl add_to_c3_somehow +_080C9D08: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9D10: .4byte 0x020244e9 +_080C9D14: .4byte 0x02039d08 +_080C9D18: .4byte sub_80C9E50 + 1 + thumb_func_end sub_80C9BE8 + + thumb_func_start sub_80C9D1C +sub_80C9D1C: @ 80C9D1C + push {r4,lr} + ldr r0, _080C9D34 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bls _080C9D2A + b _080C9E3C +_080C9D2A: + lsls r0, 2 + ldr r1, _080C9D38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080C9D34: .4byte 0x02039d08 +_080C9D38: .4byte _080C9D3C + .align 2, 0 +_080C9D3C: + .4byte _080C9D50 + .4byte _080C9DAC + .4byte _080C9DC0 + .4byte _080C9DFC + .4byte _080C9E18 +_080C9D50: + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + beq _080C9D74 + movs r0, 0x20 + bl audio_play + movs r0, 0xF + bl sub_80CAC58 + ldr r0, _080C9D70 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C9E3C + .align 2, 0 +_080C9D70: .4byte 0x02039d08 +_080C9D74: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080C9D8C + ldr r0, _080C9D88 + bl add_to_c3_somehow + b _080C9E3C + .align 2, 0 +_080C9D88: .4byte sub_80C954C + 1 +_080C9D8C: + movs r0, 0x5 + bl audio_play + movs r0, 0x12 + bl sub_80CAC58 + movs r0, 0 + bl sub_80CAD9C + ldr r0, _080C9DA8 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C9E3C + .align 2, 0 +_080C9DA8: .4byte 0x02039d08 +_080C9DAC: + ldr r0, _080C9DBC + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9E3C + b _080C9DE0 + .align 2, 0 +_080C9DBC: .4byte 0x030022c0 +_080C9DC0: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C9DE0 + cmp r1, 0 + bgt _080C9DDA + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C9DF0 + b _080C9E3C +_080C9DDA: + cmp r1, 0x1 + beq _080C9DF0 + b _080C9E3C +_080C9DE0: + bl sub_80CADC4 + ldr r0, _080C9DEC + bl add_to_c3_somehow + b _080C9E3C + .align 2, 0 +_080C9DEC: .4byte task_pokemon_box_related + 1 +_080C9DF0: + movs r0, 0x3 + bl audio_play + bl sub_80CADC4 + b _080C9E06 +_080C9DFC: + movs r0, 0x14 + movs r1, 0 + movs r2, 0 + bl sub_80F9BF4 +_080C9E06: + ldr r0, _080C9E14 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9E3C + .align 2, 0 +_080C9E14: .4byte 0x02039d08 +_080C9E18: + bl sub_80F9C30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080C9E3C + bl sub_80CABE0 + bl calc_player_party_count + ldr r1, _080C9E44 + strb r0, [r1] + ldr r0, _080C9E48 + ldr r0, [r0] + strb r4, [r0, 0x2] + ldr r0, _080C9E4C + bl add_to_c3_somehow +_080C9E3C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9E44: .4byte 0x020244e9 +_080C9E48: .4byte 0x02039d08 +_080C9E4C: .4byte sub_80C9E50 + 1 + thumb_func_end sub_80C9D1C + + thumb_func_start sub_80C9E50 +sub_80C9E50: @ 80C9E50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _080C9E80 + ldr r0, [r0] + ldrb r4, [r0, 0x2] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080C9E88 + bl sub_80D127C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080C9E88 + bl sub_80D12D4 + ldr r1, _080C9E84 + b _080C9E8C + .align 2, 0 +_080C9E80: .4byte 0x02039d08 +_080C9E84: .4byte 0x02039d12 +_080C9E88: + ldr r1, _080C9EAC + movs r0, 0 +_080C9E8C: + strh r0, [r1] + cmp r4, 0x1 + beq _080C9EB4 + cmp r4, 0x1 + ble _080C9E9E + cmp r4, 0x2 + beq _080C9F1C + cmp r4, 0x3 + beq _080C9F48 +_080C9E9E: + bl sub_80C9FC8 + ldr r0, _080C9EB0 + bl set_callback2 + b _080C9F56 + .align 2, 0 +_080C9EAC: .4byte 0x02039d12 +_080C9EB0: .4byte sub_80C7678 + 1 +_080C9EB4: + ldr r0, _080C9EF0 + ldr r1, [r0] + ldr r2, _080C9EF4 + adds r0, r1, r2 + ldr r4, [r0] + subs r2, 0x5 + adds r0, r1, r2 + ldrb r7, [r0] + subs r2, 0x1 + adds r0, r1, r2 + ldrb r6, [r0] + ldr r0, _080C9EF8 + adds r1, r0 + ldrb r5, [r1] + bl sub_80C9FC8 + cmp r5, 0 + bne _080C9F04 + ldr r0, _080C9EFC + cmp r4, r0 + bne _080C9F04 + ldr r0, _080C9F00 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_81BFA80 + b _080C9F56 + .align 2, 0 +_080C9EF0: .4byte 0x02039d08 +_080C9EF4: .4byte 0x0000218c +_080C9EF8: .4byte 0x00002188 +_080C9EFC: .4byte 0x02039d14 +_080C9F00: .4byte c2_808CE60 + 1 +_080C9F04: + ldr r0, _080C9F18 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_81BF8EC + b _080C9F56 + .align 2, 0 +_080C9F18: .4byte c2_808CE60 + 1 +_080C9F1C: + bl sub_80C9FC8 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + movs r0, 0 + str r0, [sp] + ldr r0, _080C9F44 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl do_choose_name_or_words_screen + b _080C9F56 + .align 2, 0 +_080C9F44: .4byte c2_808CE60 + 1 +_080C9F48: + bl sub_80C9FC8 + ldr r2, _080C9F68 + movs r0, 0xB + movs r1, 0 + bl sub_81AAC90 +_080C9F56: + mov r0, r8 + bl remove_task + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080C9F68: .4byte c2_808CE60 + 1 + thumb_func_end sub_80C9E50 + + thumb_func_start sub_80C9F6C +sub_80C9F6C: @ 80C9F6C + push {lr} + sub sp, 0x4 + ldr r0, _080C9FA0 + ldrh r1, [r0] + mov r0, sp + strh r1, [r0] + cmp r1, 0 + beq _080C9FC0 + bl sub_80CFE08 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _080C9FA4 + ldrb r0, [r0] + cmp r0, 0 + beq _080C9FAC + movs r0, 0x64 + muls r0, r1 + ldr r1, _080C9FA8 + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + b _080C9FB6 + .align 2, 0 +_080C9FA0: .4byte 0x0203ce7c +_080C9FA4: .4byte 0x02039d0c +_080C9FA8: .4byte 0x020244ec +_080C9FAC: + adds r0, r1, 0 + movs r1, 0xC + mov r2, sp + bl set_pokemon_data_from_selected_box +_080C9FB6: + mov r0, sp + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 +_080C9FC0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80C9F6C + + thumb_func_start sub_80C9FC8 +sub_80C9FC8: @ 80C9FC8 + push {r4,lr} + bl sub_80D25F0 + bl sub_80D01B8 + ldr r4, _080C9FE8 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + bl Window_FreeMemory + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080C9FE8: .4byte 0x02039d08 + thumb_func_end sub_80C9FC8 + + thumb_func_start sub_80C9FEC +sub_80C9FEC: @ 80C9FEC + push {lr} + sub sp, 0x4 + ldr r1, _080CA018 + movs r0, 0xE + bl lcd_io_set + ldr r1, _080CA01C + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, _080CA020 + ldr r1, _080CA024 + bl LZ77UnCompVram + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080CA018: .4byte 0x00001f0f +_080CA01C: .4byte 0x085720dc +_080CA020: .4byte 0x08572174 +_080CA024: .4byte 0x0600f800 + thumb_func_end sub_80C9FEC + + thumb_func_start sub_80CA028 +sub_80CA028: @ 80CA028 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x2 + bl bg_change_y_offset + pop {r0} + bx r0 + thumb_func_end sub_80CA028 + + thumb_func_start sub_80CA044 +sub_80CA044: @ 80CA044 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _080CA090 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r1, _080CA094 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, _080CA098 + ldr r5, _080CA09C + ldr r1, [r5] + ldr r4, _080CA0A0 + adds r1, r4 + bl LZ77UnCompWram + ldr r1, [r5] + adds r1, r4 + movs r0, 0x1 + bl bg_set_tilemap + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CA090: .4byte 0x08572734 +_080CA094: .4byte 0x08dd2fe8 +_080CA098: .4byte 0x085722a0 +_080CA09C: .4byte 0x02039d08 +_080CA0A0: .4byte 0x00005ac4 + thumb_func_end sub_80CA044 + + thumb_func_start sub_80CA0A4 +sub_80CA0A4: @ 80CA0A4 + push {lr} + ldr r0, _080CA0BC + bl Window_InitFromTemplates + lsls r0, 16 + cmp r0, 0 + beq _080CA0C0 + bl TextBox_ResetSomeField + movs r0, 0x1 + b _080CA0C2 + .align 2, 0 +_080CA0BC: .4byte 0x08572714 +_080CA0C0: + movs r0, 0 +_080CA0C2: + pop {r1} + bx r1 + thumb_func_end sub_80CA0A4 + + thumb_func_start sub_80CA0C8 +sub_80CA0C8: @ 80CA0C8 + push {lr} + ldr r0, _080CA0D4 + bl gpu_pal_obj_alloc_tag_and_apply + pop {r0} + bx r0 + .align 2, 0 +_080CA0D4: .4byte 0x08572744 + thumb_func_end sub_80CA0C8 + + thumb_func_start sub_80CA0D8 +sub_80CA0D8: @ 80CA0D8 + push {lr} + ldr r0, _080CA110 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080CA114 + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080CA118 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _080CA11C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + beq _080CA124 + ldr r0, _080CA120 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + b _080CA12E + .align 2, 0 +_080CA110: .4byte 0x085723dc +_080CA114: .4byte 0x085723fc +_080CA118: .4byte 0x085726f4 +_080CA11C: .4byte 0x02039d08 +_080CA120: .4byte 0x0857241c +_080CA124: + ldr r0, _080CA14C + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply +_080CA12E: + ldr r1, _080CA150 + movs r0, 0xA + bl lcd_io_set + bl sub_80CA318 + bl sub_80CA154 + bl sub_80CA1C4 + bl sub_80CA230 + pop {r0} + bx r0 + .align 2, 0 +_080CA14C: .4byte 0x0857243c +_080CA150: .4byte 0x00001e05 + thumb_func_end sub_80CA0D8 + + thumb_func_start sub_80CA154 +sub_80CA154: @ 80CA154 + push {r4,lr} + ldr r1, _080CA1B4 + movs r0, 0x10 + movs r2, 0 + bl sub_811FFB4 + ldr r4, _080CA1B8 + ldr r1, [r4] + ldr r3, _080CA1BC + adds r1, r3 + str r0, [r1] + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, [r4] + adds r0, r3 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldr r2, [r0] + movs r1, 0x28 + strh r1, [r2, 0x20] + ldr r1, [r0] + movs r0, 0x96 + strh r0, [r1, 0x22] + movs r0, 0x10 + bl gpu_tile_obj_tag_get_range_start + ldr r1, [r4] + movs r2, 0xDA + lsls r2, 4 + adds r1, r2 + lsls r0, 16 + lsrs r0, 11 + ldr r2, _080CA1C0 + adds r0, r2 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CA1B4: .4byte 0x0000dac8 +_080CA1B8: .4byte 0x02039d08 +_080CA1BC: .4byte 0x00000d94 +_080CA1C0: .4byte 0x06010000 + thumb_func_end sub_80CA154 + + thumb_func_start sub_80CA1C4 +sub_80CA1C4: @ 80CA1C4 + push {r4,lr} + sub sp, 0x8 + ldr r0, _080CA21C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r4, 0 +_080CA1DA: + lsls r1, r4, 6 + subs r1, r4 + adds r1, 0x8 + lsls r1, 16 + asrs r1, 16 + ldr r0, _080CA220 + movs r2, 0x9 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080CA224 + ldr r2, [r1] + lsls r1, r4, 2 + ldr r3, _080CA228 + adds r2, r3 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080CA22C + adds r1, r0 + str r1, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CA1DA + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CA21C: .4byte 0x0857274c +_080CA220: .4byte 0x085728bc +_080CA224: .4byte 0x02039d08 +_080CA228: .4byte 0x00000d98 +_080CA22C: .4byte 0x02020630 + thumb_func_end sub_80CA1C4 + + thumb_func_start sub_80CA230 +sub_80CA230: @ 80CA230 + push {lr} + ldr r0, _080CA258 + ldr r1, [r0] + ldr r2, _080CA25C + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, 0x4 + adds r1, r2 + ldr r1, [r1] + bl sub_80CA44C + bl sub_80CA4FC + bl sub_80CA65C + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + .align 2, 0 +_080CA258: .4byte 0x02039d08 +_080CA25C: .4byte 0x00000ce4 + thumb_func_end sub_80CA230 + + thumb_func_start BoxSetMosaic +BoxSetMosaic: @ 80CA260 + push {lr} + bl sub_80CA230 + ldr r3, _080CA2B0 + ldr r0, [r3] + movs r1, 0x89 + lsls r1, 6 + adds r0, r1 + ldr r2, [r0] + cmp r2, 0 + beq _080CA2AC + ldrb r0, [r2, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, [r3] + movs r0, 0x89 + lsls r0, 6 + adds r1, r0 + ldr r2, [r1] + movs r0, 0xA + strh r0, [r2, 0x2E] + ldr r2, [r1] + movs r0, 0x1 + strh r0, [r2, 0x30] + ldr r2, [r1] + ldr r0, _080CA2B4 + str r0, [r2, 0x1C] + ldr r0, [r1] + ldrh r0, [r0, 0x2E] + lsls r1, r0, 12 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set +_080CA2AC: + pop {r0} + bx r0 + .align 2, 0 +_080CA2B0: .4byte 0x02039d08 +_080CA2B4: .4byte BoxSetMosaic2 + 1 + thumb_func_end BoxSetMosaic + + thumb_func_start sub_80CA2B8 +sub_80CA2B8: @ 80CA2B8 + ldr r0, _080CA2CC + ldr r0, [r0] + movs r1, 0x89 + lsls r1, 6 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 27 + lsrs r0, 31 + bx lr + .align 2, 0 +_080CA2CC: .4byte 0x02039d08 + thumb_func_end sub_80CA2B8 + + thumb_func_start BoxSetMosaic2 +BoxSetMosaic2: @ 80CA2D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bge _080CA2E6 + movs r0, 0 + strh r0, [r4, 0x2E] +_080CA2E6: + ldrh r0, [r4, 0x2E] + lsls r1, r0, 12 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080CA30E + ldrb r0, [r4, 0x1] + movs r1, 0x11 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x1] + ldr r0, _080CA314 + str r0, [r4, 0x1C] +_080CA30E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CA314: .4byte nullsub_12 + 1 + thumb_func_end BoxSetMosaic2 + + thumb_func_start sub_80CA318 +sub_80CA318: @ 80CA318 + push {r4-r7,lr} + sub sp, 0x28 + ldr r0, _080CA3AC + mov r12, r0 + ldr r1, [r0] + ldr r4, _080CA3B0 + adds r0, r1, r4 + str r0, [sp, 0x18] + add r3, sp, 0x18 + movs r0, 0x82 + lsls r0, 10 + str r0, [r3, 0x4] + ldr r5, _080CA3B4 + adds r1, r5 + str r1, [sp, 0x20] + ldr r0, _080CA3B8 + add r2, sp, 0x20 + str r0, [r2, 0x4] + mov r1, sp + ldr r0, _080CA3BC + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + movs r6, 0 + adds r7, r2, 0 + mov r5, r12 + movs r2, 0 + ldr r1, _080CA3C0 +_080CA352: + ldr r0, [r5] + adds r0, r4 + adds r0, r6 + strb r2, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r1 + bls _080CA352 + movs r6, 0 + ldr r5, _080CA3AC + ldr r4, _080CA3B4 + movs r2, 0 +_080CA36C: + ldr r0, [r5] + lsls r1, r6, 1 + adds r0, r4 + adds r0, r1 + strh r2, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0xF + bls _080CA36C + ldr r0, _080CA3AC + ldr r0, [r0] + movs r6, 0x89 + lsls r6, 6 + adds r0, r6 + movs r1, 0 + str r1, [r0] + adds r0, r3, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080CA420 + adds r0, r7, 0 + bl gpu_pal_obj_alloc_tag_and_apply + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _080CA420 + b _080CA40C + .align 2, 0 +_080CA3AC: .4byte 0x02039d08 +_080CA3B0: .4byte 0x000022c4 +_080CA3B4: .4byte 0x00002244 +_080CA3B8: .4byte 0x0000dac6 +_080CA3BC: .4byte 0x08572754 +_080CA3C0: .4byte 0x000007ff +_080CA3C4: + ldr r0, _080CA3F8 + ldr r2, [r0] + movs r7, 0x89 + lsls r7, 6 + adds r3, r2, r7 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080CA3FC + adds r0, r1 + str r0, [r3] + lsls r0, r4, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldr r3, _080CA400 + adds r1, r2, r3 + strh r0, [r1] + ldr r6, _080CA404 + adds r2, r6 + lsls r0, r5, 5 + ldr r7, _080CA408 + adds r0, r7 + str r0, [r2] + b _080CA420 + .align 2, 0 +_080CA3F8: .4byte 0x02039d08 +_080CA3FC: .4byte 0x02020630 +_080CA400: .4byte 0x0000223a +_080CA404: .4byte 0x0000223c +_080CA408: .4byte 0x06010000 +_080CA40C: + mov r0, sp + movs r1, 0x28 + movs r2, 0x30 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + bne _080CA3C4 +_080CA420: + ldr r0, _080CA444 + ldr r0, [r0] + movs r1, 0x89 + lsls r1, 6 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _080CA43C + movs r0, 0x2 + bl gpu_tile_obj_free_by_tag + ldr r0, _080CA448 + bl gpu_pal_free_tag +_080CA43C: + add sp, 0x28 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CA444: .4byte 0x02039d08 +_080CA448: .4byte 0x0000dac6 + thumb_func_end sub_80CA318 + + thumb_func_start sub_80CA44C +sub_80CA44C: @ 80CA44C + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r1, 0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r6, _080CA4C8 + ldr r2, [r6] + movs r7, 0x89 + lsls r7, 6 + adds r0, r2, r7 + ldr r0, [r0] + cmp r0, 0 + beq _080CA4F2 + cmp r4, 0 + beq _080CA4E8 + lsls r0, r4, 3 + ldr r1, _080CA4CC + adds r0, r1 + ldr r5, _080CA4D0 + adds r1, r2, r5 + movs r2, 0x1 + str r2, [sp] + adds r2, r4, 0 + bl sub_8034654 + ldr r1, [r6] + ldr r2, _080CA4D4 + adds r0, r1, r2 + ldr r0, [r0] + ldr r4, _080CA4D8 + adds r1, r4 + bl LZ77UnCompWram + ldr r0, [r6] + adds r5, r0, r5 + ldr r1, _080CA4DC + adds r0, r1 + ldr r1, [r0] + ldr r2, _080CA4E0 + adds r0, r5, 0 + bl CpuSet + ldr r0, [r6] + adds r4, r0, r4 + ldr r2, _080CA4E4 + adds r0, r2 + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r6] + adds r0, r7 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _080CA4F2 + .align 2, 0 +_080CA4C8: .4byte 0x02039d08 +_080CA4CC: .4byte 0x0830a18c +_080CA4D0: .4byte 0x000022c4 +_080CA4D4: .4byte 0x00000cdc +_080CA4D8: .4byte 0x00002244 +_080CA4DC: .4byte 0x0000223c +_080CA4E0: .4byte 0x04000200 +_080CA4E4: .4byte 0x0000223a +_080CA4E8: + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080CA4F2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80CA44C + + thumb_func_start sub_80CA4FC +sub_80CA4FC: @ 80CA4FC + push {r4-r6,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r6, _080CA574 + ldr r2, [r6] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + beq _080CA588 + ldr r0, _080CA578 + adds r2, r0 + movs r4, 0 + str r4, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r1, _080CA57C + adds r2, r1 + movs r0, 0xF + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r0, _080CA580 + adds r2, r0 + movs r0, 0x1D + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0xA + bl Print + ldr r2, [r6] + ldr r1, _080CA584 + adds r2, r1 + movs r0, 0x2B + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0x6 + bl Print + b _080CA5E8 + .align 2, 0 +_080CA574: .4byte 0x02039d08 +_080CA578: .4byte 0x00000cf9 +_080CA57C: .4byte 0x00000d1d +_080CA580: .4byte 0x00000d41 +_080CA584: .4byte 0x00000d65 +_080CA588: + ldr r0, _080CA624 + adds r2, r0 + movs r4, 0 + str r4, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r1, _080CA628 + adds r2, r1 + movs r0, 0xD + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r0, _080CA62C + adds r2, r0 + movs r0, 0x1C + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r1, _080CA630 + adds r2, r1 + movs r0, 0x2A + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0xA + bl Print +_080CA5E8: + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + ldr r4, _080CA634 + ldr r1, [r4] + ldr r2, _080CA638 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + beq _080CA640 + adds r2, 0x7 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0xB5 + adds r1, r2 + ldr r1, [r1] + bl sub_8120084 + ldr r0, [r4] + ldr r1, _080CA63C + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + b _080CA64E + .align 2, 0 +_080CA624: .4byte 0x00000d65 +_080CA628: .4byte 0x00000cf9 +_080CA62C: .4byte 0x00000d1d +_080CA630: .4byte 0x00000d41 +_080CA634: .4byte 0x02039d08 +_080CA638: .4byte 0x00000ce4 +_080CA63C: .4byte 0x00000d94 +_080CA640: + ldr r2, _080CA658 + adds r0, r1, r2 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 +_080CA64E: + strb r0, [r1] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CA658: .4byte 0x00000d94 + thumb_func_end sub_80CA4FC + + thumb_func_start sub_80CA65C +sub_80CA65C: @ 80CA65C + push {r4,lr} + sub sp, 0x4 + ldr r0, _080CA6A8 + ldr r0, [r0] + ldr r1, _080CA6AC + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080CA6B4 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x8 + bl sub_80D27AC + movs r4, 0 +_080CA680: + ldr r0, _080CA6A8 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _080CA6B0 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 1 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start_if_different + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CA680 + b _080CA6E6 + .align 2, 0 +_080CA6A8: .4byte 0x02039d08 +_080CA6AC: .4byte 0x00000ce4 +_080CA6B0: .4byte 0x00000d98 +_080CA6B4: + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x8 + bl sub_80D27AC + movs r4, 0 +_080CA6C6: + ldr r0, _080CA6FC + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _080CA700 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 25 + lsrs r1, 24 + bl obj_anim_image_start + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CA6C6 +_080CA6E6: + movs r0, 0 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CA6FC: .4byte 0x02039d08 +_080CA700: .4byte 0x00000d98 + thumb_func_end sub_80CA65C + + thumb_func_start sub_80CA704 +sub_80CA704: @ 80CA704 + push {r4,lr} + sub sp, 0x4 + ldr r0, _080CA77C + ldr r4, _080CA780 + ldr r1, [r4] + adds r1, 0xB0 + bl LZ77UnCompWram + ldr r0, _080CA784 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r2, [r4] + adds r2, 0xB0 + movs r0, 0x16 + str r0, [sp] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0xC + bl sub_80D2644 + ldr r2, _080CA788 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x9 + bl sub_80D2644 + movs r0, 0x1 + movs r1, 0xA + movs r2, 0 + bl sub_80D2770 + movs r0, 0x2 + movs r1, 0x15 + movs r2, 0 + bl sub_80D2770 + bl sub_80CAA74 + ldr r0, _080CA78C + ldrb r0, [r0] + cmp r0, 0 + beq _080CA790 + movs r0, 0x1 + bl sub_80CA984 + movs r0, 0x1 + bl sub_80CB7E8 + movs r0, 0x2 + bl sub_80D2918 + movs r0, 0x1 + bl sub_80D2918 + b _080CA7B2 + .align 2, 0 +_080CA77C: .4byte 0x08dd36c8 +_080CA780: .4byte 0x02039d08 +_080CA784: .4byte 0x08dd36a8 +_080CA788: .4byte 0x0857245c +_080CA78C: .4byte 0x02039d0c +_080CA790: + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x14 + movs r3, 0xC + bl sub_80D27AC + movs r0, 0x1 + bl sub_80CA984 + movs r0, 0x1 + bl sub_80D2918 + movs r0, 0x2 + bl sub_80D2918 +_080CA7B2: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _080CA7CC + ldr r0, [r0] + ldr r1, _080CA7D0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CA7CC: .4byte 0x02039d08 +_080CA7D0: .4byte 0x000002c7 + thumb_func_end sub_80CA704 + + thumb_func_start sub_80CA7D4 +sub_80CA7D4: @ 80CA7D4 + push {lr} + ldr r0, _080CA800 + ldr r1, [r0] + movs r0, 0xB0 + lsls r0, 2 + adds r2, r1, r0 + movs r3, 0 + movs r0, 0x14 + strh r0, [r2] + ldr r0, _080CA804 + adds r2, r1, r0 + movs r0, 0x2 + strh r0, [r2] + ldr r0, _080CA808 + adds r1, r0 + strb r3, [r1] + movs r0, 0 + bl sub_80CB7E8 + pop {r0} + bx r0 + .align 2, 0 +_080CA800: .4byte 0x02039d08 +_080CA804: .4byte 0x000002c2 +_080CA808: .4byte 0x000002c5 + thumb_func_end sub_80CA7D4 + + thumb_func_start sub_80CA80C +sub_80CA80C: @ 80CA80C + push {r4,lr} + ldr r4, _080CA868 + ldr r2, [r4] + ldr r1, _080CA86C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x14 + beq _080CA87A + movs r0, 0xB0 + lsls r0, 2 + adds r1, r2, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldr r0, _080CA870 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_80D27F4 + movs r0, 0x1 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x8 + bl sub_80CBAF0 + ldr r1, [r4] + ldr r0, _080CA86C + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x14 + beq _080CA874 + movs r0, 0x1 + b _080CA87C + .align 2, 0 +_080CA868: .4byte 0x02039d08 +_080CA86C: .4byte 0x000002c5 +_080CA870: .4byte 0x000002c2 +_080CA874: + ldr r1, _080CA884 + movs r0, 0x1 + strb r0, [r1] +_080CA87A: + movs r0, 0 +_080CA87C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080CA884: .4byte 0x02039d0c + thumb_func_end sub_80CA80C + + thumb_func_start sub_80CA888 +sub_80CA888: @ 80CA888 + push {r4,lr} + ldr r4, _080CA8BC + ldr r1, [r4] + movs r0, 0xB0 + lsls r0, 2 + adds r2, r1, r0 + movs r3, 0 + movs r0, 0 + strh r0, [r2] + ldr r0, _080CA8C0 + adds r2, r1, r0 + movs r0, 0x16 + strh r0, [r2] + ldr r0, _080CA8C4 + adds r1, r0 + strb r3, [r1] + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CA8B4 + bl sub_80D11CC +_080CA8B4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CA8BC: .4byte 0x02039d08 +_080CA8C0: .4byte 0x000002c2 +_080CA8C4: .4byte 0x000002c5 + thumb_func_end sub_80CA888 + + thumb_func_start sub_80CA8C8 +sub_80CA8C8: @ 80CA8C8 + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, _080CA940 + ldr r2, [r5] + ldr r1, _080CA944 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x14 + beq _080CA974 + movs r0, 0xB0 + lsls r0, 2 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r4, _080CA948 + adds r1, r2, r4 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + movs r1, 0x3 + bl sub_80D27F4 + movs r0, 0x1 + bl sub_80D2918 + movs r1, 0x80 + lsls r1, 1 + ldr r0, [r5] + adds r0, r4 + ldrb r3, [r0] + movs r0, 0xC + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r2, 0xA + bl bg_fill_tilemap_rect + movs r0, 0x8 + negs r0, r0 + bl sub_80CBAF0 + ldr r1, [r5] + ldr r0, _080CA944 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x14 + beq _080CA94C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + b _080CA976 + .align 2, 0 +_080CA940: .4byte 0x02039d08 +_080CA944: .4byte 0x000002c5 +_080CA948: .4byte 0x000002c2 +_080CA94C: + ldr r0, _080CA980 + movs r1, 0 + strb r1, [r0] + bl sub_80CBB9C + bl party_compaction + movs r0, 0x2 + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x9 + bl sub_80D27AC + movs r0, 0x2 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_080CA974: + movs r0, 0 +_080CA976: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080CA980: .4byte 0x02039d0c + thumb_func_end sub_80CA8C8 + + thumb_func_start sub_80CA984 +sub_80CA984: @ 80CA984 + push {lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + beq _080CA99E + movs r0, 0x2 + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x9 + bl sub_80D27AC + b _080CA9AC +_080CA99E: + movs r0, 0x2 + str r0, [sp] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x9 + bl sub_80D27AC +_080CA9AC: + movs r0, 0x2 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80CA984 + + thumb_func_start sub_80CA9C0 +sub_80CA9C0: @ 80CA9C0 + ldr r2, _080CA9E0 + ldr r0, [r2] + ldr r1, _080CA9E4 + adds r0, r1 + movs r3, 0x1 + strb r3, [r0] + ldr r0, [r2] + adds r1, 0x1 + adds r0, r1 + movs r1, 0x1E + strb r1, [r0] + ldr r0, [r2] + ldr r1, _080CA9E8 + adds r0, r1 + strb r3, [r0] + bx lr + .align 2, 0 +_080CA9E0: .4byte 0x02039d08 +_080CA9E4: .4byte 0x000002c7 +_080CA9E8: .4byte 0x000002c9 + thumb_func_end sub_80CA9C0 + + thumb_func_start sub_80CA9EC +sub_80CA9EC: @ 80CA9EC + push {lr} + ldr r0, _080CAA0C + ldr r0, [r0] + ldr r2, _080CAA10 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080CAA06 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + bl sub_80CA984 +_080CAA06: + pop {r0} + bx r0 + .align 2, 0 +_080CAA0C: .4byte 0x02039d08 +_080CAA10: .4byte 0x000002c7 + thumb_func_end sub_80CA9EC + + thumb_func_start sub_80CAA14 +sub_80CAA14: @ 80CAA14 + push {r4,lr} + ldr r3, _080CAA68 + ldr r1, [r3] + ldr r2, _080CAA6C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080CAA60 + movs r0, 0xB2 + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1E + bls _080CAA60 + ldr r0, [r3] + movs r1, 0xB2 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + movs r2, 0 + ldr r4, _080CAA70 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0 + bne _080CAA54 + movs r2, 0x1 +_080CAA54: + strb r2, [r1] + ldr r0, [r3] + adds r0, r4 + ldrb r0, [r0] + bl sub_80CA984 +_080CAA60: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CAA68: .4byte 0x02039d08 +_080CAA6C: .4byte 0x000002c7 +_080CAA70: .4byte 0x000002c9 + thumb_func_end sub_80CAA14 + + thumb_func_start sub_80CAA74 +sub_80CAA74: @ 80CAA74 + push {r4,lr} + movs r4, 0x1 +_080CAA78: + movs r0, 0x64 + muls r0, r4 + ldr r1, _080CAAA4 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + adds r0, r4, 0 + bl sub_80CAAA8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080CAA78 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CAAA4: .4byte 0x020244ec + thumb_func_end sub_80CAA74 + + thumb_func_start sub_80CAAA8 +sub_80CAAA8: @ 80CAAA8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r7, _080CAB14 + cmp r1, 0 + beq _080CAAB8 + ldr r7, _080CAB18 +_080CAAB8: + subs r0, 0x1 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 18 + movs r1, 0xE0 + lsls r1, 11 + adds r0, r1 + lsrs r3, r0, 16 + movs r0, 0 + ldr r1, _080CAB1C + mov r12, r1 +_080CAAD4: + movs r2, 0 + adds r4, r7, 0 + adds r4, 0x8 + adds r5, r3, 0 + adds r5, 0xC + adds r6, r0, 0x1 +_080CAAE0: + mov r0, r12 + ldr r1, [r0] + adds r0, r3, r2 + lsls r0, 1 + adds r1, 0xB0 + adds r1, r0 + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3 + bls _080CAAE0 + adds r7, r4, 0 + lsls r0, r5, 16 + lsrs r3, r0, 16 + lsls r0, r6, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080CAAD4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CAB14: .4byte 0x085724bc +_080CAB18: .4byte 0x085724a4 +_080CAB1C: .4byte 0x02039d08 + thumb_func_end sub_80CAAA8 + + thumb_func_start sub_80CAB20 +sub_80CAB20: @ 80CAB20 + push {lr} + sub sp, 0x4 + bl sub_80CAA74 + movs r0, 0x16 + str r0, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xC + bl sub_80D27AC + movs r0, 0x1 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80CAB20 + + thumb_func_start sub_80CAB4C +sub_80CAB4C: @ 80CAB4C + push {lr} + ldr r0, _080CAB68 + ldr r0, [r0] + ldr r1, _080CAB6C + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r0, 0x6 + bl audio_play + bl sub_80CA7D4 + pop {r0} + bx r0 + .align 2, 0 +_080CAB68: .4byte 0x02039d08 +_080CAB6C: .4byte 0x000002c6 + thumb_func_end sub_80CAB4C + + thumb_func_start sub_80CAB70 +sub_80CAB70: @ 80CAB70 + push {r4,r5,lr} + ldr r4, _080CAB8C + ldr r0, [r4] + ldr r5, _080CAB90 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CABAA + cmp r0, 0x1 + bgt _080CAB94 + cmp r0, 0 + beq _080CAB9A + b _080CABD8 + .align 2, 0 +_080CAB8C: .4byte 0x02039d08 +_080CAB90: .4byte 0x000002c6 +_080CAB94: + cmp r0, 0x2 + beq _080CABD4 + b _080CABD8 +_080CAB9A: + bl sub_80CA80C + lsls r0, 24 + cmp r0, 0 + bne _080CABD8 + bl sub_80CDBA0 + b _080CABC4 +_080CABAA: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + bne _080CABD8 + ldr r0, [r4] + ldr r1, _080CABD0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080CABC4 + bl BoxSetMosaic +_080CABC4: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CABD8 + .align 2, 0 +_080CABD0: .4byte 0x00000cea +_080CABD4: + movs r0, 0 + b _080CABDA +_080CABD8: + movs r0, 0x1 +_080CABDA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CAB70 + + thumb_func_start sub_80CABE0 +sub_80CABE0: @ 80CABE0 + push {r4,lr} + ldr r4, _080CAC10 + bl get_preferred_box + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _080CAC0A + ldr r0, _080CAC14 + bl flag_clear + ldr r4, _080CAC18 + bl get_preferred_box + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl var_set +_080CAC0A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CAC10: .4byte 0x02039d10 +_080CAC14: .4byte 0x000008d7 +_080CAC18: .4byte 0x00004036 + thumb_func_end sub_80CABE0 + + thumb_func_start sub_80CAC1C +sub_80CAC1C: @ 80CAC1C + push {lr} + sub sp, 0xC + movs r1, 0xE8 + lsls r1, 5 + movs r0, 0x8 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_80CAC1C + + thumb_func_start sub_80CAC58 +sub_80CAC58: @ 80CAC58 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81AFBF0 + ldr r1, _080CAC7C + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0, 0x4] + cmp r0, 0x7 + bhi _080CAD30 + lsls r0, 2 + ldr r1, _080CAC80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CAC7C: .4byte 0x0857276c +_080CAC80: .4byte _080CAC84 + .align 2, 0 +_080CAC84: + .4byte _080CAD30 + .4byte _080CACA4 + .4byte _080CACA4 + .4byte _080CACA4 + .4byte _080CACB8 + .4byte _080CACB8 + .4byte _080CACB8 + .4byte _080CACD0 +_080CACA4: + ldr r0, _080CACB0 + ldr r1, [r0] + ldr r0, _080CACB4 + adds r1, r0 + b _080CACC0 + .align 2, 0 +_080CACB0: .4byte 0x02039d08 +_080CACB4: .4byte 0x00000cee +_080CACB8: + ldr r0, _080CACC8 + ldr r1, [r0] + ldr r2, _080CACCC + adds r1, r2 +_080CACC0: + movs r0, 0 + bl sub_81AFC0C + b _080CAD30 + .align 2, 0 +_080CACC8: .4byte 0x02039d08 +_080CACCC: .4byte 0x000021e0 +_080CACD0: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080CACF4 + ldr r0, _080CACEC + ldr r4, [r0] + ldr r0, _080CACF0 + adds r4, r0 + bl sub_80D12B8 + adds r1, r0, 0 + adds r0, r4, 0 + b _080CAD00 + .align 2, 0 +_080CACEC: .4byte 0x02039d08 +_080CACF0: .4byte 0x000021eb +_080CACF4: + ldr r0, _080CAD08 + ldr r1, [r0] + ldr r2, _080CAD0C + adds r0, r1, r2 + ldr r2, _080CAD10 + adds r1, r2 +_080CAD00: + bl gf_strcpy + adds r2, r0, 0 + b _080CAD16 + .align 2, 0 +_080CAD08: .4byte 0x02039d08 +_080CAD0C: .4byte 0x000021eb +_080CAD10: .4byte 0x00000d65 +_080CAD14: + adds r2, r1, 0 +_080CAD16: + subs r1, r2, 0x1 + ldrb r0, [r1] + cmp r0, 0 + beq _080CAD14 + movs r0, 0xFF + strb r0, [r2] + ldr r0, _080CAD8C + ldr r1, [r0] + ldr r0, _080CAD90 + adds r1, r0 + movs r0, 0 + bl sub_81AFC0C +_080CAD30: + ldr r5, _080CAD8C + ldr r0, [r5] + ldr r4, _080CAD94 + adds r0, r4 + ldr r2, _080CAD98 + lsls r1, r6, 3 + adds r1, r2 + ldr r1, [r1] + bl sub_81AFC28 + movs r0, 0x1 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, [r5] + adds r2, r4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CAD8C: .4byte 0x02039d08 +_080CAD90: .4byte 0x000021eb +_080CAD94: .4byte 0x00002190 +_080CAD98: .4byte 0x0857276c + thumb_func_end sub_80CAC58 + + thumb_func_start sub_80CAD9C +sub_80CAD9C: @ 80CAD9C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080CADC0 + movs r1, 0xB + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl MoveMenuCursorNoWrapAround + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CADC0: .4byte 0x08572864 + thumb_func_end sub_80CAD9C + + thumb_func_start sub_80CADC4 +sub_80CADC4: @ 80CADC4 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_80CADC4 + + thumb_func_start sub_80CADD8 +sub_80CADD8: @ 80CADD8 + push {lr} + bl sub_80CFEF0 + movs r0, 0x12 + bl sub_80CFF34 + movs r0, 0x13 + bl sub_80CFF34 + movs r0, 0x14 + bl sub_80CFF34 + movs r0, 0x15 + bl sub_80CFF34 + bl sub_80D2494 + cmp r0, 0 + beq _080CAE04 + movs r0, 0x16 + bl sub_80CFF34 +_080CAE04: + bl sub_80CFFD0 + pop {r0} + bx r0 + thumb_func_end sub_80CADD8 + + thumb_func_start sub_80CAE0C +sub_80CAE0C: @ 80CAE0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80CFEF0 + cmp r4, 0x1 + beq _080CAE4A + cmp r4, 0x1 + bgt _080CAE26 + cmp r4, 0 + beq _080CAE30 + b _080CAE96 +_080CAE26: + cmp r5, 0x2 + beq _080CAE64 + cmp r5, 0x3 + beq _080CAE7E + b _080CAE96 +_080CAE30: + movs r0, 0x17 + bl sub_80CFF34 + movs r0, 0x18 + bl sub_80CFF34 + movs r0, 0x19 + bl sub_80CFF34 + movs r0, 0x1A + bl sub_80CFF34 + b _080CAE96 +_080CAE4A: + movs r0, 0x1B + bl sub_80CFF34 + movs r0, 0x1C + bl sub_80CFF34 + movs r0, 0x1D + bl sub_80CFF34 + movs r0, 0x1E + bl sub_80CFF34 + b _080CAE96 +_080CAE64: + movs r0, 0x1F + bl sub_80CFF34 + movs r0, 0x20 + bl sub_80CFF34 + movs r0, 0x21 + bl sub_80CFF34 + movs r0, 0x22 + bl sub_80CFF34 + b _080CAE96 +_080CAE7E: + movs r0, 0x23 + bl sub_80CFF34 + movs r0, 0x24 + bl sub_80CFF34 + movs r0, 0x25 + bl sub_80CFF34 + movs r0, 0x26 + bl sub_80CFF34 +_080CAE96: + bl sub_80CFFD0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80CAE0C + + thumb_func_start sub_80CAEA0 +sub_80CAEA0: @ 80CAEA0 + ldr r0, _080CAEA8 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080CAEA8: .4byte 0x02039d0d + thumb_func_end sub_80CAEA0 + + thumb_func_start sub_80CAEAC +sub_80CAEAC: @ 80CAEAC + push {lr} + bl sub_80CEADC + lsls r0, 24 + cmp r0, 0 + bne _080CAEE8 + ldr r0, _080CAED4 + ldrb r0, [r0] + cmp r0, 0 + beq _080CAED8 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_80D0D8C + b _080CAEE8 + .align 2, 0 +_080CAED4: .4byte 0x02039d0c +_080CAED8: + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80D0D8C +_080CAEE8: + ldr r1, _080CAF00 + ldrh r0, [r1] + cmp r0, 0 + beq _080CAEFA + bl sub_80D0F38 + movs r0, 0x3 + bl sub_80CFE54 +_080CAEFA: + pop {r0} + bx r0 + .align 2, 0 +_080CAF00: .4byte 0x02039d12 + thumb_func_end sub_80CAEAC + + thumb_func_start sub_80CAF04 +sub_80CAF04: @ 80CAF04 + push {r4-r6,lr} + bl sub_80D2F04 + movs r2, 0 + ldr r3, _080CAF94 + ldr r5, _080CAF98 + movs r4, 0 + adds r6, r3, 0 +_080CAF14: + ldr r0, [r3] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x27 + bls _080CAF14 + movs r2, 0 + ldr r5, _080CAF94 + ldr r4, _080CAF9C + movs r3, 0 +_080CAF30: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x27 + bls _080CAF30 + movs r2, 0 + ldr r5, _080CAF94 + movs r4, 0xA7 + lsls r4, 4 + movs r3, 0 +_080CAF4E: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + str r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _080CAF4E + movs r2, 0 + ldr r5, _080CAF94 + ldr r4, _080CAFA0 + movs r3, 0 +_080CAF6A: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + str r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1D + bls _080CAF6A + ldr r0, [r6] + ldr r2, _080CAFA4 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r1, _080CAFA8 + adds r0, r1 + strh r2, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CAF94: .4byte 0x02039d08 +_080CAF98: .4byte 0x00000b08 +_080CAF9C: .4byte 0x00000b58 +_080CAFA0: .4byte 0x00000a88 +_080CAFA4: .4byte 0x00000a6c +_080CAFA8: .4byte 0x0000078c + thumb_func_end sub_80CAF04 + + thumb_func_start sub_80CAFAC +sub_80CAFAC: @ 80CAFAC + push {lr} + bl sub_80CEB24 + lsls r0, 24 + movs r1, 0x1 + cmp r0, 0 + beq _080CAFBC + movs r1, 0x2 +_080CAFBC: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80CAFAC + + thumb_func_start sub_80CAFC4 +sub_80CAFC4: @ 80CAFC4 + push {r4-r6,lr} + sub sp, 0x8 + ldr r5, _080CB018 + ldr r0, [r5] + ldr r4, _080CB01C + adds r0, r4 + movs r1, 0 + bl pokemon_getattr + adds r6, r0, 0 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x41 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_80CAFAC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_80CC230 + ldr r1, [r5] + ldr r2, _080CB020 + adds r1, r2 + str r0, [r1] + ldr r1, _080CB024 + str r1, [r0, 0x1C] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CB018: .4byte 0x02039d08 +_080CB01C: .4byte 0x000020a4 +_080CB020: .4byte 0x00000a6c +_080CB024: .4byte sub_80CC100 + 1 + thumb_func_end sub_80CAFC4 + + thumb_func_start sub_80CB028 +sub_80CB028: @ 80CB028 + 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 r9, r0 + movs r0, 0 + mov r8, r0 + movs r6, 0 + movs r7, 0 +_080CB042: + movs r5, 0 + adds r1, r7, 0x1 + mov r10, r1 +_080CB048: + mov r0, r9 + adds r1, r6, 0 + movs r2, 0x41 + bl get_pokemon_data_from_any_box + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080CB0B0 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + bl get_pokemon_data_from_any_box + adds r1, r0, 0 + lsls r2, r5, 1 + adds r2, r5 + lsls r2, 19 + movs r3, 0xC8 + lsls r3, 15 + adds r2, r3 + asrs r2, 16 + lsls r3, r7, 1 + adds r3, r7 + lsls r3, 19 + movs r0, 0xB0 + lsls r0, 14 + adds r3, r0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x13 + subs r0, r5 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + adds r0, r4, 0 + asrs r3, 16 + bl sub_80CC230 + ldr r1, _080CB0A8 + ldr r1, [r1] + mov r3, r8 + lsls r2, r3, 2 + ldr r3, _080CB0AC + adds r1, r3 + adds r1, r2 + str r0, [r1] + b _080CB0C0 + .align 2, 0 +_080CB0A8: .4byte 0x02039d08 +_080CB0AC: .4byte 0x00000a88 +_080CB0B0: + ldr r0, _080CB138 + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + ldr r3, _080CB13C + adds r0, r3 + adds r0, r1 + str r4, [r0] +_080CB0C0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CB048 + mov r1, r10 + lsls r0, r1, 16 + lsrs r7, r0, 16 + cmp r7, 0x4 + bls _080CB042 + ldr r0, _080CB138 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CB126 + movs r6, 0 + movs r2, 0xD + negs r2, r2 + adds r4, r2, 0 +_080CB0F6: + mov r0, r9 + adds r1, r6, 0 + movs r2, 0xC + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _080CB11C + ldr r0, _080CB138 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r3, _080CB13C + adds r0, r3 + adds r0, r1 + ldr r2, [r0] + ldrb r0, [r2, 0x1] + ands r0, r4 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x1] +_080CB11C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1D + bls _080CB0F6 +_080CB126: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB138: .4byte 0x02039d08 +_080CB13C: .4byte 0x00000a88 + thumb_func_end sub_80CB028 + + thumb_func_start sub_80CB140 +sub_80CB140: @ 80CB140 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + movs r1, 0x41 + bl get_pokemon_data_from_selected_box + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0 + beq _080CB1DA + adds r0, r7, 0 + movs r1, 0x6 + bl __umodsi3 + adds r6, r0, 0 + lsls r0, r6, 24 + lsrs r0, 24 + lsls r5, r0, 1 + adds r5, r0 + lsls r5, 19 + movs r0, 0xC8 + lsls r0, 15 + adds r5, r0 + lsrs r5, 16 + adds r0, r7, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 19 + movs r0, 0xB0 + lsls r0, 14 + adds r4, r0 + lsrs r4, 16 + adds r0, r7, 0 + movs r1, 0 + bl get_pokemon_data_from_selected_box + adds r1, r0, 0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x13 + subs r0, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r8 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80CC230 + adds r3, r0, 0 + ldr r0, _080CB1E8 + ldr r2, [r0] + lsls r1, r7, 2 + ldr r4, _080CB1EC + adds r0, r2, r4 + adds r0, r1 + str r3, [r0] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + bne _080CB1DA + ldrb r0, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r3, 0x1] +_080CB1DA: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB1E8: .4byte 0x02039d08 +_080CB1EC: .4byte 0x00000a88 + thumb_func_end sub_80CB140 + + thumb_func_start sub_80CB1F0 +sub_80CB1F0: @ 80CB1F0 + push {r4-r7,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r7, _080CB228 + ldr r6, _080CB22C + movs r5, 0x1 + ldr r4, _080CB230 +_080CB200: + ldr r0, [r7] + lsls r1, r2, 2 + adds r0, r6 + adds r1, r0, r1 + ldr r0, [r1] + cmp r0, 0 + beq _080CB218 + strh r3, [r0, 0x32] + ldr r0, [r1] + strh r5, [r0, 0x36] + ldr r0, [r1] + str r4, [r0, 0x1C] +_080CB218: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1D + bls _080CB200 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB228: .4byte 0x02039d08 +_080CB22C: .4byte 0x00000a88 +_080CB230: .4byte sub_80CB278 + 1 + thumb_func_end sub_80CB1F0 + + thumb_func_start sub_80CB234 +sub_80CB234: @ 80CB234 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x30] + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CB250 + subs r0, r1, 0x1 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + b _080CB266 +_080CB250: + ldr r0, _080CB26C + ldr r1, [r0] + ldr r3, _080CB270 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrh r0, [r2, 0x34] + strh r0, [r2, 0x20] + ldr r0, _080CB274 + str r0, [r2, 0x1C] +_080CB266: + pop {r0} + bx r0 + .align 2, 0 +_080CB26C: .4byte 0x02039d08 +_080CB270: .4byte 0x00000c66 +_080CB274: .4byte nullsub_12 + 1 + thumb_func_end sub_80CB234 + + thumb_func_start sub_80CB278 +sub_80CB278: @ 80CB278 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x36] + movs r3, 0x36 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CB28C + subs r0, r1, 0x1 + strh r0, [r2, 0x36] + b _080CB2A8 +_080CB28C: + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x38] + subs r0, 0x45 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB6 + bls _080CB2A8 + ldr r0, _080CB2AC + str r0, [r2, 0x1C] +_080CB2A8: + pop {r0} + bx r0 + .align 2, 0 +_080CB2AC: .4byte nullsub_12 + 1 + thumb_func_end sub_80CB278 + + thumb_func_start sub_80CB2B0 +sub_80CB2B0: @ 80CB2B0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r7, _080CB2F0 +_080CB2BA: + ldr r0, [r7] + lsls r4, r5, 2 + ldr r1, _080CB2F4 + adds r0, r1 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CB2DA + bl sub_80CC314 + ldr r0, [r7] + ldr r1, _080CB2F4 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CB2DA: + adds r0, r5, 0x6 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x4 + bls _080CB2BA + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB2F0: .4byte 0x02039d08 +_080CB2F4: .4byte 0x00000a88 + thumb_func_end sub_80CB2B0 + + thumb_func_start sub_80CB2F8 +sub_80CB2F8: @ 80CB2F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x8] + lsls r2, 16 + movs r1, 0x2C + mov r8, r1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 19 + movs r3, 0xC8 + lsls r3, 15 + adds r1, r3 + lsrs r1, 16 + str r1, [sp, 0x10] + ldr r1, [sp, 0x8] + adds r1, 0x1 + lsrs r6, r2, 16 + str r6, [sp, 0xC] + asrs r2, 16 + muls r1, r2 + ldr r2, [sp, 0x10] + subs r1, r2, r1 + lsls r1, 16 + lsrs r2, r1, 16 + movs r1, 0x13 + subs r1, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + movs r3, 0 + mov r9, r3 + adds r5, r0, 0 + ldr r1, _080CB3DC + ldr r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + beq _080CB3F0 + movs r7, 0x4 + lsls r2, 16 + mov r10, r2 +_080CB358: + ldr r6, _080CB3DC + ldr r2, [r6] + lsls r0, r5, 1 + ldr r3, _080CB3E0 + adds r1, r2, r3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080CB3C2 + lsls r4, r5, 2 + ldr r6, _080CB3E4 + adds r1, r2, r6 + adds r1, r4 + ldr r1, [r1] + mov r2, r8 + lsls r3, r2, 16 + asrs r3, 16 + movs r2, 0x2 + str r2, [sp] + ldr r6, [sp, 0x14] + str r6, [sp, 0x4] + mov r6, r10 + asrs r2, r6, 16 + bl sub_80CC230 + adds r2, r0, 0 + ldr r1, _080CB3DC + ldr r0, [r1] + ldr r3, _080CB3E8 + adds r0, r3 + adds r1, r0, r4 + str r2, [r1] + cmp r2, 0 + beq _080CB3C2 + mov r6, sp + ldrh r6, [r6, 0x8] + strh r6, [r2, 0x30] + ldr r0, [r1] + mov r2, sp + ldrh r2, [r2, 0xC] + strh r2, [r0, 0x32] + ldr r0, [r1] + mov r3, sp + ldrh r3, [r3, 0x10] + strh r3, [r0, 0x34] + ldr r1, [r1] + ldr r0, _080CB3EC + str r0, [r1, 0x1C] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080CB3C2: + adds r0, r5, 0x6 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + adds r0, 0x18 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + subs r7, 0x1 + cmp r7, 0 + bge _080CB358 + b _080CB4A6 + .align 2, 0 +_080CB3DC: .4byte 0x02039d08 +_080CB3E0: .4byte 0x00000ba8 +_080CB3E4: .4byte 0x00000be4 +_080CB3E8: .4byte 0x00000a88 +_080CB3EC: .4byte sub_80CB234 + 1 +_080CB3F0: + mov r10, r1 + movs r7, 0x4 + lsls r2, 16 + str r2, [sp, 0x18] +_080CB3F8: + mov r6, r10 + ldr r2, [r6] + lsls r0, r5, 1 + ldr r3, _080CB4B8 + adds r1, r2, r3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080CB490 + lsls r4, r5, 2 + ldr r6, _080CB4BC + adds r1, r2, r6 + adds r1, r4 + ldr r1, [r1] + mov r2, r8 + lsls r3, r2, 16 + asrs r3, 16 + movs r2, 0x2 + str r2, [sp] + ldr r6, [sp, 0x14] + str r6, [sp, 0x4] + ldr r6, [sp, 0x18] + asrs r2, r6, 16 + bl sub_80CC230 + adds r2, r0, 0 + mov r0, r10 + ldr r3, [r0] + ldr r1, _080CB4C0 + adds r0, r3, r1 + adds r1, r0, r4 + str r2, [r1] + cmp r2, 0 + beq _080CB490 + mov r6, sp + ldrh r6, [r6, 0x8] + strh r6, [r2, 0x30] + ldr r0, [r1] + mov r2, sp + ldrh r2, [r2, 0xC] + strh r2, [r0, 0x32] + ldr r0, [r1] + mov r6, sp + ldrh r6, [r6, 0x10] + strh r6, [r0, 0x34] + ldr r1, [r1] + ldr r0, _080CB4C4 + str r0, [r1, 0x1C] + ldr r1, _080CB4C8 + adds r0, r3, r1 + ldrb r0, [r0] + adds r1, r5, 0 + movs r2, 0xC + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _080CB486 + mov r2, r10 + ldr r0, [r2] + ldr r3, _080CB4C0 + adds r0, r3 + adds r0, r4 + ldr r2, [r0] + ldrb r1, [r2, 0x1] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r2, 0x1] +_080CB486: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080CB490: + adds r0, r5, 0x6 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + adds r0, 0x18 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + subs r7, 0x1 + cmp r7, 0 + bge _080CB3F8 +_080CB4A6: + mov r0, r9 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080CB4B8: .4byte 0x00000ba8 +_080CB4BC: .4byte 0x00000be4 +_080CB4C0: .4byte 0x00000a88 +_080CB4C4: .4byte sub_80CB234 + 1 +_080CB4C8: .4byte 0x00000c5c + thumb_func_end sub_80CB2F8 + + thumb_func_start sub_80CB4CC +sub_80CB4CC: @ 80CB4CC + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _080CB52C + ldr r1, [r6] + ldr r2, _080CB530 + adds r1, r2 + movs r5, 0 + strb r5, [r1] + ldr r1, [r6] + ldr r3, _080CB534 + adds r1, r3 + strb r0, [r1] + ldr r1, [r6] + ldr r7, _080CB538 + adds r1, r7 + strb r4, [r1] + ldr r3, [r6] + movs r1, 0xC6 + lsls r1, 4 + adds r2, r3, r1 + movs r1, 0x20 + strh r1, [r2] + lsls r4, 24 + asrs r4, 24 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 1 + negs r1, r1 + subs r7, 0x5 + adds r2, r3, r7 + strh r1, [r2] + ldr r1, _080CB53C + adds r3, r1 + strh r5, [r3] + bl sub_80CB6F0 + cmp r4, 0 + ble _080CB544 + ldr r0, [r6] + ldr r2, _080CB540 + adds r0, r2 + movs r1, 0 + b _080CB54C + .align 2, 0 +_080CB52C: .4byte 0x02039d08 +_080CB530: .4byte 0x00000c6a +_080CB534: .4byte 0x00000c6b +_080CB538: .4byte 0x00000c69 +_080CB53C: .4byte 0x00000c66 +_080CB540: .4byte 0x00000c68 +_080CB544: + ldr r0, [r6] + ldr r3, _080CB578 + adds r0, r3 + movs r1, 0x5 +_080CB54C: + strb r1, [r0] + ldr r0, _080CB57C + ldr r2, [r0] + ldr r7, _080CB578 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x64 + ldr r3, _080CB580 + adds r1, r2, r3 + strh r0, [r1] + subs r7, 0x4 + adds r2, r7 + movs r1, 0 + ldrsh r0, [r2, r1] + bl sub_80CB1F0 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB578: .4byte 0x00000c68 +_080CB57C: .4byte 0x02039d08 +_080CB580: .4byte 0x00000c62 + thumb_func_end sub_80CB4CC + + thumb_func_start sub_80CB584 +sub_80CB584: @ 80CB584 + push {r4-r6,lr} + ldr r5, _080CB5B0 + ldr r0, [r5] + movs r4, 0xC6 + lsls r4, 4 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _080CB59A + subs r0, 0x1 + strh r0, [r1] +_080CB59A: + ldr r3, [r5] + ldr r6, _080CB5B4 + adds r0, r3, r6 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CB61C + cmp r0, 0x1 + bgt _080CB5B8 + cmp r0, 0 + beq _080CB5C0 + b _080CB6DE + .align 2, 0 +_080CB5B0: .4byte 0x02039d08 +_080CB5B4: .4byte 0x00000c6a +_080CB5B8: + cmp r0, 0x2 + bne _080CB5BE + b _080CB6CC +_080CB5BE: + b _080CB6DE +_080CB5C0: + ldr r0, _080CB60C + adds r1, r3, r0 + ldr r2, _080CB610 + adds r0, r3, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + subs r0, 0x41 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBA + bhi _080CB5DC + b _080CB6E8 +_080CB5DC: + ldr r1, _080CB614 + adds r0, r3, r1 + ldrb r0, [r0] + bl sub_80CB2B0 + ldr r2, [r5] + ldr r0, _080CB60C + adds r3, r2, r0 + ldr r1, _080CB618 + adds r0, r2, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + adds r2, r6 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _080CB6E8 + .align 2, 0 +_080CB60C: .4byte 0x00000c62 +_080CB610: .4byte 0x00000c64 +_080CB614: .4byte 0x00000c68 +_080CB618: .4byte 0x00000c69 +_080CB61C: + ldr r2, _080CB680 + adds r1, r3, r2 + ldr r6, _080CB684 + adds r2, r3, r6 + ldrh r0, [r2] + ldrh r6, [r1] + adds r0, r6 + strh r0, [r1] + ldr r6, _080CB688 + adds r0, r3, r6 + ldrb r0, [r0] + adds r1, r3, r4 + ldrh r1, [r1] + movs r3, 0 + ldrsh r2, [r2, r3] + bl sub_80CB2F8 + ldr r2, [r5] + ldr r3, _080CB68C + adds r1, r2, r3 + lsls r0, 24 + lsrs r0, 24 + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + ldr r1, _080CB690 + adds r0, r2, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + cmp r1, 0 + ble _080CB662 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0x5 + beq _080CB66E +_080CB662: + cmp r1, 0 + bge _080CB69C + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _080CB69C +_080CB66E: + ldr r0, _080CB694 + ldr r1, [r0] + ldr r2, _080CB698 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CB6E8 + .align 2, 0 +_080CB680: .4byte 0x00000c62 +_080CB684: .4byte 0x00000c64 +_080CB688: .4byte 0x00000c68 +_080CB68C: .4byte 0x00000c66 +_080CB690: .4byte 0x00000c69 +_080CB694: .4byte 0x02039d08 +_080CB698: .4byte 0x00000c6a +_080CB69C: + ldr r3, _080CB6BC + ldr r0, [r3] + ldr r6, _080CB6C0 + adds r1, r0, r6 + ldr r2, _080CB6C4 + adds r0, r2 + ldrb r0, [r0] + ldrb r6, [r1] + adds r0, r6 + movs r2, 0 + strb r0, [r1] + ldr r0, [r3] + ldr r1, _080CB6C8 + adds r0, r1 + strb r2, [r0] + b _080CB6E8 + .align 2, 0 +_080CB6BC: .4byte 0x02039d08 +_080CB6C0: .4byte 0x00000c68 +_080CB6C4: .4byte 0x00000c69 +_080CB6C8: .4byte 0x00000c6a +_080CB6CC: + ldr r2, _080CB6E4 + adds r0, r3, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _080CB6E8 + adds r1, r3, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080CB6DE: + movs r0, 0 + b _080CB6EA + .align 2, 0 +_080CB6E4: .4byte 0x00000c66 +_080CB6E8: + movs r0, 0x1 +_080CB6EA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80CB584 + + thumb_func_start sub_80CB6F0 +sub_80CB6F0: @ 80CB6F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 + ldr r1, _080CB768 + mov r9, r1 +_080CB704: + adds r0, 0x1 + mov r8, r0 + movs r7, 0x5 +_080CB70A: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x41 + bl get_pokemon_data_from_any_box + mov r2, r9 + ldr r1, [r2] + lsls r2, r5, 1 + ldr r3, _080CB76C + adds r1, r3 + adds r1, r2 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080CB744 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + bl get_pokemon_data_from_any_box + mov r2, r9 + ldr r1, [r2] + lsls r2, r5, 2 + ldr r3, _080CB770 + adds r1, r3 + adds r1, r2 + str r0, [r1] +_080CB744: + adds r5, 0x1 + subs r7, 0x1 + cmp r7, 0 + bge _080CB70A + mov r0, r8 + cmp r0, 0x4 + ble _080CB704 + ldr r0, _080CB768 + ldr r0, [r0] + ldr r1, _080CB774 + adds r0, r1 + strb r6, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB768: .4byte 0x02039d08 +_080CB76C: .4byte 0x00000ba8 +_080CB770: .4byte 0x00000be4 +_080CB774: .4byte 0x00000c5c + thumb_func_end sub_80CB6F0 + + thumb_func_start sub_80CB778 +sub_80CB778: @ 80CB778 + push {r4,r5,lr} + lsls r0, 24 + ldr r5, _080CB7A4 + ldr r1, [r5] + lsrs r4, r0, 22 + ldr r0, _080CB7A8 + adds r1, r0 + adds r1, r4 + ldr r0, [r1] + cmp r0, 0 + beq _080CB79E + bl sub_80CC314 + ldr r0, [r5] + ldr r1, _080CB7A8 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CB79E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CB7A4: .4byte 0x02039d08 +_080CB7A8: .4byte 0x00000a88 + thumb_func_end sub_80CB778 + + thumb_func_start sub_80CB7AC +sub_80CB7AC: @ 80CB7AC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r1, _080CB7E0 + ldr r1, [r1] + lsrs r0, 22 + ldr r3, _080CB7E4 + adds r1, r3 + adds r1, r0 + ldr r3, [r1] + cmp r3, 0 + beq _080CB7DA + movs r0, 0x3 + adds r1, r2, 0 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] +_080CB7DA: + pop {r0} + bx r0 + .align 2, 0 +_080CB7E0: .4byte 0x02039d08 +_080CB7E4: .4byte 0x00000a88 + thumb_func_end sub_80CB7AC + + thumb_func_start sub_80CB7E8 +sub_80CB7E8: @ 80CB7E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, _080CB88C + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x68 + movs r3, 0x40 + bl sub_80CC230 + ldr r1, _080CB890 + ldr r1, [r1] + movs r2, 0xA7 + lsls r2, 4 + adds r1, r2 + str r0, [r1] + movs r7, 0x1 + movs r6, 0x1 +_080CB830: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, _080CB88C + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080CB894 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + subs r0, r6, 0x1 + lsls r3, r0, 1 + adds r3, r0 + lsls r3, 19 + movs r0, 0x80 + lsls r0, 13 + adds r3, r0 + asrs r3, 16 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x98 + bl sub_80CC230 + ldr r1, _080CB890 + ldr r1, [r1] + lsls r2, r6, 2 + movs r3, 0xA7 + lsls r3, 4 + adds r1, r3 + adds r1, r2 + str r0, [r1] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + b _080CB8A4 + .align 2, 0 +_080CB88C: .4byte 0x020244ec +_080CB890: .4byte 0x02039d08 +_080CB894: + ldr r0, _080CB948 + ldr r0, [r0] + lsls r1, r6, 2 + movs r2, 0xA7 + lsls r2, 4 + adds r0, r2 + adds r0, r1 + str r5, [r0] +_080CB8A4: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CB830 + ldr r3, _080CB948 + mov r0, r8 + cmp r0, 0 + bne _080CB8EA + movs r6, 0 + cmp r6, r7 + bcs _080CB8EA + mov r12, r3 + movs r5, 0xA7 + lsls r5, 4 + movs r4, 0x4 +_080CB8C4: + mov r2, r12 + ldr r1, [r2] + lsls r0, r6, 2 + adds r1, r5 + adds r1, r0 + ldr r2, [r1] + ldrh r0, [r2, 0x22] + subs r0, 0xA0 + strh r0, [r2, 0x22] + ldr r1, [r1] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + bcc _080CB8C4 +_080CB8EA: + ldr r0, [r3] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CB93C + movs r6, 0 + adds r7, r3, 0 + movs r5, 0xA7 + lsls r5, 4 +_080CB8FA: + ldr r0, [r7] + lsls r4, r6, 2 + adds r0, r5 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CB932 + movs r0, 0x64 + muls r0, r6 + ldr r1, _080CB94C + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + bne _080CB932 + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + ldr r2, [r0] + 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] +_080CB932: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CB8FA +_080CB93C: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB948: .4byte 0x02039d08 +_080CB94C: .4byte 0x020244ec + thumb_func_end sub_80CB7E8 + + thumb_func_start sub_80CB950 +sub_80CB950: @ 80CB950 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, _080CB9B4 + ldr r1, [r0] + ldr r2, _080CB9B8 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + movs r5, 0 + movs r6, 0 + adds r3, r0, 0 + movs r7, 0xA7 + lsls r7, 4 +_080CB96A: + ldr r0, [r3] + lsls r4, r5, 2 + adds r0, r7 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CB9A0 + cmp r5, r6 + beq _080CB99A + adds r1, r6, 0 + str r3, [sp] + bl sub_80CB9D0 + ldr r3, [sp] + ldr r2, [r3] + adds r0, r2, r7 + adds r0, r4 + movs r1, 0 + str r1, [r0] + ldr r0, _080CB9B8 + adds r2, r0 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_080CB99A: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080CB9A0: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CB96A + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CB9B4: .4byte 0x02039d08 +_080CB9B8: .4byte 0x00000c5e + thumb_func_end sub_80CB950 + + thumb_func_start sub_80CB9BC +sub_80CB9BC: @ 80CB9BC + ldr r0, _080CB9C8 + ldr r0, [r0] + ldr r1, _080CB9CC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080CB9C8: .4byte 0x02039d08 +_080CB9CC: .4byte 0x00000c5e + thumb_func_end sub_80CB9BC + + thumb_func_start sub_80CB9D0 +sub_80CB9D0: @ 80CB9D0 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + strh r1, [r2, 0x30] + cmp r1, 0 + bne _080CB9E4 + movs r3, 0x68 + movs r4, 0x40 + b _080CB9F6 +_080CB9E4: + movs r3, 0x98 + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 19 + movs r1, 0x80 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 +_080CB9F6: + ldrh r0, [r2, 0x20] + lsls r0, 3 + strh r0, [r2, 0x32] + ldrh r0, [r2, 0x22] + lsls r0, 3 + strh r0, [r2, 0x34] + lsls r1, r3, 3 + movs r3, 0x32 + ldrsh r0, [r2, r3] + subs r0, r1, r0 + cmp r0, 0 + bge _080CBA10 + adds r0, 0x7 +_080CBA10: + asrs r0, 3 + strh r0, [r2, 0x36] + lsls r0, r4, 16 + asrs r0, 13 + movs r3, 0x34 + ldrsh r1, [r2, r3] + subs r0, r1 + cmp r0, 0 + bge _080CBA24 + adds r0, 0x7 +_080CBA24: + asrs r0, 3 + strh r0, [r2, 0x38] + movs r0, 0x8 + strh r0, [r2, 0x3A] + ldr r0, _080CBA38 + str r0, [r2, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CBA38: .4byte sub_80CBA3C + 1 + thumb_func_end sub_80CB9D0 + + thumb_func_start sub_80CBA3C +sub_80CBA3C: @ 80CBA3C + push {r4,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x3A] + movs r1, 0x3A + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080CBA6C + ldrh r0, [r3, 0x36] + ldrh r4, [r3, 0x32] + adds r0, r4 + strh r0, [r3, 0x32] + ldrh r1, [r3, 0x38] + ldrh r4, [r3, 0x34] + adds r1, r4 + strh r1, [r3, 0x34] + lsls r0, 16 + asrs r0, 19 + strh r0, [r3, 0x20] + lsls r1, 16 + asrs r1, 19 + strh r1, [r3, 0x22] + subs r0, r2, 0x1 + strh r0, [r3, 0x3A] + b _080CBAB2 +_080CBA6C: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080CBA7C + movs r0, 0x68 + strh r0, [r3, 0x20] + movs r0, 0x40 + b _080CBA8E +_080CBA7C: + movs r0, 0x98 + strh r0, [r3, 0x20] + movs r4, 0x30 + ldrsh r1, [r3, r4] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x10 +_080CBA8E: + strh r0, [r3, 0x22] + ldr r0, _080CBAB8 + str r0, [r3, 0x1C] + ldr r0, _080CBABC + ldr r2, [r0] + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r1, 2 + movs r4, 0xA7 + lsls r4, 4 + adds r0, r2, r4 + adds r0, r1 + str r3, [r0] + ldr r0, _080CBAC0 + adds r2, r0 + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] +_080CBAB2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CBAB8: .4byte nullsub_12 + 1 +_080CBABC: .4byte 0x02039d08 +_080CBAC0: .4byte 0x00000c5e + thumb_func_end sub_80CBA3C + + thumb_func_start sub_80CBAC4 +sub_80CBAC4: @ 80CBAC4 + push {r4,lr} + ldr r4, _080CBAE8 + ldr r0, [r4] + ldr r1, _080CBAEC + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080CBAE2 + bl sub_80CC314 + ldr r0, [r4] + ldr r1, _080CBAEC + adds r0, r1 + movs r1, 0 + str r1, [r0] +_080CBAE2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CBAE8: .4byte 0x02039d08 +_080CBAEC: .4byte 0x00000a6c + thumb_func_end sub_80CBAC4 + + thumb_func_start sub_80CBAF0 +sub_80CBAF0: @ 80CBAF0 + push {r4-r6,lr} + movs r3, 0 + ldr r6, _080CBB48 + lsls r0, 16 + asrs r4, r0, 16 + movs r5, 0x5 + negs r5, r5 +_080CBAFE: + ldr r0, [r6] + lsls r1, r3, 2 + movs r2, 0xA7 + lsls r2, 4 + adds r0, r2 + adds r2, r0, r1 + ldr r1, [r2] + cmp r1, 0 + beq _080CBB56 + ldrh r0, [r1, 0x22] + adds r0, r4, r0 + strh r0, [r1, 0x22] + ldr r2, [r2] + ldrh r1, [r2, 0x26] + ldrh r0, [r2, 0x22] + adds r1, r0 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 13 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0xC0 + bls _080CBB4C + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _080CBB56 + .align 2, 0 +_080CBB48: .4byte 0x02039d08 +_080CBB4C: + adds r2, 0x3E + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] +_080CBB56: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _080CBAFE + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CBAF0 + + thumb_func_start sub_80CBB68 +sub_80CBB68: @ 80CBB68 + push {r4,r5,lr} + lsls r0, 24 + ldr r5, _080CBB98 + ldr r1, [r5] + lsrs r4, r0, 22 + movs r0, 0xA7 + lsls r0, 4 + adds r1, r0 + adds r1, r4 + ldr r0, [r1] + cmp r0, 0 + beq _080CBB92 + bl sub_80CC314 + ldr r0, [r5] + movs r1, 0xA7 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CBB92: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CBB98: .4byte 0x02039d08 + thumb_func_end sub_80CBB68 + + thumb_func_start sub_80CBB9C +sub_80CBB9C: @ 80CBB9C + push {r4-r6,lr} + movs r5, 0 + ldr r6, _080CBBD8 +_080CBBA2: + ldr r0, [r6] + lsls r4, r5, 2 + movs r1, 0xA7 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CBBC6 + bl sub_80CC314 + ldr r0, [r6] + movs r1, 0xA7 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CBBC6: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CBBA2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CBBD8: .4byte 0x02039d08 + thumb_func_end sub_80CBB9C + + thumb_func_start sub_80CBBDC +sub_80CBBDC: @ 80CBBDC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r1, _080CBC10 + ldr r1, [r1] + lsrs r0, 22 + movs r3, 0xA7 + lsls r3, 4 + adds r1, r3 + adds r1, r0 + ldr r3, [r1] + cmp r3, 0 + beq _080CBC0C + movs r0, 0x3 + adds r1, r2, 0 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] +_080CBC0C: + pop {r0} + bx r0 + .align 2, 0 +_080CBC10: .4byte 0x02039d08 + thumb_func_end sub_80CBBDC + + thumb_func_start sub_80CBC14 +sub_80CBC14: @ 80CBC14 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + cmp r4, 0 + bne _080CBC44 + ldr r3, _080CBC3C + ldr r0, [r3] + ldr r5, _080CBC40 + adds r2, r0, r5 + lsls r1, 2 + adds r5, 0x4 + adds r0, r5 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + str r4, [r0] + b _080CBC60 + .align 2, 0 +_080CBC3C: .4byte 0x02039d08 +_080CBC40: .4byte 0x00000a6c +_080CBC44: + cmp r4, 0x1 + bne _080CBC96 + ldr r3, _080CBC9C + ldr r0, [r3] + ldr r1, _080CBCA0 + adds r2, r0, r1 + lsls r1, r5, 2 + ldr r4, _080CBCA4 + adds r0, r4 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + movs r1, 0 + str r1, [r0] +_080CBC60: + adds r5, r3, 0 + ldr r0, [r5] + ldr r4, _080CBCA0 + adds r0, r4 + ldr r1, [r0] + ldr r0, _080CBCA8 + str r0, [r1, 0x1C] + bl sub_80CAFAC + ldr r1, [r5] + adds r1, r4 + ldr r3, [r1] + movs r1, 0x3 + 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] + ldr r0, [r5] + adds r0, r4 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x7 + strb r1, [r0] +_080CBC96: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CBC9C: .4byte 0x02039d08 +_080CBCA0: .4byte 0x00000a6c +_080CBCA4: .4byte 0x00000a88 +_080CBCA8: .4byte sub_80CC100 + 1 + thumb_func_end sub_80CBC14 + + thumb_func_start sub_80CBCAC +sub_80CBCAC: @ 80CBCAC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r0, 0xE + bne _080CBCF8 + ldr r3, _080CBCF0 + ldr r1, [r3] + lsls r5, r6, 2 + movs r4, 0xA7 + lsls r4, 4 + adds r0, r1, r4 + adds r0, r5 + ldr r2, _080CBCF4 + adds r1, r2 + ldr r2, [r1] + str r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r3] + adds r0, r4 + adds r0, r5 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0xC + strb r1, [r0] + b _080CBD34 + .align 2, 0 +_080CBCF0: .4byte 0x02039d08 +_080CBCF4: .4byte 0x00000a6c +_080CBCF8: + ldr r5, _080CBD4C + ldr r1, [r5] + lsls r4, r6, 2 + ldr r3, _080CBD50 + adds r0, r1, r3 + adds r0, r4 + ldr r2, _080CBD54 + adds r1, r2 + ldr r2, [r1] + str r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r5] + adds r0, r3 + adds r0, r4 + ldr r4, [r0] + adds r0, r6, 0 + movs r1, 0x6 + bl __umodsi3 + movs r1, 0x13 + subs r1, r0 + adds r4, 0x43 + strb r1, [r4] + adds r3, r5, 0 +_080CBD34: + ldr r1, [r3] + ldr r0, _080CBD54 + adds r1, r0 + ldr r2, [r1] + ldr r0, _080CBD58 + str r0, [r2, 0x1C] + movs r0, 0 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CBD4C: .4byte 0x02039d08 +_080CBD50: .4byte 0x00000a88 +_080CBD54: .4byte 0x00000a6c +_080CBD58: .4byte nullsub_12 + 1 + thumb_func_end sub_80CBCAC + + thumb_func_start sub_80CBD5C +sub_80CBD5C: @ 80CBD5C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r0, 0xE + bne _080CBD80 + ldr r3, _080CBD7C + ldr r1, [r3] + movs r0, 0xB0 + lsls r0, 4 + adds r2, r1, r0 + lsls r0, r4, 2 + movs r4, 0xA7 + lsls r4, 4 + b _080CBD8E + .align 2, 0 +_080CBD7C: .4byte 0x02039d08 +_080CBD80: + ldr r3, _080CBDB0 + ldr r1, [r3] + movs r0, 0xB0 + lsls r0, 4 + adds r2, r1, r0 + lsls r0, r4, 2 + ldr r4, _080CBDB4 +_080CBD8E: + adds r0, r4 + adds r1, r0 + str r1, [r2] + ldr r1, [r3] + ldr r2, _080CBDB8 + adds r0, r1, r2 + ldr r2, [r0] + ldr r0, _080CBDBC + str r0, [r2, 0x1C] + ldr r4, _080CBDC0 + adds r1, r4 + movs r0, 0 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CBDB0: .4byte 0x02039d08 +_080CBDB4: .4byte 0x00000a88 +_080CBDB8: .4byte 0x00000a6c +_080CBDBC: .4byte nullsub_12 + 1 +_080CBDC0: .4byte 0x00000c5d + thumb_func_end sub_80CBD5C + + thumb_func_start sub_80CBDC4 +sub_80CBDC4: @ 80CBDC4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r6, _080CBDE0 + ldr r0, [r6] + ldr r1, _080CBDE4 + mov r9, r1 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0x10 + bne _080CBDE8 + movs r0, 0 + b _080CBEF4 + .align 2, 0 +_080CBDE0: .4byte 0x02039d08 +_080CBDE4: .4byte 0x00000c5d +_080CBDE8: + adds r0, 0x1 + strb r0, [r1] + ldr r2, [r6] + ldr r5, _080CBF00 + adds r0, r2, r5 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CBE18 + movs r1, 0xB0 + lsls r1, 4 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r0] + ldrh r0, [r1, 0x22] + subs r0, 0x1 + strh r0, [r1, 0x22] + ldr r5, _080CBF04 + adds r0, r2, r5 + ldr r1, [r0] + ldrh r0, [r1, 0x22] + adds r0, 0x1 + strh r0, [r1, 0x22] +_080CBE18: + ldr r3, [r6] + movs r7, 0xB0 + lsls r7, 4 + adds r4, r3, r7 + ldr r0, [r4] + ldr r0, [r0] + mov r8, r0 + ldr r5, _080CBF08 + mov r0, r9 + adds r1, r3, r0 + ldrb r0, [r1] + lsls r0, 4 + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _080CBE3C + adds r0, 0xF +_080CBE3C: + asrs r0, 4 + mov r2, r8 + strh r0, [r2, 0x24] + ldr r0, _080CBF04 + mov r8, r0 + add r3, r8 + ldr r2, [r3] + ldrb r0, [r1] + lsls r0, 4 + adds r0, r5 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, 0 + bge _080CBE5A + adds r0, 0xF +_080CBE5A: + asrs r0, 4 + negs r0, r0 + strh r0, [r2, 0x24] + ldrb r0, [r1] + cmp r0, 0x8 + bne _080CBEBE + ldr r3, [r3] + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0, 0x5] + movs r5, 0x3 + movs r1, 0xC + ands r1, r0 + ldrb r2, [r3, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r0, [r6] + mov r2, r8 + adds r1, r0, r2 + ldr r1, [r1] + adds r0, r7 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x43 + ldrb r0, [r0] + adds r1, 0x43 + strb r0, [r1] + bl sub_80CAFAC + ldr r1, [r6] + adds r1, r7 + ldr r1, [r1] + ldr r1, [r1] + ands r5, r0 + lsls r5, 2 + ldrb r0, [r1, 0x5] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0x5] + ldr r0, [r6] + adds r0, r7 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x7 + strb r1, [r0] +_080CBEBE: + ldr r1, [r6] + mov r5, r9 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x10 + bne _080CBEF2 + mov r0, r8 + adds r2, r1, r0 + ldr r3, [r2] + adds r1, r7 + ldr r0, [r1] + ldr r0, [r0] + str r0, [r2] + ldr r0, [r1] + str r3, [r0] + ldr r1, [r6] + mov r2, r8 + adds r0, r1, r2 + ldr r2, [r0] + ldr r0, _080CBF0C + str r0, [r2, 0x1C] + adds r1, r7 + ldr r0, [r1] + ldr r1, [r0] + ldr r0, _080CBF10 + str r0, [r1, 0x1C] +_080CBEF2: + movs r0, 0x1 +_080CBEF4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080CBF00: .4byte 0x00000c5d +_080CBF04: .4byte 0x00000a6c +_080CBF08: .4byte 0x08329f40 +_080CBF0C: .4byte sub_80CC100 + 1 +_080CBF10: .4byte nullsub_12 + 1 + thumb_func_end sub_80CBDC4 + + thumb_func_start sub_80CBF14 +sub_80CBF14: @ 80CBF14 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r0, 0x1 + beq _080CBF4C + cmp r0, 0x1 + bgt _080CBF2E + cmp r0, 0 + beq _080CBF34 + b _080CBFC0 +_080CBF2E: + cmp r2, 0x2 + beq _080CBF70 + b _080CBFC0 +_080CBF34: + ldr r3, _080CBF44 + ldr r1, [r3] + ldr r0, _080CBF48 + adds r2, r1, r0 + lsls r0, r4, 2 + movs r4, 0xA7 + lsls r4, 4 + b _080CBF58 + .align 2, 0 +_080CBF44: .4byte 0x02039d08 +_080CBF48: .4byte 0x00000b04 +_080CBF4C: + ldr r3, _080CBF64 + ldr r1, [r3] + ldr r0, _080CBF68 + adds r2, r1, r0 + lsls r0, r4, 2 + ldr r4, _080CBF6C +_080CBF58: + adds r0, r4 + adds r1, r0 + str r1, [r2] + adds r4, r3, 0 + b _080CBF80 + .align 2, 0 +_080CBF64: .4byte 0x02039d08 +_080CBF68: .4byte 0x00000b04 +_080CBF6C: .4byte 0x00000a88 +_080CBF70: + ldr r0, _080CBFC8 + ldr r1, [r0] + ldr r3, _080CBFCC + adds r2, r1, r3 + ldr r4, _080CBFD0 + adds r1, r4 + str r1, [r2] + adds r4, r0, 0 +_080CBF80: + ldr r0, [r4] + ldr r1, _080CBFCC + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _080CBFC0 + bl obj_alloc_rotscale_entry + ldr r0, [r4] + ldr r3, _080CBFCC + adds r0, r3 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, [r4] + adds r1, r3 + ldr r0, [r1] + ldr r2, [r0] + ldr r0, _080CBFD4 + str r0, [r2, 0x10] + ldr r0, [r1] + ldr r0, [r0] + movs r1, 0 + bl sub_8008258 +_080CBFC0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CBFC8: .4byte 0x02039d08 +_080CBFCC: .4byte 0x00000b04 +_080CBFD0: .4byte 0x00000a6c +_080CBFD4: .4byte 0x0857291c + thumb_func_end sub_80CBF14 + + thumb_func_start sub_80CBFD8 +sub_80CBFD8: @ 80CBFD8 + push {lr} + ldr r0, _080CBFFC + ldr r0, [r0] + ldr r1, _080CC000 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0] + cmp r1, 0 + beq _080CBFF8 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _080CC004 +_080CBFF8: + movs r0, 0 + b _080CC01A + .align 2, 0 +_080CBFFC: .4byte 0x02039d08 +_080CC000: .4byte 0x00000b04 +_080CC004: + adds r0, r1, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CC018 + movs r0, 0x4 + orrs r0, r2 + strb r0, [r3] +_080CC018: + movs r0, 0x1 +_080CC01A: + pop {r1} + bx r1 + thumb_func_end sub_80CBFD8 + + thumb_func_start sub_80CC020 +sub_80CC020: @ 80CC020 + push {r4,lr} + ldr r4, _080CC05C + ldr r0, [r4] + ldr r1, _080CC060 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _080CC056 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r0, [r4] + ldr r1, _080CC060 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + bl sub_80CC314 + ldr r0, [r4] + ldr r1, _080CC060 + adds r0, r1 + ldr r1, [r0] + movs r0, 0 + str r0, [r1] +_080CC056: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CC05C: .4byte 0x02039d08 +_080CC060: .4byte 0x00000b04 + thumb_func_end sub_80CC020 + + thumb_func_start sub_80CC064 +sub_80CC064: @ 80CC064 + push {lr} + ldr r3, _080CC098 + ldr r0, [r3] + ldr r1, _080CC09C + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _080CC094 + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r1, _080CC09C + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0x1 + bl sub_8008258 +_080CC094: + pop {r0} + bx r0 + .align 2, 0 +_080CC098: .4byte 0x02039d08 +_080CC09C: .4byte 0x00000b04 + thumb_func_end sub_80CC064 + + thumb_func_start sub_80CC0A0 +sub_80CC0A0: @ 80CC0A0 + push {lr} + ldr r0, _080CC0B4 + ldr r0, [r0] + ldr r1, _080CC0B8 + adds r2, r0, r1 + ldr r0, [r2] + cmp r0, 0 + bne _080CC0BC + movs r0, 0 + b _080CC0D0 + .align 2, 0 +_080CC0B4: .4byte 0x02039d08 +_080CC0B8: .4byte 0x00000b04 +_080CC0BC: + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CC0CE + movs r0, 0 + str r0, [r2] +_080CC0CE: + movs r0, 0x1 +_080CC0D0: + pop {r1} + bx r1 + thumb_func_end sub_80CC0A0 + + thumb_func_start sub_80CC0D4 +sub_80CC0D4: @ 80CC0D4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080CC0F8 + ldr r1, [r1] + ldr r2, _080CC0FC + adds r1, r2 + ldr r3, [r1] + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x5] + bx lr + .align 2, 0 +_080CC0F8: .4byte 0x02039d08 +_080CC0FC: .4byte 0x00000a6c + thumb_func_end sub_80CC0D4 + + thumb_func_start sub_80CC100 +sub_80CC100: @ 80CC100 + ldr r1, _080CC11C + ldr r1, [r1] + ldr r2, _080CC120 + adds r1, r2 + ldr r2, [r1] + ldrh r2, [r2, 0x20] + strh r2, [r0, 0x20] + ldr r2, [r1] + ldrh r1, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r1, r2 + adds r1, 0x4 + strh r1, [r0, 0x22] + bx lr + .align 2, 0 +_080CC11C: .4byte 0x02039d08 +_080CC120: .4byte 0x00000cb4 + thumb_func_end sub_80CC100 + + thumb_func_start sub_80CC124 +sub_80CC124: @ 80CC124 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, _080CC18C + ldr r0, [r1] + ldr r2, _080CC190 + adds r0, r2 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, r3 + beq _080CC158 + adds r6, r2, 0 + ldr r5, _080CC190 +_080CC140: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x27 + bhi _080CC158 + ldr r0, [r6] + lsls r1, r4, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _080CC140 +_080CC158: + cmp r4, 0x28 + bne _080CC198 + movs r4, 0 + ldr r0, [r2] + ldr r5, _080CC190 + adds r0, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _080CC184 + adds r6, r2, 0 +_080CC16C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x27 + bhi _080CC184 + ldr r0, [r6] + lsls r1, r4, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080CC16C +_080CC184: + cmp r4, 0x28 + bne _080CC198 + ldr r0, _080CC194 + b _080CC1CA + .align 2, 0 +_080CC18C: .4byte 0x02039d08 +_080CC190: .4byte 0x00000b58 +_080CC194: .4byte 0x0000ffff +_080CC198: + ldr r1, [r2] + lsls r2, r4, 1 + ldr r5, _080CC1D0 + adds r0, r1, r5 + adds r0, r2 + strh r3, [r0] + ldr r0, _080CC1D4 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r4, 20 + lsrs r4, 16 + adds r0, r3, 0 + movs r1, 0x1 + bl sub_80D3020 + lsls r1, r4, 5 + ldr r2, _080CC1D8 + adds r1, r2 + ldr r2, _080CC1DC + bl CpuSet + adds r0, r4, 0 +_080CC1CA: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080CC1D0: .4byte 0x00000b58 +_080CC1D4: .4byte 0x00000b08 +_080CC1D8: .4byte 0x06010000 +_080CC1DC: .4byte 0x04000080 + thumb_func_end sub_80CC124 + + thumb_func_start sub_80CC1E0 +sub_80CC1E0: @ 80CC1E0 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r6, _080CC214 +_080CC1EA: + ldr r1, [r6] + lsls r2, r3, 1 + ldr r4, _080CC218 + adds r0, r1, r4 + adds r4, r0, r2 + ldrh r0, [r4] + cmp r0, r5 + bne _080CC220 + ldr r0, _080CC21C + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080CC22A + strh r0, [r4] + b _080CC22A + .align 2, 0 +_080CC214: .4byte 0x02039d08 +_080CC218: .4byte 0x00000b58 +_080CC21C: .4byte 0x00000b08 +_080CC220: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x27 + bls _080CC1EA +_080CC22A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CC1E0 + + thumb_func_start sub_80CC230 +sub_80CC230: @ 80CC230 + 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, 16 + lsrs r6, r0, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x18] + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r9, r5 + mov r2, sp + ldr r0, _080CC2E0 + ldm r0!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldm r0!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + adds r0, r6, 0 + bl sub_80D2E08 + mov r10, r0 + mov r6, r10 + mov r2, sp + ldr r1, _080CC2E4 + adds r1, r6, r1 + ldr r3, _080CC2E8 + adds r0, r3, 0 + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2, 0x2] + adds r0, r6, 0 + bl sub_80CC124 + lsls r0, 16 + lsrs r0, 16 + adds r5, r0, 0 + ldr r0, _080CC2EC + cmp r5, r0 + beq _080CC302 + ldr r7, [sp, 0x18] + lsls r1, r7, 16 + asrs r1, 16 + mov r0, r8 + lsls r2, r0, 16 + asrs r2, 16 + mov r0, sp + mov r3, r9 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080CC2FC + ldr r1, _080CC2F0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldr r2, _080CC2F4 + ands r2, r5 + ldrh r3, [r0, 0x4] + ldr r1, _080CC2F8 + ands r1, r3 + orrs r1, r2 + strh r1, [r0, 0x4] + movs r1, 0x3 + ands r4, r1 + lsls r3, r4, 2 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r3 + strb r1, [r0, 0x5] + mov r1, r10 + strh r1, [r0, 0x2E] + b _080CC304 + .align 2, 0 +_080CC2E0: .4byte 0x085728d4 +_080CC2E4: .4byte 0x0857c388 +_080CC2E8: .4byte 0x0000dac0 +_080CC2EC: .4byte 0x0000ffff +_080CC2F0: .4byte 0x02020630 +_080CC2F4: .4byte 0x000003ff +_080CC2F8: .4byte 0xfffffc00 +_080CC2FC: + adds r0, r6, 0 + bl sub_80CC1E0 +_080CC302: + movs r0, 0 +_080CC304: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CC230 + + thumb_func_start sub_80CC314 +sub_80CC314: @ 80CC314 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + bl sub_80CC1E0 + adds r0, r4, 0 + bl obj_delete_and_free_tiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80CC314 + + thumb_func_start sub_80CC32C +sub_80CC32C: @ 80CC32C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080CC354 + movs r1, 0x2 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080CC358 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CC354: .4byte sub_80CC370 + 1 +_080CC358: .4byte 0x03005e00 + thumb_func_end sub_80CC32C + + thumb_func_start sub_80CC35C +sub_80CC35C: @ 80CC35C + push {lr} + ldr r0, _080CC36C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080CC36C: .4byte sub_80CC370 + 1 + thumb_func_end sub_80CC35C + + thumb_func_start sub_80CC370 +sub_80CC370: @ 80CC370 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _080CC394 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _080CC454 + lsls r0, 2 + ldr r1, _080CC398 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CC394: .4byte 0x03005e00 +_080CC398: .4byte _080CC39C + .align 2, 0 +_080CC39C: + .4byte _080CC3B0 + .4byte _080CC3E8 + .4byte _080CC41C + .4byte _080CC426 + .4byte _080CC44C +_080CC3B0: + ldr r1, _080CC3DC + ldr r0, [r1] + ldr r2, _080CC3E0 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + movs r3, 0xB3 + lsls r3, 2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _080CC3E4 + adds r1, r0 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + strh r0, [r4, 0xA] + b _080CC458 + .align 2, 0 +_080CC3DC: .4byte 0x02039d08 +_080CC3E0: .4byte 0x000002d2 +_080CC3E4: .4byte 0x00004ac4 +_080CC3E8: + movs r1, 0xA + ldrsh r0, [r4, r1] + bl dma3_transfer_queue_check_for_space + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080CC45E + ldr r0, _080CC414 + ldr r1, [r0] + ldr r2, _080CC418 + adds r1, r2 + movs r0, 0x2 + bl bg_set_tilemap + movs r0, 0x2 + bl gpu_sync_bg_show + b _080CC458 + .align 2, 0 +_080CC414: .4byte 0x02039d08 +_080CC418: .4byte 0x00004ac4 +_080CC41C: + ldrb r0, [r4, 0xC] + movs r1, 0 + bl sub_80CC7A0 + b _080CC458 +_080CC426: + bl sub_80CCA00 + cmp r0, 0 + beq _080CC45E + ldrb r0, [r4, 0xC] + bl sub_80CCB50 + bl sub_80CD02C + ldrb r0, [r4, 0xC] + bl sub_80CB028 + ldr r1, _080CC448 + movs r0, 0xC + bl lcd_io_set + b _080CC458 + .align 2, 0 +_080CC448: .4byte 0x00005b0a +_080CC44C: + adds r0, r2, 0 + bl remove_task + b _080CC458 +_080CC454: + movs r0, 0 + b _080CC45C +_080CC458: + ldrh r0, [r4, 0x8] + adds r0, 0x1 +_080CC45C: + strh r0, [r4, 0x8] +_080CC45E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80CC370 + + thumb_func_start sub_80CC464 +sub_80CC464: @ 80CC464 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + adds r0, r4, 0 + bl sub_80CC644 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r5, _080CC528 + ldr r2, [r5] + lsls r0, r6, 24 + asrs r3, r0, 24 + movs r0, 0x6 + negs r0, r0 + adds r1, r0, 0 + cmp r3, 0 + ble _080CC490 + movs r1, 0x6 +_080CC490: + ldr r7, _080CC52C + adds r0, r2, r7 + strh r1, [r0] + movs r1, 0x2 + cmp r3, 0 + ble _080CC49E + movs r1, 0x1 +_080CC49E: + ldr r7, _080CC530 + adds r0, r2, r7 + strb r1, [r0] + ldr r2, [r5] + movs r0, 0xB4 + lsls r0, 2 + adds r1, r2, r0 + movs r0, 0x20 + strh r0, [r1] + movs r1, 0xB5 + lsls r1, 2 + adds r0, r2, r1 + strb r4, [r0] + ldr r2, [r5] + movs r1, 0 + cmp r3, 0 + bgt _080CC4C2 + movs r1, 0x5 +_080CC4C2: + ldr r4, _080CC534 + adds r0, r2, r4 + strh r1, [r0] + movs r7, 0xB6 + lsls r7, 2 + adds r0, r2, r7 + strh r3, [r0] + movs r1, 0x38 + cmp r3, 0 + ble _080CC4DC + movs r0, 0x84 + lsls r0, 1 + adds r1, r0, 0 +_080CC4DC: + ldr r4, _080CC538 + adds r0, r2, r4 + strh r1, [r0] + movs r1, 0 + cmp r3, 0 + bgt _080CC4EA + movs r1, 0x5 +_080CC4EA: + movs r7, 0xB7 + lsls r7, 2 + adds r0, r2, r7 + strh r1, [r0] + ldr r0, _080CC53C + adds r1, r2, r0 + movs r0, 0 + strh r0, [r1] + movs r3, 0xB8 + lsls r3, 2 + adds r1, r2, r3 + movs r0, 0x2 + strh r0, [r1] + ldr r4, _080CC540 + adds r0, r2, r4 + mov r7, r8 + strb r7, [r0] + ldr r0, [r5] + ldr r1, _080CC544 + adds r0, r1 + strb r6, [r0] + ldr r0, [r5] + ldr r3, _080CC548 + adds r0, r3 + movs r1, 0 + strb r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CC528: .4byte 0x02039d08 +_080CC52C: .4byte 0x000002ce +_080CC530: .4byte 0x000002d3 +_080CC534: .4byte 0x000002d6 +_080CC538: .4byte 0x000002da +_080CC53C: .4byte 0x000002de +_080CC540: .4byte 0x00000a64 +_080CC544: .4byte 0x00000a65 +_080CC548: .4byte 0x00000a63 + thumb_func_end sub_80CC464 + + thumb_func_start sub_80CC54C +sub_80CC54C: @ 80CC54C + push {r4-r6,lr} + ldr r4, _080CC568 + ldr r1, [r4] + ldr r5, _080CC56C + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CC594 + cmp r0, 0x1 + bgt _080CC570 + cmp r0, 0 + beq _080CC576 + b _080CC624 + .align 2, 0 +_080CC568: .4byte 0x02039d08 +_080CC56C: .4byte 0x00000a63 +_080CC570: + cmp r0, 0x2 + beq _080CC5E4 + b _080CC624 +_080CC576: + ldr r2, _080CC5D8 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl sub_80CC7A0 + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CC594: + bl sub_80CCA00 + cmp r0, 0 + beq _080CC632 + ldr r6, _080CC5DC + ldr r1, [r6] + ldr r4, _080CC5D8 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r5, _080CC5E0 + adds r1, r5 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl sub_80CB4CC + ldr r1, [r6] + adds r4, r1, r4 + ldrb r0, [r4] + adds r1, r5 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl sub_80CCCFC + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80CD0B8 + b _080CC624 + .align 2, 0 +_080CC5D8: .4byte 0x00000a64 +_080CC5DC: .4byte 0x02039d08 +_080CC5E0: .4byte 0x00000a65 +_080CC5E4: + bl sub_80CB584 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, [r4] + movs r4, 0xB4 + lsls r4, 2 + adds r3, r2, r4 + ldrh r0, [r3] + cmp r0, 0 + beq _080CC620 + movs r0, 0xB3 + lsls r0, 2 + adds r1, r2, r0 + subs r4, 0x2 + adds r0, r2, r4 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + ldrh r0, [r3] + subs r0, 0x1 + strh r0, [r3] + lsls r0, 16 + cmp r0, 0 + bne _080CC632 + bl sub_80CCEE0 + bl sub_80CD158 +_080CC620: + adds r0, r5, 0 + b _080CC634 +_080CC624: + ldr r0, _080CC63C + ldr r1, [r0] + ldr r4, _080CC640 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CC632: + movs r0, 0x1 +_080CC634: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080CC63C: .4byte 0x02039d08 +_080CC640: .4byte 0x00000a63 + thumb_func_end sub_80CC54C + + thumb_func_start sub_80CC644 +sub_80CC644: @ 80CC644 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl get_preferred_box + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0 + cmp r1, r4 + beq _080CC66E +_080CC658: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xD + bls _080CC664 + movs r1, 0 +_080CC664: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r1, r4 + bne _080CC658 +_080CC66E: + movs r0, 0x1 + negs r0, r0 + cmp r2, 0x6 + bhi _080CC678 + movs r0, 0x1 +_080CC678: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80CC644 + + thumb_func_start sub_80CC680 +sub_80CC680: @ 80CC680 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80D2120 + ldr r0, _080CC6A8 + ldr r0, [r0] + ldr r1, _080CC6AC + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CC6A8: .4byte 0x02039d08 +_080CC6AC: .4byte 0x00000a62 + thumb_func_end sub_80CC680 + + thumb_func_start sub_80CC6B0 +sub_80CC6B0: @ 80CC6B0 + push {r4,lr} + sub sp, 0x4 + ldr r1, _080CC6D0 + ldr r0, [r1] + ldr r2, _080CC6D4 + adds r0, r2 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _080CC794 + lsls r0, 2 + ldr r1, _080CC6D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CC6D0: .4byte 0x02039d08 +_080CC6D4: .4byte 0x00000a62 +_080CC6D8: .4byte _080CC6DC + .align 2, 0 +_080CC6DC: + .4byte _080CC6F0 + .4byte _080CC718 + .4byte _080CC732 + .4byte _080CC76C + .4byte _080CC790 +_080CC6F0: + ldr r0, [r4] + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080CC710 + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r4] + ldr r2, _080CC714 + adds r1, r2 + b _080CC77E + .align 2, 0 +_080CC710: .4byte 0x0000ffff +_080CC714: .4byte 0x00000a62 +_080CC718: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080CC794 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80CC7A0 + b _080CC776 +_080CC732: + bl sub_80CCA00 + cmp r0, 0x1 + bne _080CC794 + bl sub_80CCF9C + ldr r4, _080CC760 + ldr r0, [r4] + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080CC764 + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, [r4] + ldr r2, _080CC768 + adds r1, r2 + b _080CC77E + .align 2, 0 +_080CC760: .4byte 0x02039d08 +_080CC764: .4byte 0x0000ffff +_080CC768: .4byte 0x00000a62 +_080CC76C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080CC794 +_080CC776: + ldr r0, _080CC788 + ldr r1, [r0] + ldr r0, _080CC78C + adds r1, r0 +_080CC77E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CC794 + .align 2, 0 +_080CC788: .4byte 0x02039d08 +_080CC78C: .4byte 0x00000a62 +_080CC790: + movs r0, 0 + b _080CC796 +_080CC794: + movs r0, 0x1 +_080CC796: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80CC6B0 + + thumb_func_start sub_80CC7A0 +sub_80CC7A0: @ 80CC7A0 + push {r4-r7,lr} + sub sp, 0x8 + ldr r4, _080CC854 + ldr r2, [r4] + ldr r3, _080CC858 + adds r2, r3 + movs r3, 0 + strb r3, [r2] + ldr r2, [r4] + ldr r3, _080CC85C + adds r2, r3 + strb r0, [r2] + ldr r0, [r4] + ldr r2, _080CC860 + adds r0, r2 + strb r1, [r0] + ldr r1, [r4] + adds r2, r1, r2 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _080CC7E6 + movs r3, 0 + ldr r0, _080CC864 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + bne _080CC7DA + movs r3, 0x1 +_080CC7DA: + strb r3, [r2] + ldr r0, [r4] + ldr r1, _080CC868 + adds r0, r1 + bl sub_80CCAE0 +_080CC7E6: + ldr r7, _080CC854 + ldr r0, [r7] + ldr r2, _080CC85C + adds r0, r2 + ldrb r0, [r0] + bl sub_80D20F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _080CC8C4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080CC86C + adds r6, r0, r1 + ldr r0, [r6, 0x4] + ldr r1, [r7] + ldr r5, _080CC870 + adds r1, r5 + bl LZ77UnCompWram + ldr r0, [r7] + adds r5, r0, r5 + ldr r4, _080CC860 + adds r1, r0, r4 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r3, _080CC864 + adds r0, r3 + ldrb r2, [r0] + adds r0, r5, 0 + bl sub_80CCA3C + ldr r1, [r7] + adds r4, r1, r4 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + beq _080CC874 + ldr r0, [r6, 0x8] + ldr r2, _080CC864 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 21 + movs r3, 0x80 + lsls r3, 15 + adds r1, r3 + lsrs r1, 16 + movs r2, 0x40 + bl gpu_pal_apply + b _080CC888 + .align 2, 0 +_080CC854: .4byte 0x02039d08 +_080CC858: .4byte 0x000006f9 +_080CC85C: .4byte 0x000006fa +_080CC860: .4byte 0x000006fb +_080CC864: .4byte 0x000002d2 +_080CC868: .4byte 0x00004ac4 +_080CC86C: .4byte 0x085775b8 +_080CC870: .4byte 0x00000792 +_080CC874: + ldr r0, [r6, 0x8] + ldr r2, _080CC8B4 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, _080CC8B8 + adds r1, r2 + movs r2, 0x20 + bl CpuSet +_080CC888: + ldr r0, [r6] + mov r1, sp + bl malloc_and_decompress + adds r1, r0, 0 + ldr r0, _080CC8BC + ldr r3, [r0] + ldr r2, _080CC8C0 + adds r0, r3, r2 + str r1, [r0] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + ldr r0, _080CC8B4 + adds r3, r0 + ldrb r3, [r3] + lsls r3, 8 + movs r0, 0x2 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _080CC9DA + .align 2, 0 +_080CC8B4: .4byte 0x000002d2 +_080CC8B8: .4byte 0x02037794 +_080CC8BC: .4byte 0x02039d08 +_080CC8C0: .4byte 0x00000a68 +_080CC8C4: + bl sub_80D24A8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, _080CC948 + adds r6, r1, r0 + ldr r0, [r6, 0x4] + ldr r1, [r7] + ldr r4, _080CC94C + adds r1, r4 + bl LZ77UnCompWram + ldr r2, [r7] + adds r0, r2, r4 + ldr r5, _080CC950 + adds r1, r2, r5 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r3, _080CC954 + adds r2, r3 + ldrb r2, [r2] + bl sub_80CCA3C + ldr r0, [r6, 0x8] + ldr r1, [r7] + adds r1, r4 + movs r2, 0x20 + bl CpuSet + bl sub_80D2510 + ldr r1, [r7] + ldr r2, _080CC958 + adds r1, r2 + movs r2, 0x2 + bl CpuSet + bl sub_80D2510 + ldr r1, [r7] + ldr r3, _080CC95C + adds r1, r3 + movs r2, 0x2 + bl CpuSet + ldr r1, [r7] + adds r5, r1, r5 + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + beq _080CC960 + adds r0, r1, r4 + ldr r2, _080CC954 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 21 + movs r3, 0x80 + lsls r3, 15 + adds r1, r3 + lsrs r1, 16 + movs r2, 0x40 + bl gpu_pal_apply + b _080CC976 + .align 2, 0 +_080CC948: .4byte 0x0857af44 +_080CC94C: .4byte 0x00000792 +_080CC950: .4byte 0x000006fb +_080CC954: .4byte 0x000002d2 +_080CC958: .4byte 0x00000794 +_080CC95C: .4byte 0x000007b4 +_080CC960: + ldr r2, _080CC9E8 + adds r0, r1, r2 + ldr r3, _080CC9EC + adds r1, r3 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, _080CC9F0 + adds r1, r2 + movs r2, 0x20 + bl CpuSet +_080CC976: + ldr r0, [r6] + mov r1, sp + bl malloc_and_decompress + ldr r6, _080CC9F4 + ldr r1, [r6] + ldr r5, _080CC9F8 + adds r1, r5 + str r0, [r1] + ldr r4, _080CC9FC + bl sub_80D24DC + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + add r1, sp, 0x4 + bl malloc_and_decompress + adds r4, r0, 0 + ldr r0, [r6] + adds r0, r5 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, [sp, 0x4] + lsls r2, 9 + lsrs r2, 11 + movs r0, 0x80 + lsls r0, 19 + orrs r2, r0 + adds r0, r4, 0 + bl CpuSet + adds r0, r4, 0 + bl free + ldr r0, [r6] + adds r5, r0, r5 + ldr r1, [r5] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + ldr r3, _080CC9EC + adds r0, r3 + ldrb r3, [r0] + lsls r3, 8 + movs r0, 0x2 + bl gpu_copy_bg_tile_pattern_data_to_vram +_080CC9DA: + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CC9E8: .4byte 0x00000792 +_080CC9EC: .4byte 0x000002d2 +_080CC9F0: .4byte 0x02037794 +_080CC9F4: .4byte 0x02039d08 +_080CC9F8: .4byte 0x00000a68 +_080CC9FC: .4byte 0x0857b004 + thumb_func_end sub_80CC7A0 + + thumb_func_start sub_80CCA00 +sub_80CCA00: @ 80CCA00 + push {r4,r5,lr} + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080CCA12 + movs r0, 0 + b _080CCA2E +_080CCA12: + ldr r5, _080CCA34 + ldr r0, [r5] + ldr r1, _080CCA38 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080CCA2C + bl free + ldr r0, [r5] + ldr r1, _080CCA38 + adds r0, r1 + str r4, [r0] +_080CCA2C: + movs r0, 0x1 +_080CCA2E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080CCA34: .4byte 0x02039d08 +_080CCA38: .4byte 0x00000a68 + thumb_func_end sub_80CCA00 + + thumb_func_start sub_80CCA3C +sub_80CCA3C: @ 80CCA3C + push {r4-r7,lr} + sub sp, 0x24 + adds r5, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r4, r2, 17 + ldr r0, _080CCAAC + ldr r0, [r0] + movs r3, 0xB3 + lsls r3, 2 + adds r0, r3 + ldrh r3, [r0] + lsrs r3, 3 + adds r3, 0xA + lsls r1, 24 + asrs r7, r1, 24 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r6, r3, r0 + movs r0, 0x3F + ands r6, r0 + movs r3, 0x14 + str r3, [sp] + movs r1, 0x12 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + str r3, [sp, 0x10] + str r1, [sp, 0x14] + movs r0, 0x11 + str r0, [sp, 0x18] + lsls r2, 24 + asrs r2, 16 + str r2, [sp, 0x1C] + movs r0, 0xC0 + lsls r0, 10 + adds r4, r0 + asrs r4, 16 + str r4, [sp, 0x20] + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect + cmp r7, 0 + beq _080CCAD2 + cmp r7, 0 + ble _080CCAB0 + lsls r0, r6, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + b _080CCAB6 + .align 2, 0 +_080CCAAC: .4byte 0x02039d08 +_080CCAB0: + lsls r0, r6, 16 + ldr r3, _080CCADC + adds r0, r3 +_080CCAB6: + lsrs r6, r0, 16 + lsls r2, r6, 24 + lsrs r2, 24 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x12 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r3, 0x2 + bl Bg_FillWramTileMapRectWithTileAndPalette +_080CCAD2: + add sp, 0x24 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CCADC: .4byte 0xfffc0000 + thumb_func_end sub_80CCA3C + + thumb_func_start sub_80CCAE0 +sub_80CCAE0: @ 80CCAE0 + push {r4-r6,lr} + adds r2, r0, 0 + ldr r0, _080CCB0C + ldr r0, [r0] + movs r1, 0xB3 + lsls r1, 2 + adds r0, r1 + ldrh r0, [r0] + lsrs r0, 3 + adds r3, r0, 0 + adds r3, 0x1E + movs r0, 0x3F + ands r3, r0 + adds r0, r3, 0 + cmp r0, 0x1F + bgt _080CCB10 + lsls r0, 1 + movs r6, 0x98 + lsls r6, 3 + adds r0, r6 + b _080CCB18 + .align 2, 0 +_080CCB0C: .4byte 0x02039d08 +_080CCB10: + lsls r0, 1 + movs r1, 0xC8 + lsls r1, 4 + adds r0, r1 +_080CCB18: + adds r2, r0 + movs r0, 0 + movs r5, 0 + movs r4, 0x3F +_080CCB20: + strh r5, [r2] + adds r2, 0x2 + adds r3, 0x1 + ands r3, r4 + adds r1, r3, 0 + cmp r1, 0 + bne _080CCB32 + ldr r6, _080CCB4C + adds r2, r6 +_080CCB32: + cmp r1, 0x20 + bne _080CCB3C + movs r1, 0xF8 + lsls r1, 3 + adds r2, r1 +_080CCB3C: + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2B + bls _080CCB20 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CCB4C: .4byte 0xfffff7c0 + thumb_func_end sub_80CCAE0 + + thumb_func_start sub_80CCB50 +sub_80CCB50: @ 80CCB50 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _080CCCD0 + mov r10, r1 + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 2 + adds r0, r1, r2 + str r0, [sp, 0x24] + mov r3, sp + adds r3, 0x24 + str r3, [sp, 0x2C] + ldr r0, _080CCCD4 + str r0, [r3, 0x4] + ldr r4, _080CCCD8 + adds r1, r4 + str r1, [sp, 0x14] + add r0, sp, 0x18 + ldr r7, _080CCCDC + strh r7, [r0] + add r0, sp, 0x1C + movs r1, 0 + movs r2, 0x8 + bl memset + add r1, sp, 0x14 + add r0, sp, 0x4 + movs r2, 0x10 + bl memcpy + mov r0, r8 + bl sub_80D20F8 + lsls r0, 24 + mov r5, r10 + ldr r4, [r5] + ldr r2, _080CCCE0 + lsrs r0, 22 + adds r1, r0, r2 + ldrh r3, [r1] + movs r5, 0xE3 + lsls r5, 3 + adds r1, r4, r5 + strh r3, [r1] + adds r2, 0x2 + adds r0, r2 + ldrh r0, [r0] + ldr r1, _080CCCE4 + adds r4, r1 + strh r0, [r4] + add r0, sp, 0x4 + bl gpu_pal_obj_alloc_and_load_multiple + mov r2, r10 + ldr r0, [r2] + movs r6, 0xE7 + lsls r6, 3 + adds r0, r6 + movs r1, 0xFC + lsls r1, 2 + str r1, [r0] + adds r0, r7, 0 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + mov r4, r10 + ldr r3, [r4] + lsls r1, r0, 4 + movs r5, 0x87 + lsls r5, 1 + mov r9, r5 + add r1, r9 + ldr r4, _080CCCE8 + adds r2, r3, r4 + strh r1, [r2] + adds r3, r6 + movs r5, 0x80 + lsls r5, 9 + adds r1, r5, 0 + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r0, r7, 0 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + mov r1, r10 + ldr r4, [r1] + lsls r1, r0, 4 + add r1, r9 + ldr r3, _080CCCEC + adds r2, r4, r3 + strh r1, [r2] + adds r6, r4, r6 + lsls r5, r0 + ldr r0, [r6] + orrs r0, r5 + str r0, [r6] + ldr r5, _080CCCF0 + adds r4, r5 + mov r0, r8 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x8 + bl sub_8009128 + mov r4, r10 + ldr r1, [r4] + adds r5, r1, r5 + movs r0, 0xBE + lsls r0, 2 + adds r1, r0 + movs r0, 0x2 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r0, [sp, 0x2C] + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + mov r0, r8 + bl sav3_get_box_name + bl sub_80CD00C + movs r4, 0 + lsls r0, 16 + asrs r6, r0, 16 +_080CCC70: + lsls r1, r4, 5 + adds r1, r6, r1 + lsls r1, 16 + asrs r1, 16 + ldr r0, _080CCCF4 + movs r2, 0x1C + movs r3, 0x18 + bl obj_add_from_template_forward_search + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r5, _080CCCD0 + ldr r2, [r5] + lsls r0, r4, 2 + movs r3, 0xE4 + lsls r3, 3 + adds r2, r3 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080CCCF8 + adds r0, r1 + str r0, [r2] + lsls r1, r4, 24 + lsrs r1, 24 + bl obj_anim_image_start + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CCC70 + ldr r0, [r5] + movs r4, 0xDF + lsls r4, 3 + adds r0, r4 + movs r1, 0 + strb r1, [r0] + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CCCD0: .4byte 0x02039d08 +_080CCCD4: .4byte 0x00030200 +_080CCCD8: .4byte 0x000006fc +_080CCCDC: .4byte 0x0000dac9 +_080CCCE0: .4byte 0x08577574 +_080CCCE4: .4byte 0x0000071a +_080CCCE8: .4byte 0x0000071c +_080CCCEC: .4byte 0x0000071e +_080CCCF0: .4byte 0x000021b8 +_080CCCF4: .4byte 0x0857b0a8 +_080CCCF8: .4byte 0x02020630 + thumb_func_end sub_80CCB50 + + thumb_func_start sub_80CCCFC +sub_80CCCFC: @ 80CCCFC + 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, 0x28] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r4, _080CCD78 + ldr r2, [r4] + movs r1, 0xBE + lsls r1, 2 + adds r0, r2, r1 + str r0, [sp, 0x1C] + add r3, sp, 0x1C + ldr r5, _080CCD7C + mov r12, r5 + movs r6, 0xC0 + lsls r6, 10 + mov r9, r6 + ldr r0, _080CCD80 + str r0, [r3, 0x4] + add r1, sp, 0x4 + ldr r0, _080CCD84 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + movs r1, 0 + movs r5, 0xDF + lsls r5, 3 + adds r2, r5 + ldrb r0, [r2] + mov r8, r4 + adds r6, r3, 0 + cmp r0, 0 + bne _080CCD50 + movs r1, 0x1 +_080CCD50: + strb r1, [r2] + mov r7, r8 + ldr r0, [r7] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080CCD8C + ldr r0, [r6, 0x4] + mov r1, r12 + ands r0, r1 + mov r3, r9 + orrs r0, r3 + str r0, [r6, 0x4] + ldr r0, [r7] + ldr r5, _080CCD88 + adds r0, r5 + ldrh r0, [r0] + mov r9, r0 + b _080CCDB0 + .align 2, 0 +_080CCD78: .4byte 0x02039d08 +_080CCD7C: .4byte 0x0000ffff +_080CCD80: .4byte 0x00030200 +_080CCD84: .4byte 0x0857b0a8 +_080CCD88: .4byte 0x0000071c +_080CCD8C: + ldr r0, [r6, 0x4] + mov r7, r12 + ands r0, r7 + movs r1, 0x80 + lsls r1, 11 + orrs r0, r1 + str r0, [r6, 0x4] + mov r1, r8 + ldr r0, [r1] + ldr r3, _080CCEC4 + adds r0, r3 + ldrh r0, [r0] + mov r9, r0 + add r1, sp, 0x4 + movs r0, 0x4 + strh r0, [r1] + ldr r0, _080CCEC8 + strh r0, [r1, 0x2] +_080CCDB0: + mov r5, r8 + ldr r4, [r5] + ldr r5, _080CCECC + adds r4, r5 + ldr r0, [sp, 0x28] + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x8 + bl sub_8009128 + mov r7, r8 + ldr r1, [r7] + adds r5, r1, r5 + movs r0, 0xBE + lsls r0, 2 + adds r1, r0 + movs r0, 0x2 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + adds r0, r6, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, [sp, 0x28] + bl sub_80D20F8 + lsls r0, 24 + lsrs r0, 22 + ldr r1, _080CCED0 + adds r0, r1 + mov r1, r9 + movs r2, 0x4 + bl gpu_pal_apply + ldr r0, [sp, 0x28] + bl sav3_get_box_name + bl sub_80CD00C + lsls r0, 16 + mov r1, r10 + lsls r2, r1, 24 + asrs r2, 24 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 6 + lsrs r3, r0, 16 + str r3, [sp, 0x24] + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r7, 0 + mov r9, r8 + negs r2, r2 + mov r8, r2 +_080CCE2E: + lsls r6, r7, 5 + mov r5, r10 + lsls r1, r5, 16 + asrs r1, 16 + adds r1, r6 + lsls r1, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1C + movs r3, 0x18 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + ldr r2, [r1] + lsls r5, r7, 2 + movs r3, 0xE5 + lsls r3, 3 + adds r2, r3 + adds r2, r5 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080CCED4 + adds r1, r0 + str r1, [r2] + mov r0, r8 + lsls r4, r0, 1 + add r4, r8 + lsls r4, 1 + strh r4, [r1, 0x2E] + ldr r1, [r2] + ldr r3, [sp, 0x24] + lsls r0, r3, 16 + asrs r0, 16 + adds r0, r6 + strh r0, [r1, 0x30] + ldr r0, [r2] + movs r6, 0 + strh r6, [r0, 0x32] + ldr r0, [r2] + ldr r1, _080CCED8 + str r1, [r0, 0x1C] + lsls r1, r7, 24 + lsrs r1, 24 + bl obj_anim_image_start + mov r1, r9 + ldr r0, [r1] + movs r3, 0xE4 + lsls r3, 3 + adds r0, r3 + adds r0, r5 + ldr r1, [r0] + strh r4, [r1, 0x2E] + ldr r2, [r0] + movs r1, 0x1 + strh r1, [r2, 0x30] + ldr r1, [r0] + ldr r0, _080CCEDC + str r0, [r1, 0x1C] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + bls _080CCE2E + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CCEC4: .4byte 0x0000071c +_080CCEC8: .4byte 0x0000dac9 +_080CCECC: .4byte 0x000021b8 +_080CCED0: .4byte 0x08577574 +_080CCED4: .4byte 0x02020630 +_080CCED8: .4byte sub_80CCF30 + 1 +_080CCEDC: .4byte sub_80CCF64 + 1 + thumb_func_end sub_80CCCFC + + thumb_func_start sub_80CCEE0 +sub_80CCEE0: @ 80CCEE0 + push {lr} + ldr r0, _080CCEFC + ldr r0, [r0] + movs r1, 0xDF + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080CCF00 + movs r0, 0x4 + bl gpu_tile_obj_free_by_tag + b _080CCF06 + .align 2, 0 +_080CCEFC: .4byte 0x02039d08 +_080CCF00: + movs r0, 0x3 + bl gpu_tile_obj_free_by_tag +_080CCF06: + ldr r0, _080CCF28 + ldr r0, [r0] + movs r3, 0xE4 + lsls r3, 3 + adds r2, r0, r3 + adds r3, 0x8 + adds r1, r0, r3 + ldr r1, [r1] + str r1, [r2] + ldr r2, _080CCF2C + adds r1, r0, r2 + adds r3, 0x4 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080CCF28: .4byte 0x02039d08 +_080CCF2C: .4byte 0x00000724 + thumb_func_end sub_80CCEE0 + + thumb_func_start sub_80CCF30 +sub_80CCF30: @ 80CCF30 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x32] + movs r3, 0x32 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CCF44 + subs r0, r1, 0x1 + strh r0, [r2, 0x32] + b _080CCF5C +_080CCF44: + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x30 + ldrsh r1, [r2, r3] + cmp r0, r1 + bne _080CCF5C + ldr r0, _080CCF60 + str r0, [r2, 0x1C] +_080CCF5C: + pop {r0} + bx r0 + .align 2, 0 +_080CCF60: .4byte nullsub_12 + 1 + thumb_func_end sub_80CCF30 + + thumb_func_start sub_80CCF64 +sub_80CCF64: @ 80CCF64 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x30] + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CCF78 + subs r0, r1, 0x1 + strh r0, [r2, 0x30] + b _080CCF96 +_080CCF78: + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x32] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC0 + bls _080CCF96 + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_080CCF96: + pop {r0} + bx r0 + thumb_func_end sub_80CCF64 + + thumb_func_start sub_80CCF9C +sub_80CCF9C: @ 80CCF9C + push {lr} + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sub_80D20F8 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _080CCFD8 + ldr r2, [r0] + movs r3, 0xDF + lsls r3, 3 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080CCFE4 + lsls r0, r1, 2 + ldr r1, _080CCFDC + adds r0, r1 + adds r3, 0x24 + adds r1, r2, r3 + ldrh r1, [r1] + lsls r1, 1 + ldr r2, _080CCFE0 + adds r1, r2 + movs r2, 0x2 + bl CpuSet + b _080CCFFC + .align 2, 0 +_080CCFD8: .4byte 0x02039d08 +_080CCFDC: .4byte 0x08577574 +_080CCFE0: .4byte 0x02037714 +_080CCFE4: + lsls r0, r1, 2 + ldr r1, _080CD000 + adds r0, r1 + ldr r3, _080CD004 + adds r1, r2, r3 + ldrh r1, [r1] + lsls r1, 1 + ldr r2, _080CD008 + adds r1, r2 + movs r2, 0x2 + bl CpuSet +_080CCFFC: + pop {r0} + bx r0 + .align 2, 0 +_080CD000: .4byte 0x08577574 +_080CD004: .4byte 0x0000071e +_080CD008: .4byte 0x02037714 + thumb_func_end sub_80CCF9C + + thumb_func_start sub_80CD00C +sub_80CD00C: @ 80CD00C + push {lr} + adds r1, r0, 0 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r1, r0, 0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + movs r0, 0xB0 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80CD00C + + thumb_func_start sub_80CD02C +sub_80CD02C: @ 80CD02C + push {r4,r5,lr} + ldr r0, _080CD0A8 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r5, 0 +_080CD036: + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 19 + movs r0, 0xB8 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + ldr r0, _080CD0AC + movs r2, 0x1C + movs r3, 0x16 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080CD088 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080CD0B0 + adds r4, r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + movs r0, 0x1 + cmp r5, 0 + bne _080CD076 + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 +_080CD076: + strh r0, [r4, 0x34] + ldr r0, _080CD0B4 + ldr r0, [r0] + lsls r1, r5, 2 + movs r2, 0xE6 + lsls r2, 3 + adds r0, r2 + adds r0, r1 + str r4, [r0] +_080CD088: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _080CD036 + bl sub_80CEADC + lsls r0, 24 + cmp r0, 0 + beq _080CD0A2 + movs r0, 0x1 + bl sub_80CD1A8 +_080CD0A2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CD0A8: .4byte 0x0857b080 +_080CD0AC: .4byte 0x0857b0e0 +_080CD0B0: .4byte 0x02020630 +_080CD0B4: .4byte 0x02039d08 + thumb_func_end sub_80CD02C + + thumb_func_start sub_80CD0B8 +sub_80CD0B8: @ 80CD0B8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r7, _080CD10C + mov r12, r7 + movs r6, 0xE6 + lsls r6, 3 + movs r4, 0 + movs r3, 0x2 +_080CD0CC: + mov r0, r12 + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r6 + adds r1, r0 + ldr r0, [r1] + strh r4, [r0, 0x24] + ldr r0, [r1] + strh r3, [r0, 0x2E] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1 + bls _080CD0CC + lsls r0, r5, 24 + cmp r0, 0 + bge _080CD114 + ldr r1, [r7] + movs r2, 0xE6 + lsls r2, 3 + adds r3, r1, r2 + ldr r2, [r3] + movs r0, 0x1D + strh r0, [r2, 0x30] + ldr r0, _080CD110 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x5 + strh r0, [r2, 0x30] + ldr r0, [r3] + movs r2, 0x48 + b _080CD130 + .align 2, 0 +_080CD10C: .4byte 0x02039d08 +_080CD110: .4byte 0x00000734 +_080CD114: + ldr r1, [r7] + movs r2, 0xE6 + lsls r2, 3 + adds r3, r1, r2 + ldr r2, [r3] + movs r0, 0x5 + strh r0, [r2, 0x30] + ldr r0, _080CD154 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x1D + strh r0, [r2, 0x30] + ldr r0, [r3] + movs r2, 0xF8 +_080CD130: + strh r2, [r0, 0x32] + ldr r0, [r1] + strh r2, [r0, 0x32] + ldr r1, [r7] + movs r2, 0xE6 + lsls r2, 3 + adds r0, r1, r2 + ldr r2, [r0] + movs r0, 0 + strh r0, [r2, 0x3C] + ldr r0, _080CD154 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1 + strh r0, [r1, 0x3C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CD154: .4byte 0x00000734 + thumb_func_end sub_80CD0B8 + + thumb_func_start sub_80CD158 +sub_80CD158: @ 80CD158 + push {r4-r6,lr} + movs r3, 0 + movs r5, 0 + movs r6, 0x5 + negs r6, r6 + ldr r4, _080CD1A4 +_080CD164: + ldr r1, [r4] + lsls r0, r3, 2 + movs r2, 0xE6 + lsls r2, 3 + adds r1, r2 + adds r1, r0 + ldr r2, [r1] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 3 + adds r0, 0x5C + strh r0, [r2, 0x20] + ldr r0, [r1] + strh r5, [r0, 0x24] + ldr r1, [r1] + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x1 + bls _080CD164 + movs r0, 0x1 + bl sub_80CD1A8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CD1A4: .4byte 0x02039d08 + thumb_func_end sub_80CD158 + + thumb_func_start sub_80CD1A8 +sub_80CD1A8: @ 80CD1A8 + push {r4-r6,lr} + lsls r0, 24 + cmp r0, 0 + beq _080CD1E4 + movs r2, 0 + ldr r6, _080CD1E0 + movs r5, 0xE6 + lsls r5, 3 + movs r3, 0 + movs r4, 0x1 +_080CD1BC: + ldr r1, [r6] + lsls r0, r2, 2 + adds r1, r5 + adds r1, r0 + ldr r0, [r1] + strh r4, [r0, 0x2E] + ldr r0, [r1] + strh r3, [r0, 0x30] + ldr r0, [r1] + strh r3, [r0, 0x32] + ldr r0, [r1] + strh r3, [r0, 0x36] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1 + bls _080CD1BC + b _080CD204 + .align 2, 0 +_080CD1E0: .4byte 0x02039d08 +_080CD1E4: + movs r2, 0 + ldr r5, _080CD20C + movs r4, 0xE6 + lsls r4, 3 + movs r3, 0 +_080CD1EE: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldr r0, [r0] + strh r3, [r0, 0x2E] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1 + bls _080CD1EE +_080CD204: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CD20C: .4byte 0x02039d08 + thumb_func_end sub_80CD1A8 + + thumb_func_start sub_80CD210 +sub_80CD210: @ 80CD210 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x4 + bhi _080CD2DC + lsls r0, 2 + ldr r1, _080CD228 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CD228: .4byte _080CD22C + .align 2, 0 +_080CD22C: + .4byte _080CD240 + .4byte _080CD246 + .4byte _080CD274 + .4byte _080CD27A + .4byte _080CD2CC +_080CD240: + movs r0, 0 + strh r0, [r2, 0x24] + b _080CD2DC +_080CD246: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + movs r1, 0 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _080CD2DC + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x24] + adds r0, r3 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080CD2DC + strh r1, [r2, 0x32] + strh r1, [r2, 0x24] + b _080CD2DC +_080CD274: + movs r0, 0x3 + strh r0, [r2, 0x2E] + b _080CD2DC +_080CD27A: + ldr r0, _080CD2C4 + ldr r1, [r0] + ldr r0, _080CD2C8 + adds r1, r0 + ldrh r0, [r2, 0x20] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2, 0x20] + subs r0, 0x49 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAE + bls _080CD2A0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] +_080CD2A0: + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080CD2DC + ldrh r0, [r2, 0x32] + strh r0, [r2, 0x20] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + movs r0, 0x4 + strh r0, [r2, 0x2E] + b _080CD2DC + .align 2, 0 +_080CD2C4: .4byte 0x02039d08 +_080CD2C8: .4byte 0x000002ce +_080CD2CC: + ldr r0, _080CD2E0 + ldr r0, [r0] + ldr r1, _080CD2E4 + adds r0, r1 + ldrh r1, [r2, 0x20] + ldrh r0, [r0] + subs r1, r0 + strh r1, [r2, 0x20] +_080CD2DC: + pop {r0} + bx r0 + .align 2, 0 +_080CD2E0: .4byte 0x02039d08 +_080CD2E4: .4byte 0x000002ce + thumb_func_end sub_80CD210 + + thumb_func_start sub_80CD2E8 +sub_80CD2E8: @ 80CD2E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, [sp, 0x18] + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080CD354 + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080CD360 + movs r1, 0x1 + ands r1, r7 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, _080CD358 + adds r6, r4, r5 + adds r0, r6, 0 + bl obj_anim_image_start + movs r0, 0x3 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r6, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x5] + adds r5, 0x1C + adds r4, r5 + ldr r0, _080CD35C + str r0, [r4] + adds r0, r6, 0 + b _080CD362 + .align 2, 0 +_080CD354: .4byte 0x0857b0e0 +_080CD358: .4byte 0x02020630 +_080CD35C: .4byte nullsub_12 + 1 +_080CD360: + movs r0, 0 +_080CD362: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CD2E8 + + thumb_func_start sub_80CD36C +sub_80CD36C: @ 80CD36C + push {lr} + ldr r0, _080CD380 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + cmp r1, 0x1 + beq _080CD388 + ldr r1, _080CD384 + movs r0, 0 + strb r0, [r1] + b _080CD38C + .align 2, 0 +_080CD380: .4byte 0x02039d08 +_080CD384: .4byte 0x02039d78 +_080CD388: + ldr r0, _080CD3C8 + strb r1, [r0] +_080CD38C: + ldr r0, _080CD3CC + movs r1, 0 + strb r1, [r0] + ldr r0, _080CD3D0 + strb r1, [r0] + ldr r0, _080CD3D4 + strb r1, [r0] + ldr r0, _080CD3D8 + strb r1, [r0] + ldr r0, _080CD3DC + strb r1, [r0] + bl sub_80CDC0C + bl sub_80CFC14 + ldr r2, _080CD3E0 + ldr r0, [r2] + ldr r1, _080CD3E4 + adds r0, r1 + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _080CD3E8 + adds r0, r1 + strb r3, [r0] + bl sub_80CEB40 + pop {r0} + bx r0 + .align 2, 0 +_080CD3C8: .4byte 0x02039d78 +_080CD3CC: .4byte 0x02039d79 +_080CD3D0: .4byte 0x02039d7a +_080CD3D4: .4byte 0x02039d7b +_080CD3D8: .4byte 0x02039d7c +_080CD3DC: .4byte 0x02039d7d +_080CD3E0: .4byte 0x02039d08 +_080CD3E4: .4byte 0x00000cd6 +_080CD3E8: .4byte 0x000021ff + thumb_func_end sub_80CD36C + + thumb_func_start sub_80CD3EC +sub_80CD3EC: @ 80CD3EC + push {lr} + bl sub_80CFC14 + bl sub_80CEBDC + ldr r3, _080CD42C + ldr r0, [r3] + ldr r1, _080CD430 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + ldr r1, _080CD434 + adds r0, r1 + strb r2, [r0] + ldr r0, _080CD438 + ldrb r0, [r0] + cmp r0, 0 + beq _080CD426 + ldr r0, [r3] + ldr r1, _080CD43C + adds r0, r1 + ldr r1, _080CD440 + movs r2, 0x64 + bl memcpy + bl sub_80CAFC4 +_080CD426: + pop {r0} + bx r0 + .align 2, 0 +_080CD42C: .4byte 0x02039d08 +_080CD430: .4byte 0x00000cd6 +_080CD434: .4byte 0x000021ff +_080CD438: .4byte 0x02039d7a +_080CD43C: .4byte 0x000020a4 +_080CD440: .4byte 0x02039d14 + thumb_func_end sub_80CD3EC + + thumb_func_start sub_80CD444 +sub_80CD444: @ 80CD444 + push {r4-r6,lr} + adds r4, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0x4 + bhi _080CD4FC + lsls r0, 2 + ldr r1, _080CD460 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CD460: .4byte _080CD464 + .align 2, 0 +_080CD464: + .4byte _080CD478 + .4byte _080CD4A6 + .4byte _080CD4CE + .4byte _080CD4D6 + .4byte _080CD4F4 +_080CD478: + adds r0, r5, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x64 + strh r1, [r4] + adds r0, r5, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x20 + strh r1, [r6] + b _080CD4FC +_080CD4A6: + cmp r5, 0 + bne _080CD4B2 + movs r0, 0x68 + strh r0, [r4] + movs r0, 0x34 + b _080CD4FA +_080CD4B2: + cmp r5, 0x6 + bne _080CD4BE + movs r0, 0x98 + strh r0, [r4] + movs r0, 0x84 + b _080CD4FA +_080CD4BE: + movs r0, 0x98 + strh r0, [r4] + subs r1, r5, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + b _080CD4FA +_080CD4CE: + movs r0, 0xA2 + strh r0, [r4] + movs r0, 0xC + b _080CD4FA +_080CD4D6: + ldr r0, _080CD4F0 + ldrb r0, [r0] + movs r1, 0xE + cmp r0, 0 + beq _080CD4E2 + movs r1, 0x8 +_080CD4E2: + strh r1, [r6] + movs r0, 0x58 + muls r0, r5 + adds r0, 0x78 + strh r0, [r4] + b _080CD4FC + .align 2, 0 +_080CD4F0: .4byte 0x02039d7a +_080CD4F4: + movs r0, 0xA0 + strh r0, [r4] + movs r0, 0x60 +_080CD4FA: + strh r0, [r6] +_080CD4FC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CD444 + + thumb_func_start sub_80CD504 +sub_80CD504: @ 80CD504 + push {lr} + ldr r0, _080CD52C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CD538 + cmp r0, 0x1 + bne _080CD54C + ldr r0, _080CD530 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080CD534 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + b _080CD542 + .align 2, 0 +_080CD52C: .4byte 0x02039d78 +_080CD530: .4byte 0x02039d79 +_080CD534: .4byte 0x020244ec +_080CD538: + ldr r0, _080CD548 + ldrb r0, [r0] + movs r1, 0xB + bl get_pokemon_data_from_selected_box +_080CD542: + lsls r0, 16 + lsrs r0, 16 + b _080CD54E + .align 2, 0 +_080CD548: .4byte 0x02039d79 +_080CD54C: + movs r0, 0 +_080CD54E: + pop {r1} + bx r1 + thumb_func_end sub_80CD504 + + thumb_func_start sub_80CD554 +sub_80CD554: @ 80CD554 + push {r4-r7,lr} + ldr r7, _080CD570 + ldr r5, [r7] + movs r0, 0xCD + lsls r0, 4 + adds r1, r5, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080CD57E + ldrb r0, [r5, 0x1] + cmp r0, 0x3 + beq _080CD574 + movs r0, 0 + b _080CD69A + .align 2, 0 +_080CD570: .4byte 0x02039d08 +_080CD574: + bl sub_80D1218 + lsls r0, 24 + lsrs r0, 24 + b _080CD69A +_080CD57E: + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080CD67C + ldr r1, _080CD668 + adds r4, r5, r1 + ldr r2, _080CD66C + adds r1, r5, r2 + ldr r0, [r4] + ldr r1, [r1] + adds r0, r1 + str r0, [r4] + movs r0, 0xCC + lsls r0, 4 + adds r3, r5, r0 + adds r2, 0x4 + adds r1, r5, r2 + ldr r0, [r3] + ldr r1, [r1] + adds r0, r1 + str r0, [r3] + ldr r6, _080CD670 + adds r1, r5, r6 + ldr r2, [r1] + ldr r0, [r4] + asrs r0, 8 + strh r0, [r2, 0x20] + ldr r2, [r1] + ldr r0, [r3] + asrs r0, 8 + strh r0, [r2, 0x22] + ldr r1, [r1] + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x80 + lsls r3, 1 + cmp r0, r3 + ble _080CD5DA + ldr r4, _080CD674 + adds r0, r2, r4 + lsls r0, 16 + asrs r0, 16 + adds r0, 0x40 + strh r0, [r1, 0x20] +_080CD5DA: + ldr r0, [r7] + adds r0, r6 + ldr r1, [r0] + ldrh r2, [r1, 0x20] + movs r4, 0x20 + ldrsh r0, [r1, r4] + cmp r0, 0x3F + bgt _080CD5F6 + movs r0, 0x40 + subs r0, r2 + lsls r0, 16 + asrs r0, 16 + subs r0, r3, r0 + strh r0, [r1, 0x20] +_080CD5F6: + ldr r0, [r7] + adds r0, r6 + ldr r1, [r0] + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0xB0 + ble _080CD612 + adds r0, r2, 0 + subs r0, 0xB0 + lsls r0, 16 + asrs r0, 16 + subs r0, 0x10 + strh r0, [r1, 0x22] +_080CD612: + ldr r0, [r7] + adds r0, r6 + ldr r2, [r0] + ldrh r3, [r2, 0x22] + movs r4, 0x22 + ldrsh r0, [r2, r4] + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080CD632 + subs r0, r1, r3 + movs r1, 0xB0 + lsls r0, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r2, 0x22] +_080CD632: + ldr r0, [r7] + ldr r2, _080CD678 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080CD698 + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080CD698 + ldr r0, [r7] + adds r0, r6 + ldr r2, [r0] + adds r2, 0x3F + ldrb r3, [r2] + lsrs r1, r3, 1 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 1 + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _080CD698 + .align 2, 0 +_080CD668: .4byte 0x00000cbc +_080CD66C: .4byte 0x00000cc4 +_080CD670: .4byte 0x00000cb4 +_080CD674: .4byte 0xffffff00 +_080CD678: .4byte 0x00000cd7 +_080CD67C: + ldr r3, _080CD6A0 + adds r2, r5, r3 + ldr r1, [r2] + ldr r4, _080CD6A4 + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r1, 0x20] + ldr r1, [r2] + ldr r2, _080CD6A8 + adds r0, r5, r2 + ldrh r0, [r0] + strh r0, [r1, 0x22] + bl sub_80CDA68 +_080CD698: + movs r0, 0x1 +_080CD69A: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080CD6A0: .4byte 0x00000cb4 +_080CD6A4: .4byte 0x00000ccc +_080CD6A8: .4byte 0x00000cce + thumb_func_end sub_80CD554 + + thumb_func_start sub_80CD6AC +sub_80CD6AC: @ 80CD6AC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r6, sp + adds r6, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl sub_80CD444 + ldr r1, _080CD6FC + ldr r0, [r1] + ldr r2, _080CD700 + adds r0, r2 + strb r4, [r0] + ldr r0, [r1] + ldr r3, _080CD704 + adds r0, r3 + strb r5, [r0] + ldr r1, [r1] + mov r0, sp + ldrh r2, [r0] + subs r3, 0x9 + adds r0, r1, r3 + strh r2, [r0] + ldrh r0, [r6] + ldr r2, _080CD708 + adds r1, r2 + strh r0, [r1] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CD6FC: .4byte 0x02039d08 +_080CD700: .4byte 0x00000cd4 +_080CD704: .4byte 0x00000cd5 +_080CD708: .4byte 0x00000cce + thumb_func_end sub_80CD6AC + + thumb_func_start sub_80CD70C +sub_80CD70C: @ 80CD70C + push {r4-r7,lr} + ldr r0, _080CD728 + ldr r2, [r0] + ldr r3, _080CD72C + adds r1, r2, r3 + ldrh r1, [r1] + adds r4, r0, 0 + cmp r1, 0 + beq _080CD730 + movs r0, 0xCD + lsls r0, 4 + adds r1, r2, r0 + movs r0, 0xC + b _080CD738 + .align 2, 0 +_080CD728: .4byte 0x02039d08 +_080CD72C: .4byte 0x00000cd2 +_080CD730: + movs r3, 0xCD + lsls r3, 4 + adds r1, r2, r3 + movs r0, 0x6 +_080CD738: + strh r0, [r1] + ldr r1, [r4] + ldr r0, _080CD77C + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + beq _080CD752 + movs r3, 0xCD + lsls r3, 4 + adds r0, r1, r3 + ldrh r0, [r0] + lsrs r0, 1 + strb r0, [r2] +_080CD752: + ldr r2, [r4] + ldr r1, _080CD780 + adds r0, r2, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080CD78C + cmp r1, 0x1 + beq _080CD7AC + ldr r3, _080CD784 + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080CD788 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x22 + ldrsh r0, [r0, r2] + b _080CD7C0 + .align 2, 0 +_080CD77C: .4byte 0x00000cd7 +_080CD780: .4byte 0x00000cd2 +_080CD784: .4byte 0x00000cce +_080CD788: .4byte 0x00000cb4 +_080CD78C: + ldr r3, _080CD7A4 + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080CD7A8 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x22 + ldrsh r0, [r0, r2] + adds r0, 0xC0 + b _080CD7C0 + .align 2, 0 +_080CD7A4: .4byte 0x00000cce +_080CD7A8: .4byte 0x00000cb4 +_080CD7AC: + ldr r3, _080CD7EC + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080CD7F0 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x22 + ldrsh r0, [r0, r2] + subs r0, 0xC0 +_080CD7C0: + subs r7, r1, r0 + ldr r2, [r4] + ldr r3, _080CD7F4 + adds r0, r2, r3 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080CD7FC + cmp r1, 0x1 + beq _080CD81C + ldr r1, _080CD7F8 + adds r0, r2, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080CD7F0 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x20 + ldrsh r0, [r0, r2] + b _080CD830 + .align 2, 0 +_080CD7EC: .4byte 0x00000cce +_080CD7F0: .4byte 0x00000cb4 +_080CD7F4: .4byte 0x00000cd3 +_080CD7F8: .4byte 0x00000ccc +_080CD7FC: + ldr r3, _080CD814 + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080CD818 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r0, 0xC0 + b _080CD830 + .align 2, 0 +_080CD814: .4byte 0x00000ccc +_080CD818: .4byte 0x00000cb4 +_080CD81C: + ldr r3, _080CD880 + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080CD884 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x20 + ldrsh r0, [r0, r2] + subs r0, 0xC0 +_080CD830: + subs r0, r1, r0 + lsls r7, 8 + lsls r0, 8 + ldr r4, [r4] + ldr r3, _080CD888 + adds r6, r4, r3 + movs r1, 0xCD + lsls r1, 4 + adds r5, r4, r1 + ldrh r1, [r5] + bl __divsi3 + str r0, [r6] + ldr r2, _080CD88C + adds r6, r4, r2 + ldrh r1, [r5] + adds r0, r7, 0 + bl __divsi3 + str r0, [r6] + ldr r3, _080CD890 + adds r2, r4, r3 + ldr r0, _080CD884 + adds r1, r4, r0 + ldr r0, [r1] + movs r3, 0x20 + ldrsh r0, [r0, r3] + lsls r0, 8 + str r0, [r2] + movs r0, 0xCC + lsls r0, 4 + adds r4, r0 + ldr r0, [r1] + movs r1, 0x22 + ldrsh r0, [r0, r1] + lsls r0, 8 + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CD880: .4byte 0x00000ccc +_080CD884: .4byte 0x00000cb4 +_080CD888: .4byte 0x00000cc4 +_080CD88C: .4byte 0x00000cc8 +_080CD890: .4byte 0x00000cbc + thumb_func_end sub_80CD70C + + thumb_func_start sub_80CD894 +sub_80CD894: @ 80CD894 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80CD6AC + bl sub_80CD70C + ldr r5, _080CD8D4 + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + beq _080CD8E4 + ldr r2, _080CD8D8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080CD8FC + ldr r0, _080CD8DC + ldrb r0, [r0] + cmp r0, 0 + bne _080CD8FC + ldr r2, _080CD8E0 + adds r0, r1, r2 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + b _080CD8FC + .align 2, 0 +_080CD8D4: .4byte 0x02039d08 +_080CD8D8: .4byte 0x000021ff +_080CD8DC: .4byte 0x02039d7a +_080CD8E0: .4byte 0x00000cb4 +_080CD8E4: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080CD8FC + ldr r0, [r5] + ldr r1, _080CD920 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start +_080CD8FC: + ldr r0, _080CD924 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CD95C + ldr r0, _080CD928 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CD930 + ldr r0, _080CD92C + ldrb r1, [r0] + movs r0, 0 + bl sub_80D0E50 + b _080CD93E + .align 2, 0 +_080CD920: .4byte 0x00000cb4 +_080CD924: .4byte 0x02039d08 +_080CD928: .4byte 0x02039d78 +_080CD92C: .4byte 0x02039d79 +_080CD930: + cmp r0, 0x1 + bne _080CD93E + ldr r0, _080CD94C + ldrb r1, [r0] + movs r0, 0x1 + bl sub_80D0E50 +_080CD93E: + cmp r4, 0 + bne _080CD950 + movs r0, 0 + adds r1, r6, 0 + bl sub_80D0D8C + b _080CD95C + .align 2, 0 +_080CD94C: .4byte 0x02039d79 +_080CD950: + cmp r4, 0x1 + bne _080CD988 + movs r0, 0x1 + adds r1, r6, 0 + bl sub_80D0D8C +_080CD95C: + cmp r4, 0x1 + bne _080CD988 + ldr r0, _080CD9D0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _080CD988 + ldr r1, _080CD9D4 + ldr r0, [r1] + ldr r2, _080CD9D8 + adds r0, r2 + strb r4, [r0] + ldr r0, [r1] + ldr r1, _080CD9DC + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_080CD988: + cmp r4, 0 + beq _080CD9E4 + cmp r4, 0 + blt _080CDA56 + cmp r4, 0x3 + bgt _080CDA56 + ldr r5, _080CD9D4 + ldr r0, [r5] + ldr r2, _080CD9E0 + adds r0, r2 + ldr r4, [r0] + ldrb r1, [r4, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r4, 0x5] + ldr r0, [r5] + ldr r4, _080CD9DC + adds r0, r4 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + ldr r0, [r5] + adds r0, r4 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + ands r2, r0 + orrs r2, r3 + strb r2, [r1, 0x5] + b _080CDA56 + .align 2, 0 +_080CD9D0: .4byte 0x02039d78 +_080CD9D4: .4byte 0x02039d08 +_080CD9D8: .4byte 0x00000cd6 +_080CD9DC: .4byte 0x00000cb8 +_080CD9E0: .4byte 0x00000cb4 +_080CD9E4: + ldr r3, _080CDA18 + ldr r1, [r3] + ldr r2, _080CDA1C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080CDA28 + ldr r2, _080CDA20 + adds r0, r1, r2 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r3] + ldr r1, _080CDA24 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _080CDA56 + .align 2, 0 +_080CDA18: .4byte 0x02039d08 +_080CDA1C: .4byte 0x000021ff +_080CDA20: .4byte 0x00000cb4 +_080CDA24: .4byte 0x00000cb8 +_080CDA28: + ldr r2, _080CDA5C + adds r0, r1, r2 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, _080CDA60 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CDA56 + ldr r0, _080CDA64 + ldrb r0, [r0] + cmp r0, 0 + beq _080CDA56 + movs r0, 0x2 + bl sub_80CC0D4 +_080CDA56: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CDA5C: .4byte 0x00000cb4 +_080CDA60: .4byte 0x02039d78 +_080CDA64: .4byte 0x02039d7a + thumb_func_end sub_80CD894 + + thumb_func_start sub_80CDA68 +sub_80CDA68: @ 80CDA68 + push {r4,lr} + ldr r1, _080CDAA8 + ldr r4, _080CDAAC + ldr r2, [r4] + ldr r3, _080CDAB0 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, _080CDAB4 + adds r3, 0x1 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + beq _080CDAC0 + ldr r1, _080CDAB8 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDAD8 + ldr r0, _080CDABC + ldrb r0, [r0] + cmp r0, 0 + bne _080CDAD8 + subs r3, 0x21 + adds r0, r2, r3 + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start + b _080CDAD8 + .align 2, 0 +_080CDAA8: .4byte 0x02039d78 +_080CDAAC: .4byte 0x02039d08 +_080CDAB0: .4byte 0x00000cd4 +_080CDAB4: .4byte 0x02039d79 +_080CDAB8: .4byte 0x000021ff +_080CDABC: .4byte 0x02039d7a +_080CDAC0: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080CDAD8 + ldr r0, [r4] + ldr r1, _080CDAF4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start +_080CDAD8: + bl sub_80CEB40 + ldr r0, _080CDAF8 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _080CDB0E + cmp r0, 0x1 + bgt _080CDAFC + cmp r0, 0 + beq _080CDB30 + b _080CDB8A + .align 2, 0 +_080CDAF4: .4byte 0x00000cb4 +_080CDAF8: .4byte 0x02039d78 +_080CDAFC: + cmp r0, 0x2 + beq _080CDB06 + cmp r0, 0x3 + bne _080CDB8A + b _080CDB1E +_080CDB06: + movs r0, 0x1 + bl sub_80CD1A8 + b _080CDB8A +_080CDB0E: + ldr r0, _080CDB28 + ldr r0, [r0] + ldr r2, _080CDB2C + adds r0, r2 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0xD + strb r1, [r0] +_080CDB1E: + movs r0, 0x1 + bl sub_80CC0D4 + b _080CDB8A + .align 2, 0 +_080CDB28: .4byte 0x02039d08 +_080CDB2C: .4byte 0x00000cb8 +_080CDB30: + ldr r4, _080CDB90 + ldr r1, [r4] + ldr r3, _080CDB94 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDB8A + ldr r2, _080CDB98 + adds r0, r1, r2 + ldr r3, [r0] + ldrb r1, [r3, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r0, [r4] + ldr r3, _080CDB9C + adds r0, r3 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + ands r2, r0 + movs r0, 0x8 + orrs r2, r0 + strb r2, [r1, 0x5] + ldr r0, [r4] + adds r0, r3 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x15 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x2 + bl sub_80CC0D4 +_080CDB8A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CDB90: .4byte 0x02039d08 +_080CDB94: .4byte 0x000021ff +_080CDB98: .4byte 0x00000cb4 +_080CDB9C: .4byte 0x00000cb8 + thumb_func_end sub_80CDA68 + + thumb_func_start sub_80CDBA0 +sub_80CDBA0: @ 80CDBA0 + push {lr} + ldr r0, _080CDBB0 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDBB4 + movs r3, 0 + b _080CDBC2 + .align 2, 0 +_080CDBB0: .4byte 0x02039d7a +_080CDBB4: + bl calc_player_party_count + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x5 + bls _080CDBC2 + movs r3, 0x5 +_080CDBC2: + ldr r0, _080CDBEC + ldr r2, [r0] + ldr r1, _080CDBF0 + adds r0, r2, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CDBE0 + ldr r0, _080CDBF4 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_080CDBE0: + movs r0, 0x1 + adds r1, r3, 0 + bl sub_80CD894 + pop {r0} + bx r0 + .align 2, 0 +_080CDBEC: .4byte 0x02039d08 +_080CDBF0: .4byte 0x00000cb4 +_080CDBF4: .4byte 0x00000cd7 + thumb_func_end sub_80CDBA0 + + thumb_func_start sub_80CDBF8 +sub_80CDBF8: @ 80CDBF8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80CD894 + pop {r0} + bx r0 + thumb_func_end sub_80CDBF8 + + thumb_func_start sub_80CDC0C +sub_80CDC0C: @ 80CDC0C + ldr r1, _080CDC14 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_080CDC14: .4byte 0x02039d7e + thumb_func_end sub_80CDC0C + + thumb_func_start sub_80CDC18 +sub_80CDC18: @ 80CDC18 + ldr r0, _080CDC24 + ldr r1, _080CDC28 + ldrb r1, [r1] + strb r1, [r0] + bx lr + .align 2, 0 +_080CDC24: .4byte 0x02039d7e +_080CDC28: .4byte 0x02039d79 + thumb_func_end sub_80CDC18 + + thumb_func_start sub_80CDC2C +sub_80CDC2C: @ 80CDC2C + ldr r0, _080CDC34 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080CDC34: .4byte 0x02039d7e + thumb_func_end sub_80CDC2C + + thumb_func_start sub_80CDC38 +sub_80CDC38: @ 80CDC38 + lsls r0, 24 + ldr r1, _080CDC58 + ldr r1, [r1] + ldr r2, _080CDC5C + adds r3, r1, r2 + ldr r2, _080CDC60 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + movs r0, 0xD9 + lsls r0, 4 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_080CDC58: .4byte 0x02039d08 +_080CDC5C: .4byte 0x00000d8c +_080CDC60: .4byte 0x0857b998 + thumb_func_end sub_80CDC38 + + thumb_func_start sub_80CDC64 +sub_80CDC64: @ 80CDC64 + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _080CDC84 + ldr r0, _080CDC78 + ldr r1, [r0] + ldr r2, _080CDC7C + adds r1, r2 + ldr r2, _080CDC80 + b _080CDC8E + .align 2, 0 +_080CDC78: .4byte 0x02039d08 +_080CDC7C: .4byte 0x00000d8c +_080CDC80: .4byte sub_80CDEB4 + 1 +_080CDC84: + ldr r0, _080CDCA0 + ldr r1, [r0] + ldr r2, _080CDCA4 + adds r1, r2 + ldr r2, _080CDCA8 +_080CDC8E: + str r2, [r1] + ldr r0, [r0] + movs r1, 0xD9 + lsls r1, 4 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080CDCA0: .4byte 0x02039d08 +_080CDCA4: .4byte 0x00000d8c +_080CDCA8: .4byte sub_80CDEC4 + 1 + thumb_func_end sub_80CDC64 + + thumb_func_start sub_80CDCAC +sub_80CDCAC: @ 80CDCAC + push {lr} + ldr r0, _080CDCC4 + ldr r0, [r0] + ldr r1, _080CDCC8 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080CDCC4: .4byte 0x02039d08 +_080CDCC8: .4byte 0x00000d8c + thumb_func_end sub_80CDCAC + + thumb_func_start sub_80CDCCC +sub_80CDCCC: @ 80CDCCC + push {r4,r5,lr} + ldr r4, _080CDCE8 + ldr r1, [r4] + movs r5, 0xD9 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CDD1C + cmp r0, 0x1 + bgt _080CDCEC + cmp r0, 0 + beq _080CDCF6 + b _080CDD54 + .align 2, 0 +_080CDCE8: .4byte 0x02039d08 +_080CDCEC: + cmp r0, 0x2 + beq _080CDD40 + cmp r0, 0x3 + beq _080CDCFE + b _080CDD54 +_080CDCF6: + ldr r0, _080CDD04 + ldrb r0, [r0] + cmp r0, 0 + beq _080CDD08 +_080CDCFE: + movs r0, 0 + b _080CDD56 + .align 2, 0 +_080CDD04: .4byte 0x02039d7a +_080CDD08: + ldr r2, _080CDD18 + adds r0, r1, r2 + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start + b _080CDD4A + .align 2, 0 +_080CDD18: .4byte 0x00000cb4 +_080CDD1C: + bl sub_80CDED4 + lsls r0, 24 + cmp r0, 0 + bne _080CDD54 + ldr r0, [r4] + ldr r1, _080CDD3C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl obj_anim_image_start + bl sub_80CDF38 + b _080CDD4A + .align 2, 0 +_080CDD3C: .4byte 0x00000cb4 +_080CDD40: + bl sub_80CDF08 + lsls r0, 24 + cmp r0, 0 + bne _080CDD54 +_080CDD4A: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CDD54: + movs r0, 0x1 +_080CDD56: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CDCCC + + thumb_func_start sub_80CDD5C +sub_80CDD5C: @ 80CDD5C + push {r4,r5,lr} + ldr r4, _080CDD78 + ldr r0, [r4] + movs r5, 0xD9 + lsls r5, 4 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CDDA4 + cmp r0, 0x1 + bgt _080CDD7C + cmp r0, 0 + beq _080CDD82 + b _080CDDD0 + .align 2, 0 +_080CDD78: .4byte 0x02039d08 +_080CDD7C: + cmp r0, 0x2 + beq _080CDDCC + b _080CDDD0 +_080CDD82: + bl sub_80CDED4 + lsls r0, 24 + cmp r0, 0 + bne _080CDDD0 + ldr r0, [r4] + ldr r1, _080CDDA0 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start + bl sub_80CDFAC + b _080CDDBC + .align 2, 0 +_080CDDA0: .4byte 0x00000cb4 +_080CDDA4: + bl sub_80CDF08 + lsls r0, 24 + cmp r0, 0 + bne _080CDDD0 + ldr r0, [r4] + ldr r1, _080CDDC8 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start +_080CDDBC: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CDDD0 + .align 2, 0 +_080CDDC8: .4byte 0x00000cb4 +_080CDDCC: + movs r0, 0 + b _080CDDD2 +_080CDDD0: + movs r0, 0x1 +_080CDDD2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CDD5C + + thumb_func_start sub_80CDDD8 +sub_80CDDD8: @ 80CDDD8 + push {r4,r5,lr} + ldr r4, _080CDDF4 + ldr r1, [r4] + movs r5, 0xD9 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CDE68 + cmp r0, 0x1 + bgt _080CDDF8 + cmp r0, 0 + beq _080CDDFE + b _080CDEAC + .align 2, 0 +_080CDDF4: .4byte 0x02039d08 +_080CDDF8: + cmp r0, 0x2 + beq _080CDEA8 + b _080CDEAC +_080CDDFE: + ldr r0, _080CDE18 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CDE20 + cmp r0, 0x1 + bne _080CDEA8 + ldr r0, _080CDE1C + adds r1, r0 + movs r0, 0xE + b _080CDE2A + .align 2, 0 +_080CDE18: .4byte 0x02039d78 +_080CDE1C: .4byte 0x00000d91 +_080CDE20: + bl get_preferred_box + ldr r1, [r4] + ldr r2, _080CDE58 + adds r1, r2 +_080CDE2A: + strb r0, [r1] + ldr r4, _080CDE5C + ldr r0, [r4] + ldr r1, _080CDE60 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start + ldr r0, [r4] + ldr r2, _080CDE58 + adds r0, r2 + ldrb r0, [r0] + ldr r1, _080CDE64 + ldrb r1, [r1] + bl sub_80CBD5C + ldr r1, [r4] + movs r0, 0xD9 + lsls r0, 4 + adds r1, r0 + b _080CDE94 + .align 2, 0 +_080CDE58: .4byte 0x00000d91 +_080CDE5C: .4byte 0x02039d08 +_080CDE60: .4byte 0x00000cb4 +_080CDE64: .4byte 0x02039d79 +_080CDE68: + bl sub_80CBDC4 + lsls r0, 24 + cmp r0, 0 + bne _080CDEAC + ldr r0, [r4] + ldr r1, _080CDE9C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl obj_anim_image_start + ldr r0, [r4] + ldr r2, _080CDEA0 + adds r0, r2 + ldrb r0, [r0] + ldr r1, _080CDEA4 + ldrb r1, [r1] + bl diegohint1 + ldr r1, [r4] + adds r1, r5 +_080CDE94: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CDEAC + .align 2, 0 +_080CDE9C: .4byte 0x00000cb4 +_080CDEA0: .4byte 0x00000d91 +_080CDEA4: .4byte 0x02039d79 +_080CDEA8: + movs r0, 0 + b _080CDEAE +_080CDEAC: + movs r0, 0x1 +_080CDEAE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CDDD8 + + thumb_func_start sub_80CDEB4 +sub_80CDEB4: @ 80CDEB4 + push {lr} + bl sub_80CDED4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CDEB4 + + thumb_func_start sub_80CDEC4 +sub_80CDEC4: @ 80CDEC4 + push {lr} + bl sub_80CDF08 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CDEC4 + + thumb_func_start sub_80CDED4 +sub_80CDED4: @ 80CDED4 + push {lr} + ldr r0, _080CDEF4 + ldr r0, [r0] + ldr r1, _080CDEF8 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080CDEEC + cmp r0, 0x8 + beq _080CDEFC +_080CDEEC: + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _080CDF00 + .align 2, 0 +_080CDEF4: .4byte 0x02039d08 +_080CDEF8: .4byte 0x00000cb4 +_080CDEFC: + movs r0, 0 + b _080CDF02 +_080CDF00: + movs r0, 0x1 +_080CDF02: + pop {r1} + bx r1 + thumb_func_end sub_80CDED4 + + thumb_func_start sub_80CDF08 +sub_80CDF08: @ 80CDF08 + push {lr} + ldr r0, _080CDF28 + ldr r0, [r0] + ldr r1, _080CDF2C + adds r0, r1 + ldr r1, [r0] + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080CDF30 + ldrh r0, [r1, 0x26] + subs r0, 0x1 + strh r0, [r1, 0x26] + movs r0, 0x1 + b _080CDF32 + .align 2, 0 +_080CDF28: .4byte 0x02039d08 +_080CDF2C: .4byte 0x00000cb4 +_080CDF30: + movs r0, 0 +_080CDF32: + pop {r1} + bx r1 + thumb_func_end sub_80CDF08 + + thumb_func_start sub_80CDF38 +sub_80CDF38: @ 80CDF38 + push {r4,lr} + ldr r0, _080CDF60 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CDF68 + cmp r0, 0x1 + bne _080CDF94 + ldr r4, _080CDF64 + ldrb r1, [r4] + movs r0, 0xE + bl sub_80CE018 + ldrb r1, [r4] + movs r0, 0 + bl sub_80CBC14 + b _080CDF8E + .align 2, 0 +_080CDF60: .4byte 0x02039d78 +_080CDF64: .4byte 0x02039d79 +_080CDF68: + ldr r0, _080CDF9C + ldr r0, [r0] + ldr r1, _080CDFA0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDF8E + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080CDFA4 + ldrb r1, [r4] + bl sub_80CE018 + ldrb r1, [r4] + movs r0, 0x1 + bl sub_80CBC14 +_080CDF8E: + ldr r1, _080CDFA8 + movs r0, 0x1 + strb r0, [r1] +_080CDF94: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CDF9C: .4byte 0x02039d08 +_080CDFA0: .4byte 0x000021ff +_080CDFA4: .4byte 0x02039d79 +_080CDFA8: .4byte 0x02039d7a + thumb_func_end sub_80CDF38 + + thumb_func_start sub_80CDFAC +sub_80CDFAC: @ 80CDFAC + push {r4,r5,lr} + ldr r0, _080CDFD4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CDFDC + cmp r0, 0x1 + bne _080CDFFE + ldr r4, _080CDFD8 + ldrb r1, [r4] + movs r0, 0xE + bl diegohint2 + ldrb r1, [r4] + movs r0, 0xE + bl sub_80CBCAC + b _080CDFF8 + .align 2, 0 +_080CDFD4: .4byte 0x02039d78 +_080CDFD8: .4byte 0x02039d79 +_080CDFDC: + bl get_preferred_box + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080CE004 + ldrb r1, [r5] + adds r0, r4, 0 + bl diegohint2 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_80CBCAC +_080CDFF8: + ldr r1, _080CE008 + movs r0, 0 + strb r0, [r1] +_080CDFFE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CE004: .4byte 0x02039d79 +_080CE008: .4byte 0x02039d7a + thumb_func_end sub_80CDFAC + + thumb_func_start sub_80CE00C +sub_80CE00C: @ 80CE00C + push {lr} + bl sub_80CEB40 + pop {r0} + bx r0 + thumb_func_end sub_80CE00C + + thumb_func_start sub_80CE018 +sub_80CE018: @ 80CE018 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r4, 0xE + bne _080CE054 + ldr r0, _080CE044 + ldr r0, [r0] + ldr r1, _080CE048 + adds r0, r1 + ldr r3, _080CE04C + ldr r1, _080CE050 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + movs r2, 0x64 + bl memcpy + b _080CE064 + .align 2, 0 +_080CE044: .4byte 0x02039d08 +_080CE048: .4byte 0x000020a4 +_080CE04C: .4byte 0x020244ec +_080CE050: .4byte 0x02039d79 +_080CE054: + ldr r0, _080CE07C + ldr r2, [r0] + ldr r0, _080CE080 + adds r2, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80D2054 +_080CE064: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80CE0E8 + ldr r0, _080CE084 + strb r4, [r0] + ldr r0, _080CE088 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CE07C: .4byte 0x02039d08 +_080CE080: .4byte 0x000020a4 +_080CE084: .4byte 0x02039d7b +_080CE088: .4byte 0x02039d7c + thumb_func_end sub_80CE018 + + thumb_func_start diegohint2 +diegohint2: @ 80CE08C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r6, 0xE + bne _080CE0C0 + ldr r1, _080CE0B4 + movs r0, 0x64 + muls r0, r7 + adds r0, r1 + ldr r1, _080CE0B8 + ldr r1, [r1] + ldr r2, _080CE0BC + adds r1, r2 + movs r2, 0x64 + bl memcpy + b _080CE0D8 + .align 2, 0 +_080CE0B4: .4byte 0x020244ec +_080CE0B8: .4byte 0x02039d08 +_080CE0BC: .4byte 0x000020a4 +_080CE0C0: + ldr r5, _080CE0E0 + ldr r0, [r5] + ldr r4, _080CE0E4 + adds r0, r4 + bl pokemon_restore_pp + ldr r2, [r5] + adds r2, r4 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80D1F18 +_080CE0D8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CE0E0: .4byte 0x02039d08 +_080CE0E4: .4byte 0x000020a4 + thumb_func_end diegohint2 + + thumb_func_start sub_80CE0E8 +sub_80CE0E8: @ 80CE0E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0xE + bne _080CE108 + movs r0, 0x64 + muls r0, r1 + ldr r1, _080CE104 + adds r0, r1 + bl zero_pokemon_struct + b _080CE10C + .align 2, 0 +_080CE104: .4byte 0x020244ec +_080CE108: + bl sub_80D2018 +_080CE10C: + pop {r0} + bx r0 + thumb_func_end sub_80CE0E8 + + thumb_func_start diegohint1 +diegohint1: @ 80CE110 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r6, 0xE + bne _080CE144 + ldr r0, _080CE138 + ldr r0, [r0] + ldr r1, _080CE13C + adds r0, r1 + ldr r2, _080CE140 + movs r1, 0x64 + muls r1, r7 + adds r1, r2 + movs r2, 0x64 + bl memcpy + b _080CE154 + .align 2, 0 +_080CE138: .4byte 0x02039d08 +_080CE13C: .4byte 0x00002108 +_080CE140: .4byte 0x020244ec +_080CE144: + ldr r0, _080CE188 + ldr r2, [r0] + ldr r0, _080CE18C + adds r2, r0 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80D2054 +_080CE154: + adds r0, r6, 0 + adds r1, r7, 0 + bl diegohint2 + ldr r5, _080CE188 + ldr r1, [r5] + ldr r4, _080CE190 + adds r0, r1, r4 + ldr r2, _080CE18C + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + bl sub_80CEC00 + ldr r0, _080CE194 + strb r6, [r0] + ldr r0, _080CE198 + strb r7, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CE188: .4byte 0x02039d08 +_080CE18C: .4byte 0x00002108 +_080CE190: .4byte 0x000020a4 +_080CE194: .4byte 0x02039d7b +_080CE198: .4byte 0x02039d7c + thumb_func_end diegohint1 + + thumb_func_start sub_80CE19C +sub_80CE19C: @ 80CE19C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_80C6FD4 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080CE1BA + movs r0, 0 + b _080CE21A +_080CE1BA: + ldr r5, _080CE1D8 + ldrb r0, [r5] + cmp r0, 0 + beq _080CE1DC + lsls r4, 24 + lsrs r1, r4, 24 + adds r0, r6, 0 + bl diegohint2 + bl sub_80CBAC4 + movs r0, 0 + strb r0, [r5] + b _080CE1F6 + .align 2, 0 +_080CE1D8: .4byte 0x02039d7a +_080CE1DC: + ldr r5, _080CE220 + ldrb r1, [r5] + movs r0, 0xE + bl sub_80CE018 + lsls r4, 24 + lsrs r1, r4, 24 + adds r0, r6, 0 + bl diegohint2 + ldrb r0, [r5] + bl sub_80CBB68 +_080CE1F6: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _080CE208 + lsrs r0, r4, 24 + bl sub_80CB140 +_080CE208: + ldr r0, _080CE224 + ldr r0, [r0] + ldr r1, _080CE228 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + movs r0, 0x1 +_080CE21A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080CE220: .4byte 0x02039d79 +_080CE224: .4byte 0x02039d08 +_080CE228: .4byte 0x00000cb4 + thumb_func_end sub_80CE19C + + thumb_func_start sub_80CE22C +sub_80CE22C: @ 80CE22C + push {lr} + ldr r0, _080CE248 + ldr r0, [r0] + ldr r1, _080CE24C + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start + bl sub_80CEB40 + pop {r0} + bx r0 + .align 2, 0 +_080CE248: .4byte 0x02039d08 +_080CE24C: .4byte 0x00000cb4 + thumb_func_end sub_80CE22C + + thumb_func_start sub_80CE250 +sub_80CE250: @ 80CE250 + push {lr} + ldr r0, _080CE260 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE264 + movs r2, 0x2 + b _080CE274 + .align 2, 0 +_080CE260: .4byte 0x02039d7a +_080CE264: + ldr r0, _080CE294 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r2, 0x1 + eors r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r2, r0, 31 +_080CE274: + ldr r0, _080CE298 + ldrb r1, [r0] + adds r0, r2, 0 + bl sub_80CBF14 + ldr r0, _080CE29C + ldr r1, [r0] + ldr r2, _080CE2A0 + adds r0, r1, r2 + ldr r2, _080CE2A4 + adds r1, r2 + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_080CE294: .4byte 0x02039d78 +_080CE298: .4byte 0x02039d79 +_080CE29C: .4byte 0x02039d08 +_080CE2A0: .4byte 0x000021e0 +_080CE2A4: .4byte 0x00000cee + thumb_func_end sub_80CE250 + + thumb_func_start sub_80CE2A8 +sub_80CE2A8: @ 80CE2A8 + push {lr} + bl sub_80CBFD8 + lsls r0, 24 + cmp r0, 0 + beq _080CE2B8 + movs r0, 0x1 + b _080CE2CA +_080CE2B8: + ldr r0, _080CE2D0 + ldr r0, [r0] + ldr r1, _080CE2D4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start + movs r0, 0 +_080CE2CA: + pop {r1} + bx r1 + .align 2, 0 +_080CE2D0: .4byte 0x02039d08 +_080CE2D4: .4byte 0x00000cb4 + thumb_func_end sub_80CE2A8 + + thumb_func_start sub_80CE2D8 +sub_80CE2D8: @ 80CE2D8 + push {lr} + bl sub_80CC020 + ldr r1, _080CE2EC + ldrb r0, [r1] + cmp r0, 0 + beq _080CE2F0 + movs r0, 0 + strb r0, [r1] + b _080CE316 + .align 2, 0 +_080CE2EC: .4byte 0x02039d7a +_080CE2F0: + ldr r0, _080CE300 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CE304 + movs r2, 0xE + b _080CE30C + .align 2, 0 +_080CE300: .4byte 0x02039d78 +_080CE304: + bl get_preferred_box + lsls r0, 24 + lsrs r2, r0, 24 +_080CE30C: + ldr r0, _080CE320 + ldrb r1, [r0] + adds r0, r2, 0 + bl sub_80CE0E8 +_080CE316: + bl sub_80CEB40 + pop {r0} + bx r0 + .align 2, 0 +_080CE320: .4byte 0x02039d79 + thumb_func_end sub_80CE2D8 + + thumb_func_start sub_80CE324 +sub_80CE324: @ 80CE324 + push {lr} + ldr r0, _080CE344 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE33E + ldr r0, _080CE348 + ldr r0, [r0] + ldr r1, _080CE34C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl obj_anim_image_start +_080CE33E: + pop {r0} + bx r0 + .align 2, 0 +_080CE344: .4byte 0x02039d7a +_080CE348: .4byte 0x02039d08 +_080CE34C: .4byte 0x00000cb4 + thumb_func_end sub_80CE324 + + thumb_func_start sub_80CE350 +sub_80CE350: @ 80CE350 + push {r4,r5,lr} + adds r3, r0, 0 + movs r5, 0 + ldr r4, _080CE394 +_080CE358: + movs r1, 0 + ldrsb r1, [r4, r1] + cmp r1, 0x22 + beq _080CE378 + ldr r0, _080CE398 + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080CE37E + movs r1, 0x1 + ldrsb r1, [r4, r1] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080CE37E +_080CE378: + ldrh r0, [r4, 0x2] + strh r0, [r3] + adds r3, 0x2 +_080CE37E: + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x5 + bls _080CE358 + ldr r1, _080CE39C + adds r0, r1, 0 + strh r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CE394: .4byte 0x0857b9a4 +_080CE398: .4byte 0x03005d8c +_080CE39C: .4byte 0x00000163 + thumb_func_end sub_80CE350 + + thumb_func_start sub_80CE3A0 +sub_80CE3A0: @ 80CE3A0 + push {r4,r5,lr} + bl sub_80CE51C + adds r3, r0, 0 + cmp r3, 0 + bne _080CE3D0 + ldr r2, _080CE3C4 + ldr r0, [r2] + ldr r1, _080CE3C8 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _080CE3CC + adds r0, r2 + strb r3, [r0] + b _080CE504 + .align 2, 0 +_080CE3C4: .4byte 0x02039d08 +_080CE3C8: .4byte 0x0000216d +_080CE3CC: .4byte 0x0000216c +_080CE3D0: + ldr r0, _080CE400 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE418 + ldr r4, _080CE404 + ldr r1, [r4] + ldr r3, _080CE408 + adds r0, r1, r3 + ldr r2, _080CE40C + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r0, [r4] + ldr r3, _080CE410 + adds r0, r3 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080CE414 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + b _080CE494 + .align 2, 0 +_080CE400: .4byte 0x02039d7a +_080CE404: .4byte 0x02039d08 +_080CE408: .4byte 0x00002108 +_080CE40C: .4byte 0x000020a4 +_080CE410: .4byte 0x00002170 +_080CE414: .4byte 0x00002171 +_080CE418: + ldr r0, _080CE44C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CE464 + ldr r4, _080CE450 + ldr r0, [r4] + ldr r2, _080CE454 + adds r0, r2 + ldr r3, _080CE458 + ldr r1, _080CE45C + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + movs r2, 0x64 + bl memcpy + ldr r0, [r4] + ldr r3, _080CE460 + adds r0, r3 + movs r1, 0xE + strb r1, [r0] + b _080CE488 + .align 2, 0 +_080CE44C: .4byte 0x02039d78 +_080CE450: .4byte 0x02039d08 +_080CE454: .4byte 0x00002108 +_080CE458: .4byte 0x020244ec +_080CE45C: .4byte 0x02039d79 +_080CE460: .4byte 0x00002170 +_080CE464: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080CE4C8 + ldrb r1, [r1] + ldr r4, _080CE4CC + ldr r2, [r4] + ldr r3, _080CE4D0 + adds r2, r3 + bl sub_80D2054 + bl get_preferred_box + ldr r1, [r4] + ldr r2, _080CE4D4 + adds r1, r2 + strb r0, [r1] +_080CE488: + ldr r0, _080CE4CC + ldr r0, [r0] + ldr r1, _080CE4C8 + ldrb r1, [r1] + ldr r3, _080CE4D8 + adds r0, r3 +_080CE494: + strb r1, [r0] + ldr r5, _080CE4CC + ldr r0, [r5] + ldr r4, _080CE4DC + adds r0, r4 + bl sub_80CE350 + ldr r2, [r5] + ldr r1, _080CE4D0 + adds r0, r2, r1 + adds r2, r4 + movs r1, 0x51 + bl pokemon_getattr + ldr r2, [r5] + ldr r3, _080CE4E0 + adds r1, r2, r3 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080CE4E8 + ldr r0, _080CE4E4 + adds r1, r2, r0 + movs r0, 0 + strb r0, [r1] + b _080CE4F8 + .align 2, 0 +_080CE4C8: .4byte 0x02039d79 +_080CE4CC: .4byte 0x02039d08 +_080CE4D0: .4byte 0x00002108 +_080CE4D4: .4byte 0x00002170 +_080CE4D8: .4byte 0x00002171 +_080CE4DC: .4byte 0x00002176 +_080CE4E0: .4byte 0x00002174 +_080CE4E4: .4byte 0x0000216d +_080CE4E8: + ldr r1, _080CE50C + adds r0, r2, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + ldr r2, _080CE510 + adds r0, r2 + strb r1, [r0] +_080CE4F8: + ldr r0, _080CE514 + ldr r0, [r0] + ldr r3, _080CE518 + adds r0, r3 + movs r1, 0 + strh r1, [r0] +_080CE504: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CE50C: .4byte 0x0000216d +_080CE510: .4byte 0x0000216c +_080CE514: .4byte 0x02039d08 +_080CE518: .4byte 0x00002172 + thumb_func_end sub_80CE3A0 + + thumb_func_start sub_80CE51C +sub_80CE51C: @ 80CE51C + push {r4-r6,lr} + ldr r0, _080CE54C + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r5, r0, 31 + movs r4, 0 +_080CE52A: + movs r0, 0x64 + muls r0, r4 + ldr r1, _080CE550 + adds r0, r1 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _080CE53E + adds r5, 0x1 +_080CE53E: + adds r4, 0x1 + cmp r4, 0x5 + ble _080CE52A + cmp r5, 0x2 + ble _080CE554 +_080CE548: + movs r0, 0x1 + b _080CE578 + .align 2, 0 +_080CE54C: .4byte 0x02039d7a +_080CE550: .4byte 0x020244ec +_080CE554: + movs r6, 0 +_080CE556: + movs r4, 0 +_080CE558: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D2270 + cmp r0, 0 + beq _080CE56A + adds r5, 0x1 + cmp r5, 0x2 + bgt _080CE548 +_080CE56A: + adds r4, 0x1 + cmp r4, 0x1D + ble _080CE558 + adds r6, 0x1 + cmp r6, 0xD + ble _080CE556 + movs r0, 0 +_080CE578: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80CE51C + + thumb_func_start sub_80CE580 +sub_80CE580: @ 80CE580 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080CE5A4 + ldr r2, [r0] + ldr r3, _080CE5A8 + adds r1, r2, r3 + ldrb r1, [r1] + adds r5, r0, 0 + cmp r1, 0 + beq _080CE5B0 + ldr r1, _080CE5AC + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + b _080CE736 + .align 2, 0 +_080CE5A4: .4byte 0x02039d08 +_080CE5A8: .4byte 0x0000216d +_080CE5AC: .4byte 0x0000216c +_080CE5B0: + ldr r3, _080CE5C0 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080CE5C4 + cmp r0, 0x1 + beq _080CE690 + b _080CE732 + .align 2, 0 +_080CE5C0: .4byte 0x00002172 +_080CE5C4: + movs r6, 0 +_080CE5C6: + ldr r2, [r5] + ldr r1, _080CE630 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bne _080CE5E4 + ldr r3, _080CE634 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, r6 + beq _080CE606 +_080CE5E4: + movs r0, 0x64 + muls r0, r6 + ldr r1, _080CE638 + adds r0, r1 + ldr r1, _080CE63C + adds r2, r1 + movs r1, 0x51 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [r5] + ldr r2, _080CE640 + adds r1, r2 + ldrh r0, [r1] + bics r0, r4 + strh r0, [r1] +_080CE606: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CE5C6 + ldr r2, _080CE644 + ldr r1, [r2] + ldr r3, _080CE640 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080CE64C + subs r3, 0x7 + adds r0, r1, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _080CE648 + adds r0, r2 + strb r1, [r0] + b _080CE732 + .align 2, 0 +_080CE630: .4byte 0x00002170 +_080CE634: .4byte 0x00002171 +_080CE638: .4byte 0x020244ec +_080CE63C: .4byte 0x00002176 +_080CE640: .4byte 0x00002174 +_080CE644: .4byte 0x02039d08 +_080CE648: .4byte 0x0000216c +_080CE64C: + ldr r3, _080CE66C + adds r0, r1, r3 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r1, [r2] + ldr r0, _080CE670 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080CE732 + .align 2, 0 +_080CE66C: .4byte 0x0000216e +_080CE670: .4byte 0x00002172 +_080CE674: + ldr r1, _080CE688 + adds r0, r5, r1 + movs r1, 0x1 + strb r1, [r0] + mov r2, r8 + ldr r0, [r2] + ldr r3, _080CE68C + adds r0, r3 + strb r1, [r0] + b _080CE732 + .align 2, 0 +_080CE688: .4byte 0x0000216d +_080CE68C: .4byte 0x0000216c +_080CE690: + movs r6, 0 + mov r8, r5 + ldr r7, _080CE740 +_080CE696: + mov r0, r8 + ldr r3, [r0] + ldr r1, _080CE744 + adds r0, r3, r1 + ldrb r0, [r0] + ldr r2, _080CE748 + adds r1, r3, r2 + ldrb r1, [r1] + adds r2, 0x7 + adds r3, r2 + movs r2, 0x51 + bl sub_80D1ED0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080CE6E0 + ldr r5, [r5] + ldr r3, _080CE74C + adds r0, r5, r3 + ldrh r2, [r0] + ldr r1, _080CE744 + adds r0, r5, r1 + ldrh r3, [r0] + adds r1, r7, 0 + ands r1, r2 + adds r0, r7, 0 + ands r0, r3 + cmp r1, r0 + beq _080CE6E0 + ldr r2, _080CE750 + adds r1, r5, r2 + ldrh r0, [r1] + bics r0, r4 + strh r0, [r1] + cmp r0, 0 + beq _080CE674 +_080CE6E0: + ldr r2, _080CE754 + ldr r1, [r2] + ldr r3, _080CE748 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + movs r3, 0 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + adds r5, r2, 0 + cmp r0, 0x1D + ble _080CE728 + ldr r0, [r2] + ldr r1, _080CE748 + adds r0, r1 + strb r3, [r0] + ldr r1, [r2] + ldr r0, _080CE744 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xD + ble _080CE728 + ldr r0, [r2] + ldr r1, _080CE758 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _080CE75C + adds r0, r2 + strb r3, [r0] +_080CE728: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1D + bls _080CE696 +_080CE732: + movs r0, 0x1 + negs r0, r0 +_080CE736: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080CE740: .4byte 0x0000ffff +_080CE744: .4byte 0x0000216e +_080CE748: .4byte 0x0000216f +_080CE74C: .4byte 0x00002170 +_080CE750: .4byte 0x00002174 +_080CE754: .4byte 0x02039d08 +_080CE758: .4byte 0x0000216d +_080CE75C: .4byte 0x0000216c + thumb_func_end sub_80CE580 + + thumb_func_start sub_80CE760 +sub_80CE760: @ 80CE760 + push {lr} + ldr r0, _080CE780 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE77A + ldr r0, _080CE784 + ldr r1, _080CE788 + ldr r1, [r1] + ldr r2, _080CE78C + adds r1, r2 + movs r2, 0x64 + bl memcpy +_080CE77A: + pop {r0} + bx r0 + .align 2, 0 +_080CE780: .4byte 0x02039d7a +_080CE784: .4byte 0x02039d14 +_080CE788: .4byte 0x02039d08 +_080CE78C: .4byte 0x000020a4 + thumb_func_end sub_80CE760 + + thumb_func_start sub_80CE790 +sub_80CE790: @ 80CE790 + push {lr} + ldr r0, _080CE7B4 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE7D8 + ldr r0, _080CE7B8 + ldrb r0, [r0] + cmp r0, 0xE + bne _080CE7C8 + ldr r0, _080CE7BC + ldr r0, [r0] + ldr r1, _080CE7C0 + adds r0, r1 + ldr r1, _080CE7C4 + movs r2, 0x64 + bl memcpy + b _080CE7D8 + .align 2, 0 +_080CE7B4: .4byte 0x02039d7a +_080CE7B8: .4byte 0x02039d7b +_080CE7BC: .4byte 0x02039d08 +_080CE7C0: .4byte 0x000020a4 +_080CE7C4: .4byte 0x02039d14 +_080CE7C8: + ldr r0, _080CE7DC + ldr r0, [r0] + ldr r1, _080CE7E0 + adds r0, r1 + ldr r1, _080CE7E4 + movs r2, 0x50 + bl memcpy +_080CE7D8: + pop {r0} + bx r0 + .align 2, 0 +_080CE7DC: .4byte 0x02039d08 +_080CE7E0: .4byte 0x000020a4 +_080CE7E4: .4byte 0x02039d14 + thumb_func_end sub_80CE790 + + thumb_func_start sub_80CE7E8 +sub_80CE7E8: @ 80CE7E8 + push {r4,r5,lr} + ldr r0, _080CE81C + ldrb r5, [r0] + cmp r5, 0 + beq _080CE838 + bl sub_80CE760 + ldr r3, _080CE820 + ldr r1, [r3] + ldr r0, _080CE824 + adds r2, r1, r0 + ldr r0, _080CE828 + str r0, [r2] + ldr r2, _080CE82C + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r0, [r3] + ldr r4, _080CE830 + adds r0, r4 + strb r2, [r0] + ldr r0, [r3] + ldr r1, _080CE834 + adds r0, r1 + strb r2, [r0] + b _080CE8CA + .align 2, 0 +_080CE81C: .4byte 0x02039d7a +_080CE820: .4byte 0x02039d08 +_080CE824: .4byte 0x0000218c +_080CE828: .4byte 0x02039d14 +_080CE82C: .4byte 0x00002187 +_080CE830: .4byte 0x00002186 +_080CE834: .4byte 0x00002188 +_080CE838: + ldr r0, _080CE874 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CE894 + ldr r4, _080CE878 + ldr r1, [r4] + ldr r0, _080CE87C + adds r2, r1, r0 + ldr r0, _080CE880 + str r0, [r2] + ldr r0, _080CE884 + ldrb r0, [r0] + ldr r2, _080CE888 + adds r1, r2 + strb r0, [r1] + bl sub_80C70C4 + ldr r1, [r4] + subs r0, 0x1 + ldr r2, _080CE88C + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + ldr r4, _080CE890 + adds r0, r4 + strb r5, [r0] + b _080CE8CA + .align 2, 0 +_080CE874: .4byte 0x02039d78 +_080CE878: .4byte 0x02039d08 +_080CE87C: .4byte 0x0000218c +_080CE880: .4byte 0x020244ec +_080CE884: .4byte 0x02039d79 +_080CE888: .4byte 0x00002187 +_080CE88C: .4byte 0x00002186 +_080CE890: .4byte 0x00002188 +_080CE894: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl get_pokemon_by_box_and_pos + ldr r3, _080CE8D0 + ldr r2, [r3] + ldr r4, _080CE8D4 + adds r1, r2, r4 + str r0, [r1] + ldr r0, _080CE8D8 + ldrb r0, [r0] + ldr r1, _080CE8DC + adds r2, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r2, _080CE8E0 + adds r0, r2 + movs r1, 0x1D + strb r1, [r0] + ldr r0, [r3] + subs r4, 0x4 + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] +_080CE8CA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CE8D0: .4byte 0x02039d08 +_080CE8D4: .4byte 0x0000218c +_080CE8D8: .4byte 0x02039d79 +_080CE8DC: .4byte 0x00002187 +_080CE8E0: .4byte 0x00002186 + thumb_func_end sub_80CE7E8 + + thumb_func_start sub_80CE8E4 +sub_80CE8E4: @ 80CE8E4 + push {lr} + ldr r0, _080CE8F4 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE8F8 + bl sub_80CE790 + b _080CE900 + .align 2, 0 +_080CE8F4: .4byte 0x02039d7a +_080CE8F8: + ldr r0, _080CE904 + ldr r1, _080CE908 + ldrb r1, [r1] + strb r1, [r0] +_080CE900: + pop {r0} + bx r0 + .align 2, 0 +_080CE904: .4byte 0x02039d79 +_080CE908: .4byte 0x0203cf20 + thumb_func_end sub_80CE8E4 + + thumb_func_start party_compaction +party_compaction: @ 80CE90C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, _080CE958 + movs r6, 0 + movs r5, 0 + movs r0, 0x64 + mov r9, r0 + ldr r1, _080CE95C + mov r8, r1 + subs r0, 0x65 + mov r10, r0 +_080CE928: + mov r0, r9 + muls r0, r6 + mov r1, r8 + adds r4, r0, r1 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + cmp r0, 0 + beq _080CE960 + cmp r6, r5 + beq _080CE950 + mov r0, r9 + muls r0, r5 + add r0, r8 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy +_080CE950: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _080CE96A + .align 2, 0 +_080CE958: .4byte 0x0000ffff +_080CE95C: .4byte 0x020244ec +_080CE960: + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, r10 + bne _080CE96A + adds r7, r6, 0 +_080CE96A: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CE928 + lsls r7, 16 + cmp r5, 0x5 + bhi _080CE992 + movs r6, 0x64 + ldr r4, _080CE9A4 +_080CE97E: + adds r0, r5, 0 + muls r0, r6 + adds r0, r4 + bl zero_pokemon_struct + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CE97E +_080CE992: + asrs r0, r7, 16 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080CE9A4: .4byte 0x020244ec + thumb_func_end party_compaction + + thumb_func_start sub_80CE9A8 +sub_80CE9A8: @ 80CE9A8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + ldr r2, _080CE9D8 + ldr r1, [r2] + ldr r3, _080CE9DC + adds r1, r3 + strb r0, [r1] + ldr r0, _080CE9E0 + ldrb r0, [r0] + cmp r0, 0 + beq _080CE9E8 + ldr r0, [r2] + ldr r1, _080CE9E4 + adds r0, r1 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr + b _080CEA1C + .align 2, 0 +_080CE9D8: .4byte 0x02039d08 +_080CE9DC: .4byte 0x00000ceb +_080CE9E0: .4byte 0x02039d7a +_080CE9E4: .4byte 0x000020a4 +_080CE9E8: + ldr r4, _080CEA24 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x1 + bne _080CEA08 + ldr r0, _080CEA28 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080CEA2C + adds r0, r1 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr +_080CEA08: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080CEA1C + ldr r0, _080CEA28 + ldrb r0, [r0] + movs r1, 0x8 + mov r2, sp + bl set_pokemon_data_from_selected_box +_080CEA1C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CEA24: .4byte 0x02039d78 +_080CEA28: .4byte 0x02039d79 +_080CEA2C: .4byte 0x020244ec + thumb_func_end sub_80CE9A8 + + thumb_func_start sub_80CEA30 +sub_80CEA30: @ 80CEA30 + push {lr} + ldr r0, _080CEA58 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CEA64 + ldr r0, _080CEA5C + ldrb r0, [r0] + cmp r0, 0 + bne _080CEA64 + ldr r0, _080CEA60 + ldrb r0, [r0] + bl sub_80C7050 + lsls r0, 24 + cmp r0, 0 + bne _080CEA64 + movs r0, 0x1 + b _080CEA66 + .align 2, 0 +_080CEA58: .4byte 0x02039d78 +_080CEA5C: .4byte 0x02039d7a +_080CEA60: .4byte 0x02039d79 +_080CEA64: + movs r0, 0 +_080CEA66: + pop {r1} + bx r1 + thumb_func_end sub_80CEA30 + + thumb_func_start sub_80CEA6C +sub_80CEA6C: @ 80CEA6C + push {lr} + ldr r0, _080CEAB0 + ldrb r0, [r0] + cmp r0, 0 + beq _080CEAC8 + ldr r0, _080CEAB4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CEAAC + ldr r0, _080CEAB8 + ldrb r0, [r0] + bl sub_80C7050 + lsls r0, 24 + cmp r0, 0 + bne _080CEAAC + ldr r0, _080CEABC + ldr r1, [r0] + ldr r2, _080CEAC0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080CEAC8 + ldr r2, _080CEAC4 + adds r0, r1, r2 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080CEAC8 +_080CEAAC: + movs r0, 0x1 + b _080CEACA + .align 2, 0 +_080CEAB0: .4byte 0x02039d7a +_080CEAB4: .4byte 0x02039d78 +_080CEAB8: .4byte 0x02039d79 +_080CEABC: .4byte 0x02039d08 +_080CEAC0: .4byte 0x00000ced +_080CEAC4: .4byte 0x000020a4 +_080CEAC8: + movs r0, 0 +_080CEACA: + pop {r1} + bx r1 + thumb_func_end sub_80CEA6C + + thumb_func_start sub_80CEAD0 +sub_80CEAD0: @ 80CEAD0 + ldr r0, _080CEAD8 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080CEAD8: .4byte 0x02039d7a + thumb_func_end sub_80CEAD0 + + thumb_func_start sub_80CEADC +sub_80CEADC: @ 80CEADC + push {lr} + movs r1, 0 + ldr r0, _080CEAF4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x2 + bne _080CEAEE + movs r1, 0x1 +_080CEAEE: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080CEAF4: .4byte 0x02039d78 + thumb_func_end sub_80CEADC + + thumb_func_start sub_80CEAF8 +sub_80CEAF8: @ 80CEAF8 + push {lr} + movs r1, 0 + ldr r0, _080CEB1C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x3 + bne _080CEB16 + ldr r0, _080CEB20 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CEB16 + movs r1, 0x1 +_080CEB16: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080CEB1C: .4byte 0x02039d78 +_080CEB20: .4byte 0x02039d79 + thumb_func_end sub_80CEAF8 + + thumb_func_start sub_80CEB24 +sub_80CEB24: @ 80CEB24 + push {lr} + movs r1, 0 + ldr r0, _080CEB3C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CEB36 + movs r1, 0x1 +_080CEB36: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080CEB3C: .4byte 0x02039d78 + thumb_func_end sub_80CEB24 + + thumb_func_start sub_80CEB40 +sub_80CEB40: @ 80CEB40 + push {r4,lr} + ldr r0, _080CEB74 + ldr r1, [r0] + movs r2, 0 + ldr r3, _080CEB78 + ldrb r0, [r3] + cmp r0, 0 + bne _080CEB52 + movs r2, 0x1 +_080CEB52: + ldr r4, _080CEB7C + adds r0, r1, r4 + strb r2, [r0] + ldrb r0, [r3] + cmp r0, 0 + bne _080CEBD0 + ldr r0, _080CEB80 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _080CEB8A + cmp r0, 0x1 + bgt _080CEB84 + cmp r0, 0 + beq _080CEBBA + b _080CEBD0 + .align 2, 0 +_080CEB74: .4byte 0x02039d08 +_080CEB78: .4byte 0x02039d7a +_080CEB7C: .4byte 0x00000cea +_080CEB80: .4byte 0x02039d78 +_080CEB84: + cmp r0, 0x3 + bgt _080CEBD0 + b _080CEBB0 +_080CEB8A: + ldr r1, _080CEBA8 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _080CEBB0 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, _080CEBAC + adds r0, r1 + movs r1, 0 + bl sub_80CEC00 + b _080CEBD0 + .align 2, 0 +_080CEBA8: .4byte 0x02039d79 +_080CEBAC: .4byte 0x020244ec +_080CEBB0: + movs r0, 0 + movs r1, 0x2 + bl sub_80CEC00 + b _080CEBD0 +_080CEBBA: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080CEBD8 + ldrb r1, [r1] + bl get_pokemon_by_box_and_pos + movs r1, 0x1 + bl sub_80CEC00 +_080CEBD0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080CEBD8: .4byte 0x02039d79 + thumb_func_end sub_80CEB40 + + thumb_func_start sub_80CEBDC +sub_80CEBDC: @ 80CEBDC + push {lr} + ldr r0, _080CEBF0 + ldrb r0, [r0] + cmp r0, 0 + beq _080CEBF8 + ldr r0, _080CEBF4 + movs r1, 0 + bl sub_80CEC00 + b _080CEBFC + .align 2, 0 +_080CEBF0: .4byte 0x02039d7a +_080CEBF4: .4byte 0x02039d14 +_080CEBF8: + bl sub_80CEB40 +_080CEBFC: + pop {r0} + bx r0 + thumb_func_end sub_80CEBDC + + thumb_func_start sub_80CEC00 +sub_80CEC00: @ 80CEC00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + ldr r0, _080CEC64 + mov r8, r0 + ldr r1, [r0] + ldr r3, _080CEC68 + adds r2, r1, r3 + movs r0, 0 + strh r0, [r2] + mov r9, r0 + mov r10, r0 + cmp r5, 0 + bne _080CED18 + adds r6, r4, 0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + mov r2, r8 + ldr r1, [r2] + ldr r3, _080CEC6C + adds r1, r3 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080CEC44 + b _080CEE34 +_080CEC44: + adds r0, r4, 0 + movs r1, 0x4 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + beq _080CEC74 + mov r1, r8 + ldr r0, [r1] + ldr r2, _080CEC70 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080CEC86 + .align 2, 0 +_080CEC64: .4byte 0x02039d08 +_080CEC68: .4byte 0x00000ce6 +_080CEC6C: .4byte 0x00000ce4 +_080CEC70: .4byte 0x00000ced +_080CEC74: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + mov r3, r8 + ldr r1, [r3] + ldr r2, _080CECFC + adds r1, r2 + strb r0, [r1] +_080CEC86: + ldr r4, _080CED00 + ldr r2, [r4] + ldr r5, _080CED04 + adds r2, r5 + adds r0, r6, 0 + movs r1, 0x2 + bl pokemon_getattr + ldr r0, [r4] + adds r0, r5 + bl get_end_of_string_ptr_limit_10_chars + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [r4] + ldr r3, _080CED08 + adds r1, r3 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x8 + bl pokemon_getattr + ldr r1, [r4] + ldr r2, _080CED0C + adds r1, r2 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, [r4] + movs r3, 0xCE + lsls r3, 4 + adds r1, r3 + str r0, [r1] + adds r0, r6, 0 + bl pokemon_get_pal + ldr r1, [r4] + ldr r2, _080CED10 + adds r1, r2 + str r0, [r1] + adds r0, r6, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_getattr + ldr r1, [r4] + ldr r3, _080CED14 + adds r1, r3 + strh r0, [r1] + b _080CEE26 + .align 2, 0 +_080CECFC: .4byte 0x00000ced +_080CED00: .4byte 0x02039d08 +_080CED04: .4byte 0x00000cee +_080CED08: .4byte 0x00000cec +_080CED0C: .4byte 0x00000ceb +_080CED10: .4byte 0x00000cdc +_080CED14: .4byte 0x00000ce6 +_080CED18: + cmp r5, 0x1 + beq _080CED1E + b _080CEE1C +_080CED1E: + adds r7, r4, 0 + adds r0, r7, 0 + movs r1, 0x41 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + ldr r3, _080CED64 + adds r1, r3 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080CED3A + b _080CEE34 +_080CED3A: + adds r0, r7, 0 + movs r1, 0x1 + bl pokemon_getattr_encrypted + mov r9, r0 + adds r0, r7, 0 + movs r1, 0x4 + bl pokemon_getattr_encrypted + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + beq _080CED6C + mov r1, r8 + ldr r0, [r1] + ldr r2, _080CED68 + adds r0, r2 + strb r5, [r0] + b _080CED7E + .align 2, 0 +_080CED64: .4byte 0x00000ce4 +_080CED68: .4byte 0x00000ced +_080CED6C: + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_getattr_encrypted + mov r3, r8 + ldr r1, [r3] + ldr r2, _080CEE00 + adds r1, r2 + strb r0, [r1] +_080CED7E: + ldr r5, _080CEE04 + ldr r2, [r5] + ldr r4, _080CEE08 + adds r2, r4 + adds r0, r7, 0 + movs r1, 0x2 + bl pokemon_getattr_encrypted + ldr r0, [r5] + adds r0, r4 + bl get_end_of_string_ptr_limit_10_chars + adds r0, r7, 0 + bl sub_80690C0 + ldr r1, [r5] + ldr r3, _080CEE0C + adds r1, r3 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x8 + bl pokemon_getattr_encrypted + ldr r1, [r5] + ldr r2, _080CEE10 + adds r1, r2 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0 + bl pokemon_getattr_encrypted + adds r2, r0, 0 + ldr r1, [r5] + movs r6, 0xCE + lsls r6, 4 + adds r0, r1, r6 + str r2, [r0] + subs r4, 0xA + adds r1, r4 + ldrh r0, [r1] + mov r1, r9 + bl species_and_otid_get_pal + ldr r1, [r5] + ldr r3, _080CEE14 + adds r2, r1, r3 + str r0, [r2] + adds r4, r1, r4 + ldrh r0, [r4] + adds r1, r6 + ldr r1, [r1] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + ldr r1, [r5] + ldr r2, _080CEE18 + adds r1, r2 + strh r0, [r1] + b _080CEE26 + .align 2, 0 +_080CEE00: .4byte 0x00000ced +_080CEE04: .4byte 0x02039d08 +_080CEE08: .4byte 0x00000cee +_080CEE0C: .4byte 0x00000cec +_080CEE10: .4byte 0x00000ceb +_080CEE14: .4byte 0x00000cdc +_080CEE18: .4byte 0x00000ce6 +_080CEE1C: + ldr r3, _080CEE78 + adds r0, r1, r3 + mov r1, r9 + strh r1, [r0] + strh r1, [r2] +_080CEE26: + ldr r0, _080CEE7C + ldr r1, [r0] + ldr r2, _080CEE78 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0 + bne _080CEE94 +_080CEE34: + ldr r4, _080CEE7C + ldr r0, [r4] + ldr r3, _080CEE80 + adds r0, r3 + movs r1, 0 + movs r2, 0x5 + bl sub_80090FC + ldr r0, [r4] + ldr r1, _080CEE84 + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC + ldr r0, [r4] + ldr r2, _080CEE88 + adds r0, r2 + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC + ldr r0, [r4] + ldr r3, _080CEE8C + adds r0, r3 + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC + ldr r0, [r4] + ldr r1, _080CEE90 + adds r0, r1 + b _080CEEF2 + .align 2, 0 +_080CEE78: .4byte 0x00000ce4 +_080CEE7C: .4byte 0x02039d08 +_080CEE80: .4byte 0x00000cee +_080CEE84: .4byte 0x00000cf9 +_080CEE88: .4byte 0x00000d1d +_080CEE8C: .4byte 0x00000d41 +_080CEE90: .4byte 0x00000d65 +_080CEE94: + ldr r3, _080CEEB8 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080CEF14 + mov r0, r10 + cmp r0, 0 + beq _080CEEC0 + ldr r2, _080CEEBC + adds r0, r1, r2 + adds r3, 0x1 + adds r1, r3 + movs r2, 0 + movs r3, 0x5 + bl sub_8009128 + b _080CEECE + .align 2, 0 +_080CEEB8: .4byte 0x00000ced +_080CEEBC: .4byte 0x00000cf9 +_080CEEC0: + ldr r2, _080CEEFC + adds r0, r1, r2 + ldr r1, _080CEF00 + movs r2, 0 + movs r3, 0x8 + bl sub_8009128 +_080CEECE: + ldr r4, _080CEF04 + ldr r0, [r4] + ldr r3, _080CEF08 + adds r0, r3 + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC + ldr r0, [r4] + ldr r1, _080CEF0C + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC + ldr r0, [r4] + ldr r2, _080CEF10 + adds r0, r2 +_080CEEF2: + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC + b _080CF0B8 + .align 2, 0 +_080CEEFC: .4byte 0x00000cf9 +_080CEF00: .4byte 0x085e8264 +_080CEF04: .4byte 0x02039d08 +_080CEF08: .4byte 0x00000d1d +_080CEF0C: .4byte 0x00000d41 +_080CEF10: .4byte 0x00000d65 +_080CEF14: + cmp r2, 0x1D + beq _080CEF1C + cmp r2, 0x20 + bne _080CEF20 +_080CEF1C: + movs r3, 0xFF + mov r9, r3 +_080CEF20: + ldr r4, _080CEFA0 + ldr r1, [r4] + ldr r2, _080CEFA4 + adds r0, r1, r2 + ldr r3, _080CEFA8 + adds r1, r3 + movs r2, 0 + movs r3, 0x5 + bl sub_8009128 + ldr r1, [r4] + ldr r0, _080CEFAC + adds r2, r1, r0 + movs r0, 0xBA + strb r0, [r2] + ldr r3, _080CEFB0 + adds r2, r1, r3 + ldr r0, [r4] + ldr r1, _080CEFB4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, _080CEFB8 + adds r1, r0 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x5 + bl sub_8009128 + ldr r4, [r4] + ldr r3, _080CEFBC + adds r2, r4, r3 + movs r0, 0xFC + strb r0, [r2] + ldr r0, _080CEFC0 + adds r2, r4, r0 + movs r0, 0x4 + strb r0, [r2] + ldr r1, _080CEFC4 + adds r2, r4, r1 + mov r3, r9 + cmp r3, 0 + beq _080CEFD4 + cmp r3, 0xFE + beq _080CF000 + movs r0, 0x2 + strb r0, [r2] + ldr r0, _080CEFC8 + adds r2, r4, r0 + movs r0, 0x1 + strb r0, [r2] + adds r1, 0x2 + adds r2, r4, r1 + movs r0, 0x3 + strb r0, [r2] + ldr r3, _080CEFCC + adds r2, r4, r3 + movs r0, 0x77 + strb r0, [r2] + ldr r0, _080CEFD0 + adds r2, r4, r0 + b _080CF020 + .align 2, 0 +_080CEFA0: .4byte 0x02039d08 +_080CEFA4: .4byte 0x00000cf9 +_080CEFA8: .4byte 0x00000cee +_080CEFAC: .4byte 0x00000d1d +_080CEFB0: .4byte 0x00000d1e +_080CEFB4: .4byte 0x00000ce4 +_080CEFB8: .4byte 0x083185c8 +_080CEFBC: .4byte 0x00000d41 +_080CEFC0: .4byte 0x00000d42 +_080CEFC4: .4byte 0x00000d43 +_080CEFC8: .4byte 0x00000d44 +_080CEFCC: .4byte 0x00000d46 +_080CEFD0: .4byte 0x00000d47 +_080CEFD4: + strb r0, [r2] + ldr r1, _080CEFF4 + adds r2, r4, r1 + movs r0, 0x1 + strb r0, [r2] + ldr r3, _080CEFF8 + adds r2, r4, r3 + movs r0, 0x5 + strb r0, [r2] + ldr r0, _080CEFFC + adds r2, r4, r0 + movs r0, 0xB5 + strb r0, [r2] + adds r1, 0x3 + adds r2, r4, r1 + b _080CF020 + .align 2, 0 +_080CEFF4: .4byte 0x00000d44 +_080CEFF8: .4byte 0x00000d45 +_080CEFFC: .4byte 0x00000d46 +_080CF000: + movs r0, 0x6 + strb r0, [r2] + ldr r3, _080CF090 + adds r2, r4, r3 + movs r0, 0x1 + strb r0, [r2] + ldr r0, _080CF094 + adds r2, r4, r0 + movs r0, 0x7 + strb r0, [r2] + ldr r1, _080CF098 + adds r2, r4, r1 + movs r0, 0xB6 + strb r0, [r2] + adds r3, 0x3 + adds r2, r4, r3 +_080CF020: + movs r0, 0xFC + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x4 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x2 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x1 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x3 + strb r0, [r2] + adds r2, 0x1 + movs r5, 0 + strb r5, [r2] + adds r2, 0x1 + movs r0, 0xF9 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x5 + strb r0, [r2] + adds r2, 0x1 + ldr r4, _080CF09C + ldr r0, [r4] + ldr r1, _080CF0A0 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r2, r0, 0 + strb r5, [r2] + movs r0, 0xFF + strb r0, [r2, 0x1] + ldr r4, [r4] + ldr r2, _080CF0A4 + adds r1, r4, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _080CF0AC + ldr r3, _080CF0A8 + adds r4, r3 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x8 + bl sub_8009128 + b _080CF0B8 + .align 2, 0 +_080CF090: .4byte 0x00000d44 +_080CF094: .4byte 0x00000d45 +_080CF098: .4byte 0x00000d46 +_080CF09C: .4byte 0x02039d08 +_080CF0A0: .4byte 0x00000cec +_080CF0A4: .4byte 0x00000ce6 +_080CF0A8: .4byte 0x00000d65 +_080CF0AC: + ldr r1, _080CF0C8 + adds r0, r4, r1 + movs r1, 0 + movs r2, 0x8 + bl sub_80090FC +_080CF0B8: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080CF0C8: .4byte 0x00000d65 + thumb_func_end sub_80CEC00 + + thumb_func_start sub_80CF0CC +sub_80CF0CC: @ 80CF0CC + push {lr} + ldr r0, _080CF0EC + ldr r0, [r0] + ldr r1, _080CF0F0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CF0F4 + cmp r0, 0x1 + ble _080CF0E4 + cmp r0, 0x2 + beq _080CF0FA +_080CF0E4: + bl sub_80CF108 + b _080CF0FE + .align 2, 0 +_080CF0EC: .4byte 0x02039d08 +_080CF0F0: .4byte 0x000021ff +_080CF0F4: + bl sub_80CF374 + b _080CF0FE +_080CF0FA: + bl sub_80CF4B0 +_080CF0FE: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CF0CC + + thumb_func_start sub_80CF108 +sub_80CF108: @ 80CF108 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _080CF18C + ldrb r0, [r0] + mov r8, r0 + ldr r2, _080CF190 + ldrb r4, [r2] + ldr r5, _080CF194 + ldr r0, [r5] + ldr r1, _080CF198 + mov r10, r1 + add r0, r10 + movs r1, 0 + strb r1, [r0] + ldr r0, [r5] + ldr r7, _080CF19C + adds r0, r7 + strb r1, [r0] + ldr r0, [r5] + ldr r3, _080CF1A0 + mov r9, r3 + add r0, r9 + strb r1, [r0] + ldr r6, _080CF1A4 + ldrh r1, [r6, 0x30] + movs r0, 0x40 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _080CF14C + b _080CF33C +_080CF14C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080CF1A8 + movs r6, 0x1 + lsls r0, r4, 24 + movs r1, 0xC0 + lsls r1, 19 + adds r0, r1 + lsrs r4, r0, 24 + asrs r0, 24 + cmp r0, 0x1D + bgt _080CF168 + b _080CF358 +_080CF168: + movs r2, 0x3 + mov r8, r2 + subs r0, 0x1E + lsls r0, 24 + asrs r0, 24 + movs r1, 0x3 + bl __divsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [r5] + add r0, r10 + strb r6, [r0] + ldr r0, [r5] + add r0, r9 + strb r6, [r0] + b _080CF358 + .align 2, 0 +_080CF18C: .4byte 0x02039d78 +_080CF190: .4byte 0x02039d79 +_080CF194: .4byte 0x02039d08 +_080CF198: .4byte 0x00000cd2 +_080CF19C: .4byte 0x00000cd3 +_080CF1A0: .4byte 0x00000cd7 +_080CF1A4: .4byte 0x030022c0 +_080CF1A8: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF1DE + movs r6, 0x1 + movs r0, 0 + ldrsb r0, [r3, r0] + movs r1, 0x6 + bl __modsi3 + lsls r0, 24 + cmp r0, 0 + beq _080CF1CA + lsls r0, r4, 24 + movs r3, 0xFF + lsls r3, 24 + b _080CF34C +_080CF1CA: + ldr r0, [r5] + adds r0, r7 + movs r1, 0xFF + strb r1, [r0] + lsls r0, r4, 24 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r4, r0, 24 + b _080CF358 +_080CF1DE: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF212 + movs r6, 0x1 + movs r0, 0 + ldrsb r0, [r3, r0] + adds r0, 0x1 + movs r1, 0x6 + bl __modsi3 + cmp r0, 0 + beq _080CF204 + lsls r0, r4, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r4, r0, 24 + b _080CF358 +_080CF204: + ldr r0, [r5] + adds r0, r7 + strb r6, [r0] + lsls r0, r4, 24 + movs r3, 0xFB + lsls r3, 24 + b _080CF34C +_080CF212: + ldrh r1, [r6, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080CF220 + movs r6, 0x1 + b _080CF352 +_080CF220: + movs r4, 0x1 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF2E4 + bl sub_80CFA5C + lsls r0, 24 + cmp r0, 0 + beq _080CF2E4 + ldr r0, _080CF240 + ldrb r0, [r0] + cmp r0, 0 + bne _080CF244 + movs r0, 0x8 + b _080CF366 + .align 2, 0 +_080CF240: .4byte 0x02039d7d +_080CF244: + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x2 + bne _080CF254 + ldr r0, _080CF270 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080CF2D4 +_080CF254: + movs r0, 0 + bl sub_80CFF98 + subs r0, 0x1 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bhi _080CF2E4 + lsls r0, 2 + ldr r1, _080CF274 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CF270: .4byte 0x02039d7a +_080CF274: .4byte _080CF278 + .align 2, 0 +_080CF278: + .4byte _080CF2B4 + .4byte _080CF2B8 + .4byte _080CF2BC + .4byte _080CF2C0 + .4byte _080CF2C4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2C8 + .4byte _080CF2CC + .4byte _080CF2E4 + .4byte _080CF2D0 +_080CF2B4: + movs r0, 0xB + b _080CF366 +_080CF2B8: + movs r0, 0xC + b _080CF366 +_080CF2BC: + movs r0, 0xD + b _080CF366 +_080CF2C0: + movs r0, 0xE + b _080CF366 +_080CF2C4: + movs r0, 0xF + b _080CF366 +_080CF2C8: + movs r0, 0x10 + b _080CF366 +_080CF2CC: + movs r0, 0x11 + b _080CF366 +_080CF2D0: + movs r0, 0x12 + b _080CF366 +_080CF2D4: + ldr r2, _080CF2E0 + adds r0, r1, r2 + strb r4, [r0] + movs r0, 0x14 + b _080CF366 + .align 2, 0 +_080CF2E0: .4byte 0x000021ff +_080CF2E4: + ldr r2, _080CF2F4 + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF2F8 + movs r0, 0x13 + b _080CF366 + .align 2, 0 +_080CF2F4: .4byte 0x030022c0 +_080CF2F8: + ldr r0, _080CF314 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080CF326 + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080CF318 + movs r0, 0xA + b _080CF366 + .align 2, 0 +_080CF314: .4byte 0x03005d90 +_080CF318: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080CF326 + movs r0, 0x9 + b _080CF366 +_080CF326: + ldrh r1, [r2, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF338 + bl sub_80CFDC4 + movs r0, 0 + b _080CF366 +_080CF338: + movs r6, 0 + b _080CF364 +_080CF33C: + movs r6, 0x1 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0x5 + ble _080CF352 + lsls r0, r4, 24 + movs r3, 0xFA + lsls r3, 24 +_080CF34C: + adds r0, r3 + lsrs r4, r0, 24 + b _080CF358 +_080CF352: + movs r0, 0x2 + mov r8, r0 + movs r4, 0 +_080CF358: + cmp r6, 0 + beq _080CF364 + mov r0, r8 + adds r1, r4, 0 + bl sub_80CD894 +_080CF364: + adds r0, r6, 0 +_080CF366: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CF108 + + thumb_func_start sub_80CF374 +sub_80CF374: @ 80CF374 + push {r4,lr} + ldr r1, _080CF3A4 + ldrh r0, [r1, 0x2C] + movs r4, 0x1 + ands r4, r0 + cmp r4, 0 + beq _080CF428 + ldrh r1, [r1, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080CF3AC + ldr r4, _080CF3A8 + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __divsi3 + lsls r0, 24 + cmp r0, 0 + beq _080CF420 + ldrb r1, [r4] + subs r1, 0x6 + b _080CF40E + .align 2, 0 +_080CF3A4: .4byte 0x030022c0 +_080CF3A8: .4byte 0x02039d79 +_080CF3AC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080CF3CC + ldr r1, _080CF3C8 + movs r0, 0 + ldrsb r0, [r1, r0] + adds r0, 0x6 + cmp r0, 0x1D + bgt _080CF420 + ldrb r1, [r1] + adds r1, 0x6 + b _080CF40E + .align 2, 0 +_080CF3C8: .4byte 0x02039d79 +_080CF3CC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF3F0 + ldr r4, _080CF3EC + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __modsi3 + lsls r0, 24 + cmp r0, 0 + beq _080CF420 + ldrb r1, [r4] + subs r1, 0x1 + b _080CF40E + .align 2, 0 +_080CF3EC: .4byte 0x02039d79 +_080CF3F0: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF424 + ldr r4, _080CF41C + movs r0, 0 + ldrsb r0, [r4, r0] + adds r0, 0x1 + movs r1, 0x6 + bl __modsi3 + cmp r0, 0 + beq _080CF420 + ldrb r1, [r4] + adds r1, 0x1 +_080CF40E: + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80CD894 + movs r0, 0x15 + b _080CF49C + .align 2, 0 +_080CF41C: .4byte 0x02039d79 +_080CF420: + movs r0, 0x18 + b _080CF49C +_080CF424: + movs r0, 0 + b _080CF49C +_080CF428: + bl sub_80D0BA4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080CF464 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + cmp r0, r1 + beq _080CF47C + ldr r2, _080CF468 + ldr r0, _080CF46C + ldr r1, [r0] + ldr r3, _080CF470 + adds r0, r1, r3 + ldrh r0, [r0] + negs r0, r0 + lsrs r0, 31 + strb r0, [r2] + ldr r0, _080CF474 + adds r1, r0 + movs r0, 0x2 + strb r0, [r1] + bl get_preferred_box + ldr r1, _080CF478 + strb r0, [r1] + movs r0, 0x17 + b _080CF49C + .align 2, 0 +_080CF464: .4byte 0x02039d79 +_080CF468: .4byte 0x02039d7a +_080CF46C: .4byte 0x02039d08 +_080CF470: .4byte 0x00000ce4 +_080CF474: .4byte 0x000021ff +_080CF478: .4byte 0x02039d7b +_080CF47C: + ldr r1, _080CF4A4 + ldr r0, [r1] + ldr r2, _080CF4A8 + adds r0, r2 + strb r4, [r0] + ldr r0, [r1] + ldr r3, _080CF4AC + adds r0, r3 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x16 +_080CF49C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080CF4A4: .4byte 0x02039d08 +_080CF4A8: .4byte 0x000021ff +_080CF4AC: .4byte 0x00000cb8 + thumb_func_end sub_80CF374 + + thumb_func_start sub_80CF4B0 +sub_80CF4B0: @ 80CF4B0 + push {r4,lr} + ldr r2, _080CF4D4 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080CF4DC + movs r0, 0 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF588 + ldr r0, _080CF4D8 + ldrb r1, [r0] + subs r1, 0x6 + b _080CF53A + .align 2, 0 +_080CF4D4: .4byte 0x030022c0 +_080CF4D8: .4byte 0x02039d79 +_080CF4DC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080CF4FC + movs r0, 0x1 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF588 + ldr r0, _080CF4F8 + ldrb r1, [r0] + adds r1, 0x6 + b _080CF53A + .align 2, 0 +_080CF4F8: .4byte 0x02039d79 +_080CF4FC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF51C + movs r0, 0x2 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF5A2 + ldr r0, _080CF518 + ldrb r1, [r0] + subs r1, 0x1 + b _080CF53A + .align 2, 0 +_080CF518: .4byte 0x02039d79 +_080CF51C: + movs r0, 0x10 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080CF54C + movs r0, 0x3 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF5B6 + ldr r0, _080CF548 + ldrb r1, [r0] + adds r1, 0x1 +_080CF53A: + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80CD894 + movs r0, 0x19 + b _080CF5BC + .align 2, 0 +_080CF548: .4byte 0x02039d79 +_080CF54C: + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF580 + bl sub_80D0BC0 + lsls r0, 24 + cmp r0, 0 + beq _080CF588 + ldr r0, _080CF574 + strb r4, [r0] + ldr r0, _080CF578 + ldr r0, [r0] + ldr r1, _080CF57C + adds r0, r1 + strb r4, [r0] + movs r0, 0x1A + b _080CF5BC + .align 2, 0 +_080CF574: .4byte 0x02039d7a +_080CF578: .4byte 0x02039d08 +_080CF57C: .4byte 0x000021ff +_080CF580: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF58C +_080CF588: + movs r0, 0x18 + b _080CF5BC +_080CF58C: + ldr r0, _080CF5A8 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080CF5BA + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080CF5AC +_080CF5A2: + movs r0, 0xA + b _080CF5BC + .align 2, 0 +_080CF5A8: .4byte 0x03005d90 +_080CF5AC: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080CF5BA +_080CF5B6: + movs r0, 0x9 + b _080CF5BC +_080CF5BA: + movs r0, 0 +_080CF5BC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80CF4B0 + + thumb_func_start sub_80CF5C4 +sub_80CF5C4: @ 80CF5C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, _080CF634 + ldrb r0, [r0] + mov r9, r0 + ldr r6, _080CF638 + ldrb r4, [r6] + ldr r2, _080CF63C + ldr r0, [r2] + ldr r1, _080CF640 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _080CF644 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x5 + adds r0, r3 + strb r1, [r0] + mov r8, r1 + movs r7, 0 + ldr r1, _080CF648 + ldrh r3, [r1, 0x30] + movs r0, 0x40 + ands r0, r3 + adds r5, r6, 0 + mov r12, r1 + cmp r0, 0 + beq _080CF608 + b _080CF7A8 +_080CF608: + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _080CF64C + lsls r0, r4, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r4, r0, 24 + asrs r0, 24 + cmp r0, 0x6 + ble _080CF622 + movs r4, 0 +_080CF622: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r5, r1] + cmp r0, r1 + bne _080CF630 + b _080CF7C6 +_080CF630: + movs r7, 0x1 + b _080CF7CA + .align 2, 0 +_080CF634: .4byte 0x02039d78 +_080CF638: .4byte 0x02039d79 +_080CF63C: .4byte 0x02039d08 +_080CF640: .4byte 0x00000cd3 +_080CF644: .4byte 0x00000cd2 +_080CF648: .4byte 0x030022c0 +_080CF64C: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _080CF670 + ldrb r1, [r5] + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + beq _080CF670 + movs r7, 0x1 + ldr r0, [r2] + ldr r2, _080CF66C + adds r0, r2 + strb r1, [r0] + movs r4, 0 + b _080CF7C6 + .align 2, 0 +_080CF66C: .4byte 0x00000cd6 +_080CF670: + mov r3, r12 + ldrh r1, [r3, 0x30] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF69E + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + bne _080CF694 + movs r7, 0x1 + ldr r0, [r2] + ldr r1, _080CF690 + adds r0, r1 + ldrb r4, [r0] + b _080CF7C6 + .align 2, 0 +_080CF690: .4byte 0x00000cd6 +_080CF694: + movs r7, 0x6 + movs r2, 0 + mov r9, r2 + movs r4, 0 + b _080CF7C6 +_080CF69E: + mov r3, r12 + ldrh r1, [r3, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF75C + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0x6 + bne _080CF6C4 + ldr r0, [r2] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080CF6BE + movs r0, 0x4 + b _080CF7D8 +_080CF6BE: + movs r0, 0x1 + mov r8, r0 + b _080CF75C +_080CF6C4: + bl sub_80CFA5C + lsls r0, 24 + cmp r0, 0 + beq _080CF75C + ldr r0, _080CF6DC + ldrb r0, [r0] + cmp r0, 0 + bne _080CF6E0 + movs r0, 0x8 + b _080CF7D8 + .align 2, 0 +_080CF6DC: .4byte 0x02039d7d +_080CF6E0: + movs r0, 0 + bl sub_80CFF98 + subs r0, 0x1 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bhi _080CF75C + lsls r0, 2 + ldr r1, _080CF6FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080CF6FC: .4byte _080CF700 + .align 2, 0 +_080CF700: + .4byte _080CF73C + .4byte _080CF740 + .4byte _080CF744 + .4byte _080CF748 + .4byte _080CF74C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF750 + .4byte _080CF754 + .4byte _080CF75C + .4byte _080CF758 +_080CF73C: + movs r0, 0xB + b _080CF7D8 +_080CF740: + movs r0, 0xC + b _080CF7D8 +_080CF744: + movs r0, 0xD + b _080CF7D8 +_080CF748: + movs r0, 0xE + b _080CF7D8 +_080CF74C: + movs r0, 0xF + b _080CF7D8 +_080CF750: + movs r0, 0x10 + b _080CF7D8 +_080CF754: + movs r0, 0x11 + b _080CF7D8 +_080CF758: + movs r0, 0x12 + b _080CF7D8 +_080CF75C: + ldr r2, _080CF778 + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + beq _080CF784 + ldr r0, _080CF77C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080CF780 + movs r0, 0x13 + b _080CF7D8 + .align 2, 0 +_080CF778: .4byte 0x030022c0 +_080CF77C: .4byte 0x02039d08 +_080CF780: + movs r1, 0x1 + mov r8, r1 +_080CF784: + mov r2, r8 + cmp r2, 0 + beq _080CF794 + movs r7, 0x6 + movs r3, 0 + mov r9, r3 + movs r4, 0 + b _080CF7C6 +_080CF794: + mov r0, r12 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF7C6 + bl sub_80CFDC4 + movs r0, 0 + b _080CF7D8 +_080CF7A8: + lsls r0, r4, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r4, r0, 24 + cmp r0, 0 + bge _080CF7B8 + movs r4, 0x6 +_080CF7B8: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r6, r1] + cmp r0, r1 + beq _080CF7C6 + movs r7, 0x1 +_080CF7C6: + cmp r7, 0 + beq _080CF7D6 +_080CF7CA: + cmp r7, 0x6 + beq _080CF7D6 + mov r0, r9 + adds r1, r4, 0 + bl sub_80CD894 +_080CF7D6: + adds r0, r7, 0 +_080CF7D8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CF5C4 + + thumb_func_start sub_80CF7E4 +sub_80CF7E4: @ 80CF7E4 + push {r4-r6,lr} + ldr r3, _080CF820 + ldr r0, [r3] + ldr r1, _080CF824 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + ldr r2, _080CF828 + adds r0, r2 + strb r1, [r0] + ldr r0, [r3] + ldr r5, _080CF82C + adds r0, r5 + strb r1, [r0] + ldr r1, _080CF830 + ldrh r2, [r1, 0x30] + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _080CF8AA + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080CF834 + movs r4, 0x1 + movs r1, 0 + movs r6, 0x2 + b _080CF8B6 + .align 2, 0 +_080CF820: .4byte 0x02039d08 +_080CF824: .4byte 0x00000cd3 +_080CF828: .4byte 0x00000cd2 +_080CF82C: .4byte 0x00000cd7 +_080CF830: .4byte 0x030022c0 +_080CF834: + ldrh r2, [r1, 0x2C] + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080CF85A + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _080CF86E + ldr r0, _080CF860 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080CF872 + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _080CF864 +_080CF85A: + movs r0, 0xA + b _080CF8D2 + .align 2, 0 +_080CF860: .4byte 0x03005d90 +_080CF864: + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _080CF872 +_080CF86E: + movs r0, 0x9 + b _080CF8D2 +_080CF872: + ldrh r1, [r1, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF88A + movs r0, 0 + bl sub_80CD1A8 + bl sub_80CFA38 + movs r0, 0x7 + b _080CF8D2 +_080CF88A: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF896 + movs r0, 0x13 + b _080CF8D2 +_080CF896: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF8A6 + bl sub_80CFDC4 + movs r0, 0 + b _080CF8D2 +_080CF8A6: + movs r4, 0 + b _080CF8D0 +_080CF8AA: + movs r4, 0x1 + movs r1, 0x3 + movs r6, 0 + ldr r0, [r3] + adds r0, r5 + strb r4, [r0] +_080CF8B6: + cmp r4, 0 + beq _080CF8D0 + lsls r5, r1, 24 + cmp r1, 0x2 + beq _080CF8C6 + movs r0, 0 + bl sub_80CD1A8 +_080CF8C6: + lsrs r0, r5, 24 + lsls r1, r6, 24 + lsrs r1, 24 + bl sub_80CD894 +_080CF8D0: + adds r0, r4, 0 +_080CF8D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80CF7E4 + + thumb_func_start sub_80CF8D8 +sub_80CF8D8: @ 80CF8D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080CF928 + ldrb r0, [r0] + mov r8, r0 + ldr r0, _080CF92C + mov r12, r0 + ldrb r2, [r0] + ldr r3, _080CF930 + ldr r0, [r3] + ldr r1, _080CF934 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + ldr r6, _080CF938 + adds r0, r6 + strb r1, [r0] + ldr r0, [r3] + ldr r5, _080CF93C + adds r0, r5 + strb r1, [r0] + ldr r7, _080CF940 + ldrh r1, [r7, 0x30] + movs r0, 0x40 + ands r0, r1 + adds r4, r3, 0 + cmp r0, 0 + bne _080CF9B2 + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + beq _080CF944 + movs r7, 0x1 + movs r0, 0x2 + mov r8, r0 + movs r2, 0 + ldr r0, [r4] + b _080CF9D0 + .align 2, 0 +_080CF928: .4byte 0x02039d78 +_080CF92C: .4byte 0x02039d79 +_080CF930: .4byte 0x02039d08 +_080CF934: .4byte 0x00000cd3 +_080CF938: .4byte 0x00000cd2 +_080CF93C: .4byte 0x00000cd7 +_080CF940: .4byte 0x030022c0 +_080CF944: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF960 + movs r7, 0x1 + lsls r0, r2, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r2, r0, 24 + cmp r0, 0 + bge _080CF9D4 + movs r2, 0x1 + b _080CF9D4 +_080CF960: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF97E + movs r7, 0x1 + lsls r0, r2, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x1 + ble _080CF9D4 + movs r2, 0 + b _080CF9D4 +_080CF97E: + ldrh r1, [r7, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF992 + movs r0, 0x4 + cmp r2, 0 + bne _080CF9E2 + movs r0, 0x5 + b _080CF9E2 +_080CF992: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF99E + movs r0, 0x13 + b _080CF9E2 +_080CF99E: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF9AE + bl sub_80CFDC4 + movs r0, 0 + b _080CF9E2 +_080CF9AE: + movs r7, 0 + b _080CF9E0 +_080CF9B2: + movs r7, 0x1 + movs r0, 0 + mov r8, r0 + ldr r0, [r3] + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + mov r1, r12 + movs r0, 0 + ldrsb r0, [r1, r0] + movs r2, 0x1D + cmp r0, 0 + bne _080CF9CE + movs r2, 0x18 +_080CF9CE: + ldr r0, [r3] +_080CF9D0: + adds r0, r5 + strb r7, [r0] +_080CF9D4: + cmp r7, 0 + beq _080CF9E0 + mov r0, r8 + adds r1, r2, 0 + bl sub_80CD894 +_080CF9E0: + adds r0, r7, 0 +_080CF9E2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CF8D8 + + thumb_func_start sub_80CF9EC +sub_80CF9EC: @ 80CF9EC + push {r4,r5,lr} + movs r3, 0 + ldr r0, _080CFA18 + ldr r1, [r0] + adds r4, r0, 0 + cmp r1, 0 + beq _080CFA30 + ldr r5, _080CFA1C +_080CF9FC: + lsls r0, r3, 3 + adds r2, r0, r4 + movs r1, 0x4 + ldrsb r1, [r2, r1] + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r1, r0 + bne _080CFA20 + ldr r0, [r2] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + b _080CFA32 + .align 2, 0 +_080CFA18: .4byte 0x0857b9bc +_080CFA1C: .4byte 0x02039d78 +_080CFA20: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r0, r3, 3 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + bne _080CF9FC +_080CFA30: + movs r0, 0 +_080CFA32: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CF9EC + + thumb_func_start sub_80CFA38 +sub_80CFA38: @ 80CFA38 + push {lr} + bl sub_80CFEF0 + movs r0, 0x9 + bl sub_80CFF34 + movs r0, 0xA + bl sub_80CFF34 + movs r0, 0xB + bl sub_80CFF34 + movs r0, 0 + bl sub_80CFF34 + pop {r0} + bx r0 + thumb_func_end sub_80CFA38 + + thumb_func_start sub_80CFA5C +sub_80CFA5C: @ 80CFA5C + push {lr} + bl sub_80CFEF0 + ldr r0, _080CFA74 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CFA78 + bl sub_80CFB44 + b _080CFA7C + .align 2, 0 +_080CFA74: .4byte 0x02039d08 +_080CFA78: + bl sub_80CFA84 +_080CFA7C: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CFA5C + + thumb_func_start sub_80CFA84 +sub_80CFA84: @ 80CFA84 + push {lr} + bl sub_80CD504 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _080CFAA4 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080CFAAE + cmp r0, 0x1 + bgt _080CFAA8 + cmp r0, 0 + beq _080CFABA + b _080CFAF4 + .align 2, 0 +_080CFAA4: .4byte 0x02039d08 +_080CFAA8: + cmp r0, 0x2 + beq _080CFAC6 + b _080CFAF4 +_080CFAAE: + cmp r1, 0 + beq _080CFAF4 + movs r0, 0x1 + bl sub_80CFF34 + b _080CFAF8 +_080CFABA: + cmp r1, 0 + beq _080CFAF4 + movs r0, 0x2 + bl sub_80CFF34 + b _080CFAF8 +_080CFAC6: + ldr r0, _080CFADC + ldrb r0, [r0] + cmp r0, 0 + beq _080CFAE8 + cmp r1, 0 + beq _080CFAE0 + movs r0, 0x4 + bl sub_80CFF34 + b _080CFAF8 + .align 2, 0 +_080CFADC: .4byte 0x02039d7a +_080CFAE0: + movs r0, 0x5 + bl sub_80CFF34 + b _080CFAF8 +_080CFAE8: + cmp r1, 0 + beq _080CFAF4 + movs r0, 0x3 + bl sub_80CFF34 + b _080CFAF8 +_080CFAF4: + movs r0, 0 + b _080CFB3E +_080CFAF8: + movs r0, 0x6 + bl sub_80CFF34 + ldr r0, _080CFB1C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _080CFB2A + ldr r0, _080CFB20 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFB24 + movs r0, 0x2 + bl sub_80CFF34 + b _080CFB2A + .align 2, 0 +_080CFB1C: .4byte 0x02039d08 +_080CFB20: .4byte 0x02039d78 +_080CFB24: + movs r0, 0x1 + bl sub_80CFF34 +_080CFB2A: + movs r0, 0x8 + bl sub_80CFF34 + movs r0, 0x7 + bl sub_80CFF34 + movs r0, 0 + bl sub_80CFF34 + movs r0, 0x1 +_080CFB3E: + pop {r1} + bx r1 + thumb_func_end sub_80CFA84 + + thumb_func_start sub_80CFB44 +sub_80CFB44: @ 80CFB44 + push {r4,r5,lr} + ldr r4, _080CFB80 + ldr r0, [r4] + ldr r5, _080CFB84 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _080CFBDA + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080CFBAC + ldr r2, [r4] + ldr r0, _080CFB88 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080CFB8C + adds r0, r2, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _080CFBDA + movs r0, 0xE + bl sub_80CFF34 + b _080CFBE4 + .align 2, 0 +_080CFB80: .4byte 0x02039d08 +_080CFB84: .4byte 0x00000ce4 +_080CFB88: .4byte 0x00000ce6 +_080CFB8C: + ldrh r0, [r1] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080CFBA4 + movs r0, 0xC + bl sub_80CFF34 + movs r0, 0x10 + bl sub_80CFF34 +_080CFBA4: + movs r0, 0x11 + bl sub_80CFF34 + b _080CFBE4 +_080CFBAC: + ldr r2, [r4] + ldr r0, _080CFBC8 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080CFBCC + adds r0, r2, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _080CFBDA + movs r0, 0xD + bl sub_80CFF34 + b _080CFBE4 + .align 2, 0 +_080CFBC8: .4byte 0x00000ce6 +_080CFBCC: + ldrh r0, [r1] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080CFBDE +_080CFBDA: + movs r0, 0 + b _080CFBEC +_080CFBDE: + movs r0, 0xF + bl sub_80CFF34 +_080CFBE4: + movs r0, 0 + bl sub_80CFF34 + movs r0, 0x1 +_080CFBEC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CFB44 + + thumb_func_start sub_80CFBF4 +sub_80CFBF4: @ 80CFBF4 + ldr r1, _080CFC0C + ldr r1, [r1] + ldr r2, _080CFC10 + adds r1, r2 + ldr r2, [r1] + ldrh r2, [r2, 0x20] + strh r2, [r0, 0x20] + ldr r1, [r1] + ldrh r1, [r1, 0x22] + adds r1, 0x14 + strh r1, [r0, 0x22] + bx lr + .align 2, 0 +_080CFC0C: .4byte 0x02039d08 +_080CFC10: .4byte 0x00000cb4 + thumb_func_end sub_80CFBF4 + + thumb_func_start sub_80CFC14 +sub_80CFC14: @ 80CFC14 + push {r4-r6,lr} + sub sp, 0x2C + mov r1, sp + ldr r0, _080CFCE0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + add r4, sp, 0x18 + adds r1, r4, 0 + ldr r0, _080CFCE4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + mov r0, sp + bl gpu_tile_obj_alloc_and_load_multiple + adds r0, r4, 0 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _080CFCE8 + bl gpu_pal_tags_index_of + ldr r6, _080CFCEC + ldr r1, [r6] + ldr r4, _080CFCF0 + adds r1, r4 + strb r0, [r1] + ldr r0, _080CFCF4 + bl gpu_pal_tags_index_of + ldr r1, [r6] + ldr r5, _080CFCF8 + adds r1, r5 + strb r0, [r1] + ldr r0, _080CFCFC + ldrb r0, [r0] + ldr r1, _080CFD00 + ldrb r1, [r1] + add r4, sp, 0x28 + mov r5, sp + adds r5, 0x2A + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80CD444 + ldr r0, _080CFD04 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0 + ldrsh r2, [r5, r3] + movs r3, 0x6 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080CFD18 + ldr r2, [r6] + ldr r4, _080CFD08 + adds r3, r2, r4 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080CFD0C + adds r1, r0 + str r1, [r3] + ldr r0, _080CFD10 + ldr r5, _080CFCF0 + adds r2, r5 + ldrb r0, [r0] + adds r2, r0 + ldrb r2, [r2] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, _080CFD14 + ldrb r0, [r0] + cmp r0, 0 + beq _080CFD22 + ldr r0, [r6] + adds r0, r4 + ldr r0, [r0] + movs r1, 0x3 + bl obj_anim_image_start + b _080CFD22 + .align 2, 0 +_080CFCE0: .4byte 0x0857b9e4 +_080CFCE4: .4byte 0x0857b9fc +_080CFCE8: .4byte 0x0000daca +_080CFCEC: .4byte 0x02039d08 +_080CFCF0: .4byte 0x00000cd8 +_080CFCF4: .4byte 0x0000dac7 +_080CFCF8: .4byte 0x00000cd9 +_080CFCFC: .4byte 0x02039d78 +_080CFD00: .4byte 0x02039d79 +_080CFD04: .4byte 0x0857ba50 +_080CFD08: .4byte 0x00000cb4 +_080CFD0C: .4byte 0x02020630 +_080CFD10: .4byte 0x02039d7d +_080CFD14: .4byte 0x02039d7a +_080CFD18: + ldr r0, [r6] + ldr r1, _080CFD34 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_080CFD22: + ldr r0, _080CFD38 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CFD3C + movs r3, 0xD + movs r4, 0x1 + b _080CFD40 + .align 2, 0 +_080CFD34: .4byte 0x00000cb4 +_080CFD38: .4byte 0x02039d78 +_080CFD3C: + movs r3, 0x15 + movs r4, 0x2 +_080CFD40: + ldr r0, _080CFD94 + movs r1, 0 + movs r2, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080CFDA8 + ldr r5, _080CFD98 + ldr r2, [r5] + ldr r3, _080CFD9C + adds r2, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080CFDA0 + adds r1, r0 + str r1, [r2] + lsls r3, r4, 2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldr r0, _080CFDA4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CFDB4 + ldr r0, [r5] + ldr r4, _080CFD9C + adds r0, r4 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _080CFDB4 + .align 2, 0 +_080CFD94: .4byte 0x0857ba68 +_080CFD98: .4byte 0x02039d08 +_080CFD9C: .4byte 0x00000cb8 +_080CFDA0: .4byte 0x02020630 +_080CFDA4: .4byte 0x02039d78 +_080CFDA8: + ldr r0, _080CFDBC + ldr r0, [r0] + ldr r5, _080CFDC0 + adds r0, r5 + movs r1, 0 + str r1, [r0] +_080CFDB4: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080CFDBC: .4byte 0x02039d08 +_080CFDC0: .4byte 0x00000cb8 + thumb_func_end sub_80CFC14 + + thumb_func_start sub_80CFDC4 +sub_80CFDC4: @ 80CFDC4 + push {lr} + ldr r2, _080CFDF8 + movs r1, 0 + ldrb r0, [r2] + cmp r0, 0 + bne _080CFDD2 + movs r1, 0x1 +_080CFDD2: + strb r1, [r2] + ldr r0, _080CFDFC + ldr r0, [r0] + ldr r3, _080CFE00 + adds r1, r0, r3 + ldr r3, [r1] + ldr r1, _080CFE04 + adds r0, r1 + ldrb r2, [r2] + adds r0, r2 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r3, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + pop {r0} + bx r0 + .align 2, 0 +_080CFDF8: .4byte 0x02039d7d +_080CFDFC: .4byte 0x02039d08 +_080CFE00: .4byte 0x00000cb4 +_080CFE04: .4byte 0x00000cd8 + thumb_func_end sub_80CFDC4 + + thumb_func_start sub_80CFE08 +sub_80CFE08: @ 80CFE08 + ldr r0, _080CFE10 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080CFE10: .4byte 0x02039d79 + thumb_func_end sub_80CFE08 + + thumb_func_start sub_80CFE14 +sub_80CFE14: @ 80CFE14 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, _080CFE40 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFE48 + ldr r4, _080CFE44 + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __modsi3 + strb r0, [r5] + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __divsi3 + b _080CFE4C + .align 2, 0 +_080CFE40: .4byte 0x02039d78 +_080CFE44: .4byte 0x02039d79 +_080CFE48: + movs r0, 0 + strb r0, [r5] +_080CFE4C: + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CFE14 + + thumb_func_start sub_80CFE54 +sub_80CFE54: @ 80CFE54 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080CFE70 + ldr r0, [r0] + ldr r2, _080CFE74 + adds r0, r2 + ldr r0, [r0] + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_080CFE70: .4byte 0x02039d08 +_080CFE74: .4byte 0x00000cb4 + thumb_func_end sub_80CFE54 + + thumb_func_start sub_80CFE78 +sub_80CFE78: @ 80CFE78 + ldr r0, _080CFE80 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080CFE80: .4byte 0x02039d7b + thumb_func_end sub_80CFE78 + + thumb_func_start sub_80CFE84 +sub_80CFE84: @ 80CFE84 + ldr r0, _080CFEA0 + ldr r0, [r0] + ldr r1, _080CFEA4 + adds r0, r1 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + bx lr + .align 2, 0 +_080CFEA0: .4byte 0x02039d08 +_080CFEA4: .4byte 0x00000cb4 + thumb_func_end sub_80CFE84 + + thumb_func_start sub_80CFEA8 +sub_80CFEA8: @ 80CFEA8 + push {lr} + ldr r0, _080CFEC4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFEC0 + ldr r0, _080CFEC8 + ldrb r1, [r0] + movs r0, 0 + bl sub_80D0E50 +_080CFEC0: + pop {r0} + bx r0 + .align 2, 0 +_080CFEC4: .4byte 0x02039d78 +_080CFEC8: .4byte 0x02039d79 + thumb_func_end sub_80CFEA8 + + thumb_func_start sub_80CFECC +sub_80CFECC: @ 80CFECC + push {lr} + ldr r0, _080CFEE8 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFEE4 + ldr r0, _080CFEEC + ldrb r1, [r0] + movs r0, 0 + bl sub_80D0D8C +_080CFEE4: + pop {r0} + bx r0 + .align 2, 0 +_080CFEE8: .4byte 0x02039d78 +_080CFEEC: .4byte 0x02039d79 + thumb_func_end sub_80CFECC + + thumb_func_start sub_80CFEF0 +sub_80CFEF0: @ 80CFEF0 + ldr r2, _080CFF24 + ldr r0, [r2] + ldr r1, _080CFF28 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _080CFF2C + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + subs r3, 0x41 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _080CFF30 + adds r0, r1 + movs r1, 0xF + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x6 + adds r0, r3 + movs r1, 0x5C + strh r1, [r0] + bx lr + .align 2, 0 +_080CFF24: .4byte 0x02039d08 +_080CFF28: .4byte 0x00000cac +_080CFF2C: .4byte 0x00000cad +_080CFF30: .4byte 0x00000c71 + thumb_func_end sub_80CFEF0 + + thumb_func_start sub_80CFF34 +sub_80CFF34: @ 80CFF34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, _080CFF84 + ldr r2, [r4] + ldr r5, _080CFF88 + adds r1, r2, r5 + ldrb r0, [r1] + cmp r0, 0x6 + bhi _080CFF7E + adds r1, r0, 0 + lsls r1, 3 + ldr r0, _080CFF8C + adds r1, r0 + adds r1, r2, r1 + ldr r2, _080CFF90 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + str r3, [r1, 0x4] + bl sub_8008C24 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, [r4] + ldr r2, _080CFF94 + adds r0, r2 + ldrb r2, [r0] + cmp r1, r2 + bls _080CFF74 + strb r1, [r0] +_080CFF74: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CFF7E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080CFF84: .4byte 0x02039d08 +_080CFF88: .4byte 0x00000cac +_080CFF8C: .4byte 0x00000c74 +_080CFF90: .4byte 0x0857ba80 +_080CFF94: .4byte 0x00000cad + thumb_func_end sub_80CFF34 + + thumb_func_start sub_80CFF98 +sub_80CFF98: @ 80CFF98 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080CFFBC + ldr r1, [r0] + ldr r3, _080CFFC0 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r2, r0 + bcs _080CFFC8 + lsls r0, r2, 3 + ldr r2, _080CFFC4 + adds r1, r2 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + b _080CFFCC + .align 2, 0 +_080CFFBC: .4byte 0x02039d08 +_080CFFC0: .4byte 0x00000cac +_080CFFC4: .4byte 0x00000c78 +_080CFFC8: + movs r0, 0x1 + negs r0, r0 +_080CFFCC: + pop {r1} + bx r1 + thumb_func_end sub_80CFF98 + + thumb_func_start sub_80CFFD0 +sub_80CFFD0: @ 80CFFD0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, _080D0088 + ldr r1, [r5] + ldr r2, _080D008C + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, 0x2 + subs r2, 0x3E + adds r1, r2 + strb r0, [r1] + ldr r1, [r5] + ldr r6, _080D0090 + adds r0, r1, r6 + ldrb r0, [r0] + lsls r0, 1 + movs r3, 0xC7 + lsls r3, 4 + adds r1, r3 + strb r0, [r1] + ldr r1, [r5] + adds r2, r1, r2 + ldrb r2, [r2] + movs r0, 0x1D + subs r0, r2 + ldr r2, _080D0094 + adds r1, r2 + strb r0, [r1] + ldr r1, [r5] + adds r3, r1, r3 + ldrb r2, [r3] + movs r0, 0xF + subs r0, r2 + ldr r3, _080D0098 + adds r1, r3 + strb r0, [r1] + ldr r0, [r5] + ldr r1, _080D009C + adds r0, r1 + bl Window_AddFromTemplate + ldr r1, [r5] + movs r4, 0xCB + lsls r4, 4 + adds r1, r4 + movs r2, 0 + mov r8, r2 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl Window_FillTileMap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0xB + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, [r5] + adds r0, r2, r4 + ldrb r0, [r0] + adds r1, r2, r6 + ldrb r1, [r1] + ldr r3, _080D00A0 + adds r2, r3 + bl PrintMenuTable + ldr r1, [r5] + adds r4, r1, r4 + ldrb r0, [r4] + adds r1, r6 + ldrb r1, [r1] + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [r5] + ldr r1, _080D00A4 + adds r0, r1 + mov r2, r8 + strb r2, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D0088: .4byte 0x02039d08 +_080D008C: .4byte 0x00000cad +_080D0090: .4byte 0x00000cac +_080D0094: .4byte 0x00000c6d +_080D0098: .4byte 0x00000c6e +_080D009C: .4byte 0x00000c6c +_080D00A0: .4byte 0x00000c74 +_080D00A4: .4byte 0x00000cae + thumb_func_end sub_80CFFD0 + + thumb_func_start sub_80D00A8 +sub_80D00A8: @ 80D00A8 + movs r0, 0 + bx lr + thumb_func_end sub_80D00A8 + + thumb_func_start sub_80D00AC +sub_80D00AC: @ 80D00AC + push {r4,r5,lr} + movs r5, 0x2 + negs r5, r5 + ldr r4, _080D00E8 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080D0102 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D00CE + movs r0, 0x5 + bl audio_play + adds r5, 0x1 +_080D00CE: + ldrh r1, [r4, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080D00EC + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursor + b _080D010A + .align 2, 0 +_080D00E8: .4byte 0x030022c0 +_080D00EC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080D010A + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl MoveMenuCursor + b _080D010A +_080D0102: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r5, r0, 24 +_080D010A: + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _080D0116 + bl sub_80D013C +_080D0116: + cmp r5, 0 + blt _080D0128 + ldr r0, _080D0134 + ldr r0, [r0] + lsls r1, r5, 3 + ldr r2, _080D0138 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] +_080D0128: + lsls r0, r5, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080D0134: .4byte 0x02039d08 +_080D0138: .4byte 0x00000c78 + thumb_func_end sub_80D00AC + + thumb_func_start sub_80D013C +sub_80D013C: @ 80D013C + push {r4,r5,lr} + ldr r5, _080D0160 + ldr r0, [r5] + movs r4, 0xCB + lsls r4, 4 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_8198070 + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_Remove + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D0160: .4byte 0x02039d08 + thumb_func_end sub_80D013C + + thumb_func_start sub_80D0164 +sub_80D0164: @ 80D0164 + push {r4,lr} + ldr r4, _080D01A0 + ldr r0, _080D01A4 + bl malloc + str r0, [r4] + cmp r0, 0 + beq _080D01B0 + ldr r0, _080D01A8 + bl Window_AddFromTemplate8Bpp + adds r1, r0, 0 + ldr r0, _080D01AC + ldr r0, [r0] + movs r2, 0x88 + lsls r2, 6 + adds r0, r2 + strh r1, [r0] + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0xFF + beq _080D01B0 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + b _080D01B2 + .align 2, 0 +_080D01A0: .4byte 0x02039d80 +_080D01A4: .4byte 0x00000974 +_080D01A8: .4byte 0x0857bb1c +_080D01AC: .4byte 0x02039d08 +_080D01B0: + movs r0, 0 +_080D01B2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D0164 + + thumb_func_start sub_80D01B8 +sub_80D01B8: @ 80D01B8 + push {lr} + ldr r0, _080D01CC + ldr r0, [r0] + cmp r0, 0 + beq _080D01C6 + bl free +_080D01C6: + pop {r0} + bx r0 + .align 2, 0 +_080D01CC: .4byte 0x02039d80 + thumb_func_end sub_80D01B8 + + thumb_func_start sub_80D01D0 +sub_80D01D0: @ 80D01D0 + ldr r2, _080D01E0 + ldr r1, [r2] + movs r3, 0 + strb r0, [r1] + ldr r0, [r2] + strb r3, [r0, 0x1] + bx lr + .align 2, 0 +_080D01E0: .4byte 0x02039d80 + thumb_func_end sub_80D01D0 + + thumb_func_start sub_80D01E4 +sub_80D01E4: @ 80D01E4 + push {lr} + ldr r0, _080D01FC + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080D0244 + lsls r0, 2 + ldr r1, _080D0200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D01FC: .4byte 0x02039d80 +_080D0200: .4byte _080D0204 + .align 2, 0 +_080D0204: + .4byte _080D021C + .4byte _080D0222 + .4byte _080D0228 + .4byte _080D022E + .4byte _080D0234 + .4byte _080D023A +_080D021C: + bl sub_80D024C + b _080D023E +_080D0222: + bl sub_80D0344 + b _080D023E +_080D0228: + bl sub_80D03B0 + b _080D023E +_080D022E: + bl sub_80D0420 + b _080D023E +_080D0234: + bl sub_80D04A0 + b _080D023E +_080D023A: + bl sub_80D04C8 +_080D023E: + lsls r0, 24 + lsrs r0, 24 + b _080D0246 +_080D0244: + movs r0, 0 +_080D0246: + pop {r1} + bx r1 + thumb_func_end sub_80D01E4 + + thumb_func_start sub_80D024C +sub_80D024C: @ 80D024C + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, _080D0264 + ldr r1, [r6] + ldrb r0, [r1, 0x1] + cmp r0, 0x1 + beq _080D027C + cmp r0, 0x1 + bgt _080D0268 + cmp r0, 0 + beq _080D026E + b _080D0338 + .align 2, 0 +_080D0264: .4byte 0x02039d80 +_080D0268: + cmp r0, 0x2 + beq _080D0324 + b _080D0338 +_080D026E: + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x80 + bl sub_80D304C + b _080D030E +_080D027C: + adds r0, r1, 0x2 + adds r1, 0x3 + bl sub_80CFE14 + ldr r1, [r6] + ldrb r0, [r1, 0x2] + strb r0, [r1, 0x4] + ldr r1, [r6] + ldrb r0, [r1, 0x3] + strb r0, [r1, 0x5] + ldr r4, _080D0318 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + ldr r5, _080D031C + ldr r0, [r5] + movs r4, 0x88 + lsls r4, 6 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + bl Window_FillPixels8Bpp + ldr r1, [r6] + ldrb r0, [r1, 0x2] + ldrb r1, [r1, 0x3] + bl sub_80D07B0 + movs r0, 0 + movs r1, 0x4 + movs r2, 0x1 + bl gpu_bg_config_set_field + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram8Bpp + movs r0, 0xFC + lsls r0, 6 + ldr r2, _080D0320 + movs r1, 0x8 + bl sub_80A2A20 + movs r0, 0x2 + bl sub_80CFE54 + movs r0, 0x8 + movs r1, 0x80 + bl lcd_io_set_bits +_080D030E: + ldr r1, [r6] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0338 + .align 2, 0 +_080D0318: .4byte 0xfffffc00 +_080D031C: .4byte 0x02039d08 +_080D0320: .4byte 0x00007fff +_080D0324: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080D0338 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0 + b _080D033A +_080D0338: + movs r0, 0x1 +_080D033A: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D024C + + thumb_func_start sub_80D0344 +sub_80D0344: @ 80D0344 + push {r4,lr} + ldr r4, _080D035C + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080D036E + cmp r0, 0x1 + bgt _080D0360 + cmp r0, 0 + beq _080D0366 + b _080D03A8 + .align 2, 0 +_080D035C: .4byte 0x02039d80 +_080D0360: + cmp r0, 0x2 + beq _080D0382 + b _080D03A8 +_080D0366: + movs r0, 0 + bl gpu_sync_bg_hide + b _080D0378 +_080D036E: + bl sub_80D0B5C + movs r0, 0 + bl sub_80CFE54 +_080D0378: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D03A8 +_080D0382: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080D03A8 + bl sub_80CFE84 + movs r0, 0x3 + bl stdpal_get + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0 + b _080D03AA +_080D03A8: + movs r0, 0x1 +_080D03AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D0344 + + thumb_func_start sub_80D03B0 +sub_80D03B0: @ 80D03B0 + push {r4,lr} + ldr r4, _080D03C4 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _080D03C8 + cmp r0, 0x1 + beq _080D040C + b _080D0416 + .align 2, 0 +_080D03C4: .4byte 0x02039d80 +_080D03C8: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + bne _080D0416 + ldr r1, [r4] + adds r0, r1, 0x6 + adds r1, 0x7 + bl sub_80CFE14 + bl sub_80D062C + ldr r1, [r4] + ldrb r0, [r1, 0x6] + strb r0, [r1, 0x4] + ldr r1, [r4] + ldrb r0, [r1, 0x7] + strb r0, [r1, 0x5] + ldr r0, _080D0408 + ldr r0, [r0] + movs r1, 0x88 + lsls r1, 6 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram8Bpp + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0416 + .align 2, 0 +_080D0408: .4byte 0x02039d08 +_080D040C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _080D0418 +_080D0416: + movs r0, 0x1 +_080D0418: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D03B0 + + thumb_func_start sub_80D0420 +sub_80D0420: @ 80D0420 + push {r4,lr} + ldr r4, _080D0438 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080D044E + cmp r0, 0x1 + bgt _080D043C + cmp r0, 0 + beq _080D0442 + b _080D0498 + .align 2, 0 +_080D0438: .4byte 0x02039d80 +_080D043C: + cmp r0, 0x2 + beq _080D047A + b _080D0498 +_080D0442: + bl sub_80D08CC + bl sub_80D09A4 + movs r0, 0 + b _080D046C +_080D044E: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080D0498 + movs r0, 0x3 + bl sub_80CFE54 + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + movs r2, 0x8 + bl sub_80D0884 + movs r0, 0x1 +_080D046C: + bl sub_80CDC64 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0498 +_080D047A: + bl sub_80D0894 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80CDCAC + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0 + bne _080D0498 + cmp r0, 0 + bne _080D0498 + movs r0, 0 + b _080D049A +_080D0498: + movs r0, 0x1 +_080D049A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D0420 + + thumb_func_start sub_80D04A0 +sub_80D04A0: @ 80D04A0 + push {r4,lr} + bl sub_80CD554 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80D0894 + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0 + bne _080D04C0 + cmp r0, 0 + bne _080D04C0 + movs r0, 0 + b _080D04C2 +_080D04C0: + movs r0, 0x1 +_080D04C2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D04A0 + + thumb_func_start sub_80D04C8 +sub_80D04C8: @ 80D04C8 + push {r4,lr} + ldr r4, _080D04E0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080D0506 + cmp r0, 0x1 + bgt _080D04E4 + cmp r0, 0 + beq _080D04EE + b _080D0576 + .align 2, 0 +_080D04E0: .4byte 0x02039d80 +_080D04E4: + cmp r0, 0x2 + beq _080D0532 + cmp r0, 0x3 + beq _080D0550 + b _080D0576 +_080D04EE: + bl sub_80D0AAC + movs r1, 0xFF + lsls r1, 8 + movs r0, 0 + movs r2, 0x8 + bl sub_80D0884 + movs r0, 0 + bl sub_80CDC64 + b _080D0546 +_080D0506: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + bl sub_80D0894 + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + bl sub_80D0A1C + movs r0, 0x2 + bl sub_80CFE54 + movs r0, 0x1 + bl sub_80CDC64 + movs r0, 0 + bl gpu_sync_bg_hide + b _080D0546 +_080D0532: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + movs r0, 0 + bl sub_80CFE54 + bl sub_80D0B5C +_080D0546: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0576 +_080D0550: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + movs r0, 0x3 + bl stdpal_get + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_80CFE84 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0 + b _080D0578 +_080D0576: + movs r0, 0x1 +_080D0578: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D04C8 + + thumb_func_start sub_80D0580 +sub_80D0580: @ 80D0580 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _080D05BC + cmp r0, 0x1 + bgt _080D0596 + cmp r0, 0 + beq _080D05A0 + b _080D0624 +_080D0596: + cmp r1, 0x2 + beq _080D05DC + cmp r1, 0x3 + beq _080D05FC + b _080D0624 +_080D05A0: + ldr r0, _080D05B8 + ldr r1, [r0] + ldrb r0, [r1, 0x9] + cmp r0, 0 + beq _080D060A + subs r0, 0x1 + strb r0, [r1, 0x9] + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + b _080D05F0 + .align 2, 0 +_080D05B8: .4byte 0x02039d80 +_080D05BC: + ldr r0, _080D05D8 + ldr r1, [r0] + ldrb r2, [r1, 0x9] + ldrb r0, [r1, 0xB] + adds r0, r2, r0 + cmp r0, 0x4 + bgt _080D060A + adds r0, r2, 0x1 + strb r0, [r1, 0x9] + movs r1, 0xFC + lsls r1, 8 + movs r0, 0 + b _080D05F0 + .align 2, 0 +_080D05D8: .4byte 0x02039d80 +_080D05DC: + ldr r0, _080D05F8 + ldr r1, [r0] + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _080D060A + subs r0, 0x1 + strb r0, [r1, 0x8] + movs r0, 0x80 + lsls r0, 3 + movs r1, 0 +_080D05F0: + movs r2, 0x6 + bl sub_80D0884 + b _080D0624 + .align 2, 0 +_080D05F8: .4byte 0x02039d80 +_080D05FC: + ldr r0, _080D0610 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + ldrb r0, [r1, 0xA] + adds r0, r2, r0 + cmp r0, 0x5 + ble _080D0614 +_080D060A: + movs r0, 0 + b _080D0626 + .align 2, 0 +_080D0610: .4byte 0x02039d80 +_080D0614: + adds r0, r2, 0x1 + strb r0, [r1, 0x8] + movs r0, 0xFC + lsls r0, 8 + movs r1, 0 + movs r2, 0x6 + bl sub_80D0884 +_080D0624: + movs r0, 0x1 +_080D0626: + pop {r1} + bx r1 + thumb_func_end sub_80D0580 + + thumb_func_start sub_80D062C +sub_80D062C: @ 80D062C + push {r4-r7,lr} + ldr r6, _080D06CC + ldr r2, [r6] + ldrb r3, [r2, 0x2] + ldrb r5, [r2, 0x6] + subs r1, r3, r5 + cmp r1, 0 + bge _080D063E + negs r1, r1 +_080D063E: + ldrb r0, [r2, 0x4] + subs r0, r3, r0 + cmp r0, 0 + bge _080D0648 + negs r0, r0 +_080D0648: + subs r0, r1, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x7] + subs r3, r1, r0 + cmp r3, 0 + bge _080D065A + negs r3, r3 +_080D065A: + ldrb r2, [r2, 0x5] + subs r0, r1, r2 + cmp r0, 0 + bge _080D0664 + negs r0, r0 +_080D0664: + subs r0, r3, r0 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + cmp r4, 0 + ble _080D0678 + adds r0, r5, 0 + bl sub_80D06D0 +_080D0678: + cmp r4, 0 + bge _080D0694 + ldr r2, [r6] + ldrb r0, [r2, 0x4] + ldrb r1, [r2, 0x3] + ldrb r2, [r2, 0x5] + bl sub_80D0740 + ldr r2, [r6] + ldrb r0, [r2, 0x6] + ldrb r1, [r2, 0x3] + ldrb r2, [r2, 0x5] + bl sub_80D06D0 +_080D0694: + lsls r0, r7, 16 + asrs r4, r0, 16 + cmp r4, 0 + ble _080D06A8 + ldr r2, [r6] + ldrb r0, [r2, 0x7] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x4] + bl sub_80D0708 +_080D06A8: + cmp r4, 0 + bge _080D06C4 + ldr r2, [r6] + ldrb r0, [r2, 0x5] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x4] + bl sub_80D0778 + ldr r2, [r6] + ldrb r0, [r2, 0x7] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x4] + bl sub_80D0708 +_080D06C4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D06CC: .4byte 0x02039d80 + thumb_func_end sub_80D062C + + thumb_func_start sub_80D06D0 +sub_80D06D0: @ 80D06D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D06EE + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D0700 +_080D06EE: + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + bl sub_80D07B0 + cmp r4, r5 + bls _080D06EE +_080D0700: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D06D0 + + thumb_func_start sub_80D0708 +sub_80D0708: @ 80D0708 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D0726 + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D0738 +_080D0726: + adds r0, r4, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r6, 0 + bl sub_80D07B0 + cmp r4, r5 + bls _080D0726 +_080D0738: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D0708 + + thumb_func_start sub_80D0740 +sub_80D0740: @ 80D0740 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D075E + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D0770 +_080D075E: + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + bl sub_80D0834 + cmp r4, r5 + bls _080D075E +_080D0770: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D0740 + + thumb_func_start sub_80D0778 +sub_80D0778: @ 80D0778 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D0796 + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D07A8 +_080D0796: + adds r0, r4, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r6, 0 + bl sub_80D0834 + cmp r4, r5 + bls _080D0796 +_080D07A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D0778 + + thumb_func_start sub_80D07B0 +sub_80D07B0: @ 80D07B0 + push {r4-r7,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r7, r0, r1 + lsls r4, r7, 1 + adds r4, r6, r4 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x41 + bl get_pokemon_data_from_selected_box + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + bl get_pokemon_data_from_selected_box + adds r1, r0, 0 + cmp r5, 0 + beq _080D0828 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_80D2EDC + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80D3080 + adds r0, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080D0830 + ldr r1, [r1] + movs r2, 0x88 + lsls r2, 6 + adds r1, r2 + ldrb r3, [r1] + movs r2, 0x20 + str r2, [sp] + str r2, [sp, 0x4] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + str r1, [sp, 0x8] + lsls r1, r7, 3 + str r1, [sp, 0xC] + str r2, [sp, 0x10] + str r2, [sp, 0x14] + str r0, [sp, 0x18] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl Window_CopyPixelRectToWindow4BppTo8Bpp +_080D0828: + add sp, 0x1C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0830: .4byte 0x02039d08 + thumb_func_end sub_80D07B0 + + thumb_func_start sub_80D0834 +sub_80D0834: @ 80D0834 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r5, r0, r1 + lsls r0, r5, 1 + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x41 + bl get_pokemon_data_from_selected_box + lsls r0, 16 + cmp r0, 0 + beq _080D0878 + ldr r0, _080D0880 + ldr r0, [r0] + movs r1, 0x88 + lsls r1, 6 + adds r0, r1 + ldrb r0, [r0] + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 3 + lsls r3, r5, 3 + movs r1, 0x20 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0 + bl Window_FillPixelRect8Bpp +_080D0878: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D0880: .4byte 0x02039d08 + thumb_func_end sub_80D0834 + + thumb_func_start sub_80D0884 +sub_80D0884: @ 80D0884 + ldr r3, _080D0890 + ldr r3, [r3] + strh r0, [r3, 0xC] + strh r1, [r3, 0xE] + strh r2, [r3, 0x10] + bx lr + .align 2, 0 +_080D0890: .4byte 0x02039d80 + thumb_func_end sub_80D0884 + + thumb_func_start sub_80D0894 +sub_80D0894: @ 80D0894 + push {r4,lr} + ldr r4, _080D08C8 + ldr r1, [r4] + ldrh r0, [r1, 0x10] + cmp r0, 0 + beq _080D08BE + ldrh r1, [r1, 0xC] + movs r0, 0 + movs r2, 0x1 + bl bg_change_x_offset + ldr r0, [r4] + ldrh r1, [r0, 0xE] + movs r0, 0 + movs r2, 0x1 + bl bg_change_y_offset + ldr r1, [r4] + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] +_080D08BE: + ldr r0, [r4] + ldrb r0, [r0, 0x10] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D08C8: .4byte 0x02039d80 + thumb_func_end sub_80D0894 + + thumb_func_start sub_80D08CC +sub_80D08CC: @ 80D08CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _080D09A0 + ldr r1, [r4] + ldrb r0, [r1, 0x4] + ldrb r2, [r1, 0x2] + cmp r0, r2 + bls _080D08E4 + adds r0, r2, 0 +_080D08E4: + strb r0, [r1, 0x8] + ldr r1, [r4] + ldrb r0, [r1, 0x5] + ldrb r2, [r1, 0x3] + cmp r0, r2 + bls _080D08F2 + adds r0, r2, 0 +_080D08F2: + strb r0, [r1, 0x9] + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x4] + subs r0, r1, r0 + cmp r0, 0 + bge _080D0902 + negs r0, r0 +_080D0902: + adds r0, 0x1 + strb r0, [r2, 0xA] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x5] + subs r0, r1, r0 + cmp r0, 0 + bge _080D0914 + negs r0, r0 +_080D0914: + adds r0, 0x1 + strb r0, [r2, 0xB] + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r6, 0 + ldr r0, [r4] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r8, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r0, r1 + mov r9, r0 + adds r2, r1, 0 + cmp r2, r9 + bge _080D0990 +_080D093C: + lsls r0, r2, 1 + adds r0, r2 + ldr r3, _080D09A0 + ldr r1, [r3] + lsls r0, 1 + ldrb r3, [r1, 0x8] + adds r0, r3 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + adds r7, r2, 0x1 + cmp r4, r8 + bge _080D098A + mov r0, r8 + subs r4, r0, r4 +_080D095A: + mov r0, r10 + adds r1, r5, 0 + bl get_pokemon_by_box_and_pos + adds r1, r0, 0 + ldr r2, _080D09A0 + ldr r0, [r2] + lsls r2, r6, 2 + adds r2, r6 + lsls r2, 4 + adds r0, r2 + adds r0, 0x14 + movs r2, 0x50 + bl memcpy + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bne _080D095A +_080D098A: + adds r2, r7, 0 + cmp r2, r9 + blt _080D093C +_080D0990: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D09A0: .4byte 0x02039d80 + thumb_func_end sub_80D08CC + + thumb_func_start sub_80D09A4 +sub_80D09A4: @ 80D09A4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _080D0A18 + ldr r0, [r4] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r7, r2, r1 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r1, r0 + mov r9, r1 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, [r4] + ldrb r2, [r0, 0x9] + cmp r2, r9 + bge _080D0A0C +_080D09D0: + lsls r0, r2, 1 + adds r0, r2 + ldr r1, _080D0A18 + ldr r1, [r1] + lsls r0, 1 + ldrb r3, [r1, 0x8] + adds r0, r3 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + adds r6, r2, 0x1 + cmp r4, r7 + bge _080D0A06 + subs r4, r7, r4 +_080D09EC: + adds r0, r5, 0 + bl sub_80CB778 + mov r0, r8 + adds r1, r5, 0 + bl sub_80D2018 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bne _080D09EC +_080D0A06: + adds r2, r6, 0 + cmp r2, r9 + blt _080D09D0 +_080D0A0C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0A18: .4byte 0x02039d80 + thumb_func_end sub_80D09A4 + + thumb_func_start sub_80D0A1C +sub_80D0A1C: @ 80D0A1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _080D0AA8 + ldr r0, [r0] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r8, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r0, r1 + mov r10, r0 + movs r6, 0 + adds r2, r1, 0 + cmp r2, r10 + bge _080D0A98 +_080D0A42: + lsls r0, r2, 1 + adds r0, r2 + ldr r3, _080D0AA8 + ldr r1, [r3] + lsls r0, 1 + ldrb r4, [r1, 0x8] + adds r0, r4 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + adds r7, r2, 0x1 + cmp r4, r8 + bge _080D0A92 + mov r9, r3 + mov r0, r8 + subs r4, r0, r4 +_080D0A62: + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 4 + adds r1, 0x14 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D0A80 + adds r0, r5, 0 + bl sub_80CB140 +_080D0A80: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bne _080D0A62 +_080D0A92: + adds r2, r7, 0 + cmp r2, r10 + blt _080D0A42 +_080D0A98: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0AA8: .4byte 0x02039d80 + thumb_func_end sub_80D0A1C + + thumb_func_start sub_80D0AAC +sub_80D0AAC: @ 80D0AAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, _080D0B58 + ldr r0, [r4] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r10, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r1, r0 + str r1, [sp] + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r7, 0 + ldr r0, [r4] + ldrb r3, [r0, 0x9] + ldr r0, [sp] + cmp r3, r0 + bge _080D0B46 +_080D0AE2: + lsls r0, r3, 1 + adds r0, r3 + ldr r2, _080D0B58 + ldr r1, [r2] + lsls r0, 1 + ldrb r4, [r1, 0x8] + adds r0, r4 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r5, [r1, 0x8] + adds r3, 0x1 + mov r9, r3 + cmp r5, r10 + bge _080D0B3E + mov r8, r2 + mov r0, r10 + subs r5, r0, r5 +_080D0B04: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 4 + adds r4, r0, 0 + adds r4, 0x14 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D0B2C + mov r0, r8 + ldr r2, [r0] + adds r2, r4 + ldr r0, [sp, 0x4] + adds r1, r6, 0 + bl sub_80D1F18 +_080D0B2C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + subs r5, 0x1 + cmp r5, 0 + bne _080D0B04 +_080D0B3E: + mov r3, r9 + ldr r1, [sp] + cmp r3, r1 + blt _080D0AE2 +_080D0B46: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0B58: .4byte 0x02039d80 + thumb_func_end sub_80D0AAC + + thumb_func_start sub_80D0B5C +sub_80D0B5C: @ 80D0B5C + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0 + movs r1, 0x4 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x8 + movs r1, 0x80 + bl lcd_io_clear_bits + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80D0B5C + + thumb_func_start sub_80D0BA4 +sub_80D0BA4: @ 80D0BA4 + ldr r0, _080D0BBC + ldr r2, [r0] + ldrb r1, [r2, 0x3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + ldrb r2, [r2, 0x2] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_080D0BBC: .4byte 0x02039d80 + thumb_func_end sub_80D0BA4 + + thumb_func_start sub_80D0BC0 +sub_80D0BC0: @ 80D0BC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _080D0C2C + ldr r0, [r0] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r9, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r0, r1, r0 + str r0, [sp] + movs r7, 0 + adds r6, r1, 0 + cmp r6, r0 + bge _080D0C4E + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 1 + mov r8, r0 +_080D0BF0: + ldr r2, _080D0C2C + ldr r1, [r2] + ldrb r0, [r1, 0x8] + add r0, r8 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + cmp r4, r9 + bge _080D0C42 + mov r10, r2 +_080D0C04: + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 4 + adds r1, 0x14 + mov r2, r10 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D0C30 + adds r0, r5, 0 + movs r1, 0x5 + bl get_pokemon_data_from_selected_box + cmp r0, 0 + beq _080D0C30 + movs r0, 0 + b _080D0C50 + .align 2, 0 +_080D0C2C: .4byte 0x02039d80 +_080D0C30: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x1 + cmp r4, r9 + blt _080D0C04 +_080D0C42: + movs r0, 0x6 + add r8, r0 + adds r6, 0x1 + ldr r2, [sp] + cmp r6, r2 + blt _080D0BF0 +_080D0C4E: + movs r0, 0x1 +_080D0C50: + 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_80D0BC0 + + thumb_func_start sub_80D0C60 +sub_80D0C60: @ 80D0C60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r3, _080D0D5C + ldr r0, [r3] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0D3E + ldr r0, _080D0D60 + str r0, [sp, 0x18] + ldr r1, _080D0D64 + add r2, sp, 0x18 + ldr r0, [r2, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r2, 0x4] + mov r1, sp + ldr r0, _080D0D68 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + movs r7, 0 + mov r9, r2 + mov r8, r3 + movs r0, 0 + mov r10, r0 +_080D0CA0: + adds r6, r7, 0x7 + lsls r1, r6, 16 + mov r2, r9 + ldrh r0, [r2, 0x4] + orrs r0, r1 + str r0, [r2, 0x4] + mov r0, r9 + bl gpu_tile_obj_decompress_and_load + mov r4, r9 + ldrh r0, [r4, 0x6] + bl gpu_tile_obj_tag_get_range_start + mov r5, r8 + ldr r1, [r5] + lsls r5, r7, 4 + ldr r2, _080D0D6C + adds r1, r2 + adds r1, r5 + lsls r0, 16 + lsrs r0, 11 + ldr r4, _080D0D70 + adds r0, r4 + str r0, [r1] + ldr r0, _080D0D74 + adds r4, r7, r0 + lsls r0, r4, 16 + lsrs r0, 16 + bl gpu_pal_alloc_new + mov r2, r8 + ldr r1, [r2] + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D0D78 + adds r1, r2 + strh r0, [r1] + ldrh r0, [r1] + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + strh r0, [r1] + mov r0, sp + strh r6, [r0] + strh r4, [r0, 0x2] + movs r1, 0 + movs r2, 0 + movs r3, 0xB + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r4, r8 + ldr r2, [r4] + ldr r6, _080D0D7C + adds r2, r6 + adds r2, r5 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080D0D80 + adds r1, r0 + str r1, [r2] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r4] + adds r0, r5 + ldr r1, _080D0D84 + adds r0, r1 + mov r2, r10 + strb r2, [r0] + adds r7, 0x1 + cmp r7, 0x2 + ble _080D0CA0 +_080D0D3E: + ldr r0, _080D0D5C + ldr r0, [r0] + ldr r4, _080D0D88 + adds r0, r4 + movs r1, 0 + strh r1, [r0] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0D5C: .4byte 0x02039d08 +_080D0D60: .4byte 0x03000f78 +_080D0D64: .4byte 0xffff0000 +_080D0D68: .4byte 0x0857bc70 +_080D0D6C: .4byte 0x00002208 +_080D0D70: .4byte 0x06010000 +_080D0D74: .4byte 0xffffdacb +_080D0D78: .4byte 0x0000220c +_080D0D7C: .4byte 0x00002204 +_080D0D80: .4byte 0x02020630 +_080D0D84: .4byte 0x00002210 +_080D0D88: .4byte 0x00002234 + thumb_func_end sub_80D0C60 + + thumb_func_start sub_80D0D8C +sub_80D0D8C: @ 80D0D8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, _080D0DC0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0E42 + mov r0, r8 + adds r1, r7, 0 + bl sub_80D1324 + cmp r0, 0 + bne _080D0E42 + mov r0, r8 + cmp r0, 0 + beq _080D0DC4 + cmp r0, 0x1 + beq _080D0DDA + b _080D0E42 + .align 2, 0 +_080D0DC0: .4byte 0x02039d08 +_080D0DC4: + adds r0, r7, 0 + movs r1, 0x5 + bl get_pokemon_data_from_selected_box + cmp r0, 0 + beq _080D0E42 + adds r0, r7, 0 + movs r1, 0xC + bl get_pokemon_data_from_selected_box + b _080D0DFC +_080D0DDA: + cmp r7, 0x5 + bhi _080D0E42 + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _080D0E4C + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _080D0E42 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr +_080D0DFC: + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080D0E42 + adds r0, r4, 0 + bl sub_80D1794 + adds r6, r0, 0 + adds r0, r4, 0 + bl sub_80D17A4 + adds r5, r0, 0 + bl sub_80D12E8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_80D140C + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80D1524 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D1740 +_080D0E42: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0E4C: .4byte 0x020244ec + thumb_func_end sub_80D0D8C + + thumb_func_start sub_80D0E50 +sub_80D0E50: @ 80D0E50 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _080D0E8C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0E86 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80D1604 +_080D0E86: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D0E8C: .4byte 0x02039d08 + thumb_func_end sub_80D0E50 + + thumb_func_start sub_80D0E90 +sub_80D0E90: @ 80D0E90 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + ldr r0, _080D0EF4 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0F20 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80D1604 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_80D140C + cmp r6, 0 + bne _080D0EF8 + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl set_pokemon_data_from_selected_box + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80CB7AC + b _080D0F10 + .align 2, 0 +_080D0EF4: .4byte 0x02039d08 +_080D0EF8: + movs r0, 0x64 + muls r0, r7 + ldr r1, _080D0F28 + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80CBBDC +_080D0F10: + ldr r0, _080D0F2C + ldr r0, [r0] + ldr r2, _080D0F30 + adds r1, r0, r2 + ldrh r1, [r1] + ldr r2, _080D0F34 + adds r0, r2 + strh r1, [r0] +_080D0F20: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D0F28: .4byte 0x020244ec +_080D0F2C: .4byte 0x02039d08 +_080D0F30: .4byte 0x00000ce6 +_080D0F34: .4byte 0x00002234 + thumb_func_end sub_80D0E90 + + thumb_func_start sub_80D0F38 +sub_80D0F38: @ 80D0F38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r5, 0 + bl sub_80D1794 + mov r8, r0 + adds r0, r5, 0 + bl sub_80D17A4 + adds r6, r0, 0 + bl sub_80D12E8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_80D1524 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl sub_80D1604 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_80D140C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D1740 + ldr r0, _080D0FA4 + ldr r0, [r0] + ldr r1, _080D0FA8 + adds r0, r1 + strh r5, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D0FA4: .4byte 0x02039d08 +_080D0FA8: .4byte 0x00002234 + thumb_func_end sub_80D0F38 + + thumb_func_start sub_80D0FAC +sub_80D0FAC: @ 80D0FAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, _080D1014 + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D106A + mov r0, r9 + adds r1, r7, 0 + bl sub_80D1370 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0 + bl sub_80D1604 + mov r1, r9 + cmp r1, 0 + bne _080D101C + adds r0, r7, 0 + movs r1, 0xC + bl get_pokemon_data_from_selected_box + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r8 + ldr r2, [r0] + ldr r4, _080D1018 + adds r2, r4 + adds r0, r7, 0 + movs r1, 0xC + bl set_pokemon_data_from_selected_box + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + b _080D1048 + .align 2, 0 +_080D1014: .4byte 0x02039d08 +_080D1018: .4byte 0x00002234 +_080D101C: + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, _080D1078 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r8 + ldr r2, [r0] + ldr r5, _080D107C + adds r2, r5 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r1, r8 + ldr r0, [r1] + adds r0, r5 +_080D1048: + strh r6, [r0] + movs r0, 0x2 + movs r1, 0 + bl sub_80D1370 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x4 + mov r2, r9 + adds r3, r7, 0 + bl sub_80D1604 +_080D106A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D1078: .4byte 0x020244ec +_080D107C: .4byte 0x00002234 + thumb_func_end sub_80D0FAC + + thumb_func_start sub_80D1080 +sub_80D1080: @ 80D1080 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + mov r8, r5 + ldr r6, _080D10D8 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D1100 + movs r0, 0x2 + movs r1, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_80D1604 + cmp r7, 0 + bne _080D10E0 + ldr r2, [r6] + ldr r0, _080D10DC + adds r2, r0 + adds r0, r5, 0 + movs r1, 0xC + bl set_pokemon_data_from_selected_box + adds r0, r5, 0 + movs r1, 0 + bl sub_80CB7AC + b _080D1100 + .align 2, 0 +_080D10D8: .4byte 0x02039d08 +_080D10DC: .4byte 0x00002234 +_080D10E0: + movs r0, 0x64 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r1, _080D110C + adds r0, r1 + ldr r2, [r6] + ldr r1, _080D1110 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + mov r0, r8 + movs r1, 0 + bl sub_80CBBDC +_080D1100: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D110C: .4byte 0x020244ec +_080D1110: .4byte 0x00002234 + thumb_func_end sub_80D1080 + + thumb_func_start sub_80D1114 +sub_80D1114: @ 80D1114 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + ldr r0, _080D116C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D1188 + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80D1604 + cmp r6, 0 + bne _080D1170 + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl set_pokemon_data_from_selected_box + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80CB7AC + b _080D1188 + .align 2, 0 +_080D116C: .4byte 0x02039d08 +_080D1170: + movs r0, 0x64 + muls r0, r7 + ldr r1, _080D1190 + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80CBBDC +_080D1188: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D1190: .4byte 0x020244ec + thumb_func_end sub_80D1114 + + thumb_func_start sub_80D1194 +sub_80D1194: @ 80D1194 + push {r4,lr} + ldr r0, _080D11C8 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D11C2 + movs r0, 0x2 + movs r1, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x5 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl sub_80D1604 +_080D11C2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D11C8: .4byte 0x02039d08 + thumb_func_end sub_80D1194 + + thumb_func_start sub_80D11CC +sub_80D11CC: @ 80D11CC + push {r4,lr} + ldr r0, _080D1210 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D120A + movs r4, 0 +_080D11DA: + ldr r0, _080D1210 + ldr r1, [r0] + lsls r0, r4, 4 + adds r1, r0 + ldr r2, _080D1214 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080D1204 + subs r2, 0x2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D1204 + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0x7 + movs r2, 0x2 + movs r3, 0 + bl sub_80D1604 +_080D1204: + adds r4, 0x1 + cmp r4, 0x2 + ble _080D11DA +_080D120A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1210: .4byte 0x02039d08 +_080D1214: .4byte 0x00002210 + thumb_func_end sub_80D11CC + + thumb_func_start sub_80D1218 +sub_80D1218: @ 80D1218 + push {r4,r5,lr} + movs r5, 0 + ldr r0, _080D1254 + ldr r0, [r0] + ldr r1, _080D1258 + adds r4, r0, r1 + adds r3, r0, 0 +_080D1226: + ldr r1, _080D125C + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080D1268 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x28 + ands r0, r1 + cmp r0, 0x8 + beq _080D124E + ldr r1, [r2, 0x1C] + ldr r0, _080D1260 + cmp r1, r0 + beq _080D1268 + ldr r0, _080D1264 + cmp r1, r0 + beq _080D1268 +_080D124E: + movs r0, 0x1 + b _080D1274 + .align 2, 0 +_080D1254: .4byte 0x02039d08 +_080D1258: .4byte 0x00002204 +_080D125C: .4byte 0x00002210 +_080D1260: .4byte nullsub_12 + 1 +_080D1264: .4byte sub_80D1AD8 + 1 +_080D1268: + adds r4, 0x10 + adds r3, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _080D1226 + movs r0, 0 +_080D1274: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D1218 + + thumb_func_start sub_80D127C +sub_80D127C: @ 80D127C + push {lr} + ldr r0, _080D12A0 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + bne _080D12B0 + movs r2, 0 + ldr r0, _080D12A4 + adds r1, r0 +_080D128E: + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _080D12A8 + ldrb r0, [r1] + cmp r0, 0x2 + bne _080D12A8 + movs r0, 0x1 + b _080D12B2 + .align 2, 0 +_080D12A0: .4byte 0x02039d08 +_080D12A4: .4byte 0x0000220e +_080D12A8: + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x2 + ble _080D128E +_080D12B0: + movs r0, 0 +_080D12B2: + pop {r1} + bx r1 + thumb_func_end sub_80D127C + + thumb_func_start sub_80D12B8 +sub_80D12B8: @ 80D12B8 + push {lr} + ldr r0, _080D12CC + ldr r0, [r0] + ldr r1, _080D12D0 + adds r0, r1 + ldrh r0, [r0] + bl itemid_get_item + pop {r1} + bx r1 + .align 2, 0 +_080D12CC: .4byte 0x02039d08 +_080D12D0: .4byte 0x00002234 + thumb_func_end sub_80D12B8 + + thumb_func_start sub_80D12D4 +sub_80D12D4: @ 80D12D4 + ldr r0, _080D12E0 + ldr r0, [r0] + ldr r1, _080D12E4 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_080D12E0: .4byte 0x02039d08 +_080D12E4: .4byte 0x00002234 + thumb_func_end sub_80D12D4 + + thumb_func_start sub_80D12E8 +sub_80D12E8: @ 80D12E8 + push {r4,r5,lr} + movs r2, 0 + ldr r5, _080D1308 + ldr r3, _080D130C + movs r4, 0x1 +_080D12F2: + ldr r0, [r5] + lsls r1, r2, 4 + adds r0, r1 + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0 + bne _080D1310 + strb r4, [r1] + adds r0, r2, 0 + b _080D131C + .align 2, 0 +_080D1308: .4byte 0x02039d08 +_080D130C: .4byte 0x00002210 +_080D1310: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _080D12F2 + movs r0, 0x3 +_080D131C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D12E8 + + thumb_func_start sub_80D1324 +sub_80D1324: @ 80D1324 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + ldr r0, _080D1358 + ldr r2, [r0] +_080D1334: + ldr r5, _080D135C + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _080D1360 + subs r5, 0x2 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r4 + bne _080D1360 + adds r5, 0x1 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r1 + bne _080D1360 + movs r0, 0x1 + b _080D136A + .align 2, 0 +_080D1358: .4byte 0x02039d08 +_080D135C: .4byte 0x00002210 +_080D1360: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x2 + ble _080D1334 + movs r0, 0 +_080D136A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D1324 + + thumb_func_start sub_80D1370 +sub_80D1370: @ 80D1370 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + ldr r0, _080D13A8 + ldr r1, [r0] +_080D1380: + lsls r0, r3, 4 + adds r2, r1, r0 + ldr r6, _080D13AC + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _080D13B0 + subs r6, 0x2 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r5 + bne _080D13B0 + adds r6, 0x1 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r4 + bne _080D13B0 + adds r0, r3, 0 + b _080D13BC + .align 2, 0 +_080D13A8: .4byte 0x02039d08 +_080D13AC: .4byte 0x00002210 +_080D13B0: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _080D1380 + movs r0, 0x3 +_080D13BC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D1370 + + thumb_func_start sub_80D13C4 +sub_80D13C4: @ 80D13C4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r2, 0 + ldr r0, _080D13EC + ldr r3, [r0] + ldr r0, _080D13F0 + adds r4, r3, r0 + ldr r6, _080D13F4 +_080D13D4: + lsls r1, r2, 4 + adds r0, r3, r1 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _080D13F8 + adds r0, r4, r1 + ldr r0, [r0] + cmp r0, r5 + bne _080D13F8 + adds r0, r2, 0 + b _080D1404 + .align 2, 0 +_080D13EC: .4byte 0x02039d08 +_080D13F0: .4byte 0x00002204 +_080D13F4: .4byte 0x00002210 +_080D13F8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _080D13D4 + movs r0, 0x3 +_080D1404: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D13C4 + + thumb_func_start sub_80D140C +sub_80D140C: @ 80D140C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r5, 0x2 + bhi _080D150A + cmp r1, 0 + beq _080D1438 + cmp r1, 0x1 + beq _080D1494 + ldr r4, _080D1434 + lsls r3, r5, 4 + b _080D14F4 + .align 2, 0 +_080D1434: .4byte 0x02039d08 +_080D1438: + adds r0, r7, 0 + movs r1, 0x6 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080D148C + ldr r2, [r6] + lsls r5, 4 + ldr r1, _080D1490 + adds r2, r1 + adds r2, r5 + ldr r3, [r2] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, 0x70 + strh r1, [r3, 0x20] + ldr r3, [r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x38 + strh r1, [r3, 0x22] + ldr r2, [r2] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r4, r6, 0 + adds r3, r5, 0 + b _080D14F4 + .align 2, 0 +_080D148C: .4byte 0x02039d08 +_080D1490: .4byte 0x00002204 +_080D1494: + cmp r7, 0 + bne _080D14BC + ldr r4, _080D14B4 + ldr r0, [r4] + lsls r3, r5, 4 + ldr r1, _080D14B8 + adds r0, r1 + adds r0, r3 + ldr r2, [r0] + movs r1, 0x74 + strh r1, [r2, 0x20] + ldr r1, [r0] + movs r0, 0x4C + strh r0, [r1, 0x22] + b _080D14DC + .align 2, 0 +_080D14B4: .4byte 0x02039d08 +_080D14B8: .4byte 0x00002204 +_080D14BC: + ldr r4, _080D1514 + ldr r0, [r4] + lsls r3, r5, 4 + ldr r1, _080D1518 + adds r0, r1 + adds r0, r3 + ldr r2, [r0] + movs r1, 0xA4 + strh r1, [r2, 0x20] + ldr r2, [r0] + subs r1, r7, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x1C + strh r0, [r2, 0x22] +_080D14DC: + ldr r0, [r4] + ldr r1, _080D1518 + adds r0, r1 + adds r0, r3 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] +_080D14F4: + ldr r0, [r4] + adds r0, r3 + ldr r1, _080D151C + adds r0, r1 + mov r1, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldr r1, _080D1520 + adds r0, r1 + strb r7, [r0] +_080D150A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D1514: .4byte 0x02039d08 +_080D1518: .4byte 0x00002204 +_080D151C: .4byte 0x0000220e +_080D1520: .4byte 0x0000220f + thumb_func_end sub_80D140C + + thumb_func_start sub_80D1524 +sub_80D1524: @ 80D1524 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r1 + mov r9, r2 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bhi _080D15AC + movs r0, 0 + str r0, [sp] + ldr r4, _080D15BC + ldr r1, [r4] + ldr r6, _080D15C0 + adds r1, r6 + ldr r2, _080D15C4 + mov r0, sp + bl CpuFastSet + ldr r1, [r4] + ldr r5, _080D15C8 + adds r1, r5 + mov r0, r8 + bl LZ77UnCompWram + lsls r7, 4 + mov r8, r7 + adds r7, r4, 0 + movs r4, 0x2 +_080D1562: + ldr r1, [r7] + adds r0, r1, r5 + adds r1, r6 + movs r2, 0x18 + bl CpuFastSet + adds r6, 0x80 + adds r5, 0x60 + subs r4, 0x1 + cmp r4, 0 + bge _080D1562 + ldr r5, _080D15BC + ldr r1, [r5] + ldr r4, _080D15C0 + adds r0, r1, r4 + ldr r2, _080D15CC + adds r1, r2 + add r1, r8 + ldr r1, [r1] + movs r2, 0x80 + bl CpuFastSet + ldr r1, [r5] + adds r1, r4 + mov r0, r9 + bl LZ77UnCompWram + ldr r0, [r5] + adds r4, r0, r4 + add r0, r8 + ldr r1, _080D15D0 + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply +_080D15AC: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D15BC: .4byte 0x02039d08 +_080D15C0: .4byte 0x000042c4 +_080D15C4: .4byte 0x01000080 +_080D15C8: .4byte 0x000022c4 +_080D15CC: .4byte 0x00002208 +_080D15D0: .4byte 0x0000220c + thumb_func_end sub_80D1524 + + thumb_func_start sub_80D15D4 +sub_80D15D4: @ 80D15D4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + cmp r2, 0x2 + bhi _080D15F6 + ldr r0, _080D15FC + ldr r0, [r0] + lsls r1, r2, 4 + ldr r2, _080D1600 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + adds r1, r3, 0 + bl sub_8008258 +_080D15F6: + pop {r0} + bx r0 + .align 2, 0 +_080D15FC: .4byte 0x02039d08 +_080D1600: .4byte 0x00002204 + thumb_func_end sub_80D15D4 + + thumb_func_start sub_80D1604 +sub_80D1604: @ 80D1604 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + cmp r4, 0x2 + bls _080D161C + b _080D172E +_080D161C: + cmp r0, 0x7 + bls _080D1622 + b _080D172E +_080D1622: + lsls r0, 2 + ldr r1, _080D162C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D162C: .4byte _080D1630 + .align 2, 0 +_080D1630: + .4byte _080D1650 + .4byte _080D1674 + .4byte _080D1698 + .4byte _080D16C4 + .4byte _080D16F0 + .4byte _080D172E + .4byte _080D172E + .4byte _080D171C +_080D1650: + ldr r0, _080D1668 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, _080D166C + adds r0, r2 + adds r0, r1 + ldr r1, [r0] + strh r4, [r1, 0x2E] + ldr r1, [r0] + ldr r0, _080D1670 + b _080D172C + .align 2, 0 +_080D1668: .4byte 0x02039d08 +_080D166C: .4byte 0x00002204 +_080D1670: .4byte sub_80D1A48 + 1 +_080D1674: + ldr r0, _080D168C + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, _080D1690 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r1, [r0] + ldr r0, _080D1694 + b _080D172C + .align 2, 0 +_080D168C: .4byte 0x02039d08 +_080D1690: .4byte 0x00002204 +_080D1694: .4byte sub_80D1A74 + 1 +_080D1698: + ldr r0, _080D16B8 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, _080D16BC + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r1, [r0] + strh r5, [r1, 0x3A] + ldr r1, [r0] + strh r3, [r1, 0x3C] + ldr r1, [r0] + ldr r0, _080D16C0 + b _080D172C + .align 2, 0 +_080D16B8: .4byte 0x02039d08 +_080D16BC: .4byte 0x00002204 +_080D16C0: .4byte sub_80D1B14 + 1 +_080D16C4: + ldr r0, _080D16E4 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, _080D16E8 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r2, [r0] + ldr r1, _080D16EC + str r1, [r2, 0x1C] + strh r5, [r2, 0x3A] + ldr r0, [r0] + strh r3, [r0, 0x3C] + b _080D172E + .align 2, 0 +_080D16E4: .4byte 0x02039d08 +_080D16E8: .4byte 0x00002204 +_080D16EC: .4byte sub_80D1B94 + 1 +_080D16F0: + ldr r0, _080D1710 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, _080D1714 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r1, [r0] + strh r5, [r1, 0x3A] + ldr r1, [r0] + strh r3, [r1, 0x3C] + ldr r1, [r0] + ldr r0, _080D1718 + b _080D172C + .align 2, 0 +_080D1710: .4byte 0x02039d08 +_080D1714: .4byte 0x00002204 +_080D1718: .4byte sub_80D1C30 + 1 +_080D171C: + ldr r0, _080D1734 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, _080D1738 + adds r0, r2 + adds r0, r1 + ldr r1, [r0] + ldr r0, _080D173C +_080D172C: + str r0, [r1, 0x1C] +_080D172E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D1734: .4byte 0x02039d08 +_080D1738: .4byte 0x00002204 +_080D173C: .4byte sub_80D1CCC + 1 + thumb_func_end sub_80D1604 + + thumb_func_start sub_80D1740 +sub_80D1740: @ 80D1740 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r2, 0x2 + bhi _080D1780 + ldr r1, _080D1788 + ldr r0, [r1] + lsls r2, 4 + adds r0, r2 + ldr r3, _080D178C + adds r0, r3 + strb r4, [r0] + ldr r0, [r1] + ldr r1, _080D1790 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + movs r3, 0 + cmp r4, 0 + bne _080D176E + movs r3, 0x1 +_080D176E: + adds r2, r0, 0 + adds r2, 0x3E + lsls r3, 2 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] +_080D1780: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1788: .4byte 0x02039d08 +_080D178C: .4byte 0x00002210 +_080D1790: .4byte 0x00002204 + thumb_func_end sub_80D1740 + + thumb_func_start sub_80D1794 +sub_80D1794: @ 80D1794 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl GetItemIconPic + pop {r1} + bx r1 + thumb_func_end sub_80D1794 + + thumb_func_start sub_80D17A4 +sub_80D17A4: @ 80D17A4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl GetItemIconPic + pop {r1} + bx r1 + thumb_func_end sub_80D17A4 + + thumb_func_start sub_80D17B4 +sub_80D17B4: @ 80D17B4 + push {r4,lr} + sub sp, 0x14 + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080D17D4 + ldr r0, _080D17CC + ldr r0, [r0] + ldr r1, _080D17D0 + b _080D17DA + .align 2, 0 +_080D17CC: .4byte 0x02039d08 +_080D17D0: .4byte 0x00002234 +_080D17D4: + ldr r0, _080D1810 + ldr r0, [r0] + ldr r1, _080D1814 +_080D17DA: + adds r0, r1 + ldrh r0, [r0] + bl itemid_get_description + adds r4, r0, 0 + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl sub_8199F74 + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1810: .4byte 0x02039d08 +_080D1814: .4byte 0x00000ce6 + thumb_func_end sub_80D17B4 + + thumb_func_start sub_80D1818 +sub_80D1818: @ 80D1818 + push {lr} + ldr r0, _080D1840 + ldr r0, [r0] + ldr r1, _080D1844 + adds r0, r1 + movs r1, 0x15 + strh r1, [r0] + ldr r1, _080D1848 + movs r3, 0x9D + lsls r3, 1 + movs r0, 0 + movs r2, 0x80 + bl gpu_copy_bg_tile_pattern_data_to_vram + movs r0, 0 + bl sub_80D19B4 + pop {r0} + bx r0 + .align 2, 0 +_080D1840: .4byte 0x02039d08 +_080D1844: .4byte 0x00002236 +_080D1848: .4byte 0x0857bb24 + thumb_func_end sub_80D1818 + + thumb_func_start sub_80D184C +sub_80D184C: @ 80D184C + push {r4,r5,lr} + sub sp, 0x10 + ldr r0, _080D1864 + ldr r0, [r0] + ldr r2, _080D1868 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0 + bne _080D186C + movs r0, 0 + b _080D18D2 + .align 2, 0 +_080D1864: .4byte 0x02039d08 +_080D1868: .4byte 0x00002236 +_080D186C: + subs r0, 0x1 + strh r0, [r1] + ldrh r1, [r1] + movs r0, 0x15 + subs r5, r0, r1 + movs r4, 0 + cmp r4, r5 + bge _080D18BC +_080D187C: + movs r0, 0 + movs r1, 0xA + bl bg_get_field + adds r1, r0, 0 + ldr r0, _080D18DC + ldr r0, [r0] + ldr r2, _080D18E0 + adds r0, r2 + adds r1, 0x14 + ldrh r0, [r0] + adds r1, r0 + adds r1, r4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r4, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x15 + str r0, [sp, 0xC] + movs r0, 0 + movs r3, 0xD + bl bg_write_sequence_to_wram_tile_map_rect + adds r4, 0x1 + cmp r4, r5 + blt _080D187C +_080D18BC: + adds r0, r5, 0 + bl sub_80D19B4 + ldr r0, _080D18DC + ldr r0, [r0] + ldr r1, _080D18E0 + adds r0, r1 + ldrh r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_080D18D2: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080D18DC: .4byte 0x02039d08 +_080D18E0: .4byte 0x00002236 + thumb_func_end sub_80D184C + + thumb_func_start sub_80D18E4 +sub_80D18E4: @ 80D18E4 + push {r4,r5,lr} + sub sp, 0x10 + ldr r5, _080D18FC + ldr r0, [r5] + ldr r4, _080D1900 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x16 + bne _080D1904 + movs r0, 0 + b _080D19A4 + .align 2, 0 +_080D18FC: .4byte 0x02039d08 +_080D1900: .4byte 0x00002236 +_080D1904: + cmp r0, 0 + bne _080D1920 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x15 + movs r3, 0xC + bl Bg_FillWramTileMapRectWithTileAndPalette +_080D1920: + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrh r1, [r1] + movs r0, 0x15 + subs r5, r0, r1 + movs r4, 0 + cmp r4, r5 + bge _080D1976 +_080D1936: + movs r0, 0 + movs r1, 0xA + bl bg_get_field + adds r1, r0, 0 + ldr r0, _080D19AC + ldr r0, [r0] + ldr r2, _080D19B0 + adds r0, r2 + adds r1, 0x14 + ldrh r0, [r0] + adds r1, r0 + adds r1, r4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r4, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x15 + str r0, [sp, 0xC] + movs r0, 0 + movs r3, 0xD + bl bg_write_sequence_to_wram_tile_map_rect + adds r4, 0x1 + cmp r4, r5 + blt _080D1936 +_080D1976: + cmp r5, 0 + blt _080D1980 + adds r0, r5, 0 + bl sub_80D19B4 +_080D1980: + adds r2, r5, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0xC + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 +_080D19A4: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080D19AC: .4byte 0x02039d08 +_080D19B0: .4byte 0x00002236 + thumb_func_end sub_80D18E4 + + thumb_func_start sub_80D19B4 +sub_80D19B4: @ 80D19B4 + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + cmp r7, 0 + beq _080D19EC + movs r1, 0x9D + lsls r1, 1 + lsls r4, r7, 24 + lsrs r4, 24 + str r4, [sp] + movs r6, 0x1 + str r6, [sp, 0x4] + movs r5, 0xF + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0xC + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _080D1A3C + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x14 + bl Bg_FillWramTileMapRectWithTileAndPalette +_080D19EC: + ldr r1, _080D1A40 + lsls r5, r7, 24 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r6, 0xF + str r6, [sp, 0x8] + movs r0, 0 + adds r2, r5, 0 + movs r3, 0xD + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x9E + lsls r1, 1 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + adds r2, r5, 0 + movs r3, 0xC + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _080D1A44 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + adds r2, r5, 0 + movs r3, 0x14 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D1A3C: .4byte 0x0000093a +_080D1A40: .4byte 0x0000013b +_080D1A44: .4byte 0x0000013d + thumb_func_end sub_80D19B4 + + thumb_func_start sub_80D1A48 +sub_80D1A48: @ 80D1A48 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D1A68 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80D1740 + ldr r0, _080D1A70 + str r0, [r4, 0x1C] +_080D1A68: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1A70: .4byte nullsub_12 + 1 + thumb_func_end sub_80D1A48 + + thumb_func_start sub_80D1A74 +sub_80D1A74: @ 80D1A74 + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _080D1A86 + cmp r1, 0x1 + beq _080D1AA2 + b _080D1AD0 +_080D1A86: + ldrh r0, [r3, 0x20] + lsls r0, 4 + strh r0, [r3, 0x30] + ldrh r0, [r3, 0x22] + lsls r0, 4 + strh r0, [r3, 0x32] + movs r0, 0xA + strh r0, [r3, 0x34] + movs r0, 0x15 + strh r0, [r3, 0x36] + strh r1, [r3, 0x38] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] +_080D1AA2: + ldrh r1, [r3, 0x30] + ldrh r0, [r3, 0x34] + subs r1, r0 + strh r1, [r3, 0x30] + ldrh r0, [r3, 0x32] + ldrh r2, [r3, 0x36] + subs r0, r2 + strh r0, [r3, 0x32] + lsls r1, 16 + asrs r1, 20 + strh r1, [r3, 0x20] + lsls r0, 16 + asrs r0, 20 + strh r0, [r3, 0x22] + ldrh r0, [r3, 0x38] + adds r0, 0x1 + strh r0, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1AD0 + ldr r0, _080D1AD4 + str r0, [r3, 0x1C] +_080D1AD0: + pop {r0} + bx r0 + .align 2, 0 +_080D1AD4: .4byte sub_80D1AD8 + 1 + thumb_func_end sub_80D1A74 + + thumb_func_start sub_80D1AD8 +sub_80D1AD8: @ 80D1AD8 + ldr r1, _080D1B0C + ldr r3, [r1] + ldr r1, _080D1B10 + adds r3, r1 + ldr r1, [r3] + ldrh r1, [r1, 0x20] + adds r1, 0x4 + strh r1, [r0, 0x20] + ldr r2, [r3] + ldrh r1, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r1, r2 + adds r1, 0x8 + strh r1, [r0, 0x22] + ldr r1, [r3] + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + bx lr + .align 2, 0 +_080D1B0C: .4byte 0x02039d08 +_080D1B10: .4byte 0x00000cb4 + thumb_func_end sub_80D1AD8 + + thumb_func_start sub_80D1B14 +sub_80D1B14: @ 80D1B14 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080D1B26 + cmp r1, 0x1 + beq _080D1B42 + b _080D1B8A +_080D1B26: + ldrh r0, [r4, 0x20] + lsls r0, 4 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + movs r0, 0x15 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080D1B42: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + ldrh r2, [r4, 0x32] + adds r1, r2 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x22] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1B8A + adds r0, r4, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + bl sub_80D140C + ldr r0, _080D1B90 + str r0, [r4, 0x1C] +_080D1B8A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1B90: .4byte nullsub_12 + 1 + thumb_func_end sub_80D1B14 + + thumb_func_start sub_80D1B94 +sub_80D1B94: @ 80D1B94 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080D1BA6 + cmp r1, 0x1 + beq _080D1BC2 + b _080D1C20 +_080D1BA6: + ldrh r0, [r4, 0x20] + lsls r0, 4 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + movs r0, 0x15 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080D1BC2: + ldrh r1, [r4, 0x30] + ldrh r0, [r4, 0x34] + subs r1, r0 + strh r1, [r4, 0x30] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + subs r0, r2 + strh r0, [r4, 0x32] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x20] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x22] + ldr r1, _080D1C28 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1C20 + adds r0, r4, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + bl sub_80D140C + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, _080D1C2C + str r0, [r4, 0x1C] +_080D1C20: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1C28: .4byte 0x08329f40 +_080D1C2C: .4byte sub_80D1AD8 + 1 + thumb_func_end sub_80D1B94 + + thumb_func_start sub_80D1C30 +sub_80D1C30: @ 80D1C30 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080D1C42 + cmp r1, 0x1 + beq _080D1C5E + b _080D1CBE +_080D1C42: + ldrh r0, [r4, 0x20] + lsls r0, 4 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + movs r0, 0x15 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080D1C5E: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + ldrh r2, [r4, 0x32] + adds r1, r2 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x22] + ldr r1, _080D1CC4 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1CBE + adds r0, r4, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + bl sub_80D140C + ldr r0, _080D1CC8 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] +_080D1CBE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D1CC4: .4byte 0x08329f40 +_080D1CC8: .4byte nullsub_12 + 1 + thumb_func_end sub_80D1C30 + + thumb_func_start sub_80D1CCC +sub_80D1CCC: @ 80D1CCC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + subs r0, 0x8 + strh r0, [r2, 0x22] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080D1CFC + ldr r0, _080D1D00 + str r0, [r2, 0x1C] + adds r0, r2, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80D1740 +_080D1CFC: + pop {r0} + bx r0 + .align 2, 0 +_080D1D00: .4byte nullsub_12 + 1 + thumb_func_end sub_80D1CCC + + thumb_func_start nullsub_40 +nullsub_40: @ 80D1D04 + bx lr + thumb_func_end nullsub_40 + + thumb_func_start nullsub_98 +nullsub_98: @ 80D1D08 + bx lr + thumb_func_end nullsub_98 + + thumb_func_start get_preferred_box +get_preferred_box: @ 80D1D0C + ldr r0, _080D1D14 + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .align 2, 0 +_080D1D14: .4byte 0x03005d94 + thumb_func_end get_preferred_box + + thumb_func_start sub_80D1D18 +sub_80D1D18: @ 80D1D18 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xD + bhi _080D1D28 + ldr r0, _080D1D2C + ldr r0, [r0] + strb r1, [r0] +_080D1D28: + pop {r0} + bx r0 + .align 2, 0 +_080D1D2C: .4byte 0x03005d94 + thumb_func_end sub_80D1D18 + + thumb_func_start get_pokemon_data_from_any_box +get_pokemon_data_from_any_box: @ 80D1D30 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1D6C + cmp r4, 0x1D + bhi _080D1D6C + ldr r2, _080D1D68 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + bl pokemon_getattr_encrypted + b _080D1D6E + .align 2, 0 +_080D1D68: .4byte 0x03005d94 +_080D1D6C: + movs r0, 0 +_080D1D6E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end get_pokemon_data_from_any_box + + thumb_func_start set_pokemon_data_from_any_box +set_pokemon_data_from_any_box: @ 80D1D74 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1DAC + cmp r4, 0x1D + bhi _080D1DAC + ldr r2, _080D1DB4 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + adds r2, r6, 0 + bl pokemon_setattr_encrypted +_080D1DAC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D1DB4: .4byte 0x03005d94 + thumb_func_end set_pokemon_data_from_any_box + + thumb_func_start get_pokemon_data_from_selected_box +get_pokemon_data_from_selected_box: @ 80D1DB8 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _080D1DD4 + ldr r0, [r0] + ldrb r0, [r0] + adds r1, r3, 0 + bl get_pokemon_data_from_any_box + pop {r1} + bx r1 + .align 2, 0 +_080D1DD4: .4byte 0x03005d94 + thumb_func_end get_pokemon_data_from_selected_box + + thumb_func_start set_pokemon_data_from_selected_box +set_pokemon_data_from_selected_box: @ 80D1DD8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080D1DF8 + ldr r0, [r0] + ldrb r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl set_pokemon_data_from_any_box + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D1DF8: .4byte 0x03005d94 + thumb_func_end set_pokemon_data_from_selected_box + + thumb_func_start sub_80D1DFC +sub_80D1DFC: @ 80D1DFC + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1E38 + cmp r4, 0x1D + bhi _080D1E38 + ldr r2, _080D1E34 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr_encrypted + b _080D1E3C + .align 2, 0 +_080D1E34: .4byte 0x03005d94 +_080D1E38: + movs r0, 0xFF + strb r0, [r5] +_080D1E3C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D1DFC + + thumb_func_start sub_80D1E44 +sub_80D1E44: @ 80D1E44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r0, 0xD + bhi _080D1E84 + cmp r2, 0x1D + bhi _080D1E84 + ldr r6, _080D1E8C + lsls r1, r0, 2 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r5, r0, 0x4 + ldr r0, [r6] + adds r0, r5 + lsls r1, r2, 2 + adds r1, r2 + lsls r4, r1, 4 + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D1E84 + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + bl sub_80690C0 +_080D1E84: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080D1E8C: .4byte 0x03005d94 + thumb_func_end sub_80D1E44 + + thumb_func_start sub_80D1E90 +sub_80D1E90: @ 80D1E90 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1EC6 + cmp r4, 0x1D + bhi _080D1EC6 + ldr r2, _080D1ECC + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_setattr_encrypted +_080D1EC6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D1ECC: .4byte 0x03005d94 + thumb_func_end sub_80D1E90 + + thumb_func_start sub_80D1ED0 +sub_80D1ED0: @ 80D1ED0 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1F10 + cmp r4, 0x1D + bhi _080D1F10 + ldr r2, _080D1F0C + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + adds r2, r6, 0 + bl pokemon_getattr_encrypted + b _080D1F12 + .align 2, 0 +_080D1F0C: .4byte 0x03005d94 +_080D1F10: + movs r0, 0 +_080D1F12: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D1ED0 + + thumb_func_start sub_80D1F18 +sub_80D1F18: @ 80D1F18 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r4, 0xD + bhi _080D1F4E + cmp r1, 0x1D + bhi _080D1F4E + ldr r0, _080D1F54 + ldr r0, [r0] + lsls r3, r1, 2 + adds r3, r1 + lsls r3, 4 + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 5 + adds r3, r1 + adds r0, r3 + adds r0, 0x4 + adds r1, r5, 0 + movs r2, 0x50 + bl memcpy +_080D1F4E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D1F54: .4byte 0x03005d94 + thumb_func_end sub_80D1F18 + + thumb_func_start sub_80D1F58 +sub_80D1F58: @ 80D1F58 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r4, 0xD + bhi _080D1F8E + cmp r2, 0x1D + bhi _080D1F8E + ldr r0, _080D1F94 + ldr r1, [r0] + lsls r3, r2, 2 + adds r3, r2 + lsls r3, 4 + lsls r2, r4, 2 + adds r2, r4 + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + adds r3, r0 + adds r1, r3 + adds r1, 0x4 + adds r0, r5, 0 + movs r2, 0x50 + bl memcpy +_080D1F8E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D1F94: .4byte 0x03005d94 + thumb_func_end sub_80D1F58 + + thumb_func_start sub_80D1F98 +sub_80D1F98: @ 80D1F98 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x3C] + mov r12, r6 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r0, r12 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r7, 0xD + bhi _080D2004 + cmp r6, 0x1D + bhi _080D2004 + ldr r2, _080D2014 + lsls r0, r7, 2 + adds r0, r7 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 4 + adds r0, r1 + str r5, [sp] + ldr r1, [sp, 0x38] + str r1, [sp, 0x4] + str r3, [sp, 0x8] + ldr r1, [sp, 0x40] + str r1, [sp, 0xC] + mov r1, r9 + mov r2, r8 + adds r3, r4, 0 + bl create_pokemon +_080D2004: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D2014: .4byte 0x03005d94 + thumb_func_end sub_80D1F98 + + thumb_func_start sub_80D2018 +sub_80D2018: @ 80D2018 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D2048 + cmp r4, 0x1D + bhi _080D2048 + ldr r2, _080D2050 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + bl zero_pokemon_boxed_data +_080D2048: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D2050: .4byte 0x03005d94 + thumb_func_end sub_80D2018 + + thumb_func_start sub_80D2054 +sub_80D2054: @ 80D2054 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D2088 + cmp r4, 0x1D + bhi _080D2088 + ldr r2, _080D2090 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + bl sub_8069004 +_080D2088: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D2090: .4byte 0x03005d94 + thumb_func_end sub_80D2054 + + thumb_func_start get_pokemon_by_box_and_pos +get_pokemon_by_box_and_pos: @ 80D2094 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D20C8 + cmp r4, 0x1D + bhi _080D20C8 + ldr r2, _080D20C4 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + b _080D20CA + .align 2, 0 +_080D20C4: .4byte 0x03005d94 +_080D20C8: + movs r0, 0 +_080D20CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end get_pokemon_by_box_and_pos + + thumb_func_start sav3_get_box_name +sav3_get_box_name: @ 80D20D0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xD + bls _080D20DE + movs r0, 0 + b _080D20EC +_080D20DE: + ldr r0, _080D20F0 + lsls r1, r2, 3 + adds r1, r2 + ldr r2, _080D20F4 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 +_080D20EC: + pop {r1} + bx r1 + .align 2, 0 +_080D20F0: .4byte 0x03005d94 +_080D20F4: .4byte 0x00008344 + thumb_func_end sav3_get_box_name + + thumb_func_start sub_80D20F8 +sub_80D20F8: @ 80D20F8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xD + bls _080D2106 + movs r0, 0 + b _080D2112 +_080D2106: + ldr r0, _080D2118 + ldr r0, [r0] + ldr r2, _080D211C + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] +_080D2112: + pop {r1} + bx r1 + .align 2, 0 +_080D2118: .4byte 0x03005d94 +_080D211C: .4byte 0x000083c2 + thumb_func_end sub_80D20F8 + + thumb_func_start sub_80D2120 +sub_80D2120: @ 80D2120 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r2, 0xD + bhi _080D213E + cmp r1, 0x10 + bhi _080D213E + ldr r0, _080D2144 + ldr r0, [r0] + ldr r3, _080D2148 + adds r0, r3 + adds r0, r2 + strb r1, [r0] +_080D213E: + pop {r0} + bx r0 + .align 2, 0 +_080D2144: .4byte 0x03005d94 +_080D2148: .4byte 0x000083c2 + thumb_func_end sub_80D2120 + + thumb_func_start sub_80D214C +sub_80D214C: @ 80D214C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r0, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + adds r4, r3, 0 + ldr r2, _080D21B0 + cmp r3, 0x1 + bhi _080D216E + movs r2, 0x1 + cmp r3, 0x1 + beq _080D2172 +_080D216E: + cmp r4, 0x3 + bne _080D21BC +_080D2172: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080D2208 + cmp r1, r7 + bgt _080D2208 +_080D218A: + asrs r4, r0, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + add r0, r8 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D21B4 + asrs r0, r6, 16 + adds r0, r4, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080D2208 + cmp r2, r7 + ble _080D218A + b _080D2208 + .align 2, 0 +_080D21B0: .4byte 0x0000ffff +_080D21B4: + adds r0, r4, 0 + b _080D220C +_080D21B8: + adds r0, r5, 0 + b _080D220C +_080D21BC: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080D2208 + cmp r1, r7 + bgt _080D2208 +_080D21D4: + asrs r5, r0, 16 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 4 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D21F8 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D21B8 +_080D21F8: + asrs r0, r6, 16 + adds r0, r5, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080D2208 + cmp r2, r7 + ble _080D21D4 +_080D2208: + movs r0, 0x1 + negs r0, r0 +_080D220C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D214C + + thumb_func_start sub_80D2218 +sub_80D2218: @ 80D2218 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _080D2248 + mov r8, r0 + movs r7, 0x4 +_080D2228: + movs r5, 0 + adds r6, r7, 0 + movs r4, 0 +_080D222E: + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + adds r0, r4 + movs r1, 0x5 + str r2, [sp] + bl pokemon_getattr_encrypted + ldr r2, [sp] + cmp r0, 0 + bne _080D224C + movs r0, 0x1 + b _080D2262 + .align 2, 0 +_080D2248: .4byte 0x03005d94 +_080D224C: + adds r4, 0x50 + adds r5, 0x1 + cmp r5, 0x1D + ble _080D222E + movs r0, 0x96 + lsls r0, 4 + adds r7, r0 + adds r2, 0x1 + cmp r2, 0xD + ble _080D2228 + movs r0, 0 +_080D2262: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D2218 + + thumb_func_start sub_80D2270 +sub_80D2270: @ 80D2270 + push {r4-r6,lr} + adds r2, r1, 0 + cmp r0, 0xD + bhi _080D22C8 + cmp r2, 0x1D + bhi _080D22C8 + ldr r6, _080D22C4 + lsls r1, r0, 2 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r5, r0, 0x4 + ldr r0, [r6] + adds r0, r5 + lsls r1, r2, 2 + adds r1, r2 + lsls r4, r1, 4 + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D22C8 + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D22C8 + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + movs r1, 0x4 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D22C8 + movs r0, 0x1 + b _080D22CA + .align 2, 0 +_080D22C4: .4byte 0x03005d94 +_080D22C8: + movs r0, 0 +_080D22CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D2270 + + thumb_func_start sub_80D22D0 +sub_80D22D0: @ 80D22D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + movs r0, 0 + ldr r1, _080D2338 + mov r9, r1 +_080D22E0: + lsls r1, r0, 2 + adds r2, r0, 0x1 + mov r8, r2 + adds r1, r0 + movs r5, 0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r4, r0, 0x4 + movs r6, 0x1D +_080D22F4: + mov r1, r9 + ldr r0, [r1] + adds r0, r4 + adds r0, r5 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D231A + mov r2, r9 + ldr r0, [r2] + adds r0, r4 + adds r0, r5 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D231A + adds r7, 0x1 +_080D231A: + adds r5, 0x50 + subs r6, 0x1 + cmp r6, 0 + bge _080D22F4 + mov r0, r8 + cmp r0, 0xD + ble _080D22E0 + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D2338: .4byte 0x03005d94 + thumb_func_end sub_80D22D0 + + thumb_func_start sub_80D233C +sub_80D233C: @ 80D233C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + movs r0, 0 + ldr r1, _080D23A4 + mov r9, r1 +_080D234C: + lsls r1, r0, 2 + adds r2, r0, 0x1 + mov r8, r2 + adds r1, r0 + movs r5, 0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r4, r0, 0x4 + movs r6, 0x1D +_080D2360: + mov r1, r9 + ldr r0, [r1] + adds r0, r4 + adds r0, r5 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D2384 + mov r2, r9 + ldr r0, [r2] + adds r0, r4 + adds r0, r5 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D2386 +_080D2384: + adds r7, 0x1 +_080D2386: + adds r5, 0x50 + subs r6, 0x1 + cmp r6, 0 + bge _080D2360 + mov r0, r8 + cmp r0, 0xD + ble _080D234C + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D23A4: .4byte 0x03005d94 + thumb_func_end sub_80D233C + + thumb_func_start sub_80D23A8 +sub_80D23A8: @ 80D23A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r1, sp + strh r0, [r1] + ldr r0, _080D23FC + strh r0, [r1, 0x2] + movs r0, 0 + mov r8, r0 + ldr r7, _080D2400 + movs r5, 0x4 +_080D23C0: + movs r6, 0 + movs r4, 0 +_080D23C4: + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D2404 + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D2404 + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + movs r1, 0x51 + mov r2, sp + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D2404 + movs r0, 0x1 + b _080D241E + .align 2, 0 +_080D23FC: .4byte 0x00000163 +_080D2400: .4byte 0x03005d94 +_080D2404: + adds r4, 0x50 + adds r6, 0x1 + cmp r6, 0x1D + ble _080D23C4 + movs r0, 0x96 + lsls r0, 4 + adds r5, r0 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0xD + ble _080D23C0 + movs r0, 0 +_080D241E: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D23A8 + + thumb_func_start sub_80D242C +sub_80D242C: @ 80D242C + ldr r2, _080D2464 + ldr r0, [r2] + ldr r1, _080D2468 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _080D246C + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r1, [r2] + ldr r0, _080D2470 + adds r2, r1, r0 + ldr r0, _080D2474 + strh r0, [r2] + subs r3, 0x14 + adds r2, r1, r3 + ldr r0, _080D2478 + strh r0, [r2] + ldr r0, _080D247C + adds r1, r0 + movs r0, 0xFF + strb r0, [r1] + bx lr + .align 2, 0 +_080D2464: .4byte 0x03005d8c +_080D2468: .4byte 0x00003d84 +_080D246C: .4byte 0x00003d85 +_080D2470: .4byte 0x00003d70 +_080D2474: .4byte 0x00007b35 +_080D2478: .4byte 0x00006186 +_080D247C: .4byte 0x00003d74 + thumb_func_end sub_80D242C + + thumb_func_start sub_80D2480 +sub_80D2480: @ 80D2480 + ldr r1, _080D248C + ldr r1, [r1] + ldr r2, _080D2490 + adds r1, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_080D248C: .4byte 0x03005d8c +_080D2490: .4byte 0x00003d86 + thumb_func_end sub_80D2480 + + thumb_func_start sub_80D2494 +sub_80D2494: @ 80D2494 + ldr r0, _080D24A0 + ldr r0, [r0] + ldr r1, _080D24A4 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080D24A0: .4byte 0x03005d8c +_080D24A4: .4byte 0x00003d86 + thumb_func_end sub_80D2494 + + thumb_func_start sub_80D24A8 +sub_80D24A8: @ 80D24A8 + ldr r0, _080D24B4 + ldr r0, [r0] + ldr r1, _080D24B8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080D24B4: .4byte 0x03005d8c +_080D24B8: .4byte 0x00003d85 + thumb_func_end sub_80D24A8 + + thumb_func_start sub_80D24BC +sub_80D24BC: @ 80D24BC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _080D24D0 + ldr r0, _080D24D4 + ldr r0, [r0] + ldr r2, _080D24D8 + adds r0, r2 + strb r1, [r0] +_080D24D0: + pop {r0} + bx r0 + .align 2, 0 +_080D24D4: .4byte 0x03005d8c +_080D24D8: .4byte 0x00003d85 + thumb_func_end sub_80D24BC + + thumb_func_start sub_80D24DC +sub_80D24DC: @ 80D24DC + ldr r0, _080D24E8 + ldr r0, [r0] + ldr r1, _080D24EC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080D24E8: .4byte 0x03005d8c +_080D24EC: .4byte 0x00003d84 + thumb_func_end sub_80D24DC + + thumb_func_start sub_80D24F0 +sub_80D24F0: @ 80D24F0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _080D2504 + ldr r0, _080D2508 + ldr r0, [r0] + ldr r2, _080D250C + adds r0, r2 + strb r1, [r0] +_080D2504: + pop {r0} + bx r0 + .align 2, 0 +_080D2508: .4byte 0x03005d8c +_080D250C: .4byte 0x00003d84 + thumb_func_end sub_80D24F0 + + thumb_func_start sub_80D2510 +sub_80D2510: @ 80D2510 + ldr r0, _080D251C + ldr r0, [r0] + ldr r1, _080D2520 + adds r0, r1 + bx lr + .align 2, 0 +_080D251C: .4byte 0x03005d8c +_080D2520: .4byte 0x00003d70 + thumb_func_end sub_80D2510 + + thumb_func_start sub_80D2524 +sub_80D2524: @ 80D2524 + push {r4,lr} + ldr r2, _080D253C + ldr r2, [r2] + ldr r4, _080D2540 + adds r3, r2, r4 + strh r0, [r3] + ldr r0, _080D2544 + adds r2, r0 + strh r1, [r2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D253C: .4byte 0x03005d8c +_080D2540: .4byte 0x00003d70 +_080D2544: .4byte 0x00003d72 + thumb_func_end sub_80D2524 + + thumb_func_start sub_80D2548 +sub_80D2548: @ 80D2548 + ldr r0, _080D2554 + ldr r0, [r0] + ldr r1, _080D2558 + adds r0, r1 + bx lr + .align 2, 0 +_080D2554: .4byte 0x03005d8c +_080D2558: .4byte 0x00003d74 + thumb_func_end sub_80D2548 + + thumb_func_start sub_80D255C +sub_80D255C: @ 80D255C + push {lr} + adds r1, r0, 0 + ldr r0, _080D2570 + ldr r0, [r0] + ldr r2, _080D2574 + adds r0, r2 + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_080D2570: .4byte 0x03005d8c +_080D2574: .4byte 0x00003d74 + thumb_func_end sub_80D255C + + thumb_func_start sub_80D2578 +sub_80D2578: @ 80D2578 + push {lr} + movs r1, 0 + ldr r0, _080D2594 + ldr r0, [r0] + ldr r2, _080D2598 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080D258C + movs r1, 0x1 +_080D258C: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080D2594: .4byte 0x03005d8c +_080D2598: .4byte 0x00003d74 + thumb_func_end sub_80D2578 + + thumb_func_start sub_80D259C +sub_80D259C: @ 80D259C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, _080D25E8 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + bl malloc + str r0, [r6] + ldr r5, _080D25EC + movs r1, 0 + cmp r0, 0 + beq _080D25BA + adds r1, r4, 0 +_080D25BA: + strh r1, [r5] + movs r2, 0 + cmp r2, r1 + bcs _080D25E2 + movs r3, 0 + adds r4, r5, 0 +_080D25C6: + ldr r0, [r6] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 4 + adds r1, r0 + str r3, [r1, 0x18] + adds r1, 0x2C + strb r3, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4] + cmp r2, r0 + bcc _080D25C6 +_080D25E2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D25E8: .4byte 0x02039d84 +_080D25EC: .4byte 0x02039d88 + thumb_func_end sub_80D259C + + thumb_func_start sub_80D25F0 +sub_80D25F0: @ 80D25F0 + push {lr} + ldr r0, _080D2600 + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_080D2600: .4byte 0x02039d84 + thumb_func_end sub_80D25F0 + + thumb_func_start sub_80D2604 +sub_80D2604: @ 80D2604 + push {r4,r5,lr} + movs r4, 0 + ldr r0, _080D263C + ldrh r0, [r0] + cmp r4, r0 + bge _080D2634 + movs r5, 0 +_080D2612: + ldr r0, _080D2640 + ldr r0, [r0] + adds r0, r5, r0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D2628 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80D2918 +_080D2628: + adds r5, 0x30 + adds r4, 0x1 + ldr r0, _080D263C + ldrh r0, [r0] + cmp r4, r0 + blt _080D2612 +_080D2634: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D263C: .4byte 0x02039d88 +_080D2640: .4byte 0x02039d84 + thumb_func_end sub_80D2604 + + thumb_func_start sub_80D2644 +sub_80D2644: @ 80D2644 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r2, 0 + ldr r2, [sp, 0x24] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + ldr r0, _080D26DC + ldrh r0, [r0] + cmp r6, r0 + bcs _080D272C + ldr r0, _080D26E0 + mov r9, r0 + ldr r0, [r0] + lsls r1, r6, 1 + mov r8, r1 + adds r5, r1, r6 + lsls r5, 4 + adds r0, r5, r0 + movs r1, 0 + str r1, [r0, 0x18] + str r4, [r0, 0x1C] + adds r0, 0x2B + strb r7, [r0] + mov r2, r9 + ldr r0, [r2] + adds r0, r5, r0 + mov r3, r10 + strh r3, [r0, 0x24] + mov r1, sp + ldrh r1, [r1] + strh r1, [r0, 0x26] + adds r0, r7, 0 + movs r1, 0x3 + bl bg_get_field + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + movs r1, 0x9 + bl bg_get_field + lsls r0, 16 + lsrs r0, 16 + mov r2, r9 + ldr r1, [r2] + adds r5, r1 + ldr r2, _080D26E4 + lsls r4, 2 + lsls r1, r0, 4 + adds r4, r1 + adds r4, r2 + ldrh r1, [r4] + strh r1, [r5, 0x20] + ldrh r1, [r4, 0x2] + strh r1, [r5, 0x22] + mov r2, r8 + cmp r0, 0 + beq _080D26E8 + adds r1, r5, 0 + adds r1, 0x2A + movs r0, 0x1 + b _080D26EE + .align 2, 0 +_080D26DC: .4byte 0x02039d88 +_080D26E0: .4byte 0x02039d84 +_080D26E4: .4byte 0x0857bc88 +_080D26E8: + adds r1, r5, 0 + adds r1, 0x2A + movs r0, 0x2 +_080D26EE: + strb r0, [r1] + ldr r4, _080D273C + ldr r1, [r4] + adds r2, r6 + lsls r2, 4 + adds r1, r2, r1 + adds r0, r1, 0 + adds r0, 0x2A + ldrb r0, [r0] + mov r3, r10 + muls r3, r0 + movs r0, 0 + strh r3, [r1, 0x28] + mov r3, r10 + strh r3, [r1, 0x10] + mov r5, sp + ldrh r5, [r5] + strh r5, [r1, 0x12] + strh r0, [r1, 0xC] + strh r0, [r1, 0xE] + strh r0, [r1, 0x14] + strh r0, [r1, 0x16] + adds r0, r1, 0 + adds r0, 0xC + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldr r0, [r4] + adds r2, r0 + adds r2, 0x2C + movs r0, 0x1 + strb r0, [r2] +_080D272C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D273C: .4byte 0x02039d84 + thumb_func_end sub_80D2644 + + thumb_func_start sub_80D2740 +sub_80D2740: @ 80D2740 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080D2768 + ldrh r0, [r0] + cmp r2, r0 + bcs _080D2764 + ldr r0, _080D276C + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, r1 + str r3, [r0, 0x18] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] +_080D2764: + pop {r0} + bx r0 + .align 2, 0 +_080D2768: .4byte 0x02039d88 +_080D276C: .4byte 0x02039d84 + thumb_func_end sub_80D2740 + + thumb_func_start sub_80D2770 +sub_80D2770: @ 80D2770 + 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, _080D27A4 + ldrh r0, [r0] + cmp r3, r0 + bcs _080D279C + ldr r0, _080D27A8 + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r0, r1 + strh r4, [r0, 0x14] + strh r2, [r0, 0x16] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] +_080D279C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D27A4: .4byte 0x02039d88 +_080D27A8: .4byte 0x02039d84 + thumb_func_end sub_80D2770 + + thumb_func_start sub_80D27AC +sub_80D27AC: @ 80D27AC + push {r4-r6,lr} + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _080D27EC + ldrh r0, [r0] + cmp r5, r0 + bcs _080D27E6 + ldr r0, _080D27F0 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 4 + adds r0, r1 + strh r6, [r0, 0xC] + strh r2, [r0, 0xE] + strh r3, [r0, 0x10] + strh r4, [r0, 0x12] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] +_080D27E6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D27EC: .4byte 0x02039d88 +_080D27F0: .4byte 0x02039d84 + thumb_func_end sub_80D27AC + + thumb_func_start sub_80D27F4 +sub_80D27F4: @ 80D27F4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _080D2820 + ldrh r0, [r0] + cmp r5, r0 + bcc _080D280C + b _080D290E +_080D280C: + ldr r4, _080D2824 + lsls r2, r5, 1 + cmp r1, 0x5 + bls _080D2816 + b _080D2900 +_080D2816: + lsls r0, r1, 2 + ldr r1, _080D2828 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D2820: .4byte 0x02039d88 +_080D2824: .4byte 0x02039d84 +_080D2828: .4byte _080D282C + .align 2, 0 +_080D282C: + .4byte _080D2844 + .4byte _080D2864 + .4byte _080D2888 + .4byte _080D28A8 + .4byte _080D28CC + .4byte _080D28E8 +_080D2844: + ldr r4, _080D2860 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0x14] + adds r0, r2 + strh r0, [r1, 0x14] + ldrh r0, [r1, 0x10] + subs r0, r2 + b _080D287E + .align 2, 0 +_080D2860: .4byte 0x02039d84 +_080D2864: + ldr r4, _080D2884 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x10] + adds r0, r2 +_080D287E: + strh r0, [r1, 0x10] + adds r2, r3, 0 + b _080D2900 + .align 2, 0 +_080D2884: .4byte 0x02039d84 +_080D2888: + ldr r4, _080D28A4 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0x16] + adds r0, r2 + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x12] + subs r0, r2 + b _080D28C2 + .align 2, 0 +_080D28A4: .4byte 0x02039d84 +_080D28A8: + ldr r4, _080D28C8 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0xE] + subs r0, r2 + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x12] + adds r0, r2 +_080D28C2: + strh r0, [r1, 0x12] + adds r2, r3, 0 + b _080D2900 + .align 2, 0 +_080D28C8: .4byte 0x02039d84 +_080D28CC: + ldr r3, _080D28E4 + ldr r0, [r3] + lsls r2, r5, 1 + adds r1, r2, r5 + lsls r1, 4 + adds r1, r0 + lsls r0, r6, 24 + asrs r0, 24 + ldrh r4, [r1, 0x14] + adds r0, r4 + strh r0, [r1, 0x14] + b _080D28FE + .align 2, 0 +_080D28E4: .4byte 0x02039d84 +_080D28E8: + ldr r3, _080D2914 + ldr r0, [r3] + lsls r2, r5, 1 + adds r1, r2, r5 + lsls r1, 4 + adds r1, r0 + lsls r0, r6, 24 + asrs r0, 24 + ldrh r4, [r1, 0x16] + adds r0, r4 + strh r0, [r1, 0x16] +_080D28FE: + adds r4, r3, 0 +_080D2900: + ldr r0, [r4] + adds r1, r2, r5 + lsls r1, 4 + adds r1, r0 + adds r1, 0x2C + movs r0, 0x1 + strb r0, [r1] +_080D290E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D2914: .4byte 0x02039d84 + thumb_func_end sub_80D27F4 + + thumb_func_start sub_80D2918 +sub_80D2918: @ 80D2918 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, _080D2958 + ldrh r0, [r0] + cmp r2, r0 + bcs _080D2952 + ldr r5, _080D295C + ldr r0, [r5] + lsls r1, r2, 1 + adds r1, r2 + lsls r4, r1, 4 + adds r0, r4, r0 + ldr r0, [r0, 0x18] + cmp r0, 0 + beq _080D2940 + adds r0, r2, 0 + bl sub_80D2960 +_080D2940: + adds r0, r6, 0 + bl sub_80D29F8 + ldr r1, [r5] + adds r1, r4, r1 + adds r0, r1, 0 + adds r0, 0xC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} +_080D2952: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D2958: .4byte 0x02039d88 +_080D295C: .4byte 0x02039d84 + thumb_func_end sub_80D2918 + + thumb_func_start sub_80D2960 +sub_80D2960: @ 80D2960 + 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 r4, _080D29F4 + ldr r1, [r4] + lsls r5, r0, 1 + adds r0, r5, r0 + lsls r0, 4 + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x2A + ldrb r3, [r1] + ldrh r1, [r0, 0x20] + adds r2, r3, 0 + muls r2, r1 + mov r9, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + mov r2, r9 + muls r2, r1 + ldr r1, [r0, 0x18] + adds r1, r2 + movs r6, 0x8 + ldrsh r2, [r0, r6] + muls r2, r3 + adds r7, r1, r2 + movs r6, 0 + ldrh r0, [r0, 0x6] + cmp r6, r0 + bge _080D29E4 + mov r10, r4 +_080D29AA: + mov r0, r10 + ldr r1, [r0] + mov r2, r8 + adds r4, r5, r2 + lsls r4, 4 + adds r1, r4, r1 + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldrb r2, [r1, 0x8] + ldrb r3, [r1, 0xA] + adds r3, r6 + lsls r3, 24 + lsrs r3, 24 + ldrb r1, [r1, 0x4] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r7, 0 + bl gpu_copy_to_iwram_tile_map_rect + add r7, r9 + adds r6, 0x1 + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r4, [r4, 0x6] + cmp r6, r4 + blt _080D29AA +_080D29E4: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D29F4: .4byte 0x02039d84 + thumb_func_end sub_80D2960 + + thumb_func_start sub_80D29F8 +sub_80D29F8: @ 80D29F8 + 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 r4, _080D2A8C + ldr r1, [r4] + lsls r5, r0, 1 + adds r0, r5, r0 + lsls r0, 4 + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x2A + ldrb r3, [r1] + ldrh r1, [r0, 0x24] + adds r2, r3, 0 + muls r2, r1 + mov r9, r2 + movs r6, 0xE + ldrsh r1, [r0, r6] + mov r2, r9 + muls r2, r1 + ldr r1, [r0, 0x1C] + adds r1, r2 + movs r6, 0xC + ldrsh r2, [r0, r6] + muls r2, r3 + adds r7, r1, r2 + movs r6, 0 + ldrh r0, [r0, 0x12] + cmp r6, r0 + bge _080D2A7C + mov r10, r4 +_080D2A42: + mov r0, r10 + ldr r1, [r0] + mov r2, r8 + adds r4, r5, r2 + lsls r4, 4 + adds r1, r4, r1 + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldrb r2, [r1, 0x14] + ldrb r3, [r1, 0x16] + adds r3, r6 + lsls r3, 24 + lsrs r3, 24 + ldrb r1, [r1, 0x10] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r7, 0 + bl gpu_copy_to_iwram_tile_map_rect + add r7, r9 + adds r6, 0x1 + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r4, [r4, 0x12] + cmp r6, r4 + blt _080D2A42 +_080D2A7C: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D2A8C: .4byte 0x02039d84 + thumb_func_end sub_80D29F8 + + thumb_func_start sub_80D2A90 +sub_80D2A90: @ 80D2A90 + ldr r3, _080D2AA0 + str r0, [r3] + str r1, [r0] + movs r1, 0 + strb r2, [r0, 0x5] + strb r1, [r0, 0x4] + bx lr + .align 2, 0 +_080D2AA0: .4byte 0x02039d8c + thumb_func_end sub_80D2A90 + + thumb_func_start sub_80D2AA4 +sub_80D2AA4: @ 80D2AA4 + push {r4,r5,lr} + ldr r2, _080D2AE8 + ldr r1, [r2] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _080D2AE2 + movs r4, 0 + ldrb r1, [r1, 0x4] + cmp r4, r1 + bcs _080D2ADA + adds r5, r2, 0 +_080D2ABA: + ldr r0, [r5] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + ldr r0, [r0] + adds r0, r1 + ldr r1, [r0, 0x10] + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + cmp r4, r0 + bcc _080D2ABA +_080D2ADA: + ldr r0, _080D2AE8 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x4] +_080D2AE2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D2AE8: .4byte 0x02039d8c + thumb_func_end sub_80D2AA4 + + thumb_func_start sub_80D2AEC +sub_80D2AEC: @ 80D2AEC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + mov r10, r3 + ldr r0, [sp, 0x24] + ldr r3, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, _080D2B6C + ldr r2, [r0] + ldrb r0, [r2, 0x4] + adds r1, r0, 0 + ldrb r7, [r2, 0x5] + cmp r1, r7 + bcs _080D2B74 + adds r0, 0x1 + strb r0, [r2, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r1, r0 + lsls r0, r4, 1 + strh r0, [r1, 0x8] + ldr r2, [sp] + lsls r0, r2, 5 + add r0, r12 + lsls r0, 1 + add r0, r9 + str r0, [r1, 0x4] + adds r0, r3, 0 + muls r0, r6 + add r0, r8 + lsls r0, 1 + add r0, r10 + str r0, [r1] + strh r5, [r1, 0xC] + strh r6, [r1, 0xA] + ldr r0, _080D2B70 + str r0, [r1, 0x10] + movs r0, 0x1 + b _080D2B76 + .align 2, 0 +_080D2B6C: .4byte 0x02039d8c +_080D2B70: .4byte sub_80D2B88 + 1 +_080D2B74: + movs r0, 0 +_080D2B76: + 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_80D2AEC + + thumb_func_start sub_80D2B88 +sub_80D2B88: @ 80D2B88 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + b _080D2BB2 +_080D2B90: + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldrh r2, [r4, 0x8] + lsrs r2, 1 + bl CpuSet + ldr r0, [r4, 0x4] + adds r0, 0x40 + str r0, [r4, 0x4] + ldrh r1, [r4, 0xA] + lsls r1, 1 + ldr r0, [r4] + adds r0, r1 + str r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080D2BB2: + ldrh r0, [r4, 0xC] + cmp r5, r0 + bcc _080D2B90 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D2B88 + + thumb_func_start sub_80D2BC0 +sub_80D2BC0: @ 80D2BC0 + push {r4-r7,lr} + mov r12, r0 + ldr r0, [sp, 0x14] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _080D2C0C + ldr r2, [r0] + ldrb r0, [r2, 0x4] + adds r1, r0, 0 + ldrb r7, [r2, 0x5] + cmp r1, r7 + bcs _080D2C14 + adds r0, 0x1 + strb r0, [r2, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r1, r0 + lsls r0, r3, 1 + strh r0, [r1, 0x8] + lsls r0, r4, 5 + adds r0, r6 + lsls r0, 1 + add r0, r12 + str r0, [r1, 0x4] + strh r5, [r1, 0xC] + ldr r0, _080D2C10 + str r0, [r1, 0x10] + movs r0, 0x1 + b _080D2C16 + .align 2, 0 +_080D2C0C: .4byte 0x02039d8c +_080D2C10: .4byte sub_80D2C1C + 1 +_080D2C14: + movs r0, 0 +_080D2C16: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D2BC0 + + thumb_func_start sub_80D2C1C +sub_80D2C1C: @ 80D2C1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + movs r0, 0 + ldrh r1, [r6, 0xC] + cmp r0, r1 + bcs _080D2CAA + movs r7, 0x80 + lsls r7, 5 + mov r5, sp + ldr r2, _080D2C68 + mov r8, r2 + movs r1, 0x81 + lsls r1, 24 + mov r10, r1 +_080D2C42: + ldr r2, [r6, 0x4] + ldrh r3, [r6, 0x8] + mov r12, r2 + adds r0, 0x1 + mov r9, r0 + cmp r3, r7 + bhi _080D2C6C + movs r0, 0 + strh r0, [r5] + mov r2, sp + mov r0, r8 + str r2, [r0] + mov r1, r12 + str r1, [r0, 0x4] + lsrs r0, r3, 1 + mov r2, r10 + orrs r0, r2 + mov r1, r8 + b _080D2C94 + .align 2, 0 +_080D2C68: .4byte 0x040000d4 +_080D2C6C: + movs r4, 0 + strh r4, [r5] + ldr r1, _080D2CBC + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, _080D2CC0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r7 + subs r3, r7 + cmp r3, r7 + bhi _080D2C6C + strh r4, [r5] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r10 + orrs r0, r2 +_080D2C94: + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, r12 + adds r0, 0x40 + str r0, [r6, 0x4] + mov r1, r9 + lsls r0, r1, 16 + lsrs r0, 16 + ldrh r2, [r6, 0xC] + cmp r0, r2 + bcc _080D2C42 +_080D2CAA: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D2CBC: .4byte 0x040000d4 +_080D2CC0: .4byte 0x81000800 + thumb_func_end sub_80D2C1C + + thumb_func_start sub_80D2CC4 +sub_80D2CC4: @ 80D2CC4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r5, [sp, 0x54] + 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 + ldr r0, _080D2D60 + str r0, [sp, 0x18] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_80D2EDC + str r0, [sp, 0x1C] + ldr r0, _080D2D64 + str r0, [sp, 0x20] + ldr r0, _080D2D68 + str r0, [sp, 0x24] + str r6, [sp, 0x28] + ldr r0, _080D2D6C + adds r0, r4, r0 + ldr r1, _080D2D70 + adds r5, r1, 0 + ldrb r0, [r0] + adds r1, r5, r0 + add r0, sp, 0x2C + strh r1, [r0] + add r1, sp, 0x18 + mov r0, sp + movs r2, 0x18 + bl memcpy + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _080D2D2A + mov r0, sp + strh r5, [r0, 0x14] +_080D2D2A: + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, r7, 16 + asrs r2, 16 + mov r0, sp + mov r3, r9 + bl sub_80D31B4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _080D2D74 + adds r0, r1 + bl sub_80D30DC + adds r0, r4, 0 + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D2D60: .4byte 0x0857c570 +_080D2D64: .4byte 0x0857c5b4 +_080D2D68: .4byte 0x0857c5e8 +_080D2D6C: .4byte 0x0857c388 +_080D2D70: .4byte 0x0000dac0 +_080D2D74: .4byte 0x02020630 + thumb_func_end sub_80D2CC4 + + thumb_func_start sub_80D2D78 +sub_80D2D78: @ 80D2D78 + push {r4-r7,lr} + sub sp, 0x18 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x2C] + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + mov r3, sp + ldr r2, _080D2DF0 + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + ldr r2, _080D2DF4 + str r2, [sp, 0x8] + ldr r2, _080D2DF8 + str r2, [sp, 0xC] + str r1, [sp, 0x10] + ldr r2, _080D2DFC + adds r2, r0, r2 + ldr r7, _080D2E00 + adds r1, r7, 0 + ldrb r2, [r2] + adds r1, r2 + strh r1, [r3, 0x14] + ldr r1, [sp, 0x30] + bl sub_80D3020 + str r0, [sp, 0x4] + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80D31B4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _080D2E04 + adds r0, r1 + bl sub_80D30DC + adds r0, r4, 0 + add sp, 0x18 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D2DF0: .4byte 0x0857c570 +_080D2DF4: .4byte 0x0857c5b4 +_080D2DF8: .4byte 0x0857c5e8 +_080D2DFC: .4byte 0x0857c388 +_080D2E00: .4byte 0x0000dac0 +_080D2E04: .4byte 0x02020630 + thumb_func_end sub_80D2D78 + + thumb_func_start sub_80D2E08 +sub_80D2E08: @ 80D2E08 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xC9 + bne _080D2E32 + adds r0, r1, 0 + bl sub_80D2E48 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080D2E24 + movs r0, 0xC9 + b _080D2E2E +_080D2E24: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080D2E2E: + adds r1, r0, 0 + b _080D2E40 +_080D2E32: + movs r0, 0xCE + lsls r0, 1 + adds r1, r2, 0 + cmp r1, r0 + bls _080D2E40 + movs r1, 0x82 + lsls r1, 1 +_080D2E40: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80D2E08 + + thumb_func_start sub_80D2E48 +sub_80D2E48: @ 80D2E48 + push {lr} + adds r2, r0, 0 + cmp r2, 0 + beq _080D2E7E + 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 + b _080D2E80 +_080D2E7E: + movs r0, 0 +_080D2E80: + pop {r1} + bx r1 + thumb_func_end sub_80D2E48 + + thumb_func_start sub_80D2E84 +sub_80D2E84: @ 80D2E84 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + mov r1, sp + bl sub_80D45E8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _080D2EBA + mov r0, sp + ldrh r0, [r0] + cmp r0, 0 + bne _080D2EAA + mov r1, sp + adds r0, 0xC9 + b _080D2EB2 +_080D2EAA: + mov r1, sp + movs r2, 0xCE + lsls r2, 1 + adds r0, r2 +_080D2EB2: + strh r0, [r1] + mov r0, sp + ldrh r0, [r0] + b _080D2ED2 +_080D2EBA: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _080D2EC6 + movs r4, 0x82 + lsls r4, 1 +_080D2EC6: + adds r0, r4, 0 + movs r1, 0 + bl sub_80D2E08 + lsls r0, 16 + lsrs r0, 16 +_080D2ED2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D2E84 + + thumb_func_start sub_80D2EDC +sub_80D2EDC: @ 80D2EDC + push {r4,lr} + adds r4, r2, 0 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D2E08 + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_80D3020 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D2EDC + + thumb_func_start sub_80D2EF8 +sub_80D2EF8: @ 80D2EF8 + push {lr} + bl sub_80D328C + pop {r0} + bx r0 + thumb_func_end sub_80D2EF8 + + thumb_func_start sub_80D2F04 +sub_80D2F04: @ 80D2F04 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080D2F24 +_080D2F0A: + lsls r0, r4, 3 + adds r0, r5 + bl gpu_pal_obj_alloc_tag_and_apply + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080D2F0A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D2F24: .4byte 0x0857c540 + thumb_func_end sub_80D2F04 + + thumb_func_start sub_80D2F28 +sub_80D2F28: @ 80D2F28 + push {r4,lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bls _080D2F3A + movs r1, 0x82 + lsls r1, 1 +_080D2F3A: + ldr r0, _080D2F60 + adds r0, r1, r0 + ldrb r0, [r0] + ldr r1, _080D2F64 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080D2F5A + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply +_080D2F5A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D2F60: .4byte 0x0857c388 +_080D2F64: .4byte 0x0857c540 + thumb_func_end sub_80D2F28 + + thumb_func_start sub_80D2F68 +sub_80D2F68: @ 80D2F68 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080D2F94 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _080D2F98 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080D2F8E + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply +_080D2F8E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D2F94: .4byte 0x0857c388 +_080D2F98: .4byte 0x0857c540 + thumb_func_end sub_80D2F68 + + thumb_func_start sub_80D2F9C +sub_80D2F9C: @ 80D2F9C + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080D2FBC +_080D2FA2: + lsls r0, r4, 3 + adds r0, r5 + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080D2FA2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D2FBC: .4byte 0x0857c540 + thumb_func_end sub_80D2F9C + + thumb_func_start sub_80D2FC0 +sub_80D2FC0: @ 80D2FC0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bls _080D2FD2 + movs r1, 0x82 + lsls r1, 1 +_080D2FD2: + ldr r0, _080D2FE8 + adds r0, r1, r0 + ldrb r0, [r0] + ldr r1, _080D2FEC + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + pop {r0} + bx r0 + .align 2, 0 +_080D2FE8: .4byte 0x0857c388 +_080D2FEC: .4byte 0x0857c540 + thumb_func_end sub_80D2FC0 + + thumb_func_start sub_80D2FF0 +sub_80D2FF0: @ 80D2FF0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080D300C + adds r0, r1 + ldrb r0, [r0] + ldr r1, _080D3010 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_free_tag + pop {r0} + bx r0 + .align 2, 0 +_080D300C: .4byte 0x0857c388 +_080D3010: .4byte 0x0857c540 + thumb_func_end sub_80D2FF0 + + thumb_func_start sub_80D3014 +sub_80D3014: @ 80D3014 + push {lr} + bl sub_80D30DC + pop {r0} + bx r0 + thumb_func_end sub_80D3014 + + thumb_func_start sub_80D3020 +sub_80D3020: @ 80D3020 + push {lr} + adds r3, r1, 0 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _080D3048 + lsls r1, r0, 2 + adds r1, r2 + ldr r2, [r1] + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + bne _080D3042 + cmp r3, 0x1 + bne _080D3042 + movs r0, 0x80 + lsls r0, 3 + adds r2, r0 +_080D3042: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_080D3048: .4byte 0x0857bca8 + thumb_func_end sub_80D3020 + + thumb_func_start sub_80D304C +sub_80D304C: @ 80D304C + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xA0 + bhi _080D3074 + ldr r6, _080D307C + movs r5, 0x5 +_080D305A: + ldr r0, [r6] + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _080D305A +_080D3074: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D307C: .4byte 0x0857c540 + thumb_func_end sub_80D304C + + thumb_func_start sub_80D3080 +sub_80D3080: @ 80D3080 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bls _080D3092 + movs r1, 0x82 + lsls r1, 1 +_080D3092: + ldr r0, _080D309C + adds r0, r1, r0 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_080D309C: .4byte 0x0857c388 + thumb_func_end sub_80D3080 + + thumb_func_start sub_80D30A0 +sub_80D30A0: @ 80D30A0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080D30AC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080D30AC: .4byte 0x0857c388 + thumb_func_end sub_80D30A0 + + thumb_func_start sub_80D30B0 +sub_80D30B0: @ 80D30B0 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r2, r0 + bls _080D30C2 + movs r2, 0x82 + lsls r2, 1 +_080D30C2: + ldr r1, _080D30D4 + ldr r0, _080D30D8 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_080D30D4: .4byte 0x0857c540 +_080D30D8: .4byte 0x0857c388 + thumb_func_end sub_80D30B0 + + thumb_func_start sub_80D30DC +sub_80D30DC: @ 80D30DC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r7, 0 + adds r6, r4, 0 + adds r6, 0x2C + ldrb r2, [r6] + movs r0, 0x3F + mov r9, r0 + ands r0, r2 + cmp r0, 0 + bne _080D3190 + movs r1, 0x2A + adds r1, r4 + mov r8, r1 + ldrb r1, [r1] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + adds r5, r4, 0 + adds r5, 0x2B + ldrb r0, [r5] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + movs r1, 0 + ldrsh r3, [r0, r1] + movs r0, 0x2 + negs r0, r0 + cmp r3, r0 + beq _080D3126 + adds r0, 0x1 + cmp r3, r0 + bne _080D312A + b _080D31A4 +_080D3126: + strb r7, [r5] + b _080D31A4 +_080D312A: + ldr r2, _080D3188 + ldrb r1, [r4, 0x3] + lsrs r1, 6 + lsls r1, 1 + ldrb r0, [r4, 0x1] + lsrs r0, 6 + lsls r0, 3 + adds r1, r0 + adds r1, r2 + ldrh r2, [r1] + adds r1, r2, 0 + muls r1, r3 + ldr r0, [r4, 0xC] + adds r0, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r3, _080D318C + adds r1, r3 + bl copy_queue_add + mov r0, r8 + ldrb r1, [r0] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r5] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 10 + lsrs r0, 26 + mov r1, r9 + ands r1, r0 + ldrb r2, [r6] + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldrb r7, [r5] + b _080D31A4 + .align 2, 0 +_080D3188: .4byte 0x0857c5f0 +_080D318C: .4byte 0x06010000 +_080D3190: + lsls r0, r2, 26 + lsrs r0, 26 + subs r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6] +_080D31A4: + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D30DC + + thumb_func_start sub_80D31B4 +sub_80D31B4: @ 80D31B4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x38 + mov r9, r0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0 + str r0, [sp, 0x30] + ldr r2, _080D327C + mov r0, r9 + ldr r6, [r0] + ldrb r1, [r6, 0x3] + lsrs r1, 6 + lsls r1, 1 + ldrb r0, [r6, 0x1] + lsrs r0, 6 + lsls r0, 3 + adds r1, r0 + adds r1, r2 + ldrh r2, [r1] + ldr r1, _080D3280 + add r3, sp, 0x30 + ldr r0, [r3, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [r3, 0x4] + add r1, sp, 0x18 + ldr r0, _080D3284 + strh r0, [r1] + mov r0, r9 + ldrh r2, [r0, 0x14] + mov r0, sp + adds r0, 0x1A + strh r2, [r0] + str r6, [sp, 0x1C] + mov r2, r9 + ldr r0, [r2, 0x8] + str r0, [sp, 0x20] + str r3, [sp, 0x24] + ldr r0, [r2, 0xC] + str r0, [sp, 0x28] + ldr r0, [r2, 0x10] + str r0, [sp, 0x2C] + mov r0, sp + movs r2, 0x18 + bl memcpy + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080D3288 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r4, r3, r6 + adds r5, r4, 0 + adds r5, 0x2C + ldrb r1, [r5] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r5] + adds r4, 0x3F + ldrb r2, [r4] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r4] + adds r6, 0xC + adds r3, r6 + mov r2, r9 + ldr r1, [r2, 0x4] + str r1, [r3] + add sp, 0x38 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080D327C: .4byte 0x0857c5f0 +_080D3280: .4byte 0xffff0000 +_080D3284: .4byte 0x0000ffff +_080D3288: .4byte 0x02020630 + thumb_func_end sub_80D31B4 + + thumb_func_start sub_80D328C +sub_80D328C: @ 80D328C + push {lr} + sub sp, 0x8 + movs r1, 0 + str r1, [sp] + ldr r3, _080D32C0 + ldrb r2, [r0, 0x3] + lsrs r2, 6 + lsls r2, 1 + ldrb r1, [r0, 0x1] + lsrs r1, 6 + lsls r1, 3 + adds r2, r1 + adds r2, r3 + ldrh r3, [r2] + ldr r2, _080D32C4 + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r3 + str r1, [sp, 0x4] + mov r1, sp + str r1, [r0, 0xC] + bl obj_delete_and_free_tiles + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080D32C0: .4byte 0x0857c5f0 +_080D32C4: .4byte 0xffff0000 + thumb_func_end sub_80D328C + + thumb_func_start sub_80D32C8 +sub_80D32C8: @ 80D32C8 + mov r12, r0 + adds r0, 0x2A + movs r3, 0 + strb r1, [r0] + mov r2, r12 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x40 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, r12 + adds r0, 0x2B + strb r3, [r0] + bx lr + thumb_func_end sub_80D32C8 + + thumb_func_start exec_movement +exec_movement: @ 80D32E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + beq _080D330A + movs r0, 0x1 + b _080D3332 +_080D330A: + ldr r0, _080D333C + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080D331C + movs r0, 0x32 + bl sub_80D33AC +_080D331C: + bl sub_80D33F4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + ldrb r1, [r1] + adds r2, r4, 0 + bl sub_80D3408 + lsls r0, 24 + lsrs r0, 24 +_080D3332: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D333C: .4byte sub_80D3660 + 1 + thumb_func_end exec_movement + + thumb_func_start sub_80D3340 +sub_80D3340: @ 80D3340 + push {r4,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 npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _080D3382 + bl sub_80D33F4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_80D3474 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _080D3382 + adds r0, r4, 0 + bl sub_80D3584 + lsls r0, 24 + lsrs r0, 24 + b _080D3384 +_080D3382: + movs r0, 0x1 +_080D3384: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D3340 + + thumb_func_start sub_80D338C +sub_80D338C: @ 80D338C + push {r4,lr} + bl sub_80D33F4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _080D33A6 + adds r0, r4, 0 + bl sub_80D361C + adds r0, r4, 0 + bl remove_task +_080D33A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D338C + + thumb_func_start sub_80D33AC +sub_80D33AC: @ 80D33AC + push {r4,r5,lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080D33E8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1 + lsls r1, r0, 2 + adds r1, r0 + lsls r3, r1, 3 + ldr r5, _080D33EC + ldr r0, _080D33F0 + adds r4, r0, 0 +_080D33CC: + lsls r0, r2, 1 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + orrs r1, r4 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080D33CC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D33E8: .4byte sub_80D3660 + 1 +_080D33EC: .4byte 0x03005e08 +_080D33F0: .4byte 0x0000ffff + thumb_func_end sub_80D33AC + + thumb_func_start sub_80D33F4 +sub_80D33F4: @ 80D33F4 + push {lr} + ldr r0, _080D3404 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080D3404: .4byte sub_80D3660 + 1 + thumb_func_end sub_80D33F4 + + thumb_func_start sub_80D3408 +sub_80D3408: @ 80D3408 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r1, 24 + lsrs r6, r1, 24 + mov r8, r6 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80D3474 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _080D3444 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D3584 + lsls r0, 24 + cmp r0, 0 + beq _080D3464 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + b _080D345A +_080D3444: + adds r0, r7, 0 + movs r1, 0xFF + bl sub_80D3474 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _080D3464 + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r8 +_080D345A: + mov r3, r9 + bl sub_80D35DC + movs r0, 0 + b _080D3466 +_080D3464: + movs r0, 0x1 +_080D3466: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D3408 + + thumb_func_start sub_80D3474 +sub_80D3474: @ 80D3474 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080D3498 + adds r1, r0 + adds r1, 0x2 + movs r2, 0 +_080D348C: + ldrb r0, [r1] + cmp r0, r3 + bne _080D349C + adds r0, r2, 0 + b _080D34AA + .align 2, 0 +_080D3498: .4byte 0x03005e08 +_080D349C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 + cmp r2, 0xF + bls _080D348C + movs r0, 0x10 +_080D34AA: + pop {r1} + bx r1 + thumb_func_end sub_80D3474 + + thumb_func_start sub_80D34B0 +sub_80D34B0: @ 80D34B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080D34E0 + adds r1, r0 + adds r1, 0x2 + str r1, [r2] + movs r0, 0 + cmp r0, r3 + bcs _080D34DC +_080D34CE: + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, 0x1 + cmp r0, r3 + bcc _080D34CE + str r1, [r2] +_080D34DC: + pop {r0} + bx r0 + .align 2, 0 +_080D34E0: .4byte 0x03005e08 + thumb_func_end sub_80D34B0 + + thumb_func_start sub_80D34E4 +sub_80D34E4: @ 80D34E4 + push {r4,lr} + sub sp, 0x4 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + mov r2, sp + bl sub_80D34B0 + ldr r0, [sp] + strb r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D34E4 + + thumb_func_start sub_80D3508 +sub_80D3508: @ 80D3508 + push {r4,lr} + sub sp, 0x4 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r2, sp + bl sub_80D34B0 + ldr r0, [sp] + ldrb r0, [r0] + strb r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D3508 + + thumb_func_start sub_80D352C +sub_80D352C: @ 80D352C + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r2, _080D3554 + lsrs r1, 22 + adds r1, r2 + ldr r2, [r1] + mvns r2, r2 + lsls r2, 16 + lsrs r2, 16 + ldr r3, _080D3558 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0x8] + ands r2, r0 + strh r2, [r1, 0x8] + bx lr + .align 2, 0 +_080D3554: .4byte 0x0832a328 +_080D3558: .4byte 0x03005e00 + thumb_func_end sub_80D352C + + thumb_func_start sub_80D355C +sub_80D355C: @ 80D355C + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, _080D357C + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldr r0, _080D3580 + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldrh r1, [r2, 0x8] + orrs r0, r1 + strh r0, [r2, 0x8] + bx lr + .align 2, 0 +_080D357C: .4byte 0x03005e00 +_080D3580: .4byte 0x0832a328 + thumb_func_end sub_80D355C + + thumb_func_start sub_80D3584 +sub_80D3584: @ 80D3584 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, _080D35AC + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldr r0, _080D35B0 + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldrh r1, [r2, 0x8] + ands r0, r1 + cmp r0, 0 + bne _080D35B4 + movs r0, 0 + b _080D35B6 + .align 2, 0 +_080D35AC: .4byte 0x03005e00 +_080D35B0: .4byte 0x0832a328 +_080D35B4: + movs r0, 0x1 +_080D35B6: + pop {r1} + bx r1 + thumb_func_end sub_80D3584 + + thumb_func_start npc_obj_offscreen_culling_and_flag_update +npc_obj_offscreen_culling_and_flag_update: @ 80D35BC + lsls r0, 24 + ldr r2, _080D35C8 + lsrs r0, 22 + adds r0, r2 + str r1, [r0] + bx lr + .align 2, 0 +_080D35C8: .4byte 0x02039d90 + thumb_func_end npc_obj_offscreen_culling_and_flag_update + + thumb_func_start sub_80D35CC +sub_80D35CC: @ 80D35CC + lsls r0, 24 + ldr r1, _080D35D8 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080D35D8: .4byte 0x02039d90 + thumb_func_end sub_80D35CC + + thumb_func_start sub_80D35DC +sub_80D35DC: @ 80D35DC + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D352C + adds r0, r4, 0 + mov r1, r8 + bl npc_obj_offscreen_culling_and_flag_update + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_80D34E4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D35DC + + thumb_func_start sub_80D361C +sub_80D361C: @ 80D361C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080D3658 + adds r1, r0 + adds r4, r1, 0x2 + movs r5, 0 +_080D3630: + ldrb r0, [r4] + cmp r0, 0xFF + beq _080D3646 + adds r1, r0, 0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080D365C + adds r0, r1 + bl npc_sync_anim_pause_bits +_080D3646: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x1 + cmp r5, 0xF + bls _080D3630 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D3658: .4byte 0x03005e08 +_080D365C: .4byte 0x02037350 + thumb_func_end sub_80D361C + + thumb_func_start sub_80D3660 +sub_80D3660: @ 80D3660 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 + mov r6, sp +_080D366C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, sp + bl sub_80D3508 + ldrb r0, [r6] + cmp r0, 0xFF + beq _080D3690 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80D35CC + adds r3, r0, 0 + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D36A4 +_080D3690: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _080D366C + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D3660 + + thumb_func_start sub_80D36A4 +sub_80D36A4: @ 80D36A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r3, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + mov r8, r6 + lsls r2, 24 + lsrs r2, 24 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r1, _080D36F4 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_state_set_and_valid + lsls r0, 24 + cmp r0, 0 + beq _080D36DC + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080D370E +_080D36DC: + ldrb r1, [r5] + cmp r1, 0xFE + bne _080D36F8 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80D355C + adds r0, r4, 0 + bl sub_8097404 + b _080D370E + .align 2, 0 +_080D36F4: .4byte 0x02037350 +_080D36F8: + adds r0, r4, 0 + bl npc_set_state_2 + lsls r0, 24 + cmp r0, 0 + bne _080D370E + adds r5, 0x1 + mov r0, r8 + adds r1, r5, 0 + bl npc_obj_offscreen_culling_and_flag_update +_080D370E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D36A4 + + thumb_func_start sub_80D3718 +sub_80D3718: @ 80D3718 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0x52 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3754 + ldr r1, _080D3744 + ldr r0, _080D3748 + str r0, [r1] + ldr r1, _080D374C + ldr r0, _080D3750 + str r0, [r1] + movs r0, 0x1 + b _080D3A2C + .align 2, 0 +_080D3744: .4byte 0x03005db0 +_080D3748: .4byte hm_add_c3_launch_phase_2 + 1 +_080D374C: .4byte 0x0203ceec +_080D3750: .4byte sub_80D3A9C + 1 +_080D3754: + ldr r0, _080D3788 + adds r1, r0, 0x2 + bl player_get_pos_to + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _080D378C + adds r0, r1 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + cmp r0, 0x34 + bne _080D3798 + ldr r1, _080D3790 + movs r0, 0x5 + strb r0, [r1] + ldr r0, _080D3794 + movs r1, 0x2 + b _080D37A2 + .align 2, 0 +_080D3788: .4byte 0x0203ab40 +_080D378C: .4byte 0x020244ec +_080D3790: .4byte 0x03001100 +_080D3794: .4byte 0x03001101 +_080D3798: + ldr r1, _080D3878 + movs r0, 0x3 + strb r0, [r1] + ldr r0, _080D387C + movs r1, 0x1 +_080D37A2: + strb r1, [r0] + ldr r0, _080D3880 + strb r1, [r0] + movs r6, 0 + movs r1, 0 +_080D37AC: + mov r2, sp + adds r0, r2, r6 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bls _080D37AC + movs r6, 0 + ldr r2, _080D3884 + movs r1, 0 +_080D37C2: + adds r0, r6, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x18 + bls _080D37C2 + movs r3, 0 + str r3, [sp, 0x10] + movs r6, 0 +_080D37D6: + ldr r4, _080D3888 + adds r0, r6, r4 + ldr r1, _080D388C + ldrh r1, [r1, 0x2] + adds r0, r1 + movs r5, 0 + adds r2, r6, 0x1 + str r2, [sp, 0x18] + lsls r7, r6, 1 + lsls r0, 16 + str r0, [sp, 0x14] + asrs r0, 16 + mov r10, r0 + lsls r0, r6, 2 + adds r0, r6 + mov r9, r0 +_080D37F6: + ldr r3, _080D3888 + adds r0, r5, r3 + ldr r4, _080D388C + ldrh r4, [r4] + adds r0, r4 + lsls r0, 16 + lsrs r1, r0, 16 + mov r8, r1 + asrs r4, r0, 16 + adds r0, r4, 0 + mov r1, r10 + bl cur_mapdata_get_upper4bit_at + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D388C + movs r1, 0x4 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _080D38BC + adds r0, r4, 0 + mov r1, r10 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D3846 + adds r0, r4, 0 + bl sub_8089484 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3856 +_080D3846: + adds r0, r5, 0x6 + add r0, r9 + ldr r3, _080D3884 + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + str r0, [sp, 0x10] +_080D3856: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + ldr r2, [sp, 0x14] + asrs r1, r2, 16 + bl cur_mapdata_get_middle2bit_at + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3890 + adds r0, r7, r6 + adds r0, r5 + mov r3, sp + adds r1, r3, r0 + b _080D38C4 + .align 2, 0 +_080D3878: .4byte 0x03001100 +_080D387C: .4byte 0x03001101 +_080D3880: .4byte 0x03001102 +_080D3884: .4byte 0x03001108 +_080D3888: .4byte 0x0000ffff +_080D388C: .4byte 0x0203ab40 +_080D3890: + adds r0, r7, r6 + adds r0, r5 + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80899F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D38C8 + adds r0, r5, 0x6 + add r0, r9 + ldr r3, _080D38B8 + adds r0, r3 + strb r1, [r0] + b _080D38C8 + .align 2, 0 +_080D38B8: .4byte 0x03001108 +_080D38BC: + adds r0, r7, r6 + adds r0, r5 + mov r4, sp + adds r1, r4, r0 +_080D38C4: + movs r0, 0 + strb r0, [r1] +_080D38C8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080D37F6 + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _080D38DE + b _080D37D6 +_080D38DE: + ldr r2, [sp, 0xC] + cmp r2, 0x34 + beq _080D38EE + ldr r3, [sp, 0x10] + cmp r3, 0x1 + beq _080D38EC + b _080D3A2A +_080D38EC: + b _080D3A1E +_080D38EE: + movs r6, 0 + ldr r4, _080D39D4 + mov r9, r4 + ldr r0, _080D39D8 + mov r10, r0 +_080D38F8: + lsls r2, r6, 2 + mov r3, r10 + adds r1, r2, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + mov r4, r9 + ldrh r4, [r4] + adds r0, r4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r0, 0x1 + ldrsb r0, [r1, r0] + mov r1, r9 + ldrh r1, [r1, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r7, 0x1 + movs r5, 0 + ldr r3, _080D39DC + adds r0, r2, r3 + ldrb r0, [r0] + adds r6, 0x1 + str r6, [sp, 0x18] + adds r6, r2, 0 + cmp r0, 0 + beq _080D395A +_080D3930: + adds r1, r2, 0 + adds r0, r5, r2 + adds r0, r3 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _080D39F4 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bhi _080D395A + adds r0, r5, r1 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080D3930 +_080D395A: + cmp r7, 0x1 + bne _080D3A0C + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_upper4bit_at + lsls r0, 24 + lsrs r0, 24 + mov r2, r9 + movs r1, 0x4 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _080D3A0C + mov r3, r10 + adds r2, r6, r3 + movs r1, 0x1 + ldrsb r1, [r2, r1] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0xC + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D39BC + adds r0, r4, 0 + bl sub_8089484 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D39F8 +_080D39BC: + ldr r1, _080D39E0 + ldr r0, _080D39E4 + str r0, [r1] + ldr r1, _080D39E8 + ldr r0, _080D39EC + str r0, [r1] + ldr r0, _080D39F0 + adds r0, r6, r0 + strb r7, [r0] + movs r4, 0x1 + str r4, [sp, 0x10] + b _080D3A0C + .align 2, 0 +_080D39D4: .4byte 0x0203ab40 +_080D39D8: .4byte 0x0857c608 +_080D39DC: .4byte 0x0857c60a +_080D39E0: .4byte 0x03005db0 +_080D39E4: .4byte hm_add_c3_launch_phase_2 + 1 +_080D39E8: .4byte 0x0203ceec +_080D39EC: .4byte hm2_ruin_valley + 1 +_080D39F0: .4byte 0x03001108 +_080D39F4: + movs r7, 0 + b _080D395A +_080D39F8: + adds r0, r4, 0 + bl sub_80899F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D3A0C + ldr r0, _080D3A3C + adds r0, r6, r0 + strb r1, [r0] +_080D3A0C: + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bhi _080D3A18 + b _080D38F8 +_080D3A18: + ldr r2, [sp, 0x10] + cmp r2, 0x1 + bne _080D3A2A +_080D3A1E: + ldr r1, _080D3A40 + ldr r0, _080D3A44 + str r0, [r1] + ldr r1, _080D3A48 + ldr r0, _080D3A4C + str r0, [r1] +_080D3A2A: + ldr r0, [sp, 0x10] +_080D3A2C: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D3A3C: .4byte 0x03001108 +_080D3A40: .4byte 0x03005db0 +_080D3A44: .4byte hm_add_c3_launch_phase_2 + 1 +_080D3A48: .4byte 0x0203ceec +_080D3A4C: .4byte hm2_ruin_valley + 1 + thumb_func_end sub_80D3718 + + thumb_func_start hm2_ruin_valley +hm2_ruin_valley: @ 80D3A50 + push {lr} + movs r0, 0x1 + bl oe_exec + bl brm_get_pokemon_selection + ldr r1, _080D3A68 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080D3A68: .4byte 0x02038c08 + thumb_func_end hm2_ruin_valley + + thumb_func_start sub_80D3A6C +sub_80D3A6C: @ 80D3A6C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D3A94 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _080D3A98 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x12 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080D3A94: .4byte 0x03005e00 +_080D3A98: .4byte sub_80D3AEC + 1 + thumb_func_end sub_80D3A6C + + thumb_func_start sub_80D3A9C +sub_80D3A9C: @ 80D3A9C + push {lr} + bl brm_get_pokemon_selection + ldr r1, _080D3AB4 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, _080D3AB8 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080D3AB4: .4byte 0x02038c08 +_080D3AB8: .4byte 0x08290705 + thumb_func_end sub_80D3A9C + + thumb_func_start sub_80D3ABC +sub_80D3ABC: @ 80D3ABC + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D3AE4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _080D3AE8 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x12 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080D3AE4: .4byte 0x03005e00 +_080D3AE8: .4byte sub_80D4354 + 1 + thumb_func_end sub_80D3ABC + + thumb_func_start sub_80D3AEC +sub_80D3AEC: @ 80D3AEC + push {lr} + movs r0, 0x1 + bl oe_active_list_remove + movs r0, 0x3A + bl oe_exec + pop {r0} + bx r0 + thumb_func_end sub_80D3AEC + + thumb_func_start sub_80D3B00 +sub_80D3B00: @ 80D3B00 + push {r4-r7,lr} + movs r6, 0 + movs r0, 0x80 + bl audio_play + ldr r4, _080D3BF0 + adds r1, r4, 0x2 + adds r0, r4, 0 + bl player_get_pos_to + adds r7, r4, 0 +_080D3B16: + ldr r0, _080D3BF4 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D3B64 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + adds r4, r0, 0 + subs r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x5 + bl __udivsi3 + adds r5, r0, 0 + subs r5, 0x2 + lsls r4, 24 + asrs r4, 24 + ldrh r0, [r7] + adds r4, r0 + lsls r5, 24 + asrs r5, 24 + ldrh r2, [r7, 0x2] + adds r5, r2 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80D3C10 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808E75C +_080D3B64: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x18 + bls _080D3B16 + ldr r2, _080D3BF0 + ldr r0, _080D3BF8 + ldrb r1, [r0] + ldrh r0, [r2] + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldr r1, _080D3BFC + ldrb r1, [r1] + mvns r1, r1 + ldrh r2, [r2, 0x2] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80D3D5C + bl cur_mapdata_full_redraw + ldr r4, _080D3C00 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + movs r6, 0 + ldr r5, _080D3C04 +_080D3BA0: + ldr r0, _080D3C08 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r2, 0x80 + lsls r2, 12 + adds r1, r2 + asrs r1, 16 + ldrb r2, [r0] + adds r2, 0x14 + ldr r0, _080D3C0C + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + lsls r1, r6, 5 + strh r1, [r0, 0x32] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x7 + bls _080D3BA0 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D3BF0: .4byte 0x0203ab40 +_080D3BF4: .4byte 0x03001108 +_080D3BF8: .4byte 0x03001101 +_080D3BFC: .4byte 0x03001102 +_080D3C00: .4byte 0x02039dd0 +_080D3C04: .4byte 0x02020630 +_080D3C08: .4byte 0x02037590 +_080D3C0C: .4byte 0x0857c66c + thumb_func_end sub_80D3B00 + + thumb_func_start sub_80D3C10 +sub_80D3C10: @ 80D3C10 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r6, r0, 16 + asrs r4, r0, 16 + lsrs r7, r1, 16 + asrs r5, r1, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_get_blockid_at + adds r1, r0, 0 + ldr r0, _080D3C48 + cmp r1, r0 + bgt _080D3C5C + subs r0, 0x1 + cmp r1, r0 + bge _080D3CD4 + cmp r1, 0x25 + beq _080D3CF6 + cmp r1, 0x25 + bgt _080D3C4C + cmp r1, 0xD + beq _080D3C9C + cmp r1, 0x15 + beq _080D3C9C + b _080D3D00 + .align 2, 0 +_080D3C48: .4byte 0x00000207 +_080D3C4C: + movs r0, 0xE3 + lsls r0, 1 + cmp r1, r0 + beq _080D3CAC + adds r0, 0x1 + cmp r1, r0 + beq _080D3CB2 + b _080D3D00 +_080D3C5C: + ldr r0, _080D3C74 + cmp r1, r0 + beq _080D3CE4 + cmp r1, r0 + bgt _080D3C78 + subs r0, 0xA + cmp r1, r0 + beq _080D3C9C + adds r0, 0x2 + cmp r1, r0 + beq _080D3CE4 + b _080D3D00 + .align 2, 0 +_080D3C74: .4byte 0x00000212 +_080D3C78: + ldr r0, _080D3C8C + cmp r1, r0 + beq _080D3CC4 + cmp r1, r0 + bgt _080D3C90 + subs r0, 0x1 + cmp r1, r0 + beq _080D3CBC + b _080D3D00 + .align 2, 0 +_080D3C8C: .4byte 0x00000282 +_080D3C90: + ldr r0, _080D3C98 + cmp r1, r0 + beq _080D3CCC + b _080D3D00 + .align 2, 0 +_080D3C98: .4byte 0x00000283 +_080D3C9C: + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + movs r2, 0x1 + bl setmaptile_0 + b _080D3D00 +_080D3CAC: + movs r2, 0xE7 + lsls r2, 1 + b _080D3CD6 +_080D3CB2: + ldr r2, _080D3CB8 + b _080D3CD6 + .align 2, 0 +_080D3CB8: .4byte 0x000001cf +_080D3CBC: + ldr r2, _080D3CC0 + b _080D3CD6 + .align 2, 0 +_080D3CC0: .4byte 0x00000279 +_080D3CC4: + ldr r2, _080D3CC8 + b _080D3CD6 + .align 2, 0 +_080D3CC8: .4byte 0x0000027a +_080D3CCC: + ldr r2, _080D3CD0 + b _080D3CD6 + .align 2, 0 +_080D3CD0: .4byte 0x0000027b +_080D3CD4: + ldr r2, _080D3CE0 +_080D3CD6: + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 + b _080D3D00 + .align 2, 0 +_080D3CE0: .4byte 0x00000271 +_080D3CE4: + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + movs r2, 0x86 + lsls r2, 2 + bl setmaptile_0 + b _080D3D00 +_080D3CF6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xE + bl setmaptile_0 +_080D3D00: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D3C10 + + thumb_func_start sub_80D3D08 +sub_80D3D08: @ 80D3D08 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + cmp r1, 0x1 + bne _080D3D24 + movs r0, 0x1 + b _080D3D56 +_080D3D24: + ldr r0, _080D3D30 + cmp r1, r0 + bne _080D3D34 + movs r0, 0x2 + b _080D3D56 + .align 2, 0 +_080D3D30: .4byte 0x00000279 +_080D3D34: + ldr r0, _080D3D40 + cmp r1, r0 + bne _080D3D44 + movs r0, 0x3 + b _080D3D56 + .align 2, 0 +_080D3D40: .4byte 0x0000027a +_080D3D44: + ldr r0, _080D3D50 + cmp r2, r0 + beq _080D3D54 + movs r0, 0 + b _080D3D56 + .align 2, 0 +_080D3D50: .4byte 0x0000027b +_080D3D54: + movs r0, 0x4 +_080D3D56: + pop {r1} + bx r1 + thumb_func_end sub_80D3D08 + + thumb_func_start sub_80D3D5C +sub_80D3D5C: @ 80D3D5C + 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 r9, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + ldr r1, _080D3DCC + ldrb r2, [r1] + mov r3, r10 + adds r0, r2, r3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + movs r4, 0 + cmp r4, r2 + blt _080D3D8A + b _080D3EA0 +_080D3D8A: + lsls r0, r3, 16 + asrs r7, r0, 16 +_080D3D8E: + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + lsls r4, 16 + asrs r1, r4, 16 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + asrs r5, r0, 16 + adds r0, r5, 0 + adds r1, r7, 0 + bl cur_mapdata_get_blockid_at + mov r8, r4 + cmp r0, 0x15 + bne _080D3E12 + adds r4, r7, 0x1 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D3DE8 + cmp r0, 0x2 + bgt _080D3DD0 + cmp r0, 0x1 + beq _080D3DDA + b _080D3E12 + .align 2, 0 +_080D3DCC: .4byte 0x03001100 +_080D3DD0: + cmp r0, 0x3 + beq _080D3DF8 + cmp r0, 0x4 + beq _080D3E08 + b _080D3E12 +_080D3DDA: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x82 + lsls r2, 2 + bl setmaptile_0 + b _080D3E12 +_080D3DE8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080D3DF4 + bl setmaptile_0 + b _080D3E12 + .align 2, 0 +_080D3DF4: .4byte 0x00000281 +_080D3DF8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080D3E04 + bl setmaptile_0 + b _080D3E12 + .align 2, 0 +_080D3E04: .4byte 0x00000282 +_080D3E08: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080D3ED8 + bl setmaptile_0 +_080D3E12: + lsls r0, r6, 16 + asrs r5, r0, 16 + ldr r3, [sp] + lsls r0, r3, 16 + asrs r4, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + cmp r0, 0x1 + bne _080D3E8C + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D3E44 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl setmaptile_0 +_080D3E44: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D3EDC + cmp r0, r1 + bne _080D3E5C + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080D3EE0 + bl setmaptile_0 +_080D3E5C: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D3EE4 + cmp r0, r1 + bne _080D3E74 + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080D3EE8 + bl setmaptile_0 +_080D3E74: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D3ED8 + cmp r0, r1 + bne _080D3E8C + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080D3EEC + bl setmaptile_0 +_080D3E8C: + movs r1, 0x80 + lsls r1, 9 + add r1, r8 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r0, _080D3EF0 + ldrb r0, [r0] + cmp r1, r0 + bge _080D3EA0 + b _080D3D8E +_080D3EA0: + ldr r1, _080D3EF0 + ldrb r0, [r1] + cmp r0, 0x5 + bne _080D3EC8 + mov r3, r9 + lsls r5, r3, 16 + asrs r5, 16 + mov r0, r10 + lsls r4, r0, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D3EF4 + movs r0, 0x1 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D3EF4 +_080D3EC8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D3ED8: .4byte 0x00000283 +_080D3EDC: .4byte 0x00000281 +_080D3EE0: .4byte 0x00000279 +_080D3EE4: .4byte 0x00000282 +_080D3EE8: .4byte 0x0000027a +_080D3EEC: .4byte 0x0000027b +_080D3EF0: .4byte 0x03001100 + thumb_func_end sub_80D3D5C + + thumb_func_start sub_80D3EF4 +sub_80D3EF4: @ 80D3EF4 + 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 + lsls r1, 16 + lsrs r5, r1, 16 + adds r3, r5, 0 + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + cmp r0, 0 + bne _080D3F2C + mov r2, sp + ldr r1, _080D3F28 + ldrb r0, [r1, 0x5] + strb r0, [r2] + ldrb r0, [r1, 0xA] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0xF] + strb r0, [r2, 0x2] + mov r8, r5 + b _080D3F4E + .align 2, 0 +_080D3F28: .4byte 0x03001108 +_080D3F2C: + cmp r0, 0x1 + beq _080D3F32 + b _080D414A +_080D3F32: + mov r2, sp + ldr r1, _080D4008 + ldrb r0, [r1, 0x9] + strb r0, [r2] + ldrb r0, [r1, 0xE] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0x13] + strb r0, [r2, 0x2] + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 11 + adds r0, r1 + lsrs r0, 16 + mov r8, r0 +_080D3F4E: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D3FC6 + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + adds r4, r0, 0x3 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D3F7E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl setmaptile_0 +_080D3F7E: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D400C + cmp r0, r1 + bne _080D3F96 + ldr r2, _080D4010 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D3F96: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D4014 + cmp r0, r1 + bne _080D3FAE + ldr r2, _080D4018 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D3FAE: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D401C + cmp r0, r1 + bne _080D3FC6 + ldr r2, _080D4020 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D3FC6: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080D40C0 + mov r0, r8 + lsls r5, r0, 16 + asrs r6, r5, 16 + mov r1, r10 + lsls r4, r1, 16 + asrs r7, r4, 16 + adds r1, r7, 0x2 + adds r0, r6, 0 + bl cur_mapdata_get_blockid_at + mov r9, r4 + cmp r0, 0x15 + bne _080D4056 + adds r4, r7, 0x3 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r6, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D4034 + cmp r0, 0x2 + bgt _080D4024 + cmp r0, 0x1 + beq _080D402E + b _080D4056 + .align 2, 0 +_080D4008: .4byte 0x03001108 +_080D400C: .4byte 0x00000281 +_080D4010: .4byte 0x00000279 +_080D4014: .4byte 0x00000282 +_080D4018: .4byte 0x0000027a +_080D401C: .4byte 0x00000283 +_080D4020: .4byte 0x0000027b +_080D4024: + cmp r0, 0x3 + beq _080D403C + cmp r0, 0x4 + beq _080D404C + b _080D4056 +_080D402E: + movs r2, 0x82 + lsls r2, 2 + b _080D403E +_080D4034: + ldr r2, _080D4038 + b _080D403E + .align 2, 0 +_080D4038: .4byte 0x00000281 +_080D403C: + ldr r2, _080D4048 +_080D403E: + adds r0, r6, 0 + adds r1, r4, 0 + bl setmaptile_0 + b _080D4056 + .align 2, 0 +_080D4048: .4byte 0x00000282 +_080D404C: + ldr r2, _080D4100 + adds r0, r6, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D4056: + asrs r5, 16 + mov r1, r9 + asrs r0, r1, 16 + adds r4, r0, 0x4 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D4078 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl setmaptile_0 +_080D4078: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D4104 + cmp r0, r1 + bne _080D4090 + ldr r2, _080D4108 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D4090: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D410C + cmp r0, r1 + bne _080D40A8 + ldr r2, _080D4110 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D40A8: + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _080D4100 + cmp r0, r1 + bne _080D40C0 + ldr r2, _080D4114 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D40C0: + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + bne _080D414A + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r1, r10 + lsls r0, r1, 16 + asrs r4, r0, 16 + adds r1, r4, 0x3 + adds r0, r5, 0 + bl cur_mapdata_get_blockid_at + cmp r0, 0x15 + bne _080D414A + adds r4, 0x4 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D4128 + cmp r0, 0x2 + bgt _080D4118 + cmp r0, 0x1 + beq _080D4122 + b _080D414A + .align 2, 0 +_080D4100: .4byte 0x00000283 +_080D4104: .4byte 0x00000281 +_080D4108: .4byte 0x00000279 +_080D410C: .4byte 0x00000282 +_080D4110: .4byte 0x0000027a +_080D4114: .4byte 0x0000027b +_080D4118: + cmp r0, 0x3 + beq _080D4130 + cmp r0, 0x4 + beq _080D4140 + b _080D414A +_080D4122: + movs r2, 0x82 + lsls r2, 2 + b _080D4132 +_080D4128: + ldr r2, _080D412C + b _080D4132 + .align 2, 0 +_080D412C: .4byte 0x00000281 +_080D4130: + ldr r2, _080D413C +_080D4132: + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 + b _080D414A + .align 2, 0 +_080D413C: .4byte 0x00000282 +_080D4140: + ldr r2, _080D415C + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D414A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D415C: .4byte 0x00000283 + thumb_func_end sub_80D3EF4 + + thumb_func_start objc_8097BA8 +objc_8097BA8: @ 80D4160 + movs r2, 0 + movs r1, 0x8 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x34] + ldr r1, _080D4170 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_080D4170: .4byte objc_8097BBC + 1 + thumb_func_end objc_8097BA8 + + thumb_func_start objc_8097BBC +objc_8097BBC: @ 80D4174 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x2E] + adds r1, 0x1 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 18 + adds r1, r0 + strh r1, [r4, 0x2E] + adds r2, 0x1 + strh r2, [r4, 0x34] + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x1C + beq _080D41C0 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _080D41C4 +_080D41C0: + ldr r0, _080D41CC + str r0, [r4, 0x1C] +_080D41C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D41CC: .4byte sub_80D41D0 + 1 + thumb_func_end objc_8097BBC + + thumb_func_start sub_80D41D0 +sub_80D41D0: @ 80D41D0 + push {r4-r6,lr} + movs r4, 0x1 +_080D41D4: + ldr r6, _080D4230 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _080D4234 + adds r0, r5 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _080D41D4 + ldr r0, [r6] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x3A + bl oe_stop + ldr r0, [r6] + bl free + movs r0, 0 + str r0, [r6] + bl sub_80984F4 + bl script_env_2_disable + bl unown_chamber_related + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D422A + ldr r0, _080D4238 + bl script_env_1_execute_new_script +_080D422A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D4230: .4byte 0x02039dd0 +_080D4234: .4byte 0x02020630 +_080D4238: .4byte 0x08267edb + thumb_func_end sub_80D41D0 + + thumb_func_start sub_80D423C +sub_80D423C: @ 80D423C + 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 cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089B1C + lsls r0, 24 + cmp r0, 0 + beq _080D42AE + adds r4, 0x1 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D428A + cmp r0, 0x2 + bgt _080D427A + cmp r0, 0x1 + beq _080D4284 + b _080D42AE +_080D427A: + cmp r0, 0x3 + beq _080D4294 + cmp r0, 0x4 + beq _080D42A4 + b _080D42AE +_080D4284: + movs r2, 0x82 + lsls r2, 2 + b _080D4296 +_080D428A: + ldr r2, _080D4290 + b _080D4296 + .align 2, 0 +_080D4290: .4byte 0x00000281 +_080D4294: + ldr r2, _080D42A0 +_080D4296: + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 + b _080D42AE + .align 2, 0 +_080D42A0: .4byte 0x00000282 +_080D42A4: + ldr r2, _080D42B4 + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 +_080D42AE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D42B4: .4byte 0x00000283 + thumb_func_end sub_80D423C + + thumb_func_start task00_bag_acit_10 +task00_bag_acit_10: @ 80D42B8 + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_get_blockid_at + cmp r0, 0x1 + bne _080D434A + adds r5, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089B30 + lsls r0, 24 + cmp r0, 0 + beq _080D434A + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_get_blockid_at + adds r1, r0, 0 + ldr r0, _080D4304 + cmp r1, r0 + beq _080D4328 + cmp r1, r0 + bgt _080D4308 + subs r0, 0x79 + cmp r1, r0 + beq _080D431C + b _080D434A + .align 2, 0 +_080D4304: .4byte 0x00000281 +_080D4308: + ldr r0, _080D4318 + cmp r1, r0 + beq _080D4330 + adds r0, 0x1 + cmp r1, r0 + beq _080D4340 + b _080D434A + .align 2, 0 +_080D4318: .4byte 0x00000282 +_080D431C: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl setmaptile_0 + b _080D434A +_080D4328: + ldr r2, _080D432C + b _080D4332 + .align 2, 0 +_080D432C: .4byte 0x00000279 +_080D4330: + ldr r2, _080D433C +_080D4332: + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 + b _080D434A + .align 2, 0 +_080D433C: .4byte 0x0000027a +_080D4340: + ldr r2, _080D4350 + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 +_080D434A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4350: .4byte 0x0000027b + thumb_func_end task00_bag_acit_10 + + thumb_func_start sub_80D4354 +sub_80D4354: @ 80D4354 + push {lr} + movs r0, 0x80 + bl audio_play + movs r0, 0x2 + bl oe_active_list_remove + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80D4354 + + thumb_func_start sub_80D436C +sub_80D436C: @ 80D436C + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080D4394 +_080D4372: + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + ldr r0, _080D4398 + adds r1, r0 + ldr r0, [r5] + adds r0, r1 + bl sub_80D439C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080D4372 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4394: .4byte 0x03005d8c +_080D4398: .4byte 0x00002be0 + thumb_func_end sub_80D436C + + thumb_func_start sub_80D439C +sub_80D439C: @ 80D439C + push {r4-r6,lr} + adds r3, r0, 0 + ldr r0, _080D43EC + adds r4, r0, 0 + adds r1, r3, 0 + movs r2, 0x8 +_080D43A8: + ldrh r0, [r1] + orrs r0, r4 + strh r0, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080D43A8 + movs r2, 0 + adds r6, r3, 0 + adds r6, 0x1A + adds r4, r3, 0 + adds r4, 0x12 + movs r5, 0xFF +_080D43C2: + adds r1, r4, r2 + ldrb r0, [r1] + orrs r0, r5 + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x7 + ble _080D43C2 + adds r1, r6, 0 + movs r2, 0 + adds r0, r1, 0x3 +_080D43D6: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080D43D6 + movs r1, 0 + movs r0, 0x1 + strh r0, [r3, 0x1E] + strh r1, [r3, 0x20] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D43EC: .4byte 0x0000ffff + thumb_func_end sub_80D439C + + thumb_func_start sub_80D43F0 +sub_80D43F0: @ 80D43F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080D4418 + adds r0, r4, 0 + movs r1, 0x40 + bl pokemon_getattr + cmp r0, 0xFF + beq _080D4418 + movs r0, 0x1 + b _080D441A +_080D4418: + movs r0, 0 +_080D441A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D43F0 + + thumb_func_start sub_80D4420 +sub_80D4420: @ 80D4420 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + lsls r1, 16 + lsrs r0, r1, 16 + str r0, [sp, 0x8] + mov r0, sp + movs r2, 0 + ldrb r3, [r0, 0x8] + strb r3, [r0] + lsrs r1, 24 + strb r1, [r0, 0x1] + add r3, sp, 0x4 + strb r2, [r3] + ldr r4, _080D458C + mov r10, r4 + mov r9, r3 + adds r4, r3, 0 +_080D444C: + mov r1, r10 + ldr r0, [r1] + ldrb r2, [r4] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r0, r1 + movs r1, 0xB0 + lsls r1, 6 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080D4468 + b _080D45A8 +_080D4468: + movs r4, 0 + ldr r2, _080D4590 + mov r12, r2 + ldr r7, _080D458C + add r5, sp, 0x4 + ldr r3, _080D4594 + adds r6, r3, 0 +_080D4476: + ldr r2, [r7] + lsls r3, r4, 1 + ldrb r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, _080D4598 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + orrs r0, r6 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _080D4476 + movs r4, 0 + ldr r5, _080D458C + add r3, sp, 0x4 +_080D44A0: + ldr r2, [r5] + ldrb r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldr r1, _080D459C + adds r2, r1 + adds r2, r0 + mov r1, r12 + ldr r0, [r1] + adds r0, r4 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080D44A0 + mov r3, r10 + ldr r2, [r3] + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldr r1, _080D459C + adds r2, r1 + adds r2, r0 + movs r0, 0xFF + strb r0, [r2] + mov r2, r9 + ldrb r1, [r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r3] + adds r0, r1 + ldr r3, _080D459C + adds r0, r3 + movs r1, 0 + bl sub_81DB4DC + movs r4, 0 + ldr r6, _080D458C + add r3, sp, 0x4 + ldr r5, _080D4590 +_080D4500: + ldr r2, [r6] + ldrb r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldr r1, _080D45A0 + adds r2, r1 + adds r2, r0 + ldr r0, [r5] + adds r0, 0xA + adds r0, r4 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080D4500 + mov r0, r8 + movs r1, 0xB + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_80D45C8 + mov r2, r10 + ldr r3, [r2] + mov r4, r9 + ldrb r2, [r4] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r3, r1 + ldr r2, _080D45A4 + adds r1, r2 + strh r0, [r1] + ldrb r1, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r4, 0xB0 + lsls r4, 6 + adds r3, r4 + mov r0, sp + ldrh r0, [r0, 0x8] + strh r0, [r3] + mov r0, r8 + movs r1, 0x40 + mov r2, r9 + bl pokemon_setattr + mov r0, r8 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + mov r1, r9 + ldrb r0, [r1] + b _080D45B6 + .align 2, 0 +_080D458C: .4byte 0x03005d8c +_080D4590: .4byte 0x03005d90 +_080D4594: .4byte 0x0000ffff +_080D4598: .4byte 0x00002be0 +_080D459C: .4byte 0x00002bf2 +_080D45A0: .4byte 0x00002bfa +_080D45A4: .4byte 0x00002bfe +_080D45A8: + adds r0, r2, 0x1 + strb r0, [r3] + ldrb r0, [r4] + cmp r0, 0x5 + bhi _080D45B4 + b _080D444C +_080D45B4: + movs r0, 0xFF +_080D45B6: + 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_80D4420 + + thumb_func_start sub_80D45C8 +sub_80D45C8: @ 80D45C8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _080D45E0 + adds r0, r1, 0 + bl sub_80D2E48 + lsls r0, 16 + ldr r1, _080D45E4 + adds r0, r1 + lsrs r0, 16 +_080D45E0: + pop {r1} + bx r1 + .align 2, 0 +_080D45E4: .4byte 0x75300000 + thumb_func_end sub_80D45C8 + + thumb_func_start sub_80D45E8 +sub_80D45E8: @ 80D45E8 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _080D4600 + adds r2, r3, r0 + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x1B + bhi _080D4604 + movs r0, 0xC9 + strh r2, [r1] + b _080D4606 + .align 2, 0 +_080D4600: .4byte 0xffff8ad0 +_080D4604: + adds r0, r3, 0 +_080D4606: + pop {r1} + bx r1 + thumb_func_end sub_80D45E8 + + thumb_func_start sub_80D460C +sub_80D460C: @ 80D460C + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + ldrh r5, [r7, 0x20] + adds r1, r5, 0 + bl sub_80D4420 + add r4, sp, 0x4 + strb r0, [r4] + ldrb r2, [r4] + cmp r2, 0xFF + beq _080D4670 + ldr r0, _080D4668 + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + ldr r0, _080D466C + adds r1, r0 + adds r0, r7, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0 + movs r1, 0x40 + adds r2, r4, 0 + bl pokemon_setattr + mov r0, sp + strb r5, [r0] + mov r1, sp + lsrs r0, r5, 8 + strb r0, [r1, 0x1] + adds r0, r6, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + ldrb r0, [r4] + b _080D4672 + .align 2, 0 +_080D4668: .4byte 0x03005d8c +_080D466C: .4byte 0x00002be0 +_080D4670: + movs r0, 0xFF +_080D4672: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D460C + + thumb_func_start sub_80D467C +sub_80D467C: @ 80D467C + movs r0, 0 + bx lr + thumb_func_end sub_80D467C + + thumb_func_start sub_80D4680 +sub_80D4680: @ 80D4680 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_80D43F0 + lsls r0, 24 + cmp r0, 0 + beq _080D46D2 + adds r0, r4, 0 + movs r1, 0x40 + bl pokemon_getattr + add r2, sp, 0x4 + strb r0, [r2] + ldr r0, _080D46DC + ldr r3, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r0, 0xB0 + lsls r0, 6 + adds r3, r0 + movs r1, 0 + movs r0, 0 + strh r0, [r3] + movs r0, 0xFF + strb r0, [r2] + mov r0, sp + strb r1, [r0] + strb r1, [r0, 0x1] + adds r0, r4, 0 + movs r1, 0x40 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_080D46D2: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D46DC: .4byte 0x03005d8c + thumb_func_end sub_80D4680 + + thumb_func_start sub_80D46E0 +sub_80D46E0: @ 80D46E0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080D46FC + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + movs r0, 0xB0 + lsls r0, 6 + adds r2, r0 + movs r0, 0 + strh r0, [r2] + bx lr + .align 2, 0 +_080D46FC: .4byte 0x03005d8c + thumb_func_end sub_80D46E0 + + thumb_func_start sub_80D4700 +sub_80D4700: @ 80D4700 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + adds r5, r0, 0 + mov r0, sp + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + add r1, sp, 0x4 + movs r0, 0xFF + strb r0, [r1] + movs r7, 0x6 + mov r9, r1 + ldr r0, _080D4798 + mov r8, r0 + ldr r3, _080D479C +_080D4724: + mov r1, r8 + ldr r0, [r1] + lsls r1, r7, 3 + adds r1, r7 + lsls r1, 2 + adds r4, r0, r1 + movs r2, 0xB0 + lsls r2, 6 + adds r0, r4, r2 + ldrh r6, [r0] + cmp r6, 0 + bne _080D47A0 + adds r4, r3 + adds r0, r5, 0 + movs r1, 0x40 + str r3, [sp, 0x8] + bl pokemon_getattr + mov r1, r8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r3, [sp, 0x8] + adds r1, r3 + ldm r1!, {r0,r2,r3} + stm r4!, {r0,r2,r3} + ldm r1!, {r0,r2,r3} + stm r4!, {r0,r2,r3} + ldm r1!, {r0,r2,r3} + stm r4!, {r0,r2,r3} + adds r0, r5, 0 + movs r1, 0x40 + bl pokemon_getattr + mov r1, r8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + movs r3, 0xB0 + lsls r3, 6 + adds r2, r3 + strh r6, [r2] + adds r0, r5, 0 + movs r1, 0x40 + mov r2, r9 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r7, 0 + b _080D47AC + .align 2, 0 +_080D4798: .4byte 0x03005d8c +_080D479C: .4byte 0x00002be0 +_080D47A0: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _080D4724 + movs r0, 0xFF +_080D47AC: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D4700 + + thumb_func_start itemid_is_mail +itemid_is_mail: @ 80D47BC + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x84 + bgt _080D47CE + cmp r0, 0x79 + blt _080D47CE + movs r0, 0x1 + b _080D47D0 +_080D47CE: + movs r0, 0 +_080D47D0: + pop {r1} + bx r1 + thumb_func_end itemid_is_mail + + thumb_func_start sub_80D47D4 +sub_80D47D4: @ 80D47D4 + push {lr} + bl sub_80A0934 + bl sub_80D47E4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80D47D4 + + thumb_func_start sub_80D47E4 +sub_80D47E4: @ 80D47E4 + push {r4,lr} + movs r0, 0x80 + lsls r0, 7 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D486C + ldr r4, _080D4838 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080D4844 + adds r0, r4, 0 + movs r1, 0x5A + bl AddTask + ldr r4, _080D483C + strb r0, [r4] + movs r0, 0x12 + movs r1, 0x28 + bl lcd_io_set + ldr r2, _080D4840 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x8] + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x28 + strh r1, [r0, 0xC] + b _080D486C + .align 2, 0 +_080D4838: .4byte sub_80D487C + 1 +_080D483C: .4byte 0x02039dd4 +_080D4840: .4byte 0x03005e00 +_080D4844: + ldr r3, _080D4874 + ldr r2, _080D4878 + ldrb r0, [r2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + movs r4, 0x8 + ldrsh r0, [r1, r4] + cmp r0, 0x2 + beq _080D485E + movs r0, 0x2 + strh r0, [r1, 0x8] +_080D485E: + ldrb r0, [r2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + movs r0, 0x1 + strh r0, [r1, 0xE] +_080D486C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D4874: .4byte 0x03005e00 +_080D4878: .4byte 0x02039dd4 + thumb_func_end sub_80D47E4 + + thumb_func_start sub_80D487C +sub_80D487C: @ 80D487C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080D48A0 + adds r4, r1, r0 + movs r2, 0x8 + ldrsh r1, [r4, r2] + adds r3, r0, 0 + cmp r1, 0x6 + bhi _080D4966 + lsls r0, r1, 2 + ldr r1, _080D48A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D48A0: .4byte 0x03005e00 +_080D48A4: .4byte _080D48A8 + .align 2, 0 +_080D48A8: + .4byte _080D48DE + .4byte _080D4908 + .4byte _080D4920 + .4byte _080D4966 + .4byte _080D494C + .4byte _080D4960 + .4byte _080D48C4 +_080D48C4: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _080D4966 + strh r1, [r4, 0x8] + strh r1, [r4, 0x10] + bl sub_80D49B0 + b _080D4966 +_080D48DE: + ldrh r0, [r4, 0xC] + subs r0, 0x2 + movs r2, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080D4966 + strh r2, [r4, 0xC] + movs r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, _080D4904 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + strh r2, [r0, 0xA] + b _080D4966 + .align 2, 0 +_080D4904: .4byte 0x02039dd4 +_080D4908: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + ble _080D4966 + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080D4966 +_080D4920: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + movs r1, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _080D4966 + movs r0, 0x28 + strh r0, [r4, 0xC] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D4946 + movs r0, 0x6 + strh r0, [r4, 0x8] + strh r1, [r4, 0x10] + strh r1, [r4, 0xE] + b _080D4966 +_080D4946: + movs r0, 0x4 + strh r0, [r4, 0x8] + b _080D496E +_080D494C: + bl rboxid_upload_textbox_1_no_pal + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x5 + strh r0, [r4, 0x8] + b _080D4966 +_080D4960: + bl call_203AE8C + b _080D496E +_080D4966: + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl lcd_io_set +_080D496E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D487C + + thumb_func_start call_203AE8C +call_203AE8C: @ 80D4974 + push {lr} + ldr r0, _080D49A8 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _080D49A4 + bl rboxid_upload_textbox_1_no_pal + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl sub_8197A80 + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set_forced_blank + ldr r0, _080D49AC + ldrb r0, [r0] + bl remove_task +_080D49A4: + pop {r0} + bx r0 + .align 2, 0 +_080D49A8: .4byte sub_80D487C + 1 +_080D49AC: .4byte 0x02039dd4 + thumb_func_end call_203AE8C + + thumb_func_start sub_80D49B0 +sub_80D49B0: @ 80D49B0 + push {r4,r5,lr} + sub sp, 0x24 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _080D4A08 + ldr r0, _080D49D4 + ldrh r1, [r0, 0x12] + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + bne _080D49DC + mov r4, sp + adds r4, 0xF + ldr r0, _080D49D8 + ldr r1, [r0, 0x1C] + b _080D49F2 + .align 2, 0 +_080D49D4: .4byte 0x02037318 +_080D49D8: .4byte 0x0857f544 +_080D49DC: + mov r4, sp + adds r4, 0xF + ldr r1, _080D49FC + ldr r0, _080D4A00 + ldr r0, [r0] + ldr r2, _080D4A04 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] +_080D49F2: + adds r0, r4, 0 + bl gf_strcpy + b _080D4A18 + .align 2, 0 +_080D49FC: .4byte 0x0857f544 +_080D4A00: .4byte 0x03005d90 +_080D4A04: .4byte 0x00000cb2 +_080D4A08: + mov r4, sp + adds r4, 0xF + ldr r0, _080D4A74 + ldrb r1, [r0, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl GetMapName +_080D4A18: + bl sub_8197A40 + bl sub_80D4BE0 + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x50 + bl sub_81DB35C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + add r1, sp, 0xC + movs r5, 0 + movs r0, 0xFC + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + adds r0, r1, 0 + strb r5, [r0, 0x2] + bl rboxid_upload_textbox_1_no_pal + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x7 + add r2, sp, 0xC + adds r3, r4, 0 + bl Print + bl rboxid_upload_textbox_1_no_pal + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x24 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4A74: .4byte 0x02037318 + thumb_func_end sub_80D49B0 + + thumb_func_start sub_80D4A78 +sub_80D4A78: @ 80D4A78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r4, [sp, 0x3C] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x14] + movs r5, 0 + lsls r0, r1, 24 + asrs r1, r0, 24 + lsrs r3, r2, 24 + str r3, [sp, 0xC] + movs r6, 0xFF + lsls r6, 24 + adds r6, r2 + mov r8, r6 + str r0, [sp, 0x18] + subs r4, r1, 0x1 +_080D4AB4: + ldr r0, _080D4BC4 + adds r1, r5, r0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r4, 24 + lsrs r2, 24 + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + movs r6, 0xE + mov r9, r6 + str r6, [sp, 0x8] + adds r0, r7, 0 + mov r6, r8 + lsrs r3, r6, 24 + bl Bg_FillWramTileMapRectWithTileAndPalette + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0xB + ble _080D4AB4 + ldr r1, _080D4BC8 + movs r0, 0x1 + negs r0, r0 + add r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + ldr r3, [sp, 0xC] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _080D4BCC + ldr r6, [sp, 0x10] + add r6, r10 + lsls r6, 24 + lsrs r6, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r7, 0 + adds r2, r6, 0 + ldr r3, [sp, 0xC] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _080D4BD0 + ldr r4, [sp, 0xC] + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x8B + lsls r1, 2 + str r5, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r7, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _080D4BD4 + ldr r4, [sp, 0xC] + adds r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _080D4BD8 + str r5, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r5, 0 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + lsls r4, r0, 24 + movs r6, 0x1 +_080D4B8A: + ldr r3, _080D4BDC + adds r1, r5, r3 + lsls r1, 16 + lsrs r1, 16 + subs r0, r5, 0x1 + ldr r3, [sp, 0x18] + asrs r2, r3, 24 + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + adds r0, r7, 0 + lsrs r3, r4, 24 + bl Bg_FillWramTileMapRectWithTileAndPalette + adds r5, 0x1 + cmp r5, 0xB + ble _080D4B8A + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D4BC4: .4byte 0x0000021d +_080D4BC8: .4byte 0x00000229 +_080D4BCC: .4byte 0x0000022a +_080D4BD0: .4byte 0x0000022b +_080D4BD4: .4byte 0x0000022d +_080D4BD8: .4byte 0x0000022e +_080D4BDC: .4byte 0x0000022f + thumb_func_end sub_80D4A78 + + thumb_func_start sub_80D4BE0 +sub_80D4BE0: @ 80D4BE0 + push {r4,r5,lr} + sub sp, 0x8 + bl rboxid_upload_textbox_1_no_pal + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080D4C04 + ldrb r1, [r0, 0x14] + cmp r1, 0x57 + bls _080D4C0A + cmp r1, 0xC4 + bls _080D4C08 + adds r0, r1, 0 + subs r0, 0x6D + lsls r0, 16 + lsrs r1, r0, 16 + b _080D4C0A + .align 2, 0 +_080D4C04: .4byte 0x02037318 +_080D4C08: + movs r1, 0 +_080D4C0A: + ldr r0, _080D4C54 + adds r0, r1, r0 + ldrb r4, [r0] + adds r0, r5, 0 + movs r1, 0 + bl Window_GetField + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + subs r1, r4 + lsls r1, 6 + ldr r2, _080D4C58 + adds r1, r2 + movs r2, 0x80 + lsls r2, 3 + ldr r3, _080D4C5C + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _080D4C60 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + bl Window_WriteStandardTileMap + ldr r0, _080D4C64 + ldrb r0, [r0, 0x16] + cmp r0, 0xE + bne _080D4C6C + ldr r0, _080D4C68 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + b _080D4C7A + .align 2, 0 +_080D4C54: .4byte 0x0857f464 +_080D4C58: .4byte 0x0857dd04 +_080D4C5C: .4byte 0x0000021d +_080D4C60: .4byte sub_80D4A78 + 1 +_080D4C64: .4byte 0x02037318 +_080D4C68: .4byte 0x0857f444 +_080D4C6C: + lsls r0, r4, 5 + ldr r1, _080D4CA0 + adds r0, r1 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply +_080D4C7A: + lsls r1, r4, 4 + subs r1, r4 + lsls r1, 6 + ldr r0, _080D4CA4 + adds r1, r0 + movs r0, 0x50 + str r0, [sp] + movs r0, 0x18 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl Window_CopyWholePixelBlockToWindow + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4CA0: .4byte 0x0857f384 +_080D4CA4: .4byte 0x0857c684 + thumb_func_end sub_80D4BE0 + + thumb_func_start sub_80D4CA8 +sub_80D4CA8: @ 80D4CA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080D4CF4 + ldr r2, _080D4CF8 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _080D4CEE + adds r4, 0x64 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _080D4CFC + 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 obj_delete_and_free_tiles + movs r0, 0xFF + strb r0, [r5] +_080D4CEE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4CF4: .4byte 0x0203ce54 +_080D4CF8: .4byte 0x00000804 +_080D4CFC: .4byte 0x02020630 + thumb_func_end sub_80D4CA8 + + thumb_func_start sub_80D4D00 +sub_80D4D00: @ 80D4D00 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080D4D2C + ldr r4, [r0] + ldr r0, _080D4D30 + adds r4, r0 + ldr r0, _080D4D34 + movs r1, 0x44 + movs r2, 0x42 + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4] + adds r0, r5, 0 + movs r1, 0 + bl sub_80D4D38 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4D2C: .4byte 0x0203ce54 +_080D4D30: .4byte 0x00000804 +_080D4D34: .4byte 0x0857fb4c + thumb_func_end sub_80D4D00 + + thumb_func_start sub_80D4D38 +sub_80D4D38: @ 80D4D38 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + ldr r0, _080D4D70 + ldr r0, [r0] + ldr r2, _080D4D74 + adds r0, r2 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, _080D4D78 + adds r2, r0, r2 + cmp r1, 0 + beq _080D4D84 + ldr r0, _080D4D7C + strh r0, [r2, 0x26] + ldr r0, _080D4D80 + str r0, [r2, 0x1C] + adds r0, r3, 0x1 + strh r0, [r2, 0x2E] + adds r0, r2, 0 + movs r1, 0 + bl obj_anim_image_start + b _080D4D90 + .align 2, 0 +_080D4D70: .4byte 0x0203ce54 +_080D4D74: .4byte 0x00000804 +_080D4D78: .4byte 0x02020630 +_080D4D7C: .4byte 0x0000fffb +_080D4D80: .4byte sub_80D4D94 + 1 +_080D4D84: + adds r1, r3, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl obj_anim_image_start +_080D4D90: + pop {r0} + bx r0 + thumb_func_end sub_80D4D38 + + thumb_func_start sub_80D4D94 +sub_80D4D94: @ 80D4D94 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x26] + movs r2, 0x26 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D4DA8 + adds r0, r1, 0x1 + strh r0, [r4, 0x26] + b _080D4DB8 +_080D4DA8: + ldrh r1, [r4, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _080D4DC0 + str r0, [r4, 0x1C] +_080D4DB8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D4DC0: .4byte nullsub_12 + 1 + thumb_func_end sub_80D4D94 + + thumb_func_start sub_80D4DC4 +sub_80D4DC4: @ 80D4DC4 + push {r4,lr} + ldr r0, _080D4DFC + ldr r0, [r0] + ldr r1, _080D4E00 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080D4E04 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D4DF4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r0, _080D4E08 + str r0, [r4, 0x1C] +_080D4DF4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D4DFC: .4byte 0x0203ce54 +_080D4E00: .4byte 0x00000804 +_080D4E04: .4byte 0x02020630 +_080D4E08: .4byte sub_80D4E0C + 1 + thumb_func_end sub_80D4DC4 + + thumb_func_start sub_80D4E0C +sub_80D4E0C: @ 80D4E0C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D4E28 + adds r0, r4, 0 + movs r1, 0 + bl sub_8008258 + ldr r0, _080D4E30 + str r0, [r4, 0x1C] +_080D4E28: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D4E30: .4byte nullsub_12 + 1 + thumb_func_end sub_80D4E0C + + thumb_func_start sub_80D4E34 +sub_80D4E34: @ 80D4E34 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080D4E74 + ldr r4, [r0] + ldr r0, _080D4E78 + adds r4, r0 + ldr r0, _080D4E7C + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _080D4E80 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _080D4E84 + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4] + ldr r2, _080D4E88 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D4E74: .4byte 0x0203ce54 +_080D4E78: .4byte 0x00000805 +_080D4E7C: .4byte 0x0857fba0 +_080D4E80: .4byte 0x0857fba8 +_080D4E84: .4byte 0x0857fbb0 +_080D4E88: .4byte 0x02020630 + thumb_func_end sub_80D4E34 + + thumb_func_start sub_80D4E8C +sub_80D4E8C: @ 80D4E8C + ldrh r2, [r0, 0x30] + ldrh r1, [r0, 0x34] + adds r1, 0x1 + movs r3, 0x1 + ands r1, r3 + subs r2, r1 + adds r1, r0, 0 + adds r1, 0x28 + strb r2, [r1] + ldrh r2, [r0, 0x30] + ldrh r1, [r0, 0x34] + adds r1, 0x1 + ands r1, r3 + subs r2, r1 + adds r0, 0x29 + strb r2, [r0] + bx lr + thumb_func_end sub_80D4E8C + + thumb_func_start sub_80D4EB0 +sub_80D4EB0: @ 80D4EB0 + push {r4,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080D4ED8 + ldr r0, _080D4ED4 + b _080D4EDA + .align 2, 0 +_080D4ED4: .4byte 0x0857fb98 +_080D4ED8: + ldr r0, _080D4F0C +_080D4EDA: + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x30] + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x30] + adds r0, r4, 0 + bl sub_80D4E8C + ldr r0, _080D4F10 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D4F0C: .4byte 0x0857fb9c +_080D4F10: .4byte sub_80D4F14 + 1 + thumb_func_end sub_80D4EB0 + + thumb_func_start sub_80D4F14 +sub_80D4F14: @ 80D4F14 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl sub_80D4E8C + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _080D4F32 + movs r0, 0x1 + bl sub_80D4CA8 +_080D4F32: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D4F14 + + thumb_func_start sub_80D4F38 +sub_80D4F38: @ 80D4F38 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, _080D4F8C + ldr r2, _080D4F90 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _080D4F86 + adds r4, 0x66 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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 _080D4F86 + strb r2, [r5] + ldr r1, _080D4F94 + 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] +_080D4F86: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D4F8C: .4byte 0x0203ce54 +_080D4F90: .4byte 0x00000806 +_080D4F94: .4byte 0x02020630 + thumb_func_end sub_80D4F38 + + thumb_func_start sub_80D4F98 +sub_80D4F98: @ 80D4F98 + push {lr} + lsls r0, 24 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + bl sub_80D4CA8 + pop {r0} + bx r0 + thumb_func_end sub_80D4F98 + + thumb_func_start sub_80D4FAC +sub_80D4FAC: @ 80D4FAC + push {lr} + ldr r0, _080D4FC0 + ldr r0, [r0] + ldr r1, _080D4FC4 + adds r0, r1 + movs r1, 0x8 + bl sub_8122344 + pop {r0} + bx r0 + .align 2, 0 +_080D4FC0: .4byte 0x0203ce54 +_080D4FC4: .4byte 0x00000808 + thumb_func_end sub_80D4FAC + + thumb_func_start sub_80D4FC8 +sub_80D4FC8: @ 80D4FC8 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _080D4FE4 + ldr r0, [r0] + ldr r1, _080D4FE8 + adds r0, r1 + movs r1, 0x8 + bl sub_81223FC + pop {r0} + bx r0 + .align 2, 0 +_080D4FE4: .4byte 0x0203ce54 +_080D4FE8: .4byte 0x00000808 + thumb_func_end sub_80D4FC8 + + thumb_func_start sub_80D4FEC +sub_80D4FEC: @ 80D4FEC + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, _080D5010 + ldr r0, [r0] + ldr r1, _080D5014 + 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 + .align 2, 0 +_080D5010: .4byte 0x0203ce54 +_080D5014: .4byte 0x00000808 + thumb_func_end sub_80D4FEC + + thumb_func_start sub_80D5018 +sub_80D5018: @ 80D5018 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r4, 0 + movs r1, 0 + bl memset + movs r0, 0x80 + lsls r0, 1 + adds r4, r0 + movs r7, 0 +_080D5036: + adds r4, 0x20 + movs r5, 0 + adds r1, r7, 0x1 + mov r8, r1 +_080D503E: + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x20 + bl memcpy + adds r4, 0x20 + adds r6, 0x20 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _080D503E + cmp r7, 0x5 + beq _080D505C + adds r4, 0x20 +_080D505C: + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x5 + bls _080D5036 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D5018 + + thumb_func_start sub_80D5070 +sub_80D5070: @ 80D5070 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0x2A + bne _080D5082 + bl sub_80E162C +_080D5082: + ldr r5, _080D50C0 + lsls r4, 3 + adds r0, r5, 0x4 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp] + ldr r1, _080D50C4 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, _080D50C8 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_pal_obj_decompress_and_apply + adds r4, r5 + ldr r0, [r4] + ldr r4, _080D50CC + adds r1, r4, 0 + bl call_LZZUnCompWram + ldr r0, _080D50D0 + adds r1, r4, r0 + adds r0, r4, 0 + bl sub_80D5018 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D50C0: .4byte 0x0857fc94 +_080D50C4: .4byte 0xffff0000 +_080D50C8: .4byte 0x00007544 +_080D50CC: .4byte 0x0201d000 +_080D50D0: .4byte 0xfffff000 + thumb_func_end sub_80D5070 + + thumb_func_start sub_80D50D4 +sub_80D50D4: @ 80D50D4 + 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, 16 + lsrs r5, 16 + bl sub_80D5070 + ldr r0, _080D5108 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080D5108: .4byte 0x0857fbec + thumb_func_end sub_80D50D4 + + thumb_func_start sub_80D510C +sub_80D510C: @ 80D510C + push {lr} + ldr r0, _080D5118 + bl gpu_pal_free_tag + pop {r0} + bx r0 + .align 2, 0 +_080D5118: .4byte 0x00007544 + thumb_func_end sub_80D510C + + thumb_func_start sub_80D511C +sub_80D511C: @ 80D511C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _080D5180 + bl gpu_pal_free_tag + adds r0, r4, 0 + bl sub_80D5070 + ldr r0, _080D5184 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + adds r4, r1, 0 + mov r0, r8 + cmp r0, 0x1 + bne _080D5172 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080D5188 + adds r0, r1 + movs r1, 0x1 + bl sub_8008258 +_080D5172: + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080D5180: .4byte 0x00007544 +_080D5184: .4byte 0x0857fc7c +_080D5188: .4byte 0x02020630 + thumb_func_end sub_80D511C + + thumb_func_start sub_80D518C +sub_80D518C: @ 80D518C + push {lr} + adds r1, r0, 0 + ldr r0, _080D51A8 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x74 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080D51A8: .4byte 0x0857fe10 + thumb_func_end sub_80D518C + + thumb_func_start sub_80D51AC +sub_80D51AC: @ 80D51AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080D51CC + ldrb r0, [r4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080D51D0 + adds r0, r5, 0 + bl move_anim_task_del + b _080D520C + .align 2, 0 +_080D51CC: .4byte 0x0203841e +_080D51D0: + ldr r1, _080D5214 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x24] + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x26] + ldr r1, _080D5218 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x8] + ldrh r1, [r4, 0x6] + strh r1, [r0, 0xA] + ldrh r1, [r4, 0x8] + strh r1, [r0, 0xC] + ldrh r1, [r4, 0x8] + strh r1, [r0, 0xE] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x10] + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x12] + ldr r1, _080D521C + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080D520C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D5214: .4byte 0x02020630 +_080D5218: .4byte 0x03005e00 +_080D521C: .4byte sub_80D5220 + 1 + thumb_func_end sub_80D51AC + + thumb_func_start sub_80D5220 +sub_80D5220: @ 80D5220 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080D525C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0xE] + movs r2, 0xE + ldrsh r5, [r3, r2] + adds r7, r1, 0 + cmp r5, 0 + bne _080D52C6 + ldr r2, _080D5260 + movs r6, 0x8 + ldrsh r1, [r3, r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r6, 0x24 + ldrsh r0, [r1, r6] + adds r6, r2, 0 + cmp r0, 0 + bne _080D5264 + ldrh r0, [r3, 0x10] + strh r0, [r1, 0x24] + b _080D5266 + .align 2, 0 +_080D525C: .4byte 0x03005e00 +_080D5260: .4byte 0x02020630 +_080D5264: + strh r5, [r1, 0x24] +_080D5266: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r7 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r5, 0x26 + ldrsh r0, [r1, r5] + cmp r0, 0 + bne _080D5286 + ldrh r0, [r3, 0x12] + b _080D5288 +_080D5286: + movs r0, 0 +_080D5288: + strh r0, [r1, 0x26] + adds r0, r2, r4 + lsls r0, 3 + adds r2, r0, r7 + ldrh r0, [r2, 0xC] + strh r0, [r2, 0xE] + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bne _080D52CA + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r3, [r0, 0x24] + movs r5, 0x8 + ldrsh r1, [r2, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r3, [r0, 0x26] + adds r0, r4, 0 + bl move_anim_task_del + b _080D52CA +_080D52C6: + subs r0, 0x1 + strh r0, [r3, 0xE] +_080D52CA: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D5220 + + thumb_func_start sub_80D52D0 +sub_80D52D0: @ 80D52D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, _080D52F8 + ldrh r0, [r2] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x3 + bgt _080D52FC + lsls r0, 24 + lsrs r0, 24 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080D5352 + b _080D5356 + .align 2, 0 +_080D52F8: .4byte 0x0203841e +_080D52FC: + cmp r1, 0x8 + beq _080D5348 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x5 + beq _080D531C + cmp r0, 0x5 + bgt _080D5312 + cmp r0, 0x4 + beq _080D5318 + b _080D5324 +_080D5312: + cmp r0, 0x6 + beq _080D5320 + b _080D5324 +_080D5318: + movs r0, 0 + b _080D5326 +_080D531C: + movs r0, 0x2 + b _080D5326 +_080D5320: + movs r0, 0x1 + b _080D5326 +_080D5324: + movs r0, 0x3 +_080D5326: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _080D533C + movs r6, 0x1 +_080D533C: + ldr r0, _080D5344 + adds r0, r4, r0 + b _080D5350 + .align 2, 0 +_080D5344: .4byte 0x020241e4 +_080D5348: + ldr r1, _080D5360 + ldr r0, _080D5364 + ldrb r0, [r0] + adds r0, r1 +_080D5350: + ldrb r3, [r0] +_080D5352: + cmp r6, 0 + beq _080D5368 +_080D5356: + adds r0, r5, 0 + bl move_anim_task_del + b _080D53A6 + .align 2, 0 +_080D5360: .4byte 0x020241e4 +_080D5364: .4byte 0x02038436 +_080D5368: + ldr r1, _080D53AC + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldr r2, _080D53B0 + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x24] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x26] + ldr r1, _080D53B4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0x8] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0xE] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x10] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x12] + ldr r1, _080D53B8 + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080D53A6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D53AC: .4byte 0x02020630 +_080D53B0: .4byte 0x0203841e +_080D53B4: .4byte 0x03005e00 +_080D53B8: .4byte sub_80D53BC + 1 + thumb_func_end sub_80D52D0 + + thumb_func_start sub_80D53BC +sub_80D53BC: @ 80D53BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080D5400 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r1 + ldrh r2, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + mov r12, r1 + cmp r0, 0 + bne _080D5474 + ldr r2, _080D5404 + movs r7, 0x8 + ldrsh r1, [r3, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r0, 0x24 + ldrsh r1, [r4, r0] + ldrh r5, [r3, 0x10] + movs r7, 0x10 + ldrsh r0, [r3, r7] + adds r7, r2, 0 + cmp r1, r0 + bne _080D5408 + negs r0, r5 + strh r0, [r4, 0x24] + b _080D540A + .align 2, 0 +_080D5400: .4byte 0x03005e00 +_080D5404: .4byte 0x02020630 +_080D5408: + strh r5, [r4, 0x24] +_080D540A: + lsls r3, r6, 2 + adds r1, r3, r6 + lsls r1, 3 + add r1, r12 + movs r0, 0x8 + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r7 + movs r0, 0x26 + ldrsh r2, [r4, r0] + mov r8, r2 + ldrh r5, [r1, 0x12] + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r8, r0 + bne _080D5434 + negs r0, r5 + strh r0, [r4, 0x26] + b _080D5436 +_080D5434: + strh r5, [r4, 0x26] +_080D5436: + adds r0, r3, r6 + lsls r0, 3 + mov r4, r12 + adds r3, r0, r4 + ldrh r0, [r3, 0xC] + strh r0, [r3, 0xE] + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080D5478 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x24] + movs r4, 0x8 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del + b _080D5478 +_080D5474: + subs r0, r2, 0x1 + strh r0, [r3, 0xE] +_080D5478: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D53BC + + thumb_func_start sub_80D5484 +sub_80D5484: @ 80D5484 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080D54A4 + ldrb r0, [r4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080D54A8 + adds r0, r5, 0 + bl move_anim_task_del + b _080D54F6 + .align 2, 0 +_080D54A4: .4byte 0x0203841e +_080D54A8: + ldr r0, _080D54FC + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x2] + ldrh r2, [r1, 0x24] + adds r0, r2 + movs r2, 0 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x4] + ldrh r6, [r1, 0x26] + adds r0, r6 + strh r0, [r1, 0x26] + ldr r0, _080D5500 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + strh r3, [r1, 0x8] + strh r2, [r1, 0xA] + ldrh r0, [r4, 0x6] + strh r0, [r1, 0xC] + strh r2, [r1, 0xE] + ldrh r0, [r4, 0x8] + strh r0, [r1, 0x10] + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 1 + strh r0, [r1, 0x12] + movs r6, 0x4 + ldrsh r0, [r4, r6] + lsls r0, 1 + strh r0, [r1, 0x14] + ldr r2, _080D5504 + str r2, [r1] + adds r0, r5, 0 + bl _call_via_r2 +_080D54F6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D54FC: .4byte 0x02020630 +_080D5500: .4byte 0x03005e00 +_080D5504: .4byte sub_80D5508 + 1 + thumb_func_end sub_80D5484 + + thumb_func_start sub_80D5508 +sub_80D5508: @ 80D5508 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080D5560 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + adds r6, r1, 0 + cmp r0, 0 + beq _080D5526 + b _080D5638 +_080D5526: + ldrh r1, [r4, 0xA] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D5568 + ldr r2, _080D5564 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r3, [r0, 0x24] + adds r1, r3 + strh r1, [r0, 0x24] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x14] + ldrh r3, [r0, 0x26] + adds r1, r3 + strh r1, [r0, 0x26] + adds r3, r2, 0 + b _080D5592 + .align 2, 0 +_080D5560: .4byte 0x03005e00 +_080D5564: .4byte 0x02020630 +_080D5568: + ldr r3, _080D55F4 + 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, 0x12] + subs r1, r2 + strh r1, [r0, 0x24] + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + ldrh r2, [r4, 0x14] + subs r1, r2 + strh r1, [r0, 0x26] +_080D5592: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + ldrh r0, [r4, 0x10] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0xA] + adds r2, r0, 0x1 + strh r2, [r4, 0xA] + lsls r0, r2, 16 + asrs r0, 16 + movs r6, 0xC + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _080D563C + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080D55F8 + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r2, 0x12 + ldrsh r0, [r4, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + ldrh r6, [r1, 0x24] + adds r0, r6 + strh r0, [r1, 0x24] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r2, 0x14 + ldrsh r0, [r4, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + ldrh r3, [r1, 0x26] + adds r0, r3 + strh r0, [r1, 0x26] + b _080D5630 + .align 2, 0 +_080D55F4: .4byte 0x02020630 +_080D55F8: + movs r6, 0x8 + ldrsh r0, [r4, r6] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r3, 0x14 + ldrsh r1, [r4, r3] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r2, 0x26] + subs r0, r1 + strh r0, [r2, 0x26] +_080D5630: + adds r0, r5, 0 + bl move_anim_task_del + b _080D563C +_080D5638: + subs r0, r2, 0x1 + strh r0, [r4, 0xE] +_080D563C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D5508 + + thumb_func_start sub_80D5644 +sub_80D5644: @ 80D5644 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080D5694 + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D5698 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r5, 0x2] + strh r2, [r1, 0x24] + ldr r2, _080D569C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + ldrh r0, [r5, 0x2] + strh r0, [r1, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r1, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r1, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x10] + ldr r2, _080D56A0 + str r2, [r1] + adds r0, r4, 0 + bl _call_via_r2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D5694: .4byte 0x0203841e +_080D5698: .4byte 0x02020630 +_080D569C: .4byte 0x03005e00 +_080D56A0: .4byte sub_80D56A4 + 1 + thumb_func_end sub_80D5644 + + thumb_func_start sub_80D56A4 +sub_80D56A4: @ 80D56A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _080D5730 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r2 + ldrb r5, [r3, 0x8] + ldrh r4, [r3, 0xA] + ldrh r1, [r3, 0x18] + adds r0, r1, 0x1 + strh r0, [r3, 0x18] + movs r7, 0xC + ldrsh r0, [r3, r7] + lsls r1, 16 + asrs r1, 16 + mov r12, r2 + ldr r7, _080D5734 + cmp r0, r1 + bne _080D56F6 + movs r0, 0 + strh r0, [r3, 0x18] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0, r7 + ldrh r3, [r1, 0x24] + movs r0, 0x24 + ldrsh r2, [r1, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r2, r0 + bne _080D56EE + negs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_080D56EE: + lsls r0, r4, 16 + asrs r0, 16 + adds r0, r3 + strh r0, [r1, 0x24] +_080D56F6: + lsls r2, r6, 2 + adds r2, r6 + lsls r2, 3 + add r2, r12 + strh r4, [r2, 0xA] + ldrh r1, [r2, 0xE] + ldrh r0, [r2, 0x1A] + adds r1, r0 + strh r1, [r2, 0x1A] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r7 + lsls r1, 16 + asrs r1, 24 + strh r1, [r0, 0x26] + ldrh r0, [r2, 0x10] + subs r0, 0x1 + strh r0, [r2, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _080D5728 + adds r0, r6, 0 + bl move_anim_task_del +_080D5728: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D5730: .4byte 0x03005e00 +_080D5734: .4byte 0x02020630 + thumb_func_end sub_80D56A4 + + thumb_func_start sub_80D5738 +sub_80D5738: @ 80D5738 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x1 + ldr r4, _080D57AC + ldrb r0, [r4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _080D575C + movs r0, 0x5 + strh r0, [r4, 0x8] +_080D575C: + movs r1, 0 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r3, r4, 0 + ldr r2, _080D57B0 + mov r12, r2 + lsls r4, r5, 2 + ldr r2, _080D57B4 + mov r8, r2 + cmp r1, r0 + bge _080D5782 + adds r2, r0, 0 +_080D5774: + lsls r0, r6, 25 + lsrs r6, r0, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + blt _080D5774 +_080D5782: + adds r0, r4, r5 + lsls r0, 3 + add r0, r12 + strh r7, [r0, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r0, 0xE] + strh r6, [r0, 0x10] + mov r1, r8 + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D57AC: .4byte 0x0203841e +_080D57B0: .4byte 0x03005e00 +_080D57B4: .4byte sub_80D57B8 + 1 + thumb_func_end sub_80D5738 + + thumb_func_start sub_80D57B8 +sub_80D57B8: @ 80D57B8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _080D5828 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrb r4, [r5, 0x8] + movs r1, 0x12 + ldrsh r0, [r5, r1] + movs r2, 0xA + ldrsh r1, [r5, r2] + bl sine + ldr r2, _080D582C + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r4, r1, r2 + strh r0, [r4, 0x24] + movs r1, 0x12 + ldrsh r0, [r5, r1] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r5, 0xC] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x10] + ldrh r1, [r5, 0x12] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x12] + cmp r0, 0 + bne _080D5810 + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] +_080D5810: + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _080D5822 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_080D5822: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D5828: .4byte 0x03005e00 +_080D582C: .4byte 0x02020630 + thumb_func_end sub_80D57B8 + + thumb_func_start sub_80D5830 +sub_80D5830: @ 80D5830 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080D5858 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D584C + ldr r1, _080D585C + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_080D584C: + adds r0, r4, 0 + bl sub_80D5738 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D5858: .4byte 0x02038436 +_080D585C: .4byte 0x0203841e + thumb_func_end sub_80D5830 + + thumb_func_start sub_80D5860 +sub_80D5860: @ 80D5860 + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080D5888 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5890 + ldr r1, _080D588C + ldrh r0, [r1, 0x2] + negs r0, r0 + b _080D5894 + .align 2, 0 +_080D5888: .4byte 0x02038436 +_080D588C: .4byte 0x0203841e +_080D5890: + ldr r1, _080D58C0 + ldrh r0, [r1, 0x2] +_080D5894: + strh r0, [r4, 0x30] + ldrh r2, [r1] + movs r0, 0 + strh r2, [r4, 0x2E] + strh r0, [r4, 0x32] + ldr r1, _080D58C4 + ldr r0, _080D58C8 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r1, _080D58CC + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _080D58D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D58C0: .4byte 0x0203841e +_080D58C4: .4byte 0x020241e4 +_080D58C8: .4byte 0x02038436 +_080D58CC: .4byte sub_80D58D4 + 1 +_080D58D0: .4byte sub_80A6630 + 1 + thumb_func_end sub_80D5860 + + thumb_func_start sub_80D58D4 +sub_80D58D4: @ 80D58D4 + push {lr} + ldrh r1, [r0, 0x36] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x30] + negs r1, r1 + strh r1, [r0, 0x30] + ldr r1, _080D58F0 + str r1, [r0, 0x1C] + ldr r1, _080D58F4 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_080D58F0: .4byte sub_80A6630 + 1 +_080D58F4: .4byte move_anim_8072740 + 1 + thumb_func_end sub_80D58D4 + + thumb_func_start sub_80D58F8 +sub_80D58F8: @ 80D58F8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r5, _080D5938 + ldrb r0, [r5, 0x4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r5] + movs r1, 0 + strh r2, [r4, 0x2E] + strh r1, [r4, 0x30] + ldrh r1, [r5, 0x2] + strh r1, [r4, 0x32] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r1, _080D593C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _080D5940 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D5938: .4byte 0x0203841e +_080D593C: .4byte sub_80D5944 + 1 +_080D5940: .4byte sub_80A6630 + 1 + thumb_func_end sub_80D58F8 + + thumb_func_start sub_80D5944 +sub_80D5944: @ 80D5944 + push {lr} + ldrh r1, [r0, 0x36] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x32] + negs r1, r1 + strh r1, [r0, 0x32] + ldr r1, _080D5960 + str r1, [r0, 0x1C] + ldr r1, _080D5964 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_080D5960: .4byte sub_80A6630 + 1 +_080D5964: .4byte move_anim_8072740 + 1 + thumb_func_end sub_80D5944 + + thumb_func_start sub_80D5968 +sub_80D5968: @ 80D5968 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, _080D5980 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D598C + ldr r1, _080D5984 + ldr r0, _080D5988 + b _080D5990 + .align 2, 0 +_080D5980: .4byte 0x0203841e +_080D5984: .4byte 0x020241e4 +_080D5988: .4byte 0x02038436 +_080D598C: + ldr r1, _080D59F0 + ldr r0, _080D59F4 +_080D5990: + ldrb r0, [r0] + adds r0, r1 + ldrb r7, [r0] + ldr r5, _080D59F8 + ldrh r0, [r5, 0x4] + movs r3, 0 + strh r0, [r6, 0x2E] + ldr r0, _080D59FC + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r6, 0x30] + ldrh r0, [r4, 0x20] + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x22] + strh r0, [r6, 0x36] + adds r0, r6, 0 + str r3, [sp] + bl sub_80A6E14 + ldr r3, [sp] + strh r3, [r6, 0x34] + strh r3, [r6, 0x36] + ldrh r0, [r4, 0x24] + strh r0, [r6, 0x38] + ldrh r0, [r4, 0x26] + strh r0, [r6, 0x3A] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080D5A00 + strh r3, [r6, 0x32] + b _080D5A06 + .align 2, 0 +_080D59F0: .4byte 0x020241e4 +_080D59F4: .4byte 0x02038437 +_080D59F8: .4byte 0x0203841e +_080D59FC: .4byte 0x02020630 +_080D5A00: + cmp r0, 0x2 + bne _080D5A06 + strh r3, [r6, 0x30] +_080D5A06: + ldr r0, _080D5A1C + ldrh r1, [r0, 0x2] + lsls r0, r7, 8 + orrs r0, r1 + strh r0, [r6, 0x3C] + ldr r0, _080D5A20 + str r0, [r6, 0x1C] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D5A1C: .4byte 0x0203841e +_080D5A20: .4byte sub_80D5A24 + 1 + thumb_func_end sub_80D5968 + + thumb_func_start sub_80D5A24 +sub_80D5A24: @ 80D5A24 + push {r4-r6,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x3C] + lsls r1, r0, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + lsls r0, 16 + asrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080D5A60 + adds r3, r1, r0 + ldrh r0, [r2, 0x2E] + movs r6, 0x2E + ldrsh r1, [r2, r6] + cmp r1, 0 + bne _080D5A64 + cmp r4, 0x1 + bhi _080D5A4E + strh r1, [r3, 0x24] +_080D5A4E: + cmp r5, 0x2 + beq _080D5A56 + cmp r5, 0 + bne _080D5A58 +_080D5A56: + strh r1, [r3, 0x26] +_080D5A58: + adds r0, r2, 0 + bl move_anim_8072740 + b _080D5A8E + .align 2, 0 +_080D5A60: .4byte 0x02020630 +_080D5A64: + subs r0, 0x1 + strh r0, [r2, 0x2E] + ldrh r1, [r2, 0x30] + ldrh r0, [r2, 0x34] + adds r1, r0 + strh r1, [r2, 0x34] + ldrh r0, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r0, r4 + strh r0, [r2, 0x36] + lsls r1, 16 + asrs r1, 24 + ldrh r6, [r2, 0x38] + adds r1, r6 + strh r1, [r3, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r2, 0x3A] + adds r0, r2 + strh r0, [r3, 0x26] +_080D5A8E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D5A24 + + thumb_func_start sub_80D5A94 +sub_80D5A94: @ 80D5A94 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _080D5AA8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D5AB0 + ldr r0, _080D5AAC + b _080D5AB2 + .align 2, 0 +_080D5AA8: .4byte 0x0203841e +_080D5AAC: .4byte 0x02038436 +_080D5AB0: + ldr r0, _080D5B30 +_080D5AB2: + ldrb r2, [r0] + ldr r0, _080D5B34 + adds r0, r2, r0 + ldrb r6, [r0] + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5ADC + ldr r1, _080D5B38 + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080D5ADC + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080D5ADC: + ldr r2, _080D5B38 + ldrh r0, [r2, 0x8] + movs r4, 0 + strh r0, [r5, 0x2E] + ldr r0, _080D5B3C + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x2] + ldrh r3, [r1, 0x20] + adds r0, r3 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x22] + strh r0, [r5, 0x34] + ldrh r0, [r2, 0x4] + ldrh r1, [r1, 0x22] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6E14 + strh r4, [r5, 0x34] + strh r4, [r5, 0x36] + strh r6, [r5, 0x38] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, _080D5B40 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _080D5B44 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D5B30: .4byte 0x02038437 +_080D5B34: .4byte 0x020241e4 +_080D5B38: .4byte 0x0203841e +_080D5B3C: .4byte 0x02020630 +_080D5B40: .4byte move_anim_8072740 + 1 +_080D5B44: .4byte sub_80A6680 + 1 + thumb_func_end sub_80D5A94 + + thumb_func_start sub_80D5B48 +sub_80D5B48: @ 80D5B48 + push {r4-r7,lr} + adds r6, r0, 0 + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080D5B68 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D5B70 + ldr r0, _080D5B6C + b _080D5B72 + .align 2, 0 +_080D5B68: .4byte 0x0203841e +_080D5B6C: .4byte 0x02038436 +_080D5B70: + ldr r0, _080D5BF0 +_080D5B72: + ldrb r1, [r0] + ldr r0, _080D5BF4 + adds r0, r1, r0 + ldrb r7, [r0] + adds r0, r1, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5B9C + ldr r1, _080D5BF8 + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080D5B9C + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080D5B9C: + ldr r5, _080D5BF8 + ldrh r0, [r5, 0x8] + strh r0, [r6, 0x2E] + ldr r0, _080D5BFC + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r6, 0x30] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r6, 0x34] + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl sub_80A6E14 + ldrh r0, [r4, 0x24] + lsls r0, 8 + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x26] + lsls r0, 8 + strh r0, [r6, 0x36] + strh r7, [r6, 0x38] + ldrh r0, [r5, 0xA] + strh r0, [r6, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _080D5C04 + ldr r1, _080D5C00 + adds r0, r6, 0 + bl oamt_set_x3A_32 + b _080D5C0C + .align 2, 0 +_080D5BF0: .4byte 0x02038437 +_080D5BF4: .4byte 0x020241e4 +_080D5BF8: .4byte 0x0203841e +_080D5BFC: .4byte 0x02020630 +_080D5C00: .4byte move_anim_8072740 + 1 +_080D5C04: + ldr r1, _080D5C18 + adds r0, r6, 0 + bl oamt_set_x3A_32 +_080D5C0C: + ldr r0, _080D5C1C + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D5C18: .4byte sub_80D5C20 + 1 +_080D5C1C: .4byte sub_80A6680 + 1 + thumb_func_end sub_80D5B48 + + thumb_func_start sub_80D5C20 +sub_80D5C20: @ 80D5C20 + push {r4,lr} + ldr r4, _080D5C4C + movs r1, 0x38 + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + movs r3, 0 + strh r3, [r1, 0x24] + movs r1, 0x38 + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r3, [r1, 0x26] + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D5C4C: .4byte 0x02020630 + thumb_func_end sub_80D5C20 + + thumb_func_start sub_80D5C50 +sub_80D5C50: @ 80D5C50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _080D5CD4 + movs r0, 0x6 + ldrsh r1, [r5, r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, _080D5CD8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5C82 + ldrh r0, [r5, 0x2] + negs r0, r0 + strh r0, [r5, 0x2] + ldrh r0, [r5, 0xA] + negs r0, r0 + strh r0, [r5, 0xA] +_080D5C82: + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + ldr r1, _080D5CDC + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r2, 0xC + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x12] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x14] + strh r7, [r4, 0x16] + ldr r0, _080D5CE0 + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D5CD4: .4byte 0x0203841e +_080D5CD8: .4byte 0x02038436 +_080D5CDC: .4byte 0x03005e00 +_080D5CE0: .4byte sub_80D5CE4 + 1 + thumb_func_end sub_80D5C50 + + thumb_func_start sub_80D5CE4 +sub_80D5CE4: @ 80D5CE4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D5D3C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r1, [r5, 0x8] + ldrh r0, [r5, 0xA] + ldrh r2, [r5, 0x1E] + adds r0, r2 + strh r0, [r5, 0x1E] + ldr r2, _080D5D40 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r2 + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x1C] + lsrs r0, 8 + movs r2, 0xC + ldrsh r1, [r5, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x16] + ldrh r1, [r5, 0x1C] + adds r0, r1 + strh r0, [r5, 0x1C] + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _080D5D34 + ldr r0, _080D5D44 + str r0, [r5] +_080D5D34: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D5D3C: .4byte 0x03005e00 +_080D5D40: .4byte 0x02020630 +_080D5D44: .4byte sub_80D5D48 + 1 + thumb_func_end sub_80D5CE4 + + thumb_func_start sub_80D5D48 +sub_80D5D48: @ 80D5D48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _080D5D6C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080D5D70 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + b _080D5DA4 + .align 2, 0 +_080D5D6C: .4byte 0x03005e00 +_080D5D70: + ldrb r0, [r4, 0x8] + ldrh r2, [r4, 0x12] + ldrh r1, [r4, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + ldr r3, _080D5DAC + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsls r2, 16 + asrs r2, 24 + ldrh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 24 + adds r2, r0 + strh r2, [r1, 0x24] + ldrh r0, [r4, 0x14] + subs r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _080D5DA4 + adds r0, r5, 0 + bl move_anim_task_del +_080D5DA4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D5DAC: .4byte 0x02020630 + thumb_func_end sub_80D5D48 + + thumb_func_start sub_80D5DB0 +sub_80D5DB0: @ 80D5DB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080D5DD4 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _080D5DDE + cmp r0, 0x2 + bgt _080D5DD8 + cmp r0, 0 + blt _080D5E10 + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + b _080D5E18 + .align 2, 0 +_080D5DD4: .4byte 0x0203841e +_080D5DD8: + cmp r0, 0x3 + beq _080D5DE8 + b _080D5E10 +_080D5DDE: + ldr r5, _080D5DE4 + b _080D5DEA + .align 2, 0 +_080D5DE4: .4byte 0x02038436 +_080D5DE8: + ldr r5, _080D5E08 +_080D5DEA: + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080D5E10 + ldr r1, _080D5E0C + ldrb r0, [r5] + eors r0, r4 + adds r0, r1 + ldrb r2, [r0] + b _080D5E18 + .align 2, 0 +_080D5E08: .4byte 0x02038437 +_080D5E0C: .4byte 0x020241e4 +_080D5E10: + adds r0, r6, 0 + bl move_anim_task_del + b _080D5E58 +_080D5E18: + ldr r1, _080D5E38 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r5, r0, r1 + strh r2, [r5, 0x8] + ldr r0, _080D5E3C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5E44 + ldr r0, _080D5E40 + ldrh r0, [r0, 0x2] + b _080D5E4A + .align 2, 0 +_080D5E38: .4byte 0x03005e00 +_080D5E3C: .4byte 0x02038437 +_080D5E40: .4byte 0x0203841e +_080D5E44: + ldr r0, _080D5E60 + ldrh r0, [r0, 0x2] + negs r0, r0 +_080D5E4A: + strh r0, [r5, 0xA] + ldr r0, _080D5E64 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D5E68 + str r0, [r1] +_080D5E58: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D5E60: .4byte 0x0203841e +_080D5E64: .4byte 0x03005e00 +_080D5E68: .4byte sub_80D5E6C + 1 + thumb_func_end sub_80D5DB0 + + thumb_func_start sub_80D5E6C +sub_80D5E6C: @ 80D5E6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080D5EB0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r2, [r1, 0x8] + ldr r3, _080D5EB4 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r1, 0xA] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + movs r2, 0x24 + ldrsh r1, [r0, r2] + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r1, r0 + adds r1, 0x20 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bls _080D5EAA + adds r0, r4, 0 + bl move_anim_task_del +_080D5EAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D5EB0: .4byte 0x03005e00 +_080D5EB4: .4byte 0x02020630 + thumb_func_end sub_80D5E6C + + thumb_func_start sub_80D5EB8 +sub_80D5EB8: @ 80D5EB8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _080D5F08 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5ED4 + ldr r1, _080D5F0C + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_080D5ED4: + ldr r4, _080D5F0C + ldrb r0, [r4, 0x8] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D5F10 + lsls r3, r5, 2 + adds r1, r3, r5 + lsls r1, 3 + adds r2, r1, r2 + ldrh r1, [r4] + strh r1, [r2, 0x8] + ldrh r1, [r4, 0x2] + strh r1, [r2, 0xA] + ldrh r1, [r4, 0x4] + strh r1, [r2, 0xC] + ldrh r1, [r4, 0x6] + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D5F14 + ldrb r0, [r6] + b _080D5F18 + .align 2, 0 +_080D5F08: .4byte 0x02038436 +_080D5F0C: .4byte 0x0203841e +_080D5F10: .4byte 0x03005e00 +_080D5F14: + ldr r0, _080D5F30 + ldrb r0, [r0] +_080D5F18: + strh r0, [r2, 0x12] + ldr r1, _080D5F34 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x20] + ldr r1, _080D5F38 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D5F30: .4byte 0x02038437 +_080D5F34: .4byte 0x03005e00 +_080D5F38: .4byte sub_80D5F3C + 1 + thumb_func_end sub_80D5EB8 + + thumb_func_start sub_80D5F3C +sub_80D5F3C: @ 80D5F3C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080D5F8C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + ldrb r7, [r4, 0x10] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x1C] + adds r0, r1 + lsls r1, r0, 16 + strh r0, [r4, 0x1C] + lsrs r1, 24 + mov r8, r1 + mov r0, r8 + movs r2, 0xA + ldrsh r1, [r4, r2] + bl sine + lsls r0, 16 + lsrs r5, r0, 16 + mov r9, r5 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D5F94 + ldr r0, _080D5F90 + lsls r2, r7, 4 + adds r1, r2, r7 + lsls r1, 2 + adds r1, r0 + strh r5, [r1, 0x24] + mov r9, r0 + adds r4, r2, 0 + b _080D5FDA + .align 2, 0 +_080D5F8C: .4byte 0x03005e00 +_080D5F90: .4byte 0x02020630 +_080D5F94: + ldrb r0, [r4, 0x12] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080D5FBC + ldr r1, _080D5FB8 + lsls r2, r7, 4 + adds r0, r2, r7 + lsls r0, 2 + adds r3, r0, r1 + lsls r0, r5, 16 + asrs r0, 16 + mov r9, r1 + adds r4, r2, 0 + cmp r0, 0 + bge _080D5FD8 + b _080D5FD6 + .align 2, 0 +_080D5FB8: .4byte 0x02020630 +_080D5FBC: + ldr r1, _080D605C + lsls r2, r7, 4 + adds r0, r2, r7 + lsls r0, 2 + adds r3, r0, r1 + mov r4, r9 + lsls r0, r4, 16 + asrs r0, 16 + mov r9, r1 + adds r4, r2, 0 + cmp r0, 0 + bge _080D5FD6 + negs r0, r0 +_080D5FD6: + negs r0, r0 +_080D5FD8: + strh r0, [r3, 0x26] +_080D5FDA: + mov r5, r8 + cmp r5, 0x7F + bls _080D5FFC + ldr r1, _080D6060 + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0x1E + ldrsh r0, [r3, r5] + adds r5, r1, 0 + cmp r0, 0 + bne _080D5FFC + movs r1, 0x20 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _080D601E +_080D5FFC: + mov r2, r8 + cmp r2, 0x7E + bhi _080D6050 + ldr r1, _080D6060 + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0x1E + ldrsh r0, [r3, r5] + adds r5, r1, 0 + cmp r0, 0x1 + bne _080D6050 + movs r1, 0x20 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080D6050 +_080D601E: + adds r1, r2, r6 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x1E] + movs r2, 0x1 + eors r0, r2 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + eors r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bne _080D6050 + adds r0, r4, r7 + lsls r0, 2 + add r0, r9 + strh r3, [r0, 0x24] + strh r3, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_080D6050: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D605C: .4byte 0x02020630 +_080D6060: .4byte 0x03005e00 + thumb_func_end sub_80D5F3C + + thumb_func_start sub_80D6064 +sub_80D6064: @ 80D6064 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _080D60B0 + ldrb r0, [r6, 0x6] + bl obj_id_for_side_relative_to_move + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r1, [r6, 0x8] + adds r0, r5, 0 + bl sub_80A7270 + ldr r1, _080D60B4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r6] + strh r1, [r0, 0x8] + ldrh r1, [r6, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r6, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r6, 0x4] + strh r1, [r0, 0xE] + strh r5, [r0, 0x10] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r0, 0x1C] + strh r1, [r0, 0x1E] + ldr r1, _080D60B8 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D60B0: .4byte 0x0203841e +_080D60B4: .4byte 0x03005e00 +_080D60B8: .4byte sub_80D60BC + 1 + thumb_func_end sub_80D6064 + + thumb_func_start sub_80D60BC +sub_80D60BC: @ 80D60BC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _080D611C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xA] + ldrh r3, [r4, 0x1E] + adds r0, r3 + strh r0, [r4, 0x1E] + ldrb r0, [r4, 0x10] + adds r6, r0, 0 + movs r0, 0x1C + ldrsh r1, [r4, r0] + movs r3, 0x1E + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080D612C + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + ble _080D6120 + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + negs r0, r0 + strh r0, [r4, 0xA] + strh r2, [r4, 0xC] + strh r1, [r4, 0xE] + b _080D612C + .align 2, 0 +_080D611C: .4byte 0x03005e00 +_080D6120: + adds r0, r6, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_080D612C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D60BC + + thumb_func_start sub_80D6134 +sub_80D6134: @ 80D6134 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _080D6170 + ldrb r0, [r4, 0x4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + bl sub_80A7270 + ldr r1, _080D6174 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2, 0xA] + ldrh r0, [r4] + strh r0, [r2, 0xC] + movs r3, 0x6 + ldrsh r0, [r4, r3] + cmp r0, 0x1 + beq _080D6178 + strh r1, [r2, 0xE] + b _080D6184 + .align 2, 0 +_080D6170: .4byte 0x0203841e +_080D6174: .4byte 0x03005e00 +_080D6178: + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r3, r0, 0 + muls r3, r1 + adds r0, r3, 0 + strh r0, [r2, 0xE] +_080D6184: + ldr r1, _080D61B0 + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r5, r0, r1 + ldr r6, _080D61B4 + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x10] + mov r0, r8 + strh r0, [r5, 0x12] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x14] + bl sub_80A4DF0 + lsls r0, 24 + mov r8, r4 + cmp r0, 0 + beq _080D61B8 + movs r0, 0x1 + strh r0, [r5, 0x16] + b _080D61DC + .align 2, 0 +_080D61B0: .4byte 0x03005e00 +_080D61B4: .4byte 0x0203841e +_080D61B8: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080D61C8 + ldr r0, _080D61C4 + b _080D61CA + .align 2, 0 +_080D61C4: .4byte 0x02038436 +_080D61C8: + ldr r0, _080D6220 +_080D61CA: + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _080D61DA + movs r1, 0x1 +_080D61DA: + strh r1, [r5, 0x16] +_080D61DC: + ldr r0, _080D6224 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r4, r1, r0 + movs r3, 0x16 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080D6208 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080D6208 + movs r1, 0xE + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0xE] + movs r2, 0x10 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x10] +_080D6208: + ldr r0, _080D6224 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D6228 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D6220: .4byte 0x02038437 +_080D6224: .4byte 0x03005e00 +_080D6228: .4byte sub_80D6308 + 1 + thumb_func_end sub_80D6134 + + thumb_func_start sub_80D622C +sub_80D622C: @ 80D622C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080D6268 + ldrb r0, [r4, 0x4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + bl sub_80A7270 + ldr r1, _080D626C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xA] + ldrh r1, [r4] + strh r1, [r0, 0xC] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D6274 + ldr r0, _080D6270 + b _080D6276 + .align 2, 0 +_080D6268: .4byte 0x0203841e +_080D626C: .4byte 0x03005e00 +_080D6270: .4byte 0x02038436 +_080D6274: + ldr r0, _080D62A4 +_080D6276: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D6288 + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] +_080D6288: + ldr r0, _080D62A8 + movs r2, 0x6 + ldrsh r1, [r0, r2] + adds r6, r0, 0 + cmp r1, 0x1 + beq _080D62B0 + ldr r2, _080D62AC + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0xE] + b _080D62CA + .align 2, 0 +_080D62A4: .4byte 0x02038437 +_080D62A8: .4byte 0x0203841e +_080D62AC: .4byte 0x03005e00 +_080D62B0: + ldr r3, _080D6300 + lsls r4, r5, 2 + adds r0, r4, r5 + lsls r0, 3 + adds r0, r3 + ldrh r2, [r6] + ldrh r1, [r6, 0x2] + adds r7, r2, 0 + muls r7, r1 + adds r1, r7, 0 + strh r1, [r0, 0xE] + adds r2, r3, 0 + adds r3, r4, 0 +_080D62CA: + adds r1, r3, r5 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r6, 0x2] + strh r0, [r1, 0x10] + mov r0, r8 + strh r0, [r1, 0x12] + ldrh r0, [r6, 0x6] + strh r0, [r1, 0x14] + movs r0, 0x1 + strh r0, [r1, 0x16] + movs r2, 0xE + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0xE] + movs r7, 0x10 + ldrsh r0, [r1, r7] + negs r0, r0 + strh r0, [r1, 0x10] + ldr r0, _080D6304 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D6300: .4byte 0x03005e00 +_080D6304: .4byte sub_80D6308 + 1 + thumb_func_end sub_80D622C + + thumb_func_start sub_80D6308 +sub_80D6308: @ 80D6308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080D6360 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] + ldrb r0, [r4, 0x12] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xE] + adds r1, r2, 0 + bl obj_id_set_rotscale + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D633C + ldrb r0, [r4, 0x12] + bl sub_80A73A0 +_080D633C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xC + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _080D6382 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080D6364 + cmp r0, 0x1 + ble _080D636A + cmp r0, 0x2 + beq _080D6372 + b _080D636A + .align 2, 0 +_080D6360: .4byte 0x03005e00 +_080D6364: + ldrb r0, [r4, 0x12] + bl sub_80A7344 +_080D636A: + adds r0, r5, 0 + bl move_anim_task_del + b _080D6382 +_080D6372: + movs r0, 0 + strh r0, [r4, 0xA] + movs r2, 0x10 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x10] + movs r0, 0x1 + strh r0, [r4, 0x14] +_080D6382: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D6308 + + thumb_func_start sub_80D6388 +sub_80D6388: @ 80D6388 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080D63B4 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r8, r0 + cmp r1, 0 + bne _080D63C0 + ldr r4, _080D63B8 + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r6, r0, r4 + ldr r0, _080D63BC + ldrh r0, [r0] + movs r1, 0xC + bl __udivsi3 + b _080D63D4 + .align 2, 0 +_080D63B4: .4byte 0x0203841e +_080D63B8: .4byte 0x03005e00 +_080D63BC: .4byte 0x02038408 +_080D63C0: + ldr r4, _080D645C + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r6, r0, r4 + ldr r0, _080D6460 + ldr r0, [r0] + movs r1, 0xC + bl __divsi3 +_080D63D4: + strh r0, [r6, 0x26] + lsls r0, 16 + adds r1, r4, 0 + cmp r0, 0 + bgt _080D63E2 + movs r0, 0x1 + strh r0, [r6, 0x26] +_080D63E2: + movs r2, 0x26 + ldrsh r0, [r6, r2] + cmp r0, 0x10 + ble _080D63EE + movs r0, 0x10 + strh r0, [r6, 0x26] +_080D63EE: + adds r4, r5, r7 + lsls r4, 3 + adds r4, r1 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + movs r5, 0 + strh r1, [r4, 0x24] + ldrh r2, [r4, 0x26] + movs r0, 0x1 + ands r0, r2 + adds r1, r0 + strh r1, [r4, 0x22] + strh r5, [r4, 0x20] + mov r1, r8 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x1C] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x1E] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + ldr r2, _080D6464 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x18] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x1A] + strh r5, [r4, 0x8] + mov r1, r8 + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xA] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0xC] + ldr r0, _080D6468 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D645C: .4byte 0x03005e00 +_080D6460: .4byte 0x02038404 +_080D6464: .4byte 0x02020630 +_080D6468: .4byte sub_80D646C + 1 + thumb_func_end sub_80D6388 + + thumb_func_start sub_80D646C +sub_80D646C: @ 80D646C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080D64C0 + adds r3, r0, r1 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xA + ldrsh r1, [r3, r2] + cmp r0, r1 + ble _080D654A + movs r0, 0 + strh r0, [r3, 0x8] + ldrh r0, [r3, 0x20] + adds r1, r0, 0x1 + movs r0, 0x1 + ands r1, r0 + strh r1, [r3, 0x20] + movs r2, 0x1C + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080D64DE + cmp r1, 0 + beq _080D64C8 + ldr r2, _080D64C4 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x18] + adds r1, r2 + b _080D64DC + .align 2, 0 +_080D64C0: .4byte 0x03005e00 +_080D64C4: .4byte 0x02020630 +_080D64C8: + ldr r2, _080D6504 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x18] + ldrh r2, [r3, 0x24] + subs r1, r2 +_080D64DC: + strh r1, [r0, 0x24] +_080D64DE: + movs r1, 0x1E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080D6518 + movs r2, 0x20 + ldrsh r4, [r3, r2] + cmp r4, 0 + beq _080D6508 + ldr r2, _080D6504 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x26] + strh r1, [r0, 0x26] + b _080D6518 + .align 2, 0 +_080D6504: .4byte 0x02020630 +_080D6508: + ldr r2, _080D6550 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x26] +_080D6518: + ldrh r0, [r3, 0xC] + subs r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + bne _080D654A + ldr r2, _080D6550 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x24] + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x26] + adds r0, r5, 0 + bl move_anim_task_del +_080D654A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D6550: .4byte 0x02020630 + thumb_func_end sub_80D646C + + thumb_func_start decrypt_bag_item_quantity +decrypt_bag_item_quantity: @ 80D6554 + adds r1, r0, 0 + ldr r0, _080D6568 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + ldrh r1, [r1] + eors r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_080D6568: .4byte 0x03005d90 + thumb_func_end decrypt_bag_item_quantity + + thumb_func_start encrypt_bag_item_quantity +encrypt_bag_item_quantity: @ 80D656C + lsls r1, 16 + lsrs r1, 16 + ldr r2, _080D6580 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + eors r1, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_080D6580: .4byte 0x03005d90 + thumb_func_end encrypt_bag_item_quantity + + thumb_func_start sub_80D6584 +sub_80D6584: @ 80D6584 + ldrh r0, [r0] + bx lr + thumb_func_end sub_80D6584 + + thumb_func_start sub_80D6588 +sub_80D6588: @ 80D6588 + strh r1, [r0] + bx lr + thumb_func_end sub_80D6588 + + thumb_func_start encrypt_decrypt_all_item_quantities +encrypt_decrypt_all_item_quantities: @ 80D658C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r0 + movs r1, 0 + ldr r0, _080D65E0 + mov r9, r0 +_080D659E: + movs r6, 0 + lsls r5, r1, 3 + mov r2, r9 + adds r0, r5, r2 + adds r7, r1, 0x1 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcs _080D65CC + ldr r2, _080D65E0 +_080D65B0: + adds r4, r5, r2 + lsls r1, r6, 2 + ldr r0, [r4] + adds r0, r1 + adds r0, 0x2 + mov r1, r8 + str r2, [sp] + bl apply_u16_xor_crypto + adds r6, 0x1 + ldr r2, [sp] + ldrb r4, [r4, 0x4] + cmp r6, r4 + bcc _080D65B0 +_080D65CC: + adds r1, r7, 0 + cmp r1, 0x4 + bls _080D659E + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D65E0: .4byte 0x02039dd8 + thumb_func_end encrypt_decrypt_all_item_quantities + + thumb_func_start call_encrypt_decrypt_all_item_quantities +call_encrypt_decrypt_all_item_quantities: @ 80D65E4 + push {lr} + bl encrypt_decrypt_all_item_quantities + pop {r0} + bx r0 + thumb_func_end call_encrypt_decrypt_all_item_quantities + + thumb_func_start init_bag_pockets +init_bag_pockets: @ 80D65F0 + push {r4,lr} + ldr r1, _080D663C + ldr r0, _080D6640 + ldr r2, [r0] + movs r3, 0xAC + lsls r3, 3 + adds r0, r2, r3 + str r0, [r1] + movs r3, 0x1E + strb r3, [r1, 0x4] + movs r4, 0xBB + lsls r4, 3 + adds r0, r2, r4 + str r0, [r1, 0x20] + adds r0, r1, 0 + adds r0, 0x24 + strb r3, [r0] + movs r3, 0xCA + lsls r3, 3 + adds r0, r2, r3 + str r0, [r1, 0x8] + movs r0, 0x10 + strb r0, [r1, 0xC] + adds r4, 0xB8 + adds r0, r2, r4 + str r0, [r1, 0x10] + movs r0, 0x40 + strb r0, [r1, 0x14] + movs r0, 0xF2 + lsls r0, 3 + adds r2, r0 + str r2, [r1, 0x18] + movs r0, 0x2E + strb r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D663C: .4byte 0x02039dd8 +_080D6640: .4byte 0x03005d8c + thumb_func_end init_bag_pockets + + thumb_func_start itemid_get_name +itemid_get_name: @ 80D6644 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + thumb_func_end itemid_get_name + + thumb_func_start sub_80D6660 +sub_80D6660: @ 80D6660 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, r3, 0 + cmp r3, 0x4 + bne _080D668C + cmp r2, 0x1 + bhi _080D667C + movs r0, 0x4 + bl itemid_get_item + adds r1, r0, 0 + b _080D667E +_080D667C: + ldr r1, _080D6688 +_080D667E: + adds r0, r4, 0 + bl gf_strcpy + b _080D66BE + .align 2, 0 +_080D6688: .4byte 0x085efcd4 +_080D668C: + adds r0, r3, 0 + subs r0, 0x85 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2A + bhi _080D66B0 + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + ldr r0, _080D66AC + adds r1, r0 + adds r0, r4, 0 + bl sub_80D66C4 + b _080D66BE + .align 2, 0 +_080D66AC: .4byte 0x085897e4 +_080D66B0: + adds r0, r1, 0 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy +_080D66BE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D6660 + + thumb_func_start sub_80D66C4 +sub_80D66C4: @ 80D66C4 + push {r4,lr} + ldr r4, _080D66E4 + cmp r2, 0x1 + bhi _080D66CE + ldr r4, _080D66E8 +_080D66CE: + bl gf_strcpy + movs r1, 0 + strb r1, [r0] + adds r0, 0x1 + adds r1, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D66E4: .4byte 0x085efce5 +_080D66E8: .4byte 0x085efcdf + thumb_func_end sub_80D66C4 + + thumb_func_start sub_80D66EC +sub_80D66EC: @ 80D66EC + push {lr} + lsls r0, 24 + movs r2, 0 + ldr r1, _080D6710 + lsrs r0, 21 + subs r0, 0x8 + adds r0, r1 + ldrb r1, [r0, 0x4] + cmp r2, r1 + bcs _080D671E + ldr r3, [r0] +_080D6702: + lsls r0, r2, 2 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080D6714 + movs r0, 0x1 + b _080D6720 + .align 2, 0 +_080D6710: .4byte 0x02039dd8 +_080D6714: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcc _080D6702 +_080D671E: + movs r0, 0 +_080D6720: + pop {r1} + bx r1 + thumb_func_end sub_80D66EC + + thumb_func_start sub_80D6724 +sub_80D6724: @ 80D6724 + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r7, 0 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + beq _080D67B6 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080D6752 + ldr r0, _080D6760 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6768 +_080D6752: + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80D710C + lsls r0, 24 + lsrs r0, 24 + b _080D67B8 + .align 2, 0 +_080D6760: .4byte 0x00004004 +_080D6764: + movs r0, 0x1 + b _080D67B8 +_080D6768: + adds r0, r7, 0 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + movs r6, 0 + ldr r1, _080D677C + lsrs r4, r0, 21 + b _080D67AE + .align 2, 0 +_080D677C: .4byte 0x02039dd8 +_080D6780: + adds r0, r4, r1 + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r7 + bne _080D67A6 + adds r0, r1, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcs _080D6764 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080D6764 +_080D67A6: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080D67C0 +_080D67AE: + adds r0, r4, r1 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _080D6780 +_080D67B6: + movs r0, 0 +_080D67B8: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D67C0: .4byte 0x02039dd8 + thumb_func_end sub_80D6724 + + thumb_func_start sub_80D67C4 +sub_80D67C4: @ 80D67C4 + push {r4,lr} + movs r4, 0x85 +_080D67C8: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D67E4 + ldr r0, _080D67E0 + strh r1, [r0] + movs r0, 0x1 + b _080D67F6 + .align 2, 0 +_080D67E0: .4byte 0x020375f0 +_080D67E4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xB2 + bls _080D67C8 + ldr r1, _080D67FC + movs r0, 0 + strh r0, [r1] + movs r0, 0 +_080D67F6: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D67FC: .4byte 0x020375f0 + thumb_func_end sub_80D67C4 + + thumb_func_start sub_80D6800 +sub_80D6800: @ 80D6800 + 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 r5, r1, 16 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + beq _080D6906 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080D6838 + ldr r0, _080D6848 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D684C +_080D6838: + mov r0, r8 + adds r1, r5, 0 + bl sub_80D7184 + lsls r0, 24 + lsrs r0, 24 + b _080D6916 + .align 2, 0 +_080D6848: .4byte 0x00004004 +_080D684C: + mov r0, r8 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, _080D690C + cmp r2, 0x3 + beq _080D6860 + movs r7, 0x63 +_080D6860: + movs r6, 0 + ldr r1, _080D6910 + lsls r4, r2, 3 + adds r0, r4, r1 + mov r9, r4 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcs _080D68BC + subs r0, r2, 0x2 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_080D6878: + adds r0, r4, r1 + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r8 + bne _080D68AC + adds r0, r1, 0x2 + str r2, [sp] + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r1, r5 + ldr r2, [sp] + cmp r0, r7 + ble _080D6914 + mov r0, r10 + cmp r0, 0x1 + bls _080D6906 + subs r0, r7, r1 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080D6914 +_080D68AC: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _080D6910 + adds r0, r4, r1 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _080D6878 +_080D68BC: + cmp r5, 0 + beq _080D6914 + movs r6, 0 + ldr r3, _080D6910 + mov r1, r9 + adds r0, r1, r3 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcs _080D6902 + adds r4, r3, 0 + subs r0, r2, 0x2 + lsls r0, 24 + lsrs r2, r0, 24 +_080D68D6: + adds r0, r1, r4 + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080D68F2 + cmp r5, r7 + bls _080D6914 + cmp r2, 0x1 + bls _080D6906 + subs r0, r5, r7 + lsls r0, 16 + lsrs r5, r0, 16 +_080D68F2: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r9 + adds r0, r1, r3 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _080D68D6 +_080D6902: + cmp r5, 0 + beq _080D6914 +_080D6906: + movs r0, 0 + b _080D6916 + .align 2, 0 +_080D690C: .4byte 0x000003e7 +_080D6910: .4byte 0x02039dd8 +_080D6914: + movs r0, 0x1 +_080D6916: + 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_80D6800 + + thumb_func_start bag_add_item +bag_add_item: @ 80D6928 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 16 + lsrs r5, r1, 16 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + bne _080D694C + movs r0, 0 + b _080D6A92 +_080D694C: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080D6964 + ldr r0, _080D6974 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6978 +_080D6964: + mov r0, r9 + adds r1, r5, 0 + bl sub_80D7204 + lsls r0, 24 + lsrs r0, 24 + b _080D6A92 + .align 2, 0 +_080D6974: .4byte 0x00004004 +_080D6978: + mov r0, r9 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, r0, 3 + ldr r0, _080D6A38 + adds r7, r1, r0 + ldrb r0, [r7, 0x4] + lsls r0, 2 + bl malloc_and_clear + mov r8, r0 + ldr r1, [r7] + ldrb r2, [r7, 0x4] + lsls r2, 2 + bl memcpy + ldr r2, _080D6A3C + mov r0, r10 + cmp r0, 0x3 + beq _080D69AA + movs r2, 0x63 +_080D69AA: + movs r6, 0 + ldrb r0, [r7, 0x4] + cmp r6, r0 + bcs _080D6A06 + mov r0, r10 + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_080D69BC: + lsls r0, r6, 2 + mov r3, r8 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r9 + bne _080D69FA + adds r4, r1, 0x2 + adds r0, r4, 0 + str r2, [sp, 0x4] + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, r5 + ldr r2, [sp, 0x4] + cmp r1, r2 + ble _080D6A68 + ldr r1, [sp] + cmp r1, 0x1 + bls _080D6A74 + subs r0, r2, r0 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl encrypt_bag_item_quantity + ldr r2, [sp, 0x4] + cmp r5, 0 + beq _080D6A7E +_080D69FA: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r7, 0x4] + cmp r6, r0 + bcc _080D69BC +_080D6A06: + cmp r5, 0 + beq _080D6A7E + movs r6, 0 + cmp r6, r0 + bcs _080D6A62 + mov r0, r10 + subs r0, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 +_080D6A18: + lsls r0, r6, 2 + mov r3, r8 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, 0 + bne _080D6A56 + mov r0, r9 + strh r0, [r1] + cmp r5, r2 + bhi _080D6A40 + adds r0, r1, 0x2 + adds r1, r5, 0 + bl encrypt_bag_item_quantity + b _080D6A7E + .align 2, 0 +_080D6A38: .4byte 0x02039dd8 +_080D6A3C: .4byte 0x000003e7 +_080D6A40: + cmp r4, 0x1 + bls _080D6A74 + subs r0, r5, r2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r1, 0x2 + adds r1, r2, 0 + str r2, [sp, 0x4] + bl encrypt_bag_item_quantity + ldr r2, [sp, 0x4] +_080D6A56: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r7, 0x4] + cmp r6, r1 + bcc _080D6A18 +_080D6A62: + cmp r5, 0 + beq _080D6A7E + b _080D6A74 +_080D6A68: + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl encrypt_bag_item_quantity + b _080D6A7E +_080D6A74: + mov r0, r8 + bl free + movs r0, 0 + b _080D6A92 +_080D6A7E: + ldr r0, [r7] + ldrb r2, [r7, 0x4] + lsls r2, 2 + mov r1, r8 + bl memcpy + mov r0, r8 + bl free + movs r0, 0x1 +_080D6A92: + 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 bag_add_item + + thumb_func_start sub_80D6AA4 +sub_80D6AA4: @ 80D6AA4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r4, 0 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + beq _080D6B38 + mov r0, r8 + cmp r0, 0 + beq _080D6B38 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080D6AE0 + ldr r0, _080D6AF0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6AF4 +_080D6AE0: + mov r0, r8 + adds r1, r7, 0 + bl sub_80D7334 + lsls r0, 24 + lsrs r0, 24 + b _080D6C5A + .align 2, 0 +_080D6AF0: .4byte 0x00004004 +_080D6AF4: + mov r0, r8 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, r0, 3 + ldr r0, _080D6B3C + adds r5, r1, r0 + movs r6, 0 + ldrb r2, [r5, 0x4] + cmp r6, r2 + bcs _080D6B34 +_080D6B10: + ldr r0, [r5] + lsls r1, r6, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r8 + bne _080D6B28 + adds r0, r1, 0x2 + bl decrypt_bag_item_quantity + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_080D6B28: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r5, 0x4] + cmp r6, r0 + bcc _080D6B10 +_080D6B34: + cmp r4, r7 + bcs _080D6B40 +_080D6B38: + movs r0, 0 + b _080D6C5A + .align 2, 0 +_080D6B3C: .4byte 0x02039dd8 +_080D6B40: + bl sub_80E9214 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6B70 + ldr r4, _080D6BB0 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + ldr r0, _080D6BB4 + mov r1, r8 + bl var_set +_080D6B70: + mov r0, r9 + bl sub_81ABB2C + lsls r0, 24 + lsrs r1, r0, 24 + ldrb r0, [r5, 0x4] + cmp r0, r1 + bls _080D6BE6 + ldr r0, [r5] + lsls r1, 2 + adds r2, r1, r0 + ldrh r0, [r2] + adds r4, r1, 0 + cmp r0, r8 + bne _080D6BE6 + adds r0, r2, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r7 + bcc _080D6BB8 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + subs r1, r7 + lsls r1, 16 + lsrs r1, 16 + bl encrypt_bag_item_quantity + movs r7, 0 + b _080D6BCA + .align 2, 0 +_080D6BB0: .4byte 0x000040ee +_080D6BB4: .4byte 0x000040ed +_080D6BB8: + subs r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + movs r1, 0 + bl encrypt_bag_item_quantity +_080D6BCA: + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _080D6BE2 + ldr r0, [r5] + adds r0, r4, r0 + strh r2, [r0] +_080D6BE2: + cmp r7, 0 + beq _080D6C58 +_080D6BE6: + movs r6, 0 + ldrb r0, [r5, 0x4] + cmp r6, r0 + bcs _080D6C58 +_080D6BEE: + ldr r0, [r5] + lsls r1, r6, 2 + adds r2, r1, r0 + ldrh r0, [r2] + adds r4, r1, 0 + cmp r0, r8 + bne _080D6C4C + adds r0, r2, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r7 + bcc _080D6C1E + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + subs r1, r7 + lsls r1, 16 + lsrs r1, 16 + bl encrypt_bag_item_quantity + movs r7, 0 + b _080D6C30 +_080D6C1E: + subs r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + movs r1, 0 + bl encrypt_bag_item_quantity +_080D6C30: + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _080D6C48 + ldr r0, [r5] + adds r0, r4, r0 + strh r2, [r0] +_080D6C48: + cmp r7, 0 + beq _080D6C58 +_080D6C4C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r2, [r5, 0x4] + cmp r6, r2 + bcc _080D6BEE +_080D6C58: + movs r0, 0x1 +_080D6C5A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D6AA4 + + thumb_func_start sub_80D6C68 +sub_80D6C68: @ 80D6C68 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80D6C68 + + thumb_func_start sub_80D6C7C +sub_80D6C7C: @ 80D6C7C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + movs r4, 0 + lsrs r1, 24 + cmp r4, r1 + bcs _080D6CA6 + adds r5, r1, 0 + movs r7, 0 +_080D6C8E: + lsls r0, r4, 2 + adds r0, r6 + strh r7, [r0] + adds r0, 0x2 + movs r1, 0 + bl encrypt_bag_item_quantity + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bcc _080D6C8E +_080D6CA6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D6C7C + + thumb_func_start sub_80D6CAC +sub_80D6CAC: @ 80D6CAC + push {lr} + movs r1, 0 + ldr r0, _080D6CCC + ldr r2, [r0] + movs r3, 0x93 + lsls r3, 3 +_080D6CB8: + lsls r0, r1, 24 + asrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r2, r0 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080D6CD0 + adds r0, r1, 0 + b _080D6CE0 + .align 2, 0 +_080D6CCC: .4byte 0x03005d8c +_080D6CD0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x31 + ble _080D6CB8 + movs r0, 0x1 + negs r0, r0 +_080D6CE0: + pop {r1} + bx r1 + thumb_func_end sub_80D6CAC + + thumb_func_start sub_80D6CE4 +sub_80D6CE4: @ 80D6CE4 + push {r4,lr} + movs r2, 0 + movs r1, 0 + ldr r0, _080D6D18 + ldr r3, [r0] + movs r4, 0x93 + lsls r4, 3 +_080D6CF2: + lsls r0, r1, 2 + adds r0, r3, r0 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _080D6D04 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080D6D04: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x31 + bls _080D6CF2 + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D6D18: .4byte 0x03005d8c + thumb_func_end sub_80D6CE4 + + thumb_func_start sub_80D6D1C +sub_80D6D1C: @ 80D6D1C + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 +_080D6D28: + ldr r0, _080D6D54 + ldr r2, [r0] + lsls r1, r4, 2 + adds r0, r2, r1 + movs r3, 0x93 + lsls r3, 3 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r6 + bne _080D6D5C + adds r0, r1, r2 + ldr r1, _080D6D58 + adds r0, r1 + bl sub_80D6584 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _080D6D5C + movs r0, 0x1 + b _080D6D68 + .align 2, 0 +_080D6D54: .4byte 0x03005d8c +_080D6D58: .4byte 0x0000049a +_080D6D5C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x31 + bls _080D6D28 + movs r0, 0 +_080D6D68: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D6D1C + + thumb_func_start sub_80D6D70 +sub_80D6D70: @ 80D6D70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r0, 0xC8 + bl malloc_and_clear + adds r7, r0, 0 + ldr r0, _080D6DF8 + ldr r1, [r0] + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + adds r0, r7, 0 + movs r2, 0xC8 + bl memcpy + movs r6, 0 +_080D6D9C: + lsls r0, r6, 2 + adds r1, r0, r7 + ldrh r0, [r1] + cmp r0, r8 + bne _080D6DD0 + adds r4, r1, 0x2 + adds r0, r4, 0 + bl sub_80D6584 + lsls r0, 16 + lsrs r2, r0, 16 + adds r1, r2, r5 + ldr r3, _080D6DFC + cmp r1, r3 + ble _080D6E04 + ldr r1, _080D6E00 + adds r0, r5, r1 + adds r0, r2, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_80D6588 + cmp r5, 0 + beq _080D6E20 +_080D6DD0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x31 + bls _080D6D9C + cmp r5, 0 + beq _080D6E20 + bl sub_80D6CAC + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080D6E10 + adds r0, r7, 0 + bl free + movs r0, 0 + b _080D6E3A + .align 2, 0 +_080D6DF8: .4byte 0x03005d8c +_080D6DFC: .4byte 0x000003e7 +_080D6E00: .4byte 0x0000fc19 +_080D6E04: + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80D6588 + b _080D6E20 +_080D6E10: + lsls r0, r1, 2 + adds r0, r7 + mov r1, r8 + strh r1, [r0] + adds r0, 0x2 + adds r1, r5, 0 + bl sub_80D6588 +_080D6E20: + ldr r0, _080D6E44 + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + adds r1, r7, 0 + movs r2, 0xC8 + bl memcpy + adds r0, r7, 0 + bl free + movs r0, 0x1 +_080D6E3A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D6E44: .4byte 0x03005d8c + thumb_func_end sub_80D6D70 + + thumb_func_start sub_80D6E48 +sub_80D6E48: @ 80D6E48 + push {lr} + lsls r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r2, _080D6E7C + ldr r2, [r2] + lsrs r0, 22 + adds r3, r2, r0 + ldr r0, _080D6E80 + adds r2, r3, r0 + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _080D6E76 + movs r2, 0x93 + lsls r2, 3 + adds r0, r3, r2 + strh r1, [r0] + bl sub_80D6E84 +_080D6E76: + pop {r0} + bx r0 + .align 2, 0 +_080D6E7C: .4byte 0x03005d8c +_080D6E80: .4byte 0x0000049a + thumb_func_end sub_80D6E48 + + thumb_func_start sub_80D6E84 +sub_80D6E84: @ 80D6E84 + push {r4-r7,lr} + movs r2, 0 +_080D6E88: + adds r1, r2, 0x1 + lsls r0, r1, 16 + lsrs r4, r0, 16 + adds r6, r1, 0 + cmp r4, 0x31 + bhi _080D6ECA + ldr r0, _080D6ED8 + mov r12, r0 + lsls r5, r2, 2 + movs r7, 0x93 + lsls r7, 3 +_080D6E9E: + mov r0, r12 + ldr r1, [r0] + adds r0, r1, r5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + bne _080D6EC0 + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + adds r2, r1, r5 + ldr r3, [r2] + lsls r0, r4, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + str r3, [r1] +_080D6EC0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x31 + bls _080D6E9E +_080D6ECA: + lsls r0, r6, 16 + lsrs r2, r0, 16 + cmp r2, 0x30 + bls _080D6E88 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D6ED8: .4byte 0x03005d8c + thumb_func_end sub_80D6E84 + + thumb_func_start sub_80D6EDC +sub_80D6EDC: @ 80D6EDC + push {lr} + ldr r0, _080D6EF8 + ldr r0, [r0] + ldr r2, _080D6EFC + adds r1, r0, r2 + ldrh r2, [r1] + ldr r3, _080D6F00 + cmp r2, r3 + beq _080D6F04 + movs r0, 0x88 + lsls r0, 1 + cmp r2, r0 + beq _080D6F0C + b _080D6F0E + .align 2, 0 +_080D6EF8: .4byte 0x03005d8c +_080D6EFC: .4byte 0x00000496 +_080D6F00: .4byte 0x00000103 +_080D6F04: + movs r0, 0x88 + lsls r0, 1 + strh r0, [r1] + b _080D6F0E +_080D6F0C: + strh r3, [r1] +_080D6F0E: + pop {r0} + bx r0 + thumb_func_end sub_80D6EDC + + thumb_func_start bag_pocket_get_itemid +bag_pocket_get_itemid: @ 80D6F14 + lsls r0, 24 + lsls r1, 16 + ldr r2, _080D6F2C + lsrs r0, 21 + subs r0, 0x8 + adds r0, r2 + ldr r0, [r0] + lsrs r1, 14 + adds r1, r0 + ldrh r0, [r1] + bx lr + .align 2, 0 +_080D6F2C: .4byte 0x02039dd8 + thumb_func_end bag_pocket_get_itemid + + thumb_func_start bag_pocket_get_item_quantity +bag_pocket_get_item_quantity: @ 80D6F30 + push {lr} + lsls r0, 24 + lsls r1, 16 + ldr r2, _080D6F54 + lsrs r0, 21 + subs r0, 0x8 + adds r0, r2 + lsrs r1, 14 + ldr r0, [r0] + adds r0, r1 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080D6F54: .4byte 0x02039dd8 + thumb_func_end bag_pocket_get_item_quantity + + thumb_func_start swap32 +swap32: @ 80D6F58 + ldr r3, [r0] + ldr r2, [r1] + str r2, [r0] + str r3, [r1] + bx lr + thumb_func_end swap32 + + thumb_func_start sub_80D6F64 +sub_80D6F64: @ 80D6F64 + push {r4-r7,lr} + adds r6, r0, 0 + movs r3, 0 + b _080D6FA6 +_080D6F6C: + adds r1, r3, 0x1 + lsls r0, r1, 16 + lsrs r4, r0, 16 + adds r7, r1, 0 + cmp r4, r2 + bcs _080D6FA2 + lsls r5, r3, 2 +_080D6F7A: + ldr r0, [r6] + adds r0, r5 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + cmp r0, 0 + bne _080D6F96 + ldr r1, [r6] + adds r0, r1, r5 + lsls r2, r4, 2 + adds r1, r2 + bl swap32 +_080D6F96: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r6, 0x4] + cmp r4, r0 + bcc _080D6F7A +_080D6FA2: + lsls r0, r7, 16 + lsrs r3, r0, 16 +_080D6FA6: + ldrb r2, [r6, 0x4] + subs r0, r2, 0x1 + cmp r3, r0 + blt _080D6F6C + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D6F64 + + thumb_func_start sub_80D6FB4 +sub_80D6FB4: @ 80D6FB4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + movs r3, 0 + b _080D701A +_080D6FC0: + adds r1, r3, 0x1 + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r8, r1 + cmp r5, r2 + bcs _080D7014 + lsls r7, r3, 2 +_080D6FCE: + ldr r0, [r6] + adds r0, r7 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsls r4, r5, 2 + cmp r0, 0 + beq _080D6FFE + ldr r0, [r6] + adds r0, r4 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + cmp r0, 0 + beq _080D7008 + ldr r0, [r6] + adds r1, r7, r0 + adds r0, r4, r0 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bls _080D7008 +_080D6FFE: + ldr r1, [r6] + adds r0, r1, r7 + adds r1, r4 + bl swap32 +_080D7008: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r6, 0x4] + cmp r5, r0 + bcc _080D6FCE +_080D7014: + mov r1, r8 + lsls r0, r1, 16 + lsrs r3, r0, 16 +_080D701A: + ldrb r2, [r6, 0x4] + subs r0, r2, 0x1 + cmp r3, r0 + blt _080D6FC0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D6FB4 + + thumb_func_start sub_80D702C +sub_80D702C: @ 80D702C + push {r4-r6,lr} + adds r4, r0, 0 + adds r3, r2, 0 + cmp r1, r3 + beq _080D708C + lsls r0, r1, 2 + adds r0, r4 + ldr r6, [r0] + cmp r3, r1 + bls _080D7064 + subs r3, 0x1 + lsls r1, 16 + lsls r0, r3, 16 + asrs r2, r0, 16 + cmp r1, r0 + bge _080D7086 + adds r5, r2, 0 +_080D704E: + asrs r2, r1, 16 + lsls r0, r2, 2 + adds r0, r4 + ldr r1, [r0, 0x4] + str r1, [r0] + adds r2, 0x1 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r5 + blt _080D704E + b _080D7086 +_080D7064: + lsls r1, 16 + lsls r0, r3, 16 + asrs r2, r0, 16 + cmp r1, r0 + ble _080D7086 + adds r5, r2, 0 +_080D7070: + asrs r2, r1, 16 + lsls r1, r2, 2 + adds r1, r4 + subs r0, r1, 0x4 + ldr r0, [r0] + str r0, [r1] + subs r2, 0x1 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r5 + bgt _080D7070 +_080D7086: + lsls r0, r3, 2 + adds r0, r4 + str r6, [r0] +_080D708C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D702C + + thumb_func_start sub_80D7094 +sub_80D7094: @ 80D7094 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080D70B8 +_080D709A: + lsls r1, r4, 3 + adds r1, r5 + ldr r0, [r1] + ldrb r1, [r1, 0x4] + bl sub_80D6C7C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _080D709A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D70B8: .4byte 0x02039dd8 + thumb_func_end sub_80D7094 + + thumb_func_start sub_80D70BC +sub_80D70BC: @ 80D70BC + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + adds r0, r6, 0 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 21 + ldr r1, _080D7108 + adds r5, r0, r1 + movs r4, 0 + ldrb r0, [r5, 0x4] + cmp r7, r0 + bcs _080D70FE +_080D70DA: + ldr r0, [r5] + lsls r1, r4, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r6 + bne _080D70F2 + adds r0, r1, 0x2 + bl decrypt_bag_item_quantity + adds r0, r7, r0 + lsls r0, 16 + lsrs r7, r0, 16 +_080D70F2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r5, 0x4] + cmp r4, r0 + bcc _080D70DA +_080D70FE: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080D7108: .4byte 0x02039dd0 + thumb_func_end sub_80D70BC + + thumb_func_start sub_80D710C +sub_80D710C: @ 80D710C + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, _080D7160 + ldr r3, [r0] + ldr r1, _080D7164 + 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, _080D7168 + adds r0, r2 + adds r2, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, _080D716C + adds r0, r1 + adds r3, r0 + movs r1, 0 +_080D7140: + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r5 + bne _080D7170 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, r4 + bcs _080D715C + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _080D7170 +_080D715C: + movs r0, 0x1 + b _080D717C + .align 2, 0 +_080D7160: .4byte 0x03005d90 +_080D7164: .4byte 0x00000ca9 +_080D7168: .4byte 0x00000e2c +_080D716C: .4byte 0x00000e54 +_080D7170: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _080D7140 + movs r0, 0 +_080D717C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D710C + + thumb_func_start sub_80D7184 +sub_80D7184: @ 80D7184 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, _080D71E0 + ldr r3, [r0] + ldr r1, _080D71E4 + 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, _080D71E8 + adds r0, r2 + adds r2, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, _080D71EC + adds r0, r1 + adds r3, r0 + movs r1, 0 +_080D71B8: + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r5 + beq _080D71C6 + cmp r0, 0 + bne _080D71F0 +_080D71C6: + adds r0, r3, r1 + ldrb r0, [r0] + adds r0, r4 + cmp r0, 0x63 + ble _080D71DA + subs r0, 0x63 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _080D71F0 +_080D71DA: + movs r0, 0x1 + b _080D71FC + .align 2, 0 +_080D71E0: .4byte 0x03005d90 +_080D71E4: .4byte 0x00000ca9 +_080D71E8: .4byte 0x00000e2c +_080D71EC: .4byte 0x00000e54 +_080D71F0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _080D71B8 + movs r0, 0 +_080D71FC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D7184 + + thumb_func_start sub_80D7204 +sub_80D7204: @ 80D7204 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, _080D7294 + ldr r3, [r0] + ldr r1, _080D7298 + 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, _080D729C + adds r0, r2 + adds r0, r3 + mov r9, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, _080D72A0 + adds r0, r1 + adds r3, r0 + mov r8, r3 + movs r0, 0x14 + bl malloc + adds r5, r0, 0 + movs r0, 0xA + bl malloc + adds r6, r0, 0 + adds r0, r5, 0 + mov r1, r9 + movs r2, 0x14 + bl memcpy + adds r0, r6, 0 + mov r1, r8 + movs r2, 0xA + bl memcpy + movs r2, 0 +_080D7266: + lsls r0, r2, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, r7 + bne _080D72AA + adds r1, r6, r2 + ldrb r0, [r1] + cmp r0, 0x62 + bhi _080D72AA + adds r0, r4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x63 + bls _080D72A4 + ldrb r0, [r1] + subs r0, 0x63 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x63 + strb r0, [r1] + b _080D72A6 + .align 2, 0 +_080D7294: .4byte 0x03005d90 +_080D7298: .4byte 0x00000ca9 +_080D729C: .4byte 0x00000e2c +_080D72A0: .4byte 0x00000e54 +_080D72A4: + movs r4, 0 +_080D72A6: + cmp r4, 0 + beq _080D7304 +_080D72AA: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _080D7266 + cmp r4, 0 + beq _080D7304 + movs r2, 0 +_080D72BA: + lsls r0, r2, 1 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + bne _080D72E6 + strh r7, [r1] + adds r1, r6, r2 + strb r4, [r1] + lsls r0, r4, 24 + lsrs r0, 24 + cmp r0, 0x63 + bls _080D72E0 + ldrb r0, [r1] + subs r0, 0x63 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x63 + strb r0, [r1] + b _080D72E2 +_080D72E0: + movs r4, 0 +_080D72E2: + cmp r4, 0 + beq _080D7304 +_080D72E6: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _080D72BA + cmp r4, 0 + beq _080D7304 + adds r0, r5, 0 + bl free + adds r0, r6, 0 + bl free + movs r0, 0 + b _080D7326 +_080D7304: + mov r0, r9 + adds r1, r5, 0 + movs r2, 0x14 + bl memcpy + mov r0, r8 + adds r1, r6, 0 + movs r2, 0xA + bl memcpy + adds r0, r5, 0 + bl free + adds r0, r6, 0 + bl free + movs r0, 0x1 +_080D7326: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D7204 + + thumb_func_start sub_80D7334 +sub_80D7334: @ 80D7334 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, _080D73A0 + ldr r3, [r0] + ldr r1, _080D73A4 + 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, _080D73A8 + adds r0, r2 + adds r0, r3 + mov r8, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, _080D73AC + adds r0, r1 + adds r7, r3, r0 + ldr r1, _080D73B0 + ldrh r0, [r1, 0x8] + ldrh r1, [r1, 0x6] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 1 + mov r1, r8 + adds r3, r0, r1 + ldrh r0, [r3] + cmp r0, r9 + bne _080D73B4 + adds r1, r7, r2 + ldrb r0, [r1] + cmp r0, r4 + bcc _080D73B4 + subs r0, r4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080D744C + strh r0, [r3] + b _080D744C + .align 2, 0 +_080D73A0: .4byte 0x03005d90 +_080D73A4: .4byte 0x00000ca9 +_080D73A8: .4byte 0x00000e2c +_080D73AC: .4byte 0x00000e54 +_080D73B0: .4byte 0x0203cf30 +_080D73B4: + movs r0, 0x14 + bl malloc + adds r5, r0, 0 + movs r0, 0xA + bl malloc + adds r6, r0, 0 + adds r0, r5, 0 + mov r1, r8 + movs r2, 0x14 + bl memcpy + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0xA + bl memcpy + movs r2, 0 +_080D73DA: + lsls r0, r2, 1 + adds r3, r0, r5 + ldrh r0, [r3] + cmp r0, r9 + bne _080D740E + adds r1, r6, r2 + ldrb r0, [r1] + cmp r0, r4 + bcc _080D73FC + subs r0, r4 + strb r0, [r1] + movs r4, 0 + lsls r0, 24 + cmp r0, 0 + bne _080D740A + strh r4, [r3] + b _080D740A +_080D73FC: + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0 + strb r0, [r1] + movs r0, 0 + strh r0, [r3] +_080D740A: + cmp r4, 0 + beq _080D742C +_080D740E: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _080D73DA + cmp r4, 0 + beq _080D742C + adds r0, r5, 0 + bl free + adds r0, r6, 0 + bl free + movs r0, 0 + b _080D744E +_080D742C: + mov r0, r8 + adds r1, r5, 0 + movs r2, 0x14 + bl memcpy + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0xA + bl memcpy + adds r0, r5, 0 + bl free + adds r0, r6, 0 + bl free +_080D744C: + movs r0, 0x1 +_080D744E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D7334 + + thumb_func_start itemid_sanitize +itemid_sanitize: @ 80D745C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xBC + lsls r0, 1 + cmp r1, r0 + bhi _080D746E + adds r0, r1, 0 + b _080D7470 +_080D746E: + movs r0, 0 +_080D7470: + pop {r1} + bx r1 + thumb_func_end itemid_sanitize + + thumb_func_start itemid_get_item +itemid_get_item: @ 80D7474 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + ldr r1, _080D7490 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_080D7490: .4byte 0x085839a0 + thumb_func_end itemid_get_item + + thumb_func_start itemid_get_number +itemid_get_number: @ 80D7494 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D74B4 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrh r0, [r0, 0xE] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D74B4: .4byte 0x085839a0 + thumb_func_end itemid_get_number + + thumb_func_start itemid_get_market_price +itemid_get_market_price: @ 80D74B8 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D74D8 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrh r0, [r0, 0x10] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D74D8: .4byte 0x085839a0 + thumb_func_end itemid_get_market_price + + thumb_func_start itemid_get_x12 +itemid_get_x12: @ 80D74DC + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D74FC + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x12] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D74FC: .4byte 0x085839a0 + thumb_func_end itemid_get_x12 + + thumb_func_start itemid_get_quality +itemid_get_quality: @ 80D7500 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D7520 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x13] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D7520: .4byte 0x085839a0 + thumb_func_end itemid_get_quality + + thumb_func_start itemid_get_description +itemid_get_description: @ 80D7524 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D7544 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r4, 0x14 + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D7544: .4byte 0x085839a0 + thumb_func_end itemid_get_description + + thumb_func_start itemid_is_unique +itemid_is_unique: @ 80D7548 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D7568 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x18] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D7568: .4byte 0x085839a0 + thumb_func_end itemid_is_unique + + thumb_func_start itemid_get_x19 +itemid_get_x19: @ 80D756C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D758C + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x19] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D758C: .4byte 0x085839a0 + thumb_func_end itemid_get_x19 + + thumb_func_start itemid_get_pocket_number +itemid_get_pocket_number: @ 80D7590 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D75B0 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x1A] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D75B0: .4byte 0x085839a0 + thumb_func_end itemid_get_pocket_number + + thumb_func_start itemid_get_type +itemid_get_type: @ 80D75B4 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D75D4 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x1B] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D75D4: .4byte 0x085839a0 + thumb_func_end itemid_get_type + + thumb_func_start itemid_get_overworld_function +itemid_get_overworld_function: @ 80D75D8 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D75F8 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r4, 0x1C + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D75F8: .4byte 0x085839a0 + thumb_func_end itemid_get_overworld_function + + thumb_func_start itemid_get_usage +itemid_get_usage: @ 80D75FC + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D761C + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D761C: .4byte 0x085839a0 + thumb_func_end itemid_get_usage + + thumb_func_start itemid_get_battle_function +itemid_get_battle_function: @ 80D7620 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D7640 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r4, 0x24 + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D7640: .4byte 0x085839a0 + thumb_func_end itemid_get_battle_function + + thumb_func_start itemid_get_x28 +itemid_get_x28: @ 80D7644 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _080D7664 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + adds r0, 0x28 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080D7664: .4byte 0x085839a0 + thumb_func_end itemid_get_x28 + + thumb_func_start nullsub_41 +nullsub_41: @ 80D7668 + bx lr + thumb_func_end nullsub_41 + + thumb_func_start sub_80D766C +sub_80D766C: @ 80D766C + ldr r1, _080D7674 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_080D7674: .4byte 0x02039f2a + thumb_func_end sub_80D766C + + thumb_func_start sub_80D7678 +sub_80D7678: @ 80D7678 + push {r4,lr} + movs r0, 0 + movs r1, 0x40 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r4, _080D76F0 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + movs r1, 0xFE + lsls r1, 7 + movs r0, 0 + bl lcd_io_set_bits + ldr r0, _080D76F4 + movs r1, 0 + strh r1, [r0] + ldr r0, _080D76F8 + strh r1, [r0] + ldr r0, _080D76FC + strh r1, [r0] + ldr r0, _080D7700 + strh r1, [r0] + ldr r0, _080D7704 + strh r1, [r0] + ldr r0, _080D7708 + strh r1, [r0] + ldr r0, _080D770C + strh r1, [r0] + ldr r0, _080D7710 + strh r1, [r0] + ldr r0, _080D7714 + strh r1, [r0] + ldr r0, _080D7718 + strh r1, [r0] + ldr r0, _080D771C + strh r1, [r0] + ldr r0, _080D7720 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D76F0: .4byte 0x00003f3f +_080D76F4: .4byte 0x02022e14 +_080D76F8: .4byte 0x02022e16 +_080D76FC: .4byte 0x02022e18 +_080D7700: .4byte 0x02022e1a +_080D7704: .4byte 0x02022e1c +_080D7708: .4byte 0x02022e1e +_080D770C: .4byte 0x02022e20 +_080D7710: .4byte 0x02022e22 +_080D7714: .4byte 0x02022e24 +_080D7718: .4byte 0x02022e26 +_080D771C: .4byte 0x02022e28 +_080D7720: .4byte 0x02022e2a + thumb_func_end sub_80D7678 + + thumb_func_start sub_80D7724 +sub_80D7724: @ 80D7724 + push {r4,r5,lr} + ldr r0, _080D7780 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + ldr r0, _080D7784 + ldr r1, _080D7788 + bl call_LZZUnCompVram + ldr r1, _080D778C + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _080D7790 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl decompress_palette + bl sub_80D782C + movs r4, 0 + movs r5, 0xA0 +_080D775E: + ldr r0, _080D7794 + adds r0, r5, r0 + ldr r1, _080D7798 + adds r1, r4, r1 + ldrb r1, [r1] + adds r1, 0x5 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + adds r5, 0x20 + adds r4, 0x1 + cmp r4, 0x3 + ble _080D775E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D7780: .4byte 0x08c17ab0 +_080D7784: .4byte 0x08c1850c +_080D7788: .4byte 0x06002000 +_080D778C: .4byte 0x08c16fa8 +_080D7790: .4byte 0x08c16e90 +_080D7794: .4byte 0x0201a004 +_080D7798: .4byte 0x02039f26 + thumb_func_end sub_80D7724 + + thumb_func_start sub_80D779C +sub_80D779C: @ 80D779C + push {r4,lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080D77DC + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0x3 + movs r1, 0x6 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r4, 0 +_080D77BA: + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, _080D77E0 + ldr r1, [r1] + lsls r2, r4, 2 + adds r1, 0x24 + adds r1, r2 + ldr r1, [r1] + bl bg_set_tilemap + adds r4, 0x1 + cmp r4, 0x3 + ble _080D77BA + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D77DC: .4byte 0x08587f34 +_080D77E0: .4byte 0x02039f34 + thumb_func_end sub_80D779C + + thumb_func_start sub_80D77E4 +sub_80D77E4: @ 80D77E4 + push {lr} + ldr r0, _080D780C + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r0, _080D7810 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D7818 + ldr r2, _080D7814 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _080D7822 + .align 2, 0 +_080D780C: .4byte 0x08587f44 +_080D7810: .4byte 0x02039f2a +_080D7814: .4byte 0x03003014 +_080D7818: + ldr r0, _080D7828 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_080D7822: + pop {r0} + bx r0 + .align 2, 0 +_080D7828: .4byte 0x03003014 + thumb_func_end sub_80D77E4 + + thumb_func_start sub_80D782C +sub_80D782C: @ 80D782C + push {r4,r5,lr} + ldr r0, _080D7870 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + movs r5, 0xA + movs r4, 0xFA + lsls r4, 16 +_080D7848: + lsrs r1, r4, 16 + ldr r0, _080D7874 + movs r2, 0x2 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0xD + ble _080D7848 + ldr r0, _080D7878 + movs r1, 0xF3 + movs r2, 0x2 + bl rboxid_80040B8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D7870: .4byte 0x08587c30 +_080D7874: .4byte 0x020378f6 +_080D7878: .4byte 0x00007e3f + thumb_func_end sub_80D782C + + thumb_func_start sub_80D787C +sub_80D787C: @ 80D787C + push {r4-r7,lr} + ldr r4, _080D797C + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x5C + bl memset + movs r5, 0 + movs r2, 0xFF +_080D7890: + ldr r0, [r4] + ldr r1, [r0] + adds r1, 0x2 + adds r1, r5 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x3 + ble _080D7890 + movs r4, 0 + ldr r6, _080D797C + movs r5, 0x3 +_080D78AA: + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0 + movs r2, 0x1C + bl memset + adds r4, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _080D78AA + ldr r4, _080D797C + movs r7, 0x4 + negs r7, r7 + movs r6, 0xFF + movs r3, 0 + movs r5, 0x3 +_080D78CC: + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r2, [r1, 0xB] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0xB] + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r0, [r1, 0x13] + orrs r0, r6 + strb r0, [r1, 0x13] + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r0, [r1, 0x14] + orrs r0, r6 + strb r0, [r1, 0x14] + adds r3, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _080D78CC + ldr r4, _080D797C + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r1, 0 + movs r2, 0x14 + bl memset + ldr r0, [r4] + ldr r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x44 + bl memset + ldr r2, [r4] + ldr r1, [r2, 0x10] + movs r0, 0 + str r0, [r1] + ldr r0, [r2, 0x14] + movs r1, 0 + movs r2, 0x10 + bl memset + ldr r0, _080D7980 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080D7938 + movs r0, 0 + bl sub_80DCE58 +_080D7938: + movs r5, 0 + adds r2, r4, 0 + movs r6, 0xFF + movs r3, 0 + ldr r4, _080D7984 +_080D7942: + ldr r0, [r2] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r0, [r1, 0x19] + orrs r0, r6 + strb r0, [r1, 0x19] + ldr r0, [r2] + ldr r1, [r0] + adds r1, 0x14 + adds r1, r5 + adds r0, r5, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080D7942 + bl sub_80DD590 + ldr r0, _080D797C + ldr r0, [r0] + ldr r0, [r0, 0x1C] + movs r1, 0 + movs r2, 0x40 + bl memset + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D797C: .4byte 0x02039f34 +_080D7980: .4byte 0x02039f2a +_080D7984: .4byte 0x02039f26 + thumb_func_end sub_80D787C + + thumb_func_start sub_80D7988 +sub_80D7988: @ 80D7988 + push {r4,r5,lr} + ldr r4, _080D7A50 + movs r0, 0x40 + bl malloc_and_clear + str r0, [r4] + movs r0, 0x5C + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1] + movs r0, 0x70 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x14 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x8] + movs r0, 0x44 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0xC] + movs r0, 0x10 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0x10 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x14] + movs r0, 0x14 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x18] + movs r0, 0x40 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x1C] + movs r0, 0xC + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x20] + movs r5, 0x80 + lsls r5, 5 + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x24] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x28] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x2C] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x30] + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x34] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x38] + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + ldr r2, [r4] + str r0, [r2, 0x3C] + ldr r1, _080D7A54 + str r0, [r1] + ldr r1, _080D7A58 + ldr r0, [r2, 0x28] + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D7A50: .4byte 0x02039f34 +_080D7A54: .4byte 0x0202305c +_080D7A58: .4byte 0x02023060 + thumb_func_end sub_80D7988 + + thumb_func_start sub_80D7A5C +sub_80D7A5C: @ 80D7A5C + push {r4,r5,lr} + ldr r5, _080D7B18 + ldr r0, [r5] + ldr r0, [r0] + bl free + ldr r0, [r5] + movs r4, 0 + str r4, [r0] + ldr r0, [r0, 0x4] + bl free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0, 0x8] + bl free + ldr r0, [r5] + str r4, [r0, 0x8] + ldr r0, [r0, 0xC] + bl free + ldr r0, [r5] + str r4, [r0, 0xC] + ldr r0, [r0, 0x10] + bl free + ldr r0, [r5] + str r4, [r0, 0x10] + ldr r0, [r0, 0x14] + bl free + ldr r0, [r5] + str r4, [r0, 0x14] + ldr r0, [r0, 0x18] + bl free + ldr r0, [r5] + str r4, [r0, 0x18] + ldr r0, [r0, 0x1C] + bl free + ldr r0, [r5] + str r4, [r0, 0x1C] + ldr r0, [r0, 0x20] + bl free + ldr r0, [r5] + str r4, [r0, 0x20] + ldr r0, [r0, 0x24] + bl free + ldr r0, [r5] + str r4, [r0, 0x24] + ldr r0, [r0, 0x28] + bl free + ldr r0, [r5] + str r4, [r0, 0x28] + ldr r0, [r0, 0x2C] + bl free + ldr r0, [r5] + str r4, [r0, 0x2C] + ldr r0, [r0, 0x30] + bl free + ldr r0, [r5] + str r4, [r0, 0x30] + ldr r0, [r0, 0x34] + bl free + ldr r0, [r5] + str r4, [r0, 0x34] + ldr r0, [r0, 0x38] + bl free + ldr r0, [r5] + str r4, [r0, 0x38] + ldr r0, [r0, 0x3C] + bl free + ldr r0, [r5] + str r4, [r0, 0x3C] + bl free + str r4, [r5] + ldr r0, _080D7B1C + str r4, [r0] + ldr r0, _080D7B20 + str r4, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D7B18: .4byte 0x02039f34 +_080D7B1C: .4byte 0x0202305c +_080D7B20: .4byte 0x02023060 + thumb_func_end sub_80D7A5C + + thumb_func_start sub_80D7B24 +sub_80D7B24: @ 80D7B24 + push {r4-r6,lr} + ldr r0, _080D7B40 + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r5, [r6] + cmp r5, 0x1 + beq _080D7BD4 + cmp r5, 0x1 + bgt _080D7B44 + cmp r5, 0 + beq _080D7B4E + b _080D7C56 + .align 2, 0 +_080D7B40: .4byte 0x030022c0 +_080D7B44: + cmp r5, 0x2 + beq _080D7BDA + cmp r5, 0x3 + beq _080D7C04 + b _080D7C56 +_080D7B4E: + ldr r0, _080D7BC0 + strb r5, [r0] + bl sub_80D7988 + bl init_uns_table_pokemon_copy + ldr r4, _080D7BC4 + ldr r0, [r4] + ldr r0, [r0] + bl free + ldr r0, [r4] + str r5, [r0] + movs r0, 0x80 + lsls r0, 7 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + bl sub_80D779C + bl sub_80D77E4 + bl sub_80D7678 + bl dp12_8087EA4 + bl sub_80A1A74 + ldr r2, _080D7BC8 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + bl reset_all_obj_data + bl clear_tasks + bl gpu_pal_allocator_reset + ldr r1, _080D7BCC + movs r0, 0x4 + strb r0, [r1] + ldr r0, _080D7BD0 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + strb r5, [r0] + bl sub_806E414 + bl sub_80D787C + b _080D7BF6 + .align 2, 0 +_080D7BC0: .4byte 0x02039f38 +_080D7BC4: .4byte 0x020244d4 +_080D7BC8: .4byte 0x02037fd4 +_080D7BCC: .4byte 0x0300301c +_080D7BD0: .4byte 0x02000000 +_080D7BD4: + movs r0, 0x2 + strb r0, [r6] + b _080D7C56 +_080D7BDA: + ldr r4, _080D7C00 + ldr r0, [r4] + ldr r0, [r0] + adds r0, 0x59 + bl sub_80D7E44 + lsls r0, 24 + cmp r0, 0 + beq _080D7C56 + ldr r0, [r4] + ldr r0, [r0] + adds r0, 0x59 + movs r1, 0 + strb r1, [r0] +_080D7BF6: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _080D7C56 + .align 2, 0 +_080D7C00: .4byte 0x02039f34 +_080D7C04: + bl sub_80DE224 + ldr r0, _080D7C5C + movs r1, 0 + strh r1, [r0] + ldr r0, _080D7C60 + strh r1, [r0] + movs r0, 0x2 + bl sub_80A2390 + ldr r2, _080D7C64 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, _080D7C68 + bl SetVBlankCallback + ldr r0, _080D7C6C + movs r1, 0xA + bl AddTask + ldr r1, _080D7C70 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0x8] + ldr r0, _080D7C74 + bl set_callback2 + ldr r0, _080D7C78 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D7C56 + bl sub_800E0E8 + movs r0, 0x8 + movs r1, 0x8 + bl sub_800DFB4 +_080D7C56: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D7C5C: .4byte 0x02022e18 +_080D7C60: .4byte 0x02022e1a +_080D7C64: .4byte 0x02037fd4 +_080D7C68: .4byte vblank_cb_battle + 1 +_080D7C6C: .4byte sub_80D7C7C + 1 +_080D7C70: .4byte 0x02039f34 +_080D7C74: .4byte sub_80D823C + 1 +_080D7C78: .4byte 0x02039f2a + thumb_func_end sub_80D7B24 + + thumb_func_start sub_80D7C7C +sub_80D7C7C: @ 80D7C7C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _080D7CA8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080D7CA2 + ldr r0, _080D7CAC + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0x8] + ldr r0, _080D7CB0 + str r0, [r1] +_080D7CA2: + pop {r0} + bx r0 + .align 2, 0 +_080D7CA8: .4byte 0x02037fd4 +_080D7CAC: .4byte 0x03005e00 +_080D7CB0: .4byte sub_80D7CB4 + 1 + thumb_func_end sub_80D7C7C + + thumb_func_start sub_80D7CB4 +sub_80D7CB4: @ 80D7CB4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080D7CEC + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D7D90 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D7D3A + ldr r2, _080D7CF0 + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r4, r0, r2 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r6, r1, 0 + cmp r0, 0x1 + beq _080D7D04 + cmp r0, 0x1 + bgt _080D7CF4 + cmp r0, 0 + beq _080D7CFA + b _080D7D3A + .align 2, 0 +_080D7CEC: .4byte 0x02039f2a +_080D7CF0: .4byte 0x03005e00 +_080D7CF4: + cmp r0, 0x2 + beq _080D7D28 + b _080D7D3A +_080D7CFA: + bl sub_80DBF68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080D7D04: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080D7D9E + bl sub_800ADF8 + ldr r0, _080D7D24 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080D7D9E + .align 2, 0 +_080D7D24: .4byte 0x03005e00 +_080D7D28: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D7D9E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080D7D3A: + ldr r2, _080D7D7C + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080D7D9E + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, _080D7D80 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080D7D62 + bl sub_80DBF68 +_080D7D62: + ldr r0, _080D7D84 + movs r1, 0 + bl AddTask + ldr r1, _080D7D88 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + ldr r1, _080D7D8C + str r1, [r0] + b _080D7D9E + .align 2, 0 +_080D7D7C: .4byte 0x02037fd4 +_080D7D80: .4byte 0x02039f2a +_080D7D84: .4byte sub_80D7DAC + 1 +_080D7D88: .4byte 0x03005e00 +_080D7D8C: .4byte nullsub_41 + 1 +_080D7D90: + ldr r0, _080D7DA4 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D7DA8 + str r0, [r1] +_080D7D9E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080D7DA4: .4byte 0x03005e00 +_080D7DA8: .4byte sub_80D80C8 + 1 + thumb_func_end sub_80D7CB4 + + thumb_func_start sub_80D7DAC +sub_80D7DAC: @ 80D7DAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080D7DC0 + ldr r2, _080D7DC4 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_080D7DC0: .4byte sub_80FC998 + 1 +_080D7DC4: .4byte sub_80D7DC8 + 1 + thumb_func_end sub_80D7DAC + + thumb_func_start sub_80D7DC8 +sub_80D7DC8: @ 80D7DC8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D7DE0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + ldr r0, _080D7DE4 + str r0, [r1] + bx lr + .align 2, 0 +_080D7DE0: .4byte 0x03005e00 +_080D7DE4: .4byte sub_80D7DE8 + 1 + thumb_func_end sub_80D7DC8 + + thumb_func_start sub_80D7DE8 +sub_80D7DE8: @ 80D7DE8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _080D7E30 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bgt _080D7E2A + bl link_get_multiplayer_id + adds r0, r4, 0 + bl remove_task + ldr r0, _080D7E34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldr r1, _080D7E38 + str r1, [r0] + ldr r1, _080D7E3C + ldr r0, _080D7E40 + ldr r0, [r0] + str r0, [r1] +_080D7E2A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D7E30: .4byte 0x03005e00 +_080D7E34: .4byte 0x02039f34 +_080D7E38: .4byte sub_80D80C8 + 1 +_080D7E3C: .4byte 0x03005d80 +_080D7E40: .4byte 0x030060b8 + thumb_func_end sub_80D7DE8 + + thumb_func_start sub_80D7E44 +sub_80D7E44: @ 80D7E44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + mov r10, r0 + ldrb r0, [r0] + cmp r0, 0x6 + bls _080D7E5A + b _080D80A4 +_080D7E5A: + lsls r0, 2 + ldr r1, _080D7E64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D7E64: .4byte _080D7E68 + .align 2, 0 +_080D7E68: + .4byte _080D7E84 + .4byte _080D7EC8 + .4byte _080D7ED8 + .4byte _080D7F28 + .4byte _080D7F40 + .4byte _080D7F7C + .4byte _080D8004 +_080D7E84: + ldr r2, _080D7EBC + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + movs r1, 0xC0 + lsls r1, 19 + movs r4, 0x80 + lsls r4, 8 + movs r0, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldr r1, _080D7EC0 + movs r0, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldr r1, _080D7EC4 + movs r0, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + b _080D80AE + .align 2, 0 +_080D7EBC: .4byte 0x02037fd4 +_080D7EC0: .4byte 0x06008000 +_080D7EC4: .4byte 0x06010000 +_080D7EC8: + ldr r0, _080D7ED4 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + b _080D80AE + .align 2, 0 +_080D7ED4: .4byte 0x08c17ab0 +_080D7ED8: + ldr r0, _080D7F14 + ldr r4, _080D7F18 + adds r1, r4, 0 + bl call_LZZUnCompVram + ldr r3, _080D7F1C + movs r5, 0x80 + lsls r5, 6 + ldr r1, _080D7F20 + ldr r6, _080D7F24 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x84 + lsls r7, 24 +_080D7EF4: + str r4, [r1] + str r3, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r4, r2 + adds r3, r2 + subs r5, r2 + cmp r5, r2 + bhi _080D7EF4 + str r4, [r1] + str r3, [r1, 0x4] + lsrs r0, r5, 2 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + b _080D80AE + .align 2, 0 +_080D7F14: .4byte 0x08c1850c +_080D7F18: .4byte 0x06002000 +_080D7F1C: .4byte 0x02018000 +_080D7F20: .4byte 0x040000d4 +_080D7F24: .4byte 0x84000400 +_080D7F28: + ldr r1, _080D7F3C + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _080D80AE + .align 2, 0 +_080D7F3C: .4byte 0x08c16fa8 +_080D7F40: + ldr r1, _080D7F68 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _080D7F6C + ldr r0, [r0] + ldr r1, [r0, 0x2C] + ldr r2, _080D7F70 + ldr r0, _080D7F74 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _080D7F78 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + b _080D80AE + .align 2, 0 +_080D7F68: .4byte 0x08c17170 +_080D7F6C: .4byte 0x02039f34 +_080D7F70: .4byte 0x0201aa04 +_080D7F74: .4byte 0x040000d4 +_080D7F78: .4byte 0x84000200 +_080D7F7C: + ldr r0, _080D7FE4 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl decompress_palette + ldr r5, _080D7FE8 + ldr r6, _080D7FEC + adds r0, r5, 0 + mov r1, sp + adds r2, r6, 0 + bl CpuSet + ldr r0, _080D7FF0 + mov r9, r0 + ldrb r0, [r0] + adds r0, 0x5 + lsls r0, 5 + ldr r1, _080D7FF4 + adds r1, r5 + mov r8, r1 + add r0, r8 + add r4, sp, 0x20 + adds r1, r4, 0 + adds r2, r6, 0 + bl CpuSet + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + mov r2, r9 + ldrb r1, [r2] + adds r1, 0x5 + lsls r1, 5 + add r1, r8 + mov r0, sp + adds r2, r6, 0 + bl CpuSet + ldr r1, _080D7FF8 + ldr r0, _080D7FFC + mov r2, r8 + str r2, [r0] + str r1, [r0, 0x4] + ldr r1, _080D8000 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + bl sub_80D782C + b _080D80AE + .align 2, 0 +_080D7FE4: .4byte 0x08c16e90 +_080D7FE8: .4byte 0x02037814 +_080D7FEC: .4byte 0x04000008 +_080D7FF0: .4byte 0x02039f25 +_080D7FF4: .4byte 0xffffff00 +_080D7FF8: .4byte 0x0201a004 +_080D7FFC: .4byte 0x040000d4 +_080D8000: .4byte 0x84000080 +_080D8004: + bl sub_80DD04C + bl sub_80DBF90 + bl sub_80DB2BC + bl sub_80DB120 + ldr r1, _080D808C + ldr r1, [r1] + ldr r1, [r1] + movs r4, 0 + strb r0, [r1, 0x12] + bl sub_80DC2BC + bl sub_80DC4F0 + bl sub_80DC594 + bl sub_80DC5E8 + bl sub_80DC7EC + ldr r1, _080D8090 + strb r4, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r3, 0x3 + strb r3, [r1, 0x2] + movs r2, 0x2 + strb r2, [r1, 0x3] + ldr r0, _080D8094 + str r4, [r0] + ldr r4, _080D8098 + strb r2, [r4] + ldr r0, _080D809C + strb r3, [r0] + bl sub_80DB0C4 + ldr r2, _080D80A0 + ldrb r1, [r4] + adds r1, r2 + strb r0, [r1] + bl sub_80DEA20 + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + b _080D80AE + .align 2, 0 +_080D808C: .4byte 0x02039f34 +_080D8090: .4byte 0x02024076 +_080D8094: .4byte 0x02022fec +_080D8098: .4byte 0x0202420b +_080D809C: .4byte 0x0202420c +_080D80A0: .4byte 0x020241e4 +_080D80A4: + movs r0, 0 + mov r1, r10 + strb r0, [r1] + movs r0, 0x1 + b _080D80B8 +_080D80AE: + mov r2, r10 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + movs r0, 0 +_080D80B8: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D7E44 + + thumb_func_start sub_80D80C8 +sub_80D80C8: @ 80D80C8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _080D80FC + ldrb r2, [r1, 0x8] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x8] + ldrb r1, [r1, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080D80F8 + ldr r0, _080D8100 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, _080D8104 + str r0, [r1] +_080D80F8: + pop {r0} + bx r0 + .align 2, 0 +_080D80FC: .4byte 0x02037fd4 +_080D8100: .4byte 0x03005e00 +_080D8104: .4byte sub_80D8108 + 1 + thumb_func_end sub_80D80C8 + + thumb_func_start sub_80D8108 +sub_80D8108: @ 80D8108 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080D8130 + 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, 0x4 + bhi _080D8208 + lsls r0, 2 + ldr r1, _080D8134 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D8130: .4byte 0x03005e00 +_080D8134: .4byte _080D8138 + .align 2, 0 +_080D8138: + .4byte _080D814C + .4byte _080D8176 + .4byte _080D8194 + .4byte _080D81B0 + .4byte _080D8208 +_080D814C: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _080D822C + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x61 + movs r1, 0 + bl audio_play_and_stuff + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080D822C +_080D8176: + ldr r1, _080D8190 + ldrh r0, [r1] + adds r0, 0x7 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA0 + ble _080D822C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + b _080D81FA + .align 2, 0 +_080D8190: .4byte 0x02022e1a +_080D8194: + bl sub_80DE350 + ldr r0, _080D81AC + 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 _080D822C + .align 2, 0 +_080D81AC: .4byte 0x03005e00 +_080D81B0: + movs r0, 0x8 + bl lcd_io_get + mov r1, sp + strh r0, [r1] + movs r0, 0xC + bl lcd_io_get + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r3, sp + ldrb r2, [r3] + movs r1, 0x4 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + ldrb r0, [r4] + ands r1, r0 + strb r1, [r4] + mov r0, sp + ldrh r1, [r0] + movs r0, 0x8 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0xC + bl lcd_io_set + bl sub_80DDB0C + ldr r1, _080D8204 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 +_080D81FA: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080D822C + .align 2, 0 +_080D8204: .4byte 0x03005e00 +_080D8208: + ldr r0, _080D8234 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080D822C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + ldr r1, _080D8238 + str r1, [r0] +_080D822C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D8234: .4byte 0x02039f34 +_080D8238: .4byte sub_80D833C + 1 + thumb_func_end sub_80D8108 + + thumb_func_start sub_80D823C +sub_80D823C: @ 80D823C + push {r4,r5,lr} + bl call_obj_callbacks + bl run_active_tasks + bl obj_sync_something + bl fade_and_return_progress_probably + movs r4, 0 +_080D8250: + ldr r5, _080D8278 + ldrb r0, [r5] + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D8266 + lsls r0, r4, 24 + lsrs r0, 24 + bl gpu_copy_wram_bg_tilemap_to_vram +_080D8266: + adds r4, 0x1 + cmp r4, 0x3 + ble _080D8250 + movs r0, 0 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D8278: .4byte 0x02039f38 + thumb_func_end sub_80D823C + + thumb_func_start vblank_cb_battle +vblank_cb_battle: @ 80D827C + push {lr} + ldr r0, _080D830C + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _080D8310 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _080D8314 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _080D8318 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, _080D831C + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + ldr r0, _080D8320 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + ldr r0, _080D8324 + ldrh r1, [r0] + movs r0, 0x1C + bl lcd_io_set + ldr r0, _080D8328 + ldrh r1, [r0] + movs r0, 0x1E + bl lcd_io_set + ldr r0, _080D832C + ldrh r1, [r0] + movs r0, 0x40 + bl lcd_io_set + ldr r0, _080D8330 + ldrh r1, [r0] + movs r0, 0x44 + bl lcd_io_set + ldr r0, _080D8334 + ldrh r1, [r0] + movs r0, 0x42 + bl lcd_io_set + ldr r0, _080D8338 + ldrh r1, [r0] + movs r0, 0x46 + bl lcd_io_set + bl copy_pal_bg_faded_to_pal_ram + bl copy_super_sprites_to_oam + bl copy_queue_process + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_080D830C: .4byte 0x02022e14 +_080D8310: .4byte 0x02022e16 +_080D8314: .4byte 0x02022e18 +_080D8318: .4byte 0x02022e1a +_080D831C: .4byte 0x02022e1c +_080D8320: .4byte 0x02022e1e +_080D8324: .4byte 0x02022e20 +_080D8328: .4byte 0x02022e22 +_080D832C: .4byte 0x02022e24 +_080D8330: .4byte 0x02022e26 +_080D8334: .4byte 0x02022e28 +_080D8338: .4byte 0x02022e2a + thumb_func_end vblank_cb_battle + + thumb_func_start sub_80D833C +sub_80D833C: @ 80D833C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080D839C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _080D840C + ldr r0, _080D83A0 + strh r1, [r0] + ldr r0, _080D83A4 + strh r1, [r0] + bl sub_80DCD48 + ldr r1, _080D83A8 + ldr r2, _080D83AC + ldr r0, _080D83B0 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _080D83B4 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r0, _080D83B8 + ldr r1, _080D83BC + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1, 0x1] + adds r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r0, _080D83C0 + ldrb r0, [r0] + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080D83CC + ldr r0, _080D83C4 + ldr r1, _080D83C8 + bl gf_strcpy + b _080D83D4 + .align 2, 0 +_080D839C: .4byte 0x03005e00 +_080D83A0: .4byte 0x02022e16 +_080D83A4: .4byte 0x02022e1e +_080D83A8: .4byte 0x02037714 +_080D83AC: .4byte 0x0201a204 +_080D83B0: .4byte 0x040000d4 +_080D83B4: .4byte 0x84000100 +_080D83B8: .4byte 0x02021cc4 +_080D83BC: .4byte 0x02039f34 +_080D83C0: .4byte 0x02039f25 +_080D83C4: .4byte 0x02022e2c +_080D83C8: .4byte 0x0827d507 +_080D83CC: + ldr r0, _080D83FC + ldr r1, _080D8400 + bl gf_strcpy +_080D83D4: + bl sub_80DB89C + ldr r4, _080D8404 + ldr r1, _080D83FC + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080D8408 + 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 _080D841A + .align 2, 0 +_080D83FC: .4byte 0x02022e2c +_080D8400: .4byte 0x0827d531 +_080D8404: .4byte 0x02021fc4 +_080D8408: .4byte 0x03005e00 +_080D840C: + bl sub_80DED4C + cmp r0, 0 + bne _080D841A + strh r0, [r4, 0x8] + ldr r0, _080D8420 + str r0, [r4] +_080D841A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D8420: .4byte sub_80D8424 + 1 + thumb_func_end sub_80D833C + + thumb_func_start sub_80D8424 +sub_80D8424: @ 80D8424 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _080D8464 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080D843C + cmp r1, 0x2 + bne _080D8482 +_080D843C: + movs r0, 0x5 + bl audio_play + ldr r0, _080D8468 + ldrb r0, [r0] + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080D8474 + movs r0, 0x1 + bl sub_80DC490 + ldr r0, _080D846C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D8470 + b _080D8480 + .align 2, 0 +_080D8464: .4byte 0x030022c0 +_080D8468: .4byte 0x02039f25 +_080D846C: .4byte 0x03005e00 +_080D8470: .4byte sub_80D8490 + 1 +_080D8474: + ldr r0, _080D8488 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D848C +_080D8480: + str r0, [r1] +_080D8482: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D8488: .4byte 0x03005e00 +_080D848C: .4byte sub_80D8894 + 1 + thumb_func_end sub_80D8424 + + thumb_func_start sub_80D8490 +sub_80D8490: @ 80D8490 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _080D8524 + movs r1, 0xA0 + strh r1, [r0] + ldr r0, _080D8528 + strh r1, [r0] + movs r6, 0 + ldr r0, _080D852C + mov r8, r0 + ldr r2, _080D8530 + mov r10, r2 + ldr r7, _080D8534 +_080D84B8: + lsls r1, r6, 1 + mov r0, r8 + ldrb r2, [r0] + lsls r0, r2, 6 + adds r1, r0 + add r1, r10 + ldrh r4, [r1] + add r5, sp, 0x4 + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _080D853C + adds r0, r2, 0 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _080D853C + ldr r0, [r7] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x8] + adds r1, r4, 0 + bl sub_80E5414 + lsls r0, 24 + cmp r0, 0 + beq _080D853C + ldr r0, [r7] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D853C + add r0, sp, 0x4 + ldr r1, _080D8538 + b _080D8566 + .align 2, 0 +_080D8524: .4byte 0x02022e16 +_080D8528: .4byte 0x02022e1e +_080D852C: .4byte 0x02039f25 +_080D8530: .4byte 0x02039e1e +_080D8534: .4byte 0x02039f34 +_080D8538: .4byte 0x085ed1a0 +_080D853C: + cmp r4, 0 + beq _080D856C + ldr r0, [r7] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x8] + cmp r0, r4 + bne _080D856C + ldr r0, _080D85F0 + lsls r1, r4, 3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + beq _080D856C + add r0, sp, 0x4 + ldr r1, _080D85F4 +_080D8566: + bl gf_strcpy + adds r5, r0, 0 +_080D856C: + movs r0, 0xD + adds r1, r4, 0 + muls r1, r0 + ldr r0, _080D85F8 + adds r1, r0 + adds r0, r5, 0 + bl gf_strcpy + adds r4, r6, 0x5 + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x7 + str r0, [sp] + adds r0, r4, 0 + add r1, sp, 0x4 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _080D84B8 + ldr r4, _080D85FC + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D880C + ldr r2, _080D8600 + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 1 + ldr r0, _080D8604 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl prints_contest_move_description + ldr r1, _080D8608 + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, _080D860C + str r1, [r0] + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D85F0: .4byte 0x0858c2b4 +_080D85F4: .4byte 0x085ed1a7 +_080D85F8: .4byte 0x0831977c +_080D85FC: .4byte 0x02039f34 +_080D8600: .4byte 0x02039e00 +_080D8604: .4byte 0x02039f25 +_080D8608: .4byte 0x03005e00 +_080D860C: .4byte sub_80D8610 + 1 + thumb_func_end sub_80D8490 + + thumb_func_start sub_80D8610 +sub_80D8610: @ 80D8610 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + ldr r3, _080D865C + ldr r1, _080D8660 + ldr r0, _080D8664 + ldrb r0, [r0] + lsls r0, 6 + adds r1, 0x1E + adds r1, r0, r1 + movs r2, 0x3 +_080D8628: + ldrh r0, [r1] + cmp r0, 0 + beq _080D8634 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080D8634: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080D8628 + ldrh r0, [r3, 0x2E] + movs r5, 0x1 + ands r5, r0 + cmp r5, 0 + beq _080D8670 + movs r0, 0x5 + bl audio_play + ldr r0, _080D8668 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D866C + str r0, [r1] + b _080D87FA + .align 2, 0 +_080D865C: .4byte 0x030022c0 +_080D8660: .4byte 0x02039e00 +_080D8664: .4byte 0x02039f25 +_080D8668: .4byte 0x03005e00 +_080D866C: .4byte sub_80D8894 + 1 +_080D8670: + ldrh r0, [r3, 0x30] + cmp r0, 0x20 + bne _080D8678 + b _080D87FA +_080D8678: + cmp r0, 0x20 + bgt _080D8682 + cmp r0, 0x2 + beq _080D868E + b _080D87FA +_080D8682: + cmp r0, 0x40 + beq _080D8730 + cmp r0, 0x80 + bne _080D868C + b _080D879C +_080D868C: + b _080D87FA +_080D868E: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_80DC490 + ldr r0, _080D86C8 + ldr r1, _080D86CC + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1, 0x1] + adds r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r0, _080D86D0 + ldrb r0, [r0] + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080D86DC + ldr r0, _080D86D4 + ldr r1, _080D86D8 + bl gf_strcpy + b _080D86E4 + .align 2, 0 +_080D86C8: .4byte 0x02021cc4 +_080D86CC: .4byte 0x02039f34 +_080D86D0: .4byte 0x02039f25 +_080D86D4: .4byte 0x02022e2c +_080D86D8: .4byte 0x0827d507 +_080D86DC: + ldr r0, _080D8714 + ldr r1, _080D8718 + bl gf_strcpy +_080D86E4: + bl sub_80DB89C + ldr r4, _080D871C + ldr r1, _080D8714 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl sub_80DEC30 + ldr r0, _080D8720 + movs r1, 0 + strh r1, [r0] + ldr r0, _080D8724 + strh r1, [r0] + ldr r1, _080D8728 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _080D872C + str r1, [r0] + b _080D87FA + .align 2, 0 +_080D8714: .4byte 0x02022e2c +_080D8718: .4byte 0x0827d531 +_080D871C: .4byte 0x02021fc4 +_080D8720: .4byte 0x02022e16 +_080D8724: .4byte 0x02022e1e +_080D8728: .4byte 0x03005e00 +_080D872C: .4byte sub_80D8424 + 1 +_080D8730: + ldr r4, _080D8750 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D883C + ldr r0, [r4] + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0 + bne _080D8754 + subs r0, r6, 0x1 + b _080D8756 + .align 2, 0 +_080D8750: .4byte 0x02039f34 +_080D8754: + subs r0, 0x1 +_080D8756: + strb r0, [r1] + ldr r4, _080D8790 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D880C + ldr r2, _080D8794 + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 1 + ldr r0, _080D8798 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl prints_contest_move_description + cmp r6, 0x1 + bls _080D87FA + movs r0, 0x5 + bl audio_play + b _080D87FA + .align 2, 0 +_080D8790: .4byte 0x02039f34 +_080D8794: .4byte 0x02039e00 +_080D8798: .4byte 0x02039f25 +_080D879C: + ldr r4, _080D87BC + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D883C + ldr r0, [r4] + ldr r1, [r0] + ldrb r2, [r1] + subs r0, r6, 0x1 + cmp r2, r0 + bne _080D87C0 + strb r5, [r1] + b _080D87C4 + .align 2, 0 +_080D87BC: .4byte 0x02039f34 +_080D87C0: + adds r0, r2, 0x1 + strb r0, [r1] +_080D87C4: + ldr r4, _080D8800 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D880C + ldr r2, _080D8804 + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 1 + ldr r0, _080D8808 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl prints_contest_move_description + cmp r6, 0x1 + bls _080D87FA + movs r0, 0x5 + bl audio_play +_080D87FA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D8800: .4byte 0x02039f34 +_080D8804: .4byte 0x02039e00 +_080D8808: .4byte 0x02039f25 + thumb_func_end sub_80D8610 + + thumb_func_start sub_80D880C +sub_80D880C: @ 80D880C + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 25 + movs r0, 0xF8 + lsls r0, 21 + adds r3, r0 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0x37 + movs r2, 0 + bl sub_80DECB8 + add sp, 0x10 + pop {r0} + bx r0 + thumb_func_end sub_80D880C + + thumb_func_start sub_80D883C +sub_80D883C: @ 80D883C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 23 + adds r3, r4, 0 + adds r3, 0x1F + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + mov r8, r0 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r6, 0x11 + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r1, 0xB + movs r2, 0 + bl sub_80DECB8 + adds r4, 0x20 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xB + movs r2, 0 + adds r3, r4, 0 + bl sub_80DECB8 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D883C + + thumb_func_start sub_80D8894 +sub_80D8894: @ 80D8894 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080D88F0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D890C + ldr r4, _080D88F4 + ldrb r0, [r4] + bl sub_80DB8B8 + ldr r1, _080D88F8 + ldr r1, [r1] + ldrb r2, [r4] + ldr r3, [r1, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r3 + strh r0, [r1, 0x6] + ldr r4, _080D88FC + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D8900 + adds r1, r4, 0 + bl set_task_function_and_args_14_15 + ldr r1, _080D8904 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080D8908 + str r1, [r0] + bl sub_80DBF68 + movs r0, 0 + bl sub_80DC490 + b _080D891E + .align 2, 0 +_080D88F0: .4byte 0x02039f2a +_080D88F4: .4byte 0x02039f25 +_080D88F8: .4byte 0x02039f34 +_080D88FC: .4byte sub_80FC9F8 + 1 +_080D8900: .4byte sub_80D892C + 1 +_080D8904: .4byte 0x03005e00 +_080D8908: .4byte nullsub_41 + 1 +_080D890C: + bl sub_80DB918 + ldr r0, _080D8924 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D8928 + str r0, [r1] +_080D891E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080D8924: .4byte 0x03005e00 +_080D8928: .4byte sub_80D895C + 1 + thumb_func_end sub_80D8894 + + thumb_func_start sub_80D892C +sub_80D892C: @ 80D892C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldr r2, _080D8950 + ldr r0, _080D8954 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _080D8958 + str r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080D8950: .4byte 0x03005e00 +_080D8954: .4byte 0x02039f34 +_080D8958: .4byte sub_80D895C + 1 + thumb_func_end sub_80D892C + + thumb_func_start sub_80D895C +sub_80D895C: @ 80D895C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_80DB89C + ldr r0, _080D89E4 + movs r1, 0 + strh r1, [r0] + ldr r0, _080D89E8 + strh r1, [r0] + movs r0, 0 + bl sub_80DC490 + movs r6, 0 + movs r5, 0xA0 + lsls r5, 19 +_080D897C: + lsrs r4, r5, 24 + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _080D897C + movs r0, 0 + bl sub_80DED60 + ldr r1, _080D89EC + ldr r0, _080D89F0 + movs r2, 0x80 + lsls r2, 3 + ldr r4, _080D89F4 + str r1, [r4] + str r0, [r4, 0x4] + lsrs r1, r2, 2 + movs r3, 0x84 + lsls r3, 24 + orrs r1, r3 + str r1, [r4, 0x8] + ldr r1, [r4, 0x8] + ldr r1, _080D89F8 + adds r0, r1 + movs r1, 0 + bl gpu_pal_apply + ldr r1, _080D89FC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + ldr r1, _080D8A00 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D89E4: .4byte 0x02022e16 +_080D89E8: .4byte 0x02022e1e +_080D89EC: .4byte 0x02037b14 +_080D89F0: .4byte 0x0201a604 +_080D89F4: .4byte 0x040000d4 +_080D89F8: .4byte 0xfffffc00 +_080D89FC: .4byte 0x03005e00 +_080D8A00: .4byte sub_80D8A04 + 1 + thumb_func_end sub_80D895C + + thumb_func_start sub_80D8A04 +sub_80D8A04: @ 80D8A04 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D8A48 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080D8A42 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080D8A42 + bl sub_80DDBE8 + movs r0, 0x1 + bl sub_80DE69C + ldr r0, _080D8A4C + str r0, [r4] +_080D8A42: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080D8A48: .4byte 0x03005e00 +_080D8A4C: .4byte sub_80D8A50 + 1 + thumb_func_end sub_80D8A04 + + thumb_func_start sub_80D8A50 +sub_80D8A50: @ 80D8A50 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080D8A7C + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0, 0x6] + movs r0, 0x90 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _080D8A76 + ldr r0, _080D8A80 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080D8A84 + str r0, [r1] +_080D8A76: + pop {r0} + bx r0 + .align 2, 0 +_080D8A7C: .4byte 0x02039f34 +_080D8A80: .4byte 0x03005e00 +_080D8A84: .4byte sub_80D8A88 + 1 + thumb_func_end sub_80D8A50 + + thumb_func_start sub_80D8A88 +sub_80D8A88: @ 80D8A88 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080D8B20 + lsls r3, r6, 2 + adds r1, r3, r6 + 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, 0x13 + ble _080D8B18 + ldr r2, _080D8B24 + ldr r0, [r2] + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x10] + ldr r0, [r2] + ldr r1, [r0] + ldr r0, _080D8B28 + ldr r0, [r0] + str r0, [r1, 0x18] + ldr r0, _080D8B2C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _080D8B08 + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080D8B08 + movs r4, 0 + ldr r1, _080D8B30 + ldrb r0, [r1] + cmp r0, 0x3 + bgt _080D8B08 + adds r5, r1, 0 +_080D8ADE: + ldrb r0, [r5] + adds r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl sub_80DB8B8 + ldr r1, _080D8B24 + ldr r1, [r1] + ldrb r2, [r5] + adds r2, r4 + ldr r3, [r1, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r3 + strh r0, [r1, 0x6] + adds r4, 0x1 + ldrb r0, [r5] + adds r0, r4, r0 + cmp r0, 0x3 + ble _080D8ADE +_080D8B08: + ldr r1, _080D8B20 + adds r0, r7, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, _080D8B34 + str r1, [r0] +_080D8B18: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080D8B20: .4byte 0x03005e00 +_080D8B24: .4byte 0x02039f34 +_080D8B28: .4byte 0x03005d80 +_080D8B2C: .4byte 0x02039f2a +_080D8B30: .4byte 0x02039f30 +_080D8B34: .4byte sub_80D8B38 + 1 + thumb_func_end sub_80D8A88 + + thumb_func_start sub_80D8B38 +sub_80D8B38: @ 80D8B38 + 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 r2, _080D8B78 + ldr r0, [r2] + ldr r0, [r0] + ldrb r6, [r0, 0x11] + ldr r1, _080D8B7C + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + mov r9, r2 + adds r4, r1, 0 + cmp r0, 0x3B + bls _080D8B6E + bl _080DA100 +_080D8B6E: + lsls r0, 2 + ldr r1, _080D8B80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D8B78: .4byte 0x02039f34 +_080D8B7C: .4byte 0x03005e00 +_080D8B80: .4byte _080D8B84 + .align 2, 0 +_080D8B84: + .4byte _080D8C74 + .4byte _080D8D30 + .4byte _080D8D56 + .4byte _080D8DC4 + .4byte _080D8E7C + .4byte _080D8EC8 + .4byte _080D8F84 + .4byte _080D8FB8 + .4byte _080D9010 + .4byte _080D908C + .4byte _080D9FC0 + .4byte _080D9FEC + .4byte _080D9238 + .4byte _080D926C + .4byte _080D9774 + .4byte _080D9864 + .4byte _080D98D4 + .4byte _080D9904 + .4byte _080D99EC + .4byte _080D999E + .4byte _080DA024 + .4byte _080DA0A0 + .4byte _080DA0C2 + .4byte _080D90B4 + .4byte _080D9180 + .4byte _080D9388 + .4byte _080D939E + .4byte _080D947C + .4byte _080D94A0 + .4byte _080D9508 + .4byte _080D95EC + .4byte _080DA038 + .4byte _080DA080 + .4byte _080D9EBC + .4byte _080D9F48 + .4byte _080D929A + .4byte _080D92D0 + .4byte _080D92F6 + .4byte _080D9334 + .4byte _080D955C + .4byte _080D95C4 + .4byte _080D9A2C + .4byte _080DA100 + .4byte _080D9DAC + .4byte _080DA100 + .4byte _080D9830 + .4byte _080D997C + .4byte _080D921A + .4byte _080D91A4 + .4byte _080D91F4 + .4byte _080D935C + .4byte _080D9690 + .4byte _080D971C + .4byte _080D9BAA + .4byte _080D9C68 + .4byte _080D9F68 + .4byte _080D9F84 + .4byte _080D9DD4 + .4byte _080D9E60 + .4byte _080D9EA0 +_080D8C74: + bl sub_80DCD48 + movs r7, 0 + ldr r0, _080D8D00 + ldr r0, [r0] + ldr r1, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r1, 0x10] + mov r5, r8 + lsls r5, 2 + mov r10, r5 + ldrb r2, [r0] + cmp r1, r2 + beq _080D8C9C + adds r2, r0, 0 +_080D8C92: + adds r7, 0x1 + adds r0, r2, r7 + ldrb r0, [r0] + cmp r1, r0 + bne _080D8C92 +_080D8C9C: + ldr r4, _080D8D00 + ldr r0, [r4] + ldr r0, [r0] + strb r7, [r0, 0x11] + ldr r0, [r4] + ldr r2, [r0] + ldrb r6, [r2, 0x11] + ldr r0, _080D8D04 + ldrb r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080D8D14 + ldrb r0, [r2, 0x7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x7] + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080D8CD4 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DD080 +_080D8CD4: + ldr r4, _080D8D08 + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080D8D0C + adds r1, r4, 0 + bl set_task_function_and_args_14_15 + bl sub_80DBF68 + ldr r1, _080D8D10 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D8D00: .4byte 0x02039f34 +_080D8D04: .4byte 0x02039f2a +_080D8D08: .4byte sub_80FCC88 + 1 +_080D8D0C: .4byte sub_80DA110 + 1 +_080D8D10: .4byte 0x03005e00 +_080D8D14: + adds r0, r6, 0 + bl sub_80DD080 + ldr r0, _080D8D2C + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D8D2C: .4byte 0x03005e00 +_080D8D30: + mov r3, r9 + ldr r0, [r3] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D8D44 + bl _080DA100 +_080D8D44: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x8] + bl _080DA100 +_080D8D56: + adds r0, r6, 0 + bl sub_80DF080 + bl sub_80DF750 + ldr r0, _080D8D9C + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080D8D86 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _080D8DA4 +_080D8D86: + ldr r0, _080D8DA0 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1F + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D8D9C: .4byte 0x02039f34 +_080D8DA0: .4byte 0x03005e00 +_080D8DA4: + bl sub_80DB89C + ldr r0, _080D8DC0 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r6, [r1, 0x1C] + movs r0, 0x3 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D8DC0: .4byte 0x03005e00 +_080D8DC4: + mov r4, r8 + lsls r4, 2 + mov r10, r4 + ldr r1, _080D8E60 + movs r2, 0 + adds r0, r1, 0x3 +_080D8DD0: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080D8DD0 + movs r7, 0x4 + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0, 0x18] + movs r1, 0 + movs r2, 0x14 + bl memset + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DE9DC + ldr r4, _080D8E64 + ldr r0, [r5] + ldr r0, [r0] + ldrb r3, [r0, 0x11] + lsls r2, r3, 6 + adds r0, r2, r4 + ldrh r0, [r0] + adds r1, r4, 0 + adds r1, 0x3C + adds r1, r2, r1 + ldr r1, [r1] + adds r4, 0x38 + adds r2, r4 + ldr r2, [r2] + bl sub_80DB174 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _080D8E68 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r3, r0, r2 + movs r1, 0x78 + strh r1, [r3, 0x24] + adds r2, 0x1C + adds r0, r2 + ldr r1, _080D8E6C + str r1, [r0] + ldr r0, _080D8E70 + mov r4, r10 + add r4, r8 + lsls r4, 3 + adds r4, r0 + strh r5, [r4, 0xC] + ldr r1, _080D8E74 + ldr r0, _080D8E78 + ldrb r0, [r0] + adds r0, r1 + strb r5, [r0] + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DC9EC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80DCBE8 + strh r7, [r4, 0x8] + bl _080DA100 + .align 2, 0 +_080D8E60: .4byte 0x020244e4 +_080D8E64: .4byte 0x02039e00 +_080D8E68: .4byte 0x02020630 +_080D8E6C: .4byte sub_80DA134 + 1 +_080D8E70: .4byte 0x03005e00 +_080D8E74: .4byte 0x020241e4 +_080D8E78: .4byte 0x0202420b +_080D8E7C: + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r2, r0, r4 + ldrb r5, [r2, 0xC] + ldr r1, _080D8EC0 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, _080D8EC4 + cmp r1, r0 + beq _080D8EA0 + bl _080DA100 +_080D8EA0: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D8EB8 + bl _080DA100 +_080D8EB8: + movs r0, 0x5 + strh r0, [r2, 0x8] + bl _080DA100 + .align 2, 0 +_080D8EC0: .4byte 0x02020630 +_080D8EC4: .4byte nullsub_12 + 1 +_080D8EC8: + mov r5, r9 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r5, r0, 2 + adds r1, r5, r1 + ldrb r1, [r1, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D8EF2 + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x21 + strh r1, [r0, 0x8] + bl _080DA100 +_080D8EF2: + bl sub_80DB89C + ldr r0, _080D8F28 + lsls r1, r6, 6 + ldr r2, _080D8F2C + adds r1, r2 + bl gf_strcpy + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r3, r5, r0 + ldrh r1, [r3, 0x6] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bhi _080D8F38 + ldr r0, _080D8F30 + adds r2, r1, 0 + movs r1, 0xD + muls r1, r2 + ldr r2, _080D8F34 + adds r1, r2 + bl gf_strcpy + b _080D8F48 + .align 2, 0 +_080D8F28: .4byte 0x02021cc4 +_080D8F2C: .4byte 0x02039e02 +_080D8F30: .4byte 0x02021dc4 +_080D8F34: .4byte 0x0831977c +_080D8F38: + ldr r0, _080D8F70 + ldr r2, _080D8F74 + ldrb r1, [r3, 0xA] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy +_080D8F48: + ldr r4, _080D8F78 + ldr r1, _080D8F7C + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080D8F80 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D8F70: .4byte 0x02021dc4 +_080D8F74: .4byte 0x08587f1c +_080D8F78: .4byte 0x02021fc4 +_080D8F7C: .4byte 0x0827d55a +_080D8F80: .4byte 0x03005e00 +_080D8F84: + bl sub_80DED4C + adds r1, r0, 0 + cmp r1, 0 + beq _080D8F92 + bl _080DA100 +_080D8F92: + ldr r0, _080D8FB0 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x5A + strb r1, [r0] + ldr r1, _080D8FB4 + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D8FB0: .4byte 0x02039f34 +_080D8FB4: .4byte 0x03005e00 +_080D8FB8: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r1] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl sub_80DE834 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DE864 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DE9DC + adds r0, r4, 0 + bl sub_80DEAA8 + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r1, _080D900C + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D900C: .4byte 0x03005e00 +_080D9010: + ldr r0, _080D9050 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _080D9054 + ldrb r4, [r0] + cmp r4, 0 + beq _080D9024 + bl _080DA100 +_080D9024: + adds r0, r6, 0 + bl sub_80DE9B0 + ldr r0, _080D9058 + ldr r1, [r0] + ldr r0, [r1] + adds r0, 0x5A + ldrb r0, [r0] + cmp r0, 0 + beq _080D9060 + ldr r0, _080D905C + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r4, [r1, 0x1C] + movs r0, 0x9 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9050: .4byte 0x020383f8 +_080D9054: .4byte 0x020383fd +_080D9058: .4byte 0x02039f34 +_080D905C: .4byte 0x03005e00 +_080D9060: + ldr r1, [r1, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080D907A + adds r0, r6, 0 + bl sub_80DC674 +_080D907A: + bl sub_80DE12C + ldr r0, _080D9088 + mov r4, r8 + lsls r1, r4, 2 + b _080D9192 + .align 2, 0 +_080D9088: .4byte 0x03005e00 +_080D908C: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r2, r0, r4 + ldrh r0, [r2, 0x1C] + adds r1, r0, 0x1 + strh r1, [r2, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + bgt _080D90A8 + bl _080DA100 +_080D90A8: + movs r0, 0 + strh r0, [r2, 0x1C] + movs r0, 0x7 + strh r0, [r2, 0x8] + bl _080DA100 +_080D90B4: + mov r0, r8 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r7, r0, r4 + movs r0, 0 + strh r0, [r7, 0xA] + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + mov r12, r0 + lsls r1, r6, 3 + subs r0, r1, r6 + lsls r5, r0, 2 + mov r0, r12 + adds r3, r5, r0 + ldrb r0, [r3, 0x13] + mov r10, r2 + str r1, [sp, 0x4] + cmp r0, 0xFF + beq _080D90FA + ldrb r1, [r3, 0x13] + adds r0, r6, 0 + bl sub_80DD45C + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + movs r1, 0xFF + strb r1, [r0, 0x13] + movs r0, 0x18 + strh r0, [r7, 0x8] + bl _080DA100 +_080D90FA: + ldrb r0, [r3, 0x14] + cmp r0, 0xFF + beq _080D9178 + movs r7, 0 + cmp r7, r6 + beq _080D910E + mov r2, r12 + ldrb r0, [r2, 0x13] + cmp r0, 0xFF + bne _080D912C +_080D910E: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080D912C + cmp r7, r6 + beq _080D910E + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0xFF + beq _080D910E +_080D912C: + cmp r7, 0x4 + bne _080D9168 + mov r4, r9 + ldr r0, [r4] + ldr r0, [r0, 0x4] + ldr r5, [sp, 0x4] + subs r4, r5, r6 + lsls r4, 2 + adds r0, r4, r0 + ldrb r1, [r0, 0x14] + adds r0, r6, 0 + bl sub_80DD45C + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r0 + movs r0, 0xFF + strb r0, [r4, 0x14] + ldr r1, _080D9164 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x18 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D9164: .4byte 0x03005e00 +_080D9168: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x30 + strh r1, [r0, 0x8] + bl _080DA100 +_080D9178: + movs r0, 0x30 + strh r0, [r7, 0x8] + bl _080DA100 +_080D9180: + bl sub_80DED4C + cmp r0, 0 + beq _080D918C + bl _080DA100 +_080D918C: + ldr r0, _080D91A0 + mov r2, r8 + lsls r1, r2, 2 +_080D9192: + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x17 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D91A0: .4byte 0x03005e00 +_080D91A4: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x11] + movs r3, 0x3 + ands r3, r0 + cmp r3, 0x1 + bne _080D91C4 + movs r0, 0x5 + bl sub_80DD720 + b _080D91DA +_080D91C4: + cmp r3, 0x2 + bne _080D91D0 + movs r0, 0x6 + bl sub_80DD720 + b _080D91DA +_080D91D0: + cmp r3, 0x3 + bne _080D9208 + movs r0, 0x7 + bl sub_80DD720 +_080D91DA: + ldr r0, _080D91F0 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x31 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D91F0: .4byte 0x03005e00 +_080D91F4: + mov r3, r9 + ldr r0, [r3] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D9208 + bl _080DA100 +_080D9208: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2F + strh r1, [r0, 0x8] + bl _080DA100 +_080D921A: + movs r0, 0x1 + bl sub_80DE008 + ldr r0, _080D9234 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0xC + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9234: .4byte 0x03005e00 +_080D9238: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + movs r4, 0x2 + ldrsh r1, [r0, r4] + movs r0, 0 + adds r2, r6, 0 + bl sub_80DC028 + ldr r1, _080D9268 + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xD + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D9268: .4byte 0x03005e00 +_080D926C: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r1] + ldrb r0, [r0, 0x11] + ldr r1, [r1, 0x14] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9288 + bl _080DA100 +_080D9288: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x23 + strh r1, [r0, 0x8] + bl _080DA100 +_080D929A: + mov r2, r9 + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x10 + bne _080D92B8 + movs r0, 0x8 + bl sub_80DD720 +_080D92B8: + ldr r0, _080D92CC + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x24 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D92CC: .4byte 0x03005e00 +_080D92D0: + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D92E4 + bl _080DA100 +_080D92E4: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x25 + strh r1, [r0, 0x8] + bl _080DA100 +_080D92F6: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80DB5B8 + lsls r0, 24 + cmp r0, 0 + beq _080D9320 + ldr r1, _080D931C + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + movs r1, 0x26 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D931C: .4byte 0x03005e00 +_080D9320: + ldr r0, _080D9330 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + b _080D9354 + .align 2, 0 +_080D9330: .4byte 0x03005e00 +_080D9334: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r4 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080D9350 + bl _080DA100 +_080D9350: + movs r0, 0 + strh r0, [r1, 0x1C] +_080D9354: + movs r0, 0x32 + strh r0, [r1, 0x8] + bl _080DA100 +_080D935C: + adds r0, r6, 0 + bl sub_80DB798 + lsls r0, 24 + cmp r0, 0 + beq _080D936E + movs r0, 0x63 + bl audio_play +_080D936E: + ldr r0, _080D9384 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x19 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9384: .4byte 0x03005e00 +_080D9388: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0 + strh r1, [r0, 0xA] + movs r1, 0x1A + strh r1, [r0, 0x8] + bl _080DA100 +_080D939E: + movs r3, 0 + movs r5, 0 + str r5, [sp] + mov r0, r8 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r7, [r0, r2] + mov r10, r1 + cmp r7, 0x3 + bgt _080D9418 + ldr r5, _080D93DC + ldr r2, _080D93E0 +_080D93BC: + movs r3, 0 + str r3, [sp] + adds r0, r3, 0 + cmp r0, r6 + beq _080D93E4 + ldrb r0, [r5] + cmp r0, r7 + bne _080D93E4 + ldr r0, [r2] + ldr r0, [r0, 0x4] + ldrb r0, [r0, 0x13] + cmp r0, 0xFF + beq _080D93E4 + movs r1, 0x1 + str r1, [sp] + b _080D940C + .align 2, 0 +_080D93DC: .4byte 0x02039f26 +_080D93E0: .4byte 0x02039f34 +_080D93E4: + adds r3, 0x1 + cmp r3, 0x3 + bgt _080D940C + cmp r3, r6 + beq _080D93E4 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, r7 + bne _080D93E4 + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0xFF + beq _080D93E4 + movs r0, 0x1 + str r0, [sp] +_080D940C: + ldr r1, [sp] + cmp r1, 0 + bne _080D9422 + adds r7, 0x1 + cmp r7, 0x3 + ble _080D93BC +_080D9418: + ldr r2, [sp] + lsls r0, r2, 24 + asrs r2, r0, 24 + cmp r2, 0 + beq _080D9464 +_080D9422: + mov r5, r10 + add r5, r8 + lsls r5, 3 + adds r5, r4 + ldr r0, _080D9460 + adds r0, r3, r0 + ldrb r0, [r0] + strh r0, [r5, 0xA] + lsls r0, r3, 24 + lsrs r0, 24 + mov r4, r9 + ldr r1, [r4] + ldr r1, [r1, 0x4] + lsls r4, r3, 3 + subs r4, r3 + lsls r4, 2 + adds r1, r4, r1 + ldrb r1, [r1, 0x13] + bl sub_80DD45C + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r0 + movs r0, 0xFF + strb r0, [r4, 0x13] + movs r0, 0x1B + strh r0, [r5, 0x8] + bl _080DA100 + .align 2, 0 +_080D9460: .4byte 0x02039f26 +_080D9464: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r2, [r0, 0xA] + strh r2, [r0, 0x1C] + movs r1, 0x33 + strh r1, [r0, 0x8] + bl sub_80DB884 + bl _080DA100 +_080D947C: + bl sub_80DED4C + cmp r0, 0 + beq _080D9488 + bl _080DA100 +_080D9488: + ldr r0, _080D949C + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1C + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D949C: .4byte 0x03005e00 +_080D94A0: + movs r7, 0 + mov r3, r8 + lsls r0, r3, 2 + adds r1, r0, r3 + lsls r1, 3 + adds r1, r4 + movs r4, 0xA + ldrsh r2, [r1, r4] + ldr r1, _080D9500 + mov r10, r0 + adds r5, r1, 0 + ldrb r0, [r5] + cmp r2, r0 + beq _080D94CA + adds r1, r2, 0 + adds r2, r5, 0 +_080D94C0: + adds r7, 0x1 + adds r0, r7, r2 + ldrb r0, [r0] + cmp r1, r0 + bne _080D94C0 +_080D94CA: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0xE] + ldrh r0, [r0, 0x2] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + negs r1, r1 + lsls r2, r7, 24 + lsrs r2, 24 + bl sub_80DC028 + ldr r1, _080D9504 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1D + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D9500: .4byte 0x02039f26 +_080D9504: .4byte 0x03005e00 +_080D9508: + movs r7, 0 + mov r2, r8 + lsls r0, r2, 2 + adds r1, r0, r2 + lsls r1, 3 + adds r1, r4 + movs r5, 0xA + ldrsh r3, [r1, r5] + ldr r1, _080D9558 + mov r10, r0 + adds r5, r1, 0 + ldrb r0, [r5] + cmp r3, r0 + beq _080D952E +_080D9524: + adds r7, 0x1 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r3, r0 + bne _080D9524 +_080D952E: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x14] + lsls r0, r7, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9546 + bl _080DA100 +_080D9546: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x27 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D9558: .4byte 0x02039f26 +_080D955C: + movs r7, 0 + mov r2, r8 + lsls r0, r2, 2 + adds r1, r0, r2 + lsls r1, 3 + adds r1, r4 + movs r3, 0xA + ldrsh r2, [r1, r3] + ldr r1, _080D95AC + mov r10, r0 + adds r5, r1, 0 + ldrb r4, [r5] + cmp r2, r4 + beq _080D9586 + adds r1, r2, 0 + adds r2, r5, 0 +_080D957C: + adds r7, 0x1 + adds r0, r7, r2 + ldrb r0, [r0] + cmp r1, r0 + bne _080D957C +_080D9586: + lsls r0, r7, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80DB5B8 + lsls r0, 24 + cmp r0, 0 + beq _080D95B4 + ldr r1, _080D95B0 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + movs r1, 0x28 + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D95AC: .4byte 0x02039f26 +_080D95B0: .4byte 0x03005e00 +_080D95B4: + ldr r0, _080D95C0 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + b _080D95E4 + .align 2, 0 +_080D95C0: .4byte 0x03005e00 +_080D95C4: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r4 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080D95E0 + bl _080DA100 +_080D95E0: + movs r0, 0 + strh r0, [r1, 0x1C] +_080D95E4: + movs r0, 0x1E + strh r0, [r1, 0x8] + bl _080DA100 +_080D95EC: + movs r7, 0 + ldr r2, _080D9638 + ldrb r3, [r2] + mov r0, r8 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r0, 3 + adds r4, r0, r4 + movs r5, 0xA + ldrsh r0, [r4, r5] + mov r10, r1 + adds r5, r2, 0 + cmp r3, r0 + beq _080D961E + adds r3, r5, 0 + adds r2, r4, 0 +_080D960C: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080D961E + adds r0, r7, r3 + ldrb r1, [r0] + movs r4, 0xA + ldrsh r0, [r2, r4] + cmp r1, r0 + bne _080D960C +_080D961E: + lsls r4, r7, 24 + lsrs r0, r4, 24 + bl sub_80DB798 + lsls r0, 24 + adds r6, r4, 0 + cmp r0, 0 + beq _080D963C + movs r0, 0x63 + bl audio_play + b _080D9642 + .align 2, 0 +_080D9638: .4byte 0x02039f26 +_080D963C: + movs r0, 0x64 + bl audio_play +_080D9642: + ldr r5, _080D9688 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r4, r0, 2 + adds r1, r4, r1 + ldrb r1, [r1, 0x15] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D9670 + lsrs r0, r6, 24 + bl sub_80DC674 + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] +_080D9670: + ldr r0, _080D968C + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + movs r0, 0x1A + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9688: .4byte 0x02039f34 +_080D968C: .4byte 0x03005e00 +_080D9690: + mov r5, r8 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + mov r10, r2 + cmp r0, 0x9 + bgt _080D96AE + bl _080DA100 +_080D96AE: + movs r0, 0 + strh r0, [r4, 0x1C] + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080D96D4 + ldrb r1, [r2, 0x11] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D96F6 +_080D96D4: + bl sub_80DB89C + ldr r0, _080D9708 + lsls r1, r6, 6 + ldr r2, _080D970C + adds r1, r2 + bl gf_strcpy + ldr r4, _080D9710 + ldr r1, _080D9714 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 +_080D96F6: + ldr r0, _080D9718 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x34 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9708: .4byte 0x02021cc4 +_080D970C: .4byte 0x02039e02 +_080D9710: .4byte 0x02021fc4 +_080D9714: .4byte 0x0827e793 +_080D9718: .4byte 0x03005e00 +_080D971C: + bl sub_80DED4C + cmp r0, 0 + beq _080D9728 + bl _080DA100 +_080D9728: + ldr r0, _080D9754 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080D975C + ldr r0, _080D9758 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x11 + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9754: .4byte 0x02039f34 +_080D9758: .4byte 0x03005e00 +_080D975C: + ldr r0, _080D9770 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0xE + strh r0, [r1, 0x8] + bl _080DA100 + .align 2, 0 +_080D9770: .4byte 0x03005e00 +_080D9774: + mov r4, r9 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] + lsls r4, r0, 24 + lsrs r5, r4, 24 + cmp r5, 0 + beq _080D97DC + bl sub_80DB89C + asrs r0, r4, 24 + cmp r0, 0x1 + bne _080D97A0 + ldr r0, _080D979C + b _080D97A6 + .align 2, 0 +_080D979C: .4byte 0x0827e32e +_080D97A0: + cmp r0, 0x2 + bne _080D97B4 + ldr r0, _080D97B0 +_080D97A6: + movs r1, 0x1 + bl sub_80DEC30 + b _080D97BC + .align 2, 0 +_080D97B0: .4byte 0x0827e35b +_080D97B4: + ldr r0, _080D97D4 + movs r1, 0x1 + bl sub_80DEC30 +_080D97BC: + movs r0, 0x3 + bl sub_80DD720 + ldr r1, _080D97D8 + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + b _080D9812 + .align 2, 0 +_080D97D4: .4byte 0x0827e38d +_080D97D8: .4byte 0x03005e00 +_080D97DC: + bl sub_80DB89C + ldr r0, _080D981C + lsls r1, r6, 6 + ldr r2, _080D9820 + adds r1, r2 + bl gf_strcpy + ldr r4, _080D9824 + ldr r1, _080D9828 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + movs r0, 0x2 + bl sub_80DD720 + ldr r1, _080D982C + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x1C] +_080D9812: + movs r1, 0x2D + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D981C: .4byte 0x02021cc4 +_080D9820: .4byte 0x02039e02 +_080D9824: .4byte 0x02021fc4 +_080D9828: .4byte 0x0827e2fe +_080D982C: .4byte 0x03005e00 +_080D9830: + mov r3, r9 + ldr r0, [r3] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D9844 + bl _080DA100 +_080D9844: + ldrb r0, [r2, 0x11] + bl sub_80DC9B4 + ldr r1, _080D9860 + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xF + strh r1, [r0, 0x8] + bl _080DA100 + .align 2, 0 +_080D9860: .4byte 0x03005e00 +_080D9864: + bl sub_80DED4C + cmp r0, 0 + beq _080D9870 + bl _080DA100 +_080D9870: + ldr r1, _080D98CC + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bgt _080D988E + bl _080DA100 +_080D988E: + ldr r7, _080D98D0 + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r5, r0, 2 + adds r2, r5, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + mov r8, r0 + ands r0, r1 + cmp r0, 0 + bne _080D98C2 + movs r1, 0x2 + ldrsh r0, [r2, r1] + ldrb r1, [r2, 0x17] + adds r2, r6, 0 + bl sub_80DC028 + ldr r0, [r7] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrh r0, [r1, 0x2] + ldrb r2, [r1, 0x17] + adds r0, r2 + strh r0, [r1, 0x2] +_080D98C2: + mov r3, r8 + strh r3, [r4, 0x8] + bl _080DA100 + .align 2, 0 +_080D98CC: .4byte 0x03005e00 +_080D98D0: .4byte 0x02039f34 +_080D98D4: + mov r5, r9 + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080D98F0 + bl _080DA100 +_080D98F0: + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r1, [r0, 0x1C] + movs r1, 0x11 + strh r1, [r0, 0x8] + bl _080DA100 +_080D9904: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D996C + bl sub_80DB89C + ldr r0, _080D9958 + lsls r1, r6, 6 + ldr r2, _080D995C + adds r1, r2 + bl gf_strcpy + ldr r4, _080D9960 + ldr r1, _080D9964 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r0, _080D9968 + mov r5, r8 + lsls r4, r5, 2 + add r4, r8 + lsls r4, 3 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x1C] + bl sub_80DD720 + movs r0, 0x2E + strh r0, [r4, 0x8] + b _080DA100 + .align 2, 0 +_080D9958: .4byte 0x02021cc4 +_080D995C: .4byte 0x02039e02 +_080D9960: .4byte 0x02021fc4 +_080D9964: .4byte 0x0827e6e3 +_080D9968: .4byte 0x03005e00 +_080D996C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x29 + strh r1, [r0, 0x8] + b _080DA100 +_080D997C: + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D998E + b _080DA100 +_080D998E: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x13 + strh r1, [r0, 0x8] + b _080DA100 +_080D999E: + bl sub_80DED4C + cmp r0, 0 + beq _080D99A8 + b _080DA100 +_080D99A8: + ldr r5, _080D99E4 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r4, r6, 3 + subs r4, r6 + lsls r4, 2 + adds r1, r4, r1 + movs r2, 0x2 + ldrsh r0, [r1, r2] + ldrb r1, [r1, 0x18] + negs r1, r1 + adds r2, r6, 0 + bl sub_80DC028 + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r4, r0 + ldrb r1, [r4, 0x18] + ldrh r0, [r4, 0x2] + subs r0, r1 + strh r0, [r4, 0x2] + ldr r1, _080D99E8 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x12 + strh r1, [r0, 0x8] + b _080DA100 + .align 2, 0 +_080D99E4: .4byte 0x02039f34 +_080D99E8: .4byte 0x03005e00 +_080D99EC: + bl sub_80DCD48 + ldr r0, _080D9A24 + ldr r0, [r0] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080D9A0A + b _080DA100 +_080D9A0A: + ldr r0, _080D9A28 + mov r5, r8 + lsls r4, r5, 2 + add r4, r8 + lsls r4, 3 + adds r4, r0 + strh r3, [r4, 0x1C] + bl sub_80DB89C + movs r0, 0x29 + strh r0, [r4, 0x8] + b _080DA100 + .align 2, 0 +_080D9A24: .4byte 0x02039f34 +_080D9A28: .4byte 0x03005e00 +_080D9A2C: + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0, 0x10] + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D9A56 + ldr r0, [r2] + lsls r0, 20 + lsrs r0, 29 + cmp r6, r0 + beq _080D9A56 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x39 + strh r1, [r0, 0x8] + b _080DA100 +_080D9A56: + mov r3, r9 + ldr r1, [r3] + ldr r0, [r1, 0x10] + ldrb r0, [r0] + str r0, [sp] + ldr r1, [r1, 0x4] + lsls r2, r6, 3 + subs r0, r2, r6 + lsls r0, 2 + adds r5, r0, r1 + ldrb r1, [r5, 0x11] + movs r0, 0x10 + ands r0, r1 + str r2, [sp, 0x4] + cmp r0, 0 + beq _080D9A94 + movs r4, 0x1 + str r4, [sp] + ldr r0, _080D9A8C + ldrh r2, [r5, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, _080D9A90 + adds r1, r2 + bl gf_strcpy + b _080D9AAE + .align 2, 0 +_080D9A8C: .4byte 0x02021ec4 +_080D9A90: .4byte 0x0831977c +_080D9A94: + ldr r0, _080D9B14 + ldr r3, _080D9B18 + ldr r2, _080D9B1C + ldrh r1, [r5, 0x6] + lsls r1, 3 + adds r1, r2 + ldrb r1, [r1, 0x1] + lsls r1, 29 + lsrs r1, 27 + adds r1, r3 + ldr r1, [r1] + bl gf_strcpy +_080D9AAE: + ldr r5, [sp] + lsls r0, r5, 24 + cmp r0, 0 + ble _080D9AD2 + ldr r0, _080D9B20 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r2, [sp, 0x4] + subs r0, r2, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D9AD2 + movs r3, 0 + str r3, [sp] +_080D9AD2: + bl sub_80DB89C + ldr r0, _080D9B24 + lsls r1, r6, 6 + ldr r2, _080D9B28 + adds r1, r2 + bl gf_strcpy + ldr r4, _080D9B20 + ldr r0, [r4] + ldr r1, [r0] + ldrb r0, [r1, 0x13] + ldr r5, [sp] + lsls r2, r5, 24 + asrs r3, r2, 24 + adds r0, r3, r0 + strb r0, [r1, 0x13] + ldr r0, [r4] + ldr r1, [r0] + movs r0, 0x13 + ldrsb r0, [r1, r0] + adds r5, r2, 0 + cmp r0, 0 + bge _080D9B06 + movs r0, 0 + strb r0, [r1, 0x13] +_080D9B06: + cmp r3, 0 + bne _080D9B30 + ldr r0, _080D9B2C + mov r2, r8 + lsls r1, r2, 2 + b _080D9F58 + .align 2, 0 +_080D9B14: .4byte 0x02021ec4 +_080D9B18: .4byte 0x08587f08 +_080D9B1C: .4byte 0x0858c2b4 +_080D9B20: .4byte 0x02039f34 +_080D9B24: .4byte 0x02021cc4 +_080D9B28: .4byte 0x02039e02 +_080D9B2C: .4byte 0x03005e00 +_080D9B30: + cmp r3, 0 + bge _080D9B48 + ldr r0, _080D9B40 + ldr r1, _080D9B44 + bl ExpandTextCodes + b _080D9B74 + .align 2, 0 +_080D9B40: .4byte 0x02021fc4 +_080D9B44: .4byte 0x0827e73c +_080D9B48: + cmp r3, 0 + ble _080D9B6C + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bgt _080D9B6C + ldr r0, _080D9B64 + ldr r1, _080D9B68 + bl ExpandTextCodes + b _080D9B74 + .align 2, 0 +_080D9B64: .4byte 0x02021fc4 +_080D9B68: .4byte 0x0827e717 +_080D9B6C: + ldr r0, _080D9B98 + ldr r1, _080D9B9C + bl ExpandTextCodes +_080D9B74: + ldr r0, _080D9B98 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080D9BA0 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0 + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] + cmp r5, 0 + bge _080D9BA4 + movs r0, 0x35 + strh r0, [r1, 0x8] + b _080DA100 + .align 2, 0 +_080D9B98: .4byte 0x02021fc4 +_080D9B9C: .4byte 0x0827e76a +_080D9BA0: .4byte 0x03005e00 +_080D9BA4: + movs r0, 0x36 + strh r0, [r1, 0x8] + b _080DA100 +_080D9BAA: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r4 + movs r0, 0x1C + ldrsh r3, [r4, r0] + cmp r3, 0x1 + beq _080D9BE8 + cmp r3, 0x1 + bgt _080D9BC6 + cmp r3, 0 + beq _080D9BD0 + b _080DA100 +_080D9BC6: + cmp r3, 0x2 + beq _080D9C0C + cmp r3, 0x3 + beq _080D9C46 + b _080DA100 +_080D9BD0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x1 + bl sub_80DDED0 + ldr r0, _080D9BE4 + bl fanfare_play + b _080D9C3E + .align 2, 0 +_080D9BE4: .4byte 0x00000187 +_080D9BE8: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + ldrb r0, [r0, 0x7] + ands r3, r0 + cmp r3, 0 + beq _080D9BF8 + b _080DA100 +_080D9BF8: + bl sub_80DED4C + cmp r0, 0 + beq _080D9C02 + b _080DA100 +_080D9C02: + movs r0, 0x1 + negs r0, r0 + bl sub_80DDCDC + b _080D9C3E +_080D9C0C: + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x20 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080D9C22 + b _080DA100 +_080D9C22: + ldrh r0, [r4, 0x1E] + adds r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + bgt _080D9C32 + b _080DA100 +_080D9C32: + strh r2, [r4, 0x1E] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + bl sub_80DDED0 +_080D9C3E: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080DA100 +_080D9C46: + ldr r0, _080D9C64 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080D9C58 + b _080DA100 +_080D9C58: + strh r0, [r4, 0x1C] + strh r0, [r4, 0x1E] + movs r0, 0x2B + strh r0, [r4, 0x8] + b _080DA100 + .align 2, 0 +_080D9C64: .4byte 0x02037fd4 +_080D9C68: + mov r3, r8 + lsls r1, r3, 2 + adds r0, r1, r3 + lsls r0, 3 + adds r0, r4 + movs r5, 0x1C + ldrsh r0, [r0, r5] + mov r10, r1 + cmp r0, 0x4 + bls _080D9C7E + b _080DA100 +_080D9C7E: + lsls r0, 2 + ldr r1, _080D9C88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080D9C88: .4byte _080D9C8C + .align 2, 0 +_080D9C8C: + .4byte _080D9CA0 + .4byte _080D9CB0 + .4byte _080D9CD4 + .4byte _080D9D3E + .4byte _080D9D84 +_080D9CA0: + bl sub_80DED4C + cmp r0, 0 + beq _080D9CAA + b _080DA100 +_080D9CAA: + movs r0, 0x1 + movs r1, 0x1 + b _080D9D68 +_080D9CB0: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D9CC2 + b _080DA100 +_080D9CC2: + bl sub_80DDE0C + movs r0, 0xDF + bl audio_play + movs r0, 0x1 + bl sub_80DDCDC + b _080D9D6C +_080D9CD4: + mov r3, r9 + ldr r2, [r3] + ldr r0, [r2] + ldrb r1, [r0, 0x6] + movs r0, 0x20 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080D9CEA + b _080DA100 +_080D9CEA: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r5, r0, r4 + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + bgt _080D9D02 + b _080DA100 +_080D9D02: + strh r3, [r5, 0x1E] + ldr r0, [r2, 0x4] + lsls r4, r6, 3 + subs r4, r6 + lsls r4, 2 + adds r0, r4, r0 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [r2, 0x10] + ldrb r1, [r1, 0x2] + lsls r1, 24 + asrs r1, 24 + adds r2, r6, 0 + bl sub_80DC028 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r1, 0x4] + adds r4, r0 + ldr r0, [r1, 0x10] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + ldrh r3, [r4, 0x2] + adds r0, r3 + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + b _080DA100 +_080D9D3E: + mov r4, r9 + ldr r2, [r4] + ldr r1, [r2, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9D54 + b _080DA100 +_080D9D54: + ldr r0, [r2] + ldrb r1, [r0, 0x6] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080D9D62 + b _080DA100 +_080D9D62: + movs r1, 0x1 + negs r1, r1 + movs r0, 0x1 +_080D9D68: + bl sub_80DDED0 +_080D9D6C: + ldr r0, _080D9D80 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + b _080DA100 + .align 2, 0 +_080D9D80: .4byte 0x03005e00 +_080D9D84: + ldr r0, _080D9DA8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080D9D96 + b _080DA100 +_080D9D96: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r3, [r0, 0x1C] + strh r3, [r0, 0x1E] + movs r1, 0x2B + strh r1, [r0, 0x8] + b _080DA100 + .align 2, 0 +_080D9DA8: .4byte 0x02037fd4 +_080D9DAC: + mov r5, r9 + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9DC2 + b _080DA100 +_080D9DC2: + bl sub_80DB89C + ldr r0, _080D9DD0 + mov r2, r8 + lsls r1, r2, 2 + b _080D9F58 + .align 2, 0 +_080D9DD0: .4byte 0x03005e00 +_080D9DD4: + bl sub_80DB89C + ldr r0, _080D9E3C + ldr r5, _080D9E40 + ldr r1, [r5] + ldr r1, [r1, 0x10] + ldr r1, [r1] + lsls r1, 20 + lsrs r1, 29 + lsls r1, 6 + ldr r4, _080D9E44 + adds r1, r4 + bl gf_strcpy + ldr r0, _080D9E48 + lsls r1, r6, 6 + adds r1, r4 + bl gf_strcpy + ldr r0, _080D9E4C + ldr r1, [r5] + ldr r2, [r1, 0x4] + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, _080D9E50 + adds r1, r2 + bl gf_strcpy + ldr r4, _080D9E54 + ldr r1, _080D9E58 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080D9E5C + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3A + strh r1, [r0, 0x8] + b _080DA100 + .align 2, 0 +_080D9E3C: .4byte 0x02021ec4 +_080D9E40: .4byte 0x02039f34 +_080D9E44: .4byte 0x02039e02 +_080D9E48: .4byte 0x02021cc4 +_080D9E4C: .4byte 0x02021dc4 +_080D9E50: .4byte 0x0831977c +_080D9E54: .4byte 0x02021fc4 +_080D9E58: .4byte 0x0827e7ea +_080D9E5C: .4byte 0x03005e00 +_080D9E60: + bl sub_80DED4C + cmp r0, 0 + beq _080D9E6A + b _080DA100 +_080D9E6A: + bl sub_80DB89C + ldr r4, _080D9E94 + ldr r1, _080D9E98 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080D9E9C + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3B + strh r1, [r0, 0x8] + b _080DA100 + .align 2, 0 +_080D9E94: .4byte 0x02021fc4 +_080D9E98: .4byte 0x0827e817 +_080D9E9C: .4byte 0x03005e00 +_080D9EA0: + bl sub_80DED4C + cmp r0, 0 + beq _080D9EAA + b _080DA100 +_080D9EAA: + bl sub_80DB89C + ldr r0, _080D9EB8 + mov r5, r8 + lsls r1, r5, 2 + b _080D9F58 + .align 2, 0 +_080D9EB8: .4byte 0x03005e00 +_080D9EBC: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r4, r0, 2 + adds r2, r4, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D9EDC + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] +_080D9EDC: + adds r0, r6, 0 + bl sub_80DC9B4 + ldr r0, _080D9F2C + lsls r1, r6, 6 + ldr r2, _080D9F30 + adds r1, r2 + bl gf_strcpy + ldr r0, _080D9F34 + mov r2, r9 + ldr r1, [r2] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + ldrh r2, [r1, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, _080D9F38 + adds r1, r2 + bl gf_strcpy + ldr r4, _080D9F3C + ldr r1, _080D9F40 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080D9F44 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x22 + strh r1, [r0, 0x8] + b _080DA100 + .align 2, 0 +_080D9F2C: .4byte 0x02021cc4 +_080D9F30: .4byte 0x02039e02 +_080D9F34: .4byte 0x02021dc4 +_080D9F38: .4byte 0x0831977c +_080D9F3C: .4byte 0x02021fc4 +_080D9F40: .4byte 0x0827e58a +_080D9F44: .4byte 0x03005e00 +_080D9F48: + bl sub_80DED4C + cmp r0, 0 + beq _080D9F52 + b _080DA100 +_080D9F52: + ldr r0, _080D9F64 + mov r4, r8 + lsls r1, r4, 2 +_080D9F58: + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x37 + strh r0, [r1, 0x8] + b _080DA100 + .align 2, 0 +_080D9F64: .4byte 0x03005e00 +_080D9F68: + bl sub_80DDBE8 + ldr r0, _080D9F80 + mov r5, r8 + lsls r1, r5, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x38 + strh r0, [r1, 0x8] + b _080DA100 + .align 2, 0 +_080D9F80: .4byte 0x03005e00 +_080D9F84: + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080D9F9A + b _080DA100 +_080D9F9A: + movs r0, 0x13 + ldrsb r0, [r2, r0] + cmp r0, 0x4 + ble _080D9FA8 + strb r1, [r2, 0x13] + bl sub_80DD940 +_080D9FA8: + ldr r0, _080D9FBC + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0xA + strh r0, [r1, 0x8] + b _080DA100 + .align 2, 0 +_080D9FBC: .4byte 0x03005e00 +_080D9FC0: + mov r3, r8 + lsls r2, r3, 2 + add r2, r8 + lsls r2, 3 + adds r2, r4 + ldrb r5, [r2, 0xC] + ldr r1, _080D9FE4 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, _080D9FE8 + str r1, [r0] + movs r0, 0xB + strh r0, [r2, 0x8] + b _080DA100 + .align 2, 0 +_080D9FE4: .4byte 0x02020630 +_080D9FE8: .4byte sub_80DA164 + 1 +_080D9FEC: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r4 + ldrb r5, [r4, 0xC] + ldr r1, _080DA020 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r6, r0, r1 + adds r0, r6, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080DA100 + adds r0, r6, 0 + bl obj_free_rotscale_entry + adds r0, r6, 0 + bl obj_delete_and_free_tiles + movs r0, 0x14 + strh r0, [r4, 0x8] + b _080DA100 + .align 2, 0 +_080DA020: .4byte 0x02020630 +_080DA024: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0 + strh r1, [r0, 0x1C] + movs r1, 0x15 + strh r1, [r0, 0x8] + b _080DA100 +_080DA038: + bl sub_80DB89C + ldr r0, _080DA06C + lsls r1, r6, 6 + ldr r2, _080DA070 + adds r1, r2 + bl gf_strcpy + ldr r4, _080DA074 + ldr r1, _080DA078 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080DA07C + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x20 + strh r1, [r0, 0x8] + b _080DA100 + .align 2, 0 +_080DA06C: .4byte 0x02021cc4 +_080DA070: .4byte 0x02039e02 +_080DA074: .4byte 0x02021fc4 +_080DA078: .4byte 0x0827d56f +_080DA07C: .4byte 0x03005e00 +_080DA080: + bl sub_80DED4C + cmp r0, 0 + bne _080DA100 + ldr r0, _080DA09C + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x15 + strh r0, [r1, 0x8] + b _080DA100 + .align 2, 0 +_080DA09C: .4byte 0x03005e00 +_080DA0A0: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r4 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _080DA100 + movs r0, 0 + strh r0, [r1, 0x1C] + movs r0, 0x16 + strh r0, [r1, 0x8] + b _080DA100 +_080DA0C2: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1, 0x10] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _080DA0F4 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r2, [r0, 0x8] + strh r2, [r0, 0xA] + strh r2, [r0, 0xC] + ldr r1, _080DA0F0 + str r1, [r0] + b _080DA100 + .align 2, 0 +_080DA0F0: .4byte sub_80DA198 + 1 +_080DA0F4: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r2, [r0, 0x8] +_080DA100: + 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_80D8B38 + + thumb_func_start sub_80DA110 +sub_80DA110: @ 80DA110 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DA130 + ldr r1, [r1] + ldr r3, [r1] + ldrb r2, [r3, 0x7] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r3, 0x7] + bl remove_task + pop {r0} + bx r0 + .align 2, 0 +_080DA130: .4byte 0x02039f34 + thumb_func_end sub_80DA110 + + thumb_func_start sub_80DA134 +sub_80DA134: @ 80DA134 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x24] + movs r3, 0x24 + ldrsh r2, [r1, r3] + cmp r2, 0 + beq _080DA148 + subs r0, 0x2 + strh r0, [r1, 0x24] + b _080DA15C +_080DA148: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _080DA15C + strh r2, [r1, 0x2E] + ldr r0, _080DA160 + str r0, [r1, 0x1C] +_080DA15C: + pop {r0} + bx r0 + .align 2, 0 +_080DA160: .4byte nullsub_12 + 1 + thumb_func_end sub_80DA134 + + thumb_func_start sub_80DA164 +sub_80DA164: @ 80DA164 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + subs r0, 0x6 + strh r0, [r2, 0x24] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r3, 0x24 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _080DA18E + ldr r0, _080DA194 + str r0, [r2, 0x1C] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080DA18E: + pop {r0} + bx r0 + .align 2, 0 +_080DA194: .4byte nullsub_12 + 1 + thumb_func_end sub_80DA164 + + thumb_func_start sub_80DA198 +sub_80DA198: @ 80DA198 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA1BC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080DA22E + cmp r0, 0x1 + bgt _080DA1C0 + cmp r0, 0 + beq _080DA1C6 + b _080DA250 + .align 2, 0 +_080DA1BC: .4byte 0x03005e00 +_080DA1C0: + cmp r0, 0x2 + beq _080DA248 + b _080DA250 +_080DA1C6: + ldr r0, _080DA214 + ldrb r1, [r0] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080DA224 + ldr r0, _080DA218 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x7] + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080DA1F4 + bl sub_80DB944 + bl sub_80DBA18 +_080DA1F4: + ldr r4, _080DA21C + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA220 + adds r1, r4, 0 + bl set_task_function_and_args_14_15 + bl sub_80DBF68 + strh r6, [r5, 0x8] + b _080DA250 + .align 2, 0 +_080DA214: .4byte 0x02039f2a +_080DA218: .4byte 0x02039f34 +_080DA21C: .4byte sub_80FCC88 + 1 +_080DA220: .4byte sub_80DA110 + 1 +_080DA224: + bl sub_80DB944 + bl sub_80DBA18 + b _080DA23E +_080DA22E: + ldr r0, _080DA244 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080DA250 +_080DA23E: + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080DA250 + .align 2, 0 +_080DA244: .4byte 0x02039f34 +_080DA248: + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, _080DA258 + str r0, [r5] +_080DA250: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DA258: .4byte sub_80DA25C + 1 + thumb_func_end sub_80DA198 + + thumb_func_start sub_80DA25C +sub_80DA25C: @ 80DA25C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_80DE008 + ldr r1, _080DA284 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + ldr r1, _080DA288 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA284: .4byte 0x03005e00 +_080DA288: .4byte sub_80DA28C + 1 + thumb_func_end sub_80DA25C + + thumb_func_start sub_80DA28C +sub_80DA28C: @ 80DA28C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA2B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080DA2D2 + cmp r5, 0x1 + bgt _080DA2B4 + cmp r5, 0 + beq _080DA2BA + b _080DA312 + .align 2, 0 +_080DA2B0: .4byte 0x03005e00 +_080DA2B4: + cmp r5, 0x2 + beq _080DA304 + b _080DA312 +_080DA2BA: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080DA312 + movs r0, 0x2 + bl sub_80DE69C + strh r5, [r4, 0xA] + b _080DA2F6 +_080DA2D2: + ldr r0, _080DA300 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080DA312 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080DA312 + strh r1, [r4, 0xA] +_080DA2F6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080DA312 + .align 2, 0 +_080DA300: .4byte 0x02039f34 +_080DA304: + bl sub_80DC3AC + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + ldr r0, _080DA318 + str r0, [r4] +_080DA312: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DA318: .4byte sub_80DA31C + 1 + thumb_func_end sub_80DA28C + + thumb_func_start sub_80DA31C +sub_80DA31C: @ 80DA31C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80DC3C4 + lsls r0, 24 + cmp r0, 0 + beq _080DA33A + ldr r0, _080DA340 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080DA344 + str r0, [r1] +_080DA33A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA340: .4byte 0x03005e00 +_080DA344: .4byte sub_80DA348 + 1 + thumb_func_end sub_80DA31C + + thumb_func_start sub_80DA348 +sub_80DA348: @ 80DA348 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA374 + ldr r3, _080DA378 + ldr r1, _080DA37C + str r2, [r1] + str r3, [r1, 0x4] + ldr r2, _080DA380 + str r2, [r1, 0x8] + ldr r1, [r1, 0x8] + ldr r2, _080DA384 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0xA] + ldr r0, _080DA388 + str r0, [r1] + bx lr + .align 2, 0 +_080DA374: .4byte 0x0201a204 +_080DA378: .4byte 0x02037714 +_080DA37C: .4byte 0x040000d4 +_080DA380: .4byte 0x84000100 +_080DA384: .4byte 0x03005e00 +_080DA388: .4byte sub_80DA38C + 1 + thumb_func_end sub_80DA348 + + thumb_func_start sub_80DA38C +sub_80DA38C: @ 80DA38C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA3C4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080DA3BE + movs r0, 0 + strh r0, [r1, 0x8] + ldrh r0, [r1, 0xA] + subs r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080DA3BE + ldr r0, _080DA3C8 + str r0, [r1] +_080DA3BE: + pop {r0} + bx r0 + .align 2, 0 +_080DA3C4: .4byte 0x03005e00 +_080DA3C8: .4byte sub_80DA3CC + 1 + thumb_func_end sub_80DA38C + + thumb_func_start sub_80DA3CC +sub_80DA3CC: @ 80DA3CC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA42C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080DA448 + ldr r0, _080DA430 + ldr r0, [r0] + ldr r5, _080DA434 + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x1A] + bl sub_80DB89C + ldr r0, _080DA438 + ldrb r1, [r5] + lsls r1, 6 + ldr r2, _080DA43C + adds r1, r2 + bl gf_strcpy + ldr r5, _080DA440 + ldr r0, _080DA444 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl ExpandTextCodes + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _080DA45A + .align 2, 0 +_080DA42C: .4byte 0x03005e00 +_080DA430: .4byte 0x02039f34 +_080DA434: .4byte 0x02039f25 +_080DA438: .4byte 0x02021cc4 +_080DA43C: .4byte 0x02039e02 +_080DA440: .4byte 0x02021fc4 +_080DA444: .4byte 0x08587d90 +_080DA448: + bl sub_80DED4C + cmp r0, 0 + bne _080DA45A + strh r0, [r6, 0x8] + ldr r0, _080DA460 + str r0, [r6] + bl sub_80DCD48 +_080DA45A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DA460: .4byte sub_80DA464 + 1 + thumb_func_end sub_80DA3CC + + thumb_func_start sub_80DA464 +sub_80DA464: @ 80DA464 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA494 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _080DA48E + movs r0, 0 + strh r0, [r4, 0x8] + bl sub_80DC3AC + ldr r0, _080DA498 + str r0, [r4] +_080DA48E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA494: .4byte 0x03005e00 +_080DA498: .4byte sub_80DA49C + 1 + thumb_func_end sub_80DA464 + + thumb_func_start sub_80DA49C +sub_80DA49C: @ 80DA49C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80DC3C4 + lsls r0, 24 + cmp r0, 0 + beq _080DA4BE + ldr r1, _080DA4C4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, _080DA4C8 + str r1, [r0] +_080DA4BE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA4C4: .4byte 0x03005e00 +_080DA4C8: .4byte sub_80DA4CC + 1 + thumb_func_end sub_80DA49C + + thumb_func_start sub_80DA4CC +sub_80DA4CC: @ 80DA4CC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80DE224 + ldr r1, _080DA4EC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080DA4F0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA4EC: .4byte 0x03005e00 +_080DA4F0: .4byte sub_80DE424 + 1 + thumb_func_end sub_80DA4CC + + thumb_func_start sub_80DA4F4 +sub_80DA4F4: @ 80DA4F4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80DE350 + ldr r1, _080DA514 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080DA518 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA514: .4byte 0x03005e00 +_080DA518: .4byte sub_80DA51C + 1 + thumb_func_end sub_80DA4F4 + + thumb_func_start sub_80DA51C +sub_80DA51C: @ 80DA51C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x8 + bl lcd_io_get + mov r1, sp + strh r0, [r1] + movs r0, 0xC + bl lcd_io_get + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r3, sp + ldrb r2, [r3] + movs r1, 0x4 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + ldrb r0, [r4] + ands r1, r0 + strb r1, [r4] + mov r0, sp + ldrh r1, [r0] + movs r0, 0x8 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0xC + bl lcd_io_set + ldr r2, _080DA584 + ldr r0, [r2] + ldr r1, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, [r2] + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x5 + bne _080DA590 + ldr r0, _080DA588 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080DA58C + b _080DA5A0 + .align 2, 0 +_080DA584: .4byte 0x02039f34 +_080DA588: .4byte 0x03005e00 +_080DA58C: .4byte sub_80DA5E8 + 1 +_080DA590: + bl sub_80DDB0C + ldr r0, _080DA5AC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _080DA5B0 +_080DA5A0: + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DA5AC: .4byte 0x03005e00 +_080DA5B0: .4byte sub_80DA5B4 + 1 + thumb_func_end sub_80DA51C + + thumb_func_start sub_80DA5B4 +sub_80DA5B4: @ 80DA5B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080DA5DC + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080DA5D8 + ldr r0, _080DA5E0 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080DA5E4 + str r0, [r1] +_080DA5D8: + pop {r0} + bx r0 + .align 2, 0 +_080DA5DC: .4byte 0x02039f34 +_080DA5E0: .4byte 0x03005e00 +_080DA5E4: .4byte sub_80D833C + 1 + thumb_func_end sub_80DA5B4 + + thumb_func_start sub_80DA5E8 +sub_80DA5E8: @ 80DA5E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080DA644 + movs r1, 0 + strh r1, [r0] + ldr r0, _080DA648 + strh r1, [r0] + ldr r4, _080DA64C + movs r3, 0 + ldr r2, _080DA650 + movs r1, 0x3 +_080DA600: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r0, r3, r0 + ldrh r0, [r0, 0x4] + strh r0, [r2] + adds r3, 0x1C + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080DA600 + bl sub_80DBD18 + bl sub_80DB89C + ldr r0, _080DA654 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DA65C + ldr r0, _080DA64C + ldr r2, [r0] + ldr r0, _080DA658 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x8] + bl sub_80ED03C + b _080DA668 + .align 2, 0 +_080DA644: .4byte 0x02022e16 +_080DA648: .4byte 0x02022e1e +_080DA64C: .4byte 0x02039f34 +_080DA650: .4byte 0x02039f10 +_080DA654: .4byte 0x02039f2a +_080DA658: .4byte 0x02039f25 +_080DA65C: + bl sub_80DF250 + bl sub_80DF4F8 + bl sub_80DF750 +_080DA668: + ldr r1, _080DA69C + ldr r0, _080DA6A0 + ldr r0, [r0] + str r0, [r1] + ldr r4, _080DA6A4 + ldr r1, _080DA6A8 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, _080DA6AC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, _080DA6B0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DA69C: .4byte 0x030060b8 +_080DA6A0: .4byte 0x03005d80 +_080DA6A4: .4byte 0x02021fc4 +_080DA6A8: .4byte 0x0827d597 +_080DA6AC: .4byte 0x03005e00 +_080DA6B0: .4byte sub_80DA6B4 + 1 + thumb_func_end sub_80DA5E8 + + thumb_func_start sub_80DA6B4 +sub_80DA6B4: @ 80DA6B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80DED4C + adds r4, r0, 0 + cmp r4, 0 + bne _080DA6EA + bl sub_80DE224 + ldr r0, _080DA6F0 + strh r4, [r0] + ldr r1, _080DA6F4 + movs r0, 0xA0 + strh r0, [r1] + movs r0, 0x62 + movs r1, 0 + bl audio_play_and_stuff + ldr r1, _080DA6F8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + ldr r1, _080DA6FC + str r1, [r0] +_080DA6EA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DA6F0: .4byte 0x02022e18 +_080DA6F4: .4byte 0x02022e1a +_080DA6F8: .4byte 0x03005e00 +_080DA6FC: .4byte sub_80DA700 + 1 + thumb_func_end sub_80DA6B4 + + thumb_func_start sub_80DA700 +sub_80DA700: @ 80DA700 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _080DA734 + ldrh r0, [r1] + subs r0, 0x7 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bge _080DA718 + movs r0, 0 + strh r0, [r1] +_080DA718: + ldrh r2, [r1] + cmp r2, 0 + bne _080DA72E + ldr r0, _080DA738 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldr r0, _080DA73C + str r0, [r1] + strh r2, [r1, 0x8] +_080DA72E: + pop {r0} + bx r0 + .align 2, 0 +_080DA734: .4byte 0x02022e1a +_080DA738: .4byte 0x03005e00 +_080DA73C: .4byte sub_80DA740 + 1 + thumb_func_end sub_80DA700 + + thumb_func_start sub_80DA740 +sub_80DA740: @ 80DA740 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA774 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x31 + ble _080DA794 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _080DA778 + ldrb r0, [r0] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080DA780 + ldr r0, _080DA77C + b _080DA792 + .align 2, 0 +_080DA774: .4byte 0x03005e00 +_080DA778: .4byte 0x02039f2a +_080DA77C: .4byte sub_80DA7A0 + 1 +_080DA780: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080DA79C +_080DA792: + str r0, [r4] +_080DA794: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DA79C: .4byte sub_80DA830 + 1 + thumb_func_end sub_80DA740 + + thumb_func_start sub_80DA7A0 +sub_80DA7A0: @ 80DA7A0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080DA7DC + adds r0, r5, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DA7E0 + adds r1, r5, 0 + bl set_task_function_and_args_14_15 + ldr r1, _080DA7E4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080DA7E8 + str r1, [r0] + bl sub_80DBF68 + movs r0, 0 + bl sub_80DC490 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DA7DC: .4byte sub_80FCACC + 1 +_080DA7E0: .4byte sub_80DA7EC + 1 +_080DA7E4: .4byte 0x03005e00 +_080DA7E8: .4byte nullsub_41 + 1 + thumb_func_end sub_80DA7A0 + + thumb_func_start sub_80DA7EC +sub_80DA7EC: @ 80DA7EC + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r2, _080DA824 + ldr r0, _080DA828 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _080DA82C + str r1, [r0] + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080DA824: .4byte 0x03005e00 +_080DA828: .4byte 0x02039f34 +_080DA82C: .4byte sub_80DA830 + 1 + thumb_func_end sub_80DA7EC + + thumb_func_start sub_80DA830 +sub_80DA830: @ 80DA830 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080DA864 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080DA860 + adds r0, r2, 0 + bl remove_task + ldr r0, _080DA868 + ldr r1, _080DA86C + str r1, [r0] + bl Window_FreeMemory + bl sub_80D7A5C + bl sub_805F094 + ldr r0, _080DA870 + bl set_callback2 +_080DA860: + pop {r0} + bx r0 + .align 2, 0 +_080DA864: .4byte 0x02037fd4 +_080DA868: .4byte 0x03005dac +_080DA86C: .4byte sub_80DA874 + 1 +_080DA870: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_80DA830 + + thumb_func_start sub_80DA874 +sub_80DA874: @ 80DA874 + push {lr} + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80DA874 + + thumb_func_start sub_80DA884 +sub_80DA884: @ 80DA884 + push {lr} + ldr r0, _080DA89C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DA898 + ldr r1, _080DA8A0 + movs r0, 0x3 + strb r0, [r1] +_080DA898: + pop {r0} + bx r0 + .align 2, 0 +_080DA89C: .4byte 0x02039f2a +_080DA8A0: .4byte 0x02039f25 + thumb_func_end sub_80DA884 + + thumb_func_start sub_80DA8A4 +sub_80DA8A4: @ 80DA8A4 + push {lr} + ldr r0, _080DA8B8 + ldr r1, _080DA8BC + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080DA8C0 + movs r0, 0 + b _080DA8C2 + .align 2, 0 +_080DA8B8: .4byte 0x02039f25 +_080DA8BC: .4byte 0x02039f2b +_080DA8C0: + movs r0, 0x1 +_080DA8C2: + pop {r1} + bx r1 + thumb_func_end sub_80DA8A4 + + thumb_func_start sub_80DA8C8 +sub_80DA8C8: @ 80DA8C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, _080DA918 + ldr r1, [r6] + mov r0, sp + bl gf_strcpy + ldr r0, _080DA91C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DA8F2 + mov r0, sp + bl sub_80DF9D4 +_080DA8F2: + ldr r5, _080DA920 + ldrb r0, [r5] + lsls r0, 6 + ldr r4, _080DA924 + adds r0, r4 + mov r1, sp + movs r2, 0x8 + bl memcpy + ldr r0, [r6] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080DA928 + ldrb r0, [r5] + lsls r0, 6 + adds r0, r4, r0 + movs r1, 0xD8 + b _080DA930 + .align 2, 0 +_080DA918: .4byte 0x03005d90 +_080DA91C: .4byte 0x02039f2a +_080DA920: .4byte 0x02039f25 +_080DA924: .4byte 0x02039e0d +_080DA928: + ldrb r0, [r5] + lsls r0, 6 + adds r0, r4, r0 + movs r1, 0xD9 +_080DA930: + strb r1, [r0, 0x8] + ldr r7, _080DAAB4 + ldr r6, _080DAAB8 + ldrb r0, [r6] + lsls r0, 6 + adds r1, r7, 0 + adds r1, 0x18 + adds r0, r1 + movs r1, 0 + str r1, [r0] + ldrb r0, [r6] + lsls r0, 6 + adds r0, r7 + adds r0, 0x2C + strb r1, [r0] + movs r0, 0x64 + mov r1, r8 + muls r1, r0 + ldr r0, _080DAABC + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + ldr r0, _080DAAC0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DA994 + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + adds r1, r0, 0 + mov r0, sp + bl sub_80DF9E0 +_080DA994: + ldrb r0, [r6] + lsls r0, 6 + adds r4, r7, 0x2 + adds r0, r4 + mov r1, sp + movs r2, 0xB + bl memcpy + ldrb r0, [r6] + lsls r0, 6 + adds r0, r4 + mov r1, sp + bl gf_strcpy + adds r0, r5, 0 + movs r1, 0x16 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x26 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x17 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x27 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x18 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x28 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x21 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x29 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x2F + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x2A + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x30 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x2B + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0xD + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x1E] + adds r0, r5, 0 + movs r1, 0xE + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x20] + adds r0, r5, 0 + movs r1, 0xF + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x22] + adds r0, r5, 0 + movs r1, 0x10 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x24] + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r2, r7, 0 + adds r2, 0x38 + adds r1, r2 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x1 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r2, r7, 0 + adds r2, 0x3C + adds r1, r2 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r0, [r6] + lsls r0, 6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x26 + ldrb r3, [r0] + adds r0, 0x1 + ldrb r5, [r0] + adds r0, 0x1 + ldrb r6, [r0] + adds r0, 0x1 + ldrb r7, [r0] + adds r0, 0x1 + ldrb r4, [r0] + cmp r2, 0xFE + bne _080DAAC4 + adds r3, 0x14 + b _080DAB12 + .align 2, 0 +_080DAAB4: .4byte 0x02039e00 +_080DAAB8: .4byte 0x02039f25 +_080DAABC: .4byte 0x020244ec +_080DAAC0: .4byte 0x02039f2a +_080DAAC4: + cmp r2, 0xFF + bne _080DAAD4 + lsls r0, r5, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r5, r0, 16 + b _080DAB12 +_080DAAD4: + movs r0, 0x80 + lsls r0, 1 + cmp r2, r0 + bne _080DAAE8 + lsls r0, r6, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r6, r0, 16 + b _080DAB12 +_080DAAE8: + ldr r0, _080DAAFC + cmp r2, r0 + bne _080DAB00 + lsls r0, r7, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r7, r0, 16 + b _080DAB12 + .align 2, 0 +_080DAAFC: .4byte 0x00000101 +_080DAB00: + movs r0, 0x81 + lsls r0, 1 + cmp r2, r0 + bne _080DAB12 + lsls r0, r4, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 +_080DAB12: + cmp r3, 0xFF + ble _080DAB18 + movs r3, 0xFF +_080DAB18: + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB22 + movs r5, 0xFF +_080DAB22: + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB2C + movs r6, 0xFF +_080DAB2C: + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB36 + movs r7, 0xFF +_080DAB36: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB40 + movs r4, 0xFF +_080DAB40: + ldr r2, _080DAB84 + ldr r1, _080DAB88 + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x26 + strb r3, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x27 + strb r5, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x28 + strb r6, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x29 + strb r7, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x2A + strb r4, [r0] + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DAB84: .4byte 0x02039e00 +_080DAB88: .4byte 0x02039f25 + thumb_func_end sub_80DA8C8 + + thumb_func_start sub_80DAB8C +sub_80DAB8C: @ 80DAB8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x64 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r6, 0 + movs r7, 0 + bl sub_80DA884 + ldr r0, _080DABDC + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080DABC0 + ldr r0, _080DABE0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DABC0 + movs r7, 0x1 +_080DABC0: + movs r5, 0 + ldr r2, _080DABE4 + ldr r3, _080DABE8 +_080DABC6: + ldrb r0, [r2, 0x1C] + lsls r0, 30 + lsrs r0, 30 + cmp r8, r0 + bne _080DAC3A + cmp r7, 0x1 + bne _080DABEC + ldrb r0, [r3] + cmp r0, 0x1 + beq _080DAC3A + b _080DABF2 + .align 2, 0 +_080DABDC: .4byte 0x00000864 +_080DABE0: .4byte 0x02039f2a +_080DABE4: .4byte 0x085880a4 +_080DABE8: .4byte 0x085898a4 +_080DABEC: + ldrb r0, [r3] + cmp r0, 0x2 + beq _080DAC3A +_080DABF2: + cmp r4, 0 + bne _080DABFE + ldrb r0, [r2, 0x1C] + lsls r0, 29 + cmp r0, 0 + blt _080DAC2E +_080DABFE: + cmp r4, 0x1 + bne _080DAC0A + ldrb r0, [r2, 0x1C] + lsls r0, 28 + cmp r0, 0 + blt _080DAC2E +_080DAC0A: + cmp r4, 0x2 + bne _080DAC16 + ldrb r0, [r2, 0x1C] + lsls r0, 27 + cmp r0, 0 + blt _080DAC2E +_080DAC16: + cmp r4, 0x3 + bne _080DAC22 + ldrb r0, [r2, 0x1C] + lsls r0, 26 + cmp r0, 0 + blt _080DAC2E +_080DAC22: + cmp r4, 0x4 + bne _080DAC3A + ldrb r0, [r2, 0x1C] + lsls r0, 25 + cmp r0, 0 + bge _080DAC3A +_080DAC2E: + adds r0, r6, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + add r0, sp + strb r5, [r0] +_080DAC3A: + adds r2, 0x40 + adds r3, 0x1 + adds r5, 0x1 + cmp r5, 0x5F + bls _080DABC6 + mov r0, sp + adds r1, r0, r6 + movs r0, 0xFF + strb r0, [r1] + movs r5, 0 + ldr r7, _080DACB0 +_080DAC50: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080DACB4 + lsls r2, r5, 6 + adds r2, r1 + mov r1, sp + adds r4, r1, r0 + ldrb r1, [r4] + lsls r1, 6 + adds r1, r7 + adds r0, r2, 0 + movs r2, 0x40 + bl memcpy + ldrb r0, [r4] + adds r2, r5, 0x1 + subs r1, r6, 0x1 + cmp r0, 0xFF + beq _080DAC92 + adds r3, r4, 0 +_080DAC86: + ldrb r0, [r3, 0x1] + strb r0, [r3] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0xFF + bne _080DAC86 +_080DAC92: + lsls r0, r1, 24 + lsrs r6, r0, 24 + adds r5, r2, 0 + cmp r5, 0x2 + ble _080DAC50 + ldr r0, _080DACB8 + ldrb r0, [r0] + bl sub_80DA8C8 + add sp, 0x64 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DACB0: .4byte 0x085880a4 +_080DACB4: .4byte 0x02039e00 +_080DACB8: .4byte 0x02039f24 + thumb_func_end sub_80DAB8C + + thumb_func_start sub_80DACBC +sub_80DACBC: @ 80DACBC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x64 + mov r8, r2 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + movs r7, 0 + ldr r0, _080DACFC + ldrb r1, [r0] + mov r9, r0 + cmp r1, 0x4 + bne _080DACDE + b _080DADF6 +_080DACDE: + movs r5, 0 + ldr r3, _080DAD00 + ldr r6, _080DAD04 +_080DACE4: + ldrb r0, [r3, 0x1C] + lsls r0, 30 + lsrs r0, 30 + cmp r2, r0 + bne _080DAD56 + mov r0, r8 + cmp r0, 0x1 + bne _080DAD08 + ldrb r0, [r6] + cmp r0, 0x1 + beq _080DAD56 + b _080DAD0E + .align 2, 0 +_080DACFC: .4byte 0x02039f30 +_080DAD00: .4byte 0x085880a4 +_080DAD04: .4byte 0x085898a4 +_080DAD08: + ldrb r0, [r6] + cmp r0, 0x2 + beq _080DAD56 +_080DAD0E: + cmp r4, 0 + bne _080DAD1A + ldrb r0, [r3, 0x1C] + lsls r0, 29 + cmp r0, 0 + blt _080DAD4A +_080DAD1A: + cmp r4, 0x1 + bne _080DAD26 + ldrb r0, [r3, 0x1C] + lsls r0, 28 + cmp r0, 0 + blt _080DAD4A +_080DAD26: + cmp r4, 0x2 + bne _080DAD32 + ldrb r0, [r3, 0x1C] + lsls r0, 27 + cmp r0, 0 + blt _080DAD4A +_080DAD32: + cmp r4, 0x3 + bne _080DAD3E + ldrb r0, [r3, 0x1C] + lsls r0, 26 + cmp r0, 0 + blt _080DAD4A +_080DAD3E: + cmp r4, 0x4 + bne _080DAD56 + ldrb r0, [r3, 0x1C] + lsls r0, 25 + cmp r0, 0 + bge _080DAD56 +_080DAD4A: + adds r0, r7, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r7, r1, 24 + add r0, sp + strb r5, [r0] +_080DAD56: + adds r3, 0x40 + adds r6, 0x1 + adds r5, 0x1 + cmp r5, 0x5F + bls _080DACE4 + mov r3, sp + adds r1, r3, r7 + movs r0, 0xFF + strb r0, [r1] + movs r5, 0 + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x4 + subs r0, r1 + cmp r5, r0 + bge _080DADF6 + ldr r3, _080DAE04 + mov r8, r3 + mov r6, r9 + movs r0, 0x2 + add r0, r8 + mov r9, r0 +_080DAD82: + bl sub_80F903C + lsls r0, 16 + lsrs r0, 16 + adds r1, r7, 0 + bl __modsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldrb r0, [r6] + adds r0, r5 + lsls r0, 6 + add r0, r8 + ldr r2, _080DAE08 + mov r3, sp + adds r4, r3, r1 + ldrb r1, [r4] + lsls r1, 6 + adds r1, r2 + movs r2, 0x40 + bl memcpy + ldrb r0, [r6] + adds r0, r5 + lsls r0, 6 + mov r1, r8 + adds r1, 0xD + adds r0, r1 + bl sub_80DF9D4 + ldrb r0, [r6] + adds r0, r5 + lsls r0, 6 + add r0, r9 + movs r1, 0x2 + bl sub_80DF9E0 + ldrb r0, [r4] + adds r3, r5, 0x1 + subs r1, r7, 0x1 + cmp r0, 0xFF + beq _080DADE6 + adds r2, r4, 0 +_080DADDA: + ldrb r0, [r2, 0x1] + strb r0, [r2] + adds r2, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _080DADDA +_080DADE6: + lsls r0, r1, 24 + lsrs r7, r0, 24 + adds r5, r3, 0 + ldrb r1, [r6] + movs r0, 0x4 + subs r0, r1 + cmp r5, r0 + blt _080DAD82 +_080DADF6: + add sp, 0x64 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DAE04: .4byte 0x02039e00 +_080DAE08: .4byte 0x085880a4 + thumb_func_end sub_80DACBC + + thumb_func_start sub_80DAE0C +sub_80DAE0C: @ 80DAE0C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _080DAE1E + movs r0, 0x3 + b _080DAE9A +_080DAE1E: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080DAE2E + movs r0, 0x4 + b _080DAE9A +_080DAE2E: + ldr r0, _080DAE40 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080DAE82 + lsls r0, 2 + ldr r1, _080DAE44 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DAE40: .4byte 0x02039f2c +_080DAE44: .4byte _080DAE48 + .align 2, 0 +_080DAE48: + .4byte _080DAE5C + .4byte _080DAE62 + .4byte _080DAE68 + .4byte _080DAE6E + .4byte _080DAE74 +_080DAE5C: + adds r0, r4, 0 + movs r1, 0x32 + b _080DAE78 +_080DAE62: + adds r0, r4, 0 + movs r1, 0x33 + b _080DAE78 +_080DAE68: + adds r0, r4, 0 + movs r1, 0x34 + b _080DAE78 +_080DAE6E: + adds r0, r4, 0 + movs r1, 0x35 + b _080DAE78 +_080DAE74: + adds r0, r4, 0 + movs r1, 0x36 +_080DAE78: + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + b _080DAE86 +_080DAE82: + movs r0, 0 + b _080DAE9A +_080DAE86: + ldr r0, _080DAEA0 + adds r2, r1, 0 + ldrh r1, [r0] + movs r0, 0x2 + cmp r2, r1 + bhi _080DAE9A + movs r0, 0 + cmp r2, r1 + bcc _080DAE9A + movs r0, 0x1 +_080DAE9A: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080DAEA0: .4byte 0x02039f2e + thumb_func_end sub_80DAE0C + + thumb_func_start sub_80DAEA4 +sub_80DAEA4: @ 80DAEA4 + push {r4,r5,lr} + movs r5, 0 +_080DAEA8: + ldr r0, _080DAED0 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0 + bl Window_FastFillPixels + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80DAF04 + adds r0, r4, 0 + bl sub_80DAF88 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DAEA8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DAED0: .4byte 0x02039f26 + thumb_func_end sub_80DAEA4 + + thumb_func_start sub_80DAED4 +sub_80DAED4: @ 80DAED4 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r0, _080DAEFC + ldr r1, _080DAF00 + bl gf_strcpy + adds r1, r0, 0 + subs r0, r1, 0x1 + strb r4, [r0] + adds r0, r1, 0 + adds r1, r5, 0 + bl gf_strcpy + adds r1, r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080DAEFC: .4byte 0x02022e2c +_080DAF00: .4byte 0x085ed1ab + thumb_func_end sub_80DAED4 + + thumb_func_start sub_80DAF04 +sub_80DAF04: @ 80DAF04 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r0, r1, 24 + movs r2, 0xA0 + lsls r2, 20 + adds r1, r2 + lsrs r1, 24 + bl sub_80DAF1C + pop {r0} + bx r0 + thumb_func_end sub_80DAF04 + + thumb_func_start sub_80DAF1C +sub_80DAF1C: @ 80DAF1C + push {r4,r5,lr} + sub sp, 0x24 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _080DAF78 + add r0, sp, 0x4 + bl gf_strcpy + lsls r1, r5, 6 + ldr r0, _080DAF7C + adds r1, r0 + add r0, sp, 0x4 + bl gf_strcat + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_80DAED4 + ldr r4, _080DAF80 + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x60 + bl sub_81DB368 + adds r2, r0, 0 + cmp r2, 0x37 + ble _080DAF5C + movs r2, 0x37 +_080DAF5C: + ldr r0, _080DAF84 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x7 + str r1, [sp] + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80DEBD0 + add sp, 0x24 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DAF78: .4byte 0x085e8d3e +_080DAF7C: .4byte 0x02039e0d +_080DAF80: .4byte 0x02022e2c +_080DAF84: .4byte 0x02039f26 + thumb_func_end sub_80DAF1C + + thumb_func_start sub_80DAF88 +sub_80DAF88: @ 80DAF88 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r0, r1, 24 + movs r2, 0xA0 + lsls r2, 20 + adds r1, r2 + lsrs r1, 24 + bl sub_80DAFA0 + pop {r0} + bx r0 + thumb_func_end sub_80DAF88 + + thumb_func_start sub_80DAFA0 +sub_80DAFA0: @ 80DAFA0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r4, 6 + ldr r2, _080DAFD4 + adds r0, r2 + bl sub_80DAED4 + ldr r0, _080DAFD8 + adds r4, r0 + ldrb r0, [r4] + ldr r1, _080DAFDC + movs r2, 0x7 + str r2, [sp] + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DAFD4: .4byte 0x02039e02 +_080DAFD8: .4byte 0x02039f26 +_080DAFDC: .4byte 0x02022e2c + thumb_func_end sub_80DAFA0 + + thumb_func_start sub_80DAFE0 +sub_80DAFE0: @ 80DAFE0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0x4 + bhi _080DB06C + lsls r0, 2 + ldr r1, _080DAFF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DAFF8: .4byte _080DAFFC + .align 2, 0 +_080DAFFC: + .4byte _080DB010 + .4byte _080DB028 + .4byte _080DB040 + .4byte _080DB050 + .4byte _080DB06C +_080DB010: + ldr r0, _080DB024 + lsls r2, 6 + adds r1, r2, r0 + adds r3, r1, 0 + adds r3, 0x26 + ldrb r5, [r3] + adds r3, 0x4 + ldrb r4, [r3] + adds r1, 0x27 + b _080DB07E + .align 2, 0 +_080DB024: .4byte 0x02039e00 +_080DB028: + ldr r0, _080DB03C + lsls r2, 6 + adds r1, r2, r0 + adds r3, r1, 0 + adds r3, 0x27 + ldrb r5, [r3] + subs r3, 0x1 + ldrb r4, [r3] + adds r1, 0x28 + b _080DB07E + .align 2, 0 +_080DB03C: .4byte 0x02039e00 +_080DB040: + ldr r1, _080DB04C + lsls r2, 6 + adds r3, r2, r1 + adds r0, r3, 0 + adds r0, 0x28 + b _080DB05A + .align 2, 0 +_080DB04C: .4byte 0x02039e00 +_080DB050: + ldr r1, _080DB068 + lsls r2, 6 + adds r3, r2, r1 + adds r0, r3, 0 + adds r0, 0x29 +_080DB05A: + ldrb r5, [r0] + subs r0, 0x1 + ldrb r4, [r0] + adds r0, 0x2 + ldrb r3, [r0] + adds r0, r1, 0 + b _080DB080 + .align 2, 0 +_080DB068: .4byte 0x02039e00 +_080DB06C: + ldr r0, _080DB098 + lsls r2, 6 + adds r1, r2, r0 + adds r3, r1, 0 + adds r3, 0x2A + ldrb r5, [r3] + subs r3, 0x1 + ldrb r4, [r3] + adds r1, 0x26 +_080DB07E: + ldrb r3, [r1] +_080DB080: + adds r1, r2, r0 + adds r1, 0x2B + adds r0, r4, r3 + ldrb r1, [r1] + adds r0, r1 + asrs r0, 1 + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080DB098: .4byte 0x02039e00 + thumb_func_end sub_80DAFE0 + + thumb_func_start sub_80DB09C +sub_80DB09C: @ 80DB09C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, _080DB0C0 +_080DB0A6: + lsls r0, r4, 24 + lsrs r0, 24 + adds r1, r6, 0 + bl sub_80DAFE0 + strh r0, [r5] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB0A6 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DB0C0: .4byte 0x02039f00 + thumb_func_end sub_80DB09C + + thumb_func_start sub_80DB0C4 +sub_80DB0C4: @ 80DB0C4 + push {r4,r5,lr} + ldr r0, _080DB10C + bl gpu_tile_obj_decompress_and_load + ldr r0, _080DB110 + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + ldr r0, _080DB114 + movs r1, 0x70 + movs r2, 0x24 + movs r3, 0x1E + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080DB118 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r5, r2, r4 + ldrb r3, [r5, 0x5] + movs r1, 0xF + ands r1, r3 + movs r3, 0x10 + orrs r1, r3 + strb r1, [r5, 0x5] + adds r4, 0x1C + adds r2, r4 + ldr r1, _080DB11C + str r1, [r2] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080DB10C: .4byte 0x08587c00 +_080DB110: .4byte 0x08c1c6b8 +_080DB114: .4byte 0x08587be8 +_080DB118: .4byte 0x02020630 +_080DB11C: .4byte nullsub_12 + 1 + thumb_func_end sub_80DB0C4 + + thumb_func_start sub_80DB120 +sub_80DB120: @ 80DB120 + push {lr} + ldr r0, _080DB164 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080DB168 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _080DB16C + movs r1, 0x60 + movs r2, 0xA + movs r3, 0x1D + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DB170 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3E + adds r1, r2 + mov r12, r1 + ldrb r1, [r1] + movs r3, 0x4 + orrs r1, r3 + mov r3, r12 + strb r1, [r3] + ldrh r1, [r2, 0x4] + lsls r1, 22 + lsrs r1, 22 + strh r1, [r2, 0x2E] + pop {r1} + bx r1 + .align 2, 0 +_080DB164: .4byte 0x08587c08 +_080DB168: .4byte 0x08587c10 +_080DB16C: .4byte 0x08587c18 +_080DB170: .4byte 0x02020630 + thumb_func_end sub_80DB120 + + thumb_func_start sub_80DB174 +sub_80DB174: @ 80DB174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r1, 0 + adds r6, r2, 0 + adds r4, r3, 0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + bl sub_80DE84C + adds r5, r0, 0 + ldr r0, _080DB1AC + ldrb r0, [r0] + cmp r4, r0 + bne _080DB1B8 + lsls r0, r5, 3 + ldr r1, _080DB1B0 + adds r0, r1 + ldr r1, _080DB1B4 + ldr r1, [r1] + ldr r1, [r1, 0x4] + adds r2, r5, 0 + adds r3, r6, 0 + bl help_system_enable_unless_flashback__sp199 + b _080DB1CC + .align 2, 0 +_080DB1AC: .4byte 0x02039f25 +_080DB1B0: .4byte 0x083028b8 +_080DB1B4: .4byte 0x020244d4 +_080DB1B8: + lsls r0, r5, 3 + ldr r1, _080DB260 + adds r0, r1 + ldr r1, _080DB264 + ldr r1, [r1] + ldr r1, [r1, 0x4] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8034B50 +_080DB1CC: + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl species_and_otid_get_pal + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0 + bl sub_806A068 + ldr r4, _080DB268 + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A600C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + movs r1, 0x70 + movs r3, 0x1E + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080DB26C + mov r8, r0 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + mov r0, r8 + adds r4, r6, r0 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + movs r1, 0xD + negs r1, r1 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0x2 + bl sub_80A82E4 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + mov r0, r8 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, _080DB270 + str r1, [r0] + ldrb r0, [r4, 0x5] + lsrs r0, 4 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x32] + adds r0, r5, 0 + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080DB278 + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, _080DB274 + b _080DB280 + .align 2, 0 +_080DB260: .4byte 0x083028b8 +_080DB264: .4byte 0x020244d4 +_080DB268: .4byte 0x0202499c +_080DB26C: .4byte 0x02020630 +_080DB270: .4byte nullsub_12 + 1 +_080DB274: .4byte 0x082ff6c0 +_080DB278: + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, _080DB2A0 +_080DB280: + str r1, [r0] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _080DB2A4 + adds r0, r1 + movs r1, 0 + bl sub_8008258 + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080DB2A0: .4byte 0x082ff694 +_080DB2A4: .4byte 0x02020630 + thumb_func_end sub_80DB174 + + thumb_func_start sub_80DB2A8 +sub_80DB2A8: @ 80DB2A8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + beq _080DB2B6 + movs r0, 0x1 + b _080DB2B8 +_080DB2B6: + movs r0, 0 +_080DB2B8: + pop {r1} + bx r1 + thumb_func_end sub_80DB2A8 + + thumb_func_start sub_80DB2BC +sub_80DB2BC: @ 80DB2BC + push {r4-r6,lr} + ldr r5, _080DB2E8 + ldr r0, [r5] + ldr r0, [r0, 0x24] + movs r4, 0xA0 + lsls r4, 3 + adds r1, r0, r4 + movs r6, 0xA0 + lsls r6, 1 + adds r2, r6, 0 + bl CpuSet + ldr r0, [r5] + ldr r0, [r0, 0x2C] + adds r4, r0, r4 + adds r1, r4, 0 + adds r2, r6, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DB2E8: .4byte 0x02039f34 + thumb_func_end sub_80DB2BC + + thumb_func_start sub_80DB2EC +sub_80DB2EC: @ 80DB2EC + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r2, _080DB314 + ldr r1, _080DB318 + lsrs r0, 13 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _080DB354 + lsls r0, 2 + ldr r1, _080DB31C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DB314: .4byte 0x0858cdcc +_080DB318: .4byte 0x0858c2b4 +_080DB31C: .4byte _080DB320 + .align 2, 0 +_080DB320: + .4byte _080DB344 + .4byte _080DB344 + .4byte _080DB34C + .4byte _080DB34C + .4byte _080DB354 + .4byte _080DB354 + .4byte _080DB354 + .4byte _080DB354 + .4byte _080DB344 +_080DB344: + ldr r0, _080DB348 + b _080DB356 + .align 2, 0 +_080DB348: .4byte 0x00009082 +_080DB34C: + ldr r0, _080DB350 + b _080DB356 + .align 2, 0 +_080DB350: .4byte 0x00009088 +_080DB354: + ldr r0, _080DB36C +_080DB356: + lsls r1, r3, 12 + movs r2, 0x90 + lsls r2, 8 + adds r1, r2 + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080DB36C: .4byte 0x00009086 + thumb_func_end sub_80DB2EC + + thumb_func_start prints_contest_move_description +prints_contest_move_description: @ 80DB370 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r1, _080DB3F0 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + ldr r7, _080DB3F4 + cmp r0, 0 + beq _080DB3A4 + adds r7, 0x5 + cmp r0, 0x1 + beq _080DB3A4 + adds r7, 0x5 + cmp r0, 0x2 + beq _080DB3A4 + adds r7, 0x40 + cmp r0, 0x3 + bne _080DB3A4 + subs r7, 0x20 +_080DB3A4: + movs r6, 0x5 + str r6, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + adds r1, r7, 0 + movs r2, 0xB + movs r3, 0x1F + bl sub_80DECB8 + adds r1, r7, 0 + adds r1, 0x10 + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + movs r2, 0xB + movs r3, 0x20 + bl sub_80DECB8 + ldr r2, _080DB3F8 + ldr r0, _080DB3F0 + mov r3, r8 + lsls r1, r3, 3 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x1] + adds r7, r1, 0 + cmp r0, 0xFF + bne _080DB3FC + movs r6, 0 + b _080DB408 + .align 2, 0 +_080DB3F0: .4byte 0x0858c2b4 +_080DB3F4: .4byte 0x00004040 +_080DB3F8: .4byte 0x0858cdcc +_080DB3FC: + ldrb r0, [r2, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 +_080DB408: + cmp r6, 0x8 + bls _080DB40E + movs r6, 0x8 +_080DB40E: + ldr r1, _080DB450 + movs r0, 0x8 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x1F + bl sub_80DED10 + ldr r1, _080DB454 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x1F + bl sub_80DED10 + ldr r1, _080DB458 + ldr r0, _080DB45C + adds r0, r7, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x2] + cmp r0, 0xFF + bne _080DB460 + movs r6, 0 + b _080DB46C + .align 2, 0 +_080DB450: .4byte 0x00005035 +_080DB454: .4byte 0x00005012 +_080DB458: .4byte 0x0858cdcc +_080DB45C: .4byte 0x0858c2b4 +_080DB460: + ldrb r0, [r1, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 +_080DB46C: + cmp r6, 0x8 + bls _080DB472 + movs r6, 0x8 +_080DB472: + ldr r1, _080DB4CC + movs r0, 0x8 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x20 + bl sub_80DED10 + ldr r1, _080DB4D0 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x20 + bl sub_80DED10 + movs r0, 0xA + movs r1, 0 + bl Window_FastFillPixels + ldr r1, _080DB4D4 + ldr r0, _080DB4D8 + adds r0, r7, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0xA + bl sub_80DEB70 + ldr r1, _080DB4DC + movs r0, 0x9 + bl sub_80DEB70 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DB4CC: .4byte 0x00005036 +_080DB4D0: .4byte 0x00005014 +_080DB4D4: .4byte 0x08587c50 +_080DB4D8: .4byte 0x0858c2b4 +_080DB4DC: .4byte 0x085e8d3e + thumb_func_end prints_contest_move_description + + thumb_func_start sub_80DB4E0 +sub_80DB4E0: @ 80DB4E0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, _080DB55C + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0x2 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080DB560 + cmp r5, 0 + beq _080DB560 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80DB2EC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x2 + mov r8, r0 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r6, 0x11 + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DECB8 + adds r4, 0x10 + lsls r4, 16 + lsrs r4, 16 + adds r3, r7, 0x1 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + bl sub_80DECB8 + b _080DB576 + .align 2, 0 +_080DB55C: .4byte 0x02039f26 +_080DB560: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DED10 +_080DB576: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DB4E0 + + thumb_func_start sub_80DB584 +sub_80DB584: @ 80DB584 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_080DB58A: + ldr r0, _080DB5AC + ldr r0, [r0] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + ldrh r0, [r0, 0x6] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_80DB4E0 + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB58A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DB5AC: .4byte 0x02039f34 + thumb_func_end sub_80DB584 + + thumb_func_start sub_80DB5B0 +sub_80DB5B0: @ 80DB5B0 + ldr r0, _080DB5B4 + bx lr + .align 2, 0 +_080DB5B4: .4byte 0x00002034 + thumb_func_end sub_80DB5B0 + + thumb_func_start sub_80DB5B8 +sub_80DB5B8: @ 80DB5B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r10, r8 + ldr r0, _080DB5F0 + mov r9, r0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r7, r0, 2 + adds r3, r7, r1 + ldrb r0, [r3, 0x10] + movs r5, 0x30 + ands r5, r0 + cmp r5, 0 + bne _080DB5F4 + movs r0, 0 + b _080DB68A + .align 2, 0 +_080DB5F0: .4byte 0x02039f34 +_080DB5F4: + ldr r0, _080DB644 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0x2 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0xD + ldrsb r0, [r3, r0] + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r4, r0, 24 + cmp r5, 0x10 + bne _080DB648 + bl sub_80DB5B0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + str r0, [sp] + lsls r0, r4, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r2, 0x13 + adds r3, r6, 0 + bl sub_80DED10 + mov r1, r8 + cmp r1, 0 + beq _080DB688 + movs r0, 0x5B + b _080DB672 + .align 2, 0 +_080DB644: .4byte 0x02039f26 +_080DB648: + adds r3, r6, r4 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x3 + subs r0, r4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x13 + bl sub_80DED10 + mov r0, r10 + cmp r0, 0 + beq _080DB688 + movs r0, 0x26 +_080DB672: + bl audio_play + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + adds r1, r7, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x10] +_080DB688: + movs r0, 0x1 +_080DB68A: + 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_80DB5B8 + + thumb_func_start sub_80DB69C +sub_80DB69C: @ 80DB69C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r7, 0 + movs r0, 0x1 + mov r10, r0 + movs r1, 0x11 + mov r9, r1 + movs r0, 0 + mov r8, r0 +_080DB6B6: + ldr r0, _080DB740 + adds r0, r7, r0 + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + adds r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + bl sub_80DB5B0 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080DB744 + ldr r0, [r0] + ldr r0, [r0, 0x4] + add r0, r8 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + mov r1, r10 + str r1, [sp] + asrs r6, r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x13 + adds r3, r4, 0 + bl sub_80DED10 + adds r4, r6 + lsls r4, 24 + lsrs r4, 24 + mov r1, r10 + str r1, [sp] + movs r0, 0x3 + subs r0, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x13 + adds r3, r4, 0 + bl sub_80DED10 + movs r1, 0x1C + add r8, r1 + adds r7, 0x1 + cmp r7, 0x3 + ble _080DB6B6 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DB740: .4byte 0x02039f26 +_080DB744: .4byte 0x02039f34 + thumb_func_end sub_80DB69C + + thumb_func_start sub_80DB748 +sub_80DB748: @ 80DB748 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + cmp r1, 0x4 + bhi _080DB78A + lsls r0, r1, 2 + ldr r1, _080DB760 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DB760: .4byte _080DB764 + .align 2, 0 +_080DB764: + .4byte _080DB778 + .4byte _080DB77C + .4byte _080DB780 + .4byte _080DB784 + .4byte _080DB788 +_080DB778: + movs r0, 0x80 + b _080DB78A +_080DB77C: + movs r0, 0x84 + b _080DB78A +_080DB780: + movs r0, 0x86 + b _080DB78A +_080DB784: + movs r0, 0x88 + b _080DB78A +_080DB788: + movs r0, 0x82 +_080DB78A: + movs r1, 0x90 + lsls r1, 8 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80DB748 + + thumb_func_start sub_80DB798 +sub_80DB798: @ 80DB798 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + mov r9, r1 + movs r1, 0 + mov r8, r1 + ldr r1, _080DB7E0 + adds r1, r0, r1 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + adds r1, 0x2 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r1, _080DB7E4 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldr r0, [r2, 0x10] + ldr r1, _080DB7E8 + ands r0, r1 + cmp r0, 0 + bne _080DB7DC + ldrb r0, [r2, 0xF] + cmp r0, 0 + beq _080DB7EC +_080DB7DC: + movs r0, 0 + b _080DB80E + .align 2, 0 +_080DB7E0: .4byte 0x02039f26 +_080DB7E4: .4byte 0x02039f34 +_080DB7E8: .4byte 0x00ff0003 +_080DB7EC: + ldrb r1, [r2, 0xC] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _080DB7FA + movs r0, 0x1 + b _080DB80E +_080DB7FA: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080DB80C + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DB81A +_080DB80C: + movs r0, 0x2 +_080DB80E: + bl sub_80DB748 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + b _080DB81E +_080DB81A: + movs r0, 0 + mov r9, r0 +_080DB81E: + mov r1, r9 + cmp r1, 0 + beq _080DB85E + movs r6, 0x2 + str r6, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + mov r1, r8 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DECB8 + mov r1, r8 + adds r1, 0x10 + lsls r1, 16 + lsrs r1, 16 + adds r3, r7, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + movs r2, 0x14 + bl sub_80DECB8 + b _080DB874 +_080DB85E: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DED10 +_080DB874: + mov r0, r9 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80DB798 + + thumb_func_start sub_80DB884 +sub_80DB884: @ 80DB884 + push {r4,lr} + movs r4, 0 +_080DB888: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DB798 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB888 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DB884 + + thumb_func_start sub_80DB89C +sub_80DB89C: @ 80DB89C + push {lr} + movs r0, 0x4 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x4 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl sub_80DED60 + pop {r0} + bx r0 + thumb_func_end sub_80DB89C + + thumb_func_start sub_80DB8B8 +sub_80DB8B8: @ 80DB8B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + adds r0, r4, 0 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + beq _080DB8D0 + movs r0, 0 + b _080DB90A +_080DB8D0: + ldr r0, _080DB8EC + ldrb r0, [r0] + cmp r4, r0 + beq _080DB8F4 + adds r0, r4, 0 + bl sub_81562C4 + bl sub_8156324 + lsls r0, 24 + ldr r2, _080DB8F0 + lsrs r0, 23 + lsls r1, r4, 6 + b _080DB902 + .align 2, 0 +_080DB8EC: .4byte 0x02039f25 +_080DB8F0: .4byte 0x02039e00 +_080DB8F4: + ldr r2, _080DB910 + ldr r0, _080DB914 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 1 + lsls r1, r5, 6 +_080DB902: + adds r0, r1 + adds r2, 0x1E + adds r0, r2 + ldrh r0, [r0] +_080DB90A: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080DB910: .4byte 0x02039e00 +_080DB914: .4byte 0x02039f34 + thumb_func_end sub_80DB8B8 + + thumb_func_start sub_80DB918 +sub_80DB918: @ 80DB918 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_080DB91E: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DB8B8 + ldr r1, _080DB940 + ldr r1, [r1] + ldr r1, [r1, 0x4] + adds r1, r5, r1 + strh r0, [r1, 0x6] + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB91E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DB940: .4byte 0x02039f34 + thumb_func_end sub_80DB918 + + thumb_func_start sub_80DB944 +sub_80DB944: @ 80DB944 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r5, _080DB9EC + mov r4, sp + movs r3, 0 + movs r6, 0x3 +_080DB956: + ldr r2, [r5] + ldr r1, [r2, 0x4] + adds r1, r3, r1 + ldrh r0, [r1, 0x2] + ldrh r7, [r1, 0x4] + adds r0, r7 + strh r0, [r1, 0x4] + ldr r0, [r2, 0x4] + adds r0, r3, r0 + ldrh r0, [r0, 0x4] + strh r0, [r4] + adds r4, 0x2 + adds r3, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _080DB956 + movs r6, 0 +_080DB978: + movs r4, 0x3 + cmp r4, r6 + ble _080DB9A4 +_080DB97E: + subs r5, r4, 0x1 + lsls r0, r5, 1 + mov r1, sp + adds r3, r1, r0 + lsls r0, r4, 1 + adds r2, r1, r0 + ldrh r4, [r3] + movs r7, 0 + ldrsh r1, [r3, r7] + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _080DB99E + ldrh r0, [r2] + strh r4, [r2] + strh r0, [r3] +_080DB99E: + adds r4, r5, 0 + cmp r4, r6 + bgt _080DB97E +_080DB9A4: + adds r6, 0x1 + cmp r6, 0x2 + ble _080DB978 + movs r6, 0 + movs r0, 0x4 + negs r0, r0 + mov r9, r0 + ldr r1, _080DB9EC + mov r8, r1 + movs r7, 0x3 + mov r12, r7 +_080DB9BA: + movs r4, 0 + lsls r0, r6, 3 + adds r7, r6, 0x1 + subs r0, r6 + lsls r5, r0, 2 + mov r3, sp +_080DB9C6: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r2, r5, r0 + movs r6, 0x4 + ldrsh r1, [r2, r6] + movs r6, 0 + ldrsh r0, [r3, r6] + cmp r1, r0 + bne _080DB9F0 + mov r0, r12 + ands r4, r0 + ldrb r1, [r2, 0xB] + mov r0, r9 + ands r0, r1 + orrs r0, r4 + strb r0, [r2, 0xB] + b _080DB9F8 + .align 2, 0 +_080DB9EC: .4byte 0x02039f34 +_080DB9F0: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB9C6 +_080DB9F8: + adds r6, r7, 0 + cmp r6, 0x3 + ble _080DB9BA + movs r0, 0x1 + bl sub_80DCE58 + bl sub_80DD590 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DB944 + + thumb_func_start sub_80DBA18 +sub_80DBA18: @ 80DBA18 + push {r4,r5,lr} + ldr r4, _080DBA30 + movs r2, 0 + movs r3, 0x3 +_080DBA20: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r1, r2, r0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + bne _080DBA34 + movs r1, 0x5 + b _080DBA52 + .align 2, 0 +_080DBA30: .4byte 0x02039f34 +_080DBA34: + movs r5, 0x2 + ldrsh r0, [r1, r5] + movs r1, 0 + cmp r0, 0 + ble _080DBA52 + movs r1, 0x1 + cmp r0, 0x1D + ble _080DBA52 + movs r1, 0x2 + cmp r0, 0x3B + ble _080DBA52 + movs r1, 0x4 + cmp r0, 0x4F + bgt _080DBA52 + movs r1, 0x3 +_080DBA52: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r0, r2, r0 + strb r1, [r0, 0x1A] + adds r2, 0x1C + subs r3, 0x1 + cmp r3, 0 + bge _080DBA20 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DBA18 + + thumb_func_start sub_80DBA68 +sub_80DBA68: @ 80DBA68 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DBA94 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080DBA90 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DBA98 +_080DBA90: + movs r0, 0 + b _080DBA9A + .align 2, 0 +_080DBA94: .4byte 0x02039f34 +_080DBA98: + movs r0, 0x1 +_080DBA9A: + pop {r1} + bx r1 + thumb_func_end sub_80DBA68 + + thumb_func_start sub_80DBAA0 +sub_80DBAA0: @ 80DBAA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r5, _080DBCA4 + movs r0, 0 + mov r8, r0 + movs r1, 0x7 + negs r1, r1 + mov r10, r1 + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + movs r4, 0 + movs r6, 0x3 +_080DBAC0: + ldr r1, [r5] + ldr r0, [r1, 0x4] + adds r0, r4, r0 + movs r2, 0 + strh r2, [r0, 0x2] + ldr r0, [r1, 0x4] + adds r0, r4, r0 + strh r2, [r0] + ldr r0, [r1, 0x4] + adds r0, r4, r0 + mov r1, r8 + strb r1, [r0, 0x12] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r3, r4, r0 + ldrb r2, [r3, 0xC] + movs r0, 0x6 + ands r0, r2 + cmp r0, 0 + beq _080DBAFC + lsls r0, r2, 29 + lsrs r0, 30 + subs r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 1 + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] +_080DBAFC: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + mov r1, r8 + strb r1, [r0, 0xE] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + mov r1, r8 + strb r1, [r0, 0xF] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r7, 0x5 + negs r7, r7 + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x9 + negs r0, r0 + mov r12, r0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0xC] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0xC] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0xFF + strb r1, [r0, 0x13] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0, 0x14] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r2, [r0, 0x4] + adds r2, r4, r2 + ldrb r3, [r2, 0x15] + lsls r1, r3, 31 + lsrs r1, 31 + lsls r1, 2 + adds r0, r7, 0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0x11] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080DBBF4 + ldrb r1, [r2, 0xC] + mov r0, r10 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xC] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x11] +_080DBBF4: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0x11] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080DBC1A + ldrb r0, [r2, 0xB] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0xB] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + mov r0, r12 + ands r0, r2 + strb r0, [r1, 0x11] +_080DBC1A: + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + adds r4, 0x1C + subs r6, 0x1 + cmp r6, 0 + blt _080DBC34 + b _080DBAC0 +_080DBC34: + movs r6, 0 + ldr r5, _080DBCA4 + movs r7, 0 + movs r4, 0 +_080DBC3C: + ldr r3, [r5] + ldr r0, [r3, 0x4] + adds r0, r4, r0 + ldrh r1, [r0, 0x6] + strh r1, [r0, 0x8] + ldr r2, [r3] + lsls r1, r6, 1 + ldrb r0, [r2, 0x1] + lsls r0, 3 + adds r1, r0 + adds r2, 0x1C + adds r2, r1 + ldr r0, [r3, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + strh r0, [r2] + ldr r0, [r3, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl sub_80DD9F0 + ldr r1, [r5] + ldr r2, [r1] + ldrb r1, [r2, 0x1] + lsls r1, 2 + adds r1, r6, r1 + adds r2, 0x44 + adds r2, r1 + strb r0, [r2] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + strh r7, [r0, 0x6] + adds r4, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080DBC3C + ldr r0, _080DBCA4 + ldr r0, [r0] + ldr r2, [r0, 0x10] + ldrb r1, [r2, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DBCA4: .4byte 0x02039f34 + thumb_func_end sub_80DBAA0 + + thumb_func_start sub_80DBCA8 +sub_80DBCA8: @ 80DBCA8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DBCD4 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080DBCD0 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DBCD8 +_080DBCD0: + movs r0, 0x1 + b _080DBCDA + .align 2, 0 +_080DBCD4: .4byte 0x02039f34 +_080DBCD8: + movs r0, 0 +_080DBCDA: + pop {r1} + bx r1 + thumb_func_end sub_80DBCA8 + + thumb_func_start sub_80DBCE0 +sub_80DBCE0: @ 80DBCE0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80DBD34 + ldr r1, _080DBD0C + lsls r4, 1 + adds r1, r4, r1 + strh r0, [r1] + ldr r2, _080DBD10 + adds r2, r4, r2 + ldr r1, _080DBD14 + adds r4, r1 + ldrh r4, [r4] + adds r0, r4 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DBD0C: .4byte 0x02039f18 +_080DBD10: .4byte 0x02039f08 +_080DBD14: .4byte 0x02039f00 + thumb_func_end sub_80DBCE0 + + thumb_func_start sub_80DBD18 +sub_80DBD18: @ 80DBD18 + push {r4,lr} + movs r4, 0 +_080DBD1C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DBCE0 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DBD1C + bl sub_80DBD4C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DBD18 + + thumb_func_start sub_80DBD34 +sub_80DBD34: @ 80DBD34 + lsls r0, 24 + ldr r1, _080DBD48 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 17 + asrs r0, 16 + bx lr + .align 2, 0 +_080DBD48: .4byte 0x02039f10 + thumb_func_end sub_80DBD34 + + thumb_func_start sub_80DBD4C +sub_80DBD4C: @ 80DBD4C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x70 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0 + mov r9, r0 + mov r1, sp + adds r1, 0x8 + str r1, [sp, 0x64] + mov r3, sp + adds r3, 0xC + str r3, [sp, 0x68] + mov r6, sp + adds r6, 0x14 + str r6, [sp, 0x6C] + mov r4, sp +_080DBD7A: + bl GenerateRandomNumber + strh r0, [r4] + movs r2, 0 + cmp r2, r9 + bge _080DBDB8 + mov r1, sp + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bne _080DBD9C + subs r4, 0x2 + movs r7, 0x1 + negs r7, r7 + add r9, r7 + b _080DBDB8 +_080DBD9C: + adds r2, 0x1 + cmp r2, r9 + bge _080DBDB8 + lsls r0, r2, 1 + mov r3, sp + adds r1, r3, r0 + ldrh r0, [r4] + ldrh r1, [r1] + cmp r0, r1 + bne _080DBD9C + subs r4, 0x2 + movs r6, 0x1 + negs r6, r6 + add r9, r6 +_080DBDB8: + adds r4, 0x2 + movs r7, 0x1 + add r9, r7 + mov r0, r9 + cmp r0, 0x3 + ble _080DBD7A + movs r1, 0 + mov r9, r1 + mov r4, sp + ldr r6, _080DBEC8 + ldr r2, [sp, 0x64] + ldr r5, _080DBECC + ldr r3, [sp, 0x68] +_080DBDD2: + mov r7, r9 + lsls r1, r7, 4 + movs r7, 0 + ldrsh r0, [r6, r7] + str r0, [r2] + movs r7, 0 + ldrsh r0, [r5, r7] + str r0, [r3] + ldrh r0, [r4] + str r0, [r2, 0x8] + ldr r0, [sp, 0x6C] + adds r1, r0, r1 + mov r7, r9 + str r7, [r1] + adds r4, 0x2 + adds r6, 0x2 + adds r2, 0x10 + adds r5, 0x2 + adds r3, 0x10 + movs r0, 0x1 + add r9, r0 + mov r1, r9 + cmp r1, 0x3 + ble _080DBDD2 + movs r3, 0 + mov r9, r3 +_080DBE06: + movs r4, 0x3 + cmp r4, r9 + ble _080DBE90 + add r7, sp, 0x48 + ldr r6, [sp, 0x68] + str r6, [sp, 0x58] + ldr r0, [sp, 0x64] + adds r0, 0x8 + str r0, [sp, 0x5C] + ldr r1, [sp, 0x6C] + str r1, [sp, 0x60] +_080DBE1C: + subs r3, r4, 0x1 + mov r10, r3 + mov r0, r10 + adds r1, r4, 0 + ldr r2, [sp, 0x64] + bl sub_80DBF30 + lsls r0, 24 + cmp r0, 0 + beq _080DBE8A + mov r6, r10 + lsls r2, r6, 4 + ldr r0, [sp, 0x64] + adds r3, r0, r2 + ldr r0, [r3] + str r0, [sp, 0x48] + ldr r1, [sp, 0x58] + adds r6, r1, r2 + ldr r0, [r6] + str r0, [r7, 0x4] + ldr r0, [sp, 0x5C] + adds r0, r2 + mov r8, r0 + ldr r0, [r0] + str r0, [r7, 0x8] + ldr r1, [sp, 0x60] + adds r2, r1, r2 + ldr r0, [r2] + str r0, [r7, 0xC] + lsls r1, r4, 4 + ldr r0, [sp, 0x64] + adds r5, r0, r1 + ldr r0, [r5] + str r0, [r3] + ldr r3, [sp, 0x58] + adds r4, r3, r1 + ldr r0, [r4] + str r0, [r6] + ldr r6, [sp, 0x5C] + adds r3, r6, r1 + ldr r0, [r3] + mov r6, r8 + str r0, [r6] + ldr r0, [sp, 0x60] + adds r1, r0, r1 + ldr r0, [r1] + str r0, [r2] + ldr r0, [sp, 0x48] + str r0, [r5] + ldr r0, [r7, 0x4] + str r0, [r4] + ldr r0, [r7, 0x8] + str r0, [r3] + ldr r0, [r7, 0xC] + str r0, [r1] +_080DBE8A: + mov r4, r10 + cmp r4, r9 + bgt _080DBE1C +_080DBE90: + movs r1, 0x1 + add r9, r1 + mov r3, r9 + cmp r3, 0x2 + ble _080DBE06 + movs r6, 0 + mov r9, r6 + ldr r2, _080DBED0 + ldr r1, [sp, 0x6C] +_080DBEA2: + ldr r0, [r1] + adds r0, r2 + mov r7, r9 + strb r7, [r0] + adds r1, 0x10 + movs r0, 0x1 + add r9, r0 + mov r3, r9 + cmp r3, 0x3 + ble _080DBEA2 + add sp, 0x70 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DBEC8: .4byte 0x02039f08 +_080DBECC: .4byte 0x02039f00 +_080DBED0: .4byte 0x02039f20 + thumb_func_end sub_80DBD4C + + thumb_func_start sub_80DBED4 +sub_80DBED4: @ 80DBED4 + push {lr} + ldr r0, _080DBF14 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DBF0E + ldr r0, _080DBF18 + ldr r2, [r0] + ldr r1, _080DBF1C + ldr r0, _080DBF20 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 1 + ldr r0, _080DBF24 + ldrh r0, [r0] + lsls r0, 3 + adds r1, r0 + ldr r0, _080DBF28 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + adds r0, 0x1 + ldr r1, _080DBF2C + cmp r0, r1 + ble _080DBF0C + adds r0, r1, 0 +_080DBF0C: + strh r0, [r2] +_080DBF0E: + pop {r0} + bx r0 + .align 2, 0 +_080DBF14: .4byte 0x02039f2a +_080DBF18: .4byte 0x03005d90 +_080DBF1C: .4byte 0x02039f20 +_080DBF20: .4byte 0x02039f25 +_080DBF24: .4byte 0x02039f2c +_080DBF28: .4byte 0x00000624 +_080DBF2C: .4byte 0x0000270f + thumb_func_end sub_80DBED4 + + thumb_func_start sub_80DBF30 +sub_80DBF30: @ 80DBF30 + push {lr} + lsls r0, 4 + adds r0, r2 + lsls r1, 4 + adds r3, r1, r2 + ldr r2, [r0] + ldr r1, [r3] + cmp r2, r1 + blt _080DBF60 + cmp r2, r1 + bgt _080DBF52 + ldr r2, [r0, 0x4] + ldr r1, [r3, 0x4] + cmp r2, r1 + blt _080DBF60 + cmp r2, r1 + ble _080DBF56 +_080DBF52: + movs r2, 0 + b _080DBF62 +_080DBF56: + ldr r1, [r0, 0x8] + ldr r0, [r3, 0x8] + movs r2, 0 + cmp r1, r0 + bge _080DBF62 +_080DBF60: + movs r2, 0x1 +_080DBF62: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80DBF30 + + thumb_func_start sub_80DBF68 +sub_80DBF68: @ 80DBF68 + push {lr} + ldr r0, _080DBF84 + movs r1, 0 + strh r1, [r0] + ldr r0, _080DBF88 + strh r1, [r0] + bl sub_80DB89C + ldr r0, _080DBF8C + movs r1, 0 + bl sub_80DEC30 + pop {r0} + bx r0 + .align 2, 0 +_080DBF84: .4byte 0x02022e16 +_080DBF88: .4byte 0x02022e1e +_080DBF8C: .4byte 0x0827e8da + thumb_func_end sub_80DBF68 + + thumb_func_start sub_80DBF90 +sub_80DBF90: @ 80DBF90 + push {r4,r5,lr} + sub sp, 0xC + movs r5, 0x80 + lsls r5, 18 + movs r4, 0x3 +_080DBF9A: + lsrs r3, r5, 24 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x16 + bl sub_80DED10 + movs r0, 0xA0 + lsls r0, 19 + adds r5, r0 + subs r4, 0x1 + cmp r4, 0 + bge _080DBF9A + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DBF90 + + thumb_func_start sub_80DBFC8 +sub_80DBFC8: @ 80DBFC8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DBFEC + cmp r0, 0 + beq _080DBFE2 + ldr r1, _080DBFF0 + cmp r0, 0x1 + beq _080DBFE2 + ldr r1, _080DBFF4 + cmp r0, 0x2 + bne _080DBFE2 + ldr r1, _080DBFF8 +_080DBFE2: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080DBFEC: .4byte 0x00005011 +_080DBFF0: .4byte 0x00006011 +_080DBFF4: .4byte 0x00008011 +_080DBFF8: .4byte 0x00007011 + thumb_func_end sub_80DBFC8 + + thumb_func_start sub_80DBFFC +sub_80DBFFC: @ 80DBFFC + push {lr} + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r2, r0, 24 + cmp r2, 0x10 + ble _080DC016 + movs r1, 0x10 + b _080DC020 +_080DC016: + movs r0, 0x10 + negs r0, r0 + cmp r2, r0 + bge _080DC020 + movs r1, 0xF0 +_080DC020: + lsls r0, r1, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80DBFFC + + thumb_func_start sub_80DC028 +sub_80DC028: @ 80DC028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r0, _080DC0BC + ldr r0, [r0] + ldr r0, [r0, 0x14] + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x2] + ldr r0, _080DC0C0 + movs r1, 0x14 + bl AddTask + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 16 + asrs r5, 16 + adds r0, r5, 0 + bl sub_80DBFFC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 16 + asrs r6, 16 + adds r5, r6 + lsls r5, 16 + asrs r5, 16 + adds r0, r5, 0 + bl sub_80DBFFC + lsls r4, 24 + asrs r4, 24 + subs r0, r4 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + bl sub_80DBFC8 + ldr r2, _080DC0C4 + lsls r3, r7, 2 + adds r0, r3, r7 + lsls r0, 3 + adds r1, r0, r2 + adds r0, r4, 0 + cmp r4, 0 + bge _080DC0A0 + negs r0, r4 +_080DC0A0: + strh r0, [r1, 0x8] + lsls r0, r5, 24 + asrs r0, 24 + strh r0, [r1, 0xA] + cmp r4, 0 + bgt _080DC0B4 + cmp r4, 0 + bne _080DC0C8 + cmp r0, 0 + ble _080DC0C8 +_080DC0B4: + movs r0, 0x1 + strh r0, [r1, 0xC] + b _080DC0D6 + .align 2, 0 +_080DC0BC: .4byte 0x02039f34 +_080DC0C0: .4byte sub_80DC0F4 + 1 +_080DC0C4: .4byte 0x03005e00 +_080DC0C8: + ldr r2, _080DC0EC + lsls r3, r7, 2 + adds r0, r3, r7 + lsls r0, 3 + adds r0, r2 + ldr r1, _080DC0F0 + strh r1, [r0, 0xC] +_080DC0D6: + adds r0, r3, r7 + lsls r0, 3 + adds r0, r2 + mov r1, r8 + strh r1, [r0, 0xE] + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080DC0EC: .4byte 0x03005e00 +_080DC0F0: .4byte 0x0000ffff + thumb_func_end sub_80DC028 + + thumb_func_start sub_80DC0F4 +sub_80DC0F4: @ 80DC0F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080DC154 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xE] + mov r9, r0 + ldrh r3, [r4, 0x8] + ldrh r1, [r4, 0xA] + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bgt _080DC126 + b _080DC2A8 +_080DC126: + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r2, [r4, 0xA] + movs r5, 0xA + ldrsh r0, [r4, r5] + cmp r0, 0 + bne _080DC15C + adds r0, r7, 0 + bl remove_task + ldr r0, _080DC158 + ldr r0, [r0] + ldr r0, [r0, 0x14] + mov r2, r9 + lsls r1, r2, 2 + adds r1, r0 + ldrb r2, [r1, 0x2] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x2] + b _080DC2A8 + .align 2, 0 +_080DC154: .4byte 0x03005e00 +_080DC158: .4byte 0x02039f34 +_080DC15C: + cmp r3, 0 + bne _080DC1A4 + lsls r0, r1, 16 + mov r8, r0 + cmp r0, 0 + bge _080DC17A + mov r0, r9 + bl sub_80DBFC8 + adds r0, 0x2 + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + b _080DC188 +_080DC17A: + mov r0, r9 + bl sub_80DBFC8 + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r0, [r4, 0xA] + subs r0, 0x1 +_080DC188: + strh r0, [r4, 0xA] + ldr r1, _080DC1A0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r2, r1, 0x1 + strh r2, [r0, 0x8] + lsls r1, 24 + lsrs r5, r1, 24 + b _080DC210 + .align 2, 0 +_080DC1A0: .4byte 0x03005e00 +_080DC1A4: + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bge _080DC1DE + lsls r0, r1, 16 + mov r8, r0 + cmp r0, 0 + bge _080DC1CC + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + mov r0, r9 + bl sub_80DBFC8 + adds r0, 0x2 + b _080DC20C +_080DC1CC: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + subs r0, r2, 0x1 + strh r0, [r4, 0xA] + b _080DC210 +_080DC1DE: + lsls r0, r1, 16 + mov r8, r0 + cmp r0, 0 + bge _080DC1F8 + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + b _080DC210 +_080DC1F8: + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + subs r0, r2, 0x1 + strh r0, [r4, 0xA] + mov r0, r9 + bl sub_80DBFC8 +_080DC20C: + lsls r0, 16 + lsrs r6, r0, 16 +_080DC210: + str r5, [sp, 0xC] + movs r0, 0 + mov r10, r0 + cmp r5, 0x7 + bls _080DC226 + movs r2, 0x1 + mov r10, r2 + adds r0, r5, 0 + subs r0, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 +_080DC226: + adds r2, r5, 0 + adds r2, 0x16 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _080DC278 + add r0, r9 + ldrb r0, [r0] + lsls r3, r0, 2 + adds r3, r0 + adds r3, 0x2 + add r3, r10 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + adds r1, r6, 0 + bl sub_80DED10 + mov r3, r8 + cmp r3, 0 + ble _080DC284 + movs r0, 0x60 + bl audio_play + ldr r4, _080DC27C + adds r0, r4, 0 + bl m4aMPlayImmInit + ldr r1, _080DC280 + ldr r0, [sp, 0xC] + lsls r2, r0, 24 + asrs r2, 16 + adds r0, r4, 0 + bl MPlayPitchControl + b _080DC28A + .align 2, 0 +_080DC278: .4byte 0x02039f26 +_080DC27C: .4byte 0x030075f0 +_080DC280: .4byte 0x0000ffff +_080DC284: + movs r0, 0x16 + bl audio_play +_080DC28A: + mov r2, r10 + cmp r2, 0 + bne _080DC2A8 + cmp r5, 0 + bne _080DC2A8 + cmp r6, 0 + bne _080DC2A8 + ldr r0, _080DC2B8 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + negs r0, r0 + strh r0, [r1, 0xC] +_080DC2A8: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DC2B8: .4byte 0x03005e00 + thumb_func_end sub_80DC0F4 + + thumb_func_start sub_80DC2BC +sub_80DC2BC: @ 80DC2BC + push {r4,r5,lr} + ldr r0, _080DC2F4 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r4, 0 + ldr r5, _080DC2F8 +_080DC2C8: + ldr r0, _080DC2FC + adds r0, r4, r0 + ldrb r0, [r0] + adds r0, r5 + ldrb r2, [r0] + ldr r0, _080DC300 + movs r1, 0xB4 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, _080DC304 + ldr r1, [r1] + ldr r2, [r1, 0x14] + lsls r1, r4, 2 + adds r1, r2 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC2C8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DC2F4: .4byte 0x08587a74 +_080DC2F8: .4byte 0x08587a6c +_080DC2FC: .4byte 0x02039f26 +_080DC300: .4byte 0x08587ad0 +_080DC304: .4byte 0x02039f34 + thumb_func_end sub_80DC2BC + + thumb_func_start sub_80DC308 +sub_80DC308: @ 80DC308 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _080DC34C + ldr r0, [r4] + ldr r2, [r0, 0x14] + lsls r3, r6, 2 + adds r2, r3, r2 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r4] + ldr r0, [r1, 0x14] + adds r3, r0 + ldrb r7, [r3] + ldr r1, [r1, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + movs r1, 0x4 + ldrsh r0, [r0, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 17 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x38 + ble _080DC350 + movs r5, 0x38 + b _080DC356 + .align 2, 0 +_080DC34C: .4byte 0x02039f34 +_080DC350: + cmp r0, 0 + bge _080DC356 + movs r5, 0 +_080DC356: + ldr r2, _080DC388 + lsls r3, r7, 4 + adds r0, r3, r7 + lsls r0, 2 + adds r4, r0, r2 + movs r0, 0x3E + adds r0, r4 + mov r12, r0 + ldrb r1, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + strh r6, [r4, 0x2E] + strh r5, [r4, 0x30] + lsls r0, r5, 16 + asrs r0, 16 + movs r5, 0x24 + ldrsh r1, [r4, r5] + cmp r0, r1 + ble _080DC38C + movs r0, 0x1 + b _080DC38E + .align 2, 0 +_080DC388: .4byte 0x02020630 +_080DC38C: + ldr r0, _080DC3A4 +_080DC38E: + strh r0, [r4, 0x32] + adds r0, r3, r7 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _080DC3A8 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DC3A4: .4byte 0x0000ffff +_080DC3A8: .4byte sub_80DC408 + 1 + thumb_func_end sub_80DC308 + + thumb_func_start sub_80DC3AC +sub_80DC3AC: @ 80DC3AC + push {r4,lr} + movs r4, 0 +_080DC3B0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DC308 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC3B0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DC3AC + + thumb_func_start sub_80DC3C4 +sub_80DC3C4: @ 80DC3C4 + push {r4,lr} + movs r2, 0 + ldr r3, _080DC3FC + ldr r0, [r3] + ldr r0, [r0, 0x14] + ldrb r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DC3F2 + movs r4, 0x1 +_080DC3DA: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080DC3F2 + ldr r0, [r3] + ldr r1, [r0, 0x14] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080DC3DA +_080DC3F2: + cmp r2, 0x4 + beq _080DC400 + movs r0, 0 + b _080DC402 + .align 2, 0 +_080DC3FC: .4byte 0x02039f34 +_080DC400: + movs r0, 0x1 +_080DC402: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80DC3C4 + + thumb_func_start sub_80DC408 +sub_80DC408: @ 80DC408 + push {r4,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x24] + movs r0, 0x24 + ldrsh r1, [r3, r0] + movs r4, 0x30 + ldrsh r0, [r3, r4] + cmp r1, r0 + bne _080DC440 + ldr r0, _080DC438 + ldr r0, [r0] + movs r2, 0x2E + ldrsh r1, [r3, r2] + ldr r0, [r0, 0x14] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x2] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x2] + ldr r0, _080DC43C + str r0, [r3, 0x1C] + b _080DC446 + .align 2, 0 +_080DC438: .4byte 0x02039f34 +_080DC43C: .4byte nullsub_12 + 1 +_080DC440: + ldrh r0, [r3, 0x32] + adds r0, r2, r0 + strh r0, [r3, 0x24] +_080DC446: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DC408 + + thumb_func_start sub_80DC44C +sub_80DC44C: @ 80DC44C + push {r4-r6,lr} + movs r2, 0 + ldr r6, _080DC480 + ldr r5, _080DC484 + ldr r4, _080DC488 + ldr r3, _080DC48C +_080DC458: + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r0, r2, r3 + ldrb r0, [r0] + adds r0, r4 + ldrb r0, [r0] + strh r0, [r1, 0x22] + adds r2, 0x1 + cmp r2, 0x3 + ble _080DC458 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DC480: .4byte 0x02020630 +_080DC484: .4byte 0x02039f34 +_080DC488: .4byte 0x08587a6c +_080DC48C: .4byte 0x02039f26 + thumb_func_end sub_80DC44C + + thumb_func_start sub_80DC490 +sub_80DC490: @ 80DC490 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r3, 0 + ldr r7, _080DC4C0 + ldr r5, _080DC4C4 + ldr r4, _080DC4C8 + movs r2, 0 +_080DC4A0: + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + bls _080DC4E2 + cmp r6, 0 + bne _080DC4CC + ldr r0, [r4] + ldr r0, [r0, 0x14] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xB4 + b _080DC4E0 + .align 2, 0 +_080DC4C0: .4byte 0x02039f26 +_080DC4C4: .4byte 0x02020630 +_080DC4C8: .4byte 0x02039f34 +_080DC4CC: + ldr r0, [r4] + ldr r0, [r0, 0x14] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x80 + lsls r1, 1 +_080DC4E0: + strh r1, [r0, 0x20] +_080DC4E2: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x3 + ble _080DC4A0 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DC490 + + thumb_func_start sub_80DC4F0 +sub_80DC4F0: @ 80DC4F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080DC574 + bl gpu_pal_obj_alloc_tag_and_apply + movs r5, 0 + ldr r7, _080DC578 + ldr r0, _080DC57C + mov r8, r0 + movs r6, 0 +_080DC506: + lsls r0, r5, 3 + ldr r1, _080DC580 + adds r0, r1 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080DC584 + adds r0, r6, r0 + ldr r2, _080DC588 + ldr r1, _080DC58C + adds r1, r5, r1 + ldrb r1, [r1] + adds r1, r2 + ldrb r2, [r1] + movs r1, 0xCC + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + ldr r1, [r1, 0x14] + lsls r4, r5, 2 + adds r1, r4, r1 + strb r0, [r1, 0x1] + ldr r0, [r7] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldr r1, _080DC590 + bl obj_set_f18_to_r0_f42_to_40 + ldr r0, [r7] + ldr r0, [r0, 0x14] + adds r4, r0 + ldrb r1, [r4, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r6, 0x18 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DC506 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DC574: .4byte 0x08587b08 +_080DC578: .4byte 0x02039f34 +_080DC57C: .4byte 0x02020630 +_080DC580: .4byte 0x08587ae8 +_080DC584: .4byte 0x08587b18 +_080DC588: .4byte 0x08587a70 +_080DC58C: .4byte 0x02039f26 +_080DC590: .4byte 0x08587b80 + thumb_func_end sub_80DC4F0 + + thumb_func_start sub_80DC594 +sub_80DC594: @ 80DC594 + push {lr} + ldr r0, _080DC5D4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080DC5D8 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _080DC5DC + movs r1, 0x1E + movs r2, 0x2C + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DC5E0 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + ldr r1, _080DC5E4 + ldr r1, [r1] + ldr r1, [r1] + adds r1, 0x58 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080DC5D4: .4byte 0x08587bb0 +_080DC5D8: .4byte 0x08587bb8 +_080DC5DC: .4byte 0x08587bc8 +_080DC5E0: .4byte 0x02020630 +_080DC5E4: .4byte 0x02039f34 + thumb_func_end sub_80DC594 + + thumb_func_start sub_80DC5E8 +sub_80DC5E8: @ 80DC5E8 + push {r4,lr} + ldr r0, _080DC624 + movs r1, 0x1E + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DC628 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0xD] + movs r2, 0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r4, _080DC62C + movs r3, 0xFF +_080DC60A: + lsls r0, r2, 3 + adds r0, r1 + adds r0, r4 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080DC60A + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DC624: .4byte sub_80DC728 + 1 +_080DC628: .4byte 0x02039f34 +_080DC62C: .4byte 0x03005e08 + thumb_func_end sub_80DC5E8 + + thumb_func_start sub_80DC630 +sub_80DC630: @ 80DC630 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080DC66C + ldr r1, _080DC670 + ldr r5, [r1] + ldr r1, [r5] + ldrb r2, [r1, 0xD] + lsls r1, r2, 2 + adds r1, r2 + adds r1, r0 + lsls r1, 3 + adds r3, 0x8 + adds r1, r3 + movs r4, 0 + strh r4, [r1] + lsls r0, 2 + adds r0, 0x1 + lsls r0, 1 + ldr r1, [r5] + ldrb r2, [r1, 0xD] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + adds r0, r3 + strh r4, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DC66C: .4byte 0x03005e00 +_080DC670: .4byte 0x02039f34 + thumb_func_end sub_80DC630 + + thumb_func_start sub_80DC674 +sub_80DC674: @ 80DC674 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080DC69C + movs r1, 0x1F + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DC6A0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DC69C: .4byte sub_80DC6A4 + 1 +_080DC6A0: .4byte 0x03005e00 + thumb_func_end sub_80DC674 + + thumb_func_start sub_80DC6A4 +sub_80DC6A4: @ 80DC6A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r2, _080DC71C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x8] + adds r5, r0, 0 + ldr r0, _080DC720 + ldr r4, [r0] + ldr r0, [r4] + ldrb r1, [r0, 0xD] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5 + lsls r0, 3 + adds r7, r2, 0 + adds r7, 0x8 + adds r1, r0, r7 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080DC6DC + cmp r0, 0xFF + bne _080DC716 +_080DC6DC: + movs r3, 0 + movs r0, 0xFF + strh r0, [r1] + lsls r1, r5, 2 + adds r1, 0x1 + lsls r1, 1 + ldr r0, [r4] + ldrb r2, [r0, 0xD] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r7 + strh r3, [r1] + ldr r0, [r4] + adds r0, 0x14 + adds r0, r5 + ldrb r0, [r0] + adds r0, 0x5 + lsls r0, 4 + adds r0, 0x6 + ldr r3, _080DC724 + movs r1, 0x2 + movs r2, 0 + bl pal_fade_1 + adds r0, r6, 0 + bl remove_task +_080DC716: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DC71C: .4byte 0x03005e00 +_080DC720: .4byte 0x02039f34 +_080DC724: .4byte 0x00004bff + thumb_func_end sub_80DC6A4 + + thumb_func_start sub_80DC728 +sub_80DC728: @ 80DC728 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + lsls r1, r0, 2 + adds r1, r0 + mov r9, r1 + lsls r7, r1, 3 + ldr r0, _080DC778 + mov r8, r0 + movs r1, 0x8 + negs r1, r1 + add r1, r8 + mov r10, r1 +_080DC74C: + lsls r0, r6, 26 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r7 + mov r4, r8 + adds r2, r0, r4 + ldrh r4, [r2] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r0, 0xFF + beq _080DC7CA + adds r0, r3, 0x1 + lsls r1, r0, 1 + adds r1, r7 + add r1, r8 + movs r5, 0 + ldrsh r1, [r1, r5] + adds r5, r0, 0 + cmp r1, 0 + bne _080DC77C + adds r0, r4, 0x1 + b _080DC77E + .align 2, 0 +_080DC778: .4byte 0x03005e08 +_080DC77C: + subs r0, r4, 0x1 +_080DC77E: + strh r0, [r2] + lsls r1, r3, 1 + mov r0, r9 + lsls r2, r0, 3 + adds r0, r1, r2 + mov r3, r10 + adds r3, 0x8 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + cmp r0, 0x10 + beq _080DC79C + cmp r0, 0 + bne _080DC7AA +_080DC79C: + lsls r0, r5, 1 + adds r0, r2 + adds r0, r3 + ldrh r1, [r0] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0] +_080DC7AA: + ldr r0, _080DC7E4 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x14 + adds r0, r6 + ldrb r0, [r0] + adds r0, 0x5 + lsls r0, 4 + adds r0, 0x6 + adds r1, r4, r7 + add r1, r8 + ldrb r2, [r1] + movs r1, 0x2 + ldr r3, _080DC7E8 + bl pal_fade_1 +_080DC7CA: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _080DC74C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DC7E4: .4byte 0x02039f34 +_080DC7E8: .4byte 0x00004bff + thumb_func_end sub_80DC728 + + thumb_func_start sub_80DC7EC +sub_80DC7EC: @ 80DC7EC + push {r4,lr} + ldr r0, _080DC814 + movs r1, 0x1E + bl AddTask + ldr r1, _080DC818 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0xE] + movs r4, 0 +_080DC800: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DC81C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC800 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DC814: .4byte sub_80DC8D0 + 1 +_080DC818: .4byte 0x02039f34 + thumb_func_end sub_80DC7EC + + thumb_func_start sub_80DC81C +sub_80DC81C: @ 80DC81C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _080DC85C + ldr r1, _080DC860 + ldr r4, [r1] + ldr r1, [r4] + ldrb r2, [r1, 0xE] + lsls r1, r2, 2 + adds r1, r2 + adds r1, r0 + lsls r1, 3 + adds r3, 0x8 + adds r1, r3 + movs r5, 0 + movs r2, 0xFF + strh r2, [r1] + lsls r0, 2 + adds r0, 0x1 + lsls r0, 1 + ldr r1, [r4] + ldrb r2, [r1, 0xE] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + adds r0, r3 + strh r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DC85C: .4byte 0x03005e00 +_080DC860: .4byte 0x02039f34 + thumb_func_end sub_80DC81C + + thumb_func_start sub_80DC864 +sub_80DC864: @ 80DC864 + push {r4,lr} + movs r4, 0 +_080DC868: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DC87C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC868 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DC864 + + thumb_func_start sub_80DC87C +sub_80DC87C: @ 80DC87C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80DC81C + adds r0, r4, 0x5 + lsls r2, r0, 5 + ldr r3, _080DC8C0 + adds r6, r2, r3 + ldr r5, _080DC8C4 + adds r2, r5 + ldr r1, _080DC8C8 + str r6, [r1] + str r2, [r1, 0x4] + ldr r2, _080DC8CC + str r2, [r1, 0x8] + ldr r6, [r1, 0x8] + lsls r0, 4 + adds r4, 0xC + adds r0, r4 + lsls r0, 1 + subs r3, 0x14 + adds r3, r0, r3 + subs r5, 0x14 + adds r0, r5 + str r3, [r1] + str r0, [r1, 0x4] + str r2, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DC8C0: .4byte 0x02037728 +_080DC8C4: .4byte 0x02037b28 +_080DC8C8: .4byte 0x040000d4 +_080DC8CC: .4byte 0x80000001 + thumb_func_end sub_80DC87C + + thumb_func_start sub_80DC8D0 +sub_80DC8D0: @ 80DC8D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + movs r7, 0 + lsls r1, r0, 2 + adds r1, r0 + mov r9, r1 + lsls r6, r1, 3 + ldr r0, _080DC938 + mov r8, r0 + ldr r1, _080DC93C + mov r10, r1 +_080DC8F0: + lsls r0, r7, 26 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r6 + mov r4, r8 + adds r2, r0, r4 + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r0, 0xFF + beq _080DC996 + adds r0, r3, 0x2 + lsls r0, 1 + adds r0, r6 + adds r1, r0, r4 + ldrh r0, [r1] + adds r0, 0x1 + movs r4, 0 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080DC996 + strh r4, [r1] + adds r0, r3, 0x1 + lsls r1, r0, 1 + adds r1, r6 + add r1, r8 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r4, r0, 0 + cmp r1, 0 + bne _080DC940 + ldrh r0, [r2] + adds r0, 0x1 + b _080DC944 + .align 2, 0 +_080DC938: .4byte 0x03005e08 +_080DC93C: .4byte 0x00004bff +_080DC940: + ldrh r0, [r2] + subs r0, 0x1 +_080DC944: + strh r0, [r2] + lsls r1, r3, 1 + mov r5, r9 + lsls r2, r5, 3 + adds r0, r1, r2 + ldr r3, _080DC9B0 + adds r3, 0x8 + adds r0, r3 + movs r5, 0 + ldrsh r0, [r0, r5] + adds r5, r1, 0 + cmp r0, 0x10 + beq _080DC962 + cmp r0, 0 + bne _080DC970 +_080DC962: + lsls r0, r4, 1 + adds r0, r2 + adds r0, r3 + ldrh r1, [r0] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0] +_080DC970: + adds r4, r7, 0x5 + lsls r4, 4 + adds r0, r4, 0 + adds r0, 0xA + adds r5, r6 + add r5, r8 + ldrb r2, [r5] + movs r1, 0x1 + mov r3, r10 + bl pal_fade_1 + adds r4, 0xC + adds r4, r7 + ldrb r2, [r5] + adds r0, r4, 0 + movs r1, 0x1 + mov r3, r10 + bl pal_fade_1 +_080DC996: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DC8F0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DC9B0: .4byte 0x03005e00 + thumb_func_end sub_80DC8D0 + + thumb_func_start sub_80DC9B4 +sub_80DC9B4: @ 80DC9B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080DC9DC + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DC9E0 + adds r0, r2, 0 + bl sub_80DC630 + b _080DC9E6 + .align 2, 0 +_080DC9DC: .4byte 0x02039f34 +_080DC9E0: + adds r0, r2, 0 + bl sub_80DC674 +_080DC9E6: + pop {r0} + bx r0 + thumb_func_end sub_80DC9B4 + + thumb_func_start sub_80DC9EC +sub_80DC9EC: @ 80DC9EC + 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, 0xC] + ldr r6, _080DCB48 + adds r6, r0, r6 + ldrb r0, [r6] + lsls r5, r0, 2 + adds r5, r0 + lsls r5, 27 + movs r0, 0x80 + lsls r0, 22 + adds r5, r0 + lsrs r5, 24 + ldr r1, [sp, 0xC] + lsls r4, r1, 3 + ldr r0, _080DCB4C + adds r0, r4, r0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080DCB50 + adds r4, r0 + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r2, [sp, 0xC] + lsls r4, r2, 1 + adds r4, r2 + lsls r4, 3 + ldr r0, _080DCB54 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB8 + adds r2, r5, 0 + movs r3, 0x1D + bl obj_add_from_template_forward_search + mov r9, r0 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + adds r0, r4, 0 + movs r1, 0xF8 + adds r2, r5, 0 + movs r3, 0x1D + bl obj_add_from_template_forward_search + 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 r1, _080DCB58 + adds r5, r1 + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x40 + ldr r3, _080DCB5C + adds r0, r3, 0 + ands r1, r0 + ldr r0, _080DCB60 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r4, 0xC0 + lsls r4, 19 + ldrb r0, [r6] + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 6 + ldr r0, _080DCB64 + adds r3, r0 + ldr r7, _080DCB68 + ldr r0, [r7] + ldr r0, [r0, 0x34] + str r0, [sp] + movs r0, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl rfu_MBOOT_CHILD_inheritanceLinkStatus + ldrb r0, [r6] + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 6 + ldr r1, _080DCB6C + adds r3, r1 + ldr r0, [r7] + ldr r0, [r0, 0x38] + str r0, [sp] + movs r0, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl rfu_MBOOT_CHILD_inheritanceLinkStatus + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, [r7] + ldr r1, [r0, 0x34] + movs r6, 0xA0 + lsls r6, 3 + adds r1, r6 + ldr r2, _080DCB70 + mov r10, r2 + add r0, sp, 0x4 + bl CpuSet + str r4, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r7] + ldr r1, [r1, 0x38] + adds r1, r6 + mov r2, r10 + bl CpuSet + ldr r0, [r7] + ldr r0, [r0, 0x34] + mov r3, r9 + lsls r4, r3, 4 + add r4, r9 + lsls r4, 2 + ldr r1, _080DCB58 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r6, _080DCB74 + adds r1, r6 + movs r2, 0x80 + lsls r2, 4 + mov r10, r2 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + ldr r0, [r7] + ldr r0, [r0, 0x38] + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, r6 + mov r2, r10 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + mov r3, r8 + strh r3, [r4, 0x2E] + mov r0, r9 + strh r0, [r5, 0x2E] + mov r1, sp + ldrh r1, [r1, 0xC] + strh r1, [r4, 0x30] + mov r2, sp + ldrh r2, [r2, 0xC] + strh r2, [r5, 0x30] + 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 + .align 2, 0 +_080DCB48: .4byte 0x02039f26 +_080DCB4C: .4byte 0x08589904 +_080DCB50: .4byte 0x08589924 +_080DCB54: .4byte 0x0858998c +_080DCB58: .4byte 0x02020630 +_080DCB5C: .4byte 0x000003ff +_080DCB60: .4byte 0xfffffc00 +_080DCB64: .4byte 0x0600e026 +_080DCB68: .4byte 0x02039f34 +_080DCB6C: .4byte 0x0600e036 +_080DCB70: .4byte 0x050000c0 +_080DCB74: .4byte 0x06010000 + thumb_func_end sub_80DC9EC + + thumb_func_start sub_80DCB78 +sub_80DCB78: @ 80DCB78 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DCBB0 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + adds r5, r1 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl obj_delete_and_free_resources + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DCBB0: .4byte 0x02020630 + thumb_func_end sub_80DCB78 + + thumb_func_start sub_80DCBB4 +sub_80DCBB4: @ 80DCBB4 + push {lr} + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _080DCBCC + movs r0, 0x52 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_080DCBCC: .4byte 0x00000907 + thumb_func_end sub_80DCBB4 + + thumb_func_start sub_80DCBD0 +sub_80DCBD0: @ 80DCBD0 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end sub_80DCBD0 + + thumb_func_start sub_80DCBE8 +sub_80DCBE8: @ 80DCBE8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r4, r0, 0 + mov r9, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + bl sub_80DCBB4 + ldr r0, _080DCC60 + ldr r1, [r0] + ldr r2, _080DCC64 + mov r8, r2 + lsls r6, r4, 4 + adds r6, r4 + lsls r6, 2 + adds r0, r6, r2 + movs r3, 0x30 + ldrsh r2, [r0, r3] + ldr r1, [r1, 0x14] + lsls r2, 2 + adds r2, r1 + ldrb r1, [r2, 0x2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2, 0x2] + ldrh r5, [r0, 0x2E] + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x1 + bl sub_8008258 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + mov r1, r8 + adds r0, r4, r1 + movs r1, 0x1 + bl sub_8008258 + movs r2, 0x1C + add r8, r2 + add r6, r8 + ldr r0, _080DCC68 + str r0, [r6] + add r4, r8 + ldr r0, _080DCC6C + str r0, [r4] + mov r3, r9 + cmp r3, 0 + bne _080DCC70 + movs r0, 0x65 + bl audio_play + b _080DCC76 + .align 2, 0 +_080DCC60: .4byte 0x02039f34 +_080DCC64: .4byte 0x02020630 +_080DCC68: .4byte sub_80DCC84 + 1 +_080DCC6C: .4byte nullsub_12 + 1 +_080DCC70: + movs r0, 0x2 + bl audio_play +_080DCC76: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80DCBE8 + + thumb_func_start sub_80DCC84 +sub_80DCC84: @ 80DCC84 + push {lr} + mov r12, r0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080DCCCC + mov r0, r12 + ldrh r1, [r0, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080DCCD0 + 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, 26 + cmp r0, 0 + bge _080DCCCC + mov r3, r12 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + ldr r0, _080DCCD4 + mov r1, r12 + str r0, [r1, 0x1C] +_080DCCCC: + pop {r0} + bx r0 + .align 2, 0 +_080DCCD0: .4byte 0x02020630 +_080DCCD4: .4byte sub_80DCCD8 + 1 + thumb_func_end sub_80DCC84 + + thumb_func_start sub_80DCCD8 +sub_80DCCD8: @ 80DCCD8 + push {lr} + ldr r1, _080DCD04 + ldr r1, [r1] + movs r3, 0x30 + ldrsh r2, [r0, r3] + ldr r1, [r1, 0x14] + lsls r2, 2 + adds r2, r1 + ldrb r3, [r2, 0x2] + movs r1, 0x3 + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x2] + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_80DCB78 + bl sub_80DCBD0 + pop {r0} + bx r0 + .align 2, 0 +_080DCD04: .4byte 0x02039f34 + thumb_func_end sub_80DCCD8 + + thumb_func_start sub_80DCD08 +sub_80DCD08: @ 80DCD08 + push {lr} + ldr r0, _080DCD20 + movs r1, 0xD0 + lsls r1, 9 + adds r2, r0, r1 + ldrb r1, [r2] + adds r3, r0, 0 + cmp r1, 0x1 + bne _080DCD24 + movs r0, 0 + b _080DCD26 + .align 2, 0 +_080DCD20: .4byte 0x02000000 +_080DCD24: + movs r0, 0x1 +_080DCD26: + strb r0, [r2] + movs r1, 0xD0 + lsls r1, 9 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DCD3E + bl sub_80DAEA4 + bl sub_80DB2BC + b _080DCD42 +_080DCD3E: + bl sub_80DCD48 +_080DCD42: + pop {r0} + bx r0 + thumb_func_end sub_80DCD08 + + thumb_func_start sub_80DCD48 +sub_80DCD48: @ 80DCD48 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _080DCD74 + ldrb r0, [r0] + cmp r0, 0 + beq _080DCE44 + ldr r0, _080DCD78 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080DCE44 + cmp r0, 0 + blt _080DCD7C + cmp r0, 0x3 + bgt _080DCD7C + cmp r0, 0x2 + blt _080DCD7C + bl sub_80DF750 + b _080DCE44 + .align 2, 0 +_080DCD74: .4byte 0x020322d5 +_080DCD78: .4byte 0x02000000 +_080DCD7C: + movs r5, 0 +_080DCD7E: + adds r0, r5, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080DCD7E + movs r5, 0 +_080DCD92: + ldr r0, _080DCE4C + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + add r2, sp, 0x4 + ldrh r4, [r0, 0x4] + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080DCDBC + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0 + ldr r1, _080DCE50 + bl gf_strcpy + adds r2, r0, 0 +_080DCDBC: + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r0, _080DCE54 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x7 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x37 + movs r3, 0x1 + bl sub_80DEBD0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080DCD92 + movs r5, 0 +_080DCDEA: + ldr r0, _080DCE4C + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + add r2, sp, 0x4 + ldrh r4, [r0, 0x2] + movs r1, 0x2 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080DCE14 + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0 + ldr r1, _080DCE50 + bl gf_strcpy + adds r2, r0, 0 +_080DCE14: + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r0, _080DCE54 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x7 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080DCDEA + bl sub_80DB2BC +_080DCE44: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DCE4C: .4byte 0x02039f34 +_080DCE50: .4byte 0x085e8d40 +_080DCE54: .4byte 0x02039f26 + thumb_func_end sub_80DCD48 + + thumb_func_start sub_80DCE58 +sub_80DCE58: @ 80DCE58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r5, 0 + add r4, sp, 0x4 + adds r6, r4, 0 + movs r7, 0 +_080DCE7E: + bl GenerateRandomNumber + adds r1, r0, 0 + mov r0, sp + adds r0, r7 + adds r0, 0x4 + strh r1, [r0] + movs r2, 0 + cmp r2, r5 + bge _080DCEB6 + lsls r0, r1, 16 + lsrs r0, 16 + mov r1, sp + ldrh r1, [r1, 0x4] + cmp r0, r1 + beq _080DCEB0 +_080DCE9E: + adds r2, 0x1 + cmp r2, r5 + bge _080DCEB6 + lsls r0, r2, 1 + adds r0, r4, r0 + ldrh r1, [r6] + ldrh r0, [r0] + cmp r1, r0 + bne _080DCE9E +_080DCEB0: + subs r6, 0x2 + subs r7, 0x2 + subs r5, 0x1 +_080DCEB6: + adds r6, 0x2 + adds r7, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCE7E + mov r2, r8 + cmp r2, 0 + bne _080DCF80 + movs r5, 0 + ldr r3, _080DCF38 + mov r8, r3 +_080DCECC: + mov r6, r8 + strb r5, [r6] + movs r4, 0 + cmp r4, r5 + bge _080DCF48 + ldr r7, _080DCF3C + mov r9, r7 + lsls r0, r5, 1 + adds r1, r0, 0 + add r1, r9 + mov r12, r1 + mov r2, sp + adds r2, 0x4 + str r2, [sp, 0xC] + add r0, sp + adds r0, 0x4 + str r0, [sp, 0x10] + ldr r3, _080DCF38 + adds r6, r3, 0 + mov r10, r6 +_080DCEF4: + ldrb r0, [r3] + lsls r2, r0, 1 + mov r7, r9 + adds r0, r2, r7 + movs r6, 0 + ldrsh r1, [r0, r6] + mov r7, r12 + movs r6, 0 + ldrsh r0, [r7, r6] + cmp r1, r0 + blt _080DCF1C + cmp r1, r0 + bne _080DCF40 + ldr r7, [sp, 0xC] + adds r0, r7, r2 + ldrh r0, [r0] + ldr r1, [sp, 0x10] + ldrh r1, [r1] + cmp r0, r1 + bcs _080DCF40 +_080DCF1C: + adds r2, r5, 0 + cmp r5, r4 + ble _080DCF34 + subs r0, r5, 0x1 + mov r6, r10 + adds r1, r0, r6 +_080DCF28: + ldrb r0, [r1] + strb r0, [r1, 0x1] + subs r1, 0x1 + subs r2, 0x1 + cmp r2, r4 + bgt _080DCF28 +_080DCF34: + strb r5, [r3] + b _080DCF48 + .align 2, 0 +_080DCF38: .4byte 0x02039f26 +_080DCF3C: .4byte 0x02039f00 +_080DCF40: + adds r3, 0x1 + adds r4, 0x1 + cmp r4, r5 + blt _080DCEF4 +_080DCF48: + cmp r4, r5 + bne _080DCF50 + mov r7, r8 + strb r5, [r7] +_080DCF50: + movs r0, 0x1 + add r8, r0 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCECC + ldr r4, _080DCF7C + mov r0, sp + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy + movs r5, 0 +_080DCF68: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + adds r0, r4 + strb r5, [r0] + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCF68 + b _080DD034 + .align 2, 0 +_080DCF7C: .4byte 0x02039f26 +_080DCF80: + mov r0, sp + movs r1, 0xFF + movs r2, 0x4 + bl memset + movs r5, 0 + ldr r3, _080DCFA4 + movs r6, 0 +_080DCF90: + ldr r0, _080DCFA8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r0, [r0, 0xB] + lsls r0, 30 + lsrs r2, r0, 30 + mov r7, sp + adds r1, r7, r2 + b _080DCFB6 + .align 2, 0 +_080DCFA4: .4byte 0x02039f26 +_080DCFA8: .4byte 0x02039f34 +_080DCFAC: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + mov r0, sp + adds r1, r0, r2 +_080DCFB6: + ldrb r0, [r1] + cmp r0, 0xFF + bne _080DCFAC + strb r5, [r1] + strb r2, [r3] + adds r3, 0x1 + adds r6, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCF90 + movs r5, 0 +_080DCFCC: + movs r4, 0x3 + adds r1, r5, 0x1 + mov r10, r1 + cmp r4, r5 + ble _080DD02E + mov r9, r4 + ldr r2, _080DD044 + mov r8, r2 + add r3, sp, 0x4 + mov r12, r3 +_080DCFE0: + ldr r6, _080DD048 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + adds r1, r0, 0 + subs r1, 0x1C + ldrb r2, [r1, 0xB] + ldrb r3, [r0, 0xB] + mov r1, r9 + ands r1, r2 + mov r0, r9 + ands r0, r3 + subs r3, r4, 0x1 + cmp r1, r0 + bne _080DD028 + mov r0, r8 + adds r7, r3, r0 + adds r2, r4, r0 + ldrb r6, [r7] + ldrb r1, [r2] + cmp r6, r1 + bcs _080DD028 + lsls r0, r3, 1 + add r0, r12 + lsls r1, r4, 1 + add r1, r12 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _080DD028 + ldrb r0, [r2] + strb r6, [r2] + strb r0, [r7] +_080DD028: + adds r4, r3, 0 + cmp r4, r5 + bgt _080DCFE0 +_080DD02E: + mov r5, r10 + cmp r5, 0x2 + ble _080DCFCC +_080DD034: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DD044: .4byte 0x02039f26 +_080DD048: .4byte 0x02039f34 + thumb_func_end sub_80DCE58 + + thumb_func_start sub_80DD04C +sub_80DD04C: @ 80DD04C + push {r4,r5,lr} + movs r4, 0 + movs r5, 0xA0 +_080DD052: + ldr r0, _080DD078 + adds r0, r5, r0 + ldr r1, _080DD07C + adds r1, r4, r1 + ldrb r1, [r1] + adds r1, 0x5 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + adds r5, 0x20 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD052 + bl sub_80DAEA4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DD078: .4byte 0x0201a004 +_080DD07C: .4byte 0x02039f26 + thumb_func_end sub_80DD04C + + thumb_func_start sub_80DD080 +sub_80DD080: @ 80DD080 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _080DD108 + ldr r3, [r4] + ldr r1, [r3, 0x4] + lsls r7, r6, 3 + subs r0, r7, r6 + lsls r5, r0, 2 + adds r1, r5, r1 + movs r2, 0 + strh r2, [r1, 0x2] + ldr r0, [r3, 0x4] + adds r0, r5, r0 + strh r2, [r0] + adds r0, r6, 0 + bl sub_80DBA68 + lsls r0, 24 + mov r8, r4 + cmp r0, 0 + bne _080DD0B4 + b _080DD3C4 +_080DD0B4: + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrh r0, [r1, 0x6] + ldr r2, _080DD10C + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0] + mov r9, r2 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + strb r0, [r1, 0xA] + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r2, r5, r0 + ldrh r0, [r2, 0x6] + ldrh r1, [r2, 0x8] + cmp r0, r1 + bne _080DD110 + cmp r0, 0 + beq _080DD110 + ldrb r0, [r2, 0x15] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x15] + ldr r0, [r4] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r3, [r2, 0xB] + lsls r1, r3, 25 + lsrs r1, 29 + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0xB] + b _080DD12C + .align 2, 0 +_080DD108: .4byte 0x02039f34 +_080DD10C: .4byte 0x0858c2b4 +_080DD110: + ldr r4, _080DD1E0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + lsls r3, r6, 3 + subs r1, r3, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0xB] + movs r0, 0x71 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + mov r8, r4 + adds r7, r3, 0 +_080DD12C: + mov r2, r8 + ldr r4, [r2] + ldr r2, [r4, 0x4] + subs r0, r7, r6 + lsls r0, 2 + adds r2, r0, r2 + ldr r3, _080DD1E4 + mov r1, r9 + lsls r5, r1, 2 + adds r3, r5, r3 + ldrb r1, [r3, 0x1] + strh r1, [r2] + ldr r1, [r4, 0x4] + adds r0, r1 + ldrh r1, [r0] + strh r1, [r0, 0x2] + ldr r1, [r4, 0x8] + ldrb r0, [r3, 0x2] + strh r0, [r1, 0x4] + ldr r1, [r4, 0x8] + ldrh r0, [r1, 0x4] + strh r0, [r1, 0x6] + ldr r0, [r4, 0x8] + strb r6, [r0, 0x11] + movs r2, 0 + mov r9, r5 + mov r4, r8 + movs r3, 0 + movs r1, 0 +_080DD166: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r0, r1, r0 + strb r3, [r0, 0xE] + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r0, 0xD + adds r0, r2 + strb r3, [r0] + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + ble _080DD166 + ldr r5, _080DD1E0 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r2, r4, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DD1B4 + ldrh r0, [r2, 0x8] + ldrh r1, [r2, 0x6] + bl sub_80E5414 + lsls r0, 24 + cmp r0, 0 + bne _080DD1B4 + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] +_080DD1B4: + ldr r0, _080DD1E8 + add r0, r9 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _080DD1E0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x10] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x10 + bne _080DD1EC + ldrh r1, [r2, 0x2] + subs r1, 0xA + movs r0, 0xD + ldrsb r0, [r2, r0] + b _080DD206 + .align 2, 0 +_080DD1E0: .4byte 0x02039f34 +_080DD1E4: .4byte 0x0858cdcc +_080DD1E8: .4byte 0x0858cecc +_080DD1EC: + ldrb r1, [r2, 0x11] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080DD200 + movs r1, 0xD + ldrsb r1, [r2, r1] + lsls r0, r1, 1 + adds r0, r1 + b _080DD204 +_080DD200: + movs r0, 0xD + ldrsb r0, [r2, r0] +_080DD204: + ldrh r1, [r2, 0x2] +_080DD206: + adds r0, r1 + strh r0, [r2, 0x2] + ldr r5, _080DD298 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r1, r4, r1 + movs r0, 0 + strb r0, [r1, 0x16] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] + adds r0, r6, 0 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _080DD2E2 + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrh r0, [r1, 0x8] + ldrh r1, [r1, 0x6] + bl sub_80E5414 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080DD29C + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DD29C + strb r3, [r2, 0x16] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x15] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0 + ldrsh r2, [r0, r1] + ldrb r1, [r0, 0x16] + muls r1, r2 + strb r1, [r0, 0x17] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x15] + movs r2, 0x8 + b _080DD2C8 + .align 2, 0 +_080DD298: .4byte 0x02039f34 +_080DD29C: + ldr r2, _080DD2D0 + ldr r5, _080DD2D4 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r3, r4, r1 + ldrh r0, [r3, 0x6] + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _080DD2D8 + ldrb r0, [r3, 0x15] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x15] + movs r2, 0x40 +_080DD2C8: + orrs r0, r2 + strb r0, [r1, 0x15] + b _080DD2E2 + .align 2, 0 +_080DD2D0: .4byte 0x0858c2b4 +_080DD2D4: .4byte 0x02039f34 +_080DD2D8: + ldrb r1, [r3, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x15] +_080DD2E2: + ldr r5, _080DD380 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r2, r4, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x1 + mov r8, r0 + ands r0, r1 + cmp r0, 0 + beq _080DD30A + ldrb r0, [r2, 0xB] + lsls r0, 25 + lsrs r0, 29 + adds r0, 0x1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + strb r1, [r2, 0x18] +_080DD30A: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0xC] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _080DD334 + ldrb r1, [r2, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r5] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + movs r1, 0 + strh r1, [r0, 0x2] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + strh r1, [r0] +_080DD334: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl sub_80DD9F0 + ldr r1, [r5] + ldr r1, [r1, 0x10] + strb r0, [r1] + ldr r2, [r5] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrb r1, [r0, 0x11] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DD35C + ldr r0, [r2, 0x10] + mov r1, r8 + strb r1, [r0] +_080DD35C: + ldr r1, [r5] + ldr r3, [r1, 0x10] + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0 + ble _080DD388 + ldr r0, [r1] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r3, r1] + adds r0, r1 + cmp r0, 0x4 + ble _080DD384 + movs r0, 0x3C + b _080DD38A + .align 2, 0 +_080DD380: .4byte 0x02039f34 +_080DD384: + movs r0, 0xA + b _080DD38A +_080DD388: + movs r0, 0 +_080DD38A: + strb r0, [r3, 0x2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + b _080DD3AE +_080DD3A2: + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_080DD3A8: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080DD3B6 +_080DD3AE: + cmp r2, r6 + beq _080DD3A8 + cmp r0, 0 + bne _080DD3A2 +_080DD3B6: + ldr r0, _080DD3D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r0, 2 + adds r0, r1 + strb r2, [r0, 0x1B] +_080DD3C4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DD3D0: .4byte 0x02039f34 + thumb_func_end sub_80DD080 + + thumb_func_start sub_80DD3D4 +sub_80DD3D4: @ 80DD3D4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DD3EC + ldr r2, [r2] + ldr r3, [r2, 0x4] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r3 + strb r1, [r2, 0x13] + bx lr + .align 2, 0 +_080DD3EC: .4byte 0x02039f34 + thumb_func_end sub_80DD3D4 + + thumb_func_start sub_80DD3F0 +sub_80DD3F0: @ 80DD3F0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DD408 + ldr r2, [r2] + ldr r3, [r2, 0x4] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r3 + strb r1, [r2, 0x14] + bx lr + .align 2, 0 +_080DD408: .4byte 0x02039f34 + thumb_func_end sub_80DD3F0 + + thumb_func_start sub_80DD40C +sub_80DD40C: @ 80DD40C + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x3B + bls _080DD426 + movs r1, 0x35 + bl sub_80DD3D4 + b _080DD456 +_080DD426: + cmp r1, 0x27 + bls _080DD432 + movs r1, 0x34 + bl sub_80DD3D4 + b _080DD456 +_080DD432: + cmp r1, 0x1D + bls _080DD43E + movs r1, 0x33 + bl sub_80DD3D4 + b _080DD456 +_080DD43E: + cmp r1, 0x13 + bls _080DD44A + movs r1, 0x32 + bl sub_80DD3D4 + b _080DD456 +_080DD44A: + cmp r2, 0x9 + bls _080DD456 + adds r0, r3, 0 + movs r1, 0x31 + bl sub_80DD3D4 +_080DD456: + pop {r0} + bx r0 + thumb_func_end sub_80DD40C + + thumb_func_start sub_80DD45C +sub_80DD45C: @ 80DD45C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, _080DD4BC + lsls r1, r4, 6 + ldr r2, _080DD4C0 + adds r1, r2 + bl gf_strcpy + ldr r0, _080DD4C4 + ldr r5, _080DD4C8 + ldr r1, [r5] + ldr r2, [r1, 0x4] + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, _080DD4CC + adds r1, r2 + bl gf_strcpy + ldr r3, _080DD4D0 + ldr r1, [r5] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r1, r0, 29 + cmp r1, 0 + bne _080DD4DC + ldr r0, _080DD4D4 + ldr r1, _080DD4D8 + bl gf_strcpy + b _080DD52C + .align 2, 0 +_080DD4BC: .4byte 0x02021cc4 +_080DD4C0: .4byte 0x02039e02 +_080DD4C4: .4byte 0x02021dc4 +_080DD4C8: .4byte 0x02039f34 +_080DD4CC: .4byte 0x0831977c +_080DD4D0: .4byte 0x0858c2b4 +_080DD4D4: .4byte 0x02021ec4 +_080DD4D8: .4byte 0x0827e837 +_080DD4DC: + lsrs r0, r1, 29 + cmp r0, 0x1 + bne _080DD4F4 + ldr r0, _080DD4EC + ldr r1, _080DD4F0 + bl gf_strcpy + b _080DD52C + .align 2, 0 +_080DD4EC: .4byte 0x02021ec4 +_080DD4F0: .4byte 0x0827e83f +_080DD4F4: + lsrs r0, r1, 29 + cmp r0, 0x2 + bne _080DD50C + ldr r0, _080DD504 + ldr r1, _080DD508 + bl gf_strcpy + b _080DD52C + .align 2, 0 +_080DD504: .4byte 0x02021ec4 +_080DD508: .4byte 0x0827e847 +_080DD50C: + lsrs r0, r1, 29 + cmp r0, 0x3 + bne _080DD524 + ldr r0, _080DD51C + ldr r1, _080DD520 + bl gf_strcpy + b _080DD52C + .align 2, 0 +_080DD51C: .4byte 0x02021ec4 +_080DD520: .4byte 0x0827e850 +_080DD524: + ldr r0, _080DD550 + ldr r1, _080DD554 + bl gf_strcpy +_080DD52C: + ldr r4, _080DD558 + ldr r1, _080DD55C + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandTextCodes + bl sub_80DB89C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DD550: .4byte 0x02021ec4 +_080DD554: .4byte 0x0827e85a +_080DD558: .4byte 0x02021fc4 +_080DD55C: .4byte 0x08587e10 + thumb_func_end sub_80DD45C + + thumb_func_start sub_80DD560 +sub_80DD560: @ 80DD560 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080DD58C + ldr r1, [r4] + ldr r3, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r3, r1, r3 + ldrb r0, [r3, 0xC] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r3, 0xC] + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DD58C: .4byte 0x02039f34 + thumb_func_end sub_80DD560 + + thumb_func_start sub_80DD590 +sub_80DD590: @ 80DD590 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r12, r0 + movs r4, 0 + ldr r1, _080DD5FC + mov r9, r1 + add r2, sp, 0x4 + mov r6, r9 + movs r5, 0 + adds r3, r2, 0 +_080DD5AC: + mov r0, sp + adds r1, r0, r4 + adds r0, r4, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r4 + strb r5, [r0] + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD5AC + movs r4, 0 + ldr r7, _080DD600 + ldr r1, [r7] + mov r8, r1 + adds r5, r2, 0 +_080DD5CA: + movs r2, 0 + mov r0, r8 + ldr r1, [r0, 0x4] +_080DD5D0: + ldrb r0, [r1, 0x19] + cmp r0, r4 + beq _080DD604 + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + ble _080DD5D0 +_080DD5DE: + cmp r2, 0x4 + bne _080DD684 + movs r2, 0 + ldrb r0, [r5] + cmp r0, 0 + bne _080DD612 + ldr r0, [r7] + ldr r0, [r0, 0x4] + ldrb r0, [r0, 0x19] + cmp r0, 0xFF + bne _080DD612 + mov r12, r2 + movs r2, 0x1 + b _080DD63A + .align 2, 0 +_080DD5FC: .4byte 0x02039f26 +_080DD600: .4byte 0x02039f34 +_080DD604: + mov r1, sp + adds r0, r1, r2 + strb r4, [r0] + adds r1, r5, r2 + movs r0, 0x1 + strb r0, [r1] + b _080DD5DE +_080DD612: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080DD676 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080DD612 + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x19] + cmp r0, 0xFF + bne _080DD612 + lsls r0, r2, 24 + lsrs r0, 24 + mov r12, r0 + adds r2, 0x1 +_080DD63A: + cmp r2, 0x3 + bgt _080DD676 + ldr r6, _080DD6D4 + lsls r0, r2, 3 + subs r0, r2 + lsls r3, r0, 2 +_080DD646: + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080DD66E + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r3, r0 + ldrb r0, [r0, 0x19] + cmp r0, 0xFF + bne _080DD66E + mov r1, r12 + adds r0, r1, r6 + adds r1, r2, r6 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080DD66E + lsls r0, r2, 24 + lsrs r0, 24 + mov r12, r0 +_080DD66E: + adds r3, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + ble _080DD646 +_080DD676: + mov r0, sp + add r0, r12 + strb r4, [r0] + mov r0, r12 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080DD684: + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD5CA + movs r4, 0 + ldr r6, _080DD6D8 + movs r5, 0 +_080DD690: + ldr r0, [r6] + ldr r1, [r0, 0x8] + adds r1, r4 + mov r0, sp + adds r3, r0, r4 + ldrb r0, [r3] + strb r0, [r1] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + movs r1, 0xFF + strb r1, [r0, 0x19] + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x10] + mov r0, r9 + adds r1, r4, r0 + ldrb r0, [r3] + strb r0, [r1] + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD690 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DD6D4: .4byte 0x02039f26 +_080DD6D8: .4byte 0x02039f34 + thumb_func_end sub_80DD590 + + thumb_func_start sub_80DD6DC +sub_80DD6DC: @ 80DD6DC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0x1 + strh r1, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x54 + ble _080DD712 + movs r0, 0 + strh r0, [r2, 0x30] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldr r0, _080DD718 + str r0, [r2, 0x1C] + ldr r0, _080DD71C + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] +_080DD712: + pop {r0} + bx r0 + .align 2, 0 +_080DD718: .4byte nullsub_12 + 1 +_080DD71C: .4byte 0x02039f34 + thumb_func_end sub_80DD6DC + + thumb_func_start sub_80DD720 +sub_80DD720: @ 80DD720 + push {r4,r5,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _080DD740 + ldr r0, [r0] + ldr r0, [r0] + ldrb r5, [r0, 0x12] + cmp r1, 0x8 + bls _080DD734 + b _080DD8D4 +_080DD734: + lsls r0, r1, 2 + ldr r1, _080DD744 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DD740: .4byte 0x02039f34 +_080DD744: .4byte _080DD748 + .align 2, 0 +_080DD748: + .4byte _080DD76C + .4byte _080DD76C + .4byte _080DD79C + .4byte _080DD7D0 + .4byte _080DD804 + .4byte _080DD838 + .4byte _080DD86C + .4byte _080DD8D4 + .4byte _080DD8A0 +_080DD76C: + ldr r0, _080DD790 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x2E] + ldr r2, _080DD794 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD798 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x20 + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD790: .4byte 0x02020630 +_080DD794: .4byte 0x000003ff +_080DD798: .4byte 0xfffffc00 +_080DD79C: + ldr r0, _080DD7C4 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x4 + ldr r3, _080DD7C8 + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD7CC + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x1F + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD7C4: .4byte 0x02020630 +_080DD7C8: .4byte 0x000003ff +_080DD7CC: .4byte 0xfffffc00 +_080DD7D0: + ldr r0, _080DD7F8 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x8 + ldr r3, _080DD7FC + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD800 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x1F + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD7F8: .4byte 0x02020630 +_080DD7FC: .4byte 0x000003ff +_080DD800: .4byte 0xfffffc00 +_080DD804: + ldr r0, _080DD82C + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0xC + ldr r3, _080DD830 + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD834 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD82C: .4byte 0x02020630 +_080DD830: .4byte 0x000003ff +_080DD834: .4byte 0xfffffc00 +_080DD838: + ldr r0, _080DD860 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0xC + ldr r3, _080DD864 + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD868 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD860: .4byte 0x02020630 +_080DD864: .4byte 0x000003ff +_080DD868: .4byte 0xfffffc00 +_080DD86C: + ldr r0, _080DD894 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x10 + ldr r3, _080DD898 + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD89C + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD894: .4byte 0x02020630 +_080DD898: .4byte 0x000003ff +_080DD89C: .4byte 0xfffffc00 +_080DD8A0: + ldr r0, _080DD8C8 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x18 + ldr r3, _080DD8CC + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD8D0 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0xC3 + bl audio_play + b _080DD8F8 + .align 2, 0 +_080DD8C8: .4byte 0x02020630 +_080DD8CC: .4byte 0x000003ff +_080DD8D0: .4byte 0xfffffc00 +_080DD8D4: + ldr r0, _080DD92C + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x14 + ldr r3, _080DD930 + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, _080DD934 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play +_080DD8F8: + adds r2, r4, 0 + ldr r4, _080DD92C + adds r2, r5 + lsls r2, 2 + adds r1, r2, r4 + movs r0, 0 + strh r0, [r1, 0x30] + adds r1, 0x3E + ldrb r3, [r1] + subs r0, 0x5 + ands r0, r3 + strb r0, [r1] + adds r4, 0x1C + adds r2, r4 + ldr r0, _080DD938 + str r0, [r2] + ldr r0, _080DD93C + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DD92C: .4byte 0x02020630 +_080DD930: .4byte 0x000003ff +_080DD934: .4byte 0xfffffc00 +_080DD938: .4byte sub_80DD6DC + 1 +_080DD93C: .4byte 0x02039f34 + thumb_func_end sub_80DD720 + + thumb_func_start sub_80DD940 +sub_80DD940: @ 80DD940 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r6, _080DD9DC + ldr r0, _080DD9E0 + mov r9, r0 + ldr r0, _080DD9E4 + mov r8, r0 + ldr r7, _080DD9E8 +_080DD956: + ldr r0, [r6] + ldr r1, [r0] + movs r0, 0x13 + ldrsb r0, [r1, r0] + ldr r4, _080DD9EC + cmp r5, r0 + bge _080DD966 + adds r4, 0x40 +_080DD966: + adds r0, r1, 0 + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r0, r5, 0 + adds r0, 0x11 + adds r1, r0 + lsls r1, 5 + add r1, r8 + adds r0, r4, 0 + adds r2, r7, 0 + bl CpuSet + adds r0, r4, 0 + adds r0, 0x20 + ldr r1, [r6] + ldr r1, [r1] + adds r1, 0x58 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r9 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r5, 0 + adds r2, 0x19 + adds r1, r2 + lsls r1, 5 + add r1, r8 + adds r2, r7, 0 + bl CpuSet + ldr r0, [r6] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + ble _080DD9C8 + bl sub_80DDA20 +_080DD9C8: + adds r5, 0x1 + cmp r5, 0x4 + ble _080DD956 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DD9DC: .4byte 0x02039f34 +_080DD9E0: .4byte 0x02020630 +_080DD9E4: .4byte 0x06010000 +_080DD9E8: .4byte 0x04000008 +_080DD9EC: .4byte 0x08d8ec24 + thumb_func_end sub_80DD940 + + thumb_func_start sub_80DD9F0 +sub_80DD9F0: @ 80DD9F0 + lsls r0, 16 + ldr r3, _080DDA14 + ldr r1, _080DDA18 + lsrs r0, 13 + adds r0, r1 + ldrb r1, [r0, 0x1] + lsls r1, 29 + lsrs r1, 29 + ldr r0, _080DDA1C + ldrh r2, [r0] + lsls r0, r2, 2 + adds r0, r2 + adds r1, r0 + adds r1, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + bx lr + .align 2, 0 +_080DDA14: .4byte 0x085899ec +_080DDA18: .4byte 0x0858c2b4 +_080DDA1C: .4byte 0x02039f2c + thumb_func_end sub_80DD9F0 + + thumb_func_start sub_80DDA20 +sub_80DDA20: @ 80DDA20 + push {r4,r5,lr} + ldr r0, _080DDA54 + movs r1, 0xA + bl AddTask + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080DDA58 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0x1 + strh r0, [r4, 0xA] + ldr r0, _080DDA5C + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080DDA54: .4byte c3_08130B10 + 1 +_080DDA58: .4byte 0x03005e00 +_080DDA5C: .4byte 0x0000abe2 + thumb_func_end sub_80DDA20 + + thumb_func_start c3_08130B10 +c3_08130B10: @ 80DDA60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080DDA90 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _080DDAFE + movs r0, 0 + strh r0, [r2, 0x8] + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080DDA94 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + b _080DDA98 + .align 2, 0 +_080DDA90: .4byte 0x03005e00 +_080DDA94: + ldrh r0, [r2, 0x10] + subs r0, 0x1 +_080DDA98: + strh r0, [r2, 0x10] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 4 + movs r3, 0x84 + lsls r3, 1 + adds r6, r3, 0 + adds r0, r6 + lsls r0, 16 + lsrs r0, 16 + ldrb r2, [r4, 0x10] + ldr r3, _080DDB04 + movs r1, 0x1 + bl pal_fade_1 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080DDACA + cmp r0, 0x10 + bne _080DDAFE +_080DDACA: + ldrh r0, [r4, 0xE] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0xE] + ldr r0, _080DDB08 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bgt _080DDAFE + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 4 + adds r0, r6 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1F + bl pal_fade_1 + adds r0, r5, 0 + bl remove_task +_080DDAFE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DDB04: .4byte 0x00007fff +_080DDB08: .4byte 0x02039f34 + thumb_func_end c3_08130B10 + + thumb_func_start sub_80DDB0C +sub_80DDB0C: @ 80DDB0C + push {r4,lr} + ldr r0, _080DDB5C + movs r1, 0xA + bl AddTask + ldr r3, _080DDB60 + ldr r4, _080DDB64 + ldr r2, [r4] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, _080DDB68 + strh r1, [r0, 0x24] + ldr r0, [r2] + adds r0, 0x58 + 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 r0, [r4] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DDB5C: .4byte sub_80DDB6C + 1 +_080DDB60: .4byte 0x02020630 +_080DDB64: .4byte 0x02039f34 +_080DDB68: .4byte 0x0000ffba + thumb_func_end sub_80DDB0C + + thumb_func_start sub_80DDB6C +sub_80DDB6C: @ 80DDB6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldr r4, _080DDBDC + ldr r0, [r4] + ldr r0, [r0] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080DDBE0 + adds r2, r0, r1 + ldr r0, _080DDBE4 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r5, 0xD0 + lsls r5, 3 + adds r0, r5, 0 + ldrh r5, [r1, 0x1C] + adds r0, r5 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 24 + ldrh r5, [r2, 0x24] + adds r0, r5 + strh r0, [r2, 0x24] + ldrb r0, [r1, 0x1C] + strh r0, [r1, 0x1C] + movs r1, 0x24 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _080DDBB8 + movs r0, 0 + strh r0, [r2, 0x24] +_080DDBB8: + movs r5, 0x24 + ldrsh r0, [r2, r5] + cmp r0, 0 + bne _080DDBD4 + ldr r0, [r4] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r3, 0 + bl remove_task +_080DDBD4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DDBDC: .4byte 0x02039f34 +_080DDBE0: .4byte 0x02020630 +_080DDBE4: .4byte 0x03005e00 + thumb_func_end sub_80DDB6C + + thumb_func_start sub_80DDBE8 +sub_80DDBE8: @ 80DDBE8 + push {r4,r5,lr} + ldr r5, _080DDC14 + ldr r4, _080DDC18 + ldr r0, [r4] + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080DDC1C + ldrb r1, [r2, 0x6] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + b _080DDC40 + .align 2, 0 +_080DDC14: .4byte 0x02020630 +_080DDC18: .4byte 0x02039f34 +_080DDC1C: + ldr r0, _080DDC48 + movs r1, 0xA + bl AddTask + ldr r2, [r4] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + strh r1, [r0, 0x24] + ldr r2, [r2] + ldrb r0, [r2, 0x6] + movs r1, 0x40 + orrs r0, r1 +_080DDC40: + strb r0, [r2, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DDC48: .4byte task08_080CD1CC + 1 + thumb_func_end sub_80DDBE8 + + thumb_func_start task08_080CD1CC +task08_080CD1CC: @ 80DDC4C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r5, _080DDCCC + ldr r0, [r5] + ldr r0, [r0] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080DDCD0 + adds r3, r0, r1 + ldr r0, _080DDCD4 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + adds r2, r0 + movs r1, 0xD0 + lsls r1, 3 + adds r0, r1, 0 + ldrh r1, [r2, 0x1C] + adds r0, r1 + strh r0, [r2, 0x1C] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r3, 0x24] + subs r1, r0 + strh r1, [r3, 0x24] + ldrb r0, [r2, 0x1C] + strh r0, [r2, 0x1C] + movs r2, 0x24 + ldrsh r0, [r3, r2] + movs r1, 0x46 + negs r1, r1 + cmp r0, r1 + bge _080DDC9C + ldr r0, _080DDCD8 + strh r0, [r3, 0x24] +_080DDC9C: + movs r2, 0x24 + ldrsh r0, [r3, r2] + cmp r0, r1 + bne _080DDCC4 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r4, 0 + bl remove_task +_080DDCC4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DDCCC: .4byte 0x02039f34 +_080DDCD0: .4byte 0x02020630 +_080DDCD4: .4byte 0x03005e00 +_080DDCD8: .4byte 0x0000ffba + thumb_func_end task08_080CD1CC + + thumb_func_start sub_80DDCDC +sub_80DDCDC: @ 80DDCDC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080DDD14 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DDD18 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0x8] + ldr r0, _080DDD1C + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DDD14: .4byte sub_80DDD20 + 1 +_080DDD18: .4byte 0x03005e00 +_080DDD1C: .4byte 0x02039f34 + thumb_func_end sub_80DDCDC + + thumb_func_start sub_80DDD20 +sub_80DDD20: @ 80DDD20 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080DDD44 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080DDD54 + cmp r0, 0x1 + bgt _080DDD48 + cmp r0, 0 + beq _080DDD4E + b _080DDD9C + .align 2, 0 +_080DDD44: .4byte 0x03005e00 +_080DDD48: + cmp r0, 0x2 + beq _080DDD70 + b _080DDD9C +_080DDD4E: + bl sub_80DDB0C + b _080DDD64 +_080DDD54: + ldr r0, _080DDD6C + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080DDD9C +_080DDD64: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080DDD9C + .align 2, 0 +_080DDD6C: .4byte 0x02039f34 +_080DDD70: + ldrh r0, [r4, 0x1E] + adds r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080DDD9C + movs r0, 0 + strh r0, [r4, 0x1E] + bl sub_80DD940 + ldr r0, _080DDDA4 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r5, 0 + bl remove_task +_080DDD9C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DDDA4: .4byte 0x02039f34 + thumb_func_end sub_80DDD20 + + thumb_func_start sub_80DDDA8 +sub_80DDDA8: @ 80DDDA8 + ldr r3, _080DDDDC + ldr r0, _080DDDE0 + ldr r2, [r0] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x24] + ldr r0, [r2] + adds r0, 0x58 + 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] + bx lr + .align 2, 0 +_080DDDDC: .4byte 0x02020630 +_080DDDE0: .4byte 0x02039f34 + thumb_func_end sub_80DDDA8 + + thumb_func_start sub_80DDDE4 +sub_80DDDE4: @ 80DDDE4 + ldr r2, _080DDE04 + ldr r0, _080DDE08 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x58 + 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] + bx lr + .align 2, 0 +_080DDE04: .4byte 0x02020630 +_080DDE08: .4byte 0x02039f34 + thumb_func_end sub_80DDDE4 + + thumb_func_start sub_80DDE0C +sub_80DDE0C: @ 80DDE0C + push {lr} + ldr r0, _080DDE28 + movs r1, 0xF + bl AddTask + ldr r0, _080DDE2C + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r0} + bx r0 + .align 2, 0 +_080DDE28: .4byte sub_80DDE30 + 1 +_080DDE2C: .4byte 0x02039f34 + thumb_func_end sub_80DDE0C + + thumb_func_start sub_80DDE30 +sub_80DDE30: @ 80DDE30 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080DDE6C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _080DDEBA + movs r0, 0 + strh r0, [r4, 0x1C] + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080DDE78 + ldr r0, _080DDE70 + ldr r1, _080DDE74 + movs r2, 0x80 + lsls r2, 5 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + b _080DDE8C + .align 2, 0 +_080DDE6C: .4byte 0x03005e00 +_080DDE70: .4byte 0x02019000 +_080DDE74: .4byte 0x06002000 +_080DDE78: + ldr r0, _080DDEC0 + ldr r1, _080DDEC4 + movs r2, 0x80 + lsls r2, 5 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] +_080DDE8C: + ldr r1, _080DDEC8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x1E] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x1E] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0x9 + bne _080DDEBA + ldr r0, _080DDECC + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r5, 0 + bl remove_task +_080DDEBA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DDEC0: .4byte 0x02018000 +_080DDEC4: .4byte 0x06002000 +_080DDEC8: .4byte 0x03005e00 +_080DDECC: .4byte 0x02039f34 + thumb_func_end sub_80DDE30 + + thumb_func_start sub_80DDED0 +sub_80DDED0: @ 80DDED0 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _080DDF10 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + cmp r4, 0 + ble _080DDF38 + ldr r7, _080DDF14 + lsls r0, r5, 24 + adds r4, r0, 0 + cmp r4, 0 + ble _080DDF1C + movs r5, 0 + ldr r2, _080DDF18 + ldr r0, [r2] + ldr r0, [r0] + movs r1, 0x13 + ldrsb r1, [r0, r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080DDF4E + .align 2, 0 +_080DDF10: .4byte sub_80DDF80 + 1 +_080DDF14: .4byte 0x0000237e +_080DDF18: .4byte 0x02039f34 +_080DDF1C: + ldr r2, _080DDF34 + ldr r0, [r2] + ldr r0, [r0] + movs r1, 0x13 + ldrsb r1, [r0, r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + b _080DDF4E + .align 2, 0 +_080DDF34: .4byte 0x02039f34 +_080DDF38: + movs r7, 0 + lsls r0, r5, 24 + adds r4, r0, 0 + cmp r4, 0 + ble _080DDF48 + movs r5, 0 + movs r3, 0xC + b _080DDF4C +_080DDF48: + movs r5, 0xC + movs r3, 0 +_080DDF4C: + ldr r2, _080DDF78 +_080DDF4E: + ldr r1, _080DDF7C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x8] + strh r5, [r0, 0xA] + asrs r1, r4, 24 + strh r1, [r0, 0xC] + strh r3, [r0, 0xE] + ldr r0, [r2] + ldr r2, [r0] + ldrb r1, [r2, 0x7] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x7] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DDF78: .4byte 0x02039f34 +_080DDF7C: .4byte 0x03005e00 + thumb_func_end sub_80DDED0 + + thumb_func_start sub_80DDF80 +sub_80DDF80: @ 80DDF80 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _080DDFB0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x1C] + adds r1, r0, 0x1 + strh r1, [r3, 0x1C] + lsls r0, 16 + cmp r0, 0 + blt _080DDFFC + movs r0, 0 + strh r0, [r3, 0x1C] + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0 + ble _080DDFB4 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + b _080DDFB8 + .align 2, 0 +_080DDFB0: .4byte 0x03005e00 +_080DDFB4: + ldrh r0, [r3, 0xA] + subs r0, 0x1 +_080DDFB8: + strh r0, [r3, 0xA] + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r2 + ldrb r2, [r4, 0xA] + ldrh r3, [r4, 0x8] + movs r0, 0x11 + movs r1, 0x1 + bl pal_fade_1 + ldrb r2, [r4, 0xA] + ldrh r3, [r4, 0x8] + movs r0, 0x1A + movs r1, 0x1 + bl pal_fade_1 + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080DDFFC + adds r0, r5, 0 + bl remove_task + ldr r0, _080DE004 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x7] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x7] +_080DDFFC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DE004: .4byte 0x02039f34 + thumb_func_end sub_80DDF80 + + thumb_func_start sub_80DE008 +sub_80DE008: @ 80DE008 + 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 + movs r5, 0 + ldr r0, _080DE0A4 + mov r9, r0 + mov r8, r9 + ldr r6, _080DE0A8 + movs r4, 0 + movs r7, 0 +_080DE026: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r7, r0 + ldrb r1, [r0, 0x10] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080DE0BC + mov r2, r10 + cmp r2, 0 + beq _080DE0BC + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80DE0F0 + mov r3, r8 + ldr r1, [r3] + ldr r1, [r1, 0x14] + adds r1, r4, r1 + ldrb r2, [r1, 0x1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, _080DE0AC + adds r1, r2 + ldr r2, _080DE0B0 + bl CpuSet + mov r0, r8 + ldr r3, [r0] + ldr r0, [r3, 0x14] + adds r0, r4, r0 + ldrb r0, [r0, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldr r2, _080DE0B4 + ldr r0, _080DE0B8 + adds r0, r5, r0 + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x22] + ldr r0, [r3, 0x14] + adds r0, r4, r0 + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + b _080DE0D6 + .align 2, 0 +_080DE0A4: .4byte 0x02039f34 +_080DE0A8: .4byte 0x02020630 +_080DE0AC: .4byte 0x060100c0 +_080DE0B0: .4byte 0x04000008 +_080DE0B4: .4byte 0x08587a70 +_080DE0B8: .4byte 0x02039f26 +_080DE0BC: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0, 0x1] + 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 +_080DE0D6: + strb r1, [r0] + adds r4, 0x4 + adds r7, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080DE026 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DE008 + + thumb_func_start sub_80DE0F0 +sub_80DE0F0: @ 80DE0F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DE118 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0x10] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + bne _080DE120 + ldrb r0, [r2, 0x19] + lsls r0, 5 + ldr r1, _080DE11C + adds r0, r1 + b _080DE122 + .align 2, 0 +_080DE118: .4byte 0x02039f34 +_080DE11C: .4byte 0x08d8e9b4 +_080DE120: + ldr r0, _080DE128 +_080DE122: + pop {r1} + bx r1 + .align 2, 0 +_080DE128: .4byte 0x08d8ea34 + thumb_func_end sub_80DE0F0 + + thumb_func_start sub_80DE12C +sub_80DE12C: @ 80DE12C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r7, 0 + movs r0, 0x2 + mov r10, r0 + movs r0, 0x1 + mov r8, r0 + movs r0, 0x11 + mov r9, r0 +_080DE146: + ldr r0, _080DE1E0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0xD + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _080DE1CA + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080DE1CA + ldr r0, _080DE1E4 + adds r0, r7, r0 + ldrb r0, [r0] + lsls r5, r0, 2 + adds r5, r0 + adds r6, r5, 0x2 + movs r0, 0x3 + bl sub_80DB748 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 24 + lsrs r6, 24 + mov r0, r10 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + adds r3, r6, 0 + bl sub_80DECB8 + adds r4, 0x10 + lsls r4, 16 + lsrs r4, 16 + adds r5, 0x3 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + adds r3, r5, 0 + bl sub_80DECB8 + movs r0, 0x63 + bl audio_play +_080DE1CA: + adds r7, 0x1 + cmp r7, 0x3 + ble _080DE146 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DE1E0: .4byte 0x02039f34 +_080DE1E4: .4byte 0x02039f26 + thumb_func_end sub_80DE12C + + thumb_func_start sub_80DE1E8 +sub_80DE1E8: @ 80DE1E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080DE218 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0x15] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080DE212 + ldrb r1, [r2, 0xC] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080DE21C +_080DE212: + movs r0, 0 + b _080DE21E + .align 2, 0 +_080DE218: .4byte 0x02039f34 +_080DE21C: + movs r0, 0x1 +_080DE21E: + pop {r1} + bx r1 + thumb_func_end sub_80DE1E8 + + thumb_func_start sub_80DE224 +sub_80DE224: @ 80DE224 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + movs r0, 0xA + bl lcd_io_get + mov r1, sp + strh r0, [r1] + mov r2, sp + ldrb r1, [r2] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2] + ldrb r1, [r2, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2] + movs r0, 0xD + negs r0, r0 + mov r8, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + ldrh r1, [r0] + movs r0, 0xA + bl lcd_io_set + movs r0, 0x8 + bl lcd_io_get + mov r6, sp + adds r6, 0x2 + strh r0, [r6] + movs r0, 0xC + bl lcd_io_get + add r5, sp, 0x4 + strh r0, [r5] + ldrb r1, [r6] + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r6] + ldrb r0, [r5] + ands r4, r0 + orrs r4, r1 + strb r4, [r5] + ldrh r1, [r6] + movs r0, 0x8 + bl lcd_io_set + ldrh r1, [r5] + movs r0, 0xC + bl lcd_io_set + ldr r1, _080DE338 + movs r0, 0xF0 + strh r0, [r1] + ldr r4, _080DE33C + movs r0, 0xA0 + strh r0, [r4] + movs r0, 0x14 + movs r1, 0xF0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x16 + bl lcd_io_set + movs r0, 0 + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r4, _080DE340 + ldr r1, [r4] + ldr r1, [r1, 0x28] + ldr r2, _080DE344 + bl CpuSet + ldr r1, _080DE348 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl sub_80DED60 + movs r5, 0 + ldr r7, _080DE34C + movs r6, 0x4 +_080DE2F0: + ldr r0, [r4] + ldr r0, [r0, 0x14] + lsls r3, r5, 2 + adds r0, r3, r0 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r8 + ands r0, r2 + orrs r0, r6 + strb r0, [r1, 0x5] + ldr r0, [r4] + ldr r0, [r0, 0x14] + adds r3, r0 + ldrb r0, [r3, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r8 + ands r0, r2 + orrs r0, r6 + strb r0, [r1, 0x5] + adds r5, 0x1 + cmp r5, 0x3 + ble _080DE2F0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DE338: .4byte 0x02022e18 +_080DE33C: .4byte 0x02022e1a +_080DE340: .4byte 0x02039f34 +_080DE344: .4byte 0x05000400 +_080DE348: .4byte 0x08c17980 +_080DE34C: .4byte 0x02020630 + thumb_func_end sub_80DE224 + + thumb_func_start sub_80DE350 +sub_80DE350: @ 80DE350 + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, _080DE40C + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + movs r5, 0 + str r5, [sp] + ldr r6, _080DE410 + ldr r0, [r6] + ldr r1, [r0, 0x28] + ldr r2, _080DE414 + mov r0, sp + bl CpuSet + movs r0, 0x1 + bl sub_80DED60 + movs r0, 0xA + bl lcd_io_get + add r3, sp, 0x4 + strh r0, [r3] + ldrb r1, [r3] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r3] + mov r1, sp + adds r1, 0x5 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r3] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r3] + ldrh r1, [r3] + movs r0, 0xA + bl lcd_io_set + ldr r0, _080DE418 + strh r5, [r0] + ldr r0, _080DE41C + strh r5, [r0] + ldr r7, _080DE420 +_080DE3CA: + ldr r0, [r6] + ldr r0, [r0, 0x14] + lsls r3, r5, 2 + adds r0, r3, r0 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + ldr r0, [r0, 0x14] + adds r3, r0 + ldrb r0, [r3, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x5] + adds r5, 0x1 + cmp r5, 0x3 + ble _080DE3CA + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DE40C: .4byte 0x06008000 +_080DE410: .4byte 0x02039f34 +_080DE414: .4byte 0x05000400 +_080DE418: .4byte 0x02022e18 +_080DE41C: .4byte 0x02022e1a +_080DE420: .4byte 0x02020630 + thumb_func_end sub_80DE350 + + thumb_func_start sub_80DE424 +sub_80DE424: @ 80DE424 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _080DE454 + movs r0, 0 + strh r0, [r1] + ldr r1, _080DE458 + movs r0, 0xA0 + strh r0, [r1] + movs r0, 0x62 + movs r1, 0 + bl audio_play_and_stuff + ldr r1, _080DE45C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080DE460 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DE454: .4byte 0x02022e18 +_080DE458: .4byte 0x02022e1a +_080DE45C: .4byte 0x03005e00 +_080DE460: .4byte sub_80DE464 + 1 + thumb_func_end sub_80DE424 + + thumb_func_start sub_80DE464 +sub_80DE464: @ 80DE464 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _080DE49C + ldrh r0, [r1] + subs r0, 0x7 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bge _080DE47C + movs r0, 0 + strh r0, [r1] +_080DE47C: + ldrh r2, [r1] + cmp r2, 0 + bne _080DE496 + ldr r0, _080DE4A0 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + strh r2, [r1, 0xC] + ldr r0, _080DE4A4 + str r0, [r1] +_080DE496: + pop {r0} + bx r0 + .align 2, 0 +_080DE49C: .4byte 0x02022e1a +_080DE4A0: .4byte 0x03005e00 +_080DE4A4: .4byte sub_80DE4A8 + 1 + thumb_func_end sub_80DE464 + + thumb_func_start sub_80DE4A8 +sub_80DE4A8: @ 80DE4A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080DE4CC + lsls r3, r4, 2 + adds r0, r3, r4 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0x1 + beq _080DE52C + cmp r1, 0x1 + bgt _080DE4D0 + cmp r1, 0 + beq _080DE4DA + b _080DE5B4 + .align 2, 0 +_080DE4CC: .4byte 0x03005e00 +_080DE4D0: + cmp r1, 0x2 + beq _080DE58A + cmp r1, 0x3 + beq _080DE5A4 + b _080DE5B4 +_080DE4DA: + movs r2, 0 + adds r6, r3, 0 + ldr r5, _080DE520 + ldr r3, _080DE524 +_080DE4E2: + ldr r0, [r5] + ldr r1, [r0] + adds r1, 0x14 + adds r1, r2 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x3 + ble _080DE4E2 + bl sub_80DBF90 + bl sub_80DC864 + bl sub_80DB69C + bl sub_80DD04C + movs r0, 0x1 + bl sub_80DE008 + bl sub_80DC44C + ldr r0, _080DE528 + adds r1, r6, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x8] + b _080DE5B4 + .align 2, 0 +_080DE520: .4byte 0x02039f34 +_080DE524: .4byte 0x02039f26 +_080DE528: .4byte 0x03005e00 +_080DE52C: + ldr r0, _080DE574 + ldrb r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080DE584 + ldr r0, _080DE578 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x7] + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080DE552 + bl sub_80DBAA0 +_080DE552: + ldr r4, _080DE57C + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DE580 + adds r1, r4, 0 + bl set_task_function_and_args_14_15 + bl sub_80DBF68 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080DE5B4 + .align 2, 0 +_080DE574: .4byte 0x02039f2a +_080DE578: .4byte 0x02039f34 +_080DE57C: .4byte sub_80FCC88 + 1 +_080DE580: .4byte sub_80DA110 + 1 +_080DE584: + bl sub_80DBAA0 + b _080DE59A +_080DE58A: + ldr r0, _080DE5A0 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080DE5B4 +_080DE59A: + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080DE5B4 + .align 2, 0 +_080DE5A0: .4byte 0x02039f34 +_080DE5A4: + bl sub_80DB884 + bl sub_80DB2BC + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, _080DE5BC + str r0, [r5] +_080DE5B4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DE5BC: .4byte sub_80DE5F4 + 1 + thumb_func_end sub_80DE4A8 + + thumb_func_start sub_80DE5C0 +sub_80DE5C0: @ 80DE5C0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080DE5E8 + ldrh r0, [r1] + adds r0, 0x7 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA0 + ble _080DE5E4 + ldr r0, _080DE5EC + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080DE5F0 + str r0, [r1] +_080DE5E4: + pop {r0} + bx r0 + .align 2, 0 +_080DE5E8: .4byte 0x02022e1a +_080DE5EC: .4byte 0x03005e00 +_080DE5F0: .4byte sub_80DA4F4 + 1 + thumb_func_end sub_80DE5C0 + + thumb_func_start sub_80DE5F4 +sub_80DE5F4: @ 80DE5F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DE614 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x9 + bgt _080DE618 + adds r0, r2, 0x1 + strh r0, [r1, 0xC] + b _080DE654 + .align 2, 0 +_080DE614: .4byte 0x03005e00 +_080DE618: + ldrh r3, [r1, 0xA] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _080DE636 + ldrh r2, [r1, 0x8] + movs r4, 0x8 + ldrsh r0, [r1, r4] + cmp r0, 0x10 + bne _080DE632 + adds r0, r3, 0x1 + strh r0, [r1, 0xA] + b _080DE654 +_080DE632: + adds r0, r2, 0x1 + b _080DE652 +_080DE636: + ldrh r0, [r1, 0x8] + movs r3, 0x8 + ldrsh r2, [r1, r3] + cmp r2, 0 + bne _080DE650 + strh r2, [r1, 0xA] + strh r2, [r1, 0xC] + ldr r0, _080DE64C + str r0, [r1] + b _080DE654 + .align 2, 0 +_080DE64C: .4byte sub_80DE65C + 1 +_080DE650: + subs r0, 0x1 +_080DE652: + strh r0, [r1, 0x8] +_080DE654: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DE5F4 + + thumb_func_start sub_80DE65C +sub_80DE65C: @ 80DE65C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DE67C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x9 + bgt _080DE680 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + b _080DE690 + .align 2, 0 +_080DE67C: .4byte 0x03005e00 +_080DE680: + movs r0, 0 + strh r0, [r4, 0xC] + movs r0, 0x61 + movs r1, 0 + bl audio_play_and_stuff + ldr r0, _080DE698 + str r0, [r4] +_080DE690: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DE698: .4byte sub_80DE5C0 + 1 + thumb_func_end sub_80DE65C + + thumb_func_start sub_80DE69C +sub_80DE69C: @ 80DE69C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + ldr r6, _080DE784 + ldr r5, _080DE788 +_080DE6AE: + bl rotscale_alloc_entry + ldr r1, [r5] + ldr r1, [r1, 0x14] + lsls r4, r7, 2 + adds r1, r4, r1 + ldrb r1, [r1] + lsls r3, r1, 4 + adds r3, r1 + lsls r3, 2 + adds r3, r6 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1F + ands r0, r1 + lsls r0, 1 + ldrb r1, [r3, 0x3] + movs r2, 0x3F + negs r2, r2 + mov r12, r2 + mov r2, r12 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x3] + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r2, [r0, 0x1] + movs r3, 0x4 + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strb r2, [r0, 0x1] + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + bl sub_8008258 + mov r0, r8 + cmp r0, 0x2 + bne _080DE74C + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_anim_step + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] +_080DE74C: + adds r7, 0x1 + cmp r7, 0x3 + ble _080DE6AE + ldr r0, _080DE78C + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080DE790 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0x8] + ldr r0, _080DE788 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x7] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x7] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DE784: .4byte 0x02020630 +_080DE788: .4byte 0x02039f34 +_080DE78C: .4byte sub_80DE794 + 1 +_080DE790: .4byte 0x03005e00 + thumb_func_end sub_80DE69C + + thumb_func_start sub_80DE794 +sub_80DE794: @ 80DE794 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _080DE828 + ldr r3, _080DE82C + ldr r0, [r3] + ldr r0, [r0, 0x14] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080DE822 + ldr r0, _080DE830 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + bne _080DE7EC + movs r4, 0 + adds r5, r2, 0 + movs r2, 0x4 +_080DE7CC: + ldr r0, [r3] + ldr r1, [r0, 0x14] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x3 + ble _080DE7CC +_080DE7EC: + movs r4, 0 +_080DE7EE: + ldr r5, _080DE82C + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080DE828 + adds r0, r1 + bl obj_free_rotscale_entry + adds r4, 0x1 + cmp r4, 0x3 + ble _080DE7EE + ldr r0, [r5] + ldr r2, [r0] + ldrb r1, [r2, 0x7] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x7] + adds r0, r6, 0 + bl remove_task +_080DE822: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DE828: .4byte 0x02020630 +_080DE82C: .4byte 0x02039f34 +_080DE830: .4byte 0x03005e00 + thumb_func_end sub_80DE794 + + thumb_func_start sub_80DE834 +sub_80DE834: @ 80DE834 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bls _080DE844 + movs r1, 0x1 +_080DE844: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80DE834 + + thumb_func_start sub_80DE84C +sub_80DE84C: @ 80DE84C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _080DE860 + cmp r1, r0 + bls _080DE85A + movs r1, 0 +_080DE85A: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080DE860: .4byte 0x0000019b + thumb_func_end sub_80DE84C + + thumb_func_start sub_80DE864 +sub_80DE864: @ 80DE864 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _080DE8C8 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl sub_80DE834 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _080DE8CC + lsls r0, r7, 6 + adds r0, r1 + ldrh r0, [r0] + bl sub_80DE84C + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r4] + ldr r0, [r0, 0x18] + movs r1, 0 + movs r2, 0x14 + bl memset + bl sub_80A3934 + ldr r1, _080DE8D0 + movs r2, 0 + adds r0, r1, 0x3 +_080DE8A8: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080DE8A8 + cmp r5, 0x90 + beq _080DE920 + cmp r5, 0x90 + bgt _080DE8DE + cmp r5, 0x4C + beq _080DE978 + cmp r5, 0x4C + bgt _080DE8D4 + cmp r5, 0xD + beq _080DE978 + b _080DE9A2 + .align 2, 0 +_080DE8C8: .4byte 0x02039f34 +_080DE8CC: .4byte 0x02039e00 +_080DE8D0: .4byte 0x020244e4 +_080DE8D4: + cmp r5, 0x82 + beq _080DE978 + cmp r5, 0x8F + beq _080DE978 + b _080DE9A2 +_080DE8DE: + cmp r5, 0xD8 + beq _080DE960 + cmp r5, 0xD8 + bgt _080DE8EC + cmp r5, 0xAE + beq _080DE8FA + b _080DE9A2 +_080DE8EC: + cmp r5, 0xDA + beq _080DE96C + movs r0, 0x88 + lsls r0, 1 + cmp r5, r0 + beq _080DE920 + b _080DE9A2 +_080DE8FA: + ldr r0, _080DE918 + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0x7 + beq _080DE910 + ldrb r0, [r1, 0x7] + cmp r0, 0x7 + bne _080DE99C +_080DE910: + ldr r1, _080DE91C + movs r0, 0 + b _080DE9A0 + .align 2, 0 +_080DE918: .4byte 0x083203cc +_080DE91C: .4byte 0x02038432 +_080DE920: + ldr r6, _080DE958 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x1B] + ldr r5, _080DE95C + lsls r4, 6 + adds r0, r4, r5 + ldrh r0, [r0] + bl sub_80DE84C + ldr r2, [r6] + ldr r1, [r2, 0x18] + strh r0, [r1, 0x2] + ldr r2, [r2, 0x18] + adds r5, 0x38 + adds r4, r5 + ldr r0, [r4] + str r0, [r2, 0x10] + ldrb r0, [r2, 0x4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x4] + b _080DE9A2 + .align 2, 0 +_080DE958: .4byte 0x02039f34 +_080DE95C: .4byte 0x02039e00 +_080DE960: + ldr r1, _080DE968 + movs r0, 0xFF + b _080DE9A0 + .align 2, 0 +_080DE968: .4byte 0x0203841a +_080DE96C: + ldr r1, _080DE974 + movs r0, 0 + b _080DE9A0 + .align 2, 0 +_080DE974: .4byte 0x0203841a +_080DE978: + ldr r0, _080DE994 + ldr r0, [r0] + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x5A + ldrb r1, [r2] + cmp r1, 0 + bne _080DE99C + movs r0, 0x2 + strb r0, [r2] + ldr r0, _080DE998 + strb r1, [r0] + b _080DE9A2 + .align 2, 0 +_080DE994: .4byte 0x02039f34 +_080DE998: .4byte 0x02038432 +_080DE99C: + ldr r1, _080DE9AC + movs r0, 0x1 +_080DE9A0: + strb r0, [r1] +_080DE9A2: + bl sub_80DEA5C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DE9AC: .4byte 0x02038432 + thumb_func_end sub_80DE864 + + thumb_func_start sub_80DE9B0 +sub_80DE9B0: @ 80DE9B0 + push {r4,lr} + ldr r4, _080DE9D8 + ldr r0, [r4] + ldr r0, [r0, 0x18] + movs r1, 0 + movs r2, 0x14 + bl memset + ldr r0, [r4] + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x5A + ldrb r0, [r1] + cmp r0, 0 + beq _080DE9D2 + subs r0, 0x1 + strb r0, [r1] +_080DE9D2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DE9D8: .4byte 0x02039f34 + thumb_func_end sub_80DE9B0 + + thumb_func_start sub_80DE9DC +sub_80DE9DC: @ 80DE9DC + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _080DEA18 + ldr r0, [r6] + ldr r0, [r0, 0x18] + strb r4, [r0, 0x5] + ldr r5, _080DEA1C + lsls r4, 6 + adds r0, r4, r5 + ldrh r0, [r0] + bl sub_80DE84C + ldr r2, [r6] + ldr r1, [r2, 0x18] + strh r0, [r1] + ldr r1, [r2, 0x18] + adds r0, r5, 0 + adds r0, 0x38 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [r1, 0x8] + adds r5, 0x3C + adds r4, r5 + ldr r0, [r4] + str r0, [r1, 0xC] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DEA18: .4byte 0x02039f34 +_080DEA1C: .4byte 0x02039e00 + thumb_func_end sub_80DE9DC + + thumb_func_start sub_80DEA20 +sub_80DEA20: @ 80DEA20 + push {lr} + ldr r0, _080DEA4C + bl object_new_hidden_with_callback + ldr r1, _080DEA50 + strb r0, [r1, 0x3] + ldr r0, _080DEA54 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080DEA58 + adds r0, r1 + bl obj_alloc_rotscale_entry + bl sub_80DEA5C + pop {r0} + bx r0 + .align 2, 0 +_080DEA4C: .4byte nullsub_12 + 1 +_080DEA50: .4byte 0x020241e4 +_080DEA54: .4byte 0x0202420c +_080DEA58: .4byte 0x02020630 + thumb_func_end sub_80DEA20 + + thumb_func_start sub_80DEA5C +sub_80DEA5C: @ 80DEA5C + push {r4,lr} + ldr r0, _080DEAA0 + ldrb r0, [r0, 0x3] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080DEAA4 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0x3 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + movs r0, 0x3 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DEAA0: .4byte 0x020241e4 +_080DEAA4: .4byte 0x02020630 + thumb_func_end sub_80DEA5C + + thumb_func_start sub_80DEAA8 +sub_80DEAA8: @ 80DEAA8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _080DEAC8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x6] + cmp r0, 0x20 + bhi _080DEB60 + lsls r0, 2 + ldr r1, _080DEACC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DEAC8: .4byte 0x0831c898 +_080DEACC: .4byte _080DEAD0 + .align 2, 0 +_080DEAD0: + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB54 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB54 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 +_080DEB54: + ldr r1, _080DEB5C + movs r0, 0x2 + b _080DEB64 + .align 2, 0 +_080DEB5C: .4byte 0x0202420c +_080DEB60: + ldr r1, _080DEB6C + movs r0, 0x3 +_080DEB64: + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080DEB6C: .4byte 0x0202420c + thumb_func_end sub_80DEAA8 + + thumb_func_start sub_80DEB70 +sub_80DEB70: @ 80DEB70 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + str r1, [sp] + mov r0, sp + movs r2, 0 + strb r4, [r0, 0x4] + movs r1, 0x1 + strb r1, [r0, 0x5] + strb r2, [r0, 0x6] + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r2, [r0, 0xA] + strb r2, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r0, 0xF0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r1, sp + movs r0, 0x80 + strb r0, [r1, 0xD] + mov r0, sp + movs r1, 0 + movs r2, 0 + bl remo_copy + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + bl sub_80DED60 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DEB70 + + thumb_func_start sub_80DEBD0 +sub_80DEBD0: @ 80DEBD0 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r4, [sp, 0x1C] + str r1, [sp] + mov r0, sp + movs r1, 0 + strb r5, [r0, 0x4] + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + strb r2, [r0, 0x8] + strb r3, [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, 0xF0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r1, sp + movs r0, 0x80 + strb r0, [r1, 0xD] + mov r0, sp + movs r1, 0 + movs r2, 0 + bl remo_copy + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + bl sub_80DED60 + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DEBD0 + + thumb_func_start sub_80DEC30 +sub_80DEC30: @ 80DEC30 + push {r4,r5,lr} + sub sp, 0x10 + str r0, [sp] + mov r2, sp + movs r3, 0 + movs r0, 0x4 + strb r0, [r2, 0x4] + mov r0, sp + movs r5, 0x1 + strb r5, [r0, 0x5] + strb r3, [r0, 0x6] + strb r5, [r0, 0x7] + strb r3, [r0, 0x8] + strb r5, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r4, sp + ldrb r3, [r4, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r4, 0xC] + mov r3, sp + movs r0, 0x10 + strb r0, [r3, 0xC] + ldrb r0, [r3, 0xD] + ands r2, r0 + strb r2, [r3, 0xD] + mov r2, sp + movs r0, 0x80 + strb r0, [r2, 0xD] + cmp r1, 0 + bne _080DEC80 + mov r0, sp + movs r1, 0 + movs r2, 0 + bl remo_copy + b _080DECA4 +_080DEC80: + ldr r0, _080DEC90 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080DEC94 + movs r1, 0x4 + b _080DEC9C + .align 2, 0 +_080DEC90: .4byte 0x02039f2a +_080DEC94: + bl sav2_get_text_speed + lsls r0, 24 + lsrs r1, r0, 24 +_080DEC9C: + mov r0, sp + movs r2, 0 + bl remo_copy +_080DECA4: + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0 + bl sub_80DED60 + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DEC30 + + thumb_func_start sub_80DECB8 +sub_80DECB8: @ 80DECB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + ldr r0, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + mov r7, r8 + lsls r7, 24 + lsrs r7, 24 + mov r8, r7 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + lsls r6, 16 + asrs r6, 16 + str r6, [sp, 0xC] + mov r0, r8 + bl bg_write_sequence_to_wram_tile_map_rect + mov r0, r8 + bl sub_80DED60 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DECB8 + + thumb_func_start sub_80DED10 +sub_80DED10: @ 80DED10 + push {r4-r6,lr} + sub sp, 0x10 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + 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 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r4, 0 + str r4, [sp, 0xC] + bl sub_80DECB8 + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80DED10 + + thumb_func_start sub_80DED4C +sub_80DED4C: @ 80DED4C + push {lr} + bl run_remoboxes + movs r0, 0x4 + bl a_pressed_maybe + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80DED4C + + thumb_func_start sub_80DED60 +sub_80DED60: @ 80DED60 + ldr r2, _080DED70 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + orrs r1, r0 + strb r1, [r2] + bx lr + .align 2, 0 +_080DED70: .4byte 0x02039f38 + thumb_func_end sub_80DED60 + + thumb_func_start sub_80DED74 +sub_80DED74: @ 80DED74 + push {r4-r6,lr} + movs r0, 0 + ldr r6, _080DEDA0 + ldr r5, _080DEDA4 + movs r4, 0 +_080DED7E: + adds r3, r0, 0x1 + lsls r1, r0, 3 + movs r2, 0x3 +_080DED84: + ldr r0, [r6] + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080DED84 + adds r0, r3, 0 + cmp r0, 0x4 + ble _080DED7E + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080DEDA0: .4byte 0x03005d90 +_080DEDA4: .4byte 0x00000624 + thumb_func_end sub_80DED74 + + thumb_func_start sub_80DEDA8 +sub_80DEDA8: @ 80DEDA8 + 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] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r1, _080DEDF8 + ldrb r0, [r1] + cmp r0, 0 + beq _080DEDE6 +_080DEDD8: + adds r5, 0x1 + cmp r5, 0x2 + bgt _080DEDE6 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DEDD8 +_080DEDE6: + ldr r0, [sp] + cmp r0, 0xFF + bne _080DEE00 + ldr r0, _080DEDFC + ldrb r0, [r0] + cmp r5, r0 + beq _080DEE00 + movs r0, 0 + b _080DEF90 + .align 2, 0 +_080DEDF8: .4byte 0x02039f20 +_080DEDFC: .4byte 0x02039f25 +_080DEE00: + ldr r0, _080DEE14 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080DEE4C + lsls r0, 2 + ldr r1, _080DEE18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DEE14: .4byte 0x02039f2c +_080DEE18: .4byte _080DEE1C + .align 2, 0 +_080DEE1C: + .4byte _080DEE4C + .4byte _080DEE30 + .4byte _080DEE36 + .4byte _080DEE3C + .4byte _080DEE42 +_080DEE30: + mov r0, r8 + adds r0, 0x3 + b _080DEE46 +_080DEE36: + mov r0, r8 + adds r0, 0x6 + b _080DEE46 +_080DEE3C: + mov r0, r8 + adds r0, 0x9 + b _080DEE46 +_080DEE42: + mov r0, r8 + adds r0, 0xC +_080DEE46: + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080DEE4C: + ldr r1, [sp] + cmp r1, 0xFE + bne _080DEE54 + b _080DEF50 +_080DEE54: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80DEFA8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r2, _080DEED8 + mov r10, r2 + ldr r0, [r2] + mov r3, r9 + lsls r7, r3, 5 + ldr r6, _080DEEDC + adds r2, r0, r6 + adds r2, r7 + ldr r4, _080DEEE0 + lsls r5, 6 + adds r1, r4, 0 + adds r1, 0x38 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r2] + adds r1, r0, r7 + adds r2, r5, r4 + ldrh r2, [r2] + ldr r3, _080DEEE4 + adds r1, r3 + strh r2, [r1] + ldr r1, _080DEEE8 + adds r2, r0, r1 + adds r2, r7 + adds r1, r4, 0 + adds r1, 0x3C + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r2] + adds r6, r7, r6 + adds r0, r6 + adds r0, 0xB + adds r1, r4, 0x2 + adds r1, r5, r1 + bl gf_strcpy + mov r2, r10 + ldr r0, [r2] + adds r0, r6 + adds r0, 0x16 + adds r4, 0xD + adds r5, r4 + adds r1, r5, 0 + bl gf_strcpy + ldr r0, _080DEEEC + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DEEF4 + mov r3, r10 + ldr r0, [r3] + adds r0, r7 + ldr r1, _080DEEF0 + adds r0, r1 + movs r1, 0x4 + b _080DEF02 + .align 2, 0 +_080DEED8: .4byte 0x03005d8c +_080DEEDC: .4byte 0x00002e90 +_080DEEE0: .4byte 0x02039e00 +_080DEEE4: .4byte 0x00002e98 +_080DEEE8: .4byte 0x00002e94 +_080DEEEC: .4byte 0x02039f2a +_080DEEF0: .4byte 0x00002eae +_080DEEF4: + mov r2, r10 + ldr r0, [r2] + adds r0, r7 + ldr r1, _080DEF20 + ldrh r1, [r1] + ldr r3, _080DEF24 + adds r0, r3 +_080DEF02: + strb r1, [r0] + ldr r0, [sp] + cmp r0, 0xFF + beq _080DEF34 + ldr r0, _080DEF28 + ldr r0, [r0] + mov r2, r9 + lsls r1, r2, 5 + adds r0, r1 + ldr r1, _080DEF2C + ldrh r1, [r1] + ldr r3, _080DEF30 + adds r0, r3 + strb r1, [r0] + b _080DEF8E + .align 2, 0 +_080DEF20: .4byte 0x02039f2e +_080DEF24: .4byte 0x00002eae +_080DEF28: .4byte 0x03005d8c +_080DEF2C: .4byte 0x02039f2c +_080DEF30: .4byte 0x00002e9a +_080DEF34: + ldr r0, _080DEF48 + ldr r0, [r0] + mov r2, r9 + lsls r1, r2, 5 + adds r0, r1 + ldr r3, _080DEF4C + adds r0, r3 + mov r1, r8 + strb r1, [r0] + b _080DEF8E + .align 2, 0 +_080DEF48: .4byte 0x03005d8c +_080DEF4C: .4byte 0x00002e9a +_080DEF50: + ldr r6, _080DEFA0 + ldr r4, _080DEFA4 + lsls r5, 6 + adds r0, r4, 0 + adds r0, 0x38 + adds r0, r5, r0 + ldr r0, [r0] + str r0, [r6] + adds r0, r4, 0 + adds r0, 0x3C + adds r0, r5, r0 + ldr r0, [r0] + str r0, [r6, 0x4] + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r6, 0x8] + adds r0, r6, 0 + adds r0, 0xB + adds r1, r4, 0x2 + adds r1, r5, r1 + bl gf_strcpy + adds r0, r6, 0 + adds r0, 0x16 + adds r4, 0xD + adds r5, r4 + adds r1, r5, 0 + bl gf_strcpy + mov r2, r8 + strb r2, [r6, 0xA] +_080DEF8E: + movs r0, 0x1 +_080DEF90: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080DEFA0: .4byte 0x02039f3c +_080DEFA4: .4byte 0x02039e00 + thumb_func_end sub_80DEDA8 + + thumb_func_start sub_80DEFA8 +sub_80DEFA8: @ 80DEFA8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x3 + bgt _080DEFF8 + cmp r0, 0 + blt _080DEFF8 + cmp r1, 0 + beq _080DEFE6 + movs r2, 0x5 + ldr r0, _080DEFEC + mov r12, r0 + ldr r4, _080DEFF0 + ldr r3, _080DEFF4 +_080DEFC8: + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 5 + adds r1, r0 + adds r0, r1, r4 + adds r1, r3 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5,r6} + stm r0!, {r5,r6} + subs r2, 0x1 + cmp r2, 0 + bgt _080DEFC8 +_080DEFE6: + movs r0, 0 + b _080DF03A + .align 2, 0 +_080DEFEC: .4byte 0x03005d8c +_080DEFF0: .4byte 0x00002e90 +_080DEFF4: .4byte 0x00002e70 +_080DEFF8: + ldr r0, _080DF00C + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080DF038 + lsls r0, 2 + ldr r1, _080DF010 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080DF00C: .4byte 0x02039f2c +_080DF010: .4byte _080DF014 + .align 2, 0 +_080DF014: + .4byte _080DF028 + .4byte _080DF02C + .4byte _080DF030 + .4byte _080DF034 + .4byte _080DF038 +_080DF028: + movs r0, 0x8 + b _080DF03A +_080DF02C: + movs r0, 0x9 + b _080DF03A +_080DF030: + movs r0, 0xA + b _080DF03A +_080DF034: + movs r0, 0xB + b _080DF03A +_080DF038: + movs r0, 0xC +_080DF03A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80DEFA8 + + thumb_func_start sub_80DF040 +sub_80DF040: @ 80DF040 + push {r4-r7,lr} + movs r2, 0 + ldr r0, _080DF074 + mov r12, r0 + ldr r4, _080DF078 + ldr r3, _080DF07C +_080DF04C: + 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 r3, 0x20 + adds r2, 0x1 + cmp r2, 0x7 + ble _080DF04C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DF074: .4byte 0x03005d8c +_080DF078: .4byte 0x00002e90 +_080DF07C: .4byte 0x08587fa4 + thumb_func_end sub_80DF040 + + thumb_func_start sub_80DF080 +sub_80DF080: @ 80DF080 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _080DF1B8 + ldr r3, [r2] + ldr r5, [r3, 0x10] + ldrb r1, [r5, 0x1] + movs r7, 0x1 + adds r0, r7, 0 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + bne _080DF0D2 + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + ble _080DF0D2 + ldr r1, [r3, 0x4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _080DF0D2 + ldr r1, [r3, 0x1C] + lsls r2, r4, 4 + adds r1, r2, r1 + ldrb r3, [r1, 0xC] + movs r0, 0x1 + orrs r0, r3 + strb r0, [r1, 0xC] + ldr r0, [r6] + ldr r0, [r0, 0x1C] + adds r2, r0 + ldrb r0, [r2, 0xE] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xE] +_080DF0D2: + ldr r3, [r6] + ldr r1, [r3, 0x4] + lsls r2, r4, 3 + subs r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + adds r7, r2, 0 + cmp r0, 0 + beq _080DF0FA + ldr r0, [r3, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x2 + orrs r0, r2 + strb r0, [r1, 0xC] +_080DF0FA: + ldr r3, [r6] + ldr r2, [r3, 0x10] + ldrb r1, [r2, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080DF126 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _080DF126 + movs r0, 0x2 + ldrsb r0, [r2, r0] + cmp r0, 0x3C + bne _080DF126 + ldr r0, [r3, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x4 + orrs r0, r2 + strb r0, [r1, 0xC] +_080DF126: + ldr r3, [r6] + ldr r1, [r3, 0x4] + subs r0, r7, r4 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080DF14E + ldrb r0, [r2, 0x16] + cmp r0, 0 + beq _080DF14E + ldr r0, [r3, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1, 0xC] +_080DF14E: + movs r3, 0 + movs r5, 0 +_080DF152: + cmp r3, r4 + beq _080DF180 + ldr r1, [r6] + ldr r0, [r1, 0x4] + adds r0, r5, r0 + ldrb r0, [r0, 0xE] + cmp r0, 0 + beq _080DF180 + ldr r0, [r1, 0x1C] + lsls r2, r4, 4 + adds r2, r0 + ldrb r0, [r2, 0xC] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0xC] + ldr r0, [r6] + ldr r0, [r0, 0x1C] + lsls r2, r3, 4 + adds r2, r0 + ldrb r0, [r2, 0xC] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0xC] +_080DF180: + adds r5, 0x1C + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF152 + ldr r2, [r6] + ldr r1, [r2, 0x4] + subs r0, r7, r4 + lsls r5, r0, 2 + adds r1, r5, r1 + ldrb r3, [r1, 0xC] + movs r0, 0x6 + ands r0, r3 + cmp r0, 0 + bne _080DF1A6 + ldrb r1, [r1, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DF1BC +_080DF1A6: + ldr r0, [r2, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x20 + orrs r0, r2 + strb r0, [r1, 0xC] + b _080DF1F6 + .align 2, 0 +_080DF1B8: .4byte 0x02039f34 +_080DF1BC: + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + bne _080DF1F6 + ldr r2, [r2, 0x1C] + lsls r3, r4, 4 + adds r2, r3, r2 + ldrb r0, [r2, 0xC] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0xC] + ldr r0, [r6] + ldr r1, [r0, 0x1C] + adds r1, r3, r1 + ldrb r0, [r1, 0xE] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1, 0xE] + ldr r1, [r6] + ldr r0, [r1, 0x1C] + adds r3, r0 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + lsls r0, 1 + adds r3, r0 + ldr r0, [r1, 0x4] + adds r0, r5, r0 + ldrh r0, [r0, 0x6] + strh r0, [r3] +_080DF1F6: + ldr r2, [r6] + ldr r1, [r2, 0x4] + subs r0, r7, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080DF21A + ldr r0, [r2, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xD] + movs r0, 0x2 + orrs r0, r2 + strb r0, [r1, 0xD] +_080DF21A: + ldr r2, [r6] + ldr r0, [r2] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bne _080DF24A + ldr r3, [r2, 0x10] + ldrb r1, [r3, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080DF24A + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0 + bge _080DF24A + ldr r0, [r2, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xD] + movs r0, 0x20 + orrs r0, r2 + strb r0, [r1, 0xD] +_080DF24A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DF080 + + thumb_func_start sub_80DF250 +sub_80DF250: @ 80DF250 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + movs r1, 0 + movs r0, 0 + str r0, [sp, 0x20] + movs r4, 0 + ldr r6, _080DF290 + mov r2, sp + adds r2, 0xC + str r2, [sp, 0x28] + mov r3, sp + adds r3, 0x14 + str r3, [sp, 0x2C] + mov r7, sp + adds r7, 0x2 + str r7, [sp, 0x24] + ldr r5, _080DF294 + movs r2, 0 + movs r3, 0x80 + lsls r3, 17 +_080DF280: + adds r0, r4, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF298 + lsrs r0, r2, 24 + str r0, [sp, 0x20] + b _080DF29E + .align 2, 0 +_080DF290: .4byte 0x02039f34 +_080DF294: .4byte 0x02039f20 +_080DF298: + cmp r0, 0x3 + bne _080DF29E + lsrs r1, r2, 24 +_080DF29E: + adds r2, r3 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DF280 + ldr r0, [r6] + ldr r0, [r0, 0x1C] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1, 0xD] + movs r0, 0x1 + orrs r0, r2 + strb r0, [r1, 0xD] + movs r4, 0 + ldr r1, [sp, 0x20] + lsls r1, 4 + str r1, [sp, 0x30] + mov r9, r4 + mov r10, r4 +_080DF2C2: + ldr r2, [sp, 0x20] + cmp r4, r2 + beq _080DF2EE + ldr r1, _080DF48C + lsls r0, r2, 1 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + add r1, r10 + movs r6, 0 + ldrsh r0, [r1, r6] + subs r2, r0 + cmp r2, 0x32 + bgt _080DF2EE + ldr r7, _080DF490 + ldr r0, [r7] + ldr r2, [r0, 0x1C] + add r2, r9 + ldrb r0, [r2, 0xD] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF2EE: + ldr r1, _080DF490 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + mov r3, r9 + adds r2, r3, r0 + ldrb r1, [r2, 0xE] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080DF30A + ldrb r0, [r2, 0xD] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF30A: + movs r5, 0 + ldr r2, _080DF494 + add r2, r10 + movs r6, 0 + ldrsh r1, [r2, r6] + ldr r7, _080DF494 + movs r3, 0 + ldrsh r0, [r7, r3] + cmp r1, r0 + blt _080DF336 + adds r3, r2, 0 + adds r2, r7, 0 +_080DF322: + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + bgt _080DF336 + movs r6, 0 + ldrsh r1, [r3, r6] + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _080DF322 +_080DF336: + cmp r5, 0x4 + bne _080DF354 + ldr r1, _080DF498 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080DF354 + ldr r2, _080DF490 + ldr r0, [r2] + ldr r2, [r0, 0x1C] + add r2, r9 + ldrb r0, [r2, 0xD] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF354: + movs r3, 0 + mov r12, r3 + mov r8, r3 + movs r5, 0 + ldr r0, _080DF494 + add r0, r10 + movs r7, 0 + ldrsh r6, [r0, r7] + str r6, [sp, 0x34] + ldr r2, _080DF494 + ldr r0, _080DF49C + mov r1, r10 + adds r6, r1, r0 + adds r3, r0, 0 +_080DF370: + movs r7, 0 + ldrsh r0, [r2, r7] + ldr r1, [sp, 0x34] + cmp r1, r0 + ble _080DF37E + movs r7, 0x1 + mov r12, r7 +_080DF37E: + movs r0, 0 + ldrsh r1, [r6, r0] + movs r7, 0 + ldrsh r0, [r3, r7] + cmp r1, r0 + ble _080DF38E + movs r0, 0x1 + mov r8, r0 +_080DF38E: + adds r2, 0x2 + adds r3, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DF370 + mov r1, r12 + cmp r1, 0 + bne _080DF3B4 + mov r2, r8 + cmp r2, 0 + bne _080DF3B4 + ldr r3, _080DF490 + ldr r0, [r3] + ldr r2, [r0, 0x1C] + add r2, r9 + ldrb r0, [r2, 0xD] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF3B4: + ldr r6, _080DF490 + ldr r0, [r6] + ldr r0, [r0, 0x1C] + mov r7, r9 + adds r2, r7, r0 + ldrb r1, [r2, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DF3D0 + ldrb r0, [r2, 0xD] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF3D0: + movs r0, 0x10 + add r9, r0 + movs r1, 0x2 + add r10, r1 + adds r4, 0x1 + cmp r4, 0x3 + bgt _080DF3E0 + b _080DF2C2 +_080DF3E0: + movs r4, 0 + movs r5, 0 + movs r3, 0 + ldr r2, [sp, 0x28] + mov r1, sp +_080DF3EA: + strh r3, [r1] + adds r0, r2, r4 + strb r5, [r0] + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x4 + ble _080DF3EA + mov r1, sp + ldr r0, _080DF4A0 + strh r0, [r1, 0xA] + movs r0, 0 + ldr r2, [sp, 0x28] + strb r0, [r2, 0x5] + movs r4, 0 + ldr r0, _080DF490 + ldr r0, [r0] + mov r8, r0 + ldr r7, [sp, 0x30] +_080DF40E: + mov r3, r8 + ldr r0, [r3, 0x1C] + adds r0, r7, r0 + lsls r1, r4, 1 + adds r0, r1 + ldrh r0, [r0] + adds r4, 0x1 + mov r12, r4 + cmp r0, 0 + beq _080DF450 + ldr r0, _080DF490 + ldr r6, [r0] + ldr r3, [sp, 0x28] + mov r4, sp + movs r5, 0x4 +_080DF42C: + ldr r0, [r6, 0x1C] + adds r0, r7, r0 + adds r0, r1 + ldrh r0, [r0] + ldrh r2, [r4] + cmp r0, r2 + beq _080DF440 + cmp r2, 0 + bne _080DF446 + strh r0, [r4] +_080DF440: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_080DF446: + adds r3, 0x1 + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _080DF42C +_080DF450: + mov r4, r12 + cmp r4, 0x4 + ble _080DF40E + mov r0, sp + ldrh r0, [r0] + ldr r6, [sp, 0x2C] + strh r0, [r6] + ldr r7, [sp, 0x28] + ldrb r3, [r7] + movs r6, 0 + movs r4, 0x1 + ldr r1, [sp, 0x24] + ldrh r0, [r1] + ldr r1, _080DF4A0 + cmp r0, r1 + beq _080DF4C0 + ldr r5, [sp, 0x2C] + adds r7, r1, 0 + mov r2, sp + adds r2, 0x2 +_080DF478: + ldr r0, [sp, 0x28] + adds r1, r0, r4 + ldrb r0, [r1] + cmp r3, r0 + bcs _080DF4A4 + ldrh r0, [r2] + strh r0, [r5] + ldrb r3, [r1] + movs r6, 0x1 + b _080DF4B6 + .align 2, 0 +_080DF48C: .4byte 0x02039f08 +_080DF490: .4byte 0x02039f34 +_080DF494: .4byte 0x02039f00 +_080DF498: .4byte 0x02039f20 +_080DF49C: .4byte 0x02039f18 +_080DF4A0: .4byte 0x0000ffff +_080DF4A4: + cmp r3, r0 + bne _080DF4B6 + lsls r0, r6, 1 + adds r0, r5, r0 + ldrh r1, [r2] + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080DF4B6: + adds r2, 0x2 + adds r4, 0x1 + ldrh r0, [r2] + cmp r0, r7 + bne _080DF478 +_080DF4C0: + bl GenerateRandomNumber + ldr r1, _080DF4F4 + ldr r1, [r1] + ldr r4, [r1, 0x1C] + ldr r1, [sp, 0x30] + adds r4, r1, r4 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 1 + ldr r2, [sp, 0x2C] + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r4, 0xA] + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DF4F4: .4byte 0x02039f34 + thumb_func_end sub_80DF250 + + thumb_func_start sub_80DF4F8 +sub_80DF4F8: @ 80DF4F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r1, _080DF614 + ldr r0, _080DF618 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080DF514 + b _080DF6EE +_080DF514: + movs r7, 0 + movs r3, 0 + ldr r0, _080DF61C + mov r12, r0 +_080DF51C: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF528 + lsls r0, r3, 24 + lsrs r7, r0, 24 +_080DF528: + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF51C + movs r1, 0 + mov r9, r1 + mov r10, r1 + movs r3, 0 + lsls r2, r7, 1 + lsls r4, r7, 4 + mov r8, r4 + ldr r1, _080DF620 + adds r0, r2, r1 + movs r6, 0 + ldrsh r5, [r0, r6] + str r5, [sp, 0x8] + adds r5, r1, 0 + ldr r0, _080DF624 + adds r2, r0 + adds r4, r0, 0 +_080DF54E: + movs r1, 0 + ldrsh r0, [r5, r1] + ldr r6, [sp, 0x8] + cmp r6, r0 + bge _080DF562 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080DF562: + movs r0, 0 + ldrsh r1, [r2, r0] + movs r6, 0 + ldrsh r0, [r4, r6] + cmp r1, r0 + bge _080DF578 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_080DF578: + adds r5, 0x2 + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF54E + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + add r0, r8 + ldrb r1, [r0, 0xC] + movs r4, 0 + movs r2, 0x1 + movs r3, 0x7 +_080DF592: + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _080DF5A0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080DF5A0: + lsrs r1, 1 + subs r3, 0x1 + cmp r3, 0 + bge _080DF592 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080DF61C + ldr r0, [r0] + ldr r0, [r0, 0x1C] + add r0, r8 + ldrb r1, [r0, 0xC] + movs r4, 0 + movs r2, 0 + movs r3, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DF5DC + cmp r5, 0 + beq _080DF5F6 +_080DF5D6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080DF5DC: + lsrs r1, 1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, 0x1 + cmp r3, 0x7 + bgt _080DF5F6 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DF5DC + cmp r5, r4 + bne _080DF5D6 +_080DF5F6: + movs r1, 0x1 + adds r0, r1, 0 + lsls r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r7, 0 + bne _080DF628 + mov r0, sp + strb r1, [r0] + ldr r1, _080DF61C + ldr r0, [r1] + ldr r0, [r0, 0x1C] + ldrb r4, [r0, 0x1D] + movs r3, 0x2 + b _080DF638 + .align 2, 0 +_080DF614: .4byte 0x02039f20 +_080DF618: .4byte 0x02039f25 +_080DF61C: .4byte 0x02039f34 +_080DF620: .4byte 0x02039f00 +_080DF624: .4byte 0x02039f18 +_080DF628: + mov r1, sp + movs r0, 0 + strb r0, [r1] + ldr r1, _080DF668 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + ldrb r4, [r0, 0xD] + movs r3, 0x1 +_080DF638: + mov r12, r1 + movs r5, 0x1 + lsls r2, 24 + str r2, [sp, 0x4] + cmp r3, 0x3 + bgt _080DF682 +_080DF644: + cmp r3, r7 + beq _080DF67C + mov r6, r12 + ldr r2, [r6] + ldr r0, [r2, 0x1C] + lsls r1, r3, 4 + adds r0, r1, r0 + ldrb r0, [r0, 0xD] + cmp r4, r0 + bcs _080DF66C + mov r0, sp + strb r3, [r0] + ldr r0, [r2, 0x1C] + adds r0, r1, r0 + ldrb r4, [r0, 0xD] + movs r5, 0x1 + b _080DF67C + .align 2, 0 +_080DF668: .4byte 0x02039f34 +_080DF66C: + cmp r4, r0 + bne _080DF67C + mov r1, sp + adds r0, r1, r5 + strb r3, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080DF67C: + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF644 +_080DF682: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + add r0, sp + ldrb r6, [r0] + movs r2, 0x80 + movs r3, 0 + ldr r5, _080DF700 + ldr r0, [r5] + ldr r0, [r0, 0x1C] + lsls r1, r6, 4 + adds r0, r1, r0 + ldrb r0, [r0, 0xD] + ands r0, r2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080DF6C4 +_080DF6AE: + lsrs r2, 1 + adds r3, 0x1 + cmp r3, 0x7 + bgt _080DF6C4 + ldr r0, [r5] + ldr r0, [r0, 0x1C] + adds r0, r1, r0 + ldrb r4, [r0, 0xD] + ands r4, r2 + cmp r4, 0 + beq _080DF6AE +_080DF6C4: + mov r0, r9 + bl sub_80ECDA4 + mov r0, r10 + bl sub_80ECDF4 + ldr r5, [sp, 0x4] + lsrs r0, r5, 24 + bl sub_80ECE34 + ldr r0, _080DF700 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + add r0, r8 + ldrh r0, [r0, 0xA] + bl sub_80ECE74 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80ECEB4 +_080DF6EE: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DF700: .4byte 0x02039f34 + thumb_func_end sub_80DF4F8 + + thumb_func_start sub_80DF704 +sub_80DF704: @ 80DF704 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _080DF724 + movs r1, 0xD0 + lsls r1, 9 + adds r2, r0, r1 + ldrb r1, [r2] + adds r4, r0, 0 + cmp r1, 0 + bne _080DF72C + cmp r3, 0 + bne _080DF728 + movs r0, 0x2 + b _080DF72E + .align 2, 0 +_080DF724: .4byte 0x02000000 +_080DF728: + movs r0, 0x3 + b _080DF72E +_080DF72C: + movs r0, 0 +_080DF72E: + strb r0, [r2] + movs r1, 0xD0 + lsls r1, 9 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF746 + bl sub_80DAEA4 + bl sub_80DB2BC + b _080DF74A +_080DF746: + bl sub_80DF750 +_080DF74A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DF704 + + thumb_func_start sub_80DF750 +sub_80DF750: @ 80DF750 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r0, _080DF860 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF766 + b _080DF924 +_080DF766: + ldr r0, _080DF864 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080DF77C + b _080DF924 +_080DF77C: + movs r7, 0 + mov r2, sp + adds r2, 0x18 + str r2, [sp, 0x30] +_080DF784: + adds r0, r7, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DF784 + ldr r0, _080DF864 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080DF874 + movs r7, 0 + movs r2, 0x7 + mov r10, r2 + ldr r0, [sp, 0x30] + mov r9, r0 +_080DF7AE: + add r0, sp, 0x4 + ldr r1, _080DF868 + bl gf_strcpy + adds r5, r0, 0 + ldr r0, _080DF86C + adds r0, r7, r0 + ldrb r0, [r0] + mov r1, r10 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + ldr r0, _080DF870 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + lsls r0, r7, 4 + adds r0, r1 + ldrb r4, [r0, 0xC] + movs r6, 0x7 + adds r2, r7, 0x1 + mov r8, r2 +_080DF7DE: + movs r1, 0x1 + ands r1, r4 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + adds r5, r0, 0 + lsrs r4, 1 + lsls r0, r6, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r6, r0, 24 + asrs r0, 24 + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + bgt _080DF7DE + movs r6, 0 + ldr r4, _080DF86C + ldr r3, [sp, 0x30] +_080DF80A: + lsls r0, r6, 24 + asrs r0, 24 + adds r2, r3, r0 + mov r1, sp + adds r1, r0 + adds r1, 0x4 + ldrb r1, [r1] + strb r1, [r2] + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + asrs r5, r0, 24 + cmp r5, 0x4 + ble _080DF80A + mov r0, r9 + adds r1, r0, r5 + movs r0, 0xFF + strb r0, [r1] + adds r4, r7, r4 + ldrb r0, [r4] + mov r1, r10 + str r1, [sp] + mov r1, r9 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + ldrb r0, [r4] + mov r1, sp + adds r1, r5 + adds r1, 0x4 + mov r2, r10 + str r2, [sp] + movs r2, 0x37 + movs r3, 0x1 + bl sub_80DEBD0 + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DF7AE + b _080DF920 + .align 2, 0 +_080DF860: .4byte 0x020322d5 +_080DF864: .4byte 0x02000000 +_080DF868: .4byte 0x085ed1b2 +_080DF86C: .4byte 0x02039f26 +_080DF870: .4byte 0x02039f34 +_080DF874: + movs r7, 0 + mov r2, sp + adds r2, 0x6 + str r2, [sp, 0x2C] + ldr r0, [sp, 0x30] + mov r9, r0 + movs r1, 0x7 + mov r10, r1 +_080DF884: + add r0, sp, 0x4 + ldr r1, _080DF934 + bl gf_strcpy + ldr r0, _080DF938 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + lsls r0, r7, 4 + adds r0, r1 + ldrb r4, [r0, 0xD] + ldr r5, [sp, 0x2C] + movs r6, 0x7 + adds r2, r7, 0x1 + mov r8, r2 +_080DF8A0: + movs r1, 0x1 + ands r1, r4 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + adds r5, r0, 0 + lsrs r4, 1 + lsls r0, r6, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r6, r0, 24 + asrs r0, 24 + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + bgt _080DF8A0 + movs r6, 0 + ldr r4, _080DF93C + ldr r3, [sp, 0x30] +_080DF8CC: + lsls r0, r6, 24 + asrs r0, 24 + adds r2, r3, r0 + mov r1, sp + adds r1, r0 + adds r1, 0x4 + ldrb r1, [r1] + strb r1, [r2] + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + asrs r5, r0, 24 + cmp r5, 0x4 + ble _080DF8CC + mov r0, r9 + adds r1, r0, r5 + movs r0, 0xFF + strb r0, [r1] + adds r4, r7, r4 + ldrb r0, [r4] + mov r1, r10 + str r1, [sp] + mov r1, r9 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + ldrb r0, [r4] + mov r1, sp + adds r1, r5 + adds r1, 0x4 + mov r2, r10 + str r2, [sp] + movs r2, 0x37 + movs r3, 0x1 + bl sub_80DEBD0 + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DF884 +_080DF920: + bl sub_80DB2BC +_080DF924: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DF934: .4byte 0x085ed1b5 +_080DF938: .4byte 0x02039f34 +_080DF93C: .4byte 0x02039f26 + thumb_func_end sub_80DF750 + + thumb_func_start sub_80DF940 +sub_80DF940: @ 80DF940 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0x2 + ldrb r0, [r4] + cmp r0, 0xFC + bne _080DF956 + ldrb r0, [r4, 0x1] + cmp r0, 0x15 + bne _080DF956 + movs r0, 0x2 + b _080DF9CC +_080DF956: + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _080DF9CA + ldrb r0, [r4] + cmp r0, 0xFF + beq _080DF9CA +_080DF96A: + ldrb r1, [r4] + adds r0, r1, 0 + adds r0, 0x45 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + bls _080DF9BE + adds r0, r1, 0 + adds r0, 0x5F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bls _080DF9BE + adds r0, r1, 0 + cmp r0, 0 + beq _080DF9BE + cmp r0, 0xAD + beq _080DF9BE + cmp r0, 0xB8 + beq _080DF9BE + cmp r0, 0xAB + beq _080DF9BE + cmp r0, 0xAC + beq _080DF9BE + cmp r0, 0xB5 + beq _080DF9BE + cmp r0, 0xB6 + beq _080DF9BE + cmp r0, 0xBA + beq _080DF9BE + cmp r0, 0xAE + beq _080DF9BE + cmp r0, 0xB0 + beq _080DF9BE + cmp r0, 0xB1 + beq _080DF9BE + cmp r0, 0xB2 + beq _080DF9BE + cmp r0, 0xB3 + beq _080DF9BE + cmp r0, 0xB1 + bne _080DF9C8 +_080DF9BE: + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080DF96A + b _080DF9CA +_080DF9C8: + movs r5, 0x1 +_080DF9CA: + adds r0, r5, 0 +_080DF9CC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80DF940 + + thumb_func_start sub_80DF9D4 +sub_80DF9D4: @ 80DF9D4 + ldrb r2, [r0, 0x5] + movs r1, 0xFF + strb r1, [r0, 0x5] + strb r2, [r0, 0x7] + bx lr + thumb_func_end sub_80DF9D4 + + thumb_func_start sub_80DF9E0 +sub_80DF9E0: @ 80DF9E0 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_8009370 + cmp r4, 0x1 + bne _080DF9F8 + movs r0, 0xFF + strb r0, [r5, 0x5] + movs r0, 0xFC + strb r0, [r5, 0xA] + b _080DFA00 +_080DF9F8: + ldrb r1, [r5, 0x5] + movs r0, 0xFF + strb r0, [r5, 0x5] + strb r1, [r5, 0xA] +_080DFA00: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DF9E0 + + thumb_func_start sub_80DFA08 +sub_80DFA08: @ 80DFA08 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r5, 0x2 + cmp r6, 0x1 + bne _080DFA28 + adds r0, r4, 0 + bl sub_80DF940 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8009308 + b _080DFA3E +_080DFA28: + ldrb r0, [r4, 0xA] + cmp r0, 0xFC + bne _080DFA38 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8009308 + b _080DFA3E +_080DFA38: + strb r0, [r4, 0x5] + movs r0, 0xFF + strb r0, [r4, 0xA] +_080DFA3E: + adds r4, r5, 0 + adds r4, 0xD + cmp r6, 0x1 + bne _080DFA68 + movs r0, 0xFF + strb r0, [r4, 0x7] + ldrb r0, [r4, 0x4] + strb r0, [r4, 0x6] + ldrb r0, [r4, 0x3] + strb r0, [r4, 0x5] + ldrb r0, [r4, 0x2] + strb r0, [r4, 0x4] + ldrb r0, [r4, 0x1] + strb r0, [r4, 0x3] + ldrb r0, [r5, 0xD] + strb r0, [r4, 0x2] + movs r0, 0x15 + strb r0, [r4, 0x1] + movs r0, 0xFC + strb r0, [r5, 0xD] + b _080DFA70 +_080DFA68: + ldrb r0, [r4, 0x7] + strb r0, [r4, 0x5] + movs r0, 0xFF + strb r0, [r4, 0x7] +_080DFA70: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80DFA08 + + thumb_func_start CreateShopMainMenu +CreateShopMainMenu: @ 80DFA78 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + ldr r5, _080DFABC + strb r4, [r5, 0xF] + cmp r4, 0 + bne _080DFACC + ldr r0, _080DFAC0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r4, _080DFAC4 + adds r0, r4, 0 + movs r1, 0x3 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _080DFAC8 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r5, 0xE] + str r4, [r5, 0x4] + movs r5, 0x3 + b _080DFAF8 + .align 2, 0 +_080DFABC: .4byte 0x02039f60 +_080DFAC0: .4byte 0x08589a38 +_080DFAC4: .4byte 0x08589a10 +_080DFAC8: .4byte 0x00ffffff +_080DFACC: + ldr r0, _080DFB38 + ldr r1, [r0, 0xC] + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r4, _080DFB3C + adds r0, r4, 0 + movs r1, 0x2 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _080DFB40 + ldr r1, [sp, 0x8] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x8] + add r0, sp, 0x8 + bl Window_AddFromTemplate + strb r0, [r5, 0xE] + str r4, [r5, 0x4] + movs r5, 0x2 +_080DFAF8: + ldr r4, _080DFB44 + ldrb r0, [r4, 0xE] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4, 0xE] + ldr r2, [r4, 0x4] + adds r1, r5, 0 + bl PrintMenuTable + ldrb r0, [r4, 0xE] + adds r1, r5, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldrb r0, [r4, 0xE] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0xE] + movs r1, 0x1 + bl Window_CopyToVram + ldr r0, _080DFB48 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080DFB38: .4byte 0x08589a38 +_080DFB3C: .4byte 0x08589a28 +_080DFB40: .4byte 0x00ffffff +_080DFB44: .4byte 0x02039f60 +_080DFB48: .4byte Task_ShopMenu + 1 + thumb_func_end CreateShopMainMenu + + thumb_func_start SetShopMenuCallback +SetShopMenuCallback: @ 80DFB4C + ldr r1, _080DFB54 + str r0, [r1] + bx lr + .align 2, 0 +_080DFB54: .4byte 0x02039f60 + thumb_func_end SetShopMenuCallback + + thumb_func_start SetShopItemsForSale +SetShopItemsForSale: @ 80DFB58 + push {lr} + adds r1, r0, 0 + movs r2, 0 + ldr r3, _080DFB84 + str r1, [r3, 0x8] + strh r2, [r3, 0xC] + ldrh r0, [r1] + cmp r0, 0 + beq _080DFB80 +_080DFB6A: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080DFB6A +_080DFB80: + pop {r0} + bx r0 + .align 2, 0 +_080DFB84: .4byte 0x02039f60 + thumb_func_end SetShopItemsForSale + + thumb_func_start Task_ShopMenu +Task_ShopMenu: @ 80DFB88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r2, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r2, r0 + beq _080DFBC4 + adds r0, 0x1 + cmp r2, r0 + bne _080DFBB4 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl HandleShopQuit + b _080DFBC4 +_080DFBB4: + ldr r0, _080DFBCC + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 +_080DFBC4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DFBCC: .4byte 0x02039f60 + thumb_func_end Task_ShopMenu + + thumb_func_start HandleShopBuy +HandleShopBuy: @ 80DFBD0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, _080DFC00 + adds r4, r1, r2 + ldr r3, _080DFC04 + lsrs r0, r3, 16 + strh r0, [r4, 0x10] + strh r3, [r4, 0x12] + subs r2, 0x8 + adds r1, r2 + ldr r0, _080DFC08 + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DFC00: .4byte 0x03005e08 +_080DFC04: .4byte sub_80DFD94 + 1 +_080DFC08: .4byte sub_80DFCA4 + 1 + thumb_func_end HandleShopBuy + + thumb_func_start HandleShopSell +HandleShopSell: @ 80DFC0C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, _080DFC3C + adds r4, r1, r2 + ldr r3, _080DFC40 + lsrs r0, r3, 16 + strh r0, [r4, 0x10] + strh r3, [r4, 0x12] + subs r2, 0x8 + adds r1, r2 + ldr r0, _080DFC44 + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DFC3C: .4byte 0x03005e08 +_080DFC40: .4byte sub_81AAC00 + 1 +_080DFC44: .4byte sub_80DFCA4 + 1 + thumb_func_end HandleShopSell + + thumb_func_start sub_80DFC48 +sub_80DFC48: @ 80DFC48 + push {lr} + ldr r0, _080DFC5C + ldr r1, _080DFC60 + str r1, [r0] + ldr r0, _080DFC64 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080DFC5C: .4byte 0x03005dac +_080DFC60: .4byte sub_80DFCE0 + 1 +_080DFC64: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_80DFC48 + + thumb_func_start HandleShopQuit +HandleShopQuit: @ 80DFC68 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080DFCA0 + ldrb r0, [r5, 0xE] + movs r1, 0x2 + bl sub_8198070 + ldrb r0, [r5, 0xE] + bl Window_Remove + bl sub_80ED238 + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task + ldr r5, [r5] + cmp r5, 0 + beq _080DFC98 + bl _call_via_r5 +_080DFC98: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DFCA0: .4byte 0x02039f60 + thumb_func_end HandleShopQuit + + thumb_func_start sub_80DFCA4 +sub_80DFCA4: @ 80DFCA4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _080DFCD8 + adds r4, r0, r1 + ldr r0, _080DFCDC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080DFCD2 + adds r0, r2, 0 + bl remove_task + ldrh r0, [r4, 0x10] + lsls r0, 16 + ldrh r1, [r4, 0x12] + orrs r0, r1 + bl set_callback2 +_080DFCD2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DFCD8: .4byte 0x03005e08 +_080DFCDC: .4byte 0x02037fd4 + thumb_func_end sub_80DFCA4 + + thumb_func_start sub_80DFCE0 +sub_80DFCE0: @ 80DFCE0 + push {lr} + bl pal_fill_black + ldr r0, _080DFCF4 + movs r1, 0x8 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080DFCF4: .4byte sub_80DFCF8 + 1 + thumb_func_end sub_80DFCE0 + + thumb_func_start sub_80DFCF8 +sub_80DFCF8: @ 80DFCF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080DFD36 + ldr r0, _080DFD20 + ldrb r0, [r0, 0xF] + cmp r0, 0x2 + bne _080DFD2C + ldr r1, _080DFD24 + ldr r2, _080DFD28 + adds r0, r4, 0 + bl sub_81978EC + b _080DFD36 + .align 2, 0 +_080DFD20: .4byte 0x02039f60 +_080DFD24: .4byte 0x085e95c7 +_080DFD28: .4byte sub_80DFD44 + 1 +_080DFD2C: + ldr r1, _080DFD3C + ldr r2, _080DFD40 + adds r0, r5, 0 + bl sub_81978EC +_080DFD36: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080DFD3C: .4byte 0x085e959b +_080DFD40: .4byte sub_80DFD44 + 1 + thumb_func_end sub_80DFCF8 + + thumb_func_start sub_80DFD44 +sub_80DFD44: @ 80DFD44 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080DFD60 + ldrb r0, [r0, 0xF] + bl CreateShopMainMenu + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080DFD60: .4byte 0x02039f60 + thumb_func_end sub_80DFD44 + + thumb_func_start sub_80DFD64 +sub_80DFD64: @ 80DFD64 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80DFD64 + + thumb_func_start sub_80DFD80 +sub_80DFD80: @ 80DFD80 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80DFD80 + + thumb_func_start sub_80DFD94 +sub_80DFD94: @ 80DFD94 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _080DFE08 + movs r1, 0x87 + lsls r1, 3 + adds r5, r0, r1 + ldrb r4, [r5] + cmp r4, 0 + beq _080DFE20 + cmp r4, 0x1 + bne _080DFDAC + b _080DFEE4 +_080DFDAC: + bl CreateShopMoneyBox + bl sub_80E01C8 + ldr r0, _080DFE0C + movs r1, 0x8 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080DFE10 + movs r1, 0 + movs r2, 0 + bl calls_per_item_funcs_in_list_outer + ldr r2, _080DFE14 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r1, 0x16] + 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 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _080DFE18 + bl SetVBlankCallback + ldr r0, _080DFE1C + bl set_callback2 + b _080DFEF4 + .align 2, 0 +_080DFE08: .4byte 0x030022c0 +_080DFE0C: .4byte sub_80E0AC8 + 1 +_080DFE10: .4byte 0x03006310 +_080DFE14: .4byte 0x03005e00 +_080DFE18: .4byte sub_80DFD80 + 1 +_080DFE1C: .4byte sub_80DFD64 + 1 +_080DFE20: + bl vblank_hblank_handler_set_zero + str r4, [sp, 0x8] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _080DFECC + add r0, sp, 0x8 + bl CpuFastSet + bl remove_some_task + bl reset_temp_tile_data_buffers + bl gpu_pal_allocator_reset + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + bl clear_scheduled_bg_copies_to_vram + ldr r4, _080DFED0 + ldr r0, _080DFED4 + bl malloc_and_clear + str r0, [r4] + ldr r1, _080DFED8 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080DFEDC + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080DFEE0 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + bl GetShopItemNames + bl sub_80E036C + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + bl sub_80E0468 + bl sub_80E0424 + b _080DFEEE + .align 2, 0 +_080DFECC: .4byte 0x01000100 +_080DFED0: .4byte 0x02039f70 +_080DFED4: .4byte 0x000020b0 +_080DFED8: .4byte 0x0000200b +_080DFEDC: .4byte 0x0000200d +_080DFEE0: .4byte 0x0000200e +_080DFEE4: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _080DFEF4 +_080DFEEE: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_080DFEF4: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DFD94 + + thumb_func_start FreeShopItemNames +FreeShopItemNames: @ 80DFEFC + push {lr} + ldr r0, _080DFF20 + ldr r0, [r0] + bl free + ldr r0, _080DFF24 + ldr r0, [r0] + bl free + ldr r0, _080DFF28 + ldr r0, [r0] + bl free + bl Window_FreeMemory + pop {r0} + bx r0 + .align 2, 0 +_080DFF20: .4byte 0x02039f70 +_080DFF24: .4byte 0x02039f74 +_080DFF28: .4byte 0x02039f78 + thumb_func_end FreeShopItemNames + + thumb_func_start GetShopItemNames +GetShopItemNames: @ 80DFF2C + push {r4-r7,lr} + ldr r7, _080DFFC4 + ldr r4, _080DFFC8 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + lsls r0, 3 + bl malloc + str r0, [r7] + ldr r5, _080DFFCC + ldrh r0, [r4, 0xC] + adds r0, 0x1 + lsls r0, 4 + bl malloc + str r0, [r5] + movs r6, 0 + ldrh r0, [r4, 0xC] + cmp r6, r0 + bcs _080DFF78 +_080DFF54: + lsls r1, r6, 3 + ldr r0, [r7] + adds r0, r1 + ldr r2, [r4, 0x8] + lsls r1, r6, 1 + adds r1, r2 + ldrh r1, [r1] + lsls r3, r6, 4 + ldr r2, [r5] + adds r2, r3 + bl GetShopItemName + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r2, [r4, 0xC] + cmp r6, r2 + bcc _080DFF54 +_080DFF78: + ldr r4, _080DFFCC + lsls r5, r6, 4 + ldr r0, [r4] + adds r0, r5 + ldr r1, _080DFFD0 + bl gf_strcpy + ldr r2, _080DFFC4 + ldr r0, [r2] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r4] + adds r0, r5 + str r0, [r1] + movs r0, 0x2 + negs r0, r0 + str r0, [r1, 0x4] + ldr r3, _080DFFD4 + adds r1, r3, 0 + ldr r0, _080DFFD8 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r2] + str r0, [r3] + ldr r0, _080DFFC8 + ldrh r0, [r0, 0xC] + adds r1, r0, 0x1 + strh r1, [r3, 0xC] + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _080DFFDC + movs r0, 0x8 + strh r0, [r3, 0xE] + b _080DFFDE + .align 2, 0 +_080DFFC4: .4byte 0x02039f74 +_080DFFC8: .4byte 0x02039f60 +_080DFFCC: .4byte 0x02039f78 +_080DFFD0: .4byte 0x085e8cf7 +_080DFFD4: .4byte 0x03006310 +_080DFFD8: .4byte 0x08589a48 +_080DFFDC: + strh r1, [r3, 0xE] +_080DFFDE: + ldr r0, _080DFFF4 + ldr r0, [r0] + ldr r1, _080DFFF8 + ldrh r1, [r1, 0xE] + ldr r2, _080DFFFC + adds r0, r2 + strh r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080DFFF4: .4byte 0x02039f70 +_080DFFF8: .4byte 0x03006310 +_080DFFFC: .4byte 0x00002004 + thumb_func_end GetShopItemNames + + thumb_func_start GetShopItemName +GetShopItemName: @ 80E0000 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r2, 0 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, _080E001C + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0020 + adds r0, r4, 0 + adds r1, r5, 0 + bl itemid_get_name + b _080E002C + .align 2, 0 +_080E001C: .4byte 0x02039f60 +_080E0020: + lsls r1, r4, 5 + ldr r0, _080E0038 + adds r1, r0 + adds r0, r5, 0 + bl gf_strcpy +_080E002C: + str r5, [r6] + str r4, [r6, 0x4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E0038: .4byte 0x085a5c09 + thumb_func_end GetShopItemName + + thumb_func_start PrintShopItemDescription +PrintShopItemDescription: @ 80E003C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _080E0054 + movs r0, 0x5 + bl audio_play +_080E0054: + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _080E0078 + lsls r4, r7, 16 + lsrs r0, r4, 16 + ldr r1, _080E0070 + ldr r1, [r1] + ldr r2, _080E0074 + adds r1, r2 + ldrb r1, [r1] + bl AddItemIconObjectInShop + b _080E008A + .align 2, 0 +_080E0070: .4byte 0x02039f70 +_080E0074: .4byte 0x0000200c +_080E0078: + ldr r0, _080E00C8 + ldr r1, _080E00CC + ldr r1, [r1] + ldr r2, _080E00D0 + adds r1, r2 + ldrb r1, [r1] + bl AddItemIconObjectInShop + lsls r4, r7, 16 +_080E008A: + lsrs r4, 16 + mov r8, r4 + ldr r6, _080E00CC + ldr r0, [r6] + ldr r5, _080E00D0 + adds r0, r5 + ldrb r0, [r0] + movs r4, 0x1 + adds r1, r4, 0 + eors r1, r0 + mov r0, r8 + bl sub_80E031C + ldr r1, [r6] + adds r1, r5 + ldrb r0, [r1] + eors r0, r4 + strb r0, [r1] + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _080E00E8 + ldr r0, _080E00D4 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E00D8 + mov r0, r8 + bl itemid_get_description + adds r4, r0, 0 + b _080E00EA + .align 2, 0 +_080E00C8: .4byte 0x0000ffff +_080E00CC: .4byte 0x02039f70 +_080E00D0: .4byte 0x0000200c +_080E00D4: .4byte 0x02039f60 +_080E00D8: + ldr r0, _080E00E4 + lsls r1, r7, 5 + adds r0, 0x18 + adds r1, r0 + ldr r4, [r1] + b _080E00EA + .align 2, 0 +_080E00E4: .4byte 0x085a5c08 +_080E00E8: + ldr r4, _080E0110 +_080E00EA: + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80E04A4 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E0110: .4byte 0x085e93e0 + thumb_func_end PrintShopItemDescription + + thumb_func_start PrintShopBuyPrice +PrintShopBuyPrice: @ 80E0114 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080E01AC + ldr r0, _080E015C + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0164 + ldr r5, _080E0160 + lsls r0, r1, 16 + lsrs r0, 16 + bl itemid_get_market_price + adds r4, r0, 0 + movs r0, 0x1 + bl sub_80EF038 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + asrs r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl decimal_int_to_string + b _080E0176 + .align 2, 0 +_080E015C: .4byte 0x02039f60 +_080E0160: .4byte 0x02021cc4 +_080E0164: + ldr r0, _080E01B4 + ldr r2, _080E01B8 + lsls r1, 5 + adds r1, r2 + ldrh r1, [r1, 0x14] + movs r2, 0 + movs r3, 0x5 + bl decimal_int_to_string +_080E0176: + ldr r4, _080E01BC + ldr r1, _080E01C0 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x78 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, _080E01C4 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x7 + adds r3, r7, 0 + bl sub_8199EEC +_080E01AC: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E01B4: .4byte 0x02021cc4 +_080E01B8: .4byte 0x085a5c08 +_080E01BC: .4byte 0x02021fc4 +_080E01C0: .4byte 0x085e969c +_080E01C4: .4byte 0x08589ab3 + thumb_func_end PrintShopBuyPrice + + thumb_func_start sub_80E01C8 +sub_80E01C8: @ 80E01C8 + push {r4,r5,lr} + sub sp, 0x10 + ldr r5, _080E0210 + ldr r2, [r5] + ldr r4, _080E0214 + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E0206 + ldr r0, _080E0218 + ldrh r1, [r0, 0xC] + adds r0, r1, 0x1 + cmp r0, 0x8 + ble _080E0206 + subs r0, r1, 0x7 + str r0, [sp] + ldr r0, _080E021C + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r1, _080E0220 + adds r0, r2, r1 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl sub_81AF4A0 + ldr r1, [r5] + adds r1, r4 + strb r0, [r1] +_080E0206: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E0210: .4byte 0x02039f70 +_080E0214: .4byte 0x0000200b +_080E0218: .4byte 0x02039f60 +_080E021C: .4byte 0x00000834 +_080E0220: .4byte 0x00002008 + thumb_func_end sub_80E01C8 + + thumb_func_start sub_80E0224 +sub_80E0224: @ 80E0224 + push {r4,lr} + ldr r4, _080E0248 + ldr r0, [r4] + ldr r2, _080E024C + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _080E0242 + bl sub_81AF620 + ldr r0, [r4] + ldr r1, _080E024C + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_080E0242: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E0248: .4byte 0x02039f70 +_080E024C: .4byte 0x0000200b + thumb_func_end sub_80E0224 + + thumb_func_start sub_80E0250 +sub_80E0250: @ 80E0250 + push {r4,lr} + sub sp, 0x8 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl sub_81AE88C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _080E0280 + movs r0, 0 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + bl sub_80E04A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E0280: .4byte 0x085e8d60 + thumb_func_end sub_80E0250 + + thumb_func_start AddItemIconObjectInShop +AddItemIconObjectInShop: @ 80E0284 + push {r4,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r0, _080E02D8 + ldr r4, _080E02DC + adds r1, r3, r4 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080E0310 + ldr r0, _080E02E0 + ldrb r0, [r0, 0xF] + cmp r0, 0 + beq _080E02AE + ldr r0, _080E02E4 + cmp r2, r0 + bne _080E02F0 +_080E02AE: + ldr r0, _080E02E8 + adds r1, r3, r0 + adds r0, r1, 0 + bl AddItemIconObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080E0310 + strb r2, [r4] + ldr r1, _080E02EC + 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] + b _080E0310 + .align 2, 0 +_080E02D8: .4byte 0x02039f70 +_080E02DC: .4byte 0x0000200d +_080E02E0: .4byte 0x02039f60 +_080E02E4: .4byte 0x0000ffff +_080E02E8: .4byte 0x0000083e +_080E02EC: .4byte 0x02020630 +_080E02F0: + lsls r0, r2, 24 + lsrs r0, 24 + ldr r2, _080E0318 + adds r1, r3, r2 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x14 + movs r2, 0x54 + movs r3, 0x1 + bl sub_81295CC + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080E0310 + strb r2, [r4] +_080E0310: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E0318: .4byte 0x0000083e + thumb_func_end AddItemIconObjectInShop + + thumb_func_start sub_80E031C +sub_80E031C: @ 80E031C + push {r4,r5,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, _080E035C + ldr r2, _080E0360 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _080E0356 + ldr r0, _080E0364 + adds r4, r0 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E0368 + adds r0, r1 + bl obj_delete_and_free_tiles + movs r0, 0xFF + strb r0, [r5] +_080E0356: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E035C: .4byte 0x02039f70 +_080E0360: .4byte 0x0000200d +_080E0364: .4byte 0x0000083e +_080E0368: .4byte 0x02020630 + thumb_func_end sub_80E031C + + thumb_func_start sub_80E036C +sub_80E036C: @ 80E036C + push {r4,lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080E041C + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _080E0420 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + movs r0, 0xC0 + lsls r0, 5 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 5 + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E041C: .4byte 0x08589a60 +_080E0420: .4byte 0x02039f70 + thumb_func_end sub_80E036C + + thumb_func_start sub_80E0424 +sub_80E0424: @ 80E0424 + push {lr} + sub sp, 0x4 + ldr r1, _080E0454 + movs r2, 0xE8 + lsls r2, 2 + ldr r3, _080E0458 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + bl decompress_and_copy_tile_data_to_vram + ldr r0, _080E045C + ldr r1, _080E0460 + ldr r1, [r1] + bl call_LZZUnCompWram + ldr r0, _080E0464 + movs r1, 0xC0 + movs r2, 0x20 + bl decompress_palette + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080E0454: .4byte 0x08d9afbc +_080E0458: .4byte 0x000003e3 +_080E045C: .4byte 0x08d9b0f0 +_080E0460: .4byte 0x02039f70 +_080E0464: .4byte 0x08d9b0c8 + thumb_func_end sub_80E0424 + + thumb_func_start sub_80E0468 +sub_80E0468: @ 80E0468 + push {lr} + ldr r0, _080E04A0 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xE0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + pop {r0} + bx r0 + .align 2, 0 +_080E04A0: .4byte 0x08589a70 + thumb_func_end sub_80E0468 + + thumb_func_start sub_80E04A4 +sub_80E04A4: @ 80E04A4 + push {r4-r6,lr} + sub sp, 0x14 + ldr r6, [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 r5, 24 + lsrs r5, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, _080E04E4 + adds r4, r5 + str r4, [sp, 0x8] + lsls r6, 24 + asrs r6, 24 + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl sub_8199EEC + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E04E4: .4byte 0x08589ab0 + thumb_func_end sub_80E04A4 + + thumb_func_start sub_80E04E8 +sub_80E04E8: @ 80E04E8 + 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 + 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, 0x5 + movs r2, 0xA + movs r3, 0xE + bl sub_8121E7C + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E04E8 + + thumb_func_start CreateShopMoneyBox +CreateShopMoneyBox: @ 80E0524 + push {lr} + bl sub_80E0570 + bl sub_80E0A40 + movs r0, 0x13 + movs r1, 0xB + bl AddMoneyTextObject + ldr r0, _080E056C + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl decrypt_money + adds r3, r0, 0 + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD + bl set_window_border_style_and_print_money_box + 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 + pop {r0} + bx r0 + .align 2, 0 +_080E056C: .4byte 0x03005d8c + thumb_func_end CreateShopMoneyBox + + thumb_func_start sub_80E0570 +sub_80E0570: @ 80E0570 + push {lr} + bl sub_80E075C + bl sub_80E08F0 + bl sub_80E0584 + pop {r0} + bx r0 + thumb_func_end sub_80E0570 + + thumb_func_start sub_80E0584 +sub_80E0584: @ 80E0584 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _080E0604 + ldr r0, [r0] + mov r9, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r1, sp + mov r0, sp + ldrh r0, [r0] + subs r0, 0x4 + strh r0, [r1] + ldrh r0, [r4] + subs r0, 0x4 + strh r0, [r4] + movs r1, 0 + mov r10, r4 +_080E05B6: + movs r4, 0 + lsls r7, r1, 16 + asrs r0, r7, 16 + mov r8, r0 +_080E05BE: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r4, 16 + asrs r5, r4, 16 + adds r0, r5 + mov r2, r10 + movs r3, 0 + ldrsh r1, [r2, r3] + add r1, r8 + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + mov r1, r8 + bl sub_80E0A88 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E0608 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, r5 + mov r2, r10 + movs r3, 0 + ldrsh r1, [r2, r3] + add r1, r8 + bl cur_mapdata_block_get_bgs_at + lsls r0, 24 + lsrs r5, r0, 24 + b _080E060A + .align 2, 0 +_080E0604: .4byte 0x02037318 +_080E0608: + movs r5, 0x1 +_080E060A: + ldr r0, _080E0628 + cmp r6, r0 + bhi _080E062C + asrs r0, r4, 16 + mov r2, r9 + ldr r1, [r2, 0x10] + lsls r3, r6, 4 + ldr r2, [r1, 0xC] + adds r2, r3 + asrs r1, r7, 16 + adds r3, r5, 0 + bl sub_80E0670 + b _080E0644 + .align 2, 0 +_080E0628: .4byte 0x000001ff +_080E062C: + asrs r0, r4, 16 + mov r3, r9 + ldr r2, [r3, 0x14] + ldr r3, _080E066C + adds r1, r6, r3 + lsls r1, 4 + ldr r2, [r2, 0xC] + adds r2, r1 + asrs r1, r7, 16 + adds r3, r5, 0 + bl sub_80E0670 +_080E0644: + movs r1, 0x80 + lsls r1, 9 + adds r0, r4, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0xE + ble _080E05BE + adds r0, r7, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080E05B6 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E066C: .4byte 0xfffffe00 + thumb_func_end sub_80E0584 + + thumb_func_start sub_80E0670 +sub_80E0670: @ 80E0670 + push {r4-r7,lr} + adds r7, r2, 0 + lsls r3, 24 + lsrs r3, 24 + adds r2, r3, 0 + lsls r0, 17 + lsrs r5, r0, 16 + lsls r1, 22 + lsrs r1, 16 + cmp r3, 0x1 + beq _080E06C0 + cmp r3, 0x1 + bgt _080E0690 + cmp r3, 0 + beq _080E0696 + b _080E0728 +_080E0690: + cmp r2, 0x2 + beq _080E06F8 + b _080E0728 +_080E0696: + ldr r6, _080E06BC + ldr r0, [r6] + movs r2, 0xC0 + lsls r2, 5 + adds r0, r2 + lsls r5, 16 + asrs r5, 16 + lsls r4, r1, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80E0734 + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 4 + b _080E06E2 + .align 2, 0 +_080E06BC: .4byte 0x02039f70 +_080E06C0: + ldr r6, _080E06F4 + ldr r0, [r6] + movs r2, 0x80 + lsls r2, 5 + adds r0, r2 + lsls r5, 16 + asrs r5, 16 + lsls r4, r1, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80E0734 + ldr r0, [r6] + movs r1, 0xC0 + lsls r1, 5 +_080E06E2: + adds r0, r1 + adds r3, r7, 0 + adds r3, 0x8 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E0734 + b _080E0728 + .align 2, 0 +_080E06F4: .4byte 0x02039f70 +_080E06F8: + ldr r6, _080E0730 + ldr r0, [r6] + movs r2, 0x80 + lsls r2, 5 + adds r0, r2 + lsls r5, 16 + asrs r5, 16 + lsls r4, r1, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80E0734 + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 4 + adds r0, r1 + adds r3, r7, 0 + adds r3, 0x8 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E0734 +_080E0728: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E0730: .4byte 0x02039f70 + thumb_func_end sub_80E0670 + + thumb_func_start sub_80E0734 +sub_80E0734: @ 80E0734 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r2 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r3] + strh r0, [r1] + ldrh r0, [r3, 0x2] + strh r0, [r1, 0x2] + adds r2, r1, 0 + adds r2, 0x40 + ldrh r0, [r3, 0x4] + strh r0, [r2] + adds r1, 0x42 + ldrh r0, [r3, 0x6] + strh r0, [r1] + bx lr + thumb_func_end sub_80E0734 + + thumb_func_start sub_80E075C +sub_80E075C: @ 80E075C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + movs r7, 0 + ldr r5, _080E0850 + ldr r3, _080E0854 + movs r2, 0x10 +_080E0780: + ldr r1, [r5] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 1 + adds r1, r3 + adds r1, r0 + strh r2, [r1] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _080E0780 + movs r7, 0 + str r4, [sp, 0x8] + ldr r1, _080E0850 + mov r9, r1 + mov r2, sp + str r2, [sp, 0x4] +_080E07A4: + movs r3, 0 + adds r4, r7, 0x1 + str r4, [sp, 0xC] +_080E07AA: + ldr r1, _080E0858 + adds r0, r3, r1 + ldr r2, [sp, 0x4] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + ldr r4, _080E085C + adds r1, r7, r4 + ldr r2, [sp, 0x8] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + str r3, [sp, 0x10] + bl npc_id_by_pos + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x10] + cmp r6, 0x10 + beq _080E08C2 + mov r4, r9 + ldr r1, [r4] + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r5, r0, 1 + ldr r2, _080E0854 + adds r0, r1, r2 + adds r0, r5 + movs r2, 0 + mov r10, r2 + strh r6, [r0] + ldr r2, _080E0860 + adds r0, r1, r2 + adds r0, r5 + strh r3, [r0] + ldr r0, _080E0864 + adds r1, r0 + adds r1, r5 + strh r7, [r1] + ldr r1, [sp, 0x4] + movs r2, 0 + ldrsh r0, [r1, r2] + subs r1, r3, 0x4 + adds r0, r1 + ldr r1, [sp, 0x8] + movs r2, 0 + ldrsh r1, [r1, r2] + mov r12, r1 + subs r1, r7, 0x2 + add r1, r12 + str r3, [sp, 0x10] + bl cur_mapdata_block_get_bgs_at + mov r1, r9 + ldr r2, [r1] + ldr r1, _080E0868 + adds r1, r2 + mov r12, r1 + add r12, r5 + lsls r0, 24 + lsrs r0, 24 + mov r1, r12 + strh r0, [r1] + ldr r1, _080E086C + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + ldr r3, [sp, 0x10] + cmp r0, 0x2 + beq _080E0884 + cmp r0, 0x2 + bgt _080E0870 + cmp r0, 0x1 + beq _080E0876 + b _080E08A4 + .align 2, 0 +_080E0850: .4byte 0x02039f70 +_080E0854: .4byte 0x00002010 +_080E0858: .4byte 0x0000fffc +_080E085C: .4byte 0x0000fffe +_080E0860: .4byte 0x00002012 +_080E0864: .4byte 0x00002014 +_080E0868: .4byte 0x00002018 +_080E086C: .4byte 0x02037350 +_080E0870: + cmp r0, 0x3 + beq _080E0894 + b _080E08A4 +_080E0876: + ldr r4, _080E0880 + adds r0, r2, r4 + adds r0, r5 + mov r1, r10 + b _080E08B6 + .align 2, 0 +_080E0880: .4byte 0x00002016 +_080E0884: + ldr r4, _080E0890 + adds r0, r2, r4 + adds r0, r5 + movs r1, 0x1 + b _080E08B6 + .align 2, 0 +_080E0890: .4byte 0x00002016 +_080E0894: + ldr r1, _080E08A0 + adds r0, r2, r1 + adds r0, r5 + movs r1, 0x2 + b _080E08B6 + .align 2, 0 +_080E08A0: .4byte 0x00002016 +_080E08A4: + mov r2, r9 + ldr r0, [r2] + mov r2, r8 + adds r1, r4, r2 + lsls r1, 1 + ldr r4, _080E08EC + adds r0, r4 + adds r0, r1 + movs r1, 0x3 +_080E08B6: + strh r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080E08C2: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x6 + bhi _080E08CE + b _080E07AA +_080E08CE: + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x4 + bhi _080E08DA + b _080E07A4 +_080E08DA: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E08EC: .4byte 0x00002016 + thumb_func_end sub_80E075C + + thumb_func_start sub_80E08F0 +sub_80E08F0: @ 80E08F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r7, 0 + ldr r0, _080E09F4 + mov r8, r0 + ldr r1, _080E09F8 + mov r10, r1 + ldr r2, _080E09FC + mov r9, r2 +_080E090A: + mov r3, r8 + ldr r0, [r3] + lsls r1, r7, 2 + adds r1, r7 + lsls r5, r1, 1 + ldr r4, _080E0A00 + adds r0, r4 + adds r1, r0, r5 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x10 + beq _080E09D8 + adds r1, r0, 0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r0, [r0, 0x5] + bl npc_get_type + mov r4, r8 + ldr r3, [r4] + ldr r2, _080E0A00 + adds r1, r3, r2 + adds r1, r5 + movs r4, 0 + ldrsh r2, [r1, r4] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + add r1, r10 + ldrb r4, [r1, 0x5] + ldr r2, _080E0A04 + adds r1, r3, r2 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 4 + adds r2, 0x8 + lsls r2, 16 + asrs r2, 16 + ldr r1, _080E0A08 + adds r3, r1 + adds r3, r5 + ldrh r3, [r3] + lsls r3, 4 + movs r1, 0xA + ldrsh r0, [r0, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r0, 0x30 + subs r3, r0 + lsls r3, 16 + asrs r3, 16 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + ldr r1, _080E0A0C + bl sub_808DD68 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r2, _080E0A00 + adds r1, r5, r2 + mov r3, r8 + ldr r0, [r3] + adds r0, r1 + bl sub_80E0A14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E09C0 + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + add r2, r9 + adds r2, 0x42 + ldrb r0, [r2] + movs r4, 0x40 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] +_080E09C0: + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r9 + mov r2, r8 + ldr r1, [r2] + ldr r3, _080E0A10 + adds r1, r3 + adds r1, r5 + ldrb r1, [r1] + bl obj_anim_image_start +_080E09D8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _080E090A + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E09F4: .4byte 0x02039f70 +_080E09F8: .4byte 0x02037350 +_080E09FC: .4byte 0x02020630 +_080E0A00: .4byte 0x00002010 +_080E0A04: .4byte 0x00002012 +_080E0A08: .4byte 0x00002014 +_080E0A0C: .4byte nullsub_12 + 1 +_080E0A10: .4byte 0x00002016 + thumb_func_end sub_80E08F0 + + thumb_func_start sub_80E0A14 +sub_80E0A14: @ 80E0A14 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r4, r2] + adds r1, 0x2 + bl sub_80E0A88 + lsls r0, 24 + cmp r0, 0 + bne _080E0A38 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080E0A38 + movs r0, 0x1 + b _080E0A3A +_080E0A38: + movs r0, 0 +_080E0A3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E0A14 + + thumb_func_start sub_80E0A40 +sub_80E0A40: @ 80E0A40 + push {r4-r6,lr} + ldr r0, _080E0A7C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + adds r4, r0, r1 + adds r3, r0, 0 + movs r1, 0 + ldr r0, _080E0A80 + adds r6, r0, 0 + ldr r5, _080E0A84 +_080E0A56: + lsls r0, r1, 16 + asrs r2, r0, 16 + lsls r1, r2, 1 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080E0A6A + adds r1, r4 + adds r0, r6 + strh r0, [r1] +_080E0A6A: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, r5 + ble _080E0A56 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E0A7C: .4byte 0x02039f70 +_080E0A80: .4byte 0x0000c3e3 +_080E0A84: .4byte 0x000003ff + thumb_func_end sub_80E0A40 + + thumb_func_start sub_80E0A88 +sub_80E0A88: @ 80E0A88 + push {lr} + ldr r2, _080E0ABC + ldr r2, [r2] + lsls r0, 1 + lsls r1, 6 + adds r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r0, [r1] + cmp r0, 0 + bne _080E0AC0 + adds r0, r1, 0 + adds r0, 0x40 + ldrh r0, [r0] + cmp r0, 0 + bne _080E0AC0 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080E0AC0 + adds r0, r1, 0 + adds r0, 0x42 + ldrh r0, [r0] + cmp r0, 0 + bne _080E0AC0 + movs r0, 0x1 + b _080E0AC2 + .align 2, 0 +_080E0ABC: .4byte 0x02039f70 +_080E0AC0: + movs r0, 0 +_080E0AC2: + pop {r1} + bx r1 + thumb_func_end sub_80E0A88 + + thumb_func_start sub_80E0AC8 +sub_80E0AC8: @ 80E0AC8 + 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, _080E0B14 + adds r4, r0, r1 + ldr r0, _080E0B18 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080E0AEA + b _080E0C8E +_080E0AEA: + ldrb r0, [r4, 0xE] + bl sub_81AE604 + adds r5, r0, 0 + ldrb r0, [r4, 0xE] + ldr r7, _080E0B1C + ldr r2, [r7] + ldr r3, _080E0B20 + adds r1, r2, r3 + subs r3, 0x2 + adds r2, r3 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _080E0B24 + adds r0, 0x1 + cmp r5, r0 + bne _080E0B32 + b _080E0C8E + .align 2, 0 +_080E0B14: .4byte 0x03005e08 +_080E0B18: .4byte 0x02037fd4 +_080E0B1C: .4byte 0x02039f70 +_080E0B20: .4byte 0x00002008 +_080E0B24: + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_80E1168 + b _080E0C8E +_080E0B32: + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0xA] + movs r0, 0x2 + bl Window_FillTileMap + bl sub_80E0224 + ldrb r0, [r4, 0xE] + movs r1, 0x2 + bl sub_80E0250 + ldr r0, _080E0B7C + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0B80 + lsls r0, r5, 16 + lsrs r0, 16 + bl itemid_get_market_price + adds r4, r0, 0 + movs r0, 0x1 + bl sub_80EF038 + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + asrs r4, r0 + str r4, [r1] + b _080E0B92 + .align 2, 0 +_080E0B7C: .4byte 0x02039f60 +_080E0B80: + ldr r1, [r7] + movs r3, 0x80 + lsls r3, 6 + adds r1, r3 + ldr r2, _080E0BBC + lsls r0, r5, 5 + adds r0, r2 + ldrh r0, [r0, 0x14] + str r0, [r1] +_080E0B92: + ldr r0, _080E0BC0 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r2, _080E0BC4 + mov r8, r2 + ldr r1, [r2] + movs r7, 0x80 + lsls r7, 6 + adds r1, r7 + ldr r1, [r1] + bl is_money_greater_than + lsls r0, 24 + cmp r0, 0 + bne _080E0BD0 + ldr r1, _080E0BC8 + ldr r2, _080E0BCC + b _080E0C28 + .align 2, 0 +_080E0BBC: .4byte 0x085a5c08 +_080E0BC0: .4byte 0x03005d8c +_080E0BC4: .4byte 0x02039f70 +_080E0BC8: .4byte 0x085e9539 +_080E0BCC: .4byte sub_80E10A0 + 1 +_080E0BD0: + ldr r4, _080E0C10 + ldrb r0, [r4, 0xF] + cmp r0, 0 + bne _080E0C38 + lsls r0, r5, 16 + lsrs r5, r0, 16 + ldr r1, _080E0C14 + adds r0, r5, 0 + bl itemid_get_name + adds r0, r5, 0 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080E0C24 + ldr r4, _080E0C18 + adds r0, r5, 0 + bl sub_81B6CFC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, _080E0C1C + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _080E0C20 + b _080E0C26 + .align 2, 0 +_080E0C10: .4byte 0x02039f60 +_080E0C14: .4byte 0x02021cc4 +_080E0C18: .4byte 0x02021dc4 +_080E0C1C: .4byte 0x0831977c +_080E0C20: .4byte 0x085e9417 +_080E0C24: + ldr r1, _080E0C30 +_080E0C26: + ldr r2, _080E0C34 +_080E0C28: + adds r0, r6, 0 + bl sub_80E04E8 + b _080E0C8E + .align 2, 0 +_080E0C30: .4byte 0x085e93ef +_080E0C34: .4byte sub_80E0CA4 + 1 +_080E0C38: + ldr r0, _080E0C68 + lsls r1, r5, 5 + ldr r2, _080E0C6C + adds r1, r2 + bl gf_strcpy + ldr r0, _080E0C70 + mov r3, r8 + ldr r1, [r3] + adds r1, r7 + ldr r1, [r1] + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + ldrb r0, [r4, 0xF] + cmp r0, 0x1 + bne _080E0C7C + ldr r0, _080E0C74 + ldr r1, _080E0C78 + bl ExpandTextCodes + b _080E0C84 + .align 2, 0 +_080E0C68: .4byte 0x02021cc4 +_080E0C6C: .4byte 0x085a5c09 +_080E0C70: .4byte 0x02021dc4 +_080E0C74: .4byte 0x02021fc4 +_080E0C78: .4byte 0x085e9468 +_080E0C7C: + ldr r0, _080E0C98 + ldr r1, _080E0C9C + bl ExpandTextCodes +_080E0C84: + ldr r1, _080E0C98 + ldr r2, _080E0CA0 + adds r0, r6, 0 + bl sub_80E04E8 +_080E0C8E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E0C98: .4byte 0x02021fc4 +_080E0C9C: .4byte 0x085e9493 +_080E0CA0: .4byte sub_80E0EAC + 1 + thumb_func_end sub_80E0AC8 + + thumb_func_start sub_80E0CA4 +sub_80E0CA4: @ 80E0CA4 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r5, r6, 2 + adds r5, r6 + lsls r5, 3 + ldr r0, _080E0D44 + adds r5, r0 + ldrh r0, [r5, 0xA] + bl sub_80D70BC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x3 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, _080E0D48 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _080E0D4C + ldr r1, _080E0D50 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_80E04A4 + movs r0, 0x1 + strh r0, [r5, 0x2] + movs r0, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + adds r0, r6, 0 + bl sub_80E10EC + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _080E0D54 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl decrypt_money + ldr r1, _080E0D58 + ldr r4, [r1] + movs r2, 0x80 + lsls r2, 6 + adds r1, r4, r2 + ldr r1, [r1] + bl __udivsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x63 + bls _080E0D60 + ldr r0, _080E0D5C + adds r1, r4, r0 + movs r0, 0x63 + strb r0, [r1] + b _080E0D66 + .align 2, 0 +_080E0D44: .4byte 0x03005e08 +_080E0D48: .4byte 0x02021cc4 +_080E0D4C: .4byte 0x02021fc4 +_080E0D50: .4byte 0x085e93d5 +_080E0D54: .4byte 0x03005d8c +_080E0D58: .4byte 0x02039f70 +_080E0D5C: .4byte 0x0000200a +_080E0D60: + ldr r2, _080E0D7C + adds r0, r4, r2 + strb r1, [r0] +_080E0D66: + ldr r0, _080E0D80 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080E0D84 + str r0, [r1] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E0D7C: .4byte 0x0000200a +_080E0D80: .4byte 0x03005e00 +_080E0D84: .4byte sub_80E0D88 + 1 + thumb_func_end sub_80E0CA4 + + thumb_func_start sub_80E0D88 +sub_80E0D88: @ 80E0D88 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r6, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _080E0DE4 + adds r5, r0, r1 + adds r0, r5, 0x2 + ldr r7, _080E0DE8 + ldr r1, [r7] + ldr r2, _080E0DEC + adds r1, r2 + ldrb r1, [r1] + bl sub_8122034 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E0DF0 + ldrh r0, [r5, 0xA] + bl itemid_get_market_price + adds r4, r0, 0 + movs r0, 0x1 + bl sub_80EF038 + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + asrs r4, r0 + movs r2, 0x2 + ldrsh r0, [r5, r2] + muls r0, r4 + str r0, [r1] + adds r0, r6, 0 + bl sub_80E10EC + b _080E0EA4 + .align 2, 0 +_080E0DE4: .4byte 0x03005e08 +_080E0DE8: .4byte 0x02039f70 +_080E0DEC: .4byte 0x0000200a +_080E0DF0: + ldr r0, _080E0E5C + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080E0E74 + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x4 + bl Window_FillTileMap + movs r0, 0x3 + bl Window_FillTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldrh r0, [r5, 0xA] + ldr r1, _080E0E60 + bl itemid_get_name + ldr r0, _080E0E64 + movs r2, 0x2 + ldrsh r1, [r5, r2] + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _080E0E68 + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + ldr r1, _080E0E6C + ldr r2, _080E0E70 + adds r0, r6, 0 + bl sub_80E04E8 + b _080E0EA4 + .align 2, 0 +_080E0E5C: .4byte 0x030022c0 +_080E0E60: .4byte 0x02021cc4 +_080E0E64: .4byte 0x02021dc4 +_080E0E68: .4byte 0x02021ec4 +_080E0E6C: .4byte 0x085e943f +_080E0E70: .4byte sub_80E0EAC + 1 +_080E0E74: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080E0EA4 + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x4 + bl Window_FillTileMap + movs r0, 0x3 + bl Window_FillTileMap + adds r0, r4, 0 + bl sub_80E10A0 +_080E0EA4: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E0D88 + + thumb_func_start sub_80E0EAC +sub_80E0EAC: @ 80E0EAC + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E0ED4 + movs r2, 0 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xD + str r2, [sp, 0x8] + ldr r2, _080E0ED8 + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl sub_8121F94 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_080E0ED4: .4byte 0x08589aa8 +_080E0ED8: .4byte 0x08589a08 + thumb_func_end sub_80E0EAC + + thumb_func_start sub_80E0EDC +sub_80E0EDC: @ 80E0EDC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080E0F20 + adds r4, r0, r1 + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r6, _080E0F24 + ldrb r0, [r6, 0xF] + cmp r0, 0 + bne _080E0F40 + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x2] + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E0F30 + ldr r1, _080E0F28 + ldr r2, _080E0F2C + adds r0, r5, 0 + bl sub_80E04E8 + adds r0, r5, 0 + bl sub_80E1204 + b _080E0F7A + .align 2, 0 +_080E0F20: .4byte 0x03005e08 +_080E0F24: .4byte 0x02039f60 +_080E0F28: .4byte 0x085e94c5 +_080E0F2C: .4byte sub_80E0F88 + 1 +_080E0F30: + ldr r1, _080E0F38 + ldr r2, _080E0F3C + b _080E0F60 + .align 2, 0 +_080E0F38: .4byte 0x085e9558 +_080E0F3C: .4byte sub_80E10A0 + 1 +_080E0F40: + ldrb r0, [r4, 0xA] + bl sub_8161960 + lsls r0, 24 + cmp r0, 0 + beq _080E0F70 + ldrb r0, [r6, 0xF] + cmp r0, 0x1 + bne _080E0F5C + ldr r1, _080E0F58 + b _080E0F5E + .align 2, 0 +_080E0F58: .4byte 0x085e94e7 +_080E0F5C: + ldr r1, _080E0F68 +_080E0F5E: + ldr r2, _080E0F6C +_080E0F60: + adds r0, r5, 0 + bl sub_80E04E8 + b _080E0F7A + .align 2, 0 +_080E0F68: .4byte 0x085e9510 +_080E0F6C: .4byte sub_80E0F88 + 1 +_080E0F70: + ldr r1, _080E0F80 + ldr r2, _080E0F84 + adds r0, r7, 0 + bl sub_80E04E8 +_080E0F7A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E0F80: .4byte 0x085e957f +_080E0F84: .4byte sub_80E10A0 + 1 + thumb_func_end sub_80E0EDC + + thumb_func_start sub_80E0F88 +sub_80E0F88: @ 80E0F88 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x26 + bl sav12_xor_increment + ldr r5, _080E0FDC + ldr r0, [r5] + movs r4, 0x92 + lsls r4, 3 + adds r0, r4 + ldr r1, _080E0FE0 + ldr r1, [r1] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + ldr r1, [r1] + bl subtract_money + movs r0, 0x5F + bl audio_play + ldr r0, [r5] + adds r0, r4 + bl decrypt_money + adds r1, r0, 0 + movs r0, 0 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + ldr r0, _080E0FE4 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0FF0 + ldr r0, _080E0FE8 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080E0FEC + b _080E0FFC + .align 2, 0 +_080E0FDC: .4byte 0x03005d8c +_080E0FE0: .4byte 0x02039f70 +_080E0FE4: .4byte 0x02039f60 +_080E0FE8: .4byte 0x03005e00 +_080E0FEC: .4byte sub_80E100C + 1 +_080E0FF0: + ldr r0, _080E1004 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080E1008 +_080E0FFC: + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E1004: .4byte 0x03005e00 +_080E1008: .4byte sub_80E1078 + 1 + thumb_func_end sub_80E0F88 + + thumb_func_start sub_80E100C +sub_80E100C: @ 80E100C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080E105C + adds r5, r0, r1 + ldr r0, _080E1060 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080E1072 + movs r0, 0x5 + bl audio_play + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bne _080E106C + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x9 + ble _080E106C + movs r0, 0xC + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E106C + ldr r1, _080E1064 + ldr r2, _080E1068 + adds r0, r4, 0 + bl sub_80E04E8 + b _080E1072 + .align 2, 0 +_080E105C: .4byte 0x03005e08 +_080E1060: .4byte 0x030022c0 +_080E1064: .4byte 0x085e95ea +_080E1068: .4byte sub_80E10A0 + 1 +_080E106C: + adds r0, r4, 0 + bl sub_80E10A0 +_080E1072: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E100C + + thumb_func_start sub_80E1078 +sub_80E1078: @ 80E1078 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080E109C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080E1096 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_80E10A0 +_080E1096: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E109C: .4byte 0x030022c0 + thumb_func_end sub_80E1078 + + thumb_func_start sub_80E10A0 +sub_80E10A0: @ 80E10A0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, _080E10E4 + adds r6, r4, r5 + movs r0, 0x5 + movs r1, 0 + bl sub_8197DF8 + ldrb r0, [r6, 0xE] + movs r1, 0x1 + bl sub_80E0250 + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl sub_80E01C8 + subs r5, 0x8 + adds r4, r5 + ldr r0, _080E10E8 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E10E4: .4byte 0x03005e08 +_080E10E8: .4byte sub_80E0AC8 + 1 + thumb_func_end sub_80E10A0 + + thumb_func_start sub_80E10EC +sub_80E10EC: @ 80E10EC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _080E1154 + adds r4, r0 + movs r0, 0x4 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _080E1158 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + adds r0, r1 + ldr r3, [r0] + movs r0, 0xFF + str r0, [sp] + movs r0, 0x4 + movs r1, 0x26 + movs r2, 0x1 + bl PrintMoneyAmount + ldr r0, _080E115C + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _080E1160 + ldr r1, _080E1164 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_80E04A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E1154: .4byte 0x03005e08 +_080E1158: .4byte 0x02039f70 +_080E115C: .4byte 0x02021cc4 +_080E1160: .4byte 0x02021fc4 +_080E1164: .4byte 0x085e8da0 + thumb_func_end sub_80E10EC + + thumb_func_start sub_80E1168 +sub_80E1168: @ 80E1168 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _080E11A0 + ldr r0, _080E11A4 + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _080E11A8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080E11AC + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E11A0: .4byte 0x03005dac +_080E11A4: .4byte sub_80DFCE0 + 1 +_080E11A8: .4byte 0x03005e00 +_080E11AC: .4byte sub_80E11B0 + 1 + thumb_func_end sub_80E1168 + + thumb_func_start sub_80E11B0 +sub_80E11B0: @ 80E11B0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080E11DC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E11D6 + bl sub_80E53F4 + bl FreeShopItemNames + ldr r0, _080E11E0 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_080E11D6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E11DC: .4byte 0x02037fd4 +_080E11E0: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_80E11B0 + + thumb_func_start sub_80E11E4 +sub_80E11E4: @ 80E11E4 + push {lr} + ldr r0, _080E11FC + movs r1, 0 + strb r1, [r0] + ldr r0, _080E1200 + movs r1, 0 + movs r2, 0xC + bl memset + pop {r0} + bx r0 + .align 2, 0 +_080E11FC: .4byte 0x02039f7c +_080E1200: .4byte 0x02039f80 + thumb_func_end sub_80E11E4 + + thumb_func_start sub_80E1204 +sub_80E1204: @ 80E1204 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080E1240 + adds r4, r1, r0 + movs r3, 0 + ldr r5, _080E1244 + adds r6, r5, 0 +_080E121A: + lsls r0, r3, 2 + adds r2, r0, r6 + ldrh r1, [r2] + movs r7, 0xA + ldrsh r0, [r4, r7] + cmp r1, r0 + bne _080E1250 + ldrh r0, [r2, 0x2] + cmp r0, 0 + beq _080E1250 + adds r1, r0, 0 + movs r3, 0x2 + ldrsh r0, [r4, r3] + adds r0, r1, r0 + cmp r0, 0xFF + ble _080E1248 + movs r0, 0xFF + strh r0, [r2, 0x2] + b _080E127A + .align 2, 0 +_080E1240: .4byte 0x03005e08 +_080E1244: .4byte 0x02039f80 +_080E1248: + ldrh r0, [r4, 0x2] + adds r0, r1, r0 + strh r0, [r2, 0x2] + b _080E127A +_080E1250: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x2 + bls _080E121A + ldr r2, _080E1280 + ldrb r0, [r2] + cmp r0, 0x2 + bhi _080E127A + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0xA] + strh r1, [r0] + ldrb r0, [r2] + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_080E127A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E1280: .4byte 0x02039f7c + thumb_func_end sub_80E1204 + + thumb_func_start sub_80E1284 +sub_80E1284: @ 80E1284 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl CreateShopMainMenu + adds r0, r4, 0 + bl SetShopItemsForSale + bl sub_80E11E4 + ldr r0, _080E12A4 + bl SetShopMenuCallback + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E12A4: .4byte script_env_2_enable_and_set_ctx_running + 1 + thumb_func_end sub_80E1284 + + thumb_func_start sub_80E12A8 +sub_80E12A8: @ 80E12A8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl CreateShopMainMenu + adds r0, r4, 0 + bl SetShopItemsForSale + ldr r0, _080E12C4 + bl SetShopMenuCallback + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E12C4: .4byte script_env_2_enable_and_set_ctx_running + 1 + thumb_func_end sub_80E12A8 + + thumb_func_start sub_80E12C8 +sub_80E12C8: @ 80E12C8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + bl CreateShopMainMenu + adds r0, r4, 0 + bl SetShopItemsForSale + ldr r0, _080E12E4 + bl SetShopMenuCallback + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E12E4: .4byte script_env_2_enable_and_set_ctx_running + 1 + thumb_func_end sub_80E12C8 + + thumb_func_start sub_80E12E8 +sub_80E12E8: @ 80E12E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + ldr r2, _080E137C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r1, 0x12] + subs r0, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r4, [r1, 0xA] + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080E13AC + movs r2, 0 + lsls r5, 16 + str r5, [sp, 0xC] + lsls r0, r3, 16 + lsls r1, r4, 16 + asrs r0, 16 + str r0, [sp] + asrs r1, 16 + str r1, [sp, 0x4] + lsls r0, r1, 1 + mov r1, r9 + adds r7, r0, r1 +_080E133C: + movs r4, 0 + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + ldr r2, [sp] + adds r6, r2, r0 +_080E1348: + ldr r0, [sp, 0xC] + asrs r1, r0, 16 + lsls r4, 16 + asrs r0, r4, 16 + adds r5, r1, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl cur_mapdata_get_blockid_at + movs r2, 0 + ldrsh r1, [r7, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _080E1390 + ldr r0, [sp, 0x4] + cmp r0, 0x2 + beq _080E1380 + ldrh r0, [r7, 0x2] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl setmaptile_0 + b _080E1390 + .align 2, 0 +_080E137C: .4byte 0x03005e00 +_080E1380: + mov r1, r9 + ldrh r0, [r1] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl setmaptile_0 +_080E1390: + movs r2, 0x80 + lsls r2, 9 + adds r0, r4, r2 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E1348 + adds r0, r2, 0 + add r0, r8 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E133C + b _080E1434 +_080E13AC: + movs r2, 0 + lsls r5, 16 + str r5, [sp, 0xC] + lsls r0, r3, 16 + lsls r1, r4, 16 + asrs r0, 16 + str r0, [sp, 0x8] + asrs r7, r1, 16 +_080E13BC: + movs r4, 0 + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + ldr r1, [sp, 0x8] + adds r6, r1, r0 +_080E13C8: + ldr r2, [sp, 0xC] + asrs r1, r2, 16 + lsls r4, 16 + asrs r0, r4, 16 + adds r5, r1, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl cur_mapdata_get_blockid_at + movs r1, 0x2 + subs r1, r7 + lsls r1, 1 + add r1, r9 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _080E141A + cmp r7, 0x2 + beq _080E140A + movs r0, 0x1 + subs r0, r7 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl setmaptile_0 + b _080E141A +_080E140A: + mov r1, r9 + ldrh r0, [r1, 0x4] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl setmaptile_0 +_080E141A: + movs r2, 0x80 + lsls r2, 9 + adds r0, r4, r2 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E13C8 + adds r0, r2, 0 + add r0, r8 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E13BC +_080E1434: + 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_80E12E8 + + thumb_func_start sub_80E1444 +sub_80E1444: @ 80E1444 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, _080E146C + adds r4, r0, r1 + movs r0, 0x1 + strh r0, [r4, 0x6] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bhi _080E14DE + lsls r0, 2 + ldr r1, _080E1470 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E146C: .4byte 0x03005e08 +_080E1470: .4byte _080E1474 + .align 2, 0 +_080E1474: + .4byte _080E1490 + .4byte _080E1498 + .4byte _080E14A0 + .4byte _080E14A8 + .4byte _080E14B0 + .4byte _080E14C4 + .4byte _080E14D4 +_080E1490: + ldr r1, _080E1494 + b _080E14C6 + .align 2, 0 +_080E1494: .4byte 0x08589aba +_080E1498: + ldr r1, _080E149C + b _080E14C6 + .align 2, 0 +_080E149C: .4byte 0x08589ac0 +_080E14A0: + ldr r1, _080E14A4 + b _080E14B2 + .align 2, 0 +_080E14A4: .4byte 0x08589ac6 +_080E14A8: + ldr r1, _080E14AC + b _080E14C6 + .align 2, 0 +_080E14AC: .4byte 0x08589acc +_080E14B0: + ldr r1, _080E14C0 +_080E14B2: + movs r2, 0xC0 + lsls r2, 4 + adds r0, r3, 0 + bl sub_80E12E8 + b _080E14DE + .align 2, 0 +_080E14C0: .4byte 0x08589ad2 +_080E14C4: + ldr r1, _080E14D0 +_080E14C6: + adds r0, r3, 0 + movs r2, 0 + bl sub_80E12E8 + b _080E14DE + .align 2, 0 +_080E14D0: .4byte 0x08589ad8 +_080E14D4: + ldr r1, _080E1508 + adds r0, r3, 0 + movs r2, 0 + bl sub_80E12E8 +_080E14DE: + ldrh r0, [r4] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r4] + adds r5, r0, 0 + cmp r5, 0 + bne _080E1502 + bl cur_mapdata_full_redraw + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + strh r0, [r4, 0x2] + strh r5, [r4, 0x6] +_080E1502: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E1508: .4byte 0x08589ade + thumb_func_end sub_80E1444 + + thumb_func_start sub_80E150C +sub_80E150C: @ 80E150C + push {r4-r7,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r6, _080E1550 + adds r0, r6, 0 + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080E1554 + adds r7, r0, r1 + adds r0, r7, 0 + adds r0, 0x8 + adds r1, r7, 0 + adds r1, 0xA + bl player_get_pos_to + movs r0, 0 + strh r0, [r7] + strh r0, [r7, 0x2] + strh r5, [r7, 0x4] + adds r0, r4, 0 + bl _call_via_r6 + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080E1550: .4byte sub_80E1444 + 1 +_080E1554: .4byte 0x03005e08 + thumb_func_end sub_80E150C + + thumb_func_start sub_80E1558 +sub_80E1558: @ 80E1558 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E150C + ldr r1, _080E156C + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080E156C: .4byte 0x02039f8c + thumb_func_end sub_80E1558 + + thumb_func_start sub_80E1570 +sub_80E1570: @ 80E1570 + push {lr} + ldr r0, _080E1580 + ldrb r0, [r0] + bl remove_task + pop {r0} + bx r0 + .align 2, 0 +_080E1580: .4byte 0x02039f8c + thumb_func_end sub_80E1570 + + thumb_func_start sub_80E1584 +sub_80E1584: @ 80E1584 + push {lr} + ldr r2, _080E15A8 + ldr r0, _080E15AC + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080E15B0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x2 + bne _080E15B0 + movs r0, 0 + b _080E15B2 + .align 2, 0 +_080E15A8: .4byte 0x03005e00 +_080E15AC: .4byte 0x02039f8c +_080E15B0: + movs r0, 0x1 +_080E15B2: + pop {r1} + bx r1 + thumb_func_end sub_80E1584 + + thumb_func_start sub_80E15B8 +sub_80E15B8: @ 80E15B8 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, _080E15D8 + ldr r1, [r0] + ldr r0, _080E15DC + adds r1, r0 + ldr r2, _080E15E0 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080E15D8: .4byte 0x03005d8c +_080E15DC: .4byte 0x000031f8 +_080E15E0: .4byte 0x0100001a + thumb_func_end sub_80E15B8 + + thumb_func_start sub_80E15E4 +sub_80E15E4: @ 80E15E4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080E1608 + ldr r0, [r0] + ldr r1, _080E160C + adds r3, r0, r1 + movs r2, 0 +_080E15F2: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x33 + bls _080E15F2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E1608: .4byte 0x03005d8c +_080E160C: .4byte 0x000031f8 + thumb_func_end sub_80E15E4 + + thumb_func_start sub_80E1610 +sub_80E1610: @ 80E1610 + push {lr} + adds r3, r0, 0 + movs r2, 0 + movs r1, 0 +_080E1618: + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r0 + adds r1, 0x1 + cmp r1, 0x2F + bls _080E1618 + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80E1610 + + thumb_func_start sub_80E162C +sub_80E162C: @ 80E162C + push {r4,lr} + ldr r4, _080E1660 + ldr r1, [r4] + ldr r2, _080E1664 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E1674 + ldr r2, _080E1668 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E1674 + ldr r2, _080E166C + adds r0, r1, r2 + bl sub_80E1610 + ldr r1, [r4] + ldr r2, _080E1670 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _080E1674 + movs r0, 0x1 + b _080E1676 + .align 2, 0 +_080E1660: .4byte 0x03005d8c +_080E1664: .4byte 0x0000320c +_080E1668: .4byte 0x00003202 +_080E166C: .4byte 0x000031f8 +_080E1670: .4byte 0x00003228 +_080E1674: + movs r0, 0 +_080E1676: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E162C + + thumb_func_start sub_80E167C +sub_80E167C: @ 80E167C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2B + bne _080E16A0 + bl sub_80E162C + cmp r0, 0 + beq _080E16A0 + ldr r0, _080E1698 + ldr r0, [r0] + ldr r1, _080E169C + b _080E16B4 + .align 2, 0 +_080E1698: .4byte 0x03005d8c +_080E169C: .4byte 0x000031f8 +_080E16A0: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2A + bls _080E16AC + movs r4, 0x1 +_080E16AC: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, _080E16BC +_080E16B4: + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E16BC: .4byte 0x0858a654 + thumb_func_end sub_80E167C + + thumb_func_start sub_80E16C0 +sub_80E16C0: @ 80E16C0 + lsls r0, 24 + ldr r1, _080E16D4 + lsrs r0, 21 + ldr r2, _080E16D8 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_080E16D4: .4byte 0x03005d8c +_080E16D8: .4byte 0x0000169c + thumb_func_end sub_80E16C0 + + thumb_func_start sub_80E16DC +sub_80E16DC: @ 80E16DC + push {lr} + ldr r0, _080E1704 + ldrb r0, [r0] + bl sub_808F110 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E16C0 + adds r2, r0, 0 + ldrb r0, [r2, 0x1] + lsls r0, 25 + lsrs r0, 25 + cmp r0, 0x2 + beq _080E1718 + cmp r0, 0x2 + bgt _080E1708 + cmp r0, 0x1 + beq _080E1712 + b _080E172E + .align 2, 0 +_080E1704: .4byte 0x03005df0 +_080E1708: + cmp r0, 0x3 + beq _080E171E + cmp r0, 0x4 + beq _080E1724 + b _080E172E +_080E1712: + ldrb r0, [r2, 0x5] + movs r1, 0x10 + b _080E1728 +_080E1718: + ldrb r0, [r2, 0x5] + movs r1, 0x20 + b _080E1728 +_080E171E: + ldrb r0, [r2, 0x5] + movs r1, 0x40 + b _080E1728 +_080E1724: + ldrb r0, [r2, 0x5] + movs r1, 0x80 +_080E1728: + orrs r0, r1 + strb r0, [r2, 0x5] + b _080E1732 +_080E172E: + movs r0, 0 + b _080E1734 +_080E1732: + movs r0, 0x1 +_080E1734: + pop {r1} + bx r1 + thumb_func_end sub_80E16DC + + thumb_func_start sub_80E1738 +sub_80E1738: @ 80E1738 + push {lr} + bl sub_809D280 + ldr r1, _080E1760 + cmp r0, r1 + bne _080E1768 + ldr r0, _080E1764 + ldrb r0, [r0] + bl sub_808F110 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E19C8 + lsls r0, 24 + cmp r0, 0 + bne _080E1768 + movs r0, 0x1 + b _080E176A + .align 2, 0 +_080E1760: .4byte 0x082742f9 +_080E1764: .4byte 0x03005df0 +_080E1768: + movs r0, 0 +_080E176A: + pop {r1} + bx r1 + thumb_func_end sub_80E1738 + + thumb_func_start sub_80E1770 +sub_80E1770: @ 80E1770 + push {lr} + bl sub_809D280 + ldr r1, _080E1788 + cmp r0, r1 + bne _080E178C + bl sub_80E16DC + lsls r0, 24 + lsrs r0, 24 + b _080E178E + .align 2, 0 +_080E1788: .4byte 0x082742f9 +_080E178C: + movs r0, 0 +_080E178E: + pop {r1} + bx r1 + thumb_func_end sub_80E1770 + + thumb_func_start sub_80E1794 +sub_80E1794: @ 80E1794 + push {r4-r6,lr} + movs r2, 0 + ldr r6, _080E17BC + ldr r5, _080E17C0 + ldr r0, _080E17C4 + ldr r3, [r0] + ldr r4, [r0, 0x4] +_080E17A2: + ldr r0, [r6] + lsls r1, r2, 3 + adds r0, r1 + adds r0, r5 + str r3, [r0] + str r4, [r0, 0x4] + adds r2, 0x1 + cmp r2, 0x7F + ble _080E17A2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E17BC: .4byte 0x03005d8c +_080E17C0: .4byte 0x0000169c +_080E17C4: .4byte 0x0858abd0 + thumb_func_end sub_80E1794 + + thumb_func_start sub_80E17C8 +sub_80E17C8: @ 80E17C8 + push {r4,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080E17DA +_080E17D6: + movs r0, 0 + b _080E1866 +_080E17DA: + lsls r0, r1, 25 + lsrs r0, 25 + cmp r0, 0x5 + bhi _080E1864 + lsls r0, 2 + ldr r1, _080E17EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E17EC: .4byte _080E17F0 + .align 2, 0 +_080E17F0: + .4byte _080E17D6 + .4byte _080E1810 + .4byte _080E1810 + .4byte _080E1810 + .4byte _080E1808 + .4byte _080E1828 +_080E1808: + adds r0, r4, 0 + bl sub_80E1B38 + strb r0, [r4, 0x4] +_080E1810: + ldrb r2, [r4, 0x1] + lsls r1, r2, 25 + lsrs r1, 25 + adds r1, 0x1 + movs r0, 0x7F + ands r1, r0 + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + b _080E1864 +_080E1828: + ldrb r0, [r4, 0x5] + movs r1, 0x11 + negs r1, r1 + ands r1, r0 + movs r0, 0x21 + negs r0, r0 + ands r1, r0 + subs r0, 0x20 + ands r1, r0 + movs r0, 0x7F + ands r1, r0 + movs r0, 0 + strb r0, [r4, 0x4] + ldrb r2, [r4, 0x1] + subs r0, 0x80 + ands r0, r2 + movs r2, 0x2 + orrs r0, r2 + strb r0, [r4, 0x1] + adds r1, 0x1 + movs r0, 0xF + ands r1, r0 + strb r1, [r4, 0x5] + cmp r1, 0xA + bne _080E1864 + ldr r0, _080E186C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r4] + str r1, [r4, 0x4] +_080E1864: + movs r0, 0x1 +_080E1866: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E186C: .4byte 0x0858abd0 + thumb_func_end sub_80E17C8 + + thumb_func_start sub_80E1870 +sub_80E1870: @ 80E1870 + push {r4-r7,lr} + adds r6, r0, 0 + movs r2, 0 +_080E1876: + ldr r1, _080E18C0 + lsls r0, r2, 3 + ldr r3, _080E18C4 + adds r0, r3 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + adds r7, r2, 0x1 + cmp r0, 0 + beq _080E1910 + ldrb r1, [r4, 0x1] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0 + beq _080E1910 + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E1910 + ldrb r0, [r4] + bl sub_80E1B7C + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + subs r1, r0 + cmp r6, r1 + blt _080E18CC + ldr r0, _080E18C8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r4] + str r1, [r4, 0x4] + b _080E1910 + .align 2, 0 +_080E18C0: .4byte 0x03005d8c +_080E18C4: .4byte 0x0000169c +_080E18C8: .4byte 0x0858abd0 +_080E18CC: + adds r5, r6, 0 + cmp r5, 0 + beq _080E1910 + ldrh r1, [r4, 0x2] + cmp r1, r5 + ble _080E18DC + subs r0, r1, r5 + b _080E190E +_080E18DC: + subs r5, r1 + ldrb r0, [r4] + bl sub_80E1B7C + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80E17C8 + cmp r0, 0 + beq _080E1910 + ldrb r1, [r4, 0x1] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x5 + bne _080E1900 + ldrh r0, [r4, 0x2] + lsls r0, 2 + strh r0, [r4, 0x2] +_080E1900: + cmp r5, 0 + beq _080E1910 + ldrh r0, [r4, 0x2] + adds r1, r0, 0 + cmp r0, r5 + ble _080E18DC + subs r0, r5 +_080E190E: + strh r0, [r4, 0x2] +_080E1910: + adds r2, r7, 0 + cmp r2, 0x7F + ble _080E1876 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E1870 + + thumb_func_start sub_80E191C +sub_80E191C: @ 80E191C + push {r4-r7,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r7, r3, 24 + bl sub_80E16C0 + adds r6, r0, 0 + ldr r0, _080E1980 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r6] + str r1, [r6, 0x4] + strb r4, [r6] + adds r0, r4, 0 + bl sub_80E1B7C + strh r0, [r6, 0x2] + movs r1, 0x7F + ands r1, r5 + ldrb r2, [r6, 0x1] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + cmp r5, 0x5 + bne _080E196E + adds r0, r6, 0 + bl sub_80E1B38 + strb r0, [r6, 0x4] + ldrh r0, [r6, 0x2] + lsls r0, 2 + strh r0, [r6, 0x2] +_080E196E: + cmp r7, 0 + bne _080E197A + ldrb r0, [r6, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r6, 0x1] +_080E197A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E1980: .4byte 0x0858abd0 + thumb_func_end sub_80E191C + + thumb_func_start sub_80E1984 +sub_80E1984: @ 80E1984 + lsls r0, 24 + ldr r1, _080E19A0 + ldr r2, [r1] + lsrs r0, 21 + adds r2, r0 + ldr r0, _080E19A4 + adds r2, r0 + ldr r0, _080E19A8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_080E19A0: .4byte 0x03005d8c +_080E19A4: .4byte 0x0000169c +_080E19A8: .4byte 0x0858abd0 + thumb_func_end sub_80E1984 + + thumb_func_start sub_80E19AC +sub_80E19AC: @ 80E19AC + lsls r0, 24 + ldr r1, _080E19C0 + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + ldr r0, _080E19C4 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_080E19C0: .4byte 0x03005d8c +_080E19C4: .4byte 0x0000169c + thumb_func_end sub_80E19AC + + thumb_func_start sub_80E19C8 +sub_80E19C8: @ 80E19C8 + lsls r0, 24 + ldr r1, _080E19E0 + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + ldr r0, _080E19E4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 25 + lsrs r0, 25 + bx lr + .align 2, 0 +_080E19E0: .4byte 0x03005d8c +_080E19E4: .4byte 0x0000169d + thumb_func_end sub_80E19C8 + + thumb_func_start berryid_from_itemid +berryid_from_itemid: @ 80E19E8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, _080E1A04 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x2A + bhi _080E1A08 + adds r0, r1, 0 + adds r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + b _080E1A0A + .align 2, 0 +_080E1A04: .4byte 0xff7b0000 +_080E1A08: + movs r0, 0x1 +_080E1A0A: + pop {r1} + bx r1 + thumb_func_end berryid_from_itemid + + thumb_func_start sub_80E1A10 +sub_80E1A10: @ 80E1A10 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, _080E1A2C + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x2A + bhi _080E1A30 + adds r0, r1, 0 + adds r0, 0x84 + lsls r0, 16 + lsrs r0, 16 + b _080E1A32 + .align 2, 0 +_080E1A2C: .4byte 0xffff0000 +_080E1A30: + movs r0, 0x85 +_080E1A32: + pop {r1} + bx r1 + thumb_func_end sub_80E1A10 + + thumb_func_start sub_80E1A38 +sub_80E1A38: @ 80E1A38 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E167C + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x6 + bl memcpy + movs r0, 0xFF + strb r0, [r4, 0x6] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E1A38 + + thumb_func_start sub_80E1A58 +sub_80E1A58: @ 80E1A58 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E167C + adds r1, r0, 0 + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_80D66C4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E1A58 + + thumb_func_start sub_80E1A78 +sub_80E1A78: @ 80E1A78 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E16C0 + ldrb r2, [r0, 0x1] + movs r1, 0x7F + ands r1, r2 + strb r1, [r0, 0x1] + pop {r0} + bx r0 + thumb_func_end sub_80E1A78 + + thumb_func_start sub_80E1A90 +sub_80E1A90: @ 80E1A90 + push {lr} + ldrb r2, [r0, 0x5] + movs r0, 0x10 + ands r0, r2 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r1, r0, 31 + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _080E1AAA + adds r1, 0x1 +_080E1AAA: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _080E1AB8 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_080E1AB8: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080E1AC6 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_080E1AC6: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80E1A90 + + thumb_func_start sub_80E1ACC +sub_80E1ACC: @ 80E1ACC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E16C0 + bl sub_80E1A90 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80E1ACC + + thumb_func_start sub_80E1AE4 +sub_80E1AE4: @ 80E1AE4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + bne _080E1AFA + lsls r0, r6, 24 + b _080E1B2E +_080E1AFA: + subs r1, r0, r6 + subs r0, r2, 0x1 + adds r5, r1, 0 + muls r5, r0 + adds r4, r1, 0 + muls r4, r2 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + subs r4, r5 + adds r4, 0x1 + adds r1, r4, 0 + bl __umodsi3 + adds r5, r0 + movs r0, 0x3 + ands r0, r5 + cmp r0, 0x1 + bls _080E1B28 + lsrs r0, r5, 2 + adds r0, 0x1 + b _080E1B2A +_080E1B28: + lsrs r0, r5, 2 +_080E1B2A: + adds r0, r6 + lsls r0, 24 +_080E1B2E: + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80E1AE4 + + thumb_func_start sub_80E1B38 +sub_80E1B38: @ 80E1B38 + push {r4-r6,lr} + adds r4, r0, 0 + ldrb r0, [r4] + bl sub_80E167C + ldrb r6, [r0, 0xB] + ldrb r5, [r0, 0xA] + adds r0, r4, 0 + bl sub_80E1A90 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80E1AE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80E1B38 + + thumb_func_start sub_80E1B64 +sub_80E1B64: @ 80E1B64 + lsls r0, 24 + ldr r1, _080E1B78 + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + movs r0, 0xB5 + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_080E1B78: .4byte 0x03005d8c + thumb_func_end sub_80E1B64 + + thumb_func_start sub_80E1B7C +sub_80E1B7C: @ 80E1B7C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E167C + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 18 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80E1B7C + + thumb_func_start sub_80E1B94 +sub_80E1B94: @ 80E1B94 + push {r4-r6,lr} + ldr r0, _080E1BD0 + ldrb r0, [r0] + bl sub_808F110 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_80E19AC + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + bl sub_80E1A78 + ldr r0, _080E1BD4 + ldrb r0, [r0] + ldr r1, _080E1BD8 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_8092E9C + lsls r0, 24 + cmp r0, 0 + beq _080E1BE0 + ldr r1, _080E1BDC + movs r0, 0xFF + strh r0, [r1] + b _080E1BEE + .align 2, 0 +_080E1BD0: .4byte 0x03005df0 +_080E1BD4: .4byte 0x020375f2 +_080E1BD8: .4byte 0x03005d8c +_080E1BDC: .4byte 0x020375e0 +_080E1BE0: + ldr r4, _080E1C1C + adds r0, r5, 0 + bl sub_80E19C8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_080E1BEE: + ldr r4, _080E1C20 + adds r0, r5, 0 + bl sub_80E1ACC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r4, _080E1C24 + adds r0, r5, 0 + bl sub_80E1B64 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, _080E1C28 + ldrh r2, [r4] + adds r0, r6, 0 + bl sub_80E1A58 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E1C1C: .4byte 0x020375e0 +_080E1C20: .4byte 0x020375e2 +_080E1C24: .4byte 0x020375e4 +_080E1C28: .4byte 0x02021cc4 + thumb_func_end sub_80E1B94 + + thumb_func_start sub_80E1C2C +sub_80E1C2C: @ 80E1C2C + push {lr} + ldr r0, _080E1C4C + ldrb r0, [r0] + bl sub_808F110 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E19AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E1C50 + bl sub_80E1A38 + pop {r0} + bx r0 + .align 2, 0 +_080E1C4C: .4byte 0x03005df0 +_080E1C50: .4byte 0x02021cc4 + thumb_func_end sub_80E1C2C + + thumb_func_start sub_80E1C54 +sub_80E1C54: @ 80E1C54 + push {r4,r5,lr} + ldr r0, _080E1C8C + ldrb r0, [r0] + bl sub_808F110 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80E19AC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + bl sub_80E1B64 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, _080E1C90 + adds r0, r5, 0 + bl sub_80E1A58 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E1C8C: .4byte 0x03005df0 +_080E1C90: .4byte 0x02021cc4 + thumb_func_end sub_80E1C54 + + thumb_func_start sub_80E1C94 +sub_80E1C94: @ 80E1C94 + push {lr} + ldr r0, _080E1CA0 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080E1CA0: .4byte c2_810A554 + 1 + thumb_func_end sub_80E1C94 + + thumb_func_start sub_80E1CA4 +sub_80E1CA4: @ 80E1CA4 + push {r4,lr} + ldr r0, _080E1CD4 + ldrh r0, [r0] + bl berryid_from_itemid + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080E1CD8 + ldrb r0, [r0] + bl sub_808F110 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80E191C + bl sub_80E1B94 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E1CD4: .4byte 0x0203ce7c +_080E1CD8: .4byte 0x03005df0 + thumb_func_end sub_80E1CA4 + + thumb_func_start sub_80E1CDC +sub_80E1CDC: @ 80E1CDC + push {r4-r6,lr} + ldr r0, _080E1D20 + ldrb r0, [r0] + bl sub_808F110 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_80E19AC + lsls r0, 24 + lsrs r0, 24 + ldr r6, _080E1D24 + bl sub_80E1A10 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl sub_80E1B64 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E1D20: .4byte 0x03005df0 +_080E1D24: .4byte 0x020375e0 + thumb_func_end sub_80E1CDC + + thumb_func_start sub_80E1D28 +sub_80E1D28: @ 80E1D28 + push {lr} + ldr r0, _080E1D50 + ldrb r0, [r0] + bl sub_808F110 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E1984 + ldr r0, _080E1D54 + ldrb r0, [r0] + ldr r1, _080E1D58 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_8092EF0 + pop {r0} + bx r0 + .align 2, 0 +_080E1D50: .4byte 0x03005df0 +_080E1D54: .4byte 0x020375f2 +_080E1D58: .4byte 0x03005d8c + thumb_func_end sub_80E1D28 + + thumb_func_start sub_80E1D5C +sub_80E1D5C: @ 80E1D5C + push {lr} + movs r0, 0x4 + bl sub_80D66EC + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80E1D5C + + thumb_func_start sub_80E1D6C +sub_80E1D6C: @ 80E1D6C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_8088B80 + mov r0, sp + ldrh r2, [r0] + ldrh r1, [r4] + adds r1, 0x3 + adds r3, r2, 0 + adds r3, 0xE + lsls r1, 16 + movs r5, 0x80 + lsls r5, 12 + adds r0, r1, r5 + lsrs r0, 16 + mov r10, r0 + mov r5, sp + lsls r2, 16 + asrs r2, 16 + mov r9, r2 + ldr r4, _080E1E04 + lsls r3, 16 + asrs r3, 16 + mov r8, r3 + asrs r7, r1, 16 + movs r6, 0xF +_080E1DB0: + ldrb r0, [r4] + lsls r0, 31 + cmp r0, 0 + beq _080E1DEC + ldrb r0, [r4, 0x6] + cmp r0, 0xC + bne _080E1DEC + ldrh r0, [r4, 0x10] + strh r0, [r5] + ldrh r0, [r4, 0x12] + mov r1, sp + strh r0, [r1, 0x2] + movs r2, 0 + ldrsh r1, [r5, r2] + cmp r9, r1 + bgt _080E1DEC + cmp r1, r8 + bgt _080E1DEC + lsls r0, 16 + asrs r1, r0, 16 + cmp r7, r1 + bgt _080E1DEC + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + bgt _080E1DEC + ldrb r0, [r4, 0x1D] + bl sub_80E1A78 +_080E1DEC: + adds r4, 0x24 + subs r6, 0x1 + cmp r6, 0 + bge _080E1DB0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E1E04: .4byte 0x02037350 + thumb_func_end sub_80E1D6C + + thumb_func_start sub_80E1E08 +sub_80E1E08: @ 80E1E08 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r0, _080E1E44 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E1E4C + ldr r0, _080E1E48 + movs r1, 0xFF + strh r1, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80E1EFC + movs r0, 0x1 + b _080E1E4E + .align 2, 0 +_080E1E44: .4byte sub_80E2058 + 1 +_080E1E48: .4byte 0x020375f0 +_080E1E4C: + movs r0, 0 +_080E1E4E: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E1E08 + + thumb_func_start sub_80E1E58 +sub_80E1E58: @ 80E1E58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r4, [sp, 0x1C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080E1EA0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E1EA8 + ldr r1, _080E1EA4 + movs r0, 0xFF + strh r0, [r1] + str r4, [sp] + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80E1EFC + movs r0, 0x1 + b _080E1EAA + .align 2, 0 +_080E1EA0: .4byte sub_80E2058 + 1 +_080E1EA4: .4byte 0x020375f0 +_080E1EA8: + movs r0, 0 +_080E1EAA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E1E58 + + thumb_func_start sub_80E1EB8 +sub_80E1EB8: @ 80E1EB8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + b _080E1EEC +_080E1EC0: + cmp r1, 0xFD + bne _080E1EE4 + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0x1 + bne _080E1EEC + ldr r0, _080E1EE0 + ldr r0, [r0] + bl sub_8008C24 + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + b _080E1EEC + .align 2, 0 +_080E1EE0: .4byte 0x03005d90 +_080E1EE4: + adds r4, 0x1 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080E1EEC: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _080E1EC0 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E1EB8 + + thumb_func_start sub_80E1EFC +sub_80E1EFC: @ 80E1EFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + ldr r1, _080E1FB8 + lsls r0, r2, 3 + adds r0, r1 + ldrb r6, [r0, 0x4] + ldr r0, [r0] + mov r8, r0 + movs r1, 0 + cmp r1, r6 + bge _080E1F4C + mov r5, r8 + adds r4, r6, 0 +_080E1F3C: + ldr r0, [r5] + bl display_text_and_get_width + adds r1, r0, 0 + adds r5, 0x8 + subs r4, 0x1 + cmp r4, 0 + bne _080E1F3C +_080E1F4C: + adds r0, r1, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r7, r0, 24 + lsls r3, r6, 25 + lsrs r3, 24 + adds r0, r7, 0 + mov r1, r9 + adds r2, r4, 0 + bl CreateWindowFromRect + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r8 + bl PrintMenuTable + adds r0, r4, 0 + adds r1, r6, 0 + ldr r2, [sp, 0x4] + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [sp] + adds r1, r6, 0 + adds r2, r4, 0 + mov r3, r10 + bl sub_80E1FBC + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E1FB8: .4byte 0x0858b760 + thumb_func_end sub_80E1EFC + + thumb_func_start sub_80E1FBC +sub_80E1FBC: @ 80E1FBC + 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 r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r1, _080E201C + movs r0, 0x2 + strb r0, [r1] + movs r2, 0 + ldr r6, _080E2020 + ldr r5, _080E2024 + movs r3, 0xC +_080E1FE6: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r4 + bne _080E1FF0 + strb r3, [r1] +_080E1FF0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _080E1FE6 + adds r0, r6, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080E2028 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + mov r0, r8 + strh r0, [r1, 0x10] + cmp r7, 0x3 + bls _080E202C + movs r0, 0x1 + b _080E202E + .align 2, 0 +_080E201C: .4byte 0x02039f90 +_080E2020: .4byte sub_80E2058 + 1 +_080E2024: .4byte 0x0858bb68 +_080E2028: .4byte 0x03005e00 +_080E202C: + movs r0, 0 +_080E202E: + strh r0, [r1, 0x12] + ldr r1, _080E2054 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + mov r1, r9 + strh r1, [r0, 0x14] + strh r4, [r0, 0x16] + adds r0, r4, 0 + bl sub_80E2A94 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E2054: .4byte 0x03005e00 + thumb_func_end sub_80E1FBC + + thumb_func_start sub_80E2058 +sub_80E2058: @ 80E2058 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _080E2084 + adds r5, r0, r1 + ldr r0, _080E2088 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E20FC + ldr r1, _080E208C + ldrb r0, [r1] + cmp r0, 0 + beq _080E2090 + subs r0, 0x1 + strb r0, [r1] + b _080E20FC + .align 2, 0 +_080E2084: .4byte 0x03005e08 +_080E2088: .4byte 0x02037fd4 +_080E208C: .4byte 0x02039f90 +_080E2090: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E209E + bl ProcessMenuInputNoWrapAround + b _080E20A2 +_080E209E: + bl ProcessMenuInput +_080E20A2: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080E20E0 + ldrh r1, [r0, 0x2E] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080E20B8 + ldrb r0, [r5, 0xE] + bl sub_80E2A94 +_080E20B8: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080E20FC + adds r0, 0x1 + cmp r1, r0 + bne _080E20E8 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E20FC + movs r0, 0x5 + bl audio_play + ldr r1, _080E20E4 + movs r0, 0x7F + strh r0, [r1] + b _080E20EC + .align 2, 0 +_080E20E0: .4byte 0x030022c0 +_080E20E4: .4byte 0x020375f0 +_080E20E8: + ldr r0, _080E2104 + strh r1, [r0] +_080E20EC: + ldrb r0, [r5, 0xC] + bl sub_80E2A78 + adds r0, r6, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080E20FC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E2104: .4byte 0x020375f0 + thumb_func_end sub_80E2058 + + thumb_func_start yes_no_box +yes_no_box: @ 80E2108 + push {r4,lr} + ldr r4, _080E2130 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2138 + ldr r1, _080E2134 + movs r0, 0xFF + strh r0, [r1] + bl sub_8197930 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + movs r0, 0x1 + b _080E213A + .align 2, 0 +_080E2130: .4byte task_yes_no_maybe + 1 +_080E2134: .4byte 0x020375f0 +_080E2138: + movs r0, 0 +_080E213A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end yes_no_box + + thumb_func_start sub_80E2140 +sub_80E2140: @ 80E2140 + push {lr} + ldr r0, _080E2150 + ldrh r0, [r0] + cmp r0, 0xFF + beq _080E2154 + movs r0, 0x1 + b _080E2156 + .align 2, 0 +_080E2150: .4byte 0x020375f0 +_080E2154: + movs r0, 0 +_080E2156: + pop {r1} + bx r1 + thumb_func_end sub_80E2140 + + thumb_func_start task_yes_no_maybe +task_yes_no_maybe: @ 80E215C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080E217C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x4 + bgt _080E2180 + adds r0, r2, 0x1 + strh r0, [r1, 0xC] + b _080E21C4 + .align 2, 0 +_080E217C: .4byte 0x03005e00 +_080E2180: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080E21A4 + cmp r1, r0 + bgt _080E219C + subs r0, 0x1 + cmp r1, r0 + beq _080E21C4 + b _080E21BA +_080E219C: + cmp r1, 0 + beq _080E21B4 + cmp r1, 0x1 + bne _080E21BA +_080E21A4: + movs r0, 0x5 + bl audio_play + ldr r1, _080E21B0 + movs r0, 0 + b _080E21B8 + .align 2, 0 +_080E21B0: .4byte 0x020375f0 +_080E21B4: + ldr r1, _080E21CC + movs r0, 0x1 +_080E21B8: + strh r0, [r1] +_080E21BA: + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080E21C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E21CC: .4byte 0x020375f0 + thumb_func_end task_yes_no_maybe + + thumb_func_start sub_80E21D0 +sub_80E21D0: @ 80E21D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, [sp, 0x30] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + ldr r0, _080E220C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2210 + movs r0, 0 + b _080E22E8 + .align 2, 0 +_080E220C: .4byte sub_80E2308 + 1 +_080E2210: + ldr r0, _080E22F8 + movs r1, 0xFF + strh r1, [r0] + movs r2, 0 + movs r6, 0 + ldr r1, _080E22FC + lsls r5, 3 + adds r0, r5, r1 + str r5, [sp, 0xC] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bge _080E2246 + mov r8, r1 +_080E222A: + mov r0, r8 + adds r4, r5, r0 + ldr r1, [r4] + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + bl display_text_and_get_width + adds r2, r0, 0 + adds r6, 0x1 + ldrb r4, [r4, 0x4] + cmp r6, r4 + blt _080E222A +_080E2246: + adds r0, r2, 0 + bl convert_pixel_width_to_tile_width + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r1, r10 + muls r1, r5 + mov r8, r1 + adds r0, r7, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _080E22FC + mov r9, r2 + ldr r0, [sp, 0xC] + add r9, r0 + mov r1, r9 + ldrb r0, [r1, 0x4] + mov r1, r10 + bl __udivsi3 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _080E2300 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E2304 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + mov r2, sp + ldrh r2, [r2, 0x8] + strh r2, [r4, 0x10] + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, r6, 25 + lsrs r3, 24 + adds r0, r7, 0 + ldr r1, [sp, 0x4] + mov r2, r8 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4, 0x14] + lsls r5, 27 + lsrs r5, 24 + mov r2, r9 + ldr r1, [r2] + str r1, [sp] + adds r1, r5, 0 + mov r2, r10 + adds r3, r6, 0 + bl sub_81997AC + ldrb r0, [r4, 0x14] + movs r1, 0 + str r1, [sp] + adds r1, r5, 0 + mov r2, r10 + adds r3, r6, 0 + bl sub_8199944 + ldrb r0, [r4, 0x14] + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 +_080E22E8: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080E22F8: .4byte 0x020375f0 +_080E22FC: .4byte 0x0858b760 +_080E2300: .4byte sub_80E2308 + 1 +_080E2304: .4byte 0x03005e00 + thumb_func_end sub_80E21D0 + + thumb_func_start sub_80E2308 +sub_80E2308: @ 80E2308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080E2344 + adds r5, r0, r1 + bl sub_8199334 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080E2360 + adds r0, 0x1 + cmp r1, r0 + bne _080E234C + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E2360 + movs r0, 0x5 + bl audio_play + ldr r1, _080E2348 + movs r0, 0x7F + strh r0, [r1] + b _080E2350 + .align 2, 0 +_080E2344: .4byte 0x03005e08 +_080E2348: .4byte 0x020375f0 +_080E234C: + ldr r0, _080E2368 + strh r1, [r0] +_080E2350: + ldrb r0, [r5, 0xC] + bl sub_80E2A78 + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080E2360: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E2368: .4byte 0x020375f0 + thumb_func_end sub_80E2308 + + thumb_func_start sp109_CreatePCMenu +sp109_CreatePCMenu: @ 80E236C + push {lr} + ldr r0, _080E238C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2394 + ldr r1, _080E2390 + movs r0, 0xFF + strh r0, [r1] + bl CreatePCMenu + movs r0, 0x1 + b _080E2396 + .align 2, 0 +_080E238C: .4byte sub_80E2058 + 1 +_080E2390: .4byte 0x020375f0 +_080E2394: + movs r0, 0 +_080E2396: + pop {r1} + bx r1 + thumb_func_end sp109_CreatePCMenu + + thumb_func_start CreatePCMenu +CreatePCMenu: @ 80E239C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + movs r7, 0x8 + movs r5, 0 + movs r4, 0 + ldr r6, _080E2438 +_080E23AC: + ldm r6!, {r0} + adds r1, r5, 0 + bl display_text_and_get_width + adds r5, r0, 0 + adds r4, 0x1 + cmp r4, 0x3 + bls _080E23AC + ldr r6, _080E243C + adds r0, r6, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080E23D4 + ldr r0, _080E2440 + adds r1, r5, 0 + bl display_text_and_get_width + adds r5, r0, 0 +_080E23D4: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + bl flag_check + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080E2448 + movs r0, 0x4 + mov r8, r0 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x8 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r2, _080E2440 + movs r0, 0x21 + str r0, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print + ldr r2, _080E2444 + movs r0, 0x31 + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print + b _080E247A + .align 2, 0 +_080E2438: .4byte 0x0858bb70 +_080E243C: .4byte 0x00000864 +_080E2440: .4byte 0x085eb18b +_080E2444: .4byte 0x085eb198 +_080E2448: + movs r0, 0x3 + mov r8, r0 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x6 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r2, _080E24A4 + movs r0, 0x21 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r5, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print +_080E247A: + ldr r0, _080E24A8 + bl flag_check + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080E24B0 + ldr r2, _080E24AC + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print + b _080E24C6 + .align 2, 0 +_080E24A4: .4byte 0x085eb198 +_080E24A8: .4byte 0x000008ab +_080E24AC: .4byte 0x085eb176 +_080E24B0: + ldr r2, _080E2508 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r1, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print +_080E24C6: + ldr r4, _080E250C + ldr r1, _080E2510 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r7, 0 + movs r3, 0x11 + bl sub_819A024 + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + adds r0, r6, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0 + mov r1, r8 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_80E1FBC + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E2508: .4byte 0x085eb169 +_080E250C: .4byte 0x02021fc4 +_080E2510: .4byte 0x085eb183 + thumb_func_end CreatePCMenu + + thumb_func_start sub_80E2514 +sub_80E2514: @ 80E2514 + push {lr} + sub sp, 0x10 + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + ldr r2, _080E2544 + 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 text_box_related_one + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_080E2544: .4byte 0x0827266f + thumb_func_end sub_80E2514 + + thumb_func_start sub_80E2548 +sub_80E2548: @ 80E2548 + push {lr} + ldr r0, _080E2568 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2570 + ldr r1, _080E256C + movs r0, 0xFF + strh r0, [r1] + bl sub_80E2578 + movs r0, 0x1 + b _080E2572 + .align 2, 0 +_080E2568: .4byte sub_80E2058 + 1 +_080E256C: .4byte 0x020375f0 +_080E2570: + movs r0, 0 +_080E2572: + pop {r1} + bx r1 + thumb_func_end sub_80E2548 + + thumb_func_start sub_80E2578 +sub_80E2578: @ 80E2578 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + movs r5, 0 + movs r4, 0 + ldr r3, _080E2780 + movs r2, 0xFF +_080E258A: + adds r0, r4, r3 + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080E258A + movs r0, 0x1 + movs r1, 0 + bl fbox_get_field + ldr r0, _080E2784 + ldrh r1, [r0] + cmp r1, 0 + bne _080E25D2 + ldr r4, _080E2780 + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0xE8 + lsls r0, 1 + bl flag_check + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080E25D2 + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E25D2: + ldr r0, _080E2788 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2630 + ldr r0, _080E278C + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2630 + ldr r2, _080E2784 + ldrh r0, [r2] + cmp r0, 0 + bne _080E2606 + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2606: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E2630 + movs r4, 0xD7 + lsls r4, 1 + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080E2630 + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl flag_set +_080E2630: + movs r0, 0xB9 + lsls r0, 1 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2690 + movs r0, 0x8E + lsls r0, 4 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2690 + ldr r2, _080E2784 + ldrh r0, [r2] + cmp r0, 0 + bne _080E2668 + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2668: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E2690 + ldr r4, _080E2790 + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080E2690 + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl flag_set +_080E2690: + ldr r0, _080E2794 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E26EC + ldr r0, _080E2798 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E26EC + ldr r2, _080E2784 + ldrh r0, [r2] + cmp r0, 0 + bne _080E26C4 + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E26C4: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E26EC + ldr r4, _080E279C + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080E26EC + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl flag_set +_080E26EC: + movs r0, 0xBC + lsls r0, 1 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E274C + ldr r0, _080E27A0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E274C + ldr r2, _080E2784 + ldrh r0, [r2] + cmp r0, 0 + bne _080E2722 + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x5 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2722: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E274C + movs r4, 0xD8 + lsls r4, 1 + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080E274C + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x5 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl flag_set +_080E274C: + ldr r0, _080E2780 + adds r0, r5, r0 + movs r1, 0x6 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080E2784 + ldrh r0, [r0] + cmp r0, 0 + bne _080E276E + movs r0, 0xE8 + lsls r0, 1 + bl flag_check + lsls r0, 24 + lsrs r0, 24 +_080E276E: + adds r7, r5, 0 + cmp r7, 0x7 + bne _080E27A4 + ldr r1, _080E2784 + movs r0, 0xB + strh r0, [r1] + bl sub_813A128 + b _080E2860 + .align 2, 0 +_080E2780: .4byte 0x03001124 +_080E2784: .4byte 0x020375e0 +_080E2788: .4byte 0x00000113 +_080E278C: .4byte 0x000008b3 +_080E2790: .4byte 0x000001db +_080E2794: .4byte 0x00000173 +_080E2798: .4byte 0x000008d5 +_080E279C: .4byte 0x000001af +_080E27A0: .4byte 0x000008d6 +_080E27A4: + movs r1, 0 + movs r4, 0 + lsls r6, r7, 25 + subs r0, r7, 0x1 + mov r9, r0 + ldr r5, _080E2870 +_080E27B0: + ldr r0, _080E2874 + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E27C6 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + bl display_text_and_get_width + adds r1, r0, 0 +_080E27C6: + adds r4, 0x1 + cmp r4, 0x6 + bls _080E27B0 + adds r0, r1, 0 + bl convert_pixel_width_to_tile_width + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1C + subs r0, r2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x6 + subs r1, r7 + lsls r1, 25 + lsrs r1, 24 + lsrs r3, r6, 24 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r5, 0 + movs r4, 0 + ldr r0, _080E2870 + mov r8, r0 +_080E2802: + ldr r0, _080E2874 + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _080E2834 + lsls r0, 2 + add r0, r8 + ldr r2, [r0] + lsls r0, r5, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2834: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080E2802 + mov r0, r9 + lsls r2, r0, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r7, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + adds r0, r6, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0 + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0x8 + bl sub_80E1FBC +_080E2860: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E2870: .4byte 0x0858bb80 +_080E2874: .4byte 0x03001124 + thumb_func_end sub_80E2578 + + thumb_func_start sub_80E2878 +sub_80E2878: @ 80E2878 + push {lr} + ldr r2, _080E2890 + ldrh r0, [r2] + cmp r0, 0x7F + beq _080E288C + ldr r0, _080E2894 + ldrh r1, [r2] + adds r1, r0 + ldrb r0, [r1] + strh r0, [r2] +_080E288C: + pop {r0} + bx r0 + .align 2, 0 +_080E2890: .4byte 0x020375f0 +_080E2894: .4byte 0x03001124 + thumb_func_end sub_80E2878 + + thumb_func_start task_picbox +task_picbox: @ 80E2898 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080E28BC + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080E28F8 + cmp r0, 0x1 + bgt _080E28C0 + cmp r0, 0 + beq _080E28DE + b _080E28F8 + .align 2, 0 +_080E28BC: .4byte 0x03005e00 +_080E28C0: + cmp r0, 0x2 + beq _080E28CA + cmp r0, 0x3 + beq _080E28EC + b _080E28F8 +_080E28CA: + movs r0, 0xC + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E28E8 + adds r0, r1 + ldrb r1, [r4, 0xC] + bl sub_80B6070 +_080E28DE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080E28F8 + .align 2, 0 +_080E28E8: .4byte 0x02020630 +_080E28EC: + ldrb r0, [r4, 0x12] + bl sub_80E2A78 + adds r0, r5, 0 + bl remove_task +_080E28F8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_picbox + + thumb_func_start sub_80E2900 +sub_80E2900: @ 80E2900 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r4, _080E29A8 + adds r0, r4, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080E29B8 + lsls r1, r7, 19 + movs r0, 0xA0 + lsls r0, 14 + adds r1, r0 + asrs r1, 16 + lsls r2, r6, 19 + adds r2, r0 + asrs r2, 16 + mov r0, r8 + movs r3, 0 + bl sub_80B5F84 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x8 + movs r3, 0x8 + bl CreateWindowFromRect + ldr r1, _080E29AC + lsls r3, r4, 2 + adds r3, r4 + lsls r3, 3 + adds r3, r1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r3, 0x12] + strh r1, [r3, 0x8] + mov r0, r8 + strh r0, [r3, 0xA] + strh r5, [r3, 0xC] + ldr r4, _080E29B0 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, _080E29B4 + str r2, [r0] + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r0, [r3, 0x12] + movs r1, 0x1 + bl SetStandardWindowBorderStyle + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + b _080E29BA + .align 2, 0 +_080E29A8: .4byte task_picbox + 1 +_080E29AC: .4byte 0x03005e00 +_080E29B0: .4byte 0x02020630 +_080E29B4: .4byte nullsub_12 + 1 +_080E29B8: + movs r0, 0 +_080E29BA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E2900 + + thumb_func_start picbox_close +picbox_close: @ 80E29C4 + push {lr} + ldr r0, _080E29E8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080E29F4 + ldr r0, _080E29EC + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r0, _080E29F0 + b _080E29F6 + .align 2, 0 +_080E29E8: .4byte task_picbox + 1 +_080E29EC: .4byte 0x03005e00 +_080E29F0: .4byte sub_80E29FC + 1 +_080E29F4: + movs r0, 0 +_080E29F6: + pop {r1} + bx r1 + thumb_func_end picbox_close + + thumb_func_start sub_80E29FC +sub_80E29FC: @ 80E29FC + push {lr} + ldr r0, _080E2A10 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080E2A14 + movs r0, 0 + b _080E2A16 + .align 2, 0 +_080E2A10: .4byte task_picbox + 1 +_080E2A14: + movs r0, 0x1 +_080E2A16: + pop {r1} + bx r1 + thumb_func_end sub_80E29FC + + thumb_func_start CreateWindowFromRect +CreateWindowFromRect: @ 80E2A1C + push {r4,r5,lr} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsls r5, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + adds r5, r0 + lsrs r5, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl Window_AddFromTemplate + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end CreateWindowFromRect + + thumb_func_start sub_80E2A78 +sub_80E2A78: @ 80E2A78 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8198070 + adds r0, r4, 0 + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E2A78 + + thumb_func_start sub_80E2A94 +sub_80E2A94: @ 80E2A94 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x4A + cmp r0, 0x5 + bhi _080E2B70 + lsls r0, 2 + ldr r1, _080E2AAC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E2AAC: .4byte _080E2AB0 + .align 2, 0 +_080E2AB0: + .4byte _080E2B40 + .4byte _080E2B08 + .4byte _080E2AD8 + .4byte _080E2AC8 + .4byte _080E2AE8 + .4byte _080E2AF8 +_080E2AC8: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _080E2AD4 + b _080E2B12 + .align 2, 0 +_080E2AD4: .4byte 0x0858bbac +_080E2AD8: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _080E2AE4 + b _080E2B12 + .align 2, 0 +_080E2AE4: .4byte 0x0858bb9c +_080E2AE8: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _080E2AF4 + b _080E2B12 + .align 2, 0 +_080E2AF4: .4byte 0x0858bbbc +_080E2AF8: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _080E2B04 + b _080E2B12 + .align 2, 0 +_080E2B04: .4byte 0x0858bbcc +_080E2B08: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _080E2B3C +_080E2B12: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r2, [r0] + 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 text_box_related_one + b _080E2B70 + .align 2, 0 +_080E2B3C: .4byte 0x0858bbec +_080E2B40: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _080E2B78 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r2, [r0] + 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 text_box_related_one +_080E2B70: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E2B78: .4byte 0x0858bbe0 + thumb_func_end sub_80E2A94 + + thumb_func_start sp106_CreateStartMenu +sp106_CreateStartMenu: @ 80E2B7C + push {lr} + ldr r0, _080E2B9C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2BA4 + ldr r1, _080E2BA0 + movs r0, 0xFF + strh r0, [r1] + bl CreateStartMenu + movs r0, 0x1 + b _080E2BA6 + .align 2, 0 +_080E2B9C: .4byte sub_80E2058 + 1 +_080E2BA0: .4byte 0x020375f0 +_080E2BA4: + movs r0, 0 +_080E2BA6: + pop {r1} + bx r1 + thumb_func_end sp106_CreateStartMenu + + thumb_func_start CreateStartMenu +CreateStartMenu: @ 80E2BAC + push {r4-r6,lr} + sub sp, 0xC + movs r0, 0x15 + movs r1, 0 + movs r2, 0x7 + movs r3, 0x12 + bl CreateWindowFromRect + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r2, _080E2CA4 + movs r0, 0x9 + str r0, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, _080E2CA8 + movs r0, 0x19 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, _080E2CAC + movs r0, 0x29 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, _080E2CB0 + movs r0, 0x39 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, _080E2CB4 + ldr r2, [r0] + movs r0, 0x49 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, _080E2CB8 + movs r0, 0x59 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, _080E2CBC + movs r0, 0x69 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, _080E2CC0 + movs r0, 0x79 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0x10 + str r0, [sp] + movs r0, 0x8 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x9 + bl sub_81983AC + movs r0, 0 + movs r1, 0x8 + adds r2, r4, 0 + movs r3, 0x56 + bl sub_80E2CC4 + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E2CA4: .4byte 0x085eb25c +_080E2CA8: .4byte 0x085eb264 +_080E2CAC: .4byte 0x085eb26c +_080E2CB0: .4byte 0x085eb270 +_080E2CB4: .4byte 0x03005d90 +_080E2CB8: .4byte 0x085eb279 +_080E2CBC: .4byte 0x085eb27e +_080E2CC0: .4byte 0x085eb285 + thumb_func_end CreateStartMenu + + thumb_func_start sub_80E2CC4 +sub_80E2CC4: @ 80E2CC4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, _080E2D04 + movs r0, 0x2 + strb r0, [r1] + ldr r0, _080E2D08 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E2D0C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x10] + strh r0, [r1, 0x12] + strh r5, [r1, 0x14] + strh r6, [r1, 0x16] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E2D04: .4byte 0x02039f90 +_080E2D08: .4byte sub_80E2058 + 1 +_080E2D0C: .4byte 0x03005e00 + thumb_func_end sub_80E2CC4 + + thumb_func_start display_text_and_get_width_internal +display_text_and_get_width_internal: @ 80E2D10 + push {lr} + sub sp, 0x40 + adds r1, r0, 0 + mov r0, sp + bl ExpandTextCodes + movs r0, 0x1 + mov r1, sp + movs r2, 0 + bl font_get_width_of_string + add sp, 0x40 + pop {r1} + bx r1 + thumb_func_end display_text_and_get_width_internal + + thumb_func_start display_text_and_get_width +display_text_and_get_width: @ 80E2D2C + push {r4,lr} + adds r4, r1, 0 + bl display_text_and_get_width_internal + cmp r0, r4 + bge _080E2D3A + adds r0, r4, 0 +_080E2D3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end display_text_and_get_width + + thumb_func_start convert_pixel_width_to_tile_width +convert_pixel_width_to_tile_width: @ 80E2D40 + push {lr} + adds r1, r0, 0 + adds r0, 0x9 + cmp r0, 0 + bge _080E2D4C + adds r0, 0x7 +_080E2D4C: + asrs r0, 3 + adds r0, 0x1 + cmp r0, 0x1C + ble _080E2D56 + movs r0, 0x1C +_080E2D56: + pop {r1} + bx r1 + thumb_func_end convert_pixel_width_to_tile_width + + thumb_func_start sub_80E2D5C +sub_80E2D5C: @ 80E2D5C + push {lr} + adds r2, r0, 0 + adds r0, r2, r1 + cmp r0, 0x1C + ble _080E2D70 + movs r0, 0x1C + subs r2, r0, r1 + cmp r2, 0 + bge _080E2D70 + movs r2, 0 +_080E2D70: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80E2D5C + + thumb_func_start do_choose_name_or_words_screen +do_choose_name_or_words_screen: @ 80E2D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r5, r2, 16 + lsls r3, 16 + lsrs r6, r3, 16 + ldr r4, _080E2DA4 + movs r0, 0xF2 + lsls r0, 5 + bl malloc + str r0, [r4] + cmp r0, 0 + bne _080E2DA8 + ldr r0, [sp, 0x1C] + bl set_callback2 + b _080E2DE2 + .align 2, 0 +_080E2DA4: .4byte 0x02039f94 +_080E2DA8: + ldr r1, _080E2DEC + adds r0, r1 + strb r7, [r0] + ldr r0, [r4] + ldr r2, _080E2DF0 + adds r1, r0, r2 + strh r5, [r1] + adds r2, 0x2 + adds r1, r0, r2 + strh r6, [r1] + ldr r1, _080E2DF4 + adds r2, r0, r1 + ldr r1, [sp, 0x18] + str r1, [r2] + ldr r2, _080E2DF8 + adds r1, r0, r2 + mov r2, r8 + str r2, [r1] + ldr r1, _080E2DFC + adds r0, r1 + ldr r2, [sp, 0x1C] + str r2, [r0] + cmp r7, 0 + bne _080E2DDC + bl start_timer1 +_080E2DDC: + ldr r0, _080E2E00 + bl set_callback2 +_080E2DE2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E2DEC: .4byte 0x00001e2c +_080E2DF0: .4byte 0x00001e34 +_080E2DF4: .4byte 0x00001e38 +_080E2DF8: .4byte 0x00001e30 +_080E2DFC: .4byte 0x00001e3c +_080E2E00: .4byte c2_choose_name_or_words_screen + 1 + thumb_func_end do_choose_name_or_words_screen + + thumb_func_start c2_choose_name_or_words_screen +c2_choose_name_or_words_screen: @ 80E2E04 + push {lr} + ldr r0, _080E2E20 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x7 + bhi _080E2E9C + lsls r0, 2 + ldr r1, _080E2E24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E2E20: .4byte 0x030022c0 +_080E2E24: .4byte _080E2E28 + .align 2, 0 +_080E2E28: + .4byte _080E2E48 + .4byte _080E2E52 + .4byte _080E2E58 + .4byte _080E2E5E + .4byte _080E2E68 + .4byte _080E2E6E + .4byte _080E2E74 + .4byte _080E2E7A +_080E2E48: + bl sub_80E4F70 + bl choose_name_or_words_screen_setup + b _080E2E86 +_080E2E52: + bl choose_name_or_words_screen_init_bgs + b _080E2E86 +_080E2E58: + bl sub_80A1A74 + b _080E2E86 +_080E2E5E: + bl reset_all_obj_data + bl gpu_pal_allocator_reset + b _080E2E86 +_080E2E68: + bl clear_tasks + b _080E2E86 +_080E2E6E: + bl choose_name_or_words_screen_apply_bg_pals + b _080E2E86 +_080E2E74: + bl choose_name_or_words_screen_load_bg_tile_patterns + b _080E2E86 +_080E2E7A: + bl sub_80E3CC8 + bl fade_and_return_progress_probably + bl sub_80E501C +_080E2E86: + ldr r1, _080E2E98 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080E2EA4 + .align 2, 0 +_080E2E98: .4byte 0x030022c0 +_080E2E9C: + bl sub_80E4CB8 + bl sub_80E3194 +_080E2EA4: + pop {r0} + bx r0 + thumb_func_end c2_choose_name_or_words_screen + + thumb_func_start choose_name_or_words_screen_setup +choose_name_or_words_screen_setup: @ 80E2EA8 + push {r4-r7,lr} + ldr r5, _080E2F70 + ldr r0, [r5] + ldr r1, _080E2F74 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, [r5] + ldr r3, _080E2F78 + adds r0, r1, r3 + movs r4, 0 + strh r2, [r0] + ldr r7, _080E2F7C + adds r0, r1, r7 + strh r2, [r0] + ldr r0, _080E2F80 + adds r2, r1, r0 + movs r3, 0x1 + movs r0, 0x1 + strh r0, [r2] + adds r7, 0x4 + adds r2, r1, r7 + movs r0, 0x2 + strh r0, [r2] + movs r0, 0xF1 + lsls r0, 5 + adds r1, r0 + strb r4, [r1] + ldr r0, [r5] + ldr r1, _080E2F84 + adds r0, r1 + strb r3, [r0] + ldr r1, [r5] + ldr r6, _080E2F88 + adds r3, r1, r6 + ldr r2, _080E2F8C + ldr r4, _080E2F90 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + ldrb r0, [r0, 0x4] + ldr r2, _080E2F94 + adds r1, r2 + strb r0, [r1] + ldr r2, [r5] + adds r0, r2, r6 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r1, 3 + movs r0, 0xF0 + subs r0, r1 + asrs r3, r0, 1 + adds r0, r3, 0x6 + subs r7, 0x8 + adds r1, r2, r7 + strh r0, [r1] + adds r2, r4 + ldrb r0, [r2] + cmp r0, 0x4 + bne _080E2F2C + adds r0, r3, 0 + adds r0, 0x11 + strh r0, [r1] +_080E2F2C: + ldr r0, [r5] + ldr r4, _080E2F98 + ldrh r1, [r4] + ldr r2, _080E2F9C + adds r0, r2 + strb r1, [r0] + ldr r0, [r5] + movs r3, 0xC0 + lsls r3, 5 + adds r0, r3 + movs r1, 0xFF + movs r2, 0x10 + bl memset + ldr r1, [r5] + adds r0, r1, r6 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _080E2F64 + movs r7, 0xC0 + lsls r7, 5 + adds r0, r1, r7 + ldr r2, _080E2FA0 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy +_080E2F64: + movs r0, 0x10 + strh r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E2F70: .4byte 0x02039f94 +_080E2F74: .4byte 0x00001e10 +_080E2F78: .4byte 0x00001e18 +_080E2F7C: .4byte 0x00001e1a +_080E2F80: .4byte 0x00001e1c +_080E2F84: .4byte 0x00001e21 +_080E2F88: .4byte 0x00001e28 +_080E2F8C: .4byte 0x0858bfd8 +_080E2F90: .4byte 0x00001e2c +_080E2F94: .4byte 0x00001e22 +_080E2F98: .4byte 0x030022b0 +_080E2F9C: .4byte 0x00001e25 +_080E2FA0: .4byte 0x00001e30 + thumb_func_end choose_name_or_words_screen_setup + + thumb_func_start sub_80E2FA4 +sub_80E2FA4: @ 80E2FA4 + push {r4,r5,lr} + movs r3, 0 + ldr r4, _080E2FE0 + movs r5, 0x5 + negs r5, r5 +_080E2FAE: + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + lsls r0, r1, 31 + cmp r0, 0 + beq _080E2FC8 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] +_080E2FC8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3F + bls _080E2FAE + movs r0, 0 + bl sub_80E3E3C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E2FE0: .4byte 0x02020630 + thumb_func_end sub_80E2FA4 + + thumb_func_start choose_name_or_words_screen_init_bgs +choose_name_or_words_screen_init_bgs: @ 80E2FE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0xC + mov r8, r0 + add r2, sp, 0x8 + movs r6, 0 + ldr r1, _080E3178 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _080E317C + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080E300A: + strh r6, [r2] + add r0, sp, 0x8 + 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 _080E300A + strh r6, [r2] + add r2, sp, 0x8 + 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, 0xC] + ldr r2, _080E3178 + 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 + add r0, sp, 0x8 + 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 lcd_io_set + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080E3180 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + bl sub_81971D0 + bl sub_8197200 +_080E30D8: + lsls r0, r4, 3 + ldr r1, _080E3184 + adds r0, r1 + bl Window_AddFromTemplate + ldr r5, _080E3188 + ldr r1, [r5] + ldr r2, _080E318C + adds r1, r2 + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080E30D8 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r1, 0xC8 + lsls r1, 3 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _080E3190 + movs r0, 0x52 + bl lcd_io_set + ldr r1, [r5] + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r5] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r5] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + movs r0, 0x3 + bl bg_set_tilemap + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E3178: .4byte 0x040000d4 +_080E317C: .4byte 0x81000800 +_080E3180: .4byte 0x0858be00 +_080E3184: .4byte 0x0858be10 +_080E3188: .4byte 0x02039f94 +_080E318C: .4byte 0x00001e11 +_080E3190: .4byte 0x0000080c + thumb_func_end choose_name_or_words_screen_init_bgs + + thumb_func_start sub_80E3194 +sub_80E3194: @ 80E3194 + push {lr} + ldr r0, _080E31A8 + movs r1, 0x2 + bl AddTask + ldr r0, _080E31AC + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080E31A8: .4byte sub_80E31B0 + 1 +_080E31AC: .4byte sub_80E4F58 + 1 + thumb_func_end sub_80E3194 + + thumb_func_start sub_80E31B0 +sub_80E31B0: @ 80E31B0 + push {lr} + ldr r0, _080E31CC + ldr r0, [r0] + ldr r1, _080E31D0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _080E3240 + lsls r0, 2 + ldr r1, _080E31D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E31CC: .4byte 0x02039f94 +_080E31D0: .4byte 0x00001e10 +_080E31D4: .4byte _080E31D8 + .align 2, 0 +_080E31D8: + .4byte _080E3200 + .4byte _080E320E + .4byte _080E3218 + .4byte _080E3214 + .4byte _080E321E + .4byte _080E3224 + .4byte _080E322A + .4byte _080E3230 + .4byte _080E3236 + .4byte _080E323C +_080E3200: + bl sub_80E3294 + bl sub_80E2FA4 + bl sub_80E4F84 + b _080E3240 +_080E320E: + bl sub_80E335C + b _080E3240 +_080E3214: + bl sub_80E33A8 +_080E3218: + bl sub_80E3398 + b _080E3240 +_080E321E: + bl sub_80E3640 + b _080E3240 +_080E3224: + bl sub_80E3680 + b _080E3240 +_080E322A: + bl pokemon_store + b _080E3240 +_080E3230: + bl sub_80E3604 + b _080E3240 +_080E3236: + bl sub_80E3448 + b _080E3240 +_080E323C: + bl sub_80E347C +_080E3240: + pop {r0} + bx r0 + thumb_func_end sub_80E31B0 + + thumb_func_start sub_80E3244 +sub_80E3244: @ 80E3244 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E3250 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080E3250: .4byte 0x0858bebb + thumb_func_end sub_80E3244 + + thumb_func_start sub_80E3254 +sub_80E3254: @ 80E3254 + ldr r1, _080E3268 + ldr r0, _080E326C + ldr r0, [r0] + ldr r2, _080E3270 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080E3268: .4byte 0x0858bebe +_080E326C: .4byte 0x02039f94 +_080E3270: .4byte 0x00001e22 + thumb_func_end sub_80E3254 + + thumb_func_start sub_80E3274 +sub_80E3274: @ 80E3274 + ldr r1, _080E3288 + ldr r0, _080E328C + ldr r0, [r0] + ldr r2, _080E3290 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080E3288: .4byte 0x0858bec1 +_080E328C: .4byte 0x02039f94 +_080E3290: .4byte 0x00001e22 + thumb_func_end sub_80E3274 + + thumb_func_start sub_80E3294 +sub_80E3294: @ 80E3294 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, _080E333C + movs r0, 0x3 + bl sub_80E4CF8 + ldr r5, _080E3340 + ldr r0, [r5] + ldr r1, _080E3344 + adds r0, r1 + movs r6, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _080E3348 + movs r0, 0x2 + bl sub_80E4CF8 + ldr r1, _080E334C + movs r0, 0x1 + bl sub_80E4CF8 + ldr r0, [r5] + ldr r1, _080E3350 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_80E4DE4 + ldr r0, [r5] + ldr r1, _080E3354 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80E4DE4 + movs r0, 0x2 + movs r1, 0 + bl nullsub_10 + movs r0, 0x1 + movs r1, 0x1 + bl nullsub_10 + bl sub_80E4D10 + bl sub_80E4964 + bl sub_80E4EF0 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + str r6, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, [r5] + ldr r0, _080E3358 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080E333C: .4byte 0x08dd4544 +_080E3340: .4byte 0x02039f94 +_080E3344: .4byte 0x00001e22 +_080E3348: .4byte 0x08dd46e0 +_080E334C: .4byte 0x08dd4620 +_080E3350: .4byte 0x00001e12 +_080E3354: .4byte 0x00001e11 +_080E3358: .4byte 0x00001e10 + thumb_func_end sub_80E3294 + + thumb_func_start sub_80E335C +sub_80E335C: @ 80E335C + push {lr} + ldr r0, _080E338C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E3384 + movs r0, 0x1 + bl sub_80E4630 + movs r0, 0x1 + bl sub_80E3E94 + ldr r0, _080E3390 + ldr r1, [r0] + ldr r0, _080E3394 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080E3384: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080E338C: .4byte 0x02037fd4 +_080E3390: .4byte 0x02039f94 +_080E3394: .4byte 0x00001e10 + thumb_func_end sub_80E335C + + thumb_func_start sub_80E3398 +sub_80E3398: @ 80E3398 + push {lr} + bl sub_80E44BC + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80E3398 + + thumb_func_start sub_80E33A8 +sub_80E33A8: @ 80E33A8 + push {lr} + bl sub_80E3F04 + lsls r0, 24 + cmp r0, 0 + beq _080E33CA + movs r0, 0x1 + bl sub_80E4630 + bl sub_80E3E28 + ldr r0, _080E33D0 + ldr r0, [r0] + ldr r1, _080E33D4 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] +_080E33CA: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080E33D0: .4byte 0x02039f94 +_080E33D4: .4byte 0x00001e10 + thumb_func_end sub_80E33A8 + + thumb_func_start pokemon_store +pokemon_store: @ 80E33D8 + push {r4,lr} + bl sub_80E4BE4 + movs r0, 0 + bl sub_80E4630 + movs r0, 0 + bl sub_80E3E94 + movs r0, 0x3 + movs r1, 0 + movs r2, 0x1 + bl sub_80E3948 + ldr r4, _080E3420 + ldr r0, [r4] + ldr r1, _080E3424 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080E342C + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _080E342C + bl pokemon_transfer_to_pc_with_message + ldr r0, [r4] + ldr r1, _080E3428 + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + movs r0, 0 + b _080E343A + .align 2, 0 +_080E3420: .4byte 0x02039f94 +_080E3424: .4byte 0x00001e2c +_080E3428: .4byte 0x00001e10 +_080E342C: + ldr r0, _080E3440 + ldr r0, [r0] + ldr r1, _080E3444 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + movs r0, 0x1 +_080E343A: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E3440: .4byte 0x02039f94 +_080E3444: .4byte 0x00001e10 + thumb_func_end pokemon_store + + thumb_func_start sub_80E3448 +sub_80E3448: @ 80E3448 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _080E3474 + ldr r1, [r0] + ldr r0, _080E3478 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_080E3474: .4byte 0x02039f94 +_080E3478: .4byte 0x00001e10 + thumb_func_end sub_80E3448 + + thumb_func_start sub_80E347C +sub_80E347C: @ 80E347C + push {r4,r5,lr} + ldr r0, _080E34D0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080E34C6 + ldr r4, _080E34D4 + ldr r0, [r4] + ldr r1, _080E34D8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080E34A0 + bl set_rand_seed_and_trainer_id_hi +_080E34A0: + ldr r0, [r4] + ldr r1, _080E34DC + adds r0, r1 + ldr r0, [r0] + bl set_callback2 + ldr r0, _080E34E0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + bl Window_FreeMemory + ldr r0, [r4] + bl free + str r5, [r4] +_080E34C6: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080E34D0: .4byte 0x02037fd4 +_080E34D4: .4byte 0x02039f94 +_080E34D8: .4byte 0x00001e2c +_080E34DC: .4byte 0x00001e3c +_080E34E0: .4byte sub_80E31B0 + 1 + thumb_func_end sub_80E347C + + thumb_func_start pokemon_transfer_to_pc_with_message +pokemon_transfer_to_pc_with_message: @ 80E34E4 + push {r4,r5,lr} + sub sp, 0x10 + movs r5, 0 + bl sub_813B260 + lsls r0, 24 + cmp r0, 0 + bne _080E3534 + ldr r4, _080E3520 + ldr r0, _080E3524 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _080E3528 + ldr r1, _080E352C + ldr r1, [r1] + ldr r2, _080E3530 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + b _080E3574 + .align 2, 0 +_080E3520: .4byte 0x02021cc4 +_080E3524: .4byte 0x00004036 +_080E3528: .4byte 0x02021dc4 +_080E352C: .4byte 0x02039f94 +_080E3530: .4byte 0x00001e30 +_080E3534: + ldr r4, _080E35DC + ldr r0, _080E35E0 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _080E35E4 + ldr r1, _080E35E8 + ldr r1, [r1] + ldr r2, _080E35EC + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r4, _080E35F0 + 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 gf_strcpy + movs r5, 0x2 +_080E3574: + ldr r0, _080E35F4 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080E3586 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E3586: + ldr r4, _080E35F8 + ldr r1, _080E35FC + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _080E3600 + 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 r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl text_box_related_one + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E35DC: .4byte 0x02021cc4 +_080E35E0: .4byte 0x00004036 +_080E35E4: .4byte 0x02021dc4 +_080E35E8: .4byte 0x02039f94 +_080E35EC: .4byte 0x00001e30 +_080E35F0: .4byte 0x02021ec4 +_080E35F4: .4byte 0x000008ab +_080E35F8: .4byte 0x02021fc4 +_080E35FC: .4byte 0x0858bdb8 +_080E3600: .4byte 0x03003014 + thumb_func_end pokemon_transfer_to_pc_with_message + + thumb_func_start sub_80E3604 +sub_80E3604: @ 80E3604 + push {lr} + bl run_remoboxes + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _080E362E + ldr r0, _080E3634 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080E362E + ldr r0, _080E3638 + ldr r0, [r0] + ldr r1, _080E363C + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] +_080E362E: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080E3634: .4byte 0x030022c0 +_080E3638: .4byte 0x02039f94 +_080E363C: .4byte 0x00001e10 + thumb_func_end sub_80E3604 + + thumb_func_start sub_80E3640 +sub_80E3640: @ 80E3640 + push {lr} + movs r0, 0 + bl sub_80E4630 + bl sub_80E4050 + bl sub_80E373C + movs r0, 0x1 + bl sub_80E3E3C + movs r0, 0 + movs r1, 0 + movs r2, 0x1 + bl sub_80E3948 + movs r0, 0x6 + bl audio_play + ldr r0, _080E3678 + ldr r0, [r0] + ldr r1, _080E367C + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080E3678: .4byte 0x02039f94 +_080E367C: .4byte 0x00001e10 + thumb_func_end sub_80E3640 + + thumb_func_start sub_80E3680 +sub_80E3680: @ 80E3680 + push {r4-r6,lr} + sub sp, 0x4 + bl sub_80E3794 + lsls r0, 24 + cmp r0, 0 + beq _080E3732 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E3DFC + bl sub_80E3F70 + movs r5, 0 + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r0, 24 + lsrs r0, 24 + adds r6, r4, 0 + cmp r1, r0 + bne _080E36B2 + movs r5, 0x1 +_080E36B2: + ldr r2, _080E36E8 + ldr r0, [r2] + ldr r1, _080E36EC + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r1, [r2] + ldr r3, _080E36F0 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, [r2] + adds r4, r3 + ldrb r0, [r4] + movs r1, 0x3 + bl __umodsi3 + strb r0, [r4] + cmp r5, 0 + beq _080E36F4 + mov r4, sp + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + b _080E3712 + .align 2, 0 +_080E36E8: .4byte 0x02039f94 +_080E36EC: .4byte 0x00001e10 +_080E36F0: .4byte 0x00001e22 +_080E36F4: + mov r0, sp + movs r2, 0 + ldrsh r4, [r0, r2] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _080E3714 + mov r4, sp + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 +_080E3712: + strh r0, [r4] +_080E3714: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl sub_80E3D78 + bl sub_80E4E5C + movs r0, 0x1 + bl sub_80E4630 + movs r0, 0 + bl sub_80E3E3C +_080E3732: + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80E3680 + + thumb_func_start sub_80E373C +sub_80E373C: @ 80E373C + push {r4,lr} + ldr r4, _080E3758 + 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 + .align 2, 0 +_080E3758: .4byte sub_80E375C + 1 + thumb_func_end sub_80E373C + + thumb_func_start sub_80E375C +sub_80E375C: @ 80E375C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080E378C + ldr r2, _080E3790 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080E376E: + 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 _080E376E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E378C: .4byte 0x0858bec4 +_080E3790: .4byte 0x03005e00 + thumb_func_end sub_80E375C + + thumb_func_start sub_80E3794 +sub_80E3794: @ 80E3794 + push {lr} + ldr r0, _080E37A8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080E37AC + movs r0, 0 + b _080E37AE + .align 2, 0 +_080E37A8: .4byte sub_80E375C + 1 +_080E37AC: + movs r0, 0x1 +_080E37AE: + pop {r1} + bx r1 + thumb_func_end sub_80E3794 + + thumb_func_start sub_80E37B4 +sub_80E37B4: @ 80E37B4 + ldr r1, _080E37D0 + ldr r1, [r1] + ldr r3, _080E37D4 + adds r2, r1, r3 + movs r3, 0 + strh r3, [r2] + ldr r2, _080E37D8 + adds r1, r2 + strh r3, [r1] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + movs r0, 0 + bx lr + .align 2, 0 +_080E37D0: .4byte 0x02039f94 +_080E37D4: .4byte 0x00001e18 +_080E37D8: .4byte 0x00001e1a + thumb_func_end sub_80E37B4 + + thumb_func_start sub_80E37DC +sub_80E37DC: @ 80E37DC + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r5, _080E385C + ldr r0, [r5] + ldr r2, _080E3860 + adds r1, r0, r2 + str r1, [sp] + ldr r1, _080E3864 + adds r0, r1 + str r0, [sp, 0x4] + ldrh r0, [r4, 0xA] + adds r0, 0x4 + strh r0, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + movs r1, 0x28 + bl sine + ldr r1, [r5] + movs r2, 0xF1 + lsls r2, 5 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + ldrh r0, [r4, 0xA] + adds r0, 0x80 + movs r1, 0xFF + ands r0, r1 + movs r1, 0x28 + bl sine + ldr r1, [r5] + ldr r2, _080E3868 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _080E3852 + ldr r0, [r5] + ldr r1, _080E386C + adds r2, r0, r1 + ldrb r3, [r2] + adds r1, 0x2 + adds r0, r1 + ldrh r1, [r0] + strh r1, [r2] + strh r3, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080E3852: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080E385C: .4byte 0x02039f94 +_080E3860: .4byte 0x00001e1a +_080E3864: .4byte 0x00001e18 +_080E3868: .4byte 0x00001e21 +_080E386C: .4byte 0x00001e1c + thumb_func_end sub_80E37DC + + thumb_func_start sub_80E3870 +sub_80E3870: @ 80E3870 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r5, _080E38F4 + ldr r0, [r5] + ldr r2, _080E38F8 + adds r1, r0, r2 + str r1, [sp] + ldr r3, _080E38FC + adds r0, r3 + str r0, [sp, 0x4] + ldrh r0, [r4, 0xA] + adds r0, 0x4 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r1, 0x28 + bl sine + ldr r1, [r5] + movs r2, 0xF1 + lsls r2, 5 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + ldrh r0, [r4, 0xA] + adds r0, 0x80 + movs r1, 0xFF + ands r0, r1 + movs r1, 0x28 + bl sine + ldr r1, [r5] + ldr r3, _080E3900 + adds r1, r3 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080E38EA + ldr r0, [r5] + movs r2, 0xF1 + lsls r2, 5 + adds r1, r0, r2 + ldrb r2, [r1] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + strb r2, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080E38EA: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080E38F4: .4byte 0x02039f94 +_080E38F8: .4byte 0x00001e1a +_080E38FC: .4byte 0x00001e18 +_080E3900: .4byte 0x00001e21 + thumb_func_end sub_80E3870 + + thumb_func_start sub_80E3904 +sub_80E3904: @ 80E3904 + push {lr} + ldr r0, _080E391C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080E391C: .4byte sub_80E375C + 1 + thumb_func_end sub_80E3904 + + thumb_func_start sub_80E3920 +sub_80E3920: @ 80E3920 + push {lr} + ldr r0, _080E3940 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E3944 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x3 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_080E3940: .4byte c3_0809E58C + 1 +_080E3944: .4byte 0x03005e00 + thumb_func_end sub_80E3920 + + thumb_func_start sub_80E3948 +sub_80E3948: @ 80E3948 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _080E3980 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080E3984 + adds r4, r1, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r5, r0 + bne _080E3988 + cmp r6, 0 + bne _080E3988 + strh r7, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0xC] + b _080E39B4 + .align 2, 0 +_080E3980: .4byte c3_0809E58C + 1 +_080E3984: .4byte 0x03005e00 +_080E3988: + cmp r5, 0x3 + bne _080E3998 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080E3998 + cmp r6, 0 + beq _080E39B4 +_080E3998: + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + beq _080E39AA + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80E3AE8 +_080E39AA: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_80E3B10 +_080E39B4: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E3948 + + thumb_func_start c3_0809E58C +c3_0809E58C: @ 80E39BC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080E3A24 + adds r4, r1, r0 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + beq _080E3A6E + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080E3A6E + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80E3A74 + lsls r0, 16 + lsrs r0, 16 + ldrb r3, [r4, 0xE] + adds r1, r3, 0 + adds r2, r3, 0 + bl sub_80B609C + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080E3A08 + subs r0, r1, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + cmp r0, 0 + bne _080E3A6E +_080E3A08: + movs r0, 0x2 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x10] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r0, 0 + blt _080E3A32 + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0xD + bgt _080E3A28 + adds r0, r2, r1 + b _080E3A36 + .align 2, 0 +_080E3A24: .4byte 0x03005e00 +_080E3A28: + movs r0, 0x10 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x14] + adds r0, 0x1 + b _080E3A3C +_080E3A32: + ldrh r3, [r4, 0xE] + adds r0, r1, r3 +_080E3A36: + strh r0, [r4, 0xE] + ldrh r2, [r4, 0x14] + adds r0, r1, r2 +_080E3A3C: + strh r0, [r4, 0x14] + movs r3, 0xE + ldrsh r0, [r4, r3] + ldrh r1, [r4, 0xE] + cmp r0, 0x10 + bne _080E3A5C + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0x16 + bne _080E3A5C + ldr r0, _080E3A58 + strh r0, [r4, 0x10] + b _080E3A6E + .align 2, 0 +_080E3A58: .4byte 0x0000fffc +_080E3A5C: + lsls r0, r1, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080E3A6E + ldrh r0, [r4, 0xA] + strh r0, [r4, 0xC] + movs r0, 0x2 + strh r0, [r4, 0x10] + strh r1, [r4, 0x14] +_080E3A6E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end c3_0809E58C + + thumb_func_start sub_80E3A74 +sub_80E3A74: @ 80E3A74 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x4 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x87 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + add r6, sp, 0x8 + strh r0, [r6] + movs r0, 0x6 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + adds r0, r5 + mov r1, sp + adds r1, 0xA + strh r0, [r1] + movs r0, 0x7 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + adds r0, r5 + add r1, sp, 0xC + strh r0, [r1] + movs r0, 0x7 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + ldr r1, _080E3AE4 + adds r0, r1 + mov r1, sp + adds r1, 0xE + strh r0, [r1] + mov r0, sp + adds r1, r6, 0 + movs r2, 0x8 + bl memcpy + lsls r4, 1 + mov r1, sp + adds r0, r1, r4 + ldrh r0, [r0] + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080E3AE4: .4byte 0x00000101 + thumb_func_end sub_80E3A74 + + thumb_func_start sub_80E3AE8 +sub_80E3AE8: @ 80E3AE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E3A74 + lsls r0, 16 + ldr r2, _080E3B08 + lsrs r0, 15 + adds r2, r0, r2 + ldr r1, _080E3B0C + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_080E3B08: .4byte 0x02037b14 +_080E3B0C: .4byte 0x02037714 + thumb_func_end sub_80E3AE8 + + thumb_func_start sub_80E3B10 +sub_80E3B10: @ 80E3B10 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + movs r2, 0x4 + strh r2, [r0, 0xE] + movs r1, 0x2 + strh r1, [r0, 0x10] + strh r3, [r0, 0x12] + strh r2, [r0, 0x14] + bx lr + thumb_func_end sub_80E3B10 + + thumb_func_start sub_80E3B30 +sub_80E3B30: @ 80E3B30 + push {r4-r6,lr} + adds r5, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E3B48 + adds r0, r5, 0 + movs r1, 0 + bl obj_anim_image_start +_080E3B48: + ldrh r0, [r5, 0x36] + movs r1, 0xFF + ands r1, r0 + adds r6, r5, 0 + adds r6, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r6] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + movs r0, 0x2E + ldrsh r4, [r5, r0] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E3B7C + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] +_080E3B7C: + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080E3BAC + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080E3BAC + movs r2, 0x2E + ldrsh r1, [r5, r2] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _080E3BAC + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r1, r0 + beq _080E3BB6 +_080E3BAC: + movs r0, 0 + strh r0, [r5, 0x38] + movs r0, 0x2 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x3C] +_080E3BB6: + ldrh r0, [r5, 0x3C] + subs r0, 0x1 + strh r0, [r5, 0x3C] + lsls r0, 16 + cmp r0, 0 + bne _080E3BDE + ldrh r1, [r5, 0x3A] + ldrh r2, [r5, 0x38] + adds r0, r1, r2 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + beq _080E3BD6 + cmp r0, 0 + bne _080E3BDA +_080E3BD6: + negs r0, r1 + strh r0, [r5, 0x3A] +_080E3BDA: + movs r0, 0x2 + strh r0, [r5, 0x3C] +_080E3BDE: + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080E3C14 + ldrh r4, [r5, 0x38] + lsls r5, r4, 24 + lsrs r5, 24 + lsls r4, 16 + asrs r4, 17 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r2, _080E3C1C + adds r0, r2 + lsrs r0, 16 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r5, 0 + bl sub_80B609C +_080E3C14: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E3C1C: .4byte 0x01010000 + thumb_func_end sub_80E3B30 + + thumb_func_start sub_80E3C20 +sub_80E3C20: @ 80E3C20 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080E3C68 + mov r0, sp + movs r2, 0x8 + bl memcpy + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080E3C44 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080E3C52 +_080E3C44: + movs r0, 0x8 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r4, 0x30] +_080E3C52: + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x24] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E3C68: .4byte 0x0858bed4 + thumb_func_end sub_80E3C20 + + thumb_func_start sub_80E3C6C +sub_80E3C6C: @ 80E3C6C + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _080E3C94 + mov r0, sp + movs r2, 0x8 + bl memcpy + bl sub_80E4A60 + lsls r0, 24 + ldrh r1, [r4, 0x2E] + lsls r1, 24 + cmp r0, r1 + beq _080E3C98 + movs r0, 0 + strh r0, [r4, 0x26] + strh r0, [r4, 0x30] + b _080E3CBE + .align 2, 0 +_080E3C94: .4byte 0x0858bedc +_080E3C98: + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080E3CC0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r4, 0x30] + movs r0, 0 +_080E3CBE: + strh r0, [r4, 0x32] +_080E3CC0: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E3C6C + + thumb_func_start sub_80E3CC8 +sub_80E3CC8: @ 80E3CC8 + push {lr} + bl sub_80E3CE4 + bl sub_80E3F8C + bl sub_80E4218 + bl sub_80E4290 + bl sub_80E4354 + pop {r0} + bx r0 + thumb_func_end sub_80E3CC8 + + thumb_func_start sub_80E3CE4 +sub_80E3CE4: @ 80E3CE4 + push {r4-r6,lr} + ldr r0, _080E3D68 + movs r1, 0x26 + movs r2, 0x58 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r5, _080E3D6C + ldr r1, [r5] + ldr r4, _080E3D70 + adds r1, r4 + strb r0, [r1] + movs r0, 0x1 + bl sub_80E3E3C + ldr r6, _080E3D74 + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1, 0x5] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x1] + ands r2, r1 + orrs r2, r3 + strb r2, [r0, 0x1] + ldr r2, [r5] + adds r2, r4 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0x3A] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + strh r1, [r0, 0x3A] + movs r0, 0 + movs r1, 0 + bl sub_80E3D78 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E3D68: .4byte 0x0858c138 +_080E3D6C: .4byte 0x02039f94 +_080E3D70: .4byte 0x00001e23 +_080E3D74: .4byte 0x02020630 + thumb_func_end sub_80E3CE4 + + thumb_func_start sub_80E3D78 +sub_80E3D78: @ 80E3D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + ldr r1, _080E3DC4 + ldr r1, [r1] + ldr r2, _080E3DC8 + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, _080E3DCC + adds r5, r1, r2 + lsrs r1, r0, 16 + mov r8, r1 + asrs r6, r0, 16 + ldr r4, _080E3DD0 + bl sub_80E3274 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r6, r0 + bge _080E3DD8 + bl sub_80E3274 + ldr r1, _080E3DD4 + lsls r0, 24 + lsrs r0, 21 + adds r0, r6, r0 + adds r0, r1 + ldrb r0, [r0] + adds r0, 0x26 + b _080E3DDA + .align 2, 0 +_080E3DC4: .4byte 0x02039f94 +_080E3DC8: .4byte 0x00001e23 +_080E3DCC: .4byte 0x02020630 +_080E3DD0: .4byte 0x0858bea0 +_080E3DD4: .4byte 0x0858bea3 +_080E3DD8: + movs r0, 0 +_080E3DDA: + strh r0, [r5, 0x20] + lsls r0, r7, 16 + asrs r0, 12 + adds r0, 0x58 + strh r0, [r5, 0x22] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x30] + strh r0, [r5, 0x34] + mov r2, r8 + strh r2, [r5, 0x2E] + strh r7, [r5, 0x30] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E3D78 + + thumb_func_start sub_80E3DFC +sub_80E3DFC: @ 80E3DFC + ldr r2, _080E3E1C + ldr r2, [r2] + ldr r3, _080E3E20 + adds r2, r3 + ldrb r3, [r2] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + ldr r3, _080E3E24 + adds r2, r3 + ldrh r3, [r2, 0x2E] + strh r3, [r0] + ldrh r0, [r2, 0x30] + strh r0, [r1] + bx lr + .align 2, 0 +_080E3E1C: .4byte 0x02039f94 +_080E3E20: .4byte 0x00001e23 +_080E3E24: .4byte 0x02020630 + thumb_func_end sub_80E3DFC + + thumb_func_start sub_80E3E28 +sub_80E3E28: @ 80E3E28 + push {lr} + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80E3D78 + pop {r0} + bx r0 + thumb_func_end sub_80E3E28 + + thumb_func_start sub_80E3E3C +sub_80E3E3C: @ 80E3E3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080E3E84 + ldr r1, _080E3E88 + ldr r4, [r1] + ldr r1, _080E3E8C + adds r4, r1 + ldrb r1, [r4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + ldrh r3, [r2, 0x36] + ldr r1, _080E3E90 + ands r1, r3 + strh r1, [r2, 0x36] + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + ldrh r2, [r1, 0x36] + orrs r0, r2 + strh r0, [r1, 0x36] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl obj_anim_image_start + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E3E84: .4byte 0x02020630 +_080E3E88: .4byte 0x02039f94 +_080E3E8C: .4byte 0x00001e23 +_080E3E90: .4byte 0xffffff00 + thumb_func_end sub_80E3E3C + + thumb_func_start sub_80E3E94 +sub_80E3E94: @ 80E3E94 + push {r4,r5,lr} + lsls r0, 24 + ldr r5, _080E3ECC + ldr r1, _080E3ED0 + ldr r4, [r1] + ldr r1, _080E3ED4 + adds r4, r1 + ldrb r1, [r4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + ldrh r3, [r2, 0x36] + movs r1, 0xFF + ands r1, r3 + strh r1, [r2, 0x36] + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsrs r0, 16 + ldrh r2, [r1, 0x36] + orrs r0, r2 + strh r0, [r1, 0x36] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E3ECC: .4byte 0x02020630 +_080E3ED0: .4byte 0x02039f94 +_080E3ED4: .4byte 0x00001e23 + thumb_func_end sub_80E3E94 + + thumb_func_start sub_80E3ED8 +sub_80E3ED8: @ 80E3ED8 + push {lr} + ldr r0, _080E3EF8 + ldr r0, [r0] + ldr r1, _080E3EFC + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E3F00 + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_080E3EF8: .4byte 0x02039f94 +_080E3EFC: .4byte 0x00001e23 +_080E3F00: .4byte 0x02020630 + thumb_func_end sub_80E3ED8 + + thumb_func_start sub_80E3F04 +sub_80E3F04: @ 80E3F04 + ldr r2, _080E3F24 + ldr r0, _080E3F28 + ldr r0, [r0] + ldr r1, _080E3F2C + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 31 + bx lr + .align 2, 0 +_080E3F24: .4byte 0x02020630 +_080E3F28: .4byte 0x02039f94 +_080E3F2C: .4byte 0x00001e23 + thumb_func_end sub_80E3F04 + + thumb_func_start sub_80E3F30 +sub_80E3F30: @ 80E3F30 + push {r4,r5,lr} + sub sp, 0x4 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl sub_80E3DFC + mov r0, sp + movs r1, 0 + ldrsh r4, [r0, r1] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _080E3F64 + ldr r0, _080E3F60 + movs r2, 0 + ldrsh r1, [r5, r2] + adds r1, r0 + ldrb r0, [r1] + b _080E3F66 + .align 2, 0 +_080E3F60: .4byte 0x0858bee4 +_080E3F64: + movs r0, 0 +_080E3F66: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E3F30 + + thumb_func_start sub_80E3F70 +sub_80E3F70: @ 80E3F70 + push {r4,lr} + ldr r4, _080E3F88 + bl sub_80E3274 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E3F88: .4byte 0x0858bea0 + thumb_func_end sub_80E3F70 + + thumb_func_start sub_80E3F8C +sub_80E3F8C: @ 80E3F8C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _080E4030 + movs r1, 0xCC + movs r2, 0x58 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E4034 + ldr r1, [r1] + ldr r2, _080E4038 + adds r1, r2 + strb r0, [r1] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, _080E403C + mov r8, r0 + add r5, r8 + ldr r1, _080E4040 + adds r0, r5, 0 + bl obj_set_f18_to_r0_f42_to_40 + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r6, 0x4 + orrs r0, r6 + strb r0, [r1] + ldr r0, _080E4044 + movs r1, 0xCC + movs r2, 0x54 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r8 + ldr r1, _080E4048 + adds r0, r4, 0 + bl obj_set_f18_to_r0_f42_to_40 + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r6 + strb r0, [r4] + ldr r0, _080E404C + movs r1, 0xCC + movs r2, 0x53 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r6 + strb r1, [r2, 0x5] + strh r0, [r5, 0x3C] + adds r2, 0x3E + ldrb r0, [r2] + orrs r0, r6 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E4030: .4byte 0x0858c0c0 +_080E4034: .4byte 0x02039f94 +_080E4038: .4byte 0x00001e24 +_080E403C: .4byte 0x02020630 +_080E4040: .4byte 0x0858c050 +_080E4044: .4byte 0x0858c0f0 +_080E4048: .4byte 0x0858c058 +_080E404C: .4byte 0x0858c0d8 + thumb_func_end sub_80E3F8C + + thumb_func_start sub_80E4050 +sub_80E4050: @ 80E4050 + ldr r0, _080E4074 + ldr r2, [r0] + ldr r1, _080E4078 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E407C + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldr r1, _080E4080 + adds r2, r1 + ldrb r1, [r2] + strh r1, [r0, 0x30] + bx lr + .align 2, 0 +_080E4074: .4byte 0x02039f94 +_080E4078: .4byte 0x00001e24 +_080E407C: .4byte 0x02020630 +_080E4080: .4byte 0x00001e22 + thumb_func_end sub_80E4050 + + thumb_func_start sub_80E4084 +sub_80E4084: @ 80E4084 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _080E40A8 +_080E408A: + movs r1, 0x2E + 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 _080E408A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E40A8: .4byte 0x0858bee8 + thumb_func_end sub_80E4084 + + thumb_func_start sub_80E40AC +sub_80E40AC: @ 80E40AC + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x3A + ldrsh r0, [r6, r1] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r1, _080E40F4 + adds r5, r1 + movs r2, 0x3C + ldrsh r0, [r6, r2] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldr r0, _080E40F8 + ldr r0, [r0] + ldr r1, _080E40FC + adds r0, r1 + ldrb r0, [r0] + bl sub_80E3244 + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E41B8 + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080E40F4: .4byte 0x02020630 +_080E40F8: .4byte 0x02039f94 +_080E40FC: .4byte 0x00001e22 + thumb_func_end sub_80E40AC + + thumb_func_start sub_80E4100 +sub_80E4100: @ 80E4100 + movs r0, 0 + bx lr + thumb_func_end sub_80E4100 + + thumb_func_start sub_80E4104 +sub_80E4104: @ 80E4104 + push {r4,r5,lr} + adds r3, r0, 0 + movs r0, 0x3A + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, _080E4170 + adds r4, r0, r2 + movs r0, 0x3C + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080E4168 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + ldr r0, _080E4174 + strh r0, [r4, 0x26] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x30] + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E3244 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80E41B8 +_080E4168: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080E4170: .4byte 0x02020630 +_080E4174: .4byte 0x0000fffc + thumb_func_end sub_80E4104 + + thumb_func_start sub_80E4178 +sub_80E4178: @ 80E4178 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E41B4 + 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] + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _080E41AC + movs r0, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r4, 0x2E] +_080E41AC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E41B4: .4byte 0x02020630 + thumb_func_end sub_80E4178 + + thumb_func_start sub_80E41B8 +sub_80E41B8: @ 80E41B8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080E4210 + lsls r4, r5, 1 + adds r0, r4, r0 + ldrh r0, [r0] + bl gpu_pal_tags_index_of + lsls r0, 4 + mov r1, r8 + ldrb r2, [r1, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + mov r0, r8 + strb r1, [r0, 0x5] + ldr r0, _080E4214 + adds r4, r0 + ldrh r0, [r4] + bl gpu_tile_obj_tag_get_range_start + adds r1, r6, 0 + adds r1, 0x40 + strh r0, [r1] + adds r6, 0x42 + movs r1, 0x3F + ands r1, r5 + ldrb r2, [r6] + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E4210: .4byte 0x0858bef8 +_080E4214: .4byte 0x0858befe + thumb_func_end sub_80E41B8 + + thumb_func_start sub_80E4218 +sub_80E4218: @ 80E4218 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _080E4280 + movs r1, 0xCC + movs r2, 0x74 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r6, _080E4284 + adds r4, r6 + ldr r0, _080E4288 + mov r8, r0 + adds r0, r4, 0 + mov r1, r8 + bl obj_set_f18_to_r0_f42_to_40 + adds r4, 0x3E + ldrb r0, [r4] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r4] + ldr r0, _080E428C + movs r1, 0xCC + movs r2, 0x8C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r6 + adds r0, r4, 0 + mov r1, r8 + bl obj_set_f18_to_r0_f42_to_40 + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r5 + strb r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E4280: .4byte 0x0858c108 +_080E4284: .4byte 0x02020630 +_080E4288: .4byte 0x0858c070 +_080E428C: .4byte 0x0858c120 + thumb_func_end sub_80E4218 + + thumb_func_start sub_80E4290 +sub_80E4290: @ 80E4290 + push {r4-r6,lr} + ldr r5, _080E433C + ldr r0, [r5] + ldr r4, _080E4340 + adds r0, r4 + ldrh r1, [r0] + subs r1, 0x5 + ldr r0, _080E4344 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x38 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _080E4348 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r4, r0, r4 + ldrh r1, [r4] + movs r5, 0 + ldr r2, _080E434C + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r5, r0 + bcs _080E4334 + adds r6, r3, 0 +_080E42E2: + lsls r1, 16 + asrs r4, r1, 16 + movs r0, 0xC0 + lsls r0, 10 + adds r1, r0 + asrs r1, 16 + ldr r0, _080E4350 + movs r2, 0x3C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + strh r5, [r0, 0x2E] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x8 + lsls r4, 16 + lsrs r1, r4, 16 + ldr r0, _080E433C + ldr r0, [r0] + ldr r2, _080E434C + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r5, r0 + bcc _080E42E2 +_080E4334: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E433C: .4byte 0x02039f94 +_080E4340: .4byte 0x00001e16 +_080E4344: .4byte 0x0858c150 +_080E4348: .4byte 0x02020630 +_080E434C: .4byte 0x00001e28 +_080E4350: .4byte 0x0858c168 + thumb_func_end sub_80E4290 + + thumb_func_start sub_80E4354 +sub_80E4354: @ 80E4354 + push {lr} + ldr r1, _080E4374 + ldr r0, _080E4378 + ldr r0, [r0] + ldr r2, _080E437C + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_080E4374: .4byte 0x0858bf04 +_080E4378: .4byte 0x02039f94 +_080E437C: .4byte 0x00001e28 + thumb_func_end sub_80E4354 + + thumb_func_start nullsub_42 +nullsub_42: @ 80E4380 + bx lr + thumb_func_end nullsub_42 + + thumb_func_start sub_80E4384 +sub_80E4384: @ 80E4384 + push {lr} + sub sp, 0x4 + ldr r0, _080E43D0 + ldr r0, [r0] + ldr r1, _080E43D4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0 + bl sub_808BD3C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E43D8 + movs r2, 0 + str r2, [sp] + movs r2, 0x38 + movs r3, 0x25 + bl sub_808DD68 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080E43DC + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x4 + bl obj_anim_image_start + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080E43D0: .4byte 0x02039f94 +_080E43D4: .4byte 0x00001e34 +_080E43D8: .4byte nullsub_12 + 1 +_080E43DC: .4byte 0x02020630 + thumb_func_end sub_80E4384 + + thumb_func_start sub_80E43E0 +sub_80E43E0: @ 80E43E0 + push {r4,lr} + ldr r0, _080E4414 + movs r1, 0x38 + movs r2, 0x29 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080E4418 + adds r4, r0 + ldr r1, _080E441C + adds r0, r4, 0 + bl obj_set_f18_to_r0_f42_to_40 + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E4414: .4byte 0x0858c180 +_080E4418: .4byte 0x02020630 +_080E441C: .4byte 0x0858c078 + thumb_func_end sub_80E43E0 + + thumb_func_start sub_80E4420 +sub_80E4420: @ 80E4420 + push {lr} + sub sp, 0xC + bl sub_80D2F04 + ldr r0, _080E4468 + ldr r3, [r0] + ldr r1, _080E446C + adds r0, r3, r1 + ldrh r0, [r0] + ldr r1, _080E4470 + movs r2, 0 + str r2, [sp] + ldr r2, _080E4474 + adds r3, r2 + ldr r2, [r3] + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] + movs r2, 0x38 + movs r3, 0x28 + bl sub_80D2CC4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E4478 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r1, 0x5] + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_080E4468: .4byte 0x02039f94 +_080E446C: .4byte 0x00001e34 +_080E4470: .4byte nullsub_12 + 1 +_080E4474: .4byte 0x00001e38 +_080E4478: .4byte 0x02020630 + thumb_func_end sub_80E4420 + + thumb_func_start sub_80E447C +sub_80E447C: @ 80E447C + push {lr} + sub sp, 0x4 + ldr r1, _080E44B4 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r2, 0x38 + movs r3, 0x25 + bl sub_808DD68 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080E44B8 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x4 + bl obj_anim_image_start + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080E44B4: .4byte nullsub_12 + 1 +_080E44B8: .4byte 0x02020630 + thumb_func_end sub_80E447C + + thumb_func_start sub_80E44BC +sub_80E44BC: @ 80E44BC + push {r4,r5,lr} + bl sub_80E460C + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80E3F30 + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x8 + bne _080E44DA + bl sub_80E45E0 + b _080E44F6 +_080E44DA: + cmp r4, 0x6 + bne _080E44E4 + bl sub_80E4AF8 + b _080E4504 +_080E44E4: + cmp r5, 0x9 + beq _080E4500 + ldr r1, _080E44FC + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080E44F6: + lsls r0, 24 + lsrs r0, 24 + b _080E4506 + .align 2, 0 +_080E44FC: .4byte 0x0858bf18 +_080E4500: + bl sub_80E3E28 +_080E4504: + movs r0, 0 +_080E4506: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E44BC + + thumb_func_start sub_80E450C +sub_80E450C: @ 80E450C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + bne _080E4546 + bl sub_80E4B54 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80E3ED8 + cmp r4, 0 + beq _080E4546 + movs r0, 0x2 + bl sub_80E4630 + ldr r0, _080E4550 + ldr r0, [r0] + ldr r1, _080E4554 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] +_080E4546: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E4550: .4byte 0x02039f94 +_080E4554: .4byte 0x00001e10 + thumb_func_end sub_80E450C + + thumb_func_start sub_80E4558 +sub_80E4558: @ 80E4558 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + beq _080E4572 + movs r0, 0 + b _080E457A +_080E4572: + bl sub_80E45E0 + lsls r0, 24 + lsrs r0, 24 +_080E457A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E4558 + + thumb_func_start sub_80E4580 +sub_80E4580: @ 80E4580 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + bne _080E459A + bl sub_80E4AF8 +_080E459A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E4580 + + thumb_func_start sub_80E45A4 +sub_80E45A4: @ 80E45A4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + beq _080E45BE + movs r0, 0 + b _080E45D2 +_080E45BE: + movs r0, 0x5 + bl audio_play + ldr r0, _080E45D8 + ldr r0, [r0] + ldr r1, _080E45DC + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0x1 +_080E45D2: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E45D8: .4byte 0x02039f94 +_080E45DC: .4byte 0x00001e10 + thumb_func_end sub_80E45A4 + + thumb_func_start sub_80E45E0 +sub_80E45E0: @ 80E45E0 + ldr r0, _080E45F0 + ldr r0, [r0] + ldr r1, _080E45F4 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0x1 + bx lr + .align 2, 0 +_080E45F0: .4byte 0x02039f94 +_080E45F4: .4byte 0x00001e10 + thumb_func_end sub_80E45E0 + + thumb_func_start sub_80E45F8 +sub_80E45F8: @ 80E45F8 + push {lr} + ldr r0, _080E4608 + movs r1, 0x1 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080E4608: .4byte sub_80E465C + 1 + thumb_func_end sub_80E45F8 + + thumb_func_start sub_80E460C +sub_80E460C: @ 80E460C + push {lr} + ldr r0, _080E4628 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E462C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0xA] + pop {r1} + bx r1 + .align 2, 0 +_080E4628: .4byte sub_80E465C + 1 +_080E462C: .4byte 0x03005e00 + thumb_func_end sub_80E460C + + thumb_func_start sub_80E4630 +sub_80E4630: @ 80E4630 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080E4654 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E4658 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E4654: .4byte sub_80E465C + 1 +_080E4658: .4byte 0x03005e00 + thumb_func_end sub_80E4630 + + thumb_func_start sub_80E465C +sub_80E465C: @ 80E465C + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _080E4684 + ldr r2, _080E4688 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080E4684: .4byte 0x0858bf28 +_080E4688: .4byte 0x03005e00 + thumb_func_end sub_80E465C + + thumb_func_start sub_80E468C +sub_80E468C: @ 80E468C + movs r1, 0 + strh r1, [r0, 0xA] + bx lr + thumb_func_end sub_80E468C + + thumb_func_start sub_80E4692 +sub_80E4692: @ 80E4692 + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2, 0xA] + ldr r0, _080E46B0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080E46B4 + movs r0, 0x5 + strh r0, [r2, 0xA] + b _080E46E4 + .align 2, 0 +_080E46B0: .4byte 0x030022c0 +_080E46B4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080E46C2 + movs r0, 0x6 + strh r0, [r2, 0xA] + b _080E46E4 +_080E46C2: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080E46D0 + movs r0, 0x8 + strh r0, [r2, 0xA] + b _080E46E4 +_080E46D0: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080E46DE + movs r0, 0x9 + strh r0, [r2, 0xA] + b _080E46E4 +_080E46DE: + adds r0, r2, 0 + bl sub_80E46F0 +_080E46E4: + pop {r0} + bx r0 + thumb_func_end sub_80E4692 + + thumb_func_start sub_80E46E8 +sub_80E46E8: @ 80E46E8 + movs r1, 0 + strh r1, [r0, 0xA] + bx lr + thumb_func_end sub_80E46E8 + + thumb_func_start sub_80E46F0 +sub_80E46F0: @ 80E46F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + mov r9, r0 + ldr r1, _080E47DC + mov r0, sp + movs r2, 0xA + bl memcpy + add r0, sp, 0xC + mov r10, r0 + ldr r1, _080E47E0 + movs r2, 0xA + bl memcpy + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x2C] + ldr r1, _080E47E4 + ldr r0, [sp, 0x2C] + movs r2, 0x8 + bl memcpy + mov r2, sp + adds r2, 0x20 + str r2, [sp, 0x30] + ldr r1, _080E47E8 + adds r0, r2, 0 + movs r2, 0x6 + bl memcpy + add r4, sp, 0x28 + mov r5, sp + adds r5, 0x2A + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80E3DFC + ldr r0, _080E47EC + ldrh r2, [r0, 0x30] + movs r0, 0x40 + ands r0, r2 + lsls r0, 16 + lsrs r0, 16 + negs r0, r0 + lsrs r1, r0, 31 + movs r0, 0x80 + ands r0, r2 + adds r6, r4, 0 + cmp r0, 0 + beq _080E475E + movs r1, 0x2 +_080E475E: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _080E4768 + movs r1, 0x3 +_080E4768: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _080E4772 + movs r1, 0x4 +_080E4772: + ldrh r0, [r6] + mov r8, r0 + lsls r1, 1 + mov r2, sp + adds r7, r2, r1 + ldrh r0, [r7] + add r0, r8 + strh r0, [r6] + add r1, r10 + ldrh r0, [r1] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0 + bge _080E479E + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] +_080E479E: + movs r0, 0 + ldrsh r4, [r6, r0] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _080E47B2 + movs r0, 0 + strh r0, [r6] +_080E47B2: + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _080E481E + movs r2, 0 + ldrsh r4, [r6, r2] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E47F0 + ldrh r0, [r5] + mov r1, r9 + strh r0, [r1, 0xC] + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 1 + ldr r1, [sp, 0x2C] + adds r0, r1, r0 + b _080E481A + .align 2, 0 +_080E47DC: .4byte 0x0858bf34 +_080E47E0: .4byte 0x0858bf3e +_080E47E4: .4byte 0x0858bf48 +_080E47E8: .4byte 0x0858bf50 +_080E47EC: .4byte 0x030022c0 +_080E47F0: + mov r2, r8 + lsls r4, r2, 16 + asrs r4, 16 + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E481E + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080E4810 + mov r2, r9 + ldrh r0, [r2, 0xC] + b _080E481C +_080E4810: + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r0, 1 + ldr r2, [sp, 0x30] + adds r0, r2, r0 +_080E481A: + ldrh r0, [r0] +_080E481C: + strh r0, [r5] +_080E481E: + movs r0, 0 + ldrsh r4, [r6, r0] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E4860 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _080E483A + movs r0, 0x2 + strh r0, [r5] +_080E483A: + movs r2, 0 + ldrsh r0, [r5, r2] + cmp r0, 0x2 + ble _080E4846 + movs r0, 0 + strh r0, [r5] +_080E4846: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E4856 + movs r0, 0x1 + mov r2, r9 + strh r0, [r2, 0xC] + b _080E4878 +_080E4856: + cmp r0, 0x2 + bne _080E4878 + mov r1, r9 + strh r0, [r1, 0xC] + b _080E4878 +_080E4860: + movs r2, 0 + ldrsh r0, [r5, r2] + cmp r0, 0 + bge _080E486C + movs r0, 0x3 + strh r0, [r5] +_080E486C: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + ble _080E4878 + movs r0, 0 + strh r0, [r5] +_080E4878: + movs r2, 0 + ldrsh r0, [r6, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl sub_80E3D78 + 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_80E46F0 + + thumb_func_start sub_80E4894 +sub_80E4894: @ 80E4894 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, _080E48DC + ldr r0, [r5] + ldr r4, _080E48E0 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _080E48E4 + adds r1, r2 + ldr r1, [r1] + ldr r2, [r1, 0x8] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E48DC: .4byte 0x02039f94 +_080E48E0: .4byte 0x00001e14 +_080E48E4: .4byte 0x00001e28 + thumb_func_end sub_80E4894 + + thumb_func_start sub_80E48E8 +sub_80E48E8: @ 80E48E8 + push {r4,r5,lr} + sub sp, 0x2C + ldr r5, _080E4950 + ldr r0, [r5] + ldr r1, _080E4954 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, _080E4958 + adds r1, r0 + add r0, sp, 0xC + bl gf_strcpy + ldr r0, [r5] + ldr r1, _080E495C + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x8] + add r0, sp, 0xC + movs r2, 0xF + bl sub_8008C08 + ldr r0, [r5] + ldr r4, _080E4960 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + movs r3, 0x8 + bl Print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E4950: .4byte 0x02039f94 +_080E4954: .4byte 0x00001e34 +_080E4958: .4byte 0x083185c8 +_080E495C: .4byte 0x00001e28 +_080E4960: .4byte 0x00001e14 + thumb_func_end sub_80E48E8 + + thumb_func_start sub_80E4964 +sub_80E4964: @ 80E4964 + push {lr} + ldr r1, _080E4980 + ldr r0, _080E4984 + ldr r0, [r0] + ldr r2, _080E4988 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_080E4980: .4byte 0x0858bf58 +_080E4984: .4byte 0x02039f94 +_080E4988: .4byte 0x00001e2c + thumb_func_end sub_80E4964 + + thumb_func_start sub_80E498C +sub_80E498C: @ 80E498C + push {lr} + ldr r1, _080E49AC + ldr r0, _080E49B0 + ldr r0, [r0] + ldr r2, _080E49B4 + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_080E49AC: .4byte 0x0858bf6c +_080E49B0: .4byte 0x02039f94 +_080E49B4: .4byte 0x00001e28 + thumb_func_end sub_80E498C + + thumb_func_start nullsub_43 +nullsub_43: @ 80E49B8 + bx lr + thumb_func_end nullsub_43 + + thumb_func_start sub_80E49BC +sub_80E49BC: @ 80E49BC + push {r4,r5,lr} + sub sp, 0x10 + movs r4, 0 + ldr r1, _080E4A14 + add r0, sp, 0xC + bl gf_strcpy + ldr r5, _080E4A18 + ldr r0, [r5] + ldr r1, _080E4A1C + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFF + beq _080E4A0C + cmp r0, 0xFE + bne _080E49E6 + ldr r1, _080E4A20 + add r0, sp, 0xC + bl gf_strcpy + movs r4, 0x1 +_080E49E6: + ldr r0, [r5] + ldr r1, _080E4A24 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r4, 1 + adds r1, r4 + ldr r2, _080E4A28 + adds r1, r2 + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0x68 + movs r3, 0x1 + bl box_print +_080E4A0C: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E4A14: .4byte 0x085e8d49 +_080E4A18: .4byte 0x02039f94 +_080E4A1C: .4byte 0x00001e36 +_080E4A20: .4byte 0x085e8d4b +_080E4A24: .4byte 0x00001e13 +_080E4A28: .4byte 0x0858bf74 + thumb_func_end sub_80E49BC + + thumb_func_start sub_80E4A2C +sub_80E4A2C: @ 80E4A2C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r6, _080E4A5C + bl sub_80E3274 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 13 + adds r4, r5 + lsls r0, 24 + lsrs r0, 19 + adds r4, r0 + adds r4, r6 + ldrb r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080E4A5C: .4byte 0x0858be40 + thumb_func_end sub_80E4A2C + + thumb_func_start sub_80E4A60 +sub_80E4A60: @ 80E4A60 + push {r4,r5,lr} + movs r2, 0 + ldr r0, _080E4A88 + ldr r4, [r0] + ldr r3, _080E4A8C + adds r1, r4, r3 + ldr r1, [r1] + ldrb r3, [r1, 0x1] + adds r5, r0, 0 + cmp r2, r3 + bcs _080E4A9A + movs r0, 0xC0 + lsls r0, 5 + adds r1, r4, r0 +_080E4A7C: + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E4A90 + adds r0, r2, 0 + b _080E4AAA + .align 2, 0 +_080E4A88: .4byte 0x02039f94 +_080E4A8C: .4byte 0x00001e28 +_080E4A90: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _080E4A7C +_080E4A9A: + ldr r0, [r5] + ldr r1, _080E4AB0 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_080E4AAA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080E4AB0: .4byte 0x00001e28 + thumb_func_end sub_80E4A60 + + thumb_func_start sub_80E4AB4 +sub_80E4AB4: @ 80E4AB4 + push {lr} + ldr r0, _080E4AE0 + ldr r2, [r0] + ldr r1, _080E4AE4 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + subs r0, 0x1 + lsls r1, r0, 24 + cmp r1, 0 + ble _080E4AF0 + movs r0, 0xC0 + lsls r0, 5 + adds r3, r2, r0 +_080E4AD0: + asrs r2, r1, 24 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E4AE8 + lsrs r0, r1, 24 + b _080E4AF2 + .align 2, 0 +_080E4AE0: .4byte 0x02039f94 +_080E4AE4: .4byte 0x00001e28 +_080E4AE8: + subs r0, r2, 0x1 + lsls r1, r0, 24 + cmp r1, 0 + bgt _080E4AD0 +_080E4AF0: + movs r0, 0 +_080E4AF2: + pop {r1} + bx r1 + thumb_func_end sub_80E4AB4 + + thumb_func_start sub_80E4AF8 +sub_80E4AF8: @ 80E4AF8 + push {r4-r6,lr} + bl sub_80E4AB4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _080E4B50 + ldr r0, [r6] + movs r5, 0xC0 + lsls r5, 5 + adds r0, r5 + adds r0, r4 + movs r1, 0 + strb r1, [r0] + bl sub_80E4D10 + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] + bl sub_80E3F30 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080E4B38 + cmp r0, 0x2 + bne _080E4B42 +_080E4B38: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl sub_80E3948 +_080E4B42: + movs r0, 0x17 + bl audio_play + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E4B50: .4byte 0x02039f94 + thumb_func_end sub_80E4AF8 + + thumb_func_start sub_80E4B54 +sub_80E4B54: @ 80E4B54 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E3DFC + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl sub_80E4A2C + lsls r0, 24 + lsrs r0, 24 + bl sub_80E4BBC + bl sub_80E4D10 + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x5 + bl audio_play + bl sub_80E4AB4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E4BA8 + ldr r1, [r1] + ldr r2, _080E4BAC + adds r1, r2 + ldr r1, [r1] + ldrb r1, [r1, 0x1] + subs r1, 0x1 + cmp r0, r1 + bne _080E4BB0 + movs r0, 0x1 + b _080E4BB2 + .align 2, 0 +_080E4BA8: .4byte 0x02039f94 +_080E4BAC: .4byte 0x00001e28 +_080E4BB0: + movs r0, 0 +_080E4BB2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E4B54 + + thumb_func_start sub_80E4BBC +sub_80E4BBC: @ 80E4BBC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80E4A60 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E4BE0 + ldr r1, [r1] + movs r2, 0xC0 + lsls r2, 5 + adds r1, r2 + adds r1, r0 + strb r4, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E4BE0: .4byte 0x02039f94 + thumb_func_end sub_80E4BBC + + thumb_func_start sub_80E4BE4 +sub_80E4BE4: @ 80E4BE4 + push {r4,r5,lr} + movs r2, 0 + ldr r1, _080E4BF8 + ldr r0, [r1] + ldr r4, _080E4BFC + adds r0, r4 + ldr r0, [r0] + adds r5, r1, 0 + b _080E4C44 + .align 2, 0 +_080E4BF8: .4byte 0x02039f94 +_080E4BFC: .4byte 0x00001e28 +_080E4C00: + ldr r1, [r1] + movs r0, 0xC0 + lsls r0, 5 + adds r3, r1, r0 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E4C34 + cmp r0, 0xFF + beq _080E4C34 + ldr r2, _080E4C30 + adds r0, r1, r2 + ldr r0, [r0] + adds r1, r4 + ldr r1, [r1] + ldrb r2, [r1, 0x1] + adds r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r1, r3, 0 + bl gf_strncpy + b _080E4C4A + .align 2, 0 +_080E4C30: .4byte 0x00001e30 +_080E4C34: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r5, 0 + ldr r0, [r1] + ldr r4, _080E4C50 + adds r0, r4 + ldr r0, [r0] +_080E4C44: + ldrb r0, [r0, 0x1] + cmp r2, r0 + bcc _080E4C00 +_080E4C4A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E4C50: .4byte 0x00001e28 + thumb_func_end sub_80E4BE4 + + thumb_func_start choose_name_or_words_screen_load_bg_tile_patterns +choose_name_or_words_screen_load_bg_tile_patterns: @ 80E4C54 + push {r4-r6,lr} + ldr r0, _080E4CA4 + ldr r6, _080E4CA8 + ldr r1, [r6] + ldr r4, _080E4CAC + adds r1, r4 + bl LZ77UnCompWram + ldr r1, [r6] + adds r1, r4 + movs r5, 0xC0 + lsls r5, 3 + movs r0, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, [r6] + adds r1, r4 + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, [r6] + adds r1, r4 + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _080E4CB0 + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _080E4CB4 + bl gpu_pal_obj_alloc_and_load_multiple + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E4CA4: .4byte 0x08dd3838 +_080E4CA8: .4byte 0x02039f94 +_080E4CAC: .4byte 0x00001810 +_080E4CB0: .4byte 0x0858c1c8 +_080E4CB4: .4byte 0x0858c230 + thumb_func_end choose_name_or_words_screen_load_bg_tile_patterns + + thumb_func_start sub_80E4CB8 +sub_80E4CB8: @ 80E4CB8 + push {lr} + bl sub_80E45F8 + bl sub_80E3920 + pop {r0} + bx r0 + thumb_func_end sub_80E4CB8 + + thumb_func_start choose_name_or_words_screen_apply_bg_pals +choose_name_or_words_screen_apply_bg_pals: @ 80E4CC8 + push {lr} + ldr r0, _080E4CF0 + movs r1, 0 + movs r2, 0xC0 + bl gpu_pal_apply + ldr r0, _080E4CF4 + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl stdpal_get + movs r1, 0xB0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_080E4CF0: .4byte 0x08dd3778 +_080E4CF4: .4byte 0x0858bd78 + thumb_func_end choose_name_or_words_screen_apply_bg_pals + + thumb_func_start sub_80E4CF8 +sub_80E4CF8: @ 80E4CF8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + pop {r0} + bx r0 + thumb_func_end sub_80E4CF8 + + thumb_func_start nullsub_10 +nullsub_10: @ 80E4D0C + bx lr + thumb_func_end nullsub_10 + + thumb_func_start sub_80E4D10 +sub_80E4D10: @ 80E4D10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r7, _080E4DD4 + ldr r1, [r7] + ldr r2, _080E4DD8 + adds r0, r1, r2 + ldr r0, [r0] + ldrb r6, [r0, 0x1] + subs r2, 0x12 + adds r0, r1, r2 + ldrh r0, [r0] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, _080E4DDC + adds r1, r0 + ldrb r0, [r1] + movs r1, 0x11 + bl Window_FastFillPixels + movs r4, 0 + cmp r4, r6 + bcs _080E4DA6 + add r5, sp, 0xC + mov r10, r4 + ldr r0, _080E4DE0 + ldrb r0, [r0] + mov r8, r0 +_080E4D52: + ldr r0, [r7] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r5] + mov r2, r8 + strb r2, [r5, 0x1] + ldrb r0, [r5] + bl sub_80E503C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r0, 0x1 + bne _080E4D76 + movs r1, 0x2 +_080E4D76: + ldr r0, [r7] + ldr r2, _080E4DDC + adds r0, r2 + ldrb r0, [r0] + lsls r3, r4, 3 + add r3, r9 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _080E4D52 +_080E4DA6: + bl sub_80E498C + ldr r5, _080E4DD4 + ldr r0, [r5] + ldr r4, _080E4DDC + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E4DD4: .4byte 0x02039f94 +_080E4DD8: .4byte 0x00001e28 +_080E4DDC: .4byte 0x00001e13 +_080E4DE0: .4byte 0x085e8218 + thumb_func_end sub_80E4D10 + + thumb_func_start sub_80E4DE4 +sub_80E4DE4: @ 80E4DE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _080E4E50 + adds r0, r5, r0 + ldrb r1, [r0] + adds r0, r6, 0 + bl Window_FastFillPixels + movs r4, 0 + ldr r1, _080E4E54 + lsls r0, r5, 2 + adds r0, r1 + ldr r7, [r0] + ldr r0, _080E4E58 + mov r8, r0 +_080E4E0E: + lsls r3, r4, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + lsls r0, r4, 2 + lsls r1, r5, 4 + adds r0, r1 + add r0, r8 + ldr r0, [r0] + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl box_print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080E4E0E + adds r0, r6, 0 + bl Window_WriteStandardTileMap + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E4E50: .4byte 0x0858bf88 +_080E4E54: .4byte 0x0858bf8c +_080E4E58: .4byte 0x0858c198 + thumb_func_end sub_80E4DE4 + + thumb_func_start sub_80E4E5C +sub_80E4E5C: @ 80E4E5C + push {r4-r6,lr} + movs r0, 0xA + bl lcd_io_get + adds r4, r0, 0 + movs r5, 0x3 + ands r4, r5 + movs r0, 0xC + bl lcd_io_get + ands r0, r5 + cmp r4, r0 + bls _080E4E8C + movs r5, 0x1 + movs r6, 0x1 + ldr r1, _080E4E84 + ldr r0, [r1] + ldr r2, _080E4E88 + b _080E4E96 + .align 2, 0 +_080E4E84: .4byte 0x02039f94 +_080E4E88: .4byte 0x00001e11 +_080E4E8C: + movs r5, 0x2 + movs r6, 0x2 + ldr r1, _080E4EE0 + ldr r0, [r1] + ldr r2, _080E4EE4 +_080E4E96: + adds r0, r2 + ldrb r4, [r0] + adds r0, r1, 0 + ldr r1, _080E4EE8 + ldr r0, [r0] + ldr r2, _080E4EEC + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80E4CF8 + bl sub_80E3254 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80E4DE4 + bl sub_80E3254 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl nullsub_10 + adds r0, r6, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E4EE0: .4byte 0x02039f94 +_080E4EE4: .4byte 0x00001e12 +_080E4EE8: .4byte 0x0858bf98 +_080E4EEC: .4byte 0x00001e22 + thumb_func_end sub_80E4E5C + + thumb_func_start sub_80E4EF0 +sub_80E4EF0: @ 80E4EF0 + push {r4,r5,lr} + sub sp, 0x10 + ldr r1, _080E4F48 + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldr r5, _080E4F4C + ldr r0, [r5] + ldr r4, _080E4F50 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0xFF + bl Window_FastFillPixels + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + add r1, sp, 0xC + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, _080E4F54 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl box_print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E4F48: .4byte 0x0858bfa4 +_080E4F4C: .4byte 0x02039f94 +_080E4F50: .4byte 0x00001e15 +_080E4F54: .4byte 0x085eeaf6 + thumb_func_end sub_80E4EF0 + + thumb_func_start sub_80E4F58 +sub_80E4F58: @ 80E4F58 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80E4F58 + + thumb_func_start sub_80E4F70 +sub_80E4F70: @ 80E4F70 + push {lr} + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + pop {r0} + bx r0 + thumb_func_end sub_80E4F70 + + thumb_func_start sub_80E4F84 +sub_80E4F84: @ 80E4F84 + push {lr} + ldr r0, _080E4F90 + bl SetVBlankCallback + pop {r0} + bx r0 + .align 2, 0 +_080E4F90: .4byte sub_80E4F94 + 1 + thumb_func_end sub_80E4F84 + + thumb_func_start sub_80E4F94 +sub_80E4F94: @ 80E4F94 + push {r4,r5,lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + ldr r5, _080E5004 + ldr r0, [r5] + ldr r1, _080E5008 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, [r5] + ldr r1, _080E500C + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + movs r0, 0xA + bl lcd_io_get + ldr r4, _080E5010 + adds r1, r4, 0 + ands r1, r0 + movs r0, 0xA + bl lcd_io_set + ldr r0, [r5] + ldr r1, _080E5014 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xA + bl lcd_io_set_bits + movs r0, 0xC + bl lcd_io_get + ands r4, r0 + movs r0, 0xC + adds r1, r4, 0 + bl lcd_io_set + ldr r0, [r5] + ldr r1, _080E5018 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xC + bl lcd_io_set_bits + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E5004: .4byte 0x02039f94 +_080E5008: .4byte 0x00001e18 +_080E500C: .4byte 0x00001e1a +_080E5010: .4byte 0x0000fffc +_080E5014: .4byte 0x00001e1c +_080E5018: .4byte 0x00001e1e + thumb_func_end sub_80E4F94 + + thumb_func_start sub_80E501C +sub_80E501C: @ 80E501C + push {lr} + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + pop {r0} + bx r0 + thumb_func_end sub_80E501C + + thumb_func_start sub_80E503C +sub_80E503C: @ 80E503C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + ldr r0, _080E5070 + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0xFF + beq _080E5066 + adds r1, r3, 0 +_080E5050: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r4, r0 + beq _080E5066 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E5050 +_080E5066: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E5070: .4byte 0x0858bdc8 + thumb_func_end sub_80E503C + + thumb_func_start sub_80E5074 +sub_80E5074: @ 80E5074 + push {lr} + sub sp, 0x8 + ldr r0, _080E5094 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, _080E5098 + str r0, [sp, 0x4] + movs r0, 0 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080E5094: .4byte 0x03005d90 +_080E5098: .4byte sub_8086194 + 1 + thumb_func_end sub_80E5074 + + thumb_func_start sub_80E509C +sub_80E509C: @ 80E509C + push {lr} + sub sp, 0x8 + ldr r0, _080E50BC + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, _080E50C0 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080E50BC: .4byte 0x03005d90 +_080E50C0: .4byte sub_8086194 + 1 + thumb_func_end sub_80E509C + + thumb_func_start sub_80E50C4 +sub_80E50C4: @ 80E50C4 + push {lr} + sub sp, 0x8 + ldr r0, _080E50E4 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, _080E50E8 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080E50E4: .4byte 0x03005d90 +_080E50E8: .4byte sub_8086194 + 1 + thumb_func_end sub_80E50C4 + + thumb_func_start sub_80E50EC +sub_80E50EC: @ 80E50EC + push {lr} + sub sp, 0x8 + ldr r0, _080E510C + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, _080E5110 + str r0, [sp, 0x4] + movs r0, 0x3 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080E510C: .4byte 0x03005d90 +_080E5110: .4byte sub_8086194 + 1 + thumb_func_end sub_80E50EC + + thumb_func_start decrypt_money +decrypt_money: @ 80E5114 + ldr r1, _080E5124 + ldr r1, [r1] + adds r1, 0xAC + ldr r0, [r0] + ldr r1, [r1] + eors r0, r1 + bx lr + .align 2, 0 +_080E5124: .4byte 0x03005d90 + thumb_func_end decrypt_money + + thumb_func_start encrypt_money +encrypt_money: @ 80E5128 + ldr r2, _080E5138 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + eors r2, r1 + str r2, [r0] + bx lr + .align 2, 0 +_080E5138: .4byte 0x03005d90 + thumb_func_end encrypt_money + + thumb_func_start is_money_greater_than +is_money_greater_than: @ 80E513C + push {r4,lr} + adds r4, r1, 0 + bl decrypt_money + cmp r0, r4 + bcs _080E514C + movs r0, 0 + b _080E514E +_080E514C: + movs r0, 0x1 +_080E514E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end is_money_greater_than + + thumb_func_start add_money +add_money: @ 80E5154 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + bl decrypt_money + adds r5, r0, 0 + adds r0, r5, r4 + ldr r5, _080E5188 + adds r4, r5, 0 + cmp r0, r5 + bhi _080E5178 + adds r5, r0, 0 + adds r0, r6, 0 + bl decrypt_money + cmp r5, r0 + bcs _080E5178 + adds r5, r4, 0 +_080E5178: + adds r0, r6, 0 + adds r1, r5, 0 + bl encrypt_money + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E5188: .4byte 0x000f423f + thumb_func_end add_money + + thumb_func_start subtract_money +subtract_money: @ 80E518C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl decrypt_money + adds r1, r0, 0 + cmp r1, r4 + bcs _080E51A0 + movs r1, 0 + b _080E51A2 +_080E51A0: + subs r1, r4 +_080E51A2: + adds r0, r5, 0 + bl encrypt_money + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end subtract_money + + thumb_func_start sub_80E51B0 +sub_80E51B0: @ 80E51B0 + push {lr} + ldr r0, _080E51CC + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, _080E51D0 + ldrh r1, [r1] + bl is_money_greater_than + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080E51CC: .4byte 0x03005d8c +_080E51D0: .4byte 0x020375e2 + thumb_func_end sub_80E51B0 + + thumb_func_start sub_80E51D4 +sub_80E51D4: @ 80E51D4 + push {lr} + ldr r0, _080E51EC + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, _080E51F0 + ldrh r1, [r1] + bl subtract_money + pop {r0} + bx r0 + .align 2, 0 +_080E51EC: .4byte 0x03005d8c +_080E51F0: .4byte 0x020375e2 + thumb_func_end sub_80E51D4 + + thumb_func_start PrintMoneyAmountInMoneyBox +PrintMoneyAmountInMoneyBox: @ 80E51F4 + push {lr} + sub sp, 0x4 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + movs r1, 0x26 + movs r2, 0x1 + bl PrintMoneyAmount + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end PrintMoneyAmountInMoneyBox + + thumb_func_start PrintMoneyAmount +PrintMoneyAmount: @ 80E5214 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r4, 24 + lsrs r5, r4, 24 + ldr r4, _080E528C + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + subs r1, r0 + ldr r2, _080E5290 + adds r0, r1, 0 + subs r1, 0x1 + cmp r0, 0 + ble _080E5264 + movs r3, 0x77 +_080E5258: + strb r3, [r2] + adds r2, 0x1 + adds r0, r1, 0 + subs r1, 0x1 + cmp r0, 0 + bgt _080E5258 +_080E5264: + ldr r1, _080E5294 + adds r0, r2, 0 + bl ExpandTextCodes + ldr r2, _080E5290 + str r6, [sp] + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + mov r3, r8 + bl Print + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E528C: .4byte 0x02021cc4 +_080E5290: .4byte 0x02021fc4 +_080E5294: .4byte 0x085e969c + thumb_func_end PrintMoneyAmount + + thumb_func_start set_window_border_style_and_print_money_box +set_window_border_style_and_print_money_box: @ 80E5298 + push {r4-r6,lr} + mov r6, r8 + push {r6} + 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 + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end set_window_border_style_and_print_money_box + + thumb_func_start sub_80E52D4 +sub_80E52D4: @ 80E52D4 + push {lr} + adds r1, r0, 0 + ldr r0, _080E52E8 + ldrb r0, [r0] + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + pop {r0} + bx r0 + .align 2, 0 +_080E52E8: .4byte 0x02039f98 + thumb_func_end sub_80E52D4 + + thumb_func_start sub_80E52EC +sub_80E52EC: @ 80E52EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsls r3, 24 + lsrs r6, r4, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + lsrs r5, r3, 24 + adds r3, r0 + lsrs r3, 24 + movs r0, 0xA + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x8 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + bl rbox_template_set + ldr r4, _080E5380 + add r0, sp, 0x10 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0x1 + bl Window_CopyToVram + ldrb r0, [r4] + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + mov r3, r8 + bl set_window_border_style_and_print_money_box + lsls r6, 19 + movs r0, 0x98 + lsls r0, 13 + adds r6, r0 + lsrs r6, 16 + lsls r5, 19 + movs r0, 0xB0 + lsls r0, 12 + adds r5, r0 + lsrs r5, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl AddMoneyTextObject + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E5380: .4byte 0x02039f98 + thumb_func_end sub_80E52EC + + thumb_func_start sub_80E5384 +sub_80E5384: @ 80E5384 + push {r4,lr} + bl sub_80E53F4 + ldr r4, _080E53A8 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E53A8: .4byte 0x02039f98 + thumb_func_end sub_80E5384 + + thumb_func_start AddMoneyTextObject +AddMoneyTextObject: @ 80E53AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080E53E4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _080E53E8 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _080E53EC + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, _080E53F0 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E53E4: .4byte 0x0858c2a4 +_080E53E8: .4byte 0x0858c2ac +_080E53EC: .4byte 0x0858c28c +_080E53F0: .4byte 0x02039f99 + thumb_func_end AddMoneyTextObject + + thumb_func_start sub_80E53F4 +sub_80E53F4: @ 80E53F4 + push {lr} + ldr r0, _080E540C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E5410 + adds r0, r1 + bl obj_delete_and_free_resources + pop {r0} + bx r0 + .align 2, 0 +_080E540C: .4byte 0x02039f99 +_080E5410: .4byte 0x02020630 + thumb_func_end sub_80E53F4 + + thumb_func_start sub_80E5414 +sub_80E5414: @ 80E5414 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsls r1, 16 + ldr r2, _080E5468 + lsrs r0, 13 + adds r0, r2 + ldrb r4, [r0, 0x2] + mov r3, sp + lsrs r1, 13 + adds r1, r2 + ldrb r0, [r1, 0x3] + strb r0, [r3] + mov r2, sp + ldrb r0, [r1, 0x4] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0x5] + strb r0, [r2, 0x2] + mov r0, sp + ldrb r1, [r1, 0x6] + strb r1, [r0, 0x3] + cmp r4, 0 + beq _080E5470 + mov r0, sp + ldrb r0, [r0] + cmp r4, r0 + beq _080E545E + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r4, r0 + beq _080E545E + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r4, r0 + beq _080E545E + cmp r4, r1 + bne _080E5470 +_080E545E: + ldr r0, _080E546C + adds r0, r4, r0 + ldrb r0, [r0] + b _080E5472 + .align 2, 0 +_080E5468: .4byte 0x0858c2b4 +_080E546C: .4byte 0x0858ce8c +_080E5470: + movs r0, 0 +_080E5472: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E5414 + + thumb_func_start nullsub_99 +nullsub_99: @ 80E547C + bx lr + thumb_func_end nullsub_99 + + thumb_func_start sub_80E5480 +sub_80E5480: @ 80E5480 + push {lr} + ldr r3, _080E54AC + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E54AC: .4byte 0x02039f34 + thumb_func_end sub_80E5480 + + thumb_func_start sub_80E54B0 +sub_80E54B0: @ 80E54B0 + push {lr} + ldr r3, _080E54DC + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x11] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E54DC: .4byte 0x02039f34 + thumb_func_end sub_80E54B0 + + thumb_func_start sub_80E54E0 +sub_80E54E0: @ 80E54E0 + ldr r3, _080E5530 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x15] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0xB] + movs r0, 0x71 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + bx lr + .align 2, 0 +_080E5530: .4byte 0x02039f34 + thumb_func_end sub_80E54E0 + + thumb_func_start sub_80E5534 +sub_80E5534: @ 80E5534 + push {lr} + ldr r3, _080E555C + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0, 0x12] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x2 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E555C: .4byte 0x02039f34 + thumb_func_end sub_80E5534 + + thumb_func_start sub_80E5560 +sub_80E5560: @ 80E5560 + push {lr} + ldr r3, _080E558C + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x3 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E558C: .4byte 0x02039f34 + thumb_func_end sub_80E5560 + + thumb_func_start sub_80E5590 +sub_80E5590: @ 80E5590 + push {lr} + ldr r3, _080E55B8 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x14 + strb r1, [r0, 0xF] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x4 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E55B8: .4byte 0x02039f34 + thumb_func_end sub_80E5590 + + thumb_func_start sub_80E55BC +sub_80E55BC: @ 80E55BC + push {lr} + ldr r3, _080E55E8 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x5 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E55E8: .4byte 0x02039f34 + thumb_func_end sub_80E55BC + + thumb_func_start sub_80E55EC +sub_80E55EC: @ 80E55EC + push {r4,r5,lr} + movs r2, 0 + ldr r5, _080E5660 + ldr r0, [r5] + ldr r1, [r0, 0x8] + ldrb r4, [r1, 0x11] + adds r3, r1, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _080E563A + subs r0, 0x1 + ldrb r1, [r1] + cmp r0, r1 + beq _080E5622 + adds r3, r5, 0 +_080E560A: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080E5622 + ldr r0, [r3] + ldr r1, [r0, 0x8] + adds r0, r1, r4 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r2 + ldrb r1, [r1] + cmp r0, r1 + bne _080E560A +_080E5622: + ldr r1, _080E5660 + ldr r0, [r1] + ldr r0, [r0, 0x8] + strb r2, [r0, 0x8] + ldr r0, [r1] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + lsrs r2, r0, 24 +_080E563A: + cmp r2, 0 + bne _080E564C + ldr r0, _080E5660 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E564C: + ldr r0, _080E5660 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E5660: .4byte 0x02039f34 + thumb_func_end sub_80E55EC + + thumb_func_start c3_080493E4 +c3_080493E4: @ 80E5664 + push {r4-r6,lr} + movs r1, 0 + ldr r2, _080E56DC + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r5, [r0, 0x11] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _080E56B4 + movs r3, 0 + movs r4, 0 + adds r6, r2, 0 +_080E567E: + ldr r0, [r6] + ldr r2, [r0, 0x8] + adds r0, r2, r5 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5698 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r4 + strb r3, [r0] + adds r4, 0x1 +_080E5698: + adds r3, 0x1 + cmp r3, 0x3 + ble _080E567E + ldr r0, _080E56DC + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x8 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] + bl sub_80E6A2C + lsls r0, 24 + lsrs r1, r0, 24 +_080E56B4: + cmp r1, 0 + bne _080E56C6 + ldr r0, _080E56DC + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E56C6: + ldr r0, _080E56DC + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E56DC: .4byte 0x02039f34 + thumb_func_end c3_080493E4 + + thumb_func_start sub_80E56E0 +sub_80E56E0: @ 80E56E0 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x14 + cmp r0, 0x1 + bls _080E5702 + movs r1, 0x3C + cmp r0, 0x7 + bhi _080E5702 + movs r1, 0x28 +_080E5702: + ldr r0, _080E5714 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strh r1, [r0, 0x4] + bl sub_80E55EC + pop {r0} + bx r0 + .align 2, 0 +_080E5714: .4byte 0x02039f34 + thumb_func_end sub_80E56E0 + + thumb_func_start sub_80E5718 +sub_80E5718: @ 80E5718 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r1, _080E57C8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r5, [r0, 0x11] + adds r0, r5 + ldrb r0, [r0] + mov r8, r1 + cmp r0, 0 + beq _080E579E + movs r4, 0 + mov r6, r8 +_080E5736: + ldr r0, [r6] + ldr r2, [r0, 0x8] + adds r0, r2, r5 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5798 + strb r4, [r2, 0x8] + ldr r0, [r6] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r0, 0 + beq _080E5782 + movs r1, 0xA + cmp r0, 0x2 + bls _080E5782 + movs r1, 0x14 + cmp r0, 0x4 + bls _080E5782 + movs r1, 0x1E + cmp r0, 0x6 + bls _080E5782 + movs r1, 0x3C + cmp r0, 0x8 + bhi _080E5782 + movs r1, 0x28 +_080E5782: + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r1, [r0, 0x4] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E5798 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_080E5798: + adds r4, 0x1 + cmp r4, 0x3 + ble _080E5736 +_080E579E: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + cmp r7, 0 + bne _080E57BE + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E57BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E57C8: .4byte 0x02039f34 + thumb_func_end sub_80E5718 + + thumb_func_start sub_80E57CC +sub_80E57CC: @ 80E57CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r9, r0 + ldr r1, _080E5888 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r2, [r0, 0x11] + mov r8, r2 + add r0, r8 + ldrb r0, [r0] + mov r10, r1 + cmp r0, 0 + beq _080E5858 + movs r6, 0 + mov r7, r10 + movs r5, 0 +_080E57F4: + ldr r2, [r7] + ldr r0, [r2, 0x8] + mov r3, r8 + adds r1, r0, r3 + adds r0, r6 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bls _080E5850 + ldr r0, [r2, 0x4] + adds r0, r5, r0 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E5850 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5850 + ldr r0, [r7] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r0, [r2, 0x15] + movs r3, 0x11 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r0, [r7] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r0, [r2, 0x15] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x15] + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80DD3D4 + movs r0, 0x1 + mov r9, r0 +_080E5850: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080E57F4 +_080E5858: + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x7 + bl sub_80DD3D4 + mov r2, r9 + cmp r2, 0 + bne _080E587A + mov r3, r10 + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E587A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E5888: .4byte 0x02039f34 + thumb_func_end sub_80E57CC + + thumb_func_start sub_80E588C +sub_80E588C: @ 80E588C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + ldr r1, _080E58D4 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r7, [r0, 0x11] + adds r0, r7 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0 + beq _080E590A + movs r5, 0 + movs r6, 0 + mov r8, r4 +_080E58B0: + ldr r3, [r4] + ldr r2, [r3, 0x8] + adds r0, r2, r7 + adds r1, r2, r5 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5900 + ldr r0, [r3, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E58D8 + movs r0, 0x32 + b _080E58DA + .align 2, 0 +_080E58D4: .4byte 0x02039f34 +_080E58D8: + movs r0, 0xA +_080E58DA: + strh r0, [r2, 0x4] + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + strb r5, [r0, 0x8] + ldr r0, [r1] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E5900 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080E5900: + adds r6, 0x1C + adds r5, 0x1 + ldr r4, _080E5934 + cmp r5, 0x3 + ble _080E58B0 +_080E590A: + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + mov r0, r9 + cmp r0, 0 + bne _080E5928 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E5928: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E5934: .4byte 0x02039f34 + thumb_func_end sub_80E588C + + thumb_func_start sub_80E5938 +sub_80E5938: @ 80E5938 + push {r4,lr} + ldr r4, _080E596C + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x11] + bl c3_080493E4 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E596C: .4byte 0x02039f34 + thumb_func_end sub_80E5938 + + thumb_func_start sub_80E5970 +sub_80E5970: @ 80E5970 + push {r4,lr} + ldr r4, _080E59A8 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + ldr r1, _080E59AC + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + bl sub_80E6934 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E59A8: .4byte 0x02039f34 +_080E59AC: .4byte 0x0858c2b4 + thumb_func_end sub_80E5970 + + thumb_func_start sub_80E59B0 +sub_80E59B0: @ 80E59B0 + push {lr} + movs r0, 0 + bl sub_80E6934 + ldr r0, _080E59CC + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E59CC: .4byte 0x02039f34 + thumb_func_end sub_80E59B0 + + thumb_func_start sub_80E59D0 +sub_80E59D0: @ 80E59D0 + push {lr} + movs r0, 0x1 + bl sub_80E6934 + ldr r0, _080E59EC + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E59EC: .4byte 0x02039f34 + thumb_func_end sub_80E59D0 + + thumb_func_start sub_80E59F0 +sub_80E59F0: @ 80E59F0 + push {lr} + movs r0, 0x2 + bl sub_80E6934 + ldr r0, _080E5A0C + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E5A0C: .4byte 0x02039f34 + thumb_func_end sub_80E59F0 + + thumb_func_start sub_80E5A10 +sub_80E5A10: @ 80E5A10 + push {lr} + movs r0, 0x3 + bl sub_80E6934 + ldr r0, _080E5A2C + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E5A2C: .4byte 0x02039f34 + thumb_func_end sub_80E5A10 + + thumb_func_start sub_80E5A30 +sub_80E5A30: @ 80E5A30 + push {lr} + movs r0, 0x4 + bl sub_80E6934 + ldr r0, _080E5A4C + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .align 2, 0 +_080E5A4C: .4byte 0x02039f34 + thumb_func_end sub_80E5A30 + + thumb_func_start sub_80E5A50 +sub_80E5A50: @ 80E5A50 + push {r4-r6,lr} + movs r4, 0 + ldr r2, _080E5A9C + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x11] + adds r0, r1 + ldrb r0, [r0] + adds r6, r2, 0 + cmp r0, 0x3 + beq _080E5AB0 + movs r5, 0 +_080E5A68: + ldr r0, _080E5A9C + ldr r0, [r0] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0x11] + adds r0, r1, r0 + ldrb r0, [r0] + adds r0, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + bne _080E5AAA + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5AA0 + adds r0, r4, 0 + bl sub_80DD560 + adds r0, r4, 0 + movs r1, 0xA + b _080E5AA4 + .align 2, 0 +_080E5A9C: .4byte 0x02039f34 +_080E5AA0: + adds r0, r4, 0 + movs r1, 0x3C +_080E5AA4: + bl sub_80DD3D4 + movs r4, 0x1 +_080E5AAA: + adds r5, 0x1 + cmp r5, 0x3 + ble _080E5A68 +_080E5AB0: + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x9 + bl sub_80DD3D4 + cmp r4, 0 + bne _080E5ACC + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E5ACC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E5A50 + + thumb_func_start sub_80E5AD4 +sub_80E5AD4: @ 80E5AD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0 + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x18] + mov r0, sp + movs r1, 0xFF + movs r2, 0x5 + bl memset + movs r5, 0 + movs r4, 0 + add r2, sp, 0x10 + mov r8, r2 + add r3, sp, 0x8 + mov r10, r3 + movs r6, 0 +_080E5B00: + ldr r0, _080E5B4C + ldr r2, [r0] + ldr r1, [r2, 0x8] + ldrb r0, [r1, 0x11] + adds r0, r1, r0 + adds r1, r5 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080E5B38 + ldr r0, [r2, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080E5B38 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080E5B38 + mov r1, sp + adds r0, r1, r4 + strb r5, [r0] + adds r4, 0x1 +_080E5B38: + adds r6, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080E5B00 + cmp r4, 0x1 + bne _080E5B50 + movs r0, 0x3C + mov r2, r8 + strh r0, [r2] + b _080E5B7E + .align 2, 0 +_080E5B4C: .4byte 0x02039f34 +_080E5B50: + cmp r4, 0x2 + bne _080E5B5E + movs r0, 0x1E + mov r3, r8 + strh r0, [r3] + strh r0, [r3, 0x2] + b _080E5B7E +_080E5B5E: + cmp r4, 0x3 + bne _080E5B6E + movs r0, 0x14 + mov r6, r8 + strh r0, [r6] + strh r0, [r6, 0x2] + strh r0, [r6, 0x4] + b _080E5B7E +_080E5B6E: + mov r1, r8 + movs r2, 0 + mov r0, r8 + adds r0, 0x6 +_080E5B76: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080E5B76 +_080E5B7E: + movs r5, 0 + ldr r7, _080E5BC4 + movs r6, 0 + mov r4, r10 +_080E5B86: + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E5BD0 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _080E5BD0 + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrh r0, [r0, 0x8] + lsls r0, 3 + ldr r1, _080E5BC8 + adds r0, r1 + ldrb r0, [r0, 0x2] + ldr r2, _080E5BCC + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + b _080E5BD2 + .align 2, 0 +_080E5BC4: .4byte 0x02039f34 +_080E5BC8: .4byte 0x0858c2b4 +_080E5BCC: .4byte 0x0858ce8c +_080E5BD0: + movs r0, 0 +_080E5BD2: + strh r0, [r4] + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4] + subs r0, r1 + strh r0, [r4] + adds r6, 0x1C + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080E5B86 + mov r3, r8 + movs r6, 0 + ldrsh r0, [r3, r6] + cmp r0, 0 + beq _080E5CA0 + movs r5, 0 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E5CA0 + mov r4, sp +_080E5C16: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r5, 1 + add r1, r8 + movs r3, 0 + ldrsh r2, [r1, r3] + ldrb r3, [r4] + lsls r1, r3, 1 + add r1, r10 + movs r6, 0 + ldrsh r1, [r1, r6] + adds r2, r1 + cmp r0, r2 + bge _080E5C66 + adds r0, r3, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5C70 + ldrb r0, [r4] + bl sub_80DD560 + ldrb r0, [r4] + movs r1, 0xA + bl sub_80DD3D4 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + b _080E5C6A +_080E5C66: + movs r0, 0x1 + str r0, [sp, 0x18] +_080E5C6A: + ldr r1, [sp, 0x18] + cmp r1, 0 + beq _080E5C86 +_080E5C70: + movs r2, 0 + str r2, [sp, 0x18] + ldrb r0, [r4] + movs r1, 0x3C + bl sub_80DD3D4 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080E5C86: + ldr r0, _080E5CD0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0xD + ldrb r3, [r4] + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + adds r4, 0x1 + adds r5, 0x1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080E5C16 +_080E5CA0: + ldr r6, _080E5CD0 + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xB + bl sub_80DD3D4 + mov r0, r9 + cmp r0, 0 + bne _080E5CC0 + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E5CC0: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E5CD0: .4byte 0x02039f34 + thumb_func_end sub_80E5AD4 + + thumb_func_start sub_80E5CD4 +sub_80E5CD4: @ 80E5CD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + movs r6, 0 + ldr r7, _080E5D78 + movs r5, 0 +_080E5CE4: + ldr r2, [r7] + ldr r0, [r2, 0x8] + ldrb r1, [r0, 0x11] + adds r1, r0, r1 + adds r0, r6 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bls _080E5D46 + ldr r0, [r2, 0x4] + adds r0, r5, r0 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _080E5D46 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5D46 + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + movs r1, 0 + strb r1, [r0, 0xD] + ldr r0, [r7] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r1, [r2, 0x10] + movs r3, 0x31 + negs r3, r3 + adds r0, r3, 0 + ands r1, r0 + movs r0, 0x20 + orrs r1, r0 + strb r1, [r2, 0x10] + adds r0, r4, 0 + movs r1, 0xD + bl sub_80DD3D4 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080E5D46: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080E5CE4 + ldr r4, _080E5D78 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xC + bl sub_80DD3D4 + mov r0, r8 + cmp r0, 0 + bne _080E5D6E + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x39 + bl sub_80DD3F0 +_080E5D6E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E5D78: .4byte 0x02039f34 + thumb_func_end sub_80E5CD4 + + thumb_func_start sub_80E5D7C +sub_80E5D7C: @ 80E5D7C + push {r4-r7,lr} + movs r7, 0 + movs r4, 0 + ldr r5, _080E5DAC + movs r6, 0 +_080E5D86: + ldr r3, [r5] + ldr r2, [r3, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5DD2 + ldr r0, [r3, 0x4] + adds r0, r6, r0 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _080E5DB0 + movs r0, 0x28 + b _080E5DB2 + .align 2, 0 +_080E5DAC: .4byte 0x02039f34 +_080E5DB0: + movs r0, 0xA +_080E5DB2: + strh r0, [r2, 0x4] + ldr r0, [r5] + ldr r0, [r0, 0x8] + strb r4, [r0, 0x8] + ldr r0, [r5] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E5DD2 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_080E5DD2: + adds r6, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080E5D86 + ldr r4, _080E5E00 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xE + bl sub_80DD3D4 + cmp r7, 0 + bne _080E5DF8 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x39 + bl sub_80DD3F0 +_080E5DF8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E5E00: .4byte 0x02039f34 + thumb_func_end sub_80E5D7C + + thumb_func_start sub_80E5E04 +sub_80E5E04: @ 80E5E04 + push {r4,lr} + ldr r1, _080E5E4C + ldr r0, _080E5E50 + ldr r4, [r0] + ldr r0, [r4, 0x8] + ldrb r2, [r0, 0x11] + adds r1, r2, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _080E5E46 + ldr r0, [r4, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + ldr r3, _080E5E54 + ldr r2, _080E5E58 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xF + bl sub_80DD3D4 +_080E5E46: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E5E4C: .4byte 0x02039f26 +_080E5E50: .4byte 0x02039f34 +_080E5E54: .4byte 0x0858cdcc +_080E5E58: .4byte 0x0858c2b4 + thumb_func_end sub_80E5E04 + + thumb_func_start sub_80E5E5C +sub_80E5E5C: @ 80E5E5C + push {r4,lr} + ldr r1, _080E5EA4 + ldr r0, _080E5EA8 + ldr r4, [r0] + ldr r0, [r4, 0x8] + ldrb r2, [r0, 0x11] + adds r1, r2, r1 + ldrb r0, [r1] + cmp r0, 0x3 + bne _080E5E9E + ldr r0, [r4, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + ldr r3, _080E5EAC + ldr r2, _080E5EB0 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x10 + bl sub_80DD3D4 +_080E5E9E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E5EA4: .4byte 0x02039f26 +_080E5EA8: .4byte 0x02039f34 +_080E5EAC: .4byte 0x0858cdcc +_080E5EB0: .4byte 0x0858c2b4 + thumb_func_end sub_80E5E5C + + thumb_func_start sub_80E5EB4 +sub_80E5EB4: @ 80E5EB4 + push {r4-r7,lr} + movs r1, 0 + movs r5, 0 + ldr r0, _080E5F08 + ldr r4, [r0] + ldr r2, [r4, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + ldrb r6, [r0] + movs r3, 0 +_080E5EC8: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r6, r0 + bls _080E5EDA + ldr r0, [r4, 0x4] + adds r0, r3, r0 + movs r7, 0x2 + ldrsh r0, [r0, r7] + adds r5, r0 +_080E5EDA: + adds r3, 0x1C + adds r1, 0x1 + cmp r1, 0x3 + ble _080E5EC8 + cmp r5, 0 + bge _080E5EE8 + movs r5, 0 +_080E5EE8: + ldr r0, _080E5F08 + ldr r3, [r0] + ldr r0, [r3, 0x8] + ldrb r2, [r0, 0x11] + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E5EFC + cmp r5, 0 + bne _080E5F0C +_080E5EFC: + adds r0, r2, 0 + movs r1, 0x12 + bl sub_80DD3D4 + b _080E5F2C + .align 2, 0 +_080E5F08: .4byte 0x02039f34 +_080E5F0C: + ldr r0, [r3, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r3, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x11 + bl sub_80DD3D4 +_080E5F2C: + ldr r4, _080E5F60 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + movs r7, 0x2 + ldrsh r0, [r0, r7] + bl sub_80E6B70 + ldr r2, [r4] + ldr r1, [r2, 0x8] + ldrb r3, [r1, 0x11] + ldr r2, [r2, 0x4] + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r2 + strh r0, [r1, 0x2] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E5F60: .4byte 0x02039f34 + thumb_func_end sub_80E5EB4 + + thumb_func_start sub_80E5F64 +sub_80E5F64: @ 80E5F64 + push {r4-r7,lr} + movs r6, 0 + ldr r0, _080E5FC0 + ldr r4, [r0] + ldr r2, [r4, 0x8] + ldrb r1, [r2, 0x11] + adds r3, r2, r1 + ldrb r1, [r3] + adds r7, r0, 0 + cmp r1, 0 + beq _080E5FB2 + movs r1, 0 + adds r5, r4, 0 + adds r4, r2, 0 + ldrb r0, [r3] + subs r3, r0, 0x1 + movs r2, 0 +_080E5F86: + adds r0, r4, r1 + ldrb r0, [r0] + cmp r3, r0 + bne _080E5F94 + ldr r0, [r5, 0x4] + adds r0, r2, r0 + ldrh r6, [r0, 0x2] +_080E5F94: + adds r2, 0x1C + adds r1, 0x1 + cmp r1, 0x3 + ble _080E5F86 + ldr r3, [r7] + ldr r0, [r3, 0x8] + ldrb r2, [r0, 0x11] + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E5FB2 + lsls r0, r6, 16 + asrs r4, r0, 16 + cmp r4, 0 + bgt _080E5FC4 +_080E5FB2: + ldr r0, [r7] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x14 + bl sub_80DD3D4 + b _080E5FDE + .align 2, 0 +_080E5FC0: .4byte 0x02039f34 +_080E5FC4: + ldr r1, [r3, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x2] + adds r1, r4, r1 + strh r1, [r0, 0x2] + ldr r0, [r3, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x13 + bl sub_80DD3D4 +_080E5FDE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E5F64 + + thumb_func_start sub_80E5FE4 +sub_80E5FE4: @ 80E5FE4 + push {r4,r5,lr} + ldr r1, _080E6008 + ldr r3, [r1] + ldr r0, [r3, 0x8] + ldrb r2, [r0, 0x11] + adds r0, r2 + ldrb r4, [r0] + adds r5, r1, 0 + cmp r4, 0 + bne _080E600C + ldr r0, [r3, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0xA + b _080E601C + .align 2, 0 +_080E6008: .4byte 0x02039f34 +_080E600C: + ldr r0, [r3, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 +_080E601C: + strh r0, [r1, 0x2] + cmp r4, 0 + bne _080E6030 + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x15 + bl sub_80DD3D4 + b _080E6060 +_080E6030: + cmp r4, 0x1 + bne _080E6042 + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x16 + bl sub_80DD3D4 + b _080E6060 +_080E6042: + cmp r4, 0x2 + bne _080E6054 + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x17 + bl sub_80DD3D4 + b _080E6060 +_080E6054: + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x18 + bl sub_80DD3D4 +_080E6060: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E5FE4 + + thumb_func_start sub_80E6068 +sub_80E6068: @ 80E6068 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x2 + bhi _080E6098 + movs r4, 0xA + ldr r0, _080E6094 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1A + bl sub_80DD3D4 + b _080E60FC + .align 2, 0 +_080E6094: .4byte 0x02039f34 +_080E6098: + cmp r0, 0x5 + bhi _080E60B4 + movs r4, 0x14 + ldr r0, _080E60B0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1B + bl sub_80DD3D4 + b _080E60FC + .align 2, 0 +_080E60B0: .4byte 0x02039f34 +_080E60B4: + cmp r0, 0x7 + bhi _080E60D0 + movs r4, 0x28 + ldr r0, _080E60CC + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1C + bl sub_80DD3D4 + b _080E60FC + .align 2, 0 +_080E60CC: .4byte 0x02039f34 +_080E60D0: + cmp r1, 0x8 + bhi _080E60EC + movs r4, 0x3C + ldr r0, _080E60E8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1D + bl sub_80DD3D4 + b _080E60FC + .align 2, 0 +_080E60E8: .4byte 0x02039f34 +_080E60EC: + movs r4, 0x50 + ldr r0, _080E6118 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1E + bl sub_80DD3D4 +_080E60FC: + ldr r0, _080E6118 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E6118: .4byte 0x02039f34 + thumb_func_end sub_80E6068 + + thumb_func_start sub_80E611C +sub_80E611C: @ 80E611C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, _080E61A0 + ldr r0, [r2] + ldr r3, [r0, 0x8] + ldrb r0, [r3, 0x11] + adds r0, r3, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r2 + cmp r1, 0 + beq _080E61F8 + mov r7, r8 + ldrb r6, [r3] +_080E6140: + movs r2, 0 + lsls r0, r4, 24 + asrs r1, r0, 24 + adds r5, r0, 0 + cmp r6, r1 + beq _080E616A + ldr r4, _080E61A0 +_080E614E: + lsls r0, r2, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r2, r0, 24 + asrs r3, r0, 24 + cmp r3, 0x3 + bgt _080E616A + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r0, r3 + ldrb r0, [r0] + cmp r0, r1 + bne _080E614E +_080E616A: + ldr r0, [r7] + lsls r3, r2, 24 + asrs r1, r3, 24 + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + mov r12, r3 + cmp r0, 0 + bne _080E6190 + ldrb r1, [r2, 0xC] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _080E61A4 +_080E6190: + movs r1, 0xFF + lsls r1, 24 + adds r0, r5, r1 + lsrs r4, r0, 24 + cmp r0, 0 + blt _080E61F8 + b _080E6140 + .align 2, 0 +_080E61A0: .4byte 0x02039f34 +_080E61A4: + mov r2, r8 + ldr r6, [r2] + ldr r0, [r6, 0x8] + ldrb r1, [r0, 0x11] + ldr r4, [r6, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r5, r0, r4 + ldrh r0, [r5, 0x6] + ldr r3, _080E6204 + lsls r0, 3 + adds r7, r0, r3 + ldrb r2, [r7, 0x1] + lsls r2, 29 + mov r0, r12 + asrs r1, r0, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x6] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r2, r0 + bne _080E61F8 + ldr r1, _080E6208 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r5, 0x2] + ldr r0, [r6, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1F + bl sub_80DD3D4 +_080E61F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E6204: .4byte 0x0858c2b4 +_080E6208: .4byte 0x0858cdcc + thumb_func_end sub_80E611C + + thumb_func_start sub_80E620C +sub_80E620C: @ 80E620C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, _080E6298 + ldr r3, [r0] + ldr r1, [r3, 0x8] + ldrb r2, [r1, 0x11] + adds r1, r2 + ldrb r1, [r1] + mov r9, r0 + cmp r1, 0 + beq _080E62AC + ldr r1, [r3, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + mov r8, r0 + movs r6, 0 + ldr r0, _080E629C + mov r12, r0 + movs r7, 0 +_080E623C: + mov r1, r9 + ldr r4, [r1] + ldr r0, [r4, 0x8] + ldrb r2, [r0, 0x11] + adds r1, r0, r2 + ldrb r1, [r1] + subs r1, 0x1 + adds r0, r6 + ldrb r0, [r0] + cmp r1, r0 + bne _080E62A4 + mov r1, r8 + lsls r0, r1, 3 + mov r1, r12 + adds r5, r0, r1 + ldrb r1, [r5, 0x1] + lsls r1, 29 + ldr r3, [r4, 0x4] + adds r0, r7, r3 + ldrh r0, [r0, 0x6] + lsls r0, 3 + add r0, r12 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r1, r0 + beq _080E62A4 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r3 + ldr r2, _080E62A0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x20 + bl sub_80DD3D4 + b _080E62AC + .align 2, 0 +_080E6298: .4byte 0x02039f34 +_080E629C: .4byte 0x0858c2b4 +_080E62A0: .4byte 0x0858cdcc +_080E62A4: + adds r7, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080E623C +_080E62AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E620C + + thumb_func_start sub_80E62B8 +sub_80E62B8: @ 80E62B8 + push {r4-r7,lr} + ldr r0, _080E6310 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x11] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080E632E + movs r5, 0 + movs r6, 0 +_080E62CE: + ldr r0, _080E6310 + ldr r4, [r0] + ldr r1, [r4, 0x8] + ldrb r2, [r1, 0x11] + adds r0, r1, r2 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + bne _080E6326 + ldr r1, [r4, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r3, r0, r1 + adds r1, r6, r1 + movs r0, 0x2 + ldrsh r2, [r3, r0] + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r2, r0 + ble _080E6314 + adds r0, r2, 0 + lsls r0, 1 + strh r0, [r3, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x21 + bl sub_80DD3D4 + b _080E6326 + .align 2, 0 +_080E6310: .4byte 0x02039f34 +_080E6314: + cmp r2, r0 + bge _080E6326 + movs r0, 0 + strh r0, [r3, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x22 + bl sub_80DD3D4 +_080E6326: + adds r6, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080E62CE +_080E632E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E62B8 + + thumb_func_start sub_80E6334 +sub_80E6334: @ 80E6334 + push {r4,lr} + ldr r4, _080E6384 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrb r3, [r1, 0xD] + movs r0, 0xD + ldrsb r0, [r1, r0] + cmp r0, 0x1D + bgt _080E6388 + adds r0, r3, 0 + adds r0, 0xA + strb r0, [r1, 0xD] + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x10] + movs r1, 0x31 + negs r1, r1 + ands r1, r2 + movs r2, 0x10 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x23 + bl sub_80DD3D4 + b _080E6390 + .align 2, 0 +_080E6384: .4byte 0x02039f34 +_080E6388: + adds r0, r2, 0 + movs r1, 0x3A + bl sub_80DD3D4 +_080E6390: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E6334 + + thumb_func_start sub_80E6398 +sub_80E6398: @ 80E6398 + push {lr} + ldr r3, _080E63D8 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x11] + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080E63DC + adds r0, r2, 0 + movs r1, 0x24 + bl sub_80DD3D4 + b _080E63E4 + .align 2, 0 +_080E63D8: .4byte 0x02039f34 +_080E63DC: + adds r0, r2, 0 + movs r1, 0x3B + bl sub_80DD3D4 +_080E63E4: + pop {r0} + bx r0 + thumb_func_end sub_80E6398 + + thumb_func_start sub_80E63E8 +sub_80E63E8: @ 80E63E8 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, _080E6470 + ldr r2, [r0] + ldr r1, [r2] + ldrb r1, [r1, 0x1] + mov r12, r0 + cmp r1, 0x4 + bne _080E63FC + b _080E6518 +_080E63FC: + movs r6, 0 + adds r4, r2, 0 +_080E6400: + lsls r1, r6, 24 + asrs r1, 24 + mov r0, sp + adds r3, r0, r1 + ldr r2, [r4, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + strb r0, [r3] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E6400 + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + mov r2, sp + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + movs r6, 0 + mov r3, r12 + ldr r7, [r3] +_080E6438: + movs r5, 0 +_080E643A: + lsls r0, r5, 24 + asrs r2, r0, 24 + ldr r0, [r7, 0x8] + ldrb r0, [r0, 0x11] + cmp r2, r0 + beq _080E6474 + lsls r0, r6, 24 + asrs r3, r0, 24 + mov r0, sp + adds r4, r0, r2 + ldrb r1, [r4] + cmp r3, r1 + bne _080E6474 + ldr r0, [r7, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsls r0, r3, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x19] + cmp r0, r1 + bne _080E6474 + adds r0, r3, 0x1 + strb r0, [r4] + b _080E6484 + .align 2, 0 +_080E6470: .4byte 0x02039f34 +_080E6474: + lsls r0, r5, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r5, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E643A +_080E6484: + cmp r5, 0x4 + beq _080E6498 + lsls r0, r6, 24 + movs r3, 0x80 + lsls r3, 17 + adds r0, r3 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E6438 +_080E6498: + mov r4, r12 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + mov r3, sp + adds r2, r3, r0 + movs r0, 0 + strb r0, [r2] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x10] + movs r1, 0x3F + ands r1, r2 + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0, 0x10] + movs r6, 0 + mov r3, r12 +_080E64C6: + ldr r0, [r3] + lsls r1, r6, 24 + asrs r1, 24 + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + mov r4, sp + adds r2, r4, r1 + ldrb r2, [r2] + strb r2, [r0, 0x19] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E64C6 + mov r0, r12 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x11] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x11] + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x25 + bl sub_80DD3D4 +_080E6518: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E63E8 + + thumb_func_start sub_80E6520 +sub_80E6520: @ 80E6520 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, _080E65B0 + ldr r2, [r0] + ldr r1, [r2] + ldrb r1, [r1, 0x1] + mov r12, r0 + cmp r1, 0x4 + bne _080E6538 + b _080E6658 +_080E6538: + movs r6, 0 + adds r4, r2, 0 +_080E653C: + lsls r1, r6, 24 + asrs r1, 24 + mov r0, sp + adds r3, r0, r1 + ldr r2, [r4, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + strb r0, [r3] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E653C + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + mov r2, sp + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + movs r6, 0x3 + mov r3, r12 + ldr r7, [r3] + movs r4, 0x1 + negs r4, r4 + mov r8, r4 +_080E657A: + movs r5, 0 +_080E657C: + lsls r0, r5, 24 + asrs r2, r0, 24 + ldr r0, [r7, 0x8] + ldrb r0, [r0, 0x11] + cmp r2, r0 + beq _080E65B4 + lsls r0, r6, 24 + asrs r3, r0, 24 + mov r0, sp + adds r4, r0, r2 + ldrb r1, [r4] + cmp r3, r1 + bne _080E65B4 + ldr r0, [r7, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsls r0, r3, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x19] + cmp r0, r1 + bne _080E65B4 + subs r0, r3, 0x1 + strb r0, [r4] + b _080E65C4 + .align 2, 0 +_080E65B0: .4byte 0x02039f34 +_080E65B4: + lsls r0, r5, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r5, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E657C +_080E65C4: + cmp r5, 0x4 + beq _080E65D8 + lsls r0, r6, 24 + movs r3, 0xFF + lsls r3, 24 + adds r0, r3 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, r8 + bgt _080E657A +_080E65D8: + mov r4, r12 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + mov r3, sp + adds r2, r3, r0 + movs r0, 0x3 + strb r0, [r2] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x10] + movs r1, 0x3F + ands r1, r2 + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0, 0x10] + movs r6, 0 + mov r3, r12 +_080E6606: + ldr r0, [r3] + lsls r1, r6, 24 + asrs r1, 24 + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + mov r4, sp + adds r2, r4, r1 + ldrb r2, [r2] + strb r2, [r0, 0x19] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E6606 + mov r0, r12 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x11] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x11] + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x26 + bl sub_80DD3D4 +_080E6658: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E6520 + + thumb_func_start nullsub_100 +nullsub_100: @ 80E6664 + bx lr + thumb_func_end nullsub_100 + + thumb_func_start sub_80E6668 +sub_80E6668: @ 80E6668 + push {r4-r7,lr} + sub sp, 0x8 + ldr r0, _080E66E4 + ldr r1, [r0] + ldr r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + beq _080E676C + movs r6, 0 + add r5, sp, 0x4 + adds r4, r1, 0 + adds r7, r5, 0 +_080E6680: + lsls r1, r6, 24 + asrs r1, 24 + mov r0, sp + adds r3, r0, r1 + ldr r2, [r4, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + strb r0, [r3] + adds r0, r7, r1 + strb r6, [r0] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E6680 + movs r6, 0 + adds r7, r5, 0 +_080E66AA: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + lsls r2, r6, 24 + asrs r2, 24 + movs r1, 0x4 + subs r1, r2 + bl __modsi3 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0 +_080E66C4: + lsls r0, r1, 24 + asrs r2, r0, 24 + adds r3, r7, r2 + ldrb r1, [r3] + adds r5, r0, 0 + cmp r1, 0xFF + beq _080E66EE + cmp r4, 0 + bne _080E66E8 + mov r1, sp + adds r0, r1, r2 + strb r6, [r0] + movs r0, 0xFF + strb r0, [r3] + b _080E66FC + .align 2, 0 +_080E66E4: .4byte 0x02039f34 +_080E66E8: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080E66EE: + movs r1, 0x80 + lsls r1, 17 + adds r0, r5, r1 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E66C4 +_080E66FC: + lsls r0, r6, 24 + movs r6, 0x80 + lsls r6, 17 + adds r0, r6 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E66AA + movs r6, 0 + ldr r5, _080E6774 + adds r4, r5, 0 +_080E6712: + ldr r0, [r4] + lsls r3, r6, 24 + asrs r3, 24 + ldr r1, [r0, 0x4] + lsls r2, r3, 3 + subs r2, r3 + lsls r2, 2 + adds r1, r2, r1 + mov r6, sp + adds r0, r6, r3 + ldrb r0, [r0] + strb r0, [r1, 0x19] + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r2, r0 + ldrb r1, [r2, 0x10] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x10] + adds r3, 0x1 + lsls r3, 24 + lsrs r6, r3, 24 + asrs r3, 24 + cmp r3, 0x3 + ble _080E6712 + ldr r1, [r5] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x11] + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x27 + bl sub_80DD3D4 +_080E676C: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E6774: .4byte 0x02039f34 + thumb_func_end sub_80E6668 + + thumb_func_start sub_80E6778 +sub_80E6778: @ 80E6778 + push {lr} + ldr r3, _080E67B0 + ldr r0, _080E67B4 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r2, r0, r1 + ldrh r0, [r2, 0x6] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 29 + ldr r1, _080E67B8 + lsrs r0, 29 + ldrh r1, [r1] + cmp r0, r1 + beq _080E67AA + ldrb r0, [r2, 0x11] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x11] +_080E67AA: + pop {r0} + bx r0 + .align 2, 0 +_080E67B0: .4byte 0x0858c2b4 +_080E67B4: .4byte 0x02039f34 +_080E67B8: .4byte 0x02039f2c + thumb_func_end sub_80E6778 + + thumb_func_start sub_80E67BC +sub_80E67BC: @ 80E67BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + movs r4, 0 + ldr r5, _080E6804 + movs r6, 0 +_080E67CC: + ldr r3, [r5] + ldr r2, [r3, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E682E + ldr r0, [r3, 0x4] + adds r1, r6, r0 + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r0, 0 + ble _080E6808 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r2, 0x4] + ldr r0, [r3, 0x8] + movs r1, 0x4 + ldrsh r0, [r0, r1] + bl sub_80E6BB4 + ldr r1, [r5] + ldr r1, [r1, 0x8] + strh r0, [r1, 0x4] + b _080E680C + .align 2, 0 +_080E6804: .4byte 0x02039f34 +_080E6808: + movs r0, 0xA + strh r0, [r2, 0x4] +_080E680C: + ldr r0, [r5] + ldr r0, [r0, 0x8] + strb r4, [r0, 0x8] + ldr r0, [r5] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E682E + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080E682E: + adds r6, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080E67CC + mov r7, r8 + cmp r7, 0 + bne _080E684A + ldr r0, _080E6864 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E684A: + ldr r0, _080E6864 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E6864: .4byte 0x02039f34 + thumb_func_end sub_80E67BC + + thumb_func_start sub_80E6868 +sub_80E6868: @ 80E6868 + push {r4,lr} + ldr r0, _080E6888 + ldr r1, [r0] + ldr r0, [r1] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080E688C + movs r4, 0xA + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1A + bl sub_80DD3D4 + b _080E68CE + .align 2, 0 +_080E6888: .4byte 0x02039f34 +_080E688C: + cmp r0, 0x1 + bne _080E689E + movs r4, 0x14 + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1B + bl sub_80DD3D4 + b _080E68CE +_080E689E: + cmp r0, 0x2 + bne _080E68B0 + movs r4, 0x1E + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1C + bl sub_80DD3D4 + b _080E68CE +_080E68B0: + cmp r0, 0x3 + bne _080E68C2 + movs r4, 0x32 + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1D + bl sub_80DD3D4 + b _080E68CE +_080E68C2: + movs r4, 0x3C + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1E + bl sub_80DD3D4 +_080E68CE: + ldr r0, _080E68E8 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E68E8: .4byte 0x02039f34 + thumb_func_end sub_80E6868 + + thumb_func_start sub_80E68EC +sub_80E68EC: @ 80E68EC + push {r4,lr} + ldr r4, _080E6930 + ldr r0, [r4] + ldr r2, [r0, 0x10] + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080E692A + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r0, [r4] + ldr r3, [r0, 0x10] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x1] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x3D + bl sub_80DD3D4 +_080E692A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E6930: .4byte 0x02039f34 + thumb_func_end sub_80E68EC + + thumb_func_start sub_80E6934 +sub_80E6934: @ 80E6934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + movs r4, 0 + ldr r6, _080E6978 + ldr r0, _080E697C + mov r9, r0 + movs r5, 0 +_080E694E: + ldr r3, [r6] + ldr r2, [r3, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E699E + ldr r0, [r3, 0x4] + adds r0, r5, r0 + ldrh r0, [r0, 0x6] + lsls r0, 3 + add r0, r9 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + cmp r8, r0 + bne _080E6980 + movs r0, 0x28 + b _080E6982 + .align 2, 0 +_080E6978: .4byte 0x02039f34 +_080E697C: .4byte 0x0858c2b4 +_080E6980: + movs r0, 0xA +_080E6982: + strh r0, [r2, 0x4] + ldr r0, [r6] + ldr r0, [r0, 0x8] + strb r4, [r0, 0x8] + ldr r0, [r6] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E699E + adds r7, 0x1 +_080E699E: + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080E694E + cmp r7, 0 + bne _080E69B8 + ldr r0, _080E69C4 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E69B8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E69C4: .4byte 0x02039f34 + thumb_func_end sub_80E6934 + + thumb_func_start sub_80E69C8 +sub_80E69C8: @ 80E69C8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _080E69F8 + ldr r0, [r2] + ldr r0, [r0, 0x8] + adds r0, 0xD + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x10] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080E69FC + adds r0, r3, 0 + movs r1, 0x2D + b _080E6A22 + .align 2, 0 +_080E69F8: .4byte 0x02039f34 +_080E69FC: + ldrb r0, [r2, 0x12] + cmp r0, 0 + bne _080E6A1A + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E6A26 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080E6A26 + movs r0, 0x1 + b _080E6A28 +_080E6A1A: + subs r0, 0x1 + strb r0, [r2, 0x12] + adds r0, r3, 0 + movs r1, 0x2C +_080E6A22: + bl sub_80DD3D4 +_080E6A26: + movs r0, 0 +_080E6A28: + pop {r1} + bx r1 + thumb_func_end sub_80E69C8 + + thumb_func_start sub_80E6A2C +sub_80E6A2C: @ 80E6A2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + movs r7, 0 + ldr r4, _080E6AB0 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0xFF + beq _080E6B10 + mov r8, r4 +_080E6A4E: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r0, 0x8 + adds r0, r7 + ldrb r5, [r0] + adds r6, r5, 0 + adds r0, r5, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E6AFE + ldr r2, [r4] + ldr r1, [r2, 0x8] + ldrh r0, [r1, 0x4] + strh r0, [r1, 0x6] + ldr r1, [r2, 0x4] + lsls r0, r5, 3 + subs r0, r5 + lsls r4, r0, 2 + adds r1, r4, r1 + ldrb r1, [r1, 0x10] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080E6A8E + ldr r1, [r2, 0x8] + movs r2, 0x6 + ldrsh r0, [r1, r2] + lsls r0, 1 + strh r0, [r1, 0x6] +_080E6A8E: + mov r0, r8 + ldr r3, [r0] + ldr r0, [r3, 0x4] + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + movs r4, 0x1 + ands r4, r0 + cmp r4, 0 + beq _080E6AB4 + ldr r1, [r3, 0x8] + movs r0, 0xA + strh r0, [r1, 0x6] + adds r0, r5, 0 + movs r1, 0x2F + bl sub_80DD3D4 + b _080E6AFE + .align 2, 0 +_080E6AB0: .4byte 0x02039f34 +_080E6AB4: + ldr r2, [r3, 0x8] + ldrb r1, [r1, 0xF] + ldrh r0, [r2, 0x6] + subs r0, r1 + strh r0, [r2, 0x6] + ldr r2, [r3, 0x8] + ldrh r1, [r2, 0x6] + movs r3, 0x6 + ldrsh r0, [r2, r3] + cmp r0, 0 + bgt _080E6AD6 + strh r4, [r2, 0x6] + adds r0, r5, 0 + movs r1, 0x2E + bl sub_80DD3D4 + b _080E6AFE +_080E6AD6: + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_80E6B3C + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x6] + adds r0, r6, 0 + bl sub_80DD40C + lsls r0, r6, 1 + mov r2, sp + adds r1, r2, r0 + mov r3, r8 + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrh r0, [r0, 0x6] + strh r0, [r1] +_080E6AFE: + adds r7, 0x1 + ldr r4, _080E6B20 + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r0, 0x8 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E6A4E +_080E6B10: + movs r7, 0 + mov r1, sp +_080E6B14: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080E6B24 + movs r0, 0x1 + b _080E6B2E + .align 2, 0 +_080E6B20: .4byte 0x02039f34 +_080E6B24: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _080E6B14 + movs r0, 0 +_080E6B2E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E6A2C + + thumb_func_start sub_80E6B3C +sub_80E6B3C: @ 80E6B3C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080E6B6C + ldr r4, [r2] + ldr r3, [r4, 0x4] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r3, r2, r3 + ldrh r0, [r3, 0x2] + subs r0, r1 + strh r0, [r3, 0x2] + ldr r0, [r4, 0x4] + adds r2, r0 + ldrb r0, [r2, 0xE] + adds r1, r0 + strb r1, [r2, 0xE] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E6B6C: .4byte 0x02039f34 + thumb_func_end sub_80E6B3C + + thumb_func_start sub_80E6B70 +sub_80E6B70: @ 80E6B70 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + cmp r4, 0 + bge _080E6B80 + negs r0, r4 +_080E6B80: + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r4, 0 + bge _080E6B9E + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + beq _080E6BA8 + adds r0, r4, 0 + subs r0, 0xA + adds r0, r1, r0 + b _080E6BA4 +_080E6B9E: + lsls r0, 16 + asrs r0, 16 + subs r0, r4, r0 +_080E6BA4: + lsls r0, 16 + lsrs r5, r0, 16 +_080E6BA8: + lsls r0, r5, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E6B70 + + thumb_func_start sub_80E6BB4 +sub_80E6BB4: @ 80E6BB4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + cmp r4, 0 + bge _080E6BC4 + negs r0, r4 +_080E6BC4: + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + beq _080E6BDC + adds r0, r4, 0 + adds r0, 0xA + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_080E6BDC: + lsls r0, r5, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E6BB4 + + thumb_func_start sub_80E6BE8 +sub_80E6BE8: @ 80E6BE8 + push {lr} + ldr r0, _080E6BF4 + bl sub_80B37D4 + pop {r0} + bx r0 + .align 2, 0 +_080E6BF4: .4byte sub_80E715C + 1 + thumb_func_end sub_80E6BE8 + + thumb_func_start sub_80E6BF8 +sub_80E6BF8: @ 80E6BF8 + push {r4,lr} + ldr r2, _080E6C50 + ldr r0, _080E6C54 + ldr r1, [r0] + ldr r3, _080E6C58 + adds r0, r1, r3 + str r0, [r2] + ldr r2, _080E6C5C + ldr r4, _080E6C60 + adds r0, r1, r4 + str r0, [r2] + ldr r2, _080E6C64 + ldr r3, _080E6C68 + adds r0, r1, r3 + str r0, [r2] + ldr r2, _080E6C6C + ldr r4, _080E6C70 + adds r0, r1, r4 + str r0, [r2] + ldr r2, _080E6C74 + ldr r3, _080E6C78 + adds r0, r1, r3 + str r0, [r2] + ldr r2, _080E6C7C + ldr r0, _080E6C80 + str r0, [r2] + ldr r2, _080E6C84 + ldr r0, _080E6C88 + ldr r0, [r0] + ldr r4, _080E6C8C + adds r3, r0, r4 + str r3, [r2] + ldr r2, _080E6C90 + ldr r4, _080E6C94 + adds r1, r4 + str r1, [r2] + ldr r1, _080E6C98 + adds r0, 0xDC + str r0, [r1] + ldr r0, _080E6C9C + str r3, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E6C50: .4byte 0x03001134 +_080E6C54: .4byte 0x03005d8c +_080E6C58: .4byte 0x00001a9c +_080E6C5C: .4byte 0x03001138 +_080E6C60: .4byte 0x000027cc +_080E6C64: .4byte 0x0300113c +_080E6C68: .4byte 0x00002b50 +_080E6C6C: .4byte 0x03001140 +_080E6C70: .4byte 0x00002e28 +_080E6C74: .4byte 0x03001144 +_080E6C78: .4byte 0x00002e68 +_080E6C7C: .4byte 0x03001148 +_080E6C80: .4byte 0x02039f9c +_080E6C84: .4byte 0x0300114c +_080E6C88: .4byte 0x03005d90 +_080E6C8C: .4byte 0x0000064c +_080E6C90: .4byte 0x03001150 +_080E6C94: .4byte 0x00003b58 +_080E6C98: .4byte 0x03001154 +_080E6C9C: .4byte 0x03001158 + thumb_func_end sub_80E6BF8 + + thumb_func_start sub_80E6CA0 +sub_80E6CA0: @ 80E6CA0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080E6D24 + ldr r1, [r0] + movs r4, 0xC8 + lsls r4, 4 + adds r0, r5, 0 + adds r2, r4, 0 + bl memcpy + adds r4, r5, r4 + ldr r0, _080E6D28 + ldr r1, [r0] + movs r2, 0xE1 + lsls r2, 2 + adds r0, r4, 0 + bl memcpy + adds r0, r4, 0 + bl sub_80F14F8 + ldr r1, _080E6D2C + adds r0, r5, r1 + ldr r1, _080E6D30 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r2, _080E6D34 + adds r0, r5, r2 + ldr r1, _080E6D38 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r1, _080E6D3C + adds r0, r5, r1 + ldr r1, _080E6D40 + ldr r1, [r1] + movs r2, 0x28 + bl memcpy + ldr r2, _080E6D44 + adds r0, r5, r2 + bl sub_80E89F8 + ldr r0, _080E6D48 + ldr r0, [r0] + ldr r2, _080E6D4C + adds r1, r5, r2 + bl sub_81659DC + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E6D1C + bl sub_81539D4 + ldr r2, _080E6D50 + adds r1, r5, r2 + strh r0, [r1] +_080E6D1C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E6D24: .4byte 0x03001134 +_080E6D28: .4byte 0x03001138 +_080E6D2C: .4byte 0x00001004 +_080E6D30: .4byte 0x0300113c +_080E6D34: .4byte 0x00001044 +_080E6D38: .4byte 0x03001140 +_080E6D3C: .4byte 0x00001084 +_080E6D40: .4byte 0x03001144 +_080E6D44: .4byte 0x000010ac +_080E6D48: .4byte 0x0300114c +_080E6D4C: .4byte 0x00001124 +_080E6D50: .4byte 0x000011c8 + thumb_func_end sub_80E6CA0 + + thumb_func_start sub_80E6D54 +sub_80E6D54: @ 80E6D54 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080E6DF4 + ldr r1, [r0] + movs r4, 0xC8 + lsls r4, 4 + adds r0, r5, 0 + adds r2, r4, 0 + bl memcpy + adds r0, r5, 0 + bl sub_80EB18C + adds r4, r5, r4 + ldr r0, _080E6DF8 + ldr r1, [r0] + movs r2, 0xE1 + lsls r2, 2 + adds r0, r4, 0 + bl memcpy + adds r0, r4, 0 + bl sub_80F1208 + ldr r1, _080E6DFC + adds r0, r5, r1 + ldr r1, _080E6E00 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r2, _080E6E04 + adds r4, r5, r2 + ldr r0, _080E6E08 + ldr r1, [r0] + adds r0, r4, 0 + movs r2, 0x40 + bl memcpy + adds r0, r4, 0 + bl sub_8120B70 + ldr r1, _080E6E0C + adds r0, r5, r1 + ldr r1, _080E6E10 + ldr r1, [r1] + movs r2, 0x28 + bl memcpy + ldr r2, _080E6E14 + adds r4, r5, r2 + adds r0, r4, 0 + bl sub_80E89F8 + adds r0, r4, 0 + bl sub_80E8A54 + ldr r0, _080E6E18 + ldr r0, [r0] + ldr r1, _080E6E1C + adds r4, r5, r1 + adds r1, r4, 0 + bl sub_81659DC + adds r0, r4, 0 + bl nullsub_44 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E6DEE + bl sub_81539D4 + ldr r2, _080E6E20 + adds r1, r5, r2 + strh r0, [r1] +_080E6DEE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E6DF4: .4byte 0x03001134 +_080E6DF8: .4byte 0x03001138 +_080E6DFC: .4byte 0x00001004 +_080E6E00: .4byte 0x0300113c +_080E6E04: .4byte 0x00001044 +_080E6E08: .4byte 0x03001140 +_080E6E0C: .4byte 0x00001084 +_080E6E10: .4byte 0x03001144 +_080E6E14: .4byte 0x000010ac +_080E6E18: .4byte 0x0300114c +_080E6E1C: .4byte 0x00001124 +_080E6E20: .4byte 0x000011c8 + thumb_func_end sub_80E6D54 + + thumb_func_start sub_80E6E24 +sub_80E6E24: @ 80E6E24 + push {r4,r5,lr} + bl sub_80E9914 + bl sub_80F0BB8 + bl sub_80E6BF8 + bl sub_800A064 + cmp r0, 0 + beq _080E6E60 + bl sub_800A03C + cmp r0, 0 + bne _080E6E50 + ldr r0, _080E6E4C + ldr r0, [r0] + bl sub_80E6CA0 + b _080E6F12 + .align 2, 0 +_080E6E4C: .4byte 0x0203a018 +_080E6E50: + ldr r0, _080E6E5C + ldr r0, [r0] + bl sub_80E6D54 + b _080E6F12 + .align 2, 0 +_080E6E5C: .4byte 0x0203a018 +_080E6E60: + ldr r5, _080E6F18 + ldr r0, [r5] + ldr r1, _080E6F1C + ldr r1, [r1] + movs r4, 0xC8 + lsls r4, 4 + adds r2, r4, 0 + bl memcpy + ldr r0, [r5] + adds r0, r4 + ldr r1, _080E6F20 + ldr r1, [r1] + movs r2, 0xE1 + lsls r2, 2 + bl memcpy + ldr r0, [r5] + ldr r1, _080E6F24 + adds r0, r1 + ldr r1, _080E6F28 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r0, [r5] + ldr r2, _080E6F2C + adds r0, r2 + ldr r1, _080E6F30 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r0, [r5] + ldr r1, _080E6F34 + adds r0, r1 + ldr r1, _080E6F38 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r0, [r5] + ldr r2, _080E6F3C + adds r0, r2 + ldr r1, _080E6F40 + ldr r1, [r1] + movs r2, 0x28 + bl memcpy + ldr r0, [r5] + ldr r1, _080E6F44 + adds r0, r1 + bl sub_80E89F8 + ldr r0, [r5] + ldr r4, _080E6F48 + adds r0, r4 + ldr r1, _080E6F4C + ldr r1, [r1] + movs r2, 0xEC + bl memcpy + ldr r0, [r5] + adds r0, r4 + bl sub_80E8AC0 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E6EFA + bl sub_81539D4 + ldr r1, [r5] + ldr r2, _080E6F50 + adds r1, r2 + strh r0, [r1] +_080E6EFA: + ldr r0, [r5] + ldr r1, _080E6F54 + adds r0, r1 + ldr r1, _080E6F58 + ldr r1, [r1] + bl sub_80E8110 + ldr r0, [r5] + ldr r2, _080E6F5C + adds r0, r2 + bl sub_80E8260 +_080E6F12: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E6F18: .4byte 0x0203a018 +_080E6F1C: .4byte 0x03001134 +_080E6F20: .4byte 0x03001138 +_080E6F24: .4byte 0x00001004 +_080E6F28: .4byte 0x0300113c +_080E6F2C: .4byte 0x00001044 +_080E6F30: .4byte 0x03001140 +_080E6F34: .4byte 0x00001214 +_080E6F38: .4byte 0x03001150 +_080E6F3C: .4byte 0x00001084 +_080E6F40: .4byte 0x03001144 +_080E6F44: .4byte 0x000010ac +_080E6F48: .4byte 0x00001124 +_080E6F4C: .4byte 0x0300114c +_080E6F50: .4byte 0x00001210 +_080E6F54: .4byte 0x00001254 +_080E6F58: .4byte 0x03001154 +_080E6F5C: .4byte 0x000012dc + thumb_func_end sub_80E6E24 + + thumb_func_start sub_80E6F60 +sub_80E6F60: @ 80E6F60 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + bl sub_800A064 + cmp r0, 0 + beq _080E7014 + ldr r5, _080E6FF4 + ldr r0, [r5] + movs r1, 0xC8 + lsls r1, 4 + mov r8, r1 + add r0, r8 + bl sub_80E7B2C + ldr r0, [r5] + ldr r6, _080E6FF8 + lsls r4, 24 + lsrs r4, 24 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80EAF80 + ldr r3, [r5] + ldr r1, _080E6FFC + adds r0, r3, r1 + add r3, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7B60 + ldr r0, [r5] + ldr r1, _080E7000 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7948 + ldr r0, [r5] + add r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F01E8 + ldr r0, [r5] + ldr r1, _080E7004 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F0C7C + ldr r0, [r5] + ldr r1, _080E7008 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E78C4 + ldr r0, [r5] + ldr r1, _080E700C + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812287C + ldr r0, [r5] + ldr r1, _080E7010 + adds r0, r1 + adds r1, r4, 0 + bl sub_80E7F68 + b _080E70BE + .align 2, 0 +_080E6FF4: .4byte 0x0203a014 +_080E6FF8: .4byte 0x00001230 +_080E6FFC: .4byte 0x000010ac +_080E7000: .4byte 0x00001124 +_080E7004: .4byte 0x00001004 +_080E7008: .4byte 0x00001044 +_080E700C: .4byte 0x00001084 +_080E7010: .4byte 0x000011c8 +_080E7014: + ldr r5, _080E70C8 + ldr r0, [r5] + movs r1, 0xC8 + lsls r1, 4 + mov r8, r1 + add r0, r8 + bl sub_80E7B2C + ldr r0, [r5] + ldr r6, _080E70CC + lsls r4, 24 + lsrs r4, 24 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80EAF80 + ldr r0, [r5] + add r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F01E8 + ldr r0, [r5] + ldr r1, _080E70D0 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F0C7C + ldr r0, [r5] + ldr r1, _080E70D4 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E78C4 + ldr r0, [r5] + ldr r1, _080E70D8 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812287C + ldr r3, [r5] + ldr r1, _080E70DC + adds r0, r3, r1 + add r3, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7B60 + ldr r0, [r5] + ldr r1, _080E70E0 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7948 + ldr r0, [r5] + ldr r1, _080E70E4 + adds r0, r1 + adds r1, r4, 0 + bl sub_80E7F68 + ldr r0, [r5] + ldr r1, _080E70E8 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7A14 + ldr r0, [r5] + ldr r1, _080E70EC + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E8468 + ldr r0, [r5] + ldr r1, _080E70F0 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E89AC +_080E70BE: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E70C8: .4byte 0x0203a014 +_080E70CC: .4byte 0x00001444 +_080E70D0: .4byte 0x00001004 +_080E70D4: .4byte 0x00001044 +_080E70D8: .4byte 0x00001084 +_080E70DC: .4byte 0x000010ac +_080E70E0: .4byte 0x00001124 +_080E70E4: .4byte 0x00001210 +_080E70E8: .4byte 0x00001214 +_080E70EC: .4byte 0x00001254 +_080E70F0: .4byte 0x000012dc + thumb_func_end sub_80E6F60 + + thumb_func_start sub_80E70F4 +sub_80E70F4: @ 80E70F4 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + 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 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E70F4 + + thumb_func_start sub_80E7128 +sub_80E7128: @ 80E7128 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E7158 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bne _080E7150 + movs r0, 0xE2 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x8] +_080E7150: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E7158: .4byte 0x03005e00 + thumb_func_end sub_80E7128 + + thumb_func_start sub_80E715C +sub_80E715C: @ 80E715C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080E7180 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _080E7176 + b _080E730A +_080E7176: + lsls r0, 2 + ldr r1, _080E7184 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E7180: .4byte 0x03005e08 +_080E7184: .4byte _080E7188 + .align 2, 0 +_080E7188: + .4byte _080E71A0 + .4byte _080E7218 + .4byte _080E724C + .4byte _080E726C + .4byte _080E72AC + .4byte _080E72C0 +_080E71A0: + ldr r4, _080E71F8 + ldr r0, _080E71FC + bl malloc + str r0, [r4] + ldr r4, _080E7200 + ldr r0, _080E7204 + bl malloc + str r0, [r4] + ldr r0, _080E7208 + ldrb r0, [r0] + bl sub_8009628 + movs r0, 0x80 + lsls r0, 7 + movs r1, 0x1 + bl var_set + ldr r1, _080E720C + movs r0, 0 + strb r0, [r1] + bl sub_80E6E24 + bl sub_80FB00C + movs r0, 0x1 + strh r0, [r5] + ldr r0, _080E7210 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldr r0, _080E7214 + movs r1, 0x51 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1E] + b _080E730A + .align 2, 0 +_080E71F8: .4byte 0x0203a018 +_080E71FC: .4byte 0x00001444 +_080E7200: .4byte 0x0203a014 +_080E7204: .4byte 0x00005110 +_080E7208: .4byte 0x020375e2 +_080E720C: .4byte 0x03001130 +_080E7210: .4byte sub_80E7324 + 1 +_080E7214: .4byte sub_80E7128 + 1 +_080E7218: + ldr r2, _080E7244 + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080E730A + movs r0, 0x2 + strh r0, [r5] + ldr r0, _080E7248 + bl flag_set + bl sub_80FB074 + ldrb r0, [r5, 0x1E] + bl remove_task + b _080E730A + .align 2, 0 +_080E7244: .4byte 0x03005e00 +_080E7248: .4byte 0x00000894 +_080E724C: + ldr r0, _080E7268 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + movs r0, 0x3 + strh r0, [r5] + movs r0, 0xE0 + bl audio_play + b _080E730A + .align 2, 0 +_080E7268: .4byte sub_80E7FF8 + 1 +_080E726C: + ldr r2, _080E72A0 + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x4] + cmp r4, 0 + bne _080E730A + movs r0, 0x4 + strh r0, [r5] + ldr r0, _080E72A4 + ldrb r0, [r0] + cmp r0, 0 + bne _080E7296 + bl sub_80B3050 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] +_080E7296: + ldr r0, _080E72A8 + bl sub_80E70F4 + strh r4, [r5, 0x10] + b _080E730A + .align 2, 0 +_080E72A0: .4byte 0x03005e00 +_080E72A4: .4byte 0x030030fc +_080E72A8: .4byte 0x085eea8e +_080E72AC: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _080E730A + movs r0, 0x5 + strh r0, [r5] + b _080E730A +_080E72C0: + ldr r2, _080E7310 + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080E730A + ldr r0, _080E7314 + ldr r0, [r0] + bl free + ldr r0, _080E7318 + ldr r0, [r0] + bl free + bl sub_808729C + ldr r0, _080E731C + ldrb r0, [r0] + cmp r0, 0 + beq _080E72F8 + ldr r0, _080E7320 + movs r1, 0xA + bl AddTask +_080E72F8: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080E730A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E7310: .4byte 0x03005e00 +_080E7314: .4byte 0x0203a014 +_080E7318: .4byte 0x0203a018 +_080E731C: .4byte 0x030030fc +_080E7320: .4byte sub_80AF2B4 + 1 + thumb_func_end sub_80E715C + + thumb_func_start sub_80E7324 +sub_80E7324: @ 80E7324 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r6, _080E7350 + adds r5, r0, r6 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0x64 + beq _080E73A0 + cmp r1, 0x64 + bgt _080E7362 + cmp r1, 0x1 + bne _080E7346 + b _080E7464 +_080E7346: + cmp r1, 0x1 + bgt _080E7354 + cmp r1, 0 + beq _080E7384 + b _080E7566 + .align 2, 0 +_080E7350: .4byte 0x03005e00 +_080E7354: + cmp r1, 0x2 + bne _080E735A + b _080E7490 +_080E735A: + cmp r1, 0x5 + bne _080E7360 + b _080E7550 +_080E7360: + b _080E7566 +_080E7362: + cmp r1, 0xC9 + beq _080E73F8 + cmp r1, 0xC9 + bgt _080E7370 + cmp r1, 0x65 + beq _080E73B8 + b _080E7566 +_080E7370: + ldr r0, _080E7380 + cmp r1, r0 + beq _080E7432 + adds r0, 0x63 + cmp r1, r0 + beq _080E744A + b _080E7566 + .align 2, 0 +_080E7380: .4byte 0x0000012d +_080E7384: + ldr r0, _080E739C + bl sub_80E70F4 + movs r0, 0xE1 + lsls r0, 3 + strh r0, [r5, 0x18] + movs r0, 0xC8 + lsls r0, 1 + strh r0, [r5, 0x8] + bl sub_8009FAC + b _080E7566 + .align 2, 0 +_080E739C: .4byte 0x085eea7e +_080E73A0: + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080E73B0 + b _080E7566 +_080E73B0: + movs r0, 0 + strh r0, [r5, 0x20] + movs r0, 0x65 + b _080E7564 +_080E73B8: + bl sub_800ABAC + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800ABBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E73EA + bl sub_800AA48 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _080E73DA + b _080E7566 +_080E73DA: + movs r0, 0x15 + bl audio_play + movs r1, 0 + movs r0, 0xC9 + strh r0, [r5, 0x8] + strh r1, [r5, 0x20] + b _080E7566 +_080E73EA: + movs r0, 0x16 + bl audio_play + ldr r0, _080E73F4 + b _080E7564 + .align 2, 0 +_080E73F4: .4byte 0x0000012d +_080E73F8: + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080E740C + b _080E7566 +_080E740C: + ldrh r4, [r5, 0x20] + adds r4, 0x1 + strh r4, [r5, 0x20] + lsls r4, 16 + asrs r4, 16 + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + cmp r4, r1 + bgt _080E742A + b _080E7566 +_080E742A: + bl sub_800A620 + movs r0, 0x1 + b _080E7564 +_080E7432: + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080E7446 + b _080E7566 +_080E7446: + movs r0, 0x1 + b _080E7564 +_080E744A: + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080E745A + b _080E7566 +_080E745A: + movs r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + strh r0, [r5, 0x20] + b _080E7566 +_080E7464: + ldr r0, _080E7488 + ldrb r0, [r0] + cmp r0, 0 + bne _080E746E + b _080E7566 +_080E746E: + ldr r4, _080E748C + bl sub_80E7810 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0x5 + b _080E7564 + .align 2, 0 +_080E7488: .4byte 0x03003124 +_080E748C: .4byte 0x02021cc4 +_080E7490: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r5, 0x14] + strh r1, [r5, 0x8] + bl sub_80E7810 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + ldr r0, _080E74EC + str r0, [r5] + bl sub_800A064 + cmp r0, 0 + beq _080E7504 + ldr r0, _080E74F0 + ldr r0, [r0] + adds r1, r5, 0 + adds r1, 0xC + bl sub_80E7808 + ldr r0, _080E74F4 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r6 + strh r4, [r0, 0x8] + ldr r0, _080E74F8 + ldr r0, [r0] + adds r1, r6, r1 + adds r1, 0x12 + bl sub_80E7808 + ldr r1, _080E74FC + ldr r0, _080E7500 + str r0, [r1] + b _080E7566 + .align 2, 0 +_080E74EC: .4byte sub_80E756C + 1 +_080E74F0: .4byte 0x0203a018 +_080E74F4: .4byte sub_80E7630 + 1 +_080E74F8: .4byte 0x0203a014 +_080E74FC: .4byte 0x0300115c +_080E7500: .4byte 0x00001230 +_080E7504: + ldr r0, _080E753C + ldr r0, [r0] + adds r1, r5, 0 + adds r1, 0xC + bl sub_80E7808 + ldr r0, _080E7540 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r6 + strh r4, [r0, 0x8] + ldr r0, _080E7544 + ldr r0, [r0] + adds r1, r6, r1 + adds r1, 0x12 + bl sub_80E7808 + ldr r1, _080E7548 + ldr r0, _080E754C + str r0, [r1] + b _080E7566 + .align 2, 0 +_080E753C: .4byte 0x0203a018 +_080E7540: .4byte sub_80E7630 + 1 +_080E7544: .4byte 0x0203a014 +_080E7548: .4byte 0x0300115c +_080E754C: .4byte 0x00001444 +_080E7550: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _080E7566 + movs r0, 0 + strh r0, [r5, 0x1C] + movs r0, 0x2 +_080E7564: + strh r0, [r5, 0x8] +_080E7566: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E7324 + + thumb_func_start sub_80E756C +sub_80E756C: @ 80E756C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080E7590 + adds r5, r1, r0 + movs r2, 0x8 + ldrsh r1, [r5, r2] + adds r2, r0, 0 + cmp r1, 0x4 + bhi _080E7624 + lsls r0, r1, 2 + ldr r1, _080E7594 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E7590: .4byte 0x03005e00 +_080E7594: .4byte _080E7598 + .align 2, 0 +_080E7598: + .4byte _080E75AC + .4byte _080E75D0 + .4byte _080E7624 + .4byte _080E75E2 + .4byte _080E760E +_080E75AC: + adds r0, r5, 0 + adds r0, 0xC + bl sub_80E77FC + adds r1, r0, 0 + movs r0, 0x10 + ldrsh r2, [r5, r0] + movs r0, 0xC8 + muls r0, r2 + adds r1, r0 + ldr r0, _080E75CC + movs r2, 0xC8 + bl memcpy + b _080E75FC + .align 2, 0 +_080E75CC: .4byte 0x020228c4 +_080E75D0: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E75FC + movs r0, 0x1 + bl sub_800A4D8 + b _080E75FC +_080E75E2: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + movs r1, 0x10 + ldrsh r4, [r5, r1] + ldr r0, _080E7604 + ldr r0, [r0] + movs r1, 0xC8 + bl __udivsi3 + adds r0, 0x1 + cmp r4, r0 + bne _080E7608 +_080E75FC: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080E7624 + .align 2, 0 +_080E7604: .4byte 0x0300115c +_080E7608: + movs r0, 0 + strh r0, [r5, 0x8] + b _080E7624 +_080E760E: + movs r1, 0x1C + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _080E7624 + ldr r0, _080E762C + str r0, [r5] +_080E7624: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E762C: .4byte sub_80E77D4 + 1 + thumb_func_end sub_80E756C + + thumb_func_start sub_80E7630 +sub_80E7630: @ 80E7630 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r0, 2 + ldr r1, [sp] + adds r0, r1 + lsls r0, 3 + ldr r1, _080E7674 + adds r0, r1 + mov r10, r0 + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + bl sub_800A9D8 + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x4] + cmp r3, r0 + bne _080E773E + movs r4, 0 + mov r8, r4 + b _080E771C + .align 2, 0 +_080E7674: .4byte 0x03005e00 +_080E7678: + ldr r1, [sp, 0x4] + mov r0, r8 + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + movs r2, 0x1 + add r2, r8 + mov r9, r2 + cmp r1, 0 + beq _080E7714 + mov r0, r10 + adds r0, 0x12 + bl sub_80E77FC + mov r3, r9 + lsls r4, r3, 1 + mov r5, r10 + adds r5, 0x8 + adds r4, r5, r4 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r7, 0xC8 + muls r1, r7 + adds r0, r1 + ldr r3, _080E76D8 + ldr r1, [r3] + mov r2, r8 + muls r2, r1 + adds r1, r2, 0 + adds r6, r0, r1 + mov r0, r8 + bl sub_80E7820 + adds r1, r0, 0 + movs r3, 0 + ldrsh r2, [r4, r3] + adds r0, r2, 0x1 + muls r0, r7 + ldr r4, _080E76D8 + ldr r3, [r4] + cmp r0, r3 + bls _080E76DC + muls r2, r7 + subs r2, r3, r2 + adds r0, r6, 0 + bl memcpy + b _080E76E4 + .align 2, 0 +_080E76D8: .4byte 0x0300115c +_080E76DC: + adds r0, r6, 0 + movs r2, 0xC8 + bl memcpy +_080E76E4: + mov r0, r8 + bl sub_800A5EC + mov r0, r9 + lsls r1, r0, 1 + adds r1, r5, r1 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r2, 0 + ldrsh r4, [r1, r2] + ldr r3, _080E7764 + ldr r0, [r3] + movs r1, 0xC8 + bl __udivsi3 + adds r0, 0x1 + cmp r4, r0 + bne _080E7714 + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] +_080E7714: + mov r4, r9 + lsls r0, r4, 24 + lsrs r0, 24 + mov r8, r0 +_080E771C: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bcc _080E7678 + ldr r2, _080E7768 + mov r0, r10 + movs r3, 0x8 + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] +_080E773E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + ldr r4, [sp, 0x8] + cmp r4, r0 + bne _080E7752 + ldr r0, [sp] + bl remove_task +_080E7752: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E7764: .4byte 0x0300115c +_080E7768: .4byte 0x03005e00 + thumb_func_end sub_80E7630 + + thumb_func_start sub_80E776C +sub_80E776C: @ 80E776C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r2, _080E779C + adds r0, r2 + movs r4, 0x1C + ldrsh r1, [r0, r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080E7794 + adds r0, r3, 0 + bl remove_task +_080E7794: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E779C: .4byte 0x03005e00 + thumb_func_end sub_80E776C + + thumb_func_start sub_80E77A0 +sub_80E77A0: @ 80E77A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080E77C8 + adds r1, r0 + ldr r0, _080E77CC + str r0, [r1] + ldr r0, _080E77D0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E77C4 + movs r2, 0x12 + ldrsh r0, [r1, r2] + bl sub_80E6F60 +_080E77C4: + pop {r0} + bx r0 + .align 2, 0 +_080E77C8: .4byte 0x03005e00 +_080E77CC: .4byte sub_80E776C + 1 +_080E77D0: .4byte 0x03001130 + thumb_func_end sub_80E77A0 + + thumb_func_start sub_80E77D4 +sub_80E77D4: @ 80E77D4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080E77F0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _080E77F4 + str r0, [r1] + ldr r1, _080E77F8 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_080E77F0: .4byte 0x03005e00 +_080E77F4: .4byte sub_80E77A0 + 1 +_080E77F8: .4byte 0x03001130 + thumb_func_end sub_80E77D4 + + thumb_func_start sub_80E77FC +sub_80E77FC: @ 80E77FC + adds r1, r0, 0 + ldrh r0, [r1] + ldrh r1, [r1, 0x2] + lsls r1, 16 + orrs r0, r1 + bx lr + thumb_func_end sub_80E77FC + + thumb_func_start sub_80E7808 +sub_80E7808: @ 80E7808 + strh r0, [r1] + lsrs r0, 16 + strh r0, [r1, 0x2] + bx lr + thumb_func_end sub_80E7808 + + thumb_func_start sub_80E7810 +sub_80E7810: @ 80E7810 + push {lr} + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80E7810 + + thumb_func_start sub_80E7820 +sub_80E7820: @ 80E7820 + lsls r0, 24 + lsrs r0, 16 + ldr r1, _080E782C + adds r0, r1 + bx lr + .align 2, 0 +_080E782C: .4byte 0x020223c4 + thumb_func_end sub_80E7820 + + thumb_func_start sub_80E7830 +sub_80E7830: @ 80E7830 + push {r4,lr} + adds r4, r0, 0 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _080E7868 + cmp r0, 0x3 + bhi _080E784A + cmp r0, 0x2 + beq _080E7850 + b _080E78B8 +_080E784A: + cmp r0, 0x4 + beq _080E7894 + b _080E78B8 +_080E7850: + movs r3, 0 + ldr r2, _080E7864 + adds r1, r4, 0 +_080E7856: + adds r0, r3, r2 + ldrb r0, [r0] + stm r1!, {r0} + adds r3, 0x1 + cmp r3, 0x1 + bls _080E7856 + b _080E78B8 + .align 2, 0 +_080E7864: .4byte 0x0858cf8c +_080E7868: + movs r0, 0 + bl sub_800A2A4 + adds r2, r0, 0 + movs r0, 0x1 + ands r2, r0 + movs r3, 0 + ldr r1, _080E7890 + lsls r0, r2, 1 + adds r0, r2 + adds r1, r0, r1 + adds r2, r4, 0 +_080E7880: + ldrb r0, [r1] + stm r2!, {r0} + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x2 + bls _080E7880 + b _080E78B8 + .align 2, 0 +_080E7890: .4byte 0x0858cf8e +_080E7894: + movs r0, 0 + bl sub_800A2A4 + movs r1, 0x9 + bl __umodsi3 + adds r2, r0, 0 + movs r3, 0 + ldr r1, _080E78C0 + lsls r0, r2, 2 + adds r1, r0, r1 + adds r2, r4, 0 +_080E78AC: + ldrb r0, [r1] + stm r2!, {r0} + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x3 + bls _080E78AC +_080E78B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E78C0: .4byte 0x0858cf94 + thumb_func_end sub_80E7830 + + thumb_func_start sub_80E78C4 +sub_80E78C4: @ 80E78C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r9, r0 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + bl sub_80E7830 + lsls r0, r7, 2 + add r0, sp + ldr r1, [r0] + mov r0, r8 + muls r0, r1 + mov r2, r9 + adds r6, r2, r0 + ldr r2, _080E790C + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0] + ldrh r5, [r0, 0x1A] + bl sub_800A064 + cmp r0, 0 + beq _080E7910 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8120D34 + b _080E791A + .align 2, 0 +_080E790C: .4byte 0x020229e8 +_080E7910: + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8120CD0 +_080E791A: + ldr r0, _080E7944 + ldr r0, [r0] + lsls r1, r7, 2 + add r1, sp + ldr r1, [r1] + mov r2, r8 + muls r2, r1 + adds r1, r2, 0 + add r1, r9 + movs r2, 0x40 + bl memcpy + bl sub_8120670 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E7944: .4byte 0x03001140 + thumb_func_end sub_80E78C4 + + thumb_func_start sub_80E7948 +sub_80E7948: @ 80E7948 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r0, sp + bl sub_80E7830 + bl sub_800A064 + cmp r0, 0 + beq _080E79AC + lsls r0, r6, 2 + mov r1, sp + adds r5, r1, r0 + ldr r0, [r5] + muls r0, r7 + add r0, r8 + adds r4, r7, 0 + muls r4, r6 + mov r1, r8 + adds r6, r1, r4 + adds r1, r6, 0 + bl sub_816587C + mov r9, r4 + cmp r0, 0x1 + bne _080E79FE + adds r7, r6, 0 + ldr r2, _080E79A8 + ldr r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x1A] + adds r0, r7, 0 + adds r0, 0xE4 + strb r1, [r0] + adds r0, r7, 0 + bl sub_8164F70 + b _080E79FE + .align 2, 0 +_080E79A8: .4byte 0x020229e8 +_080E79AC: + adds r5, r7, 0 + muls r5, r6 + mov r0, r8 + adds r4, r0, r5 + lsls r0, r6, 2 + add r0, sp + ldr r0, [r0] + adds r1, r7, 0 + muls r1, r0 + add r1, r8 + adds r0, r4, 0 + movs r2, 0xEC + bl memcpy + adds r7, r4, 0 + movs r6, 0 + mov r9, r5 +_080E79CE: + movs r0, 0x2C + muls r0, r6 + adds r0, 0x34 + adds r1, r7, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080E79F2 + adds r4, r1, 0 + adds r4, 0x20 + adds r0, r4, 0 + bl sub_8009228 + cmp r0, 0 + beq _080E79F2 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8009308 +_080E79F2: + adds r6, 0x1 + cmp r6, 0x3 + ble _080E79CE + adds r0, r7, 0 + bl sub_8164F70 +_080E79FE: + mov r0, r8 + add r0, r9 + bl sub_81628A0 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E7948 + + thumb_func_start sub_80E7A14 +sub_80E7A14: @ 80E7A14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r5, r2, 24 + mov r0, sp + bl sub_80E7830 + adds r0, r7, 0 + muls r0, r5 + add r0, r8 + ldr r6, _080E7A5C + ldr r1, [r6] + movs r2, 0x40 + bl memcpy + bl sub_818D9AC + lsls r0, 24 + cmp r0, 0 + bne _080E7A60 + movs r0, 0x40 + bl malloc + adds r4, r0, 0 + cmp r4, 0 + beq _080E7A8A + ldr r1, [r6] + movs r2, 0x40 + bl memcpy + b _080E7A62 + .align 2, 0 +_080E7A5C: .4byte 0x03001150 +_080E7A60: + movs r4, 0 +_080E7A62: + ldr r0, _080E7A98 + ldr r0, [r0] + lsls r1, r5, 2 + add r1, sp + ldr r1, [r1] + muls r1, r7 + add r1, r8 + movs r2, 0x40 + bl memcpy + bl sub_818DA78 + cmp r4, 0 + beq _080E7A8A + adds r0, r4, 0 + bl sub_818E570 + adds r0, r4, 0 + bl free +_080E7A8A: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E7A98: .4byte 0x03001150 + thumb_func_end sub_80E7A14 + + thumb_func_start sub_80E7A9C +sub_80E7A9C: @ 80E7A9C + ldrh r0, [r0, 0x20] + lsls r0, 24 + lsrs r0, 24 + bx lr + thumb_func_end sub_80E7A9C + + thumb_func_start sub_80E7AA4 +sub_80E7AA4: @ 80E7AA4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x38 + mov r8, r0 + mov r10, r1 + mov r9, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x54] + lsls r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsrs r4, 23 + add r4, r9 + ldrb r0, [r4] + mov r6, r10 + muls r6, r0 + add r6, r8 + ldrb r0, [r4, 0x1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 3 + adds r1, r6, r1 + mov r0, sp + movs r2, 0x38 + bl memcpy + lsls r5, 1 + add r5, r9 + ldrb r0, [r5] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r8, r0 + ldrb r1, [r4, 0x1] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 3 + adds r6, r0 + ldrb r0, [r5, 0x1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 3 + add r1, r8 + adds r0, r6, 0 + movs r2, 0x38 + bl memcpy + ldrb r1, [r5, 0x1] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 3 + add r8, r0 + mov r0, r8 + mov r1, sp + movs r2, 0x38 + bl memcpy + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E7AA4 + + thumb_func_start sub_80E7B2C +sub_80E7B2C: @ 80E7B2C + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + movs r1, 0 + ldr r4, _080E7B50 +_080E7B36: + adds r0, r3, r1 + ldrb r0, [r0] + adds r0, r2, r0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 + cmp r1, 0xFF + ble _080E7B36 + strb r2, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E7B50: .4byte 0x03001160 + thumb_func_end sub_80E7B2C + + thumb_func_start sub_80E7B54 +sub_80E7B54: @ 80E7B54 + ldr r0, _080E7B5C + ldrb r0, [r0] + bx lr + .align 2, 0 +_080E7B5C: .4byte 0x03001160 + thumb_func_end sub_80E7B54 + + thumb_func_start sub_80E7B60 +sub_80E7B60: @ 80E7B60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x38] + ldr r0, _080E7BF4 + ldrh r0, [r0, 0x4] + bl SeedRng2 + bl sub_8009FCC + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0x1C + str r1, [sp, 0x4C] + mov r2, sp + adds r2, 0x1D + str r2, [sp, 0x50] + mov r3, sp + adds r3, 0xC + str r3, [sp, 0x48] + movs r7, 0xFF + add r3, sp, 0x8 + movs r2, 0 + adds r6, r1, 0 + ldr r5, [sp, 0x50] +_080E7BB0: + mov r1, sp + add r1, r8 + adds r1, 0x4 + ldrb r0, [r1] + orrs r0, r7 + strb r0, [r1] + mov r1, r8 + adds r0, r3, r1 + strb r2, [r0] + lsls r1, 1 + adds r0, r6, r1 + strb r2, [r0] + adds r1, r5, r1 + strb r2, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x3 + bls _080E7BB0 + bl sub_800A064 + str r0, [sp, 0x3C] + movs r2, 0 + mov r8, r2 + lsls r4, 16 + str r4, [sp, 0x54] + ldr r0, [sp, 0x30] + mov r3, r9 + muls r3, r0 + str r3, [sp, 0x44] + b _080E7D04 + .align 2, 0 +_080E7BF4: .4byte 0x020229e8 +_080E7BF8: + ldr r1, [sp, 0x30] + mov r0, r8 + muls r0, r1 + ldr r2, [sp, 0x2C] + adds r7, r2, r0 + ldr r1, _080E7C50 + mov r3, r8 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x1A] + mov r9, r1 + ldrb r0, [r0] + str r0, [sp, 0x40] + movs r6, 0 + ldr r0, [r7, 0x70] + cmp r6, r0 + bcs _080E7CFA + movs r2, 0x10 + negs r2, r2 + mov r10, r2 +_080E7C24: + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 3 + adds r5, r7, r0 + ldrh r0, [r5, 0x20] + cmp r0, 0 + beq _080E7CEE + ldr r3, [sp, 0x3C] + cmp r3, 0 + beq _080E7C9A + adds r4, r5, 0 + adds r4, 0x24 + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _080E7C54 + movs r4, 0x1 + b _080E7C5C + .align 2, 0 +_080E7C50: .4byte 0x020229e8 +_080E7C54: + adds r0, r4, 0 + bl sub_8009370 + mov r4, r9 +_080E7C5C: + ldrh r1, [r5, 0x2C] + ldr r0, _080E7C70 + cmp r1, r0 + bne _080E7C74 + adds r0, r5, 0 + adds r0, 0x2C + bl sub_8009370 + movs r1, 0x1 + b _080E7C76 + .align 2, 0 +_080E7C70: .4byte 0x000015fc +_080E7C74: + mov r1, r9 +_080E7C76: + ldr r0, [sp, 0x40] + subs r0, 0x1 + cmp r0, 0x1 + bhi _080E7CEE + adds r2, r5, 0 + adds r2, 0x37 + movs r0, 0xF + ands r4, r0 + ldrb r0, [r2] + mov r3, r10 + ands r0, r3 + orrs r0, r4 + lsls r1, 4 + movs r3, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _080E7CEE +_080E7C9A: + mov r0, r9 + cmp r0, 0x1 + bne _080E7CEE + adds r0, r5, 0 + adds r0, 0x24 + bl sub_8009228 + cmp r0, 0 + beq _080E7CBA + adds r0, r5, 0 + adds r0, 0x37 + ldrb r1, [r0] + mov r2, r10 + ands r1, r2 + movs r2, 0x1 + b _080E7CC6 +_080E7CBA: + adds r0, r5, 0 + adds r0, 0x37 + ldrb r1, [r0] + mov r3, r10 + ands r1, r3 + movs r2, 0x2 +_080E7CC6: + orrs r1, r2 + strb r1, [r0] + adds r4, r0, 0 + adds r0, r5, 0 + adds r0, 0x2C + bl sub_8009228 + cmp r0, 0 + beq _080E7CE2 + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x10 + b _080E7CEA +_080E7CE2: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x20 +_080E7CEA: + orrs r1, r0 + strb r1, [r4] +_080E7CEE: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7, 0x70] + cmp r6, r0 + bcc _080E7C24 +_080E7CFA: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080E7D04: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bcs _080E7D12 + b _080E7BF8 +_080E7D12: + movs r0, 0 + str r0, [sp, 0x34] + mov r8, r0 + ldr r1, [sp, 0x54] + lsrs r0, r1, 16 + ldr r2, [sp, 0x34] + cmp r2, r0 + bcs _080E7D70 + adds r5, r0, 0 +_080E7D24: + ldr r3, [sp, 0x30] + mov r0, r8 + muls r0, r3 + ldr r1, [sp, 0x2C] + adds r7, r1, r0 + ldr r0, [r7, 0x70] + cmp r0, 0 + beq _080E7D62 + movs r6, 0 + cmp r6, r0 + bcs _080E7D62 + adds r3, r7, 0 + adds r3, 0x74 + ldr r2, [sp, 0x4C] + mov r0, r8 + lsls r1, r0, 1 + movs r4, 0x1 +_080E7D46: + lsls r0, r6, 1 + adds r0, r3, r0 + ldrh r0, [r0] + cmp r0, 0 + bne _080E7D56 + adds r0, r6, r1 + adds r0, r2, r0 + strb r4, [r0] +_080E7D56: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7, 0x70] + cmp r6, r0 + bcc _080E7D46 +_080E7D62: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r8, r5 + bcc _080E7D24 +_080E7D70: + movs r6, 0 + mov r8, r6 + ldr r1, [sp, 0x54] + cmp r1, 0 + beq _080E7E64 + add r2, sp, 0x24 + mov r10, r2 + movs r3, 0x25 + add r3, sp + mov r9, r3 +_080E7D84: + ldr r1, [sp, 0x30] + mov r0, r8 + muls r0, r1 + ldr r2, [sp, 0x2C] + adds r7, r2, r0 + mov r3, r8 + lsls r1, r3, 1 + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080E7DA6 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7DB0 +_080E7DA6: + ldr r0, [sp, 0x34] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] +_080E7DB0: + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7DD4 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0 + bne _080E7DD4 +_080E7DC4: + lsls r1, r6, 1 + mov r3, r10 + adds r0, r3, r1 + mov r3, r8 + strb r3, [r0] + add r1, r9 + strb r2, [r1] + b _080E7E4E +_080E7DD4: + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080E7DE8 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0x1 + beq _080E7DC4 +_080E7DE8: + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7E54 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7E54 + lsls r5, r6, 1 + mov r1, r10 + adds r0, r1, r5 + mov r2, r8 + strb r2, [r0] + adds r0, r7, 0 + bl sub_80E7A9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r0, 0x38 + bl sub_80E7A9C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0 + bne _080E7E30 + cmp r1, 0 + beq _080E7E34 + mov r3, r9 + adds r1, r3, r5 + movs r0, 0x1 + strb r0, [r1] + b _080E7E4E +_080E7E30: + cmp r1, 0 + beq _080E7E48 +_080E7E34: + bl GenerateRandomNumber2 + mov r1, r9 + adds r2, r1, r5 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + strb r0, [r2] + b _080E7E4E +_080E7E48: + mov r2, r9 + adds r0, r2, r5 + strb r1, [r0] +_080E7E4E: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080E7E54: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + mov r8, r3 + ldr r1, [sp, 0x54] + cmp r0, r1 + bcc _080E7D84 +_080E7E64: + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0x44] + lsls r0, r3, 4 + subs r0, r3 + lsls r0, 3 + ldr r1, [sp, 0x2C] + adds r7, r1, r0 + ldr r1, [sp, 0x48] +_080E7E76: + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1, r0 + str r7, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x3 + bls _080E7E76 + bl sub_80E7B54 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, [sp, 0x34] + cmp r3, 0x3 + beq _080E7EC8 + cmp r3, 0x3 + bgt _080E7EAE + cmp r3, 0x2 + beq _080E7EB6 + b _080E7F1C +_080E7EAE: + ldr r0, [sp, 0x34] + cmp r0, 0x4 + beq _080E7EE8 + b _080E7F1C +_080E7EB6: + add r2, sp, 0x24 + movs r0, 0x1 + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + movs r3, 0 + bl sub_80E7AA4 + b _080E7F1C +_080E7EC8: + ldr r0, _080E7EE4 + lsls r1, 1 + adds r2, r1, r0 + ldrb r3, [r2] + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + add r2, sp, 0x24 + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + bl sub_80E7AA4 + b _080E7F1C + .align 2, 0 +_080E7EE4: .4byte 0x0858cfb8 +_080E7EE8: + add r6, sp, 0x24 + ldr r4, _080E7F5C + lsls r5, r1, 2 + adds r0, r5, r4 + ldrb r3, [r0] + adds r0, r4, 0x1 + adds r0, r5, r0 + ldrb r0, [r0] + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + adds r2, r6, 0 + bl sub_80E7AA4 + adds r0, r4, 0x2 + adds r0, r5, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r5, r4 + ldrb r0, [r5] + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + adds r2, r6, 0 + bl sub_80E7AA4 +_080E7F1C: + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x44] + adds r7, r1, r2 + ldr r4, _080E7F60 + ldr r0, [r4] + movs r3, 0xC2 + lsls r3, 6 + adds r0, r3 + adds r1, r7, 0 + movs r2, 0x38 + bl memcpy + ldr r0, [r4] + ldr r1, _080E7F64 + adds r0, r1 + adds r1, r7, 0 + adds r1, 0x38 + movs r2, 0x38 + bl memcpy + ldr r0, [sp, 0x38] + bl SeedRng + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E7F5C: .4byte 0x0858cfbe +_080E7F60: .4byte 0x03005d8c +_080E7F64: .4byte 0x0000310c + thumb_func_end sub_80E7B60 + + thumb_func_start sub_80E7F68 +sub_80E7F68: @ 80E7F68 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + cmp r1, 0 + beq _080E7FEC + ldrh r0, [r4] + cmp r0, 0 + beq _080E7FEC + bl sub_80D6C68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080E7FEC + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + cmp r0, 0 + bne _080E7FE4 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6D1C + lsls r0, 24 + cmp r0, 0 + bne _080E7FE4 + ldrh r0, [r4] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + beq _080E7FE4 + ldr r0, _080E7FD0 + ldrh r1, [r4] + bl var_set + ldr r0, _080E7FD4 + ldr r1, _080E7FD8 + bl gf_strcpy + ldrh r1, [r4] + ldr r0, _080E7FDC + cmp r1, r0 + bne _080E7FEC + ldr r0, _080E7FE0 + bl flag_set + b _080E7FEC + .align 2, 0 +_080E7FD0: .4byte 0x00004001 +_080E7FD4: .4byte 0x02021cc4 +_080E7FD8: .4byte 0x020229f0 +_080E7FDC: .4byte 0x00000113 +_080E7FE0: .4byte 0x000008b3 +_080E7FE4: + ldr r0, _080E7FF4 + movs r1, 0 + bl var_set +_080E7FEC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E7FF4: .4byte 0x00004001 + thumb_func_end sub_80E7F68 + + thumb_func_start sub_80E7FF8 +sub_80E7FF8: @ 80E7FF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080E801C + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bls _080E8012 + b _080E810A +_080E8012: + lsls r0, 2 + ldr r1, _080E8020 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080E801C: .4byte 0x03005e00 +_080E8020: .4byte _080E8024 + .align 2, 0 +_080E8024: + .4byte _080E80F2 + .4byte _080E804C + .4byte _080E805A + .4byte _080E8064 + .4byte _080E807C + .4byte _080E8090 + .4byte _080E80A4 + .4byte _080E80C0 + .4byte _080E80EE + .4byte _080E80FA +_080E804C: + bl sub_800A064 + cmp r0, 0 + bne _080E80F2 + movs r0, 0x6 + strh r0, [r4, 0x8] + b _080E810A +_080E805A: + bl sub_8076D5C + bl sub_8153430 + b _080E80F2 +_080E8064: + bl sub_8153474 + lsls r0, 24 + cmp r0, 0 + beq _080E810A + bl sav2_gender2_inplace_and_xFE + movs r1, 0 + movs r0, 0x4 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + b _080E810A +_080E807C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _080E810A + bl sub_800AC34 + b _080E80F2 +_080E8090: + ldr r0, _080E80A0 + ldrb r0, [r0] + cmp r0, 0 + bne _080E810A + adds r0, r5, 0 + bl remove_task + b _080E810A + .align 2, 0 +_080E80A0: .4byte 0x03003124 +_080E80A4: + movs r0, 0 + bl sub_801048C + lsls r0, 24 + cmp r0, 0 + bne _080E810A + ldr r0, _080E80BC + movs r1, 0x5 + bl AddTask + b _080E80F2 + .align 2, 0 +_080E80BC: .4byte sub_8153688 + 1 +_080E80C0: + ldr r0, _080E80E0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080E810A + ldr r0, _080E80E4 + ldrb r0, [r0] + cmp r0, 0 + beq _080E80E8 + movs r0, 0x1 + bl sub_801048C + movs r0, 0x8 + strh r0, [r4, 0x8] + b _080E810A + .align 2, 0 +_080E80E0: .4byte sub_8153688 + 1 +_080E80E4: .4byte 0x030030fc +_080E80E8: + movs r0, 0x4 + strh r0, [r4, 0x8] + b _080E810A +_080E80EE: + bl sub_800ADF8 +_080E80F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080E810A +_080E80FA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080E810A + adds r0, r5, 0 + bl remove_task +_080E810A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E7FF8 + + thumb_func_start sub_80E8110 +sub_80E8110: @ 80E8110 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r0, [sp] + mov r10, r1 + adds r1, r0, 0 + adds r1, 0x38 + movs r0, 0xFF + strb r0, [r1] + ldr r1, [sp] + adds r1, 0x7C + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + ldr r0, [sp] + mov r1, r10 + movs r2, 0x44 + bl memcpy + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0 + str r1, [sp, 0xC] + movs r2, 0 + str r2, [sp, 0x4] + mov r8, r2 + movs r7, 0 + ldr r0, _080E81DC + mov r9, r0 +_080E8150: + mov r1, r9 + ldr r0, [r1] + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + adds r0, r7, r0 + movs r1, 0x3 + bl __modsi3 + adds r6, r0, 0x1 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + mov r2, r10 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x38 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E81B8 + adds r5, r1, 0 + adds r5, 0x34 + adds r0, r5, 0 + bl sub_80842DC + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + adds r0, 0xA + bl sub_80842DC + cmp r4, r0 + beq _080E819A + movs r2, 0x1 + add r8, r2 + str r6, [sp, 0x4] +_080E819A: + adds r0, r5, 0 + bl sub_80842DC + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + adds r0, 0xA + bl sub_80842DC + cmp r4, r0 + bne _080E81B8 + ldr r2, [sp, 0xC] + adds r2, 0x1 + str r2, [sp, 0xC] + str r6, [sp, 0x8] +_080E81B8: + adds r7, 0x1 + cmp r7, 0x1 + ble _080E8150 + mov r0, r8 + cmp r0, 0 + bne _080E81D0 + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _080E81D0 + mov r8, r1 + ldr r2, [sp, 0x8] + str r2, [sp, 0x4] +_080E81D0: + mov r0, r8 + cmp r0, 0x1 + beq _080E81E0 + cmp r0, 0x2 + beq _080E81EC + b _080E824C + .align 2, 0 +_080E81DC: .4byte 0x03005d90 +_080E81E0: + ldr r2, [sp, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r10 + b _080E820E +_080E81EC: + bl GenerateRandomNumber2 + lsls r0, 16 + ldr r1, _080E821C + cmp r0, r1 + bls _080E8224 + ldr r0, _080E8220 + ldr r0, [r0] + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r10 + adds r1, 0x44 +_080E820E: + ldr r0, [sp] + adds r0, 0x44 + movs r2, 0x44 + bl memcpy + b _080E824C + .align 2, 0 +_080E821C: .4byte 0x33330000 +_080E8220: .4byte 0x03005d90 +_080E8224: + ldr r0, _080E825C + ldr r0, [r0] + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r10 + adds r1, 0x44 + ldr r0, [sp] + adds r0, 0x44 + movs r2, 0x44 + bl memcpy +_080E824C: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E825C: .4byte 0x03005d90 + thumb_func_end sub_80E8110 + + thumb_func_start sub_80E8260 +sub_80E8260: @ 80E8260 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + movs r6, 0 + ldr r0, _080E83F4 + mov r10, r0 +_080E8274: + movs r7, 0 + lsls r0, r6, 5 + adds r6, 0x1 + mov r9, r6 + mov r1, r8 + adds r4, r0, r1 + adds r0, 0x6 + adds r6, r1, r0 + adds r5, r4, 0 +_080E8286: + mov r2, r10 + ldr r1, [r2] + adds r1, 0xA + adds r0, r5, 0 + bl sub_80842F4 + movs r0, 0x2 + strb r0, [r4, 0xE] + mov r0, r10 + ldr r1, [r0] + adds r0, r6, 0 + bl gf_strcpy + adds r4, 0x10 + adds r6, 0x10 + adds r5, 0x10 + adds r7, 0x1 + cmp r7, 0x1 + ble _080E8286 + mov r6, r9 + cmp r6, 0x8 + ble _080E8274 + ldr r1, _080E83F4 + mov r10, r1 + ldr r2, _080E83F8 + str r2, [sp, 0x4] + movs r4, 0x99 + lsls r4, 1 + add r4, r8 + movs r0, 0x95 + lsls r0, 1 + add r0, r8 + mov r9, r0 + ldr r1, _080E83FC + str r1, [sp, 0x8] + movs r6, 0x92 + lsls r6, 1 + add r6, r8 + movs r5, 0x90 + lsls r5, 1 + add r5, r8 + movs r7, 0x1 +_080E82DA: + movs r0, 0x2 + strb r0, [r4, 0x8] + mov r2, r10 + ldr r1, [r2] + adds r1, 0xA + adds r0, r5, 0 + bl sub_80842F4 + mov r0, r10 + ldr r1, [r0] + ldr r2, [sp, 0x8] + adds r1, r2 + adds r0, r6, 0 + bl sub_80842F4 + mov r0, r10 + ldr r1, [r0] + mov r0, r9 + bl gf_strcpy + mov r2, r10 + ldr r1, [r2] + ldr r0, [sp, 0x4] + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, [sp, 0x4] + adds r1, 0x8 + str r1, [sp, 0x4] + adds r4, 0x1C + movs r2, 0x1C + add r9, r2 + ldr r0, [sp, 0x8] + adds r0, 0x4 + str r0, [sp, 0x8] + adds r6, 0x1C + adds r5, 0x1C + subs r7, 0x1 + cmp r7, 0 + bge _080E82DA + movs r6, 0 + ldr r0, _080E83F4 + ldr r3, [r0] + mov r4, r8 + movs r1, 0xC4 + adds r1, r4 + mov r9, r1 + movs r2, 0x84 + adds r2, r4 + mov r8, r2 + movs r0, 0x44 + adds r0, r4 + mov r12, r0 + adds r7, r4, 0x4 + movs r1, 0xCF + lsls r1, 4 + adds r1, r3, r1 + str r1, [sp] + mov r10, r4 + ldr r2, _080E8400 + adds r5, r3, r2 +_080E8356: + lsls r2, r6, 1 + ldr r1, [sp] + ldrh r0, [r1] + strh r0, [r7] + ldrh r0, [r5] + strh r0, [r7, 0x20] + ldrh r0, [r5, 0x4] + mov r1, r12 + strh r0, [r1] + ldr r1, _080E8404 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x20] + movs r1, 0xDD + lsls r1, 4 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r8 + strh r0, [r1] + ldr r1, _080E8408 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r8 + strh r0, [r1, 0x20] + ldr r1, _080E840C + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r9 + strh r0, [r1] + ldr r1, _080E8410 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r9 + strh r0, [r1, 0x20] + ldr r1, _080E8414 + adds r0, r3, r1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x82 + lsls r0, 1 + add r0, r10 + strh r1, [r0] + ldr r1, _080E8418 + adds r0, r3, r1 + adds r0, r2 + ldrh r1, [r0] + movs r2, 0x94 + lsls r2, 1 + adds r0, r4, r2 + strh r1, [r0] + adds r4, 0x1C + movs r0, 0x10 + add r9, r0 + add r8, r0 + add r12, r0 + adds r7, 0x10 + ldr r1, [sp] + adds r1, 0x2 + str r1, [sp] + add r10, r0 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x1 + ble _080E8356 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E83F4: .4byte 0x03005d90 +_080E83F8: .4byte 0x00000ee1 +_080E83FC: .4byte 0x00000ef1 +_080E8400: .4byte 0x00000cf4 +_080E8404: .4byte 0x00000d14 +_080E8408: .4byte 0x00000dde +_080E840C: .4byte 0x00000dea +_080E8410: .4byte 0x00000e08 +_080E8414: .4byte 0x00000e1e +_080E8418: .4byte 0x00000cfc + thumb_func_end sub_80E8260 + + thumb_func_start sub_80E841C +sub_80E841C: @ 80E841C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + adds r6, r1, 0 + adds r6, 0x34 + adds r5, r1, 0 +_080E842E: + adds r0, r7, 0 + adds r0, 0x34 + bl sub_80842DC + adds r4, r0, 0 + adds r0, r6, 0 + bl sub_80842DC + cmp r4, r0 + bne _080E844E + ldrb r0, [r7, 0x2] + ldrb r1, [r5, 0x2] + cmp r0, r1 + bne _080E844E + movs r0, 0x1 + b _080E845E +_080E844E: + adds r6, 0x44 + adds r5, 0x44 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + ble _080E842E + movs r0, 0 +_080E845E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E841C + + thumb_func_start sub_80E8468 +sub_80E8468: @ 80E8468 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + mov r0, sp + bl sub_80E7830 + lsls r4, 2 + mov r1, sp + adds r0, r1, r4 + ldr r0, [r0] + muls r0, r5 + adds r3, r6, r0 + movs r7, 0 + movs r2, 0 + mov r8, r2 + movs r5, 0 + adds r6, r3, 0 + adds r6, 0x38 + adds r4, r3, 0 +_080E8496: + ldrb r0, [r6] + cmp r0, 0xFF + beq _080E84B4 + ldr r0, _080E84C8 + ldr r1, [r0] + adds r1, 0xDC + adds r0, r4, 0 + str r3, [sp, 0x10] + bl sub_80E841C + ldr r3, [sp, 0x10] + cmp r0, 0 + bne _080E84B4 + adds r7, 0x1 + mov r8, r5 +_080E84B4: + adds r6, 0x44 + adds r4, 0x44 + adds r5, 0x1 + cmp r5, 0x1 + ble _080E8496 + cmp r7, 0x1 + beq _080E84CC + cmp r7, 0x2 + beq _080E8508 + b _080E8566 + .align 2, 0 +_080E84C8: .4byte 0x03005d90 +_080E84CC: + ldr r4, _080E8504 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB2 + ldrb r1, [r1] + lsls r1, 27 + lsrs r1, 30 + adds r2, r1, 0x1 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r0, r1 + adds r0, 0xDC + mov r2, r8 + lsls r1, r2, 4 + add r1, r8 + lsls r1, 2 + adds r1, r3 + movs r2, 0x44 + bl memcpy + ldr r4, [r4] + adds r4, 0xB2 + ldrb r5, [r4] + lsls r0, r5, 27 + lsrs r0, 30 + adds r0, 0x1 + b _080E8550 + .align 2, 0 +_080E8504: .4byte 0x03005d90 +_080E8508: + movs r5, 0 + adds r6, r3, 0 +_080E850C: + movs r0, 0x1 + eors r0, r5 + ldr r7, _080E8574 + ldr r4, [r7] + adds r1, r4, 0 + adds r1, 0xB2 + ldrb r1, [r1] + lsls r1, 27 + lsrs r1, 30 + adds r0, r1 + movs r1, 0x3 + bl __modsi3 + adds r2, r0, 0x1 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + adds r4, 0xDC + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x44 + bl memcpy + adds r6, 0x44 + adds r5, 0x1 + cmp r5, 0x1 + ble _080E850C + ldr r4, [r7] + adds r4, 0xB2 + ldrb r5, [r4] + lsls r0, r5, 27 + lsrs r0, 30 + adds r0, 0x2 +_080E8550: + movs r1, 0x3 + bl __modsi3 + movs r1, 0x3 + ands r0, r1 + lsls r0, 3 + movs r1, 0x19 + negs r1, r1 + ands r1, r5 + orrs r1, r0 + strb r1, [r4] +_080E8566: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E8574: .4byte 0x03005d90 + thumb_func_end sub_80E8468 + + thumb_func_start sub_80E8578 +sub_80E8578: @ 80E8578 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x54 + str r0, [sp] + ldr r0, [sp, 0x74] + movs r4, 0 + mov r8, r4 + movs r5, 0 + str r5, [sp, 0x4] + ldr r4, _080E8594 + b _080E85A0 + .align 2, 0 +_080E8594: .4byte 0x03001168 +_080E8598: + adds r1, r2 + ldr r6, [sp, 0x4] + adds r6, 0x1 + str r6, [sp, 0x4] +_080E85A0: + ldr r5, [sp, 0x4] + cmp r5, r0 + bge _080E85B6 + cmp r5, r3 + beq _080E85B0 + stm r4!, {r1} + movs r6, 0x1 + add r8, r6 +_080E85B0: + mov r5, r8 + cmp r5, 0x3 + bne _080E8598 +_080E85B6: + movs r6, 0 + str r6, [sp, 0x4] + subs r0, 0x1 + str r0, [sp, 0x24] +_080E85BE: + movs r0, 0 + str r0, [sp, 0x8] + ldr r1, [sp, 0x4] + adds r1, 0x1 + str r1, [sp, 0x28] + ldr r2, [sp, 0x4] + lsls r2, 1 + str r2, [sp, 0x34] + ldr r3, [sp, 0x4] + adds r3, r2, r3 + str r3, [sp, 0x10] + movs r4, 0 + str r4, [sp, 0x44] + movs r5, 0 + str r5, [sp, 0x48] +_080E85DC: + movs r6, 0 + mov r8, r6 + ldr r0, _080E8874 + ldr r1, [r0] + ldr r2, [sp, 0x10] + lsls r0, r2, 5 + ldr r3, [sp, 0x48] + adds r0, r3, r0 + adds r3, r0, r1 + lsls r0, r2, 6 + ldr r4, [sp, 0x44] + adds r0, r4, r0 + ldr r5, [sp] + adds r2, r0, r5 +_080E85F8: + adds r0, r2, 0 + movs r6, 0x87 + lsls r6, 2 + adds r1, r3, r6 + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x10 + adds r2, 0x10 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x2 + ble _080E85F8 + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0x24] + cmp r8, r3 + bge _080E86DC + ldr r4, [sp, 0x4] + lsls r4, 5 + mov r9, r4 + ldr r5, [sp, 0x8] + lsls r7, r5, 4 + ldr r6, [sp, 0x34] + ldr r1, [sp, 0x4] + adds r0, r6, r1 + lsls r0, 6 + str r0, [sp, 0x14] + ldr r2, [sp] + adds r0, r2, r0 + ldr r3, [sp, 0x44] + str r3, [sp, 0x18] + adds r0, r3 + str r0, [sp, 0x1C] + ldr r4, [sp, 0x14] + adds r0, r3, r4 + adds r0, r2 + adds r0, 0x30 + mov r10, r0 +_080E864A: + movs r5, 0 + str r5, [sp, 0xC] + movs r3, 0 + mov r6, r8 + lsls r6, 2 + str r6, [sp, 0x38] + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + ldr r4, [sp] + adds r5, r0, r4 + ldr r0, _080E8878 + adds r0, r6, r0 + str r0, [sp, 0x50] +_080E8666: + lsls r0, r3, 4 + ldr r6, [sp, 0x1C] + adds r0, r6, r0 + str r3, [sp, 0x4C] + bl sub_80842DC + adds r4, r0, 0 + ldr r1, [sp, 0x50] + ldr r0, [r1] + add r0, r9 + adds r0, r7 + bl sub_80842DC + ldr r3, [sp, 0x4C] + cmp r4, r0 + bne _080E86A8 + ldr r2, [sp, 0xC] + adds r2, 0x1 + str r2, [sp, 0xC] + ldr r4, [sp, 0x50] + ldr r0, [r4] + mov r6, r9 + adds r1, r7, r6 + adds r1, r0, r1 + ldrh r0, [r5, 0x4] + ldrh r2, [r1, 0x4] + cmp r0, r2 + bcs _080E86A8 + adds r0, r5, 0 + ldm r1!, {r2,r4,r6} + stm r0!, {r2,r4,r6} + ldr r1, [r1] + str r1, [r0] +_080E86A8: + adds r5, 0x10 + adds r3, 0x1 + cmp r3, 0x2 + ble _080E8666 + ldr r3, [sp, 0xC] + cmp r3, 0 + bne _080E86CE + ldr r0, _080E8878 + ldr r4, [sp, 0x38] + adds r0, r4, r0 + ldr r0, [r0] + mov r5, r9 + adds r2, r7, r5 + mov r1, r10 + adds r0, r2 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] +_080E86CE: + movs r4, 0x10 + add r10, r4 + movs r5, 0x1 + add r8, r5 + ldr r6, [sp, 0x24] + cmp r8, r6 + blt _080E864A +_080E86DC: + ldr r0, [sp, 0x44] + adds r0, 0x60 + str r0, [sp, 0x44] + ldr r1, [sp, 0x48] + adds r1, 0x30 + str r1, [sp, 0x48] + ldr r2, [sp, 0x8] + adds r2, 0x1 + str r2, [sp, 0x8] + cmp r2, 0x1 + bgt _080E86F4 + b _080E85DC +_080E86F4: + ldr r3, [sp, 0x28] + str r3, [sp, 0x4] + cmp r3, 0x8 + bgt _080E86FE + b _080E85BE +_080E86FE: + movs r4, 0 + str r4, [sp, 0x8] +_080E8702: + ldr r5, [sp, 0x8] + adds r5, 0x1 + str r5, [sp, 0x2C] + ldr r0, _080E8874 + ldr r1, [r0] + movs r0, 0x54 + ldr r6, [sp, 0x8] + muls r0, r6 + adds r3, r0, r1 + movs r0, 0xA8 + muls r0, r6 + ldr r1, [sp] + adds r2, r0, r1 + movs r4, 0x2 + mov r8, r4 +_080E8720: + movs r5, 0xD8 + lsls r5, 3 + adds r0, r2, r5 + ldr r6, _080E887C + adds r1, r3, r6 + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x1C + adds r2, 0x1C + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r1, r8 + cmp r1, 0 + bge _080E8720 + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0x24] + cmp r8, r3 + blt _080E8752 + b _080E885A +_080E8752: + ldr r4, [sp, 0x8] + lsls r1, r4, 3 + movs r0, 0xA8 + adds r5, r4, 0 + muls r5, r0 + str r5, [sp, 0x20] + str r5, [sp, 0x3C] + subs r1, r4 + lsls r1, 2 + mov r10, r1 +_080E8766: + movs r6, 0 + str r6, [sp, 0xC] + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x38] + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x30] + ldr r0, _080E8878 + ldr r2, [sp, 0x38] + adds r2, r0 + mov r9, r2 + ldr r3, [sp] + movs r4, 0xD8 + lsls r4, 3 + adds r0, r3, r4 + ldr r5, [sp, 0x3C] + adds r7, r5, r0 + str r6, [sp, 0x40] + movs r3, 0x2 +_080E878E: + ldr r1, [sp, 0x20] + movs r2, 0xD8 + lsls r2, 3 + adds r0, r1, r2 + ldr r4, [sp] + adds r0, r4, r0 + ldr r6, [sp, 0x40] + adds r5, r0, r6 + adds r0, r5, 0 + str r3, [sp, 0x4C] + bl sub_80842DC + adds r4, r0, 0 + movs r6, 0x90 + lsls r6, 1 + add r6, r10 + mov r1, r9 + ldr r0, [r1] + adds r0, r6 + bl sub_80842DC + ldr r3, [sp, 0x4C] + cmp r4, r0 + bne _080E8808 + adds r0, r5, 0x4 + bl sub_80842DC + adds r4, r0, 0 + mov r2, r9 + ldr r0, [r2] + adds r0, r6 + adds r0, 0x4 + bl sub_80842DC + ldr r3, [sp, 0x4C] + cmp r4, r0 + bne _080E8808 + ldr r4, [sp, 0xC] + adds r4, 0x1 + str r4, [sp, 0xC] + mov r5, r9 + ldr r0, [r5] + mov r6, r10 + adds r2, r0, r6 + movs r0, 0x94 + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r7, 0x8] + ldrh r1, [r1] + cmp r0, r1 + bcs _080E8808 + adds r0, r7, 0 + movs r4, 0x90 + lsls r4, 1 + adds r1, r2, r4 + ldm r1!, {r2,r5,r6} + stm r0!, {r2,r5,r6} + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r1] + str r1, [r0] +_080E8808: + adds r7, 0x1C + ldr r0, [sp, 0x40] + adds r0, 0x1C + str r0, [sp, 0x40] + subs r3, 0x1 + cmp r3, 0 + bge _080E878E + ldr r1, [sp, 0xC] + cmp r1, 0 + bne _080E8850 + mov r0, r8 + adds r0, 0x3 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r2, [sp, 0x20] + adds r1, r2 + ldr r3, [sp] + adds r1, r3, r1 + ldr r0, _080E8878 + ldr r4, [sp, 0x38] + adds r0, r4, r0 + ldr r0, [r0] + add r0, r10 + movs r5, 0xD8 + lsls r5, 3 + adds r1, r5 + movs r6, 0x90 + lsls r6, 1 + adds r0, r6 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r0, [r0] + str r0, [r1] +_080E8850: + ldr r3, [sp, 0x30] + mov r8, r3 + ldr r4, [sp, 0x24] + cmp r8, r4 + blt _080E8766 +_080E885A: + ldr r5, [sp, 0x2C] + str r5, [sp, 0x8] + cmp r5, 0x1 + bgt _080E8864 + b _080E8702 +_080E8864: + add sp, 0x54 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E8874: .4byte 0x03005d90 +_080E8878: .4byte 0x03001168 +_080E887C: .4byte 0x0000057c + thumb_func_end sub_80E8578 + + thumb_func_start sub_80E8880 +sub_80E8880: @ 80E8880 + push {r4-r7,lr} + mov r12, r0 + adds r7, r1, 0 + movs r5, 0 +_080E8888: + movs r2, 0 + movs r4, 0x1 + negs r4, r4 + movs r1, 0 + adds r6, r5, 0x1 + adds r3, r7, 0 +_080E8894: + ldrh r0, [r3, 0x4] + cmp r0, r2 + ble _080E889E + adds r4, r1, 0 + adds r2, r0, 0 +_080E889E: + adds r3, 0x10 + adds r1, 0x1 + cmp r1, 0x5 + ble _080E8894 + cmp r4, 0 + blt _080E88C0 + lsls r1, r5, 4 + lsls r2, r4, 4 + adds r2, r7 + add r1, r12 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x4] +_080E88C0: + adds r5, r6, 0 + cmp r5, 0x2 + ble _080E8888 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8880 + + thumb_func_start sub_80E88CC +sub_80E88CC: @ 80E88CC + push {r4-r7,lr} + mov r12, r0 + adds r6, r1, 0 + movs r5, 0 +_080E88D4: + movs r3, 0 + movs r4, 0x1 + negs r4, r4 + movs r2, 0 + adds r7, r5, 0x1 + adds r1, r6, 0 +_080E88E0: + ldrh r0, [r1, 0x8] + cmp r0, r3 + ble _080E88EA + adds r4, r2, 0 + adds r3, r0, 0 +_080E88EA: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x5 + ble _080E88E0 + cmp r4, 0 + blt _080E8918 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + adds r2, r6 + add r1, r12 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x8] +_080E8918: + adds r5, r7, 0 + cmp r5, 0x2 + ble _080E88D4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E88CC + + thumb_func_start sub_80E8924 +sub_80E8924: @ 80E8924 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + movs r0, 0 + ldr r1, _080E89A4 + mov r10, r1 +_080E8936: + lsls r1, r0, 1 + adds r2, r0, 0x1 + mov r8, r2 + adds r1, r0 + lsls r0, r1, 5 + movs r2, 0x87 + lsls r2, 2 + adds r7, r0, r2 + lsls r1, 6 + mov r0, r9 + adds r4, r0, r1 + movs r6, 0 + movs r5, 0x1 +_080E8950: + mov r1, r10 + ldr r0, [r1] + adds r0, r7 + adds r0, r6 + adds r1, r4, 0 + bl sub_80E8880 + adds r4, 0x60 + adds r6, 0x30 + subs r5, 0x1 + cmp r5, 0 + bge _080E8950 + mov r0, r8 + cmp r0, 0x8 + ble _080E8936 + movs r5, 0 + ldr r4, _080E89A4 +_080E8972: + movs r0, 0x54 + adds r1, r5, 0 + muls r1, r0 + ldr r2, _080E89A8 + adds r1, r2 + ldr r0, [r4] + adds r0, r1 + movs r1, 0xA8 + muls r1, r5 + movs r2, 0xD8 + lsls r2, 3 + adds r1, r2 + add r1, r9 + bl sub_80E88CC + adds r5, 0x1 + cmp r5, 0x1 + ble _080E8972 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E89A4: .4byte 0x03005d90 +_080E89A8: .4byte 0x0000057c + thumb_func_end sub_80E8924 + + thumb_func_start sub_80E89AC +sub_80E89AC: @ 80E89AC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + bl sub_8009FCC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x81 + lsls r0, 4 + bl malloc_and_clear + adds r5, r0, 0 + str r4, [sp] + adds r1, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_80E8578 + adds r0, r5, 0 + bl sub_80E8924 + adds r0, r5, 0 + bl free + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E89AC + + thumb_func_start sub_80E89F8 +sub_80E89F8: @ 80E89F8 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, _080E8A40 + ldr r4, _080E8A44 + ldr r1, [r4] + movs r0, 0xC2 + lsls r0, 6 + adds r1, r0 + adds r0, r5, 0 + movs r2, 0x38 + bl memcpy + ldr r1, [r4] + ldr r0, _080E8A48 + adds r1, r0 + adds r0, r5, 0 + adds r0, 0x38 + movs r2, 0x38 + bl memcpy + ldr r0, [r4] + ldr r1, _080E8A4C + adds r0, r1 + adds r1, r5, 0 + bl sub_806FA9C + ldr r0, _080E8A50 + ldr r1, [r0] + adds r0, r6, 0 + movs r2, 0x78 + bl memcpy + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E8A40: .4byte 0x02039f9c +_080E8A44: .4byte 0x03005d8c +_080E8A48: .4byte 0x0000310c +_080E8A4C: .4byte 0x00003030 +_080E8A50: .4byte 0x03001148 + thumb_func_end sub_80E89F8 + + thumb_func_start sub_80E8A54 +sub_80E8A54: @ 80E8A54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r0, 0 + mov r9, r0 + ldr r0, [r5, 0x70] + cmp r9, r0 + bcs _080E8AAE + adds r4, r5, 0 + adds r4, 0x2C + movs r0, 0x24 + adds r0, r5 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x37 + adds r6, r5, 0 +_080E8A78: + ldrh r0, [r6, 0x20] + cmp r0, 0 + beq _080E8A9A + ldrb r1, [r4, 0xB] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + beq _080E8A90 + mov r0, r8 + movs r1, 0xFC + bl sub_81DB4DC +_080E8A90: + ldrb r1, [r7] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8009308 +_080E8A9A: + adds r4, 0x38 + movs r0, 0x38 + add r8, r0 + adds r7, 0x38 + adds r6, 0x38 + movs r0, 0x1 + add r9, r0 + ldr r0, [r5, 0x70] + cmp r9, r0 + bcc _080E8A78 +_080E8AAE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8A54 + + thumb_func_start nullsub_44 +nullsub_44: @ 80E8ABC + bx lr + thumb_func_end nullsub_44 + + thumb_func_start sub_80E8AC0 +sub_80E8AC0: @ 80E8AC0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_080E8AC6: + movs r0, 0x2C + muls r0, r4 + adds r0, 0x34 + adds r1, r5, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080E8ADC + adds r0, r1, 0 + adds r0, 0x20 + bl sub_8009370 +_080E8ADC: + adds r4, 0x1 + cmp r4, 0x3 + ble _080E8AC6 + adds r0, r5, 0 + bl sub_8164F70 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E8AC0 + + thumb_func_start sub_80E8AF0 +sub_80E8AF0: @ 80E8AF0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0 + str r0, [sp] + ldr r2, _080E8B24 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + movs r2, 0 + adds r4, 0x2 + movs r3, 0xFF +_080E8B0A: + adds r0, r4, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x6 + bls _080E8B0A + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E8B24: .4byte 0x01000028 + thumb_func_end sub_80E8AF0 + + thumb_func_start sub_80E8B28 +sub_80E8B28: @ 80E8B28 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080E8B50 +_080E8B2E: + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 5 + ldr r0, _080E8B54 + adds r1, r0 + ldr r0, [r5] + adds r0, r1 + bl sub_80E8AF0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080E8B2E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E8B50: .4byte 0x03005d8c +_080E8B54: .4byte 0x00001a9c + thumb_func_end sub_80E8B28 + + thumb_func_start sub_80E8B58 +sub_80E8B58: @ 80E8B58 + ldr r0, _080E8B64 + ldr r1, _080E8B68 + ldrh r1, [r1] + strb r1, [r0] + bx lr + .align 2, 0 +_080E8B64: .4byte 0x0203a01c +_080E8B68: .4byte 0x020375e0 + thumb_func_end sub_80E8B58 + + thumb_func_start sub_80E8B6C +sub_80E8B6C: @ 80E8B6C + push {r4,lr} + ldr r0, _080E8B7C + movs r1, 0 + strh r1, [r0] + movs r3, 0 + adds r4, r0, 0 + b _080E8B86 + .align 2, 0 +_080E8B7C: .4byte 0x020375f0 +_080E8B80: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 +_080E8B86: + cmp r3, 0x13 + bhi _080E8BB0 + ldr r2, _080E8BB8 + ldr r0, _080E8BBC + ldr r1, [r0] + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 5 + adds r1, r0 + ldr r0, _080E8BC0 + adds r1, r0 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bne _080E8B80 + movs r0, 0x1 + strh r0, [r4] + ldr r0, _080E8BC4 + adds r1, r3, 0 + bl var_set +_080E8BB0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E8BB8: .4byte 0x0203a01c +_080E8BBC: .4byte 0x03005d8c +_080E8BC0: .4byte 0x00001a9c +_080E8BC4: .4byte 0x00004054 + thumb_func_end sub_80E8B6C + + thumb_func_start sub_80E8BC8 +sub_80E8BC8: @ 80E8BC8 + push {lr} + ldr r0, _080E8BE0 + ldr r0, [r0] + ldr r1, _080E8BE4 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0 + beq _080E8BEC + ldr r1, _080E8BE8 + movs r0, 0x1 + strh r0, [r1] + b _080E8BF0 + .align 2, 0 +_080E8BE0: .4byte 0x03005d8c +_080E8BE4: .4byte 0x00001a9c +_080E8BE8: .4byte 0x020375f0 +_080E8BEC: + ldr r0, _080E8BF4 + strh r1, [r0] +_080E8BF0: + pop {r0} + bx r0 + .align 2, 0 +_080E8BF4: .4byte 0x020375f0 + thumb_func_end sub_80E8BC8 + + thumb_func_start sub_80E8BF8 +sub_80E8BF8: @ 80E8BF8 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + adds r1, r0, 0 + ldr r2, _080E8C30 + adds r0, r2, 0 + ands r1, r0 + adds r0, r1, 0 + subs r0, 0x90 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C34 + movs r0, 0x1 + b _080E8C8E + .align 2, 0 +_080E8C30: .4byte 0x00000fff +_080E8C34: + adds r0, r1, 0 + subs r0, 0x92 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C44 + movs r0, 0x2 + b _080E8C8E +_080E8C44: + adds r0, r1, 0 + subs r0, 0x9A + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C54 + movs r0, 0x3 + b _080E8C8E +_080E8C54: + adds r0, r1, 0 + subs r0, 0x94 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C64 + movs r0, 0x4 + b _080E8C8E +_080E8C64: + adds r0, r1, 0 + subs r0, 0x96 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080E8C78 + cmp r1, 0x9C + beq _080E8C78 + cmp r1, 0x9D + bne _080E8C7C +_080E8C78: + movs r0, 0x5 + b _080E8C8E +_080E8C7C: + adds r0, r1, 0 + subs r0, 0x98 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080E8C8C + movs r0, 0 + b _080E8C8E +_080E8C8C: + movs r0, 0x6 +_080E8C8E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E8BF8 + + thumb_func_start sub_80E8C98 +sub_80E8C98: @ 80E8C98 + push {r4,lr} + ldr r4, _080E8CAC + bl sub_80E8BF8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E8CAC: .4byte 0x020375e6 + thumb_func_end sub_80E8C98 + + thumb_func_start sub_80E8CB0 +sub_80E8CB0: @ 80E8CB0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r0, [sp] + str r1, [sp, 0x4] + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + ldr r0, _080E8D14 + ldr r0, [r0] + mov r8, r0 + movs r0, 0 + mov r12, r0 + mov r1, r8 + ldr r0, [r1, 0x4] + cmp r12, r0 + bge _080E8D3C + ldr r4, [r1] +_080E8CDA: + movs r2, 0 + mov r0, r12 + lsls r7, r0, 16 + cmp r2, r4 + bge _080E8D28 + asrs r0, r7, 16 + adds r6, r0, 0 + muls r6, r4 + mov r1, r8 + ldr r5, [r1, 0xC] + ldr r0, _080E8D18 + mov r9, r0 +_080E8CF2: + lsls r0, r2, 16 + asrs r3, r0, 16 + adds r0, r6, r3 + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + mov r0, r9 + ands r0, r1 + cmp r0, r10 + bne _080E8D1C + ldr r1, [sp] + strh r2, [r1] + mov r0, r12 + ldr r2, [sp, 0x4] + strh r0, [r2] + b _080E8D3C + .align 2, 0 +_080E8D14: .4byte 0x02037318 +_080E8D18: .4byte 0x000003ff +_080E8D1C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, r4 + blt _080E8CF2 +_080E8D28: + movs r2, 0x80 + lsls r2, 9 + adds r1, r7, r2 + lsrs r0, r1, 16 + mov r12, r0 + asrs r1, 16 + mov r2, r8 + ldr r0, [r2, 0x4] + cmp r1, r0 + blt _080E8CDA +_080E8D3C: + 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_80E8CB0 + + thumb_func_start sub_80E8D4C +sub_80E8D4C: @ 80E8D4C + 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 player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + movs r5, 0 + mov r12, r4 + lsls r0, 16 + asrs r3, r0, 16 + ldr r1, _080E8D98 + mov r8, r1 + adds r7, r0, 0 + mov r4, sp + mov r6, r12 +_080E8D80: + ldr r0, _080E8D98 + lsls r1, r5, 2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, r3 + bne _080E8D9C + movs r3, 0 + ldrsh r0, [r4, r3] + movs r5, 0 + ldrsh r1, [r6, r5] + ldrh r3, [r2, 0x2] + b _080E8DC4 + .align 2, 0 +_080E8D98: .4byte 0x0858cfcc +_080E8D9C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x6 + bls _080E8D80 + movs r5, 0 + mov r4, sp + mov r6, r12 +_080E8DAC: + lsls r0, r5, 2 + mov r1, r8 + adds r3, r0, r1 + ldrh r1, [r3, 0x2] + asrs r0, r7, 16 + cmp r1, r0 + bne _080E8DDE + movs r2, 0 + ldrsh r0, [r4, r2] + movs r5, 0 + ldrsh r1, [r6, r5] + ldrh r3, [r3] +_080E8DC4: + movs r5, 0xC0 + lsls r5, 4 + adds r2, r5, 0 + orrs r2, r3 + bl setmaptile_0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl cur_mapdata_draw_block_at + b _080E8DE8 +_080E8DDE: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x6 + bls _080E8DAC +_080E8DE8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8D4C + + thumb_func_start sub_80E8DF4 +sub_80E8DF4: @ 80E8DF4 + push {lr} + adds r2, r0, 0 + movs r1, 0 +_080E8DFA: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E8E06 + adds r0, r1, 0 + b _080E8E12 +_080E8E06: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x6 + bls _080E8DFA + movs r0, 0x7 +_080E8E12: + pop {r1} + bx r1 + thumb_func_end sub_80E8DF4 + + thumb_func_start sub_80E8E18 +sub_80E8E18: @ 80E8E18 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r2, _080E8EB4 + ldr r0, [r2] + ldr r1, _080E8EB8 + ldrb r1, [r1] + ldr r3, _080E8EBC + adds r0, r3 + strb r1, [r0] + movs r3, 0 + ldr r5, _080E8EC0 + ldr r4, _080E8EC4 +_080E8E32: + ldr r1, [r2] + adds r1, r5 + adds r1, r3 + ldr r0, [r4] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080E8E32 + ldr r0, _080E8EC8 + movs r1, 0 + bl var_set + ldr r6, _080E8EB4 + ldr r4, [r6] + ldr r0, _080E8ECC + adds r4, r0 + ldr r1, _080E8EC4 + mov r8, r1 + ldr r5, [r1] + adds r0, r5, 0 + bl sub_80E8DF4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl gf_strncpy + ldr r3, [r6] + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + ldr r1, _080E8ED0 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldr r0, [r6] + ldr r3, _080E8ED4 + adds r0, r3 + movs r1, 0x2 + strb r1, [r0] + ldr r0, _080E8ED8 + ldr r1, _080E8EDC + ldrb r1, [r1, 0x14] + bl var_set + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E8EB4: .4byte 0x03005d8c +_080E8EB8: .4byte 0x0203a01c +_080E8EBC: .4byte 0x00001a9c +_080E8EC0: .4byte 0x00001aa5 +_080E8EC4: .4byte 0x03005d90 +_080E8EC8: .4byte 0x00004054 +_080E8ECC: .4byte 0x00001a9e +_080E8ED0: .4byte 0x00001a9d +_080E8ED4: .4byte 0x00001aa9 +_080E8ED8: .4byte 0x00004026 +_080E8EDC: .4byte 0x02037318 + thumb_func_end sub_80E8E18 + + thumb_func_start sub_80E8EE0 +sub_80E8EE0: @ 80E8EE0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + movs r5, 0 + b _080E8F8A +_080E8EEE: + mov r0, r8 + ldr r1, [r0, 0x10] + lsls r2, r5, 1 + adds r0, r2, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + adds r6, r1, 0 + adds r1, r5, 0x1 + mov r9, r1 + cmp r0, 0x8 + bne _080E8F82 + movs r4, 0 + ldr r7, _080E8F60 +_080E8F0A: + ldr r1, [r7] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 5 + adds r1, r0 + ldr r0, _080E8F64 + adds r1, r0 + ldrb r1, [r1] + adds r0, r2, r5 + lsls r0, 2 + adds r3, r0, r6 + ldr r0, [r3, 0x8] + cmp r1, r0 + bne _080E8F78 + ldrh r5, [r3] + adds r5, 0x7 + ldrh r4, [r3, 0x2] + adds r4, 0x7 + lsls r5, 16 + asrs r0, r5, 16 + lsls r4, 16 + asrs r1, r4, 16 + bl cur_mapdata_get_blockid_at + movs r3, 0 + lsls r0, 16 + asrs r1, r0, 16 + ldr r6, _080E8F68 +_080E8F42: + lsls r0, r3, 2 + adds r2, r0, r6 + ldrh r0, [r2] + cmp r0, r1 + bne _080E8F6C + ldrh r0, [r2, 0x2] + movs r1, 0xC0 + lsls r1, 4 + adds r2, r1, 0 + orrs r2, r0 + asrs r0, r5, 16 + asrs r1, r4, 16 + bl setmaptile_0 + b _080E8F82 + .align 2, 0 +_080E8F60: .4byte 0x03005d8c +_080E8F64: .4byte 0x00001a9c +_080E8F68: .4byte 0x0858cfcc +_080E8F6C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x6 + bls _080E8F42 + b _080E8F82 +_080E8F78: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080E8F0A +_080E8F82: + mov r1, r9 + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r0, r8 +_080E8F8A: + ldrb r0, [r0, 0x3] + cmp r5, r0 + bcc _080E8EEE + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8EE0 + + thumb_func_start sub_80E8F9C +sub_80E8F9C: @ 80E8F9C + push {lr} + ldr r0, _080E8FC8 + ldrb r0, [r0] + movs r1, 0xA + bl __udivsi3 + ldr r2, _080E8FCC + lsls r0, 26 + asrs r0, 24 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + adds r0, 0x1 + adds r0, r2 + movs r2, 0 + ldrsb r2, [r0, r2] + movs r0, 0x19 + bl warp1_set_2 + pop {r0} + bx r0 + .align 2, 0 +_080E8FC8: .4byte 0x0203a01c +_080E8FCC: .4byte 0x0858cfe8 + thumb_func_end sub_80E8F9C + + thumb_func_start sub_80E8FD0 +sub_80E8FD0: @ 80E8FD0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080E8FF0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _080E8FF4 + cmp r0, 0x1 + beq _080E900C + b _080E904A + .align 2, 0 +_080E8FF0: .4byte 0x03005e00 +_080E8FF4: + ldr r0, _080E9008 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E904A + movs r0, 0x1 + strh r0, [r2, 0x8] + b _080E904A + .align 2, 0 +_080E9008: .4byte 0x02037fd4 +_080E900C: + ldr r0, _080E9050 + bl var_get + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080E9054 + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r0, _080E9058 + adds r2, r0 + ldrb r0, [r2] + cmp r0, 0xFE + bhi _080E9030 + adds r0, 0x1 + strb r0, [r2] +_080E9030: + bl sub_80E8F9C + bl warp_in + ldr r0, _080E905C + ldr r1, _080E9060 + str r1, [r0] + ldr r0, _080E9064 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_080E904A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E9050: .4byte 0x00004054 +_080E9054: .4byte 0x03005d8c +_080E9058: .4byte 0x00001aac +_080E905C: .4byte 0x03005dac +_080E9060: .4byte sub_80AF168 + 1 +_080E9064: .4byte c2_load_new_map + 1 + thumb_func_end sub_80E8FD0 + + thumb_func_start sub_80E9068 +sub_80E9068: @ 80E9068 + push {lr} + ldr r0, _080E9094 + movs r1, 0 + bl AddTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _080E9098 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .align 2, 0 +_080E9094: .4byte sub_80E8FD0 + 1 +_080E9098: .4byte 0x03005d8c + thumb_func_end sub_80E9068 + + thumb_func_start sub_80E909C +sub_80E909C: @ 80E909C + push {lr} + ldr r0, _080E90B8 + ldrb r0, [r0, 0x17] + cmp r0, 0x9 + bne _080E90C0 + ldr r0, _080E90BC + bl var_get + lsls r0, 16 + cmp r0, 0 + bne _080E90C0 + movs r0, 0 + b _080E90C2 + .align 2, 0 +_080E90B8: .4byte 0x02037318 +_080E90BC: .4byte 0x00004097 +_080E90C0: + movs r0, 0x1 +_080E90C2: + pop {r1} + bx r1 + thumb_func_end sub_80E909C + + thumb_func_start sub_80E90C8 +sub_80E90C8: @ 80E90C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080E9100 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080E9104 + adds r0, r1 + movs r1, 0x2 + bl npc_turn + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E90F8 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_080E90F8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E9100: .4byte 0x02037590 +_080E9104: .4byte 0x02037350 + thumb_func_end sub_80E90C8 + + thumb_func_start sub_80E9108 +sub_80E9108: @ 80E9108 + push {r4,lr} + sub sp, 0x4 + bl script_env_2_enable + bl call_203AE8C + mov r4, sp + adds r4, 0x2 + movs r2, 0x88 + lsls r2, 2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E8CB0 + mov r1, sp + mov r0, sp + ldrh r0, [r0] + adds r0, 0x7 + strh r0, [r1] + ldrh r0, [r4] + adds r0, 0x7 + strh r0, [r4] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r2, 0xE2 + lsls r2, 4 + bl setmaptile_0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + bl pal_fill_black + ldr r0, _080E9168 + movs r1, 0 + bl AddTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E9168: .4byte sub_80E90C8 + 1 + thumb_func_end sub_80E9108 + + thumb_func_start sub_80E916C +sub_80E916C: @ 80E916C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080E91DC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E91D4 + ldr r0, _080E91E0 + ldrb r0, [r0] + movs r1, 0xA + bl __udivsi3 + ldr r1, _080E91E4 + ldr r1, [r1] + movs r5, 0x4 + ldrsb r5, [r1, r5] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + ldr r4, _080E91E8 + lsls r0, 26 + asrs r0, 24 + adds r3, r0, 0x2 + adds r3, r4 + ldrb r3, [r3] + lsls r3, 24 + asrs r3, 24 + adds r0, 0x3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + adds r0, r5, 0 + bl warp1_set + bl warp_in + ldr r1, _080E91EC + ldr r0, _080E91F0 + str r0, [r1] + ldr r0, _080E91F4 + bl set_callback2 + adds r0, r6, 0 + bl remove_task +_080E91D4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E91DC: .4byte 0x02037fd4 +_080E91E0: .4byte 0x0203a01c +_080E91E4: .4byte 0x03005d8c +_080E91E8: .4byte 0x0858cfe8 +_080E91EC: .4byte 0x03005dac +_080E91F0: .4byte sub_80E9108 + 1 +_080E91F4: .4byte c2_load_new_map + 1 + thumb_func_end sub_80E916C + + thumb_func_start sub_80E91F8 +sub_80E91F8: @ 80E91F8 + push {lr} + ldr r0, _080E9210 + movs r1, 0 + bl AddTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .align 2, 0 +_080E9210: .4byte sub_80E916C + 1 + thumb_func_end sub_80E91F8 + + thumb_func_start sub_80E9214 +sub_80E9214: @ 80E9214 + push {lr} + ldr r0, _080E922C + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x19 + bne _080E9230 + ldrb r0, [r1, 0x5] + cmp r0, 0x17 + bhi _080E9230 + movs r0, 0x1 + b _080E9232 + .align 2, 0 +_080E922C: .4byte 0x03005d8c +_080E9230: + movs r0, 0 +_080E9232: + pop {r1} + bx r1 + thumb_func_end sub_80E9214 + + thumb_func_start sub_80E9238 +sub_80E9238: @ 80E9238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_80E9214 + lsls r0, 24 + cmp r0, 0 + beq _080E9328 + ldr r0, _080E92E0 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _080E92E4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + ldr r2, _080E92E8 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r7, r1, 0 + adds r7, 0x12 + adds r6, r1, 0 + adds r6, 0x22 + movs r1, 0 + mov r0, sp + strh r1, [r0] + mov r4, sp +_080E927A: + ldrh r2, [r4] + adds r1, r7, r2 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + bhi _080E92AC + ldr r0, _080E92EC + ldrb r3, [r1] + lsls r1, r3, 5 + adds r1, r0 + ldrb r0, [r1, 0x11] + cmp r0, 0x4 + beq _080E92AC + adds r0, r6, r2 + ldrb r2, [r0] + lsrs r0, r2, 4 + adds r0, 0x7 + movs r1, 0xF + ands r1, r2 + adds r1, 0x7 + adds r2, r3, 0 + bl sub_8127D38 +_080E92AC: + ldrh r0, [r4] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r4] + cmp r0, 0xF + bls _080E927A + cmp r5, 0 + beq _080E92F4 + mov r4, sp + adds r4, 0x2 + movs r2, 0x88 + lsls r2, 2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E8CB0 + mov r0, sp + ldrh r0, [r0] + adds r0, 0x7 + ldrh r1, [r4] + adds r1, 0x7 + ldr r2, _080E92F0 + bl setmaptile_0 + b _080E9328 + .align 2, 0 +_080E92E0: .4byte 0x00004054 +_080E92E4: .4byte 0x03005d8c +_080E92E8: .4byte 0x00001a9c +_080E92EC: .4byte 0x085a5c08 +_080E92F0: .4byte 0x00000e21 +_080E92F4: + mov r0, r8 + cmp r0, 0x1 + bne _080E9328 + ldr r0, _080E9334 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080E9328 + mov r4, sp + adds r4, 0x2 + movs r2, 0x88 + lsls r2, 2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E8CB0 + mov r0, sp + ldrh r0, [r0] + adds r0, 0x7 + ldrh r1, [r4] + adds r1, 0x7 + ldr r2, _080E9338 + bl setmaptile_0 +_080E9328: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E9334: .4byte 0x00004089 +_080E9338: .4byte 0x00000e0a + thumb_func_end sub_80E9238 + + thumb_func_start sub_80E933C +sub_80E933C: @ 80E933C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + bl sub_80E9214 + lsls r0, 24 + cmp r0, 0 + bne _080E9374 + ldr r0, _080E9368 + ldr r0, [r0] + ldr r1, _080E936C + adds r1, r0, r1 + str r1, [sp, 0x4] + ldr r2, _080E9370 + adds r2, r0, r2 + str r2, [sp, 0x8] + movs r3, 0xC + str r3, [sp, 0x10] + b _080E939C + .align 2, 0 +_080E9368: .4byte 0x03005d8c +_080E936C: .4byte 0x0000271c +_080E9370: .4byte 0x00002728 +_080E9374: + ldr r0, _080E93A0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + ldr r2, _080E93A4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + ldr r4, _080E93A8 + adds r1, r4 + ldr r0, [r2] + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x12 + str r1, [sp, 0x4] + adds r0, 0x22 + str r0, [sp, 0x8] + movs r2, 0x10 + str r2, [sp, 0x10] +_080E939C: + movs r6, 0 + b _080E955A + .align 2, 0 +_080E93A0: .4byte 0x00004054 +_080E93A4: .4byte 0x03005d8c +_080E93A8: .4byte 0x00001a9c +_080E93AC: + ldr r4, [sp, 0x4] + adds r0, r4, r6 + ldrb r1, [r0] + mov r10, r0 + adds r0, r6, 0x1 + str r0, [sp, 0x14] + cmp r1, 0 + bne _080E93BE + b _080E9554 +_080E93BE: + mov r1, r10 + ldrb r0, [r1] + lsls r0, 5 + ldr r2, _080E9510 + adds r0, r2 + ldrb r1, [r0, 0x11] + ldrb r0, [r0, 0x13] + str r0, [sp, 0xC] + cmp r1, 0x4 + beq _080E93D4 + b _080E9554 +_080E93D4: + movs r5, 0 + ldr r0, _080E9514 + ldr r3, [r0, 0x4] + ldrb r4, [r3] + mov r9, r0 + cmp r5, r4 + bcs _080E9412 + ldr r0, [r3, 0x4] + ldrh r2, [r0, 0x14] + ldr r1, _080E9518 + ldrh r0, [r1] + adds r0, 0xAE + adds r7, r1, 0 + cmp r2, r0 + beq _080E9412 + adds r2, r4, 0 +_080E93F4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r2 + bcs _080E9412 + ldr r1, [r3, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x14] + ldrh r0, [r7] + adds r0, 0xAE + cmp r1, r0 + bne _080E93F4 +_080E9412: + mov r3, r9 + ldr r0, [r3, 0x4] + ldrb r0, [r0] + cmp r5, r0 + bne _080E941E + b _080E9554 +_080E941E: + ldr r4, _080E951C + mov r8, r4 + ldr r0, [sp, 0x8] + adds r1, r0, r6 + ldrb r0, [r1] + lsrs r0, 4 + strh r0, [r4] + ldr r7, _080E9520 + ldrb r1, [r1] + movs r0, 0xF + ands r0, r1 + strh r0, [r7] + ldrh r0, [r4] + adds r0, 0x7 + ldrh r1, [r7] + adds r1, 0x7 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089350 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E9462 + adds r0, r4, 0 + bl sub_8089364 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E9554 +_080E9462: + ldr r6, _080E9524 + mov r1, r9 + ldr r0, [r1, 0x4] + ldr r1, [r0, 0x4] + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 3 + adds r1, r4, r1 + ldr r2, _080E9528 + adds r0, r2, 0 + ldrb r1, [r1, 0x1] + adds r0, r1 + strh r0, [r6] + ldrh r0, [r6] + mov r3, r10 + ldrb r1, [r3] + lsls r1, 5 + ldr r2, _080E952C + adds r1, r2 + ldr r1, [r1] + ldrh r1, [r1] + bl var_set + mov r3, r9 + ldr r0, [r3, 0x4] + ldr r0, [r0, 0x4] + adds r4, r0 + ldrb r0, [r4] + strh r0, [r6] + ldr r0, _080E9518 + ldrh r0, [r0] + adds r0, 0xAE + lsls r0, 16 + lsrs r0, 16 + bl flag_clear + ldrb r0, [r6] + ldr r5, _080E9530 + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r4, r8 + movs r3, 0 + ldrsh r4, [r4, r3] + mov r8, r4 + movs r4, 0 + ldrsh r7, [r7, r4] + str r7, [sp] + mov r3, r8 + bl sub_808EBA8 + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + bl sub_80E9214 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E954C + ldr r0, _080E9534 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080E954C + ldr r0, [sp, 0xC] + cmp r0, 0x6 + bne _080E9538 + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r3, 0x6 + bl sub_808F28C + b _080E954C + .align 2, 0 +_080E9510: .4byte 0x085a5c08 +_080E9514: .4byte 0x02037318 +_080E9518: .4byte 0x020375e0 +_080E951C: .4byte 0x020375e4 +_080E9520: .4byte 0x020375e6 +_080E9524: .4byte 0x020375f0 +_080E9528: .4byte 0x00003f20 +_080E952C: .4byte 0x085a5c24 +_080E9530: .4byte 0x03005d8c +_080E9534: .4byte 0x00004054 +_080E9538: + ldr r1, [sp, 0xC] + cmp r1, 0x7 + bne _080E954C + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r3, 0x7 + bl sub_808F28C +_080E954C: + ldr r1, _080E9574 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080E9554: + ldr r2, [sp, 0x14] + lsls r0, r2, 24 + lsrs r6, r0, 24 +_080E955A: + ldr r3, [sp, 0x10] + cmp r6, r3 + bcs _080E9562 + b _080E93AC +_080E9562: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E9574: .4byte 0x020375e0 + thumb_func_end sub_80E933C + + thumb_func_start sub_80E9578 +sub_80E9578: @ 80E9578 + push {r4-r6,lr} + movs r5, 0 + ldr r1, _080E95CC + ldr r0, [r1, 0x4] + ldrb r0, [r0] + cmp r5, r0 + bcs _080E95C4 + adds r6, r1, 0 +_080E9588: + ldr r0, [r6, 0x4] + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r4, [r1, 0x14] + adds r0, r4, 0 + subs r0, 0xAE + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xD + bhi _080E95B6 + ldrb r0, [r1] + ldr r1, _080E95D0 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl npc_hide_by_local_id_and_map + adds r0, r4, 0 + bl flag_set +_080E95B6: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r6, 0x4] + ldrb r0, [r0] + cmp r5, r0 + bcc _080E9588 +_080E95C4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E95CC: .4byte 0x02037318 +_080E95D0: .4byte 0x03005d8c + thumb_func_end sub_80E9578 + + thumb_func_start sub_80E95D4 +sub_80E95D4: @ 80E95D4 + push {r4,r5,lr} + ldr r5, _080E95FC + ldr r4, _080E9600 + ldr r0, _080E9604 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sub_80EA20C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl var_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E95FC: .4byte 0x0000401f +_080E9600: .4byte 0x0858d060 +_080E9604: .4byte 0x00004054 + thumb_func_end sub_80E95D4 + + thumb_func_start sub_80E9608 +sub_80E9608: @ 80E9608 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r3, 0 + ldrb r0, [r4, 0x3] + cmp r3, r0 + bge _080E9660 + ldr r6, _080E964C +_080E9618: + lsls r3, 16 + asrs r1, r3, 16 + ldr r2, [r4, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x5] + cmp r0, 0x8 + bne _080E9650 + movs r0, 0 + ldrsh r1, [r5, r0] + ldrh r0, [r2] + adds r0, 0x7 + cmp r1, r0 + bne _080E9650 + movs r0, 0x2 + ldrsh r1, [r5, r0] + ldrh r0, [r2, 0x2] + adds r0, 0x7 + cmp r1, r0 + bne _080E9650 + ldr r0, [r2, 0x8] + strb r0, [r6] + b _080E9660 + .align 2, 0 +_080E964C: .4byte 0x0203a01c +_080E9650: + movs r1, 0x80 + lsls r1, 9 + adds r0, r3, r1 + lsrs r3, r0, 16 + asrs r0, 16 + ldrb r1, [r4, 0x3] + cmp r0, r1 + blt _080E9618 +_080E9660: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E9608 + + thumb_func_start sub_80E9668 +sub_80E9668: @ 80E9668 + push {lr} + bl sub_80E9608 + bl sub_80E8B6C + ldr r0, _080E967C + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080E967C: .4byte 0x08275bb7 + thumb_func_end sub_80E9668 + + thumb_func_start sub_80E9680 +sub_80E9680: @ 80E9680 + push {lr} + bl sub_80E8B58 + bl sub_80E8B6C + ldr r0, _080E9698 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080E969C + movs r0, 0x1 + b _080E969E + .align 2, 0 +_080E9698: .4byte 0x020375f0 +_080E969C: + movs r0, 0 +_080E969E: + pop {r1} + bx r1 + thumb_func_end sub_80E9680 + + thumb_func_start sub_80E96A4 +sub_80E96A4: @ 80E96A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080E96C8 + 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 _080E96DC + cmp r0, 0x1 + bgt _080E96CC + cmp r0, 0 + beq _080E96D2 + b _080E9714 + .align 2, 0 +_080E96C8: .4byte 0x03005e00 +_080E96CC: + cmp r0, 0x2 + beq _080E96F4 + b _080E9714 +_080E96D2: + bl script_env_2_enable + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080E9714 +_080E96DC: + ldr r0, _080E96F0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E9714 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080E9714 + .align 2, 0 +_080E96F0: .4byte 0x02037fd4 +_080E96F4: + movs r0, 0x7E + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + bl warp_in + ldr r0, _080E971C + ldr r1, _080E9720 + str r1, [r0] + ldr r0, _080E9724 + bl set_callback2 + bl script_env_2_disable + adds r0, r5, 0 + bl remove_task +_080E9714: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E971C: .4byte 0x03005dac +_080E9720: .4byte mapldr_default + 1 +_080E9724: .4byte c2_load_new_map + 1 + thumb_func_end sub_80E96A4 + + thumb_func_start sub_80E9728 +sub_80E9728: @ 80E9728 + push {lr} + ldr r0, _080E9740 + movs r1, 0 + bl AddTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .align 2, 0 +_080E9740: .4byte sub_80E96A4 + 1 + thumb_func_end sub_80E9728 + + thumb_func_start sub_80E9744 +sub_80E9744: @ 80E9744 + push {lr} + ldr r0, _080E9760 + ldr r0, [r0] + ldr r1, _080E9764 + adds r0, r1 + ldr r1, _080E9768 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080E9770 + ldr r1, _080E976C + movs r0, 0x1 + b _080E9774 + .align 2, 0 +_080E9760: .4byte 0x03005d8c +_080E9764: .4byte 0x00001a9c +_080E9768: .4byte 0x0203a01c +_080E976C: .4byte 0x020375f0 +_080E9770: + ldr r1, _080E977C + movs r0, 0 +_080E9774: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080E977C: .4byte 0x020375f0 + thumb_func_end sub_80E9744 + + thumb_func_start sub_80E9780 +sub_80E9780: @ 80E9780 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _080E97DC + mov r8, r0 + lsls r5, r1, 2 + adds r5, r1 + lsls r5, 5 + ldr r4, [r0] + adds r4, r5, r4 + ldr r1, _080E97E0 + adds r4, r1 + adds r0, r4, 0 + bl sub_80E8DF4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl gf_strncpy + movs r1, 0xFF + strb r1, [r0] + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldr r1, _080E97E4 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8009308 + ldr r1, _080E97E8 + adds r0, r6, 0 + bl gf_strcat + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080E97DC: .4byte 0x03005d8c +_080E97E0: .4byte 0x00001a9e +_080E97E4: .4byte 0x00001aa9 +_080E97E8: .4byte 0x085ea72f + thumb_func_end sub_80E9780 + + thumb_func_start sub_80E97EC +sub_80E97EC: @ 80E97EC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080E9808 + bl var_get + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80E9780 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080E9808: .4byte 0x00004054 + thumb_func_end sub_80E97EC + + thumb_func_start sub_80E980C +sub_80E980C: @ 80E980C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _080E9864 + bl var_get + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E9868 + mov r8, r1 + lsls r5, r0, 2 + adds r5, r0 + lsls r5, 5 + ldr r4, [r1] + adds r4, r5, r4 + ldr r0, _080E986C + adds r4, r0 + ldr r6, _080E9870 + adds r0, r4, 0 + bl sub_80E8DF4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl gf_strncpy + movs r1, 0xFF + strb r1, [r0] + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldr r1, _080E9874 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8009308 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E9864: .4byte 0x00004054 +_080E9868: .4byte 0x03005d8c +_080E986C: .4byte 0x00001a9e +_080E9870: .4byte 0x02021cc4 +_080E9874: .4byte 0x00001aa9 + thumb_func_end sub_80E980C + + thumb_func_start sub_80E9878 +sub_80E9878: @ 80E9878 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080E989C + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r0, _080E98A0 + adds r2, r0 + ldrb r0, [r2] + lsrs r0, 6 + cmp r0, 0 + bne _080E98A4 + movs r0, 0 + b _080E98A6 + .align 2, 0 +_080E989C: .4byte 0x03005d8c +_080E98A0: .4byte 0x00001a9d +_080E98A4: + movs r0, 0x1 +_080E98A6: + pop {r1} + bx r1 + thumb_func_end sub_80E9878 + + thumb_func_start sub_80E98AC +sub_80E98AC: @ 80E98AC + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x1A + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1B + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1C + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1D + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1E + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1F + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E98AC + + thumb_func_start sub_80E9914 +sub_80E9914: @ 80E9914 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r0, 0 + mov r10, r0 + ldr r0, _080E9A70 + ldr r1, [r0] + ldr r2, _080E9A74 + adds r2, r1, r2 + str r2, [sp] + ldr r3, _080E9A78 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080E993A + b _080E9A60 +_080E993A: + movs r6, 0 + ldr r7, _080E9A7C + adds r7, r1, r7 + str r7, [sp, 0x14] + ldr r0, _080E9A80 + adds r0, r1, r0 + str r0, [sp, 0xC] + ldr r2, _080E9A84 + adds r2, r1, r2 + str r2, [sp, 0x10] + adds r3, 0x94 + adds r3, r1, r3 + str r3, [sp, 0x18] + ldr r7, _080E9A88 + adds r7, r1, r7 + str r7, [sp, 0x1C] + mov r9, r6 +_080E995C: + movs r4, 0 + lsls r5, r6, 2 + lsls r3, r6, 1 + ldr r0, _080E9A8C + mov r8, r0 + adds r1, r6, 0x1 + str r1, [sp, 0x4] + adds r2, r5, 0 + ldr r1, [sp, 0x14] +_080E996E: + adds r0, r2, r4 + lsls r0, 1 + adds r0, r1, r0 + mov r7, r9 + strh r7, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080E996E + ldr r1, [sp, 0xC] + adds r0, r1, r3 + mov r2, r9 + strh r2, [r0] + ldr r7, [sp, 0x10] + adds r0, r7, r3 + strh r2, [r0] + ldr r1, [sp, 0x18] + adds r0, r1, r6 + mov r2, r9 + strb r2, [r0] + ldr r3, [sp] + adds r0, r3, r5 + mov r7, r9 + str r7, [r0] + ldr r1, [sp, 0x1C] + adds r0, r1, r6 + strb r7, [r0] + movs r2, 0x64 + adds r5, r6, 0 + muls r5, r2 + mov r3, r8 + adds r4, r5, r3 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080E9A54 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080E9A54 + movs r4, 0 + mov r7, r10 + lsls r7, 2 + mov r8, r7 + mov r0, r10 + lsls r7, r0, 1 + adds r0, 0x1 + str r0, [sp, 0x8] + ldr r2, _080E9A8C +_080E99DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r2 + str r2, [sp, 0x20] + bl pokemon_getattr + mov r3, r8 + adds r1, r3, r4 + lsls r1, 1 + ldr r3, [sp, 0x14] + adds r1, r3, r1 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r2, [sp, 0x20] + cmp r4, 0x3 + bls _080E99DA + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _080E9A8C + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldr r2, [sp, 0xC] + adds r1, r2, r7 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + ldr r3, [sp, 0x10] + adds r1, r3, r7 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x18] + add r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, [sp] + add r1, r8 + str r0, [r1] + adds r0, r4, 0 + bl sub_80E98AC + ldr r1, [sp, 0x1C] + add r1, r10 + strb r0, [r1] + ldr r7, [sp, 0x8] + lsls r0, r7, 16 + lsrs r0, 16 + mov r10, r0 +_080E9A54: + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bhi _080E9A60 + b _080E995C +_080E9A60: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E9A70: .4byte 0x03005d8c +_080E9A74: .4byte 0x00001ad0 +_080E9A78: .4byte 0x00001a9c +_080E9A7C: .4byte 0x00001ae8 +_080E9A80: .4byte 0x00001b18 +_080E9A84: .4byte 0x00001b24 +_080E9A88: .4byte 0x00001b36 +_080E9A8C: .4byte 0x020244ec + thumb_func_end sub_80E9914 + + thumb_func_start sub_80E9A90 +sub_80E9A90: @ 80E9A90 + push {r4-r6,lr} + ldr r5, _080E9AB4 + ldr r0, [r5] + ldr r4, _080E9AB8 + adds r1, r0, r4 + ldrh r6, [r1] + ldr r1, _080E9ABC + adds r0, r1 + bl sub_80E8AF0 + ldr r0, [r5] + adds r0, r4 + strh r6, [r0] + bl sub_80E9728 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E9AB4: .4byte 0x03005d8c +_080E9AB8: .4byte 0x00001aaa +_080E9ABC: .4byte 0x00001a9c + thumb_func_end sub_80E9A90 + + thumb_func_start sub_80E9AC0 +sub_80E9AC0: @ 80E9AC0 + push {lr} + movs r0, 0x14 + bl sav12_xor_increment + bl sub_80E9A90 + pop {r0} + bx r0 + thumb_func_end sub_80E9AC0 + + thumb_func_start sub_80E9AD0 +sub_80E9AD0: @ 80E9AD0 + push {r4-r7,lr} + ldr r0, _080E9ADC + ldr r4, [r0, 0x4] + movs r6, 0 + b _080E9B62 + .align 2, 0 +_080E9ADC: .4byte 0x02037318 +_080E9AE0: + ldr r2, [r4, 0x10] + lsls r1, r6, 1 + adds r0, r1, r6 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x5] + adds r7, r1, 0 + cmp r0, 0x8 + bne _080E9B5C + ldr r0, _080E9B30 + ldr r0, [r0] + ldr r1, _080E9B34 + adds r0, r1 + ldrb r1, [r0] + ldr r0, [r2, 0x8] + cmp r1, r0 + bne _080E9B5C + ldrh r0, [r2] + adds r0, 0x7 + ldrh r1, [r2, 0x2] + adds r1, 0x7 + bl cur_mapdata_get_blockid_at + movs r1, 0 + ldr r5, _080E9B38 + lsls r0, 16 + asrs r2, r0, 16 +_080E9B16: + lsls r0, r1, 2 + adds r3, r0, r5 + ldrh r0, [r3, 0x2] + cmp r0, r2 + beq _080E9B3C + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x6 + bls _080E9B16 +_080E9B2A: + bl cur_mapdata_full_redraw + b _080E9B68 + .align 2, 0 +_080E9B30: .4byte 0x03005d8c +_080E9B34: .4byte 0x00001a9c +_080E9B38: .4byte 0x0858cfcc +_080E9B3C: + ldr r0, [r4, 0x10] + adds r1, r7, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x7 + ldrh r1, [r1, 0x2] + adds r1, 0x7 + ldrh r3, [r3] + movs r4, 0xC0 + lsls r4, 4 + adds r2, r4, 0 + orrs r2, r3 + bl setmaptile_0 + b _080E9B2A +_080E9B5C: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080E9B62: + ldrb r0, [r4, 0x3] + cmp r6, r0 + bcc _080E9AE0 +_080E9B68: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E9AD0 + + thumb_func_start sub_80E9B70 +sub_80E9B70: @ 80E9B70 + push {r4-r6,lr} + bl sub_80E9AD0 + movs r0, 0x14 + bl sav12_xor_increment + ldr r5, _080E9B9C + ldr r0, [r5] + ldr r4, _080E9BA0 + adds r1, r0, r4 + ldrh r6, [r1] + ldr r1, _080E9BA4 + adds r0, r1 + bl sub_80E8AF0 + ldr r0, [r5] + adds r0, r4 + strh r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E9B9C: .4byte 0x03005d8c +_080E9BA0: .4byte 0x00001aaa +_080E9BA4: .4byte 0x00001a9c + thumb_func_end sub_80E9B70 + + thumb_func_start sub_80E9BA8 +sub_80E9BA8: @ 80E9BA8 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0x1 +_080E9BAE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80E9878 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E9BC4 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E9BC4: + lsls r0, r4, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080E9BAE + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E9BA8 + + thumb_func_start sub_80E9BDC +sub_80E9BDC: @ 80E9BDC + push {lr} + ldr r0, _080E9BFC + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sub_80E9878 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080E9C04 + ldr r0, _080E9C00 + strh r1, [r0] + b _080E9C22 + .align 2, 0 +_080E9BFC: .4byte 0x00004054 +_080E9C00: .4byte 0x020375f0 +_080E9C04: + bl sub_80E9BA8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bls _080E9C1C + ldr r1, _080E9C18 + movs r0, 0x2 + b _080E9C20 + .align 2, 0 +_080E9C18: .4byte 0x020375f0 +_080E9C1C: + ldr r1, _080E9C28 + movs r0, 0 +_080E9C20: + strh r0, [r1] +_080E9C22: + pop {r0} + bx r0 + .align 2, 0 +_080E9C28: .4byte 0x020375f0 + thumb_func_end sub_80E9BDC + + thumb_func_start sub_80E9C2C +sub_80E9C2C: @ 80E9C2C + push {lr} + ldr r0, _080E9C68 + bl var_get + ldr r1, _080E9C6C + ldr r2, [r1] + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r0, _080E9C70 + adds r2, r0 + ldrb r3, [r2] + lsrs r1, r3, 6 + movs r0, 0x1 + eors r1, r0 + lsls r1, 6 + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x86 + lsls r0, 1 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_080E9C68: .4byte 0x00004054 +_080E9C6C: .4byte 0x03005d8c +_080E9C70: .4byte 0x00001a9d + thumb_func_end sub_80E9C2C + + thumb_func_start sub_80E9C74 +sub_80E9C74: @ 80E9C74 + push {lr} + ldr r0, _080E9C84 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080E9C84: .4byte sub_8126AD8 + 1 + thumb_func_end sub_80E9C74 + + thumb_func_start sub_80E9C88 +sub_80E9C88: @ 80E9C88 + push {lr} + ldr r0, _080E9C98 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080E9C98: .4byte sub_80E9C9C + 1 + thumb_func_end sub_80E9C88 + + thumb_func_start sub_80E9C9C +sub_80E9C9C: @ 80E9C9C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, _080E9D00 + mov r8, r0 + adds r5, r7, r0 + bl script_env_2_enable + bl sub_80E9BA8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + cmp r0, 0 + beq _080E9D10 + movs r0, 0 + strh r0, [r5, 0x2] + strh r0, [r5, 0x4] + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldr r4, _080E9D04 + movs r0, 0xDC + lsls r0, 1 + bl malloc_and_clear + str r0, [r4] + ldr r0, _080E9D08 + bl Window_AddFromTemplate + strh r0, [r5, 0xC] + adds r0, r6, 0 + bl game_continue + adds r0, r6, 0 + bl sub_80E9E00 + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _080E9D0C + str r1, [r0] + b _080E9D1A + .align 2, 0 +_080E9D00: .4byte 0x03005e08 +_080E9D04: .4byte 0x0203a020 +_080E9D08: .4byte 0x0858d06c +_080E9D0C: .4byte sub_80E9E90 + 1 +_080E9D10: + ldr r1, _080E9D24 + ldr r2, _080E9D28 + adds r0, r6, 0 + bl sub_81978EC +_080E9D1A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E9D24: .4byte 0x085ea785 +_080E9D28: .4byte task_pc_turn_off + 1 + thumb_func_end sub_80E9C9C + + thumb_func_start game_continue +game_continue: @ 80E9D2C + 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, _080E9DAC + adds r7, r1, r0 + movs r6, 0 + movs r5, 0x1 + ldr r0, _080E9DB0 + mov r8, r0 +_080E9D48: + adds r0, r5, 0 + bl sub_80E9878 + lsls r0, 24 + cmp r0, 0 + beq _080E9D7C + lsls r4, r6, 5 + adds r4, 0x58 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + adds r1, r5, 0 + bl sub_80E9780 + mov r3, r8 + ldr r0, [r3] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + str r5, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080E9D7C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080E9D48 + ldr r4, _080E9DB0 + ldr r1, [r4] + lsls r3, r6, 3 + adds r2, r1, r3 + ldr r0, _080E9DB4 + str r0, [r2] + adds r1, 0x4 + adds r1, r3 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + adds r2, r6, 0x1 + strh r2, [r7] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080E9DB8 + strh r2, [r7, 0x6] + b _080E9DBC + .align 2, 0 +_080E9DAC: .4byte 0x03005e08 +_080E9DB0: .4byte 0x0203a020 +_080E9DB4: .4byte 0x085e8cf0 +_080E9DB8: + movs r0, 0x8 + strh r0, [r7, 0x6] +_080E9DBC: + ldr r2, _080E9DE4 + adds r1, r2, 0 + ldr r0, _080E9DE8 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldrh r0, [r7, 0xC] + strb r0, [r2, 0x10] + ldrh r0, [r7] + strh r0, [r2, 0xC] + ldr r0, [r4] + str r0, [r2] + ldrh r0, [r7, 0x6] + strh r0, [r2, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080E9DE4: .4byte 0x03006310 +_080E9DE8: .4byte 0x0858d07c + thumb_func_end game_continue + + thumb_func_start sub_80E9DEC +sub_80E9DEC: @ 80E9DEC + push {lr} + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _080E9DFC + movs r0, 0x5 + bl audio_play +_080E9DFC: + pop {r0} + bx r0 + thumb_func_end sub_80E9DEC + + thumb_func_start sub_80E9E00 +sub_80E9E00: @ 80E9E00 + 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, _080E9E3C + adds r4, r0 + ldrb r0, [r4, 0xC] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r0, _080E9E40 + ldrh r1, [r4, 0x4] + ldrh r2, [r4, 0x2] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + adds r0, r5, 0 + bl sub_80E9E44 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080E9E3C: .4byte 0x03005e08 +_080E9E40: .4byte 0x03006310 + thumb_func_end sub_80E9E00 + + thumb_func_start sub_80E9E44 +sub_80E9E44: @ 80E9E44 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _080E9E88 + adds r4, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r0, r1 + str r0, [sp] + ldr r0, _080E9E8C + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0x4 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xBC + movs r2, 0xC + movs r3, 0x94 + bl sub_81AF4A0 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x10] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080E9E88: .4byte 0x03005e08 +_080E9E8C: .4byte 0x000013f8 + thumb_func_end sub_80E9E44 + + thumb_func_start sub_80E9E90 +sub_80E9E90: @ 80E9E90 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _080E9EC4 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + bl sub_81AE604 + adds r5, r0, 0 + ldrb r0, [r4, 0xA] + adds r1, r4, 0x4 + adds r2, r4, 0x2 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _080E9EC8 + adds r0, 0x1 + cmp r5, r0 + bne _080E9F0C + b _080E9F1A + .align 2, 0 +_080E9EC4: .4byte 0x03005e08 +_080E9EC8: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x10] + bl sub_81AF620 + ldrb r0, [r4, 0xC] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0xC] + bl Window_FillTileMap + ldrb r0, [r4, 0xC] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _080E9F08 + ldr r0, [r0] + bl free + adds r0, r6, 0 + bl task_pc_turn_off + b _080E9F1A + .align 2, 0 +_080E9F08: .4byte 0x0203a020 +_080E9F0C: + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0x8] + adds r0, r6, 0 + bl sub_80E9F20 +_080E9F1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E9E90 + + thumb_func_start sub_80E9F20 +sub_80E9F20: @ 80E9F20 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, _080E9F9C + adds r5, r4, r6 + ldrb r0, [r5, 0x10] + bl sub_81AF620 + ldr r0, _080E9FA0 + ldr r1, [r0, 0xC] + ldr r0, [r0, 0x8] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, _080E9FA4 + mov r8, r0 + movs r1, 0x2 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _080E9FA8 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl Window_AddFromTemplate + strh r0, [r5, 0xE] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r5, 0xE] + movs r1, 0x2 + mov r2, r8 + bl PrintMenuTable + ldrb r0, [r5, 0xE] + movs r1, 0x2 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + subs r6, 0x8 + adds r4, r6 + ldr r0, _080E9FAC + str r0, [r4] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E9F9C: .4byte 0x03005e08 +_080E9FA0: .4byte 0x0858d06c +_080E9FA4: .4byte 0x0858d048 +_080E9FA8: .4byte 0x00ffffff +_080E9FAC: .4byte sub_80E9FB0 + 1 + thumb_func_end sub_80E9F20 + + thumb_func_start sub_80E9FB0 +sub_80E9FB0: @ 80E9FB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _080E9FF2 + adds r0, 0x1 + cmp r4, r0 + bne _080E9FDC + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_80EA18C + b _080E9FF2 +_080E9FDC: + movs r0, 0x5 + bl audio_play + ldr r0, _080E9FF8 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 +_080E9FF2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080E9FF8: .4byte 0x0858d048 + thumb_func_end sub_80E9FB0 + + thumb_func_start sub_80E9FFC +sub_80E9FFC: @ 80E9FFC + 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, _080EA058 + adds r4, r0 + ldrb r0, [r4, 0xC] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0xE] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0xC] + bl Window_FillTileMap + ldrb r0, [r4, 0xE] + bl Window_FillTileMap + ldrb r0, [r4, 0xE] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _080EA05C + ldrb r1, [r4, 0x8] + bl sub_80E9780 + ldr r4, _080EA060 + ldr r1, _080EA064 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _080EA068 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EA058: .4byte 0x03005e08 +_080EA05C: .4byte 0x02021cc4 +_080EA060: .4byte 0x02021fc4 +_080EA064: .4byte 0x085ea737 +_080EA068: .4byte sub_80EA06C + 1 + thumb_func_end sub_80E9FFC + + thumb_func_start sub_80EA06C +sub_80EA06C: @ 80EA06C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _080EA088 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EA088: .4byte 0x0858d058 + thumb_func_end sub_80EA06C + + thumb_func_start sub_80EA08C +sub_80EA08C: @ 80EA08C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + ldr r0, _080EA110 + mov r8, r0 + adds r6, r5, r0 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldrb r0, [r6, 0xA] + adds r1, r6, 0x4 + mov r9, r1 + adds r1, r6, 0x2 + mov r10, r1 + mov r1, r9 + mov r2, r10 + bl sub_81AE6C8 + ldr r0, _080EA114 + ldr r2, [r0] + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r2, r0 + ldr r1, _080EA118 + adds r2, r1 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + bl game_continue + ldrb r2, [r6, 0x6] + ldrb r3, [r6] + mov r0, r9 + mov r1, r10 + bl sub_812225C + adds r0, r4, 0 + bl sub_80E9E00 + movs r0, 0x8 + negs r0, r0 + add r8, r0 + add r5, r8 + ldr r0, _080EA11C + str r0, [r5] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EA110: .4byte 0x03005e08 +_080EA114: .4byte 0x03005d8c +_080EA118: .4byte 0x00001a9d +_080EA11C: .4byte sub_80E9E90 + 1 + thumb_func_end sub_80EA08C + + thumb_func_start sub_80EA120 +sub_80EA120: @ 80EA120 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080EA134 + ldr r2, _080EA138 + bl sub_81978EC + pop {r0} + bx r0 + .align 2, 0 +_080EA134: .4byte 0x085ea762 +_080EA138: .4byte sub_80EA08C + 1 + thumb_func_end sub_80EA120 + + thumb_func_start sub_80EA13C +sub_80EA13C: @ 80EA13C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _080EA184 + mov r8, r0 + adds r6, r4, r0 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldrb r0, [r6, 0xA] + adds r1, r6, 0x4 + adds r6, 0x2 + adds r2, r6, 0 + bl sub_81AE6C8 + adds r0, r5, 0 + bl sub_80E9E00 + movs r0, 0x8 + negs r0, r0 + add r8, r0 + add r4, r8 + ldr r0, _080EA188 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EA184: .4byte 0x03005e08 +_080EA188: .4byte sub_80E9E90 + 1 + thumb_func_end sub_80EA13C + + thumb_func_start sub_80EA18C +sub_80EA18C: @ 80EA18C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, _080EA1C8 + adds r5, r4, r6 + bl sub_80E9E44 + ldrb r0, [r5, 0xE] + movs r1, 0 + bl sub_819746C + ldrb r0, [r5, 0xE] + bl Window_FillTileMap + ldrb r0, [r5, 0xE] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + subs r6, 0x8 + adds r4, r6 + ldr r0, _080EA1CC + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EA1C8: .4byte 0x03005e08 +_080EA1CC: .4byte sub_80E9E90 + 1 + thumb_func_end sub_80EA18C + + thumb_func_start task_pc_turn_off +task_pc_turn_off: @ 80EA1D0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080EA1EC + bl var_get + lsls r0, 16 + cmp r0, 0 + bne _080EA1F4 + ldr r0, _080EA1F0 + bl script_env_1_execute_new_script + b _080EA1FA + .align 2, 0 +_080EA1EC: .4byte 0x00004054 +_080EA1F0: .4byte 0x0823b4e8 +_080EA1F4: + ldr r0, _080EA208 + bl script_env_1_execute_new_script +_080EA1FA: + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EA208: .4byte 0x0823b5e9 + thumb_func_end task_pc_turn_off + + thumb_func_start sub_80EA20C +sub_80EA20C: @ 80EA20C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080EA244 + ldr r4, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r4, r1 + ldr r1, _080EA248 + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x5 + bl __umodsi3 + ldr r1, _080EA24C + adds r4, r1 + ldrb r2, [r4] + lsls r2, 27 + lsrs r2, 31 + lsls r1, r2, 2 + adds r1, r2 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080EA244: .4byte 0x03005d8c +_080EA248: .4byte 0x00001aa5 +_080EA24C: .4byte 0x00001a9d + thumb_func_end sub_80EA20C + + thumb_func_start sub_80EA250 +sub_80EA250: @ 80EA250 + push {lr} + ldr r0, _080EA270 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sub_80EA20C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + bne _080EA278 + ldr r0, _080EA274 + b _080EA2DA + .align 2, 0 +_080EA270: .4byte 0x00004054 +_080EA274: .4byte 0x08274966 +_080EA278: + cmp r0, 0x1 + bne _080EA284 + ldr r0, _080EA280 + b _080EA2DA + .align 2, 0 +_080EA280: .4byte 0x08274d13 +_080EA284: + cmp r0, 0x2 + bne _080EA290 + ldr r0, _080EA28C + b _080EA2DA + .align 2, 0 +_080EA28C: .4byte 0x08274ffe +_080EA290: + cmp r0, 0x3 + bne _080EA29C + ldr r0, _080EA298 + b _080EA2DA + .align 2, 0 +_080EA298: .4byte 0x08275367 +_080EA29C: + cmp r0, 0x4 + bne _080EA2A8 + ldr r0, _080EA2A4 + b _080EA2DA + .align 2, 0 +_080EA2A4: .4byte 0x082756c7 +_080EA2A8: + cmp r0, 0x5 + bne _080EA2B4 + ldr r0, _080EA2B0 + b _080EA2DA + .align 2, 0 +_080EA2B0: .4byte 0x08274b24 +_080EA2B4: + cmp r0, 0x6 + bne _080EA2C0 + ldr r0, _080EA2BC + b _080EA2DA + .align 2, 0 +_080EA2BC: .4byte 0x08274e75 +_080EA2C0: + cmp r0, 0x7 + bne _080EA2CC + ldr r0, _080EA2C8 + b _080EA2DA + .align 2, 0 +_080EA2C8: .4byte 0x082751e1 +_080EA2CC: + cmp r1, 0x8 + beq _080EA2D8 + ldr r0, _080EA2D4 + b _080EA2DA + .align 2, 0 +_080EA2D4: .4byte 0x082758cc +_080EA2D8: + ldr r0, _080EA2E0 +_080EA2DA: + pop {r1} + bx r1 + .align 2, 0 +_080EA2E0: .4byte 0x082754f6 + thumb_func_end sub_80EA250 + + thumb_func_start sub_80EA2E4 +sub_80EA2E4: @ 80EA2E4 + push {lr} + movs r0, 0x1 + bl sub_813BADC + ldr r1, _080EA300 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _080EA304 + ldr r0, _080EA308 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080EA300: .4byte 0x02038bca +_080EA304: .4byte 0x02022fec +_080EA308: .4byte 0x08000008 + thumb_func_end sub_80EA2E4 + + thumb_func_start sub_80EA30C +sub_80EA30C: @ 80EA30C + push {lr} + ldr r0, _080EA344 + bl var_get + ldr r1, _080EA348 + ldr r3, [r1] + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r3, r1 + ldr r0, _080EA34C + ldrb r0, [r0] + ldr r1, _080EA350 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + pop {r0} + bx r0 + .align 2, 0 +_080EA344: .4byte 0x00004054 +_080EA348: .4byte 0x03005d8c +_080EA34C: .4byte 0x020375f0 +_080EA350: .4byte 0x00001a9d + thumb_func_end sub_80EA30C + + thumb_func_start sub_80EA354 +sub_80EA354: @ 80EA354 + push {r4-r7,lr} + ldr r0, _080EA3CC + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _080EA3D0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080EA39A + movs r3, 0 + ldr r7, _080EA3D4 + ldr r4, _080EA3D8 + movs r6, 0x21 + negs r6, r6 +_080EA376: + ldr r1, [r7] + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 5 + adds r1, r0 + adds r1, r4 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x13 + bls _080EA376 + ldr r0, _080EA3D0 + bl flag_set +_080EA39A: + ldr r4, _080EA3DC + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80EA20C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r2, _080EA3E0 + ldr r0, _080EA3D4 + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + adds r1, r0 + ldr r0, _080EA3D8 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 26 + lsrs r0, 31 + strh r0, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EA3CC: .4byte 0x00004054 +_080EA3D0: .4byte 0x00000922 +_080EA3D4: .4byte 0x03005d8c +_080EA3D8: .4byte 0x00001a9d +_080EA3DC: .4byte 0x020375e0 +_080EA3E0: .4byte 0x020375f0 + thumb_func_end sub_80EA354 + + thumb_func_start sub_80EA3E4 +sub_80EA3E4: @ 80EA3E4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080EA408 + adds r5, r1, r0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080EA448 + cmp r0, 0x1 + bgt _080EA40C + cmp r0, 0 + beq _080EA414 + b _080EA820 + .align 2, 0 +_080EA408: .4byte 0x03005e08 +_080EA40C: + cmp r0, 0x2 + bne _080EA412 + b _080EA810 +_080EA412: + b _080EA820 +_080EA414: + ldr r0, _080EA42C + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EA434 + ldr r1, _080EA430 + movs r0, 0x1 + strb r0, [r1] + b _080EA438 + .align 2, 0 +_080EA42C: .4byte 0x00004054 +_080EA430: .4byte 0x0203a01d +_080EA434: + ldr r0, _080EA444 + strb r1, [r0] +_080EA438: + adds r0, r5, 0x4 + adds r1, r5, 0x6 + bl player_get_pos_to + b _080EA81C + .align 2, 0 +_080EA444: .4byte 0x0203a01d +_080EA448: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x4 + ldrsh r0, [r5, r3] + adds r6, r4, 0 + cmp r1, r0 + bne _080EA474 + movs r0, 0 + ldrsh r1, [r6, r0] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _080EA474 + b _080EA820 +_080EA474: + strh r2, [r5, 0x4] + ldrh r0, [r6] + strh r0, [r5, 0x6] + ldr r4, _080EA4DC + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r6, r2] + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x8D + lsls r0, 2 + cmp r4, r0 + beq _080EA4C2 + adds r0, 0x8 + cmp r4, r0 + bne _080EA4E8 +_080EA4C2: + ldr r0, _080EA4E0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA4CC + b _080EA820 +_080EA4CC: + ldr r4, _080EA4E4 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x20 + b _080EA7FA + .align 2, 0 +_080EA4DC: .4byte 0x000040ec +_080EA4E0: .4byte 0x0203a01d +_080EA4E4: .4byte 0x000040ef +_080EA4E8: + ldr r3, _080EA534 + adds r0, r4, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080EA51A + movs r0, 0xB0 + lsls r0, 2 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + beq _080EA51A + adds r0, 0x6 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + bne _080EA540 +_080EA51A: + ldr r0, _080EA538 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA524 + b _080EA820 +_080EA524: + ldr r4, _080EA53C + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x1 + b _080EA7FA + .align 2, 0 +_080EA534: .4byte 0xfffffd48 +_080EA538: .4byte 0x0203a01d +_080EA53C: .4byte 0x000040ee +_080EA540: + ldr r0, _080EA570 + cmp r4, r0 + beq _080EA558 + adds r0, 0x8 + cmp r4, r0 + beq _080EA558 + adds r0, 0x10 + cmp r4, r0 + beq _080EA558 + adds r0, 0x8 + cmp r4, r0 + bne _080EA57C +_080EA558: + ldr r0, _080EA574 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA562 + b _080EA820 +_080EA562: + ldr r4, _080EA578 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x4 + b _080EA7FA + .align 2, 0 +_080EA570: .4byte 0x00000239 +_080EA574: .4byte 0x0203a01d +_080EA578: .4byte 0x000040ee +_080EA57C: + cmp r5, 0x34 + bne _080EA586 + ldr r0, _080EA5BC + cmp r4, r0 + beq _080EA59E +_080EA586: + cmp r5, 0x35 + bne _080EA5CC + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl cur_mapdata_get_blockid_at + ldr r1, _080EA5C0 + cmp r0, r1 + bne _080EA5CC +_080EA59E: + ldr r0, _080EA5C4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA5A8 + b _080EA820 +_080EA5A8: + ldr r4, _080EA5C8 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + b _080EA7FA + .align 2, 0 +_080EA5BC: .4byte 0x0000026d +_080EA5C0: .4byte 0x0000026a +_080EA5C4: .4byte 0x0203a01d +_080EA5C8: .4byte 0x000040ef +_080EA5CC: + cmp r5, 0xC1 + bne _080EA618 + ldr r0, _080EA60C + cmp r4, r0 + bne _080EA618 + ldr r0, _080EA610 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA5E0 + b _080EA820 +_080EA5E0: + ldr r4, _080EA614 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + b _080EA7FA + .align 2, 0 +_080EA60C: .4byte 0x0000023d +_080EA610: .4byte 0x0203a01d +_080EA614: .4byte 0x000040ef +_080EA618: + cmp r5, 0x47 + bne _080EA668 + ldr r0, _080EA65C + cmp r4, r0 + bne _080EA668 + ldr r0, _080EA660 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA62C + b _080EA820 +_080EA62C: + ldr r4, _080EA664 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + eors r1, r0 + b _080EA7FC + .align 2, 0 +_080EA65C: .4byte 0x0000023e +_080EA660: .4byte 0x0203a01d +_080EA664: .4byte 0x000040ef +_080EA668: + adds r0, r5, 0 + bl sub_80893C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA698 + ldr r0, _080EA690 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA680 + b _080EA820 +_080EA680: + ldr r4, _080EA694 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x80 + b _080EA7FA + .align 2, 0 +_080EA690: .4byte 0x0203a01d +_080EA694: .4byte 0x000040ef +_080EA698: + adds r0, r5, 0 + bl sub_808938C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA72C + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl cur_mapdata_get_blockid_at + lsls r0, 16 + asrs r0, 16 + mov r1, sp + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r6, r3] + bl sub_80FA5E4 + ldr r0, _080EA6F8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA6D0 + b _080EA820 +_080EA6D0: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl cur_mapdata_get_blockid_at + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 2 + cmp r1, r0 + beq _080EA70C + cmp r1, r0 + bgt _080EA6FC + movs r0, 0x8A + lsls r0, 2 + cmp r1, r0 + beq _080EA714 + b _080EA820 + .align 2, 0 +_080EA6F8: .4byte 0x0203a01d +_080EA6FC: + movs r0, 0xCF + lsls r0, 2 + cmp r1, r0 + beq _080EA70C + adds r0, 0x4 + cmp r1, r0 + beq _080EA70C + b _080EA820 +_080EA70C: + ldr r4, _080EA710 + b _080EA7F0 + .align 2, 0 +_080EA710: .4byte 0x000040ee +_080EA714: + ldr r4, _080EA728 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + b _080EA7FA + .align 2, 0 +_080EA728: .4byte 0x000040ee +_080EA72C: + adds r0, r5, 0 + bl sub_80893A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA778 + ldr r0, _080EA770 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA75E + ldr r4, _080EA774 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EA75E: + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r6, r2] + bl sub_80FA794 + b _080EA820 + .align 2, 0 +_080EA770: .4byte 0x0203a01d +_080EA774: .4byte 0x000040ef +_080EA778: + adds r0, r5, 0 + bl sub_80893B4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA7A8 + ldr r0, _080EA7A0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA820 + ldr r4, _080EA7A4 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 8 + adds r0, r3, 0 + b _080EA7FA + .align 2, 0 +_080EA7A0: .4byte 0x0203a01d +_080EA7A4: .4byte 0x000040ee +_080EA7A8: + adds r0, r5, 0 + bl sub_8089848 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA7D8 + ldr r0, _080EA7D0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA820 + ldr r4, _080EA7D4 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + b _080EA7FA + .align 2, 0 +_080EA7D0: .4byte 0x0203a01d +_080EA7D4: .4byte 0x000040ef +_080EA7D8: + adds r0, r5, 0 + bl sub_808985C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA820 + ldr r0, _080EA808 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA820 + ldr r4, _080EA80C +_080EA7F0: + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x2 +_080EA7FA: + orrs r1, r0 +_080EA7FC: + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + b _080EA820 + .align 2, 0 +_080EA808: .4byte 0x0203a01d +_080EA80C: .4byte 0x000040ef +_080EA810: + ldrb r0, [r5, 0x8] + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _080EA820 +_080EA81C: + movs r0, 0x1 + strh r0, [r5, 0x2] +_080EA820: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EA3E4 + + thumb_func_start sub_80EA828 +sub_80EA828: @ 80EA828 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r2, 0 + mov r8, r3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _080EA8C4 + ldr r0, [r6] + lsls r2, r5, 2 + adds r2, r5 + lsls r4, r2, 5 + adds r0, r4 + ldr r2, _080EA8C8 + mov r9, r2 + add r0, r9 + movs r2, 0xA0 + bl memcpy + ldr r2, [r6] + adds r2, r4 + ldr r0, _080EA8CC + adds r2, r0 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + subs r0, r7, 0x1 + cmp r0, 0x1 + bhi _080EA876 + ldr r0, [r6] + adds r0, r4 + ldr r1, _080EA8D0 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] +_080EA876: + cmp r7, 0x3 + bne _080EA8B8 + mov r2, r8 + cmp r2, 0x1 + bne _080EA8B8 + mov r1, r9 + adds r0, r4, r1 + ldr r1, [r6] + adds r1, r0 + adds r2, r1, 0x2 + movs r3, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0xFF + beq _080EA8A0 +_080EA892: + adds r3, 0x1 + cmp r3, 0x6 + bgt _080EA8A0 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EA892 +_080EA8A0: + cmp r3, 0x5 + ble _080EA8B8 + ldr r0, _080EA8C4 + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + adds r1, r0 + ldr r2, _080EA8D0 + adds r1, r2 + movs r0, 0x2 + strb r0, [r1] +_080EA8B8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EA8C4: .4byte 0x03005d8c +_080EA8C8: .4byte 0x00001a9c +_080EA8CC: .4byte 0x00001a9d +_080EA8D0: .4byte 0x00001aa9 + thumb_func_end sub_80EA828 + + thumb_func_start sub_80EA8D4 +sub_80EA8D4: @ 80EA8D4 + push {r4,lr} + movs r2, 0 + adds r4, r0, 0 + adds r4, 0x9 + adds r3, r1, 0 + adds r3, 0x9 +_080EA8E0: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080EA8F0 + movs r0, 0 + b _080EA8FC +_080EA8F0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080EA8E0 + movs r0, 0x1 +_080EA8FC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EA8D4 + + thumb_func_start sub_80EA904 +sub_80EA904: @ 80EA904 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r3, 0 + ldrb r0, [r6, 0x2] + cmp r0, 0xFF + bne _080EA918 + ldrb r0, [r5, 0x2] + cmp r0, 0xFF + beq _080EA946 +_080EA918: + adds r2, r6, 0x2 + adds r0, r2, r3 + adds r4, r5, 0x2 + adds r1, r4, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080EA92C + movs r0, 0 + b _080EA948 +_080EA92C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x6 + bhi _080EA946 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EA918 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EA918 +_080EA946: + movs r0, 0x1 +_080EA948: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EA904 + + thumb_func_start sub_80EA950 +sub_80EA950: @ 80EA950 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r2, [r4, 0x1] + movs r0, 0x10 + adds r1, r0, 0 + ands r1, r2 + ldrb r2, [r5, 0x1] + ands r0, r2 + cmp r1, r0 + bne _080EA986 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80EA8D4 + lsls r0, 24 + cmp r0, 0 + beq _080EA986 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80EA904 + lsls r0, 24 + cmp r0, 0 + beq _080EA986 + movs r0, 0x1 + b _080EA988 +_080EA986: + movs r0, 0 +_080EA988: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80EA950 + + thumb_func_start sub_80EA990 +sub_80EA990: @ 80EA990 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r0, _080EA9B8 + ldr r2, [r0] + ldr r4, _080EA9BC +_080EA99E: + lsls r0, r1, 16 + asrs r1, r0, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r0, r2, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _080EA9C0 + adds r0, r1, 0 + b _080EA9D0 + .align 2, 0 +_080EA9B8: .4byte 0x03005d8c +_080EA9BC: .4byte 0x00001a9c +_080EA9C0: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080EA99E + movs r0, 0x1 + negs r0, r0 +_080EA9D0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EA990 + + thumb_func_start sub_80EA9D8 +sub_80EA9D8: @ 80EA9D8 + push {r4,lr} + movs r2, 0x1 + ldr r0, _080EA9FC + ldr r3, [r0] + ldr r4, _080EAA00 +_080EA9E2: + lsls r0, r2, 16 + asrs r1, r0, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r0, r3, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080EAA04 + lsls r0, r2, 24 + lsrs r0, 24 + b _080EAA12 + .align 2, 0 +_080EA9FC: .4byte 0x03005d8c +_080EAA00: .4byte 0x00001a9c +_080EAA04: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080EA9E2 + movs r0, 0 +_080EAA12: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EA9D8 + + thumb_func_start sub_80EAA18 +sub_80EAA18: @ 80EAA18 + push {r4,lr} + movs r3, 0x1 + ldr r0, _080EAA44 + ldr r4, [r0] +_080EAA20: + lsls r2, r3, 16 + asrs r1, r2, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r0, r4, r0 + ldr r1, _080EAA48 + adds r0, r1 + ldrb r1, [r0] + lsrs r0, r1, 6 + cmp r0, 0 + bne _080EAA4C + lsls r0, r1, 28 + cmp r0, 0 + bne _080EAA4C + lsls r0, r3, 24 + lsrs r0, 24 + b _080EAA5C + .align 2, 0 +_080EAA44: .4byte 0x03005d8c +_080EAA48: .4byte 0x00001a9d +_080EAA4C: + movs r1, 0x80 + lsls r1, 9 + adds r0, r2, r1 + lsrs r3, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080EAA20 + movs r0, 0 +_080EAA5C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EAA18 + + thumb_func_start sub_80EAA64 +sub_80EAA64: @ 80EAA64 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldrb r0, [r5] + cmp r0, 0 + beq _080EAAEC + ldrb r0, [r5] + bl sub_80EA990 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + beq _080EAAEC + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080EAAC4 + ldr r0, _080EAABC + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 5 + adds r1, r0 + ldr r0, _080EAAC0 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 28 + lsrs r0, 28 + cmp r0, 0x1 + beq _080EAAEC + lsrs r0, r1, 6 + cmp r0, 0x2 + bne _080EAAB4 + ldrb r1, [r5, 0x1] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _080EAAEC +_080EAAB4: + lsls r4, 24 + lsrs r4, 24 + b _080EAADC + .align 2, 0 +_080EAABC: .4byte 0x03005d8c +_080EAAC0: .4byte 0x00001a9d +_080EAAC4: + bl sub_80EA9D8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080EAADC + bl sub_80EAA18 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080EAAEC +_080EAADC: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_80EA828 + adds r0, r4, 0 + b _080EAAEE +_080EAAEC: + movs r0, 0 +_080EAAEE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EAA64 + + thumb_func_start sub_80EAAF4 +sub_80EAAF4: @ 80EAAF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xA0 + ldr r0, _080EAB9C + ldr r0, [r0] + ldr r1, _080EABA0 + adds r7, r0, r1 + movs r2, 0x1 +_080EAB08: + adds r1, r2, 0x1 + lsls r0, r1, 24 + lsrs r5, r0, 24 + mov r9, r1 + cmp r5, 0x13 + bhi _080EAB84 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 5 + adds r6, r0, r7 + movs r0, 0xC0 + mov r8, r0 +_080EAB20: + ldrb r0, [r6, 0x1] + mov r3, r8 + ands r3, r0 + cmp r3, 0 + bne _080EAB3E + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 5 + adds r0, r7 + ldrb r1, [r0, 0x1] + mov r0, r8 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0x40 + beq _080EAB56 +_080EAB3E: + cmp r3, 0x80 + bne _080EAB7A + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 5 + adds r0, r7 + ldrb r1, [r0, 0x1] + mov r0, r8 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0x80 + beq _080EAB7A +_080EAB56: + mov r0, sp + adds r1, r6, 0 + movs r2, 0xA0 + bl memcpy + adds r4, r5 + lsls r4, 5 + adds r4, r7 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0xA0 + bl memcpy + adds r0, r4, 0 + mov r1, sp + movs r2, 0xA0 + bl memcpy +_080EAB7A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAB20 +_080EAB84: + mov r1, r9 + lsls r0, r1, 24 + lsrs r2, r0, 24 + cmp r2, 0x12 + bls _080EAB08 + add sp, 0xA0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EAB9C: .4byte 0x03005d8c +_080EABA0: .4byte 0x00001a9c + thumb_func_end sub_80EAAF4 + + thumb_func_start sub_80EABA4 +sub_80EABA4: @ 80EABA4 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r4, 0x1 +_080EABAE: + ldr r0, [r5] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 5 + adds r3, r1, r0 + ldrb r0, [r3, 0x1] + lsrs r0, 6 + cmp r0, r6 + bne _080EABCA + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + adds r0, r3, 0 + bl sub_80EAA64 +_080EABCA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080EABAE + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EABA4 + + thumb_func_start sub_80EABDC +sub_80EABDC: @ 80EABDC + push {r4-r6,lr} + adds r5, r0, 0 + ldrb r0, [r5] + cmp r0, 0 + beq _080EABF8 + ldrb r0, [r5, 0x1] + lsls r0, 27 + ldr r1, _080EABFC + ldr r3, [r1] + lsrs r0, 31 + adds r6, r1, 0 + ldrb r1, [r3, 0x8] + cmp r0, r1 + beq _080EAC00 +_080EABF8: + movs r0, 0 + b _080EAC56 + .align 2, 0 +_080EABFC: .4byte 0x03005d90 +_080EAC00: + movs r2, 0 + adds r4, r5, 0 + adds r4, 0x9 + adds r3, 0xA +_080EAC08: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080EABF8 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080EAC08 + movs r2, 0 + ldrb r0, [r5, 0x2] + cmp r0, 0xFF + bne _080EAC2A + ldr r0, [r6] + b _080EAC4E +_080EAC2A: + adds r3, r5, 0x2 + adds r0, r3, r2 + ldr r4, [r6] + adds r1, r4, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080EABF8 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bhi _080EAC54 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EAC2A + adds r0, r4, r2 +_080EAC4E: + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EAC2A +_080EAC54: + movs r0, 0x1 +_080EAC56: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EABDC + + thumb_func_start sub_80EAC5C +sub_80EAC5C: @ 80EAC5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + mov r9, r1 + mov r8, r2 + movs r5, 0 + movs r6, 0 +_080EAC70: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + bne _080EAC9A + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 5 + mov r1, r10 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80EABDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EAC9A + adds r0, r4, 0 + bl sub_80E8AF0 + movs r0, 0x1 + orrs r5, r0 +_080EAC9A: + movs r7, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + bne _080EACC8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 5 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80EABDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EACC8 + adds r0, r4, 0 + bl sub_80E8AF0 + orrs r5, r7 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080EACC8: + movs r7, 0x4 + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + bne _080EACF6 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 5 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80EABDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EACF6 + adds r0, r4, 0 + bl sub_80E8AF0 + orrs r5, r7 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080EACF6: + cmp r5, 0x7 + beq _080EAD04 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x13 + bls _080EAC70 +_080EAD04: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EAC5C + + thumb_func_start sub_80EAD14 +sub_80EAD14: @ 80EAD14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + movs r5, 0 +_080EAD24: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + mov r1, r8 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080EAD7E + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80EA950 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EAD7E + cmp r7, 0 + bne _080EAD50 + adds r0, r4, 0 + bl sub_80E8AF0 + b _080EAD88 +_080EAD50: + ldrh r0, [r6, 0xE] + ldrh r3, [r4, 0xE] + cmp r0, r3 + bls _080EAD60 + adds r0, r4, 0 + bl sub_80E8AF0 + b _080EAD88 +_080EAD60: + ldrb r0, [r6, 0x1] + lsls r0, 28 + lsrs r0, 28 + ldrb r1, [r4, 0x1] + movs r3, 0x10 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x1] + adds r0, r6, 0 + bl sub_80E8AF0 + movs r0, 0x1 + b _080EAD8A +_080EAD7E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAD24 +_080EAD88: + movs r0, 0 +_080EAD8A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EAD14 + + thumb_func_start sub_80EAD94 +sub_80EAD94: @ 80EAD94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + adds r7, r1, 0 + mov r8, r2 + adds r6, r3, 0 + movs r5, 0x1 +_080EADA6: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + mov r1, r9 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080EADF8 + ldrb r1, [r4, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + bne _080EADCE + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] +_080EADCE: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_80EAD14 + lsls r0, 24 + cmp r0, 0 + bne _080EADF8 + adds r0, r4, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_80EAD14 + lsls r0, 24 + cmp r0, 0 + bne _080EADF8 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80EAD14 +_080EADF8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EADA6 + movs r5, 0 +_080EAE04: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + adds r4, r0, r7 + ldrb r0, [r4] + cmp r0, 0 + beq _080EAE38 + ldrb r0, [r4, 0x1] + movs r2, 0x21 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_80EAD14 + lsls r0, 24 + cmp r0, 0 + bne _080EAE38 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80EAD14 +_080EAE38: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAE04 + movs r5, 0 + movs r0, 0x21 + negs r0, r0 + adds r7, r0, 0 +_080EAE4A: + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 5 + mov r2, r8 + adds r1, r4, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080EAE6A + ldrb r0, [r1, 0x1] + ands r0, r7 + strb r0, [r1, 0x1] + adds r0, r1, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80EAD14 +_080EAE6A: + adds r1, r4, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _080EAE78 + ldrb r0, [r1, 0x1] + ands r0, r7 + strb r0, [r1, 0x1] +_080EAE78: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAE4A + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EAD94 + + thumb_func_start sub_80EAE90 +sub_80EAE90: @ 80EAE90 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + ldrb r1, [r4, 0x1] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _080EAEAE + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_80EAA64 + adds r0, r4, 0 + bl sub_80E8AF0 +_080EAEAE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80EAE90 + + thumb_func_start sub_80EAEB4 +sub_80EAEB4: @ 80EAEB4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 +_080EAEBA: + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 5 + ldr r0, [r5] + adds r0, r4 + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + bl sub_80EAE90 + ldr r0, [r5, 0xC] + adds r0, r4 + ldr r1, [r5, 0x10] + ldr r2, [r5, 0x14] + bl sub_80EAE90 + ldr r0, [r5, 0x18] + adds r0, r4 + ldr r1, [r5, 0x1C] + ldr r2, [r5, 0x20] + bl sub_80EAE90 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bls _080EAEBA + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EAEB4 + + thumb_func_start sub_80EAEF4 +sub_80EAEF4: @ 80EAEF4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, [r4] + ldr r1, [r4, 0xC] + ldr r2, [r4, 0x18] + bl sub_80EAC5C + ldr r0, _080EAF78 + ldr r0, [r0] + ldr r1, _080EAF7C + adds r0, r1 + ldr r1, [r4] + ldr r2, [r4, 0xC] + ldr r3, [r4, 0x18] + bl sub_80EAD94 + adds r0, r4, 0 + bl sub_80EAEB4 + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldr r2, [r4, 0x8] + bl sub_80EAA64 + ldr r0, [r4, 0xC] + ldr r1, [r4, 0x10] + ldr r2, [r4, 0x14] + bl sub_80EAA64 + ldr r0, [r4, 0x18] + ldr r1, [r4, 0x1C] + ldr r2, [r4, 0x20] + bl sub_80EAA64 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80EABA4 + adds r6, r4, 0 + adds r6, 0xC + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80EABA4 + adds r5, r4, 0 + adds r5, 0x18 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80EABA4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80EABA4 + adds r0, r6, 0 + movs r1, 0 + bl sub_80EABA4 + adds r0, r5, 0 + movs r1, 0 + bl sub_80EABA4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EAF78: .4byte 0x03005d8c +_080EAF7C: .4byte 0x00001a9c + thumb_func_end sub_80EAEF4 + + thumb_func_start sub_80EAF80 +sub_80EAF80: @ 80EAF80 + push {r4-r7,lr} + sub sp, 0x24 + adds r6, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x60 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080EAF9A + b _080EB16A +_080EAF9A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080EAFAC + cmp r0, 0x3 + beq _080EAFC8 + b _080EAFD6 +_080EAFAC: + lsls r4, r5, 1 + adds r0, r6, r4 + movs r1, 0 + adds r2, r5, 0 + bl memset + adds r4, r5 + adds r4, r6, r4 + adds r0, r4, 0 + movs r1, 0 + adds r2, r5, 0 + bl memset + b _080EAFD6 +_080EAFC8: + lsls r0, r5, 1 + adds r0, r5 + adds r0, r6, r0 + movs r1, 0 + adds r2, r5, 0 + bl memset +_080EAFD6: + cmp r7, 0x1 + beq _080EB030 + cmp r7, 0x1 + bgt _080EAFE4 + cmp r7, 0 + beq _080EAFEE + b _080EB0D4 +_080EAFE4: + cmp r7, 0x2 + beq _080EB074 + cmp r7, 0x3 + beq _080EB0A8 + b _080EB0D4 +_080EAFEE: + adds r0, r6, r5 + str r0, [sp] + ldr r4, _080EB02C + movs r3, 0xFF + ldrb r0, [r4, 0x1C] + str r0, [sp, 0x4] + ldrh r0, [r4, 0x36] + str r0, [sp, 0x8] + lsls r1, r5, 1 + adds r0, r6, r1 + str r0, [sp, 0xC] + ldrh r2, [r4, 0x38] + adds r0, r3, 0 + ands r0, r2 + str r0, [sp, 0x10] + adds r0, r4, 0 + adds r0, 0x52 + ldrh r0, [r0] + str r0, [sp, 0x14] + adds r1, r5 + adds r1, r6, r1 + str r1, [sp, 0x18] + adds r0, r4, 0 + adds r0, 0x54 + ldrh r0, [r0] + ands r3, r0 + str r3, [sp, 0x1C] + adds r0, r4, 0 + adds r0, 0x6E + ldrh r0, [r0] + b _080EB0D2 + .align 2, 0 +_080EB02C: .4byte 0x020229e8 +_080EB030: + lsls r2, r5, 1 + adds r0, r6, r2 + str r0, [sp] + ldr r4, _080EB070 + ldrh r3, [r4, 0x38] + movs r1, 0xFF + adds r0, r1, 0 + ands r0, r3 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r0, 0x52 + ldrh r0, [r0] + str r0, [sp, 0x8] + adds r2, r5 + adds r2, r6, r2 + str r2, [sp, 0xC] + adds r0, r4, 0 + adds r0, 0x54 + ldrh r2, [r0] + adds r0, r1, 0 + ands r0, r2 + str r0, [sp, 0x10] + adds r0, r4, 0 + adds r0, 0x6E + ldrh r0, [r0] + str r0, [sp, 0x14] + str r6, [sp, 0x18] + ldrh r0, [r4] + ands r1, r0 + str r1, [sp, 0x1C] + ldrh r0, [r4, 0x1A] + b _080EB0D2 + .align 2, 0 +_080EB070: .4byte 0x020229e8 +_080EB074: + lsls r0, r5, 1 + adds r0, r5 + adds r0, r6, r0 + str r0, [sp] + ldr r1, _080EB0A4 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x6E + ldrh r0, [r0] + str r0, [sp, 0x8] + str r6, [sp, 0xC] + ldrb r0, [r1] + str r0, [sp, 0x10] + ldrh r0, [r1, 0x1A] + str r0, [sp, 0x14] + adds r0, r6, r5 + str r0, [sp, 0x18] + ldrb r0, [r1, 0x1C] + str r0, [sp, 0x1C] + ldrh r0, [r1, 0x36] + b _080EB0D2 + .align 2, 0 +_080EB0A4: .4byte 0x020229e8 +_080EB0A8: + str r6, [sp] + ldr r1, _080EB174 + ldrb r0, [r1] + str r0, [sp, 0x4] + ldrh r0, [r1, 0x1A] + str r0, [sp, 0x8] + adds r0, r6, r5 + str r0, [sp, 0xC] + movs r2, 0xFF + ldrb r0, [r1, 0x1C] + str r0, [sp, 0x10] + ldrh r0, [r1, 0x36] + str r0, [sp, 0x14] + lsls r0, r5, 1 + adds r0, r6, r0 + str r0, [sp, 0x18] + ldrh r0, [r1, 0x38] + ands r2, r0 + str r2, [sp, 0x1C] + adds r1, 0x52 + ldrh r0, [r1] +_080EB0D2: + str r0, [sp, 0x20] +_080EB0D4: + mov r0, sp + bl sub_80EAEF4 + movs r3, 0x1 + ldr r6, _080EB178 + movs r7, 0x10 + negs r7, r7 +_080EB0E2: + ldr r0, [r6] + lsls r1, r3, 2 + adds r1, r3 + lsls r4, r1, 5 + adds r0, r4 + ldr r5, _080EB17C + adds r2, r0, r5 + ldrb r1, [r2] + lsls r0, r1, 28 + lsrs r0, 28 + cmp r0, 0x1 + bne _080EB112 + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r6] + adds r1, r4 + adds r1, r5 + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] +_080EB112: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _080EB0E2 + bl sub_80EAAF4 + movs r3, 0x1 + ldr r7, _080EB178 + adds r6, r7, 0 + adds r4, r5, 0 + movs r5, 0x3F +_080EB12A: + ldr r0, [r6] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 5 + adds r0, r1 + adds r2, r0, r4 + ldrb r1, [r2] + lsrs r0, r1, 6 + cmp r0, 0x2 + bne _080EB144 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] +_080EB144: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _080EB12A + ldr r1, [r7] + ldr r2, _080EB180 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080EB16A + ldr r0, _080EB184 + adds r2, r1, r0 + ldrh r1, [r2] + ldr r0, _080EB188 + cmp r1, r0 + beq _080EB16A + adds r0, r1, 0x1 + strh r0, [r2] +_080EB16A: + add sp, 0x24 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EB174: .4byte 0x020229e8 +_080EB178: .4byte 0x03005d8c +_080EB17C: .4byte 0x00001a9d +_080EB180: .4byte 0x00001a9c +_080EB184: .4byte 0x00001aaa +_080EB188: .4byte 0x0000ffff + thumb_func_end sub_80EAF80 + + thumb_func_start sub_80EB18C +sub_80EB18C: @ 80EB18C + push {r4,r5,lr} + movs r5, 0 + adds r4, r0, 0 +_080EB192: + ldrb r0, [r4, 0xD] + cmp r0, 0x1 + bne _080EB19E + adds r0, r4, 0 + bl sub_80E8AF0 +_080EB19E: + adds r4, 0xA0 + adds r5, 0x1 + cmp r5, 0x13 + bls _080EB192 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80EB18C + + thumb_func_start sub_80EB1AC +sub_80EB1AC: @ 80EB1AC + push {lr} + ldr r0, _080EB1E4 + movs r1, 0 + bl var_set + ldr r0, _080EB1E8 + movs r1, 0 + bl var_set + ldr r0, _080EB1EC + movs r1, 0 + bl var_set + ldr r0, _080EB1F0 + movs r1, 0 + bl var_set + ldr r0, _080EB1F4 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB1FC + ldr r0, _080EB1F8 + movs r1, 0x1 + bl var_set + b _080EB204 + .align 2, 0 +_080EB1E4: .4byte 0x000040ec +_080EB1E8: .4byte 0x000040ed +_080EB1EC: .4byte 0x000040ee +_080EB1F0: .4byte 0x000040ef +_080EB1F4: .4byte 0x00004054 +_080EB1F8: .4byte 0x000040f0 +_080EB1FC: + ldr r0, _080EB210 + movs r1, 0 + bl var_set +_080EB204: + ldr r1, _080EB214 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080EB210: .4byte 0x000040f0 +_080EB214: .4byte 0x0203a01d + thumb_func_end sub_80EB1AC + + thumb_func_start sub_80EB218 +sub_80EB218: @ 80EB218 + push {r4-r6,lr} + ldr r5, _080EB278 + adds r0, r5, 0 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB272 + ldr r6, _080EB27C + ldrb r0, [r6] + cmp r0, 0x1 + bne _080EB272 + bl sub_80E9214 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080EB272 + adds r0, r5, 0 + movs r1, 0 + bl var_set + strb r4, [r6] + bl sub_80EEA70 + ldr r0, _080EB280 + movs r1, 0 + bl var_set + ldr r0, _080EB284 + movs r1, 0 + bl var_set + ldr r0, _080EB288 + movs r1, 0 + bl var_set + ldr r0, _080EB28C + movs r1, 0 + bl var_set + adds r0, r5, 0 + movs r1, 0 + bl var_set +_080EB272: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EB278: .4byte 0x000040f0 +_080EB27C: .4byte 0x0203a01d +_080EB280: .4byte 0x000040ec +_080EB284: .4byte 0x000040ed +_080EB288: .4byte 0x000040ee +_080EB28C: .4byte 0x000040ef + thumb_func_end sub_80EB218 + + thumb_func_start sub_80EB290 +sub_80EB290: @ 80EB290 + push {r4,lr} + ldr r0, _080EB2C0 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB2BA + ldr r4, _080EB2C4 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EB2BA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EB2C0: .4byte 0x00004054 +_080EB2C4: .4byte 0x000040ef + thumb_func_end sub_80EB290 + + thumb_func_start sub_80EB2C8 +sub_80EB2C8: @ 80EB2C8 + push {r4,lr} + ldr r0, _080EB2F8 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB2F2 + ldr r4, _080EB2FC + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EB2F2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EB2F8: .4byte 0x00004054 +_080EB2FC: .4byte 0x000040ee + thumb_func_end sub_80EB2C8 + + thumb_func_start sub_80EB300 +sub_80EB300: @ 80EB300 + push {r4,r5,lr} + ldr r0, _080EB354 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB34C + ldr r5, _080EB358 + adds r0, r5, 0 + bl var_get + ldr r1, _080EB35C + ands r1, r0 + adds r0, r5, 0 + bl var_set + ldr r4, _080EB360 + adds r0, r4, 0 + bl var_get + ldr r1, _080EB364 + ands r1, r0 + adds r0, r4, 0 + bl var_set + adds r0, r5, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 6 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl var_set +_080EB34C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EB354: .4byte 0x00004054 +_080EB358: .4byte 0x000040ee +_080EB35C: .4byte 0x0000c7ff +_080EB360: .4byte 0x000040ef +_080EB364: .4byte 0x0000fffe + thumb_func_end sub_80EB300 + + thumb_func_start sub_80EB368 +sub_80EB368: @ 80EB368 + push {r4,r5,lr} + ldr r0, _080EB3BC + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB3B4 + ldr r5, _080EB3C0 + adds r0, r5, 0 + bl var_get + ldr r1, _080EB3C4 + ands r1, r0 + adds r0, r5, 0 + bl var_set + ldr r4, _080EB3C8 + adds r0, r4, 0 + bl var_get + ldr r1, _080EB3CC + ands r1, r0 + adds r0, r4, 0 + bl var_set + adds r0, r5, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl var_set +_080EB3B4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EB3BC: .4byte 0x00004054 +_080EB3C0: .4byte 0x000040ee +_080EB3C4: .4byte 0x0000c7ff +_080EB3C8: .4byte 0x000040ef +_080EB3CC: .4byte 0x0000fffe + thumb_func_end sub_80EB368 + + thumb_func_start sub_80EB3D0 +sub_80EB3D0: @ 80EB3D0 + push {r4,r5,lr} + ldr r0, _080EB424 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB41C + ldr r5, _080EB428 + adds r0, r5, 0 + bl var_get + ldr r1, _080EB42C + ands r1, r0 + adds r0, r5, 0 + bl var_set + ldr r4, _080EB430 + adds r0, r4, 0 + bl var_get + ldr r1, _080EB434 + ands r1, r0 + adds r0, r4, 0 + bl var_set + adds r0, r5, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl var_set +_080EB41C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EB424: .4byte 0x00004054 +_080EB428: .4byte 0x000040ee +_080EB42C: .4byte 0x0000c7ff +_080EB430: .4byte 0x000040ef +_080EB434: .4byte 0x0000fffe + thumb_func_end sub_80EB3D0 + + thumb_func_start sub_80EB438 +sub_80EB438: @ 80EB438 + push {r4,lr} + ldr r0, _080EB488 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB480 + ldr r4, _080EB48C + adds r0, r4, 0 + bl var_get + ldr r1, _080EB490 + ands r1, r0 + adds r0, r4, 0 + bl var_set + adds r4, 0x1 + adds r0, r4, 0 + bl var_get + ldr r1, _080EB494 + ands r1, r0 + adds r0, r4, 0 + bl var_set + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x1 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EB480: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EB488: .4byte 0x00004054 +_080EB48C: .4byte 0x000040ee +_080EB490: .4byte 0x0000c7ff +_080EB494: .4byte 0x0000fffe + thumb_func_end sub_80EB438 + + thumb_func_start sub_80EB498 +sub_80EB498: @ 80EB498 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + ldr r1, _080EB4C8 + adds r0, r1 + cmp r0, 0x18 + bhi _080EB55C + lsls r0, 2 + ldr r1, _080EB4CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EB4C8: .4byte 0xfffffce4 +_080EB4CC: .4byte _080EB4D0 + .align 2, 0 +_080EB4D0: + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 +_080EB534: + ldr r0, _080EB564 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB55C + ldr r4, _080EB568 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EB55C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EB564: .4byte 0x00004054 +_080EB568: .4byte 0x000040ee + thumb_func_end sub_80EB498 + + thumb_func_start sub_80EB56C +sub_80EB56C: @ 80EB56C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + ldr r1, _080EB5A0 + adds r0, r1 + cmp r0, 0xCF + bls _080EB594 + b _080EB9D0 +_080EB594: + lsls r0, 2 + ldr r1, _080EB5A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EB5A0: .4byte 0xfffffdd4 +_080EB5A4: .4byte _080EB5A8 + .align 2, 0 +_080EB5A8: + .4byte _080EB930 + .4byte _080EB97C + .4byte _080EB97C + .4byte _080EB97C + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB930 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB954 + .4byte _080EB954 + .4byte _080EB8E8 + .4byte _080EB8E8 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C +_080EB8E8: + ldr r0, _080EB904 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, _080EB908 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x40 + b _080EB994 + .align 2, 0 +_080EB904: .4byte 0x00004054 +_080EB908: .4byte 0x000040ee +_080EB90C: + ldr r0, _080EB928 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, _080EB92C + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x8 + b _080EB994 + .align 2, 0 +_080EB928: .4byte 0x00004054 +_080EB92C: .4byte 0x000040ee +_080EB930: + ldr r0, _080EB94C + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, _080EB950 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x40 + b _080EB994 + .align 2, 0 +_080EB94C: .4byte 0x00004054 +_080EB950: .4byte 0x000040ef +_080EB954: + ldr r0, _080EB974 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, _080EB978 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + b _080EB994 + .align 2, 0 +_080EB974: .4byte 0x00004054 +_080EB978: .4byte 0x000040ef +_080EB97C: + ldr r0, _080EB9A4 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, _080EB9A8 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x10 +_080EB994: + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + b _080EB9D0 + .align 2, 0 +_080EB9A4: .4byte 0x00004054 +_080EB9A8: .4byte 0x000040ef +_080EB9AC: + ldr r0, _080EB9D8 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, _080EB9DC + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EB9D0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EB9D8: .4byte 0x00004054 +_080EB9DC: .4byte 0x000040ef + thumb_func_end sub_80EB56C + + thumb_func_start sub_80EB9E0 +sub_80EB9E0: @ 80EB9E0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + ldr r1, _080EBA14 + adds r0, r1 + cmp r0, 0x35 + bls _080EBA08 + b _080EBB18 +_080EBA08: + lsls r0, 2 + ldr r1, _080EBA18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EBA14: .4byte 0xfffffd6f +_080EBA18: .4byte _080EBA1C + .align 2, 0 +_080EBA1C: + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 +_080EBAF4: + ldr r0, _080EBB20 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EBB18 + ldr r4, _080EBB24 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EBB18: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EBB20: .4byte 0x00004054 +_080EBB24: .4byte 0x000040ef + thumb_func_end sub_80EB9E0 + + thumb_func_start sub_80EBB28 +sub_80EBB28: @ 80EBB28 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + ldr r1, _080EBB5C + adds r0, r1 + cmp r0, 0xA2 + bls _080EBB50 + b _080EBE6C +_080EBB50: + lsls r0, 2 + ldr r1, _080EBB60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EBB5C: .4byte 0xfffffddb +_080EBB60: .4byte _080EBB64 + .align 2, 0 +_080EBB64: + .4byte _080EBE48 + .4byte _080EBE48 + .4byte _080EBE48 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE14 + .4byte _080EBE14 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 +_080EBDF0: + ldr r0, _080EBE0C + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EBE6C + ldr r4, _080EBE10 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x8 + b _080EBE30 + .align 2, 0 +_080EBE0C: .4byte 0x00004054 +_080EBE10: .4byte 0x000040ef +_080EBE14: + ldr r0, _080EBE40 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EBE6C + ldr r4, _080EBE44 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 +_080EBE30: + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + b _080EBE6C + .align 2, 0 +_080EBE40: .4byte 0x00004054 +_080EBE44: .4byte 0x000040ef +_080EBE48: + ldr r0, _080EBE74 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EBE6C + ldr r4, _080EBE78 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x10 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EBE6C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EBE74: .4byte 0x00004054 +_080EBE78: .4byte 0x000040ef + thumb_func_end sub_80EBB28 + + thumb_func_start sub_80EBE7C +sub_80EBE7C: @ 80EBE7C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + adds r1, r0, 0 + ldr r0, _080EBED4 + cmp r1, r0 + bgt _080EBECC + subs r0, 0x1 + cmp r1, r0 + blt _080EBECC + ldr r0, _080EBED8 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080EBECC + ldr r4, _080EBEDC + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x4 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080EBECC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EBED4: .4byte 0x0000028e +_080EBED8: .4byte 0x00004054 +_080EBEDC: .4byte 0x000040ef + thumb_func_end sub_80EBE7C + + thumb_func_start sub_80EBEE0 +sub_80EBEE0: @ 80EBEE0 + push {r4-r7,lr} + movs r3, 0 + ldr r6, _080EBF30 + movs r5, 0 + ldr r7, _080EBF34 +_080EBEEA: + ldr r0, [r6] + lsls r1, r3, 3 + adds r1, r3 + lsls r1, 2 + adds r0, r1 + ldr r2, _080EBF38 + adds r0, r2 + strb r5, [r0] + ldr r0, [r6] + adds r0, r1 + adds r2, 0x1 + adds r0, r2 + strb r5, [r0] + movs r2, 0 + adds r4, r3, 0x1 + adds r3, r1, 0 +_080EBF0A: + ldr r0, [r6] + adds r1, r2, r3 + adds r0, r7 + adds r0, r1 + strb r5, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x21 + bls _080EBF0A + lsls r0, r4, 24 + lsrs r3, r0, 24 + cmp r3, 0x18 + bls _080EBEEA + bl sub_80EEE5C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EBF30: .4byte 0x03005d8c +_080EBF34: .4byte 0x000027ce +_080EBF38: .4byte 0x000027cc + thumb_func_end sub_80EBEE0 + + thumb_func_start sub_80EBF3C +sub_80EBF3C: @ 80EBF3C + push {r4-r7,lr} + movs r4, 0x5 + ldr r1, _080EBFB0 + ldr r0, [r1] + movs r2, 0xA2 + lsls r2, 6 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080EBF70 + adds r3, r1, 0 + subs r2, 0xB4 +_080EBF54: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x17 + bhi _080EBF70 + ldr r0, [r3] + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EBF54 +_080EBF70: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + ldr r6, _080EBFB0 +_080EBF86: + ldr r1, [r6] + lsls r0, r5, 3 + adds r0, r5 + lsls r4, r0, 2 + adds r1, r4 + ldr r0, _080EBFB4 + adds r1, r0 + ldrb r0, [r1] + bl sub_80EFFE0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _080EBFBC + ldr r0, [r6] + adds r0, r4 + ldr r1, _080EBFB8 + adds r0, r1 + ldrb r0, [r0] + b _080EBFCC + .align 2, 0 +_080EBFB0: .4byte 0x03005d8c +_080EBFB4: .4byte 0x000027cc +_080EBFB8: .4byte 0x000027cd +_080EBFBC: + ldr r2, _080EBFD4 + adds r0, r4, r2 + ldr r1, [r6] + adds r1, r0 + ldrh r0, [r1, 0x16] + cmp r0, 0 + bne _080EBFD8 + ldrb r0, [r1, 0x1] +_080EBFCC: + cmp r0, 0x1 + bne _080EBFD8 + adds r0, r5, 0 + b _080EBFEC + .align 2, 0 +_080EBFD4: .4byte 0x000027cc +_080EBFD8: + cmp r5, 0 + bne _080EBFE0 + movs r5, 0x17 + b _080EBFE6 +_080EBFE0: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EBFE6: + cmp r5, r7 + bne _080EBF86 + movs r0, 0xFF +_080EBFEC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EBF3C + + thumb_func_start sub_80EBFF4 +sub_80EBFF4: @ 80EBFF4 + push {lr} + bl sub_80EBF3C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + bne _080EC006 + movs r0, 0xFF + b _080EC03E +_080EC006: + ldr r0, _080EC030 + ldr r2, [r0] + ldr r3, _080EC034 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080EC03C + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2, r0 + ldr r2, _080EC038 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x29 + bne _080EC03C + bl sub_80EC18C + lsls r0, 24 + lsrs r0, 24 + b _080EC03E + .align 2, 0 +_080EC030: .4byte 0x03005d8c +_080EC034: .4byte 0x00002b90 +_080EC038: .4byte 0x000027cc +_080EC03C: + adds r0, r1, 0 +_080EC03E: + pop {r1} + bx r1 + thumb_func_end sub_80EBFF4 + + thumb_func_start per_step_2 +per_step_2: @ 80EC044 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _080EC078 + bl flag_set + bl sub_80F0040 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EC06A + cmp r0, 0x2 + beq _080EC0BE + ldr r0, _080EC07C + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0xD + bne _080EC080 +_080EC06A: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_80EC0CC + b _080EC0BE + .align 2, 0 +_080EC078: .4byte 0x00000891 +_080EC07C: .4byte 0x03005d8c +_080EC080: + ldr r0, _080EC0C4 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080EC0BE + bl sub_80EBFF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080EC0AE + bl sub_80EEF20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080EC0AE + bl is_tile_XX_prevent_per_step_scripts + lsls r0, 24 + cmp r0, 0 + beq _080EC0BE +_080EC0AE: + ldr r0, _080EC0C8 + bl flag_clear + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_80EC0CC +_080EC0BE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EC0C4: .4byte 0x00000892 +_080EC0C8: .4byte 0x00000891 + thumb_func_end per_step_2 + + thumb_func_start sub_80EC0CC +sub_80EC0CC: @ 80EC0CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + movs r5, 0 + cmp r5, r10 + bge _080EC120 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1, 0 + mov r8, r2 + mov r1, r8 + orrs r1, r0 + mov r8, r1 +_080EC0F2: + movs r4, 0 + adds r7, r5, 0x1 + cmp r4, r9 + bge _080EC11A + mov r0, r8 + lsls r6, r0, 16 +_080EC0FE: + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_block_get_role_at + cmp r0, 0x86 + bne _080EC114 + adds r0, r4, 0 + adds r1, r5, 0 + lsrs r2, r6, 16 + bl setmaptile_0 +_080EC114: + adds r4, 0x1 + cmp r4, r9 + blt _080EC0FE +_080EC11A: + adds r5, r7, 0 + cmp r5, r10 + blt _080EC0F2 +_080EC120: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EC0CC + + thumb_func_start sub_80EC130 +sub_80EC130: @ 80EC130 + push {lr} + ldr r1, _080EC148 + ldr r0, [r1] + ldr r1, [r1, 0x4] + movs r2, 0x2 + bl sub_80EC0CC + bl cur_mapdata_full_redraw + pop {r0} + bx r0 + .align 2, 0 +_080EC148: .4byte 0x03005dc0 + thumb_func_end sub_80EC130 + + thumb_func_start cut +cut: @ 80EC14C + push {lr} + ldr r1, _080EC164 + ldr r0, [r1] + ldr r1, [r1, 0x4] + movs r2, 0x3 + bl sub_80EC0CC + bl cur_mapdata_full_redraw + pop {r0} + bx r0 + .align 2, 0 +_080EC164: .4byte 0x03005dc0 + thumb_func_end cut + + thumb_func_start sub_80EC168 +sub_80EC168: @ 80EC168 + ldr r0, _080EC180 + ldr r1, [r0] + ldr r0, _080EC184 + ldrh r2, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + ldr r0, _080EC188 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_080EC180: .4byte 0x03005d8c +_080EC184: .4byte 0x020375e0 +_080EC188: .4byte 0x000027cc + thumb_func_end sub_80EC168 + + thumb_func_start sub_80EC18C +sub_80EC18C: @ 80EC18C + push {r4,lr} + movs r2, 0 + ldr r0, _080EC1B8 + ldr r3, [r0] +_080EC194: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r3, r0 + ldr r4, _080EC1BC + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080EC1C0 + cmp r0, 0x29 + beq _080EC1C0 + adds r4, 0x1 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EC1C0 + adds r0, r2, 0 + b _080EC1CC + .align 2, 0 +_080EC1B8: .4byte 0x03005d8c +_080EC1BC: .4byte 0x000027cc +_080EC1C0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x17 + bls _080EC194 + movs r0, 0xFF +_080EC1CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EC18C + + thumb_func_start sub_80EC1D4 +sub_80EC1D4: @ 80EC1D4 + push {lr} + ldr r3, _080EC204 + ldr r2, _080EC208 + ldrh r1, [r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EC20C + adds r0, r1 + ldr r3, [r3] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0x29 + bne _080EC214 + ldr r1, _080EC210 + adds r0, r3, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080EC214 + bl sub_80EC18C + lsls r0, 24 + lsrs r0, 24 + b _080EC216 + .align 2, 0 +_080EC204: .4byte 0x03005d8c +_080EC208: .4byte 0x020375e0 +_080EC20C: .4byte 0x000027cc +_080EC210: .4byte 0x00002b90 +_080EC214: + ldrb r0, [r2] +_080EC216: + pop {r1} + bx r1 + thumb_func_end sub_80EC1D4 + + thumb_func_start sub_80EC21C +sub_80EC21C: @ 80EC21C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r3, _080EC300 + ldr r2, [r3] + ldr r1, _080EC304 + adds r0, r2, r1 + movs r4, 0 + mov r10, r4 + movs r1, 0 + strh r1, [r0] + ldr r4, _080EC308 + adds r0, r2, r4 + strh r1, [r0] + adds r4, 0x2 + adds r0, r2, r4 + strh r1, [r0] + ldr r0, _080EC30C + adds r1, r2, r0 + ldr r0, _080EC310 + strh r0, [r1] + adds r4, 0x6 + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + mov r8, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r6, 0x5 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r5, 0x9 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + ldr r2, _080EC314 + adds r0, r2 + ldrb r1, [r0] + mov r4, r9 + ands r4, r1 + strb r4, [r0] + ldr r0, [r3] + adds r0, r2 + ldrb r1, [r0] + mov r4, r8 + ands r4, r1 + strb r4, [r0] + ldr r0, [r3] + adds r0, r2 + ldrb r1, [r0] + ands r6, r1 + strb r6, [r0] + ldr r0, [r3] + adds r0, r2 + ldrb r1, [r0] + ands r5, r1 + strb r5, [r0] + ldr r1, [r3] + adds r1, r2 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + ldr r1, _080EC318 + adds r0, r1 + mov r4, r10 + strb r4, [r0] + ldr r0, [r3] + adds r1, 0x1 + adds r0, r1 + strb r4, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EC300: .4byte 0x03005d8c +_080EC304: .4byte 0x00002ba4 +_080EC308: .4byte 0x00002ba6 +_080EC30C: .4byte 0x00002baa +_080EC310: .4byte 0x0000ffff +_080EC314: .4byte 0x00002baf +_080EC318: .4byte 0x00002bac + thumb_func_end sub_80EC21C + + thumb_func_start sub_80EC31C +sub_80EC31C: @ 80EC31C + push {r4,lr} + ldr r3, _080EC384 + ldr r2, [r3] + ldr r0, _080EC388 + mov r12, r0 + ldrh r1, [r0, 0x6] + ldr r4, _080EC38C + adds r0, r2, r4 + strh r1, [r0] + mov r0, r12 + ldrh r1, [r0, 0x26] + adds r4, 0x2 + adds r0, r2, r4 + strh r1, [r0] + mov r0, r12 + ldrh r1, [r0, 0x22] + adds r4, 0x2 + adds r0, r2, r4 + strh r1, [r0] + ldr r0, _080EC390 + adds r2, r0 + ldrb r1, [r2] + adds r0, r1, 0 + adds r4, r3, 0 + cmp r0, 0xFF + beq _080EC354 + adds r0, r1, 0x1 + strb r0, [r2] +_080EC354: + ldr r2, [r4] + mov r0, r12 + ldrb r1, [r0, 0x5] + lsls r1, 31 + ldr r0, _080EC394 + adds r2, r0 + lsrs r1, 31 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + mov r1, r12 + ldrb r0, [r1] + cmp r0, 0 + beq _080EC398 + ldr r0, [r4] + ldr r1, _080EC394 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + b _080EC3A6 + .align 2, 0 +_080EC384: .4byte 0x03005d8c +_080EC388: .4byte 0x03005d10 +_080EC38C: .4byte 0x00002ba4 +_080EC390: .4byte 0x00002bad +_080EC394: .4byte 0x00002bae +_080EC398: + ldr r0, [r4] + ldr r1, _080EC3C0 + adds r0, r1 + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 +_080EC3A6: + strb r1, [r0] + mov r1, r12 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _080EC3C4 + ldr r0, [r4] + ldr r1, _080EC3C0 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _080EC3D2 + .align 2, 0 +_080EC3C0: .4byte 0x00002bae +_080EC3C4: + ldr r0, [r4] + ldr r1, _080EC40C + adds r0, r1 + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_080EC3D2: + strb r1, [r0] + mov r0, r12 + ldrb r1, [r0, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080EC410 + movs r1, 0 + mov r0, r12 + adds r0, 0x36 + ldrb r0, [r0] + cmp r0, 0 + bne _080EC410 +_080EC3EC: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bhi _080EC41E + mov r0, r12 + adds r0, 0x36 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _080EC3EC + ldr r0, [r4] + ldr r4, _080EC40C + adds r0, r4 + b _080EC416 + .align 2, 0 +_080EC40C: .4byte 0x00002bae +_080EC410: + ldr r0, [r4] + ldr r1, _080EC43C + adds r0, r1 +_080EC416: + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_080EC41E: + bl sub_80EC4E8 + ldr r0, _080EC440 + ldr r0, [r0] + ldr r4, _080EC444 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _080EC436 + movs r0, 0x1 + bl flag_set +_080EC436: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EC43C: .4byte 0x00002bae +_080EC440: .4byte 0x03005d8c +_080EC444: .4byte 0x00002ba8 + thumb_func_end sub_80EC31C + + thumb_func_start sub_80EC448 +sub_80EC448: @ 80EC448 + push {r4-r6,lr} + ldr r5, _080EC4D4 + ldr r2, [r5] + ldr r6, _080EC4D8 + adds r0, r2, r6 + ldrb r1, [r0] + lsls r1, 31 + ldr r4, _080EC4DC + adds r2, r4 + lsrs r1, 31 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + adds r0, r2, r6 + ldrb r0, [r0] + adds r2, r4 + movs r1, 0x2 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + adds r0, r2, r6 + ldrb r0, [r0] + adds r2, r4 + movs r1, 0x4 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + adds r0, r2, r6 + ldrb r0, [r0] + adds r2, r4 + movs r1, 0x8 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x9 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r5] + adds r1, r6 + ldrb r0, [r1] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r5] + ldr r1, _080EC4E0 + ldrb r1, [r1, 0x14] + ldr r2, _080EC4E4 + adds r0, r2 + strb r1, [r0] + movs r0, 0x6 + bl sav12_xor_increment + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EC4D4: .4byte 0x03005d8c +_080EC4D8: .4byte 0x00002bae +_080EC4DC: .4byte 0x00002baf +_080EC4E0: .4byte 0x02037318 +_080EC4E4: .4byte 0x00002bac + thumb_func_end sub_80EC448 + + thumb_func_start sub_80EC4E8 +sub_80EC4E8: @ 80EC4E8 + ldr r0, _080EC4FC + ldr r1, [r0] + ldr r0, _080EC500 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_080EC4FC: .4byte 0x03005d8c +_080EC500: .4byte 0x00002bae + thumb_func_end sub_80EC4E8 + + thumb_func_start sub_80EC504 +sub_80EC504: @ 80EC504 + push {lr} + ldr r0, _080EC528 + ldr r0, [r0] + ldr r2, _080EC52C + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x5 + bls _080EC522 + ldrb r0, [r1] + movs r1, 0x3 + bl __umodsi3 + adds r0, 0x6 + lsls r0, 24 + lsrs r0, 24 +_080EC522: + pop {r1} + bx r1 + .align 2, 0 +_080EC528: .4byte 0x03005d8c +_080EC52C: .4byte 0x00002bad + thumb_func_end sub_80EC504 + + thumb_func_start is_tile_XX_prevent_per_step_scripts +is_tile_XX_prevent_per_step_scripts: @ 80EC530 + ldr r0, _080EC540 + ldr r0, [r0] + ldr r1, _080EC544 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 31 + bx lr + .align 2, 0 +_080EC540: .4byte 0x03005d8c +_080EC544: .4byte 0x00002bae + thumb_func_end is_tile_XX_prevent_per_step_scripts + + thumb_func_start sub_80EC548 +sub_80EC548: @ 80EC548 + push {r4,r5,lr} + ldr r5, _080EC574 + ldr r0, [r5] + ldr r2, _080EC578 + adds r1, r0, r2 + ldrh r0, [r1] + ldr r4, _080EC57C + cmp r0, r4 + beq _080EC584 + ldr r0, _080EC580 + ldrh r1, [r1] + bl sub_811EBBC + ldr r1, [r5] + ldr r0, _080EC578 + adds r1, r0 + ldrh r2, [r1] + adds r0, r4, 0 + orrs r0, r2 + strh r0, [r1] + movs r0, 0x1 + b _080EC586 + .align 2, 0 +_080EC574: .4byte 0x03005d8c +_080EC578: .4byte 0x00002baa +_080EC57C: .4byte 0x0000ffff +_080EC580: .4byte 0x02021cc4 +_080EC584: + movs r0, 0 +_080EC586: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80EC548 + + thumb_func_start sub_80EC58C +sub_80EC58C: @ 80EC58C + push {lr} + ldr r0, _080EC5A4 + ldr r0, [r0] + ldr r1, _080EC5A8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080EC5AC + movs r0, 0x1 + b _080EC5D2 + .align 2, 0 +_080EC5A4: .4byte 0x03005d8c +_080EC5A8: .4byte 0x00002baf +_080EC5AC: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080EC5B8 + movs r0, 0x2 + b _080EC5D2 +_080EC5B8: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080EC5C4 + movs r0, 0x3 + b _080EC5D2 +_080EC5C4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080EC5D0 + movs r0, 0 + b _080EC5D2 +_080EC5D0: + movs r0, 0x4 +_080EC5D2: + pop {r1} + bx r1 + thumb_func_end sub_80EC58C + + thumb_func_start sub_80EC5D8 +sub_80EC5D8: @ 80EC5D8 + push {lr} + bl sub_80EC504 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x7 + bhi _080EC6B0 + lsls r0, 2 + ldr r1, _080EC5F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EC5F4: .4byte _080EC5F8 + .align 2, 0 +_080EC5F8: + .4byte _080EC618 + .4byte _080EC62C + .4byte _080EC640 + .4byte _080EC654 + .4byte _080EC668 + .4byte _080EC67C + .4byte _080EC690 + .4byte _080EC6A4 +_080EC618: + ldr r1, _080EC624 + movs r0, 0xE + strh r0, [r1] + ldr r1, _080EC628 + movs r0, 0xD + b _080EC6AE + .align 2, 0 +_080EC624: .4byte 0x020375e0 +_080EC628: .4byte 0x020375e2 +_080EC62C: + ldr r1, _080EC638 + movs r0, 0x5 + strh r0, [r1] + ldr r1, _080EC63C + movs r0, 0x6 + b _080EC6AE + .align 2, 0 +_080EC638: .4byte 0x020375e0 +_080EC63C: .4byte 0x020375e2 +_080EC640: + ldr r1, _080EC64C + movs r0, 0x12 + strh r0, [r1] + ldr r1, _080EC650 + movs r0, 0x11 + b _080EC6AE + .align 2, 0 +_080EC64C: .4byte 0x020375e0 +_080EC650: .4byte 0x020375e2 +_080EC654: + ldr r1, _080EC660 + movs r0, 0x15 + strh r0, [r1] + ldr r1, _080EC664 + movs r0, 0x16 + b _080EC6AE + .align 2, 0 +_080EC660: .4byte 0x020375e0 +_080EC664: .4byte 0x020375e2 +_080EC668: + ldr r1, _080EC674 + movs r0, 0x8 + strh r0, [r1] + ldr r1, _080EC678 + movs r0, 0x9 + b _080EC6AE + .align 2, 0 +_080EC674: .4byte 0x020375e0 +_080EC678: .4byte 0x020375e2 +_080EC67C: + ldr r1, _080EC688 + movs r0, 0x13 + strh r0, [r1] + ldr r1, _080EC68C + movs r0, 0x14 + b _080EC6AE + .align 2, 0 +_080EC688: .4byte 0x020375e0 +_080EC68C: .4byte 0x020375e2 +_080EC690: + ldr r1, _080EC69C + movs r0, 0x17 + strh r0, [r1] + ldr r1, _080EC6A0 + movs r0, 0x18 + b _080EC6AE + .align 2, 0 +_080EC69C: .4byte 0x020375e0 +_080EC6A0: .4byte 0x020375e2 +_080EC6A4: + ldr r1, _080EC6B4 + movs r0, 0xA + strh r0, [r1] + ldr r1, _080EC6B8 + movs r0, 0xB +_080EC6AE: + strh r0, [r1] +_080EC6B0: + pop {r0} + bx r0 + .align 2, 0 +_080EC6B4: .4byte 0x020375e0 +_080EC6B8: .4byte 0x020375e2 + thumb_func_end sub_80EC5D8 + + thumb_func_start sub_80EC6BC +sub_80EC6BC: @ 80EC6BC + push {lr} + ldr r0, _080EC6D4 + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0x7 + bhi _080EC724 + lsls r0, 2 + ldr r1, _080EC6D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EC6D4: .4byte 0x020375e2 +_080EC6D8: .4byte _080EC6DC + .align 2, 0 +_080EC6DC: + .4byte _080EC6FC + .4byte _080EC702 + .4byte _080EC708 + .4byte _080EC70E + .4byte _080EC724 + .4byte _080EC714 + .4byte _080EC71A + .4byte _080EC720 +_080EC6FC: + bl sub_80ED548 + b _080EC724 +_080EC702: + bl sub_80ED5B8 + b _080EC724 +_080EC708: + bl sub_80ED610 + b _080EC724 +_080EC70E: + bl nullsub_45 + b _080EC724 +_080EC714: + bl sub_80ECF5C + b _080EC724 +_080EC71A: + bl sub_80ED164 + b _080EC724 +_080EC720: + bl sub_80ECA38 +_080EC724: + pop {r0} + bx r0 + thumb_func_end sub_80EC6BC + + thumb_func_start sub_80EC728 +sub_80EC728: @ 80EC728 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + bl sub_80EED88 + bl sub_80ED718 + ldr r5, _080EC748 + ldrh r0, [r5, 0x28] + cmp r0, 0 + bne _080EC74C + bl sub_80EC8FC + b _080EC888 + .align 2, 0 +_080EC748: .4byte 0x03005d10 +_080EC74C: + bl sub_80EC8A4 + ldr r0, _080EC804 + bl sub_80EFB38 + lsls r0, 24 + cmp r0, 0 + beq _080EC75E + b _080EC888 +_080EC75E: + ldrh r1, [r5, 0x28] + movs r0, 0xB + muls r0, r1 + ldr r1, _080EC808 + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x2A + bl sub_8008C44 + cmp r0, 0 + bne _080EC776 + b _080EC888 +_080EC776: + ldr r0, _080EC80C + ldr r0, [r0] + ldr r1, _080EC810 + adds r0, r1 + bl sub_80EFB08 + ldr r1, _080EC814 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EC888 + movs r0, 0x15 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EC888 + movs r2, 0 + adds r1, r5, 0 + adds r1, 0x36 +_080EC7A8: + adds r0, r2, r1 + ldrb r0, [r0] + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _080EC7A8 + cmp r4, 0 + bne _080EC7CA + ldrb r1, [r5, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EC888 +_080EC7CA: + movs r4, 0 + ldr r2, _080EC80C + ldr r0, _080EC814 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EC810 + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + movs r0, 0x15 + strb r0, [r6] + strb r4, [r6, 0x1] + ldrb r1, [r5, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EC81C + movs r4, 0x1 + movs r0, 0x1 + adds r3, r6, 0 + adds r3, 0x13 + ldr r1, _080EC818 + mov r8, r1 + adds r7, r6, 0x4 + b _080EC84E + .align 2, 0 +_080EC804: .4byte 0x0000ffff +_080EC808: .4byte 0x083185c8 +_080EC80C: .4byte 0x03005d8c +_080EC810: .4byte 0x000027cc +_080EC814: .4byte 0x030060bc +_080EC818: .4byte 0x03005d90 +_080EC81C: + movs r2, 0 + ldr r0, _080EC894 + mov r12, r0 + adds r3, r6, 0 + adds r3, 0x13 + ldr r1, _080EC898 + mov r8, r1 + adds r7, r6, 0x4 + adds r1, r5, 0 + adds r1, 0x36 +_080EC830: + adds r0, r2, r1 + ldrb r0, [r0] + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _080EC830 + cmp r4, 0xFF + bls _080EC84A + movs r4, 0xFF +_080EC84A: + mov r1, r12 + ldrh r0, [r1] +_080EC84E: + strb r4, [r6, 0x12] + strb r0, [r6, 0xF] + mov r0, r8 + ldr r1, [r0] + adds r0, r3, 0 + bl gf_strcpy + ldr r4, _080EC89C + adds r0, r7, 0 + adds r1, r4, 0 + bl gf_strcpy + adds r0, r7, 0 + bl sub_81DB604 + adds r5, r0, 0 + adds r0, r7, 0 + bl sub_8009370 + subs r4, 0x2A + ldrh r0, [r4, 0x28] + strh r0, [r6, 0x10] + adds r0, r6, 0 + bl sub_80EC9E8 + ldr r0, _080EC8A0 + ldrb r0, [r0] + strb r0, [r6, 0x2] + strb r5, [r6, 0x3] +_080EC888: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EC894: .4byte 0x02024208 +_080EC898: .4byte 0x03005d90 +_080EC89C: .4byte 0x03005d3a +_080EC8A0: .4byte 0x082e9531 + thumb_func_end sub_80EC728 + + thumb_func_start sub_80EC8A4 +sub_80EC8A4: @ 80EC8A4 + push {r4,lr} + ldr r0, _080EC8E8 + ldr r1, [r0] + ldr r0, _080EC8EC + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0x19 + beq _080EC8CA + ldr r2, _080EC8F0 + adds r0, r1, r2 + movs r1, 0x18 + bl sub_80EF910 + movs r0, 0x5 + bl sub_80847F8 + strh r0, [r4, 0x6] + movs r0, 0x19 + strb r0, [r4] +_080EC8CA: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + ldr r1, _080EC8F4 + ldrh r0, [r1, 0x28] + strh r0, [r4, 0x4] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x8] + ldr r0, _080EC8F8 + ldrb r0, [r0, 0x14] + strb r0, [r4, 0xA] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EC8E8: .4byte 0x03005d8c +_080EC8EC: .4byte 0x00002b2c +_080EC8F0: .4byte 0x000027cc +_080EC8F4: .4byte 0x03005d10 +_080EC8F8: .4byte 0x02037318 + thumb_func_end sub_80EC8A4 + + thumb_func_start sub_80EC8FC +sub_80EC8FC: @ 80EC8FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080EC9C0 + bl sub_80EFB38 + lsls r0, 24 + cmp r0, 0 + bne _080EC9B4 + movs r1, 0 + movs r5, 0 + ldr r2, _080EC9C4 +_080EC914: + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bls _080EC914 + cmp r5, 0xFF + bls _080EC92E + movs r5, 0xFF +_080EC92E: + cmp r5, 0x2 + bls _080EC9B4 + ldr r0, _080EC9C8 + mov r8, r0 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080EC940 + cmp r0, 0x1 + bne _080EC9B4 +_080EC940: + ldr r7, _080EC9CC + ldr r0, [r7] + ldr r6, _080EC9D0 + adds r0, r6 + bl sub_80EFB08 + ldr r4, _080EC9D4 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EC9B4 + movs r0, 0x17 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EC9B4 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r4, [r7] + adds r4, r0 + movs r1, 0 + movs r0, 0x17 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r1, _080EC9D8 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x20] + strh r0, [r4, 0xE] + strb r5, [r4, 0x10] + mov r1, r8 + ldrb r0, [r1] + strb r0, [r4, 0x11] + ldr r0, _080EC9DC + ldrb r0, [r0, 0x14] + strb r0, [r4, 0x12] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EC9E0 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EC9E4 + ldrb r0, [r0] + strb r0, [r4, 0x2] +_080EC9B4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EC9C0: .4byte 0x0000ffff +_080EC9C4: .4byte 0x03005d46 +_080EC9C8: .4byte 0x0202433a +_080EC9CC: .4byte 0x03005d8c +_080EC9D0: .4byte 0x000027cc +_080EC9D4: .4byte 0x030060bc +_080EC9D8: .4byte 0x03005d10 +_080EC9DC: .4byte 0x02037318 +_080EC9E0: .4byte 0x03005d90 +_080EC9E4: .4byte 0x082e9531 + thumb_func_end sub_80EC8FC + + thumb_func_start sub_80EC9E8 +sub_80EC9E8: @ 80EC9E8 + push {r4,lr} + adds r4, r0, 0 + bl sub_80F0020 + strb r0, [r4, 0x1E] + lsrs r2, r0, 8 + strb r2, [r4, 0x1F] + adds r1, r4, 0 + adds r1, 0x20 + strb r0, [r1] + adds r1, 0x1 + strb r2, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x23 + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80EC9E8 + + thumb_func_start sub_80ECA10 +sub_80ECA10: @ 80ECA10 + push {r4,lr} + adds r4, r0, 0 + bl sub_80F0020 + adds r1, r4, 0 + adds r1, 0x20 + strb r0, [r1] + lsrs r1, r0, 8 + adds r2, r4, 0 + adds r2, 0x21 + strb r1, [r2] + adds r2, 0x1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x23 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80ECA10 + + thumb_func_start sub_80ECA38 +sub_80ECA38: @ 80ECA38 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080ECAD8 + mov r8, r0 + ldr r7, [r0] + ldr r1, _080ECADC + adds r6, r7, r1 + ldrb r1, [r6] + cmp r1, 0x8 + bne _080ECACE + ldr r0, _080ECAE0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r5, _080ECAE4 + adds r4, r5 + adds r4, r7, r4 + strb r1, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x14 + ldr r1, _080ECAE8 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _080ECAEC + ldrh r0, [r0] + strb r0, [r4, 0x1C] + ldr r0, _080ECAF0 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080ECAF4 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x12] + ldrh r0, [r6, 0x2] + strh r0, [r4, 0x2] + ldrb r0, [r6, 0xC] + strb r0, [r4, 0xC] + ldrb r0, [r6, 0xD] + strb r0, [r4, 0xD] + ldrb r0, [r6, 0xE] + strb r0, [r4, 0xE] + ldrh r0, [r6, 0x10] + strh r0, [r4, 0x10] + ldrb r0, [r6, 0xF] + strb r0, [r4, 0xF] + adds r0, r4, 0x4 + ldr r2, _080ECAF8 + adds r1, r7, r2 + bl gf_strcpy + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ECAFC + ldrb r0, [r0] + strb r0, [r4, 0x1D] + ldrb r0, [r6, 0x1E] + strb r0, [r4, 0x1E] + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + movs r1, 0x18 + bl sub_80EF910 +_080ECACE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ECAD8: .4byte 0x03005d8c +_080ECADC: .4byte 0x00002b2c +_080ECAE0: .4byte 0x030060bc +_080ECAE4: .4byte 0x000027cc +_080ECAE8: .4byte 0x03005d90 +_080ECAEC: .4byte 0x02039f2c +_080ECAF0: .4byte 0x02039f24 +_080ECAF4: .4byte 0x020244ec +_080ECAF8: .4byte 0x00002b30 +_080ECAFC: .4byte 0x082e9531 + thumb_func_end sub_80ECA38 + + thumb_func_start sub_80ECB00 +sub_80ECB00: @ 80ECB00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + ldr r6, _080ECB88 + ldr r0, [r6] + ldr r5, _080ECB8C + adds r0, r5 + bl sub_80EFADC + ldr r4, _080ECB90 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECBEC + movs r0, 0xA + bl sub_80EF550 + ldr r0, _080ECB94 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080ECBEC + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, [r6] + adds r4, r1, r0 + movs r0, 0xA + strb r0, [r4] + movs r5, 0x1 + strb r5, [r4, 0x1] + adds r0, r4, 0x4 + ldr r1, _080ECB98 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _080ECB9C + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080ECBA0 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080ECBA2 + strb r5, [r4, 0x18] + b _080ECBA4 + .align 2, 0 +_080ECB88: .4byte 0x03005d8c +_080ECB8C: .4byte 0x000027cc +_080ECB90: .4byte 0x030060bc +_080ECB94: .4byte 0x020375f0 +_080ECB98: .4byte 0x03005d90 +_080ECB9C: .4byte 0x02022fec +_080ECBA0: + movs r0, 0x2 +_080ECBA2: + strb r0, [r4, 0x18] +_080ECBA4: + mov r0, r10 + strh r0, [r4, 0x14] + mov r0, r9 + strh r0, [r4, 0x16] + mov r0, r8 + strh r0, [r4, 0x2] + lsls r0, r7, 3 + subs r0, r7 + lsls r5, r0, 2 + ldr r6, _080ECBFC + adds r1, r5, r6 + mov r0, sp + bl gf_strcpy + mov r0, sp + bl sub_8009370 + adds r0, r4, 0 + adds r0, 0xC + mov r1, sp + bl gf_strcpy + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ECC00 + ldrb r0, [r0] + strb r0, [r4, 0x19] + cmp r0, 0x1 + beq _080ECBE8 + adds r0, r6, r5 + ldrh r0, [r0, 0x12] + cmp r0, 0x1 + bne _080ECBEA +_080ECBE8: + movs r0, 0x1 +_080ECBEA: + strb r0, [r4, 0x1A] +_080ECBEC: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ECBFC: .4byte 0x020229f0 +_080ECC00: .4byte 0x082e9531 + thumb_func_end sub_80ECB00 + + thumb_func_start sub_80ECC04 +sub_80ECC04: @ 80ECC04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r10, r0 + ldr r0, [sp, 0x44] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _080ECC58 + mov r8, r0 + ldr r0, [r0] + ldr r7, _080ECC5C + adds r0, r7 + bl sub_80EFADC + ldr r4, _080ECC60 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECC54 + movs r0, 0x9 + bl sub_80EF550 + ldr r0, _080ECC64 + ldrh r0, [r0] + cmp r0, 0x1 + bne _080ECC68 +_080ECC54: + movs r0, 0 + b _080ECCEE + .align 2, 0 +_080ECC58: .4byte 0x03005d8c +_080ECC5C: .4byte 0x000027cc +_080ECC60: .4byte 0x030060bc +_080ECC64: .4byte 0x020375f0 +_080ECC68: + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r0 + movs r0, 0x9 + strb r0, [r4] + movs r7, 0x1 + strb r7, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0xC + ldr r1, _080ECCE0 + ldr r1, [r1] + bl gf_strcpy + mov r0, sp + mov r1, r10 + bl gf_strcpy + mov r0, sp + bl sub_8009370 + adds r0, r4, 0x4 + mov r1, sp + bl gf_strcpy + movs r0, 0x7 + ands r5, r0 + ldrb r1, [r4, 0x3] + subs r0, 0xF + ands r0, r1 + orrs r0, r5 + movs r1, 0x3 + ands r6, r1 + lsls r2, r6, 3 + subs r1, 0x1C + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + add r0, sp, 0x20 + ldrb r0, [r0] + strb r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ECCE4 + ldrb r0, [r0] + strb r0, [r4, 0x14] + cmp r0, 0x1 + beq _080ECCDA + mov r1, r9 + cmp r1, 0x1 + bne _080ECCE8 +_080ECCDA: + strb r7, [r4, 0x15] + b _080ECCEC + .align 2, 0 +_080ECCE0: .4byte 0x03005d90 +_080ECCE4: .4byte 0x082e9531 +_080ECCE8: + mov r2, r9 + strb r2, [r4, 0x15] +_080ECCEC: + movs r0, 0x1 +_080ECCEE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ECC04 + + thumb_func_start sub_80ECD00 +sub_80ECD00: @ 80ECD00 + push {r4-r6,lr} + sub sp, 0x20 + ldr r6, _080ECD78 + ldr r0, _080ECD7C + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ECD80 + adds r0, r1 + ldr r1, [r6] + adds r4, r1, r0 + ldr r0, _080ECD84 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + strb r0, [r4, 0x16] + adds r0, r4, 0x2 + ldr r1, _080ECD88 + ldr r1, [r1] + bl gf_strcpy + movs r0, 0xB + strb r0, [r4] + movs r5, 0x1 + strb r5, [r4, 0x1] + bl sub_80F0020 + strb r0, [r4, 0xA] + lsrs r0, 8 + strb r0, [r4, 0xB] + ldr r1, _080ECD8C + mov r0, sp + bl gf_strcpy + mov r0, sp + bl sub_8009370 + adds r0, r4, 0 + adds r0, 0xC + mov r1, sp + bl gf_strcpy + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ECD90 + ldrb r0, [r0] + strb r0, [r4, 0x17] + cmp r0, 0x1 + beq _080ECD74 + ldr r0, [r6] + ldr r1, _080ECD94 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080ECD98 +_080ECD74: + strb r5, [r4, 0x18] + b _080ECD9A + .align 2, 0 +_080ECD78: .4byte 0x03005d8c +_080ECD7C: .4byte 0x020375e4 +_080ECD80: .4byte 0x000027cc +_080ECD84: .4byte 0x020375e2 +_080ECD88: .4byte 0x03005d90 +_080ECD8C: .4byte 0x02021cc4 +_080ECD90: .4byte 0x082e9531 +_080ECD94: .4byte 0x000031a0 +_080ECD98: + strb r0, [r4, 0x18] +_080ECD9A: + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80ECD00 + + thumb_func_start sub_80ECDA4 +sub_80ECDA4: @ 80ECDA4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _080ECDE4 + ldr r0, [r5] + ldr r4, _080ECDE8 + adds r0, r4 + movs r1, 0x18 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EFADC + ldr r1, _080ECDEC + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECDDC + ldr r0, [r5] + ldr r1, _080ECDF0 + adds r0, r1 + strb r6, [r0, 0xD] + movs r1, 0x8 + strb r1, [r0] +_080ECDDC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ECDE4: .4byte 0x03005d8c +_080ECDE8: .4byte 0x000027cc +_080ECDEC: .4byte 0x030060bc +_080ECDF0: .4byte 0x00002b2c + thumb_func_end sub_80ECDA4 + + thumb_func_start sub_80ECDF4 +sub_80ECDF4: @ 80ECDF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080ECE24 + ldr r0, [r0] + ldr r1, _080ECE28 + adds r4, r0, r1 + ldr r1, _080ECE2C + adds r0, r1 + bl sub_80EFADC + ldr r1, _080ECE30 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECE1C + strb r5, [r4, 0xE] +_080ECE1C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ECE24: .4byte 0x03005d8c +_080ECE28: .4byte 0x00002b2c +_080ECE2C: .4byte 0x000027cc +_080ECE30: .4byte 0x030060bc + thumb_func_end sub_80ECDF4 + + thumb_func_start sub_80ECE34 +sub_80ECE34: @ 80ECE34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080ECE64 + ldr r0, [r0] + ldr r1, _080ECE68 + adds r4, r0, r1 + ldr r1, _080ECE6C + adds r0, r1 + bl sub_80EFADC + ldr r1, _080ECE70 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECE5C + strb r5, [r4, 0xF] +_080ECE5C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ECE64: .4byte 0x03005d8c +_080ECE68: .4byte 0x00002b2c +_080ECE6C: .4byte 0x000027cc +_080ECE70: .4byte 0x030060bc + thumb_func_end sub_80ECE34 + + thumb_func_start sub_80ECE74 +sub_80ECE74: @ 80ECE74 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _080ECEA4 + ldr r0, [r0] + ldr r1, _080ECEA8 + adds r4, r0, r1 + ldr r1, _080ECEAC + adds r0, r1 + bl sub_80EFADC + ldr r1, _080ECEB0 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECE9C + strh r5, [r4, 0x10] +_080ECE9C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ECEA4: .4byte 0x03005d8c +_080ECEA8: .4byte 0x00002b2c +_080ECEAC: .4byte 0x000027cc +_080ECEB0: .4byte 0x030060bc + thumb_func_end sub_80ECE74 + + thumb_func_start sub_80ECEB4 +sub_80ECEB4: @ 80ECEB4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, _080ECF10 + ldr r4, [r0] + ldr r0, _080ECF14 + adds r5, r4, r0 + ldr r1, _080ECF18 + adds r0, r4, r1 + bl sub_80EFADC + ldr r1, _080ECF1C + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECF4C + ldr r2, _080ECF20 + lsls r1, r6, 6 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r5, 0x2] + ldr r0, _080ECF24 + adds r4, r0 + adds r2, 0xD + adds r1, r2 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + bl sub_8009370 + strb r7, [r5, 0xC] + adds r1, r6, 0x1 + ldr r0, _080ECF28 + ldrb r0, [r0] + cmp r1, r0 + ble _080ECF30 + ldr r0, _080ECF2C + ldrh r0, [r0, 0x1A] + b _080ECF4A + .align 2, 0 +_080ECF10: .4byte 0x03005d8c +_080ECF14: .4byte 0x00002b2c +_080ECF18: .4byte 0x000027cc +_080ECF1C: .4byte 0x030060bc +_080ECF20: .4byte 0x02039e00 +_080ECF24: .4byte 0x00002b30 +_080ECF28: .4byte 0x02039f30 +_080ECF2C: .4byte 0x020229e8 +_080ECF30: + ldr r0, _080ECF54 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080ECF48 + ldr r1, _080ECF58 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x1A] + cmp r0, 0x1 + bne _080ECF4A +_080ECF48: + movs r0, 0x1 +_080ECF4A: + strb r0, [r5, 0x1E] +_080ECF4C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ECF54: .4byte 0x082e9531 +_080ECF58: .4byte 0x020229e8 + thumb_func_end sub_80ECEB4 + + thumb_func_start sub_80ECF5C +sub_80ECF5C: @ 80ECF5C + push {r4-r7,lr} + ldr r0, _080ED000 + ldr r6, [r0] + ldr r0, _080ED004 + adds r5, r6, r0 + ldrb r2, [r5] + cmp r2, 0x6 + bne _080ED02C + ldr r0, _080ED008 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED00C + adds r0, r1 + adds r4, r6, r0 + strb r2, [r4] + movs r7, 0x1 + strb r7, [r4, 0x1] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + adds r0, r4, 0 + adds r0, 0x16 + ldr r1, _080ED010 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + adds r0, 0x8 + ldr r2, _080ED014 + adds r1, r6, r2 + bl gf_strcpy + ldrb r0, [r5, 0x13] + lsls r0, 29 + lsrs r0, 29 + ldrb r2, [r4, 0x13] + movs r3, 0x8 + negs r3, r3 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x13] + ldrb r2, [r5, 0x13] + movs r0, 0x18 + ands r0, r2 + movs r2, 0x19 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0x13] + ldrh r0, [r5, 0x14] + strh r0, [r4, 0x14] + ldrb r0, [r5, 0x13] + movs r1, 0x60 + ands r1, r0 + movs r0, 0x61 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x13] + ldrb r1, [r5, 0x13] + lsls r1, 29 + lsrs r1, 29 + ands r0, r3 + orrs r0, r1 + strb r0, [r4, 0x13] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ED018 + ldrb r0, [r0] + strb r0, [r4, 0x1E] + cmp r0, 0x1 + beq _080ECFFA + ldrb r0, [r5, 0x1F] + cmp r0, 0x1 + bne _080ED01C +_080ECFFA: + strb r7, [r4, 0x1F] + b _080ED01E + .align 2, 0 +_080ED000: .4byte 0x03005d8c +_080ED004: .4byte 0x00002b2c +_080ED008: .4byte 0x030060bc +_080ED00C: .4byte 0x000027cc +_080ED010: .4byte 0x03005d90 +_080ED014: .4byte 0x00002b34 +_080ED018: .4byte 0x082e9531 +_080ED01C: + strb r0, [r4, 0x1F] +_080ED01E: + ldr r0, _080ED034 + ldr r0, [r0] + ldr r1, _080ED038 + adds r0, r1 + movs r1, 0x18 + bl sub_80EF910 +_080ED02C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ED034: .4byte 0x03005d8c +_080ED038: .4byte 0x000027cc + thumb_func_end sub_80ECF5C + + thumb_func_start sub_80ED03C +sub_80ED03C: @ 80ED03C + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, _080ED080 + ldr r0, [r4] + ldr r1, _080ED084 + adds r5, r0, r1 + bl sub_80EF7B4 + ldr r0, [r4] + ldr r1, _080ED088 + adds r0, r1 + bl sub_80EFADC + ldr r1, _080ED08C + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED07A + ldr r0, [r4] + ldr r1, _080ED088 + adds r0, r1 + movs r1, 0x18 + bl sub_80EF910 + strh r6, [r5, 0x14] + movs r0, 0x6 + strb r0, [r5] +_080ED07A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ED080: .4byte 0x03005d8c +_080ED084: .4byte 0x00002b2c +_080ED088: .4byte 0x000027cc +_080ED08C: .4byte 0x030060bc + thumb_func_end sub_80ED03C + + thumb_func_start sub_80ED090 +sub_80ED090: @ 80ED090 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080ED140 + ldr r4, [r0] + ldr r0, _080ED144 + adds r7, r4, r0 + ldr r1, _080ED148 + adds r0, r4, r1 + bl sub_80EFADC + ldr r1, _080ED14C + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED134 + movs r3, 0x3 + adds r0, r5, 0 + ands r0, r3 + lsls r0, 5 + ldrb r1, [r7, 0x13] + movs r2, 0x61 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r7, 0x13] + ldr r0, _080ED150 + ldrb r0, [r0] + movs r1, 0x7 + ands r1, r0 + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x13] + ldr r1, _080ED154 + ldrb r1, [r1] + ands r3, r1 + lsls r3, 3 + movs r1, 0x19 + negs r1, r1 + ands r0, r1 + orrs r0, r3 + strb r0, [r7, 0x13] + ldr r0, _080ED158 + mov r8, r0 + ldrb r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080ED15C + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x2] + mov r1, r8 + ldrb r0, [r1] + muls r0, r6 + adds r0, r5 + ldr r1, _080ED160 + adds r4, r1 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl sub_8009370 + mov r1, r8 + ldrb r0, [r1] + muls r0, r6 + adds r0, r5 + movs r1, 0x3 + bl pokemon_getattr + strb r0, [r7, 0x1F] +_080ED134: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ED140: .4byte 0x03005d8c +_080ED144: .4byte 0x00002b2c +_080ED148: .4byte 0x000027cc +_080ED14C: .4byte 0x030060bc +_080ED150: .4byte 0x02039f2c +_080ED154: .4byte 0x02039f2e +_080ED158: .4byte 0x02039f24 +_080ED15C: .4byte 0x020244ec +_080ED160: .4byte 0x00002b34 + thumb_func_end sub_80ED090 + + thumb_func_start sub_80ED164 +sub_80ED164: @ 80ED164 + push {r4-r6,lr} + ldr r2, _080ED1D4 + ldr r0, _080ED1D8 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED1DC + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + movs r0, 0x7 + strb r0, [r6] + movs r0, 0x1 + strb r0, [r6, 0x1] + adds r0, r6, 0x2 + ldr r4, _080ED1E0 + ldr r1, [r4] + bl gf_strcpy + adds r0, r6, 0 + adds r0, 0xC + ldr r1, [r4] + ldr r2, _080ED1E4 + adds r1, r2 + bl gf_strcpy + ldr r1, [r4] + ldr r2, _080ED1E8 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r6, 0xA] + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r6, 0x14] + ldr r5, _080ED1EC + adds r1, r5 + ldrb r0, [r1] + movs r1, 0 + bl sub_8164FCC + strh r0, [r6, 0x16] + ldr r0, [r4] + ldr r1, _080ED1F0 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6, 0x1C] + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080ED1F4 + movs r0, 0x32 + b _080ED1F6 + .align 2, 0 +_080ED1D4: .4byte 0x03005d8c +_080ED1D8: .4byte 0x030060bc +_080ED1DC: .4byte 0x000027cc +_080ED1E0: .4byte 0x03005d90 +_080ED1E4: .4byte 0x00000bd8 +_080ED1E8: .4byte 0x00000bd4 +_080ED1EC: .4byte 0x00000d07 +_080ED1F0: .4byte 0x00000d06 +_080ED1F4: + movs r0, 0x64 +_080ED1F6: + strb r0, [r6, 0x1A] + ldr r0, _080ED228 + ldrh r0, [r0] + strb r0, [r6, 0x1B] + adds r0, r6, 0 + bl sub_80ECA10 + ldr r0, _080ED22C + ldrb r0, [r0] + strb r0, [r6, 0x1D] + cmp r0, 0x1 + beq _080ED21C + ldr r0, _080ED230 + ldr r0, [r0] + ldr r2, _080ED234 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080ED21E +_080ED21C: + movs r0, 0x1 +_080ED21E: + strb r0, [r6, 0x1E] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ED228: .4byte 0x020375e0 +_080ED22C: .4byte 0x082e9531 +_080ED230: .4byte 0x03005d90 +_080ED234: .4byte 0x00000beb + thumb_func_end sub_80ED164 + + thumb_func_start sub_80ED238 +sub_80ED238: @ 80ED238 + push {r4-r7,lr} + ldr r5, _080ED2F8 + ldr r0, [r5] + ldrh r1, [r0, 0x4] + ldr r0, _080ED2FC + cmp r1, r0 + beq _080ED2F2 + ldr r0, _080ED300 + cmp r1, r0 + beq _080ED2F2 + ldr r0, _080ED304 + bl sub_80EFB38 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080ED2F2 + ldr r0, [r5] + ldr r7, _080ED308 + adds r0, r7 + bl sub_80EFB08 + ldr r6, _080ED30C + strb r0, [r6] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED2F2 + movs r0, 0x16 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080ED2F2 + bl sub_80EF500 + ldr r2, _080ED310 + ldrh r0, [r2, 0x2] + cmp r0, 0x13 + bls _080ED2F2 + movs r1, 0 + ldrsb r1, [r6, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, [r5] + adds r5, r1, r0 + movs r0, 0x16 + strb r0, [r5] + strb r4, [r5, 0x1] + ldr r0, _080ED314 + ldrb r0, [r0, 0x14] + strb r0, [r5, 0x12] + movs r4, 0 + adds r7, r5, 0x6 + mov r12, r2 + adds r6, r5, 0 + adds r6, 0xC +_080ED2B6: + lsls r2, r4, 1 + adds r3, r7, r2 + lsls r1, r4, 2 + add r1, r12 + ldrh r0, [r1] + strh r0, [r3] + adds r2, r6, r2 + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080ED2B6 + movs r0, 0x1 + bl sub_80EF038 + strb r0, [r5, 0x2] + adds r0, r5, 0 + adds r0, 0x13 + ldr r1, _080ED318 + ldr r1, [r1] + bl gf_strcpy + adds r0, r5, 0 + bl sub_80EC9E8 + ldr r0, _080ED31C + ldrb r0, [r0] + strb r0, [r5, 0x3] +_080ED2F2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ED2F8: .4byte 0x03005d8c +_080ED2FC: .4byte 0x00003c1a +_080ED300: .4byte 0x0000371a +_080ED304: .4byte 0x00005555 +_080ED308: .4byte 0x000027cc +_080ED30C: .4byte 0x030060bc +_080ED310: .4byte 0x02039f80 +_080ED314: .4byte 0x02037318 +_080ED318: .4byte 0x03005d90 +_080ED31C: .4byte 0x082e9531 + thumb_func_end sub_80ED238 + + thumb_func_start sub_80ED320 +sub_80ED320: @ 80ED320 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + bl sub_80EF7A8 + ldr r0, _080ED40C + ldrh r0, [r0] + cmp r0, 0x1 + beq _080ED400 + ldr r0, _080ED410 + mov r8, r0 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r6, _080ED414 + adds r0, r6 + ldr r4, _080ED418 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + ldr r1, _080ED41C + mov r9, r1 + ldr r0, [r1] + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080ED400 + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080ED400 + ldr r2, _080ED420 + ldr r0, _080ED424 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED428 + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r0, 0x5 + strb r0, [r4] + movs r5, 0x1 + strb r5, [r4, 0x1] + mov r2, r8 + ldrh r0, [r2] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + strb r0, [r4, 0x1A] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ands r0, r5 + strb r0, [r4, 0x1B] + ldrh r0, [r4, 0x2] + bl sub_80EFA24 + strh r0, [r4, 0x1C] + adds r0, r4, 0 + adds r0, 0xF + mov r2, r9 + ldr r1, [r2] + bl gf_strcpy + mov r1, r8 + ldrh r0, [r1] + muls r0, r7 + adds r0, r6 + adds r5, r4, 0x4 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr + adds r0, r5, 0 + bl sub_8009370 + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ED42C + ldrb r0, [r0] + strb r0, [r4, 0x1E] + mov r2, r8 + ldrh r0, [r2] + muls r0, r7 + adds r0, r6 + movs r1, 0x3 + bl pokemon_getattr + strb r0, [r4, 0x1F] +_080ED400: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ED40C: .4byte 0x020375f0 +_080ED410: .4byte 0x020375e0 +_080ED414: .4byte 0x020244ec +_080ED418: .4byte 0x02021cc4 +_080ED41C: .4byte 0x03005d90 +_080ED420: .4byte 0x03005d8c +_080ED424: .4byte 0x030060bc +_080ED428: .4byte 0x000027cc +_080ED42C: .4byte 0x082e9531 + thumb_func_end sub_80ED320 + + thumb_func_start sub_80ED430 +sub_80ED430: @ 80ED430 + push {r4,r5,lr} + ldr r4, _080ED4C0 + ldr r0, _080ED4C4 + ldrh r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _080ED4C8 + adds r1, r0 + ldr r2, [r4] + adds r1, r2, r1 + ldrh r3, [r1, 0xC] + ldr r5, _080ED4CC + adds r0, r2, r5 + strh r3, [r0] + ldrb r0, [r1, 0x10] + ldr r3, _080ED4D0 + adds r2, r3 + strb r0, [r2] + ldr r0, [r4] + ldrb r2, [r1, 0x11] + adds r5, 0x3 + adds r0, r5 + strb r2, [r0] + ldr r0, [r4] + ldrb r2, [r1, 0x14] + adds r3, 0x2 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + ldrb r2, [r1, 0x2] + adds r5, 0x2 + adds r0, r5 + strb r2, [r0] + ldr r2, [r4] + ldrh r3, [r1, 0xE] + adds r5, 0x1 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0x4] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0x6] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0x8] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0xA] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrb r0, [r1, 0x3] + ldr r3, _080ED4D4 + adds r2, r3 + strb r0, [r2] + ldr r0, [r4] + ldrb r1, [r1, 0x13] + adds r5, 0x3 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080ED4D8 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ED4C0: .4byte 0x03005d8c +_080ED4C4: .4byte 0x020375e0 +_080ED4C8: .4byte 0x000027cc +_080ED4CC: .4byte 0x00002b90 +_080ED4D0: .4byte 0x00002b92 +_080ED4D4: .4byte 0x00002ba0 +_080ED4D8: .4byte 0x00002ba2 + thumb_func_end sub_80ED430 + + thumb_func_start sub_80ED4DC +sub_80ED4DC: @ 80ED4DC + push {r4,lr} + bl sub_80EFA88 + ldr r0, _080ED538 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080ED532 + ldr r2, _080ED53C + ldr r0, _080ED540 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED544 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0x17 + bl sub_818E848 + movs r0, 0x2 + strb r0, [r4, 0x18] + movs r0, 0xC + strb r0, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + adds r0, r4, 0x2 + bl sub_818E81C + adds r0, r4, 0 + adds r0, 0xA + adds r1, r4, 0 + adds r1, 0xB + bl sub_818E7E0 + bl sub_818E880 + strb r0, [r4, 0x16] + adds r0, r4, 0 + bl sub_80ECA10 +_080ED532: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ED538: .4byte 0x020375f0 +_080ED53C: .4byte 0x03005d8c +_080ED540: .4byte 0x030060bc +_080ED544: .4byte 0x000027cc + thumb_func_end sub_80ED4DC + + thumb_func_start sub_80ED548 +sub_80ED548: @ 80ED548 + push {r4,lr} + ldr r2, _080ED5A0 + ldr r0, _080ED5A4 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED5A8 + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r0, 0x1 + strb r0, [r4] + strb r0, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x10 + ldr r1, _080ED5AC + ldr r1, [r1] + bl gf_strcpy + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _080ED5B0 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ED5B4 + ldrb r0, [r0] + strb r0, [r4, 0x18] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ED5A0: .4byte 0x03005d8c +_080ED5A4: .4byte 0x030060bc +_080ED5A8: .4byte 0x000027cc +_080ED5AC: .4byte 0x03005d90 +_080ED5B0: .4byte 0x020244ec +_080ED5B4: .4byte 0x082e9531 + thumb_func_end sub_80ED548 + + thumb_func_start sub_80ED5B8 +sub_80ED5B8: @ 80ED5B8 + push {r4,r5,lr} + ldr r2, _080ED5FC + ldr r0, _080ED600 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED604 + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r5, 0 + movs r0, 0x2 + strb r0, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x10 + ldr r1, _080ED608 + ldr r1, [r1] + bl gf_strcpy + strh r5, [r4, 0x2] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ED60C + ldrb r0, [r0] + strb r0, [r4, 0x18] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ED5FC: .4byte 0x03005d8c +_080ED600: .4byte 0x030060bc +_080ED604: .4byte 0x000027cc +_080ED608: .4byte 0x03005d90 +_080ED60C: .4byte 0x082e9531 + thumb_func_end sub_80ED5B8 + + thumb_func_start sub_80ED610 +sub_80ED610: @ 80ED610 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, _080ED6D8 + ldr r0, _080ED6DC + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080ED6E0 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x1 + mov r8, r0 + mov r1, r8 + strb r1, [r5, 0x1] + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, _080ED6E4 + adds r0, r6 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + lsrs r0, 4 + movs r1, 0xF + ands r0, r1 + ldrb r2, [r5, 0x4] + movs r1, 0x10 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x4] + ldr r0, _080ED6E8 + ldrb r0, [r0] + lsls r0, 4 + movs r2, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x4] + adds r0, r5, 0x5 + ldr r1, _080ED6EC + ldr r1, [r1] + bl gf_strcpy + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + adds r4, r5, 0 + adds r4, 0x10 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl sub_8009370 + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r5, 0x2] + adds r0, r5, 0 + bl sub_80ECA10 + ldr r0, _080ED6F0 + ldrb r0, [r0] + strb r0, [r5, 0xD] + cmp r0, 0x1 + beq _080ED6D4 + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + bne _080ED6F4 +_080ED6D4: + mov r0, r8 + b _080ED706 + .align 2, 0 +_080ED6D8: .4byte 0x03005d8c +_080ED6DC: .4byte 0x030060bc +_080ED6E0: .4byte 0x000027cc +_080ED6E4: .4byte 0x020244ec +_080ED6E8: .4byte 0x020375e6 +_080ED6EC: .4byte 0x03005d90 +_080ED6F0: .4byte 0x082e9531 +_080ED6F4: + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + movs r1, 0x3 + bl pokemon_getattr +_080ED706: + strb r0, [r5, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80ED610 + + thumb_func_start nullsub_45 +nullsub_45: @ 80ED714 + bx lr + thumb_func_end nullsub_45 + + thumb_func_start sub_80ED718 +sub_80ED718: @ 80ED718 + push {r4-r6,lr} + ldr r0, _080ED7EC + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080ED7E4 + movs r1, 0 + ldr r0, _080ED7F0 + ldr r2, [r0] + ldr r3, _080ED7F4 +_080ED72E: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2, r0 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x29 + beq _080ED7E4 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x17 + bls _080ED72E + ldr r0, _080ED7F8 + bl sub_80EFB38 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080ED7E4 + ldr r6, _080ED7F0 + ldr r0, [r6] + ldr r1, _080ED7F4 + adds r0, r1 + bl sub_80EFADC + ldr r4, _080ED7FC + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED7E4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r2, 0 + ldrsb r2, [r4, r2] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + ldr r2, _080ED7F4 + adds r1, r2 + ldr r4, [r6] + adds r4, r1 + movs r1, 0x29 + strb r1, [r4] + movs r3, 0x1 + strb r3, [r4, 0x1] + ldr r2, _080ED800 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0xA] + strb r0, [r4, 0x14] + strb r5, [r4, 0x2] + strb r5, [r4, 0x3] + ldrh r0, [r1] + movs r2, 0 + strh r0, [r4, 0xC] + strh r5, [r4, 0xE] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x4] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x6] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x8] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0xA] + ldrb r0, [r1, 0xB] + strb r0, [r4, 0x10] + strb r2, [r4, 0x11] + strb r2, [r4, 0x12] + movs r0, 0x32 + strb r0, [r4, 0x13] + strb r2, [r4, 0x15] + strh r3, [r4, 0x16] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, _080ED804 + ldrb r0, [r0] + strb r0, [r4, 0x18] +_080ED7E4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ED7EC: .4byte 0x00000864 +_080ED7F0: .4byte 0x03005d8c +_080ED7F4: .4byte 0x000027cc +_080ED7F8: .4byte 0x00000147 +_080ED7FC: .4byte 0x030060bc +_080ED800: .4byte 0x0858d094 +_080ED804: .4byte 0x082e9531 + thumb_func_end sub_80ED718 + + thumb_func_start sub_80ED808 +sub_80ED808: @ 80ED808 + push {r4,r5,lr} + ldr r3, _080ED874 + ldr r0, [r3] + ldr r2, _080ED878 + adds r1, r0, r2 + movs r4, 0 + movs r2, 0 + strh r2, [r1] + ldr r5, _080ED87C + adds r0, r5 + strb r4, [r0] + ldr r0, [r3] + ldr r1, _080ED880 + adds r0, r1 + strb r4, [r0] + ldr r0, [r3] + adds r5, 0x2 + adds r0, r5 + strb r4, [r0] + ldr r0, [r3] + adds r1, 0x2 + adds r0, r1 + strb r4, [r0] + ldr r0, [r3] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + ldr r1, _080ED884 + adds r0, r1 + strb r4, [r0] + ldr r0, [r3] + adds r5, 0x3 + adds r0, r5 + strb r4, [r0] + ldr r0, [r3] + adds r1, 0x2 + adds r0, r1 + strh r2, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ED874: .4byte 0x03005d8c +_080ED878: .4byte 0x00002b90 +_080ED87C: .4byte 0x00002b92 +_080ED880: .4byte 0x00002b93 +_080ED884: .4byte 0x00002ba0 + thumb_func_end sub_80ED808 + + thumb_func_start sub_80ED888 +sub_80ED888: @ 80ED888 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80ED8B4 + adds r0, r4, 0 + bl sub_80ED924 + adds r0, r4, 0 + bl sub_80EF120 + adds r0, r4, 0 + bl sub_80EDA48 + adds r0, r4, 0 + bl sub_80EEB98 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80ED888 + + thumb_func_start sub_80ED8B4 +sub_80ED8B4: @ 80ED8B4 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _080ED8FC + ldr r0, [r1] + ldr r2, _080ED900 + adds r0, r2 + ldrh r0, [r0] + mov r12, r1 + cmp r0, 0 + bne _080ED91C + movs r1, 0 + ldr r6, _080ED904 +_080ED8CE: + mov r7, r12 + ldr r4, [r7] + lsls r0, r1, 3 + adds r0, r1 + lsls r3, r0, 2 + adds r2, r4, r3 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0x29 + bne _080ED912 + ldr r7, _080ED908 + adds r0, r2, r7 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080ED912 + adds r0, r3, r6 + adds r1, r4, r0 + ldrh r0, [r1, 0x16] + cmp r0, r5 + bcs _080ED90C + movs r0, 0 + strh r0, [r1, 0x16] + b _080ED91C + .align 2, 0 +_080ED8FC: .4byte 0x03005d8c +_080ED900: .4byte 0x00002b90 +_080ED904: .4byte 0x000027cc +_080ED908: .4byte 0x000027cd +_080ED90C: + subs r0, r5 + strh r0, [r1, 0x16] + b _080ED91C +_080ED912: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x17 + bls _080ED8CE +_080ED91C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80ED8B4 + + thumb_func_start sub_80ED924 +sub_80ED924: @ 80ED924 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _080ED940 + ldr r0, [r0] + ldr r3, _080ED944 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r2 + bhi _080ED948 + bl sub_80ED808 + b _080ED94C + .align 2, 0 +_080ED940: .4byte 0x03005d8c +_080ED944: .4byte 0x00002ba2 +_080ED948: + subs r0, r2 + strh r0, [r1] +_080ED94C: + pop {r0} + bx r0 + thumb_func_end sub_80ED924 + + thumb_func_start sub_80ED950 +sub_80ED950: @ 80ED950 + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + beq _080ED978 + ldr r4, _080ED974 + ldrh r0, [r4] + lsrs r0, 8 + cmp r0, 0x4 + bls _080ED966 + bl sub_80ED9A8 +_080ED966: + ldrb r0, [r4] + strh r0, [r4] + cmp r0, 0xFF + beq _080ED99C + adds r0, 0x1 + b _080ED99A + .align 2, 0 +_080ED974: .4byte 0x0203a026 +_080ED978: + ldr r4, _080ED9A4 + ldrb r0, [r4] + cmp r0, 0x4 + bls _080ED984 + bl sub_80ED9A8 +_080ED984: + ldrh r0, [r4] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + strh r1, [r4] + lsrs r0, r1, 8 + cmp r0, 0xFF + beq _080ED99C + movs r2, 0x80 + lsls r2, 1 + adds r0, r1, r2 +_080ED99A: + strh r0, [r4] +_080ED99C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ED9A4: .4byte 0x0203a026 + thumb_func_end sub_80ED950 + + thumb_func_start sub_80ED9A8 +sub_80ED9A8: @ 80ED9A8 + push {r4-r6,lr} + ldr r6, _080EDA20 + ldr r0, [r6] + ldr r5, _080EDA24 + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EDA28 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDA18 + movs r0, 0x18 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDA18 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x18 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r1, _080EDA2C + ldrh r0, [r1] + strb r0, [r4, 0x2] + ldrh r0, [r1] + lsrs r0, 8 + strb r0, [r4, 0x3] + ldr r0, _080EDA30 + ldrh r0, [r0] + strh r0, [r4, 0x4] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EDA34 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EDA38 + ldrb r0, [r0] + strb r0, [r4, 0x6] +_080EDA18: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EDA20: .4byte 0x03005d8c +_080EDA24: .4byte 0x000027cc +_080EDA28: .4byte 0x030060bc +_080EDA2C: .4byte 0x0203a026 +_080EDA30: .4byte 0x0203a024 +_080EDA34: .4byte 0x03005d90 +_080EDA38: .4byte 0x082e9531 + thumb_func_end sub_80ED9A8 + + thumb_func_start sub_80EDA3C +sub_80EDA3C: @ 80EDA3C + ldr r1, _080EDA44 + strh r0, [r1] + bx lr + .align 2, 0 +_080EDA44: .4byte 0x0203a024 + thumb_func_end sub_80EDA3C + + thumb_func_start sub_80EDA48 +sub_80EDA48: @ 80EDA48 + push {r4,lr} + ldr r4, _080EDA74 + ldr r0, [r4] + ldr r2, _080EDA78 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x19 + bne _080EDA6E + ldrh r0, [r1, 0x2] + cmp r0, 0x13 + bls _080EDA62 + bl sub_80EDA80 +_080EDA62: + ldr r0, [r4] + ldr r1, _080EDA7C + adds r0, r1 + movs r1, 0x18 + bl sub_80EF910 +_080EDA6E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EDA74: .4byte 0x03005d8c +_080EDA78: .4byte 0x00002b2c +_080EDA7C: .4byte 0x000027cc + thumb_func_end sub_80EDA48 + + thumb_func_start sub_80EDA80 +sub_80EDA80: @ 80EDA80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, _080EDB28 + ldr r0, [r7] + ldr r1, _080EDB2C + adds r5, r0, r1 + ldr r0, _080EDB30 + bl sub_80EFB38 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080EDB1C + ldr r0, [r7] + ldr r1, _080EDB34 + mov r8, r1 + add r0, r8 + bl sub_80EFB08 + ldr r4, _080EDB38 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDB1C + movs r0, 0x19 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDB1C + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldr r4, [r7] + adds r4, r0 + movs r0, 0x19 + strb r0, [r4] + strb r6, [r4, 0x1] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + movs r0, 0x5 + bl sub_80847F8 + ldrh r1, [r5, 0x6] + subs r0, r1 + strh r0, [r4, 0x6] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x8] + ldrb r0, [r5, 0xA] + strb r0, [r4, 0xA] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EDB3C + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EDB40 + ldrb r0, [r0] + strb r0, [r4, 0xB] + ldr r0, [r7] + add r0, r8 + movs r1, 0x18 + bl sub_80EF910 +_080EDB1C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EDB28: .4byte 0x03005d8c +_080EDB2C: .4byte 0x00002b2c +_080EDB30: .4byte 0x0000ffff +_080EDB34: .4byte 0x000027cc +_080EDB38: .4byte 0x030060bc +_080EDB3C: .4byte 0x03005d90 +_080EDB40: .4byte 0x082e9531 + thumb_func_end sub_80EDA80 + + thumb_func_start sub_80EDB44 +sub_80EDB44: @ 80EDB44 + push {r4-r7,lr} + movs r0, 0x1A + movs r1, 0x1 + bl sub_80EF46C + ldr r4, _080EDBB8 + ldr r0, [r4] + ldr r1, _080EDBBC + adds r0, r1 + bl sub_80EFB08 + ldr r2, _080EDBC0 + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDC40 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r2, _080EDBBC + adds r0, r2 + ldr r1, [r4] + adds r4, r1, r0 + movs r1, 0 + movs r0, 0x1A + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r6, _080EDBC4 + movs r5, 0 +_080EDB88: + lsls r0, r6, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080EDB9C + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EDB9C: + adds r6, 0x1 + ldr r0, _080EDBC8 + cmp r6, r0 + bls _080EDB88 + strb r5, [r4, 0x4] + bl sub_809D42C + cmp r0, 0 + beq _080EDBCC + movs r0, 0x1 + bl pokedex_count + b _080EDBD2 + .align 2, 0 +_080EDBB8: .4byte 0x03005d8c +_080EDBBC: .4byte 0x000027cc +_080EDBC0: .4byte 0x030060bc +_080EDBC4: .4byte 0x00000867 +_080EDBC8: .4byte 0x0000086e +_080EDBCC: + movs r0, 0x1 + bl sub_80C0844 +_080EDBD2: + strh r0, [r4, 0x2] + ldr r1, _080EDC48 + ldrb r0, [r1, 0x14] + strb r0, [r4, 0x7] + ldrh r0, [r1, 0x12] + movs r1, 0 + strh r0, [r4, 0xA] + strb r1, [r4, 0x5] + strb r1, [r4, 0x6] + movs r6, 0 + adds r7, r4, 0 + adds r7, 0x13 +_080EDBEA: + ldr r0, _080EDC4C + lsls r5, r6, 1 + adds r0, r5, r0 + ldrh r0, [r0] + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EDC04 + ldrb r0, [r4, 0x5] + adds r0, 0x1 + strb r0, [r4, 0x5] +_080EDC04: + ldr r0, _080EDC50 + adds r0, r5, r0 + ldrh r0, [r0] + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EDC1C + ldrb r0, [r4, 0x6] + adds r0, 0x1 + strb r0, [r4, 0x6] +_080EDC1C: + adds r6, 0x1 + cmp r6, 0x6 + bls _080EDBEA + ldr r0, _080EDC54 + ldr r1, [r0] + ldr r2, _080EDC58 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r4, 0x8] + adds r0, r7, 0 + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EDC5C + ldrb r0, [r0] + strb r0, [r4, 0xC] +_080EDC40: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EDC48: .4byte 0x02037318 +_080EDC4C: .4byte 0x0858d0de +_080EDC50: .4byte 0x0858d0d0 +_080EDC54: .4byte 0x03005d90 +_080EDC58: .4byte 0x00000eb8 +_080EDC5C: .4byte 0x082e9531 + thumb_func_end sub_80EDB44 + + thumb_func_start sub_80EDC60 +sub_80EDC60: @ 80EDC60 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r7, _080EDCD4 + ldr r0, [r7] + ldr r6, _080EDCD8 + adds r0, r6 + bl sub_80EFB08 + ldr r4, _080EDCDC + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDCCE + movs r0, 0x1B + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDCCE + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r4, [r7] + adds r4, r0 + movs r1, 0 + movs r0, 0x1B + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r1, _080EDCE0 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + strb r0, [r4, 0x8] + ldrh r0, [r5] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x6] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EDCE4 + ldrb r0, [r0] + strb r0, [r4, 0x9] +_080EDCCE: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EDCD4: .4byte 0x03005d8c +_080EDCD8: .4byte 0x000027cc +_080EDCDC: .4byte 0x030060bc +_080EDCE0: .4byte 0x03005d90 +_080EDCE4: .4byte 0x082e9531 + thumb_func_end sub_80EDC60 + + thumb_func_start sub_80EDCE8 +sub_80EDCE8: @ 80EDCE8 + push {r4-r6,lr} + ldr r6, _080EDD5C + ldr r0, [r6] + ldr r5, _080EDD60 + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EDD64 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDD56 + movs r0, 0x1C + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDD56 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x1C + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r0, _080EDD68 + ldrh r0, [r0] + strh r0, [r4, 0x2] + ldr r1, _080EDD6C + ldrb r0, [r1, 0x14] + strb r0, [r4, 0x4] + ldrh r0, [r1, 0x12] + strh r0, [r4, 0x6] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EDD70 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EDD74 + ldrb r0, [r0] + strb r0, [r4, 0x5] +_080EDD56: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EDD5C: .4byte 0x03005d8c +_080EDD60: .4byte 0x000027cc +_080EDD64: .4byte 0x030060bc +_080EDD68: .4byte 0x020375e2 +_080EDD6C: .4byte 0x02037318 +_080EDD70: .4byte 0x03005d90 +_080EDD74: .4byte 0x082e9531 + thumb_func_end sub_80EDCE8 + + thumb_func_start sub_80EDD78 +sub_80EDD78: @ 80EDD78 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _080EDDBC + ldr r0, [r0] + ldr r1, _080EDDC0 + adds r0, r1 + bl sub_80EFB08 + ldr r1, _080EDDC4 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDE54 + movs r0, 0x1D + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDE54 + movs r5, 0 + ldr r0, _080EDDC8 + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _080EDDCC + cmp r1, 0x1 + beq _080EDDEE + b _080EDE54 + .align 2, 0 +_080EDDBC: .4byte 0x03005d8c +_080EDDC0: .4byte 0x000027cc +_080EDDC4: .4byte 0x030060bc +_080EDDC8: .4byte 0x0203a02a +_080EDDCC: + ldr r0, _080EDDE0 + ldrh r1, [r0] + adds r0, r1, 0 + adds r0, 0xC8 + cmp r4, r0 + blt _080EDDE4 + movs r5, 0x1 + subs r0, r4, r1 + b _080EDE12 + .align 2, 0 +_080EDDE0: .4byte 0x0203a028 +_080EDDE4: + cmp r1, 0x63 + bls _080EDE54 + adds r0, r1, 0 + subs r0, 0x64 + b _080EDE0C +_080EDDEE: + ldr r0, _080EDE00 + ldrh r1, [r0] + adds r0, r1, 0 + adds r0, 0x32 + cmp r4, r0 + blt _080EDE04 + movs r5, 0x1 + subs r0, r4, r1 + b _080EDE12 + .align 2, 0 +_080EDE00: .4byte 0x0203a028 +_080EDE04: + cmp r1, 0x31 + bls _080EDE54 + adds r0, r1, 0 + subs r0, 0x32 +_080EDE0C: + cmp r4, r0 + bgt _080EDE54 + subs r0, r1, r4 +_080EDE12: + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, _080EDE5C + ldr r0, _080EDE60 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EDE64 + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r1, 0 + movs r0, 0x1D + strb r0, [r4] + strb r1, [r4, 0x1] + strh r3, [r4, 0x4] + ldrb r0, [r6] + strb r0, [r4, 0x3] + strb r5, [r4, 0x2] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EDE68 + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EDE6C + ldrb r0, [r0] + strb r0, [r4, 0x8] +_080EDE54: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EDE5C: .4byte 0x03005d8c +_080EDE60: .4byte 0x030060bc +_080EDE64: .4byte 0x000027cc +_080EDE68: .4byte 0x03005d90 +_080EDE6C: .4byte 0x082e9531 + thumb_func_end sub_80EDD78 + + thumb_func_start sub_80EDE70 +sub_80EDE70: @ 80EDE70 + ldr r2, _080EDE7C + movs r1, 0 + strb r1, [r2] + ldr r1, _080EDE80 + strh r0, [r1] + bx lr + .align 2, 0 +_080EDE7C: .4byte 0x0203a02a +_080EDE80: .4byte 0x0203a028 + thumb_func_end sub_80EDE70 + + thumb_func_start sub_80EDE84 +sub_80EDE84: @ 80EDE84 + ldr r2, _080EDE90 + movs r1, 0x1 + strb r1, [r2] + ldr r1, _080EDE94 + strh r0, [r1] + bx lr + .align 2, 0 +_080EDE90: .4byte 0x0203a02a +_080EDE94: .4byte 0x0203a028 + thumb_func_end sub_80EDE84 + + thumb_func_start sub_80EDE98 +sub_80EDE98: @ 80EDE98 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + movs r3, 0 + ldr r6, _080EDEDC + ldr r7, _080EDEE0 + adds r2, r6, 0 + movs r1, 0 +_080EDEAC: + adds r0, r3, r2 + strb r1, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _080EDEAC + movs r3, 0 + movs r5, 0 +_080EDEBE: + ldr r0, [r7] + ldr r1, _080EDEE4 + adds r0, r1 + adds r0, r3 + ldrb r4, [r0] + adds r3, 0x1 + cmp r4, 0 + beq _080EDF0A + movs r1, 0 + ldrb r0, [r6] + cmp r0, 0 + bne _080EDEE8 + strb r4, [r6] + b _080EDF04 + .align 2, 0 +_080EDEDC: .4byte 0x030060d0 +_080EDEE0: .4byte 0x03005d8c +_080EDEE4: .4byte 0x00001aae +_080EDEE8: + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, r4 + beq _080EDF0A + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _080EDF0A + adds r2, r1, r6 + ldrb r0, [r2] + cmp r0, 0 + bne _080EDEE8 + strb r4, [r2] +_080EDF04: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EDF0A: + lsls r0, r3, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _080EDEBE + cmp r5, 0x4 + bls _080EDF1E + movs r0, 0x4 + mov r1, r8 + strb r0, [r1, 0x3] + b _080EDF22 +_080EDF1E: + mov r0, r8 + strb r5, [r0, 0x3] +_080EDF22: + mov r1, r8 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _080EDFA4 + cmp r0, 0x1 + bne _080EDF34 + ldrb r0, [r6] + strb r0, [r1, 0x4] + b _080EDFA4 +_080EDF34: + movs r6, 0 + adds r7, r5, 0 + muls r7, r5 + cmp r6, r7 + bge _080EDF7E + ldr r0, _080EDFB0 + mov r9, r0 +_080EDF42: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 24 + lsrs r1, r0, 24 + mov r0, r9 + adds r2, r4, r0 + ldrb r3, [r2] + add r1, r9 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + blt _080EDF42 +_080EDF7E: + movs r3, 0 + mov r1, r8 + ldrb r1, [r1, 0x3] + cmp r3, r1 + bcs _080EDFA4 + mov r2, r8 + adds r2, 0x4 + ldr r4, _080EDFB0 +_080EDF8E: + adds r1, r2, r3 + adds r0, r3, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + mov r0, r8 + ldrb r0, [r0, 0x3] + cmp r3, r0 + bcc _080EDF8E +_080EDFA4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EDFB0: .4byte 0x030060d0 + thumb_func_end sub_80EDE98 + + thumb_func_start sub_80EDFB4 +sub_80EDFB4: @ 80EDFB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + movs r7, 0 + movs r0, 0 + mov r9, r0 + ldr r1, _080EE0F8 + mov r8, r1 +_080EDFCA: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _080EE0FC + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080EE094 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080EE094 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r2, _080EE100 + mov r3, r9 + lsls r1, r3, 3 + adds r6, r1, r2 + strb r0, [r6] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r6, 0x2] + movs r5, 0 + adds r0, r4, 0 + movs r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE020 + mov r0, r8 + strh r1, [r0] + movs r5, 0x1 +_080EE020: + adds r0, r4, 0 + movs r1, 0xE + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE03C + lsls r0, r5, 1 + add r0, r8 + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EE03C: + adds r0, r4, 0 + movs r1, 0xF + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE058 + lsls r0, r5, 1 + add r0, r8 + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EE058: + adds r0, r4, 0 + movs r1, 0x10 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE074 + lsls r0, r5, 1 + add r0, r8 + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EE074: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + strh r0, [r6, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080EE094: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x5 + bls _080EDFCA + movs r7, 0 + movs r1, 0 + cmp r1, r9 + bcs _080EE0BE + ldr r2, _080EE100 +_080EE0A8: + lsls r0, r7, 3 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1, r0 + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r9 + bcc _080EE0A8 +_080EE0BE: + adds r0, r1, 0 + mov r1, r9 + bl __divsi3 + mov r1, r10 + strb r0, [r1, 0x2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r9 + bl __modsi3 + lsls r0, 16 + ldr r1, _080EE100 + lsrs r0, 13 + adds r0, r1 + ldrh r1, [r0, 0x2] + mov r2, r10 + strh r1, [r2, 0x8] + ldrh r0, [r0, 0x4] + strh r0, [r2, 0xA] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EE0F8: .4byte 0x030060c0 +_080EE0FC: .4byte 0x020244ec +_080EE100: .4byte 0x030060e0 + thumb_func_end sub_80EDFB4 + + thumb_func_start sub_80EE104 +sub_80EE104: @ 80EE104 + push {r4,lr} + movs r0, 0x1F + movs r1, 0x1 + bl sub_80EF46C + ldr r4, _080EE170 + ldr r0, [r4] + ldr r1, _080EE174 + adds r0, r1 + bl sub_80EFB08 + ldr r2, _080EE178 + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE168 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EE174 + adds r0, r1 + ldr r4, [r4] + adds r4, r0 + movs r1, 0 + movs r0, 0x1F + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EE17C + ldr r1, [r1] + bl gf_strcpy + adds r0, r4, 0 + bl sub_80EDE98 + adds r0, r4, 0 + bl sub_80EDFB4 + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EE180 + ldrb r0, [r0] + strb r0, [r4, 0xC] +_080EE168: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EE170: .4byte 0x03005d8c +_080EE174: .4byte 0x000027cc +_080EE178: .4byte 0x030060bc +_080EE17C: .4byte 0x03005d90 +_080EE180: .4byte 0x082e9531 + thumb_func_end sub_80EE104 + + thumb_func_start sub_80EE184 +sub_80EE184: @ 80EE184 + push {r4-r7,lr} + ldr r6, _080EE224 + ldr r0, [r6] + ldr r5, _080EE228 + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EE22C + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080EE1A4 + b _080EE2C2 +_080EE1A4: + movs r0, 0x1E + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EE1B6 + b _080EE2C2 +_080EE1B6: + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, [r6] + adds r4, r1, r0 + movs r1, 0 + movs r0, 0x1E + strb r0, [r4] + strb r1, [r4, 0x1] + movs r5, 0 + ldr r6, _080EE230 + ldr r3, _080EE234 + ldr r7, _080EE238 + adds r2, r6, 0 + adds r2, 0x36 +_080EE1DA: + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bls _080EE1DA + ldrb r1, [r6, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EE1FE + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080EE1FE: + ldrb r0, [r3, 0x14] + strb r0, [r4, 0x4] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, [r7] + bl gf_strcpy + ldrh r0, [r6, 0x6] + strh r0, [r4, 0xA] + ldr r0, _080EE23C + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x9 + bhi _080EE282 + lsls r0, 2 + ldr r1, _080EE240 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EE224: .4byte 0x03005d8c +_080EE228: .4byte 0x000027cc +_080EE22C: .4byte 0x030060bc +_080EE230: .4byte 0x03005d10 +_080EE234: .4byte 0x02037318 +_080EE238: .4byte 0x03005d90 +_080EE23C: .4byte 0x0202433a +_080EE240: .4byte _080EE244 + .align 2, 0 +_080EE244: + .4byte _080EE276 + .4byte _080EE26C + .4byte _080EE26C + .4byte _080EE27A + .4byte _080EE27A + .4byte _080EE27E + .4byte _080EE272 + .4byte _080EE27A + .4byte _080EE282 + .4byte _080EE27E +_080EE26C: + movs r0, 0 + strb r0, [r4] + b _080EE2C2 +_080EE272: + movs r0, 0 + b _080EE280 +_080EE276: + movs r0, 0x1 + b _080EE280 +_080EE27A: + movs r0, 0x2 + b _080EE280 +_080EE27E: + movs r0, 0x3 +_080EE280: + strb r0, [r4, 0x5] +_080EE282: + ldr r1, _080EE2A4 + ldrh r0, [r1, 0x20] + strh r0, [r4, 0x2] + ldrb r0, [r4, 0x5] + cmp r0, 0x1 + beq _080EE2B2 + cmp r0, 0x1 + bgt _080EE2B6 + cmp r0, 0 + bne _080EE2B6 + ldrb r1, [r1, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EE2A8 + movs r0, 0x1 + b _080EE2AC + .align 2, 0 +_080EE2A4: .4byte 0x03005d10 +_080EE2A8: + lsls r0, r1, 26 + lsrs r0, 28 +_080EE2AC: + strh r0, [r4, 0x6] + strh r5, [r4, 0x8] + b _080EE2B6 +_080EE2B2: + ldrh r0, [r1, 0x22] + strh r0, [r4, 0xC] +_080EE2B6: + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EE2C8 + ldrb r0, [r0] + strb r0, [r4, 0xE] +_080EE2C2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EE2C8: .4byte 0x082e9531 + thumb_func_end sub_80EE184 + + thumb_func_start sub_80EE2CC +sub_80EE2CC: @ 80EE2CC + push {r4-r6,lr} + ldr r6, _080EE340 + ldr r0, [r6] + ldr r5, _080EE344 + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EE348 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE33A + movs r0, 0x20 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE33A + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x20 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EE34C + ldr r1, [r1] + bl gf_strcpy + ldr r0, _080EE350 + ldrb r1, [r0] + movs r0, 0x4 + subs r0, r1 + strb r0, [r4, 0x4] + ldr r0, _080EE354 + ldrh r0, [r0] + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EE358 + ldrb r0, [r0] + strb r0, [r4, 0x5] +_080EE33A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EE340: .4byte 0x03005d8c +_080EE344: .4byte 0x000027cc +_080EE348: .4byte 0x030060bc +_080EE34C: .4byte 0x03005d90 +_080EE350: .4byte 0x020375e0 +_080EE354: .4byte 0x020375e2 +_080EE358: .4byte 0x082e9531 + thumb_func_end sub_80EE2CC + + thumb_func_start sub_80EE35C +sub_80EE35C: @ 80EE35C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r3, 0 + ldr r3, [sp, 0x24] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp] + ldr r0, _080EE438 + mov r8, r0 + ldr r0, [r0] + ldr r5, _080EE43C + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EE440 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE426 + movs r0, 0x21 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE426 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r0 + movs r1, 0 + movs r0, 0x21 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EE444 + ldr r1, [r1] + bl gf_strcpy + mov r0, r10 + strh r0, [r4, 0x4] + mov r1, r9 + strh r1, [r4, 0x6] + lsls r0, r6, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r4, 0x2] + movs r2, 0 + movs r3, 0 + adds r5, r4, 0 + adds r5, 0x8 +_080EE3EE: + cmp r2, r6 + beq _080EE408 + lsls r0, r2, 1 + adds r0, r7 + ldrh r1, [r0] + cmp r1, 0 + beq _080EE408 + lsls r0, r3, 1 + adds r0, r5, r0 + strh r1, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080EE408: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080EE3EE + strb r3, [r4, 0x10] + mov r2, sp + ldrh r2, [r2] + strh r2, [r4, 0xE] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EE448 + ldrb r0, [r0] + strb r0, [r4, 0x11] +_080EE426: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EE438: .4byte 0x03005d8c +_080EE43C: .4byte 0x000027cc +_080EE440: .4byte 0x030060bc +_080EE444: .4byte 0x03005d90 +_080EE448: .4byte 0x082e9531 + thumb_func_end sub_80EE35C + + thumb_func_start sub_80EE44C +sub_80EE44C: @ 80EE44C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, _080EE4C8 + ldr r0, [r6] + ldr r5, _080EE4CC + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EE4D0 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE4BE + movs r0, 0x27 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE4BE + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x27 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EE4D4 + ldr r1, [r1] + bl gf_strcpy + mov r0, r8 + strb r0, [r4, 0x2] + strb r7, [r4, 0x3] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EE4D8 + ldrb r0, [r0] + strb r0, [r4, 0x4] +_080EE4BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EE4C8: .4byte 0x03005d8c +_080EE4CC: .4byte 0x000027cc +_080EE4D0: .4byte 0x030060bc +_080EE4D4: .4byte 0x03005d90 +_080EE4D8: .4byte 0x082e9531 + thumb_func_end sub_80EE44C + + thumb_func_start sub_80EE4DC +sub_80EE4DC: @ 80EE4DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r7, _080EE57C + ldr r0, [r7] + ldr r5, _080EE580 + adds r0, r5 + bl sub_80EFB08 + ldr r4, _080EE584 + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE59A + movs r0, 0x23 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE59A + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, [r7] + adds r5, r1, r0 + movs r1, 0 + movs r0, 0x23 + strb r0, [r5] + strb r1, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0x13 + ldr r1, _080EE588 + ldr r1, [r1] + bl gf_strcpy + adds r4, r5, 0x4 + adds r0, r6, 0 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl sub_8009370 + adds r0, r6, 0 + bl sub_80EE5A4 + strb r0, [r5, 0x2] + mov r0, r8 + bl sub_80EE69C + strb r0, [r5, 0x3] + adds r0, r5, 0 + bl sub_80EC9E8 + ldr r0, _080EE58C + ldrb r0, [r0] + strb r0, [r5, 0xF] + cmp r0, 0x1 + beq _080EE578 + adds r0, r6, 0 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + bne _080EE590 +_080EE578: + movs r0, 0x1 + b _080EE598 + .align 2, 0 +_080EE57C: .4byte 0x03005d8c +_080EE580: .4byte 0x000027cc +_080EE584: .4byte 0x030060bc +_080EE588: .4byte 0x03005d90 +_080EE58C: .4byte 0x082e9531 +_080EE590: + adds r0, r6, 0 + movs r1, 0x3 + bl pokemon_getattr +_080EE598: + strb r0, [r5, 0x10] +_080EE59A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EE4DC + + thumb_func_start sub_80EE5A4 +sub_80EE5A4: @ 80EE5A4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x32 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x33 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x34 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x35 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x36 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x43 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x44 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x45 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x46 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x47 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x48 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x49 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4A + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4B + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4C + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4D + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4E + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80EE5A4 + + thumb_func_start sub_80EE69C +sub_80EE69C: @ 80EE69C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x43 + beq _080EE722 + cmp r0, 0x32 + bne _080EE6AE + movs r0, 0x1 + b _080EE728 +_080EE6AE: + cmp r0, 0x33 + bne _080EE6B6 + movs r0, 0x5 + b _080EE728 +_080EE6B6: + cmp r0, 0x34 + bne _080EE6BE + movs r0, 0x9 + b _080EE728 +_080EE6BE: + cmp r0, 0x35 + bne _080EE6C6 + movs r0, 0xD + b _080EE728 +_080EE6C6: + cmp r0, 0x36 + bne _080EE6CE + movs r0, 0x11 + b _080EE728 +_080EE6CE: + cmp r0, 0x44 + bne _080EE6D6 + movs r0, 0x15 + b _080EE728 +_080EE6D6: + cmp r0, 0x45 + bne _080EE6DE + movs r0, 0x16 + b _080EE728 +_080EE6DE: + cmp r0, 0x46 + bne _080EE6E6 + movs r0, 0x17 + b _080EE728 +_080EE6E6: + cmp r0, 0x47 + bne _080EE6EE + movs r0, 0x18 + b _080EE728 +_080EE6EE: + cmp r0, 0x48 + bne _080EE6F6 + movs r0, 0x19 + b _080EE728 +_080EE6F6: + cmp r0, 0x49 + bne _080EE6FE + movs r0, 0x1A + b _080EE728 +_080EE6FE: + cmp r0, 0x4A + bne _080EE706 + movs r0, 0x1B + b _080EE728 +_080EE706: + cmp r0, 0x4B + bne _080EE70E + movs r0, 0x1C + b _080EE728 +_080EE70E: + cmp r0, 0x4C + bne _080EE716 + movs r0, 0x1D + b _080EE728 +_080EE716: + cmp r0, 0x4D + bne _080EE71E + movs r0, 0x1E + b _080EE728 +_080EE71E: + cmp r0, 0x4E + beq _080EE726 +_080EE722: + movs r0, 0 + b _080EE728 +_080EE726: + movs r0, 0x1F +_080EE728: + pop {r1} + bx r1 + thumb_func_end sub_80EE69C + + thumb_func_start sub_80EE72C +sub_80EE72C: @ 80EE72C + push {r4-r6,lr} + ldr r5, _080EE7A4 + ldr r0, [r5] + ldr r6, _080EE7A8 + adds r0, r6 + bl sub_80EFB08 + ldr r4, _080EE7AC + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE79C + movs r0, 0x22 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE79C + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r4, [r5] + adds r4, r0 + movs r1, 0 + movs r0, 0x22 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EE7B0 + ldr r1, [r1] + bl gf_strcpy + ldr r0, [r5] + ldr r2, _080EE7B4 + adds r1, r0, r2 + ldrh r1, [r1] + strh r1, [r4, 0x4] + ldr r1, _080EE7B8 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4, 0x6] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EE7BC + ldrb r0, [r0] + strb r0, [r4, 0x8] +_080EE79C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EE7A4: .4byte 0x03005d8c +_080EE7A8: .4byte 0x000027cc +_080EE7AC: .4byte 0x030060bc +_080EE7B0: .4byte 0x03005d90 +_080EE7B4: .4byte 0x00002bb0 +_080EE7B8: .4byte 0x00002bb2 +_080EE7BC: .4byte 0x082e9531 + thumb_func_end sub_80EE72C + + thumb_func_start sub_80EE7C0 +sub_80EE7C0: @ 80EE7C0 + push {r4,lr} + ldr r4, _080EE7FC + ldr r0, [r4] + ldr r1, _080EE800 + adds r0, r1 + bl sub_80EFADC + ldr r1, _080EE804 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE810 + movs r0, 0xB + bl sub_80EF550 + ldr r0, _080EE808 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080EE810 + ldr r0, [r4] + ldr r1, _080EE80C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080EE810 + movs r0, 0 + b _080EE812 + .align 2, 0 +_080EE7FC: .4byte 0x03005d8c +_080EE800: .4byte 0x000027cc +_080EE804: .4byte 0x030060bc +_080EE808: .4byte 0x020375f0 +_080EE80C: .4byte 0x00003150 +_080EE810: + movs r0, 0x1 +_080EE812: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EE7C0 + + thumb_func_start sub_80EE818 +sub_80EE818: @ 80EE818 + push {r4-r7,lr} + movs r0, 0x24 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EE870 + ldr r0, _080EE890 + ldr r0, [r0] + ldr r1, _080EE894 + adds r7, r0, r1 + bl sub_80F0020 + adds r4, r0, 0 + movs r6, 0x5 + lsrs r5, r4, 8 +_080EE83C: + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0x24 + bne _080EE866 + movs r3, 0xFF + adds r0, r4, 0 + ands r0, r3 + adds r2, r1, 0 + adds r2, 0x22 + ldrb r2, [r2] + cmp r0, r2 + bne _080EE866 + adds r0, r5, 0 + ands r0, r3 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + beq _080EE89C +_080EE866: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x17 + bls _080EE83C +_080EE870: + ldr r0, _080EE890 + ldr r0, [r0] + ldr r1, _080EE894 + adds r0, r1 + bl sub_80EFB08 + ldr r1, _080EE898 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE8C0 + movs r0, 0x1 + b _080EE8C2 + .align 2, 0 +_080EE890: .4byte 0x03005d8c +_080EE894: .4byte 0x000027cc +_080EE898: .4byte 0x030060bc +_080EE89C: + ldr r5, _080EE8B8 + ldr r0, [r5] + ldr r4, _080EE8BC + adds r0, r4 + adds r1, r6, 0 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C + movs r0, 0x1 + b _080EE8C2 + .align 2, 0 +_080EE8B8: .4byte 0x03005d8c +_080EE8BC: .4byte 0x000027cc +_080EE8C0: + movs r0, 0 +_080EE8C2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EE818 + + thumb_func_start sub_80EE8C8 +sub_80EE8C8: @ 80EE8C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r5, _080EE930 + ldr r0, [r5] + ldr r1, _080EE934 + adds r0, r1 + bl sub_80EFB08 + ldr r2, _080EE938 + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080EE8F4 + b _080EEA52 +_080EE8F4: + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r2, _080EE934 + adds r0, r2 + ldr r1, [r5] + adds r7, r1, r0 + movs r1, 0 + movs r0, 0x24 + strb r0, [r7] + strb r1, [r7, 0x1] + adds r0, r7, 0 + adds r0, 0x13 + ldr r1, _080EE93C + ldr r1, [r1] + bl gf_strcpy + strh r6, [r7, 0x2] + strb r4, [r7, 0xD] + subs r0, r4, 0x1 + cmp r0, 0xC + bls _080EE926 + b _080EEA46 +_080EE926: + lsls r0, 2 + ldr r1, _080EE940 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EE930: .4byte 0x03005d8c +_080EE934: .4byte 0x000027cc +_080EE938: .4byte 0x030060bc +_080EE93C: .4byte 0x03005d90 +_080EE940: .4byte _080EE944 + .align 2, 0 +_080EE944: + .4byte _080EE978 + .4byte _080EE9A8 + .4byte _080EE9E8 + .4byte _080EEA00 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 +_080EE978: + ldr r4, _080EE9A4 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r0, r4, 0 + adds r0, 0x64 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] + adds r4, 0xC8 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x8] + b _080EEA46 + .align 2, 0 +_080EE9A4: .4byte 0x020244ec +_080EE9A8: + ldr r4, _080EE9E4 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r0, r4, 0 + adds r0, 0x64 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] + adds r0, r4, 0 + adds r0, 0xC8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x8] + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0xA] + b _080EEA46 + .align 2, 0 +_080EE9E4: .4byte 0x020244ec +_080EE9E8: + ldr r4, _080EE9FC + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r4, 0x64 + adds r0, r4, 0 + b _080EEA3C + .align 2, 0 +_080EE9FC: .4byte 0x020244ec +_080EEA00: + ldr r2, _080EEA5C + mov r8, r2 + ldr r6, _080EEA60 + ldr r0, [r6] + ldr r1, _080EEA64 + adds r0, r1 + ldrh r0, [r0] + movs r5, 0x64 + adds r1, r0, 0 + muls r1, r5 + movs r4, 0xEA + lsls r4, 1 + adds r1, r4 + ldr r0, [r2] + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + ldr r0, [r6] + ldr r2, _080EEA68 + adds r0, r2 + ldrh r0, [r0] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + mov r2, r8 + ldr r0, [r2] + adds r0, r1 +_080EEA3C: + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] +_080EEA46: + adds r0, r7, 0 + bl sub_80EC9E8 + ldr r0, _080EEA6C + ldrb r0, [r0] + strb r0, [r7, 0xC] +_080EEA52: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EEA5C: .4byte 0x03005d8c +_080EEA60: .4byte 0x03005d90 +_080EEA64: .4byte 0x00000caa +_080EEA68: .4byte 0x00000cac +_080EEA6C: .4byte 0x082e9531 + thumb_func_end sub_80EE8C8 + + thumb_func_start sub_80EEA70 +sub_80EEA70: @ 80EEA70 + push {r4-r7,lr} + sub sp, 0x20 + movs r0, 0x26 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EEA86 + b _080EEB8C +_080EEA86: + ldr r7, _080EEB40 + ldr r0, [r7] + ldr r1, _080EEB44 + adds r0, r1 + bl sub_80EFB08 + ldr r2, _080EEB48 + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EEB8C + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EEB44 + adds r0, r1 + ldr r1, [r7] + adds r5, r1, r0 + movs r1, 0 + movs r0, 0x26 + strb r0, [r5] + strb r1, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0x13 + ldr r1, _080EEB4C + ldr r1, [r1] + bl gf_strcpy + ldr r0, _080EEB50 + bl var_get + strh r0, [r5, 0x2] + bl sub_80E980C + ldr r1, _080EEB54 + mov r0, sp + bl gf_strcpy + mov r0, sp + bl sub_8009370 + adds r0, r5, 0x4 + mov r1, sp + bl gf_strcpy + ldr r0, _080EEB58 + bl var_get + strh r0, [r5, 0x10] + ldr r0, _080EEB5C + bl var_get + adds r4, r0, 0 + ldr r0, _080EEB60 + bl var_get + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + adds r4, r0 + str r4, [r5, 0xC] + adds r0, r5, 0 + bl sub_80EC9E8 + ldr r0, _080EEB64 + ldrb r0, [r0] + strb r0, [r5, 0x1B] + cmp r0, 0x1 + beq _080EEB3A + ldr r4, [r7] + ldr r6, _080EEB68 + adds r0, r6, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r4, r1 + ldr r0, _080EEB6C + adds r4, r0 + ldrb r0, [r4] + cmp r0, 0x1 + bne _080EEB70 +_080EEB3A: + movs r0, 0x1 + b _080EEB8A + .align 2, 0 +_080EEB40: .4byte 0x03005d8c +_080EEB44: .4byte 0x000027cc +_080EEB48: .4byte 0x030060bc +_080EEB4C: .4byte 0x03005d90 +_080EEB50: .4byte 0x000040ec +_080EEB54: .4byte 0x02021cc4 +_080EEB58: .4byte 0x000040ed +_080EEB5C: .4byte 0x000040ee +_080EEB60: .4byte 0x000040ef +_080EEB64: .4byte 0x082e9531 +_080EEB68: .4byte 0x00004054 +_080EEB6C: .4byte 0x00001aa9 +_080EEB70: + adds r0, r6, 0 + bl var_get + ldr r2, [r7] + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r1, _080EEB94 + adds r2, r1 + ldrb r0, [r2] +_080EEB8A: + strb r0, [r5, 0x1C] +_080EEB8C: + add sp, 0x20 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EEB94: .4byte 0x00001aa9 + thumb_func_end sub_80EEA70 + + thumb_func_start sub_80EEB98 +sub_80EEB98: @ 80EEB98 + push {r4-r7,lr} + movs r5, 0 + ldr r6, _080EEBA4 + adds r7, r6, 0x2 + b _080EEBAE + .align 2, 0 +_080EEBA4: .4byte 0x0858d0ec +_080EEBA8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EEBAE: + cmp r5, 0x6 + bhi _080EEBCE + lsls r4, r5, 2 + adds r0, r4, r6 + ldrh r0, [r0] + bl var_get + adds r4, r7 + lsls r0, 16 + lsrs r0, 16 + ldrh r4, [r4] + cmp r0, r4 + bcc _080EEBA8 + adds r0, r5, 0 + bl sub_80EEBF4 +_080EEBCE: + movs r5, 0 + ldr r4, _080EEBF0 +_080EEBD2: + lsls r0, r5, 2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0 + bl var_set + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080EEBD2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EEBF0: .4byte 0x0858d0ec + thumb_func_end sub_80EEB98 + + thumb_func_start sub_80EEBF4 +sub_80EEBF4: @ 80EEBF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x25 + movs r1, 0x1 + bl sub_80EF46C + ldr r4, _080EEC68 + ldr r0, [r4] + ldr r1, _080EEC6C + adds r0, r1 + bl sub_80EFB08 + ldr r2, _080EEC70 + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EEC60 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EEC6C + adds r0, r1 + ldr r4, [r4] + adds r4, r0 + movs r1, 0 + movs r0, 0x25 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, _080EEC74 + ldr r1, [r1] + bl gf_strcpy + strb r5, [r4, 0x4] + ldr r1, _080EEC78 + lsls r0, r5, 2 + adds r0, r1 + ldrh r0, [r0] + bl var_get + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, _080EEC7C + ldrb r0, [r0] + strb r0, [r4, 0x5] +_080EEC60: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EEC68: .4byte 0x03005d8c +_080EEC6C: .4byte 0x000027cc +_080EEC70: .4byte 0x030060bc +_080EEC74: .4byte 0x03005d90 +_080EEC78: .4byte 0x0858d0ec +_080EEC7C: .4byte 0x082e9531 + thumb_func_end sub_80EEBF4 + + thumb_func_start sub_80EEC80 +sub_80EEC80: @ 80EEC80 + push {r4,lr} + ldr r4, _080EECA0 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EECA0: .4byte 0x000040e6 + thumb_func_end sub_80EEC80 + + thumb_func_start sub_80EECA4 +sub_80EECA4: @ 80EECA4 + push {r4,lr} + ldr r4, _080EECC4 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EECC4: .4byte 0x000040eb + thumb_func_end sub_80EECA4 + + thumb_func_start sub_80EECC8 +sub_80EECC8: @ 80EECC8 + push {r4,lr} + ldr r4, _080EECE8 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EECE8: .4byte 0x000040e7 + thumb_func_end sub_80EECC8 + + thumb_func_start sub_80EECEC +sub_80EECEC: @ 80EECEC + push {r4,lr} + ldr r4, _080EED0C + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EED0C: .4byte 0x000040e8 + thumb_func_end sub_80EECEC + + thumb_func_start sub_80EED10 +sub_80EED10: @ 80EED10 + push {r4,lr} + ldr r4, _080EED30 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EED30: .4byte 0x000040e9 + thumb_func_end sub_80EED10 + + thumb_func_start sub_80EED34 +sub_80EED34: @ 80EED34 + push {r4,lr} + ldr r4, _080EED58 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + ldr r0, _080EED5C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EED58: .4byte 0x000040ea +_080EED5C: .4byte 0x020375e4 + thumb_func_end sub_80EED34 + + thumb_func_start sub_80EED60 +sub_80EED60: @ 80EED60 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, _080EED84 + adds r0, r5, 0 + bl var_get + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl var_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EED84: .4byte 0x000040f1 + thumb_func_end sub_80EED60 + + thumb_func_start sub_80EED88 +sub_80EED88: @ 80EED88 + push {r4-r7,lr} + ldr r0, _080EEE14 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080EEE0C + ldr r6, _080EEE18 + ldr r0, [r6] + ldr r7, _080EEE1C + adds r0, r7 + bl sub_80EEE30 + ldr r5, _080EEE20 + strb r0, [r5] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EEE0C + ldr r0, _080EEE24 + bl sub_80EFB38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EEE0C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r4, r0, 0x1 + adds r0, r4, 0 + bl sub_80EF0E4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EEE0C + ldr r1, [r6] + movs r0, 0 + ldrsb r0, [r5, r0] + lsls r0, 2 + adds r1, r0 + adds r1, r7 + strb r4, [r1] + ldr r2, [r6] + movs r0, 0 + ldrsb r0, [r5, r0] + lsls r0, 2 + adds r0, r2, r0 + ldr r1, _080EEE28 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0] + movs r0, 0 + ldrsb r0, [r5, r0] + lsls r0, 2 + adds r2, r0 + ldr r0, _080EEE2C + adds r2, r0 + movs r0, 0x1 + strb r0, [r2] +_080EEE0C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EEE14: .4byte 0x00000864 +_080EEE18: .4byte 0x03005d8c +_080EEE1C: .4byte 0x00002b50 +_080EEE20: .4byte 0x030060bc +_080EEE24: .4byte 0x0000028f +_080EEE28: .4byte 0x00002b52 +_080EEE2C: .4byte 0x00002b51 + thumb_func_end sub_80EED88 + + thumb_func_start sub_80EEE30 +sub_80EEE30: @ 80EEE30 + push {lr} + adds r2, r0, 0 + movs r1, 0 +_080EEE36: + lsls r0, r1, 24 + asrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EEE48 + adds r0, r1, 0 + b _080EEE58 +_080EEE48: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0xF + ble _080EEE36 + movs r0, 0x1 + negs r0, r0 +_080EEE58: + pop {r1} + bx r1 + thumb_func_end sub_80EEE30 + + thumb_func_start sub_80EEE5C +sub_80EEE5C: @ 80EEE5C + push {r4,lr} + movs r4, 0 +_080EEE60: + adds r0, r4, 0 + bl sub_80EEE78 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080EEE60 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80EEE5C + + thumb_func_start sub_80EEE78 +sub_80EEE78: @ 80EEE78 + push {r4,lr} + lsls r0, 24 + ldr r3, _080EEEA8 + ldr r1, [r3] + lsrs r0, 22 + adds r1, r0 + ldr r2, _080EEEAC + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r4, _080EEEB0 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r0, _080EEEB4 + adds r1, r0 + strh r2, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EEEA8: .4byte 0x03005d8c +_080EEEAC: .4byte 0x00002b50 +_080EEEB0: .4byte 0x00002b51 +_080EEEB4: .4byte 0x00002b52 + thumb_func_end sub_80EEE78 + + thumb_func_start sub_80EEEB8 +sub_80EEEB8: @ 80EEEB8 + push {r4-r7,lr} + movs r2, 0 + ldr r6, _080EEED8 +_080EEEBE: + ldr r0, _080EEED8 + ldr r0, [r0] + lsls r1, r2, 2 + adds r0, r1 + ldr r3, _080EEEDC + adds r0, r3 + ldrb r0, [r0] + adds r5, r2, 0x1 + cmp r0, 0 + bne _080EEF12 + lsls r0, r5, 24 + b _080EEF0C + .align 2, 0 +_080EEED8: .4byte 0x03005d8c +_080EEEDC: .4byte 0x00002b50 +_080EEEE0: + ldr r3, [r6] + lsls r4, r2, 2 + adds r0, r3, r4 + ldr r7, _080EEF04 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _080EEF08 + adds r0, r3, r7 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r2, 0 + bl sub_80EEE78 + b _080EEF12 + .align 2, 0 +_080EEF04: .4byte 0x00002b50 +_080EEF08: + adds r0, r2, 0x1 + lsls r0, 24 +_080EEF0C: + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080EEEE0 +_080EEF12: + lsls r0, r5, 24 + lsrs r2, r0, 24 + cmp r2, 0xE + bls _080EEEBE + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EEEB8 + + thumb_func_start sub_80EEF20 +sub_80EEF20: @ 80EEF20 + push {r4,lr} + movs r2, 0 + ldr r0, _080EEF50 + ldr r3, [r0] +_080EEF28: + lsls r0, r2, 2 + adds r1, r3, r0 + ldr r4, _080EEF54 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080EEF58 + adds r4, 0x1 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EEF58 + adds r4, 0x1 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0x2 + bhi _080EEF58 + adds r0, r2, 0 + b _080EEF64 + .align 2, 0 +_080EEF50: .4byte 0x03005d8c +_080EEF54: .4byte 0x00002b50 +_080EEF58: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080EEF28 + movs r0, 0xFF +_080EEF64: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EEF20 + + thumb_func_start sub_80EEF6C +sub_80EEF6C: @ 80EEF6C + push {r4,r5,lr} + bl sub_80EEF20 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080EEF84 + ldr r1, _080EEF80 + movs r0, 0 + b _080EF01A + .align 2, 0 +_080EEF80: .4byte 0x020375f0 +_080EEF84: + ldr r5, _080EEFB4 + ldr r0, [r5] + lsls r4, r2, 2 + adds r1, r0, r4 + ldr r0, _080EEFB8 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0 + bne _080EEFE8 + ldr r2, _080EEFBC + adds r1, r2 + movs r0, 0x2 + strb r0, [r1] + ldr r0, _080EEFC0 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x13 + bgt _080EEFC8 + ldr r1, _080EEFC4 + ldr r0, [r5] + adds r0, r4 + subs r2, 0x1 + b _080EEFD0 + .align 2, 0 +_080EEFB4: .4byte 0x03005d8c +_080EEFB8: .4byte 0x00002b52 +_080EEFBC: .4byte 0x00002b51 +_080EEFC0: .4byte 0x03005cf8 +_080EEFC4: .4byte 0x0858d11c +_080EEFC8: + ldr r1, _080EEFE0 + ldr r0, [r5] + adds r0, r4 + ldr r2, _080EEFE4 +_080EEFD0: + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + b _080EF016 + .align 2, 0 +_080EEFE0: .4byte 0x0858d130 +_080EEFE4: .4byte 0x00002b50 +_080EEFE8: + ldrh r1, [r2] + ldr r0, _080EF024 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r0, [r5] + adds r0, r4 + ldr r1, _080EF028 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r1, _080EF02C + ldr r0, [r5] + adds r0, r4 + ldr r2, _080EF030 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 +_080EF016: + ldr r1, _080EF034 + movs r0, 0x1 +_080EF01A: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EF024: .4byte 0x02021cc4 +_080EF028: .4byte 0x00002b51 +_080EF02C: .4byte 0x0858d108 +_080EF030: .4byte 0x00002b50 +_080EF034: .4byte 0x020375f0 + thumb_func_end sub_80EEF6C + + thumb_func_start sub_80EF038 +sub_80EF038: @ 80EF038 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _080EF048 + b _080EF08A +_080EF044: + movs r0, 0x1 + b _080EF08C +_080EF048: + movs r2, 0 + ldr r4, _080EF074 +_080EF04C: + ldr r1, [r4] + lsls r0, r2, 2 + adds r1, r0 + ldr r5, _080EF078 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, r3 + bne _080EF080 + ldr r2, _080EF07C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080EF08A + adds r0, r3, 0 + bl sub_80EF094 + lsls r0, 24 + cmp r0, 0 + bne _080EF044 + b _080EF08A + .align 2, 0 +_080EF074: .4byte 0x03005d8c +_080EF078: .4byte 0x00002b50 +_080EF07C: .4byte 0x00002b51 +_080EF080: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080EF04C +_080EF08A: + movs r0, 0 +_080EF08C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80EF038 + + thumb_func_start sub_80EF094 +sub_80EF094: @ 80EF094 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EF0A6 + cmp r0, 0x3 + beq _080EF0C8 +_080EF0A2: + movs r0, 0x1 + b _080EF0D6 +_080EF0A6: + ldr r0, _080EF0C0 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _080EF0D4 + ldr r0, _080EF0C4 + ldrh r0, [r0] + cmp r0, 0x19 + beq _080EF0A2 + b _080EF0D4 + .align 2, 0 +_080EF0C0: .4byte 0x03005d8c +_080EF0C4: .4byte 0x020375f2 +_080EF0C8: + ldr r0, _080EF0DC + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _080EF0E0 + cmp r1, r0 + beq _080EF0A2 +_080EF0D4: + movs r0, 0 +_080EF0D6: + pop {r1} + bx r1 + .align 2, 0 +_080EF0DC: .4byte 0x03005d8c +_080EF0E0: .4byte 0x0000150d + thumb_func_end sub_80EF094 + + thumb_func_start sub_80EF0E4 +sub_80EF0E4: @ 80EF0E4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080EF0F2 +_080EF0EE: + movs r0, 0x1 + b _080EF112 +_080EF0F2: + movs r1, 0 + ldr r0, _080EF118 + ldr r3, [r0] + ldr r4, _080EF11C +_080EF0FA: + lsls r0, r1, 2 + adds r0, r3, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r2 + beq _080EF0EE + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080EF0FA + movs r0, 0 +_080EF112: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080EF118: .4byte 0x03005d8c +_080EF11C: .4byte 0x00002b50 + thumb_func_end sub_80EF0E4 + + thumb_func_start sub_80EF120 +sub_80EF120: @ 80EF120 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + ldr r0, _080EF158 + mov r8, r0 +_080EF130: + mov r1, r8 + ldr r0, [r1] + lsls r1, r6, 2 + adds r2, r0, r1 + ldr r3, _080EF15C + adds r0, r2, r3 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0 + beq _080EF196 + ldr r1, _080EF160 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r7 + bcs _080EF164 + adds r0, r6, 0 + bl sub_80EEE78 + b _080EF196 + .align 2, 0 +_080EF158: .4byte 0x03005d8c +_080EF15C: .4byte 0x00002b50 +_080EF160: .4byte 0x00002b52 +_080EF164: + ldr r5, _080EF1B0 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080EF186 + ldr r0, _080EF1B4 + bl flag_check + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080EF186 + mov r2, r8 + ldr r0, [r2] + adds r0, r4 + adds r0, r5 + strb r1, [r0] +_080EF186: + mov r3, r8 + ldr r1, [r3] + adds r1, r4 + ldr r0, _080EF1B8 + adds r1, r0 + ldrh r0, [r1] + subs r0, r7 + strh r0, [r1] +_080EF196: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bls _080EF130 + bl sub_80EEEB8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EF1B0: .4byte 0x00002b51 +_080EF1B4: .4byte 0x00000864 +_080EF1B8: .4byte 0x00002b52 + thumb_func_end sub_80EF120 + + thumb_func_start sub_80EF1BC +sub_80EF1BC: @ 80EF1BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x1 + beq _080EF1FC + cmp r1, 0x1 + bgt _080EF1D6 + cmp r1, 0 + beq _080EF1E0 + b _080EF244 +_080EF1D6: + cmp r2, 0x2 + beq _080EF218 + cmp r2, 0x3 + beq _080EF234 + b _080EF244 +_080EF1E0: + ldr r1, _080EF1F4 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF1F8 + ldr r1, [r1, 0x14] + bl gf_strcpy + b _080EF244 + .align 2, 0 +_080EF1F4: .4byte 0x0858d144 +_080EF1F8: .4byte 0x0858baf0 +_080EF1FC: + ldr r1, _080EF210 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF214 + ldr r1, [r1, 0x18] + bl gf_strcpy + b _080EF244 + .align 2, 0 +_080EF210: .4byte 0x0858d144 +_080EF214: .4byte 0x0858baf0 +_080EF218: + ldr r1, _080EF22C + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF230 + ldr r1, [r1, 0x1C] + bl gf_strcpy + b _080EF244 + .align 2, 0 +_080EF22C: .4byte 0x0858d144 +_080EF230: .4byte 0x0858baf0 +_080EF234: + ldr r1, _080EF248 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF24C + ldr r1, [r1, 0x20] + bl gf_strcpy +_080EF244: + pop {r0} + bx r0 + .align 2, 0 +_080EF248: .4byte 0x0858d144 +_080EF24C: .4byte 0x0858baf0 + thumb_func_end sub_80EF1BC + + thumb_func_start sub_80EF250 +sub_80EF250: @ 80EF250 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0x4 + bhi _080EF300 + lsls r0, 2 + ldr r1, _080EF268 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EF268: .4byte _080EF26C + .align 2, 0 +_080EF26C: + .4byte _080EF280 + .4byte _080EF29C + .4byte _080EF2B8 + .4byte _080EF2D4 + .4byte _080EF2F0 +_080EF280: + ldr r1, _080EF294 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF298 + ldr r1, [r1] + bl gf_strcpy + b _080EF300 + .align 2, 0 +_080EF294: .4byte 0x0858d144 +_080EF298: .4byte 0x0858baf0 +_080EF29C: + ldr r1, _080EF2B0 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF2B4 + ldr r1, [r1, 0x4] + bl gf_strcpy + b _080EF300 + .align 2, 0 +_080EF2B0: .4byte 0x0858d144 +_080EF2B4: .4byte 0x0858baf0 +_080EF2B8: + ldr r1, _080EF2CC + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF2D0 + ldr r1, [r1, 0x8] + bl gf_strcpy + b _080EF300 + .align 2, 0 +_080EF2CC: .4byte 0x0858d144 +_080EF2D0: .4byte 0x0858baf0 +_080EF2D4: + ldr r1, _080EF2E8 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF2EC + ldr r1, [r1, 0xC] + bl gf_strcpy + b _080EF300 + .align 2, 0 +_080EF2E8: .4byte 0x0858d144 +_080EF2EC: .4byte 0x0858baf0 +_080EF2F0: + ldr r1, _080EF304 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080EF308 + ldr r1, [r1, 0x10] + bl gf_strcpy +_080EF300: + pop {r0} + bx r0 + .align 2, 0 +_080EF304: .4byte 0x0858d144 +_080EF308: .4byte 0x0858baf0 + thumb_func_end sub_80EF250 + + thumb_func_start sub_80EF30C +sub_80EF30C: @ 80EF30C + push {lr} + ldr r2, _080EF334 + ldr r0, _080EF338 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080EF33C + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + ldrb r1, [r1, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x1 + bl sub_80EF250 + pop {r0} + bx r0 + .align 2, 0 +_080EF334: .4byte 0x03005d8c +_080EF338: .4byte 0x020375e0 +_080EF33C: .4byte 0x000027cc + thumb_func_end sub_80EF30C + + thumb_func_start sub_80EF340 +sub_80EF340: @ 80EF340 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80EF370 + adds r3, r0, 0 + ldr r0, _080EF36C + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsls r3, 24 + lsrs r3, 24 + adds r1, r5, 0 + movs r2, 0 + bl decimal_int_to_string + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080EF36C: .4byte 0x0858d144 + thumb_func_end sub_80EF340 + + thumb_func_start sub_80EF370 +sub_80EF370: @ 80EF370 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xA + bl __divsi3 + cmp r0, 0 + beq _080EF3FC + adds r0, r4, 0 + movs r1, 0x64 + bl __divsi3 + cmp r0, 0 + bne _080EF38E + movs r0, 0x2 + b _080EF406 +_080EF38E: + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3A0 + movs r0, 0x3 + b _080EF406 +_080EF3A0: + ldr r1, _080EF3B0 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3B4 + movs r0, 0x4 + b _080EF406 + .align 2, 0 +_080EF3B0: .4byte 0x00002710 +_080EF3B4: + ldr r1, _080EF3C4 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3C8 + movs r0, 0x5 + b _080EF406 + .align 2, 0 +_080EF3C4: .4byte 0x000186a0 +_080EF3C8: + ldr r1, _080EF3D8 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3DC + movs r0, 0x6 + b _080EF406 + .align 2, 0 +_080EF3D8: .4byte 0x000f4240 +_080EF3DC: + ldr r1, _080EF3EC + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3F0 + movs r0, 0x7 + b _080EF406 + .align 2, 0 +_080EF3EC: .4byte 0x00989680 +_080EF3F0: + ldr r1, _080EF400 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + beq _080EF404 +_080EF3FC: + movs r0, 0x1 + b _080EF406 + .align 2, 0 +_080EF400: .4byte 0x05f5e100 +_080EF404: + movs r0, 0x8 +_080EF406: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EF370 + + thumb_func_start sub_80EF40C +sub_80EF40C: @ 80EF40C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + movs r5, 0 +_080EF41E: + lsls r4, r5, 1 + adds r0, r6, 0x6 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _080EF43E + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + adds r1, 0xC + adds r1, r4 + ldrh r1, [r1] + muls r0, r1 + adds r7, r0 +_080EF43E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080EF41E + ldrb r0, [r6, 0x2] + cmp r0, 0x1 + bne _080EF458 + asrs r1, r7, 1 + mov r0, r8 + bl sub_80EF340 + b _080EF460 +_080EF458: + mov r0, r8 + adds r1, r7, 0 + bl sub_80EF340 +_080EF460: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EF40C + + thumb_func_start sub_80EF46C +sub_80EF46C: @ 80EF46C + 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, 24 + lsrs r1, 24 + mov r9, r1 + ldr r5, _080EF4DC + ldr r0, [r5] + ldr r4, _080EF4E0 + adds r0, r4 + mov r8, r0 + bl sub_80F0020 + adds r7, r0, 0 + movs r6, 0x5 +_080EF494: + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + mov r2, r8 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, r10 + bne _080EF4E4 + movs r3, 0xFF + adds r0, r7, 0 + ands r0, r3 + adds r2, r1, 0 + adds r2, 0x22 + ldrb r2, [r2] + cmp r0, r2 + bne _080EF4E4 + lsrs r0, r7, 8 + ands r0, r3 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080EF4E4 + mov r0, r9 + cmp r0, 0x1 + bne _080EF4D8 + ldr r0, [r5] + adds r0, r4 + adds r1, r6, 0 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C +_080EF4D8: + movs r0, 0x1 + b _080EF4F0 + .align 2, 0 +_080EF4DC: .4byte 0x03005d8c +_080EF4E0: .4byte 0x000027cc +_080EF4E4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x17 + bls _080EF494 + movs r0, 0 +_080EF4F0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EF46C + + thumb_func_start sub_80EF500 +sub_80EF500: @ 80EF500 + push {r4-r7,lr} + movs r2, 0 +_080EF504: + adds r1, r2, 0x1 + lsls r0, r1, 24 + lsrs r5, r0, 24 + adds r7, r1, 0 + cmp r5, 0x2 + bhi _080EF53C + ldr r6, _080EF54C + lsls r0, r2, 2 + adds r4, r0, r6 +_080EF516: + lsls r0, r5, 2 + adds r3, r0, r6 + ldrh r0, [r4, 0x2] + ldrh r1, [r3, 0x2] + cmp r0, r1 + bcs _080EF532 + ldrh r1, [r4] + adds r2, r0, 0 + ldrh r0, [r3] + strh r0, [r4] + ldrh r0, [r3, 0x2] + strh r0, [r4, 0x2] + strh r1, [r3] + strh r2, [r3, 0x2] +_080EF532: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080EF516 +_080EF53C: + lsls r0, r7, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bls _080EF504 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EF54C: .4byte 0x02039f80 + thumb_func_end sub_80EF500 + + thumb_func_start sub_80EF550 +sub_80EF550: @ 80EF550 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0 + ldr r5, _080EF580 + ldr r4, _080EF584 +_080EF55C: + ldr r3, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r3, r0 + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, r6 + bne _080EF5A4 + ldr r6, _080EF588 + adds r0, r2, r6 + ldrb r2, [r0] + cmp r2, 0x1 + bne _080EF590 + ldr r0, _080EF58C + strh r2, [r0] + b _080EF5B2 + .align 2, 0 +_080EF580: .4byte 0x03005d8c +_080EF584: .4byte 0x000027cc +_080EF588: .4byte 0x000027cd +_080EF58C: .4byte 0x020375f0 +_080EF590: + adds r0, r3, r4 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C + bl sub_80EFA88 + b _080EF5B2 +_080EF5A4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _080EF55C + bl sub_80EFA88 +_080EF5B2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EF550 + + thumb_func_start sub_80EF5B8 +sub_80EF5B8: @ 80EF5B8 + push {lr} + ldr r1, _080EF5D4 + movs r0, 0 + strh r0, [r1] + ldr r0, _080EF5D8 + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0xA + bhi _080EF646 + lsls r0, 2 + ldr r1, _080EF5DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080EF5D4: .4byte 0x020375f0 +_080EF5D8: .4byte 0x020375e2 +_080EF5DC: .4byte _080EF5E0 + .align 2, 0 +_080EF5E0: + .4byte _080EF60C + .4byte _080EF612 + .4byte _080EF618 + .4byte _080EF61E + .4byte _080EF624 + .4byte _080EF62A + .4byte _080EF630 + .4byte _080EF636 + .4byte _080EF63C + .4byte _080EF646 + .4byte _080EF642 +_080EF60C: + bl sub_80EF64C + b _080EF646 +_080EF612: + bl sub_80EF6C4 + b _080EF646 +_080EF618: + bl sub_80EF704 + b _080EF646 +_080EF61E: + bl sub_80EF79C + b _080EF646 +_080EF624: + bl sub_80EF7A8 + b _080EF646 +_080EF62A: + bl sub_80EF7B4 + b _080EF646 +_080EF630: + bl sub_80EF80C + b _080EF646 +_080EF636: + bl sub_80EF7F4 + b _080EF646 +_080EF63C: + bl sub_80EF800 + b _080EF646 +_080EF642: + bl sub_80EF84C +_080EF646: + pop {r0} + bx r0 + thumb_func_end sub_80EF5B8 + + thumb_func_start sub_80EF64C +sub_80EF64C: @ 80EF64C + push {r4,lr} + movs r0, 0x1 + bl sub_80EF550 + ldr r0, _080EF6A8 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF6A0 + ldr r4, _080EF6AC + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _080EF6B0 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, _080EF6B4 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r2, _080EF6B8 + ldr r0, _080EF6BC + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080EF6C0 + adds r0, r1 + movs r1, 0x6 + bl sub_811F88C +_080EF6A0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EF6A8: .4byte 0x020375f0 +_080EF6AC: .4byte 0x02021cc4 +_080EF6B0: .4byte 0x020244ec +_080EF6B4: .4byte 0x083185c8 +_080EF6B8: .4byte 0x03005d8c +_080EF6BC: .4byte 0x030060bc +_080EF6C0: .4byte 0x000027d0 + thumb_func_end sub_80EF64C + + thumb_func_start sub_80EF6C4 +sub_80EF6C4: @ 80EF6C4 + push {lr} + movs r0, 0x2 + bl sub_80EF550 + ldr r0, _080EF6F4 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF6F0 + ldr r2, _080EF6F8 + ldr r0, _080EF6FC + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080EF700 + adds r0, r1 + movs r1, 0x6 + bl sub_811F88C +_080EF6F0: + pop {r0} + bx r0 + .align 2, 0 +_080EF6F4: .4byte 0x020375f0 +_080EF6F8: .4byte 0x03005d8c +_080EF6FC: .4byte 0x030060bc +_080EF700: .4byte 0x000027d0 + thumb_func_end sub_80EF6C4 + + thumb_func_start sub_80EF704 +sub_80EF704: @ 80EF704 + push {r4-r6,lr} + movs r0, 0x3 + bl sub_80EF550 + ldr r0, _080EF77C + ldrh r0, [r0] + cmp r0, 0 + bne _080EF774 + ldr r6, _080EF780 + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0x64 + muls r0, r5 + ldr r4, _080EF784 + adds r0, r4 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, _080EF788 + adds r1, r0 + adds r0, r6, 0 + bl gf_strcpy + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r5 + adds r0, r4 + ldr r4, _080EF78C + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + ldr r2, _080EF790 + ldr r0, _080EF794 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080EF798 + adds r0, r1 + movs r1, 0x2 + bl sub_811F88C +_080EF774: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EF77C: .4byte 0x020375f0 +_080EF780: .4byte 0x02021cc4 +_080EF784: .4byte 0x020244ec +_080EF788: .4byte 0x083185c8 +_080EF78C: .4byte 0x02021dc4 +_080EF790: .4byte 0x03005d8c +_080EF794: .4byte 0x030060bc +_080EF798: .4byte 0x000027e8 + thumb_func_end sub_80EF704 + + thumb_func_start sub_80EF79C +sub_80EF79C: @ 80EF79C + ldr r1, _080EF7A4 + movs r0, 0x1 + strh r0, [r1] + bx lr + .align 2, 0 +_080EF7A4: .4byte 0x020375f0 + thumb_func_end sub_80EF79C + + thumb_func_start sub_80EF7A8 +sub_80EF7A8: @ 80EF7A8 + push {lr} + movs r0, 0x5 + bl sub_80EF550 + pop {r0} + bx r0 + thumb_func_end sub_80EF7A8 + + thumb_func_start sub_80EF7B4 +sub_80EF7B4: @ 80EF7B4 + push {lr} + movs r0, 0x6 + bl sub_80EF550 + ldr r0, _080EF7E4 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF7E0 + ldr r2, _080EF7E8 + ldr r0, _080EF7EC + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080EF7F0 + adds r0, r1 + movs r1, 0x2 + bl sub_811F88C +_080EF7E0: + pop {r0} + bx r0 + .align 2, 0 +_080EF7E4: .4byte 0x020375f0 +_080EF7E8: .4byte 0x03005d8c +_080EF7EC: .4byte 0x030060bc +_080EF7F0: .4byte 0x000027d0 + thumb_func_end sub_80EF7B4 + + thumb_func_start sub_80EF7F4 +sub_80EF7F4: @ 80EF7F4 + push {lr} + movs r0, 0x8 + bl sub_80EF550 + pop {r0} + bx r0 + thumb_func_end sub_80EF7F4 + + thumb_func_start sub_80EF800 +sub_80EF800: @ 80EF800 + push {lr} + movs r0, 0x9 + bl sub_80EF550 + pop {r0} + bx r0 + thumb_func_end sub_80EF800 + + thumb_func_start sub_80EF80C +sub_80EF80C: @ 80EF80C + push {lr} + movs r0, 0x7 + bl sub_80EF550 + ldr r0, _080EF83C + ldrh r0, [r0] + cmp r0, 0 + bne _080EF838 + ldr r2, _080EF840 + ldr r0, _080EF844 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080EF848 + adds r0, r1 + movs r1, 0x1 + bl sub_811F88C +_080EF838: + pop {r0} + bx r0 + .align 2, 0 +_080EF83C: .4byte 0x020375f0 +_080EF840: .4byte 0x03005d8c +_080EF844: .4byte 0x030060bc +_080EF848: .4byte 0x000027e4 + thumb_func_end sub_80EF80C + + thumb_func_start sub_80EF84C +sub_80EF84C: @ 80EF84C + push {lr} + movs r0, 0xB + bl sub_80EF550 + ldr r0, _080EF87C + ldrh r0, [r0] + cmp r0, 0 + bne _080EF878 + ldr r2, _080EF880 + ldr r0, _080EF884 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080EF888 + adds r0, r1 + movs r1, 0x1 + bl sub_811F88C +_080EF878: + pop {r0} + bx r0 + .align 2, 0 +_080EF87C: .4byte 0x020375f0 +_080EF880: .4byte 0x03005d8c +_080EF884: .4byte 0x030060bc +_080EF888: .4byte 0x000027e0 + thumb_func_end sub_80EF84C + + thumb_func_start sub_80EF88C +sub_80EF88C: @ 80EF88C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, _080EF8E0 + adds r5, r1, r0 + ldr r6, _080EF8E4 + adds r0, r5, 0 + movs r1, 0x2 + adds r2, r6, 0 + 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 _080EF8EC + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r0, r1 + ldr r1, _080EF8E8 + adds r0, r1 + adds r1, r6, 0 + bl sub_8008C44 + cmp r0, 0 + bne _080EF8EC + movs r0, 0 + b _080EF8EE + .align 2, 0 +_080EF8E0: .4byte 0x020244ec +_080EF8E4: .4byte 0x02021cc4 +_080EF8E8: .4byte 0x083185c8 +_080EF8EC: + movs r0, 0x1 +_080EF8EE: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EF88C + + thumb_func_start sub_80EF8F8 +sub_80EF8F8: @ 80EF8F8 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + bl sub_80EF88C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80EF8F8 + + thumb_func_start sub_80EF910 +sub_80EF910: @ 80EF910 + push {lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 2 + adds r2, r0 + movs r0, 0 + strb r0, [r2] + strb r0, [r2, 0x1] + movs r1, 0 + adds r2, 0x2 + movs r3, 0 +_080EF92A: + adds r0, r2, r1 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x21 + bls _080EF92A + pop {r0} + bx r0 + thumb_func_end sub_80EF910 + + thumb_func_start sub_80EF93C +sub_80EF93C: @ 80EF93C + push {r4-r7,lr} + adds r4, r0, 0 + movs r5, 0 +_080EF942: + lsls r0, r5, 3 + adds r0, r5 + lsls r1, r0, 2 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080EF986 + adds r0, r5, 0x1 + b _080EF97E +_080EF954: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _080EF97C + adds r1, r4 + adds r0, r3, 0 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_80EF910 + b _080EF986 +_080EF97C: + adds r0, r2, 0x1 +_080EF97E: + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _080EF954 +_080EF986: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080EF942 + movs r5, 0x5 +_080EF992: + lsls r0, r5, 3 + adds r0, r5 + lsls r1, r0, 2 + adds r0, r1, r4 + ldrb r0, [r0] + adds r5, 0x1 + cmp r0, 0 + bne _080EF9D8 + lsls r0, r5, 24 + b _080EF9D2 +_080EF9A6: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _080EF9CE + adds r1, r4 + adds r0, r3, 0 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_80EF910 + b _080EF9D8 +_080EF9CE: + adds r0, r2, 0x1 + lsls r0, 24 +_080EF9D2: + lsrs r2, r0, 24 + cmp r2, 0x17 + bls _080EF9A6 +_080EF9D8: + lsls r0, r5, 24 + lsrs r5, r0, 24 + cmp r5, 0x17 + bls _080EF992 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EF93C + + thumb_func_start sub_80EF9E8 +sub_80EF9E8: @ 80EF9E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + lsrs r0, 16 + bl sub_80EFA24 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _080EFA1C + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0xB + muls r1, r5 + ldr r2, _080EFA20 + adds r1, r2 + bl gf_strcpy + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080EFA1C: .4byte 0x0858d144 +_080EFA20: .4byte 0x083185c8 + thumb_func_end sub_80EF9E8 + + thumb_func_start sub_80EFA24 +sub_80EFA24: @ 80EFA24 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, _080EFA44 + bl __umodsi3 + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + b _080EFA62 + .align 2, 0 +_080EFA44: .4byte 0x0000019b +_080EFA48: + cmp r4, 0x1 + bne _080EFA54 + ldr r4, _080EFA50 + b _080EFA5A + .align 2, 0 +_080EFA50: .4byte 0x0000019b +_080EFA54: + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_080EFA5A: + cmp r4, r6 + bne _080EFA62 + adds r4, r5, 0 + b _080EFA7E +_080EFA62: + adds r0, r4, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080EFA48 + cmp r4, r5 + beq _080EFA48 +_080EFA7E: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EFA24 + + thumb_func_start sub_80EFA88 +sub_80EFA88: @ 80EFA88 + push {lr} + ldr r0, _080EFAB8 + ldr r0, [r0] + ldr r1, _080EFABC + adds r0, r1 + bl sub_80EFADC + ldr r1, _080EFAC0 + strb r0, [r1] + ldr r2, _080EFAC4 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + strh r1, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080EFACC + ldr r1, _080EFAC8 + movs r0, 0x1 + b _080EFAD0 + .align 2, 0 +_080EFAB8: .4byte 0x03005d8c +_080EFABC: .4byte 0x000027cc +_080EFAC0: .4byte 0x030060bc +_080EFAC4: .4byte 0x020375e4 +_080EFAC8: .4byte 0x020375f0 +_080EFACC: + ldr r1, _080EFAD8 + movs r0, 0 +_080EFAD0: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080EFAD8: .4byte 0x020375f0 + thumb_func_end sub_80EFA88 + + thumb_func_start sub_80EFADC +sub_80EFADC: @ 80EFADC + push {lr} + adds r2, r0, 0 + movs r1, 0 +_080EFAE2: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EFAF6 + lsls r0, r1, 24 + asrs r0, 24 + b _080EFB04 +_080EFAF6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _080EFAE2 + movs r0, 0x1 + negs r0, r0 +_080EFB04: + pop {r1} + bx r1 + thumb_func_end sub_80EFADC + + thumb_func_start sub_80EFB08 +sub_80EFB08: @ 80EFB08 + push {lr} + adds r2, r0, 0 + movs r1, 0x5 +_080EFB0E: + lsls r0, r1, 24 + asrs r1, r0, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EFB24 + adds r0, r1, 0 + b _080EFB34 +_080EFB24: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x17 + ble _080EFB0E + movs r0, 0x1 + negs r0, r0 +_080EFB34: + pop {r1} + bx r1 + thumb_func_end sub_80EFB08 + + thumb_func_start sub_80EFB38 +sub_80EFB38: @ 80EFB38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bls _080EFB50 + movs r0, 0x1 + b _080EFB52 +_080EFB50: + movs r0, 0 +_080EFB52: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EFB38 + + thumb_func_start sub_80EFB58 +sub_80EFB58: @ 80EFB58 + push {r4-r6,lr} + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r4, 0x4 + ldr r6, _080EFB74 + b _080EFB7E + .align 2, 0 +_080EFB74: .4byte 0x0000ffff +_080EFB78: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080EFB7E: + cmp r2, 0x6 + bne _080EFB84 + movs r2, 0 +_080EFB84: + lsls r1, r2, 1 + adds r0, r5, r1 + ldrh r0, [r0] + adds r3, r4, 0x4 + cmp r0, r6 + beq _080EFB78 + ldr r0, _080EFBA0 + adds r1, r3, r1 + ldrh r1, [r1] + bl sub_811EBBC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EFBA0: .4byte 0x02021ec4 + thumb_func_end sub_80EFB58 + + thumb_func_start sub_80EFBA4 +sub_80EFBA4: @ 80EFBA4 + push {lr} + adds r2, r0, 0 + movs r3, 0 + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0xFF + beq _080EFBD0 + adds r2, 0x4 +_080EFBB4: + adds r0, r2, r1 + ldrb r0, [r0] + adds r0, r3, r0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bhi _080EFBD0 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EFBB4 +_080EFBD0: + movs r0, 0x7 + ands r3, r0 + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_80EFBA4 + + thumb_func_start sub_80EFBDC +sub_80EFBDC: @ 80EFBDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + movs r2, 0 + movs r7, 0xFF +_080EFC06: + mov r1, sp + adds r0, r1, r2 + ldrb r1, [r0] + orrs r1, r7 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _080EFC06 + cmp r3, 0 + bne _080EFC72 + mov r4, r8 + adds r4, 0xF + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r6, 0 + bne _080EFC36 + mov r0, sp + adds r1, r4, r5 + b _080EFC40 +_080EFC36: + cmp r6, 0x1 + bne _080EFC46 + mov r0, sp + subs r1, r2, r5 + adds r1, r4, r1 +_080EFC40: + ldrb r1, [r1] + strb r1, [r0] + b _080EFC6C +_080EFC46: + cmp r6, 0x2 + bne _080EFC56 + mov r1, sp + adds r0, r4, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + b _080EFC66 +_080EFC56: + mov r1, sp + subs r0, r2, 0x2 + subs r0, r5 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1] + subs r0, r2, 0x1 + subs r0, r5 +_080EFC66: + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1, 0x1] +_080EFC6C: + mov r2, r8 + ldrb r1, [r2, 0x1E] + b _080EFCC8 +_080EFC72: + cmp r3, 0x1 + bne _080EFCD0 + mov r4, r8 + adds r4, 0x4 + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r6, 0 + bne _080EFC8E + mov r0, sp + adds r1, r4, r5 + b _080EFC98 +_080EFC8E: + cmp r6, 0x1 + bne _080EFC9E + mov r0, sp + subs r1, r2, r5 + adds r1, r4, r1 +_080EFC98: + ldrb r1, [r1] + strb r1, [r0] + b _080EFCC4 +_080EFC9E: + cmp r6, 0x2 + bne _080EFCAE + mov r1, sp + adds r0, r4, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + b _080EFCBE +_080EFCAE: + mov r1, sp + subs r0, r2, 0x2 + subs r0, r5 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1] + subs r0, r2, 0x1 + subs r0, r5 +_080EFCBE: + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1, 0x1] +_080EFCC4: + mov r5, r8 + ldrb r1, [r5, 0x1F] +_080EFCC8: + mov r0, sp + bl sub_8009308 + b _080EFD30 +_080EFCD0: + movs r0, 0xB + muls r4, r0 + ldr r7, _080EFCEC + adds r0, r4, r7 + bl sub_8008C24 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r6, 0 + bne _080EFCF0 + mov r0, sp + adds r1, r5, r4 + b _080EFCFA + .align 2, 0 +_080EFCEC: .4byte 0x083185c8 +_080EFCF0: + cmp r6, 0x1 + bne _080EFD02 + mov r0, sp + subs r1, r2, r5 + adds r1, r4 +_080EFCFA: + adds r1, r7 + ldrb r1, [r1] + strb r1, [r0] + b _080EFD30 +_080EFD02: + cmp r6, 0x2 + bne _080EFD16 + mov r1, sp + adds r0, r5, r4 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + adds r0, r5, r0 + b _080EFD2A +_080EFD16: + mov r1, sp + subs r0, r2, 0x2 + subs r0, r5 + adds r0, r4 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r1] + subs r0, r2, 0x1 + subs r0, r5 + adds r0, r4 +_080EFD2A: + adds r0, r7 + ldrb r0, [r0] + strb r0, [r1, 0x1] +_080EFD30: + ldr r0, _080EFD50 + mov r2, r9 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + mov r1, sp + bl gf_strcpy + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080EFD50: .4byte 0x0858d144 + thumb_func_end sub_80EFBDC + + thumb_func_start sub_80EFD54 +sub_80EFD54: @ 80EFD54 + push {r4,lr} + movs r1, 0 + ldr r0, _080EFD78 + ldr r3, [r0] + ldr r0, _080EFD7C + ldrh r2, [r0] + ldr r4, _080EFD80 +_080EFD62: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r2 + bne _080EFD84 + movs r0, 0x1 + b _080EFD90 + .align 2, 0 +_080EFD78: .4byte 0x03005d8c +_080EFD7C: .4byte 0x020375e0 +_080EFD80: .4byte 0x000027cc +_080EFD84: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _080EFD62 + movs r0, 0 +_080EFD90: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EFD54 + + thumb_func_start sub_80EFD98 +sub_80EFD98: @ 80EFD98 + push {r4,lr} + ldr r0, _080EFDC4 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080EFDC8 + adds r0, r1 + ldr r4, _080EFDCC + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + ldr r0, _080EFDD0 + adds r1, r4, 0 + bl sub_8008C44 + cmp r0, 0 + beq _080EFDD4 + bl sub_80ED320 + movs r0, 0x1 + b _080EFDD6 + .align 2, 0 +_080EFDC4: .4byte 0x020375e0 +_080EFDC8: .4byte 0x020244ec +_080EFDCC: .4byte 0x02021cc4 +_080EFDD0: .4byte 0x02021ec4 +_080EFDD4: + movs r0, 0 +_080EFDD6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EFD98 + + thumb_func_start sub_80EFDDC +sub_80EFDDC: @ 80EFDDC + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x8 + ldr r0, _080EFE84 + mov r9, r0 + ldrh r0, [r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, _080EFE88 + adds r0, r6 + ldr r2, _080EFE8C + movs r1, 0x2 + bl pokemon_getattr + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + ldr r1, _080EFE90 + mov r10, r1 + movs r1, 0x2 + mov r2, r10 + bl pokemon_getattr + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + bl pokemon_get_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, _080EFE94 + str r0, [sp, 0x4] + movs r0, 0x3 + mov r1, r10 + adds r2, r5, 0 + adds r3, r4, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EFE84: .4byte 0x020375e0 +_080EFE88: .4byte 0x020244ec +_080EFE8C: .4byte 0x02021ec4 +_080EFE90: .4byte 0x02021dc4 +_080EFE94: .4byte c2_080CC144 + 1 + thumb_func_end sub_80EFDDC + + thumb_func_start c2_080CC144 +c2_080CC144: @ 80EFE98 + push {lr} + ldr r0, _080EFEB8 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080EFEBC + adds r0, r1 + ldr r2, _080EFEC0 + movs r1, 0x2 + bl pokemon_setattr + bl c2_exit_to_overworld_1_continue_scripts_restart_music + pop {r0} + bx r0 + .align 2, 0 +_080EFEB8: .4byte 0x020375e0 +_080EFEBC: .4byte 0x020244ec +_080EFEC0: .4byte 0x02021dc4 + thumb_func_end c2_080CC144 + + thumb_func_start sub_80EFEC4 +sub_80EFEC4: @ 80EFEC4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + ldr r0, _080EFF34 + ldrb r0, [r0] + ldr r1, _080EFF38 + ldrb r1, [r1] + bl get_pokemon_by_box_and_pos + adds r6, r0, 0 + ldr r2, _080EFF3C + movs r1, 0x2 + bl pokemon_getattr_encrypted + ldr r0, _080EFF40 + mov r8, r0 + adds r0, r6, 0 + movs r1, 0x2 + mov r2, r8 + bl pokemon_getattr_encrypted + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl pokemon_roll_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + str r0, [sp] + ldr r0, _080EFF44 + str r0, [sp, 0x4] + movs r0, 0x3 + mov r1, r8 + adds r2, r5, 0 + adds r3, r4, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080EFF34: .4byte 0x020375f6 +_080EFF38: .4byte 0x020375f8 +_080EFF3C: .4byte 0x02021ec4 +_080EFF40: .4byte 0x02021dc4 +_080EFF44: .4byte sub_80EFF48 + 1 + thumb_func_end sub_80EFEC4 + + thumb_func_start sub_80EFF48 +sub_80EFF48: @ 80EFF48 + push {lr} + ldr r0, _080EFF60 + ldrb r0, [r0] + ldr r1, _080EFF64 + ldrb r1, [r1] + ldr r2, _080EFF68 + bl sub_80D1E90 + bl c2_exit_to_overworld_1_continue_scripts_restart_music + pop {r0} + bx r0 + .align 2, 0 +_080EFF60: .4byte 0x020375f6 +_080EFF64: .4byte 0x020375f8 +_080EFF68: .4byte 0x02021dc4 + thumb_func_end sub_80EFF48 + + thumb_func_start sub_80EFF6C +sub_80EFF6C: @ 80EFF6C + push {r4,lr} + ldr r0, _080EFF90 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080EFF94 + adds r0, r1 + ldr r4, _080EFF98 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EFF90: .4byte 0x020375e0 +_080EFF94: .4byte 0x020244ec +_080EFF98: .4byte 0x02021cc4 + thumb_func_end sub_80EFF6C + + thumb_func_start sub_80EFF9C +sub_80EFF9C: @ 80EFF9C + push {r4,lr} + bl sub_80F0020 + adds r4, r0, 0 + ldr r0, _080EFFC4 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080EFFC8 + adds r0, r1 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bne _080EFFD0 + ldr r1, _080EFFCC + movs r0, 0 + b _080EFFD4 + .align 2, 0 +_080EFFC4: .4byte 0x020375e0 +_080EFFC8: .4byte 0x020244ec +_080EFFCC: .4byte 0x020375f0 +_080EFFD0: + ldr r1, _080EFFDC + movs r0, 0x1 +_080EFFD4: + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080EFFDC: .4byte 0x020375f0 + thumb_func_end sub_80EFF9C + + thumb_func_start sub_80EFFE0 +sub_80EFFE0: @ 80EFFE0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r1, 0 + beq _080F0016 + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080EFFFA + movs r0, 0x2 + b _080F001C +_080EFFFA: + adds r0, r1, 0 + subs r0, 0x15 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080F000A + movs r0, 0x3 + b _080F001C +_080F000A: + adds r0, r2, 0 + subs r0, 0x29 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _080F001A +_080F0016: + movs r0, 0 + b _080F001C +_080F001A: + movs r0, 0x4 +_080F001C: + pop {r1} + bx r1 + thumb_func_end sub_80EFFE0 + + thumb_func_start sub_80F0020 +sub_80F0020: @ 80F0020 + ldr r0, _080F003C + ldr r2, [r0] + ldrb r0, [r2, 0xD] + lsls r0, 24 + ldrb r1, [r2, 0xC] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0xB] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0xA] + orrs r0, r1 + bx lr + .align 2, 0 +_080F003C: .4byte 0x03005d90 + thumb_func_end sub_80F0020 + + thumb_func_start sub_80F0040 +sub_80F0040: @ 80F0040 + push {lr} + ldr r0, _080F0064 + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x1 + bne _080F0060 + ldr r0, _080F0068 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080F006C + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _080F0074 +_080F0060: + movs r0, 0 + b _080F009E + .align 2, 0 +_080F0064: .4byte 0x03005d8c +_080F0068: .4byte 0x03005d90 +_080F006C: + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bne _080F0060 +_080F0074: + ldr r0, _080F0098 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0092 + movs r0, 0x89 + lsls r0, 4 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F009C +_080F0092: + movs r0, 0x1 + b _080F009E + .align 2, 0 +_080F0098: .4byte 0x000008bd +_080F009C: + movs r0, 0x2 +_080F009E: + pop {r1} + bx r1 + thumb_func_end sub_80F0040 + + thumb_func_start sub_80F00A4 +sub_80F00A4: @ 80F00A4 + push {r4,lr} + ldr r0, _080F00D8 + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x1 + bne _080F0104 + ldr r0, _080F00DC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080F00EC + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0 + bne _080F0104 + ldr r0, _080F00E0 + ldr r1, _080F00E4 + bl gf_strcpy + ldr r0, _080F00E8 + movs r1, 0x1 + bl var_set + b _080F0104 + .align 2, 0 +_080F00D8: .4byte 0x03005d8c +_080F00DC: .4byte 0x03005d90 +_080F00E0: .4byte 0x02021cc4 +_080F00E4: .4byte 0x085ead08 +_080F00E8: .4byte 0x00004003 +_080F00EC: + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bne _080F0104 + ldr r0, _080F014C + ldr r1, _080F0150 + bl gf_strcpy + ldr r0, _080F0154 + movs r1, 0x1 + bl var_set +_080F0104: + ldr r4, _080F0154 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _080F0142 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _080F0158 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080F016C + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F0158 +_080F0142: + ldr r0, _080F014C + ldr r1, _080F0150 + bl gf_strcpy + b _080F01A8 + .align 2, 0 +_080F014C: .4byte 0x02021cc4 +_080F0150: .4byte 0x085ead08 +_080F0154: .4byte 0x00004003 +_080F0158: + ldr r0, _080F0164 + ldr r1, _080F0168 + bl gf_strcpy + b _080F01A8 + .align 2, 0 +_080F0164: .4byte 0x02021cc4 +_080F0168: .4byte 0x085ead04 +_080F016C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F0198 + ldr r0, _080F0190 + ldr r1, _080F0194 + bl gf_strcpy + adds r0, r4, 0 + movs r1, 0x1 + bl var_set + b _080F01A8 + .align 2, 0 +_080F0190: .4byte 0x02021cc4 +_080F0194: .4byte 0x085ead08 +_080F0198: + ldr r0, _080F01B0 + ldr r1, _080F01B4 + bl gf_strcpy + adds r0, r4, 0 + movs r1, 0x2 + bl var_set +_080F01A8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F01B0: .4byte 0x02021cc4 +_080F01B4: .4byte 0x085ead04 + thumb_func_end sub_80F00A4 + + thumb_func_start start_menu_append_item +start_menu_append_item: @ 80F01B8 + push {lr} + ldr r0, _080F01DC + movs r1, 0 + bl var_set + ldr r0, _080F01E0 + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x5 + bl npc_hide_by_local_id_and_map + ldr r0, _080F01E4 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_080F01DC: .4byte 0x000040bc +_080F01E0: .4byte 0x03005d8c +_080F01E4: .4byte 0x00000396 + thumb_func_end start_menu_append_item + + thumb_func_start sub_80F01E8 +sub_80F01E8: @ 80F01E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0xE1 + lsls r0, 4 + bl malloc + mov r8, r0 + cmp r0, 0 + bne _080F0206 + b _080F0344 +_080F0206: + movs r4, 0 +_080F0208: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 5 + adds r0, r4 + lsls r0, 2 + add r0, r8 + adds r1, r4, 0 + muls r1, r5 + adds r1, r7, r1 + movs r2, 0xE1 + lsls r2, 2 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080F0208 + mov r5, r8 + movs r4, 0 + ldr r7, _080F0234 + b _080F0276 + .align 2, 0 +_080F0234: .4byte 0x020229e8 +_080F0238: + lsls r0, r4, 3 + subs r2, r0, r4 + lsls r0, r2, 2 + adds r3, r0, r7 + ldrb r1, [r3] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080F025A + lsls r0, r2, 5 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + bl sub_80F1254 + b _080F0270 +_080F025A: + cmp r1, 0x3 + bne _080F0270 + ldrh r0, [r3, 0x1A] + cmp r0, 0x1 + bne _080F0270 + lsls r0, r2, 5 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + bl sub_80F12A4 +_080F0270: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080F0276: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _080F0238 + cmp r6, 0x1 + beq _080F02C4 + cmp r6, 0x1 + bgt _080F0290 + cmp r6, 0 + beq _080F029A + b _080F031E +_080F0290: + cmp r6, 0x2 + beq _080F02DC + cmp r6, 0x3 + beq _080F0304 + b _080F031E +_080F029A: + ldr r0, _080F02B8 + ldr r0, [r0] + ldr r1, _080F02BC + adds r0, r1 + movs r2, 0xE1 + lsls r2, 2 + adds r1, r5, r2 + movs r3, 0xE1 + lsls r3, 3 + adds r2, r5, r3 + ldr r4, _080F02C0 + adds r3, r5, r4 + bl sub_80F0358 + b _080F031E + .align 2, 0 +_080F02B8: .4byte 0x03005d8c +_080F02BC: .4byte 0x000027cc +_080F02C0: .4byte 0x00000a8c +_080F02C4: + ldr r0, _080F02D4 + ldr r1, [r0] + ldr r0, _080F02D8 + adds r1, r0 + movs r3, 0xE1 + lsls r3, 3 + adds r2, r5, r3 + b _080F02EA + .align 2, 0 +_080F02D4: .4byte 0x03005d8c +_080F02D8: .4byte 0x000027cc +_080F02DC: + movs r0, 0xE1 + lsls r0, 2 + adds r1, r5, r0 + ldr r0, _080F02F8 + ldr r2, [r0] + ldr r3, _080F02FC + adds r2, r3 +_080F02EA: + ldr r4, _080F0300 + adds r3, r5, r4 + adds r0, r5, 0 + bl sub_80F0358 + b _080F031E + .align 2, 0 +_080F02F8: .4byte 0x03005d8c +_080F02FC: .4byte 0x000027cc +_080F0300: .4byte 0x00000a8c +_080F0304: + movs r0, 0xE1 + lsls r0, 2 + adds r1, r5, r0 + movs r3, 0xE1 + lsls r3, 3 + adds r2, r5, r3 + ldr r0, _080F0350 + ldr r3, [r0] + ldr r4, _080F0354 + adds r3, r4 + adds r0, r5, 0 + bl sub_80F0358 +_080F031E: + ldr r5, _080F0350 + ldr r0, [r5] + ldr r4, _080F0354 + adds r0, r4 + bl sub_80EF93C + bl sub_80F0C04 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C + bl sub_80F0708 + bl sub_80F0B64 + mov r0, r8 + bl free +_080F0344: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F0350: .4byte 0x03005d8c +_080F0354: .4byte 0x000027cc + thumb_func_end sub_80F01E8 + + thumb_func_start sub_80F0358 +sub_80F0358: @ 80F0358 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + add r0, sp, 0x10 + str r0, [sp] + add r0, sp, 0x14 + str r0, [sp, 0x4] + add r0, sp, 0x18 + str r0, [sp, 0x8] + add r0, sp, 0x1C + str r0, [sp, 0xC] + bl sub_8009FCC + ldr r1, _080F03D4 + strb r0, [r1] +_080F0384: + movs r6, 0 + ldr r0, _080F03D4 + ldrb r1, [r0] + cmp r6, r1 + bcs _080F0384 + mov r10, r0 +_080F0390: + cmp r6, 0 + bne _080F0398 + ldr r2, _080F03D8 + strb r6, [r2] +_080F0398: + lsls r4, r6, 2 + mov r3, sp + adds r0, r3, r4 + ldr r0, [r0] + ldr r0, [r0] + bl sub_80F06D0 + ldr r1, _080F03DC + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + adds r7, r4, 0 + cmp r0, r1 + bne _080F03E0 + ldr r1, _080F03D8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + mov r2, r10 + ldrb r2, [r2] + cmp r0, r2 + beq _080F048C + adds r6, 0x1 + mov r9, r6 + b _080F0470 + .align 2, 0 +_080F03D4: .4byte 0x03001174 +_080F03D8: .4byte 0x0203a02c +_080F03DC: .4byte 0x03001176 +_080F03E0: + movs r5, 0 + mov r3, r10 + ldrb r0, [r3] + subs r0, 0x1 + adds r2, r6, 0x1 + mov r9, r2 + cmp r5, r0 + bge _080F0456 + ldr r3, _080F0480 + mov r8, r3 +_080F03F4: + adds r0, r6, r5 + adds r4, r0, 0x1 + mov r0, r8 + ldrb r1, [r0] + adds r0, r4, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r0, [r0] + bl sub_80EFB08 + ldr r1, _080F0484 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080F0446 + mov r2, r8 + ldrb r1, [r2] + adds r0, r4, 0 + bl __modsi3 + adds r2, r0, 0 + lsls r0, r2, 2 + add r0, sp + ldr r0, [r0] + mov r3, sp + adds r1, r3, r7 + ldr r1, [r1] + lsls r2, 24 + lsrs r2, 24 + bl sub_80F049C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0456 +_080F0446: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _080F03F4 +_080F0456: + mov r2, r10 + ldrb r0, [r2] + subs r0, 0x1 + cmp r5, r0 + bne _080F0470 + mov r3, sp + adds r0, r3, r7 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, _080F0488 + ldrb r1, [r1] + bl sub_80EF910 +_080F0470: + mov r1, r9 + lsls r0, r1, 24 + lsrs r6, r0, 24 + mov r2, r10 + ldrb r2, [r2] + cmp r6, r2 + bcc _080F0390 + b _080F0384 + .align 2, 0 +_080F0480: .4byte 0x03001174 +_080F0484: .4byte 0x030060bc +_080F0488: .4byte 0x03001176 +_080F048C: + 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_80F0358 + + thumb_func_start sub_80F049C +sub_80F049C: @ 80F049C + push {r4-r7,lr} + sub sp, 0x4 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r4, [r0] + ldr r6, [r1] + movs r5, 0 + ldr r2, _080F04D8 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0] + str r2, [sp] + bl sub_80EFFE0 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + ldr r2, [sp] + cmp r0, 0x3 + beq _080F050C + cmp r0, 0x3 + bgt _080F04DC + cmp r0, 0x2 + beq _080F04E2 + b _080F055A + .align 2, 0 +_080F04D8: .4byte 0x03001176 +_080F04DC: + cmp r1, 0x4 + beq _080F0534 + b _080F055A +_080F04E2: + ldr r0, _080F0508 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r6, r1 + adds r2, r7, 0 + bl sub_80F0580 + b _080F0556 + .align 2, 0 +_080F0508: .4byte 0x030060bc +_080F050C: + ldr r0, _080F0530 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r6, r1 + adds r2, r7, 0 + bl sub_80F05E8 + b _080F0556 + .align 2, 0 +_080F0530: .4byte 0x030060bc +_080F0534: + ldr r0, _080F0564 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r6, r1 + adds r2, r7, 0 + bl sub_80F0668 +_080F0556: + lsls r0, 24 + lsrs r5, r0, 24 +_080F055A: + cmp r5, 0x1 + beq _080F0568 + movs r0, 0 + b _080F0574 + .align 2, 0 +_080F0564: .4byte 0x030060bc +_080F0568: + ldr r0, _080F057C + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80EF910 + movs r0, 0x1 +_080F0574: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080F057C: .4byte 0x03001176 + thumb_func_end sub_80F049C + + thumb_func_start sub_80F0580 +sub_80F0580: @ 80F0580 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_800A2A4 + adds r5, r0, 0 + movs r2, 0xFF + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r1, [r1] + cmp r0, r1 + bne _080F05B0 + lsrs r0, r5, 8 + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080F05B0 + movs r0, 0 + b _080F05E0 +_080F05B0: + adds r1, r4, 0 + adds r1, 0x20 + ldrb r0, [r1] + adds r2, r4, 0 + adds r2, 0x22 + strb r0, [r2] + adds r3, r4, 0 + adds r3, 0x21 + ldrb r0, [r3] + adds r2, 0x1 + strb r0, [r2] + strb r5, [r1] + lsrs r0, r5, 8 + strb r0, [r3] + adds r1, r6, 0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6, 0x1] +_080F05E0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F0580 + + thumb_func_start sub_80F05E8 +sub_80F05E8: @ 80F05E8 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_800A2A4 + adds r2, r0, 0 + movs r3, 0xFF + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0614 + lsrs r0, r2, 8 + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r0, r1 + beq _080F0634 +_080F0614: + movs r3, 0xFF + adds r0, r2, 0 + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x22 + lsrs r5, r2, 8 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0638 + adds r0, r5, 0 + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0638 +_080F0634: + movs r0, 0 + b _080F0660 +_080F0638: + ldrb r1, [r4, 0x1E] + adds r0, r4, 0 + adds r0, 0x20 + strb r1, [r0] + ldrb r0, [r4, 0x1F] + adds r1, r4, 0 + adds r1, 0x21 + strb r0, [r1] + strb r2, [r4, 0x1E] + strb r5, [r4, 0x1F] + adds r1, r6, 0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6, 0x1] +_080F0660: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F05E8 + + thumb_func_start sub_80F0668 +sub_80F0668: @ 80F0668 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_800A2A4 + adds r5, r0, 0 + movs r2, 0xFF + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0698 + lsrs r0, r5, 8 + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0698 + movs r0, 0 + b _080F06CA +_080F0698: + adds r1, r4, 0 + adds r1, 0x20 + ldrb r0, [r1] + adds r2, r4, 0 + adds r2, 0x22 + strb r0, [r2] + adds r3, r4, 0 + adds r3, 0x21 + ldrb r0, [r3] + adds r2, 0x1 + strb r0, [r2] + strb r5, [r1] + lsrs r0, r5, 8 + strb r0, [r3] + adds r1, r6, 0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6, 0x1] + strh r0, [r6, 0x16] +_080F06CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F0668 + + thumb_func_start sub_80F06D0 +sub_80F06D0: @ 80F06D0 + push {lr} + adds r3, r0, 0 + movs r2, 0 +_080F06D6: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r3 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _080F06F6 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _080F06F6 + lsls r0, r2, 24 + asrs r0, 24 + b _080F0704 +_080F06F6: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x17 + bls _080F06D6 + movs r0, 0x1 + negs r0, r0 +_080F0704: + pop {r1} + bx r1 + thumb_func_end sub_80F06D0 + + thumb_func_start sub_80F0708 +sub_80F0708: @ 80F0708 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 +_080F0716: + ldr r3, _080F073C + ldr r1, [r3] + mov r4, r9 + lsls r2, r4, 3 + adds r0, r2, r4 + lsls r0, 2 + adds r1, r0 + ldr r0, _080F0740 + adds r1, r0 + ldrb r0, [r1] + adds r7, r2, 0 + cmp r0, 0x29 + bls _080F0732 + b _080F0AD8 +_080F0732: + lsls r0, 2 + ldr r1, _080F0744 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F073C: .4byte 0x03005d8c +_080F0740: .4byte 0x000027cc +_080F0744: .4byte _080F0748 + .align 2, 0 +_080F0748: + .4byte _080F0AE2 + .4byte _080F0848 + .4byte _080F0AE2 + .4byte _080F0860 + .4byte _080F0878 + .4byte _080F0890 + .4byte _080F08BC + .4byte _080F08D4 + .4byte _080F07F0 + .4byte _080F0AE2 + .4byte _080F081C + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0900 + .4byte _080F0AE2 + .4byte _080F0918 + .4byte _080F0944 + .4byte _080F095C + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0974 + .4byte _080F09A0 + .4byte _080F0AE2 + .4byte _080F09C0 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F09F4 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AD8 + .4byte _080F0AE2 +_080F07F0: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F0818 + adds r0, r6 + ldrh r0, [r0, 0x12] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x2] + b _080F09E6 + .align 2, 0 +_080F0818: .4byte 0x000027cc +_080F081C: + ldr r0, [r3] + mov r2, r9 + adds r4, r7, r2 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F0844 + adds r0, r6 + ldrh r0, [r0, 0x16] + lsls r5, r2, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x2] + b _080F09E6 + .align 2, 0 +_080F0844: .4byte 0x000027cc +_080F0848: + ldr r0, [r3] + mov r4, r9 + adds r1, r7, r4 + lsls r1, 2 + adds r1, r0 + ldr r0, _080F085C + adds r1, r0 + ldrh r0, [r1, 0x2] + b _080F09B0 + .align 2, 0 +_080F085C: .4byte 0x000027cc +_080F0860: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, _080F0874 + adds r1, r4 + ldrh r0, [r1, 0x2] + lsls r1, r2, 24 + b _080F09B2 + .align 2, 0 +_080F0874: .4byte 0x000027cc +_080F0878: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, _080F088C + adds r1, r4 + ldrh r0, [r1, 0x6] + lsls r1, r2, 24 + b _080F09B2 + .align 2, 0 +_080F088C: .4byte 0x000027cc +_080F0890: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F08B8 + adds r0, r6 + ldrh r0, [r0, 0x2] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x1C] + b _080F09E6 + .align 2, 0 +_080F08B8: .4byte 0x000027cc +_080F08BC: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, _080F08D0 + adds r1, r4 + ldrh r0, [r1, 0x2] + lsls r1, r2, 24 + b _080F09B2 + .align 2, 0 +_080F08D0: .4byte 0x000027cc +_080F08D4: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F08FC + adds r0, r6 + ldrh r0, [r0, 0xA] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x14] + b _080F09E6 + .align 2, 0 +_080F08FC: .4byte 0x000027cc +_080F0900: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, _080F0914 + adds r1, r4 + ldrh r0, [r1, 0x10] + lsls r1, r2, 24 + b _080F09B2 + .align 2, 0 +_080F0914: .4byte 0x000027cc +_080F0918: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F0940 + adds r0, r6 + ldrh r0, [r0, 0xC] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0xE] + b _080F09E6 + .align 2, 0 +_080F0940: .4byte 0x000027cc +_080F0944: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, _080F0958 + adds r1, r4 + ldrh r0, [r1, 0x4] + lsls r1, r2, 24 + b _080F09B2 + .align 2, 0 +_080F0958: .4byte 0x000027cc +_080F095C: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F0970 + adds r0, r6 + ldrh r0, [r0, 0x8] + b _080F09D0 + .align 2, 0 +_080F0970: .4byte 0x000027cc +_080F0974: + ldr r0, [r3] + mov r2, r9 + adds r4, r7, r2 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F099C + adds r0, r6 + ldrh r0, [r0, 0x2] + lsls r5, r2, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0xA] + b _080F09E6 + .align 2, 0 +_080F099C: .4byte 0x000027cc +_080F09A0: + ldr r0, [r3] + mov r4, r9 + adds r1, r7, r4 + lsls r1, 2 + adds r1, r0 + ldr r0, _080F09BC + adds r1, r0 + ldrh r0, [r1, 0x8] +_080F09B0: + lsls r1, r4, 24 +_080F09B2: + lsrs r1, 24 + bl sub_80F0B24 + b _080F0AE2 + .align 2, 0 +_080F09BC: .4byte 0x000027cc +_080F09C0: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, _080F09F0 + adds r0, r6 + ldrh r0, [r0, 0x6] +_080F09D0: + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x4] +_080F09E6: + adds r1, r5, 0 + bl sub_80F0B24 + b _080F0AE2 + .align 2, 0 +_080F09F0: .4byte 0x000027cc +_080F09F4: + ldr r0, [r3] + mov r2, r9 + adds r4, r7, r2 + lsls r4, 2 + adds r0, r4, r0 + ldr r5, _080F0A40 + adds r0, r5 + ldrh r0, [r0, 0x4] + lsls r2, 24 + mov r8, r2 + lsrs r6, r2, 24 + adds r1, r6, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r0, r4, r0 + adds r0, r5 + ldrh r0, [r0, 0x6] + adds r1, r6, 0 + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r5 + ldrb r0, [r4, 0xD] + subs r0, 0x1 + mov r6, r8 + cmp r0, 0xC + bhi _080F0AE2 + lsls r0, 2 + ldr r1, _080F0A44 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F0A40: .4byte 0x000027cc +_080F0A44: .4byte _080F0A48 + .align 2, 0 +_080F0A48: + .4byte _080F0A7C + .4byte _080F0AA0 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C +_080F0A7C: + ldr r0, _080F0A98 + ldr r1, [r0] + mov r4, r9 + adds r0, r7, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, _080F0A9C + adds r0, r1 + ldrh r0, [r0, 0x8] + lsrs r1, r6, 24 + bl sub_80F0B24 + b _080F0AE2 + .align 2, 0 +_080F0A98: .4byte 0x03005d8c +_080F0A9C: .4byte 0x000027cc +_080F0AA0: + ldr r2, _080F0AD0 + ldr r0, [r2] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r5, _080F0AD4 + adds r0, r5 + ldrh r0, [r0, 0x8] + lsrs r6, 24 + adds r1, r6, 0 + str r2, [sp] + bl sub_80F0B24 + ldr r2, [sp] + ldr r0, [r2] + adds r4, r0 + adds r4, r5 + ldrh r0, [r4, 0xA] + adds r1, r6, 0 + bl sub_80F0B24 + b _080F0AE2 + .align 2, 0 +_080F0AD0: .4byte 0x03005d8c +_080F0AD4: .4byte 0x000027cc +_080F0AD8: + mov r2, r9 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_80F0B00 +_080F0AE2: + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0x17 + bhi _080F0AF2 + b _080F0716 +_080F0AF2: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80F0708 + + thumb_func_start sub_80F0B00 +sub_80F0B00: @ 80F0B00 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080F0B1C + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + ldr r0, _080F0B20 + adds r2, r0 + movs r0, 0 + strb r0, [r2] + bx lr + .align 2, 0 +_080F0B1C: .4byte 0x03005d8c +_080F0B20: .4byte 0x000027cd + thumb_func_end sub_80F0B00 + + thumb_func_start sub_80F0B24 +sub_80F0B24: @ 80F0B24 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + asrs r2, r0, 24 + cmp r2, 0 + bne _080F0B56 + ldr r0, _080F0B5C + ldr r1, [r0] + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0 + ldr r0, _080F0B60 + adds r1, r0 + strb r2, [r1] +_080F0B56: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F0B5C: .4byte 0x03005d8c +_080F0B60: .4byte 0x000027cd + thumb_func_end sub_80F0B24 + + thumb_func_start sub_80F0B64 +sub_80F0B64: @ 80F0B64 + push {r4-r6,lr} + ldr r0, _080F0BA8 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0BA2 + movs r2, 0 + ldr r4, _080F0BAC + movs r3, 0 + ldr r5, _080F0BB0 +_080F0B7C: + ldr r0, [r5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0, r1 + ldr r6, _080F0BB4 + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0x7 + beq _080F0B94 + cmp r0, 0x29 + bne _080F0B98 +_080F0B94: + adds r0, r1, r4 + strb r3, [r0] +_080F0B98: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x17 + bls _080F0B7C +_080F0BA2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F0BA8: .4byte 0x00000864 +_080F0BAC: .4byte 0x000027cd +_080F0BB0: .4byte 0x03005d8c +_080F0BB4: .4byte 0x000027cc + thumb_func_end sub_80F0B64 + + thumb_func_start sub_80F0BB8 +sub_80F0BB8: @ 80F0BB8 + push {r4-r6,lr} + movs r5, 0 + ldr r6, _080F0BF8 +_080F0BBE: + ldr r1, [r6] + lsls r0, r5, 3 + adds r0, r5 + lsls r4, r0, 2 + adds r1, r4 + ldr r0, _080F0BFC + adds r1, r0 + ldrb r0, [r1] + bl sub_80EFFE0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080F0BE6 + ldr r0, [r6] + adds r0, r4 + ldr r1, _080F0C00 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080F0BE6: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _080F0BBE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F0BF8: .4byte 0x03005d8c +_080F0BFC: .4byte 0x000027cc +_080F0C00: .4byte 0x000027cd + thumb_func_end sub_80F0BB8 + + thumb_func_start sub_80F0C04 +sub_80F0C04: @ 80F0C04 + push {r4,r5,lr} + movs r3, 0 + movs r2, 0x5 + ldr r0, _080F0C74 + ldr r4, [r0] + ldr r5, _080F0C78 +_080F0C10: + lsls r0, r2, 24 + asrs r1, r0, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080F0C2E + lsls r0, r3, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r3, r0, 24 +_080F0C2E: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x17 + ble _080F0C10 + movs r2, 0 + lsls r0, r3, 24 + asrs r0, 24 + movs r1, 0x5 + subs r0, r1, r0 + cmp r2, r0 + bge _080F0C6E + adds r5, r0, 0 +_080F0C4A: + ldr r0, _080F0C74 + ldr r0, [r0] + ldr r1, _080F0C78 + adds r0, r1 + lsls r1, r2, 24 + asrs r4, r1, 24 + movs r2, 0xA0 + lsls r2, 19 + adds r1, r2 + lsrs r1, 24 + bl sub_80EF910 + adds r4, 0x1 + lsls r4, 24 + lsrs r2, r4, 24 + asrs r4, 24 + cmp r4, r5 + blt _080F0C4A +_080F0C6E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F0C74: .4byte 0x03005d8c +_080F0C78: .4byte 0x000027cc + thumb_func_end sub_80F0C04 + + thumb_func_start sub_80F0C7C +sub_80F0C7C: @ 80F0C7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0x80 + lsls r0, 1 + bl malloc + adds r5, r0, 0 + cmp r5, 0 + beq _080F0D4C + movs r4, 0 +_080F0C9A: + lsls r0, r4, 6 + adds r0, r5 + adds r1, r4, 0 + muls r1, r7 + add r1, r8 + movs r2, 0x40 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080F0C9A + cmp r6, 0x1 + beq _080F0CF0 + cmp r6, 0x1 + bgt _080F0CC2 + cmp r6, 0 + beq _080F0CCC + b _080F0D3E +_080F0CC2: + cmp r6, 0x2 + beq _080F0D08 + cmp r6, 0x3 + beq _080F0D28 + b _080F0D3E +_080F0CCC: + ldr r0, _080F0CE8 + ldr r0, [r0] + ldr r1, _080F0CEC + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x40 + adds r2, r5, 0 + adds r2, 0x80 + adds r3, r5, 0 + adds r3, 0xC0 + bl sub_80F0D60 + b _080F0D3E + .align 2, 0 +_080F0CE8: .4byte 0x03005d8c +_080F0CEC: .4byte 0x00002b50 +_080F0CF0: + ldr r0, _080F0D00 + ldr r1, [r0] + ldr r0, _080F0D04 + adds r1, r0 + adds r2, r5, 0 + adds r2, 0x80 + b _080F0D14 + .align 2, 0 +_080F0D00: .4byte 0x03005d8c +_080F0D04: .4byte 0x00002b50 +_080F0D08: + adds r1, r5, 0 + adds r1, 0x40 + ldr r0, _080F0D20 + ldr r2, [r0] + ldr r0, _080F0D24 + adds r2, r0 +_080F0D14: + adds r3, r5, 0 + adds r3, 0xC0 + adds r0, r5, 0 + bl sub_80F0D60 + b _080F0D3E + .align 2, 0 +_080F0D20: .4byte 0x03005d8c +_080F0D24: .4byte 0x00002b50 +_080F0D28: + adds r1, r5, 0 + adds r1, 0x40 + adds r2, r5, 0 + adds r2, 0x80 + ldr r0, _080F0D58 + ldr r3, [r0] + ldr r0, _080F0D5C + adds r3, r0 + adds r0, r5, 0 + bl sub_80F0D60 +_080F0D3E: + bl sub_80F0EEC + bl sub_80F0F24 + adds r0, r5, 0 + bl free +_080F0D4C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F0D58: .4byte 0x03005d8c +_080F0D5C: .4byte 0x00002b50 + thumb_func_end sub_80F0C7C + + thumb_func_start sub_80F0D60 +sub_80F0D60: @ 80F0D60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + add r0, sp, 0x10 + str r0, [sp] + add r0, sp, 0x14 + str r0, [sp, 0x4] + add r0, sp, 0x18 + str r0, [sp, 0x8] + add r0, sp, 0x1C + str r0, [sp, 0xC] + bl sub_8009FCC + ldr r1, _080F0D9C + strb r0, [r1] + movs r0, 0 + mov r10, r0 +_080F0D90: + movs r7, 0 + mov r1, r10 + adds r1, 0x1 + str r1, [sp, 0x20] + b _080F0E28 + .align 2, 0 +_080F0D9C: .4byte 0x03001175 +_080F0DA0: + lsls r4, r7, 2 + mov r1, sp + adds r0, r1, r4 + ldr r0, [r0] + ldr r0, [r0] + mov r1, r10 + bl sub_80F0ECC + ldr r1, _080F0E4C + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + mov r8, r4 + adds r1, r7, 0x1 + mov r9, r1 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080F0E22 + movs r5, 0 + ldr r1, _080F0E50 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + bge _080F0E22 + adds r6, r1, 0 +_080F0DD4: + adds r0, r7, r5 + adds r4, r0, 0x1 + ldrb r1, [r6] + adds r0, r4, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r0, [r0] + bl sub_80EEE30 + ldr r1, _080F0E54 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080F0E14 + ldrb r1, [r6] + adds r0, r4, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + mov r1, sp + add r1, r8 + ldr r1, [r1] + bl sub_80F0E58 +_080F0E14: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6] + subs r0, 0x1 + cmp r5, r0 + blt _080F0DD4 +_080F0E22: + mov r1, r9 + lsls r0, r1, 24 + lsrs r7, r0, 24 +_080F0E28: + ldr r0, _080F0E50 + ldrb r0, [r0] + cmp r7, r0 + bcc _080F0DA0 + ldr r1, [sp, 0x20] + lsls r0, r1, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0xF + bls _080F0D90 + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F0E4C: .4byte 0x03001176 +_080F0E50: .4byte 0x03001175 +_080F0E54: .4byte 0x030060bc + thumb_func_end sub_80F0D60 + + thumb_func_start sub_80F0E58 +sub_80F0E58: @ 80F0E58 + push {lr} + ldr r0, [r0] + ldr r1, [r1] + ldr r2, _080F0E7C + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r2, 2 + adds r1, r2 + ldr r2, _080F0E80 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + bl sub_80F0E84 + pop {r0} + bx r0 + .align 2, 0 +_080F0E7C: .4byte 0x03001176 +_080F0E80: .4byte 0x030060bc + thumb_func_end sub_80F0E58 + + thumb_func_start sub_80F0E84 +sub_80F0E84: @ 80F0E84 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + ldrb r3, [r5] + adds r0, r3, 0 + cmp r0, 0 + bne _080F0E9A +_080F0E96: + movs r0, 0 + b _080F0EC6 +_080F0E9A: + movs r1, 0 + adds r2, r3, 0 + adds r3, r0, 0 +_080F0EA0: + lsls r0, r1, 2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _080F0E96 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080F0EA0 + lsls r0, r6, 24 + asrs r0, 22 + adds r0, r4 + strb r2, [r0] + movs r1, 0x1 + strb r1, [r0, 0x1] + ldrh r1, [r5, 0x2] + strh r1, [r0, 0x2] + movs r0, 0x1 +_080F0EC6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F0E84 + + thumb_func_start sub_80F0ECC +sub_80F0ECC: @ 80F0ECC + push {lr} + lsls r1, 24 + lsrs r2, r1, 24 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080F0EE2 + lsls r0, r2, 24 + asrs r0, 24 + b _080F0EE6 +_080F0EE2: + movs r0, 0x1 + negs r0, r0 +_080F0EE6: + pop {r1} + bx r1 + thumb_func_end sub_80F0ECC + + thumb_func_start sub_80F0EEC +sub_80F0EEC: @ 80F0EEC + push {r4,lr} + movs r4, 0 +_080F0EF0: + ldr r0, _080F0F1C + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1 + ldr r1, _080F0F20 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bls _080F0F08 + adds r0, r4, 0 + bl sub_80EEE78 +_080F0F08: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080F0EF0 + bl sub_80EEEB8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F0F1C: .4byte 0x03005d8c +_080F0F20: .4byte 0x00002b50 + thumb_func_end sub_80F0EEC + + thumb_func_start sub_80F0F24 +sub_80F0F24: @ 80F0F24 + push {r4,r5,lr} + ldr r0, _080F0F58 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0F50 + movs r2, 0 + ldr r5, _080F0F5C + ldr r4, _080F0F60 + movs r3, 0 +_080F0F3C: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080F0F3C +_080F0F50: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F0F58: .4byte 0x00000864 +_080F0F5C: .4byte 0x03005d8c +_080F0F60: .4byte 0x00002b51 + thumb_func_end sub_80F0F24 + + thumb_func_start sub_80F0F64 +sub_80F0F64: @ 80F0F64 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r0, 0x2C + bl malloc_and_clear + adds r4, r0, 0 + movs r7, 0 +_080F0F74: + lsls r0, r7, 3 + adds r1, r0, r7 + lsls r1, 2 + adds r1, r6 + ldrb r1, [r1] + subs r1, 0x1 + adds r2, r0, 0 + cmp r1, 0x28 + bls _080F0F88 + b _080F11F4 +_080F0F88: + lsls r0, r1, 2 + ldr r1, _080F0F94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F0F94: .4byte _080F0F98 + .align 2, 0 +_080F0F98: + .4byte _080F103C + .4byte _080F103C + .4byte _080F105A + .4byte _080F11F4 + .4byte _080F1152 + .4byte _080F111E + .4byte _080F10E6 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F1092 + .4byte _080F10C6 + .4byte _080F118A + .4byte _080F11AA + .4byte _080F11CA + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11EA +_080F103C: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4] + adds r0, 0x10 + bl sub_8009228 + cmp r0, 0 + beq _080F1056 + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x18] + b _080F11F4 +_080F1056: + ldr r0, [r4] + b _080F11F2 +_080F105A: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x4] + adds r0, 0x5 + bl sub_8009228 + cmp r0, 0 + beq _080F1074 + ldr r1, [r4, 0x4] + movs r0, 0x1 + strb r0, [r1, 0xD] + b _080F1078 +_080F1074: + ldr r0, [r4, 0x4] + strb r5, [r0, 0xD] +_080F1078: + ldr r0, [r4, 0x4] + adds r0, 0x10 + bl sub_8009228 + cmp r0, 0 + beq _080F108C + ldr r1, [r4, 0x4] + movs r0, 0x1 + strb r0, [r1, 0xE] + b _080F11F4 +_080F108C: + ldr r0, [r4, 0x4] + strb r5, [r0, 0xE] + b _080F11F4 +_080F1092: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x18] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F10AC + ldr r1, [r4, 0x18] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _080F10B0 +_080F10AC: + ldr r0, [r4, 0x18] + strb r5, [r0, 0x2] +_080F10B0: + ldr r0, [r4, 0x18] + adds r0, 0x4 + bl sub_8009228 + cmp r0, 0 + beq _080F10C0 + ldr r1, [r4, 0x18] + b _080F10DA +_080F10C0: + ldr r0, [r4, 0x18] + strb r5, [r0, 0x3] + b _080F11F4 +_080F10C6: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x1C] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F10E0 + ldr r1, [r4, 0x1C] +_080F10DA: + movs r0, 0x1 + strb r0, [r1, 0x3] + b _080F11F4 +_080F10E0: + ldr r0, [r4, 0x1C] + strb r5, [r0, 0x3] + b _080F11F4 +_080F10E6: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x14] + adds r0, 0x2 + bl sub_8009228 + cmp r0, 0 + beq _080F1100 + ldr r1, [r4, 0x14] + movs r0, 0x1 + strb r0, [r1, 0x1D] + b _080F1104 +_080F1100: + ldr r0, [r4, 0x14] + strb r5, [r0, 0x1D] +_080F1104: + ldr r0, [r4, 0x14] + adds r0, 0xC + bl sub_8009228 + cmp r0, 0 + beq _080F1118 + ldr r1, [r4, 0x14] + movs r0, 0x1 + strb r0, [r1, 0x1E] + b _080F11F4 +_080F1118: + ldr r0, [r4, 0x14] + strb r5, [r0, 0x1E] + b _080F11F4 +_080F111E: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x10] + adds r0, 0x16 + bl sub_8009228 + cmp r0, 0 + beq _080F1138 + ldr r1, [r4, 0x10] + movs r0, 0x1 + strb r0, [r1, 0x1E] + b _080F113C +_080F1138: + ldr r0, [r4, 0x10] + strb r5, [r0, 0x1E] +_080F113C: + ldr r0, [r4, 0x10] + adds r0, 0x8 + bl sub_8009228 + cmp r0, 0 + beq _080F114C + ldr r1, [r4, 0x10] + b _080F117E +_080F114C: + ldr r0, [r4, 0x10] + strb r5, [r0, 0x1F] + b _080F11F4 +_080F1152: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0xC] + adds r0, 0xF + bl sub_8009228 + cmp r0, 0 + beq _080F116C + ldr r1, [r4, 0xC] + movs r0, 0x1 + strb r0, [r1, 0x1E] + b _080F1170 +_080F116C: + ldr r0, [r4, 0xC] + strb r5, [r0, 0x1E] +_080F1170: + ldr r0, [r4, 0xC] + adds r0, 0x4 + bl sub_8009228 + cmp r0, 0 + beq _080F1184 + ldr r1, [r4, 0xC] +_080F117E: + movs r0, 0x1 + strb r0, [r1, 0x1F] + b _080F11F4 +_080F1184: + ldr r0, [r4, 0xC] + strb r5, [r0, 0x1F] + b _080F11F4 +_080F118A: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x8] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F11A4 + ldr r1, [r4, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _080F11F4 +_080F11A4: + ldr r0, [r4, 0x8] + strb r5, [r0, 0x2] + b _080F11F4 +_080F11AA: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x20] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F11C4 + ldr r1, [r4, 0x20] + movs r0, 0x1 + strb r0, [r1, 0x6] + b _080F11F4 +_080F11C4: + ldr r0, [r4, 0x20] + strb r5, [r0, 0x6] + b _080F11F4 +_080F11CA: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x24] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F11E4 + ldr r1, [r4, 0x24] + movs r0, 0x1 + strb r0, [r1, 0xB] + b _080F11F4 +_080F11E4: + ldr r0, [r4, 0x24] + strb r5, [r0, 0xB] + b _080F11F4 +_080F11EA: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x28] +_080F11F2: + strb r5, [r0, 0x18] +_080F11F4: + adds r7, 0x1 + cmp r7, 0x17 + bgt _080F11FC + b _080F0F74 +_080F11FC: + adds r0, r4, 0 + bl free + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80F0F64 + + thumb_func_start sub_80F1208 +sub_80F1208: @ 80F1208 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80F14F8 + adds r4, r5, 0 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r4, r1 + cmp r4, r0 + bcs _080F124C +_080F121C: + ldrb r0, [r4] + cmp r0, 0x7 + bne _080F1240 + ldrb r0, [r4, 0x1D] + cmp r0, 0x1 + bne _080F1230 + ldrb r0, [r4, 0x1E] + cmp r0, 0x1 + bne _080F1236 + b _080F1240 +_080F1230: + ldrb r0, [r4, 0x1E] + cmp r0, 0x1 + bne _080F1240 +_080F1236: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x24 + bl memset +_080F1240: + adds r4, 0x24 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r5, r1 + cmp r4, r0 + bcc _080F121C +_080F124C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F1208 + + thumb_func_start sub_80F1254 +sub_80F1254: @ 80F1254 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r4, 0 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r4, r1 + cmp r4, r0 + bcs _080F128A +_080F1264: + ldrb r0, [r4] + cmp r0, 0x7 + bne _080F127E + adds r0, r4, 0 + adds r0, 0xC + bl sub_8009228 + cmp r0, 0 + beq _080F127A + movs r0, 0x1 + b _080F127C +_080F127A: + movs r0, 0x2 +_080F127C: + strb r0, [r4, 0x1E] +_080F127E: + adds r4, 0x24 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r5, r1 + cmp r4, r0 + bcc _080F1264 +_080F128A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F1254 + + thumb_func_start sub_80F1290 +sub_80F1290: @ 80F1290 + push {lr} + bl sub_8009228 + movs r1, 0x2 + cmp r0, 0 + beq _080F129E + movs r1, 0x1 +_080F129E: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80F1290 + + thumb_func_start sub_80F12A4 +sub_80F12A4: @ 80F12A4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r4, 0 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r4, r1 + cmp r4, r0 + bcc _080F12B6 + b _080F14F0 +_080F12B6: + ldrb r0, [r4] + subs r0, 0x1 + cmp r0, 0x28 + bls _080F12C0 + b _080F14E2 +_080F12C0: + lsls r0, 2 + ldr r1, _080F12CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F12CC: .4byte _080F12D0 + .align 2, 0 +_080F12D0: + .4byte _080F1374 + .4byte _080F137A + .4byte _080F1380 + .4byte _080F138E + .4byte _080F139A + .4byte _080F13A8 + .4byte _080F13BE + .4byte _080F13CC + .4byte _080F13E0 + .4byte _080F13F4 + .4byte _080F1408 + .4byte _080F1416 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F142A + .4byte _080F1438 + .4byte _080F1444 + .4byte _080F1450 + .4byte _080F145C + .4byte _080F14AC + .4byte _080F1468 + .4byte _080F14B8 + .4byte _080F148C + .4byte _080F1474 + .4byte _080F14AC + .4byte _080F14B8 + .4byte _080F1480 + .4byte _080F148C + .4byte _080F1498 + .4byte _080F14AC + .4byte _080F14B8 + .4byte _080F14C4 + .4byte _080F14D8 + .4byte _080F14E2 + .4byte _080F14E2 +_080F1374: + adds r0, r4, 0 + adds r0, 0x10 + b _080F1422 +_080F137A: + adds r0, r4, 0 + adds r0, 0x10 + b _080F1422 +_080F1380: + adds r0, r4, 0x5 + bl sub_80F1290 + strb r0, [r4, 0xD] + adds r0, r4, 0 + adds r0, 0x10 + b _080F1478 +_080F138E: + adds r0, r4, 0 + adds r0, 0xB + bl sub_80F1290 + strb r0, [r4, 0x17] + b _080F14E2 +_080F139A: + adds r0, r4, 0 + adds r0, 0xF + bl sub_80F1290 + strb r0, [r4, 0x1E] + adds r0, r4, 0x4 + b _080F13B6 +_080F13A8: + adds r0, r4, 0 + adds r0, 0x16 + bl sub_80F1290 + strb r0, [r4, 0x1E] + adds r0, r4, 0 + adds r0, 0x8 +_080F13B6: + bl sub_80F1290 + strb r0, [r4, 0x1F] + b _080F14E2 +_080F13BE: + adds r0, r4, 0x2 + bl sub_80F1290 + strb r0, [r4, 0x1D] + adds r0, r4, 0 + adds r0, 0xC + b _080F13D8 +_080F13CC: + adds r0, r4, 0 + adds r0, 0x14 + bl sub_80F1290 + strb r0, [r4, 0x1D] + adds r0, r4, 0x4 +_080F13D8: + bl sub_80F1290 + strb r0, [r4, 0x1E] + b _080F14E2 +_080F13E0: + adds r0, r4, 0 + adds r0, 0xC + bl sub_80F1290 + strb r0, [r4, 0x14] + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x15] + b _080F14E2 +_080F13F4: + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x19] + adds r0, r4, 0 + adds r0, 0xC + bl sub_80F1290 + strb r0, [r4, 0x1A] + b _080F14E2 +_080F1408: + adds r0, r4, 0x2 + bl sub_80F1290 + strb r0, [r4, 0x17] + adds r0, r4, 0 + adds r0, 0xC + b _080F1422 +_080F1416: + adds r0, r4, 0x2 + bl sub_80F1290 + strb r0, [r4, 0x17] + adds r0, r4, 0 + adds r0, 0xB +_080F1422: + bl sub_80F1290 + strb r0, [r4, 0x18] + b _080F14E2 +_080F142A: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x2] + adds r0, r4, 0x4 + b _080F143C +_080F1438: + adds r0, r4, 0 + adds r0, 0x13 +_080F143C: + bl sub_80F1290 + strb r0, [r4, 0x3] + b _080F14E2 +_080F1444: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x2] + b _080F14E2 +_080F1450: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x6] + b _080F14E2 +_080F145C: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0xB] + b _080F14E2 +_080F1468: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x9] + b _080F14E2 +_080F1474: + adds r0, r4, 0 + adds r0, 0x13 +_080F1478: + bl sub_80F1290 + strb r0, [r4, 0xE] + b _080F14E2 +_080F1480: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x11] + b _080F14E2 +_080F148C: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x8] + b _080F14E2 +_080F1498: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0xF] + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x10] + b _080F14E2 +_080F14AC: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0xC] + b _080F14E2 +_080F14B8: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x5] + b _080F14E2 +_080F14C4: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x1B] + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x1C] + b _080F14E2 +_080F14D8: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x4] +_080F14E2: + adds r4, 0x24 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r5, r1 + cmp r4, r0 + bcs _080F14F0 + b _080F12B6 +_080F14F0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F12A4 + + thumb_func_start sub_80F14F8 +sub_80F14F8: @ 80F14F8 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r5, 0 + movs r6, 0x17 +_080F1500: + ldrb r0, [r4] + cmp r0, 0x17 + beq _080F151C + cmp r0, 0x19 + bne _080F152C + ldrb r0, [r4, 0xA] + cmp r0, 0x58 + bls _080F152C + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x24 + bl memset + b _080F152C +_080F151C: + ldrb r0, [r4, 0x12] + cmp r0, 0x58 + bls _080F152C + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x24 + bl memset +_080F152C: + adds r4, 0x24 + adds r5, 0x24 + subs r6, 0x1 + cmp r6, 0 + bge _080F1500 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80F14F8 + + thumb_func_start sub_80F153C +sub_80F153C: @ 80F153C + push {lr} + ldr r0, _080F1574 + ldr r2, [r0] + ldr r0, _080F1578 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, _080F157C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F155A + b _080F16E6 +_080F155A: + subs r1, 0x1 + adds r0, r2, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x28 + bls _080F1568 + b _080F16E6 +_080F1568: + lsls r0, 2 + ldr r1, _080F1580 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F1574: .4byte 0x03005d8c +_080F1578: .4byte 0x020375e0 +_080F157C: .4byte 0x000027cd +_080F1580: .4byte _080F1584 + .align 2, 0 +_080F1584: + .4byte _080F1628 + .4byte _080F162E + .4byte _080F1634 + .4byte _080F163A + .4byte _080F165E + .4byte _080F1646 + .4byte _080F164C + .4byte _080F1664 + .4byte _080F1670 + .4byte _080F166A + .4byte _080F16B8 + .4byte _080F16E2 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F1652 + .4byte _080F1658 + .4byte _080F1676 + .4byte _080F167C + .4byte _080F1682 + .4byte _080F1688 + .4byte _080F168E + .4byte _080F1694 + .4byte _080F169A + .4byte _080F16A0 + .4byte _080F16A6 + .4byte _080F16AC + .4byte _080F16B2 + .4byte _080F16BE + .4byte _080F16C4 + .4byte _080F16CA + .4byte _080F16D0 + .4byte _080F16D6 + .4byte _080F16DC + .4byte _080F16E6 + .4byte _080F1640 +_080F1628: + bl sub_80F24D8 + b _080F16E6 +_080F162E: + bl sub_80F2708 + b _080F16E6 +_080F1634: + bl sub_80F28A4 + b _080F16E6 +_080F163A: + bl nullsub_46 + b _080F16E6 +_080F1640: + bl sub_80F29A0 + b _080F16E6 +_080F1646: + bl sub_80F16EC + b _080F16E6 +_080F164C: + bl sub_80F1974 + b _080F16E6 +_080F1652: + bl sub_80F211C + b _080F16E6 +_080F1658: + bl sub_80F1C0C + b _080F16E6 +_080F165E: + bl sub_80F1E48 + b _080F16E6 +_080F1664: + bl sub_80F2A10 + b _080F16E6 +_080F166A: + bl sub_80F3140 + b _080F16E6 +_080F1670: + bl sub_80F3388 + b _080F16E6 +_080F1676: + bl sub_80F2370 + b _080F16E6 +_080F167C: + bl sub_80F3828 + b _080F16E6 +_080F1682: + bl sub_80F3904 + b _080F16E6 +_080F1688: + bl sub_80F39E4 + b _080F16E6 +_080F168E: + bl sub_80F3C04 + b _080F16E6 +_080F1694: + bl sub_80F3D74 + b _080F16E6 +_080F169A: + bl sub_80F3E7C + b _080F16E6 +_080F16A0: + bl sub_80F4028 + b _080F16E6 +_080F16A6: + bl sub_80F4360 + b _080F16E6 +_080F16AC: + bl sub_80F45A0 + b _080F16E6 +_080F16B2: + bl sub_80F466C + b _080F16E6 +_080F16B8: + bl sub_80F487C + b _080F16E6 +_080F16BE: + bl sub_80F49BC + b _080F16E6 +_080F16C4: + bl sub_80F4B5C + b _080F16E6 +_080F16CA: + bl sub_80F4D9C + b _080F16E6 +_080F16D0: + bl sub_80F5030 + b _080F16E6 +_080F16D6: + bl sub_80F51EC + b _080F16E6 +_080F16DC: + bl sub_80F5548 + b _080F16E6 +_080F16E2: + bl sub_80F56D4 +_080F16E6: + pop {r0} + bx r0 + thumb_func_end sub_80F153C + + thumb_func_start sub_80F16EC +sub_80F16EC: @ 80F16EC + push {r4,r5,lr} + ldr r2, _080F171C + ldr r0, _080F1720 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F1724 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F1728 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F172C + ldrb r5, [r0] + cmp r5, 0x8 + bls _080F1712 + b _080F1952 +_080F1712: + lsls r0, r5, 2 + ldr r1, _080F1730 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F171C: .4byte 0x03005d8c +_080F1720: .4byte 0x020375e0 +_080F1724: .4byte 0x000027cc +_080F1728: .4byte 0x020375f0 +_080F172C: .4byte 0x0203a030 +_080F1730: .4byte _080F1734 + .align 2, 0 +_080F1734: + .4byte _080F1758 + .4byte _080F17B0 + .4byte _080F17E8 + .4byte _080F1818 + .4byte _080F184C + .4byte _080F1880 + .4byte _080F18C4 + .4byte _080F190C + .4byte _080F193C +_080F1758: + ldr r0, _080F1798 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x1 + bl sub_80EF250 + ldrb r1, [r4, 0x13] + lsls r1, 27 + lsrs r1, 30 + movs r0, 0x2 + bl sub_80EF1BC + ldrh r1, [r4, 0x2] + movs r0, 0xB + muls r0, r1 + ldr r1, _080F179C + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + bl sub_8008C44 + cmp r0, 0 + bne _080F17A4 + ldr r1, _080F17A0 + movs r0, 0x8 + b _080F1950 + .align 2, 0 +_080F1798: .4byte 0x02021cc4 +_080F179C: .4byte 0x083185c8 +_080F17A0: .4byte 0x0203a030 +_080F17A4: + ldr r1, _080F17AC + movs r0, 0x1 + b _080F1950 + .align 2, 0 +_080F17AC: .4byte 0x0203a030 +_080F17B0: + ldr r0, _080F17DC + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F17E0 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F17E4 + adds r1, r4, 0 + adds r1, 0x8 + ldrb r2, [r4, 0x1F] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x2 + bl sub_80EF250 + b _080F194C + .align 2, 0 +_080F17DC: .4byte 0x02021cc4 +_080F17E0: .4byte 0x083185c8 +_080F17E4: .4byte 0x02021dc4 +_080F17E8: + ldr r0, _080F1804 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + bne _080F180C + ldr r1, _080F1808 + movs r0, 0x3 + b _080F1950 + .align 2, 0 +_080F1804: .4byte 0x02021cc4 +_080F1808: .4byte 0x0203a030 +_080F180C: + ldr r1, _080F1814 + movs r0, 0x4 + b _080F1950 + .align 2, 0 +_080F1814: .4byte 0x0203a030 +_080F1818: + ldr r0, _080F1840 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F1844 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldrb r1, [r4, 0x13] + lsls r1, 25 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x2 + bl sub_80EF340 + ldr r1, _080F1848 + movs r0, 0x5 + b _080F1950 + .align 2, 0 +_080F1840: .4byte 0x02021cc4 +_080F1844: .4byte 0x02021dc4 +_080F1848: .4byte 0x0203a030 +_080F184C: + ldr r0, _080F1874 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F1878 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldrb r1, [r4, 0x13] + lsls r1, 25 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x2 + bl sub_80EF340 + ldr r1, _080F187C + movs r0, 0x5 + b _080F1950 + .align 2, 0 +_080F1874: .4byte 0x02021cc4 +_080F1878: .4byte 0x02021dc4 +_080F187C: .4byte 0x0203a030 +_080F1880: + ldr r0, _080F18AC + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x1 + bl sub_80EF250 + ldr r0, _080F18B0 + ldrh r1, [r4, 0x6] + bl sub_811EBBC + ldrh r0, [r4, 0x14] + cmp r0, 0 + beq _080F18B8 + ldr r1, _080F18B4 + movs r0, 0x6 + b _080F1950 + .align 2, 0 +_080F18AC: .4byte 0x02021cc4 +_080F18B0: .4byte 0x02021ec4 +_080F18B4: .4byte 0x0203a030 +_080F18B8: + ldr r1, _080F18C0 + movs r0, 0x7 + b _080F1950 + .align 2, 0 +_080F18C0: .4byte 0x0203a030 +_080F18C4: + ldr r0, _080F18F4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F18F8 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F18FC + ldrh r2, [r4, 0x14] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F1900 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F1904 + ldrh r1, [r4, 0x6] + bl sub_811EBBC + ldr r1, _080F1908 + movs r0, 0x7 + b _080F1950 + .align 2, 0 +_080F18F4: .4byte 0x02021cc4 +_080F18F8: .4byte 0x083185c8 +_080F18FC: .4byte 0x02021dc4 +_080F1900: .4byte 0x0831977c +_080F1904: .4byte 0x02021ec4 +_080F1908: .4byte 0x0203a030 +_080F190C: + ldr r0, _080F1930 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F1934 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1938 + adds r1, r2 + bl gf_strcpy + bl sub_80F577C + b _080F1952 + .align 2, 0 +_080F1930: .4byte 0x02021cc4 +_080F1934: .4byte 0x02021dc4 +_080F1938: .4byte 0x083185c8 +_080F193C: + ldr r0, _080F1964 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1968 + adds r1, r2 + bl gf_strcpy +_080F194C: + ldr r1, _080F196C + movs r0, 0x2 +_080F1950: + strb r0, [r1] +_080F1952: + ldr r0, _080F1970 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F1964: .4byte 0x02021cc4 +_080F1968: .4byte 0x083185c8 +_080F196C: .4byte 0x0203a030 +_080F1970: .4byte 0x0858d204 + thumb_func_end sub_80F16EC + + thumb_func_start sub_80F1974 +sub_80F1974: @ 80F1974 + push {r4,r5,lr} + ldr r2, _080F19A8 + ldr r0, _080F19AC + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F19B0 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F19B4 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F19B8 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xE + bls _080F199C + b _080F1BEA +_080F199C: + lsls r0, r5, 2 + ldr r1, _080F19BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F19A8: .4byte 0x03005d8c +_080F19AC: .4byte 0x020375e0 +_080F19B0: .4byte 0x000027cc +_080F19B4: .4byte 0x020375f0 +_080F19B8: .4byte 0x0203a030 +_080F19BC: .4byte _080F19C0 + .align 2, 0 +_080F19C0: + .4byte _080F19FC + .4byte _080F1A40 + .4byte _080F1A90 + .4byte _080F1AB4 + .4byte _080F1AE0 + .4byte _080F1B28 + .4byte _080F1B38 + .4byte _080F1B48 + .4byte _080F1B4E + .4byte _080F1B4E + .4byte _080F1B4E + .4byte _080F1B68 + .4byte _080F1B94 + .4byte _080F1B94 + .4byte _080F1BCC +_080F19FC: + ldr r0, _080F1A24 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] + bl sub_81DB5E8 + ldr r0, _080F1A28 + ldrh r2, [r4, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1A2C + adds r1, r2 + bl gf_strcpy + ldrh r0, [r4, 0x16] + cmp r0, 0x6 + bls _080F1A34 + ldr r1, _080F1A30 + movs r0, 0x1 + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1A24: .4byte 0x02021cc4 +_080F1A28: .4byte 0x02021dc4 +_080F1A2C: .4byte 0x083185c8 +_080F1A30: .4byte 0x0203a030 +_080F1A34: + ldr r1, _080F1A3C + movs r0, 0x2 + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1A3C: .4byte 0x0203a030 +_080F1A40: + ldrb r0, [r4, 0x1A] + cmp r0, 0x32 + bne _080F1A58 + ldr r0, _080F1A50 + ldr r1, _080F1A54 + bl gf_strcpy + b _080F1A60 + .align 2, 0 +_080F1A50: .4byte 0x02021cc4 +_080F1A54: .4byte 0x085eaeb1 +_080F1A58: + ldr r0, _080F1A78 + ldr r1, _080F1A7C + bl gf_strcpy +_080F1A60: + ldrh r1, [r4, 0x16] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x1C] + cmp r0, 0x1 + bne _080F1A84 + ldr r1, _080F1A80 + movs r0, 0x3 + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1A78: .4byte 0x02021cc4 +_080F1A7C: .4byte 0x085eaeb8 +_080F1A80: .4byte 0x0203a030 +_080F1A84: + ldr r1, _080F1A8C + movs r0, 0x4 + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1A8C: .4byte 0x0203a030 +_080F1A90: + ldr r0, _080F1AB0 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrh r1, [r4, 0x16] + adds r1, 0x1 + movs r0, 0x1 + bl sub_80EF340 +_080F1AA6: + ldrb r0, [r4, 0x1B] + cmp r0, 0 + beq _080F1B02 + b _080F1B1C + .align 2, 0 +_080F1AB0: .4byte 0x02021cc4 +_080F1AB4: + ldr r0, _080F1AD4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F1AD8 + ldrh r2, [r4, 0x14] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1ADC + adds r1, r2 + bl gf_strcpy + b _080F1AA6 + .align 2, 0 +_080F1AD4: .4byte 0x02021cc4 +_080F1AD8: .4byte 0x02021dc4 +_080F1ADC: .4byte 0x083185c8 +_080F1AE0: + ldr r0, _080F1B0C + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F1B10 + ldrh r2, [r4, 0x14] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1B14 + adds r1, r2 + bl gf_strcpy + ldrb r0, [r4, 0x1B] + cmp r0, 0 + bne _080F1B1C +_080F1B02: + ldr r1, _080F1B18 + movs r0, 0x5 + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1B0C: .4byte 0x02021cc4 +_080F1B10: .4byte 0x02021dc4 +_080F1B14: .4byte 0x083185c8 +_080F1B18: .4byte 0x0203a030 +_080F1B1C: + ldr r1, _080F1B24 + movs r0, 0x6 + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1B24: .4byte 0x0203a030 +_080F1B28: + ldr r0, _080F1B34 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + b _080F1B54 + .align 2, 0 +_080F1B34: .4byte 0x02021cc4 +_080F1B38: + ldr r0, _080F1B44 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + b _080F1B54 + .align 2, 0 +_080F1B44: .4byte 0x02021cc4 +_080F1B48: + movs r0, 0xB + strb r0, [r2] + b _080F1BEA +_080F1B4E: + ldr r0, _080F1B60 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] +_080F1B54: + bl sub_81DB5E8 + ldr r1, _080F1B64 + movs r0, 0xB + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1B60: .4byte 0x02021cc4 +_080F1B64: .4byte 0x0203a030 +_080F1B68: + ldr r0, _080F1B80 + ldrh r1, [r4, 0x18] + bl sub_811EBBC + ldrb r0, [r4, 0x1B] + cmp r0, 0 + bne _080F1B88 + ldr r1, _080F1B84 + movs r0, 0xC + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1B80: .4byte 0x02021cc4 +_080F1B84: .4byte 0x0203a030 +_080F1B88: + ldr r1, _080F1B90 + movs r0, 0xD + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1B90: .4byte 0x0203a030 +_080F1B94: + ldr r0, _080F1BBC + ldrh r1, [r4, 0x18] + bl sub_811EBBC + ldr r0, _080F1BC0 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] + bl sub_81DB5E8 + ldr r0, _080F1BC4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r1, _080F1BC8 + movs r0, 0xE + strb r0, [r1] + b _080F1BEA + .align 2, 0 +_080F1BBC: .4byte 0x02021cc4 +_080F1BC0: .4byte 0x02021dc4 +_080F1BC4: .4byte 0x02021ec4 +_080F1BC8: .4byte 0x0203a030 +_080F1BCC: + ldr r0, _080F1BFC + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] + bl sub_81DB5E8 + ldr r0, _080F1C00 + ldrh r2, [r4, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1C04 + adds r1, r2 + bl gf_strcpy + bl sub_80F577C +_080F1BEA: + ldr r0, _080F1C08 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F1BFC: .4byte 0x02021cc4 +_080F1C00: .4byte 0x02021dc4 +_080F1C04: .4byte 0x083185c8 +_080F1C08: .4byte 0x0858d240 + thumb_func_end sub_80F1974 + + thumb_func_start sub_80F1C0C +sub_80F1C0C: @ 80F1C0C + push {r4-r6,lr} + ldr r2, _080F1C40 + ldr r0, _080F1C44 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F1C48 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F1C4C + movs r0, 0 + strh r0, [r1] + ldr r0, _080F1C50 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0xC + bls _080F1C34 + b _080F1E2C +_080F1C34: + lsls r0, r6, 2 + ldr r1, _080F1C54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F1C40: .4byte 0x03005d8c +_080F1C44: .4byte 0x020375e0 +_080F1C48: .4byte 0x000027cc +_080F1C4C: .4byte 0x020375f0 +_080F1C50: .4byte 0x0203a030 +_080F1C54: .4byte _080F1C58 + .align 2, 0 +_080F1C58: + .4byte _080F1C8C + .4byte _080F1CC8 + .4byte _080F1D10 + .4byte _080F1D22 + .4byte _080F1D10 + .4byte _080F1D10 + .4byte _080F1D4C + .4byte _080F1D7C + .4byte _080F1DAC + .4byte _080F1DB8 + .4byte _080F1DC6 + .4byte _080F1DD8 + .4byte _080F1E1C +_080F1C8C: + ldr r0, _080F1CB0 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r0, _080F1CB4 + ldrb r1, [r5, 0x12] + movs r2, 0 + bl GetMapName + ldrh r0, [r5, 0xC] + cmp r0, 0xFE + bls _080F1CBC + ldr r1, _080F1CB8 + movs r0, 0xB + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1CB0: .4byte 0x02021cc4 +_080F1CB4: .4byte 0x02021dc4 +_080F1CB8: .4byte 0x0203a030 +_080F1CBC: + ldr r1, _080F1CC4 + movs r0, 0x1 + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1CC4: .4byte 0x0203a030 +_080F1CC8: + ldr r0, _080F1D04 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r4, _080F1D08 + ldrh r0, [r5, 0x6] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrh r1, [r5, 0xC] + movs r0, 0x2 + bl sub_80EF340 + ldr r4, _080F1D0C + bl GenerateRandomNumber + ldrb r2, [r4] + adds r2, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, r2 + strb r0, [r4] + b _080F1E2C + .align 2, 0 +_080F1D04: .4byte 0x02021cc4 +_080F1D08: .4byte 0x02021dc4 +_080F1D0C: .4byte 0x0203a030 +_080F1D10: + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _080F1D1C + movs r0, 0x6 + strb r0, [r2] + b _080F1E2C +_080F1D1C: + movs r0, 0xA + strb r0, [r2] + b _080F1E2C +_080F1D22: + ldrh r1, [r5, 0xC] + adds r1, 0x1 + movs r0, 0x2 + bl sub_80EF340 + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _080F1D40 + ldr r1, _080F1D3C + movs r0, 0x6 + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1D3C: .4byte 0x0203a030 +_080F1D40: + ldr r1, _080F1D48 + movs r0, 0xA + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1D48: .4byte 0x0203a030 +_080F1D4C: + ldr r4, _080F1D74 + ldrh r0, [r5, 0x8] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrh r1, [r5, 0xE] + movs r0, 0x2 + bl sub_80EF340 + ldrh r0, [r5, 0xA] + cmp r0, 0 + beq _080F1D94 + ldr r1, _080F1D78 + movs r0, 0x7 + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1D74: .4byte 0x02021dc4 +_080F1D78: .4byte 0x0203a030 +_080F1D7C: + ldr r4, _080F1DA4 + ldrh r0, [r5, 0xA] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrh r1, [r5, 0x10] + movs r0, 0x2 + bl sub_80EF340 +_080F1D94: + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + beq _080F1DFA + ldr r1, _080F1DA8 + movs r0, 0x9 + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1DA4: .4byte 0x02021dc4 +_080F1DA8: .4byte 0x0203a030 +_080F1DAC: + ldrh r0, [r5, 0xC] + cmp r0, 0xFE + bls _080F1DD2 + movs r0, 0xC + strb r0, [r2] + b _080F1E2C +_080F1DB8: + movs r0, 0x1 + adds r1, r5, 0 + bl sub_80EF40C + bl sub_80F577C + b _080F1E2C +_080F1DC6: + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + bne _080F1DD2 + movs r0, 0x8 + strb r0, [r2] + b _080F1E2C +_080F1DD2: + movs r0, 0x9 + strb r0, [r2] + b _080F1E2C +_080F1DD8: + ldr r0, _080F1E04 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r4, _080F1E08 + ldrh r0, [r5, 0x6] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + bne _080F1E10 +_080F1DFA: + ldr r1, _080F1E0C + movs r0, 0x8 + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1E04: .4byte 0x02021cc4 +_080F1E08: .4byte 0x02021dc4 +_080F1E0C: .4byte 0x0203a030 +_080F1E10: + ldr r1, _080F1E18 + movs r0, 0xC + strb r0, [r1] + b _080F1E2C + .align 2, 0 +_080F1E18: .4byte 0x0203a030 +_080F1E1C: + ldr r0, _080F1E40 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + bl sub_80F577C +_080F1E2C: + ldr r0, _080F1E44 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F1E40: .4byte 0x02021cc4 +_080F1E44: .4byte 0x0858d1d0 + thumb_func_end sub_80F1C0C + + thumb_func_start sub_80F1E48 +sub_80F1E48: @ 80F1E48 + push {r4-r6,lr} + sub sp, 0x8 + ldr r2, _080F1E7C + ldr r0, _080F1E80 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F1E84 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F1E88 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F1E8C + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0x12 + bls _080F1E72 + b _080F20FE +_080F1E72: + lsls r0, r6, 2 + ldr r1, _080F1E90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F1E7C: .4byte 0x03005d8c +_080F1E80: .4byte 0x020375e0 +_080F1E84: .4byte 0x000027cc +_080F1E88: .4byte 0x020375f0 +_080F1E8C: .4byte 0x0203a030 +_080F1E90: .4byte _080F1E94 + .align 2, 0 +_080F1E94: + .4byte _080F1EE0 + .4byte _080F1F28 + .4byte _080F1F4A + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F90 + .4byte _080F1F90 + .4byte _080F1F90 + .4byte _080F20EC + .4byte _080F1FCC + .4byte _080F200C + .4byte _080F202C + .4byte _080F2074 + .4byte _080F20A4 + .4byte _080F20F0 +_080F1EE0: + ldr r0, _080F1F14 + adds r1, r5, 0 + adds r1, 0xF + ldrb r2, [r5, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F1F18 + ldrh r2, [r5, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F1F1C + adds r1, r2 + bl gf_strcpy + ldr r0, _080F1F20 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1F] + bl sub_81DB5E8 + ldr r4, _080F1F24 + adds r0, r5, 0 + bl sub_80EFBA4 + adds r0, 0x1 + strb r0, [r4] + b _080F20FE + .align 2, 0 +_080F1F14: .4byte 0x02021cc4 +_080F1F18: .4byte 0x02021dc4 +_080F1F1C: .4byte 0x083185c8 +_080F1F20: .4byte 0x02021ec4 +_080F1F24: .4byte 0x0203a030 +_080F1F28: + ldrb r0, [r5, 0x1A] + cmp r0, 0 + bne _080F1F34 + movs r0, 0x9 + strb r0, [r2] + b _080F20FE +_080F1F34: + cmp r0, 0x1 + bne _080F1F3E + movs r0, 0xA + strb r0, [r2] + b _080F20FE +_080F1F3E: + cmp r0, 0x2 + beq _080F1F44 + b _080F20FE +_080F1F44: + movs r0, 0xB + strb r0, [r2] + b _080F20FE +_080F1F4A: + ldr r0, _080F1F64 + adds r1, r5, 0 + adds r1, 0xF + ldrb r2, [r5, 0x1E] + bl sub_81DB5E8 + ldrb r0, [r5, 0x1A] + cmp r0, 0 + bne _080F1F6C + ldr r1, _080F1F68 + movs r0, 0x9 + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F1F64: .4byte 0x02021cc4 +_080F1F68: .4byte 0x0203a030 +_080F1F6C: + cmp r0, 0x1 + bne _080F1F7C + ldr r1, _080F1F78 + movs r0, 0xA + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F1F78: .4byte 0x0203a030 +_080F1F7C: + cmp r0, 0x2 + beq _080F1F82 + b _080F20FE +_080F1F82: + ldr r1, _080F1F8C + movs r0, 0xB + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F1F8C: .4byte 0x0203a030 +_080F1F90: + ldr r0, _080F1FC4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1F] + bl sub_81DB5E8 + movs r4, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_80EFBDC + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl sub_80EFBDC + ldr r1, _080F1FC8 + movs r0, 0xC + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F1FC4: .4byte 0x02021cc4 +_080F1FC8: .4byte 0x0203a030 +_080F1FCC: + ldr r0, _080F2004 + adds r1, r5, 0 + adds r1, 0xF + ldrb r2, [r5, 0x1E] + bl sub_81DB5E8 + movs r4, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl sub_80EFBDC + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80EFBDC + ldr r1, _080F2008 + movs r0, 0xE + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F2004: .4byte 0x02021cc4 +_080F2008: .4byte 0x0203a030 +_080F200C: + movs r4, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80EFBDC + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0 + b _080F20D2 +_080F202C: + movs r0, 0 + str r0, [sp] + str r5, [sp, 0x4] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80EFBDC + ldr r0, _080F2068 + ldrh r2, [r5, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F206C + adds r1, r2 + bl gf_strcpy + ldrh r0, [r5, 0x2] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_80EFBDC + ldr r1, _080F2070 + movs r0, 0x10 + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F2068: .4byte 0x02021dc4 +_080F206C: .4byte 0x083185c8 +_080F2070: .4byte 0x0203a030 +_080F2074: + ldrh r0, [r5, 0x2] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_80EFBDC + movs r0, 0 + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80EFBDC + ldr r1, _080F20A0 + movs r0, 0x11 + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F20A0: .4byte 0x0203a030 +_080F20A4: + movs r0, 0 + str r0, [sp] + str r5, [sp, 0x4] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80EFBDC + ldr r0, _080F20E0 + ldrh r2, [r5, 0x1C] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F20E4 + adds r1, r2 + bl gf_strcpy + ldrh r0, [r5, 0x1C] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 +_080F20D2: + bl sub_80EFBDC + ldr r1, _080F20E8 + movs r0, 0x12 + strb r0, [r1] + b _080F20FE + .align 2, 0 +_080F20E0: .4byte 0x02021dc4 +_080F20E4: .4byte 0x083185c8 +_080F20E8: .4byte 0x0203a030 +_080F20EC: + movs r6, 0x12 + strb r6, [r2] +_080F20F0: + ldr r0, _080F2114 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1F] + bl sub_81DB5E8 + bl sub_80F577C +_080F20FE: + ldr r0, _080F2118 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F2114: .4byte 0x02021cc4 +_080F2118: .4byte 0x0858d338 + thumb_func_end sub_80F1E48 + + thumb_func_start sub_80F211C +sub_80F211C: @ 80F211C + push {r4-r6,lr} + ldr r2, _080F2150 + ldr r0, _080F2154 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F2158 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F215C + movs r0, 0 + strh r0, [r1] + ldr r0, _080F2160 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0xB + bls _080F2144 + b _080F2358 +_080F2144: + lsls r0, r6, 2 + ldr r1, _080F2164 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F2150: .4byte 0x03005d8c +_080F2154: .4byte 0x020375e0 +_080F2158: .4byte 0x000027cc +_080F215C: .4byte 0x020375f0 +_080F2160: .4byte 0x0203a030 +_080F2164: .4byte _080F2168 + .align 2, 0 +_080F2168: + .4byte _080F2198 + .4byte _080F21EC + .4byte _080F21F2 + .4byte _080F222C + .4byte _080F2264 + .4byte _080F226A + .4byte _080F22A0 + .4byte _080F22F4 + .4byte _080F22F4 + .4byte _080F2324 + .4byte _080F2324 + .4byte _080F2354 +_080F2198: + ldr r0, _080F21CC + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, _080F21D0 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F21D4 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F21D8 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldrb r0, [r5, 0xF] + cmp r0, 0x1 + bne _080F21E0 + ldr r1, _080F21DC + movs r0, 0x5 + strb r0, [r1] + b _080F2358 + .align 2, 0 +_080F21CC: .4byte 0x02021cc4 +_080F21D0: .4byte 0x02021dc4 +_080F21D4: .4byte 0x083185c8 +_080F21D8: .4byte 0x02021ec4 +_080F21DC: .4byte 0x0203a030 +_080F21E0: + ldr r1, _080F21E8 + movs r0, 0x1 + strb r0, [r1] + b _080F2358 + .align 2, 0 +_080F21E8: .4byte 0x0203a030 +_080F21EC: + movs r0, 0x2 + strb r0, [r2] + b _080F2358 +_080F21F2: + ldr r4, _080F2218 + ldrb r0, [r5, 0xF] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrb r1, [r5, 0x12] + movs r0, 0x2 + bl sub_80EF340 + ldrb r0, [r5, 0x12] + cmp r0, 0x3 + bhi _080F2220 + ldr r1, _080F221C + movs r0, 0x3 + strb r0, [r1] + b _080F2358 + .align 2, 0 +_080F2218: .4byte 0x02021dc4 +_080F221C: .4byte 0x0203a030 +_080F2220: + ldr r1, _080F2228 + movs r0, 0x4 + strb r0, [r1] + b _080F2358 + .align 2, 0 +_080F2228: .4byte 0x0203a030 +_080F222C: + ldr r0, _080F2254 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, _080F2258 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F225C + adds r1, r2 + bl gf_strcpy + ldr r0, _080F2260 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + b _080F2286 + .align 2, 0 +_080F2254: .4byte 0x02021cc4 +_080F2258: .4byte 0x02021dc4 +_080F225C: .4byte 0x083185c8 +_080F2260: .4byte 0x02021ec4 +_080F2264: + movs r0, 0x6 + strb r0, [r2] + b _080F2358 +_080F226A: + ldr r0, _080F2290 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, _080F2294 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2298 + adds r1, r2 + bl gf_strcpy +_080F2286: + ldr r1, _080F229C + movs r0, 0x6 + strb r0, [r1] + b _080F2358 + .align 2, 0 +_080F2290: .4byte 0x02021cc4 +_080F2294: .4byte 0x02021dc4 +_080F2298: .4byte 0x083185c8 +_080F229C: .4byte 0x0203a030 +_080F22A0: + ldr r0, _080F22E0 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, _080F22E4 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F22E8 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F22EC + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r4, _080F22F0 + bl GenerateRandomNumber + ldrb r2, [r4] + adds r2, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, r2 + strb r0, [r4] + b _080F2358 + .align 2, 0 +_080F22E0: .4byte 0x02021cc4 +_080F22E4: .4byte 0x02021dc4 +_080F22E8: .4byte 0x083185c8 +_080F22EC: .4byte 0x02021ec4 +_080F22F0: .4byte 0x0203a030 +_080F22F4: + ldr r0, _080F2318 + ldrh r1, [r5, 0x10] + movs r4, 0xB + muls r1, r4 + ldr r2, _080F231C + adds r1, r2 + bl gf_strcpy + ldr r0, _080F2320 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldrh r1, [r5, 0x10] + movs r0, 0x2 + bl sub_80EF9E8 + b _080F233E + .align 2, 0 +_080F2318: .4byte 0x02021cc4 +_080F231C: .4byte 0x083185c8 +_080F2320: .4byte 0x02021dc4 +_080F2324: + ldr r0, _080F2344 + ldrh r1, [r5, 0x10] + movs r4, 0xB + muls r1, r4 + ldr r2, _080F2348 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F234C + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 +_080F233E: + ldr r0, _080F2350 + strb r4, [r0] + b _080F2358 + .align 2, 0 +_080F2344: .4byte 0x02021cc4 +_080F2348: .4byte 0x083185c8 +_080F234C: .4byte 0x02021dc4 +_080F2350: .4byte 0x0203a030 +_080F2354: + bl sub_80F577C +_080F2358: + ldr r0, _080F236C + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F236C: .4byte 0x0858d1a0 + thumb_func_end sub_80F211C + + thumb_func_start sub_80F2370 +sub_80F2370: @ 80F2370 + push {r4,r5,lr} + ldr r2, _080F23A0 + ldr r0, _080F23A4 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F23A8 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F23AC + movs r0, 0 + strh r0, [r1] + ldr r0, _080F23B0 + ldrb r5, [r0] + cmp r5, 0x6 + bls _080F2396 + b _080F24C0 +_080F2396: + lsls r0, r5, 2 + ldr r1, _080F23B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F23A0: .4byte 0x03005d8c +_080F23A4: .4byte 0x020375e0 +_080F23A8: .4byte 0x000027cc +_080F23AC: .4byte 0x020375f0 +_080F23B0: .4byte 0x0203a030 +_080F23B4: .4byte _080F23B8 + .align 2, 0 +_080F23B8: + .4byte _080F23D4 + .4byte _080F2408 + .4byte _080F245C + .4byte _080F245C + .4byte _080F24A0 + .4byte _080F24A0 + .4byte _080F24BC +_080F23D4: + ldr r0, _080F23F8 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldr r0, _080F23FC + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2400 + adds r1, r2 + bl gf_strcpy + ldr r1, _080F2404 + movs r0, 0x1 + strb r0, [r1] + b _080F24C0 + .align 2, 0 +_080F23F8: .4byte 0x02021cc4 +_080F23FC: .4byte 0x02021dc4 +_080F2400: .4byte 0x083185c8 +_080F2404: .4byte 0x0203a030 +_080F2408: + ldr r0, _080F243C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldr r0, _080F2440 + ldrb r1, [r4, 0x12] + movs r2, 0 + bl GetMapName + ldr r0, _080F2444 + ldrh r2, [r4, 0xE] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2448 + adds r1, r2 + bl gf_strcpy + ldrb r0, [r4, 0x11] + cmp r0, 0x1 + bne _080F2450 + ldr r1, _080F244C + movs r0, 0x3 + strb r0, [r1] + b _080F24C0 + .align 2, 0 +_080F243C: .4byte 0x02021cc4 +_080F2440: .4byte 0x02021dc4 +_080F2444: .4byte 0x02021ec4 +_080F2448: .4byte 0x083185c8 +_080F244C: .4byte 0x0203a030 +_080F2450: + ldr r1, _080F2458 + movs r0, 0x2 + strb r0, [r1] + b _080F24C0 + .align 2, 0 +_080F2458: .4byte 0x0203a030 +_080F245C: + ldr r0, _080F248C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldrb r1, [r4, 0x10] + movs r0, 0x1 + bl sub_80EF340 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _080F2494 + ldr r1, _080F2490 + movs r0, 0x5 + strb r0, [r1] + b _080F24C0 + .align 2, 0 +_080F248C: .4byte 0x02021cc4 +_080F2490: .4byte 0x0203a030 +_080F2494: + ldr r1, _080F249C + movs r0, 0x4 + strb r0, [r1] + b _080F24C0 + .align 2, 0 +_080F249C: .4byte 0x0203a030 +_080F24A0: + ldr r0, _080F24B4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldr r1, _080F24B8 + movs r0, 0x6 + strb r0, [r1] + b _080F24C0 + .align 2, 0 +_080F24B4: .4byte 0x02021cc4 +_080F24B8: .4byte 0x0203a030 +_080F24BC: + bl sub_80F577C +_080F24C0: + ldr r0, _080F24D4 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F24D4: .4byte 0x0858d394 + thumb_func_end sub_80F2370 + + thumb_func_start sub_80F24D8 +sub_80F24D8: @ 80F24D8 + push {r4-r7,lr} + ldr r2, _080F250C + ldr r0, _080F2510 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F2514 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F2518 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F251C + ldrb r7, [r0] + adds r6, r0, 0 + cmp r7, 0x33 + bls _080F2500 + b _080F26F0 +_080F2500: + lsls r0, r7, 2 + ldr r1, _080F2520 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F250C: .4byte 0x03005d8c +_080F2510: .4byte 0x020375e0 +_080F2514: .4byte 0x000027cc +_080F2518: .4byte 0x020375f0 +_080F251C: .4byte 0x0203a030 +_080F2520: .4byte _080F2524 + .align 2, 0 +_080F2524: + .4byte _080F25F4 + .4byte _080F2628 + .4byte _080F2654 + .4byte _080F265A + .4byte _080F2672 + .4byte _080F2672 + .4byte _080F2672 + .4byte _080F2684 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26A6 + .4byte _080F26CC +_080F25F4: + ldr r0, _080F2618 + adds r1, r5, 0 + adds r1, 0x10 + ldrb r2, [r5, 0x18] + bl sub_81DB5E8 + ldr r0, _080F261C + ldrh r2, [r5, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2620 + adds r1, r2 + bl gf_strcpy + ldr r1, _080F2624 + movs r0, 0x32 + strb r0, [r1] + b _080F26F0 + .align 2, 0 +_080F2618: .4byte 0x02021cc4 +_080F261C: .4byte 0x02021dc4 +_080F2620: .4byte 0x083185c8 +_080F2624: .4byte 0x0203a030 +_080F2628: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r2, r0, 0x1 + cmp r2, 0x1 + bne _080F2648 + ldr r1, _080F2644 + movs r0, 0x2 + strb r0, [r1] + b _080F26F0 + .align 2, 0 +_080F2644: .4byte 0x0203a030 +_080F2648: + ldr r1, _080F2650 + adds r0, r2, 0x2 + strb r0, [r1] + b _080F26F0 + .align 2, 0 +_080F2650: .4byte 0x0203a030 +_080F2654: + movs r0, 0x33 + strb r0, [r6] + b _080F26F0 +_080F265A: + bl GenerateRandomNumber + ldrb r4, [r6] + adds r4, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, r4 + strb r0, [r6] + b _080F26F0 +_080F2672: + adds r0, r5, 0 + bl sub_80EFB58 + ldr r1, _080F2680 + movs r0, 0x7 + strb r0, [r1] + b _080F26F0 + .align 2, 0 +_080F2680: .4byte 0x0203a030 +_080F2684: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1F + bl __umodsi3 + adds r0, 0x46 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x2 + adds r1, r2, 0 + bl sub_80EF340 + bl sub_80F577C + b _080F26F0 +_080F26A6: + ldr r4, _080F26C4 + adds r1, r5, 0x4 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_811EC08 + adds r0, r4, 0 + bl box_related_two__2 + ldr r1, _080F26C8 + movs r0, 0x1 + strb r0, [r1] + b _080F26FC + .align 2, 0 +_080F26C4: .4byte 0x02021fc4 +_080F26C8: .4byte 0x0203a030 +_080F26CC: + ldr r4, _080F26E8 + adds r1, r5, 0x4 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_811EC08 + adds r0, r4, 0 + bl box_related_two__2 + ldr r1, _080F26EC + movs r0, 0x3 + strb r0, [r1] + b _080F26FC + .align 2, 0 +_080F26E8: .4byte 0x02021fc4 +_080F26EC: .4byte 0x0203a030 +_080F26F0: + ldr r0, _080F2704 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_080F26FC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F2704: .4byte 0x0858d150 + thumb_func_end sub_80F24D8 + + thumb_func_start sub_80F2708 +sub_80F2708: @ 80F2708 + push {r4-r7,lr} + ldr r2, _080F273C + ldr r0, _080F2740 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F2744 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F2748 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F274C + ldrb r6, [r0] + adds r7, r0, 0 + cmp r6, 0x32 + bls _080F2730 + b _080F288C +_080F2730: + lsls r0, r6, 2 + ldr r1, _080F2750 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F273C: .4byte 0x03005d8c +_080F2740: .4byte 0x020375e0 +_080F2744: .4byte 0x000027cc +_080F2748: .4byte 0x020375f0 +_080F274C: .4byte 0x0203a030 +_080F2750: .4byte _080F2754 + .align 2, 0 +_080F2754: + .4byte _080F2820 + .4byte _080F2844 + .4byte _080F285C + .4byte _080F285C + .4byte _080F285C + .4byte _080F2862 + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F2868 +_080F2820: + ldr r0, _080F283C + adds r1, r5, 0 + adds r1, 0x10 + ldrb r2, [r5, 0x18] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80EFB58 + ldr r1, _080F2840 + movs r0, 0x32 + strb r0, [r1] + b _080F288C + .align 2, 0 +_080F283C: .4byte 0x02021cc4 +_080F2840: .4byte 0x0203a030 +_080F2844: + bl GenerateRandomNumber + ldrb r4, [r7] + adds r4, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, r4 + strb r0, [r7] + b _080F288C +_080F285C: + movs r0, 0x5 + strb r0, [r7] + b _080F288C +_080F2862: + bl sub_80F577C + b _080F288C +_080F2868: + ldr r4, _080F2884 + adds r1, r5, 0x4 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_811EC08 + adds r0, r4, 0 + bl box_related_two__2 + ldr r1, _080F2888 + movs r0, 0x1 + strb r0, [r1] + b _080F2898 + .align 2, 0 +_080F2884: .4byte 0x02021fc4 +_080F2888: .4byte 0x0203a030 +_080F288C: + ldr r0, _080F28A0 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_080F2898: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F28A0: .4byte 0x0858d170 + thumb_func_end sub_80F2708 + + thumb_func_start sub_80F28A4 +sub_80F28A4: @ 80F28A4 + push {r4-r6,lr} + ldr r2, _080F28D4 + ldr r0, _080F28D8 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F28DC + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F28E0 + movs r0, 0 + strh r0, [r1] + ldr r6, _080F28E4 + ldrb r5, [r6] + cmp r5, 0x3 + bgt _080F28E8 + cmp r5, 0x1 + bge _080F2930 + cmp r5, 0 + beq _080F28EE + b _080F297E + .align 2, 0 +_080F28D4: .4byte 0x03005d8c +_080F28D8: .4byte 0x020375e0 +_080F28DC: .4byte 0x000027cc +_080F28E0: .4byte 0x020375f0 +_080F28E4: .4byte 0x0203a030 +_080F28E8: + cmp r5, 0x4 + beq _080F2968 + b _080F297E +_080F28EE: + ldr r0, _080F2920 + adds r1, r4, 0x5 + ldrb r2, [r4, 0xD] + bl sub_81DB5E8 + ldr r0, _080F2924 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2928 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F292C + adds r1, r4, 0 + adds r1, 0x10 + ldrb r2, [r4, 0xE] + bl sub_81DB5E8 + ldrb r0, [r4, 0x4] + lsrs r0, 4 + adds r0, 0x1 + strb r0, [r6] + b _080F297E + .align 2, 0 +_080F2920: .4byte 0x02021cc4 +_080F2924: .4byte 0x02021dc4 +_080F2928: .4byte 0x083185c8 +_080F292C: .4byte 0x02021ec4 +_080F2930: + ldr r0, _080F2958 + adds r1, r4, 0x5 + ldrb r2, [r4, 0xD] + bl sub_81DB5E8 + ldr r0, _080F295C + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2960 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F2964 + ldrh r1, [r4, 0x1C] + bl sub_811EBBC + movs r0, 0x4 + strb r0, [r6] + b _080F297E + .align 2, 0 +_080F2958: .4byte 0x02021cc4 +_080F295C: .4byte 0x02021dc4 +_080F2960: .4byte 0x083185c8 +_080F2964: .4byte 0x02021ec4 +_080F2968: + ldr r0, _080F2990 + adds r1, r4, 0x5 + ldrb r2, [r4, 0xD] + bl sub_81DB5E8 + ldr r0, _080F2994 + ldrh r1, [r4, 0x1E] + bl sub_811EBBC + bl sub_80F577C +_080F297E: + ldr r0, _080F2998 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F2990: .4byte 0x02021cc4 +_080F2994: .4byte 0x02021ec4 +_080F2998: .4byte 0x0858d188 + thumb_func_end sub_80F28A4 + + thumb_func_start nullsub_46 +nullsub_46: @ 80F299C + bx lr + thumb_func_end nullsub_46 + + thumb_func_start sub_80F29A0 +sub_80F29A0: @ 80F29A0 + push {r4,lr} + ldr r2, _080F29F0 + ldr r0, _080F29F4 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F29F8 + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + ldr r0, _080F29FC + ldrb r1, [r4, 0x10] + movs r2, 0 + bl GetMapName + ldr r0, _080F2A00 + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2A04 + adds r1, r2 + bl gf_strcpy + bl sub_80F577C + bl sub_80ED430 + ldr r1, _080F2A08 + ldr r0, _080F2A0C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F29F0: .4byte 0x03005d8c +_080F29F4: .4byte 0x020375e0 +_080F29F8: .4byte 0x000027cc +_080F29FC: .4byte 0x02021cc4 +_080F2A00: .4byte 0x02021dc4 +_080F2A04: .4byte 0x083185c8 +_080F2A08: .4byte 0x0858d19c +_080F2A0C: .4byte 0x0203a030 + thumb_func_end sub_80F29A0 + + thumb_func_start sub_80F2A10 +sub_80F2A10: @ 80F2A10 + push {r4-r7,lr} + ldr r2, _080F2A44 + ldr r0, _080F2A48 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F2A4C + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, _080F2A50 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F2A54 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0x20 + bls _080F2A38 + b _080F311C +_080F2A38: + lsls r0, r7, 2 + ldr r1, _080F2A58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F2A44: .4byte 0x03005d8c +_080F2A48: .4byte 0x020375e0 +_080F2A4C: .4byte 0x000027cc +_080F2A50: .4byte 0x020375f0 +_080F2A54: .4byte 0x0203a030 +_080F2A58: .4byte _080F2A5C + .align 2, 0 +_080F2A5C: + .4byte _080F2AE0 + .4byte _080F2B54 + .4byte _080F2BA2 + .4byte _080F2BC8 + .4byte _080F2BF4 + .4byte _080F2D2C + .4byte _080F2D40 + .4byte _080F2D54 + .4byte _080F2D68 + .4byte _080F2DE8 + .4byte _080F2DFC + .4byte _080F2E10 + .4byte _080F2E24 + .4byte _080F2E38 + .4byte _080F2E4C + .4byte _080F2ECC + .4byte _080F2EE0 + .4byte _080F2EF4 + .4byte _080F2F08 + .4byte _080F2F1C + .4byte _080F2F30 + .4byte _080F2F44 + .4byte _080F2F58 + .4byte _080F2F94 + .4byte _080F3064 + .4byte _080F3080 + .4byte _080F30E0 + .4byte _080F30E0 + .4byte _080F30A8 + .4byte _080F30AE + .4byte _080F30E0 + .4byte _080F30E0 + .4byte _080F30FC +_080F2AE0: + ldr r0, _080F2B18 + ldrb r1, [r6, 0x1C] + bl sub_818E868 + ldr r0, _080F2B1C + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2B20 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F2B24 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + ldrb r0, [r6, 0xD] + ldrb r1, [r6, 0xE] + cmp r0, r1 + bne _080F2B38 + cmp r0, 0 + bne _080F2B2C + ldr r1, _080F2B28 + movs r0, 0x1 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2B18: .4byte 0x02021cc4 +_080F2B1C: .4byte 0x02021dc4 +_080F2B20: .4byte 0x083185c8 +_080F2B24: .4byte 0x02021ec4 +_080F2B28: .4byte 0x0203a030 +_080F2B2C: + ldr r1, _080F2B34 + movs r0, 0x3 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2B34: .4byte 0x0203a030 +_080F2B38: + cmp r0, r1 + bls _080F2B48 + ldr r1, _080F2B44 + movs r0, 0x2 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2B44: .4byte 0x0203a030 +_080F2B48: + ldr r1, _080F2B50 + movs r0, 0x4 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2B50: .4byte 0x0203a030 +_080F2B54: + ldr r0, _080F2B80 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2B84 + adds r1, r2 + bl gf_strcpy + ldrb r1, [r6, 0xF] + cmp r1, 0x8 + bne _080F2B6C + b _080F2CF0 +_080F2B6C: + cmp r1, 0x8 + bgt _080F2B88 +_080F2B70: + cmp r1, 0x2 + bne _080F2B76 + b _080F2CD8 +_080F2B76: + cmp r1, 0x2 + bgt _080F2B7C + b _080F2C96 +_080F2B7C: + b _080F2CAC + .align 2, 0 +_080F2B80: .4byte 0x02021dc4 +_080F2B84: .4byte 0x083185c8 +_080F2B88: + cmp r1, 0x20 + bne _080F2B8E + b _080F2D08 +_080F2B8E: + cmp r1, 0x20 + bgt _080F2B94 + b _080F2CBA +_080F2B94: + cmp r1, 0x40 + bne _080F2B9A + b _080F2D14 +_080F2B9A: + cmp r1, 0x80 + beq _080F2BA0 + b _080F311C +_080F2BA0: + b _080F2D20 +_080F2BA2: + ldr r0, _080F2BC0 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2BC4 + adds r1, r2 + bl gf_strcpy +_080F2BB2: + ldrb r1, [r6, 0xF] + cmp r1, 0x8 + bne _080F2BBA + b _080F2CF0 +_080F2BBA: + cmp r1, 0x8 + ble _080F2B70 + b _080F2B88 + .align 2, 0 +_080F2BC0: .4byte 0x02021dc4 +_080F2BC4: .4byte 0x083185c8 +_080F2BC8: + ldr r0, _080F2BE8 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2BEC + adds r1, r2 + bl gf_strcpy + ldr r0, _080F2BF0 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + b _080F2BB2 + .align 2, 0 +_080F2BE8: .4byte 0x02021dc4 +_080F2BEC: .4byte 0x083185c8 +_080F2BF0: .4byte 0x02021ec4 +_080F2BF4: + ldrb r0, [r6, 0x1C] + cmp r0, 0x4 + bhi _080F2C74 + lsls r0, 2 + ldr r1, _080F2C04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F2C04: .4byte _080F2C08 + .align 2, 0 +_080F2C08: + .4byte _080F2C1C + .4byte _080F2C30 + .4byte _080F2C44 + .4byte _080F2C58 + .4byte _080F2C6C +_080F2C1C: + ldr r0, _080F2C28 + ldr r1, _080F2C2C + bl gf_strcpy + b _080F2C74 + .align 2, 0 +_080F2C28: .4byte 0x02021cc4 +_080F2C2C: .4byte 0x085eb0e8 +_080F2C30: + ldr r0, _080F2C3C + ldr r1, _080F2C40 + bl gf_strcpy + b _080F2C74 + .align 2, 0 +_080F2C3C: .4byte 0x02021cc4 +_080F2C40: .4byte 0x085eb0ed +_080F2C44: + ldr r0, _080F2C50 + ldr r1, _080F2C54 + bl gf_strcpy + b _080F2C74 + .align 2, 0 +_080F2C50: .4byte 0x02021cc4 +_080F2C54: .4byte 0x085eb0f4 +_080F2C58: + ldr r0, _080F2C64 + ldr r1, _080F2C68 + bl gf_strcpy + b _080F2C74 + .align 2, 0 +_080F2C64: .4byte 0x02021cc4 +_080F2C68: .4byte 0x085eb0f9 +_080F2C6C: + ldr r0, _080F2C9C + ldr r1, _080F2CA0 + bl gf_strcpy +_080F2C74: + ldr r0, _080F2CA4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2CA8 + adds r1, r2 + bl gf_strcpy + ldrb r1, [r6, 0xF] + cmp r1, 0x8 + beq _080F2CF0 + cmp r1, 0x8 + bgt _080F2CB2 + cmp r1, 0x2 + beq _080F2CD8 + cmp r1, 0x2 + bgt _080F2CAC +_080F2C96: + cmp r1, 0x1 + beq _080F2CCA + b _080F311C + .align 2, 0 +_080F2C9C: .4byte 0x02021cc4 +_080F2CA0: .4byte 0x085eb0ff +_080F2CA4: .4byte 0x02021dc4 +_080F2CA8: .4byte 0x083185c8 +_080F2CAC: + cmp r1, 0x4 + beq _080F2CE4 + b _080F311C +_080F2CB2: + cmp r1, 0x20 + beq _080F2D08 + cmp r1, 0x20 + bgt _080F2CC0 +_080F2CBA: + cmp r1, 0x10 + beq _080F2CFC + b _080F311C +_080F2CC0: + cmp r1, 0x40 + beq _080F2D14 + cmp r1, 0x80 + beq _080F2D20 + b _080F311C +_080F2CCA: + ldr r1, _080F2CD4 + movs r0, 0x8 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2CD4: .4byte 0x0203a030 +_080F2CD8: + ldr r1, _080F2CE0 + movs r0, 0x5 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2CE0: .4byte 0x0203a030 +_080F2CE4: + ldr r1, _080F2CEC + movs r0, 0xE + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2CEC: .4byte 0x0203a030 +_080F2CF0: + ldr r1, _080F2CF8 + movs r0, 0x7 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2CF8: .4byte 0x0203a030 +_080F2CFC: + ldr r1, _080F2D04 + movs r0, 0x6 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2D04: .4byte 0x0203a030 +_080F2D08: + ldr r1, _080F2D10 + movs r0, 0x14 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2D10: .4byte 0x0203a030 +_080F2D14: + ldr r1, _080F2D1C + movs r0, 0x15 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2D1C: .4byte 0x0203a030 +_080F2D20: + ldr r1, _080F2D28 + movs r0, 0x16 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2D28: .4byte 0x0203a030 +_080F2D2C: + ldr r0, _080F2D38 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2D3C + b _080F2F72 + .align 2, 0 +_080F2D38: .4byte 0x02021dc4 +_080F2D3C: .4byte 0x083185c8 +_080F2D40: + ldr r0, _080F2D4C + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2D50 + b _080F2F72 + .align 2, 0 +_080F2D4C: .4byte 0x02021dc4 +_080F2D50: .4byte 0x083185c8 +_080F2D54: + ldr r0, _080F2D60 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2D64 + b _080F2F72 + .align 2, 0 +_080F2D60: .4byte 0x02021dc4 +_080F2D64: .4byte 0x083185c8 +_080F2D68: + ldr r0, _080F2D8C + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2D90 + adds r1, r2 + bl gf_strcpy + ldrb r0, [r6, 0x1C] + cmp r0, 0x4 + bls _080F2D80 + b _080F311C +_080F2D80: + lsls r0, 2 + ldr r1, _080F2D94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F2D8C: .4byte 0x02021dc4 +_080F2D90: .4byte 0x083185c8 +_080F2D94: .4byte _080F2D98 + .align 2, 0 +_080F2D98: + .4byte _080F2DAC + .4byte _080F2DB8 + .4byte _080F2DC4 + .4byte _080F2DD0 + .4byte _080F2DDC +_080F2DAC: + ldr r1, _080F2DB4 + movs r0, 0x9 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2DB4: .4byte 0x0203a030 +_080F2DB8: + ldr r1, _080F2DC0 + movs r0, 0xA + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2DC0: .4byte 0x0203a030 +_080F2DC4: + ldr r1, _080F2DCC + movs r0, 0xB + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2DCC: .4byte 0x0203a030 +_080F2DD0: + ldr r1, _080F2DD8 + movs r0, 0xC + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2DD8: .4byte 0x0203a030 +_080F2DDC: + ldr r1, _080F2DE4 + movs r0, 0xD + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2DE4: .4byte 0x0203a030 +_080F2DE8: + ldr r0, _080F2DF4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2DF8 + b _080F2F72 + .align 2, 0 +_080F2DF4: .4byte 0x02021dc4 +_080F2DF8: .4byte 0x083185c8 +_080F2DFC: + ldr r0, _080F2E08 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2E0C + b _080F2F72 + .align 2, 0 +_080F2E08: .4byte 0x02021dc4 +_080F2E0C: .4byte 0x083185c8 +_080F2E10: + ldr r0, _080F2E1C + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2E20 + b _080F2F72 + .align 2, 0 +_080F2E1C: .4byte 0x02021dc4 +_080F2E20: .4byte 0x083185c8 +_080F2E24: + ldr r0, _080F2E30 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2E34 + b _080F2F72 + .align 2, 0 +_080F2E30: .4byte 0x02021dc4 +_080F2E34: .4byte 0x083185c8 +_080F2E38: + ldr r0, _080F2E44 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2E48 + b _080F2F72 + .align 2, 0 +_080F2E44: .4byte 0x02021dc4 +_080F2E48: .4byte 0x083185c8 +_080F2E4C: + ldr r0, _080F2E70 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2E74 + adds r1, r2 + bl gf_strcpy + ldrb r0, [r6, 0x1C] + cmp r0, 0x4 + bls _080F2E64 + b _080F311C +_080F2E64: + lsls r0, 2 + ldr r1, _080F2E78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F2E70: .4byte 0x02021dc4 +_080F2E74: .4byte 0x083185c8 +_080F2E78: .4byte _080F2E7C + .align 2, 0 +_080F2E7C: + .4byte _080F2E90 + .4byte _080F2E9C + .4byte _080F2EA8 + .4byte _080F2EB4 + .4byte _080F2EC0 +_080F2E90: + ldr r1, _080F2E98 + movs r0, 0xF + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2E98: .4byte 0x0203a030 +_080F2E9C: + ldr r1, _080F2EA4 + movs r0, 0x10 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2EA4: .4byte 0x0203a030 +_080F2EA8: + ldr r1, _080F2EB0 + movs r0, 0x11 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2EB0: .4byte 0x0203a030 +_080F2EB4: + ldr r1, _080F2EBC + movs r0, 0x12 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2EBC: .4byte 0x0203a030 +_080F2EC0: + ldr r1, _080F2EC8 + movs r0, 0x13 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2EC8: .4byte 0x0203a030 +_080F2ECC: + ldr r0, _080F2ED8 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2EDC + b _080F2F72 + .align 2, 0 +_080F2ED8: .4byte 0x02021dc4 +_080F2EDC: .4byte 0x083185c8 +_080F2EE0: + ldr r0, _080F2EEC + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2EF0 + b _080F2F72 + .align 2, 0 +_080F2EEC: .4byte 0x02021dc4 +_080F2EF0: .4byte 0x083185c8 +_080F2EF4: + ldr r0, _080F2F00 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2F04 + b _080F2F72 + .align 2, 0 +_080F2F00: .4byte 0x02021dc4 +_080F2F04: .4byte 0x083185c8 +_080F2F08: + ldr r0, _080F2F14 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2F18 + b _080F2F72 + .align 2, 0 +_080F2F14: .4byte 0x02021dc4 +_080F2F18: .4byte 0x083185c8 +_080F2F1C: + ldr r0, _080F2F28 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2F2C + b _080F2F72 + .align 2, 0 +_080F2F28: .4byte 0x02021dc4 +_080F2F2C: .4byte 0x083185c8 +_080F2F30: + ldr r0, _080F2F3C + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2F40 + b _080F2F72 + .align 2, 0 +_080F2F3C: .4byte 0x02021dc4 +_080F2F40: .4byte 0x083185c8 +_080F2F44: + ldr r0, _080F2F50 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2F54 + b _080F2F72 + .align 2, 0 +_080F2F50: .4byte 0x02021dc4 +_080F2F54: .4byte 0x083185c8 +_080F2F58: + ldr r0, _080F2F80 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F2F84 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F2F88 + ldrh r2, [r6, 0x10] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F2F8C +_080F2F72: + adds r1, r2 + bl gf_strcpy + ldr r1, _080F2F90 + movs r0, 0x17 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F2F80: .4byte 0x02021dc4 +_080F2F84: .4byte 0x083185c8 +_080F2F88: .4byte 0x02021ec4 +_080F2F8C: .4byte 0x0831977c +_080F2F90: .4byte 0x0203a030 +_080F2F94: + ldr r0, _080F2FD4 + ldrh r1, [r6, 0x12] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F2FD8 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F2FDC + adds r1, r6, 0x4 + ldrb r2, [r6, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F2FE0 + ldrh r1, [r6, 0x2] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldrb r0, [r6, 0xC] + cmp r0, 0x8 + beq _080F3028 + cmp r0, 0x8 + bgt _080F2FEA + cmp r0, 0x2 + beq _080F3010 + cmp r0, 0x2 + bgt _080F2FE4 + cmp r0, 0x1 + beq _080F3002 + b _080F311C + .align 2, 0 +_080F2FD4: .4byte 0x02021cc4 +_080F2FD8: .4byte 0x083185c8 +_080F2FDC: .4byte 0x02021dc4 +_080F2FE0: .4byte 0x02021ec4 +_080F2FE4: + cmp r0, 0x4 + beq _080F301C + b _080F311C +_080F2FEA: + cmp r0, 0x20 + beq _080F3040 + cmp r0, 0x20 + bgt _080F2FF8 + cmp r0, 0x10 + beq _080F3034 + b _080F311C +_080F2FF8: + cmp r0, 0x40 + beq _080F304C + cmp r0, 0x80 + beq _080F3058 + b _080F311C +_080F3002: + ldr r1, _080F300C + movs r0, 0x1F + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F300C: .4byte 0x0203a030 +_080F3010: + ldr r1, _080F3018 + movs r0, 0x1E + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F3018: .4byte 0x0203a030 +_080F301C: + ldr r1, _080F3024 + movs r0, 0x1D + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F3024: .4byte 0x0203a030 +_080F3028: + ldr r1, _080F3030 + movs r0, 0x1C + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F3030: .4byte 0x0203a030 +_080F3034: + ldr r1, _080F303C + movs r0, 0x1B + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F303C: .4byte 0x0203a030 +_080F3040: + ldr r1, _080F3048 + movs r0, 0x1A + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F3048: .4byte 0x0203a030 +_080F304C: + ldr r1, _080F3054 + movs r0, 0x19 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F3054: .4byte 0x0203a030 +_080F3058: + ldr r1, _080F3060 + movs r0, 0x18 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F3060: .4byte 0x0203a030 +_080F3064: + ldr r0, _080F3078 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F307C + adds r1, r2 + bl gf_strcpy + b _080F30EA + .align 2, 0 +_080F3078: .4byte 0x02021cc4 +_080F307C: .4byte 0x083185c8 +_080F3080: + ldr r0, _080F309C + adds r1, r6, 0x4 + ldrb r2, [r6, 0x1E] + bl sub_81DB5E8 + ldr r0, _080F30A0 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F30A4 + adds r1, r2 + bl gf_strcpy + b _080F30EA + .align 2, 0 +_080F309C: .4byte 0x02021cc4 +_080F30A0: .4byte 0x02021dc4 +_080F30A4: .4byte 0x083185c8 +_080F30A8: + movs r0, 0x20 + strb r0, [r2] + b _080F311C +_080F30AE: + ldr r0, _080F30D0 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + ldr r0, _080F30D4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F30D8 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F30DC + b _080F30E2 + .align 2, 0 +_080F30D0: .4byte 0x02021cc4 +_080F30D4: .4byte 0x02021dc4 +_080F30D8: .4byte 0x083185c8 +_080F30DC: .4byte 0x02021ec4 +_080F30E0: + ldr r0, _080F30F4 +_080F30E2: + adds r1, r6, 0x4 + ldrb r2, [r6, 0x1E] + bl sub_81DB5E8 +_080F30EA: + ldr r1, _080F30F8 + movs r0, 0x20 + strb r0, [r1] + b _080F311C + .align 2, 0 +_080F30F4: .4byte 0x02021cc4 +_080F30F8: .4byte 0x0203a030 +_080F30FC: + ldr r0, _080F3130 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + ldr r0, _080F3134 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F3138 + adds r1, r2 + bl gf_strcpy + bl sub_80F577C +_080F311C: + ldr r0, _080F313C + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F3130: .4byte 0x02021cc4 +_080F3134: .4byte 0x02021dc4 +_080F3138: .4byte 0x083185c8 +_080F313C: .4byte 0x0858d27c + thumb_func_end sub_80F2A10 + + thumb_func_start sub_80F3140 +sub_80F3140: @ 80F3140 + push {r4,r5,lr} + ldr r2, _080F3174 + ldr r0, _080F3178 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F317C + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F3180 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F3184 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0x7 + bls _080F3168 + b _080F3362 +_080F3168: + lsls r0, r5, 2 + ldr r1, _080F3188 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F3174: .4byte 0x03005d8c +_080F3178: .4byte 0x020375e0 +_080F317C: .4byte 0x000027cc +_080F3180: .4byte 0x020375f0 +_080F3184: .4byte 0x0203a030 +_080F3188: .4byte _080F318C + .align 2, 0 +_080F318C: + .4byte _080F31AC + .4byte _080F31CA + .4byte _080F321C + .4byte _080F3268 + .4byte _080F329C + .4byte _080F32C0 + .4byte _080F32EC + .4byte _080F3338 +_080F31AC: + ldrb r1, [r4, 0x18] + cmp r1, 0 + bge _080F31B4 + b _080F3362 +_080F31B4: + cmp r1, 0x1 + ble _080F31BE + cmp r1, 0x2 + beq _080F31C4 + b _080F3362 +_080F31BE: + movs r0, 0x1 + strb r0, [r2] + b _080F3362 +_080F31C4: + movs r0, 0x5 + strb r0, [r2] + b _080F3362 +_080F31CA: + ldr r0, _080F31F0 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, _080F31F4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldrb r0, [r4, 0x18] + cmp r0, 0 + bne _080F3200 + ldr r0, _080F31F8 + ldr r1, _080F31FC + bl gf_strcpy + b _080F3208 + .align 2, 0 +_080F31F0: .4byte 0x02021cc4 +_080F31F4: .4byte 0x02021dc4 +_080F31F8: .4byte 0x02021ec4 +_080F31FC: .4byte 0x085ecb64 +_080F3200: + ldr r0, _080F3210 + ldr r1, _080F3214 + bl gf_strcpy +_080F3208: + ldr r1, _080F3218 + movs r0, 0x2 + strb r0, [r1] + b _080F3362 + .align 2, 0 +_080F3210: .4byte 0x02021ec4 +_080F3214: .4byte 0x085ecb6b +_080F3218: .4byte 0x0203a030 +_080F321C: + ldr r0, _080F3250 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, _080F3254 + ldrh r2, [r4, 0x16] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F3258 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F325C + ldrh r2, [r4, 0x14] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F3260 + adds r1, r2 + bl gf_strcpy + ldr r1, _080F3264 + movs r0, 0x3 + strb r0, [r1] + b _080F3362 + .align 2, 0 +_080F3250: .4byte 0x02021cc4 +_080F3254: .4byte 0x02021dc4 +_080F3258: .4byte 0x083185c8 +_080F325C: .4byte 0x02021ec4 +_080F3260: .4byte 0x0831977c +_080F3264: .4byte 0x0203a030 +_080F3268: + ldr r0, _080F328C + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldr r0, _080F3290 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F3294 + adds r1, r2 + bl gf_strcpy + ldr r1, _080F3298 + movs r0, 0x4 + strb r0, [r1] + b _080F3362 + .align 2, 0 +_080F328C: .4byte 0x02021cc4 +_080F3290: .4byte 0x02021dc4 +_080F3294: .4byte 0x083185c8 +_080F3298: .4byte 0x0203a030 +_080F329C: + ldr r0, _080F32B8 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, _080F32BC + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + bl sub_80F577C + b _080F3362 + .align 2, 0 +_080F32B8: .4byte 0x02021cc4 +_080F32BC: .4byte 0x02021dc4 +_080F32C0: + ldr r0, _080F32E0 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, _080F32E4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldr r1, _080F32E8 + movs r0, 0x6 + strb r0, [r1] + b _080F3362 + .align 2, 0 +_080F32E0: .4byte 0x02021cc4 +_080F32E4: .4byte 0x02021dc4 +_080F32E8: .4byte 0x0203a030 +_080F32EC: + ldr r0, _080F3320 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, _080F3324 + ldrh r2, [r4, 0x16] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F3328 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F332C + ldrh r2, [r4, 0x14] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F3330 + adds r1, r2 + bl gf_strcpy + ldr r1, _080F3334 + movs r0, 0x7 + strb r0, [r1] + b _080F3362 + .align 2, 0 +_080F3320: .4byte 0x02021cc4 +_080F3324: .4byte 0x02021dc4 +_080F3328: .4byte 0x083185c8 +_080F332C: .4byte 0x02021ec4 +_080F3330: .4byte 0x0831977c +_080F3334: .4byte 0x0203a030 +_080F3338: + ldr r0, _080F3374 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, _080F3378 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldr r0, _080F337C + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F3380 + adds r1, r2 + bl gf_strcpy + bl sub_80F577C +_080F3362: + ldr r0, _080F3384 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F3374: .4byte 0x02021cc4 +_080F3378: .4byte 0x02021dc4 +_080F337C: .4byte 0x02021ec4 +_080F3380: .4byte 0x083185c8 +_080F3384: .4byte 0x0858d300 + thumb_func_end sub_80F3140 + + thumb_func_start sub_80F3388 +sub_80F3388: @ 80F3388 + push {r4,r5,lr} + ldr r2, _080F33B8 + ldr r0, _080F33BC + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F33C0 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F33C4 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F33C8 + ldrb r5, [r0] + cmp r5, 0x5 + bls _080F33AE + b _080F3624 +_080F33AE: + lsls r0, r5, 2 + ldr r1, _080F33CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F33B8: .4byte 0x03005d8c +_080F33BC: .4byte 0x020375e0 +_080F33C0: .4byte 0x000027cc +_080F33C4: .4byte 0x020375f0 +_080F33C8: .4byte 0x0203a030 +_080F33CC: .4byte _080F33D0 + .align 2, 0 +_080F33D0: + .4byte _080F33E8 + .4byte _080F3418 + .4byte _080F3500 + .4byte _080F350C + .4byte _080F35F4 + .4byte _080F3620 +_080F33E8: + ldr r0, _080F3404 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] + bl sub_81DB5E8 + ldrb r0, [r4, 0x2] + cmp r0, 0x14 + bls _080F340C + ldr r1, _080F3408 + movs r0, 0x1 + strb r0, [r1] + b _080F3624 + .align 2, 0 +_080F3404: .4byte 0x02021cc4 +_080F3408: .4byte 0x0203a030 +_080F340C: + ldr r1, _080F3414 + movs r0, 0x3 + strb r0, [r1] + b _080F3624 + .align 2, 0 +_080F3414: .4byte 0x0203a030 +_080F3418: + ldrb r0, [r4, 0x3] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0x4 + bhi _080F349C + lsls r0, 2 + ldr r1, _080F342C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F342C: .4byte _080F3430 + .align 2, 0 +_080F3430: + .4byte _080F3444 + .4byte _080F3458 + .4byte _080F346C + .4byte _080F3480 + .4byte _080F3494 +_080F3444: + ldr r0, _080F3450 + ldr r1, _080F3454 + bl gf_strcpy + b _080F349C + .align 2, 0 +_080F3450: .4byte 0x02021cc4 +_080F3454: .4byte 0x085ecb48 +_080F3458: + ldr r0, _080F3464 + ldr r1, _080F3468 + bl gf_strcpy + b _080F349C + .align 2, 0 +_080F3464: .4byte 0x02021cc4 +_080F3468: .4byte 0x085ecb4e +_080F346C: + ldr r0, _080F3478 + ldr r1, _080F347C + bl gf_strcpy + b _080F349C + .align 2, 0 +_080F3478: .4byte 0x02021cc4 +_080F347C: .4byte 0x085ecb52 +_080F3480: + ldr r0, _080F348C + ldr r1, _080F3490 + bl gf_strcpy + b _080F349C + .align 2, 0 +_080F348C: .4byte 0x02021cc4 +_080F3490: .4byte 0x085ecb58 +_080F3494: + ldr r0, _080F34AC + ldr r1, _080F34B0 + bl gf_strcpy +_080F349C: + ldrb r0, [r4, 0x2] + cmp r0, 0x18 + bls _080F34BC + ldr r0, _080F34B4 + ldr r1, _080F34B8 + bl gf_strcpy + b _080F34DC + .align 2, 0 +_080F34AC: .4byte 0x02021cc4 +_080F34B0: .4byte 0x085ecb5f +_080F34B4: .4byte 0x02021dc4 +_080F34B8: .4byte 0x085ecb2a +_080F34BC: + cmp r0, 0x16 + bls _080F34D4 + ldr r0, _080F34CC + ldr r1, _080F34D0 + bl gf_strcpy + b _080F34DC + .align 2, 0 +_080F34CC: .4byte 0x02021dc4 +_080F34D0: .4byte 0x085ecb20 +_080F34D4: + ldr r0, _080F34F0 + ldr r1, _080F34F4 + bl gf_strcpy +_080F34DC: + ldr r0, _080F34F8 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] + bl sub_81DB5E8 + ldr r1, _080F34FC + movs r0, 0x2 + strb r0, [r1] + b _080F3624 + .align 2, 0 +_080F34F0: .4byte 0x02021dc4 +_080F34F4: .4byte 0x085ecb1b +_080F34F8: .4byte 0x02021ec4 +_080F34FC: .4byte 0x0203a030 +_080F3500: + ldr r0, _080F3508 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x15] + b _080F3606 + .align 2, 0 +_080F3508: .4byte 0x02021cc4 +_080F350C: + ldrb r0, [r4, 0x3] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0x4 + bhi _080F3590 + lsls r0, 2 + ldr r1, _080F3520 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F3520: .4byte _080F3524 + .align 2, 0 +_080F3524: + .4byte _080F3538 + .4byte _080F354C + .4byte _080F3560 + .4byte _080F3574 + .4byte _080F3588 +_080F3538: + ldr r0, _080F3544 + ldr r1, _080F3548 + bl gf_strcpy + b _080F3590 + .align 2, 0 +_080F3544: .4byte 0x02021cc4 +_080F3548: .4byte 0x085ecb48 +_080F354C: + ldr r0, _080F3558 + ldr r1, _080F355C + bl gf_strcpy + b _080F3590 + .align 2, 0 +_080F3558: .4byte 0x02021cc4 +_080F355C: .4byte 0x085ecb4e +_080F3560: + ldr r0, _080F356C + ldr r1, _080F3570 + bl gf_strcpy + b _080F3590 + .align 2, 0 +_080F356C: .4byte 0x02021cc4 +_080F3570: .4byte 0x085ecb52 +_080F3574: + ldr r0, _080F3580 + ldr r1, _080F3584 + bl gf_strcpy + b _080F3590 + .align 2, 0 +_080F3580: .4byte 0x02021cc4 +_080F3584: .4byte 0x085ecb58 +_080F3588: + ldr r0, _080F35A0 + ldr r1, _080F35A4 + bl gf_strcpy +_080F3590: + ldrb r0, [r4, 0x2] + cmp r0, 0x10 + bls _080F35B0 + ldr r0, _080F35A8 + ldr r1, _080F35AC + bl gf_strcpy + b _080F35D0 + .align 2, 0 +_080F35A0: .4byte 0x02021cc4 +_080F35A4: .4byte 0x085ecb5f +_080F35A8: .4byte 0x02021dc4 +_080F35AC: .4byte 0x085ecb34 +_080F35B0: + cmp r0, 0xD + bls _080F35C8 + ldr r0, _080F35C0 + ldr r1, _080F35C4 + bl gf_strcpy + b _080F35D0 + .align 2, 0 +_080F35C0: .4byte 0x02021dc4 +_080F35C4: .4byte 0x085ecb3a +_080F35C8: + ldr r0, _080F35E4 + ldr r1, _080F35E8 + bl gf_strcpy +_080F35D0: + ldr r0, _080F35EC + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] + bl sub_81DB5E8 + ldr r1, _080F35F0 + movs r0, 0x4 + strb r0, [r1] + b _080F3624 + .align 2, 0 +_080F35E4: .4byte 0x02021dc4 +_080F35E8: .4byte 0x085ecb3e +_080F35EC: .4byte 0x02021ec4 +_080F35F0: .4byte 0x0203a030 +_080F35F4: + ldr r0, _080F3614 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x15] + bl sub_81DB5E8 + ldr r0, _080F3618 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] +_080F3606: + bl sub_81DB5E8 + ldr r1, _080F361C + movs r0, 0x5 + strb r0, [r1] + b _080F3624 + .align 2, 0 +_080F3614: .4byte 0x02021cc4 +_080F3618: .4byte 0x02021dc4 +_080F361C: .4byte 0x0203a030 +_080F3620: + bl sub_80F577C +_080F3624: + ldr r0, _080F3638 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F3638: .4byte 0x0858d228 + thumb_func_end sub_80F3388 + + thumb_func_start sub_80F363C +sub_80F363C: @ 80F363C + push {r4-r7,lr} + ldr r0, _080F365C + movs r1, 0 + strh r1, [r0] + ldr r0, _080F3660 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0x8 + bls _080F3650 + b _080F37EA +_080F3650: + lsls r0, r7, 2 + ldr r1, _080F3664 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F365C: .4byte 0x020375f0 +_080F3660: .4byte 0x0203a030 +_080F3664: .4byte _080F3668 + .align 2, 0 +_080F3668: + .4byte _080F368C + .4byte _080F36D4 + .4byte _080F36DA + .4byte _080F372C + .4byte _080F379C + .4byte _080F379C + .4byte _080F379C + .4byte _080F379C + .4byte _080F37A2 +_080F368C: + ldr r0, _080F36B4 + ldr r4, _080F36B8 + ldr r1, [r4] + ldr r2, _080F36BC + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl GetMapName + ldr r0, [r4] + ldr r1, _080F36C0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bls _080F36C8 + ldr r1, _080F36C4 + movs r0, 0x1 + strb r0, [r1] + b _080F37EA + .align 2, 0 +_080F36B4: .4byte 0x02021cc4 +_080F36B8: .4byte 0x03005d8c +_080F36BC: .4byte 0x00002bac +_080F36C0: .4byte 0x00002bad +_080F36C4: .4byte 0x0203a030 +_080F36C8: + ldr r1, _080F36D0 + movs r0, 0x2 + strb r0, [r1] + b _080F37EA + .align 2, 0 +_080F36D0: .4byte 0x0203a030 +_080F36D4: + movs r0, 0x2 + strb r0, [r2] + b _080F37EA +_080F36DA: + ldr r0, _080F36F4 + ldr r0, [r0] + ldr r1, _080F36F8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F36FC + movs r0, 0x4 + strb r0, [r2] + b _080F37EA + .align 2, 0 +_080F36F4: .4byte 0x03005d8c +_080F36F8: .4byte 0x00002bae +_080F36FC: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080F370A + movs r0, 0x5 + strb r0, [r2] + b _080F37EA +_080F370A: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080F3718 + movs r0, 0x6 + strb r0, [r2] + b _080F37EA +_080F3718: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F3726 + movs r0, 0x7 + strb r0, [r2] + b _080F37EA +_080F3726: + movs r0, 0x3 + strb r0, [r2] + b _080F37EA +_080F372C: + ldr r0, _080F3774 + ldr r4, _080F3778 + ldr r1, [r4] + ldr r2, _080F377C + adds r1, r2 + ldrh r1, [r1] + movs r6, 0xB + muls r1, r6 + ldr r5, _080F3780 + adds r1, r5 + bl gf_strcpy + ldr r0, _080F3784 + ldr r1, [r4] + ldr r2, _080F3788 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F378C + adds r1, r2 + bl gf_strcpy + ldr r0, _080F3790 + ldr r1, [r4] + ldr r2, _080F3794 + adds r1, r2 + ldrh r1, [r1] + muls r1, r6 + adds r1, r5 + bl gf_strcpy + ldr r1, _080F3798 + movs r0, 0x8 + strb r0, [r1] + b _080F37EA + .align 2, 0 +_080F3774: .4byte 0x02021cc4 +_080F3778: .4byte 0x03005d8c +_080F377C: .4byte 0x00002ba4 +_080F3780: .4byte 0x083185c8 +_080F3784: .4byte 0x02021dc4 +_080F3788: .4byte 0x00002ba8 +_080F378C: .4byte 0x0831977c +_080F3790: .4byte 0x02021ec4 +_080F3794: .4byte 0x00002ba6 +_080F3798: .4byte 0x0203a030 +_080F379C: + movs r0, 0x8 + strb r0, [r2] + b _080F37EA +_080F37A2: + ldr r0, _080F37FC + ldr r4, _080F3800 + ldr r1, [r4] + ldr r2, _080F3804 + adds r1, r2 + ldrh r1, [r1] + bl sub_811EBBC + ldr r0, _080F3808 + ldr r1, [r4] + ldr r2, _080F380C + adds r1, r2 + ldrh r1, [r1] + movs r6, 0xB + muls r1, r6 + ldr r5, _080F3810 + adds r1, r5 + bl gf_strcpy + ldr r0, _080F3814 + ldr r1, [r4] + ldr r2, _080F3818 + adds r1, r2 + ldrh r1, [r1] + muls r1, r6 + adds r1, r5 + bl gf_strcpy + ldr r1, _080F381C + movs r0, 0x1 + strh r0, [r1] + ldr r1, _080F3820 + movs r0, 0 + strb r0, [r1] + bl sub_80EC4E8 +_080F37EA: + ldr r0, _080F3824 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F37FC: .4byte 0x02021cc4 +_080F3800: .4byte 0x03005d8c +_080F3804: .4byte 0x00002baa +_080F3808: .4byte 0x02021dc4 +_080F380C: .4byte 0x00002ba4 +_080F3810: .4byte 0x083185c8 +_080F3814: .4byte 0x02021ec4 +_080F3818: .4byte 0x00002ba6 +_080F381C: .4byte 0x020375f0 +_080F3820: .4byte 0x0203a030 +_080F3824: .4byte 0x0858d66c + thumb_func_end sub_80F363C + + thumb_func_start sub_80F3828 +sub_80F3828: @ 80F3828 + push {r4,r5,lr} + ldr r2, _080F3854 + ldr r0, _080F3858 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F385C + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r0, _080F3860 + movs r1, 0 + strh r1, [r0] + ldrb r0, [r4, 0x2] + ldrb r2, [r4, 0x3] + cmp r0, r2 + bcs _080F3868 + ldr r0, _080F3864 + strb r1, [r0] + b _080F3870 + .align 2, 0 +_080F3854: .4byte 0x03005d8c +_080F3858: .4byte 0x020375e0 +_080F385C: .4byte 0x000027cc +_080F3860: .4byte 0x020375f0 +_080F3864: .4byte 0x0203a030 +_080F3868: + ldr r1, _080F387C + movs r0, 0x1 + strb r0, [r1] + adds r0, r1, 0 +_080F3870: + ldrb r5, [r0] + cmp r5, 0 + beq _080F3880 + cmp r5, 0x1 + beq _080F38B8 + b _080F38E0 + .align 2, 0 +_080F387C: .4byte 0x0203a030 +_080F3880: + ldr r0, _080F38AC + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x6] + bl sub_81DB5E8 + ldr r0, _080F38B0 + ldrh r2, [r4, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F38B4 + adds r1, r2 + bl gf_strcpy + ldrb r1, [r4, 0x3] + movs r0, 0x2 + bl sub_80EF340 + bl sub_80F577C + b _080F38E0 + .align 2, 0 +_080F38AC: .4byte 0x02021cc4 +_080F38B0: .4byte 0x02021dc4 +_080F38B4: .4byte 0x083185c8 +_080F38B8: + ldr r0, _080F38F4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x6] + bl sub_81DB5E8 + ldr r0, _080F38F8 + ldrh r2, [r4, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F38FC + adds r1, r2 + bl gf_strcpy + ldrb r1, [r4, 0x2] + movs r0, 0x2 + bl sub_80EF340 + bl sub_80F577C +_080F38E0: + ldr r0, _080F3900 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F38F4: .4byte 0x02021cc4 +_080F38F8: .4byte 0x02021dc4 +_080F38FC: .4byte 0x083185c8 +_080F3900: .4byte 0x0858d3b0 + thumb_func_end sub_80F3828 + + thumb_func_start sub_80F3904 +sub_80F3904: @ 80F3904 + push {r4-r6,lr} + ldr r2, _080F3934 + ldr r0, _080F3938 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F393C + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F3940 + movs r0, 0 + strh r0, [r1] + ldr r6, _080F3944 + ldrb r5, [r6] + cmp r5, 0x1 + beq _080F3974 + cmp r5, 0x1 + bgt _080F3948 + cmp r5, 0 + beq _080F394E + b _080F39BE + .align 2, 0 +_080F3934: .4byte 0x03005d8c +_080F3938: .4byte 0x020375e0 +_080F393C: .4byte 0x000027cc +_080F3940: .4byte 0x020375f0 +_080F3944: .4byte 0x0203a030 +_080F3948: + cmp r5, 0x2 + beq _080F3994 + b _080F39BE +_080F394E: + ldr r0, _080F3970 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xB] + bl sub_81DB5E8 + ldrh r1, [r4, 0x6] + movs r0, 0x1 + bl sub_80EF340 + ldrh r1, [r4, 0x2] + movs r0, 0x2 + bl sub_80EF340 + movs r0, 0x1 + strb r0, [r6] + b _080F39BE + .align 2, 0 +_080F3970: .4byte 0x02021cc4 +_080F3974: + ldr r0, _080F398C + ldrh r2, [r4, 0x8] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F3990 + adds r1, r2 + bl gf_strcpy + movs r0, 0x2 + strb r0, [r6] + b _080F39BE + .align 2, 0 +_080F398C: .4byte 0x02021cc4 +_080F3990: .4byte 0x083185c8 +_080F3994: + ldr r0, _080F39D0 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xB] + bl sub_81DB5E8 + ldr r0, _080F39D4 + ldrb r1, [r4, 0xA] + movs r2, 0 + bl GetMapName + ldr r0, _080F39D8 + ldrh r2, [r4, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F39DC + adds r1, r2 + bl gf_strcpy + bl sub_80F577C +_080F39BE: + ldr r0, _080F39E0 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F39D0: .4byte 0x02021cc4 +_080F39D4: .4byte 0x02021dc4 +_080F39D8: .4byte 0x02021ec4 +_080F39DC: .4byte 0x083185c8 +_080F39E0: .4byte 0x0858d3b8 + thumb_func_end sub_80F3904 + + thumb_func_start sub_80F39E4 +sub_80F39E4: @ 80F39E4 + push {r4,r5,lr} + ldr r2, _080F3A18 + ldr r0, _080F3A1C + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F3A20 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F3A24 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F3A28 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xA + bls _080F3A0C + b _080F3BE8 +_080F3A0C: + lsls r0, r5, 2 + ldr r1, _080F3A2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F3A18: .4byte 0x03005d8c +_080F3A1C: .4byte 0x020375e0 +_080F3A20: .4byte 0x000027cc +_080F3A24: .4byte 0x020375f0 +_080F3A28: .4byte 0x0203a030 +_080F3A2C: .4byte _080F3A30 + .align 2, 0 +_080F3A30: + .4byte _080F3A5C + .4byte _080F3B30 + .4byte _080F3B58 + .4byte _080F3B90 + .4byte _080F3BA2 + .4byte _080F3BC4 + .4byte _080F3BD8 + .4byte _080F3A92 + .4byte _080F3AC0 + .4byte _080F3ADC + .4byte _080F3AF8 +_080F3A5C: + ldrb r0, [r4, 0x7] + cmp r0, 0x56 + beq _080F3A6C + cmp r0, 0x57 + beq _080F3A72 + movs r0, 0x7 + strb r0, [r2] + b _080F3BE8 +_080F3A6C: + movs r0, 0x8 + strb r0, [r2] + b _080F3BE8 +_080F3A72: + ldrh r1, [r4, 0xA] + ldr r0, _080F3A88 + cmp r1, r0 + bgt _080F3A8C + subs r0, 0x2 + cmp r1, r0 + blt _080F3A8C + movs r0, 0xA + strb r0, [r2] + b _080F3BE8 + .align 2, 0 +_080F3A88: .4byte 0x00000117 +_080F3A8C: + movs r0, 0x9 + strb r0, [r2] + b _080F3BE8 +_080F3A92: + ldr r0, _080F3AB8 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r0, _080F3ABC + ldrb r1, [r4, 0x7] + movs r2, 0 + bl GetMapName +_080F3AB0: + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _080F3B12 + b _080F3B24 + .align 2, 0 +_080F3AB8: .4byte 0x02021cc4 +_080F3ABC: .4byte 0x02021ec4 +_080F3AC0: + ldr r0, _080F3AD8 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + b _080F3AB0 + .align 2, 0 +_080F3AD8: .4byte 0x02021cc4 +_080F3ADC: + ldr r0, _080F3AF4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + b _080F3AB0 + .align 2, 0 +_080F3AF4: .4byte 0x02021cc4 +_080F3AF8: + ldr r0, _080F3B1C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _080F3B24 +_080F3B12: + ldr r1, _080F3B20 + movs r0, 0x1 + strb r0, [r1] + b _080F3BE8 + .align 2, 0 +_080F3B1C: .4byte 0x02021cc4 +_080F3B20: .4byte 0x0203a030 +_080F3B24: + ldr r1, _080F3B2C + movs r0, 0x2 + strb r0, [r1] + b _080F3BE8 + .align 2, 0 +_080F3B2C: .4byte 0x0203a030 +_080F3B30: + ldrb r1, [r4, 0x4] + movs r0, 0 + bl sub_80EF340 + ldr r0, _080F3B50 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080F3BCC + ldr r0, [r4, 0x4] + ldr r1, _080F3B54 + ands r0, r1 + cmp r0, 0 + bne _080F3B6E + b _080F3B84 + .align 2, 0 +_080F3B50: .4byte 0x000008a8 +_080F3B54: .4byte 0x00ffff00 +_080F3B58: + ldr r0, _080F3B78 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _080F3BCC + ldr r0, [r4, 0x4] + ldr r1, _080F3B7C + ands r0, r1 + cmp r0, 0 + beq _080F3B84 +_080F3B6E: + ldr r1, _080F3B80 + movs r0, 0x4 + strb r0, [r1] + b _080F3BE8 + .align 2, 0 +_080F3B78: .4byte 0x000008a8 +_080F3B7C: .4byte 0x00ffff00 +_080F3B80: .4byte 0x0203a030 +_080F3B84: + ldr r1, _080F3B8C + movs r0, 0x3 + strb r0, [r1] + b _080F3BE8 + .align 2, 0 +_080F3B8C: .4byte 0x0203a030 +_080F3B90: + ldrh r0, [r4, 0x8] + cmp r0, 0 + bne _080F3B9C + movs r0, 0x6 + strb r0, [r2] + b _080F3BE8 +_080F3B9C: + movs r0, 0x5 + strb r0, [r2] + b _080F3BE8 +_080F3BA2: + ldrb r1, [r4, 0x6] + movs r0, 0 + bl sub_80EF340 + ldrb r1, [r4, 0x5] + movs r0, 0x1 + bl sub_80EF340 + ldrh r0, [r4, 0x8] + cmp r0, 0 + beq _080F3BCC + ldr r1, _080F3BC0 + movs r0, 0x5 + strb r0, [r1] + b _080F3BE8 + .align 2, 0 +_080F3BC0: .4byte 0x0203a030 +_080F3BC4: + ldrh r1, [r4, 0x8] + movs r0, 0 + bl sub_80EF340 +_080F3BCC: + ldr r1, _080F3BD4 + movs r0, 0x6 + strb r0, [r1] + b _080F3BE8 + .align 2, 0 +_080F3BD4: .4byte 0x0203a030 +_080F3BD8: + ldr r0, _080F3BFC + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + bl sub_80F577C +_080F3BE8: + ldr r0, _080F3C00 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F3BFC: .4byte 0x02021cc4 +_080F3C00: .4byte 0x0858d3c4 + thumb_func_end sub_80F39E4 + + thumb_func_start sub_80F3C04 +sub_80F3C04: @ 80F3C04 + push {r4,r5,lr} + ldr r2, _080F3C34 + ldr r0, _080F3C38 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F3C3C + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F3C40 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F3C44 + ldrb r5, [r0] + cmp r5, 0x6 + bls _080F3C2A + b _080F3D54 +_080F3C2A: + lsls r0, r5, 2 + ldr r1, _080F3C48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F3C34: .4byte 0x03005d8c +_080F3C38: .4byte 0x020375e0 +_080F3C3C: .4byte 0x000027cc +_080F3C40: .4byte 0x020375f0 +_080F3C44: .4byte 0x0203a030 +_080F3C48: .4byte _080F3C4C + .align 2, 0 +_080F3C4C: + .4byte _080F3C68 + .4byte _080F3CA0 + .4byte _080F3CA0 + .4byte _080F3CD4 + .4byte _080F3D0C + .4byte _080F3D0C + .4byte _080F3D40 +_080F3C68: + ldr r0, _080F3C88 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldr r0, _080F3C8C + ldrh r1, [r4, 0x6] + bl sub_811EBBC + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _080F3C94 + ldr r1, _080F3C90 + movs r0, 0x1 + strb r0, [r1] + b _080F3D54 + .align 2, 0 +_080F3C88: .4byte 0x02021cc4 +_080F3C8C: .4byte 0x02021dc4 +_080F3C90: .4byte 0x0203a030 +_080F3C94: + ldr r1, _080F3C9C + movs r0, 0x2 + strb r0, [r1] + b _080F3D54 + .align 2, 0 +_080F3C9C: .4byte 0x0203a030 +_080F3CA0: + ldr r0, _080F3CC4 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldr r0, _080F3CC8 + ldrh r1, [r4, 0x6] + bl sub_811EBBC + ldr r0, _080F3CCC + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x9] + bl sub_81DB5E8 + ldr r1, _080F3CD0 + movs r0, 0x3 + strb r0, [r1] + b _080F3D54 + .align 2, 0 +_080F3CC4: .4byte 0x02021cc4 +_080F3CC8: .4byte 0x02021dc4 +_080F3CCC: .4byte 0x02021ec4 +_080F3CD0: .4byte 0x0203a030 +_080F3CD4: + ldr r0, _080F3CF4 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldr r0, _080F3CF8 + ldrh r1, [r4, 0x6] + bl sub_811EBBC + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _080F3D00 + ldr r1, _080F3CFC + movs r0, 0x4 + strb r0, [r1] + b _080F3D54 + .align 2, 0 +_080F3CF4: .4byte 0x02021cc4 +_080F3CF8: .4byte 0x02021dc4 +_080F3CFC: .4byte 0x0203a030 +_080F3D00: + ldr r1, _080F3D08 + movs r0, 0x5 + strb r0, [r1] + b _080F3D54 + .align 2, 0 +_080F3D08: .4byte 0x0203a030 +_080F3D0C: + ldr r0, _080F3D30 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldr r0, _080F3D34 + ldrh r1, [r4, 0x6] + bl sub_811EBBC + ldr r0, _080F3D38 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x9] + bl sub_81DB5E8 + ldr r1, _080F3D3C + movs r0, 0x6 + strb r0, [r1] + b _080F3D54 + .align 2, 0 +_080F3D30: .4byte 0x02021cc4 +_080F3D34: .4byte 0x02021dc4 +_080F3D38: .4byte 0x02021ec4 +_080F3D3C: .4byte 0x0203a030 +_080F3D40: + ldr r0, _080F3D68 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldr r0, _080F3D6C + ldrh r1, [r4, 0x6] + bl sub_811EBBC + bl sub_80F577C +_080F3D54: + ldr r0, _080F3D70 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F3D68: .4byte 0x02021cc4 +_080F3D6C: .4byte 0x02021dc4 +_080F3D70: .4byte 0x0858d3f0 + thumb_func_end sub_80F3C04 + + thumb_func_start sub_80F3D74 +sub_80F3D74: @ 80F3D74 + push {r4-r7,lr} + ldr r2, _080F3DA4 + ldr r0, _080F3DA8 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F3DAC + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F3DB0 + movs r0, 0 + strh r0, [r1] + ldr r7, _080F3DB4 + ldrb r6, [r7] + cmp r6, 0x1 + beq _080F3E02 + cmp r6, 0x1 + bgt _080F3DB8 + cmp r6, 0 + beq _080F3DBE + b _080F3E5C + .align 2, 0 +_080F3DA4: .4byte 0x03005d8c +_080F3DA8: .4byte 0x020375e0 +_080F3DAC: .4byte 0x000027cc +_080F3DB0: .4byte 0x020375f0 +_080F3DB4: .4byte 0x0203a030 +_080F3DB8: + cmp r6, 0x2 + beq _080F3E3C + b _080F3E5C +_080F3DBE: + ldr r4, _080F3DE8 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldrb r0, [r5, 0x4] + cmp r0, 0x57 + bne _080F3DFC + ldrh r1, [r5, 0x6] + ldr r0, _080F3DEC + cmp r1, r0 + bgt _080F3DF0 + subs r0, 0x2 + cmp r1, r0 + blt _080F3DF0 + movs r0, 0x2 + strb r0, [r7] + b _080F3E5C + .align 2, 0 +_080F3DE8: .4byte 0x02021cc4 +_080F3DEC: .4byte 0x00000117 +_080F3DF0: + ldr r1, _080F3DF8 + movs r0, 0x1 + strb r0, [r1] + b _080F3E5C + .align 2, 0 +_080F3DF8: .4byte 0x0203a030 +_080F3DFC: + movs r0, 0x1 + strb r0, [r7] + b _080F3E5C +_080F3E02: + ldr r4, _080F3E30 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _080F3E34 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x5] + bl sub_81DB5E8 + ldr r0, _080F3E38 + ldrb r1, [r5, 0x4] + movs r2, 0 + bl GetMapName + bl sub_80F577C + b _080F3E5C + .align 2, 0 +_080F3E30: .4byte 0x02021cc4 +_080F3E34: .4byte 0x02021dc4 +_080F3E38: .4byte 0x02021ec4 +_080F3E3C: + ldr r4, _080F3E70 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _080F3E74 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x5] + bl sub_81DB5E8 + bl sub_80F577C +_080F3E5C: + ldr r0, _080F3E78 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F3E70: .4byte 0x02021cc4 +_080F3E74: .4byte 0x02021dc4 +_080F3E78: .4byte 0x0858d40c + thumb_func_end sub_80F3D74 + + thumb_func_start sub_80F3E7C +sub_80F3E7C: @ 80F3E7C + push {r4,r5,lr} + ldr r2, _080F3EAC + ldr r0, _080F3EB0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F3EB4 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F3EB8 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F3EBC + ldrb r5, [r0] + cmp r5, 0x1 + beq _080F3F28 + cmp r5, 0x1 + bgt _080F3EC0 + cmp r5, 0 + beq _080F3ECC + b _080F4008 + .align 2, 0 +_080F3EAC: .4byte 0x03005d8c +_080F3EB0: .4byte 0x020375e0 +_080F3EB4: .4byte 0x000027cc +_080F3EB8: .4byte 0x020375f0 +_080F3EBC: .4byte 0x0203a030 +_080F3EC0: + cmp r5, 0x2 + beq _080F3F78 + cmp r5, 0x3 + bne _080F3ECA + b _080F3FCC +_080F3ECA: + b _080F4008 +_080F3ECC: + ldr r0, _080F3EE4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F3EE8 + cmp r0, 0x1 + beq _080F3EFC + b _080F3F04 + .align 2, 0 +_080F3EE4: .4byte 0x02021cc4 +_080F3EE8: + ldr r0, _080F3EF4 + ldr r1, _080F3EF8 + bl gf_strcpy + b _080F3F04 + .align 2, 0 +_080F3EF4: .4byte 0x02021dc4 +_080F3EF8: .4byte 0x085ecb0c +_080F3EFC: + ldr r0, _080F3F10 + ldr r1, _080F3F14 + bl gf_strcpy +_080F3F04: + ldrb r1, [r4, 0x2] + cmp r1, 0x1 + bne _080F3F1C + ldr r0, _080F3F18 + strb r1, [r0] + b _080F4008 + .align 2, 0 +_080F3F10: .4byte 0x02021dc4 +_080F3F14: .4byte 0x085ecb12 +_080F3F18: .4byte 0x0203a030 +_080F3F1C: + ldr r1, _080F3F24 + movs r0, 0x2 + strb r0, [r1] + b _080F4008 + .align 2, 0 +_080F3F24: .4byte 0x0203a030 +_080F3F28: + ldr r0, _080F3F40 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F3F44 + cmp r0, 0x1 + beq _080F3F58 + b _080F3F60 + .align 2, 0 +_080F3F40: .4byte 0x02021cc4 +_080F3F44: + ldr r0, _080F3F50 + ldr r1, _080F3F54 + bl gf_strcpy + b _080F3F60 + .align 2, 0 +_080F3F50: .4byte 0x02021dc4 +_080F3F54: .4byte 0x085ecb0c +_080F3F58: + ldr r0, _080F3F70 + ldr r1, _080F3F74 + bl gf_strcpy +_080F3F60: + ldrh r1, [r4, 0x4] + movs r0, 0x2 + bl sub_80EF340 + bl sub_80F577C + b _080F4008 + .align 2, 0 +_080F3F70: .4byte 0x02021dc4 +_080F3F74: .4byte 0x085ecb12 +_080F3F78: + ldr r0, _080F3F90 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F3F94 + cmp r0, 0x1 + beq _080F3FA8 + b _080F3FB0 + .align 2, 0 +_080F3F90: .4byte 0x02021cc4 +_080F3F94: + ldr r0, _080F3FA0 + ldr r1, _080F3FA4 + bl gf_strcpy + b _080F3FB0 + .align 2, 0 +_080F3FA0: .4byte 0x02021dc4 +_080F3FA4: .4byte 0x085ecb0c +_080F3FA8: + ldr r0, _080F3FC0 + ldr r1, _080F3FC4 + bl gf_strcpy +_080F3FB0: + ldrh r1, [r4, 0x4] + movs r0, 0x2 + bl sub_80EF340 + ldr r1, _080F3FC8 + movs r0, 0x3 + strb r0, [r1] + b _080F4008 + .align 2, 0 +_080F3FC0: .4byte 0x02021dc4 +_080F3FC4: .4byte 0x085ecb12 +_080F3FC8: .4byte 0x0203a030 +_080F3FCC: + ldr r0, _080F3FE4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r1, [r4, 0x3] + cmp r1, 0 + beq _080F3FE8 + cmp r1, 0x1 + beq _080F3FFC + b _080F4004 + .align 2, 0 +_080F3FE4: .4byte 0x02021cc4 +_080F3FE8: + ldr r0, _080F3FF4 + ldr r1, _080F3FF8 + bl gf_strcpy + b _080F4004 + .align 2, 0 +_080F3FF4: .4byte 0x02021dc4 +_080F3FF8: .4byte 0x085ecb12 +_080F3FFC: + ldr r0, _080F401C + ldr r1, _080F4020 + bl gf_strcpy +_080F4004: + bl sub_80F577C +_080F4008: + ldr r0, _080F4024 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F401C: .4byte 0x02021dc4 +_080F4020: .4byte 0x085ecb0c +_080F4024: .4byte 0x0858d418 + thumb_func_end sub_80F3E7C + + thumb_func_start sub_80F4028 +sub_80F4028: @ 80F4028 + push {r4-r7,lr} + ldr r2, _080F405C + ldr r0, _080F4060 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F4064 + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, _080F4068 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F406C + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0xC + bls _080F4050 + b _080F4344 +_080F4050: + lsls r0, r7, 2 + ldr r1, _080F4070 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F405C: .4byte 0x03005d8c +_080F4060: .4byte 0x020375e0 +_080F4064: .4byte 0x000027cc +_080F4068: .4byte 0x020375f0 +_080F406C: .4byte 0x0203a030 +_080F4070: .4byte _080F4074 + .align 2, 0 +_080F4074: + .4byte _080F40A8 + .4byte _080F40BA + .4byte _080F40FC + .4byte _080F4140 + .4byte _080F4168 + .4byte _080F418C + .4byte _080F41D0 + .4byte _080F4254 + .4byte _080F42C8 + .4byte _080F42F4 + .4byte _080F42F4 + .4byte _080F4334 + .4byte _080F4284 +_080F40A8: + ldrb r0, [r6, 0x5] + cmp r0, 0 + bne _080F40B4 + movs r0, 0x1 + strb r0, [r2] + b _080F4344 +_080F40B4: + movs r0, 0x5 + strb r0, [r2] + b _080F4344 +_080F40BA: + ldr r0, _080F40E8 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F40EC + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F40F0 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F40F4 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r1, _080F40F8 + movs r0, 0x2 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F40E8: .4byte 0x02021cc4 +_080F40EC: .4byte 0x02021dc4 +_080F40F0: .4byte 0x083185c8 +_080F40F4: .4byte 0x02021ec4 +_080F40F8: .4byte 0x0203a030 +_080F40FC: + ldr r0, _080F412C + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F4130 + ldrh r1, [r6, 0x2] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F4134 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4138 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldr r1, _080F413C + movs r0, 0x3 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F412C: .4byte 0x02021cc4 +_080F4130: .4byte 0x02021dc4 +_080F4134: .4byte 0x083185c8 +_080F4138: .4byte 0x02021ec4 +_080F413C: .4byte 0x0203a030 +_080F4140: + ldrh r1, [r6, 0x8] + movs r0, 0 + bl sub_80EF340 + ldr r4, _080F4160 + ldrh r0, [r6, 0x6] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _080F4164 + movs r0, 0x4 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F4160: .4byte 0x02021dc4 +_080F4164: .4byte 0x0203a030 +_080F4168: + ldr r0, _080F4184 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F4188 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + bl sub_80F577C + b _080F4344 + .align 2, 0 +_080F4184: .4byte 0x02021cc4 +_080F4188: .4byte 0x02021dc4 +_080F418C: + ldr r0, _080F41BC + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F41C0 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F41C4 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F41C8 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r1, _080F41CC + movs r0, 0x6 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F41BC: .4byte 0x02021cc4 +_080F41C0: .4byte 0x02021dc4 +_080F41C4: .4byte 0x083185c8 +_080F41C8: .4byte 0x02021ec4 +_080F41CC: .4byte 0x0203a030 +_080F41D0: + ldr r0, _080F4208 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F420C + ldrh r1, [r6, 0x2] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F4210 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4214 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldrb r0, [r6, 0x5] + cmp r0, 0x2 + beq _080F423C + cmp r0, 0x2 + bgt _080F4218 + cmp r0, 0x1 + beq _080F421E + b _080F4344 + .align 2, 0 +_080F4208: .4byte 0x02021cc4 +_080F420C: .4byte 0x02021dc4 +_080F4210: .4byte 0x083185c8 +_080F4214: .4byte 0x02021ec4 +_080F4218: + cmp r0, 0x3 + beq _080F4248 + b _080F4344 +_080F421E: + ldrh r0, [r6, 0xC] + cmp r0, 0 + bne _080F4230 + ldr r1, _080F422C + movs r0, 0xC + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F422C: .4byte 0x0203a030 +_080F4230: + ldr r1, _080F4238 + movs r0, 0x7 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F4238: .4byte 0x0203a030 +_080F423C: + ldr r1, _080F4244 + movs r0, 0x9 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F4244: .4byte 0x0203a030 +_080F4248: + ldr r1, _080F4250 + movs r0, 0xA + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F4250: .4byte 0x0203a030 +_080F4254: + ldr r0, _080F4274 + ldrh r2, [r6, 0xC] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F4278 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F427C + ldrh r2, [r6, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F4280 + adds r1, r2 + b _080F42A8 + .align 2, 0 +_080F4274: .4byte 0x02021cc4 +_080F4278: .4byte 0x0831977c +_080F427C: .4byte 0x02021dc4 +_080F4280: .4byte 0x083185c8 +_080F4284: + ldr r0, _080F42B4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F42B8 + ldrh r1, [r6, 0x2] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F42BC + adds r1, r4 + bl gf_strcpy + ldr r0, _080F42C0 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 +_080F42A8: + bl gf_strcpy + ldr r1, _080F42C4 + movs r0, 0x8 + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F42B4: .4byte 0x02021cc4 +_080F42B8: .4byte 0x02021dc4 +_080F42BC: .4byte 0x083185c8 +_080F42C0: .4byte 0x02021ec4 +_080F42C4: .4byte 0x0203a030 +_080F42C8: + ldr r0, _080F42E8 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F42EC + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r1, _080F42F0 + movs r0, 0xB + strb r0, [r1] + b _080F4344 + .align 2, 0 +_080F42E8: .4byte 0x02021cc4 +_080F42EC: .4byte 0x02021dc4 +_080F42F0: .4byte 0x0203a030 +_080F42F4: + ldr r0, _080F4320 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, _080F4324 + ldrh r1, [r6, 0x2] + movs r4, 0xB + muls r1, r4 + ldr r2, _080F4328 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F432C + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r0, _080F4330 + strb r4, [r0] + b _080F4344 + .align 2, 0 +_080F4320: .4byte 0x02021cc4 +_080F4324: .4byte 0x02021dc4 +_080F4328: .4byte 0x083185c8 +_080F432C: .4byte 0x02021ec4 +_080F4330: .4byte 0x0203a030 +_080F4334: + ldr r0, _080F4358 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + bl sub_80F577C +_080F4344: + ldr r0, _080F435C + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F4358: .4byte 0x02021cc4 +_080F435C: .4byte 0x0858d428 + thumb_func_end sub_80F4028 + + thumb_func_start sub_80F4360 +sub_80F4360: @ 80F4360 + push {r4-r6,lr} + ldr r2, _080F4394 + ldr r0, _080F4398 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F439C + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F43A0 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F43A4 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0xD + bls _080F4388 + b _080F4588 +_080F4388: + lsls r0, r6, 2 + ldr r1, _080F43A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F4394: .4byte 0x03005d8c +_080F4398: .4byte 0x020375e0 +_080F439C: .4byte 0x000027cc +_080F43A0: .4byte 0x020375f0 +_080F43A4: .4byte 0x0203a030 +_080F43A8: .4byte _080F43AC + .align 2, 0 +_080F43AC: + .4byte _080F43E4 + .4byte _080F4414 + .4byte _080F44E4 + .4byte _080F4448 + .4byte _080F44E4 + .4byte _080F449C + .4byte _080F44C0 + .4byte _080F44E4 + .4byte _080F44EA + .4byte _080F4538 + .4byte _080F4538 + .4byte _080F4538 + .4byte _080F4538 + .4byte _080F4584 +_080F43E4: + ldr r0, _080F4400 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0xC] + bl sub_81DB5E8 + ldrb r0, [r5, 0x3] + cmp r0, 0 + bne _080F4408 + ldr r1, _080F4404 + movs r0, 0x2 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4400: .4byte 0x02021cc4 +_080F4404: .4byte 0x0203a030 +_080F4408: + ldr r1, _080F4410 + movs r0, 0x1 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4410: .4byte 0x0203a030 +_080F4414: + ldr r0, _080F4430 + ldrb r1, [r5, 0x4] + lsls r1, 5 + ldr r2, _080F4434 + adds r1, r2 + bl gf_strcpy + ldrb r0, [r5, 0x3] + cmp r0, 0x1 + bne _080F443C + ldr r1, _080F4438 + movs r0, 0x4 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4430: .4byte 0x02021dc4 +_080F4434: .4byte 0x085a5c09 +_080F4438: .4byte 0x0203a030 +_080F443C: + ldr r1, _080F4444 + movs r0, 0x3 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4444: .4byte 0x0203a030 +_080F4448: + ldr r0, _080F4468 + ldrb r1, [r5, 0x5] + lsls r1, 5 + ldr r2, _080F446C + adds r1, r2 + bl gf_strcpy + ldrb r1, [r5, 0x3] + cmp r1, 0x3 + beq _080F4484 + cmp r1, 0x3 + bgt _080F4470 + cmp r1, 0x2 + beq _080F4476 + b _080F4588 + .align 2, 0 +_080F4468: .4byte 0x02021dc4 +_080F446C: .4byte 0x085a5c09 +_080F4470: + cmp r1, 0x4 + beq _080F4490 + b _080F4588 +_080F4476: + ldr r1, _080F4480 + movs r0, 0x7 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4480: .4byte 0x0203a030 +_080F4484: + ldr r1, _080F448C + movs r0, 0x6 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F448C: .4byte 0x0203a030 +_080F4490: + ldr r1, _080F4498 + movs r0, 0x5 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4498: .4byte 0x0203a030 +_080F449C: + ldr r0, _080F44B4 + ldrb r1, [r5, 0x6] + lsls r1, 5 + ldr r4, _080F44B8 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F44BC + ldrb r1, [r5, 0x7] + lsls r1, 5 + adds r1, r4 + b _080F44CA + .align 2, 0 +_080F44B4: .4byte 0x02021dc4 +_080F44B8: .4byte 0x085a5c09 +_080F44BC: .4byte 0x02021ec4 +_080F44C0: + ldr r0, _080F44D8 + ldrb r1, [r5, 0x6] + lsls r1, 5 + ldr r2, _080F44DC + adds r1, r2 +_080F44CA: + bl gf_strcpy + ldr r1, _080F44E0 + movs r0, 0x8 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F44D8: .4byte 0x02021dc4 +_080F44DC: .4byte 0x085a5c09 +_080F44E0: .4byte 0x0203a030 +_080F44E4: + movs r0, 0x8 + strb r0, [r2] + b _080F4588 +_080F44EA: + ldr r0, _080F4504 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0xC] + bl sub_81DB5E8 + ldrb r1, [r5, 0x2] + cmp r1, 0x18 + bhi _080F450C + ldr r1, _080F4508 + movs r0, 0xC + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4504: .4byte 0x02021cc4 +_080F4508: .4byte 0x0203a030 +_080F450C: + cmp r1, 0x31 + bhi _080F451C + ldr r1, _080F4518 + movs r0, 0xB + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4518: .4byte 0x0203a030 +_080F451C: + cmp r1, 0x45 + bhi _080F452C + ldr r1, _080F4528 + movs r0, 0xA + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4528: .4byte 0x0203a030 +_080F452C: + ldr r1, _080F4534 + movs r0, 0x9 + strb r0, [r1] + b _080F4588 + .align 2, 0 +_080F4534: .4byte 0x0203a030 +_080F4538: + ldr r0, _080F456C + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0xC] + bl sub_81DB5E8 + ldr r0, _080F4570 + ldrh r2, [r5, 0x8] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F4574 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F4578 + ldrh r1, [r5, 0xA] + movs r4, 0xD + muls r1, r4 + ldr r2, _080F457C + adds r1, r2 + bl gf_strcpy + ldr r0, _080F4580 + strb r4, [r0] + b _080F4588 + .align 2, 0 +_080F456C: .4byte 0x02021cc4 +_080F4570: .4byte 0x02021dc4 +_080F4574: .4byte 0x083185c8 +_080F4578: .4byte 0x02021ec4 +_080F457C: .4byte 0x0831977c +_080F4580: .4byte 0x0203a030 +_080F4584: + bl sub_80F577C +_080F4588: + ldr r0, _080F459C + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F459C: .4byte 0x0858d45c + thumb_func_end sub_80F4360 + + thumb_func_start sub_80F45A0 +sub_80F45A0: @ 80F45A0 + push {r4-r6,lr} + ldr r2, _080F45DC + ldr r0, _080F45E0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F45E4 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F45E8 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F45EC + ldrb r6, [r0] + ldr r0, _080F45F0 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x5] + bl sub_81DB5E8 + ldrb r0, [r5, 0x4] + cmp r0, 0 + bne _080F45FC + ldr r0, _080F45F4 + ldr r1, _080F45F8 + bl gf_strcpy + b _080F4634 + .align 2, 0 +_080F45DC: .4byte 0x03005d8c +_080F45E0: .4byte 0x020375e0 +_080F45E4: .4byte 0x000027cc +_080F45E8: .4byte 0x020375f0 +_080F45EC: .4byte 0x0203a030 +_080F45F0: .4byte 0x02021cc4 +_080F45F4: .4byte 0x02021dc4 +_080F45F8: .4byte 0x085ecb72 +_080F45FC: + cmp r0, 0x1 + bne _080F4614 + ldr r0, _080F460C + ldr r1, _080F4610 + bl gf_strcpy + b _080F4634 + .align 2, 0 +_080F460C: .4byte 0x02021dc4 +_080F4610: .4byte 0x085ecb7a +_080F4614: + cmp r0, 0x2 + bne _080F462C + ldr r0, _080F4624 + ldr r1, _080F4628 + bl gf_strcpy + b _080F4634 + .align 2, 0 +_080F4624: .4byte 0x02021dc4 +_080F4628: .4byte 0x085ecb80 +_080F462C: + ldr r0, _080F465C + ldr r1, _080F4660 + bl gf_strcpy +_080F4634: + ldr r4, _080F4664 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + bl sub_80F577C + ldr r1, _080F4668 + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F465C: .4byte 0x02021dc4 +_080F4660: .4byte 0x085ecb87 +_080F4664: .4byte 0x02021ec4 +_080F4668: .4byte 0x0858d494 + thumb_func_end sub_80F45A0 + + thumb_func_start sub_80F466C +sub_80F466C: @ 80F466C + push {r4-r7,lr} + ldr r2, _080F469C + ldr r0, _080F46A0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F46A4 + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, _080F46A8 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F46AC + ldrb r7, [r0] + cmp r7, 0x6 + bls _080F4692 + b _080F4858 +_080F4692: + lsls r0, r7, 2 + ldr r1, _080F46B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F469C: .4byte 0x03005d8c +_080F46A0: .4byte 0x020375e0 +_080F46A4: .4byte 0x000027cc +_080F46A8: .4byte 0x020375f0 +_080F46AC: .4byte 0x0203a030 +_080F46B0: .4byte _080F46B4 + .align 2, 0 +_080F46B4: + .4byte _080F46D0 + .4byte _080F4714 + .4byte _080F4760 + .4byte _080F47B4 + .4byte _080F47EC + .4byte _080F4814 + .4byte _080F4838 +_080F46D0: + ldr r0, _080F4700 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0x11] + bl sub_81DB5E8 + ldr r0, _080F4704 + ldrh r1, [r6, 0x6] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F4708 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F470C + ldrh r1, [r6, 0x4] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldr r1, _080F4710 + movs r0, 0x1 + strb r0, [r1] + b _080F4858 + .align 2, 0 +_080F4700: .4byte 0x02021cc4 +_080F4704: .4byte 0x02021dc4 +_080F4708: .4byte 0x083185c8 +_080F470C: .4byte 0x02021ec4 +_080F4710: .4byte 0x0203a030 +_080F4714: + ldr r0, _080F4748 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0x11] + bl sub_81DB5E8 + ldr r0, _080F474C + ldrh r2, [r6, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F4750 + adds r1, r2 + bl gf_strcpy + ldr r0, _080F4754 + ldrh r2, [r6, 0x2] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F4758 + adds r1, r2 + bl gf_strcpy + ldr r1, _080F475C + movs r0, 0x2 + strb r0, [r1] + b _080F4858 + .align 2, 0 +_080F4748: .4byte 0x02021cc4 +_080F474C: .4byte 0x02021dc4 +_080F4750: .4byte 0x083185c8 +_080F4754: .4byte 0x02021ec4 +_080F4758: .4byte 0x0831977c +_080F475C: .4byte 0x0203a030 +_080F4760: + ldr r0, _080F4780 + ldrh r2, [r6, 0x6] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F4784 + adds r1, r2 + bl gf_strcpy + ldrb r1, [r6, 0x10] + cmp r1, 0x2 + beq _080F479C + cmp r1, 0x2 + bgt _080F4788 + cmp r1, 0x1 + beq _080F478E + b _080F4824 + .align 2, 0 +_080F4780: .4byte 0x02021cc4 +_080F4784: .4byte 0x083185c8 +_080F4788: + cmp r1, 0x3 + beq _080F47A8 + b _080F4824 +_080F478E: + ldr r1, _080F4798 + movs r0, 0x5 + strb r0, [r1] + b _080F4858 + .align 2, 0 +_080F4798: .4byte 0x0203a030 +_080F479C: + ldr r1, _080F47A4 + movs r0, 0x4 + strb r0, [r1] + b _080F4858 + .align 2, 0 +_080F47A4: .4byte 0x0203a030 +_080F47A8: + ldr r0, _080F47B0 + strb r1, [r0] + b _080F4858 + .align 2, 0 +_080F47B0: .4byte 0x0203a030 +_080F47B4: + ldr r0, _080F47DC + ldrh r1, [r6, 0x8] + movs r5, 0xD + muls r1, r5 + ldr r4, _080F47E0 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F47E4 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F47E8 + ldrh r1, [r6, 0xC] + muls r1, r5 + adds r1, r4 + b _080F4820 + .align 2, 0 +_080F47DC: .4byte 0x02021cc4 +_080F47E0: .4byte 0x0831977c +_080F47E4: .4byte 0x02021dc4 +_080F47E8: .4byte 0x02021ec4 +_080F47EC: + ldr r0, _080F4808 + ldrh r1, [r6, 0x8] + movs r5, 0xD + muls r1, r5 + ldr r4, _080F480C + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4810 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + b _080F4820 + .align 2, 0 +_080F4808: .4byte 0x02021cc4 +_080F480C: .4byte 0x0831977c +_080F4810: .4byte 0x02021dc4 +_080F4814: + ldr r0, _080F482C + ldrh r2, [r6, 0x8] + movs r1, 0xD + muls r1, r2 + ldr r2, _080F4830 + adds r1, r2 +_080F4820: + bl gf_strcpy +_080F4824: + ldr r1, _080F4834 + movs r0, 0x6 + strb r0, [r1] + b _080F4858 + .align 2, 0 +_080F482C: .4byte 0x02021dc4 +_080F4830: .4byte 0x0831977c +_080F4834: .4byte 0x0203a030 +_080F4838: + ldr r0, _080F486C + ldrh r1, [r6, 0xE] + movs r5, 0xD + muls r1, r5 + ldr r4, _080F4870 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4874 + ldrh r1, [r6, 0x2] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + bl sub_80F577C +_080F4858: + ldr r0, _080F4878 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F486C: .4byte 0x02021cc4 +_080F4870: .4byte 0x0831977c +_080F4874: .4byte 0x02021dc4 +_080F4878: .4byte 0x0858d498 + thumb_func_end sub_80F466C + + thumb_func_start sub_80F487C +sub_80F487C: @ 80F487C + push {r4,r5,lr} + ldr r2, _080F48AC + ldr r0, _080F48B0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F48B4 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F48B8 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F48BC + ldrb r5, [r0] + cmp r5, 0x5 + bls _080F48A2 + b _080F499A +_080F48A2: + lsls r0, r5, 2 + ldr r1, _080F48C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F48AC: .4byte 0x03005d8c +_080F48B0: .4byte 0x020375e0 +_080F48B4: .4byte 0x000027cc +_080F48B8: .4byte 0x020375f0 +_080F48BC: .4byte 0x0203a030 +_080F48C0: .4byte _080F48C4 + .align 2, 0 +_080F48C4: + .4byte _080F48DC + .4byte _080F4944 + .4byte _080F4944 + .4byte _080F4944 + .4byte _080F4944 + .4byte _080F4978 +_080F48DC: + ldr r0, _080F4908 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + ldr r0, _080F490C + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 + ldr r0, _080F4910 + ldrh r1, [r4, 0x14] + bl sub_811EBBC + ldrb r1, [r4, 0x16] + cmp r1, 0x59 + bls _080F4918 + ldr r1, _080F4914 + movs r0, 0x1 + strb r0, [r1] + b _080F499A + .align 2, 0 +_080F4908: .4byte 0x02021cc4 +_080F490C: .4byte 0x02021dc4 +_080F4910: .4byte 0x02021ec4 +_080F4914: .4byte 0x0203a030 +_080F4918: + cmp r1, 0x45 + bls _080F4928 + ldr r1, _080F4924 + movs r0, 0x2 + strb r0, [r1] + b _080F499A + .align 2, 0 +_080F4924: .4byte 0x0203a030 +_080F4928: + cmp r1, 0x1D + bls _080F4938 + ldr r1, _080F4934 + movs r0, 0x3 + strb r0, [r1] + b _080F499A + .align 2, 0 +_080F4934: .4byte 0x0203a030 +_080F4938: + ldr r1, _080F4940 + movs r0, 0x4 + strb r0, [r1] + b _080F499A + .align 2, 0 +_080F4940: .4byte 0x0203a030 +_080F4944: + ldr r0, _080F496C + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + ldr r0, _080F4970 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 + ldrb r1, [r4, 0x16] + movs r0, 0x2 + bl sub_80EF340 + ldr r1, _080F4974 + movs r0, 0x5 + strb r0, [r1] + b _080F499A + .align 2, 0 +_080F496C: .4byte 0x02021cc4 +_080F4970: .4byte 0x02021dc4 +_080F4974: .4byte 0x0203a030 +_080F4978: + ldr r0, _080F49AC + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + ldr r0, _080F49B0 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 + ldr r0, _080F49B4 + ldrh r1, [r4, 0x14] + bl sub_811EBBC + bl sub_80F577C +_080F499A: + ldr r0, _080F49B8 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F49AC: .4byte 0x02021cc4 +_080F49B0: .4byte 0x02021dc4 +_080F49B4: .4byte 0x02021ec4 +_080F49B8: .4byte 0x0858d320 + thumb_func_end sub_80F487C + + thumb_func_start sub_80F49BC +sub_80F49BC: @ 80F49BC + push {r4,r5,lr} + ldr r2, _080F49F0 + ldr r0, _080F49F4 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F49F8 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F49FC + movs r0, 0 + strh r0, [r1] + ldr r0, _080F4A00 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xB + bls _080F49E4 + b _080F4B3A +_080F49E4: + lsls r0, r5, 2 + ldr r1, _080F4A04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F49F0: .4byte 0x03005d8c +_080F49F4: .4byte 0x020375e0 +_080F49F8: .4byte 0x000027cc +_080F49FC: .4byte 0x020375f0 +_080F4A00: .4byte 0x0203a030 +_080F4A04: .4byte _080F4A08 + .align 2, 0 +_080F4A08: + .4byte _080F4A38 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B1A +_080F4A38: + ldr r0, _080F4A6C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + adds r0, r4, 0 + adds r0, 0x23 + ldrb r0, [r0] + lsls r0, 8 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r1, [r1] + adds r0, r1 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x9 + bls _080F4A60 + b _080F4B3A +_080F4A60: + lsls r0, 2 + ldr r1, _080F4A70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F4A6C: .4byte 0x02021cc4 +_080F4A70: .4byte _080F4A74 + .align 2, 0 +_080F4A74: + .4byte _080F4A9C + .4byte _080F4AA8 + .4byte _080F4AB4 + .4byte _080F4AC0 + .4byte _080F4ACC + .4byte _080F4AD8 + .4byte _080F4AE4 + .4byte _080F4AF0 + .4byte _080F4AFC + .4byte _080F4B08 +_080F4A9C: + ldr r1, _080F4AA4 + movs r0, 0x1 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AA4: .4byte 0x0203a030 +_080F4AA8: + ldr r1, _080F4AB0 + movs r0, 0x2 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AB0: .4byte 0x0203a030 +_080F4AB4: + ldr r1, _080F4ABC + movs r0, 0x3 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4ABC: .4byte 0x0203a030 +_080F4AC0: + ldr r1, _080F4AC8 + movs r0, 0x4 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AC8: .4byte 0x0203a030 +_080F4ACC: + ldr r1, _080F4AD4 + movs r0, 0x5 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AD4: .4byte 0x0203a030 +_080F4AD8: + ldr r1, _080F4AE0 + movs r0, 0x6 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AE0: .4byte 0x0203a030 +_080F4AE4: + ldr r1, _080F4AEC + movs r0, 0x7 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AEC: .4byte 0x0203a030 +_080F4AF0: + ldr r1, _080F4AF8 + movs r0, 0x8 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4AF8: .4byte 0x0203a030 +_080F4AFC: + ldr r1, _080F4B04 + movs r0, 0x9 + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4B04: .4byte 0x0203a030 +_080F4B08: + ldr r1, _080F4B10 + movs r0, 0xA + strb r0, [r1] + b _080F4B3A + .align 2, 0 +_080F4B10: .4byte 0x0203a030 +_080F4B14: + movs r0, 0xB + strb r0, [r2] + b _080F4B3A +_080F4B1A: + ldr r0, _080F4B4C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldr r0, _080F4B50 + ldrh r1, [r4, 0x4] + bl sub_811EBBC + ldr r0, _080F4B54 + ldrh r1, [r4, 0x6] + bl sub_811EBBC + bl sub_80F577C +_080F4B3A: + ldr r0, _080F4B58 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F4B4C: .4byte 0x02021cc4 +_080F4B50: .4byte 0x02021dc4 +_080F4B54: .4byte 0x02021ec4 +_080F4B58: .4byte 0x0858d4b4 + thumb_func_end sub_80F49BC + + thumb_func_start sub_80F4B5C +sub_80F4B5C: @ 80F4B5C + push {r4,r5,lr} + ldr r2, _080F4B8C + ldr r0, _080F4B90 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F4B94 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F4B98 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F4B9C + ldrb r5, [r0] + cmp r5, 0xF + bls _080F4B82 + b _080F4D84 +_080F4B82: + lsls r0, r5, 2 + ldr r1, _080F4BA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F4B8C: .4byte 0x03005d8c +_080F4B90: .4byte 0x020375e0 +_080F4B94: .4byte 0x000027cc +_080F4B98: .4byte 0x020375f0 +_080F4B9C: .4byte 0x0203a030 +_080F4BA0: .4byte _080F4BA4 + .align 2, 0 +_080F4BA4: + .4byte _080F4BE4 + .4byte _080F4C30 + .4byte _080F4C30 + .4byte _080F4C30 + .4byte _080F4C64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D80 +_080F4BE4: + ldr r0, _080F4C08 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xF] + bl sub_81DB5E8 + ldr r0, _080F4C0C + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + cmp r1, 0x9 + bhi _080F4C14 + ldr r1, _080F4C10 + movs r0, 0x1 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4C08: .4byte 0x02021cc4 +_080F4C0C: .4byte 0x02021dc4 +_080F4C10: .4byte 0x0203a030 +_080F4C14: + cmp r1, 0x13 + bhi _080F4C24 + ldr r1, _080F4C20 + movs r0, 0x2 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4C20: .4byte 0x0203a030 +_080F4C24: + ldr r1, _080F4C2C + movs r0, 0x3 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4C2C: .4byte 0x0203a030 +_080F4C30: + ldr r0, _080F4C58 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xF] + bl sub_81DB5E8 + ldr r0, _080F4C5C + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + movs r0, 0x2 + bl sub_80EF340 + ldr r1, _080F4C60 + movs r0, 0x4 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4C58: .4byte 0x02021cc4 +_080F4C5C: .4byte 0x02021dc4 +_080F4C60: .4byte 0x0203a030 +_080F4C64: + ldr r0, _080F4C80 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0x18 + bls _080F4C76 + b _080F4D84 +_080F4C76: + lsls r0, 2 + ldr r1, _080F4C84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F4C80: .4byte 0x02021dc4 +_080F4C84: .4byte _080F4C88 + .align 2, 0 +_080F4C88: + .4byte _080F4CEC + .4byte _080F4CF8 + .4byte _080F4CF8 + .4byte _080F4CF8 + .4byte _080F4CF8 + .4byte _080F4D04 + .4byte _080F4D04 + .4byte _080F4D04 + .4byte _080F4D04 + .4byte _080F4D10 + .4byte _080F4D10 + .4byte _080F4D10 + .4byte _080F4D10 + .4byte _080F4D1C + .4byte _080F4D1C + .4byte _080F4D1C + .4byte _080F4D1C + .4byte _080F4D28 + .4byte _080F4D28 + .4byte _080F4D28 + .4byte _080F4D28 + .4byte _080F4D34 + .4byte _080F4D40 + .4byte _080F4D4C + .4byte _080F4D58 +_080F4CEC: + ldr r1, _080F4CF4 + movs r0, 0x5 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4CF4: .4byte 0x0203a030 +_080F4CF8: + ldr r1, _080F4D00 + movs r0, 0x6 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D00: .4byte 0x0203a030 +_080F4D04: + ldr r1, _080F4D0C + movs r0, 0x7 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D0C: .4byte 0x0203a030 +_080F4D10: + ldr r1, _080F4D18 + movs r0, 0x8 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D18: .4byte 0x0203a030 +_080F4D1C: + ldr r1, _080F4D24 + movs r0, 0x9 + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D24: .4byte 0x0203a030 +_080F4D28: + ldr r1, _080F4D30 + movs r0, 0xA + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D30: .4byte 0x0203a030 +_080F4D34: + ldr r1, _080F4D3C + movs r0, 0xB + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D3C: .4byte 0x0203a030 +_080F4D40: + ldr r1, _080F4D48 + movs r0, 0xC + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D48: .4byte 0x0203a030 +_080F4D4C: + ldr r1, _080F4D54 + movs r0, 0xD + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D54: .4byte 0x0203a030 +_080F4D58: + ldr r1, _080F4D60 + movs r0, 0xE + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D60: .4byte 0x0203a030 +_080F4D64: + ldr r0, _080F4D78 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldr r1, _080F4D7C + movs r0, 0xF + strb r0, [r1] + b _080F4D84 + .align 2, 0 +_080F4D78: .4byte 0x02021dc4 +_080F4D7C: .4byte 0x0203a030 +_080F4D80: + bl sub_80F577C +_080F4D84: + ldr r0, _080F4D98 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F4D98: .4byte 0x0858d4e4 + thumb_func_end sub_80F4B5C + + thumb_func_start sub_80F4D9C +sub_80F4D9C: @ 80F4D9C + push {r4-r7,lr} + ldr r2, _080F4DD0 + ldr r0, _080F4DD4 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F4DD8 + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, _080F4DDC + movs r0, 0 + strh r0, [r1] + ldr r0, _080F4DE0 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0x12 + bls _080F4DC4 + b _080F5014 +_080F4DC4: + lsls r0, r7, 2 + ldr r1, _080F4DE4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F4DD0: .4byte 0x03005d8c +_080F4DD4: .4byte 0x020375e0 +_080F4DD8: .4byte 0x000027cc +_080F4DDC: .4byte 0x020375f0 +_080F4DE0: .4byte 0x0203a030 +_080F4DE4: .4byte _080F4DE8 + .align 2, 0 +_080F4DE8: + .4byte _080F4E34 + .4byte _080F4F18 + .4byte _080F4ECE + .4byte _080F4EF4 + .4byte _080F4EF4 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F3C + .4byte _080F4F74 + .4byte _080F4F9C + .4byte _080F4FE0 + .4byte _080F5004 +_080F4E34: + ldrb r0, [r6, 0xD] + subs r0, 0x1 + cmp r0, 0xC + bls _080F4E3E + b _080F5014 +_080F4E3E: + lsls r0, 2 + ldr r1, _080F4E48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F4E48: .4byte _080F4E4C + .align 2, 0 +_080F4E4C: + .4byte _080F4E80 + .4byte _080F4E86 + .4byte _080F4E8C + .4byte _080F4E92 + .4byte _080F4E98 + .4byte _080F4E9E + .4byte _080F4EA4 + .4byte _080F4EAA + .4byte _080F4EB0 + .4byte _080F4EB6 + .4byte _080F4EBC + .4byte _080F4EC2 + .4byte _080F4EC8 +_080F4E80: + movs r0, 0x1 + strb r0, [r2] + b _080F5014 +_080F4E86: + movs r0, 0x2 + strb r0, [r2] + b _080F5014 +_080F4E8C: + movs r0, 0x3 + strb r0, [r2] + b _080F5014 +_080F4E92: + movs r0, 0x4 + strb r0, [r2] + b _080F5014 +_080F4E98: + movs r0, 0x5 + strb r0, [r2] + b _080F5014 +_080F4E9E: + movs r0, 0x6 + strb r0, [r2] + b _080F5014 +_080F4EA4: + movs r0, 0x7 + strb r0, [r2] + b _080F5014 +_080F4EAA: + movs r0, 0x8 + strb r0, [r2] + b _080F5014 +_080F4EB0: + movs r0, 0x9 + strb r0, [r2] + b _080F5014 +_080F4EB6: + movs r0, 0xA + strb r0, [r2] + b _080F5014 +_080F4EBC: + movs r0, 0xB + strb r0, [r2] + b _080F5014 +_080F4EC2: + movs r0, 0xC + strb r0, [r2] + b _080F5014 +_080F4EC8: + movs r0, 0xD + strb r0, [r2] + b _080F5014 +_080F4ECE: + ldr r0, _080F4EEC + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + ldrh r1, [r6, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, _080F4EF0 + movs r0, 0x10 + strb r0, [r1] + b _080F5014 + .align 2, 0 +_080F4EEC: .4byte 0x02021cc4 +_080F4EF0: .4byte 0x0203a030 +_080F4EF4: + ldr r0, _080F4F10 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + ldrh r1, [r6, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, _080F4F14 + movs r0, 0xF + strb r0, [r1] + b _080F5014 + .align 2, 0 +_080F4F10: .4byte 0x02021cc4 +_080F4F14: .4byte 0x0203a030 +_080F4F18: + ldr r0, _080F4F34 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + ldrh r1, [r6, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, _080F4F38 + movs r0, 0xE + strb r0, [r1] + b _080F5014 + .align 2, 0 +_080F4F34: .4byte 0x02021cc4 +_080F4F38: .4byte 0x0203a030 +_080F4F3C: + ldr r0, _080F4F64 + ldrh r1, [r6, 0x4] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F4F68 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4F6C + ldrh r1, [r6, 0x6] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4F70 + ldrh r1, [r6, 0x8] + muls r1, r5 + adds r1, r4 + b _080F4FEC + .align 2, 0 +_080F4F64: .4byte 0x02021cc4 +_080F4F68: .4byte 0x083185c8 +_080F4F6C: .4byte 0x02021dc4 +_080F4F70: .4byte 0x02021ec4 +_080F4F74: + ldr r0, _080F4F90 + ldrh r1, [r6, 0x4] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F4F94 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4F98 + ldrh r1, [r6, 0x6] + muls r1, r5 + adds r1, r4 + b _080F4FEC + .align 2, 0 +_080F4F90: .4byte 0x02021cc4 +_080F4F94: .4byte 0x083185c8 +_080F4F98: .4byte 0x02021dc4 +_080F4F9C: + ldr r0, _080F4FCC + ldrh r1, [r6, 0x4] + movs r5, 0xB + muls r1, r5 + ldr r4, _080F4FD0 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4FD4 + ldrh r1, [r6, 0x6] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldr r0, _080F4FD8 + ldrh r1, [r6, 0x8] + muls r1, r5 + adds r1, r4 + bl gf_strcpy + ldr r1, _080F4FDC + movs r0, 0x11 + strb r0, [r1] + b _080F5014 + .align 2, 0 +_080F4FCC: .4byte 0x02021cc4 +_080F4FD0: .4byte 0x083185c8 +_080F4FD4: .4byte 0x02021dc4 +_080F4FD8: .4byte 0x02021ec4 +_080F4FDC: .4byte 0x0203a030 +_080F4FE0: + ldr r0, _080F4FF8 + ldrh r2, [r6, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, _080F4FFC + adds r1, r2 +_080F4FEC: + bl gf_strcpy + ldr r1, _080F5000 + movs r0, 0x12 + strb r0, [r1] + b _080F5014 + .align 2, 0 +_080F4FF8: .4byte 0x02021cc4 +_080F4FFC: .4byte 0x083185c8 +_080F5000: .4byte 0x0203a030 +_080F5004: + ldr r0, _080F5028 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + bl sub_80F577C +_080F5014: + ldr r0, _080F502C + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F5028: .4byte 0x02021cc4 +_080F502C: .4byte 0x0858d524 + thumb_func_end sub_80F4D9C + + thumb_func_start sub_80F5030 +sub_80F5030: @ 80F5030 + push {r4,r5,lr} + ldr r2, _080F5060 + ldr r0, _080F5064 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F5068 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F506C + movs r0, 0 + strh r0, [r1] + ldr r0, _080F5070 + ldrb r5, [r0] + cmp r5, 0x8 + bls _080F5056 + b _080F5164 +_080F5056: + lsls r0, r5, 2 + ldr r1, _080F5074 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F5060: .4byte 0x03005d8c +_080F5064: .4byte 0x020375e0 +_080F5068: .4byte 0x000027cc +_080F506C: .4byte 0x020375f0 +_080F5070: .4byte 0x0203a030 +_080F5074: .4byte _080F5078 + .align 2, 0 +_080F5078: + .4byte _080F509C + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5154 +_080F509C: + ldr r0, _080F50B8 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x5] + bl sub_81DB5E8 + ldrb r0, [r4, 0x4] + cmp r0, 0x6 + bhi _080F5164 + lsls r0, 2 + ldr r1, _080F50BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F50B8: .4byte 0x02021cc4 +_080F50BC: .4byte _080F50C0 + .align 2, 0 +_080F50C0: + .4byte _080F50DC + .4byte _080F50E8 + .4byte _080F50F4 + .4byte _080F5100 + .4byte _080F510C + .4byte _080F5118 + .4byte _080F5124 +_080F50DC: + ldr r1, _080F50E4 + movs r0, 0x1 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F50E4: .4byte 0x0203a030 +_080F50E8: + ldr r1, _080F50F0 + movs r0, 0x2 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F50F0: .4byte 0x0203a030 +_080F50F4: + ldr r1, _080F50FC + movs r0, 0x3 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F50FC: .4byte 0x0203a030 +_080F5100: + ldr r1, _080F5108 + movs r0, 0x4 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F5108: .4byte 0x0203a030 +_080F510C: + ldr r1, _080F5114 + movs r0, 0x5 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F5114: .4byte 0x0203a030 +_080F5118: + ldr r1, _080F5120 + movs r0, 0x6 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F5120: .4byte 0x0203a030 +_080F5124: + ldr r1, _080F512C + movs r0, 0x7 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F512C: .4byte 0x0203a030 +_080F5130: + ldr r0, _080F514C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x5] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, _080F5150 + movs r0, 0x8 + strb r0, [r1] + b _080F5164 + .align 2, 0 +_080F514C: .4byte 0x02021cc4 +_080F5150: .4byte 0x0203a030 +_080F5154: + ldr r0, _080F5178 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x5] + bl sub_81DB5E8 + bl sub_80F577C +_080F5164: + ldr r0, _080F517C + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F5178: .4byte 0x02021cc4 +_080F517C: .4byte 0x0858d570 + thumb_func_end sub_80F5030 + + thumb_func_start sub_80F5180 +sub_80F5180: @ 80F5180 + push {r4,lr} + movs r1, 0 + movs r2, 0 + ldr r3, [r0, 0xC] + movs r4, 0x1 +_080F518A: + adds r0, r3, 0 + lsrs r0, r1 + ands r0, r4 + cmp r0, 0 + beq _080F519A + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080F519A: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _080F518A + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80F5180 + + thumb_func_start sub_80F51AC +sub_80F51AC: @ 80F51AC + push {r4-r6,lr} + lsls r1, 24 + lsrs r4, r1, 24 + movs r2, 0 + movs r3, 0 + ldr r1, [r0, 0xC] + movs r5, 0x1 + ldr r6, _080F51D0 +_080F51BC: + adds r0, r1, 0 + lsrs r0, r2 + ands r0, r5 + cmp r0, 0 + beq _080F51DA + cmp r3, r4 + bne _080F51D4 + adds r0, r2, r6 + ldrb r0, [r0] + b _080F51E6 + .align 2, 0 +_080F51D0: .4byte 0x0858d690 +_080F51D4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080F51DA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080F51BC + movs r0, 0 +_080F51E6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F51AC + + thumb_func_start sub_80F51EC +sub_80F51EC: @ 80F51EC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, _080F5228 + ldr r0, _080F522C + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F5230 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, _080F5234 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F5238 + ldrb r2, [r0] + mov r9, r2 + adds r2, r0, 0 + mov r0, r9 + cmp r0, 0x2B + bls _080F521E + b _080F552A +_080F521E: + lsls r0, 2 + ldr r1, _080F523C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F5228: .4byte 0x03005d8c +_080F522C: .4byte 0x020375e0 +_080F5230: .4byte 0x000027cc +_080F5234: .4byte 0x020375f0 +_080F5238: .4byte 0x0203a030 +_080F523C: .4byte _080F5240 + .align 2, 0 +_080F5240: + .4byte _080F52F0 + .4byte _080F5348 + .4byte _080F53C4 + .4byte _080F5444 + .4byte _080F5498 + .4byte _080F5498 + .4byte _080F5498 + .4byte _080F54C4 + .4byte _080F54E8 + .4byte _080F54EC + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F54F0 + .4byte _080F5510 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 +_080F52F0: + ldr r0, _080F531C + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, _080F5320 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80F5180 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080F5328 + ldr r1, _080F5324 + movs r0, 0x8 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F531C: .4byte 0x02021cc4 +_080F5320: .4byte 0x02021dc4 +_080F5324: .4byte 0x0203a030 +_080F5328: + movs r0, 0x1 + strb r0, [r5, 0x12] + bl GenerateRandomNumber + ldr r4, _080F5344 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + strb r0, [r4] + ldrb r1, [r4] + b _080F542A + .align 2, 0 +_080F5344: .4byte 0x0203a031 +_080F5348: + ldr r0, _080F536C + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80F5180 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + beq _080F53DE + cmp r6, 0x2 + beq _080F5370 + movs r4, 0 + b _080F538A + .align 2, 0 +_080F536C: .4byte 0x02021dc4 +_080F5370: + strb r6, [r5, 0x12] + ldr r0, _080F5380 + ldrb r0, [r0] + cmp r0, 0 + bne _080F5384 + adds r0, r5, 0 + movs r1, 0x1 + b _080F542C + .align 2, 0 +_080F5380: .4byte 0x0203a031 +_080F5384: + adds r0, r5, 0 + movs r1, 0 + b _080F542C +_080F538A: + bl GenerateRandomNumber + ldr r7, _080F53BC + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + strb r0, [r7, 0x1] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + cmp r0, r1 + bne _080F53B2 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _080F53C0 + cmp r4, r0 + bls _080F538A +_080F53B2: + movs r0, 0x2 + strb r0, [r5, 0x12] + ldrb r1, [r7, 0x1] + b _080F542A + .align 2, 0 +_080F53BC: .4byte 0x0203a031 +_080F53C0: .4byte 0x0000fffe +_080F53C4: + ldr r0, _080F53E8 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80F5180 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bne _080F53F0 +_080F53DE: + ldr r1, _080F53EC + movs r0, 0x9 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F53E8: .4byte 0x02021dc4 +_080F53EC: .4byte 0x0203a030 +_080F53F0: + movs r4, 0 + ldr r7, _080F5438 + ldr r2, _080F543C + mov r8, r2 +_080F53F8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + strb r0, [r7, 0x2] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + cmp r0, r1 + beq _080F5418 + ldrb r2, [r7, 0x1] + cmp r0, r2 + bne _080F5422 +_080F5418: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r8 + bls _080F53F8 +_080F5422: + movs r0, 0x3 + strb r0, [r5, 0x12] + ldr r0, _080F5438 + ldrb r1, [r0, 0x2] +_080F542A: + adds r0, r5, 0 +_080F542C: + bl sub_80F51AC + ldr r1, _080F5440 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F5438: .4byte 0x0203a031 +_080F543C: .4byte 0x0000fffe +_080F5440: .4byte 0x0203a030 +_080F5444: + ldr r0, _080F5470 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, _080F5474 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + ldrh r1, [r5, 0x2] + movs r0, 0x2 + bl sub_80EF340 + ldrh r0, [r5, 0x2] + cmp r0, 0x1E + bhi _080F547C + ldr r1, _080F5478 + movs r0, 0x4 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F5470: .4byte 0x02021cc4 +_080F5474: .4byte 0x02021dc4 +_080F5478: .4byte 0x0203a030 +_080F547C: + cmp r0, 0x64 + bhi _080F548C + ldr r1, _080F5488 + movs r0, 0x5 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F5488: .4byte 0x0203a030 +_080F548C: + ldr r1, _080F5494 + movs r0, 0x6 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F5494: .4byte 0x0203a030 +_080F5498: + ldr r0, _080F54B8 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, _080F54BC + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + ldr r1, _080F54C0 + movs r0, 0x7 + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F54B8: .4byte 0x02021cc4 +_080F54BC: .4byte 0x02021dc4 +_080F54C0: .4byte 0x0203a030 +_080F54C4: + ldr r0, _080F54E0 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, _080F54E4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + bl sub_80F577C + b _080F552A + .align 2, 0 +_080F54E0: .4byte 0x02021cc4 +_080F54E4: .4byte 0x02021dc4 +_080F54E8: + movs r0, 0x3 + b _080F5528 +_080F54EC: + movs r0, 0x3 + b _080F5528 +_080F54F0: + ldr r4, _080F5508 + ldrh r0, [r5, 0x10] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _080F550C + ldrb r0, [r5, 0x12] + strb r0, [r1] + b _080F552A + .align 2, 0 +_080F5508: .4byte 0x02021dc4 +_080F550C: .4byte 0x0203a030 +_080F5510: + adds r0, r5, 0 + adds r0, 0x22 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F5522 + movs r0, 0x16 + b _080F5528 +_080F5522: + movs r0, 0x15 + b _080F5528 +_080F5526: + ldrb r0, [r5, 0x12] +_080F5528: + strb r0, [r2] +_080F552A: + ldr r0, _080F5544 + mov r2, r9 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F5544: .4byte 0x0858d594 + thumb_func_end sub_80F51EC + + thumb_func_start sub_80F5548 +sub_80F5548: @ 80F5548 + push {r4,r5,lr} + ldr r2, _080F557C + ldr r0, _080F5580 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F5584 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F5588 + movs r0, 0 + strh r0, [r1] + ldr r0, _080F558C + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xA + bls _080F5570 + b _080F56BC +_080F5570: + lsls r0, r5, 2 + ldr r1, _080F5590 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F557C: .4byte 0x03005d8c +_080F5580: .4byte 0x020375e0 +_080F5584: .4byte 0x000027cc +_080F5588: .4byte 0x020375f0 +_080F558C: .4byte 0x0203a030 +_080F5590: .4byte _080F5594 + .align 2, 0 +_080F5594: + .4byte _080F55C0 + .4byte _080F55DC + .4byte _080F5614 + .4byte _080F5628 + .4byte _080F569A + .4byte _080F562E + .4byte _080F5650 + .4byte _080F5680 + .4byte _080F5694 + .4byte _080F569A + .4byte _080F56B8 +_080F55C0: + ldrb r1, [r4, 0x2] + cmp r1, 0 + bne _080F55CC + movs r0, 0x6 + strb r0, [r2] + b _080F56BC +_080F55CC: + cmp r1, 0x3 + bhi _080F55D6 + movs r0, 0x5 + strb r0, [r2] + b _080F56BC +_080F55D6: + movs r0, 0x1 + strb r0, [r2] + b _080F56BC +_080F55DC: + ldr r0, _080F5600 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _080F5608 + ldr r1, _080F5604 + movs r0, 0x3 + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F5600: .4byte 0x02021cc4 +_080F5604: .4byte 0x0203a030 +_080F5608: + ldr r1, _080F5610 + movs r0, 0x2 + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F5610: .4byte 0x0203a030 +_080F5614: + ldrb r1, [r4, 0x3] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, _080F5624 + movs r0, 0x4 + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F5624: .4byte 0x0203a030 +_080F5628: + movs r0, 0x4 + strb r0, [r2] + b _080F56BC +_080F562E: + ldr r0, _080F564C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F5662 + b _080F5674 + .align 2, 0 +_080F564C: .4byte 0x02021cc4 +_080F5650: + ldr r0, _080F566C + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _080F5674 +_080F5662: + ldr r1, _080F5670 + movs r0, 0x8 + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F566C: .4byte 0x02021cc4 +_080F5670: .4byte 0x0203a030 +_080F5674: + ldr r1, _080F567C + movs r0, 0x7 + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F567C: .4byte 0x0203a030 +_080F5680: + ldrb r1, [r4, 0x3] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, _080F5690 + movs r0, 0x9 + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F5690: .4byte 0x0203a030 +_080F5694: + movs r0, 0x9 + strb r0, [r2] + b _080F56BC +_080F569A: + ldr r0, _080F56B0 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldr r1, _080F56B4 + movs r0, 0xA + strb r0, [r1] + b _080F56BC + .align 2, 0 +_080F56B0: .4byte 0x02021cc4 +_080F56B4: .4byte 0x0203a030 +_080F56B8: + bl sub_80F577C +_080F56BC: + ldr r0, _080F56D0 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F56D0: .4byte 0x0858d640 + thumb_func_end sub_80F5548 + + thumb_func_start sub_80F56D4 +sub_80F56D4: @ 80F56D4 + push {r4-r6,lr} + ldr r2, _080F5704 + ldr r0, _080F5708 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F570C + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, _080F5710 + movs r0, 0 + strh r0, [r1] + ldr r6, _080F5714 + ldrb r5, [r6] + cmp r5, 0x2 + bgt _080F5718 + cmp r5, 0x1 + bge _080F5744 + cmp r5, 0 + beq _080F571E + b _080F575E + .align 2, 0 +_080F5704: .4byte 0x03005d8c +_080F5708: .4byte 0x020375e0 +_080F570C: .4byte 0x000027cc +_080F5710: .4byte 0x020375f0 +_080F5714: .4byte 0x0203a030 +_080F5718: + cmp r5, 0x3 + beq _080F574E + b _080F575E +_080F571E: + ldr r0, _080F5730 + ldrb r1, [r4, 0xA] + bl sub_818E868 + ldrb r1, [r4, 0x16] + cmp r1, 0x1 + bne _080F5734 + strb r1, [r6] + b _080F575E + .align 2, 0 +_080F5730: .4byte 0x02021cc4 +_080F5734: + cmp r1, 0 + bne _080F573E + movs r0, 0x2 + strb r0, [r6] + b _080F575E +_080F573E: + movs r0, 0x3 + strb r0, [r6] + b _080F575E +_080F5744: + ldr r0, _080F5770 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 +_080F574E: + ldr r0, _080F5774 + adds r1, r4, 0 + adds r1, 0xB + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + bl sub_80F577C +_080F575E: + ldr r0, _080F5778 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F5770: .4byte 0x02021ec4 +_080F5774: .4byte 0x02021dc4 +_080F5778: .4byte 0x0858d384 + thumb_func_end sub_80F56D4 + + thumb_func_start sub_80F577C +sub_80F577C: @ 80F577C + ldr r1, _080F57A4 + movs r0, 0x1 + strh r0, [r1] + ldr r1, _080F57A8 + movs r0, 0 + strb r0, [r1] + ldr r0, _080F57AC + ldr r2, [r0] + ldr r0, _080F57B0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r0, _080F57B4 + adds r2, r0 + movs r0, 0 + strb r0, [r2] + bx lr + .align 2, 0 +_080F57A4: .4byte 0x020375f0 +_080F57A8: .4byte 0x0203a030 +_080F57AC: .4byte 0x03005d8c +_080F57B0: .4byte 0x020375e0 +_080F57B4: .4byte 0x000027cd + thumb_func_end sub_80F577C + + thumb_func_start sub_80F57B8 +sub_80F57B8: @ 80F57B8 + ldr r1, _080F57C0 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_080F57C0: .4byte 0x0203a030 + thumb_func_end sub_80F57B8 + + thumb_func_start sub_80F57C4 +sub_80F57C4: @ 80F57C4 + push {r4,lr} + movs r0, 0 + movs r1, 0x40 + bl lcd_io_set + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _080F58D8 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + movs r4, 0 +_080F57E0: + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, _080F58DC + ldr r1, [r1] + lsls r2, r4, 2 + adds r1, 0xC + adds r1, r2 + ldr r1, [r1] + bl bg_set_tilemap + adds r4, 0x1 + cmp r4, 0x3 + ble _080F57E0 + ldr r0, _080F58E0 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + ldr r1, _080F58E4 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _080F58E8 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r1, 0xFF + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r0, _080F58EC + movs r1, 0 + strh r1, [r0] + ldr r0, _080F58F0 + strh r1, [r0] + ldr r0, _080F58F4 + strh r1, [r0] + ldr r0, _080F58F8 + strh r1, [r0] + ldr r0, _080F58FC + strh r1, [r0] + ldr r0, _080F5900 + strh r1, [r0] + ldr r0, _080F5904 + strh r1, [r0] + ldr r0, _080F5908 + strh r1, [r0] + ldr r0, _080F590C + strh r1, [r0] + ldr r0, _080F5910 + strh r1, [r0] + ldr r0, _080F5914 + strh r1, [r0] + ldr r0, _080F5918 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F58D8: .4byte 0x0858d888 +_080F58DC: .4byte 0x0203a034 +_080F58E0: .4byte 0x0858d898 +_080F58E4: .4byte 0x00003f3f +_080F58E8: .4byte 0x00003f2e +_080F58EC: .4byte 0x02022e14 +_080F58F0: .4byte 0x02022e16 +_080F58F4: .4byte 0x02022e18 +_080F58F8: .4byte 0x02022e1a +_080F58FC: .4byte 0x02022e1c +_080F5900: .4byte 0x02022e1e +_080F5904: .4byte 0x02022e20 +_080F5908: .4byte 0x02022e22 +_080F590C: .4byte 0x02022e24 +_080F5910: .4byte 0x02022e26 +_080F5914: .4byte 0x02022e28 +_080F5918: .4byte 0x02022e2a + thumb_func_end sub_80F57C4 + + thumb_func_start sub_80F591C +sub_80F591C: @ 80F591C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, _080F59D4 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + ldr r1, _080F59D8 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _080F59DC + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _080F59E0 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + bl sub_80F71C8 + ldr r0, _080F59E4 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl decompress_palette + ldr r0, _080F59E8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r7, 0 + movs r0, 0x1 + mov r8, r0 +_080F5976: + lsls r5, r7, 24 + lsrs r5, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80F7310 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80F7364 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + movs r6, 0 + lsls r1, r7, 1 + adds r2, r7, 0x1 + str r2, [sp, 0xC] + lsls r4, 24 + asrs r4, 24 + mov r10, r4 + adds r1, r7 + adds r0, r1, 0x6 + lsls r0, 24 + mov r9, r0 + adds r1, 0x5 + lsls r7, r1, 24 +_080F59B0: + ldr r1, _080F59EC + cmp r6, r10 + bge _080F59B8 + adds r1, 0x2 +_080F59B8: + ldr r4, [sp, 0x8] + lsls r0, r4, 24 + asrs r0, 24 + adds r2, r0, 0 + cmp r0, 0 + bge _080F59C6 + negs r2, r0 +_080F59C6: + cmp r6, r2 + bge _080F59F4 + ldr r5, _080F59F0 + cmp r0, 0 + bge _080F59F6 + adds r5, 0x2 + b _080F59F6 + .align 2, 0 +_080F59D4: .4byte 0x08c19588 +_080F59D8: .4byte 0x08c1a12c +_080F59DC: .4byte 0x08c1a000 +_080F59E0: .4byte 0x08c19eec +_080F59E4: .4byte 0x08c1a2b4 +_080F59E8: .4byte 0x0858d6b0 +_080F59EC: .4byte 0x000060b2 +_080F59F0: .4byte 0x000060a4 +_080F59F4: + ldr r5, _080F5A70 +_080F59F6: + adds r4, r6, 0 + adds r4, 0x13 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + adds r2, r4, 0 + lsrs r3, r7, 24 + bl bg_fill_tilemap_rect + mov r2, r8 + str r2, [sp] + str r2, [sp, 0x4] + movs r0, 0x1 + adds r1, r5, 0 + adds r2, r4, 0 + mov r4, r9 + lsrs r3, r4, 24 + bl bg_fill_tilemap_rect + adds r6, 0x1 + cmp r6, 0x9 + ble _080F59B0 + ldr r7, [sp, 0xC] + cmp r7, 0x3 + ble _080F5976 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F5A70: .4byte 0x000060a2 + thumb_func_end sub_80F591C + + thumb_func_start sub_80F5A74 +sub_80F5A74: @ 80F5A74 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r1, r5, 6 + ldr r0, _080F5ACC + adds r7, r1, r0 + ldr r6, _080F5AD0 + ldr r0, _080F5AD4 + ldrb r0, [r0] + cmp r5, r0 + bne _080F5A96 + ldr r1, _080F5AD8 + adds r0, r6, 0 + bl gf_strcpy + adds r6, r0, 0 +_080F5A96: + adds r1, r7, 0x2 + adds r0, r6, 0 + bl gf_strcpy + ldr r4, _080F5AD0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_80F7ED0 + ldr r1, _080F5ADC + adds r0, r6, 0 + bl gf_strcpy + adds r1, r7, 0 + adds r1, 0xD + adds r0, r6, 0 + bl gf_strcat + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x32 + bl sub_80F7ED0 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F5ACC: .4byte 0x02039e00 +_080F5AD0: .4byte 0x02022e2c +_080F5AD4: .4byte 0x02039f25 +_080F5AD8: .4byte 0x085ed21e +_080F5ADC: .4byte 0x085e8d3e + thumb_func_end sub_80F5A74 + + thumb_func_start sub_80F5AE0 +sub_80F5AE0: @ 80F5AE0 + push {r4,lr} + movs r4, 0 +_080F5AE4: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80F5A74 + adds r4, 0x1 + cmp r4, 0x3 + ble _080F5AE4 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80F5AE0 + + thumb_func_start sub_80F5B00 +sub_80F5B00: @ 80F5B00 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _080F5BC0 + ldrb r0, [r5, 0x8] + movs r6, 0x80 + orrs r0, r6 + strb r0, [r5, 0x8] + movs r0, 0 + bl SetVBlankCallback + bl sub_80F7DF4 + bl sub_80F57C4 + bl dp12_8087EA4 + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + bl gpu_pal_allocator_reset + bl sub_80F591C + bl sub_80F6A9C + movs r0, 0 + movs r1, 0x1 + bl sub_80F6A64 + bl sub_80F5AE0 + ldr r4, _080F5BC4 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x18 + bl memset + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0 + movs r2, 0x50 + bl memset + bl sub_80F6DC0 + bl sub_80F6AE8 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldrb r1, [r5, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r5, 0x8] + ldr r0, _080F5BC8 + movs r1, 0x5 + bl AddTask + ldr r1, [r4] + ldr r1, [r1] + strb r0, [r1, 0x2] + ldr r0, _080F5BCC + bl set_callback2 + ldr r1, _080F5BD0 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, _080F5BD4 + ldr r2, _080F5BD8 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _080F5BDC + movs r1, 0x14 + bl AddTask + bl sub_80F7880 + ldr r0, _080F5BE0 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F5BE4 + ldrb r0, [r5, 0x8] + orrs r0, r6 + strb r0, [r5, 0x8] + b _080F5BEC + .align 2, 0 +_080F5BC0: .4byte 0x02037fd4 +_080F5BC4: .4byte 0x0203a034 +_080F5BC8: .4byte sub_80F5CE4 + 1 +_080F5BCC: .4byte sub_80F5C00 + 1 +_080F5BD0: .4byte 0x02022e28 +_080F5BD4: .4byte 0x02022e2a +_080F5BD8: .4byte 0x000080a0 +_080F5BDC: .4byte sub_80F68B4 + 1 +_080F5BE0: .4byte 0x02039f2a +_080F5BE4: + movs r0, 0xDF + lsls r0, 1 + bl song_play_for_text +_080F5BEC: + ldr r0, _080F5BFC + bl SetVBlankCallback + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F5BFC: .4byte sub_80F5C24 + 1 + thumb_func_end sub_80F5B00 + + thumb_func_start sub_80F5C00 +sub_80F5C00: @ 80F5C00 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_active_tasks + bl fade_and_return_progress_probably + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_80F5C00 + + thumb_func_start sub_80F5C24 +sub_80F5C24: @ 80F5C24 + push {lr} + ldr r0, _080F5CB4 + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _080F5CB8 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _080F5CBC + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _080F5CC0 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, _080F5CC4 + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + ldr r0, _080F5CC8 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + ldr r0, _080F5CCC + ldrh r1, [r0] + movs r0, 0x1C + bl lcd_io_set + ldr r0, _080F5CD0 + ldrh r1, [r0] + movs r0, 0x1E + bl lcd_io_set + ldr r0, _080F5CD4 + ldrh r1, [r0] + movs r0, 0x40 + bl lcd_io_set + ldr r0, _080F5CD8 + ldrh r1, [r0] + movs r0, 0x44 + bl lcd_io_set + ldr r0, _080F5CDC + ldrh r1, [r0] + movs r0, 0x42 + bl lcd_io_set + ldr r0, _080F5CE0 + ldrh r1, [r0] + movs r0, 0x46 + bl lcd_io_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_080F5CB4: .4byte 0x02022e14 +_080F5CB8: .4byte 0x02022e16 +_080F5CBC: .4byte 0x02022e18 +_080F5CC0: .4byte 0x02022e1a +_080F5CC4: .4byte 0x02022e1c +_080F5CC8: .4byte 0x02022e1e +_080F5CCC: .4byte 0x02022e20 +_080F5CD0: .4byte 0x02022e22 +_080F5CD4: .4byte 0x02022e24 +_080F5CD8: .4byte 0x02022e26 +_080F5CDC: .4byte 0x02022e28 +_080F5CE0: .4byte 0x02022e2a + thumb_func_end sub_80F5C24 + + thumb_func_start sub_80F5CE4 +sub_80F5CE4: @ 80F5CE4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, _080F5D18 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F5CF8 + b _080F5E2E +_080F5CF8: + ldr r2, _080F5D1C + 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, 0x1 + beq _080F5DE0 + cmp r0, 0x1 + bgt _080F5D20 + cmp r0, 0 + beq _080F5D2A + b _080F5E2E + .align 2, 0 +_080F5D18: .4byte 0x02039f2a +_080F5D1C: .4byte 0x03005e00 +_080F5D20: + cmp r0, 0x2 + beq _080F5DF4 + cmp r0, 0x3 + beq _080F5E0A + b _080F5E2E +_080F5D2A: + bl sub_80DBED4 + ldr r1, _080F5DBC + ldr r0, _080F5DC0 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F5D58 + movs r0, 0x23 + bl sav12_xor_increment + ldr r1, _080F5DC4 + movs r0, 0x8 + strh r0, [r1] + bl sub_80EF5B8 + ldr r0, _080F5DC8 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080F5D58 + bl sub_80EC6BC +_080F5D58: + movs r0, 0x2 + bl sub_813BADC + ldr r0, _080F5DCC + ldrb r0, [r0] + bl sub_80DEDA8 + movs r0, 0xFE + bl sub_80DEDA8 + ldr r1, _080F5DD0 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0xFE + movs r1, 0 + bl sub_80DEFA8 + ldr r1, _080F5DD4 + strb r0, [r1] + ldr r5, _080F5DD8 + adds r0, r5, 0 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl var_set + bl sub_8076D5C + movs r0, 0x1 + bl save_game_when_memory_present + bl sav2_gender2_inplace_and_xFE + adds r0, r5, 0 + adds r1, r4, 0 + bl var_set + ldr r0, _080F5DDC + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080F5E2E + .align 2, 0 +_080F5DBC: .4byte 0x02039f20 +_080F5DC0: .4byte 0x02039f25 +_080F5DC4: .4byte 0x020375e2 +_080F5DC8: .4byte 0x020375f0 +_080F5DCC: .4byte 0x02039f2e +_080F5DD0: .4byte 0x02039f5c +_080F5DD4: .4byte 0x02039f5d +_080F5DD8: .4byte 0x00004086 +_080F5DDC: .4byte 0x03005e00 +_080F5DE0: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F5E2E + movs r0, 0x64 + b _080F5E2C +_080F5DF4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F5EBA + bl sub_800ADF8 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F5EBA +_080F5E0A: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F5EBA + movs r0, 0xDF + lsls r0, 1 + bl song_play_for_text + ldr r2, _080F5E64 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldrh r0, [r4, 0x8] + adds r0, 0x1 +_080F5E2C: + strh r0, [r4, 0x8] +_080F5E2E: + ldr r0, _080F5E64 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080F5EBA + ldr r1, _080F5E68 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + strh r2, [r4, 0x8] + ldr r0, _080F5E6C + ldrb r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080F5E78 + ldr r0, _080F5E70 + bl sub_80F707C + ldr r0, _080F5E74 + b _080F5EB8 + .align 2, 0 +_080F5E64: .4byte 0x02037fd4 +_080F5E68: .4byte 0x03005e00 +_080F5E6C: .4byte 0x02039f2a +_080F5E70: .4byte 0x085ed207 +_080F5E74: .4byte sub_80F5ED8 + 1 +_080F5E78: + movs r0, 0x24 + bl sav12_xor_increment + ldr r1, _080F5EC0 + ldr r0, _080F5EC4 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F5E92 + movs r0, 0x25 + bl sav12_xor_increment +_080F5E92: + ldr r0, _080F5EC8 + ldrb r0, [r0] + bl sub_80DEDA8 + movs r0, 0xFE + bl sub_80DEDA8 + ldr r0, _080F5ECC + strb r5, [r0] + movs r0, 0xFE + movs r1, 0 + bl sub_80DEFA8 + ldr r1, _080F5ED0 + strb r0, [r1] + movs r0, 0x2 + bl sub_813BADC + ldr r0, _080F5ED4 +_080F5EB8: + str r0, [r4] +_080F5EBA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F5EC0: .4byte 0x02039f20 +_080F5EC4: .4byte 0x02039f25 +_080F5EC8: .4byte 0x02039f2e +_080F5ECC: .4byte 0x02039f5c +_080F5ED0: .4byte 0x02039f5d +_080F5ED4: .4byte sub_80F5F74 + 1 + thumb_func_end sub_80F5CE4 + + thumb_func_start sub_80F5ED8 +sub_80F5ED8: @ 80F5ED8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080F5F04 + ldrb r0, [r0] + cmp r0, 0 + beq _080F5EFC + ldr r0, _080F5F08 + movs r1, 0 + bl AddTask + ldr r1, _080F5F0C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080F5F10 + str r1, [r0] +_080F5EFC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F5F04: .4byte 0x03003124 +_080F5F08: .4byte sub_80F5F14 + 1 +_080F5F0C: .4byte 0x03005e00 +_080F5F10: .4byte nullsub_4 + 1 + thumb_func_end sub_80F5ED8 + + thumb_func_start sub_80F5F14 +sub_80F5F14: @ 80F5F14 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080F5F28 + ldr r2, _080F5F2C + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_080F5F28: .4byte sub_80FC998 + 1 +_080F5F2C: .4byte sub_80F5F30 + 1 + thumb_func_end sub_80F5F14 + + thumb_func_start sub_80F5F30 +sub_80F5F30: @ 80F5F30 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F5F60 + adds r0, r4, 0 + bl remove_task + ldr r2, _080F5F68 + ldr r0, _080F5F6C + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _080F5F70 + str r1, [r0] + bl sub_80F7144 +_080F5F60: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F5F68: .4byte 0x03005e00 +_080F5F6C: .4byte 0x0203a034 +_080F5F70: .4byte sub_80F5F74 + 1 + thumb_func_end sub_80F5F30 + + thumb_func_start sub_80F5F74 +sub_80F5F74: @ 80F5F74 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F5FB4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080F5FC4 + ldr r0, _080F5FB8 + movs r1, 0x14 + bl AddTask + ldr r0, _080F5FBC + ldr r1, _080F5FC0 + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1] + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 + movs r2, 0x78 + b _080F6016 + .align 2, 0 +_080F5FB4: .4byte 0x03005e00 +_080F5FB8: .4byte sub_80F68F0 + 1 +_080F5FBC: .4byte 0x085ed1b8 +_080F5FC0: .4byte 0x0203a034 +_080F5FC4: + cmp r0, 0x1 + bne _080F5FDC + ldr r0, _080F5FD8 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080F6048 + b _080F5FF0 + .align 2, 0 +_080F5FD8: .4byte 0x0203a034 +_080F5FDC: + cmp r0, 0x2 + bne _080F5FF8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _080F6048 + movs r0, 0 +_080F5FF0: + strh r0, [r4, 0xA] + adds r0, r1, 0x1 + strh r0, [r4, 0x8] + b _080F6048 +_080F5FF8: + cmp r0, 0x3 + bne _080F6030 + ldr r0, _080F6024 + ldr r1, _080F6028 + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1] + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080F602C + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 +_080F6016: + bl sub_80F6E9C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F6048 + .align 2, 0 +_080F6024: .4byte 0x085ed1d0 +_080F6028: .4byte 0x0203a034 +_080F602C: .4byte 0x0000ffff +_080F6030: + cmp r0, 0x4 + bne _080F6048 + ldr r0, _080F6050 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x2 + bne _080F6048 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _080F6054 + str r0, [r4] +_080F6048: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F6050: .4byte 0x0203a034 +_080F6054: .4byte sub_80F6058 + 1 + thumb_func_end sub_80F5F74 + + thumb_func_start sub_80F6058 +sub_80F6058: @ 80F6058 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F607C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080F60C0 + cmp r0, 0x1 + bgt _080F6080 + cmp r0, 0 + beq _080F6086 + b _080F60E6 + .align 2, 0 +_080F607C: .4byte 0x03005e00 +_080F6080: + cmp r0, 0x2 + beq _080F60D4 + b _080F60E6 +_080F6086: + ldr r5, _080F60B4 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _080F60E6 + ldrh r1, [r4, 0xC] + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80F7A80 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F60B8 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080F60E6 + .align 2, 0 +_080F60B4: .4byte 0x0203a034 +_080F60B8: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F60E6 +_080F60C0: + ldr r0, _080F60D0 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F60E6 + strh r0, [r4, 0x8] + b _080F60E6 + .align 2, 0 +_080F60D0: .4byte 0x0203a034 +_080F60D4: + movs r0, 0x88 + lsls r0, 3 + bl sub_80F6EF4 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xC] + ldr r0, _080F60EC + str r0, [r4] +_080F60E6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F60EC: .4byte sub_80F60F0 + 1 + thumb_func_end sub_80F6058 + + thumb_func_start sub_80F60F0 +sub_80F60F0: @ 80F60F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r4, r2, 0 + ldr r0, _080F613C + ldr r5, [r0] + ldr r0, [r5] + ldrb r3, [r0, 0x4] + cmp r3, 0 + bne _080F614C + ldr r1, _080F6140 + lsls r0, r2, 2 + adds r0, r2 + 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, 0x15 + bne _080F615E + strh r3, [r1, 0xA] + ldr r0, _080F6144 + ldr r1, [r5] + ldrb r1, [r1] + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080F6148 + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 + bl sub_80F6E9C + b _080F615E + .align 2, 0 +_080F613C: .4byte 0x0203a034 +_080F6140: .4byte 0x03005e00 +_080F6144: .4byte 0x085ed1e9 +_080F6148: .4byte 0x0000ffff +_080F614C: + cmp r3, 0x2 + bne _080F615E + ldr r0, _080F6164 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080F6168 + str r0, [r1] +_080F615E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F6164: .4byte 0x03005e00 +_080F6168: .4byte sub_80F616C + 1 + thumb_func_end sub_80F60F0 + + thumb_func_start sub_80F616C +sub_80F616C: @ 80F616C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F6190 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080F61D4 + cmp r0, 0x1 + bgt _080F6194 + cmp r0, 0 + beq _080F619A + b _080F61F8 + .align 2, 0 +_080F6190: .4byte 0x03005e00 +_080F6194: + cmp r0, 0x2 + beq _080F61E8 + b _080F61F8 +_080F619A: + ldr r5, _080F61C8 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _080F61F8 + ldrh r1, [r4, 0xC] + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_80F7A80 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F61CC + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080F61F8 + .align 2, 0 +_080F61C8: .4byte 0x0203a034 +_080F61CC: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F61F8 +_080F61D4: + ldr r0, _080F61E4 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F61F8 + strh r0, [r4, 0x8] + b _080F61F8 + .align 2, 0 +_080F61E4: .4byte 0x0203a034 +_080F61E8: + movs r0, 0x88 + lsls r0, 3 + bl sub_80F6EF4 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _080F6200 + str r0, [r4] +_080F61F8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F6200: .4byte sub_80F6204 + 1 + thumb_func_end sub_80F616C + + thumb_func_start sub_80F6204 +sub_80F6204: @ 80F6204 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x64 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080F6230 + 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 _080F6226 + b _080F63F4 +_080F6226: + lsls r0, 2 + ldr r1, _080F6234 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F6230: .4byte 0x03005e00 +_080F6234: .4byte _080F6238 + .align 2, 0 +_080F6238: + .4byte _080F6250 + .4byte _080F6274 + .4byte _080F6292 + .4byte _080F62CC + .4byte _080F6334 + .4byte _080F63E4 +_080F6250: + ldr r0, _080F6270 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080F625E + b _080F63F4 +_080F625E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080F63F4 + .align 2, 0 +_080F6270: .4byte 0x0203a034 +_080F6274: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + beq _080F628C + b _080F63F4 +_080F628C: + movs r0, 0 + strh r0, [r1, 0xA] + b _080F63BC +_080F6292: + movs r4, 0 + lsls r6, r5, 2 + ldr r7, _080F62C0 +_080F6298: + ldr r0, _080F62C4 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r7 + ldr r0, _080F62C8 + adds r0, r4, r0 + ldrb r0, [r0] + strh r0, [r1, 0x8] + strh r4, [r1, 0xA] + adds r4, 0x1 + cmp r4, 0x3 + ble _080F6298 + b _080F63B4 + .align 2, 0 +_080F62C0: .4byte 0x03005e00 +_080F62C4: .4byte sub_80F73DC + 1 +_080F62C8: .4byte 0x02039f20 +_080F62CC: + ldr r0, _080F6328 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _080F62DA + b _080F63F4 +_080F62DA: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + beq _080F62F2 + b _080F63F4 +_080F62F2: + movs r0, 0 + strh r0, [r4, 0xA] + ldr r0, _080F632C + movs r1, 0xA + bl AddTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r4, 0 + ldr r1, _080F6330 + ldrb r0, [r1] + cmp r0, 0 + beq _080F631C +_080F630E: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080F631C + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F630E +_080F631C: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0xE + bl sub_80F77E0 + b _080F63F4 + .align 2, 0 +_080F6328: .4byte 0x0203a034 +_080F632C: .4byte sub_80F74BC + 1 +_080F6330: .4byte 0x02039f20 +_080F6334: + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r2, r0, r2 + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0x15 + bne _080F63F4 + movs r0, 0 + strh r0, [r2, 0xA] + movs r4, 0 + ldr r1, _080F63C4 + ldrb r0, [r1] + ldr r7, _080F63C8 + ldr r2, _080F63CC + mov r8, r2 + cmp r0, 0 + beq _080F636E +_080F6360: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080F636E + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F6360 +_080F636E: + lsls r4, 6 + mov r0, r8 + adds r1, r4, r0 + adds r0, r7, 0 + bl gf_strcpy + adds r0, r7, 0 + bl sub_81DB5AC + ldr r0, _080F63D0 + mov r1, r8 + subs r1, 0xB + adds r4, r1 + adds r1, r4, 0 + bl gf_strcpy + ldr r1, _080F63D4 + mov r0, sp + bl ExpandTextCodes + ldr r0, _080F63D8 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0] + mov r0, sp + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080F63DC + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 + bl sub_80F6E9C +_080F63B4: + ldr r0, _080F63E0 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 +_080F63BC: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080F63F4 + .align 2, 0 +_080F63C4: .4byte 0x02039f20 +_080F63C8: .4byte 0x02021cc4 +_080F63CC: .4byte 0x02039e0d +_080F63D0: .4byte 0x02021dc4 +_080F63D4: .4byte 0x085ed1fa +_080F63D8: .4byte 0x0203a034 +_080F63DC: .4byte 0x0000ffff +_080F63E0: .4byte 0x03005e00 +_080F63E4: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, _080F6400 + str r1, [r0] +_080F63F4: + add sp, 0x64 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F6400: .4byte sub_80F6404 + 1 + thumb_func_end sub_80F6204 + + thumb_func_start sub_80F6404 +sub_80F6404: @ 80F6404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080F6434 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x5 + bls _080F6428 + b _080F669C +_080F6428: + lsls r0, 2 + ldr r1, _080F6438 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F6434: .4byte 0x03005e00 +_080F6438: .4byte _080F643C + .align 2, 0 +_080F643C: + .4byte _080F6454 + .4byte _080F658C + .4byte _080F65DC + .4byte _080F65F0 + .4byte _080F6638 + .4byte _080F667C +_080F6454: + ldr r1, _080F64C0 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, _080F64C4 + ldr r3, _080F64C8 + adds r0, r3, 0 + strh r0, [r1] + movs r2, 0 + ldr r1, _080F64CC + ldrb r0, [r1] + lsls r4, r7, 2 + mov r10, r4 + ldr r3, _080F64D0 + ldr r4, _080F64D4 + mov r9, r4 + ldr r4, _080F64D8 + mov r12, r4 + ldr r4, _080F64DC + mov r8, r4 + cmp r0, 0 + beq _080F648C +_080F647E: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080F648C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F647E +_080F648C: + lsls r1, r2, 6 + adds r0, r1, r3 + ldrh r6, [r0] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r1, r0 + ldr r4, [r0] + adds r0, r3, 0 + adds r0, 0x3C + adds r1, r0 + ldr r5, [r1] + mov r0, r9 + ldrb r0, [r0] + cmp r2, r0 + bne _080F64E0 + lsls r0, r6, 3 + add r0, r12 + mov r2, r8 + ldr r1, [r2] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r4, 0 + bl help_system_enable_unless_flashback__sp199 + b _080F64F2 + .align 2, 0 +_080F64C0: .4byte 0x02022e24 +_080F64C4: .4byte 0x02022e26 +_080F64C8: .4byte 0x00005050 +_080F64CC: .4byte 0x02039f20 +_080F64D0: .4byte 0x02039e00 +_080F64D4: .4byte 0x02039f25 +_080F64D8: .4byte 0x0830a18c +_080F64DC: .4byte 0x020244d4 +_080F64E0: + lsls r0, r6, 3 + add r0, r12 + mov r3, r8 + ldr r1, [r3] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8034B50 +_080F64F2: + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_806E7CC + adds r4, r0, 0 + bl gpu_pal_obj_decompress_and_apply + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, _080F656C + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x2] + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x50 + movs r3, 0xA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _080F6570 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r5 + strh r6, [r3, 0x30] + ldrb r4, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + strb r1, [r3, 0x5] + adds r5, 0x1C + adds r2, r5 + ldr r1, _080F6574 + str r1, [r2] + ldr r1, _080F6578 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0x8] + ldr r0, _080F657C + bl gpu_tile_obj_decompress_and_load + ldr r0, _080F6580 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _080F6584 + movs r1, 0xA + bl AddTask + ldr r0, _080F6588 + mov r4, r10 + adds r1, r4, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080F669C + .align 2, 0 +_080F656C: .4byte 0x0202499c +_080F6570: .4byte 0x02020630 +_080F6574: .4byte sub_80F75A8 + 1 +_080F6578: .4byte 0x0203a034 +_080F657C: .4byte 0x0858d878 +_080F6580: .4byte 0x0858d880 +_080F6584: .4byte sub_80F7670 + 1 +_080F6588: .4byte 0x03005e00 +_080F658C: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080F65A4 + b _080F669C +_080F65A4: + movs r0, 0 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _080F65BA + movs r0, 0x20 + strh r0, [r4, 0xC] +_080F65BA: + ldrb r2, [r4, 0xC] + ldr r3, _080F65D8 + movs r0, 0x50 + subs r0, r2 + lsls r0, 8 + adds r1, r2, 0 + adds r1, 0x50 + orrs r0, r1 + strh r0, [r3] + cmp r2, 0x20 + bne _080F669C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F669C + .align 2, 0 +_080F65D8: .4byte 0x02022e26 +_080F65DC: + ldr r0, _080F65EC + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _080F669C + b _080F6664 + .align 2, 0 +_080F65EC: .4byte 0x0203a034 +_080F65F0: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r4 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x79 + bne _080F669C + movs r0, 0 + strh r0, [r3, 0xA] + ldr r2, _080F662C + ldr r0, _080F6630 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _080F6634 + str r1, [r0] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _080F669C + .align 2, 0 +_080F662C: .4byte 0x02020630 +_080F6630: .4byte 0x0203a034 +_080F6634: .4byte sub_80F7620 + 1 +_080F6638: + ldr r0, _080F6674 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x2 + bne _080F669C + ldr r3, _080F6678 + ldrh r0, [r3] + lsrs r2, r0, 8 + adds r0, r2, 0x2 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x50 + bls _080F6656 + movs r2, 0x50 +_080F6656: + lsls r1, r2, 8 + movs r0, 0xA0 + subs r0, r2 + orrs r1, r0 + strh r1, [r3] + cmp r2, 0x50 + bne _080F669C +_080F6664: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080F669C + .align 2, 0 +_080F6674: .4byte 0x0203a034 +_080F6678: .4byte 0x02022e26 +_080F667C: + ldr r0, _080F66AC + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + cmp r0, 0x2 + bne _080F669C + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x9] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + strh r1, [r0, 0x8] + ldr r1, _080F66B0 + str r1, [r0] +_080F669C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F66AC: .4byte 0x0203a034 +_080F66B0: .4byte sub_80F66B4 + 1 + thumb_func_end sub_80F6404 + + thumb_func_start sub_80F66B4 +sub_80F66B4: @ 80F66B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080F6708 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080F6702 + ldr r0, _080F670C + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + lsls r6, r7, 2 + cmp r0, 0 + bne _080F66F2 + ldr r5, _080F6710 + movs r4, 0x3 +_080F66DA: + ldrh r0, [r5] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + adds r5, 0x40 + subs r4, 0x1 + cmp r4, 0 + bge _080F66DA +_080F66F2: + ldr r1, _080F6714 + adds r0, r6, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + ldr r1, _080F6718 + str r1, [r0] +_080F6702: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F6708: .4byte 0x030022c0 +_080F670C: .4byte 0x02039f2a +_080F6710: .4byte 0x02039e00 +_080F6714: .4byte 0x03005e00 +_080F6718: .4byte sub_80F671C + 1 + thumb_func_end sub_80F66B4 + + thumb_func_start sub_80F671C +sub_80F671C: @ 80F671C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080F6750 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F6760 + ldr r0, _080F6754 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080F676E + ldr r0, _080F6758 + bl sub_80F707C + bl sub_800AC34 + ldr r0, _080F675C + str r0, [r4] + b _080F676E + .align 2, 0 +_080F6750: .4byte 0x02039f2a +_080F6754: .4byte 0x03005e00 +_080F6758: .4byte 0x085ed207 +_080F675C: .4byte sub_80F677C + 1 +_080F6760: + ldr r0, _080F6774 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _080F6778 + str r0, [r1] +_080F676E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F6774: .4byte 0x03005e00 +_080F6778: .4byte task_repel + 1 + thumb_func_end sub_80F671C + + thumb_func_start sub_80F677C +sub_80F677C: @ 80F677C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080F67B4 + ldrb r0, [r0] + cmp r0, 0 + bne _080F67AC + ldr r0, _080F67B8 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F679A + bl sub_800E084 +_080F679A: + bl sub_80F7144 + ldr r0, _080F67BC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080F67C0 + str r0, [r1] +_080F67AC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F67B4: .4byte 0x03003124 +_080F67B8: .4byte 0x02039f2a +_080F67BC: .4byte 0x03005e00 +_080F67C0: .4byte task_repel + 1 + thumb_func_end sub_80F677C + + thumb_func_start task_repel +task_repel: @ 80F67C4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080F680C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F67E6 + ldr r1, _080F6810 + ldr r0, _080F6814 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bl sub_80ED090 +_080F67E6: + movs r0, 0 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldr r1, _080F6818 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080F681C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F680C: .4byte 0x02039f2a +_080F6810: .4byte 0x02039f20 +_080F6814: .4byte 0x02039f25 +_080F6818: .4byte 0x03005e00 +_080F681C: .4byte sub_80F6820 + 1 + thumb_func_end task_repel + + thumb_func_start sub_80F6820 +sub_80F6820: @ 80F6820 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + ldr r0, _080F6858 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080F68A8 + ldr r1, _080F685C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080F6868 + ldr r0, _080F6860 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bl remove_task + ldr r0, _080F6864 + b _080F686E + .align 2, 0 +_080F6858: .4byte 0x02037fd4 +_080F685C: .4byte 0x03005e00 +_080F6860: .4byte 0x0203a034 +_080F6864: .4byte 0x0000ffff +_080F6868: + cmp r0, 0x1 + bne _080F6884 + ldr r0, _080F6880 +_080F686E: + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _080F68A8 + .align 2, 0 +_080F6880: .4byte 0xffff0000 +_080F6884: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl remove_task + bl Window_FreeMemory + ldr r0, _080F68B0 + bl set_callback2 + bl sub_80F7E64 +_080F68A8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F68B0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80F6820 + + thumb_func_start sub_80F68B4 +sub_80F68B4: @ 80F68B4 + push {r4,r5,lr} + ldr r2, _080F68E8 + ldrh r3, [r2] + adds r0, r3, 0x2 + strh r0, [r2] + ldr r4, _080F68EC + ldrh r5, [r4] + adds r1, r5, 0x1 + strh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _080F68D4 + adds r0, r3, 0 + subs r0, 0xFD + strh r0, [r2] +_080F68D4: + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _080F68E2 + adds r0, r5, 0 + subs r0, 0xFE + strh r0, [r4] +_080F68E2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F68E8: .4byte 0x02022e20 +_080F68EC: .4byte 0x02022e22 + thumb_func_end sub_80F68B4 + + thumb_func_start sub_80F68F0 +sub_80F68F0: @ 80F68F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080F6920 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080F6972 + movs r0, 0 + strh r0, [r2, 0x8] + movs r3, 0xC + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080F6924 + ldrh r0, [r2, 0xA] + adds r0, 0x1 + b _080F6928 + .align 2, 0 +_080F6920: .4byte 0x03005e00 +_080F6924: + ldrh r0, [r2, 0xA] + subs r0, 0x1 +_080F6928: + strh r0, [r2, 0xA] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x10 + bne _080F693E + movs r0, 0x1 + b _080F6942 +_080F693E: + cmp r0, 0 + bne _080F6944 +_080F6942: + strh r0, [r1, 0xC] +_080F6944: + ldr r0, _080F6990 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r2, [r4, 0xA] + ldr r3, _080F6994 + movs r0, 0x6B + movs r1, 0x1 + bl pal_fade_1 + ldrb r2, [r4, 0xA] + ldr r3, _080F6998 + movs r0, 0x68 + movs r1, 0x1 + bl pal_fade_1 + ldrb r2, [r4, 0xA] + ldr r3, _080F699C + movs r0, 0x6E + movs r1, 0x1 + bl pal_fade_1 +_080F6972: + ldr r1, _080F6990 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r3, 0xA + ldrsh r4, [r0, r3] + cmp r4, 0 + bne _080F69A4 + ldr r0, _080F69A0 + ldr r0, [r0] + ldr r0, [r0] + strb r4, [r0, 0xA] + b _080F69AE + .align 2, 0 +_080F6990: .4byte 0x03005e00 +_080F6994: .4byte 0x00002ede +_080F6998: .4byte 0x00007fff +_080F699C: .4byte 0x000077be +_080F69A0: .4byte 0x0203a034 +_080F69A4: + ldr r0, _080F69B4 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xA] +_080F69AE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F69B4: .4byte 0x0203a034 + thumb_func_end sub_80F68F0 + + thumb_func_start sub_80F69B8 +sub_80F69B8: @ 80F69B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + mov r8, r4 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + ldr r0, _080F6A38 + movs r2, 0 + ldrb r0, [r0] + cmp r4, r0 + bne _080F69DE + movs r2, 0x1 +_080F69DE: + adds r0, r7, 0 + ldr r1, [sp, 0x28] + bl sub_80D2EDC + adds r3, r0, 0 + lsls r0, r5, 9 + adds r0, 0x80 + adds r3, r0 + cmp r6, 0 + beq _080F6A40 + lsls r1, r4, 9 + ldr r0, _080F6A3C + adds r1, r0 + movs r2, 0xC0 + lsls r2, 1 + adds r0, r3, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + adds r0, r4, 0 + adds r0, 0xA + lsls r0, 28 + lsls r1, r4, 20 + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + orrs r1, r0 + lsrs r1, 16 + lsls r3, r4, 1 + adds r3, r4 + adds r3, 0x4 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r2, 0x3 + bl bg_write_sequence_to_wram_tile_map_rect + b _080F6A54 + .align 2, 0 +_080F6A38: .4byte 0x02039f25 +_080F6A3C: .4byte 0x06004000 +_080F6A40: + mov r0, r8 + lsls r1, r0, 9 + ldr r2, _080F6A60 + adds r1, r2 + movs r2, 0xC0 + lsls r2, 1 + adds r0, r3, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy +_080F6A54: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F6A60: .4byte 0x06004000 + thumb_func_end sub_80F69B8 + + thumb_func_start sub_80F6A64 +sub_80F6A64: @ 80F6A64 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + ldr r4, _080F6A98 +_080F6A74: + ldrh r0, [r4] + lsls r1, r5, 24 + lsrs r1, 24 + ldr r2, [r4, 0x38] + str r2, [sp] + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80F69B8 + adds r4, 0x40 + adds r5, 0x1 + cmp r5, 0x3 + ble _080F6A74 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F6A98: .4byte 0x02039e00 + thumb_func_end sub_80F6A64 + + thumb_func_start sub_80F6A9C +sub_80F6A9C: @ 80F6A9C + push {r4-r6,lr} + movs r4, 0 + ldr r6, _080F6ADC + movs r5, 0xA0 + lsls r5, 16 +_080F6AA6: + ldr r1, _080F6AE0 + lsls r0, r4, 6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0 + bl sub_80D2E08 + lsls r0, 16 + lsrs r0, 16 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 5 + ldr r1, _080F6AE4 + adds r0, r1 + lsrs r1, r5, 16 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 13 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x3 + ble _080F6AA6 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F6ADC: .4byte 0x0857c388 +_080F6AE0: .4byte 0x02039e00 +_080F6AE4: .4byte 0x08dde1f8 + thumb_func_end sub_80F6A9C + + thumb_func_start sub_80F6AE8 +sub_80F6AE8: @ 80F6AE8 + push {r4,lr} + ldr r0, _080F6B60 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F6B58 + bl sub_800E0E8 + movs r0, 0x8 + movs r1, 0x8 + bl sub_800DFB4 + ldr r4, _080F6B64 + ldr r0, _080F6B68 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x43 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _080F6B6C + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r1, r0, 0 + lsls r1, 16 + movs r0, 0x1 + negs r0, r0 + lsrs r1, 11 + ldr r2, _080F6B70 + adds r1, r2 + movs r2, 0x80 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldr r0, _080F6B74 + movs r1, 0x8 + movs r2, 0x8 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x1] +_080F6B58: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F6B60: .4byte 0x02039f2a +_080F6B64: .4byte 0x02020630 +_080F6B68: .4byte 0x02022b10 +_080F6B6C: .4byte 0x0858d8e0 +_080F6B70: .4byte 0x06010000 +_080F6B74: .4byte 0x0858d8c8 + thumb_func_end sub_80F6AE8 + + thumb_func_start sub_80F6B78 +sub_80F6B78: @ 80F6B78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + adds r5, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + add r4, sp, 0x20 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0x1E + strb r0, [r4, 0x3] + movs r0, 0x2 + strb r0, [r4, 0x4] + adds r0, r4, 0 + bl Window_AddFromTemplate + lsls r6, r0, 24 + lsrs r4, r6, 24 + adds r0, r4, 0 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0 + bl font_get_width_of_string + adds r2, r0, 0 + adds r2, 0x9 + cmp r2, 0 + bge _080F6BC4 + adds r2, 0x7 +_080F6BC4: + asrs r2, 3 + mov r10, r2 + cmp r2, 0x1E + ble _080F6BD0 + movs r1, 0x1E + mov r10, r1 +_080F6BD0: + mov r1, r10 + lsls r2, r1, 3 + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _080F6DA8 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + adds r0, r4, 0 + movs r1, 0x7 + bl Window_GetField + mov r9, r0 + ldr r2, _080F6DAC + mov r8, r2 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + ldr r3, _080F6DB0 + adds r1, r3 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r0, 17 + ldr r2, _080F6DB4 + adds r0, r2 + str r0, [sp, 0xC] + str r6, [sp, 0x38] + mov r7, sp + adds r7, 0x1C + str r7, [sp, 0x2C] + mov r0, r10 + adds r0, 0x2 + str r0, [sp, 0x30] + movs r5, 0 + add r7, sp, 0x10 + mov r12, r7 + adds r6, r1, 0 + adds r6, 0x2E + movs r4, 0x2 +_080F6C34: + adds r0, r6, r5 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r0, 17 + adds r0, r2 + mov r1, r12 + adds r1, 0x4 + mov r12, r1 + subs r1, 0x4 + stm r1!, {r0} + adds r5, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080F6C34 + mov r7, r8 + adds r7, 0x80 + mov r2, r8 + adds r2, 0x40 + str r2, [sp, 0x28] + mov r0, r8 + adds r0, 0x20 + str r0, [sp, 0x3C] + mov r1, r8 + adds r1, 0xA0 + str r1, [sp, 0x40] + adds r2, 0x20 + str r2, [sp, 0x34] + add r5, sp, 0xC + movs r6, 0 + movs r4, 0x3 +_080F6C7C: + str r6, [sp, 0x1C] + ldm r5!, {r1} + ldr r0, [sp, 0x2C] + ldr r2, _080F6DB8 + bl CpuSet + subs r4, 0x1 + cmp r4, 0 + bge _080F6C7C + ldr r5, [sp, 0xC] + ldr r6, _080F6DBC + mov r0, r8 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + movs r0, 0x80 + lsls r0, 1 + adds r1, r5, r0 + adds r0, r7, 0 + adds r2, r6, 0 + bl CpuSet + movs r2, 0x80 + lsls r2, 2 + adds r1, r5, r2 + adds r0, r7, 0 + adds r2, r6, 0 + bl CpuSet + movs r7, 0xC0 + lsls r7, 2 + adds r1, r5, r7 + ldr r0, [sp, 0x28] + adds r2, r6, 0 + bl CpuSet + movs r4, 0 + cmp r4, r10 + bge _080F6D32 + adds r7, r6, 0 +_080F6CCE: + adds r6, r4, 0x1 + adds r0, r6, 0 + cmp r6, 0 + bge _080F6CDA + adds r0, r4, 0 + adds r0, 0x8 +_080F6CDA: + asrs r0, 3 + lsls r1, r0, 2 + add r1, sp + adds r1, 0xC + lsls r0, 3 + subs r0, r6, r0 + lsls r0, 5 + ldr r1, [r1] + adds r5, r1, r0 + mov r0, r8 + adds r0, 0xC0 + adds r1, r5, 0 + adds r2, r7, 0 + bl CpuSet + movs r0, 0x80 + lsls r0, 1 + adds r1, r5, r0 + mov r0, r9 + adds r2, r7, 0 + bl CpuSet + movs r0, 0xF0 + lsls r0, 2 + add r0, r9 + movs r2, 0x80 + lsls r2, 2 + adds r1, r5, r2 + adds r2, r7, 0 + bl CpuSet + movs r0, 0xC0 + lsls r0, 2 + adds r1, r5, r0 + mov r0, r8 + adds r0, 0xE0 + adds r2, r7, 0 + bl CpuSet + movs r1, 0x20 + add r9, r1 + adds r4, r6, 0 + cmp r4, r10 + blt _080F6CCE +_080F6D32: + adds r2, r4, 0x1 + adds r0, r2, 0 + cmp r2, 0 + bge _080F6D3E + adds r0, r4, 0 + adds r0, 0x8 +_080F6D3E: + asrs r0, 3 + lsls r1, r0, 2 + add r1, sp + adds r1, 0xC + lsls r0, 3 + subs r0, r2, r0 + lsls r0, 5 + ldr r1, [r1] + adds r5, r1, r0 + ldr r4, _080F6DBC + ldr r0, [sp, 0x3C] + adds r1, r5, 0 + adds r2, r4, 0 + bl CpuSet + movs r2, 0x80 + lsls r2, 1 + adds r1, r5, r2 + ldr r0, [sp, 0x40] + adds r2, r4, 0 + bl CpuSet + movs r7, 0x80 + lsls r7, 2 + adds r1, r5, r7 + ldr r0, [sp, 0x40] + adds r2, r4, 0 + bl CpuSet + movs r0, 0xC0 + lsls r0, 2 + adds r1, r5, r0 + ldr r0, [sp, 0x34] + adds r2, r4, 0 + bl CpuSet + ldr r1, [sp, 0x38] + lsrs r0, r1, 24 + bl Window_Remove + ldr r2, [sp, 0x30] + lsls r1, r2, 3 + movs r0, 0xF0 + subs r0, r1 + asrs r0, 1 + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080F6DA8: .4byte 0x0858d8e8 +_080F6DAC: .4byte 0x0858d6d0 +_080F6DB0: .4byte 0x02020630 +_080F6DB4: .4byte 0x06010000 +_080F6DB8: .4byte 0x05000100 +_080F6DBC: .4byte 0x04000008 + thumb_func_end sub_80F6B78 + + thumb_func_start sub_80F6DC0 +sub_80F6DC0: @ 80F6DC0 + push {r4-r6,lr} + sub sp, 0x20 + mov r1, sp + ldr r0, _080F6E88 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r5, sp, 0x18 + ldr r6, _080F6E8C + movs r4, 0x7 +_080F6DD6: + adds r0, r6, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r6, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _080F6DD6 + ldr r0, _080F6E90 + bl gpu_pal_obj_alloc_tag_and_apply + movs r4, 0 + mov r6, sp +_080F6DEE: + mov r0, sp + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x90 + movs r3, 0xA + bl obj_add_from_template_forward_search + adds r1, r5, r4 + strb r0, [r1] + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + adds r4, 0x1 + cmp r4, 0x7 + ble _080F6DEE + ldr r2, _080F6E94 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x1] + movs r3, 0 + strh r1, [r0, 0x2E] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x2] + strh r1, [r0, 0x30] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x3] + strh r1, [r0, 0x32] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x5] + strh r1, [r0, 0x2E] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x6] + strh r1, [r0, 0x30] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x7] + strh r1, [r0, 0x32] + ldr r1, _080F6E98 + ldr r0, [r1] + ldr r2, [r0] + ldrb r0, [r5] + strb r0, [r2] + ldr r0, [r1] + ldr r0, [r0] + strb r3, [r0, 0x4] + ldr r0, [r1] + ldr r1, [r0] + ldrb r0, [r5, 0x4] + strb r0, [r1, 0x1] + bl sub_80F7144 + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F6E88: .4byte 0x0858d7f8 +_080F6E8C: .4byte 0x0858d810 +_080F6E90: .4byte 0x0858d850 +_080F6E94: .4byte 0x02020630 +_080F6E98: .4byte 0x0203a034 + thumb_func_end sub_80F6DC0 + + thumb_func_start sub_80F6E9C +sub_80F6E9C: @ 80F6E9C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, _080F6EE8 + ldr r4, [r4] + mov r8, r4 + ldr r4, [r4] + ldrb r5, [r4] + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r5, _080F6EEC + adds r4, r5 + movs r6, 0 + movs r5, 0x88 + lsls r5, 1 + strh r5, [r4, 0x20] + strh r1, [r4, 0x22] + strh r6, [r4, 0x24] + strh r6, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + adds r0, 0x20 + strh r0, [r4, 0x36] + strh r2, [r4, 0x38] + strh r3, [r4, 0x3A] + strh r6, [r4, 0x3C] + ldr r0, _080F6EF0 + str r0, [r4, 0x1C] + mov r0, r8 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F6EE8: .4byte 0x0203a034 +_080F6EEC: .4byte 0x02020630 +_080F6EF0: .4byte sub_80F6F68 + 1 + thumb_func_end sub_80F6E9C + + thumb_func_start sub_80F6EF4 +sub_80F6EF4: @ 80F6EF4 + push {r4,r5,lr} + ldr r1, _080F6F34 + ldr r4, [r1] + ldr r1, [r4] + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, _080F6F38 + adds r1, r2 + ldrh r2, [r1, 0x24] + ldrh r3, [r1, 0x20] + adds r2, r3 + movs r3, 0 + strh r2, [r1, 0x20] + ldrh r2, [r1, 0x26] + ldrh r5, [r1, 0x22] + adds r2, r5 + strh r2, [r1, 0x22] + strh r3, [r1, 0x26] + strh r3, [r1, 0x24] + strh r0, [r1, 0x3A] + strh r3, [r1, 0x3C] + ldr r0, _080F6F3C + str r0, [r1, 0x1C] + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F6F34: .4byte 0x0203a034 +_080F6F38: .4byte 0x02020630 +_080F6F3C: .4byte sub_80F7014 + 1 + thumb_func_end sub_80F6EF4 + + thumb_func_start sub_80F6F40 +sub_80F6F40: @ 80F6F40 + movs r3, 0 + movs r2, 0 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r1, 0x90 + strh r1, [r0, 0x22] + strh r2, [r0, 0x26] + strh r2, [r0, 0x24] + ldr r1, _080F6F60 + str r1, [r0, 0x1C] + ldr r0, _080F6F64 + ldr r0, [r0] + ldr r0, [r0] + strb r3, [r0, 0x4] + bx lr + .align 2, 0 +_080F6F60: .4byte nullsub_12 + 1 +_080F6F64: .4byte 0x0203a034 + thumb_func_end sub_80F6F40 + + thumb_func_start sub_80F6F68 +sub_80F6F68: @ 80F6F68 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x3A] + ldrh r0, [r3, 0x3C] + adds r2, r0 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x20] + subs r0, r1 + strh r0, [r3, 0x20] + movs r1, 0xFF + ands r2, r1 + strh r2, [r3, 0x3C] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r3, 0x36] + movs r4, 0x36 + ldrsh r1, [r3, r4] + cmp r0, r1 + bge _080F6F92 + strh r2, [r3, 0x20] +_080F6F92: + movs r4, 0 + ldr r6, _080F6FD4 + movs r5, 0x40 + adds r2, r3, 0 + adds r2, 0x2E +_080F6F9C: + movs r7, 0 + ldrsh r0, [r2, r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r3, 0x24] + ldrh r7, [r3, 0x20] + adds r0, r7 + adds r0, r5 + strh r0, [r1, 0x20] + adds r5, 0x40 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _080F6F9C + movs r0, 0x20 + ldrsh r1, [r3, r0] + movs r2, 0x36 + ldrsh r0, [r3, r2] + cmp r1, r0 + bne _080F6FCC + ldr r0, _080F6FD8 + str r0, [r3, 0x1C] +_080F6FCC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F6FD4: .4byte 0x02020630 +_080F6FD8: .4byte sub_80F6FDC + 1 + thumb_func_end sub_80F6F68 + + thumb_func_start sub_80F6FDC +sub_80F6FDC: @ 80F6FDC + push {lr} + adds r2, r0, 0 + ldr r0, _080F700C + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x4] + ldrh r3, [r2, 0x38] + ldr r1, _080F7010 + lsrs r0, r1, 16 + cmp r3, r0 + beq _080F7008 + subs r0, r3, 0x1 + strh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 16 + asrs r1, 16 + cmp r0, r1 + bne _080F7008 + ldrh r0, [r2, 0x3A] + bl sub_80F6EF4 +_080F7008: + pop {r0} + bx r0 + .align 2, 0 +_080F700C: .4byte 0x0203a034 +_080F7010: .4byte 0xffff0000 + thumb_func_end sub_80F6FDC + + thumb_func_start sub_80F7014 +sub_80F7014: @ 80F7014 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x3A] + ldrh r0, [r3, 0x3C] + adds r2, r0 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x20] + subs r0, r1 + strh r0, [r3, 0x20] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x3C] + movs r4, 0 + ldr r6, _080F7078 + movs r5, 0x40 + adds r2, r3, 0 + adds r2, 0x2E +_080F7038: + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r3, 0x24] + ldrh r7, [r3, 0x20] + adds r0, r7 + adds r0, r5 + strh r0, [r1, 0x20] + adds r5, 0x40 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _080F7038 + movs r1, 0x20 + ldrsh r0, [r3, r1] + movs r2, 0x24 + ldrsh r1, [r3, r2] + adds r0, r1 + movs r1, 0xE0 + negs r1, r1 + cmp r0, r1 + bge _080F7070 + adds r0, r3, 0 + bl sub_80F6F40 +_080F7070: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F7078: .4byte 0x02020630 + thumb_func_end sub_80F7014 + + thumb_func_start sub_80F707C +sub_80F707C: @ 80F707C + push {r4-r7,lr} + ldr r4, _080F7130 + ldr r1, [r4] + ldr r1, [r1] + ldrb r1, [r1, 0x1] + bl sub_80F6B78 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + ldr r1, [r1] + ldrb r2, [r1, 0x1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r3, _080F7134 + adds r4, r1, r3 + adds r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x50 + strh r0, [r4, 0x22] + adds r5, r4, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + strb r0, [r5] + movs r5, 0 + adds r6, r3, 0 + mov r12, r2 + movs r3, 0x40 +_080F70BE: + lsls r0, r5, 1 + adds r2, r4, 0 + adds r2, 0x2E + adds r2, r0 + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r4, 0x24] + ldrh r7, [r4, 0x20] + adds r0, r7 + adds r0, r3 + strh r0, [r1, 0x20] + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r4, 0x22] + strh r1, [r0, 0x22] + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + adds r3, 0x40 + adds r5, 0x1 + cmp r5, 0x2 + ble _080F70BE + ldr r1, _080F7138 + movs r0, 0xF0 + strh r0, [r1] + ldr r2, _080F713C + ldrh r1, [r4, 0x22] + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 8 + adds r1, 0x10 + orrs r0, r1 + strh r0, [r2] + ldr r1, _080F7140 + movs r0, 0x48 + bl lcd_io_set + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F7130: .4byte 0x0203a034 +_080F7134: .4byte 0x02020630 +_080F7138: .4byte 0x02022e24 +_080F713C: .4byte 0x02022e26 +_080F7140: .4byte 0x00003f3e + thumb_func_end sub_80F707C + + thumb_func_start sub_80F7144 +sub_80F7144: @ 80F7144 + push {r4-r7,lr} + ldr r0, _080F71B4 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r3, _080F71B8 + adds r2, r3 + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r0, [r0] + movs r1, 0x4 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r7, _080F71BC + ldr r6, _080F71C0 + adds r5, r3, 0 + movs r4, 0x4 + adds r2, 0x2E + movs r3, 0x2 +_080F7174: + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _080F7174 + movs r0, 0 + strh r0, [r7] + strh r0, [r6] + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r6] + movs r0, 0x44 + bl lcd_io_set + ldr r1, _080F71C4 + movs r0, 0x48 + bl lcd_io_set + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F71B4: .4byte 0x0203a034 +_080F71B8: .4byte 0x02020630 +_080F71BC: .4byte 0x02022e24 +_080F71C0: .4byte 0x02022e26 +_080F71C4: .4byte 0x00003f3f + thumb_func_end sub_80F7144 + + thumb_func_start sub_80F71C8 +sub_80F71C8: @ 80F71C8 + push {r4-r6,lr} + sub sp, 0xC + movs r5, 0x5 + movs r4, 0x1 + ldr r0, _080F71F0 + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080F71F8 + ldr r1, _080F71F4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r2, 0x5 + movs r3, 0x1 + bl gpu_copy_to_iwram_tile_map_rect + movs r5, 0xA + b _080F7240 + .align 2, 0 +_080F71F0: .4byte 0x02039f2a +_080F71F4: .4byte 0x08dc6498 +_080F71F8: + ldr r0, _080F7204 + ldrh r2, [r0] + cmp r2, 0 + bne _080F720C + ldr r1, _080F7208 + b _080F722E + .align 2, 0 +_080F7204: .4byte 0x02039f2e +_080F7208: .4byte 0x08dc63f8 +_080F720C: + cmp r2, 0x1 + bne _080F7218 + ldr r1, _080F7214 + b _080F722E + .align 2, 0 +_080F7214: .4byte 0x08dc6420 +_080F7218: + cmp r2, 0x2 + bne _080F722C + ldr r1, _080F7228 + movs r0, 0xA + str r0, [sp] + str r2, [sp, 0x4] + movs r0, 0x2 + b _080F7236 + .align 2, 0 +_080F7228: .4byte 0x08dc6448 +_080F722C: + ldr r1, _080F7250 +_080F722E: + movs r0, 0xA + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] +_080F7236: + movs r2, 0x5 + movs r3, 0x1 + bl gpu_copy_to_iwram_tile_map_rect + movs r5, 0xF +_080F7240: + ldr r0, _080F7254 + ldrh r0, [r0] + cmp r0, 0 + bne _080F725C + movs r6, 0 + ldr r1, _080F7258 + b _080F7298 + .align 2, 0 +_080F7250: .4byte 0x08dc6470 +_080F7254: .4byte 0x02039f2c +_080F7258: .4byte 0x08dc64ac +_080F725C: + cmp r0, 0x1 + bne _080F726C + movs r6, 0x1 + ldr r1, _080F7268 + b _080F7298 + .align 2, 0 +_080F7268: .4byte 0x08dc64c0 +_080F726C: + cmp r0, 0x2 + bne _080F7290 + movs r6, 0x2 + ldr r1, _080F728C + lsls r2, r5, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r3, r4, 24 + movs r0, 0x5 + str r0, [sp] + str r6, [sp, 0x4] + movs r0, 0x2 + bl gpu_copy_to_iwram_tile_map_rect + b _080F72CC + .align 2, 0 +_080F728C: .4byte 0x08dc64d4 +_080F7290: + cmp r0, 0x3 + bne _080F72B4 + movs r6, 0x3 + ldr r1, _080F72B0 +_080F7298: + lsls r2, r5, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r3, r4, 24 + movs r0, 0x5 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + bl gpu_copy_to_iwram_tile_map_rect + b _080F72CC + .align 2, 0 +_080F72B0: .4byte 0x08dc64e8 +_080F72B4: + movs r6, 0x4 + ldr r1, _080F7304 + lsls r2, r5, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r3, r4, 24 + movs r0, 0x5 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + bl gpu_copy_to_iwram_tile_map_rect +_080F72CC: + adds r5, 0x5 + ldr r1, _080F7308 + lsls r2, r5, 24 + lsrs r2, 24 + lsrs r3, r4, 24 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + bl gpu_copy_to_iwram_tile_map_rect + ldr r0, _080F730C + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x20 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect_simple + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F7304: .4byte 0x08dc64fc +_080F7308: .4byte 0x08dc6510 +_080F730C: .4byte 0x0203a034 + thumb_func_end sub_80F71C8 + + thumb_func_start sub_80F7310 +sub_80F7310: @ 80F7310 + push {r4,r5,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r1, _080F735C + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x3F + bl __udivsi3 + adds r1, r0, 0 + ldr r0, _080F7360 + ands r0, r1 + cmp r0, 0 + beq _080F733C + movs r0, 0x80 + lsls r0, 9 + adds r1, r0 +_080F733C: + lsrs r1, 16 + cmp r1, 0 + bne _080F7348 + cmp r4, 0 + beq _080F7348 + movs r1, 0x1 +_080F7348: + cmp r5, 0 + beq _080F7352 + cmp r1, 0xA + bls _080F7352 + movs r1, 0xA +_080F7352: + lsls r0, r1, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080F735C: .4byte 0x02039f00 +_080F7360: .4byte 0x0000ffff + thumb_func_end sub_80F7310 + + thumb_func_start sub_80F7364 +sub_80F7364: @ 80F7364 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r1, _080F73C4 + lsls r0, r5, 1 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r7, r1, 0 + cmp r0, 0 + bge _080F7380 + negs r0, r0 +_080F7380: + lsls r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x50 + bl __udivsi3 + adds r2, r0, 0 + ldr r0, _080F73C8 + ands r0, r2 + cmp r0, 0 + beq _080F739A + movs r0, 0x80 + lsls r0, 9 + adds r2, r0 +_080F739A: + lsrs r2, 16 + cmp r2, 0 + bne _080F73A6 + cmp r4, 0 + beq _080F73A6 + movs r2, 0x1 +_080F73A6: + cmp r6, 0 + beq _080F73B0 + cmp r2, 0xA + bls _080F73B0 + movs r2, 0xA +_080F73B0: + lsls r0, r5, 1 + adds r0, r7 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080F73CC + negs r0, r2 + lsls r0, 24 + b _080F73CE + .align 2, 0 +_080F73C4: .4byte 0x02039f18 +_080F73C8: .4byte 0x0000ffff +_080F73CC: + lsls r0, r2, 24 +_080F73CE: + lsrs r0, 24 + lsls r0, 24 + asrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80F7364 + + thumb_func_start sub_80F73DC +sub_80F73DC: @ 80F73DC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _080F7418 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r7, r0, r1 + ldrh r2, [r7, 0x1C] + movs r0, 0x1C + ldrsh r6, [r7, r0] + cmp r6, 0 + bne _080F741C + movs r1, 0x8 + ldrsh r0, [r7, r1] + movs r1, 0x3 + subs r1, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + strh r0, [r7, 0x1E] + adds r0, r2, 0x1 + strh r0, [r7, 0x1C] + b _080F74A4 + .align 2, 0 +_080F7418: .4byte 0x03005e00 +_080F741C: + cmp r6, 0x1 + bne _080F74A4 + ldrh r0, [r7, 0x1E] + subs r0, 0x1 + strh r0, [r7, 0x1E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080F74A4 + movs r2, 0x8 + ldrsh r4, [r7, r2] + lsls r4, 17 + ldr r0, _080F74B4 + adds r4, r0 + lsrs r4, 16 + movs r1, 0xA + ldrsh r0, [r7, r1] + lsls r3, r0, 1 + adds r3, r0 + adds r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + movs r2, 0x2 + mov r9, r2 + str r2, [sp] + str r6, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_write_sequence_to_wram_tile_map_rect + adds r4, 0x10 + lsls r4, 16 + lsrs r4, 16 + movs r1, 0xA + ldrsh r0, [r7, r1] + lsls r3, r0, 1 + adds r3, r0 + adds r3, 0x6 + lsls r3, 24 + lsrs r3, 24 + mov r2, r9 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_write_sequence_to_wram_tile_map_rect + ldr r0, _080F74B8 + ldr r0, [r0] + ldr r1, [r0] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + mov r0, r8 + bl remove_task + movs r0, 0x18 + bl audio_play +_080F74A4: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F74B4: .4byte 0x50430000 +_080F74B8: .4byte 0x0203a034 + thumb_func_end sub_80F73DC + + thumb_func_start sub_80F74BC +sub_80F74BC: @ 80F74BC + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, _080F752C + ldrb r0, [r1] + ldr r6, _080F7530 + cmp r0, 0 + beq _080F74DE +_080F74D0: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080F74DE + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F74D0 +_080F74DE: + ldr r1, [r6] + lsls r3, r4, 1 + adds r3, r4 + lsls r0, r3, 6 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + ldr r1, [r1, 0x14] + adds r1, r0 + adds r3, 0x4 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x9 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r2, 0 + bl bg_copy_tilemap_rect_simple + ldr r1, _080F7534 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x1C] + movs r1, 0x1 + strh r1, [r0, 0x20] + ldr r1, _080F7538 + str r1, [r0] + ldr r0, [r6] + ldr r0, [r0] + strb r5, [r0, 0x3] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F752C: .4byte 0x02039f20 +_080F7530: .4byte 0x0203a034 +_080F7534: .4byte 0x03005e00 +_080F7538: .4byte sub_80F753C + 1 + thumb_func_end sub_80F74BC + + thumb_func_start sub_80F753C +sub_80F753C: @ 80F753C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F7588 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0x1 + bne _080F75A0 + movs r0, 0 + strh r0, [r4, 0x1E] + ldrh r2, [r4, 0x20] + lsls r2, 24 + lsrs r2, 24 + ldr r3, _080F758C + movs r0, 0x91 + movs r1, 0x1 + bl pal_fade_1 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080F7590 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _080F75A0 + strh r5, [r4, 0x22] + b _080F75A0 + .align 2, 0 +_080F7588: .4byte 0x03005e00 +_080F758C: .4byte 0x00006f8d +_080F7590: + ldrh r0, [r4, 0x20] + subs r0, 0x1 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _080F75A0 + strh r0, [r4, 0x22] +_080F75A0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F753C + + thumb_func_start sub_80F75A8 +sub_80F75A8: @ 80F75A8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x9 + bgt _080F75D0 + adds r0, r1, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _080F7610 + ldrh r0, [r4, 0x30] + movs r1, 0 + bl cry_related + movs r0, 0 + strh r0, [r4, 0x30] + b _080F7610 +_080F75D0: + movs r0, 0xC0 + lsls r0, 3 + adds r2, r0, 0 + ldrh r1, [r4, 0x30] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] + movs r1, 0xFF + ands r2, r1 + strh r2, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x77 + bgt _080F75F6 + movs r0, 0x78 + strh r0, [r4, 0x20] +_080F75F6: + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + bne _080F7610 + ldr r0, _080F7618 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x30] + ldr r0, _080F761C + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x6] +_080F7610: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F7618: .4byte nullsub_12 + 1 +_080F761C: .4byte 0x0203a034 + thumb_func_end sub_80F75A8 + + thumb_func_start sub_80F7620 +sub_80F7620: @ 80F7620 + push {lr} + adds r3, r0, 0 + movs r0, 0xC0 + lsls r0, 3 + adds r2, r0, 0 + ldrh r0, [r3, 0x30] + adds r2, r0 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x20] + subs r0, r1 + strh r0, [r3, 0x20] + movs r1, 0xFF + ands r2, r1 + strh r2, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _080F7664 + ldr r0, _080F7668 + str r0, [r3, 0x1C] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080F766C + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x6] +_080F7664: + pop {r0} + bx r0 + .align 2, 0 +_080F7668: .4byte nullsub_12 + 1 +_080F766C: .4byte 0x0203a034 + thumb_func_end sub_80F7620 + + thumb_func_start sub_80F7670 +sub_80F7670: @ 80F7670 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080F7750 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _080F7732 + movs r0, 0 + strh r0, [r1, 0x8] + ldr r0, _080F7754 + mov r8, r0 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x7] + cmp r0, 0x27 + bhi _080F7732 + ldr r4, _080F7758 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r1, r0, 0 + subs r1, 0x14 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0x2C + movs r3, 0x5 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + ldr r1, _080F775C + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + adds r5, r1 + lsls r0, 23 + lsrs r0, 23 + strh r0, [r5, 0x2E] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x18 + bl __umodsi3 + adds r0, 0x10 + strh r0, [r5, 0x30] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + ands r0, r1 + adds r0, 0x30 + strh r0, [r5, 0x32] + bl GenerateRandomNumber + ldrh r6, [r5, 0x4] + lsls r4, r6, 22 + lsrs r4, 22 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + adds r4, r0 + ldr r1, _080F7760 + adds r0, r1, 0 + ands r4, r0 + ldr r0, _080F7764 + ands r0, r6 + orrs r0, r4 + strh r0, [r5, 0x4] + mov r1, r8 + ldr r0, [r1] + ldr r1, [r0] + ldrb r0, [r1, 0x7] + adds r0, 0x1 + strb r0, [r1, 0x7] +_080F7732: + ldr r0, _080F7754 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080F7744 + adds r0, r7, 0 + bl remove_task +_080F7744: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F7750: .4byte 0x03005e00 +_080F7754: .4byte 0x0203a034 +_080F7758: .4byte 0x0858d860 +_080F775C: .4byte 0x02020630 +_080F7760: .4byte 0x000003ff +_080F7764: .4byte 0xfffffc00 + thumb_func_end sub_80F7670 + + thumb_func_start sub_80F7768 +sub_80F7768: @ 80F7768 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r1, [r4, 0x32] + ldrh r0, [r4, 0x36] + adds r1, r0 + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0x36] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + ldr r5, _080F77DC + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080F77B6 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080F77B6: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0xF8 + bgt _080F77C6 + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x74 + ble _080F77D6 +_080F77C6: + adds r0, r4, 0 + bl obj_delete_and_free_tiles + ldr r0, [r5] + ldr r1, [r0] + ldrb r0, [r1, 0x7] + subs r0, 0x1 + strb r0, [r1, 0x7] +_080F77D6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F77DC: .4byte 0x0203a034 + thumb_func_end sub_80F7768 + + thumb_func_start sub_80F77E0 +sub_80F77E0: @ 80F77E0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080F7818 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F781C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xA] + ldr r0, _080F7820 + lsls r4, 6 + adds r4, r0 + ldrh r0, [r4] + strh r0, [r1, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F7818: .4byte sub_80F7824 + 1 +_080F781C: .4byte 0x03005e00 +_080F7820: .4byte 0x02039e00 + thumb_func_end sub_80F77E0 + + thumb_func_start sub_80F7824 +sub_80F7824: @ 80F7824 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F7878 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrb r5, [r4, 0x8] + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xA + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _080F786E + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xC] + ldrb r2, [r4, 0x1E] + ldr r1, _080F787C + lsls r3, r5, 6 + adds r1, 0x38 + adds r3, r1 + ldr r1, [r3] + str r1, [sp] + adds r1, r5, 0 + movs r3, 0 + bl sub_80F69B8 + ldrh r0, [r4, 0x1E] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x1E] +_080F786E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F7878: .4byte 0x03005e00 +_080F787C: .4byte 0x02039e00 + thumb_func_end sub_80F7824 + + thumb_func_start sub_80F7880 +sub_80F7880: @ 80F7880 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _080F7A44 + ldrh r2, [r0] + adds r4, r0, 0 + adds r3, r4, 0x2 + movs r0, 0x2 + mov r8, r0 +_080F7898: + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0 + ldrsh r1, [r3, r5] + cmp r0, r1 + bge _080F78A6 + ldrh r2, [r3] +_080F78A6: + adds r3, 0x2 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r1, r8 + cmp r1, 0 + bge _080F7898 + lsls r0, r2, 16 + str r0, [sp] + cmp r0, 0 + bge _080F78E4 + ldrh r2, [r4] + adds r3, r4, 0x2 + movs r4, 0x2 + mov r8, r4 +_080F78C4: + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0 + ldrsh r1, [r3, r5] + cmp r0, r1 + ble _080F78D2 + ldrh r2, [r3] +_080F78D2: + adds r3, 0x2 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + lsls r1, r2, 16 + str r1, [sp] + mov r4, r8 + cmp r4, 0 + bge _080F78C4 +_080F78E4: + movs r5, 0 + mov r8, r5 + mov r10, r5 +_080F78EA: + ldr r0, _080F7A48 + mov r1, r8 + lsls r7, r1, 1 + adds r0, r7, r0 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + ldr r4, [sp] + asrs r5, r4, 16 + adds r1, r5, 0 + cmp r5, 0 + bge _080F790C + negs r1, r5 +_080F790C: + bl __divsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __modsi3 + cmp r0, 0x4 + ble _080F791E + adds r4, 0xA +_080F791E: + ldr r0, _080F7A4C + mov r9, r0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r1, r10 + adds r6, r1, r0 + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + str r0, [r6] + ldr r0, _080F7A50 + adds r7, r0 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + bge _080F7942 + negs r1, r1 +_080F7942: + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r5, 0 + cmp r1, 0 + bge _080F7954 + negs r1, r1 +_080F7954: + bl __divsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __modsi3 + cmp r0, 0x4 + ble _080F7966 + adds r4, 0xA +_080F7966: + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + str r0, [r6, 0x4] + movs r4, 0 + ldrsh r0, [r7, r4] + cmp r0, 0 + bge _080F797C + movs r0, 0x1 + strb r0, [r6, 0x10] +_080F797C: + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0, 0x4] + mov r1, r10 + adds r4, r1, r0 + ldr r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + subs r0, r1 + lsls r0, 11 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + movs r5, 0xFF + ands r0, r5 + cmp r0, 0x7F + bls _080F79A8 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2 +_080F79A8: + lsrs r0, r1, 8 + str r0, [r4, 0x8] + ldr r1, [r4, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + subs r0, r1 + lsls r0, 11 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + ands r0, r5 + cmp r0, 0x7F + bls _080F79CC + movs r5, 0x80 + lsls r5, 1 + adds r1, r5 +_080F79CC: + lsrs r0, r1, 8 + str r0, [r4, 0xC] + mov r0, r8 + lsls r4, r0, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80F7310 + mov r2, r9 + ldr r1, [r2] + ldr r1, [r1, 0x4] + add r1, r10 + strb r0, [r1, 0x11] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80F7364 + mov r4, r9 + ldr r1, [r4] + ldr r1, [r1, 0x4] + add r1, r10 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _080F7A02 + negs r0, r0 +_080F7A02: + strb r0, [r1, 0x12] + ldr r0, _080F7A54 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _080F7A60 + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0, 0x4] + mov r2, r10 + adds r1, r2, r0 + ldr r5, [r1, 0x8] + ldrh r3, [r1, 0x8] + ldr r4, [r1, 0xC] + ldrh r2, [r1, 0xC] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080F7A2C + lsls r0, r2, 16 + negs r0, r0 + lsrs r2, r0, 16 +_080F7A2C: + lsls r0, r3, 16 + asrs r3, r0, 16 + lsls r0, r2, 16 + asrs r2, r0, 16 + adds r0, r3, r2 + cmp r0, 0x58 + bne _080F7A60 + cmp r2, 0 + ble _080F7A58 + subs r0, r4, 0x1 + str r0, [r1, 0xC] + b _080F7A60 + .align 2, 0 +_080F7A44: .4byte 0x02039f08 +_080F7A48: .4byte 0x02039f00 +_080F7A4C: .4byte 0x0203a034 +_080F7A50: .4byte 0x02039f18 +_080F7A54: .4byte 0x02039f20 +_080F7A58: + cmp r3, 0 + ble _080F7A60 + subs r0, r5, 0x1 + str r0, [r1, 0x8] +_080F7A60: + movs r4, 0x14 + add r10, r4 + movs r5, 0x1 + add r8, r5 + mov r0, r8 + cmp r0, 0x3 + bgt _080F7A70 + b _080F78EA +_080F7A70: + 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_80F7880 + + thumb_func_start sub_80F7A80 +sub_80F7A80: @ 80F7A80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + str r1, [sp, 0x8] + movs r3, 0 + str r3, [sp, 0xC] + cmp r0, 0 + bne _080F7B5C + mov r9, r3 + ldr r4, _080F7B44 + mov r10, r4 + movs r7, 0xA0 + lsls r7, 19 + movs r6, 0 +_080F7AAC: + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r2, [r0, 0x11] + cmp r8, r2 + bcs _080F7B2E + adds r2, 0x13 + mov r3, r8 + subs r2, r3 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + lsrs r3, r7, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + ldr r1, _080F7B48 + bl bg_fill_tilemap_rect + ldr r0, _080F7B4C + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r10 + ldr r4, [r0] + ldr r1, [r4, 0x4] + adds r1, r6, r1 + ldr r0, [r1, 0x8] + lsls r0, 16 + ldrb r1, [r1, 0x11] + bl __udivsi3 + mov r1, r8 + adds r1, 0x1 + adds r3, r0, 0 + muls r3, r1 + ldr r0, _080F7B50 + ands r0, r3 + ldr r1, _080F7B54 + cmp r0, r1 + bls _080F7B0A + movs r1, 0x80 + lsls r1, 9 + adds r3, r1 +_080F7B0A: + ldr r1, _080F7B58 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + mov r1, r9 + strh r1, [r0, 0x8] + lsrs r1, r3, 16 + strh r1, [r0, 0xA] + ldr r1, [r4] + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] +_080F7B2E: + movs r3, 0xC0 + lsls r3, 18 + adds r7, r3 + adds r6, 0x14 + movs r4, 0x1 + add r9, r4 + mov r0, r9 + cmp r0, 0x3 + ble _080F7AAC + b _080F7C7E + .align 2, 0 +_080F7B44: .4byte 0x0203a034 +_080F7B48: .4byte 0x000060b3 +_080F7B4C: .4byte sub_80F7CA8 + 1 +_080F7B50: .4byte 0x0000ffff +_080F7B54: .4byte 0x00007fff +_080F7B58: .4byte 0x03005e00 +_080F7B5C: + movs r1, 0 + mov r9, r1 + mov r10, r1 + movs r3, 0xC0 + lsls r3, 19 + str r3, [sp, 0x10] +_080F7B68: + ldr r4, _080F7C04 + ldr r0, [r4] + ldr r0, [r0, 0x4] + add r0, r10 + ldrb r2, [r0, 0x12] + ldrb r0, [r0, 0x10] + ldr r1, _080F7C08 + cmp r0, 0 + beq _080F7B7C + adds r1, 0x2 +_080F7B7C: + lsls r0, r2, 24 + asrs r0, 24 + cmp r8, r0 + bge _080F7C64 + mov r3, r8 + lsls r2, r3, 24 + asrs r2, 24 + subs r2, 0x13 + subs r2, r0, r2 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [sp, 0x10] + lsrs r3, r4, 24 + movs r7, 0x1 + str r7, [sp] + str r7, [sp, 0x4] + movs r0, 0x1 + bl bg_fill_tilemap_rect + ldr r0, _080F7C0C + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080F7C04 + ldr r6, [r0] + ldr r1, [r6, 0x4] + add r1, r10 + ldr r0, [r1, 0xC] + lsls r0, 16 + ldrb r1, [r1, 0x12] + bl __udivsi3 + mov r1, r8 + adds r1, 0x1 + adds r3, r0, 0 + muls r3, r1 + ldr r0, _080F7C10 + ands r0, r3 + ldr r1, _080F7C14 + cmp r0, r1 + bls _080F7BDA + movs r1, 0x80 + lsls r1, 9 + adds r3, r1 +_080F7BDA: + ldr r1, _080F7C18 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r4, r0, r1 + mov r0, r9 + strh r0, [r4, 0x8] + ldr r0, [r6, 0x4] + add r0, r10 + ldrb r0, [r0, 0x10] + adds r6, r1, 0 + cmp r0, 0 + beq _080F7C1C + strh r7, [r4, 0xC] + ldr r0, [sp, 0xC] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + b _080F7C26 + .align 2, 0 +_080F7C04: .4byte 0x0203a034 +_080F7C08: .4byte 0x000060a3 +_080F7C0C: .4byte sub_80F7CA8 + 1 +_080F7C10: .4byte 0x0000ffff +_080F7C14: .4byte 0x00007fff +_080F7C18: .4byte 0x03005e00 +_080F7C1C: + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] +_080F7C26: + ldr r1, _080F7C48 + ldr r0, [r1] + ldr r0, [r0, 0x4] + mov r4, r10 + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + ldr r4, _080F7C48 + cmp r0, 0 + beq _080F7C4C + adds r0, r2, r5 + lsls r0, 3 + adds r0, r6 + lsrs r2, r3, 16 + ldr r1, [r1, 0x8] + subs r1, r2 + b _080F7C58 + .align 2, 0 +_080F7C48: .4byte 0x0203a034 +_080F7C4C: + adds r0, r2, r5 + lsls r0, 3 + adds r0, r6 + lsrs r2, r3, 16 + ldr r1, [r1, 0x8] + adds r1, r2 +_080F7C58: + strh r1, [r0, 0xA] + ldr r0, [r4] + ldr r1, [r0] + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] +_080F7C64: + movs r0, 0x14 + add r10, r0 + ldr r1, [sp, 0x10] + movs r3, 0xC0 + lsls r3, 18 + adds r1, r3 + str r1, [sp, 0x10] + movs r4, 0x1 + add r9, r4 + mov r0, r9 + cmp r0, 0x3 + bgt _080F7C7E + b _080F7B68 +_080F7C7E: + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _080F7C8A + movs r0, 0x16 + bl audio_play +_080F7C8A: + ldr r3, [sp, 0x8] + cmp r3, 0 + beq _080F7C96 + movs r0, 0x15 + bl audio_play +_080F7C96: + 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_80F7A80 + + thumb_func_start sub_80F7CA8 +sub_80F7CA8: @ 80F7CA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r4, 0 + mov r9, r4 + ldr r1, _080F7CF0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r6, [r0, 0x8] + ldrh r7, [r0, 0xA] + ldrh r1, [r0, 0xC] + mov r12, r1 + movs r2, 0xC + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _080F7CF8 + ldr r2, _080F7CF4 + ldr r0, [r2] + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0xC + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r5, r1, 0 + cmp r0, 0 + bgt _080F7D10 + b _080F7D0E + .align 2, 0 +_080F7CF0: .4byte 0x03005e00 +_080F7CF4: .4byte 0x0203a034 +_080F7CF8: + ldr r2, _080F7D38 + ldr r0, [r2] + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0xC + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r5, r1, 0 + cmp r0, 0x57 + ble _080F7D10 +_080F7D0E: + movs r4, 0x1 +_080F7D10: + ldr r0, [r2] + ldr r0, [r0] + adds r0, 0xC + adds r2, r0, r5 + ldrh r3, [r2] + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r7, 16 + asrs r0, 16 + cmp r1, r0 + bne _080F7D2A + movs r1, 0x1 + mov r9, r1 +_080F7D2A: + mov r0, r9 + cmp r0, 0 + bne _080F7D4A + cmp r4, 0 + beq _080F7D3C + strh r7, [r2] + b _080F7D4A + .align 2, 0 +_080F7D38: .4byte 0x0203a034 +_080F7D3C: + mov r1, r12 + cmp r1, 0 + beq _080F7D46 + subs r0, r3, 0x1 + b _080F7D48 +_080F7D46: + adds r0, r3, 0x1 +_080F7D48: + strh r0, [r2] +_080F7D4A: + cmp r4, 0 + bne _080F7DC4 + mov r2, r9 + cmp r2, 0 + bne _080F7DCA + movs r2, 0 +_080F7D56: + ldr r0, _080F7D74 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0xC + adds r0, r5 + movs r1, 0 + ldrsh r3, [r0, r1] + adds r0, r2, 0x1 + lsls r1, r0, 3 + adds r4, r0, 0 + cmp r3, r1 + blt _080F7D78 + movs r0, 0x8 + b _080F7D94 + .align 2, 0 +_080F7D74: .4byte 0x0203a034 +_080F7D78: + lsls r0, r2, 3 + cmp r3, r0 + blt _080F7D92 + adds r0, r3, 0 + cmp r3, 0 + bge _080F7D86 + adds r0, r3, 0x7 +_080F7D86: + asrs r0, 3 + lsls r0, 3 + subs r0, r3, r0 + lsls r0, 24 + lsrs r0, 24 + b _080F7D94 +_080F7D92: + movs r0, 0 +_080F7D94: + cmp r0, 0x3 + bhi _080F7DA0 + ldr r3, _080F7D9C + b _080F7DA2 + .align 2, 0 +_080F7D9C: .4byte 0x0000504c +_080F7DA0: + ldr r3, _080F7DEC +_080F7DA2: + adds r1, r0, r3 + adds r2, 0x7 + lsls r2, 24 + lsrs r2, 24 + adds r3, r5, r6 + adds r3, 0x6 + lsls r3, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + lsrs r3, 24 + bl bg_fill_tilemap_rect + adds r2, r4, 0 + cmp r2, 0xA + ble _080F7D56 +_080F7DC4: + mov r0, r9 + cmp r0, 0 + beq _080F7DDC +_080F7DCA: + ldr r0, _080F7DF0 + ldr r0, [r0] + ldr r1, [r0] + ldrb r0, [r1, 0x14] + subs r0, 0x1 + strb r0, [r1, 0x14] + mov r0, r8 + bl remove_task +_080F7DDC: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F7DEC: .4byte 0x00005057 +_080F7DF0: .4byte 0x0203a034 + thumb_func_end sub_80F7CA8 + + thumb_func_start sub_80F7DF4 +sub_80F7DF4: @ 80F7DF4 + push {r4,r5,lr} + ldr r4, _080F7E60 + movs r0, 0x20 + bl malloc_and_clear + str r0, [r4] + movs r0, 0x18 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1] + movs r0, 0x50 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x4] + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x8] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0xC] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x10] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x14] + adds r0, r5, 0 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x18] + movs r0, 0x80 + lsls r0, 5 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x1C] + bl init_uns_table_pokemon_copy + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F7E60: .4byte 0x0203a034 + thumb_func_end sub_80F7DF4 + + thumb_func_start sub_80F7E64 +sub_80F7E64: @ 80F7E64 + push {r4,r5,lr} + ldr r5, _080F7ECC + ldr r0, [r5] + ldr r0, [r0] + bl free + ldr r0, [r5] + movs r4, 0 + str r4, [r0] + ldr r0, [r0, 0x4] + bl free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0, 0x8] + bl free + ldr r0, [r5] + str r4, [r0, 0x8] + ldr r0, [r0, 0xC] + bl free + ldr r0, [r5] + str r4, [r0, 0xC] + ldr r0, [r0, 0x10] + bl free + ldr r0, [r5] + str r4, [r0, 0x10] + ldr r0, [r0, 0x14] + bl free + ldr r0, [r5] + str r4, [r0, 0x14] + ldr r0, [r0, 0x18] + bl free + ldr r0, [r5] + str r4, [r0, 0x18] + ldr r0, [r0, 0x1C] + bl free + ldr r0, [r5] + str r4, [r0, 0x1C] + bl free + str r4, [r5] + bl sub_805F094 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F7ECC: .4byte 0x0203a034 + thumb_func_end sub_80F7E64 + + thumb_func_start sub_80F7ED0 +sub_80F7ED0: @ 80F7ED0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + str r1, [sp] + mov r0, sp + movs r3, 0 + strb r4, [r0, 0x4] + mov r1, sp + movs r0, 0x7 + strb r0, [r1, 0x5] + mov r0, sp + strb r2, [r0, 0x6] + movs r1, 0x2 + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x12 + 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 r1, sp + movs r0, 0x80 + strb r0, [r1, 0xD] + mov r0, sp + movs r1, 0 + movs r2, 0 + bl remo_copy + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80F7ED0 + + thumb_func_start sub_80F7F30 +sub_80F7F30: @ 80F7F30 + push {r4,r5,lr} + ldr r0, _080F7F68 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080F7F6C + adds r0, r1 + bl sub_80DAE0C + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + cmp r5, 0 + beq _080F7F5E + ldr r4, _080F7F70 + ldrb r0, [r4] + ldr r1, _080F7F74 + ldrb r1, [r1] + bl sub_80DAB8C + ldrb r0, [r4] + bl sub_80DB09C +_080F7F5E: + ldr r0, _080F7F78 + strh r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F7F68: .4byte 0x02039f24 +_080F7F6C: .4byte 0x020244ec +_080F7F70: .4byte 0x02039f2c +_080F7F74: .4byte 0x02039f2e +_080F7F78: .4byte 0x020375f0 + thumb_func_end sub_80F7F30 + + thumb_func_start sub_80F7F7C +sub_80F7F7C: @ 80F7F7C + push {r4,lr} + movs r4, 0 + ldr r0, _080F7FA0 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _080F7FA4 + adds r2, r1, r0 + ldr r0, _080F7FA8 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080F7FEE + lsls r0, 2 + ldr r1, _080F7FAC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F7FA0: .4byte 0x02039f24 +_080F7FA4: .4byte 0x020244ec +_080F7FA8: .4byte 0x02039f2c +_080F7FAC: .4byte _080F7FB0 + .align 2, 0 +_080F7FB0: + .4byte _080F7FC4 + .4byte _080F7FCA + .4byte _080F7FD0 + .4byte _080F7FD6 + .4byte _080F7FDC +_080F7FC4: + adds r0, r2, 0 + movs r1, 0x32 + b _080F7FE0 +_080F7FCA: + adds r0, r2, 0 + movs r1, 0x33 + b _080F7FE0 +_080F7FD0: + adds r0, r2, 0 + movs r1, 0x34 + b _080F7FE0 +_080F7FD6: + adds r0, r2, 0 + movs r1, 0x35 + b _080F7FE0 +_080F7FDC: + adds r0, r2, 0 + movs r1, 0x36 +_080F7FE0: + bl pokemon_getattr + ldr r1, _080F7FF8 + ldrh r1, [r1] + cmp r0, r1 + bls _080F7FEE + movs r4, 0x1 +_080F7FEE: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080F7FF8: .4byte 0x02039f2e + thumb_func_end sub_80F7F7C + + thumb_func_start sub_80F7FFC +sub_80F7FFC: @ 80F7FFC + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _080F8024 + ldr r0, _080F8028 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080F8010 + b _080F8250 +_080F8010: + ldr r0, _080F802C + ldrh r0, [r0] + cmp r0, 0x4 + bls _080F801A + b _080F8250 +_080F801A: + lsls r0, 2 + ldr r1, _080F8030 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F8024: .4byte 0x02039f20 +_080F8028: .4byte 0x02039f25 +_080F802C: .4byte 0x02039f2c +_080F8030: .4byte _080F8034 + .align 2, 0 +_080F8034: + .4byte _080F8048 + .4byte _080F80B8 + .4byte _080F8124 + .4byte _080F8190 + .4byte _080F81F8 +_080F8048: + ldr r6, _080F80AC + ldrb r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, _080F80B0 + adds r0, r4 + movs r1, 0x32 + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + mov r0, sp + strb r1, [r0] + ldr r0, _080F80B4 + ldrh r0, [r0] + cmp r1, r0 + bls _080F806C + b _080F8250 +_080F806C: + adds r0, r1, 0 + cmp r0, 0x3 + bls _080F8074 + b _080F8250 +_080F8074: + adds r1, r0, 0x1 + mov r0, sp + strb r1, [r0] + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x32 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080F809C + b _080F8250 +_080F809C: + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x32 + bl sub_80EE4DC + b _080F8250 + .align 2, 0 +_080F80AC: .4byte 0x02039f24 +_080F80B0: .4byte 0x020244ec +_080F80B4: .4byte 0x02039f2e +_080F80B8: + mov r4, sp + ldr r7, _080F8118 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080F811C + adds r0, r5 + movs r1, 0x33 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, _080F8120 + ldrh r0, [r0] + cmp r2, r0 + bls _080F80DC + b _080F8250 +_080F80DC: + cmp r2, 0x3 + bls _080F80E2 + b _080F8250 +_080F80E2: + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x33 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080F810A + b _080F8250 +_080F810A: + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x33 + bl sub_80EE4DC + b _080F8250 + .align 2, 0 +_080F8118: .4byte 0x02039f24 +_080F811C: .4byte 0x020244ec +_080F8120: .4byte 0x02039f2e +_080F8124: + mov r4, sp + ldr r7, _080F8184 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080F8188 + adds r0, r5 + movs r1, 0x34 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, _080F818C + ldrh r0, [r0] + cmp r2, r0 + bls _080F8148 + b _080F8250 +_080F8148: + cmp r2, 0x3 + bls _080F814E + b _080F8250 +_080F814E: + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x34 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8250 + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x34 + bl sub_80EE4DC + b _080F8250 + .align 2, 0 +_080F8184: .4byte 0x02039f24 +_080F8188: .4byte 0x020244ec +_080F818C: .4byte 0x02039f2e +_080F8190: + mov r4, sp + ldr r7, _080F81EC + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080F81F0 + adds r0, r5 + movs r1, 0x35 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, _080F81F4 + ldrh r0, [r0] + cmp r2, r0 + bhi _080F8250 + cmp r2, 0x3 + bhi _080F8250 + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x35 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8250 + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x35 + bl sub_80EE4DC + b _080F8250 + .align 2, 0 +_080F81EC: .4byte 0x02039f24 +_080F81F0: .4byte 0x020244ec +_080F81F4: .4byte 0x02039f2e +_080F81F8: + mov r4, sp + ldr r7, _080F8258 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _080F825C + adds r0, r5 + movs r1, 0x36 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, _080F8260 + ldrh r0, [r0] + cmp r2, r0 + bhi _080F8250 + cmp r2, 0x3 + bhi _080F8250 + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x36 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8250 + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x36 + bl sub_80EE4DC +_080F8250: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F8258: .4byte 0x02039f24 +_080F825C: .4byte 0x020244ec +_080F8260: .4byte 0x02039f2e + thumb_func_end sub_80F7FFC + + thumb_func_start sub_80F8264 +sub_80F8264: @ 80F8264 + push {r4,lr} + ldr r4, _080F8284 + ldr r0, _080F8288 + ldrh r1, [r0] + lsls r1, 6 + ldr r0, _080F828C + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + bl sub_81DB5AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F8284: .4byte 0x02021cc4 +_080F8288: .4byte 0x020375e4 +_080F828C: .4byte 0x02039e0d + thumb_func_end sub_80F8264 + + thumb_func_start sub_80F8290 +sub_80F8290: @ 80F8290 + push {lr} + ldr r0, _080F82A8 + ldr r1, _080F82AC + ldrh r1, [r1] + lsls r1, 6 + ldr r2, _080F82B0 + adds r1, r2 + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_080F82A8: .4byte 0x02021ec4 +_080F82AC: .4byte 0x020375e4 +_080F82B0: .4byte 0x02039e02 + thumb_func_end sub_80F8290 + + thumb_func_start sub_80F82B4 +sub_80F82B4: @ 80F82B4 + push {r4-r6,lr} + movs r1, 0 + movs r2, 0 + ldr r5, _080F82F0 + ldr r4, _080F82F4 + ldr r0, _080F82F8 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r4 + movs r6, 0 + ldrsh r3, [r0, r6] +_080F82CA: + lsls r0, r1, 1 + adds r0, r4 + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r3, r0 + bge _080F82DC + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080F82DC: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080F82CA + strh r2, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F82F0: .4byte 0x020375e0 +_080F82F4: .4byte 0x02039f00 +_080F82F8: .4byte 0x020375e4 + thumb_func_end sub_80F82B4 + + thumb_func_start sub_80F82FC +sub_80F82FC: @ 80F82FC + ldr r2, _080F8310 + ldr r1, _080F8314 + ldr r0, _080F8318 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_080F8310: .4byte 0x020375e0 +_080F8314: .4byte 0x02039f00 +_080F8318: .4byte 0x020375e4 + thumb_func_end sub_80F82FC + + thumb_func_start sub_80F831C +sub_80F831C: @ 80F831C + push {lr} + movs r1, 0 + ldr r2, _080F8344 + ldrb r0, [r2] + ldr r3, _080F8348 + cmp r0, 0 + beq _080F833C +_080F832A: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _080F833C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080F832A +_080F833C: + strh r1, [r3] + pop {r0} + bx r0 + .align 2, 0 +_080F8344: .4byte 0x02039f20 +_080F8348: .4byte 0x020375e2 + thumb_func_end sub_80F831C + + thumb_func_start sub_80F834C +sub_80F834C: @ 80F834C + push {r4,lr} + movs r1, 0 + ldr r2, _080F8384 + ldrb r0, [r2] + ldr r4, _080F8388 + ldr r3, _080F838C + cmp r0, 0 + beq _080F836E +_080F835C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _080F836E + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080F835C +_080F836E: + lsls r1, 6 + adds r1, r3 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + bl sub_81DB5AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F8384: .4byte 0x02039f20 +_080F8388: .4byte 0x02021ec4 +_080F838C: .4byte 0x02039e0d + thumb_func_end sub_80F834C + + thumb_func_start sub_80F8390 +sub_80F8390: @ 80F8390 + push {r4,lr} + movs r1, 0 + ldr r2, _080F83C4 + ldrb r0, [r2] + ldr r4, _080F83C8 + ldr r3, _080F83CC + cmp r0, 0 + beq _080F83B2 +_080F83A0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _080F83B2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080F83A0 +_080F83B2: + lsls r1, 6 + adds r1, r3 + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F83C4: .4byte 0x02039f20 +_080F83C8: .4byte 0x02021cc4 +_080F83CC: .4byte 0x02039e02 + thumb_func_end sub_80F8390 + + thumb_func_start sub_80F83D0 +sub_80F83D0: @ 80F83D0 + push {lr} + ldr r0, _080F83DC + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080F83DC: .4byte sub_80D7B24 + 1 + thumb_func_end sub_80F83D0 + + thumb_func_start sub_80F83E0 +sub_80F83E0: @ 80F83E0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080F8404 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080F83FE + adds r0, r2, 0 + bl remove_task + ldr r0, _080F8408 + bl set_callback2 +_080F83FE: + pop {r0} + bx r0 + .align 2, 0 +_080F8404: .4byte 0x02037fd4 +_080F8408: .4byte sub_80F83D0 + 1 + thumb_func_end sub_80F83E0 + + thumb_func_start sub_80F840C +sub_80F840C: @ 80F840C + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, _080F8434 + movs r1, 0xA + bl AddTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080F8434: .4byte sub_80F83E0 + 1 + thumb_func_end sub_80F840C + + thumb_func_start sub_80F8438 +sub_80F8438: @ 80F8438 + ldr r2, _080F844C + ldr r1, _080F8450 + ldr r0, _080F8454 + ldrh r0, [r0] + lsls r0, 6 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_080F844C: .4byte 0x020375e0 +_080F8450: .4byte 0x02039e00 +_080F8454: .4byte 0x020375e4 + thumb_func_end sub_80F8438 + + thumb_func_start sub_80F8458 +sub_80F8458: @ 80F8458 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080F847C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080F8476 + adds r0, r2, 0 + bl remove_task + ldr r0, _080F8480 + bl set_callback2 +_080F8476: + pop {r0} + bx r0 + .align 2, 0 +_080F847C: .4byte 0x02037fd4 +_080F8480: .4byte sub_80F5B00 + 1 + thumb_func_end sub_80F8458 + + thumb_func_start sub_80F8484 +sub_80F8484: @ 80F8484 + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, _080F84AC + movs r1, 0xA + bl AddTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080F84AC: .4byte sub_80F8458 + 1 + thumb_func_end sub_80F8484 + + thumb_func_start sub_80F84B0 +sub_80F84B0: @ 80F84B0 + ldr r0, _080F84BC + ldr r1, _080F84C0 + ldrb r1, [r1] + strh r1, [r0] + bx lr + .align 2, 0 +_080F84BC: .4byte 0x020375e0 +_080F84C0: .4byte 0x02039f25 + thumb_func_end sub_80F84B0 + + thumb_func_start sub_80F84C4 +sub_80F84C4: @ 80F84C4 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl script_env_2_enable + ldr r6, _080F84FC + adds r0, r6, 0 + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r2, _080F8500 + adds r0, r4, 0 + adds r1, r6, 0 + bl set_task_function_and_args_14_15 + ldr r1, _080F8504 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x1A] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F84FC: .4byte sub_80FC580 + 1 +_080F8500: .4byte sub_80F8508 + 1 +_080F8504: .4byte 0x03005e00 + thumb_func_end sub_80F84C4 + + thumb_func_start sub_80F8508 +sub_80F8508: @ 80F8508 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080F8530 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080F8540 + ldr r0, _080F8534 + ldrb r0, [r0] + bl sub_80DA8C8 + ldr r1, _080F8538 + ldr r2, _080F853C + adds r0, r4, 0 + bl set_task_function_and_args_14_15 + b _080F8556 + .align 2, 0 +_080F8530: .4byte 0x02039f2a +_080F8534: .4byte 0x02039f24 +_080F8538: .4byte sub_80FC6BC + 1 +_080F853C: .4byte sub_80F8568 + 1 +_080F8540: + ldr r0, _080F855C + ldrb r0, [r0] + bl sub_80DA8C8 + ldr r1, _080F8560 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080F8564 + str r1, [r0] +_080F8556: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F855C: .4byte 0x02039f24 +_080F8560: .4byte 0x03005e00 +_080F8564: .4byte sub_81D9DE4 + 1 + thumb_func_end sub_80F8508 + + thumb_func_start sub_80F8568 +sub_80F8568: @ 80F8568 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080F857C + ldr r2, _080F8580 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_080F857C: .4byte sub_80FC804 + 1 +_080F8580: .4byte sub_80F8584 + 1 + thumb_func_end sub_80F8568 + + thumb_func_start sub_80F8584 +sub_80F8584: @ 80F8584 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080F8598 + ldr r2, _080F859C + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_080F8598: .4byte sub_80FCE48 + 1 +_080F859C: .4byte sub_80F85A0 + 1 + thumb_func_end sub_80F8584 + + thumb_func_start sub_80F85A0 +sub_80F85A0: @ 80F85A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080F85B4 + ldr r2, _080F85B8 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_080F85B4: .4byte sub_80FC894 + 1 +_080F85B8: .4byte sub_80F85BC + 1 + thumb_func_end sub_80F85A0 + + thumb_func_start sub_80F85BC +sub_80F85BC: @ 80F85BC + 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, _080F8638 + mov r12, r5 + ldr r0, _080F863C + mov r9, r0 + add r1, sp, 0x4 + mov r8, r1 + ldrb r0, [r5] + cmp r3, r0 + bcs _080F8606 + lsls r0, r6, 2 + adds r0, r6 + lsls r4, r0, 3 + ldr r7, _080F8640 +_080F85EC: + mov r1, sp + adds r2, r1, 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 r0, [r5] + cmp r3, r0 + bcc _080F85EC +_080F8606: + movs r3, 0 + mov r1, r12 + ldrb r0, [r1] + cmp r3, r0 + bcs _080F862A + adds r4, r0, 0 + mov r2, sp +_080F8614: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _080F862A + mov r0, sp + adds r1, r0, r3 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + beq _080F8614 +_080F862A: + mov r1, r12 + ldrb r1, [r1] + cmp r3, r1 + bne _080F8644 + movs r0, 0 + b _080F8646 + .align 2, 0 +_080F8638: .4byte 0x02039f30 +_080F863C: .4byte 0x020375e0 +_080F8640: .4byte 0x03005e08 +_080F8644: + movs r0, 0x1 +_080F8646: + mov r1, r9 + strh r0, [r1] + movs r3, 0 + mov r4, r12 + ldrb r0, [r4] + cmp r3, r0 + bcs _080F8678 + mov r5, r8 + lsls r0, r6, 2 + adds r0, r6 + lsls r2, r0, 3 + ldr r7, _080F86A4 +_080F865E: + adds r1, r5, r3 + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r2 + adds r0, r7 + ldrh r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r1, [r4] + cmp r3, r1 + bcc _080F865E +_080F8678: + mov r0, r8 + bl sub_80F86E0 + ldr r1, _080F86A8 + strb r0, [r1] + ldr r0, _080F86AC + ldrb r0, [r0] + bl sub_80DB09C + ldr r1, _080F86B0 + ldr r2, _080F86B4 + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F86A4: .4byte 0x03005e08 +_080F86A8: .4byte 0x02039f2b +_080F86AC: .4byte 0x02039f2c +_080F86B0: .4byte sub_80FCF40 + 1 +_080F86B4: .4byte sub_80F86B8 + 1 + thumb_func_end sub_80F85BC + + thumb_func_start sub_80F86B8 +sub_80F86B8: @ 80F86B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_80DCE58 + ldr r1, _080F86D8 + ldr r2, _080F86DC + adds r0, r4, 0 + bl set_task_function_and_args_14_15 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F86D8: .4byte sub_80FCFD0 + 1 +_080F86DC: .4byte sub_80F8714 + 1 + thumb_func_end sub_80F86B8 + + thumb_func_start sub_80F86E0 +sub_80F86E0: @ 80F86E0 + push {r4,r5,lr} + adds r3, r0, 0 + movs r4, 0 + movs r2, 0x1 + ldr r0, _080F8710 + ldrb r0, [r0] + cmp r2, r0 + bge _080F8708 + adds r5, r0, 0 +_080F86F2: + adds r0, r3, r4 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080F8702 + lsls r0, r2, 24 + lsrs r4, r0, 24 +_080F8702: + adds r2, 0x1 + cmp r2, r5 + blt _080F86F2 +_080F8708: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080F8710: .4byte 0x02039f30 + thumb_func_end sub_80F86E0 + + thumb_func_start sub_80F8714 +sub_80F8714: @ 80F8714 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _080F873C + ldrh r0, [r0] + cmp r0, 0x1 + bne _080F8748 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F877E + ldr r0, _080F8740 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _080F8744 + str r0, [r1] + b _080F877E + .align 2, 0 +_080F873C: .4byte 0x020375e0 +_080F8740: .4byte 0x03005e00 +_080F8744: .4byte sub_80F878C + 1 +_080F8748: + ldr r5, _080F8784 + movs r4, 0x3 +_080F874C: + adds r0, r5, 0 + bl get_end_of_string_ptr_limit_10_chars + adds r5, 0x40 + subs r4, 0x1 + cmp r4, 0 + bge _080F874C + adds r0, r6, 0 + bl remove_task + ldr r0, _080F8788 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running +_080F877E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F8784: .4byte 0x02039e02 +_080F8788: .4byte 0x03005d8c + thumb_func_end sub_80F8714 + + thumb_func_start sub_80F878C +sub_80F878C: @ 80F878C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800AC34 + ldr r1, _080F87AC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080F87B0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F87AC: .4byte 0x03005e00 +_080F87B0: .4byte sub_80F87B4 + 1 + thumb_func_end sub_80F878C + + thumb_func_start sub_80F87B4 +sub_80F87B4: @ 80F87B4 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _080F87D4 + ldrb r0, [r0] + cmp r0, 0 + bne _080F87D0 + adds r0, r1, 0 + bl remove_task + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running +_080F87D0: + pop {r0} + bx r0 + .align 2, 0 +_080F87D4: .4byte 0x03003124 + thumb_func_end sub_80F87B4 + + thumb_func_start sub_80F87D8 +sub_80F87D8: @ 80F87D8 + push {r4,lr} + ldr r0, _080F8808 + ldr r2, [r0] + ldr r1, _080F880C + ldrb r3, [r1, 0x15] + ldr r4, _080F8810 + adds r0, r2, r4 + strh r3, [r0] + adds r0, r1, 0 + adds r0, 0x55 + ldrb r3, [r0] + adds r4, 0x2 + adds r0, r2, r4 + strh r3, [r0] + adds r1, 0x95 + ldrb r0, [r1] + movs r1, 0x9E + lsls r1, 5 + adds r2, r1 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F8808: .4byte 0x03005d8c +_080F880C: .4byte 0x02039e00 +_080F8810: .4byte 0x000013bc + thumb_func_end sub_80F87D8 + + thumb_func_start sub_80F8814 +sub_80F8814: @ 80F8814 + push {lr} + ldr r0, _080F882C + ldrb r0, [r0] + adds r1, r0, 0 + cmp r0, 0x1 + beq _080F883A + cmp r0, 0x1 + bgt _080F8830 + cmp r0, 0 + beq _080F8836 + b _080F8842 + .align 2, 0 +_080F882C: .4byte 0x020375e2 +_080F8830: + cmp r1, 0x2 + beq _080F883E + b _080F8842 +_080F8836: + movs r1, 0x3 + b _080F8844 +_080F883A: + movs r1, 0x4 + b _080F8844 +_080F883E: + movs r1, 0x5 + b _080F8844 +_080F8842: + movs r1, 0x64 +_080F8844: + ldr r0, _080F884C + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080F884C: .4byte 0x020375e0 + thumb_func_end sub_80F8814 + + thumb_func_start sub_80F8850 +sub_80F8850: @ 80F8850 + push {lr} + bl sub_80F8264 + bl sub_80F8290 + bl sub_80F8438 + pop {r0} + bx r0 + thumb_func_end sub_80F8850 + + thumb_func_start sub_80F8864 +sub_80F8864: @ 80F8864 + push {lr} + ldr r0, _080F8878 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080F88A4 + lsls r0, 2 + ldr r1, _080F887C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F8878: .4byte 0x02039f2c +_080F887C: .4byte _080F8880 + .align 2, 0 +_080F8880: + .4byte _080F8894 + .4byte _080F8898 + .4byte _080F889C + .4byte _080F88A0 + .4byte _080F88A4 +_080F8894: + movs r1, 0x8 + b _080F88A6 +_080F8898: + movs r1, 0x9 + b _080F88A6 +_080F889C: + movs r1, 0xA + b _080F88A6 +_080F88A0: + movs r1, 0xB + b _080F88A6 +_080F88A4: + movs r1, 0xC +_080F88A6: + ldr r0, _080F88C0 + ldr r0, [r0] + lsls r1, 5 + adds r0, r1 + ldr r1, _080F88C4 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + bne _080F88CC + ldr r0, _080F88C8 + strh r1, [r0] + b _080F88D2 + .align 2, 0 +_080F88C0: .4byte 0x03005d8c +_080F88C4: .4byte 0x00002e98 +_080F88C8: .4byte 0x020375e0 +_080F88CC: + ldr r1, _080F88D8 + movs r0, 0x1 + strh r0, [r1] +_080F88D2: + pop {r0} + bx r0 + .align 2, 0 +_080F88D8: .4byte 0x020375e0 + thumb_func_end sub_80F8864 + + thumb_func_start sub_80F88DC +sub_80F88DC: @ 80F88DC + push {lr} + movs r0, 0xFF + bl sub_80DEDA8 + pop {r0} + bx r0 + thumb_func_end sub_80F88DC + + thumb_func_start sub_80F88E8 +sub_80F88E8: @ 80F88E8 + push {lr} + ldr r0, _080F8918 + ldr r1, _080F891C + ldrb r2, [r1] + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _080F8930 + ldr r0, _080F8920 + ldrh r0, [r0] + cmp r0, 0x3 + bne _080F8930 + ldr r1, _080F8924 + lsls r0, r2, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, _080F8928 + cmp r1, r0 + ble _080F8930 + ldr r1, _080F892C + movs r0, 0x1 + b _080F8934 + .align 2, 0 +_080F8918: .4byte 0x02039f20 +_080F891C: .4byte 0x02039f25 +_080F8920: .4byte 0x02039f2e +_080F8924: .4byte 0x02039f08 +_080F8928: .4byte 0x0000031f +_080F892C: .4byte 0x020375e0 +_080F8930: + ldr r1, _080F893C + movs r0, 0 +_080F8934: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080F893C: .4byte 0x020375e0 + thumb_func_end sub_80F88E8 + + thumb_func_start sub_80F8940 +sub_80F8940: @ 80F8940 + push {lr} + movs r3, 0 + ldr r0, _080F8968 + ldr r0, [r0] + ldr r2, _080F896C + adds r1, r0, r2 + movs r2, 0x4 +_080F894E: + ldrh r0, [r1] + cmp r0, 0 + beq _080F895A + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080F895A: + adds r1, 0x20 + subs r2, 0x1 + cmp r2, 0 + bge _080F894E + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_080F8968: .4byte 0x03005d8c +_080F896C: .4byte 0x00002f98 + thumb_func_end sub_80F8940 + + thumb_func_start sub_80F8970 +sub_80F8970: @ 80F8970 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, _080F8A44 + mov r12, r0 + ldr r1, _080F8A48 + mov r9, r1 + ldr r2, _080F8A4C + mov r10, r2 + mov r2, r12 + mov r1, sp + movs r6, 0x3 +_080F898E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _080F898E + movs r6, 0 +_080F899E: + movs r1, 0x3 + cmp r1, r6 + ble _080F89C8 +_080F89A4: + subs r5, r1, 0x1 + lsls r0, r5, 1 + mov r4, sp + adds r3, r4, r0 + lsls r0, r1, 1 + adds r2, r4, r0 + ldrh r4, [r3] + movs r7, 0 + ldrsh r1, [r3, r7] + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _080F89C2 + strh r4, [r2] + strh r0, [r3] +_080F89C2: + adds r1, r5, 0 + cmp r1, r6 + bgt _080F89A4 +_080F89C8: + adds r6, 0x1 + cmp r6, 0x2 + ble _080F899E + mov r2, r9 + ldrh r0, [r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + movs r2, 0 + mov r8, r2 + movs r6, 0 + lsls r0, 16 + asrs r4, r0, 16 + adds r3, r0, 0 + mov r1, sp + mov r5, r9 +_080F89E8: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, r4 + bne _080F8A02 + lsls r0, r2, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r2, r0, 24 + ldrh r7, [r5] + cmp r6, r7 + bne _080F8A02 + mov r8, r2 +_080F8A02: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080F89E8 + movs r6, 0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + asrs r1, r3, 16 + lsls r2, 24 + mov r9, r2 + cmp r0, r1 + beq _080F8A30 + adds r2, r1, 0 + mov r1, sp +_080F8A20: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + bgt _080F8A30 + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, r2 + bne _080F8A20 +_080F8A30: + lsls r0, r6, 24 + lsrs r7, r0, 24 + mov r2, r8 + movs r6, 0 + asrs r1, r3, 16 + mov r5, r12 + movs r4, 0 + ldrsh r0, [r5, r4] + b _080F8A66 + .align 2, 0 +_080F8A44: .4byte 0x02039f00 +_080F8A48: .4byte 0x020375e4 +_080F8A4C: .4byte 0x02039e02 +_080F8A50: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080F8A56: + adds r6, 0x1 + cmp r6, 0x3 + bgt _080F8A6E + lsls r0, r6, 1 + add r0, r12 + asrs r1, r3, 16 + movs r5, 0 + ldrsh r0, [r0, r5] +_080F8A66: + cmp r1, r0 + bne _080F8A56 + cmp r2, 0x1 + bne _080F8A50 +_080F8A6E: + lsls r4, r6, 6 + mov r0, r10 + adds r1, r4, r0 + ldr r0, _080F8AA4 + bl gf_strcpy + ldr r5, _080F8AA8 + mov r0, r10 + adds r0, 0xB + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl gf_strcpy + adds r0, r5, 0 + bl sub_81DB5AC + mov r1, r9 + asrs r0, r1, 24 + cmp r0, 0x1 + beq _080F8A9C + cmp r8, r0 + bne _080F8AB0 +_080F8A9C: + ldr r0, _080F8AAC + strh r7, [r0] + b _080F8AB6 + .align 2, 0 +_080F8AA4: .4byte 0x02021cc4 +_080F8AA8: .4byte 0x02021dc4 +_080F8AAC: .4byte 0x020375e4 +_080F8AB0: + ldr r1, _080F8AC8 + adds r0, r7, 0x4 + strh r0, [r1] +_080F8AB6: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F8AC8: .4byte 0x020375e4 + thumb_func_end sub_80F8970 + + thumb_func_start sub_80F8ACC +sub_80F8ACC: @ 80F8ACC + push {lr} + ldr r0, _080F8AD8 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080F8AD8: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80F8ACC + + thumb_func_start sub_80F8ADC +sub_80F8ADC: @ 80F8ADC + push {lr} + ldr r0, _080F8AF0 + bl set_callback2 + ldr r1, _080F8AF4 + ldr r0, _080F8AF8 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_080F8AF0: .4byte sub_812FDEC + 1 +_080F8AF4: .4byte 0x030022c0 +_080F8AF8: .4byte sub_80F8ACC + 1 + thumb_func_end sub_80F8ADC + + thumb_func_start sub_80F8AFC +sub_80F8AFC: @ 80F8AFC + push {r4,r5,lr} + ldr r0, _080F8B30 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8B7C + movs r3, 0 + ldr r0, _080F8B34 + adds r4, r0, 0 + ldr r5, _080F8B38 + ldrb r0, [r4] + cmp r3, r0 + bge _080F8B50 + adds r2, r5, 0 + ldr r1, _080F8B3C +_080F8B1C: + ldrb r0, [r1] + subs r0, 0x1 + cmp r0, 0x1 + bhi _080F8B44 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080F8B40 + movs r0, 0xEB + b _080F8B42 + .align 2, 0 +_080F8B30: .4byte 0x02039f2a +_080F8B34: .4byte 0x02039f30 +_080F8B38: .4byte 0x02039e00 +_080F8B3C: .4byte 0x020229e8 +_080F8B40: + movs r0, 0xEC +_080F8B42: + strb r0, [r2, 0x15] +_080F8B44: + adds r2, 0x40 + adds r1, 0x1C + adds r3, 0x1 + ldrb r0, [r4] + cmp r3, r0 + blt _080F8B1C +_080F8B50: + ldr r0, _080F8B84 + ldrb r1, [r5, 0x15] + bl var_set + ldr r0, _080F8B88 + adds r1, r5, 0 + adds r1, 0x55 + ldrb r1, [r1] + bl var_set + ldr r0, _080F8B8C + adds r1, r5, 0 + adds r1, 0x95 + ldrb r1, [r1] + bl var_set + ldr r0, _080F8B90 + adds r1, r5, 0 + adds r1, 0xD5 + ldrb r1, [r1] + bl var_set +_080F8B7C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F8B84: .4byte 0x00004010 +_080F8B88: .4byte 0x00004011 +_080F8B8C: .4byte 0x00004012 +_080F8B90: .4byte 0x00004013 + thumb_func_end sub_80F8AFC + + thumb_func_start sub_80F8B94 +sub_80F8B94: @ 80F8B94 + push {r4-r7,lr} + ldr r1, _080F8C08 + movs r0, 0xC + strb r0, [r1] + ldr r0, _080F8C0C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8C6E + movs r5, 0 + ldr r0, _080F8C10 + ldrb r0, [r0] + cmp r5, r0 + bge _080F8C6E + movs r7, 0 + movs r6, 0x60 + movs r4, 0xB0 + lsls r4, 17 +_080F8BBA: + ldr r0, _080F8C14 + adds r0, r5, r0 + ldrb r0, [r0] + ldr r1, _080F8C18 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080F8C1C + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _080F8C20 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r6 + strb r0, [r1, 0x5] + ldr r0, _080F8C24 + adds r1, r7, r0 + ldrb r0, [r1] + subs r0, 0x1 + cmp r0, 0x1 + bhi _080F8C38 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080F8C2C + lsrs r1, r4, 16 + ldr r0, _080F8C28 + b _080F8C42 + .align 2, 0 +_080F8C08: .4byte 0x0300301c +_080F8C0C: .4byte 0x02039f2a +_080F8C10: .4byte 0x02039f30 +_080F8C14: .4byte 0x0858d8ec +_080F8C18: .4byte 0x03005d8c +_080F8C1C: .4byte 0x02037350 +_080F8C20: .4byte 0x02020630 +_080F8C24: .4byte 0x020229e8 +_080F8C28: .4byte 0x08499a18 +_080F8C2C: + lsrs r1, r4, 16 + ldr r0, _080F8C34 + b _080F8C42 + .align 2, 0 +_080F8C34: .4byte 0x084a54b8 +_080F8C38: + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080F8C50 + lsrs r1, r4, 16 + ldr r0, _080F8C4C +_080F8C42: + movs r2, 0x20 + bl gpu_pal_apply + b _080F8C5A + .align 2, 0 +_080F8C4C: .4byte 0x084987f8 +_080F8C50: + lsrs r1, r4, 16 + ldr r0, _080F8C74 + movs r2, 0x20 + bl gpu_pal_apply +_080F8C5A: + movs r0, 0x80 + lsls r0, 13 + adds r4, r0 + adds r7, 0x1C + adds r6, 0x10 + adds r5, 0x1 + ldr r0, _080F8C78 + ldrb r0, [r0] + cmp r5, r0 + blt _080F8BBA +_080F8C6E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F8C74: .4byte 0x084a4278 +_080F8C78: .4byte 0x02039f30 + thumb_func_end sub_80F8B94 + + thumb_func_start sub_80F8C7C +sub_80F8C7C: @ 80F8C7C + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _080F8CFC + ldrb r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, _080F8D00 + adds r0, r4 + movs r1, 0x46 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0 + bne _080F8D18 + ldr r0, _080F8D04 + ldr r1, _080F8D08 + ldrb r2, [r1] + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _080F8D18 + ldr r0, _080F8D0C + ldrh r0, [r0] + cmp r0, 0x3 + bne _080F8D18 + ldr r1, _080F8D10 + lsls r0, r2, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, _080F8D14 + cmp r1, r0 + ble _080F8D18 + movs r1, 0x1 + mov r0, sp + strb r1, [r0] + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x46 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8CF6 + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x46 + bl sub_80EE4DC +_080F8CF6: + movs r0, 0x1 + b _080F8D1A + .align 2, 0 +_080F8CFC: .4byte 0x02039f24 +_080F8D00: .4byte 0x020244ec +_080F8D04: .4byte 0x02039f20 +_080F8D08: .4byte 0x02039f25 +_080F8D0C: .4byte 0x02039f2e +_080F8D10: .4byte 0x02039f08 +_080F8D14: .4byte 0x0000031f +_080F8D18: + movs r0, 0 +_080F8D1A: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F8C7C + + thumb_func_start sub_80F8D24 +sub_80F8D24: @ 80F8D24 + movs r0, 0 + bx lr + thumb_func_end sub_80F8D24 + + thumb_func_start sub_80F8D28 +sub_80F8D28: @ 80F8D28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, _080F8DA8 + adds r0, r7, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080F8D44 + b _080F8E9C +_080F8D44: + bl init_uns_table_pokemon_copy + movs r0, 0xA + mov r9, r0 + movs r1, 0x3 + mov r10, r1 + ldr r2, _080F8DAC + ldr r4, _080F8DB0 + ldrh r1, [r4] + lsls r1, 6 + adds r0, r1, r2 + ldrh r6, [r0] + adds r0, r2, 0 + adds r0, 0x38 + adds r0, r1, r0 + ldr r5, [r0] + adds r2, 0x3C + adds r1, r2 + ldr r1, [r1] + mov r8, r1 + adds r0, r7, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _080F8DB4 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r6, [r0, 0xA] + ldr r1, _080F8DB8 + ldrh r0, [r4] + ldrb r1, [r1] + cmp r0, r1 + bne _080F8DC4 + lsls r0, r6, 3 + ldr r1, _080F8DBC + adds r0, r1 + ldr r1, _080F8DC0 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r5, 0 + bl help_system_enable_unless_flashback__sp199 + b _080F8DD8 + .align 2, 0 +_080F8DA8: .4byte sub_80F8EE8 + 1 +_080F8DAC: .4byte 0x02039e00 +_080F8DB0: .4byte 0x020375e4 +_080F8DB4: .4byte 0x03005e00 +_080F8DB8: .4byte 0x02039f25 +_080F8DBC: .4byte 0x0830a18c +_080F8DC0: .4byte 0x020244d4 +_080F8DC4: + lsls r0, r6, 3 + ldr r1, _080F8E44 + adds r0, r1 + ldr r1, _080F8E48 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_8034B50 +_080F8DD8: + adds r0, r6, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_806E7CC + adds r4, r0, 0 + bl gpu_pal_obj_decompress_and_apply + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, _080F8E4C + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x2] + mov r1, r9 + adds r1, 0x1 + lsls r1, 19 + movs r2, 0x80 + lsls r2, 14 + adds r1, r2 + asrs r1, 16 + mov r3, r10 + lsls r2, r3, 19 + movs r3, 0xA0 + lsls r3, 14 + adds r2, r3 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080F8E50 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8E58 + movs r0, 0x4 + ands r0, r1 + lsls r4, r5, 4 + cmp r0, 0 + bne _080F8E6C + adds r0, r4, r5 + lsls r0, 2 + ldr r1, _080F8E54 + adds r0, r1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 + b _080F8E6C + .align 2, 0 +_080F8E44: .4byte 0x0830a18c +_080F8E48: .4byte 0x020244d4 +_080F8E4C: .4byte 0x0202499c +_080F8E50: .4byte 0x02039f2a +_080F8E54: .4byte 0x02020630 +_080F8E58: + lsls r4, r5, 4 + adds r0, r4, r5 + lsls r0, 2 + ldr r1, _080F8EAC + adds r0, r1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 +_080F8E6C: + ldr r1, _080F8EB0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + mov r2, r10 + strh r2, [r0, 0x10] + ldr r3, _080F8EAC + adds r1, r4, r5 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, _080F8EB4 + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_080F8E9C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F8EAC: .4byte 0x02020630 +_080F8EB0: .4byte 0x03005e00 +_080F8EB4: .4byte nullsub_12 + 1 + thumb_func_end sub_80F8D28 + + thumb_func_start sub_80F8EB8 +sub_80F8EB8: @ 80F8EB8 + push {lr} + ldr r0, _080F8EE0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080F8EDC + ldr r0, _080F8EE4 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + bl sub_805F094 +_080F8EDC: + pop {r0} + bx r0 + .align 2, 0 +_080F8EE0: .4byte sub_80F8EE8 + 1 +_080F8EE4: .4byte 0x03005e00 + thumb_func_end sub_80F8EB8 + + thumb_func_start sub_80F8EE8 +sub_80F8EE8: @ 80F8EE8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _080F8F0C + adds r5, r0, r1 + movs r2, 0x8 + ldrsh r0, [r5, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080F8F98 + lsls r0, 2 + ldr r1, _080F8F10 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080F8F0C: .4byte 0x03005e00 +_080F8F10: .4byte _080F8F14 + .align 2, 0 +_080F8F14: + .4byte _080F8F78 + .4byte _080F8F28 + .4byte _080F8F98 + .4byte _080F8F42 + .4byte _080F8F84 +_080F8F28: + movs r0, 0xA + movs r1, 0x3 + movs r2, 0x8 + movs r3, 0x8 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + movs r1, 0x1 + bl SetStandardWindowBorderStyle + b _080F8F78 +_080F8F42: + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _080F8F80 + adds r4, r0, r1 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + bl gpu_pal_tag_by_index + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_free_tag + ldrb r0, [r4, 0x1] + lsls r0, 30 + cmp r0, 0 + beq _080F8F72 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry +_080F8F72: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_080F8F78: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080F8F98 + .align 2, 0 +_080F8F80: .4byte 0x02020630 +_080F8F84: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x12] + bl sub_80E2A78 + adds r0, r4, 0 + bl remove_task +_080F8F98: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F8EE8 + + thumb_func_start sub_80F8FA0 +sub_80F8FA0: @ 80F8FA0 + push {r4,lr} + ldr r0, _080F8FCC + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8FD8 + ldr r0, _080F8FD0 + ldrb r0, [r0] + cmp r0, 0x4 + bne _080F8FD8 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F8FD8 + ldr r4, _080F8FD4 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + b _080F8FDE + .align 2, 0 +_080F8FCC: .4byte 0x02039f2a +_080F8FD0: .4byte 0x02039f30 +_080F8FD4: .4byte 0x020375f0 +_080F8FD8: + ldr r1, _080F8FE4 + movs r0, 0x4 + strh r0, [r1] +_080F8FDE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F8FE4: .4byte 0x020375f0 + thumb_func_end sub_80F8FA0 + + thumb_func_start sub_80F8FE8 +sub_80F8FE8: @ 80F8FE8 + push {r4,lr} + ldr r0, _080F900C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F9020 + ldr r2, _080F9010 + ldr r1, [r2] + ldr r0, _080F9014 + muls r0, r1 + ldr r1, _080F9018 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + ldr r4, _080F901C + b _080F902A + .align 2, 0 +_080F900C: .4byte 0x02039f2a +_080F9010: .4byte 0x030060b8 +_080F9014: .4byte 0x41c64e6d +_080F9018: .4byte 0x00006073 +_080F901C: .4byte 0x020375f0 +_080F9020: + ldr r4, _080F9038 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 +_080F902A: + ldrh r1, [r4] + bl __umodsi3 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F9038: .4byte 0x020375f0 + thumb_func_end sub_80F8FE8 + + thumb_func_start sub_80F903C +sub_80F903C: @ 80F903C + ldr r2, _080F9050 + ldr r1, [r2] + ldr r0, _080F9054 + muls r0, r1 + ldr r1, _080F9058 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .align 2, 0 +_080F9050: .4byte 0x030060b8 +_080F9054: .4byte 0x41c64e6d +_080F9058: .4byte 0x00006073 + thumb_func_end sub_80F903C + + thumb_func_start sub_80F905C +sub_80F905C: @ 80F905C + push {lr} + ldr r0, _080F9070 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F9074 + movs r0, 0 + b _080F907E + .align 2, 0 +_080F9070: .4byte 0x02039f2a +_080F9074: + ldr r0, _080F9084 + movs r1, 0x5 + bl AddTask + movs r0, 0x1 +_080F907E: + pop {r1} + bx r1 + .align 2, 0 +_080F9084: .4byte sub_80F9088 + 1 + thumb_func_end sub_80F905C + + thumb_func_start sub_80F9088 +sub_80F9088: @ 80F9088 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080F90BC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080F90C0 + cmp r0, 0x1 + beq _080F90CE + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F90D4 + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl remove_task + b _080F90D4 + .align 2, 0 +_080F90BC: .4byte 0x03005e00 +_080F90C0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F90D4 + bl sub_800ADF8 +_080F90CE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080F90D4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F9088 + + thumb_func_start sub_80F90DC +sub_80F90DC: @ 80F90DC + push {lr} + ldr r0, _080F9104 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F90FE + ldr r0, _080F9108 + ldrb r0, [r0] + cmp r0, 0 + beq _080F90FE + bl sub_800E0E8 + movs r0, 0x8 + movs r1, 0x8 + bl sub_800DFB4 +_080F90FE: + pop {r0} + bx r0 + .align 2, 0 +_080F9104: .4byte 0x02039f2a +_080F9108: .4byte 0x03003124 + thumb_func_end sub_80F90DC + + thumb_func_start sub_80F910C +sub_80F910C: @ 80F910C + push {lr} + ldr r0, _080F912C + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F9126 + ldr r0, _080F9130 + ldrb r0, [r0] + cmp r0, 0 + beq _080F9126 + bl sub_800E084 +_080F9126: + pop {r0} + bx r0 + .align 2, 0 +_080F912C: .4byte 0x02039f2a +_080F9130: .4byte 0x03003124 + thumb_func_end sub_80F910C + + thumb_func_start sub_80F9134 +sub_80F9134: @ 80F9134 + push {lr} + ldr r0, _080F9148 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080F914C + movs r0, 0 + b _080F914E + .align 2, 0 +_080F9148: .4byte 0x02039f2a +_080F914C: + movs r0, 0x1 +_080F914E: + pop {r1} + bx r1 + thumb_func_end sub_80F9134 + + thumb_func_start sub_80F9154 +sub_80F9154: @ 80F9154 + ldr r1, _080F915C + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_080F915C: .4byte 0x02039f2a + thumb_func_end sub_80F9154 + + thumb_func_start sub_80F9160 +sub_80F9160: @ 80F9160 + push {lr} + ldr r0, _080F9174 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F9178 + movs r0, 0 + b _080F917A + .align 2, 0 +_080F9174: .4byte 0x02039f2a +_080F9178: + movs r0, 0x1 +_080F917A: + pop {r1} + bx r1 + thumb_func_end sub_80F9160 + + thumb_func_start sp000_heal_pokemon +sp000_heal_pokemon: @ 80F9180 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r8, r0 + ldr r0, _080F923C + ldrb r0, [r0] + cmp r8, r0 + bcs _080F922C + ldr r1, _080F9240 + mov r10, r1 + mov r6, sp +_080F919E: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + add r4, r10 + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r1, r0, 16 + strb r0, [r6] + lsrs r1, 24 + strb r1, [r6, 0x1] + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 + movs r1, 0x1 + add r1, r8 + mov r9, r1 +_080F91D4: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r7, 0 + adds r2, r5, 0 + bl move_get_pp_info + strb r0, [r6] + adds r1, r5, 0 + adds r1, 0x11 + adds r0, r4, 0 + mov r2, sp + bl pokemon_setattr + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080F91D4 + movs r0, 0 + strb r0, [r6] + strb r0, [r6, 0x1] + strb r0, [r6, 0x2] + strb r0, [r6, 0x3] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + add r0, r10 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _080F923C + ldrb r0, [r0] + cmp r8, r0 + bcc _080F919E +_080F922C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F923C: .4byte 0x020244e9 +_080F9240: .4byte 0x020244ec + thumb_func_end sp000_heal_pokemon + + thumb_func_start sub_80F9244 +sub_80F9244: @ 80F9244 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x78 + adds r5, r0, 0 + adds r3, r1, 0 + adds r4, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 16 + lsrs r0, r4, 16 + mov r8, r0 + add r6, sp, 0x14 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r3, 0 + movs r3, 0x20 + bl create_pokemon_set_level + add r0, sp, 0x10 + mov r1, r8 + strb r1, [r0] + lsrs r4, 24 + strb r4, [r0, 0x1] + adds r0, r6, 0 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r6, 0 + bl pokemon_catch + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r5, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0x1 + bgt _080F92B8 + cmp r4, 0 + blt _080F92B8 + adds r0, r5, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r5, 0 + movs r1, 0x3 + bl pokedex_flag_operation +_080F92B8: + adds r0, r4, 0 + add sp, 0x78 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F9244 + + thumb_func_start sub_80F92C8 +sub_80F92C8: @ 80F92C8 + push {lr} + sub sp, 0x68 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r0, sp + movs r2, 0x1 + bl sub_8070954 + add r2, sp, 0x64 + movs r0, 0x1 + strb r0, [r2] + mov r0, sp + movs r1, 0x2D + bl pokemon_setattr + mov r0, sp + bl pokemon_catch + lsls r0, 24 + lsrs r0, 24 + add sp, 0x68 + pop {r1} + bx r1 + thumb_func_end sub_80F92C8 + + thumb_func_start sub_80F92F8 +sub_80F92F8: @ 80F92F8 + push {lr} + bl sub_806B5C4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + beq _080F9314 + cmp r1, 0x1 + bgt _080F9310 + cmp r1, 0 + beq _080F9314 + b _080F9318 +_080F9310: + cmp r1, 0x2 + bne _080F9318 +_080F9314: + ldr r0, _080F931C + strh r1, [r0] +_080F9318: + pop {r0} + bx r0 + .align 2, 0 +_080F931C: .4byte 0x020375f0 + thumb_func_end sub_80F92F8 + + thumb_func_start sub_80F9320 +sub_80F9320: @ 80F9320 + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r5, 0 + movs r7, 0xCE + lsls r7, 1 +_080F932C: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _080F935C + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080F9360 + cmp r0, r7 + beq _080F9360 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + cmp r0, r6 + bne _080F9360 + movs r0, 0x1 + b _080F9368 + .align 2, 0 +_080F935C: .4byte 0x020244ec +_080F9360: + adds r5, 0x1 + cmp r5, 0x5 + ble _080F932C + movs r0, 0 +_080F9368: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80F9320 + + thumb_func_start sub_80F9370 +sub_80F9370: @ 80F9370 + push {r4,lr} + movs r0, 0xAF + bl sub_80F9320 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0x1 + bne _080F9392 + movs r0, 0xAF + bl berryid_from_itemid + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080F939C + bl sub_80E1A38 +_080F9392: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080F939C: .4byte 0x02021cc4 + thumb_func_end sub_80F9370 + + thumb_func_start sub_80F93A0 +sub_80F93A0: @ 80F93A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r7, r2, 16 + lsrs r6, r7, 16 + bl zero_enemy_party_data + ldr r0, _080F93FC + mov r8, r0 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x20 + bl create_pokemon_set_level + cmp r6, 0 + beq _080F93EE + add r0, sp, 0x10 + strb r6, [r0] + adds r1, r0, 0 + lsrs r0, r7, 24 + strb r0, [r1, 0x1] + mov r0, r8 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr +_080F93EE: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F93FC: .4byte 0x02024744 + thumb_func_end sub_80F93A0 + + thumb_func_start sub_80F9400 +sub_80F9400: @ 80F9400 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r2, 24 + cmp r3, 0x6 + bls _080F941C + ldr r0, _080F9430 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080F941C: + movs r0, 0x64 + muls r0, r3 + ldr r1, _080F9434 + adds r0, r1 + adds r1, r4, 0 + bl sub_80691F4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F9430: .4byte 0x020244e9 +_080F9434: .4byte 0x020244ec + thumb_func_end sub_80F9400 + + thumb_func_start sub_80F9438 +sub_80F9438: @ 80F9438 + push {lr} + ldr r0, _080F9454 + ldr r1, _080F9458 + str r1, [r0, 0x8] + ldr r0, _080F945C + movs r1, 0x9 + bl var_set + movs r0, 0 + bl sub_81B8518 + pop {r0} + bx r0 + .align 2, 0 +_080F9454: .4byte 0x030022c0 +_080F9458: .4byte sub_80F9460 + 1 +_080F945C: .4byte 0x000040cf + thumb_func_end sub_80F9438 + + thumb_func_start sub_80F9460 +sub_80F9460: @ 80F9460 + push {lr} + ldr r0, _080F9470 + ldrb r1, [r0] + cmp r1, 0 + bne _080F9478 + ldr r0, _080F9474 + strh r1, [r0] + b _080F947E + .align 2, 0 +_080F9470: .4byte 0x0203cef8 +_080F9474: .4byte 0x020375f0 +_080F9478: + ldr r1, _080F9488 + movs r0, 0x1 + strh r0, [r1] +_080F947E: + ldr r0, _080F948C + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080F9488: .4byte 0x020375f0 +_080F948C: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80F9460 + + thumb_func_start sub_80F9490 +sub_80F9490: @ 80F9490 + push {lr} + ldr r1, _080F94AC + ldr r0, _080F94B0 + str r0, [r1, 0x8] + ldr r0, _080F94B4 + ldrb r0, [r0] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81B8518 + pop {r0} + bx r0 + .align 2, 0 +_080F94AC: .4byte 0x030022c0 +_080F94B0: .4byte sub_80F94B8 + 1 +_080F94B4: .4byte 0x020375e0 + thumb_func_end sub_80F9490 + + thumb_func_start sub_80F94B8 +sub_80F94B8: @ 80F94B8 + push {lr} + ldr r0, _080F94C8 + ldrb r1, [r0] + cmp r1, 0 + bne _080F94D0 + ldr r0, _080F94CC + strh r1, [r0] + b _080F94D6 + .align 2, 0 +_080F94C8: .4byte 0x0203cef8 +_080F94CC: .4byte 0x020375f0 +_080F94D0: + ldr r1, _080F94E0 + movs r0, 0x1 + strh r0, [r1] +_080F94D6: + ldr r0, _080F94E4 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_080F94E0: .4byte 0x020375f0 +_080F94E4: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80F94B8 + + thumb_func_start sub_80F94E8 +sub_80F94E8: @ 80F94E8 + push {r4-r7,lr} + sub sp, 0x198 + add r0, sp, 0x190 + movs r1, 0 + str r1, [r0] + ldr r2, _080F9558 + mov r1, sp + bl CpuSet + movs r5, 0 + movs r7, 0x64 + ldr r6, _080F955C + mov r4, sp +_080F9502: + ldr r0, _080F9560 + adds r1, r5, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080F951C + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r7 + adds r1, r6 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy +_080F951C: + adds r4, 0x64 + adds r5, 0x1 + cmp r5, 0x3 + ble _080F9502 + add r0, sp, 0x194 + movs r1, 0 + str r1, [r0] + ldr r4, _080F955C + ldr r2, _080F9564 + adds r1, r4, 0 + bl CpuSet + mov r5, sp + add r6, sp, 0x12C +_080F9538: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x64 + adds r4, 0x64 + cmp r5, r6 + ble _080F9538 + bl calc_player_party_count + add sp, 0x198 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F9558: .4byte 0x05000064 +_080F955C: .4byte 0x020244ec +_080F9560: .4byte 0x0203cef8 +_080F9564: .4byte 0x05000096 + thumb_func_end sub_80F94E8 + + thumb_func_start sub_80F9568 +sub_80F9568: @ 80F9568 + push {lr} + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080F9580 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _080F9584 +_080F9580: + movs r0, 0 + b _080F9586 +_080F9584: + movs r0, 0x1 +_080F9586: + pop {r1} + bx r1 + thumb_func_end sub_80F9568 + + thumb_func_start sub_80F958C +sub_80F958C: @ 80F958C + push {r4,r5,lr} + ldr r4, _080F95AC + movs r5, 0 +_080F9592: + adds r0, r4, 0 + bl sub_80F9568 + cmp r0, 0 + beq _080F95B0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080F95B0 + movs r0, 0 + b _080F95BA + .align 2, 0 +_080F95AC: .4byte 0x020244ec +_080F95B0: + adds r5, 0x1 + adds r4, 0x64 + cmp r5, 0x5 + ble _080F9592 + movs r0, 0x1 +_080F95BA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80F958C + + thumb_func_start sub_80F95C0 +sub_80F95C0: @ 80F95C0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, _080F9604 + adds r4, r0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x7 + bl happiness_algorithm + adds r0, r4, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + ldr r5, _080F9608 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr + adds r0, r5, 0 + bl get_end_of_string_ptr_limit_10_chars + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9604: .4byte 0x020244ec +_080F9608: .4byte 0x02021cc4 + thumb_func_end sub_80F95C0 + + thumb_func_start sub_80F960C +sub_80F960C: @ 80F960C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, _080F9648 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80F9568 + cmp r0, 0 + beq _080F964C + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080F964C + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F964C + movs r0, 0x1 + b _080F964E + .align 2, 0 +_080F9648: .4byte 0x020244ec +_080F964C: + movs r0, 0 +_080F964E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80F960C + + thumb_func_start sub_80F9654 +sub_80F9654: @ 80F9654 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _080F9678 + adds r4, r0, r1 + movs r0, 0 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080F96AE + cmp r5, 0x1 + bgt _080F967C + cmp r5, 0 + beq _080F9682 + b _080F9722 + .align 2, 0 +_080F9678: .4byte 0x03005e08 +_080F967C: + cmp r5, 0x2 + beq _080F96C0 + b _080F9722 +_080F9682: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bgt _080F96A8 +_080F968C: + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80F960C + cmp r0, 0 + bne _080F96FC + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + adds r1, r0, 0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080F968C +_080F96A8: + movs r0, 0x2 + strh r0, [r4] + b _080F9722 +_080F96AE: + bl sub_809833C + lsls r0, 24 + cmp r0, 0 + beq _080F9722 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + b _080F9722 +_080F96C0: + bl sub_80F958C + adds r1, r0, 0 + cmp r1, 0 + beq _080F9714 + bl sub_81A9E40 + adds r4, r0, 0 + bl sub_81A80A8 + orrs r4, r0 + lsls r4, 24 + cmp r4, 0 + bne _080F96E6 + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080F96F0 +_080F96E6: + ldr r0, _080F96EC + strh r5, [r0] + b _080F9718 + .align 2, 0 +_080F96EC: .4byte 0x020375f0 +_080F96F0: + ldr r1, _080F96F8 + movs r0, 0x1 + strh r0, [r1] + b _080F9718 + .align 2, 0 +_080F96F8: .4byte 0x020375f0 +_080F96FC: + ldrb r0, [r4, 0x2] + bl sub_80F95C0 + ldr r0, _080F9710 + bl box_related_two__2 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080F9722 + .align 2, 0 +_080F9710: .4byte 0x085ecf5d +_080F9714: + ldr r0, _080F9728 + strh r1, [r0] +_080F9718: + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl remove_task +_080F9722: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080F9728: .4byte 0x020375f0 + thumb_func_end sub_80F9654 + + thumb_func_start sub_80F972C +sub_80F972C: @ 80F972C + push {lr} + ldr r0, _080F9740 + movs r1, 0x50 + bl AddTask + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .align 2, 0 +_080F9740: .4byte sub_80F9654 + 1 + thumb_func_end sub_80F972C + + thumb_func_start overworld_poison +overworld_poison: @ 80F9744 + push {r4-r7,lr} + sub sp, 0x4 + ldr r4, _080F97B0 + movs r7, 0 + movs r6, 0 + movs r5, 0x5 +_080F9750: + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _080F9794 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F9794 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + str r0, [sp] + cmp r0, 0 + beq _080F9786 + subs r0, 0x1 + str r0, [sp] + cmp r0, 0 + bne _080F9788 +_080F9786: + adds r6, 0x1 +_080F9788: + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r7, 0x1 +_080F9794: + adds r4, 0x64 + subs r5, 0x1 + cmp r5, 0 + bge _080F9750 + cmp r6, 0 + bne _080F97A4 + cmp r7, 0 + beq _080F97A8 +_080F97A4: + bl overworld_posion_effect +_080F97A8: + cmp r6, 0 + beq _080F97B4 + movs r0, 0x2 + b _080F97BE + .align 2, 0 +_080F97B0: .4byte 0x020244ec +_080F97B4: + cmp r7, 0 + bne _080F97BC + movs r0, 0 + b _080F97BE +_080F97BC: + movs r0, 0x1 +_080F97BE: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end overworld_poison + + thumb_func_start sub_80F97C8 +sub_80F97C8: @ 80F97C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + movs r1, 0 + bl pokemon_getattr + lsls r0, 16 + str r0, [sp, 0x4] + lsrs r0, 16 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0x27 + bl pokemon_getattr + adds r7, r0, 0 + movs r6, 0xF + ands r7, r6 + adds r0, r5, 0 + movs r1, 0x28 + bl pokemon_getattr + mov r8, r0 + mov r1, r8 + ands r1, r6 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0x29 + bl pokemon_getattr + mov r9, r0 + mov r3, r9 + ands r3, r6 + mov r9, r3 + adds r0, r5, 0 + movs r1, 0x2A + bl pokemon_getattr + mov r10, r0 + ands r0, r6 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x2B + bl pokemon_getattr + adds r4, r0, 0 + ands r4, r6 + adds r0, r5, 0 + movs r1, 0x2C + bl pokemon_getattr + adds r2, r0, 0 + ands r2, r6 + mov r1, r8 + mov r3, r9 + eors r1, r3 + mov r8, r1 + mov r0, r8 + muls r0, r7 + movs r1, 0xFF + ldr r3, [sp] + ands r3, r1 + eors r0, r3 + eors r4, r2 + mov r1, r10 + muls r1, r4 + ldr r3, [sp, 0x4] + lsrs r2, r3, 24 + eors r1, r2 + lsls r0, 8 + adds r0, r1 + 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_80F97C8 + + thumb_func_start sub_80F986C +sub_80F986C: @ 80F986C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x1 + ldr r3, _080F9888 +_080F9876: + lsls r0, r1, 3 + adds r0, r3 + ldrh r0, [r0, 0x4] + cmp r2, r0 + bcs _080F988C + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _080F9898 + .align 2, 0 +_080F9888: .4byte 0x0858d8f0 +_080F988C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xE + bls _080F9876 + adds r0, r1, 0 +_080F9898: + pop {r1} + bx r1 + thumb_func_end sub_80F986C + + thumb_func_start sub_80F989C +sub_80F989C: @ 80F989C + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r6, 16 + lsrs r6, 16 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_80C0630 + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r6, 0 + bl sub_80F986C + lsls r0, 24 + ldr r1, _080F990C + lsrs r0, 21 + adds r0, r1 + ldrh r1, [r0] + str r1, [sp] + movs r2, 0 + str r2, [sp, 0x4] + ldrb r2, [r0, 0x2] + movs r3, 0 + ldrh r4, [r0, 0x4] + movs r5, 0 + adds r0, r6, 0 + movs r1, 0 + subs r0, r4 + sbcs r1, r5 + bl __udivdi3 + ldr r2, [sp] + ldr r3, [sp, 0x4] + adds r2, r0 + adcs r3, r1 + str r2, [sp] + str r3, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + bl __muldi3 + movs r2, 0xA + movs r3, 0 + bl __udivdi3 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080F990C: .4byte 0x0858d8f0 + thumb_func_end sub_80F989C + + thumb_func_start sub_80F9910 +sub_80F9910: @ 80F9910 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 1 + adds r0, r4, 0 + bl __floatsidf + cmp r4, 0 + bge _080F992C + ldr r3, _080F9974 + ldr r2, _080F9970 + bl __adddf3 +_080F992C: + ldr r2, _080F9978 + ldr r3, _080F997C + bl __divdf3 + bl __fixunsdfsi + adds r4, r0, 0 + movs r1, 0xA + bl __udivsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x8 + bl decimal_int_to_string + adds r5, r0, 0 + ldr r1, _080F9980 + bl gf_strcat + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9970: .4byte 0x41f00000 +_080F9974: .4byte 0x00000000 +_080F9978: .4byte 0x40396666 +_080F997C: .4byte 0x66666666 +_080F9980: .4byte 0x085eed24 + thumb_func_end sub_80F9910 + + thumb_func_start sub_80F9984 +sub_80F9984: @ 80F9984 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, _080F999C + ldrh r0, [r1] + cmp r0, 0xFF + bne _080F99A0 + movs r0, 0 + b _080F9A0A + .align 2, 0 +_080F999C: .4byte 0x020375f0 +_080F99A0: + ldrh r1, [r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _080F99C8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _080F99C2 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, r6 + beq _080F99CC +_080F99C2: + movs r0, 0x1 + b _080F9A0A + .align 2, 0 +_080F99C8: .4byte 0x020244ec +_080F99CC: + mov r4, sp + adds r0, r5, 0 + bl sub_80F97C8 + strh r0, [r4] + mov r0, sp + ldrh r1, [r0] + adds r0, r6, 0 + bl sub_80F989C + adds r5, r0, 0 + ldrh r1, [r7] + adds r0, r6, 0 + bl sub_80F989C + adds r4, r0, 0 + ldr r0, _080F9A04 + adds r1, r5, 0 + bl sub_80F9910 + cmp r5, r4 + bls _080F9A08 + mov r0, sp + ldrh r0, [r0] + strh r0, [r7] + movs r0, 0x3 + b _080F9A0A + .align 2, 0 +_080F9A04: .4byte 0x02021dc4 +_080F9A08: + movs r0, 0x2 +_080F9A0A: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80F9984 + + thumb_func_start sub_80F9A14 +sub_80F9A14: @ 80F9A14 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r1, [r5] + adds r0, r4, 0 + bl sub_80F989C + adds r1, r0, 0 + ldr r0, _080F9A50 + bl sub_80F9910 + ldr r0, _080F9A54 + movs r1, 0xB + muls r1, r4 + ldr r2, _080F9A58 + adds r1, r2 + bl gf_strcpy + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 8 + cmp r1, r0 + bne _080F9A64 + ldr r0, _080F9A5C + ldr r1, _080F9A60 + bl gf_strcpy + b _080F9A6E + .align 2, 0 +_080F9A50: .4byte 0x02021ec4 +_080F9A54: .4byte 0x02021cc4 +_080F9A58: .4byte 0x083185c8 +_080F9A5C: .4byte 0x02021dc4 +_080F9A60: .4byte 0x085ecf6b +_080F9A64: + ldr r0, _080F9A74 + ldr r1, _080F9A78 + ldr r1, [r1] + bl gf_strcpy +_080F9A6E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9A74: .4byte 0x02021dc4 +_080F9A78: .4byte 0x03005d90 + thumb_func_end sub_80F9A14 + + thumb_func_start sub_80F9A7C +sub_80F9A7C: @ 80F9A7C + push {lr} + ldr r0, _080F9A8C + movs r1, 0x80 + lsls r1, 8 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_080F9A8C: .4byte 0x00004047 + thumb_func_end sub_80F9A7C + + thumb_func_start sub_80F9A90 +sub_80F9A90: @ 80F9A90 + push {lr} + ldr r0, _080F9AA8 + bl var_get_pointer + adds r1, r0, 0 + movs r0, 0x95 + lsls r0, 1 + bl sub_80F9A14 + pop {r0} + bx r0 + .align 2, 0 +_080F9AA8: .4byte 0x00004047 + thumb_func_end sub_80F9A90 + + thumb_func_start sub_80F9AAC +sub_80F9AAC: @ 80F9AAC + push {r4,lr} + ldr r0, _080F9ACC + bl var_get_pointer + adds r1, r0, 0 + ldr r4, _080F9AD0 + movs r0, 0x95 + lsls r0, 1 + bl sub_80F9984 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F9ACC: .4byte 0x00004047 +_080F9AD0: .4byte 0x020375f0 + thumb_func_end sub_80F9AAC + + thumb_func_start sub_80F9AD4 +sub_80F9AD4: @ 80F9AD4 + push {lr} + ldr r0, _080F9AE4 + movs r1, 0x80 + lsls r1, 8 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_080F9AE4: .4byte 0x0000404f + thumb_func_end sub_80F9AD4 + + thumb_func_start sub_80F9AE8 +sub_80F9AE8: @ 80F9AE8 + push {lr} + ldr r0, _080F9AFC + bl var_get_pointer + adds r1, r0, 0 + ldr r0, _080F9B00 + bl sub_80F9A14 + pop {r0} + bx r0 + .align 2, 0 +_080F9AFC: .4byte 0x0000404f +_080F9B00: .4byte 0x00000127 + thumb_func_end sub_80F9AE8 + + thumb_func_start sub_80F9B04 +sub_80F9B04: @ 80F9B04 + push {r4,lr} + ldr r0, _080F9B24 + bl var_get_pointer + adds r1, r0, 0 + ldr r4, _080F9B28 + ldr r0, _080F9B2C + bl sub_80F9984 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080F9B24: .4byte 0x0000404f +_080F9B28: .4byte 0x020375f0 +_080F9B2C: .4byte 0x00000127 + thumb_func_end sub_80F9B04 + + thumb_func_start sub_80F9B30 +sub_80F9B30: @ 80F9B30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r7, 0 + add r4, sp, 0x8 + movs r0, 0x1 + strb r0, [r4] + ldr r1, _080F9BB8 + mov r0, sp + movs r2, 0x7 + bl memcpy + mov r8, r4 + cmp r6, 0xA + bhi _080F9BAC + cmp r5, 0x40 + bhi _080F9BAC + ldr r0, _080F9BBC + ldr r0, [r0] + ldr r1, _080F9BC0 + adds r0, r1 + adds r0, r6 + strb r5, [r0] + movs r5, 0 +_080F9B6A: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _080F9BC4 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080F9B9C + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080F9B9C + mov r1, sp + adds r0, r1, r6 + ldrb r1, [r0] + adds r0, r4, 0 + mov r2, r8 + bl pokemon_setattr + movs r7, 0x1 +_080F9B9C: + adds r5, 0x1 + cmp r5, 0x5 + ble _080F9B6A + cmp r7, 0 + beq _080F9BAC + ldr r0, _080F9BC8 + bl flag_set +_080F9BAC: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080F9BB8: .4byte 0x0858d970 +_080F9BBC: .4byte 0x03005d8c +_080F9BC0: .4byte 0x000031a8 +_080F9BC4: .4byte 0x020244ec +_080F9BC8: .4byte 0x0000089b + thumb_func_end sub_80F9B30 + + thumb_func_start sub_80F9BCC +sub_80F9BCC: @ 80F9BCC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _080F9BF0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80F9C44 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9BF0: .4byte sub_80F9C90 + 1 + thumb_func_end sub_80F9BCC + + thumb_func_start sub_80F9BF4 +sub_80F9BF4: @ 80F9BF4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _080F9C18 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80F9C44 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9C18: .4byte sub_80F9DFC + 1 + thumb_func_end sub_80F9BF4 + + thumb_func_start sub_80F9C1C +sub_80F9C1C: @ 80F9C1C + push {lr} + ldr r0, _080F9C2C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080F9C2C: .4byte sub_80F9C90 + 1 + thumb_func_end sub_80F9C1C + + thumb_func_start sub_80F9C30 +sub_80F9C30: @ 80F9C30 + push {lr} + ldr r0, _080F9C40 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080F9C40: .4byte sub_80F9DFC + 1 + thumb_func_end sub_80F9C30 + + thumb_func_start sub_80F9C44 +sub_80F9C44: @ 80F9C44 + push {r4,r5,lr} + lsls r1, 16 + lsrs r4, r1, 16 + adds r5, r4, 0 + lsls r3, 24 + lsrs r3, 24 + adds r1, r3, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, _080F9C8C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x10 + cmp r4, 0 + beq _080F9C72 + adds r0, r4, 0 +_080F9C72: + strh r0, [r1, 0xA] + movs r0, 0x14 + cmp r5, 0 + beq _080F9C7C + adds r0, r5, 0 +_080F9C7C: + strh r0, [r1, 0xC] + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9C8C: .4byte 0x03005e00 + thumb_func_end sub_80F9C44 + + thumb_func_start sub_80F9C90 +sub_80F9C90: @ 80F9C90 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080F9CB4 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080F9D10 + cmp r0, 0x1 + bgt _080F9CB8 + cmp r0, 0 + beq _080F9CC2 + b _080F9DDE + .align 2, 0 +_080F9CB4: .4byte 0x03005e00 +_080F9CB8: + cmp r0, 0x2 + beq _080F9D32 + cmp r0, 0x3 + beq _080F9D94 + b _080F9DDE +_080F9CC2: + movs r0, 0x78 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + movs r0, 0x50 + strh r0, [r4, 0x12] + movs r0, 0x51 + strh r0, [r4, 0x14] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + b _080F9DEE +_080F9D10: + movs r0, 0x50 + bl lcd_io_get + strh r0, [r4, 0x16] + movs r0, 0x54 + bl lcd_io_get + strh r0, [r4, 0x18] + movs r0, 0x50 + movs r1, 0xBF + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x10 + bl lcd_io_set + b _080F9DEE +_080F9D32: + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0xA] + subs r0, r1 + movs r5, 0 + strh r0, [r4, 0xE] + ldrh r2, [r4, 0x10] + adds r1, r2 + strh r1, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + ble _080F9D50 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xEF + ble _080F9D76 +_080F9D50: + strh r5, [r4, 0xE] + movs r0, 0xF0 + strh r0, [r4, 0x10] + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4, 0x16] + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _080F9D90 + strh r5, [r0] +_080F9D76: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + movs r1, 0xE + ldrsh r0, [r4, r1] + b _080F9DD8 + .align 2, 0 +_080F9D90: .4byte 0x02037b14 +_080F9D94: + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0xC] + subs r0, r1 + strh r0, [r4, 0x12] + ldrh r2, [r4, 0x14] + adds r1, r2 + strh r1, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + ble _080F9DB0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _080F9DC2 +_080F9DB0: + movs r0, 0 + strh r0, [r4, 0x12] + movs r0, 0xA0 + strh r0, [r4, 0x14] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits +_080F9DC2: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r1, 0x12 + ldrsh r0, [r4, r1] +_080F9DD8: + cmp r0, 0 + bne _080F9DF4 + b _080F9DEE +_080F9DDE: + ldrh r1, [r4, 0x16] + movs r0, 0x50 + bl lcd_io_set + adds r0, r5, 0 + bl remove_task + b _080F9DF4 +_080F9DEE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080F9DF4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F9C90 + + thumb_func_start sub_80F9DFC +sub_80F9DFC: @ 80F9DFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080F9E20 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _080F9E38 + cmp r1, 0x1 + bgt _080F9E24 + cmp r1, 0 + beq _080F9E2E + b _080F9F2C + .align 2, 0 +_080F9E20: .4byte 0x03005e00 +_080F9E24: + cmp r1, 0x2 + beq _080F9E86 + cmp r1, 0x3 + beq _080F9ED8 + b _080F9F2C +_080F9E2E: + ldr r0, _080F9E34 + strh r1, [r0] + b _080F9F4E + .align 2, 0 +_080F9E34: .4byte 0x02037b14 +_080F9E38: + movs r1, 0 + strh r1, [r4, 0xE] + movs r0, 0xF0 + strh r0, [r4, 0x10] + strh r1, [r4, 0x12] + movs r0, 0xA0 + strh r0, [r4, 0x14] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + b _080F9F4E +_080F9E86: + ldrh r0, [r4, 0xC] + ldrh r2, [r4, 0x12] + adds r1, r0, r2 + strh r1, [r4, 0x12] + ldrh r2, [r4, 0x14] + subs r0, r2, r0 + strh r0, [r4, 0x14] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x4F + bgt _080F9EA4 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bgt _080F9EBC +_080F9EA4: + movs r0, 0x50 + strh r0, [r4, 0x12] + movs r0, 0x51 + strh r0, [r4, 0x14] + movs r0, 0x50 + movs r1, 0xBF + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x10 + bl lcd_io_set +_080F9EBC: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x50 + bne _080F9F54 + b _080F9F4E +_080F9ED8: + ldrh r0, [r4, 0xA] + ldrh r2, [r4, 0xE] + adds r1, r0, r2 + strh r1, [r4, 0xE] + ldrh r2, [r4, 0x10] + subs r0, r2, r0 + strh r0, [r4, 0x10] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x77 + bgt _080F9EF6 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bgt _080F9F0C +_080F9EF6: + movs r0, 0x78 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + subs r0, 0x79 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, _080F9F28 + movs r0, 0 + strh r0, [r1] +_080F9F0C: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x78 + bne _080F9F54 + b _080F9F4E + .align 2, 0 +_080F9F28: .4byte 0x02037b14 +_080F9F2C: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl remove_task + b _080F9F54 +_080F9F4E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080F9F54: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F9DFC + + thumb_func_start sub_80F9F5C +sub_80F9F5C: @ 80F9F5C + push {lr} + ldr r0, _080F9F70 + ldr r1, _080F9F74 + ldr r1, [r1, 0x4] + bl sub_80E9608 + bl sub_80E8B6C + pop {r0} + bx r0 + .align 2, 0 +_080F9F70: .4byte 0x0203ab40 +_080F9F74: .4byte 0x02037318 + thumb_func_end sub_80F9F5C + + thumb_func_start sub_80F9F78 +sub_80F9F78: @ 80F9F78 + push {lr} + ldr r0, _080F9F98 + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _080F9FC0 + ldr r1, _080F9F9C + ldr r0, [r1, 0x4] + cmp r0, 0x2 + beq _080F9FAE + cmp r0, 0x2 + bgt _080F9FA0 + cmp r0, 0x1 + beq _080F9FA6 + b _080F9FFE + .align 2, 0 +_080F9F98: .4byte 0x02037590 +_080F9F9C: .4byte 0x02038c08 +_080F9FA0: + cmp r0, 0x3 + beq _080F9FB6 + b _080F9FDC +_080F9FA6: + movs r0, 0x10 + str r0, [r1, 0x14] + movs r0, 0x28 + b _080F9FFC +_080F9FAE: + movs r0, 0x10 + str r0, [r1, 0x14] + movs r0, 0x8 + b _080F9FFC +_080F9FB6: + movs r0, 0x8 + negs r0, r0 + str r0, [r1, 0x14] + movs r0, 0x18 + b _080F9FFC +_080F9FC0: + ldr r1, _080F9FD4 + ldr r0, [r1, 0x4] + cmp r0, 0x2 + beq _080F9FEA + cmp r0, 0x2 + bgt _080F9FD8 + cmp r0, 0x1 + beq _080F9FE2 + b _080F9FFE + .align 2, 0 +_080F9FD4: .4byte 0x02038c08 +_080F9FD8: + cmp r0, 0x3 + beq _080F9FEE +_080F9FDC: + cmp r0, 0x4 + beq _080F9FF8 + b _080F9FFE +_080F9FE2: + movs r0, 0x8 + str r0, [r1, 0x14] + movs r0, 0x28 + b _080F9FFC +_080F9FEA: + movs r0, 0x8 + b _080F9FFA +_080F9FEE: + movs r0, 0x8 + negs r0, r0 + str r0, [r1, 0x14] + movs r0, 0x18 + b _080F9FFC +_080F9FF8: + movs r0, 0x18 +_080F9FFA: + str r0, [r1, 0x14] +_080F9FFC: + str r0, [r1, 0x18] +_080F9FFE: + pop {r0} + bx r0 + thumb_func_end sub_80F9F78 + + thumb_func_start sub_80FA004 +sub_80FA004: @ 80FA004 + push {r4,lr} + bl sub_80E8BC8 + ldr r0, _080FA058 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080FA0AE + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080FA0AE + ldr r4, _080FA05C + adds r1, r4, 0x2 + adds r0, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_808923C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FA070 + bl sub_80F9F5C + ldr r1, _080FA060 + ldr r0, _080FA064 + str r0, [r1] + ldr r1, _080FA068 + ldr r0, _080FA06C + b _080FA0C0 + .align 2, 0 +_080FA058: .4byte 0x020375f0 +_080FA05C: .4byte 0x0203ab40 +_080FA060: .4byte 0x03005db0 +_080FA064: .4byte hm_add_c3_launch_phase_2 + 1 +_080FA068: .4byte 0x0203ceec +_080FA06C: .4byte sub_80FA0DC + 1 +_080FA070: + adds r0, r4, 0 + bl sub_808925C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FA0A0 + bl sub_80F9F5C + ldr r1, _080FA090 + ldr r0, _080FA094 + str r0, [r1] + ldr r1, _080FA098 + ldr r0, _080FA09C + b _080FA0C0 + .align 2, 0 +_080FA090: .4byte 0x03005db0 +_080FA094: .4byte hm_add_c3_launch_phase_2 + 1 +_080FA098: .4byte 0x0203ceec +_080FA09C: .4byte sub_80FA1E8 + 1 +_080FA0A0: + adds r0, r4, 0 + bl is_tile_x98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FA0B2 +_080FA0AE: + movs r0, 0 + b _080FA0C4 +_080FA0B2: + bl sub_80F9F5C + ldr r1, _080FA0CC + ldr r0, _080FA0D0 + str r0, [r1] + ldr r1, _080FA0D4 + ldr r0, _080FA0D8 +_080FA0C0: + str r0, [r1] + movs r0, 0x1 +_080FA0C4: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080FA0CC: .4byte 0x03005db0 +_080FA0D0: .4byte hm_add_c3_launch_phase_2 + 1 +_080FA0D4: .4byte 0x0203ceec +_080FA0D8: .4byte sub_80FA34C + 1 + thumb_func_end sub_80FA004 + + thumb_func_start sub_80FA0DC +sub_80FA0DC: @ 80FA0DC + push {lr} + bl brm_get_pokemon_selection + ldr r1, _080FA0F4 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, _080FA0F8 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080FA0F4: .4byte 0x02038c08 +_080FA0F8: .4byte 0x08275a86 + thumb_func_end sub_80FA0DC + + thumb_func_start oei_sweet_scent +oei_sweet_scent: @ 80FA0FC + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA120 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _080FA124 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080FA120: .4byte 0x03005e00 +_080FA124: .4byte sub_80FA128 + 1 + thumb_func_end oei_sweet_scent + + thumb_func_start sub_80FA128 +sub_80FA128: @ 80FA128 + push {lr} + movs r0, 0xB + bl oe_active_list_remove + movs r0, 0x37 + bl oe_exec + pop {r0} + bx r0 + thumb_func_end sub_80FA128 + + thumb_func_start sub_80FA13C +sub_80FA13C: @ 80FA13C + push {r4,lr} + bl sub_80F9F78 + ldr r0, _080FA17C + ldr r3, _080FA180 + ldr r1, _080FA184 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 23 + ldr r4, _080FA188 + ldr r3, [r4, 0x14] + adds r1, r3 + lsls r1, 16 + asrs r1, 16 + ldrb r2, [r2] + ldr r3, [r4, 0x18] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x94 + bl obj_add_from_template_forward_search + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080FA17C: .4byte 0x0858e600 +_080FA180: .4byte 0x02020630 +_080FA184: .4byte 0x02037590 +_080FA188: .4byte 0x02038c08 + thumb_func_end sub_80FA13C + + thumb_func_start sub_80FA18C +sub_80FA18C: @ 80FA18C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x83 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _080FA1A4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FA1A4: .4byte sub_80FA1A8 + 1 + thumb_func_end sub_80FA18C + + thumb_func_start sub_80FA1A8 +sub_80FA1A8: @ 80FA1A8 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0x27 + bgt _080FA1C8 + adds r0, r2, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080FA1D0 + bl sub_80E8D4C + b _080FA1D0 +_080FA1C8: + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, _080FA1D4 + str r0, [r1, 0x1C] +_080FA1D0: + pop {r0} + bx r0 + .align 2, 0 +_080FA1D4: .4byte sub_80FA1D8 + 1 + thumb_func_end sub_80FA1A8 + + thumb_func_start sub_80FA1D8 +sub_80FA1D8: @ 80FA1D8 + push {lr} + movs r1, 0x37 + bl oe_stop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FA1D8 + + thumb_func_start sub_80FA1E8 +sub_80FA1E8: @ 80FA1E8 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _080FA200 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, _080FA204 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080FA200: .4byte 0x02038c08 +_080FA204: .4byte 0x08275adf + thumb_func_end sub_80FA1E8 + + thumb_func_start sub_80FA208 +sub_80FA208: @ 80FA208 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA22C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _080FA230 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080FA22C: .4byte 0x03005e00 +_080FA230: .4byte sub_80FA234 + 1 + thumb_func_end sub_80FA208 + + thumb_func_start sub_80FA234 +sub_80FA234: @ 80FA234 + push {lr} + movs r0, 0x1A + bl oe_active_list_remove + movs r0, 0x38 + bl oe_exec + pop {r0} + bx r0 + thumb_func_end sub_80FA234 + + thumb_func_start sub_80FA248 +sub_80FA248: @ 80FA248 + push {r4,lr} + ldr r1, _080FA2C0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl cur_mapdata_block_get_role_at + adds r2, r0, 0 + ldr r1, _080FA2C4 + adds r0, r1, 0 + ands r2, r0 + cmp r2, 0x96 + bne _080FA26A + ldr r1, _080FA2C8 + movs r0, 0 + str r0, [r1, 0x1C] +_080FA26A: + cmp r2, 0x9C + bne _080FA274 + ldr r1, _080FA2C8 + movs r0, 0x2 + str r0, [r1, 0x1C] +_080FA274: + bl sub_80F9F78 + ldr r0, _080FA2CC + ldr r3, _080FA2D0 + ldr r1, _080FA2D4 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 23 + ldr r4, _080FA2C8 + ldr r3, [r4, 0x14] + adds r1, r3 + lsls r1, 16 + asrs r1, 16 + ldrb r2, [r2] + ldr r3, [r4, 0x18] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x94 + bl obj_add_from_template_forward_search + ldr r0, [r4, 0x1C] + cmp r0, 0x1 + beq _080FA2B2 + cmp r0, 0x3 + bne _080FA2B6 +_080FA2B2: + bl sub_80E8D4C +_080FA2B6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080FA2C0: .4byte 0x0203ab40 +_080FA2C4: .4byte 0x00000fff +_080FA2C8: .4byte 0x02038c08 +_080FA2CC: .4byte 0x0858e618 +_080FA2D0: .4byte 0x02020630 +_080FA2D4: .4byte 0x02037590 + thumb_func_end sub_80FA248 + + thumb_func_start sub_80FA2D8 +sub_80FA2D8: @ 80FA2D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x9B + bl audio_play + ldr r0, _080FA2FC + ldr r1, [r0, 0x1C] + adds r2, r4, 0 + adds r2, 0x2A + movs r0, 0 + strb r1, [r2] + strh r0, [r4, 0x2E] + ldr r0, _080FA300 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FA2FC: .4byte 0x02038c08 +_080FA300: .4byte sub_80FA304 + 1 + thumb_func_end sub_80FA2D8 + + thumb_func_start sub_80FA304 +sub_80FA304: @ 80FA304 + 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, 0x27 + ble _080FA32E + ldr r0, _080FA334 + ldr r0, [r0, 0x1C] + cmp r0, 0 + beq _080FA322 + cmp r0, 0x2 + bne _080FA326 +_080FA322: + bl sub_80E8D4C +_080FA326: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _080FA338 + str r0, [r4, 0x1C] +_080FA32E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FA334: .4byte 0x02038c08 +_080FA338: .4byte sub_80FA33C + 1 + thumb_func_end sub_80FA304 + + thumb_func_start sub_80FA33C +sub_80FA33C: @ 80FA33C + push {lr} + movs r1, 0x38 + bl oe_stop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FA33C + + thumb_func_start sub_80FA34C +sub_80FA34C: @ 80FA34C + push {lr} + bl brm_get_pokemon_selection + ldr r1, _080FA364 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, _080FA368 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080FA364: .4byte 0x02038c08 +_080FA368: .4byte 0x08275b38 + thumb_func_end sub_80FA34C + + thumb_func_start sub_80FA36C +sub_80FA36C: @ 80FA36C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA390 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _080FA394 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_080FA390: .4byte 0x03005e00 +_080FA394: .4byte sub_80FA398 + 1 + thumb_func_end sub_80FA36C + + thumb_func_start sub_80FA398 +sub_80FA398: @ 80FA398 + push {lr} + movs r0, 0x1B + bl oe_active_list_remove + movs r0, 0x39 + bl oe_exec + pop {r0} + bx r0 + thumb_func_end sub_80FA398 + + thumb_func_start sub_80FA3AC +sub_80FA3AC: @ 80FA3AC + push {r4,lr} + bl sub_80F9F78 + ldr r0, _080FA3EC + ldr r3, _080FA3F0 + ldr r1, _080FA3F4 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 23 + ldr r4, _080FA3F8 + ldr r3, [r4, 0x14] + adds r1, r3 + lsls r1, 16 + asrs r1, 16 + ldrb r2, [r2] + ldr r3, [r4, 0x18] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x94 + bl obj_add_from_template_forward_search + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080FA3EC: .4byte 0x0858e630 +_080FA3F0: .4byte 0x02020630 +_080FA3F4: .4byte 0x02037590 +_080FA3F8: .4byte 0x02038c08 + thumb_func_end sub_80FA3AC + + thumb_func_start sub_80FA3FC +sub_80FA3FC: @ 80FA3FC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA9 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _080FA414 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FA414: .4byte sub_80FA418 + 1 + thumb_func_end sub_80FA3FC + + thumb_func_start sub_80FA418 +sub_80FA418: @ 80FA418 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0x27 + bgt _080FA438 + adds r0, r2, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080FA440 + bl sub_80E8D4C + b _080FA440 +_080FA438: + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, _080FA444 + str r0, [r1, 0x1C] +_080FA440: + pop {r0} + bx r0 + .align 2, 0 +_080FA444: .4byte sub_80FA448 + 1 + thumb_func_end sub_80FA418 + + thumb_func_start sub_80FA448 +sub_80FA448: @ 80FA448 + push {lr} + movs r1, 0x39 + bl oe_stop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FA448 + + thumb_func_start sub_80FA458 +sub_80FA458: @ 80FA458 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + ldr r0, _080FA498 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA49C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, sp + ldrh r0, [r0] + movs r2, 0 + strh r0, [r1, 0x8] + ldrh r0, [r4] + strh r0, [r1, 0xA] + strh r2, [r1, 0xC] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080FA498: .4byte sub_80FA4A0 + 1 +_080FA49C: .4byte 0x03005e00 + thumb_func_end sub_80FA458 + + thumb_func_start sub_80FA4A0 +sub_80FA4A0: @ 80FA4A0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080FA4C8 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + subs r0, 0x4 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bhi _080FA56E + lsls r0, 2 + ldr r1, _080FA4CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FA4C8: .4byte 0x03005e08 +_080FA4CC: .4byte _080FA4D0 + .align 2, 0 +_080FA4D0: + .4byte _080FA514 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA522 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA514 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA522 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA540 +_080FA514: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x89 + lsls r2, 2 + b _080FA52E +_080FA522: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x88 + lsls r2, 2 +_080FA52E: + bl setmaptile_0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + b _080FA56E +_080FA540: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x89 + lsls r2, 2 + bl setmaptile_0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + movs r0, 0x3D + bl oe_active_list_remove + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl remove_task + b _080FA574 +_080FA56E: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] +_080FA574: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FA4A0 + + thumb_func_start sub_80FA57C +sub_80FA57C: @ 80FA57C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + movs r0, 0x3 + bl audio_play + ldr r0, _080FA5B4 + bl var_get + lsls r0, 16 + cmp r0, 0 + bne _080FA5B8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r2, 0xE2 + lsls r2, 4 + bl setmaptile_0 + b _080FA5C8 + .align 2, 0 +_080FA5B4: .4byte 0x00004054 +_080FA5B8: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, _080FA5E0 + bl setmaptile_0 +_080FA5C8: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FA5E0: .4byte 0x00000e21 + thumb_func_end sub_80FA57C + + thumb_func_start sub_80FA5E4 +sub_80FA5E4: @ 80FA5E4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, _080FA624 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA628 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x8] + strh r5, [r1, 0xA] + strh r6, [r1, 0xC] + strh r0, [r1, 0xE] + movs r0, 0x1 + strh r0, [r1, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FA624: .4byte sub_80FA62C + 1 +_080FA628: .4byte 0x03005e00 + thumb_func_end sub_80FA5E4 + + thumb_func_start sub_80FA62C +sub_80FA62C: @ 80FA62C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080FA64C + adds r4, r0, r1 + ldrh r1, [r4, 0x6] + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0x6 + bne _080FA650 + movs r0, 0 + b _080FA652 + .align 2, 0 +_080FA64C: .4byte 0x03005e08 +_080FA650: + adds r0, r1, 0x1 +_080FA652: + strh r0, [r4, 0x6] + movs r3, 0x6 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _080FA6A4 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _080FA66C + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_80FA6AC +_080FA66C: + movs r3, 0x2 + ldrsh r0, [r4, r3] + movs r2, 0x4 + ldrsh r1, [r4, r2] + ldrh r2, [r4, 0x8] + ldrh r3, [r4] + adds r2, r3 + lsls r2, 16 + lsrs r2, 16 + bl setmaptile_0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + ldrh r1, [r4, 0x8] + movs r3, 0x8 + ldrsh r0, [r4, r3] + cmp r0, 0x3 + bne _080FA6A0 + adds r0, r5, 0 + bl remove_task + b _080FA6A4 +_080FA6A0: + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_080FA6A4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FA62C + + thumb_func_start sub_80FA6AC +sub_80FA6AC: @ 80FA6AC + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 2 + cmp r1, r0 + beq _080FA6D8 + cmp r1, r0 + bgt _080FA6C8 + movs r0, 0x8A + lsls r0, 2 + cmp r1, r0 + beq _080FA6F0 + b _080FA6F6 +_080FA6C8: + movs r0, 0xCF + lsls r0, 2 + cmp r1, r0 + beq _080FA6E0 + adds r0, 0x4 + cmp r1, r0 + beq _080FA6E8 + b _080FA6F6 +_080FA6D8: + movs r0, 0x4A + bl audio_play + b _080FA6F6 +_080FA6E0: + movs r0, 0x4B + bl audio_play + b _080FA6F6 +_080FA6E8: + movs r0, 0x4C + bl audio_play + b _080FA6F6 +_080FA6F0: + movs r0, 0x4E + bl audio_play +_080FA6F6: + pop {r0} + bx r0 + thumb_func_end sub_80FA6AC + + thumb_func_start sub_80FA6FC +sub_80FA6FC: @ 80FA6FC + movs r0, 0 + bx lr + thumb_func_end sub_80FA6FC + + thumb_func_start sub_80FA700 +sub_80FA700: @ 80FA700 + movs r0, 0 + bx lr + thumb_func_end sub_80FA700 + + thumb_func_start sub_80FA704 +sub_80FA704: @ 80FA704 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x4D + bl audio_play + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + ldr r2, _080FA74C + adds r0, r5, 0 + adds r1, r4, 0 + bl setmaptile_0 + subs r6, r4, 0x1 + ldr r2, _080FA750 + adds r0, r5, 0 + adds r1, r6, 0 + bl setmaptile_0 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_draw_block_at + adds r0, r5, 0 + adds r1, r6, 0 + bl cur_mapdata_draw_block_at + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FA74C: .4byte 0x00000276 +_080FA750: .4byte 0x0000026e + thumb_func_end sub_80FA704 + + thumb_func_start sub_80FA754 +sub_80FA754: @ 80FA754 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080FA784 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0x7 + bne _080FA788 + movs r2, 0xA + ldrsh r0, [r1, r2] + movs r3, 0xC + ldrsh r1, [r1, r3] + bl sub_80FA704 + adds r0, r4, 0 + bl remove_task + b _080FA78C + .align 2, 0 +_080FA784: .4byte 0x03005e00 +_080FA788: + adds r0, r2, 0x1 + strh r0, [r1, 0x8] +_080FA78C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FA754 + + thumb_func_start sub_80FA794 +sub_80FA794: @ 80FA794 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + adds r7, r5, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FA7BC + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, r4, 16 + asrs r1, 16 + bl sub_80FA704 + b _080FA7DE +_080FA7BC: + cmp r0, 0x2 + bne _080FA7DE + ldr r0, _080FA7E4 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA7E8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r7, [r1, 0xA] + strh r6, [r1, 0xC] +_080FA7DE: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FA7E4: .4byte sub_80FA754 + 1 +_080FA7E8: .4byte 0x03005e00 + thumb_func_end sub_80FA794 + + thumb_func_start sub_80FA7EC +sub_80FA7EC: @ 80FA7EC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080FA824 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x7 + beq _080FA808 + b _080FA966 +_080FA808: + ldr r2, _080FA828 + adds r0, r2, 0 + ldrh r1, [r1, 0x8] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + bls _080FA81A + b _080FA95E +_080FA81A: + lsls r0, 2 + ldr r1, _080FA82C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FA824: .4byte 0x03005e00 +_080FA828: .4byte 0xfffffd88 +_080FA82C: .4byte _080FA830 + .align 2, 0 +_080FA830: + .4byte _080FA920 + .4byte _080FA928 + .4byte _080FA930 + .4byte _080FA938 + .4byte _080FA940 + .4byte _080FA948 + .4byte _080FA950 + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA958 +_080FA920: + movs r0, 0x3E + bl audio_play + b _080FA95E +_080FA928: + movs r0, 0x3F + bl audio_play + b _080FA95E +_080FA930: + movs r0, 0x40 + bl audio_play + b _080FA95E +_080FA938: + movs r0, 0x41 + bl audio_play + b _080FA95E +_080FA940: + movs r0, 0x42 + bl audio_play + b _080FA95E +_080FA948: + movs r0, 0x43 + bl audio_play + b _080FA95E +_080FA950: + movs r0, 0x44 + bl audio_play + b _080FA95E +_080FA958: + movs r0, 0x45 + bl audio_play +_080FA95E: + adds r0, r4, 0 + bl remove_task + b _080FA96A +_080FA966: + adds r0, r2, 0x1 + strh r0, [r1, 0xA] +_080FA96A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FA7EC + + thumb_func_start sub_80FA970 +sub_80FA970: @ 80FA970 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _080FA99C + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FA9A0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x8] + strh r0, [r1, 0xA] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FA99C: .4byte sub_80FA7EC + 1 +_080FA9A0: .4byte 0x03005e00 + thumb_func_end sub_80FA970 + + thumb_func_start sub_80FA9A4 +sub_80FA9A4: @ 80FA9A4 + 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, 0x8 + bne _080FA9BC + movs r0, 0xC3 + bl audio_play +_080FA9BC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1F + ble _080FA9CA + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_080FA9CA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FA9A4 + + thumb_func_start sub_80FA9D0 +sub_80FA9D0: @ 80FA9D0 + push {r4,lr} + sub sp, 0x4 + ldr r3, _080FAA68 + ldr r2, _080FAA6C + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x10] + mov r0, sp + strh r1, [r0] + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x8 + movs r3, 0x4 + bl sub_80930E0 + ldr r0, _080FAA70 + ldr r0, [r0, 0x58] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080FAA5E + ldr r3, _080FAA74 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r3 + movs r0, 0x3E + adds r0, r4 + mov r12, r0 + ldrb r0, [r0] + movs r1, 0x2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0xF + ands r0, r1 + movs r1, 0x50 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r3, 0x1C + adds r2, r3 + ldr r0, _080FAA78 + str r0, [r2] + movs r0, 0 + strh r0, [r4, 0x2E] +_080FAA5E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FAA68: .4byte 0x02037350 +_080FAA6C: .4byte 0x02037590 +_080FAA70: .4byte 0x085059f8 +_080FAA74: .4byte 0x02020630 +_080FAA78: .4byte sub_80FA9A4 + 1 + thumb_func_end sub_80FA9D0 + + thumb_func_start sub_80FAA7C +sub_80FAA7C: @ 80FAA7C + push {r4,lr} + sub sp, 0x4 + bl script_env_2_enable + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + ldr r1, _080FAAB8 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + str r0, [r1, 0x14] + movs r3, 0 + ldrsh r0, [r4, r3] + str r0, [r1, 0x18] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080FAAFC + cmp r0, 0x2 + bgt _080FAABC + cmp r0, 0x1 + beq _080FAAC6 + b _080FAB8C + .align 2, 0 +_080FAAB8: .4byte 0x02038c08 +_080FAABC: + cmp r0, 0x3 + beq _080FAB2C + cmp r0, 0x4 + beq _080FAB64 + b _080FAB8C +_080FAAC6: + ldr r0, _080FAAF0 + ldr r3, _080FAAF4 + ldr r1, _080FAAF8 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r3, 0x80 + lsls r3, 12 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + adds r2, 0x20 + movs r3, 0 + bl obj_add_from_template_forward_search + b _080FAB8C + .align 2, 0 +_080FAAF0: .4byte 0x0858e68c +_080FAAF4: .4byte 0x02020630 +_080FAAF8: .4byte 0x02037590 +_080FAAFC: + ldr r0, _080FAB20 + ldr r3, _080FAB24 + ldr r1, _080FAB28 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r3, 0x80 + lsls r3, 12 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + b _080FAB4C + .align 2, 0 +_080FAB20: .4byte 0x0858e68c +_080FAB24: .4byte 0x02020630 +_080FAB28: .4byte 0x02037590 +_080FAB2C: + ldr r0, _080FAB54 + ldr r3, _080FAB58 + ldr r1, _080FAB5C + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + ldr r3, _080FAB60 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + adds r2, 0x10 +_080FAB4C: + movs r3, 0x94 + bl obj_add_from_template_forward_search + b _080FAB8C + .align 2, 0 +_080FAB54: .4byte 0x0858e68c +_080FAB58: .4byte 0x02020630 +_080FAB5C: .4byte 0x02037590 +_080FAB60: .4byte 0xfff80000 +_080FAB64: + ldr r0, _080FAB98 + ldr r3, _080FAB9C + ldr r1, _080FABA0 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r3, 0xC0 + lsls r3, 13 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + adds r2, 0x10 + movs r3, 0x94 + bl obj_add_from_template_forward_search +_080FAB8C: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080FAB98: .4byte 0x0858e68c +_080FAB9C: .4byte 0x02020630 +_080FABA0: .4byte 0x02037590 + thumb_func_end sub_80FAA7C + + thumb_func_start door_restore_tilemap +door_restore_tilemap: @ 80FABA4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x83 + bl audio_play + ldr r4, _080FABD0 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + bl cur_mapdata_get_blockid_at + ldr r1, _080FABD4 + cmp r0, r1 + bne _080FABDC + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + ldr r2, _080FABD8 + bl setmaptile_0 + b _080FABEA + .align 2, 0 +_080FABD0: .4byte 0x02038c08 +_080FABD4: .4byte 0x00000286 +_080FABD8: .4byte 0x00000e02 +_080FABDC: + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + movs r2, 0xA1 + lsls r2, 2 + bl setmaptile_0 +_080FABEA: + ldr r4, _080FAC18 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + ldr r2, _080FAC1C + bl setmaptile_0 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + bl cur_mapdata_draw_block_at + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + bl cur_mapdata_draw_block_at + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, _080FAC20 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FAC18: .4byte 0x02038c08 +_080FAC1C: .4byte 0x0000020a +_080FAC20: .4byte sub_80FAC24 + 1 + thumb_func_end door_restore_tilemap + + thumb_func_start sub_80FAC24 +sub_80FAC24: @ 80FAC24 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x11 + bgt _080FAC38 + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _080FAC54 +_080FAC38: + ldr r4, _080FAC5C + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + ldr r2, _080FAC60 + bl setmaptile_0 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + bl cur_mapdata_draw_block_at + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, _080FAC64 + str r0, [r5, 0x1C] +_080FAC54: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FAC5C: .4byte 0x02038c08 +_080FAC60: .4byte 0x00000e8c +_080FAC64: .4byte sub_80FAC68 + 1 + thumb_func_end sub_80FAC24 + + thumb_func_start sub_80FAC68 +sub_80FAC68: @ 80FAC68 + push {lr} + movs r1, 0x34 + bl oe_stop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FAC68 + + thumb_func_start sub_80FAC78 +sub_80FAC78: @ 80FAC78 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_blockid_at + adds r1, r0, 0 + ldr r0, _080FACB0 + cmp r1, r0 + beq _080FAD6C + cmp r1, r0 + bgt _080FACB4 + subs r0, 0x17 + cmp r1, r0 + beq _080FAD14 + adds r0, 0x16 + cmp r1, r0 + beq _080FAD60 + b _080FADCE + .align 2, 0 +_080FACB0: .4byte 0x000002f5 +_080FACB4: + ldr r0, _080FACF8 + cmp r1, r0 + beq _080FADA4 + adds r0, 0x40 + cmp r1, r0 + beq _080FACC2 + b _080FADCE +_080FACC2: + ldr r0, _080FACFC + movs r1, 0x64 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, _080FAD00 + ldr r1, _080FAD04 + bl gf_strcpy + ldr r1, _080FAD08 + movs r0, 0 + strh r0, [r1] + ldr r0, _080FAD0C + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, _080FAD10 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x10 + b _080FAD8A + .align 2, 0 +_080FACF8: .4byte 0x000002f6 +_080FACFC: .4byte 0x02021cc4 +_080FAD00: .4byte 0x02021dc4 +_080FAD04: .4byte 0x085ea88b +_080FAD08: .4byte 0x020375f0 +_080FAD0C: .4byte 0x00004054 +_080FAD10: .4byte 0x000040ee +_080FAD14: + ldr r0, _080FAD48 + movs r1, 0x32 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _080FAD4C + ldr r1, _080FAD50 + bl gf_strcpy + ldr r1, _080FAD54 + movs r0, 0 + strh r0, [r1] + ldr r0, _080FAD58 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, _080FAD5C + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x20 + b _080FAD8A + .align 2, 0 +_080FAD48: .4byte 0x02021cc4 +_080FAD4C: .4byte 0x02021dc4 +_080FAD50: .4byte 0x085ea890 +_080FAD54: .4byte 0x020375f0 +_080FAD58: .4byte 0x00004054 +_080FAD5C: .4byte 0x000040ee +_080FAD60: + ldr r1, _080FAD68 + movs r0, 0x1 + b _080FAD70 + .align 2, 0 +_080FAD68: .4byte 0x020375f0 +_080FAD6C: + ldr r1, _080FAD98 + movs r0, 0x2 +_080FAD70: + strh r0, [r1] + ldr r0, _080FAD9C + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, _080FADA0 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x80 +_080FAD8A: + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set + b _080FADCE + .align 2, 0 +_080FAD98: .4byte 0x020375f0 +_080FAD9C: .4byte 0x00004054 +_080FADA0: .4byte 0x000040ee +_080FADA4: + ldr r1, _080FADD8 + movs r0, 0x3 + strh r0, [r1] + ldr r0, _080FADDC + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, _080FADE0 + adds r0, r4, 0 + bl var_get + adds r1, r0, 0 + movs r0, 0x80 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_080FADCE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FADD8: .4byte 0x020375f0 +_080FADDC: .4byte 0x00004054 +_080FADE0: .4byte 0x000040ee + thumb_func_end sub_80FAC78 + + thumb_func_start sub_80FADE4 +sub_80FADE4: @ 80FADE4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_80E9214 + lsls r0, 24 + cmp r0, 0 + beq _080FAE28 + cmp r5, 0 + bne _080FAE1C + ldr r1, _080FAE14 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080FAE10 + ldr r0, _080FAE18 + cmp r4, r0 + bne _080FAE28 +_080FAE10: + movs r0, 0x1 + b _080FAE2A + .align 2, 0 +_080FAE14: .4byte 0xfffffd7b +_080FAE18: .4byte 0x00000237 +_080FAE1C: + ldr r0, _080FAE30 + cmp r4, r0 + beq _080FAE10 + ldr r0, _080FAE34 + cmp r6, r0 + beq _080FAE10 +_080FAE28: + movs r0, 0 +_080FAE2A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080FAE30: .4byte 0x0000028d +_080FAE34: .4byte 0x0000023f + thumb_func_end sub_80FADE4 + + thumb_func_start task50_overworld_posion_effect +task50_overworld_posion_effect: @ 80FAE38 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _080FAE5C + adds r1, r0, r1 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + beq _080FAE76 + cmp r0, 0x1 + bgt _080FAE60 + cmp r0, 0 + beq _080FAE66 + b _080FAE92 + .align 2, 0 +_080FAE5C: .4byte 0x03005e08 +_080FAE60: + cmp r0, 0x2 + beq _080FAE8A + b _080FAE92 +_080FAE66: + ldrh r0, [r1, 0x2] + adds r0, 0x2 + strh r0, [r1, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080FAE92 + b _080FAE82 +_080FAE76: + ldrh r0, [r1, 0x2] + subs r0, 0x2 + strh r0, [r1, 0x2] + lsls r0, 16 + cmp r0, 0 + bne _080FAE92 +_080FAE82: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080FAE92 +_080FAE8A: + adds r0, r2, 0 + bl remove_task + b _080FAEA2 +_080FAE92: + ldrh r0, [r1, 0x2] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set +_080FAEA2: + pop {r0} + bx r0 + thumb_func_end task50_overworld_posion_effect + + thumb_func_start overworld_posion_effect +overworld_posion_effect: @ 80FAEA8 + push {lr} + movs r0, 0x4F + bl audio_play + ldr r0, _080FAEBC + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080FAEBC: .4byte task50_overworld_posion_effect + 1 + thumb_func_end overworld_posion_effect + + thumb_func_start c3_80A0DD8_is_running +c3_80A0DD8_is_running: @ 80FAEC0 + push {lr} + ldr r0, _080FAED0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080FAED0: .4byte task50_overworld_posion_effect + 1 + thumb_func_end c3_80A0DD8_is_running + + thumb_func_start sub_80FAED4 +sub_80FAED4: @ 80FAED4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FAEE8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _080FAEEC + str r0, [r1] + bx lr + .align 2, 0 +_080FAEE8: .4byte 0x03005e00 +_080FAEEC: .4byte sub_80FAEF0 + 1 + thumb_func_end sub_80FAED4 + + thumb_func_start sub_80FAEF0 +sub_80FAEF0: @ 80FAEF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080FAF54 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080FAF58 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _080FAF1C + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080FAF4E +_080FAF1C: + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl sub_808C228 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl d2s_08064244 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_state_2 + ldr r1, _080FAF5C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080FAF60 + str r1, [r0] +_080FAF4E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FAF54: .4byte 0x02037590 +_080FAF58: .4byte 0x02037350 +_080FAF5C: .4byte 0x03005e00 +_080FAF60: .4byte sub_80FAF64 + 1 + thumb_func_end sub_80FAEF0 + + thumb_func_start sub_80FAF64 +sub_80FAF64: @ 80FAF64 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FAFB8 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080FAFBC + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _080FAFC8 + ldr r1, _080FAFC0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xA] + adds r1, r0, 0x1 + strh r1, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bgt _080FAFC4 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + bl d2s_08064244 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_state_2 + b _080FAFC8 + .align 2, 0 +_080FAFB8: .4byte 0x02037590 +_080FAFBC: .4byte 0x02037350 +_080FAFC0: .4byte 0x03005e00 +_080FAFC4: + ldr r0, _080FAFD0 + str r0, [r2] +_080FAFC8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FAFD0: .4byte sub_80FAFD4 + 1 + thumb_func_end sub_80FAF64 + + thumb_func_start sub_80FAFD4 +sub_80FAFD4: @ 80FAFD4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_808BCD0 + lsls r0, 24 + lsrs r0, 24 + bl walkrun_set_bike_bits + 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_80FAFD4 + + thumb_func_start sub_80FAFF8 +sub_80FAFF8: @ 80FAFF8 + push {lr} + ldr r0, _080FB008 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080FB008: .4byte sub_80FAED4 + 1 + thumb_func_end sub_80FAFF8 + + thumb_func_start sub_80FB00C +sub_80FB00C: @ 80FB00C + push {r4,r5,lr} + ldr r0, _080FB060 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _080FB064 + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _080FB06C + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, _080FB068 + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r0, 0x10 + movs r1, 0xD + bl sub_8092FF0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x10 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x22] + adds r0, 0x2 + strh r0, [r4, 0x22] + adds r0, r5, 0 + b _080FB06E + .align 2, 0 +_080FB060: .4byte 0x0858e864 +_080FB064: .4byte 0x0858e880 +_080FB068: .4byte 0x02020630 +_080FB06C: + movs r0, 0x40 +_080FB06E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FB00C + + thumb_func_start sub_80FB074 +sub_80FB074: @ 80FB074 + push {r4-r7,lr} + ldr r4, _080FB0A8 + adds r7, r4, 0 + movs r6, 0 + movs r5, 0x3F +_080FB07E: + adds r0, r7, 0 + adds r0, 0x14 + adds r0, r6, r0 + ldr r1, [r0] + ldr r0, _080FB0AC + cmp r1, r0 + bne _080FB098 + adds r0, r4, 0 + bl obj_free_pal + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_080FB098: + adds r4, 0x44 + adds r6, 0x44 + subs r5, 0x1 + cmp r5, 0 + bge _080FB07E + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FB0A8: .4byte 0x02020630 +_080FB0AC: .4byte 0x0858e880 + thumb_func_end sub_80FB074 + + thumb_func_start sub_80FB0B0 +sub_80FB0B0: @ 80FB0B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x78 + bl __modsi3 + cmp r0, 0 + bne _080FB0C4 + movs r0, 0x1 + negs r0, r0 + b _080FB0D6 +_080FB0C4: + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + cmp r0, 0x4 + ble _080FB0D4 + movs r0, 0 + b _080FB0D6 +_080FB0D4: + movs r0, 0x1 +_080FB0D6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FB0B0 + + thumb_func_start sub_80FB0DC +sub_80FB0DC: @ 80FB0DC + push {lr} + adds r0, 0x78 + movs r1, 0xB4 + bl __modsi3 + cmp r0, 0 + beq _080FB0EE + movs r0, 0 + b _080FB0F2 +_080FB0EE: + movs r0, 0x1 + negs r0, r0 +_080FB0F2: + pop {r1} + bx r1 + thumb_func_end sub_80FB0DC + + thumb_func_start sub_80FB0F8 +sub_80FB0F8: @ 80FB0F8 + 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, _080FB19C + adds r5, r1, r0 + movs r1, 0 + ldrsh r0, [r5, r1] + adds r0, 0x1E + bl sub_80FB0DC + ldr r4, _080FB1A0 + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + lsls r0, 18 + movs r3, 0xC0 + lsls r3, 10 + orrs r0, r3 + asrs r0, 16 + str r0, [sp] + movs r0, 0x1 + movs r3, 0x3 + bl sub_808E82C + movs r3, 0 + ldrsh r0, [r5, r3] + bl sub_80FB0DC + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + lsls r0, 17 + ldr r3, _080FB1A4 + adds r0, r3 + asrs r0, 16 + str r0, [sp] + movs r0, 0x2 + movs r3, 0 + bl sub_808E82C + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_80FB0DC + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r4, 0 + movs r3, 0x3 + negs r3, r3 + lsls r0, 18 + asrs r0, 16 + str r0, [sp] + movs r0, 0x3 + bl sub_808E82C + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + ldr r1, _080FB1A8 + cmp r0, r1 + bne _080FB180 + strh r4, [r5] +_080FB180: + movs r3, 0 + ldrsh r0, [r5, r3] + bl sub_80FB0B0 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_808A2CC + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FB19C: .4byte 0x03005e08 +_080FB1A0: .4byte 0x03005d8c +_080FB1A4: .4byte 0xfffd0000 +_080FB1A8: .4byte 0x75300000 + thumb_func_end sub_80FB0F8 + + thumb_func_start sub_80FB1AC +sub_80FB1AC: @ 80FB1AC + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r3, r0, 3 + ldr r4, _080FB1EC + adds r7, r3, r4 + ldrh r1, [r7] + adds r1, 0x1 + strh r1, [r7] + ldrh r0, [r7, 0x4] + adds r0, 0x1 + strh r0, [r7, 0x4] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x5 + ble _080FB1DC + movs r0, 0 + strh r0, [r7] + ldrh r0, [r7, 0x2] + adds r0, 0x1 + strh r0, [r7, 0x2] +_080FB1DC: + ldrh r0, [r7, 0x2] + cmp r0, 0x13 + bne _080FB1F0 + adds r0, r2, 0 + bl remove_task + b _080FB2A8 + .align 2, 0 +_080FB1EC: .4byte 0x03005e08 +_080FB1F0: + ldr r2, _080FB2B0 + movs r1, 0x2 + ldrsh r0, [r7, r1] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x2 + bne _080FB20C + adds r0, r4, 0 + subs r0, 0x8 + adds r0, r3, r0 + ldr r1, _080FB2B4 + str r1, [r0] +_080FB20C: + movs r4, 0x2 + ldrsh r0, [r7, r4] + adds r0, r2 + movs r5, 0 + ldrsb r5, [r0, r5] + lsls r5, 16 + lsrs r5, 16 + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_80FB0B0 + adds r1, r0, 0 + lsls r5, 16 + asrs r5, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_808A2CC + movs r4, 0x4 + ldrsh r0, [r7, r4] + adds r0, 0x1E + bl sub_80FB0DC + ldr r6, _080FB2B8 + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r3, 0x3 + subs r3, r5 + lsls r3, 16 + asrs r3, 16 + lsls r0, 18 + movs r4, 0xC0 + lsls r4, 10 + orrs r0, r4 + asrs r0, 16 + str r0, [sp] + movs r0, 0x1 + bl sub_808E82C + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_80FB0DC + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + negs r3, r5 + lsls r3, 16 + asrs r3, 16 + lsls r0, 17 + ldr r4, _080FB2BC + adds r0, r4 + asrs r0, 16 + str r0, [sp] + movs r0, 0x2 + bl sub_808E82C + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_80FB0DC + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r4, 0x3 + negs r4, r4 + adds r3, r4, 0 + subs r3, r5 + lsls r3, 16 + asrs r3, 16 + lsls r0, 18 + asrs r0, 16 + str r0, [sp] + movs r0, 0x3 + bl sub_808E82C +_080FB2A8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FB2B0: .4byte 0x0858e898 +_080FB2B4: .4byte sub_80FB2C0 + 1 +_080FB2B8: .4byte 0x03005d8c +_080FB2BC: .4byte 0xfffd0000 + thumb_func_end sub_80FB1AC + + thumb_func_start sub_80FB2C0 +sub_80FB2C0: @ 80FB2C0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, _080FB300 + adds r2, r0, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080FB2F0 + movs r0, 0 + strh r0, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] +_080FB2F0: + ldrh r0, [r2, 0x2] + cmp r0, 0x13 + bne _080FB304 + adds r0, r3, 0 + bl remove_task + b _080FB358 + .align 2, 0 +_080FB300: .4byte 0x03005e08 +_080FB304: + ldr r1, _080FB364 + movs r3, 0x2 + ldrsh r0, [r2, r3] + adds r0, r1 + movs r1, 0 + mov r8, r1 + movs r6, 0 + ldrsb r6, [r0, r6] + adds r0, r6, 0 + bl sub_808A2CC + ldr r5, _080FB368 + ldr r0, [r5] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r3, 0x3 + subs r3, r6 + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + bl sub_808E82C + ldr r0, [r5] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + negs r3, r6 + mov r4, r8 + subs r4, 0x3 + str r4, [sp] + movs r0, 0x2 + bl sub_808E82C + ldr r0, [r5] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + subs r4, r6 + mov r3, r8 + str r3, [sp] + movs r0, 0x3 + adds r3, r4, 0 + bl sub_808E82C +_080FB358: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FB364: .4byte 0x0858e898 +_080FB368: .4byte 0x03005d8c + thumb_func_end sub_80FB2C0 + + thumb_func_start sub_80FB36C +sub_80FB36C: @ 80FB36C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080FB390 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _080FB386 + b _080FB4D8 +_080FB386: + lsls r0, 2 + ldr r1, _080FB394 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FB390: .4byte 0x03005e08 +_080FB394: .4byte _080FB398 + .align 2, 0 +_080FB398: + .4byte _080FB3B0 + .4byte _080FB3E8 + .4byte _080FB404 + .4byte _080FB450 + .4byte _080FB474 + .4byte _080FB492 +_080FB3B0: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + beq _080FB3C0 + b _080FB4D8 +_080FB3C0: + movs r0, 0 + bl sub_808A2C0 + movs r0, 0 + strh r0, [r4, 0x2] + ldr r0, _080FB3E4 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x4] + movs r0, 0x1 + strh r0, [r4] + movs r0, 0x31 + bl audio_play + b _080FB4D8 + .align 2, 0 +_080FB3E4: .4byte sub_80FB0F8 + 1 +_080FB3E8: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x96 + bne _080FB4D8 + bl pal_fill_black + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x2 + strh r0, [r4] + b _080FB4D8 +_080FB404: + ldrh r0, [r4, 0x2] + adds r3, r0, 0x1 + strh r3, [r4, 0x2] + ldr r0, _080FB448 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080FB4D8 + lsls r1, r3, 16 + movs r0, 0x96 + lsls r0, 17 + cmp r1, r0 + ble _080FB4D8 + strh r2, [r4, 0x2] + ldrb r0, [r4, 0x4] + bl remove_task + ldr r0, _080FB44C + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x6] + movs r0, 0x3 + strh r0, [r4] + movs r0, 0x32 + bl audio_play + b _080FB4D8 + .align 2, 0 +_080FB448: .4byte 0x02037fd4 +_080FB44C: .4byte sub_80FB1AC + 1 +_080FB450: + ldr r2, _080FB470 + movs r0, 0x6 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r5, [r0, 0x4] + cmp r5, 0 + bne _080FB4D8 + bl sub_808A2E4 + strh r5, [r4, 0x2] + movs r0, 0x4 + strh r0, [r4] + b _080FB4D8 + .align 2, 0 +_080FB470: .4byte 0x03005e00 +_080FB474: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + bne _080FB4D8 + movs r0, 0x33 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x5 + strh r0, [r4] + b _080FB4D8 +_080FB492: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bne _080FB4D8 + movs r2, 0x82 + lsls r2, 2 + movs r0, 0xB + movs r1, 0x8 + bl setmaptile_0 + movs r2, 0x84 + lsls r2, 2 + movs r0, 0xB + movs r1, 0x9 + bl setmaptile_0 + movs r2, 0x86 + lsls r2, 2 + movs r0, 0xB + movs r1, 0xA + bl setmaptile_0 + bl cur_mapdata_full_redraw + movs r0, 0x34 + bl audio_play + adds r0, r5, 0 + bl remove_task + bl script_env_2_disable +_080FB4D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FB36C + + thumb_func_start sub_80FB4E0 +sub_80FB4E0: @ 80FB4E0 + push {lr} + sub sp, 0x4 + ldr r2, _080FB528 + movs r0, 0xB + movs r1, 0x8 + bl setmaptile_0 + ldr r2, _080FB52C + movs r0, 0xB + movs r1, 0x9 + bl setmaptile_0 + ldr r2, _080FB530 + movs r0, 0xB + movs r1, 0xA + bl setmaptile_0 + bl cur_mapdata_full_redraw + bl script_env_2_enable + movs r0, 0 + str r0, [sp] + ldr r1, _080FB534 + ldr r2, _080FB538 + mov r0, sp + bl CpuFastSet + ldr r0, _080FB53C + movs r1, 0xA + bl AddTask + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080FB528: .4byte 0x0000020d +_080FB52C: .4byte 0x00000215 +_080FB530: .4byte 0x0000021d +_080FB534: .4byte 0x02037b14 +_080FB538: .4byte 0x01000100 +_080FB53C: .4byte sub_80FB36C + 1 + thumb_func_end sub_80FB4E0 + + thumb_func_start sub_80FB540 +sub_80FB540: @ 80FB540 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, _080FB594 + bl is_function_an_active_task + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080FB58A + ldr r4, _080FB598 + ldr r0, [r4] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + movs r3, 0x3 + bl sub_808E82C + ldr r0, [r4] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r5, 0x3 + negs r5, r5 + str r5, [sp] + movs r0, 0x2 + movs r3, 0 + bl sub_808E82C + ldr r0, [r4] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + str r6, [sp] + movs r0, 0x3 + adds r3, r5, 0 + bl sub_808E82C +_080FB58A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FB594: .4byte sub_80FB36C + 1 +_080FB598: .4byte 0x03005d8c + thumb_func_end sub_80FB540 + + thumb_func_start sub_80FB59C +sub_80FB59C: @ 80FB59C + push {r4-r6,lr} + sub sp, 0xC + mov r4, sp + adds r4, 0x5 + mov r5, sp + adds r5, 0x6 + add r6, sp, 0x8 + add r0, sp, 0x4 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8137FFC + lsls r0, 24 + cmp r0, 0 + bne _080FB5DE + add r0, sp, 0x4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r4, r1] + movs r2, 0x1 + negs r2, r2 + movs r3, 0 + ldrsb r3, [r5, r3] + movs r4, 0 + ldrsb r4, [r6, r4] + str r4, [sp] + bl warp1_set + movs r0, 0x1 + b _080FB5E0 +_080FB5DE: + movs r0, 0 +_080FB5E0: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FB59C + + thumb_func_start sub_80FB5E8 +sub_80FB5E8: @ 80FB5E8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080FB618 + adds r4, r0, r1 + ldr r0, _080FB61C + bl var_get_pointer + adds r7, r0, 0 + ldr r0, _080FB620 + ldr r3, [r0] + adds r6, r3, 0x4 + movs r0, 0 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _080FB648 + cmp r2, 0x1 + bgt _080FB624 + cmp r2, 0 + beq _080FB62E + b _080FB6E2 + .align 2, 0 +_080FB618: .4byte 0x03005e08 +_080FB61C: .4byte 0x000040b4 +_080FB620: .4byte 0x03005d8c +_080FB624: + cmp r2, 0x2 + beq _080FB68A + cmp r2, 0x3 + beq _080FB6C4 + b _080FB6E2 +_080FB62E: + ldr r0, _080FB644 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080FB6E2 + strh r2, [r4, 0x2] + movs r0, 0x2 + strh r0, [r4] + b _080FB6E2 + .align 2, 0 +_080FB644: .4byte 0x02037fd4 +_080FB648: + ldr r0, _080FB67C + ldrh r1, [r0, 0x2E] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080FB656 + strh r2, [r4, 0x2] +_080FB656: + ldrb r1, [r6, 0x1] + ldrb r2, [r3, 0x4] + movs r0, 0xFF + bl sub_80D3340 + lsls r0, 24 + cmp r0, 0 + beq _080FB6E2 + movs r0, 0x1 + bl sub_8137FC0 + cmp r0, 0x1 + bne _080FB686 + ldrh r0, [r7] + cmp r0, 0x2 + bne _080FB680 + movs r0, 0x9 + b _080FB682 + .align 2, 0 +_080FB67C: .4byte 0x030022c0 +_080FB680: + movs r0, 0xA +_080FB682: + strh r0, [r7] + b _080FB692 +_080FB686: + movs r0, 0x2 + strh r0, [r4] +_080FB68A: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FB698 +_080FB692: + movs r0, 0x3 + strh r0, [r4] + b _080FB6E2 +_080FB698: + ldrh r0, [r7] + cmp r0, 0x2 + bne _080FB6AC + ldrb r1, [r6, 0x1] + ldrb r2, [r6] + ldr r3, _080FB6A8 + b _080FB6B2 + .align 2, 0 +_080FB6A8: .4byte 0x0858e8ab +_080FB6AC: + ldrb r1, [r6, 0x1] + ldrb r2, [r6] + ldr r3, _080FB6C0 +_080FB6B2: + movs r0, 0xFF + bl exec_movement + movs r0, 0x1 + strh r0, [r4] + b _080FB6E2 + .align 2, 0 +_080FB6C0: .4byte 0x0858e8ad +_080FB6C4: + ldr r0, _080FB6E8 + bl flag_clear + movs r0, 0x80 + lsls r0, 7 + bl flag_clear + movs r0, 0 + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + bl sp13E_warp_to_last_warp + adds r0, r5, 0 + bl remove_task +_080FB6E2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FB6E8: .4byte 0x00004001 + thumb_func_end sub_80FB5E8 + + thumb_func_start sub_80FB6EC +sub_80FB6EC: @ 80FB6EC + push {r4,lr} + sub sp, 0x4 + ldr r1, _080FB740 + movs r0, 0 + str r0, [sp] + movs r0, 0x8C + movs r2, 0x70 + movs r3, 0x50 + bl sub_808DD68 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FB744 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _080FB748 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _080FB74C + movs r0, 0x4 + bl npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + b _080FB75E + .align 2, 0 +_080FB740: .4byte nullsub_12 + 1 +_080FB744: .4byte 0x02020630 +_080FB748: .4byte 0x000040b4 +_080FB74C: + movs r0, 0x3 + bl npc_direction_to_obj_anim_image_number + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start +_080FB75E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FB6EC + + thumb_func_start sub_80FB768 +sub_80FB768: @ 80FB768 + push {lr} + bl sub_80FB6EC + ldr r2, _080FB798 + ldr r0, _080FB79C + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + bl pal_fill_black + ldr r0, _080FB7A0 + movs r1, 0x50 + bl AddTask + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_080FB798: .4byte 0x02037350 +_080FB79C: .4byte 0x02037590 +_080FB7A0: .4byte sub_80FB5E8 + 1 + thumb_func_end sub_80FB768 + + thumb_func_start sub_80FB7A4 +sub_80FB7A4: @ 80FB7A4 + push {lr} + ldr r0, _080FB7DC + bl flag_set + ldr r0, _080FB7E0 + bl flag_set + movs r0, 0x80 + lsls r0, 7 + bl flag_set + ldr r0, _080FB7E4 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + bl sub_80FB59C + bl sub_80AF8B8 + pop {r0} + bx r0 + .align 2, 0 +_080FB7DC: .4byte 0x0000088d +_080FB7E0: .4byte 0x00004001 +_080FB7E4: .4byte 0x03005d8c + thumb_func_end sub_80FB7A4 + + thumb_func_start sub_80FB7E8 +sub_80FB7E8: @ 80FB7E8 + push {lr} + ldr r0, _080FB7FC + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x86 + lsls r0, 1 + cmp r1, r0 + bne _080FB800 + movs r0, 0x1 + b _080FB812 + .align 2, 0 +_080FB7FC: .4byte 0x03005d8c +_080FB800: + ldr r0, _080FB80C + cmp r1, r0 + beq _080FB810 + movs r0, 0 + b _080FB812 + .align 2, 0 +_080FB80C: .4byte 0x0000081d +_080FB810: + movs r0, 0x2 +_080FB812: + pop {r1} + bx r1 + thumb_func_end sub_80FB7E8 + + thumb_func_start sub_80FB818 +sub_80FB818: @ 80FB818 + push {r4-r6,lr} + movs r0, 0x80 + lsls r0, 7 + bl var_get_pointer + adds r5, r0, 0 + movs r3, 0 + ldr r4, _080FB84C + ldrb r0, [r4] + cmp r3, r0 + bge _080FB844 + ldr r6, _080FB850 +_080FB830: + adds r2, r5, r3 + ldr r1, [r6] + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0, 0x5] + strb r0, [r2] + adds r3, 0x1 + ldrb r0, [r4] + cmp r3, r0 + blt _080FB830 +_080FB844: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FB84C: .4byte 0x0203a048 +_080FB850: .4byte 0x0203a044 + thumb_func_end sub_80FB818 + + thumb_func_start sub_80FB854 +sub_80FB854: @ 80FB854 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 7 + bl var_get_pointer + adds r0, r4 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FB854 + + thumb_func_start sub_80FB870 +sub_80FB870: @ 80FB870 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x80 + lsls r0, 7 + bl var_get_pointer + adds r0, r4 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FB870 + + thumb_func_start sub_80FB890 +sub_80FB890: @ 80FB890 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_80FB854 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0x1 + bne _080FB8B4 + cmp r1, 0 + beq _080FB8B0 + subs r0, r1, 0x1 + lsls r0, 24 + b _080FB8BE +_080FB8B0: + movs r1, 0x3 + b _080FB8C0 +_080FB8B4: + adds r1, 0x1 + lsls r1, 24 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r1 +_080FB8BE: + lsrs r1, r0, 24 +_080FB8C0: + adds r0, r5, 0 + bl sub_80FB870 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FB890 + + thumb_func_start sub_80FB8CC +sub_80FB8CC: @ 80FB8CC + push {lr} + bl sub_80FB7E8 + cmp r0, 0x1 + beq _080FB8E0 + cmp r0, 0x1 + ble _080FB914 + cmp r0, 0x2 + beq _080FB8F8 + b _080FB914 +_080FB8E0: + ldr r1, _080FB8EC + ldr r0, _080FB8F0 + str r0, [r1] + ldr r1, _080FB8F4 + movs r0, 0x8 + b _080FB902 + .align 2, 0 +_080FB8EC: .4byte 0x0203a044 +_080FB8F0: .4byte 0x0858e8b0 +_080FB8F4: .4byte 0x0203a048 +_080FB8F8: + ldr r1, _080FB918 + ldr r0, _080FB91C + str r0, [r1] + ldr r1, _080FB920 + movs r0, 0xB +_080FB902: + strb r0, [r1] + movs r1, 0 + ldr r3, _080FB924 + movs r2, 0x40 +_080FB90A: + adds r0, r1, r3 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0xA + bls _080FB90A +_080FB914: + pop {r0} + bx r0 + .align 2, 0 +_080FB918: .4byte 0x0203a044 +_080FB91C: .4byte 0x0858e8f0 +_080FB920: .4byte 0x0203a048 +_080FB924: .4byte 0x0203a038 + thumb_func_end sub_80FB8CC + + thumb_func_start sub_80FB928 +sub_80FB928: @ 80FB928 + 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 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + ldr r0, _080FB9EC + ldr r2, [r0] + ldrh r1, [r2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrh r1, [r2, 0x2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r2, r0, 16 + adds r1, 0xE + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r5, 0 + ldr r0, _080FB9F0 + ldrb r0, [r0] + cmp r5, r0 + bcs _080FB9DA + lsls r0, r2, 16 + asrs r7, r0, 16 + lsls r0, r3, 16 + asrs r6, r0, 16 +_080FB976: + ldr r0, _080FB9F4 + ldr r0, [r0] + lsls r1, r5, 3 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r1, 0x2] + adds r0, 0x7 + lsls r0, 16 + asrs r1, r0, 16 + cmp r7, r1 + bgt _080FB9CC + mov r3, r8 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + blt _080FB9CC + lsls r0, r2, 16 + asrs r1, r0, 16 + cmp r6, r1 + bgt _080FB9CC + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r1 + blt _080FB9CC + ldr r0, _080FB9F8 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0x40 + bne _080FB9CC + ldr r3, [sp] + lsls r1, r3, 16 + mov r0, r10 + lsls r2, r0, 16 + adds r0, r5, 0 + asrs r1, 16 + asrs r2, 16 + bl sub_80FB9FC + strb r0, [r4] +_080FB9CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080FB9F0 + ldrb r0, [r0] + cmp r5, r0 + bcc _080FB976 +_080FB9DA: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FB9EC: .4byte 0x03005d8c +_080FB9F0: .4byte 0x0203a048 +_080FB9F4: .4byte 0x0203a044 +_080FB9F8: .4byte 0x0203a038 + thumb_func_end sub_80FB928 + + thumb_func_start sub_80FB9FC +sub_80FB9FC: @ 80FB9FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r0, _080FBA2C + lsls r1, r6, 3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _080FBA24 + cmp r0, 0x4 + bne _080FBA34 +_080FBA24: + mov r1, sp + ldr r0, _080FBA30 + b _080FBA38 + .align 2, 0 +_080FBA2C: .4byte 0x0203a044 +_080FBA30: .4byte 0x08591fe0 +_080FBA34: + mov r1, sp + ldr r0, _080FBACC +_080FBA38: + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r2, sp + ldrb r0, [r4, 0x4] + movs r3, 0x98 + lsls r3, 5 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r2] + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0x94 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _080FBAD4 + ldrh r0, [r4] + adds r0, 0x7 + ldrh r1, [r4, 0x2] + adds r1, 0x7 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r2, _080FBAD0 + adds r4, r2 + strh r6, [r4, 0x2E] + movs r2, 0x3E + adds r2, r4 + mov r12, r2 + ldrb r2, [r2] + movs r3, 0x2 + orrs r2, r3 + mov r3, r12 + strb r2, [r3] + lsls r0, 16 + asrs r0, 16 + lsls r2, r7, 16 + asrs r2, 16 + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + mov r3, r8 + lsls r2, r3, 16 + asrs r2, 16 + 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 + adds r0, r4, 0 + bl sub_80FBB64 + adds r0, r6, 0 + bl sub_80FB854 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8008258 + adds r0, r5, 0 + b _080FBAD6 + .align 2, 0 +_080FBACC: .4byte 0x08591fc8 +_080FBAD0: .4byte 0x02020630 +_080FBAD4: + movs r0, 0x40 +_080FBAD6: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80FB9FC + + thumb_func_start sub_80FBAE4 +sub_80FBAE4: @ 80FBAE4 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x30] + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r6, 0x32] + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + adds r0, r6, 0 + bl sub_80FBB64 + cmp r5, 0x1 + bne _080FBB2A + adds r0, r4, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080FBB1A + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 +_080FBB1A: + movs r0, 0x30 + bl audio_play + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8008258 + b _080FBB58 +_080FBB2A: + cmp r5, 0x2 + bne _080FBB58 + adds r0, r7, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080FBB4A + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 +_080FBB4A: + movs r0, 0x30 + bl audio_play + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8008258 +_080FBB58: + movs r0, 0 + strh r0, [r6, 0x30] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FBAE4 + + thumb_func_start sub_80FBB64 +sub_80FBB64: @ 80FBB64 + push {r4-r6,lr} + mov r12, r0 + mov r4, r12 + adds r4, 0x3E + ldrb r0, [r4] + movs r5, 0x5 + negs r5, r5 + ands r5, r0 + strb r5, [r4] + mov r0, r12 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + adds r0, 0x28 + movs r2, 0 + ldrsb r2, [r0, r2] + ldr r0, _080FBBF8 + adds r2, r1 + ldrh r0, [r0] + adds r2, r0 + lsls r2, 16 + mov r3, r12 + ldrh r1, [r3, 0x26] + ldrh r0, [r3, 0x22] + adds r1, r0 + mov r0, r12 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldr r3, _080FBBFC + adds r0, r1 + ldrh r3, [r3] + adds r0, r3 + lsls r0, 16 + movs r3, 0x80 + lsls r3, 15 + adds r1, r2, r3 + lsrs r1, 16 + lsrs r6, r0, 16 + adds r0, r3 + lsrs r3, r0, 16 + asrs r2, 16 + cmp r2, 0xFF + bgt _080FBBCA + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080FBBD2 +_080FBBCA: + movs r1, 0x4 + adds r0, r5, 0 + orrs r0, r1 + strb r0, [r4] +_080FBBD2: + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xAF + bgt _080FBBE6 + lsls r0, r3, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080FBBF2 +_080FBBE6: + mov r0, r12 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080FBBF2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FBBF8: .4byte 0x02021bbc +_080FBBFC: .4byte 0x02021bbe + thumb_func_end sub_80FBB64 + + thumb_func_start overworld_free_bgmaps +overworld_free_bgmaps: @ 80FBC00 + push {lr} + ldr r0, _080FBC0C + bl gpu_tile_obj_alloc_and_load_multiple + pop {r0} + bx r0 + .align 2, 0 +_080FBC0C: .4byte 0x08591d58 + thumb_func_end overworld_free_bgmaps + + thumb_func_start sub_80FBC10 +sub_80FBC10: @ 80FBC10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _080FBC44 + ldr r2, [r0] + ldrh r1, [r2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrh r1, [r2, 0x2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r1, 0xE + lsls r1, 16 + lsrs r7, r1, 16 + movs r6, 0 + b _080FBCB6 + .align 2, 0 +_080FBC44: .4byte 0x03005d8c +_080FBC48: + ldr r0, _080FBCCC + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r1, 0x2] + adds r0, 0x7 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _080FBCD0 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x40 + beq _080FBCB4 + lsls r0, r2, 16 + mov r2, r10 + lsls r1, r2, 16 + asrs r2, r0, 16 + cmp r0, r1 + blt _080FBC94 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + cmp r2, r0 + bgt _080FBC94 + lsls r0, r3, 16 + mov r2, r8 + lsls r1, r2, 16 + asrs r2, r0, 16 + cmp r0, r1 + blt _080FBC94 + lsls r0, r7, 16 + asrs r0, 16 + cmp r2, r0 + ble _080FBCB4 +_080FBC94: + ldr r0, _080FBCD0 + adds r5, r6, r0 + ldrb r0, [r5] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080FBCD4 + adds r4, r0 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + movs r0, 0x40 + strb r0, [r5] +_080FBCB4: + adds r6, 0x1 +_080FBCB6: + ldr r0, _080FBCD8 + ldrb r0, [r0] + cmp r6, r0 + blt _080FBC48 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FBCCC: .4byte 0x0203a044 +_080FBCD0: .4byte 0x0203a038 +_080FBCD4: .4byte 0x02020630 +_080FBCD8: .4byte 0x0203a048 + thumb_func_end sub_80FBC10 + + thumb_func_start sub_80FBCDC +sub_80FBCDC: @ 80FBCDC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r1, 0x1 + bne _080FBCFC + ldr r0, _080FBCF8 + mov r10, r0 + b _080FBD08 + .align 2, 0 +_080FBCF8: .4byte 0x08592058 +_080FBCFC: + cmp r1, 0x2 + beq _080FBD04 +_080FBD00: + movs r0, 0 + b _080FBD98 +_080FBD04: + ldr r1, _080FBDA8 + mov r10, r1 +_080FBD08: + adds r0, r4, 0 + bl sub_80FB854 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r0, _080FBDAC + ldr r1, [r0] + lsls r0, r4, 3 + adds r0, r1 + ldrb r2, [r0, 0x4] + ldrh r1, [r0] + adds r1, 0x7 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + movs r3, 0 + lsls r2, 3 + str r2, [sp, 0x4] + lsls r1, 16 + asrs r1, 16 + mov r9, r1 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 +_080FBD38: + movs r6, 0 + ldr r2, [sp] + adds r7, r2, r3 + lsls r0, r3, 1 + adds r5, r7, 0 + ldr r1, [sp, 0x4] + adds r0, r1 + ldr r2, _080FBDB0 + adds r4, r0, r2 +_080FBD4A: + adds r0, r5, 0 + cmp r5, 0 + bge _080FBD52 + adds r0, r7, 0x3 +_080FBD52: + asrs r0, 2 + lsls r0, 2 + subs r0, r5, r0 + lsls r0, 1 + adds r0, r6 + lsls r0, 24 + lsrs r1, r0, 24 + ldrb r0, [r4] + cmp r0, 0 + beq _080FBD88 + lsls r1, 2 + add r1, r10 + movs r0, 0 + ldrsb r0, [r1, r0] + add r0, r9 + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + add r1, r8 + str r3, [sp, 0x8] + bl cur_mapdata_get_middle2bit_at + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x8] + cmp r0, 0x1 + beq _080FBD00 +_080FBD88: + adds r4, 0x1 + adds r6, 0x1 + cmp r6, 0x1 + ble _080FBD4A + adds r3, 0x1 + cmp r3, 0x3 + ble _080FBD38 + movs r0, 0x1 +_080FBD98: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080FBDA8: .4byte 0x08592038 +_080FBDAC: .4byte 0x0203a044 +_080FBDB0: .4byte 0x08592078 + thumb_func_end sub_80FBCDC + + thumb_func_start sub_80FBDB4 +sub_80FBDB4: @ 80FBDB4 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r4, 24 + lsrs r5, r4, 24 + lsrs r4, 25 + movs r0, 0x1 + ands r5, r0 + adds r0, r6, 0 + bl sub_80FB854 + subs r4, r0 + adds r1, r4, 0x4 + adds r0, r1, 0 + cmp r1, 0 + bge _080FBDDA + adds r0, r4, 0x7 +_080FBDDA: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + ldr r1, _080FBE00 + ldr r2, [r1] + lsls r1, r6, 3 + adds r1, r2 + ldrb r1, [r1, 0x4] + ldr r2, _080FBE04 + lsls r0, 24 + asrs r0, 23 + adds r0, r5 + lsls r1, 3 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080FBE00: .4byte 0x0203a044 +_080FBE04: .4byte 0x08592078 + thumb_func_end sub_80FBDB4 + + thumb_func_start sub_80FBE08 +sub_80FBE08: @ 80FBE08 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _080FBE34 + adds r2, r3, r0 + ldrb r0, [r2] + cmp r0, 0x40 + beq _080FBE2C + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _080FBE38 + adds r4, r0 + strh r1, [r4, 0x30] + adds r0, r3, 0 + bl sub_80FB854 + strh r0, [r4, 0x32] +_080FBE2C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FBE34: .4byte 0x0203a038 +_080FBE38: .4byte 0x02020630 + thumb_func_end sub_80FBE08 + + thumb_func_start sub_80FBE3C +sub_80FBE3C: @ 80FBE3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r0, 0x2 + bne _080FBE58 + ldr r3, _080FBE54 + b _080FBE7A + .align 2, 0 +_080FBE54: .4byte 0x08591ff8 +_080FBE58: + cmp r0, 0x1 + bne _080FBE64 + ldr r3, _080FBE60 + b _080FBE7A + .align 2, 0 +_080FBE60: .4byte 0x08592008 +_080FBE64: + cmp r0, 0x3 + bne _080FBE70 + ldr r3, _080FBE6C + b _080FBE7A + .align 2, 0 +_080FBE6C: .4byte 0x08592018 +_080FBE70: + cmp r3, 0x4 + beq _080FBE78 + movs r0, 0xFF + b _080FBE88 +_080FBE78: + ldr r3, _080FBE8C +_080FBE7A: + lsls r0, r2, 16 + lsls r1, 16 + asrs r1, 16 + asrs r0, 14 + adds r0, r1 + adds r0, r3, r0 + ldrb r0, [r0] +_080FBE88: + pop {r1} + bx r1 + .align 2, 0 +_080FBE8C: .4byte 0x08592028 + thumb_func_end sub_80FBE3C + + thumb_func_start sub_80FBE90 +sub_80FBE90: @ 80FBE90 + push {lr} + bl sub_80FB7E8 + cmp r0, 0 + beq _080FBEA2 + bl sub_80FB8CC + bl sub_80FB818 +_080FBEA2: + pop {r0} + bx r0 + thumb_func_end sub_80FBE90 + + thumb_func_start sub_80FBEA8 +sub_80FBEA8: @ 80FBEA8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + bl sub_80FB7E8 + cmp r0, 0 + beq _080FBECA + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + bl sub_80FB928 + bl sub_80FBC10 +_080FBECA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FBEA8 + + thumb_func_start sub_80FBED0 +sub_80FBED0: @ 80FBED0 + push {lr} + bl sub_80FB7E8 + cmp r0, 0 + beq _080FBEEA + bl overworld_free_bgmaps + bl sub_80FB8CC + movs r0, 0 + movs r1, 0 + bl sub_80FB928 +_080FBEEA: + pop {r0} + bx r0 + thumb_func_end sub_80FBED0 + + thumb_func_start sub_80FBEF0 +sub_80FBEF0: @ 80FBEF0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl sub_80FB7E8 + cmp r0, 0 + bne _080FBF24 + b _080FBFC2 +_080FBF12: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBE08 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FB890 + b _080FBFC2 +_080FBF24: + movs r6, 0 + ldr r0, _080FBFB0 + ldrb r0, [r0] + cmp r6, r0 + bge _080FBFC2 + lsls r0, r4, 16 + asrs r7, r0, 16 +_080FBF32: + ldr r0, _080FBFB4 + ldr r1, [r0] + lsls r0, r6, 3 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x7 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + subs r0, r4, 0x2 + cmp r0, r7 + bgt _080FBFB8 + adds r0, r4, 0x1 + cmp r7, r0 + bgt _080FBFB8 + lsls r0, r2, 16 + asrs r3, r0, 16 + subs r1, r3, 0x2 + mov r2, r8 + lsls r0, r2, 16 + asrs r2, r0, 16 + cmp r1, r2 + bgt _080FBFB8 + adds r0, r3, 0x1 + cmp r2, r0 + bgt _080FBFB8 + subs r1, r7, r4 + adds r1, 0x2 + subs r2, r3 + adds r2, 0x2 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + mov r0, r9 + bl sub_80FBE3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080FBFB8 + lsrs r5, r0, 4 + movs r1, 0xF + ands r1, r0 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80FBDB4 + cmp r0, 0 + beq _080FBFB8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBCDC + cmp r0, 0 + bne _080FBF12 + movs r0, 0x1 + b _080FBFC4 + .align 2, 0 +_080FBFB0: .4byte 0x0203a048 +_080FBFB4: .4byte 0x0203a044 +_080FBFB8: + adds r6, 0x1 + ldr r0, _080FBFD0 + ldrb r0, [r0] + cmp r6, r0 + blt _080FBF32 +_080FBFC2: + movs r0, 0 +_080FBFC4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080FBFD0: .4byte 0x0203a048 + thumb_func_end sub_80FBEF0 + + thumb_func_start sub_80FBFD4 +sub_80FBFD4: @ 80FBFD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl sub_80FB7E8 + cmp r0, 0 + bne _080FBFFA + b _080FC08A +_080FBFF6: + movs r0, 0x1 + b _080FC08C +_080FBFFA: + movs r6, 0 + ldr r0, _080FC098 + ldrb r0, [r0] + cmp r6, r0 + bge _080FC08A + lsls r0, r4, 16 + asrs r7, r0, 16 +_080FC008: + ldr r0, _080FC09C + ldr r1, [r0] + lsls r0, r6, 3 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x7 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + subs r0, r4, 0x2 + cmp r0, r7 + bgt _080FC080 + adds r0, r4, 0x1 + cmp r7, r0 + bgt _080FC080 + lsls r0, r2, 16 + asrs r3, r0, 16 + subs r1, r3, 0x2 + mov r2, r8 + lsls r0, r2, 16 + asrs r2, r0, 16 + cmp r1, r2 + bgt _080FC080 + adds r0, r3, 0x1 + cmp r2, r0 + bgt _080FC080 + subs r1, r7, r4 + adds r1, 0x2 + subs r2, r3 + adds r2, 0x2 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + mov r0, r9 + bl sub_80FBE3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080FC080 + lsrs r5, r0, 4 + movs r1, 0xF + ands r1, r0 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80FBDB4 + cmp r0, 0 + beq _080FC080 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBCDC + cmp r0, 0 + beq _080FBFF6 +_080FC080: + adds r6, 0x1 + ldr r0, _080FC098 + ldrb r0, [r0] + cmp r6, r0 + blt _080FC008 +_080FC08A: + movs r0, 0 +_080FC08C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080FC098: .4byte 0x0203a048 +_080FC09C: .4byte 0x0203a044 + thumb_func_end sub_80FBFD4 + + thumb_func_start flag_check_is_in_safari_zone +flag_check_is_in_safari_zone: @ 80FC0A0 + push {lr} + ldr r0, _080FC0B0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080FC0B0: .4byte 0x0000088c + thumb_func_end flag_check_is_in_safari_zone + + thumb_func_start sub_80FC0B4 +sub_80FC0B4: @ 80FC0B4 + push {lr} + ldr r0, _080FC0C0 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_080FC0C0: .4byte 0x0000088c + thumb_func_end sub_80FC0B4 + + thumb_func_start flag_clear_is_in_safari_zone +flag_clear_is_in_safari_zone: @ 80FC0C4 + push {lr} + ldr r0, _080FC0D0 + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_080FC0D0: .4byte 0x0000088c + thumb_func_end flag_clear_is_in_safari_zone + + thumb_func_start sub_80FC0D4 +sub_80FC0D4: @ 80FC0D4 + push {lr} + movs r0, 0x11 + bl sav12_xor_increment + bl sub_80FC0B4 + bl sub_80FC244 + ldr r1, _080FC104 + movs r0, 0x1E + strb r0, [r1] + ldr r1, _080FC108 + movs r2, 0xFA + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _080FC10C + movs r1, 0 + strb r1, [r0] + ldr r0, _080FC110 + strb r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080FC104: .4byte 0x0203a04c +_080FC108: .4byte 0x0203a04e +_080FC10C: .4byte 0x0203a050 +_080FC110: .4byte 0x0203a051 + thumb_func_end sub_80FC0D4 + + thumb_func_start sub_80FC114 +sub_80FC114: @ 80FC114 + push {lr} + ldr r0, _080FC13C + ldrb r0, [r0] + ldr r1, _080FC140 + ldrb r1, [r1] + bl sub_80EE44C + bl flag_clear_is_in_safari_zone + bl sub_80FC244 + ldr r1, _080FC144 + movs r0, 0 + strb r0, [r1] + ldr r1, _080FC148 + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080FC13C: .4byte 0x0203a050 +_080FC140: .4byte 0x0203a051 +_080FC144: .4byte 0x0203a04c +_080FC148: .4byte 0x0203a04e + thumb_func_end sub_80FC114 + + thumb_func_start safari_step +safari_step: @ 80FC14C + push {lr} + bl flag_check_is_in_safari_zone + cmp r0, 0 + beq _080FC168 + bl sub_80FC480 + ldr r1, _080FC16C + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080FC170 +_080FC168: + movs r0, 0 + b _080FC178 + .align 2, 0 +_080FC16C: .4byte 0x0203a04e +_080FC170: + ldr r0, _080FC17C + bl script_env_1_execute_new_script + movs r0, 0x1 +_080FC178: + pop {r1} + bx r1 + .align 2, 0 +_080FC17C: .4byte 0x082a4b8a + thumb_func_end safari_step + + thumb_func_start sub_80FC180 +sub_80FC180: @ 80FC180 + push {lr} + ldr r0, _080FC18C + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_080FC18C: .4byte 0x082a4b6f + thumb_func_end sub_80FC180 + + thumb_func_start sub_80FC190 +sub_80FC190: @ 80FC190 + push {lr} + ldr r1, _080FC1C0 + ldr r0, _080FC1C4 + ldrb r0, [r0, 0x1F] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + ldr r2, _080FC1C8 + ldrb r0, [r2] + cmp r0, 0x7 + bne _080FC1AE + ldr r1, _080FC1CC + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080FC1AE: + ldr r0, _080FC1D0 + ldrb r0, [r0] + cmp r0, 0 + beq _080FC1D8 + ldr r0, _080FC1D4 + bl set_callback2 + b _080FC21C + .align 2, 0 +_080FC1C0: .4byte 0x0203a051 +_080FC1C4: .4byte 0x03005d10 +_080FC1C8: .4byte 0x0202433a +_080FC1CC: .4byte 0x0203a050 +_080FC1D0: .4byte 0x0203a04c +_080FC1D4: .4byte c2_exit_to_overworld_2_switch + 1 +_080FC1D8: + ldrb r0, [r2] + cmp r0, 0x8 + bne _080FC208 + ldr r0, _080FC1F8 + bl script_env_2_execute_new_script + bl warp_in + ldr r1, _080FC1FC + ldr r0, _080FC200 + str r0, [r1] + ldr r0, _080FC204 + bl set_callback2 + b _080FC21C + .align 2, 0 +_080FC1F8: .4byte 0x082a4b4c +_080FC1FC: .4byte 0x03005dac +_080FC200: .4byte sub_80AF6F0 + 1 +_080FC204: .4byte c2_load_new_map + 1 +_080FC208: + cmp r0, 0x7 + bne _080FC21C + ldr r0, _080FC220 + bl script_env_1_execute_new_script + bl script_env_2_set_ctx_paused + ldr r0, _080FC224 + bl set_callback2 +_080FC21C: + pop {r0} + bx r0 + .align 2, 0 +_080FC220: .4byte 0x082a4b9b +_080FC224: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_80FC190 + + thumb_func_start sub_80FC228 +sub_80FC228: @ 80FC228 + push {lr} + lsls r0, 24 + lsrs r0, 20 + ldr r1, _080FC240 + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_080FC240: .4byte 0x0203a054 + thumb_func_end sub_80FC228 + + thumb_func_start sub_80FC244 +sub_80FC244: @ 80FC244 + push {lr} + ldr r0, _080FC254 + movs r1, 0 + movs r2, 0xA0 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_080FC254: .4byte 0x0203a054 + thumb_func_end sub_80FC244 + + thumb_func_start sub_80FC258 +sub_80FC258: @ 80FC258 + push {r4,r5,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + movs r5, 0 +_080FC26A: + ldr r0, _080FC2B0 + ldr r2, [r0] + ldr r1, _080FC2B4 + lsls r0, r5, 4 + adds r3, r0, r1 + movs r1, 0x5 + ldrsb r1, [r2, r1] + movs r0, 0x4 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _080FC2C4 + mov r0, sp + movs r2, 0 + ldrsh r1, [r3, r2] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _080FC2C4 + movs r0, 0x2 + ldrsh r1, [r3, r0] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080FC2C4 + ldr r0, _080FC2B8 + strh r5, [r0] + ldr r1, _080FC2BC + ldrb r0, [r3, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, _080FC2C0 + bl gf_strcpy + b _080FC2D6 + .align 2, 0 +_080FC2B0: .4byte 0x03005d8c +_080FC2B4: .4byte 0x0203a054 +_080FC2B8: .4byte 0x020375f0 +_080FC2BC: .4byte 0x085b262c +_080FC2C0: .4byte 0x02021cc4 +_080FC2C4: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _080FC26A + ldr r1, _080FC2E0 + ldr r2, _080FC2E4 + adds r0, r2, 0 + strh r0, [r1] +_080FC2D6: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FC2E0: .4byte 0x020375f0 +_080FC2E4: .4byte 0x0000ffff + thumb_func_end sub_80FC258 + + thumb_func_start sub_80FC2E8 +sub_80FC2E8: @ 80FC2E8 + push {r4-r7,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + movs r5, 0 + adds r6, r4, 0 + ldr r0, _080FC358 + ldr r7, [r0] + mov r4, sp + ldr r0, _080FC35C + mov r12, r0 +_080FC306: + lsls r0, r5, 4 + mov r1, r12 + adds r3, r0, r1 + movs r1, 0x5 + ldrsb r1, [r7, r1] + movs r0, 0x4 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _080FC364 + ldrh r0, [r4] + ldrh r1, [r3] + subs r0, r1 + strh r0, [r4] + adds r2, r6, 0 + ldrh r0, [r2] + ldrh r1, [r3, 0x2] + subs r0, r1 + strh r0, [r2] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _080FC336 + negs r0, r0 + strh r0, [r4] +_080FC336: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0 + bge _080FC342 + negs r0, r0 + strh r0, [r2] +_080FC342: + movs r2, 0 + ldrsh r0, [r4, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + adds r0, r1 + cmp r0, 0x5 + bgt _080FC364 + ldr r0, _080FC360 + strh r5, [r0] + b _080FC376 + .align 2, 0 +_080FC358: .4byte 0x03005d8c +_080FC35C: .4byte 0x0203a054 +_080FC360: .4byte 0x020375f0 +_080FC364: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _080FC306 + ldr r1, _080FC380 + ldr r2, _080FC384 + adds r0, r2, 0 + strh r0, [r1] +_080FC376: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FC380: .4byte 0x020375f0 +_080FC384: .4byte 0x0000ffff + thumb_func_end sub_80FC2E8 + + thumb_func_start sub_80FC388 +sub_80FC388: @ 80FC388 + push {lr} + bl sub_80FC258 + ldr r2, _080FC3A4 + ldrh r1, [r2] + ldr r0, _080FC3A8 + cmp r1, r0 + beq _080FC3B0 + adds r0, r1, 0 + lsls r0, 4 + ldr r1, _080FC3AC + adds r0, r1 + b _080FC3B2 + .align 2, 0 +_080FC3A4: .4byte 0x020375f0 +_080FC3A8: .4byte 0x0000ffff +_080FC3AC: .4byte 0x0203a05c +_080FC3B0: + movs r0, 0 +_080FC3B2: + pop {r1} + bx r1 + thumb_func_end sub_80FC388 + + thumb_func_start sub_80FC3B8 +sub_80FC3B8: @ 80FC3B8 + push {lr} + bl sub_80FC2E8 + ldr r2, _080FC3D4 + ldrh r1, [r2] + ldr r0, _080FC3D8 + cmp r1, r0 + beq _080FC3E0 + adds r0, r1, 0 + lsls r0, 4 + ldr r1, _080FC3DC + adds r0, r1 + b _080FC3E2 + .align 2, 0 +_080FC3D4: .4byte 0x020375f0 +_080FC3D8: .4byte 0x0000ffff +_080FC3DC: .4byte 0x0203a05c +_080FC3E0: + movs r0, 0 +_080FC3E2: + pop {r1} + bx r1 + thumb_func_end sub_80FC3B8 + + thumb_func_start sub_80FC3E8 +sub_80FC3E8: @ 80FC3E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + ldr r2, _080FC45C + mov r6, sp + adds r6, 0x2 + movs r0, 0x8 + adds r0, r2 + mov r9, r0 + ldr r7, _080FC460 +_080FC408: + lsls r5, r1, 4 + adds r4, r5, r2 + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080FC468 + movs r3, 0 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _080FC468 + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _080FC468 + mov r0, sp + adds r1, r6, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + ldr r0, [r7] + ldrb r0, [r0, 0x5] + strb r0, [r4, 0x4] + mov r0, r9 + adds r2, r5, r0 + ldr r0, [r7] + mov r3, r8 + lsls r1, r3, 3 + ldr r3, _080FC464 + adds r0, r3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x64 + strb r0, [r4, 0x5] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4] + ldrh r0, [r6] + strh r0, [r4, 0x2] + b _080FC472 + .align 2, 0 +_080FC45C: .4byte 0x0203a054 +_080FC460: .4byte 0x03005d8c +_080FC464: .4byte 0x00000848 +_080FC468: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _080FC408 +_080FC472: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FC3E8 + + thumb_func_start sub_80FC480 +sub_80FC480: @ 80FC480 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _080FC4B0 +_080FC486: + lsls r0, r4, 4 + adds r1, r0, r5 + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _080FC4A0 + subs r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + cmp r0, 0 + bne _080FC4A0 + adds r0, r4, 0 + bl sub_80FC228 +_080FC4A0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080FC486 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FC4B0: .4byte 0x0203a054 + thumb_func_end sub_80FC480 + + thumb_func_start sub_80FC4B4 +sub_80FC4B4: @ 80FC4B4 + push {lr} + bl sub_80FC258 + ldr r3, _080FC4DC + ldrh r1, [r3] + ldr r0, _080FC4E0 + cmp r1, r0 + beq _080FC4EC + ldr r0, _080FC4E4 + ldr r2, _080FC4E8 + lsls r1, 4 + adds r1, r2 + ldrb r1, [r1, 0x5] + movs r2, 0x2 + movs r3, 0x3 + bl decimal_int_to_string + movs r0, 0x1 + b _080FC4EE + .align 2, 0 +_080FC4DC: .4byte 0x020375f0 +_080FC4E0: .4byte 0x0000ffff +_080FC4E4: .4byte 0x02021dc4 +_080FC4E8: .4byte 0x0203a054 +_080FC4EC: + movs r0, 0 +_080FC4EE: + pop {r1} + bx r1 + thumb_func_end sub_80FC4B4 + + thumb_func_start sub_80FC4F4 +sub_80FC4F4: @ 80FC4F4 + push {r4,r5,lr} + adds r2, r0, 0 + lsls r4, r1, 16 + lsrs r4, 16 + ldr r5, _080FC524 + adds r0, r5, 0 + adds r1, r2, 0 + adds r2, r4, 0 + bl memcpy + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + bne _080FC528 + movs r0, 0 + b _080FC52A + .align 2, 0 +_080FC524: .4byte 0x0201c000 +_080FC528: + movs r0, 0x1 +_080FC52A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FC4F4 + + thumb_func_start sub_80FC530 +sub_80FC530: @ 80FC530 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0x80 + lsls r4, 17 + lsls r4, r5 + lsrs r4, 24 + bl sub_800A550 + ands r4, r0 + cmp r4, 0 + beq _080FC552 + adds r0, r5, 0 + bl sub_800A5EC + movs r0, 0x1 + b _080FC554 +_080FC552: + movs r0, 0 +_080FC554: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FC530 + + thumb_func_start sub_80FC55C +sub_80FC55C: @ 80FC55C + push {r4,lr} + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080FC574 + movs r0, 0 + b _080FC57A +_080FC574: + bl sub_800A5B4 + movs r0, 0x1 +_080FC57A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FC55C + + thumb_func_start sub_80FC580 +sub_80FC580: @ 80FC580 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r5, _080FC5B4 + ldr r6, _080FC5B8 + ldr r4, _080FC5BC + movs r3, 0xFF +_080FC590: + lsls r0, r1, 8 + adds r0, r4 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080FC590 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r5 + movs r1, 0 + strh r1, [r0, 0x8] + str r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FC5B4: .4byte 0x03005e00 +_080FC5B8: .4byte sub_80FC5C0 + 1 +_080FC5BC: .4byte 0x020223c4 + thumb_func_end sub_80FC580 + + thumb_func_start sub_80FC5C0 +sub_80FC5C0: @ 80FC5C0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FC5D4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _080FC5D8 + str r0, [r1] + bx lr + .align 2, 0 +_080FC5D4: .4byte 0x03005e00 +_080FC5D8: .4byte sub_80FC5DC + 1 + thumb_func_end sub_80FC5C0 + + thumb_func_start sub_80FC5DC +sub_80FC5DC: @ 80FC5DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _080FC658 + ldrb r0, [r0] + cmp r0, 0 + beq _080FC650 + bl link_get_multiplayer_id + ldr r1, _080FC65C + strb r0, [r1] + bl sub_8009FCC + ldr r4, _080FC660 + strb r0, [r4] + ldr r1, _080FC664 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _080FC668 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080FC60C + movs r0, 0x3 + strb r0, [r1] +_080FC60C: + movs r3, 0 + ldrb r2, [r4] + cmp r3, r2 + bge _080FC64A + ldr r1, _080FC66C + ldrb r0, [r1] + subs r0, 0x1 + adds r6, r4, 0 + cmp r0, 0x1 + bls _080FC63A + adds r4, r2, 0 + adds r2, r1, 0 + movs r5, 0xFF +_080FC626: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, r4 + bge _080FC64A + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + subs r0, 0x1 + cmp r0, 0x1 + bhi _080FC626 +_080FC63A: + ldrb r6, [r6] + cmp r3, r6 + bge _080FC64A + ldr r0, _080FC664 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080FC64A: + adds r0, r7, 0 + bl set_task_function_to_args_14_15 +_080FC650: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FC658: .4byte 0x03003124 +_080FC65C: .4byte 0x02039f25 +_080FC660: .4byte 0x02039f30 +_080FC664: .4byte 0x02039f2a +_080FC668: .4byte 0x030030fc +_080FC66C: .4byte 0x020229e8 + thumb_func_end sub_80FC5DC + + thumb_func_start sub_80FC670 +sub_80FC670: @ 80FC670 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080FC69C + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080FC698 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FC6A0 + cmp r0, 0x1 + beq _080FC6AE + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FC6B4 +_080FC698: + movs r0, 0x1 + b _080FC6B6 + .align 2, 0 +_080FC69C: .4byte 0x02039f2a +_080FC6A0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC6B4 + bl sub_800ADF8 +_080FC6AE: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080FC6B4: + movs r0, 0 +_080FC6B6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FC670 + + thumb_func_start sub_80FC6BC +sub_80FC6BC: @ 80FC6BC + 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, _080FC6F4 + adds r0, r4, r5 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + bne _080FC6DC + b _080FC7F4 +_080FC6DC: + adds r0, r5, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080FC758 + cmp r0, 0x1 + bgt _080FC6F8 + cmp r0, 0 + beq _080FC6FE + b _080FC7DC + .align 2, 0 +_080FC6F4: .4byte 0x03005e08 +_080FC6F8: + cmp r0, 0xA + beq _080FC7C0 + b _080FC7DC +_080FC6FE: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FC738 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC7F4 + ldr r0, _080FC72C + ldr r1, _080FC730 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, _080FC734 + adds r1, r2 + movs r2, 0x40 + bl memcpy + movs r0, 0xA + strh r0, [r4, 0x8] + b _080FC7F4 + .align 2, 0 +_080FC72C: .4byte 0x020228c4 +_080FC730: .4byte 0x02039f25 +_080FC734: .4byte 0x02039e00 +_080FC738: + ldr r0, _080FC74C + ldr r1, _080FC750 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, _080FC754 + adds r1, r2 + movs r2, 0x40 + bl memcpy + b _080FC7D6 + .align 2, 0 +_080FC74C: .4byte 0x020228c4 +_080FC750: .4byte 0x02039f25 +_080FC754: .4byte 0x02039e00 +_080FC758: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FC7F4 + movs r5, 0 + ldr r0, _080FC7AC + mov r8, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _080FC798 + ldr r6, _080FC7B0 +_080FC770: + lsls r4, r5, 6 + ldr r0, _080FC7B4 + adds r4, r0 + lsls r1, r5, 8 + ldr r0, _080FC7B8 + 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, _080FC7AC + ldrb r0, [r0] + cmp r5, r0 + blt _080FC770 +_080FC798: + ldr r0, _080FC7BC + 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 _080FC7F4 + .align 2, 0 +_080FC7AC: .4byte 0x02039f30 +_080FC7B0: .4byte 0x020229e8 +_080FC7B4: .4byte 0x02039e00 +_080FC7B8: .4byte 0x020223c4 +_080FC7BC: .4byte 0x03005e00 +_080FC7C0: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 17 + cmp r0, r1 + ble _080FC7F4 + movs r0, 0x2 + bl sub_800A4D8 +_080FC7D6: + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080FC7F4 +_080FC7DC: + ldr r0, _080FC800 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0x1E] + strh r0, [r1, 0x20] + adds r0, r7, 0 + bl set_task_function_to_args_14_15 +_080FC7F4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FC800: .4byte 0x03005e00 + thumb_func_end sub_80FC6BC + + thumb_func_start sub_80FC804 +sub_80FC804: @ 80FC804 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080FC82C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080FC830 + cmp r0, 0x1 + beq _080FC858 + movs r0, 0 + strh r0, [r5, 0x8] + adds r0, r2, 0 + bl set_task_function_to_args_14_15 + b _080FC880 + .align 2, 0 +_080FC82C: .4byte 0x03005e00 +_080FC830: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FC87A + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC880 + ldr r0, _080FC854 + movs r1, 0x4 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FC880 + b _080FC87A + .align 2, 0 +_080FC854: .4byte 0x03005d80 +_080FC858: + movs r0, 0 + bl sub_80FC530 + lsls r0, 24 + cmp r0, 0 + beq _080FC880 + ldr r0, _080FC888 + ldr r4, _080FC88C + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r0, _080FC890 + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy +_080FC87A: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080FC880: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FC888: .4byte 0x03005d80 +_080FC88C: .4byte 0x020223c4 +_080FC890: .4byte 0x030060b8 + thumb_func_end sub_80FC804 + + thumb_func_start sub_80FC894 +sub_80FC894: @ 80FC894 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + mov r8, r0 + adds r0, r6 + lsls r5, r0, 3 + ldr r7, _080FC8D4 + adds r0, r5, r7 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FC986 + movs r1, 0x8 + negs r1, r1 + adds r1, r7 + mov r9, r1 + adds r4, r5, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080FC90C + cmp r0, 0x1 + bgt _080FC8D8 + cmp r0, 0 + beq _080FC8DE + b _080FC96E + .align 2, 0 +_080FC8D4: .4byte 0x03005e08 +_080FC8D8: + cmp r0, 0xA + beq _080FC954 + b _080FC96E +_080FC8DE: + ldr r1, _080FC900 + ldrh r0, [r4, 0x1A] + strb r0, [r1] + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FC904 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC986 + movs r0, 0xA + strh r0, [r4, 0x8] + b _080FC986 + .align 2, 0 +_080FC900: .4byte 0x020228c4 +_080FC904: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080FC986 +_080FC90C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FC986 + movs r3, 0 + ldr r1, _080FC94C + ldrb r0, [r1] + cmp r3, r0 + bge _080FC93A + ldr r4, _080FC950 + adds r0, r7, 0x2 + adds r2, r5, r0 + movs r5, 0x80 + lsls r5, 1 +_080FC92A: + ldrh r0, [r4] + strh r0, [r2] + adds r4, r5 + adds r2, 0x2 + adds r3, 0x1 + ldrb r0, [r1] + cmp r3, r0 + blt _080FC92A +_080FC93A: + mov r0, r8 + adds r1, r0, r6 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FC986 + .align 2, 0 +_080FC94C: .4byte 0x02039f30 +_080FC950: .4byte 0x020223c4 +_080FC954: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _080FC986 + movs r0, 0x2 + bl sub_800A4D8 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080FC986 +_080FC96E: + ldr r0, _080FC994 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0x1E] + strh r0, [r1, 0x20] + adds r0, r6, 0 + bl set_task_function_to_args_14_15 +_080FC986: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FC994: .4byte 0x03005e00 + thumb_func_end sub_80FC894 + + thumb_func_start sub_80FC998 +sub_80FC998: @ 80FC998 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080FC9C0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FC9C4 + cmp r0, 0x1 + beq _080FC9E0 + movs r0, 0 + strh r0, [r4, 0x8] + adds r0, r2, 0 + bl set_task_function_to_args_14_15 + b _080FC9F0 + .align 2, 0 +_080FC9C0: .4byte 0x03005e00 +_080FC9C4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC9F0 + ldr r0, _080FC9DC + movs r1, 0x1 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FC9F0 + b _080FC9EA + .align 2, 0 +_080FC9DC: .4byte 0x02039f25 +_080FC9E0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FC9F0 +_080FC9EA: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FC9F0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FC998 + + thumb_func_start sub_80FC9F8 +sub_80FC9F8: @ 80FC9F8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080FCA2C + mov r8, r0 + lsls r7, r5, 2 + adds r0, r7, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FCA30 + cmp r0, 0x1 + beq _080FCA68 + movs r0, 0 + strh r0, [r4, 0x8] + adds r0, r5, 0 + bl set_task_function_to_args_14_15 + b _080FCAB2 + .align 2, 0 +_080FCA2C: .4byte 0x03005e00 +_080FCA30: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCAB2 + ldr r0, _080FCA60 + ldr r2, [r0] + ldr r0, _080FCA64 + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, [r2, 0x4] + adds r0, r1 + adds r0, 0x6 + movs r1, 0x2 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCAB2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080FCAB2 + .align 2, 0 +_080FCA60: .4byte 0x02039f34 +_080FCA64: .4byte 0x02039f25 +_080FCA68: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCAB2 + movs r2, 0 + ldr r6, _080FCAC0 + mov r9, r8 + mov r12, r7 + ldrb r0, [r6] + cmp r2, r0 + bge _080FCAA4 + ldr r1, _080FCAC4 + mov r8, r1 + ldr r4, _080FCAC8 + movs r3, 0 + movs r7, 0x80 + lsls r7, 1 +_080FCA8C: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0, 0x6] + adds r4, r7 + adds r3, 0x1C + adds r2, 0x1 + ldrb r0, [r6] + cmp r2, r0 + blt _080FCA8C +_080FCAA4: + mov r0, r12 + adds r1, r0, r5 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_080FCAB2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FCAC0: .4byte 0x02039f30 +_080FCAC4: .4byte 0x02039f34 +_080FCAC8: .4byte 0x020223c4 + thumb_func_end sub_80FC9F8 + + thumb_func_start sub_80FCACC +sub_80FCACC: @ 80FCACC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080FCAF4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x8 + ldrsh r0, [r2, r3] + adds r3, r1, 0 + cmp r0, 0xB + bls _080FCAE8 + b _080FCC78 +_080FCAE8: + lsls r0, 2 + ldr r1, _080FCAF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FCAF4: .4byte 0x03005e00 +_080FCAF8: .4byte _080FCAFC + .align 2, 0 +_080FCAFC: + .4byte _080FCB2C + .4byte _080FCB44 + .4byte _080FCB6C + .4byte _080FCB90 + .4byte _080FCBA4 + .4byte _080FCB6C + .4byte _080FCBCC + .4byte _080FCBE0 + .4byte _080FCB6C + .4byte _080FCC08 + .4byte _080FCC38 + .4byte _080FCB6C +_080FCB2C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080FCB38 + b _080FCC82 +_080FCB38: + ldr r0, _080FCB40 + movs r1, 0x8 + b _080FCC16 + .align 2, 0 +_080FCB40: .4byte 0x02039f08 +_080FCB44: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + bne _080FCB50 + b _080FCC82 +_080FCB50: + ldr r0, _080FCB60 + ldr r1, _080FCB64 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCB68 + adds r1, r2 + movs r2, 0x8 + b _080FCC50 + .align 2, 0 +_080FCB60: .4byte 0x02039f08 +_080FCB64: .4byte 0x02039f2b +_080FCB68: .4byte 0x020223c4 +_080FCB6C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0xA] + adds r1, r0, 0x1 + strh r1, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bgt _080FCB84 + b _080FCC82 +_080FCB84: + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _080FCC82 +_080FCB90: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, _080FCBA0 + movs r1, 0x8 + b _080FCC16 + .align 2, 0 +_080FCBA0: .4byte 0x02039f10 +_080FCBA4: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, _080FCBC0 + ldr r1, _080FCBC4 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCBC8 + adds r1, r2 + movs r2, 0x8 + b _080FCC50 + .align 2, 0 +_080FCBC0: .4byte 0x02039f10 +_080FCBC4: .4byte 0x02039f2b +_080FCBC8: .4byte 0x020223c4 +_080FCBCC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, _080FCBDC + movs r1, 0x8 + b _080FCC16 + .align 2, 0 +_080FCBDC: .4byte 0x02039f18 +_080FCBE0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, _080FCBFC + ldr r1, _080FCC00 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCC04 + adds r1, r2 + movs r2, 0x8 + b _080FCC50 + .align 2, 0 +_080FCBFC: .4byte 0x02039f18 +_080FCC00: .4byte 0x02039f2b +_080FCC04: .4byte 0x020223c4 +_080FCC08: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, _080FCC30 + movs r1, 0x4 +_080FCC16: + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCC82 + ldr r0, _080FCC34 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FCC82 + .align 2, 0 +_080FCC30: .4byte 0x02039f20 +_080FCC34: .4byte 0x03005e00 +_080FCC38: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, _080FCC68 + ldr r1, _080FCC6C + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCC70 + adds r1, r2 + movs r2, 0x4 +_080FCC50: + bl memcpy + ldr r1, _080FCC74 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080FCC82 + .align 2, 0 +_080FCC68: .4byte 0x02039f20 +_080FCC6C: .4byte 0x02039f2b +_080FCC70: .4byte 0x020223c4 +_080FCC74: .4byte 0x03005e00 +_080FCC78: + movs r0, 0 + strh r0, [r2, 0x8] + adds r0, r4, 0 + bl set_task_function_to_args_14_15 +_080FCC82: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FCACC + + thumb_func_start sub_80FCC88 +sub_80FCC88: @ 80FCC88 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080FCCB0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x8 + ldrsh r0, [r2, r3] + adds r3, r1, 0 + cmp r0, 0xB + bls _080FCCA4 + b _080FCE38 +_080FCCA4: + lsls r0, 2 + ldr r1, _080FCCB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FCCB0: .4byte 0x03005e00 +_080FCCB4: .4byte _080FCCB8 + .align 2, 0 +_080FCCB8: + .4byte _080FCCE8 + .4byte _080FCD04 + .4byte _080FCD30 + .4byte _080FCD54 + .4byte _080FCD6C + .4byte _080FCD30 + .4byte _080FCD98 + .4byte _080FCDB0 + .4byte _080FCD30 + .4byte _080FCDC8 + .4byte _080FCDF8 + .4byte _080FCD30 +_080FCCE8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080FCCF4 + b _080FCE42 +_080FCCF4: + ldr r0, _080FCD00 + ldr r0, [r0] + ldr r0, [r0, 0x4] + movs r1, 0x70 + b _080FCDD6 + .align 2, 0 +_080FCD00: .4byte 0x02039f34 +_080FCD04: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + bne _080FCD10 + b _080FCE42 +_080FCD10: + ldr r0, _080FCD24 + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r1, _080FCD28 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCD2C + adds r1, r2 + movs r2, 0x70 + b _080FCE10 + .align 2, 0 +_080FCD24: .4byte 0x02039f34 +_080FCD28: .4byte 0x02039f2b +_080FCD2C: .4byte 0x020223c4 +_080FCD30: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0xA] + adds r1, r0, 0x1 + strh r1, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bgt _080FCD48 + b _080FCE42 +_080FCD48: + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _080FCE42 +_080FCD54: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, _080FCD68 + ldr r0, [r0] + ldr r0, [r0, 0x8] + movs r1, 0x14 + b _080FCDD6 + .align 2, 0 +_080FCD68: .4byte 0x02039f34 +_080FCD6C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, _080FCD8C + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldr r1, _080FCD90 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCD94 + adds r1, r2 + movs r2, 0x14 + b _080FCE10 + .align 2, 0 +_080FCD8C: .4byte 0x02039f34 +_080FCD90: .4byte 0x02039f2b +_080FCD94: .4byte 0x020223c4 +_080FCD98: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, _080FCDAC + ldr r0, [r0] + ldr r0, [r0, 0x10] + b _080FCDD4 + .align 2, 0 +_080FCDAC: .4byte 0x02039f34 +_080FCDB0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, _080FCDC4 + ldr r0, [r0] + ldr r0, [r0, 0x10] + b _080FCE04 + .align 2, 0 +_080FCDC4: .4byte 0x02039f34 +_080FCDC8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, _080FCDF0 +_080FCDD4: + movs r1, 0x4 +_080FCDD6: + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCE42 + ldr r0, _080FCDF4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FCE42 + .align 2, 0 +_080FCDF0: .4byte 0x02039f26 +_080FCDF4: .4byte 0x03005e00 +_080FCDF8: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, _080FCE28 +_080FCE04: + ldr r1, _080FCE2C + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCE30 + adds r1, r2 + movs r2, 0x4 +_080FCE10: + bl memcpy + ldr r1, _080FCE34 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080FCE42 + .align 2, 0 +_080FCE28: .4byte 0x02039f26 +_080FCE2C: .4byte 0x02039f2b +_080FCE30: .4byte 0x020223c4 +_080FCE34: .4byte 0x03005e00 +_080FCE38: + movs r0, 0 + strh r0, [r2, 0x8] + adds r0, r4, 0 + bl set_task_function_to_args_14_15 +_080FCE42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FCC88 + + thumb_func_start sub_80FCE48 +sub_80FCE48: @ 80FCE48 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + mov r8, r0 + adds r0, r6 + lsls r5, r0, 3 + ldr r7, _080FCE88 + adds r0, r5, r7 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FCF2E + movs r1, 0x8 + negs r1, r1 + adds r1, r7 + mov r9, r1 + adds r4, r5, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080FCEC0 + cmp r0, 0x1 + bgt _080FCE8C + cmp r0, 0 + beq _080FCE92 + b _080FCF16 + .align 2, 0 +_080FCE88: .4byte 0x03005e08 +_080FCE8C: + cmp r0, 0xA + beq _080FCEFC + b _080FCF16 +_080FCE92: + ldr r1, _080FCEB4 + movs r0, 0x6E + strb r0, [r1] + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FCEB8 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCF2E + movs r0, 0xA + strh r0, [r4, 0x8] + b _080FCF2E + .align 2, 0 +_080FCEB4: .4byte 0x020228c4 +_080FCEB8: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080FCF2E +_080FCEC0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCF2E + mov r1, r8 + mov r8, r9 + ldr r4, _080FCEF8 + adds r0, r7, 0 + adds r0, 0xA + adds r2, r5, r0 + movs r5, 0x80 + lsls r5, 1 + movs r3, 0x3 +_080FCEDC: + ldrh r0, [r4] + strh r0, [r2] + adds r4, r5 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _080FCEDC + adds r1, r6 + lsls r1, 3 + add r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FCF2E + .align 2, 0 +_080FCEF8: .4byte 0x020223c4 +_080FCEFC: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _080FCF2E + movs r0, 0x2 + bl sub_800A4D8 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080FCF2E +_080FCF16: + ldr r0, _080FCF3C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0x1E] + strh r0, [r1, 0x20] + adds r0, r6, 0 + bl set_task_function_to_args_14_15 +_080FCF2E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FCF3C: .4byte 0x03005e00 + thumb_func_end sub_80FCE48 + + thumb_func_start sub_80FCF40 +sub_80FCF40: @ 80FCF40 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 3 + ldr r6, _080FCF7C + adds r0, r4, r6 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FCFBE + adds r0, r6, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FCF80 + cmp r0, 0x1 + beq _080FCF9C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r5, 0 + bl set_task_function_to_args_14_15 + b _080FCFBE + .align 2, 0 +_080FCF7C: .4byte 0x03005e08 +_080FCF80: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCFBE + ldr r0, _080FCF98 + movs r1, 0x8 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCFBE + b _080FCFB8 + .align 2, 0 +_080FCF98: .4byte 0x02039f00 +_080FCF9C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCFBE + ldr r0, _080FCFC4 + ldr r1, _080FCFC8 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FCFCC + adds r1, r2 + movs r2, 0x8 + bl memcpy +_080FCFB8: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FCFBE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FCFC4: .4byte 0x02039f00 +_080FCFC8: .4byte 0x02039f2b +_080FCFCC: .4byte 0x020223c4 + thumb_func_end sub_80FCF40 + + thumb_func_start sub_80FCFD0 +sub_80FCFD0: @ 80FCFD0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 3 + ldr r6, _080FD00C + adds r0, r4, r6 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FD04E + adds r0, r6, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FD010 + cmp r0, 0x1 + beq _080FD02C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r5, 0 + bl set_task_function_to_args_14_15 + b _080FD04E + .align 2, 0 +_080FD00C: .4byte 0x03005e08 +_080FD010: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FD04E + ldr r0, _080FD028 + movs r1, 0x4 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FD04E + b _080FD048 + .align 2, 0 +_080FD028: .4byte 0x02039f26 +_080FD02C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FD04E + ldr r0, _080FD054 + ldr r1, _080FD058 + ldrb r1, [r1] + lsls r1, 8 + ldr r2, _080FD05C + adds r1, r2 + movs r2, 0x4 + bl memcpy +_080FD048: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FD04E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FD054: .4byte 0x02039f26 +_080FD058: .4byte 0x02039f2b +_080FD05C: .4byte 0x020223c4 + thumb_func_end sub_80FCFD0 + + thumb_func_start sub_80FD060 +sub_80FD060: @ 80FD060 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _080FD07C + ldrh r0, [r1] + cmp r0, 0xAF + bne _080FD084 + ldr r0, _080FD080 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x10] + b _080FD08A + .align 2, 0 +_080FD07C: .4byte 0x0203ce7c +_080FD080: .4byte 0x03005e00 +_080FD084: + ldrh r0, [r1] + bl itemid_get_type +_080FD08A: + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FD0B8 + ldr r0, _080FD0B0 + ldr r2, [r0] + ldr r1, _080FD0B4 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + adds r0, r5, 0 + bl task_close_bag_menu_1 + b _080FD0CC + .align 2, 0 +_080FD0B0: .4byte 0x0203ce54 +_080FD0B4: .4byte 0x085920d8 +_080FD0B8: + ldr r0, _080FD0D4 + ldr r2, [r0] + ldr r1, _080FD0D8 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + adds r0, r5, 0 + bl sub_81C5B14 +_080FD0CC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FD0D4: .4byte 0x0203cf2c +_080FD0D8: .4byte 0x085920d8 + thumb_func_end sub_80FD060 + + thumb_func_start run_eventually_start +run_eventually_start: @ 80FD0DC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _080FD104 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _080FD110 + ldr r1, _080FD108 + ldr r0, _080FD10C + str r0, [r1] + adds r0, r2, 0 + bl sub_80FD060 + b _080FD11A + .align 2, 0 +_080FD104: .4byte 0x03005e00 +_080FD108: .4byte 0x03005dac +_080FD10C: .4byte sub_80FD124 + 1 +_080FD110: + ldr r0, _080FD120 + ldr r1, [r0] + adds r0, r2, 0 + bl _call_via_r1 +_080FD11A: + pop {r0} + bx r0 + .align 2, 0 +_080FD120: .4byte 0x0203a0f4 + thumb_func_end run_eventually_start + + thumb_func_start sub_80FD124 +sub_80FD124: @ 80FD124 + push {lr} + bl pal_fill_black + ldr r0, _080FD138 + movs r1, 0x8 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_080FD138: .4byte sub_80FD13C + 1 + thumb_func_end sub_80FD124 + + thumb_func_start sub_80FD13C +sub_80FD13C: @ 80FD13C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD158 + ldr r0, _080FD160 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 +_080FD158: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FD160: .4byte 0x0203a0f4 + thumb_func_end sub_80FD13C + + thumb_func_start sub_80FD164 +sub_80FD164: @ 80FD164 + push {r4-r6,lr} + adds r4, r1, 0 + adds r1, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _080FD198 + adds r0, r6, 0 + bl ExpandTextCodes + cmp r4, 0 + bne _080FD1B4 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FD1A0 + ldr r3, _080FD19C + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl sub_81ABB4C + b _080FD1BE + .align 2, 0 +_080FD198: .4byte 0x02021fc4 +_080FD19C: .4byte sub_81ABBBC + 1 +_080FD1A0: + ldr r1, _080FD1AC + ldr r2, _080FD1B0 + adds r0, r5, 0 + bl sub_81C6DD8 + b _080FD1BE + .align 2, 0 +_080FD1AC: .4byte 0x085e8f31 +_080FD1B0: .4byte sub_81C6714 + 1 +_080FD1B4: + ldr r2, _080FD1C4 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81978EC +_080FD1BE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FD1C4: .4byte sub_80FD1F8 + 1 + thumb_func_end sub_80FD164 + + thumb_func_start display_dads_advice_cannot_use_item_str +display_dads_advice_cannot_use_item_str: @ 80FD1C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080FD1DC + bl sub_80FD164 + pop {r0} + bx r0 + .align 2, 0 +_080FD1DC: .4byte 0x085e8f31 + thumb_func_end display_dads_advice_cannot_use_item_str + + thumb_func_start display_cannot_dismount_bike_here_str +display_cannot_dismount_bike_here_str: @ 80FD1E0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080FD1F4 + bl sub_80FD164 + pop {r0} + bx r0 + .align 2, 0 +_080FD1F4: .4byte 0x085e8f6e + thumb_func_end display_cannot_dismount_bike_here_str + + thumb_func_start sub_80FD1F8 +sub_80FD1F8: @ 80FD1F8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r0, r4, 0 + bl remove_task + bl sub_80984F4 + bl script_env_2_disable + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FD1F8 + + thumb_func_start sub_80FD21C +sub_80FD21C: @ 80FD21C + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl itemid_get_overworld_function + ldr r1, _080FD234 + cmp r0, r1 + bne _080FD238 + movs r0, 0x1 + b _080FD24E + .align 2, 0 +_080FD234: .4byte sub_80FDF48 + 1 +_080FD238: + adds r0, r4, 0 + bl itemid_get_overworld_function + ldr r1, _080FD248 + cmp r0, r1 + beq _080FD24C + movs r0, 0 + b _080FD24E + .align 2, 0 +_080FD248: .4byte sub_80FE378 + 1 +_080FD24C: + movs r0, 0x2 +_080FD24E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FD21C + + thumb_func_start sub_80FD254 +sub_80FD254: @ 80FD254 + push {lr} + sub sp, 0x24 + mov r1, sp + ldr r0, _080FD270 + ldrh r0, [r0] + strh r0, [r1, 0x20] + ldr r1, _080FD274 + mov r0, sp + movs r2, 0 + bl sub_8121478 + add sp, 0x24 + pop {r0} + bx r0 + .align 2, 0 +_080FD270: .4byte 0x0203ce7c +_080FD274: .4byte sub_81AD40C + 1 + thumb_func_end sub_80FD254 + + thumb_func_start sub_80FD278 +sub_80FD278: @ 80FD278 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080FD290 + ldr r2, [r1] + ldr r1, _080FD294 + str r1, [r2] + bl task_close_bag_menu_1 + pop {r0} + bx r0 + .align 2, 0 +_080FD290: .4byte 0x0203ce54 +_080FD294: .4byte sub_80FD254 + 1 + thumb_func_end sub_80FD278 + + thumb_func_start item_field_func_bike +item_field_func_bike: @ 80FD298 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _080FD318 + adds r6, r0, r1 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FD31C + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl sub_8089990 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl sub_80899A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl sub_8089968 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl sub_808997C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD320 +_080FD30E: + ldrb r1, [r6, 0x6] + adds r0, r5, 0 + bl display_cannot_dismount_bike_here_str + b _080FD350 + .align 2, 0 +_080FD318: .4byte 0x03005e08 +_080FD31C: .4byte 0x0000088b +_080FD320: + bl sav1_map_is_biking_allowed + cmp r0, 0x1 + bne _080FD348 + bl sub_8119FF8 + lsls r0, 24 + cmp r0, 0 + bne _080FD348 + ldr r1, _080FD340 + ldr r0, _080FD344 + str r0, [r1] + adds r0, r5, 0 + bl run_eventually_start + b _080FD350 + .align 2, 0 +_080FD340: .4byte 0x0203a0f4 +_080FD344: .4byte sub_80FD358 + 1 +_080FD348: + ldrb r1, [r6, 0x6] + adds r0, r5, 0 + bl display_dads_advice_cannot_use_item_str +_080FD350: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end item_field_func_bike + + thumb_func_start sub_80FD358 +sub_80FD358: @ 80FD358 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FD374 + ldrh r0, [r0] + bl itemid_get_x28 + lsls r0, 24 + cmp r0, 0 + bne _080FD378 + movs r0, 0x2 + bl sub_811A080 + b _080FD37E + .align 2, 0 +_080FD374: .4byte 0x0203ce7c +_080FD378: + movs r0, 0x4 + bl sub_811A080 +_080FD37E: + bl sub_80984F4 + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FD358 + + thumb_func_start sub_80FD394 +sub_80FD394: @ 80FD394 + push {r4-r6,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 16 + lsrs r6, r0, 16 + lsls r0, r6, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl is_tile_x13_waterfall + lsls r0, 24 + cmp r0, 0 + bne _080FD41C + movs r0, 0x10 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + bne _080FD41C + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + bne _080FD3EC + bl sub_808BE74 + lsls r0, 24 + cmp r0, 0 + beq _080FD41C +_080FD3E8: + movs r0, 0x1 + b _080FD41E +_080FD3EC: + adds r0, r5, 0 + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + beq _080FD40C + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_get_middle2bit_at + lsls r0, 24 + cmp r0, 0 + beq _080FD3E8 +_080FD40C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8089510 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD3E8 +_080FD41C: + movs r0, 0 +_080FD41E: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FD394 + + thumb_func_start rod +rod: @ 80FD428 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80FD394 + cmp r0, 0x1 + bne _080FD44C + ldr r1, _080FD444 + ldr r0, _080FD448 + str r0, [r1] + adds r0, r4, 0 + bl run_eventually_start + b _080FD45E + .align 2, 0 +_080FD444: .4byte 0x0203a0f4 +_080FD448: .4byte sub_80FD468 + 1 +_080FD44C: + ldr r0, _080FD464 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl display_dads_advice_cannot_use_item_str +_080FD45E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FD464: .4byte 0x03005e00 + thumb_func_end rod + + thumb_func_start sub_80FD468 +sub_80FD468: @ 80FD468 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080FD48C + ldrh r0, [r0] + bl itemid_get_x28 + lsls r0, 24 + lsrs r0, 24 + bl fishing_start + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FD48C: .4byte 0x0203ce7c + thumb_func_end sub_80FD468 + + thumb_func_start it_itemfinder +it_itemfinder: @ 80FD490 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x27 + bl sav12_xor_increment + ldr r1, _080FD4B0 + ldr r0, _080FD4B4 + str r0, [r1] + adds r0, r4, 0 + bl run_eventually_start + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FD4B0: .4byte 0x0203a0f4 +_080FD4B4: .4byte sub_80FD4B8 + 1 + thumb_func_end it_itemfinder + + thumb_func_start sub_80FD4B8 +sub_80FD4B8: @ 80FD4B8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FD4E0 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_80FD5F0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD4EC + ldr r0, _080FD4E4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080FD4E8 + str r0, [r1] + b _080FD4F6 + .align 2, 0 +_080FD4E0: .4byte 0x02037318 +_080FD4E4: .4byte 0x03005e00 +_080FD4E8: .4byte sub_80FD504 + 1 +_080FD4EC: + ldr r1, _080FD4FC + ldr r2, _080FD500 + adds r0, r4, 0 + bl sub_81978EC +_080FD4F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FD4FC: .4byte 0x085e9002 +_080FD500: .4byte sub_80FD5CC + 1 + thumb_func_end sub_80FD4B8 + + thumb_func_start sub_80FD504 +sub_80FD504: @ 80FD504 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r7, r0, 3 + ldr r0, _080FD558 + mov r8, r0 + adds r4, r7, r0 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FD5B8 + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x4 + bne _080FD5AC + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_80FD9B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080FD564 + ldr r1, _080FD55C + subs r0, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl sub_80FDA24 + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _080FD560 + str r1, [r0] + b _080FD5C2 + .align 2, 0 +_080FD558: .4byte 0x03005e08 +_080FD55C: .4byte 0x085920e4 +_080FD560: .4byte sub_80FDA94 + 1 +_080FD564: + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + adds r3, r6, 0 + ldr r7, _080FD5A0 + movs r6, 0x3 +_080FD574: + adds r0, r1, r7 + adds r1, 0x1 + ldrb r0, [r0] + cmp r2, r0 + bne _080FD584 + adds r0, r1, 0 + ands r0, r6 + strh r0, [r4, 0xA] +_080FD584: + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080FD574 + ldr r1, _080FD5A4 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _080FD5A8 + str r1, [r0] + movs r0, 0 + strh r0, [r4, 0x6] + strh r0, [r4, 0x4] + b _080FD5C2 + .align 2, 0 +_080FD5A0: .4byte 0x085920e4 +_080FD5A4: .4byte 0x03005e00 +_080FD5A8: .4byte sub_80FDADC + 1 +_080FD5AC: + movs r0, 0x48 + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FD5B8: + ldrh r0, [r4, 0x6] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r4, 0x6] +_080FD5C2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FD504 + + thumb_func_start sub_80FD5CC +sub_80FD5CC: @ 80FD5CC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + bl sub_80984F4 + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FD5CC + + thumb_func_start sub_80FD5F0 +sub_80FD5F0: @ 80FD5F0 + 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 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + ldr r1, _080FD6C0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + movs r3, 0 + mov r9, r4 + ldrb r0, [r5, 0x3] + cmp r3, r0 + bge _080FD6A4 + subs r1, 0x5 + mov r8, r1 +_080FD628: + lsls r3, 16 + asrs r1, r3, 16 + ldr r2, [r5, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r4, r0, 2 + adds r1, r4, r2 + ldrb r0, [r1, 0x5] + adds r7, r3, 0 + cmp r0, 0x7 + bne _080FD694 + movs r2, 0xFA + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r1, 0xA] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080FD694 + ldr r1, [r5, 0x10] + adds r1, r4, r1 + ldrh r2, [r1] + adds r2, 0x7 + mov r0, sp + ldrh r0, [r0] + subs r2, r0 + ldrh r0, [r1, 0x2] + adds r0, 0x7 + mov r3, r9 + ldrh r1, [r3] + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 16 + asrs r1, r2, 16 + movs r3, 0xE0 + lsls r3, 11 + adds r2, r3 + lsrs r2, 16 + cmp r2, 0xE + bhi _080FD694 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, r8 + blt _080FD694 + cmp r2, 0x5 + bgt _080FD694 + adds r0, r6, 0 + bl sub_80FD8E0 +_080FD694: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r3, r0, 16 + asrs r0, 16 + ldrb r2, [r5, 0x3] + cmp r0, r2 + blt _080FD628 +_080FD6A4: + adds r0, r6, 0 + bl sub_80FD7C8 + ldr r0, _080FD6C0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x1 + beq _080FD6C4 + movs r0, 0 + b _080FD6C6 + .align 2, 0 +_080FD6C0: .4byte 0x03005e00 +_080FD6C4: + movs r0, 0x1 +_080FD6C6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80FD5F0 + + thumb_func_start sub_80FD6D4 +sub_80FD6D4: @ 80FD6D4 + push {r4-r6,lr} + lsls r1, 16 + lsrs r3, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + ldrb r2, [r0, 0x3] + ldr r5, [r0, 0x10] + movs r1, 0 + cmp r1, r2 + bge _080FD728 + lsls r0, r3, 16 + asrs r6, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + adds r3, r5, 0 +_080FD6F2: + ldrb r0, [r3, 0x5] + cmp r0, 0x7 + bne _080FD720 + ldrh r0, [r3] + cmp r6, r0 + bne _080FD720 + ldrh r0, [r3, 0x2] + cmp r4, r0 + bne _080FD720 + movs r1, 0xFA + lsls r1, 1 + adds r0, r1, 0 + ldrh r3, [r3, 0xA] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _080FD728 + movs r0, 0x1 + b _080FD72A +_080FD720: + adds r3, 0xC + adds r1, 0x1 + cmp r1, r2 + blt _080FD6F2 +_080FD728: + movs r0, 0 +_080FD72A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FD6D4 + + thumb_func_start sub_80FD730 +sub_80FD730: @ 80FD730 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl mapconnection_get_mapheader + adds r3, r0, 0 + ldrb r0, [r4] + cmp r0, 0x2 + beq _080FD758 + cmp r0, 0x2 + bgt _080FD74E + cmp r0, 0x1 + beq _080FD76C + b _080FD7AC +_080FD74E: + cmp r0, 0x3 + beq _080FD784 + cmp r0, 0x4 + beq _080FD78E + b _080FD7AC +_080FD758: + ldr r0, [r4, 0x4] + adds r0, 0x7 + subs r0, r5, r0 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, [r3] + ldr r0, [r0, 0x4] + subs r0, 0x7 + adds r0, r6 + b _080FD7A2 +_080FD76C: + ldr r0, [r4, 0x4] + adds r0, 0x7 + subs r0, r5, r0 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _080FD780 + ldr r0, [r0] + ldr r0, [r0, 0x4] + b _080FD79E + .align 2, 0 +_080FD780: .4byte 0x02037318 +_080FD784: + ldr r0, [r3] + ldr r0, [r0] + subs r0, 0x7 + adds r0, r5 + b _080FD798 +_080FD78E: + ldr r0, _080FD7A8 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x7 + subs r0, r5, r0 +_080FD798: + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, [r4, 0x4] +_080FD79E: + adds r0, 0x7 + subs r0, r6, r0 +_080FD7A2: + lsls r0, 16 + lsrs r2, r0, 16 + b _080FD7B0 + .align 2, 0 +_080FD7A8: .4byte 0x02037318 +_080FD7AC: + movs r0, 0 + b _080FD7C2 +_080FD7B0: + ldr r0, [r3, 0x4] + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + bl sub_80FD6D4 + lsls r0, 24 + lsrs r0, 24 +_080FD7C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FD730 + + thumb_func_start sub_80FD7C8 +sub_80FD7C8: @ 80FD7C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, _080FD8DC + ldr r1, [r0] + ldr r0, [r1] + adds r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldr r0, [r1, 0x4] + adds r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + lsrs r3, r0, 16 + asrs r0, 16 + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + adds r1, 0x7 + cmp r0, r1 + bgt _080FD8CC +_080FD816: + mov r5, sp + ldrh r0, [r5, 0x2] + subs r0, 0x5 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r2, r4, 16 + asrs r1, r2, 16 + movs r6, 0x2 + ldrsh r0, [r5, r6] + adds r0, 0x5 + lsls r3, 16 + mov r8, r3 + cmp r1, r0 + bgt _080FD8B6 + movs r0, 0x7 + str r0, [sp, 0x10] + mov r1, r8 + asrs r1, 16 + mov r9, r1 + mov r10, r0 +_080FD83E: + ldr r3, [sp, 0x10] + cmp r3, r9 + bgt _080FD860 + ldr r5, [sp, 0x8] + lsls r0, r5, 16 + asrs r0, 16 + cmp r9, r0 + bge _080FD860 + asrs r1, r2, 16 + cmp r10, r1 + bgt _080FD860 + ldr r6, [sp, 0xC] + lsls r0, r6, 16 + asrs r0, 16 + lsls r7, r4, 16 + cmp r1, r0 + blt _080FD89E +_080FD860: + mov r0, r8 + asrs r5, r0, 16 + lsls r4, 16 + asrs r6, r4, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8088A8C + adds r7, r4, 0 + cmp r0, 0 + beq _080FD89E + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80FD730 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD89E + mov r0, sp + ldrh r1, [r0] + subs r1, r5, r1 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, r6, r2 + lsls r2, 16 + asrs r2, 16 + ldr r0, [sp, 0x4] + bl sub_80FD8E0 +_080FD89E: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + lsls r2, r4, 16 + asrs r1, r2, 16 + mov r3, sp + movs r5, 0x2 + ldrsh r0, [r3, r5] + adds r0, 0x5 + cmp r1, r0 + ble _080FD83E +_080FD8B6: + movs r1, 0x80 + lsls r1, 9 + add r1, r8 + lsrs r3, r1, 16 + asrs r1, 16 + mov r0, sp + movs r6, 0 + ldrsh r0, [r0, r6] + adds r0, 0x7 + cmp r1, r0 + ble _080FD816 +_080FD8CC: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FD8DC: .4byte 0x02037318 + thumb_func_end sub_80FD7C8 + + thumb_func_start sub_80FD8E0 +sub_80FD8E0: @ 80FD8E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r12, r2 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _080FD914 + adds r3, r1, r0 + movs r1, 0x4 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080FD918 + strh r7, [r3] + mov r0, r12 + strh r0, [r3, 0x2] + movs r0, 0x1 + strh r0, [r3, 0x4] + b _080FD9A2 + .align 2, 0 +_080FD914: .4byte 0x03005e08 +_080FD918: + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + bge _080FD928 + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 + b _080FD92A +_080FD928: + ldrh r4, [r3] +_080FD92A: + movs r1, 0x2 + ldrsh r0, [r3, r1] + ldrh r1, [r3, 0x2] + mov r9, r1 + cmp r0, 0 + bge _080FD93E + negs r0, r0 + lsls r0, 16 + lsrs r2, r0, 16 + b _080FD940 +_080FD93E: + ldrh r2, [r3, 0x2] +_080FD940: + lsls r1, r7, 16 + asrs r0, r1, 16 + cmp r0, 0 + bge _080FD950 + negs r0, r0 + lsls r0, 16 + lsrs r6, r0, 16 + b _080FD952 +_080FD950: + lsrs r6, r1, 16 +_080FD952: + mov r1, r12 + lsls r0, r1, 16 + asrs r1, r0, 16 + mov r8, r0 + cmp r1, 0 + bge _080FD964 + negs r0, r1 + lsls r0, 16 + b _080FD966 +_080FD964: + mov r0, r8 +_080FD966: + lsrs r5, r0, 16 + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r2, 16 + asrs r2, r1, 16 + adds r4, r0, r2 + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + adds r0, r1 + cmp r4, r0 + ble _080FD988 + strh r7, [r3] + mov r1, r12 + strh r1, [r3, 0x2] + b _080FD9A2 +_080FD988: + cmp r4, r0 + bne _080FD9A2 + cmp r2, r1 + bgt _080FD99C + cmp r2, r1 + bne _080FD9A2 + mov r1, r9 + lsls r0, r1, 16 + cmp r0, r8 + bge _080FD9A2 +_080FD99C: + strh r7, [r3] + mov r0, r12 + strh r0, [r3, 0x2] +_080FD9A2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FD8E0 + + thumb_func_start sub_80FD9B0 +sub_80FD9B0: @ 80FD9B0 + push {r4,r5,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r2, r0, 16 + cmp r0, 0 + bne _080FD9C2 + cmp r1, 0 + beq _080FDA1C +_080FD9C2: + lsls r0, r2, 16 + asrs r2, r0, 16 + adds r5, r0, 0 + cmp r2, 0 + bge _080FD9D4 + negs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + b _080FD9D6 +_080FD9D4: + lsrs r4, r5, 16 +_080FD9D6: + lsls r0, r1, 16 + asrs r2, r0, 16 + adds r1, r0, 0 + cmp r2, 0 + bge _080FD9E8 + negs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + b _080FD9EA +_080FD9E8: + lsrs r3, r1, 16 +_080FD9EA: + lsls r0, r4, 16 + asrs r2, r0, 16 + lsls r0, r3, 16 + asrs r0, 16 + cmp r2, r0 + ble _080FDA02 + cmp r5, 0 + bge _080FD9FE + movs r0, 0x4 + b _080FDA1E +_080FD9FE: + movs r0, 0x2 + b _080FDA1E +_080FDA02: + cmp r2, r0 + bge _080FDA0C + cmp r1, 0 + blt _080FDA14 + b _080FDA18 +_080FDA0C: + cmp r2, r0 + bne _080FDA1C + cmp r1, 0 + bge _080FDA18 +_080FDA14: + movs r0, 0x1 + b _080FDA1E +_080FDA18: + movs r0, 0x3 + b _080FDA1E +_080FDA1C: + movs r0, 0 +_080FDA1E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FD9B0 + + thumb_func_start sub_80FDA24 +sub_80FDA24: @ 80FDA24 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r4, _080FDA90 + adds r0, r4 + bl sub_8093284 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl rom_npc_by_local_id_and_map_get_trainer_flag + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl npc_sync_anim_pause_bits + adds r0, r5, 0 + bl sub_808B828 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FDA90: .4byte 0x02037350 + thumb_func_end sub_80FDA24 + + thumb_func_start sub_80FDA94 +sub_80FDA94: @ 80FDA94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080FDAD0 + adds r0, r1 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDACA + ldr r1, _080FDAD4 + ldr r2, _080FDAD8 + adds r0, r4, 0 + bl sub_81978EC +_080FDACA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDAD0: .4byte 0x02037350 +_080FDAD4: .4byte 0x085e8f93 +_080FDAD8: .4byte sub_80FD5CC + 1 + thumb_func_end sub_80FDA94 + + thumb_func_start sub_80FDADC +sub_80FDADC: @ 80FDADC + 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, _080FDB58 + adds r4, r0, r1 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _080FDB5C + adds r0, r1 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FDB1C + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FDB50 +_080FDB1C: + ldr r1, _080FDB60 + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + bl sub_80FDA24 + movs r0, 0x1 + strh r0, [r4, 0x4] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _080FDB50 + ldr r1, _080FDB64 + ldr r2, _080FDB68 + adds r0, r5, 0 + bl sub_81978EC +_080FDB50: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FDB58: .4byte 0x03005e08 +_080FDB5C: .4byte 0x02037350 +_080FDB60: .4byte 0x085920e4 +_080FDB64: .4byte 0x085e8fdb +_080FDB68: .4byte sub_80FD5CC + 1 + thumb_func_end sub_80FDADC + + thumb_func_start sub_80FDB6C +sub_80FDB6C: @ 80FDB6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDB98 + ldr r0, _080FDB94 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl display_dads_advice_cannot_use_item_str + b _080FDBDA + .align 2, 0 +_080FDB94: .4byte 0x03005e00 +_080FDB98: + ldr r0, _080FDBBC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r5, r1, r0 + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080FDBC8 + ldr r0, _080FDBC0 + ldr r1, [r0] + ldr r0, _080FDBC4 + str r0, [r1] + adds r0, r4, 0 + bl task_close_bag_menu_1 + b _080FDBDA + .align 2, 0 +_080FDBBC: .4byte 0x03005e00 +_080FDBC0: .4byte 0x0203ce54 +_080FDBC4: .4byte sub_80FDBEC + 1 +_080FDBC8: + ldr r0, _080FDBE0 + ldr r1, _080FDBE4 + str r1, [r0] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _080FDBE8 + str r0, [r5] +_080FDBDA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FDBE0: .4byte 0x03005dac +_080FDBE4: .4byte sub_80AF6D4 + 1 +_080FDBE8: .4byte sub_80FDC00 + 1 + thumb_func_end sub_80FDB6C + + thumb_func_start sub_80FDBEC +sub_80FDBEC: @ 80FDBEC + push {lr} + ldr r1, _080FDBFC + movs r0, 0 + bl sub_81357FC + pop {r0} + bx r0 + .align 2, 0 +_080FDBFC: .4byte sub_81AD40C + 1 + thumb_func_end sub_80FDBEC + + thumb_func_start sub_80FDC00 +sub_80FDC00: @ 80FDC00 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FDC2C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080FDC24 + bl overworld_free_bg_tilemaps + ldr r1, _080FDC30 + movs r0, 0 + bl sub_81357FC + adds r0, r4, 0 + bl remove_task +_080FDC24: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDC2C: .4byte 0x02037fd4 +_080FDC30: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_80FDC00 + + thumb_func_start sub_80FDC34 +sub_80FDC34: @ 80FDC34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080FDC7C + bl sub_8145C30 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _080FDC80 + ldr r1, _080FDC84 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r1, _080FDC88 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080FDC90 + ldr r3, _080FDC8C + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C + b _080FDC9A + .align 2, 0 +_080FDC7C: .4byte 0x02021cc4 +_080FDC80: .4byte 0x02021fc4 +_080FDC84: .4byte 0x085e9026 +_080FDC88: .4byte 0x03005e00 +_080FDC8C: .4byte sub_81ABBBC + 1 +_080FDC90: + ldr r2, _080FDCA0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_080FDC9A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FDCA0: .4byte sub_80FD1F8 + 1 + thumb_func_end sub_80FDC34 + + thumb_func_start sub_80FDCA4 +sub_80FDCA4: @ 80FDCA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080FDCE8 + bl sub_80247BC + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl decimal_int_to_string + ldr r4, _080FDCEC + ldr r1, _080FDCF0 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r1, _080FDCF4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080FDCFC + ldr r3, _080FDCF8 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C + b _080FDD06 + .align 2, 0 +_080FDCE8: .4byte 0x02021cc4 +_080FDCEC: .4byte 0x02021fc4 +_080FDCF0: .4byte 0x085e9138 +_080FDCF4: .4byte 0x03005e00 +_080FDCF8: .4byte sub_81ABBBC + 1 +_080FDCFC: + ldr r2, _080FDD0C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_080FDD06: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FDD0C: .4byte sub_80FD1F8 + 1 + thumb_func_end sub_80FDCA4 + + thumb_func_start sub_80FDD10 +sub_80FDD10: @ 80FDD10 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80E1738 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDD58 + ldr r1, _080FDD40 + ldr r0, _080FDD44 + str r0, [r1] + ldr r1, _080FDD48 + ldr r0, _080FDD4C + str r0, [r1] + ldr r0, _080FDD50 + ldr r1, [r0] + ldr r0, _080FDD54 + str r0, [r1] + adds r0, r4, 0 + bl task_close_bag_menu_1 + b _080FDD68 + .align 2, 0 +_080FDD40: .4byte 0x0203a0f4 +_080FDD44: .4byte sub_80FDD74 + 1 +_080FDD48: .4byte 0x03005dac +_080FDD4C: .4byte sub_80FD124 + 1 +_080FDD50: .4byte 0x0203ce54 +_080FDD54: .4byte c2_exit_to_overworld_2_switch + 1 +_080FDD58: + ldr r0, _080FDD70 + ldrh r0, [r0] + bl itemid_get_overworld_function + adds r1, r0, 0 + adds r0, r4, 0 + bl _call_via_r1 +_080FDD68: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDD70: .4byte 0x0203ce7c + thumb_func_end sub_80FDD10 + + thumb_func_start sub_80FDD74 +sub_80FDD74: @ 80FDD74 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080FDD9C + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 + bl script_env_2_enable + ldr r0, _080FDDA0 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDD9C: .4byte 0x0203ce7c +_080FDDA0: .4byte 0x08274482 + thumb_func_end sub_80FDD74 + + thumb_func_start sub_80FDDA4 +sub_80FDDA4: @ 80FDDA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80FDE2C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDDC8 + ldr r1, _080FDDC0 + ldr r0, _080FDDC4 + b _080FDDD8 + .align 2, 0 +_080FDDC0: .4byte 0x0203a0f4 +_080FDDC4: .4byte sub_80FDE7C + 1 +_080FDDC8: + bl sub_80E1770 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDDEC + ldr r1, _080FDDE4 + ldr r0, _080FDDE8 +_080FDDD8: + str r0, [r1] + adds r0, r4, 0 + bl run_eventually_start + b _080FDDFE + .align 2, 0 +_080FDDE4: .4byte 0x0203a0f4 +_080FDDE8: .4byte sub_80FDE08 + 1 +_080FDDEC: + ldr r0, _080FDE04 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r5, 0 + bl display_dads_advice_cannot_use_item_str +_080FDDFE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FDE04: .4byte 0x03005e00 + thumb_func_end sub_80FDDA4 + + thumb_func_start sub_80FDE08 +sub_80FDE08: @ 80FDE08 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + ldr r0, _080FDE28 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDE28: .4byte 0x082744c0 + thumb_func_end sub_80FDE08 + + thumb_func_start sub_80FDE2C +sub_80FDE2C: @ 80FDE2C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl player_get_height + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r0, sp + ldrh r0, [r0] + ldrh r1, [r4] + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _080FDE68 + ldr r0, _080FDE6C + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x5] + cmp r0, 0xE4 + beq _080FDE70 +_080FDE68: + movs r0, 0 + b _080FDE72 + .align 2, 0 +_080FDE6C: .4byte 0x02037350 +_080FDE70: + movs r0, 0x1 +_080FDE72: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FDE2C + + thumb_func_start sub_80FDE7C +sub_80FDE7C: @ 80FDE7C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + ldr r0, _080FDE9C + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDE9C: .4byte 0x08242cfc + thumb_func_end sub_80FDE7C + + thumb_func_start item_field_func_recovery_item +item_field_func_recovery_item: @ 80FDEA0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FDEB4 + ldr r1, _080FDEB8 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FDEB4: .4byte 0x03006328 +_080FDEB8: .4byte sub_81B6588 + 1 + thumb_func_end item_field_func_recovery_item + + thumb_func_start sub_80FDEBC +sub_80FDEBC: @ 80FDEBC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FDED0 + ldr r1, _080FDED4 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FDED0: .4byte 0x03006328 +_080FDED4: .4byte sub_81B67C8 + 1 + thumb_func_end sub_80FDEBC + + thumb_func_start item_in_battle_func_sacred_ash +item_in_battle_func_sacred_ash: @ 80FDED8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FDEEC + ldr r1, _080FDEF0 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FDEEC: .4byte 0x03006328 +_080FDEF0: .4byte sub_81B79E8 + 1 + thumb_func_end item_in_battle_func_sacred_ash + + thumb_func_start item_field_func_pp_recovery_item +item_field_func_pp_recovery_item: @ 80FDEF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FDF08 + ldr r1, _080FDF0C + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FDF08: .4byte 0x03006328 +_080FDF0C: .4byte dp05_ether + 1 + thumb_func_end item_field_func_pp_recovery_item + + thumb_func_start sub_80FDF10 +sub_80FDF10: @ 80FDF10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FDF24 + ldr r1, _080FDF28 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FDF24: .4byte 0x03006328 +_080FDF28: .4byte dp05_pp_up + 1 + thumb_func_end sub_80FDF10 + + thumb_func_start sub_80FDF2C +sub_80FDF2C: @ 80FDF2C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FDF40 + ldr r1, _080FDF44 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FDF40: .4byte 0x03006328 +_080FDF44: .4byte dp05_rare_candy + 1 + thumb_func_end sub_80FDF2C + + thumb_func_start sub_80FDF48 +sub_80FDF48: @ 80FDF48 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FDF68 + ldrh r1, [r0] + movs r0, 0xA9 + lsls r0, 1 + cmp r1, r0 + bls _080FDF74 + ldr r2, _080FDF6C + ldr r3, _080FDF70 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FDF80 + .align 2, 0 +_080FDF68: .4byte 0x0203ce7c +_080FDF6C: .4byte 0x085e9047 +_080FDF70: .4byte sub_80FDF90 + 1 +_080FDF74: + ldr r2, _080FDF88 + ldr r3, _080FDF8C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C +_080FDF80: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDF88: .4byte 0x085e9037 +_080FDF8C: .4byte sub_80FDF90 + 1 + thumb_func_end sub_80FDF48 + + thumb_func_start sub_80FDF90 +sub_80FDF90: @ 80FDF90 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + bl audio_play + ldr r1, _080FDFB4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _080FDFB8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FDFB4: .4byte 0x03005e00 +_080FDFB8: .4byte task08_0809AD8C + 1 + thumb_func_end sub_80FDF90 + + thumb_func_start task08_0809AD8C +task08_0809AD8C: @ 80FDFBC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _080FE008 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080FE000 + ldr r4, _080FE00C + ldr r0, _080FE010 + ldrh r0, [r0] + bl sub_81B6CFC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, _080FE014 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r4, _080FE018 + ldr r1, _080FE01C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r3, _080FE020 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C +_080FE000: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE008: .4byte 0x030022c0 +_080FE00C: .4byte 0x02021cc4 +_080FE010: .4byte 0x0203ce7c +_080FE014: .4byte 0x0831977c +_080FE018: .4byte 0x02021fc4 +_080FE01C: .4byte 0x085e9058 +_080FE020: .4byte sub_80FE024 + 1 + thumb_func_end task08_0809AD8C + + thumb_func_start sub_80FE024 +sub_80FE024: @ 80FE024 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE038 + movs r1, 0x6 + bl sub_81AE238 + pop {r0} + bx r0 + .align 2, 0 +_080FE038: .4byte 0x085920e8 + thumb_func_end sub_80FE024 + + thumb_func_start sub_80FE03C +sub_80FE03C: @ 80FE03C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE050 + ldr r1, _080FE054 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FE050: .4byte 0x03006328 +_080FE054: .4byte sub_81B6DC4 + 1 + thumb_func_end sub_80FE03C + + thumb_func_start sub_80FE058 +sub_80FE058: @ 80FE058 + push {r4,lr} + ldr r4, _080FE09C + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6AA4 + ldrh r0, [r4] + ldr r1, _080FE0A0 + bl itemid_get_name + ldr r0, _080FE0A4 + ldr r1, _080FE0A8 + bl ExpandTextCodes + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE0AC + ldrh r0, [r4] + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + bl sub_81AB9A8 + ldrh r0, [r4] + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + bl sub_81ABA88 + b _080FE0B4 + .align 2, 0 +_080FE09C: .4byte 0x0203ce7c +_080FE0A0: .4byte 0x02021dc4 +_080FE0A4: .4byte 0x02021fc4 +_080FE0A8: .4byte 0x085e9080 +_080FE0AC: + bl sub_81C5924 + bl sub_81C59BC +_080FE0B4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FE058 + + thumb_func_start sub_80FE0BC +sub_80FE0BC: @ 80FE0BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _080FE0E0 + bl var_get + lsls r0, 16 + cmp r0, 0 + bne _080FE0EC + ldr r0, _080FE0E4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080FE0E8 + str r0, [r1] + b _080FE116 + .align 2, 0 +_080FE0E0: .4byte 0x00004021 +_080FE0E4: .4byte 0x03005e00 +_080FE0E8: .4byte sub_80FE124 + 1 +_080FE0EC: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE10C + ldr r2, _080FE104 + ldr r3, _080FE108 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE116 + .align 2, 0 +_080FE104: .4byte 0x085e9092 +_080FE108: .4byte sub_81ABBBC + 1 +_080FE10C: + ldr r1, _080FE11C + ldr r2, _080FE120 + adds r0, r5, 0 + bl sub_81C6DD8 +_080FE116: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE11C: .4byte 0x085e9092 +_080FE120: .4byte sub_81C6714 + 1 + thumb_func_end sub_80FE0BC + + thumb_func_start sub_80FE124 +sub_80FE124: @ 80FE124 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r5, _080FE15C + adds r1, r4, r5 + ldrh r0, [r1, 0x10] + adds r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080FE156 + movs r0, 0 + strh r0, [r1, 0x10] + movs r0, 0x2F + bl audio_play + adds r0, r5, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, _080FE160 + str r1, [r0] +_080FE156: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE15C: .4byte 0x03005e08 +_080FE160: .4byte sub_80FE164 + 1 + thumb_func_end sub_80FE124 + + thumb_func_start sub_80FE164 +sub_80FE164: @ 80FE164 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080FE1C2 + ldr r4, _080FE1A8 + ldr r0, _080FE1AC + ldrh r0, [r0] + bl itemid_get_quality + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl var_set + bl sub_80FE058 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE1B8 + ldr r2, _080FE1B0 + ldr r3, _080FE1B4 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE1C2 + .align 2, 0 +_080FE1A8: .4byte 0x00004021 +_080FE1AC: .4byte 0x0203ce7c +_080FE1B0: .4byte 0x02021fc4 +_080FE1B4: .4byte sub_81ABBBC + 1 +_080FE1B8: + ldr r1, _080FE1C8 + ldr r2, _080FE1CC + adds r0, r6, 0 + bl sub_81C6DD8 +_080FE1C2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FE1C8: .4byte 0x02021fc4 +_080FE1CC: .4byte sub_81C6714 + 1 + thumb_func_end sub_80FE164 + + thumb_func_start sub_80FE1D0 +sub_80FE1D0: @ 80FE1D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _080FE210 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080FE226 + movs r0, 0x75 + bl audio_play + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE21C + ldr r2, _080FE214 + ldr r3, _080FE218 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE226 + .align 2, 0 +_080FE210: .4byte 0x03005e00 +_080FE214: .4byte 0x02021fc4 +_080FE218: .4byte sub_81ABBBC + 1 +_080FE21C: + ldr r1, _080FE22C + ldr r2, _080FE230 + adds r0, r5, 0 + bl sub_81C6DD8 +_080FE226: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE22C: .4byte 0x02021fc4 +_080FE230: .4byte sub_81C6714 + 1 + thumb_func_end sub_80FE1D0 + + thumb_func_start item_field_func_black_white_flutes +item_field_func_black_white_flutes: @ 80FE234 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _080FE260 + ldrh r0, [r4] + ldr r1, _080FE264 + bl itemid_get_name + ldrh r0, [r4] + cmp r0, 0x2B + bne _080FE278 + ldr r0, _080FE268 + bl flag_set + ldr r0, _080FE26C + bl flag_clear + ldr r0, _080FE270 + ldr r1, _080FE274 + bl ExpandTextCodes + b _080FE28C + .align 2, 0 +_080FE260: .4byte 0x0203ce7c +_080FE264: .4byte 0x02021dc4 +_080FE268: .4byte 0x000008ad +_080FE26C: .4byte 0x000008ae +_080FE270: .4byte 0x02021fc4 +_080FE274: .4byte 0x085e90c6 +_080FE278: + ldr r0, _080FE2A4 + bl flag_set + ldr r0, _080FE2A8 + bl flag_clear + ldr r0, _080FE2AC + ldr r1, _080FE2B0 + bl ExpandTextCodes +_080FE28C: + ldr r1, _080FE2B4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x18] + ldr r1, _080FE2B8 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE2A4: .4byte 0x000008ae +_080FE2A8: .4byte 0x000008ad +_080FE2AC: .4byte 0x02021fc4 +_080FE2B0: .4byte 0x085e90f4 +_080FE2B4: .4byte 0x03005e00 +_080FE2B8: .4byte sub_80FE1D0 + 1 + thumb_func_end item_field_func_black_white_flutes + + thumb_func_start task08_080A1C44 +task08_080A1C44: @ 80FE2BC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl player_avatar_init_params_reset + bl sub_80B7CC8 + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end task08_080A1C44 + + thumb_func_start re_escape_rope +re_escape_rope: @ 80FE2D8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl flagmods_08054D70 + bl sub_80FE058 + ldr r1, _080FE308 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, _080FE30C + ldr r2, _080FE310 + adds r0, r4, 0 + bl sub_81978EC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FE308: .4byte 0x03005e00 +_080FE30C: .4byte 0x02021fc4 +_080FE310: .4byte task08_080A1C44 + 1 + thumb_func_end re_escape_rope + + thumb_func_start sub_80FE314 +sub_80FE314: @ 80FE314 + push {lr} + ldr r0, _080FE328 + ldrb r1, [r0, 0x1A] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080FE32C + movs r0, 0 + b _080FE32E + .align 2, 0 +_080FE328: .4byte 0x02037318 +_080FE32C: + movs r0, 0x1 +_080FE32E: + pop {r1} + bx r1 + thumb_func_end sub_80FE314 + + thumb_func_start sub_80FE334 +sub_80FE334: @ 80FE334 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80FE314 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FE35C + ldr r1, _080FE354 + ldr r0, _080FE358 + str r0, [r1] + adds r0, r4, 0 + bl run_eventually_start + b _080FE36E + .align 2, 0 +_080FE354: .4byte 0x0203a0f4 +_080FE358: .4byte re_escape_rope + 1 +_080FE35C: + ldr r0, _080FE374 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl display_dads_advice_cannot_use_item_str +_080FE36E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FE374: .4byte 0x03005e00 + thumb_func_end sub_80FE334 + + thumb_func_start sub_80FE378 +sub_80FE378: @ 80FE378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE38C + ldr r1, _080FE390 + str r1, [r2] + bl sub_80FD060 + pop {r0} + bx r0 + .align 2, 0 +_080FE38C: .4byte 0x03006328 +_080FE390: .4byte sub_81B7C74 + 1 + thumb_func_end sub_80FE378 + + thumb_func_start item_in_battle_func_pokeball +item_in_battle_func_pokeball: @ 80FE394 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_806B8B0 + lsls r0, 24 + cmp r0, 0 + bne _080FE3D0 + ldr r0, _080FE3C4 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE3C8 + adds r0, r4, 0 + bl task_close_bag_menu_1 + b _080FE3FA + .align 2, 0 +_080FE3C4: .4byte 0x0203ce7c +_080FE3C8: + adds r0, r4, 0 + bl sub_81C5B14 + b _080FE3FA +_080FE3D0: + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE3F0 + ldr r2, _080FE3E8 + ldr r3, _080FE3EC + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE3FA + .align 2, 0 +_080FE3E8: .4byte 0x085e9125 +_080FE3EC: .4byte sub_81ABBBC + 1 +_080FE3F0: + ldr r1, _080FE400 + ldr r2, _080FE404 + adds r0, r5, 0 + bl sub_81C6DD8 +_080FE3FA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE400: .4byte 0x085e9125 +_080FE404: .4byte sub_81C6714 + 1 + thumb_func_end item_in_battle_func_pokeball + + thumb_func_start sub_80FE408 +sub_80FE408: @ 80FE408 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _080FE430 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080FE43A + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE434 + adds r0, r4, 0 + bl task_close_bag_menu_1 + b _080FE43A + .align 2, 0 +_080FE430: .4byte 0x030022c0 +_080FE434: + adds r0, r5, 0 + bl sub_81C5B14 +_080FE43A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FE408 + + thumb_func_start sub_80FE440 +sub_80FE440: @ 80FE440 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, _080FE490 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080FE4AC + movs r0, 0x1 + bl audio_play + ldr r4, _080FE494 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6AA4 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE49C + ldrh r0, [r4] + bl sub_806CF78 + adds r2, r0, 0 + ldr r3, _080FE498 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE4AC + .align 2, 0 +_080FE490: .4byte 0x03005e00 +_080FE494: .4byte 0x0203ce7c +_080FE498: .4byte sub_80FE408 + 1 +_080FE49C: + ldrh r0, [r4] + bl sub_806CF78 + adds r1, r0, 0 + ldr r2, _080FE4B4 + adds r0, r6, 0 + bl sub_81C6DD8 +_080FE4AC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FE4B4: .4byte sub_80FE408 + 1 + thumb_func_end sub_80FE440 + + thumb_func_start status_incr_battle +status_incr_battle: @ 80FE4B8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _080FE500 + ldr r0, _080FE504 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r1, _080FE508 + adds r0, r1 + ldr r1, _080FE50C + ldrh r1, [r1] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl sub_806BD04 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080FE52C + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE518 + ldr r2, _080FE510 + ldr r3, _080FE514 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE53C + .align 2, 0 +_080FE500: .4byte 0x0202406e +_080FE504: .4byte 0x020244b8 +_080FE508: .4byte 0x020244ec +_080FE50C: .4byte 0x0203ce7c +_080FE510: .4byte 0x085e96f6 +_080FE514: .4byte sub_81ABBBC + 1 +_080FE518: + ldr r1, _080FE524 + ldr r2, _080FE528 + adds r0, r4, 0 + bl sub_81C6DD8 + b _080FE53C + .align 2, 0 +_080FE524: .4byte 0x085e96f6 +_080FE528: .4byte sub_81C6714 + 1 +_080FE52C: + ldr r0, _080FE544 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _080FE548 + str r0, [r1] + strh r2, [r1, 0x18] +_080FE53C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FE544: .4byte 0x03005e00 +_080FE548: .4byte sub_80FE440 + 1 + thumb_func_end status_incr_battle + + thumb_func_start sub_80FE54C +sub_80FE54C: @ 80FE54C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE574 + ldr r0, _080FE56C + ldr r1, [r0] + ldr r0, _080FE570 + str r0, [r1] + adds r0, r4, 0 + bl task_close_bag_menu_1 + b _080FE582 + .align 2, 0 +_080FE56C: .4byte 0x0203ce54 +_080FE570: .4byte sub_81B89F0 + 1 +_080FE574: + ldr r0, _080FE588 + ldr r1, [r0] + ldr r0, _080FE58C + str r0, [r1] + adds r0, r4, 0 + bl sub_81C5B14 +_080FE582: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FE588: .4byte 0x0203cf2c +_080FE58C: .4byte sub_81B89F0 + 1 + thumb_func_end sub_80FE54C + + thumb_func_start item_in_battle_func_recovery_item +item_in_battle_func_recovery_item: @ 80FE590 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE5A4 + ldr r1, _080FE5A8 + str r1, [r2] + bl sub_80FE54C + pop {r0} + bx r0 + .align 2, 0 +_080FE5A4: .4byte 0x03006328 +_080FE5A8: .4byte sub_81B6588 + 1 + thumb_func_end item_in_battle_func_recovery_item + + thumb_func_start sub_80FE5AC +sub_80FE5AC: @ 80FE5AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE5C0 + ldr r1, _080FE5C4 + str r1, [r2] + bl sub_80FE54C + pop {r0} + bx r0 + .align 2, 0 +_080FE5C0: .4byte 0x03006328 +_080FE5C4: .4byte sub_81B79E8 + 1 + thumb_func_end sub_80FE5AC + + thumb_func_start item_in_battle_func_pp_recovery_item +item_in_battle_func_pp_recovery_item: @ 80FE5C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE5DC + ldr r1, _080FE5E0 + str r1, [r2] + bl sub_80FE54C + pop {r0} + bx r0 + .align 2, 0 +_080FE5DC: .4byte 0x03006328 +_080FE5E0: .4byte dp05_ether + 1 + thumb_func_end item_in_battle_func_pp_recovery_item + + thumb_func_start sub_80FE5E4 +sub_80FE5E4: @ 80FE5E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FE614 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080FE634 + bl sub_80FE058 + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _080FE620 + ldr r2, _080FE618 + ldr r3, _080FE61C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _080FE646 + .align 2, 0 +_080FE614: .4byte 0x02022fec +_080FE618: .4byte 0x02021fc4 +_080FE61C: .4byte task_close_bag_menu_1 + 1 +_080FE620: + ldr r1, _080FE62C + ldr r2, _080FE630 + adds r0, r4, 0 + bl sub_81C6DD8 + b _080FE646 + .align 2, 0 +_080FE62C: .4byte 0x02021fc4 +_080FE630: .4byte sub_81C5B14 + 1 +_080FE634: + ldr r0, _080FE64C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl display_dads_advice_cannot_use_item_str +_080FE646: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FE64C: .4byte 0x03005e00 + thumb_func_end sub_80FE5E4 + + thumb_func_start sub_80FE650 +sub_80FE650: @ 80FE650 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FE674 + ldrh r0, [r0] + bl sub_81B7CEC + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x14 + bls _080FE66A + b _080FE75C +_080FE66A: + lsls r0, 2 + ldr r1, _080FE678 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FE674: .4byte 0x0203ce7c +_080FE678: .4byte _080FE67C + .align 2, 0 +_080FE67C: + .4byte _080FE708 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE75C + .4byte _080FE75C + .4byte _080FE6EC + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE75C + .4byte _080FE724 + .4byte _080FE724 + .4byte _080FE740 +_080FE6D0: + ldr r0, _080FE6E8 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl item_field_func_recovery_item + b _080FE770 + .align 2, 0 +_080FE6E8: .4byte 0x03005e00 +_080FE6EC: + ldr r0, _080FE704 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl item_in_battle_func_sacred_ash + b _080FE770 + .align 2, 0 +_080FE704: .4byte 0x03005e00 +_080FE708: + ldr r0, _080FE720 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl sub_80FDF2C + b _080FE770 + .align 2, 0 +_080FE720: .4byte 0x03005e00 +_080FE724: + ldr r0, _080FE73C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl sub_80FDF10 + b _080FE770 + .align 2, 0 +_080FE73C: .4byte 0x03005e00 +_080FE740: + ldr r0, _080FE758 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl item_field_func_pp_recovery_item + b _080FE770 + .align 2, 0 +_080FE758: .4byte 0x03005e00 +_080FE75C: + ldr r0, _080FE778 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x4 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl item_field_func_cannot_use +_080FE770: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FE778: .4byte 0x03005e00 + thumb_func_end sub_80FE650 + + thumb_func_start sub_80FE77C +sub_80FE77C: @ 80FE77C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _080FE79C + ldrh r0, [r0] + bl sub_81B7CEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + bhi _080FE814 + lsls r0, 2 + ldr r1, _080FE7A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080FE79C: .4byte 0x0203ce7c +_080FE7A0: .4byte _080FE7A4 + .align 2, 0 +_080FE7A4: + .4byte _080FE7FC + .4byte _080FE814 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE814 + .4byte _080FE804 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE80C +_080FE7FC: + adds r0, r4, 0 + bl status_incr_battle + b _080FE81A +_080FE804: + adds r0, r4, 0 + bl item_in_battle_func_recovery_item + b _080FE81A +_080FE80C: + adds r0, r4, 0 + bl item_in_battle_func_pp_recovery_item + b _080FE81A +_080FE814: + adds r0, r4, 0 + bl item_field_func_cannot_use +_080FE81A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FE77C + + thumb_func_start item_field_func_cannot_use +item_field_func_cannot_use: @ 80FE820 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080FE83C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r1, [r1, 0xE] + bl display_dads_advice_cannot_use_item_str + pop {r0} + bx r0 + .align 2, 0 +_080FE83C: .4byte 0x03005e00 + thumb_func_end item_field_func_cannot_use + + thumb_func_start sub_80FE840 +sub_80FE840: @ 80FE840 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _080FE874 + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + ldr r0, _080FE878 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FE87C + ldrh r0, [r5, 0x8] + negs r0, r0 + b _080FE87E + .align 2, 0 +_080FE874: .4byte 0x0203841e +_080FE878: .4byte 0x02038436 +_080FE87C: + ldrh r0, [r5, 0x8] +_080FE87E: + strh r0, [r4, 0x34] + ldr r0, _080FE890 + ldrh r0, [r0, 0xA] + strh r0, [r4, 0x36] + ldr r0, _080FE894 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE890: .4byte 0x0203841e +_080FE894: .4byte sub_80FE898 + 1 + thumb_func_end sub_80FE840 + + thumb_func_start sub_80FE898 +sub_80FE898: @ 80FE898 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080FE8D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r1, r0 + strh r1, [r4, 0x32] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _080FE8DA +_080FE8D4: + adds r0, r4, 0 + bl move_anim_8072740 +_080FE8DA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FE898 + + thumb_func_start sub_80FE8E0 +sub_80FE8E0: @ 80FE8E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _080FE920 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r5, _080FE924 + 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, _080FE928 + str r0, [r4, 0x1C] + ldr r1, _080FE92C + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE920: .4byte 0x0203841e +_080FE924: .4byte 0x02038436 +_080FE928: .4byte sub_80A6EEC + 1 +_080FE92C: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_80FE8E0 + + thumb_func_start sub_80FE930 +sub_80FE930: @ 80FE930 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, _080FE978 + ldrb r1, [r5, 0x6] + adds r0, r4, 0 + bl obj_anim_image_start + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldr r5, _080FE97C + 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, _080FE980 + str r0, [r4, 0x1C] + ldr r1, _080FE984 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FE978: .4byte 0x0203841e +_080FE97C: .4byte 0x02038437 +_080FE980: .4byte sub_80A6EEC + 1 +_080FE984: .4byte move_anim_8072740 + 1 + thumb_func_end sub_80FE930 + + thumb_func_start sub_80FE988 +sub_80FE988: @ 80FE988 + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r6, _080FE9D8 + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r5, _080FE9DC + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r6, 0x6] + strh r0, [r4, 0x38] + ldr r1, _080FE9E0 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FE9D8: .4byte 0x0203841e +_080FE9DC: .4byte 0x02038437 +_080FE9E0: .4byte sub_80FE9E4 + 1 + thumb_func_end sub_80FE988 + + thumb_func_start sub_80FE9E4 +sub_80FE9E4: @ 80FE9E4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _080FE9FA + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _080FEA4E +_080FE9FA: + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080FEA14 + ldr r0, _080FEA10 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 + b _080FEA1E + .align 2, 0 +_080FEA10: .4byte 0x02038437 +_080FEA14: + ldr r0, _080FEA54 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x6 +_080FEA1E: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xE + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0xF + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] +_080FEA4E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FEA54: .4byte 0x02038437 + thumb_func_end sub_80FE9E4 + + thumb_func_start sub_80FEA58 +sub_80FEA58: @ 80FEA58 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _080FEAC8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + subs r0, 0x1 + movs r2, 0 + strh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080FEAB2 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + movs r0, 0x6 + strh r0, [r5, 0x8] + ldr r1, _080FEACC + movs r0, 0xF + strh r0, [r1] + strh r2, [r1, 0x2] + movs r0, 0x50 + strh r0, [r1, 0x4] + strh r2, [r1, 0x6] + ldr r4, _080FEAD0 + ldr r0, _080FEAD4 + ldrb r0, [r0] + bl sub_80A82E4 + adds r3, r0, 0 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl obj_add_from_template_call_callback_once +_080FEAB2: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0xF + bne _080FEAC0 + adds r0, r6, 0 + bl move_anim_task_del +_080FEAC0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FEAC8: .4byte 0x03005e00 +_080FEACC: .4byte 0x0203841e +_080FEAD0: .4byte 0x08592210 +_080FEAD4: .4byte 0x02038437 + thumb_func_end sub_80FEA58 + + thumb_func_start sub_80FEAD8 +sub_80FEAD8: @ 80FEAD8 + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r6, _080FEB1C + ldrh r0, [r6, 0x6] + strh r0, [r4, 0x2E] + ldr r5, _080FEB20 + 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] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _080FEB24 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FEB1C: .4byte 0x0203841e +_080FEB20: .4byte 0x02038436 +_080FEB24: .4byte sub_80FEB28 + 1 + thumb_func_end sub_80FEAD8 + + thumb_func_start sub_80FEB28 +sub_80FEB28: @ 80FEB28 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080FEB3C + adds r0, r4, 0 + bl move_anim_8072740 +_080FEB3C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEB28 + + thumb_func_start sub_80FEB44 +sub_80FEB44: @ 80FEB44 + push {r4,r5,lr} + adds r5, r0, 0 + bl GenerateRandomNumber2 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x7 + ands r1, r0 + adds r0, r5, 0 + bl obj_anim_image_start + ldr r4, _080FEB8C + 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 + beq _080FEB90 + ldrh r0, [r5, 0x20] + subs r0, 0x14 + b _080FEB94 + .align 2, 0 +_080FEB8C: .4byte 0x02038436 +_080FEB90: + ldrh r0, [r5, 0x20] + adds r0, 0x14 +_080FEB94: + strh r0, [r5, 0x20] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1F + ands r0, r1 + adds r0, 0x40 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, _080FEBF4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A7160 + bl GenerateRandomNumber2 + movs r1, 0xFF + ands r1, r0 + strh r1, [r5, 0x38] + adds r0, r5, 0 + adds r0, 0x43 + ldrb r0, [r0] + strh r0, [r5, 0x3A] + ldr r1, _080FEBF8 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FEBF4: .4byte 0x02038437 +_080FEBF8: .4byte sub_80FEBFC + 1 + thumb_func_end sub_80FEB44 + + thumb_func_start sub_80FEBFC +sub_80FEBFC: @ 80FEBFC + push {r4,lr} + adds r4, r0, 0 + bl sub_80A70E8 + lsls r0, 24 + cmp r0, 0 + beq _080FEC12 + adds r0, r4, 0 + bl move_anim_8072740 + b _080FEC42 +_080FEC12: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xC + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x7E + bgt _080FEC2E + ldrh r0, [r4, 0x3A] + b _080FEC32 +_080FEC2E: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 +_080FEC32: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r0, [r4, 0x38] + adds r0, 0x18 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] +_080FEC42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEBFC + + thumb_func_start sub_80FEC48 +sub_80FEC48: @ 80FEC48 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _080FECA8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FEC68 + ldr r1, _080FECAC + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080FEC68: + ldr r4, _080FECAC + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, _080FECB0 + ldrb r0, [r5] + movs r1, 0 + 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, 0x1 + 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, _080FECB4 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FECA8: .4byte 0x02038436 +_080FECAC: .4byte 0x0203841e +_080FECB0: .4byte 0x02038437 +_080FECB4: .4byte sub_80FECB8 + 1 + thumb_func_end sub_80FEC48 + + thumb_func_start sub_80FECB8 +sub_80FECB8: @ 80FECB8 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080FECE2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0xA + strh r0, [r4, 0x2E] + ldr r0, _080FECE8 + str r0, [r4, 0x1C] + ldr r1, _080FECEC + adds r0, r4, 0 + bl oamt_set_x3A_32 +_080FECE2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FECE8: .4byte sub_80A64B0 + 1 +_080FECEC: .4byte sub_80FECF0 + 1 + thumb_func_end sub_80FECB8 + + thumb_func_start sub_80FECF0 +sub_80FECF0: @ 80FECF0 + push {r4,lr} + adds r4, r0, 0 + 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 obj_anim_image_start + movs r0, 0x3C + strh r0, [r4, 0x2E] + ldr r0, _080FED20 + str r0, [r4, 0x1C] + ldr r1, _080FED24 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FED20: .4byte sub_80A64B0 + 1 +_080FED24: .4byte move_anim_8072740 + 1 + thumb_func_end sub_80FECF0 + + thumb_func_start sub_80FED28 +sub_80FED28: @ 80FED28 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r5, _080FED6C + ldrb r1, [r5, 0x8] + adds r0, r4, 0 + bl obj_anim_image_start + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080FED52 + ldrb r0, [r4, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x1] +_080FED52: + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x30] + ldr r1, _080FED70 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FED6C: .4byte 0x0203841e +_080FED70: .4byte sub_80FED74 + 1 + thumb_func_end sub_80FED28 + + thumb_func_start sub_80FED74 +sub_80FED74: @ 80FED74 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x3 + negs r1, r1 + bl cosine + ldrh r1, [r4, 0x32] + adds r1, 0x18 + strh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _080FEDC8 + ldr r0, _080FEDC4 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + b _080FEDEC + .align 2, 0 +_080FEDC4: .4byte 0x02038437 +_080FEDC8: + ldr r0, _080FEE18 + ldrb r0, [r0] + bl sub_80A8328 + adds r0, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080FEDDC + movs r2, 0x3 +_080FEDDC: + movs r0, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 +_080FEDEC: + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080FEE10 + adds r0, r4, 0 + bl move_anim_8072740 +_080FEE10: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FEE18: .4byte 0x02038437 + thumb_func_end sub_80FED74 + + thumb_func_start sub_80FEE1C +sub_80FEE1C: @ 80FEE1C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080FEE36 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _080FEE3E +_080FEE36: + adds r0, r4, 0 + bl move_anim_task_del + b _080FEE70 +_080FEE3E: + ldr r0, _080FEE5C + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FEE60 + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x3 + bl lcd_bg_operations + b _080FEE6A + .align 2, 0 +_080FEE5C: .4byte 0x02038437 +_080FEE60: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations +_080FEE6A: + adds r0, r4, 0 + bl move_anim_task_del +_080FEE70: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEE1C + + thumb_func_start sub_80FEE78 +sub_80FEE78: @ 80FEE78 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r5, _080FEEC0 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldr r0, _080FEEC4 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x4] + adds r0, r5 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x40 + strh r0, [r4, 0x38] + ldr r1, _080FEEC8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FEEC0: .4byte 0x0203841e +_080FEEC4: .4byte 0x02038436 +_080FEEC8: .4byte sub_80FEECC + 1 + thumb_func_end sub_80FEE78 + + thumb_func_start sub_80FEECC +sub_80FEECC: @ 80FEECC + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _080FEF38 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x5 + negs r1, r1 + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _080FEF18 + ldr r0, _080FEF14 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + b _080FEF22 + .align 2, 0 +_080FEF14: .4byte 0x02038436 +_080FEF18: + ldr r0, _080FEF34 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 +_080FEF22: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r0, [r4, 0x38] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _080FEF3E + .align 2, 0 +_080FEF34: .4byte 0x02038436 +_080FEF38: + adds r0, r4, 0 + bl move_anim_8072740 +_080FEF3E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEECC + + thumb_func_start sub_80FEF44 +sub_80FEF44: @ 80FEF44 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, _080FEF8C + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldr r0, _080FEF90 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x4] + adds r0, r5 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x40 + strh r0, [r4, 0x38] + ldr r1, _080FEF94 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FEF8C: .4byte 0x0203841e +_080FEF90: .4byte 0x02038436 +_080FEF94: .4byte sub_80FEF98 + 1 + thumb_func_end sub_80FEF44 + + thumb_func_start sub_80FEF98 +sub_80FEF98: @ 80FEF98 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _080FEFF0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldrh r1, [r4, 0x38] + adds r0, r1, 0 + subs r0, 0x3B + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bls _080FEFD0 + adds r0, r1, 0 + subs r0, 0xBB + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _080FEFE4 +_080FEFD0: + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + eors r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] +_080FEFE4: + ldrh r0, [r4, 0x38] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _080FEFF6 +_080FEFF0: + adds r0, r4, 0 + bl move_anim_8072740 +_080FEFF6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEF98 + + thumb_func_start sub_80FEFFC +sub_80FEFFC: @ 80FEFFC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _080FF038 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, _080FF03C + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldr r0, _080FF040 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FF038: .4byte 0x02038436 +_080FF03C: .4byte 0x0203841e +_080FF040: .4byte sub_80FF044 + 1 + thumb_func_end sub_80FEFFC + + thumb_func_start sub_80FF044 +sub_80FF044: @ 80FF044 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x32] + movs r2, 0x32 + ldrsh r3, [r1, r2] + cmp r3, 0 + bne _080FF078 + ldrh r0, [r1, 0x30] + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080FF066 + movs r0, 0x80 + strh r0, [r1, 0x2E] + strh r3, [r1, 0x30] + strh r3, [r1, 0x32] + b _080FF06C +_080FF066: + strh r2, [r1, 0x2E] + strh r2, [r1, 0x30] + strh r2, [r1, 0x32] +_080FF06C: + ldr r0, _080FF074 + str r0, [r1, 0x1C] + b _080FF08C + .align 2, 0 +_080FF074: .4byte sub_80FF090 + 1 +_080FF078: + subs r0, 0x1 + strh r0, [r1, 0x32] + ldrh r0, [r1, 0x2E] + ldrh r2, [r1, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x30] + ldrh r2, [r1, 0x22] + adds r0, r2 + strh r0, [r1, 0x22] +_080FF08C: + pop {r0} + bx r0 + thumb_func_end sub_80FF044 + + thumb_func_start sub_80FF090 +sub_80FF090: @ 80FF090 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080FF0B0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FF0B4 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x19 + bl sine + negs r0, r0 + b _080FF0BE + .align 2, 0 +_080FF0B0: .4byte 0x02038436 +_080FF0B4: + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x19 + bl sine +_080FF0BE: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080FF0DE + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] +_080FF0DE: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x50 + ble _080FF0EC + adds r0, r4, 0 + bl move_anim_8072740 +_080FF0EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FF090 + + thumb_func_start sub_80FF0F4 +sub_80FF0F4: @ 80FF0F4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _080FF148 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FF114 + ldr r1, _080FF14C + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080FF114: + ldr r6, _080FF14C + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080FF154 + ldr r4, _080FF150 + 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] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + b _080FF174 + .align 2, 0 +_080FF148: .4byte 0x02038436 +_080FF14C: .4byte 0x0203841e +_080FF150: .4byte 0x02038437 +_080FF154: + ldr r0, _080FF1A0 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 + ldrh r0, [r6, 0x4] + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r6, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 +_080FF174: + strh r0, [r5, 0x36] + ldr r0, _080FF1A4 + ldrh r0, [r0, 0xA] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, _080FF1A8 + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, _080FF1A0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080FF1AC + movs r0, 0x1 + b _080FF1AE + .align 2, 0 +_080FF1A0: .4byte 0x02038437 +_080FF1A4: .4byte 0x0203841e +_080FF1A8: .4byte 0x02038436 +_080FF1AC: + movs r0, 0 +_080FF1AE: + strh r0, [r5, 0x2E] + ldr r0, _080FF1BC + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FF1BC: .4byte sub_80FF1C0 + 1 + thumb_func_end sub_80FF0F4 + + thumb_func_start sub_80FF1C0 +sub_80FF1C0: @ 80FF1C0 + push {r4-r7,lr} + adds r6, r0, 0 + movs r7, 0 + ldrh r5, [r6, 0x2E] + ldrh r4, [r6, 0x3C] + movs r0, 0x1 + strh r0, [r6, 0x2E] + adds r0, r6, 0 + bl sub_80A6900 + ldrh r0, [r6, 0x3C] + strh r5, [r6, 0x2E] + lsls r4, 16 + asrs r4, 16 + cmp r4, 0xC8 + ble _080FF1F2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x37 + bgt _080FF1F2 + ldrh r0, [r6, 0x6] + cmp r0, 0 + bne _080FF1F8 + adds r0, 0x1 + strh r0, [r6, 0x6] +_080FF1F2: + ldrh r0, [r6, 0x6] + cmp r0, 0 + beq _080FF22A +_080FF1F8: + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080FF22A + adds r3, r6, 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] + ldrh r0, [r6, 0x6] + adds r0, 0x1 + strh r0, [r6, 0x6] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bne _080FF22A + movs r7, 0x1 +_080FF22A: + movs r2, 0x20 + ldrsh r0, [r6, r2] + movs r2, 0x24 + ldrsh r1, [r6, r2] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _080FF254 + movs r0, 0x22 + ldrsh r1, [r6, r0] + movs r2, 0x26 + ldrsh r0, [r6, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _080FF254 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _080FF256 +_080FF254: + movs r7, 0x1 +_080FF256: + cmp r7, 0 + beq _080FF260 + adds r0, r6, 0 + bl move_anim_8072740 +_080FF260: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FF1C0 + + thumb_func_start sub_80FF268 +sub_80FF268: @ 80FF268 + push {r4,lr} + adds r4, r0, 0 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FF28A + ldr r0, _080FF2B0 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 +_080FF28A: + ldrh r0, [r4, 0x22] + adds r0, 0x20 + strh r0, [r4, 0x22] + ldr r1, _080FF2B4 + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x36] + ldr r0, _080FF2B8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FF2B0: .4byte 0x02038437 +_080FF2B4: .4byte 0x0203841e +_080FF2B8: .4byte sub_80FF2BC + 1 + thumb_func_end sub_80FF268 + + thumb_func_start sub_80FF2BC +sub_80FF2BC: @ 80FF2BC + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0xFF + bne _080FF2D2 + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + b _080FF2E0 +_080FF2D2: + cmp r0, 0 + ble _080FF2E0 + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + subs r0, r1, 0x2 + strh r0, [r4, 0x30] +_080FF2E0: + ldrh r3, [r4, 0x32] + ldrh r5, [r4, 0x38] + adds r2, r3, r5 + strh r2, [r4, 0x38] + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r5, 0x36 + ldrsh r0, [r4, r5] + cmp r1, r0 + bge _080FF2F8 + adds r0, r2, r3 + strh r0, [r4, 0x38] +_080FF2F8: + ldrh r1, [r4, 0x38] + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r5, 0x38 + ldrsh r0, [r4, r5] + movs r1, 0x5 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + bgt _080FF338 + ldr r0, _080FF334 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + b _080FF346 + .align 2, 0 +_080FF334: .4byte 0x02038437 +_080FF338: + ldr r0, _080FF370 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 +_080FF346: + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080FF36A + adds r0, r4, 0 + bl move_anim_8072740 +_080FF36A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FF370: .4byte 0x02038437 + thumb_func_end sub_80FF2BC + + thumb_func_start sub_80FF374 +sub_80FF374: @ 80FF374 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A6980 + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r4, _080FF3A8 + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8008258 + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x3A] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x3C] + ldr r0, _080FF3AC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FF3A8: .4byte 0x0203841e +_080FF3AC: .4byte sub_80FF3B0 + 1 + thumb_func_end sub_80FF374 + + thumb_func_start sub_80FF3B0 +sub_80FF3B0: @ 80FF3B0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _080FF3E0 + ldrh r1, [r0, 0xE] + ldr r0, _080FF3E4 + cmp r1, r0 + bne _080FF3DA + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x2E] + ldr r0, _080FF3E8 + str r0, [r4, 0x1C] +_080FF3DA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FF3E0: .4byte 0x0203841e +_080FF3E4: .4byte 0x0000ffff +_080FF3E8: .4byte sub_80FF3EC + 1 + thumb_func_end sub_80FF3B0 + + thumb_func_start sub_80FF3EC +sub_80FF3EC: @ 80FF3EC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FF404 + ldrh r0, [r4, 0x2E] + adds r0, 0xB + b _080FF408 +_080FF404: + ldrh r0, [r4, 0x2E] + subs r0, 0xB +_080FF408: + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _080FF424 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x32] +_080FF424: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080FF452 + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + cmp r0, 0 + ble _080FF44C + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8008258 + b _080FF452 +_080FF44C: + adds r0, r4, 0 + bl move_anim_8072740 +_080FF452: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FF3EC + + thumb_func_start sub_80FF458 +sub_80FF458: @ 80FF458 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _080FF494 + mov r10, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r2, r10 + adds r7, r0, r2 + adds r0, r7, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080FF498 + adds r0, r4, 0 + bl move_anim_task_del + b _080FF51C + .align 2, 0 +_080FF494: .4byte 0x02020630 +_080FF498: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80A7270 + ldr r0, _080FF52C + lsls r6, r4, 2 + adds r6, r4 + lsls r6, 3 + adds r6, r0 + ldrb r0, [r7, 0x5] + lsls r0, 28 + lsrs r0, 30 + strh r0, [r6, 0x24] + ldr r0, _080FF530 + mov r9, r0 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + mov r8, r1 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x5] + movs r5, 0xD + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + movs r0, 0x3 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + add r4, r10 + ldrb r0, [r4, 0x5] + lsls r0, 28 + lsrs r0, 30 + strh r0, [r6, 0x26] + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x2 + eors r0, r1 + bl sub_80A8328 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r0, [r4, 0x5] + ands r5, r0 + orrs r5, r1 + strb r5, [r4, 0x5] + ldr r1, _080FF534 + ldrh r0, [r1] + strh r0, [r6, 0x8] + ldrh r0, [r1, 0x2] + strh r0, [r6, 0xA] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r6, 0x1E] + ldr r0, _080FF538 + str r0, [r6] +_080FF51C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FF52C: .4byte 0x03005e00 +_080FF530: .4byte 0x02038437 +_080FF534: .4byte 0x0203841e +_080FF538: .4byte sub_80FF53C + 1 + thumb_func_end sub_80FF458 + + thumb_func_start sub_80FF53C +sub_80FF53C: @ 80FF53C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _080FF5BC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x8] + ldrh r0, [r4, 0x1C] + adds r1, r0 + strh r1, [r4, 0x1C] + ldr r2, _080FF5C0 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r5, r0, r2 + lsls r1, 16 + asrs r1, 24 + strh r1, [r5, 0x24] + ldr r0, _080FF5C4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FF586 + ldrh r0, [r5, 0x24] + negs r0, r0 + strh r0, [r5, 0x24] +_080FF586: + ldrh r0, [r4, 0x1E] + adds r0, 0x10 + strh r0, [r4, 0x1E] + movs r0, 0x1E + ldrsh r2, [r4, r0] + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r6, 0 + bl sub_80A7E6C + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _080FF5B4 + strh r0, [r4, 0x8] + ldr r0, _080FF5C8 + str r0, [r4] +_080FF5B4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FF5BC: .4byte 0x03005e00 +_080FF5C0: .4byte 0x02020630 +_080FF5C4: .4byte 0x02038437 +_080FF5C8: .4byte sub_80FF5CC + 1 + thumb_func_end sub_80FF53C + + thumb_func_start sub_80FF5CC +sub_80FF5CC: @ 80FF5CC + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _080FF650 + ldrh r1, [r0, 0xE] + ldr r0, _080FF654 + cmp r1, r0 + bne _080FF660 + ldr r0, _080FF658 + lsls r2, r3, 2 + adds r1, r2, r3 + lsls r1, 3 + adds r7, r1, r0 + movs r1, 0x8 + ldrsh r5, [r7, r1] + adds r4, r0, 0 + cmp r5, 0 + bne _080FF674 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80A7344 + ldr r6, _080FF65C + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r6 + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] + movs r5, 0x3 + ldrh r2, [r7, 0x24] + ands r2, r5 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x3 + 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, r6 + ldrh r0, [r7, 0x26] + ands r0, r5 + lsls r0, 2 + ldrb r2, [r1, 0x5] + ands r4, r2 + orrs r4, r0 + strb r4, [r1, 0x5] + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + b _080FF68E + .align 2, 0 +_080FF650: .4byte 0x0203841e +_080FF654: .4byte 0x0000ffff +_080FF658: .4byte 0x03005e00 +_080FF65C: .4byte 0x02020630 +_080FF660: + ldr r1, _080FF694 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + cmp r0, 0 + beq _080FF68E +_080FF674: + adds r1, r2, r3 + lsls r1, 3 + adds r1, r4 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080FF68E + adds r0, r3, 0 + bl move_anim_task_del +_080FF68E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080FF694: .4byte 0x03005e00 + thumb_func_end sub_80FF5CC + + thumb_func_start sub_80FF698 +sub_80FF698: @ 80FF698 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080FF6AA + cmp r0, 0x1 + beq _080FF704 + b _080FF756 +_080FF6AA: + ldr r6, _080FF6FC + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080FF6C2 + ldr r1, _080FF700 + movs r2, 0 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1] +_080FF6C2: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _080FF700 + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r5, 0x22] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _080FF756 + .align 2, 0 +_080FF6FC: .4byte 0x02038437 +_080FF700: .4byte 0x0203841e +_080FF704: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080FF756 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80082B8 + movs r0, 0x19 + strh r0, [r5, 0x2E] + ldr r4, _080FF75C + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, _080FF760 + str r0, [r5, 0x1C] + ldr r1, _080FF764 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_080FF756: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FF75C: .4byte 0x02038436 +_080FF760: .4byte sub_80A70C0 + 1 +_080FF764: .4byte move_anim_8072740 + 1 + thumb_func_end sub_80FF698 + + thumb_func_start sub_80FF768 +sub_80FF768: @ 80FF768 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080FF7D4 + ldr r4, _080FF7E0 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, _080FF7E4 + ldrh r0, [r4] + strh r0, [r5, 0x24] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x26] + ldrb r0, [r4, 0x4] + adds r0, 0x1E + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r4, 0x6] + adds r0, r5, 0 + bl obj_anim_image_start + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r2, 0x22 + ldrsh r0, [r5, r2] + movs r2, 0x26 + ldrsh r1, [r5, r2] + adds r0, r1 + cmp r0, 0x78 + ble _080FF7D4 + ldrh r0, [r5, 0x22] + adds r1, r0, 0 + subs r1, 0x78 + ldrh r2, [r5, 0x26] + adds r0, r2 + adds r1, r0 + strh r1, [r5, 0x22] +_080FF7D4: + ldr r0, _080FF7E8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FF7E0: .4byte 0x02038436 +_080FF7E4: .4byte 0x0203841e +_080FF7E8: .4byte sub_80FF8DC + 1 + thumb_func_end sub_80FF768 + + thumb_func_start sub_80FF7EC +sub_80FF7EC: @ 80FF7EC + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + mov r9, r0 + ldr r4, _080FF8C8 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, _080FF8CC + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + subs r4, r5 + lsls r4, 16 + lsrs r2, 24 + mov r1, r8 + subs r2, r1 + lsls r2, 16 + lsrs r2, 16 + lsrs r3, r4, 16 + mov r10, r3 + asrs r4, 16 + ldr r6, _080FF8D0 + movs r1, 0 + ldrsh r0, [r6, r1] + muls r0, r4 + movs r1, 0x64 + str r2, [sp] + bl __divsi3 + adds r5, r0 + mov r3, r9 + strh r5, [r3, 0x20] + ldr r2, [sp] + lsls r0, r2, 16 + asrs r0, 16 + movs r3, 0 + ldrsh r1, [r6, r3] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + add r8, r0 + mov r1, r8 + mov r0, r9 + strh r1, [r0, 0x22] + ldrh r0, [r6, 0x2] + mov r3, r9 + strh r0, [r3, 0x24] + ldrh r0, [r6, 0x4] + strh r0, [r3, 0x26] + ldrb r0, [r6, 0x6] + adds r0, 0x1E + mov r1, r9 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0x8] + mov r0, r9 + bl obj_anim_image_start + ldrh r0, [r6, 0xA] + mov r1, r9 + strh r0, [r1, 0x32] + ldr r0, _080FF8D4 + str r0, [r1, 0x1C] + ldr r1, _080FF8D8 + mov r3, r9 + ldrh r0, [r3, 0x20] + strh r0, [r1] + ldrh r0, [r3, 0x22] + strh r0, [r1, 0x2] + mov r0, r10 + strh r0, [r1, 0x4] + ldr r2, [sp] + strh r2, [r1, 0x6] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FF8C8: .4byte 0x02038436 +_080FF8CC: .4byte 0x02038437 +_080FF8D0: .4byte 0x0203841e +_080FF8D4: .4byte sub_80FF8DC + 1 +_080FF8D8: .4byte 0x0203a0f8 + thumb_func_end sub_80FF7EC + + thumb_func_start sub_80FF8DC +sub_80FF8DC: @ 80FF8DC + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x2E] + adds r1, 0x1 + strh r1, [r3, 0x2E] + lsls r1, 16 + asrs r1, 16 + movs r2, 0x32 + ldrsh r0, [r3, r2] + subs r0, 0xA + cmp r1, r0 + ble _080FF91C + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + movs r2, 0x3E + adds r2, r3 + mov r12, r2 + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] +_080FF91C: + movs r2, 0x2E + ldrsh r1, [r3, r2] + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r1, r0 + ble _080FF92E + adds r0, r3, 0 + bl move_anim_8072740 +_080FF92E: + pop {r0} + bx r0 + thumb_func_end sub_80FF8DC + + thumb_func_start sub_80FF934 +sub_80FF934: @ 80FF934 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080FF974 + ldr r5, _080FF9B0 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _080FF9B4 + lsrs r0, 24 + ldrh r2, [r4] + adds r0, r2 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x30] + ldrh r0, [r4, 0x6] + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x34] +_080FF974: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + ldrh r1, [r6, 0x30] + muls r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x2E + ldrsh r1, [r6, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r1, 0xFF + ands r0, r1 + movs r2, 0x32 + ldrsh r1, [r6, r2] + bl sine + strh r0, [r6, 0x26] + movs r0, 0x2E + ldrsh r1, [r6, r0] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _080FF9AA + adds r0, r6, 0 + bl move_anim_8072740 +_080FF9AA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FF9B0: .4byte 0x02038436 +_080FF9B4: .4byte 0x0203841e + thumb_func_end sub_80FF934 + + thumb_func_start sub_80FF9B8 +sub_80FF9B8: @ 80FF9B8 + push {r4,r5,lr} + movs r2, 0x20 + ldrsh r4, [r0, r2] + lsls r4, 8 + movs r3, 0x22 + ldrsh r2, [r0, r3] + orrs r4, r2 + movs r5, 0x3A + ldrsh r2, [r0, r5] + lsls r2, 8 + movs r5, 0x3C + ldrsh r3, [r0, r5] + orrs r2, r3 + lsls r1, 8 + strh r4, [r0, 0x38] + strh r2, [r0, 0x3A] + strh r1, [r0, 0x3C] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FF9B8 + + thumb_func_start sub_80FF9E0 +sub_80FF9E0: @ 80FF9E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + ldrh r0, [r0, 0x38] + lsrs r1, r0, 8 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r1, r8 + ldrh r0, [r1, 0x3A] + lsrs r2, r0, 8 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r1, [r1, 0x3C] + lsls r0, r1, 16 + asrs r0, 24 + lsls r0, 16 + lsrs r6, r0, 16 + movs r3, 0xFF + ands r3, r1 + cmp r2, 0 + bne _080FFA1A + movs r2, 0x20 + negs r2, r2 + b _080FFA22 +_080FFA1A: + cmp r2, 0xFF + bne _080FFA22 + movs r2, 0x88 + lsls r2, 1 +_080FFA22: + mov r0, r9 + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + mov r1, r10 + subs r0, r2, r1 + lsls r5, r3, 16 + asrs r5, 16 + muls r0, r5 + lsls r1, r6, 16 + asrs r7, r1, 16 + adds r1, r7, 0 + bl __divsi3 + adds r6, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + muls r0, r5 + adds r1, r7, 0 + bl __divsi3 + add r6, r10 + mov r1, r8 + strh r6, [r1, 0x20] + add r0, r9 + strh r0, [r1, 0x22] + adds r5, 0x1 + lsls r5, 16 + lsrs r3, r5, 16 + asrs r5, 16 + cmp r5, r7 + beq _080FFA74 + lsls r1, r7, 8 + lsls r0, r3, 16 + asrs r0, 16 + orrs r0, r1 + mov r1, r8 + strh r0, [r1, 0x3C] + movs r0, 0 + b _080FFA76 +_080FFA74: + movs r0, 0x1 +_080FFA76: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80FF9E0 + + thumb_func_start sub_80FFA84 +sub_80FFA84: @ 80FFA84 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _080FFA98 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_080FFA98: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + ble _080FFAAC + adds r0, r4, 0 + bl move_anim_8072740 +_080FFAAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FFA84 + + thumb_func_start sub_80FFAB4 +sub_80FFAB4: @ 80FFAB4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x2E] + adds r1, r0 + movs r5, 0 + strh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _080FFADE + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + strh r5, [r4, 0x2E] +_080FFADE: + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + ldrsh r2, [r4, r1] + lsls r2, 3 + movs r1, 0x1E + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x26] + adds r0, r4, 0 + bl sub_80FF9E0 + lsls r0, 24 + cmp r0, 0 + beq _080FFB0E + strh r5, [r4, 0x26] + strh r5, [r4, 0x2E] + ldr r0, _080FFB14 + str r0, [r4, 0x1C] +_080FFB0E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FFB14: .4byte sub_80FFA84 + 1 + thumb_func_end sub_80FFAB4 + + thumb_func_start sub_80FFB18 +sub_80FFB18: @ 80FFB18 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r4, _080FFB60 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080FFB64 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + ldrb r4, [r4] + cmp r0, r4 + bne _080FFB68 + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x1 + b _080FFB7A + .align 2, 0 +_080FFB60: .4byte 0x02038437 +_080FFB64: .4byte 0x02038436 +_080FFB68: + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x3 +_080FFB7A: + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, _080FFB8C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FFB8C: .4byte sub_80FFAB4 + 1 + thumb_func_end sub_80FFB18 + + thumb_func_start sub_80FFB90 +sub_80FFB90: @ 80FFB90 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x2E] + adds r1, r0 + movs r5, 0 + strh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _080FFBBA + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + strh r5, [r4, 0x2E] +_080FFBBA: + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + ldrsh r2, [r4, r1] + lsls r2, 3 + movs r1, 0x1E + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x26] + adds r0, r4, 0 + bl sub_80FF9E0 + lsls r0, 24 + cmp r0, 0 + beq _080FFBEC + strh r5, [r4, 0x26] + strh r5, [r4, 0x2E] + adds r0, r4, 0 + bl move_anim_8072740 +_080FFBEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FFB90 + + thumb_func_start sub_80FFBF4 +sub_80FFBF4: @ 80FFBF4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _080FFC30 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080FFC38 + strh r0, [r5, 0x3A] + adds r0, r6, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x28 + bl sub_80FF9B8 + movs r0, 0x3 + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, _080FFC34 + b _080FFC62 + .align 2, 0 +_080FFC30: .4byte 0x02038437 +_080FFC34: .4byte sub_80FFAB4 + 1 +_080FFC38: + movs r0, 0xFF + strh r0, [r5, 0x3A] + adds r0, r6, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080FFC50 + movs r0, 0 + strh r0, [r5, 0x3A] +_080FFC50: + adds r0, r5, 0 + movs r1, 0x28 + bl sub_80FF9B8 + movs r0, 0x3 + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, _080FFC6C +_080FFC62: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FFC6C: .4byte sub_80FFB90 + 1 + thumb_func_end sub_80FFBF4 + + thumb_func_start sub_80FFC70 +sub_80FFC70: @ 80FFC70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FFC8A + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 + ldr r0, _080FFCB0 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x30] +_080FFC8A: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + muls r0, r1 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080FFCAA + adds r0, r4, 0 + bl move_anim_8072740 +_080FFCAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080FFCB0: .4byte 0x0203841e + thumb_func_end sub_80FFC70 + + thumb_func_start sub_80FFCB4 +sub_80FFCB4: @ 80FFCB4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A6980 + ldr r4, _080FFCFC + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _080FFD00 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + ldrb r4, [r4] + cmp r0, r4 + bne _080FFD04 + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x1 + b _080FFD16 + .align 2, 0 +_080FFCFC: .4byte 0x02038436 +_080FFD00: .4byte 0x02038437 +_080FFD04: + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x3 +_080FFD16: + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, _080FFD28 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080FFD28: .4byte sub_80FFD2C + 1 + thumb_func_end sub_80FFCB4 + + thumb_func_start sub_80FFD2C +sub_80FFD2C: @ 80FFD2C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x2E] + adds r1, r0 + movs r5, 0 + strh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _080FFD56 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + strh r5, [r4, 0x2E] +_080FFD56: + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + ldrsh r2, [r4, r1] + lsls r2, 3 + movs r1, 0x1E + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + bne _080FFD8A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff +_080FFD8A: + adds r0, r4, 0 + bl sub_80FF9E0 + lsls r0, 24 + cmp r0, 0 + beq _080FFDB2 + strh r5, [r4, 0x26] + strh r5, [r4, 0x2E] + ldr r0, _080FFDB8 + str r0, [r4, 0x1C] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff +_080FFDB2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FFDB8: .4byte sub_80FFA84 + 1 + thumb_func_end sub_80FFD2C + + thumb_func_start sub_80FFDBC +sub_80FFDBC: @ 80FFDBC + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FFE50 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080FFDE4 + ldr r0, _080FFDE0 + ldrh r1, [r0, 0x2] + strh r1, [r4, 0x30] + movs r1, 0x78 + strh r1, [r4, 0x20] + adds r5, r0, 0 + b _080FFE06 + .align 2, 0 +_080FFDE0: .4byte 0x0203841e +_080FFDE4: + ldr r0, _080FFE40 + movs r1, 0x2 + ldrsh r3, [r0, r1] + adds r1, r3, 0 + subs r1, 0x20 + adds r2, r1, 0 + adds r5, r0, 0 + cmp r1, 0 + bge _080FFDFA + adds r2, r3, 0 + adds r2, 0xDF +_080FFDFA: + asrs r0, r2, 8 + lsls r0, 8 + subs r0, r1, r0 + strh r0, [r4, 0x30] + movs r0, 0x46 + strh r0, [r4, 0x20] +_080FFE06: + ldrh r0, [r5] + strh r0, [r4, 0x22] + strh r0, [r4, 0x32] + movs r0, 0x14 + strh r0, [r4, 0x36] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x3C + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + ldr r0, _080FFE44 + str r0, [r4, 0x1C] + ldrh r0, [r4, 0x30] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBE + bhi _080FFE48 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F + b _080FFE4E + .align 2, 0 +_080FFE40: .4byte 0x0203841e +_080FFE44: .4byte sub_80FFE58 + 1 +_080FFE48: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D +_080FFE4E: + strb r0, [r1] +_080FFE50: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FFDBC + + thumb_func_start sub_80FFE58 +sub_80FFE58: @ 80FFE58 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FFE6A + cmp r0, 0x1 + beq _080FFE9A + b _080FFEBA +_080FFE6A: + ldrh r5, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x4E + ble _080FFE82 + movs r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + b _080FFEBA +_080FFE82: + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + adds r0, r5, r0 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x36] + adds r1, 0x3 + strh r1, [r4, 0x36] + strh r0, [r4, 0x22] + b _080FFEBA +_080FFE9A: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FFEBA + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080FFEBA + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x32] + ldr r0, _080FFEC0 + str r0, [r4, 0x1C] +_080FFEBA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080FFEC0: .4byte sub_80FFEC4 + 1 + thumb_func_end sub_80FFE58 + + thumb_func_start sub_80FFEC4 +sub_80FFEC4: @ 80FFEC4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, _080FFF08 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r3, r0, r1 + adds r0, r5, 0x1 + adds r0, r3, r0 + ldrh r2, [r4, 0x32] + movs r6, 0x32 + ldrsh r1, [r4, r6] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + bne _080FFF10 + adds r0, r5, 0x2 + adds r0, r3, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x7F + bne _080FFEFC + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _080FFF0C + str r0, [r4, 0x1C] +_080FFEFC: + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _080FFF76 + .align 2, 0 +_080FFF08: .4byte 0x08592700 +_080FFF0C: .4byte sub_80FFF7C + 1 +_080FFF10: + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r0, r5 + movs r2, 0 + ldrsb r2, [r1, r2] + adds r1, r5, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r0, r2 + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080FFF5E + ldrh r0, [r4, 0x30] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBE + bhi _080FFF56 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F + b _080FFF5C +_080FFF56: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D +_080FFF5C: + strb r0, [r1] +_080FFF5E: + movs r6, 0x30 + ldrsh r0, [r4, r6] + movs r1, 0x3C + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] +_080FFF76: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80FFEC4 + + thumb_func_start sub_80FFF7C +sub_80FFF7C: @ 80FFF7C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x14 + ble _080FFF8E + adds r0, r4, 0 + bl move_anim_8072740 +_080FFF8E: + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FFF7C + + thumb_func_start sub_80FFFC0 +sub_80FFFC0: @ 80FFFC0 + 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, _08100114 + adds r5, r0, r1 + ldr r4, _08100118 + ldrb r0, [r4] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + strh r0, [r5, 0x10] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x16] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A861C + strh r0, [r5, 0x1C] + ldrb r0, [r4] + movs r1, 0 + bl sub_80A861C + strh r0, [r5, 0x1E] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0x1 + bne _08100028 + movs r1, 0x1 +_08100028: + strh r1, [r5, 0x12] + movs r3, 0x12 + ldrsh r0, [r5, r3] + lsls r0, 6 + movs r1, 0x38 + subs r1, r0 + strh r1, [r5, 0x1A] + ldrh r0, [r5, 0x16] + subs r0, r1 + ldrh r1, [r5, 0x14] + adds r0, r1 + strh r0, [r5, 0x18] + ldr r0, _0810011C + movs r2, 0x18 + ldrsh r1, [r5, r2] + movs r3, 0x1A + ldrsh r2, [r5, r3] + ldrb r3, [r5, 0x10] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xC] + cmp r0, 0x40 + bne _08100060 + adds r0, r6, 0 + bl move_anim_task_del +_08100060: + ldr r4, _08100120 + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xA + strh r1, [r0, 0x2E] + movs r2, 0xC + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x18] + strh r1, [r0, 0x30] + movs r3, 0xC + ldrsh r0, [r5, r3] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + movs r1, 0x1C + ldrsh r0, [r5, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r5, r3] + muls r1, r0 + ldrh r0, [r5, 0x14] + subs r0, r1 + strh r0, [r2, 0x32] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x1A] + strh r1, [r0, 0x34] + movs r1, 0xC + ldrsh r0, [r5, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r2, 0x1E + ldrsh r0, [r5, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r2, [r5, r3] + muls r0, r2 + ldrh r2, [r5, 0x16] + adds r0, r2 + strh r0, [r1, 0x36] + movs r3, 0xC + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_8100504 + movs r1, 0xC + ldrsh r2, [r5, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x38] + movs r2, 0xC + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_80A68D4 + ldr r0, _08100124 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08100114: .4byte 0x03005e00 +_08100118: .4byte 0x02038437 +_0810011C: .4byte 0x08592778 +_08100120: .4byte 0x02020630 +_08100124: .4byte sub_8100128 + 1 + thumb_func_end sub_80FFFC0 + + thumb_func_start sub_8100128 +sub_8100128: @ 8100128 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810016C + adds r6, r0, r1 + movs r0, 0xC + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08100170 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r5, [r6, r1] + cmp r5, 0x7 + bne _08100150 + b _08100380 +_08100150: + cmp r5, 0x7 + bgt _0810019E + cmp r5, 0x3 + bne _0810015A + b _08100272 +_0810015A: + cmp r5, 0x3 + bgt _08100174 + cmp r5, 0x1 + beq _08100204 + cmp r5, 0x1 + bgt _08100254 + cmp r5, 0 + beq _081001E6 + b _081004FC + .align 2, 0 +_0810016C: .4byte 0x03005e00 +_08100170: .4byte 0x02020630 +_08100174: + cmp r5, 0x5 + bne _0810017A + b _081002E8 +_0810017A: + cmp r5, 0x5 + ble _08100180 + b _08100362 +_08100180: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _08100196 + b _081004FC +_08100196: + movs r0, 0x5 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_0810019E: + cmp r5, 0xB + bne _081001A4 + b _08100464 +_081001A4: + cmp r5, 0xB + bgt _081001D2 + cmp r5, 0x9 + bne _081001AE + b _081003D2 +_081001AE: + cmp r5, 0x9 + ble _081001B4 + b _08100448 +_081001B4: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _081001CA + b _081004FC +_081001CA: + movs r0, 0x9 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_081001D2: + cmp r5, 0xD + bne _081001D8 + b _081004D6 +_081001D8: + cmp r5, 0xD + bge _081001DE + b _081004B6 +_081001DE: + cmp r5, 0xFF + bne _081001E4 + b _081004E6 +_081001E4: + b _081004FC +_081001E6: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _081001FC + b _081004FC +_081001FC: + movs r0, 0x1 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100204: + ldrh r2, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r2, r3 + movs r0, 0 + strh r2, [r4, 0x20] + ldrh r1, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrh r0, [r6, 0x14] + strh r0, [r4, 0x32] + strh r1, [r4, 0x34] + ldrh r0, [r6, 0x16] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r0, [r6, 0x10] + adds r0, 0x2 + strh r0, [r6, 0x10] + strh r5, [r6, 0xE] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_08100254: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _0810026A + b _081004FC +_0810026A: + movs r0, 0x3 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100272: + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + movs r0, 0 + strh r1, [r4, 0x20] + ldrh r2, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r2, r3 + strh r2, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r1, r0 + ldrh r0, [r6, 0x14] + subs r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + movs r1, 0x1E + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r2, 0x12 + ldrsh r1, [r6, r2] + muls r1, r0 + ldrh r0, [r6, 0x16] + subs r0, r1 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + movs r0, 0x2 + strh r0, [r6, 0xE] + ldrh r0, [r6, 0x10] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081002E8: + ldrh r1, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r1, r3 + movs r0, 0 + strh r1, [r4, 0x20] + ldrh r2, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r2, r3 + strh r2, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r0, r1 + ldrh r1, [r6, 0x14] + adds r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + movs r2, 0x1E + ldrsh r0, [r6, r2] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r0, r1 + ldrh r1, [r6, 0x16] + adds r0, r1 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r1, [r6, 0x10] + subs r1, 0x2 + strh r1, [r6, 0x10] + movs r0, 0x3 + strh r0, [r6, 0xE] + adds r0, r4, 0 + adds r0, 0x43 + strb r1, [r0] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_08100362: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _08100378 + b _081004FC +_08100378: + movs r0, 0x7 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100380: + ldrh r2, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r2, r3 + movs r0, 0 + strh r2, [r4, 0x20] + ldrh r1, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrh r0, [r6, 0x14] + strh r0, [r4, 0x32] + strh r1, [r4, 0x34] + ldrh r0, [r6, 0x16] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r1, [r6, 0x10] + adds r1, 0x2 + strh r1, [r6, 0x10] + movs r0, 0x4 + strh r0, [r6, 0xE] + adds r0, r4, 0 + adds r0, 0x43 + strb r1, [r0] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081003D2: + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + movs r0, 0 + strh r1, [r4, 0x20] + ldrh r2, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r2, r3 + strh r2, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r1, r0 + ldrh r0, [r6, 0x14] + subs r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + movs r1, 0x1E + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r2, 0x12 + ldrsh r1, [r6, r2] + muls r0, r1 + ldrh r3, [r6, 0x16] + adds r0, r3 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + movs r0, 0x5 + strh r0, [r6, 0xE] + ldrh r0, [r6, 0x10] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_08100448: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081004FC + movs r0, 0xB + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100464: + ldrh r2, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r2, r0 + movs r0, 0 + strh r2, [r4, 0x20] + ldrh r1, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrh r0, [r6, 0x18] + strh r0, [r4, 0x32] + strh r1, [r4, 0x34] + ldrh r0, [r6, 0x1A] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r1, [r6, 0x10] + subs r1, 0x2 + strh r1, [r6, 0x10] + movs r0, 0x6 + strh r0, [r6, 0xE] + adds r0, r4, 0 + adds r0, 0x43 + strb r1, [r0] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081004B6: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081004FC + adds r0, r4, 0 + bl obj_delete_and_free_tiles + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081004D6: + movs r1, 0x20 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081004FC + adds r0, r2, 0 + bl move_anim_task_del + b _081004FC +_081004E6: + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _081004FC + movs r0, 0 + strh r0, [r6, 0xA] + ldrh r0, [r6, 0x26] +_081004FA: + strh r0, [r6, 0x8] +_081004FC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8100128 + + thumb_func_start sub_8100504 +sub_8100504: @ 8100504 + push {lr} + movs r2, 0x8 + movs r3, 0x36 + ldrsh r1, [r0, r3] + movs r3, 0x22 + ldrsh r0, [r0, r3] + cmp r1, r0 + bge _0810051A + negs r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 +_0810051A: + lsls r0, r2, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8100504 + + thumb_func_start sub_8100524 +sub_8100524: @ 8100524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _081005BA + movs r0, 0 + strh r0, [r6, 0x24] + ldr r0, _081005C4 + mov r8, r0 + movs r2, 0xC + ldrsh r1, [r6, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + ldrh r2, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r2, r0 + ldr r0, _081005C8 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + ldrb r3, [r6, 0x10] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081005BA + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + mov r0, r8 + adds r4, r5, r0 + strh r7, [r4, 0x3A] + movs r0, 0xC + strh r0, [r4, 0x3C] + ldr r0, _081005CC + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + ldrh r2, [r6, 0x22] + movs r0, 0x1 + ands r0, r2 + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x22] + adds r0, 0x1 + strh r0, [r1, 0x22] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl obj_anim_image_start + ldrh r0, [r6, 0x10] + adds r4, 0x43 + strb r0, [r4] + mov r0, r8 + adds r0, 0x1C + adds r5, r0 + ldr r0, _081005D0 + str r0, [r5] +_081005BA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081005C4: .4byte 0x02020630 +_081005C8: .4byte 0x08592778 +_081005CC: .4byte 0x03005e00 +_081005D0: .4byte sub_81005D4 + 1 + thumb_func_end sub_8100524 + + thumb_func_start sub_81005D4 +sub_81005D4: @ 81005D4 + 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, 0x1 + ble _08100636 + movs r0, 0 + strh r0, [r4, 0x2E] + 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] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _08100636 + ldr r3, _0810063C + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08100636: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810063C: .4byte 0x03005e00 + thumb_func_end sub_81005D4 + + thumb_func_start sub_8100640 +sub_8100640: @ 8100640 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, _08100654 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810065C + ldr r0, _08100658 + b _0810065E + .align 2, 0 +_08100654: .4byte 0x0203841e +_08100658: .4byte 0x02038436 +_0810065C: + ldr r0, _0810067C +_0810065E: + ldrb r6, [r0] + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100688 + movs r0, 0 + strh r0, [r4, 0x36] + ldr r1, _08100680 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x32] + ldr r0, _08100684 + b _08100698 + .align 2, 0 +_0810067C: .4byte 0x02038437 +_08100680: .4byte 0x0203841e +_08100684: .4byte 0x0000fff0 +_08100688: + movs r0, 0x1 + strh r0, [r4, 0x36] + ldr r1, _081006BC + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r4, 0x32] + movs r0, 0x80 + lsls r0, 1 +_08100698: + strh r0, [r4, 0x20] + adds r7, r1, 0 + adds r5, r7, 0 + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x34] + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081006CE + cmp r0, 0x1 + bgt _081006C0 + cmp r0, 0 + beq _081006CA + b _08100738 + .align 2, 0 +_081006BC: .4byte 0x0203841e +_081006C0: + cmp r0, 0x2 + beq _081006D4 + cmp r0, 0x3 + beq _08100700 + b _08100738 +_081006CA: + ldrh r0, [r5] + b _081006E4 +_081006CE: + ldrh r0, [r5] + strh r0, [r4, 0x22] + b _0810071A +_081006D4: + adds r0, r6, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5] + adds r0, r5 +_081006E4: + strh r0, [r4, 0x22] + adds r0, r6, 0 + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + b _08100738 +_08100700: + ldr r0, _08100744 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r7, [r7] + adds r0, r7 + strh r0, [r4, 0x22] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move +_0810071A: + adds r0, r6, 0 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] +_08100738: + ldr r0, _08100748 + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08100744: .4byte 0x02038437 +_08100748: .4byte sub_810074C + 1 + thumb_func_end sub_8100640 + + thumb_func_start sub_810074C +sub_810074C: @ 810074C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r3, [r4, r0] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x30 + ldrsh r2, [r4, r1] + ldr r1, _081007A0 + movs r5, 0x2E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r2 + asrs r0, 8 + strh r0, [r4, 0x26] + movs r2, 0x32 + ldrsh r0, [r4, r2] + muls r0, r3 + strh r0, [r4, 0x24] + movs r5, 0x34 + ldrsh r0, [r4, r5] + muls r0, r3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081007A4 + movs r2, 0x24 + ldrsh r0, [r4, r2] + movs r5, 0x20 + ldrsh r1, [r4, r5] + adds r0, r1 + cmp r0, 0xF7 + ble _081007BC + b _081007B6 + .align 2, 0 +_081007A0: .4byte 0x08329f40 +_081007A4: + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _081007BC +_081007B6: + adds r0, r4, 0 + bl move_anim_8074EE0 +_081007BC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810074C + + thumb_func_start sub_81007C4 +sub_81007C4: @ 81007C4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081007E4 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081007E8 + cmp r0, 0x1 + beq _0810081C + b _08100876 + .align 2, 0 +_081007E4: .4byte 0x03005e00 +_081007E8: + ldr r0, _08100814 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + movs r2, 0x80 + lsls r2, 1 + adds r4, r2, 0 + adds r0, r4 + strh r0, [r5, 0x18] + ldr r0, _08100818 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + adds r0, r4 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _08100876 + .align 2, 0 +_08100814: .4byte 0x0000274f +_08100818: .4byte 0x000027b0 +_0810081C: + ldrh r0, [r5, 0x1A] + adds r0, 0x1 + movs r7, 0 + strh r0, [r5, 0x1A] + lsls r0, 16 + cmp r0, 0 + blt _08100876 + strh r7, [r5, 0x1A] + ldrh r0, [r5, 0x18] + ldrb r2, [r5, 0x1C] + ldr r4, _08100890 + movs r3, 0x1E + ldrsh r1, [r5, r3] + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r5, 0x20] + ldrb r2, [r5, 0x1C] + movs r3, 0x1E + ldrsh r1, [r5, r3] + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + bne _08100876 + strh r7, [r5, 0x1C] + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bne _08100876 + strh r7, [r5, 0x1E] +_08100876: + ldr r0, _08100894 + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0810088A + adds r0, r6, 0 + bl move_anim_task_del +_0810088A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08100890: .4byte 0x08592878 +_08100894: .4byte 0x0203841e + thumb_func_end sub_81007C4 + + thumb_func_start sub_8100898 +sub_8100898: @ 8100898 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r1, _081008B0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081008B4 + adds r0, r6, 0 + bl move_anim_8072740 + b _0810098E + .align 2, 0 +_081008B0: .4byte 0x0203841e +_081008B4: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081008C4 + ldr r4, _081008C0 + b _081008C6 + .align 2, 0 +_081008C0: .4byte 0x02038436 +_081008C4: + ldr r4, _08100900 +_081008C6: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08100904 + ldrh r1, [r0, 0x8] + strh r1, [r6, 0x2E] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r7, r0, 0 + cmp r1, 0 + bne _08100908 + ldrh r0, [r7, 0x4] + adds r0, r5 + strh r0, [r6, 0x20] + ldrh r0, [r7, 0x6] + adds r0, r2 + strh r0, [r6, 0x22] + strh r5, [r6, 0x38] + strh r2, [r6, 0x3A] + b _08100918 + .align 2, 0 +_08100900: .4byte 0x02038437 +_08100904: .4byte 0x0203841e +_08100908: + strh r5, [r6, 0x20] + strh r2, [r6, 0x22] + ldrh r0, [r7, 0x4] + adds r0, r5 + strh r0, [r6, 0x38] + ldrh r0, [r7, 0x6] + adds r0, r2 + strh r0, [r6, 0x3A] +_08100918: + ldrh r4, [r6, 0x20] + lsls r0, r4, 4 + strh r0, [r6, 0x30] + ldrh r5, [r6, 0x22] + lsls r0, r5, 4 + strh r0, [r6, 0x32] + movs r1, 0x38 + ldrsh r0, [r6, r1] + movs r2, 0x20 + ldrsh r1, [r6, r2] + subs r0, r1 + lsls r0, 4 + movs r3, 0x8 + ldrsh r1, [r7, r3] + bl __divsi3 + strh r0, [r6, 0x34] + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r2, 0x22 + ldrsh r1, [r6, r2] + subs r0, r1 + lsls r0, 4 + movs r3, 0x8 + ldrsh r1, [r7, r3] + bl __divsi3 + strh r0, [r6, 0x36] + ldrh r0, [r6, 0x38] + subs r0, r4 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r6, 0x3A] + subs r1, r5 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810097A + ldr r1, _08100998 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0810097A: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, _0810099C + str r0, [r6, 0x1C] +_0810098E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08100998: .4byte 0xffff8000 +_0810099C: .4byte sub_81009A0 + 1 + thumb_func_end sub_8100898 + + thumb_func_start sub_81009A0 +sub_81009A0: @ 81009A0 + push {r4,lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x2E] + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _081009D0 + ldrh r0, [r2, 0x34] + ldrh r4, [r2, 0x30] + adds r0, r4 + strh r0, [r2, 0x30] + ldrh r1, [r2, 0x36] + ldrh r4, [r2, 0x32] + adds r1, r4 + strh r1, [r2, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r2, 0x22] + subs r0, r3, 0x1 + strh r0, [r2, 0x2E] + b _081009D6 +_081009D0: + adds r0, r2, 0 + bl move_anim_8074EE0 +_081009D6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81009A0 + + thumb_func_start sub_81009DC +sub_81009DC: @ 81009DC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081009F2 + adds r0, r2, 0 + bl move_anim_8072740 +_081009F2: + pop {r0} + bx r0 + thumb_func_end sub_81009DC + + thumb_func_start sub_81009F8 +sub_81009F8: @ 81009F8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08100A18 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100A20 + ldr r2, _08100A1C + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + b _08100A2C + .align 2, 0 +_08100A18: .4byte 0x02038436 +_08100A1C: .4byte 0x0203841e +_08100A20: + ldr r0, _08100A44 + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] +_08100A2C: + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, _08100A48 + str r0, [r4, 0x1C] + ldr r1, _08100A4C + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08100A44: .4byte 0x0203841e +_08100A48: .4byte sub_80A67D8 + 1 +_08100A4C: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81009F8 + + thumb_func_start sub_8100A50 +sub_8100A50: @ 8100A50 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _08100A88 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08100A6A + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start +_08100A6A: + ldr r0, _08100A8C + str r0, [r5, 0x1C] + ldr r4, _08100A90 + 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 + .align 2, 0 +_08100A88: .4byte 0x02038436 +_08100A8C: .4byte sub_81009DC + 1 +_08100A90: .4byte 0x0203841e + thumb_func_end sub_8100A50 + + thumb_func_start sub_8100A94 +sub_8100A94: @ 8100A94 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08100AD4 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + 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 sub_8008258 + ldr r1, _08100AD8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08100ADC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08100AD4: .4byte 0x0203841e +_08100AD8: .4byte move_anim_8074EE0 + 1 +_08100ADC: .4byte sub_80A66DC + 1 + thumb_func_end sub_8100A94 + + thumb_func_start sub_8100AE0 +sub_8100AE0: @ 8100AE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08100B30 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + 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 _08100B14 + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r5, 0x22] +_08100B14: + ldr r0, _08100B34 + str r0, [r5, 0x1C] + ldr r0, _08100B38 + movs r2, 0x4 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + cmp r1, 0 + bne _08100B3C + ldrh r0, [r3] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + b _08100B50 + .align 2, 0 +_08100B30: .4byte 0x02038437 +_08100B34: .4byte sub_8100CCC + 1 +_08100B38: .4byte 0x0203841e +_08100B3C: + ldrh r0, [r5, 0x20] + ldrh r1, [r3] + subs r0, r1 + strh r0, [r5, 0x20] + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08100B50: + ldrh r0, [r3, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldr r1, _08100B84 + adds r0, r1, 0 + ldrh r2, [r5, 0x30] + adds r1, r0, r2 + strh r1, [r5, 0x30] + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] + ldrh r0, [r3, 0x4] + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08100B7E + negs r0, r1 + strh r0, [r5, 0x30] +_08100B7E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08100B84: .4byte 0xfffffc00 + thumb_func_end sub_8100AE0 + + thumb_func_start sub_8100B88 +sub_8100B88: @ 8100B88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, _08100BA4 + movs r1, 0x6 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _08100BA8 + cmp r0, 0x1 + ble _08100C24 + cmp r0, 0x2 + beq _08100BC8 + b _08100C24 + .align 2, 0 +_08100BA4: .4byte 0x0203841e +_08100BA8: + ldr r5, _08100BC4 + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r5] + eors r4, r0 + adds r0, r4, 0 + b _08100C34 + .align 2, 0 +_08100BC4: .4byte 0x02038437 +_08100BC8: + ldr r5, _08100C20 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5] + movs r2, 0x2 + mov r8, r2 + mov r1, r8 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08100C3E + ldrb r0, [r5] + mov r2, r8 + eors r0, r2 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r7 + lsrs r7, r0, 1 + ldrb r0, [r5] + mov r1, r8 + eors r0, r1 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + lsrs r4, r0, 1 + b _08100C3E + .align 2, 0 +_08100C20: .4byte 0x02038437 +_08100C24: + ldr r4, _08100C70 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4] +_08100C34: + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r4, r0, 24 +_08100C3E: + strh r7, [r6, 0x20] + strh r4, [r6, 0x22] + ldr r0, _08100C70 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08100C56 + ldrh r0, [r6, 0x22] + adds r0, 0x8 + strh r0, [r6, 0x22] +_08100C56: + ldr r0, _08100C74 + str r0, [r6, 0x1C] + ldr r0, _08100C78 + movs r2, 0x4 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + cmp r1, 0 + bne _08100C7C + ldrh r0, [r3] + ldrh r1, [r6, 0x20] + adds r0, r1 + strh r0, [r6, 0x20] + b _08100C90 + .align 2, 0 +_08100C70: .4byte 0x02038437 +_08100C74: .4byte sub_8100CCC + 1 +_08100C78: .4byte 0x0203841e +_08100C7C: + ldrh r0, [r6, 0x20] + ldrh r1, [r3] + subs r0, r1 + strh r0, [r6, 0x20] + adds r2, r6, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08100C90: + ldrh r0, [r3, 0x2] + ldrh r2, [r6, 0x22] + adds r0, r2 + strh r0, [r6, 0x22] + ldr r1, _08100CC8 + adds r0, r1, 0 + ldrh r2, [r6, 0x30] + adds r1, r0, r2 + strh r1, [r6, 0x30] + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + ldrh r2, [r6, 0x32] + adds r0, r2 + strh r0, [r6, 0x32] + ldrh r0, [r3, 0x4] + strh r0, [r6, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08100CBE + negs r0, r1 + strh r0, [r6, 0x30] +_08100CBE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08100CC8: .4byte 0xfffffc00 + thumb_func_end sub_8100B88 + + thumb_func_start sub_8100CCC +sub_8100CCC: @ 8100CCC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x34] + adds r0, r1, r2 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08100CEE + adds r0, r1, 0 + adds r0, 0x18 + b _08100CF2 +_08100CEE: + adds r0, r1, 0 + subs r0, 0x18 +_08100CF2: + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + subs r0, 0x18 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _08100D28 + ldr r1, _08100D30 + adds r0, r4, 0 + bl oamt_set_x3A_32 + movs r0, 0x3 + strh r0, [r4, 0x2E] + ldr r0, _08100D34 + str r0, [r4, 0x1C] +_08100D28: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08100D30: .4byte move_anim_8072740 + 1 +_08100D34: .4byte sub_80A64B0 + 1 + thumb_func_end sub_8100CCC + + thumb_func_start sub_8100D38 +sub_8100D38: @ 8100D38 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0x1 + ble _08100DDC + ldrh r1, [r5, 0x34] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08100D94 + adds r3, r5, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + strb r0, [r3] + ldr r4, _08100D90 + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r3, [r0] + adds r1, r2, 0 + ands r1, r3 + strb r1, [r0] + movs r0, 0x30 + ldrsh r1, [r5, 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] + b _08100DCA + .align 2, 0 +_08100D90: .4byte 0x02020630 +_08100D94: + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r3, _08100DD8 + movs r0, 0x2E + 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, 0x30 + 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] +_08100DCA: + movs r0, 0 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + b _08100DE0 + .align 2, 0 +_08100DD8: .4byte 0x02020630 +_08100DDC: + adds r0, r1, 0x1 + strh r0, [r5, 0x32] +_08100DE0: + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0xA + bne _08100E10 + movs r2, 0x2E + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08100E18 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r0, 0x30 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl move_anim_8072740 +_08100E10: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08100E18: .4byte 0x02020630 + thumb_func_end sub_8100D38 + + thumb_func_start sub_8100E1C +sub_8100E1C: @ 8100E1C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08100E3C + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x2E] + ldr r0, _08100E40 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100E44 + ldrh r0, [r5, 0x20] + ldrh r1, [r4] + subs r0, r1 + b _08100E4A + .align 2, 0 +_08100E3C: .4byte 0x0203841e +_08100E40: .4byte 0x02038436 +_08100E44: + ldrh r0, [r4] + ldrh r1, [r5, 0x20] + adds r0, r1 +_08100E4A: + strh r0, [r5, 0x20] + ldr r4, _08100E78 + ldrb r1, [r4, 0xA] + adds r0, r5, 0 + bl obj_anim_image_start + ldrh r0, [r4, 0x6] + negs r0, r0 + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x34] + ldr r1, _08100E7C + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08100E78: .4byte 0x0203841e +_08100E7C: .4byte sub_8100E80 + 1 + thumb_func_end sub_8100E1C + + thumb_func_start sub_8100E80 +sub_8100E80: @ 8100E80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x64 + bl cosine + strh r0, [r4, 0x24] + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x7F + bgt _08100EAC + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0 + b _08100EB2 +_08100EAC: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0xE +_08100EB2: + strb r0, [r1] + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x2E] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x82 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x34 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08100EE8 + adds r0, r4, 0 + bl move_anim_8072740 +_08100EE8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8100E80 + + thumb_func_start sub_8100EF0 +sub_8100EF0: @ 8100EF0 + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08100F06 + ldr r1, _08100F64 + ldrh r0, [r1, 0x2] + adds r0, 0x8 + strh r0, [r1, 0x2] +_08100F06: + ldr r6, _08100F68 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A60AC + lsls r0, 24 + ldr r4, _08100F64 + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r5, 0x22] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100F44 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08100F6C +_08100F44: + ldrb r0, [r6] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r5, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] + b _08100F84 + .align 2, 0 +_08100F64: .4byte 0x0203841e +_08100F68: .4byte 0x02038436 +_08100F6C: + ldrb r0, [r6] + bl sub_80A8328 + 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] +_08100F84: + ldr r0, _08100FC8 + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + ldr r0, _08100FCC + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r5, 0x32] + movs r4, 0x10 + movs r0, 0x10 + strh r0, [r5, 0x3C] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r0, [r5, 0x3C] + lsls r1, r0, 8 + subs r4, r0 + orrs r1, r4 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r0, _08100FD0 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08100FC8: .4byte 0x0203841e +_08100FCC: .4byte 0x00002828 +_08100FD0: .4byte sub_8100FD4 + 1 + thumb_func_end sub_8100EF0 + + thumb_func_start sub_8100FD4 +sub_8100FD4: @ 8100FD4 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x60 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08101032 + movs r0, 0 + strh r0, [r4, 0x30] + ldr r1, _0810107C + movs r2, 0x32 + ldrsh r0, [r4, r2] + adds r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r5, [r0] + movs r2, 0 + adds r6, r1, 0 + adds r3, r6, 0 +_0810100C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + adds r2, 0x1 + adds r0, r2 + lsls r1, r0, 1 + adds r1, r3 + adds r0, 0x1 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + cmp r2, 0x5 + ble _0810100C + movs r2, 0x32 + ldrsh r0, [r4, r2] + adds r0, 0x7 + lsls r0, 1 + adds r0, r6 + strh r5, [r0] +_08101032: + ldrh r2, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x6 + ble _0810106C + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _08101080 + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810106C + movs r0, 0 + strh r0, [r4, 0x3A] + subs r2, 0x1 + strh r2, [r4, 0x3C] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set +_0810106C: + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08101080 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + b _081010C2 + .align 2, 0 +_0810107C: .4byte 0x02037b14 +_08101080: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081010C2 + movs r0, 0 + strh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r2, 0x1 + strh r2, [r4, 0x3C] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081010C2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _081010C8 + str r0, [r4, 0x1C] +_081010C2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081010C8: .4byte sub_80A67F4 + 1 + thumb_func_end sub_8100FD4 + + thumb_func_start sub_81010CC +sub_81010CC: @ 81010CC + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _0810112C + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08101130 + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x2E] + strh r5, [r4, 0x30] + strh r5, [r4, 0x32] + strh r5, [r4, 0x34] + strh r5, [r4, 0x36] + strh r5, [r4, 0x3A] + movs r0, 0x10 + strh r0, [r4, 0x3C] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r0, _08101134 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810112C: .4byte 0x02038437 +_08101130: .4byte 0x0000ffe8 +_08101134: .4byte sub_8101138 + 1 + thumb_func_end sub_81010CC + + thumb_func_start sub_8101138 +sub_8101138: @ 8101138 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08101146 + b _08101290 +_08101146: + lsls r0, 2 + ldr r1, _08101150 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08101150: .4byte _08101154 + .align 2, 0 +_08101154: + .4byte _08101168 + .4byte _081011CC + .4byte _081011E8 + .4byte _08101266 + .4byte _0810127A +_08101168: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bgt _08101176 + b _08101290 +_08101176: + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08101198 + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _081011A6 + adds r0, r1, 0x1 + strh r0, [r4, 0x3A] + b _081011A6 +_08101198: + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _081011A6 + subs r0, r1, 0x1 + strh r0, [r4, 0x3C] +_081011A6: + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08101290 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08101290 + strh r0, [r4, 0x30] + b _08101272 +_081011CC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _08101290 + movs r0, 0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + b _08101272 +_081011E8: + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0x4 + bl sub_8101298 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0810120A + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_0810120A: + ldrh r0, [r4, 0x32] + adds r1, r0, 0x1 + strh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _08101290 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08101230 + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0810123E + subs r0, r1, 0x1 + strh r0, [r4, 0x3A] + b _0810123E +_08101230: + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _0810123E + adds r0, r1, 0x1 + strh r0, [r4, 0x3C] +_0810123E: + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x3A + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _08101290 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bne _08101290 + strh r1, [r4, 0x30] + strh r1, [r4, 0x32] + b _08101272 +_08101266: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08101272: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08101290 +_0810127A: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 +_08101290: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101138 + + thumb_func_start sub_8101298 +sub_8101298: @ 8101298 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0xB + bgt _081012AA + ldrh r0, [r4, 0x36] + adds r0, 0x2 + strh r0, [r4, 0x36] +_081012AA: + ldrh r5, [r4, 0x34] + adds r0, r5, 0 + subs r0, 0x12 + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + cmp r0, 0x17 + bhi _081012C0 + ldrh r0, [r4, 0x36] + subs r0, 0x2 + strh r0, [r4, 0x36] +_081012C0: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2F + ble _081012CE + ldrh r0, [r4, 0x36] + adds r0, 0x2 + strh r0, [r4, 0x36] +_081012CE: + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x9 + bl __divsi3 + strh r0, [r4, 0x24] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xE + bl __divsi3 + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + bge _081012F4 + movs r1, 0x26 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x26] +_081012F4: + adds r0, r5, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _08101304 + movs r0, 0 + strh r0, [r4, 0x34] +_08101304: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8101298 + + thumb_func_start sub_810130C +sub_810130C: @ 810130C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08101350 + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08101320 + adds r0, r4, 0 + bl sub_80A6838 +_08101320: + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x32] + ldr r1, _08101354 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08101358 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08101350: .4byte 0x0203841e +_08101354: .4byte move_anim_8072740 + 1 +_08101358: .4byte sub_80A656C + 1 + thumb_func_end sub_810130C + + thumb_func_start sub_810135C +sub_810135C: @ 810135C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _08101370 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08101378 + ldr r0, _08101374 + b _0810137A + .align 2, 0 +_08101370: .4byte 0x0203841e +_08101374: .4byte 0x02038436 +_08101378: + ldr r0, _081013BC +_0810137A: + ldrb r6, [r0] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081013C4 + movs r1, 0x2 + adds r0, r6, 0 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081013C4 + ldr r4, _081013C0 + ldrb r1, [r4, 0xC] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + adds r0, r6, 0 + bl sub_80A8924 + movs r2, 0 + ldrsh r1, [r4, r2] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + b _08101414 + .align 2, 0 +_081013BC: .4byte 0x02038437 +_081013C0: .4byte 0x0203841e +_081013C4: + ldr r4, _081013E4 + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081013E8 + adds r0, r6, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x1 + b _081013FA + .align 2, 0 +_081013E4: .4byte 0x0203841e +_081013E8: + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x3 +_081013FA: + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r5, 0x22] + ldr r0, _08101434 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_80A6864 +_08101414: + ldr r1, _08101434 + ldrh r0, [r1, 0xA] + strh r0, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x32] + ldr r1, _08101438 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810143C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08101434: .4byte 0x0203841e +_08101438: .4byte move_anim_8072740 + 1 +_0810143C: .4byte sub_80A656C + 1 + thumb_func_end sub_810135C + + thumb_func_start sub_8101440 +sub_8101440: @ 8101440 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, _0810146C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08101474 + ldr r0, _08101470 + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + b _0810148E + .align 2, 0 +_0810146C: .4byte 0x02038436 +_08101470: .4byte 0x0203841e +_08101474: + ldr r2, _08101498 + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start +_0810148E: + ldr r0, _0810149C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08101498: .4byte 0x0203841e +_0810149C: .4byte sub_81014A0 + 1 + thumb_func_end sub_8101440 + + thumb_func_start sub_81014A0 +sub_81014A0: @ 81014A0 + 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, 0x1E + ble _081014D8 + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x1E + subs r0, r1 + movs r1, 0x3 + bl __divsi3 + strh r0, [r4, 0x26] + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 18 + asrs r0, 16 + movs r1, 0x3 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_081014D8: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081014EC + adds r0, r4, 0 + bl move_anim_8072740 +_081014EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81014A0 + + thumb_func_start sub_81014F4 +sub_81014F4: @ 81014F4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, _08101524 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810152C + ldr r1, _08101528 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x1 + strh r0, [r4, 0x34] + b _0810154A + .align 2, 0 +_08101524: .4byte 0x02038436 +_08101528: .4byte 0x0203841e +_0810152C: + ldr r2, _08101554 + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldr r0, _08101558 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_0810154A: + ldr r0, _0810155C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08101554: .4byte 0x0203841e +_08101558: .4byte 0x0000ffff +_0810155C: .4byte sub_8101560 + 1 + thumb_func_end sub_81014F4 + + thumb_func_start sub_8101560 +sub_8101560: @ 8101560 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x28 + bl __divsi3 + negs r0, r0 + strh r0, [r4, 0x26] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 1 + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _081015A4 + adds r0, r4, 0 + bl move_anim_8074EE0 +_081015A4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101560 + + thumb_func_start sub_81015AC +sub_81015AC: @ 81015AC + push {lr} + ldrh r1, [r0, 0x20] + subs r1, 0x20 + strh r1, [r0, 0x20] + ldrh r1, [r0, 0x22] + subs r1, 0x20 + strh r1, [r0, 0x22] + movs r1, 0x14 + strh r1, [r0, 0x2E] + ldr r1, _081015CC + str r1, [r0, 0x1C] + ldr r1, _081015D0 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_081015CC: .4byte sub_80A64B0 + 1 +_081015D0: .4byte sub_81015D4 + 1 + thumb_func_end sub_81015AC + + thumb_func_start sub_81015D4 +sub_81015D4: @ 81015D4 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r6, [r5, 0x38] + movs r1, 0x1 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _081015EA + cmp r0, 0x1 + beq _08101604 + b _0810166A +_081015EA: + strh r1, [r5, 0x2E] + ldr r0, _081015FC + str r0, [r5, 0x1C] + ldr r1, _08101600 + adds r0, r5, 0 + bl oamt_set_x3A_32 + b _0810166A + .align 2, 0 +_081015FC: .4byte sub_80A64B0 + 1 +_08101600: .4byte sub_81015D4 + 1 +_08101604: + ldrh r3, [r5, 0x24] + ldrh r0, [r5, 0x20] + adds r3, r0 + movs r0, 0 + strh r3, [r5, 0x20] + ldrh r4, [r5, 0x26] + ldrh r1, [r5, 0x22] + adds r4, r1 + strh r4, [r5, 0x22] + strh r0, [r5, 0x26] + strh r0, [r5, 0x24] + movs r0, 0x8 + strh r0, [r5, 0x2E] + ldr r2, _08101678 + lsls r0, r6, 16 + asrs r0, 24 + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + adds r3, r1 + strh r3, [r5, 0x32] + adds r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r4, r0 + strh r4, [r5, 0x36] + ldr r0, _0810167C + str r0, [r5, 0x1C] + ldr r1, _08101680 + adds r0, r5, 0 + bl oamt_set_x3A_32 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x38] + adds r0, r1 + strh r0, [r5, 0x38] + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xD2 + bl audio_play_and_stuff +_0810166A: + ldrh r0, [r5, 0x38] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0x38] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08101678: .4byte 0x08592cd0 +_0810167C: .4byte sub_80A6EEC + 1 +_08101680: .4byte sub_8101684 + 1 + thumb_func_end sub_81015D4 + + thumb_func_start sub_8101684 +sub_8101684: @ 8101684 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _081016AC + movs r0, 0xA + strh r0, [r2, 0x2E] + ldr r0, _081016A4 + str r0, [r2, 0x1C] + ldr r1, _081016A8 + adds r0, r2, 0 + bl oamt_set_x3A_32 + b _081016B0 + .align 2, 0 +_081016A4: .4byte sub_80A64B0 + 1 +_081016A8: .4byte sub_81016B8 + 1 +_081016AC: + ldr r0, _081016B4 + str r0, [r2, 0x1C] +_081016B0: + pop {r0} + bx r0 + .align 2, 0 +_081016B4: .4byte sub_81015D4 + 1 + thumb_func_end sub_8101684 + + thumb_func_start sub_81016B8 +sub_81016B8: @ 81016B8 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x6] + cmp r1, 0 + bne _081016E0 + movs r0, 0x3 + strh r0, [r5, 0x2E] + strh r1, [r5, 0x30] + strh r1, [r5, 0x32] + ldr r0, _081016D8 + str r0, [r5, 0x1C] + ldr r1, _081016DC + adds r0, r5, 0 + bl oamt_set_x3A_32 + b _08101760 + .align 2, 0 +_081016D8: .4byte sub_80A64B0 + 1 +_081016DC: .4byte sub_8101774 + 1 +_081016E0: + ldrh r0, [r5, 0x6] + cmp r0, 0x2 + beq _08101700 + cmp r0, 0x2 + bgt _081016F0 + cmp r0, 0x1 + beq _081016F6 + b _08101714 +_081016F0: + cmp r0, 0x3 + beq _08101708 + b _08101714 +_081016F6: + ldr r6, _081016FC + adds r7, r6, 0 + b _08101718 + .align 2, 0 +_081016FC: .4byte 0x0000fff8 +_08101700: + ldr r7, _08101704 + b _08101716 + .align 2, 0 +_08101704: .4byte 0x0000fff8 +_08101708: + movs r7, 0x8 + ldr r6, _08101710 + b _08101718 + .align 2, 0 +_08101710: .4byte 0x0000fff8 +_08101714: + movs r7, 0x8 +_08101716: + movs r6, 0x8 +_08101718: + 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] + movs r0, 0x6 + strh r0, [r5, 0x2E] + ldr r4, _08101768 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r7 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x36] + ldr r0, _0810176C + str r0, [r5, 0x1C] + ldr r1, _08101770 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_08101760: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08101768: .4byte 0x02038437 +_0810176C: .4byte sub_80A6EEC + 1 +_08101770: .4byte sub_8101820 + 1 + thumb_func_end sub_81016B8 + + thumb_func_start sub_8101774 +sub_8101774: @ 8101774 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08101794 + ldrh r0, [r4, 0x30] + adds r0, 0x3 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081017A4 + movs r0, 0x10 + b _081017A2 +_08101794: + ldrh r0, [r4, 0x30] + subs r0, 0x3 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _081017A4 + movs r0, 0 +_081017A2: + strh r0, [r4, 0x30] +_081017A4: + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80A75AC + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08101800 + bl sub_80A2A20 + movs r3, 0x30 + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bne _0810180C + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x5] + lsrs r1, 4 + lsls r0, r1, 5 + ldr r2, _08101804 + adds r0, r2 + lsls r1, 4 + ldr r3, _08101808 + adds r2, r3, 0 + orrs r1, r2 + movs r2, 0x4 + bl gpu_pal_apply + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC0 + bl audio_play_and_stuff + b _08101814 + .align 2, 0 +_08101800: .4byte 0x00007fff +_08101804: .4byte 0x02037924 +_08101808: .4byte 0x00000101 +_0810180C: + cmp r0, 0 + bne _08101814 + ldr r0, _0810181C + str r0, [r4, 0x1C] +_08101814: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810181C: .4byte sub_8101820 + 1 + thumb_func_end sub_8101774 + + thumb_func_start sub_8101820 +sub_8101820: @ 8101820 + push {lr} + adds r2, r0, 0 + ldr r0, _0810183C + ldrh r1, [r0, 0xE] + ldr r0, _08101840 + cmp r1, r0 + bne _08101838 + movs r0, 0 + strh r0, [r2, 0x30] + strh r0, [r2, 0x2E] + ldr r0, _08101844 + str r0, [r2, 0x1C] +_08101838: + pop {r0} + bx r0 + .align 2, 0 +_0810183C: .4byte 0x0203841e +_08101840: .4byte 0x0000ffff +_08101844: .4byte sub_8101848 + 1 + thumb_func_end sub_8101820 + + thumb_func_start sub_8101848 +sub_8101848: @ 8101848 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0810187C + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + 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] +_0810187C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bne _08101890 + adds r0, r4, 0 + bl move_anim_8072740 +_08101890: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101848 + + thumb_func_start sub_8101898 +sub_8101898: @ 8101898 + push {r4,lr} + adds r3, r0, 0 + ldr r0, _081018B8 + ldrh r0, [r0] + strh r0, [r3, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081018BC + ldrh r0, [r3, 0x20] + subs r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + subs r0, 0x18 + strh r0, [r3, 0x22] + b _0810190E + .align 2, 0 +_081018B8: .4byte 0x0203841e +_081018BC: + cmp r0, 0x2 + bne _081018D8 + ldrh r0, [r3, 0x20] + subs r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + adds r0, 0x18 + strh r0, [r3, 0x22] + ldrb r1, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x20 + b _0810190A +_081018D8: + cmp r0, 0x3 + bne _081018F4 + ldrh r0, [r3, 0x20] + adds r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + subs r0, 0x18 + strh r0, [r3, 0x22] + ldrb r1, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + b _0810190A +_081018F4: + ldrh r0, [r3, 0x20] + adds r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + adds r0, 0x18 + strh r0, [r3, 0x22] + ldrb r1, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x30 +_0810190A: + orrs r0, r1 + strb r0, [r3, 0x3] +_0810190E: + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r4, _08101934 + adds r0, r4, 0 + ands r1, r0 + ldr r0, _08101938 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldr r1, _0810193C + str r1, [r3, 0x1C] + adds r0, r3, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08101934: .4byte 0x000003ff +_08101938: .4byte 0xfffffc00 +_0810193C: .4byte sub_81015AC + 1 + thumb_func_end sub_8101898 + + thumb_func_start sub_8101940 +sub_8101940: @ 8101940 + push {lr} + adds r3, r0, 0 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0 + strh r0, [r3, 0x2E] + ldr r0, _08101968 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _0810197C + cmp r0, 0x1 + bgt _0810196C + cmp r0, 0 + beq _08101972 + b _0810198C + .align 2, 0 +_08101968: .4byte 0x0203841e +_0810196C: + cmp r0, 0x2 + beq _08101984 + b _0810198C +_08101972: + ldr r0, _08101978 + b _0810198E + .align 2, 0 +_08101978: .4byte sub_8101998 + 1 +_0810197C: + ldr r0, _08101980 + b _0810198E + .align 2, 0 +_08101980: .4byte sub_8101A74 + 1 +_08101984: + ldr r0, _08101988 + b _0810198E + .align 2, 0 +_08101988: .4byte sub_8101AC4 + 1 +_0810198C: + ldr r0, _08101994 +_0810198E: + str r0, [r3, 0x1C] + pop {r0} + bx r0 + .align 2, 0 +_08101994: .4byte sub_8101B84 + 1 + thumb_func_end sub_8101940 + + thumb_func_start sub_8101998 +sub_8101998: @ 8101998 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + strh r0, [r4, 0x2E] + ldr r5, _081019D8 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x2 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + beq _081019B6 + movs r1, 0x2 +_081019B6: + strh r1, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r1, _081019DC + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + ldr r1, _081019E0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _081019E4 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081019D8: .4byte 0x02038436 +_081019DC: .4byte 0x020241e4 +_081019E0: .4byte sub_81019E8 + 1 +_081019E4: .4byte sub_80A6630 + 1 + thumb_func_end sub_8101998 + + thumb_func_start sub_81019E8 +sub_81019E8: @ 81019E8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x2E + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08101A24 + ldr r1, _08101A64 + ldr r4, _08101A68 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r5, 0x34] + movs r1, 0 + bl sub_80A7270 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + ldr r2, _08101A6C + adds r1, r2, 0 + cmp r0, 0 + beq _08101A20 + movs r0, 0xC0 + lsls r0, 2 + adds r1, r0, 0 +_08101A20: + strh r1, [r5, 0x36] + strh r6, [r5, 0x38] +_08101A24: + ldrh r0, [r5, 0x36] + ldrh r1, [r5, 0x38] + adds r0, r1 + strh r0, [r5, 0x38] + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r5, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08101A5E + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, _08101A70 + str r0, [r5, 0x1C] +_08101A5E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08101A64: .4byte 0x020241e4 +_08101A68: .4byte 0x02038436 +_08101A6C: .4byte 0xfffffd00 +_08101A70: .4byte sub_8101B84 + 1 + thumb_func_end sub_81019E8 + + thumb_func_start sub_8101A74 +sub_8101A74: @ 8101A74 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x4 + strh r0, [r4, 0x2E] + ldr r5, _08101AB4 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x3 + cmp r0, 0 + beq _08101A92 + movs r0, 0x3 + negs r0, r0 + adds r1, r0, 0 +_08101A92: + strh r1, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r1, _08101AB8 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + ldr r1, _08101ABC + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08101AC0 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08101AB4: .4byte 0x02038436 +_08101AB8: .4byte 0x020241e4 +_08101ABC: .4byte sub_8101B84 + 1 +_08101AC0: .4byte sub_80A6630 + 1 + thumb_func_end sub_8101A74 + + thumb_func_start sub_8101AC4 +sub_8101AC4: @ 8101AC4 + 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, 0x8 + ble _08101ADE + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, _08101AE4 + str r0, [r1, 0x1C] +_08101ADE: + pop {r0} + bx r0 + .align 2, 0 +_08101AE4: .4byte sub_8101AE8 + 1 + thumb_func_end sub_8101AC4 + + thumb_func_start sub_8101AE8 +sub_8101AE8: @ 8101AE8 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08101B38 + ldr r1, _08101B24 + ldr r4, _08101B28 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r5, 0x34] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08101B2C + movs r0, 0xFC + lsls r0, 8 + strh r0, [r5, 0x36] + movs r0, 0xC0 + lsls r0, 4 + b _08101B36 + .align 2, 0 +_08101B24: .4byte 0x020241e4 +_08101B28: .4byte 0x02038436 +_08101B2C: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r5, 0x36] + movs r0, 0xF4 + lsls r0, 8 +_08101B36: + strh r0, [r5, 0x38] +_08101B38: + ldrh r0, [r5, 0x36] + ldrh r1, [r5, 0x38] + adds r0, r1 + strh r0, [r5, 0x38] + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r5, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08101B78 + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + ldr r0, _08101B80 + str r0, [r5, 0x1C] +_08101B78: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08101B80: .4byte sub_8101B84 + 1 + thumb_func_end sub_8101AE8 + + thumb_func_start sub_8101B84 +sub_8101B84: @ 8101B84 + push {lr} + bl move_anim_8072740 + pop {r0} + bx r0 + thumb_func_end sub_8101B84 + + thumb_func_start sub_8101B90 +sub_8101B90: @ 8101B90 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r1, _08101B9C + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08101B9C: .4byte sub_8101BA0 + 1 + thumb_func_end sub_8101B90 + + thumb_func_start sub_8101BA0 +sub_8101BA0: @ 8101BA0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _08101BFA + cmp r5, 0x1 + bgt _08101BB6 + cmp r5, 0 + beq _08101BBC + b _08101C8E +_08101BB6: + cmp r5, 0x2 + beq _08101C4C + b _08101C8E +_08101BBC: + strh r5, [r4, 0x30] + ldr r1, _08101C40 + ldr r2, _08101C44 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x32] + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x34] + ldr r2, _08101C48 + adds r1, r2, 0 + cmp r0, 0 + beq _08101BE4 + movs r0, 0x80 + lsls r0, 2 + adds r1, r0, 0 +_08101BE4: + strh r1, [r4, 0x36] + strh r5, [r4, 0x38] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_08101BFA: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08101C8E + movs r0, 0 + strh r0, [r4, 0x30] + movs r2, 0x36 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08101C8E + .align 2, 0 +_08101C40: .4byte 0x020241e4 +_08101C44: .4byte 0x02038436 +_08101C48: .4byte 0xfffffe00 +_08101C4C: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08101C8E + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r4, 0 + bl move_anim_8072740 +_08101C8E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8101BA0 + + thumb_func_start sub_8101C94 +sub_8101C94: @ 8101C94 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08101CD8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldr r1, _08101CDC + ldr r2, _08101CE0 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + movs r4, 0 + strh r0, [r5, 0x8] + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + strh r2, [r5, 0xA] + strh r4, [r5, 0xC] + ldr r0, _08101CE4 + movs r3, 0 + ldrsh r1, [r0, r3] + cmp r1, 0 + beq _08101CE8 + cmp r1, 0x1 + beq _08101D04 + adds r0, r6, 0 + bl move_anim_task_del + b _08101D22 + .align 2, 0 +_08101CD8: .4byte 0x03005e00 +_08101CDC: .4byte 0x020241e4 +_08101CE0: .4byte 0x02038436 +_08101CE4: .4byte 0x0203841e +_08101CE8: + strh r1, [r5, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] + movs r0, 0x3 + strh r0, [r5, 0x12] + cmp r2, 0 + bne _08101CFC + negs r0, r0 + strh r0, [r5, 0x12] +_08101CFC: + ldr r0, _08101D00 + b _08101D20 + .align 2, 0 +_08101D00: .4byte sub_8101D2C + 1 +_08101D04: + movs r0, 0x8 + strh r0, [r5, 0xE] + movs r0, 0xC0 + lsls r0, 3 + strh r0, [r5, 0x10] + movs r1, 0xC0 + strh r1, [r5, 0x12] + cmp r2, 0 + bne _08101D1E + negs r0, r0 + strh r0, [r5, 0x10] + negs r0, r1 + strh r0, [r5, 0x12] +_08101D1E: + ldr r0, _08101D28 +_08101D20: + str r0, [r5] +_08101D22: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08101D28: .4byte sub_8101EEC + 1 + thumb_func_end sub_8101C94 + + thumb_func_start sub_8101D2C +sub_8101D2C: @ 8101D2C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08101D50 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08101D46 + b _08101EE6 +_08101D46: + lsls r0, 2 + ldr r1, _08101D54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08101D50: .4byte 0x03005e00 +_08101D54: .4byte _08101D58 + .align 2, 0 +_08101D58: + .4byte _08101D6C + .4byte _08101D9E + .4byte _08101DF8 + .4byte _08101E70 + .4byte _08101EB4 +_08101D6C: + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08101D7C + ldrh r2, [r4, 0x12] + ldrh r3, [r4, 0x10] + adds r2, r3 + b _08101EC2 +_08101D7C: + movs r0, 0x8 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r1, 0xC0 + cmp r0, 0 + bne _08101D92 + movs r2, 0xC0 + negs r2, r2 + adds r1, r2, 0 +_08101D92: + strh r1, [r4, 0x12] + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_80A7270 + b _08101EA8 +_08101D9E: + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101DC4 + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x10] + adds r0, r1 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x10] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A73A0 + b _08101ED4 +_08101DC4: + movs r0, 0x8 + strh r0, [r4, 0xE] + ldr r2, _08101DF4 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x2 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08101DEA + movs r1, 0x2 +_08101DEA: + strh r1, [r4, 0x12] + movs r0, 0x1 + strh r0, [r4, 0x14] + b _08101EA8 + .align 2, 0 +_08101DF4: .4byte 0x02020630 +_08101DF8: + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101E54 + ldrh r1, [r4, 0x14] + movs r3, 0x14 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101E12 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + b _08101EE6 +_08101E12: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08101E34 + ldr r2, _08101E30 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r4, 0x10] + adds r1, r2 + b _08101E48 + .align 2, 0 +_08101E30: .4byte 0x02020630 +_08101E34: + ldr r2, _08101E50 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + ldrh r2, [r4, 0x12] + subs r1, r2 +_08101E48: + strh r1, [r0, 0x24] + movs r0, 0x1 + strh r0, [r4, 0x14] + b _08101ED4 + .align 2, 0 +_08101E50: .4byte 0x02020630 +_08101E54: + ldr r2, _08101E6C + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + strh r1, [r0, 0x24] + movs r0, 0xC + strh r0, [r4, 0xE] + b _08101EA8 + .align 2, 0 +_08101E6C: .4byte 0x02020630 +_08101E70: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08101E80 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08101EE6 +_08101E80: + movs r0, 0x3 + strh r0, [r4, 0xE] + ldr r2, _08101EB0 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x8 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08101EA6 + movs r1, 0x8 +_08101EA6: + strh r1, [r4, 0x12] +_08101EA8: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08101EE6 + .align 2, 0 +_08101EB0: .4byte 0x02020630 +_08101EB4: + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101EE0 + ldrh r2, [r4, 0x12] + ldrh r0, [r4, 0x10] + adds r2, r0 +_08101EC2: + strh r2, [r4, 0x10] + ldr r3, _08101EDC + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x24] +_08101ED4: + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08101EE6 + .align 2, 0 +_08101EDC: .4byte 0x02020630 +_08101EE0: + adds r0, r2, 0 + bl move_anim_task_del +_08101EE6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101D2C + + thumb_func_start sub_8101EEC +sub_8101EEC: @ 8101EEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08101F28 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08101F2C + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x10] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A73A0 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08101F38 + .align 2, 0 +_08101F28: .4byte 0x03005e00 +_08101F2C: + ldrb r0, [r4, 0x8] + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_08101F38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8101EEC + + thumb_func_start sub_8101F40 +sub_8101F40: @ 8101F40 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _08101F54 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08101F5C + ldr r4, _08101F58 + b _08101F5E + .align 2, 0 +_08101F54: .4byte 0x0203841e +_08101F58: .4byte 0x02038436 +_08101F5C: + ldr r4, _08101F9C +_08101F5E: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + movs r0, 0 + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + ldr r1, _08101FA0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _08101FA4 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08101F9C: .4byte 0x02038437 +_08101FA0: .4byte sub_810208C + 1 +_08101FA4: .4byte sub_80A67D8 + 1 + thumb_func_end sub_8101F40 + + thumb_func_start sub_8101FA8 +sub_8101FA8: @ 8101FA8 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08101FE0 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08101FE4 + adds r0, r1 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, _08101FE8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08101FEC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08101FE0: .4byte 0x02038437 +_08101FE4: .4byte 0x0000ffd0 +_08101FE8: .4byte sub_8102044 + 1 +_08101FEC: .4byte sub_80A67D8 + 1 + thumb_func_end sub_8101FA8 + + thumb_func_start sub_8101FF0 +sub_8101FF0: @ 8101FF0 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, _08102034 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08102038 + ldr r2, _0810203C + adds r0, r2 + ldrh r1, [r1] + adds r0, r1 + movs r6, 0 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + strh r6, [r4, 0x2E] + strh r6, [r4, 0x30] + ldr r0, _08102040 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08102034: .4byte 0x02038437 +_08102038: .4byte 0x0203841e +_0810203C: .4byte 0x0000ffd0 +_08102040: .4byte sub_810208C + 1 + thumb_func_end sub_8101FF0 + + thumb_func_start sub_8102044 +sub_8102044: @ 8102044 + 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, 0x8 + ble _0810206E + movs r0, 0xC + strh r0, [r4, 0x2E] + movs r0, 0x8 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r1, _08102074 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08102078 + str r0, [r4, 0x1C] +_0810206E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08102074: .4byte sub_810207C + 1 +_08102078: .4byte sub_80A653C + 1 + thumb_func_end sub_8102044 + + thumb_func_start sub_810207C +sub_810207C: @ 810207C + movs r1, 0 + strh r1, [r0, 0x2E] + strh r1, [r0, 0x30] + ldr r1, _08102088 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08102088: .4byte sub_810208C + 1 + thumb_func_end sub_810207C + + thumb_func_start sub_810208C +sub_810208C: @ 810208C + 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, 0x1 + ble _081020D4 + movs r0, 0 + strh r0, [r3, 0x2E] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081020D4 + adds r0, r3, 0 + bl move_anim_8072740 +_081020D4: + pop {r0} + bx r0 + thumb_func_end sub_810208C + + thumb_func_start sub_81020D8 +sub_81020D8: @ 81020D8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _081020EC + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081020F4 + ldr r4, _081020F0 + b _081020F6 + .align 2, 0 +_081020EC: .4byte 0x0203841e +_081020F0: .4byte 0x02038436 +_081020F4: + ldr r4, _08102130 +_081020F6: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, _08102134 + ldrh r0, [r0, 0x6] + strh r0, [r5, 0x30] + ldr r0, _08102138 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08102130: .4byte 0x02038437 +_08102134: .4byte 0x0203841e +_08102138: .4byte sub_810213C + 1 + thumb_func_end sub_81020D8 + + thumb_func_start sub_810213C +sub_810213C: @ 810213C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x30 + ldrsh r1, [r2, r3] + cmp r0, r1 + ble _0810215C + movs r0, 0 + strh r0, [r2, 0x2E] + ldrh r0, [r2, 0x22] + subs r0, 0x1 + strh r0, [r2, 0x22] +_0810215C: + ldrh r0, [r2, 0x22] + ldrh r1, [r2, 0x2E] + subs r0, r1 + strh r0, [r2, 0x22] + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08102178 + adds r0, r2, 0 + bl move_anim_8072740 +_08102178: + pop {r0} + bx r0 + thumb_func_end sub_810213C + + thumb_func_start sub_810217C +sub_810217C: @ 810217C + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _081021C4 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0xC + strh r0, [r4, 0x22] + strh r5, [r4, 0x2E] + movs r0, 0x2 + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + strh r5, [r4, 0x34] + strh r5, [r4, 0x36] + subs r0, 0x42 + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x38] + ldr r0, _081021C8 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081021C4: .4byte 0x02038436 +_081021C8: .4byte sub_81021CC + 1 + thumb_func_end sub_810217C + + thumb_func_start sub_81021CC +sub_81021CC: @ 81021CC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _08102238 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0810221E + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0810221E + ldrh r1, [r4, 0x38] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC2 + bl audio_play_and_stuff +_0810221E: + movs r1, 0 + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08102238 + strh r1, [r4, 0x32] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08102238: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08102262 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + ble _08102262 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08102262 + adds r0, r4, 0 + bl move_anim_8072740 +_08102262: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81021CC + + thumb_func_start sub_8102268 +sub_8102268: @ 8102268 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081022B2 + ldr r4, _081022C8 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r5, _081022CC + lsrs r0, 24 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x2] + adds r0, r5 + strh r0, [r6, 0x22] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081022AC + ldrh r0, [r6, 0x22] + adds r0, 0xA + strh r0, [r6, 0x22] +_081022AC: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] +_081022B2: + ldr r0, _081022CC + ldrh r1, [r0, 0xE] + ldr r0, _081022D0 + cmp r1, r0 + bne _081022C2 + adds r0, r6, 0 + bl move_anim_8072740 +_081022C2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081022C8: .4byte 0x02038436 +_081022CC: .4byte 0x0203841e +_081022D0: .4byte 0x0000ffff + thumb_func_end sub_8102268 + + thumb_func_start sub_81022D4 +sub_81022D4: @ 81022D4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _081022F4 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08102300 + ldr r1, _081022F8 + ldr r0, _081022FC + strh r0, [r1, 0xE] + b _0810233E + .align 2, 0 +_081022F4: .4byte 0x03005e00 +_081022F8: .4byte 0x0203841e +_081022FC: .4byte 0x0000ffff +_08102300: + cmp r0, 0x2 + bne _0810230C + adds r0, r2, 0 + bl move_anim_task_del + b _08102344 +_0810230C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08102344 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r2, [r4, 0xA] + adds r2, 0x1 + strh r2, [r4, 0xA] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08102344 +_0810233E: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_08102344: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81022D4 + + thumb_func_start sub_810234C +sub_810234C: @ 810234C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A6980 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08102374 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r0, _08102378 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08102374: .4byte 0x0203841e +_08102378: .4byte sub_810237C + 1 + thumb_func_end sub_810234C + + thumb_func_start sub_810237C +sub_810237C: @ 810237C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08102390 + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _081023CC +_08102390: + adds r2, r5, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1E + strh r0, [r5, 0x2E] + ldr r4, _081023D4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, _081023D8 + str r0, [r5, 0x1C] + ldr r1, _081023DC + adds r0, r5, 0 + bl oamt_set_x3A_32 +_081023CC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081023D4: .4byte 0x02038436 +_081023D8: .4byte sub_80A6EEC + 1 +_081023DC: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810237C + + thumb_func_start sub_81023E0 +sub_81023E0: @ 81023E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08102430 + 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 + asrs r0, 16 + cmp r0, 0x4 + bne _08102428 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08102428 + adds r0, r5, 0 + bl move_anim_task_del +_08102428: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08102430: .4byte 0x03005e00 + thumb_func_end sub_81023E0 + + thumb_func_start sub_8102434 +sub_8102434: @ 8102434 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r0, _0810249C + ldrb r0, [r0] + cmp r4, r0 + bcs _08102490 + ldr r6, _081024A0 + ldr r5, _081024A4 +_08102448: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _08102464 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08102464 + adds r0, r4, r5 + ldrb r0, [r0] + bl sub_8072984 +_08102464: + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _08102482 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102482 + adds r0, r4, r5 + ldrb r0, [r0] + bl sub_8072984 +_08102482: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0810249C + ldrb r0, [r0] + cmp r4, r0 + bcc _08102448 +_08102490: + adds r0, r7, 0 + bl move_anim_task_del + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810249C: .4byte 0x0202406c +_081024A0: .4byte 0x0203841e +_081024A4: .4byte 0x03005d70 + thumb_func_end sub_8102434 + + thumb_func_start sub_81024A8 +sub_81024A8: @ 81024A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + b _081024C2 +_081024B2: + ldr r0, _081024D8 + adds r0, r4, r0 + ldrb r0, [r0] + bl sub_80729D0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081024C2: + ldr r0, _081024DC + ldrb r0, [r0] + cmp r4, r0 + bcc _081024B2 + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081024D8: .4byte 0x03005d70 +_081024DC: .4byte 0x0202406c + thumb_func_end sub_81024A8 + + thumb_func_start sub_81024E0 +sub_81024E0: @ 81024E0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081024F6 + movs r0, 0x30 + strh r0, [r4, 0x20] + movs r0, 0x28 + b _081024FE +_081024F6: + ldr r0, _08102520 + ldrh r1, [r0] + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] +_081024FE: + strh r0, [r4, 0x22] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _08102524 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08102520: .4byte 0x0203841e +_08102524: .4byte sub_8102528 + 1 + thumb_func_end sub_81024E0 + + thumb_func_start sub_8102528 +sub_8102528: @ 8102528 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0810253A + adds r0, r1, 0 + bl move_anim_8072740 +_0810253A: + pop {r0} + bx r0 + thumb_func_end sub_8102528 + + thumb_func_start sub_8102540 +sub_8102540: @ 8102540 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08102578 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r2, _0810257C + lsrs r0, 24 + ldrh r1, [r2] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x22] + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x36] + ldr r0, _08102580 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08102578: .4byte 0x02038436 +_0810257C: .4byte 0x0203841e +_08102580: .4byte sub_8102584 + 1 + thumb_func_end sub_8102540 + + thumb_func_start sub_8102584 +sub_8102584: @ 8102584 + 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, 0x1 + ble _081025AE + movs r0, 0 + strh r0, [r1, 0x30] + ldrh r2, [r1, 0x32] + movs r3, 0x32 + ldrsh r0, [r1, r3] + cmp r0, 0x77 + bgt _081025AE + ldrh r0, [r1, 0x22] + adds r0, 0x1 + strh r0, [r1, 0x22] + adds r0, r2, 0x1 + strh r0, [r1, 0x32] +_081025AE: + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081025BC + adds r0, r1, 0 + bl move_anim_8072740 +_081025BC: + pop {r0} + bx r0 + thumb_func_end sub_8102584 + + thumb_func_start sub_81025C0 +sub_81025C0: @ 81025C0 + 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 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + mov r8, r0 + ldr r0, _08102690 + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldr r0, _08102694 + mov r9, r0 + lsls r5, r7, 2 + adds r5, r7 + lsls r5, 3 + adds r6, r5, r0 + strh r4, [r6, 0x8] + strh r4, [r6, 0xA] + strh r4, [r6, 0xC] + strh r1, [r6, 0xE] + strh r4, [r6, 0x10] + strh r4, [r6, 0x12] + strh r4, [r6, 0x14] + movs r0, 0xD + strh r0, [r6, 0x16] + movs r0, 0xE + strh r0, [r6, 0x18] + movs r0, 0xF + strh r0, [r6, 0x1A] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80A76C4 + mov r10, r0 + mov r1, r8 + orrs r1, r0 + mov r8, r1 + movs r0, 0x8 + add r9, r0 + add r5, r9 + adds r0, r5, 0 + adds r0, 0x1C + adds r5, 0x1E + adds r1, r5, 0 + mov r2, r8 + bl sub_80A8048 + ldr r0, _08102698 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x80 + lsls r4, 9 + adds r1, r4, 0 + lsls r1, r0 + mov r0, r10 + orrs r0, r1 + mov r10, r0 + ldr r0, _0810269C + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0 + mov r1, r10 + orrs r4, r1 + ldr r0, _081026A0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _081026A4 + str r1, [r6] + adds r0, r7, 0 + bl _call_via_r1 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08102690: .4byte 0x0000ffff +_08102694: .4byte 0x03005e00 +_08102698: .4byte 0x000027d2 +_0810269C: .4byte 0x000027d3 +_081026A0: .4byte 0x00007fbb +_081026A4: .4byte sub_81026A8 + 1 + thumb_func_end sub_81025C0 + + thumb_func_start sub_81026A8 +sub_81026A8: @ 81026A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _081026D0 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _08102794 + cmp r1, 0x1 + bgt _081026D4 + cmp r1, 0 + beq _081026E2 + b _08102832 + .align 2, 0 +_081026D0: .4byte 0x03005e00 +_081026D4: + cmp r1, 0x2 + bne _081026DA + b _081027EC +_081026DA: + cmp r1, 0x3 + bne _081026E0 + b _08102820 +_081026E0: + b _08102832 +_081026E2: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _081026F0 + b _08102832 +_081026F0: + strh r1, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0810273C + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x10] + adds r0, r1 + strh r0, [r4, 0x10] + ldrh r2, [r4, 0x18] + ldrh r3, [r4, 0x12] + adds r2, r3 + strh r2, [r4, 0x12] + ldrh r1, [r4, 0x1A] + ldrh r5, [r4, 0x14] + adds r1, r5 + strh r1, [r4, 0x14] + lsls r0, 16 + asrs r0, 19 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 16 + asrs r2, 19 + lsls r2, 16 + lsls r1, 16 + asrs r1, 19 + lsls r1, 16 + lsrs r2, 11 + orrs r0, r2 + lsrs r1, 6 + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + b _08102746 +_0810273C: + ldr r7, _0810278C + mov r12, r7 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08102746: + movs r2, 0x1 + movs r3, 0 + movs r1, 0 +_0810274C: + movs r5, 0xE + ldrsh r0, [r4, r5] + ands r0, r2 + lsls r5, r2, 17 + adds r6, r3, 0 + adds r6, 0x10 + adds r1, 0x1 + mov r8, r1 + cmp r0, 0 + beq _08102778 + movs r1, 0x1 + ldr r2, _08102790 +_08102764: + adds r0, r3, r1 + lsls r0, 1 + adds r0, r2 + mov r7, r12 + strh r7, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _08102764 +_08102778: + lsrs r2, r5, 16 + lsls r0, r6, 16 + lsrs r3, r0, 16 + mov r1, r8 + lsls r0, r1, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0810274C + b _08102832 + .align 2, 0 +_0810278C: .4byte 0x00007fbb +_08102790: .4byte 0x02037b14 +_08102794: + ldr r0, _081027DC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08102832 + movs r2, 0 + ldr r3, _081027E0 + movs r5, 0x14 + adds r5, r3 + mov r12, r5 + ldr r7, _081027E4 + mov r8, r7 + ldr r6, _081027E8 + movs r5, 0x1 +_081027B2: + lsls r0, r2, 4 + adds r0, r2 + lsls r1, r0, 2 + mov r7, r12 + adds r0, r1, r7 + ldr r0, [r0] + cmp r0, r8 + beq _081027C6 + cmp r0, r6 + bne _081027CA +_081027C6: + adds r0, r1, r3 + strh r5, [r0, 0x2E] +_081027CA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _081027B2 + movs r0, 0 + strh r0, [r4, 0xA] + b _08102814 + .align 2, 0 +_081027DC: .4byte 0x02037fd4 +_081027E0: .4byte 0x02020630 +_081027E4: .4byte 0x08592ebc +_081027E8: .4byte 0x08592eec +_081027EC: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08102832 + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + bl sub_80A8050 + ldr r1, _0810281C + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_08102814: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08102832 + .align 2, 0 +_0810281C: .4byte 0x00007fbb +_08102820: + ldr r0, _08102840 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08102832 + adds r0, r2, 0 + bl move_anim_task_del +_08102832: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08102840: .4byte 0x02037fd4 + thumb_func_end sub_81026A8 + + thumb_func_start sub_8102844 +sub_8102844: @ 8102844 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _081028C8 + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bgt _08102856 + movs r0, 0x2 + strh r0, [r6, 0x4] +_08102856: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0x7F + ble _08102862 + movs r0, 0x7F + strh r0, [r6, 0x4] +_08102862: + movs r0, 0 + strh r0, [r5, 0x2E] + ldrh r0, [r6, 0x4] + strh r0, [r5, 0x30] + ldr r4, _081028CC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x2] + adds r0, r6 + strh r0, [r5, 0x22] + ldrh r1, [r5, 0x20] + strh r1, [r5, 0x3A] + strh r0, [r5, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081028D4 + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + ldrh r0, [r5, 0x20] + adds r0, 0x28 + strh r0, [r5, 0x20] + ldrh r4, [r5, 0x22] + adds r4, 0x14 + strh r4, [r5, 0x22] + lsls r0, 7 + strh r0, [r5, 0x32] + movs r0, 0x30 + ldrsh r1, [r5, r0] + ldr r0, _081028D0 + b _081028FA + .align 2, 0 +_081028C8: .4byte 0x0203841e +_081028CC: .4byte 0x02038437 +_081028D0: .4byte 0xffffec00 +_081028D4: + ldr r0, _08102914 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810291C + ldrh r0, [r5, 0x20] + subs r0, 0x28 + strh r0, [r5, 0x20] + ldrh r4, [r5, 0x22] + adds r4, 0x14 + strh r4, [r5, 0x22] + lsls r0, 7 + strh r0, [r5, 0x32] + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r0, 0xA0 + lsls r0, 5 +_081028FA: + bl __divsi3 + strh r0, [r5, 0x34] + lsls r4, 7 + strh r4, [r5, 0x36] + movs r0, 0x30 + ldrsh r1, [r5, r0] + ldr r0, _08102918 + bl __divsi3 + strh r0, [r5, 0x38] + b _08102958 + .align 2, 0 +_08102914: .4byte 0x02038436 +_08102918: .4byte 0xfffff600 +_0810291C: + ldrh r0, [r5, 0x20] + adds r0, 0x28 + strh r0, [r5, 0x20] + ldrh r4, [r5, 0x22] + subs r4, 0x14 + strh r4, [r5, 0x22] + lsls r0, 7 + strh r0, [r5, 0x32] + movs r0, 0x30 + ldrsh r1, [r5, r0] + ldr r0, _08102964 + bl __divsi3 + strh r0, [r5, 0x34] + lsls r4, 7 + strh r4, [r5, 0x36] + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r0, 0xA0 + lsls r0, 4 + bl __divsi3 + strh r0, [r5, 0x38] + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r5, 0x3] +_08102958: + ldr r0, _08102968 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08102964: .4byte 0xffffec00 +_08102968: .4byte sub_810296C + 1 + thumb_func_end sub_8102844 + + thumb_func_start sub_810296C +sub_810296C: @ 810296C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x34] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r1, [r2, 0x38] + ldrh r3, [r2, 0x36] + adds r1, r3 + strh r1, [r2, 0x36] + lsls r0, 16 + asrs r0, 23 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 23 + strh r1, [r2, 0x22] + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081029A2 + ldrh r0, [r2, 0x3A] + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x3C] + strh r0, [r2, 0x22] +_081029A2: + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _081029B0 + adds r0, r2, 0 + bl move_anim_8072740 +_081029B0: + pop {r0} + bx r0 + thumb_func_end sub_810296C + + thumb_func_start sub_81029B4 +sub_81029B4: @ 81029B4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _08102A44 + adds r6, r0, r1 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x8] + ldr r0, _08102A48 + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0xA] + movs r1, 0xA + ldrsh r0, [r6, r1] + lsls r0, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r3, r0, 16 + ldr r2, _08102A4C + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + lsls r4, r0, 4 + movs r5, 0x1 + ldr r2, _08102A50 +_08102A0C: + adds r1, r3, r5 + lsls r1, 1 + adds r1, r2 + adds r0, r4, r5 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _08102A0C + adds r0, r3, 0 + movs r1, 0x10 + movs r2, 0xB + movs r3, 0 + bl pal_fade_1 + movs r0, 0 + strh r0, [r6, 0xE] + movs r5, 0 + ldr r7, _08102A4C + movs r1, 0x1C + adds r1, r7 + mov r9, r1 + b _08102A88 + .align 2, 0 +_08102A44: .4byte 0x03005e00 +_08102A48: .4byte 0x00002771 +_08102A4C: .4byte 0x02020630 +_08102A50: .4byte 0x02037714 +_08102A54: + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r7 + ldrb r1, [r6, 0xA] + lsls r1, 4 + ldrb r3, [r4, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0 + strh r0, [r4, 0x2E] + lsls r0, r5, 7 + strh r0, [r4, 0x30] + mov r0, r8 + strh r0, [r4, 0x32] + add r2, r9 + ldr r0, _08102ABC + str r0, [r2] + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_08102A88: + cmp r5, 0x1 + bhi _08102A9A + movs r0, 0 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08102A54 +_08102A9A: + ldr r0, _08102AC0 + str r0, [r6] + ldr r0, _08102AC4 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102AC8 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl lcd_io_clear_bits + b _08102AD2 + .align 2, 0 +_08102ABC: .4byte sub_8102B3C + 1 +_08102AC0: .4byte sub_8102AE0 + 1 +_08102AC4: .4byte 0x02038436 +_08102AC8: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_clear_bits +_08102AD2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81029B4 + + thumb_func_start sub_8102AE0 +sub_8102AE0: @ 8102AE0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08102B14 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08102B32 + ldr r0, _08102B18 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102B1C + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl lcd_io_set_bits + b _08102B26 + .align 2, 0 +_08102B14: .4byte 0x03005e00 +_08102B18: .4byte 0x02038436 +_08102B1C: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_set_bits +_08102B26: + ldr r0, _08102B38 + bl gpu_pal_free_tag + adds r0, r4, 0 + bl move_anim_task_del +_08102B32: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08102B38: .4byte 0x00002771 + thumb_func_end sub_8102AE0 + + thumb_func_start sub_8102B3C +sub_8102B3C: @ 8102B3C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08102B58 + movs r0, 0 + strh r0, [r5, 0x34] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_08102B58: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x40 + ble _08102B80 + ldr r2, _08102B7C + movs r0, 0x32 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0xE] + subs r1, 0x1 + strh r1, [r0, 0xE] + adds r0, r5, 0 + bl obj_delete_but_dont_free_vram + b _08102BC2 + .align 2, 0 +_08102B7C: .4byte 0x03005e00 +_08102B80: + ldr r4, _08102BC8 + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x6 + bl __divsi3 + strh r0, [r5, 0x36] + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0xD + bl __divsi3 + strh r0, [r5, 0x38] + ldrh r1, [r5, 0x30] + adds r1, r0 + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x30] + movs r1, 0x30 + ldrsh r0, [r5, r1] + movs r2, 0x36 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] +_08102BC2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08102BC8: .4byte 0x08329f40 + thumb_func_end sub_8102B3C + + thumb_func_start sub_8102BCC +sub_8102BCC: @ 8102BCC + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08102BE0 + bl oamt_set_x3A_32 + ldr r0, _08102BE4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08102BE0: .4byte move_anim_8072740 + 1 +_08102BE4: .4byte sub_80A67D8 + 1 + thumb_func_end sub_8102BCC + + thumb_func_start sub_8102BE8 +sub_8102BE8: @ 8102BE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r4, _08102C98 + ldrh r0, [r4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + beq _08102C2C + lsls r0, r3, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r3, r0, 16 + movs r2, 0x1 + ldr r5, _08102C9C +_08102C14: + adds r1, r3, r2 + lsls r1, 1 + adds r1, r5 + lsls r0, r2, 1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _08102C14 +_08102C2C: + movs r4, 0x1 + ldr r0, _08102C98 + mov r8, r0 +_08102C32: + lsls r0, r4, 1 + adds r0, r4 + lsls r5, r0, 2 + mov r1, r8 + adds r0, r5, r1 + ldrh r0, [r0] + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, 0x1 + mov r12, r4 + cmp r3, 0xFF + beq _08102C7A + lsls r0, r3, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r3, r0, 16 + movs r2, 0x1 + ldr r7, _08102C9C + ldr r6, _08102C98 + adds r4, r5, 0 +_08102C60: + adds r1, r3, r2 + lsls r1, 1 + adds r1, r7 + lsls r0, r2, 1 + adds r0, r4 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _08102C60 +_08102C7A: + mov r1, r12 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08102C32 + mov r0, r9 + bl move_anim_task_del + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08102C98: .4byte 0x08593020 +_08102C9C: .4byte 0x02037b14 + thumb_func_end sub_8102BE8 + + thumb_func_start sub_8102CA0 +sub_8102CA0: @ 8102CA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0x1 + ldr r6, _08102CD0 +_08102CAA: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrh r0, [r0] + bl gpu_pal_free_tag + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08102CAA + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08102CD0: .4byte 0x08593020 + thumb_func_end sub_8102CA0 + + thumb_func_start sub_8102CD4 +sub_8102CD4: @ 8102CD4 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + bl sub_80A6838 + ldr r4, _08102D2C + ldrb r1, [r4] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r2, _08102D30 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08102D10 + lsls r2, r0, 4 + ldrb r1, [r5, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] +_08102D10: + ldrh r0, [r4, 0x2] + movs r1, 0 + strh r0, [r5, 0x30] + strh r1, [r5, 0x32] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x34] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08102D34 + movs r6, 0x30 + movs r3, 0x28 + b _08102D4E + .align 2, 0 +_08102D2C: .4byte 0x0203841e +_08102D30: .4byte 0x08593020 +_08102D34: + ldr r4, _08102D84 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r3, r0, 24 +_08102D4E: + ldrh r0, [r5, 0x20] + lsls r1, r0, 4 + strh r1, [r5, 0x36] + ldrh r1, [r5, 0x22] + lsls r2, r1, 4 + strh r2, [r5, 0x38] + subs r0, r6, r0 + lsls r0, 16 + asrs r0, 16 + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + adds r2, r5, 0 + adds r2, 0x3A + adds r3, r5, 0 + adds r3, 0x3C + movs r4, 0x28 + str r4, [sp] + bl sub_8102D8C + ldr r0, _08102D88 + str r0, [r5, 0x1C] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08102D84: .4byte 0x02038437 +_08102D88: .4byte sub_8102DE4 + 1 + thumb_func_end sub_8102CD4 + + thumb_func_start sub_8102D8C +sub_8102D8C: @ 8102D8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r2, 0 + mov r8, r3 + ldr r2, [sp, 0x18] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r1, r2, 24 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bge _08102DAE + lsls r0, r1, 24 + negs r0, r0 + lsrs r1, r0, 24 +_08102DAE: + lsls r5, r2, 8 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl __divsi3 + adds r4, r0, 0 + cmp r4, 0 + bne _08102DC2 + movs r4, 0x1 +_08102DC2: + adds r0, r5, 0 + adds r1, r4, 0 + bl __divsi3 + strh r0, [r7] + lsls r0, r6, 16 + asrs r0, 8 + adds r1, r4, 0 + bl __divsi3 + mov r1, r8 + strh r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8102D8C + + thumb_func_start sub_8102DE4 +sub_8102DE4: @ 8102DE4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x2E] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r1, r0, r1 + adds r0, r1, 0 + cmp r1, 0 + bge _08102E00 + adds r0, 0xFF +_08102E00: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + ldrh r1, [r4, 0x3A] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + ldrh r2, [r4, 0x3C] + ldrh r3, [r4, 0x38] + adds r2, r3 + strh r2, [r4, 0x38] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x20] + lsls r2, 16 + asrs r2, 20 + strh r2, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xF + bl sine + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + ldrh r0, [r4, 0x20] + adds r0, 0x10 + lsls r0, 16 + movs r1, 0x88 + lsls r1, 17 + cmp r0, r1 + bhi _08102E4E + lsls r0, r2, 16 + asrs r1, r0, 16 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _08102E4E + cmp r1, 0x80 + ble _08102E56 +_08102E4E: + adds r0, r4, 0 + bl move_anim_8074EE0 + b _08102EA6 +_08102E56: + movs r0, 0x34 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _08102EA6 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, r1 + ble _08102EA6 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08102E7E + strh r5, [r4, 0x30] +_08102E7E: + ldr r2, _08102EAC + movs r3, 0x30 + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08102EA6 + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] +_08102EA6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08102EAC: .4byte 0x08593020 + thumb_func_end sub_8102DE4 + + thumb_func_start sub_8102EB0 +sub_8102EB0: @ 8102EB0 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r7, _08102F34 + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102ECE + ldr r1, _08102F38 + movs r2, 0x2 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x2] +_08102ECE: + ldrb r0, [r7] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _08102F38 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + movs r5, 0 + strh r0, [r6, 0x20] + ldrb r0, [r7] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r6, 0x22] + ldrb r1, [r4] + adds r0, r6, 0 + bl obj_anim_image_start + strh r5, [r6, 0x32] + strh r5, [r6, 0x34] + ldrh r0, [r6, 0x20] + lsls r0, 4 + strh r0, [r6, 0x36] + ldrh r0, [r6, 0x22] + lsls r0, 4 + strh r0, [r6, 0x38] + movs r1, 0x2 + ldrsh r0, [r4, r1] + lsls r0, 4 + movs r1, 0x5 + bl __divsi3 + strh r0, [r6, 0x3A] + movs r2, 0x4 + ldrsh r0, [r4, r2] + lsls r0, 7 + movs r1, 0x5 + bl __divsi3 + strh r0, [r6, 0x3C] + ldr r0, _08102F3C + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08102F34: .4byte 0x02038436 +_08102F38: .4byte 0x0203841e +_08102F3C: .4byte sub_8102F40 + 1 + thumb_func_end sub_8102EB0 + + thumb_func_start sub_8102F40 +sub_8102F40: @ 8102F40 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x36] + adds r0, r1 + strh r0, [r4, 0x36] + ldrh r1, [r4, 0x3C] + ldrh r2, [r4, 0x38] + adds r1, r2 + strh r1, [r4, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x22] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _08102F9E + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08102F9E + ldrh r0, [r4, 0x32] + adds r0, 0x10 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x12 + bl cosine + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x12 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08102F9E + movs r0, 0x1 + strh r0, [r4, 0x34] +_08102F9E: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x30 + bne _08102FB2 + adds r0, r4, 0 + bl move_anim_8074EE0 +_08102FB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8102F40 + + thumb_func_start sub_8102FB8 +sub_8102FB8: @ 8102FB8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _08102FD8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _08102FDC + ldrb r0, [r5, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r5, 0x3] + movs r6, 0x10 + b _08102FDE + .align 2, 0 +_08102FD8: .4byte 0x0203841e +_08102FDC: + ldr r6, _08103018 +_08102FDE: + ldr r4, _0810301C + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x8 + strh r0, [r5, 0x22] + movs r0, 0x8 + strh r0, [r5, 0x2E] + ldr r0, _08103020 + str r0, [r5, 0x1C] + ldr r1, _08103024 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08103018: .4byte 0x0000fff0 +_0810301C: .4byte 0x02038436 +_08103020: .4byte sub_80A64B0 + 1 +_08103024: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8102FB8 + + thumb_func_start sub_8103028 +sub_8103028: @ 8103028 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldrh r0, [r4, 0x22] + adds r0, 0x8 + strh r0, [r4, 0x22] + ldr r5, _081030A0 + ldrb r1, [r5, 0x2] + adds r0, r4, 0 + bl obj_anim_image_start + ldr r2, _081030A4 + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08103068 + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] +_08103068: + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0x20 + cmp r0, 0 + bne _08103074 + ldr r2, _081030A8 +_08103074: + movs r0, 0x28 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x20] + strh r1, [r4, 0x30] + lsls r0, r2, 16 + asrs r0, 16 + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + subs r0, 0x28 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x38] + ldr r0, _081030AC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081030A0: .4byte 0x0203841e +_081030A4: .4byte 0x08593020 +_081030A8: .4byte 0x0000ffe0 +_081030AC: .4byte sub_81030B0 + 1 + thumb_func_end sub_8103028 + + thumb_func_start sub_81030B0 +sub_81030B0: @ 81030B0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _08103100 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r2, [r4, 0x24] + movs r3, 0x24 + ldrsh r0, [r4, r3] + cmp r0, 0 + bge _081030DC + lsls r0, r1, 16 + negs r0, r0 + lsrs r1, r0, 16 +_081030DC: + lsls r0, r1, 16 + asrs r0, 16 + adds r0, r2 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + ldrh r3, [r4, 0x26] + adds r0, r3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _08103106 +_08103100: + adds r0, r4, 0 + bl move_anim_8072740 +_08103106: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81030B0 + + thumb_func_start sub_810310C +sub_810310C: @ 810310C + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810312C + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + adds r0, 0x8 + b _08103136 +_0810312C: + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + subs r0, 0x8 +_08103136: + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08103158 + adds r0, 0x3 +_08103158: + asrs r0, 2 + subs r0, r4, r0 + strh r0, [r6, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810310C + + thumb_func_start sub_8103164 +sub_8103164: @ 8103164 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _08103178 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08103180 + ldr r0, _0810317C + b _08103182 + .align 2, 0 +_08103178: .4byte 0x0203841e +_0810317C: .4byte 0x02038436 +_08103180: + ldr r0, _081031C0 +_08103182: + ldrb r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_810310C + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + ldr r0, _081031C4 + ldrh r0, [r0, 0x2] + strh r0, [r5, 0x2E] + adds r0, r1, 0x2 + strh r0, [r5, 0x30] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r1, _081031C8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _081031CC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081031C0: .4byte 0x02038437 +_081031C4: .4byte 0x0203841e +_081031C8: .4byte sub_81031D0 + 1 +_081031CC: .4byte sub_80A67D8 + 1 + thumb_func_end sub_8103164 + + thumb_func_start sub_81031D0 +sub_81031D0: @ 81031D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _081031F8 + ldr r1, _08103200 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _08103204 + str r0, [r4, 0x1C] +_081031F8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08103200: .4byte move_anim_8072740 + 1 +_08103204: .4byte sub_80A67D8 + 1 + thumb_func_end sub_81031D0 + + thumb_func_start sub_8103208 +sub_8103208: @ 8103208 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810321C + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08103224 + ldr r0, _08103220 + b _08103226 + .align 2, 0 +_0810321C: .4byte 0x0203841e +_08103220: .4byte 0x02038436 +_08103224: + ldr r0, _08103244 +_08103226: + ldrb r0, [r0] + adds r1, r4, 0 + bl sub_810310C + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r1, _08103248 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0810324C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08103244: .4byte 0x02038437 +_08103248: .4byte sub_8103250 + 1 +_0810324C: .4byte sub_80A67BC + 1 + thumb_func_end sub_8103208 + + thumb_func_start sub_8103250 +sub_8103250: @ 8103250 + 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, 0x10 + ble _08103276 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r1, _0810327C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08103280 + str r0, [r4, 0x1C] +_08103276: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810327C: .4byte move_anim_8074EE0 + 1 +_08103280: .4byte sub_80A67BC + 1 + thumb_func_end sub_8103250 + + thumb_func_start sub_8103284 +sub_8103284: @ 8103284 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, _08103298 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081032A0 + ldr r0, _0810329C + b _081032A2 + .align 2, 0 +_08103298: .4byte 0x0203841e +_0810329C: .4byte 0x02038436 +_081032A0: + ldr r0, _081032F4 +_081032A2: + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + strh r0, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bgt _081032CA + movs r0, 0xA + strh r0, [r4, 0x22] +_081032CA: + movs r0, 0x1 + strh r0, [r4, 0x2E] + strh r6, [r4, 0x30] + adds r1, r4, 0 + adds r1, 0x43 + ldrb r0, [r1] + strh r0, [r4, 0x32] + ldrb r0, [r1] + adds r0, 0x4 + strh r0, [r4, 0x34] + strh r6, [r4, 0x36] + ldr r1, _081032F8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _081032FC + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081032F4: .4byte 0x02038437 +_081032F8: .4byte sub_8103300 + 1 +_081032FC: .4byte sub_80A67BC + 1 + thumb_func_end sub_8103284 + + thumb_func_start sub_8103300 +sub_8103300: @ 8103300 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x36] + adds r0, 0x1 + strh r0, [r1, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _08103316 + ldr r0, _0810331C + str r0, [r1, 0x1C] +_08103316: + pop {r0} + bx r0 + .align 2, 0 +_0810331C: .4byte sub_8103320 + 1 + thumb_func_end sub_8103300 + + thumb_func_start sub_8103320 +sub_8103320: @ 8103320 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0x4 + strh r1, [r2, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFE + ble _08103352 + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0810334C + strh r0, [r2, 0x24] + ldr r0, _08103348 + str r0, [r2, 0x1C] + b _08103388 + .align 2, 0 +_08103348: .4byte sub_8103250 + 1 +_0810334C: + movs r0, 0xFF + ands r1, r0 + strh r1, [r2, 0x30] +_08103352: + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0x4F + ble _08103362 + ldrh r0, [r2, 0x34] + adds r1, r2, 0 + adds r1, 0x43 + strb r0, [r1] +_08103362: + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r0, 0x9F + ble _08103372 + ldrh r0, [r2, 0x32] + adds r1, r2, 0 + adds r1, 0x43 + strb r0, [r1] +_08103372: + ldr r1, _0810338C + movs r3, 0x30 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + asrs r1, r0, 1 + adds r0, r1 + strh r0, [r2, 0x24] +_08103388: + pop {r0} + bx r0 + .align 2, 0 +_0810338C: .4byte 0x08329f40 + thumb_func_end sub_8103320 + + thumb_func_start sub_8103390 +sub_8103390: @ 8103390 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _081033A4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081033AC + ldr r0, _081033A8 + b _081033AE + .align 2, 0 +_081033A4: .4byte 0x0203841e +_081033A8: .4byte 0x02038436 +_081033AC: + ldr r0, _081033D0 +_081033AE: + ldrb r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_810310C + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081033D4 + adds r0, r5, 0 + movs r1, 0 + bl obj_anim_image_start + movs r0, 0x2 + b _081033DE + .align 2, 0 +_081033D0: .4byte 0x02038437 +_081033D4: + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start + movs r0, 0x3 +_081033DE: + strh r0, [r5, 0x2E] + ldr r0, _081033EC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081033EC: .4byte sub_81033F0 + 1 + thumb_func_end sub_8103390 + + thumb_func_start sub_81033F0 +sub_81033F0: @ 81033F0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _0810341E + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldr r1, _08103424 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08103428 + str r0, [r4, 0x1C] +_0810341E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08103424: .4byte sub_810342C + 1 +_08103428: .4byte sub_80A67D8 + 1 + thumb_func_end sub_81033F0 + + thumb_func_start sub_810342C +sub_810342C: @ 810342C + 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, 0x5 + ble _08103444 + adds r0, r1, 0 + bl move_anim_8072740 +_08103444: + pop {r0} + bx r0 + thumb_func_end sub_810342C + + thumb_func_start sub_8103448 +sub_8103448: @ 8103448 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r5, _0810348C + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x32] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x34] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x36] + ldr r1, _08103490 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, _08103494 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810348C: .4byte 0x0203841e +_08103490: .4byte move_anim_8074EE0 + 1 +_08103494: .4byte sub_80A6450 + 1 + thumb_func_end sub_8103448 + + thumb_func_start sub_8103498 +sub_8103498: @ 8103498 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081034AC + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081034B4 + ldr r0, _081034B0 + b _081034B6 + .align 2, 0 +_081034AC: .4byte 0x0203841e +_081034B0: .4byte 0x02038436 +_081034B4: + ldr r0, _081034D0 +_081034B6: + ldrb r0, [r0] + adds r1, r4, 0 + bl sub_810310C + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x30] + ldr r0, _081034D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081034D0: .4byte 0x02038437 +_081034D4: .4byte sub_81034D8 + 1 + thumb_func_end sub_8103498 + + thumb_func_start sub_81034D8 +sub_81034D8: @ 81034D8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0810350A + cmp r0, 0x1 + bgt _081034EE + cmp r0, 0 + beq _081034F4 + b _08103538 +_081034EE: + cmp r0, 0x2 + beq _08103524 + b _08103538 +_081034F4: + ldrh r0, [r1, 0x26] + subs r0, 0x3 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _08103538 + b _0810351C +_0810350A: + ldrh r0, [r1, 0x26] + adds r0, 0x3 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _08103538 +_0810351C: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _08103538 +_08103524: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08103538 + adds r0, r1, 0 + bl move_anim_8072740 +_08103538: + pop {r0} + bx r0 + thumb_func_end sub_81034D8 + + thumb_func_start sub_810353C +sub_810353C: @ 810353C + push {r4,lr} + adds r4, r0, 0 + ldr r3, _08103588 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x30] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x30] + movs r0, 0x2E + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _0810357A + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_8074EE0 +_0810357A: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08103588: .4byte 0x02020630 + thumb_func_end sub_810353C + + thumb_func_start sub_810358C +sub_810358C: @ 810358C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _081035D4 + 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] + ldr r1, _081035D8 + ldr r0, _081035DC + ldrb r0, [r0] + adds r0, r1 + ldrb r6, [r0] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081035E4 + ldr r0, _081035E0 + ldrh r1, [r5, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r5, 0x20] + adds r1, r0, 0 + b _081035EE + .align 2, 0 +_081035D4: .4byte 0x02038436 +_081035D8: .4byte 0x020241e4 +_081035DC: .4byte 0x02038437 +_081035E0: .4byte 0x0203841e +_081035E4: + ldr r1, _08103618 + ldrh r0, [r1] + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] +_081035EE: + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + strh r6, [r5, 0x32] + ldr r0, _0810361C + str r0, [r5, 0x1C] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08103618: .4byte 0x0203841e +_0810361C: .4byte sub_810353C + 1 + thumb_func_end sub_810358C + + thumb_func_start sub_8103620 +sub_8103620: @ 8103620 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, _0810364C + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x38] + ldr r0, _08103650 + str r0, [r4, 0x1C] + ldr r1, _08103654 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810364C: .4byte 0x0203841e +_08103650: .4byte sub_80A64B0 + 1 +_08103654: .4byte sub_8103658 + 1 + thumb_func_end sub_8103620 + + thumb_func_start sub_8103658 +sub_8103658: @ 8103658 + push {lr} + ldrh r1, [r0, 0x30] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x32] + ldrh r1, [r0, 0x22] + adds r1, 0xF + strh r1, [r0, 0x36] + ldr r1, _08103678 + str r1, [r0, 0x1C] + ldr r1, _0810367C + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_08103678: .4byte sub_80A6EEC + 1 +_0810367C: .4byte sub_8103680 + 1 + thumb_func_end sub_8103658 + + thumb_func_start sub_8103680 +sub_8103680: @ 8103680 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x38] + movs r3, 0x38 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08103696 + adds r0, r1, 0 + bl move_anim_8072740 + b _0810369A +_08103696: + subs r0, r2, 0x1 + strh r0, [r1, 0x38] +_0810369A: + pop {r0} + bx r0 + thumb_func_end sub_8103680 + + thumb_func_start sub_81036A0 +sub_81036A0: @ 81036A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081036CC + ldr r0, _081036D0 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A7270 + ldr r1, _081036D4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081036D8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081036CC: .4byte 0x020241e4 +_081036D0: .4byte 0x02038436 +_081036D4: .4byte 0x03005e00 +_081036D8: .4byte sub_81036DC + 1 + thumb_func_end sub_81036A0 + + thumb_func_start sub_81036DC +sub_81036DC: @ 81036DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0810370C + ldr r0, _08103710 + ldrb r0, [r0] + adds r1, r0, r1 + ldrb r4, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08103718 + ldr r1, _08103714 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + negs r0, r0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r6, r2, 0 + b _08103726 + .align 2, 0 +_0810370C: .4byte 0x020241e4 +_08103710: .4byte 0x02038436 +_08103714: .4byte 0x03005e00 +_08103718: + ldr r2, _08103758 + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r0, r2 + ldrh r3, [r0, 0x8] + adds r6, r1, 0 +_08103726: + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + bl obj_id_set_rotscale + ldr r1, _08103758 + adds r0, r6, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08103760 + ldrh r0, [r1, 0x8] + adds r0, 0xB0 + strh r0, [r1, 0x8] + ldr r1, _0810375C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + adds r1, 0x1 + b _0810378A + .align 2, 0 +_08103758: .4byte 0x03005e00 +_0810375C: .4byte 0x02020630 +_08103760: + cmp r0, 0x1 + bne _08103776 + ldrh r0, [r1, 0xE] + adds r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + bne _081037D0 + movs r0, 0x2 + b _081037CE +_08103776: + ldrh r0, [r1, 0x8] + subs r0, 0xB0 + strh r0, [r1, 0x8] + ldr r1, _081037C4 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + subs r1, 0x1 +_0810378A: + strh r1, [r0, 0x26] + adds r0, r4, 0 + bl sub_80A73A0 + ldr r0, _081037C8 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r2, [r1, r3] + movs r0, 0xF2 + lsls r0, 4 + cmp r2, r0 + beq _081037AA + cmp r2, 0 + bne _081037D0 +_081037AA: + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x2 + bne _081037CC + adds r0, r4, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del + b _081037D0 + .align 2, 0 +_081037C4: .4byte 0x02020630 +_081037C8: .4byte 0x03005e00 +_081037CC: + adds r0, r2, 0x1 +_081037CE: + strh r0, [r1, 0xA] +_081037D0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81036DC + + thumb_func_start sub_81037D8 +sub_81037D8: @ 81037D8 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, _081037FC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08103804 + ldr r0, _08103800 + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + adds r5, r0, 0 + b _08103810 + .align 2, 0 +_081037FC: .4byte 0x02038436 +_08103800: .4byte 0x0203841e +_08103804: + ldr r1, _08103844 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r5, r1, 0 +_08103810: + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, _08103848 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810384C + adds r3, r4, 0 + adds r3, 0x3F + ldrb r0, [r3] + movs r1, 0x1 + adds r2, r0, 0 + orrs r2, r1 + strb r2, [r3] + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08103860 + movs r0, 0x2 + orrs r2, r0 + strb r2, [r3] + b _08103860 + .align 2, 0 +_08103844: .4byte 0x0203841e +_08103848: .4byte 0x02038436 +_0810384C: + movs r2, 0x4 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08103860 + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] +_08103860: + ldr r0, _08103874 + str r0, [r4, 0x1C] + ldr r1, _08103878 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08103874: .4byte sub_80A67D8 + 1 +_08103878: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81037D8 + + thumb_func_start sub_810387C +sub_810387C: @ 810387C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, _08103898 + str r0, [r4, 0x1C] + ldr r1, _0810389C + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08103898: .4byte sub_80A67BC + 1 +_0810389C: .4byte sub_81038A0 + 1 + thumb_func_end sub_810387C + + thumb_func_start sub_81038A0 +sub_81038A0: @ 81038A0 + push {lr} + movs r1, 0x6 + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x32] + ldrh r1, [r0, 0x22] + subs r1, 0x20 + strh r1, [r0, 0x36] + ldr r1, _081038C0 + str r1, [r0, 0x1C] + ldr r1, _081038C4 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_081038C0: .4byte sub_80A6EEC + 1 +_081038C4: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81038A0 + + thumb_func_start sub_81038C8 +sub_81038C8: @ 81038C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081038EC + ldr r1, _081038E8 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + b _0810390E + .align 2, 0 +_081038E8: .4byte 0x0203841e +_081038EC: + ldr r0, _081039B4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810390E + ldr r1, _081039B8 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] +_0810390E: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r4, _081039BC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r6, _081039B8 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r6, 0x6] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + adds r7, r0, 0 + ldrh r1, [r5, 0x20] + mov r2, r8 + lsls r0, r2, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r5, 0x22] + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 24 + adds r0, r1 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08103980 + ldr r2, _081039C0 + adds r0, r4, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_08103980: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + mov r0, r8 + strh r0, [r5, 0x32] + strh r7, [r5, 0x36] + ldr r0, _081039C4 + str r0, [r5, 0x1C] + ldr r1, _081039C8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081039B4: .4byte 0x02038436 +_081039B8: .4byte 0x0203841e +_081039BC: .4byte 0x02038437 +_081039C0: .4byte 0xffffa000 +_081039C4: .4byte sub_80A6EEC + 1 +_081039C8: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81038C8 + + thumb_func_start sub_81039CC +sub_81039CC: @ 81039CC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + subs r1, r0, 0x1 + strh r1, [r3, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _081039F6 + ldr r2, _081039FC + movs r0, 0x3C + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0xA] + subs r1, 0x1 + strh r1, [r0, 0xA] + adds r0, r3, 0 + bl obj_delete_and_free_tiles +_081039F6: + pop {r0} + bx r0 + .align 2, 0 +_081039FC: .4byte 0x03005e00 + thumb_func_end sub_81039CC + + thumb_func_start sub_8103A00 +sub_8103A00: @ 8103A00 + push {r4,lr} + adds r2, r0, 0 + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _08103A30 + adds r4, r0, r1 + movs r3, 0x2E + ldrsh r1, [r2, r3] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _08103A34 + ldrh r0, [r2, 0x34] + ldrh r1, [r2, 0x38] + adds r0, r1 + strh r0, [r2, 0x38] + ldrh r0, [r2, 0x36] + ldrh r3, [r2, 0x3A] + adds r0, r3 + b _08103A42 + .align 2, 0 +_08103A30: .4byte 0x03005e00 +_08103A34: + ldrh r0, [r2, 0x38] + ldrh r1, [r2, 0x34] + subs r0, r1 + strh r0, [r2, 0x38] + ldrh r0, [r2, 0x3A] + ldrh r1, [r2, 0x36] + subs r0, r1 +_08103A42: + strh r0, [r2, 0x3A] + ldrh r0, [r2, 0x38] + ldrh r1, [r2, 0x30] + adds r3, r0, r1 + strh r3, [r2, 0x30] + ldrh r0, [r2, 0x3A] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r1, [r4, 0x16] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103A66 + lsls r0, r3, 16 + lsrs r0, 24 + negs r0, r0 + b _08103A6A +_08103A66: + lsls r0, r3, 16 + lsrs r0, 24 +_08103A6A: + strh r0, [r2, 0x24] + ldrh r1, [r4, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103A7E + ldrh r0, [r2, 0x32] + lsrs r0, 8 + negs r0, r0 + b _08103A82 +_08103A7E: + ldrh r0, [r2, 0x32] + lsrs r0, 8 +_08103A82: + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + subs r1, r0, 0x1 + strh r1, [r2, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _08103A98 + movs r0, 0x1E + strh r0, [r2, 0x2E] + ldr r0, _08103AA0 + str r0, [r2, 0x1C] +_08103A98: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08103AA0: .4byte sub_81039CC + 1 + thumb_func_end sub_8103A00 + + thumb_func_start sub_8103AA4 +sub_8103AA4: @ 8103AA4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r0, 0x3C + ldrsh r1, [r7, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _08103AE8 + adds r6, r0, r1 + ldrh r2, [r6, 0x16] + movs r1, 0x2 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + ldrh r3, [r7, 0x30] + adds r2, r0, r3 + strh r2, [r7, 0x30] + ldrh r0, [r6, 0x18] + ands r1, r0 + ldrh r0, [r7, 0x32] + adds r1, r0 + strh r1, [r7, 0x32] + ldrh r1, [r6, 0x16] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103AEC + lsls r0, r2, 16 + lsrs r0, 24 + negs r0, r0 + b _08103AF0 + .align 2, 0 +_08103AE8: .4byte 0x03005e00 +_08103AEC: + lsls r0, r2, 16 + lsrs r0, 24 +_08103AF0: + strh r0, [r7, 0x24] + ldrh r1, [r6, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103B04 + ldrh r0, [r7, 0x32] + lsrs r0, 8 + negs r0, r0 + b _08103B08 +_08103B04: + ldrh r0, [r7, 0x32] + lsrs r0, 8 +_08103B08: + strh r0, [r7, 0x26] + ldrh r0, [r7, 0x2E] + subs r1, r0, 0x1 + strh r1, [r7, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _08103BD4 + movs r4, 0 + movs r0, 0x8 + strh r0, [r7, 0x2E] + movs r0, 0x4 + strh r0, [r6, 0x12] + movs r0, 0x80 + lsls r0, 5 + bl sub_8151624 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x20] + adds r2, r0, r1 + strh r2, [r7, 0x20] + ldrh r0, [r7, 0x26] + ldrh r3, [r7, 0x22] + adds r0, r3 + strh r0, [r7, 0x22] + strh r4, [r7, 0x26] + strh r4, [r7, 0x24] + ldrh r3, [r6, 0x1E] + movs r0, 0x1E + ldrsh r1, [r6, r0] + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + blt _08103B52 + subs r0, r3, r2 + b _08103B54 +_08103B52: + subs r0, r2, r3 +_08103B54: + lsls r0, 24 + lsrs r4, r0, 16 + ldrh r3, [r6, 0x20] + movs r0, 0x20 + ldrsh r1, [r6, r0] + ldrh r2, [r7, 0x22] + movs r6, 0x22 + ldrsh r0, [r7, r6] + cmp r1, r0 + blt _08103B6C + subs r0, r3, r2 + b _08103B6E +_08103B6C: + subs r0, r2, r3 +_08103B6E: + lsls r0, 24 + lsrs r0, 16 + mov r8, r0 + movs r0, 0 + strh r0, [r7, 0x32] + strh r0, [r7, 0x30] + strh r0, [r7, 0x3A] + strh r0, [r7, 0x38] + lsls r0, r4, 16 + asrs r0, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r5, 0 + bl sub_8151534 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + movs r6, 0xE0 + lsls r6, 1 + adds r0, r6, 0 + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + strh r0, [r7, 0x34] + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + adds r1, r5, 0 + bl sub_8151534 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r6, 0 + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + strh r0, [r7, 0x36] + ldr r0, _08103BE0 + str r0, [r7, 0x1C] +_08103BD4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08103BE0: .4byte sub_8103A00 + 1 + thumb_func_end sub_8103AA4 + + thumb_func_start sub_8103BE4 +sub_8103BE4: @ 8103BE4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08103C08 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08103C02 + adds r0, r2, 0 + bl move_anim_task_del +_08103C02: + pop {r0} + bx r0 + .align 2, 0 +_08103C08: .4byte 0x03005e00 + thumb_func_end sub_8103BE4 + + thumb_func_start sub_8103C0C +sub_8103C0C: @ 8103C0C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _08103C60 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + subs r1, r0, 0x1 + strh r1, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bgt _08103CE0 + ldr r0, _08103C64 + movs r2, 0x1A + ldrsh r1, [r5, r2] + movs r3, 0x1C + ldrsh r2, [r5, r3] + ldrb r3, [r5, 0xC] + ldrb r4, [r5, 0xA] + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r0, 4 + add r0, r12 + lsls r0, 2 + ldr r1, _08103C68 + adds r6, r0, r1 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08103C6C + cmp r0, 0x2 + beq _08103C82 + b _08103C90 + .align 2, 0 +_08103C60: .4byte 0x03005e00 +_08103C64: .4byte 0x085933b0 +_08103C68: .4byte 0x02020630 +_08103C6C: + ldrb r2, [r6, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x18 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x57 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x3] + b _08103C90 +_08103C82: + ldrb r0, [r6, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r6, 0x3] +_08103C90: + ldr r3, _08103CE8 + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 3 + adds r4, r2, r3 + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x14] + subs r0, r1 + strh r0, [r6, 0x2E] + strh r7, [r6, 0x3C] + movs r1, 0xA + ldrsh r0, [r4, r1] + adds r0, 0xD + lsls r0, 1 + adds r0, r2 + adds r3, 0x8 + adds r0, r3 + mov r2, r12 + strh r2, [r0] + ldrh r0, [r4, 0xE] + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0x3F + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x9A + bl audio_play_and_stuff + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0x2 + ble _08103CE0 + ldr r0, _08103CEC + str r0, [r4] +_08103CE0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08103CE8: .4byte 0x03005e00 +_08103CEC: .4byte sub_8103BE4 + 1 + thumb_func_end sub_8103C0C + + thumb_func_start sub_8103CF0 +sub_8103CF0: @ 8103CF0 + 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 + movs r0, 0 + mov r9, r0 + movs r5, 0 + mov r0, sp + mov r1, r9 + strh r1, [r0] + mov r4, sp + adds r4, 0x2 + strh r1, [r4] + bl sub_80A4DF0 + lsls r0, 24 + mov r10, r4 + cmp r0, 0 + beq _08103D5C + ldr r1, _08103D4C + lsls r2, r7, 2 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x10] + ldr r3, _08103D50 + ldrh r0, [r3] + negs r0, r0 + strh r0, [r3] + ldrh r1, [r3, 0x4] + movs r0, 0x1 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _08103D54 + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strh r0, [r3, 0x4] + b _08103DB6 + .align 2, 0 +_08103D4C: .4byte 0x03005e00 +_08103D50: .4byte 0x0203841e +_08103D54: + movs r0, 0x1 + orrs r0, r1 + strh r0, [r3, 0x4] + b _08103DB6 +_08103D5C: + ldr r1, _08103DA0 + ldr r0, _08103DA4 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r7, 2 + mov r8, r2 + cmp r0, 0 + bne _08103DB6 + ldr r1, _08103DA8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0x10] + ldr r2, _08103DAC + ldrh r0, [r2] + negs r0, r0 + strh r0, [r2] + ldrh r0, [r2, 0x2] + negs r0, r0 + strh r0, [r2, 0x2] + ldrh r1, [r2, 0x4] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08103DB0 + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + b _08103DB4 + .align 2, 0 +_08103DA0: .4byte 0x02024076 +_08103DA4: .4byte 0x02038437 +_08103DA8: .4byte 0x03005e00 +_08103DAC: .4byte 0x0203841e +_08103DB0: + movs r0, 0x1 + orrs r0, r1 +_08103DB4: + strh r0, [r2, 0x4] +_08103DB6: + ldr r5, _08103E10 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + ldr r1, _08103E14 + mov r3, r8 + adds r4, r3, r7 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1A] + adds r6, r0, 0 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + mov r9, r0 + ldr r0, _08103E18 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103E20 + ldr r4, _08103E1C + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08103E20 + ldrb r0, [r4] + movs r1, 0 + mov r2, sp + mov r3, r10 + bl sub_80A8924 + b _08103E42 + .align 2, 0 +_08103E10: .4byte 0x02038436 +_08103E14: .4byte 0x03005e00 +_08103E18: .4byte 0x02022fec +_08103E1C: .4byte 0x02038437 +_08103E20: + mov r5, sp + ldr r4, _08103E7C + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r1, r10 + strh r0, [r1] +_08103E42: + mov r4, sp + ldr r0, _08103E80 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + mov r2, sp + ldr r3, _08103E84 + ldrh r0, [r3] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r1, 0x1E] + strh r0, [r4] + ldrh r0, [r3, 0x2] + mov r3, r10 + ldrh r3, [r3] + adds r0, r3 + strh r0, [r1, 0x20] + mov r1, r10 + strh r0, [r1] + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + adds r1, r6, 0 + cmp r0, r1 + blt _08103E88 + subs r0, r2, r1 + b _08103E8A + .align 2, 0 +_08103E7C: .4byte 0x02038437 +_08103E80: .4byte 0x03005e00 +_08103E84: .4byte 0x0203841e +_08103E88: + subs r0, r1, r2 +_08103E8A: + lsls r0, 16 + lsrs r0, 16 + lsls r4, r0, 16 + asrs r4, 16 + ldr r5, _08103F00 + ldrh r1, [r5, 0x4] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + lsls r0, 16 + asrs r0, 16 + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + ldr r2, _08103F04 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r6, r1, r2 + strh r0, [r6, 0x12] + movs r1, 0x12 + ldrsh r0, [r6, r1] + movs r1, 0x80 + bl sub_8151534 + strh r0, [r6, 0x14] + ldrh r0, [r5, 0x4] + strh r0, [r6, 0x16] + mov r2, r10 + ldrh r1, [r2] + movs r3, 0 + ldrsh r0, [r2, r3] + mov r4, r9 + cmp r0, r4 + blt _08103F08 + subs r4, r1, r4 + lsls r4, 16 + asrs r4, 16 + movs r1, 0x12 + ldrsh r0, [r6, r1] + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + strh r1, [r6, 0x18] + b _08103F28 + .align 2, 0 +_08103F00: .4byte 0x0203841e +_08103F04: .4byte 0x03005e00 +_08103F08: + subs r4, r1 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x12 + ldrsh r0, [r6, r2] + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r6, 0x18] +_08103F28: + ldr r1, _08103F68 + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r5, r0, r1 + ldr r4, _08103F6C + ldrh r0, [r4, 0x6] + strh r0, [r5, 0xE] + ldrh r1, [r4, 0x8] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08103F78 + movs r0, 0x80 + eors r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _08103FA0 + ldr r0, _08103F70 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08103F74 + adds r1, r2, 0 + ldrh r4, [r4, 0x8] + adds r1, r4 + adds r0, r1 + b _08103FB0 + .align 2, 0 +_08103F68: .4byte 0x03005e00 +_08103F6C: .4byte 0x0203841e +_08103F70: .4byte 0x02038437 +_08103F74: .4byte 0x0000ffc0 +_08103F78: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _08103FA0 + ldr r0, _08103F98 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08103F9C + adds r1, r3, 0 + ldrh r4, [r4, 0x8] + adds r1, r4 + adds r0, r1 + b _08103FB0 + .align 2, 0 +_08103F98: .4byte 0x02038437 +_08103F9C: .4byte 0x0000ffc0 +_08103FA0: + ldr r0, _08103FDC + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x8] + subs r0, r1 +_08103FB0: + strh r0, [r5, 0xC] + ldr r0, _08103FE0 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x2 + bgt _08103FC8 + movs r0, 0x3 + strh r0, [r1, 0xC] +_08103FC8: + ldr r0, _08103FE4 + 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 + .align 2, 0 +_08103FDC: .4byte 0x02038437 +_08103FE0: .4byte 0x03005e00 +_08103FE4: .4byte sub_8103C0C + 1 + thumb_func_end sub_8103CF0 + + thumb_func_start sub_8103FE8 +sub_8103FE8: @ 8103FE8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, _08104010 + ldrh r0, [r0, 0x2] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0x2E] + ldr r0, _08104014 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104010: .4byte 0x085934a0 +_08104014: .4byte sub_8104018 + 1 + thumb_func_end sub_8103FE8 + + thumb_func_start sub_8104018 +sub_8104018: @ 8104018 + push {r4-r7,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0810407C + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r5, [r4, 0x2E] + ldr r1, _08104084 + adds r0, r5, 0 + adds r0, 0x8 + lsls r0, 1 + adds r0, r1 + ldrh r7, [r0] + adds r6, r1, 0 + adds r1, r5, 0 + adds r1, 0x9 + lsls r0, r5, 1 + adds r0, r6 + adds r2, r0, 0 + adds r2, 0x10 + movs r3, 0x7 + lsls r1, 1 + adds r1, r6 +_08104050: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08104050 + adds r0, r5, 0 + adds r0, 0xF + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + bne _0810407C + adds r0, r4, 0 + bl move_anim_8072740 +_0810407C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08104084: .4byte 0x02037b14 + thumb_func_end sub_8104018 + + thumb_func_start sub_8104088 +sub_8104088: @ 8104088 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r4, _08104128 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _0810412C + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, _08104130 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081040CC + ldrh r0, [r4, 0x4] + negs r0, r0 + strh r0, [r4, 0x4] +_081040CC: + lsls r0, r6, 16 + asrs r0, 16 + ldrh r1, [r4, 0x4] + adds r0, r1 + lsls r0, 16 + ldrh r1, [r5, 0x20] + lsrs r6, r0, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r5, 0x22] + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x2E] + strh r6, [r5, 0x32] + strh r7, [r5, 0x36] + ldr r0, _08104134 + str r0, [r5, 0x1C] + ldr r1, _08104138 + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08104128: .4byte 0x02038437 +_0810412C: .4byte 0x0203841e +_08104130: .4byte 0x02038436 +_08104134: .4byte sub_80A7000 + 1 +_08104138: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8104088 + + thumb_func_start sub_810413C +sub_810413C: @ 810413C + ldr r1, _0810414C + strh r1, [r0, 0x32] + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + ldr r1, _08104150 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_0810414C: .4byte 0x0000fff0 +_08104150: .4byte sub_8104154 + 1 + thumb_func_end sub_810413C + + thumb_func_start sub_8104154 +sub_8104154: @ 8104154 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldr r0, _081041C0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08104178 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] +_08104178: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7E + ble _081041B8 + movs r0, 0 + strh r0, [r4, 0x30] + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _081041B8 + adds r0, r4, 0 + bl move_anim_8072740 +_081041B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081041C0: .4byte 0x02038436 + thumb_func_end sub_8104154 + + thumb_func_start sub_81041C4 +sub_81041C4: @ 81041C4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0x14 + strh r0, [r4, 0x2E] + ldr r5, _08104210 + 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, _08104214 + str r0, [r4, 0x1C] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08104218 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08104210: .4byte 0x02038437 +_08104214: .4byte sub_80A6EEC + 1 +_08104218: .4byte sub_810421C + 1 + thumb_func_end sub_81041C4 + + thumb_func_start sub_810421C +sub_810421C: @ 810421C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xA6 + bl audio_play_and_stuff + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + movs r2, 0 + movs r1, 0x7 + adds r0, r4, 0 + adds r0, 0x3C +_08104250: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08104250 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + ands r0, r1 + ldr r2, _08104298 + adds r1, r2, 0 + subs r1, r0 + strh r1, [r4, 0x3A] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA0 + bl __umodsi3 + adds r0, 0xA0 + strh r0, [r4, 0x3C] + ldr r0, _0810429C + str r0, [r4, 0x1C] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104298: .4byte 0x0000fff4 +_0810429C: .4byte sub_81042A0 + 1 + thumb_func_end sub_810421C + + thumb_func_start sub_81042A0 +sub_81042A0: @ 81042A0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + ldrh r2, [r4, 0x2E] + adds r0, r1, r2 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r2, r0, 24 + strh r2, [r4, 0x24] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081042BE + negs r0, r2 + strh r0, [r4, 0x24] +_081042BE: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x8 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7E + ble _081042FE + movs r0, 0 + strh r0, [r4, 0x30] + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081042FE + adds r0, r4, 0 + bl move_anim_8072740 +_081042FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81042A0 + + thumb_func_start sub_8104304 +sub_8104304: @ 8104304 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, _08104354 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08104322 + ldrh r0, [r4, 0x22] + adds r0, 0x10 + strh r0, [r4, 0x22] +_08104322: + ldr r1, _08104358 + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0xC] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldr r0, _0810435C + str r0, [r4, 0x1C] + ldr r1, _08104360 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104354: .4byte 0x02038436 +_08104358: .4byte 0x0203841e +_0810435C: .4byte sub_80A62EC + 1 +_08104360: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8104304 + + thumb_func_start sub_8104364 +sub_8104364: @ 8104364 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r7, 0x20 + ldr r4, _081043E0 + movs r0, 0x10 + mov r8, r0 + ldr r6, _081043E4 + ldr r0, _081043E8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08104390 + adds r7, r4, 0 + movs r4, 0x20 + mov r8, r6 + movs r6, 0x10 + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start +_08104390: + lsls r0, r7, 16 + asrs r0, 16 + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + movs r0, 0x6 + strh r0, [r5, 0x2E] + ldr r4, _081043EC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + add r0, r8 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x36] + ldr r0, _081043F0 + str r0, [r5, 0x1C] + ldr r1, _081043F4 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081043E0: .4byte 0x0000ffe0 +_081043E4: .4byte 0x0000fff0 +_081043E8: .4byte 0x0203841e +_081043EC: .4byte 0x02038437 +_081043F0: .4byte sub_80A6EEC + 1 +_081043F4: .4byte sub_81043F8 + 1 + thumb_func_end sub_8104364 + + thumb_func_start sub_81043F8 +sub_81043F8: @ 81043F8 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810440E + adds r0, r2, 0 + bl move_anim_8072740 +_0810440E: + pop {r0} + bx r0 + thumb_func_end sub_81043F8 + + thumb_func_start sub_8104414 +sub_8104414: @ 8104414 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r0, 0x20 + mov r8, r0 + ldr r4, _081044A8 + movs r2, 0x10 + mov r9, r2 + ldr r6, _081044AC + ldr r7, _081044B0 + ldrh r1, [r7] + movs r2, 0 + ldrsh r0, [r7, r2] + cmp r0, 0 + beq _08104448 + mov r8, r4 + movs r4, 0x20 + mov r9, r6 + movs r6, 0x10 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start +_08104448: + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + ldrh r2, [r5, 0x20] + adds r1, r2 + strh r1, [r5, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + movs r0, 0x6 + strh r0, [r5, 0x2E] + strh r1, [r5, 0x30] + ldr r4, _081044B4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + add r0, r9 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r7] + strh r0, [r5, 0x38] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x3A] + ldr r0, _081044B8 + str r0, [r5, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081044A8: .4byte 0x0000ffe0 +_081044AC: .4byte 0x0000fff0 +_081044B0: .4byte 0x0203841e +_081044B4: .4byte 0x02038437 +_081044B8: .4byte sub_81044BC + 1 + thumb_func_end sub_8104414 + + thumb_func_start sub_81044BC +sub_81044BC: @ 81044BC + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08104520 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08104520 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_seek + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r2, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x2 + strh r0, [r4, 0x24] + ldr r0, _08104528 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + eors r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x36] + strh r2, [r4, 0x34] + ldr r0, _0810452C + str r0, [r4, 0x1C] +_08104520: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104528: .4byte 0x0000fffe +_0810452C: .4byte sub_8104530 + 1 + thumb_func_end sub_81044BC + + thumb_func_start sub_8104530 +sub_8104530: @ 8104530 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08104548 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] +_08104548: + ldrh r0, [r4, 0x34] + movs r1, 0x1 + eors r0, r1 + movs r1, 0 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0810458A + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x36] + strh r1, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + movs r1, 0x1 + eors r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _08104590 + str r0, [r4, 0x1C] +_0810458A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104590: .4byte sub_8104594 + 1 + thumb_func_end sub_8104530 + + thumb_func_start sub_8104594 +sub_8104594: @ 8104594 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _081045A8 + adds r0, r4, 0 + bl move_anim_8072740 +_081045A8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8104594 + + thumb_func_start sub_81045B0 +sub_81045B0: @ 81045B0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A7270 + adds r0, r4, 0 + movs r1, 0xD0 + movs r2, 0xD0 + movs r3, 0 + bl obj_id_set_rotscale + ldr r1, _08104608 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + movs r1, 0 + bl sub_80A750C + ldr r1, _0810460C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x50 + strh r1, [r0, 0x8] + ldr r1, _08104610 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08104608: .4byte 0x02020630 +_0810460C: .4byte 0x03005e00 +_08104610: .4byte sub_8104614 + 1 + thumb_func_end sub_81045B0 + + thumb_func_start sub_8104614 +sub_8104614: @ 8104614 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0810466C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08104664 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80A7344 + ldr r1, _08104670 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + movs r1, 0x1 + bl sub_80A750C + adds r0, r5, 0 + bl move_anim_task_del +_08104664: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810466C: .4byte 0x03005e00 +_08104670: .4byte 0x02020630 + thumb_func_end sub_8104614 + + thumb_func_start sub_8104674 +sub_8104674: @ 8104674 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081046C0 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x8] + movs r1, 0 + bl sub_80A7270 + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x10] + strh r5, [r4, 0x12] + strh r5, [r4, 0x14] + ldr r0, _081046C4 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + ldr r0, _081046C8 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081046C0: .4byte 0x03005e00 +_081046C4: .4byte 0x02038436 +_081046C8: .4byte sub_81046CC + 1 + thumb_func_end sub_8104674 + + thumb_func_start sub_81046CC +sub_81046CC: @ 81046CC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081046F0 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _081046E6 + b _081047F6 +_081046E6: + lsls r0, 2 + ldr r1, _081046F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081046F0: .4byte 0x03005e00 +_081046F4: .4byte _081046F8 + .align 2, 0 +_081046F8: + .4byte _08104710 + .4byte _08104758 + .4byte _0810478E + .4byte _08104794 + .4byte _081047A4 + .4byte _081047D8 +_08104710: + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08104720 + cmp r0, 0x3 + beq _08104720 + cmp r0, 0x6 + bne _08104728 +_08104720: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8104800 +_08104728: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + adds r0, 0x28 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r1, 0x10 + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A7E6C + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _081047F6 + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + b _081047D0 +_08104758: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081047F6 + movs r2, 0x12 + ldrsh r1, [r4, r2] + cmp r1, 0x3 + bne _0810476E + strh r0, [r4, 0xC] + strh r1, [r4, 0xA] + b _081047F6 +_0810476E: + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r2, 0x80 + lsls r2, 1 + strh r2, [r4, 0x10] + ldrb r0, [r4, 0x8] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A7E6C + movs r0, 0x2 + strh r0, [r4, 0xA] + b _081047F6 +_0810478E: + movs r0, 0 + strh r0, [r4, 0xA] + b _081047F6 +_08104794: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _081047F6 + b _081047CC +_081047A4: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + subs r0, 0x50 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r1, 0x10 + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A7E6C + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _081047F6 +_081047CC: + movs r0, 0 + strh r0, [r4, 0xC] +_081047D0: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _081047F6 +_081047D8: + ldrb r0, [r4, 0x8] + bl sub_80A7344 + ldr r2, _081047FC + 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] + adds r0, r5, 0 + bl move_anim_task_del +_081047F6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081047FC: .4byte 0x02020630 + thumb_func_end sub_81046CC + + thumb_func_start sub_8104800 +sub_8104800: @ 8104800 + 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 r0, 0 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + blt _081048DA + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xFF + bne _08104844 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _08104840 + adds r0, r1 + bl obj_delete_but_dont_free_vram + b _081048DA + .align 2, 0 +_08104840: .4byte 0x02020630 +_08104844: + ldr r5, _081048E8 + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r4, r3, r5 + ldrb r1, [r4, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1F + ands r6, r0 + lsls r2, r6, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrb r0, [r7, 0x16] + ldrb r1, [r7, 0xE] + subs r0, r1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r0, [r7, 0xE] + adds r0, 0x1 + strh r0, [r7, 0xE] + ldrh r0, [r7, 0x14] + adds r0, 0x1 + strh r0, [r7, 0x14] + movs r0, 0x10 + strh r0, [r4, 0x2E] + mov r0, r9 + strh r0, [r4, 0x30] + movs r0, 0x6 + strh r0, [r4, 0x32] + adds r5, 0x1C + adds r3, r5 + ldr r0, _081048EC + str r0, [r3] + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x10 + ldrsh r2, [r7, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x1] + movs r3, 0x4 + negs r3, r3 + ands r3, r0 + movs r0, 0x1 + orrs r3, r0 + strb 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 oam_center +_081048DA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081048E8: .4byte 0x02020630 +_081048EC: .4byte sub_81048F0 + 1 + thumb_func_end sub_8104800 + + thumb_func_start sub_81048F0 +sub_81048F0: @ 81048F0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0810492E + ldr r3, _08104934 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_0810492E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104934: .4byte 0x03005e00 + thumb_func_end sub_81048F0 + + thumb_func_start sub_8104938 +sub_8104938: @ 8104938 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810495C + adds r4, r0, r1 + ldr r5, _08104960 + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08104964 + adds r0, r2, 0 + bl move_anim_task_del + b _0810498A + .align 2, 0 +_0810495C: .4byte 0x03005e00 +_08104960: .4byte 0x0203841e +_08104964: + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + strh r1, [r4, 0x8] + strh r2, [r4, 0xA] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xC] + strh r2, [r4, 0xE] + strh r2, [r4, 0x10] + ldr r2, _08104990 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _08104994 + str r0, [r4] +_0810498A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08104990: .4byte 0x085935e8 +_08104994: .4byte sub_8104998 + 1 + thumb_func_end sub_8104938 + + thumb_func_start sub_8104998 +sub_8104998: @ 8104998 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081049BC + adds r4, r0, r1 + movs r0, 0xA + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _08104A00 + cmp r5, 0x1 + bgt _081049C0 + cmp r5, 0 + beq _081049CA + b _08104AA8 + .align 2, 0 +_081049BC: .4byte 0x03005e00 +_081049C0: + cmp r5, 0x2 + beq _08104A34 + cmp r5, 0x3 + beq _08104A64 + b _08104AA8 +_081049CA: + adds r0, r4, 0 + bl sub_80A7D34 + ldrh r2, [r4, 0x10] + adds r2, 0x3 + strh r2, [r4, 0x10] + ldr r3, _081049FC + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, r2 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08104AA8 + strh r5, [r4, 0xE] + b _08104A5C + .align 2, 0 +_081049FC: .4byte 0x02020630 +_08104A00: + adds r0, r4, 0 + bl sub_80A7D34 + ldr r2, _08104A30 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + ldrh r2, [r0, 0x26] + adds r1, r2 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08104AA8 + movs r0, 0 + strh r0, [r4, 0xE] + b _08104A5C + .align 2, 0 +_08104A30: .4byte 0x02020630 +_08104A34: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08104A5C + ldr r2, _08104A58 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x2 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0x10] + subs r0, 0x2 + strh r0, [r4, 0x10] + b _08104AA8 + .align 2, 0 +_08104A58: .4byte 0x02020630 +_08104A5C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _08104AA8 +_08104A64: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08104AA8 + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _08104A9C + ldr r2, _08104A98 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del + b _08104AA8 + .align 2, 0 +_08104A98: .4byte 0x02020630 +_08104A9C: + ldrb r1, [r4, 0x8] + ldr r2, _08104AB0 + adds r0, r4, 0 + bl sub_80A7CFC + strh r5, [r4, 0xA] +_08104AA8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08104AB0: .4byte 0x085935e8 + thumb_func_end sub_8104998 + + thumb_func_start sub_8104AB4 +sub_8104AB4: @ 8104AB4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _08104AE4 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08104AE8 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _08104AEC + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104AE4: .4byte 0x03005e00 +_08104AE8: .4byte 0x08593608 +_08104AEC: .4byte sub_8104AF0 + 1 + thumb_func_end sub_8104AB4 + + thumb_func_start sub_8104AF0 +sub_8104AF0: @ 8104AF0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08104B18 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08104B10 + adds r0, r4, 0 + bl move_anim_task_del +_08104B10: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104B18: .4byte 0x03005e00 + thumb_func_end sub_8104AF0 + + thumb_func_start sub_8104B1C +sub_8104B1C: @ 8104B1C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08104B4C + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08104B50 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x40 + b _08104B6A + .align 2, 0 +_08104B4C: .4byte 0x02038436 +_08104B50: + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x20 + strh r0, [r4, 0x20] + ldr r0, _08104B9C +_08104B6A: + strh r0, [r4, 0x30] + ldr r0, _08104BA0 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r4, 0x22] + movs r0, 0x34 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + strh r1, [r4, 0x36] + ldr r1, _08104BA4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _08104BA8 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08104B9C: .4byte 0x0000ffc0 +_08104BA0: .4byte 0x02038436 +_08104BA4: .4byte move_anim_8072740 + 1 +_08104BA8: .4byte sub_80A656C + 1 + thumb_func_end sub_8104B1C + + thumb_func_start sub_8104BAC +sub_8104BAC: @ 8104BAC + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, _08104BC0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08104BC8 + ldr r0, _08104BC4 + b _08104BCA + .align 2, 0 +_08104BC0: .4byte 0x0203841e +_08104BC4: .4byte 0x02038436 +_08104BC8: + ldr r0, _08104C28 +_08104BCA: + ldrb r5, [r0] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08104BE4 + ldr r1, _08104C2C + movs r2, 0x2 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x2] +_08104BE4: + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _08104C2C + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x4] + adds r0, r4 + strh r0, [r6, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _08104C16 + movs r0, 0x8 + strh r0, [r6, 0x22] +_08104C16: + ldr r1, _08104C30 + adds r0, r6, 0 + bl oamt_set_x3A_32 + ldr r0, _08104C34 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08104C28: .4byte 0x02038437 +_08104C2C: .4byte 0x0203841e +_08104C30: .4byte move_anim_8074EE0 + 1 +_08104C34: .4byte sub_80A67BC + 1 + thumb_func_end sub_8104BAC + + thumb_func_start sub_8104C38 +sub_8104C38: @ 8104C38 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _08104C6C + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + strh r1, [r4, 0x8] + strh r0, [r4, 0xA] + ldr r2, _08104C70 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _08104C74 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104C6C: .4byte 0x03005e00 +_08104C70: .4byte 0x085936a4 +_08104C74: .4byte sub_8104C78 + 1 + thumb_func_end sub_8104C38 + + thumb_func_start sub_8104C78 +sub_8104C78: @ 8104C78 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08104CA0 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08104C98 + adds r0, r4, 0 + bl move_anim_task_del +_08104C98: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104CA0: .4byte 0x03005e00 + thumb_func_end sub_8104C78 + + thumb_func_start sub_8104CA4 +sub_8104CA4: @ 8104CA4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08104D18 + adds r4, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r4, 0x8] + strh r2, [r4, 0xA] + movs r0, 0x4 + strh r0, [r4, 0xC] + movs r0, 0x7 + strh r0, [r4, 0xE] + movs r0, 0x3 + strh r0, [r4, 0x10] + ldr r3, _08104D1C + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + strh r2, [r4, 0x16] + strh r2, [r4, 0x18] + movs r0, 0x2 + strh r0, [r4, 0x1A] + ldr r0, _08104D20 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08104D0E + movs r1, 0xC + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0xC] +_08104D0E: + ldr r0, _08104D24 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08104D18: .4byte 0x03005e00 +_08104D1C: .4byte 0x02020630 +_08104D20: .4byte 0x02038436 +_08104D24: .4byte sub_8104D28 + 1 + thumb_func_end sub_8104CA4 + + thumb_func_start sub_8104D28 +sub_8104D28: @ 8104D28 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08104D70 + adds r3, r0, r1 + ldrh r0, [r3, 0x16] + adds r0, 0x1 + strh r0, [r3, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08104D8E + movs r0, 0 + strh r0, [r3, 0x16] + ldrh r0, [r3, 0x18] + adds r0, 0x1 + strh r0, [r3, 0x18] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08104D78 + ldr r2, _08104D74 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x1A] + ldrh r2, [r0, 0x22] + adds r1, r2 + b _08104D8C + .align 2, 0 +_08104D70: .4byte 0x03005e00 +_08104D74: .4byte 0x02020630 +_08104D78: + ldr r2, _08104DA0 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + ldrh r2, [r3, 0x1A] + subs r1, r2 +_08104D8C: + strh r1, [r0, 0x22] +_08104D8E: + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _08104DDC + cmp r0, 0x1 + bgt _08104DA4 + cmp r0, 0 + beq _08104DAA + b _08104E6C + .align 2, 0 +_08104DA0: .4byte 0x02020630 +_08104DA4: + cmp r0, 0x2 + beq _08104E0C + b _08104E6C +_08104DAA: + ldr r2, _08104DD8 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0xC] + ldrh r2, [r0, 0x20] + adds r1, r2 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0xE] + subs r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08104E6C + movs r0, 0xE + strh r0, [r3, 0xE] + movs r0, 0x1 + strh r0, [r3, 0xA] + b _08104E6C + .align 2, 0 +_08104DD8: .4byte 0x02020630 +_08104DDC: + ldr r2, _08104E08 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + ldrh r2, [r3, 0xC] + subs r1, r2 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0xE] + subs r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08104E6C + movs r0, 0x7 + strh r0, [r3, 0xE] + movs r0, 0x2 + strh r0, [r3, 0xA] + b _08104E6C + .align 2, 0 +_08104E08: .4byte 0x02020630 +_08104E0C: + ldr r2, _08104E44 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0xC] + ldrh r5, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0xE] + subs r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _08104E6C + ldrh r0, [r3, 0x10] + subs r0, 0x1 + strh r0, [r3, 0x10] + lsls r0, 16 + cmp r0, 0 + beq _08104E48 + movs r0, 0x7 + strh r0, [r3, 0xE] + strh r1, [r3, 0xA] + b _08104E6C + .align 2, 0 +_08104E44: .4byte 0x02020630 +_08104E48: + ldrh r1, [r3, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08104E66 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + ldrh r2, [r3, 0x1A] + subs r1, r2 + strh r1, [r0, 0x22] +_08104E66: + adds r0, r4, 0 + bl move_anim_task_del +_08104E6C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8104D28 + + thumb_func_start sub_8104E74 +sub_8104E74: @ 8104E74 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08104EC4 + adds r5, r1, r0 + ldr r4, _08104EC8 + ldrb r0, [r4] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + movs r1, 0 + strh r0, [r5, 0x8] + movs r0, 0x4 + strh r0, [r5, 0xA] + strh r1, [r5, 0xC] + strh r1, [r5, 0xE] + strh r1, [r5, 0x10] + strh r1, [r5, 0x12] + ldrb r0, [r4] + bl sub_80A861C + strh r0, [r5, 0x26] + ldrb r0, [r4] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08104ED4 + ldr r0, _08104ECC + ldrh r0, [r0] + strh r0, [r5, 0x14] + ldr r0, _08104ED0 + b _08104EDC + .align 2, 0 +_08104EC4: .4byte 0x03005e00 +_08104EC8: .4byte 0x02038437 +_08104ECC: .4byte 0x02022e18 +_08104ED0: .4byte 0x04000014 +_08104ED4: + ldr r0, _08104F40 + ldrh r0, [r0] + strh r0, [r5, 0x14] + ldr r0, _08104F44 +_08104EDC: + str r0, [sp] + ldrh r0, [r5, 0x8] + adds r1, r0, 0 + subs r1, 0x40 + lsls r2, r1, 16 + lsls r0, 16 + cmp r2, r0 + bgt _08104F1A + ldr r4, _08104F48 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r4, r0 +_08104EF4: + asrs r3, r2, 16 + cmp r3, 0 + blt _08104F0C + lsls r1, r3, 1 + adds r2, r1, r4 + ldrh r0, [r5, 0x14] + adds r0, 0xF0 + strh r0, [r2] + adds r1, r6 + ldrh r0, [r5, 0x14] + adds r0, 0xF0 + strh r0, [r1] +_08104F0C: + adds r0, r3, 0x1 + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r3, 0x8 + ldrsh r0, [r5, r3] + cmp r1, r0 + ble _08104EF4 +_08104F1A: + ldr r0, _08104F4C + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, _08104F50 + str r0, [r5] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08104F40: .4byte 0x02022e1c +_08104F44: .4byte 0x04000018 +_08104F48: .4byte 0x02038c28 +_08104F4C: .4byte 0xa2600001 +_08104F50: .4byte sub_8104F54 + 1 + thumb_func_end sub_8104E74 + + thumb_func_start sub_8104F54 +sub_8104F54: @ 8104F54 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08104F74 + adds r3, r0, r1 + movs r1, 0x10 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08104F78 + cmp r0, 0x1 + beq _08104F8E + b _0810500E + .align 2, 0 +_08104F74: .4byte 0x03005e00 +_08104F78: + ldrh r0, [r3, 0x12] + adds r0, 0x1 + strh r0, [r3, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _0810500E + ldrh r0, [r3, 0x10] + adds r0, 0x1 + strh r0, [r3, 0x10] + b _0810500E +_08104F8E: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0810500E + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r1, [r3, 0xE] + movs r0, 0x3 + ands r0, r1 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x8] + subs r0, r1 + strh r0, [r3, 0x12] + movs r2, 0xC + ldrsh r1, [r3, r2] + cmp r1, 0x1 + beq _08104FC4 + cmp r1, 0x1 + ble _08104FCC + cmp r1, 0x2 + beq _08104FC8 + cmp r1, 0x3 + beq _08104FC8 + b _08104FCC +_08104FC4: + subs r0, 0x2 + b _08104FCA +_08104FC8: + adds r0, 0x1 +_08104FCA: + strh r0, [r3, 0x12] +_08104FCC: + movs r1, 0x12 + ldrsh r0, [r3, r1] + cmp r0, 0 + blt _08104FF0 + ldr r2, _08105014 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r3, 0x14] + strh r1, [r0] + movs r1, 0x12 + ldrsh r0, [r3, r1] + lsls r0, 1 + movs r1, 0xF0 + lsls r1, 3 + adds r2, r1 + adds r0, r2 + ldrh r1, [r3, 0x14] + strh r1, [r0] +_08104FF0: + ldrh r0, [r3, 0xE] + adds r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x26 + ldrsh r1, [r3, r2] + cmp r0, r1 + blt _0810500E + ldr r1, _08105018 + movs r0, 0x3 + strb r0, [r1, 0x15] + adds r0, r4, 0 + bl move_anim_task_del +_0810500E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105014: .4byte 0x02038c28 +_08105018: .4byte 0x02039b28 + thumb_func_end sub_8104F54 + + thumb_func_start sub_810501C +sub_810501C: @ 810501C + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _08105070 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + movs r5, 0 + strh r0, [r4, 0x20] + ldrb r0, [r6] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + strh r5, [r4, 0x2E] + strh r5, [r4, 0x30] + strh r5, [r4, 0x32] + movs r0, 0x10 + strh r0, [r4, 0x34] + strh r5, [r4, 0x36] + ldrb r0, [r6] + movs r1, 0 + bl sub_80A861C + adds r0, 0x2 + strh r0, [r4, 0x38] + movs r0, 0x3F + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x3A] + ldr r0, _08105074 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08105070: .4byte 0x02038437 +_08105074: .4byte sub_8105078 + 1 + thumb_func_end sub_810501C + + thumb_func_start sub_8105078 +sub_8105078: @ 8105078 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _081050DC + cmp r1, 0x1 + bgt _0810508E + cmp r1, 0 + beq _08105094 + b _081051BC +_0810508E: + cmp r1, 0x2 + beq _0810516E + b _081051BC +_08105094: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081050BE + strh r1, [r4, 0x32] + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081050BE: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081051BC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + b _08105166 +_081050DC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08105122 + ldrh r2, [r4, 0x32] + movs r3, 0x32 + ldrsh r1, [r4, r3] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08105122 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08105122 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl audio_play_and_stuff +_08105122: + ldrh r0, [r4, 0x34] + ldrh r2, [r4, 0x36] + adds r1, r0, r2 + strh r1, [r4, 0x36] + lsls r0, r1, 16 + asrs r2, r0, 16 + cmp r2, 0x1F + ble _08105136 + movs r0, 0x40 + b _08105144 +_08105136: + movs r0, 0x20 + negs r0, r0 + cmp r2, r0 + bgt _08105150 + movs r2, 0x40 + negs r2, r2 + adds r0, r2, 0 +_08105144: + subs r0, r1 + strh r0, [r4, 0x36] + movs r3, 0x34 + ldrsh r0, [r4, r3] + negs r0, r0 + strh r0, [r4, 0x34] +_08105150: + ldrh r0, [r4, 0x36] + movs r2, 0 + strh r0, [r4, 0x24] + movs r0, 0x38 + ldrsh r1, [r4, r0] + movs r3, 0x32 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _081051BC + strh r2, [r4, 0x30] + strh r2, [r4, 0x32] +_08105166: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081051BC +_0810516E: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810519A + movs r0, 0 + strh r0, [r4, 0x32] + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0810519A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081051BC + 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 + bl move_anim_8072740 +_081051BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8105078 + + thumb_func_start sub_81051C4 +sub_81051C4: @ 81051C4 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + movs r5, 0 + mov r0, sp + strh r5, [r0] + mov r1, sp + adds r1, 0x2 + strh r5, [r1] + ldr r0, _081051E8 + movs r3, 0x4 + ldrsh r2, [r0, r3] + adds r7, r1, 0 + adds r1, r0, 0 + cmp r2, 0 + bne _081051F0 + ldr r0, _081051EC + b _081051F2 + .align 2, 0 +_081051E8: .4byte 0x0203841e +_081051EC: .4byte 0x02038436 +_081051F0: + ldr r0, _0810522C +_081051F2: + ldrb r5, [r0] + ldrb r1, [r1, 0x6] + movs r0, 0x1 + adds r4, r0, 0 + eors r4, r1 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0810526A + movs r1, 0x2 + adds r0, r5, 0 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810526A + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, sp + adds r3, r7, 0 + bl sub_80A8924 + cmp r4, 0 + bne _08105230 + adds r0, r5, 0 + movs r1, 0 + b _08105234 + .align 2, 0 +_0810522C: .4byte 0x02038437 +_08105230: + adds r0, r5, 0 + movs r1, 0x2 +_08105234: + bl sub_80A5C6C + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08105260 + ldr r2, _0810525C + mov r0, sp + ldrh r1, [r0] + subs r1, r4 + ldrh r0, [r2] + subs r1, r0 + subs r0, r1 + strh r0, [r2] + b _0810526A + .align 2, 0 +_0810525C: .4byte 0x0203841e +_08105260: + ldr r1, _0810527C + mov r0, sp + ldrh r0, [r0] + subs r0, r4 + strh r0, [r1] +_0810526A: + ldr r1, _08105280 + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810527C: .4byte 0x0203841e +_08105280: .4byte sub_80A77C8 + 1 + thumb_func_end sub_81051C4 + + thumb_func_start sub_8105284 +sub_8105284: @ 8105284 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810529E + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl move_anim_8072740 +_0810529E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8105284 + + thumb_func_start sub_81052A4 +sub_81052A4: @ 81052A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + movs r6, 0 + mov r0, sp + strh r6, [r0] + mov r1, sp + adds r1, 0x2 + strh r6, [r1] + ldr r0, _081052D0 + movs r2, 0xA + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _081052DC + ldr r0, _081052D4 + ldrb r7, [r0] + ldr r0, _081052D8 + b _081052E2 + .align 2, 0 +_081052D0: .4byte 0x0203841e +_081052D4: .4byte 0x02038436 +_081052D8: .4byte 0x02038437 +_081052DC: + ldr r0, _081052FC + ldrb r7, [r0] + ldr r0, _08105300 +_081052E2: + ldrb r0, [r0] + mov r8, r0 + ldr r0, _08105304 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _08105308 + movs r0, 0 + mov r10, r0 + movs r1, 0x1 + str r1, [sp, 0x4] + b _08105310 + .align 2, 0 +_081052FC: .4byte 0x02038437 +_08105300: .4byte 0x02038436 +_08105304: .4byte 0x0203841e +_08105308: + movs r2, 0x2 + mov r10, r2 + movs r3, 0x3 + str r3, [sp, 0x4] +_08105310: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810536C + adds r0, r7, 0 + mov r1, r10 + bl sub_80A5C6C + lsls r0, 24 + ldr r1, _08105350 + lsrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x2 + mov r4, r8 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810535C + ldr r2, _08105354 + ldr r0, _08105358 + adds r0, r4, r0 + b _081053EA + .align 2, 0 +_08105350: .4byte 0x0203841e +_08105354: .4byte 0x02020630 +_08105358: .4byte 0x020241e4 +_0810535C: + ldr r2, _08105364 + ldr r0, _08105368 + add r0, r8 + b _081053EA + .align 2, 0 +_08105364: .4byte 0x02020630 +_08105368: .4byte 0x020241e4 +_0810536C: + adds r0, r7, 0 + mov r1, r10 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081053D4 + ldrh r1, [r1] + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081053E4 + movs r0, 0x2 + adds r4, r7, 0 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081053E4 + ldr r3, _081053D8 + ldr r2, _081053DC + adds r0, r7, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r0, r3 + adds r2, r4, r2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r3 + movs r0, 0x20 + ldrsh r1, [r6, r0] + movs r3, 0x20 + ldrsh r0, [r2, r3] + cmp r1, r0 + bge _081053E0 + adds r0, r2, 0 + adds r0, 0x43 + ldrb r0, [r0] + adds r0, 0x1 + b _081053FA + .align 2, 0 +_081053D4: .4byte 0x0203841e +_081053D8: .4byte 0x02020630 +_081053DC: .4byte 0x020241e4 +_081053E0: + adds r0, r6, 0 + b _081053F4 +_081053E4: + ldr r2, _08105440 + ldr r0, _08105444 + adds r0, r7, r0 +_081053EA: + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 +_081053F4: + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 +_081053FA: + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r7, 0 + ldr r1, [sp, 0x4] + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _08105448 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810544C + movs r1, 0x2 + mov r0, r8 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810544C + ldrb r1, [r4, 0xC] + mov r0, r8 + mov r2, sp + mov r3, sp + adds r3, 0x2 + bl sub_80A8924 + b _0810546C + .align 2, 0 +_08105440: .4byte 0x02020630 +_08105444: .4byte 0x020241e4 +_08105448: .4byte 0x0203841e +_0810544C: + mov r4, sp + mov r0, r8 + mov r1, r10 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + mov r0, r8 + ldr r1, [sp, 0x4] + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r2, sp + strh r0, [r2, 0x2] +_0810546C: + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08105490 + mov r3, sp + mov r2, sp + ldr r1, _0810548C + ldrh r0, [r1, 0x6] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r3] + adds r2, r1, 0 + b _0810549E + .align 2, 0 +_0810548C: .4byte 0x0203841e +_08105490: + mov r3, sp + mov r0, sp + ldr r2, _081054E0 + ldrh r0, [r0] + ldrh r1, [r2, 0x6] + subs r0, r1 + strh r0, [r3] +_0810549E: + ldrh r1, [r2, 0x8] + mov r3, sp + ldrh r3, [r3, 0x2] + adds r1, r3 + mov r0, sp + strh r1, [r0, 0x2] + mov r3, r9 + strh r3, [r5, 0x30] + strh r3, [r5, 0x20] + strh r6, [r5, 0x34] + strh r6, [r5, 0x22] + ldrh r0, [r0] + strh r0, [r5, 0x32] + strh r1, [r5, 0x36] + ldrh r0, [r2] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, _081054E4 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081054E0: .4byte 0x0203841e +_081054E4: .4byte sub_8105284 + 1 + thumb_func_end sub_81052A4 + + thumb_func_start sub_81054E8 +sub_81054E8: @ 81054E8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08105528 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0810550E + lsls r0, 20 + ldr r1, _0810552C + adds r0, r1 + lsrs r0, 16 + ldr r1, _08105530 + ldrb r2, [r1, 0xA] + ldrh r3, [r1, 0x8] + movs r1, 0xF + bl pal_fade_1 +_0810550E: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r1, _08105534 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105528: .4byte 0x000027db +_0810552C: .4byte 0x01010000 +_08105530: .4byte 0x0203841e +_08105534: .4byte sub_80A77C8 + 1 + thumb_func_end sub_81054E8 + + thumb_func_start sub_8105538 +sub_8105538: @ 8105538 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, _0810556C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0xA0 + cmp r0, 0 + beq _08105554 + ldr r1, _08105570 +_08105554: + movs r0, 0xE0 + lsls r0, 2 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + ldr r0, _08105574 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x3C] + ldr r0, _08105578 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810556C: .4byte 0x02038436 +_08105570: .4byte 0x0000ff60 +_08105574: .4byte 0x0203841e +_08105578: .4byte sub_810557C + 1 + thumb_func_end sub_8105538 + + thumb_func_start sub_810557C +sub_810557C: @ 810557C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x2E] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + subs r1, r0 + movs r5, 0 + strh r1, [r4, 0x26] + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + subs r2, 0x20 + strh r2, [r4, 0x2E] + ldr r0, _081055E8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0xA0 + cmp r0, 0 + beq _081055AC + ldr r1, _081055EC +_081055AC: + lsls r0, r1, 16 + asrs r0, 16 + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x26] + movs r2, 0x26 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _081055E0 + ldrh r2, [r4, 0x22] + adds r0, r1, r2 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x26] + strh r5, [r4, 0x24] + strh r5, [r4, 0x2E] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r0, _081055F0 + str r0, [r4, 0x1C] +_081055E0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081055E8: .4byte 0x02038436 +_081055EC: .4byte 0x0000ff60 +_081055F0: .4byte sub_81055F4 + 1 + thumb_func_end sub_810557C + + thumb_func_start sub_81055F4 +sub_81055F4: @ 81055F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r1, r0, 0x1 + strh r1, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _08105612 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8008258 + ldr r0, _08105618 + str r0, [r4, 0x1C] +_08105612: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105618: .4byte sub_810561C + 1 + thumb_func_end sub_81055F4 + + thumb_func_start sub_810561C +sub_810561C: @ 810561C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08105682 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + movs r0, 0 + strh r0, [r4, 0x2E] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105668 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, _0810565C + adds r0, r3, 0 + ands r1, r0 + ldr r0, _08105660 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, _08105664 + b _08105680 + .align 2, 0 +_0810565C: .4byte 0x000003ff +_08105660: .4byte 0xfffffc00 +_08105664: .4byte sub_8105694 + 1 +_08105668: + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r3, _08105688 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810568C + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, _08105690 +_08105680: + str r0, [r4, 0x1C] +_08105682: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105688: .4byte 0x000003ff +_0810568C: .4byte 0xfffffc00 +_08105690: .4byte sub_810571C + 1 + thumb_func_end sub_810561C + + thumb_func_start sub_8105694 +sub_8105694: @ 8105694 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x26] + subs r0, 0x2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _081056CA + movs r0, 0x10 + strh r0, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r4, 0x2E] + movs r0, 0x52 + bl lcd_io_set + ldr r0, _081056D0 + str r0, [r4, 0x1C] +_081056CA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081056D0: .4byte sub_81056D4 + 1 + thumb_func_end sub_8105694 + + thumb_func_start sub_81056D4 +sub_81056D4: @ 81056D4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08105712 + ldrh r1, [r4, 0x2E] + subs r1, 0x1 + strh r1, [r4, 0x2E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105712 + ldr r0, _08105718 + str r0, [r4, 0x1C] +_08105712: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105718: .4byte sub_810571C + 1 + thumb_func_end sub_81056D4 + + thumb_func_start sub_810571C +sub_810571C: @ 810571C + push {lr} + adds r3, r0, 0 + ldr r0, _08105744 + ldrh r1, [r0, 0xE] + ldr r0, _08105748 + cmp r1, r0 + bne _08105754 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x3C + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08105750 + ldr r0, _0810574C + b _08105752 + .align 2, 0 +_08105744: .4byte 0x0203841e +_08105748: .4byte 0x0000ffff +_0810574C: .4byte sub_810575C + 1 +_08105750: + ldr r0, _08105758 +_08105752: + str r0, [r3, 0x1C] +_08105754: + pop {r0} + bx r0 + .align 2, 0 +_08105758: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810571C + + thumb_func_start sub_810575C +sub_810575C: @ 810575C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810575C + + thumb_func_start sub_810577C +sub_810577C: @ 810577C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081057AC + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x8] + ldr r2, _081057B0 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _081057B4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081057AC: .4byte 0x03005e00 +_081057B0: .4byte 0x085938b0 +_081057B4: .4byte sub_81057B8 + 1 + thumb_func_end sub_810577C + + thumb_func_start sub_81057B8 +sub_81057B8: @ 81057B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08105808 + adds r4, r0, r1 + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _08105802 + ldr r2, _0810580C + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + movs r0, 0x8 + ldrsh r1, [r4, 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] + adds r0, r5, 0 + bl move_anim_task_del +_08105802: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08105808: .4byte 0x03005e00 +_0810580C: .4byte 0x02020630 + thumb_func_end sub_81057B8 + + thumb_func_start sub_8105810 +sub_8105810: @ 8105810 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08105844 + adds r4, r1, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x3 + strh r0, [r4, 0x20] + ldr r0, _08105848 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08105850 + ldr r0, _0810584C + strh r0, [r4, 0x22] + movs r0, 0x8 + b _08105856 + .align 2, 0 +_08105844: .4byte 0x03005e00 +_08105848: .4byte 0x02038437 +_0810584C: .4byte 0x0000ffff +_08105850: + movs r0, 0x1 + strh r0, [r4, 0x22] + ldr r0, _08105870 +_08105856: + strh r0, [r4, 0x24] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, _08105874 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105870: .4byte 0x0000fff8 +_08105874: .4byte sub_8105878 + 1 + thumb_func_end sub_8105810 + + thumb_func_start sub_8105878 +sub_8105878: @ 8105878 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0810589C + adds r3, r0, r1 + movs r0, 0x8 + ldrsh r4, [r3, r0] + cmp r4, 0x1 + beq _081058CC + cmp r4, 0x1 + bgt _081058A0 + cmp r4, 0 + beq _081058AA + b _08105992 + .align 2, 0 +_0810589C: .4byte 0x03005e00 +_081058A0: + cmp r4, 0x2 + beq _08105948 + cmp r4, 0x3 + beq _08105962 + b _08105992 +_081058AA: + ldr r2, _081058C8 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x24] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + strh r4, [r3, 0xA] + strh r4, [r3, 0xC] + strh r4, [r3, 0xE] + b _0810595A + .align 2, 0 +_081058C8: .4byte 0x02020630 +_081058CC: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08105992 + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + ands r0, r4 + lsls r0, 16 + cmp r0, 0 + beq _08105904 + ldr r2, _08105900 + movs r4, 0x26 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + adds r1, 0x6 + b _08105916 + .align 2, 0 +_08105900: .4byte 0x02020630 +_08105904: + ldr r2, _08105944 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + subs r1, 0x6 +_08105916: + strh r1, [r0, 0x24] + ldrh r0, [r3, 0xE] + adds r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08105992 + ldrh r1, [r3, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810595A + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + subs r0, 0x6 + strh r0, [r1, 0x24] + b _0810595A + .align 2, 0 +_08105944: .4byte 0x02020630 +_08105948: + ldrh r0, [r3, 0x20] + subs r0, 0x1 + strh r0, [r3, 0x20] + lsls r0, 16 + cmp r0, 0 + beq _0810595A + movs r0, 0 + strh r0, [r3, 0x8] + b _08105992 +_0810595A: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _08105992 +_08105962: + ldr r2, _08105998 + movs r4, 0x26 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x22] + ldrh r4, [r0, 0x24] + adds r1, r4 + strh r1, [r0, 0x24] + movs r0, 0x26 + ldrsh r1, [r3, 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 _08105992 + adds r0, r5, 0 + bl move_anim_task_del +_08105992: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08105998: .4byte 0x02020630 + thumb_func_end sub_8105878 + + thumb_func_start sub_810599C +sub_810599C: @ 810599C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081059D8 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r0, 0xE + strh r0, [r4, 0x22] + movs r0, 0x2 + strh r0, [r4, 0x24] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, _081059DC + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081059D8: .4byte 0x03005e00 +_081059DC: .4byte sub_81059E0 + 1 + thumb_func_end sub_810599C + + thumb_func_start sub_81059E0 +sub_81059E0: @ 81059E0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08105A34 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08105AA6 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x10 + ldrsh r1, [r4, r3] + cmp r0, r1 + ble _08105AA6 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08105A3C + ldr r3, _08105A38 + movs r6, 0x26 + ldrsh r1, [r4, r6] + 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 + b _08105A52 + .align 2, 0 +_08105A34: .4byte 0x03005e00 +_08105A38: .4byte 0x02020630 +_08105A3C: + ldr r3, _08105A84 + movs r0, 0x26 + ldrsh r1, [r4, 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 +_08105A52: + strb r1, [r0] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x22 + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _08105AA6 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x24 + ldrsh r1, [r4, r6] + cmp r0, r1 + bge _08105A88 + strh r2, [r4, 0xA] + strh r2, [r4, 0xC] + strh r2, [r4, 0xE] + b _08105AA6 + .align 2, 0 +_08105A84: .4byte 0x02020630 +_08105A88: + movs r0, 0x26 + ldrsh r1, [r4, 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] + adds r0, r5, 0 + bl move_anim_task_del +_08105AA6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81059E0 + + thumb_func_start sub_8105AAC +sub_8105AAC: @ 8105AAC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _08105AFC + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + movs r1, 0x4 + strh r1, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + strh r0, [r4, 0x12] + strh r0, [r4, 0x14] + strh r0, [r4, 0x16] + strh r0, [r4, 0x18] + strh r0, [r4, 0x22] + ldr r5, _08105B00 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, _08105B04 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08105AFC: .4byte 0x03005e00 +_08105B00: .4byte 0x02038436 +_08105B04: .4byte sub_8105B08 + 1 + thumb_func_end sub_8105AAC + + thumb_func_start sub_8105B08 +sub_8105B08: @ 8105B08 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _08105B2C + adds r4, r0, r1 + movs r0, 0x18 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _08105B74 + cmp r2, 0x1 + bgt _08105B30 + cmp r2, 0 + beq _08105B36 + b _08105B90 + .align 2, 0 +_08105B2C: .4byte 0x03005e00 +_08105B30: + cmp r2, 0x2 + beq _08105B8C + b _08105B90 +_08105B36: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08105B90 + strh r2, [r4, 0x10] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + movs r1, 0x1 + ands r0, r1 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08105B90 + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105B6E + strh r2, [r4, 0x14] + movs r0, 0x1 + strh r0, [r4, 0x18] + b _08105B90 +_08105B6E: + movs r0, 0x2 + strh r0, [r4, 0x18] + b _08105B90 +_08105B74: + movs r1, 0 + strh r1, [r4, 0x12] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08105B90 + strh r2, [r4, 0x16] + strh r1, [r4, 0x18] + b _08105B90 +_08105B8C: + movs r0, 0x1 + strh r0, [r4, 0x12] +_08105B90: + movs r2, 0x8 + ldrsh r5, [r4, r2] + cmp r5, 0 + beq _08105B9E + cmp r5, 0x1 + beq _08105C34 + b _08105C42 +_08105B9E: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08105C42 + strh r5, [r4, 0xA] + ldr r0, _08105C28 + movs r3, 0x24 + ldrsh r1, [r4, r3] + movs r3, 0x26 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08105C42 + ldr r0, _08105C2C + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + strh r6, [r1, 0x2E] + movs r0, 0xD + strh r0, [r1, 0x30] + ldr r2, _08105C30 + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x24] + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08105C42 + strh r5, [r4, 0xC] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _08105C42 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08105C42 + .align 2, 0 +_08105C28: .4byte 0x085938dc +_08105C2C: .4byte 0x02020630 +_08105C30: .4byte 0x085938f4 +_08105C34: + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105C42 + adds r0, r6, 0 + bl move_anim_task_del +_08105C42: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8105B08 + + thumb_func_start sub_8105C48 +sub_8105C48: @ 8105C48 + push {r4,lr} + adds r3, r0, 0 + ldr r4, _08105CB0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + movs r2, 0x1 + ldrb r1, [r0, 0x12] + ands r1, r2 + 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] + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08105CAA + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r1, 1 + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r3, 0 + bl obj_delete_and_free_tiles +_08105CAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105CB0: .4byte 0x03005e00 + thumb_func_end sub_8105C48 + + thumb_func_start sub_8105CB4 +sub_8105CB4: @ 8105CB4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08105D50 + bl gpu_pal_tags_index_of + mov r1, sp + strb r0, [r1] + movs r4, 0x1 + ldr r0, _08105D54 + adds r5, r0, 0 +_08105CCC: + subs r0, r5, r4 + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_alloc_new + mov r2, sp + adds r1, r2, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x2 + ble _08105CCC + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + adds r1, r0, 0 + ldr r0, _08105D58 + ldr r0, [r0] + movs r2, 0xBE + lsls r2, 1 + adds r0, r2 + str r1, [r0] + ldr r0, _08105D5C + bl call_LZZUnCompWram + movs r4, 0 +_08105D00: + ldr r5, _08105D58 + ldr r0, [r5] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 6 + ldr r0, [r0] + adds r0, r1 + mov r2, sp + adds r1, r2, r4 + ldrb r1, [r1] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + adds r4, 0x1 + cmp r4, 0x2 + ble _08105D00 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + ldr r0, [r0] + bl free + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + str r1, [r0] + adds r0, r6, 0 + bl move_anim_task_del + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08105D50: .4byte 0x000027de +_08105D54: .4byte 0x00002710 +_08105D58: .4byte 0x020244d4 +_08105D5C: .4byte 0x08c22610 + thumb_func_end sub_8105CB4 + + thumb_func_start sub_8105D60 +sub_8105D60: @ 8105D60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _08105D84 + movs r4, 0x2 +_08105D6A: + ldrh r0, [r5] + bl gpu_pal_free_tag + adds r5, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _08105D6A + adds r0, r6, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08105D84: .4byte 0x08593950 + thumb_func_end sub_8105D60 + + thumb_func_start sub_8105D88 +sub_8105D88: @ 8105D88 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r3, r2, 24 + movs r0, 0x1 + ands r3, r0 + negs r0, r3 + orrs r0, r3 + asrs r0, 31 + movs r3, 0x20 + ands r0, r3 + ldrh r4, [r5, 0x4] + lsls r3, r4, 22 + lsrs r3, 22 + lsrs r1, 22 + adds r0, r1 + adds r3, r0 + ldr r1, _08105DDC + adds r0, r1, 0 + ands r3, r0 + ldr r0, _08105DE0 + ands r0, r4 + orrs r0, r3 + strh r0, [r5, 0x4] + ldr r0, _08105DE4 + lsrs r2, 25 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + bl gpu_pal_tags_index_of + 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 + .align 2, 0 +_08105DDC: .4byte 0x000003ff +_08105DE0: .4byte 0xfffffc00 +_08105DE4: .4byte 0x08593950 + thumb_func_end sub_8105D88 + + thumb_func_start sub_8105DE8 +sub_8105DE8: @ 8105DE8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r6, _08105E50 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08105E08 + ldr r1, _08105E54 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_08105E08: + ldr r4, _08105E54 + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x2E] + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r5, 0x36] + ldr r0, _08105E58 + str r0, [r5, 0x1C] + ldr r1, _08105E5C + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldrb r1, [r4, 0xA] + ldrb r2, [r4, 0xC] + adds r0, r5, 0 + bl sub_8105D88 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08105E50: .4byte 0x02038436 +_08105E54: .4byte 0x0203841e +_08105E58: .4byte sub_80A6EEC + 1 +_08105E5C: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8105DE8 + + thumb_func_start sub_8105E60 +sub_8105E60: @ 8105E60 + 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, 0x1 + bne _08105E7A + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC +_08105E7A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x32] + lsls r0, r2, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + subs r2, 0x80 + strh r2, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x3C + bne _08105EAA + adds r0, r4, 0 + bl move_anim_8072740 +_08105EAA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8105E60 + + thumb_func_start sub_8105EB0 +sub_8105EB0: @ 8105EB0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + movs r6, 0xF0 + cmp r0, 0 + beq _08105EC4 + movs r6, 0x98 +_08105EC4: + movs r5, 0 + ldr r1, _08105F18 + strh r6, [r1] + ldr r4, _08105F1C + movs r0, 0xA0 + strh r0, [r4] + ldrh r1, [r1] + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x44 + bl lcd_io_set + ldr r1, _08105F20 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08105F24 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xC8 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x10 + bl lcd_io_set + ldr r1, _08105F28 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + strh r6, [r0, 0xA] + ldr r1, _08105F2C + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08105F18: .4byte 0x02022e24 +_08105F1C: .4byte 0x02022e26 +_08105F20: .4byte 0x00003f1f +_08105F24: .4byte 0x00003f3f +_08105F28: .4byte 0x03005e00 +_08105F2C: .4byte sub_8105F30 + 1 + thumb_func_end sub_8105EB0 + + thumb_func_start sub_8105F30 +sub_8105F30: @ 8105F30 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08105F64 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, r1, r2 + ldrh r0, [r3, 0x8] + adds r4, r0, 0 + adds r4, 0xD + strh r4, [r3, 0x8] + ldrh r0, [r3, 0xA] + adds r2, r0, 0 + subs r2, 0xD + strh r2, [r3, 0xA] + lsls r1, r4, 16 + lsls r0, r2, 16 + cmp r1, r0 + blt _08105F70 + ldr r0, _08105F68 + movs r1, 0 + strh r1, [r0] + ldr r0, _08105F6C + str r0, [r3] + b _08105F78 + .align 2, 0 +_08105F64: .4byte 0x03005e00 +_08105F68: .4byte 0x02022e24 +_08105F6C: .4byte sub_8105F84 + 1 +_08105F70: + ldr r1, _08105F80 + lsls r0, r4, 8 + orrs r2, r0 + strh r2, [r1] +_08105F78: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08105F80: .4byte 0x02022e24 + thumb_func_end sub_8105F30 + + thumb_func_start sub_8105F84 +sub_8105F84: @ 8105F84 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _08105FD0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + movs r4, 0 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08105FD8 + movs r0, 0x88 + strh r0, [r1, 0x1E] + movs r0, 0x50 + movs r1, 0x88 + bl lcd_io_set + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + ldr r2, _08105FD4 + movs r1, 0x10 + bl sub_80A2A20 + b _0810600C + .align 2, 0 +_08105FD0: .4byte 0x03005e00 +_08105FD4: .4byte 0x00007fff +_08105FD8: + cmp r0, 0x4 + ble _0810600C + ldr r0, _08106014 + strh r4, [r0] + ldr r0, _08106018 + strh r4, [r0] + ldr r4, _0810601C + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl move_anim_task_del +_0810600C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106014: .4byte 0x02022e24 +_08106018: .4byte 0x02022e26 +_0810601C: .4byte 0x00003f3f + thumb_func_end sub_8105F84 + + thumb_func_start sub_8106020 +sub_8106020: @ 8106020 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08106070 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0810607C + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08106074 + adds r0, r5, 0 + bl sub_80A7CFC + ldr r1, _08106078 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x24] + b _081060A4 + .align 2, 0 +_08106070: .4byte 0x03005e00 +_08106074: .4byte 0x08593988 +_08106078: .4byte 0x02020630 +_0810607C: + ldr r1, _081060AC + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + adds r0, r5, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081060A4 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_081060A4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081060AC: .4byte 0x02020630 + thumb_func_end sub_8106020 + + thumb_func_start sub_81060B0 +sub_81060B0: @ 81060B0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08106100 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0810610C + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08106104 + adds r0, r5, 0 + bl sub_80A7CFC + ldr r1, _08106108 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x24] + b _08106134 + .align 2, 0 +_08106100: .4byte 0x03005e00 +_08106104: .4byte 0x08593988 +_08106108: .4byte 0x02020630 +_0810610C: + ldr r1, _0810613C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + adds r0, r5, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08106134 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_08106134: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810613C: .4byte 0x02020630 + thumb_func_end sub_81060B0 + + thumb_func_start sub_8106140 +sub_8106140: @ 8106140 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0x5F + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r5, _08106184 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _08106188 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106184: .4byte 0x02038437 +_08106188: .4byte sub_810618C + 1 + thumb_func_end sub_8106140 + + thumb_func_start sub_810618C +sub_810618C: @ 810618C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _081061B6 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xE + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _081061BC +_081061B6: + adds r0, r4, 0 + bl move_anim_8072740 +_081061BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810618C + + thumb_func_start sub_81061C4 +sub_81061C4: @ 81061C4 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081061E8 + ldr r1, _081061E4 + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + adds r0, r2, 0x1 + strh r0, [r4, 0x2E] + b _08106244 + .align 2, 0 +_081061E4: .4byte 0x0203841e +_081061E8: + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + cmp r0, 0x64 + ble _08106236 + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] +_08106236: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _08106244 + adds r0, r4, 0 + bl move_anim_8072740 +_08106244: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81061C4 + + thumb_func_start sub_810624C +sub_810624C: @ 810624C + push {lr} + ldr r2, _08106270 + ldrh r1, [r2] + strh r1, [r0, 0x20] + movs r1, 0xA0 + strh r1, [r0, 0x22] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x2E] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x30] + ldr r1, _08106274 + str r1, [r0, 0x1C] + ldr r1, _08106278 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_08106270: .4byte 0x0203841e +_08106274: .4byte sub_80A64B0 + 1 +_08106278: .4byte sub_810627C + 1 + thumb_func_end sub_810624C + + thumb_func_start sub_810627C +sub_810627C: @ 810627C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + lsls r0, 16 + lsrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0x48 + bgt _081062E2 + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] + cmp r5, 0x40 + bgt _081062E2 + adds r0, r4, 0 + bl move_anim_8072740 +_081062E2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810627C + + thumb_func_start sub_81062E8 +sub_81062E8: @ 81062E8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08106388 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x3 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810632A + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810632A: + ldr r0, _0810638C + movs r1, 0 + strh r1, [r0] + ldr r4, _08106390 + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x16 + bl lcd_io_set + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _08106394 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r1, _08106398 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, _0810639C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, _081063A0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081063A4 + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106388: .4byte 0x00003f42 +_0810638C: .4byte 0x02022e18 +_08106390: .4byte 0x02022e1a +_08106394: .4byte 0x08c232e0 +_08106398: .4byte 0x08c23d78 +_0810639C: .4byte 0x08c23d50 +_081063A0: .4byte 0x03005e00 +_081063A4: .4byte sub_81063A8 + 1 + thumb_func_end sub_81062E8 + + thumb_func_start sub_81063A8 +sub_81063A8: @ 81063A8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _081063D0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _081063C6 + b _081064F0 +_081063C6: + lsls r0, 2 + ldr r1, _081063D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081063D0: .4byte 0x03005e00 +_081063D4: .4byte _081063D8 + .align 2, 0 +_081063D8: + .4byte _081063EC + .4byte _08106430 + .4byte _08106452 + .4byte _08106496 + .4byte _081064BC +_081063EC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _081064F0 + strh r5, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081064F0 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _081064F0 +_08106430: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8D + bne _081064F0 + movs r0, 0x10 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _081064F0 +_08106452: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _081064F0 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _081064F0 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _081064F0 +_08106496: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + ldr r1, _081064B8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + b _081064F0 + .align 2, 0 +_081064B8: .4byte 0x03005e00 +_081064BC: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081064D0 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_081064D0: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_081064F0: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81063A8 + + thumb_func_start sub_81064F8 +sub_81064F8: @ 81064F8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08106568 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810653A + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810653A: + ldr r0, _0810656C + movs r1, 0 + strh r1, [r0] + ldr r4, _08106570 + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x16 + bl lcd_io_set + mov r0, sp + bl sub_80A6B30 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08106578 + ldr r1, _08106574 + b _0810658A + .align 2, 0 +_08106568: .4byte 0x00003f42 +_0810656C: .4byte 0x02022e18 +_08106570: .4byte 0x02022e1a +_08106574: .4byte 0x08d93960 +_08106578: + ldr r0, _08106594 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810659C + ldr r1, _08106598 +_0810658A: + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + b _081065A6 + .align 2, 0 +_08106594: .4byte 0x02038437 +_08106598: .4byte 0x08d93598 +_0810659C: + ldr r1, _081065D8 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 +_081065A6: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _081065DC + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _081065E0 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, _081065E4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081065E8 + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081065D8: .4byte 0x08d9377c +_081065DC: .4byte 0x08c249f8 +_081065E0: .4byte 0x08c249d0 +_081065E4: .4byte 0x03005e00 +_081065E8: .4byte sub_81065EC + 1 + thumb_func_end sub_81064F8 + + thumb_func_start sub_81065EC +sub_81065EC: @ 81065EC + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08106614 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0810660A + b _08106730 +_0810660A: + lsls r0, 2 + ldr r1, _08106618 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08106614: .4byte 0x03005e00 +_08106618: .4byte _0810661C + .align 2, 0 +_0810661C: + .4byte _08106630 + .4byte _08106674 + .4byte _08106696 + .4byte _081066DA + .4byte _081066FC +_08106630: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08106730 + strh r5, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0xE + bne _08106730 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _08106730 +_08106674: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _08106730 + movs r0, 0xE + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _08106730 +_08106696: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08106730 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08106730 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _08106730 +_081066DA: + mov r0, sp + bl sub_80A6B30 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, _08106738 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_081066FC: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08106710 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08106710: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_08106730: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106738: .4byte 0x03005e00 + thumb_func_end sub_81065EC + + thumb_func_start sub_810673C +sub_810673C: @ 810673C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08106790 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08106794 + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldrb r0, [r5] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x3C] + ldr r1, _08106798 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106790: .4byte 0x02038436 +_08106794: .4byte 0x0203841e +_08106798: .4byte sub_810679C + 1 + thumb_func_end sub_810673C + + thumb_func_start sub_810679C +sub_810679C: @ 810679C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _081067B2 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + b _081067B6 +_081067B2: + ldrh r0, [r4, 0x3C] + subs r0, 0x1 +_081067B6: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x30 + ldrsh r0, [r4, r2] + ldrh r1, [r4, 0x34] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r3, 0x38 + ldrsh r2, [r4, r3] + cmp r2, 0 + beq _08106828 + cmp r2, 0x1 + bne _08106858 + ldr r1, _08106820 + adds r0, r1, 0 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r4, 0x32] + ldr r3, _08106824 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08106858 + movs r0, 0x2 + strh r0, [r4, 0x38] + b _08106868 + .align 2, 0 +_08106820: .4byte 0xfffffc00 +_08106824: .4byte 0xffffff00 +_08106828: + movs r3, 0x80 + lsls r3, 3 + adds r0, r3, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x2E + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _08106858 + strh r2, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x38] +_08106858: + ldr r0, _08106870 + ldrh r1, [r0, 0xE] + ldr r0, _08106874 + cmp r1, r0 + bne _08106868 + adds r0, r4, 0 + bl move_anim_8072740 +_08106868: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08106870: .4byte 0x0203841e +_08106874: .4byte 0x0000ffff + thumb_func_end sub_810679C + + thumb_func_start sub_8106878 +sub_8106878: @ 8106878 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081068C0 + 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] + ldr r4, _081068C4 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + strh r0, [r5, 0x2E] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x7 + bl cosine + strh r0, [r5, 0x30] + ldr r0, _081068C8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081068C0: .4byte 0x02038436 +_081068C4: .4byte 0x0203841e +_081068C8: .4byte sub_81068CC + 1 + thumb_func_end sub_8106878 + + thumb_func_start sub_81068CC +sub_81068CC: @ 81068CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + ldrh r3, [r2, 0x26] + adds r0, r3 + strh r0, [r2, 0x26] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r3, 0x24 + ldrsh r1, [r2, r3] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _0810690A + movs r0, 0x22 + ldrsh r1, [r2, r0] + movs r3, 0x26 + ldrsh r0, [r2, r3] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810690A + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _08106910 +_0810690A: + adds r0, r2, 0 + bl move_anim_8072740 +_08106910: + pop {r0} + bx r0 + thumb_func_end sub_81068CC + + thumb_func_start sub_8106914 +sub_8106914: @ 8106914 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + ldrh r3, [r2, 0x26] + adds r0, r3 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r1, r0, 0x1 + strh r1, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08106940 + adds r0, r2, 0 + bl move_anim_8072740 +_08106940: + pop {r0} + bx r0 + thumb_func_end sub_8106914 + + thumb_func_start sub_8106944 +sub_8106944: @ 8106944 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08106990 + 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] + ldr r4, _08106994 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + strh r0, [r5, 0x2E] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x7 + bl cosine + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x32] + ldr r0, _08106998 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106990: .4byte 0x02038436 +_08106994: .4byte 0x0203841e +_08106998: .4byte sub_8106914 + 1 + thumb_func_end sub_8106944 + + thumb_func_start sub_810699C +sub_810699C: @ 810699C + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081069B2 + adds r0, r2, 0 + bl move_anim_8072740 +_081069B2: + pop {r0} + bx r0 + thumb_func_end sub_810699C + + thumb_func_start sub_81069B8 +sub_81069B8: @ 81069B8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _081069CC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081069CC: .4byte sub_810699C + 1 + thumb_func_end sub_81069B8 + + thumb_func_start sub_81069D0 +sub_81069D0: @ 81069D0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081069EE + ldr r0, _08106A60 + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_081069EE: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r5, r0, 1 + movs r0, 0xFF + ands r5, r0 + adds r0, r5, 0 + movs r1, 0x50 + bl sine + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4F + bgt _08106A32 + adds r0, r5, 0 + movs r1, 0x50 + bl cosine + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + lsls r0, 16 + asrs r0, 24 + adds r1, r0 + strh r1, [r4, 0x26] +_08106A32: + movs r0, 0x2E + ldrsh r2, [r4, r0] + cmp r2, 0x5A + ble _08106A50 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] +_08106A50: + cmp r2, 0x64 + ble _08106A5A + adds r0, r4, 0 + bl move_anim_8072740 +_08106A5A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106A60: .4byte 0x0203841e + thumb_func_end sub_81069D0 + + thumb_func_start sub_8106A64 +sub_8106A64: @ 8106A64 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x14 + ble _08106ABA + adds r1, r0, 0 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] +_08106ABA: + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x1E + ble _08106AC8 + adds r0, r4, 0 + bl move_anim_8072740 +_08106AC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8106A64 + + thumb_func_start sub_8106AD0 +sub_8106AD0: @ 8106AD0 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106AF4 + ldr r1, _08106AF0 + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + adds r0, r2, 0x1 + strh r0, [r4, 0x2E] + b _08106B48 + .align 2, 0 +_08106AF0: .4byte 0x0203841e +_08106AF4: + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x36] + adds r0, r2 + movs r5, 0 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + cmp r0, 0x46 + ble _08106B48 + ldr r0, _08106B50 + str r0, [r4, 0x1C] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r0, r2, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB4 + bl __umodsi3 + strh r0, [r4, 0x34] +_08106B48: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106B50: .4byte sub_8106A64 + 1 + thumb_func_end sub_8106AD0 + + thumb_func_start sub_8106B54 +sub_8106B54: @ 8106B54 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106B8E + ldr r1, _08106C50 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start + ldr r0, _08106C54 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r4, 0x32] +_08106B8E: + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r0, r2 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 2 + adds r0, r1, 0 + cmp r1, 0 + bge _08106BA4 + adds r0, 0xFF +_08106BA4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _08106BB6 + movs r0, 0 + strh r0, [r4, 0x30] +_08106BB6: + movs r0, 0x30 + ldrsh r2, [r4, r0] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08106BC4 + adds r0, 0x3 +_08106BC4: + asrs r0, 2 + movs r1, 0x1E + subs r1, r0 + adds r0, r2, 0 + bl cosine + strh r0, [r4, 0x24] + movs r0, 0x30 + ldrsh r2, [r4, r0] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08106BE0 + adds r0, 0x7 +_08106BE0: + asrs r0, 3 + movs r1, 0xA + subs r1, r0 + adds r0, r2, 0 + bl sine + strh r0, [r4, 0x26] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x80 + ble _08106C04 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08106C04 + ldr r0, _08106C58 + strh r0, [r4, 0x32] +_08106C04: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106C18 + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _08106C18 + movs r0, 0x1 + strh r0, [r4, 0x32] +_08106C18: + ldrh r0, [r4, 0x34] + adds r1, r0, 0x1 + strh r1, [r4, 0x34] + subs r0, 0x9 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x46 + bls _08106C5C + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] + b _08106C6A + .align 2, 0 +_08106C50: .4byte 0x0203841e +_08106C54: .4byte 0x02038437 +_08106C58: .4byte 0x0000ffff +_08106C5C: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08106C6A: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x5A + ble _08106C78 + adds r0, r4, 0 + bl move_anim_8072740 +_08106C78: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8106B54 + + thumb_func_start sub_8106C80 +sub_8106C80: @ 8106C80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106CB4 + ldr r1, _08106CB0 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrb r1, [r1, 0x4] + adds r0, r4, 0 + bl obj_anim_image_start + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08106CC8 + .align 2, 0 +_08106CB0: .4byte 0x0203841e +_08106CB4: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08106CC8 + adds r0, r4, 0 + bl move_anim_8072740 +_08106CC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8106C80 + + thumb_func_start sub_8106CD0 +sub_8106CD0: @ 8106CD0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _08106CE8 + movs r2, 0x4 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08106CEC + adds r0, r5, 0 + bl move_anim_8072740 + b _08106D50 + .align 2, 0 +_08106CE8: .4byte 0x0203841e +_08106CEC: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08106CFC + ldr r4, _08106CF8 + b _08106CFE + .align 2, 0 +_08106CF8: .4byte 0x02038436 +_08106CFC: + ldr r4, _08106D2C +_08106CFE: + 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] + ldr r0, _08106D30 + movs r2, 0x2 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08106D34 + ldrh r0, [r5, 0x20] + adds r0, 0x20 + b _08106D38 + .align 2, 0 +_08106D2C: .4byte 0x02038437 +_08106D30: .4byte 0x0203841e +_08106D34: + ldrh r0, [r5, 0x20] + subs r0, 0x20 +_08106D38: + strh r0, [r5, 0x20] + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x2E] + ldrh r1, [r2, 0x2] + strh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _08106D58 + str r0, [r5, 0x1C] +_08106D50: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106D58: .4byte sub_8106D5C + 1 + thumb_func_end sub_8106CD0 + + thumb_func_start sub_8106D5C +sub_8106D5C: @ 8106D5C + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08106D8C + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + cmp r0, 0 + beq _08106D86 + ldrh r1, [r2, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl obj_anim_image_start + b _08106D8C +_08106D86: + adds r0, r2, 0 + bl move_anim_8072740 +_08106D8C: + pop {r0} + bx r0 + thumb_func_end sub_8106D5C + + thumb_func_start sub_8106D90 +sub_8106D90: @ 8106D90 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08106DC4 + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _08106DC8 + adds r4, r0 + ldr r2, _08106DCC + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _08106DD0 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08106DC4: .4byte 0x0203841e +_08106DC8: .4byte 0x03005e00 +_08106DCC: .4byte 0x08593b98 +_08106DD0: .4byte sub_8106DD4 + 1 + thumb_func_end sub_8106D90 + + thumb_func_start sub_8106DD4 +sub_8106DD4: @ 8106DD4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08106DFC + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08106DF4 + adds r0, r4, 0 + bl move_anim_task_del +_08106DF4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08106DFC: .4byte 0x03005e00 + thumb_func_end sub_8106DD4 + + thumb_func_start sub_8106E00 +sub_8106E00: @ 8106E00 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, _08106E14 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08106E1C + ldr r0, _08106E18 + b _08106E1E + .align 2, 0 +_08106E14: .4byte 0x0203841e +_08106E18: .4byte 0x02038436 +_08106E1C: + ldr r0, _08106EB4 +_08106E1E: + ldrb r6, [r0] + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08106E38 + ldr r1, _08106EB8 + movs r2, 0x2 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x2] +_08106E38: + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r7, _08106EB8 + lsrs r0, 24 + ldrh r3, [r7, 0x2] + adds r0, r3 + movs r4, 0 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r7, 0x4] + adds r0, r1 + strh r0, [r5, 0x22] + strh r4, [r5, 0x2E] + ldrh r1, [r5, 0x20] + lsls r1, 3 + strh r1, [r5, 0x30] + lsls r0, 3 + strh r0, [r5, 0x32] + movs r2, 0x2 + ldrsh r0, [r7, r2] + lsls r0, 3 + cmp r0, 0 + bge _08106E78 + adds r0, 0x7 +_08106E78: + asrs r0, 3 + strh r0, [r5, 0x34] + movs r3, 0x4 + ldrsh r0, [r7, r3] + lsls r0, 3 + cmp r0, 0 + bge _08106E88 + adds r0, 0x7 +_08106E88: + asrs r0, 3 + strh r0, [r5, 0x36] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0x6 + ldrsh r0, [r7, r3] + lsls r0, 4 + adds r1, r0 + ldr r3, _08106EBC + adds r0, r3, 0 + ands r1, r0 + ldr r0, _08106EC0 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r0, _08106EC4 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08106EB4: .4byte 0x02038437 +_08106EB8: .4byte 0x0203841e +_08106EBC: .4byte 0x000003ff +_08106EC0: .4byte 0xfffffc00 +_08106EC4: .4byte sub_8106EC8 + 1 + thumb_func_end sub_8106E00 + + thumb_func_start sub_8106EC8 +sub_8106EC8: @ 8106EC8 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x34] + ldrh r1, [r2, 0x30] + adds r0, r1 + strh r0, [r2, 0x30] + ldrh r1, [r2, 0x36] + ldrh r3, [r2, 0x32] + adds r1, r3 + strh r1, [r2, 0x32] + lsls r0, 16 + asrs r0, 19 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 19 + strh r1, [r2, 0x22] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08106EFC + adds r0, r2, 0 + bl move_anim_8072740 +_08106EFC: + pop {r0} + bx r0 + thumb_func_end sub_8106EC8 + + thumb_func_start sub_8106F00 +sub_8106F00: @ 8106F00 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106F22 + ldr r0, _08106F5C + ldrh r1, [r0] + movs r0, 0x78 + subs r0, r1 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08106F22: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08106F40 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + adds r0, 0x10 + movs r1, 0 + bl sub_80A750C +_08106F40: + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r2, 0x30 + ldrsh r0, [r4, r2] + adds r0, 0x50 + cmp r1, r0 + bne _08106F54 + adds r0, r4, 0 + bl move_anim_8072740 +_08106F54: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08106F5C: .4byte 0x0203841e + thumb_func_end sub_8106F00 + + thumb_func_start sub_8106F60 +sub_8106F60: @ 8106F60 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08106F8E + movs r5, 0x78 + strh r5, [r6, 0x20] + ldr r4, _08107010 + movs r2, 0 + ldrsh r0, [r4, r2] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r0, 0xF + strh r0, [r6, 0x22] + ldrb r1, [r4, 0x2] + adds r0, r6, 0 + bl obj_anim_image_start + strh r5, [r6, 0x38] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x34] +_08106F8E: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + movs r5, 0 + strh r0, [r6, 0x2E] + movs r1, 0x2E + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r6, 0x30] + movs r2, 0x2E + ldrsh r0, [r6, r2] + lsls r4, r0, 1 + adds r4, r0 + ldrh r0, [r6, 0x34] + adds r4, r0 + movs r2, 0xFF + ldrh r0, [r6, 0x3A] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0x3A] + ands r4, r2 + adds r0, r4, 0 + movs r1, 0x64 + bl cosine + strh r0, [r6, 0x24] + adds r0, r4, 0 + movs r1, 0xA + bl sine + adds r4, r0, 0 + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r1, 0x4 + bl cosine + ldrh r2, [r6, 0x30] + adds r4, r2 + adds r0, r4 + strh r0, [r6, 0x26] + movs r0, 0x2E + ldrsh r1, [r6, r0] + movs r2, 0x38 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0810700A + ldr r0, _08107014 + str r0, [r6, 0x1C] + strh r5, [r6, 0x2E] + adds r0, r6, 0 + bl oamt_add_pos2_onto_pos1 + movs r0, 0x5 + strh r0, [r6, 0x32] + strh r5, [r6, 0x36] + strh r5, [r6, 0x34] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8008258 +_0810700A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08107010: .4byte 0x0203841e +_08107014: .4byte sub_8107018 + 1 + thumb_func_end sub_8106F60 + + thumb_func_start sub_8107018 +sub_8107018: @ 8107018 + 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, 0xA + ble _08107032 + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, _08107038 + str r0, [r1, 0x1C] +_08107032: + pop {r0} + bx r0 + .align 2, 0 +_08107038: .4byte sub_810703C + 1 + thumb_func_end sub_8107018 + + thumb_func_start sub_810703C +sub_810703C: @ 810703C + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x34] + adds r0, r1, r2 + strh r0, [r4, 0x34] + strh r0, [r4, 0x26] + adds r1, 0x1 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x30 + ble _08107066 + lsls r0, r1, 16 + cmp r0, 0 + ble _08107066 + ldrh r0, [r4, 0x36] + subs r1, r0, 0x5 + strh r1, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x36] +_08107066: + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _08107098 + movs r2, 0x32 + ldrsh r1, [r4, r2] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] + adds r0, r4, 0 + bl move_anim_8072740 +_08107098: + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bne _081070A6 + adds r0, r4, 0 + bl move_anim_8072740 +_081070A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810703C + + thumb_func_start sub_81070AC +sub_81070AC: @ 81070AC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _081070F0 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081070F8 + ldr r4, _081070F4 + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081070F8 + ldrb r0, [r4] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldrh r0, [r5, 0x22] + adds r0, 0x28 + strh r0, [r5, 0x22] + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8008258 + b _08107118 + .align 2, 0 +_081070F0: .4byte 0x02022fec +_081070F4: .4byte 0x02038436 +_081070F8: + ldr r4, _08107138 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x28 + strh r0, [r5, 0x22] +_08107118: + movs r0, 0xD + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + subs r0, 0x48 + strh r0, [r5, 0x36] + ldr r0, _0810713C + str r0, [r5, 0x1C] + ldr r1, _08107140 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08107138: .4byte 0x02038436 +_0810713C: .4byte sub_80A6EEC + 1 +_08107140: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81070AC + + thumb_func_start sub_8107144 +sub_8107144: @ 8107144 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08107160 + ldr r1, _08107164 + ldr r1, [r1] + ldrb r2, [r1, 0x10] + movs r1, 0x1 + ands r1, r2 + strh r1, [r3, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08107160: .4byte 0x0203841e +_08107164: .4byte 0x02038400 + thumb_func_end sub_8107144 + + thumb_func_start update_fury_cutter_counter_copy +update_fury_cutter_counter_copy: @ 8107168 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08107180 + ldr r1, _08107184 + ldr r1, [r1] + ldrb r1, [r1, 0x10] + strh r1, [r2, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08107180: .4byte 0x0203841e +_08107184: .4byte 0x02038400 + thumb_func_end update_fury_cutter_counter_copy + + thumb_func_start sub_8107188 +sub_8107188: @ 8107188 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _08107210 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _081071B0 + ldr r1, _08107214 + ldrh r0, [r1] + strh r0, [r5, 0xA] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0xC] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0xE] +_081071B0: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r2, 0x8 + ldrsh r0, [r5, r2] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl __modsi3 + cmp r0, 0x1 + bne _081071F8 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x50 + bl __umodsi3 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _08107218 + adds r1, r4, 0 + movs r3, 0x4 + bl obj_add_from_template_forward_search +_081071F8: + movs r0, 0x8 + ldrsh r1, [r5, r0] + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _0810720A + adds r0, r6, 0 + bl move_anim_task_del +_0810720A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08107210: .4byte 0x03005e00 +_08107214: .4byte 0x0203841e +_08107218: .4byte 0x08595020 + thumb_func_end sub_8107188 + + thumb_func_start sub_810721C +sub_810721C: @ 810721C + ldr r1, _08107224 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08107224: .4byte sub_8107228 + 1 + thumb_func_end sub_810721C + + thumb_func_start sub_8107228 +sub_8107228: @ 8107228 + 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, 0xD + bgt _08107246 + ldrh r0, [r2, 0x24] + adds r0, 0x1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x26] + adds r0, 0x4 + strh r0, [r2, 0x26] +_08107246: + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810725A + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_0810725A: + pop {r0} + bx r0 + thumb_func_end sub_8107228 + + thumb_func_start sub_8107260 +sub_8107260: @ 8107260 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, _08107288 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08107290 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0810728C + ldrh r1, [r4] + subs r0, r1 + b _081072A2 + .align 2, 0 +_08107288: .4byte 0x02038436 +_0810728C: .4byte 0x0203841e +_08107290: + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _08107368 + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 +_081072A2: + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r6, 0x22] + adds r2, r6, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0810736C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081072D8 + ldr r1, _08107368 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_081072D8: + ldr r5, _08107368 + ldrh r0, [r5, 0xC] + strh r0, [r6, 0x2E] + ldrh r0, [r6, 0x20] + strh r0, [r6, 0x30] + ldr r4, _08107370 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x32] + ldrh r0, [r6, 0x22] + strh r0, [r6, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _08107374 + bl object_new_hidden_with_callback + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + strh r4, [r6, 0x38] + ldrb r0, [r5, 0x8] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl sine + ldrh r1, [r6, 0x20] + subs r1, r0 + strh r1, [r6, 0x20] + ldrb r0, [r5, 0x8] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl cosine + ldrh r1, [r6, 0x22] + subs r1, r0 + strh r1, [r6, 0x22] + ldr r0, _08107378 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r5, 0x4] + strh r0, [r1, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r1, 0x30] + ldrh r0, [r5, 0xA] + strh r0, [r1, 0x32] + ldrb r0, [r5, 0x8] + lsls r0, 8 + strh r0, [r1, 0x34] + ldrh r0, [r5, 0xC] + strh r0, [r1, 0x36] + ldr r1, _0810737C + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08107368: .4byte 0x0203841e +_0810736C: .4byte 0x02038436 +_08107370: .4byte 0x02038437 +_08107374: .4byte nullsub_12 + 1 +_08107378: .4byte 0x02020630 +_0810737C: .4byte sub_8107380 + 1 + thumb_func_end sub_8107260 + + thumb_func_start sub_8107380 +sub_8107380: @ 8107380 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r1, [r5, 0x38] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _081073E8 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r7, r0, r2 + ldrh r4, [r7, 0x36] + lsls r4, 24 + lsrs r4, 24 + ldrh r0, [r7, 0x34] + mov r8, r0 + movs r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A6F3C + mov r1, r8 + lsrs r6, r1, 8 + movs r0, 0x2E + ldrsh r1, [r7, r0] + adds r0, r6, 0 + bl sine + ldrh r1, [r5, 0x24] + adds r0, r1 + strh r0, [r5, 0x24] + movs r0, 0x30 + ldrsh r1, [r7, r0] + adds r0, r6, 0 + bl cosine + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r0, [r7, 0x32] + mov r1, r8 + adds r1, r0 + strh r1, [r7, 0x34] + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + cmp r4, 0 + beq _081073EC + strh r4, [r7, 0x36] + b _081073F6 + .align 2, 0 +_081073E8: .4byte 0x02020630 +_081073EC: + ldr r0, _08107404 + str r0, [r5, 0x1C] + adds r0, r7, 0 + bl obj_delete_and_free_tiles +_081073F6: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08107404: .4byte sub_8107408 + 1 + thumb_func_end sub_8107380 + + thumb_func_start sub_8107408 +sub_8107408: @ 8107408 + push {lr} + adds r3, r0, 0 + adds r3, 0x2C + ldrb r2, [r3] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + strb r1, [r3] + ldr r1, _08107428 + str r1, [r0, 0x1C] + ldr r1, _0810742C + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_08107428: .4byte sub_80A67D8 + 1 +_0810742C: .4byte sub_8107430 + 1 + thumb_func_end sub_8107408 + + thumb_func_start sub_8107430 +sub_8107430: @ 8107430 + push {lr} + movs r1, 0xA + strh r1, [r0, 0x2E] + ldr r1, _08107444 + str r1, [r0, 0x1C] + ldr r1, _08107448 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_08107444: .4byte sub_80A64B0 + 1 +_08107448: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_8107430 + + thumb_func_start sub_810744C +sub_810744C: @ 810744C + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _08107474 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810747C + ldr r1, _08107478 + ldrh r0, [r1, 0x4] + negs r0, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r7, r1, 0 + b _08107482 + .align 2, 0 +_08107474: .4byte 0x02038436 +_08107478: .4byte 0x0203841e +_0810747C: + ldr r0, _081074D8 + ldrh r6, [r0, 0x4] + adds r7, r0, 0 +_08107482: + ldrh r0, [r7, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, _081074DC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r7, [r7, 0x6] + adds r0, r7 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _081074E0 + str r0, [r5, 0x1C] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081074D8: .4byte 0x0203841e +_081074DC: .4byte 0x02038437 +_081074E0: .4byte sub_81074E4 + 1 + thumb_func_end sub_810744C + + thumb_func_start sub_81074E4 +sub_81074E4: @ 81074E4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08107520 + ldrh r1, [r0, 0xE] + ldr r0, _08107524 + cmp r1, r0 + bne _08107506 + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] +_08107506: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08107518 + adds r0, r4, 0 + bl move_anim_8072740 +_08107518: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08107520: .4byte 0x0203841e +_08107524: .4byte 0x0000ffff + thumb_func_end sub_81074E4 + + thumb_func_start sub_8107528 +sub_8107528: @ 8107528 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0810755C + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r0, _08107560 + ldrh r0, [r0] + strh r0, [r4, 0x8] + ldr r0, _08107564 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0xC] + ldr r0, _08107568 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810755C: .4byte 0x03005e00 +_08107560: .4byte 0x0203841e +_08107564: .4byte 0x0000279c +_08107568: .4byte sub_810756C + 1 + thumb_func_end sub_8107528 + + thumb_func_start sub_810756C +sub_810756C: @ 810756C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _081075E4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x1C] + adds r0, 0x1 + strh r0, [r2, 0x1C] + lsls r0, 16 + asrs r0, 16 + mov r12, r1 + cmp r0, 0x3 + bne _081075BE + movs r0, 0 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _081075E8 + lsls r0, r5, 1 + adds r0, r1 + ldrh r6, [r0] + adds r7, r1, 0 + adds r3, r0, 0x2 + movs r1, 0x6 + adds r2, r0, 0 +_081075A8: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081075A8 + adds r0, r5, 0x7 + lsls r0, 1 + adds r0, r7 + strh r6, [r0] +_081075BE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r12 + ldrh r1, [r0, 0x1E] + adds r1, 0x1 + strh r1, [r0, 0x1E] + lsls r1, 16 + asrs r1, 16 + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _081075DE + adds r0, r4, 0 + bl move_anim_task_del +_081075DE: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081075E4: .4byte 0x03005e00 +_081075E8: .4byte 0x02037b14 + thumb_func_end sub_810756C + + thumb_func_start sub_81075EC +sub_81075EC: @ 81075EC + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0x1E + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, _08107654 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x2E + ldrsh r1, [r5, r0] + movs r0, 0xD2 + lsls r0, 8 + bl __divsi3 + strh r0, [r5, 0x38] + ldr r0, _08107658 + ldrh r2, [r0, 0x6] + strh r2, [r5, 0x3C] + ldrh r1, [r0, 0xE] + movs r3, 0xE + ldrsh r0, [r0, r3] + cmp r0, 0x7F + ble _0810765C + adds r0, r1, 0 + subs r0, 0x7F + lsls r0, 8 + strh r0, [r5, 0x3A] + negs r0, r2 + strh r0, [r5, 0x3C] + b _08107660 + .align 2, 0 +_08107654: .4byte 0x02038437 +_08107658: .4byte 0x0203841e +_0810765C: + lsls r0, r1, 8 + strh r0, [r5, 0x3A] +_08107660: + ldr r1, _08107670 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08107670: .4byte sub_8107674 + 1 + thumb_func_end sub_81075EC + + thumb_func_start sub_8107674 +sub_8107674: @ 8107674 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08107688 + adds r0, r4, 0 + bl move_anim_8072740 +_08107688: + ldrh r0, [r4, 0x3A] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x3A + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + adds r0, r1 + asrs r0, 8 + cmp r0, 0x7F + ble _081076B8 + movs r0, 0 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + negs r0, r0 + strh r0, [r4, 0x3C] + b _081076C0 +_081076B8: + ldrh r0, [r4, 0x38] + ldrh r1, [r4, 0x3A] + adds r0, r1 + strh r0, [r4, 0x3A] +_081076C0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8107674 + + thumb_func_start sub_81076C8 +sub_81076C8: @ 81076C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081076E8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r3, _081076EC + ldrh r0, [r3] + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r3, 0xE] + ldr r0, _081076F0 + str r0, [r1] + bx lr + .align 2, 0 +_081076E8: .4byte 0x03005e00 +_081076EC: .4byte 0x0203841e +_081076F0: .4byte sub_81076F4 + 1 + thumb_func_end sub_81076C8 + + thumb_func_start sub_81076F4 +sub_81076F4: @ 81076F4 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08107728 + ldrh r0, [r2, 0xE] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r2, 0xE] + ldr r1, _0810772C + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bne _08107722 + adds r0, r3, 0 + bl move_anim_task_del +_08107722: + pop {r0} + bx r0 + .align 2, 0 +_08107728: .4byte 0x0203841e +_0810772C: .4byte 0x03005e00 + thumb_func_end sub_81076F4 + + thumb_func_start sub_8107730 +sub_8107730: @ 8107730 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r7, _0810777C + ldrb r0, [r7] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r7] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r6, _08107780 + strh r6, [r4, 0x26] + ldrb r0, [r7] + bl sub_80A82E4 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810778A + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08107784 + movs r0, 0xA + strh r0, [r4, 0x24] + b _0810778C + .align 2, 0 +_0810777C: .4byte 0x02038436 +_08107780: .4byte 0x0000fff6 +_08107784: + strh r6, [r4, 0x24] + subs r0, r5, 0x2 + b _0810778E +_0810778A: + strh r6, [r4, 0x24] +_0810778C: + adds r0, r5, 0x2 +_0810778E: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r0, _081077A0 + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081077A0: .4byte sub_81077A4 + 1 + thumb_func_end sub_8107730 + + thumb_func_start sub_81077A4 +sub_81077A4: @ 81077A4 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081077BA + adds r0, r2, 0 + bl move_anim_8072740 +_081077BA: + pop {r0} + bx r0 + thumb_func_end sub_81077A4 + + thumb_func_start sub_81077C0 +sub_81077C0: @ 81077C0 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r5, _08107880 + ldrb r0, [r5] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, _08107884 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0810780A + ldr r4, _08107888 + movs r1, 0 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4] + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + beq _08107802 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810780A +_08107802: + movs r1, 0 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4] +_0810780A: + ldr r5, _08107888 + movs r1, 0xA + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0 + cmp r0, 0 + bne _0810781E + movs r1, 0x1 +_0810781E: + ldrb r0, [r5, 0xA] + movs r7, 0x1 + cmp r0, 0 + bne _08107828 + movs r7, 0x3 +_08107828: + adds r0, r6, 0 + bl sub_80A69CC + ldr r0, _08107880 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08107842 + ldrh r0, [r5, 0x4] + negs r0, r0 + strh r0, [r5, 0x4] +_08107842: + ldrh r0, [r5, 0x8] + strh r0, [r6, 0x2E] + ldr r4, _08107884 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r4] + adds r1, r7, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x6] + adds r0, r5 + strh r0, [r6, 0x36] + ldr r0, _0810788C + str r0, [r6, 0x1C] + ldr r1, _08107890 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08107880: .4byte 0x02038436 +_08107884: .4byte 0x02038437 +_08107888: .4byte 0x0203841e +_0810788C: .4byte sub_80A6EEC + 1 +_08107890: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81077C0 + + thumb_func_start sub_8107894 +sub_8107894: @ 8107894 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, _081078C4 + ldrh r1, [r0, 0x8] + strh r1, [r4, 0x2E] + ldrh r0, [r0, 0x4] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + adds r1, r0 + strh r1, [r4, 0x36] + ldr r0, _081078C8 + str r0, [r4, 0x1C] + ldr r1, _081078CC + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081078C4: .4byte 0x0203841e +_081078C8: .4byte sub_80A6EEC + 1 +_081078CC: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8107894 + + thumb_func_start sub_81078D0 +sub_81078D0: @ 81078D0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081078E8 + movs r1, 0x6 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081078EC + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + b _081078F4 + .align 2, 0 +_081078E8: .4byte 0x0203841e +_081078EC: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC +_081078F4: + ldr r0, _08107904 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x3C] + ldr r0, _08107908 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08107904: .4byte 0x0203841e +_08107908: .4byte sub_810790C + 1 + thumb_func_end sub_81078D0 + + thumb_func_start sub_810790C +sub_810790C: @ 810790C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0xB + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x30 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810794C + adds r0, r4, 0 + bl move_anim_8072740 +_0810794C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810790C + + thumb_func_start sub_8107954 +sub_8107954: @ 8107954 + 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, _081079C4 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + mov r0, sp + bl sub_80A6B30 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081079E0 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, _081079C8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081079D0 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _081079CC + bl sub_80A6D48 + b _081079EA + .align 2, 0 +_081079C4: .4byte 0x00003f42 +_081079C8: .4byte 0x02038436 +_081079CC: .4byte 0x08d95e00 +_081079D0: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _081079DC + bl sub_80A6D48 + b _081079EA + .align 2, 0 +_081079DC: .4byte 0x08d960d0 +_081079E0: + ldr r1, _08107A14 + mov r0, sp + movs r2, 0x1 + bl sub_80A6D60 +_081079EA: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _08107A18 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _08107A1C + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08107A24 + ldr r0, _08107A20 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + b _08107A32 + .align 2, 0 +_08107A14: .4byte 0x08d963a4 +_08107A18: .4byte 0x08d94ab8 +_08107A1C: .4byte 0x0203841e +_08107A20: .4byte 0x08d95dd8 +_08107A24: + ldr r0, _08107A9C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette +_08107A32: + ldr r0, _08107AA0 + ldr r4, _08107AA4 + mov r2, r10 + lsls r5, r2, 2 + adds r1, r5, r2 + lsls r1, 3 + adds r6, r1, r4 + ldrb r1, [r6, 0x7] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0 + mov r9, r0 + mov r1, r8 + strh r1, [r6, 0x26] + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r7, r0, r4 + mov r0, r9 + strh r0, [r7, 0x8] + movs r0, 0x80 + lsls r0, 5 + strh r0, [r7, 0xA] + strh r0, [r7, 0xC] + bl sub_80A4DF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08107AB4 + ldr r1, _08107AA8 + adds r0, r1, 0 + ldr r2, _08107AAC + strh r0, [r2] + adds r1, 0x20 + adds r0, r1, 0 + ldr r2, _08107AB0 + strh r0, [r2] + movs r0, 0x2 + strh r0, [r6, 0x8] + movs r0, 0x1 + strh r0, [r6, 0xA] + mov r0, r9 + strh r0, [r7, 0xE] + b _08107B0E + .align 2, 0 +_08107A9C: .4byte 0x08d8fb9c +_08107AA0: .4byte sub_8107D58 + 1 +_08107AA4: .4byte 0x03005e00 +_08107AA8: .4byte 0x0000ffb0 +_08107AAC: .4byte 0x02022e18 +_08107AB0: .4byte 0x02022e1a +_08107AB4: + ldr r0, _08107AE4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _08107AF8 + ldr r2, _08107AE8 + adds r0, r2, 0 + ldr r2, _08107AEC + strh r0, [r2] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldr r2, _08107AF0 + strh r0, [r2] + movs r0, 0x2 + strh r0, [r6, 0x8] + ldr r0, _08107AF4 + strh r0, [r6, 0xA] + strh r1, [r7, 0xE] + b _08107B0E + .align 2, 0 +_08107AE4: .4byte 0x02038436 +_08107AE8: .4byte 0x0000ff20 +_08107AEC: .4byte 0x02022e18 +_08107AF0: .4byte 0x02022e1a +_08107AF4: .4byte 0x0000ffff +_08107AF8: + ldr r0, _08107B40 + strh r4, [r0] + ldr r1, _08107B44 + adds r0, r1, 0 + ldr r2, _08107B48 + strh r0, [r2] + ldr r0, _08107B4C + strh r0, [r6, 0x8] + movs r0, 0x1 + strh r0, [r6, 0xA] + strh r4, [r7, 0xE] +_08107B0E: + ldr r0, _08107B40 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r2, _08107B48 + ldrh r1, [r2] + movs r0, 0x16 + bl lcd_io_set + ldr r1, _08107B50 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08107B54 + movs r0, 0x30 + strh r0, [r1, 0x10] + movs r0, 0x70 + b _08107B58 + .align 2, 0 +_08107B40: .4byte 0x02022e18 +_08107B44: .4byte 0x0000ffd0 +_08107B48: .4byte 0x02022e1a +_08107B4C: .4byte 0x0000fffe +_08107B50: .4byte 0x03005e00 +_08107B54: + movs r0, 0 + strh r0, [r1, 0x10] +_08107B58: + strh r0, [r1, 0x12] + ldr r1, _08107B7C + mov r2, r10 + adds r0, r5, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x14] + ldr r1, _08107B80 + str r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08107B7C: .4byte 0x03005e00 +_08107B80: .4byte sub_8107B84 + 1 + thumb_func_end sub_8107954 + + thumb_func_start sub_8107B84 +sub_8107B84: @ 8107B84 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08107CB0 + ldr r2, _08107CB4 + ldr r0, _08107CB8 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x8] + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + ldrh r0, [r4, 0xA] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + mov r0, sp + bl sub_80A6B30 + ldrh r0, [r4, 0xA] + ldrh r3, [r4, 0xC] + adds r0, r3 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08107C18 + ldr r1, _08107CBC + mov r0, sp + ldrb r0, [r0, 0x8] + lsls r0, 4 + adds r0, 0x7 + lsls r0, 1 + adds r0, r1 + ldrh r6, [r0] + movs r2, 0x6 + adds r7, r1, 0 + adds r3, r7, 0 + mov r4, sp +_08107BDE: + ldrb r0, [r4, 0x8] + lsls r0, 4 + adds r1, r2, 0x1 + adds r0, r1 + lsls r1, r0, 1 + adds r1, r3 + subs r0, 0x1 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _08107BDE + mov r0, sp + ldrb r0, [r0, 0x8] + lsls r0, 4 + adds r0, 0x1 + lsls r0, 1 + adds r0, r7 + strh r6, [r0] + ldr r1, _08107CB8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x12] +_08107C18: + ldr r1, _08107CB8 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0x14] + adds r0, 0x1 + strh r0, [r3, 0x14] + lsls r0, 16 + asrs r0, 16 + adds r4, r1, 0 + adds r6, r2, 0 + cmp r0, 0x1 + ble _08107C86 + movs r0, 0 + strh r0, [r3, 0x14] + ldrh r0, [r3, 0xE] + adds r2, r0, 0x1 + strh r2, [r3, 0xE] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xD + bgt _08107C62 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + orrs r2, r0 + strh r2, [r1, 0xA] + ldrh r0, [r3, 0x10] + adds r0, 0x1 + strh r0, [r3, 0x10] +_08107C62: + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r0, 0x36 + ble _08107C86 + ldrh r2, [r3, 0x10] + subs r2, 0x1 + strh r2, [r3, 0x10] + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + orrs r2, r0 + strh r2, [r1, 0xA] +_08107C86: + adds r0, r6, r5 + lsls r0, 3 + adds r2, r0, r4 + movs r3, 0x26 + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldrh r0, [r0, 0xA] + movs r3, 0x1F + ands r3, r0 + cmp r3, 0 + bne _08107CA8 + strh r3, [r2, 0x8] + ldr r0, _08107CC0 + str r0, [r2] +_08107CA8: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08107CB0: .4byte 0x02022e18 +_08107CB4: .4byte 0x02022e1a +_08107CB8: .4byte 0x03005e00 +_08107CBC: .4byte 0x02037b14 +_08107CC0: .4byte sub_8107CC4 + 1 + thumb_func_end sub_8107B84 + + thumb_func_start sub_8107CC4 +sub_8107CC4: @ 8107CC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r7, _08107CFC + ldr r0, _08107D00 + mov r8, r0 + ldr r6, _08107D04 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08107D08 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08107D4A + .align 2, 0 +_08107CFC: .4byte 0x02022e18 +_08107D00: .4byte 0x02022e1a +_08107D04: .4byte 0x03005e00 +_08107D08: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08107D1C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08107D1C: + movs r0, 0 + strh r0, [r7] + mov r1, r8 + strh r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldr r1, _08107D54 + strh r1, [r0, 0x26] + adds r0, r5, 0 + bl move_anim_task_del +_08107D4A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08107D54: .4byte 0x0000ffff + thumb_func_end sub_8107CC4 + + thumb_func_start sub_8107D58 +sub_8107D58: @ 8107D58 + 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, _08107D80 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08107D74 + b _08107EAC +_08107D74: + cmp r0, 0x1 + bgt _08107D84 + cmp r0, 0 + beq _08107D8C + b _08108022 + .align 2, 0 +_08107D80: .4byte 0x03005e00 +_08107D84: + cmp r0, 0x2 + bne _08107D8A + b _08107F78 +_08107D8A: + b _08108022 +_08107D8C: + movs r3, 0 + movs r2, 0x10 + ldrsh r0, [r4, r2] + ldr r1, _08107E5C + mov r12, r1 + cmp r3, r0 + bge _08107DCA + mov r7, r12 + movs r5, 0xF0 + lsls r5, 3 + add r5, r12 + ldr r6, _08107E60 +_08107DA4: + lsls r2, r3, 16 + asrs r2, 16 + lsls r1, r2, 1 + adds r3, r1, r7 + adds r1, r5 + ldrh r0, [r4, 0xC] + strh r0, [r1] + ldrh r1, [r4, 0xC] + adds r0, r6, 0 + ands r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + lsrs r3, r2, 16 + asrs r2, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r2, r0 + blt _08107DA4 +_08107DCA: + ldrh r3, [r4, 0x10] + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08107E04 + ldr r5, _08107E5C + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 + ldr r7, _08107E60 +_08107DE2: + asrs r2, 16 + lsls r1, r2, 1 + adds r3, r1, r5 + adds r1, r6 + ldrh r0, [r4, 0xA] + strh r0, [r1] + ldrh r1, [r4, 0xA] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08107DE2 +_08107E04: + ldrh r3, [r4, 0x12] + lsls r2, r3, 16 + asrs r0, r2, 16 + cmp r0, 0x9F + bgt _08107E3A + ldr r5, _08107E5C + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 + ldr r7, _08107E60 +_08107E18: + asrs r2, 16 + lsls r1, r2, 1 + adds r3, r1, r5 + adds r1, r6 + ldrh r0, [r4, 0xC] + strh r0, [r1] + ldrh r1, [r4, 0xC] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + lsrs r3, r2, 16 + lsls r2, r3, 16 + asrs r0, r2, 16 + cmp r0, 0x9F + ble _08107E18 +_08107E3A: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08107E64 + lsls r0, r3, 16 + asrs r0, 15 + mov r3, r12 + adds r2, r0, r3 + movs r1, 0xF0 + lsls r1, 3 + add r1, r12 + adds r0, r1 + ldrh r1, [r4, 0xA] + strh r1, [r0] + ldrh r0, [r4, 0xA] + b _08107E7A + .align 2, 0 +_08107E5C: .4byte 0x02038c28 +_08107E60: .4byte 0x0000ffff +_08107E64: + lsls r0, r3, 16 + asrs r0, 15 + mov r1, r12 + adds r2, r0, r1 + movs r1, 0xF0 + lsls r1, 3 + add r1, r12 + adds r0, r1 + ldrh r1, [r4, 0xC] + strh r1, [r0] + ldrh r0, [r4, 0xC] +_08107E7A: + strh r0, [r2] + ldr r0, _08107EA4 + str r0, [sp] + ldr r0, _08107EA8 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08108022 + .align 2, 0 +_08107EA4: .4byte 0x04000052 +_08107EA8: .4byte 0xa2600001 +_08107EAC: + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08107EC4 + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bgt _08107ED8 + strh r1, [r4, 0x10] + b _08107ED2 +_08107EC4: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + ble _08107ED8 +_08107ED2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08107ED8: + movs r3, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _08107F0C + ldr r6, _08107F70 + ldr r5, _08107F74 +_08107EE6: + lsls r1, r3, 16 + asrs r1, 16 + lsls r3, r1, 1 + ldrb r2, [r5, 0x14] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 7 + adds r3, r0 + adds r3, r6 + ldrh r0, [r4, 0xC] + strh r0, [r3] + adds r1, 0x1 + lsls r1, 16 + lsrs r3, r1, 16 + asrs r1, 16 + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _08107EE6 +_08107F0C: + ldrh r3, [r4, 0x10] + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08107F40 + ldr r6, _08107F70 + ldr r5, _08107F74 +_08107F1E: + asrs r3, r2, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xA] + strh r0, [r2] + adds r3, 0x1 + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08107F1E +_08107F40: + ldrh r3, [r4, 0x12] + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _08108022 + ldr r6, _08107F70 + ldr r5, _08107F74 +_08107F4E: + asrs r3, r1, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _08107F4E + b _08108022 + .align 2, 0 +_08107F70: .4byte 0x02038c28 +_08107F74: .4byte 0x02039b28 +_08107F78: + movs r3, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _08107FAC + ldr r6, _0810802C + ldr r5, _08108030 +_08107F86: + lsls r1, r3, 16 + asrs r1, 16 + lsls r3, r1, 1 + ldrb r2, [r5, 0x14] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 7 + adds r3, r0 + adds r3, r6 + ldrh r0, [r4, 0xC] + strh r0, [r3] + adds r1, 0x1 + lsls r1, 16 + lsrs r3, r1, 16 + asrs r1, 16 + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _08107F86 +_08107FAC: + ldrh r3, [r4, 0x10] + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08107FE0 + ldr r6, _0810802C + ldr r5, _08108030 +_08107FBE: + asrs r3, r2, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xA] + strh r0, [r2] + adds r3, 0x1 + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08107FBE +_08107FE0: + ldrh r3, [r4, 0x12] + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _0810800C + ldr r6, _0810802C + ldr r5, _08108030 +_08107FEE: + asrs r3, r1, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _08107FEE +_0810800C: + movs r0, 0x26 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08108022 + bl remove_some_task + adds r0, r7, 0 + bl remove_task +_08108022: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810802C: .4byte 0x02038c28 +_08108030: .4byte 0x02039b28 + thumb_func_end sub_8107D58 + + thumb_func_start sub_8108034 +sub_8108034: @ 8108034 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r3, _08108088 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810808C + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + bl GenerateRandomNumber2 + movs r5, 0xFF + ands r5, r0 + movs r0, 0x80 + lsls r0, 1 + adds r6, r0, 0 + orrs r5, r6 + bl GenerateRandomNumber2 + ldr r1, _08108090 + ands r1, r0 + adds r0, r1, 0 + cmp r0, 0xFF + ble _0810807A + subs r0, r6, r0 + lsls r0, 16 + lsrs r1, r0, 16 +_0810807A: + strh r5, [r4, 0x30] + strh r1, [r4, 0x32] + ldr r0, _08108094 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08108088: .4byte 0x000003ff +_0810808C: .4byte 0xfffffc00 +_08108090: .4byte 0x000001ff +_08108094: .4byte sub_8108098 + 1 + thumb_func_end sub_8108034 + + thumb_func_start sub_8108098 +sub_8108098: @ 8108098 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r3, r0, r1 + strh r3, [r2, 0x34] + ldrh r1, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r1, r4 + strh r1, [r2, 0x36] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _081080BC + lsls r0, r3, 16 + asrs r0, 24 + negs r0, r0 + b _081080C0 +_081080BC: + lsls r0, r3, 16 + asrs r0, 24 +_081080C0: + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _081080DE + adds r0, r2, 0 + bl move_anim_8072740 +_081080DE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108098 + + thumb_func_start sub_81080E4 +sub_81080E4: @ 81080E4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _08108134 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r2, _08108138 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x12] + bl sub_8108384 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, _0810813C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08108134: .4byte 0x03005e00 +_08108138: .4byte 0x02020630 +_0810813C: .4byte sub_8108140 + 1 + thumb_func_end sub_81080E4 + + thumb_func_start sub_8108140 +sub_8108140: @ 8108140 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08108168 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bls _0810815C + b _0810837A +_0810815C: + lsls r0, 2 + ldr r1, _0810816C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08108168: .4byte 0x03005e00 +_0810816C: .4byte _08108170 + .align 2, 0 +_08108170: + .4byte _08108190 + .4byte _081081B6 + .4byte _08108248 + .4byte _0810827E + .4byte _08108292 + .4byte _081082A0 + .4byte _08108320 + .4byte _0810836C +_08108190: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 1 + movs r0, 0xE0 + str r0, [sp] + movs r0, 0x80 + lsls r0, 2 + str r0, [sp, 0x4] + movs r0, 0x20 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r2, r3, 0 + bl sub_80A805C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081081B6: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08108212 + movs r0, 0 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08108200 + ldr r2, _081081FC + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strh r1, [r0, 0x24] + movs r0, 0x26 + 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] + b _08108212 + .align 2, 0 +_081081FC: .4byte 0x02020630 +_08108200: + ldr r2, _08108240 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _08108244 + strh r1, [r0, 0x24] +_08108212: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _08108222 + b _0810837A +_08108222: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7E6C + ldr r2, _08108240 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + strh r5, [r4, 0xE] + b _0810835C + .align 2, 0 +_08108240: .4byte 0x02020630 +_08108244: .4byte 0x0000fffd +_08108248: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _08108258 + b _0810837A +_08108258: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 2 + movs r0, 0xC0 + lsls r0, 1 + str r0, [sp] + movs r0, 0xE0 + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0xE0 + bl sub_80A805C + movs r0, 0 + strh r0, [r4, 0xE] + b _0810835E +_0810827E: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0810837A + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + b _0810835E +_08108292: + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_8108408 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081082A0: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810837A + movs r0, 0 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081082D8 + ldr r2, _081082D4 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x2 + b _081082EA + .align 2, 0 +_081082D4: .4byte 0x02020630 +_081082D8: + ldr r2, _0810831C + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x2 +_081082EA: + strh r1, [r0, 0x26] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _0810837A + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xC0 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r3, 0xE0 + bl sub_80A805C + movs r0, 0 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + b _0810835E + .align 2, 0 +_0810831C: .4byte 0x02020630 +_08108320: + ldr r6, _08108368 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0, 0x22] + subs r1, 0x1 + strh r1, [r0, 0x22] + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0810837A + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x22] +_0810835C: + strh r5, [r4, 0x10] +_0810835E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810837A + .align 2, 0 +_08108368: .4byte 0x02020630 +_0810836C: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810837A + adds r0, r2, 0 + bl move_anim_task_del +_0810837A: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8108140 + + thumb_func_start sub_8108384 +sub_8108384: @ 8108384 + push {r4,r5,lr} + ldr r4, _081083A8 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081083B8 + ldr r1, _081083AC + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081083B0 + b _081083C8 + .align 2, 0 +_081083A8: .4byte 0x02038436 +_081083AC: .4byte 0x0202406e +_081083B0: .4byte 0x020244ec +_081083B4: + adds r0, r2, 0 + b _081083FA +_081083B8: + ldr r1, _08108400 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08108404 +_081083C8: + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r3, r0, 16 + lsrs r4, 18 + movs r2, 0 +_081083E6: + adds r1, r2, 0x1 + adds r0, r4, 0 + muls r0, r1 + cmp r3, r0 + blt _081083B4 + lsls r0, r1, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081083E6 + movs r0, 0x3 +_081083FA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08108400: .4byte 0x0202406e +_08108404: .4byte 0x02024744 + thumb_func_end sub_8108384 + + thumb_func_start sub_8108408 +sub_8108408: @ 8108408 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + ldr r4, _08108510 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0xAC + ldrb r0, [r4] + bl sub_80A82E4 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + ldrh r1, [r7, 0xA] + movs r0, 0x4 + subs r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bgt _08108458 + movs r1, 0x1 +_08108458: + movs r0, 0 + str r0, [sp, 0x4] + lsls r0, r1, 16 + mov r10, r8 + mov r9, r6 + mov r1, r10 + lsls r1, 4 + str r1, [sp, 0xC] + mov r1, r9 + lsls r1, 4 + str r1, [sp, 0x10] + asrs r0, 16 + mov r8, r0 +_08108472: + ldr r0, _08108514 + mov r1, r10 + mov r2, r9 + ldr r3, [sp, 0x8] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + lsls r6, r5, 16 + cmp r2, 0x40 + beq _081084DA + ldr r1, _08108518 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r1 + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x30] + mov r1, sp + ldrh r1, [r1, 0xC] + strh r1, [r5, 0x32] + mov r0, sp + ldrh r0, [r0, 0x10] + strh r0, [r5, 0x34] + asrs r4, r6, 16 + adds r0, r4, 0 + movs r1, 0x40 + bl cosine + strh r0, [r5, 0x36] + adds r0, r4, 0 + movs r1, 0x40 + bl sine + strh r0, [r5, 0x38] + mov r1, sp + ldrh r1, [r1] + strh r1, [r5, 0x3A] + movs r0, 0x2 + strh r0, [r5, 0x3C] + ldrh r1, [r7, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081084D4 + adds r0, r5, 0 + bl sub_810851C +_081084D4: + ldrh r0, [r7, 0xC] + adds r0, 0x1 + strh r0, [r7, 0xC] +_081084DA: + mov r1, r8 + lsls r0, r1, 1 + asrs r1, r6, 16 + adds r1, r0 + lsls r1, 16 + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r5, r0, 16 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r0, 16 + add r0, r8 + lsls r0, 16 + lsrs r1, r0, 16 + str r1, [sp, 0x4] + asrs r0, 16 + cmp r0, 0x13 + ble _08108472 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08108510: .4byte 0x02038436 +_08108514: .4byte 0x08595268 +_08108518: .4byte 0x02020630 + thumb_func_end sub_8108408 + + thumb_func_start sub_810851C +sub_810851C: @ 810851C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810852E + cmp r0, 0x1 + beq _08108564 + b _081085BE +_0810852E: + movs r2, 0x30 + ldrsh r0, [r4, r2] + movs r1, 0x6 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x36] + adds r1, r0 + strh r1, [r4, 0x36] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + ldrh r2, [r4, 0x38] + adds r1, r2 + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_08108564: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x38] + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r2, r1, 20 + strh r2, [r4, 0x22] + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _0810859A + adds r1, r2, 0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0810859A + cmp r1, 0x78 + ble _081085BE +_0810859A: + ldr r3, _081085C4 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_081085BE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081085C4: .4byte 0x03005e00 + thumb_func_end sub_810851C + + thumb_func_start sub_81085C8 +sub_81085C8: @ 81085C8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081085F8 + adds r4, r1, r0 + bl sub_8108384 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldr r0, _081085FC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08108600 + movs r0, 0x88 + strh r0, [r4, 0x10] + movs r0, 0x28 + b _08108606 + .align 2, 0 +_081085F8: .4byte 0x03005e00 +_081085FC: .4byte 0x02038436 +_08108600: + movs r0, 0x10 + strh r0, [r4, 0x10] + movs r0, 0x50 +_08108606: + strh r0, [r4, 0x14] + movs r0, 0x62 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x10] + adds r0, 0x31 + strh r0, [r4, 0x16] + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0x5 + strh r0, [r4, 0x20] + ldr r0, _08108628 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08108628: .4byte sub_810862C + 1 + thumb_func_end sub_81085C8 + + thumb_func_start sub_810862C +sub_810862C: @ 810862C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r7, _08108650 + adds r4, r0, r7 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0 + beq _08108654 + cmp r2, 0x1 + beq _08108704 + b _08108712 + .align 2, 0 +_08108650: .4byte 0x03005e00 +_08108654: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0810866A + strh r2, [r4, 0xC] + adds r0, r4, 0 + bl sub_810871C +_0810866A: + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081086E4 + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081086E4 + ldr r5, _081086F8 + movs r1, 0x1 + mov r8, r1 + mov r2, r8 + strh r2, [r5] + strh r0, [r5, 0x2] + movs r0, 0xC + strh r0, [r5, 0x4] + ldr r6, _081086FC + adds r0, r6, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081086B4 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r7 + ldr r1, [r0] + adds r0, r2, 0 + bl _call_via_r1 + ldr r1, _08108700 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081086B4: + movs r0, 0x3 + strh r0, [r5] + adds r0, r6, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081086E0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r7 + ldr r1, [r0] + adds r0, r2, 0 + bl _call_via_r1 + ldr r1, _08108700 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081086E0: + mov r0, r8 + strh r0, [r4, 0x22] +_081086E4: + movs r2, 0x1E + ldrsh r1, [r4, r2] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _08108712 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08108712 + .align 2, 0 +_081086F8: .4byte 0x0203841e +_081086FC: .4byte sub_81152DC + 1 +_08108700: .4byte 0x020383fe +_08108704: + movs r2, 0x1A + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08108712 + adds r0, r1, 0 + bl move_anim_task_del +_08108712: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_810862C + + thumb_func_start sub_810871C +sub_810871C: @ 810871C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r1, _081087A8 + movs r2, 0x18 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, 0x3 + asrs r0, 4 + ldrh r2, [r4, 0x14] + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _081087AC + movs r2, 0x16 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08108776 + ldr r3, _081087B0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _081087B4 + str r2, [r1] + adds r0, r3 + strh r5, [r0, 0x38] + strh r6, [r0, 0x3A] + movs r1, 0x9 + strh r1, [r0, 0x3C] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] +_08108776: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + ldrh r0, [r4, 0x18] + adds r0, 0x27 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x18] + movs r0, 0x16 + ldrsh r1, [r4, r0] + ldr r0, _081087B8 + muls r0, r1 + ldr r1, _081087BC + adds r0, r1 + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl __modsi3 + ldrh r1, [r4, 0x10] + adds r1, r0 + strh r1, [r4, 0x16] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081087A8: .4byte 0x08329f40 +_081087AC: .4byte 0x08595268 +_081087B0: .4byte 0x02020630 +_081087B4: .4byte sub_81087C0 + 1 +_081087B8: .4byte 0x41c64e6d +_081087BC: .4byte 0x00003039 + thumb_func_end sub_810871C + + thumb_func_start sub_81087C0 +sub_81087C0: @ 81087C0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08108856 + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x38 + ldrsh r1, [r5, r2] + cmp r0, r1 + blt _08108856 + ldr r2, _0810885C + movs r3, 0x3A + ldrsh r1, [r5, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x1C] + ldr r0, _08108860 + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x30] + cmp r0, 0x40 + beq _08108850 + movs r0, 0x30 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08108864 + adds r0, r4 + movs r1, 0x3 + bl sub_8008258 + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x3A] + strh r1, [r0, 0x3A] + movs r3, 0x30 + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x3C] + strh r1, [r0, 0x3C] + movs r0, 0x30 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, _08108868 + str r1, [r0] +_08108850: + adds r0, r5, 0 + bl obj_delete_and_free_tiles +_08108856: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810885C: .4byte 0x03005e00 +_08108860: .4byte 0x08597388 +_08108864: .4byte 0x02020630 +_08108868: .4byte sub_810886C + 1 + thumb_func_end sub_81087C0 + + thumb_func_start sub_810886C +sub_810886C: @ 810886C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081088D8 + movs r0, 0 + strh r0, [r4, 0x30] + 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] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _081088D8 + ldr r3, _081088E0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_081088D8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081088E0: .4byte 0x03005e00 + thumb_func_end sub_810886C + + thumb_func_start sub_81088E4 +sub_81088E4: @ 81088E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08108968 + adds r5, r1, r0 + ldr r4, _0810896C + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r5, 0xE] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08108928 + movs r1, 0x1 +_08108928: + strh r1, [r5, 0x16] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810893C + movs r1, 0x16 + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r5, 0x16] +_0810893C: + movs r2, 0x16 + ldrsh r0, [r5, r2] + lsls r0, 3 + ldrh r1, [r5, 0xE] + adds r0, r1 + strh r0, [r5, 0x12] + movs r2, 0x16 + ldrsh r1, [r5, r2] + lsls r1, 3 + ldrh r0, [r5, 0x10] + subs r0, r1 + strh r0, [r5, 0x14] + ldr r0, _08108970 + strh r0, [r5, 0x1A] + strh r6, [r5, 0xA] + strh r6, [r5, 0x8] + ldr r0, _08108974 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08108968: .4byte 0x03005e00 +_0810896C: .4byte 0x02038436 +_08108970: .4byte 0x0000ffe0 +_08108974: .4byte sub_8108978 + 1 + thumb_func_end sub_81088E4 + + thumb_func_start sub_8108978 +sub_8108978: @ 8108978 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810899C + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bls _08108992 + b _08108AB2 +_08108992: + lsls r0, 2 + ldr r1, _081089A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0810899C: .4byte 0x03005e00 +_081089A0: .4byte _081089A4 + .align 2, 0 +_081089A4: + .4byte _081089C0 + .4byte _081089D0 + .4byte _081089EA + .4byte _08108A2C + .4byte _08108A4E + .4byte _08108A7C + .4byte _08108AA2 +_081089C0: + adds r0, r4, 0 + bl sub_8108AC0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08108AB8 + b _08108AAA +_081089D0: + adds r0, r4, 0 + bl sub_8108AC0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08108AB8 + movs r0, 0 + strh r0, [r4, 0xA] + b _08108AAA +_081089EA: + adds r0, r4, 0 + bl sub_8108AC0 + movs r1, 0x16 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x12] + adds r1, r0 + movs r2, 0 + strh r1, [r4, 0x12] + adds r1, 0x10 + lsls r1, 16 + movs r0, 0x88 + lsls r0, 17 + cmp r1, r0 + bls _08108AB8 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08108A28 + movs r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x6 + strh r0, [r4, 0x8] + strh r2, [r4, 0xA] + b _08108AB8 +_08108A28: + strh r2, [r4, 0xA] + b _08108AAA +_08108A2C: + adds r0, r4, 0 + bl sub_8108AC0 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x14] + subs r0, r1 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08108AB8 + b _08108AAA +_08108A4E: + adds r0, r4, 0 + bl sub_8108AC0 + movs r1, 0x16 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x12] + adds r0, 0x10 + lsls r0, 16 + movs r1, 0x88 + lsls r1, 17 + cmp r0, r1 + bls _08108AB8 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0xA] + b _08108AAA +_08108A7C: + adds r0, r4, 0 + bl sub_8108AC0 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x14] + subs r0, r1 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08108AB8 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _08108AB8 +_08108AA2: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08108AB8 +_08108AAA: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08108AB8 +_08108AB2: + adds r0, r2, 0 + bl move_anim_task_del +_08108AB8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108978 + + thumb_func_start sub_8108AC0 +sub_8108AC0: @ 8108AC0 + push {r4-r6,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08108B1A + movs r0, 0 + strh r0, [r6, 0xC] + ldr r0, _08108B20 + movs r2, 0xE + ldrsh r1, [r6, r2] + movs r3, 0x10 + ldrsh r2, [r6, r3] + movs r3, 0xA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08108B1A + ldr r5, _08108B24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + movs r1, 0x10 + strh r1, [r0, 0x2E] + ldrh r1, [r6, 0x12] + strh r1, [r0, 0x32] + ldrh r1, [r6, 0x14] + strh r1, [r0, 0x36] + ldrh r1, [r6, 0x1A] + strh r1, [r0, 0x38] + bl sub_80A68D4 + adds r5, 0x1C + adds r4, r5 + ldr r0, _08108B28 + str r0, [r4] + ldrh r0, [r6, 0x18] + adds r0, 0x1 + strh r0, [r6, 0x18] +_08108B1A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08108B20: .4byte 0x08595268 +_08108B24: .4byte 0x02020630 +_08108B28: .4byte sub_8108B2C + 1 + thumb_func_end sub_8108AC0 + + thumb_func_start sub_8108B2C +sub_8108B2C: @ 8108B2C + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08108B86 + ldrh r0, [r6, 0x24] + ldrh r1, [r6, 0x20] + adds r0, r1 + strh r0, [r6, 0x20] + ldrh r0, [r6, 0x26] + ldrh r1, [r6, 0x22] + adds r0, r1 + strh r0, [r6, 0x22] + movs r0, 0x6 + strh r0, [r6, 0x2E] + bl GenerateRandomNumber2 + movs r4, 0x1F + adds r1, r4, 0 + ands r1, r0 + ldr r5, _08108B8C + adds r1, r5 + ldrh r0, [r6, 0x20] + adds r1, r0 + strh r1, [r6, 0x32] + bl GenerateRandomNumber2 + ands r4, r0 + adds r4, r5 + ldrh r1, [r6, 0x22] + adds r4, r1 + strh r4, [r6, 0x36] + bl GenerateRandomNumber2 + movs r1, 0x7 + ands r1, r0 + mvns r1, r1 + strh r1, [r6, 0x38] + adds r0, r6, 0 + bl sub_80A68D4 + ldr r0, _08108B90 + str r0, [r6, 0x1C] +_08108B86: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08108B8C: .4byte 0x0000fff0 +_08108B90: .4byte sub_8108B94 + 1 + thumb_func_end sub_8108B2C + + thumb_func_start sub_8108B94 +sub_8108B94: @ 8108B94 + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08108BD0 + movs r4, 0 + ldr r6, _08108BD8 +_08108BA6: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r6 + ldr r1, [r2] + ldr r0, _08108BDC + cmp r1, r0 + bne _08108BC6 + movs r0, 0x1 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0x18] + subs r0, 0x1 + strh r0, [r2, 0x18] + adds r0, r5, 0 + bl obj_delete_and_free_tiles +_08108BC6: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xF + bls _08108BA6 +_08108BD0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08108BD8: .4byte 0x03005e00 +_08108BDC: .4byte sub_8108978 + 1 + thumb_func_end sub_8108B94 + + thumb_func_start sub_8108BE0 +sub_8108BE0: @ 8108BE0 + ldr r2, _08108C00 + ldrh r1, [r2] + strh r1, [r0, 0x20] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x22] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x2E] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0x30] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0x32] + ldrh r1, [r2, 0xA] + strh r1, [r0, 0x34] + ldr r1, _08108C04 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08108C00: .4byte 0x0203841e +_08108C04: .4byte sub_8108C08 + 1 + thumb_func_end sub_8108BE0 + + thumb_func_start sub_8108C08 +sub_8108C08: @ 8108C08 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x2E] + subs r0, r1 + strh r0, [r4, 0x36] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x38] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08108C4C + adds r0, r4, 0 + bl move_anim_8072740 +_08108C4C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108C08 + + thumb_func_start sub_8108C54 +sub_8108C54: @ 8108C54 + push {r4,lr} + adds r4, r0, 0 + 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, 23 + strh r0, [r4, 0x24] + lsls r1, 16 + asrs r1, 23 + strh r1, [r4, 0x26] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _08108C8C + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08108C8C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108C54 + + thumb_func_start sub_8108C94 +sub_8108C94: @ 8108C94 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, _08108CD0 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x30] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldr r1, _08108CD4 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldr r0, _08108CD8 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08108CD0: .4byte 0x02038437 +_08108CD4: .4byte 0x0203841e +_08108CD8: .4byte sub_8108CDC + 1 + thumb_func_end sub_8108C94 + + thumb_func_start sub_8108CDC +sub_8108CDC: @ 8108CDC + push {r4-r6,lr} + adds r4, r0, 0 + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x20 + ldrsh r0, [r4, r2] + subs r6, r1, r0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x22 + ldrsh r0, [r4, r2] + subs r5, r1, r0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + muls r0, r6 + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + muls r0, r5 + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08108D34 + movs r0, 0 + strh r0, [r4, 0x38] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_8108D54 +_08108D34: + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08108D46 + adds r0, r4, 0 + bl move_anim_8072740 +_08108D46: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8108CDC + + thumb_func_start sub_8108D54 +sub_8108D54: @ 8108D54 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r4, r1, 0 + adds r5, r2, 0 + movs r2, 0x2E + ldrsh r1, [r0, r2] + lsrs r2, r1, 31 + adds r1, r2 + lsls r1, 15 + lsrs r1, 16 + str r1, [sp] + ldrh r1, [r0, 0x24] + ldrh r3, [r0, 0x20] + adds r1, r3 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r0, r5, r0 + subs r0, 0x5 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + bl GenerateRandomNumber2 + negs r4, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0 + subs r4, 0x5 + lsls r4, 16 + lsrs r7, r4, 16 + movs r6, 0 + mov r0, r8 + lsls r0, 16 + mov r8, r0 + mov r1, r10 + lsls r1, 16 + str r1, [sp, 0xC] + ldr r2, [sp] + lsls r2, 16 + str r2, [sp, 0x10] + asrs r1, 16 + lsls r0, r7, 16 + asrs r5, r0, 16 + str r0, [sp, 0x14] + negs r3, r5 + str r3, [sp, 0x4] + asrs r0, r2, 16 + adds r1, r0 + lsls r1, 16 + mov r10, r1 +_08108DE2: + ldr r0, _08108E24 + mov r2, r8 + asrs r1, r2, 16 + mov r3, r10 + asrs r2, r3, 16 + movs r3, 0x82 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08108E28 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r1 + movs r0, 0x14 + strh r0, [r4, 0x2E] + mov r0, r9 + strh r0, [r4, 0x30] + ldr r0, _08108E2C + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + cmp r5, 0 + bge _08108E30 + mov r1, sp + ldrh r1, [r1, 0x4] + strh r1, [r4, 0x32] + b _08108E32 + .align 2, 0 +_08108E24: .4byte 0x08595310 +_08108E28: .4byte 0x02020630 +_08108E2C: .4byte 0x02038436 +_08108E30: + strh r7, [r4, 0x32] +_08108E32: + lsls r0, r6, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r6, r0, 16 + cmp r0, 0 + ble _08108DE2 + movs r6, 0 + ldr r3, [sp, 0xC] + asrs r1, r3, 16 + ldr r0, [sp, 0x14] + asrs r5, r0, 16 + negs r2, r5 + str r2, [sp, 0x8] + ldr r3, [sp, 0x10] + asrs r0, r3, 16 + subs r1, r0 + lsls r1, 16 + mov r10, r1 +_08108E58: + ldr r0, _08108E9C + mov r2, r8 + asrs r1, r2, 16 + mov r3, r10 + asrs r2, r3, 16 + movs r3, 0x82 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08108EA0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r1 + movs r0, 0x14 + strh r0, [r4, 0x2E] + mov r0, r9 + strh r0, [r4, 0x30] + ldr r0, _08108EA4 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + cmp r5, 0 + ble _08108EA8 + mov r1, sp + ldrh r1, [r1, 0x8] + strh r1, [r4, 0x32] + b _08108EAA + .align 2, 0 +_08108E9C: .4byte 0x08595310 +_08108EA0: .4byte 0x02020630 +_08108EA4: .4byte 0x02038436 +_08108EA8: + strh r7, [r4, 0x32] +_08108EAA: + lsls r0, r6, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r6, r0, 16 + cmp r0, 0 + ble _08108E58 + 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_8108D54 + + thumb_func_start sub_8108EC8 +sub_8108EC8: @ 8108EC8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08108EFC + ldrh r0, [r0] + strh r0, [r4, 0x2E] + movs r0, 0x3C + strh r0, [r4, 0x30] + movs r0, 0x9 + strh r0, [r4, 0x32] + movs r0, 0x1E + strh r0, [r4, 0x34] + movs r0, 0xFE + lsls r0, 8 + strh r0, [r4, 0x36] + ldr r1, _08108F00 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, _08108F04 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08108EFC: .4byte 0x0203841e +_08108F00: .4byte move_anim_8072740 + 1 +_08108F04: .4byte sub_80A634C + 1 + thumb_func_end sub_8108EC8 + + thumb_func_start sub_8108F08 +sub_8108F08: @ 8108F08 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08108F40 + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x32] + ldr r0, _08108F44 + str r0, [r4, 0x1C] + ldr r1, _08108F48 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08108F40: .4byte 0x0203841e +_08108F44: .4byte sub_80A656C + 1 +_08108F48: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8108F08 + + thumb_func_start sub_8108F4C +sub_8108F4C: @ 8108F4C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, _08108F80 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08108F88 + ldr r2, _08108F84 + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r2, 0x8] + negs r0, r0 + strh r0, [r4, 0x32] + adds r1, r2, 0 + b _08108F9E + .align 2, 0 +_08108F80: .4byte 0x02038436 +_08108F84: .4byte 0x0203841e +_08108F88: + ldr r1, _08108FB4 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x32] +_08108F9E: + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x34] + ldr r0, _08108FB8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08108FB4: .4byte 0x0203841e +_08108FB8: .4byte sub_8109028 + 1 + thumb_func_end sub_8108F4C + + thumb_func_start sub_8108FBC +sub_8108FBC: @ 8108FBC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08108FE8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08108FF0 + ldr r2, _08108FEC + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r2, 0x8] + strh r0, [r4, 0x32] + adds r1, r2, 0 + b _08109008 + .align 2, 0 +_08108FE8: .4byte 0x02038436 +_08108FEC: .4byte 0x0203841e +_08108FF0: + ldr r1, _08109020 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x8] + negs r0, r0 + strh r0, [r4, 0x32] +_08109008: + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x34] + ldr r0, _08109024 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08109020: .4byte 0x0203841e +_08109024: .4byte sub_8109028 + 1 + thumb_func_end sub_8108FBC + + thumb_func_start sub_8109028 +sub_8109028: @ 8109028 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + bge _0810904E + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x26] + adds r0, r3 + strh r0, [r2, 0x26] +_0810904E: + movs r0, 0x2E + ldrsh r1, [r2, r0] + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r1, r0 + bne _08109060 + adds r0, r2, 0 + bl move_anim_8074EE0 +_08109060: + pop {r0} + bx r0 + thumb_func_end sub_8109028 + + thumb_func_start sub_8109064 +sub_8109064: @ 8109064 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, _08109088 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08109090 + ldr r0, _0810908C + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _081090A2 + .align 2, 0 +_08109088: .4byte 0x02038436 +_0810908C: .4byte 0x0203841e +_08109090: + ldr r0, _081090D0 + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + adds r2, r4, 0 + adds r2, 0x43 + movs r1, 0x8 + strb r1, [r2] +_081090A2: + adds r2, r0, 0 + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x22] + ldrh r0, [r2, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r2, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r2, 0x8] + strh r0, [r4, 0x32] + ldrh r0, [r2, 0xA] + strh r0, [r4, 0x34] + ldrh r0, [r2, 0xC] + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldr r0, _081090D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081090D0: .4byte 0x0203841e +_081090D4: .4byte sub_81090D8 + 1 + thumb_func_end sub_8109064 + + thumb_func_start sub_81090D8 +sub_81090D8: @ 81090D8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08109160 + movs r2, 0x38 + ldrsh r1, [r4, r2] + ldr r0, _08109144 + cmp r1, r0 + ble _081090F6 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + strb r0, [r1] +_081090F6: + 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 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 _0810914C + ldr r2, _08109148 + b _08109154 + .align 2, 0 +_08109144: .4byte 0x00002710 +_08109148: .4byte 0xffffff00 +_0810914C: + cmp r0, 0 + bge _08109158 + movs r2, 0x80 + lsls r2, 1 +_08109154: + adds r0, r1, r2 + strh r0, [r4, 0x2E] +_08109158: + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + b _08109166 +_08109160: + adds r0, r4, 0 + bl move_anim_8074EE0 +_08109166: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81090D8 + + thumb_func_start sub_810916C +sub_810916C: @ 810916C + push {lr} + movs r1, 0 + strh r1, [r0, 0x20] + strh r1, [r0, 0x22] + movs r1, 0x3C + strh r1, [r0, 0x2E] + movs r1, 0x8C + strh r1, [r0, 0x32] + movs r1, 0x50 + strh r1, [r0, 0x36] + ldr r1, _08109190 + str r1, [r0, 0x1C] + ldr r1, _08109194 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_08109190: .4byte sub_80A6EEC + 1 +_08109194: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810916C + + thumb_func_start sub_8109198 +sub_8109198: @ 8109198 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, _081091F0 + ldrb r0, [r5] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, _081091F4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _081091DE + movs r0, 0x2 + bl battle_get_side_with_given_state + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _081091D6 + movs r0, 0x3 + bl battle_get_side_with_given_state + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081091DE +_081091D6: + ldr r1, _081091F8 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_081091DE: + ldr r1, _081091FC + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081091F0: .4byte 0x02038436 +_081091F4: .4byte 0x02038437 +_081091F8: .4byte 0x0203841e +_081091FC: .4byte sub_80A7938 + 1 + thumb_func_end sub_8109198 + + thumb_func_start sub_8109200 +sub_8109200: @ 8109200 + ldr r2, _08109214 + ldrh r1, [r2] + negs r1, r1 + strh r1, [r2] + ldrh r1, [r2, 0x4] + negs r1, r1 + strh r1, [r2, 0x4] + ldr r1, _08109218 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_08109214: .4byte 0x0203841e +_08109218: .4byte sub_80A7938 + 1 + thumb_func_end sub_8109200 + + thumb_func_start sub_810921C +sub_810921C: @ 810921C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _0810923C + ldrh r0, [r0, 0x4] + movs r1, 0 + strh r0, [r4, 0x3C] + strh r1, [r4, 0x2E] + ldr r0, _08109240 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810923C: .4byte 0x0203841e +_08109240: .4byte sub_8109244 + 1 + thumb_func_end sub_810921C + + thumb_func_start sub_8109244 +sub_8109244: @ 8109244 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8109338 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x12 + bne _0810928E + movs r0, 0x19 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, _08109294 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _08109298 + str r0, [r5, 0x1C] +_0810928E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08109294: .4byte 0x02038437 +_08109298: .4byte sub_810929C + 1 + thumb_func_end sub_8109244 + + thumb_func_start sub_810929C +sub_810929C: @ 810929C + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _081092E4 + movs r4, 0 + strh r4, [r6, 0x2E] + ldr r5, _081092DC + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + strh r4, [r6, 0x26] + strh r4, [r6, 0x24] + ldr r1, _081092E0 + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + b _0810930E + .align 2, 0 +_081092DC: .4byte 0x02038437 +_081092E0: .4byte sub_8109314 + 1 +_081092E4: + movs r1, 0x3C + ldrsh r0, [r6, r1] + movs r1, 0x1C + bl sine + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r1, 0x3C + ldrsh r0, [r6, r1] + movs r1, 0x1C + bl cosine + ldrh r1, [r6, 0x26] + adds r0, r1 + strh r0, [r6, 0x26] + ldrh r0, [r6, 0x3C] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0x3C] +_0810930E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810929C + + thumb_func_start sub_8109314 +sub_8109314: @ 8109314 + push {r4,lr} + adds r4, r0, 0 + bl sub_8109338 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08109330 + adds r0, r4, 0 + bl move_anim_8072740 +_08109330: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109314 + + thumb_func_start sub_8109338 +sub_8109338: @ 8109338 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x1C + bl sine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x1C + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109338 + + thumb_func_start sub_8109364 +sub_8109364: @ 8109364 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08109398 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + 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, 0x32] + ldr r1, _0810939C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _081093A0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08109398: .4byte 0x0203841e +_0810939C: .4byte move_anim_8072740 + 1 +_081093A0: .4byte sub_80A653C + 1 + thumb_func_end sub_8109364 + + thumb_func_start sub_81093A4 +sub_81093A4: @ 81093A4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, _081093D8 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _081093DC + str r0, [r4, 0x1C] + ldr r1, _081093E0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081093D8: .4byte 0x0203841e +_081093DC: .4byte sub_80A64B0 + 1 +_081093E0: .4byte sub_81093E4 + 1 + thumb_func_end sub_81093A4 + + thumb_func_start sub_81093E4 +sub_81093E4: @ 81093E4 + push {lr} + adds r3, r0, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r3] + ldrh r1, [r0, 0x30] + movs r2, 0 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + ldr r1, _08109408 + str r1, [r0, 0x1C] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_08109408: .4byte sub_810940C + 1 + thumb_func_end sub_81093E4 + + thumb_func_start sub_810940C +sub_810940C: @ 810940C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0xD0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08109458 + adds r0, r4, 0 + bl move_anim_8072740 +_08109458: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810940C + + thumb_func_start sub_8109460 +sub_8109460: @ 8109460 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081094C0 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x26] + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + ldr r2, _081094C4 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x10] + ldr r0, _081094C8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + strh r5, [r4, 0x14] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, _081094CC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081094C0: .4byte 0x03005e00 +_081094C4: .4byte 0x02020630 +_081094C8: .4byte 0x02038436 +_081094CC: .4byte sub_81094D0 + 1 + thumb_func_end sub_8109460 + + thumb_func_start sub_81094D0 +sub_81094D0: @ 81094D0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081094F8 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bls _081094EC + b _081097AA +_081094EC: + lsls r0, 2 + ldr r1, _081094FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081094F8: .4byte 0x03005e00 +_081094FC: .4byte _08109500 + .align 2, 0 +_08109500: + .4byte _0810951C + .4byte _08109542 + .4byte _081095F4 + .4byte _08109654 + .4byte _08109672 + .4byte _08109748 + .4byte _0810979C +_0810951C: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 1 + movs r0, 0xE0 + str r0, [sp] + movs r0, 0x80 + lsls r0, 2 + str r0, [sp, 0x4] + movs r0, 0x20 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r2, r3, 0 + bl sub_80A805C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08109542: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810958A + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109578 + ldr r2, _08109574 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + b _08109588 + .align 2, 0 +_08109574: .4byte 0x02020630 +_08109578: + ldr r2, _081095EC + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _081095F0 +_08109588: + strh r1, [r0, 0x24] +_0810958A: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081095B8 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _081095B8 + movs r0, 0 + strh r0, [r4, 0xE] + ldr r2, _081095EC + movs r0, 0x26 + 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] +_081095B8: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081095C8 + b _081097AA +_081095C8: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7E6C + ldr r2, _081095EC + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + b _08109790 + .align 2, 0 +_081095EC: .4byte 0x02020630 +_081095F0: .4byte 0x0000fffd +_081095F4: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _08109604 + b _081097AA +_08109604: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810962E + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 2 + movs r0, 0xC0 + lsls r0, 1 + str r0, [sp] + movs r0, 0xF0 + str r0, [sp, 0x4] + movs r0, 0x6 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0xE0 + bl sub_80A805C + b _0810964E +_0810962E: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 2 + movs r0, 0xC0 + lsls r0, 1 + str r0, [sp] + movs r0, 0xC0 + str r0, [sp, 0x4] + movs r0, 0x6 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0xE0 + bl sub_80A805C +_0810964E: + movs r0, 0 + strh r0, [r4, 0xA] + b _08109790 +_08109654: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + cmp r0, 0 + beq _08109662 + b _081097AA +_08109662: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_81097B4 + b _08109790 +_08109672: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081096C0 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081096AC + ldr r2, _081096A8 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + b _081096BE + .align 2, 0 +_081096A8: .4byte 0x02020630 +_081096AC: + ldr r2, _081096F8 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x3 +_081096BE: + strh r1, [r0, 0x26] +_081096C0: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _081097AA + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081096FC + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xC0 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r3, 0xF0 + bl sub_80A805C + b _0810971A + .align 2, 0 +_081096F8: .4byte 0x02020630 +_081096FC: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xC0 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r3, 0xC0 + bl sub_80A805C +_0810971A: + ldrh r1, [r4, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109738 + ldr r2, _08109744 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] +_08109738: + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + b _08109790 + .align 2, 0 +_08109744: .4byte 0x02020630 +_08109748: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08109764 + ldr r2, _08109798 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x1 + strh r1, [r0, 0x22] +_08109764: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081097AA + ldr r2, _08109798 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + strh r1, [r0, 0x22] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + strh r5, [r4, 0xC] +_08109790: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081097AA + .align 2, 0 +_08109798: .4byte 0x02020630 +_0810979C: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081097AA + adds r0, r5, 0 + bl move_anim_task_del +_081097AA: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81094D0 + + thumb_func_start sub_81097B4 +sub_81097B4: @ 81097B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + adds r0, r4, 0 + bl sub_8109930 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r1, _08109804 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r4, [r0, 0x20] + ldr r0, _08109808 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810980C + adds r0, r4, 0 + subs r0, 0xC + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + b _08109816 + .align 2, 0 +_08109804: .4byte 0x02020630 +_08109808: .4byte 0x02038436 +_0810980C: + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xFF +_08109816: + movs r6, 0 + movs r5, 0 + lsls r4, 16 + str r4, [sp, 0x8] + mov r1, r9 + lsls r1, 16 + str r1, [sp, 0x4] + ldr r2, _081098D0 + mov r9, r2 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r3, r8 + lsls r3, 1 + mov r10, r3 +_08109834: + ldr r0, _081098D4 + ldr r2, [sp, 0x8] + asrs r1, r2, 16 + ldr r3, [sp, 0x4] + asrs r2, r3, 16 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _081098B6 + ldr r1, _081098D8 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r1 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + lsls r0, r5, 2 + adds r0, 0x40 + adds r1, r0 + ldr r3, _081098DC + adds r0, r3, 0 + ands r1, r0 + ldr r3, _081098E0 + adds r0, r3, 0 + ands r2, r0 + orrs r2, r1 + strh r2, [r4, 0x4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bls _0810987E + movs r5, 0 +_0810987E: + lsls r2, r6, 2 + mov r1, r9 + adds r0, r2, r1 + ldrh r0, [r0] + ldr r3, [sp] + adds r1, r0, 0 + muls r1, r3 + lsls r1, 16 + asrs r1, 16 + ldr r0, _081098E4 + adds r2, r0 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r0, r4, 0 + bl sub_8109984 + strh r7, [r4, 0x3A] + mov r0, r8 + strh r0, [r4, 0x3C] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + add r0, r10 + ldr r1, _081098E8 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] +_081098B6: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x6 + bls _08109834 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081098D0: .4byte 0x085955cc +_081098D4: .4byte 0x085955b4 +_081098D8: .4byte 0x02020630 +_081098DC: .4byte 0x000003ff +_081098E0: .4byte 0xfffffc00 +_081098E4: .4byte 0x085955ce +_081098E8: .4byte 0x03005e08 + thumb_func_end sub_81097B4 + + thumb_func_start sub_81098EC +sub_81098EC: @ 81098EC + push {r4,lr} + adds r4, r0, 0 + bl sub_81099A0 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08109926 + ldr r3, _0810992C + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08109926: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810992C: .4byte 0x03005e00 + thumb_func_end sub_81098EC + + thumb_func_start sub_8109930 +sub_8109930: @ 8109930 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08109968 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x26] + ldrh r0, [r1, 0x22] + adds r2, r0 + adds r1, 0x29 + movs r0, 0 + ldrsb r0, [r1, r0] + adds r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0810996C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08109970 + lsls r0, r4, 16 + movs r1, 0x94 + lsls r1, 15 + b _08109976 + .align 2, 0 +_08109968: .4byte 0x02020630 +_0810996C: .4byte 0x02038436 +_08109970: + lsls r0, r4, 16 + movs r1, 0xB0 + lsls r1, 14 +_08109976: + adds r0, r1 + lsrs r4, r0, 16 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8109930 + + thumb_func_start sub_8109984 +sub_8109984: @ 8109984 + movs r3, 0 + strh r3, [r0, 0x2E] + strh r3, [r0, 0x30] + ldrh r3, [r0, 0x20] + lsls r3, 3 + strh r3, [r0, 0x32] + ldrh r3, [r0, 0x22] + lsls r3, 3 + strh r3, [r0, 0x34] + lsls r1, 3 + strh r1, [r0, 0x36] + lsls r2, 3 + strh r2, [r0, 0x38] + bx lr + thumb_func_end sub_8109984 + + thumb_func_start sub_81099A0 +sub_81099A0: @ 81099A0 + 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, 0x2 + ble _081099CA + movs r0, 0 + strh r0, [r2, 0x2E] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x30] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + ldrh r3, [r2, 0x34] + adds r0, r3 + strh r0, [r2, 0x34] +_081099CA: + ldrh r0, [r2, 0x36] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 19 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x38] + ldrh r3, [r2, 0x34] + adds r1, r3 + strh r1, [r2, 0x34] + lsls r1, 16 + asrs r3, r1, 19 + strh r3, [r2, 0x22] + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _08109A00 + adds r1, r3, 0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _08109A00 + cmp r1, 0x78 + ble _08109A0C +_08109A00: + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08109A0C: + pop {r0} + bx r0 + thumb_func_end sub_81099A0 + + thumb_func_start sub_8109A10 +sub_8109A10: @ 8109A10 + push {r4,r5,lr} + ldr r3, _08109A54 + ldrh r1, [r3] + movs r2, 0 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x2] + strh r1, [r0, 0x22] + strh r2, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x32] + ldrh r1, [r3, 0x4] + strh r1, [r0, 0x3A] + ldrh r1, [r3, 0x6] + strh r1, [r0, 0x3C] + ldrh r4, [r0, 0x4] + lsls r2, r4, 22 + lsrs r2, 22 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r1, 4 + adds r2, r1 + ldr r3, _08109A58 + adds r1, r3, 0 + ands r2, r1 + ldr r1, _08109A5C + ands r1, r4 + orrs r1, r2 + strh r1, [r0, 0x4] + ldr r1, _08109A60 + str r1, [r0, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08109A54: .4byte 0x0203841e +_08109A58: .4byte 0x000003ff +_08109A5C: .4byte 0xfffffc00 +_08109A60: .4byte sub_8109A64 + 1 + thumb_func_end sub_8109A10 + + thumb_func_start sub_8109A64 +sub_8109A64: @ 8109A64 + push {r4,lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08109A96 + cmp r0, 0x1 + bgt _08109A7A + cmp r0, 0 + beq _08109A80 + b _08109AF4 +_08109A7A: + cmp r0, 0x2 + beq _08109AB4 + b _08109AF4 +_08109A80: + ldrh r1, [r2, 0x3A] + movs r3, 0x3A + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08109A90 + subs r0, r1, 0x1 + strh r0, [r2, 0x3A] + b _08109AF4 +_08109A90: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] +_08109A96: + ldrh r0, [r2, 0x22] + adds r0, 0x8 + strh r0, [r2, 0x22] + lsls r0, 16 + asrs r0, 16 + ldrh r3, [r2, 0x3C] + movs r4, 0x3C + ldrsh r1, [r2, r4] + cmp r0, r1 + blt _08109AF4 + strh r3, [r2, 0x22] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _08109AF4 +_08109AB4: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08109AE0 + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109ADC + ldr r0, _08109AD8 + b _08109ADE + .align 2, 0 +_08109AD8: .4byte 0x0000fffd +_08109ADC: + movs r0, 0x3 +_08109ADE: + strh r0, [r2, 0x26] +_08109AE0: + ldrh r0, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08109AF4 + adds r0, r2, 0 + bl move_anim_8072740 +_08109AF4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109A64 + + thumb_func_start sub_8109AFC +sub_8109AFC: @ 8109AFC + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08109B70 + cmp r0, 0x1 + bgt _08109B12 + cmp r0, 0 + beq _08109B18 + b _08109C3E +_08109B12: + cmp r0, 0x2 + beq _08109BCE + b _08109C3E +_08109B18: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC + ldr r4, _08109B40 + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl obj_anim_image_start + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x3C] + ldr r0, _08109B44 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08109B48 + movs r0, 0x4 + b _08109B4A + .align 2, 0 +_08109B40: .4byte 0x0203841e +_08109B44: .4byte 0x02038436 +_08109B48: + ldr r0, _08109B68 +_08109B4A: + strh r0, [r5, 0x36] + ldr r0, _08109B6C + ldrb r0, [r0] + bl sub_80A8328 + 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] + b _08109BC6 + .align 2, 0 +_08109B68: .4byte 0x0000fffc +_08109B6C: .4byte 0x02038437 +_08109B70: + ldrh r0, [r5, 0x30] + adds r0, 0xC0 + strh r0, [r5, 0x30] + ldr r0, _08109B90 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08109B94 + ldrh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + b _08109B9A + .align 2, 0 +_08109B90: .4byte 0x02038436 +_08109B94: + ldrh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 24 +_08109B9A: + strh r0, [r5, 0x26] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r2, 0x36 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08109C3E + movs r0, 0 + strh r0, [r5, 0x34] +_08109BC6: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08109C3E +_08109BCE: + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r2, 0x36 + ldrsh r1, [r5, r2] + bl sine + adds r2, r0, 0 + movs r3, 0 + strh r2, [r5, 0x24] + ldrh r0, [r5, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08109C3E + ldrh r0, [r5, 0x20] + adds r1, r2, r0 + strh r1, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r3, [r5, 0x26] + strh r3, [r5, 0x24] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x2E] + strh r1, [r5, 0x30] + ldr r4, _08109C44 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6FD4 + ldr r0, _08109C48 + str r0, [r5, 0x1C] +_08109C3E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08109C44: .4byte 0x02038437 +_08109C48: .4byte sub_8109C4C + 1 + thumb_func_end sub_8109AFC + + thumb_func_start sub_8109C4C +sub_8109C4C: @ 8109C4C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _08109CA4 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x38] + adds r0, r2, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x38] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _08109C82 + cmp r2, 0xC4 + ble _08109CAA +_08109C82: + lsls r0, 16 + cmp r0, 0 + ble _08109CAA + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08109CAA + ldr r0, _08109CA0 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x90 + bl audio_play_and_stuff + b _08109CAA + .align 2, 0 +_08109CA0: .4byte 0x02038440 +_08109CA4: + adds r0, r4, 0 + bl move_anim_8072740 +_08109CAA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109C4C + + thumb_func_start sub_8109CB0 +sub_8109CB0: @ 8109CB0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08109CC8 + ldr r0, _08109D34 + ldrh r0, [r0] + strh r0, [r4, 0x30] + adds r0, r1, 0x1 + strh r0, [r4, 0x2E] +_08109CC8: + movs r0, 0xC0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0xA0 + strh r0, [r4, 0x36] + movs r2, 0x30 + ldrsh r0, [r4, r2] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x36] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08109D64 + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x83 + bls _08109D3C + ldr r0, _08109D38 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + b _08109D80 + .align 2, 0 +_08109D34: .4byte 0x0203841e +_08109D38: .4byte 0x02038437 +_08109D3C: + ldr r0, _08109D60 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + b _08109D80 + .align 2, 0 +_08109D60: .4byte 0x02038437 +_08109D64: + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x83 + bls _08109D78 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D + b _08109D7E +_08109D78: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F +_08109D7E: + strb r0, [r1] +_08109D80: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08109DA8 + 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] +_08109DA8: + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x1E + bne _08109DB6 + adds r0, r4, 0 + bl move_anim_8072740 +_08109DB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109CB0 + + thumb_func_start sub_8109DBC +sub_8109DBC: @ 8109DBC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08109E1C + adds r4, r1, r0 + ldr r0, _08109E20 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08109DE2 + movs r1, 0x1 +_08109DE2: + strh r1, [r4, 0x20] + ldr r0, _08109E24 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + movs r0, 0x3 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, _08109E28 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08109E1C: .4byte 0x03005e00 +_08109E20: .4byte 0x02038436 +_08109E24: .4byte 0x02038437 +_08109E28: .4byte sub_8109E2C + 1 + thumb_func_end sub_8109DBC + + thumb_func_start sub_8109E2C +sub_8109E2C: @ 8109E2C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08109E50 + adds r2, r0, r1 + movs r0, 0x8 + ldrsh r3, [r2, r0] + cmp r3, 0x1 + beq _08109EF4 + cmp r3, 0x1 + bgt _08109E54 + cmp r3, 0 + beq _08109E62 + b _0810A054 + .align 2, 0 +_08109E50: .4byte 0x03005e00 +_08109E54: + cmp r3, 0x2 + bne _08109E5A + b _08109F7C +_08109E5A: + cmp r3, 0x3 + bne _08109E60 + b _0810A010 +_08109E60: + b _0810A054 +_08109E62: + movs r1, 0x20 + ldrsh r0, [r2, r1] + lsls r0, 1 + ldrh r5, [r2, 0x1C] + adds r0, r5 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08109E94 + strh r3, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109E90 + movs r0, 0x2 + b _08109E92 +_08109E90: + ldr r0, _08109EEC +_08109E92: + strh r0, [r2, 0x1E] +_08109E94: + movs r1, 0 + strh r1, [r2, 0xE] + movs r7, 0x22 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _08109ED6 + ldr r4, _08109EF0 + adds r3, r2, 0 + adds r3, 0x8 +_08109EA6: + movs r1, 0xE + ldrsh r0, [r2, r1] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r5, 0 + ldrsh r0, [r0, r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r2, 0x1E] + ldrh r7, [r2, 0x1C] + adds r0, r7 + strh r0, [r1, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r5, 0x22 + ldrsh r1, [r2, r5] + cmp r0, r1 + blt _08109EA6 +_08109ED6: + ldrh r0, [r2, 0x1A] + adds r0, 0x1 + strh r0, [r2, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + beq _08109EE6 + b _0810A054 +_08109EE6: + movs r0, 0 + strh r0, [r2, 0x1A] + b _0810A000 + .align 2, 0 +_08109EEC: .4byte 0x0000fffe +_08109EF0: .4byte 0x02020630 +_08109EF4: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08109F1C + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + ands r0, r3 + lsls r0, 16 + cmp r0, 0 + beq _08109F18 + movs r0, 0x2 + b _08109F1A +_08109F18: + ldr r0, _08109F74 +_08109F1A: + strh r0, [r2, 0x1E] +_08109F1C: + movs r1, 0 + strh r1, [r2, 0xE] + movs r7, 0x22 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _08109F5E + ldr r4, _08109F78 + adds r3, r2, 0 + adds r3, 0x8 +_08109F2E: + movs r1, 0xE + ldrsh r0, [r2, r1] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r5, 0 + ldrsh r0, [r0, r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r2, 0x1E] + ldrh r7, [r2, 0x1C] + adds r0, r7 + strh r0, [r1, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r5, 0x22 + ldrsh r1, [r2, r5] + cmp r0, r1 + blt _08109F2E +_08109F5E: + ldrh r0, [r2, 0x1A] + adds r0, 0x1 + strh r0, [r2, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x60 + bne _0810A054 + movs r0, 0 + strh r0, [r2, 0x1A] + b _0810A000 + .align 2, 0 +_08109F74: .4byte 0x0000fffe +_08109F78: .4byte 0x02020630 +_08109F7C: + movs r7, 0x20 + ldrsh r1, [r2, r7] + lsls r1, 1 + ldrh r0, [r2, 0x1C] + subs r0, r1 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08109FB0 + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109FAC + strh r3, [r2, 0x1E] + b _08109FB0 +_08109FAC: + ldr r0, _0810A008 + strh r0, [r2, 0x1E] +_08109FB0: + movs r1, 0 + strh r1, [r2, 0xE] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r1, r0 + bge _08109FF2 + ldr r4, _0810A00C + adds r3, r2, 0 + adds r3, 0x8 +_08109FC2: + movs r5, 0xE + ldrsh r0, [r2, r5] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r7, 0 + ldrsh r0, [r0, r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r2, 0x1E] + ldrh r5, [r2, 0x1C] + adds r0, r5 + strh r0, [r1, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r7, 0x22 + ldrsh r1, [r2, r7] + cmp r0, r1 + blt _08109FC2 +_08109FF2: + ldrh r0, [r2, 0x1A] + adds r0, 0x1 + strh r0, [r2, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0810A054 +_0810A000: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0810A054 + .align 2, 0 +_0810A008: .4byte 0x0000fffe +_0810A00C: .4byte 0x02020630 +_0810A010: + movs r1, 0 + strh r1, [r2, 0xE] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r1, r0 + bge _0810A04E + ldr r6, _0810A05C + adds r3, r2, 0 + adds r3, 0x8 + movs r5, 0 +_0810A024: + movs r7, 0xE + ldrsh r0, [r2, r7] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r5, [r0, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r7, 0x22 + ldrsh r1, [r2, r7] + cmp r0, r1 + blt _0810A024 +_0810A04E: + adds r0, r4, 0 + bl move_anim_task_del +_0810A054: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810A05C: .4byte 0x02020630 + thumb_func_end sub_8109E2C + + thumb_func_start sub_810A060 +sub_810A060: @ 810A060 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x8] + lsls r0, 4 + ldr r1, _0810A090 + ldrb r2, [r1] + ldrh r3, [r1, 0x2] + movs r1, 0x10 + bl pal_fade_1 + adds r0, r4, 0 + bl move_anim_task_del + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810A090: .4byte 0x0203841e + thumb_func_end sub_810A060 + + thumb_func_start sub_810A094 +sub_810A094: @ 810A094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _0810A0EC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x8 + ldrsh r0, [r2, r3] + mov r9, r1 + ldr r4, _0810A0F0 + mov r8, r4 + cmp r0, 0 + bne _0810A0CA + ldrh r0, [r4] + strh r0, [r2, 0xA] + ldrh r0, [r4, 0x2] + strh r0, [r2, 0xC] + ldrh r0, [r4, 0x4] + strh r0, [r2, 0xE] + ldrh r0, [r4, 0x6] + strh r0, [r2, 0x10] +_0810A0CA: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldr r1, _0810A0F4 + ldr r0, _0810A0F8 + ldrb r0, [r0] + adds r0, r1 + ldrb r6, [r0] + movs r5, 0x10 + ldrsh r0, [r2, r5] + cmp r0, 0 + bne _0810A100 + ldr r4, _0810A0FC + movs r1, 0x8 + ldrsh r0, [r2, r1] + b _0810A106 + .align 2, 0 +_0810A0EC: .4byte 0x03005e00 +_0810A0F0: .4byte 0x0203841e +_0810A0F4: .4byte 0x020241e4 +_0810A0F8: .4byte 0x02038437 +_0810A0FC: .4byte 0x08595684 +_0810A100: + ldr r4, _0810A14C + movs r3, 0x8 + ldrsh r0, [r2, r3] +_0810A106: + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + adds r0, r4 + ldrb r5, [r0] + lsls r0, r7, 2 + adds r1, r0, r7 + lsls r1, 3 + add r1, r9 + movs r4, 0xE + ldrsh r1, [r1, r4] + mov r12, r0 + cmp r1, 0x1 + bne _0810A154 + ldr r2, _0810A150 + lsls r3, r6, 4 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + mov r10, r0 + mov r0, r8 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r5, 24 + asrs r0, 24 + muls r0, r1 + cmp r0, 0 + bge _0810A144 + negs r0, r0 +_0810A144: + mov r5, r10 + strh r0, [r5, 0x26] + b _0810A16E + .align 2, 0 +_0810A14C: .4byte 0x08595694 +_0810A150: .4byte 0x02020630 +_0810A154: + ldr r3, _0810A1A4 + lsls r4, r6, 4 + adds r2, r4, r6 + lsls r2, 2 + adds r2, r3 + lsls r0, r5, 24 + asrs r0, 24 + mov r5, r8 + ldrh r1, [r5, 0x2] + muls r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0810A16E: + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r9 + movs r4, 0x8 + ldrsh r1, [r0, r4] + movs r5, 0xA + ldrsh r0, [r0, r5] + cmp r1, r0 + bne _0810A194 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + strh r1, [r0, 0x26] + adds r0, r7, 0 + bl move_anim_task_del +_0810A194: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810A1A4: .4byte 0x02020630 + thumb_func_end sub_810A094 + + thumb_func_start sub_810A1A8 +sub_810A1A8: @ 810A1A8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810A1C8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810A1D0 + ldr r0, _0810A1CC + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _0810A1DC + .align 2, 0 +_0810A1C8: .4byte 0x02038436 +_0810A1CC: .4byte 0x0203841e +_0810A1D0: + ldr r1, _0810A1F0 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, r1, 0 +_0810A1DC: + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, _0810A1F4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810A1F0: .4byte 0x0203841e +_0810A1F4: .4byte sub_810A1F8 + 1 + thumb_func_end sub_810A1A8 + + thumb_func_start sub_810A1F8 +sub_810A1F8: @ 810A1F8 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810A20E + adds r0, r2, 0 + bl move_anim_8072740 +_0810A20E: + pop {r0} + bx r0 + thumb_func_end sub_810A1F8 + + thumb_func_start sub_810A214 +sub_810A214: @ 810A214 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810A234 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810A23C + ldr r0, _0810A238 + ldrh r1, [r4, 0x20] + ldrh r0, [r0] + subs r1, r0 + strh r1, [r4, 0x20] + b _0810A246 + .align 2, 0 +_0810A234: .4byte 0x02038436 +_0810A238: .4byte 0x0203841e +_0810A23C: + ldr r0, _0810A250 + ldrh r0, [r0] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] +_0810A246: + ldr r0, _0810A254 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810A250: .4byte 0x0203841e +_0810A254: .4byte sub_810A258 + 1 + thumb_func_end sub_810A214 + + thumb_func_start sub_810A258 +sub_810A258: @ 810A258 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810A26E + adds r0, r2, 0 + bl move_anim_8074EE0 +_0810A26E: + pop {r0} + bx r0 + thumb_func_end sub_810A258 + + thumb_func_start sub_810A274 +sub_810A274: @ 810A274 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810A2B8 + 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] + ldr r0, _0810A2BC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810A2C4 + ldr r2, _0810A2C0 + ldrh r0, [r5, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + ldrh r1, [r2, 0x2] + subs r0, r1 + strh r0, [r5, 0x22] + b _0810A2D8 + .align 2, 0 +_0810A2B8: .4byte 0x02038437 +_0810A2BC: .4byte 0x02038436 +_0810A2C0: .4byte 0x0203841e +_0810A2C4: + ldr r0, _0810A2FC + ldrh r1, [r0] + ldrh r2, [r5, 0x20] + adds r1, r2 + strh r1, [r5, 0x20] + ldrh r1, [r0, 0x2] + ldrh r2, [r5, 0x22] + adds r1, r2 + strh r1, [r5, 0x22] + adds r2, r0, 0 +_0810A2D8: + movs r0, 0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x6] + strh r0, [r5, 0x32] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x34] + ldr r1, _0810A300 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810A304 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810A2FC: .4byte 0x0203841e +_0810A300: .4byte move_anim_8074EE0 + 1 +_0810A304: .4byte sub_80A62EC + 1 + thumb_func_end sub_810A274 + + thumb_func_start sub_810A308 +sub_810A308: @ 810A308 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, _0810A320 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _0810A380 + cmp r0, 0x1 + bgt _0810A324 + cmp r0, 0 + beq _0810A32E + b _0810A380 + .align 2, 0 +_0810A320: .4byte 0x0203841e +_0810A324: + cmp r0, 0x2 + beq _0810A338 + cmp r0, 0x3 + beq _0810A35C + b _0810A380 +_0810A32E: + ldr r0, _0810A334 + b _0810A382 + .align 2, 0 +_0810A334: .4byte 0x02038436 +_0810A338: + ldr r4, _0810A350 + ldrb r0, [r4] + movs r6, 0x2 + eors r0, r6 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _0810A354 + ldrb r4, [r4] + b _0810A384 + .align 2, 0 +_0810A350: .4byte 0x02038436 +_0810A354: + ldrb r0, [r4] + adds r4, r6, 0 + eors r4, r0 + b _0810A384 +_0810A35C: + ldr r0, _0810A378 + ldrb r0, [r0] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810A380 + ldr r0, _0810A37C + ldrb r0, [r0] + eors r4, r0 + b _0810A384 + .align 2, 0 +_0810A378: .4byte 0x02038436 +_0810A37C: .4byte 0x02038437 +_0810A380: + ldr r0, _0810A3A4 +_0810A382: + ldrb r4, [r0] +_0810A384: + ldr r0, _0810A3A8 + movs r2, 0xA + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0810A3AC + adds r0, r4, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r4, 0 + movs r1, 0x1 + b _0810A3BE + .align 2, 0 +_0810A3A4: .4byte 0x02038437 +_0810A3A8: .4byte 0x0203841e +_0810A3AC: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r4, 0 + movs r1, 0x3 +_0810A3BE: + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r7, _0810A45C + ldr r6, _0810A460 + movs r1, 0 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r0, r7 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r2, 0x2 + ldrsh r0, [r6, r2] + muls r0, r1 + asrs r0, 8 + strh r0, [r5, 0x24] + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, 0x40 + lsls r0, 1 + adds r0, r7 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r2, 0x2 + ldrsh r0, [r6, r2] + muls r0, r1 + asrs r0, 8 + strh r0, [r5, 0x26] + ldrh r1, [r6, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810A422 + adds r0, r4, 0 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r5, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] +_0810A422: + ldrb r2, [r5, 0x3] + lsls r2, 26 + lsrs r2, 27 + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + ldr r3, _0810A464 + lsls r2, 3 + adds r2, r3 + adds r1, 0x40 + lsls r1, 1 + adds r1, r7 + ldrh r1, [r1] + strh r1, [r2, 0x6] + strh r1, [r2] + strh r0, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r2, 0x4] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x2E] + ldr r0, _0810A468 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810A45C: .4byte 0x08329f40 +_0810A460: .4byte 0x0203841e +_0810A464: .4byte 0x02021bc0 +_0810A468: .4byte sub_810E2C8 + 1 + thumb_func_end sub_810A308 + + thumb_func_start sub_810A46C +sub_810A46C: @ 810A46C + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, _0810A4E0 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r6, _0810A4E4 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x38] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x3A] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x3C] + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0xC + ldrsh r0, [r5, r3] + lsls r0, 2 + adds r1, r0 + ldr r3, _0810A4E8 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810A4EC + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r1, _0810A4F0 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810A4E0: .4byte 0x0203841e +_0810A4E4: .4byte 0x02038437 +_0810A4E8: .4byte 0x000003ff +_0810A4EC: .4byte 0xfffffc00 +_0810A4F0: .4byte sub_810A4F4 + 1 + thumb_func_end sub_810A46C + + thumb_func_start sub_810A4F4 +sub_810A4F4: @ 810A4F4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _0810A55E + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0810A564 + 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 _0810A564 +_0810A55E: + adds r0, r4, 0 + bl move_anim_8072740 +_0810A564: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810A4F4 + + thumb_func_start sub_810A56C +sub_810A56C: @ 810A56C + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x38] + subs r0, 0x1 + strh r0, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810A5A4 + 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] + ldrh r0, [r3, 0x36] + strh r0, [r3, 0x38] +_0810A5A4: + ldrh r0, [r3, 0x34] + subs r1, r0, 0x1 + strh r1, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bgt _0810A5B6 + adds r0, r3, 0 + bl move_anim_8072740 +_0810A5B6: + pop {r0} + bx r0 + thumb_func_end sub_810A56C + + thumb_func_start sub_810A5BC +sub_810A5BC: @ 810A5BC + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810A5D8 + ldr r0, _0810A61C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810A5E0 +_0810A5D8: + ldr r1, _0810A620 + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_0810A5E0: + ldr r5, _0810A61C + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _0810A620 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4] + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x6] + strh r0, [r6, 0x36] + strh r0, [r6, 0x38] + ldr r0, _0810A624 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810A61C: .4byte 0x02038437 +_0810A620: .4byte 0x0203841e +_0810A624: .4byte sub_810A56C + 1 + thumb_func_end sub_810A5BC + + thumb_func_start sub_810A628 +sub_810A628: @ 810A628 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r1, _0810A644 + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x2E] + movs r2, 0xE + ldrsh r0, [r1, r2] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810A64C + ldr r0, _0810A648 + b _0810A64E + .align 2, 0 +_0810A644: .4byte 0x0203841e +_0810A648: .4byte 0x02038437 +_0810A64C: + ldr r0, _0810A6D4 +_0810A64E: + ldrb r6, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810A666 + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810A66E +_0810A666: + ldr r1, _0810A6D8 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810A66E: + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _0810A6D8 + lsrs r0, 24 + ldrh r3, [r4] + adds r0, r3 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + ldr r0, _0810A6DC + ands r0, r1 + strh r0, [r5, 0x36] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x38] + ldrh r0, [r4, 0xA] + strh r0, [r5, 0x3A] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x3C] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 2 + adds r1, r0 + ldr r3, _0810A6E0 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810A6E4 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r1, _0810A6E8 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810A6D4: .4byte 0x02038436 +_0810A6D8: .4byte 0x0203841e +_0810A6DC: .4byte 0x00007fff +_0810A6E0: .4byte 0x000003ff +_0810A6E4: .4byte 0xfffffc00 +_0810A6E8: .4byte sub_810A6EC + 1 + thumb_func_end sub_810A628 + + thumb_func_start sub_810A6EC +sub_810A6EC: @ 810A6EC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _0810A742 + 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] +_0810A742: + ldrh r0, [r4, 0x2E] + subs r1, r0, 0x1 + strh r1, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _0810A754 + adds r0, r4, 0 + bl move_anim_8072740 +_0810A754: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810A6EC + + thumb_func_start sub_810A75C +sub_810A75C: @ 810A75C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A6980 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + ldr r3, _0810A798 + movs r5, 0x6 + ldrsh r0, [r3, r5] + lsls r0, 2 + adds r1, r0 + ldr r5, _0810A79C + adds r0, r5, 0 + ands r1, r0 + ldr r0, _0810A7A0 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r1, 0x6 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _0810A7A4 + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + b _0810A7B2 + .align 2, 0 +_0810A798: .4byte 0x0203841e +_0810A79C: .4byte 0x000003ff +_0810A7A0: .4byte 0xfffffc00 +_0810A7A4: + cmp r0, 0x2 + bne _0810A7B6 + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x20 +_0810A7B2: + orrs r1, r0 + strb r1, [r4, 0x3] +_0810A7B6: + ldr r0, _0810A7D0 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r0, _0810A7D4 + str r0, [r4, 0x1C] + ldr r1, _0810A7D8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810A7D0: .4byte 0x0203841e +_0810A7D4: .4byte sub_80A64B0 + 1 +_0810A7D8: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810A75C + + thumb_func_start sub_810A7DC +sub_810A7DC: @ 810A7DC + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _0810A824 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + ldr r1, _0810A828 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + ldr r5, _0810A82C + lsrs r0, 24 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r4, 0x8] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldr r0, _0810A830 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810A824: .4byte 0x02038437 +_0810A828: .4byte 0x03005e00 +_0810A82C: .4byte 0x0203841e +_0810A830: .4byte sub_810A834 + 1 + thumb_func_end sub_810A7DC + + thumb_func_start sub_810A834 +sub_810A834: @ 810A834 + 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 r5, 0 + movs r7, 0 + ldr r1, _0810A874 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrb r2, [r0, 0xC] + str r2, [sp] + ldrh r4, [r0, 0x8] + ldrh r6, [r0, 0xA] + movs r3, 0xC + ldrsh r0, [r0, r3] + mov r10, r1 + cmp r0, 0 + bne _0810A878 + movs r0, 0 + mov r8, r0 + movs r2, 0x1 + movs r1, 0x10 + mov r12, r1 + b _0810A882 + .align 2, 0 +_0810A874: .4byte 0x03005e00 +_0810A878: + movs r2, 0x10 + mov r12, r2 + movs r3, 0x8 + mov r8, r3 + movs r2, 0x4 +_0810A882: + mov r0, r9 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r0, 3 + add r0, r10 + movs r3, 0x1C + ldrsh r0, [r0, r3] + mov r10, r1 + cmp r0, 0xA + bhi _0810A978 + lsls r0, 2 + ldr r1, _0810A8A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0810A8A0: .4byte _0810A8A4 + .align 2, 0 +_0810A8A4: + .4byte _0810A8D0 + .4byte _0810A978 + .4byte _0810A8E4 + .4byte _0810A978 + .4byte _0810A904 + .4byte _0810A978 + .4byte _0810A91A + .4byte _0810A978 + .4byte _0810A93C + .4byte _0810A978 + .4byte _0810A970 +_0810A8D0: + ldr r0, _0810A8E0 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + mov r4, r12 + lsls r3, r4, 16 + b _0810A952 + .align 2, 0 +_0810A8E0: .4byte 0x08595828 +_0810A8E4: + mov r0, r12 + lsls r3, r0, 17 + mov r1, r8 + adds r0, r1, r2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0810A900 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + b _0810A952 + .align 2, 0 +_0810A900: .4byte 0x08595828 +_0810A904: + mov r3, r12 + lsls r0, r3, 16 + asrs r0, 16 + lsls r3, r0, 1 + adds r3, r0 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + b _0810A946 +_0810A91A: + mov r0, r12 + lsls r3, r0, 18 + lsls r0, r2, 1 + adds r0, r2 + add r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0810A938 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + b _0810A952 + .align 2, 0 +_0810A938: .4byte 0x08595828 +_0810A93C: + mov r1, r12 + lsls r0, r1, 16 + asrs r0, 16 + lsls r3, r0, 2 + adds r3, r0 +_0810A946: + ldr r0, _0810A96C + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + lsls r3, 16 +_0810A952: + asrs r3, 16 + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0810A978 + .align 2, 0 +_0810A96C: .4byte 0x08595828 +_0810A970: + mov r0, r9 + bl move_anim_task_del + b _0810A9BC +_0810A978: + cmp r7, 0 + beq _0810A9AC + ldr r4, _0810A9CC + lsls r3, r5, 4 + adds r3, r5 + lsls r3, 2 + adds r0, r3, r4 + ldrh r5, [r0, 0x4] + lsls r2, r5, 22 + lsrs r2, 22 + add r2, r8 + ldr r6, _0810A9D0 + adds r1, r6, 0 + ands r2, r1 + ldr r1, _0810A9D4 + ands r1, r5 + orrs r1, r2 + strh r1, [r0, 0x4] + mov r1, sp + ldrh r1, [r1] + strh r1, [r0, 0x2E] + adds r4, 0x1C + adds r3, r4 + ldr r1, [r3] + bl _call_via_r1 +_0810A9AC: + ldr r0, _0810A9D8 + mov r1, r10 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] +_0810A9BC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810A9CC: .4byte 0x02020630 +_0810A9D0: .4byte 0x000003ff +_0810A9D4: .4byte 0xfffffc00 +_0810A9D8: .4byte 0x03005e00 + thumb_func_end sub_810A834 + + thumb_func_start sub_810A9DC +sub_810A9DC: @ 810A9DC + push {lr} + adds r3, r0, 0 + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0810A9FE + ldrb r1, [r3, 0x1] + movs r2, 0x3F + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] + ldrb r0, [r3, 0x3] + ands r2, r0 + strb r2, [r3, 0x3] + b _0810AA12 +_0810A9FE: + ldrb r2, [r3, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0x1] + ldrb r0, [r3, 0x3] + ands r1, r0 + movs r0, 0x40 + orrs r1, r0 + strb r1, [r3, 0x3] +_0810AA12: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bne _0810AA26 + adds r0, r3, 0 + bl obj_delete_and_free_tiles +_0810AA26: + pop {r0} + bx r0 + thumb_func_end sub_810A9DC + + thumb_func_start sub_810AA2C +sub_810AA2C: @ 810AA2C + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, _0810AA94 + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + ldr r0, _0810AA98 + adds r1, 0x20 + lsls r1, 16 + asrs r1, 16 + movs r7, 0x22 + ldrsh r2, [r4, r7] + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0810AA9C + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r6, r2, r3 + ldrh r5, [r6, 0x4] + lsls r1, r5, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r7, _0810AAA0 + adds r0, r7, 0 + ands r1, r0 + ldr r0, _0810AAA4 + ands r0, r5 + orrs r0, r1 + strh r0, [r6, 0x4] + ldr r1, _0810AAA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r3, 0x1C + adds r2, r3 + ldr r0, _0810AAAC + str r0, [r2] + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810AA94: .4byte 0x0203841e +_0810AA98: .4byte 0x08595840 +_0810AA9C: .4byte 0x02020630 +_0810AAA0: .4byte 0x000003ff +_0810AAA4: .4byte 0xfffffc00 +_0810AAA8: .4byte 0x020383fe +_0810AAAC: .4byte sub_810AAB0 + 1 + thumb_func_end sub_810AA2C + + thumb_func_start sub_810AAB0 +sub_810AAB0: @ 810AAB0 + 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 + bne _0810AAE4 + movs r0, 0 + strh r0, [r3, 0x2E] + 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] +_0810AAE4: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0810AAF8 + adds r0, r3, 0 + bl move_anim_8072740 +_0810AAF8: + pop {r0} + bx r0 + thumb_func_end sub_810AAB0 + + thumb_func_start sub_810AAFC +sub_810AAFC: @ 810AAFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0810AB1C + adds r5, r1, r0 + ldr r0, _0810AB20 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810AB28 + ldr r4, _0810AB24 + b _0810AB2A + .align 2, 0 +_0810AB1C: .4byte 0x03005e00 +_0810AB20: .4byte 0x0203841e +_0810AB24: .4byte 0x02038436 +_0810AB28: + ldr r4, _0810AB6C +_0810AB2A: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x24] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x26] + ldr r2, _0810AB70 + ldrh r0, [r2, 0x2] + movs r1, 0 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + strh r1, [r5, 0x18] + strh r1, [r5, 0x1A] + strh r1, [r5, 0x1C] + ldrh r0, [r2, 0x6] + strh r0, [r5, 0x1E] + strh r1, [r5, 0x20] + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x22] + ldr r0, _0810AB74 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810AB6C: .4byte 0x02038437 +_0810AB70: .4byte 0x0203841e +_0810AB74: .4byte sub_810AB78 + 1 + thumb_func_end sub_810AAFC + + thumb_func_start sub_810AB78 +sub_810AB78: @ 810AB78 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, r6, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0810AC60 + adds r5, r0, r1 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810AC78 + ldrh r0, [r5, 0x20] + adds r0, 0x1 + movs r7, 0 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x22 + ldrsh r1, [r5, r2] + cmp r0, r1 + ble _0810AC86 + strh r7, [r5, 0x20] + ldr r0, _0810AC64 + movs r3, 0x24 + ldrsh r1, [r5, r3] + movs r3, 0x26 + ldrsh r2, [r5, r3] + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0810AC86 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0810AC68 + adds r4, r0 + ldr r1, _0810AC6C + movs r2, 0x1A + ldrsh r0, [r5, r2] + lsls r0, 1 + adds r0, r1 + movs r3, 0 + ldrsb r3, [r0, r3] + ldrh r0, [r4, 0x20] + adds r3, r0 + strh r3, [r4, 0x20] + movs r2, 0x1A + ldrsh r0, [r5, r2] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + movs r2, 0 + ldrsb r2, [r0, r2] + ldrh r0, [r4, 0x22] + adds r2, r0 + strh r2, [r4, 0x22] + movs r1, 0x18 + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + movs r0, 0x28 + subs r0, r1 + strh r0, [r4, 0x2E] + strh r3, [r4, 0x30] + ldrh r0, [r5, 0x24] + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + ldrh r0, [r5, 0x26] + strh r0, [r4, 0x36] + strh r6, [r4, 0x38] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, _0810AC70 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0810AC74 + str r0, [r4, 0x1C] + ldrh r0, [r5, 0x1A] + adds r0, 0x1 + strh r0, [r5, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0810AC30 + strh r7, [r5, 0x1A] +_0810AC30: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1E + ldrsh r1, [r5, r2] + cmp r0, r1 + blt _0810AC52 + strh r7, [r5, 0x1C] + ldrh r1, [r5, 0x18] + movs r3, 0x18 + ldrsh r0, [r5, r3] + cmp r0, 0x5 + bgt _0810AC52 + adds r0, r1, 0x1 + strh r0, [r5, 0x18] +_0810AC52: + ldrh r0, [r5, 0x16] + adds r0, 0x1 + strh r0, [r5, 0x16] + ldrh r0, [r5, 0x14] + subs r0, 0x1 + strh r0, [r5, 0x14] + b _0810AC86 + .align 2, 0 +_0810AC60: .4byte 0x03005e00 +_0810AC64: .4byte 0x085958a8 +_0810AC68: .4byte 0x02020630 +_0810AC6C: .4byte 0x08595858 +_0810AC70: .4byte sub_810ACC0 + 1 +_0810AC74: .4byte sub_80A67D8 + 1 +_0810AC78: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810AC86 + adds r0, r2, 0 + bl move_anim_task_del +_0810AC86: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_810AB78 + + thumb_func_start sub_810AC8C +sub_810AC8C: @ 810AC8C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810ACB4 + ldr r2, _0810ACBC + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x16] + subs r1, 0x1 + strh r1, [r0, 0x16] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810ACB4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810ACBC: .4byte 0x03005e00 + thumb_func_end sub_810AC8C + + thumb_func_start sub_810ACC0 +sub_810ACC0: @ 810ACC0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldr r0, _0810ACD4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810ACD4: .4byte sub_810AC8C + 1 + thumb_func_end sub_810ACC0 + + thumb_func_start sub_810ACD8 +sub_810ACD8: @ 810ACD8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810ACEC + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810ACF4 + ldr r4, _0810ACF0 + b _0810ACF6 + .align 2, 0 +_0810ACEC: .4byte 0x0203841e +_0810ACF0: .4byte 0x02038436 +_0810ACF4: + ldr r4, _0810AD24 +_0810ACF6: + 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] + ldr r1, _0810AD28 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810AD2C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810AD24: .4byte 0x02038437 +_0810AD28: .4byte move_anim_8074EE0 + 1 +_0810AD2C: .4byte sub_80A67BC + 1 + thumb_func_end sub_810ACD8 + + thumb_func_start sub_810AD30 +sub_810AD30: @ 810AD30 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810AD44 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810AD4C + ldr r4, _0810AD48 + b _0810AD4E + .align 2, 0 +_0810AD44: .4byte 0x0203841e +_0810AD48: .4byte 0x02038436 +_0810AD4C: + ldr r4, _0810AD88 +_0810AD4E: + 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] + ldr r1, _0810AD8C + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x24] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x26] + ldr r1, _0810AD90 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810AD94 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810AD88: .4byte 0x02038437 +_0810AD8C: .4byte 0x0203841e +_0810AD90: .4byte move_anim_8072740 + 1 +_0810AD94: .4byte sub_80A67D8 + 1 + thumb_func_end sub_810AD30 + + thumb_func_start sub_810AD98 +sub_810AD98: @ 810AD98 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r4, _0810ADF0 + 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] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + movs r0, 0x10 + strh r0, [r5, 0x3C] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810ADE6 + movs r1, 0x3C + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r5, 0x3C] +_0810ADE6: + ldr r0, _0810ADF4 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810ADF0: .4byte 0x02038436 +_0810ADF4: .4byte sub_810ADF8 + 1 + thumb_func_end sub_810AD98 + + thumb_func_start sub_810ADF8 +sub_810ADF8: @ 810ADF8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810AE0A + cmp r0, 0x1 + beq _0810AE20 + b _0810AE50 +_0810AE0A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0810AE50 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810AE50 +_0810AE20: + ldrh r2, [r4, 0x3C] + ldrh r1, [r4, 0x20] + adds r0, r2, r1 + strh r0, [r4, 0x20] + ldr r3, _0810AE58 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x24] + adds r2, r1 + strh r2, [r0, 0x24] + ldrh r0, [r4, 0x20] + adds r0, 0x50 + lsls r0, 16 + movs r1, 0xC8 + lsls r1, 17 + cmp r0, r1 + bls _0810AE50 + adds r0, r4, 0 + bl move_anim_8074EE0 +_0810AE50: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810AE58: .4byte 0x02020630 + thumb_func_end sub_810ADF8 + + thumb_func_start sub_810AE5C +sub_810AE5C: @ 810AE5C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, _0810AE80 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0810AEF0 + cmp r0, 0x1 + bgt _0810AE84 + cmp r0, 0 + beq _0810AE90 + b _0810AFC0 + .align 2, 0 +_0810AE80: .4byte 0x03005e00 +_0810AE84: + cmp r0, 0x2 + beq _0810AF4C + cmp r0, 0x3 + bne _0810AE8E + b _0810AFA0 +_0810AE8E: + b _0810AFC0 +_0810AE90: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r5, 0x26] + ldr r4, _0810AEC4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x24] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810AECC + ldr r0, _0810AEC8 + strh r0, [r5, 0x24] + movs r0, 0x2 + b _0810AED2 + .align 2, 0 +_0810AEC4: .4byte 0x02038436 +_0810AEC8: .4byte 0x0000ffe0 +_0810AECC: + movs r0, 0x20 + strh r0, [r5, 0x24] + ldr r0, _0810AEE8 +_0810AED2: + strh r0, [r5, 0x22] + ldr r2, _0810AEEC + movs r0, 0x26 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r5, 0x24] + strh r1, [r0, 0x24] + b _0810AF92 + .align 2, 0 +_0810AEE8: .4byte 0x0000fffe +_0810AEEC: .4byte 0x02020630 +_0810AEF0: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810AFC0 + movs r0, 0 + strh r0, [r5, 0xA] + ldr r4, _0810AF48 + movs r1, 0x26 + ldrsh r0, [r5, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + adds r2, 0x3E + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrh r1, [r5, 0x24] + movs r2, 0x24 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810AF92 + ldrh r2, [r5, 0x22] + adds r2, r1, r2 + strh r2, [r5, 0x24] + movs r0, 0x26 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x24] + b _0810AFC0 + .align 2, 0 +_0810AF48: .4byte 0x02020630 +_0810AF4C: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810AFC0 + movs r0, 0 + strh r0, [r5, 0xA] + ldr r1, _0810AF9C + movs r2, 0x26 + ldrsh r0, [r5, r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + adds r2, 0x3E + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0810AFC0 +_0810AF92: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810AFC0 + .align 2, 0 +_0810AF9C: .4byte 0x02020630 +_0810AFA0: + ldr r2, _0810AFC8 + movs r0, 0x26 + ldrsh r1, [r5, 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] + adds r0, r3, 0 + bl move_anim_task_del +_0810AFC0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810AFC8: .4byte 0x02020630 + thumb_func_end sub_810AE5C + + thumb_func_start sub_810AFCC +sub_810AFCC: @ 810AFCC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0810AFF0 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _0810AFE6 + b _0810B10C +_0810AFE6: + cmp r0, 0x1 + bgt _0810AFF4 + cmp r0, 0 + beq _0810AFFC + b _0810B14E + .align 2, 0 +_0810AFF0: .4byte 0x03005e00 +_0810AFF4: + cmp r0, 0x2 + bne _0810AFFA + b _0810B140 +_0810AFFA: + b _0810B14E +_0810AFFC: + ldr r4, _0810B03C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _0810B012 + movs r1, 0x1 +_0810B012: + movs r6, 0 + strh r1, [r5, 0xA] + ldr r0, _0810B040 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r3, r0, 0 + cmp r2, 0 + beq _0810B048 + cmp r2, 0x4 + beq _0810B070 + ldrh r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810B0A8 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0xE] + ldr r0, _0810B044 + b _0810B0B0 + .align 2, 0 +_0810B03C: .4byte 0x02038436 +_0810B040: .4byte 0x0203841e +_0810B044: .4byte 0x0000fff0 +_0810B048: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 7 + adds r0, 0x78 + strh r0, [r5, 0x10] + b _0810B0E6 +_0810B070: + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r1, 7 + movs r0, 0x78 + subs r0, r1 + strh r0, [r5, 0xE] + ldr r4, _0810B0A4 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xA + ldrsh r1, [r5, r2] + lsls r1, 5 + subs r0, r1 + strh r0, [r5, 0x10] + b _0810B0E6 + .align 2, 0 +_0810B0A4: .4byte 0x02038437 +_0810B0A8: + ldr r0, _0810B0CC + strh r0, [r5, 0xE] + movs r0, 0x80 + lsls r0, 1 +_0810B0B0: + strh r0, [r5, 0x10] + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _0810B0D0 + movs r2, 0 + ldrsh r0, [r3, r2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + movs r0, 0x50 + subs r0, r1 + strh r0, [r5, 0x12] + b _0810B0E6 + .align 2, 0 +_0810B0CC: .4byte 0x0000fff0 +_0810B0D0: + movs r0, 0 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, 0x28 + strh r0, [r5, 0x12] + ldrh r1, [r5, 0xE] + ldrh r0, [r5, 0x10] + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] +_0810B0E6: + movs r2, 0xE + ldrsh r1, [r5, r2] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r1, r0 + bge _0810B0FC + movs r1, 0 + movs r0, 0x1 + strh r0, [r5, 0xA] + strh r1, [r5, 0x14] + b _0810B138 +_0810B0FC: + ldr r0, _0810B108 + strh r0, [r5, 0xA] + movs r0, 0x3 + strh r0, [r5, 0x14] + b _0810B138 + .align 2, 0 +_0810B108: .4byte 0x0000ffff +_0810B10C: + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + ble _0810B14E + movs r0, 0 + strh r0, [r5, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_810B154 + lsls r0, 24 + cmp r0, 0 + bne _0810B138 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_810B154 + lsls r0, 24 + cmp r0, 0 + beq _0810B14E +_0810B138: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810B14E +_0810B140: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B14E + adds r0, r4, 0 + bl move_anim_task_del +_0810B14E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810AFCC + + thumb_func_start sub_810B154 +sub_810B154: @ 810B154 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _0810B1E0 + movs r2, 0xE + ldrsh r1, [r4, r2] + movs r3, 0x12 + ldrsh r2, [r4, r3] + movs r3, 0x23 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0810B18A + ldr r1, _0810B1E4 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strh r5, [r0, 0x3A] + movs r1, 0x7 + strh r1, [r0, 0x3C] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_0810B18A: + ldrh r1, [r4, 0xA] + ldrh r5, [r4, 0x14] + adds r0, r1, r5 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bge _0810B19C + movs r0, 0x3 + strh r0, [r4, 0x14] +_0810B19C: + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + ble _0810B1A8 + movs r0, 0 + strh r0, [r4, 0x14] +_0810B1A8: + movs r3, 0xA + ldrsh r0, [r4, r3] + lsls r0, 4 + ldrh r5, [r4, 0xE] + adds r2, r0, r5 + strh r2, [r4, 0xE] + lsls r0, r1, 16 + asrs r3, r0, 16 + cmp r3, 0x1 + bne _0810B1C8 + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0x10 + ldrsh r1, [r4, r5] + cmp r0, r1 + bge _0810B1DC +_0810B1C8: + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + bne _0810B1E8 + lsls r0, r2, 16 + asrs r0, 16 + movs r2, 0x10 + ldrsh r1, [r4, r2] + cmp r0, r1 + bgt _0810B1E8 +_0810B1DC: + movs r0, 0x1 + b _0810B1EA + .align 2, 0 +_0810B1E0: .4byte 0x08595a00 +_0810B1E4: .4byte 0x02020630 +_0810B1E8: + movs r0, 0 +_0810B1EA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_810B154 + + thumb_func_start sub_810B1F0 +sub_810B1F0: @ 810B1F0 + 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, 0xC + ble _0810B230 + ldr r3, _0810B238 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810B230: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810B238: .4byte 0x03005e00 + thumb_func_end sub_810B1F0 + + thumb_func_start sub_810B23C +sub_810B23C: @ 810B23C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810B24E + cmp r0, 0x1 + beq _0810B280 + b _0810B294 +_0810B24E: + ldr r4, _0810B27C + 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] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_8008258 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0810B294 + .align 2, 0 +_0810B27C: .4byte 0x02038436 +_0810B280: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810B294 + adds r0, r5, 0 + bl move_anim_8074EE0 +_0810B294: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810B23C + + thumb_func_start sub_810B29C +sub_810B29C: @ 810B29C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810B2C0 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _0810B2B6 + b _0810B428 +_0810B2B6: + lsls r0, 2 + ldr r1, _0810B2C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0810B2C0: .4byte 0x03005e00 +_0810B2C4: .4byte _0810B2C8 + .align 2, 0 +_0810B2C8: + .4byte _0810B2DC + .4byte _0810B36C + .4byte _0810B3A8 + .4byte _0810B404 + .4byte _0810B414 +_0810B2DC: + ldr r4, _0810B360 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x16] + movs r0, 0x4 + strh r0, [r5, 0x18] + ldr r0, _0810B364 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + movs r2, 0x1C + ldrsh r0, [r5, r2] + movs r2, 0x14 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r1, 0x5 + bl __divsi3 + strh r0, [r5, 0x1A] + movs r0, 0x7 + strh r0, [r5, 0x10] + ldr r0, _0810B368 + strh r0, [r5, 0x12] + movs r0, 0xC + strh r0, [r5, 0x1E] + subs r0, 0x4C + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0x20] + movs r0, 0x3F + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0x22] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x24] + movs r1, 0x22 + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r1, 0x3 + bl __divsi3 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + b _0810B426 + .align 2, 0 +_0810B360: .4byte 0x02038436 +_0810B364: .4byte 0x02038437 +_0810B368: .4byte 0x0000ffff +_0810B36C: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + ble _0810B39C + movs r0, 0 + strh r0, [r5, 0xA] + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_810B430 + lsls r0, 24 + cmp r0, 0 + beq _0810B39C + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bne _0810B396 + movs r0, 0x3 + b _0810B39A +_0810B396: + ldrh r0, [r5, 0x8] + adds r0, 0x1 +_0810B39A: + strh r0, [r5, 0x8] +_0810B39C: + ldrh r1, [r5, 0x1E] + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810B428 + b _0810B41E +_0810B3A8: + ldrh r1, [r5, 0x1E] + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810B3B6 + subs r0, r1, 0x1 + strh r0, [r5, 0x1E] +_0810B3B6: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + movs r3, 0 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0810B428 + strh r3, [r5, 0xA] + ldrh r1, [r5, 0xC] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0810B3E2 + movs r0, 0x4 + strh r0, [r5, 0x16] + movs r0, 0x44 + strh r0, [r5, 0x18] + strh r3, [r5, 0x10] + strh r2, [r5, 0x12] + b _0810B3F2 +_0810B3E2: + movs r0, 0x44 + strh r0, [r5, 0x16] + movs r0, 0x4 + strh r0, [r5, 0x18] + movs r0, 0x7 + strh r0, [r5, 0x10] + ldr r0, _0810B400 + strh r0, [r5, 0x12] +_0810B3F2: + movs r1, 0x1E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810B424 + movs r0, 0x4 + b _0810B426 + .align 2, 0 +_0810B400: .4byte 0x0000ffff +_0810B404: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B428 + adds r0, r2, 0 + bl move_anim_task_del + b _0810B428 +_0810B414: + ldrh r1, [r5, 0x1E] + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810B424 +_0810B41E: + subs r0, r1, 0x1 + strh r0, [r5, 0x1E] + b _0810B428 +_0810B424: + movs r0, 0x1 +_0810B426: + strh r0, [r5, 0x8] +_0810B428: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810B29C + + thumb_func_start sub_810B430 +sub_810B430: @ 810B430 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _0810B4F8 + movs r2, 0x14 + ldrsh r1, [r4, r2] + movs r3, 0x16 + ldrsh r2, [r4, r3] + movs r3, 0x23 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0810B49C + ldr r1, _0810B4FC + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + ldrh r6, [r4, 0x10] + adds r1, r6 + ldr r6, _0810B500 + adds r0, r6, 0 + ands r1, r0 + ldr r0, _0810B504 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x10] + adds r0, r1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _0810B484 + movs r0, 0x7 + strh r0, [r4, 0x10] +_0810B484: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0x7 + ble _0810B490 + movs r0, 0 + strh r0, [r4, 0x10] +_0810B490: + strh r5, [r3, 0x3A] + movs r0, 0x3 + strh r0, [r3, 0x3C] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] +_0810B49C: + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0810B4BE + movs r5, 0x12 + ldrsh r0, [r4, r5] + cmp r0, 0 + ble _0810B4BE + ldrh r1, [r4, 0x26] + ldrh r6, [r4, 0x24] + adds r1, r6 + strh r1, [r4, 0x24] + lsls r1, 24 + asrs r1, 24 + movs r0, 0x76 + bl audio_play_and_stuff +_0810B4BE: + movs r0, 0x12 + ldrsh r3, [r4, r0] + ldrh r2, [r4, 0x16] + cmp r3, 0 + bge _0810B4D4 + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0x18 + ldrsh r1, [r4, r5] + cmp r0, r1 + ble _0810B4E4 +_0810B4D4: + cmp r3, 0 + ble _0810B508 + lsls r0, r2, 16 + asrs r0, 16 + movs r6, 0x18 + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _0810B508 +_0810B4E4: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x1A] + ldrh r1, [r4, 0x14] + adds r0, r1 + strh r0, [r4, 0x14] + movs r0, 0x1 + b _0810B514 + .align 2, 0 +_0810B4F8: .4byte 0x08595a30 +_0810B4FC: .4byte 0x02020630 +_0810B500: .4byte 0x000003ff +_0810B504: .4byte 0xfffffc00 +_0810B508: + movs r3, 0x12 + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r0, r2, r0 + strh r0, [r4, 0x16] + movs r0, 0 +_0810B514: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_810B430 + + thumb_func_start sub_810B51C +sub_810B51C: @ 810B51C + 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, 0xC + ble _0810B552 + ldr r3, _0810B558 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810B552: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810B558: .4byte 0x03005e00 + thumb_func_end sub_810B51C + + thumb_func_start sub_810B55C +sub_810B55C: @ 810B55C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810B580 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0810B5D8 + cmp r0, 0x1 + bgt _0810B584 + cmp r0, 0 + beq _0810B58A + b _0810B60E + .align 2, 0 +_0810B580: .4byte 0x03005e00 +_0810B584: + cmp r0, 0x2 + beq _0810B600 + b _0810B60E +_0810B58A: + ldr r0, _0810B5D4 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r5, 0x26] + strh r0, [r5, 0x24] + cmp r0, 0x10 + ble _0810B5B4 + adds r2, r0, 0 +_0810B5A4: + adds r1, r2, 0 + subs r1, 0x20 + adds r2, r1, 0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x10 + bgt _0810B5A4 + strh r1, [r5, 0x24] +_0810B5B4: + ldr r4, _0810B5D4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x2 + strh r0, [r5, 0x20] + b _0810B5F8 + .align 2, 0 +_0810B5D4: .4byte 0x02038437 +_0810B5D8: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810B60E + movs r0, 0 + strh r0, [r5, 0xA] + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_810B614 + lsls r0, 24 + cmp r0, 0 + beq _0810B60E +_0810B5F8: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810B60E +_0810B600: + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B60E + adds r0, r2, 0 + bl move_anim_task_del +_0810B60E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810B55C + + thumb_func_start sub_810B614 +sub_810B614: @ 810B614 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _0810B670 + movs r2, 0x22 + ldrsh r1, [r4, r2] + movs r3, 0x24 + ldrsh r2, [r4, r3] + ldrh r3, [r4, 0x20] + lsls r3, 24 + lsrs r3, 24 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0810B658 + ldr r3, _0810B674 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, _0810B678 + str r2, [r1] + adds r0, r3 + strh r5, [r0, 0x3A] + movs r1, 0xA + strh r1, [r0, 0x3C] + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] +_0810B658: + ldrh r2, [r4, 0x24] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r3, 0x26 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0810B67C + adds r0, r2, 0 + adds r0, 0x20 + strh r0, [r4, 0x24] + movs r0, 0 + b _0810B67E + .align 2, 0 +_0810B670: .4byte 0x085956c0 +_0810B674: .4byte 0x02020630 +_0810B678: .4byte sub_810B684 + 1 +_0810B67C: + movs r0, 0x1 +_0810B67E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_810B614 + + thumb_func_start sub_810B684 +sub_810B684: @ 810B684 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810B6B8 + ldr r3, _0810B6C0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810B6B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810B6C0: .4byte 0x03005e00 + thumb_func_end sub_810B684 + + thumb_func_start sub_810B6C4 +sub_810B6C4: @ 810B6C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x7 + ldr r3, _0810B7CC + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810B7D0 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r4, _0810B7D4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, _0810B7D8 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + str r3, [sp] + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0810B7DC + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r1] + ldr r3, [sp] + adds r0, r3 + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x4] + mov r4, r9 + adds r0, r4, r0 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x2] + adds r0, r6 + strh r0, [r5, 0x34] + ldrh r0, [r1, 0x6] + mov r7, r8 + adds r0, r7, r0 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A64EC + adds r4, 0x20 + movs r0, 0x98 + lsls r0, 1 + mov r12, r0 + ldr r3, [sp] + cmp r4, r12 + bhi _0810B79E + adds r0, r7, 0 + adds r0, 0x20 + ldrh r1, [r5, 0x30] + ldrh r2, [r5, 0x32] + cmp r0, 0xE0 + bhi _0810B79E + adds r4, r1, 0 + mov r10, r12 +_0810B76A: + mov r7, r9 + lsls r1, r7, 16 + asrs r1, 16 + adds r1, r4 + lsls r1, 16 + mov r7, r8 + lsls r0, r7, 16 + asrs r0, 16 + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsrs r0, r1, 16 + mov r9, r0 + movs r7, 0x80 + lsls r7, 14 + adds r1, r7 + lsrs r1, 16 + cmp r1, r10 + bhi _0810B79E + mov r1, r8 + lsls r0, r1, 16 + adds r0, r7 + lsrs r0, 16 + cmp r0, 0xE0 + bls _0810B76A +_0810B79E: + ldrh r0, [r5, 0x30] + negs r7, r0 + strh r7, [r5, 0x30] + ldrh r0, [r5, 0x32] + negs r4, r0 + strh r4, [r5, 0x32] + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + lsrs r0, 16 + movs r2, 0x98 + lsls r2, 1 + mov r12, r2 + ldr r1, _0810B7DC + mov r10, r1 + cmp r0, r12 + bhi _0810B80A + lsls r1, r6, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r1, r2 + b _0810B802 + .align 2, 0 +_0810B7CC: .4byte 0x000003ff +_0810B7D0: .4byte 0xfffffc00 +_0810B7D4: .4byte 0x02038437 +_0810B7D8: .4byte 0x02038436 +_0810B7DC: .4byte 0x0203841e +_0810B7E0: + lsls r1, r3, 16 + asrs r1, 16 + adds r1, r7 + lsls r1, 16 + asrs r0, r2, 16 + adds r0, r4 + lsls r0, 16 + lsrs r6, r0, 16 + lsrs r3, r1, 16 + movs r0, 0x80 + lsls r0, 14 + adds r1, r0 + lsrs r1, 16 + cmp r1, r12 + bhi _0810B80A + lsls r1, r6, 16 + adds r0, r1, r0 +_0810B802: + lsrs r0, 16 + adds r2, r1, 0 + cmp r0, 0xE0 + bls _0810B7E0 +_0810B80A: + strh r3, [r5, 0x20] + strh r6, [r5, 0x22] + mov r1, r10 + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + strh r3, [r5, 0x30] + mov r2, r9 + strh r2, [r5, 0x32] + strh r6, [r5, 0x34] + mov r3, r8 + strh r3, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A64EC + mov r7, r10 + ldrh r0, [r7, 0xA] + strh r0, [r5, 0x34] + ldrh r0, [r7, 0xC] + strh r0, [r5, 0x36] + ldr r0, _0810B844 + str r0, [r5, 0x1C] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810B844: .4byte sub_810B848 + 1 + thumb_func_end sub_810B6C4 + + thumb_func_start sub_810B848 +sub_810B848: @ 810B848 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810B8A0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x38] + adds r1, r2 + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x3A] + adds r0, r2 + strh r0, [r4, 0x3A] + strh r1, [r4, 0x24] + strh r0, [r4, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x3C] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + b _0810B8A6 +_0810B8A0: + adds r0, r4, 0 + bl move_anim_8072740 +_0810B8A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810B848 + + thumb_func_start sub_810B8AC +sub_810B8AC: @ 810B8AC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810B8E0 + ldrh r0, [r0] + strh r0, [r4, 0x2E] + movs r0, 0x3C + strh r0, [r4, 0x30] + movs r0, 0x9 + strh r0, [r4, 0x32] + movs r0, 0x1E + strh r0, [r4, 0x34] + movs r0, 0xFE + lsls r0, 8 + strh r0, [r4, 0x36] + ldr r1, _0810B8E4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, _0810B8E8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810B8E0: .4byte 0x0203841e +_0810B8E4: .4byte move_anim_8072740 + 1 +_0810B8E8: .4byte sub_80A634C + 1 + thumb_func_end sub_810B8AC + + thumb_func_start sub_810B8EC +sub_810B8EC: @ 810B8EC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _0810B920 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldr r0, _0810B924 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810B92C + ldr r0, _0810B928 + ldrh r1, [r4, 0x32] + ldrh r0, [r0, 0x4] + subs r1, r0 + strh r1, [r4, 0x32] + b _0810B936 + .align 2, 0 +_0810B920: .4byte 0x02038437 +_0810B924: .4byte 0x02038436 +_0810B928: .4byte 0x0203841e +_0810B92C: + ldr r0, _0810B964 + ldrh r0, [r0, 0x4] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] +_0810B936: + ldr r0, _0810B968 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + ldr r1, _0810B964 + lsrs r0, 24 + ldrh r2, [r1, 0x6] + adds r0, r2 + strh r0, [r4, 0x36] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldr r1, _0810B96C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0810B970 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810B964: .4byte 0x0203841e +_0810B968: .4byte 0x02038437 +_0810B96C: .4byte move_anim_8072740 + 1 +_0810B970: .4byte sub_80A6EEC + 1 + thumb_func_end sub_810B8EC + + thumb_func_start sub_810B974 +sub_810B974: @ 810B974 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0810B98C + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B990 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + b _0810B9C6 + .align 2, 0 +_0810B98C: .4byte 0x0203841e +_0810B990: + ldr r0, _0810B9D8 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 + ldr r0, _0810B9DC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810B9B6 + ldrh r0, [r5] + negs r0, r0 + strh r0, [r5] +_0810B9B6: + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_0810B9C6: + ldr r1, _0810B9E0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0810B9E4 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810B9D8: .4byte 0x02038437 +_0810B9DC: .4byte 0x02038436 +_0810B9E0: .4byte sub_810B9E8 + 1 +_0810B9E4: .4byte sub_80A67BC + 1 + thumb_func_end sub_810B974 + + thumb_func_start sub_810B9E8 +sub_810B9E8: @ 810B9E8 + push {lr} + adds r3, r0, 0 + 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] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _0810BA1E + adds r0, r3, 0 + bl move_anim_8074EE0 +_0810BA1E: + pop {r0} + bx r0 + thumb_func_end sub_810B9E8 + + thumb_func_start sub_810BA24 +sub_810BA24: @ 810BA24 + push {r4-r7,lr} + sub sp, 0x10 + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r6, _0810BA6C + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + movs r1, 0xA + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BA74 + ldr r4, _0810BA70 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + strh r0, [r5, 0x36] + b _0810BA86 + .align 2, 0 +_0810BA6C: .4byte 0x0203841e +_0810BA70: .4byte 0x02038437 +_0810BA74: + ldr r0, _0810BAA0 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0810BA86: + ldr r0, _0810BAA4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BAAC + ldr r0, _0810BAA8 + ldrh r1, [r5, 0x32] + ldrh r0, [r0, 0x4] + subs r1, r0 + strh r1, [r5, 0x32] + b _0810BAB6 + .align 2, 0 +_0810BAA0: .4byte 0x02038437 +_0810BAA4: .4byte 0x02038436 +_0810BAA8: .4byte 0x0203841e +_0810BAAC: + ldr r0, _0810BB54 + ldrh r0, [r0, 0x4] + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] +_0810BAB6: + adds r7, r5, 0 + adds r7, 0x2E + adds r2, r7, 0 + mov r1, sp + movs r4, 0x7 +_0810BAC0: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BAC0 + adds r0, r5, 0 + bl sub_80A7160 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + eors r0, r1 + strh r0, [r5, 0x32] +_0810BAE2: + movs r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A70E8 + movs r0, 0x20 + ldrsh r1, [r5, r0] + movs r2, 0x24 + ldrsh r0, [r5, r2] + adds r1, r0 + adds r1, 0x10 + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bhi _0810BB16 + movs r0, 0x22 + ldrsh r1, [r5, r0] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810BB16 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BAE2 +_0810BB16: + 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] + ldr r6, _0810BB58 + ldr r1, _0810BB5C + mov r3, sp + adds r2, r7, 0 + movs r4, 0x7 +_0810BB36: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BB36 + str r6, [r5, 0x1C] + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810BB54: .4byte 0x0203841e +_0810BB58: .4byte sub_80A718C + 1 +_0810BB5C: .4byte sub_810BB60 + 1 + thumb_func_end sub_810BA24 + + thumb_func_start sub_810BB60 +sub_810BB60: @ 810BB60 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r5, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + strh r5, [r4, 0x24] + movs r0, 0x80 + strh r0, [r4, 0x2E] + ldr r0, _0810BBBC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _0810BBC0 + cmp r0, 0 + beq _0810BB90 + movs r1, 0x14 +_0810BB90: + movs r2, 0x2E + ldrsh r0, [r4, r2] + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x34] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] + ldr r1, _0810BBC4 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810BBBC: .4byte 0x02038436 +_0810BBC0: .4byte 0x0000ffec +_0810BBC4: .4byte sub_810BBC8 + 1 + thumb_func_end sub_810BB60 + + thumb_func_start sub_810BBC8 +sub_810BBC8: @ 810BBC8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810BC1C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _0810BC20 + cmp r0, 0 + beq _0810BBDE + movs r1, 0x14 +_0810BBDE: + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0x1F + bgt _0810BC24 + movs r2, 0x2E + ldrsh r0, [r4, r2] + lsls r1, 16 + asrs r1, 16 + bl sine + ldrh r1, [r4, 0x34] + subs r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + ldrh r1, [r4, 0x36] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x10 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0810BC42 + .align 2, 0 +_0810BC1C: .4byte 0x02038436 +_0810BC20: .4byte 0x0000ffec +_0810BC24: + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x36] + strh r1, [r4, 0x34] + ldr r0, _0810BC48 + str r0, [r4, 0x1C] +_0810BC42: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810BC48: .4byte sub_810BC4C + 1 + thumb_func_end sub_810BBC8 + + thumb_func_start sub_810BC4C +sub_810BC4C: @ 810BC4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A70E8 + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _0810BC88 + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r1, r0, r1 + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bgt _0810BC88 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BC8E +_0810BC88: + adds r0, r4, 0 + bl move_anim_8072740 +_0810BC8E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810BC4C + + thumb_func_start sub_810BC94 +sub_810BC94: @ 810BC94 + push {r4-r7,lr} + sub sp, 0x10 + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, _0810BCD8 + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0810BCE0 + ldr r4, _0810BCDC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + b _0810BCF2 + .align 2, 0 +_0810BCD8: .4byte 0x0203841e +_0810BCDC: .4byte 0x02038437 +_0810BCE0: + ldr r0, _0810BD10 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0810BCF2: + ldr r0, _0810BD14 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BD1C + ldr r0, _0810BD18 + ldrh r1, [r5, 0x32] + ldrh r2, [r0, 0x4] + subs r1, r2 + strh r1, [r5, 0x32] + adds r1, r0, 0 + b _0810BD26 + .align 2, 0 +_0810BD10: .4byte 0x02038437 +_0810BD14: .4byte 0x02038436 +_0810BD18: .4byte 0x0203841e +_0810BD1C: + ldr r1, _0810BDD0 + ldrh r0, [r1, 0x4] + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] +_0810BD26: + ldrh r0, [r1, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A7160 + adds r7, r5, 0 + adds r7, 0x2E + adds r2, r7, 0 + mov r1, sp + movs r4, 0x7 +_0810BD3E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BD3E + ldrh r0, [r5, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + eors r0, r1 + strh r0, [r5, 0x32] +_0810BD5A: + movs r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A70E8 + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r2, 0x24 + ldrsh r0, [r5, r2] + adds r1, r0 + adds r1, 0x10 + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bhi _0810BD8E + movs r0, 0x22 + ldrsh r1, [r5, r0] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810BD8E + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BD5A +_0810BD8E: + 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] + ldr r1, _0810BDD0 + ldr r6, _0810BDD4 + mov r3, sp + adds r2, r7, 0 + movs r4, 0x7 +_0810BDAE: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BDAE + ldrh r0, [r1, 0xA] + strh r0, [r5, 0x38] + ldrh r0, [r1, 0xC] + strh r0, [r5, 0x3A] + str r6, [r5, 0x1C] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810BDD0: .4byte 0x0203841e +_0810BDD4: .4byte sub_810BDD8 + 1 + thumb_func_end sub_810BC94 + + thumb_func_start sub_810BDD8 +sub_810BDD8: @ 810BDD8 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A70E8 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810BDEC + movs r0, 0x1 + strh r0, [r4, 0x2E] +_0810BDEC: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0810BE42 + movs r2, 0x20 + ldrsh r0, [r4, r2] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _0810BE3C + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r2, 0x26 + ldrsh r0, [r4, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810BE3C + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BE42 +_0810BE3C: + adds r0, r4, 0 + bl move_anim_8072740 +_0810BE42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810BDD8 + + thumb_func_start sub_810BE48 +sub_810BE48: @ 810BE48 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810BEB4 + ldr r5, _0810BE68 + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810BE6C + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 + b _0810BEA2 + .align 2, 0 +_0810BE68: .4byte 0x0203841e +_0810BE6C: + ldr r0, _0810BEAC + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldr r0, _0810BEB0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BE92 + ldrh r0, [r5] + negs r0, r0 + strh r0, [r5] +_0810BE92: + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_0810BEA2: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810BEC8 + .align 2, 0 +_0810BEAC: .4byte 0x02038437 +_0810BEB0: .4byte 0x02038436 +_0810BEB4: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810BEC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0810BEC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810BE48 + + thumb_func_start sub_810BED0 +sub_810BED0: @ 810BED0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0810BEF0 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BF40 + movs r1, 0xA + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BEF4 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC + b _0810BF32 + .align 2, 0 +_0810BEF0: .4byte 0x0203841e +_0810BEF4: + ldr r4, _0810BF1C + ldrb r0, [r4] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BF20 + ldrh r0, [r5, 0x20] + ldrh r1, [r6] + subs r0, r1 + b _0810BF26 + .align 2, 0 +_0810BF1C: .4byte 0x02038436 +_0810BF20: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 +_0810BF26: + strh r0, [r5, 0x20] + ldr r0, _0810BF38 + ldrh r0, [r0, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] +_0810BF32: + ldr r0, _0810BF3C + b _0810BF90 + .align 2, 0 +_0810BF38: .4byte 0x0203841e +_0810BF3C: .4byte 0x02038436 +_0810BF40: + movs r1, 0xA + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BF52 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + b _0810BF8E +_0810BF52: + ldr r4, _0810BF78 + ldrb r0, [r4] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BF7C + ldrh r0, [r5, 0x20] + ldrh r1, [r6] + subs r0, r1 + b _0810BF82 + .align 2, 0 +_0810BF78: .4byte 0x02038437 +_0810BF7C: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 +_0810BF82: + strh r0, [r5, 0x20] + ldr r0, _0810BFAC + ldrh r0, [r0, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] +_0810BF8E: + ldr r0, _0810BFB0 +_0810BF90: + ldrb r0, [r0] + strh r0, [r5, 0x3C] + ldr r0, _0810BFAC + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0810BFA8 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0810BFB4 +_0810BFA8: + movs r0, 0x20 + b _0810BFB6 + .align 2, 0 +_0810BFAC: .4byte 0x0203841e +_0810BFB0: .4byte 0x02038437 +_0810BFB4: + movs r0, 0x40 +_0810BFB6: + strh r0, [r5, 0x3A] + ldr r0, _0810BFFC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810BFCC + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r5, 0x22] +_0810BFCC: + ldr r1, _0810C000 + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrh r1, [r1, 0x4] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x40 + strh r0, [r5, 0x38] + ldr r1, _0810C004 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810BFFC: .4byte 0x02038437 +_0810C000: .4byte 0x0203841e +_0810C004: .4byte sub_810C008 + 1 + thumb_func_end sub_810BED0 + + thumb_func_start sub_810C008 +sub_810C008: @ 810C008 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _0810C092 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r1, 0x6 + negs r1, r1 + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _0810C064 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + b _0810C086 +_0810C064: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] +_0810C086: + ldrh r0, [r4, 0x38] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _0810C098 +_0810C092: + adds r0, r4, 0 + bl move_anim_8072740 +_0810C098: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810C008 + + thumb_func_start sub_810C0A0 +sub_810C0A0: @ 810C0A0 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0810C144 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C0E2 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810C0E2: + ldr r0, _0810C148 + movs r1, 0 + strh r1, [r0] + ldr r4, _0810C14C + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x16 + bl lcd_io_set + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _0810C150 + movs r2, 0x80 + lsls r2, 4 + mov r3, sp + ldrh r3, [r3, 0xA] + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _0810C154 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, _0810C158 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0810C15C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0810C160 + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810C144: .4byte 0x00003f42 +_0810C148: .4byte 0x02022e18 +_0810C14C: .4byte 0x02022e1a +_0810C150: .4byte 0x0854cad0 +_0810C154: .4byte 0x08d932e0 +_0810C158: .4byte 0x0854c270 +_0810C15C: .4byte 0x03005e00 +_0810C160: .4byte sub_810C164 + 1 + thumb_func_end sub_810C0A0 + + thumb_func_start sub_810C164 +sub_810C164: @ 810C164 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0810C198 + ldr r2, _0810C19C + adds r0, r2, 0 + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + ldr r1, _0810C1A0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0810C18E + b _0810C2DA +_0810C18E: + lsls r0, 2 + ldr r1, _0810C1A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0810C198: .4byte 0x02022e18 +_0810C19C: .4byte 0x0000ffff +_0810C1A0: .4byte 0x03005e00 +_0810C1A4: .4byte _0810C1A8 + .align 2, 0 +_0810C1A8: + .4byte _0810C1BC + .4byte _0810C214 + .4byte _0810C236 + .4byte _0810C27A + .4byte _0810C29C +_0810C1BC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0810C1D6 + b _0810C2DA +_0810C1D6: + strh r5, [r4, 0x1C] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + ldr r1, _0810C210 + movs r2, 0x1A + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r1, [r0] + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bne _0810C2DA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _0810C2DA + .align 2, 0 +_0810C210: .4byte 0x08595c5c +_0810C214: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _0810C2DA + movs r0, 0x9 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _0810C2DA +_0810C236: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0810C2DA + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0810C2DA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _0810C2DA +_0810C27A: + mov r0, sp + bl sub_80A6B30 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, _0810C2E4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_0810C29C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C2B0 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0810C2B0: + ldr r0, _0810C2E8 + movs r1, 0 + strh r1, [r0] + ldr r0, _0810C2EC + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_0810C2DA: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810C2E4: .4byte 0x03005e00 +_0810C2E8: .4byte 0x02022e18 +_0810C2EC: .4byte 0x02022e1a + thumb_func_end sub_810C164 + + thumb_func_start sub_810C2F0 +sub_810C2F0: @ 810C2F0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0810C31C + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r0, _0810C320 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810C31C: .4byte 0x02038436 +_0810C320: .4byte sub_80A7820 + 1 + thumb_func_end sub_810C2F0 + + thumb_func_start sub_810C324 +sub_810C324: @ 810C324 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0810C3CC + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C366 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810C366: + ldr r0, _0810C3D0 + movs r1, 0 + strh r1, [r0] + ldr r4, _0810C3D4 + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x16 + bl lcd_io_set + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _0810C3D8 + movs r2, 0x80 + lsls r2, 4 + mov r3, sp + ldrh r3, [r3, 0xA] + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _0810C3DC + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, _0810C3E0 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _0810C3E4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0810C3E8 + strh r1, [r0, 0x26] + ldr r1, _0810C3EC + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810C3CC: .4byte 0x00003f42 +_0810C3D0: .4byte 0x02022e18 +_0810C3D4: .4byte 0x02022e1a +_0810C3D8: .4byte 0x0854cad0 +_0810C3DC: .4byte 0x08d932e0 +_0810C3E0: .4byte 0x0854c270 +_0810C3E4: .4byte 0x03005e00 +_0810C3E8: .4byte 0x0000ffff +_0810C3EC: .4byte sub_810C3F0 + 1 + thumb_func_end sub_810C324 + + thumb_func_start sub_810C3F0 +sub_810C3F0: @ 810C3F0 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _0810C420 + ldr r3, _0810C424 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0x26] + ldrh r5, [r2] + adds r0, r5 + strh r0, [r2] + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + bls _0810C416 + b _0810C54A +_0810C416: + lsls r0, 2 + ldr r1, _0810C428 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0810C420: .4byte 0x02022e18 +_0810C424: .4byte 0x03005e00 +_0810C428: .4byte _0810C42C + .align 2, 0 +_0810C42C: + .4byte _0810C440 + .4byte _0810C484 + .4byte _0810C4A6 + .4byte _0810C4EA + .4byte _0810C50C +_0810C440: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + ldr r1, _0810C480 + movs r5, 0x1A + ldrsh r0, [r4, r5] + adds r0, r1 + ldrb r1, [r0] + strh r1, [r4, 0x1E] + movs r0, 0x11 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bne _0810C54A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x1E] + b _0810C54A + .align 2, 0 +_0810C480: .4byte 0x08595c88 +_0810C484: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r3 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _0810C54A + movs r0, 0x5 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _0810C54A +_0810C4A6: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0810C54A + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0810C54A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _0810C54A +_0810C4EA: + mov r0, sp + bl sub_80A6B30 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, _0810C554 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_0810C50C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C520 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0810C520: + ldr r0, _0810C558 + movs r1, 0 + strh r1, [r0] + ldr r0, _0810C55C + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_0810C54A: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810C554: .4byte 0x03005e00 +_0810C558: .4byte 0x02022e18 +_0810C55C: .4byte 0x02022e1a + thumb_func_end sub_810C3F0 + + thumb_func_start sub_810C560 +sub_810C560: @ 810C560 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldr r6, _0810C648 + ldrh r0, [r6] + strh r0, [r5, 0x2E] + ldr r0, _0810C64C + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldr r7, _0810C650 + ldrb r0, [r7] + movs r1, 0x2 + bl sub_80A5C6C + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcs _0810C594 + movs r0, 0x80 + lsls r0, 8 + strh r0, [r5, 0x3C] +_0810C594: + ldr r3, _0810C654 + ldrb r0, [r7] + adds r0, r3 + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0810C5F4 + ldrh r0, [r6, 0x2] + negs r0, r0 + strh r0, [r6, 0x2] + ldrh r0, [r6, 0x6] + negs r0, r0 + strh r0, [r6, 0x6] + movs r1, 0x3C + ldrsh r0, [r5, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810C5F0 + mov r1, r8 + ldrb r0, [r1] + adds r0, r3 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0810C5F0 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, _0810C658 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] +_0810C5F0: + movs r0, 0x1 + strh r0, [r5, 0x3A] +_0810C5F4: + ldr r4, _0810C64C + 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] + ldr r6, _0810C648 + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0810C65C + ldrh r0, [r6, 0x2] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x30] + ldr r4, _0810C650 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x6] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r6, 0x4] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + b _0810C684 + .align 2, 0 +_0810C648: .4byte 0x0203841e +_0810C64C: .4byte 0x02038436 +_0810C650: .4byte 0x02038437 +_0810C654: .4byte 0x02024076 +_0810C658: .4byte 0x02020630 +_0810C65C: + ldrh r0, [r6, 0x2] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x30] + ldr r4, _0810C6CC + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x6] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r6, 0x4] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x1 +_0810C684: + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x8] + adds r0, r6 + strh r0, [r5, 0x36] + ldrb r0, [r4] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 16 + ldrh r1, [r5, 0x3C] + orrs r0, r1 + strh r0, [r5, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810C6B8 + movs r0, 0x1 + strh r0, [r5, 0x3A] + adds r1, r5, 0 + adds r1, 0x43 + movs r0, 0x80 + strb r0, [r1] +_0810C6B8: + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _0810C6D0 + str r0, [r5, 0x1C] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810C6CC: .4byte 0x02038437 +_0810C6D0: .4byte sub_810C6D4 + 1 + thumb_func_end sub_810C560 + + thumb_func_start sub_810C6D4 +sub_810C6D4: @ 810C6D4 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + movs r5, 0xFF + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x1 + beq _0810C7BC + cmp r1, 0x1 + bgt _0810C6EE + cmp r1, 0 + beq _0810C6F6 + b _0810C90C +_0810C6EE: + cmp r1, 0x2 + bne _0810C6F4 + b _0810C8D0 +_0810C6F4: + b _0810C90C +_0810C6F6: + adds r0, r4, 0 + bl sub_80A6F3C + ldr r1, _0810C720 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + asrs r0, 4 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810C724 + ldrh r0, [r4, 0x38] + subs r0, 0x8 + b _0810C728 + .align 2, 0 +_0810C720: .4byte 0x08329f40 +_0810C724: + ldrh r0, [r4, 0x38] + adds r0, 0x8 +_0810C728: + ands r0, r5 + strh r0, [r4, 0x38] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0810C736 + b _0810C90C +_0810C736: + movs r5, 0x50 + strh r5, [r4, 0x2E] + ldr r6, _0810C784 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, 0x1D + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C78C + ldr r1, _0810C788 + ldrb r0, [r6] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810C78C + movs r0, 0xCC + strh r0, [r4, 0x38] + b _0810C78E + .align 2, 0 +_0810C784: .4byte 0x02038437 +_0810C788: .4byte 0x02024076 +_0810C78C: + strh r5, [r4, 0x38] +_0810C78E: + movs r0, 0 + strh r0, [r4, 0x26] + ldr r1, _0810C7B8 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + asrs r0, 3 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + b _0810C90C + .align 2, 0 +_0810C7B8: .4byte 0x08329f40 +_0810C7BC: + adds r0, r4, 0 + bl sub_80A6F3C + ldr r1, _0810C818 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r0, 3 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r2, 0x38 + ldrsh r0, [r4, r2] + adds r0, 0x40 + lsls r0, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + negs r0, r0 + asrs r0, 8 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C83A + ldrh r1, [r4, 0x38] + adds r0, r1, 0 + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + adds r3, r1, 0 + cmp r0, 0x7F + bhi _0810C81C + ldrh r1, [r4, 0x3C] + lsls r1, 16 + asrs r1, 24 + b _0810C824 + .align 2, 0 +_0810C818: .4byte 0x08329f40 +_0810C81C: + ldrh r1, [r4, 0x3C] + lsls r1, 16 + asrs r1, 24 + adds r1, 0x1 +_0810C824: + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r0, r3, 0x4 + b _0810C85A +_0810C83A: + ldrh r0, [r4, 0x38] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _0810C84E + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x80 + b _0810C854 +_0810C84E: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x8C +_0810C854: + strb r0, [r1] + ldrh r0, [r4, 0x38] + subs r0, 0x4 +_0810C85A: + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _0810C90C + movs r5, 0 + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, 0x4 + strh r0, [r4, 0x36] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C8B4 + ldr r1, _0810C8AC + ldr r0, _0810C8B0 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810C8B4 + movs r0, 0x80 + lsls r0, 1 + b _0810C8B6 + .align 2, 0 +_0810C8AC: .4byte 0x02024076 +_0810C8B0: .4byte 0x02038437 +_0810C8B4: + ldr r0, _0810C8CC +_0810C8B6: + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x3C] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + adds r0, r4, 0 + bl sub_80A6FD4 + b _0810C90C + .align 2, 0 +_0810C8CC: .4byte 0x0000fff0 +_0810C8D0: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810C90C + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810C8FE + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0810C8FE: + adds r0, r4, 0 + bl obj_delete_and_free_tiles + ldr r1, _0810C914 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0810C90C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810C914: .4byte 0x020383fe + thumb_func_end sub_810C6D4 + + thumb_func_start sub_810C918 +sub_810C918: @ 810C918 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0810C92C + adds r1, r0 + ldr r0, _0810C930 + str r0, [r1] + bx lr + .align 2, 0 +_0810C92C: .4byte 0x03005e00 +_0810C930: .4byte sub_810C934 + 1 + thumb_func_end sub_810C918 + + thumb_func_start sub_810C934 +sub_810C934: @ 810C934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810C958 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _0810C978 + cmp r5, 0x1 + bgt _0810C95C + cmp r5, 0 + beq _0810C962 + b _0810C9DC + .align 2, 0 +_0810C958: .4byte 0x03005e00 +_0810C95C: + cmp r5, 0x2 + beq _0810C9CE + b _0810C9DC +_0810C962: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0810C9DC + strh r5, [r4, 0x10] + strh r5, [r4, 0x12] + strh r5, [r4, 0xC] + b _0810C9B4 +_0810C978: + ldrh r1, [r4, 0x12] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0810C9C8 + ldrb r0, [r4, 0xE] + ldrb r1, [r4, 0xC] + movs r3, 0x1 + bl sub_810C9E4 + lsls r0, 24 + cmp r0, 0 + beq _0810C998 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] +_0810C998: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0810C9C4 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0810C9BC +_0810C9B4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810C9DC +_0810C9BC: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + b _0810C9DC +_0810C9C4: + strh r5, [r4, 0x12] + b _0810C9DC +_0810C9C8: + subs r0, r1, 0x1 + strh r0, [r4, 0x12] + b _0810C9DC +_0810C9CE: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810C9DC + adds r0, r2, 0 + bl move_anim_task_del +_0810C9DC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810C934 + + thumb_func_start sub_810C9E4 +sub_810C9E4: @ 810C9E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, _0810CA5C + lsrs r0, 22 + adds r4, r0, r1 + ldrb r0, [r4, 0x3] + lsls r0, 24 + asrs r0, 28 + mov r8, r0 + cmp r0, 0x2 + beq _0810CAD0 + ldrh r0, [r4, 0x2] + lsls r0, 20 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810CAD0 + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r8 + cmp r1, 0 + beq _0810CA60 + cmp r1, 0x1 + beq _0810CA96 + b _0810CAE2 + .align 2, 0 +_0810CA5C: .4byte 0x08595cb4 +_0810CA60: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r6, 16 + asrs r1, 16 + subs r1, r0 + b _0810CACA +_0810CA96: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r7, 16 + asrs r1, 16 + adds r1, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r6, 16 + asrs r1, 16 + adds r1, r0 +_0810CACA: + lsls r1, 16 + lsrs r6, r1, 16 + b _0810CAE2 +_0810CAD0: + ldrh r0, [r4] + lsls r0, 22 + asrs r0, 6 + lsrs r7, r0, 16 + ldr r0, [r4] + lsls r0, 12 + asrs r0, 22 + lsls r0, 16 + lsrs r6, r0, 16 +_0810CAE2: + lsls r0, r6, 16 + asrs r0, 16 + adds r0, 0x8 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r0 + ldr r0, _0810CB3C + lsls r1, 16 + asrs r1, 16 + movs r2, 0x8 + negs r2, r2 + movs r3, 0x12 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _0810CB44 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r0, _0810CB40 + adds r4, r0 + adds r0, r4, 0 + mov r1, r9 + bl sub_8008258 + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + strh r7, [r4, 0x34] + strh r6, [r4, 0x36] + mov r1, r9 + strh r1, [r4, 0x38] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x3A] + mov r1, r10 + strh r1, [r4, 0x3C] + movs r0, 0x1 + b _0810CB46 + .align 2, 0 +_0810CB3C: .4byte 0x08595d2c +_0810CB40: .4byte 0x02020630 +_0810CB44: + movs r0, 0 +_0810CB46: + 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_810C9E4 + + thumb_func_start sub_810CB58 +sub_810CB58: @ 810CB58 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r2, r1, 0 + adds r2, 0x8 + strh r2, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0810CB82 + lsls r0, r2, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0810CC32 +_0810CB82: + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _0810CC04 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810CC04 + ldr r0, _0810CBF8 + movs r2, 0x34 + ldrsh r1, [r4, r2] + movs r3, 0x36 + ldrsh r2, [r4, r3] + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + cmp r0, 0x40 + beq _0810CBE6 + ldr r2, _0810CBFC + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _0810CC00 + str r1, [r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x3A] + strh r1, [r0, 0x3A] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x3C] + strh r1, [r0, 0x3C] +_0810CBE6: + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _0810CC32 + .align 2, 0 +_0810CBF8: .4byte 0x08595b68 +_0810CBFC: .4byte 0x02020630 +_0810CC00: .4byte sub_810CC3C + 1 +_0810CC04: + ldr r3, _0810CC38 + movs r2, 0x3C + ldrsh r1, [r4, r2] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810CC32: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810CC38: .4byte 0x03005e00 + thumb_func_end sub_810CB58 + + thumb_func_start sub_810CC3C +sub_810CC3C: @ 810CC3C + 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 + bne _0810CC7C + ldr r3, _0810CC84 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810CC7C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810CC84: .4byte 0x03005e00 + thumb_func_end sub_810CC3C + + thumb_func_start unc_080B06FC +unc_080B06FC: @ 810CC88 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _0810CD08 + ldr r0, [r0] + ldrb r1, [r0, 0x11] + lsrs r0, r1, 4 + lsls r1, 28 + lsrs r1, 28 + subs r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _0810CCA6 + movs r1, 0x4 +_0810CCA6: + adds r0, r5, 0 + bl sub_8008258 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r6, _0810CD0C + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + ldr r0, _0810CD10 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810CCCE + ldrh r0, [r6, 0x4] + negs r0, r0 + strh r0, [r6, 0x4] +_0810CCCE: + ldr r4, _0810CD14 + 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] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x6] + adds r0, r1 + strh r0, [r5, 0x36] + ldrh r0, [r6, 0xA] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, _0810CD18 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810CD08: .4byte 0x02038400 +_0810CD0C: .4byte 0x0203841e +_0810CD10: .4byte 0x02038436 +_0810CD14: .4byte 0x02038437 +_0810CD18: .4byte sub_810CD1C + 1 + thumb_func_end unc_080B06FC + + thumb_func_start sub_810CD1C +sub_810CD1C: @ 810CD1C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810CD3E + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldr r0, _0810CD44 + str r0, [r4, 0x1C] + ldr r1, _0810CD48 + adds r0, r4, 0 + bl oamt_set_x3A_32 +_0810CD3E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810CD44: .4byte sub_80A67D8 + 1 +_0810CD48: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810CD1C + + thumb_func_start sub_810CD4C +sub_810CD4C: @ 810CD4C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r3, _0810CDA0 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810CDA4 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + bl GenerateRandomNumber2 + movs r5, 0xFF + ands r5, r0 + movs r0, 0x80 + lsls r0, 1 + adds r6, r0, 0 + orrs r5, r6 + bl GenerateRandomNumber2 + ldr r1, _0810CDA8 + ands r1, r0 + adds r0, r1, 0 + cmp r0, 0xFF + ble _0810CD92 + subs r0, r6, r0 + lsls r0, 16 + lsrs r1, r0, 16 +_0810CD92: + strh r5, [r4, 0x30] + strh r1, [r4, 0x32] + ldr r0, _0810CDAC + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810CDA0: .4byte 0x000003ff +_0810CDA4: .4byte 0xfffffc00 +_0810CDA8: .4byte 0x000001ff +_0810CDAC: .4byte sub_810CDB0 + 1 + thumb_func_end sub_810CD4C + + thumb_func_start sub_810CDB0 +sub_810CDB0: @ 810CDB0 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r3, r0, r1 + strh r3, [r2, 0x34] + ldrh r1, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r1, r4 + strh r1, [r2, 0x36] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0810CDD4 + lsls r0, r3, 16 + asrs r0, 24 + negs r0, r0 + b _0810CDD8 +_0810CDD4: + lsls r0, r3, 16 + asrs r0, 24 +_0810CDD8: + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _0810CDF6 + adds r0, r2, 0 + bl move_anim_8072740 +_0810CDF6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810CDB0 + + thumb_func_start sub_810CDFC +sub_810CDFC: @ 810CDFC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0810CE24 + ldrb r3, [r1] + lsls r3, 1 + adds r3, r1 + ldr r1, _0810CE28 + ldr r1, [r1] + ldrb r1, [r1, 0x11] + lsrs r2, r1, 4 + lsls r1, 28 + lsrs r1, 28 + subs r2, r1 + subs r2, 0x1 + strh r2, [r3] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_0810CE24: .4byte 0x0203841e +_0810CE28: .4byte 0x02038400 + thumb_func_end sub_810CDFC + + thumb_func_start unc_080B08A0 +unc_080B08A0: @ 810CE2C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0810CE5C + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0xF + strh r0, [r4, 0x2E] + ldr r0, _0810CE60 + str r0, [r4, 0x1C] + ldr r1, _0810CE64 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810CE5C: .4byte 0x0203841e +_0810CE60: .4byte sub_80A64B0 + 1 +_0810CE64: .4byte move_anim_8072740 + 1 + thumb_func_end unc_080B08A0 + + thumb_func_start sub_810CE68 +sub_810CE68: @ 810CE68 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810CEAC + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0810CE90 + ldr r0, _0810CEB0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810CE90 + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x6] + negs r0, r0 + strh r0, [r4, 0x6] +_0810CE90: + ldr r4, _0810CEAC + ldrb r1, [r4, 0xC] + adds r0, r5, 0 + bl obj_anim_image_start + movs r0, 0 + strh r0, [r4, 0xC] + adds r0, r5, 0 + bl sub_80A7938 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810CEAC: .4byte 0x0203841e +_0810CEB0: .4byte 0x02038436 + thumb_func_end sub_810CE68 + + thumb_func_start sub_810CEB4 +sub_810CEB4: @ 810CEB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810CED0 + ldr r0, _0810CEDC + ldrh r1, [r0, 0x2] + negs r1, r1 + strh r1, [r0, 0x2] + ldrh r1, [r0, 0x6] + negs r1, r1 + strh r1, [r0, 0x6] +_0810CED0: + adds r0, r4, 0 + bl sub_810CE68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810CEDC: .4byte 0x0203841e + thumb_func_end sub_810CEB4 + + thumb_func_start sub_810CEE0 +sub_810CEE0: @ 810CEE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810CF00 + ldrb r1, [r4, 0x8] + bl obj_anim_image_start + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810CF04 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _0810CF0C + .align 2, 0 +_0810CF00: .4byte 0x0203841e +_0810CF04: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_0810CF0C: + ldr r0, _0810CF24 + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + ldr r0, _0810CF28 + str r0, [r5, 0x1C] + ldr r1, _0810CF2C + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810CF24: .4byte 0x0203841e +_0810CF28: .4byte sub_80A64B0 + 1 +_0810CF2C: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810CEE0 + + thumb_func_start sub_810CF30 +sub_810CF30: @ 810CF30 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + ldr r0, _0810CF4C + movs r2, 0 + ldrsh r1, [r0, r2] + mov r9, r0 + cmp r1, 0 + bne _0810CF54 + ldr r0, _0810CF50 + b _0810CF56 + .align 2, 0 +_0810CF4C: .4byte 0x0203841e +_0810CF50: .4byte 0x02038436 +_0810CF54: + ldr r0, _0810D09C +_0810CF56: + ldrb r0, [r0] + mov r8, r0 + mov r4, r9 + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0 + bge _0810CF74 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + strh r0, [r4, 0x4] +_0810CF74: + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl obj_anim_image_start + mov r0, r8 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + mov r0, r8 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + mov r0, r8 + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + lsls r1, 15 + lsrs r6, r1, 16 + mov r0, r8 + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0810CFBE + adds r0, 0x3 +_0810CFBE: + lsls r4, r0, 14 + lsrs r4, 16 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r6, 16 + asrs r1, 16 + bl __modsi3 + lsls r0, 16 + lsrs r6, r0, 16 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber2 + movs r7, 0x1 + adds r1, r7, 0 + ands r1, r0 + cmp r1, 0 + beq _0810D000 + lsls r0, r6, 16 + negs r0, r0 + lsrs r6, r0, 16 +_0810D000: + bl GenerateRandomNumber2 + adds r1, r7, 0 + ands r1, r0 + cmp r1, 0 + beq _0810D012 + lsls r0, r4, 16 + negs r0, r0 + lsrs r4, r0, 16 +_0810D012: + ldr r0, _0810D0A0 + add r0, r8 + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _0810D028 + lsls r0, r4, 16 + ldr r1, _0810D0A4 + adds r0, r1 + lsrs r4, r0, 16 +_0810D028: + lsls r0, r6, 16 + asrs r0, 16 + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + ldrh r3, [r5, 0x22] + adds r0, r3 + strh r0, [r5, 0x22] + mov r1, r9 + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x2E] + ldr r0, _0810D0A8 + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + adds r3, r5, 0 + adds r3, 0x43 + ldrb r3, [r3] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3C] + cmp r0, 0x40 + beq _0810D08C + movs r0, 0x3C + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0810D0AC + adds r0, r4 + movs r1, 0 + bl sub_8008258 + movs r2, 0x3C + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, _0810D0B0 + str r1, [r0] +_0810D08C: + ldr r0, _0810D0B4 + str r0, [r5, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810D09C: .4byte 0x02038437 +_0810D0A0: .4byte 0x02024076 +_0810D0A4: .4byte 0xfff00000 +_0810D0A8: .4byte 0x08597358 +_0810D0AC: .4byte 0x02020630 +_0810D0B0: .4byte nullsub_12 + 1 +_0810D0B4: .4byte sub_810D0B8 + 1 + thumb_func_end sub_810CF30 + + thumb_func_start sub_810D0B8 +sub_810D0B8: @ 810D0B8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0810D100 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0x40 + beq _0810D0F4 + ldr r4, _0810D0FC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + movs r0, 0x3C + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles +_0810D0F4: + adds r0, r5, 0 + bl move_anim_8072740 + b _0810D104 + .align 2, 0 +_0810D0FC: .4byte 0x02020630 +_0810D100: + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] +_0810D104: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810D0B8 + + thumb_func_start sub_810D10C +sub_810D10C: @ 810D10C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + movs r0, 0x1E + strh r0, [r4, 0x2E] + ldr r0, _0810D12C + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D130 + ldrh r0, [r4, 0x20] + subs r0, 0x14 + strh r0, [r4, 0x32] + b _0810D142 + .align 2, 0 +_0810D12C: .4byte 0x0203841e +_0810D130: + ldrh r0, [r4, 0x20] + adds r0, 0x14 + strh r0, [r4, 0x32] + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0810D142: + ldrh r0, [r4, 0x22] + subs r0, 0x14 + strh r0, [r4, 0x36] + ldr r0, _0810D15C + str r0, [r4, 0x1C] + ldr r1, _0810D160 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810D15C: .4byte sub_80A6EEC + 1 +_0810D160: .4byte sub_810D164 + 1 + thumb_func_end sub_810D10C + + thumb_func_start sub_810D164 +sub_810D164: @ 810D164 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + adds r0, 0x1 + movs r6, 0 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _0810D1A4 + ldrh r2, [r5, 0x20] + ldrh r4, [r5, 0x24] + subs r0, r2, r4 + strh r0, [r5, 0x32] + ldrh r1, [r5, 0x22] + ldrh r3, [r5, 0x26] + subs r0, r1, r3 + strh r0, [r5, 0x36] + movs r0, 0x8 + strh r0, [r5, 0x2E] + adds r2, r4 + strh r2, [r5, 0x20] + adds r1, r3 + strh r1, [r5, 0x22] + strh r6, [r5, 0x26] + strh r6, [r5, 0x24] + ldr r0, _0810D1AC + str r0, [r5, 0x1C] + ldr r1, _0810D1B0 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_0810D1A4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810D1AC: .4byte sub_80A6EEC + 1 +_0810D1B0: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810D164 + + thumb_func_start sub_810D1B4 +sub_810D1B4: @ 810D1B4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, _0810D230 + ldrb r1, [r0] + movs r0, 0x2 + ldr r2, _0810D234 + eors r0, r1 + ldrb r1, [r2] + cmp r0, r1 + bne _0810D1E0 + ldrb r0, [r2] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0810D1E0 + ldr r1, _0810D238 + movs r2, 0 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1] +_0810D1E0: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, _0810D230 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810D1FE + ldr r1, _0810D238 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0810D1FE: + ldr r4, _0810D238 + ldrh r0, [r4, 0x6] + movs r5, 0 + strh r0, [r6, 0x2E] + ldrh r0, [r6, 0x20] + strh r0, [r6, 0x30] + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrh r0, [r6, 0x22] + strh r0, [r6, 0x34] + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r4, 0xA] + strh r0, [r6, 0x38] + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x3A] + strh r5, [r6, 0x3C] + ldr r0, _0810D23C + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810D230: .4byte 0x02038436 +_0810D234: .4byte 0x02038437 +_0810D238: .4byte 0x0203841e +_0810D23C: .4byte sub_810D240 + 1 + thumb_func_end sub_810D1B4 + + thumb_func_start sub_810D240 +sub_810D240: @ 810D240 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _0810D26C + ldrh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r0, r2 + strh r0, [r4, 0x3C] + b _0810D272 +_0810D26C: + adds r0, r4, 0 + bl move_anim_8072740 +_0810D272: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810D240 + + thumb_func_start sub_810D278 +sub_810D278: @ 810D278 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r5, _0810D2A4 + ldrb r1, [r5, 0x4] + adds r0, r4, 0 + bl obj_anim_image_start + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldr r0, _0810D2A8 + str r0, [r4, 0x1C] + ldr r1, _0810D2AC + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810D2A4: .4byte 0x0203841e +_0810D2A8: .4byte sub_80A64B0 + 1 +_0810D2AC: .4byte sub_810D2B0 + 1 + thumb_func_end sub_810D278 + + thumb_func_start sub_810D2B0 +sub_810D2B0: @ 810D2B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_8008258 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x14 + strh r0, [r4, 0x2E] + ldr r0, _0810D2DC + str r0, [r4, 0x1C] + ldr r1, _0810D2E0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810D2DC: .4byte sub_80A64B0 + 1 +_0810D2E0: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810D2B0 + + thumb_func_start sub_810D2E4 +sub_810D2E4: @ 810D2E4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, _0810D300 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r0, _0810D304 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810D300: .4byte 0x0203841e +_0810D304: .4byte sub_810D308 + 1 + thumb_func_end sub_810D2E4 + + thumb_func_start sub_810D308 +sub_810D308: @ 810D308 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + subs r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810D34C + movs r0, 0x6 + strh r0, [r5, 0x2E] + ldr r4, _0810D354 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, _0810D358 + str r0, [r5, 0x1C] + ldr r1, _0810D35C + adds r0, r5, 0 + bl oamt_set_x3A_32 +_0810D34C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810D354: .4byte 0x02038437 +_0810D358: .4byte sub_80A6EEC + 1 +_0810D35C: .4byte sub_810D360 + 1 + thumb_func_end sub_810D308 + + thumb_func_start sub_810D360 +sub_810D360: @ 810D360 + push {lr} + movs r1, 0xF + strh r1, [r0, 0x2E] + ldr r1, _0810D374 + str r1, [r0, 0x1C] + ldr r1, _0810D378 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .align 2, 0 +_0810D374: .4byte sub_80A64B0 + 1 +_0810D378: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810D360 + + thumb_func_start sub_810D37C +sub_810D37C: @ 810D37C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810D3A8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r1, _0810D3A4 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810D404 + .align 2, 0 +_0810D3A4: .4byte 0x0203841e +_0810D3A8: + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + cmp r0, 0x64 + ble _0810D3F6 + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + 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] +_0810D3F6: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _0810D404 + adds r0, r4, 0 + bl move_anim_8072740 +_0810D404: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810D37C + + thumb_func_start sub_810D40C +sub_810D40C: @ 810D40C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810D420 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D428 + ldr r4, _0810D424 + b _0810D42A + .align 2, 0 +_0810D420: .4byte 0x0203841e +_0810D424: .4byte 0x02038436 +_0810D428: + ldr r4, _0810D470 +_0810D42A: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r1, _0810D474 + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r2, 0 + strh r0, [r5, 0x20] + ldrh r0, [r1, 0x4] + ldrh r3, [r5, 0x22] + adds r0, r3 + strh r0, [r5, 0x22] + strh r2, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x32] + strh r2, [r5, 0x34] + ldr r0, _0810D478 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810D470: .4byte 0x02038437 +_0810D474: .4byte 0x0203841e +_0810D478: .4byte sub_810D47C + 1 + thumb_func_end sub_810D40C + + thumb_func_start sub_810D47C +sub_810D47C: @ 810D47C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + cmp r2, 0 + beq _0810D48E + cmp r2, 0x1 + beq _0810D4B2 + b _0810D4EC +_0810D48E: + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _0810D4EC + movs r2, 0x32 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0810D4AA + adds r0, r1, 0 + bl move_anim_8072740 + b _0810D4EC +_0810D4AA: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _0810D4EC +_0810D4B2: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810D4DA + movs r0, 0 + strh r0, [r1, 0x30] + ldrh r0, [r1, 0x34] + adds r0, 0x1 + strh r0, [r1, 0x34] + ands r0, r2 + lsls r0, 16 + cmp r0, 0 + beq _0810D4D6 + movs r0, 0x2 + b _0810D4D8 +_0810D4D6: + ldr r0, _0810D4F0 +_0810D4D8: + strh r0, [r1, 0x24] +_0810D4DA: + ldrh r0, [r1, 0x32] + subs r0, 0x1 + strh r0, [r1, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0810D4EC + adds r0, r1, 0 + bl move_anim_8072740 +_0810D4EC: + pop {r0} + bx r0 + .align 2, 0 +_0810D4F0: .4byte 0x0000fffe + thumb_func_end sub_810D47C + + thumb_func_start sub_810D4F4 +sub_810D4F4: @ 810D4F4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0810D518 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810D520 + ldr r4, _0810D51C + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r6, 0x4] + adds r0, r2 + b _0810D532 + .align 2, 0 +_0810D518: .4byte 0x0203841e +_0810D51C: .4byte 0x02038436 +_0810D520: + ldr r4, _0810D57C + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 +_0810D532: + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + strh r0, [r5, 0x22] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + ldr r3, _0810D580 + movs r4, 0x2 + ldrsh r0, [r3, r4] + lsls r0, 4 + adds r1, r0 + ldr r4, _0810D584 + adds r0, r4, 0 + ands r1, r0 + ldr r0, _0810D588 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r1, 0 + movs r0, 0 + strh r0, [r5, 0x2E] + movs r2, 0x2 + ldrsh r0, [r3, r2] + cmp r0, 0x1 + beq _0810D5A0 + cmp r0, 0x1 + bgt _0810D58C + cmp r0, 0 + beq _0810D596 + b _0810D5C6 + .align 2, 0 +_0810D57C: .4byte 0x02038437 +_0810D580: .4byte 0x0203841e +_0810D584: .4byte 0x000003ff +_0810D588: .4byte 0xfffffc00 +_0810D58C: + cmp r0, 0x2 + beq _0810D5B0 + cmp r0, 0x3 + beq _0810D5C0 + b _0810D5C6 +_0810D596: + ldr r0, _0810D59C + b _0810D5C0 + .align 2, 0 +_0810D59C: .4byte 0x0000fffd +_0810D5A0: + movs r0, 0x3 + strh r0, [r5, 0x3A] + ldr r0, _0810D5AC + strh r0, [r5, 0x3C] + b _0810D5CE + .align 2, 0 +_0810D5AC: .4byte 0x0000fffd +_0810D5B0: + ldr r0, _0810D5BC + strh r0, [r5, 0x3A] + movs r0, 0x3 + strh r0, [r5, 0x3C] + b _0810D5CE + .align 2, 0 +_0810D5BC: .4byte 0x0000fffd +_0810D5C0: + strh r0, [r5, 0x3A] + strh r0, [r5, 0x3C] + b _0810D5CE +_0810D5C6: + adds r0, r5, 0 + bl move_anim_8072740 + b _0810D5D2 +_0810D5CE: + ldr r0, _0810D5D8 + str r0, [r5, 0x1C] +_0810D5D2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810D5D8: .4byte sub_810D5DC + 1 + thumb_func_end sub_810D4F4 + + thumb_func_start sub_810D5DC +sub_810D5DC: @ 810D5DC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x3A] + ldrh r2, [r1, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x3C] + ldrh r2, [r1, 0x22] + adds r0, r2 + strh r0, [r1, 0x22] + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0810D604 + adds r0, r1, 0 + bl move_anim_8072740 +_0810D604: + pop {r0} + bx r0 + thumb_func_end sub_810D5DC + + thumb_func_start sub_810D608 +sub_810D608: @ 810D608 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810D654 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D664 + ldr r4, _0810D658 + 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] + ldr r0, _0810D65C + ldrb r0, [r0] + bl sub_80A8328 + 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] + ldr r0, _0810D660 + b _0810D680 + .align 2, 0 +_0810D654: .4byte 0x0203841e +_0810D658: .4byte 0x0202420b +_0810D65C: .4byte 0x02038436 +_0810D660: .4byte 0x02038437 +_0810D664: + ldr r0, _0810D69C + ldrb r0, [r0] + bl sub_80A8328 + 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] + ldr r0, _0810D6A0 +_0810D680: + ldrb r0, [r0] + strh r0, [r5, 0x3C] + movs r0, 0 + strh r0, [r5, 0x2E] + movs r0, 0xC + strh r0, [r5, 0x30] + movs r0, 0x8 + strh r0, [r5, 0x32] + ldr r0, _0810D6A4 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810D69C: .4byte 0x02038437 +_0810D6A0: .4byte 0x02038436 +_0810D6A4: .4byte sub_810D6A8 + 1 + thumb_func_end sub_810D608 + + thumb_func_start sub_810D6A8 +sub_810D6A8: @ 810D6A8 + 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, 0xB4 + bne _0810D704 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x3C] + 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, 0x22] + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, _0810D70C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0810D710 + str r0, [r4, 0x1C] +_0810D704: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810D70C: .4byte move_anim_8074EE0 + 1 +_0810D710: .4byte sub_80A6F98 + 1 + thumb_func_end sub_810D6A8 + + thumb_func_start sub_810D714 +sub_810D714: @ 810D714 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810D760 + ldrh r0, [r4] + strh r0, [r5, 0x20] + movs r2, 0x78 + strh r2, [r5, 0x22] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + adds r0, 0x36 + adds r1, r5, 0 + adds r1, 0x38 + lsls r2, 8 + bl sub_80A8048 + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x3A] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0x4 + ldrsh r0, [r4, r3] + lsls r0, 2 + adds r1, r0 + ldr r3, _0810D764 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0810D768 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r0, _0810D76C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810D760: .4byte 0x0203841e +_0810D764: .4byte 0x000003ff +_0810D768: .4byte 0xfffffc00 +_0810D76C: .4byte sub_810D770 + 1 + thumb_func_end sub_810D714 + + thumb_func_start sub_810D770 +sub_810D770: @ 810D770 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _0810D7C2 + movs r2, 0x36 + ldrsh r0, [r7, r2] + movs r2, 0x38 + ldrsh r1, [r7, r2] + bl sub_80A8050 + adds r4, r0, 0 + movs r1, 0x3A + ldrsh r0, [r7, r1] + subs r4, r0 + adds r0, r7, 0 + adds r0, 0x36 + adds r1, r7, 0 + adds r1, 0x38 + adds r2, r4, 0 + bl sub_80A8048 + asrs r4, 8 + strh r4, [r7, 0x22] + lsls r4, 16 + asrs r4, 16 + movs r0, 0x8 + negs r0, r0 + cmp r4, r0 + bge _0810D7BA + adds r0, r7, 0 + bl move_anim_8072740 + b _0810D818 +_0810D7BA: + ldrh r0, [r7, 0x2E] + subs r0, 0x1 + strh r0, [r7, 0x2E] + b _0810D818 +_0810D7C2: + ldr r4, _0810D824 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r2, _0810D828 + mov r8, r2 + ldrb r0, [r2] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + subs r4, r6 + strh r4, [r7, 0x2E] + lsrs r0, 24 + subs r0, r5 + strh r0, [r7, 0x30] + ldrh r0, [r7, 0x20] + lsls r0, 4 + strh r0, [r7, 0x32] + ldrh r0, [r7, 0x22] + lsls r0, 4 + strh r0, [r7, 0x34] + ldr r0, _0810D82C + str r0, [r7, 0x1C] +_0810D818: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810D824: .4byte 0x02038436 +_0810D828: .4byte 0x02038437 +_0810D82C: .4byte sub_810D830 + 1 + thumb_func_end sub_810D770 + + thumb_func_start sub_810D830 +sub_810D830: @ 810D830 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x34] + adds r1, r3 + strh r1, [r2, 0x34] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r3, r1, 20 + strh r3, [r2, 0x22] + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _0810D86A + adds r1, r3, 0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0810D86A + cmp r1, 0x78 + ble _0810D870 +_0810D86A: + adds r0, r2, 0 + bl move_anim_8072740 +_0810D870: + pop {r0} + bx r0 + thumb_func_end sub_810D830 + + thumb_func_start sub_810D874 +sub_810D874: @ 810D874 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810D8A8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D8B8 + ldr r4, _0810D8AC + 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] + ldr r0, _0810D8B0 + ldrb r4, [r0] + ldr r0, _0810D8B4 + b _0810D8BE + .align 2, 0 +_0810D8A8: .4byte 0x0203841e +_0810D8AC: .4byte 0x0202420b +_0810D8B0: .4byte 0x02038437 +_0810D8B4: .4byte 0x02038436 +_0810D8B8: + ldr r0, _0810D8F0 + ldrb r4, [r0] + ldr r0, _0810D8F4 +_0810D8BE: + ldrb r0, [r0] + bl sub_80A8328 + 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] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810D8F8 + ldrb r2, [r5, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + b _0810D912 + .align 2, 0 +_0810D8F0: .4byte 0x02038436 +_0810D8F4: .4byte 0x02038437 +_0810D8F8: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810D918 + ldrb r2, [r5, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x18 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x57 +_0810D912: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] +_0810D918: + movs r0, 0x10 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, _0810D958 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810D95C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810D958: .4byte move_anim_8072740 + 1 +_0810D95C: .4byte sub_80A6F98 + 1 + thumb_func_end sub_810D874 + + thumb_func_start sub_810D960 +sub_810D960: @ 810D960 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0810D976 + adds r0, r4, 0 + bl move_anim_8072740 +_0810D976: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810D960 + + thumb_func_start sub_810D984 +sub_810D984: @ 810D984 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _0810DA00 + 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] + ldr r1, _0810DA04 + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1] + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x34] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x36] + ldr r0, _0810DA08 + ldrb r6, [r0] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810D9CE + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0810D9CE: + movs r0, 0x1 + ands r6, r0 + cmp r6, 0 + beq _0810D9E2 + ldrh r0, [r5, 0x32] + negs r0, r0 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] +_0810D9E2: + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + ldrh r0, [r5, 0x32] + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x34] + strh r0, [r5, 0x26] + ldr r0, _0810DA0C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810DA00: .4byte 0x02038437 +_0810DA04: .4byte 0x0203841e +_0810DA08: .4byte 0x02038432 +_0810DA0C: .4byte sub_810D960 + 1 + thumb_func_end sub_810D984 + + thumb_func_start sub_810DA10 +sub_810DA10: @ 810DA10 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810DA28 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810DA2C + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + b _0810DA34 + .align 2, 0 +_0810DA28: .4byte 0x0203841e +_0810DA2C: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 +_0810DA34: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810DA48 + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start + b _0810DA5E +_0810DA48: + ldr r0, _0810DA70 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DA5E + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start +_0810DA5E: + ldr r0, _0810DA74 + str r0, [r4, 0x1C] + ldr r1, _0810DA78 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810DA70: .4byte 0x02038436 +_0810DA74: .4byte sub_80A67D8 + 1 +_0810DA78: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810DA10 + + thumb_func_start sub_810DA7C +sub_810DA7C: @ 810DA7C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810DAB6 + ldrh r0, [r4, 0x30] + adds r0, 0x28 + 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] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0810DAB6 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DAB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DA7C + + thumb_func_start sub_810DABC +sub_810DABC: @ 810DABC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0810DAEC + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0810DAF4 + cmp r0, 0x1 + bgt _0810DB0E + cmp r0, 0 + bne _0810DB0E + movs r0, 0 + bl sub_80A6DAC + ldr r0, _0810DAF0 + ldrh r0, [r0] + strh r0, [r4, 0x18] + b _0810DB06 + .align 2, 0 +_0810DAEC: .4byte 0x03005e00 +_0810DAF0: .4byte 0x0203841e +_0810DAF4: + ldrh r0, [r4, 0x18] + subs r0, 0x1 + strh r0, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810DB1A +_0810DB06: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810DB1A +_0810DB0E: + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r1, [r4, 0x1A] + adds r0, r1 + strh r0, [r4, 0x1A] +_0810DB1A: + movs r2, 0xB0 + lsls r2, 4 + adds r0, r2, 0 + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r4, 0x1C] + ldr r0, _0810DB48 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810DB50 + ldr r1, _0810DB4C + ldrh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + adds r7, r1, 0 + b _0810DB60 + .align 2, 0 +_0810DB48: .4byte 0x02038437 +_0810DB4C: .4byte 0x02022e20 +_0810DB50: + ldr r2, _0810DBA0 + ldrh r1, [r4, 0x1A] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + adds r7, r2, 0 +_0810DB60: + ldr r3, _0810DBA4 + ldrh r2, [r4, 0x1C] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + movs r0, 0xFF + ldrb r1, [r4, 0x1A] + movs r5, 0 + strh r1, [r4, 0x1A] + ands r0, r2 + strh r0, [r4, 0x1C] + ldr r0, _0810DBA8 + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0810DB98 + strh r5, [r7] + strh r5, [r3] + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r6, 0 + bl move_anim_task_del +_0810DB98: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810DBA0: .4byte 0x02022e20 +_0810DBA4: .4byte 0x02022e22 +_0810DBA8: .4byte 0x0203841e + thumb_func_end sub_810DABC + + thumb_func_start sub_810DBAC +sub_810DBAC: @ 810DBAC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810DC00 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810DBC2 + adds r0, r5, 0 + movs r1, 0x2 + bl obj_anim_image_start +_0810DBC2: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x2E] + ldr r4, _0810DC04 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, _0810DC08 + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, _0810DC0C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810DC00: .4byte 0x0203841e +_0810DC04: .4byte 0x02038437 +_0810DC08: .4byte 0x0000ffe2 +_0810DC0C: .4byte sub_810DC10 + 1 + thumb_func_end sub_810DBAC + + thumb_func_start sub_810DC10 +sub_810DC10: @ 810DC10 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810DC24 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DC24: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DC10 + + thumb_func_start sub_810DC2C +sub_810DC2C: @ 810DC2C + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r5, _0810DCA0 + movs r1, 0x6 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810DC44 + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start +_0810DC44: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _0810DCA4 + ldrb r0, [r0] + mov r6, sp + adds r6, 0x2 + movs r1, 0x1 + mov r2, sp + adds r3, r6, 0 + bl sub_80A8924 + ldr r0, _0810DCA8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DC72 + ldrh r0, [r5, 0x8] + negs r0, r0 + strh r0, [r5, 0x8] +_0810DC72: + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + mov r1, sp + ldrh r0, [r5, 0x8] + ldrh r1, [r1] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r5, 0xA] + ldrh r6, [r6] + adds r0, r6 + strh r0, [r4, 0x36] + ldr r0, _0810DCAC + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _0810DCB0 + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810DCA0: .4byte 0x0203841e +_0810DCA4: .4byte 0x02038437 +_0810DCA8: .4byte 0x02038436 +_0810DCAC: .4byte 0x0000ffe2 +_0810DCB0: .4byte sub_810DCB4 + 1 + thumb_func_end sub_810DC2C + + thumb_func_start sub_810DCB4 +sub_810DCB4: @ 810DCB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810DCC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DCC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DCB4 + + thumb_func_start sub_810DCD0 +sub_810DCD0: @ 810DCD0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0810DD1C + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_80A6E14 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x38] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x3A] + ldr r0, _0810DD20 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810DD1C: .4byte 0x0203841e +_0810DD20: .4byte sub_810DD24 + 1 + thumb_func_end sub_810DCD0 + + thumb_func_start sub_810DD24 +sub_810DD24: @ 810DD24 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A656C + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x38] + subs r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x3A] + subs r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810DD4A + adds r0, r4, 0 + bl move_anim_8072740 +_0810DD4A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DD24 + + thumb_func_start sub_810DD50 +sub_810DD50: @ 810DD50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0810DDB0 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 + ldr r0, _0810DDB4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DD7C + ldr r1, _0810DDB8 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810DD7C: + ldr r0, _0810DDB8 + ldrh r2, [r0] + ldrh r1, [r4, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + ldrh r1, [r0, 0x2] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + ldrh r3, [r0, 0x8] + strh r3, [r4, 0x2E] + ldrh r0, [r0, 0x4] + adds r2, r0 + strh r2, [r4, 0x32] + adds r1, r3 + strh r1, [r4, 0x36] + ldr r0, _0810DDBC + str r0, [r4, 0x1C] + ldr r1, _0810DDC0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810DDB0: .4byte 0x02038437 +_0810DDB4: .4byte 0x02038436 +_0810DDB8: .4byte 0x0203841e +_0810DDBC: .4byte sub_80A6EEC + 1 +_0810DDC0: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810DD50 + + thumb_func_start sub_810DDC4 +sub_810DDC4: @ 810DDC4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0810DDDC + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810DDE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + b _0810DE16 + .align 2, 0 +_0810DDDC: .4byte 0x0203841e +_0810DDE0: + ldr r0, _0810DE20 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 + ldr r0, _0810DE24 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DE06 + ldrh r0, [r5] + negs r0, r0 + strh r0, [r5] +_0810DE06: + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_0810DE16: + ldr r0, _0810DE28 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810DE20: .4byte 0x02038437 +_0810DE24: .4byte 0x02038436 +_0810DE28: .4byte sub_810DE2C + 1 + thumb_func_end sub_810DDC4 + + thumb_func_start sub_810DE2C +sub_810DE2C: @ 810DE2C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0xB + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x30 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810DE68 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DE68: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DE2C + + thumb_func_start sub_810DE70 +sub_810DE70: @ 810DE70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A6980 + ldrh r0, [r4, 0x22] + adds r0, 0x14 + strh r0, [r4, 0x22] + movs r0, 0xBF + strh r0, [r4, 0x30] + ldr r1, _0810DE94 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810DE94: .4byte sub_810DE98 + 1 + thumb_func_end sub_810DE70 + + thumb_func_start sub_810DE98 +sub_810DE98: @ 810DE98 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x47 + bne _0810DED2 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DED2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DE98 + + thumb_func_start sub_810DED8 +sub_810DED8: @ 810DED8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0810DF08 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r1, _0810DF0C + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x8] + ldrh r0, [r1] + strh r0, [r4, 0xA] + ldr r0, _0810DF10 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldr r0, _0810DF14 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810DF08: .4byte 0x03005e00 +_0810DF0C: .4byte 0x0203841e +_0810DF10: .4byte 0x00002719 +_0810DF14: .4byte sub_810DF18 + 1 + thumb_func_end sub_810DED8 + + thumb_func_start sub_810DF18 +sub_810DF18: @ 810DF18 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _0810DF98 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x1C] + adds r1, r0, 0x1 + strh r1, [r3, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xA + ldrsh r1, [r3, r4] + adds r7, r2, 0 + cmp r0, r1 + bne _0810DF76 + movs r0, 0 + strh r0, [r3, 0x1C] + ldrb r0, [r3, 0xC] + ldr r2, _0810DF9C + lsls r0, 4 + movs r3, 0x84 + lsls r3, 1 + adds r1, r0, r3 + lsls r1, 1 + adds r1, r2 + ldrh r6, [r1] + movs r4, 0x7 + mov r12, r0 + ldr r0, _0810DFA0 + add r0, r12 + lsls r0, 1 + adds r3, r0, r2 +_0810DF5E: + ldrh r0, [r3] + strh r0, [r1] + subs r3, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0810DF5E + ldr r0, _0810DFA4 + add r0, r12 + lsls r0, 1 + adds r0, r2 + strh r6, [r0] +_0810DF76: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bne _0810DF90 + adds r0, r5, 0 + bl move_anim_task_del +_0810DF90: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810DF98: .4byte 0x03005e00 +_0810DF9C: .4byte 0x02037b14 +_0810DFA0: .4byte 0x00000107 +_0810DFA4: .4byte 0x00000101 + thumb_func_end sub_810DF18 + + thumb_func_start sub_810DFA8 +sub_810DFA8: @ 810DFA8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _0810E014 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DFC8 + ldr r1, _0810E018 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0810DFC8: + ldr r4, _0810E018 + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldrh r0, [r6, 0x20] + strh r0, [r6, 0x30] + ldr r5, _0810E01C + 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] + ldrh r0, [r6, 0x22] + strh r0, [r6, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _0810E020 + str r0, [r6, 0x1C] + ldr r1, _0810E024 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810E014: .4byte 0x02038436 +_0810E018: .4byte 0x0203841e +_0810E01C: .4byte 0x02038437 +_0810E020: .4byte sub_80A67BC + 1 +_0810E024: .4byte sub_810E028 + 1 + thumb_func_end sub_810DFA8 + + thumb_func_start sub_810E028 +sub_810E028: @ 810E028 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810E03C + adds r0, r4, 0 + bl move_anim_8072740 +_0810E03C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810E028 + + thumb_func_start sub_810E044 +sub_810E044: @ 810E044 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810E0E0 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810E070 + ldr r1, _0810E0E4 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] +_0810E070: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810E088 + ldr r0, _0810E0E4 + ldrh r1, [r0, 0x2] + negs r1, r1 + strh r1, [r0, 0x2] + ldrh r1, [r0, 0x6] + negs r1, r1 + strh r1, [r0, 0x6] +_0810E088: + 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 + ldr r2, _0810E0E4 + ldrh r1, [r2] + ldrh r3, [r5, 0x20] + adds r1, r3 + strh r1, [r5, 0x20] + lsrs r0, 24 + ldrh r1, [r2, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x2E] + movs r3, 0xC + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0810E0EC + ldr r4, _0810E0E8 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + b _0810E0FE + .align 2, 0 +_0810E0E0: .4byte 0x02038436 +_0810E0E4: .4byte 0x0203841e +_0810E0E8: .4byte 0x02038437 +_0810E0EC: + ldr r0, _0810E12C + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0810E0FE: + ldr r4, _0810E130 + ldrh r0, [r4, 0x4] + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r4, 0x6] + ldrh r3, [r5, 0x36] + adds r0, r3 + strh r0, [r5, 0x36] + ldr r0, _0810E134 + str r0, [r5, 0x1C] + ldr r1, _0810E138 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldrb r1, [r4, 0xA] + adds r0, r5, 0 + bl obj_anim_image_seek + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810E12C: .4byte 0x02038437 +_0810E130: .4byte 0x0203841e +_0810E134: .4byte sub_80A6EEC + 1 +_0810E138: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810E044 + + thumb_func_start sub_810E13C +sub_810E13C: @ 810E13C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, _0810E178 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldr r0, _0810E17C + str r0, [r4, 0x1C] + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, _0810E180 + lsls r0, 24 + lsrs r0, 24 + 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] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810E178: .4byte 0x0203841e +_0810E17C: .4byte sub_810E184 + 1 +_0810E180: .4byte 0x02020630 + thumb_func_end sub_810E13C + + thumb_func_start sub_810E184 +sub_810E184: @ 810E184 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _0810E198 + subs r0, r1, 0x1 + strh r0, [r2, 0x2E] + b _0810E1AA +_0810E198: + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r2, 0x26] + subs r1, r0 + strh r1, [r2, 0x26] +_0810E1AA: + movs r3, 0x22 + ldrsh r0, [r2, r3] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0810E1C2 + adds r0, r2, 0 + bl move_anim_8072740 +_0810E1C2: + pop {r0} + bx r0 + thumb_func_end sub_810E184 + + thumb_func_start sub_810E1C8 +sub_810E1C8: @ 810E1C8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810E1F0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810E1F8 + movs r0, 0x88 + lsls r0, 1 + strh r0, [r5, 0x20] + ldr r0, _0810E1F4 + strh r0, [r5, 0x22] + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8008258 + b _0810E1FE + .align 2, 0 +_0810E1F0: .4byte 0x02038436 +_0810E1F4: .4byte 0x0000ffe0 +_0810E1F8: + ldr r0, _0810E23C + strh r0, [r5, 0x20] + strh r0, [r5, 0x22] +_0810E1FE: + ldr r0, _0810E240 + ldrh r0, [r0] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, _0810E244 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, _0810E248 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810E23C: .4byte 0x0000ffe0 +_0810E240: .4byte 0x0203841e +_0810E244: .4byte 0x02038437 +_0810E248: .4byte sub_810E24C + 1 + thumb_func_end sub_810E1C8 + + thumb_func_start sub_810E24C +sub_810E24C: @ 810E24C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A6F3C + ldrh r1, [r4, 0x34] + lsrs r0, r1, 8 + cmp r0, 0xC8 + bls _0810E274 + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x24] + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] +_0810E274: + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x20 + movs r1, 0x98 + lsls r1, 1 + cmp r0, r1 + bhi _0810E296 + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0xA0 + ble _0810E2BC +_0810E296: + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, _0810E2C4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl move_anim_8072740 +_0810E2BC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810E2C4: .4byte 0x02020630 + thumb_func_end sub_810E24C + + thumb_func_start sub_810E2C8 +sub_810E2C8: @ 810E2C8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + subs r1, r0, 0x1 + strh r1, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _0810E308 + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810E2FA + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0810E2FA: + adds r0, r4, 0 + bl obj_delete_and_free_tiles + ldr r1, _0810E310 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0810E308: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810E310: .4byte 0x020383fe + thumb_func_end sub_810E2C8 + + thumb_func_start sub_810E314 +sub_810E314: @ 810E314 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r5, r7, 0 + adds r5, 0x2E + ldr r0, _0810E334 + ldrh r1, [r0, 0xE] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0810E33C + ldr r0, _0810E338 + b _0810E33E + .align 2, 0 +_0810E334: .4byte 0x0203841e +_0810E338: .4byte 0x02038436 +_0810E33C: + ldr r0, _0810E3E8 +_0810E33E: + ldrb r6, [r0] + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810E354 + ldr r1, _0810E3EC + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810E354: + adds r0, r6, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _0810E3EC + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r7, 0x20] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + ldrh r1, [r4, 0x2] + lsrs r0, 24 + adds r1, r0, r1 + strh r1, [r7, 0x22] + lsls r1, 8 + strh r1, [r5, 0x8] + ldrh r1, [r4, 0xC] + adds r0, r1 + lsls r0, 1 + ldrh r2, [r5, 0xE] + movs r1, 0x1 + ands r1, r2 + orrs r1, r0 + strh r1, [r5, 0xE] + ldrb r0, [r5] + movs r2, 0x4 + mov r8, r2 + mov r1, r8 + orrs r0, r1 + strb r0, [r5] + ldrh r0, [r4, 0x4] + ldrb r1, [r4, 0x4] + strh r1, [r5, 0x2] + lsls r0, 16 + lsrs r0, 24 + strh r0, [r5, 0xA] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x4] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x6] + ldrh r0, [r4, 0xA] + strh r0, [r5, 0xC] + subs r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x7F + bhi _0810E44A + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E3F0 + adds r0, r6, 0 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r7, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x5] + b _0810E408 + .align 2, 0 +_0810E3E8: .4byte 0x02038437 +_0810E3EC: .4byte 0x0203841e +_0810E3F0: + adds r0, r6, 0 + bl sub_80A8328 + movs r1, 0x3 + 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] +_0810E408: + ldrb r1, [r5, 0xE] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r5, 0xE] + movs r2, 0x4 + ldrsh r0, [r5, r2] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _0810E4AA + adds r3, r7, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r0, r2, 31 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r7, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + b _0810E4A2 +_0810E44A: + adds r0, r6, 0 + bl sub_80A8328 + movs r1, 0x3 + 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] + ldrb r0, [r5, 0xE] + movs r4, 0x1 + orrs r0, r4 + strb r0, [r5, 0xE] + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810E4AA + adds r3, r7, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + ands r1, r4 + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r7, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + mov r2, r8 + orrs r0, r2 +_0810E4A2: + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] +_0810E4AA: + ldrh r1, [r5, 0x2] + lsrs r1, 6 + lsls r1, 4 + ldrb r2, [r5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r5] + ldr r3, _0810E514 + ldrh r0, [r5, 0x2] + lsls r0, 1 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r0, r2] + ldrb r0, [r5, 0xC] + muls r0, r1 + asrs r0, 8 + strh r0, [r7, 0x24] + ldrb r2, [r7, 0x3] + lsls r2, 26 + lsrs r2, 27 + movs r1, 0x24 + ldrsh r0, [r7, r1] + negs r0, r0 + asrs r0, 1 + ldrb r5, [r5, 0xA] + adds r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r3 + ldrh r4, [r1] + ldr r1, _0810E518 + lsls r2, 3 + adds r2, r1 + adds r0, 0x40 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x6] + strh r0, [r2] + strh r4, [r2, 0x2] + lsls r0, r4, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r2, 0x4] + ldr r0, _0810E51C + str r0, [r7, 0x1C] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810E514: .4byte 0x08329f40 +_0810E518: .4byte 0x02021bc0 +_0810E51C: .4byte sub_810E520 + 1 + thumb_func_end sub_810E314 + + thumb_func_start sub_810E520 +sub_810E520: @ 810E520 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r6, 0 + adds r4, r5, 0 + adds r4, 0x2E + ldrb r2, [r4] + movs r7, 0x1 + movs r0, 0x1 + mov r9, r0 + ands r0, r2 + cmp r0, 0 + beq _0810E55A + ldrb r0, [r4, 0x1] + adds r1, r0, 0 + adds r1, 0xFF + strb r1, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + beq _0810E54E + b _0810EA36 +_0810E54E: + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810EA36 +_0810E55A: + ldrh r0, [r4, 0x2] + lsrs r1, r0, 6 + mov r12, r0 + cmp r1, 0x1 + bne _0810E566 + b _0810E68A +_0810E566: + cmp r1, 0x1 + bgt _0810E570 + cmp r1, 0 + beq _0810E57E + b _0810E97C +_0810E570: + cmp r1, 0x2 + bne _0810E576 + b _0810E77E +_0810E576: + cmp r1, 0x3 + bne _0810E57C + b _0810E872 +_0810E57C: + b _0810E97C +_0810E57E: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0x1 + bne _0810E592 + movs r0, 0x8 + orrs r0, r2 + orrs r0, r7 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810E680 +_0810E592: + lsrs r0, r1, 28 + cmp r0, 0x3 + bne _0810E5B4 + lsls r0, r2, 30 + lsrs r0, 31 + movs r1, 0x1 + eors r0, r1 + ands r0, r7 + lsls r0, 1 + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + orrs r1, r7 + strb r1, [r4] + strb r6, [r4, 0x1] + b _0810E680 +_0810E5B4: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E680 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E672 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E642 + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E628 + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E660 +_0810E628: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E660 +_0810E642: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E656 + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E65E +_0810E656: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E65E: + strb r0, [r1] +_0810E660: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E672: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E680: + ldrb r1, [r4] + movs r0, 0xF + ands r0, r1 + strb r0, [r4] + b _0810E97C +_0810E68A: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0 + bne _0810E698 + movs r0, 0x8 + orrs r0, r2 + b _0810E6A0 +_0810E698: + lsrs r0, r1, 28 + cmp r0, 0x2 + bne _0810E6A8 + adds r0, r2, 0 +_0810E6A0: + orrs r0, r7 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810E774 +_0810E6A8: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E774 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E766 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E736 + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E71C + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E754 +_0810E71C: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E754 +_0810E736: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E74A + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E752 +_0810E74A: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E752: + strb r0, [r1] +_0810E754: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E766: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E774: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x10 + b _0810E978 +_0810E77E: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0x3 + bne _0810E78C + movs r0, 0x8 + orrs r0, r2 + b _0810E794 +_0810E78C: + lsrs r0, r1, 28 + cmp r0, 0x1 + bne _0810E79C + adds r0, r2, 0 +_0810E794: + orrs r0, r7 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810E868 +_0810E79C: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E868 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E85A + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E82A + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E810 + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E848 +_0810E810: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E848 +_0810E82A: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E83E + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E846 +_0810E83E: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E846: + strb r0, [r1] +_0810E848: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E85A: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E868: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x20 + b _0810E978 +_0810E872: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0x2 + bne _0810E882 + movs r0, 0x8 + orrs r0, r2 + strb r0, [r4] + b _0810E970 +_0810E882: + lsrs r0, r1, 28 + cmp r0, 0 + bne _0810E8A4 + lsls r0, r2, 30 + lsrs r0, 31 + movs r1, 0x1 + eors r0, r1 + ands r0, r7 + lsls r0, 1 + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + orrs r1, r7 + strb r1, [r4] + strb r6, [r4, 0x1] + b _0810E970 +_0810E8A4: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E970 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E962 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E932 + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E918 + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E950 +_0810E918: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E950 +_0810E932: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E946 + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E94E +_0810E946: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E94E: + strb r0, [r1] +_0810E950: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E962: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E970: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x30 +_0810E978: + orrs r1, r0 + strb r1, [r4] +_0810E97C: + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 31 + adds r0, r4, 0 + adds r0, 0xC + adds r0, r1 + ldrb r1, [r0] + ldr r3, _0810EA04 + mov r2, r12 + lsls r0, r2, 1 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r0, r1 + asrs r0, 8 + strh r0, [r5, 0x24] + ldrb r2, [r5, 0x3] + lsls r2, 26 + lsrs r2, 27 + movs r1, 0x24 + ldrsh r0, [r5, r1] + negs r0, r0 + asrs r0, 1 + ldrb r1, [r4, 0xA] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r3 + ldrh r6, [r1] + ldr r1, _0810EA08 + lsls r2, 3 + adds r2, r1 + adds r0, 0x40 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x6] + strh r0, [r2] + strh r6, [r2, 0x2] + lsls r0, r6, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r2, 0x4] + ldrh r0, [r4, 0x6] + ldrh r2, [r4, 0x8] + adds r0, r2 + strh r0, [r4, 0x8] + lsls r0, 16 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810EA0C + ldrh r0, [r4, 0x4] + subs r1, 0x1 + ands r1, r0 + ldrh r0, [r4, 0x2] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2] + b _0810EA1C + .align 2, 0 +_0810EA04: .4byte 0x08329f40 +_0810EA08: .4byte 0x02021bc0 +_0810EA0C: + ldrh r0, [r4, 0x4] + ldr r1, _0810EA44 + ands r1, r0 + ldrh r2, [r4, 0x2] + adds r1, r2 + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0x2] +_0810EA1C: + movs r0, 0x22 + ldrsh r1, [r5, r0] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + ldrh r0, [r4, 0xE] + lsrs r0, 1 + cmp r1, r0 + blt _0810EA36 + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, _0810EA48 + str r0, [r5, 0x1C] +_0810EA36: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810EA44: .4byte 0x00007fff +_0810EA48: .4byte sub_810E2C8 + 1 + thumb_func_end sub_810E520 + + thumb_func_start sub_810EA4C +sub_810EA4C: @ 810EA4C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _0810EA94 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldr r5, _0810EA98 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r0, _0810EA9C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810EA94: .4byte 0x02038437 +_0810EA98: .4byte 0x02038436 +_0810EA9C: .4byte sub_80A7820 + 1 + thumb_func_end sub_810EA4C + + thumb_func_start sub_810EAA0 +sub_810EAA0: @ 810EAA0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0810EAB8 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810EABC + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC + b _0810EAC4 + .align 2, 0 +_0810EAB8: .4byte 0x0203841e +_0810EABC: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 +_0810EAC4: + ldr r4, _0810EB2C + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0810EADC + ldr r0, _0810EB30 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810EAF2 +_0810EADC: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0810EAF8 + ldr r0, _0810EB34 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810EAF8 +_0810EAF2: + ldrh r0, [r5, 0x20] + adds r0, 0x8 + strh r0, [r5, 0x20] +_0810EAF8: + ldr r4, _0810EB2C + ldrb r1, [r4, 0x8] + adds r0, r5, 0 + bl obj_anim_image_seek + ldrh r0, [r5, 0x20] + subs r0, 0x20 + strh r0, [r5, 0x20] + ldr r0, _0810EB38 + strh r0, [r5, 0x30] + ldrh r1, [r4, 0x8] + movs r0, 0xC + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 + ldrh r2, [r5, 0x24] + adds r0, r2 + strh r0, [r5, 0x24] + strh r1, [r5, 0x2E] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x3C] + ldr r0, _0810EB3C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810EB2C: .4byte 0x0203841e +_0810EB30: .4byte 0x02038436 +_0810EB34: .4byte 0x02038437 +_0810EB38: .4byte 0x00000ccc +_0810EB3C: .4byte sub_810EB40 + 1 + thumb_func_end sub_810EAA0 + + thumb_func_start sub_810EB40 +sub_810EB40: @ 810EB40 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0810EB6A + strh r1, [r4, 0x2E] + strh r1, [r4, 0x24] + adds r0, r4, 0 + bl obj_anim_image_start +_0810EB6A: + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810EB82 + adds r0, r4, 0 + bl move_anim_8072740 +_0810EB82: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810EB40 + + thumb_func_start sub_810EB88 +sub_810EB88: @ 810EB88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _0810EC20 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + ldrh r0, [r7, 0x8] + movs r1, 0x1F + ands r0, r1 + cmp r0, 0 + bne _0810EC02 + ldr r1, _0810EC24 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r1, 0x8 + ldrsh r0, [r7, r1] + movs r5, 0xD + negs r5, r5 + adds r1, r5, 0 + bl sine + ldr r4, _0810EC28 + strh r0, [r4] + movs r1, 0x8 + ldrsh r0, [r7, r1] + adds r1, r5, 0 + bl cosine + strh r0, [r4, 0x2] + movs r0, 0x1 + strh r0, [r4, 0x4] + movs r0, 0x3 + strh r0, [r4, 0x6] + ldr r0, _0810EC2C + mov r8, r0 + ldr r5, _0810EC30 + 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 + mov r0, r8 + adds r1, r4, 0 + movs r3, 0x3 + bl obj_add_from_template_call_callback_once +_0810EC02: + ldrh r0, [r7, 0x8] + adds r0, 0x8 + strh r0, [r7, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _0810EC16 + adds r0, r6, 0 + bl move_anim_task_del +_0810EC16: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810EC20: .4byte 0x03005e00 +_0810EC24: .4byte 0x020383fe +_0810EC28: .4byte 0x0203841e +_0810EC2C: .4byte 0x085973e8 +_0810EC30: .4byte 0x02038437 + thumb_func_end sub_810EB88 + + thumb_func_start sub_810EC34 +sub_810EC34: @ 810EC34 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810EC46 + cmp r0, 0x1 + beq _0810EC78 + b _0810EC8C +_0810EC46: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, _0810EC74 + lsls r0, 24 + lsrs r0, 24 + 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] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810EC8C + .align 2, 0 +_0810EC74: .4byte 0x02020630 +_0810EC78: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810EC8C + adds r0, r4, 0 + bl move_anim_8072740 +_0810EC8C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810EC34 + + thumb_func_start sub_810EC94 +sub_810EC94: @ 810EC94 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0810ECCC + cmp r0, 0x1 + bgt _0810ECAA + cmp r0, 0 + beq _0810ECB0 + b _0810ED1E +_0810ECAA: + cmp r0, 0x2 + beq _0810ECE0 + b _0810ED1E +_0810ECB0: + ldr r0, _0810ECC8 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + negs r0, r0 + subs r0, 0x20 + strh r0, [r4, 0x26] + b _0810ECD8 + .align 2, 0 +_0810ECC8: .4byte 0x02038437 +_0810ECCC: + ldrh r0, [r4, 0x26] + adds r0, 0xA + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _0810ED1E +_0810ECD8: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810ED1E +_0810ECE0: + ldrh r0, [r4, 0x26] + subs r0, 0xA + strh r0, [r4, 0x26] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0810ED1E + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, _0810ED24 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl move_anim_8072740 +_0810ED1E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810ED24: .4byte 0x02020630 + thumb_func_end sub_810EC94 + + thumb_func_start sub_810ED28 +sub_810ED28: @ 810ED28 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, _0810ED64 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldr r0, _0810ED68 + str r0, [r4, 0x1C] + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, _0810ED6C + lsls r0, 24 + lsrs r0, 24 + 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] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810ED64: .4byte 0x0203841e +_0810ED68: .4byte sub_810ED70 + 1 +_0810ED6C: .4byte 0x02020630 + thumb_func_end sub_810ED28 + + thumb_func_start sub_810ED70 +sub_810ED70: @ 810ED70 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _0810ED84 + subs r0, r1, 0x1 + strh r0, [r2, 0x2E] + b _0810EDC8 +_0810ED84: + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + ble _0810EDAA + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r2, 0x26] + subs r1, r0 + strh r1, [r2, 0x26] + b _0810EDC8 +_0810EDAA: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x34] + adds r1, r0, 0x1 + strh r1, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _0810EDC8 + ldr r0, _0810EDCC + str r0, [r2, 0x1C] +_0810EDC8: + pop {r0} + bx r0 + .align 2, 0 +_0810EDCC: .4byte sub_810EDD0 + 1 + thumb_func_end sub_810ED70 + + thumb_func_start sub_810EDD0 +sub_810EDD0: @ 810EDD0 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] + movs r3, 0x22 + ldrsh r0, [r2, r3] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + ble _0810EE00 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0810EE00: + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _0810EE0E + adds r0, r2, 0 + bl move_anim_8072740 +_0810EE0E: + pop {r0} + bx r0 + thumb_func_end sub_810EDD0 + + thumb_func_start sub_810EE14 +sub_810EE14: @ 810EE14 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810EE28 + cmp r0, 0x1 + beq _0810EE80 + b _0810EEEC +_0810EE28: + ldr r0, _0810EE38 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0810EE40 + ldr r4, _0810EE3C + b _0810EE42 + .align 2, 0 +_0810EE38: .4byte 0x0203841e +_0810EE3C: .4byte 0x02038436 +_0810EE40: + ldr r4, _0810EE7C +_0810EE42: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r0, 0 + movs r3, 0x80 + lsls r3, 2 + strh r3, [r5, 0x30] + movs r2, 0x80 + lsls r2, 1 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A73E0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0810EEEC + .align 2, 0 +_0810EE7C: .4byte 0x02038437 +_0810EE80: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0xB + bgt _0810EE8E + ldrh r0, [r5, 0x30] + subs r0, 0x28 + b _0810EE92 +_0810EE8E: + ldrh r0, [r5, 0x30] + adds r0, 0x28 +_0810EE92: + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x32] + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x30 + ldrsh r3, [r5, r0] + str r1, [sp] + adds r0, r5, 0 + bl sub_80A73E0 + ldrb r1, [r5, 0x3] + lsls r1, 26 + lsrs r1, 27 + movs r0, 0xF4 + lsls r0, 6 + ldr r2, _0810EEF4 + lsls r1, 3 + adds r1, r2 + movs r2, 0x6 + ldrsh r1, [r1, r2] + bl __divsi3 + adds r1, r0, 0x1 + cmp r1, 0x80 + ble _0810EECC + movs r1, 0x80 +_0810EECC: + movs r0, 0x40 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r1, r0, 1 + strh r1, [r5, 0x26] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x18 + bne _0810EEEC + adds r0, r5, 0 + bl sub_80A749C + adds r0, r5, 0 + bl move_anim_8072740 +_0810EEEC: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810EEF4: .4byte 0x02021bc0 + thumb_func_end sub_810EE14 + + thumb_func_start sub_810EEF8 +sub_810EEF8: @ 810EEF8 + push {r4,r5,lr} + adds r5, r0, 0 + bl GenerateRandomNumber2 + ldr r4, _0810EF1C + ands r4, r0 + bl GenerateRandomNumber2 + movs r1, 0x7F + ands r1, r0 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0810EF20 + movs r2, 0xB8 + lsls r2, 2 + adds r0, r4, r2 + b _0810EF28 + .align 2, 0 +_0810EF1C: .4byte 0x000001ff +_0810EF20: + movs r2, 0xB8 + lsls r2, 2 + adds r0, r2, 0 + subs r0, r4 +_0810EF28: + strh r0, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810EF3C + movs r2, 0xE0 + lsls r2, 2 + adds r0, r2, 0 + adds r0, r1, r0 + b _0810EF44 +_0810EF3C: + movs r2, 0xE0 + lsls r2, 2 + adds r0, r2, 0 + subs r0, r1 +_0810EF44: + strh r0, [r5, 0x30] + ldr r2, _0810EF6C + ldrh r0, [r2] + strh r0, [r5, 0x32] + lsls r0, 16 + cmp r0, 0 + beq _0810EF60 + ldrb r0, [r5, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r5, 0x3] +_0810EF60: + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0810EF74 + ldr r4, _0810EF70 + b _0810EF76 + .align 2, 0 +_0810EF6C: .4byte 0x0203841e +_0810EF70: .4byte 0x02038436 +_0810EF74: + ldr r4, _0810EFA0 +_0810EF76: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r5, 0x22] + ldr r0, _0810EFA4 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810EFA0: .4byte 0x02038437 +_0810EFA4: .4byte sub_810EFA8 + 1 + thumb_func_end sub_810EEF8 + + thumb_func_start sub_810EFA8 +sub_810EFA8: @ 810EFA8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810EFC0 + ldrh r3, [r4, 0x2E] + lsls r0, r3, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + b _0810EFCA +_0810EFC0: + ldrh r3, [r4, 0x2E] + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 +_0810EFCA: + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + strh r3, [r4, 0x2E] + adds r0, r2, 0 + subs r0, 0x20 + strh r0, [r4, 0x30] + lsls r0, r3, 16 + cmp r0, 0 + bge _0810EFEA + movs r0, 0 + strh r0, [r4, 0x2E] +_0810EFEA: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _0810EFFE + adds r0, r4, 0 + bl move_anim_8072740 +_0810EFFE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810EFA8 + + thumb_func_start sub_810F004 +sub_810F004: @ 810F004 + movs r1, 0 + strh r1, [r0, 0x3A] + movs r1, 0x40 + strh r1, [r0, 0x3C] + ldr r1, _0810F014 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_0810F014: .4byte sub_810F018 + 1 + thumb_func_end sub_810F004 + + thumb_func_start sub_810F018 +sub_810F018: @ 810F018 + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _0810F02A + cmp r1, 0x1 + beq _0810F078 + b _0810F07E +_0810F02A: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0810F07E + strh r1, [r3, 0x30] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r2, [r1] + 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] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _0810F07E + ldrb r1, [r1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810F07E + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _0810F07E +_0810F078: + adds r0, r3, 0 + bl move_anim_8072740 +_0810F07E: + pop {r0} + bx r0 + thumb_func_end sub_810F018 + + thumb_func_start sub_810F084 +sub_810F084: @ 810F084 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r8, r0 + ldrh r4, [r0, 0x20] + ldrh r5, [r0, 0x22] + ldr r6, _0810F138 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + mov r2, r8 + strh r6, [r2, 0x22] + ldrh r0, [r2, 0x20] + mov r9, r0 + mov r1, r9 + lsls r0, r1, 4 + strh r0, [r2, 0x36] + lsls r0, r6, 4 + strh r0, [r2, 0x38] + lsls r4, 16 + asrs r4, 16 + movs r1, 0x20 + ldrsh r0, [r2, r1] + subs r0, r4, r0 + lsls r0, 4 + movs r1, 0xC + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3A] + lsls r5, 16 + asrs r5, 16 + movs r1, 0x22 + ldrsh r0, [r2, r1] + subs r0, r5, r0 + lsls r0, 4 + movs r1, 0xC + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3C] + mov r0, r9 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + subs r5, r6 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + mov r0, r8 + movs r1, 0x1 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, _0810F13C + mov r2, r8 + str r0, [r2, 0x1C] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810F138: .4byte 0x02038436 +_0810F13C: .4byte sub_810F140 + 1 + thumb_func_end sub_810F084 + + thumb_func_start sub_810F140 +sub_810F140: @ 810F140 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x3A] + ldrh r1, [r2, 0x36] + adds r0, r1 + strh r0, [r2, 0x36] + ldrh r1, [r2, 0x3C] + ldrh r3, [r2, 0x38] + adds r1, r3 + strh r1, [r2, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r3, r1, 20 + strh r3, [r2, 0x22] + adds r0, 0x2D + lsls r0, 16 + movs r1, 0xA5 + lsls r1, 17 + cmp r0, r1 + bhi _0810F17A + adds r1, r3, 0 + cmp r1, 0x9D + bgt _0810F17A + movs r0, 0x2D + negs r0, r0 + cmp r1, r0 + bge _0810F180 +_0810F17A: + adds r0, r2, 0 + bl move_anim_8074EE0 +_0810F180: + pop {r0} + bx r0 + thumb_func_end sub_810F140 + + thumb_func_start sub_810F184 +sub_810F184: @ 810F184 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0810F1B4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810F1BC + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0810F1B8 + 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 + b _0810F1DA + .align 2, 0 +_0810F1B4: .4byte 0x0203841e +_0810F1B8: .4byte 0x02020630 +_0810F1BC: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0810F1E8 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 +_0810F1DA: + strb r0, [r1] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810F1E8: .4byte 0x02020630 + thumb_func_end sub_810F184 + + thumb_func_start sub_810F1EC +sub_810F1EC: @ 810F1EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _0810F2AC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810F212 + mov r0, r8 + cmp r0, 0 + beq _0810F22E +_0810F212: + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r1, r5, 0 + adds r1, 0x43 + movs r0, 0xC8 + strb r0, [r1] + mov r1, r8 + cmp r1, 0 + bne _0810F2B8 +_0810F22E: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + adds r0, r4, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r6, r1, 31 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F264 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80A438C +_0810F264: + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r7 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F284 + movs r0, 0x1 + eors r6, r0 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80A438C +_0810F284: + mov r0, r8 + cmp r0, 0 + bne _0810F2B8 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0810F2B8 + ldr r0, _0810F2AC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810F2B0 + movs r0, 0x48 + strh r0, [r5, 0x20] + movs r0, 0x50 + b _0810F2F2 + .align 2, 0 +_0810F2AC: .4byte 0x02038436 +_0810F2B0: + movs r0, 0xB0 + strh r0, [r5, 0x20] + movs r0, 0x28 + b _0810F2F2 +_0810F2B8: + ldr r6, _0810F320 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810F2CE + ldr r1, _0810F324 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810F2CE: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _0810F324 + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 +_0810F2F2: + strh r0, [r5, 0x22] + ldr r0, _0810F324 + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r5, 0x2E] + mov r0, r8 + cmp r0, 0 + beq _0810F32C + ldrh r0, [r5, 0x22] + adds r0, 0x9 + strh r0, [r5, 0x22] + ldr r1, _0810F328 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + b _0810F330 + .align 2, 0 +_0810F320: .4byte 0x02038436 +_0810F324: .4byte 0x0203841e +_0810F328: .4byte sub_810F3C8 + 1 +_0810F32C: + ldr r0, _0810F33C + str r0, [r5, 0x1C] +_0810F330: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810F33C: .4byte sub_810F340 + 1 + thumb_func_end sub_810F1EC + + thumb_func_start sub_810F340 +sub_810F340: @ 810F340 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810F35C + movs r0, 0x1 + strh r0, [r5, 0x3C] + b _0810F3B6 +_0810F35C: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F382 + ldr r2, _0810F3BC + ldr r0, _0810F3C0 + adds r0, r4, 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] +_0810F382: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F3AC + ldr r2, _0810F3BC + ldr r0, _0810F3C0 + adds r0, r4, 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] +_0810F3AC: + ldr r1, _0810F3C4 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 +_0810F3B6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810F3BC: .4byte 0x02020630 +_0810F3C0: .4byte 0x020241e4 +_0810F3C4: .4byte sub_810F3C8 + 1 + thumb_func_end sub_810F340 + + thumb_func_start sub_810F3C8 +sub_810F3C8: @ 810F3C8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0xD + bne _0810F3F4 + ldr r0, _0810F3F0 + str r0, [r4, 0x1C] + b _0810F3F8 + .align 2, 0 +_0810F3F0: .4byte sub_810F400 + 1 +_0810F3F4: + adds r0, r1, 0x1 + strh r0, [r4, 0x34] +_0810F3F8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810F3C8 + + thumb_func_start sub_810F400 +sub_810F400: @ 810F400 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0810F45E + movs r0, 0 + strh r0, [r3, 0x30] + ldrh r4, [r3, 0x2E] + ldr r1, _0810F464 + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 1 + adds r0, r1 + ldrh r7, [r0] + movs r5, 0x8 + adds r6, r1, 0 + adds r1, r4, 0x7 + lsls r0, r4, 1 + adds r0, r6 + adds r2, r0, 0 + adds r2, 0x10 + lsls r1, 1 + adds r1, r6 +_0810F436: + ldrh r0, [r1] + strh r0, [r2] + subs r1, 0x2 + subs r2, 0x2 + subs r5, 0x1 + cmp r5, 0 + bgt _0810F436 + adds r0, r4, 0x1 + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0810F45E + ldr r0, _0810F468 + str r0, [r3, 0x1C] +_0810F45E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810F464: .4byte 0x02037b14 +_0810F468: .4byte sub_810F46C + 1 + thumb_func_end sub_810F400 + + thumb_func_start sub_810F46C +sub_810F46C: @ 810F46C + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x34] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldrh r0, [r5, 0x34] + subs r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810F512 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810F502 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F4D4 + ldr r2, _0810F518 + ldr r0, _0810F51C + 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] +_0810F4D4: + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r6 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F502 + ldr r2, _0810F518 + ldr r0, _0810F51C + 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] +_0810F502: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0810F520 + str r0, [r5, 0x1C] +_0810F512: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810F518: .4byte 0x02020630 +_0810F51C: .4byte 0x020241e4 +_0810F520: .4byte sub_810F524 + 1 + thumb_func_end sub_810F46C + + thumb_func_start sub_810F524 +sub_810F524: @ 810F524 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810F57C + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F562 + adds r0, r5, 0 + bl sub_80A477C +_0810F562: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F57C + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_0810F57C: + ldr r0, _0810F588 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810F588: .4byte move_anim_8072740 + 1 + thumb_func_end sub_810F524 + + thumb_func_start sub_810F58C +sub_810F58C: @ 810F58C + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810F618 + ldr r5, _0810F5D8 + movs r1, 0x6 + ldrsh r0, [r5, r1] + movs r6, 0 + cmp r0, 0 + bne _0810F5A6 + movs r6, 0x1 +_0810F5A6: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810F5EE + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0810F5EE + ldr r0, _0810F5DC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810F5E0 + ldrh r0, [r5] + movs r1, 0x48 + subs r1, r0 + strh r1, [r4, 0x20] + ldrh r0, [r5, 0x2] + adds r0, 0x50 + strh r0, [r4, 0x22] + b _0810F610 + .align 2, 0 +_0810F5D8: .4byte 0x0203841e +_0810F5DC: .4byte 0x02038436 +_0810F5E0: + ldrh r0, [r5] + adds r0, 0xB0 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + adds r0, 0x28 + strh r0, [r4, 0x22] + b _0810F610 +_0810F5EE: + ldr r0, _0810F604 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810F608 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A69CC + b _0810F610 + .align 2, 0 +_0810F604: .4byte 0x0203841e +_0810F608: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A6980 +_0810F610: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810F62C +_0810F618: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _0810F62C + adds r0, r4, 0 + bl move_anim_8074EE0 +_0810F62C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810F58C + + thumb_func_start sub_810F634 +sub_810F634: @ 810F634 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0810F67C + 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 + beq _0810F684 + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldrh r0, [r5, 0x20] + subs r0, 0x28 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + adds r0, 0xA + strh r0, [r5, 0x22] + ldr r0, _0810F680 + b _0810F692 + .align 2, 0 +_0810F67C: .4byte 0x02038436 +_0810F680: .4byte 0x0000ffff +_0810F684: + ldrh r0, [r5, 0x20] + adds r0, 0x28 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + subs r0, 0xA + strh r0, [r5, 0x22] + movs r0, 0x1 +_0810F692: + strh r0, [r5, 0x30] + ldr r1, _0810F6A8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810F6AC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810F6A8: .4byte move_anim_8072740 + 1 +_0810F6AC: .4byte sub_80A67D8 + 1 + thumb_func_end sub_810F634 + + thumb_func_start sub_810F6B0 +sub_810F6B0: @ 810F6B0 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r6, _0810F734 + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + lsls r1, 15 + lsrs r4, r1, 16 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + asrs r1, 1 + negs r1, r1 + lsls r1, 16 + lsrs r7, r1, 16 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810F6F6 + lsls r0, r4, 16 + negs r0, r0 + lsrs r4, r0, 16 +_0810F6F6: + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r7 + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0810F722 + movs r0, 0x10 + strh r0, [r5, 0x22] +_0810F722: + ldr r1, _0810F738 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _0810F73C + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0810F734: .4byte 0x02038436 +_0810F738: .4byte sub_810F740 + 1 +_0810F73C: .4byte sub_80A67D8 + 1 + thumb_func_end sub_810F6B0 + + thumb_func_start sub_810F740 +sub_810F740: @ 810F740 + push {r4,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _0810F76C + str r0, [r4, 0x10] + movs r0, 0 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + ldr r0, _0810F770 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810F76C: .4byte 0x08596740 +_0810F770: .4byte sub_810F774 + 1 + thumb_func_end sub_810F740 + + thumb_func_start sub_810F774 +sub_810F774: @ 810F774 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810F786 + cmp r0, 0x1 + beq _0810F7B4 + b _0810F7CC +_0810F786: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810F7CC + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x12 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810F7CC +_0810F7B4: + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810F7CC + adds r0, r4, 0 + bl move_anim_8072740 +_0810F7CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810F774 + + thumb_func_start sub_810F7D4 +sub_810F7D4: @ 810F7D4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0810F804 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x8] + ldr r2, _0810F808 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _0810F80C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810F804: .4byte 0x03005e00 +_0810F808: .4byte 0x0859675c +_0810F80C: .4byte sub_810F810 + 1 + thumb_func_end sub_810F7D4 + + thumb_func_start sub_810F810 +sub_810F810: @ 810F810 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0810F838 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0810F830 + adds r0, r4, 0 + bl move_anim_task_del +_0810F830: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810F838: .4byte 0x03005e00 + thumb_func_end sub_810F810 + + thumb_func_start sub_810F83C +sub_810F83C: @ 810F83C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0810F888 + adds r4, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + strh r1, [r4, 0xC] + ldr r0, _0810F88C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x8 + cmp r0, 0 + beq _0810F870 + movs r1, 0x4 +_0810F870: + strh r1, [r4, 0xE] + ldrb r1, [r4, 0x8] + ldr r2, _0810F890 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _0810F894 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0810F888: .4byte 0x03005e00 +_0810F88C: .4byte 0x02038436 +_0810F890: .4byte 0x0859677c +_0810F894: .4byte sub_810F898 + 1 + thumb_func_end sub_810F83C + + thumb_func_start sub_810F898 +sub_810F898: @ 810F898 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0810F8B8 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810F8BC + cmp r0, 0x1 + beq _0810F8D8 + b _0810F936 + .align 2, 0 +_0810F8B8: .4byte 0x03005e00 +_0810F8BC: + adds r0, r4, 0 + bl sub_80A7D34 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0810F936 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _0810F936 +_0810F8D8: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810F900 + ldr r2, _0810F8FC + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x8 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _0810F936 + .align 2, 0 +_0810F8FC: .4byte 0x02020630 +_0810F900: + ldr r3, _0810F93C + movs r0, 0x8 + ldrsh r1, [r4, 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] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + ldrb r0, [r4, 0x8] + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_0810F936: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810F93C: .4byte 0x02020630 + thumb_func_end sub_810F898 + + thumb_func_start sub_810F940 +sub_810F940: @ 810F940 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0810F9C8 + adds r5, r1, r0 + movs r1, 0 + movs r0, 0x10 + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] + ldr r4, _0810F9CC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x24] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, r6 + bcs _0810F9AA + adds r1, r6, 0 +_0810F9AA: + strh r1, [r5, 0x20] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldr r0, _0810F9D0 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810F9C8: .4byte 0x03005e00 +_0810F9CC: .4byte 0x02038436 +_0810F9D0: .4byte sub_810F9D4 + 1 + thumb_func_end sub_810F940 + + thumb_func_start sub_810F9D4 +sub_810F9D4: @ 810F9D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0810F9F8 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0810FAD4 + cmp r1, 0x1 + bgt _0810F9FC + cmp r1, 0 + beq _0810FA0A + b _0810FB5A + .align 2, 0 +_0810F9F8: .4byte 0x03005e00 +_0810F9FC: + cmp r1, 0x2 + bne _0810FA02 + b _0810FB36 +_0810FA02: + cmp r1, 0x3 + bne _0810FA08 + b _0810FB44 +_0810FA08: + b _0810FB5A +_0810FA0A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bgt _0810FA1A + b _0810FB5A +_0810FA1A: + strh r1, [r4, 0xA] + ldr r0, _0810FA58 + movs r2, 0x22 + ldrsh r1, [r4, r2] + movs r3, 0x24 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xC + ldrsh r1, [r4, r0] + adds r1, 0x8 + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x8 + adds r0, r1 + strh r2, [r0] + cmp r2, 0x40 + beq _0810FABE + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0810FA78 + cmp r0, 0x1 + bgt _0810FA5C + cmp r0, 0 + beq _0810FA66 + b _0810FABE + .align 2, 0 +_0810FA58: .4byte 0x08596794 +_0810FA5C: + cmp r0, 0x2 + beq _0810FA90 + cmp r0, 0x3 + beq _0810FAA8 + b _0810FABE +_0810FA66: + ldr r0, _0810FA74 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x20] + b _0810FAB6 + .align 2, 0 +_0810FA74: .4byte 0x02020630 +_0810FA78: + ldr r0, _0810FA8C + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x20] + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x20] + b _0810FABC + .align 2, 0 +_0810FA8C: .4byte 0x02020630 +_0810FA90: + ldr r1, _0810FAA4 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r4, 0x20] + strh r1, [r0, 0x24] + ldrh r1, [r4, 0x20] + strh r1, [r0, 0x26] + b _0810FABE + .align 2, 0 +_0810FAA4: .4byte 0x02020630 +_0810FAA8: + ldr r0, _0810FAD0 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x20] + negs r0, r0 +_0810FAB6: + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x20] + negs r0, r0 +_0810FABC: + strh r0, [r1, 0x26] +_0810FABE: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0810FB5A + b _0810FB36 + .align 2, 0 +_0810FAD0: .4byte 0x02020630 +_0810FAD4: + ldrh r0, [r4, 0xA] + ands r1, r0 + cmp r1, 0 + beq _0810FAE4 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _0810FAEA +_0810FAE4: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] +_0810FAEA: + ldrh r1, [r4, 0x10] + lsls r1, 8 + ldrh r0, [r4, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + bne _0810FB5A + movs r5, 0x8 + adds r6, r4, 0 + adds r6, 0x8 +_0810FB10: + lsls r0, r5, 1 + adds r1, r6, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x40 + beq _0810FB2C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0810FB40 + adds r0, r1 + bl obj_delete_and_free_tiles +_0810FB2C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xC + bls _0810FB10 +_0810FB36: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810FB5A + .align 2, 0 +_0810FB40: .4byte 0x02020630 +_0810FB44: + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl move_anim_task_del +_0810FB5A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810F9D4 + + thumb_func_start sub_810FB60 +sub_810FB60: @ 810FB60 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + subs r0, 0xA + cmp r1, r0 + ble _0810FB8A + ldrh r0, [r4, 0x30] + movs r1, 0x1 + ands r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0810FB8A: + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0810FB9C + adds r0, r4, 0 + bl move_anim_8072740 +_0810FB9C: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810FB60 + + thumb_func_start sub_810FBA8 +sub_810FBA8: @ 810FBA8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0810FBE4 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810FBD4 + ldr r4, _0810FBE8 + 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] +_0810FBD4: + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x2E] + ldr r0, _0810FBEC + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810FBE4: .4byte 0x0203841e +_0810FBE8: .4byte 0x02038436 +_0810FBEC: .4byte sub_810FB60 + 1 + thumb_func_end sub_810FBA8 + + thumb_func_start sub_810FBF0 +sub_810FBF0: @ 810FBF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0810FC4C + adds r5, r1, r0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810FC94 + ldr r0, _0810FC50 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0810FC60 + ldr r0, _0810FC54 + strh r0, [r5, 0x1C] + ldr r4, _0810FC58 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, _0810FC5C + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + b _0810FD1E + .align 2, 0 +_0810FC4C: .4byte 0x03005e00 +_0810FC50: .4byte 0x0203841e +_0810FC54: .4byte 0x0000fff6 +_0810FC58: .4byte 0x02038437 +_0810FC5C: .4byte 0x02038436 +_0810FC60: + movs r0, 0xA + strh r0, [r5, 0x1C] + ldr r4, _0810FC8C + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, _0810FC90 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + b _0810FD12 + .align 2, 0 +_0810FC8C: .4byte 0x02038436 +_0810FC90: .4byte 0x02038437 +_0810FC94: + ldr r0, _0810FCD8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0810FCE8 + ldr r0, _0810FCDC + strh r0, [r5, 0x1C] + ldr r4, _0810FCE0 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, _0810FCE4 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + b _0810FD1E + .align 2, 0 +_0810FCD8: .4byte 0x0203841e +_0810FCDC: .4byte 0x0000fff6 +_0810FCE0: .4byte 0x02038437 +_0810FCE4: .4byte 0x02038436 +_0810FCE8: + movs r0, 0xA + strh r0, [r5, 0x1C] + ldr r4, _0810FD30 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, _0810FD34 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 +_0810FD12: + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + subs r0, 0x8 +_0810FD1E: + strh r0, [r5, 0x24] + movs r0, 0x6 + strh r0, [r5, 0xA] + ldr r0, _0810FD38 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0810FD30: .4byte 0x02038436 +_0810FD34: .4byte 0x02038437 +_0810FD38: .4byte sub_810FD3C + 1 + thumb_func_end sub_810FBF0 + + thumb_func_start sub_810FD3C +sub_810FD3C: @ 810FD3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810FD5C + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0810FD60 + cmp r1, 0x1 + beq _0810FDD4 + b _0810FDE8 + .align 2, 0 +_0810FD5C: .4byte 0x03005e00 +_0810FD60: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _0810FDE8 + strh r1, [r5, 0xA] + ldr r0, _0810FDCC + movs r2, 0x1E + ldrsh r1, [r5, r2] + movs r3, 0x20 + ldrsh r2, [r5, r3] + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0810FDB4 + ldr r0, _0810FDD0 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + movs r0, 0x10 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x22] + strh r0, [r4, 0x32] + ldrh r0, [r5, 0x24] + strh r0, [r4, 0x36] + ldrh r0, [r5, 0x1C] + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldrb r0, [r5, 0xC] + movs r1, 0x3 + ands r1, r0 + adds r0, r4, 0 + bl sub_8008258 +_0810FDB4: + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0810FDE8 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810FDE8 + .align 2, 0 +_0810FDCC: .4byte 0x08596864 +_0810FDD0: .4byte 0x02020630 +_0810FDD4: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _0810FDE8 + adds r0, r2, 0 + bl move_anim_task_del +_0810FDE8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810FD3C + + thumb_func_start sub_810FDF0 +sub_810FDF0: @ 810FDF0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810FE0E + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0810FE0E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810FDF0 + + thumb_func_start sub_810FE14 +sub_810FE14: @ 810FE14 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0810FE4C + adds r4, r1, r0 + ldr r0, _0810FE50 + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r1, 0 + subs r0, 0x20 + strh r0, [r4, 0x24] + ldr r0, _0810FE54 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + beq _0810FE6A + cmp r0, 0x1 + bgt _0810FE58 + cmp r0, 0 + beq _0810FE5E + b _0810FE86 + .align 2, 0 +_0810FE4C: .4byte 0x03005e00 +_0810FE50: .4byte 0x02038437 +_0810FE54: .4byte 0x0203841e +_0810FE58: + cmp r0, 0x2 + beq _0810FE76 + b _0810FE86 +_0810FE5E: + movs r0, 0x2 + strh r0, [r4, 0x1E] + movs r0, 0x5 + strh r0, [r4, 0x20] + movs r0, 0x40 + b _0810FE7E +_0810FE6A: + movs r0, 0x2 + strh r0, [r4, 0x1E] + movs r0, 0x5 + strh r0, [r4, 0x20] + movs r0, 0xC0 + b _0810FE7E +_0810FE76: + movs r0, 0x4 + strh r0, [r4, 0x1E] + strh r0, [r4, 0x20] + movs r0, 0 +_0810FE7E: + strh r0, [r4, 0x22] + adds r0, r1, 0 + adds r0, 0x20 + strh r0, [r4, 0x26] +_0810FE86: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0810FE92 + movs r0, 0 + strh r0, [r4, 0x24] +_0810FE92: + ldr r0, _0810FEAC + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810FEB8 + ldr r0, _0810FEB0 + ldrh r0, [r0] + strh r0, [r4, 0x1C] + ldr r0, _0810FEB4 + b _0810FEC0 + .align 2, 0 +_0810FEAC: .4byte 0x02038437 +_0810FEB0: .4byte 0x02022e18 +_0810FEB4: .4byte 0x04000014 +_0810FEB8: + ldr r0, _0810FF20 + ldrh r0, [r0] + strh r0, [r4, 0x1C] + ldr r0, _0810FF24 +_0810FEC0: + str r0, [sp] + ldrh r1, [r4, 0x24] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0x24 + ldrsh r0, [r4, r2] + adds r0, 0x40 + cmp r1, r0 + bgt _0810FEFA + ldr r5, _0810FF28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0810FEDA: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x1C] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x1C] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0x24 + ldrsh r0, [r4, r2] + adds r0, 0x40 + cmp r1, r0 + ble _0810FEDA +_0810FEFA: + ldr r0, _0810FF2C + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, _0810FF30 + str r0, [r4] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0810FF20: .4byte 0x02022e1c +_0810FF24: .4byte 0x04000018 +_0810FF28: .4byte 0x02038c28 +_0810FF2C: .4byte 0xa2600001 +_0810FF30: .4byte sub_810FF34 + 1 + thumb_func_end sub_810FE14 + + thumb_func_start sub_810FF34 +sub_810FF34: @ 810FF34 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0810FF5C + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0811000E + cmp r0, 0x1 + bgt _0810FF60 + cmp r0, 0 + beq _0810FF66 + b _08110026 + .align 2, 0 +_0810FF5C: .4byte 0x03005e00 +_0810FF60: + cmp r0, 0x2 + beq _08110020 + b _08110026 +_0810FF66: + ldrh r3, [r5, 0x22] + ldrh r4, [r5, 0x24] + movs r2, 0x24 + ldrsh r1, [r5, r2] + movs r2, 0x26 + ldrsh r0, [r5, r2] + cmp r1, r0 + bgt _0810FFFE + ldr r0, _0810FFB0 + mov r9, r0 + movs r7, 0x3 + ldr r1, _0810FFB4 + mov r12, r1 + movs r2, 0xF0 + lsls r2, 3 + add r2, r12 + mov r8, r2 +_0810FF88: + lsls r2, r3, 16 + asrs r0, r2, 15 + add r0, r9 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r3, 0x20 + ldrsh r1, [r5, r3] + asrs r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r3, r0, 16 + adds r6, r2, 0 + cmp r3, 0 + ble _0810FFB8 + ldrh r1, [r5, 0xA] + adds r0, r7, 0 + ands r0, r1 + adds r0, r3, r0 + b _0810FFC4 + .align 2, 0 +_0810FFB0: .4byte 0x08329f40 +_0810FFB4: .4byte 0x02038c28 +_0810FFB8: + cmp r3, 0 + bge _0810FFC8 + ldrh r1, [r5, 0xA] + adds r0, r7, 0 + ands r0, r1 + subs r0, r3, r0 +_0810FFC4: + lsls r0, 16 + lsrs r1, r0, 16 +_0810FFC8: + lsls r2, r4, 16 + asrs r2, 16 + lsls r3, r2, 1 + mov r0, r12 + adds r4, r3, r0 + ldrh r0, [r5, 0x1C] + lsls r1, 16 + asrs r1, 16 + adds r0, r1, r0 + strh r0, [r4] + add r3, r8 + ldrh r0, [r5, 0x1C] + adds r1, r0 + strh r1, [r3] + asrs r0, r6, 16 + ldrh r1, [r5, 0x1E] + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r2, 0x1 + lsls r2, 16 + lsrs r4, r2, 16 + asrs r2, 16 + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r2, r0 + ble _0810FF88 +_0810FFFE: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _08110026 + b _08110014 +_0811000E: + ldr r1, _0811001C + movs r0, 0x3 + strb r0, [r1, 0x15] +_08110014: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _08110026 + .align 2, 0 +_0811001C: .4byte 0x02039b28 +_08110020: + adds r0, r2, 0 + bl move_anim_task_del +_08110026: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_810FF34 + + thumb_func_start sub_8110034 +sub_8110034: @ 8110034 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08110068 + adds r7, r0, r1 + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r5, r0, 24 + mov r10, r5 + adds r6, r5, 0 + cmp r6, 0xFF + bne _0811006C + adds r0, r4, 0 + bl move_anim_task_del + b _08110116 + .align 2, 0 +_08110068: .4byte 0x03005e00 +_0811006C: + ldr r1, _08110090 + ldrb r0, [r1] + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r9, r1 + asrs r0, 16 + cmp r0, 0 + bge _08110094 + adds r0, r5, 0 + bl rotscale_free_entry + mov r0, r8 + bl move_anim_task_del + b _08110116 + .align 2, 0 +_08110090: .4byte 0x0203841e +_08110094: + ldr r2, _08110124 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r2, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, _08110128 + str r1, [r0] + adds r4, r2 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1F + ands r6, r0 + lsls r2, r6, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r1, r4, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + 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 oam_center + ldr r1, _0811012C + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x22] + mov r0, r10 + strh r0, [r7, 0x24] + mov r1, r9 + strh r1, [r7, 0x26] + ldr r0, _08110130 + str r0, [r7] +_08110116: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08110124: .4byte 0x02020630 +_08110128: .4byte nullsub_12 + 1 +_0811012C: .4byte 0x0203841e +_08110130: .4byte sub_8110134 + 1 + thumb_func_end sub_8110034 + + thumb_func_start sub_8110134 +sub_8110134: @ 8110134 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08110158 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _081101B8 + cmp r0, 0x1 + bgt _0811015C + cmp r0, 0 + beq _08110166 + b _08110238 + .align 2, 0 +_08110158: .4byte 0x03005e00 +_0811015C: + cmp r0, 0x2 + beq _08110208 + cmp r0, 0x3 + beq _08110228 + b _08110238 +_08110166: + ldrh r0, [r4, 0xA] + adds r0, 0x4 + strh r0, [r4, 0xA] + ldr r1, _081101B4 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 17 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + lsls r1, 24 + lsrs r1, 24 + bl sub_80A7EC0 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x30 + bne _08110238 + b _0811021A + .align 2, 0 +_081101B4: .4byte 0x08329f40 +_081101B8: + ldrh r0, [r4, 0xA] + subs r0, 0x4 + strh r0, [r4, 0xA] + ldr r1, _08110204 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 17 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + lsls r1, 24 + lsrs r1, 24 + bl sub_80A7EC0 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08110238 + b _0811021A + .align 2, 0 +_08110204: .4byte 0x08329f40 +_08110208: + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08110224 + adds r0, r1 + bl obj_delete_but_dont_free_vram +_0811021A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08110238 + .align 2, 0 +_08110224: .4byte 0x02020630 +_08110228: + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + bl rotscale_free_entry + adds r0, r5, 0 + bl move_anim_task_del +_08110238: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8110134 + + thumb_func_start sub_8110240 +sub_8110240: @ 8110240 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081102B8 + cmp r0, 0x1 + bgt _08110256 + cmp r0, 0 + beq _08110260 + b _08110360 +_08110256: + cmp r0, 0x2 + beq _081102EA + cmp r0, 0x3 + beq _0811034A + b _08110360 +_08110260: + ldr r4, _081102B4 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0811028E + ldrh r0, [r5, 0x22] + adds r0, 0xC + strh r0, [r5, 0x22] +_0811028E: + movs r0, 0x8 + strh r0, [r5, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r0, [r5, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + b _081102E2 + .align 2, 0 +_081102B4: .4byte 0x02038436 +_081102B8: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08110360 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCB + bl audio_play_and_stuff + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80082B8 +_081102E2: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08110360 +_081102EA: + ldrh r0, [r5, 0x32] + adds r1, r0, 0x1 + strh r1, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811032E + movs r0, 0 + strh r0, [r5, 0x32] + ldrh r1, [r5, 0x30] + subs r1, 0x1 + strh r1, [r5, 0x30] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0811032E + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0811032E: + movs r0, 0xE0 + lsls r0, 2 + adds r2, r0, 0 + ldrh r1, [r5, 0x34] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r5, 0x26] + subs r0, r1 + strh r0, [r5, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r5, 0x34] + b _08110360 +_0811034A: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl move_anim_8072740 +_08110360: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8110240 + + thumb_func_start sub_8110368 +sub_8110368: @ 8110368 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08110394 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8008258 + ldr r0, _08110390 + ldrh r1, [r0, 0x4] + negs r1, r1 + strh r1, [r0, 0x4] + ldrh r1, [r0] + negs r1, r1 + strh r1, [r0] + b _081103C4 + .align 2, 0 +_08110390: .4byte 0x0203841e +_08110394: + ldr r0, _08110428 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081103C4 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8008258 + ldr r1, _0811042C + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_081103C4: + ldr r5, _08110428 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + ldr r4, _0811042C + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + 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 r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x36] + ldr r0, _08110430 + str r0, [r6, 0x1C] + ldr r1, _08110434 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08110428: .4byte 0x02038437 +_0811042C: .4byte 0x0203841e +_08110430: .4byte sub_80A6EEC + 1 +_08110434: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8110368 + + thumb_func_start sub_8110438 +sub_8110438: @ 8110438 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0811045C + ldr r1, _08110458 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8008258 + b _08110478 + .align 2, 0 +_08110458: .4byte 0x0203841e +_0811045C: + ldr r0, _081104D4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08110478 + ldr r0, _081104D8 + ldrh r1, [r0, 0x2] + negs r1, r1 + strh r1, [r0, 0x2] + ldrh r1, [r0] + negs r1, r1 + strh r1, [r0] +_08110478: + ldr r5, _081104D4 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + ldr r4, _081104D8 + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x2E] + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x36] + ldr r0, _081104DC + str r0, [r6, 0x1C] + ldr r1, _081104E0 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081104D4: .4byte 0x02038437 +_081104D8: .4byte 0x0203841e +_081104DC: .4byte sub_80A6EEC + 1 +_081104E0: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8110438 + + thumb_func_start sub_81104E4 +sub_81104E4: @ 81104E4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08110500 + ldr r0, _08110540 + movs r2, 0x4 + ldrsh r1, [r0, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + strh r1, [r0, 0x4] +_08110500: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, _08110540 + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08110548 + ldr r4, _08110544 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + b _0811055A + .align 2, 0 +_08110540: .4byte 0x0203841e +_08110544: .4byte 0x02038437 +_08110548: + ldr r0, _08110570 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0811055A: + adds r0, r5, 0 + bl sub_80A6FD4 + ldr r0, _08110574 + ldrh r0, [r0, 0x6] + strh r0, [r5, 0x38] + ldr r0, _08110578 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08110570: .4byte 0x02038437 +_08110574: .4byte 0x0203841e +_08110578: .4byte sub_811057C + 1 + thumb_func_end sub_81104E4 + + thumb_func_start sub_811057C +sub_811057C: @ 811057C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08110592 + adds r0, r4, 0 + bl move_anim_8072740 + b _081105AE +_08110592: + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + adds r0, 0xD + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] +_081105AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811057C + + thumb_func_start sub_81105B4 +sub_81105B4: @ 81105B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081105E4 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldr r0, _081105E8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081105F0 + ldr r0, _081105EC + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _081105FC + .align 2, 0 +_081105E4: .4byte 0x02038437 +_081105E8: .4byte 0x02038436 +_081105EC: .4byte 0x0203841e +_081105F0: + ldr r1, _08110624 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, r1, 0 +_081105FC: + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, _08110628 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08110618 + ldrh r0, [r4, 0x22] + adds r0, 0x8 + strh r0, [r4, 0x22] +_08110618: + ldr r0, _0811062C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08110624: .4byte 0x0203841e +_08110628: .4byte 0x02038437 +_0811062C: .4byte sub_8110630 + 1 + thumb_func_end sub_81105B4 + + thumb_func_start sub_8110630 +sub_8110630: @ 8110630 + 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 + bne _08110664 + movs r0, 0 + strh r0, [r3, 0x2E] + 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] +_08110664: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _08110678 + adds r0, r3, 0 + bl move_anim_8072740 +_08110678: + pop {r0} + bx r0 + thumb_func_end sub_8110630 + + thumb_func_start sub_811067C +sub_811067C: @ 811067C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + movs r0, 0x10 + strh r0, [r4, 0x2E] + ldr r0, _081106A0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081106A0: .4byte sub_81106A4 + 1 + thumb_func_end sub_811067C + + thumb_func_start sub_81106A4 +sub_81106A4: @ 81106A4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x13 + bgt _081106B8 + adds r0, r1, 0x1 + strh r0, [r4, 0x32] + b _081106F6 +_081106B8: + ldrh r1, [r4, 0x30] + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081106F6 + ldrh r1, [r4, 0x2E] + subs r1, 0x1 + strh r1, [r4, 0x2E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081106F6 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _081106FC + str r0, [r4, 0x1C] +_081106F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081106FC: .4byte sub_8110700 + 1 + thumb_func_end sub_81106A4 + + thumb_func_start sub_8110700 +sub_8110700: @ 8110700 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8110700 + + thumb_func_start sub_8110720 +sub_8110720: @ 8110720 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08110740 + ldr r1, _0811073C + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + b _08110762 + .align 2, 0 +_0811073C: .4byte 0x0203841e +_08110740: + ldr r0, _0811083C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110762 + ldr r1, _08110840 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] +_08110762: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081107B2 + ldr r0, _0811083C + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, _08110844 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _081107B2 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + beq _081107A0 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081107B2 +_081107A0: + ldr r0, _08110840 + movs r2, 0x4 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x4] + movs r2, 0 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0] +_081107B2: + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, _08110844 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + ldr r6, _08110840 + lsrs r4, 24 + ldrh r0, [r6, 0x4] + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r6, 0x6] + adds r1, r2 + lsls r1, 16 + ldrh r2, [r7, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + subs r0, r2 + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r7, 0x22] + lsrs r5, r1, 16 + asrs r1, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldrh r0, [r6, 0x8] + strh r0, [r7, 0x2E] + strh r4, [r7, 0x32] + strh r5, [r7, 0x36] + ldr r0, _08110848 + str r0, [r7, 0x1C] + ldr r1, _0811084C + adds r0, r7, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811083C: .4byte 0x02038436 +_08110840: .4byte 0x0203841e +_08110844: .4byte 0x02038437 +_08110848: .4byte sub_80A6EEC + 1 +_0811084C: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8110720 + + thumb_func_start sub_8110850 +sub_8110850: @ 8110850 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _081108BC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110870 + ldr r1, _081108C0 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_08110870: + ldr r4, _081108C0 + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, _081108C4 + 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, _081108C8 + str r0, [r6, 0x1C] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081108BC: .4byte 0x02038436 +_081108C0: .4byte 0x0203841e +_081108C4: .4byte 0x02038437 +_081108C8: .4byte sub_81108CC + 1 + thumb_func_end sub_8110850 + + thumb_func_start sub_81108CC +sub_81108CC: @ 81108CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081108F8 + adds r0, r4, 0 + bl move_anim_8072740 + b _08110988 +_081108F8: + movs r0, 0x2E + adds r0, r4 + mov r8, r0 + ldrh r7, [r4, 0x20] + ldrh r5, [r4, 0x24] + ldrh r1, [r4, 0x22] + mov r12, r1 + ldrh r6, [r4, 0x26] + mov r2, r8 + add r1, sp, 0x4 + movs r3, 0x7 +_0811090E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0811090E + adds r0, r7, r5 + lsls r0, 16 + lsrs r5, r0, 16 + mov r2, r12 + adds r0, r2, r6 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _08110988 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + lsls r1, r5, 16 + asrs r1, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r1, r2 + lsls r2, r6, 16 + asrs r2, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + add r2, sp, 0x4 + mov r1, r8 + movs r3, 0x7 +_0811097A: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0811097A +_08110988: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81108CC + + thumb_func_start sub_8110994 +sub_8110994: @ 8110994 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _081109A8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081109B0 + ldr r4, _081109AC + b _081109B2 + .align 2, 0 +_081109A8: .4byte 0x0203841e +_081109AC: .4byte 0x02038436 +_081109B0: + ldr r4, _081109E4 +_081109B2: + 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 + adds r0, 0x12 + strh r0, [r5, 0x22] + ldr r1, _081109E8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _081109EC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081109E4: .4byte 0x02038437 +_081109E8: .4byte move_anim_8074EE0 + 1 +_081109EC: .4byte sub_80A67BC + 1 + thumb_func_end sub_8110994 + + thumb_func_start sub_81109F0 +sub_81109F0: @ 81109F0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _08110A5C + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _08110A10 + ldr r0, _08110A60 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 +_08110A10: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r4, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + adds r0, 0xE + strh r0, [r5, 0x22] + ldrb r1, [r6, 0x2] + adds r0, r5, 0 + bl obj_anim_image_start + adds r0, r5, 0 + bl obj_anim_step + strh r4, [r5, 0x2E] + strh r4, [r5, 0x30] + movs r0, 0x4 + strh r0, [r5, 0x32] + movs r0, 0x10 + strh r0, [r5, 0x34] + ldr r0, _08110A64 + strh r0, [r5, 0x36] + ldrh r0, [r6, 0x4] + strh r0, [r5, 0x38] + ldr r1, _08110A68 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r1, _08110A6C + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08110A5C: .4byte 0x0203841e +_08110A60: .4byte 0x02038437 +_08110A64: .4byte 0x0000ffba +_08110A68: .4byte sub_8110A70 + 1 +_08110A6C: .4byte sub_80A6450 + 1 + thumb_func_end sub_81109F0 + + thumb_func_start sub_8110A70 +sub_8110A70: @ 8110A70 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x38] + ldrh r2, [r4, 0x20] + adds r0, r1, r2 + strh r0, [r4, 0x20] + movs r0, 0xC0 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r0, 0x4 + strh r0, [r4, 0x32] + movs r0, 0x20 + strh r0, [r4, 0x34] + ldr r0, _08110AA8 + strh r0, [r4, 0x36] + ldr r1, _08110AAC + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, _08110AB0 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08110AA8: .4byte 0x0000ffe8 +_08110AAC: .4byte move_anim_8074EE0 + 1 +_08110AB0: .4byte sub_80A6450 + 1 + thumb_func_end sub_8110A70 + + thumb_func_start sub_8110AB4 +sub_8110AB4: @ 8110AB4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08110ADC + ldrb r1, [r4, 0xA] + bl obj_anim_image_start + adds r0, r5, 0 + bl obj_anim_step + ldr r0, _08110AE0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110AE4 + ldrh r0, [r5, 0x20] + ldrh r1, [r4] + subs r0, r1 + b _08110AEA + .align 2, 0 +_08110ADC: .4byte 0x0203841e +_08110AE0: .4byte 0x02038436 +_08110AE4: + ldrh r0, [r4] + ldrh r1, [r5, 0x20] + adds r0, r1 +_08110AEA: + strh r0, [r5, 0x20] + ldr r3, _08110B2C + ldrh r2, [r3, 0x2] + ldrh r0, [r5, 0x22] + adds r2, r0 + movs r4, 0 + strh r2, [r5, 0x22] + ldrh r0, [r3, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r1, [r3, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + strh r2, [r5, 0x34] + ldrh r0, [r3, 0x6] + adds r2, r0 + strh r2, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6E14 + strh r4, [r5, 0x34] + strh r4, [r5, 0x36] + ldr r0, _08110B30 + str r0, [r5, 0x1C] + ldr r1, _08110B34 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08110B2C: .4byte 0x0203841e +_08110B30: .4byte sub_80A656C + 1 +_08110B34: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_8110AB4 + + thumb_func_start sub_8110B38 +sub_8110B38: @ 8110B38 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08110B50 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08110B54 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + b _08110B5C + .align 2, 0 +_08110B50: .4byte 0x0203841e +_08110B54: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 +_08110B5C: + ldr r1, _08110B78 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x34] + ldr r0, _08110B7C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08110B78: .4byte 0x0203841e +_08110B7C: .4byte sub_8110B80 + 1 + thumb_func_end sub_8110B38 + + thumb_func_start sub_8110B80 +sub_8110B80: @ 8110B80 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + adds r0, r1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x38] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08110BC6 + adds r0, r4, 0 + bl move_anim_8072740 +_08110BC6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8110B80 + + thumb_func_start sub_8110BCC +sub_8110BCC: @ 8110BCC + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, _08110C88 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08110C10 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_08110C10: + ldr r0, _08110C8C + strh r5, [r0] + ldr r4, _08110C90 + strh r5, [r4] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x16 + bl lcd_io_set + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _08110C94 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r1, _08110C98 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, _08110C9C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r0, _08110CA0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08110C6E + ldr r0, _08110CA4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110C6E + movs r5, 0x1 +_08110C6E: + ldr r0, _08110CA8 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x8] + ldr r0, _08110CAC + str r0, [r1] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08110C88: .4byte 0x00003f42 +_08110C8C: .4byte 0x02022e18 +_08110C90: .4byte 0x02022e1a +_08110C94: .4byte 0x08d8d58c +_08110C98: .4byte 0x08d8d410 +_08110C9C: .4byte 0x08d8dab8 +_08110CA0: .4byte 0x0203841e +_08110CA4: .4byte 0x02038436 +_08110CA8: .4byte 0x03005e00 +_08110CAC: .4byte sub_8110CB0 + 1 + thumb_func_end sub_8110BCC + + thumb_func_start sub_8110CB0 +sub_8110CB0: @ 8110CB0 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08110CD8 + 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, 0 + bne _08110CE4 + ldr r1, _08110CDC + ldr r3, _08110CE0 + adds r0, r3, 0 + ldrh r3, [r1] + adds r0, r3 + b _08110CEA + .align 2, 0 +_08110CD8: .4byte 0x03005e00 +_08110CDC: .4byte 0x02022e18 +_08110CE0: .4byte 0x0000fffa +_08110CE4: + ldr r1, _08110D18 + ldrh r0, [r1] + adds r0, 0x6 +_08110CEA: + strh r0, [r1] + ldr r1, _08110D1C + ldr r3, _08110D20 + adds r0, r3, 0 + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r0, r2 + movs r3, 0x20 + ldrsh r0, [r0, r3] + adds r4, r1, 0 + cmp r0, 0x4 + bls _08110D0C + b _08110E3A +_08110D0C: + lsls r0, 2 + ldr r1, _08110D24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08110D18: .4byte 0x02022e18 +_08110D1C: .4byte 0x02022e1a +_08110D20: .4byte 0x0000ffff +_08110D24: .4byte _08110D28 + .align 2, 0 +_08110D28: + .4byte _08110D3C + .4byte _08110D7E + .4byte _08110D98 + .4byte _08110DDA + .4byte _08110DFC +_08110D3C: + adds r0, r4, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08110E3A + strh r5, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bne _08110E3A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _08110E3A +_08110D7E: + adds r0, r4, r5 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x65 + bne _08110E3A + movs r0, 0x7 + strh r0, [r1, 0x1E] + b _08110DF0 +_08110D98: + adds r0, r4, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08110E3A + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08110E3A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _08110E3A +_08110DDA: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + ldr r0, _08110DF8 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 +_08110DF0: + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _08110E3A + .align 2, 0 +_08110DF8: .4byte 0x03005e00 +_08110DFC: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08110E10 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08110E10: + ldr r0, _08110E44 + movs r1, 0 + strh r1, [r0] + ldr r0, _08110E48 + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r5, 0 + bl move_anim_task_del +_08110E3A: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08110E44: .4byte 0x02022e18 +_08110E48: .4byte 0x02022e1a + thumb_func_end sub_8110CB0 + + thumb_func_start sub_8110E4C +sub_8110E4C: @ 8110E4C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08110EC8 + ldr r4, _08110E90 + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08110E98 + ldr r0, _08110E94 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110E98 + movs r0, 0x98 + lsls r0, 1 + strh r0, [r5, 0x20] + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] + movs r0, 0x1 + strh r0, [r5, 0x38] + ldrb r1, [r5, 0x3] + subs r0, 0x40 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + b _08110E9C + .align 2, 0 +_08110E90: .4byte 0x0203841e +_08110E94: .4byte 0x02038436 +_08110E98: + ldr r0, _08110EBC + strh r0, [r5, 0x20] +_08110E9C: + ldr r4, _08110EC0 + ldrh r0, [r4] + strh r0, [r5, 0x22] + ldr r1, _08110EC4 + adds r0, r5, 0 + bl obj_set_f18_to_r0_f42_to_40 + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08110F24 + .align 2, 0 +_08110EBC: .4byte 0x0000ffc0 +_08110EC0: .4byte 0x0203841e +_08110EC4: .4byte 0x08596bc0 +_08110EC8: + ldrh r1, [r5, 0x30] + ldrh r3, [r5, 0x34] + adds r1, r3 + ldrh r2, [r5, 0x32] + ldrh r0, [r5, 0x36] + adds r2, r0 + lsls r0, r1, 16 + asrs r0, 24 + ldrh r3, [r5, 0x24] + adds r0, r3 + strh r0, [r5, 0x24] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r3, [r5, 0x26] + adds r0, r3 + strh r0, [r5, 0x26] + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x34] + ands r2, r0 + strh r2, [r5, 0x36] + movs r1, 0x38 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08110F0E + movs r2, 0x20 + ldrsh r0, [r5, r2] + movs r3, 0x24 + ldrsh r1, [r5, r3] + adds r0, r1 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + ble _08110F24 + b _08110F20 +_08110F0E: + movs r1, 0x20 + ldrsh r0, [r5, r1] + movs r2, 0x24 + ldrsh r1, [r5, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _08110F24 +_08110F20: + ldr r0, _08110F2C + str r0, [r5, 0x1C] +_08110F24: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08110F2C: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8110E4C + + thumb_func_start sub_8110F30 +sub_8110F30: @ 8110F30 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08110F68 + ldrb r1, [r5, 0x8] + bl obj_anim_image_start + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x32] + ldrh r0, [r5, 0x4] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x36] + ldr r0, _08110F6C + str r0, [r4, 0x1C] + ldr r1, _08110F70 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08110F68: .4byte 0x0203841e +_08110F6C: .4byte sub_80A6EEC + 1 +_08110F70: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8110F30 + + thumb_func_start sub_8110F74 +sub_8110F74: @ 8110F74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08110FF4 + adds r6, r1, r0 + ldr r5, _08110FF8 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r1, 0xC0 + lsls r1, 13 + adds r0, r1 + lsrs r7, r0, 16 + ldr r4, _08110FFC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r2, 0xC0 + lsls r2, 13 + adds r0, r2 + lsrs r0, 16 + mov r8, r0 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + ldrb r4, [r4] + cmp r0, r4 + bne _08110FE4 + mov r8, r7 +_08110FE4: + bl sub_811135C + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08111000 + movs r0, 0x20 + b _08111006 + .align 2, 0 +_08110FF4: .4byte 0x03005e00 +_08110FF8: .4byte 0x02038436 +_08110FFC: .4byte 0x02038437 +_08111000: + lsls r1, r5, 3 + movs r0, 0x30 + subs r0, r1 +_08111006: + strh r0, [r6, 0x18] + movs r4, 0 + strh r4, [r6, 0x8] + strh r4, [r6, 0x1E] + strh r4, [r6, 0x1A] + movs r0, 0x1 + strh r0, [r6, 0x20] + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0 + bge _0811101E + adds r0, 0x7 +_0811101E: + asrs r0, 3 + subs r0, 0x1 + strh r0, [r6, 0x1C] + mov r2, r9 + lsls r0, r2, 3 + strh r0, [r6, 0xC] + lsls r0, r7, 3 + strh r0, [r6, 0xE] + mov r1, r10 + subs r0, r1, r2 + lsls r0, 3 + movs r2, 0x18 + ldrsh r1, [r6, r2] + bl __divsi3 + strh r0, [r6, 0x10] + mov r1, r8 + subs r0, r1, r7 + lsls r0, 3 + movs r2, 0x18 + ldrsh r1, [r6, r2] + bl __divsi3 + strh r0, [r6, 0x12] + strh r4, [r6, 0x14] + strh r4, [r6, 0x16] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 8 + lsrs r4, 16 + movs r0, 0x3F + bl sub_80A5178 + lsls r0, 24 + strh r4, [r6, 0x22] + asrs r0, 24 + lsls r4, 16 + asrs r4, 16 + subs r0, r4 + movs r2, 0x18 + ldrsh r1, [r6, r2] + bl __divsi3 + strh r0, [r6, 0x24] + strh r5, [r6, 0xA] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + ldr r0, _081110A0 + str r0, [r6] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081110A0: .4byte sub_81110A4 + 1 + thumb_func_end sub_8110F74 + + thumb_func_start sub_81110A4 +sub_81110A4: @ 81110A4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _081110C8 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _081110BE + b _0811120C +_081110BE: + lsls r0, 2 + ldr r1, _081110CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081110C8: .4byte 0x03005e00 +_081110CC: .4byte _081110D0 + .align 2, 0 +_081110D0: + .4byte _081110E4 + .4byte _08111148 + .4byte _08111150 + .4byte _081111AC + .4byte _081111FE +_081110E4: + ldrh r2, [r4, 0x14] + ldrh r0, [r4, 0x10] + subs r2, r0 + strh r2, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + ldr r3, _08111144 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + lsls r2, 16 + asrs r2, 19 + strh r2, [r0, 0x24] + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 19 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08111134 + movs r0, 0x14 + strh r0, [r4, 0x1E] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08111134: + ldrh r1, [r4, 0x22] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xA2 + bl audio_play_and_stuff + b _0811120C + .align 2, 0 +_08111144: .4byte 0x02020630 +_08111148: + ldrh r0, [r4, 0x1E] + subs r0, 0x1 + strh r0, [r4, 0x1E] + b _081111F0 +_08111150: + ldrh r0, [r4, 0x1A] + subs r0, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _08111170 + ldrh r0, [r4, 0x10] + ldrh r2, [r4, 0x14] + adds r0, r2 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + b _0811117A +_08111170: + strh r0, [r4, 0x14] + strh r0, [r4, 0x16] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0811117A: + ldr r2, _081111A8 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 19 + strh r0, [r1, 0x24] + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 19 + strh r0, [r1, 0x26] + b _0811120C + .align 2, 0 +_081111A8: .4byte 0x02020630 +_081111AC: + ldrh r0, [r4, 0x10] + ldrh r2, [r4, 0xC] + adds r0, r2 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1C + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _081111EA + movs r0, 0 + strh r0, [r4, 0x1A] + adds r0, r4, 0 + bl sub_8111214 + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x22] + adds r1, r0 + strh r1, [r4, 0x22] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xAF + bl audio_play_and_stuff +_081111EA: + ldrh r0, [r4, 0x18] + subs r0, 0x1 + strh r0, [r4, 0x18] +_081111F0: + lsls r0, 16 + cmp r0, 0 + bne _0811120C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0811120C +_081111FE: + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0811120C + adds r0, r2, 0 + bl move_anim_task_del +_0811120C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81110A4 + + thumb_func_start sub_8111214 +sub_8111214: @ 8111214 + push {r4-r7,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bhi _08111304 + lsls r0, 2 + ldr r1, _08111230 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08111230: .4byte _08111234 + .align 2, 0 +_08111234: + .4byte _08111248 + .4byte _08111254 + .4byte _08111254 + .4byte _08111260 + .4byte _0811126C +_08111248: + ldr r3, _08111250 + movs r5, 0 + b _08111270 + .align 2, 0 +_08111250: .4byte 0x08596c28 +_08111254: + ldr r3, _0811125C + movs r5, 0x50 + b _08111270 + .align 2, 0 +_0811125C: .4byte 0x08596c40 +_08111260: + ldr r3, _08111268 + movs r5, 0x40 + b _08111270 + .align 2, 0 +_08111268: .4byte 0x08596c40 +_0811126C: + ldr r3, _0811130C + movs r5, 0x30 +_08111270: + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 19 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r4, 0xE] + lsls r2, 16 + asrs r2, 19 + lsls r2, 16 + movs r6, 0x20 + ldrsh r0, [r4, r6] + lsls r0, 2 + adds r1, r0 + lsls r1, 16 + lsrs r6, r1, 16 + asrs r1, 16 + lsrs r7, r2, 16 + asrs r2, 16 + adds r0, r3, 0 + movs r3, 0x23 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _081112FC + ldr r1, _08111310 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x12 + strh r1, [r0, 0x2E] + movs r2, 0x20 + ldrsh r1, [r4, r2] + lsls r2, r1, 2 + adds r2, r1 + lsls r2, 2 + adds r2, r6, r2 + movs r6, 0xA + ldrsh r3, [r4, r6] + lsls r1, r3, 1 + adds r1, r3 + adds r2, r1 + strh r2, [r0, 0x32] + strh r7, [r0, 0x36] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r2, 1 + movs r3, 0x10 + negs r3, r3 + adds r1, r3, 0 + subs r1, r2 + strh r1, [r0, 0x38] + ldrh r3, [r0, 0x4] + lsls r2, r3, 22 + lsrs r2, 22 + adds r2, r5 + ldr r5, _08111314 + adds r1, r5, 0 + ands r2, r1 + ldr r1, _08111318 + ands r1, r3 + orrs r1, r2 + strh r1, [r0, 0x4] + bl sub_80A68D4 + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] +_081112FC: + movs r6, 0x20 + ldrsh r0, [r4, r6] + negs r0, r0 + strh r0, [r4, 0x20] +_08111304: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811130C: .4byte 0x08596c40 +_08111310: .4byte 0x02020630 +_08111314: .4byte 0x000003ff +_08111318: .4byte 0xfffffc00 + thumb_func_end sub_8111214 + + thumb_func_start sub_811131C +sub_811131C: @ 811131C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0811134E + ldr r0, _08111354 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _08111348 + ldr r0, _08111358 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + subs r0, 0x1 + strh r0, [r1, 0x1E] +_08111348: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0811134E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08111354: .4byte sub_81110A4 + 1 +_08111358: .4byte 0x03005e00 + thumb_func_end sub_811131C + + thumb_func_start sub_811135C +sub_811135C: @ 811135C + push {lr} + ldr r0, _08111384 + ldr r0, [r0] + ldrb r1, [r0, 0x11] + lsrs r0, r1, 4 + lsls r1, 28 + lsrs r1, 28 + subs r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x4 + bls _0811137E + movs r1, 0x1 +_0811137E: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_08111384: .4byte 0x02038400 + thumb_func_end sub_811135C + + thumb_func_start sub_8111388 +sub_8111388: @ 8111388 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _081113C0 + ldrb r1, [r5, 0x8] + bl obj_anim_image_start + ldrh r0, [r5] + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + ldrh r1, [r5, 0x4] + subs r0, r1 + strh r0, [r4, 0x34] + movs r0, 0x3 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + ldr r0, _081113C4 + str r0, [r4, 0x1C] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081113C0: .4byte 0x0203841e +_081113C4: .4byte sub_81113C8 + 1 + thumb_func_end sub_8111388 + + thumb_func_start sub_81113C8 +sub_81113C8: @ 81113C8 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r3] + ldrh r1, [r2, 0x34] + movs r3, 0x34 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08111400 + ldrh r3, [r2, 0x32] + adds r0, r1, r3 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + adds r1, r0 + strh r1, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r1, 16 + cmp r1, 0 + ble _08111412 + movs r0, 0 + strh r0, [r2, 0x34] + b _08111412 +_08111400: + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _08111412 + adds r0, r2, 0 + bl move_anim_8072740 +_08111412: + pop {r0} + bx r0 + thumb_func_end sub_81113C8 + + thumb_func_start sub_8111418 +sub_8111418: @ 8111418 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08111440 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08111434 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_08111434: + adds r0, r4, 0 + bl sub_80A7820 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08111440: .4byte 0x02038436 + thumb_func_end sub_8111418 + + thumb_func_start sub_8111444 +sub_8111444: @ 8111444 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08111490 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08111494 + ldrh r3, [r2] + ldrh r5, [r4, 0x20] + adds r1, r3, r5 + strh r1, [r4, 0x20] + ldrh r1, [r2, 0x2] + adds r0, r1 + strh r0, [r4, 0x22] + strh r3, [r4, 0x30] + strh r1, [r4, 0x32] + ldrh r0, [r2, 0x4] + strh r0, [r4, 0x38] + ldrb r1, [r2, 0x6] + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _08111498 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08111490: .4byte 0x02038437 +_08111494: .4byte 0x0203841e +_08111498: .4byte sub_811149C + 1 + thumb_func_end sub_8111444 + + thumb_func_start sub_811149C +sub_811149C: @ 811149C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x8 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x28 + bl __divsi3 + ldrh r1, [r4, 0x24] + adds r1, r0 + strh r1, [r4, 0x24] + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + subs r1, r0 + strh r1, [r4, 0x26] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8C + ble _081114E6 + adds r0, r4, 0 + bl move_anim_8072740 +_081114E6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811149C + + thumb_func_start sub_81114EC +sub_81114EC: @ 81114EC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08111524 + ldr r0, [r2] + cmp r0, 0x20 + bgt _08111500 + ldr r1, _08111528 + movs r0, 0 + strh r0, [r1, 0xE] +_08111500: + ldr r2, [r2] + adds r0, r2, 0 + subs r0, 0x21 + cmp r0, 0x20 + bhi _08111510 + ldr r1, _08111528 + movs r0, 0x1 + strh r0, [r1, 0xE] +_08111510: + cmp r2, 0x41 + ble _0811151A + ldr r1, _08111528 + movs r0, 0x2 + strh r0, [r1, 0xE] +_0811151A: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08111524: .4byte 0x02038404 +_08111528: .4byte 0x0203841e + thumb_func_end sub_81114EC + + thumb_func_start sub_811152C +sub_811152C: @ 811152C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08111588 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0811154E + movs r0, 0 + bl sub_80A6DAC + movs r0, 0xC8 + strh r0, [r5, 0xA] +_0811154E: + ldr r4, _0811158C + movs r1, 0xA + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + ldrh r0, [r5, 0xA] + subs r0, 0x3 + strh r0, [r5, 0xA] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x78 + bne _0811157A + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r6, 0 + bl move_anim_task_del +_0811157A: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08111588: .4byte 0x03005e00 +_0811158C: .4byte 0x02022e22 + thumb_func_end sub_811152C + + thumb_func_start sub_8111590 +sub_8111590: @ 8111590 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _081115FC + 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 _081115BC + movs r0, 0 + bl sub_80A6DAC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, _08111600 + ldrh r0, [r0] + strh r0, [r4, 0xC] +_081115BC: + ldrh r0, [r4, 0xA] + adds r0, 0x50 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0xA] + ldr r6, _08111600 + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r0, 0x4 + bl cosine + ldrh r4, [r4, 0xC] + adds r0, r4 + strh r0, [r6] + ldr r0, _08111604 + movs r2, 0xE + ldrsh r1, [r0, r2] + ldr r0, _08111608 + cmp r1, r0 + bne _081115F4 + movs r0, 0 + strh r0, [r6] + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r5, 0 + bl move_anim_task_del +_081115F4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081115FC: .4byte 0x03005e00 +_08111600: .4byte 0x02022e22 +_08111604: .4byte 0x0203841e +_08111608: .4byte 0x00000fff + thumb_func_end sub_8111590 + + thumb_func_start sub_811160C +sub_811160C: @ 811160C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _08111668 + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r5, _0811166C + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_80A6FD4 + ldr r0, _08111670 + str r0, [r4, 0x1C] + movs r0, 0x10 + strh r0, [r4, 0x3A] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r4, 0x3A] + movs r0, 0x52 + bl lcd_io_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08111668: .4byte 0x0203841e +_0811166C: .4byte 0x02038437 +_08111670: .4byte sub_8111674 + 1 + thumb_func_end sub_811160C + + thumb_func_start sub_8111674 +sub_8111674: @ 8111674 + push {r4,lr} + adds r4, r0, 0 + bl sub_8111764 + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08111694 + ldr r0, _08111690 + str r0, [r4, 0x1C] + b _081116DE + .align 2, 0 +_08111690: .4byte sub_81116E8 + 1 +_08111694: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x38] + adds r0, r2, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x38] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _081116CC + cmp r2, 0xC4 + ble _081116DE +_081116CC: + lsls r0, 16 + cmp r0, 0 + ble _081116DE + ldr r0, _081116E4 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0xC4 + bl audio_play_and_stuff +_081116DE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081116E4: .4byte 0x02038440 + thumb_func_end sub_8111674 + + thumb_func_start sub_81116E8 +sub_81116E8: @ 81116E8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A6F3C + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x38] + adds r0, r2, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x38] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _0811172E + cmp r2, 0xC4 + ble _0811173A +_0811172E: + lsls r0, 16 + cmp r0, 0 + ble _0811173A + movs r0, 0xC4 + bl audio_play +_0811173A: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08111758 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08111754 + str r0, [r4, 0x1C] + b _0811175E + .align 2, 0 +_08111754: .4byte sub_80A67F4 + 1 +_08111758: + adds r0, r4, 0 + bl sub_8111764 +_0811175E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81116E8 + + thumb_func_start sub_8111764 +sub_8111764: @ 8111764 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x3A] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _08111788 + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + ldr r1, _08111784 + cmp r0, r1 + bne _081117EE + movs r0, 0 + b _081117EC + .align 2, 0 +_08111784: .4byte 0x010d0000 +_08111788: + ldrh r1, [r4, 0x3C] + adds r3, r1, 0x1 + strh r3, [r4, 0x3C] + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + bne _081117EE + ldr r1, _081117AC + ands r1, r3 + strh r1, [r4, 0x3C] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _081117B0 + adds r0, r2, 0x1 + b _081117B2 + .align 2, 0 +_081117AC: .4byte 0xffffff00 +_081117B0: + subs r0, r2, 0x1 +_081117B2: + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x3A] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081117D4 + cmp r0, 0x10 + bne _081117E0 +_081117D4: + ldrh r0, [r4, 0x3C] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + eors r0, r1 + strh r0, [r4, 0x3C] +_081117E0: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081117EE + movs r0, 0x80 + lsls r0, 1 +_081117EC: + strh r0, [r4, 0x3A] +_081117EE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8111764 + + thumb_func_start sub_81117F4 +sub_81117F4: @ 81117F4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r1, _08111810 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08111810: .4byte sub_8111814 + 1 + thumb_func_end sub_81117F4 + + thumb_func_start sub_8111814 +sub_8111814: @ 8111814 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + subs r0, 0x41 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x82 + bhi _08111848 + ldrb r0, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x8 + b _08111852 +_08111848: + ldrb r0, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 +_08111852: + orrs r1, r0 + strb r1, [r4, 0x5] + ldrh r0, [r4, 0x2E] + adds r0, 0x13 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x50 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3D + bne _08111884 + adds r0, r4, 0 + bl move_anim_8072740 +_08111884: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8111814 + + thumb_func_start sub_811188C +sub_811188C: @ 811188C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A7270 + adds r0, r4, 0 + movs r1, 0x80 + movs r2, 0x80 + movs r3, 0 + bl obj_id_set_rotscale + ldr r1, _08111904 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r1, _08111908 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x80 + strh r1, [r0, 0x8] + ldr r1, _0811190C + ldrh r1, [r1] + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r1, 0x10 + strh r1, [r0, 0xE] + ldr r1, _08111910 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08111904: .4byte 0x02020630 +_08111908: .4byte 0x03005e00 +_0811190C: .4byte 0x0203841e +_08111910: .4byte sub_8111914 + 1 + thumb_func_end sub_811188C + + thumb_func_start sub_8111914 +sub_8111914: @ 8111914 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08111964 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0811195C + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0xC] + adds r1, 0x1 + strh r1, [r4, 0xC] + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bne _0811195C + ldr r0, _08111968 + str r0, [r4] +_0811195C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08111964: .4byte 0x03005e00 +_08111968: .4byte sub_811196C + 1 + thumb_func_end sub_8111914 + + thumb_func_start sub_811196C +sub_811196C: @ 811196C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _08111990 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08111994 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + b _081119D8 + .align 2, 0 +_08111990: .4byte 0x03005e00 +_08111994: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r4, 0x8] + adds r0, 0x8 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + bgt _081119BC + movs r0, 0x8 + ldrsh r2, [r4, r0] + adds r0, r1, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + b _081119D8 +_081119BC: + adds r0, r1, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set +_081119D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811196C + + thumb_func_start sub_81119E0 +sub_81119E0: @ 81119E0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r5, [r4, 0x20] + ldrh r6, [r4, 0x22] + ldr r0, _08111A7C + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + mov r9, r1 + strh r0, [r4, 0x20] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + mov r1, r9 + strh r1, [r4, 0x2E] + ldr r2, _08111A80 + ldrh r1, [r2] + strh r1, [r4, 0x30] + ldrh r1, [r2, 0x2] + strh r1, [r4, 0x32] + ldrh r1, [r2, 0x4] + strh r1, [r4, 0x34] + ldrh r1, [r4, 0x20] + lsls r1, 4 + strh r1, [r4, 0x36] + lsls r0, 4 + strh r0, [r4, 0x38] + lsls r5, 16 + asrs r5, 16 + movs r1, 0x20 + ldrsh r0, [r4, r1] + subs r5, r0 + lsls r5, 4 + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r1, 1 + adds r0, r5, 0 + str r2, [sp] + bl __divsi3 + strh r0, [r4, 0x3A] + lsls r6, 16 + asrs r6, 16 + movs r1, 0x22 + ldrsh r0, [r4, r1] + subs r6, r0 + lsls r6, 4 + ldr r2, [sp] + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r1, 1 + adds r0, r6, 0 + bl __divsi3 + strh r0, [r4, 0x3C] + ldr r0, _08111A84 + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08111A7C: .4byte 0x02038436 +_08111A80: .4byte 0x0203841e +_08111A84: .4byte sub_8111A88 + 1 + thumb_func_end sub_81119E0 + + thumb_func_start sub_8111A88 +sub_8111A88: @ 8111A88 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08111AD2 + cmp r0, 0x1 + bgt _08111A9E + cmp r0, 0 + beq _08111AA8 + b _08111B96 +_08111A9E: + cmp r0, 0x2 + beq _08111B3C + cmp r0, 0x3 + beq _08111B90 + b _08111B96 +_08111AA8: + ldrh r0, [r5, 0x3A] + ldrh r2, [r5, 0x36] + adds r0, r2 + strh r0, [r5, 0x36] + ldrh r1, [r5, 0x3C] + ldrh r2, [r5, 0x38] + adds r1, r2 + strh r1, [r5, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r5, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r5, 0x22] + ldrh r0, [r5, 0x30] + subs r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + cmp r0, 0 + bgt _08111B96 + b _08111B82 +_08111AD2: + ldrh r0, [r5, 0x32] + subs r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + cmp r0, 0 + bgt _08111B96 + ldr r4, _08111B38 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x30] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x20] + lsls r0, 4 + strh r0, [r5, 0x36] + ldrh r0, [r5, 0x22] + lsls r0, 4 + strh r0, [r5, 0x38] + movs r1, 0x30 + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + subs r0, r1 + lsls r0, 4 + movs r2, 0x34 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0x3A] + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r2, 0x22 + ldrsh r1, [r5, r2] + subs r0, r1 + lsls r0, 4 + movs r2, 0x34 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0x3C] + b _08111B82 + .align 2, 0 +_08111B38: .4byte 0x02038437 +_08111B3C: + ldrh r0, [r5, 0x3A] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + ldrh r1, [r5, 0x3C] + ldrh r2, [r5, 0x38] + adds r1, r2 + strh r1, [r5, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r5, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r5, 0x22] + ldrh r0, [r5, 0x34] + subs r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + cmp r0, 0 + bgt _08111B96 + ldr r4, _08111B8C + 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] +_08111B82: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08111B96 + .align 2, 0 +_08111B8C: .4byte 0x02038437 +_08111B90: + adds r0, r5, 0 + bl move_anim_8074EE0 +_08111B96: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8111A88 + + thumb_func_start sub_8111B9C +sub_8111B9C: @ 8111B9C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, _08111BB0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08111BB0: .4byte sub_8111BB4 + 1 + thumb_func_end sub_8111B9C + + thumb_func_start sub_8111BB4 +sub_8111BB4: @ 8111BB4 + push {r4-r6,lr} + adds r3, r0, 0 + movs r5, 0 + movs r6, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08111C4A + adds r1, r3, 0 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x4 + ands r0, r2 + adds r4, r1, 0 + cmp r0, 0 + bne _08111BDE + movs r0, 0x4 + orrs r0, r2 + strb r0, [r4] +_08111BDE: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08111BEE + cmp r0, 0x1 + beq _08111BF8 + movs r6, 0x1 + b _08111C02 +_08111BEE: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + bne _08111C02 + b _08111C06 +_08111BF8: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x4 + bne _08111C02 + movs r5, 0x1 +_08111C02: + cmp r5, 0 + beq _08111C38 +_08111C06: + ldrb r2, [r4] + 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, [r4] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r3, 0x32] + strh r1, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08111C4A + strh r1, [r3, 0x32] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _08111C4A +_08111C38: + cmp r6, 0 + beq _08111C44 + adds r0, r3, 0 + bl move_anim_8072740 + b _08111C4A +_08111C44: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] +_08111C4A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8111BB4 + + thumb_func_start sub_8111C50 +sub_8111C50: @ 8111C50 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08111C7C + adds r5, r0, r1 + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + movs r6, 0 + movs r1, 0 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bge _08111C80 + adds r0, r4, 0 + bl move_anim_task_del + b _08111D5C + .align 2, 0 +_08111C7C: .4byte 0x03005e00 +_08111C80: + strh r1, [r5, 0xA] + movs r0, 0xF + strh r0, [r5, 0xC] + movs r0, 0x2 + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r5, 0xE] + lsls r1, 8 + ldrh r0, [r5, 0xC] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r4, _08111CE8 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x50 + strh r1, [r0, 0x2E] + ldr r0, _08111CEC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08111CF4 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08111CF0 + strh r1, [r0, 0x30] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x70 + b _08111D12 + .align 2, 0 +_08111CE8: .4byte 0x02020630 +_08111CEC: .4byte 0x02038437 +_08111CF0: .4byte 0x0000ff70 +_08111CF4: + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x90 + strh r1, [r0, 0x30] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08111D64 +_08111D12: + strh r1, [r0, 0x32] + ldr r4, _08111D68 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0 + strh r2, [r0, 0x34] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x36] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08111D6C + bl oamt_set_x3A_32 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, _08111D70 + str r1, [r0] + ldr r0, _08111D74 + str r0, [r5] +_08111D5C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08111D64: .4byte 0x0000ff90 +_08111D68: .4byte 0x02020630 +_08111D6C: .4byte nullsub_12 + 1 +_08111D70: .4byte sub_80A656C + 1 +_08111D74: .4byte sub_8111D78 + 1 + thumb_func_end sub_8111C50 + + thumb_func_start sub_8111D78 +sub_8111D78: @ 8111D78 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08111D9C + adds r4, r0, r1 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08111E1C + cmp r0, 0x1 + bgt _08111DA0 + cmp r0, 0 + beq _08111DA6 + b _08111E48 + .align 2, 0 +_08111D9C: .4byte 0x03005e00 +_08111DA0: + cmp r0, 0x2 + beq _08111E42 + b _08111E48 +_08111DA6: + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x3 + ands r0, r1 + strh r0, [r4, 0x12] + cmp r0, 0x1 + bne _08111DC4 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08111DC4 + subs r0, r1, 0x1 + strh r0, [r4, 0xC] +_08111DC4: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + bne _08111DDA + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _08111DDA + adds r0, r1, 0x1 + strh r0, [r4, 0xE] +_08111DDA: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0xC] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r1, [r4, 0xC] + movs r0, 0x80 + lsls r0, 13 + cmp r1, r0 + bne _08111E48 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x50 + ble _08111E48 + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08111E18 + adds r0, r1 + bl obj_delete_but_dont_free_vram + movs r0, 0x1 + strh r0, [r4, 0x10] + b _08111E48 + .align 2, 0 +_08111E18: .4byte 0x02020630 +_08111E1C: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08111E48 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + b _08111E48 +_08111E42: + adds r0, r2, 0 + bl move_anim_task_del +_08111E48: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8111D78 + + thumb_func_start sub_8111E50 +sub_8111E50: @ 8111E50 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, _08111E70 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x26] + ldr r2, _08111E74 + str r2, [r1] + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_08111E70: .4byte 0x03005e00 +_08111E74: .4byte sub_8111E78 + 1 + thumb_func_end sub_8111E50 + + thumb_func_start sub_8111E78 +sub_8111E78: @ 8111E78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08111EB0 + adds r5, r0, r1 + ldr r0, _08111EB4 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _08111EA4 + b _081120C6 +_08111EA4: + lsls r0, 2 + ldr r1, _08111EB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08111EB0: .4byte 0x03005e00 +_08111EB4: .4byte 0x02038437 +_08111EB8: .4byte _08111EBC + .align 2, 0 +_08111EBC: + .4byte _08111ED0 + .4byte _08111FD0 + .4byte _08112014 + .4byte _0811207C + .4byte _081120A8 +_08111ED0: + ldr r7, _08111F08 + adds r0, r7, 0 + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + mov r8, r2 + strh r0, [r5, 0x24] + cmp r0, 0xFF + beq _08111EFE + cmp r0, 0xF + beq _08111EFE + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bge _08111F0C + adds r0, r7, 0 + bl gpu_pal_free_tag +_08111EFE: + adds r0, r4, 0 + bl move_anim_task_del + b _081120CC + .align 2, 0 +_08111F08: .4byte 0x00002771 +_08111F0C: + ldr r4, _08111FB8 + movs r1, 0x8 + ldrsh r0, [r5, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r2, [r5, 0x24] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r2, 0x8 + ldrsh r0, [r5, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x8 + ldrsh r1, [r5, r0] + 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] + movs r1, 0x8 + ldrsh r0, [r5, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, _08111FBC + ldr r1, [r0] + ldr r0, _08111FC0 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 31 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + mov r2, r8 + strh r2, [r5, 0xA] + strh r2, [r5, 0xC] + movs r0, 0x10 + strh r0, [r5, 0xE] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r0, 0x22 + 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 r0, 4 + strh r0, [r5, 0x10] + cmp r6, 0x1 + bne _08111FC4 + movs r1, 0x80 + lsls r1, 2 + b _08111FC8 + .align 2, 0 +_08111FB8: .4byte 0x02020630 +_08111FBC: .4byte 0x020244d0 +_08111FC0: .4byte 0x02038437 +_08111FC4: + movs r1, 0x80 + lsls r1, 3 +_08111FC8: + movs r0, 0 + bl lcd_io_clear_bits + b _081120C6 +_08111FD0: + movs r1, 0x24 + ldrsh r0, [r5, r1] + adds r0, 0x10 + lsls r0, 4 + strh r0, [r5, 0x24] + movs r2, 0x10 + ldrsh r0, [r5, r2] + lsls r0, 1 + ldr r1, _08112004 + adds r0, r1 + movs r2, 0x24 + ldrsh r1, [r5, r2] + lsls r1, 1 + ldr r2, _08112008 + adds r1, r2 + ldr r2, _0811200C + bl CpuSet + ldrh r0, [r5, 0x10] + ldr r3, _08112010 + movs r1, 0x10 + movs r2, 0xA + bl pal_fade_1 + b _081120C6 + .align 2, 0 +_08112004: .4byte 0x02037714 +_08112008: .4byte 0x02037b14 +_0811200C: .4byte 0x04000008 +_08112010: .4byte 0x00003c0d +_08112014: + ldr r2, _08112050 + movs r0, 0x22 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + subs r1, 0x20 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r1, 0 + bge _08112034 + movs r2, 0 +_08112034: + cmp r6, 0x1 + bne _08112054 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, r2, 0 + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + str r2, [sp] + movs r2, 0x4 + str r2, [sp, 0x4] + str r6, [sp, 0x8] + b _0811206C + .align 2, 0 +_08112050: .4byte 0x02020630 +_08112054: + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, r2, 0 + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + str r2, [sp] + movs r2, 0x8 + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] +_0811206C: + movs r2, 0x2 + movs r3, 0x6 + bl sub_80BA384 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + b _081120C6 +_0811207C: + cmp r6, 0x1 + bne _08112090 + ldr r1, _0811208C + movs r0, 0x50 + bl lcd_io_set + b _08112098 + .align 2, 0 +_0811208C: .4byte 0x00003f42 +_08112090: + ldr r1, _081120A4 + movs r0, 0x50 + bl lcd_io_set +_08112098: + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + b _081120C6 + .align 2, 0 +_081120A4: .4byte 0x00003f44 +_081120A8: + cmp r6, 0x1 + bne _081120B8 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl lcd_io_set_bits + b _081120C2 +_081120B8: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_set_bits +_081120C2: + ldr r0, _081120D8 + str r0, [r5] +_081120C6: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] +_081120CC: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081120D8: .4byte sub_81120DC + 1 + thumb_func_end sub_8111E78 + + thumb_func_start sub_81120DC +sub_81120DC: @ 81120DC + 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, _08112164 + adds r4, r0, r1 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x1 + ands r0, r1 + strh r0, [r4, 0x12] + cmp r0, 0 + bne _08112114 + ldr r1, _08112168 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x12 + bl __divsi3 + strh r0, [r4, 0xC] +_08112114: + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bne _08112136 + ldr r1, _08112168 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x12 + bl __divsi3 + movs r1, 0x10 + subs r1, r0 + strh r1, [r4, 0xE] +_08112136: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0xC] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x80 + bne _0811215E + movs r0, 0 + strh r0, [r4, 0x26] + ldr r1, _0811216C + str r1, [r4] + adds r0, r5, 0 + bl _call_via_r1 +_0811215E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08112164: .4byte 0x03005e00 +_08112168: .4byte 0x08329f40 +_0811216C: .4byte sub_8112170 + 1 + thumb_func_end sub_81120DC + + thumb_func_start sub_8112170 +sub_8112170: @ 8112170 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081121A0 + adds r4, r0, r1 + ldr r0, _081121A4 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _081121DC + cmp r0, 0x1 + bgt _081121A8 + cmp r0, 0 + beq _081121AE + b _08112258 + .align 2, 0 +_081121A0: .4byte 0x03005e00 +_081121A4: .4byte 0x02038437 +_081121A8: + cmp r0, 0x2 + beq _081121F0 + b _08112258 +_081121AE: + ldr r1, _081121CC + movs r0, 0x3 + strb r0, [r1, 0x15] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + cmp r6, 0x1 + bne _081121D0 + movs r1, 0x80 + lsls r1, 2 + b _081121D4 + .align 2, 0 +_081121CC: .4byte 0x02039b28 +_081121D0: + movs r1, 0x80 + lsls r1, 3 +_081121D4: + movs r0, 0 + bl lcd_io_clear_bits + b _08112258 +_081121DC: + ldrh r0, [r4, 0x10] + ldr r3, _081121EC + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + b _08112258 + .align 2, 0 +_081121EC: .4byte 0x00003c0d +_081121F0: + ldr r3, _08112240 + movs r0, 0x24 + ldrsh r1, [r4, 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] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + bl obj_delete_but_dont_free_vram + ldr r0, _08112244 + bl gpu_pal_free_tag + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + cmp r6, 0x1 + bne _08112248 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl lcd_io_set_bits + b _08112252 + .align 2, 0 +_08112240: .4byte 0x02020630 +_08112244: .4byte 0x00002771 +_08112248: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_set_bits +_08112252: + adds r0, r5, 0 + bl move_anim_task_del +_08112258: + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8112170 + + thumb_func_start sub_8112264 +sub_8112264: @ 8112264 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldr r0, _081122A0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081122AC + ldr r4, _081122A4 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r2, 0xE0 + lsls r2, 13 + adds r0, r2 + lsrs r5, r0, 16 + ldr r4, _081122A8 + b _081122D0 + .align 2, 0 +_081122A0: .4byte 0x0203841e +_081122A4: .4byte 0x02038436 +_081122A8: .4byte 0x02038437 +_081122AC: + ldr r4, _08112374 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r2, 0xE0 + lsls r2, 13 + adds r0, r2 + lsrs r5, r0, 16 + ldr r4, _08112378 +_081122D0: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r1, 0xE0 + lsls r1, 13 + adds r0, r1 + lsrs r0, 16 + mov r9, r0 + mov r8, r5 + mov r2, r9 + subs r4, r2, r5 + lsls r4, 16 + lsrs r4, 16 + lsls r0, r6, 4 + strh r0, [r7, 0x2E] + lsls r0, r5, 4 + strh r0, [r7, 0x30] + mov r1, r10 + subs r0, r1, r6 + lsls r0, 4 + ldr r5, _0811237C + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r7, 0x32] + lsls r4, 16 + asrs r4, 12 + movs r0, 0x2 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl __divsi3 + strh r0, [r7, 0x34] + ldrh r0, [r5, 0x2] + strh r0, [r7, 0x36] + mov r1, r10 + strh r1, [r7, 0x38] + mov r2, r9 + strh r2, [r7, 0x3A] + movs r1, 0x36 + ldrsh r0, [r7, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r7, 0x3C] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r7, 0x5] + strh r6, [r7, 0x20] + mov r2, r8 + strh r2, [r7, 0x22] + ldr r0, _08112380 + str r0, [r7, 0x1C] + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08112374: .4byte 0x02038437 +_08112378: .4byte 0x02038436 +_0811237C: .4byte 0x0203841e +_08112380: .4byte sub_8112384 + 1 + thumb_func_end sub_8112264 + + thumb_func_start sub_8112384 +sub_8112384: @ 8112384 + push {r4,lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x36] + movs r1, 0x36 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _081123BC + ldrh r0, [r2, 0x32] + ldrh r4, [r2, 0x2E] + adds r0, r4 + strh r0, [r2, 0x2E] + ldrh r1, [r2, 0x34] + ldrh r4, [r2, 0x30] + adds r1, r4 + strh r1, [r2, 0x30] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r2, 0x22] + subs r0, r3, 0x1 + strh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _081123BC + strh r0, [r2, 0x2E] +_081123BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8112384 + + thumb_func_start sub_81123C4 +sub_81123C4: @ 81123C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08112514 + adds r1, r0 + str r1, [sp] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0 + ldr r1, [sp] + strh r0, [r1, 0x12] + strh r0, [r1, 0x14] + strh r0, [r1, 0x16] + strh r0, [r1, 0x18] + movs r0, 0x10 + strh r0, [r1, 0x1A] + ldr r2, _08112518 + ldrh r0, [r2] + strh r0, [r1, 0x1C] + ldr r4, _0811251C + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08112434 + b _08112530 +_08112434: + movs r4, 0 +_08112436: + lsls r1, r4, 16 + asrs r3, r1, 16 + ldr r0, _0811251C + ldrb r2, [r0] + str r1, [sp, 0x10] + cmp r3, r2 + beq _08112502 + movs r0, 0x2 + eors r2, r0 + cmp r3, r2 + beq _08112502 + lsls r0, r4, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08112502 + ldr r6, [sp, 0x4] + ldr r3, [sp, 0x8] + lsls r0, r3, 16 + asrs r7, r0, 16 + ldr r0, _08112520 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x37 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + beq _08112502 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80A861C + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r0, r8 + lsls r5, r0, 4 + add r5, r8 + lsls r5, 2 + ldr r1, _08112524 + adds r4, r5, r1 + lsls r0, r6, 4 + strh r0, [r4, 0x2E] + lsls r0, r7, 4 + strh r0, [r4, 0x30] + mov r2, r10 + subs r0, r2, r6 + lsls r0, 4 + ldr r3, _08112518 + movs r2, 0x2 + ldrsh r1, [r3, r2] + bl __divsi3 + strh r0, [r4, 0x32] + mov r3, r9 + lsls r0, r3, 16 + asrs r0, 16 + subs r0, r7 + lsls r0, 4 + ldr r2, _08112518 + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl __divsi3 + strh r0, [r4, 0x34] + ldr r1, _08112518 + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x36] + mov r2, r10 + strh r2, [r4, 0x38] + mov r3, r9 + strh r3, [r4, 0x3A] + ldr r0, _08112528 + adds r5, r0 + ldr r0, _0811252C + str r0, [r5] + ldr r2, [sp] + movs r3, 0x20 + ldrsh r1, [r2, r3] + adds r1, 0xD + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1 + mov r1, r8 + strh r1, [r0] + ldrh r0, [r2, 0x20] + adds r0, 0x1 + strh r0, [r2, 0x20] +_08112502: + ldr r2, [sp, 0x10] + movs r3, 0x80 + lsls r3, 9 + adds r0, r2, r3 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08112436 + b _081125B4 + .align 2, 0 +_08112514: .4byte 0x03005e00 +_08112518: .4byte 0x0203841e +_0811251C: .4byte 0x02038436 +_08112520: .4byte 0x08596db8 +_08112524: .4byte 0x02020630 +_08112528: .4byte 0x0202064c +_0811252C: .4byte sub_8112384 + 1 +_08112530: + ldr r0, _081125CC + ldr r7, [sp, 0x4] + ldr r2, [sp, 0x8] + lsls r1, r2, 16 + asrs r1, 16 + str r1, [sp, 0xC] + adds r1, r7, 0 + ldr r2, [sp, 0xC] + movs r3, 0x37 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + beq _081125B4 + movs r3, 0x30 + mov r10, r3 + movs r0, 0x28 + mov r9, r0 + ldr r6, _081125D0 + mov r1, r8 + lsls r5, r1, 4 + add r5, r8 + lsls r5, 2 + adds r4, r5, r6 + lsls r0, r7, 4 + strh r0, [r4, 0x2E] + ldr r2, [sp, 0xC] + lsls r0, r2, 4 + strh r0, [r4, 0x30] + subs r0, r3, r7 + lsls r0, 4 + ldr r3, _081125D4 + movs r2, 0x2 + ldrsh r1, [r3, r2] + bl __divsi3 + strh r0, [r4, 0x32] + mov r3, r9 + ldr r1, [sp, 0xC] + subs r0, r3, r1 + lsls r0, 4 + ldr r2, _081125D4 + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl __divsi3 + strh r0, [r4, 0x34] + ldr r1, _081125D4 + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x36] + mov r2, r10 + strh r2, [r4, 0x38] + mov r3, r9 + strh r3, [r4, 0x3A] + adds r6, 0x1C + adds r5, r6 + ldr r0, _081125D8 + str r0, [r5] + mov r1, r8 + ldr r0, [sp] + strh r1, [r0, 0x22] + movs r0, 0x1 + ldr r2, [sp] + strh r0, [r2, 0x20] +_081125B4: + ldr r0, _081125DC + ldr r3, [sp] + str r0, [r3] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081125CC: .4byte 0x08596db8 +_081125D0: .4byte 0x02020630 +_081125D4: .4byte 0x0203841e +_081125D8: .4byte sub_8112384 + 1 +_081125DC: .4byte sub_81125E0 + 1 + thumb_func_end sub_81123C4 + + thumb_func_start sub_81125E0 +sub_81125E0: @ 81125E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08112604 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _08112696 + cmp r1, 0x1 + bgt _08112608 + cmp r1, 0 + beq _08112616 + b _08112752 + .align 2, 0 +_08112604: .4byte 0x03005e00 +_08112608: + cmp r1, 0x2 + bne _0811260E + b _08112728 +_0811260E: + cmp r1, 0x3 + bne _08112614 + b _0811273C +_08112614: + b _08112752 +_08112616: + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0811267C + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811267C + strh r1, [r4, 0x12] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811264C + ldrh r1, [r4, 0x18] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _0811265A + adds r0, r1, 0x1 + strh r0, [r4, 0x18] + b _0811265A +_0811264C: + ldrh r1, [r4, 0x1A] + movs r2, 0x1A + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0811265A + subs r0, r1, 0x1 + strh r0, [r4, 0x1A] +_0811265A: + ldrh r1, [r4, 0x1A] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0x17 + ble _0811267C + movs r0, 0 + strh r0, [r4, 0x16] + movs r0, 0x1 + strh r0, [r4, 0x14] +_0811267C: + ldrh r1, [r4, 0x1C] + movs r2, 0x1C + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0811268C + subs r0, r1, 0x1 + strh r0, [r4, 0x1C] + b _08112752 +_0811268C: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08112752 + b _08112734 +_08112696: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08112752 + movs r0, 0 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + ands r0, r1 + lsls r0, 16 + cmp r0, 0 + beq _081126C6 + ldrh r1, [r4, 0x18] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081126D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x18] + b _081126D4 +_081126C6: + ldrh r1, [r4, 0x1A] + movs r2, 0x1A + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _081126D4 + adds r0, r1, 0x1 + strh r0, [r4, 0x1A] +_081126D4: + ldrh r1, [r4, 0x1A] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r1, [r4, 0x18] + movs r0, 0x80 + lsls r0, 13 + cmp r1, r0 + bne _08112752 + movs r5, 0 + b _08112718 +_081126F4: + adds r1, r5, 0 + adds r1, 0xD + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x8 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08112724 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_08112718: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r5, r0 + blt _081126F4 + b _08112734 + .align 2, 0 +_08112724: .4byte 0x02020630 +_08112728: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + cmp r0, 0 + ble _08112752 +_08112734: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08112752 +_0811273C: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl move_anim_task_del +_08112752: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81125E0 + + thumb_func_start sub_8112758 +sub_8112758: @ 8112758 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081127A4 + movs r1, 0 + strh r1, [r0] + ldr r0, _081127A8 + strh r1, [r0] + ldr r1, _081127AC + movs r0, 0x48 + bl lcd_io_set + ldr r1, _081127B0 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xC8 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x10 + bl lcd_io_set + ldr r0, _081127B4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081127A0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081127B8 +_081127A0: + movs r6, 0x28 + b _081127BA + .align 2, 0 +_081127A4: .4byte 0x02022e24 +_081127A8: .4byte 0x02022e26 +_081127AC: .4byte 0x00003f3f +_081127B0: .4byte 0x00003f1f +_081127B4: .4byte 0x02038436 +_081127B8: + movs r6, 0xC8 +_081127BA: + ldr r1, _081127F8 + lsls r3, r6, 16 + asrs r2, r3, 16 + lsls r0, r2, 8 + orrs r0, r2 + strh r0, [r1] + ldr r1, _081127FC + movs r5, 0x28 + ldr r0, _08112800 + strh r0, [r1] + lsrs r3, 16 + movs r1, 0xF0 + subs r1, r2 + movs r4, 0x48 + ldr r2, _08112804 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + strh r3, [r0, 0xA] + strh r1, [r0, 0xC] + strh r5, [r0, 0xE] + strh r4, [r0, 0x10] + strh r6, [r0, 0x12] + strh r5, [r0, 0x14] + ldr r1, _08112808 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081127F8: .4byte 0x02022e24 +_081127FC: .4byte 0x02022e26 +_08112800: .4byte 0x00002828 +_08112804: .4byte 0x03005e00 +_08112808: .4byte sub_811280C + 1 + thumb_func_end sub_8112758 + + thumb_func_start sub_811280C +sub_811280C: @ 811280C + 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 + ldr r2, _0811292C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0x8] + adds r0, r1, 0x1 + strh r0, [r4, 0x8] + ldrh r5, [r4, 0xA] + ldrh r7, [r4, 0xC] + ldrh r0, [r4, 0xE] + mov r10, r0 + ldrh r2, [r4, 0x10] + str r2, [sp, 0xC] + ldrh r0, [r4, 0x12] + ldrh r2, [r4, 0x14] + mov r8, r2 + lsls r1, 16 + asrs r6, r1, 16 + cmp r6, 0xF + ble _08112848 + b _08112938 +_08112848: + lsls r0, 16 + asrs r0, 16 + bl __floatsidf + str r0, [sp, 0x10] + str r1, [sp, 0x14] + lsls r0, r5, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, _08112930 + ldr r3, _08112934 + bl __muldf3 + adds r5, r1, 0 + adds r4, r0, 0 + adds r0, r6, 0 + bl __floatsidf + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + adds r1, r5, 0 + adds r0, r4, 0 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + bl __subdf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r0, r7, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, _08112930 + ldr r3, _08112934 + bl __muldf3 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + bl __adddf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + bl __floatsidf + adds r5, r1, 0 + adds r4, r0, 0 + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, _08112930 + ldr r3, _08112934 + bl __muldf3 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __subdf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, [sp, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, _08112930 + ldr r3, _08112934 + bl __muldf3 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __adddf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r5, r0, 16 + b _08112966 + .align 2, 0 +_0811292C: .4byte 0x03005e00 +_08112930: .4byte 0x3fb00000 +_08112934: .4byte 0x00000000 +_08112938: + movs r2, 0 + mov r9, r2 + movs r7, 0xF0 + movs r6, 0 + movs r5, 0x70 + str r6, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r3, 0 + bl sub_80A75AC + lsls r0, 16 + lsrs r0, 16 + str r6, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08112988 + str r0, [r4] +_08112966: + ldr r1, _0811298C + mov r2, r9 + lsls r0, r2, 8 + orrs r7, r0 + strh r7, [r1] + ldr r1, _08112990 + lsls r0, r6, 8 + orrs r5, r0 + strh r5, [r1] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08112988: .4byte sub_8112994 + 1 +_0811298C: .4byte 0x02022e24 +_08112990: .4byte 0x02022e26 + thumb_func_end sub_811280C + + thumb_func_start sub_8112994 +sub_8112994: @ 8112994 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081129E0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081129DA + ldr r0, _081129E4 + strh r1, [r0] + ldr r0, _081129E8 + strh r1, [r0] + ldr r4, _081129EC + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl move_anim_task_del +_081129DA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081129E0: .4byte 0x02037fd4 +_081129E4: .4byte 0x02022e24 +_081129E8: .4byte 0x02022e26 +_081129EC: .4byte 0x00003f3f + thumb_func_end sub_8112994 + + thumb_func_start sub_81129F0 +sub_81129F0: @ 81129F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _08112A1C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08112A24 + movs r2, 0x18 + ldr r3, _08112A20 + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r4, 0x3] + b _08112A28 + .align 2, 0 +_08112A1C: .4byte 0x02038436 +_08112A20: .4byte 0x0000fffe +_08112A24: + ldr r2, _08112A44 + movs r3, 0x2 +_08112A28: + lsls r0, r2, 16 + asrs r0, 16 + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r3, [r4, 0x30] + movs r0, 0x3C + strh r0, [r4, 0x2E] + ldr r0, _08112A48 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08112A44: .4byte 0x0000ffe8 +_08112A48: .4byte sub_8112A4C + 1 + thumb_func_end sub_81129F0 + + thumb_func_start sub_8112A4C +sub_8112A4C: @ 8112A4C + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x2E] + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _08112A5E + subs r0, r1, 0x1 + b _08112AC2 +_08112A5E: + ldrh r0, [r3, 0x30] + ldrh r4, [r3, 0x24] + adds r1, r0, r4 + strh r1, [r3, 0x24] + adds r0, r1, 0x7 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bls _08112AC4 + ldrh r0, [r3, 0x20] + adds r0, r1 + strh r0, [r3, 0x20] + movs r0, 0 + strh r0, [r3, 0x24] + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r4, _08112AB0 + adds r0, r4, 0 + ands r1, r0 + ldr r0, _08112AB4 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _08112AC0 + movs r0, 0x1E + strh r0, [r3, 0x2E] + ldr r0, _08112AB8 + str r0, [r3, 0x1C] + ldr r1, _08112ABC + adds r0, r3, 0 + bl oamt_set_x3A_32 + b _08112AC4 + .align 2, 0 +_08112AB0: .4byte 0x000003ff +_08112AB4: .4byte 0xfffffc00 +_08112AB8: .4byte sub_80A64B0 + 1 +_08112ABC: .4byte sub_8112ACC + 1 +_08112AC0: + movs r0, 0x28 +_08112AC2: + strh r0, [r3, 0x2E] +_08112AC4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8112A4C + + thumb_func_start sub_8112ACC +sub_8112ACC: @ 8112ACC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08112AF6 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x30] + strh r5, [r4, 0x32] + b _08112B3A +_08112AF6: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08112B06 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _08112B3A +_08112B06: + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x10 + subs r1, r0 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08112B3A + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08112B40 + str r0, [r4, 0x1C] +_08112B3A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08112B40: .4byte sub_8112B44 + 1 + thumb_func_end sub_8112ACC + + thumb_func_start sub_8112B44 +sub_8112B44: @ 8112B44 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + ldr r0, _08112B70 + movs r1, 0 + strh r1, [r0] + ldr r0, _08112B74 + strh r1, [r0] + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08112B70: .4byte 0x02022e24 +_08112B74: .4byte 0x02022e26 + thumb_func_end sub_8112B44 + + thumb_func_start sub_8112B78 +sub_8112B78: @ 8112B78 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r1, 0xC + bl sine + strh r0, [r5, 0x24] + ldr r0, _08112BE0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08112B9C + ldrh r0, [r5, 0x24] + negs r0, r0 + strh r0, [r5, 0x24] +_08112B9C: + ldrh r0, [r5, 0x2E] + adds r0, 0x6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08112BE8 + ldr r0, _08112BE4 + strh r0, [r5, 0x3A] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r5, 0x3A] + movs r0, 0x52 + bl lcd_io_set + b _08112C40 + .align 2, 0 +_08112BE0: .4byte 0x02038436 +_08112BE4: .4byte 0x0000050b +_08112BE8: + cmp r0, 0x1E + ble _08112C40 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r1, [r5, 0x3A] + lsls r0, r1, 16 + asrs r0, 24 + lsls r0, 16 + movs r6, 0xFF + ands r6, r1 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r7, r0, 16 + cmp r7, 0x10 + bls _08112C0C + movs r7, 0x10 +_08112C0C: + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r0, 0 + bge _08112C18 + movs r6, 0 +_08112C18: + lsls r4, r7, 8 + orrs r4, r6 + lsls r1, r4, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + strh r4, [r5, 0x3A] + cmp r7, 0x10 + bne _08112C40 + cmp r6, 0 + bne _08112C40 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08112C48 + str r0, [r5, 0x1C] +_08112C40: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08112C48: .4byte sub_8112C4C + 1 + thumb_func_end sub_8112B78 + + thumb_func_start sub_8112C4C +sub_8112C4C: @ 8112C4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8112C4C + + thumb_func_start sub_8112C6C +sub_8112C6C: @ 8112C6C + 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 r0, _08112D04 + adds r4, r0 + movs r6, 0 + strh r6, [r4, 0x8] + movs r0, 0x10 + mov r8, r0 + mov r0, r8 + strh r0, [r4, 0xA] + ldr r5, _08112D08 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1A] + ldrb r0, [r5] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + asrs r1, 1 + adds r1, 0x8 + strh r1, [r4, 0x1E] + strh r6, [r4, 0x16] + ldrb r0, [r5] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + ldrb r0, [r5] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x2 + strh r0, [r4, 0x14] + strh r6, [r4, 0xE] + mov r0, r8 + strh r0, [r4, 0x10] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + strh r6, [r4, 0x18] + ldr r0, _08112D0C + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08112D04: .4byte 0x03005e00 +_08112D08: .4byte 0x02038436 +_08112D0C: .4byte sub_8112D10 + 1 + thumb_func_end sub_8112C6C + + thumb_func_start sub_8112D10 +sub_8112D10: @ 8112D10 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _08112D34 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _08112D2A + b _08112E96 +_08112D2A: + lsls r0, 2 + ldr r1, _08112D38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08112D34: .4byte 0x03005e00 +_08112D38: .4byte _08112D3C + .align 2, 0 +_08112D3C: + .4byte _08112D54 + .4byte _08112DC4 + .4byte _08112E06 + .4byte _08112E1A + .4byte _08112E70 + .4byte _08112E80 +_08112D54: + movs r6, 0 +_08112D56: + movs r2, 0x1A + ldrsh r1, [r4, r2] + movs r0, 0x1C + ldrsh r2, [r4, r0] + ldrb r3, [r4, 0x14] + ldr r0, _08112DB8 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08112DAA + ldr r1, _08112DBC + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r1 + strh r7, [r5, 0x2E] + ldr r0, _08112DC0 + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _08112D8C + movs r1, 0x1 +_08112D8C: + strh r1, [r5, 0x30] + movs r0, 0x2A + muls r0, r6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r4, 0x1E] + strh r0, [r5, 0x34] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 1 + strh r0, [r5, 0x38] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_08112DAA: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _08112D56 + b _08112E78 + .align 2, 0 +_08112DB8: .4byte 0x08596e30 +_08112DBC: .4byte 0x02020630 +_08112DC0: .4byte 0x02038436 +_08112DC4: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08112DE2 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0xD + bgt _08112DF0 + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08112DF0 +_08112DE2: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0x4 + ble _08112DF0 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] +_08112DF0: + movs r1, 0xE + ldrsh r0, [r4, r1] + ldrh r2, [r4, 0xE] + ldrh r1, [r4, 0x10] + cmp r0, 0xE + bne _08112E60 + cmp r1, 0x4 + bne _08112E60 + movs r0, 0 + strh r0, [r4, 0xA] + b _08112E5A +_08112E06: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08112E96 + movs r0, 0 + strh r0, [r4, 0xA] + b _08112E78 +_08112E1A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08112E38 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08112E46 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08112E46 +_08112E38: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _08112E46 + adds r0, r1, 0x1 + strh r0, [r4, 0x10] +_08112E46: + movs r1, 0xE + ldrsh r0, [r4, r1] + ldrh r2, [r4, 0xE] + ldrh r1, [r4, 0x10] + cmp r0, 0 + bne _08112E60 + cmp r1, 0x10 + bne _08112E60 + movs r0, 0x1 + strh r0, [r4, 0x18] +_08112E5A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08112E60: + lsls r1, 8 + orrs r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + b _08112E96 +_08112E70: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08112E96 +_08112E78: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08112E96 +_08112E80: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r7, 0 + bl move_anim_task_del +_08112E96: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8112D10 + + thumb_func_start sub_8112E9C +sub_8112E9C: @ 8112E9C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08112EAE + ldrh r0, [r4, 0x32] + adds r0, 0x2 + b _08112EB2 +_08112EAE: + ldrh r0, [r4, 0x32] + subs r0, 0x2 +_08112EB2: + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x32] + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + subs r0, 0x41 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7E + bhi _08112EF4 + ldr r2, _08112EF0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x12] + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + b _08112F08 + .align 2, 0 +_08112EF0: .4byte 0x03005e00 +_08112EF4: + ldr r2, _08112F5C + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x3 + ldrb r1, [r0, 0x12] + ands r1, r2 +_08112F08: + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r0, 3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + movs r1, 0x7 + bl sine + strh r0, [r4, 0x26] + ldr r2, _08112F5C + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08112F56 + ldrh r0, [r1, 0x16] + subs r0, 0x1 + strh r0, [r1, 0x16] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08112F56: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08112F5C: .4byte 0x03005e00 + thumb_func_end sub_8112E9C + + thumb_func_start sub_8112F60 +sub_8112F60: @ 8112F60 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldr r2, _08112FA4 + ldr r1, _08112FA8 + ldrb r1, [r1] + adds r1, r2 + ldrb r1, [r1] + strh r1, [r0, 0x38] + movs r1, 0x80 + strh r1, [r0, 0x2E] + movs r1, 0xA + strh r1, [r0, 0x30] + ldr r2, _08112FAC + ldrh r1, [r2] + strh r1, [r0, 0x32] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x34] + ldr r1, _08112FB0 + str r1, [r0, 0x1C] + ldr r2, _08112FB4 + movs r3, 0x38 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + bx lr + .align 2, 0 +_08112FA4: .4byte 0x020241e4 +_08112FA8: .4byte 0x02038436 +_08112FAC: .4byte 0x0203841e +_08112FB0: .4byte sub_8112FB8 + 1 +_08112FB4: .4byte 0x02020630 + thumb_func_end sub_8112F60 + + thumb_func_start sub_8112FB8 +sub_8112FB8: @ 8112FB8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x34] + movs r1, 0x34 + ldrsh r3, [r5, r1] + cmp r3, 0 + beq _08113020 + subs r0, 0x1 + strh r0, [r5, 0x34] + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl sine + ldr r4, _08113018 + movs r1, 0x38 + ldrsh r2, [r5, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x24] + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl cosine + movs r1, 0x38 + ldrsh r2, [r5, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x26] + ldrh r0, [r5, 0x32] + ldrh r2, [r5, 0x2E] + adds r1, r0, r2 + strh r1, [r5, 0x2E] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08113054 + ldr r2, _0811301C + adds r0, r1, r2 + strh r0, [r5, 0x2E] + b _08113054 + .align 2, 0 +_08113018: .4byte 0x02020630 +_0811301C: .4byte 0xffffff00 +_08113020: + ldr r2, _0811305C + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x8 + strh r1, [r0, 0x22] + ldr r0, _08113060 + str r0, [r5, 0x1C] +_08113054: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811305C: .4byte 0x02020630 +_08113060: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_8112FB8 + + thumb_func_start sub_8113064 +sub_8113064: @ 8113064 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081130AC + 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 + beq _081130B4 + ldr r2, _081130B0 + ldrh r0, [r5, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r5, 0x20] + ldrh r0, [r2, 0x6] + negs r0, r0 + strh r0, [r2, 0x6] + ldrh r0, [r2, 0x8] + negs r0, r0 + strh r0, [r2, 0x8] + adds r1, r2, 0 + b _081130BE + .align 2, 0 +_081130AC: .4byte 0x02038436 +_081130B0: .4byte 0x0203841e +_081130B4: + ldr r1, _081130F4 + ldrh r0, [r1] + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] +_081130BE: + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x34] + ldrh r0, [r1, 0xA] + strh r0, [r5, 0x38] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, _081130F8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, _081130FC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081130F4: .4byte 0x0203841e +_081130F8: .4byte move_anim_8074EE0 + 1 +_081130FC: .4byte sub_80A66DC + 1 + thumb_func_end sub_8113064 + + thumb_func_start sub_8113100 +sub_8113100: @ 8113100 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80A6838 + ldr r4, _08113158 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, _0811315C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08113164 + ldr r2, _08113160 + ldrh r0, [r5, 0x20] + ldrh r1, [r2, 0x2] + subs r0, r1 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + adds r1, r0 + strh r1, [r5, 0x22] + ldrh r0, [r5, 0x32] + ldrh r1, [r2, 0x4] + subs r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r2, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + b _0811318E + .align 2, 0 +_08113158: .4byte 0x02038437 +_0811315C: .4byte 0x02038436 +_08113160: .4byte 0x0203841e +_08113164: + ldr r1, _081131A8 + ldrh r0, [r1] + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldrh r0, [r1, 0x4] + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start +_0811318E: + ldr r0, _081131A8 + ldrh r0, [r0, 0x8] + strh r0, [r5, 0x2E] + ldr r0, _081131AC + str r0, [r5, 0x1C] + ldr r1, _081131B0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081131A8: .4byte 0x0203841e +_081131AC: .4byte sub_80A6EEC + 1 +_081131B0: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_8113100 + + thumb_func_start sub_81131B4 +sub_81131B4: @ 81131B4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _081131C8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081131D0 + ldr r4, _081131CC + b _081131D2 + .align 2, 0 +_081131C8: .4byte 0x0203841e +_081131CC: .4byte 0x02038436 +_081131D0: + ldr r4, _08113214 +_081131D2: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, _08113218 + movs r0, 0x2 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x4] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldr r0, _0811321C + str r0, [r5, 0x1C] + ldr r1, _08113220 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08113214: .4byte 0x02038437 +_08113218: .4byte 0x0203841e +_0811321C: .4byte sub_80A67D8 + 1 +_08113220: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_81131B4 + + thumb_func_start sub_8113224 +sub_8113224: @ 8113224 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0811324C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0811323E + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_0811323E: + adds r0, r4, 0 + bl sub_8113100 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811324C: .4byte 0x02038436 + thumb_func_end sub_8113224 + + thumb_func_start sub_8113250 +sub_8113250: @ 8113250 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r4, _081132A4 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r6, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + strh r5, [r6, 0x36] + movs r0, 0x1 + strh r0, [r6, 0x38] + ldr r0, _081132A8 + ldrh r0, [r0] + strh r0, [r6, 0x3A] + ldr r4, _081132AC + ldrb r0, [r4] + movs r1, 0 + bl sub_80A861C + lsls r7, r0, 16 + lsrs r5, r7, 16 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A861C + lsls r1, r0, 16 + lsrs r0, r1, 16 + cmp r5, r0 + bls _081132B0 + lsrs r0, r7, 17 + b _081132B2 + .align 2, 0 +_081132A4: .4byte 0x02038436 +_081132A8: .4byte 0x0203841e +_081132AC: .4byte 0x0202420b +_081132B0: + lsrs r0, r1, 17 +_081132B2: + strh r0, [r6, 0x3C] + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r2, 0x3C + ldrsh r1, [r6, r2] + bl cosine + strh r0, [r6, 0x24] + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r2, 0x3C + ldrsh r1, [r6, r2] + bl sine + strh r0, [r6, 0x26] + ldr r0, _081132DC + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081132DC: .4byte sub_81132E0 + 1 + thumb_func_end sub_8113250 + + thumb_func_start sub_81132E0 +sub_81132E0: @ 81132E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _081132F2 + cmp r5, 0x1 + beq _0811335E + b _081133E2 +_081132F2: + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x38] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _08113344 + strh r5, [r4, 0x36] + ldrh r1, [r4, 0x38] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _08113344 + adds r0, r1, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _08113344 + movs r0, 0x10 + strh r0, [r4, 0x38] +_08113344: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _081133E2 + movs r0, 0 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081133E2 +_0811335E: + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x38] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x95 + bgt _08113386 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x95 + ble _08113386 + movs r0, 0x96 + strh r0, [r4, 0x3C] +_08113386: + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _081133CE + movs r0, 0 + strh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _081133CE + adds r0, r1, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _081133CE + movs r0, 0x10 + strh r0, [r4, 0x38] +_081133CE: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _081133E2 + adds r0, r4, 0 + bl move_anim_8072740 +_081133E2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81132E0 + + thumb_func_start sub_81133E8 +sub_81133E8: @ 81133E8 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08113414 + adds r4, r1, r0 + ldr r0, _08113418 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08113424 + ldr r0, _0811341C + str r0, [sp] + ldr r0, _08113420 + b _0811342A + .align 2, 0 +_08113414: .4byte 0x03005e00 +_08113418: .4byte 0x02038436 +_0811341C: .4byte 0x04000014 +_08113420: .4byte 0x02022e18 +_08113424: + ldr r0, _081134A0 + str r0, [sp] + ldr r0, _081134A4 +_0811342A: + ldrh r0, [r0] + strh r0, [r4, 0xC] + ldr r0, _081134A8 + str r0, [sp, 0x4] + mov r1, sp + movs r5, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r5, [r0, 0x9] + ldr r0, _081134AC + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r4, 0xE] + adds r0, 0x20 + strh r0, [r4, 0x10] + cmp r1, 0 + bge _0811345A + strh r5, [r4, 0xE] +_0811345A: + ldrh r3, [r4, 0xE] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bgt _08113488 + ldr r5, _081134B0 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0811346C: + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0xC] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + ble _0811346C +_08113488: + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, _081134B4 + str r0, [r4] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081134A0: .4byte 0x04000018 +_081134A4: .4byte 0x02022e1c +_081134A8: .4byte 0xa2600001 +_081134AC: .4byte 0x02038436 +_081134B0: .4byte 0x02038c28 +_081134B4: .4byte sub_81134B8 + 1 + thumb_func_end sub_81133E8 + + thumb_func_start sub_81134B8 +sub_81134B8: @ 81134B8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, _081134DC + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0x4 + bhi _0811356E + lsls r0, 2 + ldr r1, _081134E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081134DC: .4byte 0x03005e00 +_081134E0: .4byte _081134E4 + .align 2, 0 +_081134E4: + .4byte _081134F8 + .4byte _0811351A + .4byte _0811352A + .4byte _08113556 + .4byte _08113568 +_081134F8: + ldrh r0, [r2, 0x16] + adds r0, 0x1 + strh r0, [r2, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811354E + movs r0, 0 + strh r0, [r2, 0x16] + ldrh r0, [r2, 0x14] + adds r0, 0x1 + strh r0, [r2, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0811354E + b _08113548 +_0811351A: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _0811354E + b _08113548 +_0811352A: + ldrh r0, [r2, 0x16] + adds r0, 0x1 + strh r0, [r2, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811354E + movs r0, 0 + strh r0, [r2, 0x16] + ldrh r0, [r2, 0x14] + subs r0, 0x1 + strh r0, [r2, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _0811354E +_08113548: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0811354E: + adds r0, r2, 0 + bl sub_8113574 + b _0811356E +_08113556: + ldr r1, _08113564 + movs r0, 0x3 + strb r0, [r1, 0x15] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0811356E + .align 2, 0 +_08113564: .4byte 0x02039b28 +_08113568: + adds r0, r3, 0 + bl move_anim_task_del +_0811356E: + pop {r0} + bx r0 + thumb_func_end sub_81134B8 + + thumb_func_start sub_8113574 +sub_8113574: @ 8113574 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldrh r3, [r5, 0x12] + ldrh r4, [r5, 0xE] + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r4, r0 + bgt _081135CA + ldr r7, _081135E0 + mov r12, r7 + ldr r0, _081135E4 + mov r8, r0 + ldr r6, _081135E8 +_08113592: + lsls r2, r4, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r12 + lsls r0, r3, 1 + add r0, r8 + movs r7, 0 + ldrsh r1, [r0, r7] + movs r7, 0x14 + ldrsh r0, [r5, r7] + muls r0, r1 + asrs r0, 7 + ldrh r1, [r5, 0xC] + adds r0, r1 + strh r0, [r2] + adds r3, 0x8 + movs r0, 0xFF + ands r3, r0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r7, 0x10 + ldrsh r0, [r5, r7] + cmp r4, r0 + ble _08113592 +_081135CA: + ldrh r0, [r5, 0x12] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x12] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081135E0: .4byte 0x02038c28 +_081135E4: .4byte 0x08329f40 +_081135E8: .4byte 0x02039b28 + thumb_func_end sub_8113574 + + thumb_func_start sub_81135EC +sub_81135EC: @ 81135EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + ldr r5, _0811368C + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x5 + bl __divsi3 + adds r6, r0, 0 + ldr r1, _08113690 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + mov r2, r8 + ldrb r0, [r2] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r3, [r5, 0x8] + adds r0, r3 + strh r0, [r4, 0x22] + movs r1, 0x2 + ldrsh r0, [r5, r1] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl cosine + strh r0, [r4, 0x30] + movs r3, 0x2 + ldrsh r0, [r5, r3] + lsls r6, 16 + asrs r6, 16 + adds r1, r6, 0 + bl sine + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + ldrh r2, [r5] + adds r3, r2, 0 + muls r3, r1 + adds r1, r3, 0 + ldrh r3, [r4, 0x20] + adds r1, r3 + strh r1, [r4, 0x20] + adds r1, r2, 0 + muls r1, r0 + adds r0, r1, 0 + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x34] + ldr r0, _08113694 + str r0, [r4, 0x1C] + adds r4, 0x2E + ldr r2, _08113698 + movs r1, 0x6 +_08113674: + ldrh r0, [r4] + strh r0, [r2] + adds r4, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08113674 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811368C: .4byte 0x0203841e +_08113690: .4byte 0x02038436 +_08113694: .4byte sub_811369C + 1 +_08113698: .4byte 0x0203a100 + thumb_func_end sub_81135EC + + thumb_func_start sub_811369C +sub_811369C: @ 811369C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + adds r0, r1 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x38] + adds r0, r2 + strh r0, [r4, 0x38] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x24] + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x34 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _081136E0 + adds r0, r4, 0 + bl move_anim_8072740 +_081136E0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811369C + + thumb_func_start sub_81136E8 +sub_81136E8: @ 81136E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08113724 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08113728 + ldrh r1, [r1] + strh r1, [r0, 0x8] + ldr r1, _0811372C + ldrb r4, [r1] + movs r1, 0x10 + strh r1, [r0, 0xA] + movs r0, 0x52 + bl lcd_io_set + adds r0, r4, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08113734 + ldr r1, _08113730 + movs r0, 0x50 + bl lcd_io_set + b _0811373C + .align 2, 0 +_08113724: .4byte 0x03005e00 +_08113728: .4byte 0x0203841e +_0811372C: .4byte 0x02038436 +_08113730: .4byte 0x00003f42 +_08113734: + ldr r1, _08113750 + movs r0, 0x50 + bl lcd_io_set +_0811373C: + ldr r0, _08113754 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _08113758 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08113750: .4byte 0x00003f44 +_08113754: .4byte 0x03005e00 +_08113758: .4byte sub_811375C + 1 + thumb_func_end sub_81136E8 + + thumb_func_start sub_811375C +sub_811375C: @ 811375C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _081137C8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0xA] + lsrs r4, r0, 8 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r6, r2] + ldrb r2, [r6, 0x8] + cmp r0, r2 + bne _081137D8 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 8 + orrs r1, r0 + movs r5, 0 + strh r1, [r6, 0xA] + ldrh r1, [r6, 0xA] + movs r0, 0x52 + bl lcd_io_set + strh r5, [r6, 0xC] + cmp r4, 0x10 + bne _081137DE + ldr r2, _081137CC + ldr r1, _081137D0 + ldr r0, _081137D4 + ldrb r0, [r0] + 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] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + bl move_anim_task_del + b _081137DE + .align 2, 0 +_081137C8: .4byte 0x03005e00 +_081137CC: .4byte 0x02020630 +_081137D0: .4byte 0x020241e4 +_081137D4: .4byte 0x02038436 +_081137D8: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] +_081137DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_811375C + + thumb_func_start sub_81137E4 +sub_81137E4: @ 81137E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08113810 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldr r0, _08113814 + ldrh r0, [r0] + strh r0, [r2, 0x8] + movs r1, 0x80 + lsls r1, 5 + strh r1, [r2, 0xA] + ldr r0, _08113818 + str r0, [r2] + movs r0, 0x52 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08113810: .4byte 0x03005e00 +_08113814: .4byte 0x0203841e +_08113818: .4byte sub_811381C + 1 + thumb_func_end sub_81137E4 + + thumb_func_start sub_811381C +sub_811381C: @ 811381C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _08113878 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0xA] + lsrs r4, r0, 8 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r6, r2] + ldrb r2, [r6, 0x8] + cmp r0, r2 + bne _0811387C + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 8 + orrs r1, r0 + movs r5, 0 + strh r1, [r6, 0xA] + ldrh r1, [r6, 0xA] + movs r0, 0x52 + bl lcd_io_set + strh r5, [r6, 0xC] + cmp r4, 0 + bne _08113882 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r7, 0 + bl move_anim_task_del + b _08113882 + .align 2, 0 +_08113878: .4byte 0x03005e00 +_0811387C: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] +_08113882: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_811381C + + thumb_func_start sub_8113888 +sub_8113888: @ 8113888 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + ldr r0, _081138B4 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081138BC + ldr r1, _081138B8 + movs r0, 0x50 + bl lcd_io_set + b _081138C4 + .align 2, 0 +_081138B4: .4byte 0x02038436 +_081138B8: .4byte 0x00003f42 +_081138BC: + ldr r1, _081138D0 + movs r0, 0x50 + bl lcd_io_set +_081138C4: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081138D0: .4byte 0x00003f44 + thumb_func_end sub_8113888 + + thumb_func_start sub_81138D4 +sub_81138D4: @ 81138D4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _08113940 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x30] + ldr r5, _08113944 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + movs r0, 0x7E + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A6E14 + ldrh r0, [r4, 0x30] + negs r0, r0 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x32] + negs r0, r0 + strh r0, [r4, 0x36] + ldr r0, _08113948 + strh r0, [r4, 0x3A] + ldr r1, _0811394C + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08113940: .4byte 0x02038437 +_08113944: .4byte 0x02038436 +_08113948: .4byte 0x0000ffd8 +_0811394C: .4byte sub_8113950 + 1 + thumb_func_end sub_81138D4 + + thumb_func_start sub_8113950 +sub_8113950: @ 8113950 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r5, [r4, 0x30] + ldrh r0, [r4, 0x34] + adds r2, r5, r0 + strh r2, [r4, 0x34] + ldrh r3, [r4, 0x32] + ldrh r6, [r4, 0x36] + adds r1, r3, r6 + strh r1, [r4, 0x36] + lsls r0, r2, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + movs r6, 0x3C + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _08113992 + adds r0, r2, r5 + strh r0, [r4, 0x34] + adds r1, r3 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r4, 0x26] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] +_08113992: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + ldrh r6, [r4, 0x26] + adds r0, r6 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + cmp r0, 0x7F + ble _081139C2 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x14 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] +_081139C2: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _081139D4 + adds r0, r4, 0 + bl move_anim_8072740 +_081139D4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8113950 + + thumb_func_start sub_81139DC +sub_81139DC: @ 81139DC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08113A10 + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrb r1, [r5, 0x4] + adds r0, r4, 0 + bl sub_8008258 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x32] + ldr r0, _08113A14 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08113A10: .4byte 0x0203841e +_08113A14: .4byte sub_8113A18 + 1 + thumb_func_end sub_81139DC + + thumb_func_start sub_8113A18 +sub_8113A18: @ 8113A18 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x36] + adds r0, r1 + strh r0, [r2, 0x36] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x38] + adds r1, r3 + strh r1, [r2, 0x38] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + bne _08113A4E + ldr r0, _08113A54 + str r0, [r2, 0x1C] +_08113A4E: + pop {r0} + bx r0 + .align 2, 0 +_08113A54: .4byte sub_8113A58 + 1 + thumb_func_end sub_8113A18 + + thumb_func_start sub_8113A58 +sub_8113A58: @ 8113A58 + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x36] + ldrh r0, [r3, 0x2E] + subs r1, r0 + strh r1, [r3, 0x36] + ldrh r0, [r3, 0x38] + ldrh r2, [r3, 0x30] + subs r0, r2 + strh r0, [r3, 0x38] + lsls r1, 16 + asrs r1, 24 + strh r1, [r3, 0x24] + lsls r0, 16 + asrs r0, 24 + strh r0, [r3, 0x26] + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08113A8A + adds r0, r3, 0 + bl move_anim_8074EE0 +_08113A8A: + pop {r0} + bx r0 + thumb_func_end sub_8113A58 + + thumb_func_start sub_8113A90 +sub_8113A90: @ 8113A90 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, _08113AA4 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + cmp r1, 0 + bne _08113AAC + ldr r0, _08113AA8 + b _08113AAE + .align 2, 0 +_08113AA4: .4byte 0x0203841e +_08113AA8: .4byte 0x02038436 +_08113AAC: + ldr r0, _08113ADC +_08113AAE: + ldrb r5, [r0] + movs r6, 0x14 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x4 + ldr r7, _08113AE0 + adds r0, r7, 0 + ands r1, r0 + ldr r0, _08113AE4 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _08113B0C + cmp r0, 0x1 + bgt _08113AE8 + cmp r0, 0 + beq _08113AF2 + b _08113B60 + .align 2, 0 +_08113ADC: .4byte 0x02038437 +_08113AE0: .4byte 0x000003ff +_08113AE4: .4byte 0xfffffc00 +_08113AE8: + cmp r0, 0x2 + beq _08113B26 + cmp r0, 0x3 + beq _08113B3E + b _08113B60 +_08113AF2: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r4, 0x22] + b _08113B60 +_08113B0C: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0xE + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x10 + strh r0, [r4, 0x22] + b _08113B60 +_08113B26: + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + b _08113B54 +_08113B3E: + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0xE + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x10 +_08113B54: + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + movs r6, 0xEC +_08113B60: + movs r0, 0x20 + strh r0, [r4, 0x2E] + lsls r0, r6, 24 + asrs r0, 24 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + adds r0, 0xC + strh r0, [r4, 0x36] + ldr r0, _08113B88 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _08113B8C + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08113B88: .4byte 0x0000fff4 +_08113B8C: .4byte sub_8113B90 + 1 + thumb_func_end sub_8113A90 + + thumb_func_start sub_8113B90 +sub_8113B90: @ 8113B90 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08113BA4 + adds r0, r4, 0 + bl move_anim_8074EE0 +_08113BA4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8113B90 + + thumb_func_start sub_8113BAC +sub_8113BAC: @ 8113BAC + push {r4-r7,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08113C10 + adds r5, r1, r0 + ldr r4, _08113C14 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1F + movs r6, 0 + strh r0, [r5, 0x16] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + subs r0, 0x7 + strh r0, [r5, 0x14] + ldrh r1, [r5, 0x16] + strh r1, [r5, 0x12] + strh r0, [r5, 0x10] + subs r1, r0 + lsls r1, 8 + strh r1, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r5, 0x24] + adds r0, 0x20 + strh r0, [r5, 0x26] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08113C1C + ldr r0, _08113C18 + b _08113C1E + .align 2, 0 +_08113C10: .4byte 0x03005e00 +_08113C14: .4byte 0x02038436 +_08113C18: .4byte 0x0000fff4 +_08113C1C: + ldr r0, _08113C68 +_08113C1E: + strh r0, [r5, 0x18] + ldr r0, _08113C6C + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + cmp r0, 0x1 + bne _08113C80 + add r4, sp, 0xC + adds r0, r4, 0 + bl sub_80A6B30 + ldr r0, _08113C70 + ldrh r0, [r0] + strh r0, [r5, 0x1C] + ldr r1, _08113C74 + movs r0, 0x50 + bl lcd_io_set + ldrb r1, [r4, 0x8] + lsls r1, 4 + movs r0, 0 + movs r2, 0x20 + bl rboxid_80040B8 + ldr r0, _08113C78 + str r0, [sp] + movs r7, 0x2 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08113CB0 + ldr r1, _08113C7C + b _08113CAA + .align 2, 0 +_08113C68: .4byte 0x0000ffc0 +_08113C6C: .4byte 0x02038436 +_08113C70: .4byte 0x02022e1a +_08113C74: .4byte 0x00003f42 +_08113C78: .4byte 0x04000016 +_08113C7C: .4byte 0x02022e1c +_08113C80: + ldr r0, _08113D38 + ldrh r0, [r0] + strh r0, [r5, 0x1C] + ldr r1, _08113D3C + movs r0, 0x50 + bl lcd_io_set + movs r0, 0 + movs r1, 0x90 + movs r2, 0x20 + bl rboxid_80040B8 + ldr r0, _08113D40 + str r0, [sp] + movs r7, 0x4 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08113CB0 + ldr r1, _08113D44 +_08113CAA: + ldrh r0, [r1] + adds r0, 0xF0 + strh r0, [r1] +_08113CB0: + ldr r0, _08113D48 + str r0, [sp, 0x4] + mov r2, sp + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x8] + mov r0, sp + strb r1, [r0, 0x9] + strh r1, [r5, 0x1E] + movs r0, 0x10 + strh r0, [r5, 0x20] + strh r1, [r5, 0x8] + strh r1, [r5, 0xA] + strh r1, [r5, 0xC] + movs r0, 0x3 + bl sub_8114374 + movs r3, 0 + ldr r4, _08113D4C + movs r0, 0xF0 + lsls r0, 3 + adds r6, r4, r0 +_08113CDC: + lsls r1, r3, 1 + adds r2, r1, r4 + ldrh r0, [r5, 0x1C] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r5, 0x1C] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x6F + bls _08113CDC + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + movs r0, 0x3F + eors r7, r0 + movs r1, 0xFC + lsls r1, 6 + adds r0, r1, 0 + orrs r7, r0 + movs r0, 0x4A + adds r1, r7, 0 + bl lcd_io_set + ldr r1, _08113D50 + movs r0, 0x48 + bl lcd_io_set + ldr r2, _08113D54 + ldrh r0, [r5, 0x24] + lsls r0, 8 + ldrh r1, [r5, 0x26] + orrs r0, r1 + strh r0, [r2] + ldr r1, _08113D58 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, _08113D5C + str r0, [r5] + add sp, 0x1C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08113D38: .4byte 0x02022e1e +_08113D3C: .4byte 0x00003f44 +_08113D40: .4byte 0x0400001a +_08113D44: .4byte 0x02022e18 +_08113D48: .4byte 0xa2600001 +_08113D4C: .4byte 0x02038c28 +_08113D50: .4byte 0x00003f3f +_08113D54: .4byte 0x02022e24 +_08113D58: .4byte 0x02022e26 +_08113D5C: .4byte sub_8113D60 + 1 + thumb_func_end sub_8113BAC + + thumb_func_start sub_8113D60 +sub_8113D60: @ 8113D60 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08113D84 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08113D7A + b _08113E72 +_08113D7A: + lsls r0, 2 + ldr r1, _08113D88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08113D84: .4byte 0x03005e00 +_08113D88: .4byte _08113D8C + .align 2, 0 +_08113D8C: + .4byte _08113DA0 + .4byte _08113E02 + .4byte _08113E1C + .4byte _08113E58 + .4byte _08113E6C +_08113DA0: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08113E72 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08113DD0 + ldrh r1, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + cmp r0, 0xC + beq _08113DDE + adds r0, r1, 0x1 + strh r0, [r4, 0x1E] + b _08113DDE +_08113DD0: + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + beq _08113DDE + subs r0, r1, 0x1 + strh r0, [r4, 0x20] +_08113DDE: + ldrh r1, [r4, 0x20] + lsls r1, 8 + ldrh r0, [r4, 0x1E] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0xC + bne _08113E72 + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _08113E72 + b _08113E5E +_08113E02: + ldrh r0, [r4, 0x10] + subs r0, 0x8 + strh r0, [r4, 0x10] + adds r0, r4, 0 + bl sub_8114244 + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _08113E72 + b _08113E5E +_08113E1C: + ldrh r0, [r4, 0x10] + subs r0, 0x8 + strh r0, [r4, 0x10] + adds r0, r4, 0 + bl sub_8114244 + ldrh r1, [r4, 0x24] + adds r1, 0x4 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r2, r0, 0x4 + strh r2, [r4, 0x26] + lsls r1, 16 + lsls r0, r2, 16 + cmp r1, r0 + blt _08113E3E + strh r2, [r4, 0x24] +_08113E3E: + ldr r3, _08113E54 + ldrh r2, [r4, 0x24] + lsls r0, r2, 8 + ldrh r1, [r4, 0x26] + orrs r0, r1 + strh r0, [r3] + lsls r2, 16 + lsls r1, 16 + cmp r2, r1 + bne _08113E72 + b _08113E5E + .align 2, 0 +_08113E54: .4byte 0x02022e24 +_08113E58: + ldr r1, _08113E68 + movs r0, 0x3 + strb r0, [r1, 0x15] +_08113E5E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08113E72 + .align 2, 0 +_08113E68: .4byte 0x02039b28 +_08113E6C: + adds r0, r2, 0 + bl move_anim_task_del +_08113E72: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8113D60 + + thumb_func_start sub_8113E78 +sub_8113E78: @ 8113E78 + push {r4-r7,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _08113EA0 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _08113E94 + b _081140A6 +_08113E94: + lsls r0, 2 + ldr r1, _08113EA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08113EA0: .4byte 0x03005e00 +_08113EA4: .4byte _08113EA8 + .align 2, 0 +_08113EA8: + .4byte _08113EBC + .4byte _08113F40 + .4byte _08113F84 + .4byte _08113FF0 + .4byte _08114058 +_08113EBC: + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08113EF8 + ldr r0, _08113EEC + movs r1, 0 + strh r1, [r0] + ldr r0, _08113EF0 + strh r1, [r0] + ldr r4, _08113EF4 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + adds r0, r6, 0 + bl move_anim_task_del + b _081140A6 + .align 2, 0 +_08113EEC: .4byte 0x02022e24 +_08113EF0: .4byte 0x02022e26 +_08113EF4: .4byte 0x00003f3f +_08113EF8: + ldr r0, _08113F18 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + cmp r0, 0x1 + bne _08113F24 + ldr r1, _08113F1C + movs r0, 0x50 + bl lcd_io_set + ldr r1, _08113F20 + b _08113F2E + .align 2, 0 +_08113F18: .4byte 0x02038437 +_08113F1C: .4byte 0x00003f42 +_08113F20: .4byte 0x02022e1c +_08113F24: + ldr r1, _08113F38 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _08113F3C +_08113F2E: + ldrh r0, [r1] + adds r0, 0xF0 + strh r0, [r1] + b _08114044 + .align 2, 0 +_08113F38: .4byte 0x00003f44 +_08113F3C: .4byte 0x02022e18 +_08113F40: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08113F68 + mov r0, sp + bl sub_80A6B30 + ldr r0, _08113F64 + ldrh r0, [r0] + strh r0, [r5, 0x1C] + mov r0, sp + ldrb r1, [r0, 0x8] + lsls r1, 4 + movs r0, 0 + movs r2, 0x20 + bl rboxid_80040B8 + b _08113F78 + .align 2, 0 +_08113F64: .4byte 0x02022e1a +_08113F68: + ldr r0, _08113F80 + ldrh r0, [r0] + strh r0, [r5, 0x1C] + movs r0, 0 + movs r1, 0x90 + movs r2, 0x20 + bl rboxid_80040B8 +_08113F78: + movs r0, 0x3 + bl sub_8114374 + b _08114044 + .align 2, 0 +_08113F80: .4byte 0x02022e1e +_08113F84: + ldr r4, _08113FD0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1F + movs r6, 0 + strh r0, [r5, 0x16] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + subs r0, 0x7 + strh r0, [r5, 0x14] + ldrh r1, [r5, 0x16] + subs r1, r0 + lsls r1, 8 + strh r1, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r1, r0, 0x4 + strh r1, [r5, 0x24] + adds r0, 0x4 + strh r0, [r5, 0x26] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08113FD8 + ldr r0, _08113FD4 + b _08113FDA + .align 2, 0 +_08113FD0: .4byte 0x02038437 +_08113FD4: .4byte 0x0000fff4 +_08113FD8: + ldr r0, _08113FEC +_08113FDA: + strh r0, [r5, 0x18] + ldrh r0, [r5, 0x18] + strh r0, [r5, 0x10] + strh r0, [r5, 0x12] + movs r0, 0xC + strh r0, [r5, 0x1E] + movs r0, 0x8 + strh r0, [r5, 0x20] + b _08114044 + .align 2, 0 +_08113FEC: .4byte 0x0000ffc0 +_08113FF0: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08114000 + ldr r0, _08113FFC + b _08114002 + .align 2, 0 +_08113FFC: .4byte 0x04000016 +_08114000: + ldr r0, _0811404C +_08114002: + str r0, [sp, 0x10] + movs r3, 0 + add r4, sp, 0x10 + ldr r6, _08114050 + movs r0, 0xF0 + lsls r0, 3 + adds r7, r6, r0 +_08114010: + lsls r1, r3, 1 + adds r2, r1, r6 + ldrh r0, [r5, 0x1C] + adds r0, 0x9F + subs r0, r3 + strh r0, [r2] + adds r1, r7 + ldrh r0, [r5, 0x1C] + adds r0, 0x9F + subs r0, r3 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x6F + bls _08114010 + ldr r1, _08114054 + str r1, [r4, 0x4] + movs r2, 0 + movs r0, 0x1 + strb r0, [r4, 0x8] + strb r2, [r4, 0x9] + ldr r0, [sp, 0x10] + ldr r2, [r4, 0x8] + bl sub_80BA038 +_08114044: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _081140A6 + .align 2, 0 +_0811404C: .4byte 0x0400001a +_08114050: .4byte 0x02038c28 +_08114054: .4byte 0xa2600001 +_08114058: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08114070 + ldr r1, _0811406C + movs r0, 0x4A + bl lcd_io_set + b _08114078 + .align 2, 0 +_0811406C: .4byte 0x00003f3d +_08114070: + ldr r1, _081140B0 + movs r0, 0x4A + bl lcd_io_set +_08114078: + ldr r1, _081140B4 + movs r0, 0x48 + bl lcd_io_set + ldr r2, _081140B8 + ldrh r0, [r5, 0x24] + lsls r0, 8 + ldrh r1, [r5, 0x26] + orrs r0, r1 + strh r0, [r2] + ldr r1, _081140BC + movs r0, 0xA0 + strh r0, [r1] + movs r0, 0 + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + ldr r1, _081140C0 + movs r0, 0x52 + bl lcd_io_set + ldr r0, _081140C4 + str r0, [r5] +_081140A6: + add sp, 0x1C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081140B0: .4byte 0x00003f3b +_081140B4: .4byte 0x00003f3f +_081140B8: .4byte 0x02022e24 +_081140BC: .4byte 0x02022e26 +_081140C0: .4byte 0x0000080c +_081140C4: .4byte sub_81140C8 + 1 + thumb_func_end sub_8113E78 + + thumb_func_start sub_81140C8 +sub_81140C8: @ 81140C8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081140EC + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _081140E2 + b _08114232 +_081140E2: + lsls r0, 2 + ldr r1, _081140F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081140EC: .4byte 0x03005e00 +_081140F0: .4byte _081140F4 + .align 2, 0 +_081140F4: + .4byte _08114108 + .4byte _08114134 + .4byte _0811419C + .4byte _081141FE + .4byte _08114210 +_08114108: + ldrh r0, [r4, 0x12] + adds r0, 0x8 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0x16] + movs r3, 0x16 + ldrsh r1, [r4, r3] + cmp r0, r1 + blt _0811411E + strh r2, [r4, 0x12] +_0811411E: + adds r0, r4, 0 + bl sub_8114244 + movs r0, 0x12 + ldrsh r1, [r4, r0] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r1, r0 + beq _08114132 + b _08114232 +_08114132: + b _08114204 +_08114134: + movs r3, 0x26 + ldrsh r0, [r4, r3] + movs r2, 0x24 + ldrsh r1, [r4, r2] + subs r0, r1 + cmp r0, 0x3F + bgt _08114150 + ldrh r0, [r4, 0x24] + subs r0, 0x4 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + adds r0, 0x4 + strh r0, [r4, 0x26] + b _08114154 +_08114150: + movs r0, 0x1 + strh r0, [r4, 0xA] +_08114154: + ldr r2, _08114198 + ldrh r0, [r4, 0x24] + lsls r0, 8 + ldrh r1, [r4, 0x26] + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x10] + adds r0, 0x8 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0x14] + movs r3, 0x14 + ldrsh r1, [r4, r3] + cmp r0, r1 + blt _08114176 + strh r2, [r4, 0x10] +_08114176: + adds r0, r4, 0 + bl sub_8114244 + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08114232 + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08114232 + movs r0, 0 + strh r0, [r4, 0xA] + b _08114204 + .align 2, 0 +_08114198: .4byte 0x02022e24 +_0811419C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08114232 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081141CC + ldrh r1, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081141DA + subs r0, r1, 0x1 + strh r0, [r4, 0x1E] + b _081141DA +_081141CC: + ldrh r1, [r4, 0x20] + movs r3, 0x20 + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081141DA + adds r0, r1, 0x1 + strh r0, [r4, 0x20] +_081141DA: + ldrh r1, [r4, 0x20] + lsls r1, 8 + ldrh r0, [r4, 0x1E] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08114232 + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bne _08114232 + b _08114204 +_081141FE: + ldr r1, _0811420C + movs r0, 0x3 + strb r0, [r1, 0x15] +_08114204: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08114232 + .align 2, 0 +_0811420C: .4byte 0x02039b28 +_08114210: + ldr r0, _08114238 + movs r1, 0 + strh r1, [r0] + ldr r0, _0811423C + strh r1, [r0] + ldr r4, _08114240 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + adds r0, r5, 0 + bl move_anim_task_del +_08114232: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08114238: .4byte 0x02022e24 +_0811423C: .4byte 0x02022e26 +_08114240: .4byte 0x00003f3f + thumb_func_end sub_81140C8 + + thumb_func_start sub_8114244 +sub_8114244: @ 8114244 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrh r0, [r6, 0x12] + ldrh r4, [r6, 0x10] + subs r0, r4 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + beq _08114338 + movs r2, 0x22 + ldrsh r0, [r6, r2] + bl __divsi3 + mov r8, r0 + movs r3, 0x14 + ldrsh r0, [r6, r3] + lsls r5, r0, 8 + lsls r0, r4, 16 + movs r4, 0 + cmp r0, 0 + ble _081142A4 + ldr r0, _08114330 + mov r12, r0 + ldr r7, _08114334 +_08114278: + lsls r2, r4, 16 + asrs r2, 16 + lsls r3, r2, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r3, r0 + add r3, r12 + adds r1, r2, 0 + subs r1, 0x9F + ldrh r0, [r6, 0x1C] + subs r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + lsrs r4, r2, 16 + asrs r2, 16 + movs r1, 0x10 + ldrsh r0, [r6, r1] + cmp r2, r0 + blt _08114278 +_081142A4: + ldrh r4, [r6, 0x10] + lsls r3, r4, 16 + asrs r1, r3, 16 + movs r2, 0x12 + ldrsh r0, [r6, r2] + cmp r1, r0 + bgt _081142EE + ldr r0, _08114330 + mov r12, r0 + ldr r7, _08114334 +_081142B8: + asrs r4, r3, 16 + cmp r4, 0 + blt _081142DA + asrs r1, r5, 8 + subs r1, r4 + lsls r3, r4, 1 + ldrb r2, [r7, 0x14] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 7 + adds r3, r0 + add r3, r12 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r6, 0x1C] + adds r1, r2 + strh r1, [r3] +_081142DA: + add r5, r8 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r3, r4, 16 + asrs r1, r3, 16 + movs r2, 0x12 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _081142B8 +_081142EE: + movs r3, 0x1C + ldrsh r0, [r6, r3] + adds r0, 0x9F + lsls r2, r4, 16 + asrs r1, r2, 16 + subs r5, r0, r1 + movs r3, 0x16 + ldrsh r0, [r6, r3] + cmp r1, r0 + bge _08114366 + ldr r7, _08114330 + ldr r4, _08114334 +_08114306: + asrs r3, r2, 16 + cmp r3, 0 + blt _0811431E + lsls r2, r3, 1 + ldrb r1, [r4, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + strh r5, [r2] + subs r5, 0x1 +_0811431E: + adds r0, r3, 0x1 + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r3, 0x16 + ldrsh r0, [r6, r3] + cmp r1, r0 + blt _08114306 + b _08114366 + .align 2, 0 +_08114330: .4byte 0x02038c28 +_08114334: .4byte 0x02039b28 +_08114338: + movs r1, 0x1C + ldrsh r0, [r6, r1] + adds r5, r0, 0 + adds r5, 0x9F + movs r4, 0 + ldr r3, _08114370 + movs r2, 0xF0 + lsls r2, 3 + adds r6, r3, r2 +_0811434A: + lsls r0, r4, 16 + asrs r0, 16 + lsls r2, r0, 1 + adds r1, r2, r3 + strh r5, [r1] + adds r2, r6 + strh r5, [r2] + subs r5, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x6F + ble _0811434A +_08114366: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08114370: .4byte 0x02038c28 + thumb_func_end sub_8114244 + + thumb_func_start sub_8114374 +sub_8114374: @ 8114374 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + ldr r7, _081143BC + movs r1, 0x3 + ands r0, r1 + lsls r5, r0, 2 + movs r0, 0xD + negs r0, r0 + adds r6, r0, 0 +_0811438A: + lsls r0, r4, 24 + lsrs r0, 24 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081143AA + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r0, [r1, 0x5] + ands r0, r6 + orrs r0, r5 + strb r0, [r1, 0x5] +_081143AA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _0811438A + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081143BC: .4byte 0x02020630 + thumb_func_end sub_8114374 + + thumb_func_start sub_81143C0 +sub_81143C0: @ 81143C0 + 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 + ldr r6, _08114464 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + ldrb r0, [r6] + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80A438C + ldr r0, _08114468 + mov r9, r0 + ldr r0, _0811446C + mov r8, r0 + ldrb r0, [r6] + add r0, r8 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + adds r1, 0x3E + ldrb r2, [r1] + movs r7, 0x5 + negs r7, r7 + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r6] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811444E + ldrb r0, [r6] + eors r0, r5 + movs r1, 0x1 + eors r4, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80A438C + ldrb r0, [r6] + eors r0, r5 + add r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r7, 0 + ands r1, r2 + strb r1, [r0] +_0811444E: + mov r0, r10 + bl move_anim_task_del + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08114464: .4byte 0x02038436 +_08114468: .4byte 0x02020630 +_0811446C: .4byte 0x020241e4 + thumb_func_end sub_81143C0 + + thumb_func_start sub_8114470 +sub_8114470: @ 8114470 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _081144B8 + ldrb r0, [r4] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r5, 0 + bl sub_80A477C + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081144AC + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_081144AC: + adds r0, r6, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081144B8: .4byte 0x02038436 + thumb_func_end sub_8114470 + + thumb_func_start sub_81144BC +sub_81144BC: @ 81144BC + push {r4,lr} + adds r4, r0, 0 + ldr r1, _081144EC + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrb r1, [r1, 0x4] + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _081144F0 + str r0, [r4, 0x1C] + ldr r1, _081144F4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081144EC: .4byte 0x0203841e +_081144F0: .4byte sub_80A67D8 + 1 +_081144F4: .4byte move_anim_8072740 + 1 + thumb_func_end sub_81144BC + + thumb_func_start sub_81144F8 +sub_81144F8: @ 81144F8 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + ldr r0, _081145EC + strh r6, [r0] + ldr r0, _081145F0 + strh r6, [r0] + ldr r1, _081145F4 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _081145F8 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r1, _081145FC + movs r0, 0x50 + bl lcd_io_set + ldr r1, _08114600 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0811455C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0811455C: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081145D6 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081145D6 + ldr r4, _08114604 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0811458C + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _081145D6 +_0811458C: + ldrb r0, [r4] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081145D6 + ldr r3, _08114608 + ldr r1, _0811460C + ldrb r0, [r4] + eors r0, r5 + adds r0, r1 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r6, 0x1 +_081145D6: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08114614 + ldr r0, _08114610 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r5, [r0] + b _0811465C + .align 2, 0 +_081145EC: .4byte 0x02022e24 +_081145F0: .4byte 0x02022e26 +_081145F4: .4byte 0x00003f3f +_081145F8: .4byte 0x00003f3d +_081145FC: .4byte 0x00003f42 +_08114600: .4byte 0x00000c08 +_08114604: .4byte 0x02038436 +_08114608: .4byte 0x02020630 +_0811460C: .4byte 0x020241e4 +_08114610: .4byte 0x02039f34 +_08114614: + ldr r4, _08114634 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08114640 + ldr r1, _08114638 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0811463C + b _08114650 + .align 2, 0 +_08114634: .4byte 0x02038436 +_08114638: .4byte 0x0202406e +_0811463C: .4byte 0x02024744 +_08114640: + ldr r1, _081146E0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081146E4 +_08114650: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 +_0811465C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081146E8 + ldrb r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A89C8 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _081146EC + bl sub_80A6D48 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _081146F0 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _081146F4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r2, _081146F8 + ldr r0, _081146FC + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + negs r0, r0 + adds r0, 0x60 + strh r0, [r2] + ldr r2, _08114700 + ldrh r0, [r1, 0x22] + negs r0, r0 + adds r0, 0x20 + strh r0, [r2] + ldrb r0, [r1, 0x5] + lsrs r0, 4 + adds r0, 0x10 + adds r1, r0, 0 + ldr r2, _08114704 + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _08114708 + adds r0, r1, 0 + movs r1, 0 + bl sub_80A750C + b _08114714 + .align 2, 0 +_081146E0: .4byte 0x0202406e +_081146E4: .4byte 0x020244ec +_081146E8: .4byte 0x02038436 +_081146EC: .4byte 0x08c1d210 +_081146F0: .4byte 0x08c1d0ac +_081146F4: .4byte 0x08c1d1e8 +_081146F8: .4byte 0x02022e18 +_081146FC: .4byte 0x02020630 +_08114700: .4byte 0x02022e1a +_08114704: .4byte 0x0203841e +_08114708: + lsls r0, r1, 4 + ldrh r3, [r2, 0x4] + movs r1, 0x10 + movs r2, 0xB + bl pal_fade_1 +_08114714: + ldr r1, _0811473C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r2, _08114740 + ldrh r1, [r2] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0xE] + strh r6, [r0, 0x14] + ldr r1, _08114744 + str r1, [r0] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811473C: .4byte 0x03005e00 +_08114740: .4byte 0x0203841e +_08114744: .4byte sub_8114748 + 1 + thumb_func_end sub_81144F8 + + thumb_func_start sub_8114748 +sub_8114748: @ 8114748 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _08114810 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x4 + movs r5, 0 + strh r0, [r4, 0x1C] + ldr r2, _08114814 + ldrh r3, [r2] + subs r1, r3, 0x4 + strh r1, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x80 + beq _08114776 + b _08114886 +_08114776: + strh r5, [r4, 0x1C] + adds r0, r3, 0 + adds r0, 0x7C + strh r0, [r2] + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08114824 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08114818 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + adds r0, 0x10 + adds r1, r0, 0 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081147B8 + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80A750C +_081147B8: + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08114886 + ldr r2, _0811481C + ldr r0, _08114820 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + adds r0, r2 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + b _08114886 + .align 2, 0 +_08114810: .4byte 0x03005e00 +_08114814: .4byte 0x02022e18 +_08114818: .4byte 0x02020630 +_0811481C: .4byte 0x020241e4 +_08114820: .4byte 0x02038436 +_08114824: + cmp r0, 0x3 + bne _08114886 + ldr r0, _08114890 + strh r5, [r0] + ldr r0, _08114894 + strh r5, [r0] + ldr r4, _08114898 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08114856 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08114856: + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r6, 0 + bl move_anim_task_del +_08114886: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08114890: .4byte 0x02022e24 +_08114894: .4byte 0x02022e26 +_08114898: .4byte 0x00003f3f + thumb_func_end sub_8114748 + + thumb_func_start sub_811489C +sub_811489C: @ 811489C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _081148BC + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0x7 + bhi _08114900 + lsls r0, r1, 2 + ldr r1, _081148C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081148BC: .4byte 0x0203841e +_081148C0: .4byte _081148C4 + .align 2, 0 +_081148C4: + .4byte _081148E4 + .4byte _081148E4 + .4byte _081148E4 + .4byte _081148E4 + .4byte _081148F0 + .4byte _081148F4 + .4byte _081148F8 + .4byte _081148FC +_081148E4: + ldrb r0, [r2] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + b _08114902 +_081148F0: + movs r4, 0 + b _08114908 +_081148F4: + movs r4, 0x2 + b _08114908 +_081148F8: + movs r4, 0x1 + b _08114908 +_081148FC: + movs r4, 0x3 + b _08114908 +_08114900: + movs r2, 0xFF +_08114902: + movs r0, 0 + cmp r0, 0 + beq _0811492E +_08114908: + adds r0, r4, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811492C + ldr r0, _08114928 + adds r0, r4, r0 + ldrb r2, [r0] + b _0811492E + .align 2, 0 +_08114928: .4byte 0x020241e4 +_0811492C: + movs r2, 0xFF +_0811492E: + cmp r2, 0xFF + beq _0811494A + ldr r1, _08114958 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + ldr r1, _0811495C + ldrb r1, [r1, 0x2] + bl sub_80A750C +_0811494A: + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08114958: .4byte 0x02020630 +_0811495C: .4byte 0x0203841e + thumb_func_end sub_811489C + + thumb_func_start sub_8114960 +sub_8114960: @ 8114960 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _0811498C + ldrb r0, [r2] + cmp r0, 0x1 + bhi _08114974 + ldr r1, _08114990 + movs r0, 0 + strh r0, [r1, 0xE] +_08114974: + ldrb r0, [r2] + cmp r0, 0x2 + bne _08114980 + ldr r1, _08114990 + movs r0, 0x1 + strh r0, [r1, 0xE] +_08114980: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_0811498C: .4byte 0x02038432 +_08114990: .4byte 0x0203841e + thumb_func_end sub_8114960 + + thumb_func_start sub_8114994 +sub_8114994: @ 8114994 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _081149EC + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + movs r0, 0x14 + strh r0, [r4, 0x2E] + ldr r5, _081149F0 + 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, _081149F4 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _081149F8 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081149EC: .4byte 0x02038436 +_081149F0: .4byte 0x02038437 +_081149F4: .4byte 0x0000ffd8 +_081149F8: .4byte sub_81149FC + 1 + thumb_func_end sub_8114994 + + thumb_func_start sub_81149FC +sub_81149FC: @ 81149FC + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08114A50 + 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] + movs r0, 0x14 + strh r0, [r5, 0x2E] + ldr r4, _08114A58 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, _08114A5C + str r0, [r5, 0x1C] +_08114A50: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08114A58: .4byte 0x02038436 +_08114A5C: .4byte sub_8114A60 + 1 + thumb_func_end sub_81149FC + + thumb_func_start sub_8114A60 +sub_8114A60: @ 8114A60 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08114A74 + adds r0, r4, 0 + bl move_anim_8072740 +_08114A74: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8114A60 + + thumb_func_start sub_8114A7C +sub_8114A7C: @ 8114A7C + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, _08114ADC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08114A9C + ldr r1, _08114AE0 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_08114A9C: + ldr r4, _08114AE0 + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, _08114AE4 + 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 r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x36] + ldr r0, _08114AE8 + str r0, [r6, 0x1C] + ldr r1, _08114AEC + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08114ADC: .4byte 0x02038436 +_08114AE0: .4byte 0x0203841e +_08114AE4: .4byte 0x02038437 +_08114AE8: .4byte sub_80A6EEC + 1 +_08114AEC: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8114A7C + + thumb_func_start sub_8114AF0 +sub_8114AF0: @ 8114AF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r4, _08114B70 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A60AC + lsls r0, 24 + lsrs r7, r0, 24 + bl GenerateRandomNumber2 + movs r4, 0x1F + adds r5, r4, 0 + ands r5, r0 + bl GenerateRandomNumber2 + ands r4, r0 + adds r1, r5, 0 + cmp r1, 0x10 + ble _08114B38 + movs r0, 0x10 + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_08114B38: + lsls r0, r4, 16 + asrs r1, r0, 16 + cmp r1, 0x10 + ble _08114B48 + movs r0, 0x10 + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_08114B48: + ldr r0, _08114B74 + ldrh r0, [r0, 0x4] + strh r0, [r6, 0x2E] + mov r1, r8 + adds r0, r1, r5 + strh r0, [r6, 0x32] + adds r0, r7, r4 + strh r0, [r6, 0x36] + ldr r0, _08114B78 + str r0, [r6, 0x1C] + ldr r1, _08114B7C + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08114B70: .4byte 0x02038437 +_08114B74: .4byte 0x0203841e +_08114B78: .4byte sub_80A6EEC + 1 +_08114B7C: .4byte move_anim_8074EE0 + 1 + thumb_func_end sub_8114AF0 + + thumb_func_start sub_8114B80 +sub_8114B80: @ 8114B80 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x1 + ldr r3, _08114BE0 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _08114BE4 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r6, _08114BE8 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08114BF4 + ldr r4, _08114BEC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r6, 0x2] + adds r0, r2 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r3, [r6, 0x4] + adds r0, r3 + strh r0, [r5, 0x22] + movs r1, 0x2 + ldrsh r0, [r6, r1] + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + ble _08114BDA + movs r1, 0x1 +_08114BDA: + strh r1, [r5, 0x2E] + ldr r0, _08114BF0 + b _08114C02 + .align 2, 0 +_08114BE0: .4byte 0x000003ff +_08114BE4: .4byte 0xfffffc00 +_08114BE8: .4byte 0x0203841e +_08114BEC: .4byte 0x02038436 +_08114BF0: .4byte sub_8114C10 + 1 +_08114BF4: + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x20] + ldrh r0, [r6, 0x4] + strh r0, [r5, 0x22] + negs r0, r0 + strh r0, [r5, 0x26] + ldr r0, _08114C0C +_08114C02: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08114C0C: .4byte sub_8114C4C + 1 + thumb_func_end sub_8114B80 + + thumb_func_start sub_8114C10 +sub_8114C10: @ 8114C10 + 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 _08114C2E + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] +_08114C2E: + ldrh r0, [r2, 0x22] + subs r0, 0x4 + strh r0, [r2, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + negs r1, r1 + cmp r0, r1 + bge _08114C46 + adds r0, r2, 0 + bl move_anim_8072740 +_08114C46: + pop {r0} + bx r0 + thumb_func_end sub_8114C10 + + thumb_func_start sub_8114C4C +sub_8114C4C: @ 8114C4C + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _08114C5E + cmp r1, 0x1 + beq _08114C74 + b _08114CB6 +_08114C5E: + ldrh r0, [r3, 0x26] + adds r0, 0x4 + strh r0, [r3, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _08114CB6 + strh r1, [r3, 0x26] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _08114CB6 +_08114C74: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + ble _08114CB6 + movs r0, 0 + strh r0, [r3, 0x30] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r2, [r1] + 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] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08114CB6 + adds r0, r3, 0 + bl move_anim_8072740 +_08114CB6: + pop {r0} + bx r0 + thumb_func_end sub_8114C4C + + thumb_func_start sub_8114CBC +sub_8114CBC: @ 8114CBC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08114CDC + adds r1, r0, r1 + ldr r0, _08114CE0 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _08114CE8 + ldr r0, _08114CE4 + b _08114CEA + .align 2, 0 +_08114CDC: .4byte 0x03005e00 +_08114CE0: .4byte 0x0203841e +_08114CE4: .4byte sub_8114CFC + 1 +_08114CE8: + ldr r0, _08114CF8 +_08114CEA: + str r0, [r1] + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_08114CF8: .4byte sub_8114EB4 + 1 + thumb_func_end sub_8114CBC + + thumb_func_start sub_8114CFC +sub_8114CFC: @ 8114CFC + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08114D20 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08114D16 + b _08114EAA +_08114D16: + lsls r0, 2 + ldr r1, _08114D24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08114D20: .4byte 0x03005e00 +_08114D24: .4byte _08114D28 + .align 2, 0 +_08114D28: + .4byte _08114D3C + .4byte _08114DC4 + .4byte _08114DD4 + .4byte _08114E78 + .4byte _08114E8C +_08114D3C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldr r0, _08114D64 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1E] + cmp r0, 0x1 + bne _08114D70 + ldr r0, _08114D68 + ldrh r0, [r0] + strh r0, [r4, 0x20] + ldr r0, _08114D6C + b _08114D78 + .align 2, 0 +_08114D64: .4byte 0x02038436 +_08114D68: .4byte 0x02022e18 +_08114D6C: .4byte 0x02022e1a +_08114D70: + ldr r0, _08114DB4 + ldrh r0, [r0] + strh r0, [r4, 0x20] + ldr r0, _08114DB8 +_08114D78: + ldrh r0, [r0] + strh r0, [r4, 0x22] + ldr r0, _08114DBC + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r4, 0x24] + adds r0, 0x20 + strh r0, [r4, 0x26] + cmp r1, 0 + bge _08114D9A + movs r0, 0 + strh r0, [r4, 0x24] +_08114D9A: + ldr r2, _08114DC0 + movs r3, 0x1C + ldrsh r1, [r4, r3] + 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] + b _08114E7E + .align 2, 0 +_08114DB4: .4byte 0x02022e1c +_08114DB8: .4byte 0x02022e1e +_08114DBC: .4byte 0x02038436 +_08114DC0: .4byte 0x02020630 +_08114DC4: + ldrb r0, [r4, 0x1E] + movs r2, 0x24 + ldrsh r1, [r4, r2] + movs r3, 0x26 + ldrsh r2, [r4, r3] + bl sub_81150E0 + b _08114E7E +_08114DD4: + ldrh r0, [r4, 0xC] + adds r0, 0x6 + movs r1, 0x7F + ands r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08114DF6 + movs r0, 0 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] +_08114DF6: + ldr r1, _08114E18 + movs r2, 0xC + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + ldrh r3, [r4, 0xE] + adds r2, r0, r3 + strh r2, [r4, 0x12] + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08114E20 + ldr r1, _08114E1C + b _08114E22 + .align 2, 0 +_08114E18: .4byte 0x08329f40 +_08114E1C: .4byte 0x02022e1a +_08114E20: + ldr r1, _08114E44 +_08114E22: + ldrh r0, [r4, 0x22] + subs r0, r2 + strh r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x3F + ble _08114EAA + ldrh r0, [r4, 0x24] + movs r1, 0x78 + subs r2, r1, r0 + strh r2, [r4, 0x12] + movs r3, 0x1E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _08114E4C + ldr r1, _08114E48 + b _08114E4E + .align 2, 0 +_08114E44: .4byte 0x02022e1e +_08114E48: .4byte 0x02022e1a +_08114E4C: + ldr r1, _08114E70 +_08114E4E: + ldrh r0, [r4, 0x22] + subs r0, r2 + strh r0, [r1] + ldr r2, _08114E74 + movs r1, 0x1C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x20] + movs r3, 0x88 + lsls r3, 1 + adds r0, r3, 0 + subs r0, r2 + strh r0, [r1, 0x24] + b _08114E7E + .align 2, 0 +_08114E70: .4byte 0x02022e1e +_08114E74: .4byte 0x02020630 +_08114E78: + ldr r1, _08114E88 + movs r0, 0x3 + strb r0, [r1, 0x15] +_08114E7E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08114EAA + .align 2, 0 +_08114E88: .4byte 0x02039b28 +_08114E8C: + adds r0, r2, 0 + bl move_anim_task_del + ldr r2, _08114EB0 + movs r0, 0x1C + ldrsh r1, [r4, 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] +_08114EAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08114EB0: .4byte 0x02020630 + thumb_func_end sub_8114CFC + + thumb_func_start sub_8114EB4 +sub_8114EB4: @ 8114EB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08114EF4 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r3] + movs r4, 0 + strh r4, [r1, 0x24] + strh r4, [r1, 0x26] + ldr r0, _08114EF8 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08114F00 + ldr r0, _08114EFC + b _08114F02 + .align 2, 0 +_08114EF4: .4byte 0x02020630 +_08114EF8: .4byte 0x02038436 +_08114EFC: .4byte 0x02022e1a +_08114F00: + ldr r0, _08114F10 +_08114F02: + strh r4, [r0] + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08114F10: .4byte 0x02022e1e + thumb_func_end sub_8114EB4 + + thumb_func_start sub_8114F14 +sub_8114F14: @ 8114F14 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08114F34 + adds r1, r0, r1 + ldr r0, _08114F38 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _08114F40 + ldr r0, _08114F3C + b _08114F42 + .align 2, 0 +_08114F34: .4byte 0x03005e00 +_08114F38: .4byte 0x0203841e +_08114F3C: .4byte sub_8114F54 + 1 +_08114F40: + ldr r0, _08114F50 +_08114F42: + str r0, [r1] + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_08114F50: .4byte sub_8114FD8 + 1 + thumb_func_end sub_8114F14 + + thumb_func_start sub_8114F54 +sub_8114F54: @ 8114F54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08114F74 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _08114F78 + cmp r5, 0x1 + beq _08114FCC + b _08114FD2 + .align 2, 0 +_08114F74: .4byte 0x03005e00 +_08114F78: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldr r3, _08114FC8 + movs r0, 0x1C + ldrsh r1, [r4, 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] + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x24] + movs r1, 0x1C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x22] + movs r0, 0xA0 + subs r0, r2 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08114FD2 + .align 2, 0 +_08114FC8: .4byte 0x02020630 +_08114FCC: + adds r0, r2, 0 + bl move_anim_task_del +_08114FD2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8114F54 + + thumb_func_start sub_8114FD8 +sub_8114FD8: @ 8114FD8 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08114FFC + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _081150DA + lsls r0, 2 + ldr r1, _08115000 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08114FFC: .4byte 0x03005e00 +_08115000: .4byte _08115004 + .align 2, 0 +_08115004: + .4byte _08115018 + .4byte _0811506C + .4byte _0811507A + .4byte _08115094 + .4byte _081150D4 +_08115018: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldr r0, _0811503C + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1E] + cmp r0, 0x1 + bne _08115044 + ldr r0, _08115040 + b _08115046 + .align 2, 0 +_0811503C: .4byte 0x02038436 +_08115040: .4byte 0x02022e18 +_08115044: + ldr r0, _08115064 +_08115046: + ldrh r0, [r0] + strh r0, [r4, 0x20] + ldr r0, _08115068 + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r4, 0x24] + adds r0, 0x20 + strh r0, [r4, 0x26] + b _081150C2 + .align 2, 0 +_08115064: .4byte 0x02022e1c +_08115068: .4byte 0x02038436 +_0811506C: + ldrb r0, [r4, 0x1E] + movs r1, 0x26 + ldrsh r2, [r4, r1] + movs r1, 0 + bl sub_81150E0 + b _081150C2 +_0811507A: + ldr r2, _08115090 + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x60 + strh r1, [r0, 0x26] + b _081150C2 + .align 2, 0 +_08115090: .4byte 0x02020630 +_08115094: + ldr r2, _081150CC + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x8 + strh r1, [r0, 0x26] + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081150DA + ldr r1, _081150D0 + movs r0, 0x3 + strb r0, [r1, 0x15] +_081150C2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081150DA + .align 2, 0 +_081150CC: .4byte 0x02020630 +_081150D0: .4byte 0x02039b28 +_081150D4: + adds r0, r2, 0 + bl move_anim_task_del +_081150DA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8114FD8 + + thumb_func_start sub_81150E0 +sub_81150E0: @ 81150E0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + cmp r0, 0x1 + bne _08115104 + ldr r0, _081150FC + ldrh r3, [r0] + ldr r0, _08115100 + b _0811510A + .align 2, 0 +_081150FC: .4byte 0x02022e18 +_08115100: .4byte 0x04000014 +_08115104: + ldr r0, _08115190 + ldrh r3, [r0] + ldr r0, _08115194 +_0811510A: + str r0, [sp] + lsls r0, r1, 16 + cmp r0, 0 + bge _08115114 + movs r1, 0 +_08115114: + lsls r2, r1, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + cmp r2, r0 + bge _08115140 + ldr r5, _08115198 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_08115126: + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r5 + strh r3, [r0] + adds r1, r6 + strh r3, [r1] + adds r2, 0x1 + lsls r2, 16 + lsrs r1, r2, 16 + lsls r2, r1, 16 + asrs r0, r2, 16 + cmp r0, r4 + blt _08115126 +_08115140: + lsls r1, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _0811516E + ldr r4, _08115198 + lsls r0, r3, 16 + asrs r0, 16 + adds r3, r0, 0 + adds r3, 0xF0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_08115158: + asrs r2, r1, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + adds r2, 0x1 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _08115158 +_0811516E: + ldr r0, _0811519C + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08115190: .4byte 0x02022e1c +_08115194: .4byte 0x04000018 +_08115198: .4byte 0x02038c28 +_0811519C: .4byte 0xa2600001 + thumb_func_end sub_81150E0 + + thumb_func_start sub_81151A0 +sub_81151A0: @ 81151A0 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, _081151B4 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r7, r0, 0 + cmp r1, 0 + bne _081151BC + ldr r0, _081151B8 + b _081151BE + .align 2, 0 +_081151B4: .4byte 0x0203841e +_081151B8: .4byte 0x02038436 +_081151BC: + ldr r0, _08115220 +_081151BE: + ldrb r4, [r0] + movs r6, 0x18 + adds r1, r7, 0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _081151DA + negs r0, r6 + lsls r0, 16 + lsrs r6, r0, 16 + movs r2, 0x4 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x4] +_081151DA: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x20] + adds r0, r4, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1E + strh r0, [r5, 0x22] + ldrh r1, [r7, 0xA] + strh r1, [r5, 0x2E] + ldrh r1, [r7, 0x4] + ldrh r2, [r5, 0x20] + adds r1, r2 + strh r1, [r5, 0x32] + ldrh r1, [r7, 0x6] + adds r0, r1 + strh r0, [r5, 0x36] + ldrh r0, [r7, 0x8] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, _08115224 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08115220: .4byte 0x02038437 +_08115224: .4byte sub_8115228 + 1 + thumb_func_end sub_81151A0 + + thumb_func_start sub_8115228 +sub_8115228: @ 8115228 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0811523C + adds r0, r4, 0 + bl move_anim_8072740 +_0811523C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8115228 + + thumb_func_start sub_8115244 +sub_8115244: @ 8115244 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, _08115258 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08115260 + ldr r0, _0811525C + b _08115262 + .align 2, 0 +_08115258: .4byte 0x0203841e +_0811525C: .4byte 0x02038436 +_08115260: + ldr r0, _081152C0 +_08115262: + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081152C4 + adds r0, r2 + ldr r4, _081152C8 + movs r3, 0x2 + ldrsh r1, [r4, r3] + lsls r1, 5 + adds r0, r1 + strh r0, [r6, 0x20] + adds r0, r5, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r6, 0x22] + ldrh r2, [r6, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0x2 + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r1, r0 + ldr r3, _081152CC + adds r0, r3, 0 + ands r1, r0 + ldr r0, _081152D0 + ands r0, r2 + orrs r0, r1 + strh r0, [r6, 0x4] + ldr r1, _081152D4 + adds r0, r6, 0 + bl oamt_set_x3A_32 + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x2E] + ldr r0, _081152D8 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081152C0: .4byte 0x02038437 +_081152C4: .4byte 0x0000fff0 +_081152C8: .4byte 0x0203841e +_081152CC: .4byte 0x000003ff +_081152D0: .4byte 0xfffffc00 +_081152D4: .4byte move_anim_8072740 + 1 +_081152D8: .4byte sub_80A64B0 + 1 + thumb_func_end sub_8115244 + + thumb_func_start sub_81152DC +sub_81152DC: @ 81152DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08115300 + adds r4, r0, r1 + ldr r0, _08115304 + ldrh r2, [r0, 0x2] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r6, r0, 0 + cmp r1, 0 + beq _08115308 + adds r0, r2, 0x3 + b _08115314 + .align 2, 0 +_08115300: .4byte 0x03005e00 +_08115304: .4byte 0x0203841e +_08115308: + ldr r0, _08115334 + ldrh r0, [r0] + movs r1, 0xA + bl __udivsi3 + adds r0, 0x3 +_08115314: + strh r0, [r4, 0x26] + strh r0, [r4, 0x24] + adds r1, r6, 0 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0xE] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + beq _08115340 + cmp r0, 0x5 + bne _08115380 + ldr r0, _08115338 + ldrh r0, [r0] + strh r0, [r4, 0x22] + ldr r0, _0811533C + b _0811539E + .align 2, 0 +_08115334: .4byte 0x02038408 +_08115338: .4byte 0x02022e20 +_0811533C: .4byte sub_81153AC + 1 +_08115340: + movs r0, 0 + strh r0, [r4, 0x22] + movs r5, 0 +_08115346: + lsls r0, r5, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08115370 + movs r3, 0x22 + ldrsh r0, [r4, r3] + adds r0, 0x9 + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x8 + adds r1, r0 + ldr r0, _0811537C + adds r0, r5, r0 + ldrb r0, [r0] + strh r0, [r1] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_08115370: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _08115346 + b _0811539C + .align 2, 0 +_0811537C: .4byte 0x020241e4 +_08115380: + ldrb r0, [r6] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1A] + cmp r0, 0xFF + bne _08115398 + adds r0, r5, 0 + bl move_anim_task_del + b _081153A0 +_08115398: + movs r0, 0x1 + strh r0, [r4, 0x22] +_0811539C: + ldr r0, _081153A8 +_0811539E: + str r0, [r4] +_081153A0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081153A8: .4byte sub_81154A4 + 1 + thumb_func_end sub_81152DC + + thumb_func_start sub_81153AC +sub_81153AC: @ 81153AC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _081153D0 + adds r3, r0, r1 + movs r0, 0x8 + ldrsh r1, [r3, r0] + cmp r1, 0x1 + beq _08115430 + cmp r1, 0x1 + bgt _081153D4 + cmp r1, 0 + beq _081153DA + b _0811549C + .align 2, 0 +_081153D0: .4byte 0x03005e00 +_081153D4: + cmp r1, 0x2 + beq _08115490 + b _0811549C +_081153DA: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811549C + strh r1, [r3, 0xA] + ldrh r1, [r3, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08115404 + ldr r1, _08115400 + ldrh r0, [r3, 0x26] + ldrh r2, [r3, 0x22] + adds r0, r2 + strh r0, [r1] + b _0811540E + .align 2, 0 +_08115400: .4byte 0x02022e20 +_08115404: + ldr r0, _0811542C + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x26] + subs r1, r2 + strh r1, [r0] +_0811540E: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r3, r2] + cmp r0, r1 + bne _0811549C + movs r0, 0 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x24] + subs r0, 0x1 + strh r0, [r3, 0x24] + b _08115484 + .align 2, 0 +_0811542C: .4byte 0x02022e20 +_08115430: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811549C + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r0, [r3, 0xC] + ands r1, r0 + cmp r1, 0 + bne _0811545C + ldr r1, _08115458 + ldrh r0, [r3, 0x24] + ldrh r2, [r3, 0x22] + adds r0, r2 + strh r0, [r1] + b _08115466 + .align 2, 0 +_08115458: .4byte 0x02022e20 +_0811545C: + ldr r0, _0811548C + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x24] + subs r1, r2 + strh r1, [r0] +_08115466: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0811549C + movs r0, 0 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x24] + subs r0, 0x1 + strh r0, [r3, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0811549C +_08115484: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _0811549C + .align 2, 0 +_0811548C: .4byte 0x02022e20 +_08115490: + ldr r1, _081154A0 + ldrh r0, [r3, 0x22] + strh r0, [r1] + adds r0, r2, 0 + bl move_anim_task_del +_0811549C: + pop {r0} + bx r0 + .align 2, 0 +_081154A0: .4byte 0x02022e20 + thumb_func_end sub_81153AC + + thumb_func_start sub_81154A4 +sub_81154A4: @ 81154A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, _081154C8 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _08115504 + cmp r5, 0x1 + bgt _081154CC + cmp r5, 0 + beq _081154D2 + b _0811557E + .align 2, 0 +_081154C8: .4byte 0x03005e00 +_081154CC: + cmp r5, 0x2 + beq _08115540 + b _0811557E +_081154D2: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811557E + strh r5, [r4, 0xA] + adds r0, r4, 0 + bl sub_8115588 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0811557E + strh r5, [r4, 0xC] + ldrh r0, [r4, 0x24] + subs r0, 0x1 + strh r0, [r4, 0x24] + b _08115538 +_08115504: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811557E + strh r5, [r4, 0xA] + adds r0, r4, 0 + bl sub_8115588 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0811557E + strh r5, [r4, 0xC] + ldrh r0, [r4, 0x24] + subs r0, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0811557E +_08115538: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0811557E +_08115540: + movs r2, 0 + movs r7, 0x22 + ldrsh r0, [r4, r7] + cmp r2, r0 + bge _08115578 + ldr r0, _08115584 + mov r12, r0 + adds r5, r4, 0 + adds r5, 0x8 + movs r6, 0 +_08115554: + adds r0, r2, 0 + adds r0, 0x9 + lsls r0, 1 + adds r0, r5, r0 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r12 + strh r6, [r0, 0x24] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r2, r0 + blt _08115554 +_08115578: + adds r0, r3, 0 + bl move_anim_task_del +_0811557E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08115584: .4byte 0x02020630 + thumb_func_end sub_81154A4 + + thumb_func_start sub_8115588 +sub_8115588: @ 8115588 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0xC] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _081155B0 + movs r0, 0x24 + ldrsh r1, [r3, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r2, [r3, 0x24] + adds r0, r4, 0 + ands r0, r2 + adds r1, r0 + lsls r1, 16 + lsrs r4, r1, 16 + b _081155C0 +_081155B0: + movs r1, 0x24 + ldrsh r0, [r3, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_081155C0: + movs r2, 0 + movs r7, 0x22 + ldrsh r0, [r3, r7] + cmp r2, r0 + bge _081155F4 + ldr r6, _081155FC + adds r5, r3, 0 + adds r5, 0x8 +_081155D0: + adds r0, r2, 0 + adds r0, 0x9 + lsls r0, 1 + adds r0, r5, r0 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r4, [r0, 0x24] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x22 + ldrsh r0, [r3, r1] + cmp r2, r0 + blt _081155D0 +_081155F4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081155FC: .4byte 0x02020630 + thumb_func_end sub_8115588 + + thumb_func_start sub_8115600 +sub_8115600: @ 8115600 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _08115620 + movs r2, 0 + ldr r0, _08115624 + ldrh r0, [r0] + cmp r0, 0x63 + bls _08115614 + movs r2, 0x1 +_08115614: + strh r2, [r3, 0x1E] + adds r0, r1, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08115620: .4byte 0x0203841e +_08115624: .4byte 0x02038408 + thumb_func_end sub_8115600 + + thumb_func_start sub_8115628 +sub_8115628: @ 8115628 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _08115640 + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _08115648 + ldr r0, _08115644 + b _0811564A + .align 2, 0 +_08115640: .4byte 0x0203841e +_08115644: .4byte 0x02038437 +_08115648: + ldr r0, _081156B8 +_0811564A: + ldrb r0, [r0] + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + ble _0811565A + movs r0, 0x2 + eors r5, r0 +_0811565A: + ldr r0, _081156BC + ldrb r1, [r6, 0x2] + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081156C0 + adds r4, r0 + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x20 + subs r1, r0 + ldr r2, _081156C4 + adds r0, r2, 0 + ands r1, r0 + strh r1, [r4, 0xA] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x40 + subs r1, r0 + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0xC] + ldr r2, _081156C8 + ldrh r0, [r4, 0xA] + strh r0, [r2] + ldr r0, _081156CC + strh r1, [r0] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0xE] + adds r0, r7, 0 + bl move_anim_task_del + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081156B8: .4byte 0x02038436 +_081156BC: .4byte sub_81156D0 + 1 +_081156C0: .4byte 0x03005e00 +_081156C4: .4byte 0x000001ff +_081156C8: .4byte 0x02022e20 +_081156CC: .4byte 0x02022e22 + thumb_func_end sub_8115628 + + thumb_func_start sub_81156D0 +sub_81156D0: @ 81156D0 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, _08115700 + adds r2, r0, r1 + ldr r0, _08115704 + movs r4, 0xE + ldrsh r1, [r0, r4] + movs r4, 0xE + ldrsh r0, [r2, r4] + cmp r1, r0 + bne _08115710 + ldr r0, _08115708 + movs r1, 0 + strh r1, [r0] + ldr r0, _0811570C + strh r1, [r0] + adds r0, r3, 0 + bl remove_task + b _0811571C + .align 2, 0 +_08115700: .4byte 0x03005e00 +_08115704: .4byte 0x0203841e +_08115708: .4byte 0x02022e20 +_0811570C: .4byte 0x02022e22 +_08115710: + ldr r1, _08115724 + ldrh r0, [r2, 0xA] + strh r0, [r1] + ldr r1, _08115728 + ldrh r0, [r2, 0xC] + strh r0, [r1] +_0811571C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08115724: .4byte 0x02022e20 +_08115728: .4byte 0x02022e22 + thumb_func_end sub_81156D0 + + thumb_func_start sub_811572C +sub_811572C: @ 811572C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08115764 + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldr r0, _08115768 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0811576C + ldrh r0, [r5, 0x6] + negs r0, r0 + strh r0, [r4, 0x30] + movs r0, 0x1 + strh r0, [r4, 0x36] + b _0811577A + .align 2, 0 +_08115764: .4byte 0x0203841e +_08115768: .4byte 0x02038436 +_0811576C: + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + strh r1, [r4, 0x36] + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start +_0811577A: + ldr r0, _08115790 + ldrh r0, [r0, 0x8] + strh r0, [r4, 0x34] + ldr r1, _08115794 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115790: .4byte 0x0203841e +_08115794: .4byte sub_8115798 + 1 + thumb_func_end sub_811572C + + thumb_func_start sub_8115798 +sub_8115798: @ 8115798 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x1E + bl cosine + strh r0, [r4, 0x24] + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r1, 0xA + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + cmp r0, 0x7F + bhi _081157CA + ldrb r0, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x5] + b _081157D2 +_081157CA: + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] +_081157D2: + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x34 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _081157F6 + adds r0, r4, 0 + bl move_anim_8072740 +_081157F6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8115798 + + thumb_func_start sub_81157FC +sub_81157FC: @ 81157FC + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, _08115834 + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_811583C + movs r1, 0x2 + ldrsb r1, [r4, r1] + ldrb r2, [r4, 0x4] + ldrb r3, [r4, 0x6] + ldrh r4, [r4, 0x8] + str r4, [sp] + bl sub_80A1AD4 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08115838 + str r0, [r5, 0x1C] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115834: .4byte 0x0203841e +_08115838: .4byte sub_8115884 + 1 + thumb_func_end sub_81157FC + + thumb_func_start sub_811583C +sub_811583C: @ 811583C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + movs r4, 0x1 + mov r8, r0 + mov r1, r8 + ands r1, r4 + mov r8, r1 + lsls r0, 16 + asrs r1, r0, 17 + ands r1, r4 + asrs r2, r0, 18 + ands r2, r4 + asrs r3, r0, 19 + ands r3, r4 + asrs r6, r0, 20 + ands r6, r4 + asrs r5, r0, 21 + ands r5, r4 + asrs r0, 22 + ands r0, r4 + str r6, [sp] + str r5, [sp, 0x4] + str r0, [sp, 0x8] + mov r0, r8 + bl sub_80A75AC + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811583C + + thumb_func_start sub_8115884 +sub_8115884: @ 8115884 + push {lr} + adds r2, r0, 0 + ldr r0, _081158A0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811589A + adds r0, r2, 0 + bl move_anim_8072740 +_0811589A: + pop {r0} + bx r0 + .align 2, 0 +_081158A0: .4byte 0x02037fd4 + thumb_func_end sub_8115884 + + thumb_func_start sub_81158A4 +sub_81158A4: @ 81158A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081158F0 + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x32] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x34] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x36] + ldrh r0, [r4, 0xA] + strh r0, [r5, 0x38] + ldrh r0, [r4, 0xC] + strh r0, [r5, 0x3A] + ldrh r0, [r4] + strh r0, [r5, 0x3C] + movs r1, 0x3C + ldrsh r0, [r5, r1] + bl sub_811583C + ldrb r1, [r4, 0x8] + ldrh r2, [r4, 0x6] + bl sub_80A2A20 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _081158F4 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081158F0: .4byte 0x0203841e +_081158F4: .4byte sub_81158F8 + 1 + thumb_func_end sub_81158A4 + + thumb_func_start sub_81158F8 +sub_81158F8: @ 81158F8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0811590C + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + b _0811597C +_0811590C: + ldr r0, _08115928 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811597C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08115930 + ldr r0, _0811592C + str r0, [r4, 0x1C] + b _0811597C + .align 2, 0 +_08115928: .4byte 0x02037fd4 +_0811592C: .4byte sub_8115984 + 1 +_08115930: + movs r2, 0x3C + ldrsh r0, [r4, r2] + bl sub_811583C + adds r3, r0, 0 + ldrh r1, [r4, 0x30] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08115956 + ldrh r1, [r4, 0x36] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x34] + adds r0, r3, 0 + bl sub_80A2A20 + b _08115964 +_08115956: + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x38] + adds r0, r3, 0 + bl sub_80A2A20 +_08115964: + ldrh r0, [r4, 0x30] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + eors r0, r1 + strh r0, [r4, 0x30] + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x32] + subs r0, 0x1 + strh r0, [r4, 0x32] +_0811597C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81158F8 + + thumb_func_start sub_8115984 +sub_8115984: @ 8115984 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081159B0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081159AA + movs r1, 0x3C + ldrsh r0, [r4, r1] + bl sub_811583C + movs r1, 0 + movs r2, 0 + bl sub_80A2A20 + adds r0, r4, 0 + bl move_anim_8072740 +_081159AA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081159B0: .4byte 0x02037fd4 + thumb_func_end sub_8115984 + + thumb_func_start sub_81159B4 +sub_81159B4: @ 81159B4 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _081159F8 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r2, 0 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r2, [r4, 0x2E] + movs r0, 0xA + strh r0, [r4, 0x30] + movs r0, 0x8 + strh r0, [r4, 0x32] + movs r0, 0x28 + strh r0, [r4, 0x34] + movs r0, 0x70 + strh r0, [r4, 0x36] + strh r2, [r4, 0x38] + ldr r1, _081159FC + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, _08115A00 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081159F8: .4byte 0x0203841e +_081159FC: .4byte move_anim_8074EE0 + 1 +_08115A00: .4byte sub_80A634C + 1 + thumb_func_end sub_81159B4 + + thumb_func_start sub_8115A04 +sub_8115A04: @ 8115A04 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08115A48 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r3, _08115A4C + ldrh r1, [r3] + movs r5, 0 + strh r1, [r4, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r4, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r4, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r4, 0xE] + ldrh r2, [r3, 0x8] + strh r2, [r4, 0x10] + ldrh r1, [r3, 0xA] + strh r1, [r4, 0x12] + strh r5, [r4, 0x18] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + bl sub_8115A54 + ldr r0, _08115A50 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115A48: .4byte 0x03005e00 +_08115A4C: .4byte 0x0203841e +_08115A50: .4byte sub_8115AA4 + 1 + thumb_func_end sub_8115A04 + + thumb_func_start sub_8115A54 +sub_8115A54: @ 8115A54 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, _08115AA0 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + bl sub_811583C + movs r1, 0xA + ldrsb r1, [r4, r1] + ldrh r2, [r4, 0x12] + str r2, [sp] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80A1AD4 + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x18] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x18] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08115AA0: .4byte 0x03005e00 + thumb_func_end sub_8115A54 + + thumb_func_start sub_8115AA4 +sub_8115AA4: @ 8115AA4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + ldr r0, _08115ADC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115B06 + ldr r1, _08115AE0 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0xC + ldrsh r0, [r3, r5] + adds r6, r1, 0 + adds r5, r2, 0 + cmp r0, 0 + ble _08115B00 + movs r1, 0x18 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08115AE4 + ldrb r1, [r3, 0xE] + ldrb r2, [r3, 0x10] + b _08115AE8 + .align 2, 0 +_08115ADC: .4byte 0x02037fd4 +_08115AE0: .4byte 0x03005e00 +_08115AE4: + ldrb r1, [r3, 0x10] + ldrb r2, [r3, 0xE] +_08115AE8: + adds r0, r5, r4 + lsls r0, 3 + adds r0, r6 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08115AF8 + movs r2, 0 +_08115AF8: + adds r0, r4, 0 + bl sub_8115A54 + b _08115B06 +_08115B00: + adds r0, r4, 0 + bl move_anim_task_del +_08115B06: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8115AA4 + + thumb_func_start sub_8115B0C +sub_8115B0C: @ 8115B0C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r3, _08115BB0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r3 + ldr r2, _08115BB4 + ldrh r1, [r2] + strh r1, [r0, 0x8] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0xE] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0x10] + ldrh r1, [r2, 0xA] + strh r1, [r0, 0x12] + strh r5, [r0, 0x18] + movs r4, 0 + ldr r0, _08115BB8 + ldrb r1, [r0] + mov r9, r3 + mov r8, r2 + cmp r5, r1 + bge _08115B74 + ldr r0, _08115BBC + ldrb r3, [r0] + ldr r7, _08115BC0 + movs r0, 0x1 + mov r12, r0 + adds r2, r1, 0 +_08115B5A: + cmp r4, r3 + beq _08115B6E + ldrb r1, [r7] + cmp r4, r1 + beq _08115B6E + adds r1, r4, 0 + adds r1, 0x10 + mov r0, r12 + lsls r0, r1 + orrs r5, r0 +_08115B6E: + adds r4, 0x1 + cmp r4, r2 + blt _08115B5A +_08115B74: + mov r2, r8 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _08115B82 + movs r0, 0xE + orrs r5, r0 +_08115B82: + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + add r4, r9 + lsrs r0, r5, 16 + strh r0, [r4, 0x1A] + movs r0, 0xFF + ands r5, r0 + strh r5, [r4, 0x1C] + ldrb r2, [r4, 0x10] + adds r0, r6, 0 + movs r1, 0 + bl sub_8115BC8 + ldr r0, _08115BC4 + str r0, [r4] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08115BB0: .4byte 0x03005e00 +_08115BB4: .4byte 0x0203841e +_08115BB8: .4byte 0x0202406c +_08115BBC: .4byte 0x02038436 +_08115BC0: .4byte 0x02038437 +_08115BC4: .4byte sub_8115C18 + 1 + thumb_func_end sub_8115B0C + + thumb_func_start sub_8115BC8 +sub_8115BC8: @ 8115BC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _08115C14 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x1A] + lsls r0, 16 + ldrh r1, [r4, 0x1C] + orrs r0, r1 + movs r1, 0xA + ldrsb r1, [r4, r1] + ldrh r2, [r4, 0x12] + str r2, [sp] + adds r2, r5, 0 + bl sub_80A1AD4 + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x18] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x18] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115C14: .4byte 0x03005e00 + thumb_func_end sub_8115BC8 + + thumb_func_start sub_8115C18 +sub_8115C18: @ 8115C18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + ldr r0, _08115C50 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115C7A + ldr r1, _08115C54 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0xC + ldrsh r0, [r3, r5] + adds r6, r1, 0 + adds r5, r2, 0 + cmp r0, 0 + ble _08115C74 + movs r1, 0x18 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08115C58 + ldrb r1, [r3, 0xE] + ldrb r2, [r3, 0x10] + b _08115C5C + .align 2, 0 +_08115C50: .4byte 0x02037fd4 +_08115C54: .4byte 0x03005e00 +_08115C58: + ldrb r1, [r3, 0x10] + ldrb r2, [r3, 0xE] +_08115C5C: + adds r0, r5, r4 + lsls r0, 3 + adds r0, r6 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08115C6C + movs r2, 0 +_08115C6C: + adds r0, r4, 0 + bl sub_8115BC8 + b _08115C7A +_08115C74: + adds r0, r4, 0 + bl move_anim_task_del +_08115C7A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8115C18 + + thumb_func_start sub_8115C80 +sub_8115C80: @ 8115C80 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08115CC4 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r3, _08115CC8 + ldrh r1, [r3] + movs r5, 0 + strh r1, [r4, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r4, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r4, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r4, 0xE] + ldrh r2, [r3, 0x8] + strh r2, [r4, 0x10] + ldrh r1, [r3, 0xA] + strh r1, [r4, 0x12] + strh r5, [r4, 0x18] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + bl sub_8115CD0 + ldr r0, _08115CCC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115CC4: .4byte 0x03005e00 +_08115CC8: .4byte 0x0203841e +_08115CCC: .4byte sub_8115D2C + 1 + thumb_func_end sub_8115C80 + + thumb_func_start sub_8115CD0 +sub_8115CD0: @ 8115CD0 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, _08115D28 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x8] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r2, 0x1 + lsls r2, r0 + movs r1, 0xA + ldrsb r1, [r4, r1] + ldrh r0, [r4, 0x12] + str r0, [sp] + adds r0, r2, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80A1AD4 + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x18] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x18] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08115D28: .4byte 0x03005e00 + thumb_func_end sub_8115CD0 + + thumb_func_start sub_8115D2C +sub_8115D2C: @ 8115D2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + ldr r0, _08115D64 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115D8E + ldr r1, _08115D68 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0xC + ldrsh r0, [r3, r5] + adds r6, r1, 0 + adds r5, r2, 0 + cmp r0, 0 + ble _08115D88 + movs r1, 0x18 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08115D6C + ldrb r1, [r3, 0xE] + ldrb r2, [r3, 0x10] + b _08115D70 + .align 2, 0 +_08115D64: .4byte 0x02037fd4 +_08115D68: .4byte 0x03005e00 +_08115D6C: + ldrb r1, [r3, 0x10] + ldrb r2, [r3, 0xE] +_08115D70: + adds r0, r5, r4 + lsls r0, 3 + adds r0, r6 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08115D80 + movs r2, 0 +_08115D80: + adds r0, r4, 0 + bl sub_8115CD0 + b _08115D8E +_08115D88: + adds r0, r4, 0 + bl move_anim_task_del +_08115D8E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8115D2C + + thumb_func_start sub_8115D94 +sub_8115D94: @ 8115D94 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08115DF4 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r5, _08115DF8 + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x8] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x10] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x12] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r5] + strh r0, [r4, 0x16] + ldrh r0, [r5] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + ldrb r3, [r5, 0x8] + ldrh r0, [r5, 0x6] + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A1AD4 + ldr r0, _08115DFC + str r0, [r4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115DF4: .4byte 0x03005e00 +_08115DF8: .4byte 0x0203841e +_08115DFC: .4byte sub_8115E00 + 1 + thumb_func_end sub_8115D94 + + thumb_func_start sub_8115E00 +sub_8115E00: @ 8115E00 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08115E24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08115E28 + subs r0, r1, 0x1 + strh r0, [r4, 0x8] + b _08115EAC + .align 2, 0 +_08115E24: .4byte 0x03005e00 +_08115E28: + ldr r0, _08115E44 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115EAC + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _08115E4C + ldr r0, _08115E48 + str r0, [r4] + b _08115EAC + .align 2, 0 +_08115E44: .4byte 0x02037fd4 +_08115E48: .4byte sub_8115EB8 + 1 +_08115E4C: + ldrh r0, [r4, 0x16] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r2, 0x1 + lsls r2, r0 + ldrh r1, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08115E7A + ldrb r3, [r4, 0x10] + ldrh r0, [r4, 0xE] + str r0, [sp] + adds r0, r2, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A1AD4 + b _08115E8A +_08115E7A: + ldrb r3, [r4, 0x14] + ldrh r0, [r4, 0x12] + str r0, [sp] + adds r0, r2, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A1AD4 +_08115E8A: + ldr r0, _08115EB4 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + eors r0, r2 + strh r0, [r1, 0xA] + movs r2, 0xFF + ands r0, r2 + strh r0, [r1, 0x8] + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] +_08115EAC: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115EB4: .4byte 0x03005e00 + thumb_func_end sub_8115E00 + + thumb_func_start sub_8115EB8 +sub_8115EB8: @ 8115EB8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08115F08 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08115EFE + ldr r1, _08115F0C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x16] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + str r5, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A1AD4 + adds r0, r4, 0 + bl move_anim_task_del +_08115EFE: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08115F08: .4byte 0x02037fd4 +_08115F0C: .4byte 0x03005e00 + thumb_func_end sub_8115EB8 + + thumb_func_start sub_8115F10 +sub_8115F10: @ 8115F10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0 + ldr r0, _08115F88 + ldrb r6, [r0] + ldr r0, _08115F8C + ldrb r7, [r0] + ldr r4, _08115F90 + ldrh r1, [r4] + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08115F4A + str r2, [sp] + str r2, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r3, 0 + bl sub_80A75AC + adds r2, r0, 0 +_08115F4A: + ldrh r1, [r4, 0x2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08115F5C + movs r0, 0x80 + lsls r0, 9 + lsls r0, r6 + orrs r2, r0 +_08115F5C: + ldrh r1, [r4, 0x4] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08115F6E + movs r0, 0x80 + lsls r0, 9 + lsls r0, r7 + orrs r2, r0 +_08115F6E: + adds r0, r2, 0 + bl sub_80A2218 + mov r0, r8 + bl move_anim_task_del + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08115F88: .4byte 0x02038436 +_08115F8C: .4byte 0x02038437 +_08115F90: .4byte 0x0203841e + thumb_func_end sub_8115F10 + + thumb_func_start sub_8115F94 +sub_8115F94: @ 8115F94 + 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 r1, _08116088 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08115FD6 + ldr r1, _0811608C + ldrh r0, [r1] + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xE] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x10] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0xA] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x12] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r1, 0xC] + strh r0, [r4, 0x16] +_08115FD6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, _08116090 + ldrb r0, [r0] + mov r9, r0 + ldr r0, _08116094 + ldrb r0, [r0] + mov r10, r0 + ldrh r1, [r4, 0xC] + movs r7, 0x80 + lsls r7, 1 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08115FF8 + ldr r5, _08116098 +_08115FF8: + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08116028 + ldr r2, _0811609C + ldr r0, _081160A0 + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x14 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x2] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r1, r6, 0 + lsls r1, r0 + lsls r1, 16 + orrs r5, r1 +_08116028: + ldrh r1, [r4, 0xE] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0811603C + adds r0, r6, 0 + mov r2, r9 + lsls r0, r2 + lsls r0, 16 + orrs r5, r0 +_0811603C: + ldrh r1, [r4, 0x10] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08116050 + adds r0, r6, 0 + mov r1, r10 + lsls r0, r1 + lsls r0, 16 + orrs r5, r0 +_08116050: + movs r1, 0x12 + ldrsb r1, [r4, r1] + movs r2, 0x14 + ldrsb r2, [r4, r2] + movs r3, 0x16 + ldrsb r3, [r4, r3] + adds r0, r5, 0 + bl sub_80A2260 + movs r2, 0x8 + ldrsh r1, [r4, r2] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0811607A + adds r0, r5, 0 + bl sub_80A2334 + mov r0, r8 + bl move_anim_task_del +_0811607A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08116088: .4byte 0x03005e00 +_0811608C: .4byte 0x0203841e +_08116090: .4byte 0x02038436 +_08116094: .4byte 0x02038437 +_08116098: .4byte 0x0000ffff +_0811609C: .4byte 0x02020630 +_081160A0: .4byte 0x03005d70 + thumb_func_end sub_8115F94 + + thumb_func_start sub_81160A4 +sub_81160A4: @ 81160A4 + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, _081160D8 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x34] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _081160EC + cmp r0, 0x1 + bgt _081160DC + cmp r0, 0 + beq _081160E2 + b _08116104 + .align 2, 0 +_081160D8: .4byte 0x0203841e +_081160DC: + cmp r0, 0x2 + beq _081160F4 + b _08116104 +_081160E2: + ldr r1, _081160E8 + b _081160F6 + .align 2, 0 +_081160E8: .4byte 0x02022e20 +_081160EC: + ldr r1, _081160F0 + b _081160F6 + .align 2, 0 +_081160F0: .4byte 0x02022e22 +_081160F4: + ldr r1, _08116100 +_081160F6: + adds r0, r4, 0 + bl oamt_set_x3A_32 + b _0811610C + .align 2, 0 +_08116100: .4byte 0x02021bbc +_08116104: + ldr r1, _0811613C + adds r0, r4, 0 + bl oamt_set_x3A_32 +_0811610C: + movs r0, 0x3A + ldrsh r1, [r4, r0] + movs r2, 0x3C + ldrsh r0, [r4, r2] + lsls r0, 16 + orrs r1, r0 + ldrh r0, [r1] + strh r0, [r4, 0x36] + ldr r0, _08116140 + ldrh r0, [r0, 0x6] + strh r0, [r4, 0x38] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08116130 + bl sub_81161F4 +_08116130: + ldr r0, _08116144 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811613C: .4byte 0x02021bbe +_08116140: .4byte 0x0203841e +_08116144: .4byte sub_8116148 + 1 + thumb_func_end sub_81160A4 + + thumb_func_start sub_8116148 +sub_8116148: @ 8116148 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x34] + movs r2, 0x34 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _0811618A + subs r0, r1, 0x1 + strh r0, [r3, 0x34] + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _0811616A + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + b _081161E2 +_0811616A: + ldrh r0, [r3, 0x32] + strh r0, [r3, 0x30] + movs r0, 0x3A + ldrsh r1, [r3, r0] + movs r2, 0x3C + ldrsh r0, [r3, r2] + lsls r0, 16 + orrs r1, r0 + ldrh r0, [r3, 0x2E] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + ldrh r0, [r3, 0x2E] + negs r0, r0 + strh r0, [r3, 0x2E] + b _081161E2 +_0811618A: + movs r0, 0x3A + ldrsh r1, [r3, r0] + movs r2, 0x3C + ldrsh r0, [r3, r2] + lsls r0, 16 + orrs r1, r0 + ldrh r0, [r3, 0x36] + strh r0, [r1] + ldrh r0, [r3, 0x38] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081161DC + movs r4, 0 + ldr r5, _081161E8 + ldrb r0, [r5] + cmp r4, r0 + bcs _081161DC + ldr r2, _081161EC + mov r12, r2 + ldr r6, _081161F0 + movs r7, 0x3 + negs r7, r7 +_081161BA: + adds r0, r4, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5] + cmp r4, r0 + bcc _081161BA +_081161DC: + adds r0, r3, 0 + bl move_anim_8072740 +_081161E2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081161E8: .4byte 0x0202406c +_081161EC: .4byte 0x02020630 +_081161F0: .4byte 0x020241e4 + thumb_func_end sub_8116148 + + thumb_func_start sub_81161F4 +sub_81161F4: @ 81161F4 + push {r4-r6,lr} + ldr r6, _08116268 + ldr r4, _0811626C + ldr r5, _08116270 + ldrb r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x3 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r3, _08116274 + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + ldr r0, _08116278 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + bne _0811627C + ldrb r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + b _08116298 + .align 2, 0 +_08116268: .4byte 0x02020630 +_0811626C: .4byte 0x020241e4 +_08116270: .4byte 0x02038436 +_08116274: .4byte 0x02038437 +_08116278: .4byte 0x0203841e +_0811627C: + cmp r0, 0 + bne _08116284 + ldrb r0, [r5] + b _08116286 +_08116284: + ldrb r0, [r3] +_08116286: + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 +_08116298: + orrs r1, r2 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81161F4 + + thumb_func_start sub_81162A4 +sub_81162A4: @ 81162A4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081162E4 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldr r3, _081162E8 + ldrh r1, [r3] + strh r1, [r2, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r2, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r2, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r2, 0xE] + ldrh r1, [r3, 0x6] + strh r1, [r2, 0x18] + ldr r4, _081162EC + ldrh r1, [r3] + strh r1, [r4] + ldr r4, _081162F0 + ldrh r1, [r3, 0x2] + strh r1, [r4] + ldr r1, _081162F4 + str r1, [r2] + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081162E4: .4byte 0x03005e00 +_081162E8: .4byte 0x0203841e +_081162EC: .4byte 0x02022e20 +_081162F0: .4byte 0x02022e22 +_081162F4: .4byte sub_81162F8 + 1 + thumb_func_end sub_81162A4 + + thumb_func_start sub_81162F8 +sub_81162F8: @ 81162F8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08116328 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r1 + ldrh r2, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + mov r12, r1 + cmp r0, 0 + bne _0811637E + ldr r0, _0811632C + ldrh r2, [r0] + movs r7, 0x8 + ldrsh r1, [r3, r7] + adds r6, r0, 0 + cmp r2, r1 + bne _08116330 + ldrh r0, [r3, 0x8] + negs r0, r0 + b _08116332 + .align 2, 0 +_08116328: .4byte 0x03005e00 +_0811632C: .4byte 0x02022e20 +_08116330: + ldrh r0, [r3, 0x8] +_08116332: + strh r0, [r6] + ldr r2, _08116350 + ldrh r3, [r2] + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + mov r7, r12 + adds r4, r0, r7 + movs r7, 0xA + ldrsh r0, [r4, r7] + cmn r3, r0 + bne _08116354 + movs r0, 0 + b _08116358 + .align 2, 0 +_08116350: .4byte 0x02022e22 +_08116354: + ldrh r0, [r4, 0xA] + negs r0, r0 +_08116358: + strh r0, [r2] + adds r0, r1, r5 + lsls r0, 3 + add r0, r12 + ldrh r1, [r0, 0x18] + strh r1, [r0, 0xE] + ldrh r1, [r0, 0xC] + subs r1, 0x1 + strh r1, [r0, 0xC] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + bne _08116382 + strh r1, [r6] + strh r1, [r2] + adds r0, r5, 0 + bl move_anim_task_del + b _08116382 +_0811637E: + subs r0, r2, 0x1 + strh r0, [r3, 0xE] +_08116382: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81162F8 + + thumb_func_start sub_8116388 +sub_8116388: @ 8116388 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081163A8 + ldrb r1, [r4, 0x6] + bl sub_8008258 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081163AC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _081163B4 + .align 2, 0 +_081163A8: .4byte 0x0203841e +_081163AC: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_081163B4: + ldr r0, _081163C8 + str r0, [r5, 0x1C] + ldr r1, _081163CC + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081163C8: .4byte sub_80A67BC + 1 +_081163CC: .4byte move_anim_8072740 + 1 + thumb_func_end sub_8116388 + + thumb_func_start sub_81163D0 +sub_81163D0: @ 81163D0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081163F0 + ldrb r1, [r4, 0x6] + bl sub_8008258 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081163F4 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _081163FC + .align 2, 0 +_081163F0: .4byte 0x0203841e +_081163F4: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_081163FC: + ldr r0, _08116414 + ldrh r0, [r0, 0x8] + strh r0, [r5, 0x2E] + ldr r0, _08116418 + str r0, [r5, 0x1C] + ldr r1, _0811641C + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08116414: .4byte 0x0203841e +_08116418: .4byte sub_80A67BC + 1 +_0811641C: .4byte sub_810E2C8 + 1 + thumb_func_end sub_81163D0 + + thumb_func_start sub_8116420 +sub_8116420: @ 8116420 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08116450 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08116444 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116444 + ldr r1, _08116454 + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_08116444: + adds r0, r4, 0 + bl sub_8116388 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08116450: .4byte 0x02038436 +_08116454: .4byte 0x0203841e + thumb_func_end sub_8116420 + + thumb_func_start sub_8116458 +sub_8116458: @ 8116458 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08116490 + movs r0, 0x2 + ldrsh r1, [r5, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08116474 + bl GenerateRandomNumber2 + movs r1, 0x3 + ands r1, r0 + strh r1, [r5, 0x2] +_08116474: + ldrb r1, [r5, 0x2] + adds r0, r4, 0 + bl sub_8008258 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08116494 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + b _0811649C + .align 2, 0 +_08116490: .4byte 0x0203841e +_08116494: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 +_0811649C: + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x30 + bl __umodsi3 + ldr r1, _081164E0 + adds r0, r1 + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x18 + bl __umodsi3 + ldr r1, _081164E4 + adds r0, r1 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldr r1, _081164E8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _081164EC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081164E0: .4byte 0x0000ffe8 +_081164E4: .4byte 0x0000fff4 +_081164E8: .4byte move_anim_8074EE0 + 1 +_081164EC: .4byte sub_80A67BC + 1 + thumb_func_end sub_8116458 + + thumb_func_start sub_81164F0 +sub_81164F0: @ 81164F0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08116550 + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08116554 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + ldrh r0, [r0, 0x20] + adds r1, r0 + strh r1, [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, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + strh r1, [r4, 0x22] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x26] + ldrb r1, [r5, 0x6] + adds r0, r4, 0 + bl sub_8008258 + ldr r1, _08116558 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0811655C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08116550: .4byte 0x0203841e +_08116554: .4byte 0x02020630 +_08116558: .4byte move_anim_8074EE0 + 1 +_0811655C: .4byte sub_80A67BC + 1 + thumb_func_end sub_81164F0 + + thumb_func_start sub_8116560 +sub_8116560: @ 8116560 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08116578 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0811657C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + b _08116584 + .align 2, 0 +_08116578: .4byte 0x0203841e +_0811657C: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 +_08116584: + ldr r0, _0811659C + ldrh r0, [r0, 0x6] + strh r0, [r4, 0x2E] + ldr r1, _081165A0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _081165A4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811659C: .4byte 0x0203841e +_081165A0: .4byte move_anim_8072740 + 1 +_081165A4: .4byte sub_80A64B0 + 1 + thumb_func_end sub_8116560 + + thumb_func_start sub_81165A8 +sub_81165A8: @ 81165A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081165C8 + ldrb r1, [r4, 0x6] + bl sub_8008258 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081165CC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _081165D4 + .align 2, 0 +_081165C8: .4byte 0x0203841e +_081165CC: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_081165D4: + ldr r0, _081165E0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081165E0: .4byte sub_81165E4 + 1 + thumb_func_end sub_81165A8 + + thumb_func_start sub_81165E4 +sub_81165E4: @ 81165E4 + push {lr} + adds r3, r0, 0 + 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] + ldrh r0, [r3, 0x2E] + adds r1, r0, 0x1 + strh r1, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0811661A + adds r0, r3, 0 + bl move_anim_8072740 +_0811661A: + pop {r0} + bx r0 + thumb_func_end sub_81165E4 + + thumb_func_start sub_8116620 +sub_8116620: @ 8116620 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, _08116660 + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_811583C + adds r6, r0, 0 + ldrh r3, [r4] + lsls r3, 16 + asrs r0, r3, 23 + movs r4, 0x1 + ands r0, r4 + asrs r1, r3, 24 + ands r1, r4 + asrs r2, r3, 25 + ands r2, r4 + asrs r3, 26 + ands r3, r4 + bl sub_80A76C4 + orrs r6, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8116874 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08116660: .4byte 0x0203841e + thumb_func_end sub_8116620 + + thumb_func_start sub_8116664 +sub_8116664: @ 8116664 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x1] + movs r0, 0x1 + bl sub_811583C + adds r5, r0, 0 + ldr r0, _08116690 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + bhi _0811670E + lsls r0, 2 + ldr r1, _08116694 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08116690: .4byte 0x0203841e +_08116694: .4byte _08116698 + .align 2, 0 +_08116698: + .4byte _081166BA + .4byte _081166C6 + .4byte _081166B8 + .4byte _081166C4 + .4byte _081166D4 + .4byte _081166EC + .4byte _081166F4 + .4byte _08116700 +_081166B8: + movs r5, 0 +_081166BA: + mov r0, sp + ldr r1, _081166C0 + b _081166CA + .align 2, 0 +_081166C0: .4byte 0x02038436 +_081166C4: + movs r5, 0 +_081166C6: + mov r0, sp + ldr r1, _081166D0 +_081166CA: + ldrb r1, [r1] + strb r1, [r0] + b _0811670E + .align 2, 0 +_081166D0: .4byte 0x02038437 +_081166D4: + mov r1, sp + ldr r0, _081166E4 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, _081166E8 + ldrb r0, [r0] + strb r0, [r1, 0x1] + b _0811670E + .align 2, 0 +_081166E4: .4byte 0x02038436 +_081166E8: .4byte 0x02038437 +_081166EC: + mov r1, sp + movs r0, 0xFF + strb r0, [r1] + b _0811670E +_081166F4: + movs r5, 0 + mov r2, sp + ldr r0, _081166FC + b _08116706 + .align 2, 0 +_081166FC: .4byte 0x02038436 +_08116700: + movs r5, 0 + mov r2, sp + ldr r0, _08116758 +_08116706: + ldrb r0, [r0] + movs r1, 0x2 + eors r0, r1 + strb r0, [r2] +_0811670E: + movs r4, 0 + mov r6, sp +_08116712: + ldrb r0, [r6] + cmp r4, r0 + beq _0811673C + ldrb r0, [r6, 0x1] + cmp r4, r0 + beq _0811673C + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811673C + adds r0, r4, 0 + bl sub_80A77AC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r0 + orrs r5, r1 +_0811673C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08116712 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_8116874 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08116758: .4byte 0x02038437 + thumb_func_end sub_8116664 + + thumb_func_start sub_811675C +sub_811675C: @ 811675C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08116780 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_811583C + adds r2, r0, 0 + ldr r0, _08116784 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _08116832 + lsls r0, 2 + ldr r1, _08116788 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08116780: .4byte 0x0203841e +_08116784: .4byte 0x02022ff0 +_08116788: .4byte _0811678C + .align 2, 0 +_0811678C: + .4byte _081167B4 + .4byte _081167C4 + .4byte _081167D0 + .4byte _081167E0 + .4byte _081167EC + .4byte _081167FC + .4byte _0811680C + .4byte _0811681C + .4byte _0811682C + .4byte _0811682C +_081167B4: + ldr r1, _081167BC + ldr r0, _081167C0 + b _08116830 + .align 2, 0 +_081167BC: .4byte 0x0203841e +_081167C0: .4byte 0x00000b0c +_081167C4: + ldr r1, _081167CC + movs r0, 0x9E + lsls r0, 4 + b _08116830 + .align 2, 0 +_081167CC: .4byte 0x0203841e +_081167D0: + ldr r1, _081167D8 + ldr r0, _081167DC + b _08116830 + .align 2, 0 +_081167D8: .4byte 0x0203841e +_081167DC: .4byte 0x00002f1e +_081167E0: + ldr r1, _081167E8 + movs r0, 0x90 + lsls r0, 7 + b _08116830 + .align 2, 0 +_081167E8: .4byte 0x0203841e +_081167EC: + ldr r1, _081167F4 + ldr r0, _081167F8 + b _08116830 + .align 2, 0 +_081167F4: .4byte 0x0203841e +_081167F8: .4byte 0x00007ecb +_081167FC: + ldr r1, _08116804 + ldr r0, _08116808 + b _08116830 + .align 2, 0 +_08116804: .4byte 0x0203841e +_08116808: .4byte 0x00007ecb +_0811680C: + ldr r1, _08116814 + ldr r0, _08116818 + b _08116830 + .align 2, 0 +_08116814: .4byte 0x0203841e +_08116818: .4byte 0x00002a16 +_0811681C: + ldr r1, _08116824 + ldr r0, _08116828 + b _08116830 + .align 2, 0 +_08116824: .4byte 0x0203841e +_08116828: .4byte 0x00000d2e +_0811682C: + ldr r1, _08116840 + ldr r0, _08116844 +_08116830: + strh r0, [r1, 0x8] +_08116832: + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_8116874 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08116840: .4byte 0x0203841e +_08116844: .4byte 0x00007fff + thumb_func_end sub_811675C + + thumb_func_start sub_8116848 +sub_8116848: @ 8116848 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08116870 + ldrh r0, [r0] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + adds r0, r4, 0 + bl sub_8116874 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08116870: .4byte 0x0203841e + thumb_func_end sub_8116848 + + thumb_func_start sub_8116874 +sub_8116874: @ 8116874 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _081168AC + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + strh r1, [r2, 0x8] + lsrs r1, 16 + strh r1, [r2, 0xA] + ldr r3, _081168B0 + ldrh r1, [r3, 0x2] + strh r1, [r2, 0xC] + ldrh r1, [r3, 0x4] + strh r1, [r2, 0xE] + ldrh r1, [r3, 0x6] + strh r1, [r2, 0x10] + ldrh r1, [r3, 0x8] + strh r1, [r2, 0x12] + ldrh r1, [r3, 0x4] + strh r1, [r2, 0x1C] + ldr r1, _081168B4 + str r1, [r2] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_081168AC: .4byte 0x03005e00 +_081168B0: .4byte 0x0203841e +_081168B4: .4byte sub_81168B8 + 1 + thumb_func_end sub_8116874 + + thumb_func_start sub_81168B8 +sub_81168B8: @ 81168B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + ldr r2, _08116938 + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x1A] + mov r8, r0 + movs r4, 0x1A + ldrsh r1, [r3, r4] + movs r4, 0xC + ldrsh r0, [r3, r4] + mov r9, r2 + cmp r1, r0 + bne _0811694E + strh r6, [r3, 0x1A] + movs r0, 0x8 + ldrsh r4, [r3, r0] + movs r1, 0xA + ldrsh r0, [r3, r1] + lsls r0, 16 + orrs r4, r0 + mov r8, r5 + cmp r4, 0 + beq _0811691A + adds r5, r3, 0 +_081168F8: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0811690C + ldrb r2, [r5, 0x1C] + ldrh r3, [r5, 0x12] + adds r0, r6, 0 + movs r1, 0x10 + bl pal_fade_1 +_0811690C: + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + lsrs r4, 1 + cmp r4, 0 + bne _081168F8 +_0811691A: + mov r4, r8 + adds r0, r4, r7 + lsls r0, 3 + mov r1, r9 + adds r2, r0, r1 + ldrh r0, [r2, 0x1C] + movs r4, 0x1C + ldrsh r3, [r2, r4] + movs r4, 0x10 + ldrsh r1, [r2, r4] + cmp r3, r1 + bge _0811693C + adds r0, 0x1 + strh r0, [r2, 0x1C] + b _08116954 + .align 2, 0 +_08116938: .4byte 0x03005e00 +_0811693C: + cmp r3, r1 + ble _08116946 + subs r0, 0x1 + strh r0, [r2, 0x1C] + b _08116954 +_08116946: + adds r0, r7, 0 + bl move_anim_task_del + b _08116954 +_0811694E: + mov r0, r8 + adds r0, 0x1 + strh r0, [r3, 0x1A] +_08116954: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81168B8 + + thumb_func_start sub_8116960 +sub_8116960: @ 8116960 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, _08116994 + ldrb r0, [r4] + ldrb r1, [r4, 0x2] + ldrb r2, [r4, 0x4] + ldrb r3, [r4, 0x6] + ldrb r4, [r4, 0x8] + str r4, [sp] + bl sub_80A27B0 + ldr r1, _08116998 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0811699C + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08116994: .4byte 0x0203841e +_08116998: .4byte 0x03005e00 +_0811699C: .4byte sub_81169A0 + 1 + thumb_func_end sub_8116960 + + thumb_func_start sub_81169A0 +sub_81169A0: @ 81169A0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081169BC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081169B8 + adds r0, r2, 0 + bl move_anim_task_del +_081169B8: + pop {r0} + bx r0 + .align 2, 0 +_081169BC: .4byte 0x02037fd4 + thumb_func_end sub_81169A0 + + thumb_func_start sub_81169C0 +sub_81169C0: @ 81169C0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081169EC + adds r1, r0 + ldr r2, _081169F0 + ldrh r0, [r2] + movs r3, 0 + strh r0, [r1, 0x8] + strh r3, [r1, 0xA] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0xC] + ldrh r0, [r2, 0x4] + strh r0, [r1, 0xE] + ldrh r0, [r2, 0x6] + strh r0, [r1, 0x10] + strh r3, [r1, 0x12] + ldr r0, _081169F4 + str r0, [r1] + bx lr + .align 2, 0 +_081169EC: .4byte 0x03005e00 +_081169F0: .4byte 0x0203841e +_081169F4: .4byte sub_81169F8 + 1 + thumb_func_end sub_81169C0 + + thumb_func_start sub_81169F8 +sub_81169F8: @ 81169F8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08116A24 + adds r4, r0, r1 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08116ABC + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08116A28 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + b _08116ACA + .align 2, 0 +_08116A24: .4byte 0x03005e00 +_08116A28: + ldrb r0, [r4, 0x8] + bl duplicate_obj_of_side_rel2move_in_transparent_mode + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + blt _08116AA6 + ldr r6, _08116AB4 + movs r1, 0x14 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r3, r1, r6 + movs r2, 0x8 + ldrsh r0, [r4, r2] + movs r2, 0x2 + cmp r0, 0 + beq _08116A50 + movs r2, 0x1 +_08116A50: + lsls r2, 2 + ldrb r1, [r3, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x5] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r4, 0xE] + strh r1, [r0, 0x2E] + movs r2, 0x14 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r5, [r0, 0x30] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + strh r1, [r0, 0x32] + movs r2, 0x14 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _08116AB8 + str r1, [r0] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] +_08116AA6: + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0xA] + b _08116ACA + .align 2, 0 +_08116AB4: .4byte 0x02020630 +_08116AB8: .4byte sub_8116AD0 + 1 +_08116ABC: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08116ACA + adds r0, r2, 0 + bl move_anim_task_del +_08116ACA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81169F8 + + thumb_func_start sub_8116AD0 +sub_8116AD0: @ 8116AD0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08116AE4 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + b _08116B08 +_08116AE4: + ldr r3, _08116B10 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_08116B08: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08116B10: .4byte 0x03005e00 + thumb_func_end sub_8116AD0 + + thumb_func_start sub_8116B14 +sub_8116B14: @ 8116B14 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r0, _08116C3C + strh r7, [r0] + ldr r0, _08116C40 + strh r7, [r0] + ldr r1, _08116C44 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08116C48 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r1, _08116C4C + movs r0, 0x50 + bl lcd_io_set + ldr r1, _08116C50 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0xA + bl lcd_io_get + add r4, sp, 0x10 + strh r0, [r4] + ldrb r1, [r4] + movs r0, 0x4 + negs r0, r0 + mov r8, r0 + ands r0, r1 + strb r0, [r4] + mov r2, sp + adds r2, 0x11 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r1, [r4] + movs r0, 0xA + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116BA2 + ldrb r1, [r4] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrh r1, [r4] + movs r0, 0xA + bl lcd_io_set +_08116BA2: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08116C26 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116C26 + ldr r5, _08116C54 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08116BD2 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08116C26 +_08116BD2: + ldrb r0, [r5] + movs r6, 0x2 + eors r0, r6 + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08116C26 + ldr r3, _08116C58 + ldr r1, _08116C5C + ldrb r0, [r5] + eors r0, r6 + adds r0, r1 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldrb r1, [r4] + mov r0, r8 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] + ldrh r1, [r4] + movs r0, 0xA + bl lcd_io_set + movs r7, 0x1 +_08116C26: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08116C64 + ldr r0, _08116C60 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r5, [r0] + b _08116CAC + .align 2, 0 +_08116C3C: .4byte 0x02022e24 +_08116C40: .4byte 0x02022e26 +_08116C44: .4byte 0x00003f3f +_08116C48: .4byte 0x00003f3d +_08116C4C: .4byte 0x00003f42 +_08116C50: .4byte 0x00000c08 +_08116C54: .4byte 0x02038436 +_08116C58: .4byte 0x02020630 +_08116C5C: .4byte 0x020241e4 +_08116C60: .4byte 0x02039f34 +_08116C64: + ldr r4, _08116C84 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08116C90 + ldr r1, _08116C88 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08116C8C + b _08116CA0 + .align 2, 0 +_08116C84: .4byte 0x02038436 +_08116C88: .4byte 0x0202406e +_08116C8C: .4byte 0x02024744 +_08116C90: + ldr r1, _08116D38 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08116D3C +_08116CA0: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 +_08116CAC: + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08116D40 + ldrb r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A89C8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r0, sp + bl sub_80A6B30 + ldr r1, _08116D44 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _08116D48 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _08116D4C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + adds r1, 0x1 + movs r2, 0x2 + bl gpu_pal_apply + ldr r2, _08116D50 + ldr r0, _08116D54 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + negs r0, r0 + adds r0, 0x20 + strh r0, [r2] + ldr r2, _08116D58 + ldrh r0, [r1, 0x22] + negs r0, r0 + adds r0, 0x20 + strh r0, [r2] + ldr r1, _08116D5C + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + strh r7, [r0, 0x14] + ldr r1, _08116D60 + str r1, [r0] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08116D38: .4byte 0x0202406e +_08116D3C: .4byte 0x020244ec +_08116D40: .4byte 0x02038436 +_08116D44: .4byte 0x08c20684 +_08116D48: .4byte 0x08c20668 +_08116D4C: .4byte 0x08597418 +_08116D50: .4byte 0x02022e18 +_08116D54: .4byte 0x02020630 +_08116D58: .4byte 0x02022e1a +_08116D5C: .4byte 0x03005e00 +_08116D60: .4byte sub_8116D64 + 1 + thumb_func_end sub_8116B14 + + thumb_func_start sub_8116D64 +sub_8116D64: @ 8116D64 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, _08116E94 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x1C] + adds r0, 0x4 + movs r1, 0 + mov r8, r1 + strh r0, [r5, 0x1C] + ldr r7, _08116E98 + ldrh r2, [r7] + subs r1, r2, 0x4 + strh r1, [r7] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08116E86 + mov r0, r8 + strh r0, [r5, 0x1C] + adds r0, r2, 0 + adds r0, 0x3C + strh r0, [r7] + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08116E86 + movs r0, 0 + bl sub_80A477C + ldr r0, _08116E9C + mov r1, r8 + strh r1, [r0] + ldr r0, _08116EA0 + strh r1, [r0] + ldr r4, _08116EA4 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116DF6 + movs r0, 0xA + bl lcd_io_get + add r1, sp, 0x10 + strh r0, [r1] + ldrb r2, [r1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrh r1, [r1] + movs r0, 0xA + bl lcd_io_set +_08116DF6: + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r4, _08116EA8 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08116E7C + ldr r2, _08116EAC + ldr r0, _08116EB0 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + adds r0, r2 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] +_08116E7C: + mov r2, r8 + strh r2, [r7] + adds r0, r6, 0 + bl move_anim_task_del +_08116E86: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08116E94: .4byte 0x03005e00 +_08116E98: .4byte 0x02022e1a +_08116E9C: .4byte 0x02022e24 +_08116EA0: .4byte 0x02022e26 +_08116EA4: .4byte 0x00003f3f +_08116EA8: .4byte 0x02020630 +_08116EAC: .4byte 0x020241e4 +_08116EB0: .4byte 0x02038436 + thumb_func_end sub_8116D64 + + thumb_func_start sub_8116EB4 +sub_8116EB4: @ 8116EB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08116EF4 + movs r0, 0x18 + bl malloc_and_clear + str r0, [r4] + movs r2, 0 + ldr r3, _08116EF8 +_08116EC8: + ldr r1, [r4] + lsls r0, r2, 1 + adds r1, 0x4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _08116EC8 + ldr r0, _08116EFC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _08116F00 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08116EF4: .4byte 0x0203a110 +_08116EF8: .4byte 0x0203841e +_08116EFC: .4byte 0x03005e00 +_08116F00: .4byte sub_8116F04 + 1 + thumb_func_end sub_8116EB4 + + thumb_func_start sub_8116F04 +sub_8116F04: @ 8116F04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08116F1C + ldr r1, [r0] + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08116F24 + ldr r0, _08116F20 + b _08116F26 + .align 2, 0 +_08116F1C: .4byte 0x0203a110 +_08116F20: .4byte 0x02038436 +_08116F24: + ldr r0, _08117050 +_08116F26: + ldrb r0, [r0] + strb r0, [r1] + ldr r4, _08117054 + ldr r2, [r4] + ldrb r0, [r2] + movs r1, 0x2 + eors r0, r1 + strb r0, [r2, 0x1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116F56 + ldr r1, [r4] + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08116F5C + ldrb r0, [r1, 0x1] + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08116F5C +_08116F56: + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0xA] +_08116F5C: + ldr r0, _08117058 + movs r1, 0 + strh r1, [r0] + ldr r0, _0811705C + strh r1, [r0] + ldr r1, _08117060 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08117064 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r1, _08117068 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116FBA + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_08116FBA: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08117036 + ldr r4, _08117054 + ldr r1, [r4] + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08117036 + ldrb r0, [r1] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08116FEC + ldr r0, [r4] + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08117036 +_08116FEC: + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08117036 + ldr r3, _0811706C + ldr r1, _08117070 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + adds r0, r1 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, [r4] + strb r5, [r0, 0x2] +_08117036: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08117078 + ldr r0, _08117054 + ldr r1, [r0] + ldr r0, _08117074 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + b _081170C4 + .align 2, 0 +_08117050: .4byte 0x02038437 +_08117054: .4byte 0x0203a110 +_08117058: .4byte 0x02022e24 +_0811705C: .4byte 0x02022e26 +_08117060: .4byte 0x00003f3f +_08117064: .4byte 0x00003f3d +_08117068: .4byte 0x00003f42 +_0811706C: .4byte 0x02020630 +_08117070: .4byte 0x020241e4 +_08117074: .4byte 0x02039f34 +_08117078: + ldr r4, _0811709C + ldr r0, [r4] + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081170A8 + ldr r1, _081170A0 + ldr r0, [r4] + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081170A4 + b _081170BA + .align 2, 0 +_0811709C: .4byte 0x0203a110 +_081170A0: .4byte 0x0202406e +_081170A4: .4byte 0x02024744 +_081170A8: + ldr r1, _081170DC + ldr r0, [r4] + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081170E0 +_081170BA: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + ldr r1, [r4] +_081170C4: + strh r0, [r1, 0x14] + ldr r0, _081170E4 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081170E8 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081170DC: .4byte 0x0202406e +_081170E0: .4byte 0x020244ec +_081170E4: .4byte 0x03005e00 +_081170E8: .4byte sub_81170EC + 1 + thumb_func_end sub_8116F04 + + thumb_func_start sub_81170EC +sub_81170EC: @ 81170EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r6, _0811714C + ldr r4, _08117150 + ldr r2, [r4] + ldrb r0, [r2] + adds r1, r0, r6 + ldrb r1, [r1] + ldrh r2, [r2, 0x14] + bl sub_80A89C8 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, [r4] + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0811712E + ldrb r0, [r2, 0x1] + adds r1, r0, r6 + ldrb r1, [r1] + ldrh r2, [r2, 0x14] + bl sub_80A89C8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_0811712E: + mov r0, sp + bl sub_80A6B30 + ldr r0, [r4] + movs r4, 0x4 + ldrsh r0, [r0, r4] + cmp r0, 0 + bne _08117158 + ldr r1, _08117154 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + b _08117162 + .align 2, 0 +_0811714C: .4byte 0x020241e4 +_08117150: .4byte 0x0203a110 +_08117154: .4byte 0x08c2d930 +_08117158: + ldr r1, _08117188 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 +_08117162: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _0811718C + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _08117190 + ldr r0, [r0] + movs r1, 0x6 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + bhi _081171F8 + lsls r0, 2 + ldr r1, _08117194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08117188: .4byte 0x08c2da4c +_0811718C: .4byte 0x08c2d720 +_08117190: .4byte 0x0203a110 +_08117194: .4byte _08117198 + .align 2, 0 +_08117198: + .4byte _081171B4 + .4byte _081171BC + .4byte _081171C4 + .4byte _081171CC + .4byte _081171D4 + .4byte _081171DC + .4byte _081171E4 +_081171B4: + ldr r0, _081171B8 + b _081171E6 + .align 2, 0 +_081171B8: .4byte 0x08c2db88 +_081171BC: + ldr r0, _081171C0 + b _081171E6 + .align 2, 0 +_081171C0: .4byte 0x08c2db68 +_081171C4: + ldr r0, _081171C8 + b _081171E6 + .align 2, 0 +_081171C8: .4byte 0x08c2dba8 +_081171CC: + ldr r0, _081171D0 + b _081171E6 + .align 2, 0 +_081171D0: .4byte 0x08c2dbc8 +_081171D4: + ldr r0, _081171D8 + b _081171E6 + .align 2, 0 +_081171D8: .4byte 0x08c2dc08 +_081171DC: + ldr r0, _081171E0 + b _081171E6 + .align 2, 0 +_081171E0: .4byte 0x08c2dc28 +_081171E4: + ldr r0, _081171F4 +_081171E6: + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + b _08117206 + .align 2, 0 +_081171F4: .4byte 0x08c2dc48 +_081171F8: + ldr r0, _08117230 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette +_08117206: + ldr r3, _08117234 + movs r2, 0 + strh r2, [r3] + ldr r0, _08117238 + strh r2, [r0] + ldr r1, _0811723C + ldr r0, [r1] + movs r4, 0x4 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + cmp r0, 0x1 + bne _08117248 + movs r0, 0x40 + strh r0, [r3] + ldr r2, _08117240 + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + ldr r1, _08117244 + b _08117254 + .align 2, 0 +_08117230: .4byte 0x08c2dbe8 +_08117234: .4byte 0x02022e18 +_08117238: .4byte 0x02022e1a +_0811723C: .4byte 0x0203a110 +_08117240: .4byte 0x03005e00 +_08117244: .4byte 0x0000fffd +_08117248: + ldr r2, _08117270 + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x3 +_08117254: + strh r1, [r0, 0xA] + ldr r0, [r4] + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117274 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + strh r1, [r0, 0x10] + movs r1, 0x14 + b _08117280 + .align 2, 0 +_08117270: .4byte 0x03005e00 +_08117274: + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0xD + strh r1, [r0, 0x10] + movs r1, 0x1E +_08117280: + strh r1, [r0, 0x12] + adds r1, r3, r5 + lsls r1, 3 + adds r1, r2 + strh r7, [r1, 0x8] + ldr r3, [r4] + ldrh r0, [r3, 0xA] + strh r0, [r1, 0xC] + mov r4, r8 + strh r4, [r1, 0xE] + ldrb r0, [r3, 0x2] + strh r0, [r1, 0x14] + ldr r2, _081172C4 + ldrb r0, [r3, 0x1] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x16] + ldr r0, _081172C8 + str r0, [r1] + movs r1, 0x4 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _081172CC + movs r0, 0x40 + negs r0, r0 + bl sub_80A5278 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xEF + bl audio_play_and_stuff + b _081172E0 + .align 2, 0 +_081172C4: .4byte 0x020241e4 +_081172C8: .4byte sub_81172EC + 1 +_081172CC: + movs r0, 0x40 + negs r0, r0 + bl sub_80A5278 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xF5 + bl audio_play_and_stuff +_081172E0: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81170EC + + thumb_func_start sub_81172EC +sub_81172EC: @ 81172EC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _08117318 + ldr r1, _0811731C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + movs r0, 0x26 + ldrsh r2, [r5, r0] + cmp r2, 0x1 + beq _08117362 + cmp r2, 0x1 + bgt _08117320 + cmp r2, 0 + beq _0811732A + b _08117478 + .align 2, 0 +_08117318: .4byte 0x02022e1a +_0811731C: .4byte 0x03005e00 +_08117320: + cmp r2, 0x2 + beq _08117378 + cmp r2, 0x3 + beq _081173B6 + b _08117478 +_0811732A: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + cmp r0, 0 + bgt _08117338 + b _08117478 +_08117338: + strh r2, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r1, r0 + beq _08117360 + b _08117478 +_08117360: + b _081173AE +_08117362: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r5, r2] + cmp r0, r1 + beq _08117376 + b _08117478 +_08117376: + b _081173AE +_08117378: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + cmp r0, 0 + ble _08117478 + movs r0, 0 + strh r0, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x20 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08117478 + movs r0, 0 + bl sub_80A477C +_081173AE: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08117478 +_081173B6: + ldr r0, _08117480 + movs r1, 0 + strh r1, [r0] + ldr r0, _08117484 + strh r1, [r0] + ldr r4, _08117488 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081173E6 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_081173E6: + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0811748C + adds r0, r4 + bl obj_delete_and_free_tiles + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0811743A + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles +_0811743A: + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08117466 + movs r2, 0x16 + ldrsh r0, [r5, r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] +_08117466: + ldr r4, _08117490 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + adds r0, r6, 0 + bl move_anim_task_del +_08117478: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08117480: .4byte 0x02022e24 +_08117484: .4byte 0x02022e26 +_08117488: .4byte 0x00003f3f +_0811748C: .4byte 0x02020630 +_08117490: .4byte 0x0203a110 + thumb_func_end sub_81172EC + + thumb_func_start sub_8117494 +sub_8117494: @ 8117494 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80A76C4 + adds r6, r0, 0 + movs r1, 0 + bl sub_81175C4 + ldr r0, _081174F4 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + lsrs r0, r6, 16 + movs r5, 0 + strh r0, [r4, 0x24] + str r5, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r6, r0, 0 + ldr r1, _081174F8 + ands r6, r1 + adds r0, r6, 0 + bl sub_81175C4 + strh r6, [r4, 0x26] + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + ldr r0, _081174FC + str r0, [r4] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081174F4: .4byte 0x03005e00 +_081174F8: .4byte 0x0000ffff +_081174FC: .4byte sub_8117500 + 1 + thumb_func_end sub_8117494 + + thumb_func_start sub_8117500 +sub_8117500: @ 8117500 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08117524 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _08117544 + cmp r1, 0x1 + bgt _08117528 + cmp r1, 0 + beq _0811752E + b _081175BE + .align 2, 0 +_08117524: .4byte 0x03005e00 +_08117528: + cmp r1, 0x2 + beq _081175B8 + b _081175BE +_0811752E: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _081175BE + strh r1, [r4, 0xA] + movs r0, 0x10 + strh r0, [r4, 0xC] + b _081175AC +_08117544: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081175BE + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + movs r5, 0 + movs r6, 0x1 +_08117560: + movs r1, 0x26 + ldrsh r0, [r4, r1] + asrs r0, r5 + ands r0, r6 + cmp r0, 0 + beq _0811757A + lsls r0, r5, 20 + lsrs r0, 16 + ldrb r2, [r4, 0xC] + movs r1, 0x10 + ldr r3, _081175B4 + bl pal_fade_1 +_0811757A: + movs r1, 0x24 + ldrsh r0, [r4, r1] + asrs r0, r5 + ands r0, r6 + cmp r0, 0 + beq _0811759A + lsls r0, r5, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldrb r2, [r4, 0xC] + movs r1, 0x10 + movs r3, 0 + bl pal_fade_1 +_0811759A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _08117560 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081175BE +_081175AC: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081175BE + .align 2, 0 +_081175B4: .4byte 0x0000ffff +_081175B8: + adds r0, r2, 0 + bl move_anim_task_del +_081175BE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8117500 + + thumb_func_start sub_81175C4 +sub_81175C4: @ 81175C4 + push {r4-r6,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + movs r2, 0 +_081175CE: + movs r0, 0x1 + ands r0, r3 + lsrs r4, r3, 1 + adds r5, r2, 0x1 + cmp r0, 0 + beq _081175FA + lsls r0, r2, 20 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x10 + cmp r2, r0 + bge _081175FA + ldr r1, _0811760C + adds r3, r0, 0 +_081175EA: + lsls r0, r2, 1 + adds r0, r1 + strh r6, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + blt _081175EA +_081175FA: + adds r3, r4, 0 + lsls r0, r5, 16 + lsrs r2, r0, 16 + cmp r2, 0x1F + bls _081175CE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811760C: .4byte 0x02037b14 + thumb_func_end sub_81175C4 + + thumb_func_start sub_8117610 +sub_8117610: @ 8117610 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r2, 0 + ldr r0, _08117658 + ldrb r3, [r0] + movs r5, 0x1 +_08117620: + cmp r3, r2 + beq _0811762E + adds r1, r2, 0 + adds r1, 0x10 + adds r0, r5, 0 + lsls r0, r1 + orrs r4, r0 +_0811762E: + adds r2, 0x1 + cmp r2, 0x3 + bls _08117620 + movs r2, 0x5 + ldr r0, _0811765C + adds r1, r0, 0 + adds r1, 0x8 +_0811763C: + ldrh r0, [r1] + strh r0, [r1, 0x2] + subs r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811763C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8116874 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08117658: .4byte 0x02038436 +_0811765C: .4byte 0x0203841e + thumb_func_end sub_8117610 + + thumb_func_start sub_8117660 +sub_8117660: @ 8117660 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl sub_80A6DAC + ldr r0, _081176C8 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081176CC + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0811769C + ldr r0, _081176D0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0811769C + ldrh r0, [r4] + negs r0, r0 + strh r0, [r4] + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] +_0811769C: + ldr r0, _081176D4 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r2, _081176CC + ldrh r0, [r2] + strh r0, [r1, 0xA] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0xC] + ldrh r0, [r2, 0x6] + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + adds r0, r6, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081176C8: .4byte sub_81176D8 + 1 +_081176CC: .4byte 0x0203841e +_081176D0: .4byte 0x02038436 +_081176D4: .4byte 0x03005e00 + thumb_func_end sub_8117660 + + thumb_func_start sub_81176D8 +sub_81176D8: @ 81176D8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08117744 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r3, [r1, 0xA] + ldrh r0, [r1, 0x1C] + adds r3, r0 + movs r4, 0 + mov r12, r4 + strh r3, [r1, 0x1C] + ldrh r2, [r1, 0xC] + ldrh r7, [r1, 0x1E] + adds r2, r7 + strh r2, [r1, 0x1E] + ldr r6, _08117748 + lsls r0, r3, 16 + asrs r0, 24 + ldrh r4, [r6] + adds r0, r4 + strh r0, [r6] + ldr r4, _0811774C + lsls r0, r2, 16 + asrs r0, 24 + ldrh r7, [r4] + adds r0, r7 + strh r0, [r4] + movs r0, 0xFF + ands r3, r0 + strh r3, [r1, 0x1C] + ands r2, r0 + strh r2, [r1, 0x1E] + ldr r0, _08117750 + movs r3, 0xE + ldrsh r2, [r0, r3] + movs r7, 0xE + ldrsh r0, [r1, r7] + cmp r2, r0 + bne _0811773E + mov r0, r12 + strh r0, [r6] + strh r0, [r4] + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r5, 0 + bl remove_task +_0811773E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08117744: .4byte 0x03005e00 +_08117748: .4byte 0x02022e20 +_0811774C: .4byte 0x02022e22 +_08117750: .4byte 0x0203841e + thumb_func_end sub_81176D8 + + thumb_func_start sub_8117754 +sub_8117754: @ 8117754 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08117778 + ldrb r0, [r0] + bl battle_side_get_owner + ldr r1, _0811777C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08117778: .4byte 0x02038436 +_0811777C: .4byte 0x0203841e + thumb_func_end sub_8117754 + + thumb_func_start sub_8117780 +sub_8117780: @ 8117780 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081177A4 + ldrb r0, [r0] + bl battle_side_get_owner + ldr r1, _081177A8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081177A4: .4byte 0x02038437 +_081177A8: .4byte 0x0203841e + thumb_func_end sub_8117780 + + thumb_func_start sub_81177AC +sub_81177AC: @ 81177AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r5, _081177D8 + movs r4, 0 + ldr r0, _081177DC + ldrb r2, [r0] + movs r0, 0x2 + ldr r1, _081177E0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bne _081177C8 + movs r4, 0x1 +_081177C8: + strh r4, [r5, 0xE] + adds r0, r3, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081177D8: .4byte 0x0203841e +_081177DC: .4byte 0x02038436 +_081177E0: .4byte 0x02038437 + thumb_func_end sub_81177AC + + thumb_func_start sub_81177E4 +sub_81177E4: @ 81177E4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r6, _08117844 +_081177EE: + ldr r0, _08117848 + ldrb r0, [r0] + cmp r4, r0 + beq _0811782C + lsls r0, r4, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811782C + ldr r0, _0811784C + adds r0, r4, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldr r1, _08117850 + adds r2, 0x3E + movs r0, 0x1 + ldrb r3, [r1] + ands r3, r0 + lsls r3, 2 + ldrb r0, [r2] + movs r7, 0x5 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] +_0811782C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _081177EE + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08117844: .4byte 0x02020630 +_08117848: .4byte 0x02038436 +_0811784C: .4byte 0x020241e4 +_08117850: .4byte 0x0203841e + thumb_func_end sub_81177E4 + + thumb_func_start sub_8117854 +sub_8117854: @ 8117854 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r1, [sp, 0x44] + ldr r4, [sp, 0x48] + ldr r5, [sp, 0x4C] + ldr r6, [sp, 0x50] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r7, r3, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r10, r6 + movs r0, 0 + str r0, [sp, 0x20] + movs r0, 0x2 + adds r6, r7, 0 + eors r6, r0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081178B6 + mov r1, r8 + cmp r1, 0 + beq _081178BA + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _081178BA +_081178B6: + movs r2, 0 + mov r8, r2 +_081178BA: + ldr r0, _0811794C + movs r1, 0 + strh r1, [r0] + ldr r0, _08117950 + strh r1, [r0] + ldr r1, _08117954 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08117958 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r1, _0811795C + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0xA + bl lcd_io_get + add r4, sp, 0x10 + strh r0, [r4] + ldrb r1, [r4] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + mov r2, sp + adds r2, 0x11 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08117930 + ldrb r0, [r4] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4] +_08117930: + ldrh r1, [r4] + movs r0, 0xA + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08117964 + ldr r0, _08117960 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _081179A2 + .align 2, 0 +_0811794C: .4byte 0x02022e24 +_08117950: .4byte 0x02022e26 +_08117954: .4byte 0x00003f3f +_08117958: .4byte 0x00003f3d +_0811795C: .4byte 0x00003f42 +_08117960: .4byte 0x02039f34 +_08117964: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08117988 + ldr r1, _08117980 + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08117984 + b _08117996 + .align 2, 0 +_08117980: .4byte 0x0202406e +_08117984: .4byte 0x02024744 +_08117988: + ldr r1, _08117A44 + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08117A48 +_08117996: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 +_081179A2: + ldr r5, _08117A4C + adds r0, r7, r5 + ldrb r1, [r0] + adds r0, r7, 0 + adds r2, r4, 0 + bl sub_80A89C8 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r8 + cmp r0, 0 + beq _081179CC + adds r0, r6, r5 + ldrb r1, [r0] + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_80A89C8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] +_081179CC: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldr r1, [sp, 0x58] + movs r2, 0 + bl sub_80A6D60 + mov r0, sp + ldrb r0, [r0, 0x9] + mov r1, sp + ldrh r2, [r1, 0xA] + ldr r1, [sp, 0x54] + bl sub_80A6CC0 + mov r0, sp + ldrb r1, [r0, 0x8] + lsls r1, 4 + ldr r0, [sp, 0x5C] + movs r2, 0x20 + bl decompress_palette + ldr r0, _08117A50 + movs r1, 0 + strh r1, [r0] + ldr r0, _08117A54 + strh r1, [r0] + ldr r1, _08117A58 + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0xA] + mov r2, sp + ldrh r2, [r2, 0x18] + strh r2, [r0, 0x10] + mov r1, r10 + strh r1, [r0, 0x12] + mov r2, sp + ldrh r2, [r2, 0x1C] + strh r2, [r0, 0x14] + strh r7, [r0, 0x8] + mov r1, r8 + strh r1, [r0, 0xC] + mov r2, sp + ldrh r2, [r2, 0x20] + strh r2, [r0, 0xE] + ldr r1, _08117A5C + str r1, [r0] + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08117A44: .4byte 0x0202406e +_08117A48: .4byte 0x020244ec +_08117A4C: .4byte 0x020241e4 +_08117A50: .4byte 0x02022e18 +_08117A54: .4byte 0x02022e1a +_08117A58: .4byte 0x03005e00 +_08117A5C: .4byte sub_8117A60 + 1 + thumb_func_end sub_8117854 + + thumb_func_start sub_8117A60 +sub_8117A60: @ 8117A60 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08117A9C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r0, 0xA + ldrsh r2, [r3, r0] + adds r5, r1, 0 + cmp r2, 0 + bge _08117A7E + negs r2, r2 +_08117A7E: + ldrh r0, [r3, 0x22] + adds r4, r0, r2 + strh r4, [r3, 0x22] + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, 0 + bge _08117AA4 + ldr r2, _08117AA0 + lsls r1, r4, 16 + asrs r1, 24 + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + b _08117AB0 + .align 2, 0 +_08117A9C: .4byte 0x03005e00 +_08117AA0: .4byte 0x02022e1a +_08117AA4: + ldr r1, _08117AD4 + lsls r0, r4, 16 + asrs r0, 24 + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] +_08117AB0: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r5 + ldrh r1, [r5, 0x22] + movs r0, 0xFF + ands r0, r1 + movs r2, 0 + strh r0, [r5, 0x22] + movs r3, 0x26 + ldrsh r0, [r5, r3] + cmp r0, 0x1 + beq _08117B1A + cmp r0, 0x1 + bgt _08117AD8 + cmp r0, 0 + beq _08117ADE + b _08117C0C + .align 2, 0 +_08117AD4: .4byte 0x02022e1a +_08117AD8: + cmp r0, 0x2 + beq _08117B34 + b _08117C0C +_08117ADE: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x14 + ldrsh r1, [r5, r3] + cmp r0, r1 + bge _08117AF2 + b _08117C0C +_08117AF2: + strh r2, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x20 + ldrsh r1, [r5, r0] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _08117C0C + b _08117B2C +_08117B1A: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r5, r3] + cmp r0, r1 + bne _08117C0C +_08117B2C: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08117C0C +_08117B34: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x14 + ldrsh r1, [r5, r3] + cmp r0, r1 + blt _08117C0C + strh r2, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x20 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _08117C0C + movs r0, 0 + bl sub_80A477C + ldr r0, _08117C14 + strh r4, [r0] + ldr r0, _08117C18 + strh r4, [r0] + ldr r4, _08117C1C + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08117BB2 + movs r0, 0xA + bl lcd_io_get + mov r1, sp + strh r0, [r1] + mov r2, sp + ldrb r1, [r2] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + ldrh r1, [r0] + movs r0, 0xA + bl lcd_io_set +_08117BB2: + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r3, 0x8 + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08117C20 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08117C06 + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles +_08117C06: + adds r0, r6, 0 + bl move_anim_task_del +_08117C0C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08117C14: .4byte 0x02022e24 +_08117C18: .4byte 0x02022e26 +_08117C1C: .4byte 0x00003f3f +_08117C20: .4byte 0x02020630 + thumb_func_end sub_8117A60 + + thumb_func_start sub_8117C24 +sub_8117C24: @ 8117C24 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08117C3C + ldr r1, _08117C40 + ldrb r1, [r1] + strh r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08117C3C: .4byte 0x0203841e +_08117C40: .4byte 0x02022ff0 + thumb_func_end sub_8117C24 + + thumb_func_start sub_8117C44 +sub_8117C44: @ 8117C44 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + ldr r1, _08117C6C + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + str r0, [r1] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08117C6C: .4byte 0x020244d4 + thumb_func_end sub_8117C44 + + thumb_func_start sub_8117C70 +sub_8117C70: @ 8117C70 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _08117C9C + ldr r0, [r6] + movs r5, 0xBE + lsls r5, 1 + adds r0, r5 + ldr r0, [r0] + bl free + ldr r0, [r6] + adds r0, r5 + movs r1, 0 + str r1, [r0] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08117C9C: .4byte 0x020244d4 + thumb_func_end sub_8117C70 + + thumb_func_start sub_8117CA0 +sub_8117CA0: @ 8117CA0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _08117CE0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117CE4 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08117CFC + movs r2, 0x1 +_08117CD2: + lsrs r1, 1 + adds r4, 0x1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _08117CD2 + b _08117CFC + .align 2, 0 +_08117CE0: .4byte 0x0203841e +_08117CE4: + cmp r0, 0x1 + bne _08117CF0 + ldr r0, _08117CEC + b _08117CF6 + .align 2, 0 +_08117CEC: .4byte 0x02038436 +_08117CF0: + cmp r0, 0x2 + bne _08117CFC + ldr r0, _08117D2C +_08117CF6: + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 +_08117CFC: + ldr r0, _08117D30 + ldr r1, [r0] + ldr r0, _08117D34 + movs r2, 0x2 + ldrsh r0, [r0, r2] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + lsls r1, r4, 5 + ldr r2, _08117D38 + adds r1, r2 + movs r2, 0x20 + bl memcpy + adds r0, r5, 0 + bl move_anim_task_del + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08117D2C: .4byte 0x02038437 +_08117D30: .4byte 0x020244d4 +_08117D34: .4byte 0x0203841e +_08117D38: .4byte 0x02037714 + thumb_func_end sub_8117CA0 + + thumb_func_start sub_8117D3C +sub_8117D3C: @ 8117D3C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _08117D7C + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117D80 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08117D98 + movs r2, 0x1 +_08117D6E: + lsrs r1, 1 + adds r4, 0x1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _08117D6E + b _08117D98 + .align 2, 0 +_08117D7C: .4byte 0x0203841e +_08117D80: + cmp r0, 0x1 + bne _08117D8C + ldr r0, _08117D88 + b _08117D92 + .align 2, 0 +_08117D88: .4byte 0x02038436 +_08117D8C: + cmp r0, 0x2 + bne _08117D98 + ldr r0, _08117DC8 +_08117D92: + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 +_08117D98: + lsls r0, r4, 5 + ldr r1, _08117DCC + adds r0, r1 + ldr r1, _08117DD0 + ldr r2, [r1] + ldr r1, _08117DD4 + movs r3, 0x2 + ldrsh r1, [r1, r3] + movs r3, 0xBE + lsls r3, 1 + adds r2, r3 + ldr r2, [r2] + lsls r1, 5 + adds r1, r2 + movs r2, 0x20 + bl memcpy + adds r0, r5, 0 + bl move_anim_task_del + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08117DC8: .4byte 0x02038437 +_08117DCC: .4byte 0x02037714 +_08117DD0: .4byte 0x020244d4 +_08117DD4: .4byte 0x0203841e + thumb_func_end sub_8117D3C + + thumb_func_start sub_8117DD8 +sub_8117DD8: @ 8117DD8 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _08117E18 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117E1C + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08117E34 + movs r2, 0x1 +_08117E0A: + lsrs r1, 1 + adds r4, 0x1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _08117E0A + b _08117E34 + .align 2, 0 +_08117E18: .4byte 0x0203841e +_08117E1C: + cmp r0, 0x1 + bne _08117E28 + ldr r0, _08117E24 + b _08117E2E + .align 2, 0 +_08117E24: .4byte 0x02038436 +_08117E28: + cmp r0, 0x2 + bne _08117E34 + ldr r0, _08117E54 +_08117E2E: + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 +_08117E34: + lsls r1, r4, 5 + ldr r0, _08117E58 + adds r0, r1, r0 + ldr r2, _08117E5C + adds r1, r2 + movs r2, 0x20 + bl memcpy + adds r0, r5, 0 + bl move_anim_task_del + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08117E54: .4byte 0x02038437 +_08117E58: .4byte 0x02037714 +_08117E5C: .4byte 0x02037b14 + thumb_func_end sub_8117DD8 + + thumb_func_start sub_8117E60 +sub_8117E60: @ 8117E60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08117E80 + ldr r1, _08117E7C + movs r0, 0x1 + strh r0, [r1, 0xE] + b _08117E84 + .align 2, 0 +_08117E7C: .4byte 0x0203841e +_08117E80: + ldr r0, _08117E90 + strh r1, [r0, 0xE] +_08117E84: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08117E90: .4byte 0x0203841e + thumb_func_end sub_8117E60 + + thumb_func_start sub_8117E94 +sub_8117E94: @ 8117E94 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08117EB4 + ldr r1, _08117EB8 + ldrb r1, [r1] + strb r1, [r2] + ldr r2, _08117EBC + ldr r1, _08117EC0 + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08117EB4: .4byte 0x02038436 +_08117EB8: .4byte 0x0202420c +_08117EBC: .4byte 0x02038437 +_08117EC0: .4byte 0x0202420e + thumb_func_end sub_8117E94 + + thumb_func_start sub_8117EC4 +sub_8117EC4: @ 8117EC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08117EEC + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, _08117EF0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08117EF8 + ldr r1, _08117EF4 + movs r0, 0x1 + b _08117EFC + .align 2, 0 +_08117EEC: .4byte 0x02038436 +_08117EF0: .4byte 0x02038437 +_08117EF4: .4byte 0x0203841e +_08117EF8: + ldr r1, _08117F0C + movs r0, 0 +_08117EFC: + strh r0, [r1, 0xE] + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08117F0C: .4byte 0x0203841e + thumb_func_end sub_8117EC4 + + thumb_func_start sub_8117F10 +sub_8117F10: @ 8117F10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08117F28 + ldr r1, _08117F2C + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08117F28: .4byte 0x02038437 +_08117F2C: .4byte 0x0202420c + thumb_func_end sub_8117F10 + + thumb_func_start sub_8117F30 +sub_8117F30: @ 8117F30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08117F50 + ldr r1, _08117F54 + ldrb r1, [r1] + strb r1, [r2] + ldr r2, _08117F58 + ldr r1, _08117F5C + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08117F50: .4byte 0x02038436 +_08117F54: .4byte 0x0202420b +_08117F58: .4byte 0x02038437 +_08117F5C: .4byte 0x0202420e + thumb_func_end sub_8117F30 + + thumb_func_start sub_8117F60 +sub_8117F60: @ 8117F60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08117F78 + adds r0, r4, 0 + bl move_anim_task_del + b _08117FB4 +_08117F78: + ldr r0, _08117FBC + lsls r3, r4, 2 + adds r3, r4 + lsls r3, 3 + adds r3, r0 + ldr r0, _08117FC0 + ldr r4, [r0] + ldr r2, _08117FC4 + ldrb r0, [r2] + ldr r1, [r4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 31 + lsrs r0, 31 + strh r0, [r3, 0x8] + ldrb r1, [r2] + ldr r0, [r4] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r0, _08117FC8 + str r0, [r3] + ldr r1, _08117FCC + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_08117FB4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08117FBC: .4byte 0x03005e00 +_08117FC0: .4byte 0x020244d0 +_08117FC4: .4byte 0x02038436 +_08117FC8: .4byte sub_8117FD0 + 1 +_08117FCC: .4byte 0x020383fe + thumb_func_end sub_8117F60 + + thumb_func_start sub_8117FD0 +sub_8117FD0: @ 8117FD0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0811801C + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + bne _08118014 + ldr r0, _08118020 + ldr r1, [r0] + ldr r0, _08118024 + ldrb r3, [r0] + ldr r0, [r1] + lsls r3, 2 + adds r3, r0 + ldr r1, _08118028 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0 + bl remove_task +_08118014: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811801C: .4byte 0x0203841e +_08118020: .4byte 0x020244d0 +_08118024: .4byte 0x02038436 +_08118028: .4byte 0x03005e00 + thumb_func_end sub_8117FD0 + + thumb_func_start lcd_bg_operations +lcd_bg_operations: @ 811802C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r6, 0x3 + bls _08118040 + b _08118132 +_08118040: + ldr r0, _0811805C + adds r0, r6, r0 + ldrb r0, [r0] + bl lcd_io_get + ldr r1, _08118060 + strh r0, [r1] + cmp r5, 0x6 + bhi _08118124 + lsls r0, r5, 2 + ldr r1, _08118064 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811805C: .4byte 0x0859741a +_08118060: .4byte 0x0203a114 +_08118064: .4byte _08118068 + .align 2, 0 +_08118068: + .4byte _08118084 + .4byte _08118098 + .4byte _081180B0 + .4byte _081180C8 + .4byte _081180E0 + .4byte _081180FC + .4byte _08118110 +_08118084: + ldr r2, _08118094 + lsls r3, r4, 6 + ldrb r1, [r2, 0x1] + movs r0, 0x3F + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x1] + b _08118124 + .align 2, 0 +_08118094: .4byte 0x0203a114 +_08118098: + ldr r3, _081180AC + movs r0, 0x1 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3, 0x1] + movs r0, 0x21 + negs r0, r0 + b _0811811E + .align 2, 0 +_081180AC: .4byte 0x0203a114 +_081180B0: + ldr r3, _081180C4 + movs r0, 0x1 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x41 + negs r0, r0 + b _081180EE + .align 2, 0 +_081180C4: .4byte 0x0203a114 +_081180C8: + ldr r3, _081180DC + movs r0, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0xD + negs r0, r0 + b _081180EE + .align 2, 0 +_081180DC: .4byte 0x0203a114 +_081180E0: + ldr r3, _081180F8 + movs r0, 0x3 + adds r1, r4, 0 + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x4 + negs r0, r0 +_081180EE: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08118124 + .align 2, 0 +_081180F8: .4byte 0x0203a114 +_081180FC: + ldr r2, _0811810C + lsls r3, r4, 7 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + b _08118124 + .align 2, 0 +_0811810C: .4byte 0x0203a114 +_08118110: + ldr r3, _08118138 + movs r0, 0x1F + adds r1, r4, 0 + ands r1, r0 + ldrb r2, [r3, 0x1] + movs r0, 0x20 + negs r0, r0 +_0811811E: + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] +_08118124: + ldr r0, _0811813C + adds r0, r6, r0 + ldrb r0, [r0] + ldr r1, _08118138 + ldrh r1, [r1] + bl lcd_io_set +_08118132: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08118138: .4byte 0x0203a114 +_0811813C: .4byte 0x0859741a + thumb_func_end lcd_bg_operations + + thumb_func_start sub_8118140 +sub_8118140: @ 8118140 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r2, 0x3 + bhi _081181C8 + ldr r0, _0811816C + adds r0, r2, r0 + ldrb r0, [r0] + bl lcd_io_get + mov r1, sp + strh r0, [r1] + cmp r4, 0x6 + bhi _081181C8 + lsls r0, r4, 2 + ldr r1, _08118170 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811816C: .4byte 0x0859741e +_08118170: .4byte _08118174 + .align 2, 0 +_08118174: + .4byte _08118190 + .4byte _08118198 + .4byte _081181A0 + .4byte _081181A8 + .4byte _081181B0 + .4byte _081181B8 + .4byte _081181C0 +_08118190: + ldr r0, [sp] + lsls r0, 16 + lsrs r0, 30 + b _081181CA +_08118198: + ldr r0, [sp] + lsls r0, 18 + lsrs r0, 31 + b _081181CA +_081181A0: + ldr r0, [sp] + lsls r0, 25 + lsrs r0, 31 + b _081181CA +_081181A8: + ldr r0, [sp] + lsls r0, 28 + lsrs r0, 30 + b _081181CA +_081181B0: + ldr r0, [sp] + lsls r0, 30 + lsrs r0, 30 + b _081181CA +_081181B8: + ldr r0, [sp] + lsls r0, 24 + lsrs r0, 31 + b _081181CA +_081181C0: + ldr r0, [sp] + lsls r0, 19 + lsrs r0, 27 + b _081181CA +_081181C8: + movs r0, 0 +_081181CA: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8118140 + + thumb_func_start battle_intro_launch +battle_intro_launch: @ 81181D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _081181F8 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08118208 + ldr r0, _081181FC + ldrh r1, [r0] + ldr r0, _08118200 + cmp r1, r0 + beq _08118208 + ldr r0, _08118204 + b _08118258 + .align 2, 0 +_081181F8: .4byte 0x02022fec +_081181FC: .4byte 0x02038bce +_08118200: .4byte 0x00000c03 +_08118204: .4byte sub_8118D68 + 1 +_08118208: + ldr r2, [r2] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0811821C + ldr r0, _08118218 + b _08118258 + .align 2, 0 +_08118218: .4byte task00_battle_intro_wireless + 1 +_0811821C: + ldr r0, _08118228 + ands r0, r2 + cmp r0, 0 + beq _08118230 + ldr r0, _0811822C + b _08118258 + .align 2, 0 +_08118228: .4byte 0x003f0100 +_0811822C: .4byte task_battle_intro_anim + 1 +_08118230: + movs r0, 0x80 + lsls r0, 5 + ands r2, r0 + cmp r2, 0 + beq _08118250 + ldr r0, _08118248 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08118250 + movs r4, 0x3 + ldr r0, _0811824C + b _08118258 + .align 2, 0 +_08118248: .4byte 0x082e9530 +_0811824C: .4byte task00_battle_intro_80BC6C8 + 1 +_08118250: + ldr r1, _08118284 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] +_08118258: + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08118288 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r4, [r1, 0xA] + strh r0, [r1, 0xC] + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + strh r0, [r1, 0x12] + strh r0, [r1, 0x14] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08118284: .4byte 0x08597424 +_08118288: .4byte 0x03005e00 + thumb_func_end battle_intro_launch + + thumb_func_start sub_811828C +sub_811828C: @ 811828C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldr r0, _081182D8 + movs r1, 0 + strh r1, [r0] + ldr r0, _081182DC + strh r1, [r0] + ldr r0, _081182E0 + strh r1, [r0] + ldr r0, _081182E4 + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r4, _081182E8 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081182D8: .4byte 0x02022e18 +_081182DC: .4byte 0x02022e1a +_081182E0: .4byte 0x02022e1c +_081182E4: .4byte 0x02022e1e +_081182E8: .4byte 0x00003f3f + thumb_func_end sub_811828C + + thumb_func_start task_battle_intro_80BC47C +task_battle_intro_80BC47C: @ 81182EC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08118324 + ldrh r0, [r1] + adds r0, 0x6 + strh r0, [r1] + ldr r1, _08118328 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x4 + bls _08118318 + b _0811852A +_08118318: + lsls r0, 2 + ldr r1, _0811832C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08118324: .4byte 0x02022e18 +_08118328: .4byte 0x03005e00 +_0811832C: .4byte _08118330 + .align 2, 0 +_08118330: + .4byte _08118344 + .4byte _08118374 + .4byte _0811839C + .4byte _081183E4 + .4byte _08118524 +_08118344: + ldr r0, _0811835C + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08118360 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + movs r1, 0x10 + b _0811836A + .align 2, 0 +_0811835C: .4byte 0x02022fec +_08118360: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + movs r1, 0x1 +_0811836A: + strh r1, [r0, 0xC] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0811852A +_08118374: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + mov r3, r8 + adds r1, r0, r3 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0811838C + b _0811852A +_0811838C: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + b _0811852A +_0811839C: + ldr r1, _081183D8 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _081183B4 + b _0811852A +_081183B4: + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + add r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + ldr r2, _081183DC + ldrh r1, [r2] + ldr r0, _081183E0 + ands r0, r1 + strh r0, [r2] + b _0811852A + .align 2, 0 +_081183D8: .4byte 0x02022e26 +_081183DC: .4byte 0x020243fc +_081183E0: .4byte 0x0000fffe +_081183E4: + lsls r0, r4, 2 + adds r1, r0, r4 + lsls r1, 3 + mov r5, r8 + adds r2, r1, r5 + ldrh r3, [r2, 0xE] + movs r5, 0xE + ldrsh r1, [r2, r5] + mov r12, r0 + cmp r1, 0 + beq _08118400 + subs r0, r3, 0x1 + strh r0, [r2, 0xE] + b _0811842E +_08118400: + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _08118420 + ldr r2, _08118418 + ldrh r1, [r2] + ldr r0, _0811841C + cmp r1, r0 + beq _0811842E + subs r0, r1, 0x2 + b _0811842C + .align 2, 0 +_08118418: .4byte 0x02022e1a +_0811841C: .4byte 0x0000ffb0 +_08118420: + ldr r2, _08118500 + ldrh r1, [r2] + ldr r0, _08118504 + cmp r1, r0 + beq _0811842E + subs r0, r1, 0x1 +_0811842C: + strh r0, [r2] +_0811842E: + ldr r2, _08118508 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08118442 + ldr r3, _0811850C + adds r0, r1, r3 + strh r0, [r2] +_08118442: + mov r5, r12 + adds r0, r5, r4 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0811845A + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_0811845A: + movs r3, 0 + ldr r5, _08118510 + mov r9, r5 + ldr r7, _08118514 + mov r6, r9 + adds r5, r1, 0 +_08118466: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r5, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _08118466 + cmp r3, 0x9F + bgt _081184AA + ldr r7, _08118514 + ldr r6, _08118510 + ldr r1, _08118518 + mov r2, r12 + adds r0, r2, r4 + lsls r0, 3 + adds r5, r0, r1 +_08118490: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r5, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _08118490 +_081184AA: + mov r3, r12 + adds r0, r3, r4 + lsls r0, 3 + mov r5, r8 + adds r1, r0, r5 + movs r0, 0xC + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _0811852A + movs r0, 0x3 + mov r3, r9 + strb r0, [r3, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r2, [sp] + ldr r1, _0811851C + ldr r2, _08118520 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl lcd_io_set + b _0811852A + .align 2, 0 +_08118500: .4byte 0x02022e1a +_08118504: .4byte 0x0000ffc8 +_08118508: .4byte 0x02022e26 +_0811850C: .4byte 0xfffffc04 +_08118510: .4byte 0x02039b28 +_08118514: .4byte 0x02038c28 +_08118518: .4byte 0x03005e00 +_0811851C: .4byte 0x0600e000 +_08118520: .4byte 0x05000200 +_08118524: + adds r0, r4, 0 + bl sub_811828C +_0811852A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task_battle_intro_80BC47C + + thumb_func_start task00_battle_intro_80BC6C8 +task00_battle_intro_80BC6C8: @ 8118538 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08118564 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x3 + beq _08118578 + cmp r0, 0x3 + bgt _08118568 + cmp r0, 0x2 + beq _0811856C + b _08118580 + .align 2, 0 +_08118564: .4byte 0x03005e00 +_08118568: + cmp r0, 0x4 + bne _08118580 +_0811856C: + ldr r1, _08118574 + ldrh r0, [r1] + adds r0, 0x8 + b _0811857E + .align 2, 0 +_08118574: .4byte 0x02022e18 +_08118578: + ldr r1, _081185BC + ldrh r0, [r1] + adds r0, 0x6 +_0811857E: + strh r0, [r1] +_08118580: + lsls r0, r5, 2 + adds r1, r0, r5 + lsls r1, 3 + adds r4, r1, r2 + movs r3, 0xA + ldrsh r1, [r4, r3] + adds r6, r0, 0 + cmp r1, 0x4 + bne _081185E4 + ldr r7, _081185C0 + ldrh r0, [r4, 0x14] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081185A6 + ldr r1, _081185C4 + adds r0, r1 +_081185A6: + asrs r0, 9 + subs r0, 0x8 + strh r0, [r7] + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0xB3 + bgt _081185C8 + adds r0, r1, 0x4 + b _081185CA + .align 2, 0 +_081185BC: .4byte 0x02022e18 +_081185C0: .4byte 0x02022e1a +_081185C4: .4byte 0x000001ff +_081185C8: + adds r0, r1, 0x6 +_081185CA: + strh r0, [r4, 0x14] + ldr r2, _08118600 + adds r0, r6, r5 + lsls r0, 3 + adds r3, r0, r2 + movs r0, 0x14 + ldrsh r1, [r3, r0] + movs r0, 0xB4 + lsls r0, 1 + cmp r1, r0 + bne _081185E4 + movs r0, 0 + strh r0, [r3, 0x14] +_081185E4: + adds r0, r6, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _081185F4 + b _0811881A +_081185F4: + lsls r0, 2 + ldr r1, _08118604 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08118600: .4byte 0x03005e00 +_08118604: .4byte _08118608 + .align 2, 0 +_08118608: + .4byte _0811861C + .4byte _0811864C + .4byte _08118678 + .4byte _081186C8 + .4byte _08118814 +_0811861C: + ldr r1, _08118638 + adds r0, r6, r5 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x10 + strh r3, [r2, 0x10] + ldr r0, _0811863C + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08118640 + strh r3, [r2, 0xC] + b _08118644 + .align 2, 0 +_08118638: .4byte 0x03005e00 +_0811863C: .4byte 0x02022fec +_08118640: + movs r0, 0x1 + strh r0, [r2, 0xC] +_08118644: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0811881A +_0811864C: + ldr r0, _08118674 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118662 + b _0811881A +_08118662: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + b _0811881A + .align 2, 0 +_08118674: .4byte 0x03005e00 +_08118678: + ldr r1, _081186B8 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _08118690 + b _0811881A +_08118690: + ldr r0, _081186BC + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + movs r0, 0x1 + strh r0, [r1, 0x12] + ldr r2, _081186C0 + ldrh r1, [r2] + ldr r0, _081186C4 + ands r0, r1 + strh r0, [r2] + b _0811881A + .align 2, 0 +_081186B8: .4byte 0x02022e26 +_081186BC: .4byte 0x03005e00 +_081186C0: .4byte 0x020243fc +_081186C4: .4byte 0x0000fffe +_081186C8: + ldr r0, _08118700 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08118708 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08118728 + ldr r1, _08118704 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0xF + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + b _08118728 + .align 2, 0 +_08118700: .4byte 0x03005e00 +_08118704: .4byte 0x00001842 +_08118708: + ldrh r2, [r1, 0x10] + movs r0, 0x1F + ands r0, r2 + cmp r0, 0 + beq _08118728 + ldrh r0, [r1, 0x12] + subs r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + cmp r0, 0 + bne _08118728 + adds r0, r2, 0 + adds r0, 0xFF + strh r0, [r1, 0x10] + movs r0, 0x4 + strh r0, [r1, 0x12] +_08118728: + ldr r2, _081187F8 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0811873C + ldr r3, _081187FC + adds r0, r1, r3 + strh r0, [r2] +_0811873C: + ldr r0, _08118800 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08118752 + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_08118752: + movs r3, 0 + ldr r0, _08118804 + mov r8, r0 + ldr r2, _08118808 + mov r12, r2 + mov r7, r8 + adds r4, r1, 0 +_08118760: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r12 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _08118760 + cmp r3, 0x9F + bgt _081187A4 + ldr r0, _08118808 + mov r12, r0 + ldr r7, _08118804 + ldr r1, _08118800 + adds r0, r6, r5 + lsls r0, 3 + adds r4, r0, r1 +_0811878A: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r12 + ldrh r0, [r4, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _0811878A +_081187A4: + ldr r1, _08118800 + adds r0, r6, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0xC + ldrsh r2, [r1, r3] + cmp r2, 0 + bne _0811881A + movs r0, 0x3 + mov r3, r8 + strb r0, [r3, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r2, [sp] + ldr r1, _0811880C + ldr r2, _08118810 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl lcd_io_set + b _0811881A + .align 2, 0 +_081187F8: .4byte 0x02022e26 +_081187FC: .4byte 0xfffffc04 +_08118800: .4byte 0x03005e00 +_08118804: .4byte 0x02039b28 +_08118808: .4byte 0x02038c28 +_0811880C: .4byte 0x0600e000 +_08118810: .4byte 0x05000200 +_08118814: + adds r0, r5, 0 + bl sub_811828C +_0811881A: + ldr r0, _08118840 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + beq _08118832 + ldrh r1, [r1, 0x10] + movs r0, 0x52 + bl lcd_io_set +_08118832: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08118840: .4byte 0x03005e00 + thumb_func_end task00_battle_intro_80BC6C8 + + thumb_func_start task_battle_intro_anim +task_battle_intro_anim: @ 8118844 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08118878 + ldrh r0, [r1] + adds r0, 0x8 + strh r0, [r1] + ldr r1, _0811887C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x4 + bls _0811886E + b _08118A96 +_0811886E: + lsls r0, 2 + ldr r1, _08118880 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08118878: .4byte 0x02022e18 +_0811887C: .4byte 0x03005e00 +_08118880: .4byte _08118884 + .align 2, 0 +_08118884: + .4byte _08118898 + .4byte _081188F0 + .4byte _0811891C + .4byte _0811896C + .4byte _08118A90 +_08118898: + ldr r1, _081188D0 + movs r0, 0x50 + bl lcd_io_set + ldr r4, _081188D4 + movs r0, 0x52 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _081188D8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + strh r4, [r2, 0x10] + ldr r0, _081188DC + ldr r0, [r0] + ldr r1, _081188E0 + ands r0, r1 + cmp r0, 0 + beq _081188E4 + movs r0, 0x10 + b _081188E6 + .align 2, 0 +_081188D0: .4byte 0x00001842 +_081188D4: .4byte 0x00000808 +_081188D8: .4byte 0x03005e00 +_081188DC: .4byte 0x02022fec +_081188E0: .4byte 0x02000002 +_081188E4: + movs r0, 0x1 +_081188E6: + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _08118A96 +_081188F0: + ldr r0, _08118918 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118908 + b _08118A96 +_08118908: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + b _08118A96 + .align 2, 0 +_08118918: .4byte 0x03005e00 +_0811891C: + ldr r1, _0811895C + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _08118934 + b _08118A96 +_08118934: + ldr r0, _08118960 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + movs r0, 0x1 + strh r0, [r1, 0x12] + ldr r2, _08118964 + ldrh r1, [r2] + ldr r0, _08118968 + ands r0, r1 + strh r0, [r2] + b _08118A96 + .align 2, 0 +_0811895C: .4byte 0x02022e26 +_08118960: .4byte 0x03005e00 +_08118964: .4byte 0x020243fc +_08118968: .4byte 0x0000fffe +_0811896C: + lsls r0, r5, 2 + adds r1, r0, r5 + lsls r1, 3 + adds r2, r1, r4 + ldrh r3, [r2, 0xE] + movs r6, 0xE + ldrsh r1, [r2, r6] + mov r12, r0 + cmp r1, 0 + beq _08118986 + subs r0, r3, 0x1 + strh r0, [r2, 0xE] + b _081189A6 +_08118986: + ldrh r1, [r2, 0x10] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _081189A6 + ldrh r0, [r2, 0x12] + subs r0, 0x1 + strh r0, [r2, 0x12] + lsls r0, 16 + cmp r0, 0 + bne _081189A6 + adds r0, r1, 0 + adds r0, 0xFF + strh r0, [r2, 0x10] + movs r0, 0x6 + strh r0, [r2, 0x12] +_081189A6: + ldr r2, _08118A74 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _081189BA + ldr r3, _08118A78 + adds r0, r1, r3 + strh r0, [r2] +_081189BA: + mov r6, r12 + adds r0, r6, r5 + lsls r0, 3 + adds r1, r0, r4 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _081189D0 + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_081189D0: + movs r3, 0 + ldr r6, _08118A7C + mov r8, r6 + ldr r7, _08118A80 + adds r4, r1, 0 +_081189DA: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _081189DA + cmp r3, 0x9F + bgt _08118A1E + ldr r7, _08118A80 + ldr r6, _08118A7C + ldr r1, _08118A84 + mov r2, r12 + adds r0, r2, r5 + lsls r0, 3 + adds r4, r0, r1 +_08118A04: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r4, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _08118A04 +_08118A1E: + ldr r1, _08118A84 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0xC + ldrsh r2, [r1, r3] + cmp r2, 0 + bne _08118A96 + movs r0, 0x3 + mov r6, r8 + strb r0, [r6, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r2, [sp] + ldr r1, _08118A88 + ldr r2, _08118A8C + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl lcd_io_set + b _08118A96 + .align 2, 0 +_08118A74: .4byte 0x02022e26 +_08118A78: .4byte 0xfffffc04 +_08118A7C: .4byte 0x02039b28 +_08118A80: .4byte 0x02038c28 +_08118A84: .4byte 0x03005e00 +_08118A88: .4byte 0x0600e000 +_08118A8C: .4byte 0x05000200 +_08118A90: + adds r0, r5, 0 + bl sub_811828C +_08118A96: + ldr r0, _08118ABC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + beq _08118AB0 + ldrh r1, [r1, 0x10] + movs r0, 0x52 + bl lcd_io_set +_08118AB0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08118ABC: .4byte 0x03005e00 + thumb_func_end task_battle_intro_anim + + thumb_func_start task00_battle_intro_wireless +task00_battle_intro_wireless: @ 8118AC0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08118B0C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + movs r1, 0x8 + ldrsh r0, [r7, r1] + cmp r0, 0x1 + ble _08118B36 + movs r2, 0x10 + ldrsh r0, [r7, r2] + cmp r0, 0 + bne _08118B36 + ldr r2, _08118B10 + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _08118AFE + cmp r1, 0x4F + bhi _08118B18 +_08118AFE: + adds r0, r1, 0x3 + strh r0, [r2] + ldr r1, _08118B14 + ldrh r0, [r1] + subs r0, 0x3 + strh r0, [r1] + b _08118B36 + .align 2, 0 +_08118B0C: .4byte 0x03005e00 +_08118B10: .4byte 0x02022e18 +_08118B14: .4byte 0x02022e1c +_08118B18: + str r5, [sp] + ldr r1, _08118B58 + ldr r4, _08118B5C + mov r0, sp + adds r2, r4, 0 + bl CpuSet + str r5, [sp, 0x4] + add r0, sp, 0x4 + ldr r1, _08118B60 + adds r2, r4, 0 + bl CpuSet + movs r0, 0x1 + strh r0, [r7, 0x10] +_08118B36: + ldr r0, _08118B64 + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + mov r9, r0 + adds r5, r2, 0 + cmp r1, 0x4 + bls _08118B4E + b _08118D5A +_08118B4E: + lsls r0, r1, 2 + ldr r1, _08118B68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08118B58: .4byte 0x0600e000 +_08118B5C: .4byte 0x05000200 +_08118B60: .4byte 0x0600f000 +_08118B64: .4byte 0x03005e00 +_08118B68: .4byte _08118B6C + .align 2, 0 +_08118B6C: + .4byte _08118B80 + .4byte _08118B92 + .4byte _08118C38 + .4byte _08118C7C + .4byte _08118D54 +_08118B80: + adds r0, r5, r6 + lsls r0, 3 + add r0, r9 + movs r1, 0x20 + strh r1, [r0, 0xC] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _08118D5A +_08118B92: + adds r0, r5, r6 + lsls r0, 3 + mov r2, r9 + adds r1, r0, r2 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118BA8 + b _08118D5A +_08118BA8: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r4, _08118C28 + ldr r5, _08118C2C + ldr r0, [r5] + adds r0, 0x7D + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r3, [r1, 0x1] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r3, 0x8 + mov r9, r3 + mov r3, r9 + orrs r0, r3 + strb r0, [r1, 0x1] + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x7D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + movs r1, 0x1C + adds r1, r4 + mov r8, r1 + add r0, r8 + ldr r6, _08118C30 + str r6, [r0] + adds r3, 0x7E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + ands r2, r1 + mov r3, r9 + orrs r2, r3 + strb r2, [r0, 0x1] + ldr r0, [r5] + adds r0, 0x7E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + str r6, [r0] + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + ldr r1, _08118C34 + movs r0, 0x4A + bl lcd_io_set + b _08118D5A + .align 2, 0 +_08118C28: .4byte 0x02020630 +_08118C2C: .4byte 0x0202449c +_08118C30: .4byte sub_8038B74 + 1 +_08118C34: .4byte 0x00003f06 +_08118C38: + ldr r1, _08118C70 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _08118C50 + b _08118D5A +_08118C50: + adds r1, r5, r6 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + ldr r2, _08118C74 + ldrh r1, [r2] + ldr r0, _08118C78 + ands r0, r1 + strh r0, [r2] + b _08118D5A + .align 2, 0 +_08118C70: .4byte 0x02022e26 +_08118C74: .4byte 0x020243fc +_08118C78: .4byte 0x0000fffe +_08118C7C: + ldr r2, _08118D40 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08118C90 + ldr r3, _08118D44 + adds r0, r1, r3 + strh r0, [r2] +_08118C90: + adds r0, r5, r6 + lsls r0, 3 + mov r2, r9 + adds r1, r0, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08118CA6 + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_08118CA6: + movs r3, 0 + ldr r0, _08118D48 + mov r12, r0 + ldr r2, _08118D4C + mov r8, r2 + mov r7, r12 + adds r4, r1, 0 +_08118CB4: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r8 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _08118CB4 + cmp r3, 0x9F + bgt _08118CF8 + ldr r0, _08118D4C + mov r8, r0 + ldr r7, _08118D48 + ldr r1, _08118D50 + adds r0, r5, r6 + lsls r0, 3 + adds r4, r0, r1 +_08118CDE: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r8 + ldrh r0, [r4, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _08118CDE +_08118CF8: + adds r0, r5, r6 + lsls r0, 3 + mov r2, r9 + adds r1, r0, r2 + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08118D5A + movs r0, 0x3 + mov r2, r12 + strb r0, [r2, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl lcd_io_set + b _08118D5A + .align 2, 0 +_08118D40: .4byte 0x02022e26 +_08118D44: .4byte 0xfffffc04 +_08118D48: .4byte 0x02039b28 +_08118D4C: .4byte 0x02038c28 +_08118D50: .4byte 0x03005e00 +_08118D54: + adds r0, r6, 0 + bl sub_811828C +_08118D5A: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task00_battle_intro_wireless + + thumb_func_start sub_8118D68 +sub_8118D68: @ 8118D68 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08118D90 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0x5 + bls _08118D86 + b _08118FB2 +_08118D86: + lsls r0, 2 + ldr r1, _08118D94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08118D90: .4byte 0x03005e00 +_08118D94: .4byte _08118D98 + .align 2, 0 +_08118D98: + .4byte _08118DB0 + .4byte _08118DBE + .4byte _08118E4C + .4byte _08118EA8 + .4byte _08118F00 + .4byte _08118FAC +_08118DB0: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0xC] + b _08118F84 +_08118DBE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r6 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118DD4 + b _08118FB2 +_08118DD4: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r1, _08118E2C + movs r0, 0xA + bl lcd_io_set + ldr r1, _08118E30 + movs r0, 0xC + bl lcd_io_set + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + ldr r2, _08118E34 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + movs r1, 0xF8 + lsls r1, 6 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08118E38 + movs r0, 0x4A + bl lcd_io_set + ldr r1, _08118E3C + ldr r2, _08118E40 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _08118E44 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, _08118E48 + subs r2, 0xC0 + adds r0, r2, 0 + strh r0, [r1] + b _08118FB2 + .align 2, 0 +_08118E2C: .4byte 0x00005c0a +_08118E30: .4byte 0x00005e0a +_08118E34: .4byte 0x0000f040 +_08118E38: .4byte 0x00003f3f +_08118E3C: .4byte 0x02022e16 +_08118E40: .4byte 0x0000ffd0 +_08118E44: .4byte 0x02022e18 +_08118E48: .4byte 0x02022e1c +_08118E4C: + ldr r2, _08118E9C + ldrh r3, [r2] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + adds r1, r3, r0 + strh r1, [r2] + movs r5, 0xFF + lsls r5, 8 + ands r1, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08118E6E + adds r0, r3, 0 + adds r0, 0xFF + strh r0, [r2] +_08118E6E: + ldrh r0, [r2] + adds r1, r5, 0 + ands r1, r0 + movs r0, 0x80 + lsls r0, 6 + cmp r1, r0 + beq _08118E7E + b _08118FB2 +_08118E7E: + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r6 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + ldr r2, _08118EA0 + ldrh r1, [r2] + ldr r0, _08118EA4 + ands r0, r1 + strh r0, [r2] + b _08118FB2 + .align 2, 0 +_08118E9C: .4byte 0x02022e26 +_08118EA0: .4byte 0x020243fc +_08118EA4: .4byte 0x0000fffe +_08118EA8: + ldr r3, _08118EF4 + ldrh r2, [r3] + movs r0, 0xFF + lsls r0, 8 + ands r0, r2 + movs r1, 0x98 + lsls r1, 7 + cmp r0, r1 + beq _08118EC2 + movs r1, 0xFF + lsls r1, 2 + adds r0, r2, r1 + strh r0, [r3] +_08118EC2: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r3, r0, r6 + ldrh r1, [r3, 0xC] + movs r2, 0xC + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08118ED8 + subs r0, r1, 0x2 + strh r0, [r3, 0xC] +_08118ED8: + ldr r1, _08118EF8 + ldrh r0, [r3, 0xC] + strh r0, [r1] + ldr r2, _08118EFC + negs r1, r0 + strh r1, [r2] + lsls r0, 16 + cmp r0, 0 + bne _08118FB2 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _08118FB2 + .align 2, 0 +_08118EF4: .4byte 0x02022e26 +_08118EF8: .4byte 0x02022e18 +_08118EFC: .4byte 0x02022e1c +_08118F00: + ldr r1, _08118F8C + ldrh r0, [r1] + adds r3, r0, 0x2 + strh r3, [r1] + ldr r1, _08118F90 + ldrh r0, [r1] + adds r0, 0x2 + strh r0, [r1] + ldr r5, _08118F94 + ldrh r2, [r5] + movs r0, 0xFF + lsls r0, 8 + ands r0, r2 + movs r1, 0xA0 + lsls r1, 7 + cmp r0, r1 + beq _08118F28 + adds r0, r2, 0 + adds r0, 0xFF + strh r0, [r5] +_08118F28: + lsls r0, r3, 16 + lsrs r0, 16 + cmp r0, 0 + bne _08118FB2 + str r0, [sp] + ldr r1, _08118F98 + ldr r2, _08118F9C + mov r0, sp + bl CpuSet + movs r0, 0 + bl lcd_io_get + ldr r1, _08118FA0 + ands r1, r0 + movs r0, 0 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl lcd_io_set + ldr r1, _08118FA4 + movs r0, 0x3 + strb r0, [r1, 0x15] + ldr r1, _08118FA8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 +_08118F84: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _08118FB2 + .align 2, 0 +_08118F8C: .4byte 0x02022e16 +_08118F90: .4byte 0x02022e1e +_08118F94: .4byte 0x02022e26 +_08118F98: .4byte 0x0600e000 +_08118F9C: .4byte 0x05000800 +_08118FA0: .4byte 0x0000bfff +_08118FA4: .4byte 0x02039b28 +_08118FA8: .4byte 0x03005e00 +_08118FAC: + adds r0, r4, 0 + bl sub_811828C +_08118FB2: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8118D68 + + thumb_func_start sub_8118FBC +sub_8118FBC: @ 8118FBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + adds r6, r2, 0 + adds r4, r3, 0 + ldr r0, [sp, 0x24] + ldr r7, [sp, 0x28] + ldr r2, [sp, 0x2C] + mov r9, r2 + ldr r5, [sp, 0x30] + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0811908C + ldr r2, [r1] + lsls r4, 2 + adds r2, 0x4 + adds r2, r4 + ldr r1, _08119090 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 11 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x80 + lsls r2, 3 + adds r1, r7, 0 + bl CpuSet + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 5 + adds r1, r7, 0 + adds r3, r5, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + adds r0, r6, 0 + adds r0, 0x8 + cmp r6, r0 + bge _08119068 + mov r12, r0 + mov r2, r8 + lsls r7, r2, 1 +_0811903A: + mov r1, r8 + adds r2, r1, 0 + adds r2, 0x8 + adds r4, r6, 0x1 + cmp r1, r2 + bge _08119062 + mov r0, r10 + lsls r3, r0, 12 + lsls r0, r6, 6 + add r0, r9 + adds r6, r7, r0 + subs r1, r2, r1 +_08119052: + adds r0, r5, 0 + orrs r0, r3 + strh r0, [r6] + adds r5, 0x1 + adds r6, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _08119052 +_08119062: + adds r6, r4, 0 + cmp r6, r12 + blt _0811903A +_08119068: + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 4 + mov r1, r9 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811908C: .4byte 0x020244d4 +_08119090: .4byte 0x020244e4 + thumb_func_end sub_8118FBC + + thumb_func_start sub_8119094 +sub_8119094: @ 8119094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + mov r8, r5 + ldr r5, [sp, 0x2C] + ldr r6, [sp, 0x30] + mov r9, r6 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r1, 24 + lsls r2, 24 + lsls r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + mov r7, r8 + lsls r7, 16 + lsrs r6, r7, 16 + lsls r5, 24 + lsrs r5, 24 + mov r0, r9 + lsls r0, 24 + mov r9, r0 + ldr r4, _08119158 + ldr r0, _0811915C + ldr r0, [r0] + lsrs r2, 22 + adds r0, 0x4 + adds r0, r2 + lsrs r3, 13 + ldr r0, [r0] + adds r0, r3 + str r0, [r4] + movs r0, 0xC0 + lsls r0, 19 + adds r6, r0 + str r6, [r4, 0x4] + ldr r0, _08119160 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + adds r2, r7, 0 + lsrs r2, 21 + mov r6, r9 + lsrs r6, 15 + subs r4, r2, r6 + lsrs r0, r1, 24 + adds r1, r0, 0 + adds r1, 0x8 + cmp r0, r1 + bge _08119148 + mov r9, r1 + mov r7, r12 + lsls r7, 1 + mov r8, r7 + lsls r5, 11 + str r5, [sp] +_08119110: + mov r2, r12 + adds r3, r2, 0 + adds r3, 0x8 + adds r5, r0, 0x1 + cmp r2, r3 + bge _08119142 + mov r1, r10 + lsls r6, r1, 12 + lsls r0, 6 + movs r7, 0xC0 + lsls r7, 19 + adds r0, r7 + ldr r1, [sp] + adds r0, r1, r0 + mov r7, r8 + adds r1, r7, r0 + subs r2, r3, r2 +_08119132: + adds r0, r4, 0 + orrs r0, r6 + strh r0, [r1] + adds r4, 0x1 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08119132 +_08119142: + adds r0, r5, 0 + cmp r0, r9 + blt _08119110 +_08119148: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08119158: .4byte 0x040000d4 +_0811915C: .4byte 0x020244d4 +_08119160: .4byte 0x80000400 + thumb_func_end sub_8119094 + + thumb_func_start dp04_initiate_movement +dp04_initiate_movement: @ 8119164 + 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, _08119188 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811918C + adds r0, r3, 0 + adds r1, r4, 0 + bl invoke_player_npc_state_changer_chooser + b _08119194 + .align 2, 0 +_08119188: .4byte 0x02037590 +_0811918C: + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_81193C8 +_08119194: + pop {r4} + pop {r0} + bx r0 + thumb_func_end dp04_initiate_movement + + thumb_func_start invoke_player_npc_state_changer_chooser +invoke_player_npc_state_changer_chooser: @ 811919C + push {r4,lr} + sub sp, 0x4 + mov r1, sp + strb r0, [r1] + ldr r4, _081191C8 + mov r0, sp + bl sub_81191CC + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + mov r1, sp + ldrb r1, [r1] + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081191C8: .4byte 0x0859744c + thumb_func_end invoke_player_npc_state_changer_chooser + + thumb_func_start sub_81191CC +sub_81191CC: @ 81191CC + push {r4,lr} + adds r4, r0, 0 + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldrb r1, [r4] + cmp r1, 0 + bne _081191F4 + strb r0, [r4] + ldr r2, _081191F0 + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _08119208 + strb r1, [r2, 0x2] + movs r0, 0 + b _0811921C + .align 2, 0 +_081191F0: .4byte 0x02037590 +_081191F4: + ldr r2, _08119210 + cmp r1, r3 + beq _08119218 + ldrb r0, [r2, 0x2] + cmp r0, 0x2 + beq _08119218 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _08119214 + strb r3, [r4] +_08119208: + movs r0, 0x2 + strb r0, [r2, 0x2] + movs r0, 0x3 + b _0811921C + .align 2, 0 +_08119210: .4byte 0x02037590 +_08119214: + movs r0, 0x1 + b _0811921A +_08119218: + movs r0, 0x2 +_0811921A: + strb r0, [r2, 0x2] +_0811921C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81191CC + + thumb_func_start sub_8119224 +sub_8119224: @ 8119224 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl player_npc_use_look1 + bl sub_811A128 + pop {r0} + bx r0 + thumb_func_end sub_8119224 + + thumb_func_start sub_8119238 +sub_8119238: @ 8119238 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08119268 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0811926C + adds r4, r0, r1 + ldrb r1, [r4, 0x1E] + adds r0, r5, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + beq _08119270 + adds r0, r5, 0 + bl sub_808B828 + bl sub_811A128 + b _0811927A + .align 2, 0 +_08119268: .4byte 0x02037590 +_0811926C: .4byte 0x02037350 +_08119270: + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_8119224 +_0811927A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8119238 + + thumb_func_start sub_8119280 +sub_8119280: @ 8119280 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + ldr r6, _081192B4 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081192B8 + adds r4, r0, r1 + ldrb r1, [r4, 0x1E] + adds r0, r5, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _081192C6 + ldrb r0, [r6, 0xB] + cmp r0, 0 + beq _081192BC + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl npc_state_reaction_to_tile + b _0811933A + .align 2, 0 +_081192B4: .4byte 0x02037590 +_081192B8: .4byte 0x02037350 +_081192BC: + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8119224 + b _0811933A +_081192C6: + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119316 + cmp r4, 0x6 + bne _081192E8 + adds r0, r5, 0 + bl npc_use_some_d2s_and_sound + b _0811933A +_081192E8: + bl sub_811A128 + cmp r4, 0x4 + bne _08119304 + adds r0, r5, 0 + bl sub_808B324 + lsls r0, 24 + cmp r0, 0 + beq _08119304 + adds r0, r5, 0 + bl sub_808B7BC + b _0811933A +_08119304: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0811933A + adds r0, r7, 0 + bl tile_sound_react + b _0811933A +_08119316: + ldr r1, _08119340 + ldrb r0, [r6, 0xA] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r7, 0 + bl _call_via_r1 + ldrb r2, [r6, 0xA] + lsls r0, r2, 24 + lsrs r1, r0, 24 + lsrs r0, 25 + adds r0, r2, r0 + strb r0, [r6, 0xB] + cmp r1, 0x1 + bhi _0811933A + adds r0, r2, 0x1 + strb r0, [r6, 0xA] +_0811933A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08119340: .4byte 0x0859745c + thumb_func_end sub_8119280 + + thumb_func_start npc_state_reaction_to_tile +npc_state_reaction_to_tile: @ 8119344 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + ldr r6, _0811937C + ldrb r0, [r6, 0xB] + cmp r0, 0 + beq _0811935A + subs r0, 0x1 + strb r0, [r6, 0xB] + strb r0, [r6, 0xA] +_0811935A: + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0xA + bhi _081193AE + cmp r4, 0x6 + bne _08119380 + adds r0, r5, 0 + bl npc_use_some_d2s_and_sound + b _081193BE + .align 2, 0 +_0811937C: .4byte 0x02037590 +_08119380: + bl sub_811A128 + cmp r4, 0x4 + bne _0811939C + adds r0, r5, 0 + bl sub_808B324 + lsls r0, 24 + cmp r0, 0 + beq _0811939C + adds r0, r5, 0 + bl sub_808B7BC + b _081193BE +_0811939C: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _081193BE + adds r0, r7, 0 + bl tile_sound_react + b _081193BE +_081193AE: + ldr r0, _081193C4 + ldrb r1, [r6, 0xA] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r7, 0 + bl _call_via_r1 +_081193BE: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081193C4: .4byte 0x0859745c + thumb_func_end npc_state_reaction_to_tile + + thumb_func_start sub_81193C8 +sub_81193C8: @ 81193C8 + push {r4,lr} + sub sp, 0x4 + mov r3, sp + strb r0, [r3] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r4, _081193FC + mov r0, sp + bl sub_8119400 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + mov r1, sp + ldrb r1, [r1] + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081193FC: .4byte 0x08597468 + thumb_func_end sub_81193C8 + + thumb_func_start sub_8119400 +sub_8119400: @ 8119400 + push {r4,lr} + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r4, _08119424 + ldr r3, _08119428 + ldrb r3, [r3, 0x8] + lsls r3, 2 + adds r3, r4 + ldr r3, [r3] + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08119424: .4byte 0x0859749c +_08119428: .4byte 0x02037590 + thumb_func_end sub_8119400 + + thumb_func_start sub_811942C +sub_811942C: @ 811942C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08119460 + movs r0, 0 + strb r0, [r2, 0xA] + ldrb r1, [r4] + cmp r1, 0 + bne _0811946C + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _08119464 + strb r3, [r4] + strb r1, [r2, 0x2] + movs r0, 0x2 + strb r0, [r2, 0x8] + movs r0, 0x3 + b _081194C0 + .align 2, 0 +_08119460: .4byte 0x02037590 +_08119464: + strb r3, [r4] + strb r1, [r2, 0x2] + movs r0, 0 + b _081194C0 +_0811946C: + cmp r1, r3 + bne _08119492 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0811948A + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _0811948A + adds r0, 0x1 + strb r0, [r2, 0xB] + movs r0, 0x4 + strb r0, [r2, 0x8] + movs r0, 0xB + b _081194C0 +_0811948A: + ldrb r0, [r4] + ldr r2, _081194B8 + cmp r0, r3 + beq _081194BC +_08119492: + ldr r0, _081194B8 + ldrb r1, [r0, 0x2] + adds r2, r0, 0 + cmp r1, 0x2 + beq _081194BC + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x8] + ldrb r0, [r4] + strb r0, [r2, 0x9] + strb r1, [r2, 0x2] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_8119400 + lsls r0, 24 + lsrs r0, 24 + b _081194C0 + .align 2, 0 +_081194B8: .4byte 0x02037590 +_081194BC: + movs r0, 0x2 + strb r0, [r2, 0x2] +_081194C0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811942C + + thumb_func_start sub_81194C8 +sub_81194C8: @ 81194C8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _081194F0 + ldrb r0, [r4, 0x9] + strb r0, [r5] + ldrb r0, [r4, 0xA] + adds r0, 0x1 + strb r0, [r4, 0xA] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bls _081194F4 + movs r0, 0x1 + strb r0, [r4, 0x2] + movs r0, 0 + strb r0, [r4, 0x8] + bl sub_811A128 + movs r0, 0x1 + b _0811953A + .align 2, 0 +_081194F0: .4byte 0x02037590 +_081194F4: + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_8119D30 + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _08119536 + bl sub_811A128 + movs r0, 0x1 + strb r0, [r4, 0xB] + adds r0, r6, 0 + bl direction_reversed + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0811952A + movs r0, 0x6 + strb r0, [r4, 0x8] + movs r0, 0x9 + b _0811953A +_0811952A: + movs r0, 0x2 + strb r0, [r4, 0x2] + movs r0, 0x5 + strb r0, [r4, 0x8] + movs r0, 0x8 + b _0811953A +_08119536: + strb r6, [r5] + movs r0, 0 +_0811953A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81194C8 + + thumb_func_start sub_8119540 +sub_8119540: @ 8119540 + push {r4-r7,lr} + adds r7, r0, 0 + lsls r4, r2, 16 + lsrs r4, 16 + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _0811958C + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119590 + adds r1, r0, r1 + movs r0, 0 + strb r0, [r5, 0x2] + movs r0, 0x2 + ands r4, r0 + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0 + bne _08119594 + strb r4, [r5, 0xA] + ldrb r0, [r1, 0x1E] + bl sub_8089954 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0811959A + strb r6, [r7] + strb r0, [r5, 0x8] + bl sub_811A128 + movs r0, 0x4 + b _081195D8 + .align 2, 0 +_0811958C: .4byte 0x02037590 +_08119590: .4byte 0x02037350 +_08119594: + ldrb r0, [r5, 0xA] + adds r0, 0x1 + strb r0, [r5, 0xA] +_0811959A: + ldr r1, _081195B0 + ldrb r0, [r1, 0xA] + cmp r0, 0x27 + bls _081195B4 + strb r6, [r7] + movs r0, 0x3 + strb r0, [r1, 0x8] + bl sub_811A128 + movs r0, 0x6 + b _081195D8 + .align 2, 0 +_081195B0: .4byte 0x02037590 +_081195B4: + ldrb r0, [r7] + cmp r0, r6 + bne _081195CA + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0x4 + strb r0, [r1, 0x8] + bl sub_811A128 + movs r0, 0xA + b _081195D8 +_081195CA: + cmp r0, 0 + beq _081195D4 + movs r0, 0x1 + strb r0, [r1, 0x2] + b _081195D6 +_081195D4: + strb r6, [r7] +_081195D6: + movs r0, 0x5 +_081195D8: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8119540 + + thumb_func_start sub_81195E0 +sub_81195E0: @ 81195E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r4, _08119640 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119644 + adds r7, r0, r1 + movs r0, 0x2 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _08119652 + bl sub_811A128 + ldrb r0, [r7, 0x1E] + bl sub_8089954 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08119648 + movs r0, 0x2 + strb r0, [r4, 0x8] + adds r0, r6, 0 + mov r1, r9 + mov r2, r8 + bl sub_8119400 + lsls r0, 24 + lsrs r0, 24 + b _08119676 + .align 2, 0 +_08119640: .4byte 0x02037590 +_08119644: .4byte 0x02037350 +_08119648: + strb r5, [r6] + strb r0, [r4, 0x2] + strb r0, [r4, 0x8] + movs r0, 0x4 + b _08119676 +_08119652: + ldrb r0, [r6] + cmp r0, 0 + bne _0811965C + strb r5, [r6] + b _08119668 +_0811965C: + cmp r0, r2 + beq _0811966E + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _0811966E + movs r0, 0x1 +_08119668: + strb r0, [r4, 0x2] + movs r0, 0x6 + b _08119676 +_0811966E: + ldr r1, _08119684 + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0x7 +_08119676: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08119684: .4byte 0x02037590 + thumb_func_end sub_81195E0 + + thumb_func_start sub_8119688 +sub_8119688: @ 8119688 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r4, _081196E4 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081196E8 + adds r7, r0, r1 + movs r0, 0x2 + mov r9, r0 + movs r0, 0x2 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _08119720 + bl sub_811A128 + ldrb r0, [r7, 0x1E] + bl sub_8089954 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0811970C + strb r1, [r4, 0x8] + ldrb r0, [r6] + cmp r0, 0 + bne _081196EC + strb r5, [r6] + b _081196F6 + .align 2, 0 +_081196E4: .4byte 0x02037590 +_081196E8: .4byte 0x02037350 +_081196EC: + cmp r0, r5 + beq _081196FC + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _081196FC +_081196F6: + strb r1, [r4, 0x2] + movs r0, 0x4 + b _08119750 +_081196FC: + ldr r1, _08119708 + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xC + b _08119750 + .align 2, 0 +_08119708: .4byte 0x02037590 +_0811970C: + mov r0, r9 + strb r0, [r4, 0x8] + adds r0, r6, 0 + mov r1, r10 + mov r2, r8 + bl sub_8119400 + lsls r0, 24 + lsrs r0, 24 + b _08119750 +_08119720: + ldrb r0, [r6] + cmp r0, 0 + bne _08119736 + strb r5, [r6] + mov r1, r9 + strb r1, [r4, 0x8] + strb r0, [r4, 0x2] + bl sub_811A128 + movs r0, 0x5 + b _08119750 +_08119736: + cmp r2, r0 + beq _08119748 + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _08119748 + movs r0, 0 + strb r0, [r4, 0x2] + movs r0, 0x5 + b _08119750 +_08119748: + ldr r1, _08119760 + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xA +_08119750: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08119760: .4byte 0x02037590 + thumb_func_end sub_8119688 + + thumb_func_start sub_8119764 +sub_8119764: @ 8119764 + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r6, _081197B8 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081197BC + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r0, 0x18] + lsls r1, 28 + lsrs r1, 28 + bl npc_set_direction + movs r0, 0 + strb r0, [r6, 0x8] + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8119400 + lsls r0, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081197B8: .4byte 0x02037590 +_081197BC: .4byte 0x02037350 + thumb_func_end sub_8119764 + + thumb_func_start sub_81197C0 +sub_81197C0: @ 81197C0 + push {r4,lr} + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r4, _081197E0 + movs r3, 0 + strb r3, [r4, 0x8] + bl sub_8119400 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081197E0: .4byte 0x02037590 + thumb_func_end sub_81197C0 + + thumb_func_start sub_81197E4 +sub_81197E4: @ 81197E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl player_npc_use_look1 + pop {r0} + bx r0 + thumb_func_end sub_81197E4 + + thumb_func_start sub_81197F4 +sub_81197F4: @ 81197F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08119828 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0811982C + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _0811981A + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_0811981A: + adds r0, r4, 0 + bl player_npc_use_look1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08119828: .4byte 0x02037590 +_0811982C: .4byte 0x02037350 + thumb_func_end sub_81197F4 + + thumb_func_start sub_8119830 +sub_8119830: @ 8119830 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, _08119860 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119864 + adds r4, r0, r1 + ldrb r1, [r4, 0x1E] + adds r0, r5, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119868 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_81197E4 + b _081198BA + .align 2, 0 +_08119860: .4byte 0x02037590 +_08119864: .4byte 0x02037350 +_08119868: + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0xA + bhi _081198B4 + cmp r4, 0x6 + bne _0811988A + adds r0, r5, 0 + bl npc_use_some_d2s_and_sound + b _081198BA +_0811988A: + cmp r4, 0x4 + bne _081198A2 + adds r0, r5, 0 + bl sub_808B324 + lsls r0, 24 + cmp r0, 0 + beq _081198A2 + adds r0, r5, 0 + bl sub_808B7BC + b _081198BA +_081198A2: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _081198BA + adds r0, r6, 0 + bl tile_sound_react + b _081198BA +_081198B4: + adds r0, r6, 0 + bl sub_808B750 +_081198BA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8119830 + + thumb_func_start sub_81198C0 +sub_81198C0: @ 81198C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081198F4 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081198F8 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _081198E6 + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_081198E6: + adds r0, r4, 0 + bl sub_808B8C0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081198F4: .4byte 0x02037590 +_081198F8: .4byte 0x02037350 + thumb_func_end sub_81198C0 + + thumb_func_start sub_81198FC +sub_81198FC: @ 81198FC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08119930 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119934 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119922 + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_08119922: + adds r0, r4, 0 + bl sub_808B8D8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08119930: .4byte 0x02037590 +_08119934: .4byte 0x02037350 + thumb_func_end sub_81198FC + + thumb_func_start sub_8119938 +sub_8119938: @ 8119938 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0811996C + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119970 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _0811995E + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_0811995E: + adds r0, r4, 0 + bl sub_808B8A8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811996C: .4byte 0x02037590 +_08119970: .4byte 0x02037350 + thumb_func_end sub_8119938 + + thumb_func_start sub_8119974 +sub_8119974: @ 8119974 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081199A8 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081199AC + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _0811999A + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_0811999A: + adds r0, r4, 0 + bl sub_808B8F0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081199A8: .4byte 0x02037590 +_081199AC: .4byte 0x02037350 + thumb_func_end sub_8119974 + + thumb_func_start sub_81199B0 +sub_81199B0: @ 81199B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081199DC + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081199E0 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _081199E4 + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_8119974 + b _08119A1E + .align 2, 0 +_081199DC: .4byte 0x02037590 +_081199E0: .4byte 0x02037350 +_081199E4: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08119A18 + cmp r1, 0x9 + beq _08119A18 + cmp r1, 0x6 + bne _08119A02 + adds r0, r4, 0 + bl sub_808B938 + b _08119A1E +_08119A02: + subs r0, r1, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08119A1E + cmp r1, 0xB + bhi _08119A18 + adds r0, r4, 0 + bl sub_8119974 + b _08119A1E +_08119A18: + adds r0, r4, 0 + bl sub_808B914 +_08119A1E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81199B0 + + thumb_func_start sub_8119A24 +sub_8119A24: @ 8119A24 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + beq _08119A58 + cmp r0, 0x7 + beq _08119A84 + cmp r0, 0x9 + bls _08119A50 + adds r0, r1, 0 + adds r1, r5, 0 + bl sub_8119FC4 + lsls r0, 24 + cmp r0, 0 + bne _08119A58 +_08119A50: + adds r0, r5, 0 + bl sub_81197F4 + b _08119A84 +_08119A58: + ldr r0, _08119A8C + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _08119A90 + adds r4, r0 + movs r0, 0x22 + bl audio_play + ldrb r0, [r4, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_8093514 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc +_08119A84: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08119A8C: .4byte 0x02037590 +_08119A90: .4byte 0x02037350 + thumb_func_end sub_8119A24 + + thumb_func_start sub_8119A94 +sub_8119A94: @ 8119A94 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_808B95C + pop {r0} + bx r0 + thumb_func_end sub_8119A94 + + thumb_func_start sub_8119AA4 +sub_8119AA4: @ 8119AA4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r7, _08119AD4 + ldrb r1, [r7, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119AD8 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119ADC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_808B8A8 + b _08119B2C + .align 2, 0 +_08119AD4: .4byte 0x02037590 +_08119AD8: .4byte 0x02037350 +_08119ADC: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119B22 + cmp r1, 0x6 + bne _08119AFE + adds r0, r4, 0 + bl sub_808B938 + b _08119B2C +_08119AFE: + cmp r1, 0x9 + beq _08119B12 + cmp r1, 0x4 + bhi _08119B2C + ldrb r0, [r5, 0x1E] + bl sub_8089954 + lsls r0, 24 + cmp r0, 0 + beq _08119B1A +_08119B12: + adds r0, r4, 0 + bl sub_808B8A8 + b _08119B2C +_08119B1A: + adds r0, r4, 0 + bl sub_808B980 + b _08119B2C +_08119B22: + adds r0, r6, 0 + bl sub_808B9BC + movs r0, 0x2 + strb r0, [r7, 0x2] +_08119B2C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8119AA4 + + thumb_func_start sub_8119B34 +sub_8119B34: @ 8119B34 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r7, _08119B64 + ldrb r1, [r7, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119B68 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119B6C + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_808B8C0 + b _08119BBC + .align 2, 0 +_08119B64: .4byte 0x02037590 +_08119B68: .4byte 0x02037350 +_08119B6C: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119BB2 + cmp r1, 0x6 + bne _08119B8E + adds r0, r4, 0 + bl sub_808B938 + b _08119BBC +_08119B8E: + cmp r1, 0x9 + beq _08119BA2 + cmp r1, 0x4 + bhi _08119BBC + ldrb r0, [r5, 0x1E] + bl sub_8089954 + lsls r0, 24 + cmp r0, 0 + beq _08119BAA +_08119BA2: + adds r0, r4, 0 + bl sub_808B8A8 + b _08119BBC +_08119BAA: + adds r0, r4, 0 + bl sub_808B980 + b _08119BBC +_08119BB2: + adds r0, r6, 0 + bl sub_808B9A4 + movs r0, 0x2 + strb r0, [r7, 0x2] +_08119BBC: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8119B34 + + thumb_func_start sub_8119BC4 +sub_8119BC4: @ 8119BC4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r0, _08119BF4 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08119BF8 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119BFC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_808B8D8 + b _08119C36 + .align 2, 0 +_08119BF4: .4byte 0x02037590 +_08119BF8: .4byte 0x02037350 +_08119BFC: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119C30 + cmp r1, 0x6 + bne _08119C1E + adds r0, r4, 0 + bl npc_use_some_d2s_and_sound + b _08119C36 +_08119C1E: + subs r0, r1, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08119C36 + adds r0, r4, 0 + bl sub_808B8D8 + b _08119C36 +_08119C30: + adds r0, r6, 0 + bl npc_use_some_d2s +_08119C36: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8119BC4 + + thumb_func_start sub_8119C3C +sub_8119C3C: @ 8119C3C + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r2, r1, 16 + ldr r0, _08119C60 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08119C5A + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8119C64 +_08119C5A: + pop {r0} + bx r0 + .align 2, 0 +_08119C60: .4byte 0x02037590 + thumb_func_end sub_8119C3C + + thumb_func_start sub_8119C64 +sub_8119C64: @ 8119C64 + push {r4,r5,lr} + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r5, 0 + bl sub_8119DF8 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, _08119C8C + ldr r0, [r4, 0xC] + movs r1, 0xF + ands r0, r1 + cmp r2, r0 + bne _08119C90 + ldrb r0, [r4, 0x14] + cmp r0, 0xFE + bhi _08119C9A + adds r0, 0x1 + strb r0, [r4, 0x14] + b _08119C9A + .align 2, 0 +_08119C8C: .4byte 0x02037590 +_08119C90: + adds r0, r2, 0 + bl sub_8119D80 + movs r0, 0 + strb r0, [r4, 0xB] +_08119C9A: + movs r0, 0xF + adds r2, r5, 0 + ands r2, r0 + ldr r4, _08119CB8 + ldr r0, [r4, 0x10] + movs r1, 0xF + ands r0, r1 + cmp r2, r0 + bne _08119CBC + ldrb r0, [r4, 0x1C] + cmp r0, 0xFE + bhi _08119CC6 + adds r0, 0x1 + strb r0, [r4, 0x1C] + b _08119CC6 + .align 2, 0 +_08119CB8: .4byte 0x02037590 +_08119CBC: + adds r0, r2, 0 + bl sub_8119DBC + movs r0, 0 + strb r0, [r4, 0xB] +_08119CC6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8119C64 + + thumb_func_start sub_8119CCC +sub_8119CCC: @ 8119CCC + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + movs r2, 0 + ldrb r0, [r3] + cmp r0, 0 + beq _08119CF6 + ldr r5, _08119D10 +_08119CDC: + adds r0, r2, r5 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bhi _08119D0C + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08119CDC +_08119CF6: + movs r2, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _08119D26 + ldr r3, _08119D14 +_08119D00: + adds r0, r2, r3 + adds r1, r4, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _08119D18 +_08119D0C: + movs r0, 0 + b _08119D28 + .align 2, 0 +_08119D10: .4byte 0x020375a4 +_08119D14: .4byte 0x020375ac +_08119D18: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08119D00 +_08119D26: + movs r0, 0x1 +_08119D28: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8119CCC + + thumb_func_start sub_8119D30 +sub_8119D30: @ 8119D30 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_08119D36: + ldr r0, _08119D68 + adds r4, r5, r0 + ldr r0, _08119D6C + ldr r1, [r0, 0xC] + ldr r2, [r0, 0x10] + ldr r0, [r4, 0x8] + ands r1, r0 + ldr r0, [r4, 0xC] + ands r2, r0 + ldr r0, [r4] + cmp r1, r0 + bne _08119D70 + ldr r0, [r4, 0x4] + cmp r2, r0 + bne _08119D70 + ldr r0, [r4, 0x10] + ldr r1, [r4, 0x14] + bl sub_8119CCC + lsls r0, 24 + cmp r0, 0 + beq _08119D70 + ldrb r0, [r4, 0x18] + b _08119D7A + .align 2, 0 +_08119D68: .4byte 0x085974c0 +_08119D6C: .4byte 0x02037590 +_08119D70: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + bls _08119D36 + movs r0, 0 +_08119D7A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8119D30 + + thumb_func_start sub_8119D80 +sub_8119D80: @ 8119D80 + push {r4,lr} + lsls r0, 24 + ldr r3, _08119DB8 + ldr r2, [r3, 0xC] + lsls r2, 4 + movs r1, 0xF0 + lsls r1, 20 + ands r1, r0 + lsrs r1, 24 + orrs r2, r1 + str r2, [r3, 0xC] + movs r1, 0x7 + adds r4, r3, 0 + adds r3, 0x14 +_08119D9C: + adds r2, r1, r3 + subs r1, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08119D9C + movs r0, 0x1 + strb r0, [r4, 0x14] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08119DB8: .4byte 0x02037590 + thumb_func_end sub_8119D80 + + thumb_func_start sub_8119DBC +sub_8119DBC: @ 8119DBC + push {r4,lr} + lsls r0, 24 + ldr r3, _08119DF4 + ldr r2, [r3, 0x10] + lsls r2, 4 + movs r1, 0xF0 + lsls r1, 20 + ands r1, r0 + lsrs r1, 24 + orrs r2, r1 + str r2, [r3, 0x10] + movs r1, 0x7 + adds r4, r3, 0 + adds r3, 0x1C +_08119DD8: + adds r2, r1, r3 + subs r1, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08119DD8 + movs r0, 0x1 + strb r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08119DF4: .4byte 0x02037590 + thumb_func_end sub_8119DBC + + thumb_func_start sub_8119DF8 +sub_8119DF8: @ 8119DF8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08119E0C + movs r0, 0x2 + b _08119E32 +_08119E0C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08119E18 + movs r0, 0x1 + b _08119E32 +_08119E18: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08119E24 + movs r0, 0x3 + b _08119E32 +_08119E24: + movs r0, 0x10 + ands r2, r0 + cmp r2, 0 + bne _08119E30 + movs r0, 0 + b _08119E32 +_08119E30: + movs r0, 0x4 +_08119E32: + pop {r1} + bx r1 + thumb_func_end sub_8119DF8 + + thumb_func_start sub_8119E38 +sub_8119E38: @ 8119E38 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _08119E9C + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _08119EA0 + 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 numbers_move_direction + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + 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_8119EA4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08119E9C: .4byte 0x02037590 +_08119EA0: .4byte 0x02037350 + thumb_func_end sub_8119E38 + + thumb_func_start sub_8119EA4 +sub_8119EA4: @ 8119EA4 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + adds r5, r4, 0 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + str r5, [sp] + bl sub_808B094 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bhi _08119EE4 + cmp r4, 0 + bne _08119EE0 + adds r0, r5, 0 + bl sub_8119F18 + lsls r0, 24 + cmp r0, 0 + beq _08119EDC + movs r4, 0x2 +_08119EDC: + cmp r4, 0 + beq _08119EE4 +_08119EE0: + bl sub_8119F50 +_08119EE4: + adds r0, r4, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8119EA4 + + thumb_func_start sub_8119EF0 +sub_8119EF0: @ 8119EF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8119F18 + lsls r0, 24 + cmp r0, 0 + bne _08119F08 + ldr r0, _08119F0C + ldrb r0, [r0, 0x17] + cmp r0, 0x8 + bne _08119F10 +_08119F08: + movs r0, 0x1 + b _08119F12 + .align 2, 0 +_08119F0C: .4byte 0x02037318 +_08119F10: + movs r0, 0 +_08119F12: + pop {r1} + bx r1 + thumb_func_end sub_8119EF0 + + thumb_func_start sub_8119F18 +sub_8119F18: @ 8119F18 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80899D0 + lsls r0, 24 + cmp r0, 0 + bne _08119F42 + adds r0, r4, 0 + bl sub_8089750 + lsls r0, 24 + cmp r0, 0 + beq _08119F46 + bl player_get_height + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _08119F46 +_08119F42: + movs r0, 0x1 + b _08119F48 +_08119F46: + movs r0, 0 +_08119F48: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8119F18 + + thumb_func_start sub_8119F50 +sub_8119F50: @ 8119F50 + push {lr} + ldr r0, _08119F6C + ldrb r0, [r0] + cmp r0, 0 + beq _08119F66 + ldr r1, _08119F70 + ldrb r0, [r1] + cmp r0, 0x63 + bhi _08119F66 + adds r0, 0x1 + strb r0, [r1] +_08119F66: + pop {r0} + bx r0 + .align 2, 0 +_08119F6C: .4byte 0x0203ab54 +_08119F70: .4byte 0x0203ab55 + thumb_func_end sub_8119F50 + + thumb_func_start sub_8119F74 +sub_8119F74: @ 8119F74 + push {r4,r5,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + movs r1, 0xFD + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08119F9E + adds r0, r4, 0 + bl sub_8089968 + lsls r0, 24 + cmp r0, 0 + bne _08119FB6 + adds r0, r4, 0 + bl sub_8089990 + b _08119FB0 +_08119F9E: + adds r0, r5, 0 + bl sub_808997C + lsls r0, 24 + cmp r0, 0 + bne _08119FB6 + adds r0, r5, 0 + bl sub_80899A4 +_08119FB0: + lsls r0, 24 + cmp r0, 0 + beq _08119FBA +_08119FB6: + movs r0, 0 + b _08119FBC +_08119FBA: + movs r0, 0x1 +_08119FBC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8119F74 + + thumb_func_start sub_8119FC4 +sub_8119FC4: @ 8119FC4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + movs r3, 0xFF + lsls r3, 24 + adds r1, r3 + lsrs r1, 24 + cmp r1, 0x1 + bhi _08119FE4 + cmp r0, 0xA + beq _08119FEC + cmp r0, 0xC + bne _08119FF0 + b _08119FEC +_08119FE4: + cmp r2, 0xB + beq _08119FEC + cmp r2, 0xD + bne _08119FF0 +_08119FEC: + movs r0, 0 + b _08119FF2 +_08119FF0: + movs r0, 0x1 +_08119FF2: + pop {r1} + bx r1 + thumb_func_end sub_8119FC4 + + thumb_func_start sub_8119FF8 +sub_8119FF8: @ 8119FF8 + push {r4,lr} + sub sp, 0x4 + ldr r0, _0811A034 + ldrb r1, [r0] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + bne _0811A038 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8119F18 + lsls r0, 24 + cmp r0, 0 + bne _0811A038 + movs r0, 0 + b _0811A03A + .align 2, 0 +_0811A034: .4byte 0x02037590 +_0811A038: + movs r0, 0x1 +_0811A03A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8119FF8 + + thumb_func_start player_should_look_direction_be_enforced_upon_movement +player_should_look_direction_be_enforced_upon_movement: @ 811A044 + push {lr} + movs r0, 0x4 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _0811A078 + ldr r2, _0811A070 + ldr r0, _0811A074 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + bl sub_8089954 + lsls r0, 24 + cmp r0, 0 + beq _0811A078 + movs r0, 0 + b _0811A07A + .align 2, 0 +_0811A070: .4byte 0x02037350 +_0811A074: .4byte 0x02037590 +_0811A078: + movs r0, 0x1 +_0811A07A: + pop {r1} + bx r1 + thumb_func_end player_should_look_direction_be_enforced_upon_movement + + thumb_func_start sub_811A080 +sub_811A080: @ 811A080 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0811A0A8 + movs r0, 0 + strb r0, [r1] + ldr r0, _0811A0AC + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0811A0B0 + movs r0, 0x1 + bl walkrun_set_bike_bits + bl sav1_reset_x2C + bl sub_8085784 + b _0811A0C4 + .align 2, 0 +_0811A0A8: .4byte 0x02037348 +_0811A0AC: .4byte 0x02037590 +_0811A0B0: + adds r0, r2, 0 + bl walkrun_set_bike_bits + ldr r4, _0811A0CC + adds r0, r4, 0 + bl sav1_set_x2C + adds r0, r4, 0 + bl sub_80858C4 +_0811A0C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811A0CC: .4byte 0x00000193 + thumb_func_end sub_811A080 + + thumb_func_start sub_811A0D0 +sub_811A0D0: @ 811A0D0 + push {lr} + ldr r2, _0811A10C + movs r3, 0 + strb r3, [r2, 0x8] + strb r3, [r2, 0x9] + strb r3, [r2, 0xA] + strb r3, [r2, 0xB] + str r0, [r2, 0xC] + str r1, [r2, 0x10] + movs r1, 0 + adds r2, 0x14 +_0811A0E6: + adds r0, r1, r2 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _0811A0E6 + movs r1, 0 + ldr r3, _0811A110 + movs r2, 0 +_0811A0FA: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _0811A0FA + pop {r0} + bx r0 + .align 2, 0 +_0811A10C: .4byte 0x02037590 +_0811A110: .4byte 0x020375ac + thumb_func_end sub_811A0D0 + + thumb_func_start sub_811A114 +sub_811A114: @ 811A114 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0811A124 + strb r0, [r2, 0xA] + lsrs r1, r0, 1 + adds r0, r1 + strb r0, [r2, 0xB] + bx lr + .align 2, 0 +_0811A124: .4byte 0x02037590 + thumb_func_end sub_811A114 + + thumb_func_start sub_811A128 +sub_811A128: @ 811A128 + ldr r1, _0811A134 + movs r0, 0 + strb r0, [r1, 0xA] + strb r0, [r1, 0xB] + bx lr + .align 2, 0 +_0811A134: .4byte 0x02037590 + thumb_func_end sub_811A128 + + thumb_func_start sub_811A138 +sub_811A138: @ 811A138 + push {lr} + sub sp, 0x8 + ldr r1, _0811A160 + mov r0, sp + movs r2, 0x6 + bl memcpy + ldr r2, _0811A164 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811A168 + ldrb r0, [r2, 0xA] + lsls r0, 1 + add r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + b _0811A182 + .align 2, 0 +_0811A160: .4byte 0x085974b8 +_0811A164: .4byte 0x02037590 +_0811A168: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811A174 + movs r0, 0x3 + b _0811A182 +_0811A174: + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _0811A180 + movs r0, 0x1 + b _0811A182 +_0811A180: + movs r0, 0x2 +_0811A182: + add sp, 0x8 + pop {r1} + bx r1 + thumb_func_end sub_811A138 + + thumb_func_start sub_811A188 +sub_811A188: @ 811A188 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0811A1D8 + ldrb r1, [r5] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811A1D0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089954 + lsls r0, 24 + cmp r0, 0 + beq _0811A1D0 + movs r0, 0x2 + strb r0, [r5, 0x8] + bl player_get_direction_upper_4bits + lsls r0, 24 + lsrs r0, 24 + bl sub_808C1B4 +_0811A1D0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811A1D8: .4byte 0x02037590 + thumb_func_end sub_811A188 + + thumb_func_start is_tile_to_run_on +is_tile_to_run_on: @ 811A1DC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0811A200 + ldrb r1, [r0, 0x1A] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811A1FC + adds r0, r2, 0 + bl sub_8119F18 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0811A204 +_0811A1FC: + movs r0, 0x1 + b _0811A206 + .align 2, 0 +_0811A200: .4byte 0x02037318 +_0811A204: + movs r0, 0 +_0811A206: + pop {r1} + bx r1 + thumb_func_end is_tile_to_run_on + + thumb_func_start sub_811A20C +sub_811A20C: @ 811A20C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + adds r5, r3, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + bl clear_tasks + ldr r0, _0811A26C + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _0811A270 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + strh r5, [r0, 0x16] + adds r0, r4, 0 + movs r1, 0x2 + mov r2, r8 + bl set_word_task_arg + adds r0, r4, 0 + movs r1, 0x4 + mov r2, r9 + bl set_word_task_arg + ldr r0, _0811A274 + bl set_callback2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811A26C: .4byte sub_811A2C0 + 1 +_0811A270: .4byte 0x03005e00 +_0811A274: .4byte sub_811A278 + 1 + thumb_func_end sub_811A20C + + thumb_func_start sub_811A278 +sub_811A278: @ 811A278 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_811A278 + + thumb_func_start sub_811A290 +sub_811A290: @ 811A290 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl copy_super_sprites_to_oam + bl copy_queue_process + pop {r0} + bx r0 + thumb_func_end sub_811A290 + + thumb_func_start sub_811A2A4 +sub_811A2A4: @ 811A2A4 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0811A2BC + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + str r1, [r2] + movs r0, 0 + strh r0, [r2, 0x8] + bx lr + .align 2, 0 +_0811A2BC: .4byte 0x03005e00 + thumb_func_end sub_811A2A4 + + thumb_func_start sub_811A2C0 +sub_811A2C0: @ 811A2C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl is_c1_link_related_active + cmp r0, 0 + bne _0811A2DC +_0811A2CE: + adds r0, r4, 0 + bl sub_811A428 + lsls r0, 24 + cmp r0, 0 + bne _0811A2CE + b _0811A2EA +_0811A2DC: + adds r0, r4, 0 + bl sub_811A428 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0811A2F2 +_0811A2EA: + ldr r1, _0811A2F8 + adds r0, r4, 0 + bl sub_811A2A4 +_0811A2F2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811A2F8: .4byte sub_811A2FC + 1 + thumb_func_end sub_811A2C0 + + thumb_func_start sub_811A2FC +sub_811A2FC: @ 811A2FC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0811A324 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _0811A318 + b _0811A41C +_0811A318: + lsls r0, 2 + ldr r1, _0811A328 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811A324: .4byte 0x03005e08 +_0811A328: .4byte _0811A32C + .align 2, 0 +_0811A32C: + .4byte _0811A344 + .4byte _0811A370 + .4byte _0811A3CC + .4byte _0811A3D4 + .4byte _0811A3EC + .4byte _0811A40C +_0811A344: + ldr r0, _0811A36C + bl SetVBlankCallback + 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 sub_80A1AD4 + movs r0, 0x5 + b _0811A41A + .align 2, 0 +_0811A36C: .4byte sub_811A290 + 1 +_0811A370: + bl sub_811AAAC + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + adds r0, r4, 0 + bl sub_811A88C + cmp r0, 0 + beq _0811A39E + movs r0, 0x1 + negs r0, r0 + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x3 + strh r0, [r5] + strh r4, [r5, 0xC] + b _0811A41C +_0811A39E: + cmp r4, 0x18 + bne _0811A3B6 + movs r1, 0x1 + negs r1, r1 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x4 + b _0811A41A +_0811A3B6: + cmp r6, 0 + beq _0811A41C + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_811C158 + ldrh r0, [r5] + adds r0, 0x1 + b _0811A41A +_0811A3CC: + bl sub_811C170 + lsls r0, 24 + b _0811A414 +_0811A3D4: + ldr r0, _0811A3E8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811A41C + ldrh r0, [r5, 0xC] + bl sub_811A8A4 + b _0811A41C + .align 2, 0 +_0811A3E8: .4byte 0x02037fd4 +_0811A3EC: + ldr r0, _0811A408 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811A41C + adds r0, r2, 0 + movs r1, 0x4 + bl get_word_task_arg + bl sub_811A4D0 + b _0811A41C + .align 2, 0 +_0811A408: .4byte 0x02037fd4 +_0811A40C: + ldr r0, _0811A424 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 +_0811A414: + cmp r0, 0 + bne _0811A41C + movs r0, 0x1 +_0811A41A: + strh r0, [r5] +_0811A41C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811A424: .4byte 0x02037fd4 + thumb_func_end sub_811A2FC + + thumb_func_start sub_811A428 +sub_811A428: @ 811A428 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0811A44C + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x4 + bhi _0811A4BC + lsls r0, 2 + ldr r1, _0811A450 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811A44C: .4byte 0x03005e08 +_0811A450: .4byte _0811A454 + .align 2, 0 +_0811A454: + .4byte _0811A468 + .4byte _0811A47C + .4byte _0811A482 + .4byte _0811A498 + .4byte _0811A4B0 +_0811A468: + movs r0, 0 + bl SetVBlankCallback + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl sub_80A1A74 + b _0811A4C0 +_0811A47C: + bl sub_811F28C + b _0811A49C +_0811A482: + ldrb r4, [r6, 0x2] + adds r0, r5, 0 + movs r1, 0x2 + bl get_word_task_arg + adds r1, r0, 0 + ldrb r2, [r6, 0xE] + adds r0, r4, 0 + bl sub_811A95C + b _0811A49C +_0811A498: + bl sub_811BF8C +_0811A49C: + lsls r0, 24 + cmp r0, 0 + bne _0811A4C0 + adds r0, r5, 0 + movs r1, 0x4 + bl get_word_task_arg + bl sub_811A4D0 + b _0811A4C0 +_0811A4B0: + bl sub_811BFA4 + lsls r0, 24 + cmp r0, 0 + beq _0811A4C0 + b _0811A4C6 +_0811A4BC: + movs r0, 0 + b _0811A4C8 +_0811A4C0: + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] +_0811A4C6: + movs r0, 0x1 +_0811A4C8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811A428 + + thumb_func_start sub_811A4D0 +sub_811A4D0: @ 811A4D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_811C13C + bl sub_811AA90 + bl sub_811F2B8 + bl Window_FreeMemory + adds r0, r4, 0 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811A4D0 + + thumb_func_start sub_811A4F0 +sub_811A4F0: @ 811A4F0 + push {r4,r5,lr} + movs r5, 0x3 + ldr r0, _0811A508 + ldrh r0, [r0] + cmp r0, 0x14 + bls _0811A4FE + b _0811A7D4 +_0811A4FE: + lsls r0, 2 + ldr r1, _0811A50C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811A508: .4byte 0x020375e0 +_0811A50C: .4byte _0811A510 + .align 2, 0 +_0811A510: + .4byte _0811A564 + .4byte _0811A578 + .4byte _0811A58C + .4byte _0811A5A0 + .4byte _0811A5B4 + .4byte _0811A604 + .4byte _0811A5D8 + .4byte _0811A630 + .4byte _0811A664 + .4byte _0811A688 + .4byte _0811A6B4 + .4byte _0811A6D4 + .4byte _0811A708 + .4byte _0811A72C + .4byte _0811A73C + .4byte _0811A770 + .4byte _0811A7D4 + .4byte _0811A784 + .4byte _0811A798 + .4byte _0811A7AC + .4byte _0811A7BC +_0811A564: + ldr r0, _0811A570 + ldr r0, [r0] + ldr r1, _0811A574 + adds r4, r0, r1 + b _0811A7C2 + .align 2, 0 +_0811A570: .4byte 0x03005d8c +_0811A574: .4byte 0x00002bb0 +_0811A578: + ldr r0, _0811A584 + ldr r0, [r0] + ldr r2, _0811A588 + adds r4, r0, r2 + b _0811A7C2 + .align 2, 0 +_0811A584: .4byte 0x03005d8c +_0811A588: .4byte 0x00002bbc +_0811A58C: + ldr r0, _0811A598 + ldr r0, [r0] + ldr r3, _0811A59C + adds r4, r0, r3 + b _0811A7C2 + .align 2, 0 +_0811A598: .4byte 0x03005d8c +_0811A59C: .4byte 0x00002bc8 +_0811A5A0: + ldr r0, _0811A5AC + ldr r0, [r0] + ldr r1, _0811A5B0 + adds r4, r0, r1 + b _0811A7C2 + .align 2, 0 +_0811A5AC: .4byte 0x03005d8c +_0811A5B0: .4byte 0x00002bd4 +_0811A5B4: + ldr r2, _0811A5CC + ldr r0, _0811A5D0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, _0811A5D4 + adds r0, r3 + ldr r1, [r2] + adds r4, r1, r0 + b _0811A7C2 + .align 2, 0 +_0811A5CC: .4byte 0x03005d8c +_0811A5D0: .4byte 0x020375e2 +_0811A5D4: .4byte 0x00002be0 +_0811A5D8: + ldr r0, _0811A5F8 + ldr r0, [r0] + ldr r2, _0811A5FC + adds r1, r0, r2 + ldr r3, _0811A600 + adds r2, r0, r3 + movs r3, 0x5 +_0811A5E6: + ldrh r0, [r2] + strh r0, [r2, 0xC] + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0811A5E6 + adds r4, r1, 0 + b _0811A7C2 + .align 2, 0 +_0811A5F8: .4byte 0x03005d8c +_0811A5FC: .4byte 0x00002e36 +_0811A600: .4byte 0x00002e2a +_0811A604: + ldr r2, _0811A620 + ldr r0, _0811A624 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _0811A628 + adds r4, r0, r1 + ldr r0, _0811A62C + ldrb r5, [r0] + b _0811A7C2 + .align 2, 0 +_0811A620: .4byte 0x03005d8c +_0811A624: .4byte 0x020375e2 +_0811A628: .4byte 0x000027d0 +_0811A62C: .4byte 0x020375e4 +_0811A630: + ldr r2, _0811A654 + ldr r0, _0811A658 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, _0811A65C + adds r0, r3 + ldr r1, [r2] + adds r1, r0 + ldr r0, _0811A660 + ldrh r0, [r0] + lsls r0, 1 + adds r0, 0x1C + adds r4, r1, r0 + movs r5, 0x1 + b _0811A7C2 + .align 2, 0 +_0811A654: .4byte 0x03005d8c +_0811A658: .4byte 0x020375e2 +_0811A65C: .4byte 0x000027cc +_0811A660: .4byte 0x020375e4 +_0811A664: + ldr r2, _0811A67C + ldr r0, _0811A680 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _0811A684 + adds r4, r0, r1 + movs r5, 0 + b _0811A7C2 + .align 2, 0 +_0811A67C: .4byte 0x03005d8c +_0811A680: .4byte 0x020375e2 +_0811A684: .4byte 0x000027ce +_0811A688: + ldr r4, _0811A6A4 + ldr r1, _0811A6A8 + ldr r0, [r1] + ldr r2, _0811A6AC + adds r0, r2 + ldrh r0, [r0] + strh r0, [r4] + ldr r0, [r1] + ldr r3, _0811A6B0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _0811A7C2 + .align 2, 0 +_0811A6A4: .4byte 0x02021ec4 +_0811A6A8: .4byte 0x03005d8c +_0811A6AC: .4byte 0x00002e6c +_0811A6B0: .4byte 0x00002e6e +_0811A6B4: + ldr r0, _0811A6C8 + ldr r0, [r0] + ldr r1, _0811A6CC + adds r4, r0, r1 + ldr r2, _0811A6D0 + adds r0, r2, 0 + strh r0, [r4] + movs r5, 0x1 + b _0811A7C2 + .align 2, 0 +_0811A6C8: .4byte 0x03005d8c +_0811A6CC: .4byte 0x00002baa +_0811A6D0: .4byte 0x0000ffff +_0811A6D4: + ldr r2, _0811A6F8 + ldr r0, _0811A6FC + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, _0811A700 + adds r0, r3 + ldr r1, [r2] + adds r1, r0 + ldr r0, _0811A704 + ldrh r0, [r0] + lsls r0, 1 + adds r0, 0x4 + adds r4, r1, r0 + movs r5, 0 + b _0811A7C2 + .align 2, 0 +_0811A6F8: .4byte 0x03005d8c +_0811A6FC: .4byte 0x020375e2 +_0811A700: .4byte 0x000027cc +_0811A704: .4byte 0x020375e4 +_0811A708: + ldr r2, _0811A720 + ldr r0, _0811A724 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, _0811A728 + adds r4, r0, r1 + movs r5, 0x1 + b _0811A7C2 + .align 2, 0 +_0811A720: .4byte 0x03005d8c +_0811A724: .4byte 0x020375e2 +_0811A728: .4byte 0x000027e4 +_0811A72C: + ldr r4, _0811A738 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_811F88C + b _0811A7C2 + .align 2, 0 +_0811A738: .4byte 0x02021ec4 +_0811A73C: + ldr r2, _0811A760 + ldr r0, _0811A764 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, _0811A768 + adds r0, r3 + ldr r1, [r2] + adds r1, r0 + adds r4, r1, 0 + adds r4, 0x14 + ldr r2, _0811A76C + adds r0, r2, 0 + strh r0, [r1, 0x14] + movs r5, 0x2 + b _0811A7C2 + .align 2, 0 +_0811A760: .4byte 0x03005d8c +_0811A764: .4byte 0x020375e2 +_0811A768: .4byte 0x000027cc +_0811A76C: .4byte 0x0000ffff +_0811A770: + ldr r0, _0811A77C + ldr r0, [r0] + ldr r3, _0811A780 + adds r4, r0, r3 + b _0811A7C2 + .align 2, 0 +_0811A77C: .4byte 0x03005d8c +_0811A780: .4byte 0x00003b6e +_0811A784: + ldr r0, _0811A790 + ldr r0, [r0] + ldr r1, _0811A794 + adds r4, r0, r1 + b _0811A7C2 + .align 2, 0 +_0811A790: .4byte 0x03005d8c +_0811A794: .4byte 0x00003b5a +_0811A798: + ldr r0, _0811A7A4 + ldr r0, [r0] + ldr r2, _0811A7A8 + adds r4, r0, r2 + b _0811A7C2 + .align 2, 0 +_0811A7A4: .4byte 0x03005d8c +_0811A7A8: .4byte 0x00003b6c +_0811A7AC: + ldr r0, _0811A7B8 + ldr r0, [r0] + movs r3, 0x82 + lsls r3, 1 + adds r4, r0, r3 + b _0811A7C2 + .align 2, 0 +_0811A7B8: .4byte 0x03005d90 +_0811A7BC: + bl sub_801B058 + adds r4, r0, 0 +_0811A7C2: + bl overworld_free_bg_tilemaps + ldr r0, _0811A7DC + ldrb r0, [r0] + ldr r2, _0811A7E0 + adds r1, r4, 0 + adds r3, r5, 0 + bl sub_811A20C +_0811A7D4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811A7DC: .4byte 0x020375e0 +_0811A7E0: .4byte sub_80861B0 + 1 + thumb_func_end sub_811A4F0 + + thumb_func_start sub_811A7E4 +sub_811A7E4: @ 811A7E4 + push {lr} + bl fade_and_return_progress_probably + ldr r0, _0811A800 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0811A804 + cmp r0, 0x1 + beq _0811A80E + b _0811A840 + .align 2, 0 +_0811A800: .4byte 0x030022c0 +_0811A804: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _0811A840 +_0811A80E: + ldr r0, _0811A830 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811A84E + ldr r0, _0811A834 + ldr r0, [r0] + ldr r1, _0811A838 + adds r0, r1 + ldr r1, _0811A83C + strh r1, [r0, 0x16] + bl overworld_free_bg_tilemaps + bl sub_811A8F0 + b _0811A84E + .align 2, 0 +_0811A830: .4byte 0x02037fd4 +_0811A834: .4byte 0x03005d8c +_0811A838: .4byte 0x00003b58 +_0811A83C: .4byte 0x0000ffff +_0811A840: + ldr r1, _0811A854 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0811A84E: + pop {r0} + bx r0 + .align 2, 0 +_0811A854: .4byte 0x030022c0 + thumb_func_end sub_811A7E4 + + thumb_func_start sub_811A858 +sub_811A858: @ 811A858 + push {lr} + ldr r0, _0811A864 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0811A864: .4byte sub_811A7E4 + 1 + thumb_func_end sub_811A858 + + thumb_func_start sub_811A868 +sub_811A868: @ 811A868 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0 + ldr r1, _0811A888 +_0811A872: + ldrh r3, [r1] + cmp r2, r3 + beq _0811A884 + adds r1, 0x8 + adds r0, 0x1 + cmp r0, 0x3 + bls _0811A872 + movs r0, 0x1 + negs r0, r0 +_0811A884: + pop {r1} + bx r1 + .align 2, 0 +_0811A888: .4byte 0x08597530 + thumb_func_end sub_811A868 + + thumb_func_start sub_811A88C +sub_811A88C: @ 811A88C + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_811A868 + adds r1, r0, 0 + mvns r1, r1 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r1} + bx r1 + thumb_func_end sub_811A88C + + thumb_func_start sub_811A8A4 +sub_811A8A4: @ 811A8A4 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_811A868 + adds r4, r0, 0 + bl clear_tasks + ldr r0, _0811A8C8 + lsls r4, 3 + adds r0, 0x4 + adds r4, r0 + ldr r0, [r4] + bl sub_811A4D0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811A8C8: .4byte 0x08597530 + thumb_func_end sub_811A8A4 + + thumb_func_start sub_811A8CC +sub_811A8CC: @ 811A8CC + push {lr} + ldr r0, _0811A8E4 + ldr r1, [r0] + ldr r0, _0811A8E8 + adds r1, r0 + ldr r2, _0811A8EC + movs r0, 0xF + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .align 2, 0 +_0811A8E4: .4byte 0x03005d8c +_0811A8E8: .4byte 0x00003b6e +_0811A8EC: .4byte sub_80861B0 + 1 + thumb_func_end sub_811A8CC + + thumb_func_start sub_811A8F0 +sub_811A8F0: @ 811A8F0 + push {lr} + ldr r0, _0811A908 + ldr r1, [r0] + ldr r0, _0811A90C + adds r1, r0 + ldr r2, _0811A910 + movs r0, 0x10 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .align 2, 0 +_0811A908: .4byte 0x03005d8c +_0811A90C: .4byte 0x00003b5a +_0811A910: .4byte sub_80861B0 + 1 + thumb_func_end sub_811A8F0 + + thumb_func_start sub_811A914 +sub_811A914: @ 811A914 + push {lr} + ldr r0, _0811A92C + ldr r1, [r0] + ldr r0, _0811A930 + adds r1, r0 + ldr r2, _0811A934 + movs r0, 0x12 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .align 2, 0 +_0811A92C: .4byte 0x03005d8c +_0811A930: .4byte 0x00003b6c +_0811A934: .4byte sub_80861B0 + 1 + thumb_func_end sub_811A914 + + thumb_func_start sub_811A938 +sub_811A938: @ 811A938 + push {lr} + ldr r0, _0811A950 + ldr r1, [r0] + ldr r0, _0811A954 + adds r1, r0 + ldr r2, _0811A958 + movs r0, 0x11 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .align 2, 0 +_0811A950: .4byte 0x03005d8c +_0811A954: .4byte 0x00003b5a +_0811A958: .4byte sub_80861B0 + 1 + thumb_func_end sub_811A938 + + thumb_func_start sub_811A95C +sub_811A95C: @ 811A95C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r4, _0811A980 + movs r0, 0x50 + bl malloc + str r0, [r4] + cmp r0, 0 + bne _0811A984 + movs r0, 0 + b _0811AA7E + .align 2, 0 +_0811A980: .4byte 0x0203a118 +_0811A984: + movs r7, 0 + strb r5, [r0] + ldr r0, [r4] + mov r1, r8 + str r1, [r0, 0x38] + strb r7, [r0, 0x5] + ldr r0, [r4] + strb r7, [r0, 0x6] + ldr r0, [r4] + strb r7, [r0, 0x9] + ldr r0, [r4] + strb r6, [r0, 0x12] + ldr r0, [r4] + strb r7, [r0, 0x13] + adds r0, r5, 0 + bl sub_811BCC8 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0x10 + bne _0811A9C6 + ldr r0, [r4] + adds r0, 0x14 + bl sub_811BDF0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x14 + str r1, [r0, 0x34] + movs r1, 0x7 + strb r1, [r0, 0x4] + lsls r0, r6, 1 + b _0811A9DE +_0811A9C6: + ldr r0, [r4] + strb r7, [r0, 0x4] + ldr r3, [r4] + ldr r1, _0811AA2C + lsls r2, r6, 1 + adds r0, r2, r6 + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [r3, 0x34] + adds r0, r2, 0 +_0811A9DE: + ldr r3, _0811AA30 + ldr r2, [r3] + ldr r1, _0811AA2C + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x1] + strb r1, [r2, 0x2] + ldr r1, [r3] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x3] + ldr r0, [r3] + ldrb r2, [r0, 0x2] + ldrb r1, [r0, 0x3] + adds r4, r2, 0 + muls r4, r1 + adds r1, r4, 0 + strb r1, [r0, 0x7] + ldr r0, [r3] + strb r6, [r0, 0x1] + ldr r1, [r3] + ldrb r0, [r1, 0x7] + adds r4, r3, 0 + cmp r0, 0x9 + bls _0811AA14 + movs r0, 0x9 + strb r0, [r1, 0x7] +_0811AA14: + mov r0, r8 + cmp r0, 0 + beq _0811AA34 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x3C + ldrb r2, [r0, 0x7] + mov r0, r8 + bl CpuSet + b _0811AA64 + .align 2, 0 +_0811AA2C: .4byte 0x08597550 +_0811AA30: .4byte 0x0203a118 +_0811AA34: + movs r3, 0 + ldr r0, [r4] + ldrb r0, [r0, 0x7] + cmp r3, r0 + bge _0811AA5C + adds r6, r4, 0 + ldr r1, _0811AA88 + adds r5, r1, 0 +_0811AA44: + ldr r2, [r6] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x3C + adds r1, r0 + ldrh r0, [r1] + orrs r0, r5 + strh r0, [r1] + adds r3, 0x1 + ldrb r2, [r2, 0x7] + cmp r3, r2 + blt _0811AA44 +_0811AA5C: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x3C + str r0, [r1, 0x38] +_0811AA64: + bl sub_811F3AC + ldr r1, _0811AA8C + ldr r2, [r1] + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0x1 + strb r0, [r2, 0xD] + movs r0, 0x1 +_0811AA7E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811AA88: .4byte 0x0000ffff +_0811AA8C: .4byte 0x0203a118 + thumb_func_end sub_811A95C + + thumb_func_start sub_811AA90 +sub_811AA90: @ 811AA90 + push {r4,lr} + ldr r4, _0811AAA8 + ldr r0, [r4] + cmp r0, 0 + beq _0811AAA2 + bl free + movs r0, 0 + str r0, [r4] +_0811AAA2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811AAA8: .4byte 0x0203a118 + thumb_func_end sub_811AA90 + + thumb_func_start sub_811AAAC +sub_811AAAC: @ 811AAAC + push {lr} + ldr r0, _0811AAC4 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0xA + bhi _0811AB3E + lsls r0, 2 + ldr r1, _0811AAC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811AAC4: .4byte 0x0203a118 +_0811AAC8: .4byte _0811AACC + .align 2, 0 +_0811AACC: + .4byte _0811AAF8 + .4byte _0811AAFE + .4byte _0811AB04 + .4byte _0811AB0A + .4byte _0811AB10 + .4byte _0811AB16 + .4byte _0811AB1C + .4byte _0811AB22 + .4byte _0811AB28 + .4byte _0811AB2E + .4byte _0811AB34 +_0811AAF8: + bl sub_811AB68 + b _0811AB38 +_0811AAFE: + bl sub_811ACDC + b _0811AB38 +_0811AB04: + bl sub_811AE44 + b _0811AB38 +_0811AB0A: + bl sub_811AF00 + b _0811AB38 +_0811AB10: + bl sub_811AF8C + b _0811AB38 +_0811AB16: + bl sub_811B040 + b _0811AB38 +_0811AB1C: + bl sub_811AFEC + b _0811AB38 +_0811AB22: + bl sub_811B08C + b _0811AB38 +_0811AB28: + bl sub_811B0BC + b _0811AB38 +_0811AB2E: + bl sub_811B0E8 + b _0811AB38 +_0811AB34: + bl sub_811B0F8 +_0811AB38: + lsls r0, 16 + lsrs r0, 16 + b _0811AB40 +_0811AB3E: + movs r0, 0 +_0811AB40: + pop {r1} + bx r1 + thumb_func_end sub_811AAAC + + thumb_func_start sub_811AB44 +sub_811AB44: @ 811AB44 + push {lr} + bl sub_811BA68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _0811AB5E + cmp r0, 0x2 + blt _0811AB62 + cmp r0, 0x8 + bgt _0811AB62 + cmp r0, 0x7 + blt _0811AB62 +_0811AB5E: + movs r0, 0x1 + b _0811AB64 +_0811AB62: + movs r0, 0 +_0811AB64: + pop {r1} + bx r1 + thumb_func_end sub_811AB44 + + thumb_func_start sub_811AB68 +sub_811AB68: @ 811AB68 + push {r4-r7,lr} + ldr r0, _0811AB94 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811ABB8 + bl sub_811BF78 + ldr r1, _0811AB98 + ldr r3, [r1] + movs r2, 0 + movs r0, 0x2 + strb r0, [r3, 0x4] + ldr r0, [r1] + strb r2, [r0, 0xA] + ldr r0, [r1] + strb r2, [r0, 0xB] + ldr r0, [r1] + strb r2, [r0, 0xC] + movs r0, 0x9 + b _0811ACCC + .align 2, 0 +_0811AB94: .4byte 0x030022c0 +_0811AB98: .4byte 0x0203a118 +_0811AB9C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0811AC68 + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811AC58 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0811AC48 + movs r0, 0 + b _0811ACCC +_0811ABB8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0811AC78 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0811AC7E + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0811AB9C + ldr r2, _0811AC40 + ldr r1, [r2] + ldrb r0, [r1, 0x6] + subs r0, 0x1 +_0811ABD8: + strb r0, [r1, 0x6] +_0811ABDA: + adds r7, r2, 0 + adds r4, r7, 0 + ldr r2, [r4] + movs r0, 0x6 + ldrsb r0, [r2, r0] + ldr r6, _0811AC44 + cmp r0, 0 + bge _0811ABF8 + ldrb r0, [r2, 0x1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x6] +_0811ABF8: + ldr r3, [r4] + movs r2, 0x6 + ldrsb r2, [r3, r2] + adds r5, r6, 0 + ldrb r1, [r3, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x2] + cmp r2, r0 + ble _0811AC14 + movs r0, 0 + strb r0, [r3, 0x6] +_0811AC14: + ldr r3, [r4] + movs r2, 0x6 + ldrsb r2, [r3, r2] + ldrb r1, [r3, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r5 + ldrb r0, [r1, 0x2] + cmp r2, r0 + bne _0811AC88 + movs r0, 0x5 + ldrsb r0, [r3, r0] + cmp r0, 0x2 + ble _0811AC36 + movs r0, 0x2 + strb r0, [r3, 0x5] +_0811AC36: + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x3 + b _0811ACCC + .align 2, 0 +_0811AC40: .4byte 0x0203a118 +_0811AC44: .4byte 0x08597550 +_0811AC48: + ldr r2, _0811AC54 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + b _0811ABDA + .align 2, 0 +_0811AC54: .4byte 0x0203a118 +_0811AC58: + ldr r2, _0811AC64 + ldr r1, [r2] + ldrb r0, [r1, 0x6] + adds r0, 0x1 + b _0811ABD8 + .align 2, 0 +_0811AC64: .4byte 0x0203a118 +_0811AC68: + ldr r2, _0811AC74 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + strb r0, [r1, 0x5] + b _0811ABDA + .align 2, 0 +_0811AC74: .4byte 0x0203a118 +_0811AC78: + bl sub_811B150 + b _0811AC82 +_0811AC7E: + bl sub_811B1B4 +_0811AC82: + lsls r0, 16 + lsrs r0, 16 + b _0811ACCC +_0811AC88: + movs r0, 0x5 + ldrsb r0, [r3, r0] + cmp r0, 0 + bge _0811AC96 + ldrb r0, [r1, 0x1] + subs r0, 0x1 + strb r0, [r3, 0x5] +_0811AC96: + ldr r3, [r4] + movs r2, 0x5 + ldrsb r2, [r3, r2] + ldrb r1, [r3, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x1] + cmp r2, r0 + blt _0811ACB0 + movs r0, 0 + strb r0, [r3, 0x5] +_0811ACB0: + bl sub_811AB44 + cmp r0, 0 + beq _0811ACCA + ldr r2, [r7] + ldr r0, [r2, 0x4] + ldr r1, _0811ACD4 + ands r0, r1 + ldr r1, _0811ACD8 + cmp r0, r1 + bne _0811ACCA + movs r0, 0 + strb r0, [r2, 0x5] +_0811ACCA: + movs r0, 0x2 +_0811ACCC: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811ACD4: .4byte 0x00ffff00 +_0811ACD8: .4byte 0x00040100 + thumb_func_end sub_811AB68 + + thumb_func_start sub_811ACDC +sub_811ACDC: @ 811ACDC + push {r4-r6,lr} + ldr r2, _0811ACFC + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811AD4A + ldr r0, _0811AD00 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _0811AD3E + b _0811AD24 + .align 2, 0 +_0811ACFC: .4byte 0x030022c0 +_0811AD00: .4byte 0x0203a118 +_0811AD04: + movs r0, 0x20 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _0811ADE0 + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + bne _0811ADD0 + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _0811ADC0 + movs r0, 0 + b _0811AE32 +_0811AD24: + cmp r0, 0x1 + bgt _0811AD2E + cmp r0, 0 + beq _0811AD38 + b _0811AD4A +_0811AD2E: + cmp r0, 0x2 + beq _0811ADF6 + cmp r0, 0x3 + beq _0811AD44 + b _0811AD4A +_0811AD38: + bl sub_811B184 + b _0811ADFA +_0811AD3E: + bl sub_811B150 + b _0811ADFA +_0811AD44: + bl sub_811B264 + b _0811ADFA +_0811AD4A: + ldrh r2, [r2, 0x2E] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0811ADF0 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + bne _0811ADF6 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _0811AD04 + ldr r2, _0811ADB8 + ldr r1, [r2] + ldrb r0, [r1, 0x6] + subs r0, 0x1 + strb r0, [r1, 0x6] +_0811AD6E: + adds r6, r2, 0 +_0811AD70: + adds r5, r6, 0 + ldr r4, [r5] + movs r3, 0x6 + ldrsb r3, [r4, r3] + ldr r2, _0811ADBC + ldrb r1, [r4, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + ldrb r0, [r1, 0x2] + cmp r3, r0 + bne _0811AE00 + bl sub_811BA3C + movs r2, 0x3 + cmp r0, 0 + beq _0811AD96 + movs r2, 0x4 +_0811AD96: + ldr r1, [r5] + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0 + bge _0811ADA4 + subs r0, r2, 0x1 + strb r0, [r1, 0x5] +_0811ADA4: + ldr r1, [r5] + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, r2 + blt _0811ADB2 + movs r0, 0 + strb r0, [r1, 0x5] +_0811ADB2: + movs r0, 0x3 + b _0811AE32 + .align 2, 0 +_0811ADB8: .4byte 0x0203a118 +_0811ADBC: .4byte 0x08597550 +_0811ADC0: + ldr r2, _0811ADCC + ldr r1, [r2] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + b _0811AD6E + .align 2, 0 +_0811ADCC: .4byte 0x0203a118 +_0811ADD0: + ldr r1, _0811ADDC + ldr r0, [r1] + strb r3, [r0, 0x6] + adds r6, r1, 0 + b _0811AD70 + .align 2, 0 +_0811ADDC: .4byte 0x0203a118 +_0811ADE0: + ldr r2, _0811ADEC + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + strb r0, [r1, 0x5] + b _0811AD6E + .align 2, 0 +_0811ADEC: .4byte 0x0203a118 +_0811ADF0: + bl sub_811B150 + b _0811ADFA +_0811ADF6: + bl sub_811B1B4 +_0811ADFA: + lsls r0, 16 + lsrs r0, 16 + b _0811AE32 +_0811AE00: + movs r0, 0x5 + ldrsb r0, [r4, r0] + ldrb r1, [r1, 0x1] + cmp r0, r1 + blt _0811AE0E + subs r0, r1, 0x1 + strb r0, [r4, 0x5] +_0811AE0E: + bl sub_811AB44 + cmp r0, 0 + beq _0811AE28 + ldr r2, [r6] + ldr r0, [r2, 0x4] + ldr r1, _0811AE38 + ands r0, r1 + ldr r1, _0811AE3C + cmp r0, r1 + bne _0811AE28 + movs r0, 0 + strb r0, [r2, 0x5] +_0811AE28: + ldr r0, _0811AE40 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x4] + movs r0, 0x2 +_0811AE32: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0811AE38: .4byte 0x00ffff00 +_0811AE3C: .4byte 0x00040100 +_0811AE40: .4byte 0x0203a118 + thumb_func_end sub_811ACDC + + thumb_func_start sub_811AE44 +sub_811AE44: @ 811AE44 + push {lr} + ldr r1, _0811AE5C + ldrh r2, [r1, 0x2E] + movs r0, 0x2 + ands r0, r2 + adds r3, r1, 0 + cmp r0, 0 + beq _0811AE60 + bl sub_811B32C + b _0811AEF6 + .align 2, 0 +_0811AE5C: .4byte 0x030022c0 +_0811AE60: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0811AEAE + ldr r0, _0811AE80 + ldr r2, [r0] + movs r1, 0xA + ldrsb r1, [r2, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811AE84 + bl sub_811B2B0 + b _0811AEF6 + .align 2, 0 +_0811AE80: .4byte 0x0203a118 +_0811AE84: + movs r0, 0xB + ldrsb r0, [r2, r0] + cmp r0, 0x1 + beq _0811AEA2 + cmp r0, 0x1 + bgt _0811AE96 + cmp r0, 0 + beq _0811AE9C + b _0811AEAE +_0811AE96: + cmp r0, 0x2 + beq _0811AEA8 + b _0811AEAE +_0811AE9C: + bl sub_811B33C + b _0811AEF6 +_0811AEA2: + bl sub_811B368 + b _0811AEF6 +_0811AEA8: + bl sub_811B32C + b _0811AEF6 +_0811AEAE: + ldrh r1, [r3, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811AEBE + bl sub_811B33C + b _0811AEF6 +_0811AEBE: + ldrh r1, [r3, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0811AECC + movs r0, 0x2 + b _0811AEF2 +_0811AECC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0811AED8 + movs r0, 0x3 + b _0811AEF2 +_0811AED8: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0811AEE4 + movs r0, 0x1 + b _0811AEF2 +_0811AEE4: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0811AEF0 + movs r0, 0 + b _0811AEFA +_0811AEF0: + movs r0, 0 +_0811AEF2: + bl sub_811B528 +_0811AEF6: + lsls r0, 16 + lsrs r0, 16 +_0811AEFA: + pop {r1} + bx r1 + thumb_func_end sub_811AE44 + + thumb_func_start sub_811AF00 +sub_811AF00: @ 811AF00 + push {lr} + ldr r2, _0811AF1C + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811AF24 + ldr r0, _0811AF20 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x4] + movs r0, 0xE + b _0811AF86 + .align 2, 0 +_0811AF1C: .4byte 0x030022c0 +_0811AF20: .4byte 0x0203a118 +_0811AF24: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811AF32 + bl sub_811B394 + b _0811AF82 +_0811AF32: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0811AF3E + movs r0, 0x4 + b _0811AF7E +_0811AF3E: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811AF4A + movs r0, 0x5 + b _0811AF7E +_0811AF4A: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0811AF58 + movs r0, 0x2 + b _0811AF7E +_0811AF58: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0811AF64 + movs r0, 0x3 + b _0811AF7E +_0811AF64: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0811AF70 + movs r0, 0x1 + b _0811AF7E +_0811AF70: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0811AF7C + movs r0, 0 + b _0811AF86 +_0811AF7C: + movs r0, 0 +_0811AF7E: + bl sub_811B794 +_0811AF82: + lsls r0, 16 + lsrs r0, 16 +_0811AF86: + pop {r1} + bx r1 + thumb_func_end sub_811AF00 + + thumb_func_start sub_811AF8C +sub_811AF8C: @ 811AF8C + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811AFC0 + cmp r1, 0 + bgt _0811AFA8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811AFAC + b _0811AFE4 +_0811AFA8: + cmp r1, 0x1 + bne _0811AFE4 +_0811AFAC: + bl sub_811B2A4 + ldr r1, _0811AFBC + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x7 + b _0811AFE6 + .align 2, 0 +_0811AFBC: .4byte 0x0203a118 +_0811AFC0: + ldr r0, _0811AFDC + strh r1, [r0] + ldr r0, _0811AFE0 + ldr r0, [r0] + ldrb r0, [r0] + subs r0, 0x11 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0811AFD8 + bl sub_811B3E4 +_0811AFD8: + movs r0, 0x18 + b _0811AFE6 + .align 2, 0 +_0811AFDC: .4byte 0x020375f0 +_0811AFE0: .4byte 0x0203a118 +_0811AFE4: + movs r0, 0 +_0811AFE6: + pop {r1} + bx r1 + thumb_func_end sub_811AF8C + + thumb_func_start sub_811AFEC +sub_811AFEC: @ 811AFEC + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811B020 + cmp r1, 0 + bgt _0811B008 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B00C + b _0811B038 +_0811B008: + cmp r1, 0x1 + bne _0811B038 +_0811B00C: + bl sub_811B2A4 + ldr r1, _0811B01C + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x7 + b _0811B03A + .align 2, 0 +_0811B01C: .4byte 0x0203a118 +_0811B020: + bl sub_811BE9C + ldr r4, _0811B034 + bl sub_811B4EC + strh r0, [r4] + bl sub_811B3E4 + movs r0, 0x18 + b _0811B03A + .align 2, 0 +_0811B034: .4byte 0x020375f0 +_0811B038: + movs r0, 0 +_0811B03A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811AFEC + + thumb_func_start sub_811B040 +sub_811B040: @ 811B040 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811B070 + cmp r1, 0 + bgt _0811B05C + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B060 + b _0811B084 +_0811B05C: + cmp r1, 0x1 + bne _0811B084 +_0811B060: + ldr r0, _0811B06C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x7 + b _0811B086 + .align 2, 0 +_0811B06C: .4byte 0x0203a118 +_0811B070: + bl sub_811B418 + ldr r0, _0811B080 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x8 + b _0811B086 + .align 2, 0 +_0811B080: .4byte 0x0203a118 +_0811B084: + movs r0, 0 +_0811B086: + pop {r1} + bx r1 + thumb_func_end sub_811B040 + + thumb_func_start sub_811B08C +sub_811B08C: @ 811B08C + push {lr} + ldr r0, _0811B0A0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811B0A4 + movs r0, 0x1A + b _0811B0B8 + .align 2, 0 +_0811B0A0: .4byte 0x030022c0 +_0811B0A4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0811B0B0 + movs r0, 0 + b _0811B0B8 +_0811B0B0: + bl sub_811B150 + lsls r0, 16 + lsrs r0, 16 +_0811B0B8: + pop {r1} + bx r1 + thumb_func_end sub_811B08C + + thumb_func_start sub_811B0BC +sub_811B0BC: @ 811B0BC + push {lr} + ldr r0, _0811B0D0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0811B0D4 + movs r0, 0 + b _0811B0E0 + .align 2, 0 +_0811B0D0: .4byte 0x030022c0 +_0811B0D4: + bl sub_811B2A4 + ldr r1, _0811B0E4 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x7 +_0811B0E0: + pop {r1} + bx r1 + .align 2, 0 +_0811B0E4: .4byte 0x0203a118 + thumb_func_end sub_811B0BC + + thumb_func_start sub_811B0E8 +sub_811B0E8: @ 811B0E8 + ldr r0, _0811B0F4 + ldr r1, [r0] + movs r0, 0xA + strb r0, [r1, 0x4] + movs r0, 0x6 + bx lr + .align 2, 0 +_0811B0F4: .4byte 0x0203a118 + thumb_func_end sub_811B0E8 + + thumb_func_start sub_811B0F8 +sub_811B0F8: @ 811B0F8 + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811B134 + cmp r1, 0 + bgt _0811B114 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B118 + b _0811B148 +_0811B114: + cmp r1, 0x1 + bne _0811B148 +_0811B118: + bl sub_811B454 + ldr r2, _0811B130 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x8] + ldr r1, [r2] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x1F + b _0811B14A + .align 2, 0 +_0811B130: .4byte 0x0203a118 +_0811B134: + ldr r4, _0811B144 + bl sub_811B4EC + strh r0, [r4] + bl sub_811B3E4 + movs r0, 0x18 + b _0811B14A + .align 2, 0 +_0811B144: .4byte 0x020375f0 +_0811B148: + movs r0, 0 +_0811B14A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B0F8 + + thumb_func_start sub_811B150 +sub_811B150: @ 811B150 + push {lr} + ldr r1, _0811B170 + ldr r2, [r1] + ldrb r0, [r2] + cmp r0, 0x13 + beq _0811B160 + cmp r0, 0xB + bne _0811B174 +_0811B160: + ldrb r0, [r2, 0x4] + strb r0, [r2, 0x8] + ldr r1, [r1] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x22 + b _0811B180 + .align 2, 0 +_0811B170: .4byte 0x0203a118 +_0811B174: + ldrb r0, [r2, 0x4] + strb r0, [r2, 0x8] + ldr r1, [r1] + movs r0, 0x4 + strb r0, [r1, 0x4] + movs r0, 0x5 +_0811B180: + pop {r1} + bx r1 + thumb_func_end sub_811B150 + + thumb_func_start sub_811B184 +sub_811B184: @ 811B184 + push {lr} + ldr r2, _0811B1A4 + ldr r0, [r2] + ldrb r1, [r0, 0x4] + strb r1, [r0, 0x8] + ldr r1, [r2] + ldrb r0, [r1] + cmp r0, 0x6 + bne _0811B1A8 + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x8] + ldr r1, [r2] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x20 + b _0811B1AE + .align 2, 0 +_0811B1A4: .4byte 0x0203a118 +_0811B1A8: + movs r0, 0x5 + strb r0, [r1, 0x4] + movs r0, 0x4 +_0811B1AE: + pop {r1} + bx r1 + thumb_func_end sub_811B184 + + thumb_func_start sub_811B1B4 +sub_811B1B4: @ 811B1B4 + push {r4,lr} + ldr r4, _0811B1D8 + ldr r1, [r4] + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x8] + ldr r1, [r4] + ldrb r0, [r1] + cmp r0, 0x11 + bne _0811B1DC + bl sub_811BD64 + cmp r0, 0 + bne _0811B1FA + bl sub_811BDB0 + cmp r0, 0 + bne _0811B1E8 + b _0811B256 + .align 2, 0 +_0811B1D8: .4byte 0x0203a118 +_0811B1DC: + cmp r0, 0x12 + bne _0811B204 + bl sub_811BDB0 + cmp r0, 0 + beq _0811B1F2 +_0811B1E8: + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x1E + b _0811B25C +_0811B1F2: + bl sub_811BD64 + cmp r0, 0 + beq _0811B256 +_0811B1FA: + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x1D + b _0811B25C +_0811B204: + cmp r0, 0x9 + beq _0811B20C + cmp r0, 0xD + bne _0811B21E +_0811B20C: + bl sub_811BD2C + cmp r0, 0 + bne _0811B256 + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x21 + b _0811B25C +_0811B21E: + cmp r0, 0x13 + beq _0811B226 + cmp r0, 0xB + bne _0811B238 +_0811B226: + bl sub_811BCF4 + cmp r0, 0 + beq _0811B256 + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x22 + b _0811B25C +_0811B238: + cmp r0, 0x14 + beq _0811B258 + bl sub_811BCF4 + cmp r0, 0x1 + beq _0811B24C + bl sub_811B4EC + cmp r0, 0 + bne _0811B256 +_0811B24C: + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x4] + movs r0, 0x5 + b _0811B25C +_0811B256: + ldr r1, [r4] +_0811B258: + movs r0, 0x6 + strb r0, [r1, 0x4] +_0811B25C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B1B4 + + thumb_func_start sub_811B264 +sub_811B264: @ 811B264 + push {lr} + ldr r2, _0811B280 + ldr r1, [r2] + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x8] + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0x11 + beq _0811B28E + cmp r0, 0x11 + bgt _0811B284 + cmp r0, 0xF + beq _0811B28A + b _0811B29E + .align 2, 0 +_0811B280: .4byte 0x0203a118 +_0811B284: + cmp r0, 0x12 + beq _0811B296 + b _0811B29E +_0811B28A: + movs r0, 0x19 + b _0811B2A0 +_0811B28E: + bl sub_811B3E4 + movs r0, 0x1C + b _0811B2A0 +_0811B296: + bl sub_811B3E4 + movs r0, 0x1B + b _0811B2A0 +_0811B29E: + movs r0, 0 +_0811B2A0: + pop {r1} + bx r1 + thumb_func_end sub_811B264 + + thumb_func_start sub_811B2A4 +sub_811B2A4: @ 811B2A4 + ldr r0, _0811B2AC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bx lr + .align 2, 0 +_0811B2AC: .4byte 0x0203a118 + thumb_func_end sub_811B2A4 + + thumb_func_start sub_811B2B0 +sub_811B2B0: @ 811B2B0 + push {lr} + ldr r0, _0811B2D8 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _0811B2DC + bl sub_811B8E8 + lsls r0, 24 + lsrs r0, 24 + bl sub_811F3B8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_811F548 + b _0811B2EC + .align 2, 0 +_0811B2D8: .4byte 0x0203a118 +_0811B2DC: + bl sub_811B908 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + bl sub_811F548 +_0811B2EC: + bl sub_811F5B0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _0811B324 + ldr r2, _0811B320 + ldr r3, [r2] + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0 + strb r0, [r3, 0xF] + ldr r0, [r2] + strb r1, [r0, 0xE] + ldr r0, [r2] + strb r1, [r0, 0x10] + ldr r0, [r2] + strb r1, [r0, 0x11] + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x4] + movs r0, 0xB + b _0811B326 + .align 2, 0 +_0811B320: .4byte 0x0203a118 +_0811B324: + movs r0, 0 +_0811B326: + pop {r1} + bx r1 + thumb_func_end sub_811B2B0 + + thumb_func_start sub_811B32C +sub_811B32C: @ 811B32C + ldr r0, _0811B338 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x4] + movs r0, 0xA + bx lr + .align 2, 0 +_0811B338: .4byte 0x0203a118 + thumb_func_end sub_811B32C + + thumb_func_start sub_811B33C +sub_811B33C: @ 811B33C + push {lr} + ldr r1, _0811B35C + ldr r0, [r1] + movs r2, 0 + strb r2, [r0, 0xA] + ldr r0, [r1] + strb r2, [r0, 0xB] + ldr r0, [r1] + strb r2, [r0, 0xC] + ldr r1, [r1] + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811B360 + movs r0, 0x1 + strb r0, [r1, 0x9] + b _0811B362 + .align 2, 0 +_0811B35C: .4byte 0x0203a118 +_0811B360: + strb r2, [r1, 0x9] +_0811B362: + movs r0, 0x17 + pop {r1} + bx r1 + thumb_func_end sub_811B33C + + thumb_func_start sub_811B368 +sub_811B368: @ 811B368 + push {lr} + ldr r0, _0811B380 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + beq _0811B388 + ldr r0, _0811B384 + bl sub_811B488 + movs r0, 0x1 + b _0811B390 + .align 2, 0 +_0811B380: .4byte 0x0203a118 +_0811B384: .4byte 0x0000ffff +_0811B388: + movs r0, 0x20 + bl audio_play + movs r0, 0 +_0811B390: + pop {r1} + bx r1 + thumb_func_end sub_811B368 + + thumb_func_start sub_811B394 +sub_811B394: @ 811B394 + push {r4,r5,lr} + bl sub_811B940 + lsls r0, 16 + lsrs r0, 16 + bl sub_811F578 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_811BF88 + adds r5, r0, 0 + cmp r5, 0 + beq _0811B3BC + movs r0, 0x20 + bl audio_play + movs r0, 0 + b _0811B3DC +_0811B3BC: + adds r0, r4, 0 + bl sub_811B488 + ldr r0, _0811B3D4 + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0x6 + bne _0811B3D8 + movs r0, 0x9 + strb r0, [r1, 0x4] + movs r0, 0xD + b _0811B3DC + .align 2, 0 +_0811B3D4: .4byte 0x0203a118 +_0811B3D8: + strb r5, [r1, 0x4] + movs r0, 0xC +_0811B3DC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811B394 + + thumb_func_start sub_811B3E4 +sub_811B3E4: @ 811B3E4 + push {r4,r5,lr} + movs r4, 0 + ldr r3, _0811B414 + ldr r0, [r3] + ldrb r0, [r0, 0x7] + cmp r4, r0 + bge _0811B40E + adds r5, r3, 0 +_0811B3F4: + ldr r3, [r5] + ldr r1, [r3, 0x38] + lsls r2, r4, 1 + adds r1, r2, r1 + adds r0, r3, 0 + adds r0, 0x3C + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r4, 0x1 + ldrb r3, [r3, 0x7] + cmp r4, r3 + blt _0811B3F4 +_0811B40E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811B414: .4byte 0x0203a118 + thumb_func_end sub_811B3E4 + + thumb_func_start sub_811B418 +sub_811B418: @ 811B418 + push {r4,r5,lr} + movs r3, 0 + ldr r2, _0811B44C + ldr r0, [r2] + ldrb r0, [r0, 0x7] + cmp r3, r0 + bge _0811B444 + adds r5, r2, 0 + ldr r0, _0811B450 + adds r4, r0, 0 +_0811B42C: + ldr r2, [r5] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x3C + adds r1, r0 + ldrh r0, [r1] + orrs r0, r4 + strh r0, [r1] + adds r3, 0x1 + ldrb r2, [r2, 0x7] + cmp r3, r2 + blt _0811B42C +_0811B444: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811B44C: .4byte 0x0203a118 +_0811B450: .4byte 0x0000ffff + thumb_func_end sub_811B418 + + thumb_func_start sub_811B454 +sub_811B454: @ 811B454 + push {r4,r5,lr} + movs r4, 0 + ldr r3, _0811B484 + ldr r0, [r3] + ldrb r0, [r0, 0x7] + cmp r4, r0 + bge _0811B47E + adds r5, r3, 0 +_0811B464: + ldr r3, [r5] + lsls r1, r4, 1 + adds r2, r3, 0 + adds r2, 0x3C + adds r2, r1 + ldr r0, [r3, 0x38] + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + adds r4, 0x1 + ldrb r3, [r3, 0x7] + cmp r4, r3 + blt _0811B464 +_0811B47E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811B484: .4byte 0x0203a118 + thumb_func_end sub_811B454 + + thumb_func_start sub_811B488 +sub_811B488: @ 811B488 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_811B8C8 + lsls r0, 16 + ldr r1, _0811B4A8 + ldr r1, [r1] + lsrs r0, 15 + adds r1, 0x3C + adds r1, r0 + strh r4, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811B4A8: .4byte 0x0203a118 + thumb_func_end sub_811B488 + + thumb_func_start sub_811B4AC +sub_811B4AC: @ 811B4AC + push {r4,r5,lr} + movs r2, 0 + ldr r0, _0811B4D4 + ldr r0, [r0] + ldrb r1, [r0, 0x7] + cmp r2, r1 + bcs _0811B4E2 + adds r5, r1, 0 + adds r4, r0, 0 + adds r4, 0x3C + ldr r3, [r0, 0x38] +_0811B4C2: + lsls r0, r2, 1 + adds r1, r4, r0 + adds r0, r3 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + beq _0811B4D8 + movs r0, 0x1 + b _0811B4E4 + .align 2, 0 +_0811B4D4: .4byte 0x0203a118 +_0811B4D8: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r5 + bcc _0811B4C2 +_0811B4E2: + movs r0, 0 +_0811B4E4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811B4AC + + thumb_func_start sub_811B4EC +sub_811B4EC: @ 811B4EC + push {lr} + ldr r0, _0811B514 + ldr r0, [r0] + ldrb r0, [r0] + subs r0, 0x11 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0811B51C + bl sub_811BD64 + cmp r0, 0 + bne _0811B50E + bl sub_811BDB0 + cmp r0, 0 + beq _0811B518 +_0811B50E: + movs r0, 0 + b _0811B524 + .align 2, 0 +_0811B514: .4byte 0x0203a118 +_0811B518: + movs r0, 0x1 + b _0811B524 +_0811B51C: + bl sub_811B4AC + lsls r0, 24 + lsrs r0, 24 +_0811B524: + pop {r1} + bx r1 + thumb_func_end sub_811B4EC + + thumb_func_start sub_811B528 +sub_811B528: @ 811B528 + push {lr} + adds r2, r0, 0 + ldr r0, _0811B54C + ldr r3, [r0] + movs r1, 0xA + ldrsb r1, [r3, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B558 + ldrb r0, [r3, 0x9] + cmp r0, 0 + bne _0811B550 + adds r0, r2, 0 + bl sub_811B568 + b _0811B55E + .align 2, 0 +_0811B54C: .4byte 0x0203a118 +_0811B550: + adds r0, r2, 0 + bl sub_811B634 + b _0811B55E +_0811B558: + adds r0, r2, 0 + bl sub_811B6C4 +_0811B55E: + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_811B528 + + thumb_func_start sub_811B568 +sub_811B568: @ 811B568 + push {r4,lr} + cmp r0, 0x1 + beq _0811B5DE + cmp r0, 0x1 + bcc _0811B5FE + cmp r0, 0x2 + beq _0811B57C + cmp r0, 0x3 + beq _0811B5A4 + b _0811B62A +_0811B57C: + ldr r0, _0811B598 + ldr r1, [r0] + movs r0, 0xB + ldrsb r0, [r1, r0] + ldrb r3, [r1, 0xC] + cmn r0, r3 + beq _0811B62A + ldrb r2, [r1, 0xB] + cmp r0, 0 + beq _0811B59C + subs r0, r2, 0x1 + strb r0, [r1, 0xB] +_0811B594: + movs r0, 0xF + b _0811B62C + .align 2, 0 +_0811B598: .4byte 0x0203a118 +_0811B59C: + subs r0, r3, 0x1 + strb r0, [r1, 0xC] + movs r0, 0x11 + b _0811B62C +_0811B5A4: + ldr r0, _0811B5CC + ldr r2, [r0] + movs r1, 0xB + ldrsb r1, [r2, r1] + ldrb r3, [r2, 0xC] + adds r1, r3 + ldrb r0, [r2, 0xD] + subs r0, 0x1 + cmp r1, r0 + bge _0811B62A + ldrb r1, [r2, 0xB] + movs r0, 0xB + ldrsb r0, [r2, r0] + cmp r0, 0x2 + bgt _0811B5D0 + adds r0, r1, 0x1 + strb r0, [r2, 0xB] + movs r4, 0xF + b _0811B5D6 + .align 2, 0 +_0811B5CC: .4byte 0x0203a118 +_0811B5D0: + adds r0, r3, 0x1 + strb r0, [r2, 0xC] + movs r4, 0x10 +_0811B5D6: + bl sub_811B978 + adds r0, r4, 0 + b _0811B62C +_0811B5DE: + ldr r0, _0811B5F4 + ldr r1, [r0] + ldrb r2, [r1, 0xA] + movs r0, 0xA + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B5F8 + subs r0, r2, 0x1 + strb r0, [r1, 0xA] + b _0811B594 + .align 2, 0 +_0811B5F4: .4byte 0x0203a118 +_0811B5F8: + bl sub_811B744 + b _0811B594 +_0811B5FE: + ldr r0, _0811B620 + ldr r1, [r0] + ldrb r2, [r1, 0xA] + movs r0, 0xA + ldrsb r0, [r1, r0] + cmp r0, 0 + bgt _0811B624 + adds r0, r2, 0x1 + strb r0, [r1, 0xA] + bl sub_811B9C8 + lsls r0, 24 + cmp r0, 0 + beq _0811B594 + bl sub_811B744 + b _0811B594 + .align 2, 0 +_0811B620: .4byte 0x0203a118 +_0811B624: + bl sub_811B744 + b _0811B594 +_0811B62A: + movs r0, 0 +_0811B62C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B568 + + thumb_func_start sub_811B634 +sub_811B634: @ 811B634 + push {lr} + cmp r0, 0x1 + beq _0811B6A0 + cmp r0, 0x1 + bcc _0811B684 + cmp r0, 0x2 + beq _0811B64A + cmp r0, 0x3 + beq _0811B66A + movs r0, 0 + b _0811B6BC +_0811B64A: + ldr r0, _0811B65C + ldr r1, [r0] + ldrb r2, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _0811B660 + subs r0, r2, 0x1 + b _0811B662 + .align 2, 0 +_0811B65C: .4byte 0x0203a118 +_0811B660: + movs r0, 0x3 +_0811B662: + strb r0, [r1, 0xB] + bl sub_811B978 + b _0811B6BA +_0811B66A: + ldr r0, _0811B67C + ldr r1, [r0] + ldrb r2, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bgt _0811B680 + adds r0, r2, 0x1 + b _0811B662 + .align 2, 0 +_0811B67C: .4byte 0x0203a118 +_0811B680: + movs r0, 0 + b _0811B662 +_0811B684: + ldr r0, _0811B69C + ldr r1, [r0] + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] + bl sub_811B9C8 + lsls r0, 24 + cmp r0, 0 + beq _0811B6BA + b _0811B6B6 + .align 2, 0 +_0811B69C: .4byte 0x0203a118 +_0811B6A0: + ldr r2, _0811B6C0 + ldr r1, [r2] + ldrb r0, [r1, 0xA] + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r0, [r2] + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _0811B6BA +_0811B6B6: + bl sub_811B744 +_0811B6BA: + movs r0, 0xF +_0811B6BC: + pop {r1} + bx r1 + .align 2, 0 +_0811B6C0: .4byte 0x0203a118 + thumb_func_end sub_811B634 + + thumb_func_start sub_811B6C4 +sub_811B6C4: @ 811B6C4 + push {lr} + adds r2, r0, 0 + cmp r2, 0x1 + beq _0811B714 + cmp r2, 0x1 + bcc _0811B728 + cmp r2, 0x2 + beq _0811B6DC + cmp r2, 0x3 + beq _0811B6F8 + movs r0, 0 + b _0811B73A +_0811B6DC: + ldr r0, _0811B6F0 + ldr r1, [r0] + ldrb r3, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B6F4 + subs r0, r3, 0x1 + b _0811B736 + .align 2, 0 +_0811B6F0: .4byte 0x0203a118 +_0811B6F4: + strb r2, [r1, 0xB] + b _0811B738 +_0811B6F8: + ldr r0, _0811B70C + ldr r1, [r0] + ldrb r2, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0x1 + bgt _0811B710 + adds r0, r2, 0x1 + b _0811B736 + .align 2, 0 +_0811B70C: .4byte 0x0203a118 +_0811B710: + movs r0, 0 + b _0811B736 +_0811B714: + ldr r0, _0811B724 + ldr r1, [r0] + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] + bl sub_811B768 + b _0811B738 + .align 2, 0 +_0811B724: .4byte 0x0203a118 +_0811B728: + ldr r2, _0811B740 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0xA] + ldr r1, [r2] + ldrb r0, [r1, 0xB] + adds r0, 0x1 +_0811B736: + strb r0, [r1, 0xB] +_0811B738: + movs r0, 0xF +_0811B73A: + pop {r1} + bx r1 + .align 2, 0 +_0811B740: .4byte 0x0203a118 + thumb_func_end sub_811B6C4 + + thumb_func_start sub_811B744 +sub_811B744: @ 811B744 + push {lr} + ldr r2, _0811B764 + ldr r1, [r2] + movs r0, 0xFF + strb r0, [r1, 0xA] + ldr r2, [r2] + ldrb r1, [r2, 0xB] + movs r0, 0xB + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _0811B75E + subs r0, r1, 0x1 + strb r0, [r2, 0xB] +_0811B75E: + pop {r0} + bx r0 + .align 2, 0 +_0811B764: .4byte 0x0203a118 + thumb_func_end sub_811B744 + + thumb_func_start sub_811B768 +sub_811B768: @ 811B768 + push {r4,lr} + ldr r4, _0811B780 + ldr r1, [r4] + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811B784 + movs r0, 0x1 + strb r0, [r1, 0xA] + bl sub_811B978 + b _0811B78E + .align 2, 0 +_0811B780: .4byte 0x0203a118 +_0811B784: + ldrb r0, [r1, 0xB] + bl sub_811B960 + ldr r1, [r4] + strb r0, [r1, 0xA] +_0811B78E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811B768 + + thumb_func_start sub_811B794 +sub_811B794: @ 811B794 + push {r4,lr} + cmp r0, 0x5 + bls _0811B79C + b _0811B8C0 +_0811B79C: + lsls r0, 2 + ldr r1, _0811B7A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811B7A8: .4byte _0811B7AC + .align 2, 0 +_0811B7AC: + .4byte _0811B848 + .4byte _0811B826 + .4byte _0811B7C4 + .4byte _0811B7F0 + .4byte _0811B870 + .4byte _0811B890 +_0811B7C4: + ldr r0, _0811B7E4 + ldr r1, [r0] + movs r0, 0x11 + ldrsb r0, [r1, r0] + ldrb r3, [r1, 0xE] + adds r0, r3 + cmp r0, 0 + bgt _0811B7D6 + b _0811B8C0 +_0811B7D6: + ldrb r2, [r1, 0x11] + movs r0, 0x11 + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _0811B7E8 + subs r0, r2, 0x1 + b _0811B80E + .align 2, 0 +_0811B7E4: .4byte 0x0203a118 +_0811B7E8: + subs r0, r3, 0x1 + strb r0, [r1, 0xE] + movs r4, 0x13 + b _0811B81E +_0811B7F0: + ldr r0, _0811B814 + ldr r1, [r0] + movs r0, 0x11 + ldrsb r0, [r1, r0] + ldrb r3, [r1, 0xE] + adds r0, r3 + ldrb r2, [r1, 0xF] + cmp r0, r2 + bge _0811B8C0 + ldrb r2, [r1, 0x11] + movs r0, 0x11 + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bgt _0811B818 + adds r0, r2, 0x1 +_0811B80E: + strb r0, [r1, 0x11] + movs r4, 0x12 + b _0811B81E + .align 2, 0 +_0811B814: .4byte 0x0203a118 +_0811B818: + adds r0, r3, 0x1 + strb r0, [r1, 0xE] + movs r4, 0x14 +_0811B81E: + bl sub_811B9A0 + adds r0, r4, 0 + b _0811B8C2 +_0811B826: + ldr r0, _0811B838 + ldr r1, [r0] + ldrb r2, [r1, 0x10] + movs r0, 0x10 + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _0811B83C + subs r0, r2, 0x1 + b _0811B83E + .align 2, 0 +_0811B838: .4byte 0x0203a118 +_0811B83C: + movs r0, 0x1 +_0811B83E: + strb r0, [r1, 0x10] + bl sub_811B9A0 +_0811B844: + movs r0, 0x12 + b _0811B8C2 +_0811B848: + ldr r4, _0811B86C + ldr r1, [r4] + ldrb r2, [r1, 0x10] + movs r0, 0x10 + ldrsb r0, [r1, r0] + cmp r0, 0 + bgt _0811B866 + adds r0, r2, 0x1 + strb r0, [r1, 0x10] + bl sub_811BA1C + lsls r0, 24 + cmp r0, 0 + beq _0811B844 + ldr r1, [r4] +_0811B866: + movs r0, 0 + strb r0, [r1, 0x10] + b _0811B844 + .align 2, 0 +_0811B86C: .4byte 0x0203a118 +_0811B870: + ldr r0, _0811B884 + ldr r2, [r0] + ldrb r0, [r2, 0xE] + adds r1, r0, 0 + cmp r1, 0 + beq _0811B8C0 + cmp r1, 0x3 + bls _0811B888 + subs r0, 0x4 + b _0811B88A + .align 2, 0 +_0811B884: .4byte 0x0203a118 +_0811B888: + movs r0, 0 +_0811B88A: + strb r0, [r2, 0xE] + movs r0, 0x15 + b _0811B8C2 +_0811B890: + ldr r3, _0811B8BC + ldr r1, [r3] + ldrb r2, [r1, 0xE] + ldrb r0, [r1, 0xF] + subs r0, 0x4 + cmp r2, r0 + bgt _0811B8C0 + adds r0, r2, 0x4 + strb r0, [r1, 0xE] + ldr r2, [r3] + ldrb r1, [r2, 0xE] + ldrb r3, [r2, 0xF] + subs r0, r3, 0x3 + cmp r1, r0 + ble _0811B8B4 + adds r0, r3, 0 + adds r0, 0xFD + strb r0, [r2, 0xE] +_0811B8B4: + bl sub_811B9A0 + movs r0, 0x16 + b _0811B8C2 + .align 2, 0 +_0811B8BC: .4byte 0x0203a118 +_0811B8C0: + movs r0, 0 +_0811B8C2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B794 + + thumb_func_start sub_811B8C8 +sub_811B8C8: @ 811B8C8 + ldr r0, _0811B8E4 + ldr r0, [r0] + movs r2, 0x6 + ldrsb r2, [r0, r2] + ldrb r1, [r0, 0x2] + muls r1, r2 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_0811B8E4: .4byte 0x0203a118 + thumb_func_end sub_811B8C8 + + thumb_func_start sub_811B8E8 +sub_811B8E8: @ 811B8E8 + ldr r0, _0811B904 + ldr r0, [r0] + movs r1, 0xB + ldrsb r1, [r0, r1] + ldrb r2, [r0, 0xC] + adds r1, r2 + lsls r1, 1 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_0811B904: .4byte 0x0203a118 + thumb_func_end sub_811B8E8 + + thumb_func_start sub_811B908 +sub_811B908: @ 811B908 + push {lr} + ldr r0, _0811B938 + ldr r1, [r0] + ldrb r0, [r1, 0xA] + movs r3, 0 + cmp r0, 0x6 + bhi _0811B91A + movs r3, 0xA + ldrsb r3, [r1, r3] +_0811B91A: + ldrb r0, [r1, 0xB] + movs r2, 0 + cmp r0, 0x3 + bhi _0811B926 + movs r2, 0xB + ldrsb r2, [r1, r2] +_0811B926: + ldr r0, _0811B93C + lsls r1, r2, 3 + subs r1, r2 + adds r1, r3, r1 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_0811B938: .4byte 0x0203a118 +_0811B93C: .4byte 0x08597748 + thumb_func_end sub_811B908 + + thumb_func_start sub_811B940 +sub_811B940: @ 811B940 + ldr r0, _0811B95C + ldr r0, [r0] + movs r1, 0x11 + ldrsb r1, [r0, r1] + ldrb r2, [r0, 0xE] + adds r1, r2 + lsls r1, 1 + ldrb r0, [r0, 0x10] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_0811B95C: .4byte 0x0203a118 + thumb_func_end sub_811B940 + + thumb_func_start sub_811B960 +sub_811B960: @ 811B960 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0811B96E + cmp r0, 0x1 + beq _0811B972 +_0811B96E: + movs r0, 0x6 + b _0811B974 +_0811B972: + movs r0, 0x5 +_0811B974: + pop {r1} + bx r1 + thumb_func_end sub_811B960 + + thumb_func_start sub_811B978 +sub_811B978: @ 811B978 + push {lr} + b _0811B98E +_0811B97C: + ldr r0, _0811B99C + ldr r1, [r0] + ldrb r2, [r1, 0xA] + movs r0, 0xA + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B998 + subs r0, r2, 0x1 + strb r0, [r1, 0xA] +_0811B98E: + bl sub_811B9C8 + lsls r0, 24 + cmp r0, 0 + bne _0811B97C +_0811B998: + pop {r0} + bx r0 + .align 2, 0 +_0811B99C: .4byte 0x0203a118 + thumb_func_end sub_811B978 + + thumb_func_start sub_811B9A0 +sub_811B9A0: @ 811B9A0 + push {lr} + b _0811B9B6 +_0811B9A4: + ldr r0, _0811B9C4 + ldr r1, [r0] + ldrb r2, [r1, 0x10] + movs r0, 0x10 + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B9C0 + subs r0, r2, 0x1 + strb r0, [r1, 0x10] +_0811B9B6: + bl sub_811BA1C + lsls r0, 24 + cmp r0, 0 + bne _0811B9A4 +_0811B9C0: + pop {r0} + bx r0 + .align 2, 0 +_0811B9C4: .4byte 0x0203a118 + thumb_func_end sub_811B9A0 + + thumb_func_start sub_811B9C8 +sub_811B9C8: @ 811B9C8 + push {r4,lr} + ldr r4, _0811B9F4 + ldr r1, [r4] + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811B9F8 + bl sub_811B8E8 + adds r4, r0, 0 + bl sub_811F3AC + movs r1, 0 + lsls r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsrs r0, 24 + cmp r4, r0 + bcc _0811B9EE + movs r1, 0x1 +_0811B9EE: + adds r0, r1, 0 + b _0811BA14 + .align 2, 0 +_0811B9F4: .4byte 0x0203a118 +_0811B9F8: + ldrb r0, [r1, 0xB] + bl sub_811B960 + movs r2, 0 + ldr r1, [r4] + ldrb r1, [r1, 0xA] + lsls r1, 24 + asrs r1, 24 + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + ble _0811BA12 + movs r2, 0x1 +_0811BA12: + adds r0, r2, 0 +_0811BA14: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B9C8 + + thumb_func_start sub_811BA1C +sub_811BA1C: @ 811BA1C + push {r4,lr} + bl sub_811B940 + adds r4, r0, 0 + bl sub_811F5B0 + movs r1, 0 + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + bcc _0811BA34 + movs r1, 0x1 +_0811BA34: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811BA1C + + thumb_func_start sub_811BA3C +sub_811BA3C: @ 811BA3C + ldr r2, _0811BA54 + ldr r0, _0811BA58 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + lsrs r0, 7 + bx lr + .align 2, 0 +_0811BA54: .4byte 0x08597550 +_0811BA58: .4byte 0x0203a118 + thumb_func_end sub_811BA3C + + thumb_func_start sub_811BA5C +sub_811BA5C: @ 811BA5C + ldr r0, _0811BA64 + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .align 2, 0 +_0811BA64: .4byte 0x0203a118 + thumb_func_end sub_811BA5C + + thumb_func_start sub_811BA68 +sub_811BA68: @ 811BA68 + ldr r2, _0811BA80 + ldr r0, _0811BA84 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + lsls r0, 25 + lsrs r0, 25 + bx lr + .align 2, 0 +_0811BA80: .4byte 0x08597550 +_0811BA84: .4byte 0x0203a118 + thumb_func_end sub_811BA68 + + thumb_func_start sub_811BA88 +sub_811BA88: @ 811BA88 + ldr r0, _0811BA90 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bx lr + .align 2, 0 +_0811BA90: .4byte 0x0203a118 + thumb_func_end sub_811BA88 + + thumb_func_start sub_811BA94 +sub_811BA94: @ 811BA94 + ldr r0, _0811BA9C + ldr r0, [r0] + adds r0, 0x3C + bx lr + .align 2, 0 +_0811BA9C: .4byte 0x0203a118 + thumb_func_end sub_811BA94 + + thumb_func_start sub_811BAA0 +sub_811BAA0: @ 811BAA0 + ldr r0, _0811BAA8 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bx lr + .align 2, 0 +_0811BAA8: .4byte 0x0203a118 + thumb_func_end sub_811BAA0 + + thumb_func_start sub_811BAAC +sub_811BAAC: @ 811BAAC + ldr r0, _0811BAB4 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + bx lr + .align 2, 0 +_0811BAB4: .4byte 0x0203a118 + thumb_func_end sub_811BAAC + + thumb_func_start sub_811BAB8 +sub_811BAB8: @ 811BAB8 + ldr r0, _0811BAC0 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + bx lr + .align 2, 0 +_0811BAC0: .4byte 0x0203a118 + thumb_func_end sub_811BAB8 + + thumb_func_start sub_811BAC4 +sub_811BAC4: @ 811BAC4 + ldr r0, _0811BACC + ldr r0, [r0] + ldrb r0, [r0, 0x6] + bx lr + .align 2, 0 +_0811BACC: .4byte 0x0203a118 + thumb_func_end sub_811BAC4 + + thumb_func_start sub_811BAD0 +sub_811BAD0: @ 811BAD0 + push {r4,r5,lr} + ldr r4, _0811BB00 + ldr r2, _0811BB04 + ldr r5, [r2] + ldrb r3, [r5, 0x1] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 3 + adds r3, r4, 0 + adds r3, 0x8 + adds r2, r3 + ldr r2, [r2] + str r2, [r0] + ldrb r2, [r5, 0x1] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r4, 0xC + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811BB00: .4byte 0x08597550 +_0811BB04: .4byte 0x0203a118 + thumb_func_end sub_811BAD0 + + thumb_func_start sub_811BB08 +sub_811BB08: @ 811BB08 + push {r4,r5,lr} + ldr r4, _0811BB38 + ldr r2, _0811BB3C + ldr r5, [r2] + ldrb r3, [r5, 0x1] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 3 + adds r3, r4, 0 + adds r3, 0x10 + adds r2, r3 + ldr r2, [r2] + str r2, [r0] + ldrb r2, [r5, 0x1] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r4, 0x14 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811BB38: .4byte 0x08597550 +_0811BB3C: .4byte 0x0203a118 + thumb_func_end sub_811BB08 + + thumb_func_start sub_811BB40 +sub_811BB40: @ 811BB40 + push {lr} + adds r2, r0, 0 + ldr r0, _0811BB54 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bne _0811BB5C + ldr r0, _0811BB58 + b _0811BB7A + .align 2, 0 +_0811BB54: .4byte 0x0203a118 +_0811BB58: .4byte 0x085ec3b4 +_0811BB5C: + cmp r0, 0x4 + blt _0811BB78 + cmp r0, 0x10 + bgt _0811BB78 + cmp r0, 0xF + blt _0811BB78 + ldr r0, _0811BB70 + str r0, [r2] + ldr r0, _0811BB74 + b _0811BB7E + .align 2, 0 +_0811BB70: .4byte 0x085ec706 +_0811BB74: .4byte 0x085ec727 +_0811BB78: + ldr r0, _0811BB84 +_0811BB7A: + str r0, [r2] + movs r0, 0 +_0811BB7E: + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0811BB84: .4byte 0x085ec3a6 + thumb_func_end sub_811BB40 + + thumb_func_start sub_811BB88 +sub_811BB88: @ 811BB88 + ldr r2, _0811BB94 + str r2, [r0] + ldr r0, _0811BB98 + str r0, [r1] + bx lr + .align 2, 0 +_0811BB94: .4byte 0x085ec410 +_0811BB98: .4byte 0x085ec42f + thumb_func_end sub_811BB88 + + thumb_func_start sub_811BB9C +sub_811BB9C: @ 811BB9C + ldr r2, _0811BBAC + ldr r3, [r2] + ldrb r2, [r3, 0xA] + strb r2, [r0] + ldrb r0, [r3, 0xB] + strb r0, [r1] + bx lr + .align 2, 0 +_0811BBAC: .4byte 0x0203a118 + thumb_func_end sub_811BB9C + + thumb_func_start sub_811BBB0 +sub_811BBB0: @ 811BBB0 + ldr r0, _0811BBB8 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + bx lr + .align 2, 0 +_0811BBB8: .4byte 0x0203a118 + thumb_func_end sub_811BBB0 + + thumb_func_start sub_811BBBC +sub_811BBBC: @ 811BBBC + ldr r0, _0811BBC4 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + bx lr + .align 2, 0 +_0811BBC4: .4byte 0x0203a118 + thumb_func_end sub_811BBBC + + thumb_func_start sub_811BBC8 +sub_811BBC8: @ 811BBC8 + ldr r2, _0811BBD8 + ldr r3, [r2] + ldrb r2, [r3, 0x10] + strb r2, [r0] + ldrb r0, [r3, 0x11] + strb r0, [r1] + bx lr + .align 2, 0 +_0811BBD8: .4byte 0x0203a118 + thumb_func_end sub_811BBC8 + + thumb_func_start sub_811BBDC +sub_811BBDC: @ 811BBDC + ldr r0, _0811BBE4 + ldr r0, [r0] + ldrb r0, [r0, 0xE] + bx lr + .align 2, 0 +_0811BBE4: .4byte 0x0203a118 + thumb_func_end sub_811BBDC + + thumb_func_start sub_811BBE8 +sub_811BBE8: @ 811BBE8 + ldr r0, _0811BBF0 + ldr r0, [r0] + ldrb r0, [r0, 0xF] + bx lr + .align 2, 0 +_0811BBF0: .4byte 0x0203a118 + thumb_func_end sub_811BBE8 + + thumb_func_start sub_811BBF4 +sub_811BBF4: @ 811BBF4 + movs r0, 0 + bx lr + thumb_func_end sub_811BBF4 + + thumb_func_start sub_811BBF8 +sub_811BBF8: @ 811BBF8 + push {lr} + ldr r0, _0811BC0C + ldr r1, [r0] + ldrb r0, [r1, 0x4] + cmp r0, 0x2 + beq _0811BC10 + cmp r0, 0x3 + beq _0811BC1A + b _0811BC24 + .align 2, 0 +_0811BC0C: .4byte 0x0203a118 +_0811BC10: + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811BC24 + ldrb r0, [r1, 0xC] + b _0811BC1C +_0811BC1A: + ldrb r0, [r1, 0xE] +_0811BC1C: + cmp r0, 0 + beq _0811BC24 + movs r0, 0x1 + b _0811BC26 +_0811BC24: + movs r0, 0 +_0811BC26: + pop {r1} + bx r1 + thumb_func_end sub_811BBF8 + + thumb_func_start sub_811BC2C +sub_811BC2C: @ 811BC2C + push {lr} + ldr r0, _0811BC40 + ldr r2, [r0] + ldrb r0, [r2, 0x4] + cmp r0, 0x2 + beq _0811BC44 + cmp r0, 0x3 + beq _0811BC5A + b _0811BC68 + .align 2, 0 +_0811BC40: .4byte 0x0203a118 +_0811BC44: + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _0811BC68 + ldrb r1, [r2, 0xC] + adds r1, 0x4 + ldrb r0, [r2, 0xD] + subs r0, 0x1 + cmp r1, r0 + bgt _0811BC68 + movs r0, 0x1 + b _0811BC6A +_0811BC5A: + ldrb r0, [r2, 0xE] + adds r0, 0x4 + ldrb r2, [r2, 0xF] + cmp r0, r2 + bgt _0811BC68 + movs r0, 0x1 + b _0811BC6A +_0811BC68: + movs r0, 0 +_0811BC6A: + pop {r1} + bx r1 + thumb_func_end sub_811BC2C + + thumb_func_start sub_811BC70 +sub_811BC70: @ 811BC70 + push {lr} + bl sub_811BA3C + pop {r1} + bx r1 + thumb_func_end sub_811BC70 + + thumb_func_start sub_811BC7C +sub_811BC7C: @ 811BC7C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + movs r2, 0 + cmp r2, r3 + bcs _0811BCB2 + ldr r0, _0811BCA4 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x3C +_0811BC92: + lsls r0, r2, 1 + adds r1, r0, r5 + adds r0, r4, r0 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + beq _0811BCA8 + movs r0, 0x1 + b _0811BCB4 + .align 2, 0 +_0811BCA4: .4byte 0x0203a118 +_0811BCA8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _0811BC92 +_0811BCB2: + movs r0, 0 +_0811BCB4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811BC7C + + thumb_func_start sub_811BCBC +sub_811BCBC: @ 811BCBC + ldr r0, _0811BCC4 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + bx lr + .align 2, 0 +_0811BCC4: .4byte 0x0203a118 + thumb_func_end sub_811BCBC + + thumb_func_start sub_811BCC8 +sub_811BCC8: @ 811BCC8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r2, _0811BCE0 +_0811BCD2: + ldrb r0, [r2] + cmp r0, r3 + bne _0811BCE4 + lsls r0, r1, 24 + lsrs r0, 24 + b _0811BCEE + .align 2, 0 +_0811BCE0: .4byte 0x08597550 +_0811BCE4: + adds r2, 0x18 + adds r1, 0x1 + cmp r1, 0x14 + bls _0811BCD2 + movs r0, 0 +_0811BCEE: + pop {r1} + bx r1 + thumb_func_end sub_811BCC8 + + thumb_func_start sub_811BCF4 +sub_811BCF4: @ 811BCF4 + push {r4,lr} + movs r2, 0 + ldr r0, _0811BD14 + ldr r0, [r0] + ldrb r1, [r0, 0x7] + cmp r2, r1 + bge _0811BD24 + ldr r4, _0811BD18 + adds r3, r1, 0 + adds r1, r0, 0 + adds r1, 0x3C +_0811BD0A: + ldrh r0, [r1] + cmp r0, r4 + beq _0811BD1C + movs r0, 0 + b _0811BD26 + .align 2, 0 +_0811BD14: .4byte 0x0203a118 +_0811BD18: .4byte 0x0000ffff +_0811BD1C: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0811BD0A +_0811BD24: + movs r0, 0x1 +_0811BD26: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811BCF4 + + thumb_func_start sub_811BD2C +sub_811BD2C: @ 811BD2C + push {r4,lr} + movs r2, 0 + ldr r0, _0811BD4C + ldr r0, [r0] + ldrb r1, [r0, 0x7] + cmp r2, r1 + bge _0811BD5C + ldr r4, _0811BD50 + adds r3, r1, 0 + adds r1, r0, 0 + adds r1, 0x3C +_0811BD42: + ldrh r0, [r1] + cmp r0, r4 + bne _0811BD54 + movs r0, 0 + b _0811BD5E + .align 2, 0 +_0811BD4C: .4byte 0x0203a118 +_0811BD50: .4byte 0x0000ffff +_0811BD54: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0811BD42 +_0811BD5C: + movs r0, 0x1 +_0811BD5E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811BD2C + + thumb_func_start sub_811BD64 +sub_811BD64: @ 811BD64 + push {r4,lr} + ldr r0, _0811BD78 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x11 + bne _0811BD80 + bl sub_811BCF4 + b _0811BD9C + .align 2, 0 +_0811BD78: .4byte 0x0203a118 +_0811BD7C: + movs r0, 0 + b _0811BD9C +_0811BD80: + ldr r0, _0811BDA4 + ldr r0, [r0] + movs r2, 0 + ldr r3, _0811BDA8 + ldr r4, _0811BDAC + adds r1, r0, r4 +_0811BD8C: + ldrh r0, [r1] + cmp r0, r3 + bne _0811BD7C + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x8 + ble _0811BD8C + movs r0, 0x1 +_0811BD9C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0811BDA4: .4byte 0x03005d8c +_0811BDA8: .4byte 0x0000ffff +_0811BDAC: .4byte 0x00003b5a + thumb_func_end sub_811BD64 + + thumb_func_start sub_811BDB0 +sub_811BDB0: @ 811BDB0 + push {lr} + ldr r0, _0811BDC4 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x12 + bne _0811BDC8 + bl sub_811BCF4 + b _0811BDDE + .align 2, 0 +_0811BDC4: .4byte 0x0203a118 +_0811BDC8: + ldr r0, _0811BDE4 + ldr r0, [r0] + ldr r1, _0811BDE8 + adds r0, r1 + movs r2, 0 + ldrh r1, [r0, 0x14] + ldr r0, _0811BDEC + cmp r1, r0 + bne _0811BDDC + movs r2, 0x1 +_0811BDDC: + adds r0, r2, 0 +_0811BDDE: + pop {r1} + bx r1 + .align 2, 0 +_0811BDE4: .4byte 0x03005d8c +_0811BDE8: .4byte 0x00003b58 +_0811BDEC: .4byte 0x0000ffff + thumb_func_end sub_811BDB0 + + thumb_func_start sub_811BDF0 +sub_811BDF0: @ 811BDF0 + push {r4-r6,lr} + sub sp, 0x20 + adds r6, r0, 0 + ldr r0, _0811BE28 + ldr r4, [r0] + bl sub_81AFBF0 + ldr r0, _0811BE2C + adds r5, r4, r0 + adds r0, r5, 0 + bl sub_8008C24 + lsls r0, 16 + cmp r0, 0 + beq _0811BE34 + ldr r1, _0811BE30 + adds r0, r4, r1 + ldrb r2, [r0] + mov r0, sp + adds r1, r5, 0 + bl sub_81DB5E8 + movs r0, 0 + mov r1, sp + bl sub_81AFC0C + b _0811BE3C + .align 2, 0 +_0811BE28: .4byte 0x03005d8c +_0811BE2C: .4byte 0x00003b70 +_0811BE30: .4byte 0x00003b85 +_0811BE34: + ldr r1, _0811BE4C + movs r0, 0 + bl sub_81AFC0C +_0811BE3C: + ldr r1, _0811BE50 + adds r0, r6, 0 + bl sub_81AFC28 + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811BE4C: .4byte 0x085ec6b2 +_0811BE50: .4byte 0x085ec6a8 + thumb_func_end sub_811BDF0 + + thumb_func_start sub_811BE54 +sub_811BE54: @ 811BE54 + push {r4,r5,lr} + ldr r0, _0811BE64 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x3C + ldr r2, _0811BE68 + movs r5, 0 + b _0811BE86 + .align 2, 0 +_0811BE64: .4byte 0x0203a118 +_0811BE68: .4byte 0x02021dc4 +_0811BE6C: + ldrh r1, [r4] + adds r0, r2, 0 + movs r2, 0 + bl sub_811F434 + adds r2, r0, 0 + movs r0, 0 + strb r0, [r2] + adds r2, 0x1 + adds r4, 0x2 + adds r5, 0x1 + ldr r0, _0811BE98 + ldr r0, [r0] +_0811BE86: + ldrb r0, [r0, 0x7] + cmp r5, r0 + blt _0811BE6C + subs r2, 0x1 + movs r0, 0xFF + strb r0, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811BE98: .4byte 0x0203a118 + thumb_func_end sub_811BE54 + + thumb_func_start sub_811BE9C +sub_811BE9C: @ 811BE9C + push {r4,r5,lr} + ldr r5, _0811BEB4 + ldr r0, [r5] + ldrb r0, [r0] + cmp r0, 0x9 + beq _0811BEF0 + cmp r0, 0x9 + bgt _0811BEB8 + cmp r0, 0 + beq _0811BEC2 + b _0811BF14 + .align 2, 0 +_0811BEB4: .4byte 0x0203a118 +_0811BEB8: + cmp r0, 0xD + beq _0811BF0C + cmp r0, 0x14 + beq _0811BED0 + b _0811BF14 +_0811BEC2: + ldr r0, _0811BECC + bl flag_set + b _0811BF14 + .align 2, 0 +_0811BECC: .4byte 0x00000865 +_0811BED0: + bl sub_811BF20 + adds r1, r0, 0 + cmp r1, 0 + beq _0811BEE4 + ldr r1, _0811BEE0 + movs r0, 0x2 + b _0811BF12 + .align 2, 0 +_0811BEE0: .4byte 0x020375e0 +_0811BEE4: + ldr r0, _0811BEEC + strh r1, [r0] + b _0811BF14 + .align 2, 0 +_0811BEEC: .4byte 0x020375e0 +_0811BEF0: + bl sub_811BE54 + ldr r4, _0811BF08 + ldr r0, [r5] + adds r0, 0x3C + bl sub_81226D8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + b _0811BF14 + .align 2, 0 +_0811BF08: .4byte 0x020375e0 +_0811BF0C: + bl sub_811BF40 + ldr r1, _0811BF1C +_0811BF12: + strh r0, [r1] +_0811BF14: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811BF1C: .4byte 0x020375e0 + thumb_func_end sub_811BE9C + + thumb_func_start sub_811BF20 +sub_811BF20: @ 811BF20 + push {lr} + ldr r0, _0811BF3C + movs r1, 0x4 + bl sub_811BC7C + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _0811BF34 + movs r1, 0x1 +_0811BF34: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_0811BF3C: .4byte 0x08597764 + thumb_func_end sub_811BF20 + + thumb_func_start sub_811BF40 +sub_811BF40: @ 811BF40 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0x80 + lsls r5, 9 +_0811BF48: + lsls r0, r4, 2 + ldr r1, _0811BF60 + adds r0, r1 + movs r1, 0x2 + bl sub_811BC7C + lsls r0, 24 + cmp r0, 0 + bne _0811BF64 + lsrs r0, r5, 16 + b _0811BF72 + .align 2, 0 +_0811BF60: .4byte 0x0859776c +_0811BF64: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x4 + ble _0811BF48 + movs r0, 0 +_0811BF72: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811BF40 + + thumb_func_start sub_811BF78 +sub_811BF78: @ 811BF78 + ldr r0, _0811BF84 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x13] + bx lr + .align 2, 0 +_0811BF84: .4byte 0x0203a118 + thumb_func_end sub_811BF78 + + thumb_func_start sub_811BF88 +sub_811BF88: @ 811BF88 + movs r0, 0 + bx lr + thumb_func_end sub_811BF88 + + thumb_func_start sub_811BF8C +sub_811BF8C: @ 811BF8C + push {lr} + bl sub_811CE94 + lsls r0, 24 + cmp r0, 0 + beq _0811BF9C + movs r0, 0x1 + b _0811BF9E +_0811BF9C: + movs r0, 0 +_0811BF9E: + pop {r1} + bx r1 + thumb_func_end sub_811BF8C + + thumb_func_start sub_811BFA4 +sub_811BFA4: @ 811BFA4 + push {r4,lr} + sub sp, 0x8 + ldr r0, _0811BFC0 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x5 + bls _0811BFB4 + b _0811C120 +_0811BFB4: + lsls r0, 2 + ldr r1, _0811BFC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811BFC0: .4byte 0x0203a11c +_0811BFC4: .4byte _0811BFC8 + .align 2, 0 +_0811BFC8: + .4byte _0811BFE0 + .4byte _0811C044 + .4byte _0811C090 + .4byte _0811C0AC + .4byte _0811C0BE + .4byte _0811C0D4 +_0811BFE0: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0811C034 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _0811C038 + ldr r1, [r4] + movs r0, 0xB0 + lsls r0, 4 + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + ldr r1, [r4] + movs r0, 0xC0 + lsls r0, 2 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r0, _0811C03C + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + bl sub_811CF64 + bl sub_811CF04 + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _0811C040 + add r0, sp, 0x4 + bl CpuFastSet + b _0811C124 + .align 2, 0 +_0811C034: .4byte 0x08597c54 +_0811C038: .4byte 0x0203a11c +_0811C03C: .4byte 0x08597c64 +_0811C040: .4byte 0x01000100 +_0811C044: + ldr r1, _0811C084 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _0811C088 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + bl sub_811D60C + ldr r0, _0811C08C + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + adds r0, r1 + bl sub_811D424 + bl sub_811D230 + bl sub_811E948 + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0811C124 + .align 2, 0 +_0811C084: .4byte 0x08dcbdd0 +_0811C088: .4byte 0x08dcbf10 +_0811C08C: .4byte 0x0203a11c +_0811C090: + ldr r1, _0811C0A8 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0811C124 + .align 2, 0 +_0811C0A8: .4byte 0x08597b54 +_0811C0AC: + bl sub_811CFCC + bl sub_811D0BC + bl sub_811D2C8 + bl sub_811D684 + b _0811C124 +_0811C0BE: + bl sub_811DE90 + bl sub_811BA5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _0811C124 + bl sub_811DEC4 + b _0811C124 +_0811C0D4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C12E + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_811DE5C + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x3B + bl lcd_io_set + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0 + bl gpu_sync_bg_show + bl sub_811E5D4 + bl sub_811E720 + bl sub_811E828 + b _0811C124 +_0811C120: + movs r0, 0 + b _0811C130 +_0811C124: + ldr r0, _0811C138 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C12E: + movs r0, 0x1 +_0811C130: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0811C138: .4byte 0x0203a11c + thumb_func_end sub_811BFA4 + + thumb_func_start sub_811C13C +sub_811C13C: @ 811C13C + push {r4,lr} + ldr r4, _0811C154 + ldr r0, [r4] + cmp r0, 0 + beq _0811C14E + bl free + movs r0, 0 + str r0, [r4] +_0811C14E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811C154: .4byte 0x0203a11c + thumb_func_end sub_811C13C + + thumb_func_start sub_811C158 +sub_811C158: @ 811C158 + push {lr} + ldr r1, _0811C16C + ldr r1, [r1] + movs r2, 0 + strh r0, [r1, 0x4] + strh r2, [r1] + bl sub_811C170 + pop {r0} + bx r0 + .align 2, 0 +_0811C16C: .4byte 0x0203a11c + thumb_func_end sub_811C158 + + thumb_func_start sub_811C170 +sub_811C170: @ 811C170 + push {lr} + ldr r0, _0811C188 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0x22 + bls _0811C17E + b _0811C2CE +_0811C17E: + lsls r0, 2 + ldr r1, _0811C18C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C188: .4byte 0x0203a11c +_0811C18C: .4byte _0811C190 + .align 2, 0 +_0811C190: + .4byte _0811C2CE + .4byte _0811C21C + .4byte _0811C222 + .4byte _0811C228 + .4byte _0811C22E + .4byte _0811C234 + .4byte _0811C23A + .4byte _0811C240 + .4byte _0811C246 + .4byte _0811C24C + .4byte _0811C252 + .4byte _0811C258 + .4byte _0811C25E + .4byte _0811C264 + .4byte _0811C26A + .4byte _0811C270 + .4byte _0811C276 + .4byte _0811C27C + .4byte _0811C282 + .4byte _0811C288 + .4byte _0811C28E + .4byte _0811C294 + .4byte _0811C29A + .4byte _0811C2A0 + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2A6 + .4byte _0811C2AC + .4byte _0811C2B2 + .4byte _0811C2B8 + .4byte _0811C2BE + .4byte _0811C2C4 +_0811C21C: + bl sub_811C2D4 + b _0811C2C8 +_0811C222: + bl sub_811C30C + b _0811C2C8 +_0811C228: + bl sub_811C3E4 + b _0811C2C8 +_0811C22E: + bl sub_811C48C + b _0811C2C8 +_0811C234: + bl sub_811C404 + b _0811C2C8 +_0811C23A: + bl sub_811C448 + b _0811C2C8 +_0811C240: + bl sub_811C4D0 + b _0811C2C8 +_0811C246: + bl sub_811C518 + b _0811C2C8 +_0811C24C: + bl sub_811C554 + b _0811C2C8 +_0811C252: + bl sub_811C620 + b _0811C2C8 +_0811C258: + bl sub_811C830 + b _0811C2C8 +_0811C25E: + bl sub_811C8F0 + b _0811C2C8 +_0811C264: + bl sub_811C99C + b _0811C2C8 +_0811C26A: + bl sub_811CA5C + b _0811C2C8 +_0811C270: + bl sub_811C780 + b _0811C2C8 +_0811C276: + bl sub_811C78C + b _0811C2C8 +_0811C27C: + bl sub_811C7D4 + b _0811C2C8 +_0811C282: + bl sub_811CB18 + b _0811C2C8 +_0811C288: + bl sub_811CB98 + b _0811C2C8 +_0811C28E: + bl sub_811CB24 + b _0811C2C8 +_0811C294: + bl sub_811CC90 + b _0811C2C8 +_0811C29A: + bl sub_811CC08 + b _0811C2C8 +_0811C2A0: + bl sub_811C6C0 + b _0811C2C8 +_0811C2A6: + bl sub_811CD14 + b _0811C2C8 +_0811C2AC: + bl sub_811CD54 + b _0811C2C8 +_0811C2B2: + bl sub_811CD94 + b _0811C2C8 +_0811C2B8: + bl sub_811CDD4 + b _0811C2C8 +_0811C2BE: + bl sub_811CE14 + b _0811C2C8 +_0811C2C4: + bl sub_811CE54 +_0811C2C8: + lsls r0, 24 + lsrs r0, 24 + b _0811C2D0 +_0811C2CE: + movs r0, 0 +_0811C2D0: + pop {r1} + bx r1 + thumb_func_end sub_811C170 + + thumb_func_start sub_811C2D4 +sub_811C2D4: @ 811C2D4 + push {r4,lr} + ldr r4, _0811C2E8 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C2EC + cmp r0, 0x1 + beq _0811C2FA + b _0811C304 + .align 2, 0 +_0811C2E8: .4byte 0x0203a11c +_0811C2EC: + bl sub_811D2C8 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C304 +_0811C2FA: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811C306 +_0811C304: + movs r0, 0x1 +_0811C306: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C2D4 + + thumb_func_start sub_811C30C +sub_811C30C: @ 811C30C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + bl sub_811BA94 + adds r4, r0, 0 + bl sub_811BA68 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl sub_811BAB8 + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_811BAC4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + bl sub_811BAAC + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + lsls r0, 1 + adds r4, r0 + ldr r1, _0811C378 + mov r2, r10 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 8 + movs r1, 0xD0 + lsls r1, 12 + adds r0, r1 + lsrs r6, r0, 16 + movs r5, 0 + cmp r5, r7 + bcs _0811C3AA + ldr r2, _0811C37C + mov r8, r2 +_0811C36C: + ldrh r0, [r4] + cmp r0, r8 + bne _0811C380 + movs r0, 0x48 + b _0811C392 + .align 2, 0 +_0811C378: .4byte 0x08597c30 +_0811C37C: .4byte 0x0000ffff +_0811C380: + ldrh r1, [r4] + mov r0, sp + bl sub_811EBBC + movs r0, 0x1 + mov r1, sp + movs r2, 0 + bl font_get_width_of_string +_0811C392: + adds r0, 0x11 + lsls r1, r6, 16 + asrs r1, 16 + adds r1, r0 + lsls r1, 16 + lsrs r6, r1, 16 + adds r4, 0x2 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _0811C36C +_0811C3AA: + ldr r1, _0811C3E0 + mov r2, r10 + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + lsrs r1, 5 + mov r2, r9 + lsls r0, r2, 1 + adds r1, r0 + lsls r1, 27 + lsls r0, r6, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 20 + adds r1, r2 + lsrs r1, 24 + bl sub_811DF60 + movs r0, 0 + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811C3E0: .4byte 0x08597c30 + thumb_func_end sub_811C30C + + thumb_func_start sub_811C3E4 +sub_811C3E4: @ 811C3E4 + push {lr} + bl sub_811BAB8 + lsls r0, 24 + lsrs r0, 24 + bl sub_811E920 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x60 + bl sub_811DF60 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_811C3E4 + + thumb_func_start sub_811C404 +sub_811C404: @ 811C404 + push {r4,lr} + ldr r4, _0811C418 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C41C + cmp r0, 0x1 + beq _0811C436 + b _0811C440 + .align 2, 0 +_0811C418: .4byte 0x0203a11c +_0811C41C: + bl sub_811DF90 + movs r0, 0x2 + bl sub_811D104 + movs r0, 0x1 + bl sub_811D214 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C440 +_0811C436: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811C442 +_0811C440: + movs r0, 0x1 +_0811C442: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C404 + + thumb_func_start sub_811C448 +sub_811C448: @ 811C448 + push {r4,lr} + ldr r4, _0811C45C + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C460 + cmp r0, 0x1 + beq _0811C47A + b _0811C484 + .align 2, 0 +_0811C45C: .4byte 0x0203a11c +_0811C460: + bl sub_811DF90 + movs r0, 0x3 + bl sub_811D104 + movs r0, 0 + bl sub_811D214 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C484 +_0811C47A: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811C486 +_0811C484: + movs r0, 0x1 +_0811C486: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C448 + + thumb_func_start sub_811C48C +sub_811C48C: @ 811C48C + push {r4,lr} + ldr r4, _0811C4A0 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C4A4 + cmp r0, 0x1 + beq _0811C4BE + b _0811C4C8 + .align 2, 0 +_0811C4A0: .4byte 0x0203a11c +_0811C4A4: + bl sub_811DF90 + movs r0, 0x1 + bl sub_811D104 + movs r0, 0x1 + bl sub_811D214 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C4C8 +_0811C4BE: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811C4CA +_0811C4C8: + movs r0, 0x1 +_0811C4CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C48C + + thumb_func_start sub_811C4D0 +sub_811C4D0: @ 811C4D0 + push {r4,lr} + ldr r4, _0811C4E4 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C4E8 + cmp r0, 0x1 + beq _0811C506 + b _0811C510 + .align 2, 0 +_0811C4E4: .4byte 0x0203a11c +_0811C4E8: + bl sub_811DFB0 + movs r0, 0 + bl sub_811D104 + bl sub_811D2C8 + movs r0, 0 + bl gpu_sync_bg_show + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C510 +_0811C506: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811C512 +_0811C510: + movs r0, 0x1 +_0811C512: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C4D0 + + thumb_func_start sub_811C518 +sub_811C518: @ 811C518 + push {r4,lr} + ldr r4, _0811C52C + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C530 + cmp r0, 0x1 + beq _0811C546 + movs r0, 0x1 + b _0811C54E + .align 2, 0 +_0811C52C: .4byte 0x0203a11c +_0811C530: + bl sub_811DFB0 + movs r0, 0 + bl sub_811D104 + bl sub_811D2C8 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C546: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 +_0811C54E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C518 + + thumb_func_start sub_811C554 +sub_811C554: @ 811C554 + push {lr} + ldr r0, _0811C56C + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811C60E + lsls r0, 2 + ldr r1, _0811C570 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C56C: .4byte 0x0203a11c +_0811C570: .4byte _0811C574 + .align 2, 0 +_0811C574: + .4byte _0811C588 + .4byte _0811C5A4 + .4byte _0811C5B6 + .4byte _0811C5CC + .4byte _0811C5EC +_0811C588: + bl sub_811DF90 + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_811DE5C + bl sub_811D6D4 + b _0811C5DA +_0811C5A4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + movs r0, 0 + bl sub_811D9CC + b _0811C5DA +_0811C5B6: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + b _0811C5DA +_0811C5CC: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + bl sub_811E3AC +_0811C5DA: + ldr r0, _0811C5E8 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C618 + .align 2, 0 +_0811C5E8: .4byte 0x0203a11c +_0811C5EC: + bl sub_811E418 + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + bl sub_811DFC8 + movs r0, 0 + bl sub_811E6E0 + bl sub_811E64C + ldr r0, _0811C614 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C60E: + movs r0, 0 + b _0811C61A + .align 2, 0 +_0811C614: .4byte 0x0203a11c +_0811C618: + movs r0, 0x1 +_0811C61A: + pop {r1} + bx r1 + thumb_func_end sub_811C554 + + thumb_func_start sub_811C620 +sub_811C620: @ 811C620 + push {lr} + ldr r0, _0811C638 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811C6B8 + lsls r0, 2 + ldr r1, _0811C63C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C638: .4byte 0x0203a11c +_0811C63C: .4byte _0811C640 + .align 2, 0 +_0811C640: + .4byte _0811C654 + .4byte _0811C662 + .4byte _0811C67E + .4byte _0811C690 + .4byte _0811C6B4 +_0811C654: + bl sub_811E050 + bl sub_811E4AC + bl sub_811E6B0 + b _0811C6A4 +_0811C662: + bl sub_811E4D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0811C6B8 + movs r0, 0x1 + bl sub_811D9CC + ldr r0, _0811C68C + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C67E: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C6B8 + b _0811C6A4 + .align 2, 0 +_0811C68C: .4byte 0x0203a11c +_0811C690: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C6B8 + bl sub_811DFB0 + movs r0, 0 + bl gpu_sync_bg_show +_0811C6A4: + ldr r0, _0811C6B0 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C6B8 + .align 2, 0 +_0811C6B0: .4byte 0x0203a11c +_0811C6B4: + movs r0, 0 + b _0811C6BA +_0811C6B8: + movs r0, 0x1 +_0811C6BA: + pop {r1} + bx r1 + thumb_func_end sub_811C620 + + thumb_func_start sub_811C6C0 +sub_811C6C0: @ 811C6C0 + push {lr} + ldr r0, _0811C6D8 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811C778 + lsls r0, 2 + ldr r1, _0811C6DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C6D8: .4byte 0x0203a11c +_0811C6DC: .4byte _0811C6E0 + .align 2, 0 +_0811C6E0: + .4byte _0811C6F4 + .4byte _0811C708 + .4byte _0811C722 + .4byte _0811C748 + .4byte _0811C76E +_0811C6F4: + bl sub_811E050 + bl sub_811E6B0 + bl sub_811E55C + movs r0, 0x5 + bl sub_811D9CC + b _0811C736 +_0811C708: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811E5B8 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811D6D4 + b _0811C736 +_0811C722: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + movs r0, 0x6 + bl sub_811D9CC + bl sub_811E578 +_0811C736: + ldr r0, _0811C744 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C778 + .align 2, 0 +_0811C744: .4byte 0x0203a11c +_0811C748: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811E5B8 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811E64C + bl sub_811DFC8 + ldr r0, _0811C774 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C76E: + movs r0, 0 + b _0811C77A + .align 2, 0 +_0811C774: .4byte 0x0203a11c +_0811C778: + movs r0, 0x1 +_0811C77A: + pop {r1} + bx r1 + thumb_func_end sub_811C6C0 + + thumb_func_start sub_811C780 +sub_811C780: @ 811C780 + push {lr} + bl sub_811E088 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_811C780 + + thumb_func_start sub_811C78C +sub_811C78C: @ 811C78C + push {r4,lr} + ldr r4, _0811C7A0 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C7A4 + cmp r0, 0x1 + beq _0811C7B4 + b _0811C7CA + .align 2, 0 +_0811C7A0: .4byte 0x0203a11c +_0811C7A4: + movs r0, 0x1 + movs r1, 0x4 + bl sub_811DDAC + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C7B4: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811C7CA + bl sub_811E088 + bl sub_811E64C + movs r0, 0 + b _0811C7CC +_0811C7CA: + movs r0, 0x1 +_0811C7CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C78C + + thumb_func_start sub_811C7D4 +sub_811C7D4: @ 811C7D4 + push {r4,lr} + ldr r4, _0811C7EC + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811C808 + cmp r0, 0x1 + bgt _0811C7F0 + cmp r0, 0 + beq _0811C7F6 + b _0811C828 + .align 2, 0 +_0811C7EC: .4byte 0x0203a11c +_0811C7F0: + cmp r0, 0x2 + beq _0811C820 + b _0811C828 +_0811C7F6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x4 + bl sub_811DDAC + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C808: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811C828 + bl sub_811E64C + ldr r0, _0811C824 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C820: + movs r0, 0 + b _0811C82A + .align 2, 0 +_0811C824: .4byte 0x0203a11c +_0811C828: + movs r0, 0x1 +_0811C82A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C7D4 + + thumb_func_start sub_811C830 +sub_811C830: @ 811C830 + push {lr} + ldr r0, _0811C848 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x5 + bhi _0811C8E8 + lsls r0, 2 + ldr r1, _0811C84C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C848: .4byte 0x0203a11c +_0811C84C: .4byte _0811C850 + .align 2, 0 +_0811C850: + .4byte _0811C868 + .4byte _0811C876 + .4byte _0811C886 + .4byte _0811C898 + .4byte _0811C8B8 + .4byte _0811C8DE +_0811C868: + bl sub_811E050 + bl sub_811E4AC + bl sub_811E6B0 + b _0811C8A8 +_0811C876: + bl sub_811E4D0 + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + bl sub_811D9B4 + b _0811C8A8 +_0811C886: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + movs r0, 0x2 + bl sub_811D9CC + b _0811C8A8 +_0811C898: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + movs r0, 0x2 + bl sub_811D698 +_0811C8A8: + ldr r0, _0811C8B4 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C8E8 + .align 2, 0 +_0811C8B4: .4byte 0x0203a11c +_0811C8B8: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + bl sub_811E288 + movs r0, 0x1 + bl sub_811E6E0 + bl sub_811E64C + bl sub_811E794 + ldr r0, _0811C8E4 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C8DE: + movs r0, 0 + b _0811C8EA + .align 2, 0 +_0811C8E4: .4byte 0x0203a11c +_0811C8E8: + movs r0, 0x1 +_0811C8EA: + pop {r1} + bx r1 + thumb_func_end sub_811C830 + + thumb_func_start sub_811C8F0 +sub_811C8F0: @ 811C8F0 + push {lr} + ldr r0, _0811C908 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x5 + bhi _0811C994 + lsls r0, 2 + ldr r1, _0811C90C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C908: .4byte 0x0203a11c +_0811C90C: .4byte _0811C910 + .align 2, 0 +_0811C910: + .4byte _0811C928 + .4byte _0811C92E + .4byte _0811C940 + .4byte _0811C952 + .4byte _0811C974 + .4byte _0811C98C +_0811C928: + bl sub_811D2C8 + b _0811C962 +_0811C92E: + bl sub_811E380 + bl sub_811E6B0 + bl sub_811E7F8 + bl sub_811D9B4 + b _0811C962 +_0811C940: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C994 + movs r0, 0x3 + bl sub_811D9CC + b _0811C962 +_0811C952: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C994 + movs r0, 0 + bl gpu_sync_bg_show +_0811C962: + ldr r0, _0811C970 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C994 + .align 2, 0 +_0811C970: .4byte 0x0203a11c +_0811C974: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811C994 + bl sub_811DFB0 + ldr r0, _0811C990 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C98C: + movs r0, 0 + b _0811C996 + .align 2, 0 +_0811C990: .4byte 0x0203a11c +_0811C994: + movs r0, 0x1 +_0811C996: + pop {r1} + bx r1 + thumb_func_end sub_811C8F0 + + thumb_func_start sub_811C99C +sub_811C99C: @ 811C99C + push {lr} + ldr r0, _0811C9B4 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x6 + bhi _0811CA54 + lsls r0, 2 + ldr r1, _0811C9B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811C9B4: .4byte 0x0203a11c +_0811C9B8: .4byte _0811C9BC + .align 2, 0 +_0811C9BC: + .4byte _0811C9D8 + .4byte _0811C9DE + .4byte _0811C9F0 + .4byte _0811CA02 + .4byte _0811CA14 + .4byte _0811CA34 + .4byte _0811CA4C +_0811C9D8: + bl sub_811D2C8 + b _0811CA24 +_0811C9DE: + bl sub_811E380 + bl sub_811E6B0 + bl sub_811E7F8 + bl sub_811D9B4 + b _0811CA24 +_0811C9F0: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + movs r0, 0x3 + bl sub_811D9CC + b _0811CA24 +_0811CA02: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + movs r0, 0x3 + bl sub_811D104 + b _0811CA24 +_0811CA14: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + movs r0, 0 + bl gpu_sync_bg_show +_0811CA24: + ldr r0, _0811CA30 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CA54 + .align 2, 0 +_0811CA30: .4byte 0x0203a11c +_0811CA34: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + bl sub_811DFB0 + ldr r0, _0811CA50 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CA4C: + movs r0, 0 + b _0811CA56 + .align 2, 0 +_0811CA50: .4byte 0x0203a11c +_0811CA54: + movs r0, 0x1 +_0811CA56: + pop {r1} + bx r1 + thumb_func_end sub_811C99C + + thumb_func_start sub_811CA5C +sub_811CA5C: @ 811CA5C + push {lr} + ldr r0, _0811CA74 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811CB10 + lsls r0, 2 + ldr r1, _0811CA78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811CA74: .4byte 0x0203a11c +_0811CA78: .4byte _0811CA7C + .align 2, 0 +_0811CA7C: + .4byte _0811CA90 + .4byte _0811CAA2 + .4byte _0811CAB4 + .4byte _0811CAC4 + .4byte _0811CAE4 +_0811CA90: + bl sub_811E380 + bl sub_811E6B0 + bl sub_811E7F8 + bl sub_811D9B4 + b _0811CAD2 +_0811CAA2: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + movs r0, 0x4 + bl sub_811D9CC + b _0811CAD2 +_0811CAB4: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + bl sub_811D6D4 + b _0811CAD2 +_0811CAC4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + bl sub_811E3AC +_0811CAD2: + ldr r0, _0811CAE0 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CB10 + .align 2, 0 +_0811CAE0: .4byte 0x0203a11c +_0811CAE4: + bl sub_811E418 + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + bl sub_811DFC8 + movs r0, 0 + bl sub_811E6E0 + bl sub_811E64C + ldr r0, _0811CB0C + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + b _0811CB12 + .align 2, 0 +_0811CB0C: .4byte 0x0203a11c +_0811CB10: + movs r0, 0x1 +_0811CB12: + pop {r1} + bx r1 + thumb_func_end sub_811CA5C + + thumb_func_start sub_811CB18 +sub_811CB18: @ 811CB18 + push {lr} + bl sub_811E30C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_811CB18 + + thumb_func_start sub_811CB24 +sub_811CB24: @ 811CB24 + push {r4,lr} + ldr r4, _0811CB3C + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CB50 + cmp r0, 0x1 + bgt _0811CB40 + cmp r0, 0 + beq _0811CB4A + b _0811CB8E + .align 2, 0 +_0811CB3C: .4byte 0x0203a11c +_0811CB40: + cmp r0, 0x2 + beq _0811CB6C + cmp r0, 0x3 + beq _0811CB8A + b _0811CB8E +_0811CB4A: + bl sub_811D7A4 + b _0811CB62 +_0811CB50: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CB8E + movs r0, 0x1 + movs r1, 0x4 + bl sub_811DDAC +_0811CB62: + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CB8E +_0811CB6C: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CB8E + bl sub_811E30C + bl sub_811E64C + bl sub_811E794 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CB8A: + movs r0, 0 + b _0811CB90 +_0811CB8E: + movs r0, 0x1 +_0811CB90: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CB24 + + thumb_func_start sub_811CB98 +sub_811CB98: @ 811CB98 + push {r4,lr} + ldr r4, _0811CBB0 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CBC4 + cmp r0, 0x1 + bgt _0811CBB4 + cmp r0, 0 + beq _0811CBBE + b _0811CC00 + .align 2, 0 +_0811CBB0: .4byte 0x0203a11c +_0811CBB4: + cmp r0, 0x2 + beq _0811CBE2 + cmp r0, 0x3 + beq _0811CBFC + b _0811CC00 +_0811CBBE: + bl sub_811D7C8 + b _0811CBD8 +_0811CBC4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CC00 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x4 + bl sub_811DDAC +_0811CBD8: + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CC00 +_0811CBE2: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CC00 + bl sub_811E64C + bl sub_811E794 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CBFC: + movs r0, 0 + b _0811CC02 +_0811CC00: + movs r0, 0x1 +_0811CC02: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CB98 + + thumb_func_start sub_811CC08 +sub_811CC08: @ 811CC08 + push {r4,r5,lr} + ldr r5, _0811CC20 + ldr r0, [r5] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CC34 + cmp r0, 0x1 + bgt _0811CC24 + cmp r0, 0 + beq _0811CC2E + b _0811CC86 + .align 2, 0 +_0811CC20: .4byte 0x0203a11c +_0811CC24: + cmp r0, 0x2 + beq _0811CC64 + cmp r0, 0x3 + beq _0811CC82 + b _0811CC86 +_0811CC2E: + bl sub_811D7EC + b _0811CC5A +_0811CC34: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CC86 + bl sub_811BBDC + adds r4, r0, 0 + bl sub_811DE48 + lsls r4, 24 + lsrs r4, 24 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_811DDAC +_0811CC5A: + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CC86 +_0811CC64: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CC86 + bl sub_811E30C + bl sub_811E64C + bl sub_811E794 + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CC82: + movs r0, 0 + b _0811CC88 +_0811CC86: + movs r0, 0x1 +_0811CC88: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811CC08 + + thumb_func_start sub_811CC90 +sub_811CC90: @ 811CC90 + push {r4,r5,lr} + ldr r5, _0811CCA8 + ldr r0, [r5] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CCBC + cmp r0, 0x1 + bgt _0811CCAC + cmp r0, 0 + beq _0811CCB6 + b _0811CD0A + .align 2, 0 +_0811CCA8: .4byte 0x0203a11c +_0811CCAC: + cmp r0, 0x2 + beq _0811CCEC + cmp r0, 0x3 + beq _0811CD06 + b _0811CD0A +_0811CCB6: + bl sub_811D830 + b _0811CCE2 +_0811CCBC: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0811CD0A + bl sub_811BBDC + adds r4, r0, 0 + bl sub_811DE48 + lsls r4, 24 + lsrs r4, 24 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_811DDAC +_0811CCE2: + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CD0A +_0811CCEC: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CD0A + bl sub_811E64C + bl sub_811E794 + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CD06: + movs r0, 0 + b _0811CD0C +_0811CD0A: + movs r0, 0x1 +_0811CD0C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811CC90 + + thumb_func_start sub_811CD14 +sub_811CD14: @ 811CD14 + push {r4,lr} + ldr r4, _0811CD28 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CD2C + cmp r0, 0x1 + beq _0811CD40 + b _0811CD4A + .align 2, 0 +_0811CD28: .4byte 0x0203a11c +_0811CD2C: + bl sub_811DF90 + movs r0, 0x4 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CD4A +_0811CD40: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811CD4C +_0811CD4A: + movs r0, 0x1 +_0811CD4C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CD14 + + thumb_func_start sub_811CD54 +sub_811CD54: @ 811CD54 + push {r4,lr} + ldr r4, _0811CD68 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CD6C + cmp r0, 0x1 + beq _0811CD80 + b _0811CD8A + .align 2, 0 +_0811CD68: .4byte 0x0203a11c +_0811CD6C: + bl sub_811DF90 + movs r0, 0x5 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CD8A +_0811CD80: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811CD8C +_0811CD8A: + movs r0, 0x1 +_0811CD8C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CD54 + + thumb_func_start sub_811CD94 +sub_811CD94: @ 811CD94 + push {r4,lr} + ldr r4, _0811CDA8 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CDAC + cmp r0, 0x1 + beq _0811CDC0 + b _0811CDCA + .align 2, 0 +_0811CDA8: .4byte 0x0203a11c +_0811CDAC: + bl sub_811DF90 + movs r0, 0x6 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CDCA +_0811CDC0: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811CDCC +_0811CDCA: + movs r0, 0x1 +_0811CDCC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CD94 + + thumb_func_start sub_811CDD4 +sub_811CDD4: @ 811CDD4 + push {r4,lr} + ldr r4, _0811CDE8 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CDEC + cmp r0, 0x1 + beq _0811CE00 + b _0811CE0A + .align 2, 0 +_0811CDE8: .4byte 0x0203a11c +_0811CDEC: + bl sub_811DF90 + movs r0, 0x7 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CE0A +_0811CE00: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811CE0C +_0811CE0A: + movs r0, 0x1 +_0811CE0C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CDD4 + + thumb_func_start sub_811CE14 +sub_811CE14: @ 811CE14 + push {r4,lr} + ldr r4, _0811CE28 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CE2C + cmp r0, 0x1 + beq _0811CE40 + b _0811CE4A + .align 2, 0 +_0811CE28: .4byte 0x0203a11c +_0811CE2C: + bl sub_811DF90 + movs r0, 0x8 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CE4A +_0811CE40: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811CE4C +_0811CE4A: + movs r0, 0x1 +_0811CE4C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CE14 + + thumb_func_start sub_811CE54 +sub_811CE54: @ 811CE54 + push {r4,lr} + ldr r4, _0811CE68 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CE6C + cmp r0, 0x1 + beq _0811CE80 + b _0811CE8A + .align 2, 0 +_0811CE68: .4byte 0x0203a11c +_0811CE6C: + bl sub_811DF90 + movs r0, 0x9 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CE8A +_0811CE80: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + b _0811CE8C +_0811CE8A: + movs r0, 0x1 +_0811CE8C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CE54 + + thumb_func_start sub_811CE94 +sub_811CE94: @ 811CE94 + push {r4,lr} + ldr r4, _0811CEF8 + movs r0, 0x98 + lsls r0, 5 + bl malloc + adds r2, r0, 0 + str r2, [r4] + cmp r2, 0 + beq _0811CEFC + movs r1, 0 + strh r1, [r2] + movs r3, 0xB6 + lsls r3, 2 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + bl sub_811BC70 + ldr r1, [r4] + strb r0, [r1, 0xA] + movs r0, 0x1 + b _0811CEFE + .align 2, 0 +_0811CEF8: .4byte 0x0203a11c +_0811CEFC: + movs r0, 0 +_0811CEFE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CE94 + + thumb_func_start sub_811CF04 +sub_811CF04: @ 811CF04 + push {lr} + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end sub_811CF04 + + thumb_func_start sub_811CF64 +sub_811CF64: @ 811CF64 + push {r4,lr} + bl sub_80A1A74 + ldr r0, _0811CFB8 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0811CFBC + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0811CFC0 + movs r1, 0x40 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0811CFC4 + movs r1, 0xA0 + movs r2, 0x8 + bl gpu_pal_apply + ldr r4, _0811CFC8 + adds r0, r4, 0 + movs r1, 0xB0 + movs r2, 0xC + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xC + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0x30 + movs r2, 0xC + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811CFB8: .4byte 0x08dcbdb0 +_0811CFBC: .4byte 0x08597b14 +_0811CFC0: .4byte 0x08597b34 +_0811CFC4: .4byte 0x08597c1c +_0811CFC8: .4byte 0x08597c24 + thumb_func_end sub_811CF64 + + thumb_func_start sub_811CFCC +sub_811CFCC: @ 811CFCC + push {r4,r5,lr} + sub sp, 0x14 + bl sub_811BA88 + adds r5, r0, 0 + cmp r5, 0 + beq _0811D020 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x90 + bl sub_81DB35C + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + movs r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_811D058 + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0811D020: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811CFCC + + thumb_func_start sub_811D028 +sub_811D028: @ 811D028 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + ldr r6, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_811D028 + + thumb_func_start sub_811D058 +sub_811D058: @ 811D058 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r3 + ldr r3, [sp, 0x30] + ldr r4, [sp, 0x34] + mov r8, r4 + ldr r7, [sp, 0x38] + mov r10, r7 + ldr r5, [sp, 0x3C] + ldr r6, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r4, r9 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + add r4, sp, 0xC + mov r7, r10 + strb r7, [r4] + strb r5, [r4, 0x1] + strb r6, [r4, 0x2] + str r4, [sp] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0x4] + str r2, [sp, 0x8] + mov r2, r9 + bl box_print + 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_811D058 + + thumb_func_start sub_811D0BC +sub_811D0BC: @ 811D0BC + push {lr} + sub sp, 0xC + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl sub_811D104 + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_811D0BC + + thumb_func_start sub_811D104 +sub_811D104: @ 811D104 + push {lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + str r0, [sp, 0x10] + str r0, [sp, 0xC] + cmp r1, 0x9 + bhi _0811D1BC + lsls r0, r1, 2 + ldr r1, _0811D120 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811D120: .4byte _0811D124 + .align 2, 0 +_0811D124: + .4byte _0811D14C + .4byte _0811D16A + .4byte _0811D156 + .4byte _0811D160 + .4byte _0811D174 + .4byte _0811D180 + .4byte _0811D18C + .4byte _0811D19C + .4byte _0811D1A8 + .4byte _0811D1B4 +_0811D14C: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BAD0 + b _0811D1BC +_0811D156: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BB40 + b _0811D1BC +_0811D160: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BB08 + b _0811D1BC +_0811D16A: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BB88 + b _0811D1BC +_0811D174: + ldr r0, _0811D17C + str r0, [sp, 0xC] + b _0811D1BC + .align 2, 0 +_0811D17C: .4byte 0x085ec743 +_0811D180: + ldr r0, _0811D188 + str r0, [sp, 0xC] + b _0811D1BC + .align 2, 0 +_0811D188: .4byte 0x085ec752 +_0811D18C: + ldr r0, _0811D194 + str r0, [sp, 0xC] + ldr r0, _0811D198 + b _0811D1BA + .align 2, 0 +_0811D194: .4byte 0x085ec4c9 +_0811D198: .4byte 0x085ec4e9 +_0811D19C: + ldr r0, _0811D1A4 + str r0, [sp, 0xC] + b _0811D1BC + .align 2, 0 +_0811D1A4: .4byte 0x085ec765 +_0811D1A8: + ldr r0, _0811D1B0 + str r0, [sp, 0xC] + b _0811D1BC + .align 2, 0 +_0811D1B0: .4byte 0x085ec520 +_0811D1B4: + ldr r0, _0811D20C + str r0, [sp, 0xC] + ldr r0, _0811D210 +_0811D1BA: + str r0, [sp, 0x10] +_0811D1BC: + movs r0, 0x1 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, [sp, 0xC] + cmp r2, 0 + beq _0811D1E0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl sub_811D028 +_0811D1E0: + ldr r2, [sp, 0x10] + cmp r2, 0 + beq _0811D1FC + movs r0, 0x11 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl sub_811D028 +_0811D1FC: + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x14 + pop {r0} + bx r0 + .align 2, 0 +_0811D20C: .4byte 0x085ec672 +_0811D210: .4byte 0x085ec688 + thumb_func_end sub_811D104 + + thumb_func_start sub_811D214 +sub_811D214: @ 811D214 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _0811D22C + movs r1, 0x1 + movs r2, 0xE + bl sub_81996C0 + pop {r0} + bx r0 + .align 2, 0 +_0811D22C: .4byte 0x08597c84 + thumb_func_end sub_811D214 + + thumb_func_start sub_811D230 +sub_811D230: @ 811D230 + push {r4-r6,lr} + sub sp, 0x8 + bl sub_811BA68 + lsls r0, 24 + ldr r6, _0811D2AC + ldr r4, [sp] + ands r4, r6 + movs r1, 0x3 + orrs r4, r1 + str r4, [sp] + ldr r1, _0811D2B0 + lsrs r0, 22 + adds r0, r1 + ldrb r3, [r0] + lsls r1, r3, 27 + lsrs r1, 19 + ldr r5, _0811D2B4 + adds r2, r5, 0 + ands r2, r4 + orrs r2, r1 + lsrs r3, 5 + lsls r3, 16 + ldr r1, _0811D2B8 + ands r2, r1 + orrs r2, r3 + str r2, [sp] + ldrb r3, [r0, 0x1] + lsls r3, 24 + ldr r1, _0811D2BC + ands r1, r2 + orrs r1, r3 + str r1, [sp] + ldrb r1, [r0, 0x2] + ldr r0, [sp, 0x4] + ands r0, r6 + orrs r0, r1 + ands r0, r5 + movs r1, 0xB0 + lsls r1, 4 + orrs r0, r1 + ldr r1, _0811D2C0 + ands r0, r1 + movs r1, 0xD8 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl Window_AddFromTemplate + ldr r1, _0811D2C4 + ldr r1, [r1] + strh r0, [r1, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811D2AC: .4byte 0xffffff00 +_0811D2B0: .4byte 0x08597c30 +_0811D2B4: .4byte 0xffff00ff +_0811D2B8: .4byte 0xff00ffff +_0811D2BC: .4byte 0x00ffffff +_0811D2C0: .4byte 0x0000ffff +_0811D2C4: .4byte 0x0203a11c + thumb_func_end sub_811D230 + + thumb_func_start sub_811D2C8 +sub_811D2C8: @ 811D2C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + bl sub_811BA94 + adds r4, r0, 0 + bl sub_811BAAC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + bl sub_811BAA0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + bl sub_811BA68 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + mov r8, r0 + cmp r6, 0x7 + bne _0811D302 + movs r1, 0x1 + mov r8, r1 +_0811D302: + ldr r0, _0811D350 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + movs r1, 0x11 + bl Window_FastFillPixels + movs r7, 0 + ldr r0, [sp, 0x14] + cmp r7, r0 + bge _0811D402 +_0811D316: + add r0, sp, 0xC + ldr r1, _0811D354 + movs r2, 0x4 + bl memcpy + mov r1, r8 + cmp r1, 0 + beq _0811D32C + add r1, sp, 0xC + movs r0, 0x6 + strb r0, [r1, 0x2] +_0811D32C: + ldr r0, _0811D350 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0xB + movs r0, 0xFF + strb r0, [r1, 0xB] + adds r0, r2, 0 + add r1, sp, 0xC + bl gf_strcat + adds r2, r0, 0 + movs r5, 0 + lsls r0, r7, 4 + mov r9, r0 + adds r1, r7, 0x1 + mov r10, r1 + b _0811D3CE + .align 2, 0 +_0811D350: .4byte 0x0203a11c +_0811D354: .4byte 0x08597c8c +_0811D358: + ldrh r0, [r4] + ldr r1, _0811D370 + cmp r0, r1 + beq _0811D374 + adds r1, r0, 0 + adds r0, r2, 0 + bl sub_811EBBC + adds r2, r0, 0 + adds r4, 0x2 + b _0811D3A2 + .align 2, 0 +_0811D370: .4byte 0x0000ffff +_0811D374: + adds r4, 0x2 + mov r0, r8 + cmp r0, 0 + bne _0811D3A8 + adds r0, r2, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_80091EC + adds r2, r0, 0 + movs r1, 0xAE + movs r0, 0xB +_0811D38C: + strb r1, [r2] + adds r2, 0x1 + subs r0, 0x1 + cmp r0, 0 + bge _0811D38C + adds r0, r2, 0 + movs r1, 0 + movs r2, 0x2 + bl sub_80091EC + adds r2, r0, 0 +_0811D3A2: + mov r1, r8 + cmp r1, 0 + beq _0811D3AE +_0811D3A8: + add r1, sp, 0xC + movs r0, 0x3 + strb r0, [r1, 0x2] +_0811D3AE: + adds r0, r2, 0 + add r1, sp, 0xC + bl gf_strcat + adds r2, r0, 0 + cmp r6, 0x2 + beq _0811D3C4 + cmp r6, 0x7 + beq _0811D3C4 + cmp r6, 0x8 + bne _0811D3CC +_0811D3C4: + cmp r5, 0 + bne _0811D3CC + cmp r7, 0x4 + beq _0811D3D4 +_0811D3CC: + adds r5, 0x1 +_0811D3CE: + ldr r0, [sp, 0x10] + cmp r5, r0 + blt _0811D358 +_0811D3D4: + movs r0, 0xFF + strb r0, [r2] + ldr r0, _0811D420 + ldr r2, [r0] + ldrb r0, [r2, 0x2] + adds r2, 0xB + mov r1, r9 + adds r1, 0x1 + 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 + movs r3, 0 + bl sub_811D028 + mov r7, r10 + ldr r1, [sp, 0x14] + cmp r7, r1 + blt _0811D316 +_0811D402: + ldr r0, _0811D420 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811D420: .4byte 0x0203a11c + thumb_func_end sub_811D2C8 + + thumb_func_start sub_811D424 +sub_811D424: @ 811D424 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + bl sub_811BA68 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + str r0, [sp] + ldr r2, _0811D4C4 + mov r0, sp + mov r1, r8 + bl CpuFastSet + cmp r6, 0x2 + beq _0811D450 + cmp r6, 0x8 + bne _0811D4D4 +_0811D450: + ldr r0, _0811D4C8 + lsls r2, r6, 2 + adds r2, r0 + ldrb r1, [r2] + lsls r3, r1, 27 + lsrs r0, r3, 27 + ldrb r4, [r2, 0x1] + adds r5, r0, r4 + lsls r1, 24 + lsrs r0, r1, 29 + ldrb r2, [r2, 0x2] + adds r2, r0 + mov r12, r2 + adds r6, r0, 0 + cmp r6, r12 + blt _0811D472 + b _0811D5D6 +_0811D472: + mov r9, r3 +_0811D474: + mov r0, r9 + lsrs r3, r0, 27 + subs r7, r3, 0x1 + lsls r2, r6, 5 + adds r0, r2, r7 + lsls r0, 1 + add r0, r8 + ldr r4, _0811D4CC + adds r1, r4, 0 + strh r1, [r0] + adds r7, r3, 0 + adds r3, r2, 0 + adds r4, r6, 0x1 + cmp r7, r5 + bge _0811D4AE + movs r0, 0x80 + lsls r0, 5 + adds r2, r0, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r0, r1, r0 + subs r7, r5, r7 +_0811D4A2: + strh r2, [r0] + adds r0, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D4A2 + adds r7, r5, 0 +_0811D4AE: + adds r0, r3, r7 + lsls r0, 1 + add r0, r8 + ldr r2, _0811D4D0 + adds r1, r2, 0 + strh r1, [r0] + adds r6, r4, 0 + cmp r6, r12 + blt _0811D474 + b _0811D5D6 + .align 2, 0 +_0811D4C4: .4byte 0x01000200 +_0811D4C8: .4byte 0x08597c30 +_0811D4CC: .4byte 0x00001005 +_0811D4D0: .4byte 0x00001007 +_0811D4D4: + ldr r4, _0811D5E8 + mov r10, r4 + lsls r6, 2 + mov r9, r6 + mov r3, r9 + add r3, r10 + ldrb r0, [r3] + lsls r2, r0, 24 + lsrs r1, r2, 29 + subs r6, r1, 0x1 + lsls r0, 27 + lsrs r4, r0, 27 + subs r7, r4, 0x1 + adds r0, r4, 0 + ldrb r1, [r3, 0x1] + adds r5, r0, r1 + lsrs r2, 29 + ldrb r3, [r3, 0x2] + adds r3, r2 + mov r12, r3 + lsls r0, r6, 5 + adds r0, r7 + lsls r0, 1 + add r0, r8 + ldr r2, _0811D5EC + adds r1, r2, 0 + strh r1, [r0] + adds r7, r4, 0 + cmp r7, r5 + bge _0811D52A + ldr r4, _0811D5F0 + adds r2, r4, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r1, r0 + subs r7, r5, r7 +_0811D51E: + strh r2, [r1] + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D51E + adds r7, r5, 0 +_0811D52A: + lsls r0, r6, 5 + adds r0, r7 + lsls r0, 1 + add r0, r8 + ldr r2, _0811D5F4 + adds r1, r2, 0 + strh r1, [r0] + adds r6, 0x1 + cmp r6, r12 + bge _0811D590 + ldr r0, _0811D5E8 + add r0, r9 + ldrb r0, [r0] + lsls r3, r0, 27 +_0811D546: + lsrs r0, r3, 27 + subs r7, r0, 0x1 + lsls r1, r6, 5 + adds r1, r7 + lsls r1, 1 + add r1, r8 + ldr r4, _0811D5F8 + adds r2, r4, 0 + strh r2, [r1] + adds r7, r0, 0 + adds r4, r6, 0x1 + cmp r7, r5 + bge _0811D57C + movs r0, 0x80 + lsls r0, 5 + adds r2, r0, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r1, r0 + subs r7, r5, r7 +_0811D570: + strh r2, [r1] + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D570 + adds r7, r5, 0 +_0811D57C: + lsls r0, r6, 5 + adds r0, r7 + lsls r0, 1 + add r0, r8 + ldr r2, _0811D5FC + adds r1, r2, 0 + strh r1, [r0] + adds r6, r4, 0 + cmp r6, r12 + blt _0811D546 +_0811D590: + mov r0, r9 + add r0, r10 + ldrb r2, [r0] + lsls r2, 27 + lsrs r2, 27 + subs r7, r2, 0x1 + lsls r3, r6, 5 + adds r0, r3, r7 + lsls r0, 1 + add r0, r8 + ldr r4, _0811D600 + adds r1, r4, 0 + strh r1, [r0] + adds r7, r2, 0 + cmp r7, r5 + bge _0811D5CA + ldr r0, _0811D604 + adds r2, r0, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r0, r1, r0 + subs r7, r5, r7 +_0811D5BE: + strh r2, [r0] + adds r0, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D5BE + adds r7, r5, 0 +_0811D5CA: + adds r0, r3, r7 + lsls r0, 1 + add r0, r8 + ldr r2, _0811D608 + adds r1, r2, 0 + strh r1, [r0] +_0811D5D6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811D5E8: .4byte 0x08597c30 +_0811D5EC: .4byte 0x00001001 +_0811D5F0: .4byte 0x00001002 +_0811D5F4: .4byte 0x00001003 +_0811D5F8: .4byte 0x00001005 +_0811D5FC: .4byte 0x00001007 +_0811D600: .4byte 0x00001009 +_0811D604: .4byte 0x0000100a +_0811D608: .4byte 0x0000100b + thumb_func_end sub_811D424 + + thumb_func_start sub_811D60C +sub_811D60C: @ 811D60C + push {r4,lr} + sub sp, 0x8 + movs r0, 0x3 + bl bg_get_tilemap + adds r4, r0, 0 + bl sub_811BA68 + lsls r0, 24 + ldr r1, _0811D634 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x3] + cmp r1, 0x2 + beq _0811D63E + cmp r1, 0x2 + bgt _0811D638 + cmp r1, 0x1 + beq _0811D64C + b _0811D67C + .align 2, 0 +_0811D634: .4byte 0x08597c30 +_0811D638: + cmp r1, 0x3 + beq _0811D668 + b _0811D67C +_0811D63E: + movs r0, 0xA8 + lsls r0, 3 + adds r4, r0 + movs r0, 0x20 + str r0, [sp] + str r1, [sp, 0x4] + b _0811D65A +_0811D64C: + movs r0, 0xC0 + lsls r0, 3 + adds r4, r0 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] +_0811D65A: + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0xB + bl gpu_copy_to_iwram_tile_map_rect + b _0811D67C +_0811D668: + movs r0, 0x20 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0xA + bl gpu_copy_to_iwram_tile_map_rect +_0811D67C: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D60C + + thumb_func_start sub_811D684 +sub_811D684: @ 811D684 + push {lr} + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_811D684 + + thumb_func_start sub_811D698 +sub_811D698: @ 811D698 + push {r4,lr} + adds r4, r0, 0 + bl sub_811DD84 + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + cmp r4, 0x1 + beq _0811D6BC + cmp r4, 0x1 + bcc _0811D6B6 + cmp r4, 0x2 + beq _0811D6C2 + b _0811D6C6 +_0811D6B6: + bl sub_811D6F4 + b _0811D6C6 +_0811D6BC: + bl sub_811D758 + b _0811D6C6 +_0811D6C2: + bl sub_811D794 +_0811D6C6: + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D698 + + thumb_func_start sub_811D6D4 +sub_811D6D4: @ 811D6D4 + push {lr} + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811D6E8 + movs r0, 0 + bl sub_811D698 + b _0811D6EE +_0811D6E8: + movs r0, 0x1 + bl sub_811D698 +_0811D6EE: + pop {r0} + bx r0 + thumb_func_end sub_811D6D4 + + thumb_func_start sub_811D6F4 +sub_811D6F4: @ 811D6F4 + push {r4-r7,lr} + sub sp, 0xC + movs r5, 0 + movs r7, 0x61 +_0811D6FC: + movs r4, 0 + lsls r0, r7, 24 + lsrs r6, r0, 24 +_0811D702: + lsls r0, r5, 24 + lsrs r0, 24 + adds r5, 0x1 + bl sub_811F3B8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + beq _0811D742 + bl sub_811F424 + adds r2, r0, 0 + movs r0, 0x54 + adds r3, r4, 0 + muls r3, r0 + adds r3, 0xA + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + bl sub_811D028 + adds r4, 0x1 + cmp r4, 0x1 + ble _0811D702 + adds r7, 0x10 + b _0811D6FC +_0811D742: + bl sub_811BBBC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_811DDAC + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_811D6F4 + + thumb_func_start sub_811D758 +sub_811D758: @ 811D758 + push {r4-r6,lr} + sub sp, 0xC + movs r5, 0 + movs r4, 0xC2 + lsls r4, 23 + ldr r6, _0811D790 +_0811D764: + ldm r6!, {r2} + lsrs r0, r4, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0xA + bl sub_811D028 + movs r0, 0x80 + lsls r0, 21 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0x3 + bls _0811D764 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811D790: .4byte 0x08597c90 + thumb_func_end sub_811D758 + + thumb_func_start sub_811D794 +sub_811D794: @ 811D794 + push {lr} + movs r0, 0 + movs r1, 0x4 + bl sub_811D864 + pop {r0} + bx r0 + thumb_func_end sub_811D794 + + thumb_func_start sub_811D7A4 +sub_811D7A4: @ 811D7A4 + push {r4,lr} + bl sub_811BBDC + adds r4, r0, 0 + adds r4, 0x3 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D950 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D864 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D7A4 + + thumb_func_start sub_811D7C8 +sub_811D7C8: @ 811D7C8 + push {r4,lr} + bl sub_811BBDC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D950 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D864 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D7C8 + + thumb_func_start sub_811D7EC +sub_811D7EC: @ 811D7EC + push {r4,r5,lr} + bl sub_811BBDC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + adds r0, r5, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_811BBE8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bls _0811D80E + adds r4, r0, 0 +_0811D80E: + cmp r5, r4 + bcs _0811D828 + subs r4, r5 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D950 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D864 +_0811D828: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811D7EC + + thumb_func_start sub_811D830 +sub_811D830: @ 811D830 + push {r4,r5,lr} + bl sub_811BBDC + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_811DE48 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _0811D85C + subs r4, r0, r5 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D950 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D864 +_0811D85C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811D830 + + thumb_func_start sub_811D864 +sub_811D864: @ 811D864 + 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 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r1, r0, 1 + mov r8, r1 + lsls r0, 4 + adds r1, r0, 0 + adds r1, 0x60 + movs r0, 0xFF + ands r1, r0 + adds r1, 0x1 + movs r0, 0 + b _0811D930 +_0811D88E: + movs r6, 0 + movs r2, 0x10 + adds r2, r1 + mov r9, r2 + adds r0, 0x1 + mov r10, r0 + lsls r0, r1, 24 + lsrs r7, r0, 24 +_0811D89E: + mov r1, r8 + lsls r0, r1, 16 + lsrs r0, 16 + movs r2, 0x1 + add r8, r2 + bl sub_811F578 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0811D8F4 + cmp r4, r0 + beq _0811D926 + ldr r5, _0811D8F8 + ldr r0, [r5] + adds r0, 0xCC + adds r1, r4, 0 + movs r2, 0 + bl sub_811F434 + adds r0, r4, 0 + bl sub_811BF88 + adds r1, r0, 0 + cmp r1, 0 + bne _0811D8FC + ldr r2, [r5] + adds r2, 0xCC + movs r0, 0xD + adds r3, r6, 0 + muls r3, r0 + adds r3, 0x3 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + bl sub_811D028 + b _0811D926 + .align 2, 0 +_0811D8F4: .4byte 0x0000ffff +_0811D8F8: .4byte 0x0203a11c +_0811D8FC: + ldr r2, [r5] + adds r2, 0xCC + movs r0, 0xD + adds r3, r6, 0 + muls r3, r0 + adds r3, 0x3 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x5 + str r0, [sp, 0xC] + movs r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0x2 + movs r1, 0x1 + bl sub_811D058 +_0811D926: + adds r6, 0x1 + cmp r6, 0x1 + ble _0811D89E + mov r1, r9 + mov r0, r10 +_0811D930: + ldr r2, [sp, 0x14] + cmp r0, r2 + blt _0811D88E + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + 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_811D864 + + thumb_func_start sub_811D950 +sub_811D950: @ 811D950 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsls r1, 24 + lsrs r0, 20 + adds r3, r0, 0 + adds r3, 0x60 + movs r0, 0xFF + ands r3, r0 + lsrs r0, r1, 20 + adds r1, r3, r0 + cmp r1, 0xFF + ble _0811D97C + ldr r0, _0811D978 + adds r4, r1, r0 + movs r0, 0x80 + lsls r0, 1 + subs r0, r3 + b _0811D97E + .align 2, 0 +_0811D978: .4byte 0xffffff00 +_0811D97C: + movs r4, 0 +_0811D97E: + movs r5, 0xE0 + str r5, [sp] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0 + bl Window_FillPixelRect + cmp r4, 0 + beq _0811D9AA + str r5, [sp] + lsls r0, r4, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0 + movs r3, 0 + bl Window_FillPixelRect +_0811D9AA: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811D950 + + thumb_func_start sub_811D9B4 +sub_811D9B4: @ 811D9B4 + push {lr} + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_811D9B4 + + thumb_func_start sub_811D9CC +sub_811D9CC: @ 811D9CC + push {lr} + ldr r1, _0811D9E0 + cmp r0, 0x6 + bhi _0811DA86 + lsls r0, 2 + ldr r1, _0811D9E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811D9E0: .4byte 0x0203a11c +_0811D9E4: .4byte _0811D9E8 + .align 2, 0 +_0811D9E8: + .4byte _0811DA04 + .4byte _0811DA18 + .4byte _0811DA28 + .4byte _0811DA3C + .4byte _0811DA50 + .4byte _0811DA64 + .4byte _0811DA78 +_0811DA04: + ldr r1, _0811DA14 + ldr r2, [r1] + movs r0, 0 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0xA + b _0811DA84 + .align 2, 0 +_0811DA14: .4byte 0x0203a11c +_0811DA18: + ldr r1, _0811DA24 + ldr r2, [r1] + movs r3, 0 + movs r0, 0x9 + b _0811DA44 + .align 2, 0 +_0811DA24: .4byte 0x0203a11c +_0811DA28: + ldr r1, _0811DA38 + ldr r2, [r1] + movs r0, 0xB + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0x11 + b _0811DA84 + .align 2, 0 +_0811DA38: .4byte 0x0203a11c +_0811DA3C: + ldr r1, _0811DA4C + ldr r2, [r1] + movs r3, 0 + movs r0, 0x11 +_0811DA44: + strb r0, [r2, 0x6] + ldr r0, [r1] + strb r3, [r0, 0x7] + b _0811DA86 + .align 2, 0 +_0811DA4C: .4byte 0x0203a11c +_0811DA50: + ldr r1, _0811DA60 + ldr r2, [r1] + movs r0, 0x11 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0xA + b _0811DA84 + .align 2, 0 +_0811DA60: .4byte 0x0203a11c +_0811DA64: + ldr r1, _0811DA74 + ldr r2, [r1] + movs r0, 0x12 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0x16 + b _0811DA84 + .align 2, 0 +_0811DA74: .4byte 0x0203a11c +_0811DA78: + ldr r1, _0811DAA0 + ldr r2, [r1] + movs r0, 0x16 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0x12 +_0811DA84: + strb r0, [r2, 0x7] +_0811DA86: + ldr r1, [r1] + ldrb r0, [r1, 0x6] + movs r3, 0x1 + negs r3, r3 + adds r2, r3, 0 + ldrb r3, [r1, 0x7] + cmp r0, r3 + bcs _0811DA98 + movs r2, 0x1 +_0811DA98: + strb r2, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_0811DAA0: .4byte 0x0203a11c + thumb_func_end sub_811D9CC + + thumb_func_start sub_811DAA4 +sub_811DAA4: @ 811DAA4 + push {r4,lr} + ldr r4, _0811DAD0 + ldr r1, [r4] + ldrb r2, [r1, 0x6] + ldrb r0, [r1, 0x7] + cmp r2, r0 + beq _0811DAD4 + ldrb r0, [r1, 0x8] + adds r0, r2, r0 + strb r0, [r1, 0x6] + ldr r0, [r4] + ldrb r0, [r0, 0x6] + bl sub_811DADC + ldr r0, [r4] + ldrb r1, [r0, 0x6] + ldrb r0, [r0, 0x7] + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0811DAD6 + .align 2, 0 +_0811DAD0: .4byte 0x0203a11c +_0811DAD4: + movs r0, 0 +_0811DAD6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811DAA4 + + thumb_func_start sub_811DADC +sub_811DADC: @ 811DADC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1E + str r0, [sp] + movs r0, 0xA + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl bg_fill_tilemap_rect + cmp r4, 0x16 + bls _0811DAFE + b _0811DC1A +_0811DAFE: + lsls r0, r4, 2 + ldr r1, _0811DB08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811DB08: .4byte _0811DB0C + .align 2, 0 +_0811DB0C: + .4byte _0811DC1A + .4byte _0811DB68 + .4byte _0811DB70 + .4byte _0811DB78 + .4byte _0811DB80 + .4byte _0811DB88 + .4byte _0811DB90 + .4byte _0811DC00 + .4byte _0811DBF2 + .4byte _0811DBE4 + .4byte _0811DBD6 + .4byte _0811DB9E + .4byte _0811DBA6 + .4byte _0811DBAE + .4byte _0811DBB6 + .4byte _0811DBBE + .4byte _0811DBC6 + .4byte _0811DBCE + .4byte _0811DBD6 + .4byte _0811DBE4 + .4byte _0811DBF2 + .4byte _0811DC00 + .4byte _0811DC0E +_0811DB68: + movs r0, 0xB + movs r1, 0xE + movs r2, 0x3 + b _0811DB96 +_0811DB70: + movs r0, 0x9 + movs r1, 0xE + movs r2, 0x7 + b _0811DB96 +_0811DB78: + movs r0, 0x7 + movs r1, 0xE + movs r2, 0xB + b _0811DB96 +_0811DB80: + movs r0, 0x5 + movs r1, 0xE + movs r2, 0xF + b _0811DB96 +_0811DB88: + movs r0, 0x3 + movs r1, 0xE + movs r2, 0x13 + b _0811DB96 +_0811DB90: + movs r0, 0x1 + movs r1, 0xE + movs r2, 0x17 +_0811DB96: + movs r3, 0x2 + bl sub_811DC28 + b _0811DC1A +_0811DB9E: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x18 + b _0811DBDC +_0811DBA6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x19 + b _0811DBDC +_0811DBAE: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1A + b _0811DBDC +_0811DBB6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1B + b _0811DBDC +_0811DBBE: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1C + b _0811DBDC +_0811DBC6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1D + b _0811DBDC +_0811DBCE: + movs r0, 0 + movs r1, 0xA + movs r2, 0x1E + b _0811DBDC +_0811DBD6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x17 +_0811DBDC: + movs r3, 0xA + bl sub_811DC28 + b _0811DC1A +_0811DBE4: + movs r0, 0x1 + movs r1, 0xB + movs r2, 0x17 + movs r3, 0x8 + bl sub_811DC28 + b _0811DC1A +_0811DBF2: + movs r0, 0x1 + movs r1, 0xC + movs r2, 0x17 + movs r3, 0x6 + bl sub_811DC28 + b _0811DC1A +_0811DC00: + movs r0, 0x1 + movs r1, 0xD + movs r2, 0x17 + movs r3, 0x4 + bl sub_811DC28 + b _0811DC1A +_0811DC0E: + movs r0, 0x1 + movs r1, 0xE + movs r2, 0x17 + movs r3, 0x2 + bl sub_811DC28 +_0811DC1A: + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811DADC + + thumb_func_start sub_811DC28 +sub_811DC28: @ 811DC28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r0 + adds r7, r1, 0 + mov r9, r2 + mov r10, r3 + ldr r0, _0811DD60 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + adds r6, r0, r1 + mov r0, r12 + add r0, r9 + subs r5, r0, 0x1 + adds r0, r7, r3 + subs r0, 0x1 + mov r8, r0 + mov r2, r12 + adds r3, r7, 0 + lsls r0, r3, 5 + adds r0, r2 + lsls r0, 1 + adds r0, r6 + ldr r4, _0811DD64 + adds r1, r4, 0 + strh r1, [r0] + adds r2, 0x1 + cmp r2, r5 + bge _0811DC84 + ldr r0, _0811DD68 + adds r4, r0, 0 + lsls r1, r2, 1 + lsls r0, r3, 6 + adds r0, r6 + adds r1, r0 + subs r2, r5, r2 +_0811DC78: + strh r4, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811DC78 + adds r2, r5, 0 +_0811DC84: + lsls r0, r3, 5 + adds r0, r2 + lsls r0, 1 + adds r0, r6 + ldr r2, _0811DD6C + adds r1, r2, 0 + strh r1, [r0] + adds r3, 0x1 + mov r4, r12 + adds r4, 0x1 + adds r0, r7, 0x1 + str r0, [sp, 0x4] + mov r1, r9 + subs r1, 0x2 + str r1, [sp] + movs r2, 0x2 + negs r2, r2 + add r10, r2 + cmp r3, r8 + bge _0811DCF4 + lsls r7, r4, 1 + mov r9, r7 +_0811DCB0: + lsls r0, r3, 5 + add r0, r12 + lsls r0, 1 + adds r0, r6 + ldr r2, _0811DD70 + adds r1, r2, 0 + strh r1, [r0] + adds r2, r4, 0 + adds r7, r3, 0x1 + cmp r4, r5 + bge _0811DCE0 + movs r0, 0x80 + lsls r0, 7 + adds r1, r0, 0 + lsls r0, r3, 6 + adds r0, r6 + add r0, r9 + subs r2, r5, r4 +_0811DCD4: + strh r1, [r0] + adds r0, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811DCD4 + adds r2, r5, 0 +_0811DCE0: + lsls r0, r3, 5 + adds r0, r2 + lsls r0, 1 + adds r0, r6 + ldr r2, _0811DD74 + adds r1, r2, 0 + strh r1, [r0] + adds r3, r7, 0 + cmp r3, r8 + blt _0811DCB0 +_0811DCF4: + lsls r0, r3, 5 + mov r7, r12 + adds r1, r0, r7 + lsls r1, 1 + adds r1, r6 + ldr r7, _0811DD78 + adds r2, r7, 0 + strh r2, [r1] + adds r2, r4, 0 + mov r12, r0 + cmp r4, r5 + bge _0811DD26 + ldr r0, _0811DD7C + adds r7, r0, 0 + lsls r1, r4, 1 + lsls r0, r3, 6 + adds r0, r6 + adds r0, r1, r0 + subs r2, r5, r4 +_0811DD1A: + strh r7, [r0] + adds r0, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811DD1A + adds r2, r5, 0 +_0811DD26: + mov r1, r12 + adds r0, r1, r2 + lsls r0, 1 + adds r0, r6 + ldr r2, _0811DD80 + adds r1, r2, 0 + strh r1, [r0] + lsls r0, r4, 27 + lsrs r0, 24 + ldr r3, [sp, 0x4] + lsls r1, r3, 27 + lsrs r1, 24 + ldr r4, [sp] + lsls r2, r4, 27 + lsrs r2, 24 + mov r7, r10 + lsls r3, r7, 27 + lsrs r3, 24 + bl sub_811DE5C + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811DD60: .4byte 0x0203a11c +_0811DD64: .4byte 0x00004001 +_0811DD68: .4byte 0x00004002 +_0811DD6C: .4byte 0x00004003 +_0811DD70: .4byte 0x00004005 +_0811DD74: .4byte 0x00004007 +_0811DD78: .4byte 0x00004009 +_0811DD7C: .4byte 0x0000400a +_0811DD80: .4byte 0x0000400b + thumb_func_end sub_811DC28 + + thumb_func_start sub_811DD84 +sub_811DD84: @ 811DD84 + push {lr} + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _0811DDA4 + ldr r0, [r0] + ldr r1, _0811DDA8 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_0811DDA4: .4byte 0x0203a11c +_0811DDA8: .4byte 0x000002ce + thumb_func_end sub_811DD84 + + thumb_func_start sub_811DDAC +sub_811DDAC: @ 811DDAC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x2 + bl bg_get_y_offset + adds r2, r0, 0 + ldr r0, _0811DDF8 + ldr r3, [r0] + ldr r0, _0811DDFC + adds r1, r3, r0 + ldrh r0, [r1] + adds r0, r4 + strh r0, [r1] + lsls r4, 20 + asrs r4, 16 + lsls r0, r4, 8 + adds r2, r0 + cmp r5, 0 + beq _0811DE00 + movs r1, 0xB4 + lsls r1, 2 + adds r0, r3, r1 + str r2, [r0] + movs r0, 0xB5 + lsls r0, 2 + adds r1, r3, r0 + lsls r0, r5, 8 + str r0, [r1] + cmp r4, 0 + bge _0811DE0A + negs r0, r0 + str r0, [r1] + b _0811DE0A + .align 2, 0 +_0811DDF8: .4byte 0x0203a11c +_0811DDFC: .4byte 0x000002ce +_0811DE00: + movs r0, 0x2 + adds r1, r2, 0 + movs r2, 0 + bl bg_change_y_offset +_0811DE0A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811DDAC + + thumb_func_start sub_811DE10 +sub_811DE10: @ 811DE10 + push {lr} + movs r0, 0x2 + bl bg_get_y_offset + ldr r1, _0811DE3C + ldr r2, [r1] + movs r3, 0xB4 + lsls r3, 2 + adds r1, r2, r3 + ldr r1, [r1] + cmp r0, r1 + beq _0811DE40 + movs r1, 0xB5 + lsls r1, 2 + adds r0, r2, r1 + ldr r1, [r0] + movs r0, 0x2 + movs r2, 0x1 + bl bg_change_y_offset + movs r0, 0x1 + b _0811DE42 + .align 2, 0 +_0811DE3C: .4byte 0x0203a11c +_0811DE40: + movs r0, 0 +_0811DE42: + pop {r1} + bx r1 + thumb_func_end sub_811DE10 + + thumb_func_start sub_811DE48 +sub_811DE48: @ 811DE48 + ldr r0, _0811DE54 + ldr r0, [r0] + ldr r1, _0811DE58 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_0811DE54: .4byte 0x0203a11c +_0811DE58: .4byte 0x000002ce + thumb_func_end sub_811DE48 + + thumb_func_start sub_811DE5C +sub_811DE5C: @ 811DE5C + push {r4,r5,lr} + 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 r4, r0, 8 + adds r0, r2 + orrs r4, r0 + lsls r5, r1, 8 + adds r1, r3 + orrs r5, r1 + movs r0, 0x40 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x44 + adds r1, r5, 0 + bl lcd_io_set + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811DE5C + + thumb_func_start sub_811DE90 +sub_811DE90: @ 811DE90 + push {r4,r5,lr} + ldr r0, _0811DEB8 + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _0811DEBC + bl gpu_pal_obj_alloc_and_load_multiple + movs r5, 0 + ldr r4, _0811DEC0 +_0811DEA2: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + bls _0811DEA2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811DEB8: .4byte 0x08597ca0 +_0811DEBC: .4byte 0x08597cc0 +_0811DEC0: .4byte 0x08597ce8 + thumb_func_end sub_811DE90 + + thumb_func_start sub_811DEC4 +sub_811DEC4: @ 811DEC4 + push {lr} + bl sub_811BA68 + lsls r0, 24 + ldr r1, _0811DF18 + lsrs r0, 22 + adds r0, r1 + ldrb r2, [r0] + lsls r1, r2, 27 + lsrs r1, 8 + lsrs r2, 5 + lsls r2, 19 + ldr r0, _0811DF1C + movs r3, 0xD0 + lsls r3, 12 + adds r1, r3 + asrs r1, 16 + movs r3, 0x80 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0811DF20 + ldr r2, [r1] + movs r1, 0xB6 + lsls r1, 2 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _0811DF24 + adds r1, r0 + str r1, [r2] + movs r0, 0x1 + strh r0, [r1, 0x30] + pop {r0} + bx r0 + .align 2, 0 +_0811DF18: .4byte 0x08597c30 +_0811DF1C: .4byte 0x08597d18 +_0811DF20: .4byte 0x0203a11c +_0811DF24: .4byte 0x02020630 + thumb_func_end sub_811DEC4 + + thumb_func_start sub_811DF28 +sub_811DF28: @ 811DF28 + push {lr} + adds r1, r0, 0 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0811DF56 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0811DF56 + movs r0, 0 + strh r0, [r1, 0x2E] + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _0811DF56 + ldr r0, _0811DF5C + strh r0, [r1, 0x24] +_0811DF56: + pop {r0} + bx r0 + .align 2, 0 +_0811DF5C: .4byte 0x0000fffa + thumb_func_end sub_811DF28 + + thumb_func_start sub_811DF60 +sub_811DF60: @ 811DF60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0811DF8C + ldr r2, [r2] + movs r3, 0xB6 + lsls r3, 2 + adds r2, r3 + ldr r3, [r2] + movs r4, 0 + strh r0, [r3, 0x20] + ldr r0, [r2] + strh r1, [r0, 0x22] + ldr r0, [r2] + strh r4, [r0, 0x24] + ldr r0, [r2] + strh r4, [r0, 0x2E] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811DF8C: .4byte 0x0203a11c + thumb_func_end sub_811DF60 + + thumb_func_start sub_811DF90 +sub_811DF90: @ 811DF90 + ldr r0, _0811DFAC + ldr r1, [r0] + movs r0, 0xB6 + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + movs r2, 0 + strh r2, [r0, 0x2E] + ldr r0, [r1] + strh r2, [r0, 0x30] + ldr r0, [r1] + strh r2, [r0, 0x24] + bx lr + .align 2, 0 +_0811DFAC: .4byte 0x0203a11c + thumb_func_end sub_811DF90 + + thumb_func_start sub_811DFB0 +sub_811DFB0: @ 811DFB0 + ldr r0, _0811DFC4 + ldr r0, [r0] + movs r1, 0xB6 + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x30] + bx lr + .align 2, 0 +_0811DFC4: .4byte 0x0203a11c + thumb_func_end sub_811DFB0 + + thumb_func_start sub_811DFC8 +sub_811DFC8: @ 811DFC8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r6, _0811E040 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0811E044 + ldr r2, [r5] + movs r1, 0xB7 + lsls r1, 2 + mov r8, r1 + add r2, r8 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, _0811E048 + adds r1, r4 + str r1, [r2] + movs r0, 0x20 + strh r0, [r1, 0x24] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + movs r1, 0xB8 + lsls r1, 2 + adds r3, r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + str r1, [r3] + ldr r0, _0811E04C + strh r0, [r1, 0x24] + add r2, r8 + ldr r1, [r2] + adds r1, 0x3F + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + bl sub_811E088 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811E040: .4byte 0x08597d68 +_0811E044: .4byte 0x0203a11c +_0811E048: .4byte 0x02020630 +_0811E04C: .4byte 0x0000ffe0 + thumb_func_end sub_811DFC8 + + thumb_func_start sub_811E050 +sub_811E050: @ 811E050 + push {r4-r6,lr} + ldr r5, _0811E084 + ldr r0, [r5] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl obj_delete_and_free_tiles + ldr r0, [r5] + adds r4, r0, r4 + movs r6, 0 + str r6, [r4] + movs r4, 0xB8 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl obj_delete_and_free_tiles + ldr r0, [r5] + adds r0, r4 + str r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811E084: .4byte 0x0203a11c + thumb_func_end sub_811E050 + + thumb_func_start sub_811E088 +sub_811E088: @ 811E088 + push {r4,lr} + sub sp, 0x4 + ldr r0, _0811E0D0 + ldr r1, [r0] + movs r2, 0xB7 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0811E0E4 + adds r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0811E0E4 + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_811BB9C + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811E0D4 + mov r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r4, r1] + bl sub_811E0EC + b _0811E0E4 + .align 2, 0 +_0811E0D0: .4byte 0x0203a11c +_0811E0D4: + mov r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r4, r1] + bl sub_811E1A4 +_0811E0E4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811E088 + + thumb_func_start sub_811E0EC +sub_811E0EC: @ 811E0EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + lsrs r7, r1, 24 + lsls r0, 24 + asrs r5, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _0811E150 + ldr r0, _0811E14C + mov r8, r0 + ldr r0, [r0] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0 + bl obj_anim_image_start + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r4 + ldr r2, [r4] + movs r0, 0x54 + muls r5, r0 + adds r5, 0x3A + strh r5, [r2, 0x20] + ldr r0, [r4] + lsls r4, r7, 24 + asrs r4, 20 + adds r4, 0x60 + strh r4, [r0, 0x22] + movs r6, 0xB8 + lsls r6, 2 + adds r1, r6 + ldr r0, [r1] + movs r1, 0 + bl obj_anim_image_start + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldr r1, [r0] + strh r5, [r1, 0x20] + b _0811E192 + .align 2, 0 +_0811E14C: .4byte 0x0203a11c +_0811E150: + ldr r6, _0811E1A0 + ldr r0, [r6] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + ldr r1, [r6] + adds r4, r1, r4 + ldr r0, [r4] + movs r2, 0xD8 + mov r8, r2 + mov r2, r8 + strh r2, [r0, 0x20] + ldr r0, [r4] + lsls r4, r7, 24 + asrs r4, 20 + adds r4, 0x70 + strh r4, [r0, 0x22] + movs r5, 0xB8 + lsls r5, 2 + adds r1, r5 + ldr r0, [r1] + movs r1, 0x1 + bl obj_anim_image_start + ldr r0, [r6] + adds r0, r5 + ldr r1, [r0] + mov r2, r8 + strh r2, [r1, 0x20] +_0811E192: + ldr r0, [r0] + strh r4, [r0, 0x22] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811E1A0: .4byte 0x0203a11c + thumb_func_end sub_811E0EC + + thumb_func_start sub_811E1A4 +sub_811E1A4: @ 811E1A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsrs r4, r0, 24 + asrs r2, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _0811E234 + lsls r0, r5, 24 + asrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, 0x60 + mov r8, r0 + movs r7, 0x20 + cmp r2, 0x6 + bne _0811E1D6 + cmp r1, 0 + bne _0811E1D6 + movs r7, 0x9E + movs r6, 0x2 + b _0811E1EC +_0811E1D6: + ldr r3, _0811E22C + lsls r1, r4, 24 + lsrs r0, r1, 24 + movs r2, 0 + cmp r0, 0x6 + bhi _0811E1E4 + asrs r2, r1, 24 +_0811E1E4: + adds r0, r2, r3 + ldrb r0, [r0] + adds r7, r0 + movs r6, 0x3 +_0811E1EC: + ldr r5, _0811E230 + ldr r0, [r5] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + adds r1, r6, 0 + bl obj_anim_image_start + ldr r1, [r5] + adds r4, r1, r4 + ldr r0, [r4] + strh r7, [r0, 0x20] + ldr r0, [r4] + mov r2, r8 + strh r2, [r0, 0x22] + movs r4, 0xB8 + lsls r4, 2 + adds r1, r4 + ldr r0, [r1] + adds r1, r6, 0 + bl obj_anim_image_start + ldr r0, [r5] + adds r0, r4 + ldr r1, [r0] + strh r7, [r1, 0x20] + ldr r0, [r0] + mov r1, r8 + strh r1, [r0, 0x22] + b _0811E27A + .align 2, 0 +_0811E22C: .4byte 0x08597d08 +_0811E230: .4byte 0x0203a11c +_0811E234: + ldr r6, _0811E284 + ldr r0, [r6] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + ldr r1, [r6] + adds r4, r1, r4 + ldr r0, [r4] + movs r2, 0xD8 + mov r8, r2 + mov r2, r8 + strh r2, [r0, 0x20] + ldr r0, [r4] + lsls r4, r5, 24 + asrs r4, 20 + adds r4, 0x70 + strh r4, [r0, 0x22] + movs r5, 0xB8 + lsls r5, 2 + adds r1, r5 + ldr r0, [r1] + movs r1, 0x1 + bl obj_anim_image_start + ldr r0, [r6] + adds r0, r5 + ldr r1, [r0] + mov r2, r8 + strh r2, [r1, 0x20] + ldr r0, [r0] + strh r4, [r0, 0x22] +_0811E27A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811E284: .4byte 0x0203a11c + thumb_func_end sub_811E1A4 + + thumb_func_start sub_811E288 +sub_811E288: @ 811E288 + push {lr} + ldr r0, _0811E2CC + movs r1, 0 + movs r2, 0 + movs r3, 0x4 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0811E2D0 + ldr r2, [r1] + movs r1, 0xB9 + lsls r1, 2 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _0811E2D4 + adds r1, r0 + str r1, [r2] + ldr r0, _0811E2D8 + str r0, [r1, 0x1C] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + bl sub_811E30C + pop {r0} + bx r0 + .align 2, 0 +_0811E2CC: .4byte 0x08597d18 +_0811E2D0: .4byte 0x0203a11c +_0811E2D4: .4byte 0x02020630 +_0811E2D8: .4byte sub_811E2DC + 1 + thumb_func_end sub_811E288 + + thumb_func_start sub_811E2DC +sub_811E2DC: @ 811E2DC + 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, 0x2 + ble _0811E302 + movs r0, 0 + strh r0, [r1, 0x2E] + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _0811E302 + ldr r0, _0811E308 + strh r0, [r1, 0x24] +_0811E302: + pop {r0} + bx r0 + .align 2, 0 +_0811E308: .4byte 0x0000fffa + thumb_func_end sub_811E2DC + + thumb_func_start sub_811E30C +sub_811E30C: @ 811E30C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_811BBC8 + mov r0, sp + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0xD + muls r0, r1 + lsls r0, 27 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r1, 28 + movs r2, 0xE0 + lsls r2, 21 + adds r0, r2 + lsrs r0, 24 + movs r2, 0xC0 + lsls r2, 23 + adds r1, r2 + lsrs r1, 24 + bl sub_811E34C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811E30C + + thumb_func_start sub_811E34C +sub_811E34C: @ 811E34C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, _0811E37C + ldr r0, [r0] + movs r1, 0xB9 + lsls r1, 2 + adds r2, r0, r1 + ldr r0, [r2] + cmp r0, 0 + beq _0811E376 + movs r1, 0 + strh r3, [r0, 0x20] + ldr r0, [r2] + strh r4, [r0, 0x22] + ldr r0, [r2] + strh r1, [r0, 0x24] + ldr r0, [r2] + strh r1, [r0, 0x2E] +_0811E376: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811E37C: .4byte 0x0203a11c + thumb_func_end sub_811E34C + + thumb_func_start sub_811E380 +sub_811E380: @ 811E380 + push {r4,lr} + ldr r4, _0811E3A8 + ldr r0, [r4] + movs r1, 0xB9 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0811E3A2 + bl obj_delete_and_free_tiles + ldr r0, [r4] + movs r1, 0xB9 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_0811E3A2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811E3A8: .4byte 0x0203a11c + thumb_func_end sub_811E380 + + thumb_func_start sub_811E3AC +sub_811E3AC: @ 811E3AC + push {r4-r6,lr} + ldr r0, _0811E404 + movs r1, 0xD0 + movs r2, 0x80 + movs r3, 0x6 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0811E408 + ldr r2, [r5] + movs r1, 0xBA + lsls r1, 2 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, _0811E40C + adds r1, r4 + str r1, [r2] + movs r6, 0 + ldr r0, _0811E410 + strh r0, [r1, 0x24] + ldr r0, _0811E414 + movs r1, 0xD0 + movs r2, 0x50 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + movs r1, 0xBB + lsls r1, 2 + adds r3, r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + str r1, [r3] + strb r6, [r2, 0x9] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811E404: .4byte 0x08597df0 +_0811E408: .4byte 0x0203a11c +_0811E40C: .4byte 0x02020630 +_0811E410: .4byte 0x0000ffc0 +_0811E414: .4byte 0x08597dd0 + thumb_func_end sub_811E3AC + + thumb_func_start sub_811E418 +sub_811E418: @ 811E418 + push {r4,lr} + ldr r4, _0811E42C + ldr r2, [r4] + ldrb r3, [r2, 0x9] + cmp r3, 0 + beq _0811E430 + cmp r3, 0x1 + beq _0811E488 + movs r0, 0 + b _0811E4A6 + .align 2, 0 +_0811E42C: .4byte 0x0203a11c +_0811E430: + movs r0, 0xBA + lsls r0, 2 + adds r2, r0 + ldr r1, [r2] + ldrh r0, [r1, 0x24] + adds r0, 0x8 + strh r0, [r1, 0x24] + ldr r2, [r2] + movs r1, 0x24 + ldrsh r0, [r2, r1] + cmp r0, 0 + blt _0811E4A4 + strh r3, [r2, 0x24] + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811E466 + ldr r0, [r4] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + b _0811E476 +_0811E466: + ldr r0, [r4] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start +_0811E476: + ldr r0, _0811E484 + ldr r1, [r0] + ldrb r0, [r1, 0x9] + adds r0, 0x1 + strb r0, [r1, 0x9] + b _0811E4A4 + .align 2, 0 +_0811E484: .4byte 0x0203a11c +_0811E488: + movs r1, 0xBB + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0811E4A4 + movs r0, 0x2 + strb r0, [r2, 0x9] + movs r0, 0 + b _0811E4A6 +_0811E4A4: + movs r0, 0x1 +_0811E4A6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811E418 + + thumb_func_start sub_811E4AC +sub_811E4AC: @ 811E4AC + push {lr} + ldr r2, _0811E4CC + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x9] + ldr r0, [r2] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_0811E4CC: .4byte 0x0203a11c + thumb_func_end sub_811E4AC + + thumb_func_start sub_811E4D0 +sub_811E4D0: @ 811E4D0 + push {r4-r6,lr} + ldr r5, _0811E4E4 + ldr r3, [r5] + ldrb r0, [r3, 0x9] + cmp r0, 0 + beq _0811E4E8 + cmp r0, 0x1 + beq _0811E502 + movs r0, 0 + b _0811E554 + .align 2, 0 +_0811E4E4: .4byte 0x0203a11c +_0811E4E8: + movs r1, 0xBB + lsls r1, 2 + adds r0, r3, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0811E552 + movs r0, 0x1 + strb r0, [r3, 0x9] + b _0811E552 +_0811E502: + movs r0, 0xBA + lsls r0, 2 + adds r2, r3, r0 + ldr r1, [r2] + ldrh r0, [r1, 0x24] + subs r0, 0x8 + movs r6, 0 + strh r0, [r1, 0x24] + ldr r0, [r2] + movs r2, 0x24 + ldrsh r1, [r0, r2] + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + bgt _0811E552 + movs r4, 0xBB + lsls r4, 2 + adds r0, r3, r4 + ldr r0, [r0] + bl obj_delete_and_free_tiles + ldr r0, [r5] + movs r1, 0xBA + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl obj_delete_and_free_tiles + ldr r1, [r5] + adds r4, r1, r4 + str r6, [r4] + movs r2, 0xBA + lsls r2, 2 + adds r0, r1, r2 + str r6, [r0] + ldrb r0, [r1, 0x9] + adds r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0 + b _0811E554 +_0811E552: + movs r0, 0x1 +_0811E554: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811E4D0 + + thumb_func_start sub_811E55C +sub_811E55C: @ 811E55C + push {lr} + ldr r0, _0811E574 + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x4 + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_0811E574: .4byte 0x0203a11c + thumb_func_end sub_811E55C + + thumb_func_start sub_811E578 +sub_811E578: @ 811E578 + push {lr} + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811E59C + ldr r0, _0811E598 + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl obj_anim_image_start + b _0811E5AE + .align 2, 0 +_0811E598: .4byte 0x0203a11c +_0811E59C: + ldr r0, _0811E5B4 + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl obj_anim_image_start +_0811E5AE: + pop {r0} + bx r0 + .align 2, 0 +_0811E5B4: .4byte 0x0203a11c + thumb_func_end sub_811E578 + + thumb_func_start sub_811E5B8 +sub_811E5B8: @ 811E5B8 + ldr r0, _0811E5D0 + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsrs r1, 4 + movs r0, 0x1 + bics r0, r1 + bx lr + .align 2, 0 +_0811E5D0: .4byte 0x0203a11c + thumb_func_end sub_811E5B8 + + thumb_func_start sub_811E5D4 +sub_811E5D4: @ 811E5D4 + push {r4,lr} + ldr r4, _0811E640 + adds r0, r4, 0 + movs r1, 0x60 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E602 + ldr r0, _0811E644 + ldr r2, [r0] + movs r0, 0xBC + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0811E648 + adds r0, r1 + str r0, [r2] +_0811E602: + adds r0, r4, 0 + movs r1, 0x60 + movs r2, 0x9C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E636 + ldr r0, _0811E644 + ldr r2, [r0] + movs r0, 0xBD + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0811E648 + adds r0, r1 + str r0, [r2] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_0811E636: + bl sub_811E6B0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811E640: .4byte 0x08597e48 +_0811E644: .4byte 0x0203a11c +_0811E648: .4byte 0x02020630 + thumb_func_end sub_811E5D4 + + thumb_func_start sub_811E64C +sub_811E64C: @ 811E64C + push {r4-r6,lr} + bl sub_811BBF8 + ldr r6, _0811E6AC + ldr r1, [r6] + movs r2, 0xBC + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E666 + movs r2, 0x1 +_0811E666: + adds r3, r1, 0 + adds r3, 0x3E + movs r4, 0x1 + lsls r2, 2 + ldrb r1, [r3] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + bl sub_811BC2C + ldr r1, [r6] + movs r2, 0xBD + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E692 + movs r2, 0x1 +_0811E692: + adds r3, r1, 0 + adds r3, 0x3E + adds r1, r4, 0 + ands r1, r2 + lsls r1, 2 + ldrb r2, [r3] + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811E6AC: .4byte 0x0203a11c + thumb_func_end sub_811E64C + + thumb_func_start sub_811E6B0 +sub_811E6B0: @ 811E6B0 + ldr r3, _0811E6DC + ldr r0, [r3] + movs r1, 0xBC + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xBD + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_0811E6DC: .4byte 0x0203a11c + thumb_func_end sub_811E6B0 + + thumb_func_start sub_811E6E0 +sub_811E6E0: @ 811E6E0 + push {lr} + cmp r0, 0 + bne _0811E6FC + ldr r0, _0811E6F8 + ldr r2, [r0] + movs r1, 0xBC + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + movs r1, 0x60 + b _0811E70A + .align 2, 0 +_0811E6F8: .4byte 0x0203a11c +_0811E6FC: + ldr r0, _0811E71C + ldr r2, [r0] + movs r1, 0xBC + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + movs r1, 0x78 +_0811E70A: + strh r1, [r0, 0x20] + movs r3, 0xBD + lsls r3, 2 + adds r0, r2, r3 + ldr r0, [r0] + strh r1, [r0, 0x20] + pop {r0} + bx r0 + .align 2, 0 +_0811E71C: .4byte 0x0203a11c + thumb_func_end sub_811E6E0 + + thumb_func_start sub_811E720 +sub_811E720: @ 811E720 + push {r4,lr} + ldr r4, _0811E788 + adds r0, r4, 0 + movs r1, 0xDC + movs r2, 0x54 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E74E + ldr r0, _0811E78C + ldr r2, [r0] + movs r0, 0xBE + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0811E790 + adds r0, r1 + str r0, [r2] +_0811E74E: + adds r0, r4, 0 + movs r1, 0xDC + movs r2, 0x9C + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E77E + ldr r0, _0811E78C + ldr r2, [r0] + movs r0, 0xBF + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0811E790 + adds r0, r1 + str r0, [r2] + movs r1, 0x1 + bl obj_anim_image_start +_0811E77E: + bl sub_811E7F8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811E788: .4byte 0x08597e30 +_0811E78C: .4byte 0x0203a11c +_0811E790: .4byte 0x02020630 + thumb_func_end sub_811E720 + + thumb_func_start sub_811E794 +sub_811E794: @ 811E794 + push {r4-r6,lr} + bl sub_811BBF8 + ldr r6, _0811E7F4 + ldr r1, [r6] + movs r2, 0xBE + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E7AE + movs r2, 0x1 +_0811E7AE: + adds r3, r1, 0 + adds r3, 0x3E + movs r4, 0x1 + lsls r2, 2 + ldrb r1, [r3] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + bl sub_811BC2C + ldr r1, [r6] + movs r2, 0xBF + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E7DA + movs r2, 0x1 +_0811E7DA: + adds r3, r1, 0 + adds r3, 0x3E + adds r1, r4, 0 + ands r1, r2 + lsls r1, 2 + ldrb r2, [r3] + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0811E7F4: .4byte 0x0203a11c + thumb_func_end sub_811E794 + + thumb_func_start sub_811E7F8 +sub_811E7F8: @ 811E7F8 + ldr r3, _0811E824 + ldr r0, [r3] + movs r1, 0xBE + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xBF + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_0811E824: .4byte 0x0203a11c + thumb_func_end sub_811E7F8 + + thumb_func_start sub_811E828 +sub_811E828: @ 811E828 + push {r4,r5,lr} + sub sp, 0x4 + bl sub_811BCBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0811E84C + cmp r0, 0x1 + bgt _0811E842 + cmp r0, 0 + beq _0811E848 + b _0811E8D0 +_0811E842: + cmp r0, 0x2 + beq _0811E850 + b _0811E8D0 +_0811E848: + movs r4, 0x43 + b _0811E852 +_0811E84C: + movs r4, 0x44 + b _0811E852 +_0811E850: + movs r4, 0x7 +_0811E852: + bl sub_811BA68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0811E8D0 + adds r0, r4, 0 + ldr r5, _0811E8D8 + movs r4, 0 + str r4, [sp] + adds r1, r5, 0 + movs r2, 0x4C + movs r3, 0x28 + bl sub_808DD68 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0811E892 + ldr r1, _0811E8DC + 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 + strb r1, [r0, 0x5] + movs r1, 0x2 + bl obj_anim_image_start +_0811E892: + ldr r0, _0811E8E0 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0x69 + cmp r0, 0 + bne _0811E8A0 + movs r1, 0x64 +_0811E8A0: + str r4, [sp] + adds r0, r1, 0 + adds r1, r5, 0 + movs r2, 0x34 + movs r3, 0x28 + bl sub_808DD68 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0811E8D0 + ldr r1, _0811E8DC + 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 + strb r1, [r0, 0x5] + movs r1, 0x3 + bl obj_anim_image_start +_0811E8D0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811E8D8: .4byte nullsub_12 + 1 +_0811E8DC: .4byte 0x02020630 +_0811E8E0: .4byte 0x03005d90 + thumb_func_end sub_811E828 + + thumb_func_start sub_811E8E4 +sub_811E8E4: @ 811E8E4 + push {lr} + bl sub_811BA68 + lsls r0, 24 + ldr r1, _0811E904 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _0811E90E + cmp r0, 0x1 + bgt _0811E908 + cmp r0, 0 + beq _0811E916 + b _0811E91A + .align 2, 0 +_0811E904: .4byte 0x08597c30 +_0811E908: + cmp r0, 0x2 + beq _0811E912 + b _0811E91A +_0811E90E: + movs r0, 0x1 + b _0811E91C +_0811E912: + movs r0, 0x2 + b _0811E91C +_0811E916: + movs r0, 0 + b _0811E91C +_0811E91A: + movs r0, 0x3 +_0811E91C: + pop {r1} + bx r1 + thumb_func_end sub_811E8E4 + + thumb_func_start sub_811E920 +sub_811E920: @ 811E920 + push {r4,lr} + adds r4, r0, 0 + bl sub_811E8E4 + adds r1, r0, 0 + cmp r1, 0x2 + ble _0811E932 + movs r0, 0 + b _0811E93E +_0811E932: + ldr r0, _0811E944 + lsls r1, 2 + adds r1, r4, r1 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x4 +_0811E93E: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0811E944: .4byte 0x08597e60 + thumb_func_end sub_811E920 + + thumb_func_start sub_811E948 +sub_811E948: @ 811E948 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + bl sub_811E8E4 + mov r8, r0 + cmp r0, 0x3 + beq _0811E9FA + ldr r3, _0811EA0C + ldr r0, [sp, 0xC] + ands r0, r3 + movs r1, 0x3 + orrs r0, r1 + ldr r2, _0811EA10 + ands r0, r2 + adds r1, 0xFD + orrs r0, r1 + ldr r1, _0811EA14 + ands r0, r1 + movs r1, 0xB0 + lsls r1, 12 + orrs r0, r1 + ldr r1, _0811EA18 + ands r0, r1 + movs r1, 0xE0 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0xC] + ldr r0, [sp, 0x10] + ands r0, r3 + movs r1, 0x2 + orrs r0, r1 + ands r0, r2 + movs r1, 0xB0 + lsls r1, 4 + orrs r0, r1 + ldr r1, _0811EA1C + ands r0, r1 + movs r1, 0xD0 + lsls r1, 14 + orrs r0, r1 + str r0, [sp, 0x10] + add r0, sp, 0xC + bl Window_AddFromTemplate + lsls r0, 16 + lsrs r7, r0, 16 + lsls r4, r7, 24 + lsrs r0, r4, 24 + movs r1, 0x11 + bl Window_FastFillPixels + movs r6, 0 + mov r0, r8 + lsls r1, r0, 4 + ldr r0, _0811EA20 + adds r5, r1, r0 + ldr r1, _0811EA24 + mov r10, r1 + mov r9, r4 +_0811E9C6: + ldr r2, [r5] + lsls r4, r7, 24 + cmp r2, 0 + beq _0811E9EC + mov r1, r8 + lsls r0, r1, 2 + adds r0, r6, r0 + add r0, r10 + ldrb r3, [r0] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + mov r1, r9 + lsrs r0, r1, 24 + movs r1, 0x1 + bl sub_811D028 +_0811E9EC: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0x3 + ble _0811E9C6 + lsrs r0, r4, 24 + bl Window_WriteStandardTileMap +_0811E9FA: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811EA0C: .4byte 0xffffff00 +_0811EA10: .4byte 0xffff00ff +_0811EA14: .4byte 0xff00ffff +_0811EA18: .4byte 0x00ffffff +_0811EA1C: .4byte 0x0000ffff +_0811EA20: .4byte 0x08597e6c +_0811EA24: .4byte 0x08597e60 + thumb_func_end sub_811E948 + + thumb_func_start sub_811EA28 +sub_811EA28: @ 811EA28 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x14 + beq _0811EA4E + cmp r0, 0x14 + bgt _0811EA48 + cmp r0, 0x11 + blt _0811EA66 + ldr r0, _0811EA44 + bl flag_check + b _0811EA60 + .align 2, 0 +_0811EA44: .4byte 0x00000864 +_0811EA48: + cmp r1, 0x15 + beq _0811EA5C + b _0811EA66 +_0811EA4E: + ldr r0, _0811EA58 + bl flag_check + b _0811EA60 + .align 2, 0 +_0811EA58: .4byte 0x00000866 +_0811EA5C: + bl sub_811F0F8 +_0811EA60: + lsls r0, 24 + lsrs r0, 24 + b _0811EA68 +_0811EA66: + movs r0, 0x1 +_0811EA68: + pop {r1} + bx r1 + thumb_func_end sub_811EA28 + + thumb_func_start start_menu_is_selected_item_valid +start_menu_is_selected_item_valid: @ 811EA6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0 + bne _0811EA84 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + lsrs r0, 16 + b _0811EA9A +_0811EA84: + bl sub_811EA28 + lsls r0, 24 + cmp r0, 0 + bne _0811EA92 + movs r0, 0 + b _0811EA9A +_0811EA92: + ldr r0, _0811EAA0 + lsls r1, r4, 3 + adds r1, r0 + ldrh r0, [r1, 0x6] +_0811EA9A: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0811EAA0: .4byte 0x0859d004 + thumb_func_end start_menu_is_selected_item_valid + + thumb_func_start sub_811EAA4 +sub_811EAA4: @ 811EAA4 + push {r4,r5,lr} + lsls r2, r0, 16 + lsrs r1, r2, 16 + ldr r0, _0811EAD0 + cmp r1, r0 + beq _0811EB04 + lsrs r3, r2, 25 + ldr r5, _0811EAD4 + ands r5, r1 + cmp r3, 0x15 + bhi _0811EB08 + ldr r0, _0811EAD8 + lsls r2, r3, 3 + adds r1, r2, r0 + ldrh r4, [r1, 0x4] + cmp r3, 0x13 + bgt _0811EADC + cmp r3, 0x12 + bge _0811EAE0 + cmp r3, 0 + beq _0811EAE0 + b _0811EB00 + .align 2, 0 +_0811EAD0: .4byte 0x0000ffff +_0811EAD4: .4byte 0x000001ff +_0811EAD8: .4byte 0x0859d004 +_0811EADC: + cmp r3, 0x15 + bne _0811EB00 +_0811EAE0: + adds r0, r2, r0 + ldr r2, [r0] + movs r1, 0 + cmp r1, r4 + bcs _0811EB08 +_0811EAEA: + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + beq _0811EB04 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bcc _0811EAEA + b _0811EB08 +_0811EB00: + cmp r5, r4 + bcs _0811EB08 +_0811EB04: + movs r0, 0 + b _0811EB0A +_0811EB08: + movs r0, 0x1 +_0811EB0A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811EAA4 + + thumb_func_start sub_811EB10 +sub_811EB10: @ 811EB10 + push {lr} + lsls r0, 16 + lsrs r2, r0, 25 + lsls r0, 7 + lsrs r3, r0, 23 + cmp r2, 0x15 + bhi _0811EB5C + cmp r2, 0x13 + bgt _0811EB2C + cmp r2, 0x12 + bge _0811EB3C + cmp r2, 0 + beq _0811EB30 + b _0811EB48 +_0811EB2C: + cmp r2, 0x15 + bne _0811EB48 +_0811EB30: + ldr r0, _0811EB38 + ldrh r0, [r0] + b _0811EB50 + .align 2, 0 +_0811EB38: .4byte 0x085f5490 +_0811EB3C: + ldr r0, _0811EB44 + ldrh r0, [r0] + b _0811EB50 + .align 2, 0 +_0811EB44: .4byte 0x085fa1d4 +_0811EB48: + ldr r1, _0811EB58 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] +_0811EB50: + cmp r0, r3 + bls _0811EB5C + movs r0, 0 + b _0811EB5E + .align 2, 0 +_0811EB58: .4byte 0x0859d004 +_0811EB5C: + movs r0, 0x1 +_0811EB5E: + pop {r1} + bx r1 + thumb_func_end sub_811EB10 + + thumb_func_start sub_811EB64 +sub_811EB64: @ 811EB64 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r0, 0x13 + bgt _0811EB7C + cmp r0, 0x12 + bge _0811EB90 + cmp r0, 0 + beq _0811EB80 + b _0811EBA0 +_0811EB7C: + cmp r0, 0x15 + bne _0811EBA0 +_0811EB80: + movs r0, 0xB + muls r0, r2 + ldr r1, _0811EB8C + adds r0, r1 + b _0811EBB2 + .align 2, 0 +_0811EB8C: .4byte 0x083185c8 +_0811EB90: + movs r0, 0xD + muls r0, r2 + ldr r1, _0811EB9C + adds r0, r1 + b _0811EBB2 + .align 2, 0 +_0811EB9C: .4byte 0x0831977c +_0811EBA0: + ldr r1, _0811EBB8 + lsls r0, 3 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_0811EBB2: + pop {r1} + bx r1 + .align 2, 0 +_0811EBB8: .4byte 0x0859d004 + thumb_func_end sub_811EB64 + + thumb_func_start sub_811EBBC +sub_811EBBC: @ 811EBBC + push {r4-r6,lr} + adds r5, r0, 0 + lsls r6, r1, 16 + lsrs r0, r6, 16 + adds r4, r0, 0 + bl sub_811EAA4 + lsls r0, 24 + cmp r0, 0 + beq _0811EBD8 + ldr r1, _0811EBD4 + b _0811EBEA + .align 2, 0 +_0811EBD4: .4byte 0x085eea42 +_0811EBD8: + ldr r0, _0811EBF4 + cmp r4, r0 + beq _0811EBFC + ldr r1, _0811EBF8 + ands r1, r4 + lsrs r0, r6, 25 + bl sub_811EB64 + adds r1, r0, 0 +_0811EBEA: + adds r0, r5, 0 + bl gf_strcpy + b _0811EC02 + .align 2, 0 +_0811EBF4: .4byte 0x0000ffff +_0811EBF8: .4byte 0x000001ff +_0811EBFC: + movs r0, 0xFF + strb r0, [r5] + adds r0, r5, 0 +_0811EC02: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811EBBC + + thumb_func_start sub_811EC08 +sub_811EC08: @ 811EC08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + ldr r0, _0811EC90 + adds r2, r0 + lsrs r7, r2, 16 + movs r0, 0 + cmp r0, r9 + bcs _0811EC78 +_0811EC2A: + movs r6, 0 + adds r0, 0x1 + mov r8, r0 + cmp r6, r7 + bcs _0811EC5C + ldr r2, _0811EC94 +_0811EC36: + ldrh r1, [r5] + adds r0, r4, 0 + str r2, [sp] + bl sub_811EBBC + adds r4, r0, 0 + ldrh r0, [r5] + ldr r2, [sp] + cmp r0, r2 + beq _0811EC50 + movs r0, 0 + strb r0, [r4] + adds r4, 0x1 +_0811EC50: + adds r5, 0x2 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + bcc _0811EC36 +_0811EC5C: + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r4, 0 + bl sub_811EBBC + adds r4, r0, 0 + movs r0, 0xFE + strb r0, [r4] + adds r4, 0x1 + mov r1, r8 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, r9 + bcc _0811EC2A +_0811EC78: + subs r4, 0x1 + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811EC90: .4byte 0xffff0000 +_0811EC94: .4byte 0x0000ffff + thumb_func_end sub_811EC08 + + thumb_func_start sub_811EC98 +sub_811EC98: @ 811EC98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp] + mov r7, r8 + movs r0, 0 + str r0, [sp, 0x4] + subs r0, r7, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r0, 0 + cmp r0, r3 + bcs _0811ED62 +_0811ECC8: + adds r3, r5, 0 + movs r2, 0 + movs r1, 0 + adds r0, 0x1 + mov r10, r0 + cmp r2, r7 + bcs _0811ECEE + ldr r6, _0811ECF8 +_0811ECD8: + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r6 + beq _0811ECE4 + movs r2, 0x1 +_0811ECE4: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r7 + bcc _0811ECD8 +_0811ECEE: + cmp r2, 0 + bne _0811ECFC + lsls r0, r7, 1 + adds r5, r0 + b _0811ED56 + .align 2, 0 +_0811ECF8: .4byte 0x0000ffff +_0811ECFC: + movs r6, 0 + ldr r1, [sp, 0x4] + adds r1, 0x1 + mov r9, r1 + cmp r6, r8 + bcs _0811ED30 + ldr r2, _0811ED48 +_0811ED0A: + ldrh r1, [r5] + adds r0, r4, 0 + str r2, [sp, 0x8] + bl sub_811EBBC + adds r4, r0, 0 + ldrh r0, [r5] + ldr r2, [sp, 0x8] + cmp r0, r2 + beq _0811ED24 + movs r0, 0 + strb r0, [r4] + adds r4, 0x1 +_0811ED24: + adds r5, 0x2 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r8 + bcc _0811ED0A +_0811ED30: + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r4, 0 + bl sub_811EBBC + adds r4, r0, 0 + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _0811ED4C + movs r0, 0xFE + b _0811ED4E + .align 2, 0 +_0811ED48: .4byte 0x0000ffff +_0811ED4C: + movs r0, 0xFA +_0811ED4E: + strb r0, [r4] + adds r4, 0x1 + mov r1, r9 + str r1, [sp, 0x4] +_0811ED56: + mov r1, r10 + lsls r0, r1, 16 + lsrs r0, 16 + ldr r1, [sp] + cmp r0, r1 + bcc _0811ECC8 +_0811ED62: + subs r4, 0x1 + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + 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_811EC98 + + thumb_func_start sub_811ED7C +sub_811ED7C: @ 811ED7C + push {r4,r5,lr} + lsls r5, r0, 16 + lsrs r0, r5, 16 + adds r4, r0, 0 + ldr r0, _0811ED90 + cmp r4, r0 + bne _0811ED94 + movs r0, 0 + b _0811EDBA + .align 2, 0 +_0811ED90: .4byte 0x0000ffff +_0811ED94: + adds r0, r4, 0 + bl sub_811EAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811EDB0 + ldr r1, _0811EDAC + ands r1, r4 + lsrs r0, r5, 25 + bl sub_811EB64 + b _0811EDB2 + .align 2, 0 +_0811EDAC: .4byte 0x000001ff +_0811EDB0: + ldr r0, _0811EDC0 +_0811EDB2: + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 +_0811EDBA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0811EDC0: .4byte 0x085eea42 + thumb_func_end sub_811ED7C + + thumb_func_start sub_811EDC4 +sub_811EDC4: @ 811EDC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + movs r7, 0 + cmp r7, r8 + bcs _0811EE26 + subs r0, r1, 0x1 + lsls r0, 16 + mov r9, r0 +_0811EDEE: + mov r0, r9 + lsrs r4, r0, 16 + movs r5, 0 + cmp r5, r1 + bcs _0811EE14 +_0811EDF8: + ldrh r0, [r6] + adds r6, 0x2 + str r1, [sp] + bl sub_811ED7C + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, [sp] + cmp r5, r1 + bcc _0811EDF8 +_0811EE14: + cmp r4, r10 + bls _0811EE1C + movs r0, 0x1 + b _0811EE28 +_0811EE1C: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r8 + bcc _0811EDEE +_0811EE26: + movs r0, 0 +_0811EE28: + 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_811EDC4 + + thumb_func_start sub_811EE38 +sub_811EE38: @ 811EE38 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber + ldr r2, _0811EE88 + lsls r1, r4, 3 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1, 0x4] + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r4, 0 + beq _0811EE66 + cmp r4, 0x15 + beq _0811EE66 + cmp r4, 0x12 + beq _0811EE66 + cmp r4, 0x13 + bne _0811EE74 +_0811EE66: + ldr r1, _0811EE88 + lsls r0, r4, 3 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r1 + ldrh r2, [r0] +_0811EE74: + movs r0, 0x7F + ands r0, r4 + lsls r0, 9 + ldr r1, _0811EE8C + ands r2, r1 + orrs r0, r2 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0811EE88: .4byte 0x0859d004 +_0811EE8C: .4byte 0x000001ff + thumb_func_end sub_811EE38 + + thumb_func_start sub_811EE90 +sub_811EE90: @ 811EE90 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_811EA28 + lsls r0, 24 + cmp r0, 0 + bne _0811EEB0 + ldr r0, _0811EEAC + b _0811EEC4 + .align 2, 0 +_0811EEAC: .4byte 0x0000ffff +_0811EEB0: + cmp r4, 0 + beq _0811EEBC + adds r0, r4, 0 + bl sub_811EE38 + b _0811EEC0 +_0811EEBC: + bl sub_811F108 +_0811EEC0: + lsls r0, 16 + lsrs r0, 16 +_0811EEC4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811EE90 + + thumb_func_start sub_811EECC +sub_811EECC: @ 811EECC + push {r4,r5,lr} + ldr r0, _0811EEE0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811EF04 + cmp r0, 0x1 + bgt _0811EEE4 + cmp r0, 0 + beq _0811EEEE + b _0811EF58 + .align 2, 0 +_0811EEE0: .4byte 0x020375e0 +_0811EEE4: + cmp r0, 0x2 + beq _0811EF2C + cmp r0, 0x3 + beq _0811EF3C + b _0811EF58 +_0811EEEE: + ldr r0, _0811EEFC + ldr r0, [r0] + ldr r1, _0811EF00 + adds r5, r0, r1 + movs r2, 0x2 + b _0811EF46 + .align 2, 0 +_0811EEFC: .4byte 0x03005d8c +_0811EF00: .4byte 0x00002bb0 +_0811EF04: + ldr r0, _0811EF24 + ldr r0, [r0] + ldr r1, _0811EF28 + adds r5, r0, r1 + adds r0, r5, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x12 + bl sub_811EDC4 + lsls r0, 24 + cmp r0, 0 + beq _0811EF44 + movs r2, 0x2 + movs r3, 0x3 + b _0811EF48 + .align 2, 0 +_0811EF24: .4byte 0x03005d8c +_0811EF28: .4byte 0x00002bbc +_0811EF2C: + ldr r0, _0811EF34 + ldr r0, [r0] + ldr r1, _0811EF38 + b _0811EF42 + .align 2, 0 +_0811EF34: .4byte 0x03005d8c +_0811EF38: .4byte 0x00002bc8 +_0811EF3C: + ldr r0, _0811EF60 + ldr r0, [r0] + ldr r1, _0811EF64 +_0811EF42: + adds r5, r0, r1 +_0811EF44: + movs r2, 0x3 +_0811EF46: + movs r3, 0x2 +_0811EF48: + ldr r4, _0811EF68 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_811EC08 + adds r0, r4, 0 + bl box_related_two__3 +_0811EF58: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811EF60: .4byte 0x03005d8c +_0811EF64: .4byte 0x00002bd4 +_0811EF68: .4byte 0x02021fc4 + thumb_func_end sub_811EECC + + thumb_func_start sub_811EF6C +sub_811EF6C: @ 811EF6C + push {lr} + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + movs r0, 0xC + cmp r1, 0 + beq _0811EF7E + movs r0, 0xD +_0811EF7E: + bl sub_811EE90 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _0811EF94 + bl sub_811EBBC + pop {r0} + bx r0 + .align 2, 0 +_0811EF94: .4byte 0x02021dc4 + thumb_func_end sub_811EF6C + + thumb_func_start sub_811EF98 +sub_811EF98: @ 811EF98 + lsls r0, 24 + lsrs r2, r0, 27 + movs r1, 0xE0 + lsls r1, 19 + ands r1, r0 + lsrs r1, 24 + ldr r0, _0811EFB8 + ldr r0, [r0] + ldr r3, _0811EFBC + adds r0, r3 + adds r0, r2 + ldrb r0, [r0] + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_0811EFB8: .4byte 0x03005d8c +_0811EFBC: .4byte 0x00002e20 + thumb_func_end sub_811EF98 + + thumb_func_start sub_811EFC0 +sub_811EFC0: @ 811EFC0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x20 + bhi _0811EFE4 + lsrs r3, r0, 27 + movs r2, 0x7 + ands r2, r1 + ldr r0, _0811EFE8 + ldr r1, [r0] + ldr r0, _0811EFEC + adds r1, r0 + adds r1, r3 + movs r0, 0x1 + lsls r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] +_0811EFE4: + pop {r0} + bx r0 + .align 2, 0 +_0811EFE8: .4byte 0x03005d8c +_0811EFEC: .4byte 0x00002e20 + thumb_func_end sub_811EFC0 + + thumb_func_start sub_811EFF0 +sub_811EFF0: @ 811EFF0 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_0811EFF6: + adds r0, r4, 0 + bl sub_811EF98 + lsls r0, 24 + cmp r0, 0 + beq _0811F008 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0811F008: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x20 + bls _0811EFF6 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811EFF0 + + thumb_func_start sub_811F01C +sub_811F01C: @ 811F01C + push {r4-r6,lr} + bl sub_811EFF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x21 + bne _0811F048 + b _0811F082 +_0811F02C: + adds r0, r5, 0 + bl sub_811EFC0 + ldr r0, _0811F044 + ands r4, r0 + movs r1, 0xA0 + lsls r1, 6 + adds r0, r1, 0 + orrs r4, r0 + adds r0, r4, 0 + b _0811F084 + .align 2, 0 +_0811F044: .4byte 0x000001ff +_0811F048: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x21 + subs r1, r4 + bl __modsi3 + lsls r0, 16 + lsrs r6, r0, 16 + movs r4, 0 +_0811F05E: + lsls r0, r4, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_811EF98 + lsls r0, 24 + cmp r0, 0 + bne _0811F078 + cmp r6, 0 + beq _0811F02C + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0811F078: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x20 + bls _0811F05E +_0811F082: + ldr r0, _0811F08C +_0811F084: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0811F08C: .4byte 0x0000ffff + thumb_func_end sub_811F01C + + thumb_func_start sub_811F090 +sub_811F090: @ 811F090 + push {r4,r5,lr} + bl sub_811EFF0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0811F0B4 + b _0811F0EA +_0811F0A0: + ldr r0, _0811F0B0 + ands r4, r0 + movs r1, 0xA0 + lsls r1, 6 + adds r0, r1, 0 + orrs r4, r0 + adds r0, r4, 0 + b _0811F0EC + .align 2, 0 +_0811F0B0: .4byte 0x000001ff +_0811F0B4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0811F0C8: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_811EF98 + lsls r0, 24 + cmp r0, 0 + beq _0811F0E0 + cmp r5, 0 + beq _0811F0A0 + subs r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0811F0E0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x20 + bls _0811F0C8 +_0811F0EA: + ldr r0, _0811F0F4 +_0811F0EC: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0811F0F4: .4byte 0x0000ffff + thumb_func_end sub_811F090 + + thumb_func_start sub_811F0F8 +sub_811F0F8: @ 811F0F8 + push {lr} + bl sub_809D42C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_811F0F8 + + thumb_func_start sub_811F108 +sub_811F108: @ 811F108 + push {r4-r7,lr} + movs r0, 0 + bl start_menu_is_selected_item_valid + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _0811F128 + b _0811F172 +_0811F11A: + ldrh r1, [r5] + ldr r0, _0811F124 + ands r0, r1 + b _0811F174 + .align 2, 0 +_0811F124: .4byte 0x000001ff +_0811F128: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0811F17C + ldr r5, [r0] + ldrh r7, [r0, 0x4] + movs r6, 0 + cmp r6, r7 + bcs _0811F172 +_0811F146: + ldrh r0, [r5] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _0811F166 + cmp r4, 0 + beq _0811F11A + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0811F166: + adds r5, 0x2 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + bcc _0811F146 +_0811F172: + ldr r0, _0811F180 +_0811F174: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811F17C: .4byte 0x0859d004 +_0811F180: .4byte 0x0000ffff + thumb_func_end sub_811F108 + + thumb_func_start sub_811F184 +sub_811F184: @ 811F184 + push {r4-r7,lr} + movs r2, 0 + ldr r5, _0811F25C + ldr r4, _0811F260 + ldr r3, _0811F264 +_0811F18E: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3 + bls _0811F18E + movs r2, 0 + ldr r5, _0811F25C + ldr r4, _0811F268 + ldr r3, _0811F26C +_0811F1AE: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0811F1AE + movs r2, 0 + ldr r5, _0811F25C + ldr r4, _0811F270 + ldr r3, _0811F274 +_0811F1CE: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0811F1CE + movs r2, 0 + ldr r5, _0811F25C + ldr r4, _0811F278 + ldr r3, _0811F27C +_0811F1EE: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0811F1EE + movs r2, 0 + ldr r7, _0811F25C + ldr r6, _0811F280 + ldr r0, _0811F284 + adds r5, r0, 0 +_0811F210: + movs r3, 0 + lsls r0, r2, 3 + adds r0, r2 + lsls r4, r0, 2 +_0811F218: + ldr r1, [r7] + lsls r0, r3, 1 + adds r0, r4 + adds r1, r6 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r5 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x8 + bls _0811F218 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _0811F210 + movs r2, 0 + ldr r4, _0811F25C + ldr r3, _0811F288 + movs r1, 0 +_0811F244: + ldr r0, [r4] + adds r0, r3 + adds r0, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3F + bls _0811F244 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811F25C: .4byte 0x03005d8c +_0811F260: .4byte 0x00002bb0 +_0811F264: .4byte 0x0859e62c +_0811F268: .4byte 0x00002bbc +_0811F26C: .4byte 0x0859e634 +_0811F270: .4byte 0x00002bc8 +_0811F274: .4byte 0x0859e640 +_0811F278: .4byte 0x00002bd4 +_0811F27C: .4byte 0x0859e64c +_0811F280: .4byte 0x00002be0 +_0811F284: .4byte 0x0000ffff +_0811F288: .4byte 0x00002e20 + thumb_func_end sub_811F184 + + thumb_func_start sub_811F28C +sub_811F28C: @ 811F28C + push {r4,lr} + ldr r4, _0811F2A8 + ldr r0, _0811F2AC + bl malloc + str r0, [r4] + cmp r0, 0 + beq _0811F2B0 + bl sub_811F2D4 + bl sub_811F46C + movs r0, 0x1 + b _0811F2B2 + .align 2, 0 +_0811F2A8: .4byte 0x0203a120 +_0811F2AC: .4byte 0x00003ba4 +_0811F2B0: + movs r0, 0 +_0811F2B2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811F28C + + thumb_func_start sub_811F2B8 +sub_811F2B8: @ 811F2B8 + push {r4,lr} + ldr r4, _0811F2D0 + ldr r0, [r4] + cmp r0, 0 + beq _0811F2CA + bl free + movs r0, 0 + str r0, [r4] +_0811F2CA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0811F2D0: .4byte 0x0203a120 + thumb_func_end sub_811F2B8 + + thumb_func_start sub_811F2D4 +sub_811F2D4: @ 811F2D4 + push {r4,r5,lr} + ldr r4, _0811F3A0 + ldr r0, [r4] + movs r5, 0 + strh r5, [r0] + movs r0, 0 + bl pokedex_count + lsls r0, 16 + cmp r0, 0 + beq _0811F2FC + ldr r0, [r4] + ldrh r1, [r0] + adds r2, r1, 0x1 + strh r2, [r0] + lsls r1, 16 + lsrs r1, 15 + adds r0, 0x2 + adds r0, r1 + strh r5, [r0] +_0811F2FC: + movs r3, 0x1 +_0811F2FE: + ldr r0, [r4] + ldrh r2, [r0] + adds r1, r2, 0x1 + strh r1, [r0] + lsls r2, 16 + lsrs r2, 15 + adds r0, 0x2 + adds r0, r2 + strh r3, [r0] + adds r3, 0x1 + cmp r3, 0x10 + ble _0811F2FE + ldr r0, _0811F3A4 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0811F358 + ldr r0, _0811F3A0 + ldr r2, [r0] + ldrh r0, [r2] + adds r1, r0, 0x1 + strh r1, [r2] + lsls r0, 16 + lsrs r0, 15 + adds r3, r2, 0x2 + adds r0, r3, r0 + movs r1, 0x11 + strh r1, [r0] + ldrh r0, [r2] + adds r1, r0, 0x1 + strh r1, [r2] + lsls r0, 16 + lsrs r0, 15 + adds r0, r3, r0 + movs r1, 0x12 + strh r1, [r0] + ldrh r0, [r2] + adds r1, r0, 0x1 + strh r1, [r2] + lsls r0, 16 + lsrs r0, 15 + adds r3, r0 + movs r0, 0x13 + strh r0, [r3] +_0811F358: + ldr r0, _0811F3A8 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0811F37A + ldr r0, _0811F3A0 + ldr r0, [r0] + ldrh r1, [r0] + adds r2, r1, 0x1 + strh r2, [r0] + lsls r1, 16 + lsrs r1, 15 + adds r0, 0x2 + adds r0, r1 + movs r1, 0x14 + strh r1, [r0] +_0811F37A: + bl sub_809D42C + cmp r0, 0 + beq _0811F398 + ldr r0, _0811F3A0 + ldr r0, [r0] + ldrh r1, [r0] + adds r2, r1, 0x1 + strh r2, [r0] + lsls r1, 16 + lsrs r1, 15 + adds r0, 0x2 + adds r0, r1 + movs r1, 0x15 + strh r1, [r0] +_0811F398: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0811F3A0: .4byte 0x0203a120 +_0811F3A4: .4byte 0x00000864 +_0811F3A8: .4byte 0x00000866 + thumb_func_end sub_811F2D4 + + thumb_func_start sub_811F3AC +sub_811F3AC: @ 811F3AC + ldr r0, _0811F3B4 + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .align 2, 0 +_0811F3B4: .4byte 0x0203a120 + thumb_func_end sub_811F3AC + + thumb_func_start sub_811F3B8 +sub_811F3B8: @ 811F3B8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0811F3D4 + ldr r1, [r0] + ldrh r0, [r1] + cmp r2, r0 + bcs _0811F3D8 + lsls r0, r2, 1 + adds r1, 0x2 + adds r1, r0 + ldrb r0, [r1] + b _0811F3DA + .align 2, 0 +_0811F3D4: .4byte 0x0203a120 +_0811F3D8: + movs r0, 0x16 +_0811F3DA: + pop {r1} + bx r1 + thumb_func_end sub_811F3B8 + + thumb_func_start sub_811F3E0 +sub_811F3E0: @ 811F3E0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsls r2, 16 + lsrs r5, r2, 16 + ldr r0, _0811F420 + lsrs r1, 22 + adds r1, r0 + ldr r1, [r1] + adds r0, r4, 0 + bl gf_strcpy + adds r1, r0, 0 + subs r4, r1, r4 + lsls r4, 16 + lsrs r0, r4, 16 + cmp r0, r5 + bcs _0811F414 + movs r2, 0 +_0811F406: + strb r2, [r1] + adds r1, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _0811F406 +_0811F414: + movs r0, 0xFF + strb r0, [r1] + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0811F420: .4byte 0x0859e5d4 + thumb_func_end sub_811F3E0 + + thumb_func_start sub_811F424 +sub_811F424: @ 811F424 + lsls r0, 24 + ldr r1, _0811F430 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0811F430: .4byte 0x0859e5d4 + thumb_func_end sub_811F424 + + thumb_func_start sub_811F434 +sub_811F434: @ 811F434 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl sub_811EBBC + adds r1, r0, 0 + subs r4, r1, r4 + lsls r4, 16 + lsrs r0, r4, 16 + cmp r0, r5 + bcs _0811F460 + movs r2, 0 +_0811F452: + strb r2, [r1] + adds r1, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _0811F452 +_0811F460: + movs r0, 0xFF + strb r0, [r1] + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811F434 + + thumb_func_start sub_811F46C +sub_811F46C: @ 811F46C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r3, 0 +_0811F47A: + ldr r2, _0811F4BC + lsls r1, r3, 3 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp] + adds r1, r2 + ldr r7, [r1] + ldr r0, _0811F4C0 + ldr r1, [r0] + lsls r2, r3, 1 + adds r1, 0x2E + adds r1, r2 + movs r0, 0 + strh r0, [r1] + mov r10, r0 + movs r1, 0 + str r2, [sp, 0x4] + adds r0, r3, 0x1 + str r0, [sp, 0x8] + ldr r2, [sp] + cmp r1, r2 + bge _0811F530 +_0811F4A8: + ldrh r0, [r7] + ldr r2, _0811F4C4 + cmp r0, r2 + bne _0811F4FC + adds r7, 0x2 + ldrh r4, [r7] + adds r7, 0x2 + adds r0, r1, 0x1 + adds r1, r0, r4 + b _0811F4FE + .align 2, 0 +_0811F4BC: .4byte 0x0859e46c +_0811F4C0: .4byte 0x0203a120 +_0811F4C4: .4byte 0x0000ffff +_0811F4C8: + ldr r0, _0811F4F8 + ldr r2, [r0] + mov r0, r10 + lsls r1, r0, 1 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 3 + subs r0, r3 + lsls r0, 2 + adds r1, r0 + adds r0, r2, 0 + adds r0, 0x64 + adds r0, r1 + ldrh r1, [r5] + strh r1, [r0] + movs r0, 0x1 + add r10, r0 + adds r2, 0x2E + ldr r0, [sp, 0x4] + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _0811F526 + .align 2, 0 +_0811F4F8: .4byte 0x0203a120 +_0811F4FC: + movs r4, 0x1 +_0811F4FE: + movs r6, 0 + adds r1, 0x1 + mov r9, r1 + lsls r2, r4, 1 + mov r8, r2 + cmp r6, r4 + bge _0811F526 + adds r5, r7, 0 +_0811F50E: + ldrh r0, [r5] + str r3, [sp, 0xC] + bl sub_811F860 + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + bne _0811F4C8 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, r4 + blt _0811F50E +_0811F526: + add r7, r8 + mov r1, r9 + ldr r0, [sp] + cmp r1, r0 + blt _0811F4A8 +_0811F530: + ldr r3, [sp, 0x8] + cmp r3, 0x1A + ble _0811F47A + 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_811F46C + + thumb_func_start sub_811F548 +sub_811F548: @ 811F548 + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r0, 0 + bne _0811F55A + adds r0, r1, 0 + bl sub_811F5C4 + b _0811F560 +_0811F55A: + adds r0, r1, 0 + bl sub_811F6B8 +_0811F560: + ldr r1, _0811F570 + ldr r1, [r1] + ldr r2, _0811F574 + adds r1, r2 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0811F570: .4byte 0x0203a120 +_0811F574: .4byte 0x00003ba0 + thumb_func_end sub_811F548 + + thumb_func_start sub_811F578 +sub_811F578: @ 811F578 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _0811F598 + ldr r1, [r0] + ldr r3, _0811F59C + adds r0, r1, r3 + ldrh r0, [r0] + cmp r2, r0 + bcs _0811F5A4 + lsls r0, r2, 1 + ldr r2, _0811F5A0 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + b _0811F5A6 + .align 2, 0 +_0811F598: .4byte 0x0203a120 +_0811F59C: .4byte 0x00003ba0 +_0811F5A0: .4byte 0x00003984 +_0811F5A4: + ldr r0, _0811F5AC +_0811F5A6: + pop {r1} + bx r1 + .align 2, 0 +_0811F5AC: .4byte 0x0000ffff + thumb_func_end sub_811F578 + + thumb_func_start sub_811F5B0 +sub_811F5B0: @ 811F5B0 + ldr r0, _0811F5BC + ldr r0, [r0] + ldr r1, _0811F5C0 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_0811F5BC: .4byte 0x0203a120 +_0811F5C0: .4byte 0x00003ba0 + thumb_func_end sub_811F5B0 + + thumb_func_start sub_811F5C4 +sub_811F5C4: @ 811F5C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _0811F63C + lsls r0, r2, 3 + adds r0, r1 + ldrh r3, [r0, 0x4] + mov r8, r3 + cmp r2, 0 + beq _0811F5EC + cmp r2, 0x15 + beq _0811F5EC + cmp r2, 0x12 + beq _0811F5EC + cmp r2, 0x13 + bne _0811F64C +_0811F5EC: + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0] + movs r7, 0 + movs r5, 0 + cmp r5, r8 + bcs _0811F698 + movs r0, 0x7F + ands r0, r2 + lsls r0, 9 + mov r9, r0 + adds r4, r1, 0 + lsls r6, r2, 24 +_0811F606: + ldrh r0, [r4] + lsrs r1, r6, 24 + bl sub_811F764 + lsls r0, 24 + cmp r0, 0 + beq _0811F630 + ldr r0, _0811F640 + ldr r2, [r0] + lsls r0, r5, 1 + ldr r1, _0811F644 + adds r2, r1 + adds r2, r0 + ldrh r0, [r4] + ldr r3, _0811F648 + adds r1, r3, 0 + ands r0, r1 + mov r1, r9 + orrs r0, r1 + strh r0, [r2] + adds r5, 0x1 +_0811F630: + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r8 + bcc _0811F606 + b _0811F698 + .align 2, 0 +_0811F63C: .4byte 0x0859d004 +_0811F640: .4byte 0x0203a120 +_0811F644: .4byte 0x00003984 +_0811F648: .4byte 0x000001ff +_0811F64C: + ldr r1, [r0] + movs r7, 0 + movs r5, 0 + cmp r5, r8 + bcs _0811F698 + movs r0, 0x7F + ands r0, r2 + lsls r0, 9 + mov r10, r0 + adds r6, r1, 0 + lsls r2, 24 + mov r9, r2 +_0811F664: + ldrh r4, [r6, 0x4] + adds r0, r4, 0 + mov r2, r9 + lsrs r1, r2, 24 + bl sub_811F764 + lsls r0, 24 + cmp r0, 0 + beq _0811F690 + ldr r0, _0811F6AC + ldr r1, [r0] + lsls r0, r5, 1 + ldr r3, _0811F6B0 + adds r1, r3 + adds r1, r0 + ldr r2, _0811F6B4 + adds r0, r2, 0 + ands r4, r0 + mov r3, r10 + orrs r4, r3 + strh r4, [r1] + adds r5, 0x1 +_0811F690: + adds r6, 0xC + adds r7, 0x1 + cmp r7, r8 + bcc _0811F664 +_0811F698: + lsls r0, r5, 16 + lsrs r0, 16 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811F6AC: .4byte 0x0203a120 +_0811F6B0: .4byte 0x00003984 +_0811F6B4: .4byte 0x000001ff + thumb_func_end sub_811F5C4 + + thumb_func_start sub_811F6B8 +sub_811F6B8: @ 811F6B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r1, r0, 16 + movs r4, 0 + movs r6, 0 + ldr r3, _0811F724 + ldr r0, [r3] + lsls r5, r1, 1 + adds r0, 0x2E + adds r0, r5 + ldrh r0, [r0] + cmp r6, r0 + bcs _0811F718 + mov r8, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 3 + subs r0, r1 + lsls r7, r0, 2 + ldr r0, _0811F728 + mov r12, r0 +_0811F6E6: + mov r0, r8 + ldr r3, [r0] + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 1 + mov r0, r12 + adds r2, r3, r0 + adds r2, r1 + lsls r1, r4, 1 + adds r1, r7 + adds r0, r3, 0 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r3, 0x2E + adds r3, r5 + ldrh r3, [r3] + cmp r4, r3 + bcc _0811F6E6 +_0811F718: + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0811F724: .4byte 0x0203a120 +_0811F728: .4byte 0x00003984 + thumb_func_end sub_811F6B8 + + thumb_func_start sub_811F72C +sub_811F72C: @ 811F72C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r0, _0811F750 + ldr r0, [r0] + ldrh r1, [r0] + cmp r2, r1 + bge _0811F75C + adds r4, r3, 0 + adds r3, r1, 0 + adds r1, r0, 0x2 +_0811F744: + ldrh r0, [r1] + cmp r0, r4 + bne _0811F754 + movs r0, 0x1 + b _0811F75E + .align 2, 0 +_0811F750: .4byte 0x0203a120 +_0811F754: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0811F744 +_0811F75C: + movs r0, 0 +_0811F75E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811F72C + + thumb_func_start sub_811F764 +sub_811F764: @ 811F764 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r2, 0x15 + bhi _0811F81A + lsls r0, r2, 2 + ldr r1, _0811F77C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0811F77C: .4byte _0811F780 + .align 2, 0 +_0811F780: + .4byte _0811F7D8 + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F808 + .4byte _0811F808 + .4byte _0811F80C + .4byte _0811F7EE +_0811F7D8: + adds r0, r4, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + lsrs r0, 24 + b _0811F82C +_0811F7EE: + adds r0, r4, 0 + bl sub_811F838 + cmp r0, 0 + beq _0811F808 + adds r0, r4, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation +_0811F808: + movs r0, 0x1 + b _0811F82C +_0811F80C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_811EF98 + lsls r0, 24 + lsrs r0, 24 + b _0811F82C +_0811F81A: + ldr r1, _0811F834 + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] +_0811F82C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0811F834: .4byte 0x0859d004 + thumb_func_end sub_811F764 + + thumb_func_start sub_811F838 +sub_811F838: @ 811F838 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, _0811F84C +_0811F842: + ldrh r0, [r1] + cmp r0, r3 + bne _0811F850 + movs r0, 0x1 + b _0811F85A + .align 2, 0 +_0811F84C: .4byte 0x0859e658 +_0811F850: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0 + beq _0811F842 + movs r0, 0 +_0811F85A: + pop {r1} + bx r1 + thumb_func_end sub_811F838 + + thumb_func_start sub_811F860 +sub_811F860: @ 811F860 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 25 + lsls r0, 7 + lsrs r4, r0, 23 + adds r0, r5, 0 + bl sub_811F72C + lsls r0, 24 + cmp r0, 0 + beq _0811F884 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_811F764 + lsls r0, 24 + lsrs r0, 24 + b _0811F886 +_0811F884: + movs r0, 0 +_0811F886: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811F860 + + thumb_func_start sub_811F88C +sub_811F88C: @ 811F88C + push {lr} + adds r2, r0, 0 + lsls r1, 16 + ldr r0, _0811F8B4 + adds r1, r0 + lsrs r0, r1, 16 + ldr r1, _0811F8B8 + cmp r0, r1 + beq _0811F8AE + adds r3, r1, 0 +_0811F8A0: + strh r3, [r2] + adds r2, 0x2 + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bne _0811F8A0 +_0811F8AE: + pop {r0} + bx r0 + .align 2, 0 +_0811F8B4: .4byte 0xffff0000 +_0811F8B8: .4byte 0x0000ffff + thumb_func_end sub_811F88C + + thumb_func_start sub_811F8BC +sub_811F8BC: @ 811F8BC + push {lr} + bl sub_801B058 + ldr r1, _0811F8D4 + adds r2, r1, 0 + adds r1, r0, 0x6 +_0811F8C8: + strh r2, [r1] + subs r1, 0x2 + cmp r1, r0 + bge _0811F8C8 + pop {r0} + bx r0 + .align 2, 0 +_0811F8D4: .4byte 0x0000ffff + thumb_func_end sub_811F8BC + + thumb_func_start sub_811F8D8 +sub_811F8D8: @ 811F8D8 + push {r4,r5,lr} + asrs r4, r0, 9 + movs r1, 0x7F + ldr r5, _0811F900 + ands r5, r0 + ands r4, r1 + adds r0, r4, 0 + bl sub_811EA28 + lsls r0, 24 + cmp r0, 0 + beq _0811F904 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811F764 + lsls r0, 24 + lsrs r0, 24 + b _0811F906 + .align 2, 0 +_0811F900: .4byte 0x000001ff +_0811F904: + movs r0, 0 +_0811F906: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811F8D8 + + thumb_func_start sub_811F90C +sub_811F90C: @ 811F90C + ldr r1, _0811F914 + str r0, [r1] + bx lr + .align 2, 0 +_0811F914: .4byte 0x0203a124 + thumb_func_end sub_811F90C + + thumb_func_start sub_811F918 +sub_811F918: @ 811F918 + push {lr} + sub sp, 0x4 + ldr r0, _0811F950 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r3, _0811F954 + ldr r2, [r3] + ldr r1, [r0] + str r1, [r2, 0x2C] + ldr r0, [r0, 0x4] + str r0, [r2, 0x30] + ldr r0, _0811F958 + adds r2, r0 + movs r1, 0 + strb r1, [r2] + mov r0, sp + strh r1, [r0] + ldr r1, [r3] + adds r1, 0x34 + ldr r2, _0811F95C + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0811F950: .4byte 0x03005d90 +_0811F954: .4byte 0x0203a124 +_0811F958: .4byte 0x000010b4 +_0811F95C: .4byte 0x01000800 + thumb_func_end sub_811F918 + + thumb_func_start sub_811F960 +sub_811F960: @ 811F960 + push {r4-r7,lr} + ldr r0, _0811F980 + ldr r1, [r0] + ldr r2, _0811F984 + adds r0, r1, r2 + ldrb r2, [r0] + lsls r0, r2, 8 + adds r0, 0x34 + adds r5, r1, r0 + cmp r2, 0xD + beq _0811FA30 + cmp r2, 0xD + bgt _0811F988 + cmp r2, 0 + beq _0811F98E + b _0811F9D8 + .align 2, 0 +_0811F980: .4byte 0x0203a124 +_0811F984: .4byte 0x000010b4 +_0811F988: + cmp r2, 0xE + beq _0811FA7C + b _0811F9D8 +_0811F98E: + ldr r0, [r1, 0x2C] + adds r1, r5, 0 + movs r2, 0x8 + bl CpuFastSet + movs r4, 0 + adds r7, r5, 0 + adds r7, 0xE0 +_0811F99E: + ldr r6, _0811F9D0 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0x20 + adds r4, 0x1 + lsls r1, r4, 5 + adds r1, r5, r1 + movs r2, 0x8 + bl CpuFastSet + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x5 + bls _0811F99E + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0x40 + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + ldr r1, [r6] + ldr r0, _0811F9D4 + adds r1, r0 + b _0811FA1E + .align 2, 0 +_0811F9D0: .4byte 0x0203a124 +_0811F9D4: .4byte 0x000010b4 +_0811F9D8: + ldr r0, _0811FA28 + ldr r0, [r0] + ldr r0, [r0, 0x2C] + adds r0, 0x60 + adds r1, r5, 0 + movs r2, 0x8 + bl CpuFastSet + movs r4, 0 + adds r7, r5, 0 + adds r7, 0xE0 +_0811F9EE: + ldr r6, _0811FA28 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0x80 + adds r4, 0x1 + lsls r1, r4, 5 + adds r1, r5, r1 + movs r2, 0x8 + bl CpuFastSet + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x5 + bls _0811F9EE + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0xA0 + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + ldr r1, [r6] + ldr r2, _0811FA2C + adds r1, r2 +_0811FA1E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0811FA88 + .align 2, 0 +_0811FA28: .4byte 0x0203a124 +_0811FA2C: .4byte 0x000010b4 +_0811FA30: + ldr r0, [r1, 0x2C] + adds r0, 0xC0 + adds r1, r5, 0 + movs r2, 0x8 + bl CpuFastSet + movs r4, 0 + adds r7, r5, 0 + adds r7, 0xE0 +_0811FA42: + ldr r6, _0811FA80 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0xE0 + adds r4, 0x1 + lsls r1, r4, 5 + adds r1, r5, r1 + movs r2, 0x8 + bl CpuFastSet + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x5 + bls _0811FA42 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + ldr r1, [r6] + ldr r2, _0811FA84 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0811FA7C: + movs r0, 0 + b _0811FA8A + .align 2, 0 +_0811FA80: .4byte 0x0203a124 +_0811FA84: .4byte 0x000010b4 +_0811FA88: + movs r0, 0x1 +_0811FA8A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_811F960 + + thumb_func_start sub_811FA90 +sub_811FA90: @ 811FA90 + push {lr} + bl sub_811F918 +_0811FA96: + bl sub_811F960 + lsls r0, 24 + cmp r0, 0 + bne _0811FA96 + pop {r0} + bx r0 + thumb_func_end sub_811FA90 + + thumb_func_start sub_811FAA4 +sub_811FAA4: @ 811FAA4 + push {r4-r7,lr} + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r2, _0811FAF4 + ldr r3, [r2] + movs r1, 0 + strb r1, [r3, 0x5] + ldr r1, [r2] + strb r0, [r1, 0x4] + movs r3, 0 + adds r7, r2, 0 + adds r4, r7, 0 + movs r2, 0x1 +_0811FAC2: + ldr r0, [r4] + adds r1, r0, 0x6 + adds r1, r3 + ldrb r0, [r0, 0x4] + asrs r0, r3 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _0811FAC2 + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, r6, 16 + asrs r1, 16 + ldr r3, [r7] + ldrh r2, [r3] + ldrh r3, [r3, 0x2] + bl sub_811FC80 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811FAF4: .4byte 0x0203a124 + thumb_func_end sub_811FAA4 + + thumb_func_start sub_811FAF8 +sub_811FAF8: @ 811FAF8 + push {r4-r7,lr} + movs r5, 0 + ldr r4, _0811FBA0 +_0811FAFE: + ldr r0, [r4] + ldrh r0, [r0] + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + bl gpu_tile_obj_free_by_tag + ldr r0, [r4] + ldrh r0, [r0, 0x2] + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_free_tag + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _0811FAFE + movs r5, 0 + ldr r6, _0811FBA0 +_0811FB28: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0xC + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _0811FB9A + bl obj_delete_and_free_tiles + ldr r0, [r6] + adds r0, 0xC + adds r0, r4 + movs r1, 0 + str r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _0811FB28 + movs r5, 0 + ldr r6, _0811FBA0 +_0811FB52: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0x14 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _0811FB9A + bl obj_delete_and_free_tiles + ldr r0, [r6] + adds r0, 0x14 + adds r0, r4 + movs r7, 0 + str r7, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _0811FB52 + ldr r4, _0811FBA0 + ldr r0, [r4] + ldr r0, [r0, 0x24] + cmp r0, 0 + beq _0811FB8A + bl obj_delete_and_free_tiles + ldr r0, [r4] + str r7, [r0, 0x24] +_0811FB8A: + ldr r0, [r4] + ldr r0, [r0, 0x28] + cmp r0, 0 + beq _0811FB9A + bl obj_delete_and_free_tiles + ldr r0, [r4] + str r7, [r0, 0x28] +_0811FB9A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811FBA0: .4byte 0x0203a124 + thumb_func_end sub_811FAF8 + + thumb_func_start sub_811FBA4 +sub_811FBA4: @ 811FBA4 + push {r4,r5,lr} + ldr r0, _0811FBD4 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _0811FBDC + movs r0, 0x5 + bl audio_play + ldr r2, _0811FBD8 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + cmp r0, 0 + bge _0811FC64 + ldr r1, [r2] + movs r0, 0x5 + strb r0, [r1, 0x5] + b _0811FC64 + .align 2, 0 +_0811FBD4: .4byte 0x030022c0 +_0811FBD8: .4byte 0x0203a124 +_0811FBDC: + movs r0, 0x80 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0811FC0C + movs r0, 0x5 + bl audio_play + ldr r2, _0811FC08 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x5 + ble _0811FC64 + ldr r0, [r2] + strb r5, [r0, 0x5] + b _0811FC64 + .align 2, 0 +_0811FC08: .4byte 0x0203a124 +_0811FC0C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811FC68 + movs r0, 0x5 + bl audio_play + ldr r2, _0811FC3C + ldr r0, [r2] + movs r1, 0x5 + ldrsb r1, [r0, r1] + cmp r1, 0x4 + beq _0811FC40 + cmp r1, 0x5 + beq _0811FC76 + adds r0, 0x6 + adds r1, r0, r1 + movs r2, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _0811FC62 + movs r2, 0x1 + b _0811FC62 + .align 2, 0 +_0811FC3C: .4byte 0x0203a124 +_0811FC40: + strb r4, [r0, 0x4] + movs r3, 0 + adds r4, r2, 0 +_0811FC46: + ldr r2, [r4] + adds r0, r2, 0x6 + adds r0, r3 + ldrb r0, [r0] + lsls r0, r3 + ldrb r1, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _0811FC46 + b _0811FC76 +_0811FC62: + strb r2, [r1] +_0811FC64: + movs r0, 0x1 + b _0811FC78 +_0811FC68: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811FC64 + movs r0, 0x5 + bl audio_play +_0811FC76: + movs r0, 0 +_0811FC78: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811FBA4 + + thumb_func_start sub_811FC80 +sub_811FC80: @ 811FC80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r4, _0811FE78 + ldr r0, [r4] + adds r0, 0x34 + str r0, [sp, 0x18] + add r1, sp, 0x1C + movs r7, 0 + movs r0, 0x80 + lsls r0, 5 + strh r0, [r1] + mov r0, sp + adds r0, 0x1E + strh r5, [r0] + add r1, sp, 0x20 + ldr r0, _0811FE7C + str r0, [sp, 0x20] + movs r0, 0xC8 + lsls r0, 2 + strh r0, [r1, 0x4] + adds r0, r5, 0x1 + strh r0, [r1, 0x6] + add r0, sp, 0x28 + movs r1, 0 + movs r2, 0x8 + bl memset + add r2, sp, 0x18 + mov r10, r2 + mov r0, sp + mov r1, r10 + movs r2, 0x18 + bl memcpy + ldr r0, [r4] + ldr r0, [r0, 0x30] + str r0, [sp, 0x30] + add r0, sp, 0x34 + strh r6, [r0] + add r1, sp, 0x38 + ldr r0, _0811FE80 + str r0, [sp, 0x38] + adds r0, r6, 0x1 + strh r0, [r1, 0x4] + add r0, sp, 0x40 + movs r1, 0 + movs r2, 0x8 + bl memset + add r4, sp, 0x30 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0x18 + bl memcpy + strh r5, [r4] + strh r6, [r4, 0x2] + ldr r0, _0811FE84 + str r0, [r4, 0x4] + ldr r0, _0811FE88 + str r0, [r4, 0x8] + str r7, [r4, 0xC] + ldr r0, _0811FE8C + str r0, [r4, 0x10] + ldr r0, _0811FE90 + str r0, [r4, 0x14] + mov r0, sp + bl gpu_tile_obj_alloc_and_load_multiple + mov r0, r10 + bl gpu_pal_obj_alloc_and_load_multiple + movs r5, 0 + mov r3, r8 + lsls r3, 16 + mov r8, r3 + movs r0, 0x80 + lsls r0, 14 + add r0, r8 + mov r10, r0 + mov r1, r8 + str r1, [sp, 0x48] + mov r2, r9 + lsls r2, 16 + mov r9, r2 + movs r7, 0x80 + lsls r7, 14 + add r7, r9 + mov r3, r9 + str r3, [sp, 0x4C] +_0811FD58: + adds r0, r4, 0 + mov r2, r10 + asrs r1, r2, 16 + asrs r2, r7, 16 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + bne _0811FD70 + b _0811FEFC +_0811FD70: + ldr r6, _0811FE78 + ldr r2, [r6] + lsls r0, r5, 2 + adds r2, 0xC + adds r2, r0 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, _0811FE94 + adds r0, r1 + str r0, [r2] + lsls r1, r5, 24 + lsrs r1, 24 + bl obj_anim_image_start + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _0811FD58 + ldr r0, [r6] + ldr r1, [r0, 0x10] + ldr r3, [sp, 0x4C] + asrs r0, r3, 16 + adds r0, 0x60 + strh r0, [r1, 0x22] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + ldr r0, _0811FE98 + str r0, [r4, 0x8] + ldr r0, _0811FE9C + str r0, [r4, 0x14] + ldr r0, _0811FEA0 + str r0, [r4, 0x4] + movs r5, 0 + ldr r0, [sp, 0x48] + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + mov r9, r0 +_0811FDC8: + lsls r2, r5, 4 + adds r2, 0x10 + ldr r3, [sp, 0x4C] + asrs r3, 16 + mov r8, r3 + add r2, r8 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + mov r3, r9 + asrs r1, r3, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + bne _0811FDEE + b _0811FF0C +_0811FDEE: + ldr r6, _0811FE78 + ldr r1, [r6] + lsls r0, r5, 2 + adds r1, 0x14 + adds r1, r0 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r7, _0811FE94 + adds r0, r7 + str r0, [r1] + strh r5, [r0, 0x2E] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _0811FDC8 + ldr r0, _0811FEA4 + str r0, [r4, 0x14] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0811FEA8 + ldr r0, [r6] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r7 + str r1, [r0, 0x28] + ldrb r3, [r1, 0x1] + movs r2, 0x3F + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1, 0x1] + ldr r0, [r6] + ldr r1, [r0, 0x28] + ldrb r0, [r1, 0x3] + ands r2, r0 + movs r0, 0x80 + orrs r2, r0 + strb r2, [r1, 0x3] + ldr r0, [r6] + ldr r0, [r0, 0x28] + movs r1, 0x9 + bl obj_anim_image_start + ldr r1, [r6] + ldr r2, [r1, 0x28] + ldr r3, [sp, 0x48] + asrs r0, r3, 16 + adds r0, 0x20 + strh r0, [r2, 0x20] + ldr r2, [r1, 0x28] + mov r0, r8 + adds r0, 0x50 + strh r0, [r2, 0x22] + ldr r0, [r1, 0x28] + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0 + bl oam_center + b _0811FEAE + .align 2, 0 +_0811FE78: .4byte 0x0203a124 +_0811FE7C: .4byte 0x08dc9628 +_0811FE80: .4byte 0x08dc9608 +_0811FE84: .4byte 0x0859ee7c +_0811FE88: .4byte 0x0859ef14 +_0811FE8C: .4byte 0x082ec6a8 +_0811FE90: .4byte nullsub_47 + 1 +_0811FE94: .4byte 0x02020630 +_0811FE98: .4byte 0x0859eedc +_0811FE9C: .4byte sub_811FF40 + 1 +_0811FEA0: .4byte 0x0859ee84 +_0811FEA4: .4byte nullsub_12 + 1 +_0811FEA8: + ldr r1, [r6] + movs r0, 0 + str r0, [r1, 0x28] +_0811FEAE: + ldr r0, _0811FEF0 + str r0, [r4, 0x14] + ldr r0, [sp, 0x48] + movs r2, 0xC0 + lsls r2, 12 + adds r1, r0, r2 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0811FF20 + ldr r0, _0811FEF4 + ldr r2, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + ldr r0, _0811FEF8 + adds r1, r0 + str r1, [r2, 0x24] + ldr r3, [sp, 0x4C] + asrs r0, r3, 16 + adds r0, 0x10 + strh r0, [r1, 0x2E] + ldr r0, [r2, 0x24] + movs r1, 0x8 + bl obj_anim_image_start + b _0811FF28 + .align 2, 0 +_0811FEF0: .4byte sub_811FF7C + 1 +_0811FEF4: .4byte 0x0203a124 +_0811FEF8: .4byte 0x02020630 +_0811FEFC: + ldr r0, _0811FF08 + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, 0xC + b _0811FF14 + .align 2, 0 +_0811FF08: .4byte 0x0203a124 +_0811FF0C: + ldr r0, _0811FF1C + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, 0x14 +_0811FF14: + adds r0, r1 + movs r1, 0 + str r1, [r0] + b _0811FF28 + .align 2, 0 +_0811FF1C: .4byte 0x0203a124 +_0811FF20: + ldr r0, _0811FF38 + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x24] +_0811FF28: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0811FF38: .4byte 0x0203a124 + thumb_func_end sub_811FC80 + + thumb_func_start nullsub_47 +nullsub_47: @ 811FF3C + bx lr + thumb_func_end nullsub_47 + + thumb_func_start sub_811FF40 +sub_811FF40: @ 811FF40 + push {lr} + adds r2, r0, 0 + ldr r0, _0811FF68 + ldr r0, [r0] + movs r3, 0x2E + ldrsh r1, [r2, r3] + adds r0, 0x6 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0811FF6C + lsls r1, 1 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl obj_anim_image_start + b _0811FF76 + .align 2, 0 +_0811FF68: .4byte 0x0203a124 +_0811FF6C: + lsls r1, 25 + lsrs r1, 24 + adds r0, r2, 0 + bl obj_anim_image_start +_0811FF76: + pop {r0} + bx r0 + thumb_func_end sub_811FF40 + + thumb_func_start sub_811FF7C +sub_811FF7C: @ 811FF7C + ldr r1, _0811FF90 + ldr r1, [r1] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 4 + ldrh r2, [r0, 0x2E] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .align 2, 0 +_0811FF90: .4byte 0x0203a124 + thumb_func_end sub_811FF7C + + thumb_func_start sub_811FF94 +sub_811FF94: @ 811FF94 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r2, 0 + bne _0811FFA4 + ldr r2, _0811FFB0 +_0811FFA4: + movs r3, 0x10 + bl sub_811FFD4 + pop {r1} + bx r1 + .align 2, 0 +_0811FFB0: .4byte 0x0859e65c + thumb_func_end sub_811FF94 + + thumb_func_start sub_811FFB4 +sub_811FFB4: @ 811FFB4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r2, 0 + bne _0811FFC4 + ldr r2, _0811FFD0 +_0811FFC4: + movs r3, 0x1 + bl sub_811FFD4 + pop {r1} + bx r1 + .align 2, 0 +_0811FFD0: .4byte 0x0859e65c + thumb_func_end sub_811FFB4 + + thumb_func_start sub_811FFD4 +sub_811FFD4: @ 811FFD4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x28 + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r4, _08120050 + str r4, [sp, 0x18] + movs r4, 0x80 + add r5, sp, 0x18 + lsrs r6, r0, 16 + orrs r0, r4 + str r0, [r5, 0x4] + str r2, [sp, 0x20] + ldr r0, _08120054 + mov r8, r0 + add r4, sp, 0x20 + ldr r0, [r4, 0x4] + mov r2, r8 + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + movs r2, 0 + strh r6, [r0] + strh r1, [r0, 0x2] + ldr r0, _08120058 + str r0, [sp, 0x4] + ldr r0, _0812005C + str r0, [sp, 0x8] + str r2, [sp, 0xC] + ldr r0, _08120060 + str r0, [sp, 0x10] + ldr r0, _08120064 + str r0, [sp, 0x14] + lsls r3, 23 + lsrs r3, 16 + ldr r0, [r5, 0x4] + mov r1, r8 + ands r0, r1 + orrs r0, r3 + str r0, [r5, 0x4] + adds r0, r5, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + bne _08120068 + movs r0, 0 + b _08120072 + .align 2, 0 +_08120050: .4byte 0x0859e67c +_08120054: .4byte 0xffff0000 +_08120058: .4byte 0x0859ef1c +_0812005C: .4byte 0x0859efa4 +_08120060: .4byte 0x082ec6a8 +_08120064: .4byte nullsub_47 + 1 +_08120068: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08120080 + adds r0, r1 +_08120072: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08120080: .4byte 0x02020630 + thumb_func_end sub_811FFD4 + + thumb_func_start sub_8120084 +sub_8120084: @ 8120084 + push {lr} + lsls r0, 24 + lsrs r0, 17 + ldr r2, _0812009C + adds r0, r2 + movs r2, 0x80 + movs r3, 0x10 + bl dma3_transfer_queue_add_copy + pop {r0} + bx r0 + .align 2, 0 +_0812009C: .4byte 0x0859e67c + thumb_func_end sub_8120084 + + thumb_func_start sub_81200A0 +sub_81200A0: @ 81200A0 + push {r4,lr} + ldr r0, _081200E0 + ldr r2, [r0] + ldr r1, _081200E4 + adds r0, r2, r1 + movs r1, 0 + strb r1, [r0] + ldr r3, _081200E8 + adds r0, r2, r3 + strb r1, [r0] + ldr r0, _081200EC + ldrb r1, [r0] + adds r3, 0x1 + adds r0, r2, r3 + strb r1, [r0] + movs r3, 0 + ldr r0, _081200F0 + adds r2, r0 + ldr r4, _081200F4 +_081200C6: + lsls r0, r3, 1 + adds r1, r2, r0 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _081200C6 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081200E0: .4byte 0x03005d8c +_081200E4: .4byte 0x00002e28 +_081200E8: .4byte 0x00002e51 +_081200EC: .4byte 0x082e9531 +_081200F0: .4byte 0x00002e2a +_081200F4: .4byte 0x0859efe4 + thumb_func_end sub_81200A0 + + thumb_func_start sub_81200F8 +sub_81200F8: @ 81200F8 + ldr r0, _08120110 + ldr r1, [r0] + ldr r0, _08120114 + adds r1, r0 + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + strb r2, [r1, 0x1] + ldr r0, _08120118 + ldrb r0, [r0] + strb r0, [r1, 0x2] + bx lr + .align 2, 0 +_08120110: .4byte 0x03005d8c +_08120114: .4byte 0x00002e28 +_08120118: .4byte 0x082e9531 + thumb_func_end sub_81200F8 + + thumb_func_start sub_812011C +sub_812011C: @ 812011C + push {lr} + bl sub_8120E08 + pop {r0} + bx r0 + thumb_func_end sub_812011C + + thumb_func_start sub_8120128 +sub_8120128: @ 8120128 + ldr r0, _08120144 + ldr r1, [r0] + ldr r0, _08120148 + adds r2, r1, r0 + movs r3, 0 + movs r0, 0x4 + strb r0, [r2] + strb r3, [r2, 0x1] + ldr r0, _0812014C + ldrb r0, [r0] + ldr r2, _08120150 + adds r1, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_08120144: .4byte 0x03005d8c +_08120148: .4byte 0x00002e28 +_0812014C: .4byte 0x082e9531 +_08120150: .4byte 0x00002e48 + thumb_func_end sub_8120128 + + thumb_func_start sub_8120154 +sub_8120154: @ 8120154 + push {lr} + bl sub_81339F8 + pop {r0} + bx r0 + thumb_func_end sub_8120154 + + thumb_func_start sub_8120160 +sub_8120160: @ 8120160 + push {lr} + ldr r0, _08120188 + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 17 + cmp r0, 0x4 + bhi _081201C0 + lsls r0, 2 + ldr r1, _0812018C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08120188: .4byte 0x03005d90 +_0812018C: .4byte _08120190 + .align 2, 0 +_08120190: + .4byte _081201A4 + .4byte _081201AA + .4byte _081201B0 + .4byte _081201B6 + .4byte _081201BC +_081201A4: + bl sub_81200A0 + b _081201C0 +_081201AA: + bl sub_81200F8 + b _081201C0 +_081201B0: + bl sub_8120154 + b _081201C0 +_081201B6: + bl sub_812011C + b _081201C0 +_081201BC: + bl sub_8120128 +_081201C0: + bl sub_8120B5C + pop {r0} + bx r0 + thumb_func_end sub_8120160 + + thumb_func_start sub_81201C8 +sub_81201C8: @ 81201C8 + ldr r0, _081201D4 + ldr r0, [r0] + ldr r1, _081201D8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081201D4: .4byte 0x03005d8c +_081201D8: .4byte 0x00002e28 + thumb_func_end sub_81201C8 + + thumb_func_start sub_81201DC +sub_81201DC: @ 81201DC + push {r4,lr} + ldr r4, _081201F0 + bl sub_81201C8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081201F0: .4byte 0x020375f0 + thumb_func_end sub_81201DC + + thumb_func_start sub_81201F4 +sub_81201F4: @ 81201F4 + ldr r1, _08120204 + ldr r0, _08120208 + ldr r0, [r0] + ldr r2, _0812020C + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_08120204: .4byte 0x020375f0 +_08120208: .4byte 0x03005d8c +_0812020C: .4byte 0x00002e51 + thumb_func_end sub_81201F4 + + thumb_func_start sub_8120210 +sub_8120210: @ 8120210 + push {r4-r6,lr} + ldr r0, _0812026C + ldr r4, [r0] + ldr r0, _08120270 + adds r6, r4, r0 + ldr r1, _08120274 + adds r0, r4, r1 + ldr r5, _08120278 + ldr r1, [r5] + bl gf_strcpy + movs r2, 0 + ldr r0, _0812027C + adds r4, r0 +_0812022C: + adds r1, r4, r2 + ldr r0, [r5] + adds r0, 0xA + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3 + bls _0812022C + movs r2, 0 + adds r5, r6, 0 + adds r5, 0x29 + adds r3, r6, 0x2 + adds r4, r6, 0 + adds r4, 0xE +_0812024E: + lsls r0, r2, 1 + adds r1, r3, r0 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0812024E + movs r0, 0x1 + strb r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812026C: .4byte 0x03005d8c +_08120270: .4byte 0x00002e28 +_08120274: .4byte 0x00002e42 +_08120278: .4byte 0x03005d90 +_0812027C: .4byte 0x00002e4d + thumb_func_end sub_8120210 + + thumb_func_start sub_8120280 +sub_8120280: @ 8120280 + push {r4-r7,lr} + ldr r0, _0812032C + ldr r1, [r0] + ldr r0, _08120330 + ldrh r0, [r0] + ldr r2, _08120334 + adds r5, r1, r2 + cmp r0, 0 + bne _08120296 + ldr r0, _08120338 + adds r5, r1, r0 +_08120296: + ldr r2, _0812033C + adds r4, r2, 0 + movs r6, 0 +_0812029C: + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r2, 0 + bl sub_811EBBC + adds r2, r0, 0 + adds r7, r6, 0x1 + cmp r2, r4 + beq _081202BE + movs r1, 0x37 +_081202B0: + ldrb r0, [r4] + cmp r0, 0 + bne _081202B8 + strb r1, [r4] +_081202B8: + adds r4, 0x1 + cmp r2, r4 + bne _081202B0 +_081202BE: + adds r4, 0x1 + movs r0, 0 + strb r0, [r2] + adds r2, 0x1 + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r2, 0 + bl sub_811EBBC + adds r2, r0, 0 + cmp r2, r4 + beq _081202E6 + movs r1, 0x37 +_081202D8: + ldrb r0, [r4] + cmp r0, 0 + bne _081202E0 + strb r1, [r4] +_081202E0: + adds r4, 0x1 + cmp r2, r4 + bne _081202D8 +_081202E6: + adds r4, 0x1 + movs r0, 0xFE + strb r0, [r2] + adds r2, 0x1 + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r2, 0 + bl sub_811EBBC + adds r2, r0, 0 + cmp r2, r4 + beq _0812030E + movs r1, 0x37 +_08120300: + ldrb r0, [r4] + cmp r0, 0 + bne _08120308 + strb r1, [r4] +_08120308: + adds r4, 0x1 + cmp r2, r4 + bne _08120300 +_0812030E: + cmp r6, 0 + bne _0812031E + movs r0, 0xFC + strb r0, [r2] + adds r2, 0x1 + movs r0, 0xF + strb r0, [r2] + adds r2, 0x1 +_0812031E: + lsls r0, r7, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _0812029C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812032C: .4byte 0x03005d8c +_08120330: .4byte 0x020375e0 +_08120334: .4byte 0x00002e36 +_08120338: .4byte 0x00002e2a +_0812033C: .4byte 0x02021fc4 + thumb_func_end sub_8120280 + + thumb_func_start sub_8120340 +sub_8120340: @ 8120340 + push {lr} + ldr r0, _08120354 + ldrb r0, [r0] + bl sub_81206C0 + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .align 2, 0 +_08120354: .4byte 0x020375e0 + thumb_func_end sub_8120340 + + thumb_func_start sub_8120358 +sub_8120358: @ 8120358 + ldr r1, _08120368 + ldr r0, _0812036C + ldr r0, [r0] + ldr r2, _08120370 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r1] + bx lr + .align 2, 0 +_08120368: .4byte 0x020375f0 +_0812036C: .4byte 0x03005d8c +_08120370: .4byte 0x00002e28 + thumb_func_end sub_8120358 + + thumb_func_start sub_8120374 +sub_8120374: @ 8120374 + ldr r0, _08120384 + ldr r0, [r0] + ldr r1, _08120388 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .align 2, 0 +_08120384: .4byte 0x03005d8c +_08120388: .4byte 0x00002e28 + thumb_func_end sub_8120374 + + thumb_func_start sub_812038C +sub_812038C: @ 812038C + push {lr} + bl sub_811F01C + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _081203A4 + cmp r1, r0 + bne _081203AC + ldr r1, _081203A8 + movs r0, 0 + b _081203B6 + .align 2, 0 +_081203A4: .4byte 0x0000ffff +_081203A8: .4byte 0x020375f0 +_081203AC: + ldr r0, _081203BC + bl sub_811EBBC + ldr r1, _081203C0 + movs r0, 0x1 +_081203B6: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081203BC: .4byte 0x02021cc4 +_081203C0: .4byte 0x020375f0 + thumb_func_end sub_812038C + + thumb_func_start sub_81203C4 +sub_81203C4: @ 81203C4 + push {lr} + ldr r0, _081203E0 + ldr r0, [r0] + ldr r1, _081203E4 + adds r2, r0, r1 + ldrb r0, [r2, 0x1] + cmp r0, 0xA + bne _081203EC + ldr r1, _081203E8 + movs r0, 0 + strh r0, [r1] + strb r0, [r2, 0x1] + b _081203F2 + .align 2, 0 +_081203E0: .4byte 0x03005d8c +_081203E4: .4byte 0x00002e28 +_081203E8: .4byte 0x020375f0 +_081203EC: + ldr r1, _081203F8 + movs r0, 0x1 + strh r0, [r1] +_081203F2: + pop {r0} + bx r0 + .align 2, 0 +_081203F8: .4byte 0x020375f0 + thumb_func_end sub_81203C4 + + thumb_func_start sub_81203FC +sub_81203FC: @ 81203FC + push {r4-r6,lr} + ldr r0, _08120460 + ldr r4, [r0] + ldr r0, _08120464 + adds r5, r4, r0 + ldrb r0, [r5, 0x1] + cmp r0, 0 + bne _08120410 + bl sub_81204DC +_08120410: + ldrb r0, [r5, 0x1] + lsls r0, 1 + ldr r1, _08120468 + adds r6, r4, r1 + adds r0, r6, r0 + ldrh r1, [r0] + ldr r0, _0812046C + cmp r1, r0 + beq _08120480 + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x7 + ands r4, r0 + ldr r0, _08120470 + ldrb r1, [r5, 0x1] + lsls r1, 1 + adds r1, r6, r1 + ldrh r1, [r1] + bl sub_811EBBC + adds r2, r0, 0 + ldr r1, _08120474 + bl gf_strcpy + adds r2, r0, 0 + ldr r0, _08120478 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r2, 0 + bl gf_strcpy + adds r2, r0, 0 + ldr r1, _0812047C + bl gf_strcpy + b _081204A2 + .align 2, 0 +_08120460: .4byte 0x03005d8c +_08120464: .4byte 0x00002e28 +_08120468: .4byte 0x00002e2c +_0812046C: .4byte 0x0000ffff +_08120470: .4byte 0x02021fc4 +_08120474: .4byte 0x082942fd +_08120478: .4byte 0x0859eff0 +_0812047C: .4byte 0x08294301 +_08120480: + ldr r0, _081204BC + ldr r3, _081204C0 + ldrb r2, [r5, 0x2] + adds r1, r2, 0x1 + strb r1, [r5, 0x2] + lsls r2, 24 + lsrs r2, 24 + movs r6, 0xB9 + lsls r6, 6 + adds r1, r4, r6 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl gf_strcpy +_081204A2: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _081204C4 + movs r0, 0xA + b _081204C8 + .align 2, 0 +_081204BC: .4byte 0x02021fc4 +_081204C0: .4byte 0x0859f010 +_081204C4: + ldrb r0, [r5, 0x1] + adds r0, 0x1 +_081204C8: + strb r0, [r5, 0x1] + ldr r1, _081204D8 + movs r0, 0x1 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081204D8: .4byte 0x020375f0 + thumb_func_end sub_81203FC + + thumb_func_start sub_81204DC +sub_81204DC: @ 81204DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, _081205AC + ldr r4, [r0] + ldr r0, _081205B0 + adds r0, r4, r0 + str r0, [sp, 0x18] + ldr r1, _081205B4 + mov r0, sp + movs r2, 0x18 + bl memcpy + movs r5, 0 + movs r1, 0x2 + add r1, sp + mov r8, r1 + movs r2, 0xB9 + lsls r2, 6 + adds r3, r4, r2 + adds r1, r3, 0 +_0812050C: + adds r0, r3, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _0812050C + movs r5, 0 + ldr r3, [sp, 0x18] + adds r3, 0x4 + mov r9, r3 + adds r6, r1, 0 +_08120524: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r4, r5, 0x1 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r6, r5 + ldrb r7, [r2] + adds r1, r6, r1 + ldrb r0, [r1] + strb r0, [r2] + strb r7, [r1] + lsls r4, 16 + lsrs r5, r4, 16 + cmp r5, 0x7 + bls _08120524 + movs r0, 0 + mov r10, r0 + movs r5, 0 +_08120552: + lsls r4, r5, 2 + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl start_menu_is_selected_item_valid + add r4, r8 + strh r0, [r4] + add r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _08120552 + movs r0, 0 + ldr r2, [sp, 0x18] + strb r0, [r2, 0x2] + movs r7, 0 + movs r5, 0 +_0812057E: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x2 + bhi _081205BC + cmp r7, 0x7 + bhi _081205BC + lsls r0, r5, 1 + add r0, r9 + ldr r1, _081205B8 + strh r1, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, r5, 0x1 + b _0812060E + .align 2, 0 +_081205AC: .4byte 0x03005d8c +_081205B0: .4byte 0x00002e28 +_081205B4: .4byte 0x0859f030 +_081205B8: .4byte 0x0000ffff +_081205BC: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + adds r4, r5, 0x1 + lsls r6, r5, 1 + cmp r5, 0x5 + bhi _081205F8 + mov r3, r8 + ldrh r0, [r3] + b _081205EE +_081205DE: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r5, 0x5 + bhi _081205F8 + lsls r0, r1, 2 + adds r0, r3, r0 + ldrh r0, [r0] +_081205EE: + subs r0, r2, r0 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, 0 + bgt _081205DE +_081205F8: + cmp r1, 0x6 + bne _081205FE + movs r1, 0 +_081205FE: + lsls r0, r1, 2 + add r0, sp + ldrh r0, [r0] + bl sub_811EE90 + mov r2, r9 + adds r1, r2, r6 + strh r0, [r1] +_0812060E: + lsls r0, r4, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _0812057E + 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_81204DC + + thumb_func_start sub_8120628 +sub_8120628: @ 8120628 + ldr r0, _08120638 + ldr r0, [r0] + ldr r1, _0812063C + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_08120638: .4byte 0x03005d8c +_0812063C: .4byte 0x00002e51 + thumb_func_end sub_8120628 + + thumb_func_start sub_8120640 +sub_8120640: @ 8120640 + ldr r0, _08120650 + ldr r0, [r0] + ldr r1, _08120654 + adds r0, r1 + movs r1, 0 + strb r1, [r0, 0x1] + bx lr + .align 2, 0 +_08120650: .4byte 0x03005d8c +_08120654: .4byte 0x00002e28 + thumb_func_end sub_8120640 + + thumb_func_start sub_8120658 +sub_8120658: @ 8120658 + push {lr} + bl sub_8133A60 + pop {r0} + bx r0 + thumb_func_end sub_8120658 + + thumb_func_start sub_8120664 +sub_8120664: @ 8120664 + push {lr} + bl sub_8120E50 + pop {r0} + bx r0 + thumb_func_end sub_8120664 + + thumb_func_start sub_8120670 +sub_8120670: @ 8120670 + push {lr} + bl sub_81201C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081206B6 + lsls r0, 2 + ldr r1, _08120688 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08120688: .4byte _0812068C + .align 2, 0 +_0812068C: + .4byte _081206A0 + .4byte _081206A6 + .4byte _081206B2 + .4byte _081206AC + .4byte _081206B6 +_081206A0: + bl sub_8120628 + b _081206B6 +_081206A6: + bl sub_8120640 + b _081206B6 +_081206AC: + bl sub_8120664 + b _081206B6 +_081206B2: + bl sub_8120658 +_081206B6: + bl sub_8120B5C + pop {r0} + bx r0 + thumb_func_end sub_8120670 + + thumb_func_start sub_81206C0 +sub_81206C0: @ 81206C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081206E8 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081206EC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x12] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081206E8: .4byte sub_8120944 + 1 +_081206EC: .4byte 0x03005e00 + thumb_func_end sub_81206C0 + + thumb_func_start sub_81206F0 +sub_81206F0: @ 81206F0 + ldr r1, _081206F8 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_081206F8: .4byte 0x03002f84 + thumb_func_end sub_81206F0 + + thumb_func_start sub_81206FC +sub_81206FC: @ 81206FC + ldr r1, _08120704 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_08120704: .4byte 0x03002f84 + thumb_func_end sub_81206FC + + thumb_func_start sub_8120708 +sub_8120708: @ 8120708 + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + ldr r0, _08120740 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + ldr r0, _08120744 + strb r4, [r0] + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08120740: .4byte sub_81206FC + 1 +_08120744: .4byte 0x03002f84 + thumb_func_end sub_8120708 + + thumb_func_start sub_8120748 +sub_8120748: @ 8120748 + push {r4-r6,lr} + adds r6, r1, 0 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bls _08120756 + b _08120938 +_08120756: + lsls r0, 2 + ldr r1, _08120760 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08120760: .4byte _08120764 + .align 2, 0 +_08120764: + .4byte _0812077C + .4byte _08120938 + .4byte _081207BC + .4byte _081207F8 + .4byte _081207F8 + .4byte _08120938 +_0812077C: + ldr r0, _081207AC + ldr r2, [r0] + ldr r0, _081207B0 + ldrh r0, [r0] + ldr r3, _081207B4 + adds r1, r2, r3 + cmp r0, 0 + bne _08120790 + ldr r0, _081207B8 + adds r1, r2, r0 +_08120790: + adds r2, r1, 0 + adds r1, r6, 0 + adds r1, 0xC + movs r3, 0x5 +_08120798: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08120798 + movs r0, 0 + strb r0, [r6] + b _08120938 + .align 2, 0 +_081207AC: .4byte 0x03005d8c +_081207B0: .4byte 0x020375e0 +_081207B4: .4byte 0x00002e36 +_081207B8: .4byte 0x00002e2a +_081207BC: + ldrb r1, [r6] + lsls r1, 1 + adds r0, r6, 0 + adds r0, 0xC + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + bl sub_817C7F4 + str r0, [r6, 0x30] + movs r1, 0x3 + ands r1, r4 + lsrs r4, 3 + movs r0, 0x1 + ands r4, r0 + adds r1, r4 + adds r0, r6, 0 + bl sub_817C858 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldr r0, [r6, 0x30] + ldrb r0, [r0] + cmp r0, 0xFF + beq _081207F4 + movs r0, 0 + b _08120936 +_081207F4: + movs r0, 0x3 + b _0812091A +_081207F8: + ldrb r3, [r6, 0x1] + lsls r1, r3, 3 + ldr r0, [r6, 0x30] + adds r2, r0, r1 + ldrb r1, [r6, 0x3] + cmp r1, 0x1 + beq _081208A0 + cmp r1, 0x1 + bgt _08120810 + cmp r1, 0 + beq _0812081C + b _08120938 +_08120810: + cmp r1, 0x2 + beq _08120850 + cmp r1, 0x3 + bne _0812081A + b _08120922 +_0812081A: + b _08120938 +_0812081C: + lsls r0, r3, 2 + adds r0, r6, r0 + ldrh r0, [r0, 0x18] + strb r0, [r6, 0x2] + ldrb r0, [r2] + cmp r0, 0x32 + bhi _08120844 + movs r1, 0x3 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x8C + lsls r1, 2 + adds r0, r1 + bl m4aSongNumStart +_08120844: + movs r0, 0x2 + strb r0, [r6, 0x3] + ldrb r0, [r6, 0x2] + subs r0, 0x1 + strb r0, [r6, 0x2] + b _08120938 +_08120850: + movs r0, 0x1 + strb r0, [r6, 0x3] + ldrb r0, [r2] + cmp r0, 0x32 + bhi _08120938 + movs r3, 0x4 + ldrsh r0, [r2, r3] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r6, 0x6] + ldr r4, _08120898 + ldr r5, _0812089C + ldrh r2, [r6, 0x6] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayVolumeControl + ldrb r1, [r6, 0x1] + lsls r1, 2 + adds r1, r6, r1 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1, 0x1A] + adds r0, r1 + strh r0, [r6, 0x8] + movs r3, 0x8 + ldrsh r2, [r6, r3] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayPitchControl + b _08120938 + .align 2, 0 +_08120898: .4byte 0x03007630 +_0812089C: .4byte 0x0000ffff +_081208A0: + ldrh r2, [r6, 0xA] + movs r3, 0xA + ldrsh r0, [r6, r3] + cmp r0, 0xA + ble _081208B0 + ldrh r0, [r6, 0x6] + subs r0, 0x2 + strh r0, [r6, 0x6] +_081208B0: + ands r1, r2 + cmp r1, 0 + beq _081208BC + ldrh r0, [r6, 0x8] + adds r0, 0x40 + b _081208C0 +_081208BC: + ldrh r0, [r6, 0x8] + subs r0, 0x40 +_081208C0: + strh r0, [r6, 0x8] + ldr r4, _08120910 + ldr r5, _08120914 + ldrh r2, [r6, 0x6] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayVolumeControl + movs r0, 0x8 + ldrsh r2, [r6, r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayPitchControl + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + ldrb r0, [r6, 0x2] + subs r0, 0x1 + strb r0, [r6, 0x2] + lsls r0, 24 + cmp r0, 0 + bne _08120938 + ldrb r0, [r6, 0x1] + adds r0, 0x1 + strb r0, [r6, 0x1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08120918 + ldrb r0, [r6, 0x1] + ldr r1, [r6, 0x30] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08120918 + movs r0, 0 + b _08120936 + .align 2, 0 +_08120910: .4byte 0x03007630 +_08120914: .4byte 0x0000ffff +_08120918: + movs r0, 0x3 +_0812091A: + strb r0, [r6, 0x3] + movs r0, 0x2 + strb r0, [r6, 0x2] + b _08120938 +_08120922: + ldrb r0, [r6, 0x2] + subs r0, 0x1 + strb r0, [r6, 0x2] + lsls r0, 24 + cmp r0, 0 + bne _08120938 + ldr r0, _08120940 + bl MPlayStop_rev01 + movs r0, 0x4 +_08120936: + strb r0, [r6, 0x3] +_08120938: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08120940: .4byte 0x03007630 + thumb_func_end sub_8120748 + + thumb_func_start sub_8120944 +sub_8120944: @ 8120944 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _08120970 + adds r5, r0, r1 + ldr r1, _08120974 + adds r0, r5, 0 + bl sub_8120748 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _08120966 + b _08120B50 +_08120966: + lsls r0, 2 + ldr r1, _08120978 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08120970: .4byte 0x03005e00 +_08120974: .4byte 0x03006130 +_08120978: .4byte _0812097C + .align 2, 0 +_0812097C: + .4byte _08120994 + .4byte _081209B8 + .4byte _081209C8 + .4byte _08120A7E + .4byte _08120B40 + .4byte _08120A6E +_08120994: + bl sub_8120280 + ldr r0, _081209B4 + bl sub_8120708 + movs r0, 0 + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + strh r0, [r5, 0xE] + strh r0, [r5, 0x10] + movs r0, 0x4 + bl sub_80A31E8 + movs r0, 0x1 + b _08120B4E + .align 2, 0 +_081209B4: .4byte 0x02021fc4 +_081209B8: + bl sub_80A3200 + lsls r0, 24 + cmp r0, 0 + bne _081209C4 + b _08120B50 +_081209C4: + movs r0, 0x2 + b _08120B4E +_081209C8: + ldr r0, _081209E4 + ldr r0, [r0] + ldr r2, _081209E8 + adds r4, r0, r2 + movs r0, 0xE + ldrsh r1, [r5, r0] + ldr r0, _081209EC + adds r1, r0 + movs r3, 0 + ldrb r0, [r1] + ldr r7, _081209F0 + ldrh r2, [r5, 0x12] + ldr r6, _081209F4 + b _08120A02 + .align 2, 0 +_081209E4: .4byte 0x03005d8c +_081209E8: .4byte 0x00002e28 +_081209EC: .4byte 0x02021fc4 +_081209F0: .4byte 0x03006130 +_081209F4: .4byte 0x0203a128 +_081209F8: + adds r1, 0x1 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrb r0, [r1] +_08120A02: + cmp r0, 0 + beq _08120A12 + cmp r0, 0xFE + beq _08120A12 + cmp r0, 0xFC + beq _08120A12 + cmp r0, 0xFF + bne _081209F8 +_08120A12: + cmp r2, 0 + bne _08120A20 + movs r2, 0x10 + ldrsh r1, [r5, r2] + lsls r1, 1 + adds r0, r4, 0x2 + b _08120A2A +_08120A20: + movs r0, 0x10 + ldrsh r1, [r5, r0] + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0xE +_08120A2A: + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x3 + ands r1, r0 + lsrs r0, 3 + movs r2, 0x1 + ands r0, r2 + adds r1, r0 + strh r1, [r6] + movs r1, 0x4 + ldrsh r0, [r7, r1] + adds r1, r3, 0 + bl __divsi3 + movs r1, 0 + strh r0, [r7, 0x4] + lsls r0, 16 + cmp r0, 0 + bgt _08120A54 + movs r0, 0x1 + strh r0, [r7, 0x4] +_08120A54: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _08120A66 + movs r0, 0x3 + b _08120A68 +_08120A66: + movs r0, 0x5 +_08120A68: + strh r0, [r5, 0x8] + strh r1, [r5, 0xA] + b _08120B50 +_08120A6E: + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08120B4C + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + b _08120B50 +_08120A7E: + ldr r1, _08120AA8 + movs r2, 0xE + ldrsh r0, [r5, r2] + adds r0, r1 + ldrb r4, [r0] + cmp r4, 0xFF + bne _08120AB0 + movs r0, 0x6 + bl sub_80A3228 + ldr r0, _08120AAC + movs r1, 0x2 + bl sub_82E0308 + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl remove_task + b _08120B50 + .align 2, 0 +_08120AA8: .4byte 0x02021fc4 +_08120AAC: .4byte 0x03007630 +_08120AB0: + cmp r4, 0 + bne _08120AC6 + bl sub_81206F0 + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5, 0x8] + strh r4, [r5, 0xC] + b _08120B50 +_08120AC6: + cmp r4, 0xFE + bne _08120ADA + ldrh r0, [r5, 0xE] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] + b _08120B50 +_08120ADA: + cmp r4, 0xFC + bne _08120AEE + ldrh r0, [r5, 0xE] + adds r0, 0x2 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5, 0x8] + movs r0, 0x8 + strh r0, [r5, 0xC] + b _08120B50 +_08120AEE: + cmp r4, 0x37 + bne _08120B04 + movs r4, 0 + strb r4, [r0] + bl sub_81206F0 + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + strh r4, [r5, 0xC] + b _08120B50 +_08120B04: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08120B20 + cmp r0, 0x1 + bgt _08120B16 + cmp r0, 0 + beq _08120B1C + b _08120B50 +_08120B16: + cmp r0, 0x2 + beq _08120B28 + b _08120B50 +_08120B1C: + bl sub_81206F0 +_08120B20: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _08120B50 +_08120B28: + ldrh r0, [r5, 0xE] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0xE] + strh r1, [r5, 0xA] + ldr r0, _08120B3C + ldrh r0, [r0, 0x4] + strh r0, [r5, 0xC] + movs r0, 0x4 + b _08120B4E + .align 2, 0 +_08120B3C: .4byte 0x03006130 +_08120B40: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _08120B50 +_08120B4C: + movs r0, 0x3 +_08120B4E: + strh r0, [r5, 0x8] +_08120B50: + bl sub_8197224 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120944 + + thumb_func_start sub_8120B5C +sub_8120B5C: @ 8120B5C + push {lr} + ldr r0, _08120B6C + movs r1, 0x45 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_08120B6C: .4byte 0x00004010 + thumb_func_end sub_8120B5C + + thumb_func_start sub_8120B70 +sub_8120B70: @ 8120B70 + push {r4-r7,lr} + sub sp, 0x8 + ldrb r1, [r0] + cmp r1, 0x2 + beq _08120B80 + cmp r1, 0x3 + beq _08120BA6 + b _08120C00 +_08120B80: + adds r5, r0, 0 + movs r4, 0 +_08120B84: + adds r0, r5, 0 + adds r0, 0x32 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08120B9E + movs r0, 0xB + muls r0, r4 + adds r0, 0x5 + adds r0, r5, r0 + movs r1, 0x1 + bl sub_8009308 +_08120B9E: + adds r4, 0x1 + cmp r4, 0x3 + ble _08120B84 + b _08120C00 +_08120BA6: + adds r6, r0, 0 + movs r4, 0 + mov r7, sp + adds r5, r6, 0 + adds r5, 0x8 +_08120BB0: + adds r0, r6, 0x4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08120BF8 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x7 + bl memcpy + movs r0, 0xFF + strb r0, [r7, 0x7] + mov r0, sp + bl sub_8009228 + cmp r0, 0 + beq _08120BF8 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + mov r0, sp + ldr r1, _08120C08 + bl gf_strcpy + adds r0, r5, 0 + mov r1, sp + movs r2, 0x7 + bl memcpy + adds r0, r6, 0 + adds r0, 0x34 + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] +_08120BF8: + adds r5, 0x7 + adds r4, 0x1 + cmp r4, 0x3 + ble _08120BB0 +_08120C00: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08120C08: .4byte 0x085edfb0 + thumb_func_end sub_8120B70 + + thumb_func_start sub_8120C0C +sub_8120C0C: @ 8120C0C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r1 + adds r7, r2, 0 + ldrb r0, [r5] + cmp r0, 0x4 + bhi _08120CC4 + lsls r0, 2 + ldr r1, _08120C28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08120C28: .4byte _08120C2C + .align 2, 0 +_08120C2C: + .4byte _08120C92 + .4byte _08120CA2 + .4byte _08120C40 + .4byte _08120C6A + .4byte _08120CB0 +_08120C40: + adds r6, r5, 0 + movs r5, 0 + adds r4, r6, 0 + adds r4, 0x32 +_08120C48: + movs r0, 0xB + muls r0, r5 + adds r0, 0x5 + adds r0, r6, r0 + bl sub_8009228 + cmp r0, 0 + beq _08120C5E + mov r0, r8 + strb r0, [r4] + b _08120C60 +_08120C5E: + strb r7, [r4] +_08120C60: + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _08120C48 + b _08120CC4 +_08120C6A: + adds r4, r5, 0 + adds r4, 0x34 + adds r6, r5, 0 + adds r6, 0x8 + movs r5, 0x3 +_08120C74: + adds r0, r6, 0 + bl sub_8009228 + cmp r0, 0 + beq _08120C84 + mov r1, r8 + strb r1, [r4] + b _08120C86 +_08120C84: + strb r7, [r4] +_08120C86: + adds r4, 0x1 + adds r6, 0x7 + subs r5, 0x1 + cmp r5, 0 + bge _08120C74 + b _08120CC4 +_08120C92: + cmp r3, 0x1 + bne _08120C9C + adds r0, r5, 0 + adds r0, 0x2A + b _08120CB8 +_08120C9C: + adds r0, r5, 0 + adds r0, 0x2A + b _08120CC2 +_08120CA2: + cmp r3, 0x1 + bne _08120CAC + mov r0, r8 + strb r0, [r5, 0x2] + b _08120CC4 +_08120CAC: + strb r7, [r5, 0x2] + b _08120CC4 +_08120CB0: + cmp r3, 0x1 + bne _08120CBE + adds r0, r5, 0 + adds r0, 0x20 +_08120CB8: + mov r1, r8 + strb r1, [r0] + b _08120CC4 +_08120CBE: + adds r0, r5, 0 + adds r0, 0x20 +_08120CC2: + strb r7, [r0] +_08120CC4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120C0C + + thumb_func_start sub_8120CD0 +sub_8120CD0: @ 8120CD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _08120D28 + cmp r2, 0x1 + bne _08120D28 + adds r7, r1, 0 + movs r6, 0 + mov r8, sp + adds r4, r7, 0 + adds r4, 0x34 + adds r5, r7, 0 + adds r5, 0x8 +_08120CF2: + adds r0, r7, 0x4 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _08120D1E + mov r0, sp + adds r1, r5, 0 + movs r2, 0x7 + bl memcpy + movs r0, 0xFF + mov r1, r8 + strb r0, [r1, 0x7] + mov r0, sp + bl sub_8009228 + cmp r0, 0 + beq _08120D1A + movs r0, 0x1 + b _08120D1C +_08120D1A: + movs r0, 0x2 +_08120D1C: + strb r0, [r4] +_08120D1E: + adds r4, 0x1 + adds r5, 0x7 + adds r6, 0x1 + cmp r6, 0x3 + ble _08120CF2 +_08120D28: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120CD0 + + thumb_func_start sub_8120D34 +sub_8120D34: @ 8120D34 + push {r4-r7,lr} + adds r3, r0, 0 + adds r6, r2, 0 + movs r2, 0 + subs r1, 0x1 + cmp r1, 0x1 + bhi _08120D44 + movs r2, 0x1 +_08120D44: + ldrb r0, [r3] + cmp r0, 0x4 + bhi _08120E02 + lsls r0, 2 + ldr r1, _08120D54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08120D54: .4byte _08120D58 + .align 2, 0 +_08120D58: + .4byte _08120DE6 + .4byte _08120DF0 + .4byte _08120D6C + .4byte _08120DC6 + .4byte _08120DF8 +_08120D6C: + adds r7, r3, 0 + cmp r2, 0 + beq _08120DA4 + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x32 +_08120D78: + movs r0, 0xB + muls r0, r5 + adds r0, 0x5 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0xFC + bne _08120D98 + ldrb r0, [r1, 0x1] + cmp r0, 0x15 + bne _08120D98 + adds r0, r1, 0 + bl sub_8009370 + movs r0, 0x1 + strb r0, [r4] + b _08120D9A +_08120D98: + strb r6, [r4] +_08120D9A: + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _08120D78 + b _08120E02 +_08120DA4: + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x32 +_08120DAA: + adds r0, r4, r5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08120DBE + movs r0, 0xB + muls r0, r5 + adds r0, 0x5 + adds r0, r7, r0 + bl sub_8009370 +_08120DBE: + adds r5, 0x1 + cmp r5, 0x3 + ble _08120DAA + b _08120E02 +_08120DC6: + cmp r2, 0 + beq _08120E02 + movs r1, 0 + adds r4, r3, 0x4 + adds r2, r3, 0 + adds r2, 0x34 +_08120DD2: + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08120DDE + adds r0, r2, r1 + strb r6, [r0] +_08120DDE: + adds r1, 0x1 + cmp r1, 0x3 + ble _08120DD2 + b _08120E02 +_08120DE6: + cmp r2, 0 + beq _08120E02 + adds r0, r3, 0 + adds r0, 0x2A + b _08120E00 +_08120DF0: + cmp r2, 0 + beq _08120E02 + strb r6, [r3, 0x2] + b _08120E02 +_08120DF8: + cmp r2, 0 + beq _08120E02 + adds r0, r3, 0 + adds r0, 0x20 +_08120E00: + strb r6, [r0] +_08120E02: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120D34 + + thumb_func_start sub_8120E08 +sub_8120E08: @ 8120E08 + push {r4,r5,lr} + ldr r2, _08120E44 + ldr r0, _08120E48 + ldr r0, [r0] + ldr r1, _08120E4C + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + movs r5, 0 + movs r4, 0xFF +_08120E24: + ldr r0, [r2] + adds r0, 0x4 + adds r0, r3 + strb r5, [r0] + ldr r1, [r2] + adds r1, 0x8 + adds r1, r3 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x3 + ble _08120E24 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08120E44: .4byte 0x0203a12c +_08120E48: .4byte 0x03005d8c +_08120E4C: .4byte 0x00002e28 + thumb_func_end sub_8120E08 + + thumb_func_start sub_8120E50 +sub_8120E50: @ 8120E50 + ldr r3, _08120E68 + ldr r0, _08120E6C + ldr r0, [r0] + ldr r1, _08120E70 + adds r0, r1 + str r0, [r3] + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r3] + strb r2, [r0, 0x1] + bx lr + .align 2, 0 +_08120E68: .4byte 0x0203a12c +_08120E6C: .4byte 0x03005d8c +_08120E70: .4byte 0x00002e28 + thumb_func_end sub_8120E50 + + thumb_func_start sub_8120E74 +sub_8120E74: @ 8120E74 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x32 + bne _08120E80 + movs r0, 0 +_08120E80: + bl sub_80847F8 + pop {r1} + bx r1 + thumb_func_end sub_8120E74 + + thumb_func_start sub_8120E88 +sub_8120E88: @ 8120E88 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, _08120E9C +_08120E90: + ldrb r0, [r1] + cmp r0, r3 + bne _08120EA0 + adds r0, r1, 0 + b _08120EAA + .align 2, 0 +_08120E9C: .4byte 0x0859f048 +_08120EA0: + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x23 + ble _08120E90 + ldr r0, _08120EB0 +_08120EAA: + pop {r1} + bx r1 + .align 2, 0 +_08120EB0: .4byte 0x0859f278 + thumb_func_end sub_8120E88 + + thumb_func_start sub_8120EB4 +sub_8120EB4: @ 8120EB4 + push {lr} + bl sub_8120E88 + ldr r0, [r0, 0x4] + pop {r1} + bx r1 + thumb_func_end sub_8120EB4 + + thumb_func_start sub_8120EC0 +sub_8120EC0: @ 8120EC0 + push {lr} + bl sub_8120E88 + ldr r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_8120EC0 + + thumb_func_start sub_8120ECC +sub_8120ECC: @ 8120ECC + push {lr} + bl sub_8120E88 + ldr r0, [r0, 0x8] + pop {r1} + bx r1 + thumb_func_end sub_8120ECC + + thumb_func_start sub_8120ED8 +sub_8120ED8: @ 8120ED8 + push {lr} + movs r1, 0 + ldr r2, _08120F04 + ldr r0, [r2] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08120EFC +_08120EE6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _08120EFC + ldr r0, [r2] + adds r0, 0x4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08120EE6 +_08120EFC: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_08120F04: .4byte 0x0203a12c + thumb_func_end sub_8120ED8 + + thumb_func_start sub_8120F08 +sub_8120F08: @ 8120F08 + ldr r1, _08120F28 + lsls r0, 2 + adds r0, 0x24 + ldr r2, [r1] + adds r2, r0 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + orrs r0, r1 + bx lr + .align 2, 0 +_08120F28: .4byte 0x0203a12c + thumb_func_end sub_8120F08 + + thumb_func_start sub_8120F2C +sub_8120F2C: @ 8120F2C + ldr r2, _08120F48 + lsls r0, 2 + adds r0, 0x24 + ldr r2, [r2] + adds r2, r0 + strb r1, [r2] + lsrs r0, r1, 8 + strb r0, [r2, 0x1] + lsrs r0, r1, 16 + strb r0, [r2, 0x2] + lsrs r1, 24 + strb r1, [r2, 0x3] + bx lr + .align 2, 0 +_08120F48: .4byte 0x0203a12c + thumb_func_end sub_8120F2C + + thumb_func_start sub_8120F4C +sub_8120F4C: @ 8120F4C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _08120F70 + ldr r0, [r0] + adds r0, 0x4 + adds r0, r5 + ldrb r0, [r0] + bl sub_8120E74 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8120F08 + cmp r4, r0 + bhi _08120F74 + movs r0, 0 + b _08120F76 + .align 2, 0 +_08120F70: .4byte 0x0203a12c +_08120F74: + movs r0, 0x1 +_08120F76: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8120F4C + + thumb_func_start sub_8120F7C +sub_8120F7C: @ 8120F7C + push {r4,r5,lr} + adds r5, r1, 0 + ldr r2, _08120FA8 + lsls r1, r0, 3 + subs r1, r0 + adds r1, 0x8 + ldr r4, [r2] + adds r4, r1 + adds r0, r5, 0 + movs r1, 0xFF + movs r2, 0x8 + bl memset + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl memcpy + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08120FA8: .4byte 0x0203a12c + thumb_func_end sub_8120F7C + + thumb_func_start sub_8120FAC +sub_8120FAC: @ 8120FAC + push {r4,r5,lr} + adds r5, r1, 0 + ldr r2, _08120FD8 + lsls r1, r0, 3 + subs r1, r0 + adds r1, 0x8 + ldr r4, [r2] + adds r4, r1 + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0x7 + bl memset + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl memcpy + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08120FD8: .4byte 0x0203a12c + thumb_func_end sub_8120FAC + + thumb_func_start sub_8120FDC +sub_8120FDC: @ 8120FDC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r8, r0 + adds r6, r1, 0 + ldr r0, _08121050 + mov r9, r0 + ldr r0, [r0] + adds r0, 0x4 + add r0, r8 + strb r6, [r0] + ldr r0, _08121054 + ldr r1, [r0] + mov r0, r8 + bl sub_8120FAC + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8120E74 + adds r1, r0, 0 + mov r0, r8 + bl sub_8120F2C + ldr r5, _08121058 + adds r0, r4, 0 + bl sub_8120E74 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0xA + bl decimal_int_to_string + ldr r4, _0812105C + adds r0, r6, 0 + bl sub_8120ECC + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + mov r1, r9 + ldr r0, [r1] + adds r0, 0x34 + add r0, r8 + ldr r1, _08121060 + ldrb r1, [r1] + strb r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08121050: .4byte 0x0203a12c +_08121054: .4byte 0x03005d90 +_08121058: .4byte 0x02021cc4 +_0812105C: .4byte 0x02021dc4 +_08121060: .4byte 0x082e9531 + thumb_func_end sub_8120FDC + + thumb_func_start sub_8121064 +sub_8121064: @ 8121064 + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + movs r5, 0 + cmp r5, r6 + bge _0812107A +_08121070: + adds r0, r7, r5 + strb r5, [r0] + adds r5, 0x1 + cmp r5, r6 + blt _08121070 +_0812107A: + cmp r6, 0 + ble _081210B0 + adds r5, r6, 0 +_08121080: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r4, r7, r4 + ldrb r2, [r4] + adds r0, r7, r0 + ldrb r1, [r0] + strb r1, [r4] + strb r2, [r0] + subs r5, 0x1 + cmp r5, 0 + bne _08121080 +_081210B0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8121064 + + thumb_func_start sub_81210B8 +sub_81210B8: @ 81210B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r7, sp + mov r8, sp + ldr r0, _08121140 + ldr r0, [r0] + lsls r0, 3 + lsrs r0, 3 + adds r0, 0x3 + lsrs r0, 2 + lsls r0, 2 + mov r1, sp + subs r1, r0 + mov sp, r1 + mov r9, sp + mov r0, sp + movs r1, 0x24 + bl sub_8121064 + movs r5, 0 +_081210E4: + ldr r1, _08121144 + mov r2, r9 + adds r0, r2, r5 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r4, [r0] + ldrb r6, [r0, 0x1] + movs r1, 0 + ldr r2, _08121148 + ldr r0, [r2] + ldrb r0, [r0, 0x4] + cmp r0, r4 + beq _08121112 +_08121100: + adds r1, 0x1 + cmp r1, 0x3 + bgt _08121112 + ldr r0, [r2] + adds r0, 0x4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, r4 + bne _08121100 +_08121112: + cmp r1, 0x4 + bne _08121162 + adds r0, r4, 0 + bl sub_8120E74 + cmp r0, r6 + bcc _08121162 + ldr r0, _08121148 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x1] + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _08121150 + ldr r0, _0812114C + ldrb r0, [r0] + adds r1, r4, 0 + bl sub_8120FDC + b _0812115E + .align 2, 0 +_08121140: .4byte 0x0859f288 +_08121144: .4byte 0x0859f048 +_08121148: .4byte 0x0203a12c +_0812114C: .4byte 0x03001178 +_08121150: + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_8120FDC +_0812115E: + movs r0, 0x1 + b _0812116A +_08121162: + adds r5, 0x1 + cmp r5, 0x23 + ble _081210E4 + movs r0, 0 +_0812116A: + mov sp, r8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81210B8 + + thumb_func_start sub_8121178 +sub_8121178: @ 8121178 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + ldr r6, _081211DC + ldr r0, [r6] + adds r0, 0x4 + adds r0, r5 + ldrb r0, [r0] + mov r8, r0 + ldr r4, _081211E0 + adds r0, r5, 0 + bl sub_8120F08 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0xA + bl decimal_int_to_string + ldr r4, _081211E4 + mov r0, r8 + bl sub_8120ECC + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r4, _081211E8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8120F7C + ldr r0, [r6] + adds r0, 0x34 + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8009308 + mov r0, r8 + bl sub_8120EC0 + bl box_related_two__2 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081211DC: .4byte 0x0203a12c +_081211E0: .4byte 0x02021cc4 +_081211E4: .4byte 0x02021dc4 +_081211E8: .4byte 0x02021ec4 + thumb_func_end sub_8121178 + + thumb_func_start sub_81211EC +sub_81211EC: @ 81211EC + push {r4,r5,lr} + sub sp, 0xC + ldr r1, _081212F0 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r5, r0, 0 + movs r4, 0 + ldr r0, _081212F4 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08121230 +_08121208: + bl sub_8120EB4 + adds r1, r0, 0 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + cmp r0, r5 + ble _0812121C + adds r5, r0, 0 +_0812121C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08121230 + ldr r0, _081212F4 + ldr r0, [r0] + adds r0, 0x4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08121208 +_08121230: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8120ED8 + adds r3, r0, 0 + lsls r3, 25 + movs r0, 0x80 + lsls r0, 18 + adds r3, r0 + lsrs r3, 24 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + bl CreateWindowFromRect + ldr r1, _081212F8 + strb r0, [r1] + ldrb r0, [r1] + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r4, 0 + ldr r0, _081212F4 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _081212AA + movs r5, 0x80 + lsls r5, 17 +_08121272: + bl sub_8120EB4 + adds r2, r0, 0 + ldr r0, _081212F8 + ldrb r0, [r0] + lsrs r1, r5, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x3 + bgt _081212AA + ldr r0, _081212F4 + ldr r0, [r0] + adds r0, 0x4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08121272 +_081212AA: + ldr r5, _081212F8 + ldrb r0, [r5] + ldr r2, _081212F0 + lsls r1, r4, 4 + adds r1, 0x1 + 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 + movs r3, 0x8 + bl Print + ldrb r4, [r5] + bl sub_8120ED8 + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081212F0: .4byte 0x085eb7ea +_081212F4: .4byte 0x0203a12c +_081212F8: .4byte 0x0203a130 + thumb_func_end sub_81211EC + + thumb_func_start sub_81212FC +sub_81212FC: @ 81212FC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0812131C + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _08121320 + cmp r5, 0x1 + beq _0812132C + b _08121376 + .align 2, 0 +_0812131C: .4byte 0x03005e00 +_08121320: + bl sub_81211EC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08121376 +_0812132C: + bl ProcessMenuInput + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08121376 + adds r0, 0x1 + cmp r4, r0 + beq _0812134E + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0812135C +_0812134E: + ldr r1, _08121358 + movs r0, 0 + strh r0, [r1] + b _08121364 + .align 2, 0 +_08121358: .4byte 0x020375f0 +_0812135C: + ldr r0, _0812137C + strh r5, [r0] + ldr r0, _08121380 + strb r4, [r0] +_08121364: + ldr r0, _08121384 + ldrb r0, [r0] + bl sub_80E2A78 + adds r0, r6, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_08121376: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812137C: .4byte 0x020375f0 +_08121380: .4byte 0x03001178 +_08121384: .4byte 0x0203a130 + thumb_func_end sub_81212FC + + thumb_func_start sub_8121388 +sub_8121388: @ 8121388 + push {lr} + ldr r0, _08121398 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_08121398: .4byte sub_81212FC + 1 + thumb_func_end sub_8121388 + + thumb_func_start sub_812139C +sub_812139C: @ 812139C + push {lr} + ldr r0, _081213AC + ldrb r0, [r0] + bl sub_8121178 + pop {r0} + bx r0 + .align 2, 0 +_081213AC: .4byte 0x03001178 + thumb_func_end sub_812139C + + thumb_func_start sub_81213B0 +sub_81213B0: @ 81213B0 + push {lr} + ldr r1, _081213CC + ldr r0, _081213D0 + ldr r0, [r0] + ldr r2, _081213D4 + adds r0, r2 + str r0, [r1] + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081213CC: .4byte 0x0203a12c +_081213D0: .4byte 0x03005d8c +_081213D4: .4byte 0x00002e28 + thumb_func_end sub_81213B0 + + thumb_func_start sub_81213D8 +sub_81213D8: @ 81213D8 + push {r4,r5,lr} + ldr r2, _08121400 + ldr r0, _08121404 + ldr r1, [r0] + ldr r3, _08121408 + adds r0, r1, r3 + str r0, [r2] + ldr r5, _0812140C + ldrb r0, [r5] + ldr r2, _08121410 + adds r1, r2 + adds r1, r0 + ldrb r4, [r1] + bl sub_8120F4C + cmp r0, 0x1 + beq _08121414 + movs r0, 0 + b _0812141E + .align 2, 0 +_08121400: .4byte 0x0203a12c +_08121404: .4byte 0x03005d8c +_08121408: .4byte 0x00002e28 +_0812140C: .4byte 0x03001178 +_08121410: .4byte 0x00002e2c +_08121414: + ldrb r0, [r5] + adds r1, r4, 0 + bl sub_8120FDC + movs r0, 0x1 +_0812141E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81213D8 + + thumb_func_start sub_8121424 +sub_8121424: @ 8121424 + push {lr} + ldr r1, _0812143C + ldr r0, _08121440 + ldr r0, [r0] + ldr r2, _08121444 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08121448 + movs r0, 0x1 + b _0812144A + .align 2, 0 +_0812143C: .4byte 0x0203a12c +_08121440: .4byte 0x03005d8c +_08121444: .4byte 0x00002e28 +_08121448: + movs r0, 0 +_0812144A: + pop {r1} + bx r1 + thumb_func_end sub_8121424 + + thumb_func_start sub_8121450 +sub_8121450: @ 8121450 + push {lr} + ldr r1, _0812146C + ldr r0, _08121470 + ldr r0, [r0] + ldr r2, _08121474 + adds r0, r2 + str r0, [r1] + bl sub_81210B8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0812146C: .4byte 0x0203a12c +_08121470: .4byte 0x03005d8c +_08121474: .4byte 0x00002e28 + thumb_func_end sub_8121450 + + thumb_func_start sub_8121478 +sub_8121478: @ 8121478 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r4, _081214D0 + ldr r0, _081214D4 + bl malloc_and_clear + str r0, [r4] + ldr r1, _081214D8 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + ldr r2, _081214DC + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r4, [r4] + movs r3, 0x88 + lsls r3, 2 + adds r1, r4, r3 + ldr r0, _081214E0 + str r0, [r1] + movs r0, 0x89 + lsls r0, 2 + adds r1, r4, r0 + ldr r0, _081214E4 + str r0, [r1] + ldrh r1, [r5, 0x20] + adds r0, r1, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bhi _081214E8 + subs r1, 0x79 + subs r2, 0x4 + adds r0, r4, r2 + strb r1, [r0] + b _081214F2 + .align 2, 0 +_081214D0: .4byte 0x0203a134 +_081214D4: .4byte 0x0000222c +_081214D8: .4byte 0x0000021d +_081214DC: .4byte 0x0000021e +_081214E0: .4byte sub_811EBBC + 1 +_081214E4: .4byte sub_811EC08 + 1 +_081214E8: + ldr r3, _0812151C + adds r1, r4, r3 + movs r0, 0 + strb r0, [r1] + movs r6, 0 +_081214F2: + ldr r0, _08121520 + ldr r1, [r0] + ldr r2, _08121524 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08121504 + cmp r0, 0x1 + beq _0812152C +_08121504: + movs r3, 0x8A + lsls r3, 2 + adds r2, r1, r3 + subs r3, 0xE + adds r0, r1, r3 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _08121528 + b _08121540 + .align 2, 0 +_0812151C: .4byte 0x0000021a +_08121520: .4byte 0x0203a134 +_08121524: .4byte 0x0000021e +_08121528: .4byte 0x0859f3b4 +_0812152C: + movs r0, 0x8A + lsls r0, 2 + adds r2, r1, r0 + ldr r3, _08121578 + adds r0, r1, r3 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812157C +_08121540: + adds r0, r1 + str r0, [r2] + ldrh r0, [r5, 0x1E] + mov r1, sp + bl sub_80D45E8 + lsls r0, 16 + ldr r1, _08121580 + adds r0, r1 + movs r1, 0xCD + lsls r1, 17 + cmp r0, r1 + bhi _081215AC + ldr r1, _08121584 + ldr r2, [r1] + ldr r3, _08121578 + adds r0, r2, r3 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + beq _0812158C + cmp r0, 0x9 + beq _0812159C + ldr r0, _08121588 + adds r1, r2, r0 + movs r0, 0 + strb r0, [r1] + b _081215BA + .align 2, 0 +_08121578: .4byte 0x0000021a +_0812157C: .4byte 0x0859f458 +_08121580: .4byte 0xffff0000 +_08121584: .4byte 0x0203a134 +_08121588: .4byte 0x0000021b +_0812158C: + ldr r0, _08121598 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + b _081215BA + .align 2, 0 +_08121598: .4byte 0x0000021b +_0812159C: + ldr r0, _081215A8 + adds r1, r2, r0 + movs r0, 0x2 + strb r0, [r1] + b _081215BA + .align 2, 0 +_081215A8: .4byte 0x0000021b +_081215AC: + ldr r0, _081215E0 + ldr r1, [r0] + ldr r2, _081215E4 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 +_081215BA: + ldr r1, [r3] + movs r3, 0x85 + lsls r3, 2 + adds r0, r1, r3 + str r5, [r0] + movs r2, 0x83 + lsls r2, 2 + adds r0, r1, r2 + str r7, [r0] + adds r3, 0x4 + adds r0, r1, r3 + strb r6, [r0] + ldr r0, _081215E8 + bl set_callback2 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081215E0: .4byte 0x0203a134 +_081215E4: .4byte 0x0000021b +_081215E8: .4byte sub_81219F0 + 1 + thumb_func_end sub_8121478 + + thumb_func_start sub_81215EC +sub_81215EC: @ 81215EC + push {r4-r6,lr} + sub sp, 0xC + ldr r0, _0812160C + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x12 + bls _08121600 + b _081219E2 +_08121600: + lsls r0, 2 + ldr r1, _08121610 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0812160C: .4byte 0x030022c0 +_08121610: .4byte _08121614 + .align 2, 0 +_08121614: + .4byte _08121660 + .4byte _0812166E + .4byte _08121688 + .4byte _0812168E + .4byte _08121694 + .4byte _0812169A + .4byte _081216F4 + .4byte _08121730 + .4byte _08121740 + .4byte _08121774 + .4byte _08121782 + .4byte _081217D8 + .4byte _081217EC + .4byte _081218B0 + .4byte _081218CC + .4byte _081218EC + .4byte _081218F6 + .4byte _08121910 + .4byte _08121980 +_08121660: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + movs r0, 0 + b _081216EC +_0812166E: + add r1, sp, 0x8 + movs r0, 0 + strh r0, [r1] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _08121684 + add r0, sp, 0x8 + bl CpuSet + b _081219D4 + .align 2, 0 +_08121684: .4byte 0x01000200 +_08121688: + bl sub_80A1A74 + b _081219D4 +_0812168E: + bl clear_tasks + b _081219D4 +_08121694: + bl reset_all_obj_data + b _081219D4 +_0812169A: + bl gpu_pal_allocator_reset + bl reset_temp_tile_data_buffers + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 +_081216EC: + movs r1, 0 + bl lcd_io_set + b _081219D4 +_081216F4: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08121724 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _08121728 + ldr r1, [r4] + movs r2, 0x8B + lsls r2, 2 + adds r1, r2 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _0812172C + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + b _081219D4 + .align 2, 0 +_08121724: .4byte 0x0859f290 +_08121728: .4byte 0x0203a134 +_0812172C: .4byte 0x0000122c +_08121730: + ldr r0, _0812173C + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + b _081219D4 + .align 2, 0 +_0812173C: .4byte 0x0859f29c +_08121740: + ldr r2, _08121768 + ldr r0, _0812176C + ldr r0, [r0] + ldr r1, _08121770 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081219D4 + .align 2, 0 +_08121768: .4byte 0x0859f2b8 +_0812176C: .4byte 0x0203a134 +_08121770: .4byte 0x0000021a +_08121774: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _08121780 + b _081219D4 +_08121780: + b _081219E2 +_08121782: + 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 bg_fill_tilemap_rect + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + ldr r2, _081217CC + ldr r0, _081217D0 + ldr r0, [r0] + ldr r1, _081217D4 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + b _081219D4 + .align 2, 0 +_081217CC: .4byte 0x0859f2b8 +_081217D0: .4byte 0x0203a134 +_081217D4: .4byte 0x0000021a +_081217D8: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + b _081219D4 +_081217EC: + bl sub_8098C64 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r6, _08121894 + ldr r4, _08121898 + ldr r0, _0812189C + ldr r3, [r0] + ldr r2, _081218A0 + adds r3, r2 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x10] + subs r2, 0x26 + adds r0, r6, r2 + strh r1, [r0] + ldr r5, _081218A4 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x10] + adds r2, r5, r2 + strh r0, [r2] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x12] + movs r2, 0xFB + lsls r2, 1 + adds r0, r6, r2 + strh r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x12] + adds r2, r5, r2 + strh r0, [r2] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _081218A8 + ldr r0, _081218AC + ldr r2, [r0] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r6, 0x14] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x14] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r1, 0x2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r6, 0x16] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x16] + b _081219D4 + .align 2, 0 +_08121894: .4byte 0x02037714 +_08121898: .4byte 0x0859f2b8 +_0812189C: .4byte 0x0203a134 +_081218A0: .4byte 0x0000021a +_081218A4: .4byte 0x02037b14 +_081218A8: .4byte 0x0859f2b0 +_081218AC: .4byte 0x03005d90 +_081218B0: + ldr r0, _081218C8 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081218C2 + b _081219D4 +_081218C2: + bl sub_8121A1C + b _081219D4 + .align 2, 0 +_081218C8: .4byte 0x0203a134 +_081218CC: + ldr r0, _081218E8 + ldr r0, [r0] + movs r2, 0x86 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081218DE + b _081219D4 +_081218DE: + bl sub_8121B1C + bl run_remoboxes + b _081219D4 + .align 2, 0 +_081218E8: .4byte 0x0203a134 +_081218EC: + bl sub_8087598 + cmp r0, 0x1 + bne _081219D4 + b _081219E2 +_081218F6: + ldr r0, _08121908 + bl SetVBlankCallback + ldr r2, _0812190C + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + b _081219D4 + .align 2, 0 +_08121908: .4byte sub_8121C50 + 1 +_0812190C: .4byte 0x02037fd4 +_08121910: + ldr r5, _08121938 + ldr r0, [r5] + movs r1, 0x85 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0, 0x1E] + bl sub_80D2E84 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldr r2, _0812193C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08121940 + cmp r0, 0x2 + beq _08121958 + b _081219D4 + .align 2, 0 +_08121938: .4byte 0x0203a134 +_0812193C: .4byte 0x0000021b +_08121940: + adds r0, r4, 0 + bl sub_80D2F68 + ldr r1, _08121954 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x60 + b _0812196A + .align 2, 0 +_08121954: .4byte nullsub_12 + 1 +_08121958: + adds r0, r4, 0 + bl sub_80D2F68 + ldr r1, _0812197C + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x28 +_0812196A: + movs r3, 0x80 + bl sub_80D2D78 + ldr r1, [r5] + movs r2, 0x87 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + b _081219D4 + .align 2, 0 +_0812197C: .4byte nullsub_12 + 1 +_08121980: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _081219C8 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, _081219CC + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r1, _081219D0 + str r1, [r0] + movs r0, 0x1 + b _081219E4 + .align 2, 0 +_081219C8: .4byte 0x02037fd4 +_081219CC: .4byte 0x0203a134 +_081219D0: .4byte sub_8121C98 + 1 +_081219D4: + ldr r1, _081219EC + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081219E2: + movs r0, 0 +_081219E4: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081219EC: .4byte 0x030022c0 + thumb_func_end sub_81215EC + + thumb_func_start sub_81219F0 +sub_81219F0: @ 81219F0 + push {lr} +_081219F2: + bl sub_81215EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08121A0C + ldr r0, _08121A08 + bl set_callback2 + b _08121A18 + .align 2, 0 +_08121A08: .4byte sub_8121C64 + 1 +_08121A0C: + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081219F2 +_08121A18: + pop {r0} + bx r0 + thumb_func_end sub_81219F0 + + thumb_func_start sub_8121A1C +sub_8121A1C: @ 8121A1C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + movs r5, 0 + ldr r2, _08121AE0 + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0] + cmp r5, r0 + bcs _08121A8A + mov r8, r2 + adds r7, r1, 0 +_08121A3C: + lsls r0, r5, 6 + mov r1, r8 + ldr r2, [r1] + adds r0, r2, r0 + movs r3, 0x85 + lsls r3, 2 + adds r1, r2, r3 + lsls r3, r6, 1 + ldr r1, [r1] + adds r1, r3 + adds r2, r7 + ldr r2, [r2] + ldr r2, [r2, 0x8] + lsls r4, r5, 2 + adds r2, r4, r2 + ldr r2, [r2] + lsls r2, 30 + lsrs r2, 30 + movs r3, 0x1 + bl sub_811EC08 + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + ldr r1, [r0] + ldr r0, [r1, 0x8] + adds r4, r0 + ldr r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r1, [r1] + cmp r5, r1 + bcc _08121A3C +_08121A8A: + ldr r4, _08121AE0 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 2 + adds r0, r1, r2 + movs r3, 0x85 + lsls r3, 2 + adds r1, r3 + ldr r1, [r1] + adds r1, 0x12 + bl gf_strcpy + adds r2, r0, 0 + ldr r1, [r4] + ldr r3, _08121AE4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08121AF0 + ldr r1, _08121AE8 + adds r0, r2, 0 + bl gf_strcpy + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 2 + adds r0, r1 + bl sub_8008C24 + ldr r2, [r4] + movs r3, 0x8A + lsls r3, 2 + adds r1, r2, r3 + ldr r1, [r1] + lsls r0, 16 + lsrs r0, 13 + subs r0, 0x60 + ldrb r1, [r1, 0x2] + subs r1, r0 + ldr r0, _08121AEC + adds r2, r0 + strb r1, [r2] + b _08121B0C + .align 2, 0 +_08121AE0: .4byte 0x0203a134 +_08121AE4: .4byte 0x0000021e +_08121AE8: .4byte 0x085eea78 +_08121AEC: .4byte 0x00000219 +_08121AF0: + movs r2, 0x80 + lsls r2, 2 + adds r0, r1, r2 + bl sub_81DB52C + ldr r0, [r4] + movs r3, 0x8A + lsls r3, 2 + adds r1, r0, r3 + ldr r1, [r1] + ldrb r1, [r1, 0x2] + ldr r2, _08121B18 + adds r0, r2 + strb r1, [r0] +_08121B0C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08121B18: .4byte 0x00000219 + thumb_func_end sub_8121A1C + + thumb_func_start sub_8121B1C +sub_8121B1C: @ 8121B1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + movs r7, 0 + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r6, 0 + ldr r1, _08121C40 + ldr r0, [r1] + movs r2, 0x8A + lsls r2, 2 + mov r10, r2 + add r0, r10 + ldr r0, [r0] + ldrb r0, [r0] + cmp r6, r0 + bcs _08121BCC + mov r9, r1 + mov r8, r10 +_08121B60: + mov r0, r9 + ldr r1, [r0] + lsls r0, r6, 6 + adds r5, r1, r0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _08121BB8 + cmp r0, 0 + beq _08121BB8 + mov r2, r8 + adds r0, r1, r2 + ldr r1, [r0] + ldr r0, [r1, 0x8] + lsls r4, r6, 2 + adds r0, r4, r0 + ldr r2, [r0] + lsls r2, 24 + lsrs r2, 26 + ldrb r0, [r1, 0x4] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + adds r3, r7, r3 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _08121C44 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + bl box_print + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r4, r0 + ldrb r0, [r4, 0x1] + adds r0, r7, r0 + lsls r0, 24 + lsrs r7, r0, 24 +_08121BB8: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r2, _08121C40 + ldr r0, [r2] + add r0, r10 + ldr r0, [r0] + ldrb r0, [r0] + cmp r6, r0 + bcc _08121B60 +_08121BCC: + ldr r1, _08121C48 + add r0, sp, 0xC + bl gf_strcpy + ldr r4, _08121C40 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2 + bl gf_strcpy + ldr r0, [r4] + ldr r1, _08121C4C + adds r0, r1 + ldrb r2, [r0] + movs r0, 0x1 + add r1, sp, 0xC + bl sub_81DB35C + adds r2, r0, 0 + adds r2, 0x68 + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r3, [r0, 0x1] + adds r3, 0x58 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _08121C44 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08121C40: .4byte 0x0203a134 +_08121C44: .4byte 0x0859f2ac +_08121C48: .4byte 0x085eea78 +_08121C4C: .4byte 0x00000219 + thumb_func_end sub_8121B1C + + thumb_func_start sub_8121C50 +sub_8121C50: @ 8121C50 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8121C50 + + thumb_func_start sub_8121C64 +sub_8121C64: @ 8121C64 + push {r4,lr} + ldr r4, _08121C90 + ldr r0, [r4] + ldr r1, _08121C94 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08121C7C + bl call_obj_callbacks + bl obj_sync_something +_08121C7C: + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08121C90: .4byte 0x0203a134 +_08121C94: .4byte 0x0000021b + thumb_func_end sub_8121C64 + + thumb_func_start sub_8121C98 +sub_8121C98: @ 8121C98 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08121CB2 + ldr r0, _08121CB8 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r1, _08121CBC + str r1, [r0] +_08121CB2: + pop {r0} + bx r0 + .align 2, 0 +_08121CB8: .4byte 0x0203a134 +_08121CBC: .4byte sub_8121CC0 + 1 + thumb_func_end sub_8121C98 + + thumb_func_start sub_8121CC0 +sub_8121CC0: @ 8121CC0 + push {lr} + sub sp, 0x4 + ldr r0, _08121CF4 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08121CEE + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08121CF8 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r1, _08121CFC + str r1, [r0] +_08121CEE: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08121CF4: .4byte 0x030022c0 +_08121CF8: .4byte 0x0203a134 +_08121CFC: .4byte sub_8121D00 + 1 + thumb_func_end sub_8121CC0 + + thumb_func_start sub_8121D00 +sub_8121D00: @ 8121D00 + push {r4,lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08121D88 + ldr r4, _08121D90 + ldr r0, [r4] + movs r1, 0x83 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl set_callback2 + ldr r1, [r4] + ldr r2, _08121D94 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bgt _08121D58 + cmp r0, 0x1 + blt _08121D58 + subs r2, 0x7 + adds r0, r1, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x1E] + bl sub_80D2E84 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D2FF0 + ldr r0, [r4] + movs r1, 0x87 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08121D98 + adds r0, r1 + bl sub_80D2EF8 +_08121D58: + ldr r4, _08121D90 + ldr r0, [r4] + ldr r2, _08121D9C + movs r1, 0 + bl memset + bl sub_80A1A74 + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + bl Window_FreeMemory + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] +_08121D88: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08121D90: .4byte 0x0203a134 +_08121D94: .4byte 0x0000021b +_08121D98: .4byte 0x02020630 +_08121D9C: .4byte 0x0000222c + thumb_func_end sub_8121D00 + + thumb_func_start sub_8121DA0 +sub_8121DA0: @ 8121DA0 + push {r4,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _08121E04 + mov r0, sp + bl CpuSet + movs r4, 0 + str r4, [sp, 0x4] + add r0, sp, 0x4 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _08121E08 + bl CpuSet + add r0, sp, 0x8 + strh r4, [r0] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _08121E0C + bl CpuSet + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08121E04: .4byte 0x0100c000 +_08121E08: .4byte 0x05000100 +_08121E0C: .4byte 0x01000200 + thumb_func_end sub_8121DA0 + + thumb_func_start sub_8121E10 +sub_8121E10: @ 8121E10 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + pop {r0} + bx r0 + thumb_func_end sub_8121E10 + + thumb_func_start vblank_hblank_handler_set_zero +vblank_hblank_handler_set_zero: @ 8121E68 + push {lr} + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + pop {r0} + bx r0 + thumb_func_end vblank_hblank_handler_set_zero + + thumb_func_start sub_8121E7C +sub_8121E7C: @ 8121E7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08121F08 + strb r6, [r0] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8197B1C + ldr r4, _08121F0C + ldr r0, [sp, 0x30] + cmp r0, r4 + beq _08121EC0 + adds r0, r4, 0 + ldr r1, [sp, 0x30] + bl ExpandTextCodes +_08121EC0: + ldr r2, _08121F10 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + 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] + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl text_box_related_one + ldr r1, _08121F14 + ldr r0, [sp, 0x34] + str r0, [r1] + ldr r1, _08121F18 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, _08121F1C + str r1, [r0] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08121F08: .4byte 0x0203a140 +_08121F0C: .4byte 0x02021fc4 +_08121F10: .4byte 0x03003014 +_08121F14: .4byte 0x0300117c +_08121F18: .4byte 0x03005e00 +_08121F1C: .4byte task_show_message + 1 + thumb_func_end sub_8121E7C + + thumb_func_start sub_8121F20 +sub_8121F20: @ 8121F20 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl run_remoboxes + adds r0, r4, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8121F20 + + thumb_func_start task_show_message +task_show_message: @ 8121F3C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08121F60 + ldrb r0, [r0] + bl sub_8121F20 + lsls r0, 16 + cmp r0, 0 + bne _08121F5A + ldr r0, _08121F64 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 +_08121F5A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08121F60: .4byte 0x0203a140 +_08121F64: .4byte 0x0300117c + thumb_func_end task_show_message + + thumb_func_start sub_8121F68 +sub_8121F68: @ 8121F68 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08121F88 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r3] + str r2, [r3, 0x4] + ldr r2, _08121F8C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _08121F90 + str r0, [r1] + bx lr + .align 2, 0 +_08121F88: .4byte 0x0203a138 +_08121F8C: .4byte 0x03005e00 +_08121F90: .4byte sub_8121FDC + 1 + thumb_func_end sub_8121F68 + + thumb_func_start sub_8121F94 +sub_8121F94: @ 8121F94 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + ldr r1, [sp, 0x10] + ldr r2, [sp, 0x14] + ldr r5, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl sub_81996C0 + ldr r2, _08121FD0 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r1, _08121FD4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08121FD8 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08121FD0: .4byte 0x0203a138 +_08121FD4: .4byte 0x03005e00 +_08121FD8: .4byte sub_8121FDC + 1 + thumb_func_end sub_8121F94 + + thumb_func_start sub_8121FDC +sub_8121FDC: @ 8121FDC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08122002 + cmp r1, 0 + bgt _08121FFC + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08122018 + b _08122028 +_08121FFC: + cmp r1, 0x1 + beq _08122018 + b _08122028 +_08122002: + movs r0, 0x5 + bl audio_play + ldr r0, _08122014 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _08122028 + .align 2, 0 +_08122014: .4byte 0x0203a138 +_08122018: + movs r0, 0x5 + bl audio_play + ldr r0, _08122030 + ldr r1, [r0, 0x4] + adds r0, r4, 0 + bl _call_via_r1 +_08122028: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08122030: .4byte 0x0203a138 + thumb_func_end sub_8121FDC + + thumb_func_start sub_8122034 +sub_8122034: @ 8122034 + push {r4-r6,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r5, r1, 0 + ldrh r4, [r2] + adds r6, r4, 0 + ldr r0, _08122068 + ldrh r0, [r0, 0x30] + movs r3, 0xF0 + ands r3, r0 + cmp r3, 0x40 + bne _0812206C + adds r0, r4, 0x1 + strh r0, [r2] + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, r1 + ble _0812205E + movs r0, 0x1 + strh r0, [r2] +_0812205E: + movs r0, 0 + ldrsh r1, [r2, r0] +_08122062: + lsls r0, r4, 16 + b _081220B6 + .align 2, 0 +_08122068: .4byte 0x030022c0 +_0812206C: + cmp r3, 0x80 + bne _08122082 + subs r0, r4, 0x1 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bgt _0812207C + strh r1, [r2] +_0812207C: + movs r3, 0 + ldrsh r1, [r2, r3] + b _08122062 +_08122082: + cmp r3, 0x10 + bne _0812209C + adds r0, r4, 0 + adds r0, 0xA + strh r0, [r2] + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, r5 + ble _08122096 + strh r5, [r2] +_08122096: + movs r3, 0 + ldrsh r1, [r2, r3] + b _08122062 +_0812209C: + cmp r3, 0x20 + bne _081220C6 + adds r0, r4, 0 + subs r0, 0xA + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bgt _081220B0 + movs r0, 0x1 + strh r0, [r2] +_081220B0: + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r6, 16 +_081220B6: + asrs r0, 16 + cmp r1, r0 + beq _081220C6 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + b _081220C8 +_081220C6: + movs r0, 0 +_081220C8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8122034 + + thumb_func_start sub_81220D0 +sub_81220D0: @ 81220D0 + push {lr} + ldr r0, _081220F0 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _08122106 + ldr r0, _081220F4 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _081220F8 + movs r0, 0x1 + b _08122108 + .align 2, 0 +_081220F0: .4byte 0x03005d90 +_081220F4: .4byte 0x030022c0 +_081220F8: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08122106 + movs r0, 0x2 + b _08122108 +_08122106: + movs r0, 0 +_08122108: + pop {r1} + bx r1 + thumb_func_end sub_81220D0 + + thumb_func_start sub_812210C +sub_812210C: @ 812210C + push {lr} + ldr r0, _0812212C + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _08122142 + ldr r0, _08122130 + ldrh r1, [r0, 0x30] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08122134 + movs r0, 0x1 + b _08122144 + .align 2, 0 +_0812212C: .4byte 0x03005d90 +_08122130: .4byte 0x030022c0 +_08122134: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08122142 + movs r0, 0x2 + b _08122144 +_08122142: + movs r0, 0 +_08122144: + pop {r1} + bx r1 + thumb_func_end sub_812210C + + thumb_func_start sub_8122148 +sub_8122148: @ 8122148 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _08122174 + ldr r0, _0812216C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _08122170 + cmp r1, r0 + beq _08122166 + bl in_trade_center + cmp r0, 0x1 + bne _08122174 +_08122166: + movs r0, 0 + b _08122176 + .align 2, 0 +_0812216C: .4byte 0x03005d8c +_08122170: .4byte 0x00001919 +_08122174: + movs r0, 0x1 +_08122176: + pop {r1} + bx r1 + thumb_func_end sub_8122148 + + thumb_func_start itemid_80BF6D8_mail_related +itemid_80BF6D8_mail_related: @ 812217C + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl is_c1_link_related_active + cmp r0, 0x1 + beq _08122192 + bl in_trade_center + cmp r0, 0x1 + bne _081221A4 +_08122192: + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081221A4 + movs r0, 0 + b _081221A6 +_081221A4: + movs r0, 0x1 +_081221A6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end itemid_80BF6D8_mail_related + + thumb_func_start sub_81221AC +sub_81221AC: @ 81221AC + push {lr} + bl is_c1_link_related_active + cmp r0, 0x1 + beq _081221BE + ldr r0, _081221C4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081221C8 +_081221BE: + movs r0, 0x1 + b _081221CA + .align 2, 0 +_081221C4: .4byte 0x03003124 +_081221C8: + movs r0, 0 +_081221CA: + pop {r1} + bx r1 + thumb_func_end sub_81221AC + + thumb_func_start sub_81221D0 +sub_81221D0: @ 81221D0 + push {lr} + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + beq _081221E6 + bl sub_8087598 + lsls r0, 24 + lsrs r0, 24 + b _081221E8 +_081221E6: + movs r0, 0 +_081221E8: + pop {r1} + bx r1 + thumb_func_end sub_81221D0 + + thumb_func_start sub_81221EC +sub_81221EC: @ 81221EC + push {lr} + bl sub_81221D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08122202 + bl sub_800B504 + cmp r0, 0x1 + bne _08122206 +_08122202: + movs r0, 0x1 + b _08122208 +_08122206: + movs r0, 0 +_08122208: + pop {r1} + bx r1 + thumb_func_end sub_81221EC + + thumb_func_start atk2D_jumpifarraynotequal +atk2D_jumpifarraynotequal: @ 812220C + push {r4-r6,lr} + adds r6, r2, 0 + ldr r2, [sp, 0x10] + lsls r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + adds r4, r0, 0 + movs r0, 0 + strb r0, [r3] + movs r2, 0 + lsrs r1, 24 + cmp r2, r1 + bcs _08122240 +_08122226: + lsls r0, r2, 2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _08122236 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_08122236: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r1 + bcc _08122226 +_08122240: + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, r5 + bls _08122252 + strb r5, [r6] + b _08122254 +_08122252: + strb r1, [r6] +_08122254: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk2D_jumpifarraynotequal + + thumb_func_start sub_812225C +sub_812225C: @ 812225C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldrh r0, [r4] + cmp r0, 0 + beq _0812227A + adds r0, r2 + cmp r0, r3 + ble _0812227A + subs r0, r3, r2 + strh r0, [r4] +_0812227A: + ldrh r0, [r4] + ldrh r1, [r5] + adds r0, r1 + cmp r0, r3 + blt _08122290 + cmp r3, 0 + bne _0812228C + strh r3, [r5] + b _08122290 +_0812228C: + subs r0, r3, 0x1 + strh r0, [r5] +_08122290: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812225C + + thumb_func_start sub_8122298 +sub_8122298: @ 8122298 + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, [sp, 0x14] + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r2, r0, 24 + lsrs r0, r2, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081222F0 + lsrs r2, 25 + ldrh r0, [r4] + cmp r0, r2 + bcc _08122322 + movs r1, 0 + subs r0, r2 + cmp r1, r0 + bge _08122322 + ldrh r0, [r5] + adds r0, r7 + cmp r0, r6 + beq _08122322 +_081222CC: + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r4] + subs r0, r2 + cmp r1, r0 + bge _08122322 + ldrh r0, [r5] + adds r0, r7 + cmp r0, r6 + bne _081222CC + b _08122322 +_081222F0: + ldrh r3, [r4] + lsrs r2, 25 + adds r0, r2, 0x1 + cmp r3, r0 + blt _08122322 + movs r1, 0 + subs r0, r3, r2 + b _08122316 +_08122300: + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r4] + subs r0, r2 +_08122316: + cmp r1, r0 + bgt _08122322 + ldrh r0, [r5] + adds r0, r7 + cmp r0, r6 + bne _08122300 +_08122322: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8122298 + + thumb_func_start sub_8122328 +sub_8122328: @ 8122328 + push {lr} + ldr r0, _0812233C + bl gpu_tile_obj_decompress_and_load + ldr r0, _08122340 + bl gpu_pal_obj_decompress_and_apply + pop {r0} + bx r0 + .align 2, 0 +_0812233C: .4byte 0x0859f514 +_08122340: .4byte 0x0859f51c + thumb_func_end sub_8122328 + + thumb_func_start sub_8122344 +sub_8122344: @ 8122344 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + cmp r5, r6 + bcs _0812239C + ldr r7, _081223A8 +_08122358: + lsls r1, r5, 4 + ldr r0, _081223AC + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + mov r1, r8 + adds r4, r1, r5 + strb r0, [r4] + cmp r5, 0 + beq _0812237E + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x1 + bl obj_anim_image_start +_0812237E: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _08122358 +_0812239C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081223A8: .4byte 0x02020630 +_081223AC: .4byte 0x0859f524 + thumb_func_end sub_8122344 + + thumb_func_start sub_81223B0 +sub_81223B0: @ 81223B0 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + cmp r4, r5 + bcs _081223F6 + ldr r7, _081223D8 +_081223C0: + subs r0, r5, 0x1 + cmp r4, r0 + bne _081223DC + adds r0, r6, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl obj_delete_and_free_resources + b _081223EC + .align 2, 0 +_081223D8: .4byte 0x02020630 +_081223DC: + adds r0, r6, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl obj_delete_and_free_tiles +_081223EC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081223C0 +_081223F6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81223B0 + + thumb_func_start sub_81223FC +sub_81223FC: @ 81223FC + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r0, r2, 24 + movs r3, 0 + cmp r3, r4 + bcs _0812243E + ldr r1, _08122444 + mov r12, r1 + movs r1, 0x1 + ands r0, r1 + lsls r5, r0, 2 + movs r7, 0x5 + negs r7, r7 +_0812241C: + adds r0, r6, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcc _0812241C +_0812243E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08122444: .4byte 0x02020630 + thumb_func_end sub_81223FC + + thumb_func_start sub_8122448 +sub_8122448: @ 8122448 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + movs r0, 0x80 + ands r0, r4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x7F + ands r4, r0 + movs r3, 0 + cmp r3, r4 + bcs _081224C8 + ldr r5, _0812249C + lsls r0, r7, 16 + asrs r0, 16 + subs r0, 0x8 + mov r12, r0 +_0812247E: + subs r0, r4, 0x1 + cmp r3, r0 + bne _081224A0 + mov r0, r8 + cmp r0, 0 + beq _081224A0 + adds r2, r6, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r12 + strh r1, [r0, 0x24] + b _081224AE + .align 2, 0 +_0812249C: .4byte 0x02020630 +_081224A0: + adds r2, r6, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x24] +_081224AE: + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r9 + adds r1, 0x1 + strh r1, [r0, 0x22] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcc _0812247E +_081224C8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8122448 + + thumb_func_start sub_81224D4 +sub_81224D4: @ 81224D4 + push {r4-r7,lr} + movs r6, 0 + ldr r5, _08122508 +_081224DA: + movs r0, 0xA + bl sub_811EE38 + ldr r1, [r5] + lsls r4, r6, 3 + adds r1, r4 + ldr r2, _0812250C + adds r1, r2 + strh r0, [r1] + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08122514 + movs r0, 0xC + bl sub_811EE38 + ldr r1, [r5] + adds r1, r4 + ldr r7, _08122510 + adds r1, r7 + b _08122522 + .align 2, 0 +_08122508: .4byte 0x03005d8c +_0812250C: .4byte 0x00002e6c +_08122510: .4byte 0x00002e6e +_08122514: + movs r0, 0xD + bl sub_811EE38 + ldr r1, [r5] + adds r1, r4 + ldr r2, _08122570 + adds r1, r2 +_08122522: + strh r0, [r1] + bl GenerateRandomNumber + ldr r3, [r5] + adds r3, r4 + movs r2, 0x1 + ands r2, r0 + ldr r7, _08122574 + adds r3, r7 + lsls r2, 6 + ldrb r0, [r3] + movs r7, 0x41 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldr r0, _08122578 + adds r1, r4, r0 + ldr r0, [r5] + adds r0, r1 + bl sub_8122B28 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x4 + bls _081224DA + ldr r0, _0812257C + ldr r0, [r0] + ldr r1, _08122578 + adds r0, r1 + movs r1, 0x5 + movs r2, 0 + bl sub_8122804 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08122570: .4byte 0x00002e6e +_08122574: .4byte 0x00002e69 +_08122578: .4byte 0x00002e68 +_0812257C: .4byte 0x03005d8c + thumb_func_end sub_81224D4 + + thumb_func_start sub_8122580 +sub_8122580: @ 8122580 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08122596 + b _081226BE +_08122596: + lsls r0, r1, 2 + adds r0, r1 + str r0, [sp] + movs r0, 0 + mov r10, r0 + movs r1, 0x7F + mov r9, r1 + movs r2, 0x80 + negs r2, r2 + mov r8, r2 +_081225AA: + ldr r2, [sp] + mov r3, r10 + lsls r0, r3, 3 + ldr r4, _081225F0 + adds r0, r4 + ldr r3, _081225F4 + ldr r1, [r3] + adds r5, r1, r0 + ldrb r6, [r5, 0x1] + movs r0, 0x40 + ands r0, r6 + cmp r0, 0 + bne _08122608 + ldrb r4, [r5] + lsls r3, r4, 25 + lsrs r1, r3, 25 + lsls r0, r2, 16 + lsrs r0, 16 + cmp r1, r0 + bcc _081225F8 + adds r0, r1, 0 + subs r0, r2 + mov r1, r9 + ands r0, r1 + mov r1, r8 + ands r1, r4 + orrs r1, r0 + strb r1, [r5] + movs r0, 0x7F + ands r1, r0 + cmp r1, 0 + bne _0812269E + movs r0, 0x40 + orrs r0, r6 + b _0812269C + .align 2, 0 +_081225F0: .4byte 0x00002e68 +_081225F4: .4byte 0x03005d8c +_081225F8: + lsrs r0, r3, 25 + subs r2, r0 + mov r0, r8 + ands r0, r4 + strb r0, [r5] + movs r0, 0x40 + orrs r0, r6 + strb r0, [r5, 0x1] +_08122608: + ldrb r7, [r5] + lsls r0, r7, 25 + lsrs r0, 25 + adds r4, r0, r2 + ldrh r0, [r5] + lsls r6, r0, 18 + lsls r0, r4, 16 + lsrs r0, 16 + lsrs r1, r6, 25 + cmp r0, r1 + bls _08122678 + adds r0, r4, 0 + bl __umodsi3 + adds r3, r0, 0 + lsrs r1, r6, 25 + adds r0, r4, 0 + str r3, [sp, 0x4] + bl __udivsi3 + adds r4, r0, 0 + movs r0, 0x1 + eors r4, r0 + ands r4, r0 + lsls r2, r4, 6 + ldrb r0, [r5, 0x1] + movs r4, 0x41 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x1] + movs r1, 0x40 + ands r0, r1 + ldr r3, [sp, 0x4] + cmp r0, 0 + beq _08122662 + adds r1, r3, 0 + mov r0, r9 + ands r1, r0 + mov r0, r8 + ands r0, r7 + orrs r0, r1 + strb r0, [r5] + b _0812269E +_08122662: + ldrh r0, [r5] + lsls r0, 18 + lsrs r0, 25 + subs r0, r3 + mov r1, r9 + ands r0, r1 + mov r1, r8 + ands r1, r7 + orrs r1, r0 + strb r1, [r5] + b _0812269E +_08122678: + mov r2, r9 + ands r4, r2 + mov r0, r8 + ands r0, r7 + orrs r0, r4 + strb r0, [r5] + lsls r0, 25 + ldrh r1, [r5] + lsls r1, 18 + lsrs r0, 25 + lsrs r1, 25 + cmp r0, r1 + bne _0812269E + ldrb r0, [r5, 0x1] + movs r3, 0x41 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 +_0812269C: + strb r0, [r5, 0x1] +_0812269E: + mov r0, r10 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + cmp r0, 0x4 + bhi _081226AE + b _081225AA +_081226AE: + ldr r4, _081226D0 + ldr r0, [r4] + ldr r1, _081226D4 + adds r0, r1 + movs r1, 0x5 + movs r2, 0 + bl sub_8122804 +_081226BE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081226D0: .4byte 0x03005d8c +_081226D4: .4byte 0x00002e68 + thumb_func_end sub_8122580 + + thumb_func_start sub_81226D8 +sub_81226D8: @ 81226D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, r8 + bl sub_8122BB0 + lsls r0, 24 + cmp r0, 0 + beq _081226F8 + b _081227F2 +_081226F8: + ldr r4, _08122734 + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08122744 + adds r0, r4, 0 + bl flag_set + ldr r0, _08122738 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08122744 + ldr r0, _0812273C + ldr r1, [r0] + mov r0, r8 + ldrh r2, [r0] + ldr r3, _08122740 + adds r0, r1, r3 + strh r2, [r0] + mov r2, r8 + ldrh r0, [r2, 0x2] + adds r3, 0x2 + adds r1, r3 + strh r0, [r1] + movs r0, 0x1 + b _081227F4 + .align 2, 0 +_08122734: .4byte 0x00000893 +_08122738: .4byte 0x00000894 +_0812273C: .4byte 0x03005d8c +_08122740: .4byte 0x00002e6c +_08122744: + mov r0, r8 + ldrh r1, [r0, 0x2] + lsls r1, 16 + ldrh r0, [r0] + orrs r0, r1 + str r0, [sp, 0x4] + movs r1, 0x80 + lsls r1, 7 + ldr r0, [sp] + orrs r0, r1 + str r0, [sp] + mov r0, sp + bl sub_8122B28 + movs r5, 0 +_08122762: + ldr r6, _081227CC + lsls r4, r5, 3 + ldr r1, _081227D0 + adds r0, r4, r1 + ldr r1, [r6] + adds r1, r0 + mov r0, sp + movs r2, 0 + bl atk90_changetypestoenemyattacktype + lsls r0, 24 + adds r7, r4, 0 + cmp r0, 0 + beq _081227D4 + movs r2, 0x4 + mov r12, r6 + cmp r2, r5 + bls _081227A6 + ldr r4, _081227D0 +_08122788: + ldr r0, [r6] + lsls r3, r2, 3 + adds r0, r4 + adds r3, r0, r3 + subs r2, 0x1 + lsls r1, r2, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r3] + str r1, [r3, 0x4] + lsls r2, 16 + lsrs r2, 16 + cmp r2, r5 + bhi _08122788 +_081227A6: + mov r3, r12 + ldr r2, [r3] + ldr r0, _081227D0 + adds r2, r0 + adds r2, r7 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + cmp r5, 0x4 + bne _081227C2 + mov r0, r8 + bl sub_80EDC60 +_081227C2: + movs r0, 0 + cmp r5, 0 + bne _081227F4 + movs r0, 0x1 + b _081227F4 + .align 2, 0 +_081227CC: .4byte 0x03005d8c +_081227D0: .4byte 0x00002e68 +_081227D4: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bls _08122762 + ldr r2, [r6] + ldr r1, _08122800 + adds r2, r1 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r8 + bl sub_80EDC60 +_081227F2: + movs r0, 0 +_081227F4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08122800: .4byte 0x00002e88 + thumb_func_end sub_81226D8 + + thumb_func_start sub_8122804 +sub_8122804: @ 8122804 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + movs r2, 0 + cmp r2, r7 + bcs _0812286C +_08122820: + adds r1, r2, 0x1 + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r8, r1 + cmp r5, r7 + bcs _08122862 + lsls r0, r2, 3 + mov r1, r9 + adds r6, r1, r0 +_08122832: + lsls r0, r5, 3 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r10 + bl atk90_changetypestoenemyattacktype + lsls r0, 24 + cmp r0, 0 + beq _08122858 + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r6] + ldr r1, [r6, 0x4] + str r0, [r4] + str r1, [r4, 0x4] + str r2, [r6] + str r3, [r6, 0x4] +_08122858: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r7 + bcc _08122832 +_08122862: + mov r1, r8 + lsls r0, r1, 16 + lsrs r2, r0, 16 + cmp r2, r7 + bcc _08122820 +_0812286C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8122804 + + thumb_func_start sub_812287C +sub_812287C: @ 812287C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + adds r6, r1, 0 + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + bl malloc + mov r10, r0 + cmp r0, 0 + beq _08122980 + adds r0, r4, 0 + bl malloc + adds r7, r0, 0 + cmp r7, 0 + bne _081228B0 + mov r0, r10 + bl free + b _08122980 +_081228B0: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r5, r9 + bcs _081228DE +_081228C0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r10 + adds r1, r5, 0 + muls r1, r6 + add r1, r8 + movs r2, 0x28 + bl memcpy + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r9 + bcc _081228C0 +_081228DE: + mov r4, r10 + mov r8, r7 + movs r3, 0 + movs r5, 0 + cmp r5, r9 + bcs _08122946 +_081228EA: + movs r6, 0 +_081228EC: + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r3, 0 + str r3, [sp] + bl sub_8122C1C + lsls r0, 16 + asrs r0, 16 + ldr r3, [sp] + cmp r0, 0 + bge _08122918 + ldr r0, [r4] + ldr r1, [r4, 0x4] + mov r2, r8 + adds r2, 0x8 + mov r8, r2 + subs r2, 0x8 + stm r2!, {r0,r1} + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + b _08122930 +_08122918: + lsls r0, 3 + adds r2, r7, r0 + ldrb r1, [r2] + lsls r1, 25 + ldrb r0, [r4] + lsls r0, 25 + cmp r1, r0 + bcs _08122930 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] +_08122930: + adds r4, 0x8 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x4 + bls _081228EC + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r9 + bcc _081228EA +_08122946: + adds r0, r7, 0 + adds r1, r3, 0 + movs r2, 0x2 + bl sub_8122804 + adds r4, r7, 0 + ldr r0, _08122990 + ldr r0, [r0] + ldr r1, _08122994 + adds r1, r0 + mov r8, r1 + movs r5, 0 +_0812295E: + ldm r4!, {r0,r1} + mov r2, r8 + adds r2, 0x8 + mov r8, r2 + subs r2, 0x8 + stm r2!, {r0,r1} + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bls _0812295E + mov r0, r10 + bl free + adds r0, r7, 0 + bl free +_08122980: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08122990: .4byte 0x03005d8c +_08122994: .4byte 0x00002e68 + thumb_func_end sub_812287C + + thumb_func_start sub_8122998 +sub_8122998: @ 8122998 + push {lr} + ldr r2, _081229B8 + ldr r0, _081229BC + ldrh r1, [r0] + lsls r1, 3 + ldr r0, [r2] + adds r1, r0 + ldr r0, _081229C0 + ldr r2, _081229C4 + adds r1, r2 + movs r2, 0x2 + movs r3, 0x1 + bl sub_811EC08 + pop {r0} + bx r0 + .align 2, 0 +_081229B8: .4byte 0x03005d8c +_081229BC: .4byte 0x020375e0 +_081229C0: .4byte 0x02021cc4 +_081229C4: .4byte 0x00002e6c + thumb_func_end sub_8122998 + + thumb_func_start sub_81229C8 +sub_81229C8: @ 81229C8 + push {r4,lr} + movs r4, 0 + ldr r0, _08122A18 + ldr r3, [r0] + ldr r1, _08122A1C + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 25 + lsrs r1, 25 + ldr r2, _08122A20 + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 25 + subs r1, r0 + cmp r1, 0x1 + bgt _08122A0C + ldr r1, _08122A24 + adds r0, r3, r1 + ldrb r1, [r0] + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08122A0C + ldr r1, _08122A28 + adds r0, r3, r1 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r4, r0, 31 +_08122A0C: + ldr r0, _08122A2C + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08122A18: .4byte 0x03005d8c +_08122A1C: .4byte 0x00002e68 +_08122A20: .4byte 0x00002e70 +_08122A24: .4byte 0x00002e69 +_08122A28: .4byte 0x00002e71 +_08122A2C: .4byte 0x020375f0 + thumb_func_end sub_81229C8 + + thumb_func_start sub_8122A30 +sub_8122A30: @ 8122A30 + ldr r2, _08122A4C + ldr r0, _08122A50 + ldr r0, [r0] + ldr r3, _08122A54 + adds r1, r0, r3 + adds r3, 0x2 + adds r0, r3 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r2] + bx lr + .align 2, 0 +_08122A4C: .4byte 0x020375f0 +_08122A50: .4byte 0x03005d8c +_08122A54: .4byte 0x00002e6c + thumb_func_end sub_8122A30 + + thumb_func_start atk90_changetypestoenemyattacktype +atk90_changetypestoenemyattacktype: @ 8122A58 + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r2, 0 + cmp r2, 0x1 + beq _08122A9E + cmp r2, 0x1 + bgt _08122A72 + cmp r2, 0 + beq _08122A78 + b _08122B1A +_08122A72: + cmp r0, 0x2 + beq _08122ACA + b _08122B1A +_08122A78: + ldrb r0, [r3] + lsls r1, r0, 25 + ldrb r0, [r5] + lsls r0, 25 + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r0, [r3] + lsls r3, r0, 18 + ldrh r0, [r5] + lsls r2, r0, 18 + lsrs r1, r3, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bhi _08122B16 + lsrs r1, r3, 25 + lsrs r0, r2, 25 + b _08122AC2 +_08122A9E: + ldrh r0, [r3] + lsls r4, r0, 18 + ldrh r0, [r5] + lsls r2, r0, 18 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bhi _08122B16 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bcc _08122AC6 + ldrb r0, [r3] + lsls r1, r0, 25 + ldrb r0, [r5] + lsls r0, 25 + cmp r1, r0 + bhi _08122B16 +_08122AC2: + cmp r1, r0 + bcs _08122B1A +_08122AC6: + movs r0, 0 + b _08122B22 +_08122ACA: + ldrb r0, [r3] + lsls r1, r0, 25 + ldrb r0, [r5] + lsls r0, 25 + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r0, [r3] + lsls r4, r0, 18 + ldrh r0, [r5] + lsls r2, r0, 18 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bhi _08122B16 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bcc _08122AC6 + ldrh r1, [r3, 0x2] + ldrh r0, [r5, 0x2] + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r1, [r3, 0x4] + ldrh r0, [r5, 0x4] + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r1, [r3, 0x6] + ldrh r0, [r5, 0x6] + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 +_08122B16: + movs r0, 0x1 + b _08122B22 +_08122B1A: + bl GenerateRandomNumber + movs r1, 0x1 + ands r0, r1 +_08122B22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end atk90_changetypestoenemyattacktype + + thumb_func_start sub_8122B28 +sub_8122B28: @ 8122B28 + push {r4,r5,lr} + adds r5, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x62 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x32 + bls _08122B6A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x62 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x50 + bls _08122B6A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x62 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_08122B6A: + adds r1, r4, 0 + adds r1, 0x1E + movs r0, 0x7F + ands r1, r0 + lsls r1, 7 + ldrh r2, [r5] + ldr r0, _08122BAC + ands r0, r2 + orrs r0, r1 + strh r0, [r5] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0x1 + bl __modsi3 + adds r0, 0x1E + movs r1, 0x7F + ands r0, r1 + ldrb r2, [r5] + movs r1, 0x80 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5] + bl GenerateRandomNumber + strh r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08122BAC: .4byte 0xffffc07f + thumb_func_end sub_8122B28 + + thumb_func_start sub_8122BB0 +sub_8122BB0: @ 8122BB0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, _08122BD4 +_08122BB8: + lsls r1, r4, 3 + ldr r0, [r6] + adds r1, r0 + ldr r0, _08122BD8 + adds r1, r0 + adds r0, r5, 0 + bl sub_8122BF0 + lsls r0, 24 + cmp r0, 0 + beq _08122BDC + movs r0, 0x1 + b _08122BE8 + .align 2, 0 +_08122BD4: .4byte 0x03005d8c +_08122BD8: .4byte 0x00002e6c +_08122BDC: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08122BB8 + movs r0, 0 +_08122BE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8122BB0 + + thumb_func_start sub_8122BF0 +sub_8122BF0: @ 8122BF0 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r4, 0 +_08122BF8: + ldrh r1, [r3] + ldrh r0, [r2] + adds r2, 0x2 + adds r3, 0x2 + cmp r1, r0 + beq _08122C08 + movs r0, 0 + b _08122C14 +_08122C08: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _08122BF8 + movs r0, 0x1 +_08122C14: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8122BF0 + + thumb_func_start sub_8122C1C +sub_8122C1C: @ 8122C1C + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + lsls r2, 16 + lsrs r6, r2, 16 + movs r4, 0 + cmp r4, r6 + bge _08122C52 +_08122C2C: + adds r1, r5, 0x4 + adds r0, r7, 0x4 + bl sub_8122BF0 + lsls r0, 24 + cmp r0, 0 + beq _08122C40 + lsls r0, r4, 16 + asrs r0, 16 + b _08122C56 +_08122C40: + adds r5, 0x8 + lsls r0, r4, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, r6 + blt _08122C2C +_08122C52: + movs r0, 0x1 + negs r0, r0 +_08122C56: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8122C1C + + thumb_func_start sub_8122C5C +sub_8122C5C: @ 8122C5C + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r1, 16 + movs r3, 0 + ldr r2, _08122C80 +_08122C6A: + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, r4 + bne _08122C84 + movs r0, 0x1 + ldrsb r0, [r2, r0] + cmp r0, r1 + bne _08122C84 + adds r0, r3, 0x1 + b _08122C8E + .align 2, 0 +_08122C80: .4byte 0x0859f53c +_08122C84: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x15 + bls _08122C6A + movs r0, 0 +_08122C8E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8122C5C + + thumb_func_start sub_8122C94 +sub_8122C94: @ 8122C94 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_8122C5C + cmp r0, 0 + beq _08122CB4 + lsls r0, 3 + ldr r1, _08122CB0 + adds r0, r1 + b _08122CB6 + .align 2, 0 +_08122CB0: .4byte 0x0859f534 +_08122CB4: + movs r0, 0 +_08122CB6: + pop {r1} + bx r1 + thumb_func_end sub_8122C94 + + thumb_func_start sub_8122CBC +sub_8122CBC: @ 8122CBC + push {lr} + cmp r0, 0 + beq _08122CD4 + cmp r0, 0x16 + bhi _08122CD4 + lsls r0, 3 + ldr r1, _08122CD0 + adds r0, r1 + b _08122CD6 + .align 2, 0 +_08122CD0: .4byte 0x0859f534 +_08122CD4: + movs r0, 0 +_08122CD6: + pop {r1} + bx r1 + thumb_func_end sub_8122CBC + + thumb_func_start sub_8122CDC +sub_8122CDC: @ 8122CDC + push {lr} + lsls r2, r1, 24 + lsrs r2, 24 + movs r1, 0 + bl sub_8122CF8 +_08122CE8: + bl sub_8122DB0 + lsls r0, 24 + cmp r0, 0 + bne _08122CE8 + pop {r0} + bx r0 + thumb_func_end sub_8122CDC + + thumb_func_start sub_8122CF8 +sub_8122CF8: @ 8122CF8 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08122D20 + str r0, [r3] + movs r1, 0x79 + adds r1, r0 + mov r12, r1 + movs r1, 0 + mov r5, r12 + strb r1, [r5] + adds r0, 0x78 + strb r2, [r0] + ldr r1, [r3] + cmp r2, 0x1 + bne _08122D28 + ldr r0, _08122D24 + b _08122D2A + .align 2, 0 +_08122D20: .4byte 0x0203a144 +_08122D24: .4byte sub_8123254 + 1 +_08122D28: + ldr r0, _08122D60 +_08122D2A: + str r0, [r1, 0x18] + cmp r4, 0 + beq _08122D64 + ldr r1, [r3] + ldr r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r1, 0x80 + strb r0, [r1] + ldr r1, [r3] + ldr r0, [r4] + lsls r0, 28 + lsrs r0, 30 + adds r1, 0x81 + strb r0, [r1] + ldr r1, [r3] + ldr r0, [r4] + lsls r0, 23 + lsrs r0, 27 + adds r1, 0x82 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x83 + movs r1, 0x1 + strb r1, [r0] + b _08122D80 + .align 2, 0 +_08122D60: .4byte sub_81230C4 + 1 +_08122D64: + ldr r0, [r3] + adds r0, 0x80 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x81 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x82 + movs r1, 0x1C + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x83 + strb r4, [r0] +_08122D80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8122CF8 + + thumb_func_start sub_8122D88 +sub_8122D88: @ 8122D88 + push {r4,lr} + ldr r4, _08122DAC + str r0, [r4] + bl sub_81238AC + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x54 + ldrh r1, [r0] + adds r0, 0x20 + strh r1, [r0] + subs r0, 0x1E + ldrh r1, [r0] + adds r0, 0x20 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08122DAC: .4byte 0x0203a144 + thumb_func_end sub_8122D88 + + thumb_func_start sub_8122DB0 +sub_8122DB0: @ 8122DB0 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _08122DCC + ldr r0, [r0] + adds r0, 0x79 + ldrb r0, [r0] + cmp r0, 0x7 + bls _08122DC2 + b _0812300C +_08122DC2: + lsls r0, 2 + ldr r1, _08122DD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08122DCC: .4byte 0x0203a144 +_08122DD0: .4byte _08122DD4 + .align 2, 0 +_08122DD4: + .4byte _08122DF4 + .4byte _08122E2C + .4byte _08122E78 + .4byte _08122E94 + .4byte _08122EB0 + .4byte _08122ECC + .4byte _08122F10 + .4byte _08122F8C +_08122DF4: + ldr r0, _08122E10 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x83 + ldrb r0, [r0] + cmp r0, 0 + beq _08122E18 + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + ldr r1, _08122E14 + movs r2, 0 + str r2, [sp] + b _08122E52 + .align 2, 0 +_08122E10: .4byte 0x0203a144 +_08122E14: .4byte 0x0859f77c +_08122E18: + ldr r0, _08122E24 + ldr r1, _08122E28 + bl LZ77UnCompVram + b _08123014 + .align 2, 0 +_08122E24: .4byte 0x0859f77c +_08122E28: .4byte 0x06008000 +_08122E2C: + ldr r4, _08122E5C + ldr r0, [r4] + adds r0, 0x83 + ldrb r0, [r0] + cmp r0, 0 + beq _08122E64 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08122E44 + b _08123014 +_08122E44: + ldr r0, [r4] + adds r0, 0x80 + ldrb r0, [r0] + ldr r1, _08122E60 + movs r2, 0x1 + str r2, [sp] + movs r2, 0 +_08122E52: + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08123014 + .align 2, 0 +_08122E5C: .4byte 0x0203a144 +_08122E60: .4byte 0x085a04e0 +_08122E64: + ldr r0, _08122E70 + ldr r1, _08122E74 + bl LZ77UnCompVram + b _08123014 + .align 2, 0 +_08122E70: .4byte 0x085a04e0 +_08122E74: .4byte 0x0600e000 +_08122E78: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08122E84 + b _08123014 +_08122E84: + ldr r0, _08122E90 + movs r1, 0x70 + movs r2, 0x60 + bl gpu_pal_apply + b _08123014 + .align 2, 0 +_08122E90: .4byte 0x0859f73c +_08122E94: + ldr r0, _08122EA8 + ldr r1, _08122EAC + ldr r1, [r1] + movs r2, 0xC2 + lsls r2, 1 + adds r1, r2 + bl LZ77UnCompWram + b _08123014 + .align 2, 0 +_08122EA8: .4byte 0x0859f60c +_08122EAC: .4byte 0x0203a144 +_08122EB0: + ldr r0, _08122EC4 + ldr r1, _08122EC8 + ldr r1, [r1] + movs r5, 0xA1 + lsls r5, 2 + adds r1, r5 + bl LZ77UnCompWram + b _08123014 + .align 2, 0 +_08122EC4: .4byte 0x0859f650 +_08122EC8: .4byte 0x0203a144 +_08122ECC: + bl sub_81238AC + ldr r4, _08122F0C + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x54 + ldrh r1, [r0] + adds r0, 0x20 + strh r1, [r0] + subs r0, 0x1E + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x76 + strh r0, [r1] + ldrh r0, [r2] + bl sub_8123EB4 + ldr r1, [r4] + strh r0, [r1] + ldrh r0, [r1] + bl get_flagnr_blue_points + ldr r1, [r4] + strb r0, [r1, 0x2] + ldr r1, [r4] + adds r0, r1, 0x4 + ldrh r1, [r1] + movs r2, 0x10 + bl GetMapName + b _08123014 + .align 2, 0 +_08122F0C: .4byte 0x0203a144 +_08122F10: + ldr r0, _08122F38 + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x78 + ldrb r1, [r0] + cmp r1, 0 + bne _08122F3C + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81236C4 + b _08123014 + .align 2, 0 +_08122F38: .4byte 0x0203a144 +_08122F3C: + adds r1, r4, 0 + adds r1, 0x54 + ldrh r0, [r1] + lsls r0, 3 + subs r0, 0x34 + adds r2, r4, 0 + adds r2, 0x5C + movs r3, 0 + strh r0, [r2] + movs r0, 0x56 + adds r0, r4 + mov r12, r0 + ldrh r0, [r0] + lsls r0, 3 + subs r0, 0x44 + adds r5, r4, 0 + adds r5, 0x5E + strh r0, [r5] + ldrh r1, [r1] + adds r0, r4, 0 + adds r0, 0x64 + strh r1, [r0] + mov r0, r12 + ldrh r1, [r0] + adds r0, r4, 0 + adds r0, 0x66 + strh r1, [r0] + movs r1, 0 + ldrsh r0, [r2, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x80 + str r2, [sp] + str r2, [sp, 0x4] + str r3, [sp, 0x8] + movs r2, 0x38 + movs r3, 0x48 + bl sub_81236C4 + b _08123014 +_08122F8C: + bl sub_8123FB0 + bl sub_81237B4 + ldr r4, _08123010 + ldr r0, [r4] + movs r1, 0 + str r1, [r0, 0x1C] + str r1, [r0, 0x20] + adds r0, 0x7A + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x7E + strb r1, [r0] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x83 + ldrb r0, [r0] + cmp r0, 0 + beq _08123002 + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + movs r1, 0x3 + movs r2, 0x2 + bl gpu_bg_config_set_field + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + adds r1, 0x81 + ldrb r2, [r1] + movs r1, 0x1 + bl gpu_bg_config_set_field + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + adds r1, 0x82 + ldrb r2, [r1] + movs r1, 0x2 + bl gpu_bg_config_set_field + ldr r0, [r4] + adds r0, 0x80 + ldrb r0, [r0] + movs r1, 0x6 + movs r2, 0x1 + bl gpu_bg_config_set_field + ldr r0, [r4] + adds r0, 0x80 + ldrb r0, [r0] + movs r1, 0x4 + movs r2, 0x1 + bl gpu_bg_config_set_field +_08123002: + ldr r1, [r4] + adds r1, 0x79 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0812300C: + movs r0, 0 + b _08123022 + .align 2, 0 +_08123010: .4byte 0x0203a144 +_08123014: + ldr r0, _0812302C + ldr r1, [r0] + adds r1, 0x79 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_08123022: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0812302C: .4byte 0x0203a144 + thumb_func_end sub_8122DB0 + + thumb_func_start sub_8123030 +sub_8123030: @ 8123030 + push {lr} + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0xE0 + lsls r0, 2 + lsls r1, 24 + lsrs r1, 24 + bl sub_80A2A20 + ldr r0, _08123054 + ldr r1, _08123058 + movs r2, 0x30 + bl CpuSet + pop {r0} + bx r0 + .align 2, 0 +_08123054: .4byte 0x02037bf4 +_08123058: .4byte 0x020377f4 + thumb_func_end sub_8123030 + + thumb_func_start sub_812305C +sub_812305C: @ 812305C + push {r4,lr} + ldr r4, _081230A8 + ldr r0, [r4] + ldr r0, [r0, 0x1C] + cmp r0, 0 + beq _08123080 + bl obj_delete_and_free_tiles + ldr r0, [r4] + adds r0, 0x58 + ldrh r0, [r0] + bl gpu_tile_obj_free_by_tag + ldr r0, [r4] + adds r0, 0x5A + ldrh r0, [r0] + bl gpu_pal_free_tag +_08123080: + ldr r0, [r4] + ldr r0, [r0, 0x20] + cmp r0, 0 + beq _081230A0 + bl obj_delete_and_free_tiles + ldr r0, [r4] + adds r0, 0x70 + ldrh r0, [r0] + bl gpu_tile_obj_free_by_tag + ldr r0, [r4] + adds r0, 0x72 + ldrh r0, [r0] + bl gpu_pal_free_tag +_081230A0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081230A8: .4byte 0x0203a144 + thumb_func_end sub_812305C + + thumb_func_start sub_81230AC +sub_81230AC: @ 81230AC + push {lr} + ldr r0, _081230C0 + ldr r0, [r0] + ldr r0, [r0, 0x18] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081230C0: .4byte 0x0203a144 + thumb_func_end sub_81230AC + + thumb_func_start sub_81230C4 +sub_81230C4: @ 81230C4 + push {r4,lr} + movs r4, 0 + ldr r2, _08123160 + ldr r0, [r2] + adds r0, 0x7B + strb r4, [r0] + ldr r0, [r2] + adds r0, 0x7C + strb r4, [r0] + ldr r3, _08123164 + ldrh r1, [r3, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081230F6 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x56 + ldrh r0, [r0] + cmp r0, 0x2 + bls _081230F6 + adds r1, 0x7C + movs r0, 0xFF + strb r0, [r1] + movs r4, 0x1 +_081230F6: + ldrh r1, [r3, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08123114 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x56 + ldrh r0, [r0] + cmp r0, 0xF + bhi _08123114 + adds r1, 0x7C + movs r0, 0x1 + strb r0, [r1] + movs r4, 0x1 +_08123114: + ldrh r1, [r3, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08123132 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + cmp r0, 0x1 + bls _08123132 + adds r1, 0x7B + movs r0, 0xFF + strb r0, [r1] + movs r4, 0x1 +_08123132: + ldrh r1, [r3, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08123150 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + cmp r0, 0x1B + bhi _08123150 + adds r1, 0x7B + movs r0, 0x1 + strb r0, [r1] + movs r4, 0x1 +_08123150: + ldrh r3, [r3, 0x2E] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _08123168 + movs r4, 0x4 + b _08123172 + .align 2, 0 +_08123160: .4byte 0x0203a144 +_08123164: .4byte 0x030022c0 +_08123168: + movs r0, 0x2 + ands r0, r3 + cmp r0, 0 + beq _08123172 + movs r4, 0x5 +_08123172: + cmp r4, 0x1 + bne _08123184 + ldr r0, [r2] + adds r0, 0x7A + movs r1, 0x4 + strb r1, [r0] + ldr r1, [r2] + ldr r0, _0812318C + str r0, [r1, 0x18] +_08123184: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812318C: .4byte _swiopen + 1 + thumb_func_end sub_81230C4 + + thumb_func_start _swiopen +_swiopen: @ 8123190 + push {r4,r5,lr} + ldr r5, _081231A8 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7A + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _081231AC + movs r0, 0x2 + b _08123248 + .align 2, 0 +_081231A8: .4byte 0x0203a144 +_081231AC: + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _081231C2 + adds r1, 0x54 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081231C2: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _081231DA + adds r1, 0x54 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081231DA: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _081231F2 + adds r1, 0x56 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081231F2: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _0812320A + adds r1, 0x56 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_0812320A: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + adds r1, 0x56 + ldrh r1, [r1] + bl sub_812386C + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl get_flagnr_blue_points + ldr r1, [r5] + strb r0, [r1, 0x2] + ldr r1, [r5] + ldrh r0, [r1] + cmp r4, r0 + beq _0812323C + strh r4, [r1] + adds r0, r1, 0x4 + ldrh r1, [r1] + movs r2, 0x10 + bl GetMapName +_0812323C: + bl sub_8123FB0 + ldr r1, [r5] + ldr r0, _08123250 + str r0, [r1, 0x18] + movs r0, 0x3 +_08123248: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08123250: .4byte sub_81230C4 + 1 + thumb_func_end _swiopen + + thumb_func_start sub_8123254 +sub_8123254: @ 8123254 + push {r4-r6,lr} + movs r4, 0 + ldr r3, _08123324 + ldr r0, [r3] + mov r12, r0 + adds r0, 0x6A + strh r4, [r0] + mov r5, r12 + adds r5, 0x68 + strh r4, [r5] + ldr r2, _08123328 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + adds r6, r3, 0 + adds r3, r2, 0 + cmp r0, 0 + beq _0812328E + mov r0, r12 + adds r0, 0x5E + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x34 + negs r0, r0 + cmp r1, r0 + ble _0812328E + ldr r0, _0812332C + strh r0, [r5] + movs r4, 0x1 +_0812328E: + ldrh r1, [r3, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081232AE + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x5E + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, 0x3B + bgt _081232AE + adds r1, 0x68 + movs r0, 0x1 + strh r0, [r1] + movs r4, 0x1 +_081232AE: + ldrh r1, [r3, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081232D4 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x5C + movs r5, 0 + ldrsh r1, [r0, r5] + movs r0, 0x2C + negs r0, r0 + cmp r1, r0 + ble _081232D4 + adds r1, r2, 0 + adds r1, 0x6A + ldr r0, _0812332C + strh r0, [r1] + movs r4, 0x1 +_081232D4: + ldrh r1, [r3, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081232F4 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x5C + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0xAB + bgt _081232F4 + adds r1, 0x6A + movs r0, 0x1 + strh r0, [r1] + movs r4, 0x1 +_081232F4: + ldrh r2, [r3, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08123300 + movs r4, 0x4 +_08123300: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0812330A + movs r4, 0x5 +_0812330A: + cmp r4, 0x1 + bne _0812331A + ldr r0, [r6] + ldr r1, _08123330 + str r1, [r0, 0x18] + adds r0, 0x6C + movs r1, 0 + strh r1, [r0] +_0812331A: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08123324: .4byte 0x0203a144 +_08123328: .4byte 0x030022c0 +_0812332C: .4byte 0x0000ffff +_08123330: .4byte sub_8123334 + 1 + thumb_func_end sub_8123254 + + thumb_func_start sub_8123334 +sub_8123334: @ 8123334 + push {r4,r5,lr} + ldr r5, _08123408 + ldr r2, [r5] + adds r3, r2, 0 + adds r3, 0x5E + adds r0, r2, 0 + adds r0, 0x68 + ldrh r0, [r0] + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + adds r1, r2, 0 + adds r1, 0x5C + adds r0, r2, 0 + adds r0, 0x6A + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + movs r2, 0 + ldrsh r1, [r3, r2] + bl sub_812378C + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x6C + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bne _08123410 + adds r0, r2, 0 + adds r0, 0x5C + movs r3, 0 + ldrsh r1, [r0, r3] + adds r0, r1, 0 + adds r0, 0x2C + cmp r0, 0 + bge _0812338C + adds r0, 0x7 +_0812338C: + asrs r0, 3 + adds r0, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r2, 0 + adds r0, 0x5E + movs r4, 0 + ldrsh r1, [r0, r4] + adds r0, r1, 0 + adds r0, 0x34 + cmp r0, 0 + bge _081233A6 + adds r0, 0x7 +_081233A6: + asrs r0, 3 + adds r0, 0x2 + lsls r0, 16 + lsrs r1, r0, 16 + adds r4, r2, 0 + adds r4, 0x64 + adds r0, r2, 0 + adds r0, 0x66 + ldrh r2, [r4] + cmp r3, r2 + bne _081233C2 + ldrh r2, [r0] + cmp r1, r2 + beq _081233F2 +_081233C2: + strh r3, [r4] + strh r1, [r0] + adds r0, r3, 0 + bl sub_812386C + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl get_flagnr_blue_points + ldr r1, [r5] + strb r0, [r1, 0x2] + ldr r1, [r5] + ldrh r3, [r1] + cmp r4, r3 + beq _081233EE + strh r4, [r1] + adds r0, r1, 0x4 + ldrh r1, [r1] + movs r2, 0x10 + bl GetMapName +_081233EE: + bl sub_8123FB0 +_081233F2: + ldr r0, _08123408 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x6C + movs r0, 0 + strh r0, [r1] + ldr r0, _0812340C + str r0, [r2, 0x18] + movs r0, 0x3 + b _08123412 + .align 2, 0 +_08123408: .4byte 0x0203a144 +_0812340C: .4byte sub_8123254 + 1 +_08123410: + movs r0, 0x2 +_08123412: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8123334 + + thumb_func_start sub_8123418 +sub_8123418: @ 8123418 + push {r4-r6,lr} + ldr r1, _08123494 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x78 + ldrb r3, [r0] + adds r5, r1, 0 + cmp r3, 0 + bne _0812349C + subs r0, 0x1A + strh r3, [r0] + subs r0, 0x2 + strh r3, [r0] + str r3, [r2, 0x40] + str r3, [r2, 0x3C] + adds r4, r2, 0 + adds r4, 0x54 + ldrh r0, [r4] + lsls r0, 3 + subs r0, 0x34 + adds r1, r2, 0 + adds r1, 0x60 + strh r0, [r1] + movs r0, 0x56 + adds r0, r2 + mov r12, r0 + ldrh r0, [r0] + lsls r0, 3 + subs r0, 0x44 + adds r3, r2, 0 + adds r3, 0x62 + strh r0, [r3] + movs r6, 0 + ldrsh r0, [r1, r6] + lsls r0, 8 + cmp r0, 0 + bge _08123464 + adds r0, 0xF +_08123464: + asrs r0, 4 + str r0, [r2, 0x44] + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r0, 8 + cmp r0, 0 + bge _08123474 + adds r0, 0xF +_08123474: + asrs r0, 4 + str r0, [r2, 0x48] + ldrh r1, [r4] + adds r0, r2, 0 + adds r0, 0x64 + strh r1, [r0] + mov r3, r12 + ldrh r0, [r3] + adds r1, r2, 0 + adds r1, 0x66 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 9 + str r0, [r2, 0x4C] + ldr r0, _08123498 + b _081234FA + .align 2, 0 +_08123494: .4byte 0x0203a144 +_08123498: .4byte 0xfffff800 +_0812349C: + adds r0, r2, 0 + adds r0, 0x5C + movs r6, 0 + ldrsh r0, [r0, r6] + lsls r0, 8 + str r0, [r2, 0x3C] + adds r0, r2, 0 + adds r0, 0x5E + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 8 + str r0, [r2, 0x40] + adds r0, r2, 0 + adds r0, 0x60 + movs r1, 0 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + ldr r0, [r2, 0x3C] + cmp r0, 0 + bge _081234C8 + adds r0, 0xF +_081234C8: + asrs r0, 4 + negs r0, r0 + str r0, [r2, 0x44] + ldr r0, [r2, 0x40] + cmp r0, 0 + bge _081234D6 + adds r0, 0xF +_081234D6: + asrs r0, 4 + negs r0, r0 + str r0, [r2, 0x48] + adds r0, r2, 0 + adds r0, 0x64 + ldrh r1, [r0] + subs r0, 0x10 + strh r1, [r0] + adds r0, 0x12 + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x56 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 8 + str r0, [r2, 0x4C] + movs r0, 0x80 + lsls r0, 4 +_081234FA: + str r0, [r2, 0x50] + ldr r0, [r5] + adds r0, 0x6E + movs r1, 0 + strh r1, [r0] + bl sub_8124238 + bl sub_81243B0 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8123418 + + thumb_func_start sub_8123514 +sub_8123514: @ 8123514 + push {r4-r6,lr} + sub sp, 0xC + ldr r0, _0812352C + ldr r3, [r0] + adds r2, r3, 0 + adds r2, 0x6E + ldrh r1, [r2] + adds r5, r0, 0 + cmp r1, 0xF + bls _08123530 + movs r0, 0 + b _081236B8 + .align 2, 0 +_0812352C: .4byte 0x0203a144 +_08123530: + adds r0, r1, 0x1 + movs r1, 0 + strh r0, [r2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x10 + bne _081235A4 + str r1, [r3, 0x44] + str r1, [r3, 0x48] + adds r0, r3, 0 + adds r0, 0x60 + ldrh r1, [r0] + subs r0, 0x4 + strh r1, [r0] + adds r0, 0x6 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x5E + strh r0, [r1] + adds r1, 0x1A + ldrb r0, [r1] + movs r2, 0x80 + lsls r2, 9 + cmp r0, 0 + bne _08123566 + movs r2, 0x80 + lsls r2, 8 +_08123566: + str r2, [r3, 0x4C] + movs r2, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _08123572 + movs r2, 0x1 +_08123572: + strb r2, [r1] + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x78 + ldrb r0, [r0] + ldr r2, _0812359C + cmp r0, 0 + bne _08123584 + ldr r2, _081235A0 +_08123584: + str r2, [r1, 0x18] + adds r0, r1, 0 + adds r0, 0x58 + ldrh r0, [r0] + adds r1, 0x5A + ldrh r1, [r1] + bl sub_81240D4 + bl sub_81243DC + movs r4, 0 + b _08123686 + .align 2, 0 +_0812359C: .4byte sub_8123254 + 1 +_081235A0: .4byte sub_81230C4 + 1 +_081235A4: + ldr r2, [r3, 0x3C] + ldr r0, [r3, 0x44] + adds r2, r0 + str r2, [r3, 0x3C] + ldr r0, [r3, 0x40] + ldr r1, [r3, 0x48] + adds r0, r1 + str r0, [r3, 0x40] + asrs r2, 8 + adds r4, r3, 0 + adds r4, 0x5C + strh r2, [r4] + ldr r0, [r3, 0x40] + asrs r0, 8 + adds r1, r3, 0 + adds r1, 0x5E + strh r0, [r1] + ldr r0, [r3, 0x4C] + ldr r1, [r3, 0x50] + adds r0, r1 + str r0, [r3, 0x4C] + ldr r2, [r3, 0x44] + cmp r2, 0 + bge _081235E4 + adds r0, r3, 0 + adds r0, 0x60 + movs r6, 0 + ldrsh r1, [r4, r6] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r1, r0 + blt _081235F8 +_081235E4: + cmp r2, 0 + ble _08123608 + adds r0, r3, 0 + adds r0, 0x60 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r1, r0 + ble _08123608 +_081235F8: + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x60 + ldrh r2, [r0] + subs r0, 0x4 + movs r1, 0 + strh r2, [r0] + str r1, [r3, 0x44] +_08123608: + ldr r2, [r5] + ldr r4, [r2, 0x48] + cmp r4, 0 + bge _08123624 + adds r0, r2, 0 + adds r0, 0x5E + adds r3, r2, 0 + adds r3, 0x62 + movs r6, 0 + ldrsh r1, [r0, r6] + movs r6, 0 + ldrsh r0, [r3, r6] + cmp r1, r0 + blt _0812363C +_08123624: + cmp r4, 0 + ble _0812364E + adds r1, r2, 0 + adds r1, 0x5E + adds r0, r2, 0 + adds r0, 0x62 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r1, r0 + ble _0812364E +_0812363C: + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x62 + ldrh r1, [r0] + adds r3, r2, 0 + adds r3, 0x5E + movs r0, 0 + strh r1, [r3] + str r0, [r2, 0x48] +_0812364E: + ldr r0, _0812366C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x78 + ldrb r3, [r0] + cmp r3, 0 + bne _08123674 + ldr r1, [r2, 0x4C] + ldr r0, _08123670 + cmp r1, r0 + bgt _08123684 + adds r0, 0x1 + str r0, [r2, 0x4C] + str r3, [r2, 0x50] + b _08123684 + .align 2, 0 +_0812366C: .4byte 0x0203a144 +_08123670: .4byte 0x00007fff +_08123674: + ldr r0, [r2, 0x4C] + movs r1, 0x80 + lsls r1, 9 + cmp r0, r1 + ble _08123684 + str r1, [r2, 0x4C] + movs r0, 0 + str r0, [r2, 0x50] +_08123684: + movs r4, 0x1 +_08123686: + ldr r0, _081236C0 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5C + movs r1, 0 + ldrsh r0, [r0, r1] + adds r1, r3, 0 + adds r1, 0x5E + movs r2, 0 + ldrsh r1, [r1, r2] + ldr r2, [r3, 0x4C] + lsls r2, 8 + lsrs r2, 16 + str r2, [sp] + ldr r2, [r3, 0x4C] + lsls r2, 8 + lsrs r2, 16 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + movs r2, 0x38 + movs r3, 0x48 + bl sub_81236C4 + adds r0, r4, 0 +_081236B8: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081236C0: .4byte 0x0203a144 + thumb_func_end sub_8123514 + + thumb_func_start sub_81236C4 +sub_81236C4: @ 81236C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r7, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r4, 16 + lsrs r4, 16 + mov r8, r4 + lsls r7, 16 + adds r4, r7, 0 + lsrs r4, 16 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + ldr r4, _08123784 + ldr r6, [r4] + ldr r7, _08123788 + mov r12, r7 + adds r4, r5, 0 + adds r4, 0x40 + lsls r4, 1 + add r4, r12 + movs r7, 0 + ldrsh r4, [r4, r7] + str r4, [sp] + mov r7, r8 + muls r7, r4 + adds r4, r7, 0 + asrs r4, 8 + mov r10, r4 + str r4, [r6, 0x2C] + lsls r5, 1 + add r5, r12 + movs r7, 0 + ldrsh r5, [r5, r7] + negs r4, r5 + mov r7, r8 + muls r7, r4 + adds r4, r7, 0 + asrs r4, 8 + mov r12, r4 + str r4, [r6, 0x30] + mov r7, r9 + muls r7, r5 + adds r5, r7, 0 + asrs r5, 8 + str r5, [r6, 0x34] + ldr r7, [sp] + mov r4, r9 + muls r4, r7 + asrs r4, 8 + mov r8, r4 + str r4, [r6, 0x38] + lsls r0, 16 + asrs r0, 8 + lsls r2, 16 + asrs r2, 16 + lsls r4, r2, 8 + adds r0, r4 + lsls r3, 16 + asrs r3, 16 + adds r4, r3, 0 + muls r4, r5 + mov r5, r10 + muls r5, r2 + adds r4, r5 + subs r0, r4 + str r0, [r6, 0x24] + lsls r1, 16 + asrs r1, 8 + lsls r0, r3, 8 + adds r1, r0 + mov r0, r8 + muls r0, r3 + mov r3, r12 + muls r3, r2 + adds r2, r3, 0 + adds r0, r2 + subs r1, r0 + str r1, [r6, 0x28] + adds r6, 0x7D + movs r0, 0x1 + strb r0, [r6] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08123784: .4byte 0x0203a144 +_08123788: .4byte 0x08329f40 + thumb_func_end sub_81236C4 + + thumb_func_start sub_812378C +sub_812378C: @ 812378C + ldr r2, _081237B0 + ldr r2, [r2] + lsls r0, 16 + asrs r0, 8 + movs r3, 0xE0 + lsls r3, 5 + adds r0, r3 + str r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 8 + movs r0, 0x90 + lsls r0, 6 + adds r1, r0 + str r1, [r2, 0x28] + adds r2, 0x7D + movs r0, 0x1 + strb r0, [r2] + bx lr + .align 2, 0 +_081237B0: .4byte 0x0203a144 + thumb_func_end sub_812378C + + thumb_func_start sub_81237B4 +sub_81237B4: @ 81237B4 + push {r4,lr} + ldr r4, _08123820 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x7D + ldrb r0, [r0] + cmp r0, 0 + beq _0812381A + ldrh r1, [r1, 0x2C] + movs r0, 0x20 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x34] + movs r0, 0x22 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x30] + movs r0, 0x24 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x38] + movs r0, 0x26 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x24] + movs r0, 0x28 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x26] + movs r0, 0x2A + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x28] + movs r0, 0x2C + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x2A] + movs r0, 0x2E + bl lcd_io_set + ldr r0, [r4] + adds r0, 0x7D + movs r1, 0 + strb r1, [r0] +_0812381A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08123820: .4byte 0x0203a144 + thumb_func_end sub_81237B4 + + thumb_func_start sub_8123824 +sub_8123824: @ 8123824 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x38 + movs r3, 0x48 + bl sub_81236C4 + bl sub_81237B4 + ldr r0, _08123868 + ldr r2, [r0] + ldr r1, [r2, 0x20] + cmp r1, 0 + beq _08123860 + negs r0, r4 + strh r0, [r1, 0x24] + ldr r1, [r2, 0x20] + negs r0, r5 + strh r0, [r1, 0x26] +_08123860: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08123868: .4byte 0x0203a144 + thumb_func_end sub_8123824 + + thumb_func_start sub_812386C +sub_812386C: @ 812386C + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + ldr r0, _0812388C + adds r1, r0 + lsrs r2, r1, 16 + cmp r2, 0xE + bhi _08123886 + cmp r3, 0 + beq _08123886 + cmp r3, 0x1C + bls _08123890 +_08123886: + movs r0, 0xD5 + b _081238A4 + .align 2, 0 +_0812388C: .4byte 0xfffe0000 +_08123890: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r1, _081238A8 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3, r0 + adds r0, r1 + ldrb r0, [r0] +_081238A4: + pop {r1} + bx r1 + .align 2, 0 +_081238A8: .4byte 0x085a096c + thumb_func_end sub_812386C + + thumb_func_start sub_81238AC +sub_81238AC: @ 81238AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, _081238D8 + ldr r2, [r0] + movs r1, 0x4 + ldrsb r1, [r2, r1] + adds r3, r0, 0 + cmp r1, 0x19 + bne _081238DC + ldrb r0, [r2, 0x5] + subs r0, 0x29 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _081238DC + bl sub_8123C00 + b _08123BEC + .align 2, 0 +_081238D8: .4byte 0x03005d8c +_081238DC: + ldr r1, [r3] + movs r0, 0x4 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + bl get_map_light_level_by_bank_and_number + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x8 + bhi _08123928 + lsls r0, 2 + ldr r1, _08123900 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08123900: .4byte _08123904 + .align 2, 0 +_08123904: + .4byte _08123928 + .4byte _08123928 + .4byte _08123928 + .4byte _0812396C + .4byte _08123928 + .4byte _08123928 + .4byte _0812396C + .4byte _08123A28 + .4byte _081239E4 +_08123928: + ldr r4, _08123960 + ldr r0, [r4] + ldr r3, _08123964 + ldrb r1, [r3, 0x14] + movs r2, 0 + strh r1, [r0] + adds r0, 0x7F + strb r2, [r0] + ldr r0, [r3] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldr r0, _08123968 + ldr r0, [r0] + ldrh r6, [r0] + ldrh r3, [r0, 0x2] + ldr r1, [r4] + ldrh r0, [r1] + cmp r0, 0x45 + beq _08123956 + cmp r0, 0xCC + beq _08123956 + b _08123ABE +_08123956: + adds r1, 0x7F + movs r0, 0x1 + strb r0, [r1] + b _08123ABE + .align 2, 0 +_08123960: .4byte 0x0203a144 +_08123964: .4byte 0x02037318 +_08123968: .4byte 0x03005d8c +_0812396C: + ldr r2, _081239BC + ldrb r1, [r2, 0x1A] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081239C8 + ldr r4, _081239C0 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x25 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + ldr r0, _081239C4 + ldr r0, [r0] + ldrb r1, [r5, 0x14] + strh r1, [r0] + adds r0, 0x7F + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldr r0, [r4] + ldrh r6, [r0, 0x28] + ldrh r3, [r0, 0x2A] + b _08123ABE + .align 2, 0 +_081239BC: .4byte 0x02037318 +_081239C0: .4byte 0x03005d8c +_081239C4: .4byte 0x0203a144 +_081239C8: + ldr r0, _081239E0 + ldr r0, [r0] + ldrb r1, [r2, 0x14] + strh r1, [r0] + adds r0, 0x7F + movs r1, 0x1 + strb r1, [r0] + movs r2, 0x1 + mov r9, r2 + movs r6, 0x1 + movs r3, 0x1 + b _08123ABE + .align 2, 0 +_081239E0: .4byte 0x0203a144 +_081239E4: + ldr r4, _08123A20 + ldr r1, [r4] + 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 + adds r5, r0, 0 + ldr r0, _08123A24 + ldr r0, [r0] + ldrb r1, [r5, 0x14] + strh r1, [r0] + adds r0, 0x7F + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldr r0, [r4] + ldrh r6, [r0, 0x18] + ldrh r3, [r0, 0x1A] + b _08123ABE + .align 2, 0 +_08123A20: .4byte 0x03005d8c +_08123A24: .4byte 0x0203a144 +_08123A28: + ldr r4, _08123A58 + ldr r0, [r4] + ldr r1, _08123A5C + ldrb r1, [r1, 0x14] + strh r1, [r0] + cmp r1, 0x57 + beq _08123A64 + ldr r0, _08123A60 + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x24 + movs r0, 0 + ldrsb r0, [r7, r0] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ldrsb r1, [r7, r1] + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + b _08123A8A + .align 2, 0 +_08123A58: .4byte 0x0203a144 +_08123A5C: .4byte 0x02037318 +_08123A60: .4byte 0x03005d8c +_08123A64: + ldr r0, _08123AA4 + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x14 + ldrb r0, [r0, 0x14] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ldrsb r1, [r7, r1] + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + ldr r1, [r4] + ldrb r0, [r5, 0x14] + strh r0, [r1] +_08123A8A: + ldr r4, _08123AA8 + ldr r0, [r4] + ldrb r0, [r0] + bl sub_8123F74 + adds r1, r0, 0 + cmp r1, 0 + beq _08123AAC + ldr r0, [r4] + adds r0, 0x7F + movs r1, 0x1 + b _08123AB0 + .align 2, 0 +_08123AA4: .4byte 0x03005d8c +_08123AA8: .4byte 0x0203a144 +_08123AAC: + ldr r0, [r4] + adds r0, 0x7F +_08123AB0: + strb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldrh r6, [r7, 0x4] + ldrh r3, [r7, 0x6] +_08123ABE: + str r6, [sp] + ldr r5, _08123B44 + ldr r4, _08123B48 + ldr r0, [r4] + mov r10, r0 + ldrh r7, [r0] + lsls r0, r7, 3 + adds r0, r5 + str r0, [sp, 0x4] + ldrb r0, [r0, 0x2] + mov r8, r0 + adds r0, r2, 0 + mov r1, r8 + str r3, [sp, 0x8] + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r3, [sp, 0x8] + cmp r1, 0 + bne _08123AEA + movs r1, 0x1 +_08123AEA: + adds r0, r6, 0 + str r3, [sp, 0x8] + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, [sp, 0x8] + cmp r6, r8 + bcc _08123B04 + mov r0, r8 + subs r0, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08123B04: + ldr r2, [sp, 0x4] + ldrb r4, [r2, 0x3] + mov r0, r9 + adds r1, r4, 0 + str r3, [sp, 0x8] + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r3, [sp, 0x8] + cmp r1, 0 + bne _08123B1E + movs r1, 0x1 +_08123B1E: + adds r0, r3, 0 + bl __udivsi3 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _08123B32 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 +_08123B32: + cmp r7, 0x29 + beq _08123B5E + cmp r7, 0x29 + bgt _08123B4C + cmp r7, 0x1D + beq _08123B56 + cmp r7, 0x24 + beq _08123B94 + b _08123BC6 + .align 2, 0 +_08123B44: .4byte 0x085a147c +_08123B48: .4byte 0x0203a144 +_08123B4C: + cmp r7, 0x33 + beq _08123B5E + cmp r7, 0xCC + beq _08123BB8 + b _08123BC6 +_08123B56: + cmp r3, 0 + beq _08123BC6 + movs r6, 0 + b _08123BC6 +_08123B5E: + movs r6, 0 + ldr r0, _08123B90 + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x20 + ble _08123B6E + movs r6, 0x1 +_08123B6E: + cmp r0, 0x33 + ble _08123B78 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08123B78: + movs r3, 0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + cmp r0, 0x25 + ble _08123B84 + movs r3, 0x1 +_08123B84: + cmp r0, 0x38 + ble _08123BC6 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + b _08123BC6 + .align 2, 0 +_08123B90: .4byte 0x03005d8c +_08123B94: + movs r6, 0 + ldr r0, [sp] + cmp r0, 0xE + bls _08123B9E + movs r6, 0x1 +_08123B9E: + ldr r2, [sp] + cmp r2, 0x1C + bls _08123BAA + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08123BAA: + ldr r0, [sp] + cmp r0, 0x36 + bls _08123BC6 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + b _08123BC6 +_08123BB8: + mov r0, r10 + adds r0, 0x54 + mov r1, r10 + adds r1, 0x56 + bl sub_8123F30 + b _08123BEC +_08123BC6: + ldr r0, _08123BFC + ldr r2, [r0] + ldrh r0, [r2] + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0] + adds r0, r6, r0 + adds r0, 0x1 + adds r1, r2, 0 + adds r1, 0x54 + strh r0, [r1] + ldrh r0, [r2] + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x1] + adds r0, r3, r0 + adds r0, 0x2 + adds r2, 0x56 + strh r0, [r2] +_08123BEC: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08123BFC: .4byte 0x0203a144 + thumb_func_end sub_81238AC + + thumb_func_start sub_8123C00 +sub_8123C00: @ 8123C00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r7, 0 + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r4, 0x1 + mov r5, sp + adds r5, 0x2 + add r6, sp, 0x4 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8137FFC + lsls r0, 24 + lsrs r0, 24 + mov r10, r5 + cmp r0, 0x4 + bhi _08123C94 + lsls r0, 2 + ldr r1, _08123C3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08123C3C: .4byte _08123C40 + .align 2, 0 +_08123C40: + .4byte _08123C94 + .4byte _08123C54 + .4byte _08123C64 + .4byte _08123C74 + .4byte _08123C84 +_08123C54: + ldr r2, _08123C60 + ldr r1, [r2] + movs r0, 0x8 + strh r0, [r1] + b _08123D10 + .align 2, 0 +_08123C60: .4byte 0x0203a144 +_08123C64: + ldr r2, _08123C70 + ldr r1, [r2] + movs r0, 0xC + strh r0, [r1] + b _08123D10 + .align 2, 0 +_08123C70: .4byte 0x0203a144 +_08123C74: + ldr r2, _08123C80 + ldr r1, [r2] + movs r0, 0x27 + strh r0, [r1] + b _08123D10 + .align 2, 0 +_08123C80: .4byte 0x0203a144 +_08123C84: + ldr r2, _08123C90 + ldr r1, [r2] + movs r0, 0x2E + strh r0, [r1] + b _08123D10 + .align 2, 0 +_08123C90: .4byte 0x0203a144 +_08123C94: + mov r0, sp + ldrb r0, [r0] + ldrb r1, [r4] + bl get_mapheader_by_bank_and_number + ldr r1, _08123D50 + mov r9, r1 + ldr r2, [r1] + ldrb r1, [r0, 0x14] + strh r1, [r2] + ldr r6, [r0] + ldr r1, _08123D54 + ldrh r0, [r2] + lsls r0, 3 + adds r5, r0, r1 + ldrb r4, [r5, 0x2] + ldr r0, [r6] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08123CC6 + movs r1, 0x1 +_08123CC6: + mov r2, r10 + movs r3, 0 + ldrsh r0, [r2, r3] + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r8, r4 + bcc _08123CE2 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_08123CE2: + ldrb r4, [r5, 0x3] + ldr r0, [r6, 0x4] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08123CF6 + movs r1, 0x1 +_08123CF6: + mov r2, sp + movs r3, 0x4 + ldrsh r0, [r2, r3] + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r2, r9 + cmp r7, r4 + bcc _08123D10 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 +_08123D10: + ldr r0, [r2] + adds r0, 0x7F + movs r1, 0 + strb r1, [r0] + ldr r2, [r2] + ldr r3, _08123D54 + ldrh r0, [r2] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0] + add r0, r8 + adds r0, 0x1 + adds r1, r2, 0 + adds r1, 0x54 + strh r0, [r1] + ldrh r0, [r2] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, r7, r0 + adds r0, 0x2 + adds r2, 0x56 + strh r0, [r2] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08123D50: .4byte 0x0203a144 +_08123D54: .4byte 0x085a147c + thumb_func_end sub_8123C00 + + thumb_func_start get_flagnr_blue_points +get_flagnr_blue_points: @ 8123D58 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x9 + beq _08123E18 + cmp r0, 0x9 + bgt _08123D9A + cmp r0, 0x4 + beq _08123DF0 + cmp r0, 0x4 + bgt _08123D88 + cmp r0, 0x1 + beq _08123DD8 + cmp r0, 0x1 + bgt _08123D7E + cmp r0, 0 + beq _08123DD0 + b _08123E94 +_08123D7E: + cmp r0, 0x2 + beq _08123DDE + cmp r0, 0x3 + beq _08123DE8 + b _08123E94 +_08123D88: + cmp r0, 0x6 + beq _08123E00 + cmp r0, 0x6 + blt _08123DF8 + cmp r0, 0x7 + beq _08123E08 + cmp r0, 0x8 + beq _08123E10 + b _08123E94 +_08123D9A: + cmp r0, 0xE + beq _08123E40 + cmp r0, 0xE + bgt _08123DB4 + cmp r0, 0xB + beq _08123E28 + cmp r0, 0xB + blt _08123E20 + cmp r0, 0xC + beq _08123E30 + cmp r0, 0xD + beq _08123E38 + b _08123E94 +_08123DB4: + cmp r0, 0x3A + beq _08123E60 + cmp r0, 0x3A + bgt _08123DC2 + cmp r0, 0xF + beq _08123E48 + b _08123E94 +_08123DC2: + cmp r1, 0x49 + beq _08123E7C + cmp r1, 0xD5 + beq _08123DCC + b _08123E94 +_08123DCC: + movs r0, 0 + b _08123E96 +_08123DD0: + ldr r0, _08123DD4 + b _08123E4A + .align 2, 0 +_08123DD4: .4byte 0x0000086f +_08123DD8: + movs r0, 0x87 + lsls r0, 4 + b _08123E4A +_08123DDE: + ldr r0, _08123DE4 + b _08123E4A + .align 2, 0 +_08123DE4: .4byte 0x00000871 +_08123DE8: + ldr r0, _08123DEC + b _08123E4A + .align 2, 0 +_08123DEC: .4byte 0x00000872 +_08123DF0: + ldr r0, _08123DF4 + b _08123E4A + .align 2, 0 +_08123DF4: .4byte 0x00000873 +_08123DF8: + ldr r0, _08123DFC + b _08123E4A + .align 2, 0 +_08123DFC: .4byte 0x00000874 +_08123E00: + ldr r0, _08123E04 + b _08123E4A + .align 2, 0 +_08123E04: .4byte 0x00000875 +_08123E08: + ldr r0, _08123E0C + b _08123E4A + .align 2, 0 +_08123E0C: .4byte 0x00000876 +_08123E10: + ldr r0, _08123E14 + b _08123E4A + .align 2, 0 +_08123E14: .4byte 0x00000877 +_08123E18: + ldr r0, _08123E1C + b _08123E4A + .align 2, 0 +_08123E1C: .4byte 0x00000878 +_08123E20: + ldr r0, _08123E24 + b _08123E4A + .align 2, 0 +_08123E24: .4byte 0x00000879 +_08123E28: + ldr r0, _08123E2C + b _08123E4A + .align 2, 0 +_08123E2C: .4byte 0x0000087a +_08123E30: + ldr r0, _08123E34 + b _08123E4A + .align 2, 0 +_08123E34: .4byte 0x0000087b +_08123E38: + ldr r0, _08123E3C + b _08123E4A + .align 2, 0 +_08123E3C: .4byte 0x0000087c +_08123E40: + ldr r0, _08123E44 + b _08123E4A + .align 2, 0 +_08123E44: .4byte 0x0000087d +_08123E48: + ldr r0, _08123E5C +_08123E4A: + bl flag_check + lsls r0, 24 + movs r1, 0x3 + cmp r0, 0 + beq _08123E58 + movs r1, 0x2 +_08123E58: + adds r0, r1, 0 + b _08123E96 + .align 2, 0 +_08123E5C: .4byte 0x0000087e +_08123E60: + ldr r0, _08123E78 + bl flag_check + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + negs r0, r1 + orrs r0, r1 + asrs r0, 31 + movs r1, 0x4 + ands r0, r1 + b _08123E96 + .align 2, 0 +_08123E78: .4byte 0x000008a8 +_08123E7C: + ldr r0, _08123E90 + bl flag_check + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _08123E96 + .align 2, 0 +_08123E90: .4byte 0x000008a9 +_08123E94: + movs r0, 0x1 +_08123E96: + pop {r1} + bx r1 + thumb_func_end get_flagnr_blue_points + + thumb_func_start sub_8123E9C +sub_8123E9C: @ 8123E9C + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_812386C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8123E9C + + thumb_func_start sub_8123EB4 +sub_8123EB4: @ 8123EB4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, _08123ED0 +_08123EBE: + ldrh r0, [r1] + cmp r0, r3 + bne _08123ED4 + bl sub_8123F04 + lsls r0, 16 + lsrs r0, 16 + b _08123F00 + .align 2, 0 +_08123ED0: .4byte 0x085a1b84 +_08123ED4: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x2 + bls _08123EBE + ldr r1, _08123EF0 + ldrh r0, [r1] + cmp r0, 0xD5 + beq _08123EFE + adds r2, r1, 0 +_08123EE6: + ldrh r0, [r2] + cmp r0, r3 + bne _08123EF4 + ldrh r0, [r1, 0x2] + b _08123F00 + .align 2, 0 +_08123EF0: .4byte 0x085a1b24 +_08123EF4: + adds r1, 0x4 + adds r2, 0x4 + ldrh r0, [r1] + cmp r0, 0xD5 + bne _08123EE6 +_08123EFE: + adds r0, r3, 0 +_08123F00: + pop {r1} + bx r1 + thumb_func_end sub_8123EB4 + + thumb_func_start sub_8123F04 +sub_8123F04: @ 8123F04 + push {lr} + ldr r0, _08123F28 + bl var_get + subs r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _08123F18 + movs r1, 0 +_08123F18: + ldr r0, _08123F2C + lsls r1, 16 + asrs r1, 15 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_08123F28: .4byte 0x00004037 +_08123F2C: .4byte 0x085a1b8a + thumb_func_end sub_8123F04 + + thumb_func_start sub_8123F30 +sub_8123F30: @ 8123F30 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08123F68 + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, _08123F6C + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x7 + bls _08123F4C + movs r1, 0x9 +_08123F4C: + subs r1, 0x9 + lsls r1, 16 + ldr r0, _08123F70 + lsrs r1, 14 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r4] + ldrh r0, [r1, 0x2] + adds r0, 0x2 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08123F68: .4byte 0x00004037 +_08123F6C: .4byte 0xfff70000 +_08123F70: .4byte 0x085a1bac + thumb_func_end sub_8123F30 + + thumb_func_start sub_8123F74 +sub_8123F74: @ 8123F74 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _08123F8C +_08123F7E: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08123F90 + movs r0, 0x1 + b _08123F98 + .align 2, 0 +_08123F8C: .4byte 0x085a1bcc +_08123F90: + adds r1, 0x1 + cmp r1, 0 + beq _08123F7E + movs r0, 0 +_08123F98: + pop {r1} + bx r1 + thumb_func_end sub_8123F74 + + thumb_func_start sub_8123F9C +sub_8123F9C: @ 8123F9C + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_8123EB4 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8123F9C + + thumb_func_start sub_8123FB0 +sub_8123FB0: @ 8123FB0 + push {r4-r6,lr} + ldr r0, _08123FC4 + ldr r1, [r0] + ldrh r0, [r1] + cmp r0, 0xD5 + bne _08123FC8 + movs r0, 0 + strb r0, [r1, 0x3] + b _0812402E + .align 2, 0 +_08123FC4: .4byte 0x0203a144 +_08123FC8: + adds r0, r1, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0 + bne _08123FD8 + adds r0, r1, 0 + adds r0, 0x54 + b _08123FDC +_08123FD8: + adds r0, r1, 0 + adds r0, 0x64 +_08123FDC: + ldrh r4, [r0] + adds r0, 0x2 + ldrh r5, [r0] + movs r6, 0 + b _08124008 +_08123FE6: + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_812386C + ldr r1, _08124024 + ldr r1, [r1] + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bne _08124008 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08124008: + cmp r4, 0x1 + bhi _08123FE6 + adds r0, r5, 0 + bl sub_8124038 + lsls r0, 24 + cmp r0, 0 + beq _08124028 + subs r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0x1D + b _08124008 + .align 2, 0 +_08124024: .4byte 0x0203a144 +_08124028: + ldr r0, _08124034 + ldr r0, [r0] + strb r6, [r0, 0x3] +_0812402E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08124034: .4byte 0x0203a144 + thumb_func_end sub_8123FB0 + + thumb_func_start sub_8124038 +sub_8124038: @ 8124038 + push {r4,r5,lr} + lsls r0, 16 + ldr r1, _0812404C + adds r0, r1 + lsrs r5, r0, 16 + ldr r0, _08124050 + cmp r5, r0 + bne _08124058 + b _0812407A + .align 2, 0 +_0812404C: .4byte 0xffff0000 +_08124050: .4byte 0x0000ffff +_08124054: + movs r0, 0x1 + b _0812407C +_08124058: + movs r4, 0x1 +_0812405A: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_812386C + ldr r1, _08124084 + ldr r1, [r1] + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + beq _08124054 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1C + bls _0812405A +_0812407A: + movs r0, 0 +_0812407C: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08124084: .4byte 0x0203a144 + thumb_func_end sub_8124038 + + thumb_func_start sub_8124088 +sub_8124088: @ 8124088 + push {r4,lr} + adds r2, r0, 0 + ldr r0, _081240CC + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0x7A + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0 + beq _081240C6 + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r4, [r2, 0x20] + adds r0, r4 + strh r0, [r2, 0x20] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r1, [r2, 0x22] + adds r0, r1 + strh r0, [r2, 0x22] + ldrb r0, [r3] + subs r0, 0x1 + strb r0, [r3] +_081240C6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081240CC: .4byte 0x0203a144 + thumb_func_end sub_8124088 + + thumb_func_start nullsub_48 +nullsub_48: @ 81240D0 + bx lr + thumb_func_end nullsub_48 + + thumb_func_start sub_81240D4 +sub_81240D4: @ 81240D4 + push {r4-r7,lr} + sub sp, 0x28 + lsls r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r1, _08124144 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [sp, 0x20] + str r2, [sp, 0x24] + mov r2, sp + ldr r1, _08124148 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + lsrs r3, r0, 16 + add r2, sp, 0x18 + ldrh r1, [r2, 0x4] + orrs r1, r0 + str r1, [r2, 0x4] + mov r0, sp + strh r3, [r0] + ldr r0, _0812414C + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x58 + strh r3, [r0] + ldr r5, _08124150 + add r1, sp, 0x20 + ldr r0, [r1, 0x4] + ands r0, r5 + orrs r0, r6 + str r0, [r1, 0x4] + mov r0, sp + strh r6, [r0, 0x2] + adds r3, r4, 0 + adds r0, r3, 0 + adds r0, 0x5A + strh r6, [r0] + adds r0, 0x1E + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0 + bne _08124158 + movs r1, 0xC2 + lsls r1, 1 + adds r0, r3, r1 + str r0, [sp, 0x18] + ldr r0, [r2, 0x4] + ands r0, r5 + subs r1, 0x84 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r0, _08124154 + b _0812416E + .align 2, 0 +_08124144: .4byte 0x085a1c00 +_08124148: .4byte 0x085a1c08 +_0812414C: .4byte 0x0203a144 +_08124150: .4byte 0xffff0000 +_08124154: .4byte sub_8124088 + 1 +_08124158: + movs r3, 0xA1 + lsls r3, 2 + adds r0, r4, r3 + str r0, [sp, 0x18] + ldr r0, [r2, 0x4] + ands r0, r5 + movs r1, 0xC0 + lsls r1, 3 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r0, _081241D0 +_0812416E: + str r0, [sp, 0x14] + adds r0, r2, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r7, 0 + bl gpu_pal_obj_alloc_tag_and_apply + mov r0, sp + movs r1, 0x38 + movs r2, 0x48 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08124228 + ldr r4, _081241D4 + ldr r2, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081241D8 + adds r3, r0, r1 + str r3, [r2, 0x1C] + adds r2, 0x78 + ldrb r0, [r2] + cmp r0, 0x1 + bne _081241DC + ldrb r1, [r3, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x3] + ldr r2, [r4] + ldr r1, [r2, 0x1C] + ldrh r0, [r1, 0x20] + subs r0, 0x8 + strh r0, [r1, 0x20] + ldr r1, [r2, 0x1C] + ldrh r0, [r1, 0x22] + subs r0, 0x8 + strh r0, [r1, 0x22] + ldr r0, [r2, 0x1C] + movs r1, 0x1 + bl obj_anim_image_start + b _08124204 + .align 2, 0 +_081241D0: .4byte nullsub_48 + 1 +_081241D4: .4byte 0x0203a144 +_081241D8: .4byte 0x02020630 +_081241DC: + ldrb r1, [r3, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r3, 0x3] + ldr r1, [r4] + ldr r2, [r1, 0x1C] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r2, 0x20] + ldr r2, [r1, 0x1C] + adds r1, 0x56 + ldrh r0, [r1] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r2, 0x22] +_08124204: + ldr r4, _08124230 + ldr r0, [r4] + ldr r1, [r0, 0x1C] + movs r0, 0x2 + strh r0, [r1, 0x30] + adds r0, r6, 0 + bl gpu_pal_tags_index_of + ldr r1, [r4] + ldr r2, [r1, 0x1C] + lsls r0, 24 + lsrs r0, 20 + ldr r4, _08124234 + adds r0, r4 + strh r0, [r2, 0x32] + ldr r1, [r1, 0x1C] + movs r0, 0x1 + strh r0, [r1, 0x34] +_08124228: + add sp, 0x28 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08124230: .4byte 0x0203a144 +_08124234: .4byte 0x00000101 + thumb_func_end sub_81240D4 + + thumb_func_start sub_8124238 +sub_8124238: @ 8124238 + push {r4,lr} + ldr r4, _08124264 + ldr r0, [r4] + ldr r0, [r0, 0x1C] + cmp r0, 0 + beq _0812425C + bl obj_delete_and_free_tiles + ldr r0, [r4] + adds r0, 0x58 + ldrh r0, [r0] + bl gpu_tile_obj_free_by_tag + ldr r0, [r4] + adds r0, 0x5A + ldrh r0, [r0] + bl gpu_pal_free_tag +_0812425C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08124264: .4byte 0x0203a144 + thumb_func_end sub_8124238 + + thumb_func_start sub_8124268 +sub_8124268: @ 8124268 + ldr r0, _08124274 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + movs r0, 0x1 + strh r0, [r1, 0x34] + bx lr + .align 2, 0 +_08124274: .4byte 0x0203a144 + thumb_func_end sub_8124268 + + thumb_func_start sub_8124278 +sub_8124278: @ 8124278 + ldr r0, _08124284 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + movs r0, 0 + strh r0, [r1, 0x34] + bx lr + .align 2, 0 +_08124284: .4byte 0x0203a144 + thumb_func_end sub_8124278 + + thumb_func_start sub_8124288 +sub_8124288: @ 8124288 + push {r4-r6,lr} + sub sp, 0x28 + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r2, _081242E0 + str r2, [sp, 0x18] + movs r2, 0x80 + add r6, sp, 0x18 + lsrs r3, r0, 16 + orrs r0, r2 + str r0, [r6, 0x4] + ldr r0, _081242E4 + str r0, [sp, 0x20] + ldr r2, _081242E8 + add r4, sp, 0x20 + ldr r0, [r4, 0x4] + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + movs r5, 0 + strh r3, [r0] + strh r1, [r0, 0x2] + ldr r0, _081242EC + str r0, [sp, 0x4] + ldr r0, _081242F0 + str r0, [sp, 0x8] + str r5, [sp, 0xC] + ldr r0, _081242F4 + str r0, [sp, 0x10] + ldr r0, _081242F8 + str r0, [sp, 0x14] + ldr r0, _081242FC + ldrb r0, [r0, 0x14] + bl sub_8124668 + cmp r0, 0 + beq _08124304 + ldr r0, _08124300 + ldr r0, [r0] + str r5, [r0, 0x20] + b _081243A4 + .align 2, 0 +_081242E0: .4byte 0x085a084c +_081242E4: .4byte 0x085a082c +_081242E8: .4byte 0xffff0000 +_081242EC: .4byte 0x085a1c20 +_081242F0: .4byte 0x085a1c30 +_081242F4: .4byte 0x082ec6a8 +_081242F8: .4byte nullsub_12 + 1 +_081242FC: .4byte 0x02037318 +_08124300: .4byte 0x0203a144 +_08124304: + ldr r0, _0812436C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0x1 + bne _08124316 + ldr r0, _08124370 + str r0, [sp, 0x18] + ldr r0, _08124374 + str r0, [sp, 0x20] +_08124316: + adds r0, r6, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08124378 + ldr r2, [r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _0812437C + adds r1, r0 + str r1, [r2, 0x20] + adds r0, r2, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0 + bne _08124384 + adds r0, r2, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x20] + ldr r1, [r2, 0x20] + adds r0, r2, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x22] + ldr r1, [r2, 0x20] + ldr r0, _08124380 + b _081243A2 + .align 2, 0 +_0812436C: .4byte 0x03005d90 +_08124370: .4byte 0x085a08ec +_08124374: .4byte 0x085a08cc +_08124378: .4byte 0x0203a144 +_0812437C: .4byte 0x02020630 +_08124380: .4byte sub_81244EC + 1 +_08124384: + adds r0, r2, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x30 + strh r0, [r1, 0x20] + ldr r1, [r2, 0x20] + adds r0, r2, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x42 + strh r0, [r1, 0x22] + ldr r1, [r2, 0x20] + ldr r0, _081243AC +_081243A2: + str r0, [r1, 0x1C] +_081243A4: + add sp, 0x28 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081243AC: .4byte sub_812445C + 1 + thumb_func_end sub_8124288 + + thumb_func_start sub_81243B0 +sub_81243B0: @ 81243B0 + push {lr} + ldr r3, _081243D4 + ldr r0, [r3] + ldr r2, [r0, 0x20] + cmp r2, 0 + beq _081243CE + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r1, [r0, 0x20] + ldr r0, _081243D8 + str r0, [r1, 0x1C] +_081243CE: + pop {r0} + bx r0 + .align 2, 0 +_081243D4: .4byte 0x0203a144 +_081243D8: .4byte nullsub_12 + 1 + thumb_func_end sub_81243B0 + + thumb_func_start sub_81243DC +sub_81243DC: @ 81243DC + push {lr} + ldr r0, _08124414 + ldr r3, [r0] + ldr r1, [r3, 0x20] + cmp r1, 0 + beq _08124452 + adds r0, r3, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0812441C + adds r0, r3, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x30 + strh r0, [r1, 0x20] + ldr r1, [r3, 0x20] + adds r0, r3, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x42 + strh r0, [r1, 0x22] + ldr r1, [r3, 0x20] + ldr r0, _08124418 + b _08124444 + .align 2, 0 +_08124414: .4byte 0x0203a144 +_08124418: .4byte sub_812445C + 1 +_0812441C: + adds r0, r3, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + movs r2, 0 + strh r0, [r1, 0x20] + ldr r1, [r3, 0x20] + adds r0, r3, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x22] + ldr r0, [r3, 0x20] + strh r2, [r0, 0x24] + ldr r0, [r3, 0x20] + strh r2, [r0, 0x26] + ldr r1, [r3, 0x20] + ldr r0, _08124458 +_08124444: + str r0, [r1, 0x1C] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08124452: + pop {r0} + bx r0 + .align 2, 0 +_08124458: .4byte sub_81244EC + 1 + thumb_func_end sub_81243DC + + thumb_func_start sub_812445C +sub_812445C: @ 812445C + push {r4,lr} + adds r3, r0, 0 + ldr r0, _081244C0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x5C + movs r4, 0 + ldrsh r2, [r0, r4] + lsls r2, 1 + negs r2, r2 + strh r2, [r3, 0x24] + adds r1, 0x5E + movs r4, 0 + ldrsh r0, [r1, r4] + lsls r0, 1 + negs r0, r0 + strh r0, [r3, 0x26] + ldrh r1, [r3, 0x22] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + strh r0, [r3, 0x2E] + ldrh r1, [r3, 0x20] + adds r1, r2 + adds r2, r3, 0 + adds r2, 0x28 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + adds r2, r1 + strh r2, [r3, 0x30] + adds r0, 0x8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB0 + bhi _081244BC + lsls r0, r2, 16 + asrs r2, r0, 16 + movs r0, 0x8 + negs r0, r0 + cmp r2, r0 + blt _081244BC + cmp r2, 0xF8 + ble _081244C4 +_081244BC: + movs r0, 0 + b _081244C6 + .align 2, 0 +_081244C0: .4byte 0x0203a144 +_081244C4: + movs r0, 0x1 +_081244C6: + strh r0, [r3, 0x32] + movs r1, 0x32 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _081244D8 + adds r0, r3, 0 + bl sub_81244F8 + b _081244E4 +_081244D8: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081244E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812445C + + thumb_func_start sub_81244EC +sub_81244EC: @ 81244EC + push {lr} + bl sub_81244F8 + pop {r0} + bx r0 + thumb_func_end sub_81244EC + + thumb_func_start sub_81244F8 +sub_81244F8: @ 81244F8 + push {lr} + adds r2, r0, 0 + ldr r0, _08124538 + ldr r0, [r0] + adds r0, 0x7E + ldrb r0, [r0] + cmp r0, 0 + beq _0812453C + ldrh r0, [r2, 0x3C] + adds r0, 0x1 + strh r0, [r2, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08124548 + movs r0, 0 + strh r0, [r2, 0x3C] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08124548 + .align 2, 0 +_08124538: .4byte 0x0203a144 +_0812453C: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08124548: + pop {r0} + bx r0 + thumb_func_end sub_81244F8 + + thumb_func_start sub_812454C +sub_812454C: @ 812454C + push {lr} + ldr r0, _08124568 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x7F + ldrb r0, [r0] + cmp r0, 0 + beq _08124562 + adds r1, 0x7E + movs r0, 0x1 + strb r0, [r1] +_08124562: + pop {r0} + bx r0 + .align 2, 0 +_08124568: .4byte 0x0203a144 + thumb_func_end sub_812454C + + thumb_func_start GetMapName +GetMapName: @ 812456C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + cmp r1, 0x56 + bne _08124584 + bl sub_80E97EC + adds r1, r0, 0 + b _081245B2 +_08124584: + cmp r1, 0xD4 + bhi _081245A0 + ldr r0, _0812459C + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r5, 0 + bl gf_strcpy + adds r1, r0, 0 + b _081245B2 + .align 2, 0 +_0812459C: .4byte 0x085a147c +_081245A0: + cmp r4, 0 + bne _081245A6 + movs r4, 0x12 +_081245A6: + adds r0, r5, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_80090FC + b _081245D6 +_081245B2: + cmp r4, 0 + beq _081245D4 + subs r0, r1, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcs _081245D0 + movs r2, 0 +_081245C2: + strb r2, [r1] + adds r1, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcc _081245C2 +_081245D0: + movs r0, 0xFF + strb r0, [r1] +_081245D4: + adds r0, r1, 0 +_081245D6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetMapName + + thumb_func_start sub_81245DC +sub_81245DC: @ 81245DC + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x56 + beq _081245F8 + cmp r1, 0x57 + bne _08124604 + ldr r1, _081245F4 + bl gf_strcpy + b _0812460A + .align 2, 0 +_081245F4: .4byte 0x085ec9d2 +_081245F8: + ldr r1, _08124600 + bl gf_strcpy + b _0812460A + .align 2, 0 +_08124600: .4byte 0x085ec9d8 +_08124604: + movs r2, 0 + bl GetMapName +_0812460A: + pop {r1} + bx r1 + thumb_func_end sub_81245DC + + thumb_func_start sub_8124610 +sub_8124610: @ 8124610 + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x42 + beq _08124620 + bl sub_81245DC + b _08124626 +_08124620: + ldr r1, _0812462C + bl gf_strcpy +_08124626: + pop {r1} + bx r1 + .align 2, 0 +_0812462C: .4byte 0x085ec9e4 + thumb_func_end sub_8124610 + + thumb_func_start sub_8124630 +sub_8124630: @ 8124630 + push {r4,r5,lr} + ldr r5, [sp, 0xC] + lsls r0, 16 + ldr r4, _08124654 + lsrs r0, 13 + adds r0, r4 + ldrb r4, [r0] + strh r4, [r1] + ldrb r1, [r0, 0x1] + strh r1, [r2] + ldrb r1, [r0, 0x2] + strh r1, [r3] + ldrb r0, [r0, 0x3] + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08124654: .4byte 0x085a147c + thumb_func_end sub_8124630 + + thumb_func_start sub_8124658 +sub_8124658: @ 8124658 + ldr r0, _08124664 + ldr r0, [r0] + adds r0, 0x78 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08124664: .4byte 0x0203a144 + thumb_func_end sub_8124658 + + thumb_func_start sub_8124668 +sub_8124668: @ 8124668 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _08124680 +_08124672: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r2, r0 + bne _08124684 + movs r0, 0x1 + b _0812468C + .align 2, 0 +_08124680: .4byte 0x085a1c34 +_08124684: + adds r1, 0x1 + cmp r1, 0x2 + bls _08124672 + movs r0, 0 +_0812468C: + pop {r1} + bx r1 + thumb_func_end sub_8124668 + + thumb_func_start sub_8124690 +sub_8124690: @ 8124690 + push {r4,lr} + sub sp, 0xC + ldr r0, _081246B0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xA + bls _081246A4 + b _081248AA +_081246A4: + lsls r0, 2 + ldr r1, _081246B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081246B0: .4byte 0x030022c0 +_081246B4: .4byte _081246B8 + .align 2, 0 +_081246B8: + .4byte _081246E4 + .4byte _08124766 + .4byte _0812477C + .4byte _0812478C + .4byte _0812479C + .4byte _081247E4 + .4byte _081247F8 + .4byte _0812480C + .4byte _0812484C + .4byte _08124852 + .4byte _0812486C +_081246E4: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + ldr r4, _08124748 + ldr r0, _0812474C + bl malloc + str r0, [r4] + cmp r0, 0 + bne _08124754 + ldr r0, _08124750 + bl set_callback2 + b _081248AA + .align 2, 0 +_08124748: .4byte 0x0203a148 +_0812474C: .4byte 0x00000a74 +_08124750: .4byte sub_8086194 + 1 +_08124754: + bl sub_80A1A74 + bl reset_all_obj_data + bl gpu_tile_obj_tags_reset + bl gpu_pal_allocator_reset + b _0812489C +_08124766: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08124778 + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + b _0812489C + .align 2, 0 +_08124778: .4byte 0x085a1ee4 +_0812477C: + ldr r0, _08124788 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + b _0812489C + .align 2, 0 +_08124788: .4byte 0x085a1ef0 +_0812478C: + movs r0, 0 + movs r1, 0x65 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + b _0812489C +_0812479C: + ldr r4, _081247D8 + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + bl sub_8122CDC + movs r0, 0 + movs r1, 0 + bl sub_81240D4 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8124288 + ldr r0, [r4] + ldrh r1, [r0, 0x8] + strh r1, [r0, 0x6] + ldr r1, _081247DC + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl sub_80090FC + ldr r1, _081247E0 + movs r0, 0x1 + str r0, [r1] + bl sub_8124904 + b _0812489C + .align 2, 0 +_081247D8: .4byte 0x0203a148 +_081247DC: .4byte 0x00000a4c +_081247E0: .4byte 0x03001180 +_081247E4: + ldr r0, _081247F0 + ldr r1, _081247F4 + bl LZ77UnCompVram + b _0812489C + .align 2, 0 +_081247F0: .4byte 0x085a1c58 +_081247F4: .4byte 0x0600c000 +_081247F8: + ldr r0, _08124804 + ldr r1, _08124808 + bl LZ77UnCompVram + b _0812489C + .align 2, 0 +_08124804: .4byte 0x085a1c90 +_08124808: .4byte 0x0600f000 +_0812480C: + ldr r0, _08124844 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + ldr r2, _08124848 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _0812489C + .align 2, 0 +_08124844: .4byte 0x085a1c38 +_08124848: .4byte 0x085e8cb4 +_0812484C: + bl sub_8124A70 + b _0812489C +_08124852: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _08124868 + bl SetVBlankCallback + b _0812489C + .align 2, 0 +_08124868: .4byte sub_81248C0 + 1 +_0812486C: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set_bits + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r0, _081248B4 + bl sub_81248F4 + ldr r0, _081248B8 + bl set_callback2 +_0812489C: + ldr r1, _081248BC + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081248AA: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081248B4: .4byte sub_8124D14 + 1 +_081248B8: .4byte sub_81248D4 + 1 +_081248BC: .4byte 0x030022c0 + thumb_func_end sub_8124690 + + thumb_func_start sub_81248C0 +sub_81248C0: @ 81248C0 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81248C0 + + thumb_func_start sub_81248D4 +sub_81248D4: @ 81248D4 + push {lr} + ldr r0, _081248F0 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + .align 2, 0 +_081248F0: .4byte 0x0203a148 + thumb_func_end sub_81248D4 + + thumb_func_start sub_81248F4 +sub_81248F4: @ 81248F4 + ldr r1, _08124900 + ldr r1, [r1] + str r0, [r1] + movs r0, 0 + strh r0, [r1, 0x4] + bx lr + .align 2, 0 +_08124900: .4byte 0x0203a148 + thumb_func_end sub_81248F4 + + thumb_func_start sub_8124904 +sub_8124904: @ 8124904 + push {r4-r7,lr} + sub sp, 0xC + ldr r2, _081249B8 + ldr r0, [r2] + ldrb r0, [r0, 0xA] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0812491A + b _08124A2C +_0812491A: + movs r7, 0 + movs r3, 0 + ldr r0, _081249BC + mov r12, r0 + adds r5, r2, 0 + movs r6, 0 +_08124926: + ldr r0, [r5] + lsls r1, r3, 3 + mov r2, r12 + adds r4, r1, r2 + ldrh r0, [r0, 0x8] + ldrh r1, [r4, 0x4] + cmp r0, r1 + bne _081249C4 + ldrh r0, [r4, 0x6] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081249CE + ldr r0, [r5] + ldrb r0, [r0, 0xB] + ldr r1, [r4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_8008C24 + movs r7, 0x1 + movs r0, 0 + movs r1, 0 + bl sub_8198070 + movs r0, 0x1 + movs r1, 0 + movs r2, 0x65 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, [r5] + adds r2, 0xC + str r7, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0xB] + ldr r1, [r4] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x60 + bl sub_81DB368 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x11 + str r0, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _081249C0 + str r7, [r0] + b _081249CE + .align 2, 0 +_081249B8: .4byte 0x0203a148 +_081249BC: .4byte 0x085a1edc +_081249C0: .4byte 0x03001180 +_081249C4: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _08124926 +_081249CE: + cmp r7, 0 + bne _08124A62 + ldr r0, _081249F0 + ldr r0, [r0] + cmp r0, 0x1 + bne _081249F4 + movs r0, 0x1 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + movs r1, 0 + movs r2, 0x65 + movs r3, 0xD + bl SetWindowBorderStyle + b _081249FC + .align 2, 0 +_081249F0: .4byte 0x03001180 +_081249F4: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels +_081249FC: + ldr r0, _08124A24 + ldr r2, [r0] + adds r2, 0xC + movs r0, 0x1 + 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 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _08124A28 + str r4, [r0] + b _08124A62 + .align 2, 0 +_08124A24: .4byte 0x0203a148 +_08124A28: .4byte 0x03001180 +_08124A2C: + ldr r4, _08124A6C + ldr r0, [r4] + cmp r0, 0x1 + bne _08124A48 + movs r0, 0x1 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + movs r1, 0 + movs r2, 0x65 + movs r3, 0xD + bl SetWindowBorderStyle +_08124A48: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + str r0, [r4] +_08124A62: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08124A6C: .4byte 0x03001180 + thumb_func_end sub_8124904 + + thumb_func_start sub_8124A70 +sub_8124A70: @ 8124A70 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _08124ABC + ldr r5, _08124AC0 + ldr r1, [r5] + ldr r4, _08124AC4 + adds r1, r4 + bl LZ77UnCompWram + ldr r0, [r5] + adds r0, r4 + str r0, [sp] + ldr r1, _08124AC8 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0xE0 + lsls r1, 1 + orrs r0, r1 + ldr r1, _08124ACC + ands r0, r1 + movs r1, 0x80 + lsls r1, 10 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _08124AD0 + bl gpu_pal_obj_alloc_tag_and_apply + bl sub_8124AD4 + bl sub_8124BE4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08124ABC: .4byte 0x085a1d68 +_08124AC0: .4byte 0x0203a148 +_08124AC4: .4byte 0x0000088c +_08124AC8: .4byte 0xffff0000 +_08124ACC: .4byte 0x0000ffff +_08124AD0: .4byte 0x085a1f10 + thumb_func_end sub_8124A70 + + thumb_func_start sub_8124AD4 +sub_8124AD4: @ 8124AD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, _08124B34 + str r0, [sp, 0xC] + movs r1, 0 + mov r9, r1 + mov r2, sp + adds r2, 0x6 + str r2, [sp, 0x14] + mov r3, sp + adds r3, 0xA + str r3, [sp, 0x18] + mov r0, sp + adds r0, 0x8 + str r0, [sp, 0x10] + add r1, sp, 0x4 + mov r10, r1 +_08124AFE: + ldr r2, [sp, 0x18] + str r2, [sp] + mov r0, r9 + add r1, sp, 0x4 + mov r2, sp + adds r2, 0x6 + ldr r3, [sp, 0x10] + bl sub_8124630 + mov r3, r10 + ldrh r0, [r3] + adds r0, 0x1 + lsls r0, 3 + adds r0, 0x4 + strh r0, [r3] + mov r1, sp + ldrh r0, [r1, 0x6] + adds r0, 0x2 + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x6] + ldr r2, [sp, 0x10] + ldrh r0, [r2] + cmp r0, 0x2 + bne _08124B38 + movs r7, 0x1 + b _08124B44 + .align 2, 0 +_08124B34: .4byte 0x0000086f +_08124B38: + ldr r3, [sp, 0x18] + ldrh r0, [r3] + movs r7, 0 + cmp r0, 0x2 + bne _08124B44 + movs r7, 0x2 +_08124B44: + mov r0, r10 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, [sp, 0x14] + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, _08124B90 + movs r3, 0xA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _08124BB8 + ldr r1, _08124B94 + mov r8, r1 + lsls r4, r5, 4 + adds r0, r4, r5 + lsls r6, r0, 2 + adds r2, r6, r1 + lsls r3, r7, 6 + ldrb r1, [r2, 0x1] + movs r0, 0x3F + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x1] + ldr r0, [sp, 0xC] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08124B9C + mov r0, r8 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, _08124B98 + str r1, [r0] + b _08124BA2 + .align 2, 0 +_08124B90: .4byte 0x085a1f7c +_08124B94: .4byte 0x02020630 +_08124B98: .4byte sub_8124CBC + 1 +_08124B9C: + adds r0, r7, 0x3 + lsls r0, 16 + lsrs r7, r0, 16 +_08124BA2: + adds r4, r5 + lsls r4, 2 + ldr r0, _08124BE0 + adds r4, r0 + lsls r1, r7, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + mov r2, r9 + strh r2, [r4, 0x2E] +_08124BB8: + ldr r0, [sp, 0xC] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0xF + bls _08124AFE + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08124BE0: .4byte 0x02020630 + thumb_func_end sub_8124AD4 + + thumb_func_start sub_8124BE4 +sub_8124BE4: @ 8124BE4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + mov r8, r0 + ldr r6, _08124CAC + ldrh r0, [r6, 0x2] + cmp r0, 0xD5 + beq _08124C9C + mov r5, sp + adds r5, 0x6 + add r7, sp, 0x4 + ldr r1, _08124CB0 + mov r9, r1 + movs r0, 0x1C + add r0, r9 + mov r10, r0 +_08124C0C: + mov r1, r8 + lsls r4, r1, 2 + adds r0, r4, r6 + ldrh r0, [r0] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08124C84 + adds r0, r6, 0x2 + adds r0, r4, r0 + ldrh r6, [r0] + mov r0, sp + adds r0, 0xA + str r0, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + add r3, sp, 0x8 + bl sub_8124630 + ldrh r0, [r7] + adds r0, 0x1 + lsls r0, 3 + strh r0, [r7] + ldrh r0, [r5] + adds r0, 0x2 + lsls r0, 3 + strh r0, [r5] + movs r0, 0 + ldrsh r1, [r7, r0] + movs r0, 0 + ldrsh r2, [r5, r0] + ldr r0, _08124CB4 + movs r3, 0xA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08124C84 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + mov r1, r9 + adds r4, r2, r1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x3] + add r2, r10 + ldr r0, _08124CB8 + str r0, [r2] + adds r0, r4, 0 + movs r1, 0x6 + bl obj_anim_image_start + strh r6, [r4, 0x2E] +_08124C84: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r6, _08124CAC + lsls r0, 2 + adds r1, r6, 0x2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xD5 + bne _08124C0C +_08124C9C: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08124CAC: .4byte 0x085a1f18 +_08124CB0: .4byte 0x02020630 +_08124CB4: .4byte 0x085a1f7c +_08124CB8: .4byte sub_8124CBC + 1 + thumb_func_end sub_8124BE4 + + thumb_func_start sub_8124CBC +sub_8124CBC: @ 8124CBC + push {lr} + adds r2, r0, 0 + ldr r0, _08124CFC + ldr r0, [r0] + ldrh r1, [r0, 0x8] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r1, r0 + bne _08124D00 + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08124D0E + movs r0, 0 + strh r0, [r2, 0x30] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08124D0E + .align 2, 0 +_08124CFC: .4byte 0x0203a148 +_08124D00: + movs r0, 0x10 + strh r0, [r2, 0x30] + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x15 + ands r0, r1 + strb r0, [r2] +_08124D0E: + pop {r0} + bx r0 + thumb_func_end sub_8124CBC + + thumb_func_start sub_8124D14 +sub_8124D14: @ 8124D14 + push {r4,lr} + sub sp, 0x4 + ldr r4, _08124D28 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + cmp r1, 0 + beq _08124D2C + cmp r1, 0x1 + beq _08124D46 + b _08124D56 + .align 2, 0 +_08124D28: .4byte 0x0203a148 +_08124D2C: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, [r4] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _08124D56 +_08124D46: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08124D56 + ldr r0, _08124D60 + bl sub_81248F4 +_08124D56: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08124D60: .4byte sub_8124D64 + 1 + thumb_func_end sub_8124D14 + + thumb_func_start sub_8124D64 +sub_8124D64: @ 8124D64 + push {r4,lr} + ldr r0, _08124D88 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0 + bne _08124DF8 + bl sub_81230AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _08124DF8 + lsls r0, 2 + ldr r1, _08124D8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08124D88: .4byte 0x0203a148 +_08124D8C: .4byte _08124D90 + .align 2, 0 +_08124D90: + .4byte _08124DF8 + .4byte _08124DF8 + .4byte _08124DF8 + .4byte _08124DA8 + .4byte _08124DAE + .4byte _08124DE0 +_08124DA8: + bl sub_8124904 + b _08124DF8 +_08124DAE: + ldr r4, _08124DD4 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0x2 + beq _08124DBC + cmp r0, 0x4 + bne _08124DF8 +_08124DBC: + movs r0, 0x5 + bl m4aSongNumStart + ldr r0, [r4] + ldr r1, _08124DD8 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08124DDC + bl sub_81248F4 + b _08124DF8 + .align 2, 0 +_08124DD4: .4byte 0x0203a148 +_08124DD8: .4byte 0x00000a72 +_08124DDC: .4byte sub_8124E0C + 1 +_08124DE0: + movs r0, 0x5 + bl m4aSongNumStart + ldr r0, _08124E00 + ldr r0, [r0] + ldr r1, _08124E04 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, _08124E08 + bl sub_81248F4 +_08124DF8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08124E00: .4byte 0x0203a148 +_08124E04: .4byte 0x00000a72 +_08124E08: .4byte sub_8124E0C + 1 + thumb_func_end sub_8124D64 + + thumb_func_start sub_8124E0C +sub_8124E0C: @ 8124E0C + push {r4,lr} + sub sp, 0x4 + ldr r4, _08124E20 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + cmp r1, 0 + beq _08124E24 + cmp r1, 0x1 + beq _08124E3E + b _08124F1A + .align 2, 0 +_08124E20: .4byte 0x0203a148 +_08124E24: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r4] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _08124F1A +_08124E3E: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08124F1A + bl sub_812305C + ldr r1, [r4] + ldr r2, _08124E68 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08124F00 + ldrh r0, [r1, 0x8] + cmp r0, 0xF + beq _08124E98 + cmp r0, 0xF + bgt _08124E6C + cmp r0, 0 + beq _08124E84 + b _08124EBC + .align 2, 0 +_08124E68: .4byte 0x00000a72 +_08124E6C: + cmp r0, 0x3A + beq _08124E7C + cmp r0, 0x49 + bne _08124EBC + movs r0, 0x15 + bl sub_8084CCC + b _08124EFA +_08124E7C: + movs r0, 0x16 + bl sub_8084CCC + b _08124EFA +_08124E84: + ldr r0, _08124E94 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0xD + cmp r0, 0 + bne _08124EB0 + movs r1, 0xC + b _08124EB0 + .align 2, 0 +_08124E94: .4byte 0x03005d90 +_08124E98: + ldr r0, _08124EB8 + bl flag_check + lsls r0, 24 + movs r1, 0xB + cmp r0, 0 + beq _08124EB0 + ldr r0, [r4] + ldrb r0, [r0, 0xB] + cmp r0, 0 + bne _08124EB0 + movs r1, 0x14 +_08124EB0: + adds r0, r1, 0 + bl sub_8084CCC + b _08124EFA + .align 2, 0 +_08124EB8: .4byte 0x000008b4 +_08124EBC: + ldr r3, _08124ED8 + ldr r0, _08124EDC + ldr r0, [r0] + ldrh r1, [r0, 0x8] + lsls r0, r1, 1 + adds r2, r0, r1 + adds r0, r3, 0x2 + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08124EE0 + bl sub_8084CCC + b _08124EFA + .align 2, 0 +_08124ED8: .4byte 0x085a1e3c +_08124EDC: .4byte 0x0203a148 +_08124EE0: + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + bl warp1_set_2 +_08124EFA: + bl sub_80B69DC + b _08124F06 +_08124F00: + ldr r0, _08124F24 + bl set_callback2 +_08124F06: + ldr r4, _08124F28 + ldr r0, [r4] + cmp r0, 0 + beq _08124F16 + bl free + movs r0, 0 + str r0, [r4] +_08124F16: + bl Window_FreeMemory +_08124F1A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08124F24: .4byte sub_81B58A8 + 1 +_08124F28: .4byte 0x0203a148 + thumb_func_end sub_8124E0C + + thumb_func_start sub_8124F2C +sub_8124F2C: @ 8124F2C + push {lr} + ldr r2, _08124F74 + ldr r1, [r0, 0x4] + str r1, [r2] + ldr r2, _08124F78 + ldrb r1, [r0, 0x1F] + strb r1, [r2] + ldr r2, _08124F7C + ldrb r1, [r0, 0x19] + strb r1, [r2] + ldr r2, _08124F80 + ldrb r1, [r0, 0x1A] + strb r1, [r2] + ldr r2, _08124F84 + ldrb r1, [r0, 0x1B] + strb r1, [r2] + ldr r2, _08124F88 + ldrb r1, [r0, 0x1C] + strb r1, [r2] + ldr r2, _08124F8C + ldrb r1, [r0, 0x1D] + strb r1, [r2] + ldr r2, _08124F90 + ldrb r1, [r0, 0x1E] + strb r1, [r2] + ldrb r0, [r0] + subs r0, 0x2 + cmp r0, 0x22 + bls _08124F68 + b _081250B4 +_08124F68: + lsls r0, 2 + ldr r1, _08124F94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08124F74: .4byte 0x03006168 +_08124F78: .4byte 0x0300617c +_08124F7C: .4byte 0x03006164 +_08124F80: .4byte 0x03006178 +_08124F84: .4byte 0x03006174 +_08124F88: .4byte 0x0300616c +_08124F8C: .4byte 0x03006180 +_08124F90: .4byte 0x03006170 +_08124F94: .4byte _08124F98 + .align 2, 0 +_08124F98: + .4byte _08125024 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _08125084 + .4byte _081250B4 + .4byte _0812502A + .4byte _08125030 + .4byte _08125044 + .4byte _08125056 + .4byte _081250B4 + .4byte _0812506C + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _08125072 + .4byte _08125050 + .4byte _08125078 + .4byte _0812507E + .4byte _081250B4 + .4byte _081250B4 + .4byte _08125090 +_08125024: + bl sub_8125230 + b _081250B4 +_0812502A: + bl sub_81252E8 + b _081250B4 +_08125030: + bl sub_81254E0 + ldr r0, _08125040 + ldrb r0, [r0] + bl sub_81253A4 + b _081250B4 + .align 2, 0 +_08125040: .4byte 0x0300617c +_08125044: + bl sub_81254E0 + bl sub_8125630 + bl sub_8125448 +_08125050: + bl sub_8125630 + b _081250B4 +_08125056: + bl sub_81254E0 + bl sub_81257F8 + bl sub_81257F8 + bl sub_81258A0 + bl sub_8125448 + b _081250B4 +_0812506C: + bl sub_81256C8 + b _081250B4 +_08125072: + bl sub_81254E0 + b _081250B4 +_08125078: + bl sub_81257F8 + b _081250B4 +_0812507E: + bl sub_81258A0 + b _081250B4 +_08125084: + bl sub_8125250 + movs r0, 0x3 + bl sub_81250B8 + b _081250B4 +_08125090: + bl sub_81254E0 + bl sub_81257F8 + bl sub_81258A0 + bl sub_8125448 + bl sub_81252E8 + bl sub_81252E8 + movs r0, 0x2 + bl sub_81250B8 + movs r0, 0x4 + bl sub_8125170 +_081250B4: + pop {r0} + bx r0 + thumb_func_end sub_8124F2C + + thumb_func_start sub_81250B8 +sub_81250B8: @ 81250B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r2, 0 + ldr r0, _08125158 + mov r8, r0 + ldrb r0, [r0] + cmp r2, r0 + bcs _0812514A + ldr r1, _0812515C + mov r12, r1 + ldr r3, _08125160 + mov r10, r3 + ldr r0, _08125164 + mov r9, r0 +_081250DE: + ldr r1, _08125168 + ldrb r0, [r1] + adds r0, r2 + mov r3, r10 + ldrb r1, [r3] + muls r0, r1 + lsls r0, 1 + ldr r3, _0812516C + ldr r1, [r3] + adds r1, r0 + mov r3, r9 + ldrb r0, [r3] + lsls r0, 1 + adds r3, r1, r0 + movs r4, 0 + adds r5, r2, 0x1 + mov r0, r12 + ldrb r0, [r0] + cmp r4, r0 + bcs _0812513E + movs r6, 0x80 + lsls r6, 8 +_0812510A: + ldrh r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0812512E + movs r0, 0x1F + ands r0, r1 + adds r0, r7 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _08125124 + movs r2, 0x1F +_08125124: + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r3] +_0812512E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r3, 0x2 + mov r1, r12 + ldrb r1, [r1] + cmp r4, r1 + bcc _0812510A +_0812513E: + lsls r0, r5, 24 + lsrs r2, r0, 24 + mov r3, r8 + ldrb r3, [r3] + cmp r2, r3 + bcc _081250DE +_0812514A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08125158: .4byte 0x0300616c +_0812515C: .4byte 0x03006174 +_08125160: .4byte 0x03006180 +_08125164: .4byte 0x03006164 +_08125168: .4byte 0x03006178 +_0812516C: .4byte 0x03006168 + thumb_func_end sub_81250B8 + + thumb_func_start sub_8125170 +sub_8125170: @ 8125170 + 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 r2, 0 + ldr r0, _08125218 + ldrb r0, [r0] + cmp r2, r0 + bcs _08125208 + ldr r1, _0812521C + mov r10, r1 +_0812518E: + ldr r3, _08125220 + ldrb r0, [r3] + adds r0, r2 + ldr r3, _08125224 + ldrb r1, [r3] + muls r0, r1 + lsls r0, 1 + ldr r3, _08125228 + ldr r1, [r3] + adds r1, r0 + ldr r3, _0812522C + ldrb r0, [r3] + lsls r0, 1 + adds r3, r1, r0 + movs r5, 0 + adds r7, r2, 0x1 + mov r0, r10 + ldrb r0, [r0] + cmp r5, r0 + bcs _081251FC + movs r1, 0x80 + lsls r1, 8 + mov r9, r1 + movs r0, 0x1F + mov r12, r0 + mov r1, r8 + subs r6, r0, r1 +_081251C4: + ldrh r1, [r3] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _081251EC + movs r4, 0x1F + mov r2, r12 + ands r2, r1 + cmp r2, r6 + ble _081251E2 + mov r1, r8 + lsrs r0, r1, 1 + subs r0, r4, r0 + lsls r0, 24 + lsrs r2, r0, 24 +_081251E2: + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r3] +_081251EC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r3, 0x2 + mov r0, r10 + ldrb r0, [r0] + cmp r5, r0 + bcc _081251C4 +_081251FC: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r1, _08125218 + ldrb r1, [r1] + cmp r2, r1 + bcc _0812518E +_08125208: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08125218: .4byte 0x0300616c +_0812521C: .4byte 0x03006174 +_08125220: .4byte 0x03006178 +_08125224: .4byte 0x03006180 +_08125228: .4byte 0x03006168 +_0812522C: .4byte 0x03006164 + thumb_func_end sub_8125170 + + thumb_func_start sub_8125230 +sub_8125230: @ 8125230 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _0812524C +_08125236: + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_8125954 + adds r4, 0x1 + cmp r4, r5 + bls _08125236 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812524C: .4byte 0x00000c7f + thumb_func_end sub_8125230 + + thumb_func_start sub_8125250 +sub_8125250: @ 8125250 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _081252D0 + ldrb r0, [r0] + cmp r2, r0 + bcs _081252C2 + ldr r0, _081252D4 + mov r8, r0 + ldr r3, _081252D8 +_08125268: + ldr r0, _081252DC + ldrb r1, [r0] + adds r1, r2 + ldr r0, _081252E0 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, _081252E4 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _081252B6 + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_08125294: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _081252A8 + adds r0, r4, 0 + str r3, [sp] + bl sub_8125B28 + strh r0, [r4] + ldr r3, [sp] +_081252A8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _08125294 +_081252B6: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, _081252D0 + ldrb r0, [r0] + cmp r2, r0 + bcc _08125268 +_081252C2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081252D0: .4byte 0x0300616c +_081252D4: .4byte 0x03006168 +_081252D8: .4byte 0x03006174 +_081252DC: .4byte 0x03006178 +_081252E0: .4byte 0x03006180 +_081252E4: .4byte 0x03006164 + thumb_func_end sub_8125250 + + thumb_func_start sub_81252E8 +sub_81252E8: @ 81252E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r2, 0 + ldr r0, _0812538C + ldrb r0, [r0] + cmp r2, r0 + bcs _0812537E + ldr r0, _08125390 + mov r8, r0 + ldr r3, _08125394 +_08125300: + ldr r0, _08125398 + ldrb r1, [r0] + ldrb r0, [r3] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, _0812539C + ldrb r0, [r0] + adds r0, r2 + lsls r0, 1 + adds r4, r1, r0 + ldrh r1, [r4] + mov r0, sp + strh r1, [r0] + movs r5, 0x1 + ldrb r0, [r3] + lsls r0, 1 + adds r4, r0 + ldr r0, _081253A0 + ldrb r0, [r0] + subs r0, 0x1 + adds r7, r2, 0x1 + cmp r5, r0 + bge _08125372 + ldr r6, _08125394 +_08125336: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0812535C + ldrb r2, [r6] + lsls r2, 1 + adds r2, r4, r2 + mov r0, sp + adds r1, r4, 0 + str r3, [sp, 0x4] + bl sub_8125E18 + strh r0, [r4] + mov r1, sp + strh r0, [r1] + ldr r3, [sp, 0x4] +_0812535C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6] + lsls r0, 1 + adds r4, r0 + ldr r0, _081253A0 + ldrb r0, [r0] + subs r0, 0x1 + cmp r5, r0 + blt _08125336 +_08125372: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, _0812538C + ldrb r0, [r0] + cmp r2, r0 + bcc _08125300 +_0812537E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812538C: .4byte 0x03006174 +_08125390: .4byte 0x03006168 +_08125394: .4byte 0x03006180 +_08125398: .4byte 0x03006178 +_0812539C: .4byte 0x03006164 +_081253A0: .4byte 0x0300616c + thumb_func_end sub_81252E8 + + thumb_func_start sub_81253A4 +sub_81253A4: @ 81253A4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0 + ldr r0, _08125430 + ldrb r0, [r0] + cmp r2, r0 + bcs _08125420 + ldr r0, _08125434 + mov r9, r0 + ldr r3, _08125438 +_081253C4: + ldr r0, _0812543C + ldrb r1, [r0] + adds r1, r2 + ldr r0, _08125440 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r9 + ldr r1, [r4] + adds r1, r0 + ldr r0, _08125444 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _08125414 + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_081253F0: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _08125406 + adds r0, r4, 0 + mov r1, r8 + str r3, [sp] + bl sub_8125B5C + strh r0, [r4] + ldr r3, [sp] +_08125406: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _081253F0 +_08125414: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, _08125430 + ldrb r0, [r0] + cmp r2, r0 + bcc _081253C4 +_08125420: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08125430: .4byte 0x0300616c +_08125434: .4byte 0x03006168 +_08125438: .4byte 0x03006174 +_0812543C: .4byte 0x03006178 +_08125440: .4byte 0x03006180 +_08125444: .4byte 0x03006164 + thumb_func_end sub_81253A4 + + thumb_func_start sub_8125448 +sub_8125448: @ 8125448 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _081254C8 + ldrb r0, [r0] + cmp r2, r0 + bcs _081254BA + ldr r0, _081254CC + mov r8, r0 + ldr r3, _081254D0 +_08125460: + ldr r0, _081254D4 + ldrb r1, [r0] + adds r1, r2 + ldr r0, _081254D8 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, _081254DC + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _081254AE + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_0812548C: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _081254A0 + adds r0, r4, 0 + str r3, [sp] + bl sub_8125C68 + strh r0, [r4] + ldr r3, [sp] +_081254A0: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _0812548C +_081254AE: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, _081254C8 + ldrb r0, [r0] + cmp r2, r0 + bcc _08125460 +_081254BA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081254C8: .4byte 0x0300616c +_081254CC: .4byte 0x03006168 +_081254D0: .4byte 0x03006174 +_081254D4: .4byte 0x03006178 +_081254D8: .4byte 0x03006180 +_081254DC: .4byte 0x03006164 + thumb_func_end sub_8125448 + + thumb_func_start sub_81254E0 +sub_81254E0: @ 81254E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + ldr r0, _08125618 + ldrb r0, [r0] + cmp r7, r0 + bcs _0812556C + ldr r0, _0812561C + mov r8, r0 +_081254F6: + ldr r0, _08125620 + ldrb r1, [r0] + adds r1, r7 + ldr r0, _08125624 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r2, r8 + ldr r1, [r2] + adds r1, r0 + ldr r0, _08125628 + ldrb r0, [r0] + lsls r0, 1 + adds r5, r1, r0 + adds r4, r5, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8125C98 + strh r0, [r5] + movs r6, 0x1 + adds r5, r4, 0 + ldr r0, _0812562C + ldrb r0, [r0] + subs r0, 0x1 + adds r7, 0x1 + cmp r6, r0 + bge _08125556 +_0812552E: + adds r4, r5, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8125C98 + strh r0, [r5] + subs r1, r5, 0x2 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r4, 0 + ldr r0, _0812562C + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + blt _0812552E +_08125556: + subs r1, r5, 0x2 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + lsls r0, r7, 24 + lsrs r7, r0, 24 + ldr r0, _08125618 + ldrb r0, [r0] + cmp r7, r0 + bcc _081254F6 +_0812556C: + movs r6, 0 + ldr r0, _0812562C + ldrb r0, [r0] + cmp r6, r0 + bcs _0812560C + ldr r3, _0812561C + mov r9, r3 + ldr r0, _08125624 + mov r8, r0 +_0812557E: + ldr r0, _08125620 + ldrb r0, [r0] + mov r2, r8 + ldrb r1, [r2] + muls r0, r1 + lsls r0, 1 + mov r3, r9 + ldr r2, [r3] + adds r2, r0 + ldr r0, _08125628 + ldrb r0, [r0] + adds r0, r6 + lsls r0, 1 + adds r5, r2, r0 + lsls r1, 1 + adds r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + movs r7, 0x1 + mov r1, r8 + ldrb r0, [r1] + lsls r0, 1 + adds r5, r0 + ldr r0, _08125618 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, 0x1 + cmp r7, r0 + bge _081255F0 + ldr r4, _08125624 +_081255BE: + ldrb r1, [r4] + lsls r1, 1 + adds r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + ldrb r1, [r4] + lsls r1, 1 + subs r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4] + lsls r0, 1 + adds r5, r0 + ldr r0, _08125618 + ldrb r0, [r0] + subs r0, 0x1 + cmp r7, r0 + blt _081255BE +_081255F0: + mov r2, r8 + ldrb r1, [r2] + lsls r1, 1 + subs r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + lsls r0, r6, 24 + lsrs r6, r0, 24 + ldr r0, _0812562C + ldrb r0, [r0] + cmp r6, r0 + bcc _0812557E +_0812560C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08125618: .4byte 0x0300616c +_0812561C: .4byte 0x03006168 +_08125620: .4byte 0x03006178 +_08125624: .4byte 0x03006180 +_08125628: .4byte 0x03006164 +_0812562C: .4byte 0x03006174 + thumb_func_end sub_81254E0 + + thumb_func_start sub_8125630 +sub_8125630: @ 8125630 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _081256B0 + ldrb r0, [r0] + cmp r2, r0 + bcs _081256A2 + ldr r0, _081256B4 + mov r8, r0 + ldr r3, _081256B8 +_08125648: + ldr r0, _081256BC + ldrb r1, [r0] + adds r1, r2 + ldr r0, _081256C0 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, _081256C4 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _08125696 + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_08125674: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _08125688 + adds r0, r4, 0 + str r3, [sp] + bl sub_8125CC8 + strh r0, [r4] + ldr r3, [sp] +_08125688: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _08125674 +_08125696: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, _081256B0 + ldrb r0, [r0] + cmp r2, r0 + bcc _08125648 +_081256A2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081256B0: .4byte 0x0300616c +_081256B4: .4byte 0x03006168 +_081256B8: .4byte 0x03006174 +_081256BC: .4byte 0x03006178 +_081256C0: .4byte 0x03006180 +_081256C4: .4byte 0x03006164 + thumb_func_end sub_8125630 + + thumb_func_start sub_81256C8 +sub_81256C8: @ 81256C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, _081257F4 + ldr r4, [r0] + movs r6, 0 + movs r0, 0x80 + lsls r0, 8 + adds r5, r0, 0 +_081256E0: + movs r7, 0 +_081256E2: + ldrh r0, [r4] + ands r0, r5 + cmp r0, 0 + bne _081256F2 + adds r0, r4, 0 + bl sub_8125CC8 + strh r0, [r4] +_081256F2: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r4, 0x2 + cmp r7, 0x3F + bls _081256E2 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3F + bls _081256E0 + movs r7, 0 + ldr r1, _081257F4 + mov r10, r1 + mov r3, sp + movs r2, 0x80 + lsls r2, 8 + mov r9, r2 +_08125716: + lsls r0, r7, 1 + mov r2, r10 + ldr r1, [r2] + adds r4, r1, r0 + ldrh r1, [r4] + strh r1, [r3] + mov r1, r9 + strh r1, [r4] + movs r6, 0x1 + adds r4, 0x80 + adds r5, r0, 0 +_0812572C: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + ands r0, r2 + cmp r0, 0 + bne _0812574C + adds r2, r4, 0 + adds r2, 0x80 + mov r0, sp + adds r1, r4, 0 + str r3, [sp, 0x4] + bl sub_8125F38 + strh r0, [r4] + ldr r3, [sp, 0x4] + strh r0, [r3] +_0812574C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, 0x80 + cmp r6, 0x3E + bls _0812572C + mov r0, r9 + strh r0, [r4] + mov r1, r10 + ldr r0, [r1] + adds r4, r0, r5 + ldrh r0, [r4] + strh r0, [r3] + mov r2, r9 + strh r2, [r4] + movs r6, 0x1 + adds r4, 0x80 + movs r0, 0x80 + lsls r0, 8 + mov r8, r0 +_08125774: + ldrh r0, [r4] + mov r1, r8 + ands r0, r1 + adds r5, r4, 0 + adds r5, 0x80 + cmp r0, 0 + bne _08125794 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + str r3, [sp, 0x4] + bl sub_8125F38 + strh r0, [r4] + ldr r3, [sp, 0x4] + strh r0, [r3] +_08125794: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r5, 0 + cmp r6, 0x3E + bls _08125774 + mov r2, r9 + strh r2, [r4] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3F + bls _08125716 + ldr r0, _081257F4 + ldr r4, [r0] + movs r6, 0 + movs r0, 0x80 + lsls r0, 8 + mov r8, r0 +_081257BA: + movs r7, 0 + adds r5, r6, 0x1 +_081257BE: + ldrh r0, [r4] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _081257D0 + adds r0, r4, 0 + bl sub_8125CC8 + strh r0, [r4] +_081257D0: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r4, 0x2 + cmp r7, 0x3F + bls _081257BE + lsls r0, r5, 24 + lsrs r6, r0, 24 + cmp r6, 0x3F + bls _081257BA + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081257F4: .4byte 0x03006168 + thumb_func_end sub_81256C8 + + thumb_func_start sub_81257F8 +sub_81257F8: @ 81257F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _08125888 + ldrb r0, [r0] + cmp r2, r0 + bcs _0812587A + ldr r0, _0812588C + mov r8, r0 +_0812580E: + ldr r0, _08125890 + ldrb r1, [r0] + adds r1, r2 + ldr r0, _08125894 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, _08125898 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + ldrh r1, [r4] + mov r0, sp + strh r1, [r0] + movs r5, 0x1 + adds r4, 0x2 + ldr r0, _0812589C + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0x1 + cmp r5, r0 + bge _0812586E + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_08125846: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _0812585C + mov r0, sp + adds r1, r4, 0 + bl sub_8125CF4 + strh r0, [r4] + mov r1, sp + strh r0, [r1] +_0812585C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, _0812589C + ldrb r0, [r0] + subs r0, 0x1 + cmp r5, r0 + blt _08125846 +_0812586E: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, _08125888 + ldrb r0, [r0] + cmp r2, r0 + bcc _0812580E +_0812587A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08125888: .4byte 0x0300616c +_0812588C: .4byte 0x03006168 +_08125890: .4byte 0x03006178 +_08125894: .4byte 0x03006180 +_08125898: .4byte 0x03006164 +_0812589C: .4byte 0x03006174 + thumb_func_end sub_81257F8 + + thumb_func_start sub_81258A0 +sub_81258A0: @ 81258A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r2, 0 + ldr r0, _0812593C + ldrb r0, [r0] + cmp r2, r0 + bcs _0812592E + ldr r0, _08125940 + mov r8, r0 + ldr r7, _08125944 +_081258B8: + ldr r0, _08125948 + ldrb r1, [r0] + ldrb r0, [r7] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, _0812594C + ldrb r0, [r0] + adds r0, r2 + lsls r0, 1 + adds r4, r1, r0 + ldrh r1, [r4] + mov r0, sp + strh r1, [r0] + movs r5, 0x1 + ldrb r0, [r7] + lsls r0, 1 + adds r4, r0 + ldr r0, _08125950 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0x1 + cmp r5, r0 + bge _08125922 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_081258F2: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + bne _0812590C + mov r0, sp + adds r1, r4, 0 + str r2, [sp, 0x4] + bl sub_8125CF4 + strh r0, [r4] + mov r1, sp + strh r0, [r1] + ldr r2, [sp, 0x4] +_0812590C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r7] + lsls r0, 1 + adds r4, r0 + ldr r0, _08125950 + ldrb r0, [r0] + subs r0, 0x1 + cmp r5, r0 + blt _081258F2 +_08125922: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, _0812593C + ldrb r0, [r0] + cmp r2, r0 + bcc _081258B8 +_0812592E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812593C: .4byte 0x03006174 +_08125940: .4byte 0x03006168 +_08125944: .4byte 0x03006180 +_08125948: .4byte 0x03006178 +_0812594C: .4byte 0x03006164 +_08125950: .4byte 0x0300616c + thumb_func_end sub_81258A0 + + thumb_func_start sub_8125954 +sub_8125954: @ 8125954 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + mov r2, sp + ldr r3, _081259C0 + lsls r1, r0, 1 + add r1, r10 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r2, 0x1] + mov r5, sp + adds r0, r3, 0x2 + adds r1, r0 + ldrb r4, [r1] + lsls r2, r4, 24 + lsrs r1, r2, 27 + movs r0, 0x7 + ands r1, r0 + strh r1, [r5, 0x2] + lsrs r2, 25 + mov r9, r2 + movs r0, 0x3 + ands r2, r0 + mov r9, r2 + movs r5, 0x1 + ands r5, r4 + movs r4, 0x1 + mov r8, r4 + cmp r8, r1 + bcs _08125A06 + mov r3, sp +_081259A6: + cmp r5, 0 + bne _081259C4 + mov r0, r8 + lsls r2, r0, 2 + mov r4, sp + adds r1, r4, r2 + ldrb r0, [r3] + mov r4, r8 + subs r0, r4 + strb r0, [r1] + ldrb r0, [r3, 0x1] + add r0, r8 + b _081259D6 + .align 2, 0 +_081259C0: .4byte 0x085a1f94 +_081259C4: + mov r0, r8 + lsls r2, r0, 2 + mov r4, sp + adds r1, r4, r2 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r1] + ldrb r0, [r3, 0x1] + subs r0, 0x1 +_081259D6: + strb r0, [r1, 0x1] + add r2, sp + ldrb r0, [r2] + cmp r0, 0x3F + bhi _081259E6 + ldrb r0, [r2, 0x1] + cmp r0, 0x3F + bls _081259EE +_081259E6: + mov r0, r8 + subs r0, 0x1 + strh r0, [r3, 0x2] + b _08125A06 +_081259EE: + ldrh r0, [r3, 0x2] + mov r1, r8 + subs r0, r1 + strh r0, [r2, 0x2] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r3, 0x2] + cmp r8, r0 + bcc _081259A6 +_08125A06: + movs r2, 0 + mov r8, r2 + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r8, r0 + bcc _08125A14 + b _08125B16 +_08125A14: + movs r3, 0x1F +_08125A16: + ldr r1, _08125A74 + mov r4, r8 + lsls r0, r4, 2 + mov r2, sp + adds r6, r2, r0 + ldrb r0, [r6, 0x1] + lsls r0, 7 + ldr r1, [r1] + adds r1, r0 + ldrb r0, [r6] + lsls r0, 1 + adds r2, r1, r0 + ldrh r1, [r2] + movs r4, 0x80 + lsls r4, 8 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _08125B02 + movs r7, 0x1F + ands r7, r1 + lsls r0, r1, 16 + lsrs r5, r0, 21 + ands r5, r3 + lsrs r4, r0, 26 + ands r4, r3 + mov r0, r9 + cmp r0, 0 + blt _08125AF8 + cmp r0, 0x1 + ble _08125A78 + cmp r0, 0x3 + bgt _08125AF8 + ldrh r0, [r6, 0x2] + adds r1, r7, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r1, r5, r0 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r7, 0x1F + bls _08125AEC + movs r7, 0x1F + b _08125AEC + .align 2, 0 +_08125A74: .4byte 0x03006168 +_08125A78: + mov r1, r10 + lsls r0, r1, 1 + add r0, r10 + ldr r1, _08125AAC + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsrs r0, 3 + movs r1, 0x7 + ands r0, r1 + movs r1, 0x3 + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + cmp r0, 0x1 + beq _08125AC8 + cmp r0, 0x1 + bgt _08125AB0 + cmp r0, 0 + beq _08125AB6 + b _08125AF8 + .align 2, 0 +_08125AAC: .4byte 0x085a1f94 +_08125AB0: + cmp r0, 0x2 + beq _08125ADA + b _08125AF8 +_08125AB6: + ldrh r0, [r6, 0x2] + cmp r7, r0 + bcc _08125AC4 + subs r0, r7, r0 + lsls r0, 16 + lsrs r7, r0, 16 + b _08125AF8 +_08125AC4: + movs r7, 0 + b _08125AF8 +_08125AC8: + ldrh r0, [r6, 0x2] + cmp r5, r0 + bcc _08125AD6 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + b _08125AF8 +_08125AD6: + movs r5, 0 + b _08125AF8 +_08125ADA: + ldrh r0, [r6, 0x2] + cmp r4, r0 + bcc _08125AE8 + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + b _08125AF8 +_08125AE8: + movs r4, 0 + b _08125AF8 +_08125AEC: + cmp r5, 0x1F + bls _08125AF2 + movs r5, 0x1F +_08125AF2: + cmp r4, 0x1F + bls _08125AF8 + movs r4, 0x1F +_08125AF8: + lsls r0, r4, 10 + lsls r1, r5, 5 + orrs r0, r1 + orrs r7, r0 + strh r7, [r2] +_08125B02: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r8, r0 + bcs _08125B16 + b _08125A16 +_08125B16: + 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_8125954 + + thumb_func_start sub_8125B28 +sub_8125B28: @ 8125B28 + ldrh r2, [r0] + movs r0, 0x1F + adds r1, r2, 0 + ands r1, r0 + asrs r3, r2, 5 + ands r3, r0 + asrs r2, 10 + ands r2, r0 + movs r0, 0x4C + muls r1, r0 + movs r0, 0x97 + muls r0, r3 + adds r1, r0 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r2 + adds r1, r0 + asrs r1, 8 + lsls r0, r1, 10 + lsls r2, r1, 5 + orrs r0, r2 + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + thumb_func_end sub_8125B28 + + thumb_func_start sub_8125B5C +sub_8125B5C: @ 8125B5C + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldrh r0, [r0] + movs r2, 0x1F + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r3, r0, 21 + ands r3, r2 + lsrs r0, 26 + ands r0, r2 + cmp r1, 0x10 + bhi _08125B8C + cmp r3, 0x10 + bhi _08125B8C + cmp r0, 0x10 + bhi _08125B8C + adds r0, r4, 0 + bl sub_8125B98 + lsls r0, 16 + lsrs r0, 16 + b _08125B8E +_08125B8C: + ldr r0, _08125B94 +_08125B8E: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08125B94: .4byte 0x00007fff + thumb_func_end sub_8125B5C + + thumb_func_start sub_8125B98 +sub_8125B98: @ 8125B98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + mov r8, r0 + movs r6, 0 + movs r7, 0 + adds r0, r4, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _08125C50 + lsls r0, 2 + ldr r1, _08125BDC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08125BDC: .4byte _08125BE0 + .align 2, 0 +_08125BE0: + .4byte _08125BF8 + .4byte _08125C08 + .4byte _08125C18 + .4byte _08125C26 + .4byte _08125C34 + .4byte _08125C42 +_08125BF8: + movs r0, 0x15 + subs r0, r5 + lsls r0, 16 + lsrs r6, r0, 16 + adds r7, r6, 0 + movs r1, 0 + mov r8, r1 + b _08125C50 +_08125C08: + movs r7, 0 + movs r0, 0x15 + subs r0, r5 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r6, r8 + b _08125C50 +_08125C18: + movs r0, 0x15 + subs r0, r5 + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + mov r8, r7 + b _08125C50 +_08125C26: + movs r7, 0 + movs r6, 0 + movs r0, 0x17 + subs r0, r5 + lsls r0, 16 + lsrs r0, 16 + b _08125C4E +_08125C34: + movs r0, 0x17 + subs r0, r5 + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + mov r8, r6 + b _08125C50 +_08125C42: + movs r7, 0 + movs r0, 0x17 + subs r0, r5 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 +_08125C4E: + mov r8, r0 +_08125C50: + lsls r0, r7, 10 + lsls r1, r6, 5 + orrs r0, r1 + mov r1, r8 + orrs r1, r0 + lsls r0, r1, 16 + lsrs r0, 16 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8125B98 + + thumb_func_start sub_8125C68 +sub_8125C68: @ 8125C68 + push {lr} + ldrh r0, [r0] + movs r2, 0x1F + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r3, r0, 21 + ands r3, r2 + lsrs r0, 26 + ands r0, r2 + cmp r1, 0x10 + bhi _08125C8C + cmp r3, 0x10 + bhi _08125C8C + cmp r0, 0x10 + bhi _08125C8C + movs r0, 0 + b _08125C8E +_08125C8C: + ldr r0, _08125C94 +_08125C8E: + pop {r1} + bx r1 + .align 2, 0 +_08125C94: .4byte 0x00007fff + thumb_func_end sub_8125C68 + + thumb_func_start sub_8125C98 +sub_8125C98: @ 8125C98 + push {r4,lr} + adds r4, r0, 0 + ldrh r3, [r4] + cmp r3, 0 + beq _08125CC0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08125CB2 + adds r0, r2, 0 + b _08125CC2 +_08125CB2: + ldrh r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08125CC0 + ldrh r0, [r4] + b _08125CC2 +_08125CC0: + movs r0, 0 +_08125CC2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8125C98 + + thumb_func_start sub_8125CC8 +sub_8125CC8: @ 8125CC8 + push {r4,lr} + ldrh r1, [r0] + movs r0, 0x1F + movs r3, 0x1F + ands r3, r1 + lsls r1, 16 + lsrs r2, r1, 21 + lsrs r1, 26 + subs r3, r0, r3 + adds r4, r0, 0 + bics r4, r2 + adds r2, r4, 0 + bics r0, r1 + lsls r0, 10 + lsls r2, 5 + orrs r0, r2 + orrs r0, r3 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8125CC8 + + thumb_func_start sub_8125CF4 +sub_8125CF4: @ 8125CF4 + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r1, 0 + ldrh r4, [r0] + ldrh r5, [r7] + lsls r6, r4, 16 + lsls r0, r5, 16 + mov r12, r0 + cmp r4, r5 + beq _08125D66 + mov r2, sp + movs r3, 0x1F + movs r1, 0x1F + adds r0, r1, 0 + ands r0, r4 + strh r0, [r2] + lsrs r0, r6, 21 + ands r0, r3 + strh r0, [r2, 0x2] + lsrs r0, r6, 26 + ands r0, r3 + strh r0, [r2, 0x4] + mov r0, sp + ands r1, r5 + strh r1, [r0, 0x6] + mov r1, sp + mov r2, r12 + lsrs r0, r2, 21 + ands r0, r3 + strh r0, [r1, 0x8] + lsrs r0, r2, 26 + ands r0, r3 + strh r0, [r1, 0xA] + mov r0, sp + ldrh r0, [r0] + cmp r0, 0x19 + bls _08125D4E + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r0, 0x19 + bls _08125D4E + mov r0, sp + ldrh r0, [r0, 0x4] + cmp r0, 0x19 + bhi _08125D66 +_08125D4E: + mov r0, sp + ldrh r0, [r0, 0x6] + cmp r0, 0x19 + bls _08125D6A + mov r0, sp + ldrh r0, [r0, 0x8] + cmp r0, 0x19 + bls _08125D6A + mov r0, sp + ldrh r0, [r0, 0xA] + cmp r0, 0x19 + bls _08125D6A +_08125D66: + ldrh r0, [r7] + b _08125E10 +_08125D6A: + movs r4, 0 + add r6, sp, 0xC + mov r7, sp + adds r7, 0x6 + adds r5, r6, 0 +_08125D74: + lsls r2, r4, 1 + mov r1, sp + adds r0, r1, r2 + adds r1, r7, r2 + ldrh r3, [r0] + ldrh r0, [r1] + cmp r3, r0 + bls _08125D8A + adds r1, r5, r2 + subs r0, r3, r0 + b _08125D8E +_08125D8A: + adds r1, r5, r2 + subs r0, r3 +_08125D8E: + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08125D74 + adds r1, r6, 0 + ldrh r0, [r1, 0x2] + ldrh r3, [r1] + cmp r3, r0 + bcc _08125DB4 + ldrh r2, [r1, 0x4] + cmp r3, r2 + bcc _08125DAE + adds r2, r3, 0 + b _08125DC8 +_08125DAE: + cmp r0, r2 + bcs _08125DBA + b _08125DC2 +_08125DB4: + ldrh r2, [r1, 0x4] + cmp r0, r2 + bcc _08125DBE +_08125DBA: + ldrh r2, [r1, 0x2] + b _08125DC8 +_08125DBE: + cmp r2, r3 + bcc _08125DC6 +_08125DC2: + ldrh r2, [r1, 0x4] + b _08125DC8 +_08125DC6: + ldrh r2, [r6] +_08125DC8: + mov r0, sp + ldrh r1, [r0, 0x6] + lsrs r0, r2, 1 + movs r6, 0x1F + subs r6, r0 + adds r0, r1, 0 + muls r0, r6 + movs r1, 0x1F + bl __divsi3 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r0, sp + ldrh r0, [r0, 0x8] + muls r0, r6 + movs r1, 0x1F + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + ldrh r0, [r0, 0xA] + muls r0, r6 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 6 + lsls r4, 5 + orrs r0, r4 + orrs r5, r0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r5, 0 +_08125E10: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8125CF4 + + thumb_func_start sub_8125E18 +sub_8125E18: @ 8125E18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + mov r10, r1 + str r2, [sp] + ldrh r1, [r3] + mov r0, r10 + ldrh r0, [r0] + cmp r1, r0 + bne _08125E40 + ldrh r0, [r2] + cmp r0, r1 + bne _08125E40 + mov r1, r10 + ldrh r0, [r1] + b _08125F28 +_08125E40: + mov r2, r10 + ldrh r0, [r2] + movs r1, 0x1F + mov r9, r1 + movs r4, 0x1F + adds r5, r4, 0 + ands r5, r0 + lsls r0, 16 + lsrs r2, r0, 21 + mov r1, r9 + ands r1, r2 + mov r8, r1 + lsrs r0, 26 + mov r2, r9 + ands r2, r0 + str r2, [sp, 0x4] + ldrh r2, [r3] + adds r0, r4, 0 + ands r0, r2 + lsls r2, 16 + lsrs r1, r2, 21 + mov r3, r9 + ands r1, r3 + adds r0, r1 + lsrs r2, 26 + ands r2, r3 + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + adds r0, r5, r1 + ldr r2, [sp, 0x4] + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, [sp] + ldrh r1, [r3] + ands r4, r1 + lsls r1, 16 + lsrs r0, r1, 21 + mov r2, r9 + ands r0, r2 + adds r4, r0 + lsrs r1, 26 + ands r1, r2 + adds r4, r1 + adds r0, r4, 0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r7, r6 + bne _08125EC2 + cmp r1, r6 + bne _08125EC2 + mov r3, r10 + ldrh r0, [r3] + b _08125F28 +_08125EC2: + cmp r7, r6 + bls _08125ECA + subs r0, r7, r6 + b _08125ECC +_08125ECA: + subs r0, r6, r7 +_08125ECC: + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, r6 + bls _08125ED8 + subs r0, r1, r6 + b _08125EDA +_08125ED8: + subs r0, r6, r1 +_08125EDA: + lsls r0, 16 + lsrs r0, 16 + cmp r2, r0 + bcc _08125EE4 + adds r0, r2, 0 +_08125EE4: + lsrs r0, 1 + movs r4, 0x1F + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r1, [sp, 0x4] + adds r0, r1, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 6 + mov r2, r8 + lsls r1, r2, 5 + orrs r0, r1 + orrs r5, r0 + lsls r0, r5, 16 + lsrs r0, 16 +_08125F28: + 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_8125E18 + + thumb_func_start sub_8125F38 +sub_8125F38: @ 8125F38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + mov r10, r1 + str r2, [sp] + ldrh r1, [r3] + mov r0, r10 + ldrh r0, [r0] + cmp r1, r0 + bne _08125F60 + ldrh r0, [r2] + cmp r0, r1 + bne _08125F60 + mov r1, r10 + ldrh r0, [r1] + b _08126046 +_08125F60: + mov r2, r10 + ldrh r0, [r2] + movs r1, 0x1F + mov r9, r1 + movs r4, 0x1F + adds r5, r4, 0 + ands r5, r0 + lsls r0, 16 + lsrs r2, r0, 21 + mov r1, r9 + ands r1, r2 + mov r8, r1 + lsrs r0, 26 + mov r2, r9 + ands r2, r0 + str r2, [sp, 0x4] + ldrh r2, [r3] + adds r0, r4, 0 + ands r0, r2 + lsls r2, 16 + lsrs r1, r2, 21 + mov r3, r9 + ands r1, r3 + adds r0, r1 + lsrs r2, 26 + ands r2, r3 + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + adds r0, r5, r1 + ldr r2, [sp, 0x4] + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, [sp] + ldrh r1, [r3] + ands r4, r1 + lsls r1, 16 + lsrs r0, r1, 21 + mov r2, r9 + ands r0, r2 + adds r4, r0 + lsrs r1, 26 + ands r1, r2 + adds r4, r1 + adds r0, r4, 0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r7, r6 + bne _08125FE2 + cmp r1, r6 + bne _08125FE2 + mov r3, r10 + ldrh r0, [r3] + b _08126046 +_08125FE2: + cmp r7, r6 + bls _08125FEA + subs r0, r7, r6 + b _08125FEC +_08125FEA: + subs r0, r6, r7 +_08125FEC: + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, r6 + bls _08125FF8 + subs r0, r1, r6 + b _08125FFA +_08125FF8: + subs r0, r6, r1 +_08125FFA: + lsls r0, 16 + lsrs r0, 16 + cmp r2, r0 + bcc _08126004 + adds r0, r2, 0 +_08126004: + movs r4, 0x1F + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r1, [sp, 0x4] + adds r0, r1, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 6 + mov r2, r8 + lsls r1, r2, 5 + orrs r0, r1 + orrs r5, r0 + lsls r0, r5, 16 + lsrs r0, 16 +_08126046: + 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_8125F38 + + thumb_func_start sub_8126058 +sub_8126058: @ 8126058 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldrb r1, [r0, 0x1D] + lsrs r5, r1, 3 + ldrb r1, [r0, 0x1E] + lsrs r1, 3 + str r1, [sp, 0x8] + ldr r1, [r0, 0x4] + str r1, [sp] + ldr r2, [r0, 0x10] + str r2, [sp, 0x4] + ldrh r0, [r0, 0x16] + cmp r0, 0x2 + bne _08126108 + movs r1, 0 + ldr r0, [sp, 0x8] + cmp r1, r0 + bcc _08126086 + b _08126194 +_08126086: + movs r0, 0 + adds r2, r1, 0x1 + mov r10, r2 + cmp r0, r5 + bcs _081260FA + adds r2, r1, 0 + muls r2, r5 + mov r9, r2 + lsls r1, 3 + mov r8, r1 +_0812609A: + movs r4, 0 + lsls r6, r0, 4 + adds r7, r0, 0x1 + add r0, r9 + lsls r0, 6 + ldr r1, [sp, 0x4] + adds r1, r0 + mov r12, r1 +_081260AA: + lsls r0, r4, 3 + mov r2, r12 + adds r3, r2, r0 + mov r1, r8 + adds r0, r1, r4 + lsls r0, 3 + muls r0, r5 + lsls r0, 1 + ldr r2, [sp] + adds r0, r2, r0 + adds r2, r0, r6 + ldrh r0, [r2, 0x2] + lsls r0, 8 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r3] + ldrh r0, [r2, 0x6] + lsls r0, 8 + ldrh r1, [r2, 0x4] + orrs r0, r1 + strh r0, [r3, 0x2] + ldrh r0, [r2, 0xA] + lsls r0, 8 + ldrh r1, [r2, 0x8] + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r2, 0xE] + lsls r0, 8 + ldrh r1, [r2, 0xC] + orrs r0, r1 + strh r0, [r3, 0x6] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _081260AA + lsls r0, r7, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _0812609A +_081260FA: + mov r1, r10 + lsls r0, r1, 16 + lsrs r1, r0, 16 + ldr r2, [sp, 0x8] + cmp r1, r2 + bcc _08126086 + b _08126194 +_08126108: + movs r1, 0 + ldr r0, [sp, 0x8] + cmp r1, r0 + bcs _08126194 +_08126110: + movs r0, 0 + adds r2, r1, 0x1 + mov r10, r2 + cmp r0, r5 + bcs _08126188 + adds r2, r1, 0 + muls r2, r5 + mov r9, r2 + lsls r1, 3 + mov r8, r1 +_08126124: + movs r4, 0 + lsls r6, r0, 4 + adds r7, r0, 0x1 + add r0, r9 + lsls r0, 5 + ldr r1, [sp, 0x4] + adds r1, r0 + mov r12, r1 +_08126134: + lsls r0, r4, 2 + mov r2, r12 + adds r3, r2, r0 + mov r1, r8 + adds r0, r1, r4 + lsls r0, 3 + muls r0, r5 + lsls r0, 1 + ldr r2, [sp] + adds r0, r2, r0 + adds r2, r0, r6 + ldrh r1, [r2, 0x2] + lsls r1, 4 + ldrh r0, [r2] + orrs r1, r0 + ldrh r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2, 0x6] + lsls r0, 12 + orrs r1, r0 + strh r1, [r3] + ldrh r1, [r2, 0xA] + lsls r1, 4 + ldrh r0, [r2, 0x8] + orrs r1, r0 + ldrh r0, [r2, 0xC] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2, 0xE] + lsls r0, 12 + orrs r1, r0 + strh r1, [r3, 0x2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _08126134 + lsls r0, r7, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _08126124 +_08126188: + mov r1, r10 + lsls r0, r1, 16 + lsrs r1, r0, 16 + ldr r2, [sp, 0x8] + cmp r1, r2 + bcc _08126110 +_08126194: + 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_8126058 + + thumb_func_start sub_81261A4 +sub_81261A4: @ 81261A4 + push {lr} + ldr r2, _081261F4 + ldrb r1, [r0, 0x18] + lsls r1, 4 + strh r1, [r2] + ldr r3, _081261F8 + ldrh r2, [r2] + lsls r2, 1 + ldr r1, [r0, 0x8] + adds r1, r2 + str r1, [r3] + ldr r2, _081261FC + ldr r1, [r0, 0x4] + str r1, [r2] + ldr r2, _08126200 + ldrb r1, [r0, 0x19] + strb r1, [r2] + ldr r2, _08126204 + ldrb r1, [r0, 0x1A] + strb r1, [r2] + ldr r2, _08126208 + ldrb r1, [r0, 0x1B] + strb r1, [r2] + ldr r2, _0812620C + ldrb r1, [r0, 0x1C] + strb r1, [r2] + ldr r2, _08126210 + ldrb r1, [r0, 0x1D] + strb r1, [r2] + ldr r2, _08126214 + ldrb r1, [r0, 0x1E] + strb r1, [r2] + ldrh r0, [r0, 0x14] + cmp r0, 0x5 + bhi _0812626A + lsls r0, 2 + ldr r1, _08126218 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081261F4: .4byte 0x03006188 +_081261F8: .4byte 0x03006184 +_081261FC: .4byte 0x03006168 +_08126200: .4byte 0x03006164 +_08126204: .4byte 0x03006178 +_08126208: .4byte 0x03006174 +_0812620C: .4byte 0x0300616c +_08126210: .4byte 0x03006180 +_08126214: .4byte 0x03006170 +_08126218: .4byte _0812621C + .align 2, 0 +_0812621C: + .4byte _08126234 + .4byte _0812623C + .4byte _08126244 + .4byte _0812624E + .4byte _08126258 + .4byte _08126262 +_08126234: + movs r0, 0 + bl sub_81263A4 + b _0812626A +_0812623C: + movs r0, 0x1 + bl sub_81263A4 + b _0812626A +_08126244: + bl sub_8126270 + bl sub_8126714 + b _0812626A +_0812624E: + bl sub_8126370 + bl sub_8126664 + b _0812626A +_08126258: + bl sub_8126334 + bl sub_81265B4 + b _0812626A +_08126262: + bl sub_8126318 + bl sub_81264FC +_0812626A: + pop {r0} + bx r0 + thumb_func_end sub_81261A4 + + thumb_func_start sub_8126270 +sub_8126270: @ 8126270 + ldr r2, _081262D8 + ldr r1, [r2] + movs r0, 0 + strh r0, [r1] + ldr r0, [r2] + ldr r2, _081262DC + adds r1, r2, 0 + strh r1, [r0, 0x2] + ldr r2, _081262E0 + adds r1, r2, 0 + strh r1, [r0, 0x4] + ldr r2, _081262E4 + adds r1, r2, 0 + strh r1, [r0, 0x6] + ldr r2, _081262E8 + adds r1, r2, 0 + strh r1, [r0, 0x8] + ldr r2, _081262EC + adds r1, r2, 0 + strh r1, [r0, 0xA] + ldr r2, _081262F0 + adds r1, r2, 0 + strh r1, [r0, 0xC] + ldr r2, _081262F4 + adds r1, r2, 0 + strh r1, [r0, 0xE] + ldr r2, _081262F8 + adds r1, r2, 0 + strh r1, [r0, 0x10] + ldr r2, _081262FC + adds r1, r2, 0 + strh r1, [r0, 0x12] + ldr r2, _08126300 + adds r1, r2, 0 + strh r1, [r0, 0x14] + ldr r2, _08126304 + adds r1, r2, 0 + strh r1, [r0, 0x16] + ldr r2, _08126308 + adds r1, r2, 0 + strh r1, [r0, 0x18] + ldr r2, _0812630C + adds r1, r2, 0 + strh r1, [r0, 0x1A] + ldr r2, _08126310 + adds r1, r2, 0 + strh r1, [r0, 0x1C] + ldr r2, _08126314 + adds r1, r2, 0 + strh r1, [r0, 0x1E] + bx lr + .align 2, 0 +_081262D8: .4byte 0x03006184 +_081262DC: .4byte 0x000018c6 +_081262E0: .4byte 0x000077bd +_081262E4: .4byte 0x00002d6b +_081262E8: .4byte 0x000018dd +_081262EC: .4byte 0x00001ba6 +_081262F0: .4byte 0x000074c6 +_081262F4: .4byte 0x00001bbd +_081262F8: .4byte 0x000074dd +_081262FC: .4byte 0x000077a6 +_08126300: .4byte 0x0000197d +_08126304: .4byte 0x00001bab +_08126308: .4byte 0x00007566 +_0812630C: .4byte 0x00002cdd +_08126310: .4byte 0x00002fa6 +_08126314: .4byte 0x000074cb + thumb_func_end sub_8126270 + + thumb_func_start sub_8126318 +sub_8126318: @ 8126318 + ldr r2, _0812632C + ldr r0, [r2] + movs r1, 0 + strh r1, [r0] + ldr r2, [r2] + strh r1, [r2, 0x2] + ldr r1, _08126330 + adds r0, r1, 0 + strh r0, [r2, 0x4] + bx lr + .align 2, 0 +_0812632C: .4byte 0x03006184 +_08126330: .4byte 0x00007fff + thumb_func_end sub_8126318 + + thumb_func_start sub_8126334 +sub_8126334: @ 8126334 + push {r4,r5,lr} + ldr r1, _0812636C + ldr r0, [r1] + movs r2, 0 + strh r2, [r0] + ldr r0, [r1] + strh r2, [r0, 0x2] + movs r4, 0 + adds r5, r1, 0 +_08126346: + ldr r0, [r5] + lsls r2, r4, 1 + adds r2, r0 + adds r0, r4, 0x2 + lsls r3, r0, 1 + lsls r1, r0, 11 + lsls r0, 6 + orrs r1, r0 + orrs r1, r3 + strh r1, [r2, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xD + bls _08126346 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812636C: .4byte 0x03006184 + thumb_func_end sub_8126334 + + thumb_func_start sub_8126370 +sub_8126370: @ 8126370 + push {r4,lr} + ldr r2, _081263A0 + ldr r1, [r2] + movs r0, 0 + strh r0, [r1] + movs r3, 0 + adds r4, r2, 0 +_0812637E: + ldr r0, [r4] + lsls r2, r3, 1 + adds r2, r0 + lsls r0, r3, 10 + lsls r1, r3, 5 + orrs r0, r1 + orrs r0, r3 + strh r0, [r2, 0x2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1F + bls _0812637E + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081263A0: .4byte 0x03006184 + thumb_func_end sub_8126370 + + thumb_func_start sub_81263A4 +sub_81263A4: @ 81263A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + movs r1, 0xDF + mov r9, r1 + cmp r0, 0 + bne _081263BC + movs r2, 0xFF + mov r9, r2 +_081263BC: + movs r6, 0 + ldr r3, _08126440 + mov r12, r3 + mov r0, r9 + lsls r4, r0, 1 + ldr r5, _08126444 + cmp r6, r9 + bcs _081263E0 + movs r2, 0 +_081263CE: + ldr r0, [r3] + lsls r1, r6, 1 + adds r1, r0 + strh r2, [r1] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r9 + bcc _081263CE +_081263E0: + mov r1, r12 + ldr r0, [r1] + adds r0, r4, r0 + ldr r2, _08126448 + adds r1, r2, 0 + strh r1, [r0] + movs r3, 0 + ldrb r5, [r5] + cmp r3, r5 + bcs _081264E4 +_081263F4: + ldr r2, _0812644C + ldr r0, _08126450 + ldrb r1, [r0] + adds r1, r3 + ldr r0, _08126454 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + ldr r1, [r2] + adds r1, r0 + ldr r0, _08126458 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r6, 0 + ldr r0, _0812645C + adds r2, r0, 0 + adds r3, 0x1 + mov r10, r3 + ldrb r3, [r2] + cmp r6, r3 + bcs _081264D6 + ldr r0, _08126460 + mov r8, r0 +_08126424: + ldrh r0, [r4] + movs r3, 0x80 + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08126464 + mov r1, r8 + ldrh r0, [r1] + strh r0, [r4] + adds r6, 0x1 + adds r7, r4, 0x2 + b _081264CA + .align 2, 0 +_08126440: .4byte 0x03006184 +_08126444: .4byte 0x0300616c +_08126448: .4byte 0x00003def +_0812644C: .4byte 0x03006168 +_08126450: .4byte 0x03006178 +_08126454: .4byte 0x03006180 +_08126458: .4byte 0x03006164 +_0812645C: .4byte 0x03006174 +_08126460: .4byte 0x03006188 +_08126464: + adds r0, r4, 0 + bl sub_81267C4 + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0x1 + adds r6, 0x1 + adds r7, r4, 0x2 + cmp r3, r9 + bcs _081264C0 + ldr r0, _08126490 + ldr r2, [r0] + ldrh r1, [r2, 0x2] + mov r12, r0 + cmp r1, 0 + bne _08126494 + strh r5, [r2, 0x2] + mov r2, r8 + ldrh r0, [r2] + adds r0, 0x1 + b _081264BE + .align 2, 0 +_08126490: .4byte 0x03006184 +_08126494: + mov r2, r12 + ldr r1, [r2] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + beq _081264B8 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r9 + bcs _081264C0 + lsls r0, r3, 1 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + bne _08126494 + strh r5, [r1] +_081264B8: + mov r1, r8 + ldrh r0, [r1] + adds r0, r3 +_081264BE: + strh r0, [r4] +_081264C0: + ldr r2, _081264F4 + cmp r3, r9 + bne _081264CA + mov r3, r9 + strh r3, [r4] +_081264CA: + lsls r0, r6, 24 + lsrs r6, r0, 24 + adds r4, r7, 0 + ldrb r0, [r2] + cmp r6, r0 + bcc _08126424 +_081264D6: + mov r1, r10 + lsls r0, r1, 24 + lsrs r3, r0, 24 + ldr r0, _081264F8 + ldrb r0, [r0] + cmp r3, r0 + bcc _081263F4 +_081264E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081264F4: .4byte 0x03006174 +_081264F8: .4byte 0x0300616c + thumb_func_end sub_81263A4 + + thumb_func_start sub_81264FC +sub_81264FC: @ 81264FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r2, 0 + ldr r0, _08126550 + ldrb r0, [r0] + cmp r2, r0 + bcs _081265A0 + ldr r0, _08126554 + mov r8, r0 +_08126510: + ldr r0, _08126558 + ldrb r1, [r0] + adds r1, r2 + ldr r0, _0812655C + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, _08126560 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r6, 0 + ldr r0, _08126564 + adds r3, r0, 0 + adds r7, r2, 0x1 + ldrb r0, [r3] + cmp r6, r0 + bcs _08126594 + ldr r5, _08126568 +_0812653C: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0812656C + ldrh r0, [r5] + strh r0, [r4] + b _08126586 + .align 2, 0 +_08126550: .4byte 0x0300616c +_08126554: .4byte 0x03006168 +_08126558: .4byte 0x03006178 +_0812655C: .4byte 0x03006180 +_08126560: .4byte 0x03006164 +_08126564: .4byte 0x03006174 +_08126568: .4byte 0x03006188 +_0812656C: + adds r0, r4, 0 + bl sub_8125C68 + lsls r0, 16 + cmp r0, 0 + bne _0812657E + ldrh r0, [r5] + adds r0, 0x1 + b _08126582 +_0812657E: + ldrh r0, [r5] + adds r0, 0x2 +_08126582: + strh r0, [r4] + ldr r3, _081265AC +_08126586: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r6, r0 + bcc _0812653C +_08126594: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, _081265B0 + ldrb r0, [r0] + cmp r2, r0 + bcc _08126510 +_081265A0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081265AC: .4byte 0x03006174 +_081265B0: .4byte 0x0300616c + thumb_func_end sub_81264FC + + thumb_func_start sub_81265B4 +sub_81265B4: @ 81265B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _08126608 + ldrb r0, [r0] + cmp r2, r0 + bcs _08126650 + ldr r0, _0812660C + mov r8, r0 +_081265CA: + ldr r0, _08126610 + ldrb r1, [r0] + adds r1, r2 + ldr r0, _08126614 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, _08126618 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + ldr r0, _0812661C + adds r7, r2, 0x1 + ldrb r0, [r0] + cmp r5, r0 + bcs _08126644 + ldr r6, _08126620 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_081265FA: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + beq _08126624 + ldrh r0, [r6] + strh r0, [r4] + b _08126634 + .align 2, 0 +_08126608: .4byte 0x0300616c +_0812660C: .4byte 0x03006168 +_08126610: .4byte 0x03006178 +_08126614: .4byte 0x03006180 +_08126618: .4byte 0x03006164 +_0812661C: .4byte 0x03006174 +_08126620: .4byte 0x03006188 +_08126624: + adds r0, r4, 0 + str r2, [sp] + bl sub_8126908 + ldrh r1, [r6] + adds r0, r1 + strh r0, [r4] + ldr r2, [sp] +_08126634: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, _0812665C + ldrb r0, [r0] + cmp r5, r0 + bcc _081265FA +_08126644: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, _08126660 + ldrb r0, [r0] + cmp r2, r0 + bcc _081265CA +_08126650: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812665C: .4byte 0x03006174 +_08126660: .4byte 0x0300616c + thumb_func_end sub_81265B4 + + thumb_func_start sub_8126664 +sub_8126664: @ 8126664 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _081266B8 + ldrb r0, [r0] + cmp r2, r0 + bcs _08126700 + ldr r0, _081266BC + mov r8, r0 +_0812667A: + ldr r0, _081266C0 + ldrb r1, [r0] + adds r1, r2 + ldr r0, _081266C4 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, _081266C8 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + ldr r0, _081266CC + adds r7, r2, 0x1 + ldrb r0, [r0] + cmp r5, r0 + bcs _081266F4 + ldr r6, _081266D0 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_081266AA: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + beq _081266D4 + ldrh r0, [r6] + strh r0, [r4] + b _081266E4 + .align 2, 0 +_081266B8: .4byte 0x0300616c +_081266BC: .4byte 0x03006168 +_081266C0: .4byte 0x03006178 +_081266C4: .4byte 0x03006180 +_081266C8: .4byte 0x03006164 +_081266CC: .4byte 0x03006174 +_081266D0: .4byte 0x03006188 +_081266D4: + adds r0, r4, 0 + str r2, [sp] + bl sub_812693C + ldrh r1, [r6] + adds r0, r1 + strh r0, [r4] + ldr r2, [sp] +_081266E4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, _0812670C + ldrb r0, [r0] + cmp r5, r0 + bcc _081266AA +_081266F4: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, _08126710 + ldrb r0, [r0] + cmp r2, r0 + bcc _0812667A +_08126700: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812670C: .4byte 0x03006174 +_08126710: .4byte 0x0300616c + thumb_func_end sub_8126664 + + thumb_func_start sub_8126714 +sub_8126714: @ 8126714 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, _08126768 + ldrb r0, [r0] + cmp r2, r0 + bcs _081267B0 + ldr r0, _0812676C + mov r8, r0 +_0812672A: + ldr r0, _08126770 + ldrb r1, [r0] + adds r1, r2 + ldr r0, _08126774 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, _08126778 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + ldr r0, _0812677C + adds r7, r2, 0x1 + ldrb r0, [r0] + cmp r5, r0 + bcs _081267A4 + ldr r6, _08126780 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_0812675A: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + beq _08126784 + ldrh r0, [r6] + strh r0, [r4] + b _08126794 + .align 2, 0 +_08126768: .4byte 0x0300616c +_0812676C: .4byte 0x03006168 +_08126770: .4byte 0x03006178 +_08126774: .4byte 0x03006180 +_08126778: .4byte 0x03006164 +_0812677C: .4byte 0x03006174 +_08126780: .4byte 0x03006188 +_08126784: + adds r0, r4, 0 + str r2, [sp] + bl sub_8126838 + ldrh r1, [r6] + adds r0, r1 + strh r0, [r4] + ldr r2, [sp] +_08126794: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, _081267BC + ldrb r0, [r0] + cmp r5, r0 + bcc _0812675A +_081267A4: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, _081267C0 + ldrb r0, [r0] + cmp r2, r0 + bcc _0812672A +_081267B0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081267BC: .4byte 0x03006174 +_081267C0: .4byte 0x0300616c + thumb_func_end sub_8126714 + + thumb_func_start sub_81267C4 +sub_81267C4: @ 81267C4 + push {r4,lr} + ldrh r0, [r0] + movs r1, 0x1F + movs r4, 0x1F + ands r4, r0 + lsls r0, 16 + lsrs r3, r0, 21 + ands r3, r1 + lsrs r2, r0, 26 + ands r2, r1 + movs r1, 0x3 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _081267E8 + movs r0, 0x1C + ands r0, r4 + adds r4, r0, 0x4 +_081267E8: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _081267F6 + movs r0, 0x1C + ands r0, r3 + adds r3, r0, 0x4 +_081267F6: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08126804 + movs r0, 0x1C + ands r0, r2 + adds r2, r0, 0x4 +_08126804: + cmp r4, 0x5 + bhi _0812680A + movs r4, 0x6 +_0812680A: + cmp r4, 0x1E + bls _08126810 + movs r4, 0x1E +_08126810: + cmp r3, 0x5 + bhi _08126816 + movs r3, 0x6 +_08126816: + cmp r3, 0x1E + bls _0812681C + movs r3, 0x1E +_0812681C: + cmp r2, 0x5 + bhi _08126822 + movs r2, 0x6 +_08126822: + cmp r2, 0x1E + bls _08126828 + movs r2, 0x1E +_08126828: + lsls r0, r2, 10 + lsls r1, r3, 5 + orrs r0, r1 + orrs r4, r0 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81267C4 + + thumb_func_start sub_8126838 +sub_8126838: @ 8126838 + push {lr} + ldrh r0, [r0] + movs r1, 0x1F + movs r3, 0x1F + ands r3, r0 + lsls r0, 16 + lsrs r2, r0, 21 + ands r2, r1 + lsrs r0, 26 + ands r0, r1 + cmp r3, 0xB + bhi _0812685C + cmp r2, 0xA + bhi _0812685C + cmp r0, 0xA + bhi _0812685C + movs r0, 0x1 + b _08126902 +_0812685C: + cmp r3, 0x13 + bls _08126880 + cmp r2, 0x13 + bls _08126868 + cmp r0, 0x13 + bhi _0812688C +_08126868: + cmp r3, 0x13 + bls _08126880 + cmp r2, 0x13 + bls _08126876 + cmp r0, 0xE + bhi _0812688C + b _081268C4 +_08126876: + cmp r0, 0x13 + bls _08126880 + cmp r2, 0xE + bhi _0812688C + b _081268A0 +_08126880: + cmp r2, 0x13 + bls _08126890 + cmp r0, 0x13 + bls _08126890 + cmp r3, 0xE + bls _081268E8 +_0812688C: + movs r0, 0x2 + b _08126902 +_08126890: + cmp r3, 0x13 + bls _081268B4 + cmp r2, 0xB + bls _081268A8 + cmp r0, 0xB + bls _081268A4 + cmp r2, r0 + bcs _081268C4 +_081268A0: + movs r0, 0x8 + b _08126902 +_081268A4: + movs r0, 0xA + b _08126902 +_081268A8: + cmp r0, 0xB + bls _081268B0 + movs r0, 0xD + b _08126902 +_081268B0: + movs r0, 0x4 + b _08126902 +_081268B4: + cmp r2, 0x13 + bls _081268D8 + cmp r3, 0xB + bls _081268CC + cmp r0, 0xB + bls _081268C8 + cmp r3, r0 + bcc _081268E8 +_081268C4: + movs r0, 0x7 + b _08126902 +_081268C8: + movs r0, 0xB + b _08126902 +_081268CC: + cmp r0, 0xB + bls _081268D4 + movs r0, 0xE + b _08126902 +_081268D4: + movs r0, 0x5 + b _08126902 +_081268D8: + cmp r0, 0x13 + bls _08126900 + cmp r3, 0xB + bls _081268EC + cmp r2, 0xB + bls _081268F4 + cmp r3, r2 + bcs _081268A0 +_081268E8: + movs r0, 0x9 + b _08126902 +_081268EC: + cmp r2, 0xB + bls _081268F4 + movs r0, 0xC + b _08126902 +_081268F4: + cmp r0, 0xB + bls _081268FC + movs r0, 0xF + b _08126902 +_081268FC: + movs r0, 0x6 + b _08126902 +_08126900: + movs r0, 0x3 +_08126902: + pop {r1} + bx r1 + thumb_func_end sub_8126838 + + thumb_func_start sub_8126908 +sub_8126908: @ 8126908 + push {lr} + ldrh r1, [r0] + movs r3, 0x1F + movs r0, 0x1F + ands r0, r1 + lsls r1, 16 + lsrs r2, r1, 21 + ands r2, r3 + lsrs r1, 26 + ands r1, r3 + adds r0, r2 + adds r0, r1 + movs r1, 0x3 + bl __divsi3 + movs r1, 0x1E + ands r0, r1 + lsls r0, 16 + cmp r0, 0 + beq _08126934 + lsrs r0, 17 + b _08126936 +_08126934: + movs r0, 0x1 +_08126936: + pop {r1} + bx r1 + thumb_func_end sub_8126908 + + thumb_func_start sub_812693C +sub_812693C: @ 812693C + push {lr} + ldrh r1, [r0] + movs r3, 0x1F + movs r0, 0x1F + ands r0, r1 + lsls r1, 16 + lsrs r2, r1, 21 + ands r2, r3 + lsrs r1, 26 + ands r1, r3 + adds r0, r2 + adds r0, r1 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_812693C + + thumb_func_start sub_8126968 +sub_8126968: @ 8126968 + push {lr} + ldr r3, _081269B0 + ldrb r0, [r3] + cmp r0, 0x7 + bhi _0812697E + ldr r2, _081269B4 + ldr r1, _081269B8 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] +_0812697E: + ldr r2, _081269BC + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _08126996 + ldr r0, _081269C0 + ldr r0, [r0] + ldr r3, _081269C4 + adds r1, r0, r3 + str r1, [r2] + ldr r1, _081269C8 + adds r0, r1 + str r0, [r2, 0x4] +_08126996: + ldrb r0, [r2, 0x9] + cmp r0, 0x1 + bne _081269AC + ldr r0, _081269C0 + ldr r0, [r0] + ldr r3, _081269CC + adds r1, r0, r3 + str r1, [r2] + ldr r1, _081269D0 + adds r0, r1 + str r0, [r2, 0x4] +_081269AC: + pop {r0} + bx r0 + .align 2, 0 +_081269B0: .4byte 0x0203a173 +_081269B4: .4byte 0x0203a14c +_081269B8: .4byte 0x0203bc40 +_081269BC: .4byte 0x0203a17c +_081269C0: .4byte 0x03005d8c +_081269C4: .4byte 0x00001aae +_081269C8: .4byte 0x00001abe +_081269CC: .4byte 0x0000271c +_081269D0: .4byte 0x00002728 + thumb_func_end sub_8126968 + + thumb_func_start sub_81269D4 +sub_81269D4: @ 81269D4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _08126A18 + adds r4, r1, r0 + cmp r1, 0 + bne _08126A28 + ldr r0, _08126A1C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, _08126A20 + movs r1, 0x4 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _08126A24 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + lsrs r0, r1, 24 + cmp r0, 0x12 + bls _08126A14 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x90 + lsls r1, 21 + orrs r0, r1 + str r0, [sp] +_08126A14: + mov r0, sp + b _08126A2E + .align 2, 0 +_08126A18: .4byte 0x0203a188 +_08126A1C: .4byte 0x085a6b90 +_08126A20: .4byte 0x085a6b48 +_08126A24: .4byte 0x00ffffff +_08126A28: + lsls r0, r1, 3 + ldr r1, _08126A54 + adds r0, r1 +_08126A2E: + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08126A54: .4byte 0x085a6b90 + thumb_func_end sub_81269D4 + + thumb_func_start sub_8126A58 +sub_8126A58: @ 8126A58 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08126A84 + adds r4, r0 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08126A84: .4byte 0x0203a188 + thumb_func_end sub_8126A58 + + thumb_func_start sub_8126A88 +sub_8126A88: @ 8126A88 + push {r4,lr} + movs r0, 0 + bl sub_81269D4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r2, _08126AB4 + adds r0, r4, 0 + movs r1, 0x4 + bl PrintMenuTable + ldr r0, _08126AB8 + ldrb r2, [r0] + adds r0, r4, 0 + movs r1, 0x4 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08126AB4: .4byte 0x085a6b48 +_08126AB8: .4byte 0x0203a150 + thumb_func_end sub_8126A88 + + thumb_func_start sub_8126ABC +sub_8126ABC: @ 8126ABC + push {lr} + ldr r1, _08126AD4 + movs r0, 0 + strb r0, [r1] + bl script_env_2_enable + bl sub_8126A88 + bl sub_8126C08 + pop {r0} + bx r0 + .align 2, 0 +_08126AD4: .4byte 0x0203a150 + thumb_func_end sub_8126ABC + + thumb_func_start sub_8126AD8 +sub_8126AD8: @ 8126AD8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8126ABC + ldr r2, _08126B14 + ldr r0, _08126B18 + ldr r0, [r0] + ldr r3, _08126B1C + adds r1, r0, r3 + str r1, [r2] + ldr r1, _08126B20 + adds r0, r1 + str r0, [r2, 0x4] + movs r1, 0 + movs r0, 0x10 + strb r0, [r2, 0x8] + strb r1, [r2, 0x9] + ldr r1, _08126B24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08126B28 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08126B14: .4byte 0x0203a17c +_08126B18: .4byte 0x03005d8c +_08126B1C: .4byte 0x00001aae +_08126B20: .4byte 0x00001abe +_08126B24: .4byte 0x03005e00 +_08126B28: .4byte sub_8126B80 + 1 + thumb_func_end sub_8126AD8 + + thumb_func_start sub_8126B2C +sub_8126B2C: @ 8126B2C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8126ABC + ldr r2, _08126B68 + ldr r0, _08126B6C + ldr r0, [r0] + ldr r3, _08126B70 + adds r1, r0, r3 + str r1, [r2] + ldr r1, _08126B74 + adds r0, r1 + str r0, [r2, 0x4] + movs r0, 0xC + strb r0, [r2, 0x8] + movs r0, 0x1 + strb r0, [r2, 0x9] + ldr r1, _08126B78 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08126B7C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08126B68: .4byte 0x0203a17c +_08126B6C: .4byte 0x03005d8c +_08126B70: .4byte 0x0000271c +_08126B74: .4byte 0x00002728 +_08126B78: .4byte 0x03005e00 +_08126B7C: .4byte sub_8126B80 + 1 + thumb_func_end sub_8126B2C + + thumb_func_start sub_8126B80 +sub_8126B80: @ 8126B80 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08126BCC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08126C00 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + bl ProcessMenuInput + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _08126BD8 + adds r0, 0x1 + cmp r1, r0 + beq _08126BF4 + movs r0, 0x5 + bl audio_play + ldr r1, _08126BD0 + ldr r0, _08126BD4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + b _08126C00 + .align 2, 0 +_08126BCC: .4byte 0x02037fd4 +_08126BD0: .4byte 0x085a6b48 +_08126BD4: .4byte 0x0203a150 +_08126BD8: + bl GetMenuCursorPos + ldr r1, _08126BF0 + strb r0, [r1] + lsls r0, r4, 24 + asrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _08126C00 + bl sub_8126C08 + b _08126C00 + .align 2, 0 +_08126BF0: .4byte 0x0203a150 +_08126BF4: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_8126D6C +_08126C00: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8126B80 + + thumb_func_start sub_8126C08 +sub_8126C08: @ 8126C08 + push {lr} + sub sp, 0x10 + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r1, _08126C40 + ldr r0, _08126C44 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + 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 text_box_related_one + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08126C40: .4byte 0x085a6b68 +_08126C44: .4byte 0x0203a150 + thumb_func_end sub_8126C08 + + thumb_func_start sub_8126C48 +sub_8126C48: @ 8126C48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8161B10 + lsls r0, 24 + cmp r0, 0 + bne _08126C7C + ldr r4, _08126C70 + ldr r1, _08126C74 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08126C78 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _08126C96 + .align 2, 0 +_08126C70: .4byte 0x02021fc4 +_08126C74: .4byte 0x085ea83d +_08126C78: .4byte sub_8126DA4 + 1 +_08126C7C: + ldr r1, _08126C9C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x1E] + ldr r0, _08126CA0 + strb r2, [r0] + adds r0, r5, 0 + bl sub_8126DCC +_08126C96: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08126C9C: .4byte 0x03005e00 +_08126CA0: .4byte 0x0203a173 + thumb_func_end sub_8126C48 + + thumb_func_start sub_8126CA4 +sub_8126CA4: @ 8126CA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_81299AC + lsls r0, 24 + cmp r0, 0 + bne _08126CD8 + ldr r4, _08126CCC + ldr r1, _08126CD0 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08126CD4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _08126D00 + .align 2, 0 +_08126CCC: .4byte 0x02021fc4 +_08126CD0: .4byte 0x085eaaec +_08126CD4: .4byte sub_8126DA4 + 1 +_08126CD8: + movs r0, 0 + bl sub_8126A58 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _08126D08 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, _08126D0C + str r1, [r0] +_08126D00: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08126D08: .4byte 0x03005e00 +_08126D0C: .4byte sub_8129ABC + 1 + thumb_func_end sub_8126CA4 + + thumb_func_start sub_8126D10 +sub_8126D10: @ 8126D10 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8161B10 + lsls r0, 24 + cmp r0, 0 + bne _08126D44 + ldr r4, _08126D38 + ldr r1, _08126D3C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08126D40 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _08126D5E + .align 2, 0 +_08126D38: .4byte 0x02021fc4 +_08126D3C: .4byte 0x085ea83d +_08126D40: .4byte sub_8126DA4 + 1 +_08126D44: + ldr r1, _08126D64 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x1E] + ldr r0, _08126D68 + strb r2, [r0] + adds r0, r5, 0 + bl sub_8126DCC +_08126D5E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08126D64: .4byte 0x03005e00 +_08126D68: .4byte 0x0203a173 + thumb_func_end sub_8126D10 + + thumb_func_start sub_8126D6C +sub_8126D6C: @ 8126D6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl sub_8126A58 + ldr r0, _08126D90 + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _08126D98 + ldr r0, _08126D94 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl remove_task + b _08126D9E + .align 2, 0 +_08126D90: .4byte 0x0203a17c +_08126D94: .4byte 0x0823b4e8 +_08126D98: + adds r0, r4, 0 + bl sub_816B060 +_08126D9E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8126D6C + + thumb_func_start sub_8126DA4 +sub_8126DA4: @ 8126DA4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8126C08 + ldr r1, _08126DC4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08126DC8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08126DC4: .4byte 0x03005e00 +_08126DC8: .4byte sub_8126B80 + 1 + thumb_func_end sub_8126DA4 + + thumb_func_start sub_8126DCC +sub_8126DCC: @ 8126DCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08126DF8 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl sub_8197434 + movs r0, 0 + bl sub_8126A58 + adds r0, r4, 0 + bl sub_8126DFC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08126DF8: .4byte 0x085a6bb0 + thumb_func_end sub_8126DCC + + thumb_func_start sub_8126DFC +sub_8126DFC: @ 8126DFC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + bl sub_81269D4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_8126E8C + ldr r0, _08126E38 + ldrb r2, [r0] + adds r0, r4, 0 + movs r1, 0x9 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldr r1, _08126E3C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08126E40 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08126E38: .4byte 0x0203a173 +_08126E3C: .4byte 0x03005e00 +_08126E40: .4byte sub_8127088 + 1 + thumb_func_end sub_8126DFC + + thumb_func_start sub_8126E44 +sub_8126E44: @ 8126E44 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _08126E7C + ldrb r0, [r5, 0x1] + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r4, 0 + bl sub_8126E8C + ldrb r0, [r5, 0x1] + ldr r1, _08126E80 + ldrb r2, [r1] + movs r1, 0x9 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldr r1, _08126E84 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08126E88 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08126E7C: .4byte 0x0203a188 +_08126E80: .4byte 0x0203a173 +_08126E84: .4byte 0x03005e00 +_08126E88: .4byte sub_8127088 + 1 + thumb_func_end sub_8126E44 + + thumb_func_start sub_8126E8C +sub_8126E8C: @ 8126E8C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _08126EEC + adds r1, r0, r1 + ldr r0, _08126EF0 + ldrb r5, [r0, 0x1] + ldr r0, _08126EF4 + ldrb r0, [r0, 0x9] + movs r2, 0 + mov r8, r2 + cmp r0, 0x1 + bne _08126EC0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08126EC0 + movs r0, 0x1 + mov r8, r0 +_08126EC0: + movs r4, 0 + lsls r2, r6, 2 + mov r9, r2 + movs r7, 0xFF +_08126EC8: + mov r0, r8 + cmp r0, 0x1 + bne _08126EF8 + cmp r4, 0x6 + beq _08126EF8 + cmp r4, 0x7 + beq _08126EF8 + lsls r3, r4, 28 + lsrs r3, 24 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x8 + bl sub_8126F68 + b _08126F0C + .align 2, 0 +_08126EEC: .4byte 0x03005e08 +_08126EF0: .4byte 0x0203a188 +_08126EF4: .4byte 0x0203a17c +_08126EF8: + lsls r3, r4, 28 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x8 + bl sub_8126F68 +_08126F0C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08126EC8 + ldr r0, _08126F5C + mov r2, r9 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x1E + ldrsh r0, [r1, r2] + ldr r2, _08126F60 + cmp r0, 0x2 + bne _08126F2C + ldr r2, _08126F64 +_08126F2C: + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0x8 + 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-r7} + pop {r0} + bx r0 + .align 2, 0 +_08126F5C: .4byte 0x03005e00 +_08126F60: .4byte 0x085e8cf0 +_08126F64: .4byte 0x085eb7ea + thumb_func_end sub_8126E8C + + thumb_func_start sub_8126F68 +sub_8126F68: @ 8126F68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r4, [sp, 0x38] + ldr r6, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 24 + lsrs r1, r4, 24 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + movs r0, 0x60 + str r0, [sp, 0x14] + cmp r7, 0x8 + bne _08126FA2 + movs r2, 0x68 + str r2, [sp, 0x14] +_08126FA2: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _0812704C + adds r0, r4, 0 + bl sub_8127058 + adds r0, r4, 0 + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + adds r6, r0, r4 + ldr r1, _08127050 + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl gf_strcpy + str r5, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r2, 0 + mov r10, r2 + str r2, [sp, 0x8] + ldr r0, [sp, 0xC] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r7, 0 + bl Print + mov r0, r8 + bl sub_8161AD0 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + adds r6, r0, 0 + movs r0, 0xBA + strb r0, [r6] + adds r6, 0x1 + ldr r1, _08127054 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0x1 + adds r1, r4, 0 + ldr r2, [sp, 0x14] + bl sub_81DB368 + lsls r0, 24 + lsrs r7, r0, 24 + str r5, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + ldr r0, [sp, 0xC] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r7, 0 + bl Print + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812704C: .4byte 0x02021fc4 +_08127050: .4byte 0x085a6b28 +_08127054: .4byte 0x0203bc40 + thumb_func_end sub_8126F68 + + thumb_func_start sub_8127058 +sub_8127058: @ 8127058 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, _08127074 + bl gf_strcpy + cmp r4, 0x1 + bne _08127078 + movs r0, 0x4 + strb r0, [r5, 0x2] + movs r0, 0x5 + b _0812707E + .align 2, 0 +_08127074: .4byte 0x085ea7c8 +_08127078: + movs r0, 0x2 + strb r0, [r5, 0x2] + movs r0, 0x3 +_0812707E: + strb r0, [r5, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8127058 + + thumb_func_start sub_8127088 +sub_8127088: @ 8127088 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081270B8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081270DE + bl ProcessMenuInput + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081270C0 + cmp r1, r0 + bgt _081270BC + subs r0, 0x1 + cmp r1, r0 + beq _081270DE + b _081270CE + .align 2, 0 +_081270B8: .4byte 0x02037fd4 +_081270BC: + cmp r1, 0x8 + bne _081270CE +_081270C0: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_812719C + b _081270DE +_081270CE: + movs r0, 0x5 + bl audio_play + ldr r0, _081270E4 + strb r4, [r0] + adds r0, r5, 0 + bl sub_81270E8 +_081270DE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081270E4: .4byte 0x0203a173 + thumb_func_end sub_8127088 + + thumb_func_start sub_81270E8 +sub_81270E8: @ 81270E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08127134 + ldrb r0, [r4] + bl sub_8161AD0 + ldr r1, _08127138 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + beq _08127154 + ldrb r0, [r4] + bl sub_8161A38 + ldr r2, _0812713C + ldr r1, _08127140 + ldrb r0, [r4] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + adds r0, r5, 0 + bl sub_81279B4 + ldr r0, _08127144 + movs r1, 0 + strh r1, [r0] + ldr r0, _08127148 + strh r1, [r0] + ldr r1, _0812714C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08127150 + str r1, [r0] + b _0812716E + .align 2, 0 +_08127134: .4byte 0x0203a173 +_08127138: .4byte 0x0203a151 +_0812713C: .4byte 0x0203a14c +_08127140: .4byte 0x0203bc40 +_08127144: .4byte 0x0203a170 +_08127148: .4byte 0x0203a16e +_0812714C: .4byte 0x03005e00 +_08127150: .4byte sub_8127620 + 1 +_08127154: + movs r0, 0x1 + bl sub_8126A58 + ldr r4, _08127174 + ldr r1, _08127178 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _0812717C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_0812716E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08127174: .4byte 0x02021fc4 +_08127178: .4byte 0x085ea83d +_0812717C: .4byte sub_8127180 + 1 + thumb_func_end sub_81270E8 + + thumb_func_start sub_8127180 +sub_8127180: @ 8127180 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_8126DFC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127180 + + thumb_func_start sub_812719C +sub_812719C: @ 812719C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _081271BC + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1E + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _081271C0 + adds r0, r2, 0 + bl sub_81271CC + b _081271C6 + .align 2, 0 +_081271BC: .4byte 0x03005e00 +_081271C0: + adds r0, r2, 0 + bl sub_8127268 +_081271C6: + pop {r0} + bx r0 + thumb_func_end sub_812719C + + thumb_func_start sub_81271CC +sub_81271CC: @ 81271CC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_8126A58 + bl sub_8126A88 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + bl sub_8126C08 + ldr r1, _08127200 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08127204 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127200: .4byte 0x03005e00 +_08127204: .4byte sub_8126B80 + 1 + thumb_func_end sub_81271CC + + thumb_func_start sub_8127208 +sub_8127208: @ 8127208 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08127244 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldr r1, _08127248 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strh r1, [r0, 0x1E] + ldr r0, _0812724C + strb r2, [r0] + adds r0, r4, 0 + bl sub_8126DFC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127244: .4byte 0x085a6bb0 +_08127248: .4byte 0x03005e00 +_0812724C: .4byte 0x0203a173 + thumb_func_end sub_8127208 + + thumb_func_start sub_8127250 +sub_8127250: @ 8127250 + push {lr} + lsls r1, 24 + ldr r2, _08127264 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_08127264: .4byte 0x085a6b28 + thumb_func_end sub_8127250 + + thumb_func_start sub_8127268 +sub_8127268: @ 8127268 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_8126A58 + adds r0, r4, 0 + bl sub_8133E1C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127268 + + thumb_func_start sub_8127284 +sub_8127284: @ 8127284 + push {lr} + ldr r3, _081272AC + ldr r2, [r3] + ldr r0, _081272B0 + ldrb r0, [r0] + adds r0, 0x1 + movs r1, 0xA4 + lsls r1, 3 + adds r2, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, r1 + ldrb r1, [r1] + cmp r1, 0x8 + bls _081272B8 + ldr r2, _081272B4 + adds r1, r0, r2 + movs r0, 0x8 + strb r0, [r1] + b _081272BE + .align 2, 0 +_081272AC: .4byte 0x0203a18c +_081272B0: .4byte 0x0203a151 +_081272B4: .4byte 0x00000521 +_081272B8: + ldr r2, _081272C4 + adds r0, r2 + strb r1, [r0] +_081272BE: + pop {r0} + bx r0 + .align 2, 0 +_081272C4: .4byte 0x00000521 + thumb_func_end sub_8127284 + + thumb_func_start sub_81272C8 +sub_81272C8: @ 81272C8 + push {r4,lr} + ldr r0, _081272E8 + ldr r1, _081272EC + ldr r2, _081272F0 + ldr r3, [r2] + ldr r4, _081272F4 + adds r2, r3, r4 + ldrb r2, [r2] + subs r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + bl sub_812225C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081272E8: .4byte 0x0203a170 +_081272EC: .4byte 0x0203a16e +_081272F0: .4byte 0x0203a18c +_081272F4: .4byte 0x00000521 + thumb_func_end sub_81272C8 + + thumb_func_start sub_81272F8 +sub_81272F8: @ 81272F8 + push {r4,lr} + sub sp, 0x4 + ldr r0, _08127320 + ldr r1, _08127324 + ldr r2, _08127328 + ldr r3, [r2] + ldr r4, _0812732C + adds r2, r3, r4 + ldrb r2, [r2] + subs r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + movs r4, 0x8 + str r4, [sp] + bl sub_8122298 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127320: .4byte 0x0203a170 +_08127324: .4byte 0x0203a16e +_08127328: .4byte 0x0203a18c +_0812732C: .4byte 0x00000521 + thumb_func_end sub_81272F8 + + thumb_func_start sub_8127330 +sub_8127330: @ 8127330 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08127368 + adds r1, r0 + ldr r0, _0812736C + ldrb r0, [r0] + subs r0, 0x6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08127378 + ldr r0, _08127370 + ldrb r0, [r0, 0x9] + cmp r0, 0x1 + bne _08127378 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08127378 + ldr r0, _08127374 + movs r1, 0x1 + bl sub_8127058 + b _08127380 + .align 2, 0 +_08127368: .4byte 0x03005e08 +_0812736C: .4byte 0x0203a173 +_08127370: .4byte 0x0203a17c +_08127374: .4byte 0x02021cc4 +_08127378: + ldr r0, _08127434 + movs r1, 0 + bl sub_8127058 +_08127380: + movs r6, 0 + ldr r1, _08127438 + ldr r0, [r1] + movs r3, 0xA4 + lsls r3, 3 + adds r0, r3 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081273D6 + adds r5, r1, 0 +_08127396: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r0, 0xA4 + lsls r0, 1 + adds r4, r0 + ldr r0, [r5] + adds r0, r4 + ldr r1, _0812743C + ldr r1, [r1] + adds r1, r6 + ldrb r1, [r1] + bl sub_8127454 + ldr r1, [r5] + lsls r2, r6, 3 + adds r0, r1, r2 + adds r4, r1, r4 + str r4, [r0] + adds r0, r1, 0x4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + movs r2, 0xA4 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _08127396 +_081273D6: + ldr r5, _08127438 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r3, 0xA4 + lsls r3, 1 + adds r4, r3 + ldr r0, [r5] + adds r0, r4 + ldr r1, _08127440 + bl gf_strcpy + ldr r0, [r5] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + movs r1, 0x2 + negs r1, r1 + str r1, [r0] + ldr r2, _08127444 + adds r1, r2, 0 + ldr r0, _08127448 + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + ldr r0, _0812744C + ldrb r0, [r0, 0x1] + strb r0, [r2, 0x10] + ldr r0, [r5] + movs r4, 0xA4 + lsls r4, 3 + adds r1, r0, r4 + ldrb r1, [r1] + strh r1, [r2, 0xC] + str r0, [r2] + ldr r6, _08127450 + adds r0, r6 + ldrb r0, [r0] + strh r0, [r2, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08127434: .4byte 0x02021cc4 +_08127438: .4byte 0x0203a18c +_0812743C: .4byte 0x0203a14c +_08127440: .4byte 0x085e8cf0 +_08127444: .4byte 0x03006310 +_08127448: .4byte 0x085a6bd0 +_0812744C: .4byte 0x0203a188 +_08127450: .4byte 0x00000521 + thumb_func_end sub_8127330 + + thumb_func_start sub_8127454 +sub_8127454: @ 8127454 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 16 + lsrs r4, 16 + ldr r1, _08127478 + bl gf_strcpy + lsls r4, 5 + ldr r0, _0812747C + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl gf_strcat + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08127478: .4byte 0x02021cc4 +_0812747C: .4byte 0x085a5c09 + thumb_func_end sub_8127454 + + thumb_func_start sub_8127480 +sub_8127480: @ 8127480 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _08127492 + movs r0, 0x5 + bl audio_play +_08127492: + adds r0, r4, 0 + bl sub_8127744 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127480 + + thumb_func_start sub_81274A0 +sub_81274A0: @ 81274A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r6 + lsls r2, 24 + lsrs r5, r2, 24 + adds r7, r5, 0 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081274F6 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81277BC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081274DC + adds r3, r5, 0x2 + adds r0, r6, 0 + movs r1, 0x18 + movs r2, 0x5C + bl sub_819A2F8 + b _081274F6 +_081274DC: + adds r0, r4, 0 + bl sub_81277E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081274F6 + adds r3, r7, 0x2 + mov r0, r8 + movs r1, 0x19 + movs r2, 0x5C + bl sub_819A2F8 +_081274F6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81274A0 + + thumb_func_start sub_8127500 +sub_8127500: @ 8127500 + push {r4,lr} + sub sp, 0x10 + ldr r4, _08127548 + ldr r1, [r4] + ldr r2, _0812754C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08127540 + subs r2, 0x2 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + subs r0, r1 + str r0, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, _08127550 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0x3C + movs r2, 0xC + movs r3, 0x94 + bl sub_81AF4A0 + ldr r1, [r4] + ldr r2, _0812754C + adds r1, r2 + strb r0, [r1] +_08127540: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127548: .4byte 0x0203a18c +_0812754C: .4byte 0x00000522 +_08127550: .4byte 0x0203a170 + thumb_func_end sub_8127500 + + thumb_func_start sub_8127554 +sub_8127554: @ 8127554 + push {r4,lr} + ldr r4, _08127578 + ldr r0, [r4] + ldr r2, _0812757C + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08127572 + bl sub_81AF620 + ldr r0, [r4] + ldr r1, _0812757C + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08127572: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127578: .4byte 0x0203a18c +_0812757C: .4byte 0x00000522 + thumb_func_end sub_8127554 + + thumb_func_start sub_8127580 +sub_8127580: @ 8127580 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_81269D4 + adds r0, r4, 0 + bl sub_812759C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127580 + + thumb_func_start sub_812759C +sub_812759C: @ 812759C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + ldr r0, _08127600 + adds r5, r0 + movs r0, 0x3 + bl sub_81269D4 + ldr r0, _08127604 + ldrb r0, [r0] + bl sub_8127718 + ldr r6, _08127608 + ldr r0, _0812760C + bl malloc_and_clear + str r0, [r6] + ldr r1, _08127610 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + bl sub_8127284 + bl sub_81272C8 + bl sub_81272F8 + adds r0, r4, 0 + bl sub_8127330 + ldr r0, _08127614 + ldr r1, _08127618 + ldrh r1, [r1] + ldr r2, _0812761C + ldrh r2, [r2] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1A] + bl sub_8127500 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08127600: .4byte 0x03005e08 +_08127604: .4byte 0x0203a173 +_08127608: .4byte 0x0203a18c +_0812760C: .4byte 0x00000524 +_08127610: .4byte 0x00000522 +_08127614: .4byte 0x03006310 +_08127618: .4byte 0x0203a170 +_0812761C: .4byte 0x0203a16e + thumb_func_end sub_812759C + + thumb_func_start sub_8127620 +sub_8127620: @ 8127620 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_812759C + ldr r1, _08127644 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08127648 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127644: .4byte 0x03005e00 +_08127648: .4byte sub_812764C + 1 + thumb_func_end sub_8127620 + + thumb_func_start sub_812764C +sub_812764C: @ 812764C + 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, _08127694 + adds r5, r0, r1 + ldr r0, _08127698 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08127700 + ldrb r0, [r5, 0x1A] + bl sub_81AE604 + adds r4, r0, 0 + ldrb r0, [r5, 0x1A] + ldr r7, _0812769C + ldr r1, _081276A0 + mov r8, r1 + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081276A4 + adds r0, 0x1 + cmp r4, r0 + bne _081276C4 + b _08127700 + .align 2, 0 +_08127694: .4byte 0x03005e08 +_08127698: .4byte 0x02037fd4 +_0812769C: .4byte 0x0203a170 +_081276A0: .4byte 0x0203a16e +_081276A4: + movs r0, 0x5 + bl audio_play + ldr r0, _081276C0 + movs r2, 0x16 + ldrsh r1, [r5, r2] + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 + b _08127700 + .align 2, 0 +_081276C0: .4byte 0x085a6b78 +_081276C4: + movs r0, 0x5 + bl audio_play + ldr r0, _0812770C + strb r4, [r0] + bl sub_8127554 + ldrb r0, [r5, 0x1A] + adds r1, r7, 0 + mov r2, r8 + bl sub_81AE6C8 + movs r0, 0x1 + bl sub_8126A58 + bl sub_81277A8 + ldr r0, _08127710 + ldr r0, [r0] + bl free + ldr r1, _08127714 + movs r2, 0x16 + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_08127700: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812770C: .4byte 0x0203a172 +_08127710: .4byte 0x0203a18c +_08127714: .4byte 0x085a6b78 + thumb_func_end sub_812764C + + thumb_func_start sub_8127718 +sub_8127718: @ 8127718 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + bl sub_81269D4 + 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, 0 + bl sub_8126F68 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127718 + + thumb_func_start sub_8127744 +sub_8127744: @ 8127744 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r0, _08127764 + ldrb r5, [r0, 0x3] + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _08127768 + ldrb r0, [r0] + cmp r4, r0 + bcc _08127770 + ldr r2, _0812776C + b _08127782 + .align 2, 0 +_08127764: .4byte 0x0203a188 +_08127768: .4byte 0x0203a151 +_0812776C: .4byte 0x085e8d62 +_08127770: + ldr r1, _081277A0 + ldr r0, _081277A4 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 5 + adds r1, 0x18 + adds r0, r1 + ldr r2, [r0] +_08127782: + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081277A0: .4byte 0x085a5c08 +_081277A4: .4byte 0x0203a14c + thumb_func_end sub_8127744 + + thumb_func_start sub_81277A8 +sub_81277A8: @ 81277A8 + push {lr} + movs r0, 0x3 + bl sub_8126A58 + movs r0, 0x2 + bl sub_8126A58 + pop {r0} + bx r0 + thumb_func_end sub_81277A8 + + thumb_func_start sub_81277BC +sub_81277BC: @ 81277BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _081277D4 +_081277C6: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081277D8 + movs r0, 0x1 + b _081277E4 + .align 2, 0 +_081277D4: .4byte 0x0203a152 +_081277D8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _081277C6 + movs r0, 0 +_081277E4: + pop {r1} + bx r1 + thumb_func_end sub_81277BC + + thumb_func_start sub_81277E8 +sub_81277E8: @ 81277E8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _08127800 +_081277F2: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08127804 + movs r0, 0x1 + b _08127810 + .align 2, 0 +_08127800: .4byte 0x0203a162 +_08127804: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xB + bls _081277F2 + movs r0, 0 +_08127810: + pop {r1} + bx r1 + thumb_func_end sub_81277E8 + + thumb_func_start sub_8127814 +sub_8127814: @ 8127814 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + ldr r0, _081278B4 + movs r1, 0 + movs r2, 0x10 + bl memset + ldr r0, _081278B8 + movs r1, 0 + movs r2, 0xC + bl memset + movs r6, 0 + ldr r0, _081278BC + mov r10, r0 + ldr r1, _081278C0 + mov r9, r1 + ldr r3, _081278C4 + mov r8, r3 +_08127842: + mov r1, r10 + ldr r0, [r1] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _081278E2 + movs r2, 0 + mov r3, r8 + ldrb r0, [r3] + lsls r0, 3 + ldr r1, _081278C8 + adds r0, r1 + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcs _081278E2 + ldr r7, _081278B4 + adds r3, r1, 0 + mov r12, r3 +_08127868: + ldr r0, _081278CC + ldr r1, [r0] + adds r1, r2 + mov r3, r10 + ldr r0, [r3] + add r0, r9 + adds r0, r6 + ldrb r1, [r1] + adds r4, r2, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bne _081278D0 + movs r1, 0 + cmp r1, r5 + bcs _081278A2 + ldrb r0, [r7] + cmp r0, r4 + beq _081278A2 + ldr r3, _081278B4 + adds r2, r4, 0 +_08127890: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r5 + bcs _081278A2 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08127890 +_081278A2: + cmp r1, r5 + bne _081278D0 + adds r0, r5, r7 + strb r4, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _081278E2 + .align 2, 0 +_081278B4: .4byte 0x0203a152 +_081278B8: .4byte 0x0203a162 +_081278BC: .4byte 0x03005d8c +_081278C0: .4byte 0x00001aae +_081278C4: .4byte 0x0203a173 +_081278C8: .4byte 0x0203bc40 +_081278CC: .4byte 0x0203a14c +_081278D0: + lsls r0, r4, 16 + lsrs r2, r0, 16 + mov r1, r8 + ldrb r0, [r1] + lsls r0, 3 + add r0, r12 + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcc _08127868 +_081278E2: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0xF + bls _08127842 + movs r5, 0 + movs r6, 0 + ldr r3, _0812790C + mov r8, r3 +_081278F4: + ldr r0, _08127910 + ldr r0, [r0] + ldr r1, _08127914 + adds r0, r1 + adds r0, r6 + ldrb r0, [r0] + adds r7, r6, 0x1 + cmp r0, 0 + beq _0812799A + movs r2, 0 + b _0812798C + .align 2, 0 +_0812790C: .4byte 0x0203bc40 +_08127910: .4byte 0x03005d8c +_08127914: .4byte 0x0000271c +_08127918: + ldr r0, _08127978 + ldr r1, [r0] + adds r1, r2 + ldr r0, _0812797C + ldr r0, [r0] + ldr r3, _08127980 + adds r0, r3 + adds r0, r6 + ldrb r1, [r1] + adds r4, r2, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bne _08127988 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_81277BC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08127988 + movs r1, 0 + cmp r1, r5 + bcs _08127966 + ldr r2, _08127984 + ldrb r0, [r2] + cmp r0, r4 + beq _08127966 + adds r3, r2, 0 + adds r2, r4, 0 +_08127954: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r5 + bcs _08127966 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08127954 +_08127966: + cmp r1, r5 + bne _08127988 + ldr r0, _08127984 + adds r0, r5, r0 + strb r4, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _0812799A + .align 2, 0 +_08127978: .4byte 0x0203a14c +_0812797C: .4byte 0x03005d8c +_08127980: .4byte 0x0000271c +_08127984: .4byte 0x0203a162 +_08127988: + lsls r0, r4, 16 + lsrs r2, r0, 16 +_0812798C: + ldr r0, _081279B0 + ldrb r0, [r0] + lsls r0, 3 + add r0, r8 + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcc _08127918 +_0812799A: + lsls r0, r7, 16 + lsrs r6, r0, 16 + cmp r6, 0xB + bls _081278F4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081279B0: .4byte 0x0203a173 + thumb_func_end sub_8127814 + + thumb_func_start sub_81279B4 +sub_81279B4: @ 81279B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8127814 + pop {r0} + bx r0 + thumb_func_end sub_81279B4 + + thumb_func_start sub_81279C4 +sub_81279C4: @ 81279C4 + push {r4,lr} + movs r2, 0 + ldr r0, _081279F0 + ldrh r0, [r0] + ldr r1, _081279F4 + ldrh r1, [r1] + adds r0, r1 + adds r1, r0, 0x1 + ldr r4, _081279F8 + ldr r3, _081279FC +_081279D8: + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, r1 + beq _081279EC + cmp r2, 0xB + bhi _08127A00 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, r1 + bne _08127A00 +_081279EC: + movs r0, 0 + b _08127A0C + .align 2, 0 +_081279F0: .4byte 0x0203a170 +_081279F4: .4byte 0x0203a16e +_081279F8: .4byte 0x0203a152 +_081279FC: .4byte 0x0203a162 +_08127A00: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081279D8 + movs r0, 0x1 +_08127A0C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81279C4 + + thumb_func_start sub_8127A14 +sub_8127A14: @ 8127A14 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_81269D4 + adds r0, r4, 0 + bl sub_8127620 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127A14 + + thumb_func_start sub_8127A30 +sub_8127A30: @ 8127A30 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldr r1, _08127A54 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08127A58 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127A54: .4byte 0x03005e00 +_08127A58: .4byte sub_8127A14 + 1 + thumb_func_end sub_8127A30 + + thumb_func_start sub_8127A5C +sub_8127A5C: @ 8127A5C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08127A88 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08127A82 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + movs r0, 0x1 + bl sub_81269D4 + adds r0, r4, 0 + bl sub_8127620 +_08127A82: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127A88: .4byte 0x030022c0 + thumb_func_end sub_8127A5C + + thumb_func_start sub_8127A8C +sub_8127A8C: @ 8127A8C + 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, _08127AC4 + adds r4, r0 + bl sub_8127554 + bl sub_81277A8 + ldrb r0, [r4, 0x1A] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, _08127AC8 + ldr r0, [r0] + bl free + adds r0, r5, 0 + bl sub_8126E44 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08127AC4: .4byte 0x03005e08 +_08127AC8: .4byte 0x0203a18c + thumb_func_end sub_8127A8C + + thumb_func_start sub_8127ACC +sub_8127ACC: @ 8127ACC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08127AFC + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r4, r2, r3 + ldr r0, _08127B00 + ldr r1, [r0] + ldrh r0, [r1] + strh r0, [r4, 0xE] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x10] + adds r3, 0x8 + adds r2, r3 + adds r1, r2, 0x2 + adds r0, r2, 0 + bl player_get_pos_to + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08127AFC: .4byte 0x03005e00 +_08127B00: .4byte 0x03005d8c + thumb_func_end sub_8127ACC + + thumb_func_start sub_8127B04 +sub_8127B04: @ 8127B04 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl cur_mapdata_full_redraw + ldr r0, _08127B4C + 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 + ldr r3, _08127B50 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r3 + movs r3, 0xE + ldrsb r3, [r4, r3] + ldrb r4, [r4, 0x10] + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set + bl warp_in + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08127B4C: .4byte 0x03005d8c +_08127B50: .4byte 0x03005e00 + thumb_func_end sub_8127B04 + + thumb_func_start sub_8127B54 +sub_8127B54: @ 8127B54 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _08127B74 + cmp r2, 0x22 + beq _08127B7C + cmp r2, 0x26 + bne _08127B86 + ldr r0, _08127B78 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 16 + b _08127B86 + .align 2, 0 +_08127B74: .4byte 0x0000ffff +_08127B78: .4byte 0x085a72e4 +_08127B7C: + ldr r0, _08127B8C + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 16 +_08127B86: + pop {r1} + bx r1 + .align 2, 0 +_08127B8C: .4byte 0x085a72ec + thumb_func_end sub_8127B54 + + thumb_func_start sub_8127B90 +sub_8127B90: @ 8127B90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r4, [sp, 0x54] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x8] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x10] + movs r2, 0 + lsls r0, r3, 16 + cmp r2, r3 + bcc _08127BC6 + b _08127D28 +_08127BC6: + ldr r1, [sp, 0x8] + str r1, [sp, 0x28] + str r0, [sp, 0x2C] +_08127BCC: + ldr r3, [sp, 0x4] + ldr r4, [sp, 0xC] + subs r1, r3, r4 + lsls r0, r2, 16 + asrs r0, 16 + adds r0, 0x1 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + movs r0, 0 + mov r10, r0 + adds r1, r2, 0x1 + str r1, [sp, 0x30] + ldr r3, [sp, 0x28] + cmp r10, r3 + bcc _08127BF0 + b _08127D18 +_08127BF0: + ldr r4, [sp, 0x10] + lsls r4, 5 + str r4, [sp, 0x18] + ldr r0, _08127C58 + adds r0, r4, r0 + str r0, [sp, 0x1C] + ldr r0, _08127C5C + adds r0, r4, r0 + str r0, [sp, 0x24] + ldr r3, [sp, 0x8] + adds r1, r2, 0 + muls r1, r3 + str r1, [sp, 0x20] +_08127C0A: + ldr r0, [sp] + add r0, r10 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, [sp, 0x20] + add r1, r10 + ldr r4, [sp, 0x1C] + ldr r0, [r4] + lsls r1, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl cur_mapdata_get_behaviour_by_blockid + lsls r4, r0, 16 + lsls r0, r4, 8 + lsrs r0, 24 + bl sub_80892D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08127C50 + ldr r3, [sp, 0x24] + ldrb r0, [r3, 0x11] + cmp r0, 0x1 + beq _08127C60 + lsrs r0, r4, 28 + cmp r0, 0 + beq _08127C60 +_08127C50: + movs r4, 0xC0 + lsls r4, 4 + mov r8, r4 + b _08127C64 + .align 2, 0 +_08127C58: .4byte 0x085a5c24 +_08127C5C: .4byte 0x085a5c08 +_08127C60: + movs r0, 0 + mov r8, r0 +_08127C64: + ldr r1, [sp, 0x24] + ldrb r0, [r1, 0x11] + lsls r7, r5, 16 + ldr r2, [sp, 0x14] + lsls r2, 16 + mov r9, r2 + cmp r0, 0x3 + beq _08127C8E + asrs r0, r7, 16 + asrs r1, r2, 16 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089328 + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x1 + cmp r0, 0x1 + beq _08127C90 +_08127C8E: + movs r6, 0 +_08127C90: + ldr r3, [sp, 0x18] + ldr r4, _08127CD8 + adds r0, r3, r4 + ldrb r0, [r0] + ldr r4, [sp, 0x20] + add r4, r10 + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_8127B54 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _08127CDC + cmp r5, r0 + beq _08127CE0 + asrs r0, r7, 16 + mov r2, r9 + asrs r1, r2, 16 + ldr r3, [sp, 0x1C] + ldr r2, [r3] + lsls r3, r4, 1 + adds r3, r2 + movs r4, 0x80 + lsls r4, 2 + adds r2, r4, 0 + orrs r6, r2 + ldrh r3, [r3] + adds r2, r6, r3 + mov r3, r8 + orrs r3, r2 + orrs r3, r5 + lsls r2, r3, 16 + lsrs r2, 16 + bl sub_8088338 + b _08127D06 + .align 2, 0 +_08127CD8: .4byte 0x085a5c08 +_08127CDC: .4byte 0x0000ffff +_08127CE0: + asrs r0, r7, 16 + mov r2, r9 + asrs r1, r2, 16 + ldr r3, [sp, 0x1C] + ldr r2, [r3] + lsls r3, r4, 1 + adds r3, r2 + movs r4, 0x80 + lsls r4, 2 + adds r2, r4, 0 + orrs r6, r2 + ldrh r3, [r3] + adds r2, r6, r3 + mov r3, r8 + orrs r3, r2 + lsls r2, r3, 16 + lsrs r2, 16 + bl setmaptile_0 +_08127D06: + mov r0, r10 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldr r4, [sp, 0x28] + cmp r10, r4 + bcs _08127D18 + b _08127C0A +_08127D18: + ldr r1, [sp, 0x30] + lsls r0, r1, 16 + lsrs r2, r0, 16 + ldr r3, [sp, 0x2C] + lsrs r0, r3, 16 + cmp r2, r0 + bcs _08127D28 + b _08127BCC +_08127D28: + 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_8127B90 + + thumb_func_start sub_8127D38 +sub_8127D38: @ 8127D38 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r1, _08127D60 + lsls r0, r2, 5 + adds r0, r1 + ldrb r0, [r0, 0x12] + cmp r0, 0x9 + bhi _08127E10 + lsls r0, 2 + ldr r1, _08127D64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08127D60: .4byte 0x085a5c08 +_08127D64: .4byte _08127D68 + .align 2, 0 +_08127D68: + .4byte _08127D90 + .4byte _08127D9A + .4byte _08127DA4 + .4byte _08127DB4 + .4byte _08127DBE + .4byte _08127DC8 + .4byte _08127DD8 + .4byte _08127DE2 + .4byte _08127DF2 + .4byte _08127E02 +_08127D90: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x1 + b _08127DAC +_08127D9A: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x2 + b _08127DAC +_08127DA4: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x3 +_08127DAC: + movs r3, 0x1 + bl sub_8127B90 + b _08127E10 +_08127DB4: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x4 + b _08127DD0 +_08127DBE: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x2 + b _08127DD0 +_08127DC8: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x1 +_08127DD0: + movs r3, 0x2 + bl sub_8127B90 + b _08127E10 +_08127DD8: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x1 + b _08127DFA +_08127DE2: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x4 + bl sub_8127B90 + b _08127E10 +_08127DF2: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x3 +_08127DFA: + movs r3, 0x3 + bl sub_8127B90 + b _08127E10 +_08127E02: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_8127B90 +_08127E10: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127D38 + + thumb_func_start sub_8127E18 +sub_8127E18: @ 8127E18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r6, 0 + ldr r7, _08127EF8 + ldr r0, _08127EFC + mov r8, r0 + ldr r1, _08127F00 + mov r10, r1 + ldr r2, _08127F04 + mov r9, r2 +_08127E34: + adds r5, r6, 0 + adds r5, 0xAE + adds r4, r5, 0 + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08127F1C + adds r0, r4, 0 + bl flag_clear + movs r2, 0 + ldr r0, [r7, 0x4] + ldrb r4, [r0] + cmp r2, r4 + bcs _08127E82 + ldr r0, [r0, 0x4] + ldrh r0, [r0, 0x14] + cmp r0, r5 + beq _08127E82 + ldr r0, _08127EF8 + ldr r3, [r0, 0x4] + ldrb r6, [r3] + adds r4, r5, 0 +_08127E68: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r6 + bcs _08127E82 + ldr r0, [r3, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + cmp r0, r4 + bne _08127E68 +_08127E82: + ldr r0, [r7, 0x4] + ldr r1, [r0, 0x4] + lsls r4, r2, 1 + adds r4, r2 + lsls r4, 3 + adds r1, r4, r1 + ldr r5, _08127F08 + adds r0, r5, 0 + ldrb r1, [r1, 0x1] + adds r0, r1 + ldr r1, _08127F0C + ldr r1, [r1] + ldr r1, [r1, 0x1C] + ldrh r1, [r1] + bl var_set + ldr r0, [r7, 0x4] + ldr r0, [r0, 0x4] + adds r4, r0 + ldrb r0, [r4] + mov r6, r8 + strh r0, [r6] + ldr r1, _08127F10 + ldrh r1, [r1] + mov r2, r10 + strh r1, [r2] + ldr r1, _08127F14 + ldrh r1, [r1] + ldr r4, _08127F18 + strh r1, [r4] + mov r5, r9 + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r6, r10 + movs r4, 0 + ldrsh r3, [r6, r4] + ldr r5, _08127F18 + movs r6, 0 + ldrsh r4, [r5, r6] + str r4, [sp] + bl sub_808EBA8 + mov r1, r8 + ldrb r0, [r1] + mov r4, r9 + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + b _08127F26 + .align 2, 0 +_08127EF8: .4byte 0x02037318 +_08127EFC: .4byte 0x020375e2 +_08127F00: .4byte 0x020375e4 +_08127F04: .4byte 0x03005d8c +_08127F08: .4byte 0x00003f20 +_08127F0C: .4byte 0x0203a190 +_08127F10: .4byte 0x0203aa34 +_08127F14: .4byte 0x0203aa36 +_08127F18: .4byte 0x020375e6 +_08127F1C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xD + bls _08127E34 +_08127F26: + 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_8127E18 + + thumb_func_start sub_8127F38 +sub_8127F38: @ 8127F38 + push {lr} + movs r1, 0 + ldr r0, _08127F54 + ldrb r2, [r0, 0x8] + cmp r1, r2 + bcs _08127F62 + ldr r3, [r0] +_08127F46: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08127F58 + movs r0, 0x1 + b _08127F64 + .align 2, 0 +_08127F54: .4byte 0x0203a17c +_08127F58: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bcc _08127F46 +_08127F62: + movs r0, 0 +_08127F64: + pop {r1} + bx r1 + thumb_func_end sub_8127F38 + + thumb_func_start sub_8127F68 +sub_8127F68: @ 8127F68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08127F98 + ldrb r0, [r0, 0x9] + cmp r0, 0x1 + bne _08127FAC + ldr r0, _08127F9C + ldrb r0, [r0] + cmp r0, 0x6 + beq _08127FAC + cmp r0, 0x7 + beq _08127FAC + ldr r4, _08127FA0 + ldr r1, _08127FA4 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08127FA8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _0812804C + .align 2, 0 +_08127F98: .4byte 0x0203a17c +_08127F9C: .4byte 0x0203a173 +_08127FA0: .4byte 0x02021fc4 +_08127FA4: .4byte 0x085ea9ae +_08127FA8: .4byte sub_8127A5C + 1 +_08127FAC: + bl sub_81279C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08128038 + bl sub_8127F38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08127FE8 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _08127FE0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, _08127FE4 + str r1, [r0] + b _0812804C + .align 2, 0 +_08127FE0: .4byte 0x03005e00 +_08127FE4: .4byte sub_8128060 + 1 +_08127FE8: + ldr r0, _08128008 + ldr r4, _0812800C + ldrb r1, [r4, 0x8] + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldrb r0, [r4, 0x9] + cmp r0, 0 + bne _08128018 + ldr r0, _08128010 + ldr r1, _08128014 + bl ExpandTextCodes + b _08128020 + .align 2, 0 +_08128008: .4byte 0x02021cc4 +_0812800C: .4byte 0x0203a17c +_08128010: .4byte 0x02021fc4 +_08128014: .4byte 0x085ea8ea +_08128018: + ldr r0, _0812802C + ldr r1, _08128030 + bl ExpandTextCodes +_08128020: + ldr r1, _0812802C + ldr r2, _08128034 + adds r0, r5, 0 + bl sub_81978EC + b _0812804C + .align 2, 0 +_0812802C: .4byte 0x02021fc4 +_08128030: .4byte 0x085ea931 +_08128034: .4byte sub_8127A5C + 1 +_08128038: + ldr r4, _08128054 + ldr r1, _08128058 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _0812805C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_0812804C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08128054: .4byte 0x02021fc4 +_08128058: .4byte 0x085ea8d2 +_0812805C: .4byte sub_8127A5C + 1 + thumb_func_end sub_8127F68 + + thumb_func_start sub_8128060 +sub_8128060: @ 8128060 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08128084 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + movs r1, 0xC + ldrsh r0, [r7, r1] + cmp r0, 0x1 + beq _081280AC + cmp r0, 0x1 + bgt _08128088 + cmp r0, 0 + beq _0812808E + b _08128112 + .align 2, 0 +_08128084: .4byte 0x03005e00 +_08128088: + cmp r0, 0x2 + beq _081280FC + b _08128112 +_0812808E: + ldr r0, _081280A8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08128112 + adds r0, r6, 0 + bl sub_8127ACC + movs r0, 0x1 + strh r0, [r7, 0xC] + b _08128112 + .align 2, 0 +_081280A8: .4byte 0x02037fd4 +_081280AC: + ldr r4, _081280EC + ldrb r0, [r4, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x8] + ldr r5, _081280F0 + ldr r0, _081280F4 + ldrb r1, [r0] + ldr r0, _081280F8 + ldr r0, [r0] + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8128118 + adds r0, r6, 0 + bl sub_812826C + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_81281A8 + bl pal_fill_black + ldrb r1, [r4, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x8] + movs r0, 0x2 + strh r0, [r7, 0xC] + b _08128112 + .align 2, 0 +_081280EC: .4byte 0x02037fd4 +_081280F0: .4byte 0x0203a190 +_081280F4: .4byte 0x0203a172 +_081280F8: .4byte 0x0203a14c +_081280FC: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08128112 + movs r0, 0 + strh r0, [r7, 0x20] + adds r0, r6, 0 + bl sub_8128FD8 +_08128112: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8128060 + + thumb_func_start sub_8128118 +sub_8128118: @ 8128118 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _08128194 + ldr r4, _08128198 + ldr r5, _0812819C + ldr r2, [r5, 0x4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x2E] + strb r0, [r3] + adds r0, r6, 0 + bl gpu_pal_decompress_alloc_tag_and_upload + lsls r0, 24 + lsrs r0, 24 + str r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, _081281A0 + str r1, [r0] + adds r2, r4 + ldr r3, _081281A4 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + strh r0, [r2, 0x20] + ldr r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x3] + strh r0, [r1, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08128194: .4byte 0x0203aa38 +_08128198: .4byte 0x02020630 +_0812819C: .4byte 0x03005dd0 +_081281A0: .4byte sub_81292D0 + 1 +_081281A4: .4byte 0x085a7250 + thumb_func_end sub_8128118 + + thumb_func_start sub_81281A8 +sub_81281A8: @ 81281A8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _081281FC + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldrb r2, [r2, 0x12] + ldr r3, _08128200 + ldr r0, [r1] + ldrb r4, [r0, 0x12] + lsls r1, r4, 2 + adds r1, r3 + lsls r0, r2, 4 + ldrb r1, [r1, 0x2] + adds r0, r1 + subs r2, 0x1 + lsls r2, 3 + subs r0, r2 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0x2 + beq _081281E2 + cmp r4, 0x8 + beq _081281E2 + cmp r4, 0x9 + bne _081281EA +_081281E2: + adds r0, r2, 0 + subs r0, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 +_081281EA: + ldr r0, _08128204 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0812820C + ldr r1, _08128208 + str r0, [sp] + movs r0, 0xC1 + b _08128214 + .align 2, 0 +_081281FC: .4byte 0x03005e00 +_08128200: .4byte 0x085a7250 +_08128204: .4byte 0x03005d90 +_08128208: .4byte nullsub_12 + 1 +_0812820C: + ldr r1, _08128258 + movs r0, 0 + str r0, [sp] + movs r0, 0xC2 +_08128214: + movs r3, 0x48 + bl sub_808DD68 + ldr r1, _0812825C + strb r0, [r1] + ldr r3, _08128260 + ldr r0, _0812825C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r4, _08128264 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + bl obj_delete_and_free_tiles + ldr r0, _08128268 + ldr r0, [r0, 0x4] + strb r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128258: .4byte nullsub_12 + 1 +_0812825C: .4byte 0x0203aa39 +_08128260: .4byte 0x02020630 +_08128264: .4byte 0x0203aa38 +_08128268: .4byte 0x03005dd0 + thumb_func_end sub_81281A8 + + thumb_func_start sub_812826C +sub_812826C: @ 812826C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08128298 + ldr r0, _0812829C + ldrb r1, [r0] + ldr r0, _081282A0 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 5 + adds r0, r2 + ldrb r0, [r0, 0x12] + cmp r0, 0x9 + bls _0812828C + b _081283B2 +_0812828C: + lsls r0, 2 + ldr r1, _081282A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08128298: .4byte 0x085a5c08 +_0812829C: .4byte 0x0203a172 +_081282A0: .4byte 0x0203a14c +_081282A4: .4byte _081282A8 + .align 2, 0 +_081282A8: + .4byte _081282D0 + .4byte _081282E4 + .4byte _081282FC + .4byte _08128314 + .4byte _08128328 + .4byte _0812833C + .4byte _08128350 + .4byte _08128370 + .4byte _08128388 + .4byte _081283A0 +_081282D0: + ldr r0, _081282E0 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08128394 + .align 2, 0 +_081282E0: .4byte 0x03005e00 +_081282E4: + ldr r1, _081282F8 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x12] + movs r1, 0x1 + b _081283B0 + .align 2, 0 +_081282F8: .4byte 0x03005e00 +_081282FC: + ldr r1, _08128310 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x12] + movs r1, 0x1 + b _081283B0 + .align 2, 0 +_08128310: .4byte 0x03005e00 +_08128314: + ldr r1, _08128324 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x4 + b _081283AC + .align 2, 0 +_08128324: .4byte 0x03005e00 +_08128328: + ldr r0, _08128338 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + b _08128394 + .align 2, 0 +_08128338: .4byte 0x03005e00 +_0812833C: + ldr r1, _0812834C + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + b _081283AC + .align 2, 0 +_0812834C: .4byte 0x03005e00 +_08128350: + ldr r0, _0812836C + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x12] + movs r0, 0x3 + strh r0, [r1, 0x14] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _081283B2 + .align 2, 0 +_0812836C: .4byte 0x03005e00 +_08128370: + ldr r1, _08128384 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x12] + movs r1, 0x4 + b _081283B0 + .align 2, 0 +_08128384: .4byte 0x03005e00 +_08128388: + ldr r0, _0812839C + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 +_08128394: + strh r0, [r1, 0x12] + strh r0, [r1, 0x14] + b _081283B2 + .align 2, 0 +_0812839C: .4byte 0x03005e00 +_081283A0: + ldr r1, _081283B8 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 +_081283AC: + strh r1, [r0, 0x12] + movs r1, 0x2 +_081283B0: + strh r1, [r0, 0x14] +_081283B2: + pop {r0} + bx r0 + .align 2, 0 +_081283B8: .4byte 0x03005e00 + thumb_func_end sub_812826C + + thumb_func_start sub_81283BC +sub_81283BC: @ 81283BC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08128404 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + ldr r3, _08128408 + ldr r0, _0812840C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x3C] + ldr r0, _08128410 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x3C] + bl sub_8128DE0 + adds r0, r4, 0 + bl sub_8128950 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128404: .4byte 0x03005e00 +_08128408: .4byte 0x02020630 +_0812840C: .4byte 0x0203aa38 +_08128410: .4byte 0x0203aa39 + thumb_func_end sub_81283BC + + thumb_func_start sub_8128414 +sub_8128414: @ 8128414 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08128468 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + ldr r3, _0812846C + ldr r0, _08128470 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x3C] + ldr r0, _08128474 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x3C] + bl sub_8128DE0 + ldr r5, _08128478 + ldr r1, _0812847C + adds r0, r5, 0 + bl ExpandTextCodes + ldr r2, _08128480 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81978EC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08128468: .4byte 0x03005e00 +_0812846C: .4byte 0x02020630 +_08128470: .4byte 0x0203aa38 +_08128474: .4byte 0x0203aa39 +_08128478: .4byte 0x02021fc4 +_0812847C: .4byte 0x085ea8bf +_08128480: .4byte sub_8128B80 + 1 + thumb_func_end sub_8128414 + + thumb_func_start sub_8128484 +sub_8128484: @ 8128484 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + bl sub_80892C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812849E + cmp r4, 0 + beq _081284A2 +_0812849E: + movs r0, 0 + b _081284A4 +_081284A2: + movs r0, 0x1 +_081284A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8128484 + + thumb_func_start sub_81284AC +sub_81284AC: @ 81284AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r1, 16 + asrs r1, 16 + ldr r3, _081284E8 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + movs r3, 0xE + ldrsh r0, [r2, r3] + adds r0, 0x7 + cmp r1, r0 + bne _081284EC + lsls r1, r4, 16 + asrs r1, 16 + movs r3, 0x10 + ldrsh r0, [r2, r3] + adds r0, 0x7 + cmp r1, r0 + bne _081284EC + cmp r5, 0 + beq _081284EC + movs r0, 0 + b _081284EE + .align 2, 0 +_081284E8: .4byte 0x03005e00 +_081284EC: + movs r0, 0x1 +_081284EE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81284AC + + thumb_func_start sub_81284F4 +sub_81284F4: @ 81284F4 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80892C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08128534 + ldrb r0, [r5] + cmp r0, 0x21 + bne _08128522 + adds r0, r4, 0 + bl sub_8089378 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08128530 +_08128522: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8089314 + lsls r0, 24 + cmp r0, 0 + beq _08128534 +_08128530: + movs r0, 0x1 + b _08128536 +_08128534: + movs r0, 0 +_08128536: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81284F4 + + thumb_func_start sub_812853C +sub_812853C: @ 812853C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r1, _08128578 + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldrb r2, [r0, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r0, 0x12] + str r0, [sp, 0x8] + ldr r3, [sp] + ldrb r0, [r3, 0x11] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0812856E + b _0812893C +_0812856E: + lsls r0, 2 + ldr r1, _0812857C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08128578: .4byte 0x03005e00 +_0812857C: .4byte _08128580 + .align 2, 0 +_08128580: + .4byte _08128594 + .4byte _08128594 + .4byte _08128680 + .4byte _08128834 + .4byte _081288B8 +_08128594: + movs r6, 0 + ldr r0, [sp, 0x4] + cmp r6, r0 + bcc _0812859E + b _0812893C +_0812859E: + mov r1, r10 + lsls r1, 2 + str r1, [sp, 0x1C] +_081285A4: + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + ldr r3, _0812867C + adds r0, r3 + ldrh r0, [r0, 0xA] + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + adds r6, 0x1 + str r6, [sp, 0x14] + ldr r0, [sp, 0x8] + cmp r7, r0 + bcs _0812866E + mov r1, r9 + lsls r1, 16 + str r1, [sp, 0xC] + asrs r1, 16 + mov r9, r1 +_081285D0: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + ldr r2, _0812867C + adds r0, r2 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + mov r8, r0 + asrs r6, r0, 16 + adds r0, r6, 0 + mov r1, r9 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp, 0x4] + ldr r1, [sp, 0x14] + subs r0, r3, r1 + ldr r2, [sp, 0x8] + adds r1, r0, 0 + muls r1, r2 + adds r1, r7 + ldr r3, [sp] + ldr r0, [r3, 0x1C] + lsls r1, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl cur_mapdata_get_behaviour_by_blockid + movs r3, 0xF0 + lsls r3, 8 + adds r1, r3, 0 + adds r5, r1, 0 + ands r5, r0 + adds r0, r4, 0 + ldr r1, [sp] + bl sub_81284F4 + lsls r0, 24 + cmp r0, 0 + bne _08128632 + b _0812890C +_08128632: + mov r0, r10 + adds r1, r6, 0 + mov r2, r9 + adds r3, r5, 0 + bl sub_81284AC + lsls r0, 24 + cmp r0, 0 + bne _08128646 + b _0812890C +_08128646: + mov r1, r8 + lsrs r0, r1, 16 + ldr r2, [sp, 0xC] + lsrs r1, r2, 16 + movs r2, 0 + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08128662 + cmp r4, 0x10 + beq _08128662 + b _0812890C +_08128662: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _081285D0 +_0812866E: + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r2, [sp, 0x4] + cmp r6, r2 + bcc _081285A4 + b _0812893C + .align 2, 0 +_0812867C: .4byte 0x03005e00 +_08128680: + movs r6, 0 + mov r3, r10 + lsls r3, 2 + str r3, [sp, 0x1C] + ldr r0, [sp, 0x4] + subs r0, 0x1 + str r0, [sp, 0x18] + cmp r6, r0 + bge _0812876C + adds r0, r3, 0 + add r0, r10 + lsls r0, 3 + str r0, [sp, 0x10] +_0812869A: + ldr r1, [sp, 0x10] + adds r0, r1, r2 + ldrh r0, [r0, 0xA] + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + adds r6, 0x1 + str r6, [sp, 0x14] + ldr r3, [sp, 0x8] + cmp r7, r3 + bcs _08128760 + lsls r0, 16 + str r0, [sp, 0x20] +_081286B8: + ldr r1, [sp, 0x10] + adds r0, r1, r2 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + mov r8, r0 + asrs r6, r0, 16 + mov r2, r9 + lsls r1, r2, 16 + adds r0, r6, 0 + asrs r1, 16 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp, 0x4] + ldr r1, [sp, 0x14] + subs r0, r3, r1 + ldr r2, [sp, 0x8] + adds r1, r0, 0 + muls r1, r2 + adds r1, r7 + ldr r3, [sp] + ldr r0, [r3, 0x1C] + lsls r1, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl cur_mapdata_get_behaviour_by_blockid + movs r3, 0xF0 + lsls r3, 8 + adds r1, r3, 0 + adds r5, r1, 0 + ands r5, r0 + adds r0, r4, 0 + bl sub_8089314 + lsls r0, 24 + cmp r0, 0 + bne _08128724 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8128484 + lsls r0, 24 + cmp r0, 0 + bne _08128724 + b _0812890C +_08128724: + mov r0, r10 + adds r1, r6, 0 + ldr r3, [sp, 0x20] + asrs r2, r3, 16 + adds r3, r5, 0 + bl sub_81284AC + lsls r0, 24 + cmp r0, 0 + bne _0812873A + b _0812890C +_0812873A: + mov r1, r8 + lsrs r0, r1, 16 + ldr r2, [sp, 0x20] + lsrs r1, r2, 16 + movs r2, 0 + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _08128752 + b _0812890C +_08128752: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _08128830 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _081286B8 +_08128760: + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + cmp r6, r3 + blt _0812869A +_0812876C: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0xA] + ldr r1, [sp, 0x4] + subs r0, r1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _0812878C + b _0812893C +_0812878C: + lsls r0, 16 + str r0, [sp, 0x20] +_08128790: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + ldr r1, _08128830 + adds r0, r1 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + mov r8, r0 + asrs r6, r0, 16 + mov r2, r9 + lsls r1, r2, 16 + adds r0, r6, 0 + asrs r1, 16 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp] + ldr r0, [r3, 0x1C] + lsls r1, r7, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl cur_mapdata_get_behaviour_by_blockid + movs r3, 0xF0 + lsls r3, 8 + adds r1, r3, 0 + adds r5, r1, 0 + ands r5, r0 + adds r0, r4, 0 + bl sub_8089314 + lsls r0, 24 + cmp r0, 0 + bne _081287F2 + adds r0, r4, 0 + bl sub_8089328 + lsls r0, 24 + cmp r0, 0 + bne _081287F2 + b _0812890C +_081287F2: + mov r0, r10 + adds r1, r6, 0 + ldr r3, [sp, 0x20] + asrs r2, r3, 16 + adds r3, r5, 0 + bl sub_81284AC + lsls r0, 24 + cmp r0, 0 + bne _08128808 + b _0812890C +_08128808: + mov r1, r8 + lsrs r0, r1, 16 + ldr r2, [sp, 0x20] + lsrs r1, r2, 16 + movs r2, 0 + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08128822 + cmp r4, 0x10 + bne _0812890C +_08128822: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _08128790 + b _0812893C + .align 2, 0 +_08128830: .4byte 0x03005e00 +_08128834: + movs r6, 0 + ldr r0, [sp, 0x4] + cmp r6, r0 + bcc _0812883E + b _0812893C +_0812883E: + mov r1, r10 + lsls r0, r1, 2 + add r0, r10 + lsls r1, r0, 3 + ldr r2, _081288B4 + adds r0, r1, r2 + ldrh r0, [r0, 0xA] + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcs _081288A4 + adds r0, r2, 0 + adds r1, r0 + mov r8, r1 + mov r1, r9 + lsls r0, r1, 16 + asrs r5, r0, 16 +_08128868: + mov r2, r8 + ldrh r0, [r2, 0x8] + adds r0, r7 + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl sub_8089328 + lsls r0, 24 + cmp r0, 0 + beq _0812890C + adds r0, r4, 0 + adds r1, r5, 0x1 + bl cur_mapdata_get_blockid_at + movs r1, 0xA3 + lsls r1, 2 + cmp r0, r1 + beq _0812890C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _08128868 +_081288A4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x4] + cmp r6, r0 + bcc _0812883E + b _0812893C + .align 2, 0 +_081288B4: .4byte 0x03005e00 +_081288B8: + mov r3, r10 + lsls r1, r3, 2 + adds r0, r1, r3 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0xA] + mov r9, r0 + movs r7, 0 + str r1, [sp, 0x1C] + ldr r0, [sp, 0x8] + cmp r7, r0 + bcs _0812893C + adds r6, r2, 0 + mov r1, r9 + lsls r1, 16 + str r1, [sp, 0x20] +_081288D8: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp] + ldrb r0, [r3, 0x12] + cmp r0, 0x5 + bne _08128910 +_08128900: + adds r0, r4, 0 + bl sub_8089364 + lsls r0, 24 + cmp r0, 0 + bne _0812891C +_0812890C: + movs r0, 0 + b _0812893E +_08128910: + adds r0, r4, 0 + bl sub_8089350 + lsls r0, 24 + cmp r0, 0 + beq _08128900 +_0812891C: + adds r0, r5, 0 + ldr r2, [sp, 0x20] + lsrs r1, r2, 16 + movs r2, 0 + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bne _0812890C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _081288D8 +_0812893C: + movs r0, 0x1 +_0812893E: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812853C + + thumb_func_start sub_8128950 +sub_8128950: @ 8128950 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0812898C + ldrb r1, [r0] + ldr r0, _08128990 + ldr r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 5 + ldr r0, _08128994 + adds r1, r0 + adds r0, r5, 0 + bl sub_812853C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081289A4 + ldr r4, _08128998 + ldr r1, _0812899C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _081289A0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _081289BE + .align 2, 0 +_0812898C: .4byte 0x0203a172 +_08128990: .4byte 0x0203a14c +_08128994: .4byte 0x085a5c08 +_08128998: .4byte 0x02021fc4 +_0812899C: .4byte 0x085ea897 +_081289A0: .4byte sub_81289D0 + 1 +_081289A4: + movs r0, 0x20 + bl audio_play + ldr r4, _081289C4 + ldr r1, _081289C8 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _081289CC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_081289BE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081289C4: .4byte 0x02021fc4 +_081289C8: .4byte 0x085ea8a6 +_081289CC: .4byte sub_8129020 + 1 + thumb_func_end sub_8128950 + + thumb_func_start sub_81289D0 +sub_81289D0: @ 81289D0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _081289EC + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081289EC: .4byte 0x085a72c4 + thumb_func_end sub_81289D0 + + thumb_func_start sub_81289F0 +sub_81289F0: @ 81289F0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_8128AAC + ldr r2, _08128A34 + ldr r0, _08128A38 + ldrb r1, [r0] + ldr r0, _08128A3C + ldr r0, [r0] + adds r0, r1 + ldrb r3, [r0] + lsls r0, r3, 5 + adds r0, r2 + ldrb r0, [r0, 0x11] + cmp r0, 0x4 + beq _08128A44 + ldr r0, _08128A40 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + ldrh r1, [r1, 0xA] + adds r2, r3, 0 + bl sub_8127D38 + b _08128A64 + .align 2, 0 +_08128A34: .4byte 0x085a5c08 +_08128A38: .4byte 0x0203a172 +_08128A3C: .4byte 0x0203a14c +_08128A40: .4byte 0x03005e00 +_08128A44: + ldr r2, _08128A90 + ldr r0, _08128A94 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + subs r0, 0x7 + strh r0, [r2] + ldr r2, _08128A98 + ldrh r0, [r1, 0xA] + subs r0, 0x7 + strh r0, [r2] + ldr r0, _08128A9C + bl script_env_1_execute_new_script +_08128A64: + ldr r2, _08128AA0 + ldr r0, _08128AA4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x2 + strh r1, [r0, 0x22] + ldr r0, _08128AA8 + ldrb r0, [r0, 0x14] + cmp r0, 0x56 + bne _08128A84 + bl sub_80EE104 +_08128A84: + adds r0, r4, 0 + bl sub_8128BBC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128A90: .4byte 0x0203aa34 +_08128A94: .4byte 0x03005e00 +_08128A98: .4byte 0x0203aa36 +_08128A9C: .4byte 0x08275d1f +_08128AA0: .4byte 0x02020630 +_08128AA4: .4byte 0x0203aa38 +_08128AA8: .4byte 0x02037318 + thumb_func_end sub_81289F0 + + thumb_func_start sub_8128AAC +sub_8128AAC: @ 8128AAC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r3, 0 + ldr r0, _08128AE8 + ldrb r1, [r0, 0x8] + adds r5, r0, 0 + cmp r3, r1 + bcs _08128AD2 + ldr r4, [r5] +_08128AC0: + adds r2, r4, r3 + ldrb r0, [r2] + cmp r0, 0 + beq _08128AF0 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bcc _08128AC0 +_08128AD2: + ldrb r0, [r5, 0x9] + cmp r0, 0 + bne _08128B3C + movs r3, 0 + ldr r0, _08128AEC + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0 + bne _08128B28 + b _08128B48 + .align 2, 0 +_08128AE8: .4byte 0x0203a17c +_08128AEC: .4byte 0x0203a152 +_08128AF0: + ldr r0, _08128B1C + ldrb r1, [r0] + ldr r0, _08128B20 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r2, [r5, 0x4] + adds r2, r3 + ldr r0, _08128B24 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x8] + subs r0, 0x7 + lsls r0, 4 + ldrb r1, [r1, 0xA] + subs r1, 0x7 + adds r0, r1 + strb r0, [r2] + b _08128AD2 + .align 2, 0 +_08128B1C: .4byte 0x0203a172 +_08128B20: .4byte 0x0203a14c +_08128B24: .4byte 0x03005e00 +_08128B28: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0xF + bhi _08128B76 + adds r1, r3, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _08128B28 + b _08128B6E +_08128B3C: + movs r3, 0 + ldr r0, _08128B54 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0 + bne _08128B5C +_08128B48: + ldr r0, _08128B58 + ldrb r0, [r0] + adds r0, 0x1 + strb r0, [r2] + b _08128B76 + .align 2, 0 +_08128B54: .4byte 0x0203a162 +_08128B58: .4byte 0x0203a172 +_08128B5C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0xB + bhi _08128B76 + adds r1, r3, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _08128B5C +_08128B6E: + ldr r0, _08128B7C + ldrb r0, [r0] + adds r0, 0x1 + strb r0, [r1] +_08128B76: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08128B7C: .4byte 0x0203a172 + thumb_func_end sub_8128AAC + + thumb_func_start sub_8128B80 +sub_8128B80: @ 8128B80 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _08128B9C + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128B9C: .4byte 0x085a72cc + thumb_func_end sub_8128B80 + + thumb_func_start sub_8128BA0 +sub_8128BA0: @ 8128BA0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_8128BBC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8128BA0 + + thumb_func_start sub_8128BBC +sub_8128BBC: @ 8128BBC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _08128BE4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, _08128BE8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128BE4: .4byte 0x03005e00 +_08128BE8: .4byte c1_overworld_prev_quest + 1 + thumb_func_end sub_8128BBC + + thumb_func_start c1_overworld_prev_quest +c1_overworld_prev_quest: @ 8128BEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08128C0C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08128C10 + cmp r0, 0x1 + beq _08128C30 + b _08128C4C + .align 2, 0 +_08128C0C: .4byte 0x03005e00 +_08128C10: + bl script_env_2_enable + ldr r0, _08128C2C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08128C4C + adds r0, r4, 0 + bl sub_8127B04 + movs r0, 0x1 + strh r0, [r5, 0xC] + b _08128C4C + .align 2, 0 +_08128C2C: .4byte 0x02037fd4 +_08128C30: + bl sub_812A3C8 + ldr r0, _08128C54 + bl gpu_pal_free_tag + ldr r1, _08128C58 + ldr r0, _08128C5C + str r0, [r1] + ldr r0, _08128C60 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08128C4C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08128C54: .4byte 0x00000be5 +_08128C58: .4byte 0x03005dac +_08128C5C: .4byte sub_8128CD4 + 1 +_08128C60: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end c1_overworld_prev_quest + + thumb_func_start sub_8128C64 +sub_8128C64: @ 8128C64 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, _08128C88 + adds r4, r5, r6 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08128C9C + cmp r0, 0x1 + bgt _08128C8C + cmp r0, 0 + beq _08128C96 + b _08128CCA + .align 2, 0 +_08128C88: .4byte 0x03005e08 +_08128C8C: + cmp r0, 0x2 + beq _08128CA8 + cmp r0, 0x3 + beq _08128CB4 + b _08128CCA +_08128C96: + bl sub_80E9578 + b _08128CAC +_08128C9C: + ldr r0, _08128CA4 + bl script_env_1_execute_new_script + b _08128CAC + .align 2, 0 +_08128CA4: .4byte 0x08275d0c +_08128CA8: + bl script_env_2_enable +_08128CAC: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + b _08128CCA +_08128CB4: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08128CCA + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, _08128CD0 + str r1, [r0] +_08128CCA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08128CD0: .4byte sub_812764C + 1 + thumb_func_end sub_8128C64 + + thumb_func_start sub_8128CD4 +sub_8128CD4: @ 8128CD4 + push {r4,lr} + bl script_env_2_enable + bl pal_fill_black + ldr r0, _08128D08 + movs r1, 0x8 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8127580 + ldr r1, _08128D0C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128D08: .4byte sub_8128C64 + 1 +_08128D0C: .4byte 0x03005e00 + thumb_func_end sub_8128CD4 + + thumb_func_start sub_8128D10 +sub_8128D10: @ 8128D10 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08128D40 + adds r2, r1, r0 + ldr r0, _08128D44 + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0x1 + bne _08128D48 + movs r1, 0x2 + ldrsh r0, [r2, r1] + movs r4, 0xC + ldrsh r1, [r2, r4] + subs r0, r1 + subs r0, 0x6 + cmp r0, 0 + bge _08128D48 + ldrh r0, [r2, 0x2] + adds r0, 0x1 + b _08128D62 + .align 2, 0 +_08128D40: .4byte 0x03005e08 +_08128D44: .4byte 0x0203aa3a +_08128D48: + ldrb r0, [r3] + cmp r0, 0x2 + bne _08128D6C + movs r0, 0x2 + ldrsh r1, [r2, r0] + subs r1, 0x7 + ldr r0, _08128D68 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r1, r0 + blt _08128D6C + ldrh r0, [r2, 0x2] + subs r0, 0x1 +_08128D62: + strh r0, [r2, 0x2] + movs r0, 0 + b _08128DAE + .align 2, 0 +_08128D68: .4byte 0x02037318 +_08128D6C: + ldrb r0, [r3] + cmp r0, 0x3 + bne _08128D82 + movs r1, 0 + ldrsh r0, [r2, r1] + subs r0, 0x7 + cmp r0, 0 + bge _08128D82 + ldrh r0, [r2] + adds r0, 0x1 + b _08128DA2 +_08128D82: + ldrb r0, [r3] + cmp r0, 0x4 + bne _08128DAC + movs r3, 0 + ldrsh r1, [r2, r3] + movs r4, 0xA + ldrsh r0, [r2, r4] + adds r1, r0 + subs r1, 0x8 + ldr r0, _08128DA8 + ldr r0, [r0] + ldr r0, [r0] + cmp r1, r0 + blt _08128DAC + ldrh r0, [r2] + subs r0, 0x1 +_08128DA2: + strh r0, [r2] + movs r0, 0 + b _08128DAE + .align 2, 0 +_08128DA8: .4byte 0x02037318 +_08128DAC: + movs r0, 0x1 +_08128DAE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8128D10 + + thumb_func_start sub_8128DB4 +sub_8128DB4: @ 8128DB4 + push {lr} + ldr r0, _08128DD4 + ldrh r0, [r0, 0x2C] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + beq _08128DD8 + cmp r1, 0x80 + beq _08128DD8 + cmp r1, 0x20 + beq _08128DD8 + cmp r1, 0x10 + beq _08128DD8 + movs r0, 0 + b _08128DDA + .align 2, 0 +_08128DD4: .4byte 0x030022c0 +_08128DD8: + movs r0, 0x1 +_08128DDA: + pop {r1} + bx r1 + thumb_func_end sub_8128DB4 + + thumb_func_start sub_8128DE0 +sub_8128DE0: @ 8128DE0 + push {r4,lr} + ldr r1, _08128E0C + movs r0, 0 + strb r0, [r1] + ldr r4, _08128E10 + ldr r3, _08128E14 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0 + strh r2, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08128E0C: .4byte 0x0203aa3a +_08128E10: .4byte 0x02020630 +_08128E14: .4byte 0x0203aa38 + thumb_func_end sub_8128DE0 + + thumb_func_start sub_8128E18 +sub_8128E18: @ 8128E18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + mov r8, r2 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08128E58 + adds r4, r0, r1 + ldr r5, _08128E5C + ldr r3, _08128E60 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x36 + ldrsh r6, [r0, r1] + cmp r6, 0 + beq _08128E46 + b _08128F66 +_08128E46: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08128E68 + ldr r0, _08128E64 + movs r3, 0x18 + ldrsh r1, [r4, r3] + lsls r1, 3 + b _08128E76 + .align 2, 0 +_08128E58: .4byte 0x03005e08 +_08128E5C: .4byte 0x02020630 +_08128E60: .4byte 0x0203aa38 +_08128E64: .4byte 0x085a72d4 +_08128E68: + cmp r0, 0x2 + bne _08128E88 + ldr r0, _08128E84 + movs r3, 0x18 + ldrsh r1, [r4, r3] + lsls r1, 3 + adds r0, 0x4 +_08128E76: + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + b _08128FBA + .align 2, 0 +_08128E84: .4byte 0x085a72d4 +_08128E88: + ldr r2, _08128FC4 + ldrh r1, [r2, 0x2C] + movs r7, 0xF0 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x40 + bne _08128EBC + ldr r1, _08128FC8 + movs r0, 0x1 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08128FCC + strh r1, [r0, 0x34] + ldrh r0, [r4, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x2] +_08128EBC: + ldrh r1, [r2, 0x2C] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x80 + bne _08128EEC + ldr r1, _08128FC8 + movs r0, 0x2 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0, 0x34] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_08128EEC: + ldrh r1, [r2, 0x2C] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x20 + bne _08128F1C + ldr r1, _08128FC8 + movs r0, 0x3 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08128FCC + strh r1, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x34] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] +_08128F1C: + ldrh r1, [r2, 0x2C] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x10 + bne _08128F4C + ldr r1, _08128FC8 + movs r0, 0x4 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x34] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_08128F4C: + bl sub_8128DB4 + lsls r0, 24 + cmp r0, 0 + beq _08128F62 + mov r0, r8 + bl sub_8128D10 + lsls r0, 24 + cmp r0, 0 + bne _08128F66 +_08128F62: + bl sub_8128DE0 +_08128F66: + ldr r0, _08128FC8 + ldrb r0, [r0] + cmp r0, 0 + beq _08128F94 + ldr r3, _08128FD0 + ldr r2, _08128FD4 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x36] + adds r1, 0x1 + strh r1, [r0, 0x36] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x36] + movs r0, 0x7 + ands r0, r2 + strh r0, [r1, 0x36] +_08128F94: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08128FBA + ldr r3, _08128FC4 + ldrh r1, [r3, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08128FAC + strh r2, [r4, 0x14] +_08128FAC: + ldrh r1, [r3, 0x2E] + movs r2, 0x2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08128FBA + strh r2, [r4, 0x14] +_08128FBA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08128FC4: .4byte 0x030022c0 +_08128FC8: .4byte 0x0203aa3a +_08128FCC: .4byte 0x0000fffe +_08128FD0: .4byte 0x02020630 +_08128FD4: .4byte 0x0203aa38 + thumb_func_end sub_8128E18 + + thumb_func_start sub_8128FD8 +sub_8128FD8: @ 8128FD8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r2, _08129010 + ldr r0, _08129014 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0 + strh r2, [r0, 0x3C] + ldr r1, _08129018 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x1C] + ldr r1, _0812901C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08129010: .4byte 0x02020630 +_08129014: .4byte 0x0203aa38 +_08129018: .4byte 0x03005e00 +_0812901C: .4byte sub_8128E18 + 1 + thumb_func_end sub_8128FD8 + + thumb_func_start sub_8129020 +sub_8129020: @ 8129020 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08129044 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0812903A + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08129040 +_0812903A: + adds r0, r2, 0 + bl sub_8128FD8 +_08129040: + pop {r0} + bx r0 + .align 2, 0 +_08129044: .4byte 0x030022c0 + thumb_func_end sub_8129020 + + thumb_func_start sub_8129048 +sub_8129048: @ 8129048 + push {lr} + sub sp, 0x4 + adds r1, r0, 0 + mov r2, sp + movs r0, 0 + strh r0, [r2] + ldr r2, _08129064 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08129064: .4byte 0x01000452 + thumb_func_end sub_8129048 + + thumb_func_start sub_8129068 +sub_8129068: @ 8129068 + push {lr} + adds r2, r0, 0 + lsls r1, 16 + ldr r0, _08129084 + ldr r0, [r0] + lsrs r1, 11 + ldr r0, [r0, 0x8] + adds r0, r1 + adds r1, r2, 0 + movs r2, 0x8 + bl CpuFastSet + pop {r0} + bx r0 + .align 2, 0 +_08129084: .4byte 0x083dfc74 + thumb_func_end sub_8129068 + + thumb_func_start sub_8129088 +sub_8129088: @ 8129088 + push {r4-r7,lr} + sub sp, 0x20 + adds r7, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + lsrs r4, r1, 26 + adds r5, r4, 0 + cmp r2, 0 + beq _0812909E + ldr r0, _081290C0 + ands r2, r0 +_0812909E: + ldr r0, _081290C4 + ldr r0, [r0] + lsls r1, r2, 5 + ldr r0, [r0, 0x4] + adds r0, r1 + mov r1, sp + movs r2, 0x8 + bl CpuFastSet + cmp r4, 0x1 + beq _081290DE + cmp r4, 0x1 + bgt _081290C8 + cmp r4, 0 + beq _081290D2 + b _0812919A + .align 2, 0 +_081290C0: .4byte 0x000003ff +_081290C4: .4byte 0x083dfc74 +_081290C8: + cmp r5, 0x2 + beq _0812913E + cmp r5, 0x3 + beq _08129176 + b _0812919A +_081290D2: + mov r0, sp + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + b _0812919A +_081290DE: + movs r5, 0 + movs r6, 0xF +_081290E2: + lsls r4, r5, 2 + adds r4, r7 + adds r5, 0x1 + lsls r3, r5, 2 + subs r0, r3, 0x1 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4] + subs r0, r3, 0x2 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4, 0x1] + subs r0, r3, 0x3 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4, 0x2] + subs r3, 0x4 + mov r1, sp + adds r0, r1, r3 + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4, 0x3] + lsls r5, 16 + lsrs r5, 16 + cmp r5, 0x7 + bls _081290E2 + b _0812919A +_0812913E: + movs r5, 0 + movs r3, 0x7 +_08129142: + lsls r2, r5, 2 + adds r2, r7 + subs r1, r3, r5 + lsls r1, 2 + mov r4, sp + adds r0, r4, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r1, 0x1 + add r0, sp + ldrb r0, [r0] + strb r0, [r2, 0x1] + adds r0, r1, 0x2 + add r0, sp + ldrb r0, [r0] + strb r0, [r2, 0x2] + adds r1, 0x3 + adds r0, r4, r1 + ldrb r0, [r0] + strb r0, [r2, 0x3] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _08129142 + b _0812919A +_08129176: + movs r5, 0 + movs r4, 0x1F + movs r6, 0xF +_0812917C: + adds r3, r7, r5 + subs r0, r4, r5 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r3] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1F + bls _0812917C +_0812919A: + add sp, 0x20 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8129088 + + thumb_func_start sub_81291A4 +sub_81291A4: @ 81291A4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_081291AA: + lsls r0, r4, 5 + adds r0, 0x84 + adds r0, r5, r0 + lsls r2, r4, 1 + adds r1, r5, 0x4 + adds r1, r2 + ldrh r1, [r1] + bl sub_8129088 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3F + bls _081291AA + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81291A4 + + thumb_func_start sub_81291CC +sub_81291CC: @ 81291CC + lsls r0, 16 + ldr r1, _081291E0 + ldr r1, [r1] + ldr r1, [r1, 0xC] + lsrs r0, 15 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _081291E4 + ands r0, r1 + bx lr + .align 2, 0 +_081291E0: .4byte 0x083dfc78 +_081291E4: .4byte 0x00000fff + thumb_func_end sub_81291CC + + thumb_func_start sub_81291E8 +sub_81291E8: @ 81291E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + movs r6, 0 + ldr r1, _08129258 + lsls r5, r0, 4 + adds r0, r5, r1 + ldrb r0, [r0, 0xC] + cmp r6, r0 + bcs _0812924C + adds r7, r1, 0 +_08129204: + mov r4, r8 + ldm r4!, {r1} + adds r0, r7, 0x4 + adds r0, r5, r0 + ldr r0, [r0] + adds r0, r6 + ldrb r0, [r0] + ldr r1, [r1, 0x1C] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r1, r7, 0 + adds r1, 0x8 + adds r1, r5, r1 + ldr r1, [r1] + adds r1, r6 + lsls r0, 3 + ldrb r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl sub_81291CC + adds r2, r5, r7 + ldr r1, [r2] + adds r1, r6 + ldrb r1, [r1] + lsls r1, 1 + adds r4, r1 + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r2, [r2, 0xC] + cmp r6, r2 + bcc _08129204 +_0812924C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08129258: .4byte 0x085a71b0 + thumb_func_end sub_81291E8 + + thumb_func_start sub_812925C +sub_812925C: @ 812925C + push {r4,r5,lr} + lsls r0, 24 + ldr r3, _081292C0 + movs r1, 0 + strb r1, [r3] + ldrb r2, [r3, 0x1] + subs r1, 0x4 + ands r1, r2 + movs r5, 0xD + negs r5, r5 + ands r1, r5 + movs r2, 0x11 + negs r2, r2 + ands r1, r2 + subs r2, 0x10 + ands r1, r2 + strb r1, [r3, 0x1] + ldr r1, _081292C4 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0] + movs r4, 0x3F + lsls r1, 6 + strb r1, [r3, 0x1] + ldrh r2, [r3, 0x2] + ldr r1, _081292C8 + ands r1, r2 + strh r1, [r3, 0x2] + ldrb r2, [r3, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + strb r1, [r3, 0x3] + ldrb r0, [r0, 0x1] + lsls r0, 6 + ands r4, r1 + orrs r4, r0 + strb r4, [r3, 0x3] + ldrh r1, [r3, 0x4] + ldr r0, _081292CC + ands r0, r1 + strh r0, [r3, 0x4] + ldrb r0, [r3, 0x5] + ands r5, r0 + movs r0, 0xF + ands r5, r0 + strb r5, [r3, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081292C0: .4byte 0x0203aa3c +_081292C4: .4byte 0x085a7250 +_081292C8: .4byte 0xfffffe00 +_081292CC: .4byte 0xfffffc00 + thumb_func_end sub_812925C + + thumb_func_start sub_81292D0 +sub_81292D0: @ 81292D0 + movs r1, 0 + strh r1, [r0, 0x32] + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + strh r1, [r0, 0x3A] + strh r1, [r0, 0x3C] + ldr r1, _081292E4 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_081292E4: .4byte sub_81292E8 + 1 + thumb_func_end sub_81292D0 + + thumb_func_start sub_81292E8 +sub_81292E8: @ 81292E8 + push {lr} + adds r2, r0, 0 + movs r1, 0x3C + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08129322 + movs r1, 0x3A + ldrsh r0, [r2, r1] + cmp r0, 0xE + bgt _0812930A + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + b _08129314 +_0812930A: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 +_08129314: + strb r0, [r3] + ldrh r0, [r2, 0x3A] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r2, 0x3A] + b _0812932E +_08129322: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0812932E: + pop {r0} + bx r0 + thumb_func_end sub_81292E8 + + thumb_func_start gpu_pal_decompress_alloc_tag_and_upload +gpu_pal_decompress_alloc_tag_and_upload: @ 8129334 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_8129048 + lsls r4, 5 + ldr r0, _0812939C + adds r4, r0 + str r4, [r5] + ldrb r0, [r4, 0x11] + cmp r0, 0x4 + beq _081293B4 + ldr r0, _081293A0 + bl gpu_pal_free_tag + adds r0, r5, 0 + bl sub_81291E8 + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl sub_812925C + adds r0, r5, 0 + bl sub_81291A4 + ldr r1, _081293A4 + adds r0, r5, r1 + ldr r1, _081293A8 + ldr r2, [r1] + ldr r1, [r5] + ldr r1, [r1, 0x1C] + ldrh r1, [r1] + ldr r2, [r2, 0xC] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1, 0xE] + lsrs r1, 12 + bl sub_8129068 + ldr r0, _081293AC + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _081293B0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + b _081293C6 + .align 2, 0 +_0812939C: .4byte 0x085a5c08 +_081293A0: .4byte 0x00000be5 +_081293A4: .4byte 0x00000884 +_081293A8: .4byte 0x083dfc78 +_081293AC: .4byte 0x085a72bc +_081293B0: .4byte 0x085a728c +_081293B4: + ldr r0, [r4, 0x1C] + ldrh r0, [r0] + ldr r1, _081293D4 + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_808DD68 +_081293C6: + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081293D4: .4byte nullsub_12 + 1 + thumb_func_end gpu_pal_decompress_alloc_tag_and_upload + + thumb_func_start sub_81293D8 +sub_81293D8: @ 81293D8 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + bl sub_81AFDE4 + lsls r0, 24 + cmp r0, 0 + beq _08129490 + adds r0, r5, 0 + movs r1, 0 + bl sub_812949C + ldr r4, _0812947C + ldr r1, [r4] + bl call_LZZUnCompWram + ldr r0, [r4] + ldr r4, _08129480 + ldr r1, [r4] + bl sub_81AFE44 + ldr r0, [r4] + str r0, [sp] + ldr r4, _08129484 + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, _08129488 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r5, 0 + movs r1, 0x1 + bl sub_812949C + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl gpu_pal_obj_decompress_and_apply + movs r0, 0x18 + bl malloc + adds r5, r0, 0 + adds r1, r5, 0 + ldr r0, _0812948C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81AFE24 + adds r0, r5, 0 + bl free + adds r0, r4, 0 + b _08129492 + .align 2, 0 +_0812947C: .4byte 0x0203cebc +_08129480: .4byte 0x0203cec0 +_08129484: .4byte 0xffff0000 +_08129488: .4byte 0x0000ffff +_0812948C: .4byte 0x08614ff4 +_08129490: + movs r0, 0x40 +_08129492: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81293D8 + + thumb_func_start sub_812949C +sub_812949C: @ 812949C + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r3, 0x78 + bls _081294AC + movs r3, 0 +_081294AC: + ldr r2, _081294BC + lsls r0, 2 + lsls r1, r3, 3 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081294BC: .4byte 0x085a6be8 + thumb_func_end sub_812949C + + thumb_func_start sub_81294C0 +sub_81294C0: @ 81294C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r4, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _08129588 + adds r0, r6, 0 + bl sub_8129048 + lsls r4, 5 + ldr r0, _0812958C + adds r4, r0 + str r4, [r6] + ldrb r0, [r4, 0x11] + cmp r0, 0x4 + beq _081295A4 + adds r0, r6, 0 + bl sub_81291E8 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + bl sub_812925C + adds r0, r6, 0 + bl sub_81291A4 + ldr r0, _08129590 + adds r5, r6, r0 + ldr r0, _08129594 + ldr r1, [r0] + ldr r0, [r6] + ldr r0, [r0, 0x1C] + ldrh r0, [r0] + ldr r1, [r1, 0xC] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r0, 0xE] + lsrs r1, 12 + adds r0, r5, 0 + bl sub_8129068 + adds r0, r6, 0 + adds r0, 0x84 + str r0, [sp, 0x4] + ldr r1, _08129598 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 21 + ldr r4, _0812959C + mov r2, r8 + lsls r1, r2, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + str r5, [sp, 0xC] + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r7 + str r1, [r0, 0x4] + bl gpu_pal_obj_alloc_tag_and_apply + movs r0, 0x18 + bl malloc + adds r4, r0, 0 + adds r1, r4, 0 + ldr r0, _081295A0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r3, r8 + strh r3, [r4] + strh r7, [r4, 0x2] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl free + b _081295BA + .align 2, 0 +_08129588: .4byte 0x0203a190 +_0812958C: .4byte 0x085a5c08 +_08129590: .4byte 0x00000884 +_08129594: .4byte 0x083dfc78 +_08129598: .4byte 0x085a72f4 +_0812959C: .4byte 0xffff0000 +_081295A0: .4byte 0x085a72a4 +_081295A4: + ldr r0, [r4, 0x1C] + ldrh r0, [r0] + ldr r1, _081295C8 + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_808DD68 + lsls r0, 24 + lsrs r5, r0, 24 +_081295BA: + adds r0, r5, 0 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081295C8: .4byte nullsub_12 + 1 + thumb_func_end sub_81294C0 + + thumb_func_start sub_81295CC +sub_81295CC: @ 81295CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r6, r0, 24 + mov r12, r6 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + mov r9, r8 + lsls r2, 16 + lsrs r7, r2, 16 + mov r10, r7 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 16 + lsrs r4, 16 + adds r3, r4, 0 + lsls r5, 16 + lsrs r5, 16 + adds r2, r5, 0 + cmp r6, 0x78 + bls _08129634 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_81293D8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _08129696 + ldr r2, _08129630 + lsls r3, r4, 4 + adds r1, r3, r4 + lsls r1, 2 + adds r1, r2 + mov r5, r8 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, 0x4 + strh r0, [r1, 0x24] + lsls r0, r7, 16 + b _081296B2 + .align 2, 0 +_08129630: .4byte 0x02020630 +_08129634: + ldr r0, _08129678 + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _08129684 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81294C0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _08129696 + ldr r1, _0812967C + lsls r2, r4, 4 + adds r0, r2, r4 + lsls r0, 2 + adds r5, r0, r1 + mov r0, r8 + strh r0, [r5, 0x24] + adds r0, r6, 0 + subs r0, 0x2A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08129680 + lsls r0, r7, 16 + asrs r0, 16 + subs r0, 0x4 + strh r0, [r5, 0x26] + b _081296BC + .align 2, 0 +_08129678: .4byte 0x085a6be8 +_0812967C: .4byte 0x02020630 +_08129680: + strh r7, [r5, 0x26] + b _081296BC +_08129684: + adds r0, r3, 0 + adds r1, r2, 0 + mov r2, r12 + bl sub_81293D8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + bne _0812969A +_08129696: + movs r0, 0x40 + b _081296D8 +_0812969A: + ldr r2, _081296E8 + lsls r3, r4, 4 + adds r1, r3, r4 + lsls r1, 2 + adds r1, r2 + mov r5, r9 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, 0x4 + strh r0, [r1, 0x24] + mov r5, r10 + lsls r0, r5, 16 +_081296B2: + asrs r0, 16 + adds r0, 0x4 + strh r0, [r1, 0x26] + adds r1, r2, 0 + adds r2, r3, 0 +_081296BC: + adds r2, r4 + lsls r2, 2 + adds r2, r1 + movs r0, 0x3 + ldr r1, [sp] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r0, r4, 0 +_081296D8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081296E8: .4byte 0x02020630 + thumb_func_end sub_81295CC + + thumb_func_start sub_81296EC +sub_81296EC: @ 81296EC + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08129704 + ldr r1, [r3] + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3, 0x4] + adds r1, r0 + strb r2, [r1] + bx lr + .align 2, 0 +_08129704: .4byte 0x0203a17c + thumb_func_end sub_81296EC + + thumb_func_start sub_8129708 +sub_8129708: @ 8129708 + push {r4-r6,lr} + ldr r6, _08129728 + movs r0, 0 + strh r0, [r6] + ldr r2, _0812972C + strh r0, [r2] + ldr r4, _08129730 + ldr r1, _08129734 + ldrh r0, [r4] + ldrb r1, [r1] + cmp r0, r1 + bne _08129744 + movs r0, 0x1 + strh r0, [r2] + b _08129796 + .align 2, 0 +_08129728: .4byte 0x020375e2 +_0812972C: .4byte 0x020375f0 +_08129730: .4byte 0x020375e0 +_08129734: .4byte 0x0203aac4 +_08129738: + ldr r1, _08129740 + ldrb r0, [r2] + strh r0, [r1] + b _08129796 + .align 2, 0 +_08129740: .4byte 0x020375e4 +_08129744: + ldr r3, _0812979C + ldr r2, _081297A0 + ldr r1, _081297A4 + ldrh r0, [r4] + lsls r0, 3 + adds r4, r0, r1 + ldrb r1, [r4] + ldr r0, [r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 5 + adds r0, r3 + ldrb r0, [r0, 0x11] + cmp r0, 0x4 + bne _08129796 + ldrh r0, [r4, 0x4] + strh r0, [r6] + ldrb r0, [r4] + bl sub_81296EC + movs r1, 0 + ldr r0, _081297A8 + ldr r0, [r0, 0x4] + ldrb r2, [r0] + cmp r1, r2 + bcs _08129796 + ldr r5, [r0, 0x4] + ldrh r4, [r6] + adds r3, r2, 0 +_0812977E: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0, r5 + ldrh r0, [r2, 0x14] + cmp r0, r4 + beq _08129738 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bcc _0812977E +_08129796: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812979C: .4byte 0x085a5c08 +_081297A0: .4byte 0x0203a17c +_081297A4: .4byte 0x0203aa44 +_081297A8: .4byte 0x02037318 + thumb_func_end sub_8129708 + + thumb_func_start sub_81297AC +sub_81297AC: @ 81297AC + push {r4-r6,lr} + movs r2, 0 + ldr r0, _081297D8 + ldr r0, [r0, 0x4] + ldrb r1, [r0] + cmp r2, r1 + bcs _081297F0 + adds r3, r0, 0 + ldr r5, [r3, 0x4] + ldr r0, _081297DC + ldrh r4, [r0] + ldr r6, _081297E0 +_081297C4: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r5 + ldrh r0, [r1, 0x14] + cmp r0, r4 + bne _081297E4 + ldrb r0, [r1] + strh r0, [r6] + b _081297F0 + .align 2, 0 +_081297D8: .4byte 0x02037318 +_081297DC: .4byte 0x020375e0 +_081297E0: .4byte 0x020375e2 +_081297E4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r3] + cmp r2, r0 + bcc _081297C4 +_081297F0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81297AC + + thumb_func_start sub_81297F8 +sub_81297F8: @ 81297F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r6, 0 + b _081298BE +_08129808: + ldr r3, _081298D8 + lsls r5, r6, 3 + adds r4, r5, r3 + ldrb r1, [r4] + ldr r2, _081298DC + ldr r0, [r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 5 + ldr r7, _081298E0 + adds r0, r7 + ldrb r2, [r0, 0x11] + ldr r7, _081298DC + ldr r0, [r7, 0x4] + adds r0, r1 + ldrb r0, [r0] + lsrs r1, r0, 4 + mov r8, r1 + movs r7, 0xF + adds r1, r7, 0 + ands r1, r0 + str r1, [sp] + adds r7, r5, 0 + adds r6, 0x1 + str r6, [sp, 0x4] + cmp r2, 0x4 + beq _081298B8 + movs r6, 0 + ldrb r4, [r4, 0x2] + cmp r6, r4 + bcs _081298AE +_08129846: + movs r4, 0 + adds r0, r5, r3 + adds r2, r6, 0x1 + mov r10, r2 + ldrb r0, [r0, 0x1] + cmp r4, r0 + bcs _0812989C + ldr r3, _081298D8 + adds r3, r7 + mov r9, r3 + subs r5, r6, 0x7 + str r5, [sp, 0x8] +_0812985E: + adds r0, r4, 0x7 + add r0, r8 + ldr r1, _081298E4 + ldr r3, [r1] + ldr r1, [sp] + subs r2, r1, r6 + ldr r1, [r3] + muls r2, r1 + mov r5, r8 + adds r1, r5, r4 + adds r1, r2 + ldr r2, [r3, 0xC] + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + movs r3, 0xC0 + lsls r3, 6 + adds r2, r3, 0 + orrs r2, r1 + ldr r5, [sp] + ldr r3, [sp, 0x8] + subs r1, r5, r3 + bl sub_8088338 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r5, r9 + ldrb r5, [r5, 0x1] + cmp r4, r5 + bcc _0812985E +_0812989C: + mov r1, r10 + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r3, _081298D8 + adds r5, r7, 0 + adds r0, r7, r3 + ldrb r0, [r0, 0x2] + cmp r6, r0 + bcc _08129846 +_081298AE: + ldr r2, _081298D8 + adds r0, r7, r2 + ldrb r0, [r0] + bl sub_81296EC +_081298B8: + ldr r3, [sp, 0x4] + lsls r0, r3, 24 + lsrs r6, r0, 24 +_081298BE: + ldr r0, _081298E8 + ldrb r0, [r0] + cmp r6, r0 + bcc _08129808 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081298D8: .4byte 0x0203aa44 +_081298DC: .4byte 0x0203a17c +_081298E0: .4byte 0x085a5c08 +_081298E4: .4byte 0x02037318 +_081298E8: .4byte 0x0203aac4 + thumb_func_end sub_81297F8 + + thumb_func_start sub_81298EC +sub_81298EC: @ 81298EC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08129910 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08129928 + cmp r0, 0x1 + bgt _08129914 + cmp r0, 0 + beq _0812991E + b _08129994 + .align 2, 0 +_08129910: .4byte 0x03005e00 +_08129914: + cmp r0, 0x2 + beq _08129954 + cmp r0, 0x3 + beq _08129968 + b _08129994 +_0812991E: + bl sub_81297F8 + movs r0, 0x1 + strh r0, [r4, 0xC] + b _08129994 +_08129928: + ldr r0, _0812994C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08129994 + bl cur_mapdata_full_redraw + ldr r0, _08129950 + bl script_env_1_execute_new_script + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0x2 + strh r0, [r4, 0xC] + b _08129994 + .align 2, 0 +_0812994C: .4byte 0x02037fd4 +_08129950: .4byte 0x08275d2e +_08129954: + bl script_env_2_enable + adds r0, r5, 0 + bl sub_8127814 + bl pal_fill_black + movs r0, 0x3 + strh r0, [r4, 0xC] + b _08129994 +_08129968: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08129994 + ldr r4, _0812999C + ldr r1, _081299A0 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _081299A4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + ldr r0, _081299A8 + ldrb r0, [r0, 0x14] + cmp r0, 0x56 + bne _08129994 + bl sub_80EE104 +_08129994: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812999C: .4byte 0x02021fc4 +_081299A0: .4byte 0x085eaac5 +_081299A4: .4byte sub_8129D64 + 1 +_081299A8: .4byte 0x02037318 + thumb_func_end sub_81298EC + + thumb_func_start sub_81299AC +sub_81299AC: @ 81299AC + push {lr} + movs r1, 0 + ldr r0, _081299C8 + ldrb r2, [r0, 0x8] + cmp r1, r2 + bcs _081299D6 + ldr r3, [r0] +_081299BA: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081299CC + movs r0, 0x1 + b _081299D8 + .align 2, 0 +_081299C8: .4byte 0x0203a17c +_081299CC: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bcc _081299BA +_081299D6: + movs r0, 0 +_081299D8: + pop {r1} + bx r1 + thumb_func_end sub_81299AC + + thumb_func_start sub_81299DC +sub_81299DC: @ 81299DC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + bl player_get_direction__sp1AA + ldr r3, _08129A24 + ldr r2, _08129A28 + ldr r4, _08129A2C + ldr r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strb r0, [r3] + bl sub_812A39C + ldr r0, _08129A30 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + str r0, [r4, 0x4] + ldr r0, _08129A34 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08129A3C + ldr r1, _08129A38 + str r0, [sp] + movs r0, 0xC1 + b _08129A44 + .align 2, 0 +_08129A24: .4byte 0x0203aa38 +_08129A28: .4byte 0x02020630 +_08129A2C: .4byte 0x03005dd0 +_08129A30: .4byte 0x085a7404 +_08129A34: .4byte 0x03005d90 +_08129A38: .4byte nullsub_12 + 1 +_08129A3C: + ldr r1, _08129AA8 + movs r0, 0 + str r0, [sp] + movs r0, 0xC2 +_08129A44: + movs r2, 0x88 + movs r3, 0x48 + bl sub_808DD68 + ldr r1, _08129AAC + strb r0, [r1] + ldr r6, _08129AB0 + ldr r0, _08129AAC + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x4 + mov r8, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r5, _08129AB4 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_delete_and_free_tiles + ldr r0, _08129AB8 + ldr r0, [r0, 0x4] + strb r0, [r5] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + ands r4, r1 + mov r1, r8 + orrs r4, r1 + strb r4, [r0, 0x5] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08129AA8: .4byte nullsub_12 + 1 +_08129AAC: .4byte 0x0203aa39 +_08129AB0: .4byte 0x02020630 +_08129AB4: .4byte 0x0203aa38 +_08129AB8: .4byte 0x03005dd0 + thumb_func_end sub_81299DC + + thumb_func_start sub_8129ABC +sub_8129ABC: @ 8129ABC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08129AE0 + adds r4, r0, r1 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08129B0C + cmp r0, 0x1 + bgt _08129AE4 + cmp r0, 0 + beq _08129AEA + b _08129B2E + .align 2, 0 +_08129AE0: .4byte 0x03005e08 +_08129AE4: + cmp r0, 0x2 + beq _08129B1A + b _08129B2E +_08129AEA: + ldr r0, _08129B08 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08129B2E + adds r0, r5, 0 + bl sub_8127ACC + movs r0, 0x1 + strh r0, [r4, 0x4] + strh r0, [r4, 0xC] + strh r0, [r4, 0xA] + b _08129B2E + .align 2, 0 +_08129B08: .4byte 0x02037fd4 +_08129B0C: + bl sub_81299DC + bl pal_fill_black + movs r0, 0x2 + strh r0, [r4, 0x4] + b _08129B2E +_08129B1A: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08129B2E + strh r0, [r4, 0x18] + adds r0, r5, 0 + bl sub_8129B34 +_08129B2E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8129ABC + + thumb_func_start sub_8129B34 +sub_8129B34: @ 8129B34 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r4, _08129BB4 + ldr r3, _08129BB8 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0 + strh r6, [r0, 0x3C] + 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] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _08129BBC + str r1, [r0] + ldr r2, _08129BC0 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x88 + strh r1, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x48 + strh r1, [r0, 0x22] + ldr r1, _08129BC4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x1C] + ldr r1, _08129BC8 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08129BB4: .4byte 0x02020630 +_08129BB8: .4byte 0x0203aa38 +_08129BBC: .4byte sub_812A36C + 1 +_08129BC0: .4byte 0x0203aa39 +_08129BC4: .4byte 0x03005e00 +_08129BC8: .4byte sub_8128E18 + 1 + thumb_func_end sub_8129B34 + + thumb_func_start sub_8129BCC +sub_8129BCC: @ 8129BCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08129BF4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + bl sub_8128DE0 + adds r0, r4, 0 + bl sub_8129C74 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08129BF4: .4byte 0x03005e00 + thumb_func_end sub_8129BCC + + thumb_func_start sub_8129BF8 +sub_8129BF8: @ 8129BF8 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08129C58 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + bl sub_8128DE0 + ldr r3, _08129C5C + ldr r5, _08129C60 + ldrb r1, [r5] + 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] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, _08129C64 + str r1, [r0] + ldr r5, _08129C68 + ldr r1, _08129C6C + adds r0, r5, 0 + bl ExpandTextCodes + ldr r2, _08129C70 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81978EC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08129C58: .4byte 0x03005e00 +_08129C5C: .4byte 0x02020630 +_08129C60: .4byte 0x0203aa38 +_08129C64: .4byte nullsub_12 + 1 +_08129C68: .4byte 0x02021fc4 +_08129C6C: .4byte 0x085eaa62 +_08129C70: .4byte sub_812A1F0 + 1 + thumb_func_end sub_8129BF8 + + thumb_func_start sub_8129C74 +sub_8129C74: @ 8129C74 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_812A0E8 + ldr r0, _08129C98 + ldrb r0, [r0] + cmp r0, 0 + beq _08129CA8 + ldr r4, _08129C9C + ldr r1, _08129CA0 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08129CA4 + b _08129D14 + .align 2, 0 +_08129C98: .4byte 0x0203aac4 +_08129C9C: .4byte 0x02021fc4 +_08129CA0: .4byte 0x085eaaa3 +_08129CA4: .4byte sub_812A1A0 + 1 +_08129CA8: + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + ldr r0, _08129D20 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089288 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08129CDE + adds r0, r4, 0 + bl sub_8089404 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08129D3C +_08129CDE: + ldr r3, _08129D24 + ldr r4, _08129D28 + ldrb r1, [r4] + 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] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, _08129D2C + str r1, [r0] + ldr r4, _08129D30 + ldr r1, _08129D34 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08129D38 +_08129D14: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _08129D50 + .align 2, 0 +_08129D20: .4byte 0x03005e08 +_08129D24: .4byte 0x02020630 +_08129D28: .4byte 0x0203aa38 +_08129D2C: .4byte nullsub_12 + 1 +_08129D30: .4byte 0x02021fc4 +_08129D34: .4byte 0x085eaa62 +_08129D38: .4byte sub_812A1F0 + 1 +_08129D3C: + ldr r4, _08129D58 + ldr r1, _08129D5C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _08129D60 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_08129D50: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08129D58: .4byte 0x02021fc4 +_08129D5C: .4byte 0x085eaa81 +_08129D60: .4byte sub_8129D64 + 1 + thumb_func_end sub_8129C74 + + thumb_func_start sub_8129D64 +sub_8129D64: @ 8129D64 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08129D88 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08129D7E + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08129D84 +_08129D7E: + adds r0, r2, 0 + bl sub_8129B34 +_08129D84: + pop {r0} + bx r0 + .align 2, 0 +_08129D88: .4byte 0x030022c0 + thumb_func_end sub_8129D64 + + thumb_func_start sub_8129D8C +sub_8129D8C: @ 8129D8C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + ldr r1, _08129DA4 + lsrs r0, 19 + adds r0, r1 + ldrb r1, [r0, 0x12] + cmp r1, 0 + bne _08129DA8 + movs r0, 0x1 + strb r0, [r2, 0x1] + b _08129E06 + .align 2, 0 +_08129DA4: .4byte 0x085a5c08 +_08129DA8: + cmp r1, 0x1 + bne _08129DB4 + movs r0, 0x2 + strb r0, [r2, 0x1] + strb r1, [r2, 0x2] + b _08129E08 +_08129DB4: + cmp r1, 0x2 + bne _08129DC0 + movs r0, 0x3 + strb r0, [r2, 0x1] + movs r0, 0x1 + b _08129E06 +_08129DC0: + cmp r1, 0x3 + bne _08129DC8 + movs r0, 0x4 + b _08129E02 +_08129DC8: + cmp r1, 0x4 + bne _08129DD2 + movs r0, 0x2 + strb r0, [r2, 0x1] + b _08129E06 +_08129DD2: + cmp r1, 0x5 + bne _08129DDA + movs r0, 0x1 + b _08129E02 +_08129DDA: + cmp r1, 0x6 + bne _08129DE6 + movs r0, 0x1 + strb r0, [r2, 0x1] + movs r0, 0x3 + b _08129E06 +_08129DE6: + cmp r1, 0x7 + bne _08129DF2 + movs r0, 0x2 + strb r0, [r2, 0x1] + movs r0, 0x4 + b _08129E06 +_08129DF2: + cmp r1, 0x8 + bne _08129DFC + movs r0, 0x3 + strb r0, [r2, 0x1] + b _08129E06 +_08129DFC: + cmp r1, 0x9 + bne _08129E08 + movs r0, 0x3 +_08129E02: + strb r0, [r2, 0x1] + movs r0, 0x2 +_08129E06: + strb r0, [r2, 0x2] +_08129E08: + pop {r0} + bx r0 + thumb_func_end sub_8129D8C + + thumb_func_start sub_8129E0C +sub_8129E0C: @ 8129E0C + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + ldr r5, _08129E64 + ldr r6, _08129E68 + ldrb r3, [r6] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r5 + adds r2, 0x3E + ldrb r3, [r2] + movs r4, 0x4 + orrs r3, r4 + strb r3, [r2] + ldrb r3, [r6] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r3, r5, 0 + adds r3, 0x1C + adds r2, r3 + ldr r3, _08129E6C + str r3, [r2] + ldr r4, _08129E70 + ldrb r3, [r4] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r5 + lsrs r0, 20 + adds r0, 0x88 + strh r0, [r2, 0x20] + ldrb r2, [r4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + lsrs r1, 20 + adds r1, 0x48 + strh r1, [r0, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08129E64: .4byte 0x02020630 +_08129E68: .4byte 0x0203aa38 +_08129E6C: .4byte nullsub_12 + 1 +_08129E70: .4byte 0x0203aa39 + thumb_func_end sub_8129E0C + + thumb_func_start sub_8129E74 +sub_8129E74: @ 8129E74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _08129F08 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldrb r0, [r2, 0x8] + subs r0, 0x7 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r2, 0xA] + subs r0, 0x7 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, _08129F0C + ldr r0, [r2, 0x4] + adds r0, r1 + ldrb r0, [r0] + lsrs r5, r0, 4 + movs r6, 0xF + ands r6, r0 + mov r0, r9 + ldrb r4, [r0, 0x2] + ldr r0, [r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x29 + bne _08129ED4 + adds r0, r5, 0x7 + adds r1, r6, 0x7 + bl cur_mapdata_get_blockid_at + movs r1, 0xA3 + lsls r1, 2 + cmp r0, r1 + bne _08129ED4 + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08129ED4: + cmp r7, r5 + bcc _08129F10 + mov r0, r9 + ldrb r2, [r0, 0x1] + adds r0, r5, r2 + cmp r7, r0 + bge _08129F10 + subs r0, r6, r4 + cmp r8, r0 + ble _08129F10 + cmp r8, r6 + bhi _08129F10 + subs r0, r7, r5 + adds r0, 0x1 + subs r0, r2, r0 + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + subs r1, r6, r2 + lsls r1, 24 + lsrs r1, 24 + bl sub_8129E0C + movs r0, 0x1 + b _08129F12 + .align 2, 0 +_08129F08: .4byte 0x03005e00 +_08129F0C: .4byte 0x0203a17c +_08129F10: + movs r0, 0 +_08129F12: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8129E74 + + thumb_func_start sub_8129F20 +sub_8129F20: @ 8129F20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, _08129F94 + ldr r3, _08129F98 + ldr r0, _08129F9C + ldrb r0, [r0] + lsls r0, 3 + adds r0, r3 + ldrb r1, [r0] + ldr r0, [r2, 0x4] + adds r0, r1 + ldrb r0, [r0] + lsrs r1, r0, 4 + mov r8, r1 + movs r6, 0xF + ands r6, r0 + movs r4, 0 + ldr r7, _08129FA0 + mov r9, r3 +_08129F4A: + ldr r1, [r7] + lsls r0, r4, 1 + adds r0, r4 + lsls r5, r0, 3 + adds r1, r5 + ldr r2, _08129FA4 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r8 + bne _08129FB0 + ldr r2, _08129FA8 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r6 + bne _08129FB0 + ldr r2, _08129FAC + adds r0, r1, r2 + ldrh r0, [r0] + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08129FB0 + ldr r0, _08129F9C + ldrb r1, [r0] + lsls r1, 3 + add r1, r9 + ldr r0, [r7] + adds r0, r5 + ldr r2, _08129FAC + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1, 0x4] + b _08129FBA + .align 2, 0 +_08129F94: .4byte 0x0203a17c +_08129F98: .4byte 0x0203aa44 +_08129F9C: .4byte 0x0203aac4 +_08129FA0: .4byte 0x03005d8c +_08129FA4: .4byte 0x00000c74 +_08129FA8: .4byte 0x00000c76 +_08129FAC: .4byte 0x00000c84 +_08129FB0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3F + bls _08129F4A +_08129FBA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8129F20 + + thumb_func_start sub_8129FC8 +sub_8129FC8: @ 8129FC8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + b _0812A02A +_08129FD2: + ldr r0, [r0] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0812A024 + ldr r0, _0812A018 + ldrb r2, [r1] + lsls r1, r2, 5 + adds r1, r0 + ldrb r0, [r1, 0x11] + cmp r0, 0x4 + bne _0812A024 + ldr r5, _0812A01C + adds r0, r2, 0 + adds r1, r5, 0 + bl sub_8129D8C + lsls r1, r6, 24 + lsrs r1, 24 + adds r0, r7, 0 + adds r2, r5, 0 + bl sub_8129E74 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0812A024 + strb r6, [r5] + bl sub_8129F20 + ldr r0, _0812A020 + strb r4, [r0] + movs r0, 0x1 + b _0812A034 + .align 2, 0 +_0812A018: .4byte 0x085a5c08 +_0812A01C: .4byte 0x0203aa44 +_0812A020: .4byte 0x0203aac4 +_0812A024: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0812A02A: + ldr r0, _0812A03C + ldrb r1, [r0, 0x8] + cmp r6, r1 + bcc _08129FD2 + movs r0, 0 +_0812A034: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0812A03C: .4byte 0x0203a17c + thumb_func_end sub_8129FC8 + + thumb_func_start sub_812A040 +sub_812A040: @ 812A040 + 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] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r4, 0 + ldr r7, _0812A0D8 + ldrb r0, [r7, 0x8] + cmp r4, r0 + bcs _0812A0C6 + adds r6, r7, 0 + ldr r5, _0812A0DC +_0812A072: + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + ldr r0, [r6, 0x4] + adds r0, r4 + ldrb r0, [r0] + lsrs r3, r0, 4 + movs r2, 0xF + ands r2, r0 + cmp r1, 0 + beq _0812A0BA + ldr r0, _0812A0E0 + lsls r1, 5 + adds r1, r0 + ldrb r0, [r1, 0x11] + cmp r0, 0x4 + bne _0812A0BA + ldr r0, [sp] + cmp r0, r3 + bhi _0812A0BA + cmp r10, r2 + bhi _0812A0BA + cmp r9, r3 + bcc _0812A0BA + cmp r8, r2 + bcc _0812A0BA + ldr r0, _0812A0E4 + ldrb r1, [r5] + lsls r1, 3 + adds r1, r0 + strb r4, [r1] + bl sub_8129F20 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_0812A0BA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r7, 0x8] + cmp r4, r0 + bcc _0812A072 +_0812A0C6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812A0D8: .4byte 0x0203a17c +_0812A0DC: .4byte 0x0203aac4 +_0812A0E0: .4byte 0x085a5c08 +_0812A0E4: .4byte 0x0203aa44 + thumb_func_end sub_812A040 + + thumb_func_start sub_812A0E8 +sub_812A0E8: @ 812A0E8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _0812A140 + movs r0, 0 + strb r0, [r4] + adds r0, r6, 0 + bl sub_8129FC8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0812A18C + movs r5, 0 + ldr r0, _0812A144 + ldrb r1, [r0, 0x8] + cmp r5, r1 + bcs _0812A15A + adds r7, r4, 0 +_0812A10E: + ldr r0, [r0] + adds r0, r5 + ldrb r1, [r0] + cmp r1, 0 + beq _0812A14C + ldr r4, _0812A148 + adds r0, r1, 0 + adds r1, r4, 0 + bl sub_8129D8C + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8129E74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812A14C + strb r5, [r4] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _0812A15A + .align 2, 0 +_0812A140: .4byte 0x0203aac4 +_0812A144: .4byte 0x0203a17c +_0812A148: .4byte 0x0203aa44 +_0812A14C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0812A194 + ldrb r1, [r0, 0x8] + cmp r5, r1 + bcc _0812A10E +_0812A15A: + ldr r0, _0812A198 + ldrb r0, [r0] + cmp r0, 0 + beq _0812A18C + ldr r0, _0812A194 + ldr r2, _0812A19C + ldrb r1, [r2] + ldr r0, [r0, 0x4] + adds r0, r1 + ldrb r1, [r0] + lsrs r0, r1, 4 + movs r3, 0xF + ands r3, r1 + ldrb r1, [r2, 0x2] + subs r1, r3, r1 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r2, 0x1] + adds r2, r0 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + bl sub_812A040 +_0812A18C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812A194: .4byte 0x0203a17c +_0812A198: .4byte 0x0203aac4 +_0812A19C: .4byte 0x0203aa44 + thumb_func_end sub_812A0E8 + + thumb_func_start sub_812A1A0 +sub_812A1A0: @ 812A1A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _0812A1BC + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812A1BC: .4byte 0x085a7348 + thumb_func_end sub_812A1A0 + + thumb_func_start sub_812A1C0 +sub_812A1C0: @ 812A1C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _0812A1E8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, _0812A1EC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812A1E8: .4byte 0x03005e00 +_0812A1EC: .4byte sub_81298EC + 1 + thumb_func_end sub_812A1C0 + + thumb_func_start sub_812A1F0 +sub_812A1F0: @ 812A1F0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _0812A20C + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812A20C: .4byte 0x085a7350 + thumb_func_end sub_812A1F0 + + thumb_func_start sub_812A210 +sub_812A210: @ 812A210 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_812A22C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812A210 + + thumb_func_start sub_812A22C +sub_812A22C: @ 812A22C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _0812A254 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, _0812A258 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812A254: .4byte 0x03005e00 +_0812A258: .4byte sub_812A25C + 1 + thumb_func_end sub_812A22C + + thumb_func_start sub_812A25C +sub_812A25C: @ 812A25C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0812A27C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0812A280 + cmp r0, 0x1 + beq _0812A29C + b _0812A2B2 + .align 2, 0 +_0812A27C: .4byte 0x03005e00 +_0812A280: + ldr r0, _0812A298 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812A2B2 + adds r0, r4, 0 + bl sub_8127B04 + movs r0, 0x1 + strh r0, [r5, 0xC] + b _0812A2B2 + .align 2, 0 +_0812A298: .4byte 0x02037fd4 +_0812A29C: + bl sub_812A3C8 + ldr r0, _0812A2B8 + ldr r1, _0812A2BC + str r1, [r0] + ldr r0, _0812A2C0 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_0812A2B2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812A2B8: .4byte 0x03005dac +_0812A2BC: .4byte sub_812A334 + 1 +_0812A2C0: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_812A25C + + thumb_func_start sub_812A2C4 +sub_812A2C4: @ 812A2C4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, _0812A2E8 + adds r4, r5, r6 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0812A2FC + cmp r0, 0x1 + bgt _0812A2EC + cmp r0, 0 + beq _0812A2F6 + b _0812A32A + .align 2, 0 +_0812A2E8: .4byte 0x03005e08 +_0812A2EC: + cmp r0, 0x2 + beq _0812A308 + cmp r0, 0x3 + beq _0812A314 + b _0812A32A +_0812A2F6: + bl sub_80E9578 + b _0812A30C +_0812A2FC: + ldr r0, _0812A304 + bl script_env_1_execute_new_script + b _0812A30C + .align 2, 0 +_0812A304: .4byte 0x08275d0c +_0812A308: + bl script_env_2_enable +_0812A30C: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + b _0812A32A +_0812A314: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812A32A + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, _0812A330 + str r1, [r0] +_0812A32A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812A330: .4byte sub_8126B80 + 1 + thumb_func_end sub_812A2C4 + + thumb_func_start sub_812A334 +sub_812A334: @ 812A334 + push {lr} + bl pal_fill_black + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + bl sub_8126ABC + ldr r0, _0812A364 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812A368 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xC] + pop {r0} + bx r0 + .align 2, 0 +_0812A364: .4byte sub_812A2C4 + 1 +_0812A368: .4byte 0x03005e00 + thumb_func_end sub_812A334 + + thumb_func_start sub_812A36C +sub_812A36C: @ 812A36C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r2, 0x2E] + cmp r0, 0xF + ble _0812A38C + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0812A398 +_0812A38C: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0812A398: + pop {r0} + bx r0 + thumb_func_end sub_812A36C + + thumb_func_start sub_812A39C +sub_812A39C: @ 812A39C + push {lr} + ldr r0, _0812A3B0 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0812A3B8 + ldr r0, _0812A3B4 + bl gpu_pal_obj_alloc_tag_and_apply + b _0812A3BE + .align 2, 0 +_0812A3B0: .4byte 0x03005d90 +_0812A3B4: .4byte 0x085a73d8 +_0812A3B8: + ldr r0, _0812A3C4 + bl gpu_pal_obj_alloc_tag_and_apply +_0812A3BE: + pop {r0} + bx r0 + .align 2, 0 +_0812A3C4: .4byte 0x085a73e0 + thumb_func_end sub_812A39C + + thumb_func_start sub_812A3C8 +sub_812A3C8: @ 812A3C8 + push {lr} + movs r0, 0x8 + bl gpu_pal_free_tag + pop {r0} + bx r0 + thumb_func_end sub_812A3C8 + + thumb_func_start sub_812A3D4 +sub_812A3D4: @ 812A3D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81279C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812A430 + ldr r0, _0812A414 + ldr r1, _0812A418 + ldrb r2, [r1] + ldr r1, _0812A41C + ldr r1, [r1] + adds r1, r2 + ldrb r1, [r1] + lsls r1, 5 + ldr r2, _0812A420 + adds r1, r2 + bl gf_strcpy + ldr r4, _0812A424 + ldr r1, _0812A428 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _0812A42C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC + b _0812A444 + .align 2, 0 +_0812A414: .4byte 0x02021cc4 +_0812A418: .4byte 0x0203a172 +_0812A41C: .4byte 0x0203a14c +_0812A420: .4byte 0x085a5c09 +_0812A424: .4byte 0x02021fc4 +_0812A428: .4byte 0x085eaa14 +_0812A42C: .4byte sub_812A458 + 1 +_0812A430: + ldr r4, _0812A44C + ldr r1, _0812A450 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r2, _0812A454 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81978EC +_0812A444: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812A44C: .4byte 0x02021fc4 +_0812A450: .4byte 0x085ea9e0 +_0812A454: .4byte sub_8127A5C + 1 + thumb_func_end sub_812A3D4 + + thumb_func_start sub_812A458 +sub_812A458: @ 812A458 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _0812A474 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812A474: .4byte 0x085a741c + thumb_func_end sub_812A458 + + thumb_func_start sub_812A478 +sub_812A478: @ 812A478 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0812A4C0 + ldrb r1, [r0] + ldr r0, _0812A4C4 + ldr r0, [r0] + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r5, _0812A4C8 + ldrb r0, [r5] + bl sub_8161AD0 + ldr r1, _0812A4CC + strb r0, [r1] + ldrb r0, [r5] + bl sub_8161A38 + adds r0, r4, 0 + bl sub_8127814 + ldr r5, _0812A4D0 + ldr r1, _0812A4D4 + adds r0, r5, 0 + bl ExpandTextCodes + ldr r2, _0812A4D8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81978EC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812A4C0: .4byte 0x0203a172 +_0812A4C4: .4byte 0x0203a14c +_0812A4C8: .4byte 0x0203a173 +_0812A4CC: .4byte 0x0203a151 +_0812A4D0: .4byte 0x02021fc4 +_0812A4D4: .4byte 0x085eaa3d +_0812A4D8: .4byte sub_8127A5C + 1 + thumb_func_end sub_812A478 + + thumb_func_start sub_812A4DC +sub_812A4DC: @ 812A4DC + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0812A4FC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _0812A500 + cmp r1, 0x1 + beq _0812A518 + b _0812A530 + .align 2, 0 +_0812A4FC: .4byte 0x03005e00 +_0812A500: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0812A530 +_0812A518: + ldr r0, _0812A538 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812A530 + ldr r0, _0812A53C + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_0812A530: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812A538: .4byte 0x02037fd4 +_0812A53C: .4byte sub_812A588 + 1 + thumb_func_end sub_812A4DC + + thumb_func_start sub_812A540 +sub_812A540: @ 812A540 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0812A57C + movs r0, 0x68 + bl malloc_and_clear + str r0, [r5] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_812A6D4 + ldr r0, _0812A580 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812A584 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812A57C: .4byte 0x0203ab34 +_0812A580: .4byte sub_812A4DC + 1 +_0812A584: .4byte 0x03005e00 + thumb_func_end sub_812A540 + + thumb_func_start sub_812A588 +sub_812A588: @ 812A588 + push {lr} + sub sp, 0x4 + ldr r0, _0812A5A4 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xB + bhi _0812A666 + lsls r0, 2 + ldr r1, _0812A5A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0812A5A4: .4byte 0x030022c0 +_0812A5A8: .4byte _0812A5AC + .align 2, 0 +_0812A5AC: + .4byte _0812A5DC + .4byte _0812A5E6 + .4byte _0812A5EC + .4byte _0812A5F6 + .4byte _0812A5FC + .4byte _0812A602 + .4byte _0812A608 + .4byte _0812A60E + .4byte _0812A638 + .4byte _0812A63E + .4byte _0812A644 + .4byte _0812A660 +_0812A5DC: + bl sub_812A750 + bl sub_812A8C4 + b _0812A64C +_0812A5E6: + bl sub_812A7BC + b _0812A64C +_0812A5EC: + bl sub_812A810 + bl sub_812A834 + b _0812A64C +_0812A5F6: + bl sub_812A9AC + b _0812A64C +_0812A5FC: + bl sub_812A9CC + b _0812A64C +_0812A602: + bl sub_812AA48 + b _0812A64C +_0812A608: + bl sub_812A79C + b _0812A64C +_0812A60E: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + b _0812A64C +_0812A638: + bl sub_812FBC4 + b _0812A64C +_0812A63E: + bl sub_812FB14 + b _0812A64C +_0812A644: + bl sub_812AA78 + bl sub_812AA90 +_0812A64C: + ldr r1, _0812A65C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0812A666 + .align 2, 0 +_0812A65C: .4byte 0x030022c0 +_0812A660: + ldr r0, _0812A66C + bl set_callback2 +_0812A666: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0812A66C: .4byte sub_812A670 + 1 + thumb_func_end sub_812A588 + + thumb_func_start sub_812A670 +sub_812A670: @ 812A670 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_812A670 + + thumb_func_start sub_812A688 +sub_812A688: @ 812A688 + push {r4,lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + ldr r4, _0812A6D0 + ldr r0, [r4] + adds r0, 0x58 + ldrh r1, [r0] + movs r0, 0x40 + bl lcd_io_set + ldr r0, [r4] + adds r0, 0x5A + ldrh r1, [r0] + movs r0, 0x44 + bl lcd_io_set + ldr r0, [r4] + adds r0, 0x5C + ldrh r1, [r0] + movs r0, 0x48 + bl lcd_io_set + ldr r0, [r4] + adds r0, 0x5E + ldrh r1, [r0] + movs r0, 0x4A + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812A6D0: .4byte 0x0203ab34 + thumb_func_end sub_812A688 + + thumb_func_start sub_812A6D4 +sub_812A6D4: @ 812A6D4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0812A708 + movs r1, 0xFF + bl AddTask + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0812A70C + adds r0, r1 + strh r4, [r0, 0x8] + adds r0, 0xA + adds r1, r5, 0 + bl sub_806F67C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812A708: .4byte nullsub_49 + 1 +_0812A70C: .4byte 0x03005e00 + thumb_func_end sub_812A6D4 + + thumb_func_start sub_812A710 +sub_812A710: @ 812A710 + push {lr} + ldr r0, _0812A740 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r0, _0812A744 + adds r2, r0 + ldr r3, _0812A748 + ldr r1, [r3] + ldrh r0, [r2, 0x8] + strb r0, [r1, 0x1] + adds r2, 0xA + ldr r1, [r3] + adds r1, 0x64 + adds r0, r2, 0 + bl sub_806F684 + pop {r0} + bx r0 + .align 2, 0 +_0812A740: .4byte nullsub_49 + 1 +_0812A744: .4byte 0x03005e00 +_0812A748: .4byte 0x0203ab34 + thumb_func_end sub_812A710 + + thumb_func_start nullsub_49 +nullsub_49: @ 812A74C + bx lr + thumb_func_end nullsub_49 + + thumb_func_start sub_812A750 +sub_812A750: @ 812A750 + push {lr} + sub sp, 0x4 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _0812A790 + mov r0, sp + bl CpuSet + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0812A794 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _0812A798 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0812A790: .4byte 0x05006000 +_0812A794: .4byte 0x085a7424 +_0812A798: .4byte 0x085a7434 + thumb_func_end sub_812A750 + + thumb_func_start sub_812A79C +sub_812A79C: @ 812A79C + push {lr} + ldr r0, _0812A7B8 + bl SetVBlankCallback + movs r0, 0x1 + bl enable_irqs + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_0812A7B8: .4byte sub_812A688 + 1 + thumb_func_end sub_812A79C + + thumb_func_start sub_812A7BC +sub_812A7BC: @ 812A7BC + push {r4-r7,lr} + sub sp, 0x4 + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0x80 + lsls r3, 9 + mov r4, sp + movs r6, 0 + ldr r1, _0812A808 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _0812A80C + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0812A7DA: + 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 _0812A7DA + 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] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812A808: .4byte 0x040000d4 +_0812A80C: .4byte 0x81000800 + thumb_func_end sub_812A7BC + + thumb_func_start sub_812A810 +sub_812A810: @ 812A810 + sub sp, 0x4 + movs r2, 0xE0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, _0812A82C + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _0812A830 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + add sp, 0x4 + bx lr + .align 2, 0 +_0812A82C: .4byte 0x040000d4 +_0812A830: .4byte 0x81000200 + thumb_func_end sub_812A810 + + thumb_func_start sub_812A834 +sub_812A834: @ 812A834 + push {lr} + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x3F + bl lcd_io_set + ldr r1, _0812A8BC + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0812A8C0 + movs r0, 0x52 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_0812A8BC: .4byte 0x00001048 +_0812A8C0: .4byte 0x00000809 + thumb_func_end sub_812A834 + + thumb_func_start sub_812A8C4 +sub_812A8C4: @ 812A8C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_812A710 + ldr r5, _0812A9A4 + ldr r0, [r5] + movs r4, 0 + strb r4, [r0] + ldr r0, [r5] + strb r4, [r0, 0x2] + bl GenerateRandomNumber + ldr r2, [r5] + movs r1, 0x1 + ands r1, r0 + strb r1, [r2, 0x3] + ldr r0, [r5] + strb r4, [r0, 0x4] + ldr r0, [r5] + movs r1, 0 + strh r4, [r0, 0x8] + strb r1, [r0, 0xA] + ldr r0, [r5] + strb r1, [r0, 0xB] + bl sub_8145C30 + ldr r2, [r5] + strh r0, [r2, 0xC] + strh r4, [r2, 0xE] + strh r4, [r2, 0x10] + strh r4, [r2, 0x12] + strh r4, [r2, 0x18] + movs r0, 0x8 + strh r0, [r2, 0x1A] + adds r1, r2, 0 + adds r1, 0x58 + movs r0, 0xF0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0xA0 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x5C + movs r1, 0x3F + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + bl current_map_music_get + ldr r1, [r5] + adds r1, 0x60 + strh r0, [r1] + movs r7, 0 + ldr r0, _0812A9A8 + mov r8, r0 +_0812A934: + ldr r0, _0812A9A4 + ldr r4, [r0] + lsls r6, r7, 1 + adds r0, r4, 0 + adds r0, 0x22 + adds r0, r6 + movs r1, 0 + strh r1, [r0] + adds r5, r4, 0 + adds r5, 0x28 + adds r5, r6 + ldrb r0, [r4, 0x3] + lsls r0, 1 + lsls r1, r7, 2 + adds r0, r1 + add r0, r8 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x15 + bl __modsi3 + strh r0, [r5] + adds r4, 0x1C + adds r4, r6 + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + movs r2, 0xFC + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + adds r1, r2, 0 + bl __modsi3 + strh r0, [r4] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0812A934 + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDE70 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812A9A4: .4byte 0x0203ab34 +_0812A9A8: .4byte 0x085a76b4 + thumb_func_end sub_812A8C4 + + thumb_func_start sub_812A9AC +sub_812A9AC: @ 812A9AC + push {lr} + bl sub_80A1A74 + bl reset_all_obj_data + ldr r1, _0812A9C8 + movs r0, 0x80 + strb r0, [r1] + bl gpu_pal_allocator_reset + bl clear_tasks + pop {r0} + bx r0 + .align 2, 0 +_0812A9C8: .4byte 0x02021b38 + thumb_func_end sub_812A9AC + + thumb_func_start sub_812A9CC +sub_812A9CC: @ 812A9CC + push {r4,r5,lr} + ldr r4, _0812AA20 + movs r0, 0x8 + bl malloc + str r0, [r4] + ldr r4, _0812AA24 + movs r0, 0xE + bl malloc_and_clear + str r0, [r4] + ldr r5, _0812AA28 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r5] + ldr r1, [r4] + ldr r2, _0812AA2C + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [r4] + ldr r2, _0812AA30 + adds r0, r2, 0 + strh r0, [r1, 0x2] + ldr r2, _0812AA34 + adds r0, r2, 0 + strh r0, [r1, 0x4] + ldr r2, _0812AA38 + adds r0, r2, 0 + strh r0, [r1, 0x6] + ldr r2, _0812AA3C + adds r0, r2, 0 + strh r0, [r1, 0x8] + ldr r2, _0812AA40 + adds r0, r2, 0 + strh r0, [r1, 0xA] + ldr r2, _0812AA44 + adds r0, r2, 0 + strh r0, [r1, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812AA20: .4byte 0x0203aacc +_0812AA24: .4byte 0x0203aad0 +_0812AA28: .4byte 0x0203aadc +_0812AA2C: .4byte 0x00002051 +_0812AA30: .4byte 0x00002851 +_0812AA34: .4byte 0x00002061 +_0812AA38: .4byte 0x00002861 +_0812AA3C: .4byte 0x000020be +_0812AA40: .4byte 0x000028be +_0812AA44: .4byte 0x000020bf + thumb_func_end sub_812A9CC + + thumb_func_start sub_812AA48 +sub_812AA48: @ 812AA48 + push {lr} + bl sub_812F908 + bl sub_812F958 + bl sub_812F7E4 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r1, 0x85 + lsls r1, 2 + movs r0, 0 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + bl Window_WriteStandardTileMap + pop {r0} + bx r0 + thumb_func_end sub_812AA48 + + thumb_func_start sub_812AA78 +sub_812AA78: @ 812AA78 + push {lr} + bl sub_812E0E4 + bl sub_812E1C8 + bl sub_812CEF4 + bl sub_812E300 + pop {r0} + bx r0 + thumb_func_end sub_812AA78 + + thumb_func_start sub_812AA90 +sub_812AA90: @ 812AA90 + push {lr} + bl sub_812D188 + bl sub_812BE5C + bl sub_812DE94 + bl sub_812AAA8 + pop {r0} + bx r0 + thumb_func_end sub_812AA90 + + thumb_func_start sub_812AAA8 +sub_812AAA8: @ 812AAA8 + push {r4,lr} + ldr r4, _0812AAC4 + 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 + .align 2, 0 +_0812AAC4: .4byte sub_812AAC8 + 1 + thumb_func_end sub_812AAA8 + + thumb_func_start sub_812AAC8 +sub_812AAC8: @ 812AAC8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, _0812AAF8 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r5, _0812AAFC +_0812AAD8: + ldr r0, _0812AB00 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + adds r0, r4, r5 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _0812AAD8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812AAF8: .4byte 0x085a7450 +_0812AAFC: .4byte 0x03005e00 +_0812AB00: .4byte 0x0203ab34 + thumb_func_end sub_812AAC8 + + thumb_func_start sub_812AB04 +sub_812AB04: @ 812AB04 + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r4, _0812AB34 + ldr r0, [r4] + ldrb r0, [r0, 0x2] + bl sub_812D3B4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812AB34: .4byte 0x0203ab34 + thumb_func_end sub_812AB04 + + thumb_func_start sub_812AB38 +sub_812AB38: @ 812AB38 + push {lr} + ldr r0, _0812AB58 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812AB50 + ldr r0, _0812AB5C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0812AB50: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812AB58: .4byte 0x02037fd4 +_0812AB5C: .4byte 0x0203ab34 + thumb_func_end sub_812AB38 + + thumb_func_start sub_812AB60 +sub_812AB60: @ 812AB60 + push {lr} + ldr r3, _0812AB8C + ldr r1, [r3] + movs r0, 0 + strh r0, [r1, 0xE] + strh r0, [r1, 0x12] + strh r0, [r1, 0x18] + ldrb r2, [r1, 0x4] + movs r0, 0xC0 + ands r0, r2 + strb r0, [r1, 0x4] + ldr r1, [r3] + movs r0, 0x4 + strb r0, [r1] + ldr r3, [r3] + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0 + bgt _0812AB90 + movs r0, 0x19 + strb r0, [r3] + b _0812ABA0 + .align 2, 0 +_0812AB8C: .4byte 0x0203ab34 +_0812AB90: + ldrb r0, [r3, 0xA] + cmp r0, 0 + beq _0812ABA0 + movs r0, 0x3 + strb r0, [r3] + movs r0, 0x4 + bl sub_812DEE4 +_0812ABA0: + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_812AB60 + + thumb_func_start sub_812ABA8 +sub_812ABA8: @ 812ABA8 + push {lr} + bl sub_812E054 + lsls r0, 24 + cmp r0, 0 + beq _0812ABBC + ldr r0, _0812ABC4 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] +_0812ABBC: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812ABC4: .4byte 0x0203ab34 + thumb_func_end sub_812ABA8 + + thumb_func_start sub_812ABC8 +sub_812ABC8: @ 812ABC8 + push {lr} + movs r0, 0 + bl sub_812DEE4 + ldr r2, _0812ABF0 + ldr r1, [r2] + movs r0, 0x5 + strb r0, [r1] + ldr r2, [r2] + movs r0, 0xC + ldrsh r1, [r2, r0] + ldr r0, _0812ABF4 + cmp r1, r0 + ble _0812ABE8 + movs r0, 0x17 + strb r0, [r2] +_0812ABE8: + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0812ABF0: .4byte 0x0203ab34 +_0812ABF4: .4byte 0x0000270e + thumb_func_end sub_812ABC8 + + thumb_func_start sub_812ABF8 +sub_812ABF8: @ 812ABF8 + push {r4,r5,lr} + ldr r0, _0812AC14 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0812AC1C + movs r0, 0 + bl sub_812DC80 + ldr r0, _0812AC18 + ldr r1, [r0] + movs r0, 0x8 + b _0812ACE2 + .align 2, 0 +_0812AC14: .4byte 0x030022c0 +_0812AC18: .4byte 0x0203ab34 +_0812AC1C: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AC82 + ldr r0, _0812AC78 + ldr r2, [r0] + movs r1, 0xC + ldrsh r0, [r2, r1] + subs r0, 0x3 + movs r3, 0x12 + ldrsh r1, [r2, r3] + adds r0, r1 + cmp r0, 0 + blt _0812AC7C + ldrh r4, [r2, 0x12] + adds r0, r1, 0 + cmp r0, 0x2 + bgt _0812AC5A +_0812AC42: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_812CE7C + lsls r0, r4, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0812AC42 +_0812AC5A: + ldr r0, _0812AC78 + ldr r1, [r0] + ldrh r0, [r1, 0xC] + subs r0, 0x3 + ldrh r3, [r1, 0x12] + adds r0, r3 + strh r0, [r1, 0xC] + movs r0, 0x3 + strh r0, [r1, 0x12] + movs r0, 0x9 + strb r0, [r1] + movs r0, 0x5F + bl audio_play + b _0812ACE4 + .align 2, 0 +_0812AC78: .4byte 0x0203ab34 +_0812AC7C: + movs r0, 0x6 + strb r0, [r2] + b _0812ACE4 +_0812AC82: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812ACB2 + ldr r4, _0812ACEC + ldr r0, [r4] + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812ACB2 + movs r0, 0x5F + bl audio_play + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl sub_812CE7C + ldr r1, [r4] + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] +_0812ACB2: + ldr r0, _0812ACEC + ldr r3, [r0] + movs r1, 0x12 + ldrsh r2, [r3, r1] + ldr r4, _0812ACF0 + adds r5, r0, 0 + cmp r2, 0x2 + bgt _0812ACD0 + cmp r2, 0 + beq _0812ACD4 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812ACD4 +_0812ACD0: + movs r0, 0x9 + strb r0, [r3] +_0812ACD4: + ldrh r1, [r4, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0812ACE4 + ldr r1, [r5] + movs r0, 0x15 +_0812ACE2: + strb r0, [r1] +_0812ACE4: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0812ACEC: .4byte 0x0203ab34 +_0812ACF0: .4byte 0x030022c0 + thumb_func_end sub_812ABF8 + + thumb_func_start sub_812ACF4 +sub_812ACF4: @ 812ACF4 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _0812AD2C + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _0812AD30 + ldr r1, [r0] + movs r0, 0x7 + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .align 2, 0 +_0812AD2C: .4byte 0x085ef734 +_0812AD30: .4byte 0x0203ab34 + thumb_func_end sub_812ACF4 + + thumb_func_start sub_812AD34 +sub_812AD34: @ 812AD34 + push {lr} + ldr r0, _0812AD58 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0812AD52 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, _0812AD5C + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] +_0812AD52: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812AD58: .4byte 0x030022c0 +_0812AD5C: .4byte 0x0203ab34 + thumb_func_end sub_812AD34 + + thumb_func_start sub_812AD60 +sub_812AD60: @ 812AD60 + push {lr} + bl sub_812DCB4 + lsls r0, 24 + cmp r0, 0 + beq _0812AD74 + ldr r0, _0812AD7C + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] +_0812AD74: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812AD7C: .4byte 0x0203ab34 + thumb_func_end sub_812AD60 + + thumb_func_start sub_812AD80 +sub_812AD80: @ 812AD80 + push {r4,lr} + adds r4, r0, 0 + bl sub_812B4EC + bl sub_812DFDC + movs r0, 0 + bl sub_812BEA4 + movs r0, 0x1 + bl sub_812BEA4 + movs r0, 0x2 + bl sub_812BEA4 + bl sub_80EEC80 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r4, _0812ADC0 + ldr r0, [r4] + ldrb r1, [r0, 0x4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812ADC4 + bl sub_812D4AC + ldr r1, [r4] + movs r0, 0xA + b _0812ADCE + .align 2, 0 +_0812ADC0: .4byte 0x0203ab34 +_0812ADC4: + movs r0, 0x1 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0xB +_0812ADCE: + strb r0, [r1] + ldr r4, _0812ADF0 + ldr r0, [r4] + movs r1, 0x8 + strh r1, [r0, 0x1A] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _0812ADE6 + bl dp15_jump_random_unknown + ldr r1, [r4] + strh r0, [r1, 0x1A] +_0812ADE6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812ADF0: .4byte 0x0203ab34 + thumb_func_end sub_812AD80 + + thumb_func_start sub_812ADF4 +sub_812ADF4: @ 812ADF4 + push {lr} + bl sub_812D4CC + lsls r0, 24 + cmp r0, 0 + beq _0812AE18 + movs r0, 0x1 + bl sub_812DEE4 + ldr r3, _0812AE20 + ldr r2, [r3] + ldrb r1, [r2, 0x4] + movs r0, 0xDF + ands r0, r1 + strb r0, [r2, 0x4] + ldr r1, [r3] + movs r0, 0xB + strb r0, [r1] +_0812AE18: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812AE20: .4byte 0x0203ab34 + thumb_func_end sub_812ADF4 + + thumb_func_start sub_812AE24 +sub_812AE24: @ 812AE24 + push {lr} + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x1D + ble _0812AE40 + bl sub_812B55C + ldr r0, _0812AE48 + ldr r1, [r0] + movs r0, 0xC + strb r0, [r1] +_0812AE40: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812AE48: .4byte 0x0203ab34 + thumb_func_end sub_812AE24 + + thumb_func_start sub_812AE4C +sub_812AE4C: @ 812AE4C + push {r4,lr} + ldr r0, _0812AE80 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812AE78 + movs r0, 0x18 + bl audio_play + ldr r4, _0812AE84 + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl sub_812BEDC + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl sub_812CD40 + ldr r1, [r4] + movs r0, 0xD + strb r0, [r1] +_0812AE78: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812AE80: .4byte 0x030022c0 +_0812AE84: .4byte 0x0203ab34 + thumb_func_end sub_812AE4C + + thumb_func_start sub_812AE88 +sub_812AE88: @ 812AE88 + push {r4,lr} + ldr r4, _0812AEB8 + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl sub_812BF04 + lsls r0, 24 + cmp r0, 0 + bne _0812AEBC + ldr r1, [r4] + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + movs r0, 0xC + strb r0, [r1] + ldr r1, [r4] + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + ble _0812AEB4 + movs r0, 0xE + strb r0, [r1] +_0812AEB4: + movs r0, 0x1 + b _0812AEBE + .align 2, 0 +_0812AEB8: .4byte 0x0203ab34 +_0812AEBC: + movs r0, 0 +_0812AEBE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812AE88 + + thumb_func_start sub_812AEC4 +sub_812AEC4: @ 812AEC4 + push {r4,lr} + ldr r4, _0812AF30 + ldr r2, [r4] + ldrb r1, [r2, 0x4] + movs r0, 0xC0 + ands r0, r1 + strb r0, [r2, 0x4] + bl sub_812B828 + ldr r1, [r4] + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _0812AEEA + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r1, [r4] + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] +_0812AEEA: + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _0812AFCC + movs r0, 0xF + strb r0, [r1] + bl sub_812BABC + bl sub_812D0B0 + ldr r2, [r4] + ldrh r0, [r2, 0x10] + ldrh r1, [r2, 0xE] + subs r0, r1 + strh r0, [r2, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _0812AF12 + movs r0, 0 + strh r0, [r2, 0x10] +_0812AF12: + ldr r0, [r4] + ldrh r1, [r0, 0x8] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AF38 + ldr r0, _0812AF34 + bl fanfare_play + movs r0, 0x6 + bl sub_812DEE4 + b _0812AF62 + .align 2, 0 +_0812AF30: .4byte 0x0203ab34 +_0812AF34: .4byte 0x00000185 +_0812AF38: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0812AF54 + ldr r0, _0812AF50 + bl fanfare_play + movs r0, 0x5 + bl sub_812DEE4 + b _0812AF62 + .align 2, 0 +_0812AF50: .4byte 0x00000185 +_0812AF54: + movs r0, 0xC3 + lsls r0, 1 + bl fanfare_play + movs r0, 0x2 + bl sub_812DEE4 +_0812AF62: + ldr r2, _0812AFC8 + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0xE0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AFA6 + ldrb r1, [r3, 0x4] + movs r0, 0x3F + ands r0, r1 + movs r4, 0 + strb r0, [r3, 0x4] + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AFA6 + strb r4, [r3, 0xA] + ldr r0, [r2] + strb r4, [r0, 0xB] + ldr r0, [r2] + strb r4, [r0, 0x3] + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AFA6 + movs r0, 0x1 + strb r0, [r3, 0x3] +_0812AFA6: + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812AFEE + ldrb r0, [r3, 0x2] + cmp r0, 0xF + bhi _0812AFEE + adds r0, 0x1 + strb r0, [r3, 0x2] + ldr r0, [r2] + ldrb r0, [r0, 0x2] + bl sub_812D1A8 + b _0812AFEE + .align 2, 0 +_0812AFC8: .4byte 0x0203ab34 +_0812AFCC: + movs r0, 0x3 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0x14 + strb r0, [r1] + ldr r1, [r4] + ldrh r0, [r1, 0x12] + ldrh r2, [r1, 0x10] + adds r0, r2 + strh r0, [r1, 0x10] + lsls r0, 16 + asrs r0, 16 + ldr r2, _0812AFF8 + cmp r0, r2 + ble _0812AFEE + strh r2, [r1, 0x10] +_0812AFEE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812AFF8: .4byte 0x0000270f + thumb_func_end sub_812AEC4 + + thumb_func_start sub_812AFFC +sub_812AFFC: @ 812AFFC + push {lr} + bl sub_812BADC + lsls r0, 24 + cmp r0, 0 + beq _0812B010 + ldr r0, _0812B018 + ldr r1, [r0] + movs r0, 0x10 + strb r0, [r1] +_0812B010: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B018: .4byte 0x0203ab34 + thumb_func_end sub_812AFFC + + thumb_func_start sub_812B01C +sub_812B01C: @ 812B01C + push {r4,lr} + bl sub_812D0E0 + lsls r0, 24 + cmp r0, 0 + beq _0812B088 + ldr r4, _0812B090 + ldr r1, [r4] + movs r0, 0x13 + strb r0, [r1] + ldr r0, [r4] + ldrh r1, [r0, 0x8] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812B044 + movs r0, 0x1C + bl sav12_xor_increment +_0812B044: + ldr r2, [r4] + ldrh r1, [r2, 0x8] + movs r3, 0x4 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0812B05A + movs r0, 0 + strh r0, [r2, 0x18] + movs r0, 0x9 + strb r0, [r2] +_0812B05A: + ldr r2, [r4] + ldrh r1, [r2, 0x8] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812B06A + movs r0, 0x11 + strb r0, [r2] +_0812B06A: + ldr r1, [r4] + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _0812B088 + ldrh r1, [r1, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0812B088 + movs r0, 0x4 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0x12 + strb r0, [r1] +_0812B088: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812B090: .4byte 0x0203ab34 + thumb_func_end sub_812B01C + + thumb_func_start sub_812B094 +sub_812B094: @ 812B094 + push {r4,lr} + bl sub_812D20C + lsls r0, 24 + cmp r0, 0 + bne _0812B0CC + ldr r4, _0812B0D4 + ldr r1, [r4] + movs r0, 0x13 + strb r0, [r1] + ldr r2, [r4] + ldrh r1, [r2, 0x8] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0812B0CC + movs r0, 0x9 + strb r0, [r2] + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _0812B0CC + movs r0, 0x4 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0x12 + strb r0, [r1] +_0812B0CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812B0D4: .4byte 0x0203ab34 + thumb_func_end sub_812B094 + + thumb_func_start sub_812B0D8 +sub_812B0D8: @ 812B0D8 + push {lr} + bl sub_812E054 + lsls r0, 24 + cmp r0, 0 + beq _0812B0FC + ldr r2, _0812B104 + ldr r1, [r2] + movs r0, 0x13 + strb r0, [r1] + ldr r2, [r2] + ldrh r1, [r2, 0x8] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0812B0FC + movs r0, 0x9 + strb r0, [r2] +_0812B0FC: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B104: .4byte 0x0203ab34 + thumb_func_end sub_812B0D8 + + thumb_func_start sub_812B108 +sub_812B108: @ 812B108 + push {lr} + movs r0, 0 + bl sub_812CEB8 + movs r0, 0x1 + bl sub_812CEB8 + movs r0, 0x2 + bl sub_812CEB8 + ldr r0, _0812B12C + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B12C: .4byte 0x0203ab34 + thumb_func_end sub_812B108 + + thumb_func_start sub_812B130 +sub_812B130: @ 812B130 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0812B14E + movs r0, 0 + strh r0, [r1, 0xA] + ldr r0, _0812B154 + ldr r1, [r0] + movs r0, 0x13 + strb r0, [r1] +_0812B14E: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B154: .4byte 0x0203ab34 + thumb_func_end sub_812B130 + + thumb_func_start sub_812B158 +sub_812B158: @ 812B158 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _0812B1A8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r2, 0x85 + lsls r2, 2 + movs r3, 0xC0 + lsls r3, 1 + movs r0, 0xE + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0x15 + movs r1, 0x7 + bl sub_80323CC + ldr r0, _0812B1AC + ldr r1, [r0] + movs r0, 0x16 + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .align 2, 0 +_0812B1A8: .4byte 0x085ef6e9 +_0812B1AC: .4byte 0x0203ab34 + thumb_func_end sub_812B158 + + thumb_func_start sub_812B1B0 +sub_812B1B0: @ 812B1B0 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _0812B1EC + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0 + bl sub_812CEB8 + movs r0, 0x1 + bl sub_812CEB8 + movs r0, 0x2 + bl sub_812CEB8 + ldr r0, _0812B1E8 + ldr r1, [r0] + ldrh r0, [r1, 0x12] + ldrh r2, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + movs r0, 0x1B + b _0812B206 + .align 2, 0 +_0812B1E8: .4byte 0x0203ab34 +_0812B1EC: + cmp r1, 0x1 + beq _0812B1F8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0812B208 +_0812B1F8: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, _0812B210 + ldr r1, [r0] + movs r0, 0x5 +_0812B206: + strb r0, [r1] +_0812B208: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B210: .4byte 0x0203ab34 + thumb_func_end sub_812B1B0 + + thumb_func_start sub_812B214 +sub_812B214: @ 812B214 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _0812B24C + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _0812B250 + ldr r1, [r0] + movs r0, 0x18 + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .align 2, 0 +_0812B24C: .4byte 0x085ef6f8 +_0812B250: .4byte 0x0203ab34 + thumb_func_end sub_812B214 + + thumb_func_start sub_812B254 +sub_812B254: @ 812B254 + push {lr} + ldr r0, _0812B278 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0812B272 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, _0812B27C + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] +_0812B272: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B278: .4byte 0x030022c0 +_0812B27C: .4byte 0x0203ab34 + thumb_func_end sub_812B254 + + thumb_func_start sub_812B280 +sub_812B280: @ 812B280 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _0812B2B8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _0812B2BC + ldr r1, [r0] + movs r0, 0x1A + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .align 2, 0 +_0812B2B8: .4byte 0x085ef710 +_0812B2BC: .4byte 0x0203ab34 + thumb_func_end sub_812B280 + + thumb_func_start sub_812B2C0 +sub_812B2C0: @ 812B2C0 + push {lr} + ldr r0, _0812B2E4 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0812B2DE + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, _0812B2E8 + ldr r1, [r0] + movs r0, 0x1B + strb r0, [r1] +_0812B2DE: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812B2E4: .4byte 0x030022c0 +_0812B2E8: .4byte 0x0203ab34 + thumb_func_end sub_812B2C0 + + thumb_func_start sub_812B2EC +sub_812B2EC: @ 812B2EC + push {r4,lr} + sub sp, 0x4 + ldr r4, _0812B328 + ldr r0, [r4] + ldrh r0, [r0, 0xC] + bl sub_8145C58 + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDD78 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812B328: .4byte 0x0203ab34 + thumb_func_end sub_812B2EC + + thumb_func_start sub_812B32C +sub_812B32C: @ 812B32C + push {r4-r6,lr} + ldr r0, _0812B478 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0812B340 + b _0812B470 +_0812B340: + ldr r6, _0812B47C + ldr r0, [r6] + ldr r0, [r0, 0x64] + bl set_callback2 + ldr r4, _0812B480 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B484 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B488 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B48C + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B490 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B494 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B498 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B49C + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4A0 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4A4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4A8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4AC + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4B0 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4B4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4B8 + ldr r0, [r4] + cmp r0, 0 + beq _0812B3E4 + bl free + str r5, [r4] +_0812B3E4: + ldr r4, _0812B4BC + ldr r0, [r4] + cmp r0, 0 + beq _0812B3F2 + bl free + str r5, [r4] +_0812B3F2: + ldr r4, _0812B4C0 + ldr r0, [r4] + cmp r0, 0 + beq _0812B400 + bl free + str r5, [r4] +_0812B400: + ldr r4, _0812B4C4 + ldr r0, [r4] + cmp r0, 0 + beq _0812B40E + bl free + str r5, [r4] +_0812B40E: + ldr r4, _0812B4C8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4CC + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4D0 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4D4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4D8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4DC + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4E0 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4E4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0812B4E8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r0, [r6] + bl free + str r5, [r6] +_0812B470: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0812B478: .4byte 0x02037fd4 +_0812B47C: .4byte 0x0203ab34 +_0812B480: .4byte 0x0203aaf4 +_0812B484: .4byte 0x0203aaf8 +_0812B488: .4byte 0x0203aafc +_0812B48C: .4byte 0x0203ab00 +_0812B490: .4byte 0x0203ab04 +_0812B494: .4byte 0x0203ab08 +_0812B498: .4byte 0x0203ab0c +_0812B49C: .4byte 0x0203ab10 +_0812B4A0: .4byte 0x0203ab14 +_0812B4A4: .4byte 0x0203ab18 +_0812B4A8: .4byte 0x0203ab1c +_0812B4AC: .4byte 0x0203ab20 +_0812B4B0: .4byte 0x0203ab24 +_0812B4B4: .4byte 0x0203ab28 +_0812B4B8: .4byte 0x0203aae4 +_0812B4BC: .4byte 0x0203aae8 +_0812B4C0: .4byte 0x0203aaec +_0812B4C4: .4byte 0x0203aaf0 +_0812B4C8: .4byte 0x0203aac8 +_0812B4CC: .4byte 0x0203aacc +_0812B4D0: .4byte 0x0203aad0 +_0812B4D4: .4byte 0x0203aad4 +_0812B4D8: .4byte 0x0203aad8 +_0812B4DC: .4byte 0x0203aadc +_0812B4E0: .4byte 0x0203aae0 +_0812B4E4: .4byte 0x0203ab2c +_0812B4E8: .4byte 0x0203ab30 + thumb_func_end sub_812B32C + + thumb_func_start sub_812B4EC +sub_812B4EC: @ 812B4EC + push {r4,lr} + ldr r4, _0812B550 + ldr r1, [r4] + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0812B54A + ldrb r1, [r1, 0x4] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + bne _0812B54A + bl sub_812B5B0 + lsls r0, 24 + cmp r0, 0 + beq _0812B52C + bl sub_812B5EC + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + beq _0812B52C + ldr r2, [r4] + ldr r1, _0812B554 + lsls r0, r3, 1 + adds r0, r1 + ldrb r1, [r0] + ldrb r0, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] + cmp r3, 0x1 + bne _0812B54A +_0812B52C: + bl sub_812B634 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x5 + beq _0812B54A + ldr r0, _0812B550 + ldr r2, [r0] + ldr r1, _0812B558 + lsls r0, r3, 1 + adds r0, r1 + ldrb r1, [r0] + ldrb r0, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] +_0812B54A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812B550: .4byte 0x0203ab34 +_0812B554: .4byte 0x085a77fe +_0812B558: .4byte 0x085a7804 + thumb_func_end sub_812B4EC + + thumb_func_start sub_812B55C +sub_812B55C: @ 812B55C + push {lr} + ldr r2, _0812B578 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r2, [r2] + ldrb r0, [r2, 0x4] + cmp r0, 0 + beq _0812B572 + movs r0, 0x1 + strb r0, [r2, 0x6] +_0812B572: + pop {r0} + bx r0 + .align 2, 0 +_0812B578: .4byte 0x0203ab34 + thumb_func_end sub_812B55C + + thumb_func_start sub_812B57C +sub_812B57C: @ 812B57C + push {r4,lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0 + movs r3, 0x1 + ldr r4, _0812B598 +_0812B588: + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _0812B59C + adds r0, r2, r4 + ldrb r0, [r0] + b _0812B5AA + .align 2, 0 +_0812B598: .4byte 0x085a77f6 +_0812B59C: + lsrs r1, 1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0812B588 + movs r0, 0 +_0812B5AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812B57C + + thumb_func_start sub_812B5B0 +sub_812B5B0: @ 812B5B0 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0812B5DC + ldr r1, _0812B5E0 + ldr r1, [r1] + movs r3, 0x12 + ldrsh r2, [r1, r3] + ldrb r3, [r1, 0x1] + lsls r1, r3, 1 + adds r1, r3 + subs r1, 0x1 + adds r2, r1 + adds r2, r4 + ldrb r1, [r2] + cmp r1, r0 + bhi _0812B5E4 + movs r0, 0 + b _0812B5E6 + .align 2, 0 +_0812B5DC: .4byte 0x085a76c0 +_0812B5E0: .4byte 0x0203ab34 +_0812B5E4: + movs r0, 0x1 +_0812B5E6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812B5B0 + + thumb_func_start sub_812B5EC +sub_812B5EC: @ 812B5EC + push {r4-r6,lr} + movs r5, 0 + ldr r6, _0812B62C +_0812B5F2: + bl GenerateRandomNumber + movs r2, 0xFF + ldr r1, _0812B630 + ldr r3, [r1] + lsls r1, r5, 16 + asrs r4, r1, 16 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 1 + ldrb r3, [r3, 0x1] + adds r1, r3 + adds r1, r6 + ldrb r1, [r1] + ands r2, r0 + cmp r1, r2 + bgt _0812B620 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0812B5F2 +_0812B620: + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0812B62C: .4byte 0x085a76d2 +_0812B630: .4byte 0x0203ab34 + thumb_func_end sub_812B5EC + + thumb_func_start sub_812B634 +sub_812B634: @ 812B634 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, _0812B678 + mov r8, r0 + movs r7, 0x80 + lsls r7, 17 +_0812B644: + bl GenerateRandomNumber + movs r5, 0xFF + ands r5, r0 + ldr r0, _0812B67C + ldr r4, [r0] + lsls r2, r6, 16 + asrs r1, r2, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + ldrb r3, [r4, 0x1] + adds r0, r3 + add r0, r8 + ldrb r3, [r0] + cmp r1, 0 + bne _0812B680 + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _0812B680 + adds r3, 0xA + asrs r0, r7, 16 + cmp r3, r0 + ble _0812B69E + adds r3, r0, 0 + b _0812B69E + .align 2, 0 +_0812B678: .4byte 0x085a76e4 +_0812B67C: .4byte 0x0203ab34 +_0812B680: + asrs r0, r2, 16 + cmp r0, 0x4 + bne _0812B69E + ldr r0, _0812B6C4 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + bne _0812B69E + lsls r0, r3, 16 + ldr r1, _0812B6C8 + adds r0, r1 + lsrs r3, r0, 16 + cmp r0, 0 + bge _0812B69E + movs r3, 0 +_0812B69E: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r5 + bgt _0812B6B4 + movs r3, 0x80 + lsls r3, 9 + adds r0, r2, r3 + lsrs r6, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812B644 +_0812B6B4: + lsls r0, r6, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0812B6C4: .4byte 0x0203ab34 +_0812B6C8: .4byte 0xfff60000 + thumb_func_end sub_812B634 + + thumb_func_start sub_812B6CC +sub_812B6CC: @ 812B6CC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _0812B6E0 + ldr r2, [r0] + ldrb r0, [r2, 0x3] + cmp r0, 0 + beq _0812B6E8 + ldr r0, _0812B6E4 + b _0812B6EA + .align 2, 0 +_0812B6E0: .4byte 0x0203ab34 +_0812B6E4: .4byte 0x085a7768 +_0812B6E8: + ldr r0, _0812B6FC +_0812B6EA: + lsls r1, r3, 4 + adds r1, r3 + ldrb r2, [r2, 0x2] + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_0812B6FC: .4byte 0x085a7702 + thumb_func_end sub_812B6CC + + thumb_func_start sub_812B700 +sub_812B700: @ 812B700 + push {r4-r6,lr} + ldr r0, _0812B724 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x5] + bl GenerateRandomNumber + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl sub_812B6CC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _0812B754 + movs r6, 0x5 + b _0812B72E + .align 2, 0 +_0812B724: .4byte 0x0203ab34 +_0812B728: + subs r0, r5, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0812B72E: + lsls r0, r6, 16 + asrs r5, r0, 16 + cmp r5, 0 + ble _0812B74E + bl GenerateRandomNumber + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_812B6CC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcs _0812B728 +_0812B74E: + ldr r0, _0812B75C + ldr r0, [r0] + strb r6, [r0, 0x5] +_0812B754: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812B75C: .4byte 0x0203ab34 + thumb_func_end sub_812B700 + + thumb_func_start sub_812B760 +sub_812B760: @ 812B760 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + ldr r0, _0812B780 + lsls r4, 1 + adds r4, r0 + ldrh r4, [r4] + cmp r1, r4 + bcc _0812B784 + movs r0, 0 + b _0812B786 + .align 2, 0 +_0812B780: .4byte 0x085a77ce +_0812B784: + movs r0, 0x1 +_0812B786: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812B760 + + thumb_func_start dp15_jump_random_unknown +dp15_jump_random_unknown: @ 812B78C + push {r4,r5,lr} + movs r4, 0 + ldr r0, _0812B7A4 + ldr r0, [r0] + movs r2, 0x10 + ldrsh r1, [r0, r2] + ldr r0, _0812B7A8 + cmp r1, r0 + ble _0812B7AC + movs r4, 0x4 + b _0812B7C2 + .align 2, 0 +_0812B7A4: .4byte 0x0203ab34 +_0812B7A8: .4byte 0x0000012b +_0812B7AC: + cmp r1, 0xF9 + ble _0812B7B4 + movs r4, 0x3 + b _0812B7C2 +_0812B7B4: + cmp r1, 0xC7 + ble _0812B7BC + movs r4, 0x2 + b _0812B7C2 +_0812B7BC: + cmp r1, 0x95 + ble _0812B7C2 + movs r4, 0x1 +_0812B7C2: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r5, _0812B7E4 + lsls r4, 2 + adds r0, r4, r5 + ldrb r0, [r0] + cmp r1, r0 + bcs _0812B7E8 + movs r0, 0x4 + b _0812B822 + .align 2, 0 +_0812B7E4: .4byte 0x085a77d8 +_0812B7E8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + adds r2, r5, 0x2 + adds r2, r4, r2 + ldr r3, _0812B818 + ldr r1, _0812B81C + ldr r1, [r1] + ldrb r1, [r1, 0xB] + lsls r1, 1 + adds r1, r3 + ldrb r1, [r1] + ldrb r2, [r2] + adds r1, r2 + lsls r1, 24 + cmp r0, r1 + bcc _0812B820 + movs r0, 0x8 + b _0812B822 + .align 2, 0 +_0812B818: .4byte 0x085a77ec +_0812B81C: .4byte 0x0203ab34 +_0812B820: + movs r0, 0x2 +_0812B822: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end dp15_jump_random_unknown + + thumb_func_start sub_812B828 +sub_812B828: @ 812B828 + push {r4,lr} + ldr r4, _0812B858 + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0x8] + bl sub_812B85C + ldr r0, [r4] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + ble _0812B844 + bl sub_812B8D0 +_0812B844: + ldr r0, [r4] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + ble _0812B852 + bl sub_812B9A0 +_0812B852: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812B858: .4byte 0x0203ab34 + thumb_func_end sub_812B828 + + thumb_func_start sub_812B85C +sub_812B85C: @ 812B85C + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x2 + bl sub_812BC44 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + movs r1, 0x2 + bl sub_812BC44 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + movs r1, 0x2 + bl sub_812BC44 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B8BC + ldr r0, _0812B8C4 + ldr r2, [r0] + ldr r0, _0812B8C8 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, _0812B8CC + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] + movs r0, 0 + bl sub_812CF34 +_0812B8BC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812B8C4: .4byte 0x0203ab34 +_0812B8C8: .4byte 0x085a7828 +_0812B8CC: .4byte 0x085a7816 + thumb_func_end sub_812B85C + + thumb_func_start sub_812B8D0 +sub_812B8D0: @ 812B8D0 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B930 + cmp r1, 0 + bne _0812B90C + movs r1, 0x1 +_0812B90C: + ldr r0, _0812B994 + ldr r2, [r0] + ldr r0, _0812B998 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, _0812B99C + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] + movs r0, 0x1 + bl sub_812CF34 +_0812B930: + movs r0, 0 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B98E + cmp r1, 0 + bne _0812B96A + movs r1, 0x1 +_0812B96A: + ldr r0, _0812B994 + ldr r2, [r0] + ldr r0, _0812B998 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, _0812B99C + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] + movs r0, 0x2 + bl sub_812CF34 +_0812B98E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812B994: .4byte 0x0203ab34 +_0812B998: .4byte 0x085a7828 +_0812B99C: .4byte 0x085a7816 + thumb_func_end sub_812B8D0 + + thumb_func_start sub_812B9A0 +sub_812B9A0: @ 812B9A0 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x2 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B9FE + cmp r1, 0 + beq _0812B9F8 + ldr r0, _0812BA60 + ldr r2, [r0] + ldr r0, _0812BA64 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, _0812BA68 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] +_0812B9F8: + movs r0, 0x3 + bl sub_812CF34 +_0812B9FE: + movs r0, 0 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x2 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812BA5A + cmp r1, 0 + beq _0812BA54 + ldr r0, _0812BA60 + ldr r2, [r0] + ldr r0, _0812BA64 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, _0812BA68 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] +_0812BA54: + movs r0, 0x4 + bl sub_812CF34 +_0812BA5A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812BA60: .4byte 0x0203ab34 +_0812BA64: .4byte 0x085a7828 +_0812BA68: .4byte 0x085a7816 + thumb_func_end sub_812B9A0 + + thumb_func_start sub_812BA6C +sub_812BA6C: @ 812BA6C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r3, r1 + bne _0812BA90 + cmp r3, r2 + bne _0812BA90 + ldr r0, _0812BA8C + adds r0, r3, r0 + ldrb r0, [r0] + b _0812BAB6 + .align 2, 0 +_0812BA8C: .4byte 0x085a780e +_0812BA90: + cmp r3, 0 + bne _0812BA9C + cmp r1, 0 + bne _0812BA9C + cmp r2, 0x1 + beq _0812BAA8 +_0812BA9C: + cmp r3, 0x1 + bne _0812BAAC + cmp r1, 0x1 + bne _0812BAAC + cmp r2, 0 + bne _0812BAAC +_0812BAA8: + movs r0, 0x6 + b _0812BAB6 +_0812BAAC: + cmp r3, 0x4 + beq _0812BAB4 + movs r0, 0x9 + b _0812BAB6 +_0812BAB4: + movs r0, 0 +_0812BAB6: + pop {r1} + bx r1 + thumb_func_end sub_812BA6C + + thumb_func_start sub_812BABC +sub_812BABC: @ 812BABC + push {r4,lr} + ldr r4, _0812BAD8 + adds r0, r4, 0 + movs r1, 0x4 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812BAD8: .4byte sub_812BAFC + 1 + thumb_func_end sub_812BABC + + thumb_func_start sub_812BADC +sub_812BADC: @ 812BADC + push {lr} + ldr r0, _0812BAF0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0812BAF4 + movs r0, 0 + b _0812BAF6 + .align 2, 0 +_0812BAF0: .4byte sub_812BAFC + 1 +_0812BAF4: + movs r0, 0x1 +_0812BAF6: + pop {r1} + bx r1 + thumb_func_end sub_812BADC + + thumb_func_start sub_812BAFC +sub_812BAFC: @ 812BAFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0812BB2C + ldr r2, _0812BB30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0812BB0E: + 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 _0812BB0E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812BB2C: .4byte 0x085a74c4 +_0812BB30: .4byte 0x03005e00 + thumb_func_end sub_812BAFC + + thumb_func_start sub_812BB34 +sub_812BB34: @ 812BB34 + push {r4,lr} + adds r4, r0, 0 + bl sub_812CF6C + lsls r0, 24 + cmp r0, 0 + beq _0812BB60 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, _0812BB5C + ldr r0, [r0] + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0812BB60 + movs r0, 0x2 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _0812BB62 + .align 2, 0 +_0812BB5C: .4byte 0x0203ab34 +_0812BB60: + movs r0, 0 +_0812BB62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812BB34 + + thumb_func_start sub_812BB68 +sub_812BB68: @ 812BB68 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812BBBC + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _0812BB8E + movs r0, 0x15 + bl audio_play +_0812BB8E: + ldr r0, _0812BC10 + ldr r2, [r0] + ldrh r0, [r2, 0xE] + subs r0, 0x1 + strh r0, [r2, 0xE] + ldrh r3, [r2, 0xC] + movs r0, 0xC + ldrsh r1, [r2, r0] + ldr r0, _0812BC14 + cmp r1, r0 + bgt _0812BBA8 + adds r0, r3, 0x1 + strh r0, [r2, 0xC] +_0812BBA8: + movs r0, 0x8 + strh r0, [r4, 0xA] + ldr r0, _0812BC18 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812BBBC + movs r0, 0x4 + strh r0, [r4, 0xA] +_0812BBBC: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _0812BBF6 + ldr r0, _0812BC18 + ldrh r1, [r0, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0812BBF6 + movs r0, 0x15 + bl audio_play + ldr r1, _0812BC10 + ldr r2, [r1] + ldrh r0, [r2, 0xE] + ldrh r3, [r2, 0xC] + adds r0, r3 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + ldr r3, _0812BC1C + cmp r0, r3 + ble _0812BBF0 + strh r3, [r2, 0xC] +_0812BBF0: + ldr r1, [r1] + movs r0, 0 + strh r0, [r1, 0xE] +_0812BBF6: + ldr r0, _0812BC10 + ldr r0, [r0] + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0812BC08 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812BC08: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812BC10: .4byte 0x0203ab34 +_0812BC14: .4byte 0x0000270e +_0812BC18: .4byte 0x030022c0 +_0812BC1C: .4byte 0x0000270f + thumb_func_end sub_812BB68 + + thumb_func_start sub_812BC20 +sub_812BC20: @ 812BC20 + push {lr} + bl sub_812CFB8 + lsls r0, 24 + cmp r0, 0 + beq _0812BC3A + ldr r0, _0812BC40 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0812BC3A: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812BC40: .4byte sub_812BAFC + 1 + thumb_func_end sub_812BC20 + + thumb_func_start sub_812BC44 +sub_812BC44: @ 812BC44 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r0, _0812BC90 + ldr r0, [r0] + lsls r2, r4, 1 + adds r0, 0x28 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + lsls r1, 16 + asrs r1, 16 + adds r0, r1 + movs r1, 0x15 + bl __modsi3 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0812BC76 + adds r0, 0x15 + lsls r0, 16 + lsrs r1, r0, 16 +_0812BC76: + ldr r2, _0812BC94 + lsls r1, 16 + asrs r1, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r0, r4 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812BC90: .4byte 0x0203ab34 +_0812BC94: .4byte 0x085a766e + thumb_func_end sub_812BC44 + + thumb_func_start sub_812BC98 +sub_812BC98: @ 812BC98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r6, 0 + ldr r0, _0812BCE0 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + beq _0812BCC2 + ldr r6, _0812BCE4 +_0812BCC2: + lsls r1, r5, 16 + asrs r1, 16 + lsls r0, r6, 16 + asrs r0, 16 + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_812BC44 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0812BCE0: .4byte 0x0203ab34 +_0812BCE4: .4byte 0x0000ffff + thumb_func_end sub_812BC98 + + thumb_func_start sub_812BCE8 +sub_812BCE8: @ 812BCE8 + push {lr} + ldr r1, _0812BD20 + ldr r1, [r1] + movs r2, 0x16 + ldrsh r1, [r1, r2] + lsls r0, 16 + asrs r0, 16 + adds r1, r0 + adds r0, r1, 0 + movs r1, 0x6 + bl __modsi3 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0812BD10 + adds r0, 0x6 + lsls r0, 16 + lsrs r1, r0, 16 +_0812BD10: + ldr r0, _0812BD24 + lsls r1, 16 + asrs r1, 16 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_0812BD20: .4byte 0x0203ab34 +_0812BD24: .4byte 0x085a76ad + thumb_func_end sub_812BCE8 + + thumb_func_start sub_812BD28 +sub_812BD28: @ 812BD28 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + ldr r0, _0812BD6C + ldr r6, [r0] + lsrs r5, 23 + adds r4, r6, 0 + adds r4, 0x1C + adds r4, r5 + lsls r1, 16 + asrs r1, 16 + ldrh r0, [r4] + adds r1, r0 + strh r1, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0xFC + lsls r1, 1 + bl __modsi3 + strh r0, [r4] + adds r6, 0x28 + adds r6, r5 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl __divsi3 + movs r1, 0x15 + subs r1, r0 + strh r1, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812BD6C: .4byte 0x0203ab34 + thumb_func_end sub_812BD28 + + thumb_func_start sub_812BD70 +sub_812BD70: @ 812BD70 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r7, _0812BDD0 + ldr r0, [r7] + lsls r6, r5, 1 + adds r0, 0x1C + adds r0, r6 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 16 + asrs r1, r2, 16 + cmp r1, 0 + beq _0812BDC4 + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + bge _0812BDA6 + lsrs r4, r2, 16 +_0812BDA6: + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_812BD28 + ldr r0, [r7] + adds r0, 0x1C + adds r0, r6 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 +_0812BDC4: + lsls r0, 16 + asrs r0, 16 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0812BDD0: .4byte 0x0203ab34 + thumb_func_end sub_812BD70 + + thumb_func_start sub_812BDD4 +sub_812BDD4: @ 812BDD4 + push {r4,lr} + ldr r1, _0812BE08 + ldr r4, [r1] + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4, 0x14] + adds r0, r1 + strh r0, [r4, 0x14] + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl __modsi3 + strh r0, [r4, 0x14] + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl __divsi3 + movs r1, 0x6 + subs r1, r0 + strh r1, [r4, 0x16] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812BE08: .4byte 0x0203ab34 + thumb_func_end sub_812BDD4 + + thumb_func_start sub_812BE0C +sub_812BE0C: @ 812BE0C + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, _0812BE58 + ldr r0, [r5] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 16 + asrs r1, r2, 16 + cmp r1, 0 + beq _0812BE4E + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + bge _0812BE36 + lsrs r4, r2, 16 +_0812BE36: + lsls r0, r4, 16 + asrs r0, 16 + bl sub_812BDD4 + ldr r0, [r5] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 +_0812BE4E: + lsls r0, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0812BE58: .4byte 0x0203ab34 + thumb_func_end sub_812BE0C + + thumb_func_start sub_812BE5C +sub_812BE5C: @ 812BE5C + push {r4-r6,lr} + movs r4, 0 + ldr r5, _0812BE98 + ldr r6, _0812BE9C +_0812BE64: + adds r0, r5, 0 + movs r1, 0x2 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + strh r4, [r1, 0x26] + ldr r1, _0812BEA0 + ldr r1, [r1] + adds r1, 0x3A + adds r1, r4 + strb r0, [r1] + bl _call_via_r5 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0812BE64 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812BE98: .4byte sub_812BF2C + 1 +_0812BE9C: .4byte 0x03005e00 +_0812BEA0: .4byte 0x0203ab34 + thumb_func_end sub_812BE5C + + thumb_func_start sub_812BEA4 +sub_812BEA4: @ 812BEA4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0812BED4 + ldr r1, _0812BED8 + ldr r2, [r1] + adds r2, 0x3A + adds r2, r0 + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0x1 + strh r3, [r0, 0x8] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r3, [r0, 0x24] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812BED4: .4byte 0x03005e00 +_0812BED8: .4byte 0x0203ab34 + thumb_func_end sub_812BEA4 + + thumb_func_start sub_812BEDC +sub_812BEDC: @ 812BEDC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812BEFC + ldr r1, _0812BF00 + ldr r1, [r1] + adds r1, 0x3A + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + bx lr + .align 2, 0 +_0812BEFC: .4byte 0x03005e00 +_0812BF00: .4byte 0x0203ab34 + thumb_func_end sub_812BEDC + + thumb_func_start sub_812BF04 +sub_812BF04: @ 812BF04 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812BF24 + ldr r1, _0812BF28 + ldr r1, [r1] + adds r1, 0x3A + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x24] + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_0812BF24: .4byte 0x03005e00 +_0812BF28: .4byte 0x0203ab34 + thumb_func_end sub_812BF04 + + thumb_func_start sub_812BF2C +sub_812BF2C: @ 812BF2C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0812BF5C + ldr r2, _0812BF60 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0812BF3E: + 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 _0812BF3E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812BF5C: .4byte 0x085a74d0 +_0812BF60: .4byte 0x03005e00 + thumb_func_end sub_812BF2C + + thumb_func_start sub_812BF64 +sub_812BF64: @ 812BF64 + movs r0, 0 + bx lr + thumb_func_end sub_812BF64 + + thumb_func_start sub_812BF68 +sub_812BF68: @ 812BF68 + push {lr} + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0812BF84 + ldr r1, [r1] + movs r2, 0x1A + ldrsh r1, [r1, r2] + bl sub_812BD28 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0812BF84: .4byte 0x0203ab34 + thumb_func_end sub_812BF68 + + thumb_func_start sub_812BF88 +sub_812BF88: @ 812BF88 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x8] + ldr r0, _0812C010 + ldr r3, [r0] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x34 + adds r0, r1 + strh r2, [r0] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x2E + adds r0, r1 + strh r2, [r0] + ldrb r0, [r3, 0xA] + cmp r0, 0 + bne _0812BFF4 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _0812BFDC + ldrb r0, [r3, 0x6] + cmp r0, 0 + beq _0812BFDC + ldr r1, _0812C014 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + cmp r0, 0 + bne _0812BFF4 +_0812BFDC: + ldr r0, _0812C010 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r1, _0812C018 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0812BFF4: + ldr r0, _0812C010 + ldr r1, [r0] + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r1, 0x2E + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4, 0xA] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812C010: .4byte 0x0203ab34 +_0812C014: .4byte 0x085a74e4 +_0812C018: .4byte 0x085a74f0 + thumb_func_end sub_812BF88 + + thumb_func_start sub_812C01C +sub_812C01C: @ 812C01C + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, _0812C060 + mov r0, sp + movs r2, 0xA + bl memcpy + ldr r7, _0812C064 + ldr r5, [r7] + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r6, r0, 1 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r6 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, 0 + beq _0812C068 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x1A + ldrsh r1, [r5, r6] + bl sub_812BD70 + b _0812C0A0 + .align 2, 0 +_0812C060: .4byte 0x085a74fc +_0812C064: .4byte 0x0203ab34 +_0812C068: + adds r0, r5, 0 + adds r0, 0x2E + adds r1, r0, r6 + ldrh r3, [r1] + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0 + beq _0812C0A4 + subs r0, r3, 0x1 + strh r0, [r1] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1A + ldrsh r1, [r5, r2] + bl sub_812BD28 + ldr r1, [r7] + movs r6, 0x26 + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r1, 0x1C + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r1, 0x18 + bl __modsi3 +_0812C0A0: + lsls r0, 16 + lsrs r2, r0, 16 +_0812C0A4: + cmp r2, 0 + bne _0812C0D2 + ldr r0, _0812C0DC + ldr r1, [r0] + movs r6, 0x26 + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r1, 0x2E + adds r1, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + cmp r1, 0 + bne _0812C0D2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] +_0812C0D2: + movs r0, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0812C0DC: .4byte 0x0203ab34 + thumb_func_end sub_812C01C + + thumb_func_start sub_812C0E0 +sub_812C0E0: @ 812C0E0 + push {r4,lr} + adds r2, r0, 0 + ldr r4, _0812C134 + ldr r1, [r4] + movs r3, 0x26 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r1, 0x22 + adds r1, r0 + ldrh r0, [r2, 0xA] + strh r0, [r1] + ldrh r0, [r2, 0xA] + negs r3, r0 + strh r3, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0812C110 + lsls r0, r3, 16 + asrs r0, 17 + strh r0, [r2, 0xA] +_0812C110: + movs r0, 0xA + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _0812C12A + strh r3, [r2, 0x8] + strh r3, [r2, 0x24] + ldr r1, [r4] + movs r4, 0x26 + ldrsh r0, [r2, r4] + lsls r0, 1 + adds r1, 0x22 + adds r1, r0 + strh r3, [r1] +_0812C12A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812C134: .4byte 0x0203ab34 + thumb_func_end sub_812C0E0 + + thumb_func_start sub_812C138 +sub_812C138: @ 812C138 + push {r4,r5,lr} + ldr r4, _0812C17C + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl sub_812B57C + lsls r0, 24 + lsrs r3, r0, 24 + adds r5, r3, 0 + ldr r4, [r4] + ldrb r1, [r4, 0x4] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0812C15A + movs r5, 0 + movs r3, 0x1 +_0812C15A: + ldr r1, _0812C180 + movs r2, 0x12 + ldrsh r0, [r4, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r3, 0 + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0812C17C: .4byte 0x0203ab34 +_0812C180: .4byte 0x085a7508 + thumb_func_end sub_812C138 + + thumb_func_start sub_812C184 +sub_812C184: @ 812C184 + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 16 + asrs r3, 16 + movs r0, 0 + adds r1, r3, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, r4 + beq _0812C1AC + cmp r0, r5 + bne _0812C1BC +_0812C1AC: + ldr r0, _0812C1B8 + ldr r0, [r0] + strb r1, [r0, 0x7] + movs r0, 0x1 + b _0812C1BE + .align 2, 0 +_0812C1B8: .4byte 0x0203ab34 +_0812C1BC: + movs r0, 0 +_0812C1BE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_812C184 + + thumb_func_start sub_812C1C4 +sub_812C1C4: @ 812C1C4 + push {r4,lr} + movs r1, 0x1 + lsls r0, 16 + asrs r4, r0, 16 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _0812C20C + movs r1, 0x2 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _0812C20C + movs r1, 0x3 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0812C210 +_0812C20C: + movs r0, 0x1 + b _0812C212 +_0812C210: + movs r0, 0 +_0812C212: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812C1C4 + + thumb_func_start sub_812C218 +sub_812C218: @ 812C218 + push {lr} + ldr r0, _0812C22C + ldr r0, [r0] + ldrb r1, [r0, 0x4] + movs r0, 0xC2 + ands r0, r1 + cmp r0, 0 + bne _0812C230 + movs r0, 0 + b _0812C232 + .align 2, 0 +_0812C22C: .4byte 0x0203ab34 +_0812C230: + movs r0, 0x1 +_0812C232: + pop {r1} + bx r1 + thumb_func_end sub_812C218 + + thumb_func_start sub_812C238 +sub_812C238: @ 812C238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + movs r0, 0x2 + mov r8, r0 +_0812C24C: + lsls r0, r5, 16 + asrs r4, r0, 16 + mov r1, r8 + subs r0, r1, r4 + lsls r0, 16 + asrs r0, 16 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_812C184 + lsls r0, 24 + cmp r0, 0 + beq _0812C278 + ldr r0, _0812C274 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x34] + strh r5, [r1, 0x2E] + movs r0, 0x1 + b _0812C286 + .align 2, 0 +_0812C274: .4byte 0x0203ab34 +_0812C278: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C24C + movs r0, 0 +_0812C286: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C238 + + thumb_func_start sub_812C290 +sub_812C290: @ 812C290 + 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 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + bl sub_812C218 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0812C2BE + movs r0, 0 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C2F4 +_0812C2BE: + movs r7, 0x1 + movs r6, 0 +_0812C2C2: + lsls r0, r7, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + mov r1, r9 + mov r2, r8 + bl sub_812C184 + lsls r0, 24 + cmp r0, 0 + beq _0812C2E8 + ldr r0, _0812C2E4 + ldr r0, [r0] + strh r7, [r0, 0x34] + strh r6, [r0, 0x2E] + movs r0, 0x1 + b _0812C390 + .align 2, 0 +_0812C2E4: .4byte 0x0203ab34 +_0812C2E8: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812C2C2 +_0812C2F4: + movs r7, 0x1 + adds r6, r5, 0 + ldr r0, _0812C348 + mov r10, r0 +_0812C2FC: + lsls r5, r7, 16 + cmp r6, 0 + bne _0812C30E + asrs r0, r5, 16 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C380 +_0812C30E: + movs r0, 0x1 + asrs r4, r5, 16 + subs r0, r4 + lsls r0, 16 + asrs r0, 16 + mov r1, r9 + mov r2, r8 + bl sub_812C184 + lsls r0, 24 + cmp r0, 0 + beq _0812C380 + cmp r4, 0x1 + bne _0812C34C + cmp r6, 0 + bne _0812C33A + movs r0, 0x3 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C34C +_0812C33A: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x34] + strh r0, [r1, 0x2E] + movs r0, 0x1 + b _0812C390 + .align 2, 0 +_0812C348: .4byte 0x0203ab34 +_0812C34C: + asrs r0, r5, 16 + cmp r0, 0x3 + bgt _0812C374 + adds r4, r0, 0x1 + cmp r6, 0 + bne _0812C366 + lsls r0, r4, 16 + asrs r0, 16 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C374 +_0812C366: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x34] + strh r4, [r1, 0x2E] + movs r0, 0x1 + b _0812C390 +_0812C374: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x34] + strh r7, [r1, 0x2E] + b _0812C390 +_0812C380: + movs r1, 0x80 + lsls r1, 9 + adds r0, r5, r1 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C2FC + movs r0, 0 +_0812C390: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C290 + + thumb_func_start sub_812C3A0 +sub_812C3A0: @ 812C3A0 + push {lr} + ldr r1, _0812C3C0 + ldr r0, _0812C3C4 + ldr r0, [r0] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0812C3C0: .4byte 0x085a7514 +_0812C3C4: .4byte 0x0203ab34 + thumb_func_end sub_812C3A0 + + thumb_func_start sub_812C3C8 +sub_812C3C8: @ 812C3C8 + push {r4-r7,lr} + ldr r0, _0812C3FC + ldr r0, [r0] + movs r5, 0 + ldrh r7, [r0, 0x34] + movs r1, 0x34 + ldrsh r6, [r0, r1] +_0812C3D6: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldr r1, _0812C3FC + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1, 0x7] + cmp r0, r2 + bne _0812C400 + strh r7, [r1, 0x36] + strh r5, [r1, 0x30] + movs r0, 0x1 + b _0812C40E + .align 2, 0 +_0812C3FC: .4byte 0x0203ab34 +_0812C400: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C3D6 + movs r0, 0 +_0812C40E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C3C8 + + thumb_func_start sub_812C414 +sub_812C414: @ 812C414 + push {r4-r6,lr} + bl sub_812C3C8 + lsls r0, 24 + cmp r0, 0 + beq _0812C476 + ldr r0, _0812C468 + ldr r1, [r0] + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _0812C472 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _0812C472 + cmp r0, 0x4 + beq _0812C472 + movs r5, 0 + movs r6, 0x2 +_0812C43C: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldr r1, _0812C468 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1, 0x7] + cmp r0, r2 + beq _0812C46C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C43C + b _0812C472 + .align 2, 0 +_0812C468: .4byte 0x0203ab34 +_0812C46C: + movs r0, 0x2 + strh r0, [r1, 0x36] + strh r5, [r1, 0x30] +_0812C472: + movs r0, 0x1 + b _0812C4B2 +_0812C476: + ldr r0, _0812C4B8 + ldr r0, [r0] + movs r1, 0x34 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _0812C4B0 + movs r5, 0 + movs r6, 0x2 +_0812C486: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldr r1, _0812C4B8 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1, 0x7] + cmp r0, r2 + beq _0812C46C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C486 +_0812C4B0: + movs r0, 0 +_0812C4B2: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0812C4B8: .4byte 0x0203ab34 + thumb_func_end sub_812C414 + + thumb_func_start sub_812C4BC +sub_812C4BC: @ 812C4BC + push {r4,lr} + ldr r2, _0812C4F8 + ldr r0, [r2] + ldrb r3, [r0, 0x7] + adds r4, r3, 0 + ldrb r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0812C4D8 + movs r3, 0 + cmp r4, 0 + bne _0812C4D8 + movs r3, 0x1 +_0812C4D8: + ldr r1, _0812C4FC + ldr r0, [r2] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r3, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812C4F8: .4byte 0x0203ab34 +_0812C4FC: .4byte 0x085a7520 + thumb_func_end sub_812C4BC + + thumb_func_start sub_812C500 +sub_812C500: @ 812C500 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0812C540 + ldr r0, [r0] + movs r5, 0 + ldrh r1, [r0, 0x36] + mov r8, r1 + movs r1, 0x36 + ldrsh r6, [r0, r1] +_0812C518: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r7 + bne _0812C544 + ldr r0, _0812C540 + ldr r0, [r0] + mov r1, r8 + strh r1, [r0, 0x38] + strh r5, [r0, 0x32] + movs r0, 0x1 + b _0812C552 + .align 2, 0 +_0812C540: .4byte 0x0203ab34 +_0812C544: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C518 + movs r0, 0 +_0812C552: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C500 + + thumb_func_start sub_812C55C +sub_812C55C: @ 812C55C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0812C584 + ldr r0, [r0] + movs r2, 0x34 + ldrsh r1, [r0, r2] + movs r2, 0x36 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _0812C59C + adds r0, r6, 0 + bl sub_812C500 + lsls r0, 24 + lsrs r0, 24 + b _0812C5D2 + .align 2, 0 +_0812C584: .4byte 0x0203ab34 +_0812C588: + ldr r0, _0812C598 + ldr r0, [r0] + strh r5, [r0, 0x32] + mov r1, r8 + strh r1, [r0, 0x38] + movs r0, 0x1 + b _0812C5D2 + .align 2, 0 +_0812C598: .4byte 0x0203ab34 +_0812C59C: + movs r2, 0x1 + mov r8, r2 + cmp r1, 0x1 + bne _0812C5A8 + movs r0, 0x3 + mov r8, r0 +_0812C5A8: + movs r5, 0 + mov r7, r8 +_0812C5AC: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + beq _0812C588 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C5AC + movs r0, 0 +_0812C5D2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C55C + + thumb_func_start sub_812C5DC +sub_812C5DC: @ 812C5DC + push {r4,r5,lr} + movs r5, 0 + b _0812C5E8 +_0812C5E2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0812C5E8: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C5E2 + ldr r0, _0812C604 + ldr r0, [r0] + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812C604: .4byte 0x0203ab34 + thumb_func_end sub_812C5DC + + thumb_func_start sub_812C608 +sub_812C608: @ 812C608 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _0812C616 + movs r0, 0x1 + b _0812C620 +_0812C616: + cmp r0, 0x1 + beq _0812C61E + movs r0, 0 + b _0812C624 +_0812C61E: + movs r0, 0 +_0812C620: + strb r0, [r1] + movs r0, 0x1 +_0812C624: + pop {r1} + bx r1 + thumb_func_end sub_812C608 + + thumb_func_start sub_812C628 +sub_812C628: @ 812C628 + push {lr} + ldr r1, _0812C644 + ldr r0, _0812C648 + ldr r0, [r0] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_0812C644: .4byte 0x085a752c +_0812C648: .4byte 0x0203ab34 + thumb_func_end sub_812C628 + + thumb_func_start sub_812C64C +sub_812C64C: @ 812C64C + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, _0812C6B4 + ldr r2, [r0] + movs r1, 0x34 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812C6C4 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C6C4 + ldrh r0, [r2, 0x2E] + movs r1, 0x2 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + mov r1, sp + strb r0, [r1] + mov r0, sp + bl sub_812C608 + lsls r0, 24 + cmp r0, 0 + beq _0812C6C4 + movs r5, 0 + mov r6, sp + movs r7, 0x2 +_0812C68C: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldrb r1, [r6] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0812C6B8 + ldr r0, _0812C6B4 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x36] + strh r5, [r1, 0x30] + b _0812C6C4 + .align 2, 0 +_0812C6B4: .4byte 0x0203ab34 +_0812C6B8: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C68C +_0812C6C4: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812C64C + + thumb_func_start j5_08111E84 +j5_08111E84: @ 812C6CC + push {r4-r7,lr} + sub sp, 0x4 + ldr r4, _0812C734 + ldr r2, [r4] + ldrh r3, [r2, 0x34] + movs r1, 0x34 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812C744 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C744 + ldrh r1, [r2, 0x2E] + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + mov r1, sp + strb r0, [r1] + mov r0, sp + bl sub_812C608 + lsls r0, 24 + cmp r0, 0 + beq _0812C744 + movs r5, 0 + mov r7, sp + adds r6, r4, 0 +_0812C70C: + ldr r0, [r6] + ldrh r1, [r0, 0x34] + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldrb r1, [r7] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0812C738 + ldr r0, [r6] + ldrh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r5, [r0, 0x30] + b _0812C744 + .align 2, 0 +_0812C734: .4byte 0x0203ab34 +_0812C738: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C70C +_0812C744: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end j5_08111E84 + + thumb_func_start sub_812C74C +sub_812C74C: @ 812C74C + push {r4-r7,lr} + sub sp, 0x4 + ldr r6, _0812C774 + ldr r2, [r6] + ldrh r4, [r2, 0x34] + movs r0, 0x34 + ldrsh r3, [r2, r0] + cmp r3, 0 + beq _0812C84A + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C84A + cmp r3, 0x2 + bne _0812C796 + bl j5_08111E84 + b _0812C84A + .align 2, 0 +_0812C774: .4byte 0x0203ab34 +_0812C778: + ldr r0, _0812C784 + ldr r0, [r0] + movs r1, 0 + strh r5, [r0, 0x36] + strh r1, [r0, 0x30] + b _0812C84A + .align 2, 0 +_0812C784: .4byte 0x0203ab34 +_0812C788: + movs r0, 0x2 + strh r0, [r1, 0x36] + adds r0, r4, 0x1 + strh r0, [r1, 0x30] + b _0812C84A +_0812C792: + movs r0, 0x3 + b _0812C824 +_0812C796: + ldrh r1, [r2, 0x2E] + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + mov r1, sp + strb r0, [r1] + mov r0, sp + bl sub_812C608 + lsls r0, 24 + cmp r0, 0 + beq _0812C84A + movs r5, 0x2 + ldr r0, [r6] + movs r1, 0x34 + ldrsh r0, [r0, r1] + cmp r0, 0x3 + bne _0812C7C2 + movs r5, 0x3 +_0812C7C2: + movs r6, 0 + mov r7, sp +_0812C7C6: + lsls r0, r5, 16 + asrs r4, r0, 16 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_812BC98 + ldrb r1, [r7] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _0812C778 + lsls r1, r6, 16 + movs r2, 0x80 + lsls r2, 9 + adds r1, r2 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + lsrs r6, r1, 16 + asrs r1, 16 + cmp r1, 0x1 + ble _0812C7C6 + movs r5, 0x1 + mov r7, sp + ldr r6, _0812C82C +_0812C7F8: + ldr r0, [r6] + ldrh r1, [r0, 0x34] + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldrb r1, [r7] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0812C83E + ldr r1, [r6] + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0812C830 + cmp r4, 0x2 + ble _0812C788 +_0812C824: + strh r0, [r1, 0x36] + strh r5, [r1, 0x30] + b _0812C84A + .align 2, 0 +_0812C82C: .4byte 0x0203ab34 +_0812C830: + cmp r4, 0x2 + ble _0812C792 + movs r0, 0x2 + strh r0, [r1, 0x36] + subs r0, r4, 0x1 + strh r0, [r1, 0x30] + b _0812C84A +_0812C83E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C7F8 +_0812C84A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812C74C + + thumb_func_start sub_812C854 +sub_812C854: @ 812C854 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r0, 0 + bne _0812C868 + cmp r1, 0x1 + beq _0812C870 +_0812C868: + cmp r0, 0x1 + bne _0812C874 + cmp r2, 0 + bne _0812C874 +_0812C870: + movs r0, 0x1 + b _0812C876 +_0812C874: + movs r0, 0 +_0812C876: + pop {r1} + bx r1 + thumb_func_end sub_812C854 + + thumb_func_start sub_812C87C +sub_812C87C: @ 812C87C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r0, 0 + bne _0812C896 + cmp r1, 0x1 + bne _0812C896 + cmp r2, 0 + beq _0812C8A2 +_0812C896: + cmp r0, 0x1 + bne _0812C8A6 + cmp r1, 0 + bne _0812C8A6 + cmp r2, 0x1 + bne _0812C8A6 +_0812C8A2: + movs r0, 0x1 + b _0812C8A8 +_0812C8A6: + movs r0, 0 +_0812C8A8: + pop {r1} + bx r1 + thumb_func_end sub_812C87C + + thumb_func_start sub_812C8AC +sub_812C8AC: @ 812C8AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r0, 0 + bne _0812C8C6 + cmp r1, 0x1 + bne _0812C8C6 + cmp r2, 0 + beq _0812C8F2 +_0812C8C6: + cmp r0, 0x1 + bne _0812C8D2 + cmp r1, 0 + bne _0812C8D2 + cmp r2, 0x1 + beq _0812C8F2 +_0812C8D2: + cmp r0, 0 + bne _0812C8DE + cmp r1, 0 + bne _0812C8DE + cmp r2, 0x1 + beq _0812C8F2 +_0812C8DE: + cmp r0, 0x1 + bne _0812C8EA + cmp r1, 0x1 + bne _0812C8EA + cmp r2, 0 + beq _0812C8F2 +_0812C8EA: + cmp r0, r1 + bne _0812C8F6 + cmp r0, r2 + bne _0812C8F6 +_0812C8F2: + movs r0, 0 + b _0812C8F8 +_0812C8F6: + movs r0, 0x1 +_0812C8F8: + pop {r1} + bx r1 + thumb_func_end sub_812C8AC + + thumb_func_start sub_812C8FC +sub_812C8FC: @ 812C8FC + push {lr} + ldr r1, _0812C918 + ldr r0, _0812C91C + ldr r0, [r0] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_0812C918: .4byte 0x085a7538 +_0812C91C: .4byte 0x0203ab34 + thumb_func_end sub_812C8FC + + thumb_func_start sub_812C920 +sub_812C920: @ 812C920 + push {r4-r7,lr} + movs r6, 0 + ldr r7, _0812C95C + ldr r0, [r7] + ldrh r1, [r0, 0x2E] + movs r4, 0x2 + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x30] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r5, r1 + bne _0812C994 + movs r4, 0x2 + b _0812C96A + .align 2, 0 +_0812C95C: .4byte 0x0203ab34 +_0812C960: + lsls r0, r6, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r6, r0, 16 +_0812C96A: + lsls r1, r6, 16 + asrs r1, 16 + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0812C960 + cmp r5, 0 + bne _0812C98A + cmp r0, 0x1 + beq _0812C960 +_0812C98A: + cmp r5, 0x1 + bne _0812C9F6 + cmp r0, 0 + beq _0812C960 + b _0812C9F6 +_0812C994: + adds r0, r5, 0 + bl sub_812C854 + lsls r0, 24 + cmp r0, 0 + beq _0812C9F6 + ldr r0, [r7] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C9D2 + movs r7, 0x2 +_0812C9AE: + lsls r0, r6, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0812C9F6 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C9AE +_0812C9D2: + movs r6, 0 + movs r7, 0x2 + b _0812C9DE +_0812C9D8: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0812C9DE: + lsls r0, r6, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0812C9D8 +_0812C9F6: + ldr r0, _0812CA04 + ldr r0, [r0] + strh r6, [r0, 0x32] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812CA04: .4byte 0x0203ab34 + thumb_func_end sub_812C920 + + thumb_func_start sub_812CA08 +sub_812CA08: @ 812CA08 + 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] + ldr r4, _0812CA74 + ldr r2, [r4] + movs r5, 0x36 + ldrsh r1, [r2, r5] + cmp r1, 0 + beq _0812CAA4 + ldrh r3, [r2, 0x34] + movs r5, 0x34 + ldrsh r0, [r2, r5] + cmp r0, r1 + bne _0812CAA4 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812CAA4 + ldrh r1, [r2, 0x2E] + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r4] + ldrh r1, [r0, 0x36] + ldrh r0, [r0, 0x30] + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_812C854 + lsls r0, 24 + cmp r0, 0 + beq _0812CAA4 + movs r5, 0 + b _0812CA7E + .align 2, 0 +_0812CA74: .4byte 0x0203ab34 +_0812CA78: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0812CA7E: + lsls r6, r5, 16 + asrs r5, r6, 16 + cmp r5, 0x4 + bgt _0812CAA4 + ldr r0, _0812CB38 + ldr r0, [r0] + ldrh r1, [r0, 0x36] + subs r1, r5 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r7, r4 + bne _0812CA78 + lsrs r6, 16 + str r6, [sp] +_0812CAA4: + ldr r0, _0812CB38 + mov r9, r0 +_0812CAA8: + movs r5, 0x1 + movs r1, 0 + mov r8, r1 + ldr r2, [sp] + lsls r2, 16 + mov r10, r2 +_0812CAB4: + mov r1, r9 + ldr r0, [r1] + ldrh r1, [r0, 0x2E] + lsls r5, 16 + asrs r4, r5, 16 + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r7, r0, 24 + mov r2, r9 + ldr r0, [r2] + ldrh r1, [r0, 0x30] + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r10 + asrs r0, r1, 16 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x2 + adds r1, r4, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812C8AC + lsls r0, 24 + cmp r0, 0 + bne _0812CB3C + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812C87C + lsls r0, 24 + cmp r0, 0 + beq _0812CB28 + mov r2, r9 + ldr r0, [r2] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812CB3C +_0812CB28: + mov r5, r8 + lsls r0, r5, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r0, 16 + mov r8, r0 + b _0812CB4A + .align 2, 0 +_0812CB38: .4byte 0x0203ab34 +_0812CB3C: + movs r2, 0x80 + lsls r2, 9 + adds r0, r5, r2 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812CAB4 +_0812CB4A: + mov r5, r8 + cmp r5, 0 + beq _0812CB60 + ldr r1, [sp] + lsls r0, r1, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r0, 16 + str r0, [sp] + b _0812CAA8 +_0812CB60: + ldr r0, _0812CB7C + ldr r0, [r0] + mov r5, sp + ldrh r5, [r5] + strh r5, [r0, 0x32] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812CB7C: .4byte 0x0203ab34 + thumb_func_end sub_812CA08 + + thumb_func_start sub_812CB80 +sub_812CB80: @ 812CB80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_812CA08 + ldr r4, _0812CC24 + ldr r2, [r4] + movs r0, 0x36 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _0812CC34 + ldrh r3, [r2, 0x34] + movs r5, 0x34 + ldrsh r0, [r2, r5] + cmp r0, r1 + beq _0812CC34 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812CC34 + ldrh r1, [r2, 0x2E] + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r4] + ldrh r1, [r0, 0x36] + ldrh r0, [r0, 0x30] + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_812C854 + lsls r0, 24 + cmp r0, 0 + beq _0812CC34 + movs r1, 0x1 + ldr r0, [r4] + movs r2, 0x34 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + bne _0812CBEE + movs r1, 0x3 +_0812CBEE: + movs r3, 0 + lsls r1, 16 + mov r8, r1 + adds r7, r4, 0 +_0812CBF6: + ldr r0, [r7] + ldrh r2, [r0, 0x32] + lsls r0, r3, 16 + asrs r5, r0, 16 + adds r2, r5, r2 + mov r0, r8 + asrs r1, r0, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r6, r4 + bne _0812CC28 + ldr r1, [r7] + ldrh r0, [r1, 0x32] + adds r0, r5, r0 + strh r0, [r1, 0x32] + b _0812CC34 + .align 2, 0 +_0812CC24: .4byte 0x0203ab34 +_0812CC28: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812CBF6 +_0812CC34: + ldr r7, _0812CCB0 +_0812CC36: + ldr r0, [r7] + ldrh r0, [r0, 0x2E] + movs r1, 0x1 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x30] + movs r1, 0x2 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x32] + movs r1, 0x3 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C8AC + lsls r0, 24 + cmp r0, 0 + bne _0812CCB4 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C87C + lsls r0, 24 + cmp r0, 0 + beq _0812CCA4 + ldr r0, [r7] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812CCB4 +_0812CCA4: + ldr r1, [r7] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + b _0812CC36 + .align 2, 0 +_0812CCB0: .4byte 0x0203ab34 +_0812CCB4: + ldr r7, _0812CD30 +_0812CCB6: + ldr r0, [r7] + ldrh r0, [r0, 0x2E] + movs r1, 0x3 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x30] + movs r1, 0x2 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x32] + movs r1, 0x1 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C8AC + lsls r0, 24 + cmp r0, 0 + bne _0812CD34 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C87C + lsls r0, 24 + cmp r0, 0 + beq _0812CD24 + ldr r0, [r7] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812CD34 +_0812CD24: + ldr r1, [r7] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + b _0812CCB6 + .align 2, 0 +_0812CD30: .4byte 0x0203ab34 +_0812CD34: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812CB80 + + thumb_func_start sub_812CD40 +sub_812CD40: @ 812CD40 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0812CD6C + adds r0, r5, 0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812CD70 + 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 + .align 2, 0 +_0812CD6C: .4byte sub_812CD74 + 1 +_0812CD70: .4byte 0x03005e00 + thumb_func_end sub_812CD40 + + thumb_func_start sub_812CD74 +sub_812CD74: @ 812CD74 + push {r4,lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _0812CD9C + ldr r2, _0812CDA0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r4, 0x8 + ldrsh r2, [r0, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812CD9C: .4byte 0x085a7544 +_0812CDA0: .4byte 0x03005e00 + thumb_func_end sub_812CD74 + + thumb_func_start sub_812CDA4 +sub_812CDA4: @ 812CDA4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, _0812CDD4 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x73 + str r1, [sp] + movs r1, 0x62 + movs r2, 0x63 + movs r3, 0x72 + bl sub_812FA78 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812CDD4: .4byte 0x085a7550 + thumb_func_end sub_812CDA4 + + thumb_func_start sub_812CDD8 +sub_812CDD8: @ 812CDD8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _0812CDF0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0812CDF0: + pop {r0} + bx r0 + thumb_func_end sub_812CDD8 + + thumb_func_start sub_812CDF4 +sub_812CDF4: @ 812CDF4 + push {r4,lr} + sub sp, 0x4 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, _0812CE28 + movs r2, 0x26 + ldrsh r0, [r0, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x53 + str r1, [sp] + movs r1, 0x42 + movs r2, 0x43 + movs r3, 0x52 + bl sub_812FA78 + adds r0, r4, 0 + bl remove_task + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812CE28: .4byte 0x085a7550 + thumb_func_end sub_812CDF4 + + thumb_func_start sub_812CE2C +sub_812CE2C: @ 812CE2C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812CE4C + lsls r1, r0, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, _0812CE50 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + movs r2, 0x2 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0812CE4C: .4byte 0x085a8408 +_0812CE50: .4byte 0x085a8430 + thumb_func_end sub_812CE2C + + thumb_func_start sub_812CE54 +sub_812CE54: @ 812CE54 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812CE74 + lsls r1, r0, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, _0812CE78 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + movs r2, 0x2 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0812CE74: .4byte 0x085a841c +_0812CE78: .4byte 0x085a8430 + thumb_func_end sub_812CE54 + + thumb_func_start sub_812CE7C +sub_812CE7C: @ 812CE7C + push {r4-r7,lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + ldr r0, _0812CEB0 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r4, r0 + bcs _0812CEA8 + ldr r7, _0812CEB4 + adds r6, r0, 0 + lsls r5, r1, 1 +_0812CE94: + adds r0, r4, r5 + adds r0, r7 + ldrb r0, [r0] + bl sub_812CE2C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0812CE94 +_0812CEA8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812CEB0: .4byte 0x085a843b +_0812CEB4: .4byte 0x085a8435 + thumb_func_end sub_812CE7C + + thumb_func_start sub_812CEB8 +sub_812CEB8: @ 812CEB8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + ldr r0, _0812CEEC + adds r0, r1, r0 + ldrb r0, [r0] + cmp r4, r0 + bcs _0812CEE4 + ldr r7, _0812CEF0 + adds r6, r0, 0 + lsls r5, r1, 1 +_0812CED0: + adds r0, r4, r5 + adds r0, r7 + ldrb r0, [r0] + bl sub_812CE54 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0812CED0 +_0812CEE4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812CEEC: .4byte 0x085a843b +_0812CEF0: .4byte 0x085a8435 + thumb_func_end sub_812CEB8 + + thumb_func_start sub_812CEF4 +sub_812CEF4: @ 812CEF4 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _0812CF28 +_0812CEFA: + ldr r0, _0812CF2C + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + strh r4, [r1, 0x2E] + ldr r1, _0812CF30 + ldr r1, [r1] + adds r1, 0x44 + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0812CEFA + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812CF28: .4byte 0x02020630 +_0812CF2C: .4byte sub_812D024 + 1 +_0812CF30: .4byte 0x0203ab34 + thumb_func_end sub_812CEF4 + + thumb_func_start sub_812CF34 +sub_812CF34: @ 812CF34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0812CF64 + ldr r1, [r1] + adds r1, 0x44 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812CF68 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x30] + movs r1, 0x4 + strh r1, [r0, 0x32] + strh r2, [r0, 0x34] + strh r2, [r0, 0x36] + movs r1, 0x2 + strh r1, [r0, 0x38] + strh r2, [r0, 0x3C] + bx lr + .align 2, 0 +_0812CF64: .4byte 0x0203ab34 +_0812CF68: .4byte 0x02020630 + thumb_func_end sub_812CF34 + + thumb_func_start sub_812CF6C +sub_812CF6C: @ 812CF6C + push {r4,r5,lr} + movs r2, 0 + ldr r0, _0812CF9C + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x44 + ldr r4, _0812CFA0 +_0812CF7A: + adds r0, r3, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + movs r5, 0x30 + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _0812CFA4 + movs r5, 0x32 + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _0812CFA4 + movs r0, 0 + b _0812CFB0 + .align 2, 0 +_0812CF9C: .4byte 0x0203ab34 +_0812CFA0: .4byte 0x02020630 +_0812CFA4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0812CF7A + movs r0, 0x1 +_0812CFB0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_812CF6C + + thumb_func_start sub_812CFB8 +sub_812CFB8: @ 812CFB8 + push {r4,lr} + movs r4, 0 +_0812CFBC: + ldr r0, _0812CFD4 + ldr r0, [r0] + adds r0, 0x44 + adds r0, r4 + ldrb r0, [r0] + bl sub_812CFEC + lsls r0, 24 + cmp r0, 0 + bne _0812CFD8 + movs r0, 0 + b _0812CFE4 + .align 2, 0 +_0812CFD4: .4byte 0x0203ab34 +_0812CFD8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0812CFBC + movs r0, 0x1 +_0812CFE4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812CFB8 + + thumb_func_start sub_812CFEC +sub_812CFEC: @ 812CFEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _0812D008 + adds r1, r0 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0812D00C + movs r0, 0x1 + b _0812D01E + .align 2, 0 +_0812D008: .4byte 0x02020630 +_0812D00C: + ldrh r2, [r1, 0x3C] + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0812D01A + movs r0, 0 + strh r0, [r1, 0x30] +_0812D01A: + lsls r0, r2, 24 + lsrs r0, 24 +_0812D01E: + pop {r1} + bx r1 + thumb_func_end sub_812CFEC + + thumb_func_start sub_812D024 +sub_812D024: @ 812D024 + push {r4-r7,lr} + adds r2, r0, 0 + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812D0A6 + ldrh r0, [r2, 0x34] + subs r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812D08E + movs r0, 0 + strh r0, [r2, 0x3C] + movs r6, 0x1 + strh r6, [r2, 0x34] + ldrh r1, [r2, 0x38] + ldrh r3, [r2, 0x36] + adds r0, r1, r3 + strh r0, [r2, 0x36] + movs r4, 0x4 + ldrh r5, [r2, 0x32] + movs r7, 0x32 + ldrsh r3, [r2, r7] + cmp r3, 0 + beq _0812D060 + movs r4, 0x8 +_0812D060: + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bgt _0812D078 + strh r6, [r2, 0x3C] + negs r0, r1 + strh r0, [r2, 0x38] + cmp r3, 0 + beq _0812D08E + subs r0, r5, 0x1 + strh r0, [r2, 0x32] + b _0812D080 +_0812D078: + cmp r0, r4 + blt _0812D080 + negs r0, r1 + strh r0, [r2, 0x38] +_0812D080: + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812D08E + ldrh r0, [r2, 0x34] + lsls r0, 1 + strh r0, [r2, 0x34] +_0812D08E: + ldr r1, _0812D0AC + movs r3, 0x2E + ldrsh r0, [r2, r3] + adds r0, r1 + ldrb r0, [r0] + ldrh r3, [r2, 0x36] + lsls r3, 24 + lsrs r3, 24 + adds r1, r3, 0 + adds r2, r3, 0 + bl sub_80B6128 +_0812D0A6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812D0AC: .4byte 0x085a8430 + thumb_func_end sub_812D024 + + thumb_func_start sub_812D0B0 +sub_812D0B0: @ 812D0B0 + push {r4,lr} + ldr r4, _0812D0D8 + adds r0, r4, 0 + movs r1, 0x6 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812D0DC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x1 + strh r2, [r1, 0xE] + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812D0D8: .4byte sub_812D128 + 1 +_0812D0DC: .4byte 0x03005e00 + thumb_func_end sub_812D0B0 + + thumb_func_start sub_812D0E0 +sub_812D0E0: @ 812D0E0 + push {lr} + ldr r0, _0812D104 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0812D108 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812D10C + movs r0, 0 + b _0812D120 + .align 2, 0 +_0812D104: .4byte sub_812D128 + 1 +_0812D108: .4byte 0x03005e00 +_0812D10C: + adds r0, r2, 0 + bl remove_task + ldr r0, _0812D124 + ldr r0, [r0] + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x1 +_0812D120: + pop {r1} + bx r1 + .align 2, 0 +_0812D124: .4byte 0x085a84ac + thumb_func_end sub_812D0E0 + + thumb_func_start sub_812D128 +sub_812D128: @ 812D128 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0812D180 + adds r2, r1, r0 + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812D166 + movs r0, 0x4 + strh r0, [r2, 0xA] + ldrh r1, [r2, 0xE] + ldrh r3, [r2, 0xC] + adds r0, r1, r3 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _0812D162 + cmp r0, 0x2 + bne _0812D166 +_0812D162: + negs r0, r1 + strh r0, [r2, 0xE] +_0812D166: + ldr r0, _0812D184 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0812D180: .4byte 0x03005e00 +_0812D184: .4byte 0x085a84a0 + thumb_func_end sub_812D128 + + thumb_func_start sub_812D188 +sub_812D188: @ 812D188 + push {lr} + ldr r0, _0812D1A0 + movs r1, 0x8 + bl AddTask + ldr r1, _0812D1A4 + ldr r1, [r1] + adds r1, 0x3E + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0812D1A0: .4byte sub_812D230 + 1 +_0812D1A4: .4byte 0x0203ab34 + thumb_func_end sub_812D188 + + thumb_func_start sub_812D1A8 +sub_812D1A8: @ 812D1A8 + push {r4,lr} + ldr r0, _0812D1D4 + ldr r0, [r0] + adds r0, 0x3E + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0812D1D8 + adds r4, r0 + adds r0, r4, 0 + bl sub_812D394 + movs r1, 0x1 + strh r1, [r4, 0x8] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + strh r1, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812D1D4: .4byte 0x0203ab34 +_0812D1D8: .4byte 0x03005e00 + thumb_func_end sub_812D1A8 + + thumb_func_start sub_812D1DC +sub_812D1DC: @ 812D1DC + push {r4,lr} + ldr r0, _0812D204 + ldr r0, [r0] + adds r0, 0x3E + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0812D208 + adds r4, r0 + adds r0, r4, 0 + bl sub_812D394 + movs r0, 0x3 + strh r0, [r4, 0x8] + movs r0, 0x1 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812D204: .4byte 0x0203ab34 +_0812D208: .4byte 0x03005e00 + thumb_func_end sub_812D1DC + + thumb_func_start sub_812D20C +sub_812D20C: @ 812D20C + ldr r2, _0812D228 + ldr r0, _0812D22C + ldr r0, [r0] + adds r0, 0x3E + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_0812D228: .4byte 0x03005e00 +_0812D22C: .4byte 0x0203ab34 + thumb_func_end sub_812D20C + + thumb_func_start sub_812D230 +sub_812D230: @ 812D230 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _0812D258 + ldr r2, _0812D25C + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0812D258: .4byte 0x085a7558 +_0812D25C: .4byte 0x03005e00 + thumb_func_end sub_812D230 + + thumb_func_start nullsub_50 +nullsub_50: @ 812D260 + bx lr + thumb_func_end nullsub_50 + + thumb_func_start sub_812D264 +sub_812D264: @ 812D264 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + lsls r0, 19 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + asrs r0, 16 + movs r1, 0x14 + bl sub_812EF00 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D264 + + thumb_func_start sub_812D28C +sub_812D28C: @ 812D28C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _0812D2C0 + movs r0, 0xC + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812D2FC + ldrh r1, [r4, 0xA] + adds r0, r1, 0x2 + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + movs r2, 0 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x1 + bne _0812D2C4 + movs r3, 0x1 + movs r2, 0x1 + b _0812D2CC + .align 2, 0 +_0812D2C0: .4byte 0x02020630 +_0812D2C4: + cmp r1, 0x10 + bne _0812D2CC + movs r3, 0x2 + movs r2, 0x2 +_0812D2CC: + ldr r0, _0812D304 + ldr r0, [r0] + lsls r1, r2, 1 + adds r1, r0 + ldr r2, _0812D308 + lsls r0, r3, 2 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + lsls r3, r5, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + ldrb r0, [r4, 0xC] + bl sub_812EF6C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x26] +_0812D2FC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812D304: .4byte 0x0203aacc +_0812D308: .4byte 0x085a7568 + thumb_func_end sub_812D28C + + thumb_func_start sub_812D30C +sub_812D30C: @ 812D30C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0xA] + adds r0, r1, 0x2 + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + movs r2, 0x3 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x1 + bne _0812D32A + movs r3, 0x1 + movs r2, 0x1 + b _0812D332 +_0812D32A: + cmp r1, 0x10 + bne _0812D332 + movs r3, 0x2 + movs r2, 0x2 +_0812D332: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0812D366 + ldr r0, _0812D38C + ldr r0, [r0] + lsls r1, r2, 1 + adds r1, r0 + ldr r0, _0812D390 + lsls r2, r3, 2 + adds r0, 0x2 + adds r2, r0 + ldrh r0, [r2] + strh r0, [r1] + lsls r3, r5, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_0812D366: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0812D378 + movs r0, 0 + strh r0, [r4, 0xC] +_0812D378: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0812D384 + strh r0, [r4, 0x8] + strh r0, [r4, 0x26] +_0812D384: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812D38C: .4byte 0x0203aacc +_0812D390: .4byte 0x085a7568 + thumb_func_end sub_812D30C + + thumb_func_start sub_812D394 +sub_812D394: @ 812D394 + push {lr} + movs r1, 0x2 + adds r2, r0, 0 + adds r2, 0x8 + movs r3, 0 +_0812D39E: + lsls r0, r1, 1 + adds r0, r2, r0 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0812D39E + pop {r0} + bx r0 + thumb_func_end sub_812D394 + + thumb_func_start sub_812D3B4 +sub_812D3B4: @ 812D3B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0x3 + movs r5, 0 + cmp r5, r6 + bge _0812D41E + ldr r7, _0812D3D8 +_0812D3C4: + movs r3, 0 + movs r1, 0 + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0 + bne _0812D3DC + movs r3, 0x1 + movs r1, 0x1 + b _0812D3E4 + .align 2, 0 +_0812D3D8: .4byte 0x085a7568 +_0812D3DC: + cmp r0, 0xF + bne _0812D3E4 + movs r3, 0x2 + movs r1, 0x2 +_0812D3E4: + ldr r0, _0812D438 + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + lsls r0, r3, 2 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + lsls r3, r4, 16 + asrs r4, r3, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + lsls r0, r5, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r6 + blt _0812D3C4 +_0812D41E: + lsls r2, r5, 16 + asrs r0, r2, 16 + cmp r0, 0xF + bgt _0812D484 + ldr r7, _0812D43C +_0812D428: + movs r3, 0 + movs r1, 0x3 + asrs r0, r2, 16 + cmp r0, 0 + bne _0812D440 + movs r3, 0x1 + movs r1, 0x1 + b _0812D448 + .align 2, 0 +_0812D438: .4byte 0x0203aacc +_0812D43C: .4byte 0x085a756a +_0812D440: + cmp r0, 0xF + bne _0812D448 + movs r3, 0x2 + movs r1, 0x2 +_0812D448: + ldr r0, _0812D4A0 + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + lsls r0, r3, 2 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + lsls r3, r4, 16 + asrs r4, r3, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + lsls r0, r5, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r5, r0, 16 + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + lsls r2, r5, 16 + asrs r0, r2, 16 + cmp r0, 0xF + ble _0812D428 +_0812D484: + ldr r2, _0812D4A4 + ldr r0, _0812D4A8 + ldr r0, [r0] + adds r0, 0x3E + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0xA] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812D4A0: .4byte 0x0203aacc +_0812D4A4: .4byte 0x03005e00 +_0812D4A8: .4byte 0x0203ab34 + thumb_func_end sub_812D3B4 + + thumb_func_start sub_812D4AC +sub_812D4AC: @ 812D4AC + push {r4,lr} + ldr r4, _0812D4C8 + adds r0, r4, 0 + movs r1, 0x7 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812D4C8: .4byte sub_812D4EC + 1 + thumb_func_end sub_812D4AC + + thumb_func_start sub_812D4CC +sub_812D4CC: @ 812D4CC + push {lr} + ldr r0, _0812D4E0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0812D4E4 + movs r0, 0 + b _0812D4E6 + .align 2, 0 +_0812D4E0: .4byte sub_812D4EC + 1 +_0812D4E4: + movs r0, 0x1 +_0812D4E6: + pop {r1} + bx r1 + thumb_func_end sub_812D4CC + + thumb_func_start sub_812D4EC +sub_812D4EC: @ 812D4EC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _0812D514 + ldr r2, _0812D518 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0812D514: .4byte 0x085a7574 +_0812D518: .4byte 0x03005e00 + thumb_func_end sub_812D4EC + + thumb_func_start sub_812D51C +sub_812D51C: @ 812D51C + push {lr} + ldr r3, _0812D588 + ldr r1, [r3] + movs r2, 0 + strb r2, [r1, 0xA] + ldr r1, [r3] + strh r2, [r1, 0x14] + strh r2, [r1, 0x16] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + movs r1, 0x1E + strh r1, [r0, 0xC] + movs r1, 0xA0 + lsls r1, 3 + strh r1, [r0, 0x10] + ldr r0, _0812D58C + strh r2, [r0] + ldr r0, _0812D590 + strh r2, [r0] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl sub_812DC08 + bl sub_812E474 + bl sub_812E33C + bl sub_812E650 + bl sub_812E70C + bl sub_812E7CC + bl sub_812B700 + bl sub_80A2F30 + movs r0, 0xC4 + lsls r0, 1 + bl current_map_music_set + pop {r0} + bx r0 + .align 2, 0 +_0812D588: .4byte 0x0203ab34 +_0812D58C: .4byte 0x02021bbc +_0812D590: .4byte 0x02021bbe + thumb_func_end sub_812D51C + + thumb_func_start sub_812D594 +sub_812D594: @ 812D594 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, _0812D604 + ldrh r0, [r1] + subs r0, 0x8 + strh r0, [r1] + ldrh r1, [r4, 0xA] + adds r1, 0x8 + strh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r0, 0xF0 + movs r2, 0xFF + ands r0, r2 + lsrs r5, r0, 3 + ldr r0, _0812D608 + ands r1, r0 + movs r0, 0x14 + bl lcd_io_set + adds r2, r5, 0 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r2, r0 + beq _0812D5E2 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bgt _0812D5E2 + strh r5, [r4, 0xC] + ldrh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 19 + strh r0, [r4, 0xE] + movs r0, 0xE + ldrsh r1, [r4, r0] + adds r0, r2, 0 + bl sub_812DC08 +_0812D5E2: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xC7 + ble _0812D5F4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xE] +_0812D5F4: + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812D604: .4byte 0x02021bbc +_0812D608: .4byte 0x000001ff + thumb_func_end sub_812D594 + + thumb_func_start sub_812D60C +sub_812D60C: @ 812D60C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _0812D636 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl sub_812E934 + bl sub_812EAB0 +_0812D636: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D60C + + thumb_func_start sub_812D63C +sub_812D63C: @ 812D63C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r7, r0, 0 + ldr r1, _0812D6D8 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r0, sp, 0x4 + mov r8, r0 + ldr r1, _0812D6DC + movs r2, 0x8 + bl memcpy + add r6, sp, 0xC + ldr r1, _0812D6E0 + adds r0, r6, 0 + movs r2, 0x8 + bl memcpy + ldrh r0, [r7, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrh r0, [r7, 0x10] + subs r0, 0x4 + strh r0, [r7, 0x10] + lsls r0, 16 + asrs r0, 24 + movs r5, 0x4 + subs r5, r0 + lsls r4, r5, 1 + add r8, r4 + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + bl sub_812EA44 + adds r6, r4 + movs r1, 0 + ldrsh r0, [r6, r1] + bl sub_812EBAC + ldr r0, _0812D6E4 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812D6E8 + adds r0, r1 + mov r2, sp + adds r1, r2, r5 + ldrb r1, [r1] + bl obj_anim_image_start_if_different + movs r1, 0x10 + ldrsh r0, [r7, r1] + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + bgt _0812D6CC + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + strh r1, [r7, 0x10] + movs r0, 0 + strh r0, [r7, 0x12] +_0812D6CC: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812D6D8: .4byte 0x085a75c0 +_0812D6DC: .4byte 0x085a75c4 +_0812D6E0: .4byte 0x085a75cc +_0812D6E4: .4byte 0x0203ab34 +_0812D6E8: .4byte 0x02020630 + thumb_func_end sub_812D63C + + thumb_func_start sub_812D6EC +sub_812D6EC: @ 812D6EC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4F + ble _0812D730 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0x12] + movs r0, 0x2 + bl sub_812EBAC + ldr r0, _0812D738 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812D73C + adds r0, r1 + movs r1, 0x3 + bl obj_anim_image_start_if_different +_0812D730: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812D738: .4byte 0x0203ab34 +_0812D73C: .4byte 0x02020630 + thumb_func_end sub_812D6EC + + thumb_func_start sub_812D740 +sub_812D740: @ 812D740 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrb r0, [r4, 0x10] + adds r0, 0x80 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4F + ble _0812D76C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0x12] +_0812D76C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D740 + + thumb_func_start sub_812D774 +sub_812D774: @ 812D774 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrb r0, [r4, 0x10] + adds r0, 0x40 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _0812D7DC + movs r0, 0 + strh r0, [r4, 0x12] + ldr r0, _0812D7B4 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _0812D7B8 + ldrb r1, [r1, 0xA] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bgt _0812D7D6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + b _0812D7D4 + .align 2, 0 +_0812D7B4: .4byte 0x0203ab34 +_0812D7B8: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _0812D7C6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + b _0812D7D4 +_0812D7C6: + ldrh r0, [r4, 0x14] + bl sub_812B760 + lsls r0, 24 + cmp r0, 0 + beq _0812D7D6 + movs r0, 0xE +_0812D7D4: + strh r0, [r4, 0x8] +_0812D7D6: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] +_0812D7DC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D774 + + thumb_func_start sub_812D7E4 +sub_812D7E4: @ 812D7E4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _0812D80C + ldr r0, [r6] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r0, 0 + beq _0812D810 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BE0C + b _0812D838 + .align 2, 0 +_0812D80C: .4byte 0x0203ab34 +_0812D810: + movs r0, 0x1 + bl sub_812BCE8 + ldr r1, [r6] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x5] + cmp r0, r1 + beq _0812D842 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldr r0, [r6] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 +_0812D838: + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r4, 0x10] + adds r0, 0x40 + strh r0, [r4, 0x10] +_0812D842: + lsls r0, r5, 16 + asrs r5, r0, 16 + cmp r5, 0 + bne _0812D866 + movs r0, 0x1 + bl sub_812BCE8 + ldr r1, _0812D86C + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x5] + cmp r0, r1 + bne _0812D866 + strh r5, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812D866: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812D86C: .4byte 0x0203ab34 + thumb_func_end sub_812D7E4 + + thumb_func_start sub_812D870 +sub_812D870: @ 812D870 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + movs r6, 0 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _0812D914 + bl sub_80A2F30 + bl sub_812EA7C + bl sub_812EBCC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r5, _0812D8C4 + ldr r1, [r5] + ldrb r0, [r1, 0x5] + cmp r0, 0 + bne _0812D8D0 + movs r0, 0xA0 + strh r0, [r4, 0x10] + adds r0, r1, 0 + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812D8C8 + adds r0, r1 + movs r1, 0x5 + bl obj_anim_image_start_if_different + ldr r0, _0812D8CC + bl fanfare_play + b _0812D914 + .align 2, 0 +_0812D8C4: .4byte 0x0203ab34 +_0812D8C8: .4byte 0x02020630 +_0812D8CC: .4byte 0x00000187 +_0812D8D0: + movs r0, 0xC0 + strh r0, [r4, 0x10] + adds r0, r1, 0 + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0812D91C + adds r0, r4 + movs r1, 0x4 + bl obj_anim_image_start_if_different + ldr r0, [r5] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2B + strb r6, [r0] + ldr r0, [r5] + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0812D90C + bl sub_812D1DC + ldr r0, [r5] + strb r6, [r0, 0x2] +_0812D90C: + movs r0, 0xC3 + lsls r0, 1 + bl fanfare_play +_0812D914: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812D91C: .4byte 0x02020630 + thumb_func_end sub_812D870 + + thumb_func_start sub_812D920 +sub_812D920: @ 812D920 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0812D938 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _0812D948 +_0812D938: + bl sub_812D20C + lsls r0, 24 + cmp r0, 0 + bne _0812D948 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812D948: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D920 + + thumb_func_start sub_812D950 +sub_812D950: @ 812D950 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, _0812D990 + ldrh r0, [r1] + subs r0, 0x8 + strh r0, [r1] + ldrh r1, [r4, 0xA] + adds r1, 0x8 + strh r1, [r4, 0xA] + ldrh r0, [r4, 0xE] + adds r0, 0x8 + strh r0, [r4, 0xE] + movs r2, 0xA + ldrsh r0, [r4, r2] + subs r0, 0x8 + movs r2, 0xFF + ands r0, r2 + lsrs r5, r0, 3 + ldr r0, _0812D994 + ands r1, r0 + movs r0, 0x14 + bl lcd_io_set + ldrh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 19 + cmp r0, 0x19 + bgt _0812D998 + adds r0, r5, 0 + bl sub_812DC50 + b _0812D99E + .align 2, 0 +_0812D990: .4byte 0x02021bbc +_0812D994: .4byte 0x000001ff +_0812D998: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812D99E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812D950 + + thumb_func_start sub_812D9A4 +sub_812D9A4: @ 812D9A4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _0812D9F8 + ldr r0, [r4] + movs r6, 0 + strb r6, [r0, 0xB] + ldr r1, [r4] + ldrb r0, [r1, 0x5] + strb r0, [r1, 0xA] + ldr r0, _0812D9FC + strh r6, [r0] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldr r1, [r4] + movs r0, 0x8 + strh r0, [r1, 0x1A] + bl sub_812E3E8 + bl sub_812E82C + bl sub_812E8C4 + ldr r0, [r4] + adds r0, 0x60 + ldrh r0, [r0] + bl current_map_music_set + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _0812DA04 + ldr r0, _0812DA00 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _0812DA1A + .align 2, 0 +_0812D9F8: .4byte 0x0203ab34 +_0812D9FC: .4byte 0x02021bbc +_0812DA00: .4byte sub_812D4EC + 1 +_0812DA04: + movs r0, 0x4 + bl sub_812DEE4 + bl dp15_jump_random_unknown + strh r0, [r5, 0xA] + strh r6, [r5, 0xC] + strh r6, [r5, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0812DA1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_812D9A4 + + thumb_func_start sub_812DA20 +sub_812DA20: @ 812DA20 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _0812DA3C + ldr r5, [r0] + movs r0, 0x1A + ldrsh r1, [r5, r0] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0812DA40 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0812DA66 + .align 2, 0 +_0812DA3C: .4byte 0x0203ab34 +_0812DA40: + movs r1, 0x1C + ldrsh r0, [r5, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0812DA66 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0812DA66 + ldrh r0, [r5, 0x1A] + lsls r0, 16 + asrs r0, 17 + strh r0, [r5, 0x1A] +_0812DA66: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812DA20 + + thumb_func_start sub_812DA6C +sub_812DA6C: @ 812DA6C + push {lr} + bl sub_812E054 + lsls r0, 24 + cmp r0, 0 + beq _0812DA86 + ldr r0, _0812DA8C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0812DA86: + pop {r0} + bx r0 + .align 2, 0 +_0812DA8C: .4byte sub_812D4EC + 1 + thumb_func_end sub_812DA6C + + thumb_func_start sub_812DA90 +sub_812DA90: @ 812DA90 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_812E82C + bl sub_812EA7C + bl sub_812EBCC + bl sub_812EC20 + ldr r5, _0812DAF8 + ldr r3, _0812DAFC + ldr r0, [r3] + adds r0, 0x4E + ldrb r1, [r0] + 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] + ldr r0, [r3] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x5 + bl obj_anim_image_start_if_different + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + movs r0, 0x4 + strh r0, [r4, 0x10] + strh r1, [r4, 0x12] + bl sub_80A2F30 + ldr r0, _0812DB00 + bl fanfare_play + movs r0, 0xB2 + bl audio_play + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812DAF8: .4byte 0x02020630 +_0812DAFC: .4byte 0x0203ab34 +_0812DB00: .4byte 0x00000187 + thumb_func_end sub_812DA90 + + thumb_func_start sub_812DB04 +sub_812DB04: @ 812DB04 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, _0812DB80 + ldrh r0, [r4, 0x10] + strh r0, [r1] + ldrh r1, [r4, 0x10] + movs r0, 0x16 + bl lcd_io_set + ldrh r1, [r4, 0x12] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812DB26 + ldrh r0, [r4, 0x10] + negs r0, r0 + strh r0, [r4, 0x10] +_0812DB26: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + movs r1, 0x1F + ands r0, r1 + cmp r0, 0 + bne _0812DB3C + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 17 + strh r0, [r4, 0x10] +_0812DB3C: + movs r0, 0x10 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0812DB7A + bl sub_812EC70 + bl sub_812EC94 + bl sub_812E5A8 + bl sub_812EDC0 + ldr r2, _0812DB84 + ldr r0, _0812DB88 + ldr r0, [r0] + adds r0, 0x4E + 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] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0x12] +_0812DB7A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812DB80: .4byte 0x02021bbe +_0812DB84: .4byte 0x02020630 +_0812DB88: .4byte 0x0203ab34 + thumb_func_end sub_812DB04 + + thumb_func_start sub_812DB8C +sub_812DB8C: @ 812DB8C + push {r4,lr} + adds r4, r0, 0 + ldr r1, _0812DBB8 + movs r0, 0 + strh r0, [r1] + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + bl sub_812EEA8 + lsls r0, 24 + cmp r0, 0 + beq _0812DBB2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl sub_812EECC +_0812DBB2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812DBB8: .4byte 0x02021bbe + thumb_func_end sub_812DB8C + + thumb_func_start sub_812DBBC +sub_812DBBC: @ 812DBBC + push {lr} + ldr r1, _0812DBFC + movs r0, 0 + strh r0, [r1] + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldr r0, _0812DC00 + ldr r0, [r0] + adds r0, 0x60 + ldrh r0, [r0] + bl current_map_music_set + bl sub_812E3E8 + bl sub_812E8F8 + bl sub_812E8C4 + bl sub_812ED8C + ldr r0, _0812DC04 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + .align 2, 0 +_0812DBFC: .4byte 0x02021bbc +_0812DC00: .4byte 0x0203ab34 +_0812DC04: .4byte sub_812D4EC + 1 + thumb_func_end sub_812DBBC + + thumb_func_start sub_812DC08 +sub_812DC08: @ 812DC08 + push {r4-r6,lr} + movs r2, 0x4 + lsls r1, 16 + asrs r6, r1, 16 + lsls r0, 16 + asrs r5, r0, 16 +_0812DC14: + lsls r4, r2, 16 + asrs r4, 16 + subs r0, r4, 0x4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6, r1 + lsls r1, 1 + ldr r0, _0812DC4C + adds r1, r0 + lsls r3, r4, 5 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + adds r4, 0x1 + lsls r4, 16 + lsrs r2, r4, 16 + asrs r4, 16 + cmp r4, 0xE + ble _0812DC14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812DC4C: .4byte 0x085a96e0 + thumb_func_end sub_812DC08 + + thumb_func_start sub_812DC50 +sub_812DC50: @ 812DC50 + push {r4,r5,lr} + movs r4, 0x4 + lsls r0, 16 + asrs r5, r0, 16 +_0812DC58: + lsls r3, r4, 5 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + ldr r1, _0812DC7C + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xE + bls _0812DC58 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812DC7C: .4byte 0x085a9898 + thumb_func_end sub_812DC50 + + thumb_func_start sub_812DC80 +sub_812DC80: @ 812DC80 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0812DCAC + adds r0, r5, 0 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812DCB0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812DCAC: .4byte sub_812DCD4 + 1 +_0812DCB0: .4byte 0x03005e00 + thumb_func_end sub_812DC80 + + thumb_func_start sub_812DCB4 +sub_812DCB4: @ 812DCB4 + push {lr} + ldr r0, _0812DCC8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0812DCCC + movs r0, 0 + b _0812DCCE + .align 2, 0 +_0812DCC8: .4byte sub_812DCD4 + 1 +_0812DCCC: + movs r0, 0x1 +_0812DCCE: + pop {r1} + bx r1 + thumb_func_end sub_812DCB4 + + thumb_func_start sub_812DCD4 +sub_812DCD4: @ 812DCD4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _0812DCFC + ldr r2, _0812DD00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0812DCFC: .4byte 0x085a75d4 +_0812DD00: .4byte 0x03005e00 + thumb_func_end sub_812DCD4 + + thumb_func_start sub_812DD04 +sub_812DD04: @ 812DD04 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812DD04 + + thumb_func_start sub_812DD28 +sub_812DD28: @ 812DD28 + push {lr} + adds r2, r0, 0 + ldr r0, _0812DD44 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812DD3E + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0812DD3E: + pop {r0} + bx r0 + .align 2, 0 +_0812DD44: .4byte 0x02037fd4 + thumb_func_end sub_812DD28 + + thumb_func_start sub_812DD48 +sub_812DD48: @ 812DD48 + push {r4,lr} + adds r4, r0, 0 + bl sub_812DFDC + bl sub_812FAF4 + ldr r0, _0812DD74 + bl Window_AddFromTemplate + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812DD74: .4byte 0x085a7444 + thumb_func_end sub_812DD48 + + thumb_func_start sub_812DD78 +sub_812DD78: @ 812DD78 + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + ldr r0, _0812DDBC + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, _0812DDC0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x5 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812DDBC: .4byte 0x085a744c +_0812DDC0: .4byte 0x085ef750 + thumb_func_end sub_812DD78 + + thumb_func_start sub_812DDC4 +sub_812DDC4: @ 812DDC4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, _0812DE10 + ldrh r1, [r0, 0x2E] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0812DE08 + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + bl Window_FillTileMap + movs r0, 0x1 + movs r1, 0x1 + bl Window_CopyToVram + movs r0, 0x1 + bl Window_Remove + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812DE08: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812DE10: .4byte 0x030022c0 + thumb_func_end sub_812DDC4 + + thumb_func_start sub_812DE14 +sub_812DE14: @ 812DE14 + push {r4,lr} + adds r4, r0, 0 + bl sub_812F968 + movs r0, 0x3 + bl gpu_sync_bg_show + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812DE14 + + thumb_func_start sub_812DE30 +sub_812DE30: @ 812DE30 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_812DEE4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812DE30 + + thumb_func_start sub_812DE48 +sub_812DE48: @ 812DE48 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, _0812DE78 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + bl sub_812D3B4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812DE78: .4byte 0x0203ab34 + thumb_func_end sub_812DE48 + + thumb_func_start sub_812DE7C +sub_812DE7C: @ 812DE7C + push {lr} + ldr r0, _0812DE90 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + .align 2, 0 +_0812DE90: .4byte sub_812DCD4 + 1 + thumb_func_end sub_812DE7C + + thumb_func_start sub_812DE94 +sub_812DE94: @ 812DE94 + push {lr} + ldr r0, _0812DED4 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0812DED8 + ldr r0, [r0] + adds r0, 0x3D + strb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0812DEDC + adds r0, r1 + ldr r1, _0812DEE0 + strh r1, [r0, 0xA] + movs r1, 0x4 + adds r2, r0, 0 + adds r2, 0x8 + movs r3, 0x40 +_0812DEC0: + lsls r0, r1, 1 + adds r0, r2, r0 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0812DEC0 + pop {r0} + bx r0 + .align 2, 0 +_0812DED4: .4byte sub_812E0B0 + 1 +_0812DED8: .4byte 0x0203ab34 +_0812DEDC: .4byte 0x03005e00 +_0812DEE0: .4byte 0x0000ffff + thumb_func_end sub_812DE94 + + thumb_func_start sub_812DEE4 +sub_812DEE4: @ 812DEE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_812DFDC + ldr r0, _0812DF5C + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0812DF60 + adds r7, r0, r1 + strh r4, [r7, 0xA] + movs r6, 0 + ldr r1, _0812DF64 + lsls r5, r4, 2 + adds r0, r5, r1 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + beq _0812DF52 + mov r8, r1 +_0812DF1A: + mov r0, r8 + adds r4, r5, r0 + ldr r0, [r4] + lsls r2, r6, 2 + adds r2, r0 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + movs r3, 0x2 + ldrsh r2, [r2, r3] + bl sub_812EF98 + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, 0x4 + lsls r2, 1 + adds r1, r7, 0 + adds r1, 0x8 + adds r1, r2 + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, [r4] + lsls r0, r6, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0812DF1A +_0812DF52: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812DF5C: .4byte 0x0203ab34 +_0812DF60: .4byte 0x03005e00 +_0812DF64: .4byte 0x085a7a04 + thumb_func_end sub_812DEE4 + + thumb_func_start sub_812DF68 +sub_812DF68: @ 812DF68 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r1 + ldr r4, [sp, 0x1C] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0812DFBC + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0812DFC0 + adds r0, r1 + mov r12, r0 + movs r5, 0x4 + lsls r4, 16 + asrs r6, r4, 16 + lsls r2, 16 + lsls r3, 16 +_0812DF96: + lsls r0, r5, 1 + mov r1, r12 + adds r1, 0x8 + adds r4, r1, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0812DFC4 + str r6, [sp] + adds r0, r7, 0 + mov r1, r8 + asrs r2, 16 + asrs r3, 16 + bl sub_812EFDC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + b _0812DFCE + .align 2, 0 +_0812DFBC: .4byte 0x0203ab34 +_0812DFC0: .4byte 0x03005e00 +_0812DFC4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _0812DF96 +_0812DFCE: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812DF68 + + thumb_func_start sub_812DFDC +sub_812DFDC: @ 812DFDC + push {r4-r6,lr} + ldr r0, _0812E040 + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0812E044 + adds r4, r0, r1 + ldrh r1, [r4, 0xA] + ldr r0, _0812E048 + cmp r1, r0 + beq _0812E008 + ldr r0, _0812E04C + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_0812E008: + movs r5, 0x4 + adds r6, r4, 0 + adds r6, 0x8 +_0812E00E: + lsls r0, r5, 1 + adds r4, r6, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _0812E02E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E050 + adds r0, r1 + bl obj_delete_and_free_tiles + movs r0, 0x40 + strh r0, [r4] +_0812E02E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _0812E00E + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812E040: .4byte 0x0203ab34 +_0812E044: .4byte 0x03005e00 +_0812E048: .4byte 0x0000ffff +_0812E04C: .4byte 0x085a7a20 +_0812E050: .4byte 0x02020630 + thumb_func_end sub_812DFDC + + thumb_func_start sub_812E054 +sub_812E054: @ 812E054 + push {r4,r5,lr} + ldr r0, _0812E090 + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0812E094 + adds r0, r1 + movs r2, 0x4 + adds r3, r0, 0 + adds r3, 0x8 + ldr r4, _0812E098 +_0812E070: + lsls r0, r2, 1 + adds r1, r3, r0 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, 0x40 + beq _0812E09C + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r5, 0x3C + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _0812E09C + movs r0, 0 + b _0812E0A8 + .align 2, 0 +_0812E090: .4byte 0x0203ab34 +_0812E094: .4byte 0x03005e00 +_0812E098: .4byte 0x02020630 +_0812E09C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0812E070 + movs r0, 0x1 +_0812E0A8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_812E054 + + thumb_func_start sub_812E0B0 +sub_812E0B0: @ 812E0B0 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, _0812E0D8 + ldr r2, _0812E0DC + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0812E0D8: .4byte 0x085a7610 +_0812E0DC: .4byte 0x03005e00 + thumb_func_end sub_812E0B0 + + thumb_func_start nullsub_51 +nullsub_51: @ 812E0E0 + bx lr + thumb_func_end nullsub_51 + + thumb_func_start sub_812E0E4 +sub_812E0E4: @ 812E0E4 + push {r4-r7,lr} + movs r6, 0 + movs r0, 0x30 +_0812E0EA: + movs r4, 0 + lsls r5, r0, 16 + lsls r7, r6, 16 +_0812E0F0: + ldr r0, _0812E148 + asrs r1, r5, 16 + movs r2, 0 + movs r3, 0xE + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _0812E14C + adds r1, r0 + ldrb r0, [r1, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r1, 0x5] + strh r6, [r1, 0x2E] + strh r4, [r1, 0x30] + ldr r0, _0812E150 + strh r0, [r1, 0x34] + lsls r0, r4, 16 + movs r1, 0xC0 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x77 + ble _0812E0F0 + movs r2, 0x80 + lsls r2, 9 + adds r1, r7, r2 + movs r2, 0xA0 + lsls r2, 14 + adds r0, r5, r2 + lsrs r0, 16 + lsrs r6, r1, 16 + asrs r1, 16 + cmp r1, 0x2 + ble _0812E0EA + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812E148: .4byte 0x085a7ce0 +_0812E14C: .4byte 0x02020630 +_0812E150: .4byte 0x0000ffff + thumb_func_end sub_812E0E4 + + thumb_func_start sub_812E154 +sub_812E154: @ 812E154 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0812E1C4 + ldr r4, [r0] + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x1C + adds r1, r0 + ldrh r0, [r5, 0x30] + ldrh r1, [r1] + adds r0, r1 + strh r0, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r1, 0x78 + bl __modsi3 + strh r0, [r5, 0x32] + movs r2, 0x2E + ldrsh r1, [r5, r2] + lsls r1, 1 + adds r4, 0x22 + adds r4, r1 + ldrh r1, [r4] + adds r1, 0x1C + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r4, [r5, 0x2E] + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0x18 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_812BC44 + lsls r0, 24 + lsrs r0, 24 + bl gpu_tile_obj_tag_get_range_start + adds r1, r5, 0 + adds r1, 0x40 + strh r0, [r1] + adds r0, r5, 0 + bl sub_8008324 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812E1C4: .4byte 0x0203ab34 + thumb_func_end sub_812E154 + + thumb_func_start sub_812E1C8 +sub_812E1C8: @ 812E1C8 + push {r4-r6,lr} + movs r4, 0xCB + movs r5, 0x1 + ldr r6, _0812E22C +_0812E1D0: + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + movs r1, 0x17 + movs r2, 0 + adds r3, r5, 0 + bl sub_812E230 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 17 + subs r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r6 + ble _0812E1D0 + movs r4, 0xEB + movs r5, 0x1 + ldr r6, _0812E22C +_0812E1FE: + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + movs r1, 0x17 + movs r2, 0x1 + adds r3, r5, 0 + bl sub_812E230 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 17 + subs r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r6 + ble _0812E1FE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812E22C: .4byte 0x0000270f + thumb_func_end sub_812E1C8 + + thumb_func_start sub_812E230 +sub_812E230: @ 812E230 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0812E29C + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xD + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _0812E2A0 + adds r2, r0 + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + mov r0, r8 + strh r0, [r2, 0x2E] + strh r4, [r2, 0x30] + lsls r4, 16 + asrs r4, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + strh r0, [r2, 0x32] + ldr r0, _0812E2A4 + strh r0, [r2, 0x34] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812E29C: .4byte 0x085a7cf8 +_0812E2A0: .4byte 0x02020630 +_0812E2A4: .4byte 0x0000ffff + thumb_func_end sub_812E230 + + thumb_func_start sub_812E2A8 +sub_812E2A8: @ 812E2A8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0812E2FC + ldr r1, [r0] + ldrh r2, [r1, 0xC] + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0812E2BC + ldrh r2, [r1, 0xE] +_0812E2BC: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, r2 + beq _0812E2F6 + strh r2, [r4, 0x34] + ldrh r1, [r4, 0x32] + adds r0, r2, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r1, [r4, 0x30] + adds r0, r2, 0 + bl __udivsi3 + lsls r0, 16 + movs r3, 0xE0 + lsls r3, 11 + adds r0, r3 + lsrs r2, r0, 16 + adds r0, r2, 0 + bl gpu_tile_obj_tag_get_range_start + adds r1, r4, 0 + adds r1, 0x40 + strh r0, [r1] + adds r0, r4, 0 + bl sub_8008324 +_0812E2F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E2FC: .4byte 0x0203ab34 + thumb_func_end sub_812E2A8 + + thumb_func_start sub_812E300 +sub_812E300: @ 812E300 + push {lr} + ldr r0, _0812E330 + movs r1, 0x58 + movs r2, 0x48 + movs r3, 0xF + bl obj_add_from_template_forward_search + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0812E334 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, _0812E338 + bl obj_set_f18_to_r0_f42_to_40 + pop {r0} + bx r0 + .align 2, 0 +_0812E330: .4byte 0x085a7d10 +_0812E334: .4byte 0x02020630 +_0812E338: .4byte 0x085a7fc0 + thumb_func_end sub_812E300 + + thumb_func_start sub_812E33C +sub_812E33C: @ 812E33C + push {r4,r5,lr} + sub sp, 0x18 + ldr r4, _0812E3D4 + ldr r0, [r4] + cmp r0, 0 + bne _0812E350 + movs r0, 0x28 + bl malloc_and_clear + str r0, [r4] +_0812E350: + ldr r2, [r4] + ldr r0, _0812E3D8 + ldr r1, [r0] + str r1, [r2] + movs r3, 0x80 + lsls r3, 4 + strh r3, [r2, 0x4] + adds r0, r1, r3 + str r0, [r2, 0x8] + strh r3, [r2, 0xC] + movs r4, 0x80 + lsls r4, 5 + adds r0, r1, r4 + str r0, [r2, 0x10] + strh r3, [r2, 0x14] + movs r5, 0xC0 + lsls r5, 5 + adds r0, r1, r5 + str r0, [r2, 0x18] + strh r3, [r2, 0x1C] + movs r0, 0x80 + lsls r0, 6 + adds r1, r0 + str r1, [r2, 0x20] + strh r3, [r2, 0x24] + mov r1, sp + ldr r0, _0812E3DC + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + str r2, [sp, 0xC] + movs r1, 0x8C + lsls r1, 1 + mov r0, sp + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0812E3E0 + 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 + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + ldr r1, _0812E3E4 + ldr r1, [r1] + adds r1, 0x3F + strb r0, [r1] + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812E3D4: .4byte 0x0203aae4 +_0812E3D8: .4byte 0x0203aad8 +_0812E3DC: .4byte 0x085a7d28 +_0812E3E0: .4byte 0x02020630 +_0812E3E4: .4byte 0x0203ab34 + thumb_func_end sub_812E33C + + thumb_func_start sub_812E3E8 +sub_812E3E8: @ 812E3E8 + push {r4,lr} + ldr r0, _0812E418 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E41C + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r4, _0812E420 + ldr r0, [r4] + cmp r0, 0 + beq _0812E410 + bl free + movs r0, 0 + str r0, [r4] +_0812E410: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E418: .4byte 0x0203ab34 +_0812E41C: .4byte 0x02020630 +_0812E420: .4byte 0x0203aae4 + thumb_func_end sub_812E3E8 + + thumb_func_start sub_812E424 +sub_812E424: @ 812E424 + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2, 0x24] + strh r0, [r2, 0x26] + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0x4 + bne _0812E46A + movs r0, 0x8 + strh r0, [r2, 0x24] + strh r0, [r2, 0x26] + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _0812E458 + adds r0, r2, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _0812E466 + b _0812E46A +_0812E458: + adds r0, r2, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _0812E46A +_0812E466: + ldr r0, _0812E470 + strh r0, [r2, 0x26] +_0812E46A: + pop {r0} + bx r0 + .align 2, 0 +_0812E470: .4byte 0x0000fff8 + thumb_func_end sub_812E424 + + thumb_func_start sub_812E474 +sub_812E474: @ 812E474 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r4, _0812E584 + ldr r0, [r4] + cmp r0, 0 + bne _0812E490 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] +_0812E490: + ldr r2, [r4] + ldr r0, _0812E588 + mov r10, r0 + ldr r0, [r0] + movs r1, 0xA0 + lsls r1, 6 + adds r0, r1 + str r0, [r2] + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r2, 0x4] + mov r1, sp + ldr r0, _0812E58C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + str r2, [sp, 0xC] + mov r0, sp + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0x34 + movs r3, 0x7 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r5, _0812E590 + mov r9, r5 + adds r2, r0, r5 + ldrb r1, [r2, 0x5] + movs r7, 0xD + negs r7, r7 + mov r8, r7 + mov r0, r8 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r6, 0x2 + orrs r0, r6 + strb r0, [r1] + ldr r1, _0812E594 + adds r0, r2, 0 + bl obj_set_f18_to_r0_f42_to_40 + ldr r5, _0812E598 + ldr r0, [r5] + adds r0, 0x49 + strb r4, [r0] + ldr r4, _0812E59C + ldr r0, [r4] + cmp r0, 0 + bne _0812E510 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] +_0812E510: + ldr r2, [r4] + mov r3, r10 + ldr r0, [r3] + movs r4, 0xAC + lsls r4, 6 + adds r0, r4 + str r0, [r2] + movs r0, 0xA0 + lsls r0, 3 + strh r0, [r2, 0x4] + mov r1, sp + ldr r0, _0812E5A0 + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + str r2, [sp, 0xC] + mov r0, sp + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0x54 + movs r3, 0x7 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + mov r7, r9 + adds r2, r0, r7 + ldrb r1, [r2, 0x5] + mov r0, r8 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + ldr r1, _0812E5A4 + adds r0, r2, 0 + bl obj_set_f18_to_r0_f42_to_40 + ldr r0, [r5] + adds r0, 0x4A + strb r4, [r0] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812E584: .4byte 0x0203aae8 +_0812E588: .4byte 0x0203aad8 +_0812E58C: .4byte 0x085a7d40 +_0812E590: .4byte 0x02020630 +_0812E594: .4byte 0x085a7fe0 +_0812E598: .4byte 0x0203ab34 +_0812E59C: .4byte 0x0203aaec +_0812E5A0: .4byte 0x085a7d58 +_0812E5A4: .4byte 0x085a7ff4 + thumb_func_end sub_812E474 + + thumb_func_start sub_812E5A8 +sub_812E5A8: @ 812E5A8 + push {r4,r5,lr} + sub sp, 0x18 + ldr r4, _0812E634 + ldr r0, [r4] + cmp r0, 0 + bne _0812E5BC + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] +_0812E5BC: + ldr r2, [r4] + ldr r0, _0812E638 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + str r0, [r2] + movs r0, 0xC0 + lsls r0, 3 + strh r0, [r2, 0x4] + mov r1, sp + ldr r0, _0812E63C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + str r2, [sp, 0xC] + ldr r0, _0812E640 + ldrh r0, [r0] + movs r1, 0xA8 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + mov r0, sp + movs r2, 0x50 + movs r3, 0x7 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _0812E644 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + ldr r1, _0812E648 + bl obj_set_f18_to_r0_f42_to_40 + ldr r0, _0812E64C + ldr r0, [r0] + adds r0, 0x42 + strb r4, [r0] + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812E634: .4byte 0x0203aaf0 +_0812E638: .4byte 0x0203aad8 +_0812E63C: .4byte 0x085a7d70 +_0812E640: .4byte 0x02021bbc +_0812E644: .4byte 0x02020630 +_0812E648: .4byte 0x085a8010 +_0812E64C: .4byte 0x0203ab34 + thumb_func_end sub_812E5A8 + + thumb_func_start sub_812E650 +sub_812E650: @ 812E650 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 +_0812E656: + ldr r0, _0812E6B8 + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0 + movs r3, 0xA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + ldr r1, _0812E6BC + adds r3, r1 + ldrb r2, [r3, 0x5] + movs r6, 0xD + negs r6, r6 + adds r1, r6, 0 + ands r2, r1 + movs r1, 0x4 + orrs r2, r1 + strb r2, [r3, 0x5] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r1, [r1] + movs r2, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + strh r5, [r3, 0x3C] + ldr r1, _0812E6C0 + ldr r1, [r1] + adds r1, 0x4B + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r5, 16 + movs r6, 0xA0 + lsls r6, 13 + adds r0, r6 + lsrs r5, r0, 16 + cmp r4, 0x2 + bls _0812E656 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812E6B8: .4byte 0x085a7d88 +_0812E6BC: .4byte 0x02020630 +_0812E6C0: .4byte 0x0203ab34 + thumb_func_end sub_812E650 + + thumb_func_start sub_812E6C4 +sub_812E6C4: @ 812E6C4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0812E708 + ldr r1, [r0] + ldrh r0, [r4, 0x3C] + ldrh r1, [r1, 0x14] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x28 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + adds r1, r0, 0 + adds r1, 0x3B + strh r1, [r4, 0x22] + movs r1, 0x14 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + bl sub_812BCE8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start_if_different + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E708: .4byte 0x0203ab34 + thumb_func_end sub_812E6C4 + + thumb_func_start sub_812E70C +sub_812E70C: @ 812E70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r1, 0xB8 + lsls r1, 1 + ldr r0, _0812E7BC + movs r2, 0x64 + movs r3, 0x9 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r7, _0812E7C0 + adds r2, r0, r7 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r3, 0x2 + mov r10, r3 + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + ldrb r1, [r2, 0x5] + movs r5, 0xD + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + movs r1, 0x4 + mov r8, r1 + mov r3, r8 + orrs r0, r3 + strb r0, [r2, 0x5] + ldr r0, _0812E7C4 + mov r9, r0 + adds r0, r2, 0 + mov r1, r9 + bl obj_set_f18_to_r0_f42_to_40 + ldr r6, _0812E7C8 + ldr r0, [r6] + adds r0, 0x4E + strb r4, [r0] + movs r1, 0x90 + lsls r1, 1 + ldr r0, _0812E7BC + movs r2, 0x68 + movs r3, 0x4 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r7 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + ldrb r0, [r2, 0x5] + ands r5, r0 + mov r0, r8 + orrs r5, r0 + strb r5, [r2, 0x5] + adds r0, r2, 0 + mov r1, r9 + bl obj_set_f18_to_r0_f42_to_40 + ldr r0, [r6] + adds r0, 0x4F + strb r4, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812E7BC: .4byte 0x085a7da0 +_0812E7C0: .4byte 0x02020630 +_0812E7C4: .4byte 0x085a8028 +_0812E7C8: .4byte 0x0203ab34 + thumb_func_end sub_812E70C + + thumb_func_start sub_812E7CC +sub_812E7CC: @ 812E7CC + push {r4,lr} + ldr r0, _0812E81C + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0x4C + movs r3, 0xB + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _0812E820 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, _0812E824 + bl obj_set_f18_to_r0_f42_to_40 + ldr r0, _0812E828 + ldr r0, [r0] + adds r0, 0x40 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E81C: .4byte 0x085a7db8 +_0812E820: .4byte 0x02020630 +_0812E824: .4byte 0x085a803c +_0812E828: .4byte 0x0203ab34 + thumb_func_end sub_812E7CC + + thumb_func_start sub_812E82C +sub_812E82C: @ 812E82C + push {r4,lr} + ldr r0, _0812E8B4 + ldr r0, [r0] + adds r0, 0x40 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E8B8 + adds r0, r1 + bl obj_delete_and_free_tiles + movs r4, 0 +_0812E846: + ldr r0, _0812E8B4 + ldr r0, [r0] + adds r0, 0x49 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E8B8 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812E846 + ldr r4, _0812E8BC + ldr r0, [r4] + cmp r0, 0 + beq _0812E878 + bl free + movs r0, 0 + str r0, [r4] +_0812E878: + ldr r4, _0812E8C0 + ldr r0, [r4] + cmp r0, 0 + beq _0812E888 + bl free + movs r0, 0 + str r0, [r4] +_0812E888: + movs r4, 0 +_0812E88A: + ldr r0, _0812E8B4 + ldr r0, [r0] + adds r0, 0x4B + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E8B8 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0812E88A + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E8B4: .4byte 0x0203ab34 +_0812E8B8: .4byte 0x02020630 +_0812E8BC: .4byte 0x0203aae8 +_0812E8C0: .4byte 0x0203aaec + thumb_func_end sub_812E82C + + thumb_func_start sub_812E8C4 +sub_812E8C4: @ 812E8C4 + push {r4,lr} + movs r4, 0 +_0812E8C8: + ldr r0, _0812E8F0 + ldr r0, [r0] + adds r0, 0x4E + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E8F4 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812E8C8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E8F0: .4byte 0x0203ab34 +_0812E8F4: .4byte 0x02020630 + thumb_func_end sub_812E8C4 + + thumb_func_start sub_812E8F8 +sub_812E8F8: @ 812E8F8 + push {r4,lr} + ldr r0, _0812E928 + ldr r0, [r0] + adds r0, 0x42 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812E92C + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r4, _0812E930 + ldr r0, [r4] + cmp r0, 0 + beq _0812E920 + bl free + movs r0, 0 + str r0, [r4] +_0812E920: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812E928: .4byte 0x0203ab34 +_0812E92C: .4byte 0x02020630 +_0812E930: .4byte 0x0203aaf0 + thumb_func_end sub_812E8F8 + + thumb_func_start sub_812E934 +sub_812E934: @ 812E934 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, _0812E9D8 + mov r10, r0 + movs r1, 0x98 + movs r2, 0x20 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, _0812E9DC + mov r9, r2 + adds r3, r1, r2 + ldrb r2, [r3, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r2 + movs r2, 0x4 + mov r8, r2 + mov r2, r8 + orrs r1, r2 + strb r1, [r3, 0x5] + adds r5, r3, 0 + adds r5, 0x3F + ldrb r1, [r5] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r5] + ldr r6, _0812E9E0 + ldr r1, [r6] + adds r1, 0x50 + strb r0, [r1] + movs r0, 0x8 + strh r0, [r3, 0x2E] + ldr r0, _0812E9E4 + strh r0, [r3, 0x30] + movs r0, 0x1 + negs r0, r0 + strh r0, [r3, 0x32] + movs r5, 0x20 + strh r5, [r3, 0x3C] + mov r0, r10 + movs r1, 0xB8 + movs r2, 0x20 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + mov r2, r9 + adds r3, r1, r2 + ldrb r1, [r3, 0x5] + ands r4, r1 + mov r1, r8 + orrs r4, r1 + strb r4, [r3, 0x5] + ldr r1, [r6] + adds r1, 0x51 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r3, 0x30] + subs r0, 0x2 + strh r0, [r3, 0x32] + strh r5, [r3, 0x3C] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812E9D8: .4byte 0x085a7dd0 +_0812E9DC: .4byte 0x02020630 +_0812E9E0: .4byte 0x0203ab34 +_0812E9E4: .4byte 0x0000ffff + thumb_func_end sub_812E934 + + thumb_func_start sub_812E9E8 +sub_812E9E8: @ 812E9E8 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + movs r1, 0x2E + ldrsh r4, [r2, r1] + cmp r4, 0 + beq _0812EA0C + subs r0, 0x1 + movs r1, 0 + strh r0, [r2, 0x2E] + strh r1, [r2, 0x24] + strh r1, [r2, 0x26] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + b _0812EA3E +_0812EA0C: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + 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] + ldrh r0, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0812EA3E + ldrh r0, [r2, 0x3C] + strh r0, [r2, 0x2E] + strh r4, [r2, 0x34] +_0812EA3E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812E9E8 + + thumb_func_start sub_812EA44 +sub_812EA44: @ 812EA44 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _0812EA74 + ldr r1, _0812EA78 + ldr r3, [r1] + adds r1, r3, 0 + adds r1, 0x50 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x3C] + adds r3, 0x51 + ldrb r2, [r3] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x3C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EA74: .4byte 0x02020630 +_0812EA78: .4byte 0x0203ab34 + thumb_func_end sub_812EA44 + + thumb_func_start sub_812EA7C +sub_812EA7C: @ 812EA7C + push {r4,lr} + movs r4, 0 +_0812EA80: + ldr r0, _0812EAA8 + ldr r0, [r0] + adds r0, 0x50 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812EAAC + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812EA80 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EAA8: .4byte 0x0203ab34 +_0812EAAC: .4byte 0x02020630 + thumb_func_end sub_812EA7C + + thumb_func_start sub_812EAB0 +sub_812EAB0: @ 812EAB0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r0, _0812EB3C + mov r8, r0 + movs r1, 0x48 + movs r2, 0x50 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0812EB40 + mov r9, r1 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrb r3, [r2, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r3 + movs r6, 0x4 + orrs r1, r6 + strb r1, [r2, 0x5] + movs r3, 0 + movs r1, 0x1 + strh r1, [r2, 0x2E] + strh r3, [r2, 0x38] + movs r1, 0x10 + strh r1, [r2, 0x3A] + movs r1, 0x8 + strh r1, [r2, 0x3C] + ldr r5, _0812EB44 + ldr r1, [r5] + adds r1, 0x52 + strb r0, [r1] + mov r0, r8 + movs r1, 0x68 + movs r2, 0x50 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + ldrb r2, [r1, 0x5] + ands r4, r2 + orrs r4, r6 + strb r4, [r1, 0x5] + adds r1, 0x3F + ldrb r2, [r1] + movs r3, 0x1 + orrs r2, r3 + strb r2, [r1] + ldr r1, [r5] + adds r1, 0x53 + strb r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812EB3C: .4byte 0x085a7de8 +_0812EB40: .4byte 0x02020630 +_0812EB44: .4byte 0x0203ab34 + thumb_func_end sub_812EAB0 + + thumb_func_start sub_812EB48 +sub_812EB48: @ 812EB48 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, _0812EBA4 + mov r0, sp + movs r2, 0x2 + bl memcpy + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0812EB9A + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + cmp r0, 0 + bgt _0812EB9A + movs r0, 0x7 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r2, _0812EBA8 + adds r0, r2 + lsrs r0, 16 + movs r2, 0x38 + ldrsh r1, [r4, r2] + add r1, sp + ldrb r3, [r1] + adds r1, r3, 0 + adds r2, r3, 0 + bl sub_80B609C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r1, 0x1 + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3C] + strh r0, [r4, 0x3A] +_0812EB9A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EBA4: .4byte 0x085a7614 +_0812EBA8: .4byte 0x01030000 + thumb_func_end sub_812EB48 + + thumb_func_start sub_812EBAC +sub_812EBAC: @ 812EBAC + ldr r3, _0812EBC4 + ldr r1, _0812EBC8 + ldr r1, [r1] + adds r1, 0x52 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + strh r0, [r1, 0x3C] + bx lr + .align 2, 0 +_0812EBC4: .4byte 0x02020630 +_0812EBC8: .4byte 0x0203ab34 + thumb_func_end sub_812EBAC + + thumb_func_start sub_812EBCC +sub_812EBCC: @ 812EBCC + push {r4,lr} + movs r0, 0x7 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 4 + ldr r1, _0812EC14 + adds r0, r1 + lsrs r0, 16 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80B609C + movs r4, 0 +_0812EBEA: + ldr r0, _0812EC18 + ldr r0, [r0] + adds r0, 0x52 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812EC1C + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812EBEA + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EC14: .4byte 0x01030000 +_0812EC18: .4byte 0x0203ab34 +_0812EC1C: .4byte 0x02020630 + thumb_func_end sub_812EBCC + + thumb_func_start sub_812EC20 +sub_812EC20: @ 812EC20 + push {lr} + ldr r0, _0812EC58 + movs r1, 0xA8 + movs r2, 0x50 + movs r3, 0x6 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0812EC5C + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + ands r2, r3 + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1, 0x5] + ldr r1, _0812EC60 + ldr r1, [r1] + adds r1, 0x41 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0812EC58: .4byte 0x085a7e00 +_0812EC5C: .4byte 0x02020630 +_0812EC60: .4byte 0x0203ab34 + thumb_func_end sub_812EC20 + + thumb_func_start sub_812EC64 +sub_812EC64: @ 812EC64 + ldr r1, _0812EC6C + ldrh r1, [r1] + strh r1, [r0, 0x26] + bx lr + .align 2, 0 +_0812EC6C: .4byte 0x02021bbe + thumb_func_end sub_812EC64 + + thumb_func_start sub_812EC70 +sub_812EC70: @ 812EC70 + push {lr} + ldr r0, _0812EC8C + ldr r0, [r0] + adds r0, 0x41 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812EC90 + adds r0, r1 + bl obj_delete_and_free_tiles + pop {r0} + bx r0 + .align 2, 0 +_0812EC8C: .4byte 0x0203ab34 +_0812EC90: .4byte 0x02020630 + thumb_func_end sub_812EC70 + + thumb_func_start sub_812EC94 +sub_812EC94: @ 812EC94 + push {r4,r5,lr} + sub sp, 0x8 + ldr r1, _0812ED0C + mov r0, sp + movs r2, 0x8 + bl memcpy + movs r4, 0 +_0812ECA4: + ldr r0, _0812ED10 + ldrh r0, [r0] + movs r1, 0x50 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + ldr r0, _0812ED14 + movs r2, 0x44 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + ldr r1, _0812ED18 + adds r3, r1 + ldrb r2, [r3, 0x5] + movs r5, 0xD + negs r5, r5 + adds r1, r5, 0 + ands r2, r1 + movs r1, 0x4 + orrs r2, r1 + strb r2, [r3, 0x5] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r1, [r1] + movs r2, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + lsls r1, r4, 1 + add r1, sp + ldrh r1, [r1] + strh r1, [r3, 0x2E] + ldr r1, _0812ED1C + ldr r1, [r1] + adds r1, 0x54 + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0812ECA4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812ED0C: .4byte 0x085a7616 +_0812ED10: .4byte 0x02021bbc +_0812ED14: .4byte 0x085a7e18 +_0812ED18: .4byte 0x02020630 +_0812ED1C: .4byte 0x0203ab34 + thumb_func_end sub_812EC94 + + thumb_func_start sub_812ED20 +sub_812ED20: @ 812ED20 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + subs r0, 0x2 + movs r4, 0 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r1, 0x14 + bl cosine + strh r0, [r5, 0x24] + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r1, 0x6 + bl sine + strh r0, [r5, 0x26] + adds r1, r5, 0 + adds r1, 0x43 + strb r4, [r1] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x7F + ble _0812ED5A + movs r0, 0x2 + strb r0, [r1] +_0812ED5A: + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0812ED84 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r0, r2, 31 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0 + strh r0, [r5, 0x30] +_0812ED84: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812ED20 + + thumb_func_start sub_812ED8C +sub_812ED8C: @ 812ED8C + push {r4,lr} + movs r4, 0 +_0812ED90: + ldr r0, _0812EDB8 + ldr r0, [r0] + adds r0, 0x54 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0812EDBC + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0812ED90 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EDB8: .4byte 0x0203ab34 +_0812EDBC: .4byte 0x02020630 + thumb_func_end sub_812ED8C + + thumb_func_start sub_812EDC0 +sub_812EDC0: @ 812EDC0 + push {r4,lr} + ldr r0, _0812EE08 + movs r1, 0xA8 + movs r2, 0x3C + movs r3, 0x8 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _0812EE0C + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + bl obj_alloc_rotscale_entry + ldr r0, _0812EE10 + ldr r0, [r0] + adds r0, 0x43 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EE08: .4byte 0x085a7e30 +_0812EE0C: .4byte 0x02020630 +_0812EE10: .4byte 0x0203ab34 + thumb_func_end sub_812EDC0 + + thumb_func_start sub_812EE14 +sub_812EE14: @ 812EE14 + push {lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x2E] + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0812EE36 + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812EE90 + adds r0, r2, 0x1 + strh r0, [r3, 0x2E] + b _0812EE90 +_0812EE36: + cmp r0, 0x1 + bne _0812EE72 + 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] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _0812EE90 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + movs r0, 0 + strh r0, [r3, 0x32] + b _0812EE90 +_0812EE72: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0812EE90 + movs r0, 0x1 + strh r0, [r3, 0x3C] +_0812EE90: + ldrh r0, [r3, 0x30] + movs r1, 0xFF + ands r1, r0 + adds r1, 0x10 + strh r1, [r3, 0x30] + lsrs r1, 8 + ldrh r0, [r3, 0x26] + subs r0, r1 + strh r0, [r3, 0x26] + pop {r0} + bx r0 + thumb_func_end sub_812EE14 + + thumb_func_start sub_812EEA8 +sub_812EEA8: @ 812EEA8 + ldr r2, _0812EEC4 + ldr r0, _0812EEC8 + ldr r0, [r0] + adds r0, 0x43 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_0812EEC4: .4byte 0x02020630 +_0812EEC8: .4byte 0x0203ab34 + thumb_func_end sub_812EEA8 + + thumb_func_start sub_812EECC +sub_812EECC: @ 812EECC + push {r4,lr} + ldr r0, _0812EEF8 + ldr r0, [r0] + adds r0, 0x43 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0812EEFC + adds r4, r0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EEF8: .4byte 0x0203ab34 +_0812EEFC: .4byte 0x02020630 + thumb_func_end sub_812EECC + + thumb_func_start sub_812EF00 +sub_812EF00: @ 812EF00 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _0812EF4C + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + movs r3, 0xC + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _0812EF50 + 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] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0812EF4C: .4byte 0x085a7f98 +_0812EF50: .4byte 0x02020630 + thumb_func_end sub_812EF00 + + thumb_func_start sub_812EF54 +sub_812EF54: @ 812EF54 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812EF68 + movs r0, 0x1 + strh r0, [r2, 0x3C] +_0812EF68: + pop {r0} + bx r0 + thumb_func_end sub_812EF54 + + thumb_func_start sub_812EF6C +sub_812EF6C: @ 812EF6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _0812EF94 + adds r4, r0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812EF94: .4byte 0x02020630 + thumb_func_end sub_812EF6C + + thumb_func_start sub_812EF98 +sub_812EF98: @ 812EF98 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, _0812EFD4 + lsrs r1, 22 + adds r3, r1, r3 + ldr r5, [r3] + ldr r3, _0812EFD8 + adds r4, r1, r3 + movs r6, 0 + ldrsh r4, [r4, r6] + adds r3, 0x2 + adds r1, r3 + movs r6, 0 + ldrsh r3, [r1, r6] + lsls r2, 16 + asrs r2, 16 + str r2, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812EFDC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0812EFD4: .4byte 0x085a78c8 +_0812EFD8: .4byte 0x085a783a + thumb_func_end sub_812EF98 + + thumb_func_start sub_812EFDC +sub_812EFDC: @ 812EFDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r4, r0, 0 + mov r8, r1 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r5, [sp, 0x34] + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + mov r9, r5 + ldr r0, _0812F068 + lsrs r4, 22 + adds r0, r4, r0 + mov r3, sp + ldr r0, [r0] + ldm r0!, {r5-r7} + stm r3!, {r5-r7} + ldm r0!, {r5-r7} + stm r3!, {r5-r7} + ldr r0, _0812F06C + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + movs r3, 0x10 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _0812F070 + adds r2, r0, r1 + ldrb r0, [r2, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r2, 0x5] + mov r0, r8 + str r0, [r2, 0x1C] + mov r5, r9 + strh r5, [r2, 0x3A] + movs r0, 0x1 + strh r0, [r2, 0x3C] + ldr r0, _0812F074 + adds r4, r0 + ldr r1, [r4] + cmp r1, 0 + beq _0812F056 + adds r0, r2, 0 + bl obj_set_f18_to_r0_f42_to_40 +_0812F056: + adds r0, r7, 0 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0812F068: .4byte 0x085a8264 +_0812F06C: .4byte 0x03001188 +_0812F070: .4byte 0x02020630 +_0812F074: .4byte 0x085a82cc + thumb_func_end sub_812EFDC + + thumb_func_start sub_812F078 +sub_812F078: @ 812F078 + movs r1, 0 + strh r1, [r0, 0x3C] + bx lr + thumb_func_end sub_812F078 + + thumb_func_start sub_812F080 +sub_812F080: @ 812F080 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, _0812F0FC + mov r0, sp + movs r2, 0x8 + bl memcpy + add r5, sp, 0x8 + ldr r1, _0812F100 + adds r0, r5, 0 + movs r2, 0x8 + bl memcpy + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0812F0C6 + adds r3, r4, 0 + adds r3, 0x42 + ldrb r2, [r3] + lsls r0, r2, 26 + lsrs r0, 26 + movs r1, 0x1 + eors r1, r0 + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0 + strh r0, [r4, 0x30] +_0812F0C6: + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x42 + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + beq _0812F0F2 + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + adds r0, r5, r0 + ldrh r0, [r0] + strh r0, [r4, 0x26] +_0812F0F2: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812F0FC: .4byte 0x085a761e +_0812F100: .4byte 0x085a7626 + thumb_func_end sub_812F080 + + thumb_func_start sub_812F104 +sub_812F104: @ 812F104 + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r3] + bl sub_812F080 + pop {r0} + bx r0 + thumb_func_end sub_812F104 + + thumb_func_start sub_812F11C +sub_812F11C: @ 812F11C + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + bl sub_812F080 + pop {r0} + bx r0 + thumb_func_end sub_812F11C + + thumb_func_start sub_812F134 +sub_812F134: @ 812F134 + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x1 + orrs r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + bl sub_812F080 + pop {r0} + bx r0 + thumb_func_end sub_812F134 + + thumb_func_start sub_812F150 +sub_812F150: @ 812F150 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _0812F184 + cmp r0, 0x1 + bgt _0812F166 + cmp r0, 0 + beq _0812F170 + b _0812F1B4 +_0812F166: + cmp r0, 0x2 + beq _0812F194 + cmp r0, 0x3 + beq _0812F1B0 + b _0812F1B4 +_0812F170: + ldrh r0, [r2, 0x20] + adds r0, 0x4 + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xCF + ble _0812F1B4 + movs r0, 0xD0 + strh r0, [r2, 0x20] + b _0812F1A2 +_0812F184: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + ble _0812F1B4 + b _0812F1A2 +_0812F194: + ldrh r0, [r2, 0x20] + adds r0, 0x4 + strh r0, [r2, 0x20] + lsls r0, 16 + ldr r1, _0812F1AC + cmp r0, r1 + ble _0812F1B4 +_0812F1A2: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _0812F1B4 + .align 2, 0 +_0812F1AC: .4byte 0x010f0000 +_0812F1B0: + movs r0, 0 + strh r0, [r2, 0x3C] +_0812F1B4: + pop {r0} + bx r0 + thumb_func_end sub_812F150 + + thumb_func_start sub_812F1B8 +sub_812F1B8: @ 812F1B8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0812F1EC + cmp r0, 0x1 + bgt _0812F1CE + cmp r0, 0 + beq _0812F1D8 + b _0812F216 +_0812F1CE: + cmp r0, 0x2 + beq _0812F1FC + cmp r0, 0x3 + beq _0812F212 + b _0812F216 +_0812F1D8: + ldrh r0, [r1, 0x20] + subs r0, 0x4 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD0 + bgt _0812F216 + movs r0, 0xD0 + strh r0, [r1, 0x20] + b _0812F20A +_0812F1EC: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + ble _0812F216 + b _0812F20A +_0812F1FC: + ldrh r0, [r1, 0x20] + subs r0, 0x4 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x90 + bgt _0812F216 +_0812F20A: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _0812F216 +_0812F212: + movs r0, 0 + strh r0, [r1, 0x3C] +_0812F216: + pop {r0} + bx r0 + thumb_func_end sub_812F1B8 + + thumb_func_start sub_812F21C +sub_812F21C: @ 812F21C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _0812F2C6 + lsls r0, 2 + ldr r1, _0812F234 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0812F234: .4byte _0812F238 + .align 2, 0 +_0812F238: + .4byte _0812F250 + .4byte _0812F268 + .4byte _0812F288 + .4byte _0812F29C + .4byte _0812F2AC + .4byte _0812F2C2 +_0812F250: + ldr r0, _0812F284 + ldr r0, [r0] + ldrb r1, [r0, 0xA] + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0812F268: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812F2C6 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + b _0812F2C6 + .align 2, 0 +_0812F284: .4byte 0x0203ab34 +_0812F288: + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xCF + ble _0812F2C6 + movs r0, 0xD0 + strh r0, [r4, 0x20] + b _0812F2BA +_0812F29C: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + ble _0812F2C6 + b _0812F2BA +_0812F2AC: + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF7 + ble _0812F2C6 +_0812F2BA: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0812F2C6 +_0812F2C2: + movs r0, 0 + strh r0, [r4, 0x3C] +_0812F2C6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812F21C + + thumb_func_start sub_812F2CC +sub_812F2CC: @ 812F2CC + push {lr} + adds r3, r0, 0 + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _0812F2FA + cmp r0, 0x1 + bgt _0812F2E2 + cmp r0, 0 + beq _0812F2E8 + b _0812F368 +_0812F2E2: + cmp r0, 0x2 + beq _0812F318 + b _0812F368 +_0812F2E8: + adds r2, r3, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] +_0812F2FA: + ldrh r0, [r3, 0x22] + adds r0, 0x8 + strh r0, [r3, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + ble _0812F368 + movs r0, 0x70 + strh r0, [r3, 0x22] + movs r0, 0x10 + strh r0, [r3, 0x30] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _0812F368 +_0812F318: + movs r0, 0x32 + ldrsh r2, [r3, r0] + cmp r2, 0 + bne _0812F35E + ldrh r0, [r3, 0x22] + ldrh r1, [r3, 0x30] + subs r0, r1 + strh r0, [r3, 0x22] + negs r1, r1 + strh r1, [r3, 0x30] + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0812F35E + lsls r0, r1, 16 + asrs r0, 18 + strh r0, [r3, 0x30] + strh r2, [r3, 0x34] + adds r1, r0, 0 + cmp r1, 0 + bne _0812F35E + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + strh r1, [r3, 0x3C] + adds r2, r3, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0812F35E: + ldrh r0, [r3, 0x32] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r3, 0x32] +_0812F368: + pop {r0} + bx r0 + thumb_func_end sub_812F2CC + + thumb_func_start sub_812F36C +sub_812F36C: @ 812F36C + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0812F37E + cmp r0, 0x1 + beq _0812F394 + b _0812F3B0 +_0812F37E: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0812F3B0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _0812F3B0 +_0812F394: + ldrh r0, [r1, 0x22] + adds r0, 0x2 + strh r0, [r1, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2F + ble _0812F3B0 + movs r0, 0x30 + strh r0, [r1, 0x22] + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + movs r0, 0 + strh r0, [r1, 0x3C] +_0812F3B0: + pop {r0} + bx r0 + thumb_func_end sub_812F36C + + thumb_func_start sub_812F3B4 +sub_812F3B4: @ 812F3B4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0812F3C6 + cmp r0, 0x1 + beq _0812F416 + b _0812F468 +_0812F3C6: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0812F468 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x5 + strh r0, [r4, 0x30] + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldrh r0, [r4, 0x30] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set + b _0812F468 +_0812F416: + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0812F42C + movs r0, 0 + strh r0, [r4, 0x30] +_0812F42C: + ldrh r0, [r4, 0x30] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set + ldrh r1, [r4, 0x32] + movs r0, 0xFF + ands r0, r1 + adds r0, 0x80 + strh r0, [r4, 0x32] + movs r0, 0x30 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _0812F468 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start +_0812F468: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812F3B4 + + thumb_func_start sub_812F470 +sub_812F470: @ 812F470 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x2 + bgt _0812F4C0 + ldr r1, _0812F4BC + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x6 + bl gpu_pal_tags_index_of + 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 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812F4FC + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + movs r0, 0 + strh r0, [r5, 0x32] + b _0812F4FC + .align 2, 0 +_0812F4BC: .4byte 0x085a8510 +_0812F4C0: + ldr r1, _0812F510 + movs r2, 0x30 + ldrsh r0, [r5, r2] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x6 + bl gpu_pal_tags_index_of + 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 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _0812F4FC + strh r1, [r5, 0x30] + strh r1, [r5, 0x32] +_0812F4FC: + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start_if_different + movs r0, 0 + strh r0, [r5, 0x3C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812F510: .4byte 0x085a8510 + thumb_func_end sub_812F470 + + thumb_func_start sub_812F514 +sub_812F514: @ 812F514 + push {r4-r6,lr} + sub sp, 0x30 + adds r4, r0, 0 + ldr r1, _0812F550 + mov r0, sp + movs r2, 0x10 + bl memcpy + add r6, sp, 0x10 + ldr r1, _0812F554 + adds r0, r6, 0 + movs r2, 0x10 + bl memcpy + add r5, sp, 0x20 + ldr r1, _0812F558 + adds r0, r5, 0 + movs r2, 0x10 + bl memcpy + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0812F58C + cmp r0, 0x1 + bgt _0812F55C + cmp r0, 0 + beq _0812F562 + b _0812F5D8 + .align 2, 0 +_0812F550: .4byte 0x085a762e +_0812F554: .4byte 0x085a763e +_0812F558: .4byte 0x085a764e +_0812F55C: + cmp r0, 0x2 + beq _0812F5A0 + b _0812F5D8 +_0812F562: + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + adds r0, r6, r0 + ldrh r0, [r0] + strh r0, [r4, 0x26] + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r5, r0 + ldrh r0, [r0] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0812F58C: + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812F5D8 + b _0812F5D2 +_0812F5A0: + ldrh r0, [r4, 0x24] + movs r2, 0x24 + ldrsh r1, [r4, r2] + cmp r1, 0 + ble _0812F5AE + subs r0, 0x4 + b _0812F5B4 +_0812F5AE: + cmp r1, 0 + bge _0812F5B6 + adds r0, 0x4 +_0812F5B4: + strh r0, [r4, 0x24] +_0812F5B6: + ldrh r0, [r4, 0x26] + movs r2, 0x26 + ldrsh r1, [r4, r2] + cmp r1, 0 + ble _0812F5C4 + subs r0, 0x4 + b _0812F5CA +_0812F5C4: + cmp r1, 0 + bge _0812F5CC + adds r0, 0x4 +_0812F5CA: + strh r0, [r4, 0x26] +_0812F5CC: + ldr r0, [r4, 0x24] + cmp r0, 0 + bne _0812F5D8 +_0812F5D2: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0812F5D8: + add sp, 0x30 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_812F514 + + thumb_func_start sub_812F5E0 +sub_812F5E0: @ 812F5E0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, _0812F644 + mov r0, sp + movs r2, 0x10 + bl memcpy + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0812F602 + adds r0, r1, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0xC + strh r0, [r4, 0x30] +_0812F602: + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0812F63C + subs r0, r1, 0x1 + strh r0, [r4, 0x30] +_0812F63C: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812F644: .4byte 0x085a765e + thumb_func_end sub_812F5E0 + + thumb_func_start sub_812F648 +sub_812F648: @ 812F648 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0812F694 + cmp r0, 0x1 + bgt _0812F660 + cmp r0, 0 + beq _0812F66A + b _0812F76C +_0812F660: + cmp r0, 0x2 + beq _0812F6E0 + cmp r0, 0x3 + beq _0812F71C + b _0812F76C +_0812F66A: + ldr r0, _0812F6D8 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x5C + movs r0, 0x2F + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x3F + strh r0, [r1] + subs r1, 0x4 + ldr r0, _0812F6DC + strh r0, [r1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0812F694: + ldrh r0, [r5, 0x30] + adds r2, r0, 0x2 + strh r2, [r5, 0x30] + adds r0, 0xB2 + strh r0, [r5, 0x32] + movs r1, 0xF0 + subs r1, r2 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD0 + ble _0812F6B0 + movs r0, 0xD0 + strh r0, [r5, 0x32] +_0812F6B0: + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0xCF + bgt _0812F6BC + movs r0, 0xD0 + strh r0, [r5, 0x34] +_0812F6BC: + ldr r0, _0812F6D8 + ldr r2, [r0] + ldrh r0, [r5, 0x32] + lsls r0, 8 + ldrh r1, [r5, 0x34] + orrs r0, r1 + adds r1, r2, 0 + adds r1, 0x58 + strh r0, [r1] + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x33 + ble _0812F76C + b _0812F75E + .align 2, 0 +_0812F6D8: .4byte 0x0203ab34 +_0812F6DC: .4byte 0x00002088 +_0812F6E0: + ldr r6, _0812F774 + ldr r0, [r6] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812F76C + ldr r1, _0812F778 + movs r4, 0 + str r4, [sp] + movs r0, 0x5 + movs r2, 0xD0 + movs r3, 0x74 + bl sub_812DF68 + ldr r2, [r6] + adds r1, r2, 0 + adds r1, 0x58 + ldr r0, _0812F77C + strh r0, [r1] + adds r1, 0x2 + movs r0, 0xD1 + lsls r0, 7 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x2F + strh r0, [r1] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + strh r4, [r5, 0x30] +_0812F71C: + ldrh r0, [r5, 0x30] + adds r2, r0, 0x2 + strh r2, [r5, 0x30] + adds r0, 0xC2 + strh r0, [r5, 0x32] + movs r1, 0xE0 + subs r1, r2 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD0 + ble _0812F738 + movs r0, 0xD0 + strh r0, [r5, 0x32] +_0812F738: + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0xCF + bgt _0812F744 + movs r0, 0xD0 + strh r0, [r5, 0x34] +_0812F744: + ldr r0, _0812F774 + ldr r2, [r0] + ldrh r0, [r5, 0x32] + lsls r0, 8 + ldrh r1, [r5, 0x34] + orrs r0, r1 + adds r1, r2, 0 + adds r1, 0x58 + strh r0, [r1] + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0xF + ble _0812F76C +_0812F75E: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r1, r2, 0 + adds r1, 0x5C + movs r0, 0x3F + strh r0, [r1] +_0812F76C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812F774: .4byte 0x0203ab34 +_0812F778: .4byte nullsub_12 + 1 +_0812F77C: .4byte 0x0000c0e0 + thumb_func_end sub_812F648 + + thumb_func_start nullsub_101 +nullsub_101: @ 812F780 + bx lr + thumb_func_end nullsub_101 + + thumb_func_start sub_812F784 +sub_812F784: @ 812F784 + push {lr} + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end sub_812F784 + + thumb_func_start sub_812F794 +sub_812F794: @ 812F794 + push {r4,lr} + ldr r0, _0812F7BC + ldr r4, [r0] + movs r0, 0x6 + bl gpu_pal_tags_index_of + 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 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0812F7BC: .4byte 0x085a8520 + thumb_func_end sub_812F794 + + thumb_func_start sub_812F7C0 +sub_812F7C0: @ 812F7C0 + ldr r0, _0812F7E0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x58 + movs r0, 0xF0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0xA0 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x5C + movs r1, 0x3F + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + bx lr + .align 2, 0 +_0812F7E0: .4byte 0x0203ab34 + thumb_func_end sub_812F7C0 + + thumb_func_start sub_812F7E4 +sub_812F7E4: @ 812F7E4 + push {r4-r6,lr} + bl sub_812F8A0 + ldr r4, _0812F884 + movs r0, 0xC8 + lsls r0, 6 + bl malloc + adds r1, r0, 0 + str r1, [r4] + ldr r0, _0812F888 + bl call_LZZUnCompWram + ldr r4, _0812F88C + movs r0, 0xD8 + lsls r0, 6 + bl malloc + adds r1, r0, 0 + str r1, [r4] + ldr r0, _0812F890 + bl call_LZZUnCompWram + ldr r4, _0812F894 + movs r0, 0xB0 + bl malloc_and_clear + str r0, [r4] + movs r3, 0 + ldr r5, _0812F898 + adds r6, r4, 0 +_0812F822: + ldr r2, [r4] + lsls r1, r3, 3 + adds r2, r1, r2 + adds r1, r5 + ldr r0, [r1] + str r0, [r2] + ldrh r0, [r1, 0x4] + strh r0, [r2, 0x4] + ldrh r0, [r1, 0x6] + strh r0, [r2, 0x6] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x15 + bls _0812F822 + ldr r3, [r6] + adds r2, r3, 0 + adds r2, 0x88 + ldr r0, _0812F884 + ldr r1, [r0] + movs r4, 0xA0 + lsls r4, 4 + adds r0, r1, r4 + str r0, [r2] + adds r2, 0x8 + movs r4, 0xA0 + lsls r4, 5 + adds r0, r1, r4 + str r0, [r2] + adds r2, 0x8 + movs r4, 0xB0 + lsls r4, 5 + adds r0, r1, r4 + str r0, [r2] + adds r0, r3, 0 + adds r0, 0xA0 + movs r2, 0xC8 + lsls r2, 5 + adds r1, r2 + str r1, [r0] + adds r0, r3, 0 + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _0812F89C + bl gpu_pal_obj_alloc_and_load_multiple + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812F884: .4byte 0x0203aad4 +_0812F888: .4byte 0x08dd0050 +_0812F88C: .4byte 0x0203aad8 +_0812F890: .4byte 0x085a858c +_0812F894: .4byte 0x0203ab30 +_0812F898: .4byte 0x085a8334 +_0812F89C: .4byte 0x085a8544 + thumb_func_end sub_812F7E4 + + thumb_func_start sub_812F8A0 +sub_812F8A0: @ 812F8A0 + push {r4-r6,lr} + ldr r5, _0812F8FC + movs r0, 0x8 + bl malloc_and_clear + str r0, [r5] + ldr r4, _0812F900 + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + str r0, [r4] + adds r3, r0, 0 + movs r1, 0 + adds r6, r4, 0 + ldr r0, _0812F904 + ldr r4, [r0] +_0812F8C2: + movs r2, 0 + adds r1, 0x1 +_0812F8C6: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, 0x1 + cmp r2, 0x1F + bls _0812F8C6 + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x3F + bls _0812F8C2 + ldr r0, [r5] + ldr r1, [r6] + str r1, [r0] + movs r1, 0x80 + lsls r1, 4 + strh r1, [r0, 0x4] + movs r1, 0x11 + strh r1, [r0, 0x6] + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812F8FC: .4byte 0x0203ab2c +_0812F900: .4byte 0x0203aae0 +_0812F904: .4byte 0x085a83e4 + thumb_func_end sub_812F8A0 + + thumb_func_start sub_812F908 +sub_812F908: @ 812F908 + push {r4,r5,lr} + ldr r4, _0812F948 + movs r5, 0x88 + lsls r5, 6 + adds r0, r5, 0 + bl malloc + adds r1, r0, 0 + str r1, [r4] + ldr r0, _0812F94C + bl call_LZZUnCompWram + ldr r1, [r4] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _0812F950 + movs r1, 0 + movs r2, 0xA0 + bl gpu_pal_apply + ldr r0, _0812F954 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812F948: .4byte 0x0203aac8 +_0812F94C: .4byte 0x08dcdb30 +_0812F950: .4byte 0x08dcda90 +_0812F954: .4byte 0x085a8524 + thumb_func_end sub_812F908 + + thumb_func_start sub_812F958 +sub_812F958: @ 812F958 + push {lr} + bl sub_812F968 + bl sub_812F980 + pop {r0} + bx r0 + thumb_func_end sub_812F958 + + thumb_func_start sub_812F968 +sub_812F968: @ 812F968 + push {lr} + ldr r1, _0812F97C + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + pop {r0} + bx r0 + .align 2, 0 +_0812F97C: .4byte 0x08dce770 + thumb_func_end sub_812F968 + + thumb_func_start sub_812F980 +sub_812F980: @ 812F980 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r1, 0x4 + ldr r0, _0812FA74 + mov r8, r0 +_0812F98E: + movs r0, 0 + lsls r1, 16 + mov r9, r1 +_0812F994: + mov r2, r8 + ldr r1, [r2] + mov r2, r9 + asrs r6, r2, 16 + lsls r4, r0, 16 + asrs r4, 16 + adds r5, r6, r4 + adds r3, r5, 0 + adds r3, 0xA0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + mov r0, r8 + ldr r1, [r0] + adds r1, 0x2 + movs r2, 0xD0 + lsls r2, 1 + adds r3, r5, r2 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + mov r0, r8 + ldr r1, [r0] + adds r1, 0x4 + adds r3, r5, 0 + adds r3, 0xC0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + mov r2, r8 + ldr r1, [r2] + adds r1, 0x6 + movs r0, 0xC0 + lsls r0, 1 + adds r7, r0, 0 + adds r3, r5, r7 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + adds r4, 0x1 + lsls r4, 16 + lsrs r0, r4, 16 + asrs r4, 16 + cmp r4, 0x3 + ble _0812F994 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x8 + adds r3, r6, 0 + adds r3, 0xC0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + mov r0, r8 + ldr r1, [r0] + adds r1, 0xA + adds r3, r6, r7 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + movs r0, 0x7 +_0812FA32: + mov r2, r8 + ldr r1, [r2] + adds r1, 0xC + lsls r4, r0, 16 + asrs r4, 16 + lsls r3, r4, 5 + mov r0, r9 + asrs r5, r0, 16 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + adds r4, 0x1 + lsls r4, 16 + lsrs r0, r4, 16 + asrs r4, 16 + cmp r4, 0xB + ble _0812FA32 + adds r0, r5, 0x5 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _0812F98E + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812FA74: .4byte 0x0203aad0 + thumb_func_end sub_812F980 + + thumb_func_start sub_812FA78 +sub_812FA78: @ 812FA78 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, [sp, 0x10] + ldr r6, _0812FAE8 + ldr r0, [r6] + strh r1, [r0] + ldr r1, [r6] + strh r2, [r1, 0x2] + strh r3, [r1, 0x4] + strh r5, [r1, 0x6] + lsls r4, 16 + asrs r5, r4, 16 + movs r0, 0xF0 + lsls r0, 17 + adds r4, r0 + lsrs r4, 16 + movs r0, 0x2 + movs r2, 0x2 + adds r3, r4, 0 + bl gpu_copy_bg_tile_map_to_vram + ldr r1, [r6] + adds r1, 0x2 + ldr r0, _0812FAEC + adds r3, r5, r0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + ldr r1, [r6] + adds r1, 0x4 + movs r0, 0x80 + lsls r0, 2 + adds r3, r5, r0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl gpu_copy_bg_tile_map_to_vram + ldr r1, [r6] + adds r1, 0x6 + ldr r0, _0812FAF0 + adds r5, r0 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x2 + movs r2, 0x2 + adds r3, r5, 0 + bl gpu_copy_bg_tile_map_to_vram + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812FAE8: .4byte 0x0203aadc +_0812FAEC: .4byte 0x000001e1 +_0812FAF0: .4byte 0x00000201 + thumb_func_end sub_812FA78 + + thumb_func_start sub_812FAF4 +sub_812FAF4: @ 812FAF4 + push {lr} + ldr r1, _0812FB10 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + movs r0, 0x3 + bl gpu_sync_bg_hide + pop {r0} + bx r0 + .align 2, 0 +_0812FB10: .4byte 0x08dcec70 + thumb_func_end sub_812FAF4 + + thumb_func_start sub_812FB14 +sub_812FB14: @ 812FB14 + ldr r1, _0812FB88 + ldr r0, _0812FB8C + ldr r0, [r0] + str r0, [r1] + ldr r0, _0812FB90 + ldr r0, [r0] + str r0, [r1, 0x4] + ldr r0, _0812FB94 + ldr r0, [r0] + str r0, [r1, 0x8] + ldr r0, _0812FB98 + ldr r0, [r0] + str r0, [r1, 0xC] + ldr r0, _0812FB9C + ldr r0, [r0] + str r0, [r1, 0x10] + ldr r0, _0812FBA0 + ldr r0, [r0] + str r0, [r1, 0x14] + ldr r0, _0812FBA4 + ldr r0, [r0] + str r0, [r1, 0x18] + ldr r0, _0812FBA8 + ldr r0, [r0] + str r0, [r1, 0x1C] + ldr r0, _0812FBAC + ldr r0, [r0] + str r0, [r1, 0x20] + ldr r0, _0812FBB0 + ldr r0, [r0] + str r0, [r1, 0x24] + ldr r0, _0812FBB4 + ldr r0, [r0] + str r0, [r1, 0x28] + str r0, [r1, 0x2C] + str r0, [r1, 0x30] + str r0, [r1, 0x34] + ldr r0, _0812FBB8 + ldr r0, [r0] + str r0, [r1, 0x38] + str r0, [r1, 0x3C] + str r0, [r1, 0x40] + str r0, [r1, 0x44] + str r0, [r1, 0x48] + ldr r0, _0812FBBC + ldr r0, [r0] + str r0, [r1, 0x4C] + str r0, [r1, 0x50] + str r0, [r1, 0x54] + ldr r0, _0812FBC0 + ldr r0, [r0] + str r0, [r1, 0x58] + str r0, [r1, 0x5C] + str r0, [r1, 0x60] + movs r0, 0 + str r0, [r1, 0x64] + bx lr + .align 2, 0 +_0812FB88: .4byte 0x03001188 +_0812FB8C: .4byte 0x0203aaf4 +_0812FB90: .4byte 0x0203aaf8 +_0812FB94: .4byte 0x0203aafc +_0812FB98: .4byte 0x0203ab04 +_0812FB9C: .4byte 0x0203ab08 +_0812FBA0: .4byte 0x0203ab18 +_0812FBA4: .4byte 0x0203ab1c +_0812FBA8: .4byte 0x0203ab20 +_0812FBAC: .4byte 0x0203ab24 +_0812FBB0: .4byte 0x0203ab28 +_0812FBB4: .4byte 0x0203ab00 +_0812FBB8: .4byte 0x0203ab0c +_0812FBBC: .4byte 0x0203ab10 +_0812FBC0: .4byte 0x0203ab14 + thumb_func_end sub_812FB14 + + thumb_func_start sub_812FBC4 +sub_812FBC4: @ 812FBC4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, _0812FD6C + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r6, _0812FD70 + ldr r1, [r6] + str r1, [r0] + movs r5, 0xC0 + lsls r5, 3 + strh r5, [r0, 0x4] + ldr r4, _0812FD74 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + adds r1, r5 + str r1, [r0] + movs r1, 0x80 + lsls r1, 2 + mov r8, r1 + mov r2, r8 + strh r2, [r0, 0x4] + ldr r4, _0812FD78 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r3, 0x80 + lsls r3, 4 + adds r1, r3 + str r1, [r0] + mov r4, r8 + strh r4, [r0, 0x4] + ldr r4, _0812FD7C + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r2, 0xA0 + lsls r2, 4 + adds r1, r2 + str r1, [r0] + mov r3, r8 + strh r3, [r0, 0x4] + ldr r4, _0812FD80 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r4, 0xC0 + lsls r4, 4 + adds r1, r4 + str r1, [r0] + movs r5, 0xC0 + lsls r5, 2 + strh r5, [r0, 0x4] + ldr r4, _0812FD84 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + str r1, [r0] + movs r1, 0x80 + lsls r1, 3 + strh r1, [r0, 0x4] + ldr r4, _0812FD88 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r3, 0xA0 + lsls r3, 5 + adds r1, r3 + str r1, [r0] + mov r4, r8 + strh r4, [r0, 0x4] + ldr r4, _0812FD8C + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r2, 0xB0 + lsls r2, 5 + adds r1, r2 + str r1, [r0] + strh r5, [r0, 0x4] + ldr r4, _0812FD90 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r3, 0xC8 + lsls r3, 5 + adds r1, r3 + str r1, [r0] + strh r5, [r0, 0x4] + ldr r4, _0812FD94 + movs r0, 0x10 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r4, 0xE0 + lsls r4, 5 + adds r2, r1, r4 + str r2, [r0] + mov r2, r8 + strh r2, [r0, 0x4] + movs r3, 0xF0 + lsls r3, 5 + adds r1, r3 + str r1, [r0, 0x8] + strh r2, [r0, 0xC] + ldr r4, _0812FD98 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r4] + ldr r1, [r6] + movs r4, 0x80 + lsls r4, 6 + adds r1, r4 + str r1, [r0] + movs r1, 0xA0 + lsls r1, 2 + strh r1, [r0, 0x4] + ldr r4, _0812FD9C + movs r0, 0x28 + bl malloc_and_clear + str r0, [r4] + ldr r2, [r6] + movs r3, 0x8A + lsls r3, 6 + adds r1, r2, r3 + str r1, [r0] + movs r3, 0x80 + strh r3, [r0, 0x4] + movs r4, 0x8C + lsls r4, 6 + adds r1, r2, r4 + str r1, [r0, 0x8] + strh r3, [r0, 0xC] + adds r4, 0x80 + adds r1, r2, r4 + str r1, [r0, 0x10] + strh r3, [r0, 0x14] + adds r4, 0x80 + adds r1, r2, r4 + str r1, [r0, 0x18] + strh r3, [r0, 0x1C] + movs r1, 0x92 + lsls r1, 6 + adds r2, r1 + str r2, [r0, 0x20] + strh r3, [r0, 0x24] + ldr r4, _0812FDA0 + movs r0, 0x10 + bl malloc_and_clear + str r0, [r4] + ldr r2, [r6] + movs r3, 0x98 + lsls r3, 6 + adds r1, r2, r3 + str r1, [r0] + movs r1, 0x90 + lsls r1, 3 + strh r1, [r0, 0x4] + movs r4, 0xAA + lsls r4, 6 + adds r2, r4 + str r2, [r0, 0x8] + strh r1, [r0, 0xC] + ldr r4, _0812FDA4 + movs r0, 0x10 + bl malloc_and_clear + str r0, [r4] + ldr r2, [r6] + movs r3, 0xBC + lsls r3, 6 + adds r1, r2, r3 + str r1, [r0] + movs r1, 0xC0 + lsls r1, 1 + strh r1, [r0, 0x4] + movs r4, 0xC2 + lsls r4, 6 + adds r2, r4 + str r2, [r0, 0x8] + strh r1, [r0, 0xC] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0812FD6C: .4byte 0x0203aaf4 +_0812FD70: .4byte 0x0203aad4 +_0812FD74: .4byte 0x0203aaf8 +_0812FD78: .4byte 0x0203aafc +_0812FD7C: .4byte 0x0203ab00 +_0812FD80: .4byte 0x0203ab04 +_0812FD84: .4byte 0x0203ab08 +_0812FD88: .4byte 0x0203ab0c +_0812FD8C: .4byte 0x0203ab10 +_0812FD90: .4byte 0x0203ab14 +_0812FD94: .4byte 0x0203ab18 +_0812FD98: .4byte 0x0203ab1c +_0812FD9C: .4byte 0x0203ab20 +_0812FDA0: .4byte 0x0203ab24 +_0812FDA4: .4byte 0x0203ab28 + thumb_func_end sub_812FBC4 + + thumb_func_start sub_812FDA8 +sub_812FDA8: @ 812FDA8 + push {r4-r7,lr} + ldr r3, _0812FDD8 + ldr r4, _0812FDDC + ldr r1, _0812FDE0 + ldr r2, [r1] + subs r0, 0x1 + lsls r1, r0, 5 + adds r2, r1 + ldr r1, _0812FDE4 + ldr r5, _0812FDE8 + adds r2, r5 + ldm r2!, {r5-r7} + stm r1!, {r5-r7} + ldm r2!, {r5-r7} + stm r1!, {r5-r7} + ldm r2!, {r6,r7} + stm r1!, {r6,r7} + strb r0, [r3] + movs r0, 0 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812FDD8: .4byte 0x02039f5d +_0812FDDC: .4byte 0x02039f5c +_0812FDE0: .4byte 0x03005d8c +_0812FDE4: .4byte 0x02039f3c +_0812FDE8: .4byte 0x00002e90 + thumb_func_end sub_812FDA8 + + thumb_func_start sub_812FDEC +sub_812FDEC: @ 812FDEC + push {lr} + bl sub_812FE58 + pop {r0} + bx r0 + thumb_func_end sub_812FDEC + + thumb_func_start sub_812FDF8 +sub_812FDF8: @ 812FDF8 + push {lr} + bl sub_812FFC8 + bl run_remoboxes + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_812FDF8 + + thumb_func_start sub_812FE0C +sub_812FE0C: @ 812FE0C + push {r4,r5,lr} + ldr r0, _0812FE48 + ldr r0, [r0, 0x8] + bl set_callback2 + ldr r4, _0812FE4C + ldr r0, [r4] + bl free + movs r5, 0 + str r5, [r4] + ldr r4, _0812FE50 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r0, _0812FE54 + ldrb r0, [r0] + bl Window_Remove + movs r0, 0x1 + bl bg_get_tilemap + bl free + bl sub_805F094 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0812FE48: .4byte 0x030022c0 +_0812FE4C: .4byte 0x030061c4 +_0812FE50: .4byte 0x03006190 +_0812FE54: .4byte 0x030011f7 + thumb_func_end sub_812FE0C + + thumb_func_start sub_812FE58 +sub_812FE58: @ 812FE58 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _0812FE78 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bls _0812FE6E + b _0812FFA0 +_0812FE6E: + lsls r0, 2 + ldr r1, _0812FE7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0812FE78: .4byte 0x030022c0 +_0812FE7C: .4byte _0812FE80 + .align 2, 0 +_0812FE80: + .4byte _0812FE94 + .4byte _0812FEC8 + .4byte _0812FF14 + .4byte _0812FF2A + .4byte _0812FF54 +_0812FE94: + bl remove_some_task + movs r0, 0 + bl SetVBlankCallback + bl init_uns_table_pokemon_copy + ldr r1, _0812FEBC + ldr r0, _0812FEC0 + str r0, [r1] + movs r0, 0x1 + bl sub_8130238 + bl sub_81301EC + ldr r1, _0812FEC4 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0812FF3E + .align 2, 0 +_0812FEBC: .4byte 0x030061c0 +_0812FEC0: .4byte 0x02039f3c +_0812FEC4: .4byte 0x030022c0 +_0812FEC8: + bl sub_80A1A74 + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + movs r5, 0 + ldr r1, _0812FF0C + movs r4, 0x80 + lsls r4, 5 + ldr r6, _0812FF10 + movs r7, 0x85 + lsls r7, 24 +_0812FEE2: + str r5, [sp] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r4 + subs r3, r4 + cmp r3, r4 + bhi _0812FEE2 + str r5, [sp] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 2 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl reset_all_obj_data + b _0812FF36 + .align 2, 0 +_0812FF0C: .4byte 0x040000d4 +_0812FF10: .4byte 0x85000400 +_0812FF14: + ldrh r0, [r4, 0x20] + bl SeedRng + bl init_keypad_data + bl sub_8130098 + movs r0, 0x87 + lsls r0, 3 + adds r1, r4, r0 + b _0812FF3E +_0812FF2A: + ldr r0, _0812FF48 + ldrb r0, [r0] + ldr r1, _0812FF4C + ldrb r1, [r1] + bl sub_8130884 +_0812FF36: + ldr r1, _0812FF50 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0812FF3E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0812FFA0 + .align 2, 0 +_0812FF48: .4byte 0x02039f5d +_0812FF4C: .4byte 0x02039f5c +_0812FF50: .4byte 0x030022c0 +_0812FF54: + ldr r0, _0812FFA8 + ldrb r0, [r0] + ldr r1, _0812FFAC + ldrb r1, [r1] + bl sub_813010C + ldr r0, _0812FFB0 + movs r1, 0 + movs r2, 0x2 + bl gpu_pal_apply + movs r1, 0xA0 + lsls r1, 19 + movs r4, 0 + str r4, [sp] + ldr r0, _0812FFB4 + mov r2, sp + str r2, [r0] + str r1, [r0, 0x4] + ldr r1, _0812FFB8 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x2 + bl sub_80A2390 + ldr r0, _0812FFBC + bl SetVBlankCallback + ldr r0, _0812FFC0 + strb r4, [r0] + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _0812FFC4 + bl set_callback2 +_0812FFA0: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0812FFA8: .4byte 0x02039f5d +_0812FFAC: .4byte 0x02039f5c +_0812FFB0: .4byte 0x085b0838 +_0812FFB4: .4byte 0x040000d4 +_0812FFB8: .4byte 0x85000100 +_0812FFBC: .4byte sub_81302D0 + 1 +_0812FFC0: .4byte 0x030011f0 +_0812FFC4: .4byte sub_812FDF8 + 1 + thumb_func_end sub_812FE58 + + thumb_func_start sub_812FFC8 +sub_812FFC8: @ 812FFC8 + push {lr} + sub sp, 0x4 + ldr r3, _0812FFE0 + ldrb r1, [r3] + cmp r1, 0x1 + beq _0813001C + cmp r1, 0x1 + bgt _0812FFE4 + cmp r1, 0 + beq _0812FFEA + b _08130082 + .align 2, 0 +_0812FFE0: .4byte 0x030011f0 +_0812FFE4: + cmp r1, 0x2 + beq _0813005C + b _08130082 +_0812FFEA: + ldr r0, _08130010 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812FFFA + movs r0, 0x1 + strb r0, [r3] +_0812FFFA: + ldr r0, _08130014 + ldrb r0, [r0] + cmp r0, 0 + beq _08130082 + ldr r1, _08130018 + ldrh r0, [r1] + cmp r0, 0 + beq _08130082 + subs r0, 0x1 + b _08130080 + .align 2, 0 +_08130010: .4byte 0x02037fd4 +_08130014: .4byte 0x030011f6 +_08130018: .4byte 0x030011f4 +_0813001C: + ldr r0, _08130050 + ldrh r2, [r0, 0x2E] + ands r1, r2 + cmp r1, 0 + bne _0813002E + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08130040 +_0813002E: + movs r0, 0x2 + strb r0, [r3] + subs r0, 0x3 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_08130040: + ldr r0, _08130054 + ldrb r0, [r0] + cmp r0, 0 + beq _08130082 + ldr r1, _08130058 + movs r0, 0 + b _08130080 + .align 2, 0 +_08130050: .4byte 0x030022c0 +_08130054: .4byte 0x030011f6 +_08130058: .4byte 0x030011f4 +_0813005C: + ldr r0, _08130088 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813006E + ldr r0, _0813008C + bl set_callback2 +_0813006E: + ldr r0, _08130090 + ldrb r0, [r0] + cmp r0, 0 + beq _08130082 + ldr r1, _08130094 + ldrh r0, [r1] + cmp r0, 0x1D + bhi _08130082 + adds r0, 0x1 +_08130080: + strh r0, [r1] +_08130082: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08130088: .4byte 0x02037fd4 +_0813008C: .4byte sub_812FE0C + 1 +_08130090: .4byte 0x030011f6 +_08130094: .4byte 0x030011f4 + thumb_func_end sub_812FFC8 + + thumb_func_start sub_8130098 +sub_8130098: @ 8130098 + push {r4,lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08130100 + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x80 + lsls r0, 4 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r4, _08130104 + ldr r0, _08130108 + bl Window_AddFromTemplate + strb r0, [r4] + bl TextBox_ResetSomeField + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + bl gpu_sync_bg_show + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08130100: .4byte 0x085b07e8 +_08130104: .4byte 0x030011f7 +_08130108: .4byte 0x085b07ec + thumb_func_end sub_8130098 + + thumb_func_start sub_813010C +sub_813010C: @ 813010C + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081301D4 + ldr r6, _08130170 + ldr r1, [r6] + ldrb r5, [r1, 0xA] + cmp r0, 0x7 + bhi _08130190 + ldr r4, _08130174 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_818E868 + ldr r1, _08130178 + adds r0, r4, 0 + bl gf_strcat + ldr r1, _0813017C + ldr r0, [r6] + ldrb r0, [r0, 0x1E] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcat + ldr r4, _08130180 + ldr r1, [r6] + adds r1, 0x16 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + bl sub_81DB5AC + ldr r0, _08130184 + ldr r1, [r6] + adds r1, 0xB + bl gf_strcpy + ldr r0, _08130188 + ldr r1, _0813018C + bl ExpandTextCodes + b _081301A6 + .align 2, 0 +_08130170: .4byte 0x030061c0 +_08130174: .4byte 0x02021cc4 +_08130178: .4byte 0x085e8d5e +_0813017C: .4byte 0x085b07d4 +_08130180: .4byte 0x02021dc4 +_08130184: .4byte 0x02021ec4 +_08130188: .4byte 0x02021fc4 +_0813018C: .4byte 0x0827ea0c +_08130190: + ldr r0, _081301DC + adds r1, 0xB + bl gf_strcpy + ldr r0, _081301E0 + ldr r2, _081301E4 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl ExpandTextCodes +_081301A6: + ldr r4, _081301E0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl sub_81DB35C + adds r3, r0, 0 + ldr r0, _081301E8 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram +_081301D4: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081301DC: .4byte 0x02021cc4 +_081301E0: .4byte 0x02021fc4 +_081301E4: .4byte 0x085b07f4 +_081301E8: .4byte 0x030011f7 + thumb_func_end sub_813010C + + thumb_func_start sub_81301EC +sub_81301EC: @ 81301EC + push {lr} + movs r0, 0 + movs r1, 0 + bl lcd_io_set + ldr r2, _0813022C + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + ldr r1, _08130230 + movs r0, 0x8 + bl lcd_io_set + ldr r1, _08130234 + movs r0, 0xA + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_0813022C: .4byte 0x04000200 +_08130230: .4byte 0x00000c42 +_08130234: .4byte 0x00000a45 + thumb_func_end sub_81301EC + + thumb_func_start sub_8130238 +sub_8130238: @ 8130238 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0813025C + ldr r0, _08130250 + strb r1, [r0] + ldr r0, _08130254 + strh r1, [r0] + ldr r0, _08130258 + strh r1, [r0] + b _0813026E + .align 2, 0 +_08130250: .4byte 0x030011f6 +_08130254: .4byte 0x030011f2 +_08130258: .4byte 0x030011f4 +_0813025C: + ldr r1, _08130274 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _08130278 + movs r0, 0xF + strh r0, [r1] + ldr r1, _0813027C + movs r0, 0x1E + strh r0, [r1] +_0813026E: + pop {r0} + bx r0 + .align 2, 0 +_08130274: .4byte 0x030011f6 +_08130278: .4byte 0x030011f2 +_0813027C: .4byte 0x030011f4 + thumb_func_end sub_8130238 + + thumb_func_start sub_8130280 +sub_8130280: @ 8130280 + push {lr} + ldr r0, _08130294 + ldrb r0, [r0] + cmp r0, 0 + bne _08130298 + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + b _081302C0 + .align 2, 0 +_08130294: .4byte 0x030011f6 +_08130298: + ldr r1, _081302C4 + movs r0, 0xA + bl lcd_io_set + ldr r1, _081302C8 + ldr r0, _081302CC + ldrh r0, [r0] + lsrs r0, 1 + strh r0, [r1] + lsls r1, r0, 12 + lsls r2, r0, 8 + orrs r1, r2 + lsls r2, r0, 4 + orrs r1, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set +_081302C0: + pop {r0} + bx r0 + .align 2, 0 +_081302C4: .4byte 0x00000a45 +_081302C8: .4byte 0x030011f2 +_081302CC: .4byte 0x030011f4 + thumb_func_end sub_8130280 + + thumb_func_start sub_81302D0 +sub_81302D0: @ 81302D0 + push {lr} + bl sub_8130280 + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81302D0 + + thumb_func_start sub_81302E8 +sub_81302E8: @ 81302E8 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _08130334 + ldr r0, [r6] + ldr r1, [r0, 0x4] + ldr r2, [r0] + adds r0, r5, 0 + bl species_and_otid_get_pal + ldr r7, _08130338 + ldr r1, [r7] + bl call_LZZUnCompVram + cmp r4, 0 + bne _08130348 + lsls r0, r5, 3 + ldr r1, _0813033C + adds r0, r1 + ldr r4, _08130340 + ldr r1, [r4] + ldr r1, [r1, 0x8] + ldr r2, [r6] + ldr r3, [r2] + adds r2, r5, 0 + bl sub_8034B50 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldr r1, [r7] + ldr r2, _08130344 + ldr r2, [r2] + bl sub_8130380 + b _0813036C + .align 2, 0 +_08130334: .4byte 0x030061c0 +_08130338: .4byte 0x030061c4 +_0813033C: .4byte 0x0830a18c +_08130340: .4byte 0x020244d4 +_08130344: .4byte 0x03006190 +_08130348: + lsls r0, r5, 3 + ldr r1, _08130374 + adds r0, r1 + ldr r4, _08130378 + ldr r1, [r4] + ldr r1, [r1, 0x4] + ldr r2, [r6] + ldr r3, [r2] + adds r2, r5, 0 + bl sub_8034B50 + ldr r0, [r4] + ldr r0, [r0, 0x4] + ldr r1, [r7] + ldr r2, _0813037C + ldr r2, [r2] + bl sub_8130380 +_0813036C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08130374: .4byte 0x083028b8 +_08130378: .4byte 0x020244d4 +_0813037C: .4byte 0x03006190 + thumb_func_end sub_81302E8 + + thumb_func_start sub_8130380 +sub_8130380: @ 8130380 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r10, r0 + mov r9, r1 + str r2, [sp] + movs r0, 0 +_08130394: + movs r3, 0 + adds r1, r0, 0x1 + str r1, [sp, 0x4] + lsls r0, 3 + str r0, [sp, 0x8] +_0813039E: + movs r1, 0 + adds r2, r3, 0x1 + mov r8, r2 + ldr r7, [sp, 0x8] + adds r0, r7, r3 + lsls r0, 5 + mov r12, r0 + lsls r4, r3, 3 +_081303AE: + movs r3, 0 + lsls r0, r1, 2 + adds r6, r1, 0x1 + mov r2, r12 + adds r5, r2, r0 + ldr r7, [sp, 0x8] + adds r0, r7, r1 + lsls r0, 7 + ldr r1, [sp] + adds r2, r0, r1 +_081303C2: + lsrs r0, r3, 1 + adds r0, r5, r0 + add r0, r10 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _081303D6 + lsrs r1, 4 + b _081303DA +_081303D6: + movs r0, 0xF + ands r1, r0 +_081303DA: + cmp r1, 0 + bne _081303EC + adds r0, r4, r3 + lsls r0, 1 + adds r0, r2 + movs r7, 0x80 + lsls r7, 8 + adds r1, r7, 0 + b _081303F8 +_081303EC: + adds r0, r4, r3 + lsls r0, 1 + adds r0, r2 + lsls r1, 1 + add r1, r9 + ldrh r1, [r1] +_081303F8: + strh r1, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _081303C2 + lsls r0, r6, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bls _081303AE + mov r1, r8 + lsls r0, r1, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _0813039E + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x7 + bls _08130394 + 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_8130380 + + thumb_func_start sub_8130430 +sub_8130430: @ 8130430 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0813046C + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + cmp r4, 0x1 + beq _0813044E + b _081305A4 +_0813044E: + ldr r0, _08130470 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _0813050C + lsls r0, 2 + ldr r1, _08130474 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813046C: .4byte 0x085a989c +_08130470: .4byte 0x030061c0 +_08130474: .4byte _08130478 + .align 2, 0 +_08130478: + .4byte _0813048C + .4byte _081304A4 + .4byte _081304BC + .4byte _081304D4 + .4byte _081304F8 +_0813048C: + ldr r0, _0813049C + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _081304A0 + b _081304E0 + .align 2, 0 +_0813049C: .4byte 0x085a9a9c +_081304A0: .4byte 0x085ae974 +_081304A4: + ldr r0, _081304B4 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _081304B8 + b _081304E0 + .align 2, 0 +_081304B4: .4byte 0x085aab20 +_081304B8: .4byte 0x085aee80 +_081304BC: + ldr r0, _081304CC + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _081304D0 + b _081304E0 + .align 2, 0 +_081304CC: .4byte 0x085ab750 +_081304D0: .4byte 0x085af38c +_081304D4: + ldr r0, _081304EC + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _081304F0 +_081304E0: + ldr r1, _081304F4 + ldr r1, [r1] + bl RLUnCompWram + b _0813050C + .align 2, 0 +_081304EC: .4byte 0x085ac288 +_081304F0: .4byte 0x085af898 +_081304F4: .4byte 0x03006190 +_081304F8: + ldr r0, _08130588 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _0813058C + ldr r1, _08130590 + ldr r1, [r1] + bl RLUnCompWram +_0813050C: + movs r1, 0 + ldr r5, _08130594 + ldr r0, _08130598 + adds r4, r0, 0 +_08130514: + movs r3, 0 + lsls r2, r1, 5 +_08130518: + adds r0, r2, r3 + lsls r0, 1 + adds r0, r5 + strh r4, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1F + bls _08130518 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bls _08130514 + movs r1, 0 + ldr r0, _0813059C + mov r12, r0 + ldr r7, _08130590 +_0813053C: + movs r3, 0 + adds r6, r1, 0x1 + lsls r5, r1, 5 + lsls r4, r1, 6 +_08130544: + adds r2, r5, r3 + lsls r2, 1 + add r2, r12 + ldr r0, [r7] + adds r0, r4, r0 + lsls r1, r3, 1 + adds r0, r1 + adds r0, 0x8C + ldrh r0, [r0] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x11 + bls _08130544 + lsls r0, r6, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _0813053C + movs r3, 0 + ldr r4, _081305A0 + ldr r2, _08130590 +_08130570: + lsls r1, r3, 1 + adds r1, r4 + ldr r0, [r2] + adds r0, 0x8E + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _08130570 + b _08130676 + .align 2, 0 +_08130588: .4byte 0x085ad240 +_0813058C: .4byte 0x085afda4 +_08130590: .4byte 0x03006190 +_08130594: .4byte 0x06006000 +_08130598: .4byte 0x00001015 +_0813059C: .4byte 0x0600608c +_081305A0: .4byte 0x0600608e +_081305A4: + cmp r5, 0x7 + bhi _081305C0 + ldr r0, _081305B8 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _081305BC + b _08130650 + .align 2, 0 +_081305B8: .4byte 0x085ae370 +_081305BC: .4byte 0x085b02b0 +_081305C0: + ldr r0, _081305E0 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _08130676 + lsls r0, 2 + ldr r1, _081305E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081305E0: .4byte 0x030061c0 +_081305E4: .4byte _081305E8 + .align 2, 0 +_081305E8: + .4byte _081305FC + .4byte _08130614 + .4byte _0813062C + .4byte _08130644 + .4byte _08130664 +_081305FC: + ldr r0, _0813060C + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _08130610 + b _08130650 + .align 2, 0 +_0813060C: .4byte 0x085a9a9c +_08130610: .4byte 0x085ae974 +_08130614: + ldr r0, _08130624 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _08130628 + b _08130650 + .align 2, 0 +_08130624: .4byte 0x085aab20 +_08130628: .4byte 0x085aee80 +_0813062C: + ldr r0, _0813063C + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _08130640 + b _08130650 + .align 2, 0 +_0813063C: .4byte 0x085ab750 +_08130640: .4byte 0x085af38c +_08130644: + ldr r0, _08130658 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _0813065C +_08130650: + ldr r1, _08130660 + bl RLUnCompVram + b _08130676 + .align 2, 0 +_08130658: .4byte 0x085ac288 +_0813065C: .4byte 0x085af898 +_08130660: .4byte 0x06006000 +_08130664: + ldr r0, _0813067C + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, _08130680 + ldr r1, _08130684 + bl RLUnCompVram +_08130676: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813067C: .4byte 0x085ad240 +_08130680: .4byte 0x085afda4 +_08130684: .4byte 0x06006000 + thumb_func_end sub_8130430 + + thumb_func_start sub_8130688 +sub_8130688: @ 8130688 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _081306BC + ldr r1, _081306C0 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r3, 0x38] + str r2, [r3, 0x3C] + ldrh r2, [r3, 0x3C] + ldr r1, _081306C4 + ands r1, r2 + strh r1, [r3, 0x3C] + ldrh r1, [r3, 0x3A] + ldr r0, _081306C8 + ands r0, r1 + movs r1, 0x58 + orrs r0, r1 + strh r0, [r3, 0x3A] + adds r1, r3, 0 + adds r1, 0x38 + movs r0, 0x18 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081306BC: .4byte 0x030022c0 +_081306C0: .4byte 0x085b0830 +_081306C4: .4byte 0xfffffc00 +_081306C8: .4byte 0xfffffe00 + thumb_func_end sub_8130688 + + thumb_func_start sub_81306CC +sub_81306CC: @ 81306CC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _081306E4 + ldr r0, _081306E0 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + b _081306F4 + .align 2, 0 +_081306E0: .4byte 0x030061c0 +_081306E4: + ldr r0, _08130704 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 +_081306F4: + cmp r0, 0x4 + bhi _08130732 + lsls r0, 2 + ldr r1, _08130708 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08130704: .4byte 0x030061c0 +_08130708: .4byte _0813070C + .align 2, 0 +_0813070C: + .4byte _08130720 + .4byte _08130724 + .4byte _08130728 + .4byte _0813072C + .4byte _08130730 +_08130720: + movs r0, 0x9 + b _08130732 +_08130724: + movs r0, 0xD + b _08130732 +_08130728: + movs r0, 0x2 + b _08130732 +_0813072C: + movs r0, 0x24 + b _08130732 +_08130730: + movs r0, 0x6 +_08130732: + pop {r1} + bx r1 + thumb_func_end sub_81306CC + + thumb_func_start sub_8130738 +sub_8130738: @ 8130738 + push {r4,lr} + ldr r4, _08130758 + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + ldr r4, _0813075C + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08130758: .4byte 0x030061c4 +_0813075C: .4byte 0x03006190 + thumb_func_end sub_8130738 + + thumb_func_start sub_8130760 +sub_8130760: @ 8130760 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _081307A0 + ldr r0, _081307A4 + ldr r0, [r0] + str r0, [r1, 0x4] + ldr r0, _081307A8 + ldr r0, [r0] + str r0, [r1, 0x8] + movs r2, 0 + strb r2, [r1, 0x18] + ldr r0, _081307AC + ldr r0, [r0] + ldrb r0, [r0] + strb r0, [r1, 0x1F] + strb r2, [r1, 0x19] + strb r2, [r1, 0x1A] + movs r0, 0x40 + strb r0, [r1, 0x1B] + strb r0, [r1, 0x1C] + strb r0, [r1, 0x1D] + strb r0, [r1, 0x1E] + subs r0, r3, 0x2 + adds r4, r1, 0 + cmp r0, 0x22 + bhi _08130844 + lsls r0, 2 + ldr r1, _081307B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081307A0: .4byte 0x030061a0 +_081307A4: .4byte 0x03006190 +_081307A8: .4byte 0x030061c4 +_081307AC: .4byte 0x030061c0 +_081307B0: .4byte _081307B4 + .align 2, 0 +_081307B4: + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130840 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130840 +_08130840: + movs r0, 0x3 + b _08130846 +_08130844: + movs r0, 0x1 +_08130846: + strh r0, [r4, 0x14] + movs r0, 0x2 + strh r0, [r4, 0x16] + strb r3, [r4] + ldr r0, _0813087C + str r0, [r4, 0x10] + adds r0, r4, 0 + bl sub_8124F2C + adds r0, r4, 0 + bl sub_81261A4 + adds r0, r4, 0 + bl sub_8126058 + ldr r0, _08130880 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x80 + lsls r2, 2 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813087C: .4byte 0x06010000 +_08130880: .4byte 0x030061c4 + thumb_func_end sub_8130760 + + thumb_func_start sub_8130884 +sub_8130884: @ 8130884 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + bl sub_8130738 + ldr r0, _081308C4 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + movs r1, 0 + bl sub_81302E8 + adds r0, r4, 0 + bl sub_81306CC + lsls r0, 24 + lsrs r0, 24 + bl sub_8130760 + adds r0, r4, 0 + bl sub_8130688 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8130430 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081308C4: .4byte 0x030061c0 + thumb_func_end sub_8130884 + + thumb_func_start sub_81308C8 +sub_81308C8: @ 81308C8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _0813093C + ldr r0, [r1] + ldr r3, [r0, 0x18] + movs r4, 0 + mov r12, r1 + ldr r2, _08130940 + movs r1, 0 +_081308DC: + adds r0, r3, r4 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x53 + bls _081308DC + ldr r0, [r2] + ldr r1, _08130944 + ands r0, r1 + cmp r0, 0x8 + bne _0813092E + movs r4, 0 + ldr r6, _08130948 + ldr r5, _0813094C +_081308F6: + lsls r2, r4, 1 + ldrh r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r2, r5 + ldrh r3, [r2] + cmp r3, 0 + beq _08130928 + mov r0, r12 + ldr r2, [r0] + ldr r1, [r2, 0x18] + adds r0, r1, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x48 + adds r1, r0 + strh r3, [r1] + ldr r1, [r2, 0x18] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08130928: + adds r4, 0x1 + cmp r4, 0x3 + ble _081308F6 +_0813092E: + adds r0, r7, 0 + bl sub_8130950 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813093C: .4byte 0x020244a8 +_08130940: .4byte 0x02022fec +_08130944: .4byte 0x0a7f098a +_08130948: .4byte 0x02038bca +_0813094C: .4byte 0x08310040 + thumb_func_end sub_81308C8 + + thumb_func_start sub_8130950 +sub_8130950: @ 8130950 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08130988 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r4, 0 + ldr r6, _0813098C + movs r3, 0 +_08130962: + adds r0, r1, r4 + strb r3, [r0] + adds r4, 0x1 + cmp r4, 0x1B + bls _08130962 + movs r4, 0 + ldr r3, _08130988 + movs r5, 0x1 +_08130972: + adds r1, r2, 0 + ands r1, r5 + cmp r1, 0 + beq _08130990 + ldr r0, [r3] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r0, r4 + movs r1, 0x64 + b _08130998 + .align 2, 0 +_08130988: .4byte 0x020244a8 +_0813098C: .4byte 0x02024064 +_08130990: + ldr r0, [r3] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r0, r4 +_08130998: + strb r1, [r0] + lsrs r2, 1 + adds r4, 0x1 + cmp r4, 0x3 + ble _08130972 + ldrb r0, [r6] + movs r1, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, _08130A44 +_081309B4: + ldr r7, _08130A48 + lsls r0, r4, 2 + adds r0, r7 + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + beq _081309CE + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r0, r4 + movs r1, 0 + strb r1, [r0] +_081309CE: + bl GenerateRandomNumber + ldr r1, [r5] + ldr r2, [r1, 0x14] + adds r2, 0x18 + adds r2, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + strb r1, [r2] + adds r4, 0x1 + cmp r4, 0x3 + ble _081309B4 + ldr r0, _08130A44 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + ldr r0, _08130A4C + ldr r6, _08130A50 + ldrb r2, [r6] + strb r2, [r0] + ldr r0, _08130A54 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08130A60 + ldr r5, _08130A58 + bl GenerateRandomNumber + adds r4, r0, 0 + ldrb r0, [r6] + bl battle_side_get_owner + movs r3, 0x2 + adds r1, r3, 0 + ands r1, r4 + movs r2, 0x1 + eors r0, r2 + adds r1, r0 + strb r1, [r5] + ldr r0, _08130A5C + ldrb r1, [r0] + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08130A68 + eors r2, r3 + strb r2, [r5] + b _08130A68 + .align 2, 0 +_08130A44: .4byte 0x020244a8 +_08130A48: .4byte 0x0832a328 +_08130A4C: .4byte 0x0203ab3c +_08130A50: .4byte 0x02024064 +_08130A54: .4byte 0x02022fec +_08130A58: .4byte 0x0202420c +_08130A5C: .4byte 0x02024210 +_08130A60: + ldr r0, _08130A7C + movs r1, 0x1 + eors r1, r2 + strb r1, [r0] +_08130A68: + ldr r0, _08130A80 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _08130A84 + bl sub_8186438 + b _08130AE6 + .align 2, 0 +_08130A7C: .4byte 0x0202420c +_08130A80: .4byte 0x02022fec +_08130A84: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08130AA0 + ldr r0, _08130A9C + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x80 + lsls r0, 23 + str r0, [r1, 0xC] + b _08130B72 + .align 2, 0 +_08130A9C: .4byte 0x020244a8 +_08130AA0: + movs r0, 0x80 + lsls r0, 3 + ands r0, r1 + cmp r0, 0 + beq _08130ABC + ldr r0, _08130AB8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x80 + lsls r0, 22 + str r0, [r1, 0xC] + b _08130B72 + .align 2, 0 +_08130AB8: .4byte 0x020244a8 +_08130ABC: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08130AD8 + ldr r0, _08130AD4 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x80 + lsls r0, 24 + str r0, [r1, 0xC] + b _08130B72 + .align 2, 0 +_08130AD4: .4byte 0x020244a8 +_08130AD8: + movs r0, 0x80 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + beq _08130AF4 + bl sub_81A6FB4 +_08130AE6: + ldr r1, _08130AF0 + ldr r1, [r1] + ldr r1, [r1, 0x14] + str r0, [r1, 0xC] + b _08130B72 + .align 2, 0 +_08130AF0: .4byte 0x020244a8 +_08130AF4: + ldr r0, _08130B08 + ands r0, r1 + cmp r0, 0 + beq _08130B10 + ldr r0, _08130B0C + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x7 + str r0, [r1, 0xC] + b _08130B72 + .align 2, 0 +_08130B08: .4byte 0x0c3f0900 +_08130B0C: .4byte 0x020244a8 +_08130B10: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _08130B58 + ldr r0, _08130B48 + ldr r0, [r0] + ldr r4, [r0, 0x14] + ldr r3, _08130B4C + ldr r0, _08130B50 + ldrh r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, 0x1C + adds r1, r3 + ldr r0, _08130B54 + ldrh r2, [r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + ldr r1, [r1] + ldr r0, [r0] + orrs r1, r0 + str r1, [r4, 0xC] + b _08130B72 + .align 2, 0 +_08130B48: .4byte 0x020244a8 +_08130B4C: .4byte 0x08310030 +_08130B50: .4byte 0x02038bca +_08130B54: .4byte 0x02038bcc +_08130B58: + ldr r0, _08130B94 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08130B98 + ldr r0, _08130B9C + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x1C + adds r0, r2 + ldr r0, [r0] + str r0, [r3, 0xC] +_08130B72: + ldr r0, _08130BA0 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08130B8C + ldr r0, _08130B94 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, [r2, 0xC] + movs r1, 0x80 + orrs r0, r1 + str r0, [r2, 0xC] +_08130B8C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08130B94: .4byte 0x020244a8 +_08130B98: .4byte 0x08310030 +_08130B9C: .4byte 0x02038bca +_08130BA0: .4byte 0x02022fec + thumb_func_end sub_8130950 + + thumb_func_start sub_8130BA4 +sub_8130BA4: @ 8130BA4 + push {r4,lr} + ldr r0, _08130BBC + ldrh r4, [r0] + ldr r0, _08130BC0 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08130BC4 + bl sub_8130BDC + b _08130BC8 + .align 2, 0 +_08130BBC: .4byte 0x020241ea +_08130BC0: .4byte 0x02022fec +_08130BC4: + bl sub_8130CF4 +_08130BC8: + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _08130BD8 + strh r4, [r0] + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08130BD8: .4byte 0x020241ea + thumb_func_end sub_8130BA4 + + thumb_func_start sub_8130BDC +sub_8130BDC: @ 8130BDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + bl sub_8131074 + ldr r1, _08130C44 + ldr r0, [r1] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0xC] + cmp r0, 0 + beq _08130C2C + adds r4, r1, 0 + movs r5, 0 +_08130BF8: + ldr r0, [r4] + ldr r2, [r0, 0x14] + ldr r0, [r2, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08130C0C + strb r5, [r2] + bl tai_run_script +_08130C0C: + ldr r0, [r4] + ldr r1, [r0, 0x14] + ldr r0, [r1, 0xC] + lsrs r0, 1 + str r0, [r1, 0xC] + ldrb r0, [r1, 0x11] + adds r0, 0x1 + strb r0, [r1, 0x11] + ldr r0, [r4] + ldr r0, [r0, 0x14] + strb r5, [r0, 0x1] + ldr r0, [r4] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0xC] + cmp r0, 0 + bne _08130BF8 +_08130C2C: + ldr r1, _08130C44 + ldr r0, [r1] + ldr r3, [r0, 0x14] + ldrb r2, [r3, 0x10] + movs r0, 0x2 + ands r0, r2 + mov r12, r1 + cmp r0, 0 + beq _08130C48 + movs r0, 0x4 + b _08130CE0 + .align 2, 0 +_08130C44: .4byte 0x020244a8 +_08130C48: + movs r0, 0x4 + ands r0, r2 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08130C58 + movs r0, 0x5 + b _08130CE0 +_08130C58: + movs r6, 0x1 + mov r1, sp + ldrb r0, [r3, 0x4] + strb r0, [r1] + add r0, sp, 0x4 + strb r2, [r0] + movs r3, 0x1 + mov r8, r0 + ldr r1, _08130CEC + ldr r0, _08130CF0 + ldrb r2, [r0] + mov r5, sp + mov r7, r8 + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r4, r1, 0 + adds r4, 0xE +_08130C7C: + ldrh r0, [r4] + cmp r0, 0 + beq _08130CC6 + ldrb r1, [r5] + mov r2, r12 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _08130CAA + mov r0, sp + adds r1, r0, r6 + ldrb r0, [r2] + strb r0, [r1] + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r7, r1 + strb r3, [r1] +_08130CAA: + ldrb r1, [r5] + mov r2, r12 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08130CC6 + movs r6, 0x1 + ldrb r0, [r2] + strb r0, [r5] + strb r3, [r7] +_08130CC6: + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08130C7C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + add r0, r8 + ldrb r0, [r0] +_08130CE0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08130CEC: .4byte 0x02024084 +_08130CF0: .4byte 0x0203ab3c + thumb_func_end sub_8130BDC + + thumb_func_start sub_8130CF4 +sub_8130CF4: @ 8130CF4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x1C] + mov r2, sp + adds r2, 0x8 + str r2, [sp, 0x18] + str r1, [sp, 0x20] + mov r10, sp +_08130D14: + ldr r0, _08130D3C + ldrb r0, [r0] + cmp r8, r0 + beq _08130D2E + movs r0, 0x58 + mov r7, r8 + muls r7, r0 + adds r0, r7, 0 + ldr r1, _08130D40 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08130D48 +_08130D2E: + movs r0, 0xFF + ldr r2, [sp, 0x20] + strb r0, [r2] + ldr r0, _08130D44 + mov r7, r10 + strh r0, [r7] + b _08130EAE + .align 2, 0 +_08130D3C: .4byte 0x0203ab3c +_08130D40: .4byte 0x02024084 +_08130D44: .4byte 0x0000ffff +_08130D48: + ldr r0, _08130D68 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _08130D70 + ldr r0, _08130D6C + ldr r0, [r0] + adds r0, 0x92 + ldrb r0, [r0] + lsrs r0, 4 + bl sub_8130950 + b _08130D76 + .align 2, 0 +_08130D68: .4byte 0x02022fec +_08130D6C: .4byte 0x0202449c +_08130D70: + movs r0, 0xF + bl sub_8130950 +_08130D76: + ldr r0, _08130DF0 + mov r1, r8 + strb r1, [r0] + movs r1, 0x1 + mov r2, r8 + ands r2, r1 + ldr r0, _08130DF4 + ldrb r0, [r0] + ands r1, r0 + cmp r2, r1 + beq _08130D90 + bl sub_8131074 +_08130D90: + ldr r2, _08130DF8 + ldr r0, [r2] + ldr r0, [r0, 0x14] + movs r1, 0 + strb r1, [r0, 0x11] + ldr r0, [r2] + ldr r0, [r0, 0x14] + strb r1, [r0, 0x1] + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldr r4, [r0, 0xC] + mov r9, r2 + cmp r4, 0 + beq _08130DD8 + mov r5, r9 + movs r6, 0 +_08130DB0: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08130DC2 + ldr r0, [r5] + ldr r0, [r0, 0x14] + strb r6, [r0] + bl tai_run_script +_08130DC2: + asrs r4, 1 + ldr r0, [r5] + ldr r1, [r0, 0x14] + ldrb r0, [r1, 0x11] + adds r0, 0x1 + strb r0, [r1, 0x11] + ldr r0, [r5] + ldr r0, [r0, 0x14] + strb r6, [r0, 0x1] + cmp r4, 0 + bne _08130DB0 +_08130DD8: + mov r2, r9 + ldr r0, [r2] + ldr r3, [r0, 0x14] + ldrb r1, [r3, 0x10] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08130DFC + movs r0, 0x4 + ldr r7, [sp, 0x20] + strb r0, [r7] + b _08130EAE + .align 2, 0 +_08130DF0: .4byte 0x0202420c +_08130DF4: .4byte 0x0203ab3c +_08130DF8: .4byte 0x020244a8 +_08130DFC: + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08130E10 + movs r0, 0x5 + ldr r1, [sp, 0x20] + strb r0, [r1] + b _08130EAE +_08130E10: + add r1, sp, 0x10 + ldrb r0, [r3, 0x4] + strb r0, [r1] + add r0, sp, 0x14 + strb r2, [r0] + movs r5, 0x1 + movs r3, 0x1 + adds r6, r1, 0 + ldr r0, _08130F38 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r2, _08130F3C + adds r0, r2 + adds r4, r0, 0x2 + add r7, sp, 0x14 +_08130E30: + ldrh r0, [r4] + cmp r0, 0 + beq _08130E72 + ldrb r1, [r6] + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _08130E56 + adds r0, r6, r5 + ldrb r1, [r2] + strb r1, [r0] + adds r0, r7, r5 + strb r3, [r0] + adds r5, 0x1 +_08130E56: + ldrb r1, [r6] + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08130E72 + ldrb r0, [r2] + strb r0, [r6] + strb r3, [r7] + movs r5, 0x1 +_08130E72: + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08130E30 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + add r0, sp + adds r0, 0x14 + ldrb r0, [r0] + ldr r7, [sp, 0x20] + strb r0, [r7] + ldrb r2, [r6] + mov r0, r10 + strh r2, [r0] + ldr r0, _08130F38 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + cmp r8, r0 + bne _08130EAE + cmp r2, 0x63 + bgt _08130EAE + ldr r0, _08130F40 + mov r1, r10 + strh r0, [r1] +_08130EAE: + ldr r2, [sp, 0x20] + adds r2, 0x1 + str r2, [sp, 0x20] + movs r7, 0x2 + add r10, r7 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + bgt _08130EC4 + b _08130D14 +_08130EC4: + mov r0, sp + ldrh r5, [r0] + movs r0, 0 + ldr r2, [sp, 0x18] + strb r0, [r2] + movs r4, 0x1 + mov r8, r4 + ldr r6, _08130F44 + ldr r3, [sp, 0x18] + mov r1, sp + adds r1, 0x2 +_08130EDA: + lsls r0, r5, 16 + asrs r2, r0, 16 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r2, r0 + bne _08130EEE + adds r0, r3, r4 + mov r7, r8 + strb r7, [r0] + adds r4, 0x1 +_08130EEE: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r2, r0 + bge _08130EFE + ldrh r5, [r1] + mov r0, r8 + strb r0, [r3] + movs r4, 0x1 +_08130EFE: + adds r1, 0x2 + movs r2, 0x1 + add r8, r2 + mov r7, r8 + cmp r7, 0x3 + ble _08130EDA + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + ldr r1, [sp, 0x18] + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r6] + ldrb r0, [r6] + ldr r2, [sp, 0x1C] + adds r0, r2, r0 + ldrb r0, [r0] + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08130F38: .4byte 0x0203ab3c +_08130F3C: .4byte 0x02024090 +_08130F40: .4byte 0x0000ffff +_08130F44: .4byte 0x0202420c + thumb_func_end sub_8130CF4 + + thumb_func_start tai_run_script +tai_run_script: @ 8130F48 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r7, _08130FC0 + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrb r0, [r0] + adds r6, r7, 0 + cmp r0, 0x2 + bne _08130F60 + b _08131066 +_08130F60: + mov r9, r7 + ldr r0, _08130FC4 + mov r8, r0 +_08130F66: + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0, 0x14] + ldrb r0, [r2] + cmp r0, 0x1 + beq _08130FD4 + cmp r0, 0x1 + bgt _0813105A + cmp r0, 0 + bne _0813105A + ldr r1, _08130FC8 + ldrb r0, [r2, 0x11] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + mov r1, r8 + str r0, [r1] + ldr r5, _08130FCC + ldrb r4, [r2, 0x1] + ldr r0, _08130FD0 + ldrb r1, [r0] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r4, r3 + adds r1, r5, 0 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08130FB0 + lsls r0, r4, 1 + adds r0, r3 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] +_08130FB0: + strh r0, [r2, 0x2] + ldr r0, [r6] + ldr r1, [r0, 0x14] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0813105A + .align 2, 0 +_08130FC0: .4byte 0x020244a8 +_08130FC4: .4byte 0x0203ab38 +_08130FC8: .4byte 0x082dbef8 +_08130FCC: .4byte 0x02024084 +_08130FD0: .4byte 0x0203ab3c +_08130FD4: + ldrh r1, [r2, 0x2] + cmp r1, 0 + beq _08130FF4 + ldr r1, _08130FF0 + mov r2, r8 + ldr r0, [r2] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + b _0813100A + .align 2, 0 +_08130FF0: .4byte 0x085b083c +_08130FF4: + adds r0, r2, 0x4 + ldrb r2, [r2, 0x1] + adds r0, r2 + strb r1, [r0] + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x10] +_0813100A: + ldr r2, _08131040 + ldr r0, [r2] + ldr r3, [r0, 0x14] + ldrb r1, [r3, 0x10] + movs r0, 0x1 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0813105A + ldrb r0, [r3, 0x1] + adds r0, 0x1 + strb r0, [r3, 0x1] + ldr r0, [r6] + ldr r2, [r0, 0x14] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + bhi _08131044 + ldrb r1, [r2, 0x10] + movs r0, 0x8 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08131044 + strb r0, [r2] + b _0813104E + .align 2, 0 +_08131040: .4byte 0x020244a8 +_08131044: + ldr r0, [r6] + ldr r1, [r0, 0x14] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0813104E: + ldr r0, [r6] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x10] +_0813105A: + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrb r0, [r0] + cmp r0, 0x2 + beq _08131066 + b _08130F66 +_08131066: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai_run_script + + thumb_func_start sub_8131074 +sub_8131074: @ 8131074 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r4, _081310C0 + ldr r0, [r4] + ldr r2, [r0, 0x18] + ldr r3, _081310C4 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r2, r0 + ldr r5, _081310C8 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r2] + mov r8, r4 + mov r12, r3 + ldrh r1, [r1] + cmp r0, r1 + beq _081310E4 + adds r6, r5, 0 + movs r5, 0 +_081310A0: + mov r1, r8 + ldr r0, [r1] + ldr r4, [r0, 0x18] + mov r0, r12 + ldrb r1, [r0] + lsls r3, r1, 4 + adds r0, r5, r3 + adds r2, r4, r0 + ldrh r0, [r2] + cmp r0, 0 + bne _081310CC + lsls r0, r1, 1 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r2] + b _081310E4 + .align 2, 0 +_081310C0: .4byte 0x020244a8 +_081310C4: .4byte 0x0202420c +_081310C8: .4byte 0x02024248 +_081310CC: + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + bgt _081310E4 + adds r0, r5, r3 + adds r0, r4, r0 + lsls r1, 1 + adds r1, r6 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bne _081310A0 +_081310E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8131074 + + thumb_func_start sub_81310F0 +sub_81310F0: @ 81310F0 + push {r4,lr} + lsls r0, 24 + ldr r4, _08131114 + movs r3, 0 + lsrs r1, r0, 20 + movs r2, 0x3 +_081310FC: + ldr r0, [r4] + ldr r0, [r0, 0x18] + adds r0, r1 + strh r3, [r0] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _081310FC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08131114: .4byte 0x020244a8 + thumb_func_end sub_81310F0 + + thumb_func_start b_history__record_ability_usage_of_player +b_history__record_ability_usage_of_player: @ 8131118 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813112C + ldr r2, [r2] + ldr r2, [r2, 0x18] + adds r2, 0x40 + adds r2, r0 + strb r1, [r2] + bx lr + .align 2, 0 +_0813112C: .4byte 0x020244a8 + thumb_func_end b_history__record_ability_usage_of_player + + thumb_func_start sub_8131130 +sub_8131130: @ 8131130 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08131144 + ldr r1, [r1] + ldr r1, [r1, 0x18] + adds r1, 0x40 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08131144: .4byte 0x020244a8 + thumb_func_end sub_8131130 + + thumb_func_start b_history__record_item_x12_of_player +b_history__record_item_x12_of_player: @ 8131148 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813115C + ldr r2, [r2] + ldr r2, [r2, 0x18] + adds r2, 0x44 + adds r2, r0 + strb r1, [r2] + bx lr + .align 2, 0 +_0813115C: .4byte 0x020244a8 + thumb_func_end b_history__record_item_x12_of_player + + thumb_func_start sub_8131160 +sub_8131160: @ 8131160 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08131174 + ldr r1, [r1] + ldr r1, [r1, 0x18] + adds r1, 0x44 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08131174: .4byte 0x020244a8 + thumb_func_end sub_8131160 + + thumb_func_start tai00_unk +tai00_unk: @ 8131178 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, _081311AC + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + bcs _081311B0 + 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 _081311B4 + .align 2, 0 +_081311AC: .4byte 0x0203ab38 +_081311B0: + adds r0, r2, 0x6 + str r0, [r3] +_081311B4: + pop {r0} + bx r0 + thumb_func_end tai00_unk + + thumb_func_start tai01_unk +tai01_unk: @ 81311B8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, _081311EC + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + bls _081311F0 + 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 _081311F4 + .align 2, 0 +_081311EC: .4byte 0x0203ab38 +_081311F0: + adds r0, r2, 0x6 + str r0, [r3] +_081311F4: + pop {r0} + bx r0 + thumb_func_end tai01_unk + + thumb_func_start tai02_unk +tai02_unk: @ 81311F8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, _0813122C + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + bne _08131230 + 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 _08131234 + .align 2, 0 +_0813122C: .4byte 0x0203ab38 +_08131230: + adds r0, r2, 0x6 + str r0, [r3] +_08131234: + pop {r0} + bx r0 + thumb_func_end tai02_unk + + thumb_func_start tai03_unk +tai03_unk: @ 8131238 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, _0813126C + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + beq _08131270 + 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 _08131274 + .align 2, 0 +_0813126C: .4byte 0x0203ab38 +_08131270: + adds r0, r2, 0x6 + str r0, [r3] +_08131274: + pop {r0} + bx r0 + thumb_func_end tai03_unk + + thumb_func_start tai04_unk +tai04_unk: @ 8131278 + push {r4,lr} + ldr r2, _081312B4 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r1, r0, 0x4 + ldrb r0, [r0, 0x1] + adds r1, r0 + ldr r3, _081312B8 + ldr r0, [r3] + ldrb r0, [r0, 0x1] + ldrb r4, [r1] + adds r0, r4 + strb r0, [r1] + ldr r0, [r2] + ldr r1, [r0, 0x14] + adds r0, r1, 0x4 + ldrb r1, [r1, 0x1] + adds r1, r0, r1 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + bge _081312A8 + movs r0, 0 + strb r0, [r1] +_081312A8: + ldr r0, [r3] + adds r0, 0x2 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081312B4: .4byte 0x020244a8 +_081312B8: .4byte 0x0203ab38 + thumb_func_end tai04_unk + + thumb_func_start tai05_unk +tai05_unk: @ 81312BC + push {r4,lr} + ldr r0, _081312D0 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _081312D8 + ldr r0, _081312D4 + b _081312DA + .align 2, 0 +_081312D0: .4byte 0x0203ab38 +_081312D4: .4byte 0x0203ab3c +_081312D8: + ldr r0, _08131310 +_081312DA: + ldrb r1, [r0] + ldr r2, _08131314 + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + bcs _08131318 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813131C + .align 2, 0 +_08131310: .4byte 0x0202420c +_08131314: .4byte 0x02024084 +_08131318: + adds r0, r2, 0x7 + str r0, [r4] +_0813131C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai05_unk + + thumb_func_start tai06_unk +tai06_unk: @ 8131324 + push {r4,lr} + ldr r0, _08131338 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08131340 + ldr r0, _0813133C + b _08131342 + .align 2, 0 +_08131338: .4byte 0x0203ab38 +_0813133C: .4byte 0x0203ab3c +_08131340: + ldr r0, _08131378 +_08131342: + ldrb r1, [r0] + ldr r2, _0813137C + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + bls _08131380 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131384 + .align 2, 0 +_08131378: .4byte 0x0202420c +_0813137C: .4byte 0x02024084 +_08131380: + adds r0, r2, 0x7 + str r0, [r4] +_08131384: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai06_unk + + thumb_func_start tai07_unk +tai07_unk: @ 813138C + push {r4,lr} + ldr r0, _081313A0 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _081313A8 + ldr r0, _081313A4 + b _081313AA + .align 2, 0 +_081313A0: .4byte 0x0203ab38 +_081313A4: .4byte 0x0203ab3c +_081313A8: + ldr r0, _081313E0 +_081313AA: + ldrb r1, [r0] + ldr r2, _081313E4 + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + bne _081313E8 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081313EC + .align 2, 0 +_081313E0: .4byte 0x0202420c +_081313E4: .4byte 0x02024084 +_081313E8: + adds r0, r2, 0x7 + str r0, [r4] +_081313EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai07_unk + + thumb_func_start tai08_unk +tai08_unk: @ 81313F4 + push {r4,lr} + ldr r0, _08131408 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08131410 + ldr r0, _0813140C + b _08131412 + .align 2, 0 +_08131408: .4byte 0x0203ab38 +_0813140C: .4byte 0x0203ab3c +_08131410: + ldr r0, _08131448 +_08131412: + ldrb r1, [r0] + ldr r2, _0813144C + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + beq _08131450 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131454 + .align 2, 0 +_08131448: .4byte 0x0202420c +_0813144C: .4byte 0x02024084 +_08131450: + adds r0, r2, 0x7 + str r0, [r4] +_08131454: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai08_unk + + thumb_func_start tai09_unk +tai09_unk: @ 813145C + push {r4,r5,lr} + ldr r0, _08131470 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08131478 + ldr r0, _08131474 + b _0813147A + .align 2, 0 +_08131470: .4byte 0x0203ab38 +_08131474: .4byte 0x0203ab3c +_08131478: + ldr r0, _081314BC +_0813147A: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, _081314C0 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + beq _081314C4 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _081314CA + .align 2, 0 +_081314BC: .4byte 0x0202420c +_081314C0: .4byte 0x02024084 +_081314C4: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_081314CA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai09_unk + + thumb_func_start tai0A_unk +tai0A_unk: @ 81314D0 + push {r4,r5,lr} + ldr r0, _081314E4 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _081314EC + ldr r0, _081314E8 + b _081314EE + .align 2, 0 +_081314E4: .4byte 0x0203ab38 +_081314E8: .4byte 0x0203ab3c +_081314EC: + ldr r0, _08131530 +_081314EE: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, _08131534 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _08131538 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _0813153E + .align 2, 0 +_08131530: .4byte 0x0202420c +_08131534: .4byte 0x02024084 +_08131538: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_0813153E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0A_unk + + thumb_func_start tai0B_unk +tai0B_unk: @ 8131544 + push {r4,r5,lr} + ldr r0, _08131558 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08131560 + ldr r0, _0813155C + b _08131562 + .align 2, 0 +_08131558: .4byte 0x0203ab38 +_0813155C: .4byte 0x0203ab3c +_08131560: + ldr r0, _081315A4 +_08131562: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, _081315A8 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + beq _081315AC + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _081315B2 + .align 2, 0 +_081315A4: .4byte 0x0202420c +_081315A8: .4byte 0x02024084 +_081315AC: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_081315B2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0B_unk + + thumb_func_start tai0C_unk +tai0C_unk: @ 81315B8 + push {r4,r5,lr} + ldr r0, _081315CC + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _081315D4 + ldr r0, _081315D0 + b _081315D6 + .align 2, 0 +_081315CC: .4byte 0x0203ab38 +_081315D0: .4byte 0x0203ab3c +_081315D4: + ldr r0, _08131618 +_081315D6: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, _0813161C + movs r0, 0x58 + muls r0, r4 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _08131620 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08131626 + .align 2, 0 +_08131618: .4byte 0x0202420c +_0813161C: .4byte 0x02024084 +_08131620: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_08131626: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0C_unk + + thumb_func_start tai0D_unk +tai0D_unk: @ 813162C + push {r4,r5,lr} + ldr r0, _08131640 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08131648 + ldr r0, _08131644 + b _0813164A + .align 2, 0 +_08131640: .4byte 0x0203ab38 +_08131644: .4byte 0x0203ab3c +_08131648: + ldr r0, _08131688 +_0813164A: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r2, _0813168C + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08131690 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08131696 + .align 2, 0 +_08131688: .4byte 0x0202420c +_0813168C: .4byte 0x020242ac +_08131690: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_08131696: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0D_unk + + thumb_func_start tai0E_unk +tai0E_unk: @ 813169C + push {r4,r5,lr} + ldr r0, _081316B0 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _081316B8 + ldr r0, _081316B4 + b _081316BA + .align 2, 0 +_081316B0: .4byte 0x0203ab38 +_081316B4: .4byte 0x0203ab3c +_081316B8: + ldr r0, _081316F8 +_081316BA: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r2, _081316FC + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + bne _08131700 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08131706 + .align 2, 0 +_081316F8: .4byte 0x0202420c +_081316FC: .4byte 0x020242ac +_08131700: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_08131706: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0E_unk + + thumb_func_start tai0F_unk +tai0F_unk: @ 813170C + push {r4,lr} + ldr r0, _0813171C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _08131724 + ldr r0, _08131720 + b _08131726 + .align 2, 0 +_0813171C: .4byte 0x0203ab38 +_08131720: .4byte 0x0203ab3c +_08131724: + ldr r0, _08131770 +_08131726: + ldrb r0, [r0] + bl battle_get_per_side_status + movs r2, 0x1 + ands r2, r0 + ldr r4, _08131774 + ldr r3, [r4] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r0, _08131778 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _0813177C + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131782 + .align 2, 0 +_08131770: .4byte 0x0202420c +_08131774: .4byte 0x0203ab38 +_08131778: .4byte 0x0202428e +_0813177C: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r4] +_08131782: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai0F_unk + + thumb_func_start tai10_unk +tai10_unk: @ 8131788 + push {r4,lr} + ldr r0, _08131798 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081317A0 + ldr r0, _0813179C + b _081317A2 + .align 2, 0 +_08131798: .4byte 0x0203ab38 +_0813179C: .4byte 0x0203ab3c +_081317A0: + ldr r0, _081317EC +_081317A2: + ldrb r0, [r0] + bl battle_get_per_side_status + movs r2, 0x1 + ands r2, r0 + ldr r4, _081317F0 + ldr r3, [r4] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r0, _081317F4 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _081317F8 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081317FE + .align 2, 0 +_081317EC: .4byte 0x0202420c +_081317F0: .4byte 0x0203ab38 +_081317F4: .4byte 0x0202428e +_081317F8: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r4] +_081317FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai10_unk + + thumb_func_start tai11_unk +tai11_unk: @ 8131804 + push {lr} + ldr r0, _08131830 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, _08131834 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bcs _08131838 + 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 _0813183C + .align 2, 0 +_08131830: .4byte 0x020244a8 +_08131834: .4byte 0x0203ab38 +_08131838: + adds r0, r2, 0x6 + str r0, [r3] +_0813183C: + pop {r0} + bx r0 + thumb_func_end tai11_unk + + thumb_func_start tai12_unk +tai12_unk: @ 8131840 + push {lr} + ldr r0, _0813186C + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, _08131870 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bls _08131874 + 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 _08131878 + .align 2, 0 +_0813186C: .4byte 0x020244a8 +_08131870: .4byte 0x0203ab38 +_08131874: + adds r0, r2, 0x6 + str r0, [r3] +_08131878: + pop {r0} + bx r0 + thumb_func_end tai12_unk + + thumb_func_start tai13_unk +tai13_unk: @ 813187C + push {lr} + ldr r0, _081318A8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, _081318AC + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _081318B0 + 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 _081318B4 + .align 2, 0 +_081318A8: .4byte 0x020244a8 +_081318AC: .4byte 0x0203ab38 +_081318B0: + adds r0, r2, 0x6 + str r0, [r3] +_081318B4: + pop {r0} + bx r0 + thumb_func_end tai13_unk + + thumb_func_start tai14_unk +tai14_unk: @ 81318B8 + push {lr} + ldr r0, _081318E4 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, _081318E8 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + beq _081318EC + 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 _081318F0 + .align 2, 0 +_081318E4: .4byte 0x020244a8 +_081318E8: .4byte 0x0203ab38 +_081318EC: + adds r0, r2, 0x6 + str r0, [r3] +_081318F0: + pop {r0} + bx r0 + thumb_func_end tai14_unk + + thumb_func_start tai15_unk +tai15_unk: @ 81318F4 + push {lr} + ldr r3, _08131934 + 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 + ldr r0, _08131938 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcs _0813193C + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131942 + .align 2, 0 +_08131934: .4byte 0x0203ab38 +_08131938: .4byte 0x020244a8 +_0813193C: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_08131942: + pop {r0} + bx r0 + thumb_func_end tai15_unk + + thumb_func_start tai16_unk +tai16_unk: @ 8131948 + push {lr} + ldr r3, _08131988 + 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 + ldr r0, _0813198C + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bls _08131990 + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131996 + .align 2, 0 +_08131988: .4byte 0x0203ab38 +_0813198C: .4byte 0x020244a8 +_08131990: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_08131996: + pop {r0} + bx r0 + thumb_func_end tai16_unk + + thumb_func_start tai17_unk +tai17_unk: @ 813199C + push {lr} + ldr r3, _081319DC + 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 + ldr r0, _081319E0 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bne _081319E4 + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081319EA + .align 2, 0 +_081319DC: .4byte 0x0203ab38 +_081319E0: .4byte 0x020244a8 +_081319E4: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_081319EA: + pop {r0} + bx r0 + thumb_func_end tai17_unk + + thumb_func_start tai18_unk +tai18_unk: @ 81319F0 + push {lr} + ldr r3, _08131A30 + 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 + ldr r0, _08131A34 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + beq _08131A38 + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131A3E + .align 2, 0 +_08131A30: .4byte 0x0203ab38 +_08131A34: .4byte 0x020244a8 +_08131A38: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_08131A3E: + pop {r0} + bx r0 + thumb_func_end tai18_unk + + thumb_func_start tai19_unk +tai19_unk: @ 8131A44 + push {lr} + ldr r3, _08131A78 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, _08131A7C + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + cmp r0, r1 + bne _08131A80 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131A84 + .align 2, 0 +_08131A78: .4byte 0x0203ab38 +_08131A7C: .4byte 0x020244a8 +_08131A80: + adds r0, r2, 0x7 + str r0, [r3] +_08131A84: + pop {r0} + bx r0 + thumb_func_end tai19_unk + + thumb_func_start tai1A_unk +tai1A_unk: @ 8131A88 + push {lr} + ldr r3, _08131ABC + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, _08131AC0 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + cmp r0, r1 + beq _08131AC4 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131AC8 + .align 2, 0 +_08131ABC: .4byte 0x0203ab38 +_08131AC0: .4byte 0x020244a8 +_08131AC4: + adds r0, r2, 0x7 + str r0, [r3] +_08131AC8: + pop {r0} + bx r0 + thumb_func_end tai1A_unk + + thumb_func_start tai1B_unk +tai1B_unk: @ 8131ACC + push {r4,lr} + ldr r2, _08131B18 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08131B28 + ldr r0, _08131B1C + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x8] + adds r4, r2, 0 +_08131AF6: + ldrb r0, [r3] + cmp r1, r0 + bne _08131B20 + ldr r2, [r4] + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131B2E + .align 2, 0 +_08131B18: .4byte 0x0203ab38 +_08131B1C: .4byte 0x020244a8 +_08131B20: + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0xFF + bne _08131AF6 +_08131B28: + ldr r0, [r2] + adds r0, 0x9 + str r0, [r2] +_08131B2E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai1B_unk + + thumb_func_start tai1C_unk +tai1C_unk: @ 8131B34 + push {r4,lr} + ldr r2, _08131B70 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrb r0, [r3] + adds r4, r2, 0 + cmp r0, 0xFF + beq _08131B80 + ldr r0, _08131B74 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r2, [r0, 0x8] + adds r1, r4, 0 +_08131B60: + ldrb r0, [r3] + cmp r2, r0 + bne _08131B78 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + b _08131B98 + .align 2, 0 +_08131B70: .4byte 0x0203ab38 +_08131B74: .4byte 0x020244a8 +_08131B78: + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0xFF + bne _08131B60 +_08131B80: + ldr r2, [r4] + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] +_08131B98: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai1C_unk + + thumb_func_start tai1D_unk +tai1D_unk: @ 8131BA0 + push {r4,r5,lr} + ldr r2, _08131BEC + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrh r0, [r3] + ldr r5, _08131BF0 + cmp r0, r5 + beq _08131C00 + ldr r0, _08131BF4 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x8] + adds r4, r2, 0 +_08131BCC: + ldrh r0, [r3] + cmp r1, r0 + bne _08131BF8 + ldr r2, [r4] + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131C06 + .align 2, 0 +_08131BEC: .4byte 0x0203ab38 +_08131BF0: .4byte 0x0000ffff +_08131BF4: .4byte 0x020244a8 +_08131BF8: + adds r3, 0x2 + ldrh r0, [r3] + cmp r0, r5 + bne _08131BCC +_08131C00: + ldr r0, [r2] + adds r0, 0x9 + str r0, [r2] +_08131C06: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai1D_unk + + thumb_func_start tai1E_unk +tai1E_unk: @ 8131C0C + push {r4,r5,lr} + ldr r2, _08131C48 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrh r0, [r3] + ldr r4, _08131C4C + adds r5, r2, 0 + cmp r0, r4 + beq _08131C5C + ldr r0, _08131C50 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r2, [r0, 0x8] + adds r1, r5, 0 +_08131C3A: + ldrh r0, [r3] + cmp r2, r0 + bne _08131C54 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + b _08131C74 + .align 2, 0 +_08131C48: .4byte 0x0203ab38 +_08131C4C: .4byte 0x0000ffff +_08131C50: .4byte 0x020244a8 +_08131C54: + adds r3, 0x2 + ldrh r0, [r3] + cmp r0, r4 + bne _08131C3A +_08131C5C: + ldr r2, [r5] + 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] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] +_08131C74: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai1E_unk + + thumb_func_start tai1F_unk +tai1F_unk: @ 8131C7C + push {r4,r5,lr} + movs r3, 0 + ldr r4, _08131CBC + ldr r1, _08131CC0 + ldr r0, _08131CC4 + ldrb r2, [r0] + ldr r5, _08131CC8 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 +_08131C92: + ldrh r0, [r2] + cmp r0, 0 + beq _08131CA6 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08131CAE +_08131CA6: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08131C92 +_08131CAE: + cmp r3, 0x4 + bne _08131CCC + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + b _08131CE4 + .align 2, 0 +_08131CBC: .4byte 0x0203ab38 +_08131CC0: .4byte 0x02024084 +_08131CC4: .4byte 0x0203ab3c +_08131CC8: .4byte 0x0831c898 +_08131CCC: + 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] +_08131CE4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai1F_unk + + thumb_func_start tai20_unk +tai20_unk: @ 8131CEC + push {r4,r5,lr} + movs r3, 0 + ldr r4, _08131D2C + ldr r1, _08131D30 + ldr r0, _08131D34 + ldrb r2, [r0] + ldr r5, _08131D38 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 +_08131D02: + ldrh r0, [r2] + cmp r0, 0 + beq _08131D16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08131D1E +_08131D16: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08131D02 +_08131D1E: + cmp r3, 0x4 + beq _08131D3C + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + b _08131D54 + .align 2, 0 +_08131D2C: .4byte 0x0203ab38 +_08131D30: .4byte 0x02024084 +_08131D34: .4byte 0x0203ab3c +_08131D38: .4byte 0x0831c898 +_08131D3C: + 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] +_08131D54: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai20_unk + + thumb_func_start tai21_unk +tai21_unk: @ 8131D5C + ldr r0, _08131D74 + ldr r0, [r0] + ldr r1, [r0, 0x14] + ldr r0, _08131D78 + ldrb r0, [r0, 0x13] + str r0, [r1, 0x8] + ldr r1, _08131D7C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08131D74: .4byte 0x020244a8 +_08131D78: .4byte 0x03005d10 +_08131D7C: .4byte 0x0203ab38 + thumb_func_end tai21_unk + + thumb_func_start dp15_get_some_type +dp15_get_some_type: @ 8131D80 + push {r4,lr} + ldr r1, _08131D98 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _08131E5A + lsls r0, 2 + ldr r1, _08131D9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08131D98: .4byte 0x0203ab38 +_08131D9C: .4byte _08131DA0 + .align 2, 0 +_08131DA0: + .4byte _08131DD8 + .4byte _08131DB4 + .4byte _08131E20 + .4byte _08131DFC + .4byte _08131E44 +_08131DB4: + ldr r0, _08131DCC + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08131DD0 + ldr r0, _08131DD4 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x21 + ldrb r0, [r0] + b _08131E58 + .align 2, 0 +_08131DCC: .4byte 0x020244a8 +_08131DD0: .4byte 0x02024084 +_08131DD4: .4byte 0x0203ab3c +_08131DD8: + ldr r0, _08131DF0 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08131DF4 + ldr r0, _08131DF8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x21 + ldrb r0, [r0] + b _08131E58 + .align 2, 0 +_08131DF0: .4byte 0x020244a8 +_08131DF4: .4byte 0x02024084 +_08131DF8: .4byte 0x0202420c +_08131DFC: + ldr r0, _08131E14 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08131E18 + ldr r0, _08131E1C + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x22 + ldrb r0, [r0] + b _08131E58 + .align 2, 0 +_08131E14: .4byte 0x020244a8 +_08131E18: .4byte 0x02024084 +_08131E1C: .4byte 0x0203ab3c +_08131E20: + ldr r0, _08131E38 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08131E3C + ldr r0, _08131E40 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x22 + ldrb r0, [r0] + b _08131E58 + .align 2, 0 +_08131E38: .4byte 0x020244a8 +_08131E3C: .4byte 0x02024084 +_08131E40: .4byte 0x0202420c +_08131E44: + ldr r0, _08131E68 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08131E6C + ldrh r1, [r3, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] +_08131E58: + str r0, [r3, 0x8] +_08131E5A: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08131E68: .4byte 0x020244a8 +_08131E6C: .4byte 0x0831c898 + thumb_func_end dp15_get_some_type + + thumb_func_start sub_8131E70 +sub_8131E70: @ 8131E70 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08131E84 + ldr r0, _08131E80 + ldrb r0, [r0] + b _08131EAC + .align 2, 0 +_08131E80: .4byte 0x0203ab3c +_08131E84: + cmp r0, 0x1 + ble _08131E90 + cmp r0, 0x2 + beq _08131EA4 + cmp r0, 0x3 + beq _08131E9C +_08131E90: + ldr r0, _08131E98 + ldrb r0, [r0] + b _08131EAC + .align 2, 0 +_08131E98: .4byte 0x0202420c +_08131E9C: + ldr r0, _08131EA0 + b _08131EA6 + .align 2, 0 +_08131EA0: .4byte 0x0203ab3c +_08131EA4: + ldr r0, _08131EB0 +_08131EA6: + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 +_08131EAC: + pop {r1} + bx r1 + .align 2, 0 +_08131EB0: .4byte 0x0202420c + thumb_func_end sub_8131E70 + + thumb_func_start tai5F_unk +tai5F_unk: @ 8131EB4 + push {r4,lr} + ldr r4, _08131EF0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08131EF4 + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + adds r1, r3, 0 + adds r1, 0x21 + ldr r0, [r4] + ldrb r1, [r1] + ldrb r2, [r0, 0x2] + cmp r1, r2 + beq _08131EE4 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r2 + bne _08131EFC +_08131EE4: + ldr r0, _08131EF8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x1 + b _08131F04 + .align 2, 0 +_08131EF0: .4byte 0x0203ab38 +_08131EF4: .4byte 0x02024084 +_08131EF8: .4byte 0x020244a8 +_08131EFC: + ldr r0, _08131F14 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0 +_08131F04: + str r0, [r1, 0x8] + ldr r1, _08131F18 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08131F14: .4byte 0x020244a8 +_08131F18: .4byte 0x0203ab38 + thumb_func_end tai5F_unk + + thumb_func_start dp15_move_get_power__2_8 +dp15_move_get_power__2_8: @ 8131F1C + ldr r0, _08131F3C + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08131F40 + ldrh r1, [r3, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + str r0, [r3, 0x8] + ldr r1, _08131F44 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08131F3C: .4byte 0x020244a8 +_08131F40: .4byte 0x0831c898 +_08131F44: .4byte 0x0203ab38 + thumb_func_end dp15_move_get_power__2_8 + + thumb_func_start dp15_is_most_powerful_move__8 +dp15_is_most_powerful_move__8: @ 8131F48 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r3, 0 + ldr r0, _08132088 + ldrh r1, [r0] + ldr r5, _0813208C + ldr r6, _08132090 + ldr r2, _08132094 + cmp r1, r5 + beq _08131F86 + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r4, [r0] + ldr r1, _08132088 +_08131F76: + ldrh r0, [r1] + cmp r4, r0 + beq _08131F86 + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r1] + cmp r0, r5 + bne _08131F76 +_08131F86: + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bhi _08131F9C + b _08132126 +_08131F9C: + lsls r0, r3, 1 + ldr r1, _08132088 + adds r0, r1 + ldrh r3, [r0] + ldr r0, _0813208C + cmp r3, r0 + beq _08131FAC + b _08132126 +_08131FAC: + ldr r0, _08132098 + movs r1, 0 + strh r1, [r0] + ldr r0, _0813209C + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, _081320A0 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, _081320A4 + strb r1, [r0] + ldr r0, _081320A8 + strb r2, [r0] + movs r6, 0 + mov r9, r3 + ldr r2, _08132088 + ldrh r2, [r2] + str r2, [sp, 0x10] +_08131FD0: + movs r3, 0 + ldr r5, _081320AC + lsls r4, r6, 1 + ldr r7, _081320B0 + lsls r0, r6, 2 + mov r8, r0 + adds r1, r6, 0x1 + mov r10, r1 + ldr r2, [sp, 0x10] + cmp r2, r9 + beq _08132014 + ldr r2, _08132090 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + adds r0, r4, r0 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0] + ldr r1, _08132088 +_08132004: + ldrh r0, [r1] + cmp r2, r0 + beq _08132014 + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r1] + cmp r0, r9 + bne _08132004 +_08132014: + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + adds r0, r4, r0 + adds r1, r5, 0 + adds r1, 0xC + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081320C0 + lsls r0, r3, 1 + ldr r2, _08132088 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r9 + bne _081320C0 + ldr r0, _08132090 + ldrh r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0x1 + bls _081320C0 + ldr r5, _081320B4 + strh r2, [r5] + ldrb r0, [r7] + ldr r4, _081320B8 + ldrb r1, [r4] + bl sub_8046E7C + ldrh r0, [r5] + ldrb r1, [r7] + ldrb r2, [r4] + bl move_effectiveness_something + mov r4, sp + add r4, r8 + ldr r2, _081320BC + ldr r0, _08132094 + ldr r0, [r0] + ldr r0, [r0, 0x14] + adds r0, 0x18 + adds r0, r6 + ldrb r1, [r0] + ldr r0, [r2] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _081320C8 + movs r0, 0x1 + str r0, [r4] + b _081320C8 + .align 2, 0 +_08132088: .4byte 0x085b09c8 +_0813208C: .4byte 0x0000ffff +_08132090: .4byte 0x0831c898 +_08132094: .4byte 0x020244a8 +_08132098: .4byte 0x02024400 +_0813209C: .4byte 0x0202449c +_081320A0: .4byte 0x02024474 +_081320A4: .4byte 0x0202427c +_081320A8: .4byte 0x02024211 +_081320AC: .4byte 0x02024084 +_081320B0: .4byte 0x0203ab3c +_081320B4: .4byte 0x020241ea +_081320B8: .4byte 0x0202420c +_081320BC: .4byte 0x020241f0 +_081320C0: + mov r1, sp + add r1, r8 + movs r0, 0 + str r0, [r1] +_081320C8: + mov r6, r10 + cmp r6, 0x3 + bgt _081320D0 + b _08131FD0 +_081320D0: + movs r6, 0 + ldr r2, _08132114 + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldrb r0, [r0, 0x1] + lsls r0, 2 + add r0, sp + ldr r1, [sp] + ldr r0, [r0] + ldr r5, _08132118 + cmp r1, r0 + bgt _08132106 + adds r4, r2, 0 + mov r3, sp +_081320EC: + adds r3, 0x4 + adds r6, 0x1 + cmp r6, 0x3 + bgt _08132106 + ldr r0, [r4] + ldr r0, [r0, 0x14] + ldrb r0, [r0, 0x1] + lsls r0, 2 + add r0, sp + ldr r1, [r3] + ldr r0, [r0] + cmp r1, r0 + ble _081320EC +_08132106: + cmp r6, 0x4 + bne _0813211C + ldr r0, [r2] + ldr r1, [r0, 0x14] + movs r0, 0x2 + str r0, [r1, 0x8] + b _08132130 + .align 2, 0 +_08132114: .4byte 0x020244a8 +_08132118: .4byte 0x0203ab38 +_0813211C: + ldr r0, [r2] + ldr r1, [r0, 0x14] + movs r0, 0x1 + str r0, [r1, 0x8] + b _08132130 +_08132126: + ldr r0, [r2] + ldr r1, [r0, 0x14] + movs r0, 0 + str r0, [r1, 0x8] + ldr r5, _08132148 +_08132130: + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08132148: .4byte 0x0203ab38 + thumb_func_end dp15_is_most_powerful_move__8 + + thumb_func_start dp15_get_move_to_execute_B +dp15_get_move_to_execute_B: @ 813214C + push {lr} + ldr r0, _08132168 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r3, r0, 0 + cmp r1, 0x1 + bne _08132178 + ldr r0, _0813216C + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, _08132170 + ldr r0, _08132174 + b _08132182 + .align 2, 0 +_08132168: .4byte 0x0203ab38 +_0813216C: .4byte 0x020244a8 +_08132170: .4byte 0x02024248 +_08132174: .4byte 0x0203ab3c +_08132178: + ldr r0, _08132198 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, _0813219C + ldr r0, _081321A0 +_08132182: + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2, 0x8] + ldr r0, [r3] + adds r0, 0x2 + str r0, [r3] + pop {r0} + bx r0 + .align 2, 0 +_08132198: .4byte 0x020244a8 +_0813219C: .4byte 0x02024248 +_081321A0: .4byte 0x0202420c + thumb_func_end dp15_get_move_to_execute_B + + thumb_func_start tai26_unk +tai26_unk: @ 81321A4 + push {lr} + ldr r3, _081321D0 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldr r0, _081321D4 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + cmp r1, r0 + bne _081321D8 + 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 _081321DC + .align 2, 0 +_081321D0: .4byte 0x0203ab38 +_081321D4: .4byte 0x020244a8 +_081321D8: + adds r0, r2, 0x6 + str r0, [r3] +_081321DC: + pop {r0} + bx r0 + thumb_func_end tai26_unk + + thumb_func_start tai27_unk +tai27_unk: @ 81321E0 + push {lr} + ldr r3, _0813220C + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldr r0, _08132210 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + cmp r1, r0 + beq _08132214 + 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 _08132218 + .align 2, 0 +_0813220C: .4byte 0x0203ab38 +_08132210: .4byte 0x020244a8 +_08132214: + adds r0, r2, 0x6 + str r0, [r3] +_08132218: + pop {r0} + bx r0 + thumb_func_end tai27_unk + + thumb_func_start tai28_unk +tai28_unk: @ 813221C + push {lr} + ldr r0, _08132254 + ldrb r0, [r0] + ldr r1, _08132258 + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + ldr r3, _0813225C + ldr r2, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _08132260 + 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 _08132264 + .align 2, 0 +_08132254: .4byte 0x0203ab3c +_08132258: .4byte 0x0202420c +_0813225C: .4byte 0x0203ab38 +_08132260: + adds r0, r2, 0x6 + str r0, [r3] +_08132264: + pop {r0} + bx r0 + thumb_func_end tai28_unk + + thumb_func_start tai29_unk +tai29_unk: @ 8132268 + push {lr} + ldr r0, _081322A0 + ldrb r0, [r0] + ldr r1, _081322A4 + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + ldr r3, _081322A8 + ldr r2, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2, 0x1] + cmp r0, r1 + beq _081322AC + 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 _081322B0 + .align 2, 0 +_081322A0: .4byte 0x0203ab3c +_081322A4: .4byte 0x0202420c +_081322A8: .4byte 0x0203ab38 +_081322AC: + adds r0, r2, 0x6 + str r0, [r3] +_081322B0: + pop {r0} + bx r0 + thumb_func_end tai29_unk + + thumb_func_start nullsub_102 +nullsub_102: @ 81322B4 + bx lr + thumb_func_end nullsub_102 + + thumb_func_start nullsub_103 +nullsub_103: @ 81322B8 + bx lr + thumb_func_end nullsub_103 + + thumb_func_start tai2C_unk +tai2C_unk: @ 81322BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _081322DC + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0 + str r0, [r1, 0x8] + ldr r0, _081322E0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081322E8 + ldr r0, _081322E4 + b _081322EA + .align 2, 0 +_081322DC: .4byte 0x020244a8 +_081322E0: .4byte 0x0203ab38 +_081322E4: .4byte 0x0203ab3c +_081322E8: + ldr r0, _08132330 +_081322EA: + ldrb r5, [r0] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _08132334 + mov r8, r1 + cmp r0, 0 + bne _08132300 + ldr r0, _08132338 + mov r8, r0 +_08132300: + ldr r0, _0813233C + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08132344 + ldr r4, _08132340 + lsls r0, r5, 1 + adds r0, r4 + ldrb r7, [r0] + adds r0, r5, 0 + 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, 23 + adds r0, r4 + ldrb r6, [r0] + b _0813234E + .align 2, 0 +_08132330: .4byte 0x0202420c +_08132334: .4byte 0x02024744 +_08132338: .4byte 0x020244ec +_0813233C: .4byte 0x02022fec +_08132340: .4byte 0x0202406e +_08132344: + ldr r1, _081323AC + lsls r0, r5, 1 + adds r0, r1 + ldrb r6, [r0] + adds r7, r6, 0 +_0813234E: + movs r5, 0 +_08132350: + cmp r5, r7 + beq _08132394 + cmp r5, r6 + beq _08132394 + movs r0, 0x64 + muls r0, r5 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08132394 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08132394 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08132394 + ldr r0, _081323B0 + ldr r0, [r0] + ldr r1, [r0, 0x14] + ldr r0, [r1, 0x8] + adds r0, 0x1 + str r0, [r1, 0x8] +_08132394: + adds r5, 0x1 + cmp r5, 0x5 + ble _08132350 + ldr r1, _081323B4 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081323AC: .4byte 0x0202406e +_081323B0: .4byte 0x020244a8 +_081323B4: .4byte 0x0203ab38 + thumb_func_end tai2C_unk + + thumb_func_start dp15_get_move_id__8 +dp15_get_move_id__8: @ 81323B8 + ldr r0, _081323CC + ldr r0, [r0] + ldr r1, [r0, 0x14] + ldrh r0, [r1, 0x2] + str r0, [r1, 0x8] + ldr r1, _081323D0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_081323CC: .4byte 0x020244a8 +_081323D0: .4byte 0x0203ab38 + thumb_func_end dp15_get_move_id__8 + + thumb_func_start dp15_move_get_move_script_id +dp15_move_get_move_script_id: @ 81323D4 + ldr r0, _081323F4 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _081323F8 + ldrh r1, [r3, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + str r0, [r3, 0x8] + ldr r1, _081323FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_081323F4: .4byte 0x020244a8 +_081323F8: .4byte 0x0831c898 +_081323FC: .4byte 0x0203ab38 + thumb_func_end dp15_move_get_move_script_id + + thumb_func_start tai2F_unk +tai2F_unk: @ 8132400 + push {r4-r7,lr} + ldr r0, _08132414 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + mov r12, r0 + cmp r1, 0x1 + bne _0813241C + ldr r0, _08132418 + b _0813241E + .align 2, 0 +_08132414: .4byte 0x0203ab38 +_08132418: .4byte 0x0203ab3c +_0813241C: + ldr r0, _08132440 +_0813241E: + ldrb r3, [r0] + ldr r0, _08132444 + ldrb r0, [r0] + cmp r0, r3 + beq _081324F0 + ldr r7, _08132448 + ldr r5, [r7] + ldr r0, [r5, 0x18] + adds r0, 0x40 + adds r2, r0, r3 + ldrb r0, [r2] + adds r6, r7, 0 + cmp r0, 0 + beq _0813244C + ldr r1, [r5, 0x14] + str r0, [r1, 0x8] + b _08132504 + .align 2, 0 +_08132440: .4byte 0x0202420c +_08132444: .4byte 0x02024064 +_08132448: .4byte 0x020244a8 +_0813244C: + ldr r1, _0813247C + movs r0, 0x58 + muls r0, r3 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x17 + beq _08132468 + cmp r0, 0x2A + beq _08132468 + cmp r0, 0x47 + bne _08132480 +_08132468: + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [r1, 0x8] + b _08132504 + .align 2, 0 +_0813247C: .4byte 0x02024084 +_08132480: + ldr r6, _081324BC + ldrh r0, [r4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r6 + ldrb r0, [r2, 0x16] + cmp r0, 0 + beq _081324E8 + ldrb r0, [r2, 0x17] + cmp r0, 0 + beq _081324E0 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _081324C4 + ldr r0, [r7] + ldr r2, [r0, 0x14] + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x16] + str r0, [r2, 0x8] + ldr r0, _081324C0 + mov r12, r0 + b _08132504 + .align 2, 0 +_081324BC: .4byte 0x083203cc +_081324C0: .4byte 0x0203ab38 +_081324C4: + ldr r0, [r7] + ldr r2, [r0, 0x14] + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x17] + str r0, [r2, 0x8] + ldr r1, _081324DC + mov r12, r1 + b _08132504 + .align 2, 0 +_081324DC: .4byte 0x0203ab38 +_081324E0: + ldr r1, [r5, 0x14] + ldrb r0, [r2, 0x16] + str r0, [r1, 0x8] + b _08132504 +_081324E8: + ldr r1, [r5, 0x14] + ldrb r0, [r2, 0x17] + str r0, [r1, 0x8] + b _08132504 +_081324F0: + ldr r0, _08132514 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, _08132518 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [r2, 0x8] +_08132504: + mov r1, r12 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08132514: .4byte 0x020244a8 +_08132518: .4byte 0x02024084 + thumb_func_end tai2F_unk + + thumb_func_start tai60_unk +tai60_unk: @ 813251C + push {r4-r6,lr} + ldr r4, _08132554 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r4] + ldrb r3, [r0, 0x2] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0813253A + cmp r0, 0x2 + bne _081325BC +_0813253A: + ldr r0, _08132558 + ldr r4, [r0] + ldr r1, [r4, 0x18] + adds r1, 0x40 + adds r2, r1, r5 + ldrb r1, [r2] + adds r6, r0, 0 + cmp r1, 0 + beq _0813255C + adds r3, r1, 0 + ldr r0, [r4, 0x14] + str r3, [r0, 0x8] + b _081325CA + .align 2, 0 +_08132554: .4byte 0x0203ab38 +_08132558: .4byte 0x020244a8 +_0813255C: + ldr r1, _08132584 + movs r0, 0x58 + muls r0, r5 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x17 + beq _08132576 + cmp r0, 0x2A + beq _08132576 + cmp r0, 0x47 + bne _08132588 +_08132576: + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + b _081325CA + .align 2, 0 +_08132584: .4byte 0x02024084 +_08132588: + ldr r2, _081325B0 + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r4, [r1, 0x16] + cmp r4, 0 + beq _081325B8 + ldrb r2, [r1, 0x17] + cmp r2, 0 + beq _081325B4 + adds r0, r3, 0 + cmp r4, r0 + beq _081325CE + cmp r2, r0 + beq _081325CE + adds r3, r4, 0 + b _081325CA + .align 2, 0 +_081325B0: .4byte 0x083203cc +_081325B4: + ldrb r3, [r1, 0x16] + b _081325CA +_081325B8: + ldrb r3, [r1, 0x17] + b _081325CA +_081325BC: + ldr r1, _081325DC + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + ldr r6, _081325E0 +_081325CA: + cmp r3, 0 + bne _081325E8 +_081325CE: + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0x2 + str r0, [r1, 0x8] + ldr r2, _081325E4 + b _08132608 + .align 2, 0 +_081325DC: .4byte 0x02024084 +_081325E0: .4byte 0x020244a8 +_081325E4: .4byte 0x0203ab38 +_081325E8: + ldr r0, _081325FC + ldr r1, [r0] + adds r2, r0, 0 + ldrb r1, [r1, 0x2] + cmp r3, r1 + bne _08132600 + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0x1 + b _08132606 + .align 2, 0 +_081325FC: .4byte 0x0203ab38 +_08132600: + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0 +_08132606: + str r0, [r1, 0x8] +_08132608: + ldr r0, [r2] + adds r0, 0x3 + str r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end tai60_unk + + thumb_func_start tai30_unk +tai30_unk: @ 8132614 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _081326D0 + movs r1, 0 + strh r1, [r0] + ldr r0, _081326D4 + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, _081326D8 + movs r3, 0 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, _081326DC + strb r1, [r0] + ldr r0, _081326E0 + strb r2, [r0] + ldr r0, _081326E4 + ldr r0, [r0] + ldr r0, [r0, 0x14] + str r3, [r0, 0x8] + movs r5, 0 + ldr r4, _081326E8 + ldr r7, _081326EC + ldr r0, _081326F0 + mov r8, r0 + ldr r6, _081326F4 +_0813264A: + movs r0, 0x28 + str r0, [r4] + lsls r1, r5, 1 + ldrb r2, [r6] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + add r1, r8 + ldrh r0, [r1] + strh r0, [r7] + lsls r0, 16 + cmp r0, 0 + beq _081326B8 + ldrh r0, [r7] + ldrb r1, [r6] + ldr r2, _081326F8 + ldrb r2, [r2] + bl move_effectiveness_something + ldr r0, [r4] + cmp r0, 0x78 + bne _0813267A + movs r0, 0x50 + str r0, [r4] +_0813267A: + ldr r0, [r4] + cmp r0, 0xF0 + bne _08132684 + movs r0, 0xA0 + str r0, [r4] +_08132684: + ldr r0, [r4] + cmp r0, 0x1E + bne _0813268E + movs r0, 0x14 + str r0, [r4] +_0813268E: + ldr r0, [r4] + cmp r0, 0xF + bne _08132698 + movs r0, 0xA + str r0, [r4] +_08132698: + ldr r0, _081326DC + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081326A8 + movs r0, 0 + str r0, [r4] +_081326A8: + ldr r0, _081326E4 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, [r2, 0x8] + ldr r1, [r4] + cmp r0, r1 + bcs _081326B8 + str r1, [r2, 0x8] +_081326B8: + adds r5, 0x1 + cmp r5, 0x3 + ble _0813264A + ldr r1, _081326FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081326D0: .4byte 0x02024400 +_081326D4: .4byte 0x0202449c +_081326D8: .4byte 0x02024474 +_081326DC: .4byte 0x0202427c +_081326E0: .4byte 0x02024211 +_081326E4: .4byte 0x020244a8 +_081326E8: .4byte 0x020241f0 +_081326EC: .4byte 0x020241ea +_081326F0: .4byte 0x02024090 +_081326F4: .4byte 0x0203ab3c +_081326F8: .4byte 0x0202420c +_081326FC: .4byte 0x0203ab38 + thumb_func_end tai30_unk + + thumb_func_start dp15_simulate_damage_bonus_jump_if_eq +dp15_simulate_damage_bonus_jump_if_eq: @ 8132700 + push {r4,r5,lr} + ldr r0, _08132798 + movs r1, 0 + strh r1, [r0] + ldr r0, _0813279C + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, _081327A0 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r5, _081327A4 + strb r1, [r5] + ldr r0, _081327A8 + strb r2, [r0] + ldr r4, _081327AC + movs r0, 0x28 + str r0, [r4] + ldr r1, _081327B0 + ldr r0, _081327B4 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + strh r0, [r1] + ldrh r0, [r1] + ldr r1, _081327B8 + ldrb r1, [r1] + ldr r2, _081327BC + ldrb r2, [r2] + bl move_effectiveness_something + ldr r0, [r4] + cmp r0, 0x78 + bne _08132746 + movs r0, 0x50 + str r0, [r4] +_08132746: + ldr r0, [r4] + cmp r0, 0xF0 + bne _08132750 + movs r0, 0xA0 + str r0, [r4] +_08132750: + ldr r0, [r4] + cmp r0, 0x1E + bne _0813275A + movs r0, 0x14 + str r0, [r4] +_0813275A: + ldr r0, [r4] + cmp r0, 0xF + bne _08132764 + movs r0, 0xA + str r0, [r4] +_08132764: + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08132772 + movs r0, 0 + str r0, [r4] +_08132772: + ldrb r0, [r4] + ldr r3, _081327C0 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _081327C4 + 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 _081327C8 + .align 2, 0 +_08132798: .4byte 0x02024400 +_0813279C: .4byte 0x0202449c +_081327A0: .4byte 0x02024474 +_081327A4: .4byte 0x0202427c +_081327A8: .4byte 0x02024211 +_081327AC: .4byte 0x020241f0 +_081327B0: .4byte 0x020241ea +_081327B4: .4byte 0x020244a8 +_081327B8: .4byte 0x0203ab3c +_081327BC: .4byte 0x0202420c +_081327C0: .4byte 0x0203ab38 +_081327C4: + adds r0, r2, 0x6 + str r0, [r3] +_081327C8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp15_simulate_damage_bonus_jump_if_eq + + thumb_func_start nullsub_104 +nullsub_104: @ 81327D0 + bx lr + thumb_func_end nullsub_104 + + thumb_func_start nullsub_105 +nullsub_105: @ 81327D4 + bx lr + thumb_func_end nullsub_105 + + thumb_func_start tai34_unk +tai34_unk: @ 81327D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _081327F0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _08132818 + ldr r0, _081327F4 + b _0813281A + .align 2, 0 +_081327F0: .4byte 0x0203ab38 +_081327F4: .4byte 0x0203ab3c +_081327F8: + ldr r3, _08132814 + ldr r2, [r3] + ldrb r1, [r2, 0x6] + ldrb r0, [r2, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0813289A + .align 2, 0 +_08132814: .4byte 0x0203ab38 +_08132818: + ldr r0, _081328A8 +_0813281A: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _081328AC + mov r9, r1 + cmp r0, 0 + bne _0813282E + ldr r0, _081328B0 + mov r9, r0 +_0813282E: + ldr r0, _081328B4 + ldr r1, [r0] + ldrb r7, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + orrs r7, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + orrs r7, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + orrs r7, r0 + movs r1, 0 + mov r8, r1 + movs r0, 0xCE + lsls r0, 1 + mov r10, r0 +_08132850: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + add r4, r9 + adds r0, r4, 0 + movs r1, 0xB + 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 + cmp r5, 0 + beq _08132888 + cmp r5, r10 + beq _08132888 + cmp r6, 0 + beq _08132888 + cmp r0, r7 + beq _081327F8 +_08132888: + movs r1, 0x1 + add r8, r1 + mov r0, r8 + cmp r0, 0x5 + ble _08132850 + ldr r1, _081328B4 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_0813289A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081328A8: .4byte 0x0202420c +_081328AC: .4byte 0x02024744 +_081328B0: .4byte 0x020244ec +_081328B4: .4byte 0x0203ab38 + thumb_func_end tai34_unk + + thumb_func_start tai35_unk +tai35_unk: @ 81328B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _081328D0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081328D8 + ldr r0, _081328D4 + b _081328DA + .align 2, 0 +_081328D0: .4byte 0x0203ab38 +_081328D4: .4byte 0x0203ab3c +_081328D8: + ldr r0, _08132984 +_081328DA: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, _08132988 + mov r10, r1 + cmp r0, 0 + bne _081328EE + ldr r0, _0813298C + mov r10, r0 +_081328EE: + ldr r2, _08132990 + ldr r1, [r2] + ldrb r7, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + orrs r7, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + orrs r7, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + orrs r7, r0 + movs r1, 0 + mov r8, r1 + mov r9, r2 +_0813290C: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + add r4, r10 + adds r0, r4, 0 + movs r1, 0xB + 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 + cmp r5, 0 + beq _08132950 + movs r1, 0xCE + lsls r1, 1 + cmp r5, r1 + beq _08132950 + cmp r6, 0 + beq _08132950 + cmp r0, r7 + bne _08132950 + mov r1, r9 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08132950: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _0813290C + ldr r3, _08132990 + ldr r2, [r3] + ldrb r1, [r2, 0x6] + ldrb r0, [r2, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08132984: .4byte 0x0202420c +_08132988: .4byte 0x02024744 +_0813298C: .4byte 0x020244ec +_08132990: .4byte 0x0203ab38 + thumb_func_end tai35_unk + + thumb_func_start dp15_get_weather__8 +dp15_get_weather__8: @ 8132994 + push {lr} + ldr r2, _081329F4 + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _081329AC + ldr r0, _081329F8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x1 + str r0, [r1, 0x8] +_081329AC: + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _081329C0 + ldr r0, _081329F8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x2 + str r0, [r1, 0x8] +_081329C0: + ldrh r1, [r2] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _081329D4 + ldr r0, _081329F8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0 + str r0, [r1, 0x8] +_081329D4: + ldrh r1, [r2] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081329E8 + ldr r0, _081329F8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x3 + str r0, [r1, 0x8] +_081329E8: + ldr r1, _081329FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081329F4: .4byte 0x020243cc +_081329F8: .4byte 0x020244a8 +_081329FC: .4byte 0x0203ab38 + thumb_func_end dp15_get_weather__8 + + thumb_func_start tai37_unk +tai37_unk: @ 8132A00 + push {lr} + ldr r2, _08132A38 + ldr r0, _08132A3C + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r3, _08132A40 + ldr r2, [r3] + ldrb r0, [r0] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _08132A44 + 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 _08132A48 + .align 2, 0 +_08132A38: .4byte 0x0831c898 +_08132A3C: .4byte 0x020244a8 +_08132A40: .4byte 0x0203ab38 +_08132A44: + adds r0, r2, 0x6 + str r0, [r3] +_08132A48: + pop {r0} + bx r0 + thumb_func_end tai37_unk + + thumb_func_start tai38_unk +tai38_unk: @ 8132A4C + push {lr} + ldr r2, _08132A84 + ldr r0, _08132A88 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r3, _08132A8C + ldr r2, [r3] + ldrb r0, [r0] + ldrb r1, [r2, 0x1] + cmp r0, r1 + beq _08132A90 + 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 _08132A94 + .align 2, 0 +_08132A84: .4byte 0x0831c898 +_08132A88: .4byte 0x020244a8 +_08132A8C: .4byte 0x0203ab38 +_08132A90: + adds r0, r2, 0x6 + str r0, [r3] +_08132A94: + pop {r0} + bx r0 + thumb_func_end tai38_unk + + thumb_func_start tai39_unk +tai39_unk: @ 8132A98 + push {r4,lr} + ldr r0, _08132AAC + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132AB4 + ldr r0, _08132AB0 + b _08132AB6 + .align 2, 0 +_08132AAC: .4byte 0x0203ab38 +_08132AB0: .4byte 0x0203ab3c +_08132AB4: + ldr r0, _08132AEC +_08132AB6: + ldrb r3, [r0] + ldr r1, _08132AF0 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + bge _08132AF4 + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132AFA + .align 2, 0 +_08132AEC: .4byte 0x0202420c +_08132AF0: .4byte 0x02024084 +_08132AF4: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132AFA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai39_unk + + thumb_func_start tai3A_unk +tai3A_unk: @ 8132B00 + push {r4,lr} + ldr r0, _08132B14 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132B1C + ldr r0, _08132B18 + b _08132B1E + .align 2, 0 +_08132B14: .4byte 0x0203ab38 +_08132B18: .4byte 0x0203ab3c +_08132B1C: + ldr r0, _08132B54 +_08132B1E: + ldrb r3, [r0] + ldr r1, _08132B58 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + ble _08132B5C + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132B62 + .align 2, 0 +_08132B54: .4byte 0x0202420c +_08132B58: .4byte 0x02024084 +_08132B5C: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132B62: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai3A_unk + + thumb_func_start tai3B_unk +tai3B_unk: @ 8132B68 + push {r4,lr} + ldr r0, _08132B7C + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132B84 + ldr r0, _08132B80 + b _08132B86 + .align 2, 0 +_08132B7C: .4byte 0x0203ab38 +_08132B80: .4byte 0x0203ab3c +_08132B84: + ldr r0, _08132BBC +_08132B86: + ldrb r3, [r0] + ldr r1, _08132BC0 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + bne _08132BC4 + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132BCA + .align 2, 0 +_08132BBC: .4byte 0x0202420c +_08132BC0: .4byte 0x02024084 +_08132BC4: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132BCA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai3B_unk + + thumb_func_start tai3C_unk +tai3C_unk: @ 8132BD0 + push {r4,lr} + ldr r0, _08132BE4 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132BEC + ldr r0, _08132BE8 + b _08132BEE + .align 2, 0 +_08132BE4: .4byte 0x0203ab38 +_08132BE8: .4byte 0x0203ab3c +_08132BEC: + ldr r0, _08132C24 +_08132BEE: + ldrb r3, [r0] + ldr r1, _08132C28 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + beq _08132C2C + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132C32 + .align 2, 0 +_08132C24: .4byte 0x0202420c +_08132C28: .4byte 0x02024084 +_08132C2C: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132C32: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai3C_unk + + thumb_func_start tai3D_unk +tai3D_unk: @ 8132C38 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, _08132CE8 + ldr r0, _08132CEC + mov r8, r0 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bls _08132D1C + ldr r0, _08132CF0 + movs r1, 0 + strh r1, [r0] + ldr r0, _08132CF4 + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, _08132CF8 + movs r7, 0x1 + strb r7, [r0, 0xE] + ldr r0, _08132CFC + strb r1, [r0] + ldr r0, _08132D00 + strb r7, [r0] + ldr r5, _08132D04 + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + strh r0, [r5] + ldr r4, _08132D08 + ldrb r0, [r4] + ldr r6, _08132D0C + ldrb r1, [r6] + bl sub_8046E7C + ldrh r0, [r5] + ldrb r1, [r4] + ldrb r2, [r6] + bl move_effectiveness_something + ldr r4, _08132D10 + mov r1, r8 + ldr r0, [r1] + ldr r1, [r0, 0x14] + adds r0, r1, 0 + adds r0, 0x18 + ldrb r1, [r1, 0x1] + adds r0, r1 + ldrb r1, [r0] + ldr r0, [r4] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08132CB8 + str r7, [r4] +_08132CB8: + ldr r2, _08132D14 + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x28] + ldr r0, [r4] + cmp r1, r0 + bgt _08132D1C + ldr r3, _08132D18 + 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 _08132D24 + .align 2, 0 +_08132CE8: .4byte 0x0831c898 +_08132CEC: .4byte 0x020244a8 +_08132CF0: .4byte 0x02024400 +_08132CF4: .4byte 0x0202449c +_08132CF8: .4byte 0x02024474 +_08132CFC: .4byte 0x0202427c +_08132D00: .4byte 0x02024211 +_08132D04: .4byte 0x020241ea +_08132D08: .4byte 0x0203ab3c +_08132D0C: .4byte 0x0202420c +_08132D10: .4byte 0x020241f0 +_08132D14: .4byte 0x02024084 +_08132D18: .4byte 0x0203ab38 +_08132D1C: + ldr r1, _08132D30 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08132D24: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08132D30: .4byte 0x0203ab38 + thumb_func_end tai3D_unk + + thumb_func_start dp15_determine_move_damage_jump_if_not_fatal +dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 + push {r4-r7,lr} + ldr r2, _08132DD0 + ldr r7, _08132DD4 + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bls _08132E04 + ldr r0, _08132DD8 + movs r1, 0 + strh r1, [r0] + ldr r0, _08132DDC + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, _08132DE0 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, _08132DE4 + strb r1, [r0] + ldr r0, _08132DE8 + strb r2, [r0] + ldr r6, _08132DEC + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + strh r0, [r6] + ldr r4, _08132DF0 + ldrb r0, [r4] + ldr r5, _08132DF4 + ldrb r1, [r5] + bl sub_8046E7C + ldrh r0, [r6] + ldrb r1, [r4] + ldrb r2, [r5] + bl move_effectiveness_something + ldr r4, _08132DF8 + ldr r0, [r7] + ldr r1, [r0, 0x14] + adds r0, r1, 0 + adds r0, 0x18 + ldrb r1, [r1, 0x1] + adds r0, r1 + ldrb r1, [r0] + ldr r0, [r4] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + ldr r3, _08132DFC + ldrb r2, [r5] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r1, [r1, 0x28] + cmp r1, r0 + ble _08132E04 + ldr r3, _08132E00 + 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 _08132E0C + .align 2, 0 +_08132DD0: .4byte 0x0831c898 +_08132DD4: .4byte 0x020244a8 +_08132DD8: .4byte 0x02024400 +_08132DDC: .4byte 0x0202449c +_08132DE0: .4byte 0x02024474 +_08132DE4: .4byte 0x0202427c +_08132DE8: .4byte 0x02024211 +_08132DEC: .4byte 0x020241ea +_08132DF0: .4byte 0x0203ab3c +_08132DF4: .4byte 0x0202420c +_08132DF8: .4byte 0x020241f0 +_08132DFC: .4byte 0x02024084 +_08132E00: .4byte 0x0203ab38 +_08132E04: + ldr r1, _08132E14 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08132E0C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08132E14: .4byte 0x0203ab38 + thumb_func_end dp15_determine_move_damage_jump_if_not_fatal + + thumb_func_start tai3F_unk +tai3F_unk: @ 8132E18 + push {r4-r7,lr} + ldr r0, _08132E34 + ldr r5, [r0] + adds r7, r5, 0x2 + ldrb r1, [r5, 0x1] + adds r6, r0, 0 + cmp r1, 0x1 + beq _08132E42 + cmp r1, 0x1 + bgt _08132E38 + cmp r1, 0 + beq _08132EDC + b _08132F40 + .align 2, 0 +_08132E34: .4byte 0x0203ab38 +_08132E38: + cmp r1, 0x2 + beq _08132EDC + cmp r1, 0x3 + beq _08132E84 + b _08132F40 +_08132E42: + movs r4, 0 + ldr r3, _08132E7C + ldr r2, _08132E80 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + ldrh r5, [r5, 0x2] + cmp r0, r5 + beq _08132E74 + movs r5, 0x58 +_08132E5C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08132E74 + lsls r1, r4, 1 + ldrb r0, [r2] + muls r0, r5 + adds r1, r0 + adds r1, r3 + ldrh r0, [r1] + ldrh r1, [r7] + cmp r0, r1 + bne _08132E5C +_08132E74: + cmp r4, 0x4 + beq _08132F18 + b _08132F28 + .align 2, 0 +_08132E7C: .4byte 0x02024084 +_08132E80: .4byte 0x0203ab3c +_08132E84: + ldr r3, _08132EA0 + ldr r2, _08132EA4 + ldrb r1, [r2] + movs r0, 0x2 + eors r0, r1 + movs r1, 0x58 + muls r1, r0 + adds r0, r1, r3 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08132EA8 + adds r0, r5, 0 + b _08132F1A + .align 2, 0 +_08132EA0: .4byte 0x02024084 +_08132EA4: .4byte 0x0203ab3c +_08132EA8: + movs r4, 0 + adds r3, 0xC + adds r0, r1, r3 + ldrh r0, [r0] + ldrh r5, [r5, 0x2] + cmp r0, r5 + beq _08132E74 + mov r12, r3 + adds r5, r2, 0 + movs r3, 0x2 +_08132EBC: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08132E74 + lsls r1, r4, 1 + ldrb r0, [r5] + adds r2, r3, 0 + eors r2, r0 + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + add r1, r12 + ldrh r0, [r1] + ldrh r1, [r7] + cmp r0, r1 + bne _08132EBC + b _08132E74 +_08132EDC: + movs r4, 0 + ldr r3, _08132F20 + ldr r0, [r3] + ldr r1, [r0, 0x18] + ldr r2, _08132F24 + ldrb r0, [r2] + lsls r0, 4 + adds r1, r0 + ldrh r0, [r1] + ldrh r1, [r7] + cmp r0, r1 + beq _08132F14 + adds r7, r3, 0 + adds r5, r2, 0 + adds r3, r1, 0 +_08132EFA: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08132F14 + ldr r0, [r7] + ldr r2, [r0, 0x18] + lsls r1, r4, 1 + ldrb r0, [r5] + lsls r0, 4 + adds r1, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, r3 + bne _08132EFA +_08132F14: + cmp r4, 0x4 + bne _08132F28 +_08132F18: + ldr r0, [r6] +_08132F1A: + adds r0, 0x8 + str r0, [r6] + b _08132F40 + .align 2, 0 +_08132F20: .4byte 0x020244a8 +_08132F24: .4byte 0x0202420c +_08132F28: + ldr r2, [r6] + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r6] +_08132F40: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai3F_unk + + thumb_func_start tai40_unk +tai40_unk: @ 8132F48 + push {r4-r7,lr} + ldr r1, _08132F64 + ldr r0, [r1] + adds r6, r0, 0x2 + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x1 + beq _08132F70 + cmp r0, 0x1 + bgt _08132F68 + cmp r0, 0 + beq _08132FB4 + b _08133018 + .align 2, 0 +_08132F64: .4byte 0x0203ab38 +_08132F68: + cmp r0, 0x2 + beq _08132FB4 + cmp r0, 0x3 + bne _08133018 +_08132F70: + movs r3, 0 + ldr r2, _08132FAC + ldr r4, _08132FB0 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r2, 0xC + adds r0, r2 + ldrh r0, [r0] + ldrh r1, [r6] + cmp r0, r1 + beq _08132FA6 + adds r7, r4, 0 + movs r6, 0x58 + adds r4, r2, 0 + adds r2, r1, 0 +_08132F90: + adds r3, 0x1 + cmp r3, 0x3 + bgt _08132FA6 + lsls r1, r3, 1 + ldrb r0, [r7] + muls r0, r6 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + cmp r0, r2 + bne _08132F90 +_08132FA6: + cmp r3, 0x4 + bne _08132FF0 + b _08133000 + .align 2, 0 +_08132FAC: .4byte 0x02024084 +_08132FB0: .4byte 0x0203ab3c +_08132FB4: + movs r3, 0 + ldr r4, _08132FF8 + ldr r0, [r4] + ldr r1, [r0, 0x18] + ldr r2, _08132FFC + ldrb r0, [r2] + lsls r0, 4 + adds r1, r0 + ldrh r0, [r1] + ldrh r1, [r6] + cmp r0, r1 + beq _08132FEC + adds r7, r4, 0 + adds r6, r2, 0 + adds r4, r1, 0 +_08132FD2: + adds r3, 0x1 + cmp r3, 0x3 + bgt _08132FEC + ldr r0, [r7] + ldr r2, [r0, 0x18] + lsls r1, r3, 1 + ldrb r0, [r6] + lsls r0, 4 + adds r1, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, r4 + bne _08132FD2 +_08132FEC: + cmp r3, 0x4 + beq _08133000 +_08132FF0: + ldr r0, [r5] + adds r0, 0x8 + str r0, [r5] + b _08133018 + .align 2, 0 +_08132FF8: .4byte 0x020244a8 +_08132FFC: .4byte 0x0202420c +_08133000: + ldr r2, [r5] + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] +_08133018: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai40_unk + + thumb_func_start tai41_unk +tai41_unk: @ 8133020 + push {r4-r7,lr} + ldr r1, _08133038 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x1 + beq _08133044 + cmp r0, 0x1 + bgt _0813303C + cmp r0, 0 + beq _08133090 + b _08133110 + .align 2, 0 +_08133038: .4byte 0x0203ab38 +_0813303C: + cmp r0, 0x2 + beq _08133090 + cmp r0, 0x3 + bne _08133110 +_08133044: + movs r3, 0 + ldr r1, _08133080 + ldr r0, _08133084 + ldrb r2, [r0] + ldr r6, _08133088 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 + ldr r4, _0813308C +_08133058: + ldrh r0, [r2] + cmp r0, 0 + beq _08133072 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, [r4] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _0813307A +_08133072: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08133058 +_0813307A: + cmp r3, 0x4 + beq _081330DC + b _081330F8 + .align 2, 0 +_08133080: .4byte 0x02024084 +_08133084: .4byte 0x0203ab3c +_08133088: .4byte 0x0831c898 +_0813308C: .4byte 0x0203ab38 +_08133090: + movs r3, 0 + ldr r1, _081330E4 + ldr r0, _081330E8 + ldrb r2, [r0] + ldr r0, _081330EC + mov r12, r0 + ldr r7, _081330F0 + ldr r6, _081330F4 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r4, r0, r1 +_081330A8: + lsls r2, r3, 1 + ldrh r0, [r4] + cmp r0, 0 + beq _081330D0 + ldr r0, [r7] + ldr r1, [r0, 0x18] + ldrb r0, [r6] + lsls r0, 4 + adds r0, r2, r0 + adds r1, r0 + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldr r1, [r5] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _081330D8 +_081330D0: + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _081330A8 +_081330D8: + cmp r3, 0x4 + bne _081330F8 +_081330DC: + ldr r0, [r5] + adds r0, 0x7 + str r0, [r5] + b _08133110 + .align 2, 0 +_081330E4: .4byte 0x02024084 +_081330E8: .4byte 0x0203ab3c +_081330EC: .4byte 0x0831c898 +_081330F0: .4byte 0x020244a8 +_081330F4: .4byte 0x0202420c +_081330F8: + ldr r2, [r5] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] +_08133110: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai41_unk + + thumb_func_start tai42_unk +tai42_unk: @ 8133118 + push {r4-r6,lr} + ldr r1, _08133130 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r4, r1, 0 + cmp r0, 0x1 + beq _0813313C + cmp r0, 0x1 + bgt _08133134 + cmp r0, 0 + beq _08133188 + b _081331F4 + .align 2, 0 +_08133130: .4byte 0x0203ab38 +_08133134: + cmp r0, 0x2 + beq _08133188 + cmp r0, 0x3 + bne _081331F4 +_0813313C: + movs r3, 0 + ldr r1, _08133178 + ldr r0, _0813317C + ldrb r2, [r0] + ldr r6, _08133180 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 + ldr r5, _08133184 +_08133150: + ldrh r0, [r2] + cmp r0, 0 + beq _0813316A + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, [r5] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _08133172 +_0813316A: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08133150 +_08133172: + cmp r3, 0x4 + bne _081331C2 + b _081331DC + .align 2, 0 +_08133178: .4byte 0x02024084 +_0813317C: .4byte 0x0203ab3c +_08133180: .4byte 0x0831c898 +_08133184: .4byte 0x0203ab38 +_08133188: + movs r3, 0 + ldr r0, _081331CC + ldr r0, [r0] + ldr r1, [r0, 0x18] + ldr r0, _081331D0 + ldrb r0, [r0] + ldr r6, _081331D4 + lsls r0, 4 + adds r2, r0, r1 + ldr r5, _081331D8 +_0813319C: + ldrh r0, [r2] + cmp r0, 0 + beq _081331B6 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, [r5] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _081331BE +_081331B6: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _0813319C +_081331BE: + cmp r3, 0x4 + beq _081331DC +_081331C2: + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + b _081331F4 + .align 2, 0 +_081331CC: .4byte 0x020244a8 +_081331D0: .4byte 0x0202420c +_081331D4: .4byte 0x0831c898 +_081331D8: .4byte 0x0203ab38 +_081331DC: + ldr r2, [r4] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] +_081331F4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end tai42_unk + + thumb_func_start tai43_unk +tai43_unk: @ 81331FC + push {r4,r5,lr} + ldr r0, _08133210 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08133218 + ldr r0, _08133214 + b _0813321A + .align 2, 0 +_08133210: .4byte 0x0203ab38 +_08133214: .4byte 0x0203ab3c +_08133218: + ldr r0, _08133238 +_0813321A: + ldrb r3, [r0] + adds r4, r5, 0 + ldr r2, [r4] + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _08133240 + ldr r0, _0813323C + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x4] + cmp r0, 0 + beq _08133244 + b _0813325A + .align 2, 0 +_08133238: .4byte 0x0202420c +_0813323C: .4byte 0x020242bc +_08133240: + cmp r0, 0x1 + beq _0813324A +_08133244: + adds r0, r2, 0x7 + str r0, [r4] + b _0813327C +_0813324A: + ldr r0, _08133274 + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + beq _08133278 +_0813325A: + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813327C + .align 2, 0 +_08133274: .4byte 0x020242bc +_08133278: + adds r0, r2, 0x7 + str r0, [r5] +_0813327C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai43_unk + + thumb_func_start tai44_unk +tai44_unk: @ 8133284 + push {r4,lr} + ldr r4, _08133298 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + cmp r0, 0 + beq _0813329C + cmp r0, 0x1 + beq _081332C8 + b _08133308 + .align 2, 0 +_08133298: .4byte 0x0203ab38 +_0813329C: + ldr r2, _081332BC + ldr r0, _081332C0 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _081332C4 + ldr r1, [r1] + ldr r1, [r1, 0x14] + ldrh r0, [r0, 0x4] + ldrh r1, [r1, 0x2] + cmp r0, r1 + beq _081332E4 + b _08133308 + .align 2, 0 +_081332BC: .4byte 0x020242bc +_081332C0: .4byte 0x02024064 +_081332C4: .4byte 0x020244a8 +_081332C8: + ldr r2, _081332FC + ldr r0, _08133300 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _08133304 + ldr r1, [r1] + ldr r1, [r1, 0x14] + ldrh r0, [r0, 0x6] + ldrh r1, [r1, 0x2] + cmp r0, r1 + bne _08133308 +_081332E4: + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813330C + .align 2, 0 +_081332FC: .4byte 0x020242bc +_08133300: .4byte 0x02024064 +_08133304: .4byte 0x020244a8 +_08133308: + adds r0, r3, 0x6 + str r0, [r4] +_0813330C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai44_unk + + thumb_func_start tai45_unk +tai45_unk: @ 8133314 + ldr r0, _08133324 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0xB + orrs r0, r1 + strb r0, [r2, 0x10] + bx lr + .align 2, 0 +_08133324: .4byte 0x020244a8 + thumb_func_end tai45_unk + + thumb_func_start tai46_unk +tai46_unk: @ 8133328 + push {r4,lr} + ldr r0, _0813336C + ldr r0, [r0] + adds r0, 0x7B + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcs _08133374 + ldr r3, _08133370 + 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 _0813337C + .align 2, 0 +_0813336C: .4byte 0x0202449c +_08133370: .4byte 0x0203ab38 +_08133374: + ldr r1, _08133384 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0813337C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08133384: .4byte 0x0203ab38 + thumb_func_end tai46_unk + + thumb_func_start dp15_end_with_move_5 +dp15_end_with_move_5: @ 8133388 + ldr r0, _08133398 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0xD + orrs r0, r1 + strb r0, [r2, 0x10] + bx lr + .align 2, 0 +_08133398: .4byte 0x020244a8 + thumb_func_end dp15_end_with_move_5 + + thumb_func_start dp15_get_held_item_x12__8 +dp15_get_held_item_x12__8: @ 813339C + push {r4,lr} + ldr r0, _081333AC + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081333B4 + ldr r0, _081333B0 + b _081333B6 + .align 2, 0 +_081333AC: .4byte 0x0203ab38 +_081333B0: .4byte 0x0203ab3c +_081333B4: + ldr r0, _081333D4 +_081333B6: + ldrb r2, [r0] + ldr r0, _081333D8 + ldrb r0, [r0] + cmp r0, r2 + beq _081333E0 + ldr r4, _081333DC + ldr r0, [r4] + ldr r0, [r0, 0x18] + adds r0, 0x44 + adds r0, r2 + ldrb r0, [r0] + bl itemid_get_x12 + ldr r1, [r4] + b _081333F2 + .align 2, 0 +_081333D4: .4byte 0x0202420c +_081333D8: .4byte 0x02024064 +_081333DC: .4byte 0x020244a8 +_081333E0: + ldr r1, _08133408 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + bl itemid_get_x12 + ldr r1, _0813340C + ldr r1, [r1] +_081333F2: + ldr r1, [r1, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x8] + ldr r1, _08133410 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08133408: .4byte 0x02024084 +_0813340C: .4byte 0x020244a8 +_08133410: .4byte 0x0203ab38 + thumb_func_end dp15_get_held_item_x12__8 + + thumb_func_start tai62_unk +tai62_unk: @ 8133414 + push {r4,lr} + ldr r0, _08133440 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + lsrs r3, r0, 24 + movs r0, 0x1 + ldr r1, _08133444 + ldrb r2, [r1] + adds r1, r3, 0 + ands r1, r0 + ands r0, r2 + cmp r1, r0 + bne _0813344C + ldr r1, _08133448 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r3, [r0, 0x2E] + b _08133458 + .align 2, 0 +_08133440: .4byte 0x0203ab38 +_08133444: .4byte 0x0203ab3c +_08133448: .4byte 0x02024084 +_0813344C: + ldr r0, _08133480 + ldr r0, [r0] + ldr r0, [r0, 0x18] + adds r0, 0x44 + adds r0, r3 + ldrb r3, [r0] +_08133458: + ldr r4, _08133484 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + orrs r0, r1 + cmp r0, r3 + bne _08133488 + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813348E + .align 2, 0 +_08133480: .4byte 0x020244a8 +_08133484: .4byte 0x0203ab38 +_08133488: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_0813348E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai62_unk + + thumb_func_start tai49_unk +tai49_unk: @ 8133494 + push {lr} + ldr r0, _081334A4 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081334AC + ldr r0, _081334A8 + b _081334AE + .align 2, 0 +_081334A4: .4byte 0x0203ab38 +_081334A8: .4byte 0x0203ab3c +_081334AC: + ldr r0, _081334DC +_081334AE: + ldrb r1, [r0] + ldr r2, _081334E0 + movs r0, 0x58 + muls r1, r0 + adds r0, r1, r2 + ldrh r0, [r0] + adds r2, 0x48 + adds r1, r2 + ldr r1, [r1] + bl pokemon_species_get_gender_info + ldr r1, _081334E4 + ldr r1, [r1] + ldr r1, [r1, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x8] + ldr r1, _081334E8 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081334DC: .4byte 0x0202420c +_081334E0: .4byte 0x02024084 +_081334E4: .4byte 0x020244a8 +_081334E8: .4byte 0x0203ab38 + thumb_func_end tai49_unk + + thumb_func_start dp15_enter_battle_countdown_get_state +dp15_enter_battle_countdown_get_state: @ 81334EC + push {r4,lr} + ldr r0, _08133500 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08133508 + ldr r0, _08133504 + b _0813350A + .align 2, 0 +_08133500: .4byte 0x0203ab38 +_08133504: .4byte 0x0203ab3c +_08133508: + ldr r0, _0813352C +_0813350A: + ldrb r3, [r0] + ldr r0, _08133530 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, _08133534 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813352C: .4byte 0x0202420c +_08133530: .4byte 0x020244a8 +_08133534: .4byte 0x020242bc + thumb_func_end dp15_enter_battle_countdown_get_state + + thumb_func_start dp15_stockpile_get_num_uses +dp15_stockpile_get_num_uses: @ 8133538 + push {r4,lr} + ldr r0, _0813354C + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08133554 + ldr r0, _08133550 + b _08133556 + .align 2, 0 +_0813354C: .4byte 0x0203ab38 +_08133550: .4byte 0x0203ab3c +_08133554: + ldr r0, _08133578 +_08133556: + ldrb r3, [r0] + ldr r0, _0813357C + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, _08133580 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x9] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08133578: .4byte 0x0202420c +_0813357C: .4byte 0x020244a8 +_08133580: .4byte 0x020242bc + thumb_func_end dp15_stockpile_get_num_uses + + thumb_func_start dp15_is_double_battle +dp15_is_double_battle: @ 8133584 + ldr r0, _081335A0 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, _081335A4 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + str r0, [r2, 0x8] + ldr r1, _081335A8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_081335A0: .4byte 0x020244a8 +_081335A4: .4byte 0x02022fec +_081335A8: .4byte 0x0203ab38 + thumb_func_end dp15_is_double_battle + + thumb_func_start dp15_get_dp08_item__8 +dp15_get_dp08_item__8: @ 81335AC + push {r4,lr} + ldr r0, _081335C0 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _081335C8 + ldr r0, _081335C4 + b _081335CA + .align 2, 0 +_081335C0: .4byte 0x0203ab38 +_081335C4: .4byte 0x0203ab3c +_081335C8: + ldr r0, _081335EC +_081335CA: + ldrb r3, [r0] + ldr r0, _081335F0 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, _081335F4 + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081335EC: .4byte 0x0202420c +_081335F0: .4byte 0x020244a8 +_081335F4: .4byte 0x0202449c + thumb_func_end dp15_get_dp08_item__8 + + thumb_func_start dp15_move_get_type__8 +dp15_move_get_type__8: @ 81335F8 + ldr r0, _08133618 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _0813361C + ldr r1, [r3, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + str r0, [r3, 0x8] + ldr r1, _08133620 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08133618: .4byte 0x020244a8 +_0813361C: .4byte 0x0831c898 +_08133620: .4byte 0x0203ab38 + thumb_func_end dp15_move_get_type__8 + + thumb_func_start dp15_move_get_power__8_8 +dp15_move_get_power__8_8: @ 8133624 + ldr r0, _08133644 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08133648 + ldr r1, [r3, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + str r0, [r3, 0x8] + ldr r1, _0813364C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08133644: .4byte 0x020244a8 +_08133648: .4byte 0x0831c898 +_0813364C: .4byte 0x0203ab38 + thumb_func_end dp15_move_get_power__8_8 + + thumb_func_start dp15_move_get_move_script_id__8 +dp15_move_get_move_script_id__8: @ 8133650 + ldr r0, _08133670 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, _08133674 + ldr r1, [r3, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + str r0, [r3, 0x8] + ldr r1, _08133678 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08133670: .4byte 0x020244a8 +_08133674: .4byte 0x0831c898 +_08133678: .4byte 0x0203ab38 + thumb_func_end dp15_move_get_move_script_id__8 + + thumb_func_start dp15_get_protect_endure_activity +dp15_get_protect_endure_activity: @ 813367C + push {r4,lr} + ldr r0, _08133690 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08133698 + ldr r0, _08133694 + b _0813369A + .align 2, 0 +_08133690: .4byte 0x0203ab38 +_08133694: .4byte 0x0203ab3c +_08133698: + ldr r0, _081336BC +_0813369A: + ldrb r3, [r0] + ldr r0, _081336C0 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, _081336C4 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081336BC: .4byte 0x0202420c +_081336C0: .4byte 0x020244a8 +_081336C4: .4byte 0x020242bc + thumb_func_end dp15_get_protect_endure_activity + + thumb_func_start nullsub_106 +nullsub_106: @ 81336C8 + bx lr + thumb_func_end nullsub_106 + + thumb_func_start nullsub_107 +nullsub_107: @ 81336CC + bx lr + thumb_func_end nullsub_107 + + thumb_func_start nullsub_108 +nullsub_108: @ 81336D0 + bx lr + thumb_func_end nullsub_108 + + thumb_func_start nullsub_109 +nullsub_109: @ 81336D4 + bx lr + thumb_func_end nullsub_109 + + thumb_func_start nullsub_110 +nullsub_110: @ 81336D8 + bx lr + thumb_func_end nullsub_110 + + thumb_func_start nullsub_111 +nullsub_111: @ 81336DC + bx lr + thumb_func_end nullsub_111 + + thumb_func_start tai58_unk +tai58_unk: @ 81336E0 + push {r4,lr} + ldr r4, _0813370C + ldr r0, [r4] + adds r0, 0x5 + bl b_mc_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 + .align 2, 0 +_0813370C: .4byte 0x0203ab38 + thumb_func_end tai58_unk + + thumb_func_start dp15_jump +dp15_jump: @ 8133710 + ldr r3, _0813372C + 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] + bx lr + .align 2, 0 +_0813372C: .4byte 0x0203ab38 + thumb_func_end dp15_jump + + thumb_func_start dp15_return +dp15_return: @ 8133730 + push {lr} + bl b_mc_stack_pop_cursor + lsls r0, 24 + cmp r0, 0 + bne _0813374A + ldr r0, _08133750 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x10] +_0813374A: + pop {r0} + bx r0 + .align 2, 0 +_08133750: .4byte 0x020244a8 + thumb_func_end dp15_return + + thumb_func_start dp15_compare_attacker_defender_levels +dp15_compare_attacker_defender_levels: @ 8133754 + push {r4,r5,lr} + ldr r5, _0813376C + ldr r4, [r5] + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + beq _081337A8 + cmp r0, 0x1 + bgt _08133770 + cmp r0, 0 + beq _08133776 + b _08133824 + .align 2, 0 +_0813376C: .4byte 0x0203ab38 +_08133770: + cmp r0, 0x2 + beq _081337D8 + b _08133824 +_08133776: + ldr r3, _0813379C + ldr r0, _081337A0 + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, _081337A4 + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bhi _081337FA + b _08133820 + .align 2, 0 +_0813379C: .4byte 0x02024084 +_081337A0: .4byte 0x0203ab3c +_081337A4: .4byte 0x0202420c +_081337A8: + ldr r3, _081337CC + ldr r0, _081337D0 + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, _081337D4 + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcc _081337FA + b _08133820 + .align 2, 0 +_081337CC: .4byte 0x02024084 +_081337D0: .4byte 0x0203ab3c +_081337D4: .4byte 0x0202420c +_081337D8: + ldr r3, _08133814 + ldr r0, _08133818 + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, _0813381C + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bne _08133820 +_081337FA: + ldrb r1, [r4, 0x2] + ldrb r0, [r4, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r4, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r4, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08133824 + .align 2, 0 +_08133814: .4byte 0x02024084 +_08133818: .4byte 0x0203ab3c +_0813381C: .4byte 0x0202420c +_08133820: + adds r0, r4, 0x6 + str r0, [r5] +_08133824: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp15_compare_attacker_defender_levels + + thumb_func_start tai5C_unk +tai5C_unk: @ 813382C + push {lr} + ldr r2, _08133860 + ldr r0, _08133864 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _0813386C + ldr r3, _08133868 + 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 _08133874 + .align 2, 0 +_08133860: .4byte 0x020242bc +_08133864: .4byte 0x0202420c +_08133868: .4byte 0x0203ab38 +_0813386C: + ldr r1, _08133878 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08133874: + pop {r0} + bx r0 + .align 2, 0 +_08133878: .4byte 0x0203ab38 + thumb_func_end tai5C_unk + + thumb_func_start tai5D_unk +tai5D_unk: @ 813387C + push {lr} + ldr r2, _081338B0 + ldr r0, _081338B4 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] + lsls r0, 28 + cmp r0, 0 + bne _081338BC + ldr r3, _081338B8 + 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 _081338C4 + .align 2, 0 +_081338B0: .4byte 0x020242bc +_081338B4: .4byte 0x0202420c +_081338B8: .4byte 0x0203ab38 +_081338BC: + ldr r1, _081338C8 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_081338C4: + pop {r0} + bx r0 + .align 2, 0 +_081338C8: .4byte 0x0203ab38 + thumb_func_end tai5D_unk + + thumb_func_start tai5E_unk +tai5E_unk: @ 81338CC + push {lr} + ldr r0, _08133900 + ldrb r3, [r0] + movs r0, 0x1 + ldr r1, _08133904 + ldrb r2, [r1] + adds r1, r0, 0 + ands r1, r3 + ands r0, r2 + cmp r1, r0 + bne _0813390C + ldr r3, _08133908 + 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 _08133914 + .align 2, 0 +_08133900: .4byte 0x0203ab3c +_08133904: .4byte 0x0202420c +_08133908: .4byte 0x0203ab38 +_0813390C: + ldr r1, _08133918 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08133914: + pop {r0} + bx r0 + .align 2, 0 +_08133918: .4byte 0x0203ab38 + thumb_func_end tai5E_unk + + thumb_func_start tai61_unk +tai61_unk: @ 813391C + push {r4,lr} + ldr r4, _08133958 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + ldr r1, _0813395C + ldr r1, [r1] + ldr r1, [r1, 0x4] + lsrs r0, 22 + adds r1, r0 + ldr r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08133960 + 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 _08133966 + .align 2, 0 +_08133958: .4byte 0x0203ab38 +_0813395C: .4byte 0x020244a8 +_08133960: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_08133966: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai61_unk + + thumb_func_start b_mc_stack_push +b_mc_stack_push: @ 813396C + push {r4,lr} + ldr r1, _0813398C + ldr r1, [r1] + ldr r3, [r1, 0x1C] + 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 + .align 2, 0 +_0813398C: .4byte 0x020244a8 + thumb_func_end b_mc_stack_push + + thumb_func_start b_mc_stack_push_cursor +b_mc_stack_push_cursor: @ 8133990 + ldr r0, _081339B0 + ldr r0, [r0] + ldr r2, [r0, 0x1C] + 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, _081339B4 + ldr r0, [r0] + str r0, [r2] + bx lr + .align 2, 0 +_081339B0: .4byte 0x020244a8 +_081339B4: .4byte 0x0203ab38 + thumb_func_end b_mc_stack_push_cursor + + thumb_func_start b_mc_stack_pop_cursor +b_mc_stack_pop_cursor: @ 81339B8 + push {lr} + ldr r3, _081339D0 + ldr r0, [r3] + ldr r0, [r0, 0x1C] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + bne _081339D4 + movs r0, 0 + b _081339EE + .align 2, 0 +_081339D0: .4byte 0x020244a8 +_081339D4: + subs r0, 0x1 + strb r0, [r1] + ldr r2, _081339F4 + ldr r0, [r3] + ldr r1, [r0, 0x1C] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + movs r0, 0x1 +_081339EE: + pop {r1} + bx r1 + .align 2, 0 +_081339F4: .4byte 0x0203ab38 + thumb_func_end b_mc_stack_pop_cursor + + thumb_func_start sub_81339F8 +sub_81339F8: @ 81339F8 + push {r4-r6,lr} + ldr r0, _08133A4C + ldr r1, [r0] + ldr r0, _08133A50 + adds r5, r1, r0 + movs r2, 0 + movs r0, 0x2 + strb r0, [r5] + ldr r0, _08133A54 + adds r1, r0 + strb r2, [r1] + movs r4, 0 + ldr r6, _08133A58 +_08133A12: + movs r0, 0xB + muls r0, r4 + adds r0, 0x5 + adds r0, r5, r0 + lsls r1, r4, 2 + adds r1, r6 + ldr r1, [r1] + bl gf_strcpy + adds r1, r5, 0x1 + adds r1, r4 + ldr r0, _08133A5C + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0x32 + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08133A12 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08133A4C: .4byte 0x03005d8c +_08133A50: .4byte 0x00002e28 +_08133A54: .4byte 0x00002e59 +_08133A58: .4byte 0x085b09e4 +_08133A5C: .4byte 0x085b09f4 + thumb_func_end sub_81339F8 + + thumb_func_start sub_8133A60 +sub_8133A60: @ 8133A60 + ldr r0, _08133A70 + ldr r0, [r0] + ldr r1, _08133A74 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_08133A70: .4byte 0x03005d8c +_08133A74: .4byte 0x00002e59 + thumb_func_end sub_8133A60 + + thumb_func_start sub_8133A78 +sub_8133A78: @ 8133A78 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08133AD4 + adds r7, r1, r0 + ldr r0, _08133AD8 + ldr r4, [r0] + ldr r0, _08133ADC + adds r0, r4 + mov r9, r0 + ldr r0, _08133AE0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + ldr r1, _08133AE4 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r6, r0, 0 + ldr r1, _08133AE8 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + mov r8, r0 + movs r5, 0 + ldr r0, _08133AEC + adds r4, r0 +_08133AC2: + mov r0, r9 + adds r0, 0x1 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0x78 + bls _08133AF0 + mov r0, r8 + b _08133B00 + .align 2, 0 +_08133AD4: .4byte 0x03005e08 +_08133AD8: .4byte 0x03005d8c +_08133ADC: .4byte 0x00002e28 +_08133AE0: .4byte 0x085b09f8 +_08133AE4: .4byte 0x085eb7ea +_08133AE8: .4byte 0x085e8d38 +_08133AEC: .4byte 0x00002e29 +_08133AF0: + ldrb r1, [r1] + lsls r1, 5 + ldr r0, _08133B64 + adds r1, r0 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string +_08133B00: + cmp r0, r6 + ble _08133B06 + adds r6, r0, 0 +_08133B06: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08133AC2 + adds r0, r6, 0 + bl convert_pixel_width_to_tile_width + lsls r0, 24 + ldr r2, _08133B68 + ldr r1, [sp, 0xC] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] + add r0, sp, 0xC + bl Window_AddFromTemplate + strh r0, [r7, 0x6] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + movs r5, 0 +_08133B3C: + adds r1, r4, r5 + ldrb r0, [r1] + cmp r0, 0x78 + bls _08133B70 + ldrb r0, [r7, 0x6] + lsls r1, r5, 4 + adds r1, 0x1 + 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 + ldr r2, _08133B6C + movs r3, 0x8 + bl Print + b _08133B94 + .align 2, 0 +_08133B64: .4byte 0x085a5c09 +_08133B68: .4byte 0x00ffffff +_08133B6C: .4byte 0x085e8d38 +_08133B70: + ldrb r0, [r7, 0x6] + ldrb r2, [r1] + lsls r2, 5 + ldr r1, _08133BDC + adds r2, r1 + lsls r1, r5, 4 + adds r1, 0x1 + 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 + movs r3, 0x8 + bl Print +_08133B94: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08133B3C + ldrb r0, [r7, 0x6] + ldr r2, _08133BE0 + lsls r1, r5, 4 + adds r1, 0x1 + 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 + movs r3, 0x8 + bl Print + ldrb r0, [r7, 0x6] + movs r1, 0x5 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08133BDC: .4byte 0x085a5c09 +_08133BE0: .4byte 0x085eb7ea + thumb_func_end sub_8133A78 + + thumb_func_start sub_8133BE4 +sub_8133BE4: @ 8133BE4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08133C08 + adds r4, r0, r1 + cmp r2, 0x78 + bls _08133C14 + ldr r1, _08133C0C + ldr r2, _08133C10 + adds r0, r2, 0 + strh r0, [r1] + b _08133C18 + .align 2, 0 +_08133C08: .4byte 0x03005e08 +_08133C0C: .4byte 0x020375e0 +_08133C10: .4byte 0x0000ffff +_08133C14: + ldr r0, _08133C44 + strh r2, [r0] +_08133C18: + ldrb r0, [r4, 0x6] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x6] + bl Window_FillTileMap + ldrb r0, [r4, 0x6] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08133C44: .4byte 0x020375e0 + thumb_func_end sub_8133BE4 + + thumb_func_start sub_8133C48 +sub_8133C48: @ 8133C48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _08133C74 + ldr r0, [r0] + ldr r1, _08133C78 + adds r6, r0, r1 + bl ProcessMenuInput + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08133C80 + cmp r1, r0 + bgt _08133C7C + subs r0, 0x1 + cmp r1, r0 + beq _08133CCA + b _08133C90 + .align 2, 0 +_08133C74: .4byte 0x03005d8c +_08133C78: .4byte 0x00002e28 +_08133C7C: + cmp r1, 0x4 + bne _08133C90 +_08133C80: + movs r0, 0x5 + bl audio_play + adds r0, r7, 0 + movs r1, 0 + bl sub_8133BE4 + b _08133CCA +_08133C90: + movs r0, 0x5 + bl audio_play + ldr r0, _08133CD0 + lsls r4, 24 + asrs r4, 24 + strh r4, [r0] + ldr r5, _08133CD4 + movs r0, 0xB + adds r1, r4, 0 + muls r1, r0 + adds r1, 0x5 + adds r1, r6, r1 + adds r0, r5, 0 + bl gf_strcpy + adds r0, r6, 0 + adds r0, 0x32 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8009308 + adds r0, r6, 0x1 + adds r0, r4 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8133BE4 +_08133CCA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08133CD0: .4byte 0x020375e2 +_08133CD4: .4byte 0x02021cc4 + thumb_func_end sub_8133C48 + + thumb_func_start sub_8133CD8 +sub_8133CD8: @ 8133CD8 + ldr r0, _08133CE8 + ldr r0, [r0] + ldr r1, _08133CEC + ldr r2, _08133CF0 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_08133CE8: .4byte 0x03005d8c +_08133CEC: .4byte 0x020375f0 +_08133CF0: .4byte 0x00002e59 + thumb_func_end sub_8133CD8 + + thumb_func_start sub_8133CF4 +sub_8133CF4: @ 8133CF4 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _08133D0C +_08133CFA: + adds r0, r4, 0 + bl sub_8161AD0 + lsls r0, 24 + cmp r0, 0 + beq _08133D10 + movs r0, 0 + strh r0, [r5] + b _08133D20 + .align 2, 0 +_08133D0C: .4byte 0x020375f0 +_08133D10: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08133CFA + ldr r1, _08133D28 + movs r0, 0x1 + strh r0, [r1] +_08133D20: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08133D28: .4byte 0x020375f0 + thumb_func_end sub_8133CF4 + + thumb_func_start sub_8133D2C +sub_8133D2C: @ 8133D2C + push {r4-r6,lr} + ldr r6, _08133D78 + movs r0, 0 + strh r0, [r6] + ldr r4, _08133D7C + ldr r5, _08133D80 + ldrh r0, [r5] + lsls r0, 5 + adds r2, r0, r4 + ldr r0, _08133D84 + ldrh r0, [r0] + lsls r0, 5 + adds r0, r4 + ldrb r1, [r2, 0x13] + ldrb r0, [r0, 0x13] + cmp r1, r0 + beq _08133D72 + adds r0, r1, 0 + bl sub_81618D0 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08133D72 + ldr r0, _08133D88 + ldrh r1, [r5] + lsls r1, 5 + adds r1, r4 + ldrb r1, [r1, 0x13] + bl sub_8127250 + movs r0, 0x1 + strh r0, [r6] +_08133D72: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08133D78: .4byte 0x020375f0 +_08133D7C: .4byte 0x085a5c08 +_08133D80: .4byte 0x020375e0 +_08133D84: .4byte 0x020375e4 +_08133D88: .4byte 0x02021dc4 + thumb_func_end sub_8133D2C + + thumb_func_start sub_8133D8C +sub_8133D8C: @ 8133D8C + push {lr} + ldr r0, _08133D9C + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_08133D9C: .4byte sub_8127208 + 1 + thumb_func_end sub_8133D8C + + thumb_func_start sub_8133DA0 +sub_8133DA0: @ 8133DA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81279C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08133DFC + ldr r5, _08133DE0 + ldr r0, _08133DE4 + ldrb r1, [r0] + ldr r0, _08133DE8 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r5] + ldr r0, _08133DEC + ldr r1, _08133DF0 + ldrh r1, [r1] + lsls r1, 5 + ldr r4, _08133DF4 + adds r1, r4 + bl gf_strcpy + ldr r0, _08133DF8 + ldrh r1, [r5] + lsls r1, 5 + adds r1, r4 + bl gf_strcpy + b _08133E04 + .align 2, 0 +_08133DE0: .4byte 0x020375e4 +_08133DE4: .4byte 0x0203a172 +_08133DE8: .4byte 0x0203a14c +_08133DEC: .4byte 0x02021ec4 +_08133DF0: .4byte 0x020375e0 +_08133DF4: .4byte 0x085a5c09 +_08133DF8: .4byte 0x02021dc4 +_08133DFC: + ldr r1, _08133E14 + ldr r2, _08133E18 + adds r0, r2, 0 + strh r0, [r1] +_08133E04: + adds r0, r6, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08133E14: .4byte 0x020375e4 +_08133E18: .4byte 0x0000ffff + thumb_func_end sub_8133DA0 + + thumb_func_start sub_8133E1C +sub_8133E1C: @ 8133E1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08133E34 + movs r1, 0 + strh r1, [r2] + bl remove_task + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + .align 2, 0 +_08133E34: .4byte 0x020375e4 + thumb_func_end sub_8133E1C + + thumb_func_start sub_8133E38 +sub_8133E38: @ 8133E38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _08133E9C + ldr r6, [r0] + ldr r0, _08133EA0 + adds r5, r6, r0 + ldr r1, _08133EA4 + mov r8, r1 + ldrb r0, [r1] + bl sub_81619DC + ldr r0, _08133EA8 + ldrb r0, [r0] + bl sub_8161960 + ldr r4, _08133EAC + ldrh r1, [r4] + movs r0, 0xB + muls r0, r1 + adds r0, 0x5 + adds r5, r0 + ldr r0, _08133EB0 + ldr r1, [r0] + adds r0, r5, 0 + bl gf_strcpy + ldr r2, _08133EB4 + adds r0, r6, r2 + ldrh r1, [r4] + adds r0, r1 + mov r2, r8 + ldrh r1, [r2] + strb r1, [r0] + ldr r1, _08133EB8 + adds r0, r6, r1 + ldrh r4, [r4] + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] + ldr r2, _08133EBC + adds r6, r2 + movs r0, 0x1 + strb r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08133E9C: .4byte 0x03005d8c +_08133EA0: .4byte 0x00002e28 +_08133EA4: .4byte 0x020375e4 +_08133EA8: .4byte 0x020375e0 +_08133EAC: .4byte 0x020375e2 +_08133EB0: .4byte 0x03005d90 +_08133EB4: .4byte 0x00002e29 +_08133EB8: .4byte 0x00002e5a +_08133EBC: .4byte 0x00002e59 + thumb_func_end sub_8133E38 + + thumb_func_start sub_8133EC0 +sub_8133EC0: @ 8133EC0 + push {lr} + ldr r0, _08133ED8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl sub_8133A78 + pop {r0} + bx r0 + .align 2, 0 +_08133ED8: .4byte sub_8133C48 + 1 + thumb_func_end sub_8133EC0 + + thumb_func_start sub_8133EDC +sub_8133EDC: @ 8133EDC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3 + bls _08133EE8 + movs r1, 0 +_08133EE8: + ldr r0, _08133EF4 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_08133EF4: .4byte 0x085b1df8 + thumb_func_end sub_8133EDC + + thumb_func_start sub_8133EF8 +sub_8133EF8: @ 8133EF8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8133EF8 + + thumb_func_start set_256color_bg_bg0 +set_256color_bg_bg0: @ 8133F0C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xC + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r2, _08134180 + str r1, [r2] + movs r1, 0xC0 + lsls r1, 19 + str r1, [r2, 0x4] + ldr r0, _08134184 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r0, 0 + mov r9, r0 + str r0, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r2] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, _08134188 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + add r0, sp, 0x4 + mov r3, r9 + strh r3, [r0] + str r0, [r2] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, _0813418C + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, _08134190 + bl LZ77UnCompVram + ldr r0, _08134194 + ldr r1, _08134198 + bl LZ77UnCompVram + ldr r0, _0813419C + ldr r1, _081341A0 + bl LZ77UnCompVram + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081341A4 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r0, _081341A8 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r1, 0xAA + lsls r1, 2 + movs r0, 0 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl sub_80A1A74 + bl gpu_pal_allocator_reset + bl dp13_810BB8C + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _081341AC + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, _081341B0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081341B4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081341B8 + bl gpu_pal_obj_alloc_and_load_multiple + movs r0, 0x1 + negs r0, r0 + mov r1, r9 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _081341BC + bl SetVBlankCallback + ldr r0, _081341C0 + bl set_callback2 + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x1F + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0xFE + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x7 + bl lcd_io_set + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r0, _081341C4 + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081341C8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r3, 0x1 + mov r10, r3 + mov r1, r10 + strh r1, [r0, 0x8] + ldr r0, _081341CC + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r3, _081341D0 + mov r8, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + ldr r6, _081341D4 + ldr r5, _081341D8 + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + adds r0, r6, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + mov r0, r9 + strh r0, [r1, 0x30] + ldrb r1, [r5, 0x2] + ldrb r2, [r5, 0x3] + adds r0, r6, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + mov r3, r10 + strh r3, [r1, 0x30] + ldrb r1, [r5, 0x4] + ldrb r2, [r5, 0x5] + adds r0, r6, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + movs r0, 0x2 + strh r0, [r1, 0x30] + ldr r1, _081341DC + movs r0, 0xFF + strh r0, [r1] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08134180: .4byte 0x040000d4 +_08134184: .4byte 0x8100c000 +_08134188: .4byte 0x85000100 +_0813418C: .4byte 0x81000200 +_08134190: .4byte 0x085b0e04 +_08134194: .4byte 0x085b0a80 +_08134198: .4byte 0x06003000 +_0813419C: .4byte 0x085b0c0c +_081341A0: .4byte 0x06003800 +_081341A4: .4byte 0x085b1e00 +_081341A8: .4byte 0x085b1dcc +_081341AC: .4byte 0x085b0a00 +_081341B0: .4byte 0x085b1ed8 +_081341B4: .4byte 0x085b1ee8 +_081341B8: .4byte 0x085b1ef8 +_081341BC: .4byte sub_8133EF8 + 1 +_081341C0: .4byte sub_81341E0 + 1 +_081341C4: .4byte sub_81341FC + 1 +_081341C8: .4byte 0x03005e00 +_081341CC: .4byte 0x085b1f10 +_081341D0: .4byte 0x02020630 +_081341D4: .4byte 0x085b1f28 +_081341D8: .4byte 0x085b1dec +_081341DC: .4byte 0x030011f8 + thumb_func_end set_256color_bg_bg0 + + thumb_func_start sub_81341E0 +sub_81341E0: @ 81341E0 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81341E0 + + thumb_func_start sub_81341FC +sub_81341FC: @ 81341FC + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08134250 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x8] + bl sub_81344C8 + movs r2, 0xAA + lsls r2, 2 + movs r0, 0 + movs r1, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, _08134254 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _08134258 + str r0, [r4] + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134250: .4byte 0x03005e00 +_08134254: .4byte 0x085e8c53 +_08134258: .4byte sub_813425C + 1 + thumb_func_end sub_81341FC + + thumb_func_start sub_813425C +sub_813425C: @ 813425C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _081342D8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r2 + ldrh r7, [r6, 0x8] + ldrb r4, [r6, 0x8] + ldr r1, _081342DC + ldrh r3, [r1, 0x2E] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _081342F8 + bl sub_8134604 + ldr r0, _081342E0 + ldr r1, _081342E4 + lsls r2, r4, 1 + adds r3, r2, r1 + ldrb r5, [r3] + adds r1, 0x1 + adds r2, r1 + ldrb r4, [r2] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0xC] + ldrh r0, [r6, 0x8] + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8134690 + lsls r0, 24 + lsrs r0, 24 + ldr r4, _081342E8 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, r4, 0 + adds r2, 0x10 + adds r2, r1, r2 + ldr r3, _081342EC + str r3, [r2] + adds r4, 0x1C + adds r1, r4 + ldr r2, _081342F0 + str r2, [r1] + strh r0, [r6, 0xA] + ldr r0, _081342F4 + str r0, [r6] + b _08134334 + .align 2, 0 +_081342D8: .4byte 0x03005e00 +_081342DC: .4byte 0x030022c0 +_081342E0: .4byte 0x085b1f40 +_081342E4: .4byte 0x085b1dec +_081342E8: .4byte 0x02020630 +_081342EC: .4byte 0x085b1ed0 +_081342F0: .4byte sub_8134774 + 1 +_081342F4: .4byte sub_8134340 + 1 +_081342F8: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _08134314 + cmp r4, 0 + beq _08134314 + subs r0, r7, 0x1 + strh r0, [r6, 0x8] + ldr r0, _08134310 + str r0, [r6] + b _08134334 + .align 2, 0 +_08134310: .4byte sub_8134640 + 1 +_08134314: + ldrh r1, [r1, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08134334 + cmp r4, 0x1 + bhi _08134334 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, _0813433C + str r1, [r0] +_08134334: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813433C: .4byte sub_8134640 + 1 + thumb_func_end sub_813425C + + thumb_func_start sub_8134340 +sub_8134340: @ 8134340 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08134384 + ldr r2, _08134388 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0813437E + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x78 + bne _0813437E + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x40 + bne _0813437E + ldr r0, _0813438C + str r0, [r2] +_0813437E: + pop {r0} + bx r0 + .align 2, 0 +_08134384: .4byte 0x02020630 +_08134388: .4byte 0x03005e00 +_0813438C: .4byte sub_8134390 + 1 + thumb_func_end sub_8134340 + + thumb_func_start sub_8134390 +sub_8134390: @ 8134390 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081343F0 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x8] + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl cry_related + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _081343F4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _081343F8 + movs r1, 0xAA + lsls r1, 2 + movs r2, 0xD + movs r3, 0 + bl sub_81996C0 + ldr r0, _081343FC + str r0, [r4] + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081343F0: .4byte 0x03005e00 +_081343F4: .4byte 0x085e8c90 +_081343F8: .4byte 0x085b1ddc +_081343FC: .4byte sub_8134400 + 1 + thumb_func_end sub_8134390 + + thumb_func_start sub_8134400 +sub_8134400: @ 8134400 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08134426 + cmp r1, 0 + bgt _08134420 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08134450 + b _0813449A +_08134420: + cmp r1, 0x1 + beq _08134450 + b _0813449A +_08134426: + ldr r2, _08134444 + ldr r1, _08134448 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + strh r0, [r2] + bl dp13_810BB8C + ldr r0, _0813444C + ldr r0, [r0, 0x8] + bl set_callback2 + b _0813449A + .align 2, 0 +_08134444: .4byte 0x020375f0 +_08134448: .4byte 0x03005e00 +_0813444C: .4byte 0x030022c0 +_08134450: + movs r0, 0x5 + bl audio_play + ldr r0, _081344A0 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + ldrb r4, [r5, 0xA] + ldr r6, _081344A4 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl sub_818D820 + ldrb r0, [r5, 0xC] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r6 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles + ldr r0, _081344A8 + str r0, [r5] +_0813449A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081344A0: .4byte 0x03005e00 +_081344A4: .4byte 0x02020630 +_081344A8: .4byte sub_81344AC + 1 + thumb_func_end sub_8134400 + + thumb_func_start sub_81344AC +sub_81344AC: @ 81344AC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081344C0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _081344C4 + str r0, [r1] + bx lr + .align 2, 0 +_081344C0: .4byte 0x03005e00 +_081344C4: .4byte sub_81341FC + 1 + thumb_func_end sub_81344AC + + thumb_func_start sub_81344C8 +sub_81344C8: @ 81344C8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x34 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_8133EDC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0xB + adds r1, r4, 0 + muls r1, r0 + mov r9, r1 + ldr r0, _081345E8 + add r9, r0 + ldr r0, _081345EC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + ldr r3, _081345F0 + lsls r5, 1 + adds r2, r5, r3 + mov r10, r2 + ldrb r0, [r2] + lsls r0, 8 + ldr r1, _081345F4 + ldr r2, [sp, 0x2C] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x2C] + adds r3, 0x1 + adds r5, r3 + ldrb r1, [r5] + lsls r1, 16 + ldr r0, _081345F8 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x2C] + add r0, sp, 0x2C + bl Window_AddFromTemplate + ldr r4, _081345FC + strh r0, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x7 + add r1, sp, 0xC + movs r2, 0x68 + bl sub_81DB35C + adds r2, r0, 0 + ldrb r0, [r4] + lsls r2, 24 + lsrs r2, 24 + ldr r1, _08134600 + mov r8, r1 + str r1, [sp] + movs r6, 0 + str r6, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r1, 0x7 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + mov r1, r9 + movs r2, 0x68 + bl sub_81DB35C + adds r2, r0, 0 + ldrb r0, [r4] + lsls r2, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x11 + bl box_print + ldrb r0, [r4] + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + mov r2, r10 + ldrb r1, [r2] + lsls r0, r1, 27 + movs r2, 0xFC + lsls r2, 24 + adds r0, r2 + adds r1, 0xD + lsls r1, 3 + adds r1, 0x4 + lsls r1, 24 + ldrb r4, [r5] + lsls r5, r4, 27 + lsrs r5, 24 + adds r4, 0x4 + lsls r4, 27 + lsrs r4, 24 + lsrs r1, 8 + orrs r1, r0 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + lsls r5, 8 + orrs r5, r4 + movs r0, 0x44 + adds r1, r5, 0 + bl lcd_io_set + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081345E8: .4byte 0x083185c8 +_081345EC: .4byte 0x085b1de4 +_081345F0: .4byte 0x085b1df2 +_081345F4: .4byte 0xffff00ff +_081345F8: .4byte 0xff00ffff +_081345FC: .4byte 0x030011f8 +_08134600: .4byte 0x085b1e0c + thumb_func_end sub_81344C8 + + thumb_func_start sub_8134604 +sub_8134604: @ 8134604 + push {r4,lr} + ldr r4, _0813463C + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0xFF + strh r0, [r4] + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813463C: .4byte 0x030011f8 + thumb_func_end sub_8134604 + + thumb_func_start sub_8134640 +sub_8134640: @ 8134640 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8134604 + ldr r1, _08134660 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08134664 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134660: .4byte 0x03005e00 +_08134664: .4byte sub_8134668 + 1 + thumb_func_end sub_8134640 + + thumb_func_start sub_8134668 +sub_8134668: @ 8134668 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08134688 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x8] + bl sub_81344C8 + ldr r0, _0813468C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134688: .4byte 0x03005e00 +_0813468C: .4byte sub_813425C + 1 + thumb_func_end sub_8134668 + + thumb_func_start sub_8134690 +sub_8134690: @ 8134690 + push {lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r1, [sp] + str r2, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + ldr r1, _081346D4 + str r1, [sp, 0xC] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_818D3E4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081346D8 + 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, 0x10 + pop {r1} + bx r1 + .align 2, 0 +_081346D4: .4byte 0x0000ffff +_081346D8: .4byte 0x02020630 + thumb_func_end sub_8134690 + + thumb_func_start sub_81346DC +sub_81346DC: @ 81346DC + push {r4,lr} + adds r4, r0, 0 + ldr r2, _08134734 + ldr r3, _08134738 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r1, 0x8 + ldrsh r0, [r0, r1] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x20] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r1, 0x8 + ldrsh r0, [r0, r1] + lsls r0, 1 + adds r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x22] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x4 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134734: .4byte 0x085b1e28 +_08134738: .4byte 0x03005e00 + thumb_func_end sub_81346DC + + thumb_func_start sub_813473C +sub_813473C: @ 813473C + push {lr} + adds r3, r0, 0 + ldr r2, _08134764 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r1, r0 + bne _08134768 + adds r0, r3, 0 + movs r1, 0x1 + bl obj_anim_image_start_if_different + b _08134770 + .align 2, 0 +_08134764: .4byte 0x03005e00 +_08134768: + adds r0, r3, 0 + movs r1, 0 + bl obj_anim_image_start_if_different +_08134770: + pop {r0} + bx r0 + thumb_func_end sub_813473C + + thumb_func_start sub_8134774 +sub_8134774: @ 8134774 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x78 + ble _08134786 + subs r0, r2, 0x4 + strh r0, [r1, 0x20] +_08134786: + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x77 + bgt _08134794 + adds r0, r2, 0x4 + strh r0, [r1, 0x20] +_08134794: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x40 + ble _081347A2 + subs r0, r2, 0x2 + strh r0, [r1, 0x22] +_081347A2: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x3F + bgt _081347B0 + adds r0, r2, 0x2 + strh r0, [r1, 0x22] +_081347B0: + pop {r0} + bx r0 + thumb_func_end sub_8134774 + + thumb_func_start sub_81347B4 +sub_81347B4: @ 81347B4 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81347B4 + + thumb_func_start sub_81347C8 +sub_81347C8: @ 81347C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + 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, _081348E8 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _081348EC + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0813486C: + 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 _0813486C + 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, _081348E8 + 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] + ldr r0, _081348F0 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _081348F4 + ldrh r0, [r0] + cmp r0, 0 + bne _081348FC + ldr r0, _081348F8 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + b _08134906 + .align 2, 0 +_081348E8: .4byte 0x040000d4 +_081348EC: .4byte 0x81000800 +_081348F0: .4byte 0x08dcc05c +_081348F4: .4byte 0x020375e0 +_081348F8: .4byte 0x08dcc01c +_081348FC: + ldr r0, _08134974 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply +_08134906: + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08134978 + movs r1, 0xC0 + movs r2, 0x8 + bl gpu_pal_apply + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0813497C + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r0, _08134980 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r1, 0x94 + lsls r1, 2 + movs r0, 0 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl sub_80A1A74 + bl gpu_pal_allocator_reset + ldr r0, _08134984 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08134988 + bl gpu_pal_obj_alloc_and_load_multiple + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08134974: .4byte 0x08dcc03c +_08134978: .4byte 0x085b21d4 +_0813497C: .4byte 0x085b21fc +_08134980: .4byte 0x085b21dc +_08134984: .4byte 0x085b2208 +_08134988: .4byte 0x085b2218 + thumb_func_end sub_81347C8 + + thumb_func_start sub_813498C +sub_813498C: @ 813498C + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _081349EC + bl SetVBlankCallback + ldr r0, _081349F0 + bl set_callback2 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_081349EC: .4byte sub_81347B4 + 1 +_081349F0: .4byte sub_8134C9C + 1 + thumb_func_end sub_813498C + + thumb_func_start sub_81349F4 +sub_81349F4: @ 81349F4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xC + bl sub_81347C8 + ldr r0, _08134B1C + ldr r1, _08134B20 + bl LZ77UnCompVram + ldr r0, _08134B24 + movs r1, 0 + bl AddTask + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r1, _08134B28 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + mov r8, r1 + movs r1, 0xA + strh r1, [r0, 0xC] + mov r2, r8 + strh r2, [r0, 0xE] + strh r2, [r0, 0x10] + strh r2, [r0, 0x12] + strh r2, [r0, 0x14] + strh r2, [r0, 0x8] + movs r1, 0x96 + lsls r1, 1 + strh r1, [r0, 0xA] + ldr r0, _08134B2C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08134B30 + mov r9, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + ldrb r2, [r1, 0x1] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + movs r2, 0x1 + mov r10, r2 + mov r2, r10 + orrs r0, r2 + strb r0, [r1, 0x1] + ldrb r2, [r1, 0x3] + movs r4, 0x3F + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x3] + ldr r0, _08134B34 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + ldrb r0, [r1, 0x1] + ands r5, r0 + mov r0, r10 + orrs r5, r0 + strb r5, [r1, 0x1] + ldrb r0, [r1, 0x3] + ands r4, r0 + movs r0, 0x2 + orrs r4, r0 + strb r4, [r1, 0x3] + ldr r0, _08134B38 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + movs r0, 0x2D + strh r0, [r1, 0x30] + ldr r0, _08134B3C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + movs r0, 0x5A + strh r0, [r1, 0x30] + bl sub_813498C + ldr r2, _08134B40 + movs r0, 0x1 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08134B1C: .4byte 0x08dcc648 +_08134B20: .4byte 0x06003800 +_08134B24: .4byte sub_8134CB8 + 1 +_08134B28: .4byte 0x03005e00 +_08134B2C: .4byte 0x085b2250 +_08134B30: .4byte 0x02020630 +_08134B34: .4byte 0x085b2268 +_08134B38: .4byte 0x085b22a0 +_08134B3C: .4byte 0x085b22b8 +_08134B40: .4byte 0x085efae0 + thumb_func_end sub_81349F4 + + thumb_func_start sub_8134B44 +sub_8134B44: @ 8134B44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + bl sub_81347C8 + ldr r0, _08134B8C + ldr r1, _08134B90 + bl LZ77UnCompVram + ldr r0, _08134B94 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + bl sub_8135130 + ldr r1, _08134B98 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08134B9C + movs r2, 0x2D + mov r10, r2 + movs r0, 0x5A + str r0, [sp, 0xC] + b _08134BA4 + .align 2, 0 +_08134B8C: .4byte 0x08dcc908 +_08134B90: .4byte 0x06003800 +_08134B94: .4byte sub_8134F10 + 1 +_08134B98: .4byte 0x03005e00 +_08134B9C: + movs r1, 0x5A + mov r10, r1 + movs r2, 0x87 + str r2, [sp, 0xC] +_08134BA4: + ldr r0, _08134C84 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r6, _08134C88 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r0, 0 + mov r9, r0 + strh r7, [r1, 0x2E] + ldrb r2, [r1, 0x1] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + movs r2, 0x1 + mov r8, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x1] + ldrb r2, [r1, 0x3] + movs r4, 0x3F + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x3] + ldr r0, _08134C8C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + strh r7, [r1, 0x2E] + ldrb r0, [r1, 0x1] + ands r5, r0 + mov r0, r8 + orrs r5, r0 + strb r5, [r1, 0x1] + ldrb r0, [r1, 0x3] + ands r4, r0 + movs r0, 0x2 + orrs r4, r0 + strb r4, [r1, 0x3] + ldr r0, _08134C90 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + strh r7, [r1, 0x2E] + mov r2, r10 + strh r2, [r1, 0x30] + ldr r0, _08134C94 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + strh r7, [r1, 0x2E] + mov r0, sp + ldrh r0, [r0, 0xC] + strh r0, [r1, 0x30] + bl sub_813498C + ldr r2, _08134C98 + movs r0, 0x1 + str r0, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08134C84: .4byte 0x085b2250 +_08134C88: .4byte 0x02020630 +_08134C8C: .4byte 0x085b2268 +_08134C90: .4byte 0x085b22a0 +_08134C94: .4byte 0x085b22b8 +_08134C98: .4byte 0x085efae8 + thumb_func_end sub_8134B44 + + thumb_func_start sub_8134C9C +sub_8134C9C: @ 8134C9C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8134C9C + + thumb_func_start sub_8134CB8 +sub_8134CB8: @ 8134CB8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08134CDC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134CD8 + ldr r0, _08134CE0 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _08134CE4 + str r0, [r1] +_08134CD8: + pop {r0} + bx r0 + .align 2, 0 +_08134CDC: .4byte 0x02037fd4 +_08134CE0: .4byte 0x03005e00 +_08134CE4: .4byte sub_8134CE8 + 1 + thumb_func_end sub_8134CB8 + + thumb_func_start sub_8134CE8 +sub_8134CE8: @ 8134CE8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08134D18 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + movs r1, 0x6 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + beq _08134D1C + ldrh r0, [r5, 0x8] + ldrb r1, [r5, 0x10] + ldrb r2, [r5, 0x14] + bl sub_8134FFC + strh r0, [r5, 0x8] + b _08134DBE + .align 2, 0 +_08134D18: .4byte 0x03005e00 +_08134D1C: + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + strh r0, [r5, 0x8] + movs r3, 0xC + ldrsh r0, [r5, r3] + movs r1, 0xC + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 1 + movs r1, 0xE + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + adds r4, r1 + strh r4, [r5, 0xA] + ldr r2, _08134D68 + ldrh r0, [r2, 0x2E] + movs r3, 0x1 + adds r1, r3, 0 + ands r1, r0 + cmp r1, 0 + beq _08134D70 + ldr r0, _08134D6C + str r0, [r5] + b _08134DBE + .align 2, 0 +_08134D68: .4byte 0x030022c0 +_08134D6C: .4byte sub_8134DC4 + 1 +_08134D70: + strh r1, [r5, 0x10] + ldrh r1, [r2, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08134D7E + strh r3, [r5, 0x10] +_08134D7E: + ldrh r1, [r2, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08134D8C + movs r0, 0x2 + strh r0, [r5, 0x10] +_08134D8C: + ldrh r1, [r5, 0x10] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08134DBC + ldrh r2, [r5, 0x14] + movs r3, 0x14 + ldrsh r0, [r5, r3] + cmp r0, 0xFE + bgt _08134DA4 + adds r0, r2, 0x1 + strh r0, [r5, 0x14] +_08134DA4: + ldrh r0, [r5, 0x8] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r5, 0x14] + bl sub_8134FFC + strh r0, [r5, 0x8] + ldrb r1, [r5, 0x10] + adds r0, r6, 0 + bl sub_813504C + b _08134DBE +_08134DBC: + strh r0, [r5, 0x14] +_08134DBE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8134CE8 + + thumb_func_start sub_8134DC4 +sub_8134DC4: @ 8134DC4 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x94 + lsls r5, 2 + movs r0, 0 + movs r1, 0 + adds r2, r5, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, _08134E20 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _08134E24 + adds r1, r5, 0 + movs r2, 0xD + movs r3, 0x1 + bl sub_81996C0 + ldr r1, _08134E28 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08134E2C + str r1, [r0] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08134E20: .4byte 0x085efac6 +_08134E24: .4byte 0x085b21f4 +_08134E28: .4byte 0x03005e00 +_08134E2C: .4byte c3_80BF560 + 1 + thumb_func_end sub_8134DC4 + + thumb_func_start c3_80BF560 +c3_80BF560: @ 8134E30 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08134E56 + cmp r1, 0 + bgt _08134E50 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08134E74 + b _08134E96 +_08134E50: + cmp r1, 0x1 + beq _08134E74 + b _08134E96 +_08134E56: + movs r0, 0x5 + bl audio_play + ldr r0, _08134E6C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08134E70 + b _08134E94 + .align 2, 0 +_08134E6C: .4byte 0x03005e00 +_08134E70: .4byte sub_8134EA4 + 1 +_08134E74: + movs r0, 0x5 + bl audio_play + movs r0, 0 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + bl Window_FillTileMap + ldr r0, _08134E9C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08134EA0 +_08134E94: + str r0, [r1] +_08134E96: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134E9C: .4byte 0x03005e00 +_08134EA0: .4byte sub_8134CE8 + 1 + thumb_func_end c3_80BF560 + + thumb_func_start sub_8134EA4 +sub_8134EA4: @ 8134EA4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08134EE0 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r2, 0xE + ldrsh r1, [r4, r2] + bl sub_802F5B4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08134EE4 + str r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134EE0: .4byte 0x03005e00 +_08134EE4: .4byte c2_080111BC + 1 + thumb_func_end sub_8134EA4 + + thumb_func_start c2_080111BC +c2_080111BC: @ 8134EE8 + push {lr} + ldr r0, _08134F08 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134F02 + bl Window_FreeMemory + ldr r0, _08134F0C + ldr r0, [r0, 0x8] + bl set_callback2 +_08134F02: + pop {r0} + bx r0 + .align 2, 0 +_08134F08: .4byte 0x02037fd4 +_08134F0C: .4byte 0x030022c0 + thumb_func_end c2_080111BC + + thumb_func_start sub_8134F10 +sub_8134F10: @ 8134F10 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08134F34 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134F30 + ldr r0, _08134F38 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _08134F3C + str r0, [r1] +_08134F30: + pop {r0} + bx r0 + .align 2, 0 +_08134F34: .4byte 0x02037fd4 +_08134F38: .4byte 0x03005e00 +_08134F3C: .4byte sub_8134F40 + 1 + thumb_func_end sub_8134F10 + + thumb_func_start sub_8134F40 +sub_8134F40: @ 8134F40 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8135130 + ldr r0, _08134F6C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08134F66 + ldr r0, _08134F70 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08134F74 + str r0, [r1] +_08134F66: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134F6C: .4byte 0x030022c0 +_08134F70: .4byte 0x03005e00 +_08134F74: .4byte sub_8134F78 + 1 + thumb_func_end sub_8134F40 + + thumb_func_start sub_8134F78 +sub_8134F78: @ 8134F78 + 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 sub_80A1AD4 + ldr r1, _08134FA8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08134FAC + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08134FA8: .4byte 0x03005e00 +_08134FAC: .4byte sub_8134FB0 + 1 + thumb_func_end sub_8134F78 + + thumb_func_start sub_8134FB0 +sub_8134FB0: @ 8134FB0 + push {lr} + ldr r0, _08134FCC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134FC6 + ldr r0, _08134FD0 + ldr r0, [r0, 0x8] + bl set_callback2 +_08134FC6: + pop {r0} + bx r0 + .align 2, 0 +_08134FCC: .4byte 0x02037fd4 +_08134FD0: .4byte 0x030022c0 + thumb_func_end sub_8134FB0 + + thumb_func_start sub_8134FD4 +sub_8134FD4: @ 8134FD4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x3C + bls _08134FE4 + movs r0, 0x6 + b _08134FF6 +_08134FE4: + cmp r0, 0x1E + bls _08134FEC + movs r0, 0x3 + b _08134FF6 +_08134FEC: + cmp r1, 0xA + bhi _08134FF4 + movs r0, 0x1 + b _08134FF6 +_08134FF4: + movs r0, 0x2 +_08134FF6: + pop {r1} + bx r1 + thumb_func_end sub_8134FD4 + + thumb_func_start sub_8134FFC +sub_8134FFC: @ 8134FFC + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + adds r0, r2, 0 + bl sub_8134FD4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r5, 0x1 + beq _0813501E + cmp r5, 0x2 + beq _08135030 + b _08135044 +_0813501E: + cmp r4, 0 + beq _08135026 + subs r0, r4, r1 + b _0813503C +_08135026: + movs r2, 0xB4 + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + b _0813503C +_08135030: + movs r0, 0xB4 + lsls r0, 1 + subs r0, r1 + cmp r4, r0 + bge _08135042 + adds r0, r4, r1 +_0813503C: + lsls r0, 16 + lsrs r4, r0, 16 + b _08135044 +_08135042: + movs r4, 0 +_08135044: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8134FFC + + thumb_func_start sub_813504C +sub_813504C: @ 813504C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r4, 0x1 + beq _08135060 + cmp r4, 0x2 + beq _081350A0 + b _081350DE +_08135060: + ldr r0, _0813507C + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xE] + movs r5, 0xE + ldrsh r0, [r1, r5] + cmp r0, 0 + ble _08135080 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _081350DE + .align 2, 0 +_0813507C: .4byte 0x03005e00 +_08135080: + movs r0, 0x3B + strh r0, [r1, 0xE] + ldrh r2, [r1, 0xC] + movs r6, 0xC + ldrsh r0, [r1, r6] + cmp r0, 0 + ble _08135092 + subs r0, r2, 0x1 + b _08135094 +_08135092: + movs r0, 0x17 +_08135094: + strh r0, [r1, 0xC] + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_81350E8 + b _081350DE +_081350A0: + ldr r0, _081350BC + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xE] + movs r5, 0xE + ldrsh r0, [r1, r5] + cmp r0, 0x3A + bgt _081350C0 + adds r0, r2, 0x1 + strh r0, [r1, 0xE] + b _081350DE + .align 2, 0 +_081350BC: .4byte 0x03005e00 +_081350C0: + movs r5, 0 + strh r5, [r1, 0xE] + ldrh r2, [r1, 0xC] + movs r6, 0xC + ldrsh r0, [r1, r6] + cmp r0, 0x16 + bgt _081350D4 + adds r0, r2, 0x1 + strh r0, [r1, 0xC] + b _081350D6 +_081350D4: + strh r5, [r1, 0xC] +_081350D6: + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_81350E8 +_081350DE: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_813504C + + thumb_func_start sub_81350E8 +sub_81350E8: @ 81350E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r2, _08135108 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0xC] + cmp r3, 0x1 + beq _0813510C + cmp r3, 0x2 + beq _0813511E + b _0813512A + .align 2, 0 +_08135108: .4byte 0x03005e00 +_0813510C: + cmp r0, 0xB + beq _08135116 + cmp r0, 0x17 + beq _0813511A + b _0813512A +_08135116: + movs r0, 0 + b _08135128 +_0813511A: + strh r3, [r1, 0x12] + b _0813512A +_0813511E: + cmp r0, 0 + beq _08135128 + cmp r0, 0xC + bne _0813512A + movs r0, 0x1 +_08135128: + strh r0, [r1, 0x12] +_0813512A: + pop {r0} + bx r0 + thumb_func_end sub_81350E8 + + thumb_func_start sub_8135130 +sub_8135130: @ 8135130 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_802F588 + ldr r1, _08135198 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r6, r0, r1 + ldr r5, _0813519C + movs r0, 0x2 + ldrsb r0, [r5, r0] + strh r0, [r6, 0xC] + movs r0, 0x3 + ldrsb r0, [r5, r0] + strh r0, [r6, 0xE] + movs r0, 0xE + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + strh r0, [r6, 0x8] + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r1, 0xC + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 1 + movs r1, 0xE + ldrsh r0, [r6, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + adds r4, r1 + strh r4, [r6, 0xA] + movs r0, 0x2 + ldrsb r0, [r5, r0] + cmp r0, 0xB + bgt _081351A0 + movs r0, 0 + b _081351A2 + .align 2, 0 +_08135198: .4byte 0x03005e00 +_0813519C: .4byte 0x03005cf8 +_081351A0: + movs r0, 0x1 +_081351A2: + strh r0, [r6, 0x12] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8135130 + + thumb_func_start sub_81351AC +sub_81351AC: @ 81351AC + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r2, _0813523C + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r4, [r0, 0x8] + adds r7, r4, 0 + adds r0, r4, 0 + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081351D4 + adds r0, 0xF +_081351D4: + lsls r0, 12 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081351E8 + adds r0, 0xF +_081351E8: + lsls r1, r0, 12 + lsrs r1, 16 + lsls r3, r5, 16 + lsrs r2, r3, 16 + negs r3, r3 + lsrs r3, 16 + str r1, [sp] + movs r0, 0 + bl rotscale_set_direct + ldr r1, _08135240 + lsls r2, r7, 1 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, 0x1 + adds r2, r1 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r2, r0, 16 + cmp r3, 0x80 + bls _08135224 + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r3, r0 +_08135224: + cmp r2, 0x80 + bls _08135230 + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r2, r0 +_08135230: + strh r3, [r6, 0x24] + strh r2, [r6, 0x26] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813523C: .4byte 0x03005e00 +_08135240: .4byte 0x085b22d0 + thumb_func_end sub_81351AC + + thumb_func_start sub_8135244 +sub_8135244: @ 8135244 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r2, _081352D4 + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r4, [r0, 0xA] + adds r7, r4, 0 + adds r0, r4, 0 + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0813526C + adds r0, 0xF +_0813526C: + lsls r0, 12 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08135280 + adds r0, 0xF +_08135280: + lsls r1, r0, 12 + lsrs r1, 16 + lsls r3, r5, 16 + lsrs r2, r3, 16 + negs r3, r3 + lsrs r3, 16 + str r1, [sp] + movs r0, 0x1 + bl rotscale_set_direct + ldr r1, _081352D8 + lsls r2, r7, 1 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, 0x1 + adds r2, r1 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r2, r0, 16 + cmp r3, 0x80 + bls _081352BC + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r3, r0 +_081352BC: + cmp r2, 0x80 + bls _081352C8 + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r2, r0 +_081352C8: + strh r3, [r6, 0x24] + strh r2, [r6, 0x26] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081352D4: .4byte 0x03005e00 +_081352D8: .4byte 0x085b22d0 + thumb_func_end sub_8135244 + + thumb_func_start sub_81352DC +sub_81352DC: @ 81352DC + push {r4,lr} + adds r4, r0, 0 + ldr r2, _08135318 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0813531C + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _08135308 + adds r0, r1, 0x5 + strh r0, [r4, 0x30] +_08135308: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + bgt _0813533C + adds r0, r1, 0x1 + b _0813533A + .align 2, 0 +_08135318: .4byte 0x03005e00 +_0813531C: + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x2E + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _0813532E + subs r0, r1, 0x5 + strh r0, [r4, 0x30] +_0813532E: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x4B + ble _0813533C + subs r0, r1, 0x1 +_0813533A: + strh r0, [r4, 0x30] +_0813533C: + ldrh r0, [r4, 0x30] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _08135354 + ldr r1, _0813537C + adds r0, r1 +_08135354: + asrs r0, 12 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + bl sine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _08135370 + ldr r2, _0813537C + adds r0, r2 +_08135370: + asrs r0, 12 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813537C: .4byte 0x00000fff + thumb_func_end sub_81352DC + + thumb_func_start sub_8135380 +sub_8135380: @ 8135380 + push {r4,lr} + adds r4, r0, 0 + ldr r2, _081353BC + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081353C0 + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x69 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _081353AC + adds r0, r1, 0x5 + strh r0, [r4, 0x30] +_081353AC: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x68 + bgt _081353E0 + adds r0, r1, 0x1 + b _081353DE + .align 2, 0 +_081353BC: .4byte 0x03005e00 +_081353C0: + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x5B + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _081353D2 + subs r0, r1, 0x5 + strh r0, [r4, 0x30] +_081353D2: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + ble _081353E0 + subs r0, r1, 0x1 +_081353DE: + strh r0, [r4, 0x30] +_081353E0: + ldrh r0, [r4, 0x30] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _081353F8 + ldr r1, _08135420 + adds r0, r1 +_081353F8: + asrs r0, 12 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + bl sine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _08135414 + ldr r2, _08135420 + adds r0, r2 +_08135414: + asrs r0, 12 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08135420: .4byte 0x00000fff + thumb_func_end sub_8135380 + + thumb_func_start npc_before_player_of_type +npc_before_player_of_type: @ 8135424 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, _08135464 + adds r1, r4, 0x2 + adds r0, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl player_get_height + strb r0, [r4, 0x4] + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + ldrb r2, [r4, 0x4] + bl npc_id_by_pos_and_height + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08135468 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r0, [r2, 0x5] + cmp r0, r5 + bne _08135470 + ldr r1, _0813546C + ldrb r0, [r2, 0x8] + strh r0, [r1] + movs r0, 0x1 + b _08135472 + .align 2, 0 +_08135464: .4byte 0x0203ab40 +_08135468: .4byte 0x02037350 +_0813546C: .4byte 0x020375f2 +_08135470: + movs r0, 0 +_08135472: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end npc_before_player_of_type + + thumb_func_start oei_task_add +oei_task_add: @ 8135478 + push {lr} + ldr r0, _08135494 + adds r1, r0, 0x2 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + ldr r0, _08135498 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08135494: .4byte 0x0203ab40 +_08135498: .4byte task08_080C9820 + 1 + thumb_func_end oei_task_add + + thumb_func_start task08_080C9820 +task08_080C9820: @ 813549C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl script_env_2_enable + ldr r1, _081354F0 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r1, [r1, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081354F4 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_is_visible_or_is_x40 + lsls r0, 24 + cmp r0, 0 + beq _081354D2 + adds r0, r4, 0 + bl sub_8093284 + lsls r0, 24 + cmp r0, 0 + beq _0813551E +_081354D2: + ldr r0, _081354F8 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _08135504 + movs r0, 0x3B + bl oe_exec + ldr r0, _081354FC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _08135500 + b _0813551C + .align 2, 0 +_081354F0: .4byte 0x02037590 +_081354F4: .4byte 0x02037350 +_081354F8: .4byte 0x02037318 +_081354FC: .4byte 0x03005e00 +_08135500: .4byte sub_8135578 + 1 +_08135504: + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl npc_set_state_2 + ldr r0, _08135524 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _08135528 +_0813551C: + str r0, [r1] +_0813551E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08135524: .4byte 0x03005e00 +_08135528: .4byte sub_813552C + 1 + thumb_func_end task08_080C9820 + + thumb_func_start sub_813552C +sub_813552C: @ 813552C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08135568 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0813556C + adds r0, r1 + bl npc_get_bit7_or_const_x10_when_inactive + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08135560 + movs r0, 0x3B + bl oe_exec + ldr r0, _08135570 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08135574 + str r0, [r1] +_08135560: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08135568: .4byte 0x02037590 +_0813556C: .4byte 0x02037350 +_08135570: .4byte 0x03005e00 +_08135574: .4byte sub_8135578 + 1 + thumb_func_end sub_813552C + + thumb_func_start sub_8135578 +sub_8135578: @ 8135578 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x6 + bl oe_active_list_contains + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081355FC + bl player_get_direction__sp1AA + ldr r6, _08135604 + lsls r0, 24 + lsrs r0, 24 + str r0, [r6, 0x4] + cmp r0, 0x1 + bne _0813559E + str r4, [r6, 0x8] +_0813559E: + ldr r1, [r6, 0x4] + cmp r1, 0x2 + bne _081355A8 + movs r0, 0x1 + str r0, [r6, 0x8] +_081355A8: + cmp r1, 0x3 + bne _081355B0 + movs r0, 0x2 + str r0, [r6, 0x8] +_081355B0: + cmp r1, 0x4 + bne _081355B8 + movs r0, 0x3 + str r0, [r6, 0x8] +_081355B8: + ldr r5, _08135608 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _0813560C + adds r4, r0 + bl sub_808BF6C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808E3F8 + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08135610 + adds r0, r1 + ldrb r1, [r6, 0x8] + bl obj_anim_image_start + movs r0, 0x6 + bl oe_active_list_remove + ldr r1, _08135614 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _08135618 + str r1, [r0] +_081355FC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08135604: .4byte 0x02038c08 +_08135608: .4byte 0x02037590 +_0813560C: .4byte 0x02037350 +_08135610: .4byte 0x02020630 +_08135614: .4byte 0x03005e00 +_08135618: .4byte sub_813561C + 1 + thumb_func_end sub_8135578 + + thumb_func_start sub_813561C +sub_813561C: @ 813561C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _0813564C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x18] + lsls r1, 16 + ldrh r0, [r0, 0x1A] + orrs r1, r0 + bl _call_via_r1 + ldr r1, _08135650 + movs r0, 0 + strb r0, [r1, 0x6] + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813564C: .4byte 0x03005e00 +_08135650: .4byte 0x02037590 + thumb_func_end sub_813561C + + thumb_func_start sub_8135654 +sub_8135654: @ 8135654 + push {r4,lr} + bl sub_81797DC + lsls r0, 24 + cmp r0, 0 + beq _0813568C + ldr r4, _08135678 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, _0813567C + ldr r0, _08135680 + str r0, [r1] + ldr r1, _08135684 + ldr r0, _08135688 + b _081356A8 + .align 2, 0 +_08135678: .4byte 0x020375f0 +_0813567C: .4byte 0x03005db0 +_08135680: .4byte hm_add_c3_launch_phase_2 + 1 +_08135684: .4byte 0x0203ceec +_08135688: .4byte sub_8179834 + 1 +_0813568C: + movs r0, 0x56 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813569E + movs r0, 0 + b _081356AC +_0813569E: + ldr r1, _081356B4 + ldr r0, _081356B8 + str r0, [r1] + ldr r1, _081356BC + ldr r0, _081356C0 +_081356A8: + str r0, [r1] + movs r0, 0x1 +_081356AC: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081356B4: .4byte 0x03005db0 +_081356B8: .4byte hm_add_c3_launch_phase_2 + 1 +_081356BC: .4byte 0x0203ceec +_081356C0: .4byte sub_81356C4 + 1 + thumb_func_end sub_8135654 + + thumb_func_start sub_81356C4 +sub_81356C4: @ 81356C4 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _081356DC + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, _081356E0 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_081356DC: .4byte 0x02038c08 +_081356E0: .4byte 0x082907f0 + thumb_func_end sub_81356C4 + + thumb_func_start oei_rocksmash +oei_rocksmash: @ 81356E4 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813570C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _08135710 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x13 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0813570C: .4byte 0x03005e00 +_08135710: .4byte sub_8135714 + 1 + thumb_func_end oei_rocksmash + + thumb_func_start sub_8135714 +sub_8135714: @ 8135714 + push {lr} + movs r0, 0x83 + bl audio_play + movs r0, 0x25 + bl oe_active_list_remove + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_8135714 + + thumb_func_start sub_813572C +sub_813572C: @ 813572C + push {lr} + bl sub_80FE314 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813573E + movs r0, 0 + b _0813574C +_0813573E: + ldr r1, _08135750 + ldr r0, _08135754 + str r0, [r1] + ldr r1, _08135758 + ldr r0, _0813575C + str r0, [r1] + movs r0, 0x1 +_0813574C: + pop {r1} + bx r1 + .align 2, 0 +_08135750: .4byte 0x03005db0 +_08135754: .4byte hm_add_c3_launch_phase_2 + 1 +_08135758: .4byte 0x0203ceec +_0813575C: .4byte hm2_dig + 1 + thumb_func_end sub_813572C + + thumb_func_start hm2_dig +hm2_dig: @ 8135760 + push {lr} + bl flagmods_08054D70 + movs r0, 0x26 + bl oe_exec + bl brm_get_pokemon_selection + ldr r1, _0813577C + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0813577C: .4byte 0x02038c08 + thumb_func_end hm2_dig + + thumb_func_start sub_8135780 +sub_8135780: @ 8135780 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081357B4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _081357B8 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + bl sub_81795E8 + lsls r0, 24 + cmp r0, 0 + bne _081357AC + movs r0, 0x1 + bl walkrun_set_bike_bits +_081357AC: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081357B4: .4byte 0x03005e00 +_081357B8: .4byte sub_81357BC + 1 + thumb_func_end sub_8135780 + + thumb_func_start sub_81357BC +sub_81357BC: @ 81357BC + push {r4,lr} + movs r0, 0x26 + bl oe_active_list_remove + bl sub_81795E8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _081357D6 + bl sub_817963C + b _081357EE +_081357D6: + ldr r0, _081357F4 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081357F8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] +_081357EE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081357F4: .4byte task08_080A1C44 + 1 +_081357F8: .4byte 0x03005e00 + thumb_func_end sub_81357BC + + thumb_func_start sub_81357FC +sub_81357FC: @ 81357FC + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0813584C + ldr r0, _08135850 + bl malloc + str r0, [r5] + ldr r2, _08135854 + adds r0, r2 + movs r3, 0 + strb r4, [r0] + ldr r0, [r5] + movs r4, 0x80 + lsls r4, 4 + adds r1, r0, r4 + str r3, [r1] + ldr r1, _08135858 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r5] + ldr r4, _0813585C + adds r0, r4 + strb r3, [r0] + ldr r0, _08135860 + str r6, [r0] + ldr r5, [r5] + adds r2, r5, r2 + ldrb r2, [r2] + cmp r2, 0x2 + beq _08135888 + cmp r2, 0x2 + bgt _08135864 + cmp r2, 0x1 + beq _0813586A + b _081358C0 + .align 2, 0 +_0813584C: .4byte 0x0203ab50 +_08135850: .4byte 0x00000e88 +_08135854: .4byte 0x00000809 +_08135858: .4byte 0x00000e7c +_0813585C: .4byte 0x00000e7d +_08135860: .4byte 0x0203ab48 +_08135864: + cmp r2, 0x3 + beq _081358A4 + b _081358C0 +_0813586A: + ldr r0, _0813587C + adds r1, r5, r0 + ldr r0, _08135880 + str r0, [r1] + ldr r4, _08135884 + adds r1, r5, r4 + movs r0, 0x2 + b _081358D2 + .align 2, 0 +_0813587C: .4byte 0x00000804 +_08135880: .4byte 0x085b269b +_08135884: .4byte 0x00000808 +_08135888: + ldr r1, _08135898 + adds r0, r5, r1 + ldr r1, _0813589C + str r1, [r0] + ldr r4, _081358A0 + adds r0, r5, r4 + strb r2, [r0] + b _081358D4 + .align 2, 0 +_08135898: .4byte 0x00000804 +_0813589C: .4byte 0x085b269d +_081358A0: .4byte 0x00000808 +_081358A4: + ldr r0, _081358B4 + adds r1, r5, r0 + ldr r0, _081358B8 + str r0, [r1] + ldr r4, _081358BC + adds r1, r5, r4 + movs r0, 0x2 + b _081358D2 + .align 2, 0 +_081358B4: .4byte 0x00000804 +_081358B8: .4byte 0x085b269f +_081358BC: .4byte 0x00000808 +_081358C0: + ldr r0, _081358E0 + ldr r1, [r0] + ldr r0, _081358E4 + adds r2, r1, r0 + ldr r0, _081358E8 + str r0, [r2] + ldr r4, _081358EC + adds r1, r4 + movs r0, 0x3 +_081358D2: + strb r0, [r1] +_081358D4: + ldr r0, _081358F0 + bl set_callback2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081358E0: .4byte 0x0203ab50 +_081358E4: .4byte 0x00000804 +_081358E8: .4byte 0x085b2698 +_081358EC: .4byte 0x00000808 +_081358F0: .4byte sub_813594C + 1 + thumb_func_end sub_81357FC + + thumb_func_start sub_81358F4 +sub_81358F4: @ 81358F4 + push {lr} + ldr r1, _08135904 + movs r0, 0x1 + bl sub_81357FC + pop {r0} + bx r0 + .align 2, 0 +_08135904: .4byte sub_8059D50 + 1 + thumb_func_end sub_81358F4 + + thumb_func_start sub_8135908 +sub_8135908: @ 8135908 + push {lr} + ldr r1, _08135918 + movs r0, 0x2 + bl sub_81357FC + pop {r0} + bx r0 + .align 2, 0 +_08135918: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_8135908 + + thumb_func_start sub_813591C +sub_813591C: @ 813591C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_813591C + + thumb_func_start sub_8135938 +sub_8135938: @ 8135938 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8135938 + + thumb_func_start sub_813594C +sub_813594C: @ 813594C + push {lr} +_0813594E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08135972 + bl sub_8135978 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08135972 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813594E +_08135972: + pop {r0} + bx r0 + thumb_func_end sub_813594C + + thumb_func_start sub_8135978 +sub_8135978: @ 8135978 + push {r4,lr} + sub sp, 0x4 + ldr r0, _08135998 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x12 + bls _0813598C + b _08135BB8 +_0813598C: + lsls r0, 2 + ldr r1, _0813599C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08135998: .4byte 0x030022c0 +_0813599C: .4byte _081359A0 + .align 2, 0 +_081359A0: + .4byte _081359EC + .4byte _081359F6 + .4byte _08135A08 + .4byte _08135A0E + .4byte _08135A30 + .4byte _08135A36 + .4byte _08135A54 + .4byte _08135A70 + .4byte _08135A8C + .4byte _08135A9A + .4byte _08135AC4 + .4byte _08135ADC + .4byte _08135AFC + .4byte _08135B02 + .4byte _08135B14 + .4byte _08135B1A + .4byte _08135B64 + .4byte _08135B6A + .4byte _08135B84 +_081359EC: + bl vblank_hblank_handler_set_zero + bl clear_scheduled_bg_copies_to_vram + b _08135B9E +_081359F6: + bl remove_some_task + ldr r1, _08135A04 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135A04: .4byte 0x030022c0 +_08135A08: + bl gpu_pal_allocator_reset + b _08135B9E +_08135A0E: + bl sub_80A1A74 + ldr r2, _08135A28 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, _08135A2C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135A28: .4byte 0x02037fd4 +_08135A2C: .4byte 0x030022c0 +_08135A30: + bl reset_all_obj_data + b _08135B9E +_08135A36: + ldr r0, _08135A4C + ldr r0, [r0] + ldr r1, _08135A50 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08135A46 + b _08135B9E +_08135A46: + bl clear_tasks + b _08135B9E + .align 2, 0 +_08135A4C: .4byte 0x0203ab50 +_08135A50: .4byte 0x00000809 +_08135A54: + bl sub_8135BDC + ldr r0, _08135A68 + ldr r0, [r0] + ldr r1, _08135A6C + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _08135B9E + .align 2, 0 +_08135A68: .4byte 0x0203ab50 +_08135A6C: .4byte 0x00000e7e +_08135A70: + bl sub_8135C38 + lsls r0, 24 + cmp r0, 0 + bne _08135A7C + b _08135BD0 +_08135A7C: + ldr r1, _08135A88 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135A88: .4byte 0x030022c0 +_08135A8C: + bl sub_813625C + bl sub_81362E0 + bl sub_8136344 + b _08135B9E +_08135A9A: + movs r0, 0x38 + movs r1, 0x40 + movs r2, 0 + bl sub_8136444 + ldr r1, _08135AB8 + ldr r1, [r1] + ldr r2, _08135ABC + adds r1, r2 + strb r0, [r1] + ldr r1, _08135AC0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135AB8: .4byte 0x0203ab50 +_08135ABC: .4byte 0x00000e74 +_08135AC0: .4byte 0x030022c0 +_08135AC4: + ldr r0, _08135AD4 + ldr r0, [r0] + ldr r1, _08135AD8 + adds r0, r1 + movs r1, 0x7 + bl sub_8122344 + b _08135B9E + .align 2, 0 +_08135AD4: .4byte 0x0203ab50 +_08135AD8: .4byte 0x00000e75 +_08135ADC: + ldr r0, _08135AF0 + ldrh r0, [r0, 0x4] + ldr r1, _08135AF4 + bl sub_8136110 + ldr r1, _08135AF8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135AF0: .4byte 0x0203ab48 +_08135AF4: .4byte 0x00001005 +_08135AF8: .4byte 0x030022c0 +_08135AFC: + bl sub_8135D24 + b _08135B9E +_08135B02: + bl sub_8135E2C + ldr r1, _08135B10 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135B10: .4byte 0x030022c0 +_08135B14: + bl sub_81363BC + b _08135B9E +_08135B1A: + ldr r0, _08135B50 + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08135B54 + ldr r2, _08135B58 + ldrh r1, [r2, 0x6] + ldrh r2, [r2, 0x4] + bl calls_per_item_funcs_in_list_outer + ldr r2, _08135B5C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r1, _08135B60 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135B50: .4byte sub_81365C8 + 1 +_08135B54: .4byte 0x03006310 +_08135B58: .4byte 0x0203ab48 +_08135B5C: .4byte 0x03005e00 +_08135B60: .4byte 0x030022c0 +_08135B64: + bl sub_8135DAC + b _08135B9E +_08135B6A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, _08135B80 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .align 2, 0 +_08135B80: .4byte 0x030022c0 +_08135B84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _08135BB0 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_08135B9E: + ldr r1, _08135BB4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_08135BA6: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08135BD0 + .align 2, 0 +_08135BB0: .4byte 0x02037fd4 +_08135BB4: .4byte 0x030022c0 +_08135BB8: + ldr r0, _08135BC8 + bl SetVBlankCallback + ldr r0, _08135BCC + bl set_callback2 + movs r0, 0x1 + b _08135BD2 + .align 2, 0 +_08135BC8: .4byte sub_8135938 + 1 +_08135BCC: .4byte sub_813591C + 1 +_08135BD0: + movs r0, 0 +_08135BD2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8135978 + + thumb_func_start sub_8135BDC +sub_8135BDC: @ 8135BDC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08135C30 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r0, _08135C34 + ldr r1, [r0] + movs r0, 0x2 + bl bg_set_tilemap + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08135C30: .4byte 0x085b2620 +_08135C34: .4byte 0x0203ab50 + thumb_func_end sub_8135BDC + + thumb_func_start sub_8135C38 +sub_8135C38: @ 8135C38 + push {r4,lr} + sub sp, 0x4 + ldr r0, _08135C58 + ldr r0, [r0] + ldr r1, _08135C5C + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bhi _08135D18 + lsls r0, 2 + ldr r1, _08135C60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08135C58: .4byte 0x0203ab50 +_08135C5C: .4byte 0x00000e7e +_08135C60: .4byte _08135C64 + .align 2, 0 +_08135C64: + .4byte _08135C7C + .4byte _08135C98 + .4byte _08135CBC + .4byte _08135CCC + .4byte _08135CD8 + .4byte _08135CFC +_08135C7C: + bl reset_temp_tile_data_buffers + ldr r1, _08135C94 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08135CDE + .align 2, 0 +_08135C94: .4byte 0x08d9b2b4 +_08135C98: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08135D18 + ldr r0, _08135CB4 + ldr r4, _08135CB8 + ldr r1, [r4] + bl call_LZZUnCompWram + ldr r1, [r4] + b _08135CE2 + .align 2, 0 +_08135CB4: .4byte 0x08d9b7c8 +_08135CB8: .4byte 0x0203ab50 +_08135CBC: + ldr r0, _08135CC8 + movs r1, 0 + movs r2, 0xC0 + bl decompress_palette + b _08135CDE + .align 2, 0 +_08135CC8: .4byte 0x08d9b470 +_08135CCC: + ldr r0, _08135CD4 + bl gpu_tile_obj_decompress_and_load + b _08135CDE + .align 2, 0 +_08135CD4: .4byte 0x085b26f4 +_08135CD8: + ldr r0, _08135CF0 + bl gpu_pal_obj_decompress_and_apply +_08135CDE: + ldr r0, _08135CF4 + ldr r1, [r0] +_08135CE2: + ldr r0, _08135CF8 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08135D18 + .align 2, 0 +_08135CF0: .4byte 0x085b26fc +_08135CF4: .4byte 0x0203ab50 +_08135CF8: .4byte 0x00000e7e +_08135CFC: + bl sub_8122328 + ldr r0, _08135D10 + ldr r0, [r0] + ldr r1, _08135D14 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _08135D1A + .align 2, 0 +_08135D10: .4byte 0x0203ab50 +_08135D14: .4byte 0x00000e7e +_08135D18: + movs r0, 0 +_08135D1A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8135C38 + + thumb_func_start sub_8135D24 +sub_8135D24: @ 8135D24 + push {r4,lr} + ldr r0, _08135D74 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + 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, _08135D78 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_08135D50: + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xA + bls _08135D50 + 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 + .align 2, 0 +_08135D74: .4byte 0x085b2748 +_08135D78: .4byte 0x0860f074 + thumb_func_end sub_8135D24 + + thumb_func_start sub_8135D7C +sub_8135D7C: @ 8135D7C + push {r4,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + ldr r3, _08135DA8 + str r3, [sp, 0x8] + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl sub_8199EEC + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08135DA8: .4byte 0x085b271c + thumb_func_end sub_8135D7C + + thumb_func_start sub_8135DAC +sub_8135DAC: @ 8135DAC + push {r4,lr} + ldr r0, _08135E14 + bl itemid_get_item + adds r4, r0, 0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x48 + bl sub_81DB35C + adds r2, r0, 0 + movs r0, 0 + adds r1, r4, 0 + bl sub_8135D7C + ldr r1, _08135E18 + movs r0, 0x2 + movs r2, 0 + bl sub_8135D7C + ldr r1, _08135E1C + movs r0, 0x3 + movs r2, 0 + bl sub_8135D7C + ldr r1, _08135E20 + movs r0, 0x4 + movs r2, 0 + bl sub_8135D7C + ldr r1, _08135E24 + movs r0, 0x5 + movs r2, 0 + bl sub_8135D7C + ldr r1, _08135E28 + movs r0, 0x6 + movs r2, 0 + bl sub_8135D7C + movs r4, 0 +_08135DFE: + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08135DFE + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08135E14: .4byte 0x00000111 +_08135E18: .4byte 0x085e931d +_08135E1C: .4byte 0x085e9323 +_08135E20: .4byte 0x085e9327 +_08135E24: .4byte 0x085e932d +_08135E28: .4byte 0x085e9334 + thumb_func_end sub_8135DAC + + thumb_func_start sub_8135E2C +sub_8135E2C: @ 8135E2C + push {r4-r7,lr} + movs r6, 0 + ldr r1, _08135EE4 + ldr r0, [r1] + ldr r2, _08135EE8 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _08135E7C + adds r5, r1, 0 +_08135E42: + lsls r4, r6, 5 + ldr r3, _08135EEC + adds r4, r3 + ldr r0, [r5] + adds r0, r4 + adds r1, r6, 0 + bl sub_8135F04 + ldr r1, [r5] + lsls r2, r6, 3 + ldr r7, _08135EF0 + adds r0, r1, r7 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + movs r3, 0x81 + lsls r3, 4 + adds r0, r1, r3 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, _08135EE8 + adds r1, r4 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _08135E42 +_08135E7C: + ldr r5, _08135EE4 + lsls r4, r6, 5 + ldr r7, _08135EEC + adds r4, r7 + ldr r0, [r5] + adds r0, r4 + ldr r1, _08135EF4 + bl gf_strcpy + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, _08135EF0 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + movs r0, 0x81 + lsls r0, 4 + adds r1, r0 + adds r1, r2 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + ldr r2, _08135EF8 + adds r1, r2, 0 + ldr r0, _08135EFC + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldrb r1, [r2, 0x17] + movs r0, 0x40 + negs r0, r0 + ands r0, r1 + movs r1, 0x7 + orrs r0, r1 + strb r0, [r2, 0x17] + ldr r1, [r5] + ldr r4, _08135EE8 + adds r0, r1, r4 + ldrb r0, [r0] + strh r0, [r2, 0xC] + adds r3, r1, r3 + str r3, [r2] + ldr r6, _08135F00 + adds r1, r6 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08135EE4: .4byte 0x0203ab50 +_08135EE8: .4byte 0x0000080a +_08135EEC: .4byte 0x00000954 +_08135EF0: .4byte 0x0000080c +_08135EF4: .4byte 0x085e9344 +_08135EF8: .4byte 0x03006310 +_08135EFC: .4byte 0x085b27b0 +_08135F00: .4byte 0x0000080b + thumb_func_end sub_8135E2C + + thumb_func_start sub_8135F04 +sub_8135F04: @ 8135F04 + push {r4-r6,lr} + lsls r1, 16 + ldr r2, _08135F5C + lsrs r1, 13 + ldr r3, _08135F60 + adds r1, r3 + ldr r5, [r2] + adds r5, r1 + ldr r2, _08135F64 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + adds r4, r0, 0 + movs r0, 0xFC + strb r0, [r4] + adds r4, 0x1 + movs r0, 0x12 + strb r0, [r4] + adds r4, 0x1 + movs r0, 0x57 + strb r0, [r4] + adds r4, 0x1 + ldr r6, _08135F68 + adds r0, r5, 0 + bl sub_8136EA4 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r1, _08135F6C + adds r0, r4, 0 + bl ExpandTextCodes + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08135F5C: .4byte 0x03005d8c +_08135F60: .4byte 0x00000848 +_08135F64: .4byte 0x085b262c +_08135F68: .4byte 0x02021cc4 +_08135F6C: .4byte 0x085e934f + thumb_func_end sub_8135F04 + + thumb_func_start sub_8135F70 +sub_8135F70: @ 8135F70 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _08135F9C + movs r0, 0x5 + bl audio_play + ldr r2, _08135FB8 + ldr r0, _08135FBC + ldr r0, [r0] + ldr r1, _08135FC0 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _08135FC4 + str r1, [r0] +_08135F9C: + ldr r0, _08135FBC + ldr r0, [r0] + ldr r1, _08135FC8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08135FB0 + adds r0, r4, 0 + bl sub_8135FCC +_08135FB0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08135FB8: .4byte 0x02020630 +_08135FBC: .4byte 0x0203ab50 +_08135FC0: .4byte 0x00000e74 +_08135FC4: .4byte sub_8136470 + 1 +_08135FC8: .4byte 0x00000e7d + thumb_func_end sub_8135F70 + + thumb_func_start sub_8135FCC +sub_8135FCC: @ 8135FCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x7 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081360A0 + ldr r1, _08136024 + lsls r0, r4, 3 + ldr r2, _08136028 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + add r1, sp, 0x8 + movs r0, 0x17 + strh r0, [r1] + movs r0, 0x18 + strh r0, [r1, 0x2] + movs r5, 0 + adds r6, r1, 0 +_08136002: + adds r4, r5, 0x1 + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_8136F9C + lsls r0, 16 + adds r7, r4, 0 + cmp r0, 0 + ble _0813602C + lsls r1, r5, 12 + adds r0, r1, 0 + adds r0, 0x17 + strh r0, [r6] + adds r1, 0x18 + strh r1, [r6, 0x2] + b _08136032 + .align 2, 0 +_08136024: .4byte 0x03005d8c +_08136028: .4byte 0x00000848 +_0813602C: + movs r0, 0xF + strh r0, [r6] + strh r0, [r6, 0x2] +_08136032: + adds r0, r5, 0 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 1 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl __umodsi3 + adds r3, r0, 0 + lsls r3, 25 + movs r0, 0xD0 + lsls r0, 20 + adds r3, r0 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + add r1, sp, 0x8 + adds r2, r4, 0 + bl gpu_copy_to_iwram_tile_map_rect + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08136002 + ldr r4, _0813609C + mov r0, r8 + bl sub_8136EDC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x4 + bl sub_8135D7C + b _081360F8 + .align 2, 0 +_0813609C: .4byte 0x02021cc4 +_081360A0: + add r0, sp, 0x8 + movs r1, 0xF + strh r1, [r0] + strh r1, [r0, 0x2] + movs r5, 0 +_081360AA: + adds r0, r5, 0 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 1 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl __umodsi3 + adds r3, r0, 0 + lsls r3, 25 + movs r2, 0xD0 + lsls r2, 20 + adds r3, r2 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + add r1, sp, 0x8 + adds r2, r4, 0 + bl gpu_copy_to_iwram_tile_map_rect + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _081360AA + movs r0, 0x7 + movs r1, 0x2 + bl Window_CopyToVram +_081360F8: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8135FCC + + thumb_func_start sub_8136110 +sub_8136110: @ 8136110 + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r3, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, 15 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0xE + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r2, 0xF + bl bg_fill_tilemap_rect + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_8136110 + + thumb_func_start sub_8136140 +sub_8136140: @ 8136140 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r2, 0 +_0813614A: + adds r1, r2, 0x1 + lsls r0, r1, 16 + lsrs r6, r0, 16 + mov r12, r1 + cmp r6, 0x27 + bhi _08136192 + ldr r0, _081361A8 + mov r9, r0 + lsls r7, r2, 3 + ldr r1, _081361AC + mov r8, r1 +_08136160: + mov r0, r9 + ldr r2, [r0] + adds r0, r2, r7 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + bne _08136188 + ldr r1, _081361AC + adds r2, r1 + adds r3, r2, r7 + ldr r4, [r3] + ldr r5, [r3, 0x4] + lsls r0, r6, 3 + adds r2, r0 + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [r3] + str r1, [r3, 0x4] + str r4, [r2] + str r5, [r2, 0x4] +_08136188: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x27 + bls _08136160 +_08136192: + mov r1, r12 + lsls r0, r1, 16 + lsrs r2, r0, 16 + cmp r2, 0x26 + bls _0813614A + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081361A8: .4byte 0x03005d8c +_081361AC: .4byte 0x00000848 + thumb_func_end sub_8136140 + + thumb_func_start sub_81361B0 +sub_81361B0: @ 81361B0 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08136204 + ldr r0, [r0] + ldr r1, _08136208 + adds r6, r0, r1 + cmp r4, r5 + beq _08136246 + movs r0, 0x8 + bl malloc + adds r7, r0, 0 + lsls r0, r4, 3 + adds r0, r6 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r7] + str r1, [r7, 0x4] + cmp r5, r4 + bls _0813620C + subs r5, 0x1 + lsls r3, r4, 16 + lsls r0, r5, 16 + asrs r1, r0, 16 + cmp r3, r0 + bge _08136234 + adds r4, r1, 0 +_081361E8: + asrs r3, 16 + lsls r2, r3, 3 + adds r2, r6 + ldr r0, [r2, 0x8] + ldr r1, [r2, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + adds r3, 0x1 + lsls r3, 16 + asrs r0, r3, 16 + cmp r0, r4 + blt _081361E8 + b _08136234 + .align 2, 0 +_08136204: .4byte 0x03005d8c +_08136208: .4byte 0x00000848 +_0813620C: + lsls r3, r4, 16 + lsls r0, r5, 16 + asrs r1, r0, 16 + cmp r3, r0 + ble _08136234 + adds r4, r1, 0 +_08136218: + asrs r3, 16 + lsls r2, r3, 3 + adds r2, r6 + adds r0, r2, 0 + subs r0, 0x8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + subs r3, 0x1 + lsls r3, 16 + asrs r0, r3, 16 + cmp r0, r4 + bgt _08136218 +_08136234: + lsls r2, r5, 3 + adds r2, r6 + ldr r0, [r7] + ldr r1, [r7, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + adds r0, r7, 0 + bl free +_08136246: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81361B0 + + thumb_func_start sub_813624C +sub_813624C: @ 813624C + ldr r1, _08136258 + movs r0, 0 + strh r0, [r1, 0x4] + strh r0, [r1, 0x6] + bx lr + .align 2, 0 +_08136258: .4byte 0x0203ab48 + thumb_func_end sub_813624C + + thumb_func_start sub_813625C +sub_813625C: @ 813625C + push {r4,r5,lr} + bl sub_8136140 + ldr r0, _081362BC + ldr r0, [r0] + ldr r1, _081362C0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r2, 0 + ldr r5, _081362C4 + ldr r4, _081362C8 +_08136274: + ldr r0, [r5] + lsls r1, r2, 3 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + ldr r3, _081362BC + cmp r0, 0 + beq _08136290 + ldr r1, [r3] + ldr r0, _081362C0 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08136290: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x27 + bls _08136274 + ldr r0, [r3] + ldr r2, _081362C0 + adds r0, r2 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + adds r2, r0, r2 + ldrb r2, [r2] + cmp r2, 0x9 + bls _081362D0 + ldr r2, _081362CC + adds r1, r0, r2 + movs r0, 0x9 + strb r0, [r1] + b _081362D6 + .align 2, 0 +_081362BC: .4byte 0x0203ab50 +_081362C0: .4byte 0x0000080a +_081362C4: .4byte 0x03005d8c +_081362C8: .4byte 0x00000848 +_081362CC: .4byte 0x0000080b +_081362D0: + ldr r1, _081362DC + adds r0, r1 + strb r2, [r0] +_081362D6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081362DC: .4byte 0x0000080b + thumb_func_end sub_813625C + + thumb_func_start sub_81362E0 +sub_81362E0: @ 81362E0 + push {r4,r5,lr} + ldr r0, _08136328 + ldrh r1, [r0, 0x6] + adds r3, r0, 0 + ldr r4, _0813632C + cmp r1, 0 + beq _08136308 + ldrh r0, [r3, 0x6] + ldr r1, [r4] + ldr r5, _08136330 + adds r2, r1, r5 + ldrb r2, [r2] + adds r0, r2 + subs r5, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + ble _08136308 + subs r0, r1, r2 + strh r0, [r3, 0x6] +_08136308: + adds r2, r3, 0 + ldrh r1, [r2, 0x6] + ldrh r0, [r2, 0x4] + adds r1, r0 + ldr r0, [r4] + ldr r4, _08136334 + adds r0, r4 + ldrb r0, [r0] + cmp r1, r0 + blt _0813633C + adds r1, r0, 0 + cmp r1, 0 + bne _08136338 + strh r1, [r2, 0x4] + b _0813633C + .align 2, 0 +_08136328: .4byte 0x0203ab48 +_0813632C: .4byte 0x0203ab50 +_08136330: .4byte 0x0000080b +_08136334: .4byte 0x0000080a +_08136338: + subs r0, 0x1 + strh r0, [r3, 0x4] +_0813633C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81362E0 + + thumb_func_start sub_8136344 +sub_8136344: @ 8136344 + push {r4-r7,lr} + ldr r0, _081363AC + ldrh r1, [r0, 0x4] + adds r5, r0, 0 + cmp r1, 0x4 + bls _081363A4 + movs r4, 0 + ldrh r0, [r5, 0x4] + subs r0, 0x4 + cmp r4, r0 + bge _081363A4 + ldrh r2, [r5, 0x6] + ldr r6, _081363B0 + ldr r0, [r6] + ldr r3, _081363B4 + adds r1, r0, r3 + ldrb r1, [r1] + adds r2, r1 + ldr r7, _081363B8 + adds r0, r7 + ldrb r0, [r0] + cmp r2, r0 + beq _081363A4 + adds r3, r5, 0 +_08136374: + ldrh r0, [r3, 0x4] + subs r0, 0x1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x6] + adds r0, 0x1 + strh r0, [r3, 0x6] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r3, 0x4] + subs r0, 0x4 + cmp r4, r0 + bge _081363A4 + ldrh r2, [r5, 0x6] + ldr r1, [r6] + ldr r7, _081363B4 + adds r0, r1, r7 + ldrb r0, [r0] + adds r2, r0 + ldr r0, _081363B8 + adds r1, r0 + ldrb r1, [r1] + cmp r2, r1 + bne _08136374 +_081363A4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081363AC: .4byte 0x0203ab48 +_081363B0: .4byte 0x0203ab50 +_081363B4: .4byte 0x0000080b +_081363B8: .4byte 0x0000080a + thumb_func_end sub_8136344 + + thumb_func_start sub_81363BC +sub_81363BC: @ 81363BC + push {r4,lr} + sub sp, 0x10 + ldr r4, _08136404 + ldr r1, [r4] + ldr r2, _08136408 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081363FC + ldr r2, _0813640C + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + subs r0, r1 + str r0, [sp] + ldr r0, _08136410 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, _08136414 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xB0 + movs r2, 0x8 + movs r3, 0x98 + bl sub_81AF4A0 + ldr r1, [r4] + ldr r2, _08136408 + adds r1, r2 + strb r0, [r1] +_081363FC: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08136404: .4byte 0x0203ab50 +_08136408: .4byte 0x00000e7c +_0813640C: .4byte 0x0000080a +_08136410: .4byte 0x00000456 +_08136414: .4byte 0x0203ab4e + thumb_func_end sub_81363BC + + thumb_func_start sub_8136418 +sub_8136418: @ 8136418 + push {r4,lr} + ldr r4, _0813643C + ldr r0, [r4] + ldr r2, _08136440 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08136436 + bl sub_81AF620 + ldr r0, [r4] + ldr r1, _08136440 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08136436: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813643C: .4byte 0x0203ab50 +_08136440: .4byte 0x00000e7c + thumb_func_end sub_8136418 + + thumb_func_start sub_8136444 +sub_8136444: @ 8136444 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _0813646C + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0813646C: .4byte 0x085b2704 + thumb_func_end sub_8136444 + + thumb_func_start sub_8136470 +sub_8136470: @ 8136470 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + ble _08136480 + movs r0, 0 + strh r0, [r4, 0x2E] +_08136480: + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _0813648E + cmp r5, 0x1 + beq _081364B4 + b _081364E0 +_0813648E: + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _081364B0 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + movs r0, 0x1 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x30] + b _081364E0 + .align 2, 0 +_081364B0: .4byte 0x085b26f0 +_081364B4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _081364E0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + strh r2, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r0, _081364E8 + str r0, [r4, 0x1C] +_081364E0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081364E8: .4byte nullsub_12 + 1 + thumb_func_end sub_8136470 + + thumb_func_start sub_81364EC +sub_81364EC: @ 81364EC + 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 sub_80A1AD4 + ldr r1, _0813651C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08136520 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813651C: .4byte 0x03005e00 +_08136520: .4byte sub_8136524 + 1 + thumb_func_end sub_81364EC + + thumb_func_start sub_8136524 +sub_8136524: @ 8136524 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08136588 + adds r2, r0, r1 + ldr r0, _0813658C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081365BE + ldr r6, _08136590 + ldr r0, [r6] + ldr r1, _08136594 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0813655A + ldr r1, _08136598 + ldr r0, _0813659C + str r0, [r1] +_0813655A: + ldrb r0, [r2] + ldr r4, _081365A0 + subs r2, r4, 0x2 + adds r1, r4, 0 + bl sub_81AE6C8 + bl sub_8136418 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _081365A4 + bl set_callback2 + b _081365AC + .align 2, 0 +_08136588: .4byte 0x03005e08 +_0813658C: .4byte 0x02037fd4 +_08136590: .4byte 0x0203ab50 +_08136594: .4byte 0x00000809 +_08136598: .4byte 0x03005dac +_0813659C: .4byte sub_80AF168 + 1 +_081365A0: .4byte 0x0203ab4e +_081365A4: + subs r0, r4, 0x6 + ldr r0, [r0] + bl set_callback2 +_081365AC: + bl Window_FreeMemory + ldr r0, _081365C4 + ldr r0, [r0] + bl free + adds r0, r5, 0 + bl remove_task +_081365BE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081365C4: .4byte 0x0203ab50 + thumb_func_end sub_8136524 + + thumb_func_start sub_81365C8 +sub_81365C8: @ 81365C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + mov r8, r0 + ldr r0, _08136664 + mov r10, r0 + mov r6, r8 + add r6, r10 + ldr r0, _08136668 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081365F4 + b _08136708 +_081365F4: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08136602 + b _08136708 +_08136602: + ldr r0, _0813666C + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0 + beq _08136688 + ldrb r0, [r6] + ldr r4, _08136670 + subs r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + subs r4, 0x6 + ldrh r1, [r4, 0x6] + ldrh r0, [r4, 0x4] + adds r1, r0 + ldr r5, _08136674 + ldr r0, [r5] + ldr r2, _08136678 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08136708 + movs r0, 0x5 + bl audio_play + ldrh r0, [r4, 0x4] + ldr r1, _0813667C + bl sub_8136110 + ldrh r0, [r4, 0x4] + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x4] + ldr r0, [r5] + ldr r1, _08136680 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + mov r0, r10 + subs r0, 0x8 + add r0, r8 + ldr r1, _08136684 + str r1, [r0] + b _08136708 + .align 2, 0 +_08136664: .4byte 0x03005e08 +_08136668: .4byte 0x02037fd4 +_0813666C: .4byte 0x030022c0 +_08136670: .4byte 0x0203ab4e +_08136674: .4byte 0x0203ab50 +_08136678: .4byte 0x0000080a +_0813667C: .4byte 0x00002005 +_08136680: .4byte 0x00000e7d +_08136684: .4byte sub_813671C + 1 +_08136688: + ldr r5, _081366C8 + ldrh r2, [r5, 0x4] + mov r8, r2 + ldrb r0, [r6] + bl sub_81AE604 + adds r4, r0, 0 + ldrb r0, [r6] + adds r1, r5, 0x6 + adds r2, r5, 0x4 + bl get_coro_args_x18_x1A + ldrh r0, [r5, 0x4] + cmp r8, r0 + beq _081366B6 + mov r0, r8 + movs r1, 0x5 + bl sub_8136110 + ldrh r0, [r5, 0x4] + ldr r1, _081366CC + bl sub_8136110 +_081366B6: + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081366D0 + adds r0, 0x1 + cmp r4, r0 + bne _081366F8 + b _08136708 + .align 2, 0 +_081366C8: .4byte 0x0203ab48 +_081366CC: .4byte 0x00001005 +_081366D0: + movs r0, 0x5 + bl audio_play + ldr r0, _081366EC + ldr r2, _081366F0 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _081366F4 + mov r1, r9 + strh r1, [r0] + adds r0, r7, 0 + bl sub_81364EC + b _08136708 + .align 2, 0 +_081366EC: .4byte 0x020375f0 +_081366F0: .4byte 0x0000ffff +_081366F4: .4byte 0x0203ce7c +_081366F8: + movs r0, 0x5 + bl audio_play + ldr r0, _08136718 + strh r4, [r0] + adds r0, r7, 0 + bl sub_8136938 +_08136708: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08136718: .4byte 0x0203ce7c + thumb_func_end sub_81365C8 + + thumb_func_start sub_813671C +sub_813671C: @ 813671C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _08136760 + adds r7, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08136742 + b _08136848 +_08136742: + ldr r0, _08136764 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0813676C + movs r0, 0x5 + bl audio_play + ldrb r0, [r7] + ldr r1, _08136768 + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _08136822 + .align 2, 0 +_08136760: .4byte 0x03005e08 +_08136764: .4byte 0x030022c0 +_08136768: .4byte 0x0203ab4e +_0813676C: + ldr r6, _081367B0 + ldrh r4, [r6, 0x6] + ldrh r5, [r6, 0x4] + ldrb r0, [r7] + bl sub_81AE604 + mov r9, r0 + ldrb r0, [r7] + adds r1, r6, 0x6 + adds r2, r6, 0x4 + bl get_coro_args_x18_x1A + ldrh r0, [r6, 0x6] + cmp r4, r0 + bne _08136790 + ldrh r6, [r6, 0x4] + cmp r5, r6 + beq _081367CA +_08136790: + movs r4, 0 +_08136792: + ldr r0, _081367B0 + ldrh r0, [r0, 0x6] + adds r0, r4, r0 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x4 + ldrsh r0, [r7, r1] + cmp r5, r0 + bne _081367B8 + adds r0, r4, 0 + ldr r1, _081367B4 + bl sub_8136110 + b _081367C0 + .align 2, 0 +_081367B0: .4byte 0x0203ab48 +_081367B4: .4byte 0x00002005 +_081367B8: + adds r0, r4, 0 + movs r1, 0x5 + bl sub_8136110 +_081367C0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x8 + bls _08136792 +_081367CA: + ldr r5, _08136804 + ldr r0, [r5] + ldr r4, _08136808 + adds r0, r4 + movs r1, 0x7 + movs r2, 0 + bl sub_81223FC + ldr r0, [r5] + adds r0, r4 + ldr r1, _0813680C + ldrh r3, [r1, 0x4] + lsls r3, 4 + adds r3, 0x8 + lsls r3, 16 + lsrs r3, 16 + movs r1, 0x7 + movs r2, 0x80 + bl sub_8122448 + movs r0, 0x2 + negs r0, r0 + cmp r9, r0 + beq _08136810 + adds r0, 0x1 + cmp r9, r0 + bne _0813683A + b _08136848 + .align 2, 0 +_08136804: .4byte 0x0203ab50 +_08136808: .4byte 0x00000e75 +_0813680C: .4byte 0x0203ab48 +_08136810: + movs r0, 0x5 + bl audio_play + ldr r0, _0813682C + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08136830 +_08136822: + mov r0, r8 + movs r1, 0 + bl sub_8136854 + b _08136848 + .align 2, 0 +_0813682C: .4byte 0x030022c0 +_08136830: + mov r0, r8 + movs r1, 0x1 + bl sub_8136854 + b _08136848 +_0813683A: + movs r0, 0x5 + bl audio_play + mov r0, r8 + movs r1, 0 + bl sub_8136854 +_08136848: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_813671C + + thumb_func_start sub_8136854 +sub_8136854: @ 8136854 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _08136914 + adds r6, r0, r1 + ldr r2, _08136918 + ldrh r0, [r2, 0x4] + ldrh r1, [r2, 0x6] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0813691C + ldr r0, [r0] + ldr r1, _08136920 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldrb r0, [r6] + adds r1, r2, 0x6 + adds r2, 0x4 + bl sub_81AE6C8 + cmp r4, 0 + bne _081368AA + movs r0, 0x4 + ldrsh r1, [r6, r0] + cmp r1, r5 + beq _081368BA + subs r0, r5, 0x1 + cmp r1, r0 + beq _081368AA + adds r0, r1, 0 + adds r1, r5, 0 + bl sub_81361B0 + bl sub_8135E2C +_081368AA: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, r5 + bge _081368BA + ldr r1, _08136918 + ldrh r0, [r1, 0x4] + subs r0, 0x1 + strh r0, [r1, 0x4] +_081368BA: + ldr r0, _08136924 + ldr r2, _08136918 + ldrh r1, [r2, 0x6] + ldrh r2, [r2, 0x4] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _0813691C + ldr r0, [r0] + ldr r1, _08136928 + adds r0, r1 + movs r1, 0x7 + movs r2, 0x1 + bl sub_81223FC + movs r4, 0 + lsls r5, r7, 2 +_081368E6: + adds r0, r4, 0 + movs r1, 0x5 + bl sub_8136110 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _081368E6 + ldr r0, _08136918 + ldrh r0, [r0, 0x4] + ldr r1, _0813692C + bl sub_8136110 + ldr r1, _08136930 + adds r0, r5, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _08136934 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08136914: .4byte 0x03005e08 +_08136918: .4byte 0x0203ab48 +_0813691C: .4byte 0x0203ab50 +_08136920: .4byte 0x00000e7d +_08136924: .4byte 0x03006310 +_08136928: .4byte 0x00000e75 +_0813692C: .4byte 0x00001005 +_08136930: .4byte 0x03005e00 +_08136934: .4byte sub_81365C8 + 1 + thumb_func_end sub_8136854 + + thumb_func_start sub_8136938 +sub_8136938: @ 8136938 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0813695C + adds r6, r0, r1 + ldr r0, _08136960 + ldr r0, [r0] + ldr r1, _08136964 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08136968 + movs r0, 0x8 + b _0813696A + .align 2, 0 +_0813695C: .4byte 0x03005e08 +_08136960: .4byte 0x0203ab50 +_08136964: .4byte 0x00000808 +_08136968: + movs r0, 0x9 +_0813696A: + strh r0, [r6, 0x2] + bl sub_8136418 + ldrb r0, [r6, 0x2] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + ldrb r0, [r6, 0x2] + ldr r5, _081369C8 + ldr r3, [r5] + ldr r4, _081369CC + adds r1, r3, r4 + ldrb r1, [r1] + ldr r2, _081369D0 + mov r12, r2 + ldr r2, _081369D4 + adds r3, r2 + ldr r3, [r3] + mov r2, r12 + bl sub_81995E4 + ldrb r0, [r6, 0x2] + ldr r1, [r5] + adds r1, r4 + ldrb r1, [r1] + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldrb r0, [r6, 0x2] + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081369D8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081369DC + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081369C8: .4byte 0x0203ab50 +_081369CC: .4byte 0x00000808 +_081369D0: .4byte 0x085b2668 +_081369D4: .4byte 0x00000804 +_081369D8: .4byte 0x03005e00 +_081369DC: .4byte sub_81369E0 + 1 + thumb_func_end sub_8136938 + + thumb_func_start sub_81369E0 +sub_81369E0: @ 81369E0 + 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 _08136A3C + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08136A3C + adds r0, 0x1 + cmp r4, r0 + bne _08136A18 + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_8136DE8 + b _08136A3C +_08136A18: + movs r0, 0x5 + bl audio_play + ldr r1, _08136A44 + ldr r0, _08136A48 + ldr r0, [r0] + ldr r2, _08136A4C + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_08136A3C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08136A44: .4byte 0x085b2668 +_08136A48: .4byte 0x0203ab50 +_08136A4C: .4byte 0x00000804 + thumb_func_end sub_81369E0 + + thumb_func_start sub_8136A50 +sub_8136A50: @ 8136A50 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08136A6C + ldr r1, [r1] + movs r2, 0x80 + lsls r2, 4 + adds r1, r2 + ldr r2, _08136A70 + str r2, [r1] + bl sub_81364EC + pop {r0} + bx r0 + .align 2, 0 +_08136A6C: .4byte 0x0203ab50 +_08136A70: .4byte sub_8136A74 + 1 + thumb_func_end sub_8136A50 + + thumb_func_start sub_8136A74 +sub_8136A74: @ 8136A74 + push {lr} + ldr r2, _08136A90 + ldr r0, _08136A94 + ldrh r1, [r0] + lsls r1, 3 + ldr r0, _08136A98 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, _08136A9C + bl sub_8166204 + pop {r0} + bx r0 + .align 2, 0 +_08136A90: .4byte 0x03005d8c +_08136A94: .4byte 0x0203ce7c +_08136A98: .4byte 0x00000848 +_08136A9C: .4byte sub_8136AA0 + 1 + thumb_func_end sub_8136A74 + + thumb_func_start sub_8136AA0 +sub_8136AA0: @ 8136AA0 + push {lr} + ldr r0, _08136AB0 + ldr r1, [r0] + movs r0, 0 + bl sub_81357FC + pop {r0} + bx r0 + .align 2, 0 +_08136AB0: .4byte 0x0203ab48 + thumb_func_end sub_8136AA0 + + thumb_func_start sub_8136AB4 +sub_8136AB4: @ 8136AB4 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08136B24 + adds r0, r1 + ldrb r0, [r0, 0x2] + movs r1, 0 + bl sub_8198070 + ldr r0, _08136B28 + ldr r3, _08136B2C + ldr r1, _08136B30 + ldr r2, [r1] + ldr r1, _08136B34 + ldrh r1, [r1] + lsls r1, 3 + adds r2, r1 + ldr r1, _08136B38 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl gf_strcpy + ldr r5, _08136B3C + ldr r1, _08136B40 + adds r0, r5, 0 + bl ExpandTextCodes + 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] + ldr r0, _08136B44 + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0xA + movs r3, 0xD + bl sub_8121E7C + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08136B24: .4byte 0x03005e08 +_08136B28: .4byte 0x02021cc4 +_08136B2C: .4byte 0x085b262c +_08136B30: .4byte 0x03005d8c +_08136B34: .4byte 0x0203ce7c +_08136B38: .4byte 0x00000848 +_08136B3C: .4byte 0x02021fc4 +_08136B40: .4byte 0x085e9353 +_08136B44: .4byte sub_8136B48 + 1 + thumb_func_end sub_8136AB4 + + thumb_func_start sub_8136B48 +sub_8136B48: @ 8136B48 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08136B70 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xE + str r2, [sp, 0x8] + ldr r2, _08136B74 + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl sub_8121F94 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08136B70: .4byte 0x085b27a8 +_08136B74: .4byte 0x085b26a4 + thumb_func_end sub_8136B48 + + thumb_func_start sub_8136B78 +sub_8136B78: @ 8136B78 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _08136BB4 + ldr r1, _08136BB8 + adds r0, r5, 0 + bl ExpandTextCodes + 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] + ldr r0, _08136BBC + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0xA + movs r3, 0xD + bl sub_8121E7C + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08136BB4: .4byte 0x02021fc4 +_08136BB8: .4byte 0x085e9367 +_08136BBC: .4byte sub_8136BC0 + 1 + thumb_func_end sub_8136B78 + + thumb_func_start sub_8136BC0 +sub_8136BC0: @ 8136BC0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _08136C3C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08136C36 + ldr r0, _08136C40 + ldrb r0, [r0] + bl sub_8136F68 + movs r0, 0x5 + bl audio_play + ldr r5, _08136C44 + subs r6, r5, 0x2 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + ldr r0, _08136C48 + adds r4, r0 + ldrb r0, [r4] + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81AE6C8 + ldrh r0, [r6] + movs r1, 0x5 + bl sub_8136110 + bl sub_813625C + bl sub_81362E0 + bl sub_8135E2C + ldr r0, _08136C4C + ldrh r1, [r5] + ldrh r2, [r6] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldrh r0, [r6] + ldr r1, _08136C50 + bl sub_8136110 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r7, 0 + bl sub_8136C54 +_08136C36: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08136C3C: .4byte 0x030022c0 +_08136C40: .4byte 0x0203ce7c +_08136C44: .4byte 0x0203ab4e +_08136C48: .4byte 0x03005e08 +_08136C4C: .4byte 0x03006310 +_08136C50: .4byte 0x00001005 + thumb_func_end sub_8136BC0 + + thumb_func_start sub_8136C54 +sub_8136C54: @ 8136C54 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xA + movs r1, 0 + bl sub_8197DF8 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81363BC + ldr r1, _08136C84 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08136C88 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08136C84: .4byte 0x03005e00 +_08136C88: .4byte sub_81365C8 + 1 + thumb_func_end sub_8136C54 + + thumb_func_start sub_8136C8C +sub_8136C8C: @ 8136C8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _08136CF8 + bl get_nature + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08136CFC + ldr r7, _08136D00 + ldrh r2, [r7] + lsls r2, 3 + ldr r6, _08136D04 + adds r2, r6 + ldr r1, [r5] + adds r1, r2 + bl sub_8136FE4 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _08136D08 + ldr r3, _08136D0C + ldr r2, [r5] + ldrh r1, [r7] + lsls r1, 3 + adds r2, r1 + adds r2, r6 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl gf_strcpy + ldrb r0, [r7] + bl sub_8136F68 + ldr r1, [r5] + ldrh r0, [r7] + lsls r0, 3 + adds r1, r0 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 8 + strh r0, [r7] + lsls r4, 16 + asrs r4, 16 + cmp r4, 0 + bne _08136D10 + adds r0, 0x1 + b _08136D1A + .align 2, 0 +_08136CF8: .4byte 0x02024744 +_08136CFC: .4byte 0x03005d8c +_08136D00: .4byte 0x0203ce7c +_08136D04: .4byte 0x00000848 +_08136D08: .4byte 0x02022f58 +_08136D0C: .4byte 0x085b262c +_08136D10: + cmp r4, 0 + ble _08136D18 + adds r0, 0x2 + b _08136D1A +_08136D18: + adds r0, 0x3 +_08136D1A: + strh r0, [r7] + mov r0, r8 + bl sub_81364EC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8136C8C + + thumb_func_start sub_8136D2C +sub_8136D2C: @ 8136D2C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _08136D78 + ldrb r0, [r5] + bl sub_80FC3E8 + ldr r0, _08136D7C + ldr r3, _08136D80 + ldr r1, _08136D84 + ldr r2, [r1] + ldrh r1, [r5] + lsls r1, 3 + adds r2, r1 + ldr r1, _08136D88 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl gf_strcpy + ldr r1, _08136D8C + ldrh r0, [r5] + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_8136F68 + movs r0, 0 + strh r0, [r5] + adds r0, r4, 0 + bl sub_81364EC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08136D78: .4byte 0x0203ce7c +_08136D7C: .4byte 0x02021cc4 +_08136D80: .4byte 0x085b262c +_08136D84: .4byte 0x03005d8c +_08136D88: .4byte 0x00000848 +_08136D8C: .4byte 0x020375f0 + thumb_func_end sub_8136D2C + + thumb_func_start sub_8136D90 +sub_8136D90: @ 8136D90 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _08136DD4 + ldr r0, _08136DD8 + ldr r5, _08136DDC + ldrh r1, [r5] + lsls r1, 3 + ldr r2, _08136DE0 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 + bl sub_818E704 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + ldr r1, _08136DE4 + ldrh r0, [r5] + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_8136F68 + movs r0, 0 + strh r0, [r5] + adds r0, r4, 0 + bl sub_81364EC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08136DD4: .4byte 0x020375e0 +_08136DD8: .4byte 0x03005d8c +_08136DDC: .4byte 0x0203ce7c +_08136DE0: .4byte 0x00000848 +_08136DE4: .4byte 0x020375f0 + thumb_func_end sub_8136D90 + + thumb_func_start sub_8136DE8 +sub_8136DE8: @ 8136DE8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, _08136E18 + adds r0, r4, r5 + ldrb r0, [r0, 0x2] + movs r1, 0 + bl sub_8198070 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81363BC + subs r5, 0x8 + adds r4, r5 + ldr r0, _08136E1C + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08136E18: .4byte 0x03005e08 +_08136E1C: .4byte sub_81365C8 + 1 + thumb_func_end sub_8136DE8 + + thumb_func_start sub_8136E20 +sub_8136E20: @ 8136E20 + push {r4,lr} + lsls r0, 24 + ldr r3, _08136E78 + ldr r1, [r3] + lsrs r0, 21 + adds r1, r0 + ldr r2, _08136E7C + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r4, _08136E80 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r0, _08136E84 + adds r1, r0 + strb r2, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08136E78: .4byte 0x03005d8c +_08136E7C: .4byte 0x00000848 +_08136E80: .4byte 0x00000849 +_08136E84: .4byte 0x0000084e + thumb_func_end sub_8136E20 + + thumb_func_start sub_8136E88 +sub_8136E88: @ 8136E88 + push {r4,lr} + movs r4, 0 +_08136E8C: + adds r0, r4, 0 + bl sub_8136E20 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x27 + bls _08136E8C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8136E88 + + thumb_func_start sub_8136EA4 +sub_8136EA4: @ 8136EA4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_8136F9C + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x1 +_08136EB4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8136F9C + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _08136ECC + adds r5, r0, 0 +_08136ECC: + adds r1, r4, 0 + cmp r1, 0x4 + bls _08136EB4 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8136EA4 + + thumb_func_start sub_8136EDC +sub_8136EDC: @ 8136EDC + push {lr} + movs r1, 0x6 + bl sub_8136F9C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x63 + bls _08136EEE + movs r0, 0x63 +_08136EEE: + pop {r1} + bx r1 + thumb_func_end sub_8136EDC + + thumb_func_start sub_8136EF4 +sub_8136EF4: @ 8136EF4 + push {lr} + movs r1, 0 + ldr r0, _08136F10 + ldr r2, [r0] + ldr r3, _08136F14 +_08136EFE: + lsls r0, r1, 3 + adds r0, r2, r0 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08136F18 + lsls r0, r1, 24 + asrs r0, 24 + b _08136F26 + .align 2, 0 +_08136F10: .4byte 0x03005d8c +_08136F14: .4byte 0x00000848 +_08136F18: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x27 + bls _08136EFE + movs r0, 0x1 + negs r0, r0 +_08136F26: + pop {r1} + bx r1 + thumb_func_end sub_8136EF4 + + thumb_func_start sub_8136F2C +sub_8136F2C: @ 8136F2C + push {r4,lr} + adds r4, r0, 0 + bl sub_8136EF4 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08136F60 + ldr r0, _08136F58 + ldr r2, [r0] + lsls r0, r1, 3 + ldr r1, _08136F5C + adds r2, r1 + adds r2, r0 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x1 + b _08136F62 + .align 2, 0 +_08136F58: .4byte 0x03005d8c +_08136F5C: .4byte 0x00000848 +_08136F60: + movs r0, 0 +_08136F62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8136F2C + + thumb_func_start sub_8136F68 +sub_8136F68: @ 8136F68 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08136F8C + ldr r0, [r0] + lsls r1, r2, 3 + adds r0, r1 + ldr r1, _08136F90 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08136F94 + adds r0, r2, 0 + bl sub_8136E20 + movs r0, 0x1 + b _08136F96 + .align 2, 0 +_08136F8C: .4byte 0x03005d8c +_08136F90: .4byte 0x00000848 +_08136F94: + movs r0, 0 +_08136F96: + pop {r1} + bx r1 + thumb_func_end sub_8136F68 + + thumb_func_start sub_8136F9C +sub_8136F9C: @ 8136F9C + push {lr} + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0 + bne _08136FAC + ldrb r0, [r0] + b _08136FDE +_08136FAC: + cmp r1, 0x1 + bne _08136FB4 + ldrb r0, [r0, 0x1] + b _08136FDE +_08136FB4: + cmp r1, 0x2 + bne _08136FBC + ldrb r0, [r0, 0x2] + b _08136FDE +_08136FBC: + cmp r1, 0x3 + bne _08136FC4 + ldrb r0, [r0, 0x3] + b _08136FDE +_08136FC4: + cmp r1, 0x4 + bne _08136FCC + ldrb r0, [r0, 0x4] + b _08136FDE +_08136FCC: + cmp r1, 0x5 + bne _08136FD4 + ldrb r0, [r0, 0x5] + b _08136FDE +_08136FD4: + cmp r2, 0x6 + beq _08136FDC + movs r0, 0 + b _08136FDE +_08136FDC: + ldrb r0, [r0, 0x6] +_08136FDE: + pop {r1} + bx r1 + thumb_func_end sub_8136F9C + + thumb_func_start sub_8136FE4 +sub_8136FE4: @ 8136FE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r1 + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + movs r4, 0 + ldr r1, _08137040 + mov r9, r1 + lsls r1, r0, 2 + adds r7, r1, r0 +_08136FFE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + adds r1, r5, 0 + bl sub_8136F9C + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + ble _0813702A + adds r0, r7, r4 + add r0, r9 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r1, r0 + lsls r0, r6, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 +_0813702A: + adds r4, r5, 0 + cmp r4, 0x4 + bls _08136FFE + lsls r0, r6, 16 + asrs r0, 16 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08137040: .4byte 0x085b25a0 + thumb_func_end sub_8136FE4 + + thumb_func_start sub_8137044 +sub_8137044: @ 8137044 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0 + bl sub_8136F9C + lsls r0, 24 + ldr r1, _08137064 + lsrs r0, 22 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08137064: .4byte 0x085b262c + thumb_func_end sub_8137044 + + thumb_func_start sub_8137068 +sub_8137068: @ 8137068 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r7, _08137098 +_08137074: + lsls r1, r4, 3 + ldr r0, _0813709C + adds r1, r0 + adds r0, r5, 0 + bl sub_8136FE4 + lsls r0, 16 + cmp r0, 0 + ble _081370A0 + adds r0, r4, 0x1 + lsls r0, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r6, 0 + bl gf_strcpy + movs r0, 0x1 + b _081370AC + .align 2, 0 +_08137098: .4byte 0x085b262c +_0813709C: .4byte 0x085b2720 +_081370A0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _08137074 + movs r0, 0 +_081370AC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8137068 + + thumb_func_start sub_81370B4 +sub_81370B4: @ 81370B4 + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + movs r6, 0 +_081370BC: + adds r1, r7, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_8136F9C + adds r4, r0, 0 + adds r1, r6, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_8136F9C + lsls r4, 16 + lsls r0, 16 + lsls r1, r6, 16 + cmp r4, r0 + bge _081370E2 + lsrs r7, r1, 16 +_081370E2: + movs r2, 0x80 + lsls r2, 9 + adds r0, r1, r2 + lsrs r6, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _081370BC + lsls r0, r7, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81370B4 + + thumb_func_start sub_81370FC +sub_81370FC: @ 81370FC + push {r4,lr} + bl sub_81798D0 + lsls r0, 24 + cmp r0, 0 + beq _08137134 + ldr r4, _08137120 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, _08137124 + ldr r0, _08137128 + str r0, [r1] + ldr r1, _0813712C + ldr r0, _08137130 + b _08137152 + .align 2, 0 +_08137120: .4byte 0x020375f0 +_08137124: .4byte 0x03005db0 +_08137128: .4byte hm_add_c3_launch_phase_2 + 1 +_0813712C: .4byte 0x0203ceec +_08137130: .4byte sub_8179918 + 1 +_08137134: + ldr r0, _08137158 + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _08137170 + ldr r0, _0813715C + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08137170 + ldr r1, _08137160 + ldr r0, _08137164 + str r0, [r1] + ldr r1, _08137168 + ldr r0, _0813716C +_08137152: + str r0, [r1] + movs r0, 0x1 + b _08137172 + .align 2, 0 +_08137158: .4byte 0x02037318 +_0813715C: .4byte 0x00000888 +_08137160: .4byte 0x03005db0 +_08137164: .4byte hm_add_c3_launch_phase_2 + 1 +_08137168: .4byte 0x0203ceec +_0813716C: .4byte hm2_flash + 1 +_08137170: + movs r0, 0 +_08137172: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81370FC + + thumb_func_start hm2_flash +hm2_flash: @ 8137178 + push {r4,lr} + bl oei_task_add + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl brm_get_pokemon_selection + ldr r1, _081371A8 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r1, _081371AC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, _081371B0 + lsrs r1, r2, 16 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081371A8: .4byte 0x02038c08 +_081371AC: .4byte 0x03005e00 +_081371B0: .4byte sub_81371B4 + 1 + thumb_func_end hm2_flash + + thumb_func_start sub_81371B4 +sub_81371B4: @ 81371B4 + push {lr} + movs r0, 0xCF + bl audio_play + ldr r0, _081371CC + bl flag_set + ldr r0, _081371D0 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_081371CC: .4byte 0x00000888 +_081371D0: .4byte 0x082926f8 + thumb_func_end sub_81371B4 + + thumb_func_start sub_81371D4 +sub_81371D4: @ 81371D4 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81371D4 + + thumb_func_start sub_81371EC +sub_81371EC: @ 81371EC + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81371EC + + thumb_func_start c2_change_map +c2_change_map: @ 8137200 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _081372DC + mov r0, sp + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _081372E0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r4, 0 + str r4, [sp, 0x4] + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _081372E4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, sp + strh r4, [r0] + str r0, [r1] + ldr r0, _081372E8 + str r0, [r1, 0x4] + ldr r0, _081372EC + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + bl clear_tasks + bl reset_all_obj_data + ldr r3, _081372F0 + ldrh r2, [r3] + strh r4, [r3] + ldr r4, _081372F4 + ldrh r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + ldr r0, _081372F8 + bl SetVBlankCallback + ldr r0, _081372FC + bl set_callback2 + bl sub_8137304 + lsls r0, 24 + cmp r0, 0 + bne _081372D2 + ldr r0, _08137300 + ldr r0, [r0, 0x8] + bl set_callback2 +_081372D2: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081372DC: .4byte 0x040000d4 +_081372E0: .4byte 0x8100c000 +_081372E4: .4byte 0x85000100 +_081372E8: .4byte 0x05000002 +_081372EC: .4byte 0x810001ff +_081372F0: .4byte 0x04000208 +_081372F4: .4byte 0x04000200 +_081372F8: .4byte sub_81371EC + 1 +_081372FC: .4byte sub_81371D4 + 1 +_08137300: .4byte 0x030022c0 + thumb_func_end c2_change_map + + thumb_func_start sub_8137304 +sub_8137304: @ 8137304 + push {r4-r7,lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r6, r0, 24 + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r4, _08137344 + ldrb r0, [r4] + cmp r0, 0 + beq _08137358 + adds r7, r4, 0 + adds r0, r4, 0x4 + mov r12, r0 +_08137326: + lsls r2, r3, 3 + adds r1, r2, r7 + ldrb r0, [r1] + cmp r0, r6 + bne _08137348 + ldrb r0, [r1, 0x1] + cmp r0, r5 + bne _08137348 + mov r1, r12 + adds r0, r2, r1 + ldr r0, [r0] + bl _call_via_r0 + movs r0, 0x1 + b _0813735A + .align 2, 0 +_08137344: .4byte 0x085b27c8 +_08137348: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08137326 +_08137358: + movs r0, 0 +_0813735A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8137304 + + thumb_func_start sub_8137360 +sub_8137360: @ 8137360 + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r0, 24 + lsrs r4, r1, 24 + movs r3, 0 + ldr r1, _0813738C + ldrb r0, [r1] + cmp r0, 0 + beq _081373A0 + adds r6, r1, 0 +_08137376: + lsls r0, r3, 3 + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, r5 + bne _08137390 + ldrb r0, [r2, 0x1] + cmp r0, r4 + bne _08137390 + ldrb r0, [r2, 0x2] + b _081373A2 + .align 2, 0 +_0813738C: .4byte 0x085b27c8 +_08137390: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08137376 +_081373A0: + movs r0, 0 +_081373A2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8137360 + + thumb_func_start fade_type_for_given_maplight_pair +fade_type_for_given_maplight_pair: @ 81373A8 + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r0, 24 + lsrs r4, r1, 24 + movs r3, 0 + ldr r1, _081373D4 + ldrb r0, [r1] + cmp r0, 0 + beq _081373E8 + adds r6, r1, 0 +_081373BE: + lsls r0, r3, 3 + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, r5 + bne _081373D8 + ldrb r0, [r2, 0x1] + cmp r0, r4 + bne _081373D8 + ldrb r0, [r2, 0x3] + b _081373EA + .align 2, 0 +_081373D4: .4byte 0x085b27c8 +_081373D8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081373BE +_081373E8: + movs r0, 0 +_081373EA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end fade_type_for_given_maplight_pair + + thumb_func_start sub_81373F0 +sub_81373F0: @ 81373F0 + push {lr} + ldr r0, _08137400 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_08137400: .4byte sub_8137404 + 1 + thumb_func_end sub_81373F0 + + thumb_func_start sub_8137404 +sub_8137404: @ 8137404 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08137418 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _0813741C + str r0, [r1] + bx lr + .align 2, 0 +_08137418: .4byte 0x03005e00 +_0813741C: .4byte sub_8137420 + 1 + thumb_func_end sub_8137404 + + thumb_func_start sub_8137420 +sub_8137420: @ 8137420 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + ldr r0, _0813749C + ldr r1, _081374A0 + bl LZ77UnCompVram + ldr r0, _081374A4 + ldr r1, _081374A8 + bl LZ77UnCompVram + ldr r0, _081374AC + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _081374B0 + movs r1, 0xE0 + movs r2, 0x10 + bl gpu_pal_apply + ldr r1, _081374B4 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _081374B8 + movs r0, 0x8 + bl lcd_io_set + movs r1, 0x8A + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r1, _081374BC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081374C0 + str r1, [r0] + movs r2, 0 + movs r1, 0x10 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813749C: .4byte 0x085b2a90 +_081374A0: .4byte 0x0600c000 +_081374A4: .4byte 0x085b28b0 +_081374A8: .4byte 0x0600f800 +_081374AC: .4byte 0x085b2850 +_081374B0: .4byte 0x085b28a0 +_081374B4: .4byte 0x00003e41 +_081374B8: .4byte 0x00001f0c +_081374BC: .4byte 0x03005e00 +_081374C0: .4byte sub_81374C4 + 1 + thumb_func_end sub_8137420 + + thumb_func_start sub_81374C4 +sub_81374C4: @ 81374C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081374F4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrh r4, [r5, 0xA] + movs r0, 0x80 + lsls r0, 5 + adds r1, r4, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + cmp r4, 0x10 + bhi _081374F8 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _08137500 + .align 2, 0 +_081374F4: .4byte 0x03005e00 +_081374F8: + movs r0, 0 + strh r0, [r5, 0xC] + ldr r0, _08137508 + str r0, [r5] +_08137500: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08137508: .4byte sub_813750C + 1 + thumb_func_end sub_81374C4 + + thumb_func_start sub_813750C +sub_813750C: @ 813750C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08137548 + movs r0, 0x52 + bl lcd_io_set + ldr r1, _0813754C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0xC] + cmp r1, 0x7 + bhi _08137554 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r1, 1 + ldr r0, _08137550 + adds r0, r1, r0 + movs r2, 0x10 + subs r2, r1 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0xE0 + bl gpu_pal_apply + b _08137566 + .align 2, 0 +_08137548: .4byte 0x00001010 +_0813754C: .4byte 0x03005e00 +_08137550: .4byte 0x085b28a0 +_08137554: + ldr r0, _0813756C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08137570 + str r0, [r4] + movs r0, 0x8 + strh r0, [r4, 0xC] +_08137566: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813756C: .4byte 0x085b2850 +_08137570: .4byte sub_8137574 + 1 + thumb_func_end sub_813750C + + thumb_func_start sub_8137574 +sub_8137574: @ 8137574 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08137594 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08137598 + subs r0, r2, 0x1 + strh r0, [r1, 0xC] + b _081375A0 + .align 2, 0 +_08137594: .4byte 0x03005e00 +_08137598: + ldr r0, _081375A4 + ldr r0, [r0, 0x8] + bl set_callback2 +_081375A0: + pop {r0} + bx r0 + .align 2, 0 +_081375A4: .4byte 0x030022c0 + thumb_func_end sub_8137574 + + thumb_func_start sub_81375A8 +sub_81375A8: @ 81375A8 + push {lr} + ldr r0, _081375B8 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081375B8: .4byte sub_81375BC + 1 + thumb_func_end sub_81375A8 + + thumb_func_start sub_81375BC +sub_81375BC: @ 81375BC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081375D0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _081375D4 + str r0, [r1] + bx lr + .align 2, 0 +_081375D0: .4byte 0x03005e00 +_081375D4: .4byte sub_81375D8 + 1 + thumb_func_end sub_81375BC + + thumb_func_start sub_81375D8 +sub_81375D8: @ 81375D8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + ldr r0, _08137654 + ldr r1, _08137658 + bl LZ77UnCompVram + ldr r0, _0813765C + ldr r1, _08137660 + bl LZ77UnCompVram + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _08137664 + movs r0, 0x8 + bl lcd_io_set + movs r1, 0x8A + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _08137668 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0813766C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _08137670 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08137674 + str r1, [r0] + movs r2, 0 + movs r1, 0x10 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + strh r2, [r0, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08137654: .4byte 0x085b2a90 +_08137658: .4byte 0x0600c000 +_0813765C: .4byte 0x085b28b0 +_08137660: .4byte 0x0600f800 +_08137664: .4byte 0x00001f0c +_08137668: .4byte 0x085b2850 +_0813766C: .4byte 0x085b2870 +_08137670: .4byte 0x03005e00 +_08137674: .4byte sub_8137678 + 1 + thumb_func_end sub_81375D8 + + thumb_func_start sub_8137678 +sub_8137678: @ 8137678 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081376AC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0xC] + cmp r1, 0xF + bhi _081376B4 + adds r2, r1, 0x1 + adds r0, r2, 0x1 + strh r0, [r4, 0xC] + movs r0, 0xF + subs r0, r1 + lsls r0, 1 + ldr r1, _081376B0 + adds r0, r1 + lsls r2, 17 + lsrs r2, 16 + movs r1, 0xE0 + bl gpu_pal_apply + b _081376C8 + .align 2, 0 +_081376AC: .4byte 0x03005e00 +_081376B0: .4byte 0x085b2890 +_081376B4: + ldr r1, _081376D0 + movs r0, 0x52 + bl lcd_io_set + ldr r1, _081376D4 + movs r0, 0x50 + bl lcd_io_set + ldr r0, _081376D8 + str r0, [r4] +_081376C8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081376D0: .4byte 0x00001010 +_081376D4: .4byte 0x00003e41 +_081376D8: .4byte sub_81376DC + 1 + thumb_func_end sub_8137678 + + thumb_func_start sub_81376DC +sub_81376DC: @ 81376DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08137710 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrh r0, [r5, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0x80 + lsls r0, 21 + adds r1, r0 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + cmp r4, 0 + beq _08137714 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _08137726 + .align 2, 0 +_08137710: .4byte 0x03005e00 +_08137714: + ldr r0, _0813772C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08137730 + ldr r0, [r0, 0x8] + bl set_callback2 +_08137726: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813772C: .4byte 0x085b2870 +_08137730: .4byte 0x030022c0 + thumb_func_end sub_81376DC + + thumb_func_start sub_8137734 +sub_8137734: @ 8137734 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + bl sp000_heal_pokemon + ldr r4, _08137758 + adds r0, r4, 0 + bl flag_check + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _08137760 + ldr r0, _0813775C + strb r1, [r0] + b _0813776C + .align 2, 0 +_08137758: .4byte 0x00000864 +_0813775C: .4byte 0x0203bce4 +_08137760: + ldr r1, _081377A4 + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl flag_set +_0813776C: + movs r0, 0x1 + bl sub_80847F8 + cmp r0, 0 + bne _0813778E + ldr r0, _081377A8 + ldr r2, [r0] + ldrh r1, [r2, 0xE] + lsls r1, 16 + ldrb r0, [r2, 0x10] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x11] + orrs r1, r0 + movs r0, 0x1 + bl sav12_xor_set +_0813778E: + bl sub_8076D48 + ldr r0, _081377A8 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081377AC + movs r0, 0x1 + bl sub_8084F6C + b _081377B2 + .align 2, 0 +_081377A4: .4byte 0x0203bce4 +_081377A8: .4byte 0x03005d90 +_081377AC: + movs r0, 0x2 + bl sub_8084F6C +_081377B2: + movs r7, 0 + movs r6, 0 + add r0, sp, 0x18 + mov r8, r0 + mov r5, sp +_081377BC: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, _08137870 + adds r4, r1, r0 + movs r0, 0 + strb r6, [r5] + strb r0, [r5, 0x1] + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _0813780A + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _0813780A + adds r0, r4, 0 + movs r1, 0x43 + bl pokemon_getattr + cmp r0, 0 + bne _0813780A + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x43 + add r2, sp, 0x18 + bl pokemon_setattr + adds r0, r4, 0 + bl sub_80EE5A4 + strb r0, [r5, 0x1] + movs r7, 0x1 +_0813780A: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0x5 + ble _081377BC + cmp r7, 0x1 + bne _0813785A + movs r0, 0x2A + bl sav12_xor_increment + ldr r0, _08137874 + bl flag_set + mov r3, sp + add r2, sp, 0x4 + movs r6, 0x4 +_08137828: + ldrb r1, [r3, 0x1] + ldrb r0, [r2, 0x1] + cmp r0, r1 + bls _08137838 + ldr r1, [sp] + ldr r0, [r2] + str r0, [sp] + str r1, [r2] +_08137838: + adds r2, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _08137828 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bls _0813785A + mov r0, sp + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08137870 + adds r0, r1 + movs r1, 0x43 + bl sub_80EE4DC +_0813785A: + ldr r0, _08137878 + bl set_callback2 + movs r0, 0 + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08137870: .4byte 0x020244ec +_08137874: .4byte 0x0000089b +_08137878: .4byte sub_8173694 + 1 + thumb_func_end sub_8137734 + + thumb_func_start sp0C8_whiteout_maybe +sp0C8_whiteout_maybe: @ 813787C + push {lr} + ldr r0, _0813788C + bl set_callback2 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0813788C: .4byte c2_whiteout + 1 + thumb_func_end sp0C8_whiteout_maybe + + thumb_func_start sub_8137890 +sub_8137890: @ 8137890 + push {r4,lr} + ldr r0, _081378B4 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _081378B8 + bl var_get + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + orrs r4, r0 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081378B4: .4byte 0x00004024 +_081378B8: .4byte 0x00004025 + thumb_func_end sub_8137890 + + thumb_func_start sub_81378BC +sub_81378BC: @ 81378BC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081378DC + lsrs r1, r4, 16 + bl var_set + ldr r0, _081378E0 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081378DC: .4byte 0x00004024 +_081378E0: .4byte 0x00004025 + thumb_func_end sub_81378BC + + thumb_func_start sub_81378E4 +sub_81378E4: @ 81378E4 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl sub_81378BC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81378E4 + + thumb_func_start sub_8137904 +sub_8137904: @ 8137904 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_8137890 + adds r1, r0, 0 + cmp r4, 0 + beq _08137928 + ldr r3, _08137934 + ldr r2, _08137938 +_08137918: + adds r0, r1, 0 + muls r0, r3 + adds r1, r0, r2 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _08137918 +_08137928: + adds r0, r1, 0 + bl sub_81378BC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08137934: .4byte 0x41c64e6d +_08137938: .4byte 0x00003039 + thumb_func_end sub_8137904 + + thumb_func_start sub_813793C +sub_813793C: @ 813793C + push {r4-r6,lr} + bl sub_8137890 + lsrs r6, r0, 16 + movs r5, 0 +_08137946: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08137970 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _08137978 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, _08137974 + ands r1, r0 + cmp r1, r6 + bne _08137978 + movs r0, 0x1 + b _08137980 + .align 2, 0 +_08137970: .4byte 0x020244ec +_08137974: .4byte 0x0000ffff +_08137978: + adds r5, 0x1 + cmp r5, 0x5 + ble _08137946 + movs r0, 0 +_08137980: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_813793C + + thumb_func_start sub_8137988 +sub_8137988: @ 8137988 + push {lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + cmp r0, 0 + beq _081379CE + bl sub_802F588 + ldr r1, _081379BC + ldr r0, _081379C0 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081379C8 + ldr r0, _081379C4 + bl flag_set + b _081379CE + .align 2, 0 +_081379BC: .4byte 0x085b2b44 +_081379C0: .4byte 0x03005cf8 +_081379C4: .4byte 0x0000089a +_081379C8: + ldr r0, _081379D4 + bl flag_clear +_081379CE: + pop {r0} + bx r0 + .align 2, 0 +_081379D4: .4byte 0x0000089a + thumb_func_end sub_8137988 + + thumb_func_start sub_81379D8 +sub_81379D8: @ 81379D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AC3BC + lsls r0, 24 + cmp r0, 0 + beq _081379F2 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_081379F2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81379D8 + + thumb_func_start sub_81379F8 +sub_81379F8: @ 81379F8 + push {lr} + ldr r0, _08137A08 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_08137A08: .4byte sub_81379D8 + 1 + thumb_func_end sub_81379F8 + + thumb_func_start sub_8137A0C +sub_8137A0C: @ 8137A0C + push {lr} + ldr r0, _08137A1C + bl var_get_pointer + movs r1, 0 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08137A1C: .4byte 0x00004049 + thumb_func_end sub_8137A0C + + thumb_func_start sub_8137A20 +sub_8137A20: @ 8137A20 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _08137A48 + bl var_get_pointer + adds r5, r0, 0 + ldrh r0, [r5] + adds r4, r0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x7 + bl __umodsi3 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08137A48: .4byte 0x00004049 + thumb_func_end sub_8137A20 + + thumb_func_start sub_8137A4C +sub_8137A4C: @ 8137A4C + push {lr} + ldr r0, _08137A68 + ldrh r0, [r0] + cmp r0, 0 + bne _08137A70 + movs r0, 0 + bl sub_80C0844 + ldr r1, _08137A6C + strh r0, [r1] + movs r0, 0x1 + bl sub_80C0844 + b _08137A80 + .align 2, 0 +_08137A68: .4byte 0x020375e0 +_08137A6C: .4byte 0x020375e2 +_08137A70: + movs r0, 0 + bl pokedex_count + ldr r1, _08137A90 + strh r0, [r1] + movs r0, 0x1 + bl pokedex_count +_08137A80: + ldr r1, _08137A94 + strh r0, [r1] + bl sub_809D42C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_08137A90: .4byte 0x020375e2 +_08137A94: .4byte 0x020375e4 + thumb_func_end sub_8137A4C + + thumb_func_start sub_8137A98 +sub_8137A98: @ 8137A98 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x9 + bhi _08137AA4 + b _08137BFC +_08137AA4: + cmp r0, 0x13 + bhi _08137AB0 + ldr r0, _08137AAC + b _08137C06 + .align 2, 0 +_08137AAC: .4byte 0x082a5dab +_08137AB0: + cmp r0, 0x1D + bhi _08137ABC + ldr r0, _08137AB8 + b _08137C06 + .align 2, 0 +_08137AB8: .4byte 0x082a5df1 +_08137ABC: + cmp r0, 0x27 + bhi _08137AC8 + ldr r0, _08137AC4 + b _08137C06 + .align 2, 0 +_08137AC4: .4byte 0x082a5e34 +_08137AC8: + cmp r0, 0x31 + bhi _08137AD4 + ldr r0, _08137AD0 + b _08137C06 + .align 2, 0 +_08137AD0: .4byte 0x082a5e83 +_08137AD4: + cmp r0, 0x3B + bhi _08137AE0 + ldr r0, _08137ADC + b _08137C06 + .align 2, 0 +_08137ADC: .4byte 0x082a5eb9 +_08137AE0: + cmp r0, 0x45 + bhi _08137AEC + ldr r0, _08137AE8 + b _08137C06 + .align 2, 0 +_08137AE8: .4byte 0x082a5ef4 +_08137AEC: + cmp r0, 0x4F + bhi _08137AF8 + ldr r0, _08137AF4 + b _08137C06 + .align 2, 0 +_08137AF4: .4byte 0x082a5f39 +_08137AF8: + cmp r0, 0x59 + bhi _08137B04 + ldr r0, _08137B00 + b _08137C06 + .align 2, 0 +_08137B00: .4byte 0x082a5f82 +_08137B04: + cmp r0, 0x63 + bhi _08137B10 + ldr r0, _08137B0C + b _08137C06 + .align 2, 0 +_08137B0C: .4byte 0x082a5fb9 +_08137B10: + cmp r0, 0x6D + bhi _08137B1C + ldr r0, _08137B18 + b _08137C06 + .align 2, 0 +_08137B18: .4byte 0x082a6018 +_08137B1C: + cmp r0, 0x77 + bhi _08137B28 + ldr r0, _08137B24 + b _08137C06 + .align 2, 0 +_08137B24: .4byte 0x082a6061 +_08137B28: + cmp r0, 0x81 + bhi _08137B34 + ldr r0, _08137B30 + b _08137C06 + .align 2, 0 +_08137B30: .4byte 0x082a609c +_08137B34: + cmp r0, 0x8B + bhi _08137B40 + ldr r0, _08137B3C + b _08137C06 + .align 2, 0 +_08137B3C: .4byte 0x082a60d5 +_08137B40: + cmp r0, 0x95 + bhi _08137B4C + ldr r0, _08137B48 + b _08137C06 + .align 2, 0 +_08137B48: .4byte 0x082a6124 +_08137B4C: + cmp r0, 0x9F + bhi _08137B58 + ldr r0, _08137B54 + b _08137C06 + .align 2, 0 +_08137B54: .4byte 0x082a616f +_08137B58: + cmp r0, 0xA9 + bhi _08137B64 + ldr r0, _08137B60 + b _08137C06 + .align 2, 0 +_08137B60: .4byte 0x082a61d6 +_08137B64: + cmp r0, 0xB3 + bhi _08137B70 + ldr r0, _08137B6C + b _08137C06 + .align 2, 0 +_08137B6C: .4byte 0x082a623a +_08137B70: + cmp r0, 0xBD + bhi _08137B7C + ldr r0, _08137B78 + b _08137C06 + .align 2, 0 +_08137B78: .4byte 0x082a6287 +_08137B7C: + cmp r0, 0xC7 + bls _08137BEA + cmp r0, 0xC8 + bne _08137BB8 + ldr r0, _08137BB4 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _08137BEA + movs r0, 0xCD + lsls r0, 1 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _08137BEA + b _08137C04 + .align 2, 0 +_08137BB4: .4byte 0x00000199 +_08137BB8: + cmp r0, 0xC9 + bne _08137BF8 + ldr r0, _08137BF0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _08137C04 + movs r0, 0xCD + lsls r0, 1 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _08137C04 +_08137BEA: + ldr r0, _08137BF4 + b _08137C06 + .align 2, 0 +_08137BF0: .4byte 0x00000199 +_08137BF4: .4byte 0x082a62c9 +_08137BF8: + cmp r0, 0xCA + beq _08137C04 +_08137BFC: + ldr r0, _08137C00 + b _08137C06 + .align 2, 0 +_08137C00: .4byte 0x082a5d6c +_08137C04: + ldr r0, _08137C0C +_08137C06: + pop {r1} + bx r1 + .align 2, 0 +_08137C0C: .4byte 0x082a6312 + thumb_func_end sub_8137A98 + + thumb_func_start sub_8137C10 +sub_8137C10: @ 8137C10 + push {lr} + ldr r0, _08137C24 + ldrh r0, [r0] + bl sub_8137A98 + bl box_related_two__2 + pop {r0} + bx r0 + .align 2, 0 +_08137C24: .4byte 0x020375e0 + thumb_func_end sub_8137C10 + + thumb_func_start sub_8137C28 +sub_8137C28: @ 8137C28 + push {lr} + ldr r0, _08137C38 + bl set_callback2 + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_08137C38: .4byte sub_8174194 + 1 + thumb_func_end sub_8137C28 + + thumb_func_start sub_8137C3C +sub_8137C3C: @ 8137C3C + push {lr} + ldr r0, _08137C50 + bl set_callback2 + ldr r1, _08137C54 + ldr r0, _08137C58 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08137C50: .4byte c2_exit_to_overworld_2_switch + 1 +_08137C54: .4byte 0x03005dac +_08137C58: .4byte mapldr_080CA5C0 + 1 + thumb_func_end sub_8137C3C + + thumb_func_start mapldr_080CA5C0 +mapldr_080CA5C0: @ 8137C5C + push {lr} + sub sp, 0x4 + bl script_env_2_enable + bl sub_8085784 + bl sp109_CreatePCMenu + bl sub_80E2514 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _08137C90 + movs r1, 0xA + bl AddTask + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08137C90: .4byte sub_8137C94 + 1 + thumb_func_end mapldr_080CA5C0 + + thumb_func_start sub_8137C94 +sub_8137C94: @ 8137C94 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08137CB0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08137CAC + adds r0, r2, 0 + bl remove_task +_08137CAC: + pop {r0} + bx r0 + .align 2, 0 +_08137CB0: .4byte 0x02037fd4 + thumb_func_end sub_8137C94 + + thumb_func_start sub_8137CB4 +sub_8137CB4: @ 8137CB4 + push {lr} + ldr r0, _08137CC4 + bl set_callback2 + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_08137CC4: .4byte sub_8177888 + 1 + thumb_func_end sub_8137CB4 + + thumb_func_start sub_8137CC8 +sub_8137CC8: @ 8137CC8 + push {lr} + ldr r0, _08137CE0 + ldr r1, _08137CE4 + str r1, [r0, 0x8] + ldr r0, _08137CE8 + bl set_callback2 + bl script_env_2_enable + pop {r0} + bx r0 + .align 2, 0 +_08137CE0: .4byte 0x030022c0 +_08137CE4: .4byte c2_exit_to_overworld_2_switch + 1 +_08137CE8: .4byte sub_8134B44 + 1 + thumb_func_end sub_8137CC8 + + thumb_func_start wild_pokemon_reroll +wild_pokemon_reroll: @ 8137CEC + ldr r0, _08137D00 + movs r1, 0 + strb r1, [r0] + ldr r0, _08137D04 + strb r1, [r0] + ldr r1, _08137D08 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_08137D00: .4byte 0x0203ab54 +_08137D04: .4byte 0x0203ab55 +_08137D08: .4byte 0x0203ab58 + thumb_func_end wild_pokemon_reroll + + thumb_func_start sub_8137D0C +sub_8137D0C: @ 8137D0C + ldr r1, _08137D24 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _08137D28 + movs r0, 0 + strb r0, [r1] + ldr r1, _08137D2C + ldr r0, _08137D30 + ldr r0, [r0, 0x20] + str r0, [r1] + bx lr + .align 2, 0 +_08137D24: .4byte 0x0203ab54 +_08137D28: .4byte 0x0203ab55 +_08137D2C: .4byte 0x0203ab58 +_08137D30: .4byte 0x030022c0 + thumb_func_end sub_8137D0C + + thumb_func_start sp0E3_walkrun_bitfield_interpretation +sp0E3_walkrun_bitfield_interpretation: @ 8137D34 + push {lr} + movs r0, 0x4 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _08137D46 + movs r0, 0x1 + b _08137D58 +_08137D46: + movs r0, 0x2 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + bne _08137D56 + movs r0, 0 + b _08137D58 +_08137D56: + movs r0, 0x2 +_08137D58: + pop {r1} + bx r1 + thumb_func_end sp0E3_walkrun_bitfield_interpretation + + thumb_func_start sub_8137D5C +sub_8137D5C: @ 8137D5C + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r6, 0x63 + bhi _08137D88 + ldr r4, _08137D80 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _08137D84 + adds r0, r4, 0 + bl gf_strcat + b _08137D90 + .align 2, 0 +_08137D80: .4byte 0x02021cc4 +_08137D84: .4byte 0x085eb5ee +_08137D88: + ldr r0, _08137DDC + ldr r1, _08137DE0 + bl gf_strcpy +_08137D90: + ldr r0, _08137DE4 + cmp r7, r0 + bhi _08137DF0 + ldr r4, _08137DE8 + adds r0, r7, 0 + movs r1, 0x3C + bl __udivsi3 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0xAD + strb r0, [r4, 0x2] + adds r5, r4, 0x3 + adds r0, r7, 0 + movs r1, 0x3C + bl __umodsi3 + movs r1, 0x64 + muls r0, r1 + movs r1, 0x3C + bl __udivsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _08137DEC + adds r0, r4, 0 + bl gf_strcat + b _08137DF8 + .align 2, 0 +_08137DDC: .4byte 0x02021cc4 +_08137DE0: .4byte 0x085eb5cf +_08137DE4: .4byte 0x00000e0f +_08137DE8: .4byte 0x02021dc4 +_08137DEC: .4byte 0x085eb5e5 +_08137DF0: + ldr r0, _08137E04 + ldr r1, _08137E08 + bl gf_strcpy +_08137DF8: + movs r4, 0 + cmp r6, 0 + bne _08137E0C + movs r4, 0x5 + b _08137E2A + .align 2, 0 +_08137E04: .4byte 0x02021dc4 +_08137E08: .4byte 0x085eb5da +_08137E0C: + cmp r6, 0x3 + bhi _08137E14 + movs r4, 0x4 + b _08137E2A +_08137E14: + cmp r6, 0x9 + bhi _08137E1C + movs r4, 0x3 + b _08137E2A +_08137E1C: + cmp r6, 0x13 + bhi _08137E24 + movs r4, 0x2 + b _08137E2A +_08137E24: + cmp r6, 0x63 + bhi _08137E2A + movs r4, 0x1 +_08137E2A: + adds r0, r7, 0 + movs r1, 0x3C + bl __udivsi3 + cmp r0, 0xA + bhi _08137E3A + adds r0, r4, 0x5 + b _08137E58 +_08137E3A: + cmp r0, 0xF + bhi _08137E42 + adds r0, r4, 0x4 + b _08137E58 +_08137E42: + cmp r0, 0x14 + bhi _08137E4A + adds r0, r4, 0x3 + b _08137E58 +_08137E4A: + cmp r0, 0x28 + bhi _08137E52 + adds r0, r4, 0x2 + b _08137E58 +_08137E52: + cmp r0, 0x3B + bhi _08137E5C + adds r0, r4, 0x1 +_08137E58: + lsls r0, 24 + lsrs r4, r0, 24 +_08137E5C: + ldr r0, _08137E68 + strh r4, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08137E68: .4byte 0x020375f0 + thumb_func_end sub_8137D5C + + thumb_func_start sub_8137E6C +sub_8137E6C: @ 8137E6C + push {r4,r5,lr} + ldr r0, _08137E90 + ldr r1, _08137E94 + ldr r4, [r0, 0x20] + ldr r0, [r1] + subs r4, r0 + ldr r5, _08137E98 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_8137D5C + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_8137E9C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08137E90: .4byte 0x030022c0 +_08137E94: .4byte 0x0203ab58 +_08137E98: .4byte 0x0203ab55 + thumb_func_end sub_8137E6C + + thumb_func_start sub_8137E9C +sub_8137E9C: @ 8137E9C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r6, _08137EF0 + adds r0, r6, 0 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r7, _08137EF4 + adds r0, r7, 0 + bl var_get + lsls r0, 16 + adds r4, r0 + cmp r4, r5 + bhi _08137ECC + cmp r4, 0 + bne _08137EE6 +_08137ECC: + lsls r1, r5, 16 + lsrs r1, 16 + adds r0, r6, 0 + bl var_set + lsrs r1, r5, 16 + adds r0, r7, 0 + bl var_set + ldr r0, _08137EF8 + mov r1, r8 + bl var_set +_08137EE6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08137EF0: .4byte 0x00004028 +_08137EF4: .4byte 0x00004029 +_08137EF8: .4byte 0x00004027 + thumb_func_end sub_8137E9C + + thumb_func_start sub_8137EFC +sub_8137EFC: @ 8137EFC + push {r4,lr} + ldr r0, _08137F30 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _08137F34 + bl var_get + lsls r0, 16 + adds r4, r0 + cmp r4, 0 + beq _08137F3C + ldr r0, _08137F38 + bl var_get + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8137D5C + movs r0, 0x1 + b _08137F3E + .align 2, 0 +_08137F30: .4byte 0x00004028 +_08137F34: .4byte 0x00004029 +_08137F38: .4byte 0x00004027 +_08137F3C: + movs r0, 0 +_08137F3E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8137EFC + + thumb_func_start sub_8137F44 +sub_8137F44: @ 8137F44 + push {r4,lr} + ldr r0, _08137F84 + ldrh r1, [r0] + ldr r0, _08137F88 + cmp r1, r0 + beq _08137F7C + ldr r4, _08137F8C + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _08137F6E + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bne _08137F7C +_08137F6E: + adds r0, r4, 0 + movs r1, 0 + bl var_set + movs r0, 0 + bl sav1_set_x2C +_08137F7C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08137F84: .4byte 0x020322dc +_08137F88: .4byte 0x00000c1d +_08137F8C: .4byte 0x000040a9 + thumb_func_end sub_8137F44 + + thumb_func_start sub_8137F90 +sub_8137F90: @ 8137F90 + push {lr} + ldr r0, _08137FA8 + bl flag_set + ldr r0, _08137FAC + bl var_get_pointer + movs r1, 0 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08137FA8: .4byte 0x0000088d +_08137FAC: .4byte 0x0000404a + thumb_func_end sub_8137F90 + + thumb_func_start sub_8137FB0 +sub_8137FB0: @ 8137FB0 + push {lr} + ldr r0, _08137FBC + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_08137FBC: .4byte 0x0000088d + thumb_func_end sub_8137FB0 + + thumb_func_start sub_8137FC0 +sub_8137FC0: @ 8137FC0 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08137FEC + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08137FE6 + ldr r0, _08137FF0 + bl var_get_pointer + ldrh r1, [r0] + adds r1, r4, r1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xCC + bhi _08137FF4 +_08137FE6: + movs r0, 0 + b _08137FF6 + .align 2, 0 +_08137FEC: .4byte 0x0000088d +_08137FF0: .4byte 0x0000404a +_08137FF4: + movs r0, 0x1 +_08137FF6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8137FC0 + + thumb_func_start sub_8137FFC +sub_8137FFC: @ 8137FFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldr r0, _0813802C + bl var_get_pointer + adds r4, r0, 0 + ldr r0, _08138030 + bl var_get_pointer + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0x9 + bhi _081380C2 + lsls r0, 2 + ldr r1, _08138034 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813802C: .4byte 0x0000404a +_08138030: .4byte 0x000040b4 +_08138034: .4byte _08138038 + .align 2, 0 +_08138038: + .4byte _08138060 + .4byte _08138070 + .4byte _08138064 + .4byte _08138068 + .4byte _08138068 + .4byte _0813806C + .4byte _08138098 + .4byte _08138060 + .4byte _08138064 + .4byte _0813806C +_08138060: + movs r0, 0x1 + b _081380CE +_08138064: + movs r0, 0x4 + b _081380CE +_08138068: + movs r0, 0x2 + b _081380CE +_0813806C: + movs r0, 0x3 + b _081380CE +_08138070: + ldrh r0, [r4] + cmp r0, 0x3B + bhi _08138080 + movs r0, 0x31 + strb r0, [r5] + ldrh r0, [r4] + adds r0, 0x13 + b _081380C0 +_08138080: + cmp r0, 0x8B + bhi _0813808E + movs r0, 0x30 + strb r0, [r5] + ldrh r0, [r4] + subs r0, 0x3C + b _081380C0 +_0813808E: + movs r0, 0x2F + strb r0, [r5] + ldrh r0, [r4] + subs r0, 0x8C + b _081380C0 +_08138098: + ldrh r0, [r4] + cmp r0, 0x41 + bhi _081380A8 + movs r0, 0x2F + strb r0, [r5] + ldrh r1, [r4] + movs r0, 0x41 + b _081380BE +_081380A8: + cmp r0, 0x91 + bhi _081380B6 + movs r0, 0x30 + strb r0, [r5] + ldrh r1, [r4] + movs r0, 0x91 + b _081380BE +_081380B6: + movs r0, 0x31 + strb r0, [r5] + ldrh r1, [r4] + movs r0, 0xE0 +_081380BE: + subs r0, r1 +_081380C0: + strh r0, [r6] +_081380C2: + movs r0, 0 + mov r1, r8 + strb r0, [r1] + movs r0, 0x14 + strh r0, [r7] + movs r0, 0 +_081380CE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8137FFC + + thumb_func_start is_tile_that_overrides_player_control +is_tile_that_overrides_player_control: @ 81380D8 + push {lr} + movs r0, 0x88 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0813810A + ldr r0, _08138110 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _0813810A + cmp r0, 0x3 + ble _081380F6 + cmp r0, 0x6 + bne _0813810A +_081380F6: + ldr r0, _08138114 + bl var_get_pointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xF9 + bhi _08138118 +_0813810A: + movs r0, 0 + b _0813811A + .align 2, 0 +_08138110: .4byte 0x02037318 +_08138114: .4byte 0x000040f2 +_08138118: + movs r0, 0x1 +_0813811A: + pop {r1} + bx r1 + thumb_func_end is_tile_that_overrides_player_control + + thumb_func_start sub_8138120 +sub_8138120: @ 8138120 + push {lr} + movs r0, 0x8A + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08138152 + ldr r0, _08138158 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _08138152 + cmp r0, 0x3 + ble _0813813E + cmp r0, 0x6 + bne _08138152 +_0813813E: + ldr r0, _0813815C + bl var_get_pointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x9 + bhi _08138160 +_08138152: + movs r0, 0 + b _08138162 + .align 2, 0 +_08138158: .4byte 0x02037318 +_0813815C: .4byte 0x000040f3 +_08138160: + movs r0, 0x1 +_08138162: + pop {r1} + bx r1 + thumb_func_end sub_8138120 + + thumb_func_start sub_8138168 +sub_8138168: @ 8138168 + push {lr} + movs r0, 0x72 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0813819A + ldr r0, _081381A0 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _0813819A + cmp r0, 0x3 + ble _08138186 + cmp r0, 0x6 + bne _0813819A +_08138186: + ldr r0, _081381A4 + bl var_get_pointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x9 + bhi _081381A8 +_0813819A: + movs r0, 0 + b _081381AA + .align 2, 0 +_081381A0: .4byte 0x02037318 +_081381A4: .4byte 0x000040f5 +_081381A8: + movs r0, 0x1 +_081381AA: + pop {r1} + bx r1 + thumb_func_end sub_8138168 + + thumb_func_start sub_81381B0 +sub_81381B0: @ 81381B0 + push {lr} + movs r0, 0x80 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081381E2 + ldr r0, _081381E8 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _081381E2 + cmp r0, 0x3 + ble _081381CE + cmp r0, 0x6 + bne _081381E2 +_081381CE: + ldr r0, _081381EC + bl var_get_pointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xF9 + bhi _081381F0 +_081381E2: + movs r0, 0 + b _081381F2 + .align 2, 0 +_081381E8: .4byte 0x02037318 +_081381EC: .4byte 0x000040f4 +_081381F0: + movs r0, 0x1 +_081381F2: + pop {r1} + bx r1 + thumb_func_end sub_81381B0 + + thumb_func_start sub_81381F8 +sub_81381F8: @ 81381F8 + push {lr} + movs r0, 0x75 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0813822A + ldr r0, _08138230 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _0813822A + cmp r0, 0x3 + ble _08138216 + cmp r0, 0x6 + bne _0813822A +_08138216: + ldr r0, _08138234 + bl var_get_pointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xF9 + bhi _08138238 +_0813822A: + movs r0, 0 + b _0813823A + .align 2, 0 +_08138230: .4byte 0x02037318 +_08138234: .4byte 0x000040f6 +_08138238: + movs r0, 0x1 +_0813823A: + pop {r1} + bx r1 + thumb_func_end sub_81381F8 + + thumb_func_start sub_8138240 +sub_8138240: @ 8138240 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_8009FCC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _0813828A + ldr r0, _08138298 + mov r8, r0 +_08138262: + cmp r7, r4 + beq _08138280 + lsls r0, r6, 2 + add r0, r8 + ldr r0, [r0] + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + ldr r2, _0813829C + adds r1, r2 + bl gf_strcpy + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08138280: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08138262 +_0813828A: + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08138298: .4byte 0x0858d144 +_0813829C: .4byte 0x020229f0 + thumb_func_end sub_8138240 + + thumb_func_start sub_81382A0 +sub_81382A0: @ 81382A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r7, 0 + movs r0, 0 + mov r9, r0 + mov r8, r0 + ldr r1, _081382EC + add r0, sp, 0x8 + movs r2, 0x4 + bl memcpy + add r4, sp, 0xC + ldr r1, _081382F0 + adds r0, r4, 0 + movs r2, 0x8 + bl memcpy + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x2 + beq _08138310 + cmp r0, 0x2 + bgt _081382F4 + cmp r0, 0x1 + beq _0813833C + b _08138350 + .align 2, 0 +_081382EC: .4byte 0x085b2b5c +_081382F0: .4byte 0x085b2b60 +_081382F4: + cmp r1, 0x3 + beq _081382FE + cmp r1, 0x4 + beq _08138324 + b _08138350 +_081382FE: + movs r7, 0x2 + ldr r0, _0813830C + ldr r1, [r0] + ldrh r0, [r1] + subs r0, 0x1 + b _0813832C + .align 2, 0 +_0813830C: .4byte 0x03005d8c +_08138310: + movs r7, 0x1 + ldr r0, _08138320 + ldr r0, [r0] + ldrh r1, [r0] + mov r9, r1 + ldrh r0, [r0, 0x2] + subs r0, 0x1 + b _0813834A + .align 2, 0 +_08138320: .4byte 0x03005d8c +_08138324: + ldr r0, _08138338 + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 +_0813832C: + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldrh r1, [r1, 0x2] + mov r8, r1 + b _08138350 + .align 2, 0 +_08138338: .4byte 0x03005d8c +_0813833C: + movs r7, 0x3 + ldr r0, _08138354 + ldr r0, [r0] + ldrh r3, [r0] + mov r9, r3 + ldrh r0, [r0, 0x2] + adds r0, 0x1 +_0813834A: + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_08138350: + movs r6, 0 + b _08138410 + .align 2, 0 +_08138354: .4byte 0x03005d8c +_08138358: + cmp r10, r6 + beq _0813840A + ldr r0, _08138378 + lsls r2, r6, 3 + subs r1, r2, r6 + lsls r1, 2 + adds r1, r0 + ldrb r3, [r1] + adds r4, r0, 0 + cmp r3, 0x1 + blt _0813838C + cmp r3, 0x2 + ble _0813837C + cmp r3, 0x3 + beq _08138388 + b _0813838C + .align 2, 0 +_08138378: .4byte 0x020229e8 +_0813837C: + ldrb r0, [r1, 0x13] + movs r5, 0xEC + cmp r0, 0 + bne _0813839C + movs r5, 0xEB + b _0813839C +_08138388: + ldrb r0, [r1, 0x13] + b _08138394 +_0813838C: + subs r0, r2, r6 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x13] +_08138394: + movs r5, 0x69 + cmp r0, 0 + bne _0813839C + movs r5, 0x64 +_0813839C: + mov r0, sp + adds r0, r7 + adds r0, 0x8 + ldrb r1, [r0] + movs r4, 0xF0 + subs r4, r6 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r7, 1 + mov r0, sp + adds r0, r2 + adds r0, 0xC + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + mov r3, r9 + lsls r3, 16 + asrs r3, 16 + mov r12, r3 + add r0, r12 + adds r3, r0, 0x7 + lsls r3, 16 + asrs r3, 16 + mov r12, r3 + mov r0, sp + adds r0, 0xD + adds r0, r2 + movs r2, 0 + ldrsb r2, [r0, r2] + mov r3, r8 + lsls r0, r3, 16 + asrs r0, 16 + adds r0, r2 + adds r0, 0x7 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r2, r4, 0 + mov r3, r12 + bl sub_808DC44 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_813842C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x4 + bne _0813840A + movs r7, 0 +_0813840A: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08138410: + ldr r0, _08138428 + ldrh r0, [r0] + cmp r6, r0 + bcc _08138358 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08138428: .4byte 0x020375e0 + thumb_func_end sub_81382A0 + + thumb_func_start sub_813842C +sub_813842C: @ 813842C + push {r4,r5,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + movs r1, 0xC0 + lsls r1, 19 + adds r2, r1 + lsrs r5, r2, 24 + lsrs r4, r0, 24 + movs r2, 0xA8 + lsls r2, 21 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bls _08138454 + cmp r4, 0x64 + beq _08138454 + cmp r4, 0x69 + bne _081384E6 +_08138454: + ldr r0, _0813849C + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + adds r0, r3, 0 + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _081384E6 + ldr r1, _081384A0 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081384A4 + adds r1, r0 + lsls r3, r5, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + cmp r4, 0x69 + beq _081384D8 + cmp r4, 0x69 + bgt _081384A8 + cmp r4, 0x64 + beq _081384C4 + b _081384E6 + .align 2, 0 +_0813849C: .4byte 0x03005d8c +_081384A0: .4byte 0x02037350 +_081384A4: .4byte 0x02020630 +_081384A8: + cmp r4, 0xEB + beq _081384B2 + cmp r4, 0xEC + beq _081384BC + b _081384E6 +_081384B2: + ldr r0, _081384B8 + b _081384C6 + .align 2, 0 +_081384B8: .4byte 0x08499a18 +_081384BC: + ldr r0, _081384C0 + b _081384C6 + .align 2, 0 +_081384C0: .4byte 0x084a54b8 +_081384C4: + ldr r0, _081384D4 +_081384C6: + movs r2, 0x80 + lsls r2, 1 + adds r1, r3, r2 + movs r2, 0x20 + bl gpu_pal_apply + b _081384E6 + .align 2, 0 +_081384D4: .4byte 0x084987f8 +_081384D8: + ldr r0, _081384EC + movs r2, 0x80 + lsls r2, 1 + adds r1, r3, r2 + movs r2, 0x20 + bl gpu_pal_apply +_081384E6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081384EC: .4byte 0x084a4278 + thumb_func_end sub_813842C + + thumb_func_start sub_81384F0 +sub_81384F0: @ 81384F0 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _08138510 +_081384F6: + ldr r0, _08138514 + ldrh r0, [r0] + cmp r4, r0 + bne _0813851C + lsls r1, r4, 2 + adds r1, r5 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + ldr r2, _08138518 + bl setmaptile_0 + b _0813852A + .align 2, 0 +_08138510: .4byte 0x085b2b68 +_08138514: .4byte 0x020375e0 +_08138518: .4byte 0x00000206 +_0813851C: + lsls r1, r4, 2 + adds r1, r5 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + ldr r2, _0813853C + bl setmaptile_0 +_0813852A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081384F6 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813853C: .4byte 0x00000205 + thumb_func_end sub_81384F0 + + thumb_func_start sub_8138540 +sub_8138540: @ 8138540 + push {r4-r6,lr} + movs r5, 0xC +_08138544: + movs r4, 0x7 + adds r6, r5, 0x1 +_08138548: + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _08138564 + adds r0, r1 + cmp r0, 0x37 + bls _0813855A + b _08138734 +_0813855A: + lsls r0, 2 + ldr r1, _08138568 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08138564: .4byte 0xfffffde6 +_08138568: .4byte _0813856C + .align 2, 0 +_0813856C: + .4byte _081386F2 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813864C + .4byte _08138652 + .4byte _0813868C + .4byte _08138694 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813865C + .4byte _08138662 + .4byte _0813869C + .4byte _081386A4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813866C + .4byte _08138672 + .4byte _081386AC + .4byte _081386B4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813867C + .4byte _08138684 + .4byte _081386BC + .4byte _081386C4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _081386CC + .4byte _081386DC + .4byte _081386EC + .4byte _08138714 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _081386D4 + .4byte _081386E4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813872A + .4byte _0813871C +_0813864C: + movs r2, 0x8C + lsls r2, 2 + b _08138720 +_08138652: + ldr r2, _08138658 + b _08138720 + .align 2, 0 +_08138658: .4byte 0x00000231 +_0813865C: + movs r2, 0x8E + lsls r2, 2 + b _08138720 +_08138662: + ldr r2, _08138668 + b _08138720 + .align 2, 0 +_08138668: .4byte 0x00000239 +_0813866C: + movs r2, 0x88 + lsls r2, 2 + b _08138720 +_08138672: + ldr r2, _08138678 + b _08138720 + .align 2, 0 +_08138678: .4byte 0x00000221 +_0813867C: + ldr r2, _08138680 + b _08138720 + .align 2, 0 +_08138680: .4byte 0x00000e28 +_08138684: + ldr r2, _08138688 + b _08138720 + .align 2, 0 +_08138688: .4byte 0x00000e29 +_0813868C: + ldr r2, _08138690 + b _08138720 + .align 2, 0 +_08138690: .4byte 0x00000232 +_08138694: + ldr r2, _08138698 + b _08138720 + .align 2, 0 +_08138698: .4byte 0x00000233 +_0813869C: + ldr r2, _081386A0 + b _08138720 + .align 2, 0 +_081386A0: .4byte 0x0000023a +_081386A4: + ldr r2, _081386A8 + b _08138720 + .align 2, 0 +_081386A8: .4byte 0x0000023b +_081386AC: + ldr r2, _081386B0 + b _08138720 + .align 2, 0 +_081386B0: .4byte 0x00000222 +_081386B4: + ldr r2, _081386B8 + b _08138720 + .align 2, 0 +_081386B8: .4byte 0x00000223 +_081386BC: + ldr r2, _081386C0 + b _08138720 + .align 2, 0 +_081386C0: .4byte 0x00000e2a +_081386C4: + ldr r2, _081386C8 + b _08138720 + .align 2, 0 +_081386C8: .4byte 0x00000e2b +_081386CC: + ldr r2, _081386D0 + b _08138720 + .align 2, 0 +_081386D0: .4byte 0x00000e42 +_081386D4: + ldr r2, _081386D8 + b _08138720 + .align 2, 0 +_081386D8: .4byte 0x0000021a +_081386DC: + ldr r2, _081386E0 + b _08138720 + .align 2, 0 +_081386E0: .4byte 0x00000e43 +_081386E4: + ldr r2, _081386E8 + b _08138720 + .align 2, 0 +_081386E8: .4byte 0x0000021a +_081386EC: + movs r2, 0xE4 + lsls r2, 4 + b _08138720 +_081386F2: + subs r1, r5, 0x1 + adds r0, r4, 0 + bl cur_mapdata_get_blockid_at + movs r1, 0x90 + lsls r1, 2 + cmp r0, r1 + bne _0813870C + ldr r2, _08138708 + b _08138720 + .align 2, 0 +_08138708: .4byte 0x00000e48 +_0813870C: + ldr r2, _08138710 + b _08138720 + .align 2, 0 +_08138710: .4byte 0x00000e49 +_08138714: + ldr r2, _08138718 + b _08138720 + .align 2, 0 +_08138718: .4byte 0x00000e41 +_0813871C: + movs r2, 0xE5 + lsls r2, 4 +_08138720: + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 + b _08138734 +_0813872A: + ldr r2, _0813874C + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 +_08138734: + adds r4, 0x1 + cmp r4, 0xF + bgt _0813873C + b _08138548 +_0813873C: + adds r5, r6, 0 + cmp r5, 0x17 + bgt _08138744 + b _08138544 +_08138744: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813874C: .4byte 0x00000251 + thumb_func_end sub_8138540 + + thumb_func_start sub_8138750 +sub_8138750: @ 8138750 + push {r4-r6,lr} + ldr r4, _0813878C + movs r5, 0x3 +_08138756: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + ldr r2, _08138790 + bl setmaptile_0 + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08138756 + movs r5, 0xC +_0813876A: + movs r4, 0x7 + adds r6, r5, 0x1 +_0813876E: + adds r0, r4, 0 + adds r1, r5, 0 + bl cur_mapdata_get_blockid_at + ldr r1, _08138794 + adds r0, r1 + cmp r0, 0x30 + bls _08138780 + b _081388CA +_08138780: + lsls r0, 2 + ldr r1, _08138798 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813878C: .4byte 0x085b2b68 +_08138790: .4byte 0x00000206 +_08138794: .4byte 0xfffffde0 +_08138798: .4byte _0813879C + .align 2, 0 +_0813879C: + .4byte _08138860 + .4byte _08138866 + .4byte _08138880 + .4byte _08138888 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _08138870 + .4byte _08138876 + .4byte _08138890 + .4byte _08138898 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388A0 + .4byte _081388A8 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388B0 + .4byte _081388B0 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388C0 +_08138860: + movs r2, 0x8C + lsls r2, 2 + b _081388B2 +_08138866: + ldr r2, _0813886C + b _081388B2 + .align 2, 0 +_0813886C: .4byte 0x00000231 +_08138870: + movs r2, 0x8E + lsls r2, 2 + b _081388B2 +_08138876: + ldr r2, _0813887C + b _081388B2 + .align 2, 0 +_0813887C: .4byte 0x00000239 +_08138880: + ldr r2, _08138884 + b _081388B2 + .align 2, 0 +_08138884: .4byte 0x00000232 +_08138888: + ldr r2, _0813888C + b _081388B2 + .align 2, 0 +_0813888C: .4byte 0x00000233 +_08138890: + ldr r2, _08138894 + b _081388B2 + .align 2, 0 +_08138894: .4byte 0x0000023a +_08138898: + ldr r2, _0813889C + b _081388B2 + .align 2, 0 +_0813889C: .4byte 0x0000023b +_081388A0: + ldr r2, _081388A4 + b _081388B2 + .align 2, 0 +_081388A4: .4byte 0x00000e42 +_081388A8: + ldr r2, _081388AC + b _081388B2 + .align 2, 0 +_081388AC: .4byte 0x00000e43 +_081388B0: + ldr r2, _081388BC +_081388B2: + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 + b _081388CA + .align 2, 0 +_081388BC: .4byte 0x0000021a +_081388C0: + ldr r2, _081388E0 + adds r0, r4, 0 + adds r1, r5, 0 + bl setmaptile_0 +_081388CA: + adds r4, 0x1 + cmp r4, 0xF + bgt _081388D2 + b _0813876E +_081388D2: + adds r5, r6, 0 + cmp r5, 0x17 + bgt _081388DA + b _0813876A +_081388DA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081388E0: .4byte 0x00000251 + thumb_func_end sub_8138750 + + thumb_func_start sub_81388E4 +sub_81388E4: @ 81388E4 + push {lr} + ldr r0, _08138904 + movs r1, 0 + strb r1, [r0] + ldr r0, _08138908 + strb r1, [r0] + movs r0, 0x2C + bl audio_play + ldr r0, _0813890C + movs r1, 0x8 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_08138904: .4byte 0x0203ab5c +_08138908: .4byte 0x0203ab5d +_0813890C: .4byte sub_8138910 + 1 + thumb_func_end sub_81388E4 + + thumb_func_start sub_8138910 +sub_8138910: @ 8138910 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08138958 + ldr r5, _0813895C + ldrb r1, [r5] + adds r0, r1, r0 + ldr r4, _08138960 + ldrb r2, [r4] + ldrb r0, [r0] + cmp r0, r2 + bne _0813896C + ldr r0, _08138964 + ldrb r0, [r0] + ldr r2, _08138968 + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + bl sub_8138978 + movs r0, 0 + strb r0, [r4] + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08138970 + adds r0, r6, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + b _08138970 + .align 2, 0 +_08138958: .4byte 0x085b2b78 +_0813895C: .4byte 0x0203ab5d +_08138960: .4byte 0x0203ab5c +_08138964: .4byte 0x020375e0 +_08138968: .4byte 0x085b2b7e +_0813896C: + adds r0, r2, 0x1 + strb r0, [r4] +_08138970: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8138910 + + thumb_func_start sub_8138978 +sub_8138978: @ 8138978 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r2, r1, 16 + movs r7, 0 + subs r0, 0x1 + cmp r0, 0x7 + bhi _08138A40 + lsls r0, 2 + ldr r1, _0813899C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813899C: .4byte _081389A0 + .align 2, 0 +_081389A0: + .4byte _081389C0 + .4byte _081389D2 + .4byte _081389E4 + .4byte _081389F6 + .4byte _08138A04 + .4byte _08138A1A + .4byte _08138A26 + .4byte _08138A34 +_081389C0: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x68 + b _08138A14 +_081389D2: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x4E + b _08138A14 +_081389E4: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x5B + b _08138A14 +_081389F6: + movs r7, 0x1 + mov r1, sp + movs r0, 0x7 + strh r0, [r1] + add r1, sp, 0x8 + movs r0, 0x27 + b _08138A3E +_08138A04: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x34 +_08138A14: + strh r0, [r1] + strh r0, [r1, 0x2] + b _08138A40 +_08138A1A: + movs r7, 0x1 + mov r0, sp + strh r7, [r0] + add r1, sp, 0x8 + movs r0, 0x41 + b _08138A3E +_08138A26: + movs r7, 0x1 + mov r1, sp + movs r0, 0x7 + strh r0, [r1] + add r1, sp, 0x8 + movs r0, 0xD + b _08138A3E +_08138A34: + movs r7, 0x1 + mov r0, sp + strh r7, [r0] + add r1, sp, 0x8 + movs r0, 0x1A +_08138A3E: + strh r0, [r1] +_08138A40: + movs r6, 0 + cmp r6, r7 + bcs _08138A92 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1, 0 + adds r1, r2, 0 + orrs r1, r0 + lsls r1, 16 + mov r9, r1 + adds r1, r2, 0 + adds r1, 0x8 + orrs r1, r0 + lsls r1, 16 + mov r8, r1 +_08138A5E: + lsls r1, r6, 1 + mov r3, sp + adds r5, r3, r1 + ldrh r0, [r5] + adds r0, 0x7 + add r4, sp, 0x8 + adds r4, r1 + ldrh r1, [r4] + adds r1, 0x7 + mov r3, r9 + lsrs r2, r3, 16 + bl setmaptile_0 + ldrh r0, [r5] + adds r0, 0x7 + ldrh r1, [r4] + adds r1, 0x8 + mov r3, r8 + lsrs r2, r3, 16 + bl setmaptile_0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r7 + bcc _08138A5E +_08138A92: + bl cur_mapdata_full_redraw + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8138978 + + thumb_func_start sub_8138AA4 +sub_8138AA4: @ 8138AA4 + push {lr} + ldr r0, _08138AB8 + ldrb r0, [r0] + ldr r1, _08138ABC + ldrh r1, [r1, 0x8] + bl sub_8138978 + pop {r0} + bx r0 + .align 2, 0 +_08138AB8: .4byte 0x020375e0 +_08138ABC: .4byte 0x085b2b7e + thumb_func_end sub_8138AA4 + + thumb_func_start sub_8138AC0 +sub_8138AC0: @ 8138AC0 + push {lr} + ldr r0, _08138ACC + bl box_related_two__2 + pop {r0} + bx r0 + .align 2, 0 +_08138ACC: .4byte 0x02021fc4 + thumb_func_end sub_8138AC0 + + thumb_func_start sub_8138AD0 +sub_8138AD0: @ 8138AD0 + ldr r1, _08138AE4 + ldr r0, _08138AE8 + ldr r2, [r0] + ldrh r0, [r2] + strh r0, [r1] + ldr r1, _08138AEC + ldrh r0, [r2, 0x2] + strh r0, [r1] + bx lr + .align 2, 0 +_08138AE4: .4byte 0x020375e0 +_08138AE8: .4byte 0x03005d8c +_08138AEC: .4byte 0x020375e2 + thumb_func_end sub_8138AD0 + + thumb_func_start sub_8138AF0 +sub_8138AF0: @ 8138AF0 + push {lr} + ldr r0, _08138B0C + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_08138B0C: .4byte 0x03005d90 + thumb_func_end sub_8138AF0 + + thumb_func_start sub_8138B10 +sub_8138B10: @ 8138B10 + push {lr} + ldr r0, _08138B28 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08138B34 + ldr r0, _08138B2C + ldr r1, _08138B30 + bl gf_strcpy + b _08138B3C + .align 2, 0 +_08138B28: .4byte 0x03005d90 +_08138B2C: .4byte 0x02021cc4 +_08138B30: .4byte 0x085eb5f9 +_08138B34: + ldr r0, _08138B40 + ldr r1, _08138B44 + bl gf_strcpy +_08138B3C: + pop {r0} + bx r0 + .align 2, 0 +_08138B40: .4byte 0x02021cc4 +_08138B44: .4byte 0x085eb601 + thumb_func_end sub_8138B10 + + thumb_func_start sub_8138B48 +sub_8138B48: @ 8138B48 + push {lr} + ldr r0, _08138B60 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08138B6C + ldr r0, _08138B64 + ldr r1, _08138B68 + bl gf_strcpy + b _08138B74 + .align 2, 0 +_08138B60: .4byte 0x03005d90 +_08138B64: .4byte 0x02021cc4 +_08138B68: .4byte 0x085eb60e +_08138B6C: + ldr r0, _08138B78 + ldr r1, _08138B7C + bl gf_strcpy +_08138B74: + pop {r0} + bx r0 + .align 2, 0 +_08138B78: .4byte 0x02021cc4 +_08138B7C: .4byte 0x085eb60a + thumb_func_end sub_8138B48 + + thumb_func_start sub_8138B80 +sub_8138B80: @ 8138B80 + ldr r0, _08138B88 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08138B88: .4byte 0x0202433a + thumb_func_end sub_8138B80 + + thumb_func_start sub_8138B8C +sub_8138B8C: @ 8138B8C + push {lr} + sub sp, 0x4 + ldr r0, _08138BAC + ldrh r0, [r0] + cmp r0, 0 + beq _08138BB0 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r3, 0x6 + bl warp1_set + b _08138BC2 + .align 2, 0 +_08138BAC: .4byte 0x020375e0 +_08138BB0: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x13 + movs r1, 0x1 + movs r3, 0x6 + bl warp1_set +_08138BC2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8138B8C + + thumb_func_start sub_8138BC8 +sub_8138BC8: @ 8138BC8 + push {lr} + ldr r0, _08138BD8 + ldrh r0, [r0] + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_08138BD8: .4byte 0x020375e0 + thumb_func_end sub_8138BC8 + + thumb_func_start sub_8138BDC +sub_8138BDC: @ 8138BDC + push {lr} + ldr r0, _08138BFC + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x7 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08138C00 + cmp r0, r1 + bls _08138BF6 + adds r0, r1, 0 +_08138BF6: + pop {r1} + bx r1 + .align 2, 0 +_08138BFC: .4byte 0x03005cf8 +_08138C00: .4byte 0x0000270f + thumb_func_end sub_8138BDC + + thumb_func_start sub_8138C04 +sub_8138C04: @ 8138C04 + push {r4,lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, _08138C28 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0xFF + bne _08138C2C + movs r0, 0x6 + b _08138C7E + .align 2, 0 +_08138C28: .4byte 0x020244ec +_08138C2C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08138C3C + movs r0, 0x5 + b _08138C7E +_08138C3C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0x95 + bls _08138C4C + movs r0, 0x4 + b _08138C7E +_08138C4C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0x63 + bls _08138C5C + movs r0, 0x3 + b _08138C7E +_08138C5C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0x31 + bls _08138C6C + movs r0, 0x2 + b _08138C7E +_08138C6C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0 + bne _08138C7C + movs r0, 0 + b _08138C7E +_08138C7C: + movs r0, 0x1 +_08138C7E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8138C04 + + thumb_func_start sub_8138C84 +sub_8138C84: @ 8138C84 + push {lr} + ldr r0, _08138C90 + bl sub_817018C + pop {r0} + bx r0 + .align 2, 0 +_08138C90: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_8138C84 + + thumb_func_start sub_8138C94 +sub_8138C94: @ 8138C94 + push {lr} + ldr r0, _08138CA0 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08138CA0: .4byte sub_8138C84 + 1 + thumb_func_end sub_8138C94 + + thumb_func_start sp0D9_ComputerRelated +sp0D9_ComputerRelated: @ 8138CA4 + push {r4,lr} + ldr r4, _08138CE0 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08138CD8 + adds r0, r4, 0 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08138CE4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r0, [r1, 0xA] + strh r2, [r1, 0xC] + strh r2, [r1, 0xE] + strh r2, [r1, 0x10] +_08138CD8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08138CE0: .4byte sub_8138CE8 + 1 +_08138CE4: .4byte 0x03005e00 + thumb_func_end sp0D9_ComputerRelated + + thumb_func_start sub_8138CE8 +sub_8138CE8: @ 8138CE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08138D0C + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08138D06 + adds r0, r1, 0 + bl sub_8138D10 +_08138D06: + pop {r0} + bx r0 + .align 2, 0 +_08138D0C: .4byte 0x03005e00 + thumb_func_end sub_8138CE8 + + thumb_func_start sub_8138D10 +sub_8138D10: @ 8138D10 + push {r4-r6,lr} + adds r4, r0, 0 + movs r6, 0 + movs r5, 0 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bne _08138D7C + strh r5, [r4, 0xE] + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x3 + beq _08138D44 + cmp r0, 0x3 + bgt _08138D3A + cmp r0, 0x2 + beq _08138D40 + b _08138D4C +_08138D3A: + cmp r1, 0x4 + beq _08138D48 + b _08138D4C +_08138D40: + movs r6, 0 + b _08138D4A +_08138D44: + movs r6, 0xFF + b _08138D4A +_08138D48: + movs r6, 0x1 +_08138D4A: + movs r5, 0xFF +_08138D4C: + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsls r1, r6, 24 + asrs r1, 24 + lsls r2, r5, 24 + asrs r2, 24 + bl sub_8138D88 + bl cur_mapdata_full_redraw + ldrh r0, [r4, 0x10] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08138D7C + ldrb r0, [r4, 0xA] + bl remove_task +_08138D7C: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8138D10 + + thumb_func_start sub_8138D88 +sub_8138D88: @ 8138D88 + push {r4,r5,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r3, 0 + lsls r0, 16 + cmp r0, 0 + beq _08138DC4 + ldr r0, _08138DA8 + ldrh r0, [r0] + cmp r0, 0 + bne _08138DAC + movs r3, 0x4 + b _08138DE6 + .align 2, 0 +_08138DA8: .4byte 0x020375e0 +_08138DAC: + cmp r0, 0x1 + bne _08138DB8 + ldr r3, _08138DB4 + b _08138DE6 + .align 2, 0 +_08138DB4: .4byte 0x0000025a +_08138DB8: + cmp r0, 0x2 + bne _08138DE6 + ldr r3, _08138DC0 + b _08138DE6 + .align 2, 0 +_08138DC0: .4byte 0x00000259 +_08138DC4: + ldr r0, _08138DD0 + ldrh r0, [r0] + cmp r0, 0 + bne _08138DD4 + movs r3, 0x5 + b _08138DE6 + .align 2, 0 +_08138DD0: .4byte 0x020375e0 +_08138DD4: + cmp r0, 0x1 + bne _08138DE0 + ldr r3, _08138DDC + b _08138DE6 + .align 2, 0 +_08138DDC: .4byte 0x0000027f +_08138DE0: + cmp r0, 0x2 + bne _08138DE6 + ldr r3, _08138E18 +_08138DE6: + ldr r0, _08138E1C + ldr r2, [r0] + movs r5, 0 + ldrsh r0, [r2, r5] + lsls r1, 24 + asrs r1, 24 + adds r0, r1 + adds r0, 0x7 + movs r5, 0x2 + ldrsh r1, [r2, r5] + lsls r2, r4, 24 + asrs r2, 24 + adds r1, r2 + adds r1, 0x7 + movs r4, 0xC0 + lsls r4, 4 + adds r2, r4, 0 + orrs r3, r2 + adds r2, r3, 0 + bl setmaptile_0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08138E18: .4byte 0x0000027e +_08138E1C: .4byte 0x03005d8c + thumb_func_end sub_8138D88 + + thumb_func_start sub_8138E20 +sub_8138E20: @ 8138E20 + push {lr} + bl sub_8138E2C + pop {r0} + bx r0 + thumb_func_end sub_8138E20 + + thumb_func_start sub_8138E2C +sub_8138E2C: @ 8138E2C + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + movs r4, 0 + bl player_get_direction__sp1AA + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x3 + beq _08138E56 + cmp r0, 0x3 + bgt _08138E4C + cmp r0, 0x2 + beq _08138E52 + b _08138E5E +_08138E4C: + cmp r1, 0x4 + beq _08138E5A + b _08138E5E +_08138E52: + movs r6, 0 + b _08138E5C +_08138E56: + movs r6, 0xFF + b _08138E5C +_08138E5A: + movs r6, 0x1 +_08138E5C: + movs r5, 0xFF +_08138E5E: + ldr r0, _08138E6C + ldrh r0, [r0] + cmp r0, 0 + bne _08138E70 + movs r4, 0x4 + b _08138E82 + .align 2, 0 +_08138E6C: .4byte 0x020375e0 +_08138E70: + cmp r0, 0x1 + bne _08138E7C + ldr r4, _08138E78 + b _08138E82 + .align 2, 0 +_08138E78: .4byte 0x0000025a +_08138E7C: + cmp r0, 0x2 + bne _08138E82 + ldr r4, _08138EB8 +_08138E82: + ldr r0, _08138EBC + ldr r2, [r0] + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r6, 24 + asrs r1, 24 + adds r0, r1 + adds r0, 0x7 + movs r3, 0x2 + ldrsh r1, [r2, r3] + lsls r2, r5, 24 + asrs r2, 24 + adds r1, r2 + adds r1, 0x7 + movs r3, 0xC0 + lsls r3, 4 + adds r2, r3, 0 + orrs r4, r2 + adds r2, r4, 0 + bl setmaptile_0 + bl cur_mapdata_full_redraw + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08138EB8: .4byte 0x00000259 +_08138EBC: .4byte 0x03005d8c + thumb_func_end sub_8138E2C + + thumb_func_start sub_8138EC0 +sub_8138EC0: @ 8138EC0 + push {r4,lr} + ldr r4, _08138EFC + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08138EF4 + adds r0, r4, 0 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08138F00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r0, [r1, 0xA] + strh r2, [r1, 0xC] + strh r2, [r1, 0xE] + strh r2, [r1, 0x10] +_08138EF4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08138EFC: .4byte sub_8138F04 + 1 +_08138F00: .4byte 0x03005e00 + thumb_func_end sub_8138EC0 + + thumb_func_start sub_8138F04 +sub_8138F04: @ 8138F04 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08138F28 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08138F22 + adds r0, r1, 0 + bl sub_8138F2C +_08138F22: + pop {r0} + bx r0 + .align 2, 0 +_08138F28: .4byte 0x03005e00 + thumb_func_end sub_8138F04 + + thumb_func_start sub_8138F2C +sub_8138F2C: @ 8138F2C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bne _08138F9A + movs r0, 0 + strh r0, [r4, 0xE] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08138F64 + ldr r2, _08138F5C + movs r0, 0x12 + movs r1, 0x8 + bl setmaptile_0 + ldr r2, _08138F60 + movs r0, 0x12 + movs r1, 0x9 + bl setmaptile_0 + b _08138F7A + .align 2, 0 +_08138F5C: .4byte 0x00000e9d +_08138F60: .4byte 0x00000ea5 +_08138F64: + ldr r2, _08138FA8 + movs r0, 0x12 + movs r1, 0x8 + bl setmaptile_0 + movs r2, 0xE6 + lsls r2, 4 + movs r0, 0x12 + movs r1, 0x9 + bl setmaptile_0 +_08138F7A: + bl cur_mapdata_full_redraw + ldrh r0, [r4, 0x10] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08138F9A + ldrb r0, [r4, 0xA] + bl remove_task +_08138F9A: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08138FA8: .4byte 0x00000e58 + thumb_func_end sub_8138F2C + + thumb_func_start sub_8138FAC +sub_8138FAC: @ 8138FAC + push {lr} + ldr r2, _08138FCC + movs r0, 0x12 + movs r1, 0x8 + bl setmaptile_0 + ldr r2, _08138FD0 + movs r0, 0x12 + movs r1, 0x9 + bl setmaptile_0 + bl cur_mapdata_full_redraw + pop {r0} + bx r0 + .align 2, 0 +_08138FCC: .4byte 0x00000e9d +_08138FD0: .4byte 0x00000ea5 + thumb_func_end sub_8138FAC + + thumb_func_start sub_8138FD4 +sub_8138FD4: @ 8138FD4 + push {lr} + ldr r1, _08138FE4 + ldr r0, _08138FE8 + strh r0, [r1] + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_08138FE4: .4byte 0x020375e0 +_08138FE8: .4byte 0x000001f5 + thumb_func_end sub_8138FD4 + + thumb_func_start sub_8138FEC +sub_8138FEC: @ 8138FEC + push {lr} + ldr r1, _08138FFC + ldr r0, _08139000 + strh r0, [r1] + bl flag_clear + pop {r0} + bx r0 + .align 2, 0 +_08138FFC: .4byte 0x020375e0 +_08139000: .4byte 0x000001f5 + thumb_func_end sub_8138FEC + + thumb_func_start sub_8139004 +sub_8139004: @ 8139004 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _08139024 + adds r0, r1 + movs r1, 0x16 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08139028 + movs r0, 0x1 + b _0813902A + .align 2, 0 +_08139024: .4byte 0x020244ec +_08139028: + movs r0, 0 +_0813902A: + pop {r1} + bx r1 + thumb_func_end sub_8139004 + + thumb_func_start sub_8139030 +sub_8139030: @ 8139030 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _08139050 + adds r0, r1 + movs r1, 0x17 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08139054 + movs r0, 0x1 + b _08139056 + .align 2, 0 +_08139050: .4byte 0x020244ec +_08139054: + movs r0, 0 +_08139056: + pop {r1} + bx r1 + thumb_func_end sub_8139030 + + thumb_func_start sub_813905C +sub_813905C: @ 813905C + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0813907C + adds r0, r1 + movs r1, 0x18 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08139080 + movs r0, 0x1 + b _08139082 + .align 2, 0 +_0813907C: .4byte 0x020244ec +_08139080: + movs r0, 0 +_08139082: + pop {r1} + bx r1 + thumb_func_end sub_813905C + + thumb_func_start sub_8139088 +sub_8139088: @ 8139088 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _081390A8 + adds r0, r1 + movs r1, 0x21 + bl pokemon_getattr + cmp r0, 0xC7 + bls _081390AC + movs r0, 0x1 + b _081390AE + .align 2, 0 +_081390A8: .4byte 0x020244ec +_081390AC: + movs r0, 0 +_081390AE: + pop {r1} + bx r1 + thumb_func_end sub_8139088 + + thumb_func_start sub_81390B4 +sub_81390B4: @ 81390B4 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _081390D4 + adds r0, r1 + movs r1, 0x2F + bl pokemon_getattr + cmp r0, 0xC7 + bls _081390D8 + movs r0, 0x1 + b _081390DA + .align 2, 0 +_081390D4: .4byte 0x020244ec +_081390D8: + movs r0, 0 +_081390DA: + pop {r1} + bx r1 + thumb_func_end sub_81390B4 + + thumb_func_start sub_81390E0 +sub_81390E0: @ 81390E0 + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08139130 +_081390E6: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08139134 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _0813913C + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0813913C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x6] + cmp r0, 0xC + beq _08139128 + ldrb r0, [r1, 0x7] + cmp r0, 0xC + bne _0813913C +_08139128: + ldr r1, _08139138 + movs r0, 0x1 + b _0813914A + .align 2, 0 +_08139130: .4byte 0x083203cc +_08139134: .4byte 0x020244ec +_08139138: .4byte 0x020375f0 +_0813913C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081390E6 + ldr r1, _08139154 + movs r0, 0 +_0813914A: + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08139154: .4byte 0x020375f0 + thumb_func_end sub_81390E0 + + thumb_func_start sub_8139158 +sub_8139158: @ 8139158 + push {lr} + sub sp, 0x8 + ldr r0, _081391A4 + ldr r0, [r0] + ldrh r3, [r0] + adds r3, 0x7 + lsls r3, 16 + asrs r3, 16 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x7 + movs r1, 0x8 + movs r2, 0x7F + bl sub_808DC44 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081391A8 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x1] + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x1] + ldrb r0, [r1, 0x4] + bl sub_808EEA8 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_081391A4: .4byte 0x03005d8c +_081391A8: .4byte 0x02037350 + thumb_func_end sub_8139158 + + thumb_func_start sp114_080CAA88 +sp114_080CAA88: @ 81391AC + push {lr} + bl sub_808BCDC + lsls r0, 24 + lsrs r0, 24 + bl sub_808EEA8 + ldr r0, _081391CC + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x7F + bl npc_hide_by_local_id_and_map + pop {r0} + bx r0 + .align 2, 0 +_081391CC: .4byte 0x03005d8c + thumb_func_end sp114_080CAA88 + + thumb_func_start sub_81391D0 +sub_81391D0: @ 81391D0 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _081391F8 + adds r0, r1 + bl get_nature + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081391FC + bl sub_8137068 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081391F8: .4byte 0x020244ec +_081391FC: .4byte 0x02021cc4 + thumb_func_end sub_81391D0 + + thumb_func_start sub_8139200 +sub_8139200: @ 8139200 + push {r4,lr} + ldr r4, _08139220 + ldr r0, _08139224 + bl var_get + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl GetMapName + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08139220: .4byte 0x02021cc4 +_08139224: .4byte 0x00004026 + thumb_func_end sub_8139200 + + thumb_func_start sub_8139228 +sub_8139228: @ 8139228 + push {lr} + movs r0, 0x20 + bl sub_80847F8 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8139228 + + thumb_func_start sub_8139238 +sub_8139238: @ 8139238 + push {lr} + ldr r0, _08139244 + bl sub_8165284 + pop {r0} + bx r0 + .align 2, 0 +_08139244: .4byte 0x02021cc4 + thumb_func_end sub_8139238 + + thumb_func_start sub_8139248 +sub_8139248: @ 8139248 + push {r4,r5,lr} + ldr r0, _0813927C + ldr r2, [r0] + ldr r1, _08139280 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 25 + ldr r0, _08139284 + adds r2, r0 + lsrs r1, 25 + ldrh r2, [r2] + adds r1, r2 + ldr r2, _08139288 + ldr r0, _0813928C + ldrh r0, [r0] + adds r0, r2 + ldrb r0, [r0] + adds r5, r1, r0 + movs r0, 0x2 + bl sub_80EF038 + lsls r0, 24 + cmp r0, 0 + bne _08139294 + ldr r4, _08139290 + b _08139296 + .align 2, 0 +_0813927C: .4byte 0x03005d8c +_08139280: .4byte 0x00002e68 +_08139284: .4byte 0x00002e6a +_08139288: .4byte 0x085b2b88 +_0813928C: .4byte 0x020375e0 +_08139290: .4byte 0x085b2b94 +_08139294: + ldr r4, _081392A8 +_08139296: + adds r0, r5, 0 + movs r1, 0xC + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081392A8: .4byte 0x085b2ba0 + thumb_func_end sub_8139248 + + thumb_func_start sub_81392AC +sub_81392AC: @ 81392AC + push {lr} + ldr r1, _081392C4 + ldr r0, _081392C8 + strh r0, [r1] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081392CC + movs r0, 0x1 + b _081392CE + .align 2, 0 +_081392C4: .4byte 0x020375e0 +_081392C8: .4byte 0x00000213 +_081392CC: + movs r0, 0 +_081392CE: + pop {r1} + bx r1 + thumb_func_end sub_81392AC + + thumb_func_start sub_81392D4 +sub_81392D4: @ 81392D4 + push {lr} + ldr r1, _081392EC + movs r0, 0x85 + lsls r0, 2 + strh r0, [r1] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081392F0 + movs r0, 0x1 + b _081392F2 + .align 2, 0 +_081392EC: .4byte 0x020375e0 +_081392F0: + movs r0, 0 +_081392F2: + pop {r1} + bx r1 + thumb_func_end sub_81392D4 + + thumb_func_start sub_81392F8 +sub_81392F8: @ 81392F8 + push {lr} + ldr r1, _08139310 + ldr r0, _08139314 + strh r0, [r1] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08139318 + movs r0, 0x1 + b _0813931A + .align 2, 0 +_08139310: .4byte 0x020375e0 +_08139314: .4byte 0x00000215 +_08139318: + movs r0, 0 +_0813931A: + pop {r1} + bx r1 + thumb_func_end sub_81392F8 + + thumb_func_start sub_8139320 +sub_8139320: @ 8139320 + push {lr} + ldr r1, _08139338 + ldr r0, _0813933C + strh r0, [r1] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08139340 + movs r0, 0x1 + b _08139342 + .align 2, 0 +_08139338: .4byte 0x020375e0 +_0813933C: .4byte 0x00000216 +_08139340: + movs r0, 0 +_08139342: + pop {r1} + bx r1 + thumb_func_end sub_8139320 + + thumb_func_start sub_8139348 +sub_8139348: @ 8139348 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0813936C + adds r0, r1 + movs r1, 0x47 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0813936C: .4byte 0x020244ec + thumb_func_end sub_8139348 + + thumb_func_start sub_8139370 +sub_8139370: @ 8139370 + push {r4,lr} + sub sp, 0x4 + movs r0, 0x2A + bl sav12_xor_increment + ldr r0, _081393C0 + bl flag_set + movs r1, 0x1 + mov r0, sp + strb r1, [r0] + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, _081393C4 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x47 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _081393B6 + adds r0, r4, 0 + movs r1, 0x47 + bl sub_80EE4DC +_081393B6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081393C0: .4byte 0x0000089b +_081393C4: .4byte 0x020244ec + thumb_func_end sub_8139370 + + thumb_func_start sub_81393C8 +sub_81393C8: @ 81393C8 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _081393EC + adds r0, r1 + bl sub_806DC8C + lsls r0, 16 + ldr r1, _081393F0 + cmp r0, r1 + bhi _081393F4 + movs r0, 0 + b _081393F6 + .align 2, 0 +_081393EC: .4byte 0x020244ec +_081393F0: .4byte 0x01fd0000 +_081393F4: + movs r0, 0x1 +_081393F6: + pop {r1} + bx r1 + thumb_func_end sub_81393C8 + + thumb_func_start sub_81393FC +sub_81393FC: @ 81393FC + push {lr} + movs r0, 0xC7 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08139454 + ldr r0, _0813942C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x83 + lsls r0, 3 + cmp r1, r0 + bne _08139454 + subs r0, 0x75 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08139434 + ldr r0, _08139430 + movs r1, 0x4 + b _08139446 + .align 2, 0 +_0813942C: .4byte 0x03005d8c +_08139430: .4byte 0x0000409a +_08139434: + movs r0, 0xE9 + lsls r0, 2 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08139454 + ldr r0, _08139450 + movs r1, 0x5 +_08139446: + bl var_set + movs r0, 0x1 + b _08139456 + .align 2, 0 +_08139450: .4byte 0x0000409a +_08139454: + movs r0, 0 +_08139456: + pop {r1} + bx r1 + thumb_func_end sub_81393FC + + thumb_func_start sub_813945C +sub_813945C: @ 813945C + push {lr} + ldr r0, _08139468 + bl flag_set + pop {r0} + bx r0 + .align 2, 0 +_08139468: .4byte 0x000008bf + thumb_func_end sub_813945C + + thumb_func_start sub_813946C +sub_813946C: @ 813946C + push {r4,r5,lr} + sub sp, 0x14 + ldr r5, _081394D4 + movs r1, 0x90 + lsls r1, 1 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0x7 + movs r3, 0x20 + bl create_pokemon_set_level + movs r1, 0x1 + add r0, sp, 0x10 + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0x2E + add r2, sp, 0x10 + bl pokemon_setattr + add r1, sp, 0x10 + movs r0, 0x21 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0xD + add r2, sp, 0x10 + bl pokemon_setattr + add r0, sp, 0x10 + strh r4, [r0] + adds r0, r5, 0 + movs r1, 0xE + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0xF + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0x10 + add r2, sp, 0x10 + bl pokemon_setattr + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081394D4: .4byte 0x020244ec + thumb_func_end sub_813946C + + thumb_func_start sub_81394D8 +sub_81394D8: @ 81394D8 + push {r4-r6,lr} + ldr r0, _08139514 + bl var_get + lsls r0, 16 + lsrs r0, 16 + bl sub_8133EDC + lsls r0, 16 + lsrs r6, r0, 16 + bl calc_player_party_count + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _08139526 +_081394FA: + movs r0, 0x64 + muls r0, r4 + ldr r1, _08139518 + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + cmp r0, r6 + bne _0813951C + movs r0, 0x1 + b _08139528 + .align 2, 0 +_08139514: .4byte 0x00004023 +_08139518: .4byte 0x020244ec +_0813951C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081394FA +_08139526: + movs r0, 0 +_08139528: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81394D8 + + thumb_func_start sub_8139530 +sub_8139530: @ 8139530 + push {lr} + bl sub_80D2218 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8139530 + + thumb_func_start sub_8139540 +sub_8139540: @ 8139540 + push {lr} + ldr r0, _08139554 + movs r1, 0x3F + bl sub_806DD7C + lsls r0, 24 + cmp r0, 0 + beq _08139558 + movs r0, 0x1 + b _0813955A + .align 2, 0 +_08139554: .4byte 0x020244ec +_08139558: + movs r0, 0 +_0813955A: + pop {r1} + bx r1 + thumb_func_end sub_8139540 + + thumb_func_start sub_8139560 +sub_8139560: @ 8139560 + push {lr} + ldr r0, _081395A4 + movs r1, 0x9 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081395A8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _081395AC + ldrh r0, [r0] + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, _081395B0 + ldrh r0, [r0] + strh r0, [r1, 0xC] + ldr r0, _081395B4 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, _081395B8 + ldrh r0, [r0] + strh r0, [r1, 0x10] + movs r0, 0 + bl sub_808A2C0 + movs r0, 0xD6 + bl audio_play + pop {r0} + bx r0 + .align 2, 0 +_081395A4: .4byte sub_81395BC + 1 +_081395A8: .4byte 0x03005e00 +_081395AC: .4byte 0x020375e2 +_081395B0: .4byte 0x020375e4 +_081395B4: .4byte 0x020375e6 +_081395B8: .4byte 0x020375e0 + thumb_func_end sub_8139560 + + thumb_func_start sub_81395BC +sub_81395BC: @ 81395BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0813961C + 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 _08139614 + 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 sub_808A2CC + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08139614 + adds r0, r5, 0 + bl sub_8139620 + bl sub_808A2E4 +_08139614: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813961C: .4byte 0x03005e08 + thumb_func_end sub_81395BC + + thumb_func_start sub_8139620 +sub_8139620: @ 8139620 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_8139620 + + thumb_func_start sub_8139634 +sub_8139634: @ 8139634 + push {lr} + movs r0, 0x95 + lsls r0, 2 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8139634 + + thumb_func_start sub_8139648 +sub_8139648: @ 8139648 + push {lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08139664 + movs r0, 0x14 + bl sub_80AED7C +_08139664: + pop {r0} + bx r0 + thumb_func_end sub_8139648 + + thumb_func_start sub_8139668 +sub_8139668: @ 8139668 + push {lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08139684 + movs r0, 0x15 + bl sub_80AED7C +_08139684: + pop {r0} + bx r0 + thumb_func_end sub_8139668 + + thumb_func_start sub_8139688 +sub_8139688: @ 8139688 + push {r4-r6,lr} + bl calc_player_party_count + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _081396D6 +_08139698: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081396C8 + 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 _081396CC + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _081396CC + adds r0, r5, 0 + b _081396D8 + .align 2, 0 +_081396C8: .4byte 0x020244ec +_081396CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _08139698 +_081396D6: + movs r0, 0 +_081396D8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8139688 + + thumb_func_start sub_81396E0 +sub_81396E0: @ 81396E0 + push {lr} + ldr r0, _08139700 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08139704 + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_08139700: .4byte 0x020375e0 +_08139704: .4byte 0x020244ec + thumb_func_end sub_81396E0 + + thumb_func_start nullsub_54 +nullsub_54: @ 8139708 + bx lr + thumb_func_end nullsub_54 + + thumb_func_start sub_813970C +sub_813970C: @ 813970C + push {r4,lr} + ldr r0, _0813972C + bl var_get + lsls r0, 16 + lsrs r0, 16 + adds r3, r0, 0 + ldr r2, _08139730 + movs r1, 0 + ldrsh r0, [r2, r1] + subs r0, r3 + cmp r0, 0x6 + ble _08139734 + movs r0, 0 + b _0813974C + .align 2, 0 +_0813972C: .4byte 0x000040c2 +_08139730: .4byte 0x03005cf8 +_08139734: + ldrh r1, [r2] + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r0, 0 + blt _0813974A + subs r1, r3 + movs r0, 0x7 + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + b _0813974C +_0813974A: + movs r0, 0x8 +_0813974C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813970C + + thumb_func_start sub_8139754 +sub_8139754: @ 8139754 + push {r4,lr} + ldr r0, _08139768 + ldr r4, _0813976C + ldrh r1, [r4] + bl var_set + ldrh r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08139768: .4byte 0x000040c2 +_0813976C: .4byte 0x03005cf8 + thumb_func_end sub_8139754 + + thumb_func_start sub_8139770 +sub_8139770: @ 8139770 + push {r4-r6,lr} + ldr r6, _081397AC + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, _081397B0 + adds r0, r4 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x2 + bne _081397A6 + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + ldr r4, _081397B4 + movs r1, 0x7 + adds r2, r4, 0 + bl pokemon_getattr + ldr r0, _081397B8 + ldr r0, [r0] + adds r1, r4, 0 + bl sub_8008C44 + cmp r0, 0 + beq _081397BC +_081397A6: + movs r0, 0x1 + b _081397BE + .align 2, 0 +_081397AC: .4byte 0x020375e0 +_081397B0: .4byte 0x020244ec +_081397B4: .4byte 0x02021cc4 +_081397B8: .4byte 0x03005d90 +_081397BC: + movs r0, 0 +_081397BE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8139770 + + thumb_func_start sub_81397C4 +sub_81397C4: @ 81397C4 + push {r4,r5,lr} + ldr r2, _081397D8 + ldrh r1, [r2] + ldr r0, _081397DC + cmp r1, r0 + bls _081397E0 + movs r0, 0 + bl sub_80EF340 + b _08139862 + .align 2, 0 +_081397D8: .4byte 0x020375f0 +_081397DC: .4byte 0x0000270f +_081397E0: + ldr r0, _081397F0 + cmp r1, r0 + bls _081397F8 + ldr r4, _081397F4 + movs r0, 0xA1 + strb r0, [r4] + adds r4, 0x1 + b _0813981C + .align 2, 0 +_081397F0: .4byte 0x000003e7 +_081397F4: .4byte 0x02021cc4 +_081397F8: + cmp r1, 0x63 + bls _0813980C + ldr r4, _08139808 + movs r0, 0xA1 + strb r0, [r4] + strb r0, [r4, 0x1] + adds r4, 0x2 + b _0813981C + .align 2, 0 +_08139808: .4byte 0x02021cc4 +_0813980C: + cmp r1, 0x9 + bls _0813983C + ldr r4, _08139838 + movs r0, 0xA1 + strb r0, [r4] + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + adds r4, 0x3 +_0813981C: + ldrh r5, [r2] + adds r0, r5, 0 + bl sub_80EF370 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl decimal_int_to_string + b _08139862 + .align 2, 0 +_08139838: .4byte 0x02021cc4 +_0813983C: + ldr r4, _08139868 + movs r0, 0xA1 + strb r0, [r4] + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + adds r4, 0x4 + ldrh r5, [r2] + adds r0, r5, 0 + bl sub_80EF370 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl decimal_int_to_string +_08139862: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08139868: .4byte 0x02021cc4 + thumb_func_end sub_81397C4 + + thumb_func_start sub_813986C +sub_813986C: @ 813986C + push {lr} + ldr r0, _08139880 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081398B8 + lsls r0, 2 + ldr r1, _08139884 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08139880: .4byte 0x020375f0 +_08139884: .4byte _08139888 + .align 2, 0 +_08139888: + .4byte _0813989C + .4byte _081398A0 + .4byte _081398A4 + .4byte _081398A8 + .4byte _081398AC +_0813989C: + movs r0, 0x3 + b _081398AE +_081398A0: + movs r0, 0x4 + b _081398AE +_081398A4: + movs r0, 0 + b _081398AE +_081398A8: + movs r0, 0x1 + b _081398AE +_081398AC: + movs r0, 0x2 +_081398AE: + bl mevent_081445C0 + lsls r0, 16 + lsrs r0, 16 + b _081398BA +_081398B8: + movs r0, 0 +_081398BA: + pop {r1} + bx r1 + thumb_func_end sub_813986C + + thumb_func_start sub_81398C0 +sub_81398C0: @ 81398C0 + push {r4,lr} + ldr r1, _081398D8 + ldr r2, _081398DC + adds r0, r2, 0 + ldrh r2, [r1] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x39 + bls _081398E0 + movs r0, 0 + b _081398FC + .align 2, 0 +_081398D8: .4byte 0x020375e0 +_081398DC: .4byte 0xfffffedf +_081398E0: + ldr r4, _08139904 + ldrh r0, [r1] + bl sub_81B6CFC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, _08139908 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0x1 +_081398FC: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08139904: .4byte 0x02021dc4 +_08139908: .4byte 0x0831977c + thumb_func_end sub_81398C0 + + thumb_func_start sub_813990C +sub_813990C: @ 813990C + push {r4,r5,lr} + bl calc_player_party_count + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _08139942 +_0813991C: + movs r0, 0x64 + muls r0, r4 + ldr r1, _08139934 + adds r0, r1 + movs r1, 0x4 + bl pokemon_getattr + cmp r0, 0x1 + bne _08139938 + movs r0, 0x1 + b _08139944 + .align 2, 0 +_08139934: .4byte 0x020244ec +_08139938: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0813991C +_08139942: + movs r0, 0 +_08139944: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_813990C + + thumb_func_start sub_813994C +sub_813994C: @ 813994C + push {lr} + ldr r0, _0813996C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _08139970 + cmp r1, r0 + bne _08139978 + ldr r0, _08139974 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _08139978 + movs r0, 0x1 + b _0813997A + .align 2, 0 +_0813996C: .4byte 0x03005d8c +_08139970: .4byte 0x00000f1a +_08139974: .4byte 0x000040ce +_08139978: + movs r0, 0 +_0813997A: + pop {r1} + bx r1 + thumb_func_end sub_813994C + + thumb_func_start sub_8139980 +sub_8139980: @ 8139980 + push {lr} + movs r0, 0 + bl sub_808A2C0 + movs r0, 0x8 + movs r1, 0 + bl sub_808A2CC + pop {r0} + bx r0 + thumb_func_end sub_8139980 + + thumb_func_start sub_8139994 +sub_8139994: @ 8139994 + push {lr} + ldr r0, _081399B0 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + subs r0, 0x10 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x5 + bhi _081399E4 + lsls r0, 2 + ldr r1, _081399B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081399B0: .4byte 0x03005d8c +_081399B4: .4byte _081399B8 + .align 2, 0 +_081399B8: + .4byte _081399E4 + .4byte _081399D0 + .4byte _081399D4 + .4byte _081399D8 + .4byte _081399DC + .4byte _081399E0 +_081399D0: + movs r1, 0x5 + b _081399E6 +_081399D4: + movs r1, 0x6 + b _081399E6 +_081399D8: + movs r1, 0x7 + b _081399E6 +_081399DC: + movs r1, 0x8 + b _081399E6 +_081399E0: + movs r1, 0xF + b _081399E6 +_081399E4: + movs r1, 0x4 +_081399E6: + ldr r0, _081399F0 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_081399F0: .4byte 0x00004043 + thumb_func_end sub_8139994 + + thumb_func_start sub_81399F4 +sub_81399F4: @ 81399F4 + push {r4,lr} + ldr r2, _08139A24 + movs r0, 0 + strh r0, [r2] + ldr r1, _08139A28 + strh r0, [r1] + ldr r0, _08139A2C + ldr r3, [r0] + movs r0, 0x14 + ldrsb r0, [r3, r0] + adds r4, r1, 0 + cmp r0, 0xD + bne _08139A6E + ldrb r0, [r3, 0x15] + subs r0, 0x10 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bhi _08139A6E + lsls r0, 2 + ldr r1, _08139A30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08139A24: .4byte 0x0203ab60 +_08139A28: .4byte 0x0203ab62 +_08139A2C: .4byte 0x03005d8c +_08139A30: .4byte _08139A34 + .align 2, 0 +_08139A34: + .4byte _08139A66 + .4byte _08139A5E + .4byte _08139A56 + .4byte _08139A4E + .4byte _08139A48 +_08139A48: + movs r0, 0 + strh r0, [r2] + b _08139A6C +_08139A4E: + movs r0, 0 + strh r0, [r2] + movs r0, 0x1 + b _08139A6C +_08139A56: + movs r0, 0 + strh r0, [r2] + movs r0, 0x2 + b _08139A6C +_08139A5E: + movs r0, 0 + strh r0, [r2] + movs r0, 0x3 + b _08139A6C +_08139A66: + movs r0, 0 + strh r0, [r2] + movs r0, 0x4 +_08139A6C: + strh r0, [r4] +_08139A6E: + ldrh r0, [r4] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81399F4 + + thumb_func_start sub_8139A78 +sub_8139A78: @ 8139A78 + push {r4-r6,lr} + ldr r0, _08139AB0 + movs r1, 0x9 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08139AB4 + adds r4, r1, r0 + movs r3, 0 + strh r3, [r4, 0x2] + strh r3, [r4, 0x4] + movs r6, 0x1 + strh r6, [r4, 0x8] + ldr r0, _08139AB8 + ldr r1, _08139ABC + ldrh r2, [r0] + ldrh r0, [r1] + cmp r2, r0 + bls _08139AC0 + subs r0, r2, r0 + lsls r0, 16 + lsrs r5, r0, 16 + strh r6, [r4, 0xC] + b _08139AC8 + .align 2, 0 +_08139AB0: .4byte sub_8139AF4 + 1 +_08139AB4: .4byte 0x03005e08 +_08139AB8: .4byte 0x020375e2 +_08139ABC: .4byte 0x020375e4 +_08139AC0: + subs r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + strh r3, [r4, 0xC] +_08139AC8: + cmp r5, 0x8 + bls _08139ACE + movs r5, 0x8 +_08139ACE: + ldr r0, _08139AF0 + adds r0, r5, r0 + ldrb r0, [r0] + strh r0, [r4, 0xA] + movs r0, 0 + bl sub_808A2C0 + ldrb r1, [r4, 0xC] + adds r0, r5, 0 + bl sub_8139C2C + movs r0, 0x59 + bl audio_play + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08139AF0: .4byte 0x085b2c18 + thumb_func_end sub_8139A78 + + thumb_func_start sub_8139AF4 +sub_8139AF4: @ 8139AF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08139B5C + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _08139B54 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + movs r2, 0x8 + ldrsh r1, [r4, r2] + movs r0, 0 + bl sub_808A2CC + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08139B54 + movs r0, 0x49 + bl audio_play + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + bl sub_808A2E4 +_08139B54: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08139B5C: .4byte 0x03005e08 + thumb_func_end sub_8139AF4 + + thumb_func_start sub_8139B60 +sub_8139B60: @ 8139B60 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + ldr r5, _08139BFC + ldr r0, _08139C00 + bl Window_AddFromTemplate + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r4, _08139C04 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl sub_81DB35C + adds r3, r0, 0 + ldrb r0, [r5] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + ldr r6, _08139C08 + ldr r4, _08139C0C + ldrh r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x40 + bl sub_81DB35C + adds r3, r0, 0 + ldrb r0, [r5] + ldrh r1, [r4] + lsls r1, 2 + adds r1, r6 + ldr r2, [r1] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x11 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + bl Print + ldrb r0, [r5] + bl Window_WriteStandardTileMap + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08139BFC: .4byte 0x0203ab5e +_08139C00: .4byte 0x085b2bac +_08139C04: .4byte 0x085eb6a5 +_08139C08: .4byte 0x085b2bb4 +_08139C0C: .4byte 0x020375e2 + thumb_func_end sub_8139B60 + + thumb_func_start sub_8139C10 +sub_8139C10: @ 8139C10 + push {r4,lr} + ldr r4, _08139C28 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08139C28: .4byte 0x0203ab5e + thumb_func_end sub_8139C10 + + thumb_func_start sub_8139C2C +sub_8139C2C: @ 8139C2C + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r4, _08139C74 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08139C6C + adds r0, r4, 0 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08139C78 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + strh r5, [r1, 0xC] + ldr r0, _08139C7C + adds r0, r6, r0 + ldrb r0, [r0] + strh r0, [r1, 0xE] +_08139C6C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08139C74: .4byte sub_8139C80 + 1 +_08139C78: .4byte 0x03005e00 +_08139C7C: .4byte 0x085b2c21 + thumb_func_end sub_8139C2C + + thumb_func_start sub_8139C80 +sub_8139C80: @ 8139C80 + 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] + lsls r0, 2 + ldr r1, [sp] + adds r0, r1 + lsls r0, 3 + ldr r1, _08139D08 + adds r6, r0, r1 + movs r2, 0x2 + ldrsh r0, [r6, r2] + cmp r0, 0x6 + bne _08139D7C + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08139D10 + movs r1, 0 + ldr r2, _08139D0C + mov r10, r2 +_08139CBA: + movs r5, 0 + adds r7, r1, 0x7 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r8, r2 + adds r0, r1 + lsls r0, 1 + mov r9, r0 +_08139CCA: + adds r4, r5, 0 + adds r4, 0x8 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 15 + add r0, r9 + add r0, r10 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 4 + adds r2, r1, 0 + orrs r2, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl setmaptile_0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _08139CCA + mov r2, r8 + lsls r0, r2, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _08139CBA + b _08139D62 + .align 2, 0 +_08139D08: .4byte 0x03005e08 +_08139D0C: .4byte 0x085b2bf4 +_08139D10: + movs r1, 0 + ldr r0, _08139D94 + mov r10, r0 +_08139D16: + movs r5, 0 + adds r7, r1, 0x7 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r8, r2 + adds r0, r1 + lsls r0, 1 + mov r9, r0 +_08139D26: + adds r4, r5, 0 + adds r4, 0x8 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 15 + add r0, r9 + add r0, r10 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 4 + adds r2, r1, 0 + orrs r2, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl setmaptile_0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _08139D26 + mov r2, r8 + lsls r0, r2, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _08139D16 +_08139D62: + bl cur_mapdata_full_redraw + movs r0, 0 + strh r0, [r6, 0x2] + movs r0, 0 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + cmp r1, r0 + bne _08139D7C + ldr r0, [sp] + bl remove_task +_08139D7C: + ldrh r0, [r6, 0x2] + adds r0, 0x1 + strh r0, [r6, 0x2] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08139D94: .4byte 0x085b2c06 + thumb_func_end sub_8139C80 + + thumb_func_start sub_8139D98 +sub_8139D98: @ 8139D98 + push {r4-r7,lr} + sub sp, 0x18 + ldr r6, _08139E40 + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, _08139E44 + adds r0, r4 + movs r1, 0x27 + bl pokemon_getattr + str r0, [sp] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x28 + bl pokemon_getattr + str r0, [sp, 0x4] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x29 + bl pokemon_getattr + str r0, [sp, 0x8] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x2A + bl pokemon_getattr + str r0, [sp, 0xC] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x2B + bl pokemon_getattr + str r0, [sp, 0x10] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x2C + bl pokemon_getattr + str r0, [sp, 0x14] + ldr r1, _08139E48 + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r2, r1, 0 +_08139E00: + lsls r0, r4, 2 + add r0, sp + ldr r1, [r0] + ldrh r0, [r2] + adds r0, r1 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _08139E00 + ldr r2, _08139E4C + movs r0, 0 + strh r0, [r2] + ldr r1, _08139E50 + ldr r0, [sp] + strh r0, [r1] + movs r4, 0x1 + adds r6, r2, 0 + adds r7, r1, 0 +_08139E28: + ldrh r0, [r6] + lsls r0, 2 + mov r2, sp + adds r1, r2, r0 + lsls r0, r4, 2 + adds r5, r2, r0 + ldr r1, [r1] + ldr r0, [r5] + cmp r1, r0 + bcs _08139E54 + strh r4, [r6] + b _08139E6C + .align 2, 0 +_08139E40: .4byte 0x020375e0 +_08139E44: .4byte 0x020244ec +_08139E48: .4byte 0x020375e2 +_08139E4C: .4byte 0x020375e4 +_08139E50: .4byte 0x020375e6 +_08139E54: + cmp r1, r0 + bne _08139E6E + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08139E6E + strh r4, [r6] + ldr r0, [r5] +_08139E6C: + strh r0, [r7] +_08139E6E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _08139E28 + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8139D98 + + thumb_func_start warp0_in_pokecenter +warp0_in_pokecenter: @ 8139E80 + push {r4,lr} + ldr r0, _08139EB0 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, _08139EB4 + ldrh r0, [r2] + ldr r1, _08139EB8 + cmp r0, r1 + beq _08139EC6 + adds r4, r1, 0 + adds r1, r2, 0 +_08139EA4: + ldrh r0, [r2] + cmp r0, r3 + bne _08139EBC + movs r0, 0x1 + b _08139EC8 + .align 2, 0 +_08139EB0: .4byte 0x020322dc +_08139EB4: .4byte 0x085b2c2a +_08139EB8: .4byte 0x0000ffff +_08139EBC: + adds r1, 0x2 + adds r2, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _08139EA4 +_08139EC6: + movs r0, 0 +_08139EC8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end warp0_in_pokecenter + + thumb_func_start sub_8139ED0 +sub_8139ED0: @ 8139ED0 + push {lr} + ldr r0, _08139EE4 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _08139EE8 + cmp r1, r0 + beq _08139EEC + movs r0, 0x1 + b _08139EEE + .align 2, 0 +_08139EE4: .4byte 0x03005d8c +_08139EE8: .4byte 0x00003c1a +_08139EEC: + movs r0, 0 +_08139EEE: + pop {r1} + bx r1 + thumb_func_end sub_8139ED0 + + thumb_func_start sub_8139EF4 +sub_8139EF4: @ 8139EF4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _08139F1C + bl var_get_pointer + adds r5, r0, 0 + ldrh r0, [r5] + adds r4, r0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0xA + bl __umodsi3 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08139F1C: .4byte 0x0000402f + thumb_func_end sub_8139EF4 + + thumb_func_start sub_8139F20 +sub_8139F20: @ 8139F20 + push {r4-r7,lr} + movs r4, 0 + ldr r0, _08139F40 + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x9 + bls _08139F34 + b _0813A03A +_08139F34: + lsls r0, r6, 2 + ldr r1, _08139F44 + adds r1, r0, r1 + ldr r1, [r1] + adds r2, r0, 0 + mov pc, r1 + .align 2, 0 +_08139F40: .4byte 0x0000402f +_08139F44: .4byte _08139F48 + .align 2, 0 +_08139F48: + .4byte _08139F70 + .4byte _08139F70 + .4byte _08139F70 + .4byte _08139F70 + .4byte _08139F94 + .4byte _08139FB4 + .4byte _08139FCC + .4byte _08139FE4 + .4byte _08139FFC + .4byte _0813A014 +_08139F70: + ldr r0, _08139F8C + ldr r0, [r0] + movs r3, 0xCE + lsls r3, 4 + adds r1, r0, r3 + adds r3, r1, r2 + ldr r1, _08139F90 + adds r0, r1 + adds r1, r0, r2 + ldrh r0, [r3] + ldrh r2, [r1] + cmp r0, r2 + bcs _0813A028 + b _0813A038 + .align 2, 0 +_08139F8C: .4byte 0x03005d90 +_08139F90: .4byte 0x00000ce2 +_08139F94: + ldr r0, _08139FAC + ldr r0, [r0] + ldr r3, _08139FB0 + adds r2, r0, r3 + adds r3, 0x2 +_08139F9E: + adds r1, r0, r3 + ldrh r0, [r2] + ldrh r3, [r1] + cmp r0, r3 + bcs _0813A028 + b _0813A038 + .align 2, 0 +_08139FAC: .4byte 0x03005d90 +_08139FB0: .4byte 0x00000d0c +_08139FB4: + ldr r0, _08139FC0 + ldr r0, [r0] + ldr r1, _08139FC4 + adds r2, r0, r1 + ldr r3, _08139FC8 + b _08139F9E + .align 2, 0 +_08139FC0: .4byte 0x03005d90 +_08139FC4: .4byte 0x00000de2 +_08139FC8: .4byte 0x00000de4 +_08139FCC: + ldr r0, _08139FD8 + ldr r0, [r0] + ldr r1, _08139FDC + adds r2, r0, r1 + ldr r3, _08139FE0 + b _08139F9E + .align 2, 0 +_08139FD8: .4byte 0x03005d90 +_08139FDC: .4byte 0x00000dc8 +_08139FE0: .4byte 0x00000dca +_08139FE4: + ldr r0, _08139FF0 + ldr r0, [r0] + ldr r1, _08139FF4 + adds r2, r0, r1 + ldr r3, _08139FF8 + b _08139F9E + .align 2, 0 +_08139FF0: .4byte 0x03005d90 +_08139FF4: .4byte 0x00000dda +_08139FF8: .4byte 0x00000ddc +_08139FFC: + ldr r0, _0813A008 + ldr r0, [r0] + ldr r1, _0813A00C + adds r2, r0, r1 + ldr r3, _0813A010 + b _08139F9E + .align 2, 0 +_0813A008: .4byte 0x03005d90 +_0813A00C: .4byte 0x00000e04 +_0813A010: .4byte 0x00000e06 +_0813A014: + ldr r0, _0813A02C + ldr r0, [r0] + ldr r1, _0813A030 + adds r2, r0, r1 + ldr r3, _0813A034 + adds r1, r0, r3 + ldrh r0, [r2] + ldrh r3, [r1] + cmp r0, r3 + bcc _0813A038 +_0813A028: + adds r4, r0, 0 + b _0813A03A + .align 2, 0 +_0813A02C: .4byte 0x03005d90 +_0813A030: .4byte 0x00000e1a +_0813A034: .4byte 0x00000e1c +_0813A038: + ldrh r4, [r1] +_0813A03A: + movs r2, 0 + ldr r5, _0813A078 + lsls r0, r6, 1 + adds r1, r0, r5 + ldrb r1, [r1] + adds r3, r0, 0 + ldr r7, _0813A07C + cmp r1, r4 + bcs _0813A062 + adds r1, r3, 0 +_0813A04E: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bhi _0813A062 + adds r0, r2, r1 + adds r0, r5 + ldrb r0, [r0] + cmp r0, r4 + bcc _0813A04E +_0813A062: + adds r0, r3, r6 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813A078: .4byte 0x085b2cc8 +_0813A07C: .4byte 0x085b2c50 + thumb_func_end sub_8139F20 + + thumb_func_start sub_813A080 +sub_813A080: @ 813A080 + push {r4-r7,lr} + ldr r0, _0813A0BC + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0813A0C0 + ldr r0, [r0] + ldr r1, _0813A0C4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + cmp r5, 0x2 + bne _0813A0D8 + movs r0, 0xA9 + lsls r0, 1 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _0813A0D8 + ldr r1, _0813A0C8 + movs r0, 0x5 + strh r0, [r1] + ldr r1, _0813A0CC + movs r0, 0x4 + strh r0, [r1] + b _0813A110 + .align 2, 0 +_0813A0BC: .4byte 0x000040ce +_0813A0C0: .4byte 0x03005d90 +_0813A0C4: .4byte 0x00000ca9 +_0813A0C8: .4byte 0x020375e2 +_0813A0CC: .4byte 0x020375e4 +_0813A0D0: + movs r0, 0x4 + strh r0, [r6] + adds r0, r3, 0x5 + b _0813A10E +_0813A0D8: + movs r3, 0 + ldr r6, _0813A118 + ldr r7, _0813A11C + lsls r1, r4, 1 + lsls r2, r5, 2 + ldr r4, _0813A120 + ldr r0, _0813A124 + ldr r0, [r0] + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] +_0813A0F4: + lsls r0, r3, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r1 + bhi _0813A0D0 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0813A0F4 + movs r0, 0x4 + strh r0, [r6] + movs r0, 0xC +_0813A10E: + strh r0, [r7] +_0813A110: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813A118: .4byte 0x020375e2 +_0813A11C: .4byte 0x020375e4 +_0813A120: .4byte 0x085b2cdc +_0813A124: .4byte 0x03005d90 + thumb_func_end sub_813A080 + + thumb_func_start sub_813A128 +sub_813A128: @ 813A128 + push {r4,lr} + ldr r0, _0813A158 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0813A15C + adds r3, r0, r1 + ldr r1, _0813A160 + ldrh r0, [r1] + strh r0, [r3, 0x1E] + ldrh r0, [r1] + cmp r0, 0xC + bls _0813A14E + b _0813A2C6 +_0813A14E: + lsls r0, 2 + ldr r1, _0813A164 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813A158: .4byte sub_813A2DC + 1 +_0813A15C: .4byte 0x03005e00 +_0813A160: .4byte 0x020375e0 +_0813A164: .4byte _0813A168 + .align 2, 0 +_0813A168: + .4byte _0813A19C + .4byte _0813A1AA + .4byte _0813A1C2 + .4byte _0813A1D6 + .4byte _0813A1F0 + .4byte _0813A208 + .4byte _0813A222 + .4byte _0813A23C + .4byte _0813A25A + .4byte _0813A274 + .4byte _0813A274 + .4byte _0813A28E + .4byte _0813A2A8 +_0813A19C: + movs r1, 0 + movs r0, 0x1 + strh r0, [r3, 0x8] + strh r0, [r3, 0xA] + strh r0, [r3, 0xC] + strh r0, [r3, 0xE] + b _0813A2BC +_0813A1AA: + movs r1, 0 + movs r0, 0x5 + strh r0, [r3, 0x8] + movs r0, 0x8 + strh r0, [r3, 0xA] + movs r0, 0x1 + strh r0, [r3, 0xC] + strh r0, [r3, 0xE] + movs r0, 0x9 + strh r0, [r3, 0x10] + movs r0, 0xA + b _0813A2BE +_0813A1C2: + movs r2, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r1, 0xC + strh r1, [r3, 0xA] + movs r0, 0x1 + strh r0, [r3, 0xC] + strh r0, [r3, 0xE] + movs r0, 0x7 + b _0813A250 +_0813A1D6: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xB + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A1F0: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A208: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0x7 + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A222: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xA + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A23C: + movs r2, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r1, 0xC + strh r1, [r3, 0xA] + movs r0, 0xF + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xE +_0813A250: + strh r0, [r3, 0x10] + strh r1, [r3, 0x12] + strh r2, [r3, 0x14] + strh r4, [r3, 0x26] + b _0813A2D2 +_0813A25A: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xA + strh r0, [r3, 0xA] + movs r0, 0x11 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xB + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A274: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xB + strh r0, [r3, 0xA] + movs r0, 0xF + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xE + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A28E: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0x7 + strh r0, [r3, 0xA] + movs r0, 0x13 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xA + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A2A8: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0x7 + strh r0, [r3, 0xA] + movs r0, 0x11 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xC +_0813A2BC: + strh r0, [r3, 0x10] +_0813A2BE: + strh r0, [r3, 0x12] + strh r1, [r3, 0x14] + strh r4, [r3, 0x26] + b _0813A2D2 +_0813A2C6: + ldr r1, _0813A2D8 + movs r0, 0x7F + strh r0, [r1] + adds r0, r4, 0 + bl remove_task +_0813A2D2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813A2D8: .4byte 0x020375f0 + thumb_func_end sub_813A128 + + thumb_func_start sub_813A2DC +sub_813A2DC: @ 813A2DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0813A408 + adds r6, r0, r1 + bl script_env_2_enable + ldr r0, _0813A40C + movs r5, 0 + strh r5, [r0] + ldr r1, _0813A410 + movs r0, 0x40 + strb r0, [r1] + ldrh r0, [r6, 0x1E] + movs r1, 0 + bl sub_813AA60 + ldrb r0, [r6, 0x1E] + movs r1, 0 + bl sub_813ACE8 + ldr r4, _0813A414 + movs r1, 0xA + ldrsh r0, [r6, r1] + lsls r0, 3 + bl malloc_and_clear + str r0, [r4] + ldr r0, _0813A418 + strh r5, [r0] + bl sub_813A42C + movs r3, 0 + movs r4, 0 + movs r2, 0xA + ldrsh r0, [r6, r2] + add r1, sp, 0x18 + mov r8, r1 + cmp r3, r0 + bge _0813A36A + ldr r5, _0813A41C +_0813A33A: + lsls r1, r4, 2 + ldr r0, _0813A420 + ldrh r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r5 + ldr r0, [r1] + ldr r1, _0813A414 + ldr r2, [r1] + lsls r1, r4, 3 + adds r1, r2 + str r0, [r1] + str r4, [r1, 0x4] + adds r1, r3, 0 + bl display_text_and_get_width + adds r3, r0, 0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0xA + ldrsh r0, [r6, r2] + cmp r4, r0 + blt _0813A33A +_0813A36A: + adds r0, r3, 0 + bl convert_pixel_width_to_tile_width + strh r0, [r6, 0x10] + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r2, 0x10 + ldrsh r1, [r6, r2] + adds r0, r1 + cmp r0, 0x1D + ble _0813A38C + movs r0, 0x1D + subs r0, r1 + cmp r0, 0 + bge _0813A38A + movs r0, 0 +_0813A38A: + strh r0, [r6, 0xC] +_0813A38C: + ldrb r2, [r6, 0xC] + ldrb r3, [r6, 0xE] + ldrb r0, [r6, 0x10] + str r0, [sp] + ldrb r0, [r6, 0x12] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + 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] + mov r0, r8 + bl Window_AddFromTemplate + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r4, _0813A424 + ldrh r0, [r6, 0xA] + strh r0, [r4, 0xC] + ldrh r0, [r6, 0x8] + strh r0, [r4, 0xE] + ldrh r0, [r6, 0x22] + strb r0, [r4, 0x10] + adds r0, r7, 0 + bl sub_813A694 + ldrh r1, [r6, 0x16] + ldrh r2, [r6, 0x18] + adds r0, r4, 0 + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x24] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0813A408 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _0813A428 + str r1, [r0] + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813A408: .4byte 0x03005e00 +_0813A40C: .4byte 0x0203ab68 +_0813A410: .4byte 0x0203ab6c +_0813A414: .4byte 0x0203ab64 +_0813A418: .4byte 0x0203ab6a +_0813A41C: .4byte 0x085b2cf0 +_0813A420: .4byte 0x020375e0 +_0813A424: .4byte 0x030061d0 +_0813A428: .4byte sub_813A4EC + 1 + thumb_func_end sub_813A2DC + + thumb_func_start sub_813A42C +sub_813A42C: @ 813A42C + ldr r1, _0813A460 + ldr r0, _0813A464 + ldr r0, [r0] + str r0, [r1] + ldr r0, _0813A468 + str r0, [r1, 0x4] + movs r0, 0 + str r0, [r1, 0x8] + movs r2, 0 + movs r0, 0x1 + strh r0, [r1, 0xC] + strh r0, [r1, 0xE] + strb r2, [r1, 0x10] + strb r2, [r1, 0x11] + movs r0, 0x8 + strb r0, [r1, 0x12] + strb r2, [r1, 0x13] + movs r0, 0x21 + strb r0, [r1, 0x14] + movs r0, 0x31 + strb r0, [r1, 0x15] + movs r0, 0 + strb r0, [r1, 0x16] + movs r0, 0x1 + strb r0, [r1, 0x17] + bx lr + .align 2, 0 +_0813A460: .4byte 0x030061d0 +_0813A464: .4byte 0x0203ab64 +_0813A468: .4byte sub_813A46C + 1 + thumb_func_end sub_813A42C + + thumb_func_start sub_813A46C +sub_813A46C: @ 813A46C + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0x5 + bl audio_play + ldr r0, _0813A4DC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0813A4D4 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0813A4E0 + adds r4, r0 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + bl get_coro_args_x18_x1A + ldr r1, _0813A4E4 + mov r0, sp + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_81AE838 + ldrh r0, [r4, 0x1E] + ldr r5, _0813A4E8 + ldrh r1, [r5] + bl sub_813AC44 + ldrh r0, [r4, 0x1E] + mov r1, sp + ldrh r1, [r1] + bl sub_813AA60 + ldrb r0, [r4, 0x1E] + mov r1, sp + ldrh r1, [r1] + bl sub_813AD34 + mov r0, sp + ldrh r0, [r0] + strh r0, [r5] +_0813A4D4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813A4DC: .4byte sub_813A4EC + 1 +_0813A4E0: .4byte 0x03005e00 +_0813A4E4: .4byte 0x0203ab68 +_0813A4E8: .4byte 0x0203ab6a + thumb_func_end sub_813A46C + + thumb_func_start sub_813A4EC +sub_813A4EC: @ 813A4EC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0813A518 + adds r6, r0, r1 + ldrh r0, [r6, 0x24] + lsls r0, 24 + lsrs r0, 24 + bl sub_81AE604 + adds r4, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0813A51C + adds r0, 0x1 + cmp r4, r0 + bne _0813A530 + b _0813A566 + .align 2, 0 +_0813A518: .4byte 0x03005e00 +_0813A51C: + ldr r1, _0813A52C + movs r0, 0x7F + strh r0, [r1] + movs r0, 0x5 + bl audio_play + b _0813A54C + .align 2, 0 +_0813A52C: .4byte 0x020375f0 +_0813A530: + ldr r0, _0813A554 + strh r4, [r0] + movs r0, 0x5 + bl audio_play + movs r1, 0x14 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0813A54C + movs r1, 0xA + ldrsh r0, [r6, r1] + subs r0, 0x1 + cmp r4, r0 + bne _0813A558 +_0813A54C: + adds r0, r5, 0 + bl sub_813A570 + b _0813A566 + .align 2, 0 +_0813A554: .4byte 0x020375f0 +_0813A558: + adds r0, r5, 0 + bl sub_813A738 + ldr r0, _0813A56C + str r0, [r6] + bl script_env_2_enable_and_set_ctx_running +_0813A566: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813A56C: .4byte sub_813A600 + 1 + thumb_func_end sub_813A4EC + + thumb_func_start sub_813A570 +sub_813A570: @ 813A570 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _0813A5F8 + adds r4, r0 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_81AE838 + ldrh r0, [r4, 0x1E] + mov r1, sp + ldrh r1, [r1] + bl sub_813AC44 + adds r0, r5, 0 + bl sub_813A738 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, _0813A5FC + ldr r0, [r0] + bl free + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8198070 + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl Window_CopyToVram + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813A5F8: .4byte 0x03005e00 +_0813A5FC: .4byte 0x0203ab64 + thumb_func_end sub_813A570 + + thumb_func_start sub_813A600 +sub_813A600: @ 813A600 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813A628 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x14 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0813A624 + cmp r0, 0x2 + bne _0813A624 + movs r0, 0x1 + strh r0, [r1, 0x14] + ldr r0, _0813A62C + str r0, [r1] +_0813A624: + pop {r0} + bx r0 + .align 2, 0 +_0813A628: .4byte 0x03005e00 +_0813A62C: .4byte sub_813A664 + 1 + thumb_func_end sub_813A600 + + thumb_func_start sub_813A630 +sub_813A630: @ 813A630 + push {lr} + ldr r0, _0813A648 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _0813A64C + bl script_env_2_enable_and_set_ctx_running + b _0813A65C + .align 2, 0 +_0813A648: .4byte sub_813A600 + 1 +_0813A64C: + ldr r0, _0813A660 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + strh r0, [r1, 0x14] +_0813A65C: + pop {r0} + bx r0 + .align 2, 0 +_0813A660: .4byte 0x03005e00 + thumb_func_end sub_813A630 + + thumb_func_start sub_813A664 +sub_813A664: @ 813A664 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + adds r0, r4, 0 + bl sub_813A694 + ldr r1, _0813A68C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0813A690 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813A68C: .4byte 0x03005e00 +_0813A690: .4byte sub_813A4EC + 1 + thumb_func_end sub_813A664 + + thumb_func_start sub_813A694 +sub_813A694: @ 813A694 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0813A72C + adds r4, r1, r0 + mov r1, sp + ldr r0, _0813A730 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0x8 + ldrsh r1, [r4, r0] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + beq _0813A724 + mov r2, sp + movs r3, 0x10 + ldrsh r1, [r4, r3] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + lsls r1, 3 + adds r1, 0xC + movs r5, 0xC + ldrsh r0, [r4, r5] + subs r0, 0x1 + lsls r0, 3 + adds r1, r0 + movs r3, 0 + strb r1, [r2, 0x1] + mov r1, sp + movs r0, 0x8 + strb r0, [r1, 0x2] + movs r0, 0x10 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + lsls r1, 3 + adds r1, 0xC + movs r5, 0xC + ldrsh r0, [r4, r5] + subs r0, 0x1 + lsls r0, 3 + adds r1, r0 + strb r1, [r2, 0x4] + mov r1, sp + movs r2, 0x12 + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, 0xA + strb r0, [r1, 0x5] + mov r0, sp + strh r3, [r0, 0x6] + mov r2, sp + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + subs r0, r1 + strh r0, [r2, 0x8] + ldr r1, _0813A734 + mov r0, sp + bl sub_81AF380 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] +_0813A724: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813A72C: .4byte 0x03005e00 +_0813A730: .4byte 0x085b3030 +_0813A734: .4byte 0x0203ab68 + thumb_func_end sub_813A694 + + thumb_func_start sub_813A738 +sub_813A738: @ 813A738 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0813A764 + adds r2, r1, r0 + movs r0, 0x8 + ldrsh r1, [r2, r0] + movs r3, 0xA + ldrsh r0, [r2, r3] + cmp r1, r0 + beq _0813A75E + ldrh r0, [r2, 0x20] + lsls r0, 24 + lsrs r0, 24 + bl sub_81AF620 +_0813A75E: + pop {r0} + bx r0 + .align 2, 0 +_0813A764: .4byte 0x03005e00 + thumb_func_end sub_813A738 + + thumb_func_start nullsub_55 +nullsub_55: @ 813A768 + bx lr + thumb_func_end nullsub_55 + + thumb_func_start sub_813A76C +sub_813A76C: @ 813A76C + push {r4-r6,lr} + movs r4, 0 + ldr r6, _0813A794 + ldr r0, _0813A798 + adds r5, r0, 0 +_0813A776: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x13] + cmp r0, 0 + bne _0813A79C + subs r0, r5, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl var_set + b _0813A7A8 + .align 2, 0 +_0813A794: .4byte 0x020229e8 +_0813A798: .4byte 0x0000401f +_0813A79C: + subs r0, r5, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x69 + bl var_set +_0813A7A8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0813A776 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_813A76C + + thumb_func_start sub_813A7B8 +sub_813A7B8: @ 813A7B8 + push {lr} + ldr r1, _0813A7E8 + ldrh r0, [r1] + cmp r0, 0x5 + bls _0813A7C6 + movs r0, 0 + strh r0, [r1] +_0813A7C6: + ldrh r1, [r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0813A7EC + adds r0, r1 + bl get_nature + lsls r0, 24 + ldr r1, _0813A7F0 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + pop {r0} + bx r0 + .align 2, 0 +_0813A7E8: .4byte 0x020375e0 +_0813A7EC: .4byte 0x020244ec +_0813A7F0: .4byte 0x085b3040 + thumb_func_end sub_813A7B8 + + thumb_func_start sub_813A7F4 +sub_813A7F4: @ 813A7F4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0813A81C + bl var_get_pointer + adds r5, r0, 0 + ldrh r0, [r5] + adds r4, r0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0xC + bl __umodsi3 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813A81C: .4byte 0x00004030 + thumb_func_end sub_813A7F4 + + thumb_func_start sub_813A820 +sub_813A820: @ 813A820 + push {r4,lr} + ldr r0, _0813A848 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, _0813A84C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + ldr r0, _0813A850 + adds r1, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813A848: .4byte 0x00004030 +_0813A84C: .4byte 0x085b30a4 +_0813A850: .4byte 0x00004031 + thumb_func_end sub_813A820 + + thumb_func_start sub_813A854 +sub_813A854: @ 813A854 + push {r4,lr} + ldr r4, _0813A870 + ldr r0, _0813A874 + bl var_get + lsls r0, 16 + lsrs r0, 14 + adds r0, r4 + ldr r0, [r0] + bl box_related_two__2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813A870: .4byte 0x085b30d4 +_0813A874: .4byte 0x00004031 + thumb_func_end sub_813A854 + + thumb_func_start sub_813A878 +sub_813A878: @ 813A878 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _0813A8D4 + bl var_get + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, _0813A8D8 + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _0813A8DC + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, _0813A8E0 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0813A8F0 + ldr r1, _0813A8E4 + lsls r0, r6, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r5, 8 + adds r0, r7 + cmp r1, r0 + bne _0813A8F0 + mov r0, r8 + cmp r0, 0 + beq _0813A8E8 + adds r0, r4, 0 + movs r1, 0x2 + bl var_set + b _0813A8F0 + .align 2, 0 +_0813A8D4: .4byte 0x000040ce +_0813A8D8: .4byte 0x00004031 +_0813A8DC: .4byte 0x000040cf +_0813A8E0: .4byte 0x00004033 +_0813A8E4: .4byte 0x085b3104 +_0813A8E8: + adds r0, r4, 0 + movs r1, 0x3 + bl var_set +_0813A8F0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_813A878 + + thumb_func_start sub_813A8FC +sub_813A8FC: @ 813A8FC + push {lr} + sub sp, 0x2C + ldr r0, _0813A948 + ldr r0, [r0] + ldr r1, _0813A94C + adds r0, r1 + ldrh r1, [r0] + add r0, sp, 0xC + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r1, _0813A950 + bl gf_strcpy + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x30 + bl sub_81DB368 + adds r3, r0, 0 + ldr r0, _0813A954 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + add sp, 0x2C + pop {r0} + bx r0 + .align 2, 0 +_0813A948: .4byte 0x03005d90 +_0813A94C: .4byte 0x00000eb8 +_0813A950: .4byte 0x085eb6ad +_0813A954: .4byte 0x0203ab6d + thumb_func_end sub_813A8FC + + thumb_func_start sub_813A958 +sub_813A958: @ 813A958 + push {r4,lr} + ldr r4, _0813A980 + ldr r0, _0813A984 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl SetStandardWindowBorderStyle + bl sub_813A8FC + ldrb r0, [r4] + movs r1, 0x2 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813A980: .4byte 0x0203ab6d +_0813A984: .4byte 0x085b311c + thumb_func_end sub_813A958 + + thumb_func_start sub_813A988 +sub_813A988: @ 813A988 + push {r4,lr} + ldr r4, _0813A9A0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813A9A0: .4byte 0x0203ab6d + thumb_func_end sub_813A988 + + thumb_func_start sub_813A9A4 +sub_813A9A4: @ 813A9A4 + push {lr} + ldr r0, _0813A9BC + ldr r0, [r0] + ldr r2, _0813A9C0 + adds r1, r0, r2 + ldr r0, _0813A9C4 + ldrh r2, [r1] + ldrh r0, [r0] + cmp r2, r0 + bcs _0813A9C8 + movs r0, 0 + b _0813A9CA + .align 2, 0 +_0813A9BC: .4byte 0x03005d90 +_0813A9C0: .4byte 0x00000eb8 +_0813A9C4: .4byte 0x020375e0 +_0813A9C8: + subs r0, r2, r0 +_0813A9CA: + strh r0, [r1] + pop {r0} + bx r0 + thumb_func_end sub_813A9A4 + + thumb_func_start sub_813A9D0 +sub_813A9D0: @ 813A9D0 + push {lr} + ldr r0, _0813A9EC + ldr r0, [r0] + ldr r1, _0813A9F0 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, _0813A9F4 + ldrh r0, [r0] + adds r1, r0 + ldr r0, _0813A9F8 + cmp r1, r0 + ble _0813A9FC + strh r0, [r2] + b _0813A9FE + .align 2, 0 +_0813A9EC: .4byte 0x03005d90 +_0813A9F0: .4byte 0x00000eb8 +_0813A9F4: .4byte 0x020375e0 +_0813A9F8: .4byte 0x0000270f +_0813A9FC: + strh r1, [r2] +_0813A9FE: + pop {r0} + bx r0 + thumb_func_end sub_813A9D0 + + thumb_func_start sub_813AA04 +sub_813AA04: @ 813AA04 + ldr r0, _0813AA10 + ldr r0, [r0] + ldr r1, _0813AA14 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_0813AA10: .4byte 0x03005d90 +_0813AA14: .4byte 0x00000eb8 + thumb_func_end sub_813AA04 + + thumb_func_start sub_813AA18 +sub_813AA18: @ 813AA18 + push {r4,lr} + ldr r4, _0813AA3C + ldr r0, _0813AA40 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4] + movs r1, 0x2 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813AA3C: .4byte 0x0203ab6e +_0813AA40: .4byte 0x085b3124 + thumb_func_end sub_813AA18 + + thumb_func_start sub_813AA44 +sub_813AA44: @ 813AA44 + push {r4,lr} + ldr r4, _0813AA5C + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813AA5C: .4byte 0x0203ab6e + thumb_func_end sub_813AA44 + + thumb_func_start sub_813AA60 +sub_813AA60: @ 813AA60 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + lsrs r4, r0, 16 + ldr r1, _0813AA9C + adds r0, r1 + lsrs r0, 16 + cmp r0, 0x3 + bls _0813AA78 + b _0813ABC2 +_0813AA78: + movs r0, 0xD8 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + movs r3, 0 + bl Window_FillPixelRect + cmp r4, 0x4 + beq _0813AAE8 + cmp r4, 0x4 + bgt _0813AAA0 + cmp r4, 0x3 + beq _0813AAAA + b _0813ABC2 + .align 2, 0 +_0813AA9C: .4byte 0xfffd0000 +_0813AAA0: + cmp r4, 0x5 + beq _0813AB5C + cmp r4, 0x6 + beq _0813AB94 + b _0813ABC2 +_0813AAAA: + ldr r1, _0813AADC + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl text_box_related_one + ldr r1, _0813AAE0 + lsls r0, r5, 1 + adds r1, r0, r1 + ldrh r5, [r1] + ldr r0, _0813AAE4 + cmp r5, r0 + beq _0813AB18 + b _0813AB2C + .align 2, 0 +_0813AADC: .4byte 0x085b3170 +_0813AAE0: .4byte 0x085b312c +_0813AAE4: .4byte 0x0000ffff +_0813AAE8: + ldr r1, _0813AB20 + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + 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 text_box_related_one + ldr r1, _0813AB24 + lsls r0, r5, 1 + adds r1, r0, r1 + ldrh r5, [r1] + ldr r0, _0813AB28 + cmp r5, r0 + bne _0813AB2C +_0813AB18: + ldrh r0, [r1] + bl sub_813ABD4 + b _0813ABC2 + .align 2, 0 +_0813AB20: .4byte 0x085b319c +_0813AB24: .4byte 0x085b3142 +_0813AB28: .4byte 0x0000ffff +_0813AB2C: + ldr r4, _0813AB54 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + lsls r0, r5, 24 + lsrs r0, 24 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x21 + movs r2, 0x58 + movs r3, 0 + bl sub_81295CC + ldr r1, _0813AB58 + strb r0, [r1] + b _0813ABC2 + .align 2, 0 +_0813AB54: .4byte 0x0000157c +_0813AB58: .4byte 0x0203ab6c +_0813AB5C: + ldr r1, _0813AB8C + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + 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 text_box_related_one + ldr r1, _0813AB90 + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + bl sub_813ABD4 + b _0813ABC2 + .align 2, 0 +_0813AB8C: .4byte 0x085b31b4 +_0813AB90: .4byte 0x085b314e +_0813AB94: + ldr r1, _0813ABCC + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + 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 text_box_related_one + ldr r1, _0813ABD0 + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + bl sub_813ABD4 +_0813ABC2: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813ABCC: .4byte 0x085b31d0 +_0813ABD0: .4byte 0x085b315c + thumb_func_end sub_813AA60 + + thumb_func_start sub_813ABD4 +sub_813ABD4: @ 813ABD4 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r4, _0813AC38 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl AddItemIconObject + ldr r4, _0813AC3C + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0813AC32 + ldr r3, _0813AC40 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x24 + strh r1, [r0, 0x20] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x5C + strh r1, [r0, 0x22] +_0813AC32: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813AC38: .4byte 0x0000157c +_0813AC3C: .4byte 0x0203ab6c +_0813AC40: .4byte 0x02020630 + thumb_func_end sub_813ABD4 + + thumb_func_start sub_813AC44 +sub_813AC44: @ 813AC44 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, _0813AC74 + ldrb r0, [r2] + cmp r0, 0x40 + beq _0813AC70 + cmp r1, 0x6 + bgt _0813AC6A + cmp r1, 0x3 + blt _0813AC6A + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0813AC78 + adds r0, r1 + bl obj_delete_and_free_resources +_0813AC6A: + ldr r1, _0813AC74 + movs r0, 0x40 + strb r0, [r1] +_0813AC70: + pop {r0} + bx r0 + .align 2, 0 +_0813AC74: .4byte 0x0203ab6c +_0813AC78: .4byte 0x02020630 + thumb_func_end sub_813AC44 + + thumb_func_start sub_813AC7C +sub_813AC7C: @ 813AC7C + push {lr} + ldr r0, _0813ACA4 + ldrh r0, [r0] + cmp r0, 0 + beq _0813ACB8 + ldr r0, _0813ACA8 + ldr r2, _0813ACAC + ldr r1, _0813ACB0 + ldrh r1, [r1] + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _0813ACB4 + adds r1, r2 + bl gf_strcpy + b _0813ACD2 + .align 2, 0 +_0813ACA4: .4byte 0x020375e2 +_0813ACA8: .4byte 0x02021cc4 +_0813ACAC: .4byte 0x085b320c +_0813ACB0: .4byte 0x020375e0 +_0813ACB4: .4byte 0x0831977c +_0813ACB8: + ldr r0, _0813ACD8 + ldr r2, _0813ACDC + ldr r1, _0813ACE0 + ldrh r1, [r1] + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _0813ACE4 + adds r1, r2 + bl gf_strcpy +_0813ACD2: + pop {r0} + bx r0 + .align 2, 0 +_0813ACD8: .4byte 0x02021cc4 +_0813ACDC: .4byte 0x085b31f8 +_0813ACE0: .4byte 0x020375e0 +_0813ACE4: .4byte 0x0831977c + thumb_func_end sub_813AC7C + + thumb_func_start sub_813ACE8 +sub_813ACE8: @ 813ACE8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0813AD20 + ldr r0, _0813AD28 + ldrh r0, [r0] + cmp r0, 0 + bne _0813AD18 + ldr r4, _0813AD2C + ldr r0, _0813AD30 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl SetStandardWindowBorderStyle +_0813AD18: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_813AD34 +_0813AD20: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813AD28: .4byte 0x020375e4 +_0813AD2C: .4byte 0x0203ab5e +_0813AD30: .4byte 0x085b3220 + thumb_func_end sub_813ACE8 + + thumb_func_start sub_813AD34 +sub_813AD34: @ 813AD34 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + adds r7, r5, 0 + lsrs r6, r0, 24 + movs r1, 0xF7 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0813ADAC + ldr r4, _0813AD88 + ldrb r0, [r4] + movs r1, 0x60 + str r1, [sp] + movs r1, 0x30 + str r1, [sp, 0x4] + movs r1, 0x11 + movs r2, 0 + movs r3, 0 + bl Window_FillPixelRect + cmp r6, 0xA + bne _0813AD90 + ldrb r0, [r4] + ldr r2, _0813AD8C + lsls r1, r5, 2 + adds r1, r2 + ldr r2, [r1] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + b _0813ADAC + .align 2, 0 +_0813AD88: .4byte 0x0203ab5e +_0813AD8C: .4byte 0x085b3254 +_0813AD90: + ldrb r0, [r4] + ldr r2, _0813ADB4 + lsls r1, r7, 2 + adds r1, r2 + ldr r2, [r1] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print +_0813ADAC: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813ADB4: .4byte 0x085b3228 + thumb_func_end sub_813AD34 + + thumb_func_start sub_813ADB8 +sub_813ADB8: @ 813ADB8 + push {r4,lr} + ldr r4, _0813ADD0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813ADD0: .4byte 0x0203ab5e + thumb_func_end sub_813ADB8 + + thumb_func_start sub_813ADD4 +sub_813ADD4: @ 813ADD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r0, _0813AEA0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _0813AE90 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0813AEA4 + adds r6, r0, r1 + ldrh r0, [r6, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r4, sp + adds r4, 0x16 + add r1, sp, 0x14 + adds r2, r4, 0 + bl get_coro_args_x18_x1A + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r5, 0 + mov r9, r4 + ldr r0, _0813AEA8 + mov r8, r0 + movs r4, 0 +_0813AE1E: + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x14 + ldrh r2, [r1] + adds r2, r5 + lsls r2, 2 + ldr r1, _0813AEAC + ldrh r1, [r1] + lsls r1, 6 + adds r2, r1 + add r2, r8 + ldr r2, [r2] + lsls r1, r5, 28 + lsrs r1, 24 + str r1, [sp] + movs r7, 0xFF + str r7, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0x1 + movs r3, 0xA + bl sub_8199F74 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0813AE1E + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813AEB0 + mov r3, r9 + ldrh r1, [r3] + lsls r1, 28 + lsrs r1, 24 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl Window_CopyToVram +_0813AE90: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813AEA0: .4byte sub_813A600 + 1 +_0813AEA4: .4byte 0x03005e00 +_0813AEA8: .4byte 0x085b2cf0 +_0813AEAC: .4byte 0x020375e0 +_0813AEB0: .4byte 0x085e8b3a + thumb_func_end sub_813ADD4 + + thumb_func_start sub_813AEB4 +sub_813AEB4: @ 813AEB4 + push {r4,lr} + movs r1, 0 + ldr r0, _0813AEF8 + strh r1, [r0] + ldr r0, _0813AEFC + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0813AF00 + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r4, 0 + beq _0813AF18 + movs r2, 0 + lsls r1, 1 + ldr r3, _0813AF04 + ldr r0, _0813AF08 + adds r0, r1, r0 + ldrh r1, [r0] +_0813AEE2: + lsls r0, r2, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r1 + beq _0813AF0C + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1D + bls _0813AEE2 + b _0813AF38 + .align 2, 0 +_0813AEF8: .4byte 0x020375e2 +_0813AEFC: .4byte 0x0000400e +_0813AF00: .4byte 0x0000400d +_0813AF04: .4byte 0x0861500c +_0813AF08: .4byte 0x085b320c +_0813AF0C: + ldr r0, _0813AF14 + strh r2, [r0] + b _0813AF38 + .align 2, 0 +_0813AF14: .4byte 0x020375e2 +_0813AF18: + movs r2, 0 + lsls r1, 1 + ldr r3, _0813AF40 + ldr r0, _0813AF44 + adds r0, r1, r0 + ldrh r1, [r0] +_0813AF24: + lsls r0, r2, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r1 + beq _0813AF0C + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1D + bls _0813AF24 +_0813AF38: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813AF40: .4byte 0x0861500c +_0813AF44: .4byte 0x085b31f8 + thumb_func_end sub_813AEB4 + + thumb_func_start sub_813AF48 +sub_813AF48: @ 813AF48 + push {r4,r5,lr} + ldr r0, _0813AFBC + bl get_task_id_by_function + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xFF + beq _0813AFB6 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _0813AFC0 + adds r4, r0 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, _0813AFC4 + ldr r0, [r0] + bl free + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8198070 + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl Window_FillTileMap + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl Window_CopyToVram + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl Window_Remove + adds r0, r5, 0 + bl remove_task +_0813AFB6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813AFBC: .4byte sub_813A600 + 1 +_0813AFC0: .4byte 0x03005e00 +_0813AFC4: .4byte 0x0203ab64 + thumb_func_end sub_813AF48 + + thumb_func_start sub_813AFC8 +sub_813AFC8: @ 813AFC8 + push {lr} + ldr r0, _0813AFD8 + movs r1, 0x8 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_0813AFD8: .4byte task_deoxys_sound + 1 + thumb_func_end sub_813AFC8 + + thumb_func_start task_deoxys_sound +task_deoxys_sound: @ 813AFDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0813AFFC + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B004 + ldr r1, _0813B000 + movs r0, 0x3 + b _0813B06A + .align 2, 0 +_0813AFFC: .4byte 0x000008d4 +_0813B000: .4byte 0x020375f0 +_0813B004: + ldr r0, _0813B04C + mov r8, r0 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, _0813B050 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0 + bl var_set + cmp r5, 0 + beq _0813B05C + ldr r0, _0813B054 + subs r1, r5, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, r6 + bcs _0813B05C + movs r0, 0 + bl sub_813B0B4 + mov r0, r8 + movs r1, 0 + bl var_set + ldr r1, _0813B058 + movs r0, 0 + strh r0, [r1] + b _0813B070 + .align 2, 0 +_0813B04C: .4byte 0x00004035 +_0813B050: .4byte 0x00004034 +_0813B054: .4byte 0x085b33f6 +_0813B058: .4byte 0x020375f0 +_0813B05C: + cmp r5, 0xA + bne _0813B080 + ldr r0, _0813B078 + bl flag_set + ldr r1, _0813B07C + movs r0, 0x2 +_0813B06A: + strh r0, [r1] + bl script_env_2_enable_and_set_ctx_running +_0813B070: + adds r0, r7, 0 + bl remove_task + b _0813B0A2 + .align 2, 0 +_0813B078: .4byte 0x000008d4 +_0813B07C: .4byte 0x020375f0 +_0813B080: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_813B0B4 + ldr r0, _0813B0AC + adds r1, r5, 0 + bl var_set + ldr r1, _0813B0B0 + movs r0, 0x1 + strh r0, [r1] + adds r0, r7, 0 + bl remove_task +_0813B0A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813B0AC: .4byte 0x00004035 +_0813B0B0: .4byte 0x020375f0 + thumb_func_end task_deoxys_sound + + thumb_func_start sub_813B0B4 +sub_813B0B4: @ 813B0B4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 5 + ldr r1, _0813B0E8 + adds r0, r1 + movs r1, 0xD0 + lsls r1, 1 + movs r2, 0x8 + bl gpu_pal_apply + ldr r0, _0813B0EC + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x1 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + cmp r4, 0 + bne _0813B0F0 + movs r0, 0xC4 + bl audio_play + b _0813B0F8 + .align 2, 0 +_0813B0E8: .4byte 0x085b3280 +_0813B0EC: .4byte 0x03005d8c +_0813B0F0: + movs r0, 0x82 + lsls r0, 1 + bl audio_play +_0813B0F8: + ldr r0, _0813B12C + movs r1, 0x8 + bl AddTask + ldr r3, _0813B130 + movs r0, 0x1 + str r0, [r3] + movs r0, 0x3A + str r0, [r3, 0x4] + movs r0, 0x1A + str r0, [r3, 0x8] + ldr r0, _0813B134 + lsls r2, r4, 1 + adds r1, r2, r0 + ldrb r1, [r1] + str r1, [r3, 0xC] + adds r0, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + str r0, [r3, 0x10] + adds r5, r2, 0 + cmp r4, 0 + bne _0813B138 + movs r0, 0x3C + b _0813B13A + .align 2, 0 +_0813B12C: .4byte sub_813B160 + 1 +_0813B130: .4byte 0x02038c08 +_0813B134: .4byte 0x085b33e0 +_0813B138: + movs r0, 0x5 +_0813B13A: + str r0, [r3, 0x14] + movs r0, 0x42 + bl oe_exec + ldr r0, _0813B15C + adds r1, r5, r0 + ldrb r1, [r1] + adds r0, 0x1 + adds r0, r5, r0 + ldrb r2, [r0] + movs r0, 0x1 + bl sub_8084910 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813B15C: .4byte 0x085b33e0 + thumb_func_end sub_813B0B4 + + thumb_func_start sub_813B160 +sub_813B160: @ 813B160 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x42 + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _0813B17C + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_0813B17C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_813B160 + + thumb_func_start increment_var_x4026_on_birth_island_modulo_100 +increment_var_x4026_on_birth_island_modulo_100: @ 813B184 + push {r4,lr} + ldr r4, _0813B1B4 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _0813B1B8 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _0813B1BC + cmp r1, r0 + bne _0813B1C8 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x63 + bls _0813B1C0 + adds r0, r4, 0 + movs r1, 0 + bl var_set + b _0813B1C8 + .align 2, 0 +_0813B1B4: .4byte 0x00004034 +_0813B1B8: .4byte 0x03005d8c +_0813B1BC: .4byte 0x00003a1a +_0813B1C0: + adds r0, r4, 0 + adds r1, r2, 0 + bl var_set +_0813B1C8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end increment_var_x4026_on_birth_island_modulo_100 + + thumb_func_start sub_813B1D0 +sub_813B1D0: @ 813B1D0 + push {lr} + ldr r0, _0813B1FC + bl var_get + lsls r0, 24 + lsrs r0, 19 + ldr r1, _0813B200 + adds r0, r1 + movs r1, 0xD0 + lsls r1, 1 + movs r2, 0x8 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 19 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + pop {r0} + bx r0 + .align 2, 0 +_0813B1FC: .4byte 0x00004035 +_0813B200: .4byte 0x085b3280 + thumb_func_end sub_813B1D0 + + thumb_func_start set_unknown_box_id +set_unknown_box_id: @ 813B204 + ldr r1, _0813B20C + strb r0, [r1] + bx lr + .align 2, 0 +_0813B20C: .4byte 0x0203ab6f + thumb_func_end set_unknown_box_id + + thumb_func_start get_unknown_box_id +get_unknown_box_id: @ 813B210 + ldr r0, _0813B218 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0813B218: .4byte 0x0203ab6f + thumb_func_end get_unknown_box_id + + thumb_func_start sub_813B21C +sub_813B21C: @ 813B21C + push {r4,r5,lr} + ldr r5, _0813B250 + adds r0, r5, 0 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _0813B258 + bl get_preferred_box + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0813B254 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _0813B258 + adds r0, r5, 0 + bl flag_set + movs r0, 0x1 + b _0813B25A + .align 2, 0 +_0813B250: .4byte 0x000008d7 +_0813B254: .4byte 0x00004036 +_0813B258: + movs r0, 0 +_0813B25A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_813B21C + + thumb_func_start sub_813B260 +sub_813B260: @ 813B260 + push {r4-r7,lr} + ldr r0, _0813B2B8 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl set_unknown_box_id + bl get_preferred_box + lsls r0, 24 + lsrs r4, r0, 24 +_0813B278: + movs r5, 0 + lsls r6, r4, 24 + lsls r7, r4, 16 +_0813B27E: + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl get_pokemon_by_box_and_pos + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0813B2C0 + bl get_unknown_box_id + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + beq _0813B2A6 + ldr r0, _0813B2BC + bl flag_clear +_0813B2A6: + ldr r0, _0813B2B8 + lsrs r1, r7, 16 + bl var_set + bl sub_813B21C + lsls r0, 24 + lsrs r0, 24 + b _0813B2DC + .align 2, 0 +_0813B2B8: .4byte 0x00004036 +_0813B2BC: .4byte 0x000008d7 +_0813B2C0: + adds r5, 0x1 + cmp r5, 0x1D + ble _0813B27E + adds r4, 0x1 + cmp r4, 0xE + bne _0813B2CE + movs r4, 0 +_0813B2CE: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0813B278 + movs r0, 0 +_0813B2DC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_813B260 + + thumb_func_start sub_813B2E4 +sub_813B2E4: @ 813B2E4 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0813B324 + movs r1, 0 + bl var_set + movs r0, 0xDF + lsls r0, 1 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813B340 + ldr r0, _0813B328 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B330 + ldr r0, _0813B32C + movs r1, 0x7 + ands r4, r1 + adds r1, r4, 0 + adds r1, 0x9 + bl var_set + b _0813B36A + .align 2, 0 +_0813B324: .4byte 0x00004038 +_0813B328: .4byte 0x000001bf +_0813B32C: .4byte 0x00004037 +_0813B330: + movs r0, 0x1 + ands r4, r0 + cmp r4, 0 + bne _0813B354 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 +_0813B340: + ldr r0, _0813B350 + movs r1, 0x7 + ands r4, r1 + adds r1, r4, 0x1 + bl var_set + b _0813B36A + .align 2, 0 +_0813B350: .4byte 0x00004037 +_0813B354: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0813B370 + movs r1, 0x7 + ands r4, r1 + adds r1, r4, 0 + adds r1, 0x9 + bl var_set +_0813B36A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813B370: .4byte 0x00004037 + thumb_func_end sub_813B2E4 + + thumb_func_start sub_813B374 +sub_813B374: @ 813B374 + push {r4,lr} + ldr r0, _0813B39C + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0813B3A0 + ldr r2, _0813B3A4 + subs r1, r4, 0x1 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl GetMapName + cmp r4, 0x8 + bls _0813B3A8 + movs r0, 0x1 + b _0813B3AA + .align 2, 0 +_0813B39C: .4byte 0x00004037 +_0813B3A0: .4byte 0x02021cc4 +_0813B3A4: .4byte 0x085b3400 +_0813B3A8: + movs r0, 0 +_0813B3AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813B374 + + thumb_func_start sub_813B3B0 +sub_813B3B0: @ 813B3B0 + push {r4-r6,lr} + ldr r5, _0813B400 + adds r0, r5, 0 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0813B404 + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _0813B47C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0813B408 + cmp r4, r0 + bls _0813B474 + adds r0, r5, 0 + movs r1, 0 + bl var_set + ldr r0, _0813B40C + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x18 + bne _0813B414 + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0x69 + bgt _0813B414 + cmp r0, 0x65 + blt _0813B414 + ldr r0, _0813B410 + movs r1, 0x1 + b _0813B478 + .align 2, 0 +_0813B400: .4byte 0x00004038 +_0813B404: .4byte 0x00004037 +_0813B408: .4byte 0x000003e7 +_0813B40C: .4byte 0x03005d8c +_0813B410: .4byte 0x00004039 +_0813B414: + ldr r0, _0813B43C + ldr r2, [r0] + movs r1, 0x4 + ldrsb r1, [r2, r1] + adds r3, r0, 0 + cmp r1, 0 + bne _0813B444 + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, 0x34 + beq _0813B436 + cmp r0, 0x34 + blt _0813B444 + cmp r0, 0x38 + bgt _0813B444 + cmp r0, 0x36 + blt _0813B444 +_0813B436: + ldr r0, _0813B440 + movs r1, 0x1 + b _0813B478 + .align 2, 0 +_0813B43C: .4byte 0x03005d8c +_0813B440: .4byte 0x00004039 +_0813B444: + ldr r3, [r3] + movs r2, 0x5 + ldrsb r2, [r3, r2] + ldr r1, _0813B464 + subs r0, r6, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bne _0813B468 + movs r0, 0x4 + ldrsb r0, [r3, r0] + cmp r0, 0 + bne _0813B468 + movs r0, 0x1 + b _0813B47E + .align 2, 0 +_0813B464: .4byte 0x085b3410 +_0813B468: + ldr r0, _0813B470 + movs r1, 0 + b _0813B478 + .align 2, 0 +_0813B470: .4byte 0x00004037 +_0813B474: + adds r0, r5, 0 + adds r1, r4, 0 +_0813B478: + bl var_set +_0813B47C: + movs r0, 0 +_0813B47E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_813B3B0 + + thumb_func_start sub_813B484 +sub_813B484: @ 813B484 + push {lr} + movs r0, 0x2 + bl sub_80AB104 + pop {r0} + bx r0 + thumb_func_end sub_813B484 + + thumb_func_start sub_813B490 +sub_813B490: @ 813B490 + push {r4-r7,lr} + movs r3, 0 + ldr r0, _0813B4C4 + ldr r4, [r0] + movs r6, 0x4 + ldrsb r6, [r4, r6] + ldr r5, _0813B4C8 + adds r0, r5, 0x2 + mov r12, r0 + adds r7, r5, 0x1 +_0813B4A4: + lsls r0, r3, 1 + adds r2, r0, r3 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r6, r0 + bne _0813B4CC + movs r1, 0x5 + ldrsb r1, [r4, r1] + adds r0, r2, r7 + ldrb r0, [r0] + cmp r1, r0 + bne _0813B4CC + mov r1, r12 + adds r0, r2, r1 + ldrb r0, [r0] + b _0813B4D8 + .align 2, 0 +_0813B4C4: .4byte 0x03005d8c +_0813B4C8: .4byte 0x085b3420 +_0813B4CC: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xB + bls _0813B4A4 + movs r0, 0x1 +_0813B4D8: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_813B490 + + thumb_func_start sub_813B4E0 +sub_813B4E0: @ 813B4E0 + push {lr} + ldr r0, _0813B508 + ldrh r0, [r0] + bl sub_81D15CC + cmp r0, 0 + blt _0813B50C + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B50C + movs r0, 0x1 + b _0813B50E + .align 2, 0 +_0813B508: .4byte 0x020375e0 +_0813B50C: + movs r0, 0 +_0813B50E: + pop {r1} + bx r1 + thumb_func_end sub_813B4E0 + + thumb_func_start sub_813B514 +sub_813B514: @ 813B514 + push {lr} + ldr r0, _0813B528 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _0813B52C + movs r0, 0x1 + b _0813B52E + .align 2, 0 +_0813B528: .4byte 0x0000403f +_0813B52C: + movs r0, 0 +_0813B52E: + pop {r1} + bx r1 + thumb_func_end sub_813B514 + + thumb_func_start sub_813B534 +sub_813B534: @ 813B534 + push {lr} + ldr r2, _0813B558 + ldr r1, _0813B55C + ldr r0, [r1] + str r0, [r2] + movs r0, 0 + str r0, [r1] + ldr r0, _0813B560 + ldrb r0, [r0] + cmp r0, 0 + bne _0813B552 + ldr r0, _0813B564 + movs r1, 0x5 + bl AddTask +_0813B552: + pop {r0} + bx r0 + .align 2, 0 +_0813B558: .4byte 0x0203ab70 +_0813B55C: .4byte 0x02022fec +_0813B560: .4byte 0x03003124 +_0813B564: .4byte sub_80B3AF8 + 1 + thumb_func_end sub_813B534 + + thumb_func_start sub_813B568 +sub_813B568: @ 813B568 + push {lr} + ldr r0, _0813B578 + movs r1, 0x5 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_0813B578: .4byte sub_813B57C + 1 + thumb_func_end sub_813B568 + + thumb_func_start sub_813B57C +sub_813B57C: @ 813B57C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0813B5A0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x9 + bls _0813B596 + b _0813B7C6 +_0813B596: + lsls r0, 2 + ldr r1, _0813B5A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813B5A0: .4byte 0x03005e00 +_0813B5A4: .4byte _0813B5A8 + .align 2, 0 +_0813B5A8: + .4byte _0813B5D0 + .4byte _0813B5E4 + .4byte _0813B614 + .4byte _0813B6B4 + .4byte _0813B6E4 + .4byte _0813B728 + .4byte _0813B764 + .4byte _0813B772 + .4byte _0813B784 + .4byte _0813B7A8 +_0813B5D0: + ldr r0, _0813B5E0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0813B5DE + b _0813B7C6 +_0813B5DE: + b _0813B790 + .align 2, 0 +_0813B5E0: .4byte sub_80B3AF8 + 1 +_0813B5E4: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813B5F2 + b _0813B7C6 +_0813B5F2: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0813B5FE + b _0813B790 +_0813B5FE: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0813B610 + movs r2, 0x2 + bl link_0800A448 + b _0813B708 + .align 2, 0 +_0813B610: .4byte 0x020375e0 +_0813B614: + bl sub_800A550 + movs r1, 0x2 + ands r1, r0 + cmp r1, 0 + bne _0813B622 + b _0813B7C6 +_0813B622: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _0813B62E + b _0813B790 +_0813B62E: + ldr r5, _0813B658 + ldr r0, _0813B65C + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5] + movs r0, 0x1 + bl sub_800A5EC + ldr r0, _0813B660 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0813B668 + ldrh r1, [r5] + cmp r1, 0x1 + bne _0813B668 + ldr r0, _0813B664 + strh r1, [r0] + b _0813B790 + .align 2, 0 +_0813B658: .4byte 0x020375e2 +_0813B65C: .4byte 0x020223c4 +_0813B660: .4byte 0x020375e0 +_0813B664: .4byte 0x020375f0 +_0813B668: + ldr r0, _0813B680 + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0 + bne _0813B68C + ldr r0, _0813B684 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0813B68C + ldr r1, _0813B688 + movs r0, 0x2 + b _0813B6AC + .align 2, 0 +_0813B680: .4byte 0x020375e0 +_0813B684: .4byte 0x020375e2 +_0813B688: .4byte 0x020375f0 +_0813B68C: + ldrh r0, [r2] + cmp r0, 0x1 + bne _0813B6A8 + ldr r0, _0813B6A0 + ldrh r0, [r0] + cmp r0, 0 + bne _0813B6A8 + ldr r1, _0813B6A4 + movs r0, 0x3 + b _0813B6AC + .align 2, 0 +_0813B6A0: .4byte 0x020375e2 +_0813B6A4: .4byte 0x020375f0 +_0813B6A8: + ldr r1, _0813B6B0 + movs r0, 0 +_0813B6AC: + strh r0, [r1] + b _0813B790 + .align 2, 0 +_0813B6B0: .4byte 0x020375f0 +_0813B6B4: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813B6C2 + b _0813B7C6 +_0813B6C2: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0813B790 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0813B6E0 + movs r2, 0x2 + bl link_0800A448 + b _0813B708 + .align 2, 0 +_0813B6E0: .4byte 0x020375f0 +_0813B6E4: + bl sub_800A550 + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0813B7C6 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _0813B790 + ldr r1, _0813B71C + ldr r0, _0813B720 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0 + bl sub_800A5EC +_0813B708: + ldr r1, _0813B724 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0813B7C6 + .align 2, 0 +_0813B71C: .4byte 0x020375f0 +_0813B720: .4byte 0x020223c4 +_0813B724: .4byte 0x03005e00 +_0813B728: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0813B74C + ldr r0, _0813B744 + ldrh r0, [r0] + cmp r0, 0x2 + bne _0813B790 + ldr r0, _0813B748 + bl box_related_two__3 + b _0813B790 + .align 2, 0 +_0813B744: .4byte 0x020375f0 +_0813B748: .4byte 0x0824979b +_0813B74C: + ldr r0, _0813B75C + ldrh r0, [r0] + cmp r0, 0x3 + bne _0813B790 + ldr r0, _0813B760 + bl box_related_two__3 + b _0813B790 + .align 2, 0 +_0813B75C: .4byte 0x020375f0 +_0813B760: .4byte 0x0824979b +_0813B764: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813B7C6 + b _0813B790 +_0813B772: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B7C6 + bl sub_800ADF8 + b _0813B790 +_0813B784: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B7C6 +_0813B790: + ldr r0, _0813B7A4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0813B7C6 + .align 2, 0 +_0813B7A4: .4byte 0x03005e00 +_0813B7A8: + ldr r0, _0813B7CC + ldrb r0, [r0] + cmp r0, 0 + bne _0813B7B4 + bl sub_800AC34 +_0813B7B4: + ldr r0, _0813B7D0 + ldr r1, _0813B7D4 + ldr r1, [r1] + str r1, [r0] + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_0813B7C6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813B7CC: .4byte 0x030030fc +_0813B7D0: .4byte 0x02022fec +_0813B7D4: .4byte 0x0203ab70 + thumb_func_end sub_813B57C + + thumb_func_start sub_813B7D8 +sub_813B7D8: @ 813B7D8 + push {lr} + ldr r0, _0813B7F0 + ldrh r0, [r0] + cmp r0, 0 + bne _0813B7F8 + ldr r2, _0813B7F4 + movs r0, 0 + movs r1, 0x1 + bl sub_81D6720 + b _0813B802 + .align 2, 0 +_0813B7F0: .4byte 0x020375e0 +_0813B7F4: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_0813B7F8: + ldr r2, _0813B808 + movs r0, 0x1 + movs r1, 0 + bl sub_81D6720 +_0813B802: + pop {r0} + bx r0 + .align 2, 0 +_0813B808: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_813B7D8 + + thumb_func_start sub_813B80C +sub_813B80C: @ 813B80C + push {lr} + ldr r0, _0813B820 + movs r1, 0x8 + bl AddTask + movs r0, 0x9D + bl audio_play + pop {r0} + bx r0 + .align 2, 0 +_0813B820: .4byte sub_813B824 + 1 + thumb_func_end sub_813B80C + + thumb_func_start sub_813B824 +sub_813B824: @ 813B824 + 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, _0813B874 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, _0813B878 + ldrh r0, [r0] + cmp r1, r0 + bne _0813B858 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x9D + bl audio_play +_0813B858: + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, _0813B87C + ldrh r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0813B86C + adds r0, r5, 0 + bl remove_task +_0813B86C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813B874: .4byte 0x03005e08 +_0813B878: .4byte 0x020375e2 +_0813B87C: .4byte 0x020375e0 + thumb_func_end sub_813B824 + + thumb_func_start sub_813B880 +sub_813B880: @ 813B880 + push {lr} + ldr r0, _0813B8A8 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813B8AC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x4 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + strh r2, [r1, 0xE] + pop {r0} + bx r0 + .align 2, 0 +_0813B8A8: .4byte _fwalk + 1 +_0813B8AC: .4byte 0x03005e00 + thumb_func_end sub_813B880 + + thumb_func_start _fwalk +_fwalk: @ 813B8B0 + 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 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + ldr r1, _0813B95C + adds r5, r0, r1 + movs r0, 0x6 + ldrsh r1, [r5, r0] + lsls r1, 1 + adds r1, r5 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r1, 0x6 + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0813B94E + movs r6, 0 +_0813B8EA: + movs r4, 0 + lsls r3, r6, 3 + mov r10, r3 + adds r7, r6, 0x1 + mov r8, r7 +_0813B8F4: + ldr r0, _0813B960 + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, r4 + adds r0, 0x6 + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r1, r6 + adds r1, 0x4 + ldr r7, _0813B964 + adds r2, r4, r7 + add r2, r10 + movs r7, 0x6 + ldrsh r3, [r5, r7] + lsls r3, 5 + adds r2, r3 + lsls r2, 16 + lsrs r2, 16 + bl setmaptile_0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0813B8F4 + mov r1, r8 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0813B8EA + bl cur_mapdata_full_redraw + ldrh r0, [r5, 0x6] + adds r0, 0x1 + strh r0, [r5, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0813B94E + mov r0, r9 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_0813B94E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813B95C: .4byte 0x03005e08 +_0813B960: .4byte 0x03005d8c +_0813B964: .4byte 0x00000201 + thumb_func_end _fwalk + + thumb_func_start sub_813B968 +sub_813B968: @ 813B968 + push {r4,r5,lr} + ldr r5, _0813B998 + ldr r0, _0813B99C + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + strh r0, [r5] + ldrh r4, [r5] + adds r0, r4, 0 + movs r1, 0x14 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + subs r4, r1 + strh r4, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813B998: .4byte 0x020375f0 +_0813B99C: .4byte 0x020375e0 + thumb_func_end sub_813B968 + + thumb_func_start sub_813B9A0 +sub_813B9A0: @ 813B9A0 + push {lr} + ldr r0, _0813B9BC + ldr r0, [r0] + ldrh r1, [r0, 0x1C] + movs r0, 0xB0 + lsls r0, 4 + cmp r1, r0 + bne _0813B9B6 + movs r0, 0x3 + bl sub_8084D1C +_0813B9B6: + pop {r0} + bx r0 + .align 2, 0 +_0813B9BC: .4byte 0x03005d8c + thumb_func_end sub_813B9A0 + + thumb_func_start sub_813B9C0 +sub_813B9C0: @ 813B9C0 + push {r4,lr} + ldr r0, _0813B9F0 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, _0813B9F4 + ldrh r0, [r2] + ldr r1, _0813B9F8 + cmp r0, r1 + beq _0813BA06 + adds r4, r1, 0 + adds r1, r2, 0 +_0813B9E6: + ldrh r0, [r2] + cmp r0, r3 + bne _0813B9FC + movs r0, 0x1 + b _0813BA08 + .align 2, 0 +_0813B9F0: .4byte 0x03005d8c +_0813B9F4: .4byte 0x085b3444 +_0813B9F8: .4byte 0x0000ffff +_0813B9FC: + adds r1, 0x2 + adds r2, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _0813B9E6 +_0813BA06: + movs r0, 0 +_0813BA08: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813B9C0 + + thumb_func_start sub_813BA10 +sub_813BA10: @ 813BA10 + ldr r0, _0813BA28 + ldr r0, [r0] + ldr r2, _0813BA2C + adds r1, r0, r2 + movs r2, 0 + strh r2, [r1] + movs r1, 0xA1 + lsls r1, 5 + adds r0, r1 + strh r2, [r0] + bx lr + .align 2, 0 +_0813BA28: .4byte 0x03005d8c +_0813BA2C: .4byte 0x0000141e + thumb_func_end sub_813BA10 + + thumb_func_start sub_813BA30 +sub_813BA30: @ 813BA30 + push {lr} + bl sub_813BF44 + lsls r0, 24 + cmp r0, 0 + beq _0813BA52 + bl sub_813BCE8 + ldr r0, _0813BA58 + ldr r1, [r0] + ldr r0, _0813BA5C + ldr r0, [r0] + ldrh r0, [r0, 0xE] + movs r2, 0xA1 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] +_0813BA52: + pop {r0} + bx r0 + .align 2, 0 +_0813BA58: .4byte 0x03005d8c +_0813BA5C: .4byte 0x03005d90 + thumb_func_end sub_813BA30 + + thumb_func_start sub_813BA60 +sub_813BA60: @ 813BA60 + push {r4,lr} + ldr r4, _0813BABC + ldr r0, [r4] + ldr r1, _0813BAC0 + adds r0, r1 + ldrh r0, [r0] + lsrs r0, 7 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0813BAB6 + bl sub_813BF60 + bl sub_813BD84 + ldr r1, [r4] + ldr r0, _0813BAC4 + ldr r0, [r0] + ldrh r0, [r0, 0xE] + movs r2, 0xA1 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + ldr r0, _0813BAC8 + bl flag_clear + ldr r0, _0813BACC + bl flag_clear + ldr r0, _0813BAD0 + bl flag_clear + movs r0, 0xC6 + lsls r0, 2 + bl flag_clear + ldr r0, _0813BAD4 + bl flag_clear + ldr r0, _0813BAD8 + movs r1, 0x1 + bl var_set +_0813BAB6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813BABC: .4byte 0x03005d8c +_0813BAC0: .4byte 0x0000141e +_0813BAC4: .4byte 0x03005d90 +_0813BAC8: .4byte 0x00000315 +_0813BACC: .4byte 0x00000316 +_0813BAD0: .4byte 0x00000317 +_0813BAD4: .4byte 0x000002da +_0813BAD8: .4byte 0x00004095 + thumb_func_end sub_813BA60 + + thumb_func_start sub_813BADC +sub_813BADC: @ 813BADC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0813BB28 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _0813BB58 + ldr r4, _0813BB2C + ldr r0, [r4] + ldr r5, _0813BB30 + adds r3, r0, r5 + ldrh r2, [r3] + movs r1, 0x7F + ands r1, r2 + ldr r0, _0813BB34 + adds r0, r6, r0 + ldrb r0, [r0] + adds r1, r0 + cmp r1, 0x13 + ble _0813BB54 + bl sub_813BCA8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0813BB3C + bl sub_813BB74 + ldr r0, [r4] + adds r0, r5 + ldrh r2, [r0] + ldr r1, _0813BB38 + ands r1, r2 + strh r1, [r0] + b _0813BB58 + .align 2, 0 +_0813BB28: .4byte 0x00004095 +_0813BB2C: .4byte 0x03005d8c +_0813BB30: .4byte 0x0000141e +_0813BB34: .4byte 0x085b3470 +_0813BB38: .4byte 0x0000ff80 +_0813BB3C: + ldr r2, [r4] + adds r2, r5 + ldrh r1, [r2] + ldr r0, _0813BB50 + ands r0, r1 + movs r1, 0x14 + orrs r0, r1 + strh r0, [r2] + b _0813BB58 + .align 2, 0 +_0813BB50: .4byte 0x0000ff80 +_0813BB54: + adds r0, r2, r0 + strh r0, [r3] +_0813BB58: + ldr r0, _0813BB6C + ldr r0, [r0] + ldr r1, _0813BB70 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x7F + ands r0, r1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0813BB6C: .4byte 0x03005d8c +_0813BB70: .4byte 0x0000141e + thumb_func_end sub_813BADC + + thumb_func_start sub_813BB74 +sub_813BB74: @ 813BB74 + push {r4-r7,lr} + sub sp, 0x8 + movs r3, 0 + movs r5, 0 + ldr r7, _0813BBBC + ldr r2, _0813BBC0 + movs r6, 0x1 +_0813BB82: + ldr r0, [r7] + adds r0, r2 + ldrh r1, [r0] + ldr r0, _0813BBC4 + adds r0, r5, r0 + ldrb r4, [r0] + asrs r1, r4 + ands r1, r6 + cmp r1, 0 + bne _0813BBC8 + adds r3, r5, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl GenerateRandomNumber + adds r1, r6, 0 + ands r1, r0 + ldr r2, [sp] + ldr r3, [sp, 0x4] + cmp r1, 0 + beq _0813BBC8 + ldr r0, [r7] + adds r0, r2 + adds r1, r6, 0 + lsls r1, r4 + ldrh r2, [r0] + orrs r1, r2 + strh r1, [r0] + b _0813BBEA + .align 2, 0 +_0813BBBC: .4byte 0x03005d8c +_0813BBC0: .4byte 0x0000141e +_0813BBC4: .4byte 0x085b3474 +_0813BBC8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _0813BB82 + ldr r0, _0813BBF4 + ldr r2, [r0] + ldr r0, _0813BBF8 + adds r2, r0 + ldr r1, _0813BBFC + adds r1, r3, r1 + movs r0, 0x1 + ldrb r1, [r1] + lsls r0, r1 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r2] +_0813BBEA: + adds r0, r3, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0813BBF4: .4byte 0x03005d8c +_0813BBF8: .4byte 0x0000141e +_0813BBFC: .4byte 0x085b3474 + thumb_func_end sub_813BB74 + + thumb_func_start sub_813BC00 +sub_813BC00: @ 813BC00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + bl sub_813BCA8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0813BC2E + movs r0, 0 + b _0813BC8E +_0813BC1E: + mov r1, r8 + ldr r0, [r1] + add r0, r9 + lsls r4, r6 + ldrh r1, [r0] + eors r4, r1 + strh r4, [r0] + b _0813BC8C +_0813BC2E: + movs r5, 0 + ldr r2, _0813BC9C + mov r8, r2 + ldr r0, _0813BCA0 + mov r9, r0 + movs r4, 0x1 +_0813BC3A: + mov r1, r8 + ldr r0, [r1] + add r0, r9 + ldrh r1, [r0] + ldr r7, _0813BCA4 + adds r0, r5, r7 + ldrb r6, [r0] + asrs r1, r6 + ands r1, r4 + cmp r1, 0 + beq _0813BC5E + mov r10, r5 + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + bne _0813BC1E +_0813BC5E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _0813BC3A + ldr r0, _0813BC9C + ldr r0, [r0] + ldr r2, _0813BCA0 + adds r4, r0, r2 + ldrh r1, [r4] + mov r2, r10 + adds r0, r2, r7 + ldrb r2, [r0] + adds r0, r1, 0 + asrs r0, r2 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0813BC8C + adds r0, r3, 0 + lsls r0, r2 + eors r1, r0 + strh r1, [r4] +_0813BC8C: + mov r0, r10 +_0813BC8E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0813BC9C: .4byte 0x03005d8c +_0813BCA0: .4byte 0x0000141e +_0813BCA4: .4byte 0x085b347c + thumb_func_end sub_813BC00 + + thumb_func_start sub_813BCA8 +sub_813BCA8: @ 813BCA8 + push {r4,r5,lr} + movs r3, 0 + movs r2, 0 + ldr r0, _0813BCE0 + ldr r0, [r0] + ldr r1, _0813BCE4 + adds r0, r1 + ldrh r4, [r0] + movs r5, 0x1 +_0813BCBA: + adds r1, r2, 0 + adds r1, 0x8 + adds r0, r4, 0 + asrs r0, r1 + ands r0, r5 + cmp r0, 0 + beq _0813BCCE + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_0813BCCE: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0813BCBA + adds r0, r3, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0813BCE0: .4byte 0x03005d8c +_0813BCE4: .4byte 0x0000141e + thumb_func_end sub_813BCA8 + + thumb_func_start sub_813BCE8 +sub_813BCE8: @ 813BCE8 + push {r4-r6,lr} + movs r5, 0 + ldr r2, _0813BCFC + ldr r0, [r2] + ldrh r1, [r0, 0xE] + ldr r0, _0813BD00 + cmp r1, r0 + bhi _0813BD58 + adds r6, r2, 0 + b _0813BD32 + .align 2, 0 +_0813BCFC: .4byte 0x03005d90 +_0813BD00: .4byte 0x000003e6 +_0813BD04: + ldr r0, [r6] + ldrh r1, [r0, 0xE] + ldr r4, _0813BD50 + ldr r0, [r4] + movs r2, 0xA1 + lsls r2, 5 + adds r0, r2 + ldrh r0, [r0] + subs r1, r0 + cmp r1, 0xB + ble _0813BD58 + bl sub_813BC00 + ldr r0, [r4] + movs r1, 0xA1 + lsls r1, 5 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0xC + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0813BD32: + bl sub_813BCA8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _0813BD54 + ldr r0, _0813BD50 + ldr r1, [r0] + ldr r0, [r6] + ldrh r0, [r0, 0xE] + movs r2, 0xA1 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + b _0813BD58 + .align 2, 0 +_0813BD50: .4byte 0x03005d8c +_0813BD54: + cmp r5, 0x8 + bne _0813BD04 +_0813BD58: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_813BCE8 + + thumb_func_start sub_813BD60 +sub_813BD60: @ 813BD60 + ldr r0, _0813BD78 + ldr r0, [r0] + ldr r1, _0813BD7C + adds r0, r1 + ldrh r0, [r0] + ldr r1, _0813BD80 + ldrh r1, [r1] + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_0813BD78: .4byte 0x03005d8c +_0813BD7C: .4byte 0x0000141e +_0813BD80: .4byte 0x020375e0 + thumb_func_end sub_813BD60 + + thumb_func_start sub_813BD84 +sub_813BD84: @ 813BD84 + ldr r0, _0813BDAC + ldr r2, [r0] + ldr r0, _0813BDB0 + adds r2, r0 + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + orrs r0, r1 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + orrs r0, r1 + movs r3, 0x80 + lsls r3, 3 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + bx lr + .align 2, 0 +_0813BDAC: .4byte 0x03005d8c +_0813BDB0: .4byte 0x0000141e + thumb_func_end sub_813BD84 + + thumb_func_start sub_813BDB4 +sub_813BDB4: @ 813BDB4 + push {lr} + movs r3, 0 + movs r2, 0 + ldr r0, _0813BDD0 + ldrh r0, [r0] + subs r0, 0x8 + cmp r0, 0x7 + bhi _0813BE14 + lsls r0, 2 + ldr r1, _0813BDD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813BDD0: .4byte 0x020375e0 +_0813BDD4: .4byte _0813BDD8 + .align 2, 0 +_0813BDD8: + .4byte _0813BE14 + .4byte _0813BE14 + .4byte _0813BDF8 + .4byte _0813BDFE + .4byte _0813BE04 + .4byte _0813BE0A + .4byte _0813BE10 + .4byte _0813BE14 +_0813BDF8: + movs r3, 0 + movs r2, 0x3 + b _0813BE14 +_0813BDFE: + movs r3, 0 + movs r2, 0x1 + b _0813BE14 +_0813BE04: + movs r3, 0x1 + movs r2, 0 + b _0813BE14 +_0813BE0A: + movs r3, 0 + movs r2, 0x4 + b _0813BE14 +_0813BE10: + movs r3, 0x1 + movs r2, 0x5 +_0813BE14: + ldr r0, _0813BE28 + ldr r0, [r0] + ldr r1, _0813BE2C + adds r0, r1 + adds r1, r3, 0 + bl sub_813BE30 + pop {r0} + bx r0 + .align 2, 0 +_0813BE28: .4byte 0x03005d8c +_0813BE2C: .4byte 0x00003150 + thumb_func_end sub_813BDB4 + + thumb_func_start sub_813BE30 +sub_813BE30: @ 813BE30 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r0, r5, 4 + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0813BEE8 + cmp r2, 0x5 + bhi _0813BED4 + lsls r0, r2, 2 + ldr r1, _0813BE54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813BE54: .4byte _0813BE58 + .align 2, 0 +_0813BE58: + .4byte _0813BED4 + .4byte _0813BE70 + .4byte _0813BE84 + .4byte _0813BE98 + .4byte _0813BEAC + .4byte _0813BEC0 +_0813BE70: + ldr r0, _0813BE7C + ldr r1, _0813BE80 + bl gf_strcpy + b _0813BF04 + .align 2, 0 +_0813BE7C: .4byte 0x02021cc4 +_0813BE80: .4byte 0x085ead14 +_0813BE84: + ldr r0, _0813BE90 + ldr r1, _0813BE94 + bl gf_strcpy + b _0813BF04 + .align 2, 0 +_0813BE90: .4byte 0x02021cc4 +_0813BE94: .4byte 0x085ead1b +_0813BE98: + ldr r0, _0813BEA4 + ldr r1, _0813BEA8 + bl gf_strcpy + b _0813BF04 + .align 2, 0 +_0813BEA4: .4byte 0x02021cc4 +_0813BEA8: .4byte 0x085ead22 +_0813BEAC: + ldr r0, _0813BEB8 + ldr r1, _0813BEBC + bl gf_strcpy + b _0813BF04 + .align 2, 0 +_0813BEB8: .4byte 0x02021cc4 +_0813BEBC: .4byte 0x085ead29 +_0813BEC0: + ldr r0, _0813BECC + ldr r1, _0813BED0 + bl gf_strcpy + b _0813BF04 + .align 2, 0 +_0813BECC: .4byte 0x02021cc4 +_0813BED0: .4byte 0x085ead30 +_0813BED4: + ldr r0, _0813BEE0 + ldr r1, _0813BEE4 + bl gf_strcpy + b _0813BF04 + .align 2, 0 +_0813BEE0: .4byte 0x02021cc4 +_0813BEE4: .4byte 0x085ead0c +_0813BEE8: + ldr r4, _0813BF0C + adds r0, r4, 0 + movs r2, 0x7 + bl gf_strncpy + movs r0, 0xFF + strb r0, [r4, 0x7] + adds r0, r6, 0 + adds r0, 0x50 + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8009308 +_0813BF04: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813BF0C: .4byte 0x02021cc4 + thumb_func_end sub_813BE30 + + thumb_func_start sub_813BF10 +sub_813BF10: @ 813BF10 + push {lr} + ldr r0, _0813BF34 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _0813BF40 + bl sub_813BA30 + ldr r0, _0813BF38 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0813BF3C + bl sub_813BB74 + b _0813BF40 + .align 2, 0 +_0813BF34: .4byte 0x00004095 +_0813BF38: .4byte 0x0202433a +_0813BF3C: + bl sub_813BC00 +_0813BF40: + pop {r0} + bx r0 + thumb_func_end sub_813BF10 + + thumb_func_start sub_813BF44 +sub_813BF44: @ 813BF44 + ldr r0, _0813BF58 + ldr r0, [r0] + ldr r1, _0813BF5C + adds r0, r1 + ldrh r0, [r0] + lsrs r0, 7 + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_0813BF58: .4byte 0x03005d8c +_0813BF5C: .4byte 0x0000141e + thumb_func_end sub_813BF44 + + thumb_func_start sub_813BF60 +sub_813BF60: @ 813BF60 + ldr r0, _0813BF74 + ldr r1, [r0] + ldr r0, _0813BF78 + adds r1, r0 + ldrh r2, [r1] + movs r0, 0x80 + orrs r0, r2 + strh r0, [r1] + bx lr + .align 2, 0 +_0813BF74: .4byte 0x03005d8c +_0813BF78: .4byte 0x0000141e + thumb_func_end sub_813BF60 + + thumb_func_start sub_813BF7C +sub_813BF7C: @ 813BF7C + push {lr} + ldr r0, _0813BF90 + ldrb r0, [r0] + bl sub_813BADC + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0813BF90: .4byte 0x020375e0 + thumb_func_end sub_813BF7C + + thumb_func_start sub_813BF94 +sub_813BF94: @ 813BF94 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r2, _0813BFC0 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + movs r0, 0xFF + strb r0, [r4] + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813BFC0: .4byte 0x01000008 + thumb_func_end sub_813BF94 + + thumb_func_start sub_813BFC4 +sub_813BFC4: @ 813BFC4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0x4 +_0813BFCA: + adds r0, r4, 0 + bl sub_813BF94 + adds r4, 0x10 + subs r5, 0x1 + cmp r5, 0 + bge _0813BFCA + movs r0, 0x17 + movs r1, 0 + bl sav12_xor_set + movs r0, 0x18 + movs r1, 0 + bl sav12_xor_set + movs r0, 0x19 + movs r1, 0 + bl sav12_xor_set + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_813BFC4 + + thumb_func_start sub_813BFF8 +sub_813BFF8: @ 813BFF8 + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + ldrh r2, [r1, 0xC] + adds r0, r2 + ldrh r1, [r1, 0xE] + adds r0, r1 + bx lr + thumb_func_end sub_813BFF8 + + thumb_func_start sub_813C008 +sub_813C008: @ 813C008 + push {r4-r7,lr} + adds r7, r1, 0 + lsls r2, 16 + lsrs r6, r2, 16 + movs r5, 0 + adds r4, r0, 0 +_0813C014: + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x7 + bl sub_8008C68 + cmp r0, 0 + bne _0813C02C + ldrh r0, [r4, 0x8] + cmp r0, r6 + bne _0813C02C + adds r0, r5, 0 + b _0813C036 +_0813C02C: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x4 + ble _0813C014 + movs r0, 0x5 +_0813C036: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_813C008 + + thumb_func_start sub_813C03C +sub_813C03C: @ 813C03C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + movs r1, 0x4 +_0813C04C: + subs r3, r1, 0x1 + adds r6, r3, 0 + cmp r3, 0 + blt _0813C0BA + lsls r0, r1, 4 + add r0, r10 + str r0, [sp, 0x14] + lsls r0, r3, 4 + mov r2, r10 + adds r5, r0, r2 + movs r4, 0x50 + add r4, r10 + mov r9, r4 + add r1, r9 + mov r8, r1 +_0813C06A: + ldr r0, [sp, 0x14] + str r3, [sp, 0x10] + bl sub_813BFF8 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_813BFF8 + ldr r3, [sp, 0x10] + cmp r4, r0 + ble _0813C0B2 + mov r1, sp + ldr r0, [sp, 0x14] + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r0] + str r0, [r1] + ldr r1, [sp, 0x14] + adds r0, r5, 0 + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r0] + str r0, [r1] + adds r1, r5, 0 + mov r0, sp + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r0] + str r0, [r1] + mov r7, r8 + ldrb r2, [r7] + mov r0, r9 + adds r1, r0, r6 + ldrb r0, [r1] + strb r0, [r7] + strb r2, [r1] +_0813C0B2: + subs r5, 0x10 + subs r6, 0x1 + cmp r6, 0 + bge _0813C06A +_0813C0BA: + adds r1, r3, 0 + cmp r1, 0 + bgt _0813C04C + 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_813C03C + + thumb_func_start sub_813C0D0 +sub_813C0D0: @ 813C0D0 + push {lr} + adds r2, r0, 0 + cmp r1, 0x2 + beq _0813C100 + cmp r1, 0x2 + bgt _0813C0E2 + cmp r1, 0x1 + beq _0813C0E8 + b _0813C12A +_0813C0E2: + cmp r1, 0x3 + beq _0813C118 + b _0813C12A +_0813C0E8: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0813C0FC + cmp r0, r1 + bls _0813C12A + strh r1, [r2, 0xA] + b _0813C12A + .align 2, 0 +_0813C0FC: .4byte 0x0000270f +_0813C100: + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0813C114 + cmp r0, r1 + bls _0813C12A + strh r1, [r2, 0xC] + b _0813C12A + .align 2, 0 +_0813C114: .4byte 0x0000270f +_0813C118: + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0813C130 + cmp r0, r1 + bls _0813C12A + strh r1, [r2, 0xE] +_0813C12A: + pop {r0} + bx r0 + .align 2, 0 +_0813C130: .4byte 0x0000270f + thumb_func_end sub_813C0D0 + + thumb_func_start sub_813C134 +sub_813C134: @ 813C134 + push {r4,lr} + cmp r0, 0x2 + beq _0813C14E + cmp r0, 0x2 + bgt _0813C144 + cmp r0, 0x1 + beq _0813C14A + b _0813C166 +_0813C144: + cmp r0, 0x3 + beq _0813C152 + b _0813C166 +_0813C14A: + movs r4, 0x17 + b _0813C154 +_0813C14E: + movs r4, 0x18 + b _0813C154 +_0813C152: + movs r4, 0x19 +_0813C154: + adds r0, r4, 0 + bl sub_80847F8 + ldr r1, _0813C16C + cmp r0, r1 + bhi _0813C166 + adds r0, r4, 0 + bl sav12_xor_increment +_0813C166: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C16C: .4byte 0x0000270e + thumb_func_end sub_813C134 + + thumb_func_start sub_813C170 +sub_813C170: @ 813C170 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + mov r8, r1 + mov r10, r3 + ldr r0, [sp, 0x20] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r10 + bl sub_813C134 + adds r0, r6, 0 + bl sub_813C03C + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_813C008 + adds r5, r0, 0 + cmp r5, 0x5 + bne _0813C1D4 + movs r5, 0x4 + adds r4, r6, 0 + adds r4, 0x40 + adds r0, r4, 0 + bl sub_813BF94 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x7 + bl gf_strncpy + strh r7, [r4, 0x8] + adds r2, r6, 0 + adds r2, 0x54 + ldr r1, _0813C1F4 + mov r3, r9 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x1A] + strb r0, [r2] +_0813C1D4: + lsls r0, r5, 4 + adds r0, r6, r0 + mov r1, r10 + bl sub_813C0D0 + adds r0, r6, 0 + bl sub_813C03C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813C1F4: .4byte 0x020229e8 + thumb_func_end sub_813C170 + + thumb_func_start sub_813C1F8 +sub_813C1F8: @ 813C1F8 + push {lr} + ldr r0, _0813C20C + ldr r0, [r0] + ldr r1, _0813C210 + adds r0, r1 + bl sub_813BFC4 + pop {r0} + bx r0 + .align 2, 0 +_0813C20C: .4byte 0x03005d8c +_0813C210: .4byte 0x00003150 + thumb_func_end sub_813C1F8 + + thumb_func_start sub_813C214 +sub_813C214: @ 813C214 + push {lr} + movs r1, 0x64 + muls r1, r0 + ldr r0, _0813C234 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0813C238 + cmp r0, r2 + bls _0813C230 + strh r2, [r1] +_0813C230: + pop {r0} + bx r0 + .align 2, 0 +_0813C234: .4byte 0x02039b6c +_0813C238: .4byte 0x0000270f + thumb_func_end sub_813C214 + + thumb_func_start sub_813C23C +sub_813C23C: @ 813C23C + push {lr} + movs r1, 0x64 + muls r1, r0 + ldr r0, _0813C25C + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0813C260 + cmp r0, r2 + bls _0813C258 + strh r2, [r1] +_0813C258: + pop {r0} + bx r0 + .align 2, 0 +_0813C25C: .4byte 0x02039b6e +_0813C260: .4byte 0x0000270f + thumb_func_end sub_813C23C + + thumb_func_start sub_813C264 +sub_813C264: @ 813C264 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0813C278 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0813C27C + cmp r0, 0x2 + beq _0813C28A + b _0813C298 + .align 2, 0 +_0813C278: .4byte 0x0202433a +_0813C27C: + eors r0, r4 + bl sub_813C214 + adds r0, r4, 0 + bl sub_813C23C + b _0813C298 +_0813C28A: + movs r0, 0x1 + eors r0, r4 + bl sub_813C23C + adds r0, r4, 0 + bl sub_813C214 +_0813C298: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_813C264 + + thumb_func_start sub_813C2A0 +sub_813C2A0: @ 813C2A0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl in_trade_center + cmp r0, 0x1 + beq _0813C2DA + adds r0, r4, 0 + bl sub_813C264 + ldr r0, _0813C2E4 + ldr r0, [r0] + ldr r1, _0813C2E8 + adds r0, r1 + movs r1, 0x64 + adds r3, r4, 0 + muls r3, r1 + ldr r2, _0813C2EC + adds r1, r3, r2 + subs r2, 0x30 + adds r3, r2 + ldrh r2, [r3, 0xE] + ldr r3, _0813C2F0 + ldrb r3, [r3] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + bl sub_813C170 +_0813C2DA: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C2E4: .4byte 0x03005d8c +_0813C2E8: .4byte 0x00003150 +_0813C2EC: .4byte 0x02039b88 +_0813C2F0: .4byte 0x0202433a + thumb_func_end sub_813C2A0 + + thumb_func_start sub_813C2F4 +sub_813C2F4: @ 813C2F4 + push {r4,lr} + sub sp, 0xC + ldr r4, _0813C36C + movs r0, 0x17 + bl sub_80847F8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _0813C370 + movs r0, 0x18 + bl sub_80847F8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _0813C374 + movs r0, 0x19 + bl sub_80847F8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _0813C378 + ldr r1, _0813C37C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl sub_81DB35C + adds r3, r0, 0 + ldr r0, _0813C380 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x11 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C36C: .4byte 0x02021cc4 +_0813C370: .4byte 0x02021dc4 +_0813C374: .4byte 0x02021ec4 +_0813C378: .4byte 0x02021fc4 +_0813C37C: .4byte 0x085ef6a1 +_0813C380: .4byte 0x0203ab74 + thumb_func_end sub_813C2F4 + + thumb_func_start sub_813C384 +sub_813C384: @ 813C384 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r2, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldrh r0, [r6, 0xA] + cmp r0, 0 + bne _0813C40C + ldr r7, [r6, 0xC] + cmp r7, 0 + bne _0813C40C + ldr r0, _0813C400 + mov r8, r0 + ldrb r0, [r0] + ldr r2, _0813C404 + lsls r4, 3 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + mov r1, r8 + ldrb r0, [r1] + ldr r5, _0813C408 + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x50 + bl Print + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x80 + bl Print + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0xB0 + bl Print + b _0813C4A8 + .align 2, 0 +_0813C400: .4byte 0x0203ab74 +_0813C404: .4byte 0x085b3d84 +_0813C408: .4byte 0x085b3d8c +_0813C40C: + ldr r0, _0813C4B4 + movs r1, 0x8 + bl sub_800917C + ldr r0, _0813C4B4 + adds r1, r6, 0 + movs r2, 0x7 + bl gf_strncpy + lsls r1, r5, 24 + lsrs r1, 24 + ldr r0, _0813C4B4 + bl sub_8009308 + ldr r0, _0813C4B8 + mov r8, r0 + ldrb r0, [r0] + lsls r4, 3 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, _0813C4B4 + movs r3, 0x8 + bl Print + ldrh r1, [r6, 0xA] + ldr r0, _0813C4B4 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, _0813C4B4 + movs r3, 0x50 + bl Print + ldrh r1, [r6, 0xC] + ldr r0, _0813C4B4 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, _0813C4B4 + movs r3, 0x80 + bl Print + ldrh r1, [r6, 0xE] + ldr r0, _0813C4B4 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, _0813C4B4 + movs r3, 0xB0 + bl Print +_0813C4A8: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813C4B4: .4byte 0x02021cc4 +_0813C4B8: .4byte 0x0203ab74 + thumb_func_end sub_813C384 + + thumb_func_start sub_813C4BC +sub_813C4BC: @ 813C4BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r6, _0813C580 + ldr r0, _0813C584 + bl Window_AddFromTemplate + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r5, _0813C588 + ldr r1, _0813C58C + adds r0, r5, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0xD0 + bl sub_81DB35C + adds r3, r0, 0 + ldrb r0, [r6] + 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, r5, 0 + bl Print + ldr r0, _0813C590 + mov r8, r0 + ldr r0, [r0] + ldr r1, _0813C594 + mov r9, r1 + add r0, r9 + bl sub_813C2F4 + ldr r1, _0813C598 + adds r0, r5, 0 + bl ExpandTextCodes + ldrb r0, [r6] + movs r1, 0x29 + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + mov r7, r8 + movs r6, 0xE0 + lsls r6, 19 + mov r5, r9 +_0813C540: + ldr r2, [r7] + adds r0, r2, r5 + lsrs r1, r6, 24 + ldr r3, _0813C59C + adds r2, r3 + adds r2, r4 + ldrb r2, [r2] + bl sub_813C384 + movs r0, 0x80 + lsls r0, 18 + adds r6, r0 + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x4 + ble _0813C540 + ldr r4, _0813C580 + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813C580: .4byte 0x0203ab74 +_0813C584: .4byte 0x085b3d7c +_0813C588: .4byte 0x02021fc4 +_0813C58C: .4byte 0x085ef68d +_0813C590: .4byte 0x03005d8c +_0813C594: .4byte 0x00003150 +_0813C598: .4byte 0x085ef6bd +_0813C59C: .4byte 0x000031a0 + thumb_func_end sub_813C4BC + + thumb_func_start sub_813C5A0 +sub_813C5A0: @ 813C5A0 + push {r4,lr} + ldr r4, _0813C5B8 + ldrb r0, [r4] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C5B8: .4byte 0x0203ab74 + thumb_func_end sub_813C5A0 + + thumb_func_start sub_813C5BC +sub_813C5BC: @ 813C5BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0813C5E0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813C5DC + ldr r0, _0813C5E4 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _0813C5E8 + str r0, [r1] +_0813C5DC: + pop {r0} + bx r0 + .align 2, 0 +_0813C5E0: .4byte 0x02037fd4 +_0813C5E4: .4byte 0x03005e00 +_0813C5E8: .4byte sub_813C5EC + 1 + thumb_func_end sub_813C5BC + + thumb_func_start sub_813C5EC +sub_813C5EC: @ 813C5EC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0813C620 + adds r4, r1, r0 + ldr r0, _0813C624 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0813C610 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0813C61A +_0813C610: + movs r0, 0x5 + bl audio_play + ldr r0, _0813C628 + str r0, [r4] +_0813C61A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C620: .4byte 0x03005e00 +_0813C624: .4byte 0x030022c0 +_0813C628: .4byte sub_813C62C + 1 + thumb_func_end sub_813C5EC + + thumb_func_start sub_813C62C +sub_813C62C: @ 813C62C + 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 sub_80A1AD4 + ldr r1, _0813C65C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0813C660 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C65C: .4byte 0x03005e00 +_0813C660: .4byte sub_813C664 + 1 + thumb_func_end sub_813C62C + + thumb_func_start sub_813C664 +sub_813C664: @ 813C664 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0813C69C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813C694 + ldr r0, _0813C6A0 + bl set_callback2 + ldr r0, _0813C6A4 + ldr r0, [r0] + bl free + movs r0, 0 + bl sub_813C6A8 + bl Window_FreeMemory + adds r0, r4, 0 + bl remove_task +_0813C694: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C69C: .4byte 0x02037fd4 +_0813C6A0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_0813C6A4: .4byte 0x0203ab78 + thumb_func_end sub_813C664 + + thumb_func_start sub_813C6A8 +sub_813C6A8: @ 813C6A8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + bl Window_FillTileMap + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + adds r0, r4, 0 + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_813C6A8 + + thumb_func_start sub_813C6D4 +sub_813C6D4: @ 813C6D4 + 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, _0813C804 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _0813C808 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0813C6FA: + 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 _0813C6FA + 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, _0813C804 + 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 lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813C804: .4byte 0x040000d4 +_0813C808: .4byte 0x81000800 + thumb_func_end sub_813C6D4 + + thumb_func_start sub_813C80C +sub_813C80C: @ 813C80C + push {lr} + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl sub_80A1A74 + bl gpu_pal_allocator_reset + pop {r0} + bx r0 + thumb_func_end sub_813C80C + + thumb_func_start sub_813C828 +sub_813C828: @ 813C828 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + pop {r0} + bx r0 + thumb_func_end sub_813C828 + + thumb_func_start sub_813C880 +sub_813C880: @ 813C880 + push {lr} + movs r1, 0x94 + lsls r1, 4 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end sub_813C880 + + thumb_func_start sub_813C890 +sub_813C890: @ 813C890 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _0813C8CC + adds r0, r4, 0 + movs r2, 0xC0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, _0813C8D0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_iwram_tile_map_rect + ldr r0, _0813C8D4 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813C8CC: .4byte 0x085b3484 +_0813C8D0: .4byte 0x085b3564 +_0813C8D4: .4byte 0x085b3544 + thumb_func_end sub_813C890 + + thumb_func_start sub_813C8D8 +sub_813C8D8: @ 813C8D8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_813C8D8 + + thumb_func_start sub_813C8EC +sub_813C8EC: @ 813C8EC + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_813C8EC + + thumb_func_start sub_813C904 +sub_813C904: @ 813C904 + push {lr} + movs r0, 0 + bl SetVBlankCallback + ldr r0, _0813C918 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0813C918: .4byte sub_813C91C + 1 + thumb_func_end sub_813C904 + + thumb_func_start sub_813C91C +sub_813C91C: @ 813C91C + push {r4,lr} + sub sp, 0x4 + ldr r0, _0813C93C + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x7 + bls _0813C930 + b _0813CA3C +_0813C930: + lsls r0, 2 + ldr r1, _0813C940 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813C93C: .4byte 0x030022c0 +_0813C940: .4byte _0813C944 + .align 2, 0 +_0813C944: + .4byte _0813C964 + .4byte _0813C970 + .4byte _0813C976 + .4byte _0813C9A8 + .4byte _0813C9BE + .4byte _0813C9DE + .4byte _0813C9F0 + .4byte _0813CA14 +_0813C964: + movs r0, 0 + bl SetVBlankCallback + bl sub_813C6D4 + b _0813CA00 +_0813C970: + bl sub_813C80C + b _0813CA00 +_0813C976: + ldr r4, _0813C9A0 + movs r0, 0x80 + lsls r0, 4 + bl malloc_and_clear + str r0, [r4] + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0813C9A4 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + ldr r1, [r4] + movs r0, 0x3 + bl bg_set_tilemap + bl sub_813C828 + b _0813CA00 + .align 2, 0 +_0813C9A0: .4byte 0x0203ab78 +_0813C9A4: .4byte 0x085b3d64 +_0813C9A8: + movs r0, 0x3 + bl sub_813C890 + movs r0, 0 + bl stdpal_get + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + b _0813CA00 +_0813C9BE: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813CA3C + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0813CA00 +_0813C9DE: + ldr r0, _0813C9EC + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + b _0813CA00 + .align 2, 0 +_0813C9EC: .4byte 0x085b3d6c +_0813C9F0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_0813CA00: + ldr r1, _0813CA10 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0813CA3C + .align 2, 0 +_0813CA10: .4byte 0x030022c0 +_0813CA14: + bl sub_813C880 + ldr r0, _0813CA44 + bl SetVBlankCallback + bl sub_81D5C8C + ldr r0, _0813CA48 + movs r1, 0x8 + bl AddTask + ldr r0, _0813CA4C + bl set_callback2 + ldr r0, _0813CA50 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0813CA3C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813CA44: .4byte sub_813C8D8 + 1 +_0813CA48: .4byte sub_813C5BC + 1 +_0813CA4C: .4byte sub_813C8EC + 1 +_0813CA50: .4byte 0x030022c0 + thumb_func_end sub_813C91C + + thumb_func_start sub_813CA54 +sub_813CA54: @ 813CA54 + ldr r0, _0813CA64 + ldr r0, [r0] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + bx lr + .align 2, 0 +_0813CA64: .4byte 0x0203ab7c + thumb_func_end sub_813CA54 + + thumb_func_start sub_813CA68 +sub_813CA68: @ 813CA68 + push {lr} + sub sp, 0x4 + ldr r0, _0813CA88 + ldr r0, [r0] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0813CB20 + lsls r0, 2 + ldr r1, _0813CA8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813CA88: .4byte 0x0203ab7c +_0813CA8C: .4byte _0813CA90 + .align 2, 0 +_0813CA90: + .4byte _0813CAA4 + .4byte _0813CAB4 + .4byte _0813CABA + .4byte _0813CAEC + .4byte _0813CB10 +_0813CAA4: + ldr r0, _0813CAB0 + ldr r0, [r0] + ldrh r0, [r0, 0xE] + bl sub_813CB40 + b _0813CB24 + .align 2, 0 +_0813CAB0: .4byte 0x0203ab7c +_0813CAB4: + bl sub_813CF0C + b _0813CB24 +_0813CABA: + ldr r1, _0813CAE4 + 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, _0813CAE8 + ldr r1, [r0] + movs r0, 0x8B + lsls r0, 1 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + b _0813CB24 + .align 2, 0 +_0813CAE4: .4byte 0x085b3db4 +_0813CAE8: .4byte 0x0203ab7c +_0813CAEC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _0813CB34 + ldr r0, _0813CB04 + ldr r1, _0813CB08 + ldr r2, _0813CB0C + bl CpuSet + b _0813CB24 + .align 2, 0 +_0813CB04: .4byte 0x085b3d94 +_0813CB08: .4byte 0x02037854 +_0813CB0C: .4byte 0x04000008 +_0813CB10: + ldr r1, _0813CB1C + movs r0, 0x2 + movs r2, 0 + bl bg_change_y_offset + b _0813CB24 + .align 2, 0 +_0813CB1C: .4byte 0xfffff800 +_0813CB20: + movs r0, 0 + b _0813CB36 +_0813CB24: + ldr r0, _0813CB3C + ldr r1, [r0] + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0813CB34: + movs r0, 0x1 +_0813CB36: + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_0813CB3C: .4byte 0x0203ab7c + thumb_func_end sub_813CA68 + + thumb_func_start sub_813CB40 +sub_813CB40: @ 813CB40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r7, r0, 16 + ldr r5, _0813CBE8 + ldr r0, [r5] + ldr r1, _0813CBEC + adds r0, r1 + movs r4, 0 + strh r4, [r0] + ldr r0, _0813CBF0 + bl var_get + ldr r1, [r5] + ldr r2, _0813CBF4 + adds r1, r2 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _0813CB70 + strh r4, [r1] +_0813CB70: + ldr r0, _0813CBF8 + ldr r0, [r0] + ldr r3, _0813CBFC + adds r0, r3 + ldrh r1, [r0, 0x8] + cmp r7, r1 + bne _0813CB80 + b _0813CCB8 +_0813CB80: + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 1 + adds r0, r1, r2 + strh r4, [r0] + movs r3, 0x89 + lsls r3, 1 + adds r0, r1, r3 + strh r4, [r0] + movs r6, 0 + ldr r1, _0813CC00 +_0813CB96: + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + bne _0813CBA2 + b _0813CCF8 +_0813CBA2: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _0813CB96 + movs r6, 0 + ldr r4, _0813CC04 + ldrh r0, [r4] + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0813CC44 + mov r8, r4 + adds r5, r4, 0x4 + mov r9, r1 +_0813CBC0: + lsls r0, r6, 1 + adds r1, r0, r6 + lsls r2, r1, 1 + mov r3, r8 + adds r1, r2, r3 + adds r3, r0, 0 + ldrh r1, [r1] + cmp r7, r1 + bne _0813CC2E + adds r0, r4, 0x2 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, 0x18 + beq _0813CC1A + cmp r0, 0x18 + bgt _0813CC08 + cmp r0, 0 + beq _0813CC0E + b _0813CC2E + .align 2, 0 +_0813CBE8: .4byte 0x0203ab7c +_0813CBEC: .4byte 0x000006e2 +_0813CBF0: .4byte 0x0000403e +_0813CBF4: .4byte 0x000006e4 +_0813CBF8: .4byte 0x03005d8c +_0813CBFC: .4byte 0x000031dc +_0813CC00: .4byte 0x085b3ee8 +_0813CC04: .4byte 0x085b3ef0 +_0813CC08: + cmp r0, 0x1A + beq _0813CC1A + b _0813CC2E +_0813CC0E: + adds r0, r2, r5 + ldrh r1, [r0] + movs r0, 0 + bl sub_813CD04 + b _0813CC2E +_0813CC1A: + adds r1, r3, r6 + lsls r1, 1 + mov r0, r8 + adds r0, 0x2 + adds r0, r1, r0 + ldrh r0, [r0] + adds r1, r5 + ldrh r1, [r1] + bl sub_813CD64 +_0813CC2E: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, _0813CC74 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r9 + bne _0813CBC0 +_0813CC44: + movs r6, 0 + ldr r1, _0813CC78 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0813CCF8 +_0813CC4E: + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 2 + adds r5, r0, r1 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_813CE48 + lsls r0, 24 + cmp r0, 0 + beq _0813CC9C + ldrb r0, [r5] + cmp r0, 0x18 + beq _0813CC8C + cmp r0, 0x18 + bgt _0813CC7C + cmp r0, 0 + beq _0813CC82 + b _0813CC9C + .align 2, 0 +_0813CC74: .4byte 0x085b3ef0 +_0813CC78: .4byte 0x08552d48 +_0813CC7C: + cmp r0, 0x1A + beq _0813CC8C + b _0813CC9C +_0813CC82: + ldrb r1, [r5, 0x1] + movs r0, 0 + bl sub_813CD04 + b _0813CC9C +_0813CC8C: + ldr r0, _0813CCB4 + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl sub_813CD64 +_0813CC9C: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, _0813CCB4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0813CC4E + b _0813CCF8 + .align 2, 0 +_0813CCB4: .4byte 0x08552d48 +_0813CCB8: + ldr r2, [r5] + movs r3, 0x89 + lsls r3, 1 + adds r1, r2, r3 + strh r4, [r1] + ldrb r1, [r0, 0x13] + cmp r1, 0 + beq _0813CCF0 + adds r0, r2, 0 + adds r0, 0x10 + adds r1, r2, 0 + adds r1, 0x11 + bl sub_8161F64 + ldr r1, [r5] + ldrb r0, [r1, 0x10] + ldrb r1, [r1, 0x11] + bl get_mapheader_by_bank_and_number + ldr r1, [r5] + ldrb r0, [r0, 0x14] + strh r0, [r1, 0x12] + movs r0, 0x88 + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1] + b _0813CCF8 +_0813CCF0: + movs r3, 0x88 + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] +_0813CCF8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_813CB40 + + thumb_func_start sub_813CD04 +sub_813CD04: @ 813CD04 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r3, r1, 16 + ldr r4, _0813CD60 + ldr r2, [r4] + movs r0, 0x88 + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0x3F + bhi _0813CD58 + lsls r0, 2 + adds r0, r2, r0 + strb r5, [r0, 0x10] + ldr r1, [r4] + movs r2, 0x88 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r1, r0 + strb r3, [r1, 0x11] + adds r0, r5, 0 + adds r1, r3, 0 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + bl sub_8123F9C + ldr r2, [r4] + movs r1, 0x88 + lsls r1, 1 + adds r3, r2, r1 + ldrh r1, [r3] + lsls r1, 2 + adds r2, r1 + strh r0, [r2, 0x12] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_0813CD58: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813CD60: .4byte 0x0203ab7c + thumb_func_end sub_813CD04 + + thumb_func_start sub_813CD64 +sub_813CD64: @ 813CD64 + push {r4-r7,lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _0813CE28 + ldr r0, [r0] + movs r3, 0x89 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0x1F + bhi _0813CE22 + lsls r0, r2, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_813CE34 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xD4 + bhi _0813CE22 + movs r3, 0 + ldr r0, _0813CE2C +_0813CD96: + ldrh r4, [r0] + cmp r5, r4 + beq _0813CE22 + adds r0, 0x2 + adds r3, 0x1 + cmp r3, 0x2 + bls _0813CD96 + ldr r1, _0813CE30 + ldrh r0, [r1] + cmp r0, 0xD5 + beq _0813CDD2 + adds r4, r1, 0 + adds r7, r4, 0 + movs r6, 0 +_0813CDB2: + ldrh r0, [r4] + cmp r5, r0 + bne _0813CDC8 + adds r0, r7, 0x2 + adds r0, r6, r0 + ldrh r0, [r0] + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0813CE22 +_0813CDC8: + adds r4, 0x4 + adds r6, 0x4 + ldrh r0, [r4] + cmp r0, 0xD5 + bne _0813CDB2 +_0813CDD2: + movs r3, 0 + ldr r0, _0813CE28 + ldr r2, [r0] + movs r4, 0x89 + lsls r4, 1 + adds r1, r2, r4 + ldrh r4, [r1] + adds r1, r0, 0 + cmp r3, r4 + bge _0813CE02 + movs r6, 0xC4 + lsls r6, 3 + adds r0, r2, r6 + ldrh r0, [r0] + cmp r0, r5 + beq _0813CE02 + adds r2, r6 +_0813CDF4: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, r4 + bge _0813CE02 + ldrh r0, [r2] + cmp r0, r5 + bne _0813CDF4 +_0813CE02: + ldr r1, [r1] + movs r0, 0x89 + lsls r0, 1 + adds r2, r1, r0 + ldrh r4, [r2] + cmp r3, r4 + bne _0813CE22 + lsls r0, r3, 1 + movs r6, 0xC4 + lsls r6, 3 + adds r1, r6 + adds r1, r0 + strh r5, [r1] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_0813CE22: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813CE28: .4byte 0x0203ab7c +_0813CE2C: .4byte 0x085b3eea +_0813CE30: .4byte 0x085b3efc + thumb_func_end sub_813CD64 + + thumb_func_start sub_813CE34 +sub_813CE34: @ 813CE34 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + thumb_func_end sub_813CE34 + + thumb_func_start sub_813CE48 +sub_813CE48: @ 813CE48 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_813CE34 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xD2 + bne _0813CE7C + ldr r0, _0813CEC0 + ldr r2, [r0] + ldr r0, _0813CEC4 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrh r1, [r1] + ldr r0, _0813CEC8 + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + cmp r1, r0 + bne _0813CEBC +_0813CE7C: + ldr r0, [r4, 0x4] + adds r1, r5, 0 + movs r2, 0xC + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC + ldr r0, [r4, 0x8] + adds r1, r5, 0 + movs r2, 0x5 + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC + ldr r0, [r4, 0x10] + adds r1, r5, 0 + movs r2, 0xC + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC + ldr r0, [r4, 0xC] + adds r1, r5, 0 + movs r2, 0x5 + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC +_0813CEBC: + movs r0, 0 + b _0813CECE + .align 2, 0 +_0813CEC0: .4byte 0x0203ab7c +_0813CEC4: .4byte 0x000006e2 +_0813CEC8: .4byte 0x000006e4 +_0813CECC: + movs r0, 0x1 +_0813CECE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_813CE48 + + thumb_func_start sub_813CED4 +sub_813CED4: @ 813CED4 + push {r4,lr} + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r0, 0 + beq _0813CF02 + movs r3, 0 + cmp r3, r2 + bcs _0813CF02 + ldr r1, [r0, 0x4] +_0813CEEA: + lsls r0, r3, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, r4 + bne _0813CEF8 + movs r0, 0x1 + b _0813CF04 +_0813CEF8: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r2 + bcc _0813CEEA +_0813CF02: + movs r0, 0 +_0813CF04: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813CED4 + + thumb_func_start sub_813CF0C +sub_813CF0C: @ 813CF0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r4, 0 + ldr r2, _0813D11C + adds r7, r2, 0 + movs r6, 0x8B + lsls r6, 1 + movs r5, 0 + ldr r3, _0813D120 +_0813CF26: + ldr r0, [r7] + lsls r1, r4, 1 + adds r0, r6 + adds r0, r1 + strh r5, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r3 + bls _0813CF26 + movs r4, 0 + ldr r0, [r2] + movs r1, 0x88 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bcs _0813CFB2 + adds r3, r2, 0 +_0813CF4C: + movs r5, 0 + movs r6, 0 + adds r2, r4, 0x1 + mov r8, r2 + lsls r4, 2 + mov r9, r4 +_0813CF58: + movs r4, 0 +_0813CF5A: + adds r0, r4, 0 + adds r1, r6, 0 + str r3, [sp] + bl sub_8123E9C + ldr r3, [sp] + ldr r2, [r3] + mov r7, r9 + adds r1, r2, r7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1, 0x12] + cmp r0, r1 + bne _0813CF84 + lsls r0, r5, 1 + movs r7, 0x8B + lsls r7, 1 + adds r1, r2, r7 + adds r1, r0 + ldr r0, _0813D124 + strh r0, [r1] +_0813CF84: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bls _0813CF5A + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bls _0813CF58 + mov r1, r8 + lsls r0, r1, 16 + lsrs r4, r0, 16 + ldr r0, [r3] + movs r2, 0x88 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r4, r0 + bcc _0813CF4C +_0813CFB2: + movs r5, 0 + movs r6, 0 + ldr r7, _0813D11C + mov r12, r7 + movs r7, 0x8B + lsls r7, 1 + ldr r3, _0813D124 +_0813CFC0: + movs r4, 0 + adds r1, r6, 0x1 + mov r9, r1 +_0813CFC6: + mov r2, r12 + ldr r0, [r2] + lsls r1, r5, 1 + adds r2, r0, r7 + adds r1, r2, r1 + ldrh r0, [r1] + adds r1, r5, 0x1 + mov r8, r1 + cmp r0, r3 + bne _0813D0D2 + cmp r4, 0 + beq _0813CFF0 + subs r0, r5, 0x1 + lsls r0, 1 + adds r1, r2, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813CFF0 + movs r0, 0x2 + orrs r0, r2 + strh r0, [r1] +_0813CFF0: + adds r2, r5, 0x1 + mov r8, r2 + cmp r4, 0x1F + beq _0813D00E + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 1 + adds r0, r7 + adds r2, r0, r1 + ldrh r1, [r2] + cmp r1, r3 + beq _0813D00E + movs r0, 0x1 + orrs r0, r1 + strh r0, [r2] +_0813D00E: + cmp r6, 0 + beq _0813D02C + mov r2, r12 + ldr r1, [r2] + adds r0, r5, 0 + subs r0, 0x20 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D02C + movs r0, 0x8 + orrs r0, r2 + strh r0, [r1] +_0813D02C: + cmp r6, 0x13 + beq _0813D04A + mov r0, r12 + ldr r1, [r0] + adds r0, r5, 0 + adds r0, 0x20 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D04A + movs r0, 0x4 + orrs r0, r2 + strh r0, [r1] +_0813D04A: + cmp r4, 0 + beq _0813D06C + cmp r6, 0 + beq _0813D06C + mov r2, r12 + ldr r1, [r2] + adds r0, r5, 0 + subs r0, 0x21 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D06C + movs r0, 0x10 + orrs r0, r2 + strh r0, [r1] +_0813D06C: + cmp r4, 0x1F + beq _0813D08E + cmp r6, 0 + beq _0813D08E + mov r0, r12 + ldr r1, [r0] + adds r0, r5, 0 + subs r0, 0x1F + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D08E + movs r0, 0x40 + orrs r0, r2 + strh r0, [r1] +_0813D08E: + cmp r4, 0 + beq _0813D0B0 + cmp r6, 0x13 + beq _0813D0B0 + mov r2, r12 + ldr r1, [r2] + adds r0, r5, 0 + adds r0, 0x1F + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D0B0 + movs r0, 0x20 + orrs r0, r2 + strh r0, [r1] +_0813D0B0: + cmp r4, 0x1F + beq _0813D0D2 + cmp r6, 0x13 + beq _0813D0D2 + mov r0, r12 + ldr r1, [r0] + adds r0, r5, 0 + adds r0, 0x21 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D0D2 + movs r0, 0x80 + orrs r0, r2 + strh r0, [r1] +_0813D0D2: + mov r1, r8 + lsls r0, r1, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bhi _0813D0E4 + b _0813CFC6 +_0813D0E4: + mov r2, r9 + lsls r0, r2, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bhi _0813D0F0 + b _0813CFC0 +_0813D0F0: + movs r4, 0 + ldr r6, _0813D11C + movs r5, 0x8B + lsls r5, 1 + ldr r7, _0813D124 + mov r12, r7 + movs r0, 0xA0 + lsls r0, 8 + mov r9, r0 + ldr r7, _0813D128 + ldr r1, _0813D12C + mov r8, r1 +_0813D108: + ldr r0, [r6] + lsls r3, r4, 1 + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + adds r0, r1, 0 + cmp r0, r12 + bne _0813D130 + strh r7, [r2] + b _0813D198 + .align 2, 0 +_0813D11C: .4byte 0x0203ab7c +_0813D120: .4byte 0x0000027f +_0813D124: .4byte 0x0000ffff +_0813D128: .4byte 0x0000a010 +_0813D12C: .4byte 0x0000ffcf +_0813D130: + cmp r0, 0 + beq _0813D198 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0813D142 + mov r0, r8 + ands r0, r1 + strh r0, [r2] +_0813D142: + ldr r0, [r6] + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0813D158 + ldr r0, _0813D1B4 + ands r0, r1 + strh r0, [r2] +_0813D158: + ldr r0, [r6] + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0813D16E + ldr r0, _0813D1B8 + ands r0, r1 + strh r0, [r2] +_0813D16E: + ldr r0, [r6] + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0813D184 + ldr r0, _0813D1BC + ands r0, r1 + strh r0, [r2] +_0813D184: + ldr r1, [r6] + adds r1, r5 + adds r1, r3 + ldr r2, _0813D1C0 + ldrh r0, [r1] + adds r0, r2 + ldrb r0, [r0] + mov r2, r9 + orrs r0, r2 + strh r0, [r1] +_0813D198: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0813D1C4 + cmp r4, r0 + bls _0813D108 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813D1B4: .4byte 0x0000ff3f +_0813D1B8: .4byte 0x0000ffaf +_0813D1BC: .4byte 0x0000ff5f +_0813D1C0: .4byte 0x085b3f18 +_0813D1C4: .4byte 0x0000027f + thumb_func_end sub_813CF0C + + thumb_func_start sub_813D1C8 +sub_813D1C8: @ 813D1C8 + push {lr} + ldr r1, _0813D1F4 + ldr r2, [r1] + movs r3, 0x89 + lsls r3, 1 + adds r0, r2, r3 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0 + beq _0813D1FC + movs r1, 0x88 + lsls r1, 1 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _0813D1FC + ldr r0, _0813D1F8 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + b _0813D206 + .align 2, 0 +_0813D1F4: .4byte 0x0203ab7c +_0813D1F8: .4byte 0x0000061e +_0813D1FC: + ldr r0, [r3] + ldr r1, _0813D248 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0813D206: + ldr r1, [r3] + ldr r2, _0813D24C + adds r0, r1, r2 + movs r2, 0 + strh r2, [r0] + movs r3, 0xC3 + lsls r3, 3 + adds r0, r1, r3 + strh r2, [r0] + adds r3, 0x2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _0813D250 + adds r2, r1, r0 + movs r0, 0x40 + strh r0, [r2] + ldr r2, _0813D254 + adds r1, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0813D258 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + bl sub_813D25C + pop {r0} + bx r0 + .align 2, 0 +_0813D248: .4byte 0x0000061e +_0813D24C: .4byte 0x00000616 +_0813D250: .4byte 0x0000061c +_0813D254: .4byte 0x0000061f +_0813D258: .4byte 0x00003f44 + thumb_func_end sub_813D1C8 + + thumb_func_start sub_813D25C +sub_813D25C: @ 813D25C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0813D298 + ldr r2, [r0] + ldr r3, _0813D29C + adds r1, r2, r3 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + bne _0813D32A + ldr r0, _0813D2A0 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0813D324 + movs r1, 0xC3 + lsls r1, 3 + adds r0, r2, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0813D2A4 + subs r3, 0x4 + adds r0, r2, r3 + b _0813D2A8 + .align 2, 0 +_0813D298: .4byte 0x0203ab7c +_0813D29C: .4byte 0x0000061e +_0813D2A0: .4byte 0x00000616 +_0813D2A4: + ldr r1, _0813D310 + adds r0, r2, r1 +_0813D2A8: + ldrh r1, [r0] + adds r1, 0x4 + movs r2, 0x7F + ands r1, r2 + strh r1, [r0] + ldr r3, _0813D314 + ldr r1, [r7] + ldr r2, _0813D318 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r3 + ldrh r2, [r0] + lsls r2, 16 + asrs r2, 20 + lsls r2, 16 + ldr r0, _0813D310 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 20 + lsls r1, 24 + orrs r1, r2 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldr r1, [r7] + ldr r2, _0813D31C + adds r0, r1, r2 + movs r3, 0 + strh r3, [r0] + movs r0, 0xC3 + lsls r0, 3 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0x40 + bne _0813D3C6 + strh r3, [r2] + movs r2, 0x89 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + beq _0813D3C6 + ldr r3, _0813D320 + adds r1, r3 + movs r0, 0x1 + b _0813D3C4 + .align 2, 0 +_0813D310: .4byte 0x0000061c +_0813D314: .4byte 0x08329f40 +_0813D318: .4byte 0x0000061a +_0813D31C: .4byte 0x00000616 +_0813D320: .4byte 0x0000061e +_0813D324: + subs r0, 0x1 + strh r0, [r1] + b _0813D3C6 +_0813D32A: + ldr r0, _0813D3D0 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC + bls _0813D3C6 + movs r0, 0 + strh r0, [r1] + ldr r3, _0813D3D4 + adds r1, r2, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r4, 0 + ldr r0, [r7] + movs r6, 0x89 + lsls r6, 1 + adds r0, r6 + ldrh r0, [r0] + cmp r4, r0 + bcs _0813D3A0 + adds r5, r7, 0 + movs r0, 0x1 + mov r12, r0 + movs r1, 0x5 + negs r1, r1 + mov r8, r1 +_0813D366: + ldr r1, [r5] + lsls r2, r4, 2 + movs r3, 0xCC + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2 + ldr r3, [r0] + ldr r0, _0813D3D4 + adds r1, r0 + ldrb r0, [r1] + movs r1, 0x1 + adds r3, 0x3E + ands r1, r0 + mov r2, r12 + ands r1, r2 + lsls r1, 2 + ldrb r2, [r3] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + adds r0, r6 + ldrh r0, [r0] + cmp r4, r0 + bcc _0813D366 +_0813D3A0: + ldr r0, [r7] + ldr r3, _0813D3D4 + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0x4 + bls _0813D3C6 + movs r0, 0x1 + strb r0, [r1] + ldr r1, [r7] + movs r2, 0x88 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + beq _0813D3C6 + subs r3, 0x1 + adds r1, r3 + movs r0, 0 +_0813D3C4: + strb r0, [r1] +_0813D3C6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813D3D0: .4byte 0x00000616 +_0813D3D4: .4byte 0x0000061f + thumb_func_end sub_813D25C + + thumb_func_start sub_813D3D8 +sub_813D3D8: @ 813D3D8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, _0813D41C + ldr r0, _0813D420 + bl malloc_and_clear + str r0, [r5] + movs r1, 0 + movs r5, 0 + strh r4, [r0, 0xE] + movs r2, 0xDD + lsls r2, 3 + adds r0, r2 + str r6, [r0] + strb r1, [r6] + ldr r0, _0813D424 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813D428 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813D41C: .4byte 0x0203ab7c +_0813D420: .4byte 0x000015bc +_0813D424: .4byte sub_813D42C + 1 +_0813D428: .4byte 0x03005e00 + thumb_func_end sub_813D3D8 + + thumb_func_start sub_813D42C +sub_813D42C: @ 813D42C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0813D454 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0xB + bls _0813D44A + b _0813D584 +_0813D44A: + lsls r0, 2 + ldr r1, _0813D458 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813D454: .4byte 0x03005e00 +_0813D458: .4byte _0813D45C + .align 2, 0 +_0813D45C: + .4byte _0813D48C + .4byte _0813D4A8 + .4byte _0813D4D4 + .4byte _0813D4E6 + .4byte _0813D4EC + .4byte _0813D4F8 + .4byte _0813D520 + .4byte _0813D526 + .4byte _0813D52C + .4byte _0813D532 + .4byte _0813D544 + .4byte _0813D56C +_0813D48C: + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0x3 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0 + bl gpu_sync_bg_hide + b _0813D584 +_0813D4A8: + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x3 + bl gpu_bg_config_set_field + ldr r0, _0813D4CC + bl sub_81C4D70 + ldr r0, _0813D4D0 + ldr r0, [r0] + movs r1, 0xF7 + lsls r1, 4 + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl sub_80090FC + b _0813D584 + .align 2, 0 +_0813D4CC: .4byte 0x085b4018 +_0813D4D0: .4byte 0x0203ab7c +_0813D4D4: + bl sub_81C4E90 + cmp r0, 0x1 + beq _0813D594 + movs r0, 0x8 + negs r0, r0 + bl sub_81C4ED0 + b _0813D584 +_0813D4E6: + bl sub_813CA54 + b _0813D584 +_0813D4EC: + bl sub_813CA68 + lsls r0, 24 + cmp r0, 0 + bne _0813D594 + b _0813D584 +_0813D4F8: + ldr r0, _0813D518 + ldr r0, [r0] + ldr r2, _0813D51C + adds r0, r2 + bl sub_8122D88 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8124288 + movs r1, 0x8 + negs r1, r1 + movs r0, 0 + bl sub_8123824 + b _0813D584 + .align 2, 0 +_0813D518: .4byte 0x0203ab7c +_0813D51C: .4byte 0x000006ec +_0813D520: + bl sub_813D6D0 + b _0813D584 +_0813D526: + bl sub_813D8A8 + b _0813D584 +_0813D52C: + bl sub_813D8E8 + b _0813D584 +_0813D532: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _0813D584 +_0813D544: + ldr r1, _0813D568 + movs r0, 0x50 + bl lcd_io_set + bl sub_813D1C8 + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r1, 0x80 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set_bits + b _0813D584 + .align 2, 0 +_0813D568: .4byte 0x00003f41 +_0813D56C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldr r1, _0813D580 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0x8] + b _0813D594 + .align 2, 0 +_0813D580: .4byte sub_813D5A0 + 1 +_0813D584: + ldr r0, _0813D59C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0813D594: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813D59C: .4byte 0x03005e00 + thumb_func_end sub_813D42C + + thumb_func_start sub_813D5A0 +sub_813D5A0: @ 813D5A0 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_813D25C + ldr r1, _0813D5C8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r1 + movs r0, 0x8 + ldrsh r1, [r6, r0] + cmp r1, 0x1 + beq _0813D5F8 + cmp r1, 0x1 + bgt _0813D5CC + cmp r1, 0 + beq _0813D5E2 + b _0813D5D4 + .align 2, 0 +_0813D5C8: .4byte 0x03005e00 +_0813D5CC: + cmp r1, 0x2 + beq _0813D640 + cmp r1, 0x3 + beq _0813D652 +_0813D5D4: + ldr r0, _0813D5F0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] +_0813D5E2: + ldr r0, _0813D5F4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813D6A8 + b _0813D698 + .align 2, 0 +_0813D5F0: .4byte 0x03005e00 +_0813D5F4: .4byte 0x02037fd4 +_0813D5F8: + ldr r0, _0813D610 + ldrh r2, [r0, 0x2E] + movs r3, 0x2 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _0813D614 + strh r1, [r6, 0xA] + movs r0, 0x3 + bl audio_play + b _0813D698 + .align 2, 0 +_0813D610: .4byte 0x030022c0 +_0813D614: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _0813D630 + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _0813D6A8 + ldr r0, _0813D63C + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _0813D6A8 +_0813D630: + strh r3, [r6, 0xA] + movs r0, 0x6D + bl audio_play + b _0813D698 + .align 2, 0 +_0813D63C: .4byte 0x03005d90 +_0813D640: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _0813D698 +_0813D652: + ldr r0, _0813D690 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0813D6A8 + bl sub_813D824 + ldr r4, _0813D694 + ldr r0, [r4] + movs r1, 0xDD + lsls r1, 3 + adds r0, r1 + ldr r1, [r0] + ldrh r0, [r6, 0xA] + strb r0, [r1] + bl sub_813D6B4 + adds r0, r5, 0 + bl remove_task + bl sub_81C4EB4 + ldr r0, [r4] + bl free + str r7, [r4] + b _0813D6A8 + .align 2, 0 +_0813D690: .4byte 0x02037fd4 +_0813D694: .4byte 0x0203ab7c +_0813D698: + ldr r0, _0813D6B0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0813D6A8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813D6B0: .4byte 0x03005e00 + thumb_func_end sub_813D5A0 + + thumb_func_start sub_813D6B4 +sub_813D6B4: @ 813D6B4 + push {lr} + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0x3 + movs r1, 0x4 + movs r2, 0 + bl gpu_bg_config_set_field + pop {r0} + bx r0 + thumb_func_end sub_813D6B4 + + thumb_func_start sub_813D6D0 +sub_813D6D0: @ 813D6D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _0813D7F8 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0813D7FC + bl gpu_pal_obj_alloc_tag_and_apply + ldr r0, _0813D800 + movs r1, 0 + strh r1, [r0] + ldr r2, _0813D804 + strh r1, [r2] + ldr r1, _0813D808 + ldr r0, [r1] + movs r3, 0x89 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _0813D7D8 + ldr r5, _0813D80C + mov r10, r1 + adds r7, r2, 0 + ldr r0, _0813D810 + mov r9, r0 + ldr r6, _0813D814 + ldr r1, _0813D818 + mov r8, r1 +_0813D710: + mov r2, r10 + ldr r1, [r2] + movs r3, 0 + ldrsh r0, [r7, r3] + lsls r0, 1 + movs r2, 0xC4 + lsls r2, 3 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r5] + movs r3, 0 + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r0, r6 + ldrb r1, [r0] + adds r1, 0x1 + lsls r1, 3 + adds r1, 0x4 + mov r0, r9 + strh r1, [r0] + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r0, r6 + ldrb r2, [r0, 0x1] + lsls r2, 3 + adds r2, 0x1C + mov r3, r8 + strh r2, [r3] + movs r3, 0 + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x2] + subs r0, 0x1 + lsls r0, 2 + adds r1, r0 + mov r0, r9 + strh r1, [r0] + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x3] + subs r0, 0x1 + lsls r0, 2 + adds r2, r0 + mov r3, r8 + strh r2, [r3] + mov r0, r9 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, _0813D81C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0813D7BE + ldr r0, _0813D820 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + mov r1, r10 + ldr r3, [r1] + ldr r4, _0813D800 + ldrh r1, [r4] + adds r0, r1, 0x1 + strh r0, [r4] + lsls r1, 16 + asrs r1, 14 + movs r0, 0xCC + lsls r0, 3 + adds r3, r0 + adds r3, r1 + str r2, [r3] +_0813D7BE: + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + movs r2, 0 + ldrsh r1, [r7, r2] + mov r3, r10 + ldr r0, [r3] + movs r2, 0x89 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r1, r0 + blt _0813D710 +_0813D7D8: + ldr r0, _0813D808 + ldr r0, [r0] + ldr r1, _0813D800 + ldrh r1, [r1] + movs r3, 0xDC + lsls r3, 3 + adds r0, r3 + strh r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813D7F8: .4byte 0x085b401c +_0813D7FC: .4byte 0x085b4024 +_0813D800: .4byte 0x03001204 +_0813D804: .4byte 0x03001200 +_0813D808: .4byte 0x0203ab7c +_0813D80C: .4byte 0x03001202 +_0813D810: .4byte 0x030011fc +_0813D814: .4byte 0x085a147c +_0813D818: .4byte 0x030011fe +_0813D81C: .4byte 0x085b4034 +_0813D820: .4byte 0x02020630 + thumb_func_end sub_813D6D0 + + thumb_func_start sub_813D824 +sub_813D824: @ 813D824 + push {r4,r5,lr} + movs r0, 0x2 + bl gpu_tile_obj_free_by_tag + movs r0, 0x2 + bl gpu_pal_free_tag + movs r4, 0 + ldr r1, _0813D8A4 + ldr r0, [r1] + movs r2, 0xDC + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + cmp r4, r0 + bcs _0813D86C + adds r5, r1, 0 +_0813D846: + ldr r0, [r5] + lsls r1, r4, 2 + movs r2, 0xCC + lsls r2, 3 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + movs r1, 0xDC + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bcc _0813D846 +_0813D86C: + movs r0, 0x3 + bl gpu_tile_obj_free_by_tag + movs r0, 0x3 + bl gpu_pal_free_tag + movs r4, 0 +_0813D87A: + ldr r0, _0813D8A4 + ldr r0, [r0] + lsls r1, r4, 2 + movs r2, 0xFB + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0813D892 + bl obj_delete_and_free_tiles +_0813D892: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _0813D87A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0813D8A4: .4byte 0x0203ab7c + thumb_func_end sub_813D824 + + thumb_func_start sub_813D8A8 +sub_813D8A8: @ 813D8A8 + push {lr} + sub sp, 0x8 + ldr r0, _0813D8D4 + ldr r1, [r0] + ldr r0, _0813D8D8 + adds r1, r0 + str r1, [sp] + ldr r0, _0813D8DC + str r0, [sp, 0x4] + ldr r0, _0813D8E0 + bl LZ77UnCompWram + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _0813D8E4 + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_0813D8D4: .4byte 0x0203ab7c +_0813D8D8: .4byte 0x00000fbc +_0813D8DC: .4byte 0x00030600 +_0813D8E0: .4byte 0x08dc4140 +_0813D8E4: .4byte 0x085b40ec + thumb_func_end sub_813D8A8 + + thumb_func_start sub_813D8E8 +sub_813D8E8: @ 813D8E8 + push {r4-r6,lr} + ldr r1, _0813D91C + ldr r0, [r1] + movs r2, 0x88 + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0813D920 + movs r4, 0 + adds r5, r1, 0 + movs r3, 0xFB + lsls r3, 4 + movs r2, 0 +_0813D904: + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r3 + adds r0, r1 + str r2, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _0813D904 + b _0813D9A4 + .align 2, 0 +_0813D91C: .4byte 0x0203ab7c +_0813D920: + movs r4, 0 + ldr r5, _0813D974 +_0813D924: + lsls r1, r4, 21 + movs r6, 0xA0 + lsls r6, 16 + adds r1, r6 + asrs r1, 16 + ldr r0, _0813D978 + movs r2, 0x8C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0813D988 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r5 + ldrh r2, [r3, 0x4] + lsls r0, r2, 22 + lsrs r0, 22 + lsls r1, r4, 4 + adds r0, r1 + ldr r6, _0813D97C + adds r1, r6, 0 + ands r0, r1 + ldr r6, _0813D980 + adds r1, r6, 0 + ands r2, r1 + orrs r2, r0 + strh r2, [r3, 0x4] + ldr r0, _0813D984 + ldr r0, [r0] + lsls r1, r4, 2 + movs r2, 0xFB + lsls r2, 4 + adds r0, r2 + adds r0, r1 + str r3, [r0] + b _0813D99A + .align 2, 0 +_0813D974: .4byte 0x02020630 +_0813D978: .4byte 0x085b40fc +_0813D97C: .4byte 0x000003ff +_0813D980: .4byte 0xfffffc00 +_0813D984: .4byte 0x0203ab7c +_0813D988: + ldr r0, _0813D9AC + ldr r1, [r0] + lsls r0, r4, 2 + movs r6, 0xFB + lsls r6, 4 + adds r1, r6 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_0813D99A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _0813D924 +_0813D9A4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813D9AC: .4byte 0x0203ab7c + thumb_func_end sub_813D8E8 + + thumb_func_start sub_813D9B0 +sub_813D9B0: @ 813D9B0 + push {lr} + bl fade_and_return_progress_probably + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_813D9B0 + + thumb_func_start sub_813D9C0 +sub_813D9C0: @ 813D9C0 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + movs r7, 0 + ldr r1, _0813D9E4 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0813D9E8 + cmp r0, 0x1 + beq _0813DA00 + b _0813DA30 + .align 2, 0 +_0813D9E4: .4byte 0x03005e00 +_0813D9E8: + movs r0, 0x1 + negs r0, r0 + str r7, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0813DA30 +_0813DA00: + ldr r0, _0813DA38 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813DA30 + movs r0, 0x1C + ldrsh r1, [r6, r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0813DA3C + adds r7, r1, r0 + ldrh r4, [r6, 0xC] + ldrb r5, [r6, 0xE] + ldrb r6, [r6, 0x1C] + adds r0, r2, 0 + bl remove_task + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl evolution_cutscene +_0813DA30: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813DA38: .4byte 0x02037fd4 +_0813DA3C: .4byte 0x020244ec + thumb_func_end sub_813D9C0 + + thumb_func_start sub_813DA40 +sub_813DA40: @ 813DA40 + push {r4-r6,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _0813DA80 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0813DA84 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x1C] + ldr r0, _0813DA88 + bl set_callback2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813DA80: .4byte sub_813D9C0 + 1 +_0813DA84: .4byte 0x03005e00 +_0813DA88: .4byte sub_813D9B0 + 1 + thumb_func_end sub_813DA40 + + thumb_func_start evolution_cutscene +evolution_cutscene: @ 813DA8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r4, r0, 0 + mov r10, r1 + mov r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r1, 0 + str r1, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _0813DD10 + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + bl sub_80A1A74 + ldr r0, _0813DD14 + movs r2, 0 + strh r2, [r0] + ldr r0, _0813DD18 + strh r2, [r0] + ldr r0, _0813DD1C + strh r2, [r0] + ldr r0, _0813DD20 + strh r2, [r0] + ldr r0, _0813DD24 + strh r2, [r0] + ldr r0, _0813DD28 + strh r2, [r0] + ldr r1, _0813DD2C + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0813DD30 + movs r1, 0 + strh r1, [r0] + ldr r1, _0813DD34 + movs r0, 0x9 + strb r0, [r1] + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl reset_all_obj_data + bl remove_some_task + bl clear_tasks + bl gpu_pal_allocator_reset + ldr r0, _0813DD38 + movs r2, 0x4 + strb r2, [r0] + movs r0, 0x64 + bl malloc_and_clear + ldr r1, _0813DD3C + str r0, [r1] + bl init_uns_table_pokemon_copy + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _0813DD40 + mov r1, sp + bl strcpy_limit_10_chars + ldr r0, _0813DD44 + movs r1, 0xB + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + ldr r2, _0813DD48 + adds r1, r2 + bl gf_strcpy + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x20] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + lsls r0, r5, 3 + ldr r1, _0813DD4C + adds r0, r1 + ldr r2, _0813DD50 + ldr r1, [r2] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + bl LZ77UnCompAnyRam + adds r0, r5, 0 + ldr r1, [sp, 0x20] + mov r2, r9 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, _0813DD54 + mov r8, r0 + ldr r1, _0813DD58 + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl obj_add_from_template_forward_search + ldr r1, _0813DD3C + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r3, r1, 24 + strb r0, [r2] + ldr r7, _0813DD5C + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r6, r7, 0 + adds r6, 0x1C + adds r0, r1, r6 + ldr r2, _0813DD60 + str r2, [r0] + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r4, 0xF + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + mov r1, r10 + lsls r0, r1, 3 + ldr r2, _0813DD4C + adds r0, r2 + ldr r2, _0813DD50 + ldr r1, [r2] + ldr r1, [r1, 0x10] + mov r2, r10 + bl LZ77UnCompAnyRam + mov r0, r10 + ldr r1, [sp, 0x20] + mov r2, r9 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + mov r0, r10 + movs r1, 0x3 + bl sub_806A068 + ldr r0, _0813DD58 + mov r1, r8 + str r0, [r1, 0x10] + mov r0, r8 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl obj_add_from_template_forward_search + ldr r1, _0813DD3C + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r3, r1, 24 + strb r0, [r2, 0x1] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r6, r1, r6 + ldr r2, _0813DD60 + str r2, [r6] + adds r1, r7 + ldrb r0, [r1, 0x5] + ands r4, r0 + movs r0, 0x20 + orrs r4, r0 + strb r4, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_817BE78 + ldr r0, _0813DD64 + movs r1, 0 + bl AddTask + ldr r1, _0813DD3C + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r3, r1, 24 + strb r0, [r2, 0x2] + ldr r1, _0813DD68 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x8] + strh r5, [r0, 0xA] + mov r1, r10 + strh r1, [r0, 0xC] + mov r2, sp + ldrh r2, [r2, 0x18] + strh r2, [r0, 0xE] + movs r1, 0x1 + strh r1, [r0, 0x10] + movs r1, 0 + strh r1, [r0, 0x1A] + mov r2, sp + ldrh r2, [r2, 0x1C] + strh r2, [r0, 0x1C] + ldr r1, _0813DD3C + ldr r0, [r1] + ldr r1, _0813DD6C + adds r0, 0x4 + movs r2, 0x60 + bl memcpy + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _0813DD70 + bl SetHBlankCallback + ldr r0, _0813DD74 + bl SetVBlankCallback + bl m4aMPlayAllStop + ldr r0, _0813DD78 + bl set_callback2 + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813DD10: .4byte 0x05006000 +_0813DD14: .4byte 0x02022e14 +_0813DD18: .4byte 0x02022e16 +_0813DD1C: .4byte 0x02022e18 +_0813DD20: .4byte 0x02022e1a +_0813DD24: .4byte 0x02022e1c +_0813DD28: .4byte 0x02022e1e +_0813DD2C: .4byte 0x02022e20 +_0813DD30: .4byte 0x02022e22 +_0813DD34: .4byte 0x02022ff0 +_0813DD38: .4byte 0x0300301c +_0813DD3C: .4byte 0x0203ab80 +_0813DD40: .4byte 0x02021cc4 +_0813DD44: .4byte 0x02021dc4 +_0813DD48: .4byte 0x083185c8 +_0813DD4C: .4byte 0x0830a18c +_0813DD50: .4byte 0x020244d4 +_0813DD54: .4byte 0x0202499c +_0813DD58: .4byte 0x082ec6a8 +_0813DD5C: .4byte 0x02020630 +_0813DD60: .4byte nullsub_18 + 1 +_0813DD64: .4byte sub_813E570 + 1 +_0813DD68: .4byte 0x03005e00 +_0813DD6C: .4byte 0x02037754 +_0813DD70: .4byte nullsub_83 + 1 +_0813DD74: .4byte sub_813FCDC + 1 +_0813DD78: .4byte sub_813E3A4 + 1 + thumb_func_end evolution_cutscene + + thumb_func_start sub_813DD7C +sub_813DD7C: @ 813DD7C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + ldr r2, _0813DF14 + ldr r0, _0813DF18 + mov r8, r0 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1C + ldrsh r2, [r0, r1] + movs r1, 0x64 + adds r4, r2, 0 + muls r4, r1 + ldr r1, _0813DF1C + adds r4, r1 + ldrh r5, [r0, 0xC] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r6, r0, 0 + 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, _0813DF20 + add r0, sp, 0x4 + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + bl sub_80A1A74 + ldr r0, _0813DF24 + strh r4, [r0] + ldr r0, _0813DF28 + strh r4, [r0] + ldr r0, _0813DF2C + strh r4, [r0] + ldr r0, _0813DF30 + strh r4, [r0] + ldr r0, _0813DF34 + strh r4, [r0] + ldr r0, _0813DF38 + strh r4, [r0] + ldr r1, _0813DF3C + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0813DF40 + strh r4, [r0] + ldr r1, _0813DF44 + movs r0, 0x9 + strb r0, [r1] + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _0813DF48 + movs r0, 0x4 + strb r0, [r1] + lsls r0, r5, 3 + ldr r1, _0813DF4C + adds r0, r1 + ldr r1, _0813DF50 + ldr r1, [r1] + ldr r1, [r1, 0x10] + adds r2, r5, 0 + bl LZ77UnCompAnyRam + adds r0, r5, 0 + mov r1, r9 + adds r2, r6, 0 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0x3 + bl sub_806A068 + ldr r0, _0813DF54 + ldr r1, _0813DF58 + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl obj_add_from_template_forward_search + mov r2, r8 + ldr r1, [r2] + lsls r2, r0, 24 + lsrs r2, 24 + strb r0, [r1, 0x1] + ldr r3, _0813DF5C + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, _0813DF60 + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _0813DF64 + bl SetHBlankCallback + ldr r0, _0813DF68 + bl SetVBlankCallback + ldr r0, _0813DF6C + bl set_callback2 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813DF14: .4byte 0x03005e00 +_0813DF18: .4byte 0x0203ab80 +_0813DF1C: .4byte 0x020244ec +_0813DF20: .4byte 0x05006000 +_0813DF24: .4byte 0x02022e14 +_0813DF28: .4byte 0x02022e16 +_0813DF2C: .4byte 0x02022e18 +_0813DF30: .4byte 0x02022e1a +_0813DF34: .4byte 0x02022e1c +_0813DF38: .4byte 0x02022e1e +_0813DF3C: .4byte 0x02022e20 +_0813DF40: .4byte 0x02022e22 +_0813DF44: .4byte 0x02022ff0 +_0813DF48: .4byte 0x0300301c +_0813DF4C: .4byte 0x0830a18c +_0813DF50: .4byte 0x020244d4 +_0813DF54: .4byte 0x0202499c +_0813DF58: .4byte 0x082ec6a8 +_0813DF5C: .4byte 0x02020630 +_0813DF60: .4byte nullsub_18 + 1 +_0813DF64: .4byte nullsub_83 + 1 +_0813DF68: .4byte sub_813FCDC + 1 +_0813DF6C: .4byte sub_813E3A4 + 1 + thumb_func_end sub_813DD7C + + thumb_func_start sub_813DF70 +sub_813DF70: @ 813DF70 + push {r4-r6,lr} + sub sp, 0xC + ldr r2, _0813DFAC + ldr r0, _0813DFB0 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1C + ldrsh r2, [r0, r1] + movs r1, 0x64 + muls r2, r1 + ldr r1, _0813DFB4 + adds r4, r2, r1 + ldrh r6, [r0, 0xC] + ldr r0, _0813DFB8 + movs r3, 0x87 + lsls r3, 3 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x7 + bls _0813DFA2 + b _0813E1C8 +_0813DFA2: + lsls r0, 2 + ldr r1, _0813DFBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813DFAC: .4byte 0x03005e00 +_0813DFB0: .4byte 0x0203ab80 +_0813DFB4: .4byte 0x020244ec +_0813DFB8: .4byte 0x030022c0 +_0813DFBC: .4byte _0813DFC0 + .align 2, 0 +_0813DFC0: + .4byte _0813DFE0 + .4byte _0813E050 + .4byte _0813E078 + .4byte _0813E07E + .4byte _0813E0A8 + .4byte _0813E0F0 + .4byte _0813E160 + .4byte _0813E198 +_0813DFE0: + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _0813E02C + movs r0, 0x4 + strb r0, [r1] + ldr r0, _0813E030 + movs r1, 0 + strh r1, [r0] + ldr r0, _0813E034 + strh r1, [r0] + ldr r0, _0813E038 + strh r1, [r0] + ldr r0, _0813E03C + strh r1, [r0] + ldr r0, _0813E040 + strh r1, [r0] + ldr r0, _0813E044 + strh r1, [r0] + ldr r2, _0813E048 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r2] + ldr r0, _0813E04C + strh r1, [r0] + b _0813E180 + .align 2, 0 +_0813E02C: .4byte 0x0300301c +_0813E030: .4byte 0x02022e14 +_0813E034: .4byte 0x02022e16 +_0813E038: .4byte 0x02022e18 +_0813E03C: .4byte 0x02022e1a +_0813E040: .4byte 0x02022e1c +_0813E044: .4byte 0x02022e1e +_0813E048: .4byte 0x02022e20 +_0813E04C: .4byte 0x02022e22 +_0813E050: + bl sub_80A1A74 + ldr r0, _0813E06C + bl SetHBlankCallback + ldr r0, _0813E070 + bl SetVBlankCallback + ldr r1, _0813E074 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0813E188 + .align 2, 0 +_0813E06C: .4byte nullsub_83 + 1 +_0813E070: .4byte sub_813FD64 + 1 +_0813E074: .4byte 0x030022c0 +_0813E078: + bl sub_807F19C + b _0813E180 +_0813E07E: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, _0813E0A4 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0813E188 + .align 2, 0 +_0813E0A4: .4byte 0x030022c0 +_0813E0A8: + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r0, r6, 3 + ldr r1, _0813E0E8 + adds r0, r1 + ldr r1, _0813E0EC + ldr r1, [r1] + ldr r1, [r1, 0x10] + adds r2, r6, 0 + bl LZ77UnCompAnyRam + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + b _0813E180 + .align 2, 0 +_0813E0E8: .4byte 0x0830a18c +_0813E0EC: .4byte 0x020244d4 +_0813E0F0: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, _0813E148 + ldr r1, _0813E14C + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl obj_add_from_template_forward_search + ldr r1, _0813E150 + ldr r1, [r1] + lsls r2, r0, 24 + lsrs r2, 24 + strb r0, [r1, 0x1] + ldr r3, _0813E154 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, _0813E158 + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r1, _0813E15C + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_807B154 + b _0813E1C8 + .align 2, 0 +_0813E148: .4byte 0x0202499c +_0813E14C: .4byte 0x082ec6a8 +_0813E150: .4byte 0x0203ab80 +_0813E154: .4byte 0x02020630 +_0813E158: .4byte nullsub_18 + 1 +_0813E15C: .4byte 0x030022c0 +_0813E160: + ldr r0, _0813E190 + ldrb r0, [r0] + cmp r0, 0 + beq _0813E174 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0813E174: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 +_0813E180: + ldr r1, _0813E194 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_0813E188: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0813E1C8 + .align 2, 0 +_0813E190: .4byte 0x030030fc +_0813E194: .4byte 0x030022c0 +_0813E198: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + bl sub_807B140 + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + ldr r0, _0813E1D0 + bl set_callback2 + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl lcd_io_set +_0813E1C8: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813E1D0: .4byte sub_813E3C0 + 1 + thumb_func_end sub_813DF70 + + thumb_func_start sub_813E1D4 +sub_813E1D4: @ 813E1D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _0813E344 + mov r1, sp + bl strcpy_limit_10_chars + ldr r0, _0813E348 + movs r1, 0xB + muls r1, r5 + ldr r2, _0813E34C + adds r1, r2 + bl gf_strcpy + ldr r1, _0813E350 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r7, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r10, r0 + ldr r1, _0813E354 + mov r9, r1 + movs r0, 0x64 + bl malloc_and_clear + mov r2, r9 + str r0, [r2] + movs r4, 0 + strb r6, [r0] + lsls r0, r5, 3 + ldr r1, _0813E358 + adds r0, r1 + ldr r1, _0813E35C + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + bl LZ77UnCompAnyRam + adds r0, r5, 0 + mov r1, r10 + adds r2, r7, 0 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, _0813E360 + ldr r1, _0813E364 + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl obj_add_from_template_forward_search + mov r1, r9 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r6, r1, 24 + strb r0, [r2, 0x1] + ldr r3, _0813E368 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, _0813E36C + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_817BE78 + ldr r0, _0813E370 + movs r1, 0 + bl AddTask + mov r1, r9 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r6, r1, 24 + strb r0, [r2, 0x2] + ldr r1, _0813E374 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + mov r2, r8 + strh r2, [r0, 0xA] + strh r5, [r0, 0xC] + movs r1, 0x1 + strh r1, [r0, 0x10] + strh r4, [r0, 0x1A] + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0x1C] + ldr r0, _0813E378 + strh r4, [r0] + ldr r0, _0813E37C + strh r4, [r0] + ldr r0, _0813E380 + strh r4, [r0] + ldr r0, _0813E384 + strh r4, [r0] + ldr r0, _0813E388 + strh r4, [r0] + ldr r0, _0813E38C + strh r4, [r0] + ldr r1, _0813E390 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0813E394 + strh r4, [r0] + ldr r2, _0813E398 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0813E39C + bl SetVBlankCallback + ldr r0, _0813E3A0 + bl set_callback2 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813E344: .4byte 0x02021cc4 +_0813E348: .4byte 0x02021dc4 +_0813E34C: .4byte 0x083185c8 +_0813E350: .4byte 0x02021cc0 +_0813E354: .4byte 0x0203ab80 +_0813E358: .4byte 0x0830a18c +_0813E35C: .4byte 0x020244d4 +_0813E360: .4byte 0x0202499c +_0813E364: .4byte 0x082ec6a8 +_0813E368: .4byte 0x02020630 +_0813E36C: .4byte nullsub_18 + 1 +_0813E370: .4byte sub_813F1B8 + 1 +_0813E374: .4byte 0x03005e00 +_0813E378: .4byte 0x02022e14 +_0813E37C: .4byte 0x02022e16 +_0813E380: .4byte 0x02022e18 +_0813E384: .4byte 0x02022e1a +_0813E388: .4byte 0x02022e1c +_0813E38C: .4byte 0x02022e1e +_0813E390: .4byte 0x02022e20 +_0813E394: .4byte 0x02022e22 +_0813E398: .4byte 0x03003014 +_0813E39C: .4byte sub_813FD64 + 1 +_0813E3A0: .4byte sub_813E3C0 + 1 + thumb_func_end sub_813E1D4 + + thumb_func_start sub_813E3A4 +sub_813E3A4: @ 813E3A4 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_813E3A4 + + thumb_func_start sub_813E3C0 +sub_813E3C0: @ 813E3C0 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_813E3C0 + + thumb_func_start sub_813E3DC +sub_813E3DC: @ 813E3DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp, 0x4] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r0, 0 + str r0, [sp] + mov r0, r10 + lsls r0, 2 + str r0, [sp, 0x8] + add r0, r10 + lsls r7, r0, 3 + ldr r1, _0813E558 + adds r1, r7 + mov r8, r1 + ldrh r0, [r1] + cmp r0, 0xD + beq _0813E40C + b _0813E546 +_0813E40C: + ldr r6, _0813E55C + ldrb r0, [r6] + cmp r0, 0x5 + bls _0813E416 + b _0813E546 +_0813E416: + movs r5, 0x64 + muls r0, r5 + ldr r4, _0813E560 + adds r0, r4 + mov r9, r0 + ldr r1, [sp, 0x4] + movs r2, 0x64 + bl memcpy_pokemon + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + ldr r1, _0813E558 + adds r2, r1, r7 + adds r2, 0xC + movs r1, 0xB + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + mov r1, r8 + ldrh r2, [r1, 0xC] + movs r1, 0xB + muls r2, r1 + ldr r1, _0813E564 + adds r2, r1 + movs r1, 0x2 + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0xA + mov r2, sp + bl pokemon_setattr + movs r4, 0x32 + ldr r0, [sp, 0x8] + mov r8, r0 + adds r5, r6, 0 +_0813E484: + ldrb r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0813E560 + adds r0, r1 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + adds r4, 0x1 + cmp r4, 0x36 + ble _0813E484 + movs r4, 0x43 + ldr r7, _0813E55C +_0813E4A0: + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0813E560 + adds r0, r5 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + adds r4, 0x1 + cmp r4, 0x4F + ble _0813E4A0 + ldr r4, _0813E55C + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp] + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x40 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + bl pokemon_calc_effective_stats + bl calc_player_party_count + ldr r0, _0813E558 + mov r4, r8 + add r4, r10 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xC] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + ldrh r0, [r4, 0xC] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl pokedex_flag_operation + mov r0, r9 + movs r1, 0xB + bl pokemon_getattr + ldr r1, _0813E568 + cmp r0, r1 + bne _0813E546 + mov r0, r9 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + bne _0813E546 + ldr r0, [sp, 0x4] + movs r1, 0xB + bl pokemon_getattr + movs r1, 0x97 + lsls r1, 1 + cmp r0, r1 + bne _0813E546 + ldr r2, _0813E56C + mov r0, r9 + movs r1, 0x2 + bl pokemon_setattr +_0813E546: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813E558: .4byte 0x0832531c +_0813E55C: .4byte 0x020244e9 +_0813E560: .4byte 0x020244ec +_0813E564: .4byte 0x083185c8 +_0813E568: .4byte 0x0000012f +_0813E56C: .4byte 0x085b58c4 + thumb_func_end sub_813E3DC + + thumb_func_start sub_813E570 +sub_813E570: @ 813E570 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _0813E5E0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r2 + movs r0, 0x1C + ldrsh r1, [r3, r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0813E5E4 + adds r1, r0 + mov r9, r1 + ldr r0, _0813E5E8 + ldrh r1, [r0, 0x2C] + adds r5, r2, 0 + adds r6, r0, 0 + cmp r1, 0x2 + bne _0813E5F0 + movs r1, 0x8 + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bne _0813E5F0 + ldr r4, _0813E5EC + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E5F0 + ldrh r1, [r3, 0xE] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0813E5F0 + movs r0, 0x11 + strh r0, [r3, 0x8] + ldrb r1, [r4, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x18] + bl sub_8140134 + bl _0813F1A4 + .align 2, 0 +_0813E5E0: .4byte 0x03005e00 +_0813E5E4: .4byte 0x020244ec +_0813E5E8: .4byte 0x030022c0 +_0813E5EC: .4byte 0x02024332 +_0813E5F0: + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r0, r5 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x16 + bls _0813E606 + bl _0813F1A4 +_0813E606: + lsls r0, 2 + ldr r1, _0813E610 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813E610: .4byte _0813E614 + .align 2, 0 +_0813E614: + .4byte _0813E670 + .4byte _0813E6D4 + .4byte _0813E714 + .4byte _0813E740 + .4byte _0813E770 + .4byte _0813E7B0 + .4byte _0813E7E8 + .4byte _0813E828 + .4byte _0813E860 + .4byte _0813E8A4 + .4byte _0813E8C0 + .4byte _0813E8EC + .4byte _0813E918 + .4byte _0813E964 + .4byte _0813E990 + .4byte _0813EA1C + .4byte _0813EAC8 + .4byte _0813EB34 + .4byte _0813EB74 + .4byte _0813EBA8 + .4byte _0813EC10 + .4byte _0813EC6C + .4byte _0813ECA8 +_0813E670: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _0813E6C8 + ldr r0, _0813E6CC + ldr r0, [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] + ldr r0, _0813E6D0 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + bl _0813F1A4 + .align 2, 0 +_0813E6C8: .4byte 0x02020630 +_0813E6CC: .4byte 0x0203ab80 +_0813E6D0: .4byte 0x03005e00 +_0813E6D4: + ldr r0, _0813E704 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813E6E4 + bl _0813F1A4 +_0813E6E4: + ldr r4, _0813E708 + ldr r1, _0813E70C + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813E710 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .align 2, 0 +_0813E704: .4byte 0x02037fd4 +_0813E708: .4byte 0x02021fc4 +_0813E70C: .4byte 0x085cc990 +_0813E710: .4byte 0x03005e00 +_0813E714: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813E724 + bl _0813F1A4 +_0813E724: + ldr r0, _0813E738 + ldr r0, [r0] + ldrb r0, [r0] + ldr r1, _0813E73C + mov r3, r8 + adds r4, r3, r7 + lsls r4, 3 + adds r4, r1 + b _0813EB90 + .align 2, 0 +_0813E738: .4byte 0x0203ab80 +_0813E73C: .4byte 0x03005e00 +_0813E740: + ldr r0, _0813E768 + ldr r0, [r0] + ldrb r0, [r0] + bl sub_8140208 + cmp r0, 0 + bne _0813E752 + bl _0813F1A4 +_0813E752: + movs r0, 0xBC + lsls r0, 1 + bl audio_play + ldr r0, _0813E76C + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .align 2, 0 +_0813E768: .4byte 0x0203ab80 +_0813E76C: .4byte 0x03005e00 +_0813E770: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0813E780 + bl _0813F1A4 +_0813E780: + ldr r0, _0813E7A8 + bl current_map_music_set + ldr r0, _0813E7AC + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r4, [sp] + movs r0, 0x1C + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + bl _0813F1A4 + .align 2, 0 +_0813E7A8: .4byte 0x00000179 +_0813E7AC: .4byte 0x03005e00 +_0813E7B0: + ldr r0, _0813E7DC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813E7C0 + bl _0813F1A4 +_0813E7C0: + movs r0, 0 + bl sub_8140000 + movs r0, 0x11 + bl sub_817BE94 + ldr r1, _0813E7E0 + strb r0, [r1, 0x2] + ldr r0, _0813E7E4 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .align 2, 0 +_0813E7DC: .4byte 0x02037fd4 +_0813E7E0: .4byte 0x02024332 +_0813E7E4: .4byte 0x03005e00 +_0813E7E8: + ldr r4, _0813E820 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E7FE + bl _0813F1A4 +_0813E7FE: + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r0, _0813E824 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x3] + bl sub_817BFB4 + strb r0, [r4, 0x2] + bl _0813F1A4 + .align 2, 0 +_0813E820: .4byte 0x02024332 +_0813E824: .4byte 0x0203ab80 +_0813E828: + ldr r4, _0813E858 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E83E + bl _0813F1A4 +_0813E83E: + ldr r0, _0813E85C + ldr r1, [r0] + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl sub_817C3A0 + strb r0, [r4, 0x2] + mov r0, r8 + adds r1, r0, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .align 2, 0 +_0813E858: .4byte 0x02024332 +_0813E85C: .4byte 0x0203ab80 +_0813E860: + ldr r2, _0813E89C + ldr r1, [r2] + ldrb r0, [r1, 0x3] + subs r0, 0x1 + strb r0, [r1, 0x3] + lsls r0, 24 + cmp r0, 0 + beq _0813E874 + bl _0813F1A4 +_0813E874: + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r0, _0813E8A0 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813E890 + bl _0813F1A4 +_0813E890: + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .align 2, 0 +_0813E89C: .4byte 0x0203ab80 +_0813E8A0: .4byte 0x02024332 +_0813E8A4: + bl sub_817C068 + ldr r1, _0813E8B8 + strb r0, [r1, 0x2] + ldr r0, _0813E8BC + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .align 2, 0 +_0813E8B8: .4byte 0x02024332 +_0813E8BC: .4byte 0x03005e00 +_0813E8C0: + ldr r6, _0813E8E8 + ldrb r0, [r6, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E8D6 + bl _0813F1A4 +_0813E8D6: + mov r0, r8 + adds r4, r0, r7 + lsls r4, 3 + adds r4, r5 + ldrh r0, [r4, 0xC] + bl sub_817C144 + strb r0, [r6, 0x2] + b _0813EB96 + .align 2, 0 +_0813E8E8: .4byte 0x02024332 +_0813E8EC: + ldr r0, _0813E914 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813E902 + bl _0813F1A4 +_0813E902: + movs r0, 0x21 + bl audio_play + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .align 2, 0 +_0813E914: .4byte 0x02024332 +_0813E918: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813E926 + bl _0813F1A4 +_0813E926: + bl m4aMPlayAllStop + ldr r0, _0813E958 + ldr r1, _0813E95C + ldr r1, [r1] + adds r1, 0x4 + movs r2, 0x60 + bl memcpy + bl sub_8140174 + movs r0, 0 + str r0, [sp] + movs r0, 0x1C + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _0813E960 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .align 2, 0 +_0813E958: .4byte 0x02037754 +_0813E95C: .4byte 0x0203ab80 +_0813E960: .4byte 0x03005e00 +_0813E964: + ldr r0, _0813E988 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813E974 + bl _0813F1A4 +_0813E974: + ldr r0, _0813E98C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + mov r1, r8 + adds r4, r1, r7 + lsls r4, 3 + adds r4, r5 + ldrh r1, [r4, 0xC] + b _0813EB92 + .align 2, 0 +_0813E988: .4byte 0x02037fd4 +_0813E98C: .4byte 0x0203ab80 +_0813E990: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0813E99E + bl _0813F1A4 +_0813E99E: + ldr r4, _0813EA0C + ldr r1, _0813EA10 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813EA14 + bl song_play_for_text + ldr r2, _0813EA18 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + adds r2, r1 + adds r2, 0xC + mov r0, r9 + movs r1, 0xB + bl pokemon_setattr + mov r0, r9 + bl pokemon_calc_effective_stats + ldrh r1, [r4, 0xA] + ldrh r2, [r4, 0xC] + mov r0, r9 + bl sub_806D778 + ldrh r0, [r4, 0xC] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + ldrh r0, [r4, 0xC] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl pokedex_flag_operation + movs r0, 0xE + bl sav12_xor_increment + b _0813F1A4 + .align 2, 0 +_0813EA0C: .4byte 0x02021fc4 +_0813EA10: .4byte 0x085cc9a6 +_0813EA14: .4byte 0x00000173 +_0813EA18: .4byte 0x03005e00 +_0813EA1C: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813EA2A + b _0813F1A4 +_0813EA2A: + ldr r1, _0813EA88 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrb r1, [r4, 0x10] + mov r0, r9 + bl sub_8069318 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _0813EAA8 + movs r3, 0x1A + ldrsh r5, [r4, r3] + cmp r5, 0 + bne _0813EAA8 + ldrh r1, [r4, 0xE] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813EA5E + bl sub_80A2F30 + bl sub_8085784 +_0813EA5E: + ldrh r0, [r4, 0xE] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r4, 0xE] + strh r5, [r4, 0x10] + strh r5, [r4, 0x14] + mov r0, r9 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + ldr r0, _0813EA8C + add r1, sp, 0x4 + bl strcpy_limit_10_chars + ldr r0, _0813EA90 + cmp r6, r0 + bne _0813EA94 + movs r0, 0x16 + strh r0, [r4, 0x8] + b _0813F1A4 + .align 2, 0 +_0813EA88: .4byte 0x03005e00 +_0813EA8C: .4byte 0x02022f58 +_0813EA90: .4byte 0x0000ffff +_0813EA94: + ldr r0, _0813EAA4 + cmp r6, r0 + bne _0813EA9C + b _0813F1A4 +_0813EA9C: + movs r0, 0x14 + strh r0, [r4, 0x8] + b _0813F1A4 + .align 2, 0 +_0813EAA4: .4byte 0x0000fffe +_0813EAA8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0813EAC4 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .align 2, 0 +_0813EAC4: .4byte 0x03005e00 +_0813EAC8: + ldr r0, _0813EB28 + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0813EADC + b _0813F1A4 +_0813EADC: + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r4, r0, r5 + ldrh r1, [r4, 0xE] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0813EAF6 + bl sub_80A2F30 + bl sub_8085784 +_0813EAF6: + movs r1, 0x1A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0813EB06 + ldrh r0, [r4, 0xA] + mov r1, r9 + bl sub_813E3DC +_0813EB06: + adds r0, r7, 0 + bl remove_task + bl sub_805F094 + ldr r4, _0813EB2C + ldr r0, [r4] + bl free + str r6, [r4] + bl Window_FreeMemory + ldr r0, _0813EB30 + ldr r0, [r0] + bl set_callback2 + b _0813F1A4 + .align 2, 0 +_0813EB28: .4byte 0x02037fd4 +_0813EB2C: .4byte 0x0203ab80 +_0813EB30: .4byte 0x030061e8 +_0813EB34: + ldr r0, _0813EB68 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813EB48 + b _0813F1A4 +_0813EB48: + bl m4aMPlayAllStop + ldr r0, _0813EB6C + ldr r1, _0813EB70 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .align 2, 0 +_0813EB68: .4byte 0x02024332 +_0813EB6C: .4byte 0x0006001c +_0813EB70: .4byte 0x00007fff +_0813EB74: + ldr r0, _0813EBA0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EB82 + b _0813F1A4 +_0813EB82: + ldr r0, _0813EBA4 + ldr r0, [r0] + ldrb r0, [r0] + mov r3, r8 + adds r4, r3, r7 + lsls r4, 3 + adds r4, r5 +_0813EB90: + ldrh r1, [r4, 0xA] +_0813EB92: + bl sub_81401E0 +_0813EB96: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0813F1A4 + .align 2, 0 +_0813EBA0: .4byte 0x02037fd4 +_0813EBA4: .4byte 0x0203ab80 +_0813EBA8: + ldr r0, _0813EBD4 + ldr r0, [r0] + ldrb r0, [r0] + bl sub_8140208 + cmp r0, 0 + bne _0813EBB8 + b _0813F1A4 +_0813EBB8: + ldr r0, _0813EBD8 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0813EBE4 + ldr r0, _0813EBDC + ldr r1, _0813EBE0 + bl ExpandTextCodes + b _0813EBEC + .align 2, 0 +_0813EBD4: .4byte 0x0203ab80 +_0813EBD8: .4byte 0x03005e00 +_0813EBDC: .4byte 0x02021fc4 +_0813EBE0: .4byte 0x085cc9ee +_0813EBE4: + ldr r0, _0813EC04 + ldr r1, _0813EC08 + bl ExpandTextCodes +_0813EBEC: + ldr r0, _0813EC04 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0813EC0C + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x1A] + b _0813F16E + .align 2, 0 +_0813EC04: .4byte 0x02021fc4 +_0813EC08: .4byte 0x085cc9d3 +_0813EC0C: .4byte 0x03005e00 +_0813EC10: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813EC1E + b _0813F1A4 +_0813EC1E: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813EC2A + b _0813F1A4 +_0813EC2A: + bl sub_804F574 + ldr r0, _0813EC5C + bl fanfare_play + ldr r0, _0813EC60 + ldr r0, [r0, 0xC] + bl sub_814E6F0 + ldr r0, _0813EC64 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813EC68 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x40 + strh r0, [r1, 0x10] +_0813EC52: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0813F1A4 + .align 2, 0 +_0813EC5C: .4byte 0x0000016f +_0813EC60: .4byte 0x085cc270 +_0813EC64: .4byte 0x02022e2c +_0813EC68: .4byte 0x03005e00 +_0813EC6C: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813EC7A + b _0813F1A4 +_0813EC7A: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813EC86 + b _0813F1A4 +_0813EC86: + ldr r0, _0813ECA4 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + cmp r0, 0 + beq _0813EC9E + b _0813F1A4 +_0813EC9E: + movs r0, 0xF + strh r0, [r1, 0x8] + b _0813F1A4 + .align 2, 0 +_0813ECA4: .4byte 0x03005e00 +_0813ECA8: + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r0, r5 + movs r1, 0x14 + ldrsh r0, [r0, r1] + cmp r0, 0xC + bls _0813ECBA + b _0813F1A4 +_0813ECBA: + lsls r0, 2 + ldr r1, _0813ECC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813ECC4: .4byte _0813ECC8 + .align 2, 0 +_0813ECC8: + .4byte _0813ECFC + .4byte _0813ED48 + .4byte _0813ED90 + .4byte _0813EDCE + .4byte _0813EE34 + .4byte _0813EF30 + .4byte _0813EF88 + .4byte _0813F05C + .4byte _0813F090 + .4byte _0813F0D8 + .4byte _0813F120 + .4byte _0813F154 + .4byte _0813F180 +_0813ECFC: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813ED0A + b _0813F1A4 +_0813ED0A: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813ED16 + b _0813F1A4 +_0813ED16: + bl sub_804F574 + ldr r0, _0813ED3C + ldr r0, [r0, 0x10] + bl sub_814E6F0 + ldr r0, _0813ED40 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813ED44 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .align 2, 0 +_0813ED3C: .4byte 0x085cc270 +_0813ED40: .4byte 0x02022e2c +_0813ED44: .4byte 0x03005e00 +_0813ED48: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813ED56 + b _0813F1A4 +_0813ED56: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813ED62 + b _0813F1A4 +_0813ED62: + ldr r0, _0813ED84 + ldr r0, [r0, 0x14] + bl sub_814E6F0 + ldr r0, _0813ED88 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813ED8C + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .align 2, 0 +_0813ED84: .4byte 0x085cc270 +_0813ED88: .4byte 0x02022e2c +_0813ED8C: .4byte 0x03005e00 +_0813ED90: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813EDCE + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813EDCE + ldr r0, _0813EE20 + ldr r0, [r0, 0x18] + bl sub_814E6F0 + ldr r0, _0813EE24 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813EE28 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 + strh r0, [r1, 0x16] + movs r0, 0xA + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x14] + adds r0, 0x1 + strh r0, [r1, 0x14] +_0813EDCE: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813EDDC + b _0813F1A4 +_0813EDDC: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0813EDEA + b _0813F1A4 +_0813EDEA: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, _0813EE2C + movs r1, 0xC + bl battle_show_message_maybe + ldr r0, _0813EE28 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x14] + ldr r0, _0813EE30 + strb r2, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0813F1A4 + .align 2, 0 +_0813EE20: .4byte 0x085cc270 +_0813EE24: .4byte 0x02022e2c +_0813EE28: .4byte 0x03005e00 +_0813EE2C: .4byte 0x085ccabb +_0813EE30: .4byte 0x02024332 +_0813EE34: + ldr r0, _0813EEC0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0813EE5C + ldr r4, _0813EEC4 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0813EE5C + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0813EE5C: + ldr r0, _0813EEC0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EE84 + ldr r4, _0813EEC4 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0813EE84 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0813EE84: + ldr r0, _0813EEC0 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0813EEF2 + 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, _0813EEC4 + ldrb r2, [r0, 0x1] + cmp r2, 0 + beq _0813EECC + ldr r0, _0813EEC8 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x18] + strh r0, [r1, 0x14] + b _0813EEF2 + .align 2, 0 +_0813EEC0: .4byte 0x030022c0 +_0813EEC4: .4byte 0x02024332 +_0813EEC8: .4byte 0x03005e00 +_0813EECC: + ldr r0, _0813EF28 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x16] + strh r0, [r1, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0813EEF2 + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0813EEF2: + ldr r0, _0813EF2C + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0813EF00 + b _0813F1A4 +_0813EF00: + 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 + ldr r1, _0813EF28 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x18] + strh r1, [r0, 0x14] + b _0813F1A4 + .align 2, 0 +_0813EF28: .4byte 0x03005e00 +_0813EF2C: .4byte 0x030022c0 +_0813EF30: + ldr r0, _0813EF70 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EF3E + b _0813F1A4 +_0813EF3E: + bl Window_FreeMemory + ldr r0, _0813EF74 + ldr r1, _0813EF78 + mov r3, r8 + adds r5, r3, r7 + lsls r5, 3 + adds r5, r1 + ldrb r1, [r5, 0x1C] + ldr r2, _0813EF7C + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _0813EF80 + ldr r4, _0813EF84 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 + ldrh r0, [r5, 0x14] + adds r0, 0x1 + strh r0, [r5, 0x14] + b _0813F1A4 + .align 2, 0 +_0813EF70: .4byte 0x02037fd4 +_0813EF74: .4byte 0x020244ec +_0813EF78: .4byte 0x03005e00 +_0813EF7C: .4byte 0x020244e9 +_0813EF80: .4byte sub_813DD7C + 1 +_0813EF84: .4byte 0x020244e2 +_0813EF88: + ldr r0, _0813EFBC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EF96 + b _0813F1A4 +_0813EF96: + ldr r1, [r6, 0x4] + ldr r0, _0813EFC0 + cmp r1, r0 + beq _0813EFA0 + b _0813F1A4 +_0813EFA0: + bl sub_81C1B94 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bne _0813EFC8 + ldr r0, _0813EFC4 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0xA + b _0813F1A2 + .align 2, 0 +_0813EFBC: .4byte 0x02037fd4 +_0813EFC0: .4byte sub_813E3A4 + 1 +_0813EFC4: .4byte 0x03005e00 +_0813EFC8: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806E804 + cmp r0, 0 + beq _0813F014 + ldr r0, _0813F004 + ldr r3, _0813F008 + adds r0, r3 + ldr r0, [r0] + bl sub_814E6F0 + ldr r0, _0813F00C + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0813F010 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC + strh r1, [r0, 0x14] + b _0813F1A4 + .align 2, 0 +_0813F004: .4byte 0x085cc270 +_0813F008: .4byte 0x000004cc +_0813F00C: .4byte 0x02022e2c +_0813F010: .4byte 0x03005e00 +_0813F014: + ldr r1, _0813F050 + 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] + lsls r4, r6, 24 + lsrs r4, 24 + mov r0, r9 + adds r1, r4, 0 + bl sub_806B9A8 + ldr r0, _0813F054 + ldrh r1, [r0] + mov r0, r9 + adds r2, r4, 0 + bl sub_80691F4 + ldr r0, _0813F058 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .align 2, 0 +_0813F050: .4byte 0x02022f68 +_0813F054: .4byte 0x020244e2 +_0813F058: .4byte 0x03005e00 +_0813F05C: + ldr r0, _0813F084 + movs r1, 0xCF + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r0, _0813F088 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813F08C + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .align 2, 0 +_0813F084: .4byte 0x085cc270 +_0813F088: .4byte 0x02022e2c +_0813F08C: .4byte 0x03005e00 +_0813F090: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F09E + b _0813F1A4 +_0813F09E: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F0AA + b _0813F1A4 +_0813F0AA: + ldr r0, _0813F0CC + ldr r0, [r0, 0x1C] + bl sub_814E6F0 + ldr r0, _0813F0D0 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, _0813F0D4 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .align 2, 0 +_0813F0CC: .4byte 0x085cc270 +_0813F0D0: .4byte 0x02022e2c +_0813F0D4: .4byte 0x03005e00 +_0813F0D8: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813F1A4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F1A4 + ldr r0, _0813F114 + movs r1, 0xD0 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r0, _0813F118 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0813F11C + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x14 + strh r1, [r0, 0x8] + b _0813F1A4 + .align 2, 0 +_0813F114: .4byte 0x085cc270 +_0813F118: .4byte 0x02022e2c +_0813F11C: .4byte 0x03005e00 +_0813F120: + ldr r0, _0813F148 + ldr r0, [r0, 0x20] + bl sub_814E6F0 + ldr r0, _0813F14C + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0813F150 + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0xB + strh r1, [r0, 0x16] + strh r2, [r0, 0x18] + movs r1, 0x3 + strh r1, [r0, 0x14] + b _0813F1A4 + .align 2, 0 +_0813F148: .4byte 0x085cc270 +_0813F14C: .4byte 0x02022e2c +_0813F150: .4byte 0x03005e00 +_0813F154: + ldr r0, _0813F174 + ldr r0, [r0, 0x24] + bl sub_814E6F0 + ldr r0, _0813F178 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0813F17C + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 +_0813F16E: + movs r1, 0xF + strh r1, [r0, 0x8] + b _0813F1A4 + .align 2, 0 +_0813F174: .4byte 0x085cc270 +_0813F178: .4byte 0x02022e2c +_0813F17C: .4byte 0x03005e00 +_0813F180: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813F1A4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F1A4 + ldr r0, _0813F1B4 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 +_0813F1A2: + strh r0, [r1, 0x14] +_0813F1A4: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813F1B4: .4byte 0x03005e00 + thumb_func_end sub_813E570 + + thumb_func_start sub_813F1B8 +sub_813F1B8: @ 813F1B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, _0813F1F8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r3 + movs r1, 0x1C + ldrsh r2, [r0, r1] + movs r1, 0x64 + muls r2, r1 + ldr r1, _0813F1FC + adds r2, r1 + mov r9, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r3, 0 + cmp r0, 0x14 + bls _0813F1EC + bl _0813FCC4 +_0813F1EC: + lsls r0, 2 + ldr r1, _0813F200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813F1F8: .4byte 0x03005e00 +_0813F1FC: .4byte 0x020244ec +_0813F200: .4byte _0813F204 + .align 2, 0 +_0813F204: + .4byte _0813F258 + .4byte _0813F284 + .4byte _0813F2AC + .4byte _0813F2DC + .4byte _0813F314 + .4byte _0813F380 + .4byte _0813F3C0 + .4byte _0813F3F0 + .4byte _0813F42C + .4byte _0813F448 + .4byte _0813F474 + .4byte _0813F498 + .4byte _0813F4E4 + .4byte _0813F570 + .4byte _0813F624 + .4byte _0813F668 + .4byte _0813F6D0 + .4byte _0813F704 + .4byte _0813F748 + .4byte _0813F7A4 + .4byte _0813F7E4 +_0813F258: + ldr r4, _0813F278 + ldr r1, _0813F27C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813F280 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + b _0813F6B4 + .align 2, 0 +_0813F278: .4byte 0x02021fc4 +_0813F27C: .4byte 0x085cc990 +_0813F280: .4byte 0x03005e00 +_0813F284: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F294 + bl _0813FCC4 +_0813F294: + ldr r0, _0813F2A8 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + movs r1, 0 + bl cry_related + b _0813F6F2 + .align 2, 0 +_0813F2A8: .4byte 0x03005e00 +_0813F2AC: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0813F2BA + bl _0813FCC4 +_0813F2BA: + ldr r0, _0813F2D4 + bl m4aSongNumStop + movs r0, 0xBC + lsls r0, 1 + bl audio_play + ldr r1, _0813F2D8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + b _0813F6B4 + .align 2, 0 +_0813F2D4: .4byte 0x00000179 +_0813F2D8: .4byte 0x03005e00 +_0813F2DC: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0813F2EC + bl _0813FCC4 +_0813F2EC: + ldr r0, _0813F30C + bl song_play_for_text + ldr r1, _0813F310 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + str r5, [sp] + movs r0, 0x1C + movs r1, 0x4 + b _0813F9C8 + .align 2, 0 +_0813F30C: .4byte 0x00000179 +_0813F310: .4byte 0x03005e00 +_0813F314: + ldr r0, _0813F368 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813F324 + bl _0813FCC4 +_0813F324: + movs r0, 0x1 + bl sub_8140000 + ldr r2, _0813F36C + ldr r0, _0813F370 + ldr r0, [r0] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r6, r0, 0 + adds r6, 0x10 + adds r0, r6, 0 + bl sub_817BE94 + ldr r1, _0813F374 + strb r0, [r1, 0x2] + ldr r1, _0813F378 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, _0813F37C + movs r0, 0xE + bl lcd_io_set + bl _0813FCC4 + .align 2, 0 +_0813F368: .4byte 0x02037fd4 +_0813F36C: .4byte 0x02020630 +_0813F370: .4byte 0x0203ab80 +_0813F374: .4byte 0x02024332 +_0813F378: .4byte 0x03005e00 +_0813F37C: .4byte 0x00000603 +_0813F380: + ldr r4, _0813F3B8 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813F396 + bl _0813FCC4 +_0813F396: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r5 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r0, _0813F3BC + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x3] + bl sub_817BFB4 + strb r0, [r4, 0x2] + bl _0813FCC4 + .align 2, 0 +_0813F3B8: .4byte 0x02024332 +_0813F3BC: .4byte 0x0203ab80 +_0813F3C0: + ldr r4, _0813F3E8 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813F3D6 + bl _0813FCC4 +_0813F3D6: + ldr r0, _0813F3EC + ldr r1, [r0] + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl sub_817C3A0 + strb r0, [r4, 0x2] + b _0813F6AC + .align 2, 0 +_0813F3E8: .4byte 0x02024332 +_0813F3EC: .4byte 0x0203ab80 +_0813F3F0: + ldr r2, _0813F424 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + subs r0, 0x1 + strb r0, [r1, 0x3] + lsls r0, 24 + cmp r0, 0 + beq _0813F404 + bl _0813FCC4 +_0813F404: + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r0, _0813F428 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813F420 + bl _0813FCC4 +_0813F420: + b _0813F6AC + .align 2, 0 +_0813F424: .4byte 0x0203ab80 +_0813F428: .4byte 0x02024332 +_0813F42C: + bl sub_817C068 + ldr r1, _0813F440 + strb r0, [r1, 0x2] + ldr r1, _0813F444 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + b _0813F6B4 + .align 2, 0 +_0813F440: .4byte 0x02024332 +_0813F444: .4byte 0x03005e00 +_0813F448: + ldr r6, _0813F470 + ldrb r0, [r6, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813F45E + bl _0813FCC4 +_0813F45E: + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + ldrh r0, [r4, 0xC] + bl sub_817C280 + strb r0, [r6, 0x2] + b _0813F6F2 + .align 2, 0 +_0813F470: .4byte 0x02024332 +_0813F474: + ldr r0, _0813F494 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813F48A + bl _0813FCC4 +_0813F48A: + movs r0, 0x21 + bl audio_play + b _0813F6AC + .align 2, 0 +_0813F494: .4byte 0x02024332 +_0813F498: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F4A6 + bl _0813FCC4 +_0813F4A6: + ldr r0, _0813F4D4 + ldr r0, [r0] + bl free + ldr r5, _0813F4D8 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + ldr r1, _0813F4DC + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r1 + ldrh r1, [r4, 0xC] + bl sub_81401E0 + ldr r0, _0813F4E0 + ldr r1, [r5] + adds r1, 0x4 + movs r2, 0x60 + bl memcpy + b _0813F6F2 + .align 2, 0 +_0813F4D4: .4byte 0x0203ab84 +_0813F4D8: .4byte 0x0203ab80 +_0813F4DC: .4byte 0x03005e00 +_0813F4E0: .4byte 0x02037754 +_0813F4E4: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0813F4F2 + bl _0813FCC4 +_0813F4F2: + ldr r4, _0813F560 + ldr r1, _0813F564 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813F568 + bl fanfare_play + ldr r2, _0813F56C + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + adds r2, r1 + adds r2, 0xC + mov r0, r9 + movs r1, 0xB + bl pokemon_setattr + mov r0, r9 + bl pokemon_calc_effective_stats + ldrh r1, [r4, 0xA] + ldrh r2, [r4, 0xC] + mov r0, r9 + bl sub_806D778 + ldrh r0, [r4, 0xC] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + ldrh r0, [r4, 0xC] + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl pokedex_flag_operation + movs r0, 0xE + bl sav12_xor_increment + b _0813FCC4 + .align 2, 0 +_0813F560: .4byte 0x02021fc4 +_0813F564: .4byte 0x085cc9a6 +_0813F568: .4byte 0x00000173 +_0813F56C: .4byte 0x03005e00 +_0813F570: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F57E + b _0813FCC4 +_0813F57E: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813F58C + b _0813FCC4 +_0813F58C: + ldr r1, _0813F5DC + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrb r1, [r5, 0x10] + mov r0, r9 + bl sub_8069318 + lsls r0, 16 + lsrs r6, r0, 16 + mov r8, r4 + cmp r6, 0 + beq _0813F5FC + movs r0, 0x1A + ldrsh r2, [r5, r0] + cmp r2, 0 + bne _0813F5FC + ldrh r1, [r5, 0xE] + movs r0, 0x80 + orrs r0, r1 + strh r0, [r5, 0xE] + strh r2, [r5, 0x10] + strh r2, [r5, 0x14] + mov r0, r9 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + ldr r0, _0813F5E0 + add r1, sp, 0x4 + bl strcpy_limit_10_chars + ldr r0, _0813F5E4 + cmp r6, r0 + bne _0813F5E8 + movs r0, 0x14 + strh r0, [r5, 0x8] + b _0813FCC4 + .align 2, 0 +_0813F5DC: .4byte 0x03005e00 +_0813F5E0: .4byte 0x02022f58 +_0813F5E4: .4byte 0x0000ffff +_0813F5E8: + ldr r0, _0813F5F8 + cmp r6, r0 + bne _0813F5F0 + b _0813FCC4 +_0813F5F0: + movs r0, 0x12 + strh r0, [r5, 0x8] + b _0813FCC4 + .align 2, 0 +_0813F5F8: .4byte 0x0000fffe +_0813F5FC: + ldr r0, _0813F618 + bl song_play_for_text + ldr r1, _0813F61C + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813F620 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813F78C + .align 2, 0 +_0813F618: .4byte 0x00000179 +_0813F61C: .4byte 0x085ef6d2 +_0813F620: .4byte 0x03005e00 +_0813F624: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _0813F634 + b _0813FCC4 +_0813F634: + adds r0, r7, 0 + bl remove_task + ldr r4, _0813F65C + ldr r0, [r4] + bl free + str r5, [r4] + ldr r2, _0813F660 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _0813F664 + ldr r0, [r0] + bl set_callback2 + b _0813FCC4 + .align 2, 0 +_0813F65C: .4byte 0x0203ab80 +_0813F660: .4byte 0x03003014 +_0813F664: .4byte 0x030061e8 +_0813F668: + ldr r0, _0813F6BC + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813F67C + b _0813FCC4 +_0813F67C: + bl m4aMPlayAllStop + ldr r2, _0813F6C0 + ldr r0, _0813F6C4 + ldr r0, [r0] + 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, _0813F6C8 + orrs r0, r1 + ldr r1, _0813F6CC + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_0813F6AC: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r5 +_0813F6B4: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0813FCC4 + .align 2, 0 +_0813F6BC: .4byte 0x02024332 +_0813F6C0: .4byte 0x02020630 +_0813F6C4: .4byte 0x0203ab80 +_0813F6C8: .4byte 0x0004001c +_0813F6CC: .4byte 0x00007fff +_0813F6D0: + ldr r0, _0813F6FC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813F6DE + b _0813FCC4 +_0813F6DE: + ldr r0, _0813F700 + ldr r0, [r0] + ldrb r0, [r0] + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + ldrh r1, [r4, 0xA] + bl sub_81401E0 +_0813F6F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0813FCC4 + .align 2, 0 +_0813F6FC: .4byte 0x02037fd4 +_0813F700: .4byte 0x0203ab80 +_0813F704: + ldr r0, _0813F738 + ldr r0, [r0] + ldrb r0, [r0] + bl sub_8140208 + cmp r0, 0 + bne _0813F714 + b _0813FCC4 +_0813F714: + ldr r4, _0813F73C + ldr r1, _0813F740 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813F744 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x1A] + b _0813FC8C + .align 2, 0 +_0813F738: .4byte 0x0203ab80 +_0813F73C: .4byte 0x02021fc4 +_0813F740: .4byte 0x085cc9ee +_0813F744: .4byte 0x03005e00 +_0813F748: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F756 + b _0813FCC4 +_0813F756: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F762 + b _0813FCC4 +_0813F762: + bl sub_804F574 + ldr r0, _0813F794 + bl fanfare_play + ldr r0, _0813F798 + ldr r0, [r0, 0xC] + bl sub_814E6F0 + ldr r1, _0813F79C + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813F7A0 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x40 + strh r0, [r1, 0x10] +_0813F78C: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0813FCC4 + .align 2, 0 +_0813F794: .4byte 0x0000016f +_0813F798: .4byte 0x085cc270 +_0813F79C: .4byte 0x02022e2c +_0813F7A0: .4byte 0x03005e00 +_0813F7A4: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F7B2 + b _0813FCC4 +_0813F7B2: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813F7C0 + b _0813FCC4 +_0813F7C0: + ldr r0, _0813F7E0 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + cmp r0, 0 + beq _0813F7D8 + b _0813FCC4 +_0813F7D8: + movs r0, 0xD + strh r0, [r1, 0x8] + b _0813FCC4 + .align 2, 0 +_0813F7E0: .4byte 0x03005e00 +_0813F7E4: + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r0, r5 + movs r2, 0x14 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0xB + bls _0813F7F8 + b _0813FCC4 +_0813F7F8: + lsls r0, 2 + ldr r1, _0813F804 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0813F804: .4byte _0813F808 + .align 2, 0 +_0813F808: + .4byte _0813F838 + .4byte _0813F884 + .4byte _0813F8CC + .4byte _0813F90C + .4byte _0813F96C + .4byte _0813FA24 + .4byte _0813FAA8 + .4byte _0813FBA4 + .4byte _0813FBEC + .4byte _0813FC38 + .4byte _0813FC70 + .4byte _0813FCA0 +_0813F838: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F846 + b _0813FCC4 +_0813F846: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F852 + b _0813FCC4 +_0813F852: + bl sub_804F574 + ldr r0, _0813F878 + ldr r0, [r0, 0x10] + bl sub_814E6F0 + ldr r1, _0813F87C + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813F880 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .align 2, 0 +_0813F878: .4byte 0x085cc270 +_0813F87C: .4byte 0x02022e2c +_0813F880: .4byte 0x03005e00 +_0813F884: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F892 + b _0813FCC4 +_0813F892: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F89E + b _0813FCC4 +_0813F89E: + ldr r0, _0813F8C0 + ldr r0, [r0, 0x14] + bl sub_814E6F0 + ldr r1, _0813F8C4 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813F8C8 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .align 2, 0 +_0813F8C0: .4byte 0x085cc270 +_0813F8C4: .4byte 0x02022e2c +_0813F8C8: .4byte 0x03005e00 +_0813F8CC: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813F90C + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F90C + ldr r0, _0813F958 + ldr r0, [r0, 0x18] + bl sub_814E6F0 + ldr r1, _0813F95C + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813F960 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 + strh r0, [r1, 0x16] + movs r0, 0x9 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x14] + adds r0, 0x1 + strh r0, [r1, 0x14] +_0813F90C: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813F91A + b _0813FCC4 +_0813F91A: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0813F928 + b _0813FCC4 +_0813F928: + movs r0, 0 + movs r1, 0xA8 + movs r2, 0xE0 + bl sub_809882C + ldr r0, _0813F964 + movs r1, 0xA8 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + ldr r3, _0813F968 + strb r4, [r3, 0x1] + ldr r0, _0813F960 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x14] + strb r2, [r3, 0x1] + b _0813FCC4 + .align 2, 0 +_0813F958: .4byte 0x085cc270 +_0813F95C: .4byte 0x02022e2c +_0813F960: .4byte 0x03005e00 +_0813F964: .4byte 0x0833900c +_0813F968: .4byte 0x02024332 +_0813F96C: + bl sub_8198C58 + lsls r0, 24 + asrs r6, r0, 24 + cmp r6, 0 + beq _0813F98C + cmp r6, 0 + bgt _0813F986 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + beq _0813F9E4 + b _0813FCC4 +_0813F986: + cmp r6, 0x1 + beq _0813F9E4 + b _0813FCC4 +_0813F98C: + ldr r0, _0813F9D4 + strb r6, [r0, 0x1] + ldr r0, _0813F9D8 + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r1, _0813F9DC + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813F9E0 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x16] + strh r1, [r0, 0x14] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x5 + beq _0813F9C0 + b _0813FCC4 +_0813F9C0: + movs r0, 0x1 + negs r0, r0 + str r6, [sp] + movs r1, 0 +_0813F9C8: + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _0813FCC4 + .align 2, 0 +_0813F9D4: .4byte 0x02024332 +_0813F9D8: .4byte 0x085cc270 +_0813F9DC: .4byte 0x02022e2c +_0813F9E0: .4byte 0x03005e00 +_0813F9E4: + ldr r1, _0813FA14 + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, _0813FA18 + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r1, _0813FA1C + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813FA20 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x18] + strh r1, [r0, 0x14] + b _0813FCC4 + .align 2, 0 +_0813FA14: .4byte 0x02024332 +_0813FA18: .4byte 0x085cc270 +_0813FA1C: .4byte 0x02022e2c +_0813FA20: .4byte 0x03005e00 +_0813FA24: + ldr r0, _0813FA8C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813FA32 + b _0813FCC4 +_0813FA32: + ldr r0, _0813FA90 + ldrb r0, [r0] + cmp r0, 0 + beq _0813FA3E + bl sub_800E084 +_0813FA3E: + movs r0, 0x3 + bl bg_get_tilemap + bl free + movs r0, 0x1 + bl bg_get_tilemap + bl free + movs r0, 0 + bl bg_get_tilemap + bl free + bl Window_FreeMemory + ldr r0, _0813FA94 + ldr r1, _0813FA98 + mov r2, r8 + adds r5, r2, r7 + lsls r5, 3 + adds r5, r1 + ldrb r1, [r5, 0x1C] + ldr r2, _0813FA9C + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _0813FAA0 + ldr r4, _0813FAA4 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 + ldrh r0, [r5, 0x14] + adds r0, 0x1 + strh r0, [r5, 0x14] + b _0813FCC4 + .align 2, 0 +_0813FA8C: .4byte 0x02037fd4 +_0813FA90: .4byte 0x030030fc +_0813FA94: .4byte 0x020244ec +_0813FA98: .4byte 0x03005e00 +_0813FA9C: .4byte 0x020244e9 +_0813FAA0: .4byte sub_813DF70 + 1 +_0813FAA4: .4byte 0x020244e2 +_0813FAA8: + ldr r0, _0813FADC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813FAB6 + b _0813FCC4 +_0813FAB6: + ldr r0, _0813FAE0 + ldr r1, [r0, 0x4] + ldr r0, _0813FAE4 + cmp r1, r0 + beq _0813FAC2 + b _0813FCC4 +_0813FAC2: + bl sub_81C1B94 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bne _0813FAEC + ldr r0, _0813FAE8 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0813FCC2 + .align 2, 0 +_0813FADC: .4byte 0x02037fd4 +_0813FAE0: .4byte 0x030022c0 +_0813FAE4: .4byte sub_813E3C0 + 1 +_0813FAE8: .4byte 0x03005e00 +_0813FAEC: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806E804 + cmp r0, 0 + beq _0813FB3C + ldr r0, _0813FB2C + ldr r1, _0813FB30 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r1, _0813FB34 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813FB38 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xB + strh r1, [r0, 0x14] + b _0813FCC4 + .align 2, 0 +_0813FB2C: .4byte 0x085cc270 +_0813FB30: .4byte 0x000004cc +_0813FB34: .4byte 0x02022e2c +_0813FB38: .4byte 0x03005e00 +_0813FB3C: + ldr r1, _0813FB90 + 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] + lsls r4, r6, 24 + lsrs r4, 24 + mov r0, r9 + adds r1, r4, 0 + bl sub_806B9A8 + ldr r0, _0813FB94 + ldrh r1, [r0] + mov r0, r9 + adds r2, r4, 0 + bl sub_80691F4 + ldr r0, _0813FB98 + movs r1, 0xCF + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r1, _0813FB9C + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813FBA0 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .align 2, 0 +_0813FB90: .4byte 0x02022f68 +_0813FB94: .4byte 0x020244e2 +_0813FB98: .4byte 0x085cc270 +_0813FB9C: .4byte 0x02022e2c +_0813FBA0: .4byte 0x03005e00 +_0813FBA4: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _0813FBB2 + b _0813FCC4 +_0813FBB2: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813FBBE + b _0813FCC4 +_0813FBBE: + ldr r0, _0813FBE0 + ldr r0, [r0, 0x1C] + bl sub_814E6F0 + ldr r1, _0813FBE4 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, _0813FBE8 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .align 2, 0 +_0813FBE0: .4byte 0x085cc270 +_0813FBE4: .4byte 0x02022e2c +_0813FBE8: .4byte 0x03005e00 +_0813FBEC: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813FCC4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813FCC4 + ldr r0, _0813FC2C + movs r1, 0xD0 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_814E6F0 + ldr r1, _0813FC30 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813FC34 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x12 + strh r1, [r0, 0x8] + b _0813FCC4 + .align 2, 0 +_0813FC2C: .4byte 0x085cc270 +_0813FC30: .4byte 0x02022e2c +_0813FC34: .4byte 0x03005e00 +_0813FC38: + ldr r0, _0813FC64 + ldr r0, [r0, 0x20] + bl sub_814E6F0 + ldr r1, _0813FC68 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813FC6C + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0xA + strh r1, [r0, 0x16] + strh r2, [r0, 0x18] + movs r1, 0x3 + strh r1, [r0, 0x14] + b _0813FCC4 + .align 2, 0 +_0813FC64: .4byte 0x085cc270 +_0813FC68: .4byte 0x02022e2c +_0813FC6C: .4byte 0x03005e00 +_0813FC70: + ldr r0, _0813FC94 + ldr r0, [r0, 0x24] + bl sub_814E6F0 + ldr r1, _0813FC98 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, _0813FC9C + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 +_0813FC8C: + movs r1, 0xD + strh r1, [r0, 0x8] + b _0813FCC4 + .align 2, 0 +_0813FC94: .4byte 0x085cc270 +_0813FC98: .4byte 0x02022e2c +_0813FC9C: .4byte 0x03005e00 +_0813FCA0: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0813FCC4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813FCC4 + ldr r0, _0813FCD4 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 +_0813FCC2: + strh r0, [r1, 0x14] +_0813FCC4: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813FCD4: .4byte 0x03005e00 + thumb_func_end sub_813F1B8 + + thumb_func_start nullsub_83 +nullsub_83: @ 813FCD8 + bx lr + thumb_func_end nullsub_83 + + thumb_func_start sub_813FCDC +sub_813FCDC: @ 813FCDC + push {lr} + ldr r0, _0813FD44 + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _0813FD48 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _0813FD4C + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _0813FD50 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, _0813FD54 + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + ldr r0, _0813FD58 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + ldr r0, _0813FD5C + ldrh r1, [r0] + movs r0, 0x1C + bl lcd_io_set + ldr r0, _0813FD60 + ldrh r1, [r0] + movs r0, 0x1E + bl lcd_io_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_0813FD44: .4byte 0x02022e14 +_0813FD48: .4byte 0x02022e16 +_0813FD4C: .4byte 0x02022e18 +_0813FD50: .4byte 0x02022e1a +_0813FD54: .4byte 0x02022e1c +_0813FD58: .4byte 0x02022e1e +_0813FD5C: .4byte 0x02022e20 +_0813FD60: .4byte 0x02022e22 + thumb_func_end sub_813FCDC + + thumb_func_start sub_813FD64 +sub_813FD64: @ 813FD64 + push {lr} + ldr r0, _0813FDCC + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _0813FDD0 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _0813FDD4 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _0813FDD8 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, _0813FDDC + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + ldr r0, _0813FDE0 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + ldr r0, _0813FDE4 + ldrh r1, [r0] + movs r0, 0x1C + bl lcd_io_set + ldr r0, _0813FDE8 + ldrh r1, [r0] + movs r0, 0x1E + bl lcd_io_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_0813FDCC: .4byte 0x02022e14 +_0813FDD0: .4byte 0x02022e16 +_0813FDD4: .4byte 0x02022e18 +_0813FDD8: .4byte 0x02022e1a +_0813FDDC: .4byte 0x02022e1c +_0813FDE0: .4byte 0x02022e1e +_0813FDE4: .4byte 0x02022e20 +_0813FDE8: .4byte 0x02022e22 + thumb_func_end sub_813FD64 + + thumb_func_start sub_813FDEC +sub_813FDEC: @ 813FDEC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0813FE6C + adds r4, r0, r1 + movs r0, 0xC + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0813FE9A + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0813FE9A + ldrh r1, [r4] + adds r0, r1, 0x1 + strh r0, [r4] + lsls r1, 16 + asrs r1, 16 + ldr r3, _0813FE70 + movs r2, 0x4 + ldrsh r0, [r4, r2] + lsls r2, r0, 2 + adds r0, r3, 0x3 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r1, r0 + ble _0813FE8C + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0813FE74 + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + movs r0, 0x6 + ldrsh r2, [r4, r0] + movs r1, 0x4 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r1, r3, 0x2 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bne _0813FE5E + strh r5, [r4, 0x6] + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] +_0813FE5E: + movs r2, 0x4 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0] + b _0813FE8A + .align 2, 0 +_0813FE6C: .4byte 0x03005e08 +_0813FE70: .4byte 0x085b58c9 +_0813FE74: + ldr r0, _0813FEA0 + lsls r1, 5 + ldr r0, [r0] + adds r0, r1 + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + strh r5, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 +_0813FE8A: + strh r0, [r4, 0x2] +_0813FE8C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bne _0813FE9A + adds r0, r6, 0 + bl remove_task +_0813FE9A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0813FEA0: .4byte 0x0203ab84 + thumb_func_end sub_813FDEC + + thumb_func_start sub_813FEA4 +sub_813FEA4: @ 813FEA4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0813FEC8 + movs r1, 0x7 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0 + bne _0813FED0 + ldr r1, _0813FECC + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0xC] + b _0813FEDE + .align 2, 0 +_0813FEC8: .4byte sub_813FEE8 + 1 +_0813FECC: .4byte 0x03005e00 +_0813FED0: + ldr r0, _0813FEE4 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0xC] +_0813FEDE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0813FEE4: .4byte 0x03005e00 + thumb_func_end sub_813FEA4 + + thumb_func_start sub_813FEE8 +sub_813FEE8: @ 813FEE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0813FF14 + mov r8, r0 + ldr r1, _0813FF18 + mov r9, r1 + ldr r1, _0813FF1C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xC + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0813FF28 + ldr r7, _0813FF20 + ldr r6, _0813FF24 + b _0813FF2C + .align 2, 0 +_0813FF14: .4byte 0x02022e18 +_0813FF18: .4byte 0x02022e1a +_0813FF1C: .4byte 0x03005e00 +_0813FF20: .4byte 0x02022e1c +_0813FF24: .4byte 0x02022e1e +_0813FF28: + ldr r7, _0813FFB4 + ldr r6, _0813FFB8 +_0813FF2C: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x8] + adds r0, 0x80 + ands r0, r1 + strh r0, [r4, 0xA] + movs r1, 0x8 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl cosine + adds r0, 0x8 + mov r2, r8 + strh r0, [r2] + movs r1, 0x8 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + adds r0, 0x10 + mov r2, r9 + strh r0, [r2] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl cosine + adds r0, 0x8 + strh r0, [r7] + movs r2, 0xA + ldrsh r0, [r4, r2] + movs r1, 0x4 + bl sine + adds r0, 0x10 + strh r0, [r6] + ldr r0, _0813FFBC + bl is_function_an_active_task + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0813FFA6 + adds r0, r5, 0 + bl remove_task + mov r0, r8 + strh r4, [r0] + mov r1, r9 + strh r4, [r1] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r7] + strh r4, [r6] +_0813FFA6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813FFB4: .4byte 0x02022e20 +_0813FFB8: .4byte 0x02022e22 +_0813FFBC: .4byte sub_813FDEC + 1 + thumb_func_end sub_813FEE8 + + thumb_func_start sub_813FFC0 +sub_813FFC0: @ 813FFC0 + push {r4-r7,lr} + adds r6, r0, 0 + movs r1, 0 + ldr r5, _0813FFF8 + ldr r7, _0813FFFC +_0813FFCA: + lsls r0, r1, 4 + adds r4, r1, 0x1 + adds r2, r0, r7 + lsls r0, r1, 5 + adds r1, r0, r6 + movs r3, 0xF +_0813FFD6: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strh r0, [r1] + adds r2, 0x1 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0813FFD6 + adds r1, r4, 0 + cmp r1, 0x31 + ble _0813FFCA + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0813FFF8: .4byte 0x085b5884 +_0813FFFC: .4byte 0x085b58d9 + thumb_func_end sub_813FFC0 + + thumb_func_start sub_8140000 +sub_8140000: @ 8140000 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08140024 + movs r0, 0xC8 + lsls r0, 3 + bl malloc_and_clear + str r0, [r4] + bl sub_813FFC0 + cmp r5, 0 + bne _08140028 + movs r6, 0x1 + movs r4, 0x2 + b _0814002C + .align 2, 0 +_08140024: .4byte 0x0203ab84 +_08140028: + movs r6, 0x1 + movs r4, 0x3 +_0814002C: + ldr r0, _081400AC + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _081400B0 + 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, _081400B4 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r1, _081400B8 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + adds r0, r4, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + cmp r5, 0 + bne _081400C4 + ldr r1, _081400BC + movs r0, 0x50 + bl lcd_io_set + ldr r1, _081400C0 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xBA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + adds r0, r6, 0 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + b _081400DE + .align 2, 0 +_081400AC: .4byte 0x085b51e4 +_081400B0: .4byte 0x085b4134 +_081400B4: .4byte 0x085b482c +_081400B8: .4byte 0x085b4d10 +_081400BC: .4byte 0x00000442 +_081400C0: .4byte 0x00000808 +_081400C4: + ldr r1, _081400F4 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _081400F8 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xDA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set +_081400DE: + ldr r0, _081400FC + movs r1, 0x5 + bl AddTask + adds r0, r5, 0 + bl sub_813FEA4 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081400F4: .4byte 0x00000842 +_081400F8: .4byte 0x00000808 +_081400FC: .4byte sub_813FDEC + 1 + thumb_func_end sub_8140000 + + thumb_func_start sub_8140100 +sub_8140100: @ 8140100 + push {lr} + ldr r0, _0814012C + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _0814011E + ldr r0, _08140130 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x14] +_0814011E: + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x20 + bl rboxid_80040B8 + pop {r0} + bx r0 + .align 2, 0 +_0814012C: .4byte sub_813FDEC + 1 +_08140130: .4byte 0x03005e00 + thumb_func_end sub_8140100 + + thumb_func_start sub_8140134 +sub_8140134: @ 8140134 + push {lr} + ldr r0, _0814016C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08140148 + bl remove_task +_08140148: + ldr r0, _08140170 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0814015A + bl remove_task +_0814015A: + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x20 + bl rboxid_80040B8 + bl sub_8140174 + pop {r0} + bx r0 + .align 2, 0 +_0814016C: .4byte sub_813FDEC + 1 +_08140170: .4byte sub_813FEE8 + 1 + thumb_func_end sub_8140134 + + thumb_func_start sub_8140174 +sub_8140174: @ 8140174 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + ldr r0, _081401D0 + movs r1, 0 + strh r1, [r0] + ldr r0, _081401D4 + strh r1, [r0] + ldr r0, _081401D8 + strh r1, [r0] + movs r0, 0x1 + movs r1, 0x5 + bl sub_80391E0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + movs r1, 0x7 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x5 + bl sub_80391E0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + movs r1, 0x7 + bl gpu_bg_config_set_field + movs r1, 0xCA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _081401DC + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_081401D0: .4byte 0x02022e18 +_081401D4: .4byte 0x02022e1a +_081401D8: .4byte 0x02022e1c +_081401DC: .4byte 0x0203ab84 + thumb_func_end sub_8140174 + + thumb_func_start sub_81401E0 +sub_81401E0: @ 81401E0 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, _08140204 + adds r0, r2 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 + pop {r0} + bx r0 + .align 2, 0 +_08140204: .4byte 0x02020630 + thumb_func_end sub_81401E0 + + thumb_func_start sub_8140208 +sub_8140208: @ 8140208 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08140228 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, 0x1C + adds r1, r2 + ldr r1, [r1] + ldr r0, _0814022C + cmp r1, r0 + beq _08140230 + movs r0, 0 + b _08140232 + .align 2, 0 +_08140228: .4byte 0x02020630 +_0814022C: .4byte nullsub_12 + 1 +_08140230: + movs r0, 0x1 +_08140232: + pop {r1} + bx r1 + thumb_func_end sub_8140208 + + thumb_func_start sub_8140238 +sub_8140238: @ 8140238 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + ldr r0, _08140260 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB8 + ldrb r0, [r1] + cmp r0, 0 + beq _0814025A + adds r0, r1, 0 + bl task_tutorial_controls_fadein +_0814025A: + pop {r0} + bx r0 + .align 2, 0 +_08140260: .4byte 0x0203ab88 + thumb_func_end sub_8140238 + + thumb_func_start sub_8140264 +sub_8140264: @ 8140264 + push {r4,lr} + sub sp, 0x4 + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_8142814 + ldr r4, _081402D8 + ldr r0, [r4] + ldrh r0, [r0, 0x26] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x14 + bl lcd_io_set + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _081402A0 + ldrh r1, [r1, 0x34] + movs r0, 0x52 + bl lcd_io_set +_081402A0: + ldr r2, [r4] + movs r3, 0x2A + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081402C0 + ldr r1, _081402DC + ldr r3, _081402E0 + adds r0, r2, r3 + str r0, [r1] + ldr r0, _081402E4 + str r0, [r1, 0x4] + ldr r0, _081402E8 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0 + strh r0, [r2, 0x2A] +_081402C0: + ldr r0, [r4] + movs r2, 0x28 + ldrsh r1, [r0, r2] + cmp r1, 0x1 + beq _081402EC + cmp r1, 0x1 + ble _08140374 + cmp r1, 0x2 + beq _08140324 + cmp r1, 0xFF + beq _08140348 + b _08140374 + .align 2, 0 +_081402D8: .4byte 0x0203ab88 +_081402DC: .4byte 0x040000d4 +_081402E0: .4byte 0x0000133c +_081402E4: .4byte 0x060021c0 +_081402E8: .4byte 0x800001a0 +_081402EC: + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl gpu_bg_config_set_field + movs r0, 0 + bl gpu_sync_bg_show + ldr r1, _08140318 + ldr r2, [r4] + movs r3, 0xCF + lsls r3, 2 + adds r0, r2, r3 + str r0, [r1] + ldr r0, _0814031C + str r0, [r1, 0x4] + ldr r0, _08140320 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r2, 0x28] + b _08140374 + .align 2, 0 +_08140318: .4byte 0x040000d4 +_0814031C: .4byte 0x0600f9c0 +_08140320: .4byte 0x800001a0 +_08140324: + ldr r1, _0814033C + movs r2, 0xCF + lsls r2, 2 + adds r0, r2 + str r0, [r1] + ldr r0, _08140340 + str r0, [r1, 0x4] + ldr r0, _08140344 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + b _08140374 + .align 2, 0 +_0814033C: .4byte 0x040000d4 +_08140340: .4byte 0x0600f9c0 +_08140344: .4byte 0x800001a0 +_08140348: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0 + bl gpu_sync_bg_show + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _0814037C + mov r3, sp + str r3, [r1] + ldr r0, _08140380 + str r0, [r1, 0x4] + ldr r0, _08140384 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0x28] +_08140374: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814037C: .4byte 0x040000d4 +_08140380: .4byte 0x0600f9c0 +_08140384: .4byte 0x810001a0 + thumb_func_end sub_8140264 + + thumb_func_start sub_8140388 +sub_8140388: @ 8140388 + push {r4,r5,lr} + sub sp, 0x4 + movs r5, 0 + str r5, [sp] + ldr r4, _081403F8 + movs r0, 0xE6 + lsls r0, 6 + bl malloc_and_clear + str r0, [r4] + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081403FC + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + ldr r1, [r4] + movs r0, 0xBE + lsls r0, 1 + adds r1, r0 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r2, _08140400 + adds r1, r2 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _08140404 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r0, _08140408 + bl Window_InitFromTemplates + bl sub_8197200 + ldr r0, _0814040C + strb r5, [r0] + ldr r0, _08140410 + mov r1, sp + bl malloc_and_decompress + ldr r1, [r4] + ldr r2, _08140414 + adds r1, r2 + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081403F8: .4byte 0x0203ab88 +_081403FC: .4byte 0x085b6140 +_08140400: .4byte 0x0000117c +_08140404: .4byte 0x0000317c +_08140408: .4byte 0x085b614c +_0814040C: .4byte 0x0203ab8c +_08140410: .4byte 0x085b5dfc +_08140414: .4byte 0x0000397c + thumb_func_end sub_8140388 + + thumb_func_start sub_8140418 +sub_8140418: @ 8140418 + push {r4,r5,lr} + ldr r5, _08140468 + ldr r0, [r5] + ldr r4, _0814046C + adds r0, r4 + ldr r0, [r0] + bl free + ldr r0, [r5] + adds r0, r4 + movs r4, 0 + str r4, [r0] + bl Window_FreeMemory + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x2 + bl bg_unset_tilemap + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r0, [r5] + movs r2, 0xE6 + lsls r2, 6 + movs r1, 0 + bl memset + ldr r0, [r5] + bl free + str r4, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08140468: .4byte 0x0203ab88 +_0814046C: .4byte 0x0000397c + thumb_func_end sub_8140418 + + thumb_func_start sub_8140470 +sub_8140470: @ 8140470 + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, _08140504 + mov r0, sp + movs r2, 0x6 + bl memcpy + ldr r5, _08140508 + ldr r3, [r5] + ldr r4, _0814050C + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r3, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x4] + ldrh r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081404AA + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x4] +_081404AA: + ldr r1, [r5] + ldr r2, _08140510 + ldrb r0, [r1, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r2 + ldrb r0, [r0, 0x3] + adds r1, 0x22 + strb r0, [r1] + ldr r1, [r5] + ldrb r0, [r1, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r2 + ldrb r0, [r0, 0x4] + adds r1, 0x23 + strb r0, [r1] + ldr r2, [r5] + ldr r3, _08140514 + ldrb r1, [r2, 0x4] + lsls r0, r1, 30 + lsrs r0, 30 + lsrs r1, 7 + lsls r1, 1 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r2, 0x19] + ldr r2, [r5] + ldrb r1, [r2, 0x1A] + movs r0, 0xF + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1A] + ldr r0, [r5] + ldrb r0, [r0, 0x19] + cmp r0, 0x1 + bne _08140520 + ldr r4, _08140518 + ldr r3, _0814051C + mov r0, sp + ldrh r2, [r0] + b _08140528 + .align 2, 0 +_08140504: .4byte 0x085b6418 +_08140508: .4byte 0x0203ab88 +_0814050C: .4byte 0x020375e0 +_08140510: .4byte 0x085b6348 +_08140514: .4byte 0x085b6344 +_08140518: .4byte 0x02037714 +_0814051C: .4byte 0x02037b14 +_08140520: + ldr r4, _08140594 + ldr r3, _08140598 + mov r0, sp + ldrh r2, [r0, 0x2] +_08140528: + adds r0, r3, 0 + adds r0, 0xA2 + strh r2, [r0] + ldr r1, _0814059C + adds r0, r1, 0 + ands r0, r2 + strh r0, [r3] + ands r0, r1 + adds r2, r4, 0 + adds r2, 0xA2 + strh r0, [r2] + ands r0, r1 + strh r0, [r4] + ldr r0, _081405A0 + ldr r0, [r0] + adds r0, 0xB8 + bl sub_8151678 + movs r4, 0 +_0814054E: + ldr r5, _081405A0 + ldr r0, [r5] + adds r0, 0xB8 + lsls r2, r4, 3 + ldr r1, _081405A4 + adds r2, r1 + adds r1, r4, 0 + bl sub_815168C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xC + bls _0814054E + movs r4, 0 +_0814056C: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081405A8 + adds r0, r1 + movs r1, 0x41 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + beq _081405AC + adds r0, 0x2 + cmp r1, r0 + bne _081405B6 + ldr r0, [r5] + ldrb r1, [r0, 0x2] + movs r2, 0x1 + b _081405B2 + .align 2, 0 +_08140594: .4byte 0x02037714 +_08140598: .4byte 0x02037b14 +_0814059C: .4byte 0x0000ffff +_081405A0: .4byte 0x0203ab88 +_081405A4: .4byte 0x085b6388 +_081405A8: .4byte 0x020244ec +_081405AC: + ldr r0, [r5] + ldrb r1, [r0, 0x2] + movs r2, 0x2 +_081405B2: + orrs r1, r2 + strb r1, [r0, 0x2] +_081405B6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0814056C + bl sub_802F588 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8140470 + + thumb_func_start sub_81405CC +sub_81405CC: @ 81405CC + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _081405EC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _081405E0 + b _081407F8 +_081405E0: + lsls r0, 2 + ldr r1, _081405F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081405EC: .4byte 0x030022c0 +_081405F0: .4byte _081405F4 + .align 2, 0 +_081405F4: + .4byte _08140618 + .4byte _08140630 + .4byte _08140650 + .4byte _08140662 + .4byte _0814069C + .4byte _081406C0 + .4byte _081406E0 + .4byte _08140750 + .4byte _0814077A +_08140618: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl vblank_hblank_handler_set_zero + bl sub_8121DA0 + bl sub_8121E10 + b _081407F8 +_08140630: + bl sub_8140388 + bl TextBox_ResetSomeField + movs r1, 0x90 + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0814064C + movs r0, 0x52 + bl lcd_io_set + b _081407F8 + .align 2, 0 +_0814064C: .4byte 0x0000060a +_08140650: + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + bl reset_temp_tile_data_buffers + b _081407F8 +_08140662: + ldr r0, _08140690 + movs r2, 0xE0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + ldr r1, _08140694 + 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, _08140698 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081407F8 + .align 2, 0 +_08140690: .4byte 0x085b5bfc +_08140694: .4byte 0x08dbc2e8 +_08140698: .4byte 0x08dbca14 +_0814069C: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081406A8 + b _08140806 +_081406A8: + bl sub_8140470 + ldr r1, _081406BC + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + b _081407F8 + .align 2, 0 +_081406BC: .4byte 0x085b5fa0 +_081406C0: + movs r0, 0 + bl sub_8142C0C + bl sub_81439C8 + bl sub_814391C + bl sub_8143314 + bl sub_8142CD0 + bl sub_8142F7C + bl sub_81431E4 + b _081407F8 +_081406E0: + bl call_obj_callbacks + bl obj_sync_something + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + bl sub_8143514 + movs r0, 0x6 + bl sub_814372C + movs r0, 0 + bl sub_81436D0 + movs r0, 0 + bl sub_81424FC + ldr r4, _08140740 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08140744 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08140748 + movs r2, 0x3C + negs r2, r2 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0814074C + strh r5, [r0] + b _081407F8 + .align 2, 0 +_08140740: .4byte 0x0203ab8c +_08140744: .4byte 0x082a5b89 +_08140748: .4byte 0x02021bbc +_0814074C: .4byte 0x02021bbe +_08140750: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + b _081407F8 +_0814077A: + movs r0, 0x1 + bl enable_irqs + ldr r0, _081407E0 + bl SetVBlankCallback + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r0, _081407E4 + movs r1, 0 + bl AddTask + ldr r5, _081407E8 + ldr r1, [r5] + adds r1, 0xA4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081407EC + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0x6 + strh r0, [r4, 0x14] + bl sub_8145C30 + strh r0, [r4, 0x22] + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDE84 + ldr r0, _081407F0 + movs r1, 0x1 + bl AddTask + ldr r1, [r5] + adds r1, 0xA5 + strb r0, [r1] + ldr r0, _081407F4 + bl set_callback2 + b _08140806 + .align 2, 0 +_081407E0: .4byte sub_8140264 + 1 +_081407E4: .4byte sub_81408A8 + 1 +_081407E8: .4byte 0x0203ab88 +_081407EC: .4byte 0x03005e00 +_081407F0: .4byte sub_8140814 + 1 +_081407F4: .4byte sub_8140238 + 1 +_081407F8: + ldr r1, _08140810 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08140806: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08140810: .4byte 0x030022c0 + thumb_func_end sub_81405CC + + thumb_func_start sub_8140814 +sub_8140814: @ 8140814 + push {r4-r6,lr} + ldr r3, _081408A4 + ldr r0, [r3] + adds r0, 0x21 + ldrb r2, [r0] + adds r1, r2, 0x1 + strb r1, [r0] + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x23 + lsls r2, 24 + lsrs r2, 24 + adds r6, r3, 0 + ldrb r0, [r0] + cmp r2, r0 + bne _0814085A + adds r1, 0x21 + movs r0, 0 + strb r0, [r1] + ldr r2, [r6] + adds r3, r2, 0 + adds r3, 0x22 + ldrb r1, [r3] + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bge _0814085A + ldrb r1, [r3] + movs r3, 0xB4 + lsls r3, 1 + adds r0, r3, 0 + subs r0, r1 + strh r0, [r2, 0x24] +_0814085A: + adds r4, r6, 0 + ldr r0, [r4] + ldrh r0, [r0, 0x24] + bl sine2 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldrh r0, [r0, 0x24] + bl cosine2 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0 + bge _0814087E + adds r0, 0xF +_0814087E: + lsls r0, 12 + lsrs r5, r0, 16 + ldr r3, [r6] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0 + bge _0814088E + adds r0, 0xF +_0814088E: + asrs r0, 4 + strh r0, [r3, 0x32] + strh r0, [r3, 0x2C] + strh r5, [r3, 0x2E] + lsls r0, r5, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r3, 0x30] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081408A4: .4byte 0x0203ab88 + thumb_func_end sub_8140814 + + thumb_func_start sub_81408A8 +sub_81408A8: @ 81408A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081408FE + movs r1, 0x90 + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _08140904 + movs r0, 0x52 + bl lcd_io_set + ldr r1, _08140908 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x14] + adds r0, r4, 0 + bl sub_8141FF4 + bl sub_8142070 + bl sub_8143A40 + movs r0, 0 + bl sub_81424FC + movs r0, 0x6 + bl sub_814372C + ldr r1, _0814090C + ldr r2, _08140910 + adds r0, r4, 0 + movs r3, 0x3 + bl sub_8141F7C +_081408FE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08140904: .4byte 0x00000808 +_08140908: .4byte 0x03005e00 +_0814090C: .4byte sub_8140968 + 1 +_08140910: .4byte 0x0000ffff + thumb_func_end sub_81408A8 + + thumb_func_start sub_8140914 +sub_8140914: @ 8140914 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r5, _0814095C + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + ldr r2, _08140960 + movs r1, 0x1 + 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 + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08140964 + adds r0, r4, 0 + bl sub_8121F68 + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814095C: .4byte 0x0203ab8c +_08140960: .4byte 0x082a5c13 +_08140964: .4byte 0x085b6410 + thumb_func_end sub_8140914 + + thumb_func_start sub_8140968 +sub_8140968: @ 8140968 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + ldr r1, _0814098C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08140990 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814098C: .4byte 0x03005e00 +_08140990: .4byte sub_8140BD0 + 1 + thumb_func_end sub_8140968 + + thumb_func_start sub_8140994 +sub_8140994: @ 8140994 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081409B4 + ldr r0, [r0] + adds r0, 0xA5 + ldrb r0, [r0] + bl remove_task + adds r0, r4, 0 + bl sub_8141DE4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081409B4: .4byte 0x0203ab88 + thumb_func_end sub_8140994 + + thumb_func_start sub_81409B8 +sub_81409B8: @ 81409B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _081409CA + b _08140AE8 +_081409CA: + lsls r0, r4, 2 + ldr r1, _081409D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081409D4: .4byte _081409D8 + .align 2, 0 +_081409D8: + .4byte _08140A18 + .4byte _08140A3C + .4byte _08140A3C + .4byte _08140A3C + .4byte _08140A3C + .4byte _08140A90 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140A90 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140A90 +_08140A18: + ldr r0, _08140A38 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + movs r1, 0x10 + str r1, [sp] + movs r1, 0xD + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + b _08140B4E + .align 2, 0 +_08140A38: .4byte 0x0203ab88 +_08140A3C: + lsls r0, r4, 1 + adds r0, r4 + adds r0, 0xE + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, _08140A84 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + movs r1, 0x10 + str r1, [sp] + movs r6, 0xD + str r6, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + ldr r0, [r5] + adds r4, r0, r4 + ldr r1, _08140A88 + adds r0, r1 + ldr r1, [r0] + ldr r0, _08140A8C + adds r1, r0 + movs r0, 0x3 + str r0, [sp] + str r6, [sp, 0x4] + adds r0, r4, 0 + mov r2, r8 + movs r3, 0x7 + bl sub_8152058 + b _08140B4E + .align 2, 0 +_08140A84: .4byte 0x0203ab88 +_08140A88: .4byte 0x0000397c +_08140A8C: .4byte 0x00000232 +_08140A90: + subs r0, r4, 0x1 + movs r1, 0x5 + bl __divsi3 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0xA + lsls r1, 24 + lsrs r7, r1, 24 + ldr r5, _08140AE0 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + movs r6, 0x10 + str r6, [sp] + movs r1, 0xD + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + ldr r0, [r5] + adds r4, r0, r4 + ldr r1, _08140AE4 + adds r0, r1 + ldr r1, [r0] + movs r0, 0xA0 + lsls r0, 2 + adds r1, r0 + str r6, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0xE + adds r3, r7, 0 + bl sub_8152058 + b _08140B4E + .align 2, 0 +_08140AE0: .4byte 0x0203ab88 +_08140AE4: .4byte 0x0000397c +_08140AE8: + adds r0, r4, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0xE + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + subs r0, r4, 0x1 + movs r1, 0x5 + bl __divsi3 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x7 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r5, _08140B5C + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + movs r1, 0x10 + str r1, [sp] + movs r1, 0xD + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + ldr r0, [r5] + adds r4, r0, r4 + ldr r1, _08140B60 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 2 + adds r1, r0 + movs r0, 0x3 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r2, r8 + adds r3, r7, 0 + bl sub_8152058 +_08140B4E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08140B5C: .4byte 0x0203ab88 +_08140B60: .4byte 0x0000397c + thumb_func_end sub_81409B8 + + thumb_func_start sub_8140B64 +sub_8140B64: @ 8140B64 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08140B88 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x10] + bl sub_81436D0 + ldrb r0, [r4, 0x10] + bl sub_81409B8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08140B88: .4byte 0x03005e00 + thumb_func_end sub_8140B64 + + thumb_func_start sub_8140B8C +sub_8140B8C: @ 8140B8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08140BC4 + ldr r2, [r5] + movs r6, 0 + movs r1, 0x1 + strh r1, [r2, 0x28] + ldr r1, _08140BC8 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x10] + bl sub_81409B8 + ldr r0, [r5] + adds r0, 0x23 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x21 + strb r6, [r0] + ldr r0, _08140BCC + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08140BC4: .4byte 0x0203ab88 +_08140BC8: .4byte 0x03005e00 +_08140BCC: .4byte sub_8141040 + 1 + thumb_func_end sub_8140B8C + + thumb_func_start sub_8140BD0 +sub_8140BD0: @ 8140BD0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08140C24 + ldr r0, [r1] + ldr r2, [r0, 0x8] + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08140C30 + movs r3, 0xB + ldr r5, _08140C28 + adds r0, r5, 0 + adds r0, 0xE4 + ldr r0, [r0] + ands r2, r0 + ldr r0, _08140C2C + mov r12, r0 + lsls r7, r6, 2 + cmp r2, 0 + beq _08140C6E + adds r4, r1, 0 + adds r5, 0x8 +_08140BFE: + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r3, r0, 16 + asrs r2, r0, 16 + cmp r2, 0xD + bgt _08140C6E + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08140BFE + b _08140C6E + .align 2, 0 +_08140C24: .4byte 0x0203ab88 +_08140C28: .4byte 0x085b6154 +_08140C2C: .4byte 0x03005e00 +_08140C30: + movs r3, 0x6 + ldr r5, _08140C9C + adds r0, r5, 0 + adds r0, 0x80 + ldr r0, [r0] + ands r2, r0 + ldr r0, _08140CA0 + mov r12, r0 + lsls r7, r6, 2 + cmp r2, 0 + beq _08140C6E + adds r4, r1, 0 + adds r5, 0x8 +_08140C4A: + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r3, r0, 16 + asrs r2, r0, 16 + cmp r2, 0x9 + bgt _08140C6E + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08140C4A +_08140C6E: + adds r4, r7, r6 + lsls r4, 3 + add r4, r12 + movs r5, 0 + strh r3, [r4, 0x10] + adds r0, r6, 0 + bl sub_8141FF4 + ldrb r0, [r4, 0x10] + bl sub_81424FC + ldrb r0, [r4, 0x10] + bl sub_81436D0 + ldrb r0, [r4, 0x10] + bl sub_8142284 + strh r5, [r4, 0xA] + ldr r0, _08140CA4 + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08140C9C: .4byte 0x085b6154 +_08140CA0: .4byte 0x03005e00 +_08140CA4: .4byte sub_8140B8C + 1 + thumb_func_end sub_8140BD0 + + thumb_func_start sub_8140CA8 +sub_8140CA8: @ 8140CA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r6, 0 + movs r7, 0 + ldr r1, _08140CF0 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldrb r0, [r4] + mov r8, r0 + cmp r5, 0 + blt _08140D1C + cmp r5, 0x1 + bgt _08140CF4 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __modsi3 + lsls r0, 24 + lsrs r6, r0, 24 + movs r2, 0xF0 + lsls r2, 20 + adds r1, r0, r2 + lsrs r7, r1, 24 + cmp r0, 0 + bne _08140D1C + movs r6, 0x5 + b _08140D1C + .align 2, 0 +_08140CF0: .4byte 0x085b641e +_08140CF4: + cmp r5, 0x3 + bgt _08140D1C + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r2, 0x80 + lsls r2, 19 + adds r0, r1, r2 + lsrs r7, r0, 24 + cmp r1, 0 + bne _08140D1C + movs r6, 0x1 +_08140D1C: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r2, [r4] + adds r0, r2 + strh r0, [r4] + lsls r1, r6, 24 + asrs r3, r1, 24 + lsls r0, 16 + asrs r0, 16 + lsls r2, r7, 24 + cmp r0, r3 + bge _08140D3E + asrs r0, r2, 24 + strh r0, [r4] +_08140D3E: + movs r0, 0 + ldrsh r1, [r4, r0] + asrs r0, r2, 24 + cmp r1, r0 + ble _08140D4A + strh r3, [r4] +_08140D4A: + mov r1, r8 + lsls r0, r1, 24 + movs r2, 0 + ldrsh r1, [r4, r2] + asrs r0, 24 + cmp r1, r0 + bne _08140D5C + movs r0, 0 + b _08140D5E +_08140D5C: + movs r0, 0x1 +_08140D5E: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8140CA8 + + thumb_func_start sub_8140D6C +sub_8140D6C: @ 8140D6C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r9, r0 + movs r5, 0 + ldr r4, _08140F48 + ldrh r1, [r4, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08140DA8 + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _08140F4C + adds r0, r1 + adds r0, 0x8 + movs r1, 0 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140DA8 + b _08140F3A +_08140DA8: + ldrh r1, [r4, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08140DCE + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _08140F4C + adds r0, r1 + adds r0, 0x8 + movs r1, 0x1 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140DCE + b _08140F3A +_08140DCE: + ldrh r1, [r4, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08140DF4 + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _08140F4C + adds r0, r1 + adds r0, 0x8 + movs r1, 0x2 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140DF4 + b _08140F3A +_08140DF4: + ldrh r1, [r4, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08140E1A + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _08140F4C + adds r0, r1 + adds r0, 0x8 + movs r1, 0x3 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140E1A + b _08140F3A +_08140E1A: + cmp r5, 0 + bne _08140E20 + b _08140F3A +_08140E20: + ldr r0, _08140F50 + lsls r6, r7, 2 + adds r4, r6, r7 + lsls r4, 3 + adds r4, r0 + ldrb r0, [r4, 0x10] + bl sub_81424FC + adds r0, r7, 0 + bl sub_8140B64 + mov r1, r9 + strh r1, [r4, 0xA] + movs r0, 0x5 + bl audio_play + ldr r5, _08140F54 + ldr r0, [r5] + adds r0, 0xB8 + ldr r1, _08140F58 + bl sub_8151A9C + ldr r5, [r5] + movs r2, 0xB8 + lsls r2, 1 + adds r3, r5, r2 + ldrb r2, [r3] + movs r1, 0x7F + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xB2 + lsls r0, 1 + adds r3, r5, r0 + ldrb r2, [r3] + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xAC + lsls r0, 1 + adds r2, r5, r0 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + ldrb r0, [r4, 0x10] + bl sub_8142284 + movs r4, 0 + mov r9, r6 + ldr r1, _08140F5C + mov r12, r1 + movs r2, 0x8 + add r2, r12 + mov r10, r2 +_08140E8C: + ldr r0, _08140F54 + ldr r5, [r0] + adds r0, r4, 0 + adds r0, 0x29 + adds r6, r5, 0 + adds r6, 0x3C + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r12 + adds r3, r0, r1 + adds r2, r3, 0 + adds r2, 0x40 + add r0, r10 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, _08140F60 + mov r8, r2 + mov r0, r8 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, _08140F64 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08140E8C + ldr r0, _08140F50 + mov r2, r9 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r3, [r1, 0x10] + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _08140F3A + ldr r2, _08140F68 + movs r0, 0x10 + ldrsh r1, [r1, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r5, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08140F3A + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, 0x29 + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08140F5C + adds r3, r0, r1 + adds r2, r3, 0 + adds r2, 0x40 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldrh r2, [r2] + adds r1, r2 + mov r2, r8 + ands r1, r2 + ldrh r2, [r3, 0x4] + ldr r0, _08140F64 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] +_08140F3A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08140F48: .4byte 0x030022c0 +_08140F4C: .4byte 0x03005e08 +_08140F50: .4byte 0x03005e00 +_08140F54: .4byte 0x0203ab88 +_08140F58: .4byte 0x0000ffff +_08140F5C: .4byte 0x02020630 +_08140F60: .4byte 0x000003ff +_08140F64: .4byte 0xfffffc00 +_08140F68: .4byte 0x085b6154 + thumb_func_end sub_8140D6C + + thumb_func_start sub_8140F6C +sub_8140F6C: @ 8140F6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80EECA4 + ldr r0, _08140F8C + ldr r1, [r0] + movs r0, 0xFF + strh r0, [r1, 0x28] + ldrb r2, [r1, 0x19] + cmp r2, 0x1 + bne _08140F90 + adds r0, r1, 0 + adds r0, 0x23 + strb r2, [r0] + b _08140F96 + .align 2, 0 +_08140F8C: .4byte 0x0203ab88 +_08140F90: + adds r1, 0x23 + movs r0, 0 + strb r0, [r1] +_08140F96: + ldr r0, _08140FB8 + ldr r0, [r0] + adds r0, 0x21 + movs r1, 0 + strb r1, [r0] + ldr r1, _08140FBC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x20 + strh r1, [r0, 0xA] + ldr r1, _08140FC0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08140FB8: .4byte 0x0203ab88 +_08140FBC: .4byte 0x03005e00 +_08140FC0: .4byte sub_81410FC + 1 + thumb_func_end sub_8140F6C + + thumb_func_start sub_8140FC4 +sub_8140FC4: @ 8140FC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08141034 + ldr r2, [r4] + ldrb r1, [r2, 0x1A] + lsls r1, 28 + lsrs r1, 28 + adds r2, 0x1B + adds r2, r1 + ldr r3, _08141038 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r3 + ldrh r0, [r5, 0x10] + strb r0, [r2] + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + ldrb r0, [r1] + bl sub_8142758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xC] + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + ldrb r0, [r1] + bl sub_81436D0 + ldr r0, [r4] + ldrb r1, [r0, 0x19] + ldrh r0, [r5, 0x22] + subs r0, r1 + strh r0, [r5, 0x22] + lsls r0, 16 + cmp r0, 0 + bge _08141024 + movs r0, 0 + strh r0, [r5, 0x22] +_08141024: + ldrh r0, [r5, 0x22] + bl sub_8143514 + ldr r0, _0814103C + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141034: .4byte 0x0203ab88 +_08141038: .4byte 0x03005e00 +_0814103C: .4byte sub_8140F6C + 1 + thumb_func_end sub_8140FC4 + + thumb_func_start sub_8141040 +sub_8141040: @ 8141040 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_8140D6C + ldr r1, _08141068 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x1E + beq _08141076 + cmp r0, 0x1E + bgt _0814106C + cmp r0, 0 + beq _08141072 + b _0814108A + .align 2, 0 +_08141068: .4byte 0x03005e00 +_0814106C: + cmp r0, 0x3B + beq _08141084 + b _0814108A +_08141072: + ldrb r0, [r4, 0x10] + b _08141078 +_08141076: + movs r0, 0 +_08141078: + bl sub_81409B8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _0814109A +_08141084: + movs r0, 0 + strh r0, [r4, 0xA] + b _0814109A +_0814108A: + ldr r0, _081410D8 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0814109A: + ldr r0, _081410DC + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081410F2 + ldr r0, _081410E0 + ldr r3, [r0] + ldr r2, _081410E4 + ldr r1, _081410D8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x10 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r3, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081410E8 + movs r0, 0x16 + bl audio_play + b _081410F2 + .align 2, 0 +_081410D8: .4byte 0x03005e00 +_081410DC: .4byte 0x030022c0 +_081410E0: .4byte 0x0203ab88 +_081410E4: .4byte 0x085b6154 +_081410E8: + movs r0, 0x5F + bl m4aSongNumStart + ldr r0, _081410F8 + str r0, [r4] +_081410F2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081410F8: .4byte sub_8140FC4 + 1 + thumb_func_end sub_8141040 + + thumb_func_start sub_81410FC +sub_81410FC: @ 81410FC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08141154 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0xA] + subs r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + ble _08141168 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08141128 + ldr r1, _08141158 + ldrh r0, [r1] + adds r0, 0x2 + strh r0, [r1] +_08141128: + ldr r0, _0814115C + ldr r1, [r0] + ldrh r0, [r1, 0x26] + adds r0, 0x4 + strh r0, [r1, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x68 + bne _08141180 + ldr r2, _08141160 + adds r0, r1, 0 + adds r0, 0x55 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _08141164 + str r1, [r0] + b _08141180 + .align 2, 0 +_08141154: .4byte 0x03005e00 +_08141158: .4byte 0x02021bbc +_0814115C: .4byte 0x0203ab88 +_08141160: .4byte 0x02020630 +_08141164: .4byte nullsub_12 + 1 +_08141168: + movs r0, 0x1 + movs r1, 0xFF + bl sub_8142E70 + movs r0, 0x1 + movs r1, 0xFF + bl sub_8143038 + ldr r0, _08141188 + str r0, [r4] + movs r0, 0 + strh r0, [r4, 0xA] +_08141180: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08141188: .4byte sub_8141344 + 1 + thumb_func_end sub_81410FC + + thumb_func_start sub_814118C +sub_814118C: @ 814118C + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _081411A8 + ldr r3, [r0] + ldrb r2, [r3, 0x2] + adds r5, r0, 0 + cmp r2, 0x2 + bgt _081411AC + cmp r2, 0x1 + bge _081411B2 + b _08141280 + .align 2, 0 +_081411A8: .4byte 0x0203ab88 +_081411AC: + cmp r2, 0x3 + beq _08141214 + b _08141280 +_081411B2: + ldr r0, _081411DC + ldrb r0, [r0, 0x2] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _081411E4 + cmp r4, 0xB + bls _081411CC + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141296 +_081411CC: + ldr r0, _081411E0 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 1 + b _0814133A + .align 2, 0 +_081411DC: .4byte 0x03005cf8 +_081411E0: .4byte 0x085b6348 +_081411E4: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08141200 + ldr r0, _081411FC + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 1 + b _0814133A + .align 2, 0 +_081411FC: .4byte 0x085b6348 +_08141200: + ldr r0, _08141210 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + b _0814133A + .align 2, 0 +_08141210: .4byte 0x085b6348 +_08141214: + ldr r0, _08141240 + ldrb r0, [r0, 0x2] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bhi _08141248 + cmp r4, 0x5 + bls _0814122E + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141296 +_0814122E: + ldr r0, _08141244 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 1 + b _0814133A + .align 2, 0 +_08141240: .4byte 0x03005cf8 +_08141244: .4byte 0x085b6348 +_08141248: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141268 + cmp r4, 0x6 + bls _08141268 + ldr r0, _08141264 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 2 + b _0814133A + .align 2, 0 +_08141264: .4byte 0x085b6348 +_08141268: + ldr r1, _0814127C + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsrs r0, 1 + b _0814133A + .align 2, 0 +_0814127C: .4byte 0x085b6348 +_08141280: + ldr r0, _0814129C + ldrb r0, [r0, 0x2] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _081412B8 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081412A0 +_08141296: + movs r0, 0x1 + b _0814133A + .align 2, 0 +_0814129C: .4byte 0x03005cf8 +_081412A0: + ldr r1, _081412B4 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsrs r0, 1 + b _0814133A + .align 2, 0 +_081412B4: .4byte 0x085b6348 +_081412B8: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081412F0 + cmp r4, 0xC + bls _081412DC + ldr r1, _081412D8 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsrs r0, 1 + b _0814133A + .align 2, 0 +_081412D8: .4byte 0x085b6348 +_081412DC: + ldr r1, _081412EC + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + b _0814133A + .align 2, 0 +_081412EC: .4byte 0x085b6348 +_081412F0: + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08141328 + cmp r4, 0xC + bls _08141314 + ldr r1, _08141310 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + b _0814133A + .align 2, 0 +_08141310: .4byte 0x085b6348 +_08141314: + ldr r1, _08141324 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x1] + b _0814133A + .align 2, 0 +_08141324: .4byte 0x085b6348 +_08141328: + ldr r1, _08141340 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 25 + lsrs r0, 24 +_0814133A: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08141340: .4byte 0x085b6348 + thumb_func_end sub_814118C + + thumb_func_start sub_8141344 +sub_8141344: @ 8141344 + 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 r10, r0 + movs r4, 0 + ldr r1, _081413D0 + mov r0, sp + movs r2, 0x8 + bl memcpy + bl GenerateRandomNumber + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r7, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, _081413D4 + ldr r0, [r3] + ldr r2, _081413D8 + mov r5, r10 + lsls r1, r5, 2 + add r1, r10 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0x14] + adds r0, 0x7C + strb r2, [r0] + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7F + strb r4, [r2] + subs r2, 0x1 + strb r4, [r2] + adds r0, 0x7D + strb r4, [r0] + ldrh r0, [r1, 0x18] + adds r1, r7, 0 + bl sub_814118C + adds r4, r0, 0 + lsls r4, 24 + lsrs r1, r4, 24 + adds r0, r7, 0 + bl __modsi3 + lsrs r4, 25 + subs r0, r4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081413DC + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + movs r5, 0x1 + cmp r0, 0xC + bgt _081413C8 + movs r5, 0 +_081413C8: + cmp r6, 0x4F + bhi _081413E0 + lsls r0, r5, 25 + b _081413EA + .align 2, 0 +_081413D0: .4byte 0x085b6422 +_081413D4: .4byte 0x0203ab88 +_081413D8: .4byte 0x03005e00 +_081413DC: .4byte 0x03005cf8 +_081413E0: + lsls r1, r5, 24 + asrs r1, 24 + movs r0, 0x1 + subs r0, r1 + lsls r0, 25 +_081413EA: + lsrs r5, r0, 24 + ldr r0, _08141530 + ldr r6, [r0] + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 25 + ldr r1, _08141534 + adds r0, r1 + lsls r4, 24 + asrs r4, 24 + ldrh r0, [r0, 0x1A] + adds r4, r0 + adds r0, r6, 0 + adds r0, 0x80 + strh r4, [r0] + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _0814141C + ldr r1, _08141538 + bl __addsf3 +_0814141C: + ldr r1, _0814153C + bl __divsf3 + bl __fixunssfsi + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 1 + adds r0, r4 + movs r2, 0x82 + adds r2, r6 + mov r8, r2 + strh r0, [r2] + adds r0, r6, 0 + adds r0, 0x84 + strh r4, [r0] + adds r0, 0x2 + strh r4, [r0] + movs r0, 0x88 + adds r0, r6 + mov r9, r0 + movs r0, 0x1 + ands r0, r7 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r1 + lsls r0, 1 + add r0, sp + movs r1, 0 + ldrsh r4, [r0, r1] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08141468 + ldr r1, _08141538 + bl __addsf3 +_08141468: + mov r2, r9 + str r0, [r2] + adds r7, r6, 0 + adds r7, 0x8C + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 25 + ldr r5, _08141534 + adds r0, r5 + movs r1, 0x18 + ldrsh r4, [r0, r1] + adds r0, r4, 0 + bl __floatsisf + adds r5, r0, 0 + cmp r4, 0 + bge _08141492 + ldr r1, _08141538 + bl __addsf3 + adds r5, r0, 0 +_08141492: + str r5, [r7] + adds r7, r6, 0 + adds r7, 0x90 + ldr r1, _08141540 + adds r0, r5, 0 + bl __mulsf3 + adds r1, r5, 0 + bl __subsf3 + adds r5, r0, 0 + mov r2, r8 + movs r0, 0 + ldrsh r4, [r2, r0] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _081414C2 + ldr r1, _08141538 + bl __addsf3 + adds r2, r0, 0 +_081414C2: + adds r0, r5, 0 + adds r1, r2, 0 + bl __divsf3 + str r0, [r7] + adds r1, r6, 0 + adds r1, 0x94 + ldr r0, _08141544 + str r0, [r1] + adds r1, 0x8 + ldr r0, _08141548 + str r0, [r1] + adds r5, r6, 0 + adds r5, 0x98 + mov r1, r8 + movs r2, 0 + ldrsh r4, [r1, r2] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _081414F8 + ldr r1, _08141538 + bl __addsf3 + adds r2, r0, 0 +_081414F8: + ldr r0, _0814154C + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + str r0, [r5] + adds r1, r6, 0 + adds r1, 0xA0 + ldr r0, _08141550 + str r0, [r1] + ldr r1, _08141554 + mov r5, r10 + lsls r0, r5, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldr r1, _08141558 + str r1, [r0] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08141530: .4byte 0x0203ab88 +_08141534: .4byte 0x085b6348 +_08141538: .4byte 0x47800000 +_0814153C: .4byte 0x40a00000 +_08141540: .4byte 0x3f000000 +_08141544: .4byte 0x42880000 +_08141548: .4byte 0x00000000 +_0814154C: .4byte 0x41000000 +_08141550: .4byte 0x42100000 +_08141554: .4byte 0x03005e00 +_08141558: .4byte sub_814155C + 1 + thumb_func_end sub_8141344 + + thumb_func_start sub_814155C +sub_814155C: @ 814155C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _081415C0 + ldr r3, [r4] + ldrb r1, [r3, 0x3] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r3, 0x3] + ldr r3, [r4] + adds r2, r3, 0 + adds r2, 0x7C + adds r1, r3, 0 + adds r1, 0x3C + ldrb r2, [r2] + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, _081415C4 + adds r1, r2 + str r1, [r3, 0x38] + ldr r2, _081415C8 + str r2, [r1, 0x1C] + ldr r1, _081415CC + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r1, [r4, 0x14] + adds r1, 0x1 + strh r1, [r4, 0x14] + ldrh r0, [r4, 0x18] + adds r0, 0x1 + strh r0, [r4, 0x18] + movs r0, 0x6 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl sub_814372C + movs r0, 0x5C + bl m4aSongNumStart + ldr r0, _081415D0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081415C0: .4byte 0x0203ab88 +_081415C4: .4byte 0x02020630 +_081415C8: .4byte sub_81446AC + 1 +_081415CC: .4byte 0x03005e00 +_081415D0: .4byte sub_81415D4 + 1 + thumb_func_end sub_814155C + + thumb_func_start sub_81415D4 +sub_81415D4: @ 81415D4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, _08141610 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x7D + ldrb r0, [r0] + cmp r0, 0 + beq _081416C6 + ldrb r1, [r3, 0x3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08141614 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081416C6 + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x3] + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + b _081416C6 + .align 2, 0 +_08141610: .4byte 0x0203ab88 +_08141614: + ldr r2, _08141688 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r5, r0, r2 + movs r2, 0xA + ldrsh r0, [r5, r2] + adds r7, r1, 0 + cmp r0, 0 + bne _08141660 + adds r0, r3, 0 + adds r0, 0x7E + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81420D0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r6] + ldrb r1, [r2, 0x1A] + lsls r1, 28 + lsrs r1, 28 + adds r2, 0x1B + adds r2, r1 + ldrb r1, [r2] + bl sub_81421E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + cmp r0, 0x1 + bne _08141660 + ldr r0, [r6] + adds r0, 0xB8 + movs r1, 0x80 + lsls r1, 5 + bl sub_8151A48 +_08141660: + ldr r0, _08141688 + adds r1, r7, r4 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x3C + bgt _08141690 + ldr r0, _0814168C + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141680 + movs r0, 0x3C + strh r0, [r4, 0xA] +_08141680: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _081416C6 + .align 2, 0 +_08141688: .4byte 0x03005e00 +_0814168C: .4byte 0x030022c0 +_08141690: + ldr r0, _081416CC + ldr r1, [r0] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + ldrb r0, [r1] + bl sub_81424FC + ldrh r1, [r4, 0x20] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8142E70 + ldrb r1, [r4, 0x14] + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8143038 + movs r0, 0x20 + strh r0, [r4, 0xA] + ldr r0, _081416D0 + str r0, [r4] +_081416C6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081416CC: .4byte 0x0203ab88 +_081416D0: .4byte sub_81416D4 + 1 + thumb_func_end sub_81415D4 + + thumb_func_start sub_81416D4 +sub_81416D4: @ 81416D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0814172C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + subs r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + ble _08141740 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08141700 + ldr r1, _08141730 + ldrh r0, [r1] + subs r0, 0x2 + strh r0, [r1] +_08141700: + ldr r0, _08141734 + ldr r1, [r0] + ldrh r0, [r1, 0x26] + subs r0, 0x4 + strh r0, [r1, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x68 + bne _08141768 + ldr r2, _08141738 + adds r0, r1, 0 + adds r0, 0x55 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _0814173C + str r1, [r0] + b _08141768 + .align 2, 0 +_0814172C: .4byte 0x03005e00 +_08141730: .4byte 0x02021bbc +_08141734: .4byte 0x0203ab88 +_08141738: .4byte 0x02020630 +_0814173C: .4byte sub_814390C + 1 +_08141740: + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + bl sub_8143150 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08141756 + movs r0, 0x79 + b _08141758 +_08141756: + movs r0, 0x3D +_08141758: + strh r0, [r4, 0xA] + ldr r0, _08141770 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _08141774 + str r0, [r1] +_08141768: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141770: .4byte 0x03005e00 +_08141774: .4byte sub_8141778 + 1 + thumb_func_end sub_81416D4 + + thumb_func_start sub_8141778 +sub_8141778: @ 8141778 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _081417C8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + subs r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081417E8 + movs r0, 0xA + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081417A2 + adds r0, 0xF +_081417A2: + asrs r0, 4 + lsls r0, 4 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _081417CC + cmp r0, 0x8 + bne _081417F4 + movs r0, 0 + movs r1, 0xFF + bl sub_8142E70 + movs r0, 0 + movs r1, 0xFF + bl sub_8143038 + b _081417F4 + .align 2, 0 +_081417C8: .4byte 0x03005e00 +_081417CC: + ldrh r1, [r4, 0x20] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8142E70 + ldrb r1, [r4, 0x14] + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8143038 + b _081417F4 +_081417E8: + ldr r1, _081417FC + adds r0, r2, 0 + movs r2, 0x1E + movs r3, 0 + bl sub_8141F7C +_081417F4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081417FC: .4byte sub_814189C + 1 + thumb_func_end sub_8141778 + + thumb_func_start sub_8141800 +sub_8141800: @ 8141800 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08141858 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08141864 + cmp r0, 0 + blt _08141864 + cmp r0, 0x2 + bgt _08141864 + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _08141888 + movs r0, 0x1D + bl sub_80847F8 + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bcs _08141848 + movs r0, 0x1E + ldrsh r1, [r4, r0] + movs r0, 0x1D + bl sav12_xor_set +_08141848: + ldr r1, _0814185C + ldr r2, _08141860 + adds r0, r5, 0 + movs r3, 0x3 + bl sub_8141F7C + b _08141888 + .align 2, 0 +_08141858: .4byte 0x03005e00 +_0814185C: .4byte sub_8141A18 + 1 +_08141860: .4byte 0x0000ffff +_08141864: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _08141888 + ldr r1, _08141890 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x1E] + ldr r1, _08141894 + ldr r2, _08141898 + adds r0, r5, 0 + movs r3, 0x3 + bl sub_8141F7C +_08141888: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141890: .4byte 0x03005e00 +_08141894: .4byte sub_8141AC0 + 1 +_08141898: .4byte 0x0000ffff + thumb_func_end sub_8141800 + + thumb_func_start sub_814189C +sub_814189C: @ 814189C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _081418DC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x12 + ldrsh r1, [r0, r2] + cmp r1, 0 + beq _08141928 + cmp r1, 0 + blt _08141928 + cmp r1, 0x2 + bgt _08141928 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0xC + bne _081418EC + ldr r0, _081418E0 + bl fanfare_play + ldr r4, _081418E4 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _081418E8 + b _08141902 + .align 2, 0 +_081418DC: .4byte 0x03005e00 +_081418E0: .4byte 0x00000185 +_081418E4: .4byte 0x0203ab8c +_081418E8: .4byte 0x082a5bd7 +_081418EC: + movs r0, 0xC3 + lsls r0, 1 + bl fanfare_play + ldr r4, _08141920 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08141924 +_08141902: + movs r1, 0x1 + 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 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + b _08141958 + .align 2, 0 +_08141920: .4byte 0x0203ab8c +_08141924: .4byte 0x082a5bcb +_08141928: + movs r0, 0x20 + bl m4aSongNumStart + ldr r4, _08141974 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08141978 + movs r1, 0x1 + 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 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram +_08141958: + ldr r1, _0814197C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xA] + ldr r1, _08141980 + str r1, [r0] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141974: .4byte 0x0203ab8c +_08141978: .4byte 0x082a5be0 +_0814197C: .4byte 0x03005e00 +_08141980: .4byte sub_8141800 + 1 + thumb_func_end sub_814189C + + thumb_func_start sub_8141984 +sub_8141984: @ 8141984 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _081419A8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x16 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _081419AC + cmp r5, 0x3 + beq _081419DC + ldrh r0, [r4, 0x16] + adds r0, 0x1 + b _081419E4 + .align 2, 0 +_081419A8: .4byte 0x03005e00 +_081419AC: + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x15 + bl m4aSongNumStart + ldrh r0, [r4, 0x22] + bl sub_8143514 + movs r2, 0x22 + ldrsh r1, [r4, r2] + ldr r0, _081419CC + cmp r1, r0 + ble _081419D0 + strh r5, [r4, 0xA] + b _081419E6 + .align 2, 0 +_081419CC: .4byte 0x0000270e +_081419D0: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + b _081419E4 +_081419DC: + movs r0, 0x15 + bl m4aSongNumStop + movs r0, 0 +_081419E4: + strh r0, [r4, 0x16] +_081419E6: + ldr r0, _08141A0C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08141A04 + ldr r1, _08141A10 + ldr r2, _08141A14 + adds r0, r6, 0 + movs r3, 0x3 + bl sub_8141F7C +_08141A04: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08141A0C: .4byte 0x03005e00 +_08141A10: .4byte sub_8141AC0 + 1 +_08141A14: .4byte 0x0000ffff + thumb_func_end sub_8141984 + + thumb_func_start sub_8141A18 +sub_8141A18: @ 8141A18 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08141AA4 + ldr r1, _08141AA8 + mov r9, r1 + ldr r1, [r1] + ldrb r2, [r1, 0x19] + ldr r1, _08141AAC + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + adds r1, r2, 0 + muls r1, r0 + adds r0, r3, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r2, _08141AB0 + mov r8, r2 + ldr r1, _08141AB4 + mov r0, r8 + bl ExpandTextCodes + ldr r5, _08141AB8 + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r1, 0x1 + mov r2, r8 + movs r3, 0 + bl Print + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r0, 0x19] + movs r2, 0xC + ldrsh r0, [r4, r2] + muls r0, r1 + strh r0, [r4, 0xA] + strh r6, [r4, 0x16] + ldr r0, _08141ABC + str r0, [r4] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08141AA4: .4byte 0x02021cc4 +_08141AA8: .4byte 0x0203ab88 +_08141AAC: .4byte 0x03005e00 +_08141AB0: .4byte 0x02021fc4 +_08141AB4: .4byte 0x082a5bef +_08141AB8: .4byte 0x0203ab8c +_08141ABC: .4byte sub_8141984 + 1 + thumb_func_end sub_8141A18 + + thumb_func_start sub_8141AC0 +sub_8141AC0: @ 8141AC0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _08141B40 + ldr r0, [r5] + adds r0, 0xB8 + ldr r1, _08141B44 + bl sub_8151A9C + ldr r6, [r5] + movs r0, 0xB8 + lsls r0, 1 + adds r3, r6, r0 + ldrb r2, [r3] + movs r1, 0x7F + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xB2 + lsls r0, 1 + adds r3, r6, r0 + ldrb r2, [r3] + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xAC + lsls r0, 1 + adds r2, r6, r0 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + ldr r6, _08141B48 + ldr r2, [r5] + ldr r5, _08141B4C + ldr r0, _08141B50 + lsls r3, r4, 2 + adds r3, r4 + lsls r3, 3 + adds r3, r0 + movs r0, 0x20 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + adds r2, r0 + adds r2, 0x43 + ldrb r1, [r2] + 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] + ldr r0, _08141B54 + str r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08141B40: .4byte 0x0203ab88 +_08141B44: .4byte 0x0000ffff +_08141B48: .4byte 0x02020630 +_08141B4C: .4byte 0x085b6154 +_08141B50: .4byte 0x03005e00 +_08141B54: .4byte sub_8141B58 + 1 + thumb_func_end sub_8141AC0 + + thumb_func_start sub_8141B58 +sub_8141B58: @ 8141B58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, _08141C38 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r5, [r0, 0x10] + ldr r4, _08141C3C + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + strb r2, [r1] + movs r0, 0 + bl sub_81424FC + ldr r3, _08141C40 + ldr r0, [r4] + adds r0, 0x6C + 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] + adds r7, r3, 0 + movs r0, 0x8 + adds r0, r7 + mov r12, r0 + ldr r1, _08141C44 + mov r8, r1 +_08141BB0: + ldr r0, _08141C3C + ldr r4, [r0] + adds r0, r4, r5 + adds r0, 0x65 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r7 + adds r2, r3, 0 + adds r2, 0x40 + add r0, r12 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, _08141C48 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08141BB0 + ldr r0, _08141C38 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r2, r1, r0 + movs r1, 0x22 + ldrsh r0, [r2, r1] + ldrb r4, [r4, 0x19] + cmp r0, r4 + blt _08141CBC + movs r1, 0x14 + ldrsh r0, [r2, r1] + cmp r0, 0x6 + bne _08141C58 + ldr r4, _08141C4C + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08141C50 + movs r1, 0x1 + 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 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08141C54 + b _08141C8E + .align 2, 0 +_08141C38: .4byte 0x03005e00 +_08141C3C: .4byte 0x0203ab88 +_08141C40: .4byte 0x02020630 +_08141C44: .4byte 0xfffffc00 +_08141C48: .4byte 0x000003ff +_08141C4C: .4byte 0x0203ab8c +_08141C50: .4byte 0x082a5c21 +_08141C54: .4byte dp01t_12_3_battle_menu + 1 +_08141C58: + movs r0, 0x22 + ldrsh r1, [r2, r0] + ldr r0, _08141C9C + cmp r1, r0 + bne _08141CB0 + ldr r4, _08141CA0 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08141CA4 + movs r1, 0x1 + 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 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08141CA8 +_08141C8E: + ldr r2, _08141CAC + adds r0, r6, 0 + movs r3, 0x3 + bl sub_8141F7C + b _08141CF2 + .align 2, 0 +_08141C9C: .4byte 0x0000270f +_08141CA0: .4byte 0x0203ab8c +_08141CA4: .4byte 0x082a5c61 +_08141CA8: .4byte sub_8140914 + 1 +_08141CAC: .4byte 0x0000ffff +_08141CB0: + ldr r0, _08141CB8 + str r0, [r2] + b _08141CF2 + .align 2, 0 +_08141CB8: .4byte sub_8140914 + 1 +_08141CBC: + ldr r4, _08141D00 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08141D04 + movs r1, 0x1 + 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 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08141D08 + adds r0, r6, 0 + movs r2, 0x3C + movs r3, 0x3 + bl sub_8141F7C +_08141CF2: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08141D00: .4byte 0x0203ab8c +_08141D04: .4byte 0x082a5c04 +_08141D08: .4byte sub_8140994 + 1 + thumb_func_end sub_8141B58 + + thumb_func_start dp01t_12_3_battle_menu +dp01t_12_3_battle_menu: @ 8141D0C + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, _08141DB4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x14] + adds r0, r5, 0 + bl sub_8141FF4 + bl sub_8142070 + bl sub_8143A40 + movs r0, 0 + bl sub_81424FC + movs r0, 0x6 + bl sub_814372C + ldr r7, _08141DB8 + ldr r3, _08141DBC + movs r6, 0x5 + negs r6, r6 +_08141D44: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x43 + ldrb 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 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _08141D44 + ldr r1, _08141DB4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + movs r0, 0x22 + ldrsh r1, [r2, r0] + ldr r0, _08141DC0 + cmp r1, r0 + bne _08141DD4 + ldr r4, _08141DC4 + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, _08141DC8 + movs r1, 0x1 + 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 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08141DCC + ldr r2, _08141DD0 + adds r0, r5, 0 + movs r3, 0x3 + bl sub_8141F7C + b _08141DD8 + .align 2, 0 +_08141DB4: .4byte 0x03005e00 +_08141DB8: .4byte 0x02020630 +_08141DBC: .4byte 0x0203ab88 +_08141DC0: .4byte 0x0000270f +_08141DC4: .4byte 0x0203ab8c +_08141DC8: .4byte 0x082a5c61 +_08141DCC: .4byte sub_8140914 + 1 +_08141DD0: .4byte 0x0000ffff +_08141DD4: + ldr r0, _08141DE0 + str r0, [r2] +_08141DD8: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08141DE0: .4byte sub_8140914 + 1 + thumb_func_end dp01t_12_3_battle_menu + + thumb_func_start sub_8141DE4 +sub_8141DE4: @ 8141DE4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08141E28 + ldr r0, [r4] + adds r0, 0xB8 + ldr r1, _08141E2C + bl sub_8151A9C + ldr r0, [r4] + adds r0, 0xB8 + bl sub_8151678 + ldr r1, _08141E30 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x22] + bl sub_8145C58 + bl sub_8145C30 + ldr r1, [r4] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x19] + cmp r0, r1 + bcs _08141E38 + ldr r1, _08141E34 + movs r0, 0x1 + b _08141E3C + .align 2, 0 +_08141E28: .4byte 0x0203ab88 +_08141E2C: .4byte 0x0000ffff +_08141E30: .4byte 0x03005e00 +_08141E34: .4byte 0x020375e0 +_08141E38: + ldr r1, _08141E70 + movs r0, 0 +_08141E3C: + strh r0, [r1] + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDD78 + movs r0, 0 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldr r1, _08141E74 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08141E78 + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141E70: .4byte 0x020375e0 +_08141E74: .4byte 0x03005e00 +_08141E78: .4byte sub_8141E7C + 1 + thumb_func_end sub_8141DE4 + + thumb_func_start sub_8141E7C +sub_8141E7C: @ 8141E7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08141EDE + movs r0, 0 + bl SetVBlankCallback + ldr r1, _08141EE4 + ldr r0, _08141EE8 + strh r4, [r0] + strh r4, [r1] + bl sub_8121DA0 + bl sub_8121E10 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + bl gpu_pal_allocator_reset + bl sub_80A1A74 + bl reset_all_obj_data + bl sub_8140418 + ldr r1, _08141EEC + ldr r0, _08141EF0 + str r0, [r1] + ldr r0, _08141EF4 + bl set_callback2 + adds r0, r5, 0 + bl remove_task +_08141EDE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141EE4: .4byte 0x02021bbc +_08141EE8: .4byte 0x02021bbe +_08141EEC: .4byte 0x03005dac +_08141EF0: .4byte sub_80AF168 + 1 +_08141EF4: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_8141E7C + + thumb_func_start sub_8141EF8 +sub_8141EF8: @ 8141EF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08141F6C + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0xA8 + ldrh r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _08141F1E + ldr r0, _08141F70 + adds r2, r3, 0 + adds r2, 0xAA + ldrh r1, [r0, 0x2E] + ldrh r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _08141F52 +_08141F1E: + ldr r1, _08141F74 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0xAC + ldr r1, [r1] + str r1, [r0] + adds r0, r3, 0 + adds r0, 0xAA + ldrh r0, [r0] + cmp r0, 0 + beq _08141F40 + movs r0, 0x5 + bl audio_play +_08141F40: + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0xAC + movs r1, 0 + str r1, [r0] + subs r0, 0x2 + strh r1, [r0] + subs r0, 0x2 + strh r1, [r0] +_08141F52: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0xA8 + ldrh r2, [r1] + ldr r0, _08141F78 + cmp r2, r0 + beq _08141F64 + subs r0, r2, 0x1 + strh r0, [r1] +_08141F64: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08141F6C: .4byte 0x0203ab88 +_08141F70: .4byte 0x030022c0 +_08141F74: .4byte 0x03005e00 +_08141F78: .4byte 0x0000ffff + thumb_func_end sub_8141EF8 + + thumb_func_start sub_8141F7C +sub_8141F7C: @ 8141F7C + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r7, r3, 16 + ldr r2, _08141FCC + ldr r0, [r2] + mov r12, r0 + mov r3, r12 + adds r3, 0xB4 + ldr r1, _08141FD0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + str r0, [r3] + adds r3, r1, 0 + cmp r5, 0 + bne _08141FAC + adds r5, r0, 0 +_08141FAC: + mov r0, r12 + adds r0, 0xAC + str r5, [r0] + subs r0, 0x4 + strh r4, [r0] + ldr r0, _08141FD4 + cmp r4, r0 + bne _08141FD8 + cmp r7, 0 + bne _08141FD8 + mov r1, r12 + adds r1, 0xAA + ldrh r0, [r1] + orrs r4, r0 + strh r4, [r1] + b _08141FDE + .align 2, 0 +_08141FCC: .4byte 0x0203ab88 +_08141FD0: .4byte 0x03005e00 +_08141FD4: .4byte 0x0000ffff +_08141FD8: + ldr r0, [r2] + adds r0, 0xAA + strh r7, [r0] +_08141FDE: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r3 + ldr r1, _08141FF0 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08141FF0: .4byte sub_8141EF8 + 1 + thumb_func_end sub_8141F7C + + thumb_func_start sub_8141FF4 +sub_8141FF4: @ 8141FF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r3, _08142068 + ldr r0, [r3] + strb r4, [r0] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r6, _0814206C + adds r2, r3, 0 + movs r1, 0 +_08142036: + ldr r0, [r2] + adds r0, 0x1B + adds r0, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _08142036 + ldr r2, [r3] + ldrb r1, [r2, 0x1A] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1A] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0 + strh r1, [r0, 0xA] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08142068: .4byte 0x0203ab88 +_0814206C: .4byte 0x03005e00 + thumb_func_end sub_8141FF4 + + thumb_func_start sub_8142070 +sub_8142070: @ 8142070 + push {lr} + ldr r2, _081420CC + ldr r1, [r2] + movs r0, 0 + str r0, [r1, 0x8] + movs r1, 0 + movs r3, 0 +_0814207E: + ldr r0, [r2] + adds r0, 0xC + adds r0, r1 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x5 + bls _0814207E + movs r1, 0 + ldr r3, _081420CC + movs r2, 0 +_08142096: + ldr r0, [r3] + adds r0, 0x12 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _08142096 + movs r1, 0 + ldr r3, _081420CC + movs r2, 0 +_081420AE: + ldr r0, [r3] + adds r0, 0x16 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _081420AE + movs r0, 0x1 + movs r1, 0xFF + bl sub_8143038 + pop {r0} + bx r0 + .align 2, 0 +_081420CC: .4byte 0x0203ab88 + thumb_func_end sub_8142070 + + thumb_func_start sub_81420D0 +sub_81420D0: @ 81420D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + mov r1, sp + ldr r0, _08142104 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + add r2, sp, 0x10 + adds r1, r2, 0 + ldr r0, _08142108 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + mov r8, r2 + cmp r5, 0xB + bls _0814210C + movs r0, 0 + b _081421C8 + .align 2, 0 +_08142104: .4byte 0x085b642c +_08142108: .4byte 0x085b643c +_0814210C: + ldr r6, _081421D8 + ldr r3, [r6] + ldr r1, _081421DC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r7, 0x14 + ldrsh r1, [r0, r7] + adds r3, r1 + ldr r4, _081421E0 + lsls r5, 3 + adds r2, r5, r4 + ldrb r1, [r2, 0x2] + strb r1, [r3, 0xB] + ldrb r1, [r2, 0x2] + strh r1, [r0, 0x20] + ldr r2, [r6] + adds r0, r4, 0x4 + adds r0, r5, r0 + ldr r1, [r2, 0x8] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2, 0x8] + movs r3, 0 + mov r9, r4 + mov r12, r5 + adds r5, r0, 0 +_08142144: + lsls r0, r3, 2 + mov r1, sp + adds r4, r1, r0 + ldr r0, [r4] + ands r0, r5 + cmp r0, 0 + beq _0814215E + ldr r1, [r6] + adds r1, 0x12 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0814215E: + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x12 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x2 + bls _08142174 + ldr r0, [r2, 0x8] + ldr r1, [r4] + orrs r0, r1 + str r0, [r2, 0x8] +_08142174: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _08142144 + movs r6, 0 + ldr r0, _081421E4 + add r0, r12 + ldr r7, [r0] + ldr r4, _081421D8 + mov r5, r8 +_0814218A: + lsls r0, r6, 2 + adds r2, r5, r0 + ldr r0, [r2] + ands r0, r7 + cmp r0, 0 + beq _081421A2 + ldr r1, [r4] + adds r1, 0x16 + adds r1, r6 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081421A2: + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0x16 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bls _081421B8 + ldr r0, [r3, 0x8] + ldr r1, [r2] + orrs r0, r1 + str r0, [r3, 0x8] +_081421B8: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0814218A + mov r0, r12 + add r0, r9 + ldrb r0, [r0, 0x2] +_081421C8: + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081421D8: .4byte 0x0203ab88 +_081421DC: .4byte 0x03005e00 +_081421E0: .4byte 0x085b62e4 +_081421E4: .4byte 0x085b62e8 + thumb_func_end sub_81420D0 + + thumb_func_start sub_81421E8 +sub_81421E8: @ 81421E8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + lsrs r3, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x12 + bhi _0814227C + cmp r2, 0xF + bhi _08142278 + lsls r0, r2, 2 + ldr r1, _0814220C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814220C: .4byte _08142210 + .align 2, 0 +_08142210: + .4byte _08142250 + .4byte _08142254 + .4byte _08142254 + .4byte _08142254 + .4byte _08142254 + .4byte _08142268 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142268 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142268 +_08142250: + movs r0, 0x3 + b _0814227E +_08142254: + adds r0, r2, 0x5 + cmp r3, r0 + beq _08142274 + adds r0, 0x5 + cmp r3, r0 + beq _08142274 + adds r0, 0x5 + cmp r3, r0 + bne _0814227C + b _08142274 +_08142268: + adds r0, r2, 0x1 + cmp r3, r0 + blt _0814227C + adds r0, r2, 0x4 + cmp r3, r0 + bgt _0814227C +_08142274: + movs r0, 0x1 + b _0814227E +_08142278: + cmp r3, r2 + beq _08142274 +_0814227C: + movs r0, 0 +_0814227E: + pop {r1} + bx r1 + thumb_func_end sub_81421E8 + + thumb_func_start sub_8142284 +sub_8142284: @ 8142284 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + str r0, [sp, 0x18] + cmp r7, 0xA + beq _081422AA + cmp r7, 0xA + bgt _081422A6 + cmp r7, 0x5 + beq _081422AA + b _0814230C +_081422A6: + cmp r7, 0xF + bne _0814230C +_081422AA: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r2, r7, 0x5 + ldr r1, _08142300 + mov r12, r1 + cmp r4, r2 + bge _081422E8 + ldr r0, [r1] + ldr r3, _08142304 + ldr r5, [r0, 0x8] + adds r6, r3, 0 + adds r6, 0x8 +_081422C4: + lsls r0, r4, 2 + adds r0, r4 + lsls r1, r0, 2 + adds r0, r1, r6 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + bne _081422DE + adds r0, r1, r3 + ldrh r0, [r0, 0x10] + ldr r1, [sp, 0x18] + orrs r1, r0 + str r1, [sp, 0x18] +_081422DE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r2 + blt _081422C4 +_081422E8: + mov r2, r12 + ldr r0, [r2] + adds r0, 0xB8 + ldr r1, _08142308 + ldr r3, [sp, 0x18] + ands r3, r1 + str r3, [sp, 0x18] + adds r1, r3, 0 + bl sub_8151A48 + b _081424E2 + .align 2, 0 +_08142300: .4byte 0x0203ab88 +_08142304: .4byte 0x085b6154 +_08142308: .4byte 0x0000dfff +_0814230C: + mov r0, sp + ldr r1, _0814235C + ldm r1!, {r2,r4,r5} + stm r0!, {r2,r4,r5} + ldm r1!, {r3-r5} + stm r0!, {r3-r5} + subs r0, r7, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + mov r9, r1 + cmp r0, 0x3 + bhi _0814232A + movs r2, 0x3 + mov r9, r2 +_0814232A: + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 8 + ldr r3, _08142360 + adds r0, r3 + lsrs r0, 16 + mov r8, r0 + adds r0, r7, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08142390 + cmp r0, 0x2 + bgt _08142368 + cmp r0, 0x1 + beq _0814237C + ldr r4, _08142364 + mov r12, r4 + b _081423D4 + .align 2, 0 +_0814235C: .4byte 0x085b63f0 +_08142360: .4byte 0xffff0000 +_08142364: .4byte 0x0203ab88 +_08142368: + cmp r0, 0x3 + beq _081423A4 + cmp r0, 0x4 + beq _081423B8 + ldr r5, _08142378 + mov r12, r5 + b _081423D4 + .align 2, 0 +_08142378: .4byte 0x0203ab88 +_0814237C: + ldr r3, _08142388 + ldr r2, _0814238C + ldr r0, [r2] + adds r0, 0x43 + b _081423C0 + .align 2, 0 +_08142388: .4byte 0x02020630 +_0814238C: .4byte 0x0203ab88 +_08142390: + ldr r3, _0814239C + ldr r2, _081423A0 + ldr r0, [r2] + adds r0, 0x44 + b _081423C0 + .align 2, 0 +_0814239C: .4byte 0x02020630 +_081423A0: .4byte 0x0203ab88 +_081423A4: + ldr r3, _081423B0 + ldr r2, _081423B4 + ldr r0, [r2] + adds r0, 0x45 + b _081423C0 + .align 2, 0 +_081423B0: .4byte 0x02020630 +_081423B4: .4byte 0x0203ab88 +_081423B8: + ldr r3, _08142424 + ldr r2, _08142428 + ldr r0, [r2] + adds r0, 0x46 +_081423C0: + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + mov r8, r0 + mov r12, r2 +_081423D4: + mov r0, r9 + cmp r0, 0x1 + bne _08142430 + mov r1, r12 + ldr r4, [r1] + ldr r1, _0814242C + lsls r2, r7, 2 + adds r0, r2, r7 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r1, [r4, 0x8] + ldr r0, [r0] + ands r1, r0 + str r2, [sp, 0x1C] + cmp r1, 0 + bne _081424E2 + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r1, r0, 0x1 + lsls r1, 3 + mov r3, sp + adds r2, r3, r1 + ldrh r1, [r2, 0x2] + add r1, r8 + strh r1, [r2, 0x2] + adds r1, r4, 0 + adds r1, 0xB8 + lsls r0, 3 + subs r0, 0x8 + adds r2, r3, r0 + adds r0, r1, 0 + movs r1, 0xD + bl sub_815168C + b _081424C4 + .align 2, 0 +_08142424: .4byte 0x02020630 +_08142428: .4byte 0x0203ab88 +_0814242C: .4byte 0x085b6154 +_08142430: + movs r4, 0 + lsls r5, r7, 2 + str r5, [sp, 0x1C] + ldr r0, _081424F4 + mov r10, r0 +_0814243A: + lsls r0, r4, 2 + adds r0, r4 + adds r0, r7, r0 + adds r0, 0x5 + lsls r0, 24 + lsrs r3, r0, 24 + mov r1, r12 + ldr r5, [r1] + lsls r0, r3, 2 + adds r0, r3 + lsls r6, r0, 2 + mov r0, r10 + adds r0, 0x8 + adds r0, r6, r0 + ldr r1, [r5, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081424B0 + adds r0, r3, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r1, r0, 0x1 + lsls r1, 3 + mov r3, sp + adds r2, r3, r1 + ldrh r1, [r2, 0x2] + add r1, r8 + strh r1, [r2, 0x2] + adds r3, r5, 0 + adds r3, 0xB8 + adds r1, r4, 0 + adds r1, 0xD + lsls r1, 24 + lsrs r1, 24 + lsls r0, 3 + subs r0, 0x8 + mov r5, sp + adds r2, r5, r0 + adds r0, r3, 0 + bl sub_815168C + mov r0, r9 + cmp r0, 0x3 + bne _081424A2 + mov r1, r10 + adds r0, r6, r1 + ldrh r0, [r0, 0x10] + str r0, [sp, 0x18] +_081424A2: + mov r0, r9 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r2, _081424F8 + mov r12, r2 +_081424B0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0814243A + mov r3, r9 + cmp r3, 0x2 + beq _081424C4 + movs r4, 0 + str r4, [sp, 0x18] +_081424C4: + ldr r0, _081424F8 + ldr r0, [r0] + adds r0, 0xB8 + ldr r2, _081424F4 + ldr r5, [sp, 0x1C] + adds r1, r5, r7 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x10] + ldr r2, [sp, 0x18] + orrs r2, r1 + str r2, [sp, 0x18] + adds r1, r2, 0 + bl sub_8151A48 +_081424E2: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081424F4: .4byte 0x085b6154 +_081424F8: .4byte 0x0203ab88 + thumb_func_end sub_8142284 + + thumb_func_start sub_81424FC +sub_81424FC: @ 81424FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08142548 + ldr r1, [r4] + movs r0, 0x1 + strh r0, [r1, 0x2A] + movs r0, 0 + movs r1, 0 + bl sub_8142E70 + ldr r1, [r4] + ldr r2, _0814254C + adds r0, r1, r2 + ldr r2, _08142550 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x10 + str r2, [sp] + movs r2, 0xD + str r2, [sp, 0x4] + movs r2, 0xE + movs r3, 0x7 + bl sub_8152058 + cmp r5, 0xF + bhi _081425FC + lsls r0, r5, 2 + ldr r1, _08142554 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08142548: .4byte 0x0203ab88 +_0814254C: .4byte 0x0000117c +_08142550: .4byte 0x0000397c +_08142554: .4byte _08142558 + .align 2, 0 +_08142558: + .4byte _08142738 + .4byte _08142598 + .4byte _08142598 + .4byte _08142598 + .4byte _08142598 + .4byte _081425CC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425CC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425CC +_08142598: + movs r0, 0x4 + str r0, [sp, 0x18] + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0x3 + bhi _08142604 + add r4, sp, 0x10 + adds r3, r1, 0 +_081425AE: + ldrb r2, [r3] + adds r2, r4 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5, r0 + strb r0, [r2] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldrb r0, [r3] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcc _081425AE + b _08142604 +_081425CC: + movs r2, 0x5 + str r2, [sp, 0x18] + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _08142604 + add r3, sp, 0x10 + adds r2, r1, 0 +_081425E2: + ldrb r1, [r2] + adds r1, r3 + ldrb r0, [r2] + adds r0, r5, r0 + strb r0, [r1] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r0, [r2] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcc _081425E2 + b _08142604 +_081425FC: + movs r2, 0x1 + str r2, [sp, 0x18] + add r0, sp, 0x10 + strb r5, [r0] +_08142604: + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + adds r0, r1, 0 + ldrb r0, [r0] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcc _08142616 + b _08142738 +_08142616: + mov r2, sp + adds r2, 0xE + str r2, [sp, 0x1C] + add r0, sp, 0x10 + mov r10, r0 + add r1, sp, 0x8 + mov r9, r1 + subs r2, 0x4 + str r2, [sp, 0x20] +_08142628: + mov r1, r9 + ldrb r0, [r1] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r2, _08142748 + adds r0, r2 + ldrb r0, [r0, 0x6] + ldr r1, [sp, 0x1C] + strb r0, [r1] + mov r2, r9 + ldrb r0, [r2] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, _08142748 + adds r0, r1 + ldrb r0, [r0, 0x3] + ldr r2, [sp, 0x20] + strh r0, [r2] + mov r7, sp + adds r7, 0x9 + movs r0, 0 + strb r0, [r7] + ldrb r0, [r7] + cmp r0, 0x2 + bhi _08142726 + add r6, sp, 0xC + mov r8, r2 + ldr r0, [sp, 0x1C] + mov r12, r0 + ldr r1, _0814274C + str r1, [sp, 0x28] +_08142672: + mov r2, r9 + ldrb r0, [r2] + add r0, r10 + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _08142748 + adds r1, r0 + str r7, [sp, 0x24] + ldrb r0, [r7] + ldrb r1, [r1, 0x4] + adds r0, r1 + lsls r0, 5 + strh r0, [r6] + ldr r1, [sp, 0x28] + ldr r4, [r1] + mov r2, r8 + ldrh r0, [r2] + ldrh r2, [r6] + adds r2, r0 + lsls r2, 1 + ldr r0, _08142750 + adds r5, r4, r0 + adds r2, r5, r2 + mov r1, r12 + ldrb r0, [r1] + ldrb r1, [r7] + adds r1, r0 + ldr r0, _08142754 + adds r4, r0 + ldr r3, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, r3 + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + mov r2, r8 + ldrh r0, [r2] + ldrh r2, [r6] + adds r2, r0 + adds r2, 0x1 + lsls r2, 1 + adds r2, r5, r2 + mov r1, r12 + ldrb r0, [r1] + ldrb r1, [r7] + adds r1, r0 + ldr r3, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, r3 + movs r1, 0xD1 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + mov r2, r8 + ldrh r1, [r2] + ldrh r0, [r6] + adds r0, r1 + adds r0, 0x2 + lsls r0, 1 + adds r5, r0 + mov r1, r12 + ldrb r0, [r1] + ldrb r1, [r7] + adds r1, r0 + ldr r2, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, r2 + movs r2, 0xD2 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r5] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + ldr r1, [sp, 0x24] + ldrb r0, [r1] + cmp r0, 0x2 + bls _08142672 +_08142726: + mov r2, r9 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r0, [r2] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcs _08142738 + b _08142628 +_08142738: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08142748: .4byte 0x085b6154 +_0814274C: .4byte 0x0203ab88 +_08142750: .4byte 0x0000117c +_08142754: .4byte 0x0000397c + thumb_func_end sub_81424FC + + thumb_func_start sub_8142758 +sub_8142758: @ 8142758 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08142790 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x13 + bls _08142770 + movs r4, 0 +_08142770: + ldr r3, _08142794 + lsls r0, r4, 2 + adds r0, r4 + lsls r2, r0, 2 + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsls r0, 28 + lsrs r0, 28 + cmp r0, 0x4 + beq _081427C4 + cmp r0, 0x4 + bgt _08142798 + cmp r0, 0x3 + beq _0814279E + b _08142808 + .align 2, 0 +_08142790: .4byte 0x085b6448 +_08142794: .4byte 0x085b6154 +_08142798: + cmp r0, 0xC + beq _081427E8 + b _08142808 +_0814279E: + adds r0, r4, 0 + movs r1, 0x5 + bl __udivsi3 + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081427C0 + ldr r0, [r0] + adds r0, 0x16 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x3 + bhi _08142808 + ldrb r0, [r1] + adds r0, 0x1 + b _081427DC + .align 2, 0 +_081427C0: .4byte 0x0203ab88 +_081427C4: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081427E4 + ldr r0, [r0] + adds r0, 0x12 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _08142808 + ldrb r0, [r1] + adds r0, 0x2 +_081427DC: + add r0, sp + ldrb r0, [r0] + b _0814280A + .align 2, 0 +_081427E4: .4byte 0x0203ab88 +_081427E8: + ldr r0, _08142804 + ldr r1, [r0] + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08142808 + mov r0, sp + ldrb r0, [r0, 0x4] + b _0814280A + .align 2, 0 +_08142804: .4byte 0x0203ab88 +_08142808: + movs r0, 0 +_0814280A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8142758 + + thumb_func_start sub_8142814 +sub_8142814: @ 8142814 + push {r4-r6,lr} + ldr r4, _081428B4 + ldr r0, [r4] + ldrh r1, [r0, 0x2C] + movs r0, 0x20 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x2E] + movs r0, 0x22 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x30] + movs r0, 0x24 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x32] + movs r0, 0x26 + bl lcd_io_set + ldr r3, [r4] + movs r0, 0x2E + ldrsh r1, [r3, r0] + ldr r0, _081428B8 + movs r4, 0 + ldrsh r2, [r0, r4] + adds r2, 0x50 + adds r0, r1, 0 + muls r0, r2 + movs r4, 0xE8 + lsls r4, 7 + subs r4, r0 + movs r6, 0x2C + ldrsh r5, [r3, r6] + ldr r0, _081428BC + movs r6, 0 + ldrsh r1, [r0, r6] + adds r1, 0x74 + adds r0, r5, 0 + muls r0, r1 + subs r4, r0 + movs r5, 0x32 + ldrsh r0, [r3, r5] + muls r0, r2 + movs r5, 0xA8 + lsls r5, 7 + subs r5, r0 + movs r6, 0x30 + ldrsh r0, [r3, r6] + muls r0, r1 + subs r5, r0 + lsls r1, r4, 16 + lsrs r1, 16 + movs r0, 0x28 + bl lcd_io_set + ldr r6, _081428C0 + ands r4, r6 + lsrs r4, 16 + movs r0, 0x2A + adds r1, r4, 0 + bl lcd_io_set + lsls r1, r5, 16 + lsrs r1, 16 + movs r0, 0x2C + bl lcd_io_set + ands r5, r6 + lsrs r5, 16 + movs r0, 0x2E + adds r1, r5, 0 + bl lcd_io_set + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081428B4: .4byte 0x0203ab88 +_081428B8: .4byte 0x02021bbe +_081428BC: .4byte 0x02021bbc +_081428C0: .4byte 0x0fff0000 + thumb_func_end sub_8142814 + + thumb_func_start sub_81428C4 +sub_81428C4: @ 81428C4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _081428E0 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081428E0: .4byte 0x085b6408 + thumb_func_end sub_81428C4 + + thumb_func_start sub_81428E4 +sub_81428E4: @ 81428E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08142910 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08142908 + movs r0, 0 + bl SetVBlankCallback + ldr r0, _08142914 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08142908: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08142910: .4byte 0x02037fd4 +_08142914: .4byte sub_81405CC + 1 + thumb_func_end sub_81428E4 + + thumb_func_start sub_8142918 +sub_8142918: @ 8142918 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + bl sub_8145C14 + bl Window_FreeMemory + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r2, _08142970 + ldrb r1, [r2, 0x8] + lsls r1, 26 + lsrs r1, 26 + ldrb r3, [r2, 0x4] + movs r0, 0x40 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x4] + bl fade_and_return_progress_probably + ldr r1, _08142974 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08142978 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08142970: .4byte 0x02037fd4 +_08142974: .4byte 0x03005e00 +_08142978: .4byte sub_81428E4 + 1 + thumb_func_end sub_8142918 + + thumb_func_start sub_814297C +sub_814297C: @ 814297C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_819746C + bl sub_8145C14 + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_814297C + + thumb_func_start sub_81429A0 +sub_81429A0: @ 81429A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _081429E4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r0, _081429E8 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081429DE + ldr r1, _081429EC + movs r0, 0x1 + strh r0, [r1] + bl sub_8145C14 + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + bl script_env_2_disable + adds r0, r4, 0 + bl remove_task +_081429DE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081429E4: .4byte 0x03005e00 +_081429E8: .4byte 0x030022c0 +_081429EC: .4byte 0x020375e0 + thumb_func_end sub_81429A0 + + thumb_func_start sub_81429F0 +sub_81429F0: @ 81429F0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08142A68 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08142A60 + ldr r2, _08142A6C + ldr r0, _08142A70 + ldrh r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + lsrs r1, 7 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + ldrb r1, [r0] + ldr r0, _08142A74 + movs r2, 0x2 + movs r3, 0x1 + bl decimal_int_to_string + ldr r4, _08142A78 + ldr r1, _08142A7C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + movs r1, 0 + bl sub_81973FC + str r5, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08142A80 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _08142A84 + str r1, [r0] +_08142A60: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08142A68: .4byte 0x030022c0 +_08142A6C: .4byte 0x085b6344 +_08142A70: .4byte 0x020375e0 +_08142A74: .4byte 0x02021cc4 +_08142A78: .4byte 0x02021fc4 +_08142A7C: .4byte 0x082a5b12 +_08142A80: .4byte 0x03005e00 +_08142A84: .4byte sub_81428C4 + 1 + thumb_func_end sub_81429F0 + + thumb_func_start sub_8142A88 +sub_8142A88: @ 8142A88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08142B10 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x22 + ldrsh r0, [r6, r1] + bl sub_8145B54 + ldr r2, _08142B14 + ldr r0, _08142B18 + mov r8, r0 + ldrh r1, [r0] + movs r7, 0x1 + adds r0, r7, 0 + ands r0, r1 + lsrs r1, 7 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + ldrb r4, [r0] + ldr r0, _08142B1C + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x1 + bl decimal_int_to_string + movs r1, 0x22 + ldrsh r0, [r6, r1] + cmp r0, r4 + blt _08142B78 + mov r0, r8 + ldrh r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08142B28 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08142B28 + movs r0, 0 + movs r1, 0 + bl sub_81973FC + ldr r2, _08142B20 + str r7, [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, 0x3 + bl Window_CopyToVram + ldr r0, _08142B24 + str r0, [r6] + b _08142BB0 + .align 2, 0 +_08142B10: .4byte 0x03005e00 +_08142B14: .4byte 0x085b6344 +_08142B18: .4byte 0x020375e0 +_08142B1C: .4byte 0x02021cc4 +_08142B20: .4byte 0x082a5b6b +_08142B24: .4byte sub_81429F0 + 1 +_08142B28: + ldr r4, _08142B68 + ldr r1, _08142B6C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + movs r1, 0 + bl sub_81973FC + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08142B70 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08142B74 + str r1, [r0] + b _08142BB0 + .align 2, 0 +_08142B68: .4byte 0x02021fc4 +_08142B6C: .4byte 0x082a5b12 +_08142B70: .4byte 0x03005e00 +_08142B74: .4byte sub_81428C4 + 1 +_08142B78: + ldr r5, _08142BBC + ldr r1, _08142BC0 + adds r0, r5, 0 + bl ExpandTextCodes + movs r0, 0 + movs r1, 0 + bl sub_81973FC + str r7, [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, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08142BC4 + str r0, [r6] + strh r4, [r6, 0x22] + strh r4, [r6, 0x8] +_08142BB0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08142BBC: .4byte 0x02021fc4 +_08142BC0: .4byte 0x082a5b4e +_08142BC4: .4byte sub_81429A0 + 1 + thumb_func_end sub_8142A88 + + thumb_func_start sub_8142BC8 +sub_8142BC8: @ 8142BC8 + push {r4,lr} + bl script_env_2_enable + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8145BAC + ldr r0, _08142C04 + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8145C30 + ldr r2, _08142C08 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x22] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08142C04: .4byte sub_8142A88 + 1 +_08142C08: .4byte 0x03005e00 + thumb_func_end sub_8142BC8 + + thumb_func_start sub_8142C0C +sub_8142C0C: @ 8142C0C + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _08142C44 + bl gpu_pal_allocator_reset + ldr r0, _08142C34 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _08142C38 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08142C3C + bl gpu_tile_obj_decompress_and_load + ldr r0, _08142C40 + bl gpu_tile_obj_decompress_and_load + b _08142C5A + .align 2, 0 +_08142C34: .4byte 0x085b7384 +_08142C38: .4byte 0x085b7864 +_08142C3C: .4byte 0x085b7978 +_08142C40: .4byte 0x085b7a40 +_08142C44: + movs r0, 0xE + bl gpu_tile_obj_free_by_tag + movs r0, 0xD + bl gpu_tile_obj_free_by_tag + movs r0, 0xC + bl gpu_tile_obj_free_by_tag + bl gpu_pal_allocator_reset +_08142C5A: + pop {r0} + bx r0 + thumb_func_end sub_8142C0C + + thumb_func_start sub_8142C60 +sub_8142C60: @ 8142C60 + push {r4-r6,lr} + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, [r0, 0x4] + ldrb r3, [r1] + movs r1, 0x74 + movs r2, 0x50 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, _08142CC4 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r6] + strh r0, [r1, 0x2E] + strh r4, [r1, 0x30] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r1] + ldrh r2, [r6] + adds r0, r2, 0 + adds r0, 0x1E + strh r0, [r6] + lsls r0, 16 + ldr r1, _08142CC8 + cmp r0, r1 + bls _08142CBC + ldr r1, _08142CCC + adds r0, r2, r1 + strh r0, [r6] +_08142CBC: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08142CC4: .4byte 0x02020630 +_08142CC8: .4byte 0x01670000 +_08142CCC: .4byte 0xfffffeb6 + thumb_func_end sub_8142C60 + + thumb_func_start sub_8142CD0 +sub_8142CD0: @ 8142CD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, _08142E1C + ldr r0, [r4] + ldr r5, _08142E20 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + mov r6, sp + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r4, _08142E24 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x4] + ldrh r0, [r4, 0x6] + strh r0, [r6, 0x6] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r6, 0 + ldr r0, _08142E28 + mov r8, r0 +_08142D18: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 27 + lsrs r4, r0, 24 + movs r5, 0 + lsls r7, r6, 2 +_08142D24: + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + ldr r0, _08142E2C + adds r0, r1, r0 + adds r1, 0x94 + adds r2, r4, 0 + adds r2, 0x5C + movs r3, 0x1E + bl obj_add_from_template_forward_search + ldr r1, _08142E30 + ldr r1, [r1] + adds r2, r5, 0 + adds r2, 0x1D + adds r2, r7, r2 + adds r1, 0x3C + adds r1, r2 + strb r0, [r1] + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + adds r0, 0x18 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x47 + bls _08142D6E + movs r4, 0 +_08142D6E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08142D24 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _08142D18 + movs r6, 0 + ldr r4, _08142E28 +_08142D86: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + ldr r0, _08142E34 + adds r0, r1, r0 + adds r1, 0x94 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x46 + movs r3, 0x1E + bl obj_add_from_template_forward_search + ldr r1, _08142E30 + ldr r1, [r1] + adds r1, r6 + adds r1, 0x65 + strb r0, [r1] + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _08142D86 + movs r6, 0 + ldr r4, _08142E28 +_08142DCC: + lsls r2, r6, 1 + adds r2, r6 + lsls r2, 3 + ldr r0, _08142E38 + adds r0, r2, r0 + adds r2, 0x5C + lsls r2, 16 + asrs r2, 16 + movs r1, 0x7E + movs r3, 0x1E + bl obj_add_from_template_forward_search + ldr r1, _08142E30 + ldr r1, [r1] + adds r1, r6 + adds r1, 0x69 + strb r0, [r1] + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _08142DCC + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08142E1C: .4byte 0x085b7488 +_08142E20: .4byte 0x0201c000 +_08142E24: .4byte 0x085b7490 +_08142E28: .4byte 0x02020630 +_08142E2C: .4byte 0x085b75b0 +_08142E30: .4byte 0x0203ab88 +_08142E34: .4byte 0x085b7508 +_08142E38: .4byte 0x085b7568 + thumb_func_end sub_8142CD0 + + thumb_func_start sub_8142E3C +sub_8142E3C: @ 8142E3C + push {r4,lr} + movs r4, 0 +_08142E40: + ldr r0, _08142E68 + ldr r0, [r0] + adds r0, r4 + adds r0, 0x59 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08142E6C + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _08142E40 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08142E68: .4byte 0x0203ab88 +_08142E6C: .4byte 0x02020630 + thumb_func_end sub_8142E3C + + thumb_func_start sub_8142E70 +sub_8142E70: @ 8142E70 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + cmp r0, 0 + beq _08142EC0 + cmp r0, 0x1 + bne _08142F66 + movs r4, 0 + ldr r5, _08142EB8 + ldr r3, _08142EBC + movs r2, 0x4 +_08142E92: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x59 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x12 + bls _08142E92 + b _08142F66 + .align 2, 0 +_08142EB8: .4byte 0x02020630 +_08142EBC: .4byte 0x0203ab88 +_08142EC0: + movs r4, 0 + ldr r0, _08142F08 + mov r9, r0 + ldr r7, _08142F0C + adds r1, r7, 0x4 + mov r8, r1 + ldr r5, _08142F10 + movs r6, 0x5 + negs r6, r6 +_08142ED2: + mov r0, r9 + ldr r2, [r0] + lsls r3, r4, 3 + mov r1, r8 + adds r0, r3, r1 + ldr r1, [r2, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08142F14 + adds r0, r3, r7 + ldrb r0, [r0, 0x2] + cmp r0, r12 + beq _08142F14 + adds r0, r2, r4 + adds r0, 0x59 + ldrb r1, [r0] + 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] + b _08142F2C + .align 2, 0 +_08142F08: .4byte 0x0203ab88 +_08142F0C: .4byte 0x085b62e4 +_08142F10: .4byte 0x02020630 +_08142F14: + adds r0, r2, r4 + adds r0, 0x59 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] +_08142F2C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _08142ED2 + cmp r4, 0x12 + bhi _08142F66 + ldr r6, _08142F74 + ldr r3, _08142F78 + movs r5, 0x5 + negs r5, r5 +_08142F42: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x59 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x12 + bls _08142F42 +_08142F66: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08142F74: .4byte 0x02020630 +_08142F78: .4byte 0x0203ab88 + thumb_func_end sub_8142E70 + + thumb_func_start sub_8142F7C +sub_8142F7C: @ 8142F7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r6, _08143028 + ldr r4, _0814302C + movs r0, 0x4 + mov r8, r0 +_08142F8C: + ldr r0, _08143030 + movs r1, 0x74 + movs r2, 0x14 + movs r3, 0xA + bl obj_add_from_template_forward_search + ldr r1, [r6] + adds r3, r5, 0 + adds r3, 0x31 + adds r1, 0x3C + adds r1, r3 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r8 + orrs r1, r2 + strb r1, [r0] + ldr r2, [r6] + adds r2, 0x3C + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x2E] + 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, _08143034 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + movs r7, 0xD + negs r7, r7 + adds r2, r7, 0 + ands r1, r2 + mov r2, r8 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, [r6] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x8 + bl obj_anim_image_start + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08142F8C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143028: .4byte 0x0203ab88 +_0814302C: .4byte 0x02020630 +_08143030: .4byte 0x085b7928 +_08143034: .4byte sub_814390C + 1 + thumb_func_end sub_8142F7C + + thumb_func_start sub_8143038 +sub_8143038: @ 8143038 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r6, 0 + cmp r0, 0 + beq _08143084 + ldr r4, _0814307C + ldr r3, _08143080 + movs r2, 0x4 +_08143056: + ldr r0, [r3] + adds r0, r6 + adds r0, 0x6D + 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] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _08143056 + b _08143142 + .align 2, 0 +_0814307C: .4byte 0x02020630 +_08143080: .4byte 0x0203ab88 +_08143084: + ldr r0, _081430C4 + mov r8, r0 + ldr r7, _081430C8 + ldr r0, _081430CC + mov r12, r0 + movs r0, 0x5 + negs r0, r0 + mov r10, r0 +_08143094: + mov r0, r8 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xC + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _081430A8 + cmp r6, r9 + bne _081430D0 +_081430A8: + adds r0, r1, r6 + adds r0, 0x6D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _08143138 + .align 2, 0 +_081430C4: .4byte 0x0203ab88 +_081430C8: .4byte 0x02020630 +_081430CC: .4byte 0x085b6154 +_081430D0: + adds r5, r6, 0 + adds r5, 0x31 + adds r0, r1, 0 + adds r0, 0x3C + adds r0, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r10 + ands r0, r2 + strb r0, [r1] + mov r0, r8 + ldr r3, [r0] + adds r4, r3, 0 + adds r4, 0x3C + adds r4, r5 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r7 + adds r3, 0xC + adds r3, r6 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0x3] + adds r0, 0x1 + lsls r0, 3 + adds r0, 0x4 + strh r0, [r2, 0x20] + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r7 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0x4] + adds r0, 0x1 + lsls r0, 3 + adds r0, 0x3 + strh r0, [r2, 0x22] +_08143138: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _08143094 +_08143142: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8143038 + + thumb_func_start sub_8143150 +sub_8143150: @ 8143150 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08143180 + ldr r2, _08143178 + ldr r0, _0814317C + ldr r0, [r0] + adds r0, 0x6C + 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] + b _081431D0 + .align 2, 0 +_08143178: .4byte 0x02020630 +_0814317C: .4byte 0x0203ab88 +_08143180: + ldr r4, _081431D8 + ldr r3, _081431DC + ldr r0, [r3] + adds r0, 0x6C + ldrb r1, [r0] + 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 r3, [r3] + adds r3, 0x6C + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, _081431E0 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrb r0, [r2, 0x3] + adds r0, 0x2 + lsls r0, 3 + strh r0, [r1, 0x20] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2, 0x4] + adds r0, 0x2 + lsls r0, 3 + strh r0, [r1, 0x22] +_081431D0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081431D8: .4byte 0x02020630 +_081431DC: .4byte 0x0203ab88 +_081431E0: .4byte 0x085b6154 + thumb_func_end sub_8143150 + + thumb_func_start sub_81431E4 +sub_81431E4: @ 81431E4 + push {r4-r7,lr} + sub sp, 0xC + ldr r4, _0814326C + ldr r0, [r4] + ldr r5, _08143270 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp, 0x4] + add r0, sp, 0x4 + ldrh r2, [r4, 0x6] + lsls r2, 16 + ldrh r1, [r4, 0x4] + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + movs r1, 0xF + mov r0, sp + strh r1, [r0] + movs r0, 0 + ldr r7, _08143274 +_08143210: + movs r4, 0 + adds r6, r0, 0x1 + lsls r5, r0, 2 +_08143216: + adds r1, r5, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, _08143278 + adds r0, r1 + movs r1, 0x28 + mov r2, sp + bl sub_8142C60 + ldr r1, _0814327C + ldr r1, [r1] + adds r2, r4, 0x7 + adds r2, r5, r2 + adds r1, 0x3C + adds r1, r2 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08143216 + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _08143210 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814326C: .4byte 0x085b741c +_08143270: .4byte 0x0201c000 +_08143274: .4byte 0x02020630 +_08143278: .4byte 0x085b7610 +_0814327C: .4byte 0x0203ab88 + thumb_func_end sub_81431E4 + + thumb_func_start sub_8143280 +sub_8143280: @ 8143280 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, _08143304 + ldr r1, [r0] + ldrh r0, [r6, 0x2E] + ldrh r1, [r1, 0x24] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r1, r0, 16 + ldr r0, _08143308 + cmp r1, r0 + ble _081432A2 + ldr r2, _0814330C + adds r0, r1, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_081432A2: + adds r0, r4, 0 + bl sine2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl cosine2 + lsls r2, r5, 16 + asrs r2, 16 + movs r3, 0x30 + ldrsh r1, [r6, r3] + muls r1, r2 + asrs r1, 12 + strh r1, [r6, 0x24] + lsls r0, 16 + asrs r4, r0, 16 + negs r1, r4 + movs r3, 0x30 + ldrsh r0, [r6, r3] + muls r0, r1 + asrs r0, 12 + strh r0, [r6, 0x26] + ldrb r0, [r6, 0x3] + lsls r0, 26 + lsrs r3, r0, 27 + cmp r2, 0 + bge _081432DC + adds r2, 0xF +_081432DC: + lsls r0, r2, 12 + lsrs r5, r0, 16 + ldr r1, _08143310 + lsls r0, r3, 3 + adds r1, r0, r1 + adds r0, r4, 0 + cmp r0, 0 + bge _081432EE + adds r0, 0xF +_081432EE: + asrs r0, 4 + strh r0, [r1, 0x6] + strh r0, [r1] + strh r5, [r1, 0x2] + lsls r0, r5, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r1, 0x4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08143304: .4byte 0x0203ab88 +_08143308: .4byte 0x00000167 +_0814330C: .4byte 0xfffffe98 +_08143310: .4byte 0x02021bc0 + thumb_func_end sub_8143280 + + thumb_func_start sub_8143314 +sub_8143314: @ 8143314 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r5, 0 + ldr r7, _081434E8 + mov r6, sp +_08143322: + ldr r0, _081434EC + lsls r4, r5, 3 + adds r4, r0 + ldr r0, [r4] + adds r1, r7, 0 + bl LZ77UnCompWram + str r7, [sp] + ldrh r2, [r4, 0x4] + ldr r0, _081434F0 + ldr r1, [r6, 0x4] + ands r1, r0 + orrs r1, r2 + str r1, [r6, 0x4] + ldrh r2, [r4, 0x6] + lsls r2, 16 + ldr r0, _081434F4 + ands r0, r1 + orrs r0, r2 + str r0, [r6, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08143322 + ldr r0, _081434F8 + movs r1, 0xD0 + movs r2, 0x10 + movs r3, 0x4 + bl obj_add_from_template_forward_search + ldr r3, _081434FC + ldr r1, [r3] + adds r1, 0x50 + strb r0, [r1] + ldr r4, _08143500 + ldr r0, [r3] + adds r0, 0x50 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + movs r5, 0 + adds r7, r3, 0 +_0814338C: + lsls r1, r5, 19 + movs r0, 0xC4 + lsls r0, 16 + adds r1, r0 + asrs r1, 16 + ldr r0, _08143504 + movs r2, 0x18 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + adds r3, r5, 0 + adds r3, 0x15 + adds r1, 0x3C + adds r1, r3 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + 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, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r6, 0x40 + orrs r1, r6 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0814338C + ldr r0, _08143508 + movs r1, 0x78 + movs r2, 0x44 + movs r3, 0x4 + bl obj_add_from_template_forward_search + ldr r2, _081434FC + ldr r1, [r2] + adds r1, 0x55 + strb r0, [r1] + ldr r3, _08143500 + ldr r0, [r2] + adds r0, 0x55 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + orrs r1, r6 + strb r1, [r0] + movs r5, 0 + adds r4, r2, 0 + adds r7, r3, 0 +_0814341C: + lsls r1, r5, 20 + movs r2, 0xC0 + lsls r2, 16 + adds r1, r2 + asrs r1, 16 + ldr r0, _0814350C + movs r2, 0x24 + movs r3, 0x4 + bl obj_add_from_template_forward_search + ldr r1, [r4] + adds r2, r5, 0 + adds r2, 0x1A + adds r1, 0x3C + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x3C + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x4 + mov r8, r3 + mov r3, r8 + orrs r1, r3 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x3C + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x2C + ldrb r1, [r0] + movs r6, 0x40 + orrs r1, r6 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0814341C + ldr r0, _08143510 + movs r1, 0x98 + movs r2, 0x60 + movs r3, 0x9 + bl obj_add_from_template_forward_search + ldr r3, _081434FC + ldr r1, [r3] + adds r1, 0x6C + strb r0, [r1] + ldr r4, _08143500 + ldr r0, [r3] + adds r0, 0x6C + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r3] + adds r0, 0x6C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + orrs r1, r6 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x6C + 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] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081434E8: .4byte 0x0201c000 +_081434EC: .4byte 0x085b7750 +_081434F0: .4byte 0xffff0000 +_081434F4: .4byte 0x0000ffff +_081434F8: .4byte 0x085b77e4 +_081434FC: .4byte 0x0203ab88 +_08143500: .4byte 0x02020630 +_08143504: .4byte 0x085b77fc +_08143508: .4byte 0x085b7814 +_0814350C: .4byte 0x085b782c +_08143510: .4byte 0x085b7844 + thumb_func_end sub_8143314 + + thumb_func_start sub_8143514 +sub_8143514: @ 8143514 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r7, r0, 16 + movs r0, 0xFA + lsls r0, 2 + mov r8, r0 + movs r4, 0 + movs r6, 0 + ldr r1, _08143600 + mov r9, r1 + ldr r0, _08143604 + mov r10, r0 +_08143534: + adds r0, r7, 0 + mov r1, r8 + bl __udivsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08143604 + ldr r0, [r1] + adds r3, r6, 0 + adds r3, 0x15 + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08143600 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + cmp r5, 0 + bne _0814356E + cmp r4, 0 + bne _0814356E + cmp r6, 0x3 + bne _081435CC +_0814356E: + mov r4, r10 + ldr r0, [r4] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + movs r4, 0x5 + negs r4, r4 + adds r2, r4, 0 + ands r1, r2 + strb r1, [r0] + mov r1, r10 + ldr r0, [r1] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r4, r9 + adds r3, r0, r4 + adds r4, r3, 0 + adds r4, 0x40 + ldr r1, _08143608 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrh r2, [r0] + ldrh r4, [r4] + adds r2, r4 + ldr r4, _0814360C + adds r0, r4, 0 + ands r2, r0 + ldrh r0, [r3, 0x4] + ldr r4, _08143610 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x4] + movs r4, 0x1 +_081435CC: + adds r0, r7, 0 + mov r1, r8 + bl __umodsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r0, r8 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _08143534 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143600: .4byte 0x02020630 +_08143604: .4byte 0x0203ab88 +_08143608: .4byte 0x02020638 +_0814360C: .4byte 0x000003ff +_08143610: .4byte 0xfffffc00 + thumb_func_end sub_8143514 + + thumb_func_start sub_8143614 +sub_8143614: @ 8143614 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0814364C + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x13 + bls _0814362C + movs r4, 0 +_0814362C: + ldr r3, _08143650 + lsls r0, r4, 2 + adds r0, r4 + lsls r2, r0, 2 + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsls r0, 28 + lsrs r0, 28 + cmp r0, 0x4 + beq _08143680 + cmp r0, 0x4 + bgt _08143654 + cmp r0, 0x3 + beq _0814365A + b _081436C4 + .align 2, 0 +_0814364C: .4byte 0x085b7b04 +_08143650: .4byte 0x085b6154 +_08143654: + cmp r0, 0xC + beq _081436A4 + b _081436C4 +_0814365A: + adds r0, r4, 0 + movs r1, 0x5 + bl __udivsi3 + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0814367C + ldr r0, [r0] + adds r0, 0x16 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x3 + bhi _081436C4 + ldrb r0, [r1] + adds r0, 0x1 + b _08143698 + .align 2, 0 +_0814367C: .4byte 0x0203ab88 +_08143680: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081436A0 + ldr r0, [r0] + adds r0, 0x12 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _081436C4 + ldrb r0, [r1] + adds r0, 0x2 +_08143698: + add r0, sp + ldrb r0, [r0] + b _081436C6 + .align 2, 0 +_081436A0: .4byte 0x0203ab88 +_081436A4: + ldr r0, _081436C0 + ldr r1, [r0] + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081436C4 + mov r0, sp + ldrb r0, [r0, 0x4] + b _081436C6 + .align 2, 0 +_081436C0: .4byte 0x0203ab88 +_081436C4: + movs r0, 0 +_081436C6: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8143614 + + thumb_func_start sub_81436D0 +sub_81436D0: @ 81436D0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0814371C + ldr r1, [r1] + adds r1, 0x55 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, _08143720 + adds r4, r1, r2 + bl sub_8143614 + adds r3, r4, 0 + adds r3, 0x2B + strb r0, [r3] + adds r2, r4, 0 + adds r2, 0x40 + ldr r1, [r4, 0x8] + ldrb r0, [r3] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, _08143724 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r4, 0x4] + ldr r0, _08143728 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814371C: .4byte 0x0203ab88 +_08143720: .4byte 0x02020630 +_08143724: .4byte 0x000003ff +_08143728: .4byte 0xfffffc00 + thumb_func_end sub_81436D0 + + thumb_func_start sub_814372C +sub_814372C: @ 814372C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + movs r6, 0 + ldr r1, _08143758 + ldr r0, [r1] + ldrb r0, [r0, 0x19] + adds r5, r1, 0 + cmp r0, 0x1 + bne _08143746 + movs r6, 0x2 +_08143746: + cmp r2, 0x6 + bls _0814374C + b _081438A8 +_0814374C: + lsls r0, r2, 2 + ldr r1, _0814375C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08143758: .4byte 0x0203ab88 +_0814375C: .4byte _08143760 + .align 2, 0 +_08143760: + .4byte _081438A8 + .4byte _08143864 + .4byte _0814383C + .4byte _08143830 + .4byte _08143808 + .4byte _081437FC + .4byte _0814377C +_0814377C: + movs r4, 0 + ldr r5, _081437EC + ldr r6, _081437F0 + movs r0, 0x5 + negs r0, r0 + mov r12, r0 + adds r7, r5, 0 + adds r7, 0x8 + ldr r2, _081437F4 + mov r8, r2 +_08143790: + ldr r0, [r6] + adds r3, r4, 0 + adds r3, 0x1A + adds r0, 0x3C + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + adds r2, r3, 0 + adds r2, 0x40 + adds r0, r7 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, _081437F8 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08143790 + b _081438F4 + .align 2, 0 +_081437EC: .4byte 0x02020630 +_081437F0: .4byte 0x0203ab88 +_081437F4: .4byte 0xfffffc00 +_081437F8: .4byte 0x000003ff +_081437FC: + ldr r2, _08143804 + ldr r0, [r5] + adds r0, 0x58 + b _0814386A + .align 2, 0 +_08143804: .4byte 0x02020630 +_08143808: + ldr r2, _0814382C + ldr r0, [r5] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r2 + adds r4, r3, 0 + adds r4, 0x40 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r1, [r0, 0x8] + b _08143886 + .align 2, 0 +_0814382C: .4byte 0x02020630 +_08143830: + ldr r2, _08143838 + ldr r0, [r5] + adds r0, 0x57 + b _0814386A + .align 2, 0 +_08143838: .4byte 0x02020630 +_0814383C: + ldr r2, _08143860 + ldr r0, [r5] + adds r0, 0x57 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r2 + adds r4, r3, 0 + adds r4, 0x40 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r1, [r0, 0x8] + b _08143886 + .align 2, 0 +_08143860: .4byte 0x02020630 +_08143864: + ldr r2, _0814389C + ldr r0, [r5] + adds r0, 0x56 +_0814386A: + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r2 + adds r4, r3, 0 + adds r4, 0x40 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r1, [r0, 0x4] +_08143886: + ldrh r4, [r4] + adds r1, r4 + ldr r2, _081438A0 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, _081438A4 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + b _081438F4 + .align 2, 0 +_0814389C: .4byte 0x02020630 +_081438A0: .4byte 0x000003ff +_081438A4: .4byte 0xfffffc00 +_081438A8: + movs r4, 0 + lsls r7, r6, 2 + ldr r6, _08143900 + movs r0, 0x8 + adds r0, r6 + mov r12, r0 + ldr r2, _08143904 + mov r8, r2 +_081438B8: + ldr r0, [r5] + adds r0, r4 + adds r0, 0x56 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r6 + adds r2, r3, 0 + adds r2, 0x40 + add r0, r12 + ldr r0, [r0] + ldr r0, [r0] + adds r0, r7, r0 + ldrh r1, [r0, 0x8] + ldrh r2, [r2] + adds r1, r2 + ldr r2, _08143908 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081438B8 +_081438F4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143900: .4byte 0x02020630 +_08143904: .4byte 0xfffffc00 +_08143908: .4byte 0x000003ff + thumb_func_end sub_814372C + + thumb_func_start sub_814390C +sub_814390C: @ 814390C + ldr r1, _08143918 + ldr r1, [r1] + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x24] + bx lr + .align 2, 0 +_08143918: .4byte 0x0203ab88 + thumb_func_end sub_814390C + + thumb_func_start sub_814391C +sub_814391C: @ 814391C + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, _08143988 + ldr r0, [r4] + ldr r5, _0814398C + 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 gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _08143990 + movs r1, 0x74 + movs r2, 0x50 + movs r3, 0x51 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08143994 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, _08143998 + ldr r0, [r0] + ldrh r0, [r0, 0x24] + movs r2, 0 + strh r0, [r1, 0x2E] + strh r2, [r1, 0x30] + adds r3, r1, 0 + adds r3, 0x2C + ldrb r0, [r3] + movs r2, 0x40 + orrs r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08143988: .4byte 0x085b7948 +_0814398C: .4byte 0x0201c000 +_08143990: .4byte 0x085b7950 +_08143994: .4byte 0x02020630 +_08143998: .4byte 0x0203ab88 + thumb_func_end sub_814391C + + thumb_func_start sub_814399C +sub_814399C: @ 814399C + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r1, _081439C0 + lsls r0, 3 + adds r0, r1 + ldr r1, _081439C4 + ldr r2, [r1] + ldrh r1, [r2, 0x2C] + strh r1, [r0, 0x6] + ldrh r1, [r2, 0x2C] + strh r1, [r0] + ldrh r1, [r2, 0x2E] + strh r1, [r0, 0x2] + ldrh r1, [r2, 0x30] + strh r1, [r0, 0x4] + bx lr + .align 2, 0 +_081439C0: .4byte 0x02021bc0 +_081439C4: .4byte 0x0203ab88 + thumb_func_end sub_814399C + + thumb_func_start sub_81439C8 +sub_81439C8: @ 81439C8 + push {r4-r6,lr} + movs r4, 0 + ldr r5, _08143A34 + ldr r6, _08143A38 +_081439D0: + movs r3, 0x39 + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _08143A3C + movs r1, 0x74 + movs r2, 0x50 + bl obj_add_from_template_forward_search + ldr r1, [r5] + adds r1, 0x3C + adds r1, r4 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x3C + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x40 + beq _08143A24 + adds r1, r0, 0 + 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] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_08143A24: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081439D0 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08143A34: .4byte 0x0203ab88 +_08143A38: .4byte 0x02020630 +_08143A3C: .4byte 0x085b7928 + thumb_func_end sub_81439C8 + + thumb_func_start sub_8143A40 +sub_8143A40: @ 8143A40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _08143ABC + ldr r0, [r0] + adds r0, 0x3C + ldrb r5, [r0] + movs r6, 0 + ldr r7, _08143AC0 + movs r0, 0x1C + adds r0, r7 + mov r10, r0 + movs r1, 0x2E + adds r1, r7 + mov r9, r1 + mov r8, r6 +_08143A64: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r4, r7 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + mov r1, r10 + adds r2, r4, r1 + ldr r1, _08143AC4 + str r1, [r2] + movs r1, 0 + bl obj_anim_image_start + movs r1, 0 + adds r2, r5, 0x1 + adds r3, r6, 0x1 +_08143A8C: + lsls r0, r1, 1 + adds r0, r4 + add r0, r9 + mov r5, r8 + strh r5, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _08143A8C + lsls r0, r2, 24 + lsrs r5, r0, 24 + lsls r0, r3, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _08143A64 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143ABC: .4byte 0x0203ab88 +_08143AC0: .4byte 0x02020630 +_08143AC4: .4byte nullsub_12 + 1 + thumb_func_end sub_8143A40 + + thumb_func_start sub_8143AC8 +sub_8143AC8: @ 8143AC8 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, _08143AF8 + ldr r0, [r0] + ldrh r4, [r0, 0x24] + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldrh r2, [r3, 0x34] + movs r5, 0x34 + ldrsh r0, [r3, r5] + cmp r1, r0 + ble _08143B04 + movs r1, 0xB4 + lsls r1, 1 + adds r0, r2, r1 + subs r2, r0, r4 + strh r2, [r3, 0x3A] + lsls r1, r2, 16 + ldr r0, _08143AFC + cmp r1, r0 + ble _08143B08 + ldr r5, _08143B00 + adds r0, r2, r5 + b _08143B06 + .align 2, 0 +_08143AF8: .4byte 0x0203ab88 +_08143AFC: .4byte 0x01670000 +_08143B00: .4byte 0xfffffe98 +_08143B04: + subs r0, r2, r4 +_08143B06: + strh r0, [r3, 0x3A] +_08143B08: + movs r1, 0x3A + ldrsh r0, [r3, r1] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8143AC8 + + thumb_func_start sub_8143B14 +sub_8143B14: @ 8143B14 + push {r4,r5,lr} + bl sub_8143AC8 + ldr r5, _08143B40 + ldr r4, [r5] + lsls r0, 16 + asrs r0, 16 + bl __floatsisf + ldr r1, _08143B44 + bl __divsf3 + bl __fixunssfsi + adds r4, 0x7E + strb r0, [r4] + ldr r0, [r5] + adds r0, 0x7E + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08143B40: .4byte 0x0203ab88 +_08143B44: .4byte 0x41f00000 + thumb_func_end sub_8143B14 + + thumb_func_start sub_8143B48 +sub_8143B48: @ 8143B48 + push {r4,lr} + adds r4, r0, 0 + bl sub_8143AC8 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1E + bl __modsi3 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0xE + bne _08143B68 + movs r0, 0 + strh r0, [r4, 0x32] + b _08143B7E +_08143B68: + cmp r1, 0xD + bgt _08143B70 + movs r0, 0xE + b _08143B72 +_08143B70: + movs r0, 0x2B +_08143B72: + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 +_08143B7E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8143B48 + + thumb_func_start sub_8143B84 +sub_8143B84: @ 8143B84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + ldr r5, _08143BCC + ldr r6, [r5] + adds r4, r6, 0 + adds r4, 0x8C + adds r1, r6, 0 + adds r1, 0x90 + ldr r0, [r4] + ldr r1, [r1] + bl __addsf3 + adds r1, r0, 0 + str r1, [r4] + subs r4, 0x4 + ldr r0, [r4] + bl __addsf3 + adds r6, r0, 0 + str r6, [r4] + ldr r0, _08143BD0 + mov r8, r0 + adds r0, r6, 0 + mov r1, r8 + bl __gesf2 + cmp r0, 0 + blt _08143BD4 + adds r0, r6, 0 + mov r1, r8 + bl __subsf3 + b _08143BE8 + .align 2, 0 +_08143BCC: .4byte 0x0203ab88 +_08143BD0: .4byte 0x43b40000 +_08143BD4: + ldr r1, _08143C80 + adds r0, r6, 0 + bl __ltsf2 + cmp r0, 0 + bge _08143BEA + adds r0, r6, 0 + mov r1, r8 + bl __addsf3 +_08143BE8: + str r0, [r4] +_08143BEA: + ldr r5, [r5] + adds r0, r5, 0 + adds r0, 0x88 + ldr r0, [r0] + bl __fixsfsi + strh r0, [r7, 0x34] + adds r4, r5, 0 + adds r4, 0x98 + adds r1, r5, 0 + adds r1, 0x9C + ldr r0, [r4] + ldr r1, [r1] + bl __addsf3 + adds r1, r0, 0 + str r1, [r4] + subs r4, 0x4 + ldr r0, [r4] + bl __addsf3 + str r0, [r4] + bl __fixsfsi + strh r0, [r7, 0x36] + ldrh r0, [r7, 0x34] + bl sine2 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r0, [r7, 0x34] + bl cosine2 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x36 + ldrsh r1, [r7, r2] + muls r1, r4 + asrs r1, 12 + strh r1, [r7, 0x24] + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + movs r2, 0x36 + ldrsh r1, [r7, r2] + muls r0, r1 + asrs r0, 12 + strh r0, [r7, 0x26] + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _08143C74 + ldr r0, _08143C84 + ldr r4, _08143C88 + ldrh r2, [r7, 0x24] + lsls r2, 24 + asrs r2, 24 + adds r1, r4, 0 + bl MPlayPanpotControl + ldr r0, _08143C8C + ldrh r2, [r7, 0x24] + lsls r2, 24 + asrs r2, 24 + adds r1, r4, 0 + bl MPlayPanpotControl +_08143C74: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143C80: .4byte 0x00000000 +_08143C84: .4byte 0x030075f0 +_08143C88: .4byte 0x0000ffff +_08143C8C: .4byte 0x03007630 + thumb_func_end sub_8143B84 + + thumb_func_start sub_8143C90 +sub_8143C90: @ 8143C90 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _08143CEC + ldr r1, [r0] + ldrh r0, [r5, 0x3A] + ldrh r1, [r1, 0x24] + adds r2, r0, r1 + strh r2, [r5, 0x34] + lsls r1, r2, 16 + ldr r0, _08143CF0 + cmp r1, r0 + ble _08143CAE + ldr r1, _08143CF4 + adds r0, r2, r1 + strh r0, [r5, 0x34] +_08143CAE: + ldrh r0, [r5, 0x34] + bl sine2 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r0, [r5, 0x34] + bl cosine2 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x36 + ldrsh r1, [r5, r2] + muls r1, r4 + asrs r1, 12 + strh r1, [r5, 0x24] + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + movs r2, 0x36 + ldrsh r1, [r5, r2] + muls r0, r1 + ldr r1, _08143CF8 + asrs r0, 12 + ldrh r1, [r1] + adds r0, r1 + strh r0, [r5, 0x26] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08143CEC: .4byte 0x0203ab88 +_08143CF0: .4byte 0x01670000 +_08143CF4: .4byte 0xfffffe98 +_08143CF8: .4byte 0x02021bbe + thumb_func_end sub_8143C90 + + thumb_func_start sub_8143CFC +sub_8143CFC: @ 8143CFC + push {r4-r7,lr} + adds r5, r0, 0 + bl sub_8143B84 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x36] + adds r0, 0x84 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xD4 + bls _08143D22 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _08143D2E +_08143D22: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_08143D2E: + strb r0, [r2] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x1D + ble _08143DF8 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08143D6C + ldr r7, _08143D64 + ldr r6, [r7] + adds r4, r6, 0 + adds r4, 0x94 + adds r0, r6, 0 + adds r0, 0xA0 + ldr r0, [r0] + ldr r1, _08143D68 + bl __subsf3 + adds r1, r0, 0 + ldr r0, [r4] + bl __lesf2 + cmp r0, 0 + bgt _08143DF8 + b _08143D8C + .align 2, 0 +_08143D64: .4byte 0x0203ab88 +_08143D68: .4byte 0x40000000 +_08143D6C: + ldr r7, _08143E00 + ldr r6, [r7] + adds r4, r6, 0 + adds r4, 0x94 + adds r0, r6, 0 + adds r0, 0xA0 + ldr r0, [r0] + ldr r1, _08143E04 + bl __subsf3 + adds r1, r0, 0 + ldr r0, [r4] + bl __gesf2 + cmp r0, 0 + blt _08143DF8 +_08143D8C: + adds r1, r6, 0 + adds r1, 0x7D + movs r0, 0xFF + strb r0, [r1] + ldr r2, [r7] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + adds r0, r5, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r5, 0x3A] + ldr r0, _08143E08 + str r0, [r5, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + ldr r3, [r7] + adds r2, r3, 0 + adds r2, 0x9C + adds r1, r3, 0 + adds r1, 0x98 + ldr r0, _08143E0C + str r0, [r1] + str r0, [r2] + subs r1, 0xC + ldr r0, _08143E10 + str r0, [r1] +_08143DF8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143E00: .4byte 0x0203ab88 +_08143E04: .4byte 0x40000000 +_08143E08: .4byte sub_8143C90 + 1 +_08143E0C: .4byte 0x00000000 +_08143E10: .4byte 0xbf800000 + thumb_func_end sub_8143CFC + + thumb_func_start sub_8143E14 +sub_8143E14: @ 8143E14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + bl sub_8143B84 + movs r1, 0x34 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08143E32 + cmp r0, 0xB4 + beq _08143E9C + b _08143F80 +_08143E32: + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _08143E3C + b _08143F80 +_08143E3C: + movs r1, 0x3C + ldrsh r0, [r7, r1] + bl __floatsisf + mov r9, r0 + ldr r0, _08143E94 + mov r10, r0 + ldr r1, _08143E98 + mov r8, r1 + ldr r0, [r1] + ldrb r4, [r0, 0x4] + lsls r4, 30 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x1] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __mulsf3 + adds r6, r0, 0 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x2] + subs r0, 0x1 + bl __floatsisf + adds r1, r0, 0 + adds r0, r6, 0 + bl __addsf3 + adds r5, r0, 0 + lsrs r4, 25 + add r4, r10 + ldrh r0, [r4, 0xC] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __divsf3 + b _08143EFC + .align 2, 0 +_08143E94: .4byte 0x085b6348 +_08143E98: .4byte 0x0203ab88 +_08143E9C: + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08143F80 + movs r1, 0x3C + ldrsh r0, [r7, r1] + bl __floatsisf + mov r9, r0 + ldr r0, _08143F90 + mov r10, r0 + ldr r1, _08143F94 + mov r8, r1 + ldr r0, [r1] + ldrb r4, [r0, 0x4] + lsls r4, 30 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x1] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __mulsf3 + adds r6, r0, 0 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x2] + subs r0, 0x1 + bl __floatsisf + adds r1, r0, 0 + adds r0, r6, 0 + bl __addsf3 + adds r5, r0, 0 + lsrs r4, 25 + add r4, r10 + ldrh r0, [r4, 0xC] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __divsf3 + bl __negsf2 +_08143EFC: + adds r2, r0, 0 + mov r0, r8 + ldr r6, [r0] + adds r1, r6, 0 + adds r1, 0xA0 + adds r0, r6, 0 + adds r0, 0x94 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0 + adds r0, 0x98 + str r2, [r0] + movs r0, 0x9C + adds r0, r6 + mov r8, r0 + adds r0, r2, 0 + adds r1, r2, 0 + bl __addsf3 + adds r1, r5, 0 + bl __divsf3 + adds r4, r0, 0 + adds r0, r5, 0 + adds r1, r5, 0 + bl __mulsf3 + adds r1, r0, 0 + ldr r0, _08143F98 + bl __divsf3 + adds r1, r0, 0 + adds r0, r4, 0 + bl __addsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x8C + ldr r0, _08143F9C + str r0, [r1] + adds r2, r7, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r7, 0 + adds r0, 0x2A + movs r2, 0 + strb r2, [r0] + adds r3, r7, 0 + adds r3, 0x3F + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldr r0, _08143FA0 + str r0, [r7, 0x1C] + strh r2, [r7, 0x32] +_08143F80: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08143F90: .4byte 0x085b6348 +_08143F94: .4byte 0x0203ab88 +_08143F98: .4byte 0x40000000 +_08143F9C: .4byte 0x00000000 +_08143FA0: .4byte sub_8143CFC + 1 + thumb_func_end sub_8143E14 + + thumb_func_start sub_8143FA4 +sub_8143FA4: @ 8143FA4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x32 + ldrsh r0, [r5, r1] + bl __floatsisf + adds r4, r0, 0 + ldr r1, _08144044 + bl __mulsf3 + adds r1, r4, 0 + bl __mulsf3 + bl __fixsfsi + adds r1, r0, 0 + subs r1, 0x2D + strh r1, [r5, 0x26] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _0814403E + lsls r0, r1, 16 + cmp r0, 0 + blt _0814403E + ldr r4, _08144048 + ldr r0, [r4] + adds r0, 0x7D + movs r1, 0xFF + strb r1, [r0] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + adds r0, r5, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r5, 0x3A] + ldr r0, _0814404C + str r0, [r5, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + ldr r2, [r4] + ldrb r0, [r2, 0x3] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0x3] +_0814403E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08144044: .4byte 0x3d4ccccd +_08144048: .4byte 0x0203ab88 +_0814404C: .4byte sub_8143C90 + 1 + thumb_func_end sub_8143FA4 + + thumb_func_start sub_8144050 +sub_8144050: @ 8144050 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2C + bgt _08144098 + ldrh r4, [r3, 0x26] + subs r0, r4, 0x1 + strh r0, [r3, 0x26] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2D + bne _0814411E + ldr r2, _08144090 + ldr r0, _08144094 + ldr r0, [r0] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _0814411E + strh r4, [r3, 0x26] + b _0814411E + .align 2, 0 +_08144090: .4byte 0x02020630 +_08144094: .4byte 0x0203ab88 +_08144098: + lsls r0, r1, 16 + asrs r0, 16 + movs r2, 0x3C + ldrsh r1, [r3, r2] + cmp r0, r1 + bge _081440E4 + ldr r2, _081440D4 + ldr r0, _081440D8 + ldr r0, [r0] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x2C + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bne _0814411E + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081440DC + ldrh r0, [r3, 0x26] + adds r0, 0x1 + strh r0, [r3, 0x26] + b _0814411E + .align 2, 0 +_081440D4: .4byte 0x02020630 +_081440D8: .4byte 0x0203ab88 +_081440DC: + ldrh r0, [r3, 0x26] + subs r0, 0x1 + strh r0, [r3, 0x26] + b _0814411E +_081440E4: + adds r2, r3, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x3F + adds r0, r3 + mov r12, r0 + ldrb r0, [r0] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + strh r2, [r3, 0x32] + ldr r0, _08144124 + str r0, [r3, 0x1C] + movs r0, 0x3D + bl m4aSongNumStart +_0814411E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08144124: .4byte sub_8143FA4 + 1 + thumb_func_end sub_8144050 + + thumb_func_start sub_8144128 +sub_8144128: @ 8144128 + push {r4,lr} + adds r4, r0, 0 + bl sub_8143B84 + movs r0, 0x34 + ldrsh r1, [r4, r0] + cmp r1, 0x5A + beq _08144142 + movs r0, 0x87 + lsls r0, 1 + cmp r1, r0 + beq _0814414C + b _0814415C +_08144142: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0814415C + b _08144154 +_0814414C: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0814415C +_08144154: + ldr r0, _08144164 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x32] +_0814415C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08144164: .4byte sub_8144050 + 1 + thumb_func_end sub_8144128 + + thumb_func_start sub_8144168 +sub_8144168: @ 8144168 + push {r4,lr} + adds r4, r0, 0 + bl sub_8143B84 + ldr r0, _0814418C + ldr r0, [r0] + ldrb r0, [r0, 0x3] + lsls r0, 27 + lsrs r0, 27 + cmp r0, 0 + beq _08144182 + cmp r0, 0x1 + beq _08144194 +_08144182: + adds r0, r4, 0 + bl sub_81446DC + ldr r0, _08144190 + b _0814419C + .align 2, 0 +_0814418C: .4byte 0x0203ab88 +_08144190: .4byte sub_8143E14 + 1 +_08144194: + adds r0, r4, 0 + bl sub_81448B8 + ldr r0, _081441A4 +_0814419C: + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081441A4: .4byte sub_8144128 + 1 + thumb_func_end sub_8144168 + + thumb_func_start prev_quest_read_x24_hm_usage +prev_quest_read_x24_hm_usage: @ 81441A8 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8143B84 + ldrh r0, [r5, 0x32] + subs r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bne _081441CE + ldr r0, _08144238 + ldr r4, [r0] + adds r4, 0x98 + ldr r0, [r4] + ldr r1, _0814423C + bl __mulsf3 + str r0, [r4] +_081441CE: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0814425C + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08144244 + ldr r2, _08144238 + ldr r0, [r2] + adds r0, 0x7D + movs r1, 0xFF + strb r1, [r0] + ldr r2, [r2] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl obj_anim_image_start + adds r0, r5, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r5, 0x3A] + ldr r0, _08144240 + str r0, [r5, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + b _0814425C + .align 2, 0 +_08144238: .4byte 0x0203ab88 +_0814423C: .4byte 0xbf800000 +_08144240: .4byte sub_8143C90 + 1 +_08144244: + adds r0, r5, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + movs r0, 0x38 + bl m4aSongNumStart + adds r0, r5, 0 + bl sub_8144A24 +_0814425C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end prev_quest_read_x24_hm_usage + + thumb_func_start sub_8144264 +sub_8144264: @ 8144264 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_8143B84 + movs r0, 0 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_8143B14 + ldr r1, _081442F0 + ldr r4, _081442F4 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x7E + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r2, 0x8] + ands r0, r1 + cmp r0, 0 + bne _081442FC + adds r1, r2, 0 + adds r1, 0x7D + movs r0, 0xFF + strb r0, [r1] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r6, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl obj_anim_image_start + adds r0, r6, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r6, 0x3A] + ldr r0, _081442F8 + str r0, [r6, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + b _081443F8 + .align 2, 0 +_081442F0: .4byte 0x085b62e4 +_081442F4: .4byte 0x0203ab88 +_081442F8: .4byte sub_8143C90 + 1 +_081442FC: + movs r0, 0x38 + bl m4aSongNumStart + bl GenerateRandomNumber + movs r1, 0x1 + mov r8, r1 + ands r1, r0 + mov r8, r1 + cmp r1, 0 + beq _08144340 + ldr r4, [r4] + adds r1, r4, 0 + adds r1, 0x8C + ldr r0, _08144338 + str r0, [r1] + adds r0, r4, 0 + adds r0, 0x7E + ldrb r0, [r0] + adds r0, 0x1 + movs r1, 0xC + bl __modsi3 + lsls r1, r0, 24 + lsrs r2, r1, 24 + adds r1, r4, 0 + adds r1, 0x7F + strb r0, [r1] + ldr r5, _0814433C + b _08144378 + .align 2, 0 +_08144338: .4byte 0x00000000 +_0814433C: .4byte 0x085b6348 +_08144340: + ldr r7, [r4] + adds r4, r7, 0 + adds r4, 0x8C + ldr r5, _081443A0 + ldrb r0, [r7, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + adds r0, r1, 0 + bl __addsf3 + str r0, [r4] + adds r0, r7, 0 + adds r0, 0x7E + ldrb r4, [r0] + adds r0, r4, 0 + adds r0, 0xB + movs r1, 0xC + bl __modsi3 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r7, 0 + adds r0, 0x7F + strb r4, [r0] +_08144378: + ldr r0, _081443A4 + lsls r1, r2, 3 + adds r0, 0x4 + adds r1, r0 + ldr r2, _081443A8 + ldr r3, [r2] + ldr r1, [r1] + ldr r0, [r3, 0x8] + ands r1, r0 + cmp r1, 0 + beq _081443AC + movs r0, 0x1 + strh r0, [r6, 0x2E] + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r5 + ldrb r0, [r0, 0x2] + strh r0, [r6, 0x32] + b _081443E8 + .align 2, 0 +_081443A0: .4byte 0x085b6348 +_081443A4: .4byte 0x085b62e4 +_081443A8: .4byte 0x0203ab88 +_081443AC: + strh r1, [r6, 0x2E] + ldrb r1, [r3, 0x4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081443C4 + lsls r0, r1, 30 + lsrs r0, 25 + adds r0, r5 + ldrb r0, [r0, 0x1] + strh r0, [r6, 0x32] + b _081443E8 +_081443C4: + lsls r0, r1, 30 + lsrs r0, 25 + adds r0, r5 + ldrb r0, [r0, 0x2] + strh r0, [r6, 0x32] + mov r0, r8 + cmp r0, 0 + beq _081443E0 + adds r1, r3, 0 + adds r1, 0x8C + ldr r0, _081443DC + b _081443E6 + .align 2, 0 +_081443DC: .4byte 0x3f000000 +_081443E0: + adds r1, r3, 0 + adds r1, 0x8C + ldr r0, _08144404 +_081443E6: + str r0, [r1] +_081443E8: + ldr r0, [r2] + adds r0, 0x98 + ldr r1, _08144408 + str r1, [r0] + ldr r0, _0814440C + str r0, [r6, 0x1C] + movs r0, 0x5 + strh r0, [r6, 0x30] +_081443F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08144404: .4byte 0xbfc00000 +_08144408: .4byte 0x3dae147b +_0814440C: .4byte prev_quest_read_x24_hm_usage + 1 + thumb_func_end sub_8144264 + + thumb_func_start sub_8144410 +sub_8144410: @ 8144410 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + bl sub_8143B84 + ldr r4, _081444A4 + ldr r0, [r4] + adds r0, 0x8C + ldr r0, [r0] + ldr r1, _081444A8 + bl __gtsf2 + cmp r0, 0 + bgt _081444FA + adds r0, r6, 0 + bl sub_8143B14 + adds r0, r6, 0 + bl sub_8143B48 + lsls r0, 16 + cmp r0, 0 + bne _081444BC + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x90 + ldr r0, _081444AC + str r0, [r1] + movs r0, 0x8C + adds r0, r2 + mov r8, r0 + ldr r1, _081444B0 + mov r9, r1 + ldrb r0, [r2, 0x4] + lsls r7, r0, 30 + lsrs r0, r7, 25 + add r0, r9 + movs r4, 0x3 + ldrsb r4, [r0, r4] + adds r0, r4, 0 + bl __floatsisf + adds r5, r0, 0 + cmp r4, 0 + bge _08144476 + ldr r1, _081444B4 + bl __addsf3 + adds r5, r0, 0 +_08144476: + lsrs r0, r7, 25 + add r0, r9 + ldrb r0, [r0, 0x4] + adds r0, 0x1 + bl __floatsisf + adds r1, r0, 0 + adds r0, r5, 0 + bl __divsf3 + adds r1, r0, 0 + mov r2, r8 + ldr r0, [r2] + bl __subsf3 + mov r1, r8 + str r0, [r1] + movs r0, 0x4 + strh r0, [r6, 0x30] + ldr r0, _081444B8 + str r0, [r6, 0x1C] + b _081444FA + .align 2, 0 +_081444A4: .4byte 0x0203ab88 +_081444A8: .4byte 0x3f000000 +_081444AC: .4byte 0x00000000 +_081444B0: .4byte 0x085b6348 +_081444B4: .4byte 0x43800000 +_081444B8: .4byte sub_8144264 + 1 +_081444BC: + ldr r4, [r4] + adds r7, r4, 0 + adds r7, 0x90 + ldr r0, [r7] + ldr r6, _08144508 + adds r1, r6, 0 + bl __nesf2 + cmp r0, 0 + beq _081444FA + adds r5, r4, 0 + adds r5, 0x8C + ldr r0, [r5] + adds r1, r6, 0 + bl __ltsf2 + cmp r0, 0 + bge _081444FA + str r6, [r7] + str r6, [r5] + adds r4, 0x98 + ldr r0, [r4] + bl __extendsfdf2 + ldr r2, _0814450C + ldr r3, _08144510 + bl __divdf3 + bl __truncdfsf2 + str r0, [r4] +_081444FA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08144508: .4byte 0x00000000 +_0814450C: .4byte 0x3ff33333 +_08144510: .4byte 0x33333333 + thumb_func_end sub_8144410 + + thumb_func_start sub_8144514 +sub_8144514: @ 8144514 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_8143B84 + ldr r0, _081445C4 + ldr r5, [r0] + adds r0, r5, 0 + adds r0, 0x94 + ldr r0, [r0] + ldr r1, _081445C8 + bl __gtsf2 + cmp r0, 0 + bgt _081445B8 + movs r0, 0x98 + adds r0, r5 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x86 + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _08144556 + ldr r1, _081445CC + bl __addsf3 + adds r2, r0, 0 +_08144556: + ldr r0, _081445D0 + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + movs r0, 0x90 + adds r0, r5 + mov r8, r0 + adds r5, 0x8C + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _08144586 + ldr r1, _081445CC + bl __addsf3 + adds r2, r0, 0 +_08144586: + ldr r0, [r5] + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x2A + movs r0, 0x2 + strb r0, [r1] + adds r2, r6, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + movs r0, 0x3 + strh r0, [r6, 0x30] + ldr r0, _081445D4 + str r0, [r6, 0x1C] +_081445B8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081445C4: .4byte 0x0203ab88 +_081445C8: .4byte 0x42200000 +_081445CC: .4byte 0x47800000 +_081445D0: .4byte 0x40800000 +_081445D4: .4byte sub_8144410 + 1 + thumb_func_end sub_8144514 + + thumb_func_start sub_81445D8 +sub_81445D8: @ 81445D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_8143B84 + ldr r4, _08144694 + ldr r0, [r4] + adds r0, 0x94 + ldr r0, [r0] + ldr r1, _08144698 + bl __gtsf2 + cmp r0, 0 + bgt _0814468A + movs r0, 0x5D + bl m4aSongNumStartOrChange + ldr r5, [r4] + movs r0, 0x98 + adds r0, r5 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x84 + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _08144620 + ldr r1, _0814469C + bl __addsf3 + adds r2, r0, 0 +_08144620: + ldr r0, _081446A0 + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + movs r0, 0x90 + adds r0, r5 + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x8C + ldr r1, [r0] + ldr r0, _081446A4 + bl __subsf3 + adds r5, r0, 0 + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _0814465C + ldr r1, _0814469C + bl __addsf3 + adds r2, r0, 0 +_0814465C: + adds r0, r5, 0 + adds r1, r2, 0 + bl __divsf3 + mov r1, r8 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + adds r2, r6, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r6, 0x30] + ldr r0, _081446A8 + str r0, [r6, 0x1C] +_0814468A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08144694: .4byte 0x0203ab88 +_08144698: .4byte 0x42700000 +_0814469C: .4byte 0x47800000 +_081446A0: .4byte 0x41a00000 +_081446A4: .4byte 0x3f800000 +_081446A8: .4byte sub_8144514 + 1 + thumb_func_end sub_81445D8 + + thumb_func_start sub_81446AC +sub_81446AC: @ 81446AC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + adds r0, r4, 0 + bl sub_8143B84 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _081446D8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081446D8: .4byte sub_81445D8 + 1 + thumb_func_end sub_81446AC + + thumb_func_start sub_81446DC +sub_81446DC: @ 81446DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + ldr r1, _0814489C + mov r0, sp + movs r2, 0x8 + bl memcpy + mov r1, r8 + ldrh r0, [r1, 0x3C] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r5, _081448A0 + ldr r0, _081448A4 + movs r2, 0xC + negs r2, r2 + movs r1, 0x24 + movs r3, 0x32 + bl obj_add_from_template_forward_search + ldr r1, [r5] + adds r1, 0x73 + strb r0, [r1] + ldr r4, _081448A8 + mov r3, r8 + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r2, 2 + mov r1, sp + adds r0, r1, r2 + movs r3, 0 + ldrsh r1, [r0, r3] + mov r0, sp + adds r0, 0x2 + adds r0, r2 + movs r3, 0 + ldrsh r2, [r0, r3] + adds r0, r4, 0 + movs r3, 0x3B + bl obj_add_from_template_forward_search + ldr r1, [r5] + adds r1, 0x74 + strb r0, [r1] + adds r4, 0x18 + adds r0, r4, 0 + movs r1, 0x24 + movs r2, 0x8C + movs r3, 0x33 + bl obj_add_from_template_forward_search + ldr r1, [r5] + adds r1, 0x75 + strb r0, [r1] + ldr r3, _081448AC + ldr r0, [r5] + adds r0, 0x75 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r7, 0 + adds r6, r3, 0 + ldr r0, _081448B0 + mov r12, r0 + mov r10, r5 +_0814477C: + ldr r0, [r5] + adds r3, r7, 0 + adds r3, 0x37 + adds r0, 0x3C + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r3 + 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] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r3 + 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, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + ldr r4, [r5] + adds r2, r4, 0 + adds r2, 0x3C + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x73 + ldrb r1, [r1] + strh r1, [r0, 0x36] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x74 + ldrb r1, [r1] + strh r1, [r0, 0x38] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x75 + ldrb r1, [r1] + strh r1, [r0, 0x3A] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x32] + ldrb r0, [r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + mov r0, r8 + movs r1, 0x3C + ldrsh r3, [r0, r1] + ldrb r1, [r4, 0x4] + lsls r1, 30 + lsrs r0, r1, 25 + add r0, r12 + ldrb r0, [r0, 0x1] + muls r3, r0 + lsrs r1, 25 + add r1, r12 + ldrb r0, [r1, 0x2] + ldr r1, _081448B4 + adds r0, r1 + adds r3, r0 + strh r3, [r2, 0x34] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _081448AC + cmp r7, 0x2 + bls _0814477C + mov r3, r10 + ldr r0, [r3] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + mov r1, r8 + str r1, [r0, 0x38] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814489C: .4byte 0x085b7b0a +_081448A0: .4byte 0x0203ab88 +_081448A4: .4byte 0x085b79f8 +_081448A8: .4byte 0x085b7abc +_081448AC: .4byte 0x02020630 +_081448B0: .4byte 0x085b6348 +_081448B4: .4byte 0x0000ffff + thumb_func_end sub_81446DC + + thumb_func_start sub_81448B8 +sub_81448B8: @ 81448B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + ldr r1, _08144A0C + mov r0, sp + movs r2, 0x8 + bl memcpy + ldrh r0, [r7, 0x3C] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, _08144A10 + movs r1, 0x2E + ldrsh r2, [r7, r1] + lsls r2, 2 + mov r3, sp + adds r1, r3, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + mov r4, sp + adds r4, 0x2 + adds r2, r4, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + movs r3, 0x32 + bl obj_add_from_template_forward_search + ldr r5, _08144A14 + ldr r1, [r5] + adds r1, 0x73 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, _08144A18 + adds r0, r6 + ldrh r1, [r7, 0x2E] + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + ldr r0, _08144A1C + movs r1, 0x2E + ldrsh r2, [r7, r1] + lsls r2, 2 + mov r3, sp + adds r1, r3, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r4, r2 + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0x33 + bl obj_add_from_template_forward_search + ldr r1, [r5] + adds r1, 0x74 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x74 + 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] + mov r0, r9 + lsls r2, r0, 16 + asrs r2, 16 + ldr r3, _08144A20 + ldr r0, [r5] + ldrb r1, [r0, 0x4] + lsls r1, 30 + lsrs r0, r1, 25 + adds r0, r3 + ldrb r0, [r0, 0x1] + muls r2, r0 + lsrs r1, 25 + adds r1, r3 + ldrh r0, [r1, 0x10] + adds r0, 0x2D + adds r2, r0 + strh r2, [r7, 0x3C] +_08144992: + ldr r0, _08144A14 + ldr r4, [r0] + mov r1, r8 + adds r2, r4, r1 + adds r2, 0x73 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x73 + ldrb r1, [r1] + strh r1, [r0, 0x36] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r3, r4, 0 + adds r3, 0x74 + ldrb r1, [r3] + strh r1, [r0, 0x38] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r3] + strh r1, [r0, 0x3A] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r3, r9 + strh r3, [r0, 0x32] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r7, 0x3C] + subs r0, 0x2D + strh r0, [r1, 0x34] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bls _08144992 + str r7, [r4, 0x38] + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08144A0C: .4byte 0x085b7b12 +_08144A10: .4byte 0x085b7a10 +_08144A14: .4byte 0x0203ab88 +_08144A18: .4byte 0x02020630 +_08144A1C: .4byte 0x085b7aec +_08144A20: .4byte 0x085b6348 + thumb_func_end sub_81448B8 + + thumb_func_start sub_8144A24 +sub_8144A24: @ 8144A24 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r7, r0, 0 + movs r0, 0 + mov r9, r0 + movs r1, 0x5 + mov r8, r1 + str r0, [sp, 0xC] + mov r0, sp + movs r1, 0 + movs r2, 0xA + bl memset + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + ldr r3, _08144B10 + ldr r0, [r3] + adds r0, 0x7D + movs r5, 0x1 + strb r5, [r0] + ldr r2, [r3] + ldrb r0, [r2, 0x3] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r0, [r3] + adds r0, 0x7E + movs r1, 0xFF + strb r1, [r0] + ldr r6, [r3] + adds r4, r6, 0 + adds r4, 0x88 + movs r1, 0x34 + ldrsh r0, [r7, r1] + bl __floatsisf + str r0, [r4] + adds r1, r6, 0 + adds r1, 0x98 + ldr r0, _08144B14 + str r0, [r1] + adds r2, r6, 0 + adds r2, 0x8C + ldr r1, _08144B18 + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r1, 0x1C + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 30 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0x21 + ldrb r0, [r6, 0x3] + lsls r0, 27 + lsrs r0, 27 + subs r5, r0 + lsls r0, r5, 4 + subs r0, r5 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r5, r9 + movs r0, 0x34 + ldrsh r2, [r7, r0] +_08144ACA: + cmp r1, r2 + bge _08144AD6 + adds r0, r1, 0 + adds r0, 0x5A + cmp r2, r0 + ble _08144B38 +_08144AD6: + cmp r5, 0x3 + beq _08144B1C + adds r0, r1, 0 + adds r0, 0x5A + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08144ACA +_08144AEC: + ldr r0, _08144B10 + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x1F + ands r0, r1 + cmp r0, 0 + beq _08144B64 + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08144B58 + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + negs r1, r1 + bl cry_related + b _08144B70 + .align 2, 0 +_08144B10: .4byte 0x0203ab88 +_08144B14: .4byte 0x00000000 +_08144B18: .4byte 0x085b6348 +_08144B1C: + movs r0, 0x1 + strh r0, [r7, 0x2E] + ldr r0, _08144B34 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x3] + b _08144AEC + .align 2, 0 +_08144B34: .4byte 0x0203ab88 +_08144B38: + lsrs r0, r5, 1 + strh r0, [r7, 0x2E] + ldr r0, _08144B54 + ldr r3, [r0] + movs r1, 0x1 + ands r1, r5 + ldrb r2, [r3, 0x3] + movs r0, 0x20 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + b _08144AEC + .align 2, 0 +_08144B54: .4byte 0x0203ab88 +_08144B58: + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + bl cry_related + b _08144B70 +_08144B64: + movs r0, 0x99 + lsls r0, 1 + movs r1, 0x3F + negs r1, r1 + bl cry_related +_08144B70: + movs r0, 0x2 + mov r10, r0 + ldr r4, _08144BA4 + ldr r5, [r4] + adds r0, r5, 0 + adds r0, 0x7F + ldrb r0, [r0] + adds r0, 0x2 + movs r1, 0xC + bl __modsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r5, 0x3] + movs r0, 0x1F + ands r0, r1 + cmp r0, 0x1 + bne _08144BA8 + ldrb r1, [r5, 0x4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _08144BA8 + mov r0, r8 + adds r0, 0x6 + b _08144BAC + .align 2, 0 +_08144BA4: .4byte 0x0203ab88 +_08144BA8: + mov r0, r8 + add r0, r10 +_08144BAC: + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r5, r10 + cmp r5, r8 + bcs _08144C18 + ldr r1, _08144C40 + mov r10, r1 +_08144BBC: + ldr r3, [r4] + lsls r0, r6, 3 + ldr r1, _08144C44 + adds r0, r1 + ldr r1, [r3, 0x8] + ldr r2, [r0] + ands r1, r2 + cmp r1, 0 + bne _08144C02 + mov r0, r9 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + add r0, sp + strb r5, [r0] + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _08144C02 + ldrb r1, [r3, 0x1A] + lsls r1, 28 + lsrs r1, 28 + adds r0, r3, 0 + adds r0, 0x1B + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _08144C02 + str r5, [sp, 0xC] +_08144C02: + adds r0, r6, 0x1 + movs r1, 0xC + bl __modsi3 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _08144BBC +_08144C18: + ldr r0, [r4] + ldrb r1, [r0, 0x3] + lsls r1, 27 + lsrs r1, 27 + adds r1, 0x1 + ldrb r0, [r0, 0x2] + ands r1, r0 + cmp r1, 0 + beq _08144C48 + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _08144C48 + movs r0, 0xFF + ldr r1, [sp, 0x10] + ands r0, r1 + cmp r0, 0xBF + bhi _08144C48 + mov r0, sp + ldrh r0, [r0, 0xC] + b _08144C54 + .align 2, 0 +_08144C40: .4byte 0x085b6160 +_08144C44: .4byte 0x085b62e8 +_08144C48: + ldr r0, [sp, 0x10] + mov r1, r9 + bl __modsi3 + add r0, sp + ldrb r0, [r0] +_08144C54: + strh r0, [r7, 0x3C] + ldr r1, _08144C6C + str r1, [r7, 0x1C] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08144C6C: .4byte sub_8144168 + 1 + thumb_func_end sub_8144A24 + + thumb_func_start sub_8144C70 +sub_8144C70: @ 8144C70 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0x1 + strh r1, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08144CC0 + ldrh r0, [r2, 0x20] + subs r0, 0x2 + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08144CC0 + ldr r4, _08144CC8 + ldr r3, [r4] + ldrb r1, [r3, 0x3] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08144CAC + movs r0, 0x40 + orrs r0, r1 + strb r0, [r3, 0x3] +_08144CAC: + adds r0, r2, 0 + bl obj_delete_and_free_tiles + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x1] + ldr r1, [r4] + ldr r0, _08144CCC + ldrh r0, [r0] + strh r0, [r1, 0x34] +_08144CC0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08144CC8: .4byte 0x0203ab88 +_08144CCC: .4byte 0x085b7b1a + thumb_func_end sub_8144C70 + + thumb_func_start sub_8144CD0 +sub_8144CD0: @ 8144CD0 + push {r4,lr} + sub sp, 0x18 + adds r4, r0, 0 + ldr r1, _08144D4C + mov r0, sp + movs r2, 0x18 + bl memcpy + ldrh r0, [r4, 0x30] + adds r2, r0, 0x1 + strh r2, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _08144D54 + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _08144D2E + ldr r3, _08144D50 + movs r0, 0x3C + ldrsh r2, [r4, r0] + lsls r2, 1 + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 3 + adds r2, r0 + mov r1, sp + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r3] + movs r3, 0x3C + ldrsh r2, [r4, r3] + adds r1, r2, 0x1 + adds r0, r1, 0 + cmp r1, 0 + bge _08144D26 + adds r0, r2, 0x4 +_08144D26: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + strh r0, [r4, 0x3C] +_08144D2E: + 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 _08144D7E + .align 2, 0 +_08144D4C: .4byte 0x085b7b2e +_08144D50: .4byte 0x02021bbe +_08144D54: + ldr r1, _08144D88 + movs r0, 0 + strh r0, [r1] + ldr r2, _08144D8C + ldr r0, _08144D90 + ldr r0, [r0] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2C + ldrb r2, [r0] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08144D7E: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08144D88: .4byte 0x02021bbe +_08144D8C: .4byte 0x02020630 +_08144D90: .4byte 0x0203ab88 + thumb_func_end sub_8144CD0 + + thumb_func_start sub_8144D94 +sub_8144D94: @ 8144D94 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + movs r1, 0x30 + ldrsh r0, [r5, r1] + bl __floatsisf + adds r4, r0, 0 + ldr r1, _08144E44 + bl __mulsf3 + adds r1, r4, 0 + bl __mulsf3 + bl __fixsfsi + strh r0, [r5, 0x26] + ldr r0, _08144E48 + ldr r3, [r0] + ldr r2, _08144E4C + ldrb r0, [r3, 0x1] + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3, 0x34] + ldrb r0, [r3, 0x1] + cmp r0, 0x12 + bhi _08144DDC + adds r0, 0x1 + strb r0, [r3, 0x1] +_08144DDC: + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x3C + ble _08144E3E + movs r0, 0 + strh r0, [r5, 0x30] + ldr r3, _08144E50 + str r3, [r5, 0x1C] + ldr r2, _08144E54 + movs r0, 0x3A + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r2, 0 + adds r4, 0x1C + adds r0, r4 + str r3, [r0] + movs r0, 0x3A + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _08144E58 + strh r1, [r0, 0x30] + movs r0, 0x38 + ldrsh r1, [r5, 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] + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08144E5C + str r1, [r0] + movs r0, 0xD6 + bl m4aSongNumStart +_08144E3E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08144E44: .4byte 0x3d1fbe77 +_08144E48: .4byte 0x0203ab88 +_08144E4C: .4byte 0x085b7b1a +_08144E50: .4byte sub_8144C70 + 1 +_08144E54: .4byte 0x02020630 +_08144E58: .4byte 0x0000fffe +_08144E5C: .4byte sub_8144CD0 + 1 + thumb_func_end sub_8144D94 + + thumb_func_start sub_8144E60 +sub_8144E60: @ 8144E60 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08144EE4 + ldr r0, _08144E8C + ldr r3, [r0] + ldr r1, [r3, 0x38] + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08144E94 + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, _08144E90 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x8] + b _08144EA6 + .align 2, 0 +_08144E8C: .4byte 0x0203ab88 +_08144E90: .4byte 0x085b6348 +_08144E94: + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, _08144ED8 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x8] + adds r0, 0xB4 +_08144EA6: + cmp r2, r0 + bne _08144F7C + 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, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r0, 0x2B + bl m4aSongNumStart + ldr r2, _08144EDC + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r1, [r2] + ldr r0, _08144EE0 + ldrh r0, [r0] + strh r0, [r1, 0x34] + b _08144F7C + .align 2, 0 +_08144ED8: .4byte 0x085b6348 +_08144EDC: .4byte 0x0203ab88 +_08144EE0: .4byte 0x085b7b1a +_08144EE4: + ldr r5, _08144F24 + ldr r3, [r5] + ldr r2, _08144F28 + ldrb r0, [r3, 0x1] + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3, 0x34] + ldrb r0, [r3, 0x1] + cmp r0, 0x12 + bhi _08144F06 + adds r0, 0x1 + strb r0, [r3, 0x1] +_08144F06: + ldr r3, [r5] + ldr r1, [r3, 0x38] + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08144F30 + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, _08144F2C + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0xA] + b _08144F42 + .align 2, 0 +_08144F24: .4byte 0x0203ab88 +_08144F28: .4byte 0x085b7b1a +_08144F2C: .4byte 0x085b6348 +_08144F30: + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, _08144F84 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0xA] + adds r0, 0xB4 +_08144F42: + cmp r2, r0 + bne _08144F7C + ldr r2, _08144F88 + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _08144F8C + str r1, [r0] + movs r0, 0x36 + ldrsh r1, [r4, 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, _08144F90 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3C] +_08144F7C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08144F84: .4byte 0x085b6348 +_08144F88: .4byte 0x02020630 +_08144F8C: .4byte sub_8144D94 + 1 +_08144F90: .4byte nullsub_12 + 1 + thumb_func_end sub_8144E60 + + thumb_func_start sub_8144F94 +sub_8144F94: @ 8144F94 + adds r0, 0x3E + ldrb r3, [r0] + lsls r1, r3, 29 + lsrs r1, 31 + movs r2, 0x1 + eors r2, r1 + lsls r2, 2 + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_8144F94 + + thumb_func_start sub_8144FB0 +sub_8144FB0: @ 8144FB0 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + ble _08144FC8 + subs r0, r2, 0x1 + strh r0, [r4, 0x22] + b _0814501C +_08144FC8: + ldr r0, _08145024 + str r0, [r4, 0x1C] + adds r2, r4, 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] + movs r0, 0x5E + bl m4aSongNumStop + adds r0, r4, 0 + bl obj_delete_and_free_tiles + ldr r5, _08145028 + ldr r4, _0814502C + ldr r0, [r4] + adds r0, 0x74 + 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 + ldr r0, [r4] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles +_0814501C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08145024: .4byte nullsub_12 + 1 +_08145028: .4byte 0x02020630 +_0814502C: .4byte 0x0203ab88 + thumb_func_end sub_8144FB0 + + thumb_func_start sub_8145030 +sub_8145030: @ 8145030 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _0814505A + subs r1, 0x1 + strh r1, [r4, 0x30] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + cmp r1, 0 + bne _081450C6 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081450C6 + b _08145080 +_0814505A: + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _08145090 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _081450C6 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _08145088 +_08145080: + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + b _081450C6 +_08145088: + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + b _081450C6 +_08145090: + movs r0, 0x2B + bl m4aSongNumStart + ldr r0, _081450CC + ldr r0, [r0] + ldr r0, [r0, 0x38] + ldrh r1, [r0, 0x2E] + adds r1, 0x4 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _081450D0 + str r0, [r4, 0x1C] + ldr r2, _081450D4 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2C + ldrb r2, [r0] + movs r1, 0x7F + ands r1, r2 + strb r1, [r0] +_081450C6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081450CC: .4byte 0x0203ab88 +_081450D0: .4byte sub_8144FB0 + 1 +_081450D4: .4byte 0x02020630 + thumb_func_end sub_8145030 + + thumb_func_start sub_81450D8 +sub_81450D8: @ 81450D8 + push {r4,r5,lr} + sub sp, 0x14 + adds r4, r0, 0 + ldr r1, _08145154 + mov r0, sp + movs r2, 0x2 + bl memcpy + add r5, sp, 0x4 + ldr r1, _08145158 + adds r0, r5, 0 + movs r2, 0x10 + bl memcpy + ldrh r0, [r4, 0x30] + subs r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0814516C + ldr r0, _0814515C + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r1, 0x2E + ldrsh r0, [r0, r1] + add r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _08145208 + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r4, 0x74 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + negs r4, r4 + ldr r0, _08145160 + ldr r5, _08145164 + lsls r4, 24 + asrs r4, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + ldr r0, _08145168 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + b _08145208 + .align 2, 0 +_08145154: .4byte 0x085b7b46 +_08145158: .4byte 0x085b7b48 +_0814515C: .4byte 0x0203ab88 +_08145160: .4byte 0x030075f0 +_08145164: .4byte 0x0000ffff +_08145168: .4byte 0x03007630 +_0814516C: + lsls r0, r1, 16 + cmp r0, 0 + blt _081451BC + ldr r0, _081451B8 + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r2, 0x2E + ldrsh r0, [r0, r2] + add r0, sp + movs r2, 0 + ldrsb r2, [r0, r2] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x7 + subs r0, r1, r0 + lsls r0, 1 + adds r0, r5, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r0, r2 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + movs r2, 0x30 + ldrsh r0, [r4, r2] + subs r1, r0 + lsls r1, 1 + mov r0, sp + adds r0, 0x5 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + b _08145208 + .align 2, 0 +_081451B8: .4byte 0x0203ab88 +_081451BC: + movs r0, 0x5E + bl m4aSongNumStartOrChange + ldr r0, _081451DC + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r2, 0x2E + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _081451E0 + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + bl cry_related + b _081451EC + .align 2, 0 +_081451DC: .4byte 0x0203ab88 +_081451E0: + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + negs r1, r1 + bl cry_related +_081451EC: + ldr r0, _08145210 + ldr r0, [r0] + ldr r0, [r0, 0x38] + ldrh r1, [r0, 0x2E] + adds r1, 0x2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + movs r0, 0x2D + strh r0, [r4, 0x30] + ldr r0, _08145214 + str r0, [r4, 0x1C] +_08145208: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08145210: .4byte 0x0203ab88 +_08145214: .4byte sub_8145030 + 1 + thumb_func_end sub_81450D8 + + thumb_func_start sub_8145218 +sub_8145218: @ 8145218 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, _08145278 + mov r0, sp + movs r2, 0x2 + bl memcpy + ldrh r0, [r4, 0x30] + subs r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + blt _08145284 + ldr r0, _0814527C + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r1, 0x2E + ldrsh r0, [r0, r1] + add r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldr r1, _08145280 + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + adds r2, 0x3E + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _08145288 + .align 2, 0 +_08145278: .4byte 0x085b7b46 +_0814527C: .4byte 0x0203ab88 +_08145280: .4byte 0x02020630 +_08145284: + ldr r0, _08145290 + str r0, [r4, 0x1C] +_08145288: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145290: .4byte sub_8144F94 + 1 + thumb_func_end sub_8145218 + + thumb_func_start sub_8145294 +sub_8145294: @ 8145294 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081452D0 + ldr r3, [r0] + ldr r1, [r3, 0x38] + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081452DC + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, _081452D4 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x12] + adds r0, 0x5A + cmp r2, r0 + bne _0814533E + ldr r2, _081452D8 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x34 + b _08145306 + .align 2, 0 +_081452D0: .4byte 0x0203ab88 +_081452D4: .4byte 0x085b6348 +_081452D8: .4byte 0x02020630 +_081452DC: + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, _08145344 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x14] + movs r1, 0x87 + lsls r1, 1 + adds r0, r1 + cmp r2, r0 + bne _0814533E + ldr r2, _08145348 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x2E +_08145306: + strh r3, [r0, 0x30] + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x30] + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _0814534C + str r1, [r0] + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _08145350 + str r1, [r0] + movs r0, 0x2B + bl m4aSongNumStart +_0814533E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145344: .4byte 0x085b6348 +_08145348: .4byte 0x02020630 +_0814534C: .4byte sub_8145218 + 1 +_08145350: .4byte sub_81450D8 + 1 + thumb_func_end sub_8145294 + + thumb_func_start sub_8145354 +sub_8145354: @ 8145354 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r0, 0 + mov r8, r0 + ldr r0, _08145378 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081453F8 + cmp r0, 0x1 + bgt _0814537C + cmp r0, 0 + beq _08145382 + b _0814544A + .align 2, 0 +_08145378: .4byte 0x030061ec +_0814537C: + cmp r0, 0x2 + beq _08145434 + b _0814544A +_08145382: + ldr r5, _081453EC + ldr r0, [r5] + cmp r0, 0 + bne _0814539E + movs r0, 0x1C + bl malloc_and_clear + str r0, [r5] + ldr r4, _081453F0 + adds r0, r7, 0 + movs r1, 0x7 + bl Window_GetField + str r0, [r4] +_0814539E: + ldr r1, [r5] + ldrh r0, [r6] + movs r2, 0 + strh r0, [r1, 0x14] + ldrb r0, [r6, 0x5] + strb r0, [r1, 0x16] + ldr r0, [r5] + strb r2, [r0, 0x1A] + ldr r0, [r5] + strb r2, [r0, 0x1B] + ldr r0, [r5] + strb r2, [r0, 0x10] + ldr r1, [r5] + movs r0, 0x1C + strb r0, [r1, 0x12] + ldr r0, [r5] + strb r2, [r0, 0x11] + ldrb r1, [r6, 0x4] + lsls r1, 19 + negs r1, r1 + asrs r1, 16 + adds r0, r7, 0 + movs r2, 0x1 + bl sub_8145824 + movs r4, 0 +_081453D2: + adds r0, r7, 0 + ldr r1, _081453F4 + movs r2, 0x20 + adds r3, r4, 0 + bl Window_CopyToPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xDF + bls _081453D2 + b _08145420 + .align 2, 0 +_081453EC: .4byte 0x0203ab90 +_081453F0: .4byte 0x0203ab94 +_081453F4: .4byte 0x085b8c10 +_081453F8: + movs r4, 0 + ldr r1, _0814542C + ldr r0, [r1] + ldrb r0, [r0, 0x16] + lsls r0, 3 + cmp r8, r0 + bge _08145420 + adds r5, r1, 0 +_08145408: + adds r0, r4, 0 + movs r1, 0 + bl sub_81456A8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [r5] + ldrb r0, [r0, 0x16] + lsls r0, 3 + cmp r4, r0 + blt _08145408 +_08145420: + ldr r1, _08145430 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0814544A + .align 2, 0 +_0814542C: .4byte 0x0203ab90 +_08145430: .4byte 0x030061ec +_08145434: + adds r0, r7, 0 + bl sub_8145814 + ldr r0, _08145458 + ldrb r1, [r6, 0x3] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x1 + mov r8, r0 +_0814544A: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08145458: .4byte 0x085b8bf0 + thumb_func_end sub_8145354 + + thumb_func_start sub_814545C +sub_814545C: @ 814545C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8145814 + adds r0, r4, 0 + bl sub_8145648 + ldr r2, _081454A0 + ldr r1, [r2] + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _0814547E + subs r0, 0x1 + strb r0, [r1, 0x1B] +_0814547E: + ldr r1, [r2] + ldrb r0, [r1, 0x1A] + cmp r0, 0 + beq _081454A4 + subs r0, 0x1 + strb r0, [r1, 0x1A] + ldr r1, [r2] + ldrb r0, [r1, 0x1A] + cmp r0, 0 + bne _081454A4 + ldrh r0, [r1, 0x18] + bl sub_8145588 + bl sub_814560C + b _0814552A + .align 2, 0 +_081454A0: .4byte 0x0203ab90 +_081454A4: + ldr r5, _081454B4 + ldr r0, [r5] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081454B8 + bl sub_814560C + b _0814552A + .align 2, 0 +_081454B4: .4byte 0x0203ab90 +_081454B8: + cmp r0, 0x1 + bne _081454C2 + bl sub_81455A8 + b _081454E6 +_081454C2: + cmp r0, 0x8 + bls _081454E6 + bl sub_80A36EC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081454DC + bl sub_814560C + ldr r0, [r5] + strb r4, [r0, 0x10] + b _0814552A +_081454DC: + bl sub_81455A8 + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x10] +_081454E6: + ldr r5, _08145530 + ldr r1, [r5] + ldrb r4, [r1, 0x10] + subs r4, 0x1 + lsls r4, 25 + lsrs r4, 24 + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r2, [r1, 0x11] + adds r0, r2 + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4 + ldrb r1, [r1] + bl sub_81456A8 + ldr r1, [r5] + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r2, [r1, 0x11] + adds r0, r2 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r4, 0x1 + adds r1, r4 + ldrb r1, [r1] + bl sub_81456A8 + ldr r1, [r5] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] +_0814552A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08145530: .4byte 0x0203ab90 + thumb_func_end sub_814545C + + thumb_func_start sub_8145534 +sub_8145534: @ 8145534 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r0, _08145574 + ldr r0, [r0, 0x4] + cmp r0, 0 + bge _08145582 + ldr r6, _08145578 + ldr r1, [r6] + ldrb r0, [r1, 0x1A] + cmp r0, 0 + bne _08145582 + ldrb r0, [r1, 0x1B] + cmp r0, 0 + bne _08145582 + movs r0, 0x4 + strb r0, [r1, 0x1B] + bl sub_80A36EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0814557C + bl sub_80A36B4 + ldr r1, [r6] + strh r4, [r1, 0x18] + movs r0, 0x2 + strb r0, [r1, 0x1A] + b _08145582 + .align 2, 0 +_08145574: .4byte 0x03007420 +_08145578: .4byte 0x0203ab90 +_0814557C: + adds r0, r5, 0 + bl sub_8145588 +_08145582: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8145534 + + thumb_func_start sub_8145588 +sub_8145588: @ 8145588 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + ldr r0, _081455A4 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x10] + pop {r0} + bx r0 + .align 2, 0 +_081455A4: .4byte 0x0203ab90 + thumb_func_end sub_8145588 + + thumb_func_start sub_81455A8 +sub_81455A8: @ 81455A8 + push {r4,lr} + ldr r3, _081455B8 + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0x1 + bgt _081455C0 + ldr r0, _081455BC + b _081455D8 + .align 2, 0 +_081455B8: .4byte 0x03002f50 +_081455BC: .4byte 0x030066d0 +_081455C0: + ldr r2, _08145604 + ldrb r1, [r2, 0xB] + movs r0, 0 + ldrsb r0, [r3, r0] + subs r0, 0x1 + subs r1, r0 + ldr r0, [r2, 0x10] + muls r0, r1 + movs r1, 0xD4 + lsls r1, 2 + adds r2, r1 + adds r0, r2 +_081455D8: + movs r1, 0xC6 + lsls r1, 3 + adds r3, r0, r1 + movs r2, 0 + ldr r4, _08145608 +_081455E2: + ldr r1, [r4] + adds r1, r2 + lsls r0, r2, 1 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _081455E2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145604: .4byte 0x03006380 +_08145608: .4byte 0x0203ab90 + thumb_func_end sub_81455A8 + + thumb_func_start sub_814560C +sub_814560C: @ 814560C + push {r4,lr} + ldr r4, _08145644 + ldr r1, [r4] + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r1, [r1, 0x11] + adds r0, r1 + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81456A8 + ldr r1, [r4] + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r1, [r1, 0x11] + adds r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81456A8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145644: .4byte 0x0203ab90 + thumb_func_end sub_814560C + + thumb_func_start sub_8145648 +sub_8145648: @ 8145648 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _081456A0 + ldr r0, [r4] + ldrb r1, [r0, 0x11] + adds r0, r6, 0 + movs r2, 0 + bl sub_8145824 + ldr r1, [r4] + ldrb r0, [r1, 0x11] + adds r0, 0x2 + strb r0, [r1, 0x11] + ldr r1, [r4] + ldrb r0, [r1, 0x11] + lsrs r0, 3 + ldrb r1, [r1, 0x16] + adds r1, r0, r1 + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0814567E: + lsls r3, r4, 5 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + ldr r1, _081456A4 + movs r2, 0x20 + bl Window_CopyToPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _0814567E + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081456A0: .4byte 0x0203ab90 +_081456A4: .4byte 0x085b8c10 + thumb_func_end sub_8145648 + + thumb_func_start sub_81456A8 +sub_81456A8: @ 81456A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r7, r0, 24 + lsrs r4, r7, 24 + lsls r1, 24 + movs r0, 0xFE + lsls r0, 23 + adds r1, r0 + lsrs r1, 16 + adds r0, r1, 0 + bl __floatsidf + ldr r3, _08145768 + ldr r2, _08145764 + bl __divdf3 + bl __fixunsdfsi + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x37 + bls _081456DE + movs r5, 0x37 +_081456DE: + str r5, [sp] + movs r6, 0x1 + ands r6, r4 + ldr r0, _0814576C + ldr r1, [r0] + lsrs r7, 27 + mov r8, r7 + ldr r0, _08145770 + ldrb r1, [r1, 0x12] + cmp r5, r1 + bls _08145780 + ldr r3, _08145774 + adds r0, r6, r0 + ldrb r0, [r0] + mov r9, r0 + movs r7, 0x7 + ands r7, r4 +_08145700: + lsls r1, r5, 1 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 4 + adds r1, r0 + ldr r2, _08145778 + adds r1, r2 + mov r4, r8 + lsls r0, r4, 5 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r3] + adds r1, r2 + ldrb r0, [r1] + mov r4, r9 + ands r0, r4 + strb r0, [r1] + ldr r4, [r3] + adds r4, r2 + adds r0, r5, 0 + movs r1, 0x3 + str r3, [sp, 0x4] + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + movs r1, 0xF + ands r0, r1 + lsls r1, r6, 4 + adds r0, r1 + ldr r1, _0814577C + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + orrs r1, r0 + strb r1, [r4] + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _0814576C + ldr r0, [r2] + ldr r3, [sp, 0x4] + ldrb r0, [r0, 0x12] + cmp r5, r0 + bhi _08145700 + b _081457EA + .align 2, 0 +_08145764: .4byte 0x40920000 +_08145768: .4byte 0x00000000 +_0814576C: .4byte 0x0203ab90 +_08145770: .4byte 0x085b8c30 +_08145774: .4byte 0x0203ab94 +_08145778: .4byte 0x085b8770 +_0814577C: .4byte 0x085b8c32 +_08145780: + lsls r3, r6, 4 + mov r10, r3 + ldr r7, _08145804 + adds r0, r6, r0 + ldrb r0, [r0] + mov r9, r0 + movs r6, 0x7 + ands r6, r4 +_08145790: + lsls r1, r5, 1 + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 4 + adds r1, r0 + ldr r4, _08145808 + adds r1, r4 + mov r2, r8 + lsls r0, r2, 5 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r7] + adds r1, r2 + ldrb r0, [r1] + mov r3, r9 + ands r0, r3 + strb r0, [r1] + ldr r4, [r7] + adds r4, r2 + adds r0, r5, 0 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + movs r1, 0xF + ands r0, r1 + add r0, r10 + ldr r1, _0814580C + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + orrs r1, r0 + strb r1, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _08145810 + ldr r0, [r2] + ldrb r0, [r0, 0x12] + cmp r5, r0 + bcc _08145790 +_081457EA: + ldr r3, _08145810 + ldr r0, [r3] + mov r4, sp + ldrb r4, [r4] + strb r4, [r0, 0x12] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08145804: .4byte 0x0203ab94 +_08145808: .4byte 0x085b8770 +_0814580C: .4byte 0x085b8c32 +_08145810: .4byte 0x0203ab90 + thumb_func_end sub_81456A8 + + thumb_func_start sub_8145814 +sub_8145814: @ 8145814 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_8145814 + + thumb_func_start sub_8145824 +sub_8145824: @ 8145824 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + cmp r2, 0 + bne _08145848 + movs r1, 0 + bl Window_GetField + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 16 + asrs r1, 8 + movs r2, 0 + bl bg_change_x_offset +_08145848: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8145824 + + thumb_func_start sub_8145850 +sub_8145850: @ 8145850 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r0, 0 + mov r8, r0 + ldr r6, _08145870 + ldrb r0, [r6] + cmp r0, 0 + beq _08145874 + cmp r0, 0x1 + beq _081458B0 + b _081458F8 + .align 2, 0 +_08145870: .4byte 0x030061ec +_08145874: + ldr r5, _081458A4 + ldr r0, [r5] + cmp r0, 0 + bne _08145884 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r5] +_08145884: + ldr r1, _081458A8 + adds r0, r7, 0 + movs r2, 0 + movs r3, 0 + bl Window_CopyToPixels + ldr r0, _081458AC + ldrb r1, [r4, 0x3] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _081458F8 + .align 2, 0 +_081458A4: .4byte 0x0203ab98 +_081458A8: .4byte 0x085b8438 +_081458AC: .4byte 0x085b8418 +_081458B0: + ldr r0, _08145904 + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _08145908 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0814590C + ldrb r1, [r4, 0x4] + lsls r1, 19 + movs r2, 0xA0 + lsls r2, 14 + adds r1, r2 + asrs r1, 16 + ldrb r2, [r4, 0x5] + lsls r2, 19 + movs r3, 0xE0 + lsls r3, 14 + adds r2, r3 + asrs r2, 16 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r2, _08145910 + ldr r3, [r2] + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + strh r0, [r3, 0x4] + movs r1, 0x20 + strb r1, [r3] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + strb r4, [r0, 0x2] + movs r0, 0x1 + mov r8, r0 +_081458F8: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08145904: .4byte 0x085b8c80 +_08145908: .4byte 0x085b8c90 +_0814590C: .4byte 0x085b8c68 +_08145910: .4byte 0x0203ab98 + thumb_func_end sub_8145850 + + thumb_func_start sub_8145914 +sub_8145914: @ 8145914 + push {r4-r6,lr} + ldr r4, _08145960 + ldr r6, _08145964 + ldr r0, [r6] + ldrh r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + bl gpu_pal_tag_by_index + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_free_tag + ldr r0, [r6] + ldrh r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r4, _08145968 + ldr r0, [r4] + bl free + movs r5, 0 + str r5, [r4] + ldr r0, [r6] + bl free + str r5, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08145960: .4byte 0x02020630 +_08145964: .4byte 0x0203ab98 +_08145968: .4byte 0x0203ab90 + thumb_func_end sub_8145914 + + thumb_func_start sub_814596C +sub_814596C: @ 814596C + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r0, 0 + ldr r3, _081459B4 + ldr r4, _081459B8 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r2, [r4] + ldrh r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x6] + ldr r0, _081459BC + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0x2 + beq _081459E8 + cmp r1, 0x2 + bgt _081459C0 + cmp r1, 0 + beq _081459C6 + b _08145A2E + .align 2, 0 +_081459B4: .4byte 0x02020630 +_081459B8: .4byte 0x0203ab98 +_081459BC: .4byte 0x0203ab90 +_081459C0: + cmp r1, 0x6 + beq _08145A20 + b _08145A2E +_081459C6: + movs r0, 0x20 + strb r0, [r2, 0x1] + ldr r1, [r4] + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _081459E2 + ldrb r0, [r1, 0x2] + add r4, sp, 0xC + cmp r0, 0x1 + beq _08145A30 + subs r0, 0x1 + strb r0, [r1, 0x2] + b _08145A30 +_081459E2: + movs r0, 0x5 + strb r0, [r1, 0x2] + b _08145A2E +_081459E8: + movs r3, 0 + movs r2, 0 + add r4, sp, 0xC + adds r5, r0, 0 +_081459F0: + lsls r1, r3, 24 + asrs r1, 24 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r1, r0 + bge _081459FE + adds r3, r0, 0 +_081459FE: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081459F0 + lsls r0, r3, 24 + asrs r0, 24 + movs r1, 0xD0 + muls r0, r1 + cmp r0, 0 + bge _08145A16 + adds r0, 0xFF +_08145A16: + lsls r0, 16 + asrs r0, 24 + bl sub_8145B24 + b _08145A30 +_08145A20: + ldrb r1, [r0, 0xA] + movs r0, 0xD0 + muls r0, r1 + lsls r0, 16 + asrs r0, 24 + bl sub_8145B24 +_08145A2E: + add r4, sp, 0xC +_08145A30: + ldr r0, _08145A60 + ldr r2, [r0] + ldrb r5, [r2] + movs r1, 0 + ldrsb r1, [r2, r1] + movs r3, 0x1 + ldrsb r3, [r2, r3] + adds r6, r0, 0 + cmp r1, r3 + beq _08145A82 + cmp r1, r3 + bge _08145A64 + ldrb r0, [r2, 0x2] + adds r0, r5, r0 + strb r0, [r2] + ldr r2, [r6] + movs r1, 0 + ldrsb r1, [r2, r1] + ldrb r3, [r2, 0x1] + movs r0, 0x1 + ldrsb r0, [r2, r0] + cmp r1, r0 + ble _08145A82 + b _08145A7A + .align 2, 0 +_08145A60: .4byte 0x0203ab98 +_08145A64: + ldrb r0, [r2, 0x2] + subs r0, r5, r0 + strb r0, [r2] + ldr r2, [r6] + movs r1, 0 + ldrsb r1, [r2, r1] + ldrb r3, [r2, 0x1] + movs r0, 0x1 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08145A82 +_08145A7A: + strb r3, [r2] + ldr r1, [r6] + movs r0, 0 + strb r0, [r1, 0x1] +_08145A82: + ldr r2, _08145B18 + ldr r0, [sp, 0x4] + ands r0, r2 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldr r1, _08145B1C + ands r0, r1 + movs r1, 0x80 + lsls r1, 17 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r0, [r6] + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r1, 24 + lsrs r1, 16 + ldr r0, [sp, 0x8] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl _082E709C + add r0, sp, 0xC + ldrh r1, [r0] + ldrh r2, [r4, 0x2] + ldrh r3, [r4, 0x4] + ldrh r0, [r4, 0x6] + str r0, [sp] + movs r0, 0 + bl rotscale_set_direct + ldr r2, _08145B20 + ldr r0, [r6] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, 0x7F + movs r1, 0xFF + ands r0, r1 + lsls r1, r0, 1 + adds r1, r2 + adds r0, 0x40 + lsls r0, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0 + ldrsh r1, [r1, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _08145AF6 + adds r0, 0xFF +_08145AF6: + asrs r0, 8 + strh r0, [r7, 0x24] + lsls r1, r2, 16 + asrs r1, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _08145B0A + adds r0, 0xFF +_08145B0A: + asrs r0, 8 + strh r0, [r7, 0x26] + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08145B18: .4byte 0xffff0000 +_08145B1C: .4byte 0x0000ffff +_08145B20: .4byte 0x08329f40 + thumb_func_end sub_814596C + + thumb_func_start sub_8145B24 +sub_8145B24: @ 8145B24 + push {lr} + lsls r0, 24 + asrs r0, 24 + movs r1, 0x20 + subs r2, r1, r0 + movs r0, 0xFF + ands r2, r0 + adds r0, r2, 0 + subs r0, 0x21 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBE + bhi _08145B40 + movs r2, 0xE0 +_08145B40: + ldr r1, _08145B50 + ldr r0, [r1] + strb r2, [r0, 0x1] + ldr r1, [r1] + movs r0, 0x5 + strb r0, [r1, 0x2] + pop {r0} + bx r0 + .align 2, 0 +_08145B50: .4byte 0x0203ab98 + thumb_func_end sub_8145B24 + + thumb_func_start sub_8145B54 +sub_8145B54: @ 8145B54 + push {r4,lr} + sub sp, 0xC + adds r1, r0, 0 + ldr r0, _08145B9C + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _08145BA0 + ldr r1, _08145BA4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl sub_81DB368 + adds r3, r0, 0 + ldr r0, _08145BA8 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145B9C: .4byte 0x02021cc4 +_08145BA0: .4byte 0x02021fc4 +_08145BA4: .4byte 0x085e8dab +_08145BA8: .4byte 0x0203ab9c + thumb_func_end sub_8145B54 + + thumb_func_start sub_8145BAC +sub_8145BAC: @ 8145BAC + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, _08145C0C + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + bl rbox_template_set + ldr r4, _08145C10 + add r0, sp, 0x10 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + adds r0, r5, 0 + bl sub_8145B54 + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08145C0C: .4byte 0x00000141 +_08145C10: .4byte 0x0203ab9c + thumb_func_end sub_8145BAC + + thumb_func_start sub_8145C14 +sub_8145C14: @ 8145C14 + push {r4,lr} + ldr r4, _08145C2C + ldrb r0, [r4] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145C2C: .4byte 0x0203ab9c + thumb_func_end sub_8145C14 + + thumb_func_start sub_8145C30 +sub_8145C30: @ 8145C30 + ldr r0, _08145C4C + ldr r1, [r0] + ldr r0, _08145C50 + adds r1, r0 + ldr r0, _08145C54 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + ldrh r1, [r1] + eors r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .align 2, 0 +_08145C4C: .4byte 0x03005d8c +_08145C50: .4byte 0x00000494 +_08145C54: .4byte 0x03005d90 + thumb_func_end sub_8145C30 + + thumb_func_start sub_8145C58 +sub_8145C58: @ 8145C58 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08145C74 + ldr r2, [r1] + ldr r1, _08145C78 + ldr r1, [r1] + adds r1, 0xAC + ldr r1, [r1] + eors r0, r1 + ldr r1, _08145C7C + adds r2, r1 + strh r0, [r2] + bx lr + .align 2, 0 +_08145C74: .4byte 0x03005d8c +_08145C78: .4byte 0x03005d90 +_08145C7C: .4byte 0x00000494 + thumb_func_end sub_8145C58 + + thumb_func_start sub_8145C80 +sub_8145C80: @ 8145C80 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_8145C30 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08145C98 + cmp r1, r0 + bls _08145C9C + movs r0, 0 + b _08145CC0 + .align 2, 0 +_08145C98: .4byte 0x0000270e +_08145C9C: + adds r0, r1, r4 + cmp r1, r0 + ble _08145CAC + ldr r0, _08145CA8 + b _08145CBA + .align 2, 0 +_08145CA8: .4byte 0x0000270f +_08145CAC: + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08145CC8 + cmp r1, r0 + bls _08145CB8 + adds r1, r0, 0 +_08145CB8: + adds r0, r1, 0 +_08145CBA: + bl sub_8145C58 + movs r0, 0x1 +_08145CC0: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08145CC8: .4byte 0x0000270f + thumb_func_end sub_8145C80 + + thumb_func_start sub_8145CCC +sub_8145CCC: @ 8145CCC + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_8145C30 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcs _08145CE2 + movs r0, 0 + b _08145CEE +_08145CE2: + subs r0, r4 + lsls r0, 16 + lsrs r0, 16 + bl sub_8145C58 + movs r0, 0x1 +_08145CEE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8145CCC + + thumb_func_start sub_8145CF4 +sub_8145CF4: @ 8145CF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + bl sub_8145D48 + adds r4, r0, 0 + cmp r4, 0 + bne _08145D10 +_08145D0C: + movs r0, 0 + b _08145D42 +_08145D10: + ldr r6, _08145D14 + b _08145D26 + .align 2, 0 +_08145D14: .4byte 0x0000ffff +_08145D18: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08145D1E: + adds r4, 0x4 + ldr r0, [r4] + cmp r0, 0 + beq _08145D0C +_08145D26: + ldr r1, [r4] + ldrh r0, [r1, 0x4] + cmp r0, r6 + beq _08145D3A + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08145D1E +_08145D3A: + cmp r5, 0 + bne _08145D18 + ldr r0, [r4] + ldr r0, [r0] +_08145D42: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8145CF4 + + thumb_func_start sub_8145D48 +sub_8145D48: @ 8145D48 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r2, 0 + ldr r0, _08145D8C + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xD5 + beq _08145DB8 + adds r1, r4, 0 +_08145D60: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, r3 + bhi _08145DB8 + cmp r0, r3 + beq _08145D7E + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xD5 + bne _08145D60 +_08145D7E: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xD5 + bne _08145D98 + b _08145DB8 + .align 2, 0 +_08145D8C: .4byte 0x085b91b8 +_08145D90: + adds r0, r4, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + b _08145DBA +_08145D98: + cmp r0, r3 + bne _08145DB8 + ldr r5, _08145DC0 +_08145D9E: + lsls r1, r2, 3 + adds r0, r1, r5 + ldrb r0, [r0, 0x1] + cmp r0, r6 + beq _08145D90 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _08145D9E +_08145DB8: + movs r0, 0 +_08145DBA: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08145DC0: .4byte 0x085b91b8 + thumb_func_end sub_8145D48 + + thumb_func_start hm_prepare_rocksmash +hm_prepare_rocksmash: @ 8145DC4 + push {r4,lr} + movs r0, 0x57 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08145DD8 + movs r0, 0 + b _08145DF2 +_08145DD8: + ldr r4, _08145DF8 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, _08145DFC + ldr r0, _08145E00 + str r0, [r1] + ldr r1, _08145E04 + ldr r0, _08145E08 + str r0, [r1] + movs r0, 0x1 +_08145DF2: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08145DF8: .4byte 0x020375f0 +_08145DFC: .4byte 0x03005db0 +_08145E00: .4byte hm_add_c3_launch_phase_2 + 1 +_08145E04: .4byte 0x0203ceec +_08145E08: .4byte sub_8145E0C + 1 + thumb_func_end hm_prepare_rocksmash + + thumb_func_start sub_8145E0C +sub_8145E0C: @ 8145E0C + push {lr} + bl brm_get_pokemon_selection + ldr r1, _08145E24 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, _08145E28 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_08145E24: .4byte 0x02038c08 +_08145E28: .4byte 0x082908fd + thumb_func_end sub_8145E0C + + thumb_func_start sub_8145E2C +sub_8145E2C: @ 8145E2C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08145E60 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _08145E64 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + ldr r0, _08145E68 + ldr r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08145E6C + adds r0, r1 + ldr r1, _08145E70 + bl sub_81B1B44 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08145E60: .4byte 0x03005e00 +_08145E64: .4byte sub_8145E74 + 1 +_08145E68: .4byte 0x02038c08 +_08145E6C: .4byte 0x020244ec +_08145E70: .4byte 0x02021cc4 + thumb_func_end sub_8145E2C + + thumb_func_start sub_8145E74 +sub_8145E74: @ 8145E74 + push {lr} + movs r0, 0x28 + bl oe_active_list_remove + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_8145E74 + + thumb_func_start sub_8145E84 +sub_8145E84: @ 8145E84 + push {r4,lr} + ldr r4, _08145E94 + ldrb r0, [r4] + cmp r0, 0 + beq _08145E98 + cmp r0, 0x1 + beq _08145EAC + b _08145EC0 + .align 2, 0 +_08145E94: .4byte 0x0300120b +_08145E98: + ldr r0, _08145EA8 + ldrb r0, [r0] + bl sub_8145F6C + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08145EC0 + .align 2, 0 +_08145EA8: .4byte 0x0300120a +_08145EAC: + bl sub_8145F20 + lsls r0, 24 + cmp r0, 0 + beq _08145EC0 + movs r0, 0 + strb r0, [r4] + ldr r0, _08145ED8 + bl set_callback2 +_08145EC0: + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145ED8: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_8145E84 + + thumb_func_start sub_8145EDC +sub_8145EDC: @ 8145EDC + push {lr} + ldr r1, _08145EEC + strb r0, [r1] + ldr r0, _08145EF0 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08145EEC: .4byte 0x0300120a +_08145EF0: .4byte sub_8145E84 + 1 + thumb_func_end sub_8145EDC + + thumb_func_start sub_8145EF4 +sub_8145EF4: @ 8145EF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08145F08 + ldr r1, _08145F0C + str r1, [r2, 0x4] + bl sub_8145F6C + pop {r0} + bx r0 + .align 2, 0 +_08145F08: .4byte 0x030022c0 +_08145F0C: .4byte sub_8085E50 + 1 + thumb_func_end sub_8145EF4 + + thumb_func_start sub_8145F10 +sub_8145F10: @ 8145F10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8145F6C + pop {r0} + bx r0 + thumb_func_end sub_8145F10 + + thumb_func_start sub_8145F20 +sub_8145F20: @ 8145F20 + push {r4,lr} + ldr r0, _08145F44 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08145F48 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08145F4C + movs r0, 0 + b _08145F60 + .align 2, 0 +_08145F44: .4byte sub_8145FA8 + 1 +_08145F48: .4byte 0x03005e00 +_08145F4C: + adds r0, r2, 0 + bl remove_task + ldr r4, _08145F68 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + movs r0, 0x1 +_08145F60: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08145F68: .4byte 0x0203aba0 + thumb_func_end sub_8145F20 + + thumb_func_start sub_8145F6C +sub_8145F6C: @ 8145F6C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08145F9C + movs r1, 0x2 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08145FA0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + ldr r4, _08145FA4 + movs r0, 0x3C + bl malloc_and_clear + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08145F9C: .4byte sub_8145FA8 + 1 +_08145FA0: .4byte 0x03005e00 +_08145FA4: .4byte 0x0203aba0 + thumb_func_end sub_8145F6C + + thumb_func_start sub_8145FA8 +sub_8145FA8: @ 8145FA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08145FD8 + ldr r2, _08145FDC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08145FBA: + 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 _08145FBA + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08145FD8: .4byte 0x085c8a98 +_08145FDC: .4byte 0x03005e00 + thumb_func_end sub_8145FA8 + + thumb_func_start sub_8145FE0 +sub_8145FE0: @ 8145FE0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80AC3D0 + ldr r0, _0814600C + ldr r1, _08146010 + ldr r2, _08146014 + bl CpuSet + ldr r1, _08146018 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0814601C + movs r0, 0x2 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _0814602A + .align 2, 0 +_0814600C: .4byte 0x02037b14 +_08146010: .4byte 0x02037714 +_08146014: .4byte 0x04000100 +_08146018: .4byte 0x085c8948 +_0814601C: + movs r1, 0x4 + bl AddTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 +_0814602A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8145FE0 + + thumb_func_start sub_8146030 +sub_8146030: @ 8146030 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08146050 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08146054 + movs r0, 0 + b _0814605C + .align 2, 0 +_08146050: .4byte 0x085c8948 +_08146054: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 +_0814605C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8146030 + + thumb_func_start sub_8146064 +sub_8146064: @ 8146064 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08146088 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl AddTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146088: .4byte 0x085c89f0 + thumb_func_end sub_8146064 + + thumb_func_start sub_814608C +sub_814608C: @ 814608C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + strh r0, [r4, 0x26] + ldr r1, _081460B8 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _081460B0 + movs r0, 0x1 + strh r0, [r4, 0x26] +_081460B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081460B8: .4byte 0x085c89f0 + thumb_func_end sub_814608C + + thumb_func_start sub_81460BC +sub_81460BC: @ 81460BC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, _081460F0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081460F4 + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_8149D78 + b _08146104 + .align 2, 0 +_081460F0: .4byte 0x03005e00 +_081460F4: + bl sub_8149DDC + lsls r0, 24 + cmp r0, 0 + beq _08146104 + adds r0, r4, 0 + bl remove_task +_08146104: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81460BC + + thumb_func_start sub_814610C +sub_814610C: @ 814610C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814613C + ldr r2, _08146140 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814611E: + 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 _0814611E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814613C: .4byte 0x085c8aa8 +_08146140: .4byte 0x03005e00 + thumb_func_end sub_814610C + + thumb_func_start sub_8146144 +sub_8146144: @ 8146144 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0x40 + bl lcd_io_set_bits + movs r0, 0xC + movs r1, 0x40 + bl lcd_io_set_bits + movs r0, 0xE + movs r1, 0x40 + bl lcd_io_set_bits + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8146144 + + thumb_func_start sub_8146178 +sub_8146178: @ 8146178 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r2, [r4, r1] + cmp r2, 0 + beq _0814618E + subs r0, 0x1 + strh r0, [r4, 0xA] + b _081461CE +_0814618E: + movs r0, 0x4 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081461B0 + movs r1, 0x1 + negs r1, r1 + str r2, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_081461B0: + ldrh r1, [r4, 0xC] + movs r0, 0xF + ands r0, r1 + lsls r1, r0, 4 + orrs r1, r0 + movs r0, 0x4C + bl lcd_io_set + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0xE + ble _081461CE + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081461CE: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8146178 + + thumb_func_start sub_81461D8 +sub_81461D8: @ 81461D8 + push {lr} + ldr r0, _081461FC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081461F4 + ldr r0, _08146200 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081461F4: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081461FC: .4byte 0x02037fd4 +_08146200: .4byte sub_814610C + 1 + thumb_func_end sub_81461D8 + + thumb_func_start sub_8146204 +sub_8146204: @ 8146204 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08146234 + ldr r2, _08146238 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146216: + 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 _08146216 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08146234: .4byte 0x085c8ab4 +_08146238: .4byte 0x03005e00 + thumb_func_end sub_8146204 + + thumb_func_start sub_814623C +sub_814623C: @ 814623C + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08146298 + ldr r1, _0814629C + ldr r1, [r1] + movs r2, 0x14 + ldrsh r1, [r1, r2] + str r4, [sp] + movs r2, 0xA0 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0x2 + bl sub_8149F98 + ldr r0, _081462A0 + bl SetVBlankCallback + ldr r0, _081462A4 + bl SetHBlankCallback + movs r0, 0x3 + bl enable_irqs + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146298: .4byte 0x020393a8 +_0814629C: .4byte 0x0203aba0 +_081462A0: .4byte sub_8146320 + 1 +_081462A4: .4byte sub_8146358 + 1 + thumb_func_end sub_814623C + + thumb_func_start sub_81462A8 +sub_81462A8: @ 81462A8 + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, _08146310 + ldr r2, [r4] + ldrb r1, [r2] + movs r1, 0 + strb r1, [r2] + ldrh r1, [r0, 0xA] + adds r1, 0x4 + strh r1, [r0, 0xA] + ldrh r1, [r0, 0xC] + adds r1, 0x8 + strh r1, [r0, 0xC] + ldr r3, _08146314 + ldr r1, [r4] + movs r2, 0x14 + ldrsh r1, [r1, r2] + movs r5, 0xA + ldrsh r2, [r0, r5] + movs r5, 0xC + ldrsh r0, [r0, r5] + str r0, [sp] + movs r0, 0xA0 + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r3, 0x2 + bl sub_8149F98 + ldr r0, _08146318 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081462FA + ldr r0, _0814631C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081462FA: + ldr r0, [r4] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146310: .4byte 0x0203aba0 +_08146314: .4byte 0x02038c28 +_08146318: .4byte 0x02037fd4 +_0814631C: .4byte sub_8146204 + 1 + thumb_func_end sub_81462A8 + + thumb_func_start sub_8146320 +sub_8146320: @ 8146320 + push {lr} + bl sub_8149F2C + ldr r0, _08146348 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _08146344 + ldr r1, _0814634C + ldr r0, _08146350 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _08146354 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08146344: + pop {r0} + bx r0 + .align 2, 0 +_08146348: .4byte 0x0203aba0 +_0814634C: .4byte 0x040000d4 +_08146350: .4byte 0x02038c28 +_08146354: .4byte 0x800000a0 + thumb_func_end sub_8146320 + + thumb_func_start sub_8146358 +sub_8146358: @ 8146358 + ldr r1, _08146378 + ldr r0, _0814637C + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _08146380 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + bx lr + .align 2, 0 +_08146378: .4byte 0x02038c28 +_0814637C: .4byte 0x04000006 +_08146380: .4byte 0x04000014 + thumb_func_end sub_8146358 + + thumb_func_start sub_8146384 +sub_8146384: @ 8146384 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _081463B4 + ldr r2, _081463B8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146396: + 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 _08146396 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081463B4: .4byte 0x085c8abc +_081463B8: .4byte 0x03005e00 + thumb_func_end sub_8146384 + + thumb_func_start sub_81463BC +sub_81463BC: @ 81463BC + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08146410 + ldr r1, [r0] + ldr r0, _08146414 + movs r2, 0x16 + ldrsh r1, [r1, r2] + movs r2, 0xA0 + lsls r2, 1 + bl memset + ldr r0, _08146418 + bl SetVBlankCallback + ldr r0, _0814641C + bl SetHBlankCallback + movs r0, 0x3 + bl enable_irqs + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146410: .4byte 0x0203aba0 +_08146414: .4byte 0x020393a8 +_08146418: .4byte sub_81464B0 + 1 +_0814641C: .4byte sub_81464E8 + 1 + thumb_func_end sub_81463BC + + thumb_func_start sub_8146420 +sub_8146420: @ 8146420 + push {r4-r7,lr} + ldr r1, _081464A0 + ldr r2, [r1] + ldrb r1, [r2] + movs r1, 0 + strb r1, [r2] + ldrh r4, [r0, 0xA] + ldrh r2, [r0, 0xC] + lsls r3, r2, 16 + asrs r3, 24 + movs r5, 0x84 + lsls r5, 5 + adds r1, r4, r5 + strh r1, [r0, 0xA] + movs r1, 0xC0 + lsls r1, 1 + adds r2, r1 + strh r2, [r0, 0xC] + movs r5, 0 + lsls r7, r3, 16 +_08146448: + lsrs r0, r4, 8 + asrs r1, r7, 16 + bl sine + ldr r1, _081464A4 + lsls r2, r5, 1 + adds r2, r1 + ldr r6, _081464A0 + ldr r1, [r6] + ldrh r1, [r1, 0x16] + adds r0, r1 + strh r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x84 + lsls r1, 5 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x9F + bls _08146448 + ldr r0, _081464A8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814648E + ldr r0, _081464AC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0814648E: + ldr r0, [r6] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081464A0: .4byte 0x0203aba0 +_081464A4: .4byte 0x02038c28 +_081464A8: .4byte 0x02037fd4 +_081464AC: .4byte sub_8146384 + 1 + thumb_func_end sub_8146420 + + thumb_func_start sub_81464B0 +sub_81464B0: @ 81464B0 + push {lr} + bl sub_8149F2C + ldr r0, _081464D8 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _081464D4 + ldr r1, _081464DC + ldr r0, _081464E0 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _081464E4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081464D4: + pop {r0} + bx r0 + .align 2, 0 +_081464D8: .4byte 0x0203aba0 +_081464DC: .4byte 0x040000d4 +_081464E0: .4byte 0x02038c28 +_081464E4: .4byte 0x800000a0 + thumb_func_end sub_81464B0 + + thumb_func_start sub_81464E8 +sub_81464E8: @ 81464E8 + ldr r1, _08146508 + ldr r0, _0814650C + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _08146510 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + bx lr + .align 2, 0 +_08146508: .4byte 0x02038c28 +_0814650C: .4byte 0x04000006 +_08146510: .4byte 0x04000016 + thumb_func_end sub_81464E8 + + thumb_func_start sub_8146514 +sub_8146514: @ 8146514 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08146544 + ldr r2, _08146548 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146526: + 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 _08146526 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08146544: .4byte 0x085c8afc +_08146548: .4byte 0x03005e00 + thumb_func_end sub_8146514 + + thumb_func_start sub_814654C +sub_814654C: @ 814654C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814657C + ldr r2, _08146580 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814655E: + 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 _0814655E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814657C: .4byte 0x085c8ac4 +_08146580: .4byte 0x03005e00 + thumb_func_end sub_814654C + + thumb_func_start sub_8146584 +sub_8146584: @ 8146584 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _081465B4 + ldr r2, _081465B8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146596: + 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 _08146596 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081465B4: .4byte 0x085c8ae0 +_081465B8: .4byte 0x03005e00 + thumb_func_end sub_8146584 + + thumb_func_start sub_81465BC +sub_81465BC: @ 81465BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _081465EC + ldr r2, _081465F0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081465CE: + 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 _081465CE + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081465EC: .4byte 0x085c8b14 +_081465F0: .4byte 0x03005e00 + thumb_func_end sub_81465BC + + thumb_func_start sub_81465F4 +sub_81465F4: @ 81465F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08146624 + ldr r2, _08146628 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146606: + 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 _08146606 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08146624: .4byte 0x085c8b2c +_08146628: .4byte 0x03005e00 + thumb_func_end sub_81465F4 + + thumb_func_start sub_814662C +sub_814662C: @ 814662C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814665C + ldr r2, _08146660 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814663E: + 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 _0814663E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814665C: .4byte 0x085c8b44 +_08146660: .4byte 0x03005e00 + thumb_func_end sub_814662C + + thumb_func_start sub_8146664 +sub_8146664: @ 8146664 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08146694 + ldr r2, _08146698 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146676: + 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 _08146676 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08146694: .4byte 0x085c8b5c +_08146698: .4byte 0x03005e00 + thumb_func_end sub_8146664 + + thumb_func_start sub_814669C +sub_814669C: @ 814669C + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r1, 0 + movs r0, 0x10 + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] + strh r1, [r4, 0x10] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r4, 0x12] + ldr r0, _081466F8 + ldr r2, [r0] + movs r0, 0x3F + strh r0, [r2, 0x2] + strh r1, [r2, 0x4] + movs r0, 0xF0 + strh r0, [r2, 0x6] + movs r0, 0xA0 + strh r0, [r2, 0x8] + ldr r0, _081466FC + strh r0, [r2, 0xE] + ldrh r0, [r4, 0xA] + lsls r0, 8 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r2, 0x10] + ldr r0, _08146700 + movs r2, 0xF0 + movs r1, 0x9F + ldr r3, _08146704 + adds r0, r3 +_081466E2: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081466E2 + ldr r0, _08146708 + bl SetVBlankCallback + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081466F8: .4byte 0x0203aba0 +_081466FC: .4byte 0x00003f41 +_08146700: .4byte 0x02038c28 +_08146704: .4byte 0x000008be +_08146708: .4byte sub_8146F3C + 1 + thumb_func_end sub_814669C + + thumb_func_start sub_814670C +sub_814670C: @ 814670C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x3C + strh r0, [r4, 0x18] + adds r0, r4, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, _08146754 + bl CpuSet + ldr r0, _08146758 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _0814675C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146754: .4byte 0x01000400 +_08146758: .4byte 0x085baed0 +_0814675C: .4byte 0x085baeb0 + thumb_func_end sub_814670C + + thumb_func_start sub_8146760 +sub_8146760: @ 8146760 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x3C + strh r0, [r4, 0x18] + adds r0, r4, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, _081467A8 + bl CpuSet + ldr r0, _081467AC + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _081467B0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081467A8: .4byte 0x01000400 +_081467AC: .4byte 0x085bb4a4 +_081467B0: .4byte 0x085baeb0 + thumb_func_end sub_8146760 + + thumb_func_start sub_81467B4 +sub_81467B4: @ 81467B4 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x3C + strh r0, [r4, 0x18] + adds r0, r4, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, _081467F8 + bl CpuSet + ldr r0, _081467FC + ldr r1, [sp, 0x8] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081467F8: .4byte 0x01000400 +_081467FC: .4byte 0x085bbc14 + thumb_func_end sub_81467B4 + + thumb_func_start sub_8146800 +sub_8146800: @ 8146800 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _08146848 + mov r0, sp + bl CpuSet + ldr r0, _0814684C + ldr r1, [sp, 0x8] + movs r2, 0xB0 + lsls r2, 2 + bl CpuSet + ldr r0, _08146850 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146848: .4byte 0x01000400 +_0814684C: .4byte 0x085b9330 +_08146850: .4byte 0x085c8ed4 + thumb_func_end sub_8146800 + + thumb_func_start sub_8146854 +sub_8146854: @ 8146854 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r7, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r5, _081468DC + movs r1, 0 + ldr r0, [sp, 0x8] + mov r9, r0 + ldr r6, _081468E0 + mov r8, r6 + movs r0, 0xF0 + lsls r0, 8 + mov r12, r0 +_0814687A: + movs r0, 0 + lsls r3, r1, 16 + asrs r4, r3, 11 +_08146880: + lsls r2, r0, 16 + asrs r2, 16 + adds r1, r4, r2 + lsls r1, 1 + add r1, r9 + ldrh r0, [r5] + mov r6, r12 + orrs r0, r6 + strh r0, [r1] + adds r2, 0x1 + lsls r2, 16 + adds r5, 0x2 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0x1D + ble _08146880 + movs r1, 0x80 + lsls r1, 9 + adds r0, r3, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0814687A + movs r6, 0x10 + ldrsh r2, [r7, r6] + movs r1, 0x12 + ldrsh r0, [r7, r1] + str r0, [sp] + movs r0, 0xA0 + str r0, [sp, 0x4] + mov r0, r8 + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081468DC: .4byte 0x085c9020 +_081468E0: .4byte 0x02038c28 + thumb_func_end sub_8146854 + + thumb_func_start sub_81468E4 +sub_81468E4: @ 81468E4 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _08146924 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _08146928 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146924: .4byte 0x085bb248 +_08146928: .4byte 0x02038c28 + thumb_func_end sub_81468E4 + + thumb_func_start sub_814692C +sub_814692C: @ 814692C + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _0814696C + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _08146970 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814696C: .4byte 0x085bb930 +_08146970: .4byte 0x02038c28 + thumb_func_end sub_814692C + + thumb_func_start sub_8146974 +sub_8146974: @ 8146974 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _081469C0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _081469C4 + ldr r1, [sp, 0x8] + movs r2, 0xA0 + lsls r2, 2 + bl CpuSet + ldr r0, _081469C8 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081469C0: .4byte 0x085bc2b4 +_081469C4: .4byte 0x085bc314 +_081469C8: .4byte 0x02038c28 + thumb_func_end sub_8146974 + + thumb_func_start sub_81469CC +sub_81469CC: @ 81469CC + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _08146A18 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08146A1C + ldr r1, [sp, 0x8] + movs r2, 0xA0 + lsls r2, 2 + bl CpuSet + ldr r0, _08146A20 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146A18: .4byte 0x085bc2d4 +_08146A1C: .4byte 0x085bcb14 +_08146A20: .4byte 0x02038c28 + thumb_func_end sub_81469CC + + thumb_func_start sub_8146A24 +sub_8146A24: @ 8146A24 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _08146A70 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08146A74 + ldr r1, [sp, 0x8] + movs r2, 0xA0 + lsls r2, 2 + bl CpuSet + ldr r0, _08146A78 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146A70: .4byte 0x085bc2f4 +_08146A74: .4byte 0x085bd314 +_08146A78: .4byte 0x02038c28 + thumb_func_end sub_8146A24 + + thumb_func_start sub_8146A7C +sub_8146A7C: @ 8146A7C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _08146ABC + mov r0, sp + bl CpuSet + ldr r0, _08146AC0 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _08146AC4 + ldr r1, [sp, 0x4] + bl LZ77UnCompVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146ABC: .4byte 0x01000400 +_08146AC0: .4byte 0x085bdb34 +_08146AC4: .4byte 0x085be1e8 + thumb_func_end sub_8146A7C + + thumb_func_start sub_8146AC8 +sub_8146AC8: @ 8146AC8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08146B00 + adds r0, r5, 0 + movs r1, 0x1E + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 11 + ldr r1, _08146B20 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08146B00: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3A + ble _08146B18 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] +_08146B18: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146B20: .4byte 0x085beda0 + thumb_func_end sub_8146AC8 + + thumb_func_start sub_8146B24 +sub_8146B24: @ 8146B24 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08146B52 + adds r0, r5, 0 + movs r1, 0x5 + bl __divsi3 + lsls r0, 16 + asrs r0, 11 + ldr r1, _08146B78 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08146B52: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x44 + ble _08146B6E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x1E + strh r0, [r4, 0x18] +_08146B6E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146B78: .4byte 0x085beee0 + thumb_func_end sub_8146B24 + + thumb_func_start sub_8146B7C +sub_8146B7C: @ 8146B7C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, _08146BA4 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146BA4: .4byte 0xffff8000 + thumb_func_end sub_8146B7C + + thumb_func_start sub_8146BA8 +sub_8146BA8: @ 8146BA8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08146BE8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08146BDE + ldr r1, _08146BEC + ldrh r2, [r1, 0xA] + ldr r0, _08146BF0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08146BF4 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_08146BDE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146BE8: .4byte 0x02037fd4 +_08146BEC: .4byte 0x040000b0 +_08146BF0: .4byte 0x0000c5ff +_08146BF4: .4byte 0x00007fff + thumb_func_end sub_8146BA8 + + thumb_func_start sub_8146BF8 +sub_8146BF8: @ 8146BF8 + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + ldr r2, _08146C80 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r1, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + adds r4, r2, 0 + cmp r0, 0 + beq _08146C1E + subs r0, r1, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08146C28 +_08146C1E: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r0, 0x2 + strh r0, [r3, 0xE] +_08146C28: + ldr r2, [r4] + ldrh r0, [r3, 0xA] + lsls r0, 8 + ldrh r1, [r3, 0xC] + orrs r0, r1 + strh r0, [r2, 0x10] + movs r5, 0xC + ldrsh r0, [r3, r5] + cmp r0, 0xF + ble _08146C42 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08146C42: + ldrh r0, [r3, 0x10] + adds r0, 0x8 + strh r0, [r3, 0x10] + ldr r0, _08146C84 + adds r1, r0, 0 + ldrh r5, [r3, 0x12] + adds r1, r5 + strh r1, [r3, 0x12] + ldr r0, _08146C88 + movs r5, 0x10 + ldrsh r2, [r3, r5] + lsls r1, 16 + asrs r1, 24 + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146C80: .4byte 0x0203aba0 +_08146C84: .4byte 0xffffff00 +_08146C88: .4byte 0x02038c28 + thumb_func_end sub_8146BF8 + + thumb_func_start sub_8146C8C +sub_8146C8C: @ 8146C8C + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + ldr r2, _08146D14 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r1, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + adds r4, r2, 0 + cmp r0, 0 + beq _08146CB2 + subs r0, r1, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08146CBC +_08146CB2: + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + movs r0, 0x2 + strh r0, [r3, 0xE] +_08146CBC: + ldr r2, [r4] + ldrh r0, [r3, 0xA] + lsls r0, 8 + ldrh r1, [r3, 0xC] + orrs r0, r1 + strh r0, [r2, 0x10] + movs r5, 0xA + ldrsh r0, [r3, r5] + cmp r0, 0 + bne _08146CD6 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08146CD6: + ldrh r0, [r3, 0x10] + adds r0, 0x8 + strh r0, [r3, 0x10] + ldr r0, _08146D18 + adds r1, r0, 0 + ldrh r5, [r3, 0x12] + adds r1, r5 + strh r1, [r3, 0x12] + ldr r0, _08146D1C + movs r5, 0x10 + ldrsh r2, [r3, r5] + lsls r1, 16 + asrs r1, 24 + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08146D14: .4byte 0x0203aba0 +_08146D18: .4byte 0xffffff00 +_08146D1C: .4byte 0x02038c28 + thumb_func_end sub_8146C8C + + thumb_func_start sub_8146D20 +sub_8146D20: @ 8146D20 + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r7, _08146D84 + ldr r0, [r7] + ldrb r1, [r0] + movs r6, 0 + strb r6, [r0] + ldrh r0, [r4, 0x10] + adds r0, 0x8 + strh r0, [r4, 0x10] + ldr r0, _08146D88 + adds r1, r0, 0 + ldrh r3, [r4, 0x12] + adds r1, r3 + strh r1, [r4, 0x12] + ldr r0, _08146D8C + movs r3, 0x10 + ldrsh r2, [r4, r3] + lsls r1, 16 + asrs r1, 24 + str r1, [sp] + movs r5, 0xA0 + str r5, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _08146D70 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0xC] + strh r6, [r4, 0xE] +_08146D70: + ldr r0, [r7] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08146D84: .4byte 0x0203aba0 +_08146D88: .4byte 0xffffff00 +_08146D8C: .4byte 0x02038c28 + thumb_func_end sub_8146D20 + + thumb_func_start sub_8146D90 +sub_8146D90: @ 8146D90 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x18] + subs r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + cmp r0, 0 + bne _08146DA6 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_08146DA6: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8146D90 + + thumb_func_start sub_8146DAC +sub_8146DAC: @ 8146DAC + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, _08146DD4 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146DD4: .4byte 0x0000ffff + thumb_func_end sub_8146DAC + + thumb_func_start sub_8146DD8 +sub_8146DD8: @ 8146DD8 + push {lr} + adds r2, r0, 0 + ldr r0, _08146DF4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08146DEE + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_08146DEE: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08146DF4: .4byte 0x02037fd4 + thumb_func_end sub_8146DD8 + + thumb_func_start sub_8146DF8 +sub_8146DF8: @ 8146DF8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08146E78 + ldr r0, [r0] + ldrb r1, [r0] + movs r3, 0 + strb r3, [r0] + ldrh r2, [r4, 0xC] + movs r0, 0xC + ldrsh r1, [r4, r0] + ldr r0, _08146E7C + cmp r1, r0 + bgt _08146E18 + adds r0, r2, 0 + adds r0, 0x80 + strh r0, [r4, 0xC] +_08146E18: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08146E34 + ldrh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 24 + subs r0, r1, r0 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _08146E34 + strh r3, [r4, 0xA] +_08146E34: + ldr r0, _08146E80 + movs r1, 0xA + ldrsh r3, [r4, r1] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08146E90 + movs r0, 0 + bl SetVBlankCallback + ldr r1, _08146E84 + ldrh r2, [r1, 0xA] + ldr r0, _08146E88 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08146E8C + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _08146EB0 + .align 2, 0 +_08146E78: .4byte 0x0203aba0 +_08146E7C: .4byte 0x000003ff +_08146E80: .4byte 0x02038c28 +_08146E84: .4byte 0x040000b0 +_08146E88: .4byte 0x0000c5ff +_08146E8C: .4byte 0x00007fff +_08146E90: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08146EA4 + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + ldr r0, _08146EB8 + bl SetVBlankCallback +_08146EA4: + ldr r0, _08146EBC + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] +_08146EB0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08146EB8: .4byte sub_8146F68 + 1 +_08146EBC: .4byte 0x0203aba0 + thumb_func_end sub_8146DF8 + + thumb_func_start sub_8146EC0 +sub_8146EC0: @ 8146EC0 + push {lr} + ldr r1, _08146F1C + ldrh r2, [r1, 0xA] + ldr r0, _08146F20 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08146F24 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F2C + ldr r2, _08146F28 + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0 + beq _08146EF8 + ldr r1, _08146F2C + ldr r0, _08146F30 + str r0, [r1] + movs r3, 0xF0 + lsls r3, 3 + adds r0, r3 + str r0, [r1, 0x4] + ldr r0, _08146F34 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08146EF8: + ldr r1, _08146F38 + ldr r2, [r2] + ldrh r0, [r2, 0x2] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x4] + strh r0, [r1] + subs r1, 0x6 + ldrh r0, [r2, 0x8] + strh r0, [r1] + adds r1, 0xC + ldrh r0, [r2, 0xE] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x10] + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08146F1C: .4byte 0x040000b0 +_08146F20: .4byte 0x0000c5ff +_08146F24: .4byte 0x00007fff +_08146F28: .4byte 0x0203aba0 +_08146F2C: .4byte 0x040000d4 +_08146F30: .4byte 0x02038c28 +_08146F34: .4byte 0x800000a0 +_08146F38: .4byte 0x04000048 + thumb_func_end sub_8146EC0 + + thumb_func_start sub_8146F3C +sub_8146F3C: @ 8146F3C + push {lr} + bl sub_8146EC0 + ldr r1, _08146F58 + ldr r0, _08146F5C + str r0, [r1] + ldr r0, _08146F60 + str r0, [r1, 0x4] + ldr r0, _08146F64 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_08146F58: .4byte 0x040000b0 +_08146F5C: .4byte 0x020393a8 +_08146F60: .4byte 0x04000010 +_08146F64: .4byte 0xa2400001 + thumb_func_end sub_8146F3C + + thumb_func_start sub_8146F68 +sub_8146F68: @ 8146F68 + push {lr} + bl sub_8146EC0 + ldr r1, _08146F84 + ldr r0, _08146F88 + str r0, [r1] + ldr r0, _08146F8C + str r0, [r1, 0x4] + ldr r0, _08146F90 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_08146F84: .4byte 0x040000b0 +_08146F88: .4byte 0x020393a8 +_08146F8C: .4byte 0x04000040 +_08146F90: .4byte 0xa2400001 + thumb_func_end sub_8146F68 + + thumb_func_start sub_8146F94 +sub_8146F94: @ 8146F94 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08146FC4 + ldr r2, _08146FC8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146FA6: + 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 _08146FA6 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08146FC4: .4byte 0x085c8b7c +_08146FC8: .4byte 0x03005e00 + thumb_func_end sub_8146F94 + + thumb_func_start sub_8146FCC +sub_8146FCC: @ 8146FCC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + ldr r0, _0814700C + ldr r1, [sp, 0x8] + movs r2, 0x20 + bl CpuSet + movs r0, 0 + str r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, _08147010 + mov r0, sp + bl CpuSet + ldr r0, _08147014 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814700C: .4byte 0x085b98b0 +_08147010: .4byte 0x05000200 +_08147014: .4byte 0x085c8ed4 + thumb_func_end sub_8146FCC + + thumb_func_start sub_8147018 +sub_8147018: @ 8147018 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r7, r0, 0 + ldr r1, _08147098 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r4, sp, 0x4 + ldr r1, _0814709C + adds r0, r4, 0 + movs r2, 0xA + bl memcpy + bl GenerateRandomNumber + movs r5, 0x1 + ands r5, r0 + movs r1, 0 + mov r8, r4 + ldr r6, _081470A0 +_08147046: + lsls r5, 16 + asrs r5, 16 + lsls r0, r5, 1 + add r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + str r0, [r6] + lsls r4, r1, 16 + asrs r4, 16 + lsls r0, r4, 5 + adds r0, 0x10 + str r0, [r6, 0x4] + str r5, [r6, 0x8] + lsls r0, r4, 1 + add r0, r8 + movs r1, 0 + ldrsh r0, [r0, r1] + str r0, [r6, 0xC] + movs r0, 0x2D + bl oe_exec + adds r4, 0x1 + lsls r4, 16 + movs r0, 0x1 + eors r5, r0 + lsls r5, 16 + lsrs r5, 16 + lsrs r1, r4, 16 + asrs r4, 16 + cmp r4, 0x4 + ble _08147046 + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147098: .4byte 0x085c8b88 +_0814709C: .4byte 0x085c8b8c +_081470A0: .4byte 0x02038c08 + thumb_func_end sub_8147018 + + thumb_func_start sub_81470A4 +sub_81470A4: @ 81470A4 + push {lr} + movs r0, 0x2D + bl oe_active_list_contains + lsls r0, 24 + cmp r0, 0 + bne _081470C4 + bl sub_8149F84 + ldr r0, _081470CC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081470C4: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081470CC: .4byte sub_8146F94 + 1 + thumb_func_end sub_81470A4 + + thumb_func_start sub_81470D0 +sub_81470D0: @ 81470D0 + push {r4,r5,lr} + ldr r0, _0814712C + ldr r5, _08147130 + movs r2, 0 + ldrsh r1, [r5, r2] + movs r3, 0x4 + ldrsh r2, [r5, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08147134 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x5] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, [r5, 0x8] + strh r0, [r4, 0x2E] + ldr r0, [r5, 0xC] + strh r0, [r4, 0x30] + ldr r0, _08147138 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + ldrb r1, [r5, 0x8] + adds r0, r4, 0 + bl sub_8008258 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0814712C: .4byte 0x085c8e68 +_08147130: .4byte 0x02038c08 +_08147134: .4byte 0x02020630 +_08147138: .4byte 0x0000ffff + thumb_func_end sub_81470D0 + + thumb_func_start sub_814713C +sub_814713C: @ 814713C + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, _0814715C + mov r0, sp + movs r2, 0x4 + bl memcpy + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08147160 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + b _081471F2 + .align 2, 0 +_0814715C: .4byte 0x085c8b96 +_08147160: + ldrh r0, [r4, 0x20] + lsls r1, r0, 16 + lsrs r0, r1, 16 + cmp r0, 0xF0 + bhi _081471CE + asrs r0, r1, 19 + lsls r0, 16 + ldrh r1, [r4, 0x22] + lsls r1, 16 + asrs r1, 19 + lsls r1, 16 + lsrs r1, 16 + lsrs r2, r0, 16 + asrs r5, r0, 16 + movs r3, 0x32 + ldrsh r0, [r4, r3] + cmp r5, r0 + beq _081471CE + strh r2, [r4, 0x32] + ldr r0, _081471FC + ldrh r2, [r0] + lsrs r2, 8 + movs r0, 0x1F + ands r2, r0 + lsls r2, 11 + movs r0, 0xC0 + lsls r0, 19 + adds r2, r0 + lsls r1, 16 + asrs r1, 16 + subs r0, r1, 0x2 + lsls r0, 5 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + ldr r6, _08147200 + adds r3, r6, 0 + strh r3, [r0] + subs r0, r1, 0x1 + lsls r0, 5 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + strh r3, [r0] + lsls r0, r1, 5 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + strh r3, [r0] + adds r1, 0x1 + lsls r1, 5 + adds r1, r5 + lsls r1, 1 + adds r1, r2 + strh r3, [r1] +_081471CE: + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, 0xF + lsls r0, 16 + movs r1, 0x87 + lsls r1, 17 + cmp r0, r1 + bls _081471F2 + adds r0, r4, 0 + movs r1, 0x2D + bl oe_stop +_081471F2: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081471FC: .4byte 0x04000008 +_08147200: .4byte 0x0000f001 + thumb_func_end sub_814713C + + thumb_func_start sub_8147204 +sub_8147204: @ 8147204 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08147234 + ldr r2, _08147238 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08147216: + 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 _08147216 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08147234: .4byte 0x085c8b9c +_08147238: .4byte 0x03005e00 + thumb_func_end sub_8147204 + + thumb_func_start sub_814723C +sub_814723C: @ 814723C + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, _08147290 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + ldr r0, _08147294 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r3, _08147298 + ldr r2, _0814729C +_08147262: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _08147262 + ldr r0, _081472A0 + bl SetVBlankCallback + ldr r0, _08147290 + ldr r1, [r0] + movs r0, 0x78 + strh r0, [r1, 0x2C] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08147290: .4byte 0x0203aba0 +_08147294: .4byte 0x0000f0f1 +_08147298: .4byte 0x020393a8 +_0814729C: .4byte 0x0000f3f4 +_081472A0: .4byte sub_8147688 + 1 + thumb_func_end sub_814723C + + thumb_func_start sub_81472A4 +sub_81472A4: @ 81472A4 + push {r4-r7,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r2, _0814732C + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2C + ldrsh r3, [r1, r2] + movs r1, 0x1 + negs r1, r1 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A1AC + ldr r5, _08147330 +_081472D4: + ldr r4, _0814732C + ldr r0, [r4] + movs r7, 0x2A + ldrsh r3, [r0, r7] + lsls r3, 1 + adds r3, r5 + ldrh r1, [r0, 0x28] + adds r1, 0x1 + movs r7, 0xF0 + lsls r7, 7 + adds r2, r7, 0 + orrs r1, r2 + strh r1, [r3] + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + cmp r0, 0 + beq _081472D4 + ldr r1, [r4] + ldrh r0, [r1, 0x2C] + adds r0, 0x10 + strh r0, [r1, 0x2C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xEF + ble _08147318 + movs r0, 0 + strh r0, [r1, 0x2E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_08147318: + ldr r0, [r4] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0814732C: .4byte 0x0203aba0 +_08147330: .4byte 0x02038c28 + thumb_func_end sub_81472A4 + + thumb_func_start sub_8147334 +sub_8147334: @ 8147334 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + add r1, sp, 0xC + movs r0, 0 + strb r0, [r1] + ldr r4, _081473B8 + ldr r1, [r4] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2E + ldrsh r1, [r1, r2] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0xF0 + bl sub_814A1AC + mov r9, r4 + mov r7, r9 + add r5, sp, 0xC +_08147372: + movs r1, 0x78 + ldr r3, [r7] + ldrh r0, [r3, 0x28] + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0x4F + ble _0814738A + ldrh r1, [r3, 0x28] + movs r4, 0xF0 +_0814738A: + ldr r6, _081473BC + movs r0, 0x2A + ldrsh r2, [r3, r0] + lsls r2, 1 + adds r2, r6 + lsls r1, 16 + asrs r1, 8 + lsls r0, r4, 16 + asrs r4, r0, 16 + orrs r4, r1 + strh r4, [r2] + ldrb r0, [r5] + cmp r0, 0 + bne _081473C0 + adds r0, r3, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + strb r0, [r5] + b _08147372 + .align 2, 0 +_081473B8: .4byte 0x0203aba0 +_081473BC: .4byte 0x02038c28 +_081473C0: + ldr r1, [r7] + ldrh r0, [r1, 0x2E] + adds r0, 0x8 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0x9F + ble _081473DE + movs r0, 0xF0 + strh r0, [r1, 0x2C] + mov r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08147406 +_081473DE: + movs r3, 0x2A + ldrsh r0, [r1, r3] + cmp r0, r2 + bge _08147406 + adds r3, r4, 0 + ldr r5, _08147424 +_081473EA: + ldr r2, [r5] + ldrh r0, [r2, 0x2A] + adds r0, 0x1 + strh r0, [r2, 0x2A] + lsls r0, 16 + asrs r0, 15 + adds r0, r6 + strh r3, [r0] + movs r4, 0x2A + ldrsh r1, [r2, r4] + movs r4, 0x2E + ldrsh r0, [r2, r4] + cmp r1, r0 + blt _081473EA +_08147406: + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147424: .4byte 0x0203aba0 + thumb_func_end sub_8147334 + + thumb_func_start sub_8147428 +sub_8147428: @ 8147428 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r2, _081474A8 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2C + ldrsh r3, [r1, r2] + movs r1, 0xA0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A1AC + ldr r5, _081474AC +_08147456: + ldr r4, _081474A8 + ldr r0, [r4] + movs r1, 0x2A + ldrsh r3, [r0, r1] + lsls r3, 1 + adds r3, r5 + ldrh r1, [r0, 0x28] + lsls r1, 8 + movs r2, 0xF0 + orrs r1, r2 + strh r1, [r3] + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + cmp r0, 0 + beq _08147456 + ldr r1, [r4] + ldrh r0, [r1, 0x2C] + subs r0, 0x10 + strh r0, [r1, 0x2C] + lsls r0, 16 + cmp r0, 0 + bgt _08147494 + movs r0, 0xA0 + strh r0, [r1, 0x2E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_08147494: + ldr r0, [r4] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081474A8: .4byte 0x0203aba0 +_081474AC: .4byte 0x02038c28 + thumb_func_end sub_8147428 + + thumb_func_start sub_81474B0 +sub_81474B0: @ 81474B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r0 + add r1, sp, 0xC + movs r0, 0 + strb r0, [r1] + ldr r4, _08147538 + ldr r1, [r4] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2E + ldrsh r1, [r1, r2] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl sub_814A1AC + ldr r7, _0814753C + mov r10, r7 + ldr r0, _08147538 + mov r8, r0 + add r6, sp, 0xC +_081474F4: + mov r1, r8 + ldr r4, [r1] + movs r2, 0x2A + ldrsh r0, [r4, r2] + lsls r0, 1 + mov r7, r10 + adds r5, r0, r7 + ldrb r1, [r5] + ldrh r2, [r4, 0x28] + adds r3, r2, 0 + movs r7, 0x2E + ldrsh r0, [r4, r7] + cmp r0, 0x50 + bgt _08147514 + movs r2, 0x78 + adds r1, r3, 0 +_08147514: + lsls r0, r2, 16 + asrs r0, 8 + lsls r1, 16 + asrs r1, 16 + orrs r1, r0 + movs r7, 0 + strh r1, [r5] + ldrb r0, [r6] + cmp r0, 0 + bne _08147540 + adds r0, r4, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + strb r0, [r6] + b _081474F4 + .align 2, 0 +_08147538: .4byte 0x0203aba0 +_0814753C: .4byte 0x02038c28 +_08147540: + mov r0, r8 + ldr r2, [r0] + ldrh r0, [r2, 0x2E] + subs r0, 0x8 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bgt _0814755E + strh r7, [r2, 0x2C] + mov r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08147588 +_0814755E: + movs r4, 0x2A + ldrsh r0, [r2, r4] + cmp r0, r3 + ble _08147588 + ldr r6, _081475A8 + adds r3, r1, 0 + ldr r5, _081475AC +_0814756C: + ldr r2, [r5] + ldrh r0, [r2, 0x2A] + subs r0, 0x1 + strh r0, [r2, 0x2A] + lsls r0, 16 + asrs r0, 15 + adds r0, r6 + strh r3, [r0] + movs r7, 0x2A + ldrsh r1, [r2, r7] + movs r4, 0x2E + ldrsh r0, [r2, r4] + cmp r1, r0 + bgt _0814756C +_08147588: + ldr r7, _081475AC + ldr r0, [r7] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + 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 + .align 2, 0 +_081475A8: .4byte 0x02038c28 +_081475AC: .4byte 0x0203aba0 + thumb_func_end sub_81474B0 + + thumb_func_start sub_81475B0 +sub_81475B0: @ 81475B0 + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + ldr r1, _08147640 + ldr r0, [r1] + ldrb r2, [r0] + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + adds r0, r1, 0 + adds r0, 0x24 + movs r4, 0x2C + ldrsh r3, [r1, r4] + str r2, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A1AC + ldr r6, _08147644 +_081475DC: + movs r2, 0x78 + ldr r5, _08147640 + ldr r3, [r5] + ldrh r4, [r3, 0x28] + movs r1, 0x28 + ldrsh r0, [r3, r1] + cmp r0, 0x77 + ble _081475F0 + movs r2, 0 + movs r4, 0xF0 +_081475F0: + movs r0, 0x2A + ldrsh r1, [r3, r0] + lsls r1, 1 + adds r1, r6 + lsls r2, 8 + lsls r0, r4, 16 + asrs r0, 16 + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + cmp r0, 0 + beq _081475DC + ldr r0, [r5] + ldrh r1, [r0, 0x2C] + adds r1, 0x10 + strh r1, [r0, 0x2C] + movs r1, 0x28 + ldrsh r0, [r0, r1] + cmp r0, 0x78 + ble _0814762A + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] +_0814762A: + ldr r0, [r5] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147640: .4byte 0x0203aba0 +_08147644: .4byte 0x02038c28 + thumb_func_end sub_81475B0 + + thumb_func_start sub_8147648 +sub_8147648: @ 8147648 + push {lr} + ldr r1, _08147678 + ldrh r2, [r1, 0xA] + ldr r0, _0814767C + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08147680 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, _08147684 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08147678: .4byte 0x040000b0 +_0814767C: .4byte 0x0000c5ff +_08147680: .4byte 0x00007fff +_08147684: .4byte sub_8147204 + 1 + thumb_func_end sub_8147648 + + thumb_func_start sub_8147688 +sub_8147688: @ 8147688 + push {r4,lr} + ldr r4, _081476F4 + ldrh r1, [r4, 0xA] + ldr r0, _081476F8 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _081476FC + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, _08147700 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _081476C0 + ldr r1, _08147704 + ldr r0, _08147708 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _0814770C + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081476C0: + ldr r2, _08147710 + ldr r1, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + subs r2, 0x4 + ldr r0, _08147708 + movs r1, 0xF0 + lsls r1, 3 + adds r0, r1 + ldrh r1, [r0] + strh r1, [r2] + str r0, [r4] + str r2, [r4, 0x4] + ldr r0, _08147714 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081476F4: .4byte 0x040000b0 +_081476F8: .4byte 0x0000c5ff +_081476FC: .4byte 0x00007fff +_08147700: .4byte 0x0203aba0 +_08147704: .4byte 0x040000d4 +_08147708: .4byte 0x02038c28 +_0814770C: .4byte 0x800000a0 +_08147710: .4byte 0x04000048 +_08147714: .4byte 0xa2400001 + thumb_func_end sub_8147688 + + thumb_func_start sub_8147718 +sub_8147718: @ 8147718 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08147748 + ldr r2, _0814774C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814772A: + 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 _0814772A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08147748: .4byte 0x085c8bb8 +_0814774C: .4byte 0x03005e00 + thumb_func_end sub_8147718 + + thumb_func_start sub_8147750 +sub_8147750: @ 8147750 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r2, 0 + ldr r4, _08147798 + ldr r3, _0814779C +_08147762: + lsls r1, r2, 1 + adds r1, r4 + ldr r0, [r3] + ldrh r0, [r0, 0x16] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9F + bls _08147762 + ldr r0, _081477A0 + bl SetVBlankCallback + ldr r0, _081477A4 + bl SetHBlankCallback + movs r0, 0x2 + bl enable_irqs + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08147798: .4byte 0x020393a8 +_0814779C: .4byte 0x0203aba0 +_081477A0: .4byte sub_8147888 + 1 +_081477A4: .4byte sub_81478C0 + 1 + thumb_func_end sub_8147750 + + thumb_func_start sub_81477A8 +sub_81477A8: @ 81477A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, _08147874 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r2, [r6, 0xC] + lsls r1, r2, 16 + asrs r0, r1, 24 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r4, [r6, 0xA] + movs r0, 0xC0 + lsls r0, 1 + mov r8, r0 + movs r5, 0x80 + lsls r5, 3 + adds r0, r4, r5 + strh r0, [r6, 0xA] + ldr r0, _08147878 + cmp r1, r0 + bgt _081477E4 + movs r1, 0xC0 + lsls r1, 1 + adds r0, r2, r1 + strh r0, [r6, 0xC] +_081477E4: + movs r5, 0 + lsls r7, r3, 16 +_081477E8: + lsrs r0, r4, 8 + asrs r1, r7, 16 + bl sine + ldr r1, _0814787C + lsls r2, r5, 1 + adds r2, r1 + ldr r1, _08147874 + ldr r1, [r1] + ldrh r1, [r1, 0x16] + adds r0, r1 + strh r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x9F + bls _081477E8 + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _08147838 + ldrh r0, [r6, 0x10] + adds r0, 0x1 + strh r0, [r6, 0x10] + movs r0, 0x1 + negs r0, r0 + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] + movs r3, 0x10 + bl sub_80A1AD4 +_08147838: + movs r5, 0x10 + ldrsh r0, [r6, r5] + cmp r0, 0 + beq _0814785A + ldr r0, _08147880 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814785A + ldr r0, _08147884 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0814785A: + ldr r0, _08147874 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147874: .4byte 0x0203aba0 +_08147878: .4byte 0x1fff0000 +_0814787C: .4byte 0x02038c28 +_08147880: .4byte 0x02037fd4 +_08147884: .4byte sub_8147718 + 1 + thumb_func_end sub_81477A8 + + thumb_func_start sub_8147888 +sub_8147888: @ 8147888 + push {lr} + bl sub_8149F2C + ldr r0, _081478B0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _081478AC + ldr r1, _081478B4 + ldr r0, _081478B8 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _081478BC + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081478AC: + pop {r0} + bx r0 + .align 2, 0 +_081478B0: .4byte 0x0203aba0 +_081478B4: .4byte 0x040000d4 +_081478B8: .4byte 0x02038c28 +_081478BC: .4byte 0x800000a0 + thumb_func_end sub_8147888 + + thumb_func_start sub_81478C0 +sub_81478C0: @ 81478C0 + ldr r1, _081478E0 + ldr r0, _081478E4 + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _081478E8 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + bx lr + .align 2, 0 +_081478E0: .4byte 0x02038c28 +_081478E4: .4byte 0x04000006 +_081478E8: .4byte 0x04000016 + thumb_func_end sub_81478C0 + + thumb_func_start sub_81478EC +sub_81478EC: @ 81478EC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814791C + ldr r2, _08147920 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081478FE: + 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 _081478FE + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814791C: .4byte 0x085c8bc0 +_08147920: .4byte 0x03005e00 + thumb_func_end sub_81478EC + + thumb_func_start sub_8147924 +sub_8147924: @ 8147924 + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, _08147970 + ldr r1, [r0] + movs r2, 0 + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r3, _08147974 + movs r2, 0xF2 +_0814794A: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9F + bls _0814794A + ldr r0, _08147978 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08147970: .4byte 0x0203aba0 +_08147974: .4byte 0x020393a8 +_08147978: .4byte sub_8147A58 + 1 + thumb_func_end sub_8147924 + + thumb_func_start sub_814797C +sub_814797C: @ 814797C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, _08147A10 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r7, _08147A14 + ldrh r0, [r4, 0xC] + ldrb r5, [r4, 0xC] + adds r0, 0x10 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + adds r0, 0x8 + strh r0, [r4, 0xA] + movs r6, 0 + movs r0, 0x1 + mov r8, r0 +_081479A4: + adds r0, r5, 0 + movs r1, 0x28 + bl sine + ldrh r1, [r4, 0xA] + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bge _081479BA + movs r1, 0 +_081479BA: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xF0 + ble _081479C4 + movs r1, 0xF0 +_081479C4: + lsls r0, r1, 16 + asrs r0, 16 + lsls r1, r0, 8 + movs r2, 0xF1 + orrs r1, r2 + strh r1, [r7] + cmp r0, 0xEF + bgt _081479D8 + movs r0, 0 + mov r8, r0 +_081479D8: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, 0x2 + cmp r6, 0x9F + bls _081479A4 + mov r1, r8 + cmp r1, 0 + beq _081479F6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081479F6: + ldr r0, _08147A10 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147A10: .4byte 0x0203aba0 +_08147A14: .4byte 0x02038c28 + thumb_func_end sub_814797C + + thumb_func_start sub_8147A18 +sub_8147A18: @ 8147A18 + push {lr} + ldr r1, _08147A48 + ldrh r2, [r1, 0xA] + ldr r0, _08147A4C + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08147A50 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, _08147A54 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08147A48: .4byte 0x040000b0 +_08147A4C: .4byte 0x0000c5ff +_08147A50: .4byte 0x00007fff +_08147A54: .4byte sub_81478EC + 1 + thumb_func_end sub_8147A18 + + thumb_func_start sub_8147A58 +sub_8147A58: @ 8147A58 + push {r4,lr} + ldr r4, _08147AB8 + ldrh r1, [r4, 0xA] + ldr r0, _08147ABC + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _08147AC0 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, _08147AC4 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08147A90 + ldr r1, _08147AC8 + ldr r0, _08147ACC + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _08147AD0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08147A90: + ldr r2, _08147AD4 + ldr r1, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldr r0, _08147AD8 + str r0, [r4] + ldr r0, _08147ADC + str r0, [r4, 0x4] + ldr r0, _08147AE0 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08147AB8: .4byte 0x040000b0 +_08147ABC: .4byte 0x0000c5ff +_08147AC0: .4byte 0x00007fff +_08147AC4: .4byte 0x0203aba0 +_08147AC8: .4byte 0x040000d4 +_08147ACC: .4byte 0x02038c28 +_08147AD0: .4byte 0x800000a0 +_08147AD4: .4byte 0x04000048 +_08147AD8: .4byte 0x020393a8 +_08147ADC: .4byte 0x04000040 +_08147AE0: .4byte 0xa2400001 + thumb_func_end sub_8147A58 + + thumb_func_start sub_8147AE4 +sub_8147AE4: @ 8147AE4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08147B00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .align 2, 0 +_08147B00: .4byte 0x03005e00 + thumb_func_end sub_8147AE4 + + thumb_func_start sub_8147B04 +sub_8147B04: @ 8147B04 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08147B20 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x1 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .align 2, 0 +_08147B20: .4byte 0x03005e00 + thumb_func_end sub_8147B04 + + thumb_func_start sub_8147B24 +sub_8147B24: @ 8147B24 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08147B40 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x2 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .align 2, 0 +_08147B40: .4byte 0x03005e00 + thumb_func_end sub_8147B24 + + thumb_func_start sub_8147B44 +sub_8147B44: @ 8147B44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08147B60 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x3 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .align 2, 0 +_08147B60: .4byte 0x03005e00 + thumb_func_end sub_8147B44 + + thumb_func_start sub_8147B64 +sub_8147B64: @ 8147B64 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08147B80 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x4 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .align 2, 0 +_08147B80: .4byte 0x03005e00 + thumb_func_end sub_8147B64 + + thumb_func_start sub_8147B84 +sub_8147B84: @ 8147B84 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08147BB4 + ldr r2, _08147BB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08147B96: + 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 _08147B96 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08147BB4: .4byte 0x085c8bcc +_08147BB8: .4byte 0x03005e00 + thumb_func_end sub_8147B84 + + thumb_func_start sub_8147BBC +sub_8147BBC: @ 8147BBC + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + adds r0, r4, 0 + bl sub_8148218 + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0xC] + movs r0, 0xEF + strh r0, [r4, 0xE] + ldr r0, _08147C14 + ldr r1, [r0] + movs r0, 0x3F + strh r0, [r1, 0x2] + movs r0, 0x3E + strh r0, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r3, _08147C18 + ldr r2, _08147C1C +_08147BF0: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9F + bls _08147BF0 + ldr r0, _08147C20 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08147C14: .4byte 0x0203aba0 +_08147C18: .4byte 0x020393a8 +_08147C1C: .4byte 0x0000f0f1 +_08147C20: .4byte sub_81480CC + 1 + thumb_func_end sub_8147BBC + + thumb_func_start sub_8147C24 +sub_8147C24: @ 8147C24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + ldr r6, _08147CCC + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, _08147CD0 + ldr r1, [sp, 0x4] + movs r2, 0xF0 + bl CpuSet + ldr r1, _08147CD4 + mov r2, r8 + movs r3, 0x26 + ldrsh r0, [r2, r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _08147CD8 + ldr r0, _08147CDC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xFA + movs r2, 0xC + bl gpu_pal_apply + movs r1, 0 + ldr r5, [sp] + movs r0, 0xF0 + lsls r0, 8 + adds r7, r0, 0 +_08147C78: + movs r0, 0 + lsls r3, r1, 16 + asrs r4, r3, 11 +_08147C7E: + lsls r2, r0, 16 + asrs r2, 16 + adds r1, r4, r2 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r6] + orrs r0, r7 + strh r0, [r1] + adds r2, 0x1 + lsls r2, 16 + adds r6, 0x2 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0x1F + ble _08147C7E + movs r1, 0x80 + lsls r1, 9 + adds r0, r3, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _08147C78 + movs r0, 0x2 + bl enable_irqs + ldr r0, _08147CE0 + bl SetHBlankCallback + mov r2, r8 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147CCC: .4byte 0x085c94d0 +_08147CD0: .4byte 0x085b9af0 +_08147CD4: .4byte 0x085c8fdc +_08147CD8: .4byte 0x085c8ff0 +_08147CDC: .4byte 0x03005d90 +_08147CE0: .4byte sub_81481E0 + 1 + thumb_func_end sub_8147C24 + + thumb_func_start sub_8147CE4 +sub_8147CE4: @ 8147CE4 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, _08147DC8 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r7, _08147DCC + ldrh r0, [r4, 0xA] + ldrb r5, [r4, 0xA] + adds r0, 0x10 + strh r0, [r4, 0xA] + movs r6, 0 +_08147CFE: + adds r0, r5, 0 + movs r1, 0x10 + bl sine + ldrh r1, [r4, 0xC] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, 0 + bge _08147D14 + movs r2, 0x1 +_08147D14: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xF0 + ble _08147D1E + movs r2, 0xF0 +_08147D1E: + strh r2, [r7] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, 0x2 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r6, 0x4F + bls _08147CFE + cmp r6, 0x9F + bhi _08147D76 +_08147D38: + adds r0, r5, 0 + movs r1, 0x10 + bl sine + ldrh r1, [r4, 0xE] + subs r1, r0 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r1, 0 + bge _08147D4E + movs r2, 0 +_08147D4E: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xEF + ble _08147D58 + movs r2, 0xEF +_08147D58: + lsls r0, r2, 16 + asrs r0, 8 + movs r1, 0xF0 + orrs r0, r1 + strh r0, [r7] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, 0x2 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r6, 0x9F + bls _08147D38 +_08147D76: + ldrh r1, [r4, 0xC] + adds r1, 0x8 + strh r1, [r4, 0xC] + ldrh r0, [r4, 0xE] + subs r0, 0x8 + strh r0, [r4, 0xE] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF0 + ble _08147D8E + movs r0, 0xF0 + strh r0, [r4, 0xC] +_08147D8E: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08147D9A + movs r0, 0 + strh r0, [r4, 0xE] +_08147D9A: + ldr r0, [r4, 0xC] + cmp r0, 0xF0 + bne _08147DA6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08147DA6: + ldr r0, _08147DC8 + ldr r1, [r0] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147DC8: .4byte 0x0203aba0 +_08147DCC: .4byte 0x02038c28 + thumb_func_end sub_8147CE4 + + thumb_func_start sub_8147DD0 +sub_8147DD0: @ 8147DD0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _08147E44 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, _08147E48 + adds r5, r2, 0 + movs r2, 0xF0 +_08147DE4: + strh r2, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, 0x2 + cmp r0, 0x9F + bls _08147DE4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + strh r1, [r4, 0xC] + strh r1, [r4, 0xE] + ldr r1, [r5] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r1, 0 + bl sub_8148484 + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r1, 0x1 + bl sub_8148484 + movs r1, 0x22 + ldrsh r0, [r4, r1] + bl sub_814849C + movs r0, 0x68 + bl audio_play + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08147E44: .4byte 0x0203aba0 +_08147E48: .4byte 0x02038c28 + thumb_func_end sub_8147DD0 + + thumb_func_start sub_8147E4C +sub_8147E4C: @ 8147E4C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08147E84 + ldr r1, [r0] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + movs r1, 0x22 + ldrsh r0, [r4, r1] + bl sub_81484B8 + lsls r0, 16 + cmp r0, 0 + beq _08147E7C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0x24 + ldrsh r0, [r4, r1] + bl sub_814849C +_08147E7C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08147E84: .4byte 0x0203aba0 + thumb_func_end sub_8147E4C + + thumb_func_start sub_8147E88 +sub_8147E88: @ 8147E88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r7, _08147F28 + ldr r1, [r7] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + movs r2, 0 + mov r8, r2 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + movs r1, 0x24 + ldrsh r0, [r6, r1] + bl sub_81484B8 + lsls r0, 16 + cmp r0, 0 + beq _08147F1C + ldr r1, [r7] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + movs r0, 0 + bl SetVBlankCallback + ldr r1, _08147F2C + ldrh r2, [r1, 0xA] + ldr r0, _08147F30 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08147F34 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r4, _08147F38 + movs r5, 0xA0 + lsls r5, 1 + adds r0, r4, 0 + movs r1, 0 + adds r2, r5, 0 + bl memset + movs r2, 0xF0 + lsls r2, 3 + adds r4, r2 + adds r0, r4, 0 + movs r1, 0 + adds r2, r5, 0 + bl memset + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + mov r0, r8 + strh r0, [r6, 0xE] + strh r0, [r6, 0x10] + ldr r1, [r7] + movs r0, 0xBF + strh r0, [r1, 0xE] + ldr r0, _08147F3C + bl SetVBlankCallback +_08147F1C: + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08147F28: .4byte 0x0203aba0 +_08147F2C: .4byte 0x040000b0 +_08147F30: .4byte 0x0000c5ff +_08147F34: .4byte 0x00007fff +_08147F38: .4byte 0x02038c28 +_08147F3C: .4byte sub_8148160 + 1 + thumb_func_end sub_8147E88 + + thumb_func_start sub_8147F40 +sub_8147F40: @ 8147F40 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r2, _08148000 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + movs r6, 0x1 + ldr r1, [r2] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + ldrh r1, [r4, 0x10] + movs r3, 0x10 + ldrsh r0, [r4, r3] + mov r12, r2 + cmp r0, 0x4F + bgt _08147F6E + adds r0, r1, 0x2 + strh r0, [r4, 0x10] +_08147F6E: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x50 + ble _08147F7A + movs r0, 0x50 + strh r0, [r4, 0x10] +_08147F7A: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + movs r1, 0x1 + ands r0, r1 + ldrh r3, [r4, 0x10] + cmp r0, 0 + beq _08147FDC + movs r2, 0 + lsls r0, r3, 16 + movs r6, 0 + cmp r0, 0 + blt _08147FDC + movs r7, 0x50 + ldr r5, _08148004 +_08147F98: + lsls r0, r2, 16 + asrs r3, r0, 16 + subs r1, r7, r3 + adds r0, r3, 0 + adds r0, 0x50 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + asrs r1, 15 + adds r1, r5 + ldrh r0, [r1] + cmp r0, 0xF + bhi _08147FB8 + movs r6, 0x1 + adds r0, 0x1 + strh r0, [r1] +_08147FB8: + lsls r0, r2, 16 + asrs r0, 15 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0xF + bhi _08147FCA + movs r6, 0x1 + adds r0, 0x1 + strh r0, [r1] +_08147FCA: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + movs r3, 0x10 + ldrsh r1, [r4, r3] + ldrh r3, [r4, 0x10] + cmp r0, r1 + ble _08147F98 +_08147FDC: + cmp r3, 0x50 + bne _08147FEA + cmp r6, 0 + bne _08147FEA + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08147FEA: + mov r1, r12 + ldr r0, [r1] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08148000: .4byte 0x0203aba0 +_08148004: .4byte 0x02038c28 + thumb_func_end sub_8147F40 + + thumb_func_start sub_8148008 +sub_8148008: @ 8148008 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, _08148038 + ldr r0, [r5] + ldrb r1, [r0] + movs r6, 0 + strb r6, [r0] + movs r0, 0x1 + negs r0, r0 + ldr r2, _0814803C + movs r1, 0x10 + bl sub_80A2A20 + ldr r1, [r5] + movs r0, 0xFF + strh r0, [r1, 0xE] + strh r6, [r4, 0xE] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08148038: .4byte 0x0203aba0 +_0814803C: .4byte 0x00007fff + thumb_func_end sub_8148008 + + thumb_func_start sub_8148040 +sub_8148040: @ 8148040 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08148084 + ldr r1, [r5] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + ldr r0, _08148088 + movs r2, 0xE + ldrsh r1, [r4, r2] + movs r2, 0xA0 + lsls r2, 1 + bl memset + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0xF + ble _08148070 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08148070: + ldr r0, [r5] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08148084: .4byte 0x0203aba0 +_08148088: .4byte 0x02038c28 + thumb_func_end sub_8148040 + + thumb_func_start sub_814808C +sub_814808C: @ 814808C + push {r4,lr} + adds r4, r0, 0 + ldr r1, _081480C0 + ldrh r2, [r1, 0xA] + ldr r0, _081480C4 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _081480C8 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081480C0: .4byte 0x040000b0 +_081480C4: .4byte 0x0000c5ff +_081480C8: .4byte 0x00007fff + thumb_func_end sub_814808C + + thumb_func_start sub_81480CC +sub_81480CC: @ 81480CC + push {r4,lr} + ldr r4, _08148134 + ldrh r1, [r4, 0xA] + ldr r0, _08148138 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _0814813C + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, _08148140 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08148104 + ldr r1, _08148144 + ldr r0, _08148148 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _0814814C + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08148104: + ldr r2, _08148150 + ldr r1, [r3] + ldrh r0, [r1, 0x1C] + strh r0, [r2] + adds r2, 0x36 + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldr r0, _08148154 + str r0, [r4] + ldr r0, _08148158 + str r0, [r4, 0x4] + ldr r0, _0814815C + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08148134: .4byte 0x040000b0 +_08148138: .4byte 0x0000c5ff +_0814813C: .4byte 0x00007fff +_08148140: .4byte 0x0203aba0 +_08148144: .4byte 0x040000d4 +_08148148: .4byte 0x02038c28 +_0814814C: .4byte 0x800000a0 +_08148150: .4byte 0x04000012 +_08148154: .4byte 0x020393a8 +_08148158: .4byte 0x04000040 +_0814815C: .4byte 0xa2400001 + thumb_func_end sub_81480CC + + thumb_func_start sub_8148160 +sub_8148160: @ 8148160 + push {r4,lr} + ldr r4, _081481B4 + ldrh r1, [r4, 0xA] + ldr r0, _081481B8 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _081481BC + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r2, _081481C0 + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0 + beq _08148198 + ldr r1, _081481C4 + ldr r0, _081481C8 + str r0, [r1] + movs r3, 0xF0 + lsls r3, 3 + adds r0, r3 + str r0, [r1, 0x4] + ldr r0, _081481CC + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08148198: + ldr r1, _081481D0 + ldr r0, [r2] + ldrh r0, [r0, 0xE] + strh r0, [r1] + ldr r0, _081481D4 + str r0, [r4] + ldr r0, _081481D8 + str r0, [r4, 0x4] + ldr r0, _081481DC + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081481B4: .4byte 0x040000b0 +_081481B8: .4byte 0x0000c5ff +_081481BC: .4byte 0x00007fff +_081481C0: .4byte 0x0203aba0 +_081481C4: .4byte 0x040000d4 +_081481C8: .4byte 0x02038c28 +_081481CC: .4byte 0x800000a0 +_081481D0: .4byte 0x04000050 +_081481D4: .4byte 0x020393a8 +_081481D8: .4byte 0x04000054 +_081481DC: .4byte 0xa2400001 + thumb_func_end sub_8148160 + + thumb_func_start sub_81481E0 +sub_81481E0: @ 81481E0 + push {lr} + ldr r0, _081481F4 + ldrh r0, [r0] + cmp r0, 0x4F + bhi _08148200 + ldr r1, _081481F8 + ldr r0, _081481FC + ldr r0, [r0] + ldrh r0, [r0, 0x18] + b _08148208 + .align 2, 0 +_081481F4: .4byte 0x04000006 +_081481F8: .4byte 0x04000010 +_081481FC: .4byte 0x0203aba0 +_08148200: + ldr r1, _08148210 + ldr r0, _08148214 + ldr r0, [r0] + ldrh r0, [r0, 0x1A] +_08148208: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08148210: .4byte 0x04000010 +_08148214: .4byte 0x0203aba0 + thumb_func_end sub_81481E0 + + thumb_func_start sub_8148218 +sub_8148218: @ 8148218 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, _08148360 + movs r2, 0x26 + ldrsh r1, [r4, r2] + mov r8, r1 + add r0, r8 + ldrb r0, [r0] + ldr r2, _08148364 + lsls r1, 2 + mov r8, r1 + adds r1, r2 + ldrh r1, [r1] + subs r1, 0x20 + lsls r1, 16 + asrs r1, 16 + adds r2, 0x2 + add r2, r8 + ldrh r2, [r2] + adds r2, 0x2A + lsls r2, 16 + asrs r2, 16 + ldr r5, _08148368 + str r5, [sp] + movs r3, 0 + bl sub_80B5E6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r0, _0814836C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x88 + lsls r1, 1 + str r5, [sp] + movs r2, 0x6A + movs r3, 0 + bl sub_80B5E6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + movs r3, 0x22 + ldrsh r0, [r4, r3] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r1, _08148370 + adds r5, r1 + movs r2, 0x24 + ldrsh r0, [r4, r2] + lsls r6, r0, 4 + adds r6, r0 + lsls r6, 2 + adds r6, r1 + ldr r0, _08148374 + str r0, [r5, 0x1C] + str r0, [r6, 0x1C] + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + ldrb r0, [r6, 0x1] + orrs r0, r1 + strb r0, [r6, 0x1] + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r0, 24 + movs r3, 0x1F + mov r9, r3 + mov r4, r9 + ands r0, r4 + lsls r0, 1 + ldrb r2, [r5, 0x3] + movs r4, 0x3F + negs r4, r4 + adds r1, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x3] + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + ands r0, r1 + lsls r0, 1 + ldrb r1, [r6, 0x3] + ands r4, r1 + orrs r4, r0 + strb r4, [r6, 0x3] + ldrb r2, [r5, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r2 + movs r2, 0x40 + orrs r0, r2 + strb r0, [r5, 0x1] + ldrb r0, [r6, 0x1] + ands r1, r0 + orrs r1, r2 + strb r1, [r6, 0x1] + ldrb r0, [r5, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r5, 0x3] + ldrb r0, [r6, 0x3] + orrs r0, r1 + strb r0, [r6, 0x3] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl oam_center + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl oam_center + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r2, _08148378 + mov r3, r8 + adds r1, r3, r2 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r2, 0x2 + add r8, r2 + mov r3, r8 + movs r4, 0 + ldrsh r2, [r3, r4] + movs r3, 0 + bl sub_8008478 + ldrb r0, [r6, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r1, _0814837C + movs r2, 0x80 + lsls r2, 2 + movs r3, 0 + bl sub_8008478 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08148360: .4byte 0x085c8bf4 +_08148364: .4byte 0x085c8c0e +_08148368: .4byte 0x0201c000 +_0814836C: .4byte 0x03005d90 +_08148370: .4byte 0x02020630 +_08148374: .4byte sub_8148380 + 1 +_08148378: .4byte 0x085c8bfa +_0814837C: .4byte 0xfffffe00 + thumb_func_end sub_8148218 + + thumb_func_start sub_8148380 +sub_8148380: @ 8148380 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _081483A4 +_08148386: + movs r1, 0x2E + 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 _08148386 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081483A4: .4byte 0x085c8c24 + thumb_func_end sub_8148380 + + thumb_func_start sub_81483A8 +sub_81483A8: @ 81483A8 + movs r0, 0 + bx lr + thumb_func_end sub_81483A8 + + thumb_func_start sub_81483AC +sub_81483AC: @ 81483AC + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, _081483F0 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r4, sp, 0x4 + ldr r1, _081483F4 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r1, 0x3C + ldrsh r0, [r5, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x30] + movs r1, 0x3C + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r4, r0 + ldrh r0, [r4] + strh r0, [r5, 0x32] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081483F0: .4byte 0x085c8c40 +_081483F4: .4byte 0x085c8c44 + thumb_func_end sub_81483AC + + thumb_func_start sub_81483F8 +sub_81483F8: @ 81483F8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + ldrh r3, [r1, 0x20] + adds r2, r0, r3 + strh r2, [r1, 0x20] + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08148416 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x84 + bgt _08148424 + b _0814841E +_08148416: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x67 + ble _08148424 +_0814841E: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_08148424: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_81483F8 + + thumb_func_start sub_814842C +sub_814842C: @ 814842C + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x32] + ldrh r0, [r2, 0x30] + adds r1, r3, r0 + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + lsls r1, 16 + cmp r1, 0 + bne _08148452 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + negs r0, r3 + strh r0, [r2, 0x32] + movs r0, 0x1 + strh r0, [r2, 0x3A] +_08148452: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_814842C + + thumb_func_start sub_8148458 +sub_8148458: @ 8148458 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + adds r0, r1 + strh r0, [r2, 0x30] + ldrh r1, [r2, 0x20] + adds r1, r0 + strh r1, [r2, 0x20] + adds r1, 0x1F + lsls r1, 16 + movs r0, 0x97 + lsls r0, 17 + cmp r1, r0 + bls _0814847C + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] +_0814847C: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8148458 + + thumb_func_start sub_8148484 +sub_8148484: @ 8148484 + ldr r3, _08148498 + lsls r0, 16 + asrs r0, 16 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + strh r1, [r2, 0x3C] + bx lr + .align 2, 0 +_08148498: .4byte 0x02020630 + thumb_func_end sub_8148484 + + thumb_func_start sub_814849C +sub_814849C: @ 814849C + ldr r2, _081484B4 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + bx lr + .align 2, 0 +_081484B4: .4byte 0x02020630 + thumb_func_end sub_814849C + + thumb_func_start sub_81484B8 +sub_81484B8: @ 81484B8 + ldr r2, _081484CC + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x3A + ldrsh r0, [r1, r2] + bx lr + .align 2, 0 +_081484CC: .4byte 0x02020630 + thumb_func_end sub_81484B8 + + thumb_func_start sub_81484D0 +sub_81484D0: @ 81484D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08148500 + ldr r2, _08148504 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081484E2: + 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 _081484E2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08148500: .4byte 0x085c8c48 +_08148504: .4byte 0x03005e00 + thumb_func_end sub_81484D0 + + thumb_func_start sub_8148508 +sub_8148508: @ 8148508 + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r4, 0 + movs r3, 0 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0xC] + movs r0, 0x1 + strh r0, [r5, 0xE] + ldr r2, _08148580 + ldr r1, [r2] + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r3, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + ldrb r0, [r1] + strb r4, [r1] + ldr r4, _08148584 + adds r6, r2, 0 + movs r2, 0xF0 +_0814853A: + lsls r1, r3, 1 + adds r1, r4 + ldr r0, [r6] + ldrh r0, [r0, 0x14] + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xA0 + lsls r0, 1 + adds r0, r4 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x9F + bls _0814853A + movs r0, 0x2 + bl enable_irqs + movs r0, 0x4 + movs r1, 0x10 + bl lcd_io_set_bits + ldr r0, _08148588 + bl SetVBlankCallback + ldr r0, _0814858C + bl SetHBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08148580: .4byte 0x0203aba0 +_08148584: .4byte 0x020393a8 +_08148588: .4byte sub_814869C + 1 +_0814858C: .4byte sub_8148728 + 1 + thumb_func_end sub_8148508 + + thumb_func_start sub_8148590 +sub_8148590: @ 8148590 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r3, r0, 0 + ldr r2, _0814860C + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r0, [r3, 0xC] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r3, 0xA] + adds r0, r1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + mov r8, r2 + cmp r0, 0xF0 + ble _081485BC + movs r0, 0xF0 + strh r0, [r3, 0xA] +_081485BC: + ldrh r4, [r3, 0xC] + movs r0, 0xC + ldrsh r1, [r3, r0] + ldr r0, _08148610 + ldrh r2, [r3, 0xE] + cmp r1, r0 + bgt _081485CE + adds r0, r4, r2 + strh r0, [r3, 0xC] +_081485CE: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x7F + bgt _081485DA + lsls r0, r2, 1 + strh r0, [r3, 0xE] +_081485DA: + movs r5, 0 + ldr r7, _08148614 + movs r1, 0xA0 + lsls r1, 1 + adds r1, r7 + mov r12, r1 + mov r6, r8 +_081485E8: + lsls r0, r5, 1 + adds r2, r0, r7 + mov r1, r12 + adds r4, r0, r1 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _08148618 + ldr r1, [r6] + ldrh r0, [r3, 0xA] + ldrh r1, [r1, 0x14] + adds r0, r1 + strh r0, [r2] + ldrh r1, [r3, 0xA] + movs r0, 0xF0 + subs r0, r1 + b _0814862A + .align 2, 0 +_0814860C: .4byte 0x0203aba0 +_08148610: .4byte 0x00000fff +_08148614: .4byte 0x02038c28 +_08148618: + ldr r0, [r6] + ldrh r0, [r0, 0x14] + ldrh r1, [r3, 0xA] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r3, 0xA] + lsls r0, 8 + movs r1, 0xF1 + orrs r0, r1 +_0814862A: + strh r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9F + bls _081485E8 + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, 0xEF + ble _08148644 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08148644: + mov r1, r8 + ldr r0, [r1] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8148590 + + thumb_func_start sub_814865C +sub_814865C: @ 814865C + push {lr} + ldr r1, _0814868C + ldrh r2, [r1, 0xA] + ldr r0, _08148690 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08148694 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, _08148698 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0814868C: .4byte 0x040000b0 +_08148690: .4byte 0x0000c5ff +_08148694: .4byte 0x00007fff +_08148698: .4byte sub_81484D0 + 1 + thumb_func_end sub_814865C + + thumb_func_start sub_814869C +sub_814869C: @ 814869C + push {r4,lr} + ldr r4, _081486FC + ldrh r1, [r4, 0xA] + ldr r0, _08148700 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _08148704 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r2, _08148708 + ldr r0, _0814870C + ldr r1, [r0] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldrb r0, [r1] + cmp r0, 0 + beq _081486E6 + ldr r1, _08148710 + ldr r0, _08148714 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _08148718 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081486E6: + ldr r0, _0814871C + str r0, [r4] + ldr r0, _08148720 + str r0, [r4, 0x4] + ldr r0, _08148724 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081486FC: .4byte 0x040000b0 +_08148700: .4byte 0x0000c5ff +_08148704: .4byte 0x00007fff +_08148708: .4byte 0x04000048 +_0814870C: .4byte 0x0203aba0 +_08148710: .4byte 0x040000d4 +_08148714: .4byte 0x02038c28 +_08148718: .4byte 0x80000140 +_0814871C: .4byte 0x020394e8 +_08148720: .4byte 0x04000040 +_08148724: .4byte 0xa2400001 + thumb_func_end sub_814869C + + thumb_func_start sub_8148728 +sub_8148728: @ 8148728 + push {lr} + ldr r2, _08148754 + ldrh r0, [r2] + cmp r0, 0x9F + bhi _0814874E + ldr r1, _08148758 + ldrh r0, [r2] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _0814875C + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] +_0814874E: + pop {r0} + bx r0 + .align 2, 0 +_08148754: .4byte 0x04000006 +_08148758: .4byte 0x02038c28 +_0814875C: .4byte 0x04000014 + thumb_func_end sub_8148728 + + thumb_func_start sub_8148760 +sub_8148760: @ 8148760 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08148790 + ldr r2, _08148794 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148772: + 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 _08148772 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08148790: .4byte 0x085c8c54 +_08148794: .4byte 0x03005e00 + thumb_func_end sub_8148760 + + thumb_func_start sub_8148798 +sub_8148798: @ 8148798 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, _08148854 + ldr r1, [r0] + movs r2, 0 + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r4, 0 + ldr r5, _08148858 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r5 + mov r12, r0 + mov r8, r4 + movs r1, 0xF0 + mov r9, r1 +_081487CC: + lsls r2, r4, 1 + mov r7, r12 + adds r1, r2, r7 + ldr r0, _08148854 + ldr r3, [r0] + ldrh r0, [r3, 0x14] + strh r0, [r1] + adds r1, r4, 0 + adds r1, 0xA0 + lsls r1, 1 + adds r0, r1, r7 + mov r7, r9 + strh r7, [r0] + adds r2, r5 + ldrh r0, [r3, 0x14] + strh r0, [r2] + adds r1, r5 + mov r0, r9 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 1 + adds r0, r5 + mov r7, r8 + strh r7, [r0] + adds r1, 0xA0 + adds r0, r4, r1 + lsls r0, 1 + adds r0, r5 + subs r1, 0xE0 + strh r1, [r0] + movs r7, 0xA0 + lsls r7, 2 + adds r0, r4, r7 + lsls r0, 1 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9F + bls _081487CC + movs r0, 0 + strh r0, [r6, 0x10] + strh r0, [r6, 0x12] + movs r0, 0x7 + strh r0, [r6, 0x14] + movs r0, 0x2 + bl enable_irqs + ldr r0, _0814885C + bl SetVBlankCallback + ldr r0, _08148860 + bl SetHBlankCallback + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08148854: .4byte 0x0203aba0 +_08148858: .4byte 0x02038c28 +_0814885C: .4byte sub_814869C + 1 +_08148860: .4byte sub_8148728 + 1 + thumb_func_end sub_8148798 + + thumb_func_start sub_8148864 +sub_8148864: @ 8148864 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r9, r0 + ldr r1, _0814890C + mov r0, sp + movs r2, 0x2 + bl memcpy + add r4, sp, 0x4 + ldr r1, _08148910 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r2, _08148914 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + str r0, [sp, 0x8] + mov r10, r0 + mov r1, r9 + movs r3, 0x12 + ldrsh r0, [r1, r3] + ldr r1, [sp, 0x8] + cmp r1, r0 + ble _081488A4 + b _08148A68 +_081488A4: + movs r7, 0 + mov r2, r10 + negs r2, r2 + str r2, [sp, 0xC] + mov r3, r10 + adds r3, 0x1 + str r3, [sp, 0x10] +_081488B2: + movs r6, 0 + mov r0, sp + adds r0, r7 + mov r12, r0 +_081488BA: + lsls r0, r6, 1 + add r0, sp + adds r0, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + ldr r2, [sp, 0xC] + muls r0, r2 + lsls r0, 1 + mov r3, r12 + ldrb r3, [r3] + adds r0, r3 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _08148966 + cmp r0, 0x4F + bne _081488E2 + cmp r7, 0x1 + beq _08148966 +_081488E2: + lsls r1, r0, 1 + ldr r0, _08148918 + adds r4, r1, r0 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2 + adds r3, r1, r0 + ldr r0, _0814891C + adds r1, r0 + ldrh r2, [r4] + cmp r2, 0xEF + bls _08148920 + movs r1, 0xF0 + strh r1, [r4] + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + b _08148940 + .align 2, 0 +_0814890C: .4byte 0x085c8c64 +_08148910: .4byte 0x085c8c66 +_08148914: .4byte 0x0203aba0 +_08148918: .4byte 0x02038ea8 +_0814891C: .4byte 0x02039128 +_08148920: + ldrh r0, [r3] + lsrs r0, 8 + adds r0, r2, r0 + strh r0, [r4] + ldrh r0, [r1] + cmp r0, 0x7F + bhi _08148932 + lsls r0, 1 + strh r0, [r1] +_08148932: + ldrh r2, [r3] + ldr r0, _081489E0 + cmp r2, r0 + bhi _08148940 + ldrh r0, [r1] + adds r0, r2, r0 + strh r0, [r3] +_08148940: + lsls r0, r5, 16 + asrs r0, 15 + ldr r1, _081489E4 + adds r2, r0, r1 + ldr r1, _081489E8 + adds r3, r0, r1 + ldr r0, _081489EC + ldr r1, [r0] + ldrh r0, [r4] + ldrh r1, [r1, 0x14] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4] + movs r1, 0xF0 + subs r0, r1, r0 + strh r0, [r3] + mov r2, r10 + cmp r2, 0 + beq _08148970 +_08148966: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _081488BA +_08148970: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + bls _081488B2 + movs r7, 0 + ldr r3, _081489F0 + mov r8, r3 +_08148980: + movs r6, 0 + mov r0, sp + adds r0, r7 + mov r12, r0 + adds r1, r7, 0x1 + str r1, [sp, 0x14] +_0814898C: + mov r2, r12 + ldrb r1, [r2] + adds r1, 0x1 + lsls r0, r6, 1 + add r0, sp + adds r0, 0x4 + movs r3, 0 + ldrsh r0, [r0, r3] + ldr r2, [sp, 0xC] + muls r0, r2 + lsls r0, 1 + adds r1, r0 + lsls r1, 16 + lsrs r5, r1, 16 + asrs r1, 16 + cmp r1, 0xA0 + bgt _08148A40 + cmp r1, 0x50 + bne _081489B6 + cmp r7, 0x1 + beq _08148A40 +_081489B6: + lsls r1, 1 + mov r3, r8 + adds r4, r1, r3 + movs r0, 0xA0 + lsls r0, 1 + add r0, r8 + adds r3, r1, r0 + ldr r0, _081489F4 + adds r1, r0 + ldrh r2, [r4] + cmp r2, 0xEF + bls _081489F8 + movs r1, 0xF0 + strh r1, [r4] + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + b _08148A18 + .align 2, 0 +_081489E0: .4byte 0x00000fff +_081489E4: .4byte 0x02038c28 +_081489E8: .4byte 0x02038d68 +_081489EC: .4byte 0x0203aba0 +_081489F0: .4byte 0x02038ea8 +_081489F4: .4byte 0x02039128 +_081489F8: + ldrh r0, [r3] + lsrs r0, 8 + adds r0, r2, r0 + strh r0, [r4] + ldrh r0, [r1] + cmp r0, 0x7F + bhi _08148A0A + lsls r0, 1 + strh r0, [r1] +_08148A0A: + ldrh r2, [r3] + ldr r0, _08148AC4 + cmp r2, r0 + bhi _08148A18 + ldrh r0, [r1] + adds r0, r2, r0 + strh r0, [r3] +_08148A18: + lsls r0, r5, 16 + asrs r0, 15 + ldr r1, _08148AC8 + adds r2, r0, r1 + ldr r1, _08148ACC + adds r3, r0, r1 + ldr r1, _08148AD0 + ldr r0, [r1] + ldrh r1, [r0, 0x14] + ldrh r0, [r4] + subs r1, r0 + strh r1, [r2] + ldrh r0, [r4] + lsls r0, 8 + movs r1, 0xF1 + orrs r0, r1 + strh r0, [r3] + mov r2, r10 + cmp r2, 0 + beq _08148A4A +_08148A40: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _0814898C +_08148A4A: + ldr r3, [sp, 0x14] + lsls r0, r3, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + bls _08148980 + ldr r1, [sp, 0x10] + lsls r0, r1, 16 + lsrs r0, 16 + mov r10, r0 + mov r2, r9 + movs r3, 0x12 + ldrsh r0, [r2, r3] + cmp r10, r0 + bgt _08148A68 + b _081488A4 +_08148A68: + mov r1, r9 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _08148A7A + movs r0, 0 + strh r0, [r1, 0x10] +_08148A7A: + mov r2, r9 + movs r3, 0x10 + ldrsh r0, [r2, r3] + cmp r0, 0 + bgt _08148A98 + movs r1, 0x12 + ldrsh r0, [r2, r1] + adds r0, 0x1 + cmp r0, 0x14 + bgt _08148A98 + ldrh r0, [r2, 0x14] + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x12] + adds r0, 0x1 + strh r0, [r2, 0x12] +_08148A98: + ldr r2, [sp, 0x8] + cmp r2, 0x9F + bls _08148AA6 + mov r3, r9 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08148AA6: + ldr r0, _08148AD0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08148AC4: .4byte 0x00000fff +_08148AC8: .4byte 0x02038c28 +_08148ACC: .4byte 0x02038d68 +_08148AD0: .4byte 0x0203aba0 + thumb_func_end sub_8148864 + + thumb_func_start sub_8148AD4 +sub_8148AD4: @ 8148AD4 + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0x1 + ldr r5, _08148B0C + movs r1, 0 + ldr r4, _08148B10 +_08148AE0: + lsls r0, r1, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xF0 + beq _08148AF0 + cmp r0, r5 + beq _08148AF0 + movs r2, 0 +_08148AF0: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _08148AE0 + cmp r2, 0x1 + bne _08148B04 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08148B04: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08148B0C: .4byte 0x0000ff10 +_08148B10: .4byte 0x020393a8 + thumb_func_end sub_8148AD4 + + thumb_func_start sub_8148B14 +sub_8148B14: @ 8148B14 + push {lr} + ldr r1, _08148B44 + ldrh r2, [r1, 0xA] + ldr r0, _08148B48 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08148B4C + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, _08148B50 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08148B44: .4byte 0x040000b0 +_08148B48: .4byte 0x0000c5ff +_08148B4C: .4byte 0x00007fff +_08148B50: .4byte sub_8148760 + 1 + thumb_func_end sub_8148B14 + + thumb_func_start sub_8148B54 +sub_8148B54: @ 8148B54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08148B84 + ldr r2, _08148B88 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148B66: + 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 _08148B66 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08148B84: .4byte 0x085c8c6c +_08148B88: .4byte 0x03005e00 + thumb_func_end sub_8148B54 + + thumb_func_start sub_8148B8C +sub_8148B8C: @ 8148B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08148BBC + ldr r2, _08148BC0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148B9E: + 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 _08148B9E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08148BBC: .4byte 0x085c8c78 +_08148BC0: .4byte 0x03005e00 + thumb_func_end sub_8148B8C + + thumb_func_start sub_8148BC4 +sub_8148BC4: @ 8148BC4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, _08148C18 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + ldr r0, _08148C1C + movs r2, 0 + movs r1, 0x9F + ldr r3, _08148C20 + adds r0, r3 +_08148BEE: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08148BEE + movs r4, 0 + ldr r0, _08148C24 + bl SetVBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + strh r0, [r5, 0xA] + adds r0, 0xFF + strh r0, [r5, 0xC] + strh r4, [r5, 0x16] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08148C18: .4byte 0x0203aba0 +_08148C1C: .4byte 0x02038c28 +_08148C20: .4byte 0x000008be +_08148C24: .4byte sub_8146F68 + 1 + thumb_func_end sub_8148BC4 + + thumb_func_start sub_8148C28 +sub_8148C28: @ 8148C28 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08148C6C + ldr r1, _08148C60 + ldrh r2, [r1, 0xA] + ldr r0, _08148C64 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08148C68 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + movs r0, 0 + bl SetVBlankCallback + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _08148CDE + .align 2, 0 +_08148C60: .4byte 0x040000b0 +_08148C64: .4byte 0x0000c5ff +_08148C68: .4byte 0x00007fff +_08148C6C: + ldr r5, _08148CC8 + ldr r1, [r5] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r2, [r4, 0xC] + movs r0, 0xC + ldrsh r1, [r4, r0] + ldr r0, _08148CCC + cmp r1, r0 + bgt _08148C88 + adds r0, r2, 0 + adds r0, 0x80 + strh r0, [r4, 0xC] +_08148C88: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x9F + bgt _08148C9C + ldrh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 24 + adds r0, r1, r0 + strh r0, [r4, 0xA] +_08148C9C: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + ble _08148CA8 + movs r0, 0xA0 + strh r0, [r4, 0xA] +_08148CA8: + ldr r0, _08148CD0 + movs r2, 0xA + ldrsh r3, [r4, r2] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + bne _08148CD4 + movs r0, 0x1 + strh r0, [r4, 0x16] + bl sub_8149F84 + b _08148CDE + .align 2, 0 +_08148CC8: .4byte 0x0203aba0 +_08148CCC: .4byte 0x000003ff +_08148CD0: .4byte 0x02038c28 +_08148CD4: + ldr r0, [r5] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] +_08148CDE: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8148C28 + + thumb_func_start sub_8148CE8 +sub_8148CE8: @ 8148CE8 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _08148D60 + ldr r0, [r6] + ldrb r1, [r0] + movs r5, 0 + strb r5, [r0] + ldrh r1, [r4, 0x16] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08148D0A + adds r0, r1, 0x1 + strh r0, [r4, 0x16] + movs r0, 0x30 + strh r0, [r4, 0xA] + strh r5, [r4, 0x14] +_08148D0A: + ldr r1, _08148D64 + movs r2, 0x14 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r4, 0xA] + adds r0, r1 + strh r0, [r4, 0xA] + movs r2, 0x14 + ldrsh r1, [r4, r2] + adds r1, 0x1 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + strh r1, [r4, 0x14] + ldr r0, _08148D68 + movs r1, 0xA + ldrsh r3, [r4, r1] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bgt _08148D4C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0x16] +_08148D4C: + ldr r0, [r6] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08148D60: .4byte 0x0203aba0 +_08148D64: .4byte 0x085c8c80 +_08148D68: .4byte 0x02038c28 + thumb_func_end sub_8148CE8 + + thumb_func_start sub_8148D6C +sub_8148D6C: @ 8148D6C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08148DE8 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r1, [r4, 0x16] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08148D8E + adds r0, r1, 0x1 + strh r0, [r4, 0x16] + movs r0, 0x2 + strh r0, [r4, 0x12] + strh r0, [r4, 0x14] +_08148D8E: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + ble _08148D9A + movs r0, 0xA0 + strh r0, [r4, 0xA] +_08148D9A: + ldr r0, _08148DEC + movs r2, 0xA + ldrsh r3, [r4, r2] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + bne _08148DD6 + ldr r1, _08148DF0 + ldrh r2, [r1, 0xA] + ldr r0, _08148DF4 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08148DF8 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_08148DD6: + ldrh r2, [r4, 0x12] + ldrb r0, [r4, 0x12] + cmp r0, 0x80 + bgt _08148DFC + ldrh r1, [r4, 0x14] + adds r0, r2, 0 + adds r0, 0x8 + b _08148E08 + .align 2, 0 +_08148DE8: .4byte 0x0203aba0 +_08148DEC: .4byte 0x02038c28 +_08148DF0: .4byte 0x040000b0 +_08148DF4: .4byte 0x0000c5ff +_08148DF8: .4byte 0x00007fff +_08148DFC: + ldrh r0, [r4, 0x14] + subs r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r2, 0 + adds r0, 0x10 +_08148E08: + strh r0, [r4, 0x12] + movs r0, 0xFF + ands r2, r0 + lsls r1, 16 + asrs r1, 16 + adds r0, r2, 0 + bl sine + ldrh r2, [r4, 0xA] + adds r0, r2 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _08148E28 + movs r0, 0x1 + strh r0, [r4, 0xA] +_08148E28: + ldrh r0, [r4, 0x12] + lsls r1, r0, 16 + asrs r0, r1, 16 + cmp r0, 0xFE + ble _08148E3C + asrs r0, r1, 24 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] +_08148E3C: + ldr r0, _08148E50 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08148E50: .4byte 0x0203aba0 + thumb_func_end sub_8148D6C + + thumb_func_start sub_8148E54 +sub_8148E54: @ 8148E54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08148E84 + ldr r2, _08148E88 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148E66: + 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 _08148E66 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08148E84: .4byte 0x085c8c84 +_08148E88: .4byte 0x03005e00 + thumb_func_end sub_8148E54 + + thumb_func_start sub_8148E8C +sub_8148E8C: @ 8148E8C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + ldr r4, _08148F30 + ldr r1, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0x10 + bl CpuSet + movs r0, 0xE0 + lsls r0, 1 + adds r4, r0 + ldr r1, [sp, 0x8] + adds r1, 0x40 + adds r0, r4, 0 + movs r2, 0x10 + bl CpuSet + mov r1, sp + movs r2, 0xF0 + lsls r2, 8 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _08148F34 + mov r0, sp + bl CpuSet + ldr r0, _08148F38 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r1, 0 + movs r4, 0x1 + movs r0, 0x1 + strh r0, [r5, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + ldr r5, _08148F3C + strb r1, [r5] + ldr r0, _08148F40 + strh r0, [r5, 0x2] + strb r4, [r5, 0x4] + movs r2, 0x9A + lsls r2, 1 + strh r2, [r5, 0x6] + strb r1, [r5, 0x8] + strb r1, [r5, 0xC] + movs r0, 0x1 + negs r0, r0 + strh r0, [r5, 0xE] + strb r4, [r5, 0x10] + strh r2, [r5, 0x12] + strb r1, [r5, 0x14] + strb r1, [r5, 0x18] + ldr r2, _08148F44 + strh r2, [r5, 0x1A] + strb r4, [r5, 0x1C] + ldr r3, _08148F48 + strh r3, [r5, 0x1E] + adds r0, r5, 0 + adds r0, 0x20 + strb r1, [r0] + adds r0, 0x4 + strb r1, [r0] + strh r2, [r5, 0x26] + adds r0, 0x4 + strb r4, [r0] + strh r3, [r5, 0x2A] + adds r0, 0x4 + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08148F30: .4byte 0x085bacd0 +_08148F34: .4byte 0x01000400 +_08148F38: .4byte 0x085c8ed4 +_08148F3C: .4byte 0x03001210 +_08148F40: .4byte 0x0000ffff +_08148F44: .4byte 0x0000fffd +_08148F48: .4byte 0x00000133 + thumb_func_end sub_8148E8C + + thumb_func_start sub_8148F4C +sub_8148F4C: @ 8148F4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + movs r7, 0x1 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + movs r0, 0 +_08148F62: + movs r5, 0 + adds r6, r0, 0x1 +_08148F66: + ldr r1, _08148FF8 + lsrs r0, r5, 1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + ldr r2, _08148FFC + adds r4, r1, r2 + adds r1, r4, 0 + bl sub_8149048 + lsls r0, 16 + cmp r0, 0 + beq _08148FCA + movs r7, 0 + ldrh r2, [r4, 0x2] + movs r0, 0x1 + ands r0, r5 + cmp r0, 0x1 + bne _08148FA0 + ldr r0, _08149000 + adds r1, r0, 0 + lsls r0, r2, 16 + asrs r0, 16 + subs r1, r0 + lsls r1, 16 + lsrs r2, r1, 16 +_08148FA0: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r0, r1, 0 + cmp r1, 0 + bge _08148FAC + adds r0, 0x1F +_08148FAC: + asrs r2, r0, 5 + lsls r0, r2, 5 + subs r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r2, 5 + lsls r0, 16 + asrs r0, 16 + adds r1, r0 + ldr r0, [sp] + lsls r1, 1 + adds r1, r0 + ldr r2, _08149004 + adds r0, r2, 0 + strh r0, [r1] +_08148FCA: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _08148F66 + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08148F62 + cmp r7, 0x1 + bne _08148FE8 + mov r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_08148FE8: + movs r0, 0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08148FF8: .4byte 0x085c8d38 +_08148FFC: .4byte 0x03001210 +_08149000: .4byte 0x0000027d +_08149004: .4byte 0x0000f002 + thumb_func_end sub_8148F4C + + thumb_func_start sub_8149008 +sub_8149008: @ 8149008 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _0814903C + ldrh r2, [r1, 0xA] + ldr r0, _08149040 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08149044 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814903C: .4byte 0x040000b0 +_08149040: .4byte 0x0000c5ff +_08149044: .4byte 0x00007fff + thumb_func_end sub_8149008 + + thumb_func_start sub_8149048 +sub_8149048: @ 8149048 + push {r4,lr} + adds r2, r1, 0 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r3, [r1] + ldrb r0, [r2, 0x4] + lsls r0, 1 + adds r0, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081490CE + ldr r1, _0814908C + ldrh r0, [r3] + strh r0, [r1] + ldrh r0, [r3, 0x2] + strh r0, [r1] + ldrh r0, [r3, 0x4] + strh r0, [r1] + ldrh r0, [r3, 0x6] + strh r0, [r1] + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + beq _081490A0 + cmp r0, 0x2 + bgt _08149090 + cmp r0, 0x1 + beq _0814909A + b _081490B2 + .align 2, 0 +_0814908C: .4byte 0x03001208 +_08149090: + cmp r0, 0x3 + beq _081490A6 + cmp r0, 0x4 + beq _081490AC + b _081490B2 +_0814909A: + ldrh r0, [r2, 0x2] + adds r0, 0x1 + b _081490B0 +_081490A0: + ldrh r0, [r2, 0x2] + subs r0, 0x1 + b _081490B0 +_081490A6: + ldrh r0, [r2, 0x2] + subs r0, 0x20 + b _081490B0 +_081490AC: + ldrh r0, [r2, 0x2] + adds r0, 0x20 +_081490B0: + strh r0, [r2, 0x2] +_081490B2: + movs r4, 0x2 + ldrsh r1, [r2, r4] + ldr r0, _081490D4 + cmp r1, r0 + bgt _081490CE + ldrb r0, [r2, 0x4] + lsls r0, 1 + adds r0, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _081490D8 +_081490CE: + movs r0, 0 + b _08149138 + .align 2, 0 +_081490D4: .4byte 0x0000027f +_081490D8: + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _081490F4 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + bne _081490F4 + movs r0, 0x1 + strb r0, [r2, 0x8] + strb r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + strh r0, [r2, 0x2] + movs r0, 0x4 + strb r0, [r2] +_081490F4: + ldrb r0, [r2, 0x4] + lsls r0, 1 + adds r0, r3 + movs r3, 0x2 + ldrsh r1, [r2, r3] + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r1, r0 + bne _08149136 + ldrb r0, [r2] + adds r1, r0, 0x1 + strb r1, [r2] + ldrb r0, [r2, 0x8] + cmp r0, 0x1 + bne _08149124 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x7 + bls _08149136 + ldrb r0, [r2, 0x4] + adds r0, 0x1 + strb r0, [r2, 0x4] + movs r0, 0x4 + b _08149134 +_08149124: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08149136 + ldrb r0, [r2, 0x4] + adds r0, 0x1 + strb r0, [r2, 0x4] + movs r0, 0 +_08149134: + strb r0, [r2] +_08149136: + movs r0, 0x1 +_08149138: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8149048 + + thumb_func_start sub_8149140 +sub_8149140: @ 8149140 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08149170 + ldr r2, _08149174 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08149152: + 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 _08149152 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08149170: .4byte 0x085c8d40 +_08149174: .4byte 0x03005e00 + thumb_func_end sub_8149140 + + thumb_func_start sub_8149178 +sub_8149178: @ 8149178 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _081491BC + mov r0, sp + bl CpuSet + ldr r0, _081491C0 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _081491C4 + ldr r1, [sp, 0x4] + bl LZ77UnCompVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081491BC: .4byte 0x01000400 +_081491C0: .4byte 0x085be51c +_081491C4: .4byte 0x085bea88 + thumb_func_end sub_8149178 + + thumb_func_start sub_81491C8 +sub_81491C8: @ 81491C8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08149200 + adds r0, r5, 0 + movs r1, 0x1E + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r0, 11 + ldr r1, _08149220 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08149200: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3A + ble _08149218 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] +_08149218: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08149220: .4byte 0x085bf0a0 + thumb_func_end sub_81491C8 + + thumb_func_start sub_8149224 +sub_8149224: @ 8149224 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08149252 + adds r0, r5, 0 + movs r1, 0x5 + bl __divsi3 + lsls r0, 16 + asrs r0, 11 + ldr r1, _08149278 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08149252: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x44 + ble _0814926E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x1E + strh r0, [r4, 0x18] +_0814926E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08149278: .4byte 0x085bf2a0 + thumb_func_end sub_8149224 + + thumb_func_start sub_814927C +sub_814927C: @ 814927C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _081492AC + ldr r2, _081492B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814928E: + 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 _0814928E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081492AC: .4byte 0x085c8d60 +_081492B0: .4byte 0x03005e00 + thumb_func_end sub_814927C + + thumb_func_start sub_81492B4 +sub_81492B4: @ 81492B4 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r1, _0814933C + movs r0, 0x8 + bl lcd_io_set + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _08149340 + mov r0, sp + bl CpuSet + ldr r0, _08149344 + ldr r1, [sp, 0x8] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldr r0, _08149348 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, _0814934C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r2, 0 + ldr r3, _08149350 + movs r6, 0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r3, r0 + movs r4, 0x80 + lsls r4, 1 +_08149316: + lsls r1, r2, 1 + adds r0, r1, r3 + strh r6, [r0] + adds r1, r5 + strh r4, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9F + bls _08149316 + ldr r0, _08149354 + bl SetVBlankCallback + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814933C: .4byte 0x00009a08 +_08149340: .4byte 0x01000400 +_08149344: .4byte 0x085bf6a0 +_08149348: .4byte 0x0203aba0 +_0814934C: .4byte 0x085bf540 +_08149350: .4byte 0x02038c28 +_08149354: .4byte sub_8149508 + 1 + thumb_func_end sub_81492B4 + + thumb_func_start sub_8149358 +sub_8149358: @ 8149358 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, _08149384 + ldr r1, [sp] + movs r2, 0x80 + lsls r2, 4 + bl CpuSet + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08149384: .4byte 0x085c6be0 + thumb_func_end sub_8149358 + + thumb_func_start sub_8149388 +sub_8149388: @ 8149388 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081493B4 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _081493A0 + adds r0, 0x3 +_081493A0: + lsls r0, 14 + lsrs r0, 16 + adds r0, 0x5 + lsls r0, 5 + ldr r1, _081493D4 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_081493B4: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _081493CC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] +_081493CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081493D4: .4byte 0x085bf4a0 + thumb_func_end sub_8149388 + + thumb_func_start sub_81493D8 +sub_81493D8: @ 81493D8 + push {lr} + sub sp, 0x4 + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08149402 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, _0814940C + str r2, [sp] + movs r1, 0x2 + movs r3, 0x10 + bl sub_80A1AD4 +_08149402: + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_0814940C: .4byte 0xffff8000 + thumb_func_end sub_81493D8 + + thumb_func_start sub_8149410 +sub_8149410: @ 8149410 + push {lr} + adds r2, r0, 0 + ldr r0, _08149434 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814942E + ldr r0, _08149438 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x20] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0814942E: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08149434: .4byte 0x02037fd4 +_08149438: .4byte 0x0203aba0 + thumb_func_end sub_8149410 + + thumb_func_start sub_814943C +sub_814943C: @ 814943C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08149464 + movs r1, 0x8 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _08149468 + movs r1, 0 + movs r2, 0 + bl sub_80A2A20 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08149464: .4byte 0x00007fff +_08149468: .4byte 0xffff8000 + thumb_func_end sub_814943C + + thumb_func_start sub_814946C +sub_814946C: @ 814946C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0814949A + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r0, 11 + ldr r1, _081494F8 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_0814949A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _081494F0 + ldr r0, _081494FC + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r5, _08149500 + ldr r3, _08149504 + movs r2, 0 +_081494C4: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _081494C4 + adds r0, r5, 0 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x8] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r4, 0xC] + strh r2, [r4, 0x16] + movs r0, 0 + bl lcd_io_clear_bits +_081494F0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081494F8: .4byte 0x085bf4a0 +_081494FC: .4byte 0x0203aba0 +_08149500: .4byte sub_8146F68 + 1 +_08149504: .4byte 0x020393a8 + thumb_func_end sub_814946C + + thumb_func_start sub_8149508 +sub_8149508: @ 8149508 + push {lr} + ldr r1, _08149534 + ldrh r2, [r1, 0xA] + ldr r0, _08149538 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _0814953C + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F2C + ldr r0, _08149540 + ldr r0, [r0] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08149548 + ldr r2, _08149544 + b _08149554 + .align 2, 0 +_08149534: .4byte 0x040000b0 +_08149538: .4byte 0x0000c5ff +_0814953C: .4byte 0x00007fff +_08149540: .4byte 0x0203aba0 +_08149544: .4byte 0x02038c28 +_08149548: + ldr r2, _08149568 + cmp r0, 0x1 + bne _08149554 + movs r0, 0xF0 + lsls r0, 3 + adds r2, r0 +_08149554: + ldr r1, _0814956C + str r2, [r1] + ldr r0, _08149570 + str r0, [r1, 0x4] + ldr r0, _08149574 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r0} + bx r0 + .align 2, 0 +_08149568: .4byte 0x02038c28 +_0814956C: .4byte 0x040000b0 +_08149570: .4byte 0x04000012 +_08149574: .4byte 0xa2400001 + thumb_func_end sub_8149508 + + thumb_func_start sub_8149578 +sub_8149578: @ 8149578 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _081495A8 + ldr r2, _081495AC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814958A: + 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 _0814958A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081495A8: .4byte 0x085c8d8c +_081495AC: .4byte 0x03005e00 + thumb_func_end sub_8149578 + + thumb_func_start sub_81495B0 +sub_81495B0: @ 81495B0 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, _08149618 + ldr r1, [r0] + movs r2, 0 + movs r0, 0xBF + strh r0, [r1, 0xE] + strh r2, [r1, 0x12] + movs r0, 0x1E + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r2, _0814961C + movs r4, 0 + movs r3, 0xF0 +_081495DC: + lsls r0, r1, 1 + adds r0, r2 + strh r4, [r0] + adds r0, r1, 0 + adds r0, 0xA0 + lsls r0, 1 + adds r0, r2 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _081495DC + movs r0, 0x2 + bl enable_irqs + ldr r0, _08149620 + bl SetHBlankCallback + ldr r0, _08149624 + bl SetVBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08149618: .4byte 0x0203aba0 +_0814961C: .4byte 0x020393a8 +_08149620: .4byte sub_8149840 + 1 +_08149624: .4byte sub_8149774 + 1 + thumb_func_end sub_81495B0 + + thumb_func_start sub_8149628 +sub_8149628: @ 8149628 + push {r4-r6,lr} + sub sp, 0x10 + adds r6, r0, 0 + ldr r1, _08149690 + mov r0, sp + movs r2, 0x10 + bl memcpy + movs r5, 0 + movs r4, 0 +_0814963C: + ldr r0, _08149694 + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08149698 + adds r2, r1, r0 + movs r0, 0xF0 + strh r0, [r2, 0x20] + strh r4, [r2, 0x22] + lsls r1, r5, 16 + asrs r1, 16 + lsls r0, r1, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r2, 0x38] + adds r1, 0x1 + lsls r1, 16 + lsls r0, r4, 16 + movs r3, 0xA0 + lsls r3, 13 + adds r0, r3 + lsrs r4, r0, 16 + lsrs r5, r1, 16 + asrs r1, 16 + cmp r1, 0x7 + ble _0814963C + ldrh r0, [r2, 0x3A] + adds r0, 0x1 + strh r0, [r2, 0x3A] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08149690: .4byte 0x085c8da0 +_08149694: .4byte sub_8149864 + 1 +_08149698: .4byte 0x02020630 + thumb_func_end sub_8149628 + + thumb_func_start sub_814969C +sub_814969C: @ 814969C + push {r4,lr} + adds r4, r0, 0 + ldr r2, _081496D0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, [r2] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + ble _081496C6 + movs r0, 0x1 + negs r0, r0 + ldr r2, _081496D4 + movs r1, 0x10 + bl sub_80A2A20 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081496C6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081496D0: .4byte 0x0203aba0 +_081496D4: .4byte 0x00007fff + thumb_func_end sub_814969C + + thumb_func_start sub_81496D8 +sub_81496D8: @ 81496D8 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, _0814972C + ldr r0, [r4] + ldrb r1, [r0] + movs r5, 0 + strb r5, [r0] + ldr r1, _08149730 + ldrh r2, [r1, 0xA] + ldr r0, _08149734 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08149738 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + ldr r1, [r4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + strh r5, [r1, 0x12] + movs r0, 0xFF + strh r0, [r1, 0xE] + movs r0, 0x3F + strh r0, [r1, 0x2] + ldr r0, _0814973C + bl SetVBlankCallback + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814972C: .4byte 0x0203aba0 +_08149730: .4byte 0x040000b0 +_08149734: .4byte 0x0000c5ff +_08149738: .4byte 0x00007fff +_0814973C: .4byte sub_8149804 + 1 + thumb_func_end sub_81496D8 + + thumb_func_start sub_8149740 +sub_8149740: @ 8149740 + push {lr} + ldr r0, _0814976C + ldr r1, [r0] + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x10 + bls _08149766 + bl sub_8149F84 + ldr r0, _08149770 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_08149766: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0814976C: .4byte 0x0203aba0 +_08149770: .4byte sub_8149578 + 1 + thumb_func_end sub_8149740 + + thumb_func_start sub_8149774 +sub_8149774: @ 8149774 + push {r4,lr} + ldr r4, _081497D8 + ldrh r1, [r4, 0xA] + ldr r0, _081497DC + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _081497E0 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r2, _081497E4 + ldr r0, _081497E8 + ldr r1, [r0] + ldrh r0, [r1, 0xE] + strh r0, [r2] + subs r2, 0x8 + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldrb r0, [r1] + cmp r0, 0 + beq _081497C4 + ldr r1, _081497EC + ldr r0, _081497F0 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _081497F4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081497C4: + ldr r0, _081497F8 + str r0, [r4] + ldr r0, _081497FC + str r0, [r4, 0x4] + ldr r0, _08149800 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081497D8: .4byte 0x040000b0 +_081497DC: .4byte 0x0000c5ff +_081497E0: .4byte 0x00007fff +_081497E4: .4byte 0x04000050 +_081497E8: .4byte 0x0203aba0 +_081497EC: .4byte 0x040000d4 +_081497F0: .4byte 0x02038c28 +_081497F4: .4byte 0x80000140 +_081497F8: .4byte 0x020394e8 +_081497FC: .4byte 0x04000040 +_08149800: .4byte 0xa2400001 + thumb_func_end sub_8149774 + + thumb_func_start sub_8149804 +sub_8149804: @ 8149804 + push {lr} + bl sub_8149F2C + ldr r1, _08149838 + ldr r0, _0814983C + ldr r2, [r0] + ldrh r0, [r2, 0x12] + strh r0, [r1] + subs r1, 0x4 + ldrh r0, [r2, 0xE] + strh r0, [r1] + subs r1, 0x8 + ldrh r0, [r2, 0x2] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x4] + strh r0, [r1] + subs r1, 0xA + ldrh r0, [r2, 0x6] + strh r0, [r1] + adds r1, 0x4 + ldrh r0, [r2, 0x8] + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08149838: .4byte 0x04000054 +_0814983C: .4byte 0x0203aba0 + thumb_func_end sub_8149804 + + thumb_func_start sub_8149840 +sub_8149840: @ 8149840 + ldr r2, _08149858 + ldr r1, _0814985C + ldr r0, _08149860 + ldrh r0, [r0] + lsls r0, 1 + movs r3, 0xF0 + lsls r3, 3 + adds r1, r3 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_08149858: .4byte 0x04000054 +_0814985C: .4byte 0x02038c28 +_08149860: .4byte 0x04000006 + thumb_func_end sub_8149840 + + thumb_func_start sub_8149864 +sub_8149864: @ 8149864 + push {r4-r6,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x38] + movs r2, 0x38 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08149890 + subs r0, r1, 0x1 + strh r0, [r3, 0x38] + movs r1, 0x3A + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0814994C + ldr r0, _0814988C + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0x1 + strb r0, [r1] + b _0814994C + .align 2, 0 +_0814988C: .4byte 0x0203aba0 +_08149890: + movs r2, 0x22 + ldrsh r1, [r3, r2] + lsls r1, 1 + ldr r0, _08149954 + adds r6, r1, r0 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2 + adds r5, r1, r0 + movs r4, 0 +_081498A4: + lsls r1, r4, 1 + adds r2, r1, r6 + ldrh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x20] + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _081498A4 + movs r1, 0x20 + ldrsh r0, [r3, r1] + ldrh r2, [r3, 0x20] + cmp r0, 0 + bne _081498DE + movs r0, 0x2E + ldrsh r1, [r3, r0] + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + bne _081498DE + movs r0, 0x1 + strh r0, [r3, 0x30] +_081498DE: + adds r1, r2, 0 + subs r1, 0x10 + strh r1, [r3, 0x20] + ldrh r0, [r3, 0x2E] + adds r0, 0x80 + strh r0, [r3, 0x2E] + lsls r1, 16 + cmp r1, 0 + bge _081498F4 + movs r0, 0 + strh r0, [r3, 0x20] +_081498F4: + movs r1, 0x2E + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 5 + cmp r0, r1 + ble _08149902 + strh r1, [r3, 0x2E] +_08149902: + movs r2, 0x3A + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08149914 + ldr r0, _08149958 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0x1 + strb r0, [r1] +_08149914: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0814994C + movs r2, 0x3A + ldrsh r0, [r3, r2] + ldr r2, _08149958 + cmp r0, 0 + beq _0814993E + ldr r0, [r2] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + ble _0814994C + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0814994C +_0814993E: + ldr r1, [r2] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + adds r0, r3, 0 + bl obj_delete_and_free_tiles +_0814994C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08149954: .4byte 0x02038c28 +_08149958: .4byte 0x0203aba0 + thumb_func_end sub_8149864 + + thumb_func_start sub_814995C +sub_814995C: @ 814995C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814998C + ldr r2, _08149990 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814996E: + 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 _0814996E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814998C: .4byte 0x085c8db0 +_08149990: .4byte 0x03005e00 + thumb_func_end sub_814995C + + thumb_func_start sub_8149994 +sub_8149994: @ 8149994 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + ldr r0, _081499DC + ldr r1, [sp, 0x8] + movs r2, 0x10 + bl CpuSet + mov r1, sp + movs r2, 0xF0 + lsls r2, 8 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _081499E0 + mov r0, sp + bl CpuSet + ldr r0, _081499E4 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081499DC: .4byte 0x085bacd0 +_081499E0: .4byte 0x01000400 +_081499E4: .4byte 0x085c8ed4 + thumb_func_end sub_8149994 + + thumb_func_start sub_81499E8 +sub_81499E8: @ 81499E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08149A2A + mov r0, sp + bl sub_8149F40 + movs r0, 0x3 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 5 + ldr r1, _08149A3C + adds r0, r1 + ldr r1, [sp] + movs r2, 0x10 + bl CpuSet + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0xD + ble _08149A2A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xA] +_08149A2A: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08149A3C: .4byte 0x085bacd0 + thumb_func_end sub_81499E8 + + thumb_func_start sub_8149A40 +sub_8149A40: @ 8149A40 + push {lr} + ldrh r1, [r0, 0xA] + subs r1, 0x1 + strh r1, [r0, 0xA] + lsls r1, 16 + cmp r1, 0 + bne _08149A60 + bl sub_8149F84 + ldr r0, _08149A68 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_08149A60: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08149A68: .4byte sub_814995C + 1 + thumb_func_end sub_8149A40 + + thumb_func_start sub_8149A6C +sub_8149A6C: @ 8149A6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08149A9C + ldr r2, _08149AA0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08149A7E: + 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 _08149A7E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08149A9C: .4byte 0x085c8dbc +_08149AA0: .4byte 0x03005e00 + thumb_func_end sub_8149A6C + + thumb_func_start sub_8149AA4 +sub_8149AA4: @ 8149AA4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, _08149AFC + ldr r1, [r0] + movs r2, 0 + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r2, _08149B00 + movs r3, 0xF0 + adds r4, r2, 0 +_08149AC8: + lsls r0, r1, 1 + adds r0, r2 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _08149AC8 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xA0 + bl CpuSet + ldr r0, _08149B04 + bl SetVBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08149AFC: .4byte 0x0203aba0 +_08149B00: .4byte 0x02038c28 +_08149B04: .4byte sub_8149CE8 + 1 + thumb_func_end sub_8149AA4 + + thumb_func_start sub_8149B08 +sub_8149B08: @ 8149B08 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + mov r8, r0 + ldr r0, _08149B7C + ldr r0, [r0] + adds r0, 0x24 + ldr r6, _08149B80 + mov r2, r8 + movs r3, 0xA + ldrsh r1, [r2, r3] + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 1 + adds r1, r4, r6 + movs r5, 0 + ldrsh r1, [r1, r5] + adds r2, r6, 0x2 + adds r2, r4, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r3, r6, 0x4 + adds r3, r4, r3 + movs r5, 0 + ldrsh r3, [r3, r5] + adds r5, r6, 0x6 + adds r4, r5 + movs r5, 0 + ldrsh r4, [r4, r5] + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + bl sub_814A1AC + mov r0, r8 + movs r2, 0xA + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r6, 0x8 + adds r0, r6 + ldrh r0, [r0] + mov r3, r8 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + movs r0, 0x1 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08149B7C: .4byte 0x0203aba0 +_08149B80: .4byte 0x085c8dd0 + thumb_func_end sub_8149B08 + + thumb_func_start sub_8149B84 +sub_8149B84: @ 8149B84 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + ldr r0, _08149BD4 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + mov r8, r0 + movs r7, 0 + ldr r0, _08149BD8 + mov r9, r0 +_08149BA0: + ldr r1, _08149BD8 + ldr r0, _08149BD4 + ldr r2, [r0] + movs r3, 0x2A + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsrs r3, r0, 8 + movs r5, 0xFF + ands r5, r0 + movs r4, 0xC + ldrsh r0, [r6, r4] + cmp r0, 0 + bne _08149BDC + movs r1, 0x28 + ldrsh r0, [r2, r1] + cmp r3, r0 + bge _08149BC8 + ldrh r3, [r2, 0x28] +_08149BC8: + lsls r0, r3, 16 + lsls r1, r5, 16 + cmp r0, r1 + ble _08149BF4 + lsrs r3, r1, 16 + b _08149BF4 + .align 2, 0 +_08149BD4: .4byte 0x0203aba0 +_08149BD8: .4byte 0x02038c28 +_08149BDC: + lsls r0, r5, 16 + asrs r0, 16 + movs r4, 0x28 + ldrsh r1, [r2, r4] + cmp r0, r1 + ble _08149BEA + ldrh r5, [r2, 0x28] +_08149BEA: + lsls r0, r5, 16 + lsls r1, r3, 16 + cmp r0, r1 + bgt _08149BF4 + lsrs r5, r1, 16 +_08149BF4: + ldr r0, _08149C18 + ldr r4, [r0] + movs r0, 0x2A + ldrsh r2, [r4, r0] + lsls r2, 1 + add r2, r9 + lsls r1, r3, 16 + asrs r1, 8 + lsls r0, r5, 16 + asrs r0, 16 + orrs r0, r1 + strh r0, [r2] + cmp r7, 0 + beq _08149C1C + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08149C40 + .align 2, 0 +_08149C18: .4byte 0x0203aba0 +_08149C1C: + adds r0, r4, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + lsrs r7, r0, 24 + mov r1, r8 + lsls r0, r1, 16 + movs r3, 0x80 + lsls r3, 9 + adds r0, r3 + lsrs r4, r0, 16 + mov r8, r4 + asrs r0, 16 + cmp r0, 0xF + ble _08149BA0 +_08149C40: + ldr r0, _08149C5C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08149C5C: .4byte 0x0203aba0 + thumb_func_end sub_8149B84 + + thumb_func_start sub_8149C60 +sub_8149C60: @ 8149C60 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _08149CAC + ldr r1, _08149C9C + ldrh r2, [r1, 0xA] + ldr r0, _08149CA0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, _08149CA4 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, _08149CA8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + b _08149CC4 + .align 2, 0 +_08149C9C: .4byte 0x040000b0 +_08149CA0: .4byte 0x0000c5ff +_08149CA4: .4byte 0x00007fff +_08149CA8: .4byte sub_8149A6C + 1 +_08149CAC: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldr r1, _08149CC8 + movs r3, 0xA + ldrsh r0, [r2, r3] + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0xE] + movs r0, 0x1 +_08149CC4: + pop {r1} + bx r1 + .align 2, 0 +_08149CC8: .4byte 0x085c8e16 + thumb_func_end sub_8149C60 + + thumb_func_start sub_8149CCC +sub_8149CCC: @ 8149CCC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + beq _08149CE0 + movs r0, 0 + b _08149CE4 +_08149CE0: + movs r0, 0x1 + strh r0, [r1, 0x8] +_08149CE4: + pop {r1} + bx r1 + thumb_func_end sub_8149CCC + + thumb_func_start sub_8149CE8 +sub_8149CE8: @ 8149CE8 + push {r4,lr} + ldr r4, _08149D54 + ldrh r1, [r4, 0xA] + ldr r0, _08149D58 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, _08149D5C + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, _08149D60 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08149D20 + ldr r1, _08149D64 + ldr r0, _08149D68 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _08149D6C + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08149D20: + ldr r2, _08149D70 + ldr r1, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + subs r2, 0x4 + ldr r0, _08149D68 + movs r1, 0xF0 + lsls r1, 3 + adds r0, r1 + ldrh r1, [r0] + strh r1, [r2] + str r0, [r4] + str r2, [r4, 0x4] + ldr r0, _08149D74 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08149D54: .4byte 0x040000b0 +_08149D58: .4byte 0x0000c5ff +_08149D5C: .4byte 0x00007fff +_08149D60: .4byte 0x0203aba0 +_08149D64: .4byte 0x040000d4 +_08149D68: .4byte 0x02038c28 +_08149D6C: .4byte 0x800000a0 +_08149D70: .4byte 0x04000048 +_08149D74: .4byte 0xa2400001 + thumb_func_end sub_8149CE8 + + thumb_func_start sub_8149D78 +sub_8149D78: @ 8149D78 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r3, [sp, 0x18] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r0, _08149DD4 + movs r1, 0x3 + str r3, [sp] + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08149DD8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x10] + ldr r3, [sp] + strh r3, [r1, 0x12] + strh r0, [r1, 0x14] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08149DD4: .4byte sub_8149DFC + 1 +_08149DD8: .4byte 0x03005e00 + thumb_func_end sub_8149D78 + + thumb_func_start sub_8149DDC +sub_8149DDC: @ 8149DDC + push {lr} + ldr r0, _08149DF0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08149DF4 + movs r0, 0 + b _08149DF6 + .align 2, 0 +_08149DF0: .4byte sub_8149DFC + 1 +_08149DF4: + movs r0, 0x1 +_08149DF6: + pop {r1} + bx r1 + thumb_func_end sub_8149DDC + + thumb_func_start sub_8149DFC +sub_8149DFC: @ 8149DFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08149E2C + ldr r2, _08149E30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08149E0E: + 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 _08149E0E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08149E2C: .4byte 0x085c8e24 +_08149E30: .4byte 0x03005e00 + thumb_func_end sub_8149DFC + + thumb_func_start sub_8149E34 +sub_8149E34: @ 8149E34 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08149E4C + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _08149E70 +_08149E4C: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08149E64 + movs r0, 0x10 + strh r0, [r4, 0x16] +_08149E64: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, _08149E8C + bl sub_80A2A20 +_08149E70: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0xF + ble _08149E82 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] +_08149E82: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08149E8C: .4byte 0x00002d6b + thumb_func_end sub_8149E34 + + thumb_func_start sub_8149E90 +sub_8149E90: @ 8149E90 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08149EA8 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _08149ECA +_08149EA8: + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + bge _08149EBE + movs r0, 0 + strh r0, [r4, 0x16] +_08149EBE: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, _08149EF0 + bl sub_80A2A20 +_08149ECA: + movs r0, 0x16 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _08149EFE + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08149EF8 + ldr r0, _08149EF4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _08149EFE + .align 2, 0 +_08149EF0: .4byte 0x00002d6b +_08149EF4: .4byte sub_8149DFC + 1 +_08149EF8: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + strh r1, [r4, 0x8] +_08149EFE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8149E90 + + thumb_func_start sub_8149F08 +sub_8149F08: @ 8149F08 + push {r4,lr} + ldr r4, _08149F28 + ldr r0, [r4] + movs r1, 0 + movs r2, 0x3C + bl memset + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x14 + adds r1, 0x16 + bl sub_8089C08 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08149F28: .4byte 0x0203aba0 + thumb_func_end sub_8149F08 + + thumb_func_start sub_8149F2C +sub_8149F2C: @ 8149F2C + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8149F2C + + thumb_func_start sub_8149F40 +sub_8149F40: @ 8149F40 + ldr r1, _08149F54 + ldrh r1, [r1] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + movs r2, 0xC0 + lsls r2, 19 + adds r1, r2 + str r1, [r0] + bx lr + .align 2, 0 +_08149F54: .4byte 0x04000008 + thumb_func_end sub_8149F40 + + thumb_func_start sub_8149F58 +sub_8149F58: @ 8149F58 + push {r4,lr} + ldr r3, _08149F80 + ldrh r2, [r3] + lsrs r2, 8 + ldrh r3, [r3] + lsrs r3, 2 + lsls r2, 27 + lsrs r2, 16 + lsls r3, 30 + lsrs r3, 16 + movs r4, 0xC0 + lsls r4, 19 + adds r2, r4 + str r2, [r0] + adds r3, r4 + str r3, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08149F80: .4byte 0x04000008 + thumb_func_end sub_8149F58 + + thumb_func_start sub_8149F84 +sub_8149F84: @ 8149F84 + push {lr} + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + pop {r0} + bx r0 + thumb_func_end sub_8149F84 + + thumb_func_start sub_8149F98 +sub_8149F98: @ 8149F98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + ldr r0, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r4, 16 + movs r6, 0 + lsrs r5, r4, 16 + cmp r4, 0 + ble _0814A000 + lsls r0, r7, 16 + asrs r0, 16 + mov r9, r0 + lsls r1, 16 + mov r8, r1 + lsls r0, r3, 16 + asrs r7, r0, 16 +_08149FD0: + lsls r4, r2, 16 + asrs r4, 16 + movs r0, 0xFF + ands r0, r4 + mov r2, r8 + asrs r1, r2, 16 + bl sine + lsls r1, r6, 1 + add r1, r10 + add r0, r9 + strh r0, [r1] + lsls r1, r5, 16 + ldr r0, _0814A010 + adds r1, r0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r7 + lsls r4, 16 + lsrs r2, r4, 16 + lsrs r5, r1, 16 + cmp r1, 0 + bgt _08149FD0 +_0814A000: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814A010: .4byte 0xffff0000 + thumb_func_end sub_8149F98 + + thumb_func_start sub_814A014 +sub_814A014: @ 814A014 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r9, r0 + adds r5, r2, 0 + adds r4, r3, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + movs r2, 0xA0 + lsls r2, 1 + movs r1, 0xA + bl memset + movs r1, 0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp, 0x4] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x8] +_0814A04C: + lsls r5, r1, 16 + asrs r0, r5, 16 + mov r10, r0 + ldr r1, [sp, 0x4] + bl sine + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r10 + ldr r1, [sp, 0x4] + bl cosine + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + lsls r4, 16 + asrs r4, 16 + subs r2, r1, r4 + lsls r2, 16 + adds r1, r4 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r0, 16 + asrs r0, 16 + ldr r3, [sp, 0x8] + subs r1, r3, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r3, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsrs r1, r2, 16 + str r5, [sp, 0x10] + cmp r2, 0 + bge _0814A098 + movs r1, 0 +_0814A098: + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xF0 + ble _0814A0A2 + movs r6, 0xF0 +_0814A0A2: + lsls r0, r7, 16 + cmp r0, 0 + bge _0814A0AA + movs r7, 0 +_0814A0AA: + mov r2, r8 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0814A0B8 + movs r3, 0x9F + mov r8, r3 +_0814A0B8: + lsls r0, r1, 24 + lsrs r0, 16 + orrs r6, r0 + lsls r0, r7, 16 + asrs r0, 16 + str r0, [sp, 0xC] + lsls r0, 1 + add r0, r9 + strh r6, [r0] + mov r0, r8 + lsls r4, r0, 16 + asrs r0, r4, 15 + add r0, r9 + strh r6, [r0] + mov r0, r10 + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + ldr r1, [sp, 0x4] + bl cosine + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp, 0x8] + subs r1, r2, r0 + lsls r1, 16 + adds r0, r2, r0 + lsls r0, 16 + lsrs r2, r0, 16 + lsrs r3, r1, 16 + cmp r1, 0 + bge _0814A0FA + movs r3, 0 +_0814A0FA: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0814A104 + movs r2, 0x9F +_0814A104: + lsls r0, r3, 16 + asrs r1, r0, 16 + adds r3, r0, 0 + lsls r5, r2, 16 + ldr r0, [sp, 0xC] + cmp r0, r1 + ble _0814A128 + adds r2, r1, 0 +_0814A114: + lsls r1, r7, 16 + ldr r0, _0814A1A8 + adds r1, r0 + asrs r0, r1, 15 + add r0, r9 + strh r6, [r0] + lsrs r7, r1, 16 + asrs r1, 16 + cmp r1, r2 + bgt _0814A114 +_0814A128: + lsls r1, r7, 16 + asrs r0, r3, 16 + cmp r1, r3 + bge _0814A146 + adds r2, r0, 0 +_0814A132: + movs r3, 0x80 + lsls r3, 9 + adds r0, r1, r3 + asrs r1, r0, 15 + add r1, r9 + strh r6, [r1] + adds r1, r0, 0 + asrs r0, r1, 16 + cmp r0, r2 + blt _0814A132 +_0814A146: + asrs r0, r5, 16 + cmp r4, r5 + ble _0814A164 + adds r1, r0, 0 +_0814A14E: + ldr r2, _0814A1A8 + adds r0, r4, r2 + lsrs r3, r0, 16 + mov r8, r3 + asrs r0, 15 + add r0, r9 + strh r6, [r0] + lsls r4, r3, 16 + asrs r0, r4, 16 + cmp r0, r1 + bgt _0814A14E +_0814A164: + mov r0, r8 + lsls r4, r0, 16 + asrs r0, r5, 16 + cmp r4, r5 + bge _0814A184 + adds r2, r0, 0 +_0814A170: + movs r1, 0x80 + lsls r1, 9 + adds r0, r4, r1 + asrs r1, r0, 15 + add r1, r9 + strh r6, [r1] + adds r4, r0, 0 + asrs r0, r4, 16 + cmp r0, r2 + blt _0814A170 +_0814A184: + ldr r2, [sp, 0x10] + movs r3, 0x80 + lsls r3, 9 + adds r0, r2, r3 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0814A196 + b _0814A04C +_0814A196: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814A1A8: .4byte 0xffff0000 + thumb_func_end sub_814A014 + + thumb_func_start sub_814A1AC +sub_814A1AC: @ 814A1AC + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [sp, 0x14] + ldr r5, [sp, 0x18] + ldr r4, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + adds r7, r0, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + strh r1, [r6] + strh r2, [r6, 0x2] + strh r1, [r6, 0x4] + strh r2, [r6, 0x6] + strh r3, [r6, 0x8] + strh r7, [r6, 0xA] + strh r5, [r6, 0xC] + strh r4, [r6, 0xE] + lsls r3, 16 + asrs r3, 16 + lsls r1, 16 + asrs r1, 16 + subs r3, r1 + strh r3, [r6, 0x10] + lsls r0, r3, 16 + cmp r0, 0 + bge _0814A1FE + negs r0, r3 + strh r0, [r6, 0x10] + lsls r0, r5, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r6, 0xC] +_0814A1FE: + lsls r0, r7, 16 + asrs r0, 16 + lsls r1, r2, 16 + asrs r1, 16 + subs r1, r0, r1 + strh r1, [r6, 0x12] + lsls r0, r1, 16 + cmp r0, 0 + bge _0814A21C + negs r0, r1 + strh r0, [r6, 0x12] + lsls r0, r4, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r6, 0xE] +_0814A21C: + movs r0, 0 + strh r0, [r6, 0x14] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_814A1AC + + thumb_func_start sub_814A228 +sub_814A228: @ 814A228 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldrh r0, [r3, 0x10] + mov r8, r0 + movs r1, 0x10 + ldrsh r6, [r3, r1] + ldrh r2, [r3, 0x12] + mov r12, r2 + movs r4, 0x12 + ldrsh r5, [r3, r4] + cmp r6, r5 + ble _0814A278 + ldrh r0, [r3, 0xC] + ldrh r2, [r3, 0x4] + adds r1, r0, r2 + strh r1, [r3, 0x4] + ldrh r2, [r3, 0x14] + add r2, r12 + strh r2, [r3, 0x14] + lsls r1, r2, 16 + asrs r1, 16 + adds r4, r0, 0 + ldrh r7, [r3, 0xE] + cmp r1, r6 + ble _0814A29E + ldrh r1, [r3, 0x6] + adds r0, r7, r1 + strh r0, [r3, 0x6] + mov r1, r8 + b _0814A29A +_0814A278: + ldrh r0, [r3, 0xE] + ldrh r2, [r3, 0x6] + adds r1, r0, r2 + strh r1, [r3, 0x6] + ldrh r2, [r3, 0x14] + add r2, r8 + strh r2, [r3, 0x14] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r4, [r3, 0xC] + adds r7, r0, 0 + cmp r1, r5 + ble _0814A29E + ldrh r1, [r3, 0x4] + adds r0, r4, r1 + strh r0, [r3, 0x4] + mov r1, r12 +_0814A29A: + subs r0, r2, r1 + strh r0, [r3, 0x14] +_0814A29E: + movs r5, 0 + lsls r0, r4, 16 + asrs r2, r0, 16 + cmp r2, 0 + ble _0814A2B6 + movs r4, 0x4 + ldrsh r1, [r3, r4] + movs r4, 0x8 + ldrsh r0, [r3, r4] + ldrh r4, [r3, 0x8] + cmp r1, r0 + bge _0814A2C8 +_0814A2B6: + cmp r2, 0 + bge _0814A2D6 + movs r0, 0x4 + ldrsh r1, [r3, r0] + movs r2, 0x8 + ldrsh r0, [r3, r2] + ldrh r4, [r3, 0x8] + cmp r1, r0 + bgt _0814A2D6 +_0814A2C8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r9 + cmp r0, 0 + beq _0814A2D6 + strh r4, [r3, 0x4] +_0814A2D6: + lsls r0, r7, 16 + asrs r2, r0, 16 + cmp r2, 0 + ble _0814A2EC + movs r4, 0x6 + ldrsh r1, [r3, r4] + movs r4, 0xA + ldrsh r0, [r3, r4] + ldrh r4, [r3, 0xA] + cmp r1, r0 + bge _0814A2FE +_0814A2EC: + cmp r2, 0 + bge _0814A30C + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r2, 0xA + ldrsh r0, [r3, r2] + ldrh r4, [r3, 0xA] + cmp r1, r0 + bgt _0814A30C +_0814A2FE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r10 + cmp r0, 0 + beq _0814A30C + strh r4, [r3, 0x6] +_0814A30C: + cmp r5, 0x2 + beq _0814A314 + movs r0, 0 + b _0814A316 +_0814A314: + movs r0, 0x1 +_0814A316: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_814A228 + + thumb_func_start sub_814A324 +sub_814A324: @ 814A324 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, _0814A368 + mov r0, sp + bl CpuSet + ldr r0, _0814A36C + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _0814A370 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814A368: .4byte 0x01000400 +_0814A36C: .4byte 0x085c7c00 +_0814A370: .4byte 0x085c7be0 + thumb_func_end sub_814A324 + + thumb_func_start sub_814A374 +sub_814A374: @ 814A374 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _0814A3B4 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _0814A3B8 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814A3B4: .4byte 0x085c828c +_0814A3B8: .4byte 0x02038c28 + thumb_func_end sub_814A374 + + thumb_func_start sub_814A3BC +sub_814A3BC: @ 814A3BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814A3EC + ldr r2, _0814A3F0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A3CE: + 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 _0814A3CE + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814A3EC: .4byte 0x085c99d0 +_0814A3F0: .4byte 0x03005e00 + thumb_func_end sub_814A3BC + + thumb_func_start sub_814A3F4 +sub_814A3F4: @ 814A3F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814A424 + ldr r2, _0814A428 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A406: + 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 _0814A406 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814A424: .4byte 0x085c99e8 +_0814A428: .4byte 0x03005e00 + thumb_func_end sub_814A3F4 + + thumb_func_start sub_814A42C +sub_814A42C: @ 814A42C + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r1, 0xC0 + lsls r1, 7 + movs r0, 0 + bl lcd_io_clear_bits + movs r5, 0 + movs r0, 0x80 + lsls r0, 6 + strh r0, [r4, 0xC] + ldr r0, _0814A4B4 + strh r0, [r4, 0xA] + strh r5, [r4, 0x12] + movs r0, 0x10 + strh r0, [r4, 0x14] + movs r0, 0xA0 + lsls r0, 4 + strh r0, [r4, 0x16] + ldr r6, _0814A4B8 + ldr r2, [r6] + ldr r3, _0814A4BC + strh r3, [r2, 0xE] + ldrh r0, [r4, 0x14] + lsls r0, 8 + ldrh r1, [r4, 0x12] + orrs r0, r1 + strh r0, [r2, 0x10] + ldr r0, _0814A4C0 + strh r3, [r0] + ldr r1, _0814A4C4 + ldrh r0, [r2, 0x10] + strh r0, [r1] + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, _0814A4C8 + bl CpuSet + ldr r0, _0814A4CC + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, _0814A4D0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r6] + strh r5, [r0, 0x16] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814A4B4: .4byte 0x00007fff +_0814A4B8: .4byte 0x0203aba0 +_0814A4BC: .4byte 0x00003f41 +_0814A4C0: .4byte 0x04000050 +_0814A4C4: .4byte 0x04000052 +_0814A4C8: .4byte 0x01000400 +_0814A4CC: .4byte 0x085c7c00 +_0814A4D0: .4byte 0x085c7be0 + thumb_func_end sub_814A42C + + thumb_func_start sub_814A4D4 +sub_814A4D4: @ 814A4D4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, _0814A4FC + ldr r1, [sp] + bl LZ77UnCompVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814A4FC: .4byte 0x085c828c + thumb_func_end sub_814A4D4 + + thumb_func_start sub_814A500 +sub_814A500: @ 814A500 + push {r4-r6,lr} + adds r5, r0, 0 + movs r2, 0 + ldr r6, _0814A540 + ldr r4, _0814A544 + ldr r3, _0814A548 +_0814A50C: + lsls r1, r2, 1 + adds r1, r4 + ldr r0, [r3] + ldrh r0, [r0, 0x16] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9F + bls _0814A50C + adds r0, r6, 0 + bl SetVBlankCallback + ldr r0, _0814A54C + bl SetHBlankCallback + movs r0, 0x2 + bl enable_irqs + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814A540: .4byte sub_814A684 + 1 +_0814A544: .4byte 0x020393a8 +_0814A548: .4byte 0x0203aba0 +_0814A54C: .4byte sub_814A6CC + 1 + thumb_func_end sub_814A500 + + thumb_func_start sub_814A550 +sub_814A550: @ 814A550 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, _0814A598 + ldr r0, [r1] + ldrb r2, [r0] + movs r3, 0 + strb r3, [r0] + ldrh r2, [r4, 0xC] + lsls r0, r2, 16 + asrs r0, 24 + lsls r0, 16 + lsrs r7, r0, 16 + ldrh r6, [r4, 0xA] + movs r0, 0xC0 + lsls r0, 1 + mov r8, r0 + ldrh r0, [r4, 0x16] + subs r0, r6, r0 + strh r0, [r4, 0xA] + movs r5, 0xE + ldrsh r0, [r4, r5] + adds r5, r1, 0 + cmp r0, 0x45 + ble _0814A5A2 + movs r1, 0xC + ldrsh r0, [r4, r1] + ldr r1, _0814A59C + adds r0, r1 + cmp r0, 0 + blt _0814A5A0 + adds r0, r2, r1 + strh r0, [r4, 0xC] + b _0814A5A2 + .align 2, 0 +_0814A598: .4byte 0x0203aba0 +_0814A59C: .4byte 0xfffffe80 +_0814A5A0: + strh r3, [r4, 0xC] +_0814A5A2: + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _0814A5E0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0814A5E0 + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _0814A5C6 + adds r0, r1, 0x1 + strh r0, [r4, 0x12] + b _0814A5D4 +_0814A5C6: + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0814A5D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] +_0814A5D4: + ldr r0, [r5] + ldrh r1, [r4, 0x14] + lsls r1, 8 + ldrh r2, [r4, 0x12] + orrs r1, r2 + strh r1, [r0, 0x10] +_0814A5E0: + movs r5, 0 + lsls r7, 16 +_0814A5E4: + lsrs r0, r6, 8 + asrs r1, r7, 16 + bl sine + ldr r1, _0814A674 + lsls r2, r5, 1 + adds r2, r1 + ldr r1, _0814A678 + ldr r1, [r1] + ldrh r1, [r1, 0x16] + adds r0, r1 + strh r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + adds r0, r6, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r5, 0x9F + bls _0814A5E4 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x65 + bne _0814A632 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0814A632: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0814A654 + ldr r0, _0814A67C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814A654 + ldr r0, _0814A680 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0814A654: + ldrh r0, [r4, 0x16] + subs r0, 0x11 + strh r0, [r4, 0x16] + ldr r0, _0814A678 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0814A674: .4byte 0x02038c28 +_0814A678: .4byte 0x0203aba0 +_0814A67C: .4byte 0x02037fd4 +_0814A680: .4byte sub_814A3F4 + 1 + thumb_func_end sub_814A550 + + thumb_func_start sub_814A684 +sub_814A684: @ 814A684 + push {lr} + bl sub_8149F2C + ldr r2, _0814A6B8 + ldr r0, _0814A6BC + ldr r1, [r0] + ldrh r0, [r1, 0xE] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x10] + strh r0, [r2] + ldrb r0, [r1] + cmp r0, 0 + beq _0814A6B4 + ldr r1, _0814A6C0 + ldr r0, _0814A6C4 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, _0814A6C8 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_0814A6B4: + pop {r0} + bx r0 + .align 2, 0 +_0814A6B8: .4byte 0x04000050 +_0814A6BC: .4byte 0x0203aba0 +_0814A6C0: .4byte 0x040000d4 +_0814A6C4: .4byte 0x02038c28 +_0814A6C8: .4byte 0x800000a0 + thumb_func_end sub_814A684 + + thumb_func_start sub_814A6CC +sub_814A6CC: @ 814A6CC + ldr r1, _0814A6E4 + ldr r0, _0814A6E8 + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _0814A6EC + strh r1, [r0] + bx lr + .align 2, 0 +_0814A6E4: .4byte 0x02038c28 +_0814A6E8: .4byte 0x04000006 +_0814A6EC: .4byte 0x04000012 + thumb_func_end sub_814A6CC + + thumb_func_start sub_814A6F0 +sub_814A6F0: @ 814A6F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814A720 + ldr r2, _0814A724 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A702: + 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 _0814A702 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814A720: .4byte 0x085c99f8 +_0814A724: .4byte 0x03005e00 + thumb_func_end sub_814A6F0 + + thumb_func_start sub_814A728 +sub_814A728: @ 814A728 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814A758 + ldr r2, _0814A75C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A73A: + 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 _0814A73A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814A758: .4byte 0x085c9a08 +_0814A75C: .4byte 0x03005e00 + thumb_func_end sub_814A728 + + thumb_func_start sub_814A760 +sub_814A760: @ 814A760 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0814A790 + ldr r2, _0814A794 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A772: + 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 _0814A772 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814A790: .4byte 0x085c9a1c +_0814A794: .4byte 0x03005e00 + thumb_func_end sub_814A760 + + thumb_func_start sub_814A798 +sub_814A798: @ 814A798 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_8149F58 + ldr r0, _0814A820 + ldr r1, [sp, 0x10] + bl LZ77UnCompVram + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r6, 0x1 + str r6, [sp] + str r4, [sp, 0x4] + movs r5, 0xF + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1D + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0814A824 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + mov r1, r8 + strh r6, [r1, 0xC] + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + movs r0, 0xA + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814A820: .4byte 0x085c8598 +_0814A824: .4byte 0x085c8578 + thumb_func_end sub_814A798 + + thumb_func_start sub_814A828 +sub_814A828: @ 814A828 + push {r4,r5,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, _0814A894 + movs r2, 0x4 + str r2, [sp] + str r2, [sp, 0x4] + ldrb r0, [r4, 0xC] + str r0, [sp, 0x8] + ldrb r0, [r4, 0xE] + str r0, [sp, 0xC] + str r2, [sp, 0x10] + str r2, [sp, 0x14] + movs r0, 0xF + str r0, [sp, 0x18] + movs r5, 0 + str r5, [sp, 0x1C] + str r5, [sp, 0x20] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrh r0, [r4, 0xC] + adds r0, 0x4 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bne _0814A88A + movs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xE] + adds r0, 0x4 + strh r0, [r4, 0xE] + strh r5, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0814A88A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0814A88A: + movs r0, 0 + add sp, 0x24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0814A894: .4byte 0x085c8928 + thumb_func_end sub_814A828 + + thumb_func_start sub_814A898 +sub_814A898: @ 814A898 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldrh r0, [r4, 0x14] + adds r1, r0, 0x1 + strh r1, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x16 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0814A956 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0814A8FC + cmp r0, 0x1 + bgt _0814A8CA + cmp r0, 0 + beq _0814A8D4 + b _0814A92C +_0814A8CA: + cmp r0, 0x2 + beq _0814A914 + cmp r0, 0x3 + beq _0814A91C + b _0814A92C +_0814A8D4: + movs r2, 0xFA + ldr r6, _0814A8F4 + movs r3, 0 + ldr r5, _0814A8F8 +_0814A8DC: + lsls r1, r2, 1 + adds r0, r1, r6 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFE + bls _0814A8DC + b _0814A94C + .align 2, 0 +_0814A8F4: .4byte 0x02037714 +_0814A8F8: .4byte 0x02037b14 +_0814A8FC: + ldr r0, _0814A90C + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _0814A910 + b _0814A91E + .align 2, 0 +_0814A90C: .4byte 0xffff7fff +_0814A910: .4byte 0x085c86f4 +_0814A914: + ldr r0, _0814A918 + b _0814A91E + .align 2, 0 +_0814A918: .4byte 0x085c87f4 +_0814A91C: + ldr r0, _0814A928 +_0814A91E: + ldr r1, [sp, 0xC] + bl LZ77UnCompVram + b _0814A94C + .align 2, 0 +_0814A928: .4byte 0x085c88a4 +_0814A92C: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0814A956 +_0814A94C: + movs r0, 0 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] +_0814A956: + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_814A898 + + thumb_func_start sub_814A960 +sub_814A960: @ 814A960 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_8149F58 + ldr r0, _0814A9FC + ldr r1, [sp, 0x10] + bl LZ77UnCompVram + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r6, 0x1 + str r6, [sp] + str r4, [sp, 0x4] + movs r5, 0xF + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1D + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r4, _0814AA00 + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0xE0 + movs r1, 0x10 + movs r2, 0x8 + movs r3, 0 + bl pal_fade_1 + movs r1, 0 + movs r0, 0x22 + mov r2, r8 + strh r0, [r2, 0xC] + strh r1, [r2, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + movs r0, 0 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814A9FC: .4byte 0x085c8598 +_0814AA00: .4byte 0x085c8578 + thumb_func_end sub_814A960 + + thumb_func_start sub_814AA04 +sub_814AA04: @ 814AA04 + push {r4-r6,lr} + sub sp, 0x24 + adds r6, r0, 0 + ldr r1, _0814AA7C + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, r1 + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0x7 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x7 + bl __udivsi3 + ldr r1, _0814AA80 + movs r2, 0x4 + str r2, [sp] + str r2, [sp, 0x4] + lsls r4, 2 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x8] + lsls r0, 26 + lsrs r0, 24 + str r0, [sp, 0xC] + str r2, [sp, 0x10] + str r2, [sp, 0x14] + movs r0, 0xF + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bge _0814AA70 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_0814AA70: + movs r0, 0 + add sp, 0x24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814AA7C: .4byte 0x085c9a30 +_0814AA80: .4byte 0x085c8928 + thumb_func_end sub_814AA04 + + thumb_func_start sub_814AA84 +sub_814AA84: @ 814AA84 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xE0 + movs r1, 0x10 + movs r2, 0x3 + movs r3, 0 + bl pal_fade_1 + ldr r0, _0814AAB4 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814AAB4: .4byte 0xffff3fff + thumb_func_end sub_814AA84 + + thumb_func_start sub_814AAB8 +sub_814AAB8: @ 814AAB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x24 + adds r7, r0, 0 + ldrh r0, [r7, 0xE] + movs r1, 0x1 + eors r0, r1 + movs r6, 0 + strh r0, [r7, 0xE] + cmp r0, 0 + beq _0814AB2C + ldr r0, _0814AB24 + mov r8, r0 + movs r4, 0x4 + str r4, [sp] + str r4, [sp, 0x4] + ldr r5, _0814AB28 + movs r1, 0xC + ldrsh r0, [r7, r1] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x7 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + movs r2, 0xC + ldrsh r0, [r7, r2] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 26 + lsrs r0, 24 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + str r4, [sp, 0x14] + movs r0, 0xE + str r0, [sp, 0x18] + str r6, [sp, 0x1C] + str r6, [sp, 0x20] + movs r0, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect + b _0814AB78 + .align 2, 0 +_0814AB24: .4byte 0x085c8928 +_0814AB28: .4byte 0x085c9a30 +_0814AB2C: + movs r1, 0xC + ldrsh r0, [r7, r1] + cmp r0, 0 + ble _0814AB72 + ldr r1, _0814AB9C + subs r0, 0x1 + adds r0, r1 + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0x7 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x7 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 26 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette +_0814AB72: + ldrh r0, [r7, 0xC] + adds r0, 0x1 + strh r0, [r7, 0xC] +_0814AB78: + movs r1, 0xC + ldrsh r0, [r7, r1] + cmp r0, 0x22 + ble _0814AB86 + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] +_0814AB86: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0814AB9C: .4byte 0x085c9a30 + thumb_func_end sub_814AAB8 + + thumb_func_start sub_814ABA0 +sub_814ABA0: @ 814ABA0 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, [r4] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_814ABA0 + + thumb_func_start sub_814ABE4 +sub_814ABE4: @ 814ABE4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0814AC2C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + ldrh r0, [r6, 0xC] + movs r1, 0x1 + eors r0, r1 + strh r0, [r6, 0xC] + cmp r0, 0 + bne _0814AC24 + ldr r5, _0814AC30 + ldrh r1, [r5] + movs r0, 0x12 + bl lcd_io_set + ldr r4, _0814AC34 + ldrh r1, [r4] + movs r0, 0x10 + bl lcd_io_set + ldrh r0, [r6, 0x8] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + ldrh r0, [r6, 0xA] + ldrh r1, [r4] + adds r0, r1 + strh r0, [r4] +_0814AC24: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814AC2C: .4byte 0x03005e00 +_0814AC30: .4byte 0x02022e14 +_0814AC34: .4byte 0x02022e16 + thumb_func_end sub_814ABE4 + + thumb_func_start sub_814AC38 +sub_814AC38: @ 814AC38 + push {r4-r6,lr} + sub sp, 0x10 + adds r6, r0, 0 + movs r5, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, _0814ACB4 + ldr r1, [sp, 0xC] + bl LZ77UnCompVram + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _0814ACB8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0814ACBC + strh r5, [r0] + ldr r4, _0814ACC0 + strh r5, [r4] + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x10 + bl lcd_io_set + strh r5, [r6, 0xC] + ldr r0, _0814ACC4 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 16 + cmp r1, 0x1 + beq _0814ACE4 + cmp r1, 0x1 + bgt _0814ACC8 + cmp r1, 0 + beq _0814ACCE + b _0814AD1C + .align 2, 0 +_0814ACB4: .4byte 0x085c8598 +_0814ACB8: .4byte 0x085c8578 +_0814ACBC: .4byte 0x02022e14 +_0814ACC0: .4byte 0x02022e16 +_0814ACC4: .4byte sub_814ABE4 + 1 +_0814ACC8: + cmp r1, 0x2 + beq _0814AD00 + b _0814AD1C +_0814ACCE: + ldr r0, _0814ACE0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + b _0814AD2E + .align 2, 0 +_0814ACE0: .4byte 0x03005e00 +_0814ACE4: + ldr r1, _0814ACF8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0814ACFC + strh r1, [r0, 0x8] + movs r1, 0x1 + negs r1, r1 + b _0814AD2C + .align 2, 0 +_0814ACF8: .4byte 0x03005e00 +_0814ACFC: .4byte 0x0000ffff +_0814AD00: + ldr r1, _0814AD14 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, _0814AD18 + b _0814AD2C + .align 2, 0 +_0814AD14: .4byte 0x03005e00 +_0814AD18: .4byte 0x0000ffff +_0814AD1C: + ldr r1, _0814AD40 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0814AD44 + strh r1, [r0, 0x8] + movs r1, 0x1 +_0814AD2C: + strh r1, [r0, 0xA] +_0814AD2E: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0814AD40: .4byte 0x03005e00 +_0814AD44: .4byte 0x0000ffff + thumb_func_end sub_814AC38 + + thumb_func_start sub_814AD48 +sub_814AD48: @ 814AD48 + push {r4,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, _0814ADAC + movs r2, 0xC + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r3, [r0] + lsrs r2, r3, 3 + movs r0, 0x7 + ands r3, r0 + ldr r1, _0814ADB0 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + lsls r2, 2 + adds r2, 0x1 + str r2, [sp, 0x8] + lsls r3, 2 + str r3, [sp, 0xC] + str r0, [sp, 0x10] + str r0, [sp, 0x14] + movs r0, 0xF + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0814ADA0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0814ADA0: + movs r0, 0 + add sp, 0x24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814ADAC: .4byte 0x085c9a53 +_0814ADB0: .4byte 0x085c8928 + thumb_func_end sub_814AD48 + + thumb_func_start sub_814ADB4 +sub_814ADB4: @ 814ADB4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0814ADD4 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814ADD4: .4byte 0xffff7fff + thumb_func_end sub_814ADB4 + + thumb_func_start sub_814ADD8 +sub_814ADD8: @ 814ADD8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, _0814AE38 + movs r2, 0xC + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r3, [r0] + lsrs r2, r3, 3 + movs r0, 0x7 + ands r3, r0 + lsls r2, 2 + adds r2, 0x1 + lsls r3, 2 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0814AE2E + ldr r0, _0814AE3C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0814AE2E: + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0814AE38: .4byte 0x085c9a53 +_0814AE3C: .4byte sub_814ABE4 + 1 + thumb_func_end sub_814ADD8 + + thumb_func_start sub_814AE40 +sub_814AE40: @ 814AE40 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, _0814AEA4 + movs r1, 0 + strh r1, [r0] + ldr r4, _0814AEA8 + strh r1, [r4] + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x10 + bl lcd_io_set + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, [r5] + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0814AEA4: .4byte 0x02022e14 +_0814AEA8: .4byte 0x02022e16 + thumb_func_end sub_814AE40 + + thumb_func_start nullsub_112 +nullsub_112: @ 814AEAC + bx lr + thumb_func_end nullsub_112 + + thumb_func_start sub_814AEB0 +sub_814AEB0: @ 814AEB0 + ldr r1, _0814AEC0 + ldr r0, _0814AEC4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814AEC8 + str r1, [r0] + bx lr + .align 2, 0 +_0814AEC0: .4byte 0x03005d60 +_0814AEC4: .4byte 0x02024064 +_0814AEC8: .4byte bx_exec_buffer_A_ch0_tbl4 + 1 + thumb_func_end sub_814AEB0 + + thumb_func_start bx_exec_buffer_A_ch0_tbl4 +bx_exec_buffer_A_ch0_tbl4: @ 814AECC + push {lr} + ldr r2, _0814AF00 + ldr r1, _0814AF04 + ldr r0, _0814AF08 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0814AF18 + ldr r0, _0814AF0C + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0814AF14 + ldr r0, _0814AF10 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _0814AF18 + .align 2, 0 +_0814AF00: .4byte 0x02024068 +_0814AF04: .4byte 0x0832a328 +_0814AF08: .4byte 0x02024064 +_0814AF0C: .4byte 0x02023064 +_0814AF10: .4byte 0x085c9a94 +_0814AF14: + bl dp01_tbl4_exec_completed +_0814AF18: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl4 + + thumb_func_start sub_814AF1C +sub_814AF1C: @ 814AF1C + push {lr} + ldr r2, _0814AF44 + ldr r1, _0814AF48 + ldr r0, _0814AF4C + 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, _0814AF50 + cmp r1, r0 + bne _0814AF40 + bl dp01_tbl4_exec_completed +_0814AF40: + pop {r0} + bx r0 + .align 2, 0 +_0814AF44: .4byte 0x02020630 +_0814AF48: .4byte 0x020241e4 +_0814AF4C: .4byte 0x02024064 +_0814AF50: .4byte nullsub_12 + 1 + thumb_func_end sub_814AF1C + + thumb_func_start sub_814AF54 +sub_814AF54: @ 814AF54 + push {r4-r6,lr} + ldr r6, _0814AFAC + ldr r5, _0814AFB0 + ldr r4, _0814AFB4 + 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, _0814AFB8 + cmp r1, r0 + bne _0814AFA4 + 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 obj_delete_and_free_tiles + bl dp01_tbl4_exec_completed +_0814AFA4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814AFAC: .4byte 0x02020630 +_0814AFB0: .4byte 0x020241e4 +_0814AFB4: .4byte 0x02024064 +_0814AFB8: .4byte nullsub_12 + 1 + thumb_func_end sub_814AF54 + + thumb_func_start sub_814AFBC +sub_814AFBC: @ 814AFBC + push {r4,lr} + ldr r4, _0814AFFC + ldr r1, [r4] + ldr r3, _0814B000 + 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 _0814AFF4 + 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_tbl4_exec_completed +_0814AFF4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814AFFC: .4byte 0x020244d0 +_0814B000: .4byte 0x02024064 + thumb_func_end sub_814AFBC + + thumb_func_start sub_814B004 +sub_814B004: @ 814B004 + push {r4-r6,lr} + movs r6, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0814B028 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0814B05C + ldr r0, _0814B048 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814B05C +_0814B028: + ldr r2, _0814B04C + ldr r1, _0814B050 + ldr r0, _0814B054 + 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, _0814B058 + cmp r1, r0 + bne _0814B094 + b _0814B092 + .align 2, 0 +_0814B048: .4byte 0x02022fec +_0814B04C: .4byte 0x02020630 +_0814B050: .4byte 0x03005d70 +_0814B054: .4byte 0x02024064 +_0814B058: .4byte nullsub_12 + 1 +_0814B05C: + ldr r2, _0814B0CC + ldr r5, _0814B0D0 + ldr r0, _0814B0D4 + 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, _0814B0D8 + cmp r2, r0 + bne _0814B094 + 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 _0814B094 +_0814B092: + movs r6, 0x1 +_0814B094: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _0814B0A0 + movs r6, 0 +_0814B0A0: + cmp r6, 0 + beq _0814B0C6 + ldr r0, _0814B0DC + ldr r0, [r0] + ldr r3, _0814B0D4 + 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, _0814B0E0 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814B0E4 + str r1, [r0] +_0814B0C6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814B0CC: .4byte 0x02020630 +_0814B0D0: .4byte 0x03005d70 +_0814B0D4: .4byte 0x02024064 +_0814B0D8: .4byte nullsub_12 + 1 +_0814B0DC: .4byte 0x020244d0 +_0814B0E0: .4byte 0x03005d60 +_0814B0E4: .4byte sub_814AFBC + 1 + thumb_func_end sub_814B004 + + thumb_func_start sub_814B0E8 +sub_814B0E8: @ 814B0E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _0814B260 + mov r12, r0 + ldr r0, [r0] + ldr r7, _0814B264 + 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 _0814B114 + b _0814B252 +_0814B114: + 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 _0814B136 + b _0814B252 +_0814B136: + ldr r1, _0814B268 + mov r10, r1 + ldr r0, _0814B26C + 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, _0814B270 + cmp r3, r0 + bne _0814B252 + ldr r0, _0814B274 + 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 _0814B252 + ldrb r0, [r4, 0x9] + adds r0, 0x1 + strb r0, [r4, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0814B252 + 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 _0814B1F0 + ldr r0, _0814B278 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0814B1F0 + 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 obj_delete_and_free_tiles + ldr r4, _0814B27C + ldrb r0, [r7] + mov r1, r8 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _0814B280 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0814B284 + 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 +_0814B1F0: + ldr r1, _0814B26C + ldr r4, _0814B264 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0814B268 + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r5, _0814B27C + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _0814B280 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0814B284 + 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, _0814B260 + 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, _0814B288 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814B28C + str r1, [r0] +_0814B252: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814B260: .4byte 0x020244d0 +_0814B264: .4byte 0x02024064 +_0814B268: .4byte 0x02020630 +_0814B26C: .4byte 0x03005d7c +_0814B270: .4byte nullsub_12 + 1 +_0814B274: .4byte 0x020241e4 +_0814B278: .4byte 0x02022fec +_0814B27C: .4byte 0x03005d70 +_0814B280: .4byte 0x0202406e +_0814B284: .4byte 0x020244ec +_0814B288: .4byte 0x03005d60 +_0814B28C: .4byte sub_814B004 + 1 + thumb_func_end sub_814B0E8 + + thumb_func_start sub_814B290 +sub_814B290: @ 814B290 + push {lr} + ldr r2, _0814B2C4 + ldr r1, _0814B2C8 + ldr r0, _0814B2CC + 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 _0814B2BE + movs r2, 0x24 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0814B2BE + bl dp01_tbl4_exec_completed +_0814B2BE: + pop {r0} + bx r0 + .align 2, 0 +_0814B2C4: .4byte 0x02020630 +_0814B2C8: .4byte 0x020241e4 +_0814B2CC: .4byte 0x02024064 + thumb_func_end sub_814B290 + + thumb_func_start bx_t4_healthbar_update +bx_t4_healthbar_update: @ 814B2D0 + push {r4-r6,lr} + ldr r5, _0814B310 + ldrb r0, [r5] + ldr r6, _0814B314 + 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 _0814B318 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _0814B332 + .align 2, 0 +_0814B310: .4byte 0x02024064 +_0814B314: .4byte 0x03005d70 +_0814B318: + ldr r2, _0814B338 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0814B33C + adds r0, r2 + bl sub_805E990 + bl dp01_tbl4_exec_completed +_0814B332: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814B338: .4byte 0x0202406e +_0814B33C: .4byte 0x020244ec + thumb_func_end bx_t4_healthbar_update + + thumb_func_start sub_814B340 +sub_814B340: @ 814B340 + push {r4-r6,lr} + ldr r6, _0814B3C4 + ldr r5, _0814B3C8 + ldr r4, _0814B3CC + 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 _0814B3BC + ldr r1, _0814B3D0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814B3D4 + 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 obj_delete_and_free_tiles + ldr r1, _0814B3D8 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl4_exec_completed +_0814B3BC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814B3C4: .4byte 0x02020630 +_0814B3C8: .4byte 0x020241e4 +_0814B3CC: .4byte 0x02024064 +_0814B3D0: .4byte 0x0202406e +_0814B3D4: .4byte 0x020244ec +_0814B3D8: .4byte 0x03005d70 + thumb_func_end sub_814B340 + + thumb_func_start sub_814B3DC +sub_814B3DC: @ 814B3DC + push {r4-r6,lr} + ldr r0, _0814B438 + ldr r0, [r0] + ldr r6, _0814B43C + 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 _0814B430 + ldr r5, _0814B440 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0814B444 + 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 obj_delete_and_free_tiles + ldr r1, _0814B448 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl4_exec_completed +_0814B430: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814B438: .4byte 0x020244d0 +_0814B43C: .4byte 0x02024064 +_0814B440: .4byte 0x020241e4 +_0814B444: .4byte 0x02020630 +_0814B448: .4byte 0x03005d70 + thumb_func_end sub_814B3DC + + thumb_func_start bx_t4_button_a +bx_t4_button_a: @ 814B44C + push {lr} + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0814B45E + bl dp01_tbl4_exec_completed +_0814B45E: + pop {r0} + bx r0 + thumb_func_end bx_t4_button_a + + thumb_func_start dp01t_0F_4_move_anim +dp01t_0F_4_move_anim: @ 814B464 + push {r4,lr} + ldr r1, _0814B4A0 + ldr r0, _0814B4A4 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _0814B4A8 + 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 _0814B4B0 + 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, _0814B4AC + strb r3, [r0] + bl dp01_tbl4_exec_completed + b _0814B4DA + .align 2, 0 +_0814B4A0: .4byte 0x020241e4 +_0814B4A4: .4byte 0x02024064 +_0814B4A8: .4byte 0x02020630 +_0814B4AC: .4byte 0x020244b9 +_0814B4B0: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0814B4D4 + 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] +_0814B4D4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_0814B4DA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end dp01t_0F_4_move_anim + + thumb_func_start sub_814B4E0 +sub_814B4E0: @ 814B4E0 + push {r4,lr} + ldr r2, _0814B538 + ldr r0, _0814B53C + ldr r4, _0814B540 + 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, _0814B544 + cmp r1, r0 + bne _0814B532 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, _0814B548 + 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 _0814B526 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0814B526: + ldr r0, _0814B54C + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _0814B550 + str r0, [r1] +_0814B532: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814B538: .4byte 0x02020630 +_0814B53C: .4byte 0x03005d70 +_0814B540: .4byte 0x02024064 +_0814B544: .4byte nullsub_12 + 1 +_0814B548: .4byte 0x020244d0 +_0814B54C: .4byte 0x03005d60 +_0814B550: .4byte sub_814B554 + 1 + thumb_func_end sub_814B4E0 + + thumb_func_start sub_814B554 +sub_814B554: @ 814B554 + push {lr} + ldr r0, _0814B594 + ldr r1, [r0] + ldr r0, _0814B598 + 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 _0814B590 + ldr r2, _0814B59C + ldr r0, _0814B5A0 + 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, _0814B5A4 + cmp r1, r0 + bne _0814B590 + bl dp01_tbl4_exec_completed +_0814B590: + pop {r0} + bx r0 + .align 2, 0 +_0814B594: .4byte 0x020244d0 +_0814B598: .4byte 0x02024064 +_0814B59C: .4byte 0x02020630 +_0814B5A0: .4byte 0x020241e4 +_0814B5A4: .4byte nullsub_12 + 1 + thumb_func_end sub_814B554 + + thumb_func_start sub_814B5A8 +sub_814B5A8: @ 814B5A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r3, _0814B670 + ldr r0, [r3] + ldr r7, _0814B674 + 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 _0814B664 + 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, _0814B678 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldr r0, _0814B67C + movs r1, 0xA + bl AddTask + ldr r0, _0814B680 + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0814B684 + adds r0, r5 + bl sub_805E990 + ldr r1, _0814B688 + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0814B68C + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start + ldr r4, _0814B690 + 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, _0814B694 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814B698 + str r1, [r0] +_0814B664: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814B670: .4byte 0x020244d0 +_0814B674: .4byte 0x02024064 +_0814B678: .4byte 0x000027f9 +_0814B67C: .4byte c3_0802FDF4 + 1 +_0814B680: .4byte 0x0202406e +_0814B684: .4byte 0x020244ec +_0814B688: .4byte 0x020241e4 +_0814B68C: .4byte 0x02020630 +_0814B690: .4byte 0x03005d70 +_0814B694: .4byte 0x03005d60 +_0814B698: .4byte sub_814B4E0 + 1 + thumb_func_end sub_814B5A8 + + thumb_func_start sub_814B69C +sub_814B69C: @ 814B69C + push {r4-r6,lr} + ldr r6, _0814B71C + ldr r0, [r6] + ldr r4, _0814B720 + 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 _0814B6CE + ldr r0, _0814B724 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0814B728 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0814B6CE: + ldr r5, _0814B72C + ldr r0, _0814B730 + 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, _0814B734 + cmp r1, r0 + bne _0814B714 + 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 _0814B714 + adds r0, r3, r5 + bl obj_delete_and_free_tiles + ldr r1, _0814B738 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814B73C + str r1, [r0] +_0814B714: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814B71C: .4byte 0x020244d0 +_0814B720: .4byte 0x02024064 +_0814B724: .4byte 0x0202406e +_0814B728: .4byte 0x020244ec +_0814B72C: .4byte 0x02020630 +_0814B730: .4byte 0x03005d7c +_0814B734: .4byte nullsub_12 + 1 +_0814B738: .4byte 0x03005d60 +_0814B73C: .4byte sub_814B5A8 + 1 + thumb_func_end sub_814B69C + + thumb_func_start dp01_tbl4_exec_completed +dp01_tbl4_exec_completed: @ 814B740 + push {r4,lr} + sub sp, 0x4 + ldr r1, _0814B780 + ldr r4, _0814B784 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814B788 + str r1, [r0] + ldr r0, _0814B78C + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0814B794 + 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, _0814B790 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0814B7A6 + .align 2, 0 +_0814B780: .4byte 0x03005d60 +_0814B784: .4byte 0x02024064 +_0814B788: .4byte bx_exec_buffer_A_ch0_tbl4 + 1 +_0814B78C: .4byte 0x02022fec +_0814B790: .4byte 0x02023064 +_0814B794: + ldr r2, _0814B7B0 + ldr r1, _0814B7B4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0814B7A6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814B7B0: .4byte 0x02024068 +_0814B7B4: .4byte 0x0832a328 + thumb_func_end dp01_tbl4_exec_completed + + thumb_func_start sub_814B7B8 +sub_814B7B8: @ 814B7B8 + push {lr} + ldr r0, _0814B7E0 + ldr r2, [r0] + ldr r0, _0814B7E4 + 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 _0814B7DA + bl dp01_tbl4_exec_completed +_0814B7DA: + pop {r0} + bx r0 + .align 2, 0 +_0814B7E0: .4byte 0x020244d0 +_0814B7E4: .4byte 0x02024064 + thumb_func_end sub_814B7B8 + + thumb_func_start sub_814B7E8 +sub_814B7E8: @ 814B7E8 + push {lr} + ldr r0, _0814B810 + ldr r2, [r0] + ldr r0, _0814B814 + 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 _0814B80A + bl dp01_tbl4_exec_completed +_0814B80A: + pop {r0} + bx r0 + .align 2, 0 +_0814B810: .4byte 0x020244d0 +_0814B814: .4byte 0x02024064 + thumb_func_end sub_814B7E8 + + thumb_func_start dp01t_00_4_getattr +dp01t_00_4_getattr: @ 814B818 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, _0814B844 + ldr r0, _0814B848 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0814B850 + ldr r0, _0814B84C + 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 _0814B872 + .align 2, 0 +_0814B844: .4byte 0x02023064 +_0814B848: .4byte 0x02024064 +_0814B84C: .4byte 0x0202406e +_0814B850: + ldrb r4, [r1] + movs r5, 0 +_0814B854: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0814B86A + 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 +_0814B86A: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0814B854 +_0814B872: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl4_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_4_getattr + + thumb_func_start dp01_getattr_by_ch1_for_player_pokemon__ +dp01_getattr_by_ch1_for_player_pokemon__: @ 814B88C + 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, _0814B8C0 + ldr r3, _0814B8C4 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0814B8B6 + bl _0814C022 +_0814B8B6: + lsls r0, 2 + ldr r1, _0814B8C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814B8C0: .4byte 0x02023064 +_0814B8C4: .4byte 0x02024064 +_0814B8C8: .4byte _0814B8CC + .align 2, 0 +_0814B8CC: + .4byte _0814B9BC + .4byte _0814BBE0 + .4byte _0814BBF0 + .4byte _0814BC00 + .4byte _0814BC68 + .4byte _0814BC68 + .4byte _0814BC68 + .4byte _0814BC68 + .4byte _0814BC84 + .4byte _0814BCC0 + .4byte _0814BCC0 + .4byte _0814BCC0 + .4byte _0814BCC0 + .4byte _0814C022 + .4byte _0814C022 + .4byte _0814C022 + .4byte _0814C022 + .4byte _0814BCDC + .4byte _0814BCEC + .4byte _0814BD1C + .4byte _0814BD2C + .4byte _0814BD3C + .4byte _0814BD4C + .4byte _0814BD5C + .4byte _0814BD6C + .4byte _0814BD7C + .4byte _0814BD8C + .4byte _0814BD9C + .4byte _0814BDAC + .4byte _0814BDBC + .4byte _0814BDCC + .4byte _0814BDDC + .4byte _0814BE2C + .4byte _0814BE3C + .4byte _0814BE4C + .4byte _0814BE5C + .4byte _0814BE6C + .4byte _0814BE7C + .4byte _0814BE8C + .4byte _0814BE9C + .4byte _0814BEAC + .4byte _0814BEE0 + .4byte _0814BEF0 + .4byte _0814BF00 + .4byte _0814BF10 + .4byte _0814BF20 + .4byte _0814BF30 + .4byte _0814BF40 + .4byte _0814BF50 + .4byte _0814BF70 + .4byte _0814BF80 + .4byte _0814BF90 + .4byte _0814BFA0 + .4byte _0814BFB0 + .4byte _0814BFC0 + .4byte _0814BFD0 + .4byte _0814BFE0 + .4byte _0814BFF0 + .4byte _0814C000 + .4byte _0814C010 +_0814B9BC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814BBD0 + 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 +_0814BA08: + 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 _0814BA08 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814BBD0 + 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, _0814BBD4 + 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, _0814BBD8 + 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, _0814BBDC + 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 strcpy_limit_10_chars + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_0814BBC0: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _0814BBC0 + b _0814C022 + .align 2, 0 +_0814BBD0: .4byte 0x020244ec +_0814BBD4: .4byte 0xfffffc1f +_0814BBD8: .4byte 0xfff07fff +_0814BBDC: .4byte 0xfffffe0f +_0814BBE0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BBEC + adds r0, r1 + movs r1, 0xB + b _0814BF5A + .align 2, 0 +_0814BBEC: .4byte 0x020244ec +_0814BBF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BBFC + adds r0, r1 + movs r1, 0xC + b _0814BF5A + .align 2, 0 +_0814BBFC: .4byte 0x020244ec +_0814BC00: + 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, _0814BC64 + adds r4, r1, r0 + mov r8, r9 +_0814BC16: + 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 _0814BC16 + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BC64 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0814BC54: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0814BC54 + b _0814C022 + .align 2, 0 +_0814BC64: .4byte 0x020244ec +_0814BC68: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BC80 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0814BF5A + .align 2, 0 +_0814BC80: .4byte 0x020244ec +_0814BC84: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _0814BCBC + mov r8, r2 +_0814BC90: + 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 _0814BC90 + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BCBC + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0814C022 + .align 2, 0 +_0814BCBC: .4byte 0x020244ec +_0814BCC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BCD8 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0814C01A + .align 2, 0 +_0814BCD8: .4byte 0x020244ec +_0814BCDC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BCE8 + adds r0, r1 + movs r1, 0x1 + b _0814BCF6 + .align 2, 0 +_0814BCE8: .4byte 0x020244ec +_0814BCEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD18 + adds r0, r1 + movs r1, 0x19 +_0814BCF6: + 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 _0814C022 + .align 2, 0 +_0814BD18: .4byte 0x020244ec +_0814BD1C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD28 + adds r0, r1 + movs r1, 0x1A + b _0814C01A + .align 2, 0 +_0814BD28: .4byte 0x020244ec +_0814BD2C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD38 + adds r0, r1 + movs r1, 0x1B + b _0814C01A + .align 2, 0 +_0814BD38: .4byte 0x020244ec +_0814BD3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD48 + adds r0, r1 + movs r1, 0x1C + b _0814C01A + .align 2, 0 +_0814BD48: .4byte 0x020244ec +_0814BD4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD58 + adds r0, r1 + movs r1, 0x1D + b _0814C01A + .align 2, 0 +_0814BD58: .4byte 0x020244ec +_0814BD5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD68 + adds r0, r1 + movs r1, 0x1E + b _0814C01A + .align 2, 0 +_0814BD68: .4byte 0x020244ec +_0814BD6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD78 + adds r0, r1 + movs r1, 0x1F + b _0814C01A + .align 2, 0 +_0814BD78: .4byte 0x020244ec +_0814BD7C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD88 + adds r0, r1 + movs r1, 0x20 + b _0814C01A + .align 2, 0 +_0814BD88: .4byte 0x020244ec +_0814BD8C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BD98 + adds r0, r1 + movs r1, 0x22 + b _0814C01A + .align 2, 0 +_0814BD98: .4byte 0x020244ec +_0814BD9C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BDA8 + adds r0, r1 + movs r1, 0x23 + b _0814C01A + .align 2, 0 +_0814BDA8: .4byte 0x020244ec +_0814BDAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BDB8 + adds r0, r1 + movs r1, 0x24 + b _0814C01A + .align 2, 0 +_0814BDB8: .4byte 0x020244ec +_0814BDBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BDC8 + adds r0, r1 + movs r1, 0x25 + b _0814C01A + .align 2, 0 +_0814BDC8: .4byte 0x020244ec +_0814BDCC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BDD8 + adds r0, r1 + movs r1, 0x26 + b _0814C01A + .align 2, 0 +_0814BDD8: .4byte 0x020244ec +_0814BDDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814BE28 + 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 _0814C022 + .align 2, 0 +_0814BE28: .4byte 0x020244ec +_0814BE2C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE38 + adds r0, r1 + movs r1, 0x27 + b _0814C01A + .align 2, 0 +_0814BE38: .4byte 0x020244ec +_0814BE3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE48 + adds r0, r1 + movs r1, 0x28 + b _0814C01A + .align 2, 0 +_0814BE48: .4byte 0x020244ec +_0814BE4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE58 + adds r0, r1 + movs r1, 0x29 + b _0814C01A + .align 2, 0 +_0814BE58: .4byte 0x020244ec +_0814BE5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE68 + adds r0, r1 + movs r1, 0x2A + b _0814C01A + .align 2, 0 +_0814BE68: .4byte 0x020244ec +_0814BE6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE78 + adds r0, r1 + movs r1, 0x2B + b _0814C01A + .align 2, 0 +_0814BE78: .4byte 0x020244ec +_0814BE7C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE88 + adds r0, r1 + movs r1, 0x2C + b _0814C01A + .align 2, 0 +_0814BE88: .4byte 0x020244ec +_0814BE8C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BE98 + adds r0, r1 + movs r1, 0 + b _0814BEB6 + .align 2, 0 +_0814BE98: .4byte 0x020244ec +_0814BE9C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BEA8 + adds r0, r1 + movs r1, 0x9 + b _0814BF5A + .align 2, 0 +_0814BEA8: .4byte 0x020244ec +_0814BEAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BEDC + adds r0, r1 + movs r1, 0x37 +_0814BEB6: + 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 _0814C022 + .align 2, 0 +_0814BEDC: .4byte 0x020244ec +_0814BEE0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BEEC + adds r0, r1 + movs r1, 0x38 + b _0814C01A + .align 2, 0 +_0814BEEC: .4byte 0x020244ec +_0814BEF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BEFC + adds r0, r1 + movs r1, 0x39 + b _0814BF5A + .align 2, 0 +_0814BEFC: .4byte 0x020244ec +_0814BF00: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF0C + adds r0, r1 + movs r1, 0x3A + b _0814BF5A + .align 2, 0 +_0814BF0C: .4byte 0x020244ec +_0814BF10: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF1C + adds r0, r1 + movs r1, 0x3B + b _0814BF5A + .align 2, 0 +_0814BF1C: .4byte 0x020244ec +_0814BF20: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF2C + adds r0, r1 + movs r1, 0x3C + b _0814BF5A + .align 2, 0 +_0814BF2C: .4byte 0x020244ec +_0814BF30: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF3C + adds r0, r1 + movs r1, 0x3D + b _0814BF5A + .align 2, 0 +_0814BF3C: .4byte 0x020244ec +_0814BF40: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF4C + adds r0, r1 + movs r1, 0x3E + b _0814BF5A + .align 2, 0 +_0814BF4C: .4byte 0x020244ec +_0814BF50: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF6C + adds r0, r1 + movs r1, 0x3F +_0814BF5A: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0814C022 + .align 2, 0 +_0814BF6C: .4byte 0x020244ec +_0814BF70: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF7C + adds r0, r1 + movs r1, 0x16 + b _0814C01A + .align 2, 0 +_0814BF7C: .4byte 0x020244ec +_0814BF80: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF8C + adds r0, r1 + movs r1, 0x17 + b _0814C01A + .align 2, 0 +_0814BF8C: .4byte 0x020244ec +_0814BF90: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BF9C + adds r0, r1 + movs r1, 0x18 + b _0814C01A + .align 2, 0 +_0814BF9C: .4byte 0x020244ec +_0814BFA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BFAC + adds r0, r1 + movs r1, 0x21 + b _0814C01A + .align 2, 0 +_0814BFAC: .4byte 0x020244ec +_0814BFB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BFBC + adds r0, r1 + movs r1, 0x2F + b _0814C01A + .align 2, 0 +_0814BFBC: .4byte 0x020244ec +_0814BFC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BFCC + adds r0, r1 + movs r1, 0x30 + b _0814C01A + .align 2, 0 +_0814BFCC: .4byte 0x020244ec +_0814BFD0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BFDC + adds r0, r1 + movs r1, 0x32 + b _0814C01A + .align 2, 0 +_0814BFDC: .4byte 0x020244ec +_0814BFE0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BFEC + adds r0, r1 + movs r1, 0x33 + b _0814C01A + .align 2, 0 +_0814BFEC: .4byte 0x020244ec +_0814BFF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814BFFC + adds r0, r1 + movs r1, 0x34 + b _0814C01A + .align 2, 0 +_0814BFFC: .4byte 0x020244ec +_0814C000: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C00C + adds r0, r1 + movs r1, 0x35 + b _0814C01A + .align 2, 0 +_0814C00C: .4byte 0x020244ec +_0814C010: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C034 + adds r0, r1 + movs r1, 0x36 +_0814C01A: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0814C022: + 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 + .align 2, 0 +_0814C034: .4byte 0x020244ec + thumb_func_end dp01_getattr_by_ch1_for_player_pokemon__ + + thumb_func_start sub_814C038 +sub_814C038: @ 814C038 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814C038 + + thumb_func_start sub_814C044 +sub_814C044: @ 814C044 + push {r4,r5,lr} + ldr r1, _0814C068 + ldr r0, _0814C06C + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0814C074 + ldr r0, _0814C070 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_814C09C + b _0814C092 + .align 2, 0 +_0814C068: .4byte 0x02023064 +_0814C06C: .4byte 0x02024064 +_0814C070: .4byte 0x0202406e +_0814C074: + ldrb r4, [r1] + movs r5, 0 +_0814C078: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0814C086 + adds r0, r5, 0 + bl sub_814C09C +_0814C086: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0814C078 +_0814C092: + bl dp01_tbl4_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_814C044 + + thumb_func_start sub_814C09C +sub_814C09C: @ 814C09C + 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, _0814C0D4 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, _0814C0D8 + 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 _0814C0C8 + bl _0814CA62 +_0814C0C8: + lsls r0, 2 + ldr r1, _0814C0DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814C0D4: .4byte 0x02024064 +_0814C0D8: .4byte 0x02023067 +_0814C0DC: .4byte _0814C0E0 + .align 2, 0 +_0814C0E0: + .4byte _0814C1D0 + .4byte _0814C368 + .4byte _0814C388 + .4byte _0814C3A8 + .4byte _0814C400 + .4byte _0814C400 + .4byte _0814C400 + .4byte _0814C400 + .4byte _0814C428 + .4byte _0814C48C + .4byte _0814C48C + .4byte _0814C48C + .4byte _0814C48C + .4byte _0814CA62 + .4byte _0814CA62 + .4byte _0814CA62 + .4byte _0814CA62 + .4byte _0814C4BC + .4byte _0814C4DC + .4byte _0814C4FC + .4byte _0814C51C + .4byte _0814C53C + .4byte _0814C55C + .4byte _0814C57C + .4byte _0814C59C + .4byte _0814C5BC + .4byte _0814C5DC + .4byte _0814C5FC + .4byte _0814C61C + .4byte _0814C63C + .4byte _0814C65C + .4byte _0814C67C + .4byte _0814C6EC + .4byte _0814C70C + .4byte _0814C72C + .4byte _0814C74C + .4byte _0814C76C + .4byte _0814C78C + .4byte _0814C7AC + .4byte _0814C7CC + .4byte _0814C7EC + .4byte _0814C80C + .4byte _0814C82C + .4byte _0814C84C + .4byte _0814C86C + .4byte _0814C88C + .4byte _0814C8AC + .4byte _0814C8CC + .4byte _0814C8EC + .4byte _0814C90C + .4byte _0814C92C + .4byte _0814C94C + .4byte _0814C96C + .4byte _0814C98C + .4byte _0814C9AC + .4byte _0814C9CC + .4byte _0814C9EC + .4byte _0814CA0C + .4byte _0814CA2C + .4byte _0814CA4C +_0814C1D0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814C364 + 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 +_0814C236: + 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 _0814C236 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814C364 + 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 _0814CA62 + .align 2, 0 +_0814C364: .4byte 0x020244ec +_0814C368: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C380 + adds r0, r1 + ldr r1, _0814C384 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C380: .4byte 0x020244ec +_0814C384: .4byte 0x02024064 +_0814C388: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C3A0 + adds r0, r1 + ldr r1, _0814C3A4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C3A0: .4byte 0x020244ec +_0814C3A4: .4byte 0x02024064 +_0814C3A8: + 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, _0814C3FC + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0814C3C2: + 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 _0814C3C2 + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C3FC + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C3FC: .4byte 0x020244ec +_0814C400: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C41C + adds r0, r1 + ldr r3, _0814C420 + ldr r1, _0814C424 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0814C4A4 + .align 2, 0 +_0814C41C: .4byte 0x020244ec +_0814C420: .4byte 0x02023064 +_0814C424: .4byte 0x02024064 +_0814C428: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814C484 + adds r4, r0 + ldr r5, _0814C488 + 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 _0814CA62 + .align 2, 0 +_0814C484: .4byte 0x020244ec +_0814C488: .4byte 0x02024064 +_0814C48C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C4B0 + adds r0, r1 + ldr r3, _0814C4B4 + ldr r1, _0814C4B8 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0814C4A4: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C4B0: .4byte 0x020244ec +_0814C4B4: .4byte 0x02023064 +_0814C4B8: .4byte 0x02024064 +_0814C4BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C4D4 + adds r0, r1 + ldr r1, _0814C4D8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C4D4: .4byte 0x020244ec +_0814C4D8: .4byte 0x02024064 +_0814C4DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C4F4 + adds r0, r1 + ldr r1, _0814C4F8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C4F4: .4byte 0x020244ec +_0814C4F8: .4byte 0x02024064 +_0814C4FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C514 + adds r0, r1 + ldr r1, _0814C518 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C514: .4byte 0x020244ec +_0814C518: .4byte 0x02024064 +_0814C51C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C534 + adds r0, r1 + ldr r1, _0814C538 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C534: .4byte 0x020244ec +_0814C538: .4byte 0x02024064 +_0814C53C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C554 + adds r0, r1 + ldr r1, _0814C558 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C554: .4byte 0x020244ec +_0814C558: .4byte 0x02024064 +_0814C55C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C574 + adds r0, r1 + ldr r1, _0814C578 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C574: .4byte 0x020244ec +_0814C578: .4byte 0x02024064 +_0814C57C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C594 + adds r0, r1 + ldr r1, _0814C598 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C594: .4byte 0x020244ec +_0814C598: .4byte 0x02024064 +_0814C59C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C5B4 + adds r0, r1 + ldr r1, _0814C5B8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C5B4: .4byte 0x020244ec +_0814C5B8: .4byte 0x02024064 +_0814C5BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C5D4 + adds r0, r1 + ldr r1, _0814C5D8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C5D4: .4byte 0x020244ec +_0814C5D8: .4byte 0x02024064 +_0814C5DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C5F4 + adds r0, r1 + ldr r1, _0814C5F8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C5F4: .4byte 0x020244ec +_0814C5F8: .4byte 0x02024064 +_0814C5FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C614 + adds r0, r1 + ldr r1, _0814C618 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C614: .4byte 0x020244ec +_0814C618: .4byte 0x02024064 +_0814C61C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C634 + adds r0, r1 + ldr r1, _0814C638 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C634: .4byte 0x020244ec +_0814C638: .4byte 0x02024064 +_0814C63C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C654 + adds r0, r1 + ldr r1, _0814C658 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C654: .4byte 0x020244ec +_0814C658: .4byte 0x02024064 +_0814C65C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C674 + adds r0, r1 + ldr r1, _0814C678 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C674: .4byte 0x020244ec +_0814C678: .4byte 0x02024064 +_0814C67C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0814C6E4 + adds r4, r0 + ldr r5, _0814C6E8 + 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 _0814C79C + .align 2, 0 +_0814C6E4: .4byte 0x020244ec +_0814C6E8: .4byte 0x02024064 +_0814C6EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C704 + adds r0, r1 + ldr r1, _0814C708 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C704: .4byte 0x020244ec +_0814C708: .4byte 0x02024064 +_0814C70C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C724 + adds r0, r1 + ldr r1, _0814C728 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C724: .4byte 0x020244ec +_0814C728: .4byte 0x02024064 +_0814C72C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C744 + adds r0, r1 + ldr r1, _0814C748 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C744: .4byte 0x020244ec +_0814C748: .4byte 0x02024064 +_0814C74C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C764 + adds r0, r1 + ldr r1, _0814C768 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C764: .4byte 0x020244ec +_0814C768: .4byte 0x02024064 +_0814C76C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C784 + adds r0, r1 + ldr r1, _0814C788 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C784: .4byte 0x020244ec +_0814C788: .4byte 0x02024064 +_0814C78C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C7A4 + adds r0, r1 + ldr r1, _0814C7A8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0814C79C: + movs r1, 0x2C + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C7A4: .4byte 0x020244ec +_0814C7A8: .4byte 0x02024064 +_0814C7AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C7C4 + adds r0, r1 + ldr r1, _0814C7C8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C7C4: .4byte 0x020244ec +_0814C7C8: .4byte 0x02024064 +_0814C7CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C7E4 + adds r0, r1 + ldr r1, _0814C7E8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C7E4: .4byte 0x020244ec +_0814C7E8: .4byte 0x02024064 +_0814C7EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C804 + adds r0, r1 + ldr r1, _0814C808 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C804: .4byte 0x020244ec +_0814C808: .4byte 0x02024064 +_0814C80C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C824 + adds r0, r1 + ldr r1, _0814C828 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C824: .4byte 0x020244ec +_0814C828: .4byte 0x02024064 +_0814C82C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C844 + adds r0, r1 + ldr r1, _0814C848 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C844: .4byte 0x020244ec +_0814C848: .4byte 0x02024064 +_0814C84C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C864 + adds r0, r1 + ldr r1, _0814C868 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C864: .4byte 0x020244ec +_0814C868: .4byte 0x02024064 +_0814C86C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C884 + adds r0, r1 + ldr r1, _0814C888 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C884: .4byte 0x020244ec +_0814C888: .4byte 0x02024064 +_0814C88C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C8A4 + adds r0, r1 + ldr r1, _0814C8A8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C8A4: .4byte 0x020244ec +_0814C8A8: .4byte 0x02024064 +_0814C8AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C8C4 + adds r0, r1 + ldr r1, _0814C8C8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C8C4: .4byte 0x020244ec +_0814C8C8: .4byte 0x02024064 +_0814C8CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C8E4 + adds r0, r1 + ldr r1, _0814C8E8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C8E4: .4byte 0x020244ec +_0814C8E8: .4byte 0x02024064 +_0814C8EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C904 + adds r0, r1 + ldr r1, _0814C908 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C904: .4byte 0x020244ec +_0814C908: .4byte 0x02024064 +_0814C90C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C924 + adds r0, r1 + ldr r1, _0814C928 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C924: .4byte 0x020244ec +_0814C928: .4byte 0x02024064 +_0814C92C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C944 + adds r0, r1 + ldr r1, _0814C948 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C944: .4byte 0x020244ec +_0814C948: .4byte 0x02024064 +_0814C94C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C964 + adds r0, r1 + ldr r1, _0814C968 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C964: .4byte 0x020244ec +_0814C968: .4byte 0x02024064 +_0814C96C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C984 + adds r0, r1 + ldr r1, _0814C988 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C984: .4byte 0x020244ec +_0814C988: .4byte 0x02024064 +_0814C98C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C9A4 + adds r0, r1 + ldr r1, _0814C9A8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C9A4: .4byte 0x020244ec +_0814C9A8: .4byte 0x02024064 +_0814C9AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C9C4 + adds r0, r1 + ldr r1, _0814C9C8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C9C4: .4byte 0x020244ec +_0814C9C8: .4byte 0x02024064 +_0814C9CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814C9E4 + adds r0, r1 + ldr r1, _0814C9E8 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814C9E4: .4byte 0x020244ec +_0814C9E8: .4byte 0x02024064 +_0814C9EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814CA04 + adds r0, r1 + ldr r1, _0814CA08 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814CA04: .4byte 0x020244ec +_0814CA08: .4byte 0x02024064 +_0814CA0C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814CA24 + adds r0, r1 + ldr r1, _0814CA28 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814CA24: .4byte 0x020244ec +_0814CA28: .4byte 0x02024064 +_0814CA2C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814CA44 + adds r0, r1 + ldr r1, _0814CA48 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0814CA62 + .align 2, 0 +_0814CA44: .4byte 0x020244ec +_0814CA48: .4byte 0x02024064 +_0814CA4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0814CA8C + adds r0, r1 + ldr r1, _0814CA90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0814CA62: + ldr r2, _0814CA94 + ldr r0, _0814CA90 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0814CA8C + 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 + .align 2, 0 +_0814CA8C: .4byte 0x020244ec +_0814CA90: .4byte 0x02024064 +_0814CA94: .4byte 0x0202406e + thumb_func_end sub_814C09C + + thumb_func_start sub_814CA98 +sub_814CA98: @ 814CA98 + push {r4-r7,lr} + ldr r1, _0814CAFC + ldr r7, _0814CB00 + 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, _0814CB04 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _0814CB08 + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0814CAF0 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_0814CACE: + 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 _0814CACE +_0814CAF0: + bl dp01_tbl4_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814CAFC: .4byte 0x0202406e +_0814CB00: .4byte 0x02024064 +_0814CB04: .4byte 0x02023064 +_0814CB08: .4byte 0x020244ec + thumb_func_end sub_814CA98 + + thumb_func_start sub_814CB0C +sub_814CB0C: @ 814CB0C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _0814CC00 + mov r8, r0 + ldr r6, _0814CC04 + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0814CC08 + 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, _0814CC0C + 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 obj_add_from_template_forward_search + ldr r4, _0814CC10 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, _0814CC14 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0814CC18 + 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, _0814CC1C + adds r2, r1 + ldrb r1, [r2] + bl obj_anim_image_start + ldr r1, _0814CC20 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814CC24 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814CC00: .4byte 0x0202406e +_0814CC04: .4byte 0x02024064 +_0814CC08: .4byte 0x020244ec +_0814CC0C: .4byte 0x0202499c +_0814CC10: .4byte 0x020241e4 +_0814CC14: .4byte 0x02020630 +_0814CC18: .4byte 0x0000ff10 +_0814CC1C: .4byte 0x020244e4 +_0814CC20: .4byte 0x03005d60 +_0814CC24: .4byte sub_814B290 + 1 + thumb_func_end sub_814CB0C + + thumb_func_start sub_814CC28 +sub_814CC28: @ 814CC28 + push {r4-r6,lr} + ldr r5, _0814CC80 + ldrb r0, [r5] + ldr r4, _0814CC84 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, _0814CC88 + 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, _0814CC8C + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_814CC98 + ldr r1, _0814CC90 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814CC94 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814CC80: .4byte 0x02024064 +_0814CC84: .4byte 0x02023064 +_0814CC88: .4byte 0x0202406e +_0814CC8C: .4byte 0x020244ec +_0814CC90: .4byte 0x03005d60 +_0814CC94: .4byte sub_814B69C + 1 + thumb_func_end sub_814CC28 + + thumb_func_start sub_814CC98 +sub_814CC98: @ 814CC98 + 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, _0814CDEC + lsls r2, r6, 1 + adds r2, r0 + ldr r0, _0814CDF0 + 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, _0814CDF4 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0814CDF8 + bl object_new_hidden_with_callback + ldr r1, _0814CDFC + 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, _0814CE00 + 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 obj_add_from_template_forward_search + ldr r4, _0814CE04 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _0814CE08 + 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, _0814CE0C + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _0814CE10 + 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 + .align 2, 0 +_0814CDEC: .4byte 0x0202406e +_0814CDF0: .4byte 0x02023064 +_0814CDF4: .4byte 0x020244ec +_0814CDF8: .4byte sub_805D714 + 1 +_0814CDFC: .4byte 0x03005d7c +_0814CE00: .4byte 0x0202499c +_0814CE04: .4byte 0x020241e4 +_0814CE08: .4byte 0x02020630 +_0814CE0C: .4byte 0x020244e4 +_0814CE10: .4byte nullsub_12 + 1 + thumb_func_end sub_814CC98 + + thumb_func_start sub_814CE14 +sub_814CE14: @ 814CE14 + push {r4-r6,lr} + ldr r1, _0814CE48 + ldr r6, _0814CE4C + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0814CE5C + ldr r0, _0814CE50 + 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, _0814CE54 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814CE58 + str r1, [r0] + b _0814CE92 + .align 2, 0 +_0814CE48: .4byte 0x02023064 +_0814CE4C: .4byte 0x02024064 +_0814CE50: .4byte 0x020244d0 +_0814CE54: .4byte 0x03005d60 +_0814CE58: .4byte sub_814CEA4 + 1 +_0814CE5C: + ldr r5, _0814CE98 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0814CE9C + 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 obj_delete_and_free_tiles + ldr r1, _0814CEA0 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl4_exec_completed +_0814CE92: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814CE98: .4byte 0x020241e4 +_0814CE9C: .4byte 0x02020630 +_0814CEA0: .4byte 0x03005d70 + thumb_func_end sub_814CE14 + + thumb_func_start sub_814CEA4 +sub_814CEA4: @ 814CEA4 + push {r4-r6,lr} + ldr r6, _0814CEC4 + ldr r4, [r6] + ldr r5, _0814CEC8 + 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 _0814CECC + cmp r0, 0x1 + beq _0814CEFA + b _0814CF22 + .align 2, 0 +_0814CEC4: .4byte 0x020244d0 +_0814CEC8: .4byte 0x02024064 +_0814CECC: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0814CEE6 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0814CEE6: + 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 _0814CF22 +_0814CEFA: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0814CF22 + 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, _0814CF28 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814CF2C + str r1, [r0] +_0814CF22: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814CF28: .4byte 0x03005d60 +_0814CF2C: .4byte sub_814B3DC + 1 + thumb_func_end sub_814CEA4 + + thumb_func_start sub_814CF30 +sub_814CF30: @ 814CF30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0814CF58 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814CF60 + ldr r0, _0814CF5C + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0x20 + cmp r1, 0 + beq _0814CF62 + movs r7, 0x5A + b _0814CF62 + .align 2, 0 +_0814CF58: .4byte 0x02022fec +_0814CF5C: .4byte 0x02024064 +_0814CF60: + movs r7, 0x50 +_0814CF62: + ldr r5, _0814CFA8 + ldrb r0, [r5] + bl sub_806D864 + ldr r6, _0814CFAC + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0814CF94 + 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 _0814CFB0 +_0814CF94: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x2 + b _0814D002 + .align 2, 0 +_0814CFA8: .4byte 0x02024064 +_0814CFAC: .4byte 0x020229e8 +_0814CFB0: + 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 _0814CFDE + 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 _0814CFF2 +_0814CFDE: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x4 + b _0814D002 +_0814CFF2: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r4, [r1, 0x13] +_0814D002: + ldr r5, _0814D0C0 + 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, _0814D0C4 + mov r8, r7 + ldr r0, _0814D0C8 + lsls r4, 2 + adds r4, r0 + ldrb r0, [r4] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 15 + 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, r8 + adds r2, r4, 0 + bl obj_add_from_template_forward_search + ldr r6, _0814D0CC + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _0814D0D0 + 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, _0814D0D4 + 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, _0814D0D8 + str r1, [r0] + ldr r1, _0814D0DC + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D0E0 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814D0C0: .4byte 0x02024064 +_0814D0C4: .4byte 0x0202499c +_0814D0C8: .4byte 0x08305d2c +_0814D0CC: .4byte 0x020241e4 +_0814D0D0: .4byte 0x02020630 +_0814D0D4: .4byte 0x0000fffe +_0814D0D8: .4byte sub_805D7AC + 1 +_0814D0DC: .4byte 0x03005d60 +_0814D0E0: .4byte sub_814AF1C + 1 + thumb_func_end sub_814CF30 + + thumb_func_start sub_814D0E4 +sub_814D0E4: @ 814D0E4 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D0E4 + + thumb_func_start sub_814D0F0 +sub_814D0F0: @ 814D0F0 + push {r4-r6,lr} + ldr r6, _0814D17C + ldr r4, _0814D180 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0814D184 + 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, _0814D188 + 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, _0814D18C + 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, _0814D190 + bl oamt_set_x3A_32 + ldr r1, _0814D194 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D198 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814D17C: .4byte 0x020241e4 +_0814D180: .4byte 0x02024064 +_0814D184: .4byte 0x02020630 +_0814D188: .4byte 0x0000ffd8 +_0814D18C: .4byte sub_80A6EEC + 1 +_0814D190: .4byte nullsub_12 + 1 +_0814D194: .4byte 0x03005d60 +_0814D198: .4byte sub_814AF54 + 1 + thumb_func_end sub_814D0F0 + + thumb_func_start sub_814D19C +sub_814D19C: @ 814D19C + push {r4-r6,lr} + ldr r6, _0814D1E8 + ldr r4, [r6] + ldr r5, _0814D1EC + 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 _0814D1F0 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0814D1D0 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0814D1D0: + 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 _0814D266 + .align 2, 0 +_0814D1E8: .4byte 0x020244d0 +_0814D1EC: .4byte 0x02024064 +_0814D1F0: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0814D266 + strb r4, [r3, 0x4] + ldr r2, _0814D26C + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0814D270 + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, _0814D274 + ldr r3, _0814D278 + 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, _0814D27C + str r1, [r0] + ldr r1, _0814D280 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D284 + str r1, [r0] +_0814D266: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814D26C: .4byte 0x0202406e +_0814D270: .4byte 0x020244ec +_0814D274: .4byte 0x02020630 +_0814D278: .4byte 0x020241e4 +_0814D27C: .4byte sub_8039C00 + 1 +_0814D280: .4byte 0x03005d60 +_0814D284: .4byte sub_814B340 + 1 + thumb_func_end sub_814D19C + + thumb_func_start sub_814D288 +sub_814D288: @ 814D288 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D288 + + thumb_func_start sub_814D294 +sub_814D294: @ 814D294 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D294 + + thumb_func_start sub_814D2A0 +sub_814D2A0: @ 814D2A0 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D2A0 + + thumb_func_start sub_814D2AC +sub_814D2AC: @ 814D2AC + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D2AC + + thumb_func_start sub_814D2B8 +sub_814D2B8: @ 814D2B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, _0814D3A8 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0814D2CE + b _0814D3F4 +_0814D2CE: + ldr r0, _0814D3AC + 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, _0814D3B0 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, _0814D3B4 + 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, _0814D3B8 + 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, _0814D3BC + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, _0814D3C0 + 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, _0814D3C4 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, _0814D3C8 + 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 _0814D3CC + bl dp01_tbl4_exec_completed + b _0814D3F4 + .align 2, 0 +_0814D3A8: .4byte 0x02024064 +_0814D3AC: .4byte 0x02023064 +_0814D3B0: .4byte 0x02038432 +_0814D3B4: .4byte 0x02038408 +_0814D3B8: .4byte 0x02038404 +_0814D3BC: .4byte 0x0203841a +_0814D3C0: .4byte 0x0203841c +_0814D3C4: .4byte 0x02038400 +_0814D3C8: .4byte 0x020244bc +_0814D3CC: + ldr r0, _0814D400 + 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, _0814D404 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D408 + str r1, [r0] + ldrh r1, [r4] + ldr r2, [r7] + adds r0, r6, 0 + bl sub_817E0FC +_0814D3F4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814D400: .4byte 0x020244d0 +_0814D404: .4byte 0x03005d60 +_0814D408: .4byte bx_move_anim_4 + 1 + thumb_func_end sub_814D2B8 + + thumb_func_start bx_move_anim_4 +bx_move_anim_4: @ 814D40C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, _0814D458 + ldr r6, _0814D45C + 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, _0814D460 + 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 _0814D4A4 + cmp r2, 0x1 + bgt _0814D464 + cmp r2, 0 + beq _0814D46E + b _0814D580 + .align 2, 0 +_0814D458: .4byte 0x02023064 +_0814D45C: .4byte 0x02024064 +_0814D460: .4byte 0x020244d0 +_0814D464: + cmp r2, 0x2 + beq _0814D4CE + cmp r2, 0x3 + beq _0814D544 + b _0814D580 +_0814D46E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _0814D490 + 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 +_0814D490: + 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 _0814D580 +_0814D4A4: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0814D580 + 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 _0814D580 +_0814D4CE: + ldr r0, _0814D534 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0814D538 + ldrb r0, [r0] + cmp r0, 0 + bne _0814D580 + 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 _0814D51C + mov r0, r8 + cmp r0, 0x1 + bhi _0814D51C + 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] +_0814D51C: + ldr r0, _0814D53C + ldr r2, [r0] + ldr r0, _0814D540 + 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 _0814D580 + .align 2, 0 +_0814D534: .4byte 0x020383f8 +_0814D538: .4byte 0x020383fd +_0814D53C: .4byte 0x020244d0 +_0814D540: .4byte 0x02024064 +_0814D544: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0814D580 + 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_tbl4_exec_completed +_0814D580: + 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_4 + + thumb_func_start sub_814D590 +sub_814D590: @ 814D590 + push {r4,r5,lr} + ldr r0, _0814D5CC + movs r1, 0 + strh r1, [r0] + ldr r0, _0814D5D0 + strh r1, [r0] + ldr r5, _0814D5D4 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, _0814D5D8 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, _0814D5DC + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0814D5E0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D5E4 + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814D5CC: .4byte 0x02022e14 +_0814D5D0: .4byte 0x02022e16 +_0814D5D4: .4byte 0x02024064 +_0814D5D8: .4byte 0x02023066 +_0814D5DC: .4byte 0x02022e2c +_0814D5E0: .4byte 0x03005d60 +_0814D5E4: .4byte bx_t4_button_a + 1 + thumb_func_end sub_814D590 + + thumb_func_start sub_814D5E8 +sub_814D5E8: @ 814D5E8 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D5E8 + + thumb_func_start sub_814D5F4 +sub_814D5F4: @ 814D5F4 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D5F4 + + thumb_func_start sub_814D600 +sub_814D600: @ 814D600 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D600 + + thumb_func_start sub_814D60C +sub_814D60C: @ 814D60C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D60C + + thumb_func_start sub_814D618 +sub_814D618: @ 814D618 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D618 + + thumb_func_start sub_814D624 +sub_814D624: @ 814D624 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D624 + + thumb_func_start sub_814D630 +sub_814D630: @ 814D630 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D630 + + thumb_func_start sub_814D63C +sub_814D63C: @ 814D63C + 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, _0814D6B4 + ldr r0, _0814D6B8 + 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, _0814D6BC + cmp r7, r0 + beq _0814D6CC + ldr r6, _0814D6C0 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0814D6C4 + 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, _0814D6C8 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0814D6F6 + .align 2, 0 +_0814D6B4: .4byte 0x02023064 +_0814D6B8: .4byte 0x02024064 +_0814D6BC: .4byte 0x00007fff +_0814D6C0: .4byte 0x0202406e +_0814D6C4: .4byte 0x020244ec +_0814D6C8: .4byte 0x03005d70 +_0814D6CC: + ldr r1, _0814D714 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814D718 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, _0814D71C + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0814D6F6: + ldr r1, _0814D720 + ldr r0, _0814D724 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D728 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814D714: .4byte 0x0202406e +_0814D718: .4byte 0x020244ec +_0814D71C: .4byte 0x03005d70 +_0814D720: .4byte 0x03005d60 +_0814D724: .4byte 0x02024064 +_0814D728: .4byte bx_t4_healthbar_update + 1 + thumb_func_end sub_814D63C + + thumb_func_start sub_814D72C +sub_814D72C: @ 814D72C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D72C + + thumb_func_start sub_814D738 +sub_814D738: @ 814D738 + push {r4,lr} + ldr r4, _0814D794 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0814D78C + ldr r0, _0814D798 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _0814D79C + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0814D7A0 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _0814D7A4 + 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, _0814D7A8 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D7AC + str r1, [r0] +_0814D78C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814D794: .4byte 0x02024064 +_0814D798: .4byte 0x03005d70 +_0814D79C: .4byte 0x0202406e +_0814D7A0: .4byte 0x020244ec +_0814D7A4: .4byte 0x020244d0 +_0814D7A8: .4byte 0x03005d60 +_0814D7AC: .4byte sub_814B7B8 + 1 + thumb_func_end sub_814D738 + + thumb_func_start sub_814D7B0 +sub_814D7B0: @ 814D7B0 + push {r4,r5,lr} + ldr r5, _0814D808 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0814D800 + ldr r4, _0814D80C + 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, _0814D810 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D814 + str r1, [r0] +_0814D800: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814D808: .4byte 0x02024064 +_0814D80C: .4byte 0x02023064 +_0814D810: .4byte 0x03005d60 +_0814D814: .4byte sub_814B7B8 + 1 + thumb_func_end sub_814D7B0 + + thumb_func_start sub_814D818 +sub_814D818: @ 814D818 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D818 + + thumb_func_start sub_814D824 +sub_814D824: @ 814D824 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D824 + + thumb_func_start sub_814D830 +sub_814D830: @ 814D830 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D830 + + thumb_func_start sub_814D83C +sub_814D83C: @ 814D83C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D83C + + thumb_func_start sub_814D848 +sub_814D848: @ 814D848 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D848 + + thumb_func_start sub_814D854 +sub_814D854: @ 814D854 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D854 + + thumb_func_start sub_814D860 +sub_814D860: @ 814D860 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D860 + + thumb_func_start sub_814D86C +sub_814D86C: @ 814D86C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D86C + + thumb_func_start sub_814D878 +sub_814D878: @ 814D878 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D878 + + thumb_func_start sub_814D884 +sub_814D884: @ 814D884 + push {lr} + ldr r2, _0814D89C + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814D89C: .4byte 0x02022d0c + thumb_func_end sub_814D884 + + thumb_func_start sub_814D8A0 +sub_814D8A0: @ 814D8A0 + push {lr} + ldr r3, _0814D8CC + ldr r1, _0814D8D0 + ldr r0, _0814D8D4 + 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_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814D8CC: .4byte 0x02022d0c +_0814D8D0: .4byte 0x02023064 +_0814D8D4: .4byte 0x02024064 + thumb_func_end sub_814D8A0 + + thumb_func_start sub_814D8D8 +sub_814D8D8: @ 814D8D8 + push {lr} + ldr r2, _0814D8EC + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814D8EC: .4byte 0x02022d0c + thumb_func_end sub_814D8D8 + + thumb_func_start sub_814D8F0 +sub_814D8F0: @ 814D8F0 + push {lr} + ldr r3, _0814D914 + 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_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814D914: .4byte 0x02022d0c + thumb_func_end sub_814D8F0 + + thumb_func_start dp01t_29_4_blink +dp01t_29_4_blink: @ 814D918 + push {r4,lr} + ldr r3, _0814D940 + ldr r2, _0814D944 + ldr r4, _0814D948 + 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 _0814D94C + bl dp01_tbl4_exec_completed + b _0814D976 + .align 2, 0 +_0814D940: .4byte 0x02020630 +_0814D944: .4byte 0x020241e4 +_0814D948: .4byte 0x02024064 +_0814D94C: + ldr r1, _0814D97C + 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, _0814D980 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814D984 + str r1, [r0] +_0814D976: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814D97C: .4byte 0x020244b9 +_0814D980: .4byte 0x03005d60 +_0814D984: .4byte dp01t_0F_4_move_anim + 1 + thumb_func_end dp01t_29_4_blink + + thumb_func_start sub_814D988 +sub_814D988: @ 814D988 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D988 + + thumb_func_start sub_814D994 +sub_814D994: @ 814D994 + push {r4,lr} + ldr r4, _0814D9D0 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0814D9A8 + movs r3, 0xC0 +_0814D9A8: + ldr r2, _0814D9D4 + 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_tbl4_exec_completed + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814D9D0: .4byte 0x02024064 +_0814D9D4: .4byte 0x02023064 + thumb_func_end sub_814D994 + + thumb_func_start sub_814D9D8 +sub_814D9D8: @ 814D9D8 + push {r4,r5,lr} + ldr r4, _0814DA0C + ldr r5, _0814DA10 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0814DA14 + 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 _0814DA28 + .align 2, 0 +_0814DA0C: .4byte 0x02023064 +_0814DA10: .4byte 0x02024064 +_0814DA14: + 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 +_0814DA28: + bl dp01_tbl4_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_814D9D8 + + thumb_func_start sub_814DA34 +sub_814DA34: @ 814DA34 + push {lr} + ldr r1, _0814DA68 + ldr r0, _0814DA6C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814DA70 + 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_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814DA68: .4byte 0x0202406e +_0814DA6C: .4byte 0x02024064 +_0814DA70: .4byte 0x020244ec + thumb_func_end sub_814DA34 + + thumb_func_start dp01t_2E_4_battle_intro +dp01t_2E_4_battle_intro: @ 814DA74 + push {lr} + ldr r1, _0814DA9C + ldr r0, _0814DAA0 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _0814DAA4 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814DA9C: .4byte 0x02023064 +_0814DAA0: .4byte 0x02024064 +_0814DAA4: .4byte 0x020243fc + thumb_func_end dp01t_2E_4_battle_intro + + thumb_func_start sub_814DAA8 +sub_814DAA8: @ 814DAA8 + push {r4-r7,lr} + ldr r5, _0814DB94 + ldr r6, _0814DB98 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0814DB9C + 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, _0814DBA0 + 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, _0814DBA4 + str r1, [r0] + ldrb r2, [r6] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x38] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _0814DBA8 + 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 obj_anim_image_start + ldr r0, _0814DBAC + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6] + bl sub_806D864 + ldr r4, _0814DBB0 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + movs r5, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0814DB80 + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0814DBB4 +_0814DB80: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] + adds r0, 0x2 + b _0814DC06 + .align 2, 0 +_0814DB94: .4byte 0x020241e4 +_0814DB98: .4byte 0x02024064 +_0814DB9C: .4byte 0x02020630 +_0814DBA0: .4byte 0x0000ffd8 +_0814DBA4: .4byte sub_80A6EEC + 1 +_0814DBA8: .4byte sub_805CC00 + 1 +_0814DBAC: .4byte 0x0000d6f9 +_0814DBB0: .4byte 0x020229e8 +_0814DBB4: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0814DBE2 + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1] + ands r5, r0 + cmp r5, 0x1 + bne _0814DBF6 +_0814DBE2: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] + adds r0, 0x4 + b _0814DC06 +_0814DBF6: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] +_0814DC06: + ldr r1, _0814DCA0 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r4, r7, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + ldr r2, _0814DCA4 + ldr r1, _0814DCA8 + ldr r5, _0814DCAC + 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, _0814DCB0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0814DCB4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, _0814DCB8 + 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 _0814DC80 + ldr r0, _0814DCBC + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _0814DCC0 + str r1, [r0] +_0814DC80: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, _0814DCC4 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814DCC8 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814DCA0: .4byte 0x08305d8c +_0814DCA4: .4byte 0x02020630 +_0814DCA8: .4byte 0x020241e4 +_0814DCAC: .4byte 0x02024064 +_0814DCB0: .4byte sub_814DCCC + 1 +_0814DCB4: .4byte 0x03005e00 +_0814DCB8: .4byte 0x020244d0 +_0814DCBC: .4byte 0x020244b4 +_0814DCC0: .4byte sub_8073C30 + 1 +_0814DCC4: .4byte 0x03005d60 +_0814DCC8: .4byte nullsub_112 + 1 + thumb_func_end sub_814DAA8 + + thumb_func_start sub_814DCCC +sub_814DCCC: @ 814DCCC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _0814DCF4 + 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 _0814DCF8 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0814DDB4 + .align 2, 0 +_0814DCF4: .4byte 0x03005e00 +_0814DCF8: + ldr r7, _0814DD38 + 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 _0814DD18 + ldr r0, _0814DD3C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814DD48 +_0814DD18: + ldr r0, _0814DD40 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _0814DD44 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_814CC98 + b _0814DD9C + .align 2, 0 +_0814DD38: .4byte 0x02024064 +_0814DD3C: .4byte 0x02022fec +_0814DD40: .4byte 0x02023064 +_0814DD44: .4byte 0x0202406e +_0814DD48: + ldr r4, _0814DDC0 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, _0814DDC4 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_814CC98 + 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, _0814DDC8 + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_814CC98 + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_0814DD9C: + ldr r1, _0814DDCC + ldr r2, _0814DDD0 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814DDD4 + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl remove_task +_0814DDB4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814DDC0: .4byte 0x02023064 +_0814DDC4: .4byte 0x0202406e +_0814DDC8: .4byte 0x020244ec +_0814DDCC: .4byte 0x03005d60 +_0814DDD0: .4byte 0x02024064 +_0814DDD4: .4byte sub_814B0E8 + 1 + thumb_func_end sub_814DCCC + + thumb_func_start sub_814DDD8 +sub_814DDD8: @ 814DDD8 + push {r4-r6,lr} + ldr r1, _0814DE00 + ldr r0, _0814DE04 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0814DE08 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814DE08 + bl dp01_tbl4_exec_completed + b _0814DE7C + .align 2, 0 +_0814DE00: .4byte 0x02023064 +_0814DE04: .4byte 0x02024064 +_0814DE08: + ldr r6, _0814DE84 + ldr r0, [r6] + ldr r5, _0814DE88 + 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, _0814DE8C + 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, _0814DE90 + 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 _0814DE70 + 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] +_0814DE70: + ldr r0, _0814DE94 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _0814DE98 + str r0, [r1] +_0814DE7C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814DE84: .4byte 0x020244d0 +_0814DE88: .4byte 0x02024064 +_0814DE8C: .4byte 0x02023068 +_0814DE90: .4byte 0x020244b4 +_0814DE94: .4byte 0x03005d60 +_0814DE98: .4byte sub_814DE9C + 1 + thumb_func_end sub_814DDD8 + + thumb_func_start sub_814DE9C +sub_814DE9C: @ 814DE9C + push {r4,lr} + ldr r4, _0814DEDC + ldr r0, [r4] + ldr r3, _0814DEE0 + 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 _0814DED4 + 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_tbl4_exec_completed +_0814DED4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814DEDC: .4byte 0x020244d0 +_0814DEE0: .4byte 0x02024064 + thumb_func_end sub_814DE9C + + thumb_func_start sub_814DEE4 +sub_814DEE4: @ 814DEE4 + push {lr} + ldr r0, _0814DF20 + ldr r1, [r0] + ldr r0, _0814DF24 + 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 _0814DF16 + ldr r2, _0814DF28 + ldr r0, _0814DF2C + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _0814DF30 + str r1, [r0] +_0814DF16: + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814DF20: .4byte 0x020244d0 +_0814DF24: .4byte 0x02024064 +_0814DF28: .4byte 0x03005e00 +_0814DF2C: .4byte 0x020244b4 +_0814DF30: .4byte sub_8073C30 + 1 + thumb_func_end sub_814DEE4 + + thumb_func_start sub_814DF34 +sub_814DF34: @ 814DF34 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814DF34 + + thumb_func_start sub_814DF40 +sub_814DF40: @ 814DF40 + push {r4,lr} + ldr r4, _0814DF90 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0814DF86 + ldr r3, _0814DF94 + ldr r0, _0814DF98 + 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, _0814DF9C + 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 +_0814DF86: + bl dp01_tbl4_exec_completed + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814DF90: .4byte 0x02024064 +_0814DF94: .4byte 0x02020630 +_0814DF98: .4byte 0x020241e4 +_0814DF9C: .4byte 0x02023064 + thumb_func_end sub_814DF40 + + thumb_func_start sub_814DFA0 +sub_814DFA0: @ 814DFA0 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _0814DFE8 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0814E002 + ldr r4, _0814DFEC + 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 _0814DFF0 + bl dp01_tbl4_exec_completed + b _0814DFFC + .align 2, 0 +_0814DFE8: .4byte 0x02024064 +_0814DFEC: .4byte 0x02023064 +_0814DFF0: + ldr r0, _0814E00C + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _0814E010 + str r0, [r1] +_0814DFFC: + adds r0, r6, 0 + bl sub_817E32C +_0814E002: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0814E00C: .4byte 0x03005d60 +_0814E010: .4byte sub_814B7E8 + 1 + thumb_func_end sub_814DFA0 + + thumb_func_start sub_814E014 +sub_814E014: @ 814E014 + push {lr} + ldr r0, _0814E02C + ldrb r0, [r0] + lsls r0, 9 + ldr r1, _0814E030 + adds r0, r1 + bl sub_81851A8 + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0814E02C: .4byte 0x02024064 +_0814E030: .4byte 0x02023066 + thumb_func_end sub_814E014 + + thumb_func_start sub_814E034 +sub_814E034: @ 814E034 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814E034 + + thumb_func_start sub_814E040 +sub_814E040: @ 814E040 + push {r4,r5,lr} + ldr r5, _0814E0A4 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, _0814E0A8 + adds r0, r4 + bl sub_81851A8 + ldr r2, _0814E0AC + ldrb r0, [r5] + lsls r0, 9 + subs r1, r4, 0x3 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, _0814E0B0 + ldr r3, [r0] + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x2 + adds r0, r4 + ldrb r0, [r0] + ldr r1, _0814E0B4 + 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_tbl4_exec_completed + ldr r1, _0814E0B8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0814E0BC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814E0A4: .4byte 0x02024064 +_0814E0A8: .4byte 0x02023068 +_0814E0AC: .4byte 0x0202433a +_0814E0B0: .4byte 0x03005d90 +_0814E0B4: .4byte 0x00000ca9 +_0814E0B8: .4byte 0x03005d60 +_0814E0BC: .4byte sub_80587B0 + 1 + thumb_func_end sub_814E040 + + thumb_func_start nullsub_113 +nullsub_113: @ 814E0C0 + bx lr + thumb_func_end nullsub_113 + + thumb_func_start battle_pick_message +battle_pick_message: @ 814E0C4 + 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 + ldr r4, _0814E180 + ldr r0, _0814E184 + mov r8, r0 + ldrb r1, [r0] + lsls r1, 9 + ldr r0, _0814E188 + adds r1, r0 + str r1, [r4] + ldr r2, _0814E18C + ldrh r0, [r1, 0x4] + strh r0, [r2] + ldr r2, _0814E190 + ldrb r0, [r1, 0x6] + strb r0, [r2] + ldr r5, _0814E194 + ldrb r0, [r1, 0x7] + strb r0, [r5, 0x17] + ldr r3, _0814E198 + ldr r0, [r3] + adds r0, 0x52 + ldrb r1, [r1, 0x8] + strb r1, [r0] + ldr r0, [r3] + adds r0, 0xB1 + ldr r1, [r4] + ldrb r1, [r1, 0x9] + strb r1, [r0] + ldr r1, _0814E19C + ldr r2, [r4] + ldrb r0, [r2, 0xA] + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x8E + ldrb r1, [r2, 0xB] + strb r1, [r0] + movs r2, 0 + mov r12, r8 + mov r9, r5 + ldr r1, _0814E1A0 + mov r10, r1 + ldr r3, _0814E1A4 +_0814E126: + adds r0, r2, r3 + ldr r1, [r4] + adds r1, 0xC + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0814E126 + movs r2, 0 + ldr r0, _0814E1A0 + mov r8, r0 + ldr r3, _0814E180 + ldr r5, _0814E1A8 + ldr r4, _0814E1AC +_0814E144: + mov r0, r8 + adds r1, r2, r0 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r5 + ldr r0, [r3] + adds r0, 0x20 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r4 + ldr r0, [r3] + adds r0, 0x30 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0xF + ble _0814E144 + cmp r6, 0x5 + bls _0814E176 + b _0814E6B8 +_0814E176: + lsls r0, r6, 2 + ldr r1, _0814E1B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814E180: .4byte 0x0203aba8 +_0814E184: .4byte 0x02024064 +_0814E188: .4byte 0x02023068 +_0814E18C: .4byte 0x02024208 +_0814E190: .4byte 0x0202420a +_0814E194: .4byte 0x02024474 +_0814E198: .4byte 0x0202449c +_0814E19C: .4byte 0x0202420f +_0814E1A0: .4byte 0x02022f58 +_0814E1A4: .4byte 0x0203aba4 +_0814E1A8: .4byte 0x02022f68 +_0814E1AC: .4byte 0x02022f78 +_0814E1B0: .4byte _0814E1B4 + .align 2, 0 +_0814E1B4: + .4byte _0814E1CC + .4byte _0814E2AC + .4byte _0814E394 + .4byte _0814E430 + .4byte _0814E4F8 + .4byte _0814E55C +_0814E1CC: + ldr r0, _0814E204 + ldr r2, [r0] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0814E26C + ldr r0, _0814E208 + ands r0, r2 + cmp r0, 0 + beq _0814E248 + movs r0, 0x80 + lsls r0, 16 + ands r0, r2 + cmp r0, 0 + bne _0814E260 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _0814E214 + movs r0, 0x80 + lsls r0, 17 + ands r2, r0 + ldr r7, _0814E20C + cmp r2, 0 + bne _0814E200 + b _0814E6D8 +_0814E200: + ldr r7, _0814E210 + b _0814E6D8 + .align 2, 0 +_0814E204: .4byte 0x02022fec +_0814E208: .4byte 0x02000002 +_0814E20C: .4byte 0x085cbbcd +_0814E210: .4byte 0x085cd318 +_0814E214: + ldr r0, _0814E224 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _0814E22C + ldr r7, _0814E228 + b _0814E6D8 + .align 2, 0 +_0814E224: .4byte 0x02038bca +_0814E228: .4byte 0x085cbb9c +_0814E22C: + movs r0, 0x80 + lsls r0, 17 + ands r2, r0 + ldr r7, _0814E240 + cmp r2, 0 + bne _0814E23A + b _0814E6D8 +_0814E23A: + ldr r7, _0814E244 + b _0814E6D8 + .align 2, 0 +_0814E240: .4byte 0x085cbbb9 +_0814E244: .4byte 0x085cd301 +_0814E248: + movs r0, 0x80 + lsls r0, 15 + ands r0, r2 + cmp r0, 0 + bne _0814E260 + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + ldr r7, _0814E264 + cmp r2, 0 + bne _0814E260 + b _0814E6D8 +_0814E260: + ldr r7, _0814E268 + b _0814E6D8 + .align 2, 0 +_0814E264: .4byte 0x085cbb9c +_0814E268: .4byte 0x085cce17 +_0814E26C: + movs r0, 0x80 + lsls r0, 6 + ands r0, r2 + cmp r0, 0 + beq _0814E280 + ldr r7, _0814E27C + b _0814E6D8 + .align 2, 0 +_0814E27C: .4byte 0x085cbb5a +_0814E280: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0814E290 + ldr r7, _0814E28C + b _0814E6D8 + .align 2, 0 +_0814E28C: .4byte 0x085cbb82 +_0814E290: + movs r0, 0x80 + lsls r0, 2 + ands r2, r0 + ldr r7, _0814E2A4 + cmp r2, 0 + bne _0814E29E + b _0814E6D8 +_0814E29E: + ldr r7, _0814E2A8 + b _0814E6D8 + .align 2, 0 +_0814E2A4: .4byte 0x085cbb47 +_0814E2A8: .4byte 0x085cbb6d +_0814E2AC: + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814E310 + ldr r0, _0814E2D4 + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E308 + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0814E2DC + ldr r7, _0814E2D8 + b _0814E6D8 + .align 2, 0 +_0814E2D4: .4byte 0x02022fec +_0814E2D8: .4byte 0x085cce38 +_0814E2DC: + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0814E2F0 + ldr r7, _0814E2EC + b _0814E6D8 + .align 2, 0 +_0814E2EC: .4byte 0x085cbc96 +_0814E2F0: + movs r0, 0x40 + ands r1, r0 + ldr r7, _0814E300 + cmp r1, 0 + bne _0814E2FC + b _0814E6D8 +_0814E2FC: + ldr r7, _0814E304 + b _0814E6D8 + .align 2, 0 +_0814E300: .4byte 0x085cbc96 +_0814E304: .4byte 0x085cbce5 +_0814E308: + ldr r7, _0814E30C + b _0814E6D8 + .align 2, 0 +_0814E30C: .4byte 0x085cbc8e +_0814E310: + ldr r0, _0814E334 + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E368 + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _0814E330 + movs r0, 0x80 + lsls r0, 16 + ands r0, r1 + cmp r0, 0 + beq _0814E33C +_0814E330: + ldr r7, _0814E338 + b _0814E6D8 + .align 2, 0 +_0814E334: .4byte 0x02022fec +_0814E338: .4byte 0x085ccdde +_0814E33C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814E34C + ldr r7, _0814E348 + b _0814E6D8 + .align 2, 0 +_0814E348: .4byte 0x085cbc4e +_0814E34C: + ldr r0, _0814E35C + ands r1, r0 + ldr r7, _0814E360 + cmp r1, 0 + bne _0814E358 + b _0814E6D8 +_0814E358: + ldr r7, _0814E364 + b _0814E6D8 + .align 2, 0 +_0814E35C: .4byte 0x02000002 +_0814E360: .4byte 0x085cbbfa +_0814E364: .4byte 0x085cbc37 +_0814E368: + ldr r0, _0814E384 + ands r1, r0 + cmp r1, 0 + beq _0814E380 + ldr r0, _0814E388 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + ldr r7, _0814E38C + cmp r1, r0 + beq _0814E380 + b _0814E6D8 +_0814E380: + ldr r7, _0814E390 + b _0814E6D8 + .align 2, 0 +_0814E384: .4byte 0x02000002 +_0814E388: .4byte 0x02038bca +_0814E38C: .4byte 0x085cbc27 +_0814E390: .4byte 0x085cbbe7 +_0814E394: + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814E3EC + ldr r0, _0814E3B4 + ldr r0, [r0] + adds r0, 0xB1 + ldrb r2, [r0] + cmp r2, 0 + bne _0814E3BC + ldr r7, _0814E3B8 + b _0814E6D8 + .align 2, 0 +_0814E3B4: .4byte 0x0202449c +_0814E3B8: .4byte 0x085cbcfd +_0814E3BC: + cmp r2, 0x1 + beq _0814E3CC + ldr r0, _0814E3D0 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E3D8 +_0814E3CC: + ldr r7, _0814E3D4 + b _0814E6D8 + .align 2, 0 +_0814E3D0: .4byte 0x02022fec +_0814E3D4: .4byte 0x085cbd1b +_0814E3D8: + ldr r7, _0814E3E4 + cmp r2, 0x2 + beq _0814E3E0 + b _0814E6D8 +_0814E3E0: + ldr r7, _0814E3E8 + b _0814E6D8 + .align 2, 0 +_0814E3E4: .4byte 0x085cbd3d +_0814E3E8: .4byte 0x085cbd2a +_0814E3EC: + ldr r0, _0814E418 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 4 + ldr r2, _0814E41C + cmp r1, r0 + beq _0814E406 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0814E428 +_0814E406: + ldr r0, [r2] + movs r1, 0x40 + ands r0, r1 + ldr r7, _0814E420 + cmp r0, 0 + bne _0814E414 + b _0814E6D8 +_0814E414: + ldr r7, _0814E424 + b _0814E6D8 + .align 2, 0 +_0814E418: .4byte 0x02038bca +_0814E41C: .4byte 0x02022fec +_0814E420: .4byte 0x085cbd65 +_0814E424: .4byte 0x085cbd75 +_0814E428: + ldr r7, _0814E42C + b _0814E6D8 + .align 2, 0 +_0814E42C: .4byte 0x085cbd52 +_0814E430: + mov r4, r9 + ldrb r0, [r4, 0x17] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814E488 + ldr r0, _0814E45C + ldr r0, [r0] + adds r0, 0xB1 + ldrb r2, [r0] + cmp r2, 0 + beq _0814E456 + ldr r0, _0814E460 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E468 +_0814E456: + ldr r7, _0814E464 + b _0814E6D8 + .align 2, 0 +_0814E45C: .4byte 0x0202449c +_0814E460: .4byte 0x02022fec +_0814E464: .4byte 0x085cbca5 +_0814E468: + cmp r2, 0x1 + bne _0814E474 + ldr r7, _0814E470 + b _0814E6D8 + .align 2, 0 +_0814E470: .4byte 0x085cbcad +_0814E474: + ldr r7, _0814E480 + cmp r2, 0x2 + beq _0814E47C + b _0814E6D8 +_0814E47C: + ldr r7, _0814E484 + b _0814E6D8 + .align 2, 0 +_0814E480: .4byte 0x085cbcc7 +_0814E484: .4byte 0x085cbcb8 +_0814E488: + ldr r0, _0814E4A4 + ldr r1, [r0] + ldr r0, _0814E4A8 + ands r0, r1 + cmp r0, 0 + beq _0814E4DC + movs r0, 0x80 + lsls r0, 16 + ands r0, r1 + cmp r0, 0 + beq _0814E4AC + ldrb r0, [r4, 0x17] + b _0814E4EA + .align 2, 0 +_0814E4A4: .4byte 0x02022fec +_0814E4A8: .4byte 0x02000002 +_0814E4AC: + movs r0, 0x40 + ands r1, r0 + cmp r1, 0 + beq _0814E4BC + ldr r7, _0814E4B8 + b _0814E6D8 + .align 2, 0 +_0814E4B8: .4byte 0x085cbc7e +_0814E4BC: + ldr r0, _0814E4D0 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + ldr r7, _0814E4D4 + cmp r1, r0 + beq _0814E4CC + b _0814E6D8 +_0814E4CC: + ldr r7, _0814E4D8 + b _0814E6D8 + .align 2, 0 +_0814E4D0: .4byte 0x02038bca +_0814E4D4: .4byte 0x085cbc6e +_0814E4D8: .4byte 0x085cbc14 +_0814E4DC: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _0814E4CC + mov r1, r9 + ldrb r0, [r1, 0x17] +_0814E4EA: + ldr r7, _0814E4F4 + cmp r0, 0x1 + beq _0814E4F2 + b _0814E6D8 +_0814E4F2: + b _0814E4CC + .align 2, 0 +_0814E4F4: .4byte 0x085cce04 +_0814E4F8: + mov r0, r10 + bl sub_814F8F8 + ldr r0, _0814E524 + ldr r2, [r0] + ldrh r1, [r2] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bls _0814E534 + ldr r0, _0814E528 + ldr r1, _0814E52C + ldr r1, [r1] + adds r1, 0x8E + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + ldr r2, _0814E530 + adds r1, r2 + bl gf_strcpy + b _0814E544 + .align 2, 0 +_0814E524: .4byte 0x0203aba8 +_0814E528: .4byte 0x02022f68 +_0814E52C: .4byte 0x0202449c +_0814E530: .4byte 0x085ccbbc +_0814E534: + ldr r0, _0814E550 + ldrh r2, [r2] + movs r1, 0xD + muls r1, r2 + ldr r2, _0814E554 + adds r1, r2 + bl gf_strcpy +_0814E544: + ldr r0, _0814E550 + bl sub_814F950 + ldr r7, _0814E558 + b _0814E6D8 + .align 2, 0 +_0814E550: .4byte 0x02022f68 +_0814E554: .4byte 0x0831977c +_0814E558: .4byte 0x085cbdac +_0814E55C: + ldr r4, _0814E59C + ldrb r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0814E5C4 + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0814E58A + ldrb r1, [r4] + cmp r1, 0x3 + beq _0814E58A + movs r0, 0x3 + eors r0, r1 + strb r0, [r4] +_0814E58A: + ldr r0, _0814E59C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0814E5A4 + ldr r7, _0814E5A0 + b _0814E6D8 + .align 2, 0 +_0814E59C: .4byte 0x02022f58 +_0814E5A0: .4byte 0x085cb4ca +_0814E5A4: + ldr r0, _0814E5B8 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + ldr r7, _0814E5BC + cmp r0, 0 + bne _0814E5B4 + b _0814E6D8 +_0814E5B4: + ldr r7, _0814E5C0 + b _0814E6D8 + .align 2, 0 +_0814E5B8: .4byte 0x02022fec +_0814E5BC: .4byte 0x085cb5d2 +_0814E5C0: .4byte 0x085cb5df +_0814E5C4: + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0814E5E0 + ldrb r1, [r4] + cmp r1, 0x3 + beq _0814E5E0 + movs r0, 0x3 + eors r0, r1 + strb r0, [r4] +_0814E5E0: + ldr r0, _0814E600 + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814E638 + ldr r0, _0814E604 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0814E628 + cmp r0, 0x2 + bgt _0814E608 + cmp r0, 0x1 + beq _0814E60E + b _0814E6D8 + .align 2, 0 +_0814E600: .4byte 0x02022fec +_0814E604: .4byte 0x02022f58 +_0814E608: + cmp r0, 0x3 + beq _0814E630 + b _0814E6D8 +_0814E60E: + movs r0, 0x80 + lsls r0, 16 + ands r1, r0 + ldr r7, _0814E620 + cmp r1, 0 + beq _0814E6D8 + ldr r7, _0814E624 + b _0814E6D8 + .align 2, 0 +_0814E620: .4byte 0x085cb538 +_0814E624: .4byte 0x085cce53 +_0814E628: + ldr r7, _0814E62C + b _0814E6D8 + .align 2, 0 +_0814E62C: .4byte 0x085cb567 +_0814E630: + ldr r7, _0814E634 + b _0814E6D8 + .align 2, 0 +_0814E634: .4byte 0x085cb5a6 +_0814E638: + ldr r0, _0814E658 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _0814E680 + ldr r0, _0814E65C + ldrb r0, [r0] + cmp r0, 0x2 + beq _0814E670 + cmp r0, 0x2 + bgt _0814E660 + cmp r0, 0x1 + beq _0814E666 + b _0814E6D8 + .align 2, 0 +_0814E658: .4byte 0x02038bca +_0814E65C: .4byte 0x02022f58 +_0814E660: + cmp r0, 0x3 + beq _0814E678 + b _0814E6D8 +_0814E666: + ldr r7, _0814E66C + b _0814E6D8 + .align 2, 0 +_0814E66C: .4byte 0x085cba2e +_0814E670: + ldr r7, _0814E674 + b _0814E6D8 + .align 2, 0 +_0814E674: .4byte 0x085cd24c +_0814E678: + ldr r7, _0814E67C + b _0814E6D8 + .align 2, 0 +_0814E67C: .4byte 0x085cd267 +_0814E680: + ldr r0, _0814E694 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0814E6A8 + cmp r0, 0x2 + bgt _0814E698 + cmp r0, 0x1 + beq _0814E69E + b _0814E6D8 + .align 2, 0 +_0814E694: .4byte 0x02022f58 +_0814E698: + cmp r0, 0x3 + beq _0814E6B0 + b _0814E6D8 +_0814E69E: + ldr r7, _0814E6A4 + b _0814E6D8 + .align 2, 0 +_0814E6A4: .4byte 0x085cb524 +_0814E6A8: + ldr r7, _0814E6AC + b _0814E6D8 + .align 2, 0 +_0814E6AC: .4byte 0x085cb54f +_0814E6B0: + ldr r7, _0814E6B4 + b _0814E6D8 + .align 2, 0 +_0814E6B4: .4byte 0x085cb581 +_0814E6B8: + movs r0, 0xBE + lsls r0, 1 + cmp r6, r0 + bls _0814E6CC + ldr r1, _0814E6C8 + movs r0, 0xFF + strb r0, [r1] + b _0814E6DE + .align 2, 0 +_0814E6C8: .4byte 0x02022e2c +_0814E6CC: + ldr r1, _0814E6EC + adds r0, r6, 0 + subs r0, 0xC + lsls r0, 2 + adds r0, r1 + ldr r7, [r0] +_0814E6D8: + adds r0, r7, 0 + bl sub_814E6F0 +_0814E6DE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0814E6EC: .4byte 0x085cc270 + thumb_func_end battle_pick_message + + thumb_func_start sub_814E6F0 +sub_814E6F0: @ 814E6F0 + push {lr} + ldr r1, _0814E6FC + bl sub_814E764 + pop {r1} + bx r1 + .align 2, 0 +_0814E6FC: .4byte 0x02022e2c + thumb_func_end sub_814E6F0 + + thumb_func_start sub_814E700 +sub_814E700: @ 814E700 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, _0814E718 + mov r0, sp + movs r2, 0x8 + bl memcpy + mov r2, sp + movs r3, 0 + b _0814E728 + .align 2, 0 +_0814E718: .4byte 0x085cd422 +_0814E71C: + strb r1, [r2] + adds r4, 0x1 + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x7 + bhi _0814E730 +_0814E728: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814E71C +_0814E730: + ldr r5, [sp] + ldr r4, [sp, 0x4] + movs r3, 0 + ldr r2, _0814E74C +_0814E738: + ldr r1, [r2] + ldr r0, [r1] + cmp r5, r0 + bne _0814E750 + ldr r0, [r1, 0x4] + cmp r4, r0 + bne _0814E750 + ldr r0, [r2, 0x4] + b _0814E75A + .align 2, 0 +_0814E74C: .4byte 0x0831bca8 +_0814E750: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x6 + bls _0814E738 + movs r0, 0 +_0814E75A: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_814E700 + + thumb_func_start sub_814E764 +sub_814E764: @ 814E764 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x20 + mov r9, r0 + mov r8, r1 + movs r6, 0 + movs r4, 0 + ldr r0, _0814E78C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0814E794 + ldr r0, _0814E790 + ldrb r7, [r0] + b _0814E79C + .align 2, 0 +_0814E78C: .4byte 0x02022fec +_0814E790: .4byte 0x0203c7b4 +_0814E794: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 +_0814E79C: + mov r0, r9 + ldrb r1, [r0] + bl _0814F620 +_0814E7A4: + cmp r1, 0xFD + beq _0814E7AC + bl _0814F610 +_0814E7AC: + movs r1, 0x1 + add r9, r1 + mov r2, r9 + ldrb r0, [r2] + cmp r0, 0x34 + bls _0814E7BC + bl _0814F5C0 +_0814E7BC: + lsls r0, 2 + ldr r1, _0814E7C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814E7C8: .4byte _0814E7CC + .align 2, 0 +_0814E7CC: + .4byte _0814E8A0 + .4byte _0814E8CE + .4byte _0814E90A + .4byte _0814E914 + .4byte _0814E920 + .4byte _0814E92C + .4byte _0814E960 + .4byte _0814E994 + .4byte _0814E9C8 + .4byte _0814E9FC + .4byte _0814EA38 + .4byte _0814EA78 + .4byte _0814EAB8 + .4byte _0814EAF8 + .4byte _0814EBB0 + .4byte _0814EC38 + .4byte _0814ECD4 + .4byte _0814ED70 + .4byte _0814EE0C + .4byte _0814EEA8 + .4byte _0814EF44 + .4byte _0814EF5C + .4byte _0814EF98 + .4byte _0814F080 + .4byte _0814F088 + .4byte _0814F098 + .4byte _0814F0A8 + .4byte _0814F0B8 + .4byte _0814F0D8 + .4byte _0814F164 + .4byte _0814F220 + .4byte _0814F230 + .4byte _0814F244 + .4byte _0814F258 + .4byte _0814F27C + .4byte _0814F298 + .4byte _0814F2C0 + .4byte _0814F300 + .4byte _0814F330 + .4byte _0814F3C4 + .4byte _0814F410 + .4byte _0814F418 + .4byte _0814F3E4 + .4byte _0814F3EC + .4byte _0814F43C + .4byte _0814F444 + .4byte _0814F468 + .4byte _0814F4B8 + .4byte _0814F508 + .4byte _0814F548 + .4byte _0814F594 + .4byte _0814F5B4 + .4byte _0814E8E4 +_0814E8A0: + ldr r5, _0814E8B0 + ldrb r0, [r5] + cmp r0, 0xFD + bne _0814E8B8 + ldr r4, _0814E8B4 + adds r0, r5, 0 + b _0814E8F0 + .align 2, 0 +_0814E8B0: .4byte 0x02022f58 +_0814E8B4: .4byte 0x02021cc4 +_0814E8B8: + adds r0, r5, 0 + bl sub_814E700 + adds r4, r0, 0 + cmp r4, 0 + beq _0814E8C8 + bl _0814F5C0 +_0814E8C8: + adds r4, r5, 0 + bl _0814F5C0 +_0814E8CE: + ldr r1, _0814E8DC + ldrb r0, [r1] + cmp r0, 0xFD + bne _0814E904 + ldr r4, _0814E8E0 + b _0814E8EE + .align 2, 0 +_0814E8DC: .4byte 0x02022f68 +_0814E8E0: .4byte 0x02021dc4 +_0814E8E4: + ldr r1, _0814E8FC + ldrb r0, [r1] + cmp r0, 0xFD + bne _0814E904 + ldr r4, _0814E900 +_0814E8EE: + adds r0, r1, 0 +_0814E8F0: + adds r1, r4, 0 + bl sub_814F648 + bl _0814F5C0 + .align 2, 0 +_0814E8FC: .4byte 0x02022f78 +_0814E900: .4byte 0x02021ec4 +_0814E904: + adds r4, r1, 0 + bl _0814F5C0 +_0814E90A: + ldr r4, _0814E910 + bl _0814F5C0 + .align 2, 0 +_0814E910: .4byte 0x02021cc4 +_0814E914: + ldr r4, _0814E91C + bl _0814F5C0 + .align 2, 0 +_0814E91C: .4byte 0x02021dc4 +_0814E920: + ldr r4, _0814E928 + bl _0814F5C0 + .align 2, 0 +_0814E928: .4byte 0x02021ec4 +_0814E92C: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _0814E958 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814E95C + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814E958: .4byte 0x0202406e +_0814E95C: .4byte 0x020244ec +_0814E960: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, _0814E98C + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814E990 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814E98C: .4byte 0x0202406e +_0814E990: .4byte 0x02024744 +_0814E994: + movs r0, 0x2 + bl battle_get_side_with_given_state + ldr r1, _0814E9C0 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814E9C4 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814E9C0: .4byte 0x0202406e +_0814E9C4: .4byte 0x020244ec +_0814E9C8: + movs r0, 0x3 + bl battle_get_side_with_given_state + ldr r1, _0814E9F4 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814E9F8 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814E9F4: .4byte 0x0202406e +_0814E9F8: .4byte 0x02024744 +_0814E9FC: + ldr r2, _0814EA2C + ldr r1, _0814EA30 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x18] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EA34 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EA2C: .4byte 0x0202406e +_0814EA30: .4byte 0x020229e8 +_0814EA34: .4byte 0x020244ec +_0814EA38: + ldr r2, _0814EA6C + ldr r1, _0814EA70 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x18] + movs r0, 0x1 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EA74 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EA6C: .4byte 0x0202406e +_0814EA70: .4byte 0x020229e8 +_0814EA74: .4byte 0x02024744 +_0814EA78: + ldr r2, _0814EAAC + ldr r1, _0814EAB0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x18] + movs r0, 0x2 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EAB4 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EAAC: .4byte 0x0202406e +_0814EAB0: .4byte 0x020229e8 +_0814EAB4: .4byte 0x020244ec +_0814EAB8: + ldr r2, _0814EAEC + ldr r1, _0814EAF0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x18] + movs r0, 0x3 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EAF4 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EAEC: .4byte 0x0202406e +_0814EAF0: .4byte 0x020229e8 +_0814EAF4: .4byte 0x02024744 +_0814EAF8: + ldr r4, _0814EB1C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + adds r2, r4, 0 + cmp r0, 0 + beq _0814EB74 + ldr r0, _0814EB20 + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814EB24 + cmp r1, 0 + beq _0814EB36 + ldr r4, _0814EB28 + b _0814EB36 + .align 2, 0 +_0814EB1C: .4byte 0x0202420b +_0814EB20: .4byte 0x02022fec +_0814EB24: .4byte 0x085cbd85 +_0814EB28: .4byte 0x085cbd8b +_0814EB2C: + mov r3, r8 + adds r0, r3, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 +_0814EB36: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EB2C + ldrb r0, [r2] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, _0814EB6C + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EB70 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EB9E + .align 2, 0 +_0814EB6C: .4byte 0x0202406e +_0814EB70: .4byte 0x02024744 +_0814EB74: + ldrb r0, [r2] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, _0814EBA8 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EBAC + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EB9E: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EBA8: .4byte 0x0202406e +_0814EBAC: .4byte 0x020244ec +_0814EBB0: + ldr r4, _0814EBEC + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814EBF8 + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, _0814EBF0 + lsls r0, 24 + lsrs r0, 23 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EBF4 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EC24 + .align 2, 0 +_0814EBEC: .4byte 0x0202420b +_0814EBF0: .4byte 0x0202406e +_0814EBF4: .4byte 0x020244ec +_0814EBF8: + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, _0814EC30 + lsls r0, 24 + lsrs r0, 23 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EC34 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EC24: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EC30: .4byte 0x0202406e +_0814EC34: .4byte 0x02024744 +_0814EC38: + ldr r5, _0814EC90 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814ECA8 + ldr r0, _0814EC94 + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814EC98 + cmp r1, 0 + beq _0814EC56 + ldr r4, _0814EC9C +_0814EC56: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, _0814ECA0 + ldr r2, _0814ECA4 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EC78 +_0814EC66: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EC66 +_0814EC78: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814ECC2 + .align 2, 0 +_0814EC90: .4byte 0x0202420b +_0814EC94: .4byte 0x02022fec +_0814EC98: .4byte 0x085cbd85 +_0814EC9C: .4byte 0x085cbd8b +_0814ECA0: .4byte 0x0202406e +_0814ECA4: .4byte 0x02024744 +_0814ECA8: + ldr r1, _0814ECCC + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814ECD0 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814ECC2: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814ECCC: .4byte 0x0202406e +_0814ECD0: .4byte 0x020244ec +_0814ECD4: + ldr r5, _0814ED2C + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814ED44 + ldr r0, _0814ED30 + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814ED34 + cmp r1, 0 + beq _0814ECF2 + ldr r4, _0814ED38 +_0814ECF2: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, _0814ED3C + ldr r2, _0814ED40 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814ED14 +_0814ED02: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814ED02 +_0814ED14: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814ED5E + .align 2, 0 +_0814ED2C: .4byte 0x0202420c +_0814ED30: .4byte 0x02022fec +_0814ED34: .4byte 0x085cbd85 +_0814ED38: .4byte 0x085cbd8b +_0814ED3C: .4byte 0x0202406e +_0814ED40: .4byte 0x02024744 +_0814ED44: + ldr r1, _0814ED68 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814ED6C + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814ED5E: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814ED68: .4byte 0x0202406e +_0814ED6C: .4byte 0x020244ec +_0814ED70: + ldr r5, _0814EDC8 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814EDE0 + ldr r0, _0814EDCC + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814EDD0 + cmp r1, 0 + beq _0814ED8E + ldr r4, _0814EDD4 +_0814ED8E: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, _0814EDD8 + ldr r2, _0814EDDC + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EDB0 +_0814ED9E: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814ED9E +_0814EDB0: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EDFA + .align 2, 0 +_0814EDC8: .4byte 0x0202420e +_0814EDCC: .4byte 0x02022fec +_0814EDD0: .4byte 0x085cbd85 +_0814EDD4: .4byte 0x085cbd8b +_0814EDD8: .4byte 0x0202406e +_0814EDDC: .4byte 0x02024744 +_0814EDE0: + ldr r1, _0814EE04 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EE08 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EDFA: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + bl _0814F5BE + .align 2, 0 +_0814EE04: .4byte 0x0202406e +_0814EE08: .4byte 0x020244ec +_0814EE0C: + ldr r5, _0814EE64 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814EE7C + ldr r0, _0814EE68 + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814EE6C + cmp r1, 0 + beq _0814EE2A + ldr r4, _0814EE70 +_0814EE2A: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, _0814EE74 + ldr r2, _0814EE78 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EE4C +_0814EE3A: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EE3A +_0814EE4C: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EE96 + .align 2, 0 +_0814EE64: .4byte 0x02024064 +_0814EE68: .4byte 0x02022fec +_0814EE6C: .4byte 0x085cbd85 +_0814EE70: .4byte 0x085cbd8b +_0814EE74: .4byte 0x0202406e +_0814EE78: .4byte 0x02024744 +_0814EE7C: + ldr r1, _0814EEA0 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EEA4 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EE96: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + b _0814F5BE + .align 2, 0 +_0814EEA0: .4byte 0x0202406e +_0814EEA4: .4byte 0x020244ec +_0814EEA8: + ldr r5, _0814EF00 + ldrb r0, [r5, 0x17] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814EF18 + ldr r0, _0814EF04 + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814EF08 + cmp r1, 0 + beq _0814EEC6 + ldr r4, _0814EF0C +_0814EEC6: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, _0814EF10 + ldr r2, _0814EF14 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EEE8 +_0814EED6: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EED6 +_0814EEE8: + ldrb r0, [r2, 0x17] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EF32 + .align 2, 0 +_0814EF00: .4byte 0x02024474 +_0814EF04: .4byte 0x02022fec +_0814EF08: .4byte 0x085cbd85 +_0814EF0C: .4byte 0x085cbd8b +_0814EF10: .4byte 0x0202406e +_0814EF14: .4byte 0x02024744 +_0814EF18: + ldr r1, _0814EF3C + ldrb r0, [r5, 0x17] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814EF40 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EF32: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + b _0814F5BE + .align 2, 0 +_0814EF3C: .4byte 0x0202406e +_0814EF40: .4byte 0x020244ec +_0814EF44: + ldr r0, _0814EF58 + ldr r2, [r0] + ldrh r1, [r2] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bhi _0814EF6A + ldrh r1, [r2] + b _0814EF8A + .align 2, 0 +_0814EF58: .4byte 0x0203aba8 +_0814EF5C: + ldr r0, _0814EF7C + ldr r2, [r0] + ldrh r1, [r2, 0x2] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bls _0814EF88 +_0814EF6A: + ldr r0, _0814EF80 + ldr r0, [r0] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + ldr r1, _0814EF84 + adds r4, r0, r1 + b _0814F5C0 + .align 2, 0 +_0814EF7C: .4byte 0x0203aba8 +_0814EF80: .4byte 0x0202449c +_0814EF84: .4byte 0x085ccbbc +_0814EF88: + ldrh r1, [r2, 0x2] +_0814EF8A: + movs r0, 0xD + muls r1, r0 + ldr r0, _0814EF94 + adds r4, r1, r0 + b _0814F5C0 + .align 2, 0 +_0814EF94: .4byte 0x0831977c +_0814EF98: + ldr r0, _0814EFCC + ldr r1, [r0] + ldr r0, _0814EFD0 + ands r0, r1 + cmp r0, 0 + beq _0814F06E + ldr r2, _0814EFD4 + ldrh r0, [r2] + cmp r0, 0xAF + bne _0814F064 + movs r0, 0x40 + ands r1, r0 + cmp r1, 0 + bne _0814F014 + ldr r0, _0814EFD8 + adds r0, 0x25 + ldrb r0, [r0] + cmp r0, 0 + beq _0814EFE0 + ldr r2, _0814EFDC + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0814EFEC + b _0814F05C + .align 2, 0 +_0814EFCC: .4byte 0x02022fec +_0814EFD0: .4byte 0x02000002 +_0814EFD4: .4byte 0x02024208 +_0814EFD8: .4byte 0x02024474 +_0814EFDC: .4byte 0x0202420f +_0814EFE0: + ldr r2, _0814F008 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0814F05C +_0814EFEC: + ldrb r0, [r2] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, _0814F00C + adds r1, r0 + mov r0, sp + bl gf_strcpy + ldr r1, _0814F010 + mov r0, sp + bl gf_strcat + b _0814F5BE + .align 2, 0 +_0814F008: .4byte 0x0202420f +_0814F00C: .4byte 0x02024404 +_0814F010: .4byte 0x085cc0ad +_0814F014: + ldr r2, _0814F048 + ldr r0, _0814F04C + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _0814F050 + ldrb r2, [r1] + ldrh r0, [r0, 0x18] + cmp r0, r2 + bne _0814F05C + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, _0814F054 + adds r1, r0 + mov r0, sp + bl gf_strcpy + ldr r1, _0814F058 + mov r0, sp + bl gf_strcat + b _0814F5BE + .align 2, 0 +_0814F048: .4byte 0x020229e8 +_0814F04C: .4byte 0x02024474 +_0814F050: .4byte 0x0202420f +_0814F054: .4byte 0x02024404 +_0814F058: .4byte 0x085cc0ad +_0814F05C: + ldr r4, _0814F060 + b _0814F5C0 + .align 2, 0 +_0814F060: .4byte 0x085cc0a0 +_0814F064: + ldrh r0, [r2] + mov r1, sp + bl itemid_get_name + b _0814F5BE +_0814F06E: + ldr r0, _0814F07C + ldrh r0, [r0] + mov r1, sp + bl itemid_get_name + b _0814F5BE + .align 2, 0 +_0814F07C: .4byte 0x02024208 +_0814F080: + ldr r0, _0814F084 + b _0814F0C0 + .align 2, 0 +_0814F084: .4byte 0x0202420a +_0814F088: + ldr r1, _0814F090 + ldr r0, _0814F094 + b _0814F0BC + .align 2, 0 +_0814F090: .4byte 0x0203aba4 +_0814F094: .4byte 0x0202420b +_0814F098: + ldr r1, _0814F0A0 + ldr r0, _0814F0A4 + b _0814F0BC + .align 2, 0 +_0814F0A0: .4byte 0x0203aba4 +_0814F0A4: .4byte 0x0202420c +_0814F0A8: + ldr r1, _0814F0B0 + ldr r0, _0814F0B4 + ldrb r0, [r0, 0x17] + b _0814F0BE + .align 2, 0 +_0814F0B0: .4byte 0x0203aba4 +_0814F0B4: .4byte 0x02024474 +_0814F0B8: + ldr r1, _0814F0CC + ldr r0, _0814F0D0 +_0814F0BC: + ldrb r0, [r0] +_0814F0BE: + adds r0, r1 +_0814F0C0: + ldrb r1, [r0] + movs r0, 0xD + muls r1, r0 + ldr r0, _0814F0D4 + adds r4, r1, r0 + b _0814F5C0 + .align 2, 0 +_0814F0CC: .4byte 0x0203aba4 +_0814F0D0: .4byte 0x0202420e +_0814F0D4: .4byte 0x0831b6db +_0814F0D8: + ldr r0, _0814F0EC + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r1 + cmp r0, 0 + beq _0814F0F0 + bl sub_806B870 + b _0814F59C + .align 2, 0 +_0814F0EC: .4byte 0x02022fec +_0814F0F0: + ldr r3, _0814F108 + ldrh r2, [r3] + movs r0, 0xC0 + lsls r0, 4 + cmp r2, r0 + bne _0814F10C + bl sub_8068BB0 + lsls r0, 16 + lsrs r0, 16 + b _0814F5A0 + .align 2, 0 +_0814F108: .4byte 0x02038bca +_0814F10C: + ldr r0, _0814F118 + cmp r2, r0 + bne _0814F11C + bl sub_81A4D00 + b _0814F59C + .align 2, 0 +_0814F118: .4byte 0x000003fe +_0814F11C: + ldr r0, _0814F128 + ands r0, r1 + cmp r0, 0 + beq _0814F12C + ldrh r0, [r3] + b _0814F598 + .align 2, 0 +_0814F128: .4byte 0x003f0100 +_0814F12C: + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0814F13E + ldrh r0, [r3] + bl sub_81D5530 + b _0814F59C +_0814F13E: + movs r0, 0x80 + lsls r0, 4 + ands r1, r0 + cmp r1, 0 + beq _0814F14E + bl sub_8165264 + b _0814F59C +_0814F14E: + ldr r2, _0814F160 + ldrh r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r0, 0xD + b _0814F5A2 + .align 2, 0 +_0814F160: .4byte 0x08310030 +_0814F164: + ldr r0, _0814F1A4 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r1 + cmp r0, 0 + beq _0814F1AC + movs r2, 0 + ldr r4, _0814F1A8 + ldr r3, [r4] +_0814F178: + mov r1, sp + adds r0, r1, r2 + ldr r1, [r3] + adds r1, 0x2 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _0814F178 + mov r3, sp + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0, 0xD] + mov r0, sp + bl sub_8009308 + b _0814F5BE + .align 2, 0 +_0814F1A4: .4byte 0x02022fec +_0814F1A8: .4byte 0x020244a8 +_0814F1AC: + ldr r3, _0814F1C0 + ldrh r2, [r3] + movs r0, 0xC0 + lsls r0, 4 + cmp r2, r0 + bne _0814F1C4 + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + b _0814F284 + .align 2, 0 +_0814F1C0: .4byte 0x02038bca +_0814F1C4: + ldr r0, _0814F1D4 + cmp r2, r0 + bne _0814F1D8 + mov r0, sp + bl sub_81A4D50 + b _0814F5BE + .align 2, 0 +_0814F1D4: .4byte 0x000003fe +_0814F1D8: + ldr r0, _0814F1E4 + ands r0, r1 + cmp r0, 0 + beq _0814F1E8 + ldrh r1, [r3] + b _0814F5B8 + .align 2, 0 +_0814F1E4: .4byte 0x003f0100 +_0814F1E8: + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0814F1FC + ldrh r1, [r3] + mov r0, sp + bl sub_81D5554 + b _0814F5BE +_0814F1FC: + movs r0, 0x80 + lsls r0, 4 + ands r1, r0 + cmp r1, 0 + beq _0814F20E + mov r0, sp + bl sub_8165284 + b _0814F5BE +_0814F20E: + ldrh r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0814F21C + adds r4, r1, r0 + b _0814F5C0 + .align 2, 0 +_0814F21C: .4byte 0x08310034 +_0814F220: + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + ldr r1, _0814F22C + adds r4, r0, r1 + b _0814F5C0 + .align 2, 0 +_0814F22C: .4byte 0x020229f0 +_0814F230: + ldr r4, _0814F240 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x18] + movs r0, 0x2 + b _0814F266 + .align 2, 0 +_0814F240: .4byte 0x020229e8 +_0814F244: + ldr r4, _0814F254 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x18] + movs r0, 0x1 + b _0814F266 + .align 2, 0 +_0814F254: .4byte 0x020229e8 +_0814F258: + ldr r4, _0814F278 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x18] + movs r0, 0x3 +_0814F266: + eors r0, r1 + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x8 + adds r4, r1, r4 + b _0814F5C0 + .align 2, 0 +_0814F278: .4byte 0x020229e8 +_0814F27C: + ldr r0, _0814F290 + ldrb r0, [r0, 0x17] + bl sub_806D864 +_0814F284: + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, _0814F294 + adds r4, r1, r0 + b _0814F5C0 + .align 2, 0 +_0814F290: .4byte 0x02024474 +_0814F294: .4byte 0x020229f0 +_0814F298: + ldr r0, _0814F2AC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _0814F2B4 + ldr r4, _0814F2B0 + b _0814F5C0 + .align 2, 0 +_0814F2AC: .4byte 0x02022fec +_0814F2B0: .4byte 0x020229f0 +_0814F2B4: + ldr r0, _0814F2BC + ldr r4, [r0] + b _0814F5C0 + .align 2, 0 +_0814F2BC: .4byte 0x03005d90 +_0814F2C0: + ldr r0, _0814F2D4 + ldr r1, [r0] + ldr r0, _0814F2D8 + ands r0, r1 + cmp r0, 0 + beq _0814F2E0 + ldr r0, _0814F2DC + ldrh r1, [r0] + movs r0, 0x2 + b _0814F55A + .align 2, 0 +_0814F2D4: .4byte 0x02022fec +_0814F2D8: .4byte 0x003f0100 +_0814F2DC: .4byte 0x02038bca +_0814F2E0: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F2F8 + ldr r0, _0814F2F4 + ldrh r1, [r0] + movs r0, 0x4 + b _0814F584 + .align 2, 0 +_0814F2F4: .4byte 0x02038bca +_0814F2F8: + bl sub_80B1CA4 + adds r4, r0, 0 + b _0814F5C0 +_0814F300: + ldr r0, _0814F310 + ldr r1, [r0] + ldr r0, _0814F314 + ands r0, r1 + cmp r0, 0 + beq _0814F31C + ldr r0, _0814F318 + b _0814F556 + .align 2, 0 +_0814F310: .4byte 0x02022fec +_0814F314: .4byte 0x003f0100 +_0814F318: .4byte 0x02038bca +_0814F31C: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + bne _0814F328 + b _0814F5C0 +_0814F328: + ldr r0, _0814F32C + b _0814F580 + .align 2, 0 +_0814F32C: .4byte 0x02038bca +_0814F330: + ldr r0, _0814F384 + ldrb r0, [r0, 0x17] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814F39C + ldr r0, _0814F388 + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, _0814F38C + cmp r1, 0 + beq _0814F34E + ldr r4, _0814F390 +_0814F34E: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r5, _0814F394 + mov r12, r5 + ldr r2, _0814F398 + cmp r0, 0xFF + beq _0814F36E +_0814F35C: + mov r3, r8 + adds r0, r3, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814F35C +_0814F36E: + ldr r0, [r2] + adds r0, 0x52 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814F3B4 + .align 2, 0 +_0814F384: .4byte 0x02024474 +_0814F388: .4byte 0x02022fec +_0814F38C: .4byte 0x085cbd85 +_0814F390: .4byte 0x085cbd8b +_0814F394: .4byte 0x02024744 +_0814F398: .4byte 0x0202449c +_0814F39C: + ldr r0, _0814F3BC + ldr r0, [r0] + adds r0, 0x52 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814F3C0 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814F3B4: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + b _0814F5BE + .align 2, 0 +_0814F3BC: .4byte 0x0202449c +_0814F3C0: .4byte 0x020244ec +_0814F3C4: + ldr r0, _0814F3D8 + bl flag_check + lsls r0, 24 + ldr r4, _0814F3DC + cmp r0, 0 + bne _0814F3D4 + b _0814F5C0 +_0814F3D4: + ldr r4, _0814F3E0 + b _0814F5C0 + .align 2, 0 +_0814F3D8: .4byte 0x000008ab +_0814F3DC: .4byte 0x085cc015 +_0814F3E0: .4byte 0x085cc01f +_0814F3E4: + ldr r0, _0814F3E8 + b _0814F3EE + .align 2, 0 +_0814F3E8: .4byte 0x0202420b +_0814F3EC: + ldr r0, _0814F404 +_0814F3EE: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, _0814F408 + cmp r0, 0 + beq _0814F3FE + b _0814F5C0 +_0814F3FE: + ldr r4, _0814F40C + b _0814F5C0 + .align 2, 0 +_0814F404: .4byte 0x0202420c +_0814F408: .4byte 0x085cbd9a +_0814F40C: .4byte 0x085cbd9e +_0814F410: + ldr r0, _0814F414 + b _0814F41A + .align 2, 0 +_0814F414: .4byte 0x0202420b +_0814F418: + ldr r0, _0814F430 +_0814F41A: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, _0814F434 + cmp r0, 0 + beq _0814F42A + b _0814F5C0 +_0814F42A: + ldr r4, _0814F438 + b _0814F5C0 + .align 2, 0 +_0814F430: .4byte 0x0202420c +_0814F434: .4byte 0x085cbd91 +_0814F438: .4byte 0x085cbd95 +_0814F43C: + ldr r0, _0814F440 + b _0814F446 + .align 2, 0 +_0814F440: .4byte 0x0202420b +_0814F444: + ldr r0, _0814F45C +_0814F446: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, _0814F460 + cmp r0, 0 + beq _0814F456 + b _0814F5C0 +_0814F456: + ldr r4, _0814F464 + b _0814F5C0 + .align 2, 0 +_0814F45C: .4byte 0x0202420c +_0814F460: .4byte 0x085cbda3 +_0814F464: .4byte 0x085cbda7 +_0814F468: + ldr r0, _0814F478 + ldr r1, [r0] + ldr r0, _0814F47C + ands r0, r1 + cmp r0, 0 + beq _0814F484 + ldr r0, _0814F480 + b _0814F596 + .align 2, 0 +_0814F478: .4byte 0x02022fec +_0814F47C: .4byte 0x003f0100 +_0814F480: .4byte 0x02038bcc +_0814F484: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F49C + ldr r0, _0814F498 + ldrh r0, [r0] + bl sub_81D5530 + b _0814F59C + .align 2, 0 +_0814F498: .4byte 0x02038bcc +_0814F49C: + ldr r2, _0814F4B0 + ldr r0, _0814F4B4 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r0, 0xD + b _0814F5A2 + .align 2, 0 +_0814F4B0: .4byte 0x08310030 +_0814F4B4: .4byte 0x02038bcc +_0814F4B8: + ldr r0, _0814F4C8 + ldr r1, [r0] + ldr r0, _0814F4CC + ands r0, r1 + cmp r0, 0 + beq _0814F4D4 + ldr r0, _0814F4D0 + b _0814F5B6 + .align 2, 0 +_0814F4C8: .4byte 0x02022fec +_0814F4CC: .4byte 0x003f0100 +_0814F4D0: .4byte 0x02038bcc +_0814F4D4: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F4F0 + ldr r0, _0814F4EC + ldrh r1, [r0] + mov r0, sp + bl sub_81D5554 + b _0814F5BE + .align 2, 0 +_0814F4EC: .4byte 0x02038bcc +_0814F4F0: + ldr r0, _0814F500 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, _0814F504 + adds r4, r0, r1 + b _0814F5C0 + .align 2, 0 +_0814F500: .4byte 0x02038bcc +_0814F504: .4byte 0x08310034 +_0814F508: + ldr r0, _0814F51C + ldr r1, [r0] + ldr r0, _0814F520 + ands r0, r1 + cmp r0, 0 + beq _0814F528 + ldr r0, _0814F524 + ldrh r1, [r0] + movs r0, 0x2 + b _0814F55A + .align 2, 0 +_0814F51C: .4byte 0x02022fec +_0814F520: .4byte 0x003f0100 +_0814F524: .4byte 0x02038bcc +_0814F528: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F540 + ldr r0, _0814F53C + ldrh r1, [r0] + movs r0, 0x4 + b _0814F584 + .align 2, 0 +_0814F53C: .4byte 0x02038bcc +_0814F540: + bl sub_80B1CE0 + adds r4, r0, 0 + b _0814F5C0 +_0814F548: + ldr r0, _0814F564 + ldr r1, [r0] + ldr r0, _0814F568 + ands r0, r1 + cmp r0, 0 + beq _0814F574 + ldr r0, _0814F56C +_0814F556: + ldrh r1, [r0] + movs r0, 0x1 +_0814F55A: + bl sub_81A36D0 + ldr r4, _0814F570 + b _0814F5C0 + .align 2, 0 +_0814F564: .4byte 0x02022fec +_0814F568: .4byte 0x003f0100 +_0814F56C: .4byte 0x02038bcc +_0814F570: .4byte 0x02021fc4 +_0814F574: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F5C0 + ldr r0, _0814F58C +_0814F580: + ldrh r1, [r0] + movs r0, 0x3 +_0814F584: + bl sub_81D572C + ldr r4, _0814F590 + b _0814F5C0 + .align 2, 0 +_0814F58C: .4byte 0x02038bcc +_0814F590: .4byte 0x02021fc4 +_0814F594: + ldr r0, _0814F5AC +_0814F596: + ldrh r0, [r0] +_0814F598: + bl sub_8162BD8 +_0814F59C: + lsls r0, 24 + lsrs r0, 24 +_0814F5A0: + movs r1, 0xD +_0814F5A2: + muls r1, r0 + ldr r0, _0814F5B0 + adds r4, r1, r0 + b _0814F5C0 + .align 2, 0 +_0814F5AC: .4byte 0x02038bce +_0814F5B0: .4byte 0x0830fcd4 +_0814F5B4: + ldr r0, _0814F60C +_0814F5B6: + ldrh r1, [r0] +_0814F5B8: + mov r0, sp + bl sub_8162E20 +_0814F5BE: + mov r4, sp +_0814F5C0: + ldrb r1, [r4] + adds r0, r1, 0 + mov r5, r9 + ldrb r2, [r5] + mov r3, r9 + adds r3, 0x1 + cmp r0, 0xFF + beq _0814F5E2 +_0814F5D0: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814F5D0 +_0814F5E2: + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x24 + beq _0814F5F6 + cmp r0, 0x30 + beq _0814F5F6 + cmp r0, 0x25 + beq _0814F5F6 + cmp r0, 0x31 + bne _0814F61C +_0814F5F6: + mov r0, r8 + adds r1, r0, r6 + movs r0, 0xFC + strb r0, [r1] + adds r6, 0x1 + mov r2, r8 + adds r1, r2, r6 + movs r0, 0x9 + strb r0, [r1] + adds r6, 0x1 + b _0814F61C + .align 2, 0 +_0814F60C: .4byte 0x02038bce +_0814F610: + mov r3, r8 + adds r0, r3, r6 + strb r1, [r0] + adds r6, 0x1 + mov r3, r9 + adds r3, 0x1 +_0814F61C: + mov r9, r3 + ldrb r1, [r3] +_0814F620: + adds r0, r1, 0 + cmp r0, 0xFF + beq _0814F62A + bl _0814E7A4 +_0814F62A: + mov r5, r8 + adds r1, r5, r6 + mov r2, r9 + ldrb r0, [r2] + strb r0, [r1] + adds r6, 0x1 + adds r0, r6, 0 + add sp, 0x20 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_814E764 + + thumb_func_start sub_814F648 +sub_814F648: @ 814F648 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r0, 0 + adds r6, r1, 0 + movs r5, 0x1 + movs r0, 0 + mov r8, r0 + movs r0, 0xFF + strb r0, [r6] + ldrb r0, [r7, 0x1] + cmp r0, 0xFF + bne _0814F666 + b _0814F8EA +_0814F666: + adds r0, r7, r5 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xA + bls _0814F672 + b _0814F8E0 +_0814F672: + lsls r0, r1, 2 + ldr r1, _0814F67C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814F67C: .4byte _0814F680 + .align 2, 0 +_0814F680: + .4byte _0814F6AC + .4byte _0814F6C8 + .4byte _0814F71C + .4byte _0814F734 + .4byte _0814F744 + .4byte _0814F7BC + .4byte _0814F7D0 + .4byte _0814F7E2 + .4byte _0814F828 + .4byte _0814F83C + .4byte _0814F858 +_0814F6AC: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, _0814F6C4 + subs r1, 0xC + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + b _0814F8BE + .align 2, 0 +_0814F6C4: .4byte 0x085cc270 +_0814F6C8: + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + beq _0814F6E4 + cmp r0, 0x2 + bgt _0814F6D8 + cmp r0, 0x1 + beq _0814F6DE + b _0814F706 +_0814F6D8: + cmp r0, 0x4 + beq _0814F6EC + b _0814F706 +_0814F6DE: + ldrb r4, [r4, 0x3] + mov r8, r4 + b _0814F706 +_0814F6E4: + ldrb r1, [r4, 0x3] + ldrb r0, [r4, 0x4] + lsls r0, 8 + b _0814F702 +_0814F6EC: + ldrb r0, [r4, 0x3] + mov r8, r0 + ldrb r0, [r4, 0x4] + lsls r0, 8 + mov r1, r8 + orrs r1, r0 + ldrb r0, [r4, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r4, 0x6] + lsls r0, 24 +_0814F702: + orrs r1, r0 + mov r8, r1 +_0814F706: + adds r4, r5, r7 + ldrb r3, [r4, 0x2] + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + bl decimal_int_to_string + adds r0, r5, 0x3 + ldrb r4, [r4, 0x1] + adds r5, r0, r4 + b _0814F8E0 +_0814F71C: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0xD + muls r1, r0 + ldr r0, _0814F730 + adds r1, r0 + b _0814F8BE + .align 2, 0 +_0814F730: .4byte 0x0831977c +_0814F734: + adds r0, r5, r7 + ldrb r0, [r0, 0x1] + lsls r1, r0, 3 + subs r1, r0 + ldr r0, _0814F740 + b _0814F846 + .align 2, 0 +_0814F740: .4byte 0x0831ae38 +_0814F744: + ldrb r0, [r4, 0x1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814F768 + ldrb r1, [r4, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814F764 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814F7A4 + .align 2, 0 +_0814F764: .4byte 0x020244ec +_0814F768: + ldr r0, _0814F780 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0814F788 + ldr r1, _0814F784 + adds r0, r6, 0 + bl gf_strcat + b _0814F790 + .align 2, 0 +_0814F780: .4byte 0x02022fec +_0814F784: .4byte 0x085cbd8b +_0814F788: + ldr r1, _0814F7B4 + adds r0, r6, 0 + bl gf_strcat +_0814F790: + adds r0, r5, r7 + ldrb r1, [r0, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814F7B8 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814F7A4: + mov r0, sp + bl get_end_of_string_ptr_limit_10_chars + adds r0, r6, 0 + mov r1, sp + bl gf_strcat + b _0814F8DE + .align 2, 0 +_0814F7B4: .4byte 0x085cbd85 +_0814F7B8: .4byte 0x02024744 +_0814F7BC: + ldr r1, _0814F7CC + adds r0, r5, r7 + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + b _0814F848 + .align 2, 0 +_0814F7CC: .4byte 0x085cbe00 +_0814F7D0: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + adds r0, r6, 0 + bl get_pokemon_name + b _0814F8DE +_0814F7E2: + adds r4, r5, r7 + ldrb r0, [r4, 0x1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814F808 + ldrb r1, [r4, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814F804 + adds r0, r1 + movs r1, 0x2 + adds r2, r6, 0 + bl pokemon_getattr + b _0814F81A + .align 2, 0 +_0814F804: .4byte 0x020244ec +_0814F808: + ldrb r1, [r4, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0814F824 + adds r0, r1 + movs r1, 0x2 + adds r2, r6, 0 + bl pokemon_getattr +_0814F81A: + adds r0, r6, 0 + bl get_end_of_string_ptr_limit_10_chars + b _0814F8DE + .align 2, 0 +_0814F824: .4byte 0x02024744 +_0814F828: + ldr r1, _0814F838 + adds r0, r5, r7 + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + b _0814F848 + .align 2, 0 +_0814F838: .4byte 0x085cbe6c +_0814F83C: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + movs r0, 0xD + muls r1, r0 + ldr r0, _0814F854 +_0814F846: + adds r1, r0 +_0814F848: + adds r0, r6, 0 + bl gf_strcat + adds r5, 0x2 + b _0814F8E0 + .align 2, 0 +_0814F854: .4byte 0x0831b6db +_0814F858: + adds r0, r5, r7 + ldrb r2, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r2, r0 + ldr r0, _0814F8A0 + ldr r0, [r0] + ldr r1, _0814F8A4 + ands r0, r1 + cmp r0, 0 + beq _0814F8D6 + cmp r2, 0xAF + bne _0814F8CC + ldr r2, _0814F8A8 + ldr r0, _0814F8AC + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _0814F8B0 + ldrb r2, [r1] + ldrh r0, [r0, 0x18] + cmp r0, r2 + bne _0814F8BC + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, _0814F8B4 + adds r1, r0 + adds r0, r6, 0 + bl gf_strcpy + ldr r1, _0814F8B8 + b _0814F8BE + .align 2, 0 +_0814F8A0: .4byte 0x02022fec +_0814F8A4: .4byte 0x02000002 +_0814F8A8: .4byte 0x020229e8 +_0814F8AC: .4byte 0x02024474 +_0814F8B0: .4byte 0x0202420f +_0814F8B4: .4byte 0x02024404 +_0814F8B8: .4byte 0x085cc0ad +_0814F8BC: + ldr r1, _0814F8C8 +_0814F8BE: + adds r0, r6, 0 + bl gf_strcat + b _0814F8DE + .align 2, 0 +_0814F8C8: .4byte 0x085cc0a0 +_0814F8CC: + adds r0, r2, 0 + adds r1, r6, 0 + bl itemid_get_name + b _0814F8DE +_0814F8D6: + adds r0, r2, 0 + adds r1, r6, 0 + bl itemid_get_name +_0814F8DE: + adds r5, 0x3 +_0814F8E0: + adds r0, r7, r5 + ldrb r0, [r0] + cmp r0, 0xFF + beq _0814F8EA + b _0814F666 +_0814F8EA: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_814F648 + + thumb_func_start sub_814F8F8 +sub_814F8F8: @ 814F8F8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r2, 0 + ldr r5, _0814F92C + ldr r3, _0814F930 +_0814F902: + cmp r2, 0x4 + beq _0814F918 + ldrh r1, [r3] + cmp r1, 0 + bne _0814F90E + adds r2, 0x1 +_0814F90E: + ldr r0, [r5] + adds r3, 0x2 + ldrh r0, [r0] + cmp r1, r0 + bne _0814F902 +_0814F918: + cmp r2, 0 + blt _0814F944 + cmp r2, 0x2 + bgt _0814F938 + ldr r1, _0814F934 + adds r0, r4, 0 + bl gf_strcpy + b _0814F944 + .align 2, 0 +_0814F92C: .4byte 0x0203aba8 +_0814F930: .4byte 0x085cd336 +_0814F934: .4byte 0x085ccbb5 +_0814F938: + cmp r2, 0x4 + bgt _0814F944 + ldr r1, _0814F94C + adds r0, r4, 0 + bl gf_strcpy +_0814F944: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814F94C: .4byte 0x085ccbb9 + thumb_func_end sub_814F8F8 + + thumb_func_start sub_814F950 +sub_814F950: @ 814F950 + push {r4,r5,lr} + adds r3, r0, 0 + movs r4, 0 + b _0814F95A +_0814F958: + adds r3, 0x1 +_0814F95A: + ldrb r0, [r3] + cmp r0, 0xFF + bne _0814F958 + ldr r1, _0814F990 + ldr r5, _0814F994 + movs r0, 0 + lsls r0, 1 + adds r2, r0, r1 +_0814F96A: + cmp r4, 0x4 + beq _0814F984 + ldrh r1, [r2] + cmp r1, 0 + bne _0814F976 + adds r4, 0x1 +_0814F976: + ldr r0, [r5] + adds r2, 0x2 + ldrh r0, [r0] + cmp r1, r0 + bne _0814F96A + cmp r4, 0x4 + bhi _0814F9E0 +_0814F984: + lsls r0, r4, 2 + ldr r1, _0814F998 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814F990: .4byte 0x085cd336 +_0814F994: .4byte 0x0203aba8 +_0814F998: .4byte _0814F99C + .align 2, 0 +_0814F99C: + .4byte _0814F9B0 + .4byte _0814F9B8 + .4byte _0814F9C0 + .4byte _0814F9C8 + .4byte _0814F9D8 +_0814F9B0: + ldr r1, _0814F9B4 + b _0814F9CA + .align 2, 0 +_0814F9B4: .4byte 0x085cbdb7 +_0814F9B8: + ldr r1, _0814F9BC + b _0814F9CA + .align 2, 0 +_0814F9BC: .4byte 0x085cbdb9 +_0814F9C0: + ldr r1, _0814F9C4 + b _0814F9CA + .align 2, 0 +_0814F9C4: .4byte 0x085cbdbb +_0814F9C8: + ldr r1, _0814F9D4 +_0814F9CA: + adds r0, r3, 0 + bl gf_strcpy + b _0814F9E0 + .align 2, 0 +_0814F9D4: .4byte 0x085cbdbd +_0814F9D8: + ldr r1, _0814F9E8 + adds r0, r3, 0 + bl gf_strcpy +_0814F9E0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814F9E8: .4byte 0x085cbdbf + thumb_func_end sub_814F950 + + thumb_func_start battle_show_message_maybe +battle_show_message_maybe: @ 814F9EC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r1, _0814FA1C + ldr r0, _0814FA20 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + mov r8, r0 + movs r0, 0x80 + ands r0, r7 + cmp r0, 0 + beq _0814FA24 + movs r0, 0x7F + ands r7, r0 + movs r0, 0 + b _0814FA36 + .align 2, 0 +_0814FA1C: .4byte 0x085cd660 +_0814FA20: .4byte 0x02024474 +_0814FA24: + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0] + adds r0, r7, 0 + bl Window_FastFillPixels + movs r0, 0x1 +_0814FA36: + mov r9, r0 + str r4, [sp] + mov r0, sp + strb r7, [r0, 0x4] + mov r1, sp + lsls r6, r7, 1 + adds r3, r6, r7 + lsls r3, 2 + add r3, r8 + ldrb r0, [r3, 0x1] + strb r0, [r1, 0x5] + ldrb r0, [r3, 0x2] + strb r0, [r1, 0x6] + ldrb r0, [r3, 0x3] + strb r0, [r1, 0x7] + mov r0, sp + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + ldrb r0, [r3, 0x4] + strb r0, [r1, 0xA] + ldrb r0, [r3, 0x5] + strb r0, [r1, 0xB] + mov r4, sp + ldrb r2, [r4, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4, 0xC] + mov r2, sp + ldrb r0, [r3, 0x7] + lsls r0, 4 + movs r5, 0xF + strb r0, [r2, 0xC] + ldrb r2, [r3, 0x8] + adds r0, r5, 0 + ands r0, r2 + ldrb r2, [r4, 0xD] + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xD] + mov r2, sp + ldrb r0, [r3, 0x9] + lsls r0, 4 + ands r1, r5 + orrs r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + ldrb r0, [r0, 0x6] + cmp r0, 0xFF + bne _0814FAC6 + ldr r0, _0814FAD8 + adds r0, 0x24 + ldrb r0, [r0] + adds r1, r7, 0 + bl sub_80397C4 + adds r2, r0, 0 + mov r0, sp + ldrb r0, [r0, 0x5] + ldr r1, [sp] + mov r3, sp + ldrb r3, [r3, 0xA] + bl sub_81DB374 + mov r2, sp + mov r1, sp + strb r0, [r1, 0x8] + strb r0, [r2, 0x6] +_0814FAC6: + cmp r7, 0x16 + bne _0814FAE0 + ldr r0, _0814FADC + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + b _0814FAE8 + .align 2, 0 +_0814FAD8: .4byte 0x02024474 +_0814FADC: .4byte 0x03003014 +_0814FAE0: + ldr r0, _0814FB04 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 +_0814FAE8: + strb r1, [r0] + adds r3, r0, 0 + ldr r0, _0814FB08 + ldr r1, [r0] + ldr r2, _0814FB0C + ands r1, r2 + adds r2, r0, 0 + cmp r1, 0 + beq _0814FB10 + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + b _0814FB18 + .align 2, 0 +_0814FB04: .4byte 0x03003014 +_0814FB08: .4byte 0x02022fec +_0814FB0C: .4byte 0x01000002 +_0814FB10: + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_0814FB18: + strb r0, [r3] + cmp r7, 0 + beq _0814FB22 + cmp r7, 0x16 + bne _0814FB6C +_0814FB22: + ldr r1, [r2] + ldr r0, _0814FB30 + ands r0, r1 + cmp r0, 0 + beq _0814FB34 + movs r6, 0x1 + b _0814FB5C + .align 2, 0 +_0814FB30: .4byte 0x02000002 +_0814FB34: + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + cmp r1, 0 + beq _0814FB54 + ldr r4, _0814FB50 + bl sub_8185FC4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r6, [r0] + b _0814FB5C + .align 2, 0 +_0814FB50: .4byte 0x085cd668 +_0814FB54: + bl sav2_get_text_speed + lsls r0, 24 + lsrs r6, r0, 24 +_0814FB5C: + ldr r0, _0814FB68 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _0814FB7E + .align 2, 0 +_0814FB68: .4byte 0x03003014 +_0814FB6C: + adds r0, r6, r7 + lsls r0, 2 + add r0, r8 + ldrb r6, [r0, 0x6] + ldrb r1, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0814FB7E: + mov r0, sp + adds r1, r6, 0 + movs r2, 0 + bl remo_copy + mov r0, r9 + cmp r0, 0 + beq _0814FB9C + adds r0, r7, 0 + bl Window_WriteStandardTileMap + adds r0, r7, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0814FB9C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end battle_show_message_maybe + + thumb_func_start sub_814FBAC +sub_814FBAC: @ 814FBAC + push {r4,r5,lr} + ldr r0, _0814FC08 + ldrb r2, [r0] + lsls r1, r2, 9 + ldr r0, _0814FC0C + adds r1, r0 + ldr r4, _0814FC10 + ldr r0, _0814FC14 + adds r2, r0 + ldrb r2, [r2] + adds r0, r1, 0 + adds r0, 0x8 + adds r0, r2 + ldrb r0, [r0] + adds r1, 0xC + adds r1, r2 + ldrb r1, [r1] + bl sub_814FC20 + lsls r0, 24 + ldr r5, _0814FC18 + lsrs r0, 22 + adds r0, r4 + ldrh r1, [r0] + adds r2, r5, 0 + adds r2, 0xB8 + strh r1, [r2] + ldrh r0, [r0, 0x2] + adds r5, 0xB6 + strh r0, [r5] + ldr r4, _0814FC1C + adds r0, r2, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl CpuSet + subs r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl CpuSet + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0814FC08: .4byte 0x02024064 +_0814FC0C: .4byte 0x02023068 +_0814FC10: .4byte 0x08d85620 +_0814FC14: .4byte 0x020244b0 +_0814FC18: .4byte 0x02037714 +_0814FC1C: .4byte 0x02037bcc + thumb_func_end sub_814FBAC + + thumb_func_start sub_814FC20 +sub_814FC20: @ 814FC20 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, r2 + beq _0814FC68 + cmp r0, 0x2 + bhi _0814FC3A + cmp r2, 0x1 + bhi _0814FC68 + b _0814FC42 +_0814FC3A: + cmp r0, 0x7 + bhi _0814FC4C + cmp r2, 0x2 + bhi _0814FC68 +_0814FC42: + movs r0, 0x2 + subs r0, r2 + lsls r0, 24 + lsrs r0, 24 + b _0814FC6A +_0814FC4C: + cmp r2, 0 + bne _0814FC54 + movs r0, 0x2 + b _0814FC6A +_0814FC54: + lsrs r0, r1, 26 + cmp r2, r0 + bhi _0814FC5E + movs r0, 0x1 + b _0814FC6A +_0814FC5E: + lsrs r0, r1, 25 + cmp r3, r0 + bhi _0814FC68 + movs r0, 0 + b _0814FC6A +_0814FC68: + movs r0, 0x3 +_0814FC6A: + pop {r1} + bx r1 + thumb_func_end sub_814FC20 + + thumb_func_start sub_814FC70 +sub_814FC70: @ 814FC70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0814FC94 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814FC8E + ldr r0, _0814FC98 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_0814FC8E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0814FC94: .4byte 0x02037fd4 +_0814FC98: .4byte sub_814FCC8 + 1 + thumb_func_end sub_814FC70 + + thumb_func_start sub_814FC9C +sub_814FC9C: @ 814FC9C + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, _0814FCC4 + movs r1, 0x1 + bl AddTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0814FCC4: .4byte sub_814FC70 + 1 + thumb_func_end sub_814FC9C + + thumb_func_start sub_814FCC8 +sub_814FCC8: @ 814FCC8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + movs r4, 0 + str r4, [sp, 0x14] + ldr r1, _0814FCF0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x9 + bhi _0814FD20 + lsls r0, 2 + ldr r1, _0814FCF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0814FCF0: .4byte 0x030022c0 +_0814FCF4: .4byte _0814FCF8 + .align 2, 0 +_0814FCF8: + .4byte _0814FD20 + .4byte _0814FDD8 + .4byte _0814FE90 + .4byte _0814FF50 + .4byte _0814FF7C + .4byte _0814FF98 + .4byte _0814FFF8 + .4byte _08150090 + .4byte _08150190 + .4byte _081501C8 +_0814FD20: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl sub_8150B6C + bl remove_some_task + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0x10 + mov r9, r0 + add r2, sp, 0xC + movs r6, 0 + ldr r1, _0814FDC4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _0814FDC8 + movs r0, 0x81 + lsls r0, 24 + mov r8, r0 +_0814FD4E: + strh r6, [r2] + add r0, sp, 0xC + 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 _0814FD4E + strh r6, [r2] + add r2, sp, 0xC + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r3, r8 + orrs r0, r3 + 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, 0x10] + ldr r2, _0814FDC4 + mov r1, r9 + 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 + add r0, sp, 0xC + 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] + ldr r4, _0814FDCC + ldr r0, _0814FDD0 + bl malloc_and_clear + str r0, [r4] + ldr r1, _0814FDD4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FDC4: .4byte 0x040000d4 +_0814FDC8: .4byte 0x81000800 +_0814FDCC: .4byte 0x0203abac +_0814FDD0: .4byte 0x00004110 +_0814FDD4: .4byte 0x030022c0 +_0814FDD8: + bl reset_all_obj_data + bl clear_tasks + bl gpu_pal_allocator_reset + bl sub_80A1A74 + bl reset_temp_tile_data_buffers + bl sub_80AAFA4 + movs r4, 0 + ldr r0, _0814FE6C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + movs r2, 0 +_0814FDFC: + lsls r0, r4, 2 + adds r0, r1, r0 + str r2, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _0814FDFC + bl sound_sources_off + bl map_music_set_to_zero + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0814FE70 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _0814FE74 + ldr r1, [r4] + adds r1, 0xFC + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r3, _0814FE78 + adds r1, r3 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _0814FE7C + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + ldr r2, _0814FE80 + adds r1, r2 + movs r0, 0x3 + bl bg_set_tilemap + ldr r2, _0814FE84 + ldr r1, _0814FE88 + movs r0, 0 + strh r0, [r1] + strh r0, [r2] + ldr r1, _0814FE8C + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FE6C: .4byte 0x0854c14c +_0814FE70: .4byte 0x085cd66c +_0814FE74: .4byte 0x0203abac +_0814FE78: .4byte 0x000010fc +_0814FE7C: .4byte 0x000020fc +_0814FE80: .4byte 0x000030fc +_0814FE84: .4byte 0x02021bbc +_0814FE88: .4byte 0x02021bbe +_0814FE8C: .4byte 0x030022c0 +_0814FE90: + movs r4, 0 + add r5, sp, 0x14 + ldr r6, _0814FF18 +_0814FE96: + lsls r0, r4, 3 + adds r0, r6 + bl gpu_tile_obj_decompress_and_load + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0814FE96 + ldr r0, _0814FF1C + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0814FF20 + adds r1, r5, 0 + bl malloc_and_decompress + ldr r4, _0814FF24 + ldr r1, [r4] + ldr r2, _0814FF28 + adds r1, r2 + str r0, [r1] + ldr r0, _0814FF2C + adds r1, r5, 0 + bl malloc_and_decompress + ldr r1, [r4] + movs r3, 0x82 + lsls r3, 7 + adds r1, r3 + str r0, [r1] + ldr r0, _0814FF30 + adds r1, r5, 0 + bl malloc_and_decompress + ldr r1, [r4] + ldr r2, _0814FF34 + adds r1, r2 + str r0, [r1] + ldr r0, _0814FF38 + adds r1, r5, 0 + bl malloc_and_decompress + ldr r1, [r4] + ldr r3, _0814FF3C + adds r2, r1, r3 + str r0, [r2] + ldr r0, _0814FF40 + adds r1, r0 + ldr r0, _0814FF44 + str r0, [r1] + ldr r1, _0814FF48 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _0814FF4C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FF18: .4byte 0x085cdb54 +_0814FF1C: .4byte 0x085cdb74 +_0814FF20: .4byte 0x085cd67c +_0814FF24: .4byte 0x0203abac +_0814FF28: .4byte 0x000040fc +_0814FF2C: .4byte 0x085cd7d4 +_0814FF30: .4byte 0x085cd958 +_0814FF34: .4byte 0x00004104 +_0814FF38: .4byte 0x085cdb30 +_0814FF3C: .4byte 0x0000410c +_0814FF40: .4byte 0x00004108 +_0814FF44: .4byte 0x085cdb1c +_0814FF48: .4byte 0x08dba5b8 +_0814FF4C: .4byte 0x030022c0 +_0814FF50: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _0814FF5C + b _08150226 +_0814FF5C: + ldr r0, _0814FF74 + movs r1, 0 + movs r2, 0x80 + bl gpu_pal_apply + ldr r1, _0814FF78 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FF74: .4byte 0x08dba518 +_0814FF78: .4byte 0x030022c0 +_0814FF7C: + bl sub_8150D28 + bl run_active_tasks + ldr r1, _0814FF94 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FF94: .4byte 0x030022c0 +_0814FF98: + ldr r0, _0814FFB0 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0x7 + bne _0814FFB4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r6, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FFB0: .4byte 0x0203abac +_0814FFB4: + ldr r0, _0814FFF4 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + ldr r0, [r1] + cmp r0, 0 + bne _0814FFC4 + b _08150226 +_0814FFC4: + movs r4, 0 + adds r3, r1, 0 + movs r5, 0xD + negs r5, r5 +_0814FFCC: + lsls r0, r4, 2 + adds r0, r3, r0 + ldr r2, [r0] + cmp r2, 0 + beq _0814FFDE + ldrb r1, [r2, 0x5] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x5] +_0814FFDE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _0814FFCC + movs r3, 0x87 + lsls r3, 3 + adds r1, r6, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0814FFF4: .4byte 0x0854c14c +_0814FFF8: + ldr r6, _0815007C + ldr r0, [r6] + movs r1, 0x82 + lsls r1, 7 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x20 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r0, 0x1 + movs r2, 0 + movs r3, 0x11 + bl bg_copy_tilemap_rect_simple + ldr r0, [r6] + ldr r2, _08150080 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x1E + str r0, [sp] + movs r3, 0x14 + mov r8, r3 + str r3, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect_simple + ldr r0, [r6] + ldr r1, _08150084 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x5 + str r0, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect_simple + ldr r0, [r6] + ldr r2, _08150088 + adds r0, r2 + ldr r1, [r0] + str r4, [sp] + mov r3, r8 + str r3, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x2 + bl bg_copy_tilemap_rect_simple + ldr r1, _0815008C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_0815007C: .4byte 0x0203abac +_08150080: .4byte 0x00004104 +_08150084: .4byte 0x00004108 +_08150088: .4byte 0x0000410c +_0815008C: .4byte 0x030022c0 +_08150090: + ldr r0, _08150180 + ldrb r0, [r0] + bl sub_81514C8 + ldr r1, _08150184 + mov r9, r1 + ldr r0, [r1] + ldr r2, _08150188 + mov r8, r2 + add r0, r8 + ldr r1, [r0] + adds r1, 0x90 + movs r6, 0xC + str r6, [sp] + movs r5, 0x3 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0xE + bl bg_copy_tilemap_rect_simple + mov r3, r9 + ldr r0, [r3] + add r0, r8 + ldr r1, [r0] + adds r1, 0xD8 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x11 + bl bg_copy_tilemap_rect_simple + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + adds r1, r2 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x18 + movs r3, 0x14 + bl bg_copy_tilemap_rect_simple + mov r3, r9 + ldr r0, [r3] + add r0, r8 + ldr r1, [r0] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x11 + bl bg_copy_tilemap_rect_simple + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r1, [r0] + adds r1, 0x48 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x14 + bl bg_copy_tilemap_rect_simple + mov r2, r9 + ldr r0, [r2] + add r0, r8 + ldr r1, [r0] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x14 + bl bg_copy_tilemap_rect_simple + mov r3, r9 + ldr r0, [r3] + add r0, r8 + ldr r1, [r0] + adds r1, 0x48 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x17 + bl bg_copy_tilemap_rect_simple + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r1, [r0] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x18 + movs r3, 0x17 + bl bg_copy_tilemap_rect_simple + ldr r1, _0815018C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_08150180: .4byte 0x020375e0 +_08150184: .4byte 0x0203abac +_08150188: .4byte 0x000040fc +_0815018C: .4byte 0x030022c0 +_08150190: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x3 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _081501C0 + movs r1, 0x1 + bl sub_80A3194 + movs r0, 0x1 + bl sub_8150B6C + ldr r1, _081501C4 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .align 2, 0 +_081501C0: .4byte 0x000001a9 +_081501C4: .4byte 0x030022c0 +_081501C8: + ldr r3, _081501FC + ldrh r2, [r3] + movs r0, 0 + strh r0, [r3] + ldr r4, _08150200 + ldrh r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + ldr r0, _08150204 + bl SetVBlankCallback + ldr r0, _08150208 + bl set_callback2 + ldr r0, _0815020C + movs r1, 0 + bl AddTask + ldr r0, _08150210 + ldrh r0, [r0] + cmp r0, 0 + bne _08150218 + ldr r0, _08150214 + b _0815021A + .align 2, 0 +_081501FC: .4byte 0x04000208 +_08150200: .4byte 0x04000200 +_08150204: .4byte sub_8150800 + 1 +_08150208: .4byte mainloop + 1 +_0815020C: .4byte sub_81503E4 + 1 +_08150210: .4byte 0x020375e0 +_08150214: .4byte sub_8150550 + 1 +_08150218: + ldr r0, _08150234 +_0815021A: + movs r1, 0x1 + bl AddTask + ldr r1, _08150238 + ldr r1, [r1] +_08150224: + strb r0, [r1] +_08150226: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08150234: .4byte sub_8150664 + 1 +_08150238: .4byte 0x0203abac + thumb_func_end sub_814FCC8 + + thumb_func_start mainloop +mainloop: @ 815023C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + bl sound_something + pop {r0} + bx r0 + thumb_func_end mainloop + + thumb_func_start c2_8011A1C +c2_8011A1C: @ 8150258 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r4, 0 + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + movs r0, 0 + bl sub_8150B6C + ldr r0, _081503B8 + strh r4, [r0] + movs r0, 0 + bl sub_80AB130 + add r0, sp, 0x4 + mov r8, r0 + ldr r0, _081503BC + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + movs r2, 0 +_08150298: + lsls r0, r4, 2 + adds r0, r1, r0 + str r2, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08150298 + bl clear_tasks + bl reset_all_obj_data + bl sub_80A1A74 + movs r0, 0 + bl bg_unset_tilemap + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x2 + bl bg_unset_tilemap + movs r0, 0x3 + bl bg_unset_tilemap + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r6, _081503C0 + ldr r0, [r6] + ldr r2, _081503C4 + adds r1, r0, r2 + movs r5, 0 + str r5, [r1] + ldr r4, _081503C8 + adds r0, r4 + ldr r0, [r0] + bl free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + ldr r4, _081503CC + adds r0, r4 + ldr r0, [r0] + bl free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + movs r4, 0x82 + lsls r4, 7 + adds r0, r4 + ldr r0, [r0] + bl free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + ldr r4, _081503D0 + adds r0, r4 + ldr r0, [r0] + bl free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + bl free + str r5, [r6] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + ldr r1, _081503D4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _081503D8 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_08150340: + 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 _08150340 + 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, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, _081503D4 + 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] + bl warp_in + ldr r0, _081503DC + str r4, [r0] + ldr r0, _081503E0 + bl set_callback2 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081503B8: .4byte 0x02021bbc +_081503BC: .4byte 0x0854c14c +_081503C0: .4byte 0x0203abac +_081503C4: .4byte 0x00004108 +_081503C8: .4byte 0x0000410c +_081503CC: .4byte 0x00004104 +_081503D0: .4byte 0x000040fc +_081503D4: .4byte 0x040000d4 +_081503D8: .4byte 0x81000800 +_081503DC: .4byte 0x03005dac +_081503E0: .4byte c2_load_new_map + 1 + thumb_func_end c2_8011A1C + + thumb_func_start sub_81503E4 +sub_81503E4: @ 81503E4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, _08150410 + ldr r3, [r5] + ldrh r0, [r3, 0x6] + adds r0, 0x1 + strh r0, [r3, 0x6] + ldrb r2, [r3, 0x1] + adds r7, r5, 0 + cmp r2, 0x2 + beq _081504EA + cmp r2, 0x2 + bgt _08150414 + cmp r2, 0 + beq _08150422 + cmp r2, 0x1 + beq _0815043C + b _08150542 + .align 2, 0 +_08150410: .4byte 0x0203abac +_08150414: + cmp r2, 0x3 + bne _0815041A + b _08150510 +_0815041A: + cmp r2, 0xFF + bne _08150420 + b _08150528 +_08150420: + b _08150542 +_08150422: + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r3, 0x4] + cmp r0, r1 + beq _0815042E + b _08150542 +_0815042E: + ldrb r0, [r3, 0x2] + bl weather_set + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x1] + b _08150542 +_0815043C: + ldrb r0, [r3, 0x2] + cmp r0, 0x2 + beq _08150490 + cmp r0, 0x7 + beq _08150448 + b _08150542 +_08150448: + ldr r0, _0815048C + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0xF0 + ldr r0, [r2] + cmp r0, 0 + beq _08150542 + ldrb r1, [r0, 0x5] + movs r0, 0xC + ands r0, r1 + cmp r0, 0 + beq _08150542 + adds r3, r2, 0 + movs r5, 0xD + negs r5, r5 +_08150466: + lsls r0, r4, 2 + adds r0, r3, r0 + ldr r2, [r0] + cmp r2, 0 + beq _08150478 + ldrb r1, [r2, 0x5] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x5] +_08150478: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08150466 + ldr r1, [r7] + movs r0, 0x2 + strb r0, [r1, 0x1] + b _08150542 + .align 2, 0 +_0815048C: .4byte 0x0854c14c +_08150490: + ldr r0, _081504A4 + ldr r2, [r0] + movs r1, 0xDA + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081504A8 + strb r0, [r3, 0x1] + b _08150542 + .align 2, 0 +_081504A4: .4byte 0x0854c14c +_081504A8: + ldrh r1, [r3, 0x6] + ldrh r0, [r3, 0x4] + adds r0, 0x8 + cmp r1, r0 + blt _08150542 + adds r6, r2, 0 + adds r6, 0xF0 + movs r5, 0x1 + movs r7, 0x5 + negs r7, r7 +_081504BC: + lsls r0, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + cmp r0, 0 + beq _081504DE + adds r3, r0, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r1, r2, 29 + lsrs r1, 31 + eors r1, r5 + ands r1, r5 + lsls r1, 2 + adds r0, r7, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081504DE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _081504BC + b _08150542 +_081504EA: + lsls r1, r0, 16 + ldr r0, _0815050C + cmp r1, r0 + bne _08150542 + movs r0, 0x3 + strb r0, [r3, 0x1] + subs r0, 0x4 + str r4, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x4 + bl play_sound_effect + b _08150542 + .align 2, 0 +_0815050C: .4byte 0x023a0000 +_08150510: + ldr r0, _08150524 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08150542 + movs r0, 0xFF + strb r0, [r3, 0x1] + b _08150542 + .align 2, 0 +_08150524: .4byte 0x02037fd4 +_08150528: + movs r0, 0 + bl SetVBlankCallback + adds r0, r6, 0 + bl remove_task + ldr r0, [r5] + ldrb r0, [r0] + bl remove_task + ldr r0, _0815054C + bl set_callback2 +_08150542: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815054C: .4byte c2_8011A1C + 1 + thumb_func_end sub_81503E4 + + thumb_func_start sub_8150550 +sub_8150550: @ 8150550 + push {r4-r6,lr} + sub sp, 0xC + ldr r6, _081505A4 + ldr r1, [r6] + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _08150630 + ldrb r0, [r1, 0x14] + subs r0, 0x1 + strb r0, [r1, 0x14] + ldr r1, [r6] + ldrh r0, [r1, 0x6] + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + bne _08150576 + ldrb r0, [r1, 0x15] + subs r0, 0x1 + strb r0, [r1, 0x15] +_08150576: + ldr r2, [r6] + ldrh r0, [r2, 0x6] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08150590 + ldrb r0, [r2, 0xC] + subs r0, 0x1 + strb r0, [r2, 0xC] + ldr r1, [r6] + ldrb r0, [r1, 0xD] + subs r0, 0x1 + strb r0, [r1, 0xD] +_08150590: + ldr r0, [r6] + ldrb r1, [r0, 0x14] + cmp r1, 0x20 + beq _081505DC + cmp r1, 0x20 + bgt _081505A8 + cmp r1, 0x10 + beq _081505F4 + b _08150630 + .align 2, 0 +_081505A4: .4byte 0x0203abac +_081505A8: + cmp r1, 0x28 + beq _081505CA + cmp r1, 0xAF + bne _08150630 + movs r0, 0x2 + str r0, [sp] + movs r0, 0xA + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0x16 + bl Bg_FillWramTileMapRectWithTileAndPalette + b _08150630 +_081505CA: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0x3 + b _081505EC +_081505DC: + str r3, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0x2 +_081505EC: + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + b _08150630 +_081505F4: + ldr r1, _08150658 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x5 + str r0, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl bg_copy_tilemap_rect_simple + ldr r0, [r6] + ldr r1, _0815065C + adds r0, r1 + ldr r1, [r0] + str r4, [sp] + movs r0, 0x1E + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x2 + bl bg_copy_tilemap_rect_simple + ldr r1, [r6] + movs r0, 0x40 + strb r0, [r1, 0x15] +_08150630: + bl sub_815115C + ldr r3, _08150660 + movs r0, 0 + ldrsh r2, [r3, r0] + adds r1, r2, 0x1 + adds r0, r1, 0 + cmp r1, 0 + bge _08150646 + adds r0, r2, 0 + adds r0, 0x80 +_08150646: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + strh r0, [r3] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08150658: .4byte 0x00004108 +_0815065C: .4byte 0x0000410c +_08150660: .4byte 0x02021bbc + thumb_func_end sub_8150550 + + thumb_func_start sub_8150664 +sub_8150664: @ 8150664 + push {r4-r7,lr} + sub sp, 0xC + ldr r7, _081506B8 + ldr r1, [r7] + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _08150674 + b _081507B6 +_08150674: + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + ldr r1, [r7] + ldrh r0, [r1, 0x6] + movs r6, 0x1 + ands r0, r6 + cmp r0, 0 + bne _0815068C + ldrb r0, [r1, 0x15] + adds r0, 0x1 + strb r0, [r1, 0x15] +_0815068C: + ldr r2, [r7] + ldrh r0, [r2, 0x6] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _081506A6 + ldrb r0, [r2, 0xC] + adds r0, 0x1 + strb r0, [r2, 0xC] + ldr r1, [r7] + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] +_081506A6: + ldr r0, [r7] + ldrb r1, [r0, 0x14] + cmp r1, 0x20 + beq _0815071A + cmp r1, 0x20 + bgt _081506BC + cmp r1, 0x10 + beq _081506E8 + b _081507B6 + .align 2, 0 +_081506B8: .4byte 0x0203abac +_081506BC: + cmp r1, 0x28 + beq _08150784 + cmp r1, 0xB0 + bne _081507B6 + ldr r1, _081506E4 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1E + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x2 + bl bg_copy_tilemap_rect_simple + b _081507B6 + .align 2, 0 +_081506E4: .4byte 0x0000410c +_081506E8: + movs r0, 0x3 + str r0, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + movs r0, 0xA + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0x16 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, [r7] + movs r0, 0xC0 + strb r0, [r1, 0x15] + b _081507B6 +_0815071A: + ldr r5, _08150780 + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + str r6, [sp] + str r6, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x6] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x3 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0xE] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x10] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x3 + movs r3, 0x1 + bl Bg_FillWramTileMapRectWithTileAndPalette + b _081507B6 + .align 2, 0 +_08150780: .4byte 0x00004108 +_08150784: + ldr r5, _081507D0 + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x8] + str r6, [sp] + str r6, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x4 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x12] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x4 + movs r3, 0x1 + bl Bg_FillWramTileMapRectWithTileAndPalette +_081507B6: + bl sub_81511B8 + ldr r0, _081507D4 + ldr r1, [r0] + ldrh r0, [r1, 0x6] + ldrh r1, [r1, 0x4] + cmp r0, r1 + bcs _081507DC + ldr r4, _081507D8 + movs r1, 0 + ldrsh r0, [r4, r1] + b _081507E6 + .align 2, 0 +_081507D0: .4byte 0x00004108 +_081507D4: .4byte 0x0203abac +_081507D8: .4byte 0x02021bbc +_081507DC: + ldr r0, _081507F8 + ldr r4, [r0] + ldr r0, _081507FC + adds r4, r0 + ldrh r0, [r4] +_081507E6: + adds r0, 0xF7 + movs r1, 0xF8 + bl __modsi3 + strh r0, [r4] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081507F8: .4byte 0x0854c14c +_081507FC: .4byte 0x000006fc + thumb_func_end sub_8150664 + + thumb_func_start sub_8150800 +sub_8150800: @ 8150800 + push {r4,lr} + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r4, _08150860 + ldr r0, [r4] + ldrb r1, [r0, 0x14] + movs r0, 0x1C + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0x15] + movs r0, 0x1E + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0xC] + movs r0, 0x14 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0xD] + movs r0, 0x16 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0x8] + movs r0, 0x10 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0x9] + movs r0, 0x12 + bl lcd_io_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08150860: .4byte 0x0203abac + thumb_func_end sub_8150800 + + thumb_func_start nullsub_58 +nullsub_58: @ 8150864 + bx lr + thumb_func_end nullsub_58 + + thumb_func_start sub_8150868 +sub_8150868: @ 8150868 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _081508D0 + ldr r6, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0xFF + beq _08150934 + ldr r0, _081508D4 + ldrh r0, [r0] + cmp r0, 0 + bne _081508E4 + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150892 + ldr r1, _081508D8 + bl __addsf3 +_08150892: + ldr r1, _081508DC + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + subs r1, r0 + strh r1, [r5, 0x20] + movs r1, 0x6 + ldrsh r4, [r6, r1] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _081508BA + ldr r1, _081508D8 + bl __addsf3 +_081508BA: + ldr r1, _081508E0 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x22] + b _08150934 + .align 2, 0 +_081508D0: .4byte 0x0203abac +_081508D4: .4byte 0x020375e0 +_081508D8: .4byte 0x47800000 +_081508DC: .4byte 0x3e0f5c29 +_081508E0: .4byte 0x3d89374c +_081508E4: + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _081508F8 + ldr r1, _0815093C + bl __addsf3 +_081508F8: + ldr r1, _08150940 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + adds r0, r1 + strh r0, [r5, 0x20] + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150920 + ldr r1, _0815093C + bl __addsf3 +_08150920: + ldr r1, _08150944 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x22] +_08150934: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815093C: .4byte 0x47800000 +_08150940: .4byte 0x3e0f5c29 +_08150944: .4byte 0x3d89374c + thumb_func_end sub_8150868 + + thumb_func_start sub_8150948 +sub_8150948: @ 8150948 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _081509B4 + ldr r6, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0xFF + bne _08150958 + b _08150A60 +_08150958: + ldr r0, _081509B8 + ldrh r0, [r0] + cmp r0, 0 + bne _081509C8 + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150974 + ldr r1, _081509BC + bl __addsf3 +_08150974: + ldr r1, _081509C0 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + subs r1, r0 + strh r1, [r5, 0x20] + movs r1, 0x6 + ldrsh r4, [r6, r1] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _0815099C + ldr r1, _081509BC + bl __addsf3 +_0815099C: + ldr r1, _081509C4 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x22] + b _08150A18 + .align 2, 0 +_081509B4: .4byte 0x0203abac +_081509B8: .4byte 0x020375e0 +_081509BC: .4byte 0x47800000 +_081509C0: .4byte 0x3e0f5c29 +_081509C4: .4byte 0x3d89374c +_081509C8: + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _081509DC + ldr r1, _08150A3C + bl __addsf3 +_081509DC: + ldr r1, _08150A40 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + adds r0, r1 + strh r0, [r5, 0x20] + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150A04 + ldr r1, _08150A3C + bl __addsf3 +_08150A04: + ldr r1, _08150A44 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x22] +_08150A18: + movs r0, 0x32 + ldrsh r2, [r5, r0] + cmp r2, 0 + bne _08150A48 + movs r0, 0x11 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x34] + adds r1, r0, 0x1 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _08150A60 + strh r2, [r5, 0x34] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + b _08150A60 + .align 2, 0 +_08150A3C: .4byte 0x47800000 +_08150A40: .4byte 0x3e0f5c29 +_08150A44: .4byte 0x3d89374c +_08150A48: + movs r2, 0 + movs r0, 0x10 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x34] + adds r1, r0, 0x1 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _08150A60 + strh r2, [r5, 0x34] + strh r2, [r5, 0x32] +_08150A60: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8150948 + + thumb_func_start sub_8150A68 +sub_8150A68: @ 8150A68 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08150A98 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r3, [r2, 0x20] + adds r0, r3 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x22] + adds r1, 0x10 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + strh r0, [r2, 0x22] +_08150A98: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08150AEE + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _08150AB8 + cmp r1, 0x1 + beq _08150AC2 + b _08150AE0 +_08150AB8: + ldrh r0, [r2, 0x20] + adds r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x2E] + b _08150AD2 +_08150AC2: + ldrh r0, [r2, 0x2E] + ands r0, r1 + cmp r0, 0 + beq _08150AE0 + ldrh r0, [r2, 0x20] + adds r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x20] +_08150AD2: + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08150AE0 + ldrh r0, [r2, 0x22] + adds r0, 0x1 + strh r0, [r2, 0x22] +_08150AE0: + movs r1, 0x22 + ldrsh r0, [r2, r1] + cmp r0, 0xA0 + ble _08150AEE + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_08150AEE: + pop {r0} + bx r0 + thumb_func_end sub_8150A68 + + thumb_func_start sub_8150AF4 +sub_8150AF4: @ 8150AF4 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08150B12 + ldrh r1, [r2, 0x22] + adds r1, 0x10 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + strh r0, [r2, 0x22] +_08150B12: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08150B68 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _08150B32 + cmp r1, 0x1 + beq _08150B3C + b _08150B5A +_08150B32: + ldrh r0, [r2, 0x20] + subs r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x2E] + b _08150B4C +_08150B3C: + ldrh r0, [r2, 0x2E] + ands r0, r1 + cmp r0, 0 + beq _08150B5A + ldrh r0, [r2, 0x20] + subs r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x20] +_08150B4C: + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08150B5A + ldrh r0, [r2, 0x22] + subs r0, 0x1 + strh r0, [r2, 0x22] +_08150B5A: + movs r1, 0x22 + ldrsh r0, [r2, r1] + cmp r0, 0x4F + bgt _08150B68 + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_08150B68: + pop {r0} + bx r0 + thumb_func_end sub_8150AF4 + + thumb_func_start sub_8150B6C +sub_8150B6C: @ 8150B6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08150B7A + cmp r0, 0x1 + beq _08150C1C +_08150B7A: + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + b _08150D1C +_08150C1C: + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + ldr r0, _08150C6C + ldrh r3, [r0] + cmp r3, 0 + bne _08150C74 + ldr r1, _08150C70 + ldr r2, [r1] + movs r0, 0xB0 + strb r0, [r2, 0x14] + ldr r2, [r1] + movs r0, 0x10 + strb r0, [r2, 0x15] + ldr r0, [r1] + strb r3, [r0, 0xC] + ldr r2, [r1] + movs r0, 0x50 + b _08150C8C + .align 2, 0 +_08150C6C: .4byte 0x020375e0 +_08150C70: .4byte 0x0203abac +_08150C74: + ldr r1, _08150D24 + ldr r2, [r1] + movs r3, 0 + movs r0, 0x60 + strb r0, [r2, 0x14] + ldr r2, [r1] + movs r0, 0xE8 + strb r0, [r2, 0x15] + ldr r0, [r1] + strb r3, [r0, 0xC] + ldr r2, [r1] + movs r0, 0x4 +_08150C8C: + strb r0, [r2, 0xD] + ldr r0, [r1] + strb r3, [r0, 0x9] + ldr r0, [r1] + strb r3, [r0, 0x9] + adds r4, r1, 0 + ldr r0, [r4] + ldrb r1, [r0, 0x14] + movs r0, 0x1C + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0x15] + movs r0, 0x1E + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0xC] + movs r0, 0x14 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0xD] + movs r0, 0x16 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0x8] + movs r0, 0x10 + bl lcd_io_set + ldr r0, [r4] + ldrb r1, [r0, 0x9] + movs r0, 0x12 + bl lcd_io_set + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r1, 0xFC + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set +_08150D1C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08150D24: .4byte 0x0203abac + thumb_func_end sub_8150B6C + + thumb_func_start sub_8150D28 +sub_8150D28: @ 8150D28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r1, _08150E3C + add r0, sp, 0xC + movs r2, 0x2 + bl memcpy + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + add r6, sp, 0x10 + ldr r1, _08150E40 + adds r0, r6, 0 + movs r2, 0x4 + bl memcpy + add r5, sp, 0x14 + ldr r1, _08150E44 + adds r0, r5, 0 + movs r2, 0x8 + bl memcpy + add r4, sp, 0x1C + ldr r1, _08150E48 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r0, _08150E4C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, _08150E50 + ldrh r0, [r0] + mov r8, r6 + mov r10, r5 + cmp r0, 0 + beq _08150D86 + cmp r0, 0x1 + beq _08150E68 +_08150D86: + ldr r0, _08150E54 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + add r0, sp + adds r0, 0xC + ldrb r0, [r0] + ldr r1, _08150E58 + movs r2, 0x66 + str r2, [sp] + movs r2, 0xC8 + movs r3, 0x49 + bl sub_808DD68 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08150DD0 + ldr r0, _08150E5C + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x8 + strh r0, [r1, 0x24] + movs r0, 0x10 + strh r0, [r1, 0x26] + movs r0, 0xC8 + strh r0, [r1, 0x2E] + movs r0, 0x49 + strh r0, [r1, 0x30] +_08150DD0: + ldr r4, _08150E60 + adds r0, r4, 0 + movs r1, 0xB0 + movs r2, 0x2B + movs r3, 0x67 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _08150E5C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x20 + strh r1, [r0, 0x26] + strh r1, [r0, 0x24] + movs r1, 0xB0 + strh r1, [r0, 0x2E] + movs r1, 0x2B + strh r1, [r0, 0x30] + adds r4, 0x18 + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x63 + movs r3, 0x65 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8 + strh r1, [r0, 0x24] + movs r1, 0x4 + strh r1, [r0, 0x26] + movs r1, 0xC8 + strh r1, [r0, 0x2E] + movs r1, 0x63 + strh r1, [r0, 0x30] + ldr r2, _08150E64 + ldr r1, [r2] + movs r0, 0x7 + strb r0, [r1, 0x2] + ldr r1, [r2] + movs r0, 0xAF + lsls r0, 1 + strh r0, [r1, 0x4] + movs r0, 0x2 + bl sub_80AB130 + b _08150F3A + .align 2, 0 +_08150E3C: .4byte 0x085cdbe4 +_08150E40: .4byte 0x085cdbe6 +_08150E44: .4byte 0x085cdbea +_08150E48: .4byte 0x085cdbf2 +_08150E4C: .4byte 0x085cdbf8 +_08150E50: .4byte 0x020375e0 +_08150E54: .4byte 0x03005d90 +_08150E58: .4byte sub_8150948 + 1 +_08150E5C: .4byte 0x02020630 +_08150E60: .4byte 0x085cdb9c +_08150E64: .4byte 0x0203abac +_08150E68: + ldr r7, _08151008 + ldr r0, [r7] + ldr r1, _0815100C + adds r0, r1 + ldr r1, [r0] + adds r1, 0x48 + movs r0, 0xC + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r2, 0x18 + movs r3, 0x1A + bl bg_copy_tilemap_rect_simple + ldr r0, _08151010 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + add r0, sp + adds r0, 0xC + ldrb r0, [r0] + ldr r1, _08151014 + movs r2, 0x66 + str r2, [sp] + movs r2, 0x80 + movs r3, 0x27 + bl sub_808DD68 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08150ED4 + ldr r0, _08151018 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x8 + strh r0, [r1, 0x24] + movs r0, 0x10 + strh r0, [r1, 0x26] + movs r0, 0x80 + strh r0, [r1, 0x2E] + movs r0, 0x27 + strh r0, [r1, 0x30] +_08150ED4: + ldr r4, _0815101C + adds r0, r4, 0 + movs r1, 0x68 + movs r2, 0x9 + movs r3, 0x67 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _08151018 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x20 + strh r1, [r0, 0x26] + strh r1, [r0, 0x24] + movs r1, 0x68 + strh r1, [r0, 0x2E] + movs r1, 0x9 + strh r1, [r0, 0x30] + adds r4, 0x18 + adds r0, r4, 0 + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0x65 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8 + strh r1, [r0, 0x24] + movs r1, 0x4 + strh r1, [r0, 0x26] + movs r1, 0x80 + strh r1, [r0, 0x2E] + movs r1, 0x41 + strh r1, [r0, 0x30] + ldr r1, [r7] + movs r0, 0x2 + strb r0, [r1, 0x2] + ldr r1, [r7] + ldr r0, _08151020 + strh r0, [r1, 0x4] + movs r0, 0x7 + bl sub_80AB130 +_08150F3A: + movs r4, 0 + ldr r5, _08151018 +_08150F3E: + lsls r1, r4, 20 + movs r2, 0xC0 + lsls r2, 15 + adds r1, r2 + asrs r1, 16 + lsls r2, r4, 19 + ldr r3, _08151024 + adds r2, r3 + asrs r2, 16 + ldr r0, _08151028 + movs r3, 0x68 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8 + strh r1, [r0, 0x24] + strh r1, [r0, 0x26] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _08150F3E + movs r0, 0x3F + mov r4, r9 + ands r0, r4 + cmp r0, 0 + bne _08151074 + mov r0, r9 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + add r0, r8 + ldrb r0, [r0] + ldr r5, _0815102C + ldrh r4, [r5] + lsls r4, 2 + add r1, sp, 0x20 + adds r1, r4, r1 + ldr r1, [r1] + mov r3, r10 + adds r2, r3, r4 + movs r3, 0 + ldrsh r2, [r2, r3] + mov r3, sp + adds r3, 0x16 + adds r3, r4 + movs r4, 0 + ldrsh r3, [r3, r4] + movs r4, 0x6A + str r4, [sp] + bl sub_808DD68 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08151074 + ldr r1, _08151018 + lsls r2, r6, 4 + adds r0, r2, r6 + lsls r0, 2 + adds r4, r0, r1 + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r5] + mov r8, r2 + cmp r0, 0 + bne _08151036 + movs r7, 0x1 + mov r5, r9 + ands r5, r7 + cmp r5, 0 + beq _08151030 + adds r0, r4, 0 + movs r1, 0x6 + b _08151044 + .align 2, 0 +_08151008: .4byte 0x0203abac +_0815100C: .4byte 0x000040fc +_08151010: .4byte 0x03005d90 +_08151014: .4byte sub_8150948 + 1 +_08151018: .4byte 0x02020630 +_0815101C: .4byte 0x085cdb9c +_08151020: .4byte 0x00000109 +_08151024: .4byte 0xfff80000 +_08151028: .4byte 0x085cdbcc +_0815102C: .4byte 0x020375e0 +_08151030: + adds r0, r4, 0 + movs r1, 0x7 + b _08151056 +_08151036: + movs r7, 0x1 + mov r5, r9 + ands r5, r7 + cmp r5, 0 + beq _08151052 + adds r0, r4, 0 + movs r1, 0x7 +_08151044: + bl obj_anim_image_start + strh r7, [r4, 0x30] + ldrh r0, [r4, 0x22] + adds r0, 0x2 + strh r0, [r4, 0x22] + b _0815105C +_08151052: + adds r0, r4, 0 + movs r1, 0x6 +_08151056: + bl obj_anim_image_start + strh r5, [r4, 0x30] +_0815105C: + ldr r0, _08151084 + mov r2, r8 + adds r1, r2, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x3 + mov r3, r9 + ands r0, r3 + add r0, sp + adds r0, 0x1C + ldrb r0, [r0] + strh r0, [r1, 0x32] +_08151074: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08151084: .4byte 0x02020630 + thumb_func_end sub_8150D28 + + thumb_func_start sub_8151088 +sub_8151088: @ 8151088 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r3, 0 + mov r9, r3 + ldr r2, _08151154 + ldr r0, [r2] + ldrb r1, [r0, 0x1B] + adds r1, 0x2 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 26 + lsrs r0, 24 + mov r12, r0 +_081510AA: + movs r7, 0 + lsls r0, r3, 1 + adds r1, r3, 0x3 + adds r2, r3, 0x6 + adds r4, r3, 0x1 + str r4, [sp, 0x4] + adds r0, r3 + lsls r0, 3 + str r0, [sp] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + mov r10, r0 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + mov r8, r0 +_081510CC: + ldr r0, _08151154 + ldr r6, [r0] + lsls r3, r7, 1 + ldr r1, [sp] + adds r2, r3, r1 + adds r4, r6, 0 + adds r4, 0x22 + adds r2, r4, r2 + mov r1, r12 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldr r0, _08151158 + adds r5, r6, r0 + ldr r0, [r5] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + mov r1, r10 + adds r2, r3, r1 + adds r2, r4, r2 + str r2, [sp, 0x8] + ldr r0, [r5] + mov r2, r9 + lsls r1, r2, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldr r2, [sp, 0x8] + strh r0, [r2] + add r3, r8 + adds r4, r3 + ldr r0, [r5] + adds r1, r0 + adds r1, 0x48 + ldrh r0, [r1] + strh r0, [r4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xB + bls _081510CC + ldr r4, [sp, 0x4] + lsls r0, r4, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _081510AA + ldrb r0, [r6, 0x1B] + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + strb r0, [r6, 0x1B] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08151154: .4byte 0x0203abac +_08151158: .4byte 0x000040fc + thumb_func_end sub_8151088 + + thumb_func_start sub_815115C +sub_815115C: @ 815115C + push {r4,r5,lr} + ldr r5, _081511B4 + ldr r4, [r5] + ldrb r0, [r4, 0x1C] + adds r0, 0x1 + movs r1, 0x60 + bl __modsi3 + strb r0, [r4, 0x1C] + ldr r1, [r5] + ldrb r0, [r1, 0x1F] + ldrb r2, [r1, 0x1D] + subs r0, r2 + strb r0, [r1, 0x8] + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + ldrb r1, [r2, 0x1E] + subs r0, r1 + strb r0, [r2, 0x9] + ldr r1, [r5] + ldrb r0, [r1, 0x1D] + adds r0, 0x1 + strb r0, [r1, 0x1D] + ldr r2, [r5] + ldrb r0, [r2, 0x1D] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081511A0 + ldrb r0, [r2, 0x1E] + adds r0, 0x1 + strb r0, [r2, 0x1E] +_081511A0: + ldr r0, [r5] + ldrb r0, [r0, 0x1D] + cmp r0, 0x10 + bls _081511AC + bl sub_8151214 +_081511AC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081511B4: .4byte 0x0203abac + thumb_func_end sub_815115C + + thumb_func_start sub_81511B8 +sub_81511B8: @ 81511B8 + push {r4,r5,lr} + ldr r5, _08151210 + ldr r4, [r5] + ldrb r0, [r4, 0x1C] + adds r0, 0x1 + movs r1, 0x60 + bl __modsi3 + strb r0, [r4, 0x1C] + ldr r1, [r5] + ldrb r0, [r1, 0x1D] + ldrb r2, [r1, 0x1F] + adds r0, r2 + strb r0, [r1, 0x8] + ldr r1, [r5] + adds r2, r1, 0 + adds r2, 0x20 + ldrb r0, [r1, 0x1E] + ldrb r2, [r2] + adds r0, r2 + strb r0, [r1, 0x9] + ldr r1, [r5] + ldrb r0, [r1, 0x1D] + adds r0, 0x1 + strb r0, [r1, 0x1D] + ldr r2, [r5] + ldrb r0, [r2, 0x1D] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081511FC + ldrb r0, [r2, 0x1E] + adds r0, 0x1 + strb r0, [r2, 0x1E] +_081511FC: + ldr r0, [r5] + ldrb r0, [r0, 0x1D] + cmp r0, 0x10 + bls _08151208 + bl sub_8151388 +_08151208: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08151210: .4byte 0x0203abac + thumb_func_end sub_81511B8 + + thumb_func_start sub_8151214 +sub_8151214: @ 8151214 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r7, 0 + ldr r3, _08151378 + ldr r0, [r3] + strb r7, [r0, 0x1E] + strb r7, [r0, 0x1D] + ldr r1, [r3] + ldrb r0, [r1, 0x8] + strb r0, [r1, 0x1F] + ldr r0, [r3] + ldrb r1, [r0, 0x9] + adds r0, 0x20 + strb r1, [r0] + ldr r4, [r3] + ldrb r1, [r4, 0x19] + adds r2, r1, 0 + adds r2, 0x1E + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r4, 0x19] + ldr r1, [r3] + ldrb r0, [r1, 0x18] + subs r0, 0x2 + strb r0, [r1, 0x18] + ldr r4, _0815137C + ldr r0, [r3] + ldrb r1, [r0, 0x1A] + adds r2, r1, 0 + adds r2, 0x17 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r4] + ldr r6, _08151380 + mov r9, r3 + ldr r0, _08151384 + mov r8, r0 +_0815126E: + mov r1, r9 + ldr r2, [r1] + ldrb r0, [r2, 0x19] + strb r0, [r6] + ldr r0, _0815137C + ldrb r0, [r0] + adds r1, r0, r7 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + mov r1, r8 + strb r0, [r1] + ldrb r1, [r2, 0x18] + lsls r1, 1 + lsls r0, r7, 1 + adds r0, r7 + lsls r5, r0, 3 + adds r1, r5 + adds r0, r2, 0 + adds r0, 0x22 + adds r0, r1 + ldrh r1, [r0] + ldrb r2, [r6] + mov r0, r8 + ldrb r3, [r0] + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + mov r10, r0 + str r0, [sp, 0x8] + movs r0, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r1, [r6] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r6] + mov r0, r9 + ldr r1, [r0] + ldrb r0, [r1, 0x18] + adds r0, 0x1 + lsls r0, 1 + adds r0, r5 + adds r1, 0x22 + adds r1, r0 + ldrh r1, [r1] + ldrb r2, [r6] + mov r0, r8 + ldrb r3, [r0] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + movs r0, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x8 + bls _0815126E + ldr r5, _08151380 + ldr r4, _08151378 + ldr r0, [r4] + ldrb r1, [r0, 0x19] + adds r2, r1, 0 + adds r2, 0x1E + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r5] + ldrb r2, [r5] + movs r0, 0x2 + str r0, [sp] + movs r6, 0x20 + str r6, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, [r4] + ldrb r0, [r1, 0x18] + cmp r0, 0 + bne _08151368 + ldrb r2, [r1, 0x1A] + adds r3, r2, 0 + adds r3, 0x1D + adds r0, r3, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r3, r0 + strb r0, [r1, 0x1A] + ldr r1, [r4] + movs r0, 0xC + strb r0, [r1, 0x18] + bl sub_8151088 + ldr r0, [r4] + ldrb r1, [r0, 0x1A] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r5] + ldrb r3, [r5] + str r6, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette +_08151368: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08151378: .4byte 0x0203abac +_0815137C: .4byte 0x0203abb2 +_08151380: .4byte 0x0203abb0 +_08151384: .4byte 0x0203abb1 + thumb_func_end sub_8151214 + + thumb_func_start sub_8151388 +sub_8151388: @ 8151388 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r7, 0 + ldr r2, _081514B8 + ldr r0, [r2] + strb r7, [r0, 0x1E] + strb r7, [r0, 0x1D] + ldr r1, [r2] + ldrb r0, [r1, 0x8] + strb r0, [r1, 0x1F] + ldr r0, [r2] + ldrb r1, [r0, 0x9] + adds r0, 0x20 + strb r1, [r0] + ldr r4, [r2] + ldrb r1, [r4, 0x19] + adds r3, r1, 0x2 + adds r0, r3, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r3, r0 + strb r0, [r4, 0x19] + ldr r1, [r2] + ldrb r0, [r1, 0x18] + adds r0, 0x2 + strb r0, [r1, 0x18] + ldr r1, _081514BC + ldr r0, [r2] + ldrb r0, [r0, 0x1A] + strb r0, [r1] + ldr r6, _081514C0 + mov r10, r2 + ldr r0, _081514C4 + mov r9, r0 +_081513D4: + mov r1, r10 + ldr r2, [r1] + ldrb r0, [r2, 0x19] + strb r0, [r6] + ldr r0, _081514BC + ldrb r0, [r0] + adds r1, r0, r7 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + mov r1, r9 + strb r0, [r1] + ldrb r1, [r2, 0x18] + lsls r1, 1 + lsls r0, r7, 1 + adds r0, r7 + lsls r5, r0, 3 + adds r1, r5 + adds r0, r2, 0 + adds r0, 0x22 + adds r0, r1 + ldrh r1, [r0] + ldrb r2, [r6] + mov r0, r9 + ldrb r3, [r0] + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + mov r8, r0 + str r0, [sp, 0x8] + movs r0, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldrb r1, [r6] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r6] + mov r0, r10 + ldr r1, [r0] + ldrb r0, [r1, 0x18] + adds r0, 0x1 + lsls r0, 1 + adds r0, r5 + adds r1, 0x22 + adds r1, r0 + ldrh r1, [r1] + ldrb r2, [r6] + mov r0, r9 + ldrb r3, [r0] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + movs r0, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x8 + bls _081513D4 + ldr r4, _081514C4 + ldr r5, _081514B8 + ldr r3, [r5] + ldrb r1, [r3, 0x1A] + adds r2, r1, 0 + adds r2, 0x17 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r4] + ldrb r2, [r3, 0x19] + ldrb r3, [r4] + movs r0, 0x2 + str r0, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, [r5] + ldrb r0, [r1, 0x18] + cmp r0, 0xA + bne _081514A6 + ldrb r2, [r1, 0x1A] + adds r3, r2, 0x3 + adds r0, r3, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r3, r0 + strb r0, [r1, 0x1A] + ldr r1, [r5] + movs r0, 0xFE + strb r0, [r1, 0x18] + bl sub_8151088 +_081514A6: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081514B8: .4byte 0x0203abac +_081514BC: .4byte 0x0203abb5 +_081514C0: .4byte 0x0203abb3 +_081514C4: .4byte 0x0203abb4 + thumb_func_end sub_8151388 + + thumb_func_start sub_81514C8 +sub_81514C8: @ 81514C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081514D6 + cmp r0, 0x1 + beq _08151500 +_081514D6: + ldr r1, _081514FC + ldr r2, [r1] + movs r3, 0 + movs r0, 0x2 + strb r0, [r2, 0x1B] + ldr r0, [r1] + strb r3, [r0, 0x19] + ldr r2, [r1] + movs r0, 0x14 + strb r0, [r2, 0x1A] + ldr r1, [r1] + movs r0, 0xC + strb r0, [r1, 0x18] + bl sub_8151088 + bl sub_8151214 + b _08151522 + .align 2, 0 +_081514FC: .4byte 0x0203abac +_08151500: + ldr r1, _08151530 + ldr r2, [r1] + movs r0, 0x2 + strb r0, [r2, 0x1B] + ldr r2, [r1] + movs r0, 0x1C + strb r0, [r2, 0x19] + ldr r2, [r1] + movs r0, 0x14 + strb r0, [r2, 0x1A] + ldr r1, [r1] + movs r0, 0x4 + strb r0, [r1, 0x18] + bl sub_8151088 + bl sub_8151388 +_08151522: + ldr r0, _08151530 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x1C] + pop {r0} + bx r0 + .align 2, 0 +_08151530: .4byte 0x0203abac + thumb_func_end sub_81514C8 + + thumb_func_start sub_8151534 +sub_8151534: @ 8151534 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + muls r0, r1 + adds r1, r0, 0 + cmp r0, 0 + bge _08151548 + adds r1, 0xFF +_08151548: + lsls r0, r1, 8 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8151534 + + thumb_func_start sub_8151550 +sub_8151550: @ 8151550 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + muls r3, r2 + movs r1, 0x1 + lsls r1, r0 + adds r0, r3, 0 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8151550 + + thumb_func_start sub_8151574 +sub_8151574: @ 8151574 + push {r4-r7,lr} + adds r2, r1, 0 + adds r4, r0, 0 + asrs r5, r0, 31 + asrs r3, r2, 31 + adds r1, r5, 0 + adds r0, r4, 0 + bl __muldi3 + adds r5, r1, 0 + adds r4, r0, 0 + adds r7, r5, 0 + adds r6, r4, 0 + cmp r5, 0 + bge _0815159A + movs r6, 0xFF + movs r7, 0 + adds r6, r4 + adcs r7, r5 +_0815159A: + lsls r3, r7, 24 + lsrs r2, r6, 8 + adds r0, r3, 0 + orrs r0, r2 + asrs r1, r7, 8 + adds r5, r1, 0 + adds r4, r0, 0 + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8151574 + + thumb_func_start sub_81515B0 +sub_81515B0: @ 81515B0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + beq _081515CC + lsls r0, 16 + asrs r0, 8 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + b _081515CE +_081515CC: + movs r0, 0 +_081515CE: + pop {r1} + bx r1 + thumb_func_end sub_81515B0 + + thumb_func_start sub_81515D4 +sub_81515D4: @ 81515D4 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + asrs r1, r2, 16 + cmp r1, 0 + beq _081515F6 + lsls r0, 16 + asrs r0, 16 + lsls r0, r3 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + b _081515F8 +_081515F6: + movs r0, 0 +_081515F8: + pop {r1} + bx r1 + thumb_func_end sub_81515D4 + + thumb_func_start sub_81515FC +sub_81515FC: @ 81515FC + push {r4-r6,lr} + adds r6, r1, 0 + cmp r6, 0 + beq _0815161C + adds r2, r0, 0 + asrs r3, r0, 31 + lsrs r5, r2, 24 + lsls r4, r3, 8 + adds r1, r5, 0 + orrs r1, r4 + lsls r0, r2, 8 + adds r2, r6, 0 + asrs r3, r6, 31 + bl __divdi3 + b _0815161E +_0815161C: + movs r0, 0 +_0815161E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81515FC + + thumb_func_start sub_8151624 +sub_8151624: @ 8151624 + push {lr} + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 9 + lsls r1, 16 + asrs r1, 16 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8151624 + + thumb_func_start sub_815163C +sub_815163C: @ 815163C + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + lsls r2, r0 + lsls r1, 16 + asrs r1, 16 + adds r0, r2, 0 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_815163C + + thumb_func_start sub_815165C +sub_815165C: @ 815165C + push {lr} + adds r2, r0, 0 + ldr r1, _08151674 + ldr r0, _08151670 + asrs r3, r2, 31 + bl __divdi3 + pop {r1} + bx r1 + .align 2, 0 +_08151670: .4byte 0x00010000 +_08151674: .4byte 0x00000000 + thumb_func_end sub_815165C + + thumb_func_start sub_8151678 +sub_8151678: @ 8151678 + push {lr} + movs r1, 0 + strb r1, [r0] + strh r1, [r0, 0x2] + adds r0, 0x4 + movs r2, 0xC0 + bl memset + pop {r0} + bx r0 + thumb_func_end sub_8151678 + + thumb_func_start sub_815168C +sub_815168C: @ 815168C + push {r4-r7,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r6, 0xF + bhi _081516A8 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r5, r3, r0 + ldrb r7, [r5, 0x4] + lsrs r0, r7, 7 + cmp r0, 0 + beq _081516AC +_081516A8: + movs r0, 0xFF + b _0815170A +_081516AC: + ldrh r0, [r2] + movs r4, 0 + strh r0, [r5, 0x8] + ldrh r0, [r2, 0x2] + strh r0, [r5, 0xA] + ldrb r0, [r2, 0x4] + strb r0, [r5, 0xC] + ldrb r0, [r2, 0x5] + strb r0, [r5, 0xD] + ldrb r0, [r2, 0x6] + strb r0, [r5, 0xE] + ldrb r3, [r2, 0x7] + lsls r0, r3, 27 + lsrs r0, 27 + ldrb r2, [r5, 0xF] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + movs r0, 0x60 + ands r0, r3 + movs r2, 0x61 + negs r2, r2 + ands r1, r2 + orrs r1, r0 + lsls r3, 24 + asrs r3, 31 + lsls r3, 7 + movs r0, 0x7F + ands r1, r0 + orrs r1, r3 + strb r1, [r5, 0xF] + subs r0, 0xFF + ands r0, r7 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r5, 0x4] + strb r4, [r5, 0x6] + strb r4, [r5, 0x5] + lsls r1, 24 + cmp r1, 0 + bge _08151704 + movs r0, 0xFF + b _08151706 +_08151704: + movs r0, 0x1 +_08151706: + strb r0, [r5, 0x7] + adds r0, r6, 0 +_0815170A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_815168C + + thumb_func_start sub_8151710 +sub_8151710: @ 8151710 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r4, r1, 0 + cmp r4, 0xF + bhi _0815173C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r1, r2, r0 + ldrb r0, [r1, 0x4] + lsrs r0, 7 + cmp r0, 0 + beq _0815173C + adds r0, r1, 0x4 + movs r1, 0 + movs r2, 0xC + bl memset + adds r0, r4, 0 + b _0815173E +_0815173C: + movs r0, 0xFF +_0815173E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8151710 + + thumb_func_start sub_8151744 +sub_8151744: @ 8151744 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + movs r0, 0 + mov r12, r0 + ldrb r1, [r5, 0x8] + cmp r12, r1 + bcc _0815175C + b _081518F4 +_0815175C: + movs r7, 0x1F + ldr r0, _0815178C + mov r10, r0 + movs r1, 0x7D + negs r1, r1 + mov r9, r1 + movs r0, 0x1F + mov r8, r0 +_0815176C: + ldrh r0, [r5, 0x6] + add r0, r12 + lsls r0, 1 + ldr r1, _08151790 + adds r3, r0, r1 + ldr r1, _08151794 + adds r6, r0, r1 + ldrb r0, [r5] + lsls r0, 25 + lsrs r0, 25 + cmp r0, 0x1 + beq _08151798 + cmp r0, 0x2 + beq _081517F6 + b _081518E2 + .align 2, 0 +_0815178C: .4byte 0xfffffc1f +_08151790: .4byte 0x02037b14 +_08151794: .4byte 0x02037714 +_08151798: + ldr r0, [r3] + lsls r2, r0, 27 + lsrs r0, r2, 27 + movs r1, 0x3 + ldrsb r1, [r5, r1] + adds r0, r1 + cmp r0, 0x1F + bhi _081517BA + lsrs r0, r2, 27 + adds r0, r1 + ands r0, r7 + ldrb r2, [r3] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_081517BA: + ldr r0, [r3] + lsls r2, r0, 22 + lsrs r0, r2, 27 + movs r1, 0x3 + ldrsb r1, [r5, r1] + adds r0, r1 + cmp r0, 0x1F + bhi _081517DE + lsrs r0, r2, 27 + adds r0, r1 + mov r1, r8 + ands r0, r1 + lsls r0, 5 + ldrh r2, [r3] + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strh r1, [r3] +_081517DE: + ldr r0, [r3] + lsls r2, r0, 17 + lsrs r0, r2, 27 + movs r1, 0x3 + ldrsb r1, [r5, r1] + adds r0, r1 + cmp r0, 0x1F + bls _081517F0 + b _081518E2 +_081517F0: + lsrs r0, r2, 27 + adds r0, r1 + b _081518D4 +_081517F6: + movs r0, 0x3 + ldrsb r0, [r5, r0] + cmp r0, 0 + bge _08151868 + ldr r0, [r3] + lsls r4, r0, 27 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + blt _08151826 + lsrs r0, r4, 27 + adds r0, r2 + ands r0, r7 + ldrb r2, [r3] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_08151826: + ldr r0, [r3] + lsls r4, r0, 22 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 22 + lsrs r0, 27 + cmp r1, r0 + blt _08151850 + lsrs r0, r4, 27 + adds r0, r2 + mov r1, r8 + ands r0, r1 + lsls r0, 5 + ldrh r2, [r3] + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strh r1, [r3] +_08151850: + ldr r0, [r3] + lsls r4, r0, 17 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 17 + lsrs r0, 27 + cmp r1, r0 + blt _081518E2 + b _081518D0 +_08151868: + ldr r0, [r3] + lsls r4, r0, 27 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + bgt _08151890 + lsrs r0, r4, 27 + adds r0, r2 + ands r0, r7 + ldrb r2, [r3] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_08151890: + ldr r0, [r3] + lsls r4, r0, 22 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 22 + lsrs r0, 27 + cmp r1, r0 + bgt _081518BA + lsrs r0, r4, 27 + adds r0, r2 + mov r1, r8 + ands r0, r1 + lsls r0, 5 + ldrh r2, [r3] + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strh r1, [r3] +_081518BA: + ldr r0, [r3] + lsls r4, r0, 17 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 17 + lsrs r0, 27 + cmp r1, r0 + bgt _081518E2 +_081518D0: + lsrs r0, r4, 27 + adds r0, r2 +_081518D4: + ands r0, r7 + lsls r0, 2 + ldrb r2, [r3, 0x1] + mov r1, r9 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] +_081518E2: + mov r0, r12 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldrb r0, [r5, 0x8] + cmp r12, r0 + bcs _081518F4 + b _0815176C +_081518F4: + ldrb r1, [r5, 0x2] + adds r0, r1, 0x1 + strb r0, [r5, 0x2] + ldrb r0, [r5, 0xB] + lsls r0, 27 + lsls r1, 24 + asrs r0, 3 + cmp r1, r0 + beq _0815190A + movs r0, 0 + b _0815193E +_0815190A: + movs r0, 0 + strb r0, [r5, 0x2] + movs r0, 0x3 + ldrsb r0, [r5, r0] + negs r0, r0 + strb r0, [r5, 0x3] + ldrb r2, [r5] + movs r1, 0x7F + movs r0, 0x7F + ands r0, r2 + cmp r0, 0x1 + bne _0815192A + lsls r0, r2, 25 + lsrs r0, 25 + adds r0, 0x1 + b _08151930 +_0815192A: + lsls r0, r2, 25 + lsrs r0, 25 + subs r0, 0x1 +_08151930: + ands r0, r1 + movs r1, 0x80 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5] + movs r0, 0x1 +_0815193E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8151744 + + thumb_func_start sub_815194C +sub_815194C: @ 815194C + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + ldrb r0, [r3] + lsls r0, 25 + lsrs r0, 25 + cmp r0, 0x1 + beq _08151962 + cmp r0, 0x2 + beq _08151990 + b _081519CA +_08151962: + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcs _08151982 + ldr r4, _0815198C +_0815196A: + ldrh r0, [r3, 0x6] + adds r0, r2 + lsls r0, 1 + adds r0, r4 + ldrh r1, [r3, 0x4] + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcc _0815196A +_08151982: + ldrb r2, [r3] + lsls r1, r2, 25 + lsrs r1, 25 + adds r1, 0x1 + b _081519BC + .align 2, 0 +_0815198C: .4byte 0x02037b14 +_08151990: + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcs _081519B4 + ldr r5, _081519D4 + ldr r4, _081519D8 +_0815199A: + ldrh r0, [r3, 0x6] + adds r0, r2 + lsls r0, 1 + adds r1, r0, r5 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcc _0815199A +_081519B4: + ldrb r2, [r3] + lsls r1, r2, 25 + lsrs r1, 25 + subs r1, 0x1 +_081519BC: + movs r0, 0x7F + ands r1, r0 + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081519CA: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081519D4: .4byte 0x02037b14 +_081519D8: .4byte 0x02037714 + thumb_func_end sub_815194C + + thumb_func_start task_tutorial_controls_fadein +task_tutorial_controls_fadein: @ 81519DC + push {r4-r6,lr} + adds r4, r0, 0 + movs r5, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _08151A40 +_081519E8: + ldrh r0, [r4, 0x2] + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08151A36 + lsls r1, r5, 1 + adds r0, r1, r5 + lsls r3, r0, 2 + adds r2, r4, r3 + ldrb r0, [r2, 0x5] + subs r0, 0x1 + strb r0, [r2, 0x5] + lsls r0, 24 + lsrs r0, 24 + adds r6, r1, 0 + cmp r0, 0xFF + bne _08151A36 + ldrh r0, [r2, 0x8] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08151A24 + adds r0, r3, 0x4 + adds r0, r4, r0 + bl sub_8151744 + b _08151A2C +_08151A24: + adds r0, r3, 0x4 + adds r0, r4, r0 + bl sub_815194C +_08151A2C: + adds r0, r6, r5 + lsls r0, 2 + adds r0, r4, r0 + ldrb r1, [r0, 0xD] + strb r1, [r0, 0x5] +_08151A36: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _081519E8 +_08151A40: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task_tutorial_controls_fadein + + thumb_func_start sub_8151A48 +sub_8151A48: @ 8151A48 + push {r4-r7,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + movs r4, 0 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + movs r5, 0x1 + movs r7, 0x80 + negs r7, r7 +_08151A5E: + adds r0, r6, 0 + asrs r0, r4 + ands r0, r5 + cmp r0, 0 + beq _08151A8C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r3, r0 + ldrb r0, [r2, 0x4] + lsrs r0, 7 + cmp r0, 0 + beq _08151A8C + adds r0, r5, 0 + lsls r0, r4 + ldrh r1, [r3, 0x2] + orrs r0, r1 + strh r0, [r3, 0x2] + ldrb r1, [r2, 0x4] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r5 + strb r0, [r2, 0x4] +_08151A8C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08151A5E + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8151A48 + + thumb_func_start sub_8151A9C +sub_8151A9C: @ 8151A9C + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r5, 0 + movs r3, 0x1 +_08151AAA: + ldrh r0, [r6, 0x2] + asrs r0, r5 + ands r0, r3 + cmp r0, 0 + beq _08151B12 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r4, r6, r0 + ldrb r0, [r4, 0x4] + lsrs r0, 7 + cmp r0, 0 + beq _08151B12 + adds r0, r7, 0 + asrs r0, r5 + ands r0, r3 + cmp r0, 0 + beq _08151B12 + ldrh r1, [r4, 0xA] + lsls r1, 1 + ldr r0, _08151B08 + adds r0, r1, r0 + ldr r2, _08151B0C + adds r1, r2 + ldrb r2, [r4, 0xC] + lsls r2, 1 + str r3, [sp] + bl memcpy + ldrb r0, [r4, 0x4] + movs r2, 0x80 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r4, 0x4] + movs r0, 0 + strb r0, [r4, 0x6] + strb r0, [r4, 0x5] + ldrb r0, [r4, 0xF] + lsls r0, 24 + ldr r3, [sp] + cmp r0, 0 + bge _08151B10 + movs r0, 0xFF + strb r0, [r4, 0x7] + b _08151B12 + .align 2, 0 +_08151B08: .4byte 0x02037b14 +_08151B0C: .4byte 0x02037714 +_08151B10: + strb r3, [r4, 0x7] +_08151B12: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _08151AAA + ldr r0, _08151B28 + cmp r7, r0 + bne _08151B2C + movs r0, 0 + strb r0, [r6] + b _08151B30 + .align 2, 0 +_08151B28: .4byte 0x0000ffff +_08151B2C: + ldrh r0, [r6, 0x2] + bics r0, r7 +_08151B30: + strh r0, [r6, 0x2] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8151A9C + + thumb_func_start sub_8151B3C +sub_8151B3C: @ 8151B3C + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 + strh r4, [r5] + adds r0, r5, 0x4 + movs r1, 0 + movs r2, 0xC0 + bl memset +_08151B4E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + strb r4, [r0, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08151B4E + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8151B3C + + thumb_func_start sub_8151B68 +sub_8151B68: @ 8151B68 + push {r4,r5,lr} + adds r2, r0, 0 + adds r5, r1, 0 + movs r3, 0 + movs r4, 0 + ldrb r0, [r2, 0x5] + lsrs r0, 7 + cmp r0, 0 + bne _08151B7E + adds r4, r2, 0x4 + b _08151B9C +_08151B7E: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bhi _08151B9C + lsls r0, r3, 1 + adds r0, r3 + lsls r1, r0, 2 + adds r0, r2, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 7 + cmp r0, 0 + bne _08151B7E + adds r0, r1, 0x4 + adds r4, r2, r0 +_08151B9C: + cmp r4, 0 + beq _08151BCA + ldrb r1, [r4, 0x1] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0 + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + adds r1, r4, 0x4 + adds r0, r5, 0 + ldm r0!, {r2,r4} + stm r1!, {r2,r4} + adds r0, r3, 0 + b _08151BCC +_08151BCA: + movs r0, 0xFF +_08151BCC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8151B68 + + thumb_func_start sub_8151BD4 +sub_8151BD4: @ 8151BD4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08151C16 + ldrb r1, [r4, 0xB] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08151C16 + ldrh r2, [r4, 0x6] + ldrb r0, [r4, 0x8] + adds r0, r2, r0 + cmp r2, r0 + bge _08151C16 + ldr r5, _08151C48 + ldr r3, _08151C4C +_08151BFC: + lsls r0, r2, 1 + adds r1, r0, r5 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4, 0x6] + ldrb r1, [r4, 0x8] + adds r0, r1 + cmp r2, r0 + blt _08151BFC +_08151C16: + adds r0, r4, 0x4 + movs r1, 0 + movs r2, 0x8 + bl memset + ldrb r1, [r4, 0x1] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + subs r1, 0x10 + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + movs r1, 0x7F + ands r0, r1 + strb r0, [r4, 0x1] + movs r0, 0 + strb r0, [r4, 0x3] + strb r0, [r4, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08151C48: .4byte 0x02037b14 +_08151C4C: .4byte 0x02037714 + thumb_func_end sub_8151BD4 + + thumb_func_start sub_8151C50 +sub_8151C50: @ 8151C50 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + movs r5, 0 + cmp r2, 0 + bne _08151C74 + movs r1, 0xF + ands r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x4 + adds r0, r6, r0 + bl sub_8151BD4 + b _08151CA0 +_08151C74: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08151C94 + lsls r0, r5, 1 + adds r0, r5 + lsls r1, r0, 2 + adds r0, r6, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 7 + cmp r0, 0 + beq _08151C94 + adds r0, r1, 0x4 + adds r0, r6, r0 + bl sub_8151BD4 +_08151C94: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _08151C74 +_08151CA0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8151C50 + + thumb_func_start sub_8151CA8 +sub_8151CA8: @ 8151CA8 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + movs r3, 0 + cmp r2, 0 + bne _08151CDC + movs r0, 0xF + adds r3, r0, 0 + ands r3, r4 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r5, r1 + ldrb r2, [r1, 0x5] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x1 + lsls r0, r3 + ldrh r1, [r5] + orrs r0, r1 + strh r0, [r5] + b _08151D20 +_08151CDC: + movs r6, 0x1 + movs r7, 0x41 + negs r7, r7 +_08151CE2: + adds r0, r4, 0 + ands r0, r6 + cmp r0, 0 + beq _08151D00 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r5, r0 + ldrb r1, [r2, 0x5] + lsrs r0, r1, 7 + cmp r0, 0 + beq _08151D00 + lsls r0, r1, 25 + cmp r0, 0 + blt _08151D06 +_08151D00: + lsls r0, r4, 17 + lsrs r4, r0, 16 + b _08151D16 +_08151D06: + adds r0, r7, 0 + ands r0, r1 + strb r0, [r2, 0x5] + adds r0, r6, 0 + lsls r0, r3 + ldrh r1, [r5] + orrs r0, r1 + strh r0, [r5] +_08151D16: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _08151CE2 +_08151D20: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8151CA8 + + thumb_func_start sub_8151D28 +sub_8151D28: @ 8151D28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + movs r0, 0 + mov r12, r0 + cmp r2, 0 + bne _08151DB0 + movs r1, 0xF + ands r1, r7 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x4 + mov r1, r8 + adds r3, r1, r0 + ldrb r1, [r3, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _08151E3A + ldrb r1, [r3, 0xB] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08151D8E + ldrh r2, [r3, 0x6] + ldrb r0, [r3, 0x8] + adds r0, r2, r0 + cmp r2, r0 + bge _08151D8E + ldr r5, _08151DA8 + ldr r4, _08151DAC +_08151D74: + lsls r0, r2, 1 + adds r1, r0, r5 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r3, 0x6] + ldrb r1, [r3, 0x8] + adds r0, r1 + cmp r2, r0 + blt _08151D74 +_08151D8E: + ldrb r0, [r3, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r3, 0x1] + movs r1, 0x1 + mov r2, r12 + lsls r1, r2 + mov r2, r8 + ldrh r0, [r2] + bics r0, r1 + strh r0, [r2] + b _08151E3A + .align 2, 0 +_08151DA8: .4byte 0x02037b14 +_08151DAC: .4byte 0x02037714 +_08151DB0: + movs r0, 0x1 + mov r9, r0 + movs r1, 0x40 + mov r10, r1 +_08151DB8: + mov r2, r12 + lsls r0, r2, 1 + add r0, r12 + lsls r0, 2 + adds r0, 0x4 + mov r1, r8 + adds r3, r1, r0 + adds r0, r7, 0 + mov r2, r9 + ands r0, r2 + cmp r0, 0 + beq _08151DDA + ldrb r1, [r3, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + beq _08151DE4 +_08151DDA: + lsls r0, r7, 17 + lsrs r7, r0, 16 + mov r5, r12 + adds r5, 0x1 + b _08151E30 +_08151DE4: + ldrb r1, [r3, 0xB] + mov r0, r10 + ands r0, r1 + mov r5, r12 + adds r5, 0x1 + cmp r0, 0 + beq _08151E1A + ldrh r2, [r3, 0x6] + ldrb r0, [r3, 0x8] + adds r0, r2, r0 + cmp r2, r0 + bge _08151E1A + ldr r6, _08151E48 + ldr r4, _08151E4C +_08151E00: + lsls r0, r2, 1 + adds r1, r0, r6 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r3, 0x6] + ldrb r1, [r3, 0x8] + adds r0, r1 + cmp r2, r0 + blt _08151E00 +_08151E1A: + ldrb r1, [r3, 0x1] + mov r0, r10 + orrs r0, r1 + strb r0, [r3, 0x1] + mov r1, r9 + mov r0, r12 + lsls r1, r0 + mov r2, r8 + ldrh r0, [r2] + bics r0, r1 + strh r0, [r2] +_08151E30: + lsls r0, r5, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0xF + bls _08151DB8 +_08151E3A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08151E48: .4byte 0x02037b14 +_08151E4C: .4byte 0x02037714 + thumb_func_end sub_8151D28 + + thumb_func_start sub_8151E50 +sub_8151E50: @ 8151E50 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + movs r0, 0 + mov r10, r0 + ldr r1, [sp] + ldrh r0, [r1] + cmp r0, 0 + bne _08151E6C + b _08151FF6 +_08151E6C: + movs r2, 0xF + mov r9, r2 + movs r3, 0x10 + negs r3, r3 + mov r8, r3 + movs r7, 0x1 +_08151E78: + mov r5, r10 + lsls r0, r5, 1 + add r0, r10 + lsls r0, 2 + adds r0, 0x4 + ldr r1, [sp] + adds r4, r1, r0 + ldrb r2, [r4, 0x1] + movs r3, 0xC0 + ands r3, r2 + cmp r3, 0x80 + beq _08151E92 + b _08151FE6 +_08151E92: + ldr r0, _08151EE0 + ldrb r1, [r0, 0x7] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08151EA8 + ldrb r0, [r4, 0xB] + ands r3, r0 + cmp r3, 0 + beq _08151EA8 + b _08151FE6 +_08151EA8: + ldrb r0, [r4, 0x2] + subs r0, 0x1 + strb r0, [r4, 0x2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08151EB8 + b _08151FE6 +_08151EB8: + ldrb r0, [r4, 0x9] + strb r0, [r4, 0x2] + ldrh r0, [r4, 0x6] + ldrb r1, [r4, 0x8] + lsls r2, 28 + lsrs r2, 28 + ldrh r3, [r4, 0x4] + bl pal_fade_1 + ldrb r5, [r4, 0xB] + lsls r0, r5, 26 + asrs r0, 30 + cmp r0, 0x1 + beq _08151F16 + cmp r0, 0x1 + bgt _08151EE4 + cmp r0, 0 + beq _08151EEA + b _08151FD0 + .align 2, 0 +_08151EE0: .4byte 0x02037fd4 +_08151EE4: + cmp r0, 0x2 + beq _08151F92 + b _08151FD0 +_08151EEA: + ldrb r2, [r4, 0x1] + lsls r1, r2, 28 + lsrs r0, r1, 28 + adds r0, 0x1 + mov r3, r9 + ands r0, r3 + mov r6, r8 + adds r3, r6, 0 + ands r3, r2 + orrs r3, r0 + strb r3, [r4, 0x1] + lsrs r1, 28 + lsls r0, r5, 28 + asrs r0, 28 + cmp r1, r0 + bne _08151FD0 + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] + ands r3, r6 + strb r3, [r4, 0x1] + b _08151FD0 +_08151F16: + ldrb r3, [r4, 0x1] + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _08151F54 + lsls r0, r3, 28 + lsrs r0, 28 + subs r0, 0x1 + mov r5, r9 + ands r0, r5 + mov r2, r8 + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0x1] + cmp r0, 0 + bne _08151FD0 + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] + lsls r0, r2, 27 + lsrs r0, 31 + eors r0, r7 + ands r0, r7 + lsls r0, 4 + movs r3, 0x11 + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0x1] + b _08151FD0 +_08151F54: + lsls r0, r5, 28 + asrs r0, 28 + subs r0, 0x1 + mov r5, r9 + ands r0, r5 + lsls r2, r3, 28 + lsrs r1, r2, 28 + adds r1, 0x1 + ands r1, r5 + mov r5, r8 + ands r3, r5 + orrs r3, r1 + strb r3, [r4, 0x1] + lsrs r2, 28 + cmp r2, r0 + bne _08151FD0 + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] + lsls r0, r3, 27 + lsrs r0, 31 + eors r0, r7 + ands r0, r7 + lsls r0, 4 + movs r2, 0x11 + negs r2, r2 + adds r1, r2, 0 + ands r3, r1 + orrs r3, r0 + strb r3, [r4, 0x1] + b _08151FD0 +_08151F92: + ldrb r2, [r4, 0x1] + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _08151FA2 + mov r0, r8 + ands r0, r2 + b _08151FB0 +_08151FA2: + lsls r1, r5, 28 + asrs r1, 28 + mov r3, r9 + ands r1, r3 + mov r0, r8 + ands r0, r2 + orrs r0, r1 +_08151FB0: + strb r0, [r4, 0x1] + ldrb r2, [r4, 0x1] + lsls r0, r2, 27 + lsrs r0, 31 + eors r0, r7 + ands r0, r7 + lsls r0, 4 + movs r5, 0x11 + negs r5, r5 + adds r1, r5, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0x1] + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] +_08151FD0: + ldrb r1, [r4, 0xA] + cmp r1, 0xFF + beq _08151FE6 + ldrb r0, [r4, 0x3] + cmp r0, r1 + bne _08151FE6 + ldrb r1, [r4] + ldr r0, [sp] + movs r2, 0 + bl sub_8151D28 +_08151FE6: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0xF + bhi _08151FF6 + b _08151E78 +_08151FF6: + 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_8151E50 + + thumb_func_start sub_8152008 +sub_8152008: @ 8152008 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [sp, 0x14] + ldr r4, [sp, 0x18] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + lsrs r3, 19 + adds r3, r2 + lsls r3, 1 + adds r6, r3 + cmp r1, r4 + bcs _08152052 +_08152030: + lsls r0, r1, 6 + adds r2, r6, r0 + movs r0, 0 + adds r3, r1, 0x1 + cmp r0, r5 + bcs _0815204A +_0815203C: + strh r7, [r2] + adds r2, 0x2 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bcc _0815203C +_0815204A: + lsls r0, r3, 24 + lsrs r1, r0, 24 + cmp r1, r4 + bcc _08152030 +_08152052: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8152008 + + thumb_func_start sub_8152058 +sub_8152058: @ 8152058 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, [sp, 0x14] + ldr r4, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r6, r4, 24 + movs r4, 0 + lsrs r3, 19 + adds r3, r2 + lsls r3, 1 + adds r7, r3 + cmp r4, r6 + bcs _081520A2 +_0815207C: + lsls r0, r4, 6 + adds r2, r7, r0 + movs r3, 0 + adds r4, 0x1 + cmp r3, r5 + bcs _0815209A +_08152088: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _08152088 +_0815209A: + lsls r0, r4, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0815207C +_081520A2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8152058 + + thumb_func_start sub_81520A8 +sub_81520A8: @ 81520A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + ldr r0, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + movs r0, 0 + lsrs r4, r3, 24 + cmp r0, r8 + bcs _08152122 +_081520DA: + ldr r2, [sp] + movs r3, 0 + adds r6, r4, 0x1 + adds r0, 0x1 + mov r12, r0 + cmp r3, r7 + bcs _0815210C + lsls r5, r4, 6 +_081520EA: + lsls r0, r2, 1 + adds r0, r5 + add r0, r10 + mov r1, r9 + strh r1, [r0] + adds r1, r2, 0x1 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r7 + bcc _081520EA +_0815210C: + adds r0, r6, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r6, r0 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r12 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _081520DA +_08152122: + 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_81520A8 + + thumb_func_start sub_8152134 +sub_8152134: @ 8152134 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + ldr r0, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + movs r0, 0 + adds r5, r1, 0 + lsrs r4, r3, 24 + cmp r0, r9 + bcs _081521AE +_08152164: + ldr r2, [sp] + movs r3, 0 + adds r7, r4, 0x1 + adds r0, 0x1 + mov r8, r0 + cmp r3, r12 + bcs _08152198 + lsls r6, r4, 6 +_08152174: + lsls r0, r2, 1 + adds r0, r6 + add r0, r10 + ldrh r1, [r5] + strh r1, [r0] + adds r5, 0x2 + adds r1, r2, 0x1 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r12 + bcc _08152174 +_08152198: + adds r0, r7, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r7, r0 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, r9 + bcc _08152164 +_081521AE: + 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_8152134 + + thumb_func_start sub_81521C0 +sub_81521C0: @ 81521C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + cmp r4, 0 + beq _081521FE + cmp r4, 0x40 + bls _081521D6 + movs r4, 0x40 +_081521D6: + ldr r6, _08152204 + movs r0, 0x8 + bl malloc_and_clear + str r0, [r6] + cmp r0, 0 + beq _081521FE + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + bl malloc_and_clear + ldr r1, [r6] + str r0, [r1, 0x4] + cmp r0, 0 + bne _08152208 + adds r0, r1, 0 + bl free + str r5, [r6] +_081521FE: + movs r0, 0 + b _08152244 + .align 2, 0 +_08152204: .4byte 0x0203abb8 +_08152208: + strb r4, [r1] + cmp r5, r4 + bcs _08152242 + adds r3, r6, 0 + ldr r0, _08152250 + mov r12, r0 + movs r2, 0x4 + mov r8, r2 +_08152218: + ldr r0, [r3] + ldr r2, [r0, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 4 + adds r2, r1, r2 + mov r0, r12 + ldm r0!, {r6,r7} + stm r2!, {r6,r7} + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1, 0x19] + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x19] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r4 + bcc _08152218 +_08152242: + movs r0, 0x1 +_08152244: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08152250: .4byte 0x082ec690 + thumb_func_end sub_81521C0 + + thumb_func_start sub_8152254 +sub_8152254: @ 8152254 + push {r4-r7,lr} + movs r3, 0 + ldr r0, _08152268 + ldr r2, [r0] + adds r5, r0, 0 + cmp r2, 0 + bne _0815226C + movs r0, 0 + b _081522C4 + .align 2, 0 +_08152268: .4byte 0x0203abb8 +_0815226C: + ldrb r2, [r2] + cmp r3, r2 + bcs _08152292 + ldr r0, _081522CC + mov r12, r0 + ldr r4, _081522D0 + adds r2, r5, 0 +_0815227A: + lsls r1, r3, 3 + add r1, r12 + adds r0, r4, 0 + ldm r0!, {r6,r7} + stm r1!, {r6,r7} + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r2] + ldrb r0, [r0] + cmp r3, r0 + bcc _0815227A +_08152292: + ldr r1, [r5] + ldrb r0, [r1] + lsls r2, r0, 1 + adds r2, r0 + ldr r0, [r1, 0x4] + lsls r2, 4 + movs r1, 0 + bl memset + ldr r0, [r5] + ldr r0, [r0, 0x4] + bl free + ldr r0, [r5] + movs r4, 0 + str r4, [r0, 0x4] + movs r1, 0 + movs r2, 0x8 + bl memset + ldr r0, [r5] + bl free + str r4, [r5] + movs r0, 0x1 +_081522C4: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081522CC: .4byte 0x030024f8 +_081522D0: .4byte 0x082ec690 + thumb_func_end sub_8152254 + + thumb_func_start sub_81522D4 +sub_81522D4: @ 81522D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, _081522F0 + ldr r1, [r0] + adds r3, r0, 0 + cmp r1, 0 + beq _081522EC + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _081522F4 +_081522EC: + movs r0, 0 + b _081523D2 + .align 2, 0 +_081522F0: .4byte 0x0203abb8 +_081522F4: + ldrb r1, [r1] + cmp r6, r1 + bcs _081523D0 + adds r7, r3, 0 + movs r0, 0x3 + mov r8, r0 +_08152300: + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r5, r0, 4 + adds r2, r5, r1 + ldrb r1, [r2, 0x19] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x3 + bne _081523C2 + ldr r1, [r2, 0x2C] + cmp r1, 0 + beq _08152322 + adds r0, r2, 0 + bl _call_via_r1 +_08152322: + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r2, r5, r0 + ldrb r1, [r2, 0x19] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08152348 + lsls r0, r6, 3 + ldr r1, _08152340 + adds r0, r1 + ldr r1, _08152344 + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + b _081523C0 + .align 2, 0 +_08152340: .4byte 0x030024f8 +_08152344: .4byte 0x082ec690 +_08152348: + ldrb r0, [r2, 0xE] + ldrb r4, [r2, 0xA] + adds r0, r4 + strb r0, [r2] + ldr r4, [r7] + ldr r3, [r4, 0x4] + adds r3, r5, r3 + movs r0, 0x8 + ldrsh r2, [r3, r0] + movs r1, 0xC + ldrsh r0, [r3, r1] + adds r2, r0 + ldr r1, _081523DC + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r3, 0x2] + ldr r1, _081523E0 + mov r12, r1 + mov r1, r12 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x2] + ldr r3, [r4, 0x4] + adds r3, r5, r3 + ldrb r0, [r3, 0x19] + lsls r0, 27 + lsrs r0, 30 + mov r2, r8 + ands r0, r2 + lsls r0, 2 + ldrb r1, [r3, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x5] + ldr r4, [r7] + ldr r2, [r4, 0x4] + adds r2, r5, r2 + ldrh r3, [r2, 0x14] + ldr r1, _081523E4 + adds r0, r1, 0 + adds r1, r3, 0 + ands r1, r0 + mov r12, r1 + ldrh r0, [r2, 0x4] + ldr r3, _081523E8 + adds r1, r3, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strh r0, [r2, 0x4] + lsls r1, r6, 3 + ldr r2, _081523EC + ldr r0, [r4, 0x4] + adds r1, r2 + adds r0, r5, r0 + ldm r0!, {r2,r3} + stm r1!, {r2,r3} +_081523C0: + ldr r3, _081523F0 +_081523C2: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r3] + ldrb r0, [r0] + cmp r6, r0 + bcc _08152300 +_081523D0: + movs r0, 0x1 +_081523D2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081523DC: .4byte 0x000001ff +_081523E0: .4byte 0xfffffe00 +_081523E4: .4byte 0x000003ff +_081523E8: .4byte 0xfffffc00 +_081523EC: .4byte 0x030024f8 +_081523F0: .4byte 0x0203abb8 + thumb_func_end sub_81522D4 + + thumb_func_start sub_81523F4 +sub_81523F4: @ 81523F4 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r4, 0 + beq _08152430 + ldrh r0, [r4, 0x10] + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0815242C + cmp r5, r0 + beq _08152430 + strb r6, [r4, 0x18] + ldrb r0, [r4, 0x1] + lsrs r0, 6 + ldrb r1, [r4, 0x3] + lsrs r1, 6 + bl sub_80355F8 + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + adds r0, r5, r0 + strh r0, [r4, 0x14] + movs r0, 0x1 + b _08152432 + .align 2, 0 +_0815242C: .4byte 0x0000ffff +_08152430: + movs r0, 0 +_08152432: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81523F4 + + thumb_func_start sub_8152438 +sub_8152438: @ 8152438 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08152468 + ldr r0, [r0] + cmp r0, 0 + beq _0815246C + ldrb r1, [r0] + cmp r2, r1 + bcs _0815246C + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0x19] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815246C + str r4, [r3, 0x2C] + adds r0, r2, 0 + b _0815246E + .align 2, 0 +_08152468: .4byte 0x0203abb8 +_0815246C: + movs r0, 0xFF +_0815246E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8152438 + + thumb_func_start sub_8152474 +sub_8152474: @ 8152474 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 16 + lsrs r5, r2, 16 + ldr r0, _081524AC + ldr r0, [r0] + cmp r0, 0 + beq _081524A8 + ldrb r1, [r0] + cmp r3, r1 + bcs _081524A8 + ldr r1, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r2, r0, r1 + ldrb r1, [r2, 0x19] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081524A8 + cmp r4, 0x7 + bls _081524B0 +_081524A8: + movs r0, 0xFF + b _081524BC + .align 2, 0 +_081524AC: .4byte 0x0203abb8 +_081524B0: + lsls r1, r4, 1 + adds r0, r2, 0 + adds r0, 0x1A + adds r0, r1 + strh r5, [r0] + adds r0, r3, 0 +_081524BC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8152474 + + thumb_func_start sub_81524C4 +sub_81524C4: @ 81524C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r0 + ldr r0, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0xC] + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + movs r5, 0 + ldr r0, _08152510 + ldr r0, [r0] + cmp r0, 0 + beq _0815255E + mov r1, r9 + cmp r1, 0 + bne _08152530 + b _0815255E + .align 2, 0 +_08152510: .4byte 0x0203abb8 +_08152514: + adds r5, r2, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x30 + bl memset + strb r4, [r5, 0x16] + ldrb r0, [r5, 0x19] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r5, 0x19] + b _0815255A +_08152530: + movs r4, 0 + ldrb r1, [r0] + cmp r5, r1 + bcs _0815255A + ldr r6, [r0, 0x4] + adds r3, r1, 0 + movs r7, 0x1 +_0815253E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + adds r2, r0, r6 + ldrb r1, [r2, 0x19] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08152514 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r3 + bcc _0815253E +_0815255A: + cmp r5, 0 + bne _08152562 +_0815255E: + movs r0, 0xFF + b _081525C0 +_08152562: + adds r1, r5, 0 + mov r0, r9 + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x10] + mov r1, r8 + strh r1, [r5, 0x12] + mov r2, sp + ldrh r2, [r2, 0x4] + strh r2, [r5, 0x8] + mov r3, sp + ldrh r3, [r3, 0x8] + strh r3, [r5, 0xA] + mov r0, r8 + bl gpu_pal_tags_index_of + lsls r0, 4 + ldrb r1, [r5, 0x5] + movs r4, 0xF + ands r4, r1 + orrs r4, r0 + strb r4, [r5, 0x5] + mov r0, r10 + cmp r0, 0x3 + bhi _081525B6 + movs r1, 0x3 + ands r1, r0 + lsls r3, r1, 3 + ldrb r2, [r5, 0x19] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r5, 0x19] + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r4, r0 + orrs r4, r1 + strb r4, [r5, 0x5] +_081525B6: + adds r0, r5, 0 + ldr r1, [sp, 0xC] + bl sub_81523F4 + ldrb r0, [r5, 0x16] +_081525C0: + 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_81524C4 + + thumb_func_start sub_81525D0 +sub_81525D0: @ 81525D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _081525F8 + ldr r0, [r6] + cmp r0, 0 + beq _081525F2 + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r4, r0, 4 + adds r2, r4, r1 + ldrb r1, [r2, 0x19] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081525FC +_081525F2: + movs r0, 0xFF + b _0815263C + .align 2, 0 +_081525F8: .4byte 0x0203abb8 +_081525FC: + adds r0, r2, 0 + movs r1, 0 + movs r2, 0x30 + bl memset + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0xA0 + strb r1, [r0] + ldr r3, [r6] + ldr r2, [r3, 0x4] + adds r2, r4, r2 + ldrh r1, [r2, 0x2] + ldr r0, _08152644 + ands r0, r1 + movs r1, 0xF0 + orrs r0, r1 + strh r0, [r2, 0x2] + ldr r1, [r3, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x19] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x19] + lsls r1, r5, 3 + ldr r0, _08152648 + adds r1, r0 + ldr r0, _0815264C + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + adds r0, r5, 0 +_0815263C: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08152644: .4byte 0xfffffe00 +_08152648: .4byte 0x030024f8 +_0815264C: .4byte 0x082ec690 + thumb_func_end sub_81525D0 + + thumb_func_start calls_flash_erase_block +calls_flash_erase_block: @ 8152650 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _0815267C +_08152656: + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r5] + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xF + bls _08152656 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815267C: .4byte 0x03007860 + thumb_func_end calls_flash_erase_block + + thumb_func_start sub_8152680 +sub_8152680: @ 8152680 + ldr r0, _08152690 + movs r1, 0 + str r1, [r0] + ldr r0, _08152694 + strh r1, [r0] + ldr r0, _08152698 + str r1, [r0] + bx lr + .align 2, 0 +_08152690: .4byte 0x03006200 +_08152694: .4byte 0x030061f0 +_08152698: .4byte 0x030061fc + thumb_func_end sub_8152680 + + thumb_func_start sub_815269C +sub_815269C: @ 815269C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + movs r4, 0 + cmp r0, 0x1 + beq _081526D0 + cmp r0, 0x1 + bgt _081526B6 + cmp r0, 0 + beq _081526BC + b _081526F4 +_081526B6: + cmp r0, 0x2 + beq _081526E4 + b _081526F4 +_081526BC: + ldr r2, _081526CC + movs r1, 0x1 + lsls r1, r3 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _081526F4 + .align 2, 0 +_081526CC: .4byte 0x030061fc +_081526D0: + ldr r2, _081526E0 + adds r1, r0, 0 + lsls r1, r3 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + b _081526F4 + .align 2, 0 +_081526E0: .4byte 0x030061fc +_081526E4: + ldr r0, _081526FC + movs r1, 0x1 + lsls r1, r3 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _081526F4 + movs r4, 0x1 +_081526F4: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081526FC: .4byte 0x030061fc + thumb_func_end sub_815269C + + thumb_func_start save_write_to_flash +save_write_to_flash: @ 8152700 + push {r4-r7,lr} + adds r7, r1, 0 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _08152724 + ldr r0, _08152728 + str r0, [r1] + ldr r0, _0815272C + cmp r2, r0 + beq _08152730 + adds r0, r2, 0 + adds r1, r7, 0 + bl sub_81527A0 + lsls r0, 24 + lsrs r5, r0, 24 + b _08152782 + .align 2, 0 +_08152724: .4byte 0x03006204 +_08152728: .4byte 0x0203abbc +_0815272C: .4byte 0x0000ffff +_08152730: + ldr r1, _0815278C + ldr r5, _08152790 + ldrh r0, [r5] + strh r0, [r1] + ldr r1, _08152794 + ldr r6, _08152798 + ldr r4, [r6] + str r4, [r1] + adds r0, 0x1 + strh r0, [r5] + ldrh r0, [r5] + movs r1, 0xE + bl __umodsi3 + strh r0, [r5] + adds r4, 0x1 + str r4, [r6] + movs r5, 0x1 + movs r4, 0 +_08152756: + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_81527A0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _08152756 + ldr r0, _0815279C + ldr r0, [r0] + cmp r0, 0 + beq _08152782 + movs r5, 0xFF + ldr r1, _08152790 + ldr r0, _0815278C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08152798 + ldr r0, _08152794 + ldr r0, [r0] + str r0, [r1] +_08152782: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0815278C: .4byte 0x030061f8 +_08152790: .4byte 0x030061f0 +_08152794: .4byte 0x030061f4 +_08152798: .4byte 0x03006200 +_0815279C: .4byte 0x030061fc + thumb_func_end save_write_to_flash + + thumb_func_start sub_81527A0 +sub_81527A0: @ 81527A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _0815286C + ldrh r0, [r0] + adds r0, r6, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r2, _08152870 + ldr r1, [r2] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r6, 3 + adds r0, r4 + ldr r1, [r0] + mov r10, r1 + ldrh r4, [r0, 0x4] + movs r3, 0 + mov r9, r2 + ldr r2, _08152874 + mov r12, r2 + mov r8, r12 + movs r2, 0 + ldr r1, _08152878 +_081527F2: + mov r7, r8 + ldr r0, [r7] + adds r0, r3 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bls _081527F2 + mov r0, r12 + ldr r1, [r0] + ldr r2, _0815287C + adds r0, r1, r2 + strh r6, [r0] + ldr r3, _08152880 + adds r2, r1, r3 + ldr r0, _08152884 + str r0, [r2] + ldr r6, _08152888 + adds r1, r6 + mov r7, r9 + ldr r0, [r7] + str r0, [r1] + movs r3, 0 + lsls r5, 24 + cmp r3, r4 + bcs _08152840 + mov r2, r12 +_0815282A: + ldr r1, [r2] + adds r1, r3 + mov r6, r10 + adds r0, r6, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _0815282A +_08152840: + mov r0, r10 + adds r1, r4, 0 + bl sub_8153164 + ldr r1, _08152874 + ldr r1, [r1] + ldr r7, _0815288C + adds r2, r1, r7 + strh r0, [r2] + lsrs r0, r5, 24 + bl sub_8152908 + 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 + .align 2, 0 +_0815286C: .4byte 0x030061f0 +_08152870: .4byte 0x03006200 +_08152874: .4byte 0x03006204 +_08152878: .4byte 0x00000fff +_0815287C: .4byte 0x00000ff4 +_08152880: .4byte 0x00000ff8 +_08152884: .4byte 0x08012025 +_08152888: .4byte 0x00000ffc +_0815288C: .4byte 0x00000ff6 + thumb_func_end sub_81527A0 + + thumb_func_start sub_8152890 +sub_8152890: @ 8152890 + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r4, _081528F4 + movs r3, 0 + movs r6, 0 + ldr r1, _081528F8 +_081528A4: + adds r0, r4, r3 + strb r6, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bls _081528A4 + ldr r0, _081528FC + adds r1, r4, r0 + ldr r0, _08152900 + str r0, [r1] + movs r3, 0 + cmp r3, r2 + bcs _081528D2 +_081528C0: + adds r1, r4, r3 + adds r0, r5, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r2 + bcc _081528C0 +_081528D2: + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_8153164 + ldr r2, _08152904 + adds r1, r4, r2 + strh r0, [r1] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8152908 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081528F4: .4byte 0x0203abbc +_081528F8: .4byte 0x00000fff +_081528FC: .4byte 0x00000ff8 +_08152900: .4byte 0x08012025 +_08152904: .4byte 0x00000ff4 + thumb_func_end sub_8152890 + + thumb_func_start sub_8152908 +sub_8152908: @ 8152908 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl ProgramFlashSectorsAndVerify + cmp r0, 0 + bne _08152924 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_815269C + movs r0, 0x1 + b _0815292E +_08152924: + movs r0, 0 + adds r1, r4, 0 + bl sub_815269C + movs r0, 0xFF +_0815292E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8152908 + + thumb_func_start sub_8152934 +sub_8152934: @ 8152934 + push {r4-r6,lr} + ldr r1, _08152970 + ldr r0, _08152974 + str r0, [r1] + ldr r1, _08152978 + ldr r5, _0815297C + ldrh r0, [r5] + strh r0, [r1] + ldr r1, _08152980 + ldr r6, _08152984 + ldr r4, [r6] + str r4, [r1] + adds r0, 0x1 + strh r0, [r5] + ldrh r0, [r5] + movs r1, 0xE + bl __umodsi3 + strh r0, [r5] + adds r4, 0x1 + str r4, [r6] + ldr r1, _08152988 + movs r0, 0 + strh r0, [r1] + ldr r1, _0815298C + movs r0, 0 + str r0, [r1] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08152970: .4byte 0x03006204 +_08152974: .4byte 0x0203abbc +_08152978: .4byte 0x030061f8 +_0815297C: .4byte 0x030061f0 +_08152980: .4byte 0x030061f4 +_08152984: .4byte 0x03006200 +_08152988: .4byte 0x03006208 +_0815298C: .4byte 0x030061fc + thumb_func_end sub_8152934 + + thumb_func_start sub_8152990 +sub_8152990: @ 8152990 + ldr r1, _081529B4 + ldr r0, _081529B8 + str r0, [r1] + ldr r1, _081529BC + ldr r0, _081529C0 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _081529C4 + ldr r0, _081529C8 + ldr r0, [r0] + str r0, [r1] + ldr r1, _081529CC + movs r0, 0 + strh r0, [r1] + ldr r1, _081529D0 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_081529B4: .4byte 0x03006204 +_081529B8: .4byte 0x0203abbc +_081529BC: .4byte 0x030061f8 +_081529C0: .4byte 0x030061f0 +_081529C4: .4byte 0x030061f4 +_081529C8: .4byte 0x03006200 +_081529CC: .4byte 0x03006208 +_081529D0: .4byte 0x030061fc + thumb_func_end sub_8152990 + + thumb_func_start sub_81529D4 +sub_81529D4: @ 81529D4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08152A10 + ldrh r2, [r4] + subs r0, 0x1 + cmp r2, r0 + bge _08152A28 + movs r5, 0x1 + adds r0, r2, 0 + bl sub_81527A0 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r0, _08152A14 + ldr r0, [r0] + cmp r0, 0 + beq _08152A2A + movs r5, 0xFF + ldr r1, _08152A18 + ldr r0, _08152A1C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08152A20 + ldr r0, _08152A24 + ldr r0, [r0] + str r0, [r1] + b _08152A2A + .align 2, 0 +_08152A10: .4byte 0x03006208 +_08152A14: .4byte 0x030061fc +_08152A18: .4byte 0x030061f0 +_08152A1C: .4byte 0x030061f8 +_08152A20: .4byte 0x03006200 +_08152A24: .4byte 0x030061f4 +_08152A28: + movs r5, 0xFF +_08152A2A: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81529D4 + + thumb_func_start sub_8152A34 +sub_8152A34: @ 8152A34 + push {r4,lr} + lsls r0, 16 + movs r4, 0x1 + ldr r2, _08152A68 + adds r0, r2 + lsrs r0, 16 + bl calls_flash_erase_block_2 + ldr r0, _08152A6C + ldr r0, [r0] + cmp r0, 0 + beq _08152A5E + movs r4, 0xFF + ldr r1, _08152A70 + ldr r0, _08152A74 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08152A78 + ldr r0, _08152A7C + ldr r0, [r0] + str r0, [r1] +_08152A5E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08152A68: .4byte 0xffff0000 +_08152A6C: .4byte 0x030061fc +_08152A70: .4byte 0x030061f0 +_08152A74: .4byte 0x030061f8 +_08152A78: .4byte 0x03006200 +_08152A7C: .4byte 0x030061f4 + thumb_func_end sub_8152A34 + + thumb_func_start calls_flash_erase_block_2 +calls_flash_erase_block_2: @ 8152A80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _08152B4C + ldrh r0, [r0] + adds r0, r6, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r2, _08152B50 + ldr r1, [r2] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r6, 3 + adds r0, r4 + ldr r1, [r0] + mov r10, r1 + ldrh r3, [r0, 0x4] + movs r4, 0 + mov r9, r2 + ldr r2, _08152B54 + mov r12, r2 + mov r8, r12 + movs r2, 0 + ldr r1, _08152B58 +_08152AD2: + mov r7, r8 + ldr r0, [r7] + adds r0, r4 + strb r2, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r1 + bls _08152AD2 + mov r0, r12 + ldr r1, [r0] + ldr r2, _08152B5C + adds r0, r1, r2 + strh r6, [r0] + ldr r6, _08152B60 + adds r2, r1, r6 + ldr r0, _08152B64 + str r0, [r2] + ldr r7, _08152B68 + adds r1, r7 + mov r2, r9 + ldr r0, [r2] + str r0, [r1] + movs r4, 0 + lsls r6, r5, 24 + mov r8, r6 + cmp r4, r3 + bcs _08152B22 + mov r2, r12 +_08152B0C: + ldr r1, [r2] + adds r1, r4 + mov r7, r10 + adds r0, r7, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r3 + bcc _08152B0C +_08152B22: + mov r0, r10 + adds r1, r3, 0 + bl sub_8153164 + ldr r1, _08152B54 + ldr r1, [r1] + ldr r2, _08152B6C + adds r1, r2 + strh r0, [r1] + ldr r0, _08152B70 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + movs r6, 0x1 + movs r4, 0 + ldr r7, _08152B74 + mov r9, r7 + ldr r7, _08152B78 + b _08152B82 + .align 2, 0 +_08152B4C: .4byte 0x030061f0 +_08152B50: .4byte 0x03006200 +_08152B54: .4byte 0x03006204 +_08152B58: .4byte 0x00000fff +_08152B5C: .4byte 0x00000ff4 +_08152B60: .4byte 0x00000ff8 +_08152B64: .4byte 0x08012025 +_08152B68: .4byte 0x00000ffc +_08152B6C: .4byte 0x00000ff6 +_08152B70: .4byte 0x03007860 +_08152B74: .4byte 0x00000ff7 +_08152B78: .4byte 0x03007854 +_08152B7C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08152B82: + cmp r4, r9 + bhi _08152BA0 + ldr r0, _08152BAC + ldr r0, [r0] + adds r0, r4 + ldrb r2, [r0] + ldr r3, [r7] + adds r0, r5, 0 + adds r1, r4, 0 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + beq _08152B7C + movs r6, 0xFF +_08152BA0: + cmp r6, 0xFF + bne _08152BB0 + mov r0, r8 + lsrs r1, r0, 24 + b _08152C08 + .align 2, 0 +_08152BAC: .4byte 0x03006204 +_08152BB0: + movs r6, 0x1 + movs r4, 0 + ldr r1, _08152BBC + mov r9, r1 + ldr r7, _08152BC0 + b _08152BCA + .align 2, 0 +_08152BBC: .4byte 0x03007854 +_08152BC0: .4byte 0x00000ff9 +_08152BC4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08152BCA: + cmp r4, 0x6 + bhi _08152BEC + adds r1, r4, r7 + ldr r0, _08152C00 + ldr r0, [r0] + adds r0, r4, r0 + adds r0, r7 + ldrb r2, [r0] + mov r0, r9 + ldr r3, [r0] + adds r0, r5, 0 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + beq _08152BC4 + movs r6, 0xFF +_08152BEC: + cmp r6, 0xFF + beq _08152C04 + mov r2, r8 + lsrs r1, r2, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152C10 + .align 2, 0 +_08152C00: .4byte 0x03006204 +_08152C04: + mov r6, r8 + lsrs r1, r6, 24 +_08152C08: + movs r0, 0 + bl sub_815269C + movs r0, 0xFF +_08152C10: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end calls_flash_erase_block_2 + + thumb_func_start sav12_xor_get +sav12_xor_get: @ 8152C20 + push {r4-r6,lr} + lsls r0, 16 + ldr r6, _08152C74 + lsrs r0, 16 + ldrh r1, [r6] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, _08152C78 + ldr r1, [r5] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08152C7C + ldr r1, _08152C80 + ldr r3, [r0] + adds r0, r4, 0 + movs r2, 0x25 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + bne _08152C84 + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152C9C + .align 2, 0 +_08152C74: .4byte 0x030061f0 +_08152C78: .4byte 0x03006200 +_08152C7C: .4byte 0x03007854 +_08152C80: .4byte 0x00000ff8 +_08152C84: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_815269C + ldr r0, _08152CA4 + ldrh r0, [r0] + strh r0, [r6] + ldr r0, _08152CA8 + ldr r0, [r0] + str r0, [r5] + movs r0, 0xFF +_08152C9C: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08152CA4: .4byte 0x030061f8 +_08152CA8: .4byte 0x030061f4 + thumb_func_end sav12_xor_get + + thumb_func_start sub_8152CAC +sub_8152CAC: @ 8152CAC + push {r4-r6,lr} + lsls r0, 16 + ldr r6, _08152D08 + lsrs r0, 16 + ldrh r1, [r6] + adds r0, r1 + subs r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, _08152D0C + ldr r1, [r5] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r3, _08152D10 + ldr r1, _08152D14 + ldr r0, _08152D18 + ldr r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + bne _08152D1C + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152D34 + .align 2, 0 +_08152D08: .4byte 0x030061f0 +_08152D0C: .4byte 0x03006200 +_08152D10: .4byte 0x03007854 +_08152D14: .4byte 0x00000ff8 +_08152D18: .4byte 0x03006204 +_08152D1C: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_815269C + ldr r0, _08152D3C + ldrh r0, [r0] + strh r0, [r6] + ldr r0, _08152D40 + ldr r0, [r0] + str r0, [r5] + movs r0, 0xFF +_08152D34: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08152D3C: .4byte 0x030061f8 +_08152D40: .4byte 0x030061f4 + thumb_func_end sub_8152CAC + + thumb_func_start sub_8152D44 +sub_8152D44: @ 8152D44 + push {r4-r6,lr} + lsls r0, 16 + ldr r6, _08152D98 + lsrs r0, 16 + ldrh r1, [r6] + adds r0, r1 + subs r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, _08152D9C + ldr r1, [r5] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08152DA0 + ldr r1, _08152DA4 + ldr r3, [r0] + adds r0, r4, 0 + movs r2, 0x25 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + bne _08152DA8 + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152DC0 + .align 2, 0 +_08152D98: .4byte 0x030061f0 +_08152D9C: .4byte 0x03006200 +_08152DA0: .4byte 0x03007854 +_08152DA4: .4byte 0x00000ff8 +_08152DA8: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_815269C + ldr r0, _08152DC8 + ldrh r0, [r0] + strh r0, [r6] + ldr r0, _08152DCC + ldr r0, [r0] + str r0, [r5] + movs r0, 0xFF +_08152DC0: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08152DC8: .4byte 0x030061f8 +_08152DCC: .4byte 0x030061f4 + thumb_func_end sub_8152D44 + + thumb_func_start sub_8152DD0 +sub_8152DD0: @ 8152DD0 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, _08152DE8 + ldr r0, _08152DEC + str r0, [r1] + ldr r0, _08152DF0 + cmp r4, r0 + beq _08152DF4 + movs r5, 0xFF + b _08152E06 + .align 2, 0 +_08152DE8: .4byte 0x03006204 +_08152DEC: .4byte 0x0203abbc +_08152DF0: .4byte 0x0000ffff +_08152DF4: + adds r0, r6, 0 + bl sub_8152EC8 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8152E10 +_08152E06: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8152DD0 + + thumb_func_start sub_8152E10 +sub_8152E10: @ 8152E10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + ldr r0, _08152EAC + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 17 + lsrs r7, r0, 16 + movs r5, 0 + ldr r6, _08152EB0 +_08152E2C: + adds r0, r5, r7 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r6] + bl sub_815314C + ldr r0, [r6] + ldr r1, _08152EB4 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + bne _08152E48 + ldr r0, _08152EB8 + strh r5, [r0] +_08152E48: + ldr r0, [r6] + lsls r1, 3 + mov r2, r8 + adds r4, r1, r2 + ldrh r1, [r4, 0x4] + bl sub_8153164 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, [r6] + ldr r1, _08152EBC + adds r0, r2, r1 + ldr r1, [r0] + ldr r0, _08152EC0 + adds r5, 0x1 + cmp r1, r0 + bne _08152E98 + ldr r1, _08152EC4 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08152E98 + movs r2, 0 + ldrh r0, [r4, 0x4] + cmp r2, r0 + bcs _08152E98 + adds r3, r4, 0 + ldr r4, _08152EB0 +_08152E80: + ldr r1, [r3] + adds r1, r2 + ldr r0, [r4] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r1, [r3, 0x4] + cmp r2, r1 + bcc _08152E80 +_08152E98: + lsls r0, r5, 16 + lsrs r5, r0, 16 + cmp r5, 0xD + bls _08152E2C + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08152EAC: .4byte 0x03006200 +_08152EB0: .4byte 0x03006204 +_08152EB4: .4byte 0x00000ff4 +_08152EB8: .4byte 0x030061f0 +_08152EBC: .4byte 0x00000ff8 +_08152EC0: .4byte 0x08012025 +_08152EC4: .4byte 0x00000ff6 + thumb_func_end sub_8152E10 + + thumb_func_start sub_8152EC8 +sub_8152EC8: @ 8152EC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + movs r6, 0 + movs r5, 0 + movs r4, 0 + ldr r7, _08152F54 +_08152EE4: + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, [r7] + bl sub_815314C + ldr r2, [r7] + ldr r1, _08152F58 + adds r0, r2, r1 + ldr r1, [r0] + ldr r0, _08152F5C + cmp r1, r0 + bne _08152F34 + movs r5, 0x1 + ldr r3, _08152F60 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 3 + add r0, r10 + ldrh r1, [r0, 0x4] + adds r0, r2, 0 + bl sub_8153164 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r7] + ldr r3, _08152F64 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _08152F34 + ldr r2, _08152F68 + adds r0, r1, r2 + ldr r0, [r0] + mov r8, r0 + subs r3, 0x2 + adds r1, r3 + adds r0, r5, 0 + ldrh r1, [r1] + lsls r0, r1 + orrs r6, r0 +_08152F34: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _08152EE4 + cmp r5, 0 + beq _08152F70 + ldr r0, _08152F6C + movs r1, 0xFF + str r1, [sp] + cmp r6, r0 + bne _08152F74 + movs r2, 0x1 + str r2, [sp] + b _08152F74 + .align 2, 0 +_08152F54: .4byte 0x03006204 +_08152F58: .4byte 0x00000ff8 +_08152F5C: .4byte 0x08012025 +_08152F60: .4byte 0x00000ff4 +_08152F64: .4byte 0x00000ff6 +_08152F68: .4byte 0x00000ffc +_08152F6C: .4byte 0x00003fff +_08152F70: + movs r3, 0 + str r3, [sp] +_08152F74: + movs r6, 0 + movs r5, 0 + movs r4, 0 + ldr r7, _08152FEC +_08152F7C: + adds r0, r4, 0 + adds r0, 0xE + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r7] + bl sub_815314C + ldr r2, [r7] + ldr r1, _08152FF0 + adds r0, r2, r1 + ldr r1, [r0] + ldr r0, _08152FF4 + cmp r1, r0 + bne _08152FD0 + movs r5, 0x1 + ldr r3, _08152FF8 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 3 + add r0, r10 + ldrh r1, [r0, 0x4] + adds r0, r2, 0 + bl sub_8153164 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r7] + ldr r3, _08152FFC + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _08152FD0 + ldr r2, _08153000 + adds r0, r1, r2 + ldr r0, [r0] + mov r9, r0 + subs r3, 0x2 + adds r1, r3 + adds r0, r5, 0 + ldrh r1, [r1] + lsls r0, r1 + orrs r6, r0 +_08152FD0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _08152F7C + cmp r5, 0 + beq _08153008 + ldr r0, _08153004 + movs r1, 0xFF + cmp r6, r0 + bne _0815300A + movs r1, 0x1 + b _0815300A + .align 2, 0 +_08152FEC: .4byte 0x03006204 +_08152FF0: .4byte 0x00000ff8 +_08152FF4: .4byte 0x08012025 +_08152FF8: .4byte 0x00000ff4 +_08152FFC: .4byte 0x00000ff6 +_08153000: .4byte 0x00000ffc +_08153004: .4byte 0x00003fff +_08153008: + movs r1, 0 +_0815300A: + ldr r0, [sp] + cmp r0, 0x1 + bne _0815307C + cmp r1, 0x1 + bne _0815306C + movs r0, 0x1 + negs r0, r0 + cmp r8, r0 + bne _08153022 + mov r1, r9 + cmp r1, 0 + beq _0815302C +_08153022: + mov r2, r8 + cmp r2, 0 + bne _08153050 + cmp r9, r0 + bne _08153050 +_0815302C: + mov r1, r8 + adds r1, 0x1 + mov r0, r9 + adds r0, 0x1 + cmp r1, r0 + bcs _08153044 + ldr r0, _08153040 + mov r3, r9 + b _08153064 + .align 2, 0 +_08153040: .4byte 0x03006200 +_08153044: + ldr r0, _0815304C + mov r1, r8 + str r1, [r0] + b _08153094 + .align 2, 0 +_0815304C: .4byte 0x03006200 +_08153050: + cmp r8, r9 + bcs _08153060 + ldr r0, _0815305C + mov r2, r9 + str r2, [r0] + b _08153094 + .align 2, 0 +_0815305C: .4byte 0x03006200 +_08153060: + ldr r0, _08153068 + mov r3, r8 +_08153064: + str r3, [r0] + b _08153094 + .align 2, 0 +_08153068: .4byte 0x03006200 +_0815306C: + ldr r0, _08153078 + mov r2, r8 + str r2, [r0] + cmp r1, 0xFF + beq _0815308C + b _08153094 + .align 2, 0 +_08153078: .4byte 0x03006200 +_0815307C: + cmp r1, 0x1 + bne _08153098 + ldr r0, _08153090 + mov r3, r9 + str r3, [r0] + ldr r0, [sp] + cmp r0, 0xFF + bne _08153094 +_0815308C: + movs r0, 0xFF + b _081530C4 + .align 2, 0 +_08153090: .4byte 0x03006200 +_08153094: + movs r0, 0x1 + b _081530C4 +_08153098: + ldr r2, [sp] + cmp r2, 0 + bne _081530B8 + cmp r1, 0 + bne _081530B8 + ldr r0, _081530B0 + str r1, [r0] + ldr r0, _081530B4 + strh r1, [r0] + movs r0, 0 + b _081530C4 + .align 2, 0 +_081530B0: .4byte 0x03006200 +_081530B4: .4byte 0x030061f0 +_081530B8: + ldr r0, _081530D4 + movs r1, 0 + str r1, [r0] + ldr r0, _081530D8 + strh r1, [r0] + movs r0, 0x2 +_081530C4: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081530D4: .4byte 0x03006200 +_081530D8: .4byte 0x030061f0 + thumb_func_end sub_8152EC8 + + thumb_func_start sub_81530DC +sub_81530DC: @ 81530DC + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + ldr r5, _08153130 + adds r1, r5, 0 + bl sub_815314C + ldr r1, _08153134 + adds r0, r5, r1 + ldr r1, [r0] + ldr r0, _08153138 + cmp r1, r0 + bne _08153144 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8153164 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0815313C + adds r1, r5, r2 + ldrh r1, [r1] + cmp r1, r0 + bne _08153140 + movs r2, 0 + cmp r2, r4 + bcs _0815312A +_08153118: + adds r1, r6, r2 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r4 + bcc _08153118 +_0815312A: + movs r0, 0x1 + b _08153146 + .align 2, 0 +_08153130: .4byte 0x0203abbc +_08153134: .4byte 0x00000ff8 +_08153138: .4byte 0x08012025 +_0815313C: .4byte 0x00000ff4 +_08153140: + movs r0, 0x2 + b _08153146 +_08153144: + movs r0, 0 +_08153146: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81530DC + + thumb_func_start sub_815314C +sub_815314C: @ 815314C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0x80 + lsls r3, 5 + movs r1, 0 + bl ReadFlash + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_815314C + + thumb_func_start sub_8153164 +sub_8153164: @ 8153164 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + movs r2, 0 + movs r3, 0 + lsrs r1, 18 + cmp r2, r1 + bcs _08153182 +_08153174: + ldm r4!, {r0} + adds r2, r0 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bcc _08153174 +_08153182: + lsrs r0, r2, 16 + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153164 + + thumb_func_start sub_8153190 +sub_8153190: @ 8153190 + push {r4,r5,lr} + ldr r3, _081531F0 + ldr r0, _081531F4 + ldr r2, _081531F8 + ldrh r1, [r2] + ldr r0, [r0] + adds r0, r1 + str r0, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x4] + ldr r5, _081531FC + adds r3, 0x8 + adds r2, 0x4 + movs r4, 0x3 +_081531AC: + ldrh r0, [r2] + ldr r1, [r5] + adds r1, r0 + str r1, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x4] + adds r3, 0x8 + adds r2, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _081531AC + movs r4, 0x5 + ldr r1, _081531F0 + ldr r5, _08153200 + ldr r0, _081531F8 + adds r3, r1, 0 + adds r3, 0x28 + adds r2, r0, 0 + adds r2, 0x14 +_081531D2: + ldrh r0, [r2] + ldr r1, [r5] + adds r1, r0 + str r1, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x4] + adds r3, 0x8 + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0xD + ble _081531D2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081531F0: .4byte 0x03006220 +_081531F4: .4byte 0x03005d90 +_081531F8: .4byte 0x085cdc00 +_081531FC: .4byte 0x03005d8c +_08153200: .4byte 0x03005d94 + thumb_func_end sub_8153190 + + thumb_func_start calls_flash_erase_block_3 +calls_flash_erase_block_3: @ 8153204 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08153224 + ldr r6, [r1] + movs r0, 0 + str r0, [r1] + bl sub_8153190 + cmp r4, 0x5 + bhi _081532AC + lsls r0, r4, 2 + ldr r1, _08153228 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08153224: .4byte 0x0203cf5c +_08153228: .4byte _0815322C + .align 2, 0 +_0815322C: + .4byte _081532AC + .4byte _081532C4 + .4byte _081532C4 + .4byte _0815325A + .4byte _081532F8 + .4byte _08153244 +_08153244: + movs r4, 0x1C + ldr r5, _08153298 +_08153248: + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08153248 +_0815325A: + movs r0, 0xA + bl sub_80847F8 + ldr r1, _0815329C + cmp r0, r1 + bhi _0815326C + movs r0, 0xA + bl sav12_xor_increment +_0815326C: + bl save_serialize_game + ldr r0, _081532A0 + ldr r1, _081532A4 + bl save_write_to_flash + ldr r4, _081532A8 + movs r5, 0xF8 + lsls r5, 4 + movs r0, 0x1C + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8152890 + adds r4, r5 + movs r0, 0x1D + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8152890 + b _0815331A + .align 2, 0 +_08153298: .4byte 0x03007860 +_0815329C: .4byte 0x000003e6 +_081532A0: .4byte 0x0000ffff +_081532A4: .4byte 0x03006220 +_081532A8: .4byte 0x0201c000 +_081532AC: + bl save_serialize_game + ldr r0, _081532BC + ldr r1, _081532C0 + bl save_write_to_flash + b _0815331A + .align 2, 0 +_081532BC: .4byte 0x0000ffff +_081532C0: .4byte 0x03006220 +_081532C4: + bl save_serialize_game + movs r4, 0 +_081532CA: + adds r0, r4, 0 + ldr r1, _081532F4 + bl calls_flash_erase_block_2 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081532CA + movs r4, 0 +_081532DE: + adds r0, r4, 0 + ldr r1, _081532F4 + bl sav12_xor_get + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081532DE + b _0815331A + .align 2, 0 +_081532F4: .4byte 0x03006220 +_081532F8: + movs r4, 0x1C + ldr r5, _08153328 +_081532FC: + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _081532FC + bl save_serialize_game + ldr r0, _0815332C + ldr r1, _08153330 + bl save_write_to_flash +_0815331A: + ldr r0, _08153334 + str r6, [r0] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08153328: .4byte 0x03007860 +_0815332C: .4byte 0x0000ffff +_08153330: .4byte 0x03006220 +_08153334: .4byte 0x0203cf5c + thumb_func_end calls_flash_erase_block_3 + + thumb_func_start save_game_when_memory_present +save_game_when_memory_present: @ 8153338 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08153364 + ldr r4, [r0] + cmp r4, 0x1 + bne _0815335A + adds r0, r5, 0 + bl calls_flash_erase_block_3 + ldr r0, _08153368 + ldr r0, [r0] + cmp r0, 0 + beq _08153370 + adds r0, r5, 0 + bl fullscreen_save_activate +_0815335A: + ldr r1, _0815336C + movs r0, 0xFF + strh r0, [r1] + movs r0, 0xFF + b _08153376 + .align 2, 0 +_08153364: .4byte 0x03005d88 +_08153368: .4byte 0x030061fc +_0815336C: .4byte 0x03006294 +_08153370: + ldr r0, _0815337C + strh r4, [r0] + movs r0, 0x1 +_08153376: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0815337C: .4byte 0x03006294 + thumb_func_end save_game_when_memory_present + + thumb_func_start sub_8153380 +sub_8153380: @ 8153380 + push {lr} + ldr r0, _0815339C + ldr r0, [r0] + cmp r0, 0x1 + bne _081533A4 + bl sub_8153190 + bl save_serialize_game + ldr r0, _081533A0 + bl sub_8152934 + movs r0, 0 + b _081533A6 + .align 2, 0 +_0815339C: .4byte 0x03005d88 +_081533A0: .4byte 0x03006220 +_081533A4: + movs r0, 0x1 +_081533A6: + pop {r1} + bx r1 + thumb_func_end sub_8153380 + + thumb_func_start sub_81533AC +sub_81533AC: @ 81533AC + push {r4,lr} + ldr r1, _081533D0 + movs r0, 0xE + bl sub_81529D4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081533D4 + ldr r0, [r0] + cmp r0, 0 + beq _081533C8 + movs r0, 0 + bl fullscreen_save_activate +_081533C8: + cmp r4, 0xFF + beq _081533D8 + movs r0, 0 + b _081533DA + .align 2, 0 +_081533D0: .4byte 0x03006220 +_081533D4: .4byte 0x030061fc +_081533D8: + movs r0, 0x1 +_081533DA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81533AC + + thumb_func_start sub_81533E0 +sub_81533E0: @ 81533E0 + push {lr} + ldr r1, _08153400 + movs r0, 0xE + bl sub_8152A34 + ldr r0, _08153404 + ldr r0, [r0] + cmp r0, 0 + beq _081533F8 + movs r0, 0 + bl fullscreen_save_activate +_081533F8: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08153400: .4byte 0x03006220 +_08153404: .4byte 0x030061fc + thumb_func_end sub_81533E0 + + thumb_func_start sub_8153408 +sub_8153408: @ 8153408 + push {lr} + ldr r1, _08153428 + movs r0, 0xE + bl sub_8152CAC + ldr r0, _0815342C + ldr r0, [r0] + cmp r0, 0 + beq _08153420 + movs r0, 0 + bl fullscreen_save_activate +_08153420: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08153428: .4byte 0x03006220 +_0815342C: .4byte 0x030061fc + thumb_func_end sub_8153408 + + thumb_func_start sub_8153430 +sub_8153430: @ 8153430 + push {r4,lr} + ldr r0, _08153460 + ldr r0, [r0] + cmp r0, 0x1 + bne _0815346C + bl sub_8153190 + bl save_serialize_game + ldr r4, _08153464 + adds r0, r4, 0 + bl sub_8152990 + ldr r0, _08153468 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_8152A34 + movs r0, 0 + b _0815346E + .align 2, 0 +_08153460: .4byte 0x03005d88 +_08153464: .4byte 0x03006220 +_08153468: .4byte 0x03006208 +_0815346C: + movs r0, 0x1 +_0815346E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153430 + + thumb_func_start sub_8153474 +sub_8153474: @ 8153474 + push {r4-r6,lr} + movs r6, 0 + ldr r0, _081534A0 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r0, r1, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bhi _081534A8 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + ldr r4, _081534A4 + adds r1, r4, 0 + bl sub_8152A34 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8152D44 + b _081534B2 + .align 2, 0 +_081534A0: .4byte 0x03006208 +_081534A4: .4byte 0x03006220 +_081534A8: + ldr r1, _081534C8 + adds r0, r5, 0 + bl sub_8152D44 + movs r6, 0x1 +_081534B2: + ldr r0, _081534CC + ldr r0, [r0] + cmp r0, 0 + beq _081534C0 + movs r0, 0x1 + bl fullscreen_save_activate +_081534C0: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081534C8: .4byte 0x03006220 +_081534CC: .4byte 0x030061fc + thumb_func_end sub_8153474 + + thumb_func_start sub_81534D0 +sub_81534D0: @ 81534D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081534E8 + ldr r0, [r0] + cmp r0, 0x1 + beq _081534F0 + ldr r1, _081534EC + movs r0, 0x4 + strh r0, [r1] + movs r0, 0xFF + b _08153550 + .align 2, 0 +_081534E8: .4byte 0x03005d88 +_081534EC: .4byte 0x03006210 +_081534F0: + bl sub_8153190 + cmp r4, 0 + beq _081534FC + cmp r4, 0x3 + beq _08153528 +_081534FC: + ldr r0, _08153518 + ldr r1, _0815351C + bl sub_8152DD0 + lsls r0, 24 + lsrs r4, r0, 24 + bl save_deserialize_game + ldr r0, _08153520 + strh r4, [r0] + ldr r1, _08153524 + movs r0, 0 + str r0, [r1] + b _0815354E + .align 2, 0 +_08153518: .4byte 0x0000ffff +_0815351C: .4byte 0x03006220 +_08153520: .4byte 0x03006210 +_08153524: .4byte 0x03006214 +_08153528: + ldr r5, _08153558 + movs r6, 0xF8 + lsls r6, 4 + movs r0, 0x1C + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81530DC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0815354E + adds r1, r5, r6 + movs r0, 0x1D + adds r2, r6, 0 + bl sub_81530DC + lsls r0, 24 + lsrs r4, r0, 24 +_0815354E: + adds r0, r4, 0 +_08153550: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08153558: .4byte 0x0201c000 + thumb_func_end sub_81534D0 + + thumb_func_start sub_815355C +sub_815355C: @ 815355C + push {r4-r7,lr} + ldr r5, _08153570 + ldr r0, _08153574 + str r0, [r5] + adds r7, r0, 0 + ldr r0, _08153578 + ldr r4, [r0] + cmp r4, 0x1 + beq _0815358C + b _081535C8 + .align 2, 0 +_08153570: .4byte 0x03006204 +_08153574: .4byte 0x0203abbc +_08153578: .4byte 0x03005d88 +_0815357C: + ldrb r1, [r7, 0xA] + ldrb r0, [r7, 0xB] + adds r1, r0 + ldrb r0, [r7, 0xC] + adds r1, r0 + ldrb r0, [r7, 0xD] + adds r0, r1 + b _081535CA +_0815358C: + bl sub_8153190 + ldr r0, _081535D0 + bl sub_8152EC8 + ldr r0, _081535D4 + ldr r1, [r0] + ands r1, r4 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 17 + lsrs r6, r0, 16 + movs r4, 0 +_081535A6: + adds r0, r4, r6 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r5] + bl sub_815314C + ldr r0, [r5] + ldr r1, _081535D8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0815357C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _081535A6 +_081535C8: + movs r0, 0 +_081535CA: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081535D0: .4byte 0x03006220 +_081535D4: .4byte 0x03006200 +_081535D8: .4byte 0x00000ff4 + thumb_func_end sub_815355C + + thumb_func_start sub_81535DC +sub_81535DC: @ 81535DC + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xE2 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08153608 + ldr r4, _0815360C + movs r3, 0x80 + lsls r3, 5 + adds r0, r1, 0 + movs r1, 0 + adds r2, r4, 0 + bl ReadFlash + ldr r1, [r4] + ldr r0, _08153610 + cmp r1, r0 + beq _08153614 +_08153608: + movs r0, 0xFF + b _0815362A + .align 2, 0 +_0815360C: .4byte 0x0203abbc +_08153610: .4byte 0x0000b39d +_08153614: + movs r3, 0 + ldr r5, _08153630 + adds r2, r4, 0x4 +_0815361A: + adds r0, r6, r3 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, r5 + ble _0815361A + movs r0, 0x1 +_0815362A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08153630: .4byte 0x00000ffb + thumb_func_end sub_81535DC + + thumb_func_start sub_8153634 +sub_8153634: @ 8153634 + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0xE2 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08153680 + ldr r7, _08153674 + ldr r0, _08153678 + adds r3, r7, 0 + stm r3!, {r0} + movs r2, 0 + ldr r4, _0815367C +_08153654: + adds r0, r3, r2 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r4 + ble _08153654 + adds r0, r6, 0 + adds r1, r7, 0 + bl ProgramFlashSectorsAndVerify + cmp r0, 0 + bne _08153680 + movs r0, 0x1 + b _08153682 + .align 2, 0 +_08153674: .4byte 0x0203abbc +_08153678: .4byte 0x0000b39d +_0815367C: .4byte 0x00000ffb +_08153680: + movs r0, 0xFF +_08153682: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8153634 + + thumb_func_start sub_8153688 +sub_8153688: @ 8153688 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _081536AC + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0xB + bls _081536A2 + b _081537C2 +_081536A2: + lsls r0, 2 + ldr r1, _081536B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081536AC: .4byte 0x03005e08 +_081536B0: .4byte _081536B4 + .align 2, 0 +_081536B4: + .4byte _081536E4 + .4byte _081536F4 + .4byte _081536FE + .4byte _0815371A + .4byte _0815372C + .4byte _08153742 + .4byte _08153758 + .4byte _08153762 + .4byte _08153778 + .4byte _0815378C + .4byte _08153796 + .4byte _081537A8 +_081536E4: + ldr r0, _081536F0 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + strh r0, [r4] + b _081537C2 + .align 2, 0 +_081536F0: .4byte 0x03002700 +_081536F4: + bl sub_800ADF8 + movs r0, 0x2 + strh r0, [r4] + b _081537C2 +_081536FE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081537C2 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08153714 + bl save_serialize_map +_08153714: + movs r0, 0x3 + strh r0, [r4] + b _081537C2 +_0815371A: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08153726 + bl sub_8076D5C +_08153726: + bl sub_8153380 + b _08153752 +_0815372C: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x5 + bne _081537C2 + movs r0, 0 + strh r0, [r4, 0x2] + strh r1, [r4] + b _081537C2 +_08153742: + bl sub_81533AC + lsls r0, 24 + cmp r0, 0 + beq _08153752 + movs r0, 0x6 + strh r0, [r4] + b _081537C2 +_08153752: + movs r0, 0x4 + strh r0, [r4] + b _081537C2 +_08153758: + bl sub_81533E0 + movs r0, 0x7 + strh r0, [r4] + b _081537C2 +_08153762: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815376E + bl sav2_gender2_inplace_and_xFE +_0815376E: + bl sub_800ADF8 + movs r0, 0x8 + strh r0, [r4] + b _081537C2 +_08153778: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081537C2 + bl sub_8153408 + movs r0, 0x9 + strh r0, [r4] + b _081537C2 +_0815378C: + bl sub_800ADF8 + movs r0, 0xA + strh r0, [r4] + b _081537C2 +_08153796: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081537C2 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081537C2 +_081537A8: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _081537C2 + ldr r1, _081537C8 + movs r0, 0 + strb r0, [r1] + adds r0, r2, 0 + bl remove_task +_081537C2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081537C8: .4byte 0x03002700 + thumb_func_end sub_8153688 + + thumb_func_start sub_81537CC +sub_81537CC: @ 81537CC + push {r4,lr} + adds r4, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 16 + lsrs r2, 16 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _081537FC + ands r1, r3 + cmp r1, 0 + beq _081537FC + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _081537FC + movs r0, 0x80 + lsls r0, 2 + ands r0, r4 + cmp r0, 0 + beq _081537FC + movs r0, 0x1 + b _081537FE +_081537FC: + movs r0, 0 +_081537FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81537CC + + thumb_func_start sub_8153804 +sub_8153804: @ 8153804 + push {lr} + ldr r0, _08153818 + ldr r1, _0815381C + bl ExpandTextCodes + movs r0, 0x3 + bl sub_81538C4 + pop {r0} + bx r0 + .align 2, 0 +_08153818: .4byte 0x02021fc4 +_0815381C: .4byte 0x08674c86 + thumb_func_end sub_8153804 + + thumb_func_start sub_8153820 +sub_8153820: @ 8153820 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, _08153848 + ldr r2, _0815384C + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script + str r5, [r4, 0x64] + movs r0, 0 + str r0, [r4, 0x68] + str r0, [r4, 0x6C] + str r0, [r4, 0x70] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08153848: .4byte 0x082ded2c +_0815384C: .4byte 0x082ded70 + thumb_func_end sub_8153820 + + thumb_func_start sub_8153850 +sub_8153850: @ 8153850 + push {r4,lr} + adds r4, r0, 0 + bl script_main_handler + lsls r0, 24 + cmp r0, 0 + beq _08153868 + ldr r0, [r4, 0x70] + cmp r0, 0 + beq _08153868 + movs r0, 0x1 + b _0815386A +_08153868: + movs r0, 0 +_0815386A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153850 + + thumb_func_start sub_8153870 +sub_8153870: @ 8153870 + push {lr} + adds r1, r0, 0 + ldr r0, _08153880 + bl sub_8153820 + pop {r0} + bx r0 + .align 2, 0 +_08153880: .4byte 0x0203bbc0 + thumb_func_end sub_8153870 + + thumb_func_start sub_8153884 +sub_8153884: @ 8153884 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0815389C + adds r0, r4, 0 + bl sub_8153850 + ldr r1, [r4, 0x6C] + str r1, [r5] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0815389C: .4byte 0x0203bbc0 + thumb_func_end sub_8153884 + + thumb_func_start sub_81538A0 +sub_81538A0: @ 81538A0 + push {r4,lr} + adds r1, r0, 0 + ldr r4, _081538C0 + adds r0, r4, 0 + bl sub_8153820 +_081538AC: + adds r0, r4, 0 + bl sub_8153850 + cmp r0, 0 + bne _081538AC + ldr r0, [r4, 0x6C] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081538C0: .4byte 0x0203bbc0 + thumb_func_end sub_81538A0 + + thumb_func_start sub_81538C4 +sub_81538C4: @ 81538C4 + ldr r1, _081538CC + str r0, [r1, 0x6C] + bx lr + .align 2, 0 +_081538CC: .4byte 0x0203bbc0 + thumb_func_end sub_81538C4 + + thumb_func_start sub_81538D0 +sub_81538D0: @ 81538D0 + push {lr} + movs r2, 0 + ldr r0, _081538F0 + ldr r0, [r0] + ldr r1, _081538F4 + adds r3, r0, r1 + movs r1, 0 +_081538DE: + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r0 + adds r1, 0x1 + cmp r1, 0xB + bls _081538DE + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_081538F0: .4byte 0x03005d8c +_081538F4: .4byte 0x00003b18 + thumb_func_end sub_81538D0 + + thumb_func_start sub_81538F8 +sub_81538F8: @ 81538F8 + push {r4,r5,lr} + ldr r5, _08153930 + ldr r0, [r5] + ldr r1, _08153934 + adds r4, r0, r1 + bl sub_81538D0 + adds r1, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0815392A + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0815392A + ldrh r0, [r4, 0x2] + cmp r0, 0 + beq _0815392A + cmp r1, 0 + beq _0815392A + ldr r0, [r5] + ldr r2, _08153938 + adds r0, r2 + ldr r0, [r0] + cmp r1, r0 + beq _0815393C +_0815392A: + movs r0, 0 + b _0815393E + .align 2, 0 +_08153930: .4byte 0x03005d8c +_08153934: .4byte 0x00003b18 +_08153938: .4byte 0x00003b14 +_0815393C: + movs r0, 0x1 +_0815393E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81538F8 + + thumb_func_start sub_8153944 +sub_8153944: @ 8153944 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, _08153964 + ldr r1, [r0] + ldr r0, _08153968 + adds r1, r0 + ldr r2, _0815396C + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08153964: .4byte 0x03005d8c +_08153968: .4byte 0x00003b14 +_0815396C: .4byte 0x01000008 + thumb_func_end sub_8153944 + + thumb_func_start sub_8153970 +sub_8153970: @ 8153970 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + lsls r2, 16 + lsrs r2, 16 + adds r6, r2, 0 + cmp r3, 0 + beq _08153990 + cmp r1, 0 + beq _08153990 + cmp r2, 0 + bne _08153996 +_08153990: + bl sub_8153944 + b _081539BC +_08153996: + ldr r4, _081539C4 + ldr r0, [r4] + ldr r1, _081539C8 + adds r0, r1 + strb r3, [r0] + ldr r0, [r4] + ldr r2, _081539CC + adds r0, r2 + strb r5, [r0] + ldr r0, [r4] + adds r1, 0x2 + adds r0, r1 + strh r6, [r0] + bl sub_81538D0 + ldr r1, [r4] + ldr r2, _081539D0 + adds r1, r2 + str r0, [r1] +_081539BC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081539C4: .4byte 0x03005d8c +_081539C8: .4byte 0x00003b18 +_081539CC: .4byte 0x00003b19 +_081539D0: .4byte 0x00003b14 + thumb_func_end sub_8153970 + + thumb_func_start sub_81539D4 +sub_81539D4: @ 81539D4 + push {r4-r6,lr} + ldr r6, _081539F0 + ldr r0, [r6] + ldr r1, _081539F4 + adds r4, r0, r1 + bl sub_81538F8 + cmp r0, 0 + bne _081539F8 + bl sub_8153944 + movs r0, 0 + b _08153A1A + .align 2, 0 +_081539F0: .4byte 0x03005d8c +_081539F4: .4byte 0x00003b18 +_081539F8: + ldrh r5, [r4, 0x2] + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _08153A0C + bl sub_8153944 + b _08153A18 +_08153A0C: + bl sub_81538D0 + ldr r1, [r6] + ldr r2, _08153A20 + adds r1, r2 + str r0, [r1] +_08153A18: + adds r0, r5, 0 +_08153A1A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08153A20: .4byte 0x00003b14 + thumb_func_end sub_81539D4 + + thumb_func_start script_status_stop_and_ret_1 +script_status_stop_and_ret_1: @ 8153A24 + push {lr} + bl script_stop + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end script_status_stop_and_ret_1 + + thumb_func_start sub_8153A30 +sub_8153A30: @ 8153A30 + push {r4-r7,lr} + adds r7, r0, 0 + bl script_read_word + str r0, [r7, 0x68] + adds r0, r7, 0 + bl script_read_halfword + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r7, 0 + bl script_read_word + adds r6, r0, 0 + adds r0, r7, 0 + bl script_read_halfword + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl script_read_word + adds r3, r0, 0 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_81537CC + cmp r0, 0x1 + bne _08153A74 + str r0, [r7, 0x70] + b _08153A78 +_08153A74: + bl sub_8153804 +_08153A78: + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8153A30 + + thumb_func_start sub_8153A80 +sub_8153A80: @ 8153A80 + movs r0, 0 + bx lr + thumb_func_end sub_8153A80 + + thumb_func_start sub_8153A84 +sub_8153A84: @ 8153A84 + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + str r2, [r0, 0x6C] + movs r0, 0 + bx lr + thumb_func_end sub_8153A84 + + thumb_func_start sub_8153A94 +sub_8153A94: @ 8153A94 + 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 + ldr r1, [r4, 0x68] + subs r0, r1 + ldr r1, [r4, 0x64] + adds r1, r0, r1 + cmp r5, 0xFF + beq _08153AB8 + ldr r0, [r4, 0x6C] + cmp r5, r0 + bne _08153ABE +_08153AB8: + ldr r0, _08153AC8 + bl ExpandTextCodes +_08153ABE: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08153AC8: .4byte 0x02021fc4 + thumb_func_end sub_8153A94 + + thumb_func_start sub_8153ACC +sub_8153ACC: @ 8153ACC + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + ldr r1, [r4, 0x68] + subs r0, r1 + ldr r1, [r4, 0x64] + adds r0, r1 + bl script_env_2_execute_new_script + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153ACC + + thumb_func_start sub_8153AE8 +sub_8153AE8: @ 8153AE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + bl sub_80E162C + mov r8, r0 + adds r0, r7, 0 + bl script_read_word + adds r4, r0, 0 + ldr r0, [r7, 0x68] + subs r4, r0 + ldr r0, [r7, 0x64] + adds r4, r0 + ldr r0, _08153B3C + mov r9, r0 + ldr r6, _08153B40 + ldr r1, [r6] + ldr r5, _08153B44 + adds r1, r5 + movs r2, 0x7 + bl gf_strncpy + adds r0, r4, 0 + bl sub_80E15E4 + ldr r4, _08153B48 + ldr r1, [r6] + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x7 + bl gf_strncpy + mov r0, r8 + cmp r0, 0 + bne _08153B54 + ldr r0, _08153B4C + ldr r1, _08153B50 + b _08153B74 + .align 2, 0 +_08153B3C: .4byte 0x02021cc4 +_08153B40: .4byte 0x03005d8c +_08153B44: .4byte 0x000031f8 +_08153B48: .4byte 0x02021dc4 +_08153B4C: .4byte 0x02021fc4 +_08153B50: .4byte 0x08674ae4 +_08153B54: + mov r0, r9 + adds r1, r4, 0 + bl sub_8008C44 + cmp r0, 0 + beq _08153B70 + ldr r0, _08153B68 + ldr r1, _08153B6C + b _08153B74 + .align 2, 0 +_08153B68: .4byte 0x02021fc4 +_08153B6C: .4byte 0x08674b16 +_08153B70: + ldr r0, _08153B90 + ldr r1, _08153B94 +_08153B74: + bl ExpandTextCodes + movs r0, 0x2 + str r0, [r7, 0x6C] + bl sub_80E162C + cmp r0, 0x1 + bne _08153B9C + ldr r0, _08153B98 + movs r1, 0x1 + bl var_set + b _08153BA0 + .align 2, 0 +_08153B90: .4byte 0x02021fc4 +_08153B94: .4byte 0x08674b42 +_08153B98: .4byte 0x0000402d +_08153B9C: + movs r0, 0x1 + str r0, [r7, 0x6C] +_08153BA0: + movs r0, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8153AE8 + + thumb_func_start sub_8153BB0 +sub_8153BB0: @ 8153BB0 + 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] + bl sub_80F9B30 + ldr r0, _08153BDC + ldr r1, _08153BE0 + bl ExpandTextCodes + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08153BDC: .4byte 0x02021fc4 +_08153BE0: .4byte 0x08674b6a + thumb_func_end sub_8153BB0 + + thumb_func_start sub_8153BE4 +sub_8153BE4: @ 8153BE4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r4, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r4, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + adds r5, r0, 0 + ldr r0, [r4, 0x68] + subs r5, r0 + ldr r0, [r4, 0x64] + adds r5, r0 + adds r0, r4, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r4, 0x68] + subs r1, r0 + ldr r0, [r4, 0x64] + adds r1, r0 + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r6, [sp] + adds r0, r5, 0 + mov r2, r9 + mov r3, r8 + bl sub_80990FC + 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_8153BE4 + + thumb_func_start sub_8153C4C +sub_8153C4C: @ 8153C4C + push {r4,lr} + adds r4, r0, 0 + bl sub_809D3E8 + ldr r0, _08153C68 + ldr r1, _08153C6C + bl ExpandTextCodes + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08153C68: .4byte 0x02021fc4 +_08153C6C: .4byte 0x08674b9e + thumb_func_end sub_8153C4C + + thumb_func_start sub_8153C70 +sub_8153C70: @ 8153C70 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x8] + ldrb r0, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + bl sub_811EFC0 + ldr r0, _08153C94 + ldr r1, _08153C98 + bl ExpandTextCodes + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08153C94: .4byte 0x02021fc4 +_08153C98: .4byte 0x08674bd4 + thumb_func_end sub_8153C70 + + thumb_func_start sub_8153C9C +sub_8153C9C: @ 8153C9C + 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 r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8153970 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8153C9C + + thumb_func_start sub_8153CC8 +sub_8153CC8: @ 8153CC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x88 + adds r6, r0, 0 + bl script_read_word + ldr r1, [r6, 0x68] + subs r0, r1 + ldr r1, [r6, 0x64] + adds r5, r0, r1 + movs r0, 0x64 + adds r0, r5 + mov r8, r0 + add r4, sp, 0x24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bne _08153D18 + ldr r0, _08153D10 + ldr r1, _08153D14 + movs r2, 0xB + bl gf_strncpy + b _08153D22 + .align 2, 0 +_08153D10: .4byte 0x02021cc4 +_08153D14: .4byte 0x085e8264 +_08153D18: + ldr r0, _08153D38 + ldr r1, _08153D3C + movs r2, 0xB + bl gf_strncpy +_08153D22: + ldr r0, _08153D40 + ldrb r0, [r0] + cmp r0, 0x6 + bne _08153D4C + ldr r0, _08153D44 + ldr r1, _08153D48 + bl ExpandTextCodes + movs r0, 0x3 + b _08153DB6 + .align 2, 0 +_08153D38: .4byte 0x02021cc4 +_08153D3C: .4byte 0x085e8268 +_08153D40: .4byte 0x020244e9 +_08153D44: .4byte 0x02021fc4 +_08153D48: .4byte 0x08674c02 +_08153D4C: + ldr r7, _08153DC8 + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + mov r0, sp + mov r1, r8 + movs r2, 0x24 + bl memcpy + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + beq _08153D86 + adds r0, r4, 0 + bl species_to_pokedex_index + 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 +_08153D86: + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _08153DA4 + adds r0, r7, 0 + mov r1, sp + bl sub_80D460C +_08153DA4: + bl party_compaction + bl calc_player_party_count + ldr r0, _08153DCC + ldr r1, _08153DD0 + bl ExpandTextCodes + movs r0, 0x2 +_08153DB6: + str r0, [r6, 0x6C] + movs r0, 0 + add sp, 0x88 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08153DC8: .4byte 0x020246e0 +_08153DCC: .4byte 0x02021fc4 +_08153DD0: .4byte 0x08674bf0 + thumb_func_end sub_8153CC8 + + thumb_func_start sub_8153DD4 +sub_8153DD4: @ 8153DD4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r4, 0x68] + subs r1, r0 + ldr r0, [r4, 0x64] + adds r1, r0 + ldr r0, _08153E0C + ldr r0, [r0] + ldr r2, _08153E10 + adds r0, r2 + movs r2, 0xBC + bl memcpy + bl sub_81652B4 + ldr r0, _08153E14 + ldr r1, _08153E18 + bl ExpandTextCodes + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08153E0C: .4byte 0x03005d90 +_08153E10: .4byte 0x00000bec +_08153E14: .4byte 0x02021fc4 +_08153E18: .4byte 0x08674c31 + thumb_func_end sub_8153DD4 + + thumb_func_start sub_8153E1C +sub_8153E1C: @ 8153E1C + push {r4,lr} + adds r4, r0, 0 + bl sub_809D5F4 + ldr r0, _08153E38 + ldr r1, _08153E3C + bl ExpandTextCodes + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08153E38: .4byte 0x02021fc4 +_08153E3C: .4byte 0x085ecad8 + thumb_func_end sub_8153E1C + + thumb_func_start sub_8153E40 +sub_8153E40: @ 8153E40 + push {r4-r6,lr} + adds r6, r0, 0 + bl script_read_word + adds r5, r0, 0 + adds r0, r6, 0 + bl script_read_word + adds r4, r0, 0 + ldr r0, [r6, 0x68] + subs r4, r0 + ldr r0, [r6, 0x64] + adds r4, r0 + adds r0, r6, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r6, 0x68] + subs r1, r0 + ldr r0, [r6, 0x64] + adds r1, r0 + subs r1, r4 + adds r0, r4, 0 + bl sub_806F96C + cmp r5, r0 + beq _08153E7E + movs r0, 0 + str r0, [r6, 0x70] + movs r0, 0x1 + str r0, [r6, 0x6C] +_08153E7E: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8153E40 + + thumb_func_start sub_8153E88 +sub_8153E88: @ 8153E88 + push {r4-r6,lr} + adds r6, r0, 0 + bl script_read_word + adds r5, r0, 0 + adds r0, r6, 0 + bl script_read_word + adds r4, r0, 0 + ldr r0, [r6, 0x68] + subs r4, r0 + ldr r0, [r6, 0x64] + adds r4, r0 + adds r0, r6, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r6, 0x68] + subs r1, r0 + ldr r0, [r6, 0x64] + adds r1, r0 + subs r1, r4 + adds r0, r4, 0 + bl sub_806F8D0 + lsls r0, 16 + lsrs r0, 16 + cmp r5, r0 + beq _08153ECA + movs r0, 0 + str r0, [r6, 0x70] + movs r0, 0x1 + str r0, [r6, 0x6C] +_08153ECA: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8153E88 + + thumb_func_start dp03_step_water_reflection +dp03_step_water_reflection: @ 8153ED4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x22 + ldrsh r2, [r4, r0] + adds r0, r4, 0 + movs r3, 0x98 + bl obj_unfreeze + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08153F84 + adds r7, r1, r0 + ldr r0, _08153F88 + str r0, [r7, 0x1C] + ldrb r1, [r7, 0x5] + movs r0, 0xC + orrs r1, r0 + strb r1, [r7, 0x5] + ldr r2, _08153F8C + lsrs r0, r1, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 4 + movs r2, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x5] + movs r1, 0x3F + adds r1, r7 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0x40 + orrs r0, r1 + mov r1, r8 + strb r0, [r1] + ldr r0, _08153F90 + str r0, [r7, 0x8] + adds r0, r7, 0 + movs r1, 0 + bl obj_anim_image_start + ldr r0, _08153F94 + str r0, [r7, 0x10] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x8 + orrs r0, r1 + mov r1, r8 + strb r0, [r1] + adds r2, r7, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x2E] + strh r0, [r7, 0x2E] + ldrb r0, [r6, 0x8] + strh r0, [r7, 0x30] + strh r5, [r7, 0x3C] + adds r0, r6, 0 + adds r1, r7, 0 + bl npc_pal_op + cmp r5, 0 + bne _08153F7A + ldrb r0, [r7, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strb r1, [r7, 0x1] +_08153F7A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08153F84: .4byte 0x02020630 +_08153F88: .4byte objc_80DAF50 + 1 +_08153F8C: .4byte 0x084975c4 +_08153F90: .4byte 0x082ec69c +_08153F94: .4byte 0x082ec6a8 + thumb_func_end dp03_step_water_reflection + + thumb_func_start sub_8153F98 +sub_8153F98: @ 8153F98 + push {lr} + ldrb r0, [r0, 0x5] + bl npc_get_type + ldrh r0, [r0, 0xA] + subs r0, 0x2 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8153F98 + + thumb_func_start npc_pal_op +npc_pal_op: @ 8153FAC + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _08154004 + mov r0, sp + movs r2, 0x6 + bl memcpy + movs r0, 0 + strh r0, [r4, 0x32] + ldrb r0, [r5, 0x5] + bl npc_get_type + ldrb r1, [r0, 0xC] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08154008 + ldrb r0, [r5, 0x1F] + bl sub_80894D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08153FEE + ldrb r0, [r5, 0x1E] + bl sub_80894D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08154008 +_08153FEE: + subs r0, 0x1 + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r0, r5, 0 + bl npc_pal_op_A + b _08154012 + .align 2, 0 +_08154004: .4byte 0x085cdc38 +_08154008: + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r0, r5, 0 + bl npc_pal_op_B +_08154012: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end npc_pal_op + + thumb_func_start npc_pal_op_B +npc_pal_op_B: @ 815401C + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldrb r0, [r0, 0x5] + bl npc_get_type + adds r2, r0, 0 + ldrh r1, [r2, 0x4] + ldr r0, _08154048 + cmp r1, r0 + beq _08154070 + ldrb r0, [r2, 0xC] + movs r1, 0xF + ands r1, r0 + cmp r1, 0 + bne _0815404C + ldrh r0, [r2, 0x2] + adds r1, r4, 0 + bl npc_load_two_palettes__no_record + b _0815406A + .align 2, 0 +_08154048: .4byte 0x000011ff +_0815404C: + cmp r1, 0xA + bne _0815405A + ldrh r0, [r2, 0x2] + adds r1, r4, 0 + bl npc_load_two_palettes__and_record + b _0815406A +_0815405A: + adds r0, r4, 0 + bl npc_paltag_by_palslot + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl pal_patch_for_npc +_0815406A: + adds r0, r4, 0 + bl sub_80ABE18 +_08154070: + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_pal_op_B + + thumb_func_start npc_pal_op_A +npc_pal_op_A: @ 8154078 + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldrb r0, [r0, 0x5] + bl npc_get_type + adds r2, r0, 0 + ldrh r1, [r2, 0x4] + ldr r0, _081540A4 + cmp r1, r0 + beq _0815409C + adds r0, r1, 0 + adds r1, r4, 0 + bl pal_patch_for_npc + adds r0, r4, 0 + bl sub_80ABE18 +_0815409C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081540A4: .4byte 0x000011ff + thumb_func_end npc_pal_op_A + + thumb_func_start objc_80DAF50 +objc_80DAF50: @ 81540A8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081540F0 + adds r7, r0, r1 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081540F4 + adds r5, r0, r1 + ldr r0, [r7] + ldr r1, _081540F8 + ands r0, r1 + cmp r0, r1 + bne _081540E0 + ldrb r1, [r7, 0x8] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r1, r0 + beq _081540FC +_081540E0: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _08154214 + .align 2, 0 +_081540F0: .4byte 0x02037350 +_081540F4: .4byte 0x02020630 +_081540F8: .4byte 0x00020001 +_081540FC: + ldr r1, _08154220 + ldrb r0, [r5, 0x5] + lsrs r0, 4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldrb r1, [r5, 0x1] + lsrs r1, 6 + lsls r1, 6 + ldrb r2, [r4, 0x1] + movs r3, 0x3F + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r5, 0x3] + lsrs r0, 6 + lsls r0, 6 + ldrb r2, [r4, 0x3] + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x3] + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + movs r2, 0x10 + orrs r0, r2 + lsls r0, 1 + subs r2, 0x4F + mov r9, r2 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x3] + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + ldrh r2, [r4, 0x4] + ldr r0, _08154224 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, [r5, 0x18] + str r0, [r4, 0x18] + adds r0, r5, 0 + adds r0, 0x42 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 26 + adds r2, r4, 0 + adds r2, 0x42 + ands r3, r0 + ldrb r1, [r2] + movs r0, 0x40 + negs r0, r0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + movs r0, 0x3E + adds r0, r5 + mov r8, r0 + ldrb r0, [r0] + adds r6, r4, 0 + adds r6, 0x3E + movs r1, 0x4 + ands r1, r0 + ldrb r2, [r6] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + ldrh r0, [r5, 0x20] + strh r0, [r4, 0x20] + adds r0, r7, 0 + bl sub_8153F98 + ldrh r1, [r5, 0x22] + adds r0, r1 + ldrh r1, [r4, 0x32] + adds r1, r0 + strh r1, [r4, 0x22] + adds r0, r5, 0 + adds r0, 0x28 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x28 + strb r1, [r0] + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x29 + strb r0, [r1] + ldrh r0, [r5, 0x24] + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] + mov r2, r8 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + ldrb r1, [r6] + movs r2, 0x3 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r6] + ldrb r0, [r7, 0x3] + lsls r0, 28 + cmp r0, 0 + bge _081541EE + movs r0, 0x4 + orrs r2, r0 + strb r2, [r6] +_081541EE: + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08154214 + ldrb r0, [r4, 0x3] + mov r2, r9 + ands r2, r0 + strb r2, [r4, 0x3] + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08154214 + movs r1, 0x2 + adds r0, r2, 0 + orrs r0, r1 + strb r0, [r4, 0x3] +_08154214: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08154220: .4byte 0x084975c4 +_08154224: .4byte 0xfffffc00 + thumb_func_end objc_80DAF50 + + thumb_func_start sub_8154228 +sub_8154228: @ 8154228 + push {r4,lr} + ldr r0, _08154270 + ldr r0, [r0, 0x20] + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0x40 + beq _08154266 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08154274 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + orrs r0, r3 + strb r0, [r1] +_08154266: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08154270: .4byte 0x085059f8 +_08154274: .4byte 0x02020630 + thumb_func_end sub_8154228 + + thumb_func_start objid_set_invisible +objid_set_invisible: @ 8154278 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08154294 + 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] + bx lr + .align 2, 0 +_08154294: .4byte 0x02020630 + thumb_func_end objid_set_invisible + + thumb_func_start sub_8154298 +sub_8154298: @ 8154298 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r6, r3, 16 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, _0815433C + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081542E2 + movs r0, 0x2E + ldrsh r1, [r2, r0] + lsls r0, r7, 16 + asrs r0, 16 + cmp r1, r0 + bne _081542E2 + movs r0, 0x30 + ldrsh r1, [r2, r0] + lsls r0, r6, 16 + asrs r0, 16 + cmp r1, r0 + beq _0815432E +_081542E2: + lsls r0, r7, 16 + asrs r0, 16 + lsls r1, r6, 16 + asrs r1, 16 + mov r4, sp + adds r4, 0x2 + mov r2, sp + adds r3, r4, 0 + bl sub_8093038 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, _0815433C + adds r2, r0, r1 + mov r0, sp + ldrh r0, [r0] + adds r0, 0x8 + strh r0, [r2, 0x20] + ldrh r0, [r4] + adds r0, 0x8 + strh r0, [r2, 0x22] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + strh r7, [r2, 0x2E] + strh r6, [r2, 0x30] + mov r1, r8 + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl obj_anim_image_start +_0815432E: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815433C: .4byte 0x02020630 + thumb_func_end sub_8154298 + + thumb_func_start oei_shadow +oei_shadow: @ 8154340 + push {r4,r5,lr} + ldr r5, _081543CC + ldrb r0, [r5] + ldrb r1, [r5, 0x4] + ldrb r2, [r5, 0x8] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081543D0 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + bl npc_get_type + adds r4, r0, 0 + ldr r2, _081543D4 + ldr r1, _081543D8 + ldrb r0, [r4, 0xC] + lsls r0, 26 + lsrs r0, 30 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + movs r3, 0x94 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081543C4 + ldr r0, _081543DC + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + ldr r0, [r5] + strh r0, [r2, 0x2E] + ldr r0, [r5, 0x4] + strh r0, [r2, 0x30] + ldr r0, [r5, 0x8] + strh r0, [r2, 0x32] + ldrh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 17 + ldr r3, _081543E0 + ldrb r0, [r4, 0xC] + lsls r0, 26 + lsrs r0, 30 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + subs r1, r0 + strh r1, [r2, 0x34] +_081543C4: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081543CC: .4byte 0x02038c08 +_081543D0: .4byte 0x02037350 +_081543D4: .4byte 0x085059f8 +_081543D8: .4byte 0x085cdc3e +_081543DC: .4byte 0x02020630 +_081543E0: .4byte 0x085cdc42 + thumb_func_end oei_shadow + + thumb_func_start oamc_shadow +oamc_shadow: @ 81543E4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r5, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + beq _08154412 + adds r0, r5, 0 + movs r1, 0x3 + bl oe_stop + b _08154498 +_08154412: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081544A0 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081544A4 + adds r1, r0 + ldrb r0, [r1, 0x5] + movs r2, 0xC + ands r2, r0 + ldrb r3, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r5, 0x5] + ldrh r0, [r1, 0x20] + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x34] + ldrh r1, [r1, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldr r0, [r4] + ldr r1, _081544A8 + ands r0, r1 + cmp r0, r1 + bne _08154490 + ldrb r0, [r4, 0x1E] + bl sub_8088E64 + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1E] + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1F] + bl is_tile_grass_maybe + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1E] + bl is_water_tile_2 + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1F] + bl is_water_tile_2 + lsls r0, 24 + cmp r0, 0 + beq _08154498 +_08154490: + adds r0, r5, 0 + movs r1, 0x3 + bl oe_stop +_08154498: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081544A0: .4byte 0x02037350 +_081544A4: .4byte 0x02020630 +_081544A8: .4byte 0x00400001 + thumb_func_end oamc_shadow + + thumb_func_start oei_grass_normal +oei_grass_normal: @ 81544AC + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _08154544 + ldrh r1, [r5] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x4] + 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, _08154548 + ldr r0, [r0, 0x10] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08154538 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0815454C + adds r3, r0, r1 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x3 + ldrb r1, [r5, 0xC] + 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] + ldr r0, [r5, 0x8] + strh r0, [r3, 0x2E] + ldr r0, [r5] + strh r0, [r3, 0x30] + ldr r0, [r5, 0x4] + strh r0, [r3, 0x32] + ldr r0, [r5, 0x10] + strh r0, [r3, 0x34] + ldr r0, [r5, 0x14] + strh r0, [r3, 0x36] + ldr r0, [r5, 0x18] + strh r0, [r3, 0x38] + ldr r0, [r5, 0x1C] + cmp r0, 0 + beq _08154538 + adds r0, r3, 0 + movs r1, 0x4 + bl obj_anim_image_seek +_08154538: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08154544: .4byte 0x02038c08 +_08154548: .4byte 0x085059f8 +_0815454C: .4byte 0x02020630 + thumb_func_end oei_grass_normal + + thumb_func_start unc_grass_normal +unc_grass_normal: @ 8154550 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + lsrs r4, r0, 8 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, _081545FC + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815459C + ldr r0, _08154600 + ldr r2, [r0] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, r4 + bne _08154582 + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r0, r7 + beq _0815459C +_08154582: + ldr r1, [r3, 0x4] + ldrh r0, [r5, 0x30] + subs r0, r1 + strh r0, [r5, 0x30] + ldr r1, [r3, 0x8] + ldrh r0, [r5, 0x32] + subs r0, r1 + strh r0, [r5, 0x32] + ldrb r1, [r2, 0x5] + lsls r1, 8 + ldrb r0, [r2, 0x4] + orrs r0, r1 + strh r0, [r5, 0x38] +_0815459C: + ldrh r0, [r5, 0x34] + lsrs r1, r0, 8 + mov r8, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r5, 0x36] + lsls r0, 24 + lsrs r7, r0, 24 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r8 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _081545F0 + adds r0, r6, 0 + bl is_tile_x02_or_xD1 + lsls r0, 24 + cmp r0, 0 + beq _081545F0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08154604 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08154604 +_081545F0: + adds r0, r5, 0 + movs r1, 0x4 + bl oe_stop + b _08154648 + .align 2, 0 +_081545FC: .4byte 0x02037334 +_08154600: .4byte 0x03005d8c +_08154604: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08154654 + adds r2, r0, r1 + ldr r0, [r2, 0x10] + ldr r1, [r5, 0x30] + cmp r0, r1 + beq _08154624 + ldr r0, [r2, 0x14] + cmp r0, r1 + beq _08154624 + movs r0, 0x1 + strh r0, [r5, 0x3C] +_08154624: + movs r6, 0 + adds r0, r5, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + bne _08154632 + movs r6, 0x4 +_08154632: + adds r0, r5, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_81561FC +_08154648: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08154654: .4byte 0x02037350 + thumb_func_end unc_grass_normal + + thumb_func_start sub_8154658 +sub_8154658: @ 8154658 + push {r4,lr} + ldr r4, _081546BC + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0xC + bl sub_80930E0 + ldr r0, _081546C0 + ldr r0, [r0, 0x28] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081546B4 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _081546C4 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0xC + strh r0, [r2, 0x30] +_081546B4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081546BC: .4byte 0x02038c08 +_081546C0: .4byte 0x085059f8 +_081546C4: .4byte 0x02020630 + thumb_func_end sub_8154658 + + thumb_func_start sub_81546C8 +sub_81546C8: @ 81546C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r5, 0 + ldr r0, _08154738 + mov r8, r0 + lsls r3, 16 + asrs r3, 16 + lsls r4, 16 + asrs r4, 16 +_081546EC: + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + mov r1, r8 + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _08154740 + ldr r1, [r2, 0x1C] + ldr r0, _0815473C + cmp r1, r0 + bne _08154740 + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r3, r0 + bne _08154740 + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r4, r0 + bne _08154740 + ldrh r1, [r2, 0x34] + lsrs r0, r1, 8 + cmp r12, r0 + bne _08154740 + movs r0, 0xFF + ands r0, r1 + cmp r7, r0 + bne _08154740 + movs r1, 0x36 + ldrsh r0, [r2, r1] + cmp r6, r0 + bne _08154740 + adds r0, r5, 0 + b _0815474C + .align 2, 0 +_08154738: .4byte 0x02020630 +_0815473C: .4byte unc_grass_normal + 1 +_08154740: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3F + bls _081546EC + movs r0, 0x40 +_0815474C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81546C8 + + thumb_func_start sub_8154758 +sub_8154758: @ 8154758 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _081547F4 + ldrh r1, [r5] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x4] + 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, _081547F8 + ldr r0, [r0, 0x3C] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081547E8 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081547FC + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r5, 0x8] + bl sub_8096DA8 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldr r0, [r5, 0x8] + strh r0, [r4, 0x2E] + ldr r0, [r5] + strh r0, [r4, 0x30] + ldr r0, [r5, 0x4] + strh r0, [r4, 0x32] + ldr r0, [r5, 0x10] + strh r0, [r4, 0x34] + ldr r0, [r5, 0x14] + strh r0, [r4, 0x36] + ldr r0, [r5, 0x18] + strh r0, [r4, 0x38] + ldr r0, [r5, 0x1C] + cmp r0, 0 + beq _081547E8 + adds r0, r4, 0 + movs r1, 0x6 + bl obj_anim_image_seek +_081547E8: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081547F4: .4byte 0x02038c08 +_081547F8: .4byte 0x085059f8 +_081547FC: .4byte 0x02020630 + thumb_func_end sub_8154758 + + thumb_func_start unc_grass_tall +unc_grass_tall: @ 8154800 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + lsrs r7, r0, 8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, _081548AC + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815484C + ldr r0, _081548B0 + ldr r2, [r0] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, r7 + bne _08154832 + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r0, r6 + beq _0815484C +_08154832: + ldr r1, [r3, 0x4] + ldrh r0, [r5, 0x30] + subs r0, r1 + strh r0, [r5, 0x30] + ldr r1, [r3, 0x8] + ldrh r0, [r5, 0x32] + subs r0, r1 + strh r0, [r5, 0x32] + ldrb r1, [r2, 0x5] + lsls r1, 8 + ldrb r0, [r2, 0x4] + orrs r0, r1 + strh r0, [r5, 0x38] +_0815484C: + ldrh r0, [r5, 0x34] + lsrs r1, r0, 8 + mov r8, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r5, 0x36] + lsls r0, 24 + lsrs r6, r0, 24 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r4, r0, 24 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _081548A0 + adds r0, r4, 0 + bl is_tile_tallgrass + lsls r0, 24 + cmp r0, 0 + beq _081548A0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081548B4 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081548B4 +_081548A0: + adds r0, r5, 0 + movs r1, 0x11 + bl oe_stop + b _081548EA + .align 2, 0 +_081548AC: .4byte 0x02037334 +_081548B0: .4byte 0x03005d8c +_081548B4: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081548F8 + adds r2, r0, r1 + ldr r0, [r2, 0x10] + ldr r1, [r5, 0x30] + cmp r0, r1 + beq _081548D4 + ldr r0, [r2, 0x14] + cmp r0, r1 + beq _081548D4 + movs r0, 0x1 + strh r0, [r5, 0x3C] +_081548D4: + adds r0, r5, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + movs r2, 0 + bl sub_81561FC +_081548EA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081548F8: .4byte 0x02037350 + thumb_func_end unc_grass_tall + + thumb_func_start sub_81548FC +sub_81548FC: @ 81548FC + push {r4,lr} + ldr r4, _08154960 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08154964 + ldr r0, [r0, 0x40] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08154958 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08154968 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0x12 + strh r0, [r2, 0x30] +_08154958: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08154960: .4byte 0x02038c08 +_08154964: .4byte 0x085059f8 +_08154968: .4byte 0x02020630 + thumb_func_end sub_81548FC + + thumb_func_start sub_815496C +sub_815496C: @ 815496C + push {r4-r6,lr} + ldr r6, _08154A00 + ldrb r0, [r6] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _08154A04 + adds r5, r1, r0 + ldr r0, _08154A08 + ldr r0, [r0, 0x78] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081549F8 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r4, _08154A0C + adds r2, r4 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r6] + strh r0, [r2, 0x2E] + ldr r0, [r6, 0x4] + strh r0, [r2, 0x30] + ldr r0, [r6, 0x8] + strh r0, [r2, 0x32] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r2, 0x34] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r2, 0x36] +_081549F8: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08154A00: .4byte 0x02038c08 +_08154A04: .4byte 0x02037350 +_08154A08: .4byte 0x085059f8 +_08154A0C: .4byte 0x02020630 + thumb_func_end sub_815496C + + thumb_func_start sub_8154A10 +sub_8154A10: @ 8154A10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08154A4E + ldr r5, _08154A58 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x2] + lsls r0, 29 + cmp r0, 0 + blt _08154A5C +_08154A4E: + adds r0, r4, 0 + movs r1, 0x29 + bl oe_stop + b _08154AF2 + .align 2, 0 +_08154A58: .4byte 0x02037350 +_08154A5C: + ldrb r0, [r1, 0x5] + bl npc_get_type + mov r8, r0 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08154B00 + adds r6, r0, r1 + ldrh r5, [r6, 0x22] + ldrh r7, [r6, 0x20] + movs r0, 0x20 + ldrsh r1, [r6, r0] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08154A98 + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + beq _08154AB2 +_08154A98: + strh r7, [r4, 0x34] + strh r5, [r4, 0x36] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08154AB2 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start +_08154AB2: + strh r7, [r4, 0x20] + strh r5, [r4, 0x22] + mov r1, r8 + ldrh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 17 + subs r0, 0x8 + strh r0, [r4, 0x26] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r0, [r6, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r0, r6, 0 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + adds r0, r4, 0 + bl sub_80979D4 +_08154AF2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08154B00: .4byte 0x02020630 + thumb_func_end sub_8154A10 + + thumb_func_start sub_8154B04 +sub_8154B04: @ 8154B04 + push {r4,lr} + ldr r4, _08154B6C + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08154B70 + ldr r0, [r0, 0x2C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08154B62 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08154B74 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x3 + ldrb r2, [r4, 0xC] + ands r2, r1 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0xD + strh r1, [r0, 0x3C] + ldrb r1, [r4, 0x10] + bl obj_anim_image_start +_08154B62: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08154B6C: .4byte 0x02038c08 +_08154B70: .4byte 0x085059f8 +_08154B74: .4byte 0x02020630 + thumb_func_end sub_8154B04 + + thumb_func_start sub_8154B78 +sub_8154B78: @ 8154B78 + push {r4,r5,lr} + ldr r4, _08154BE0 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08154BE4 + ldr r0, [r0, 0x5C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + adds r5, r1, 0 + cmp r1, 0x40 + beq _08154BD8 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08154BE8 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x3 + ldrb r2, [r4, 0xC] + ands r2, r1 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x18 + strh r1, [r0, 0x3C] + ldrb r1, [r4, 0x10] + bl obj_anim_image_start +_08154BD8: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08154BE0: .4byte 0x02038c08 +_08154BE4: .4byte 0x085059f8 +_08154BE8: .4byte 0x02020630 + thumb_func_end sub_8154B78 + + thumb_func_start sub_8154BEC +sub_8154BEC: @ 8154BEC + push {r4,r5,lr} + ldr r4, _08154C54 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08154C58 + ldr r0, [r0, 0x6C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r1, r0, 24 + adds r5, r1, 0 + cmp r1, 0x40 + beq _08154C4C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08154C5C + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x3 + ldrb r2, [r4, 0xC] + ands r2, r1 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x23 + strh r1, [r0, 0x3C] + ldrb r1, [r4, 0x10] + bl obj_anim_image_start +_08154C4C: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08154C54: .4byte 0x02038c08 +_08154C58: .4byte 0x085059f8 +_08154C5C: .4byte 0x02020630 + thumb_func_end sub_8154BEC + + thumb_func_start sub_8154C60 +sub_8154C60: @ 8154C60 + push {lr} + ldr r2, _08154C78 + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_08154C78: .4byte 0x085cdc4c + thumb_func_end sub_8154C60 + + thumb_func_start sub_8154C7C +sub_8154C7C: @ 8154C7C + 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, 0x28 + ble _08154C92 + movs r0, 0x1 + strh r0, [r1, 0x2E] +_08154C92: + adds r0, r1, 0 + movs r1, 0 + bl sub_80979D4 + pop {r0} + bx r0 + thumb_func_end sub_8154C7C + + thumb_func_start sub_8154CA0 +sub_8154CA0: @ 8154CA0 + push {r4,lr} + adds r4, r0, 0 + 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] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + ldrb r1, [r3] + lsls r1, 29 + lsrs r1, 31 + adds r0, r4, 0 + bl sub_80979D4 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x38 + ble _08154CE4 + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl oe_stop +_08154CE4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8154CA0 + + thumb_func_start sub_8154CEC +sub_8154CEC: @ 8154CEC + push {r4-r6,lr} + ldr r6, _08154D80 + ldrb r0, [r6] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _08154D84 + adds r5, r1, r0 + ldr r0, _08154D88 + ldr r0, [r0, 0x34] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _08154D76 + ldrb r0, [r5, 0x5] + bl npc_get_type + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + ldr r4, _08154D8C + adds r3, r4 + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r1, [r1] + movs r2, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + ldrb r2, [r5, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r4, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r2 + strb r1, [r3, 0x5] + ldr r1, [r6] + strh r1, [r3, 0x2E] + ldr r1, [r6, 0x4] + strh r1, [r3, 0x30] + ldr r1, [r6, 0x8] + strh r1, [r3, 0x32] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + subs r0, 0x4 + strh r0, [r3, 0x26] + movs r0, 0x46 + bl audio_play +_08154D76: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08154D80: .4byte 0x02038c08 +_08154D84: .4byte 0x02037350 +_08154D88: .4byte 0x085059f8 +_08154D8C: .4byte 0x02020630 + thumb_func_end sub_8154CEC + + thumb_func_start sub_8154D90 +sub_8154D90: @ 8154D90 + 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 + bne _08154DC0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + beq _08154DCA +_08154DC0: + adds r0, r4, 0 + movs r1, 0xF + bl oe_stop + b _08154E0A +_08154DCA: + ldr r3, _08154E14 + ldr r2, _08154E18 + 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 r0, [r0, 0x20] + strh r0, [r4, 0x20] + 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 r0, [r0, 0x22] + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 +_08154E0A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08154E14: .4byte 0x02020630 +_08154E18: .4byte 0x02037350 + thumb_func_end sub_8154D90 + + thumb_func_start sub_8154E1C +sub_8154E1C: @ 8154E1C + push {r4,lr} + ldr r4, _08154E80 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0xC + bl sub_80930E0 + ldr r0, _08154E84 + ldr r0, [r0, 0x38] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08154E78 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08154E88 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0x10 + strh r0, [r2, 0x30] +_08154E78: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08154E80: .4byte 0x02038c08 +_08154E84: .4byte 0x085059f8 +_08154E88: .4byte 0x02020630 + thumb_func_end sub_8154E1C + + thumb_func_start oei_water_drop_tall +oei_water_drop_tall: @ 8154E8C + push {r4,lr} + ldr r4, _08154EF0 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08154EF4 + ldr r0, [r0, 0x30] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08154EE8 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08154EF8 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0xE + strh r0, [r2, 0x30] +_08154EE8: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08154EF0: .4byte 0x02038c08 +_08154EF4: .4byte 0x085059f8 +_08154EF8: .4byte 0x02020630 + thumb_func_end oei_water_drop_tall + + thumb_func_start sub_8154EFC +sub_8154EFC: @ 8154EFC + push {r4-r7,lr} + ldr r7, _08154F9C + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _08154FA0 + adds r6, r1, r0 + ldr r0, _08154FA4 + ldr r0, [r0, 0x34] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _08154F92 + ldrb r0, [r6, 0x5] + bl npc_get_type + adds r4, r0, 0 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r3, _08154FA8 + adds r0, r3 + ldr r1, _08154FAC + str r1, [r0, 0x1C] + adds r5, r0, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r5] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, [r7] + strh r1, [r0, 0x2E] + ldr r1, [r7, 0x4] + strh r1, [r0, 0x30] + ldr r1, [r7, 0x8] + strh r1, [r0, 0x32] + ldr r1, _08154FB0 + strh r1, [r0, 0x34] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x36] + ldrh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 17 + subs r1, 0x4 + strh r1, [r0, 0x26] + movs r1, 0x1 + bl obj_anim_image_start +_08154F92: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08154F9C: .4byte 0x02038c08 +_08154FA0: .4byte 0x02037350 +_08154FA4: .4byte 0x085059f8 +_08154FA8: .4byte 0x02020630 +_08154FAC: .4byte sub_8154FB4 + 1 +_08154FB0: .4byte 0x0000ffff + thumb_func_end sub_8154EFC + + thumb_func_start sub_8154FB4 +sub_8154FB4: @ 8154FB4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08154FEE + ldr r2, _08154FF8 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + ldrb r0, [r5, 0x2] + lsls r0, 28 + cmp r0, 0 + blt _08154FFC +_08154FEE: + adds r0, r4, 0 + movs r1, 0x22 + bl oe_stop + b _08155046 + .align 2, 0 +_08154FF8: .4byte 0x02037350 +_08154FFC: + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08155050 + adds r0, r1 + ldrh r1, [r0, 0x20] + strh r1, [r4, 0x20] + ldrh r1, [r0, 0x22] + strh r1, [r4, 0x22] + adds r0, 0x43 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 + ldr r1, [r5, 0x10] + ldr r0, [r4, 0x34] + cmp r1, r0 + beq _08155046 + ldrh r0, [r5, 0x10] + strh r0, [r4, 0x34] + ldrh r0, [r5, 0x12] + strh r0, [r4, 0x36] + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08155046 + movs r0, 0x46 + bl audio_play +_08155046: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08155050: .4byte 0x02020630 + thumb_func_end sub_8154FB4 + + thumb_func_start oei_ripples +oei_ripples: @ 8155054 + push {r4,lr} + ldr r0, _081550A8 + ldr r0, [r0, 0x14] + ldr r4, _081550AC + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081550A0 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _081550B0 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x5 + strh r0, [r2, 0x2E] +_081550A0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081550A8: .4byte 0x085059f8 +_081550AC: .4byte 0x02038c08 +_081550B0: .4byte 0x02020630 + thumb_func_end oei_ripples + + thumb_func_start sub_81550B4 +sub_81550B4: @ 81550B4 + push {r4-r6,lr} + ldr r6, _08155148 + ldrb r0, [r6] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _0815514C + adds r5, r1, r0 + ldr r0, _08155150 + ldr r0, [r0, 0x7C] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155140 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r4, _08155154 + adds r2, r4 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r6] + strh r0, [r2, 0x2E] + ldr r0, [r6, 0x4] + strh r0, [r2, 0x30] + ldr r0, [r6, 0x8] + strh r0, [r2, 0x32] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r2, 0x34] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r2, 0x36] +_08155140: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08155148: .4byte 0x02038c08 +_0815514C: .4byte 0x02037350 +_08155150: .4byte 0x085059f8 +_08155154: .4byte 0x02020630 + thumb_func_end sub_81550B4 + + thumb_func_start sub_8155158 +sub_8155158: @ 8155158 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _08155192 + ldr r5, _0815519C + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x2] + lsls r0, 26 + cmp r0, 0 + blt _081551A0 +_08155192: + adds r0, r4, 0 + movs r1, 0x2A + bl oe_stop + b _081551E4 + .align 2, 0 +_0815519C: .4byte 0x02037350 +_081551A0: + ldrb r0, [r1, 0x5] + bl npc_get_type + mov r1, sp + ldrb r2, [r1] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, _081551EC + adds r1, r2 + ldrh r2, [r1, 0x20] + strh r2, [r4, 0x20] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + ldrh r2, [r1, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r4, 0x22] + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 +_081551E4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081551EC: .4byte 0x02020630 + thumb_func_end sub_8155158 + + thumb_func_start sub_81551F0 +sub_81551F0: @ 81551F0 + push {r4,lr} + ldr r4, _08155250 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08155254 + ldr r0, [r0, 0x44] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155248 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08155258 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x13 + strh r0, [r2, 0x2E] +_08155248: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155250: .4byte 0x02038c08 +_08155254: .4byte 0x085059f8 +_08155258: .4byte 0x02020630 + thumb_func_end sub_81551F0 + + thumb_func_start sub_815525C +sub_815525C: @ 815525C + push {r4,lr} + ldr r4, _081552BC + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _081552C0 + ldr r0, [r0, 0x48] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081552B4 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _081552C4 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x14 + strh r0, [r2, 0x2E] +_081552B4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081552BC: .4byte 0x02038c08 +_081552C0: .4byte 0x085059f8 +_081552C4: .4byte 0x02020630 + thumb_func_end sub_815525C + + thumb_func_start sub_81552C8 +sub_81552C8: @ 81552C8 + push {r4,lr} + ldr r4, _08155328 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _0815532C + ldr r0, [r0, 0x4C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155320 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08155330 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x15 + strh r0, [r2, 0x2E] +_08155320: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155328: .4byte 0x02038c08 +_0815532C: .4byte 0x085059f8 +_08155330: .4byte 0x02020630 + thumb_func_end sub_81552C8 + + thumb_func_start sub_8155334 +sub_8155334: @ 8155334 + push {r4,lr} + ldr r4, _08155394 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08155398 + ldr r0, [r0, 0x50] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0815538C + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _0815539C + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x16 + strh r0, [r2, 0x2E] +_0815538C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155394: .4byte 0x02038c08 +_08155398: .4byte 0x085059f8 +_0815539C: .4byte 0x02020630 + thumb_func_end sub_8155334 + + thumb_func_start ash +ash: @ 81553A0 + push {r4,lr} + lsls r2, 16 + lsrs r2, 16 + ldr r4, _081553D0 + lsls r0, 16 + asrs r0, 16 + str r0, [r4] + lsls r1, 16 + asrs r1, 16 + str r1, [r4, 0x4] + movs r0, 0x52 + str r0, [r4, 0x8] + movs r0, 0x1 + str r0, [r4, 0xC] + str r2, [r4, 0x10] + lsls r3, 16 + asrs r3, 16 + str r3, [r4, 0x14] + movs r0, 0x7 + bl oe_exec + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081553D0: .4byte 0x02038c08 + thumb_func_end ash + + thumb_func_start oei_ash +oei_ash: @ 81553D4 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _08155454 + ldrh r1, [r5] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x4] + 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, _08155458 + ldr r0, [r0, 0x18] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + ldrb r3, [r5, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0815544A + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _0815545C + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r5, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r5] + strh r0, [r2, 0x30] + ldr r0, [r5, 0x4] + strh r0, [r2, 0x32] + ldr r0, [r5, 0x10] + strh r0, [r2, 0x34] + ldr r0, [r5, 0x14] + strh r0, [r2, 0x36] +_0815544A: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08155454: .4byte 0x02038c08 +_08155458: .4byte 0x085059f8 +_0815545C: .4byte 0x02020630 + thumb_func_end oei_ash + + thumb_func_start sub_8155460 +sub_8155460: @ 8155460 + push {lr} + ldr r2, _08155478 + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_08155478: .4byte 0x085cdc54 + thumb_func_end sub_8155460 + + thumb_func_start sub_815547C +sub_815547C: @ 815547C + push {lr} + adds r3, r0, 0 + 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] + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _081554A6 + movs r0, 0x1 + strh r0, [r3, 0x2E] +_081554A6: + pop {r0} + bx r0 + thumb_func_end sub_815547C + + thumb_func_start sub_81554AC +sub_81554AC: @ 81554AC + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + ldrh r2, [r4, 0x34] + bl setmaptile_0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl cur_mapdata_draw_block_at + ldr r2, _08155504 + ldr r0, _08155508 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + movs r0, 0x2 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08155504: .4byte 0x02037350 +_08155508: .4byte 0x02037590 + thumb_func_end sub_81554AC + + thumb_func_start sub_815550C +sub_815550C: @ 815550C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80979D4 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815552C + adds r0, r4, 0 + movs r1, 0x7 + bl oe_stop +_0815552C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815550C + + thumb_func_start sub_8155534 +sub_8155534: @ 8155534 + push {r4,r5,lr} + ldr r4, _0815559C + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _081555A0 + ldr r0, [r0, 0x1C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0x96 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + cmp r0, 0x40 + beq _0815558E + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081555A4 + adds r1, r0 + 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, 0xF + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r1, 0x32] + ldr r0, _081555A8 + strh r0, [r1, 0x34] + movs r0, 0x1 + negs r0, r0 + strh r0, [r1, 0x3A] + strh r0, [r1, 0x3C] +_0815558E: + movs r0, 0x8 + bl oe_active_list_remove + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0815559C: .4byte 0x02038c08 +_081555A0: .4byte 0x085059f8 +_081555A4: .4byte 0x02020630 +_081555A8: .4byte 0x0000ffff + thumb_func_end sub_8155534 + + thumb_func_start sub_81555AC +sub_81555AC: @ 81555AC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, _081555D4 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrh r0, [r2, 0x2E] + movs r3, 0x10 + negs r3, r3 + ands r3, r0 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r1 + lsrs r0, 24 + orrs r0, r3 + strh r0, [r2, 0x2E] + bx lr + .align 2, 0 +_081555D4: .4byte 0x02020630 + thumb_func_end sub_81555AC + + thumb_func_start sub_81555D8 +sub_81555D8: @ 81555D8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, _08155600 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrh r0, [r2, 0x2E] + movs r3, 0xF1 + negs r3, r3 + ands r3, r0 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r1 + lsrs r0, 20 + orrs r3, r0 + strh r3, [r2, 0x2E] + bx lr + .align 2, 0 +_08155600: .4byte 0x02020630 + thumb_func_end sub_81555D8 + + thumb_func_start sub_8155604 +sub_8155604: @ 8155604 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r4, _08155630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + ldrh r0, [r3, 0x2E] + ldr r4, _08155634 + ands r4, r0 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r1 + lsrs r0, 16 + orrs r4, r0 + strh r4, [r3, 0x2E] + strh r2, [r3, 0x30] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08155630: .4byte 0x02020630 +_08155634: .4byte 0xfffff0ff + thumb_func_end sub_8155604 + + thumb_func_start sub_8155638 +sub_8155638: @ 8155638 + ldrh r1, [r0, 0x2E] + movs r0, 0xF + ands r0, r1 + bx lr + thumb_func_end sub_8155638 + + thumb_func_start sub_8155640 +sub_8155640: @ 8155640 + ldrh r1, [r0, 0x2E] + movs r0, 0xF0 + ands r0, r1 + lsrs r0, 4 + bx lr + thumb_func_end sub_8155640 + + thumb_func_start sub_815564C +sub_815564C: @ 815564C + ldrh r1, [r0, 0x2E] + movs r0, 0xF0 + lsls r0, 4 + ands r0, r1 + lsrs r0, 8 + bx lr + thumb_func_end sub_815564C + + thumb_func_start sub_8155658 +sub_8155658: @ 8155658 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, _081556A8 + adds r4, r0 + ldrb r0, [r4, 0x4] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, _081556AC + adds r5, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_81556B0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_81556E8 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_815577C + ldrb r0, [r5, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r2, [r6, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081556A8: .4byte 0x02037350 +_081556AC: .4byte 0x02020630 + thumb_func_end sub_8155658 + + thumb_func_start sub_81556B0 +sub_81556B0: @ 81556B0 + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _081556E4 + mov r0, sp + movs r2, 0x9 + bl memcpy + adds r0, r4, 0 + bl sub_8155640 + lsls r0, 24 + cmp r0, 0 + bne _081556DC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + add r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl obj_anim_image_start_if_different +_081556DC: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081556E4: .4byte 0x085cdc60 + thumb_func_end sub_81556B0 + + thumb_func_start sub_81556E8 +sub_81556E8: @ 81556E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r1, 0 + ldrh r2, [r0, 0x10] + mov r1, sp + strh r2, [r1] + ldrh r1, [r0, 0x12] + mov r0, sp + adds r0, 0x2 + strh r1, [r0] + movs r2, 0x26 + ldrsh r3, [r4, r2] + mov r8, r0 + cmp r3, 0 + bne _08155770 + mov r0, sp + movs r5, 0 + ldrsh r2, [r0, r5] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r2, r0 + bne _08155724 + lsls r0, r1, 16 + asrs r0, 16 + movs r5, 0x3C + ldrsh r1, [r4, r5] + cmp r0, r1 + beq _08155770 +_08155724: + strh r3, [r4, 0x38] + strh r2, [r4, 0x3A] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + strh r0, [r4, 0x3C] + movs r5, 0x1 + mov r7, r8 + mov r6, sp +_08155736: + adds r0, r5, 0 + mov r1, sp + adds r2, r7, 0 + bl numbers_move_direction + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl cur_mapdata_get_upper4bit_at + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0815575C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _08155770 +_0815575C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x3A] + strh r0, [r6] + ldrh r0, [r4, 0x3C] + mov r1, r8 + strh r0, [r1] + cmp r5, 0x4 + bls _08155736 +_08155770: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81556E8 + + thumb_func_start sub_815577C +sub_815577C: @ 815577C + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r4, r2, 0 + ldr r1, _081557E0 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + bl sub_8155638 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + cmp r2, 0 + beq _081557F6 + ldrh r1, [r4, 0x36] + adds r1, 0x1 + strh r1, [r4, 0x36] + movs r3, 0x38 + ldrsh r0, [r4, r3] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081557BC + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] +_081557BC: + ldrh r1, [r4, 0x36] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081557CC + ldrh r0, [r4, 0x34] + negs r0, r0 + strh r0, [r4, 0x34] +_081557CC: + cmp r2, 0x2 + beq _081557F6 + adds r0, r4, 0 + bl sub_815564C + lsls r0, 24 + cmp r0, 0 + bne _081557E4 + ldrh r0, [r4, 0x26] + b _081557EA + .align 2, 0 +_081557E0: .4byte 0x085cdc6a +_081557E4: + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x30] + adds r0, r3 +_081557EA: + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x20] + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r4, 0x22] +_081557F6: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815577C + + thumb_func_start sub_8155800 +sub_8155800: @ 8155800 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08155844 + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, _08155848 + adds r2, r1 + ldr r1, _0815584C + str r1, [r2, 0x1C] + movs r1, 0x3E + adds r1, r2 + mov r12, r1 + ldrb r1, [r1] + movs r3, 0x4 + orrs r1, r3 + mov r3, r12 + strb r1, [r3] + strh r4, [r2, 0x2E] + movs r1, 0x1 + strh r1, [r2, 0x30] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155844: .4byte 0x082ec6ac +_08155848: .4byte 0x02020630 +_0815584C: .4byte sub_8155850 + 1 + thumb_func_end sub_8155800 + + thumb_func_start sub_8155850 +sub_8155850: @ 8155850 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0815588C + adds r3, r0, r1 + ldrh r1, [r2, 0x32] + adds r0, r1, 0x1 + strh r0, [r2, 0x32] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08155878 + ldrh r0, [r2, 0x30] + ldrh r1, [r3, 0x26] + adds r0, r1 + strh r0, [r3, 0x26] +_08155878: + ldrh r1, [r2, 0x32] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _08155888 + ldrh r0, [r2, 0x30] + negs r0, r0 + strh r0, [r2, 0x30] +_08155888: + pop {r0} + bx r0 + .align 2, 0 +_0815588C: .4byte 0x02020630 + thumb_func_end sub_8155850 + + thumb_func_start sub_8155890 +sub_8155890: @ 8155890 + push {r4,lr} + ldr r4, _081558F4 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0xC + bl sub_80930E0 + ldr r0, _081558F8 + ldr r0, [r0, 0x24] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081558EC + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _081558FC + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0xA + strh r0, [r2, 0x30] +_081558EC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081558F4: .4byte 0x02038c08 +_081558F8: .4byte 0x085059f8 +_081558FC: .4byte 0x02020630 + thumb_func_end sub_8155890 + + thumb_func_start sub_8155900 +sub_8155900: @ 8155900 + push {r4-r7,lr} + ldr r7, _081559AC + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _081559B0 + adds r6, r1, r0 + ldr r0, _081559B4 + ldr r0, [r0, 0x74] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _081559A4 + ldrb r0, [r6, 0x5] + bl npc_get_type + adds r5, r0, 0 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r4, _081559B8 + adds r0, r4 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, [r7] + strh r1, [r0, 0x2E] + ldr r1, [r7, 0x4] + strh r1, [r0, 0x30] + ldr r1, [r7, 0x8] + strh r1, [r0, 0x32] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x34] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x36] + ldrh r1, [r5, 0xA] + lsls r1, 16 + asrs r1, 17 + subs r1, 0x2 + strh r1, [r0, 0x26] + movs r1, 0x2 + bl obj_anim_image_seek +_081559A4: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081559AC: .4byte 0x02038c08 +_081559B0: .4byte 0x02037350 +_081559B4: .4byte 0x085059f8 +_081559B8: .4byte 0x02020630 + thumb_func_end sub_8155900 + + thumb_func_start sub_81559BC +sub_81559BC: @ 81559BC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + bne _081559F6 + ldr r2, _08155A00 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1, 0x2] + lsls r0, 27 + cmp r0, 0 + blt _08155A04 +_081559F6: + adds r0, r4, 0 + movs r1, 0x27 + bl oe_stop + b _08155A76 + .align 2, 0 +_08155A00: .4byte 0x02037350 +_08155A04: + ldr r2, _08155A80 + ldrb r1, [r1, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r5, [r0, 0x22] + ldrh r6, [r0, 0x20] + movs r2, 0x20 + ldrsh r1, [r0, r2] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08155A2C + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + beq _08155A46 +_08155A2C: + strh r6, [r4, 0x34] + strh r5, [r4, 0x36] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08155A46 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start +_08155A46: + strh r6, [r4, 0x20] + strh r5, [r4, 0x22] + ldr r3, _08155A80 + ldr r2, _08155A84 + 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 + adds r0, 0x43 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 +_08155A76: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08155A80: .4byte 0x02020630 +_08155A84: .4byte 0x02037350 + thumb_func_end sub_81559BC + + thumb_func_start sub_8155A88 +sub_8155A88: @ 8155A88 + push {r4,lr} + ldr r4, _08155AE0 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0 + bl sub_80930E0 + ldr r0, _08155AE4 + adds r0, 0x88 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0x52 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155AD8 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08155AE8 + adds r1, r0 + 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, 0x4 + orrs r0, r2 + strb r0, [r1, 0x5] +_08155AD8: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155AE0: .4byte 0x02038c08 +_08155AE4: .4byte 0x085059f8 +_08155AE8: .4byte 0x02020630 + thumb_func_end sub_8155A88 + + thumb_func_start sub_8155AEC +sub_8155AEC: @ 8155AEC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, r0 + strh r1, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r1, [r4, 0x3E] + ldr r0, _08155B28 + ands r0, r1 + cmp r0, 0 + beq _08155B20 + adds r0, r4, 0 + movs r1, 0x35 + bl oe_stop +_08155B20: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08155B28: .4byte 0x00001004 + thumb_func_end sub_8155AEC + + thumb_func_start sub_8155B2C +sub_8155B2C: @ 8155B2C + push {r4,lr} + ldr r4, _08155B94 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x4 + bl sub_80930E0 + ldr r0, _08155B98 + ldr r0, [r0, 0x58] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155B8C + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08155B9C + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + movs r1, 0xF + ands r0, r1 + movs r1, 0x50 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x17 + strh r0, [r2, 0x2E] +_08155B8C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155B94: .4byte 0x02038c08 +_08155B98: .4byte 0x085059f8 +_08155B9C: .4byte 0x02020630 + thumb_func_end sub_8155B2C + + thumb_func_start sub_8155BA0 +sub_8155BA0: @ 8155BA0 + push {lr} + movs r0, 0x1C + movs r1, 0x18 + movs r2, 0x4 + bl sub_8155BD0 + pop {r1} + bx r1 + thumb_func_end sub_8155BA0 + + thumb_func_start sub_8155BB0 +sub_8155BB0: @ 8155BB0 + push {lr} + movs r0, 0x1D + movs r1, 0x19 + movs r2, 0x3 + bl sub_8155BD0 + pop {r1} + bx r1 + thumb_func_end sub_8155BB0 + + thumb_func_start sub_8155BC0 +sub_8155BC0: @ 8155BC0 + push {lr} + movs r0, 0x24 + movs r1, 0x1C + movs r2, 0x2 + bl sub_8155BD0 + pop {r1} + bx r1 + thumb_func_end sub_8155BC0 + + thumb_func_start sub_8155BD0 +sub_8155BD0: @ 8155BD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r5, _08155C04 + ldrb r0, [r5] + ldrb r1, [r5, 0x4] + ldrb r2, [r5, 0x8] + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + beq _08155C08 + adds r0, r4, 0 + bl oe_active_list_remove + movs r0, 0x40 + b _08155C74 + .align 2, 0 +_08155C04: .4byte 0x02038c08 +_08155C08: + ldr r1, _08155C80 + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_backward_search + mov r1, sp + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155C70 + mov r0, sp + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _08155C84 + adds r2, r0 + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r3, [r0] + lsls r1, r3, 30 + lsrs r1, 31 + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + lsls r1, 1 + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + lsls r3, r7, 4 + ldrb r1, [r2, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x5] + mov r0, r8 + strh r0, [r2, 0x30] + ldr r0, [r5] + strh r0, [r2, 0x32] + ldr r0, [r5, 0x4] + strh r0, [r2, 0x34] + ldr r0, [r5, 0x8] + strh r0, [r2, 0x36] +_08155C70: + mov r0, sp + ldrb r0, [r0] +_08155C74: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08155C80: .4byte 0x085059f8 +_08155C84: .4byte 0x02020630 + thumb_func_end sub_8155BD0 + + thumb_func_start sub_8155C88 +sub_8155C88: @ 8155C88 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x32] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x34] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r5, 0x36] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + lsls r0, 24 + cmp r0, 0 + beq _08155CB8 + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl oe_stop +_08155CB8: + ldr r4, _08155D70 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + bl npc_get_type + mov r1, sp + ldrb r2, [r1] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + ldr r1, _08155D74 + adds r2, r1 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r1, [r1] + movs r3, 0x3E + adds r3, r5 + mov r12, r3 + movs r3, 0x4 + ands r3, r1 + mov r1, r12 + ldrb r4, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r4 + orrs r1, r3 + mov r3, r12 + strb r1, [r3] + ldrh r1, [r2, 0x20] + strh r1, [r5, 0x20] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + ldrh r1, [r2, 0x22] + adds r0, r1 + subs r0, 0x10 + strh r0, [r5, 0x22] + adds r2, 0x43 + ldrb r0, [r2] + subs r0, 0x1 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1 + bne _08155D38 + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start +_08155D38: + movs r3, 0x2E + ldrsh r0, [r5, r3] + ldrh r2, [r5, 0x2E] + cmp r0, 0x2 + bne _08155D54 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08155D54 + movs r0, 0x1 + strh r0, [r5, 0x3C] +_08155D54: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _08155D68 + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl oe_stop +_08155D68: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08155D70: .4byte 0x02037350 +_08155D74: .4byte 0x02020630 + thumb_func_end sub_8155C88 + + thumb_func_start sub_8155D78 +sub_8155D78: @ 8155D78 + push {lr} + adds r1, r0, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08155D96 + ldr r2, _08155D9C + ldrb r1, [r1, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] +_08155D96: + pop {r0} + bx r0 + .align 2, 0 +_08155D9C: .4byte 0x02020630 + thumb_func_end sub_8155D78 + + thumb_func_start sub_8155DA0 +sub_8155DA0: @ 8155DA0 + push {lr} + adds r2, r0, 0 + adds r2, 0x21 + ldrb r1, [r2] + cmp r1, 0x2 + beq _08155DD6 + cmp r1, 0 + beq _08155DD6 + ldrb r1, [r0, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08155DC8 + adds r1, r0, r1 + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08155DCC + movs r0, 0 + b _08155DD8 + .align 2, 0 +_08155DC8: .4byte 0x02020630 +_08155DCC: + movs r0, 0x2 + strb r0, [r2] + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_08155DD6: + movs r0, 0x1 +_08155DD8: + pop {r1} + bx r1 + thumb_func_end sub_8155DA0 + + thumb_func_start sub_8155DDC +sub_8155DDC: @ 8155DDC + push {r4,lr} + ldr r4, _08155E44 + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + ldr r0, [r4, 0x4] + adds r0, 0x7 + str r0, [r4, 0x4] + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, _08155E48 + adds r0, 0x8C + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0x52 + bl obj_add_from_template_backward_search + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08155E3C + ldr r0, _08155E4C + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0x3 + ldrb r2, [r4, 0x8] + 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] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] +_08155E3C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08155E44: .4byte 0x02038c08 +_08155E48: .4byte 0x085059f8 +_08155E4C: .4byte 0x02020630 + thumb_func_end sub_8155DDC + + thumb_func_start sub_8155E50 +sub_8155E50: @ 8155E50 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08155E84 + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08155E7C + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] +_08155E7C: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _08155E9A +_08155E84: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x22 + ble _08155E9A + adds r0, r2, 0 + movs r1, 0x36 + bl oe_stop +_08155E9A: + pop {r0} + bx r0 + thumb_func_end sub_8155E50 + + thumb_func_start sub_8155EA0 +sub_8155EA0: @ 8155EA0 + movs r1, 0 + strh r1, [r0, 0x3A] + strh r1, [r0, 0x3C] + bx lr + thumb_func_end sub_8155EA0 + + thumb_func_start sub_8155EA8 +sub_8155EA8: @ 8155EA8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08155EDE + cmp r0, 0x1 + bgt _08155EC0 + cmp r0, 0 + beq _08155ECA + b _08155F42 +_08155EC0: + cmp r0, 0x2 + beq _08155F06 + cmp r0, 0x3 + beq _08155F1A + b _08155F42 +_08155ECA: + 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 _08155F38 +_08155EDE: + 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 _08155F40 +_08155F06: + 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 _08155F38 +_08155F1A: + 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 +_08155F38: + bl sub_8097728 + ldrh r1, [r5, 0x26] + adds r0, r1 +_08155F40: + strh r0, [r5, 0x26] +_08155F42: + ldrh r1, [r5, 0x24] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x10 + bl lcd_io_set + ldrh r0, [r5, 0x3A] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x48 + bne _08155F68 + strh r1, [r5, 0x3A] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08155F68: + movs r2, 0x3C + ldrsh r0, [r5, r2] + cmp r0, 0x4 + bne _08155F76 + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + movs r6, 0x1 +_08155F76: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8155EA8 + + thumb_func_start sub_8155F80 +sub_8155F80: @ 8155F80 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x8 + bls _08155F8E + b _08156156 +_08155F8E: + lsls r0, 2 + ldr r1, _08155F98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08155F98: .4byte _08155F9C + .align 2, 0 +_08155F9C: + .4byte _08155FC0 + .4byte _08156034 + .4byte _0815606C + .4byte _08156090 + .4byte _081560C0 + .4byte _081560D4 + .4byte _081560E0 + .4byte _0815610E + .4byte _08156120 +_08155FC0: + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + movs r1, 0x78 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x12 + bl lcd_io_set + movs r3, 0x2E + ldrsh r0, [r5, r3] + cmp r0, 0x60 + bne _08156016 + movs r1, 0 + ldr r4, _08156028 + mov r12, r4 + ldr r0, _0815602C + adds r7, r0, 0 +_08155FEA: + movs r2, 0xC + lsls r0, r1, 1 + adds r3, r1, 0x1 + lsls r6, r1, 5 + adds r0, r1 + lsls r4, r0, 1 +_08155FF6: + adds r0, r6, r2 + lsls r0, 1 + add r0, r12 + adds r1, r2, r7 + adds r1, r4, r1 + adds r1, 0x1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _08155FF6 + lsls r0, r3, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _08155FEA +_08156016: + movs r2, 0x2E + ldrsh r1, [r5, r2] + ldr r0, _08156030 + cmp r1, r0 + bgt _08156022 + b _08156156 +_08156022: + movs r1, 0 + movs r0, 0x1 + b _0815611A + .align 2, 0 +_08156028: .4byte 0x0600f800 +_0815602C: .4byte 0x0000bff4 +_08156030: .4byte 0x00000137 +_08156034: + ldr r4, _08156068 + movs r3, 0x2E + ldrsh r0, [r5, r3] + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + asrs r0, 15 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 18 + ldrh r4, [r5, 0x36] + adds r0, r4 + movs r1, 0 + strh r0, [r5, 0x22] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0xBD + bne _08156156 + movs r0, 0x2 + strh r0, [r5, 0x32] + strh r1, [r5, 0x38] + strh r1, [r5, 0x2E] + b _08156156 + .align 2, 0 +_08156068: .4byte 0x08329f40 +_0815606C: + movs r3, 0x2E + ldrsh r0, [r5, r3] + cmp r0, 0x3C + bne _0815607E + ldrh r0, [r5, 0x38] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x38] + strh r1, [r5, 0x2E] +_0815607E: + movs r4, 0x38 + ldrsh r0, [r5, r4] + cmp r0, 0x7 + bne _08156156 + movs r0, 0 + strh r0, [r5, 0x38] + movs r0, 0x3 + strh r0, [r5, 0x32] + b _08156156 +_08156090: + ldrh r2, [r5, 0x26] + movs r0, 0x26 + ldrsh r1, [r5, r0] + adds r3, r2, 0 + cmp r1, 0 + bne _081560A4 + strh r1, [r5, 0x2E] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] +_081560A4: + movs r4, 0x2E + ldrsh r0, [r5, r4] + cmp r0, 0x5 + bne _08156156 + movs r0, 0 + strh r0, [r5, 0x2E] + cmp r1, 0 + ble _081560BA + subs r0, r3, 0x1 + strh r0, [r5, 0x26] + b _08156156 +_081560BA: + adds r0, r2, 0x1 + strh r0, [r5, 0x26] + b _08156156 +_081560C0: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3C + bne _08156156 + movs r1, 0 + movs r0, 0x5 + strh r0, [r5, 0x32] + strh r1, [r5, 0x2E] + strh r1, [r5, 0x38] + b _08156156 +_081560D4: + adds r0, r5, 0 + bl sub_8155EA0 + movs r1, 0 + movs r0, 0x6 + b _0815611A +_081560E0: + adds r0, r5, 0 + bl sub_8155EA8 + lsls r0, 24 + cmp r0, 0 + beq _08156156 + movs r1, 0 + strh r1, [r5, 0x2E] + ldrh r0, [r5, 0x38] + adds r0, 0x1 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bgt _08156106 + adds r0, r5, 0 + bl sub_8155EA0 + b _08156156 +_08156106: + strh r1, [r5, 0x38] + movs r0, 0x7 + strh r0, [r5, 0x32] + b _08156156 +_0815610E: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1E + bne _08156156 + movs r1, 0 + movs r0, 0x8 +_0815611A: + strh r0, [r5, 0x32] + strh r1, [r5, 0x2E] + b _08156156 +_08156120: + movs r1, 0 + ldr r6, _08156190 + movs r4, 0 +_08156126: + movs r2, 0xC + adds r3, r1, 0x1 + lsls r1, 5 +_0815612C: + adds r0, r1, r2 + lsls r0, 1 + adds r0, r6 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _0815612C + lsls r0, r3, 24 + lsrs r1, r0, 24 + cmp r1, 0xE + bls _08156126 + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + movs r1, 0x40 + bl oe_stop +_08156156: + movs r3, 0x32 + ldrsh r0, [r5, r3] + cmp r0, 0x1 + bne _08156184 + ldrh r1, [r5, 0x30] + movs r0, 0x7 + ands r0, r1 + adds r2, r1, 0 + cmp r0, 0 + bne _08156172 + ldrh r0, [r5, 0x34] + ldrh r4, [r5, 0x26] + adds r0, r4 + strh r0, [r5, 0x26] +_08156172: + movs r0, 0xF + ands r0, r2 + cmp r0, 0 + bne _08156180 + ldrh r0, [r5, 0x34] + negs r0, r0 + strh r0, [r5, 0x34] +_08156180: + adds r0, r1, 0x1 + strh r0, [r5, 0x30] +_08156184: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08156190: .4byte 0x0600f800 + thumb_func_end sub_8155F80 + + thumb_func_start sub_8156194 +sub_8156194: @ 8156194 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081561B2 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl oe_stop + b _081561C8 +_081561B2: + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0 + bl npc_y_height_related +_081561C8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156194 + + thumb_func_start sub_81561D0 +sub_81561D0: @ 81561D0 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081561EE + ldrh r1, [r2, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl oe_stop + b _081561F6 +_081561EE: + adds r0, r2, 0 + movs r1, 0 + bl sub_80979D4 +_081561F6: + pop {r0} + bx r0 + thumb_func_end sub_81561D0 + + thumb_func_start sub_81561FC +sub_81561FC: @ 81561FC + push {r4-r7,lr} + adds r6, r0, 0 + adds r0, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r1, r6, 0 + bl npc_y_height_related + movs r7, 0 +_08156212: + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 2 + ldr r1, _081562AC + adds r4, r0, r1 + ldrb r0, [r4] + lsls r0, 31 + cmp r0, 0 + beq _081562B4 + ldrb r0, [r4, 0x5] + bl npc_get_type + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081562B0 + adds r5, r0, r1 + adds r0, r6, 0 + adds r0, 0x28 + movs r2, 0 + ldrsb r2, [r0, r2] + ldrh r0, [r6, 0x20] + adds r1, r0, r2 + subs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x20 + ldrsh r2, [r5, r0] + cmp r1, r2 + bge _081562B4 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r2 + ble _081562B4 + adds r0, r5, 0 + adds r0, 0x29 + movs r3, 0 + ldrsb r3, [r0, r3] + ldrh r2, [r5, 0x22] + adds r2, r3 + ldrh r4, [r5, 0x22] + adds r0, r6, 0 + adds r0, 0x29 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r6, 0x22] + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + adds r3, r0, r3 + lsls r2, 16 + asrs r2, 16 + lsls r3, 16 + asrs r3, 16 + cmp r2, r3 + blt _0815628C + cmp r2, r0 + bge _081562B4 +_0815628C: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + ble _081562B4 + adds r2, r6, 0 + adds r2, 0x43 + adds r0, r5, 0 + adds r0, 0x43 + ldrb r1, [r0] + ldrb r0, [r2] + cmp r0, r1 + bhi _081562B4 + adds r0, r1, 0x2 + strb r0, [r2] + b _081562BE + .align 2, 0 +_081562AC: .4byte 0x02037350 +_081562B0: .4byte 0x02020630 +_081562B4: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _08156212 +_081562BE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81561FC + + thumb_func_start sub_81562C4 +sub_81562C4: @ 81562C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _0815631C + ldr r0, [r4] + ldr r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x44 + bl memset + movs r1, 0 + movs r3, 0x64 + adds r2, r4, 0 +_081562DE: + ldr r0, [r4] + ldr r0, [r0, 0xC] + adds r0, 0x5 + adds r0, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x3 + ble _081562DE + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x41 + movs r1, 0 + strb r5, [r0] + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x40 + strb r1, [r0] + ldr r0, [r2] + ldr r2, [r0, 0xC] + ldr r1, _08156320 + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, 0x18 + adds r0, r1 + ldr r0, [r0] + str r0, [r2, 0x14] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815631C: .4byte 0x02039f34 +_08156320: .4byte 0x02039e00 + thumb_func_end sub_81562C4 + + thumb_func_start sub_8156324 +sub_8156324: @ 8156324 + push {r4-r6,lr} + ldr r1, _081563AC + ldr r0, [r1] + ldr r0, [r0, 0xC] + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _0815636A + adds r4, r1, 0 + movs r5, 0 +_08156336: + ldr r0, [r4] + ldr r2, [r0, 0xC] + ldr r0, [r2, 0x14] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815634A + strb r5, [r2] + bl sub_81563B0 +_0815634A: + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldr r0, [r1, 0x14] + lsrs r0, 1 + str r0, [r1, 0x14] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + ldr r0, [r4] + ldr r0, [r0, 0xC] + strb r5, [r0, 0x4] + ldr r0, [r4] + ldr r0, [r0, 0xC] + ldr r0, [r0, 0x14] + cmp r0, 0 + bne _08156336 +_0815636A: + movs r6, 0x3 +_0815636C: + bl GenerateRandomNumber + adds r5, r0, 0 + ands r5, r6 + ldr r4, _081563AC + ldr r0, [r4] + ldr r1, [r0, 0xC] + adds r0, r1, 0x5 + adds r0, r5 + ldrb r3, [r0] + movs r2, 0 + ldrb r1, [r1, 0x5] + cmp r3, r1 + bcc _0815639E + adds r1, r4, 0 +_0815638A: + adds r2, 0x1 + cmp r2, 0x3 + bgt _0815639E + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r0, 0x5 + adds r0, r2 + ldrb r0, [r0] + cmp r3, r0 + bcs _0815638A +_0815639E: + cmp r2, 0x4 + bne _0815636C + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081563AC: .4byte 0x02039f34 + thumb_func_end sub_8156324 + + thumb_func_start sub_81563B0 +sub_81563B0: @ 81563B0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, _08156408 + ldr r0, [r5] + ldr r0, [r0, 0xC] + ldrb r0, [r0] + adds r4, r5, 0 + cmp r0, 0x2 + beq _081564A0 + adds r7, r5, 0 + ldr r6, _0815640C + ldr r0, _08156410 + mov r8, r0 +_081563CC: + ldr r0, [r7] + ldr r2, [r0, 0xC] + ldrb r0, [r2] + cmp r0, 0x1 + beq _08156426 + cmp r0, 0x1 + bgt _08156496 + cmp r0, 0 + bne _08156496 + ldr r1, _08156414 + ldrb r0, [r2, 0x10] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r6] + ldrb r1, [r2, 0x4] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + add r1, r8 + ldrh r1, [r1] + adds r0, r1, 0 + cmp r0, 0 + bne _08156418 + strh r0, [r2, 0x2] + b _0815641A + .align 2, 0 +_08156408: .4byte 0x02039f34 +_0815640C: .4byte 0x0203ab38 +_08156410: .4byte 0x02039e1e +_08156414: .4byte 0x082de350 +_08156418: + strh r1, [r2, 0x2] +_0815641A: + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08156496 +_08156426: + ldrh r1, [r2, 0x2] + cmp r1, 0 + beq _08156444 + ldr r1, _08156440 + ldr r0, [r6] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + b _08156458 + .align 2, 0 +_08156440: .4byte 0x085cdd00 +_08156444: + adds r0, r2, 0x5 + ldrb r2, [r2, 0x4] + adds r0, r2 + strb r1, [r0] + ldr r0, [r7] + ldr r2, [r0, 0xC] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] +_08156458: + ldr r2, _08156480 + ldr r0, [r2] + ldr r3, [r0, 0xC] + ldrb r1, [r3, 0x9] + movs r0, 0x1 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _08156496 + ldrb r0, [r3, 0x4] + adds r0, 0x1 + movs r2, 0 + strb r0, [r3, 0x4] + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldrb r0, [r1, 0x4] + cmp r0, 0x3 + bhi _08156484 + strb r2, [r1] + b _0815648A + .align 2, 0 +_08156480: .4byte 0x02039f34 +_08156484: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0815648A: + ldr r0, [r4] + ldr r2, [r0, 0xC] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] +_08156496: + ldr r0, [r5] + ldr r0, [r0, 0xC] + ldrb r0, [r0] + cmp r0, 0x2 + bne _081563CC +_081564A0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81563B0 + + thumb_func_start sub_81564AC +sub_81564AC: @ 81564AC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _081564BC + ldr r0, [r3] + ldr r0, [r0, 0x8] + b _081564CC + .align 2, 0 +_081564BC: .4byte 0x02039f34 +_081564C0: + adds r1, 0x1 + cmp r1, 0x3 + bgt _081564D2 + ldr r0, [r3] + ldr r0, [r0, 0x8] + adds r0, r1 +_081564CC: + ldrb r0, [r0] + cmp r0, r2 + bne _081564C0 +_081564D2: + lsls r0, r1, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81564AC + + thumb_func_start sub_81564DC +sub_81564DC: @ 81564DC + push {r4,lr} + ldr r3, _08156508 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0x5 + ldrb r0, [r0, 0x4] + adds r1, r0 + ldr r2, _0815650C + ldr r0, [r2] + ldrb r0, [r0, 0x1] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08156510 + movs r4, 0xFF + b _08156516 + .align 2, 0 +_08156508: .4byte 0x02039f34 +_0815650C: .4byte 0x0203ab38 +_08156510: + cmp r0, 0 + bge _08156516 + movs r4, 0 +_08156516: + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0x5 + ldrb r1, [r1, 0x4] + adds r0, r1 + strb r4, [r0] + ldr r0, [r2] + adds r0, 0x2 + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81564DC + + thumb_func_start sub_8156530 +sub_8156530: @ 8156530 + ldr r0, _08156548 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r0, [r0] + ldrb r0, [r0, 0x1] + strh r0, [r1, 0x18] + ldr r1, _0815654C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08156548: .4byte 0x02039f34 +_0815654C: .4byte 0x0203ab38 + thumb_func_end sub_8156530 + + thumb_func_start sub_8156550 +sub_8156550: @ 8156550 + push {lr} + bl sub_8156530 + ldr r0, _08156584 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156588 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _0815658C + 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 _08156590 + .align 2, 0 +_08156584: .4byte 0x02039f34 +_08156588: .4byte 0x0203ab38 +_0815658C: + adds r0, r2, 0x5 + str r0, [r3] +_08156590: + pop {r0} + bx r0 + thumb_func_end sub_8156550 + + thumb_func_start sub_8156594 +sub_8156594: @ 8156594 + push {lr} + bl sub_8156530 + ldr r0, _081565C8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081565CC + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _081565D0 + 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 _081565D4 + .align 2, 0 +_081565C8: .4byte 0x02039f34 +_081565CC: .4byte 0x0203ab38 +_081565D0: + adds r0, r2, 0x5 + str r0, [r3] +_081565D4: + pop {r0} + bx r0 + thumb_func_end sub_8156594 + + thumb_func_start sub_81565D8 +sub_81565D8: @ 81565D8 + push {lr} + bl sub_8156530 + ldr r0, _0815660C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156610 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156614 + 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 _08156618 + .align 2, 0 +_0815660C: .4byte 0x02039f34 +_08156610: .4byte 0x0203ab38 +_08156614: + adds r0, r2, 0x5 + str r0, [r3] +_08156618: + pop {r0} + bx r0 + thumb_func_end sub_81565D8 + + thumb_func_start sub_815661C +sub_815661C: @ 815661C + push {lr} + bl sub_8156530 + ldr r0, _08156650 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156654 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156658 + 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 _0815665C + .align 2, 0 +_08156650: .4byte 0x02039f34 +_08156654: .4byte 0x0203ab38 +_08156658: + adds r0, r2, 0x5 + str r0, [r3] +_0815665C: + pop {r0} + bx r0 + thumb_func_end sub_815661C + + thumb_func_start sub_8156660 +sub_8156660: @ 8156660 + ldr r0, _0815667C + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x18] + ldr r1, _08156680 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_0815667C: .4byte 0x02039f34 +_08156680: .4byte 0x0203ab38 + thumb_func_end sub_8156660 + + thumb_func_start sub_8156684 +sub_8156684: @ 8156684 + push {lr} + bl sub_8156660 + ldr r0, _081566B8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081566BC + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081566C0 + 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 _081566C4 + .align 2, 0 +_081566B8: .4byte 0x02039f34 +_081566BC: .4byte 0x0203ab38 +_081566C0: + adds r0, r2, 0x5 + str r0, [r3] +_081566C4: + pop {r0} + bx r0 + thumb_func_end sub_8156684 + + thumb_func_start sub_81566C8 +sub_81566C8: @ 81566C8 + push {lr} + bl sub_8156660 + ldr r0, _081566FC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156700 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08156704 + 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 _08156708 + .align 2, 0 +_081566FC: .4byte 0x02039f34 +_08156700: .4byte 0x0203ab38 +_08156704: + adds r0, r2, 0x5 + str r0, [r3] +_08156708: + pop {r0} + bx r0 + thumb_func_end sub_81566C8 + + thumb_func_start sub_815670C +sub_815670C: @ 815670C + push {lr} + bl sub_8156660 + ldr r0, _08156740 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156744 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156748 + 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 _0815674C + .align 2, 0 +_08156740: .4byte 0x02039f34 +_08156744: .4byte 0x0203ab38 +_08156748: + adds r0, r2, 0x5 + str r0, [r3] +_0815674C: + pop {r0} + bx r0 + thumb_func_end sub_815670C + + thumb_func_start sub_8156750 +sub_8156750: @ 8156750 + push {lr} + bl sub_8156660 + ldr r0, _08156784 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156788 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _0815678C + 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 _08156790 + .align 2, 0 +_08156784: .4byte 0x02039f34 +_08156788: .4byte 0x0203ab38 +_0815678C: + adds r0, r2, 0x5 + str r0, [r3] +_08156790: + pop {r0} + bx r0 + thumb_func_end sub_8156750 + + thumb_func_start sub_8156794 +sub_8156794: @ 8156794 + ldr r0, _081567B4 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r0, [r0, 0x8] + adds r1, r2, 0 + adds r1, 0x41 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2, 0x18] + ldr r1, _081567B8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_081567B4: .4byte 0x02039f34 +_081567B8: .4byte 0x0203ab38 + thumb_func_end sub_8156794 + + thumb_func_start sub_81567BC +sub_81567BC: @ 81567BC + push {lr} + bl sub_8156794 + ldr r0, _081567F0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081567F4 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081567F8 + 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 _081567FC + .align 2, 0 +_081567F0: .4byte 0x02039f34 +_081567F4: .4byte 0x0203ab38 +_081567F8: + adds r0, r2, 0x5 + str r0, [r3] +_081567FC: + pop {r0} + bx r0 + thumb_func_end sub_81567BC + + thumb_func_start sub_8156800 +sub_8156800: @ 8156800 + push {lr} + bl sub_8156794 + ldr r0, _08156834 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156838 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _0815683C + 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 _08156840 + .align 2, 0 +_08156834: .4byte 0x02039f34 +_08156838: .4byte 0x0203ab38 +_0815683C: + adds r0, r2, 0x5 + str r0, [r3] +_08156840: + pop {r0} + bx r0 + thumb_func_end sub_8156800 + + thumb_func_start sub_8156844 +sub_8156844: @ 8156844 + push {lr} + bl sub_8156794 + ldr r0, _08156878 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _0815687C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156880 + 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 _08156884 + .align 2, 0 +_08156878: .4byte 0x02039f34 +_0815687C: .4byte 0x0203ab38 +_08156880: + adds r0, r2, 0x5 + str r0, [r3] +_08156884: + pop {r0} + bx r0 + thumb_func_end sub_8156844 + + thumb_func_start sub_8156888 +sub_8156888: @ 8156888 + push {lr} + bl sub_8156794 + ldr r0, _081568BC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081568C0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _081568C4 + 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 _081568C8 + .align 2, 0 +_081568BC: .4byte 0x02039f34 +_081568C0: .4byte 0x0203ab38 +_081568C4: + adds r0, r2, 0x5 + str r0, [r3] +_081568C8: + pop {r0} + bx r0 + thumb_func_end sub_8156888 + + thumb_func_start sub_81568CC +sub_81568CC: @ 81568CC + push {r4,lr} + ldr r0, _08156904 + ldr r0, [r0] + ldr r4, [r0, 0xC] + adds r1, r4, 0 + adds r1, 0x41 + ldrb r1, [r1] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x18] + ldr r1, _08156908 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08156904: .4byte 0x02039f34 +_08156908: .4byte 0x0203ab38 + thumb_func_end sub_81568CC + + thumb_func_start sub_815690C +sub_815690C: @ 815690C + push {lr} + bl sub_81568CC + ldr r0, _08156940 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156944 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08156948 + 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 _0815694C + .align 2, 0 +_08156940: .4byte 0x02039f34 +_08156944: .4byte 0x0203ab38 +_08156948: + adds r0, r2, 0x5 + str r0, [r3] +_0815694C: + pop {r0} + bx r0 + thumb_func_end sub_815690C + + thumb_func_start sub_8156950 +sub_8156950: @ 8156950 + push {lr} + bl sub_81568CC + ldr r0, _08156984 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156988 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _0815698C + 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 _08156990 + .align 2, 0 +_08156984: .4byte 0x02039f34 +_08156988: .4byte 0x0203ab38 +_0815698C: + adds r0, r2, 0x5 + str r0, [r3] +_08156990: + pop {r0} + bx r0 + thumb_func_end sub_8156950 + + thumb_func_start sub_8156994 +sub_8156994: @ 8156994 + push {lr} + bl sub_81568CC + ldr r0, _081569C8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081569CC + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081569D0 + 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 _081569D4 + .align 2, 0 +_081569C8: .4byte 0x02039f34 +_081569CC: .4byte 0x0203ab38 +_081569D0: + adds r0, r2, 0x5 + str r0, [r3] +_081569D4: + pop {r0} + bx r0 + thumb_func_end sub_8156994 + + thumb_func_start sub_81569D8 +sub_81569D8: @ 81569D8 + push {lr} + bl sub_81568CC + ldr r0, _08156A0C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156A10 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156A14 + 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 _08156A18 + .align 2, 0 +_08156A0C: .4byte 0x02039f34 +_08156A10: .4byte 0x0203ab38 +_08156A14: + adds r0, r2, 0x5 + str r0, [r3] +_08156A18: + pop {r0} + bx r0 + thumb_func_end sub_81569D8 + + thumb_func_start sub_8156A1C +sub_8156A1C: @ 8156A1C + ldr r0, _08156A40 + ldr r0, [r0] + ldr r3, [r0, 0xC] + adds r1, r3, 0 + adds r1, 0x41 + ldrb r1, [r1] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x4] + strh r0, [r3, 0x18] + ldr r1, _08156A44 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08156A40: .4byte 0x02039f34 +_08156A44: .4byte 0x0203ab38 + thumb_func_end sub_8156A1C + + thumb_func_start sub_8156A48 +sub_8156A48: @ 8156A48 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, _08156A84 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156A88 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _08156A8C + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156A90 + .align 2, 0 +_08156A84: .4byte 0x02039f34 +_08156A88: .4byte 0x0203ab38 +_08156A8C: + adds r0, r3, 0x6 + str r0, [r4] +_08156A90: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156A48 + + thumb_func_start sub_8156A98 +sub_8156A98: @ 8156A98 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, _08156AD4 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156AD8 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + ble _08156ADC + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156AE0 + .align 2, 0 +_08156AD4: .4byte 0x02039f34 +_08156AD8: .4byte 0x0203ab38 +_08156ADC: + adds r0, r3, 0x6 + str r0, [r4] +_08156AE0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156A98 + + thumb_func_start sub_8156AE8 +sub_8156AE8: @ 8156AE8 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, _08156B24 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156B28 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bne _08156B2C + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156B30 + .align 2, 0 +_08156B24: .4byte 0x02039f34 +_08156B28: .4byte 0x0203ab38 +_08156B2C: + adds r0, r3, 0x6 + str r0, [r4] +_08156B30: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156AE8 + + thumb_func_start sub_8156B38 +sub_8156B38: @ 8156B38 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, _08156B74 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156B78 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + beq _08156B7C + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156B80 + .align 2, 0 +_08156B74: .4byte 0x02039f34 +_08156B78: .4byte 0x0203ab38 +_08156B7C: + adds r0, r3, 0x6 + str r0, [r4] +_08156B80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156B38 + + thumb_func_start sub_8156B88 +sub_8156B88: @ 8156B88 + ldr r0, _08156BA8 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r1, _08156BAC + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x18] + ldr r1, _08156BB0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08156BA8: .4byte 0x02039f34 +_08156BAC: .4byte 0x02039f00 +_08156BB0: .4byte 0x0203ab38 + thumb_func_end sub_8156B88 + + thumb_func_start sub_8156BB4 +sub_8156BB4: @ 8156BB4 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, _08156BF0 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156BF4 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _08156BF8 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156BFC + .align 2, 0 +_08156BF0: .4byte 0x02039f34 +_08156BF4: .4byte 0x0203ab38 +_08156BF8: + adds r0, r3, 0x6 + str r0, [r4] +_08156BFC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156BB4 + + thumb_func_start sub_8156C04 +sub_8156C04: @ 8156C04 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, _08156C40 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156C44 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + ble _08156C48 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156C4C + .align 2, 0 +_08156C40: .4byte 0x02039f34 +_08156C44: .4byte 0x0203ab38 +_08156C48: + adds r0, r3, 0x6 + str r0, [r4] +_08156C4C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156C04 + + thumb_func_start sub_8156C54 +sub_8156C54: @ 8156C54 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, _08156C90 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156C94 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bne _08156C98 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156C9C + .align 2, 0 +_08156C90: .4byte 0x02039f34 +_08156C94: .4byte 0x0203ab38 +_08156C98: + adds r0, r3, 0x6 + str r0, [r4] +_08156C9C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156C54 + + thumb_func_start sub_8156CA4 +sub_8156CA4: @ 8156CA4 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, _08156CE0 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08156CE4 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + beq _08156CE8 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156CEC + .align 2, 0 +_08156CE0: .4byte 0x02039f34 +_08156CE4: .4byte 0x0203ab38 +_08156CE8: + adds r0, r3, 0x6 + str r0, [r4] +_08156CEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156CA4 + + thumb_func_start sub_8156CF4 +sub_8156CF4: @ 8156CF4 + ldr r0, _08156D0C + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r0, _08156D10 + ldrh r0, [r0] + strh r0, [r1, 0x18] + ldr r1, _08156D14 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08156D0C: .4byte 0x02039f34 +_08156D10: .4byte 0x02039f2c +_08156D14: .4byte 0x0203ab38 + thumb_func_end sub_8156CF4 + + thumb_func_start sub_8156D18 +sub_8156D18: @ 8156D18 + push {lr} + bl sub_8156CF4 + ldr r0, _08156D4C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156D50 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156D54 + 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 _08156D58 + .align 2, 0 +_08156D4C: .4byte 0x02039f34 +_08156D50: .4byte 0x0203ab38 +_08156D54: + adds r0, r2, 0x5 + str r0, [r3] +_08156D58: + pop {r0} + bx r0 + thumb_func_end sub_8156D18 + + thumb_func_start sub_8156D5C +sub_8156D5C: @ 8156D5C + push {lr} + bl sub_8156CF4 + ldr r0, _08156D90 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156D94 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156D98 + 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 _08156D9C + .align 2, 0 +_08156D90: .4byte 0x02039f34 +_08156D94: .4byte 0x0203ab38 +_08156D98: + adds r0, r2, 0x5 + str r0, [r3] +_08156D9C: + pop {r0} + bx r0 + thumb_func_end sub_8156D5C + + thumb_func_start sub_8156DA0 +sub_8156DA0: @ 8156DA0 + push {r4,lr} + ldr r2, _08156DD8 + ldr r4, _08156DDC + ldr r0, [r4] + ldr r0, [r0, 0xC] + ldrb r1, [r0, 0x4] + lsls r1, 1 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl sub_80DD9F0 + ldr r1, [r4] + ldr r1, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x18] + ldr r1, _08156DE0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08156DD8: .4byte 0x02039e00 +_08156DDC: .4byte 0x02039f34 +_08156DE0: .4byte 0x0203ab38 + thumb_func_end sub_8156DA0 + + thumb_func_start sub_8156DE4 +sub_8156DE4: @ 8156DE4 + push {r4,lr} + bl sub_8156DA0 + ldr r0, _08156E18 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, _08156E1C + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08156E20 + 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 _08156E24 + .align 2, 0 +_08156E18: .4byte 0x02039f34 +_08156E1C: .4byte 0x0203ab38 +_08156E20: + adds r0, r2, 0x5 + str r0, [r3] +_08156E24: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156DE4 + + thumb_func_start sub_8156E2C +sub_8156E2C: @ 8156E2C + push {r4,lr} + bl sub_8156DA0 + ldr r0, _08156E60 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, _08156E64 + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + ble _08156E68 + 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 _08156E6C + .align 2, 0 +_08156E60: .4byte 0x02039f34 +_08156E64: .4byte 0x0203ab38 +_08156E68: + adds r0, r2, 0x5 + str r0, [r3] +_08156E6C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156E2C + + thumb_func_start sub_8156E74 +sub_8156E74: @ 8156E74 + push {r4,lr} + bl sub_8156DA0 + ldr r0, _08156EA8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, _08156EAC + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _08156EB0 + 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 _08156EB4 + .align 2, 0 +_08156EA8: .4byte 0x02039f34 +_08156EAC: .4byte 0x0203ab38 +_08156EB0: + adds r0, r2, 0x5 + str r0, [r3] +_08156EB4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156E74 + + thumb_func_start sub_8156EBC +sub_8156EBC: @ 8156EBC + push {r4,lr} + bl sub_8156DA0 + ldr r0, _08156EF0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, _08156EF4 + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + beq _08156EF8 + 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 _08156EFC + .align 2, 0 +_08156EF0: .4byte 0x02039f34 +_08156EF4: .4byte 0x0203ab38 +_08156EF8: + adds r0, r2, 0x5 + str r0, [r3] +_08156EFC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156EBC + + thumb_func_start sub_8156F04 +sub_8156F04: @ 8156F04 + ldr r2, _08156F34 + ldr r0, _08156F38 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldrb r1, [r3, 0x4] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r1, _08156F3C + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r3, 0x18] + ldr r1, _08156F40 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08156F34: .4byte 0x02039e00 +_08156F38: .4byte 0x02039f34 +_08156F3C: .4byte 0x0858c2b4 +_08156F40: .4byte 0x0203ab38 + thumb_func_end sub_8156F04 + + thumb_func_start sub_8156F44 +sub_8156F44: @ 8156F44 + push {lr} + bl sub_8156F04 + ldr r0, _08156F78 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156F7C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156F80 + 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 _08156F84 + .align 2, 0 +_08156F78: .4byte 0x02039f34 +_08156F7C: .4byte 0x0203ab38 +_08156F80: + adds r0, r2, 0x5 + str r0, [r3] +_08156F84: + pop {r0} + bx r0 + thumb_func_end sub_8156F44 + + thumb_func_start sub_8156F88 +sub_8156F88: @ 8156F88 + push {lr} + bl sub_8156F04 + ldr r0, _08156FBC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08156FC0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156FC4 + 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 _08156FC8 + .align 2, 0 +_08156FBC: .4byte 0x02039f34 +_08156FC0: .4byte 0x0203ab38 +_08156FC4: + adds r0, r2, 0x5 + str r0, [r3] +_08156FC8: + pop {r0} + bx r0 + thumb_func_end sub_8156F88 + + thumb_func_start sub_8156FCC +sub_8156FCC: @ 8156FCC + ldr r2, _08157004 + ldr r0, _08157008 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldrb r1, [r3, 0x4] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r2, _0815700C + ldr r1, _08157010 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r3, 0x18] + ldr r1, _08157014 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .align 2, 0 +_08157004: .4byte 0x02039e00 +_08157008: .4byte 0x02039f34 +_0815700C: .4byte 0x0858cdcc +_08157010: .4byte 0x0858c2b4 +_08157014: .4byte 0x0203ab38 + thumb_func_end sub_8156FCC + + thumb_func_start sub_8157018 +sub_8157018: @ 8157018 + push {lr} + bl sub_8156FCC + ldr r0, _0815704C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157050 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157054 + 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 _08157058 + .align 2, 0 +_0815704C: .4byte 0x02039f34 +_08157050: .4byte 0x0203ab38 +_08157054: + adds r0, r2, 0x5 + str r0, [r3] +_08157058: + pop {r0} + bx r0 + thumb_func_end sub_8157018 + + thumb_func_start sub_815705C +sub_815705C: @ 815705C + push {lr} + bl sub_8156FCC + ldr r0, _08157090 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157094 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157098 + 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 _0815709C + .align 2, 0 +_08157090: .4byte 0x02039f34 +_08157094: .4byte 0x0203ab38 +_08157098: + adds r0, r2, 0x5 + str r0, [r3] +_0815709C: + pop {r0} + bx r0 + thumb_func_end sub_815705C + + thumb_func_start sub_81570A0 +sub_81570A0: @ 81570A0 + push {r4-r7,lr} + ldr r2, _08157100 + ldr r5, _08157104 + ldr r0, [r5] + ldr r1, [r0, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r1, [r1] + lsls r1, 6 + adds r0, r1 + adds r2, 0x1E + adds r0, r2 + ldrh r0, [r0] + ldr r3, _08157108 + ldr r4, _0815710C + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r7, [r0, 0x1] + movs r6, 0 + ldr r0, _08157110 + mov r12, r0 + adds r1, r2 +_081570D4: + ldrh r0, [r1] + cmp r0, 0 + beq _081570EA + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + cmp r7, r0 + bcc _081570F2 +_081570EA: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _081570D4 +_081570F2: + cmp r6, 0x4 + bne _08157114 + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0x1 + b _0815711A + .align 2, 0 +_08157100: .4byte 0x02039e00 +_08157104: .4byte 0x02039f34 +_08157108: .4byte 0x0858cdcc +_0815710C: .4byte 0x0858c2b4 +_08157110: .4byte 0x0203ab38 +_08157114: + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0 +_0815711A: + strh r0, [r1, 0x18] + mov r1, r12 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81570A0 + + thumb_func_start sub_815712C +sub_815712C: @ 815712C + push {lr} + bl sub_81570A0 + ldr r0, _0815715C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157164 + ldr r3, _08157160 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815716C + .align 2, 0 +_0815715C: .4byte 0x02039f34 +_08157160: .4byte 0x0203ab38 +_08157164: + ldr r1, _08157170 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_0815716C: + pop {r0} + bx r0 + .align 2, 0 +_08157170: .4byte 0x0203ab38 + thumb_func_end sub_815712C + + thumb_func_start sub_8157174 +sub_8157174: @ 8157174 + push {r4-r7,lr} + ldr r2, _081571D4 + ldr r5, _081571D8 + ldr r0, [r5] + ldr r1, [r0, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r1, [r1] + lsls r1, 6 + adds r0, r1 + adds r2, 0x1E + adds r0, r2 + ldrh r0, [r0] + ldr r3, _081571DC + ldr r4, _081571E0 + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r7, [r0, 0x2] + movs r6, 0 + ldr r0, _081571E4 + mov r12, r0 + adds r1, r2 +_081571A8: + ldrh r0, [r1] + cmp r0, 0 + beq _081571BE + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + cmp r7, r0 + bcc _081571C6 +_081571BE: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _081571A8 +_081571C6: + cmp r6, 0x4 + bne _081571E8 + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0x1 + b _081571EE + .align 2, 0 +_081571D4: .4byte 0x02039e00 +_081571D8: .4byte 0x02039f34 +_081571DC: .4byte 0x0858cdcc +_081571E0: .4byte 0x0858c2b4 +_081571E4: .4byte 0x0203ab38 +_081571E8: + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0 +_081571EE: + strh r0, [r1, 0x18] + mov r1, r12 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8157174 + + thumb_func_start sub_8157200 +sub_8157200: @ 8157200 + push {lr} + bl sub_8157174 + ldr r0, _08157230 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157238 + ldr r3, _08157234 + 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 _08157240 + .align 2, 0 +_08157230: .4byte 0x02039f34 +_08157234: .4byte 0x0203ab38 +_08157238: + ldr r1, _08157244 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08157240: + pop {r0} + bx r0 + .align 2, 0 +_08157244: .4byte 0x0203ab38 + thumb_func_end sub_8157200 + + thumb_func_start sub_8157248 +sub_8157248: @ 8157248 + push {r4,lr} + ldr r2, _08157290 + ldr r0, _08157294 + ldr r0, [r0] + ldr r4, [r0, 0xC] + ldrb r1, [r4, 0x4] + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r2, _08157298 + ldr r1, _0815729C + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldr r1, _081572A0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08157290: .4byte 0x02039e00 +_08157294: .4byte 0x02039f34 +_08157298: .4byte 0x0858cdcc +_0815729C: .4byte 0x0858c2b4 +_081572A0: .4byte 0x0203ab38 + thumb_func_end sub_8157248 + + thumb_func_start sub_81572A4 +sub_81572A4: @ 81572A4 + push {lr} + bl sub_8157248 + ldr r0, _081572D8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081572DC + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081572E0 + 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 _081572E4 + .align 2, 0 +_081572D8: .4byte 0x02039f34 +_081572DC: .4byte 0x0203ab38 +_081572E0: + adds r0, r2, 0x5 + str r0, [r3] +_081572E4: + pop {r0} + bx r0 + thumb_func_end sub_81572A4 + + thumb_func_start sub_81572E8 +sub_81572E8: @ 81572E8 + push {lr} + bl sub_8157248 + ldr r0, _0815731C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157320 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157324 + 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 _08157328 + .align 2, 0 +_0815731C: .4byte 0x02039f34 +_08157320: .4byte 0x0203ab38 +_08157324: + adds r0, r2, 0x5 + str r0, [r3] +_08157328: + pop {r0} + bx r0 + thumb_func_end sub_81572E8 + + thumb_func_start sub_815732C +sub_815732C: @ 815732C + push {lr} + bl sub_8157248 + ldr r0, _08157360 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157364 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157368 + 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 _0815736C + .align 2, 0 +_08157360: .4byte 0x02039f34 +_08157364: .4byte 0x0203ab38 +_08157368: + adds r0, r2, 0x5 + str r0, [r3] +_0815736C: + pop {r0} + bx r0 + thumb_func_end sub_815732C + + thumb_func_start sub_8157370 +sub_8157370: @ 8157370 + push {lr} + bl sub_8157248 + ldr r0, _081573A4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081573A8 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _081573AC + 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 _081573B0 + .align 2, 0 +_081573A4: .4byte 0x02039f34 +_081573A8: .4byte 0x0203ab38 +_081573AC: + adds r0, r2, 0x5 + str r0, [r3] +_081573B0: + pop {r0} + bx r0 + thumb_func_end sub_8157370 + + thumb_func_start sub_81573B4 +sub_81573B4: @ 81573B4 + push {r4,lr} + ldr r2, _081573FC + ldr r0, _08157400 + ldr r0, [r0] + ldr r4, [r0, 0xC] + ldrb r1, [r4, 0x4] + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r2, _08157404 + ldr r1, _08157408 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldr r1, _0815740C + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081573FC: .4byte 0x02039e00 +_08157400: .4byte 0x02039f34 +_08157404: .4byte 0x0858cdcc +_08157408: .4byte 0x0858c2b4 +_0815740C: .4byte 0x0203ab38 + thumb_func_end sub_81573B4 + + thumb_func_start sub_8157410 +sub_8157410: @ 8157410 + push {lr} + bl sub_81573B4 + ldr r0, _08157444 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157448 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _0815744C + 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 _08157450 + .align 2, 0 +_08157444: .4byte 0x02039f34 +_08157448: .4byte 0x0203ab38 +_0815744C: + adds r0, r2, 0x5 + str r0, [r3] +_08157450: + pop {r0} + bx r0 + thumb_func_end sub_8157410 + + thumb_func_start sub_8157454 +sub_8157454: @ 8157454 + push {lr} + bl sub_81573B4 + ldr r0, _08157488 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _0815748C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157490 + 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 _08157494 + .align 2, 0 +_08157488: .4byte 0x02039f34 +_0815748C: .4byte 0x0203ab38 +_08157490: + adds r0, r2, 0x5 + str r0, [r3] +_08157494: + pop {r0} + bx r0 + thumb_func_end sub_8157454 + + thumb_func_start sub_8157498 +sub_8157498: @ 8157498 + push {lr} + bl sub_81573B4 + ldr r0, _081574CC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081574D0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081574D4 + 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 _081574D8 + .align 2, 0 +_081574CC: .4byte 0x02039f34 +_081574D0: .4byte 0x0203ab38 +_081574D4: + adds r0, r2, 0x5 + str r0, [r3] +_081574D8: + pop {r0} + bx r0 + thumb_func_end sub_8157498 + + thumb_func_start sub_81574DC +sub_81574DC: @ 81574DC + push {lr} + bl sub_81573B4 + ldr r0, _08157510 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157514 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157518 + 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 _0815751C + .align 2, 0 +_08157510: .4byte 0x02039f34 +_08157514: .4byte 0x0203ab38 +_08157518: + adds r0, r2, 0x5 + str r0, [r3] +_0815751C: + pop {r0} + bx r0 + thumb_func_end sub_81574DC + + thumb_func_start sub_8157520 +sub_8157520: @ 8157520 + push {r4,r5,lr} + ldr r3, _08157550 + ldr r5, _08157554 + ldr r4, [r5] + ldr r1, [r4, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r2, [r1] + lsls r1, r2, 6 + adds r0, r1 + adds r3, 0x1E + adds r0, r3 + ldrh r3, [r0] + ldr r1, [r4, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x8] + cmp r3, r1 + beq _08157558 + movs r1, 0 + b _08157560 + .align 2, 0 +_08157550: .4byte 0x02039e00 +_08157554: .4byte 0x02039f34 +_08157558: + ldrb r0, [r0, 0xB] + lsls r0, 25 + lsrs r0, 29 + adds r1, r0, 0x1 +_08157560: + ldr r0, [r5] + ldr r0, [r0, 0xC] + strh r1, [r0, 0x18] + ldr r1, _08157574 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08157574: .4byte 0x0203ab38 + thumb_func_end sub_8157520 + + thumb_func_start sub_8157578 +sub_8157578: @ 8157578 + push {lr} + bl sub_8157520 + ldr r0, _081575AC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081575B0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081575B4 + 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 _081575B8 + .align 2, 0 +_081575AC: .4byte 0x02039f34 +_081575B0: .4byte 0x0203ab38 +_081575B4: + adds r0, r2, 0x5 + str r0, [r3] +_081575B8: + pop {r0} + bx r0 + thumb_func_end sub_8157578 + + thumb_func_start sub_81575BC +sub_81575BC: @ 81575BC + push {lr} + bl sub_8157520 + ldr r0, _081575F0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081575F4 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _081575F8 + 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 _081575FC + .align 2, 0 +_081575F0: .4byte 0x02039f34 +_081575F4: .4byte 0x0203ab38 +_081575F8: + adds r0, r2, 0x5 + str r0, [r3] +_081575FC: + pop {r0} + bx r0 + thumb_func_end sub_81575BC + + thumb_func_start sub_8157600 +sub_8157600: @ 8157600 + push {lr} + bl sub_8157520 + ldr r0, _08157634 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157638 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _0815763C + 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 _08157640 + .align 2, 0 +_08157634: .4byte 0x02039f34 +_08157638: .4byte 0x0203ab38 +_0815763C: + adds r0, r2, 0x5 + str r0, [r3] +_08157640: + pop {r0} + bx r0 + thumb_func_end sub_8157600 + + thumb_func_start sub_8157644 +sub_8157644: @ 8157644 + push {lr} + bl sub_8157520 + ldr r0, _08157678 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _0815767C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157680 + 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 _08157684 + .align 2, 0 +_08157678: .4byte 0x02039f34 +_0815767C: .4byte 0x0203ab38 +_08157680: + adds r0, r2, 0x5 + str r0, [r3] +_08157684: + pop {r0} + bx r0 + thumb_func_end sub_8157644 + + thumb_func_start sub_8157688 +sub_8157688: @ 8157688 + push {r4-r6,lr} + movs r3, 0 + ldr r2, _081576F4 + ldr r0, _081576F8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldrb r1, [r0, 0x4] + lsls r1, 1 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r5, [r1] + movs r4, 0 + adds r6, r2, 0 +_081576AA: + lsls r1, r4, 1 + ldr r0, _081576F8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _081576D2 + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_80E5414 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _081576DC +_081576D2: + adds r4, 0x1 + cmp r4, 0x3 + ble _081576AA + cmp r3, 0 + beq _081576DE +_081576DC: + movs r3, 0x1 +_081576DE: + ldr r0, _081576F8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r3, [r0, 0x18] + ldr r1, _081576FC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081576F4: .4byte 0x02039e00 +_081576F8: .4byte 0x02039f34 +_081576FC: .4byte 0x0203ab38 + thumb_func_end sub_8157688 + + thumb_func_start sub_8157700 +sub_8157700: @ 8157700 + push {lr} + bl sub_8157688 + ldr r0, _08157730 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157738 + ldr r3, _08157734 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157740 + .align 2, 0 +_08157730: .4byte 0x02039f34 +_08157734: .4byte 0x0203ab38 +_08157738: + ldr r1, _08157744 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157740: + pop {r0} + bx r0 + .align 2, 0 +_08157744: .4byte 0x0203ab38 + thumb_func_end sub_8157700 + + thumb_func_start sub_8157748 +sub_8157748: @ 8157748 + push {lr} + bl sub_8157688 + ldr r0, _08157778 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157780 + ldr r3, _0815777C + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157788 + .align 2, 0 +_08157778: .4byte 0x02039f34 +_0815777C: .4byte 0x0203ab38 +_08157780: + ldr r1, _0815778C + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157788: + pop {r0} + bx r0 + .align 2, 0 +_0815778C: .4byte 0x0203ab38 + thumb_func_end sub_8157748 + + thumb_func_start sub_8157790 +sub_8157790: @ 8157790 + push {r4-r6,lr} + movs r3, 0 + ldr r2, _081577FC + ldr r0, _08157800 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldrb r1, [r0, 0x4] + lsls r1, 1 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r5, [r1] + movs r4, 0 + adds r6, r2, 0 +_081577B2: + lsls r1, r4, 1 + ldr r0, _08157800 + ldr r0, [r0] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _081577D8 + adds r1, r5, 0 + bl sub_80E5414 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _081577E2 +_081577D8: + adds r4, 0x1 + cmp r4, 0x3 + ble _081577B2 + cmp r3, 0 + beq _081577E4 +_081577E2: + movs r3, 0x1 +_081577E4: + ldr r0, _08157800 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r3, [r0, 0x18] + ldr r1, _08157804 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081577FC: .4byte 0x02039e00 +_08157800: .4byte 0x02039f34 +_08157804: .4byte 0x0203ab38 + thumb_func_end sub_8157790 + + thumb_func_start sub_8157808 +sub_8157808: @ 8157808 + push {lr} + bl sub_8157790 + ldr r0, _08157838 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157840 + ldr r3, _0815783C + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157848 + .align 2, 0 +_08157838: .4byte 0x02039f34 +_0815783C: .4byte 0x0203ab38 +_08157840: + ldr r1, _0815784C + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157848: + pop {r0} + bx r0 + .align 2, 0 +_0815784C: .4byte 0x0203ab38 + thumb_func_end sub_8157808 + + thumb_func_start sub_8157850 +sub_8157850: @ 8157850 + push {lr} + bl sub_8157790 + ldr r0, _08157880 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157888 + ldr r3, _08157884 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157890 + .align 2, 0 +_08157880: .4byte 0x02039f34 +_08157884: .4byte 0x0203ab38 +_08157888: + ldr r1, _08157894 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157890: + pop {r0} + bx r0 + .align 2, 0 +_08157894: .4byte 0x0203ab38 + thumb_func_end sub_8157850 + + thumb_func_start sub_8157898 +sub_8157898: @ 8157898 + push {r4-r6,lr} + movs r5, 0 + ldr r3, _081578EC + ldr r6, _081578F0 + ldr r4, [r6] + ldr r1, [r4, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r2, [r1] + lsls r1, r2, 6 + adds r0, r1 + adds r3, 0x1E + adds r0, r3 + ldrh r3, [r0] + ldr r1, [r4, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _081578D0 + adds r1, r3, 0 + bl sub_80E5414 + lsls r0, 24 + lsrs r5, r0, 24 +_081578D0: + cmp r5, 0 + beq _081578D6 + movs r5, 0x1 +_081578D6: + ldr r0, [r6] + ldr r0, [r0, 0xC] + strh r5, [r0, 0x18] + ldr r1, _081578F4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081578EC: .4byte 0x02039e00 +_081578F0: .4byte 0x02039f34 +_081578F4: .4byte 0x0203ab38 + thumb_func_end sub_8157898 + + thumb_func_start sub_81578F8 +sub_81578F8: @ 81578F8 + push {lr} + bl sub_8157898 + ldr r0, _08157928 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157930 + ldr r3, _0815792C + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157938 + .align 2, 0 +_08157928: .4byte 0x02039f34 +_0815792C: .4byte 0x0203ab38 +_08157930: + ldr r1, _0815793C + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157938: + pop {r0} + bx r0 + .align 2, 0 +_0815793C: .4byte 0x0203ab38 + thumb_func_end sub_81578F8 + + thumb_func_start sub_8157940 +sub_8157940: @ 8157940 + push {lr} + bl sub_8157898 + ldr r0, _08157970 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157978 + ldr r3, _08157974 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157980 + .align 2, 0 +_08157970: .4byte 0x02039f34 +_08157974: .4byte 0x0203ab38 +_08157978: + ldr r1, _08157984 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157980: + pop {r0} + bx r0 + .align 2, 0 +_08157984: .4byte 0x0203ab38 + thumb_func_end sub_8157940 + + thumb_func_start sub_8157988 +sub_8157988: @ 8157988 + push {r4,r5,lr} + ldr r4, _081579C4 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081579C8 + ldr r1, [r1] + ldr r5, [r1, 0xC] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0xD + ldrsb r0, [r1, r0] + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081579C4: .4byte 0x0203ab38 +_081579C8: .4byte 0x02039f34 + thumb_func_end sub_8157988 + + thumb_func_start sub_81579CC +sub_81579CC: @ 81579CC + push {lr} + bl sub_8157988 + ldr r0, _08157A00 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157A04 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08157A08 + 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 _08157A0C + .align 2, 0 +_08157A00: .4byte 0x02039f34 +_08157A04: .4byte 0x0203ab38 +_08157A08: + adds r0, r2, 0x5 + str r0, [r3] +_08157A0C: + pop {r0} + bx r0 + thumb_func_end sub_81579CC + + thumb_func_start sub_8157A10 +sub_8157A10: @ 8157A10 + push {lr} + bl sub_8157988 + ldr r0, _08157A44 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157A48 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157A4C + 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 _08157A50 + .align 2, 0 +_08157A44: .4byte 0x02039f34 +_08157A48: .4byte 0x0203ab38 +_08157A4C: + adds r0, r2, 0x5 + str r0, [r3] +_08157A50: + pop {r0} + bx r0 + thumb_func_end sub_8157A10 + + thumb_func_start sub_8157A54 +sub_8157A54: @ 8157A54 + push {lr} + bl sub_8157988 + ldr r0, _08157A88 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157A8C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157A90 + 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 _08157A94 + .align 2, 0 +_08157A88: .4byte 0x02039f34 +_08157A8C: .4byte 0x0203ab38 +_08157A90: + adds r0, r2, 0x5 + str r0, [r3] +_08157A94: + pop {r0} + bx r0 + thumb_func_end sub_8157A54 + + thumb_func_start sub_8157A98 +sub_8157A98: @ 8157A98 + push {lr} + bl sub_8157988 + ldr r0, _08157ACC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157AD0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157AD4 + 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 _08157AD8 + .align 2, 0 +_08157ACC: .4byte 0x02039f34 +_08157AD0: .4byte 0x0203ab38 +_08157AD4: + adds r0, r2, 0x5 + str r0, [r3] +_08157AD8: + pop {r0} + bx r0 + thumb_func_end sub_8157A98 + + thumb_func_start sub_8157ADC +sub_8157ADC: @ 8157ADC + push {r4-r6,lr} + movs r6, 0 + ldr r5, _08157B2C + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _08157B18 + ldr r2, _08157B30 + ldr r0, _08157B34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x8] + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 +_08157B18: + ldr r0, _08157B34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r6, [r0, 0x18] + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08157B2C: .4byte 0x0203ab38 +_08157B30: .4byte 0x0858c2b4 +_08157B34: .4byte 0x02039f34 + thumb_func_end sub_8157ADC + + thumb_func_start sub_8157B38 +sub_8157B38: @ 8157B38 + push {lr} + bl sub_8157ADC + ldr r0, _08157B6C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157B70 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08157B74 + 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 _08157B78 + .align 2, 0 +_08157B6C: .4byte 0x02039f34 +_08157B70: .4byte 0x0203ab38 +_08157B74: + adds r0, r2, 0x5 + str r0, [r3] +_08157B78: + pop {r0} + bx r0 + thumb_func_end sub_8157B38 + + thumb_func_start sub_8157B7C +sub_8157B7C: @ 8157B7C + push {lr} + bl sub_8157ADC + ldr r0, _08157BB0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157BB4 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157BB8 + 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 _08157BBC + .align 2, 0 +_08157BB0: .4byte 0x02039f34 +_08157BB4: .4byte 0x0203ab38 +_08157BB8: + adds r0, r2, 0x5 + str r0, [r3] +_08157BBC: + pop {r0} + bx r0 + thumb_func_end sub_8157B7C + + thumb_func_start sub_8157BC0 +sub_8157BC0: @ 8157BC0 + push {lr} + bl sub_8157ADC + ldr r0, _08157BF4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157BF8 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157BFC + 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 _08157C00 + .align 2, 0 +_08157BF4: .4byte 0x02039f34 +_08157BF8: .4byte 0x0203ab38 +_08157BFC: + adds r0, r2, 0x5 + str r0, [r3] +_08157C00: + pop {r0} + bx r0 + thumb_func_end sub_8157BC0 + + thumb_func_start sub_8157C04 +sub_8157C04: @ 8157C04 + push {lr} + bl sub_8157ADC + ldr r0, _08157C38 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08157C3C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157C40 + 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 _08157C44 + .align 2, 0 +_08157C38: .4byte 0x02039f34 +_08157C3C: .4byte 0x0203ab38 +_08157C40: + adds r0, r2, 0x5 + str r0, [r3] +_08157C44: + pop {r0} + bx r0 + thumb_func_end sub_8157C04 + + thumb_func_start sub_8157C48 +sub_8157C48: @ 8157C48 + push {lr} + ldr r0, _08157C6C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + beq _08157C74 + ldr r0, _08157C70 + ldr r0, [r0] + ldr r1, [r0, 0xC] + movs r0, 0 + b _08157C7C + .align 2, 0 +_08157C6C: .4byte 0x0203ab38 +_08157C70: .4byte 0x02039f34 +_08157C74: + ldr r0, _08157C8C + ldr r0, [r0] + ldr r1, [r0, 0xC] + movs r0, 0x1 +_08157C7C: + strh r0, [r1, 0x18] + ldr r1, _08157C90 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08157C8C: .4byte 0x02039f34 +_08157C90: .4byte 0x0203ab38 + thumb_func_end sub_8157C48 + + thumb_func_start sub_8157C94 +sub_8157C94: @ 8157C94 + push {lr} + bl sub_8157C48 + ldr r0, _08157CC4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157CCC + ldr r3, _08157CC8 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157CD4 + .align 2, 0 +_08157CC4: .4byte 0x02039f34 +_08157CC8: .4byte 0x0203ab38 +_08157CCC: + ldr r1, _08157CD8 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157CD4: + pop {r0} + bx r0 + .align 2, 0 +_08157CD8: .4byte 0x0203ab38 + thumb_func_end sub_8157C94 + + thumb_func_start sub_8157CDC +sub_8157CDC: @ 8157CDC + push {lr} + bl sub_8157C48 + ldr r0, _08157D0C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157D14 + ldr r3, _08157D10 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157D1C + .align 2, 0 +_08157D0C: .4byte 0x02039f34 +_08157D10: .4byte 0x0203ab38 +_08157D14: + ldr r1, _08157D20 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157D1C: + pop {r0} + bx r0 + .align 2, 0 +_08157D20: .4byte 0x0203ab38 + thumb_func_end sub_8157CDC + + thumb_func_start sub_8157D24 +sub_8157D24: @ 8157D24 + push {r4,lr} + ldr r4, _08157D58 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08157D5C + ldr r1, [r1] + ldr r3, [r1, 0xC] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x15] + lsls r0, 28 + lsrs r0, 31 + strh r0, [r3, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08157D58: .4byte 0x0203ab38 +_08157D5C: .4byte 0x02039f34 + thumb_func_end sub_8157D24 + + thumb_func_start sub_8157D60 +sub_8157D60: @ 8157D60 + push {lr} + bl sub_8157D24 + ldr r0, _08157D90 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157D98 + ldr r3, _08157D94 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157DA0 + .align 2, 0 +_08157D90: .4byte 0x02039f34 +_08157D94: .4byte 0x0203ab38 +_08157D98: + ldr r1, _08157DA4 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157DA0: + pop {r0} + bx r0 + .align 2, 0 +_08157DA4: .4byte 0x0203ab38 + thumb_func_end sub_8157D60 + + thumb_func_start sub_8157DA8 +sub_8157DA8: @ 8157DA8 + push {lr} + bl sub_8157D24 + ldr r0, _08157DD8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157DE0 + ldr r3, _08157DDC + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157DE8 + .align 2, 0 +_08157DD8: .4byte 0x02039f34 +_08157DDC: .4byte 0x0203ab38 +_08157DE0: + ldr r1, _08157DEC + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157DE8: + pop {r0} + bx r0 + .align 2, 0 +_08157DEC: .4byte 0x0203ab38 + thumb_func_end sub_8157DA8 + + thumb_func_start sub_8157DF0 +sub_8157DF0: @ 8157DF0 + push {r4,r5,lr} + ldr r4, _08157E34 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08157E38 + ldr r1, [r1] + ldr r5, [r1, 0xC] + ldr r3, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + adds r0, r5, 0 + adds r0, 0x41 + ldrb r2, [r0] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r1, 0x4] + ldrh r0, [r0, 0x4] + subs r1, r0 + strh r1, [r5, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08157E34: .4byte 0x0203ab38 +_08157E38: .4byte 0x02039f34 + thumb_func_end sub_8157DF0 + + thumb_func_start sub_8157E3C +sub_8157E3C: @ 8157E3C + push {lr} + bl sub_8157DF0 + ldr r0, _08157E6C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08157E74 + ldr r3, _08157E70 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157E7C + .align 2, 0 +_08157E6C: .4byte 0x02039f34 +_08157E70: .4byte 0x0203ab38 +_08157E74: + ldr r1, _08157E80 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157E7C: + pop {r0} + bx r0 + .align 2, 0 +_08157E80: .4byte 0x0203ab38 + thumb_func_end sub_8157E3C + + thumb_func_start sub_8157E84 +sub_8157E84: @ 8157E84 + push {lr} + bl sub_8157DF0 + ldr r0, _08157EB4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _08157EBC + ldr r3, _08157EB8 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157EC4 + .align 2, 0 +_08157EB4: .4byte 0x02039f34 +_08157EB8: .4byte 0x0203ab38 +_08157EBC: + ldr r1, _08157EC8 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157EC4: + pop {r0} + bx r0 + .align 2, 0 +_08157EC8: .4byte 0x0203ab38 + thumb_func_end sub_8157E84 + + thumb_func_start sub_8157ECC +sub_8157ECC: @ 8157ECC + push {lr} + bl sub_8157DF0 + ldr r0, _08157EFC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157F04 + ldr r3, _08157F00 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157F0C + .align 2, 0 +_08157EFC: .4byte 0x02039f34 +_08157F00: .4byte 0x0203ab38 +_08157F04: + ldr r1, _08157F10 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157F0C: + pop {r0} + bx r0 + .align 2, 0 +_08157F10: .4byte 0x0203ab38 + thumb_func_end sub_8157ECC + + thumb_func_start sub_8157F14 +sub_8157F14: @ 8157F14 + push {lr} + bl sub_8157DF0 + ldr r0, _08157F44 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157F4C + ldr r3, _08157F48 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157F54 + .align 2, 0 +_08157F44: .4byte 0x02039f34 +_08157F48: .4byte 0x0203ab38 +_08157F4C: + ldr r1, _08157F58 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157F54: + pop {r0} + bx r0 + .align 2, 0 +_08157F58: .4byte 0x0203ab38 + thumb_func_end sub_8157F14 + + thumb_func_start sub_8157F5C +sub_8157F5C: @ 8157F5C + push {r4,lr} + ldr r4, _08157F94 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + ldr r1, _08157F98 + ldr r1, [r1] + ldr r3, [r1, 0xC] + ldr r2, _08157F9C + lsrs r0, 23 + adds r0, r2 + adds r1, r3, 0 + adds r1, 0x41 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r2 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r3, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08157F94: .4byte 0x0203ab38 +_08157F98: .4byte 0x02039f34 +_08157F9C: .4byte 0x02039f00 + thumb_func_end sub_8157F5C + + thumb_func_start sub_8157FA0 +sub_8157FA0: @ 8157FA0 + push {lr} + bl sub_8157F5C + ldr r0, _08157FD0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08157FD8 + ldr r3, _08157FD4 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157FE0 + .align 2, 0 +_08157FD0: .4byte 0x02039f34 +_08157FD4: .4byte 0x0203ab38 +_08157FD8: + ldr r1, _08157FE4 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157FE0: + pop {r0} + bx r0 + .align 2, 0 +_08157FE4: .4byte 0x0203ab38 + thumb_func_end sub_8157FA0 + + thumb_func_start sub_8157FE8 +sub_8157FE8: @ 8157FE8 + push {lr} + bl sub_8157F5C + ldr r0, _08158018 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _08158020 + ldr r3, _0815801C + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158028 + .align 2, 0 +_08158018: .4byte 0x02039f34 +_0815801C: .4byte 0x0203ab38 +_08158020: + ldr r1, _0815802C + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158028: + pop {r0} + bx r0 + .align 2, 0 +_0815802C: .4byte 0x0203ab38 + thumb_func_end sub_8157FE8 + + thumb_func_start sub_8158030 +sub_8158030: @ 8158030 + push {lr} + bl sub_8157F5C + ldr r0, _08158060 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158068 + ldr r3, _08158064 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158070 + .align 2, 0 +_08158060: .4byte 0x02039f34 +_08158064: .4byte 0x0203ab38 +_08158068: + ldr r1, _08158074 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158070: + pop {r0} + bx r0 + .align 2, 0 +_08158074: .4byte 0x0203ab38 + thumb_func_end sub_8158030 + + thumb_func_start sub_8158078 +sub_8158078: @ 8158078 + push {lr} + bl sub_8157F5C + ldr r0, _081580A8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081580B0 + ldr r3, _081580AC + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081580B8 + .align 2, 0 +_081580A8: .4byte 0x02039f34 +_081580AC: .4byte 0x0203ab38 +_081580B0: + ldr r1, _081580BC + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_081580B8: + pop {r0} + bx r0 + .align 2, 0 +_081580BC: .4byte 0x0203ab38 + thumb_func_end sub_8158078 + + thumb_func_start sub_81580C0 +sub_81580C0: @ 81580C0 + push {r4,r5,lr} + ldr r5, _081580FC + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldr r1, _08158100 + ldr r4, [r1] + ldr r1, [r4] + lsrs r0, 23 + lsls r2, 3 + adds r0, r2 + adds r1, 0x1C + adds r1, r0 + ldrh r0, [r1] + ldr r2, [r4, 0xC] + ldr r1, _08158104 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2, 0x18] + adds r3, 0x3 + str r3, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081580FC: .4byte 0x0203ab38 +_08158100: .4byte 0x02039f34 +_08158104: .4byte 0x0858c2b4 + thumb_func_end sub_81580C0 + + thumb_func_start sub_8158108 +sub_8158108: @ 8158108 + push {lr} + bl sub_81580C0 + ldr r0, _0815813C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08158140 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08158144 + 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 _08158148 + .align 2, 0 +_0815813C: .4byte 0x02039f34 +_08158140: .4byte 0x0203ab38 +_08158144: + adds r0, r2, 0x5 + str r0, [r3] +_08158148: + pop {r0} + bx r0 + thumb_func_end sub_8158108 + + thumb_func_start sub_815814C +sub_815814C: @ 815814C + push {lr} + bl sub_81580C0 + ldr r0, _08158180 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08158184 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08158188 + 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 _0815818C + .align 2, 0 +_08158180: .4byte 0x02039f34 +_08158184: .4byte 0x0203ab38 +_08158188: + adds r0, r2, 0x5 + str r0, [r3] +_0815818C: + pop {r0} + bx r0 + thumb_func_end sub_815814C + + thumb_func_start sub_8158190 +sub_8158190: @ 8158190 + push {lr} + bl sub_81580C0 + ldr r0, _081581C4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081581C8 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081581CC + 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 _081581D0 + .align 2, 0 +_081581C4: .4byte 0x02039f34 +_081581C8: .4byte 0x0203ab38 +_081581CC: + adds r0, r2, 0x5 + str r0, [r3] +_081581D0: + pop {r0} + bx r0 + thumb_func_end sub_8158190 + + thumb_func_start sub_81581D4 +sub_81581D4: @ 81581D4 + push {lr} + bl sub_81580C0 + ldr r0, _08158208 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _0815820C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08158210 + 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 _08158214 + .align 2, 0 +_08158208: .4byte 0x02039f34 +_0815820C: .4byte 0x0203ab38 +_08158210: + adds r0, r2, 0x5 + str r0, [r3] +_08158214: + pop {r0} + bx r0 + thumb_func_end sub_81581D4 + + thumb_func_start sub_8158218 +sub_8158218: @ 8158218 + push {r4,r5,lr} + ldr r5, _0815824C + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldr r1, _08158250 + ldr r4, [r1] + ldr r1, [r4] + lsls r2, 2 + adds r0, r2 + adds r1, 0x44 + adds r1, r0 + ldr r2, [r4, 0xC] + movs r0, 0 + ldrsb r0, [r1, r0] + strh r0, [r2, 0x18] + adds r3, 0x3 + str r3, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815824C: .4byte 0x0203ab38 +_08158250: .4byte 0x02039f34 + thumb_func_end sub_8158218 + + thumb_func_start sub_8158254 +sub_8158254: @ 8158254 + push {lr} + bl sub_8158218 + ldr r0, _08158288 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _0815828C + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08158290 + 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 _08158294 + .align 2, 0 +_08158288: .4byte 0x02039f34 +_0815828C: .4byte 0x0203ab38 +_08158290: + adds r0, r2, 0x5 + str r0, [r3] +_08158294: + pop {r0} + bx r0 + thumb_func_end sub_8158254 + + thumb_func_start sub_8158298 +sub_8158298: @ 8158298 + push {lr} + bl sub_8158218 + ldr r0, _081582CC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081582D0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _081582D4 + 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 _081582D8 + .align 2, 0 +_081582CC: .4byte 0x02039f34 +_081582D0: .4byte 0x0203ab38 +_081582D4: + adds r0, r2, 0x5 + str r0, [r3] +_081582D8: + pop {r0} + bx r0 + thumb_func_end sub_8158298 + + thumb_func_start sub_81582DC +sub_81582DC: @ 81582DC + push {lr} + bl sub_8158218 + ldr r0, _08158310 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08158314 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08158318 + 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 _0815831C + .align 2, 0 +_08158310: .4byte 0x02039f34 +_08158314: .4byte 0x0203ab38 +_08158318: + adds r0, r2, 0x5 + str r0, [r3] +_0815831C: + pop {r0} + bx r0 + thumb_func_end sub_81582DC + + thumb_func_start sub_8158320 +sub_8158320: @ 8158320 + push {lr} + bl sub_8158218 + ldr r0, _08158354 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08158358 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _0815835C + 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 _08158360 + .align 2, 0 +_08158354: .4byte 0x02039f34 +_08158358: .4byte 0x0203ab38 +_0815835C: + adds r0, r2, 0x5 + str r0, [r3] +_08158360: + pop {r0} + bx r0 + thumb_func_end sub_8158320 + + thumb_func_start sub_8158364 +sub_8158364: @ 8158364 + push {r4,r5,lr} + ldr r5, _081583A8 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldr r1, _081583AC + ldr r4, [r1] + ldr r1, [r4] + lsrs r0, 23 + lsls r2, 3 + adds r0, r2 + adds r1, 0x1C + adds r1, r0 + ldrh r0, [r1] + ldr r4, [r4, 0xC] + ldr r2, _081583B0 + ldr r1, _081583B4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x18] + adds r3, 0x3 + str r3, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081583A8: .4byte 0x0203ab38 +_081583AC: .4byte 0x02039f34 +_081583B0: .4byte 0x0858cdcc +_081583B4: .4byte 0x0858c2b4 + thumb_func_end sub_8158364 + + thumb_func_start sub_81583B8 +sub_81583B8: @ 81583B8 + push {lr} + bl sub_8158364 + ldr r0, _081583EC + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _081583F0 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081583F4 + 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 _081583F8 + .align 2, 0 +_081583EC: .4byte 0x02039f34 +_081583F0: .4byte 0x0203ab38 +_081583F4: + adds r0, r2, 0x5 + str r0, [r3] +_081583F8: + pop {r0} + bx r0 + thumb_func_end sub_81583B8 + + thumb_func_start sub_81583FC +sub_81583FC: @ 81583FC + push {lr} + bl sub_8158364 + ldr r0, _08158430 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, _08158434 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08158438 + 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 _0815843C + .align 2, 0 +_08158430: .4byte 0x02039f34 +_08158434: .4byte 0x0203ab38 +_08158438: + adds r0, r2, 0x5 + str r0, [r3] +_0815843C: + pop {r0} + bx r0 + thumb_func_end sub_81583FC + + thumb_func_start sub_8158440 +sub_8158440: @ 8158440 + push {r4,lr} + ldr r0, _08158464 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldr r4, _08158468 + ldr r2, [r4] + ldrb r0, [r2, 0x1] + lsls r0, 1 + adds r1, r3, 0 + adds r1, 0x1A + adds r1, r0 + ldrh r0, [r3, 0x18] + strh r0, [r1] + adds r2, 0x2 + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08158464: .4byte 0x02039f34 +_08158468: .4byte 0x0203ab38 + thumb_func_end sub_8158440 + + thumb_func_start sub_815846C +sub_815846C: @ 815846C + push {r4,lr} + ldr r0, _08158494 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldr r4, _08158498 + ldr r2, [r4] + ldrb r0, [r2, 0x1] + lsls r0, 1 + adds r3, 0x1A + adds r3, r0 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + strh r1, [r3] + adds r2, 0x4 + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08158494: .4byte 0x02039f34 +_08158498: .4byte 0x0203ab38 + thumb_func_end sub_815846C + + thumb_func_start sub_815849C +sub_815849C: @ 815849C + push {r4,lr} + ldr r0, _081584CC + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _081584D0 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r2, 0x1A + adds r2, r0 + movs r1, 0x2 + ldrsb r1, [r3, r1] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2] + adds r1, r0 + strh r1, [r2] + adds r3, 0x4 + str r3, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081584CC: .4byte 0x02039f34 +_081584D0: .4byte 0x0203ab38 + thumb_func_end sub_815849C + + thumb_func_start sub_81584D4 +sub_81584D4: @ 81584D4 + push {r4,lr} + ldr r0, _08158500 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08158504 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + ldrh r0, [r2] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + adds r3, 0x3 + str r3, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08158500: .4byte 0x02039f34 +_08158504: .4byte 0x0203ab38 + thumb_func_end sub_81584D4 + + thumb_func_start sub_8158508 +sub_8158508: @ 8158508 + push {r4,lr} + ldr r0, _08158534 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08158538 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + ldrh r0, [r2] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + adds r3, 0x3 + str r3, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08158534: .4byte 0x02039f34 +_08158538: .4byte 0x0203ab38 + thumb_func_end sub_8158508 + + thumb_func_start sub_815853C +sub_815853C: @ 815853C + push {r4,lr} + ldr r0, _08158578 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, _0815857C + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + bge _08158580 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158586 + .align 2, 0 +_08158578: .4byte 0x02039f34 +_0815857C: .4byte 0x0203ab38 +_08158580: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_08158586: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815853C + + thumb_func_start sub_815858C +sub_815858C: @ 815858C + push {r4,lr} + ldr r0, _081585C8 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, _081585CC + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + ble _081585D0 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081585D6 + .align 2, 0 +_081585C8: .4byte 0x02039f34 +_081585CC: .4byte 0x0203ab38 +_081585D0: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_081585D6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815858C + + thumb_func_start sub_81585DC +sub_81585DC: @ 81585DC + push {r4,lr} + ldr r0, _08158618 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, _0815861C + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + bne _08158620 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158626 + .align 2, 0 +_08158618: .4byte 0x02039f34 +_0815861C: .4byte 0x0203ab38 +_08158620: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_08158626: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81585DC + + thumb_func_start sub_815862C +sub_815862C: @ 815862C + push {r4,lr} + ldr r0, _08158668 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, _0815866C + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + beq _08158670 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158676 + .align 2, 0 +_08158668: .4byte 0x02039f34 +_0815866C: .4byte 0x0203ab38 +_08158670: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_08158676: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815862C + + thumb_func_start sub_815867C +sub_815867C: @ 815867C + push {r4,r5,lr} + ldr r0, _081586BC + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _081586C0 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + bge _081586C4 + 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 _081586C8 + .align 2, 0 +_081586BC: .4byte 0x02039f34 +_081586C0: .4byte 0x0203ab38 +_081586C4: + adds r0, r3, 0x7 + str r0, [r4] +_081586C8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815867C + + thumb_func_start sub_81586D0 +sub_81586D0: @ 81586D0 + push {r4,r5,lr} + ldr r0, _08158710 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08158714 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + ble _08158718 + 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 _0815871C + .align 2, 0 +_08158710: .4byte 0x02039f34 +_08158714: .4byte 0x0203ab38 +_08158718: + adds r0, r3, 0x7 + str r0, [r4] +_0815871C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81586D0 + + thumb_func_start sub_8158724 +sub_8158724: @ 8158724 + push {r4,r5,lr} + ldr r0, _08158764 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _08158768 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + bne _0815876C + 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 _08158770 + .align 2, 0 +_08158764: .4byte 0x02039f34 +_08158768: .4byte 0x0203ab38 +_0815876C: + adds r0, r3, 0x7 + str r0, [r4] +_08158770: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8158724 + + thumb_func_start sub_8158778 +sub_8158778: @ 8158778 + push {r4,r5,lr} + ldr r0, _081587B8 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, _081587BC + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + beq _081587C0 + 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 _081587C4 + .align 2, 0 +_081587B8: .4byte 0x02039f34 +_081587BC: .4byte 0x0203ab38 +_081587C0: + adds r0, r3, 0x7 + str r0, [r4] +_081587C4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8158778 + + thumb_func_start sub_81587CC +sub_81587CC: @ 81587CC + push {r4,r5,lr} + bl GenerateRandomNumber + movs r2, 0xFF + ands r2, r0 + ldr r0, _08158808 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, _0815880C + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r2, r0 + bge _08158810 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158814 + .align 2, 0 +_08158808: .4byte 0x02039f34 +_0815880C: .4byte 0x0203ab38 +_08158810: + adds r0, r3, 0x6 + str r0, [r4] +_08158814: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81587CC + + thumb_func_start sub_815881C +sub_815881C: @ 815881C + push {r4,r5,lr} + bl GenerateRandomNumber + movs r2, 0xFF + ands r2, r0 + ldr r0, _08158858 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, _0815885C + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r2, r0 + ble _08158860 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158864 + .align 2, 0 +_08158858: .4byte 0x02039f34 +_0815885C: .4byte 0x0203ab38 +_08158860: + adds r0, r3, 0x6 + str r0, [r4] +_08158864: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815881C + + thumb_func_start sub_815886C +sub_815886C: @ 815886C + ldr r3, _08158888 + 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] + bx lr + .align 2, 0 +_08158888: .4byte 0x0203ab38 + thumb_func_end sub_815886C + + thumb_func_start dp15_call +dp15_call: @ 815888C + push {r4,lr} + ldr r4, _081588B8 + ldr r0, [r4] + adds r0, 0x5 + bl sub_81588E0 + 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 + .align 2, 0 +_081588B8: .4byte 0x0203ab38 + thumb_func_end dp15_call + + thumb_func_start sub_81588BC +sub_81588BC: @ 81588BC + push {lr} + bl sub_8158908 + lsls r0, 24 + cmp r0, 0 + bne _081588D6 + ldr r0, _081588DC + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] +_081588D6: + pop {r0} + bx r0 + .align 2, 0 +_081588DC: .4byte 0x02039f34 + thumb_func_end sub_81588BC + + thumb_func_start sub_81588E0 +sub_81588E0: @ 81588E0 + push {r4,lr} + ldr r1, _08158904 + ldr r1, [r1] + ldr r3, [r1, 0xC] + adds r4, r3, 0 + adds r4, 0x40 + ldrb r1, [r4] + adds r2, r1, 0x1 + strb r2, [r4] + lsls r1, 24 + lsrs r1, 22 + adds r3, 0x20 + adds r3, r1 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08158904: .4byte 0x02039f34 + thumb_func_end sub_81588E0 + + thumb_func_start sub_8158908 +sub_8158908: @ 8158908 + push {lr} + ldr r3, _08158920 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x40 + ldrb r0, [r1] + cmp r0, 0 + bne _08158924 + movs r0, 0 + b _08158940 + .align 2, 0 +_08158920: .4byte 0x02039f34 +_08158924: + subs r0, 0x1 + strb r0, [r1] + ldr r2, _08158944 + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + movs r0, 0x1 +_08158940: + pop {r1} + bx r1 + .align 2, 0 +_08158944: .4byte 0x0203ab38 + thumb_func_end sub_8158908 + + thumb_func_start sub_8158948 +sub_8158948: @ 8158948 + push {r4-r6,lr} + movs r5, 0 + movs r4, 0 + ldr r6, _08158978 +_08158950: + lsls r1, r4, 1 + ldr r0, _0815897C + ldr r0, [r0] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _08158980 + bl sub_80DD9F0 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _08158980 + movs r5, 0x1 + b _08158986 + .align 2, 0 +_08158978: .4byte 0x02039e1e +_0815897C: .4byte 0x02039f34 +_08158980: + adds r4, 0x1 + cmp r4, 0x3 + ble _08158950 +_08158986: + ldr r0, _0815899C + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r5, [r0, 0x18] + ldr r1, _081589A0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815899C: .4byte 0x02039f34 +_081589A0: .4byte 0x0203ab38 + thumb_func_end sub_8158948 + + thumb_func_start sub_81589A4 +sub_81589A4: @ 81589A4 + push {lr} + bl sub_8158948 + ldr r0, _081589D4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081589DC + ldr r3, _081589D8 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081589E4 + .align 2, 0 +_081589D4: .4byte 0x02039f34 +_081589D8: .4byte 0x0203ab38 +_081589DC: + ldr r1, _081589E8 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_081589E4: + pop {r0} + bx r0 + .align 2, 0 +_081589E8: .4byte 0x0203ab38 + thumb_func_end sub_81589A4 + + thumb_func_start sub_81589EC +sub_81589EC: @ 81589EC + push {lr} + bl sub_8158948 + ldr r0, _08158A1C + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158A24 + ldr r3, _08158A20 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158A2C + .align 2, 0 +_08158A1C: .4byte 0x02039f34 +_08158A20: .4byte 0x0203ab38 +_08158A24: + ldr r1, _08158A30 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158A2C: + pop {r0} + bx r0 + .align 2, 0 +_08158A30: .4byte 0x0203ab38 + thumb_func_end sub_81589EC + + thumb_func_start sub_8158A34 +sub_8158A34: @ 8158A34 + push {r4-r6,lr} + movs r6, 0 + ldr r3, _08158A60 + ldr r0, [r3] + ldrb r5, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r5, r0 + movs r4, 0 + ldr r0, _08158A64 + mov r12, r0 + ldr r2, _08158A68 + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + mov r1, r12 + adds r1, 0x1E + adds r0, r1 + ldrh r0, [r0] + b _08158A88 + .align 2, 0 +_08158A60: .4byte 0x0203ab38 +_08158A64: .4byte 0x02039e00 +_08158A68: .4byte 0x02039f34 +_08158A6C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08158A8E + lsls r1, r4, 1 + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + mov r0, r12 + adds r0, 0x1E + adds r1, r0 + ldrh r0, [r1] +_08158A88: + cmp r0, r5 + bne _08158A6C + movs r6, 0x1 +_08158A8E: + ldr r0, [r2] + ldr r0, [r0, 0xC] + strh r6, [r0, 0x18] + ldr r0, [r3] + adds r0, 0x3 + str r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158A34 + + thumb_func_start sub_8158AA0 +sub_8158AA0: @ 8158AA0 + push {lr} + bl sub_8158A34 + ldr r0, _08158AD0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08158AD8 + ldr r3, _08158AD4 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158AE0 + .align 2, 0 +_08158AD0: .4byte 0x02039f34 +_08158AD4: .4byte 0x0203ab38 +_08158AD8: + ldr r1, _08158AE4 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158AE0: + pop {r0} + bx r0 + .align 2, 0 +_08158AE4: .4byte 0x0203ab38 + thumb_func_end sub_8158AA0 + + thumb_func_start sub_8158AE8 +sub_8158AE8: @ 8158AE8 + push {lr} + bl sub_8158A34 + ldr r0, _08158B18 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158B20 + ldr r3, _08158B1C + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158B28 + .align 2, 0 +_08158B18: .4byte 0x02039f34 +_08158B1C: .4byte 0x0203ab38 +_08158B20: + ldr r1, _08158B2C + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158B28: + pop {r0} + bx r0 + .align 2, 0 +_08158B2C: .4byte 0x0203ab38 + thumb_func_end sub_8158AE8 + + thumb_func_start sub_8158B30 +sub_8158B30: @ 8158B30 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08158B8C + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + adds r6, r1 + ldr r1, _08158B90 + ldrh r0, [r1] + strh r0, [r6, 0x8] + ldrh r0, [r1, 0x2] + strh r0, [r6, 0xA] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3F + bl sub_80A5178 + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80A5314 + strh r4, [r6, 0xC] + strh r5, [r6, 0xE] + lsls r0, 24 + asrs r0, 24 + strh r0, [r6, 0x10] + movs r0, 0xA + strh r0, [r6, 0x1C] + ldr r0, _08158B94 + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08158B8C: .4byte 0x03005e00 +_08158B90: .4byte 0x0203841e +_08158B94: .4byte sub_8158B98 + 1 + thumb_func_end sub_8158B30 + + thumb_func_start sub_8158B98 +sub_8158B98: @ 8158B98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08158BC8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r5, [r4, 0xC] + ldrb r6, [r4, 0x10] + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + bne _08158BD0 + movs r0, 0x5 + strh r0, [r4, 0x1C] + strh r1, [r4, 0x1E] + ldr r0, _08158BCC + str r0, [r4] + b _08158BFE + .align 2, 0 +_08158BC8: .4byte 0x03005e00 +_08158BCC: .4byte sub_8158C04 + 1 +_08158BD0: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08158BEA + strh r1, [r4, 0x1C] + ldrh r0, [r4, 0x8] + lsls r1, r5, 24 + asrs r1, 24 + bl audio_play_and_stuff +_08158BEA: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + bl sub_80A52EC + strh r0, [r4, 0xC] +_08158BFE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158B98 + + thumb_func_start sub_8158C04 +sub_8158C04: @ 8158C04 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08158C54 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _08158C4C + movs r0, 0 + strh r0, [r4, 0x1C] + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + ldrh r0, [r4, 0xA] + lsls r1, 24 + asrs r1, 24 + bl audio_play_and_stuff + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08158C4C + adds r0, r5, 0 + bl move_anim_related_task_del +_08158C4C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08158C54: .4byte 0x03005e00 + thumb_func_end sub_8158C04 + + thumb_func_start mas_80DCF38 +mas_80DCF38: @ 8158C58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _08158CFC + ldrh r1, [r0] + str r1, [sp] + ldrb r5, [r0, 0x4] + ldrb r6, [r0, 0x6] + ldrb r3, [r0, 0x8] + mov r10, r3 + ldrb r7, [r0, 0xA] + ldrb r1, [r0, 0xC] + mov r9, r1 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r5, 0 + bl sub_80A5178 + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A5314 + ldr r2, _08158D00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + mov r6, sp + ldrh r6, [r6] + strh r6, [r1, 0x8] + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0xE] + mov r0, r10 + strh r0, [r1, 0x10] + strh r7, [r1, 0x12] + mov r3, r9 + strh r3, [r1, 0x14] + strh r2, [r1, 0x1C] + strh r4, [r1, 0x1E] + strh r3, [r1, 0x20] + ldr r2, _08158D04 + str r2, [r1] + mov r0, r8 + bl _call_via_r2 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08158CFC: .4byte 0x0203841e +_08158D00: .4byte 0x03005e00 +_08158D04: .4byte sub_8158D08 + 1 + thumb_func_end mas_80DCF38 + + thumb_func_start sub_8158D08 +sub_8158D08: @ 8158D08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08158D4C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x20] + adds r1, r0, 0x1 + strh r1, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x14 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08158D50 + movs r0, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x8] + movs r1, 0x1E + ldrsb r1, [r4, r1] + bl audio_play_and_stuff + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _08158D50 + adds r0, r5, 0 + bl move_anim_related_task_del + b _08158D82 + .align 2, 0 +_08158D4C: .4byte 0x03005e00 +_08158D50: + ldr r1, _08158D88 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08158D82 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0x1E] + adds r0, r1 + strh r0, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + bl sub_80A52EC + strh r0, [r4, 0x1E] +_08158D82: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08158D88: .4byte 0x03005e00 + thumb_func_end sub_8158D08 + + thumb_func_start sub_8158D8C +sub_8158D8C: @ 8158D8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08158DD0 + ldr r0, _08158DC0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158DC8 + ldr r0, _08158DC4 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _08158E76 + .align 2, 0 +_08158DC0: .4byte 0x0203841e +_08158DC4: .4byte 0x02039f34 +_08158DC8: + adds r0, r5, 0 + bl move_anim_task_del + b _08158E76 +_08158DD0: + ldr r0, _08158DE4 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08158DEC + ldr r0, _08158DE8 + ldrb r4, [r0] + b _08158E12 + .align 2, 0 +_08158DE4: .4byte 0x0203841e +_08158DE8: .4byte 0x02038436 +_08158DEC: + cmp r1, 0x1 + bne _08158DFC + ldr r0, _08158DF8 + ldrb r4, [r0] + b _08158E12 + .align 2, 0 +_08158DF8: .4byte 0x02038437 +_08158DFC: + cmp r1, 0x2 + bne _08158E08 + ldr r0, _08158E04 + b _08158E0A + .align 2, 0 +_08158E04: .4byte 0x02038436 +_08158E08: + ldr r0, _08158E34 +_08158E0A: + ldrb r1, [r0] + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r1 +_08158E12: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08158E1E + cmp r0, 0x3 + bne _08158E38 +_08158E1E: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08158E38 + adds r0, r5, 0 + bl move_anim_task_del + b _08158E8C + .align 2, 0 +_08158E34: .4byte 0x02038437 +_08158E38: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08158E5C + ldr r1, _08158E54 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08158E58 + b _08158E6A + .align 2, 0 +_08158E54: .4byte 0x0202406e +_08158E58: .4byte 0x02024744 +_08158E5C: + ldr r1, _08158E94 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08158E98 +_08158E6A: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 +_08158E76: + cmp r4, 0 + beq _08158E86 + lsls r1, r6, 24 + asrs r1, 24 + adds r0, r4, 0 + movs r2, 0x3 + bl sub_80A32E4 +_08158E86: + adds r0, r5, 0 + bl move_anim_task_del +_08158E8C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08158E94: .4byte 0x0202406e +_08158E98: .4byte 0x020244ec + thumb_func_end sub_8158D8C + + thumb_func_start sub_8158E9C +sub_8158E9C: @ 8158E9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08158EE0 + ldr r0, _08158ED0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158ED8 + ldr r0, _08158ED4 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _08158F86 + .align 2, 0 +_08158ED0: .4byte 0x0203841e +_08158ED4: .4byte 0x02039f34 +_08158ED8: + adds r0, r6, 0 + bl move_anim_task_del + b _08158F86 +_08158EE0: + ldr r0, _08158EF4 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08158EFC + ldr r0, _08158EF8 + ldrb r4, [r0] + b _08158F22 + .align 2, 0 +_08158EF4: .4byte 0x0203841e +_08158EF8: .4byte 0x02038436 +_08158EFC: + cmp r1, 0x1 + bne _08158F0C + ldr r0, _08158F08 + ldrb r4, [r0] + b _08158F22 + .align 2, 0 +_08158F08: .4byte 0x02038437 +_08158F0C: + cmp r1, 0x2 + bne _08158F18 + ldr r0, _08158F14 + b _08158F1A + .align 2, 0 +_08158F14: .4byte 0x02038436 +_08158F18: + ldr r0, _08158F44 +_08158F1A: + ldrb r1, [r0] + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r1 +_08158F22: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08158F2E + cmp r0, 0x3 + bne _08158F48 +_08158F2E: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08158F48 + adds r0, r6, 0 + bl move_anim_task_del + b _08158FEE + .align 2, 0 +_08158F44: .4byte 0x02038437 +_08158F48: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08158F6C + ldr r1, _08158F64 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08158F68 + b _08158F7A + .align 2, 0 +_08158F64: .4byte 0x0202406e +_08158F68: .4byte 0x02024744 +_08158F6C: + ldr r1, _08158FB8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08158FBC +_08158F7A: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 +_08158F86: + ldr r1, _08158FC0 + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1 + ldr r3, _08158FC4 + ldrh r1, [r3, 0x2] + strh r1, [r0, 0x8] + strh r4, [r0, 0xA] + lsls r1, r5, 24 + asrs r1, 24 + strh r1, [r0, 0xC] + adds r5, r2, 0 + cmp r4, 0 + beq _08158FE8 + movs r2, 0x2 + ldrsh r0, [r3, r2] + cmp r0, 0xFF + bne _08158FC8 + adds r0, r4, 0 + movs r2, 0x9 + bl sub_80A32E4 + b _08158FD0 + .align 2, 0 +_08158FB8: .4byte 0x0202406e +_08158FBC: .4byte 0x020244ec +_08158FC0: .4byte 0x03005e00 +_08158FC4: .4byte 0x0203841e +_08158FC8: + adds r0, r4, 0 + movs r2, 0x7 + bl sub_80A32E4 +_08158FD0: + ldr r0, _08158FE0 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _08158FE4 + str r0, [r1] + b _08158FEE + .align 2, 0 +_08158FE0: .4byte 0x03005e00 +_08158FE4: .4byte sub_8158FF4 + 1 +_08158FE8: + adds r0, r6, 0 + bl move_anim_task_del +_08158FEE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158E9C + + thumb_func_start sub_8158FF4 +sub_8158FF4: @ 8158FF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r9, r4 + ldr r1, _08159024 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r6, [r1, 0xA] + mov r8, r6 + ldrb r5, [r1, 0xC] + adds r7, r5, 0 + ldrh r2, [r1, 0x1A] + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bgt _08159028 + adds r0, r2, 0x1 + strh r0, [r1, 0x1A] + b _0815906A + .align 2, 0 +_08159024: .4byte 0x03005e00 +_08159028: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + bne _0815904E + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _0815906A + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xA + bl sub_80A32E4 + adds r0, r4, 0 + bl move_anim_task_del + b _0815906A +_0815904E: + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _0815906A + lsls r1, r7, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x8 + bl sub_80A32E4 + mov r0, r9 + bl move_anim_task_del +_0815906A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8158FF4 + + thumb_func_start sub_8159078 +sub_8159078: @ 8159078 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, _0815909C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x1A] + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bgt _081590A0 + adds r0, r2, 0x1 + strh r0, [r1, 0x1A] + b _081590B0 + .align 2, 0 +_0815909C: .4byte 0x03005e00 +_081590A0: + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _081590B0 + adds r0, r4, 0 + bl move_anim_task_del +_081590B0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8159078 + + thumb_func_start sub_81590B8 +sub_81590B8: @ 81590B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _081590EC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081590F0 + ldrh r1, [r1] + strh r1, [r0, 0x1C] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081590F8 + ldr r0, _081590F4 + ldr r0, [r0] + ldr r0, [r0, 0x18] + b _08159102 + .align 2, 0 +_081590EC: .4byte 0x03005e00 +_081590F0: .4byte 0x0203841e +_081590F4: .4byte 0x02039f34 +_081590F8: + ldr r1, _08159120 + ldr r0, _08159124 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 +_08159102: + ldrh r2, [r0] + ldr r0, _08159128 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0xA] + lsls r0, r5, 24 + asrs r0, 24 + strh r0, [r1, 0xC] + cmp r2, 0 + beq _08159130 + ldr r0, _0815912C + str r0, [r1] + b _08159136 + .align 2, 0 +_08159120: .4byte 0x02038438 +_08159124: .4byte 0x02038436 +_08159128: .4byte 0x03005e00 +_0815912C: .4byte sub_815913C + 1 +_08159130: + adds r0, r4, 0 + bl move_anim_task_del +_08159136: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81590B8 + + thumb_func_start sub_815913C +sub_815913C: @ 815913C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0815916C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r6, [r0, 0xA] + mov r8, r6 + ldrb r3, [r0, 0xC] + adds r5, r3, 0 + movs r7, 0x1A + ldrsh r2, [r0, r7] + mov r12, r1 + cmp r2, 0x5 + bhi _081591DC + lsls r0, r2, 2 + ldr r1, _08159170 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815916C: .4byte 0x03005e00 +_08159170: .4byte _08159174 + .align 2, 0 +_08159174: + .4byte _081591C2 + .4byte _081591A8 + .4byte _0815918C + .4byte _081591A8 + .4byte _081591A8 + .4byte _081591B8 +_0815918C: + lsls r1, r5, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x4 + bl play_cry_maybe + ldr r1, _081591A4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + b _081591B0 + .align 2, 0 +_081591A4: .4byte 0x03005e00 +_081591A8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r12 +_081591B0: + ldrh r1, [r0, 0x1A] + adds r1, 0x1 + strh r1, [r0, 0x1A] + b _08159204 +_081591B8: + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _08159204 +_081591C2: + bl sub_80A369C + ldr r0, _081591D8 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1A] + adds r0, 0x1 + strh r0, [r1, 0x1A] + b _08159204 + .align 2, 0 +_081591D8: .4byte 0x03005e00 +_081591DC: + movs r1, 0x1C + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081591F2 + lsls r1, r3, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0x6 + bl play_cry_maybe + b _081591FE +_081591F2: + lsls r1, r5, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x6 + bl sub_80A32E4 +_081591FE: + adds r0, r4, 0 + bl move_anim_task_del +_08159204: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815913C + + thumb_func_start sub_8159210 +sub_8159210: @ 8159210 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08159240 + ldrh r5, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_80A3808 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159240: .4byte 0x0203841e + thumb_func_end sub_8159210 + + thumb_func_start sub_8159244 +sub_8159244: @ 8159244 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08159274 + ldrh r5, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_80A383C + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159274: .4byte 0x0203841e + thumb_func_end sub_8159244 + + thumb_func_start sub_8159278 +sub_8159278: @ 8159278 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _081592FC + ldrb r5, [r0, 0x2] + ldrb r6, [r0, 0x4] + ldrh r1, [r0, 0x6] + mov r9, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r5, 0 + bl sub_80A5178 + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A5314 + ldr r2, _08159300 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0xE] + mov r0, r9 + strh r0, [r1, 0x12] + strh r2, [r1, 0x1C] + strh r4, [r1, 0x1E] + ldr r2, _08159304 + str r2, [r1] + mov r0, r8 + bl _call_via_r2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081592FC: .4byte 0x0203841e +_08159300: .4byte 0x03005e00 +_08159304: .4byte sub_8159308 + 1 + thumb_func_end sub_8159278 + + thumb_func_start sub_8159308 +sub_8159308: @ 8159308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _08159360 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r2, [r4, 0xE] + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _08159342 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r0, r2, r1 + strh r0, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + bl sub_80A52EC + strh r0, [r4, 0x1E] +_08159342: + ldr r1, _08159364 + ldrh r0, [r4, 0x1E] + strb r0, [r1] + movs r3, 0x1E + ldrsh r1, [r4, r3] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0815935A + adds r0, r5, 0 + bl move_anim_task_del +_0815935A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159360: .4byte 0x03005e00 +_08159364: .4byte 0x02038440 + thumb_func_end sub_8159308 + + thumb_func_start nullsub_114 +nullsub_114: @ 8159368 + bx lr + thumb_func_end nullsub_114 + + thumb_func_start sub_815936C +sub_815936C: @ 815936C + ldr r1, _0815937C + ldr r0, _08159380 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159384 + str r1, [r0] + bx lr + .align 2, 0 +_0815937C: .4byte 0x03005d60 +_08159380: .4byte 0x02024064 +_08159384: .4byte bx_exec_buffer_A_ch0_tbl6 + 1 + thumb_func_end sub_815936C + + thumb_func_start bx_exec_buffer_A_ch0_tbl6 +bx_exec_buffer_A_ch0_tbl6: @ 8159388 + push {lr} + ldr r2, _081593BC + ldr r1, _081593C0 + ldr r0, _081593C4 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081593D4 + ldr r0, _081593C8 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081593D0 + ldr r0, _081593CC + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081593D4 + .align 2, 0 +_081593BC: .4byte 0x02024068 +_081593C0: .4byte 0x0832a328 +_081593C4: .4byte 0x02024064 +_081593C8: .4byte 0x02023064 +_081593CC: .4byte 0x085cdf20 +_081593D0: + bl dp01_tbl6_exec_completed +_081593D4: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl6 + + thumb_func_start bx_battle_menu_t6_2 +bx_battle_menu_t6_2: @ 81593D8 + push {r4,r5,lr} + ldr r0, _08159408 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08159446 + movs r0, 0x5 + bl audio_play + ldr r1, _0815940C + ldr r0, _08159410 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08159424 + cmp r0, 0x1 + bgt _08159414 + cmp r0, 0 + beq _0815941E + b _08159440 + .align 2, 0 +_08159408: .4byte 0x030022c0 +_0815940C: .4byte 0x020244ac +_08159410: .4byte 0x02024064 +_08159414: + cmp r0, 0x2 + beq _0815942A + cmp r0, 0x3 + beq _08159436 + b _08159440 +_0815941E: + movs r0, 0x1 + movs r1, 0x5 + b _0815942E +_08159424: + movs r0, 0x1 + movs r1, 0x6 + b _0815942E +_0815942A: + movs r0, 0x1 + movs r1, 0x7 +_0815942E: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08159440 +_08159436: + movs r0, 0x1 + movs r1, 0x8 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_08159440: + bl dp01_tbl6_exec_completed + b _0815954E +_08159446: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08159484 + ldr r5, _0815947C + ldr r4, _08159480 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0815954E + 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 _081594F2 + .align 2, 0 +_0815947C: .4byte 0x020244ac +_08159480: .4byte 0x02024064 +_08159484: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081594C0 + ldr r5, _081594B8 + ldr r4, _081594BC + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0815954E + 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 _081594F2 + .align 2, 0 +_081594B8: .4byte 0x020244ac +_081594BC: .4byte 0x02024064 +_081594C0: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0815950C + ldr r5, _08159504 + ldr r4, _08159508 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0815954E + 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 +_081594F2: + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + b _0815954E + .align 2, 0 +_08159504: .4byte 0x020244ac +_08159508: .4byte 0x02024064 +_0815950C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0815954E + ldr r5, _08159554 + ldr r4, _08159558 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0815954E + 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 + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 +_0815954E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159554: .4byte 0x020244ac +_08159558: .4byte 0x02024064 + thumb_func_end bx_battle_menu_t6_2 + + thumb_func_start sub_815955C +sub_815955C: @ 815955C + push {lr} + ldr r2, _08159584 + ldr r1, _08159588 + ldr r0, _0815958C + 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, _08159590 + cmp r1, r0 + bne _08159580 + bl dp01_tbl6_exec_completed +_08159580: + pop {r0} + bx r0 + .align 2, 0 +_08159584: .4byte 0x02020630 +_08159588: .4byte 0x020241e4 +_0815958C: .4byte 0x02024064 +_08159590: .4byte nullsub_12 + 1 + thumb_func_end sub_815955C + + thumb_func_start bx_t6_button_a +bx_t6_button_a: @ 8159594 + push {lr} + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _081595A6 + bl dp01_tbl6_exec_completed +_081595A6: + pop {r0} + bx r0 + thumb_func_end bx_t6_button_a + + thumb_func_start sub_81595AC +sub_81595AC: @ 81595AC + push {lr} + ldr r2, _081595D4 + ldr r1, _081595D8 + ldr r0, _081595DC + 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, _081595E0 + cmp r1, r0 + bne _081595D0 + bl dp01_tbl6_exec_completed +_081595D0: + pop {r0} + bx r0 + .align 2, 0 +_081595D4: .4byte 0x02020630 +_081595D8: .4byte 0x03005d70 +_081595DC: .4byte 0x02024064 +_081595E0: .4byte nullsub_12 + 1 + thumb_func_end sub_81595AC + + thumb_func_start sub_81595E4 +sub_81595E4: @ 81595E4 + push {lr} + ldr r0, _08159614 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0815960E + ldr r2, _08159618 + ldr r0, _0815961C + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, _08159620 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl set_callback2 +_0815960E: + pop {r0} + bx r0 + .align 2, 0 +_08159614: .4byte 0x02037fd4 +_08159618: .4byte 0x030022c0 +_0815961C: .4byte 0x00000439 +_08159620: .4byte 0x03005d00 + thumb_func_end sub_81595E4 + + thumb_func_start bx_wait_t6 +bx_wait_t6: @ 8159624 + push {lr} + ldr r0, _08159654 + ldrb r0, [r0] + cmp r0, 0 + beq _0815964A + ldr r0, _08159658 + ldr r2, [r0] + ldr r0, _0815965C + 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 _0815964E +_0815964A: + bl dp01_tbl6_exec_completed +_0815964E: + pop {r0} + bx r0 + .align 2, 0 +_08159654: .4byte 0x020244b9 +_08159658: .4byte 0x020244d0 +_0815965C: .4byte 0x02024064 + thumb_func_end bx_wait_t6 + + thumb_func_start sub_8159660 +sub_8159660: @ 8159660 + push {lr} + ldr r0, _08159688 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08159684 + ldr r1, _0815968C + ldr r0, _08159690 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159694 + str r1, [r0] + bl Window_FreeMemory + bl sub_81358F4 +_08159684: + pop {r0} + bx r0 + .align 2, 0 +_08159688: .4byte 0x02037fd4 +_0815968C: .4byte 0x03005d60 +_08159690: .4byte 0x02024064 +_08159694: .4byte sub_8159698 + 1 + thumb_func_end sub_8159660 + + thumb_func_start sub_8159698 +sub_8159698: @ 8159698 + push {lr} + ldr r0, _081596C4 + ldr r1, [r0, 0x4] + ldr r0, _081596C8 + cmp r1, r0 + bne _081596BE + ldr r0, _081596CC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081596BE + ldr r0, _081596D0 + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl6_exec_completed +_081596BE: + pop {r0} + bx r0 + .align 2, 0 +_081596C4: .4byte 0x030022c0 +_081596C8: .4byte sub_8038420 + 1 +_081596CC: .4byte 0x02037fd4 +_081596D0: .4byte 0x0203ce7c + thumb_func_end sub_8159698 + + thumb_func_start sub_81596D4 +sub_81596D4: @ 81596D4 + push {lr} + ldr r0, _081596FC + ldr r2, [r0] + ldr r0, _08159700 + 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 _081596F6 + bl dp01_tbl6_exec_completed +_081596F6: + pop {r0} + bx r0 + .align 2, 0 +_081596FC: .4byte 0x020244d0 +_08159700: .4byte 0x02024064 + thumb_func_end sub_81596D4 + + thumb_func_start dp01_tbl6_exec_completed +dp01_tbl6_exec_completed: @ 8159704 + push {r4,lr} + sub sp, 0x4 + ldr r1, _08159744 + ldr r4, _08159748 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0815974C + str r1, [r0] + ldr r0, _08159750 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08159758 + 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, _08159754 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0815976A + .align 2, 0 +_08159744: .4byte 0x03005d60 +_08159748: .4byte 0x02024064 +_0815974C: .4byte bx_exec_buffer_A_ch0_tbl6 + 1 +_08159750: .4byte 0x02022fec +_08159754: .4byte 0x02023064 +_08159758: + ldr r2, _08159774 + ldr r1, _08159778 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0815976A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08159774: .4byte 0x02024068 +_08159778: .4byte 0x0832a328 + thumb_func_end dp01_tbl6_exec_completed + + thumb_func_start bx_80364D0 +bx_80364D0: @ 815977C + push {lr} + ldr r0, _081597A4 + ldr r2, [r0] + ldr r0, _081597A8 + 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 _0815979E + bl dp01_tbl6_exec_completed +_0815979E: + pop {r0} + bx r0 + .align 2, 0 +_081597A4: .4byte 0x020244d0 +_081597A8: .4byte 0x02024064 + thumb_func_end bx_80364D0 + + thumb_func_start sub_81597AC +sub_81597AC: @ 81597AC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597AC + + thumb_func_start sub_81597B8 +sub_81597B8: @ 81597B8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597B8 + + thumb_func_start sub_81597C4 +sub_81597C4: @ 81597C4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597C4 + + thumb_func_start sub_81597D0 +sub_81597D0: @ 81597D0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597D0 + + thumb_func_start sub_81597DC +sub_81597DC: @ 81597DC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597DC + + thumb_func_start sub_81597E8 +sub_81597E8: @ 81597E8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597E8 + + thumb_func_start sub_81597F4 +sub_81597F4: @ 81597F4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597F4 + + thumb_func_start sub_8159800 +sub_8159800: @ 8159800 + push {r4-r6,lr} + ldr r4, _081598B8 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + ldr r5, _081598BC + ldrb r1, [r5] + bl sub_805DF84 + ldr r0, [r4] + ldrb r6, [r0, 0x8] + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl template_build_for_pokemon_or_trainer + ldr r0, _081598C0 + ldr r2, _081598C4 + ldr r1, [r4] + ldrb r1, [r1, 0x8] + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1] + 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 obj_add_from_template_forward_search + ldr r6, _081598C8 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _081598CC + 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, _081598D0 + 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, _081598D4 + str r1, [r0] + ldr r1, _081598D8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081598DC + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081598B8: .4byte 0x03005d90 +_081598BC: .4byte 0x02024064 +_081598C0: .4byte 0x0202499c +_081598C4: .4byte 0x08305d2c +_081598C8: .4byte 0x020241e4 +_081598CC: .4byte 0x02020630 +_081598D0: .4byte 0x0000fffe +_081598D4: .4byte sub_805D7AC + 1 +_081598D8: .4byte 0x03005d60 +_081598DC: .4byte sub_815955C + 1 + thumb_func_end sub_8159800 + + thumb_func_start sub_81598E0 +sub_81598E0: @ 81598E0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81598E0 + + thumb_func_start sub_81598EC +sub_81598EC: @ 81598EC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81598EC + + thumb_func_start sub_81598F8 +sub_81598F8: @ 81598F8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81598F8 + + thumb_func_start sub_8159904 +sub_8159904: @ 8159904 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159904 + + thumb_func_start sub_8159910 +sub_8159910: @ 8159910 + push {r4,r5,lr} + ldr r0, _08159950 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, _08159954 + movs r0, 0x1 + strb r0, [r1] + ldr r5, _08159958 + 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, 0x4 + bl move_anim_start_t4 + ldr r1, _0815995C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159960 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159950: .4byte 0x020244d0 +_08159954: .4byte 0x020244b9 +_08159958: .4byte 0x02024064 +_0815995C: .4byte 0x03005d60 +_08159960: .4byte bx_wait_t6 + 1 + thumb_func_end sub_8159910 + + thumb_func_start sub_8159964 +sub_8159964: @ 8159964 + push {r4,r5,lr} + ldr r1, _081599AC + ldr r5, _081599B0 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, _081599B4 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, _081599B8 + 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, 0x4 + bl move_anim_start_t4 + ldr r1, _081599BC + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081599C0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081599AC: .4byte 0x02023064 +_081599B0: .4byte 0x02024064 +_081599B4: .4byte 0x020244d0 +_081599B8: .4byte 0x020244b9 +_081599BC: .4byte 0x03005d60 +_081599C0: .4byte bx_wait_t6 + 1 + thumb_func_end sub_8159964 + + thumb_func_start sub_81599C4 +sub_81599C4: @ 81599C4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81599C4 + + thumb_func_start sub_81599D0 +sub_81599D0: @ 81599D0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81599D0 + + thumb_func_start dp01t_10_6_message +dp01t_10_6_message: @ 81599DC + push {r4,lr} + ldr r0, _08159A14 + movs r1, 0 + strh r1, [r0] + ldr r0, _08159A18 + strh r1, [r0] + ldr r4, _08159A1C + ldrb r0, [r4] + lsls r0, 9 + ldr r1, _08159A20 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, _08159A24 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _08159A28 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159A2C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08159A14: .4byte 0x02022e14 +_08159A18: .4byte 0x02022e16 +_08159A1C: .4byte 0x02024064 +_08159A20: .4byte 0x02023066 +_08159A24: .4byte 0x02022e2c +_08159A28: .4byte 0x03005d60 +_08159A2C: .4byte bx_t6_button_a + 1 + thumb_func_end dp01t_10_6_message + + thumb_func_start dp01t_11_6_message_for_player_only +dp01t_11_6_message_for_player_only: @ 8159A30 + push {lr} + ldr r0, _08159A48 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08159A4C + bl dp01t_10_6_message + b _08159A50 + .align 2, 0 +_08159A48: .4byte 0x02024064 +_08159A4C: + bl dp01_tbl6_exec_completed +_08159A50: + pop {r0} + bx r0 + thumb_func_end dp01t_11_6_message_for_player_only + + thumb_func_start sub_8159A54 +sub_8159A54: @ 8159A54 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08159A7A + ldr r0, _08159A80 + strh r1, [r0] + ldr r1, _08159A84 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _08159A88 + ldr r0, _08159A8C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159A90 + str r1, [r0] +_08159A7A: + pop {r0} + bx r0 + .align 2, 0 +_08159A80: .4byte 0x02022e14 +_08159A84: .4byte 0x02022e16 +_08159A88: .4byte 0x03005d60 +_08159A8C: .4byte 0x02024064 +_08159A90: .4byte bx_battle_menu_t6_2 + 1 + thumb_func_end sub_8159A54 + + thumb_func_start sub_8159A94 +sub_8159A94: @ 8159A94 + push {r4,lr} + ldr r1, _08159AE0 + ldr r0, _08159AE4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159AE8 + str r1, [r0] + ldr r0, _08159AEC + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_08159AAE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _08159AAE + ldr r1, _08159AF0 + ldr r0, _08159AE4 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, _08159AF4 + bl sub_814E6F0 + ldr r0, _08159AF8 + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08159AE0: .4byte 0x03005d60 +_08159AE4: .4byte 0x02024064 +_08159AE8: .4byte sub_8159A54 + 1 +_08159AEC: .4byte 0x085cca54 +_08159AF0: .4byte 0x020244ac +_08159AF4: .4byte 0x085cca04 +_08159AF8: .4byte 0x02022e2c + thumb_func_end sub_8159A94 + + thumb_func_start sub_8159AFC +sub_8159AFC: @ 8159AFC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159AFC + + thumb_func_start sub_8159B08 +sub_8159B08: @ 8159B08 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B08 + + thumb_func_start sub_8159B14 +sub_8159B14: @ 8159B14 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08159B44 + ldr r2, _08159B48 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159B4C + str r1, [r0] + ldr r1, _08159B50 + ldrb r0, [r2] + strb r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08159B44: .4byte 0x03005d60 +_08159B48: .4byte 0x02024064 +_08159B4C: .4byte sub_8159660 + 1 +_08159B50: .4byte 0x020244b8 + thumb_func_end sub_8159B14 + + thumb_func_start sub_8159B54 +sub_8159B54: @ 8159B54 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B54 + + thumb_func_start sub_8159B60 +sub_8159B60: @ 8159B60 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B60 + + thumb_func_start sub_8159B6C +sub_8159B6C: @ 8159B6C + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B6C + + thumb_func_start sub_8159B78 +sub_8159B78: @ 8159B78 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B78 + + thumb_func_start sub_8159B84 +sub_8159B84: @ 8159B84 + push {lr} + ldr r0, _08159BB0 + ldr r1, _08159BB4 + ldrb r1, [r1] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _08159BB8 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08159BBC + adds r1, r2 + movs r2, 0xB + bl healthbar_draw_field_maybe + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_08159BB0: .4byte 0x03005d70 +_08159BB4: .4byte 0x02024064 +_08159BB8: .4byte 0x0202406e +_08159BBC: .4byte 0x020244ec + thumb_func_end sub_8159B84 + + thumb_func_start sub_8159BC0 +sub_8159BC0: @ 8159BC0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BC0 + + thumb_func_start sub_8159BCC +sub_8159BCC: @ 8159BCC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BCC + + thumb_func_start sub_8159BD8 +sub_8159BD8: @ 8159BD8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BD8 + + thumb_func_start sub_8159BE4 +sub_8159BE4: @ 8159BE4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BE4 + + thumb_func_start sub_8159BF0 +sub_8159BF0: @ 8159BF0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BF0 + + thumb_func_start sub_8159BFC +sub_8159BFC: @ 8159BFC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BFC + + thumb_func_start sub_8159C08 +sub_8159C08: @ 8159C08 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C08 + + thumb_func_start sub_8159C14 +sub_8159C14: @ 8159C14 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C14 + + thumb_func_start sub_8159C20 +sub_8159C20: @ 8159C20 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C20 + + thumb_func_start sub_8159C2C +sub_8159C2C: @ 8159C2C + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C2C + + thumb_func_start sub_8159C38 +sub_8159C38: @ 8159C38 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C38 + + thumb_func_start sub_8159C44 +sub_8159C44: @ 8159C44 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C44 + + thumb_func_start sub_8159C50 +sub_8159C50: @ 8159C50 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C50 + + thumb_func_start sub_8159C5C +sub_8159C5C: @ 8159C5C + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C5C + + thumb_func_start sub_8159C68 +sub_8159C68: @ 8159C68 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C68 + + thumb_func_start sub_8159C74 +sub_8159C74: @ 8159C74 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C74 + + thumb_func_start sub_8159C80 +sub_8159C80: @ 8159C80 + push {r4,lr} + ldr r4, _08159CBC + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _08159C94 + movs r3, 0xC0 +_08159C94: + ldr r2, _08159CC0 + 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_tbl6_exec_completed + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08159CBC: .4byte 0x02024064 +_08159CC0: .4byte 0x02023064 + thumb_func_end sub_8159C80 + + thumb_func_start dp01t_34_6_move_anim_start_t3 +dp01t_34_6_move_anim_start_t3: @ 8159CC4 + push {r4,r5,lr} + ldr r4, _08159CF8 + ldr r5, _08159CFC + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08159D00 + 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 _08159D14 + .align 2, 0 +_08159CF8: .4byte 0x02023064 +_08159CFC: .4byte 0x02024064 +_08159D00: + 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 +_08159D14: + bl dp01_tbl6_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_34_6_move_anim_start_t3 + + thumb_func_start sub_8159D20 +sub_8159D20: @ 8159D20 + push {lr} + ldr r1, _08159D50 + ldr r0, _08159D54 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08159D58 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl cry_related + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_08159D50: .4byte 0x0202406e +_08159D54: .4byte 0x02024064 +_08159D58: .4byte 0x020244ec + thumb_func_end sub_8159D20 + + thumb_func_start dp01t_2E_6_battle_intro +dp01t_2E_6_battle_intro: @ 8159D5C + push {lr} + ldr r1, _08159D84 + ldr r0, _08159D88 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _08159D8C + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_08159D84: .4byte 0x02023064 +_08159D88: .4byte 0x02024064 +_08159D8C: .4byte 0x020243fc + thumb_func_end dp01t_2E_6_battle_intro + + thumb_func_start sub_8159D90 +sub_8159D90: @ 8159D90 + push {r4,r5,lr} + ldr r5, _08159DD4 + ldr r4, _08159DD8 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _08159DDC + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08159DE0 + adds r1, r2 + movs r2, 0xA + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + ldr r1, _08159DE4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08159DE8 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159DD4: .4byte 0x03005d70 +_08159DD8: .4byte 0x02024064 +_08159DDC: .4byte 0x0202406e +_08159DE0: .4byte 0x020244ec +_08159DE4: .4byte 0x03005d60 +_08159DE8: .4byte sub_81595AC + 1 + thumb_func_end sub_8159D90 + + thumb_func_start sub_8159DEC +sub_8159DEC: @ 8159DEC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159DEC + + thumb_func_start sub_8159DF8 +sub_8159DF8: @ 8159DF8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159DF8 + + thumb_func_start sub_8159E04 +sub_8159E04: @ 8159E04 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E04 + + thumb_func_start sub_8159E10 +sub_8159E10: @ 8159E10 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E10 + + thumb_func_start sub_8159E1C +sub_8159E1C: @ 8159E1C + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _08159E54 + ldr r6, _08159E58 + 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 _08159E5C + bl dp01_tbl6_exec_completed + b _08159E68 + .align 2, 0 +_08159E54: .4byte 0x02023064 +_08159E58: .4byte 0x02024064 +_08159E5C: + ldr r0, _08159E70 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _08159E74 + str r0, [r1] +_08159E68: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08159E70: .4byte 0x03005d60 +_08159E74: .4byte sub_81596D4 + 1 + thumb_func_end sub_8159E1C + + thumb_func_start sub_8159E78 +sub_8159E78: @ 8159E78 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E78 + + thumb_func_start sub_8159E84 +sub_8159E84: @ 8159E84 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E84 + + thumb_func_start sub_8159E90 +sub_8159E90: @ 8159E90 + push {r4,lr} + ldr r2, _08159ED4 + ldr r1, _08159ED8 + ldr r4, _08159EDC + 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_tbl6_exec_completed + ldr r0, _08159EE0 + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _08159ECC + ldr r0, _08159EE4 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _08159EE8 + str r0, [r1] +_08159ECC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08159ED4: .4byte 0x0202433a +_08159ED8: .4byte 0x02023064 +_08159EDC: .4byte 0x02024064 +_08159EE0: .4byte 0x02022fec +_08159EE4: .4byte 0x03005d60 +_08159EE8: .4byte sub_81595E4 + 1 + thumb_func_end sub_8159E90 + + thumb_func_start nullsub_115 +nullsub_115: @ 8159EEC + bx lr + thumb_func_end nullsub_115 + + thumb_func_start sub_8159EF0 +sub_8159EF0: @ 8159EF0 + ldr r1, _08159F00 + ldr r0, _08159F04 + str r0, [r1] + ldr r1, _08159F08 + ldr r0, _08159F0C + str r0, [r1] + movs r0, 0x1 + bx lr + .align 2, 0 +_08159F00: .4byte 0x03005db0 +_08159F04: .4byte hm_add_c3_launch_phase_2 + 1 +_08159F08: .4byte 0x0203ceec +_08159F0C: .4byte hm2_sweet_scent + 1 + thumb_func_end sub_8159EF0 + + thumb_func_start hm2_sweet_scent +hm2_sweet_scent: @ 8159F10 + push {lr} + movs r0, 0x33 + bl oe_exec + bl brm_get_pokemon_selection + ldr r1, _08159F28 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08159F28: .4byte 0x02038c08 + thumb_func_end hm2_sweet_scent + + thumb_func_start sub_8159F2C +sub_8159F2C: @ 8159F2C + push {lr} + bl sub_80AC3D0 + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08159F54 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _08159F58 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08159F54: .4byte 0x03005e00 +_08159F58: .4byte sub_8159F5C + 1 + thumb_func_end sub_8159F2C + + thumb_func_start sub_8159F5C +sub_8159F5C: @ 8159F5C + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xEC + bl audio_play + ldr r5, _08159FD4 + ldr r1, _08159FD8 + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + adds r2, r4, 0 + bl CpuFastSet + ldr r0, _08159FDC + adds r1, r5, 0 + adds r2, r4, 0 + bl CpuFastSet + bl sub_808BCDC + ldr r2, _08159FE0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + mvns r0, r0 + movs r1, 0x1F + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl sub_80A1AD4 + ldr r0, _08159FE4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08159FE8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x33 + bl oe_active_list_remove + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08159FD4: .4byte 0x02037714 +_08159FD8: .4byte 0x02037fe8 +_08159FDC: .4byte 0x02037b14 +_08159FE0: .4byte 0x02020630 +_08159FE4: .4byte sub_8159FEC + 1 +_08159FE8: .4byte 0x03005e00 + thumb_func_end sub_8159F5C + + thumb_func_start sub_8159FEC +sub_8159FEC: @ 8159FEC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0815A03C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _0815A088 + bl sub_81BE72C + movs r0, 0x40 + movs r1, 0x8 + movs r2, 0x1F + bl sub_80A2A20 + ldr r0, _0815A040 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + bne _0815A084 + strh r6, [r4, 0x8] + bl sub_80B5578 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815A044 + adds r0, r5, 0 + bl remove_task + b _0815A088 + .align 2, 0 +_0815A03C: .4byte 0x02037fd4 +_0815A040: .4byte 0x03005e00 +_0815A044: + ldr r0, _0815A07C + str r0, [r4] + bl sub_808BCDC + ldr r2, _0815A080 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + mvns r0, r0 + movs r1, 0x1F + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl sub_80A1AD4 + bl sub_81BE6B8 + b _0815A088 + .align 2, 0 +_0815A07C: .4byte sub_815A090 + 1 +_0815A080: .4byte 0x02020630 +_0815A084: + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_0815A088: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8159FEC + + thumb_func_start sub_815A090 +sub_815A090: @ 815A090 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0815A0C4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0815A0BE + ldr r0, _0815A0C8 + ldr r1, _0815A0CC + movs r2, 0x80 + lsls r2, 1 + bl CpuFastSet + bl sub_80AC3E4 + ldr r0, _0815A0D0 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl remove_task +_0815A0BE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A0C4: .4byte 0x02037fd4 +_0815A0C8: .4byte 0x02037fe8 +_0815A0CC: .4byte 0x02037714 +_0815A0D0: .4byte 0x08290cae + thumb_func_end sub_815A090 + + thumb_func_start sub_815A0D4 +sub_815A0D4: @ 815A0D4 + push {lr} + adds r2, r0, 0 + ldr r1, _0815A0F8 + ldrh r0, [r1] + ldrh r3, [r2, 0x20] + adds r0, r3 + strh r0, [r2, 0x20] + ldrh r0, [r1, 0x2] + ldrh r3, [r2, 0x22] + adds r0, r3 + strh r0, [r2, 0x22] + movs r3, 0x6 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0815A0FC + ldrh r0, [r1, 0x4] + b _0815A100 + .align 2, 0 +_0815A0F8: .4byte 0x0203841e +_0815A0FC: + ldrh r0, [r1, 0x4] + negs r0, r0 +_0815A100: + strh r0, [r2, 0x2E] + ldrh r0, [r1, 0x8] + strh r0, [r2, 0x30] + ldr r0, _0815A110 + str r0, [r2, 0x1C] + pop {r0} + bx r0 + .align 2, 0 +_0815A110: .4byte sub_815A114 + 1 + thumb_func_end sub_815A0D4 + + thumb_func_start sub_815A114 +sub_815A114: @ 815A114 + push {lr} + adds r3, r0, 0 + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + ble _0815A154 + ldrh r1, [r3, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r3, 0x24] + ldrh r0, [r3, 0x2E] + adds r1, r0 + strh r1, [r3, 0x32] + 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] + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + b _0815A15A +_0815A154: + adds r0, r3, 0 + bl move_anim_8072740 +_0815A15A: + pop {r0} + bx r0 + thumb_func_end sub_815A114 + + thumb_func_start sub_815A160 +sub_815A160: @ 815A160 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _0815A1AC + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 8 + movs r0, 0x80 + lsls r0, 12 + adds r4, r0 + asrs r4, 16 + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 8 + movs r0, 0x80 + lsls r0, 12 + adds r1, r0 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_807521C + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815A1AC: .4byte 0x02038437 + thumb_func_end sub_815A160 + + thumb_func_start sub_815A1B0 +sub_815A1B0: @ 815A1B0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5A + strh r0, [r4, 0x2E] + ldr r0, _0815A1EC + str r0, [r4, 0x1C] + movs r0, 0x7 + strh r0, [r4, 0x30] + ldr r1, _0815A1F0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r0, [r4, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A1EC: .4byte sub_80A64B0 + 1 +_0815A1F0: .4byte sub_815A1F4 + 1 + thumb_func_end sub_815A1B0 + + thumb_func_start sub_815A1F4 +sub_815A1F4: @ 815A1F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0815A228 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815A230 + str r0, [r4, 0x1C] +_0815A228: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A230: .4byte sub_815A234 + 1 + thumb_func_end sub_815A1F4 + + thumb_func_start sub_815A234 +sub_815A234: @ 815A234 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815A234 + + thumb_func_start sub_815A254 +sub_815A254: @ 815A254 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, _0815A2E0 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 + ldrh r0, [r5, 0x20] + subs r0, r7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r5, 0x22] + subs r1, r6 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 23 + adds r0, r1 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815A2B2 + movs r1, 0x80 + lsls r1, 7 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0815A2B2: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, _0815A2E4 + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + strh r7, [r5, 0x32] + strh r6, [r5, 0x36] + ldr r0, _0815A2E8 + str r0, [r5, 0x1C] + ldr r1, _0815A2EC + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815A2E0: .4byte 0x02038437 +_0815A2E4: .4byte 0x0203841e +_0815A2E8: .4byte sub_80A6EEC + 1 +_0815A2EC: .4byte move_anim_8072740 + 1 + thumb_func_end sub_815A254 + + thumb_func_start sub_815A2F0 +sub_815A2F0: @ 815A2F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x4 + strh r0, [r4, 0x2E] + ldr r0, _0815A318 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A318: .4byte sub_815A31C + 1 + thumb_func_end sub_815A2F0 + + thumb_func_start sub_815A31C +sub_815A31C: @ 815A31C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815A342 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + b _0815A346 +_0815A342: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 +_0815A346: + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + beq _0815A354 + cmp r0, 0x4 + bne _0815A35C +_0815A354: + ldrh r0, [r4, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x30] +_0815A35C: + ldrh r0, [r4, 0x32] + adds r1, r0, 0x1 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x46 + ble _0815A3A0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + movs r0, 0 + strh r0, [r4, 0x32] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815A3A8 + str r0, [r4, 0x1C] +_0815A3A0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A3A8: .4byte sub_815A3AC + 1 + thumb_func_end sub_815A31C + + thumb_func_start sub_815A3AC +sub_815A3AC: @ 815A3AC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _0815A3E8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815A3E8 + ldr r0, _0815A3EC + str r0, [r3, 0x1C] +_0815A3E8: + pop {r0} + bx r0 + .align 2, 0 +_0815A3EC: .4byte sub_815A3F0 + 1 + thumb_func_end sub_815A3AC + + thumb_func_start sub_815A3F0 +sub_815A3F0: @ 815A3F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bhi _0815A448 + lsls r0, 2 + ldr r1, _0815A408 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815A408: .4byte _0815A40C + .align 2, 0 +_0815A40C: + .4byte _0815A428 + .4byte _0815A428 + .4byte _0815A432 + .4byte _0815A432 + .4byte _0815A440 + .4byte _0815A440 + .4byte _0815A448 +_0815A428: + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x24] + strh r1, [r4, 0x26] + b _0815A450 +_0815A432: + ldr r0, _0815A43C + strh r0, [r4, 0x24] + movs r0, 0 + b _0815A44E + .align 2, 0 +_0815A43C: .4byte 0x0000ffff +_0815A440: + movs r0, 0 + strh r0, [r4, 0x24] + movs r0, 0x1 + b _0815A44E +_0815A448: + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, _0815A494 +_0815A44E: + strh r0, [r4, 0x26] +_0815A450: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0815A462 + strh r2, [r4, 0x34] +_0815A462: + ldrh r0, [r4, 0x36] + adds r1, r0, 0x1 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0815A48C + movs r0, 0x10 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldrh r1, [r4, 0x2E] + movs r0, 0x52 + bl lcd_io_set + ldr r0, _0815A498 + str r0, [r4, 0x1C] +_0815A48C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A494: .4byte 0x0000ffff +_0815A498: .4byte sub_815A49C + 1 + thumb_func_end sub_815A3F0 + + thumb_func_start sub_815A49C +sub_815A49C: @ 815A49C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815A4CC + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] +_0815A4CC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815A4E0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815A4E0: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0815A4FE + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 +_0815A4FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815A49C + + thumb_func_start sub_815A504 +sub_815A504: @ 815A504 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0815A520 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _0815A524 + str r0, [r1] + ldr r1, _0815A528 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_0815A520: .4byte 0x03005e00 +_0815A524: .4byte sub_815A52C + 1 +_0815A528: .4byte 0x020383fe + thumb_func_end sub_815A504 + + thumb_func_start sub_815A52C +sub_815A52C: @ 815A52C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A6D94 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _0815A5B8 + lsls r5, r4, 2 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815A59C + ldr r0, _0815A5BC + lsls r2, r6, 4 + adds r1, r2, 0 + adds r1, 0xB + lsls r1, 1 + adds r1, r0 + ldrh r3, [r1] + mov r8, r3 + movs r3, 0xA + mov r9, r7 + adds r7, r5, 0 + mov r12, r0 + adds r5, r2, 0 + lsls r0, r6, 5 + add r0, r12 + adds r2, r0, 0 + adds r2, 0x14 +_0815A57A: + ldrh r0, [r2] + strh r0, [r1] + subs r2, 0x2 + subs r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bgt _0815A57A + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r12 + movs r1, 0 + mov r2, r8 + strh r2, [r0] + adds r0, r7, r4 + lsls r0, 3 + add r0, r9 + strh r1, [r0, 0x12] +_0815A59C: + ldr r0, _0815A5C0 + ldrh r1, [r0, 0xE] + ldr r0, _0815A5C4 + cmp r1, r0 + bne _0815A5AC + adds r0, r4, 0 + bl remove_task +_0815A5AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815A5B8: .4byte 0x03005e00 +_0815A5BC: .4byte 0x02037b14 +_0815A5C0: .4byte 0x0203841e +_0815A5C4: .4byte 0x0000ffff + thumb_func_end sub_815A52C + + thumb_func_start c3_80DE6F0 +c3_80DE6F0: @ 815A5C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0815A5E4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _0815A5E8 + str r0, [r1] + ldr r1, _0815A5EC + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_0815A5E4: .4byte 0x03005e00 +_0815A5E8: .4byte sub_815A5F0 + 1 +_0815A5EC: .4byte 0x020383fe + thumb_func_end c3_80DE6F0 + + thumb_func_start sub_815A5F0 +sub_815A5F0: @ 815A5F0 + 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 + bl sub_80A6D94 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, _0815A6B0 + mov r0, r8 + lsls r3, r0, 2 + adds r1, r3, r0 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815A692 + ldr r0, _0815A6B4 + lsls r2, r7, 4 + adds r1, r2, 0 + adds r1, 0xB + lsls r1, 1 + adds r1, r0 + ldrh r6, [r1] + movs r4, 0xA + mov r10, r3 + mov r9, r0 + adds r5, r2, 0 + ldr r2, _0815A6B8 + mov r12, r2 + lsls r0, r7, 5 + add r0, r9 + adds r3, r0, 0 + adds r3, 0x14 +_0815A644: + ldrh r0, [r3] + strh r0, [r1] + subs r3, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0815A644 + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r9 + strh r6, [r0] + adds r1, r5, 0 + adds r1, 0xB + lsls r1, 1 + add r1, r12 + ldrh r6, [r1] + movs r4, 0xA + lsls r0, r7, 5 + add r0, r12 + adds r2, r0, 0 + adds r2, 0x14 +_0815A66E: + ldrh r0, [r2] + strh r0, [r1] + subs r2, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0815A66E + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r12 + movs r1, 0 + strh r6, [r0] + mov r0, r10 + add r0, r8 + lsls r0, 3 + ldr r2, _0815A6B0 + adds r0, r2 + strh r1, [r0, 0x12] +_0815A692: + ldr r0, _0815A6BC + ldrh r1, [r0, 0xE] + ldr r0, _0815A6C0 + cmp r1, r0 + bne _0815A6A2 + mov r0, r8 + bl remove_task +_0815A6A2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815A6B0: .4byte 0x03005e00 +_0815A6B4: .4byte 0x02037b14 +_0815A6B8: .4byte 0x02037714 +_0815A6BC: .4byte 0x0203841e +_0815A6C0: .4byte 0x0000ffff + thumb_func_end sub_815A5F0 + + thumb_func_start sub_815A6C4 +sub_815A6C4: @ 815A6C4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _0815A728 + ldrb r0, [r0] + mov r5, sp + adds r5, 0x2 + movs r1, 0 + mov r2, sp + adds r3, r5, 0 + bl sub_80A8924 + ldr r0, _0815A72C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815A6F8 + ldr r1, _0815A730 + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0815A6F8: + ldr r1, _0815A730 + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + mov r2, sp + ldrh r0, [r1, 0x4] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + ldrh r5, [r5] + adds r0, r5 + strh r0, [r4, 0x36] + ldr r0, _0815A734 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _0815A738 + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815A728: .4byte 0x02038437 +_0815A72C: .4byte 0x02038436 +_0815A730: .4byte 0x0203841e +_0815A734: .4byte 0x0000ffce +_0815A738: .4byte sub_815A73C + 1 + thumb_func_end sub_815A6C4 + + thumb_func_start sub_815A73C +sub_815A73C: @ 815A73C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0815A75E + movs r1, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + ldr r0, _0815A764 + str r0, [r4, 0x1C] + ldr r1, _0815A768 + adds r0, r4, 0 + bl oamt_set_x3A_32 +_0815A75E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A764: .4byte sub_80A64B0 + 1 +_0815A768: .4byte sub_815A76C + 1 + thumb_func_end sub_815A73C + + thumb_func_start sub_815A76C +sub_815A76C: @ 815A76C + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815A798 + 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] +_0815A798: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0815A7AC + adds r0, r3, 0 + bl move_anim_8072740 +_0815A7AC: + pop {r0} + bx r0 + thumb_func_end sub_815A76C + + thumb_func_start sub_815A7B0 +sub_815A7B0: @ 815A7B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r5, _0815A7E0 + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, _0815A7E4 + str r0, [r4, 0x1C] + ldr r1, _0815A7E8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815A7E0: .4byte 0x0203841e +_0815A7E4: .4byte sub_80A67D8 + 1 +_0815A7E8: .4byte move_anim_8072740 + 1 + thumb_func_end sub_815A7B0 + + thumb_func_start sub_815A7EC +sub_815A7EC: @ 815A7EC + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815A84C + adds r0, r4, 0 + bl sub_80A6838 + ldr r5, _0815A828 + movs r2, 0 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sub_80A6864 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815A840 + ldr r0, _0815A82C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815A830 + ldrh r0, [r5, 0x4] + b _0815A846 + .align 2, 0 +_0815A828: .4byte 0x0203841e +_0815A82C: .4byte 0x02038436 +_0815A830: + movs r1, 0x4 + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r4, 0x30] + movs r2, 0x6 + ldrsh r0, [r5, r2] + negs r0, r0 + b _0815A84A +_0815A840: + movs r1, 0x4 + ldrsh r0, [r5, r1] + negs r0, r0 +_0815A846: + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x6] +_0815A84A: + strh r0, [r4, 0x32] +_0815A84C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r3, 0xFF + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + movs r2, 0x34 + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + strh r1, [r4, 0x24] + ands r0, r3 + movs r1, 0x5 + bl sine + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF0 + bls _0815A8A4 + adds r0, r4, 0 + bl move_anim_8072740 +_0815A8A4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815A7EC + + thumb_func_start sub_815A8AC +sub_815A8AC: @ 815A8AC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815A8C2 + adds r0, r2, 0 + bl move_anim_8072740 +_0815A8C2: + pop {r0} + bx r0 + thumb_func_end sub_815A8AC + + thumb_func_start sub_815A8C8 +sub_815A8C8: @ 815A8C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0815A8E4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815A8EC + ldr r1, _0815A8E8 + movs r0, 0 + b _0815A8F0 + .align 2, 0 +_0815A8E4: .4byte 0x02038437 +_0815A8E8: .4byte 0x0203841e +_0815A8EC: + ldr r1, _0815A900 + movs r0, 0x1 +_0815A8F0: + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815A900: .4byte 0x0203841e + thumb_func_end sub_815A8C8 + + thumb_func_start sub_815A904 +sub_815A904: @ 815A904 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0815A918 + ldr r0, [r0] + cmp r0, 0 + ble _0815A920 + ldr r1, _0815A91C + movs r0, 0 + b _0815A924 + .align 2, 0 +_0815A918: .4byte 0x02038404 +_0815A91C: .4byte 0x0203841e +_0815A920: + ldr r1, _0815A930 + movs r0, 0x1 +_0815A924: + strh r0, [r1, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_0815A930: .4byte 0x0203841e + thumb_func_end sub_815A904 + + thumb_func_start sub_815A934 +sub_815A934: @ 815A934 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _0815A990 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r0, _0815A994 + movs r1, 0 + strh r1, [r0] + ldr r4, _0815A998 + strh r1, [r4] + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x44 + bl lcd_io_set + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815A99C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815A990: .4byte 0x00001f3f +_0815A994: .4byte 0x02022e24 +_0815A998: .4byte 0x02022e26 +_0815A99C: .4byte sub_815A9A0 + 1 + thumb_func_end sub_815A934 + + thumb_func_start sub_815A9A0 +sub_815A9A0: @ 815A9A0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _0815AA60 + lsls r0, 2 + ldr r1, _0815A9B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815A9B8: .4byte _0815A9BC + .align 2, 0 +_0815A9BC: + .4byte _0815A9D4 + .4byte _0815A9F2 + .4byte _0815AA12 + .4byte _0815A9F2 + .4byte _0815AA32 + .4byte _0815AA42 +_0815A9D4: + 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 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815AA60 + b _0815AA3A +_0815A9F2: + ldrh r0, [r4, 0x30] + adds r0, 0x75 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _0815AA60 + movs r0, 0 + strh r0, [r4, 0x32] + b _0815AA3A +_0815AA12: + ldrh r0, [r4, 0x30] + subs r0, 0x75 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + bne _0815AA60 + movs r0, 0 + strh r0, [r4, 0x32] + b _0815AA3A +_0815AA32: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 +_0815AA3A: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815AA60 +_0815AA42: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815AA60 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815AA68 + str r0, [r4, 0x1C] +_0815AA60: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815AA68: .4byte sub_815AA6C + 1 + thumb_func_end sub_815A9A0 + + thumb_func_start sub_815AA6C +sub_815AA6C: @ 815AA6C + push {r4,lr} + adds r4, r0, 0 + ldr r1, _0815AAA0 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815AAA0: .4byte 0x00003f3f + thumb_func_end sub_815AA6C + + thumb_func_start sub_815AAA4 +sub_815AAA4: @ 815AAA4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0815AB18 + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815AAD0 + ldr r4, _0815AB1C + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_0815AAD0: + ldrh r0, [r6] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r3, 0 + strh r0, [r5, 0x20] + ldrh r0, [r6, 0x2] + ldrh r4, [r5, 0x22] + adds r0, r4 + strh r0, [r5, 0x22] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r4, _0815AB20 + adds r0, r4, 0 + ands r1, r0 + ldr r0, _0815AB24 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815AB2C + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r0, _0815AB28 + strh r0, [r5, 0x24] + movs r0, 0x2 + b _0815AB32 + .align 2, 0 +_0815AB18: .4byte 0x0203841e +_0815AB1C: .4byte 0x02038436 +_0815AB20: .4byte 0x000003ff +_0815AB24: .4byte 0xfffffc00 +_0815AB28: .4byte 0x0000fff4 +_0815AB2C: + movs r0, 0xC + strh r0, [r5, 0x24] + ldr r0, _0815AB50 +_0815AB32: + strh r0, [r5, 0x30] + ldr r1, _0815AB54 + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0xFF + beq _0815AB46 + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x34] +_0815AB46: + ldr r0, _0815AB58 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815AB50: .4byte 0x0000fffe +_0815AB54: .4byte 0x0203841e +_0815AB58: .4byte sub_815AB5C + 1 + thumb_func_end sub_815AAA4 + + thumb_func_start sub_815AB5C +sub_815AB5C: @ 815AB5C + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815AB9A + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0815ABBA + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815ABBA + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xDE + bl sub_80A3808 + b _0815ABBA +_0815AB9A: + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0815ABAC + negs r0, r0 +_0815ABAC: + cmp r0, 0xC + bne _0815ABBA + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + subs r0, r2, 0x1 + strh r0, [r4, 0x32] +_0815ABBA: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815ABC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0815ABC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815AB5C + + thumb_func_start sub_815ABD0 +sub_815ABD0: @ 815ABD0 + push {lr} + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r1, 0xFF + strh r1, [r0, 0x34] + bl sub_815AAA4 + pop {r0} + bx r0 + thumb_func_end sub_815ABD0 + + thumb_func_start sub_815ABEC +sub_815ABEC: @ 815ABEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815AC40 + ldr r1, _0815AC28 + movs r0, 0x48 + bl lcd_io_set + ldr r1, _0815AC2C + ldr r2, _0815AC30 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _0815AC34 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, _0815AC38 + ldrh r1, [r0] + movs r0, 0x42 + bl lcd_io_set + ldr r0, _0815AC3C + ldrh r1, [r0] + movs r0, 0x46 + bl lcd_io_set + b _0815AC70 + .align 2, 0 +_0815AC28: .4byte 0x00001f3f +_0815AC2C: .4byte 0x02022e28 +_0815AC30: .4byte 0x000098f0 +_0815AC34: .4byte 0x02022e2a +_0815AC38: .4byte 0x02022e24 +_0815AC3C: .4byte 0x02022e26 +_0815AC40: + ldr r1, _0815AC7C + movs r0, 0x48 + bl lcd_io_set + ldr r1, _0815AC80 + movs r0, 0xF0 + strh r0, [r1] + ldr r4, _0815AC84 + ldr r1, _0815AC88 + adds r0, r1, 0 + strh r0, [r4] + movs r0, 0x42 + movs r1, 0xF0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x46 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl lcd_io_set_bits +_0815AC70: + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815AC7C: .4byte 0x00001f3f +_0815AC80: .4byte 0x02022e28 +_0815AC84: .4byte 0x02022e2a +_0815AC88: .4byte 0x000078a0 + thumb_func_end sub_815ABEC + + thumb_func_start sub_815AC8C +sub_815AC8C: @ 815AC8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0815ACC4 + movs r0, 0x48 + bl lcd_io_set + ldr r0, _0815ACC8 + movs r1, 0 + strh r1, [r0] + ldr r0, _0815ACCC + strh r1, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815ACB8 + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl lcd_io_clear_bits +_0815ACB8: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815ACC4: .4byte 0x00003f3f +_0815ACC8: .4byte 0x02022e28 +_0815ACCC: .4byte 0x02022e2a + thumb_func_end sub_815AC8C + + thumb_func_start sub_815ACD0 +sub_815ACD0: @ 815ACD0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0815ACE4 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815ACEC + ldr r4, _0815ACE8 + b _0815ACEE + .align 2, 0 +_0815ACE4: .4byte 0x0203841e +_0815ACE8: .4byte 0x02038436 +_0815ACEC: + ldr r4, _0815AD40 +_0815ACEE: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x2] + adds r0, r6 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r2, _0815AD44 + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x26] + movs r3, 0 + lsls r0, 16 + asrs r0, 16 + ldrh r4, [r2, 0x6] + movs r6, 0x6 + ldrsh r1, [r2, r6] + cmp r0, r1 + ble _0815AD26 + movs r3, 0x1 +_0815AD26: + strh r3, [r5, 0x2E] + movs r0, 0 + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x32] + ldrh r0, [r2, 0xA] + strh r0, [r5, 0x34] + strh r4, [r5, 0x36] + ldr r0, _0815AD48 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815AD40: .4byte 0x02038437 +_0815AD44: .4byte 0x0203841e +_0815AD48: .4byte sub_815AD4C + 1 + thumb_func_end sub_815ACD0 + + thumb_func_start sub_815AD4C +sub_815AD4C: @ 815AD4C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r2, 0x30] + ldr r1, _0815AD94 + movs r3, 0x30 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x26] + adds r1, r0, r3 + strh r1, [r2, 0x26] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _0815AD98 + lsls r0, r1, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + bge _0815ADAA + adds r0, r2, 0 + bl move_anim_8072740 + b _0815ADAA + .align 2, 0 +_0815AD94: .4byte 0x08329f40 +_0815AD98: + lsls r0, r1, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + ble _0815ADAA + adds r0, r2, 0 + bl move_anim_8072740 +_0815ADAA: + pop {r0} + bx r0 + thumb_func_end sub_815AD4C + + thumb_func_start sub_815ADB0 +sub_815ADB0: @ 815ADB0 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0815ADD0 + adds r5, r1, r0 + ldr r0, _0815ADD4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815ADDC + ldr r4, _0815ADD8 + b _0815ADDE + .align 2, 0 +_0815ADD0: .4byte 0x03005e00 +_0815ADD4: .4byte 0x0203841e +_0815ADD8: .4byte 0x02038436 +_0815ADDC: + ldr r4, _0815AE24 +_0815ADDE: + ldrb r0, [r4] + bl sub_80A6190 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + adds r1, r0, 0 + adds r1, 0x24 + movs r2, 0 + strh r1, [r5, 0x8] + strh r1, [r5, 0xA] + subs r0, 0x21 + strh r0, [r5, 0xC] + cmp r0, 0 + bge _0815AE08 + strh r2, [r5, 0xC] +_0815AE08: + ldrh r0, [r5, 0x8] + strh r0, [r5, 0xE] + movs r0, 0x8 + strh r0, [r5, 0x10] + ldr r1, _0815AE28 + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x12] + strh r2, [r5, 0x14] + strh r2, [r5, 0x16] + cmp r7, 0x1 + bne _0815AE30 + ldr r0, _0815AE2C + b _0815AE32 + .align 2, 0 +_0815AE24: .4byte 0x02038437 +_0815AE28: .4byte 0x0203841e +_0815AE2C: .4byte 0x02022e18 +_0815AE30: + ldr r0, _0815AE50 +_0815AE32: + ldrh r2, [r0] + strh r2, [r5, 0x18] + adds r3, r2, 0 + adds r3, 0xF0 + strh r3, [r5, 0x1A] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x1C] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _0815AE54 + strh r3, [r5, 0x1E] + ldrh r3, [r5, 0x18] + b _0815AE58 + .align 2, 0 +_0815AE50: .4byte 0x02022e1c +_0815AE54: + strh r2, [r5, 0x1E] + ldrh r3, [r5, 0x1A] +_0815AE58: + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r1, [r5, 0xC] + lsls r2, r1, 16 + asrs r1, r2, 16 + movs r6, 0xE + ldrsh r0, [r5, r6] + cmp r1, r0 + bgt _0815AE8E + ldr r4, _0815AE98 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r4 + mov r12, r0 +_0815AE74: + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + add r1, r12 + strh r3, [r1] + adds r2, 0x1 + lsls r2, 16 + asrs r1, r2, 16 + movs r6, 0xE + ldrsh r0, [r5, r6] + cmp r1, r0 + ble _0815AE74 +_0815AE8E: + cmp r7, 0x1 + bne _0815AEA0 + ldr r0, _0815AE9C + b _0815AEA2 + .align 2, 0 +_0815AE98: .4byte 0x02038c28 +_0815AE9C: .4byte 0x04000014 +_0815AEA0: + ldr r0, _0815AECC +_0815AEA2: + str r0, [sp] + ldr r0, _0815AED0 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, _0815AED4 + str r0, [r5] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815AECC: .4byte 0x04000018 +_0815AED0: .4byte 0xa2600001 +_0815AED4: .4byte sub_815AED8 + 1 + thumb_func_end sub_815ADB0 + + thumb_func_start sub_815AED8 +sub_815AED8: @ 815AED8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0815AF28 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0xC] + movs r3, 0xC + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0815AF00 + strh r2, [r4, 0x8] +_0815AF00: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815AF2C + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0xC] + movs r3, 0xC + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0815AF30 + strh r2, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0x26] + b _0815AF30 + .align 2, 0 +_0815AF28: .4byte 0x03005e00 +_0815AF2C: + subs r0, r1, 0x1 + strh r0, [r4, 0x10] +_0815AF30: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815AF5C + movs r0, 0 + strh r0, [r4, 0x14] + movs r1, 0 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815AF4E + movs r1, 0x1 +_0815AF4E: + strh r1, [r4, 0x16] + cmp r1, 0 + beq _0815AF58 + ldrh r0, [r4, 0x18] + b _0815AF5A +_0815AF58: + ldrh r0, [r4, 0x1A] +_0815AF5A: + strh r0, [r4, 0x20] +_0815AF5C: + ldrh r1, [r4, 0x8] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _0815AF90 + ldr r5, _0815AFE8 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0815AF72: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x20] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x20] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _0815AF72 +_0815AF90: + ldrh r1, [r4, 0xA] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bgt _0815AFC4 + ldr r5, _0815AFE8 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0815AFA6: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x1E] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x1E] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0815AFA6 +_0815AFC4: + movs r3, 0x26 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0815AFE0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815AFDA + ldr r1, _0815AFEC + movs r0, 0x3 + strb r0, [r1, 0x15] +_0815AFDA: + adds r0, r7, 0 + bl move_anim_task_del +_0815AFE0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815AFE8: .4byte 0x02038c28 +_0815AFEC: .4byte 0x02039b28 + thumb_func_end sub_815AED8 + + thumb_func_start sub_815AFF0 +sub_815AFF0: @ 815AFF0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0815B044 + adds r4, r0 + movs r5, 0 + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + ldr r6, _0815B048 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xE] + movs r0, 0x20 + strh r0, [r4, 0x10] + ldr r0, _0815B04C + strh r0, [r4, 0x12] + strh r5, [r4, 0x14] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, _0815B050 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815B044: .4byte 0x03005e00 +_0815B048: .4byte 0x02038436 +_0815B04C: .4byte 0x0000ffec +_0815B050: .4byte sub_815B054 + 1 + thumb_func_end sub_815AFF0 + + thumb_func_start sub_815B054 +sub_815B054: @ 815B054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0815B080 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bls _0815B074 + b _0815B22E +_0815B074: + lsls r0, 2 + ldr r1, _0815B084 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815B080: .4byte 0x03005e00 +_0815B084: .4byte _0815B088 + .align 2, 0 +_0815B088: + .4byte _0815B0A0 + .4byte _0815B160 + .4byte _0815B18E + .4byte _0815B1A2 + .4byte _0815B1B8 + .4byte _0815B220 +_0815B0A0: + movs r0, 0xC + ldrsh r2, [r6, r0] + ldrh r1, [r6, 0xA] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815B0B6 + movs r1, 0x10 + ldrsh r0, [r6, r1] + subs r0, r2, r0 + b _0815B0BC +_0815B0B6: + movs r1, 0x10 + ldrsh r0, [r6, r1] + adds r0, r2, r0 +_0815B0BC: + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r2, [r6, 0x12] + ldrh r0, [r6, 0xE] + adds r2, r0 + ldr r0, _0815B150 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + ldrb r4, [r6, 0xA] + movs r3, 0x6 + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xBA + bl audio_play_and_stuff + cmp r4, 0x40 + beq _0815B120 + ldr r5, _0815B154 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r3, r1, r5 + ldrh r0, [r6, 0xA] + movs r2, 0x1 + ands r2, r0 + adds r3, 0x3F + ldrb r4, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r4 + orrs r0, r2 + strb r0, [r3] + adds r5, 0x1C + adds r1, r5 + ldr r0, _0815B158 + str r0, [r1] +_0815B120: + ldrh r1, [r6, 0xA] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0815B138 + ldrh r0, [r6, 0x10] + subs r0, 0x6 + strh r0, [r6, 0x10] + ldrh r0, [r6, 0x12] + subs r0, 0x6 + strh r0, [r6, 0x12] +_0815B138: + ldrh r1, [r6, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815B15C + adds r0, r6, 0 + bl sub_80A7CFC + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + strh r4, [r6, 0x8] + b _0815B22E + .align 2, 0 +_0815B150: .4byte 0x08593114 +_0815B154: .4byte 0x02020630 +_0815B158: .4byte nullsub_12 + 1 +_0815B15C: .4byte 0x085ce2a0 +_0815B160: + adds r0, r6, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0815B22E + movs r2, 0xA + ldrsh r1, [r6, r2] + cmp r1, 0x6 + bne _0815B180 + movs r0, 0x8 + strh r0, [r6, 0x14] + movs r0, 0x3 + strh r0, [r6, 0x8] + b _0815B22E +_0815B180: + cmp r1, 0x2 + bgt _0815B186 + movs r0, 0xA +_0815B186: + strh r0, [r6, 0x14] + movs r0, 0x2 + strh r0, [r6, 0x8] + b _0815B22E +_0815B18E: + ldrh r0, [r6, 0x14] + movs r2, 0x14 + ldrsh r1, [r6, r2] + cmp r1, 0 + beq _0815B19E + subs r0, 0x1 + strh r0, [r6, 0x14] + b _0815B22E +_0815B19E: + strh r1, [r6, 0x8] + b _0815B22E +_0815B1A2: + ldrh r1, [r6, 0x14] + movs r2, 0x14 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0815B1B2 + subs r0, r1, 0x1 + strh r0, [r6, 0x14] + b _0815B22E +_0815B1B2: + movs r0, 0x4 + strh r0, [r6, 0x8] + b _0815B22E +_0815B1B8: + movs r5, 0 + movs r7, 0 + ldr r3, _0815B214 + movs r0, 0x1C + adds r0, r3 + mov r8, r0 +_0815B1C4: + lsls r0, r5, 4 + adds r0, r5 + lsls r4, r0, 2 + adds r0, r3, 0 + adds r0, 0x14 + adds r0, r4, r0 + ldr r1, [r0] + ldr r0, _0815B218 + cmp r1, r0 + bne _0815B200 + adds r0, r4, r3 + strh r2, [r0, 0x2E] + movs r1, 0x6 + strh r1, [r0, 0x30] + movs r1, 0x2 + str r2, [sp] + str r3, [sp, 0x4] + bl obj_anim_image_start + mov r0, r8 + adds r1, r4, r0 + ldr r0, _0815B21C + str r0, [r1] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r2, [sp] + ldr r3, [sp, 0x4] + cmp r7, 0x6 + beq _0815B20A +_0815B200: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3F + bls _0815B1C4 +_0815B20A: + strh r7, [r6, 0x14] + movs r0, 0x5 + strh r0, [r6, 0x8] + b _0815B22E + .align 2, 0 +_0815B214: .4byte 0x02020630 +_0815B218: .4byte 0x08593114 +_0815B21C: .4byte sub_815B23C + 1 +_0815B220: + movs r1, 0x14 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815B22E + adds r0, r2, 0 + bl move_anim_task_del +_0815B22E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815B054 + + thumb_func_start sub_815B23C +sub_815B23C: @ 815B23C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815B270 + ldr r3, _0815B278 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x2E + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0815B270: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815B278: .4byte 0x03005e00 + thumb_func_end sub_815B23C + + thumb_func_start sub_815B27C +sub_815B27C: @ 815B27C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815B290 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC +_0815B290: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + bgt _0815B2C2 + ldrh r0, [r5, 0x2E] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815B2B4 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _0815B2C0 +_0815B2B4: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_0815B2C0: + strb r0, [r2] +_0815B2C2: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1E + ble _0815B2D8 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0815B2D8: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3D + bne _0815B324 + ldr r1, _0815B32C + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldrh r0, [r5, 0x24] + ldrh r2, [r5, 0x20] + adds r0, r2 + 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, 0x24] + strh r1, [r5, 0x26] + movs r0, 0x14 + strh r0, [r5, 0x2E] + ldr r4, _0815B330 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, _0815B334 + str r0, [r5, 0x1C] +_0815B324: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815B32C: .4byte move_anim_8072740 + 1 +_0815B330: .4byte 0x02038437 +_0815B334: .4byte sub_80A6EEC + 1 + thumb_func_end sub_815B27C + + thumb_func_start sub_815B338 +sub_815B338: @ 815B338 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0815B358 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815B35C + cmp r0, 0x1 + beq _0815B37C + b _0815B38E + .align 2, 0 +_0815B358: .4byte 0x03005e00 +_0815B35C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815B378 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B38E + .align 2, 0 +_0815B378: .4byte 0x085ce350 +_0815B37C: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B38E + adds r0, r5, 0 + bl move_anim_task_del +_0815B38E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B338 + + thumb_func_start sub_815B394 +sub_815B394: @ 815B394 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0815B3F4 + cmp r0, 0x1 + bgt _0815B3B4 + cmp r0, 0 + beq _0815B3BE + b _0815B496 +_0815B3B4: + cmp r0, 0x2 + beq _0815B424 + cmp r0, 0x3 + beq _0815B478 + b _0815B496 +_0815B3BE: + ldr r4, _0815B3F0 + 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] + adds r0, r6, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x30] + strh r0, [r5, 0x32] + b _0815B46C + .align 2, 0 +_0815B3F0: .4byte 0x02038436 +_0815B3F4: + ldrh r0, [r5, 0x30] + adds r0, 0x60 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + subs r0, 0x1A + strh r0, [r5, 0x32] + movs r2, 0x30 + ldrsh r1, [r5, r2] + movs r0, 0x32 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815B424 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0815B424: + ldrh r0, [r5, 0x30] + adds r0, 0x60 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x30 + strh r0, [r5, 0x32] + movs r2, 0x30 + ldrsh r1, [r5, r2] + movs r0, 0x32 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815B496 + movs r0, 0 + strh r0, [r5, 0x34] + ldr r1, _0815B474 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0 + bl sub_80A7344 +_0815B46C: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0815B496 + .align 2, 0 +_0815B474: .4byte 0x02020630 +_0815B478: + ldrh r0, [r5, 0x26] + subs r0, 0x6 + strh r0, [r5, 0x26] + movs r1, 0x22 + ldrsh r0, [r5, r1] + movs r2, 0x26 + ldrsh r1, [r5, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0815B496 + adds r0, r5, 0 + bl move_anim_8072740 +_0815B496: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815B394 + + thumb_func_start sub_815B49C +sub_815B49C: @ 815B49C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0815B4B4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815B4BC + ldr r0, _0815B4B8 + b _0815B4C0 + .align 2, 0 +_0815B4B4: .4byte 0x02038436 +_0815B4B8: .4byte 0x0000fff0 +_0815B4BC: + movs r0, 0x80 + lsls r0, 1 +_0815B4C0: + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x22] + ldr r0, _0815B4D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815B4D0: .4byte sub_815B4D4 + 1 + thumb_func_end sub_815B49C + + thumb_func_start sub_815B4D4 +sub_815B4D4: @ 815B4D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x48 + strh r0, [r4, 0x2E] + ldr r0, _0815B4F4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815B4F8 + ldrh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 20 + b _0815B500 + .align 2, 0 +_0815B4F4: .4byte 0x02038436 +_0815B4F8: + ldrh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 +_0815B500: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x10 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r5, r0, r1 + strh r5, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0815B54C + ldr r0, _0815B56C + ldrh r1, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x22] + adds r2, r5 + lsls r2, 16 + asrs r2, 16 + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + bl obj_add_from_template_call_callback_once +_0815B54C: + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x20 + movs r1, 0x98 + lsls r1, 1 + cmp r0, r1 + bls _0815B566 + adds r0, r4, 0 + bl move_anim_8072740 +_0815B566: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815B56C: .4byte 0x085ce3a0 + thumb_func_end sub_815B4D4 + + thumb_func_start sub_815B570 +sub_815B570: @ 815B570 + push {r4,lr} + adds r4, r0, 0 + bl GenerateRandomNumber2 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0815B58A + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x4 + b _0815B592 +_0815B58A: + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x5 +_0815B592: + ldr r3, _0815B5C4 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0815B5C8 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + bl GenerateRandomNumber2 + movs r1, 0x7 + ands r0, r1 + adds r1, r0, 0 + cmp r1, 0x3 + ble _0815B5B4 + negs r0, r1 + lsls r0, 24 + lsrs r0, 24 +_0815B5B4: + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, _0815B5CC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815B5C4: .4byte 0x000003ff +_0815B5C8: .4byte 0xfffffc00 +_0815B5CC: .4byte sub_815B5D0 + 1 + thumb_func_end sub_815B570 + + thumb_func_start sub_815B5D0 +sub_815B5D0: @ 815B5D0 + 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, 0x1D + bgt _0815B612 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0815B646 + 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, 0 + b _0815B644 +_0815B612: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + bne _0815B628 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0815B628: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x3 + bne _0815B640 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815B658 + strh r0, [r3, 0x30] +_0815B640: + ldrh r0, [r3, 0x30] + adds r0, 0x1 +_0815B644: + strh r0, [r3, 0x30] +_0815B646: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x3C + ble _0815B654 + adds r0, r3, 0 + bl obj_delete_and_free_tiles +_0815B654: + pop {r0} + bx r0 + .align 2, 0 +_0815B658: .4byte 0x0000ffff + thumb_func_end sub_815B5D0 + + thumb_func_start sub_815B65C +sub_815B65C: @ 815B65C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _0815B694 + 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 _0815B69C + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815B698 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B6AE + .align 2, 0 +_0815B694: .4byte 0x03005e00 +_0815B698: .4byte 0x085ce3b8 +_0815B69C: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B6AE + adds r0, r5, 0 + bl move_anim_task_del +_0815B6AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B65C + + thumb_func_start sub_815B6B4 +sub_815B6B4: @ 815B6B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _0815B6EC + 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 _0815B6F4 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815B6F0 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B706 + .align 2, 0 +_0815B6EC: .4byte 0x03005e00 +_0815B6F0: .4byte 0x085ce3e0 +_0815B6F4: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B706 + adds r0, r5, 0 + bl move_anim_task_del +_0815B706: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B6B4 + + thumb_func_start sub_815B70C +sub_815B70C: @ 815B70C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815B71E + cmp r0, 0x1 + beq _0815B748 + b _0815B770 +_0815B71E: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + movs r0, 0x90 + lsls r0, 4 + strh r0, [r4, 0x30] + ldr r0, _0815B744 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815B770 + .align 2, 0 +_0815B744: .4byte 0x02038436 +_0815B748: + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + subs r2, 0x60 + strh r2, [r4, 0x30] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _0815B770 + adds r0, r4, 0 + bl move_anim_8072740 +_0815B770: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815B70C + + thumb_func_start sub_815B778 +sub_815B778: @ 815B778 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _0815B7B0 + 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 _0815B7B8 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815B7B4 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B7CA + .align 2, 0 +_0815B7B0: .4byte 0x03005e00 +_0815B7B4: .4byte 0x085ce430 +_0815B7B8: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B7CA + adds r0, r5, 0 + bl move_anim_task_del +_0815B7CA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B778 + + thumb_func_start sub_815B7D0 +sub_815B7D0: @ 815B7D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _0815B800 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815B7F6 + b _0815BAFC +_0815B7F6: + lsls r0, 2 + ldr r1, _0815B804 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815B800: .4byte 0x03005e00 +_0815B804: .4byte _0815B808 + .align 2, 0 +_0815B808: + .4byte _0815B81C + .4byte _0815B86C + .4byte _0815B8A8 + .4byte _0815BA44 + .4byte _0815BA82 +_0815B81C: + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + ldr r0, _0815B840 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815B844 + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0x1 + bl lcd_bg_operations + b _0815B84E + .align 2, 0 +_0815B840: .4byte 0x02038436 +_0815B844: + movs r0, 0x2 + movs r1, 0x2 + movs r2, 0x1 + bl lcd_bg_operations +_0815B84E: + ldr r0, _0815B864 + mov r6, r8 + lsls r1, r6, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, _0815B868 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + b _0815BA26 + .align 2, 0 +_0815B864: .4byte 0x03005e00 +_0815B868: .4byte 0x0203841e +_0815B86C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _0815B886 + b _0815BAFC +_0815B886: + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + ldrh r5, [r4, 0xA] + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set + cmp r5, 0xF + beq _0815B8A6 + b _0815BAFC +_0815B8A6: + b _0815BA7A +_0815B8A8: + ldr r5, _0815B8D8 + ldrb r0, [r5] + ldr r1, _0815B8DC + ldrb r1, [r1] + mov r2, r8 + lsls r4, r2, 2 + adds r2, r4, r2 + lsls r2, 3 + adds r2, r3 + ldrb r2, [r2, 0x1C] + bl sub_805E448 + ldrb r1, [r5] + mov r0, sp + bl sub_80A6BFC + bl sub_80A4DF0 + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + beq _0815B8E0 + movs r1, 0 + b _0815B8EA + .align 2, 0 +_0815B8D8: .4byte 0x02038436 +_0815B8DC: .4byte 0x02038437 +_0815B8E0: + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r1, r0, 24 +_0815B8EA: + ldr r0, _0815B9CC + ldr r2, [r0] + lsls r0, r1, 2 + adds r2, 0x4 + adds r2, r0 + ldr r1, _0815B9D0 + ldr r0, _0815B9D4 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 11 + ldr r0, [r2] + adds r0, r1 + ldr r1, [sp] + ldr r2, _0815B9D8 + bl CpuSet + ldr r1, [sp] + movs r2, 0x80 + lsls r2, 4 + mov r0, sp + ldrh r3, [r0, 0xA] + movs r0, 0x1 + bl gpu_copy_bg_tile_pattern_data_to_vram + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815BA1C + ldr r5, _0815B9DC + ldr r0, [r5] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + adds r4, r0, 0 + ldr r0, [r5] + ldr r0, [r0, 0x18] + ldrh r0, [r0, 0x2] + bl sub_80DB2A8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0815B99C + ldr r6, [sp, 0x4] + movs r5, 0 + movs r0, 0x7 + mov r12, r0 + movs r7, 0 +_0815B950: + movs r4, 0 + adds r3, r7, r6 + mov r1, r12 + lsls r0, r1, 1 + adds r2, r0, r6 +_0815B95A: + 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 _0815B95A + movs r2, 0x20 + add r12, r2 + adds r7, 0x40 + adds r5, 0x1 + cmp r5, 0x7 + ble _0815B950 + movs r5, 0 + movs r0, 0x80 + lsls r0, 3 + adds r3, r0, 0 +_0815B980: + adds r2, r5, 0x1 + lsls r0, r5, 6 + adds r1, r0, r6 + movs r4, 0x7 +_0815B988: + ldrh r0, [r1] + eors r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0815B988 + adds r5, r2, 0 + cmp r5, 0x7 + ble _0815B980 +_0815B99C: + ldr r0, _0815B9DC + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0, 0x2] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _0815B9EC + ldr r3, _0815B9E0 + ldr r4, _0815B9E4 + ldr r2, _0815B9D4 + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, _0815B9E8 + b _0815BA06 + .align 2, 0 +_0815B9CC: .4byte 0x020244d4 +_0815B9D0: .4byte 0x020244e4 +_0815B9D4: .4byte 0x02038436 +_0815B9D8: .4byte 0x04000200 +_0815B9DC: .4byte 0x02039f34 +_0815B9E0: .4byte 0x02020630 +_0815B9E4: .4byte 0x020241e4 +_0815B9E8: .4byte 0x082ff6c0 +_0815B9EC: + ldr r3, _0815BA30 + ldr r4, _0815BA34 + ldr r2, _0815BA38 + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, _0815BA3C +_0815BA06: + str r1, [r0] + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + bl sub_8008258 +_0815BA1C: + ldr r0, _0815BA40 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815BA26: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815BAFC + .align 2, 0 +_0815BA30: .4byte 0x02020630 +_0815BA34: .4byte 0x020241e4 +_0815BA38: .4byte 0x02038436 +_0815BA3C: .4byte 0x082ff694 +_0815BA40: .4byte 0x03005e00 +_0815BA44: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815BAFC + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + ldrh r5, [r4, 0xA] + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl lcd_io_set + cmp r5, 0 + bne _0815BAFC +_0815BA7A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815BAFC +_0815BA82: + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + ldr r0, _0815BAA8 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815BAAC + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl lcd_bg_operations + b _0815BAB6 + .align 2, 0 +_0815BAA8: .4byte 0x02038436 +_0815BAAC: + movs r0, 0x2 + movs r1, 0x2 + movs r2, 0 + bl lcd_bg_operations +_0815BAB6: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815BAF6 + ldr r4, _0815BB0C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815BAF6 + ldr r0, _0815BB10 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r6, 0x1C + ldrsh r0, [r1, r6] + cmp r0, 0 + bne _0815BAF6 + ldrb r0, [r4] + ldr r1, _0815BB14 + ldr r1, [r1] + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r2 + ldrh r1, [r1, 0x2] + bl sub_805EE54 +_0815BAF6: + mov r0, r8 + bl move_anim_task_del +_0815BAFC: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815BB0C: .4byte 0x02038436 +_0815BB10: .4byte 0x03005e00 +_0815BB14: .4byte 0x020244d0 + thumb_func_end sub_815B7D0 + + thumb_func_start c3_80DFBE4 +c3_80DFBE4: @ 815BB18 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0815BB48 + ldr r3, _0815BB4C + ldr r2, _0815BB50 + ldr r1, _0815BB54 + ldrb r1, [r1] + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3E + ldrb r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r4, 0xE] + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815BB48: .4byte 0x0203841e +_0815BB4C: .4byte 0x02020630 +_0815BB50: .4byte 0x020241e4 +_0815BB54: .4byte 0x02038436 + thumb_func_end c3_80DFBE4 + + thumb_func_start sub_815BB58 +sub_815BB58: @ 815BB58 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0815BB7C + ldrb r0, [r0] + ldr r1, _0815BB80 + ldrb r1, [r1] + movs r2, 0x1 + bl sub_805E448 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815BB7C: .4byte 0x02038436 +_0815BB80: .4byte 0x02038437 + thumb_func_end sub_815BB58 + + thumb_func_start sub_815BB84 +sub_815BB84: @ 815BB84 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0815BBAC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0815BBA2 + b _0815BDF2 +_0815BBA2: + lsls r0, 2 + ldr r1, _0815BBB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815BBAC: .4byte 0x03005e00 +_0815BBB0: .4byte _0815BBB4 + .align 2, 0 +_0815BBB4: + .4byte _0815BBC8 + .4byte _0815BCB8 + .4byte _0815BD08 + .4byte _0815BD72 + .4byte _0815BDA6 +_0815BBC8: + ldr r1, _0815BC24 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815BC02 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0815BC02: + mov r0, sp + bl sub_80A6B30 + ldr r1, _0815BC28 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815BC34 + ldr r1, _0815BC2C + ldr r3, _0815BC30 + b _0815BC5C + .align 2, 0 +_0815BC24: .4byte 0x00003f42 +_0815BC28: .4byte 0x08c2a6ec +_0815BC2C: .4byte 0x02022e18 +_0815BC30: .4byte 0x0000ffc8 +_0815BC34: + ldr r0, _0815BC4C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815BC58 + ldr r1, _0815BC50 + ldr r2, _0815BC54 + adds r0, r2, 0 + b _0815BC5E + .align 2, 0 +_0815BC4C: .4byte 0x02038436 +_0815BC50: .4byte 0x02022e18 +_0815BC54: .4byte 0x0000ff79 +_0815BC58: + ldr r1, _0815BCA0 + ldr r3, _0815BCA4 +_0815BC5C: + adds r0, r3, 0 +_0815BC5E: + strh r0, [r1] + ldr r1, _0815BCA8 + movs r0, 0 + strh r0, [r1] + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _0815BCAC + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _0815BCB0 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r0, _0815BCB4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0815BCA0 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + ldr r0, _0815BCA8 + ldrh r0, [r0] + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + b _0815BD8E + .align 2, 0 +_0815BCA0: .4byte 0x02022e18 +_0815BCA4: .4byte 0x0000fff6 +_0815BCA8: .4byte 0x02022e1a +_0815BCAC: .4byte 0x08c2a634 +_0815BCB0: .4byte 0x08c2a6d4 +_0815BCB4: .4byte 0x03005e00 +_0815BCB8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x10] + adds r1, r0, 0x1 + strh r1, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bgt _0815BCCE + b _0815BDF2 +_0815BCCE: + movs r0, 0 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0815BCE4 + movs r0, 0xC + strh r0, [r4, 0xA] +_0815BCE4: + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xC + bne _0815BDF2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815BDF2 +_0815BD08: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _0815BD20 + movs r0, 0 + strh r0, [r4, 0xA] +_0815BD20: + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815BDF2 + ldr r2, _0815BD64 + ldr r1, _0815BD68 + movs r3, 0xC + ldrsh r0, [r4, r3] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815BD6C + strh r0, [r4, 0x8] + b _0815BDF2 + .align 2, 0 +_0815BD64: .4byte 0x02022e18 +_0815BD68: .4byte 0x085ce460 +_0815BD6C: + movs r0, 0x3 + strh r0, [r4, 0x8] + b _0815BDF2 +_0815BD72: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + adds r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815BDF2 + movs r0, 0 + strh r0, [r1, 0xE] + movs r0, 0x1 +_0815BD8E: + strh r0, [r1, 0x8] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xE4 + bl audio_play_and_stuff + b _0815BDF2 +_0815BDA6: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815BDC8 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0815BDC8: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, _0815BDFC + movs r1, 0 + strh r1, [r0] + ldr r0, _0815BE00 + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_task_del +_0815BDF2: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815BDFC: .4byte 0x02022e18 +_0815BE00: .4byte 0x02022e1a + thumb_func_end sub_815BB84 + + thumb_func_start sub_815BE04 +sub_815BE04: @ 815BE04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + bl GenerateRandomNumber2 + lsls r0, 16 + movs r1, 0xFC + lsls r1, 14 + ands r1, r0 + lsrs r5, r1, 16 + adds r1, r5, 0 + cmp r1, 0x1F + ble _0815BE2E + movs r0, 0x20 + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_0815BE2E: + ldr r4, _0815BF28 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r5 + strh r0, [r7, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r7, 0x22] + ldr r1, _0815BF2C + ldrh r0, [r1] + strh r0, [r7, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r7, 0x32] + ldr r4, _0815BF30 + movs r0, 0x20 + ldrsh r1, [r7, r0] + movs r0, 0x22 + ldrsh r2, [r7, r0] + adds r5, r7, 0 + adds r5, 0x43 + ldrb r3, [r5] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + bl obj_add_from_template_forward_search + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0x20 + ldrsh r1, [r7, r0] + movs r0, 0x22 + ldrsh r2, [r7, r0] + ldrb r3, [r5] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + bl obj_add_from_template_forward_search + mov r8, r0 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r0, r9 + lsls r2, r0, 4 + add r2, r9 + lsls r2, 2 + ldr r1, _0815BF34 + mov r10, r1 + adds r5, r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + str r2, [sp] + bl obj_anim_image_start + mov r0, r8 + lsls r6, r0, 4 + add r6, r8 + lsls r6, 2 + mov r1, r10 + adds r4, r6, r1 + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start + ldr r1, _0815BF2C + ldrh r0, [r1] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x32] + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + ldr r0, _0815BF38 + strh r0, [r5, 0x3C] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x3C] + adds r5, 0x3E + ldrb r0, [r5] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5] + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r1 + strb r0, [r4] + movs r0, 0x1C + add r10, r0 + ldr r2, [sp] + add r2, r10 + ldr r0, _0815BF3C + str r0, [r2] + add r6, r10 + str r0, [r6] + mov r1, r9 + strh r1, [r7, 0x3A] + mov r0, r8 + strh r0, [r7, 0x3C] + ldr r0, _0815BF40 + str r0, [r7, 0x1C] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815BF28: .4byte 0x02038436 +_0815BF2C: .4byte 0x0203841e +_0815BF30: .4byte 0x085ce48c +_0815BF34: .4byte 0x02020630 +_0815BF38: .4byte 0x0000ffff +_0815BF3C: .4byte sub_815C050 + 1 +_0815BF40: .4byte sub_815BF44 + 1 + thumb_func_end sub_815BE04 + + thumb_func_start sub_815BF44 +sub_815BF44: @ 815BF44 + push {lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x32] + ldrh r0, [r3, 0x34] + adds r2, r0 + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r3, 0x26] + subs r1, r0 + strh r1, [r3, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x34] + movs r2, 0x36 + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815BF92 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _0815BF92 + ldr r2, _0815BFEC + movs r0, 0x3A + ldrsh r1, [r3, 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] + ldrh r0, [r3, 0x36] + adds r0, 0x1 + strh r0, [r3, 0x36] +_0815BF92: + movs r1, 0x36 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _0815BFC6 + movs r2, 0x26 + ldrsh r1, [r3, r2] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0815BFC6 + ldr r2, _0815BFEC + movs r0, 0x3C + ldrsh r1, [r3, 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] + ldrh r0, [r3, 0x36] + adds r0, 0x1 + strh r0, [r3, 0x36] +_0815BFC6: + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815BFE8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815BFF0 + str r0, [r3, 0x1C] +_0815BFE8: + pop {r0} + bx r0 + .align 2, 0 +_0815BFEC: .4byte 0x02020630 +_0815BFF0: .4byte sub_815BFF4 + 1 + thumb_func_end sub_815BF44 + + thumb_func_start sub_815BFF4 +sub_815BFF4: @ 815BFF4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, _0815C048 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r6, r5, 0 + adds r6, 0x1C + adds r0, r3, r6 + ldr r2, [r0] + ldr r0, _0815C04C + cmp r2, r0 + bne _0815C040 + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldr r0, [r1] + cmp r0, r2 + bne _0815C040 + adds r0, r3, r5 + bl obj_delete_and_free_tiles + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + adds r0, r4, 0 + bl move_anim_8072740 +_0815C040: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815C048: .4byte 0x02020630 +_0815C04C: .4byte nullsub_12 + 1 + thumb_func_end sub_815BFF4 + + thumb_func_start sub_815C050 +sub_815C050: @ 815C050 + push {lr} + adds r3, r0, 0 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0815C09C + ldrh r2, [r3, 0x32] + ldrh r1, [r3, 0x34] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x26] + subs r0, r1 + strh r0, [r3, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x34] + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815C09C + mov r1, r12 + ldrb r0, [r1] + movs r1, 0x4 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, _0815C0A0 + str r0, [r3, 0x1C] +_0815C09C: + pop {r0} + bx r0 + .align 2, 0 +_0815C0A0: .4byte nullsub_12 + 1 + thumb_func_end sub_815C050 + + thumb_func_start sub_815C0A4 +sub_815C0A4: @ 815C0A4 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0815C0CC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x5 + bls _0815C0C2 + b _0815C396 +_0815C0C2: + lsls r0, 2 + ldr r1, _0815C0D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815C0CC: .4byte 0x03005e00 +_0815C0D0: .4byte _0815C0D4 + .align 2, 0 +_0815C0D4: + .4byte _0815C0EC + .4byte _0815C224 + .4byte _0815C2AC + .4byte _0815C2E2 + .4byte _0815C310 + .4byte _0815C34A +_0815C0EC: + ldr r1, _0815C148 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0815C14C + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815C124 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0815C124: + mov r0, sp + bl sub_80A6B30 + ldr r1, _0815C150 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815C15C + ldr r1, _0815C154 + ldr r3, _0815C158 + adds r0, r3, 0 + b _0815C1CA + .align 2, 0 +_0815C148: .4byte 0x00003f42 +_0815C14C: .4byte 0x00000d03 +_0815C150: .4byte 0x08c2a6ec +_0815C154: .4byte 0x02022e18 +_0815C158: .4byte 0x0000ffc8 +_0815C15C: + ldr r0, _0815C1A0 + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C1B4 + cmp r4, 0x1 + bne _0815C180 + ldr r1, _0815C1A4 + ldr r2, _0815C1A8 + adds r0, r2, 0 + strh r0, [r1] +_0815C180: + cmp r4, 0x3 + bne _0815C18C + ldr r1, _0815C1A4 + ldr r3, _0815C1AC + adds r0, r3, 0 + strh r0, [r1] +_0815C18C: + cmp r4, 0 + bne _0815C196 + ldr r1, _0815C1A4 + movs r0, 0xE + strh r0, [r1] +_0815C196: + cmp r4, 0x2 + bne _0815C1CC + ldr r1, _0815C1A4 + ldr r2, _0815C1B0 + b _0815C1C8 + .align 2, 0 +_0815C1A0: .4byte 0x02038437 +_0815C1A4: .4byte 0x02022e18 +_0815C1A8: .4byte 0x0000ff65 +_0815C1AC: .4byte 0x0000ff8d +_0815C1B0: .4byte 0x0000ffec +_0815C1B4: + cmp r4, 0x1 + bne _0815C1C0 + ldr r1, _0815C208 + ldr r3, _0815C20C + adds r0, r3, 0 + strh r0, [r1] +_0815C1C0: + cmp r4, 0 + bne _0815C1CC + ldr r1, _0815C208 + ldr r2, _0815C210 +_0815C1C8: + adds r0, r2, 0 +_0815C1CA: + strh r0, [r1] +_0815C1CC: + ldr r1, _0815C214 + movs r0, 0 + strh r0, [r1] + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _0815C218 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _0815C21C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r0, _0815C220 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _0815C208 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + ldr r0, _0815C214 + ldrh r0, [r0] + strh r0, [r1, 0x1E] + b _0815C2A4 + .align 2, 0 +_0815C208: .4byte 0x02022e18 +_0815C20C: .4byte 0x0000ff79 +_0815C210: .4byte 0x0000fff6 +_0815C214: .4byte 0x02022e1a +_0815C218: .4byte 0x08c2a634 +_0815C21C: .4byte 0x08c2a6d4 +_0815C220: .4byte 0x03005e00 +_0815C224: + ldr r1, _0815C258 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0 + strh r0, [r5, 0xE] + ldr r0, _0815C25C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C268 + ldr r2, _0815C260 + ldr r1, _0815C264 + movs r3, 0xC + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r5, [r5, 0x1C] + adds r0, r5 + b _0815C27A + .align 2, 0 +_0815C258: .4byte 0x03005e00 +_0815C25C: .4byte 0x02038437 +_0815C260: .4byte 0x02022e18 +_0815C264: .4byte 0x085ce4a4 +_0815C268: + ldr r2, _0815C298 + ldr r1, _0815C29C + movs r3, 0xC + ldrsh r0, [r5, r3] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r5, 0x1C] + subs r0, r1 +_0815C27A: + strh r0, [r2] + ldr r0, _0815C2A0 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815C2A4 + strh r0, [r1, 0x8] + b _0815C396 + .align 2, 0 +_0815C298: .4byte 0x02022e18 +_0815C29C: .4byte 0x085ce4a4 +_0815C2A0: .4byte 0x03005e00 +_0815C2A4: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815C396 +_0815C2AC: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _0815C2C6 + movs r0, 0x5 + strh r0, [r4, 0xA] +_0815C2C6: + ldrh r1, [r4, 0xA] + lsls r1, 8 + movs r0, 0x3 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bne _0815C396 + b _0815C302 +_0815C2E2: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r1, [r4, 0xE] + adds r1, 0x1 + strh r1, [r4, 0xE] + lsls r1, 16 + asrs r1, 16 + ldr r2, _0815C30C + movs r3, 0xC + ldrsh r0, [r4, r3] + adds r0, r2 + ldrb r0, [r0] + cmp r1, r0 + ble _0815C396 +_0815C302: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C396 + .align 2, 0 +_0815C30C: .4byte 0x085ce4a8 +_0815C310: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + ble _0815C32A + movs r0, 0xD + strh r0, [r4, 0xA] +_0815C32A: + ldrh r1, [r4, 0xA] + lsls r1, 8 + movs r0, 0x3 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xD + bne _0815C396 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0815C396 +_0815C34A: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815C36C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0815C36C: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, _0815C3A0 + movs r1, 0 + strh r1, [r0] + ldr r0, _0815C3A4 + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + adds r0, r6, 0 + bl move_anim_task_del +_0815C396: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815C3A0: .4byte 0x02022e18 +_0815C3A4: .4byte 0x02022e1a + thumb_func_end sub_815C0A4 + + thumb_func_start sub_815C3A8 +sub_815C3A8: @ 815C3A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _0815C3E0 + 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 _0815C3E8 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815C3E4 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C3FA + .align 2, 0 +_0815C3E0: .4byte 0x03005e00 +_0815C3E4: .4byte 0x085ce4b0 +_0815C3E8: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815C3FA + adds r0, r5, 0 + bl move_anim_task_del +_0815C3FA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815C3A8 + + thumb_func_start sub_815C400 +sub_815C400: @ 815C400 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0815C41E + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815C472 +_0815C41E: + adds r0, 0x1 + strh r0, [r4, 0x2E] + cmp r1, 0x14 + ble _0815C472 + ldrh r0, [r4, 0x30] + adds r0, 0xA0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0x80 + strh r0, [r4, 0x32] + ldr r0, _0815C44C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815C450 + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + b _0815C456 + .align 2, 0 +_0815C44C: .4byte 0x02038436 +_0815C450: + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 +_0815C456: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0815C472 + adds r0, r4, 0 + bl move_anim_8072740 +_0815C472: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815C400 + + thumb_func_start sub_815C478 +sub_815C478: @ 815C478 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0815C49C + adds r4, r0, r1 + ldr r5, _0815C4A0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C4A4 + adds r0, r2, 0 + bl move_anim_task_del + b _0815C538 + .align 2, 0 +_0815C49C: .4byte 0x03005e00 +_0815C4A0: .4byte 0x0203841e +_0815C4A4: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _0815C4B0 + movs r0, 0 + strh r0, [r5, 0x4] +_0815C4B0: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0x2 + ble _0815C4BC + movs r0, 0x2 + strh r0, [r5, 0x4] +_0815C4BC: + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r1, 1 + movs r0, 0x8 + subs r0, r1 + strh r0, [r4, 0xE] + movs r1, 0x4 + ldrsh r0, [r5, r1] + lsls r0, 7 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r5, 0x4] + adds r0, 0x2 + strh r0, [r4, 0x12] + ldrh r0, [r5, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x14] + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C508 + ldr r0, _0815C504 + b _0815C50A + .align 2, 0 +_0815C504: .4byte 0x02038436 +_0815C508: + ldr r0, _0815C540 +_0815C50A: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C528 + movs r1, 0x10 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x10] + movs r1, 0x12 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x12] +_0815C528: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, _0815C544 + str r0, [r4] +_0815C538: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815C540: .4byte 0x02038437 +_0815C544: .4byte sub_815C548 + 1 + thumb_func_end sub_815C478 + + thumb_func_start sub_815C548 +sub_815C548: @ 815C548 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0815C56C + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r6, [r4, r0] + cmp r6, 0x1 + beq _0815C5D0 + cmp r6, 0x1 + bgt _0815C570 + cmp r6, 0 + beq _0815C57C + b _0815C6A8 + .align 2, 0 +_0815C56C: .4byte 0x03005e00 +_0815C570: + cmp r6, 0x2 + beq _0815C628 + cmp r6, 0x3 + bne _0815C57A + b _0815C698 +_0815C57A: + b _0815C6A8 +_0815C57C: + ldr r2, _0815C5CC + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0815C6A8 + strh r6, [r4, 0xA] + b _0815C690 + .align 2, 0 +_0815C5CC: .4byte 0x02020630 +_0815C5D0: + ldr r2, _0815C624 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + ldrh r2, [r4, 0x12] + subs r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 1 + cmp r1, r0 + blt _0815C6A8 + movs r0, 0 + strh r0, [r4, 0xA] + b _0815C690 + .align 2, 0 +_0815C624: .4byte 0x02020630 +_0815C628: + ldr r2, _0815C68C + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r0, 0x24] + adds r1, r2 + movs r5, 0 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0815C6A8 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0815C690 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + strh r5, [r4, 0xA] + strh r5, [r4, 0x8] + b _0815C6A8 + .align 2, 0 +_0815C68C: .4byte 0x02020630 +_0815C690: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C6A8 +_0815C698: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_0815C6A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815C548 + + thumb_func_start sub_815C6B0 +sub_815C6B0: @ 815C6B0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0815C6CC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0815C6D4 + strh r0, [r4, 0x20] + ldr r1, _0815C6D0 + ldrh r0, [r1] + b _0815C6DE + .align 2, 0 +_0815C6CC: .4byte 0x02038436 +_0815C6D0: .4byte 0x0203841e +_0815C6D4: + movs r0, 0xF0 + strh r0, [r4, 0x20] + ldr r1, _0815C6F8 + ldrh r0, [r1] + subs r0, 0x1E +_0815C6DE: + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrb r1, [r1, 0x2] + adds r0, r4, 0 + bl obj_anim_image_start + ldr r0, _0815C6FC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815C6F8: .4byte 0x0203841e +_0815C6FC: .4byte sub_815C700 + 1 + thumb_func_end sub_815C6B0 + + thumb_func_start sub_815C700 +sub_815C700: @ 815C700 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x3 + strh r0, [r4, 0x2E] + ldr r0, _0815C740 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815C744 + ldrh r1, [r4, 0x20] + adds r1, 0x5 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF0 + ble _0815C732 + adds r0, r4, 0 + bl move_anim_8072740 +_0815C732: + ldrh r1, [r4, 0x2E] + movs r0, 0xFF + ands r0, r1 + movs r1, 0x10 + bl sine + b _0815C768 + .align 2, 0 +_0815C740: .4byte 0x02038436 +_0815C744: + ldrh r1, [r4, 0x20] + subs r1, 0x5 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + cmp r1, 0 + bge _0815C75C + adds r0, r4, 0 + bl move_anim_8072740 +_0815C75C: + ldrh r1, [r4, 0x2E] + movs r0, 0xFF + ands r0, r1 + movs r1, 0x10 + bl cosine +_0815C768: + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815C700 + + thumb_func_start sub_815C770 +sub_815C770: @ 815C770 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0815C7B8 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x40 + strh r0, [r4, 0x22] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r4, 0x24] + ldr r0, _0815C7BC + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + movs r1, 0 + bl sub_80A7270 + ldr r0, _0815C7C0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815C7B8: .4byte 0x03005e00 +_0815C7BC: .4byte 0x0203841e +_0815C7C0: .4byte sub_815C7C4 + 1 + thumb_func_end sub_815C770 + + thumb_func_start sub_815C7C4 +sub_815C7C4: @ 815C7C4 + 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, _0815C7F0 + adds r7, r0, r1 + movs r1, 0x8 + ldrsh r0, [r7, r1] + mov r8, r0 + cmp r0, 0x1 + beq _0815C860 + cmp r0, 0x1 + bgt _0815C7F4 + cmp r0, 0 + beq _0815C7FC + b _0815C8DA + .align 2, 0 +_0815C7F0: .4byte 0x03005e00 +_0815C7F4: + mov r2, r8 + cmp r2, 0x2 + beq _0815C8C8 + b _0815C8DA +_0815C7FC: + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r1, [r7, 0xC] + adds r2, r0, r1 + strh r2, [r7, 0xC] + lsls r0, r2, 16 + asrs r0, 16 + ldrh r3, [r7, 0x24] + mov r8, r3 + movs r3, 0x24 + ldrsh r1, [r7, r3] + cmp r0, r1 + blt _0815C8DA + mov r0, r8 + subs r5, r0, r2 + lsls r5, 16 + asrs r5, 16 + adds r6, r1, 0 + lsls r6, 1 + adds r0, r5, 0 + adds r1, r6, 0 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + movs r1, 0x1 + ands r4, r1 + cmp r4, 0 + bne _0815C854 + lsls r0, 16 + asrs r0, 16 + mov r2, r8 + subs r0, r2, r0 + b _0815C8B2 +_0815C854: + lsls r0, 16 + asrs r0, 16 + mov r3, r8 + subs r0, r3 + strh r0, [r7, 0xC] + b _0815C8DA +_0815C860: + ldr r1, _0815C8B8 + adds r0, r1, 0 + ldrh r2, [r7, 0xC] + adds r1, r0, r2 + strh r1, [r7, 0xC] + movs r3, 0xC + ldrsh r0, [r7, r3] + movs r2, 0x24 + ldrsh r6, [r7, r2] + cmn r0, r6 + bgt _0815C8DA + ldrh r3, [r7, 0x24] + mov r9, r3 + mov r0, r9 + subs r4, r0, r1 + lsls r4, 16 + asrs r4, 16 + lsls r6, 1 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r2, r0, 16 + mov r1, r8 + ands r1, r5 + lsls r0, r1, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0815C8BC + lsls r0, r2, 16 + asrs r0, 16 + mov r2, r9 + subs r0, r2 +_0815C8B2: + strh r0, [r7, 0xC] + strh r1, [r7, 0x8] + b _0815C8DA + .align 2, 0 +_0815C8B8: .4byte 0xfffffe00 +_0815C8BC: + lsls r0, r2, 16 + asrs r0, 16 + mov r3, r9 + subs r0, r3, r0 + strh r0, [r7, 0xC] + b _0815C8DA +_0815C8C8: + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r4, 0 + bl move_anim_task_del + b _0815C950 +_0815C8DA: + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r7, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldr r2, _0815C948 + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0xC + ldrsh r0, [r7, r2] + cmp r0, 0 + bge _0815C90E + adds r0, 0x3F +_0815C90E: + asrs r0, 6 + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r7, 0xA] + adds r0, 0x1 + strh r0, [r7, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815C950 + ldrh r1, [r7, 0x20] + movs r3, 0x20 + ldrsh r0, [r7, r3] + cmp r0, 0 + beq _0815C94C + subs r0, r1, 0x1 + strh r0, [r7, 0x20] + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x22] + subs r0, r1 + strh r0, [r7, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0815C950 + movs r0, 0x10 + strh r0, [r7, 0x24] + b _0815C950 + .align 2, 0 +_0815C948: .4byte 0x02020630 +_0815C94C: + movs r0, 0x2 + strh r0, [r7, 0x8] +_0815C950: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815C7C4 + + thumb_func_start sub_815C95C +sub_815C95C: @ 815C95C + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C9BC + ldr r6, _0815C9B4 + movs r2, 0x4 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0815C990 + ldr r4, _0815C9B8 + 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] +_0815C990: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + ldrh r1, [r6, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r1, r2 + strh r0, [r5, 0x22] + movs r0, 0x80 + strh r0, [r5, 0x30] + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r5, 0x32] + strh r1, [r5, 0x34] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0815CA1A + .align 2, 0 +_0815C9B4: .4byte 0x0203841e +_0815C9B8: .4byte 0x02038436 +_0815C9BC: + ldrh r1, [r5, 0x30] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r5, 0x26] + adds r0, r2 + strh r0, [r5, 0x26] + movs r2, 0x36 + ldrsh r0, [r5, r2] + adds r4, r1, 0 + cmp r0, 0 + bne _0815C9FA + movs r0, 0x26 + ldrsh r1, [r5, r0] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmn r1, r0 + ble _0815C9FA + movs r0, 0x1 + strh r0, [r5, 0x36] + movs r1, 0x32 + ldrsh r0, [r5, r1] + negs r0, r0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 1 + strh r0, [r5, 0x32] +_0815C9FA: + adds r0, r4, 0 + adds r0, 0xC0 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x80 + strh r0, [r5, 0x32] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815CA1A + adds r0, r5, 0 + bl move_anim_8072740 +_0815CA1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815C95C + + thumb_func_start sub_815CA20 +sub_815CA20: @ 815CA20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r1, _0815CA50 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0815CB2C + ldr r0, _0815CA54 + movs r3, 0 + ldrsh r1, [r0, r3] + mov r8, r0 + cmp r1, 0 + bne _0815CA5C + ldr r0, _0815CA58 + b _0815CA5E + .align 2, 0 +_0815CA50: .4byte 0x03005e00 +_0815CA54: .4byte 0x0203841e +_0815CA58: .4byte 0x02038436 +_0815CA5C: + ldr r0, _0815CA98 +_0815CA5E: + ldrb r0, [r0] + strh r0, [r2, 0x1E] + mov r1, r8 + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0815CA9C + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r6, r0, r1 + strh r5, [r6, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + mov r2, r8 + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0x1 + beq _0815CAC0 + cmp r0, 0x1 + bgt _0815CAA0 + cmp r0, 0 + beq _0815CAA8 + lsls r2, r5, 4 + b _0815CB08 + .align 2, 0 +_0815CA98: .4byte 0x02038437 +_0815CA9C: .4byte 0x03005e00 +_0815CAA0: + cmp r0, 0x2 + beq _0815CACA + lsls r2, r5, 4 + b _0815CB08 +_0815CAA8: + movs r2, 0xA0 + lsls r2, 1 + adds r0, r5, 0 + movs r1, 0xE0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + lsls r2, r5, 4 + b _0815CB08 +_0815CAC0: + movs r2, 0x98 + lsls r2, 1 + movs r3, 0xF0 + lsls r3, 4 + b _0815CAD2 +_0815CACA: + movs r2, 0x98 + lsls r2, 1 + movs r3, 0xF1 + lsls r3, 8 +_0815CAD2: + adds r0, r5, 0 + movs r1, 0xD0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815CAF8 + ldrb r0, [r6, 0x1E] + bl battle_side_get_owner + lsls r0, 24 + lsls r2, r5, 4 + cmp r0, 0 + bne _0815CB08 +_0815CAF8: + ldr r0, _0815CB24 + lsls r2, r5, 4 + adds r1, r2, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x10 + strh r0, [r1, 0x26] +_0815CB08: + ldr r1, _0815CB24 + adds r0, r2, r5 + lsls r0, 2 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x24] + ldr r0, _0815CB28 + adds r1, r4, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815CB78 + .align 2, 0 +_0815CB24: .4byte 0x02020630 +_0815CB28: .4byte 0x03005e00 +_0815CB2C: + ldrb r5, [r2, 0x1C] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + movs r4, 0 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0815CB50 + strh r4, [r2, 0xC] + ldr r0, _0815CB84 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x24] + negs r0, r0 + strh r0, [r1, 0x24] +_0815CB50: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bne _0815CB78 + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, _0815CB84 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x24] + strh r4, [r0, 0x26] + adds r0, r7, 0 + bl move_anim_task_del +_0815CB78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815CB84: .4byte 0x02020630 + thumb_func_end sub_815CA20 + + thumb_func_start sub_815CB88 +sub_815CB88: @ 815CB88 + push {r4,r5,lr} + adds r4, r0, 0 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xC + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, r0 + ldr r3, _0815CBD4 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0815CBD8 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + bl GenerateRandomNumber2 + ldr r5, _0815CBDC + ands r5, r0 + bl GenerateRandomNumber2 + movs r1, 0xFF + ands r1, r0 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0815CBE0 + movs r2, 0xBC + lsls r2, 3 + adds r0, r5, r2 + b _0815CBE8 + .align 2, 0 +_0815CBD4: .4byte 0x000003ff +_0815CBD8: .4byte 0xfffffc00 +_0815CBDC: .4byte 0x000001ff +_0815CBE0: + movs r3, 0xBC + lsls r3, 3 + adds r0, r3, 0 + subs r0, r5 +_0815CBE8: + strh r0, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815CBFA + movs r2, 0x90 + lsls r2, 3 + adds r0, r1, r2 + b _0815CC02 +_0815CBFA: + movs r3, 0x90 + lsls r3, 3 + adds r0, r3, 0 + subs r0, r1 +_0815CC02: + strh r0, [r4, 0x30] + ldr r0, _0815CC14 + ldrh r0, [r0] + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0815CC1C + ldr r0, _0815CC18 + b _0815CC1E + .align 2, 0 +_0815CC14: .4byte 0x0203841e +_0815CC18: .4byte 0x0000fff8 +_0815CC1C: + movs r0, 0xF8 +_0815CC1E: + strh r0, [r4, 0x20] + movs r0, 0x68 + strh r0, [r4, 0x22] + ldr r0, _0815CC30 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815CC30: .4byte sub_815CC34 + 1 + thumb_func_end sub_815CB88 + + thumb_func_start sub_815CC34 +sub_815CC34: @ 815CC34 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815CC4C + ldrh r3, [r4, 0x2E] + lsls r0, r3, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + b _0815CC56 +_0815CC4C: + ldrh r3, [r4, 0x2E] + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 +_0815CC56: + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + adds r0, r3, 0 + subs r0, 0x16 + strh r0, [r4, 0x2E] + adds r1, r2, 0 + subs r1, 0x30 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0815CC7A + movs r0, 0 + strh r0, [r4, 0x2E] +_0815CC7A: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _0815CC8E + adds r0, r4, 0 + bl move_anim_8072740 +_0815CC8E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815CC34 + + thumb_func_start sub_815CC94 +sub_815CC94: @ 815CC94 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _0815CCF8 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r0, _0815CCFC + movs r1, 0 + strh r1, [r0] + ldr r4, _0815CD00 + strh r1, [r4] + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + ldrh r1, [r4] + movs r0, 0x44 + bl lcd_io_set + ldr r0, _0815CD04 + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0815CD08 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815CCF8: .4byte 0x00001f3f +_0815CCFC: .4byte 0x02022e24 +_0815CD00: .4byte 0x02022e26 +_0815CD04: .4byte 0x0203841e +_0815CD08: .4byte sub_815CD0C + 1 + thumb_func_end sub_815CC94 + + thumb_func_start sub_815CD0C +sub_815CD0C: @ 815CD0C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0815CD4A + cmp r0, 0x1 + bgt _0815CD22 + cmp r0, 0 + beq _0815CD2C + b _0815CDAA +_0815CD22: + cmp r0, 0x2 + beq _0815CD60 + cmp r0, 0x3 + beq _0815CD82 + b _0815CDAA +_0815CD2C: + 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 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815CDAA + b _0815CD7A +_0815CD4A: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0815CDAA + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _0815CD7A +_0815CD60: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815CDAA + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815CD7A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + b _0815CDAA +_0815CD82: + ldr r1, _0815CDB0 + movs r0, 0x4A + bl lcd_io_set + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + adds r0, r4, 0 + bl move_anim_8072740 +_0815CDAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815CDB0: .4byte 0x00003f3f + thumb_func_end sub_815CD0C + + thumb_func_start sub_815CDB4 +sub_815CDB4: @ 815CDB4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0815CDF0 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, _0815CDF4 + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldr r1, _0815CDF8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815CDF0: .4byte 0x02038436 +_0815CDF4: .4byte 0x0203841e +_0815CDF8: .4byte sub_815CDFC + 1 + thumb_func_end sub_815CDB4 + + thumb_func_start sub_815CDFC +sub_815CDFC: @ 815CDFC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x30 + ldrsh r0, [r4, r2] + ldrh r1, [r4, 0x34] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + lsls r1, r0, 16 + cmp r0, 0x3F + bls _0815CE36 + asrs r0, r1, 16 + cmp r0, 0xC3 + ble _0815CE48 +_0815CE36: + ldr r0, _0815CE44 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + b _0815CE52 + .align 2, 0 +_0815CE44: .4byte 0x02038436 +_0815CE48: + ldr r0, _0815CE94 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 +_0815CE52: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r3, 0x38 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _0815CE98 + movs r1, 0x80 + lsls r1, 3 + adds r0, r1, 0 + ldrh r3, [r4, 0x32] + adds r0, r3 + strh r0, [r4, 0x32] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r3, [r4, 0x34] + adds r0, r3 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x2E + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _0815CEC8 + strh r2, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x38] + b _0815CEC8 + .align 2, 0 +_0815CE94: .4byte 0x02038436 +_0815CE98: + cmp r2, 0x1 + bne _0815CEC8 + ldr r1, _0815CED0 + adds r0, r1, 0 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r4, 0x32] + ldr r3, _0815CED4 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0815CEC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0815CEC8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815CED0: .4byte 0xfffffc00 +_0815CED4: .4byte 0xffffff00 + thumb_func_end sub_815CDFC + + thumb_func_start sub_815CED8 +sub_815CED8: @ 815CED8 + 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 + str r0, [sp, 0x18] + movs r0, 0 + bl obj_id_for_side_relative_to_move + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815CF18 + movs r0, 0x1 + str r0, [sp, 0x1C] + ldr r0, _0815CF14 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r1, [r0, 0x10] + mov r9, r1 + ldr r2, [r0, 0xC] + mov r8, r2 + ldrh r6, [r0, 0x2] + movs r3, 0x14 + b _0815D058 + .align 2, 0 +_0815CF14: .4byte 0x02039f34 +_0815CF18: + ldr r0, _0815CF88 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815CFC4 + movs r0, 0 + str r0, [sp, 0x1C] + ldr r6, _0815CF8C + ldr r4, _0815CF90 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r7, _0815CF94 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + movs r1, 0x1 + bl pokemon_getattr + mov r8, r0 + ldr r0, _0815CF98 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815CFBC + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815CF9C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + b _0815CFAA + .align 2, 0 +_0815CF88: .4byte 0x02038436 +_0815CF8C: .4byte 0x0202406e +_0815CF90: .4byte 0x02038437 +_0815CF94: .4byte 0x020244ec +_0815CF98: .4byte 0x020244d0 +_0815CF9C: + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + ldr r1, _0815CFB8 + adds r0, r1 +_0815CFAA: + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815CFBE + .align 2, 0 +_0815CFB8: .4byte 0x02024744 +_0815CFBC: + ldrh r6, [r1, 0x2] +_0815CFBE: + movs r1, 0x14 + mov r10, r1 + b _0815D05A +_0815CFC4: + movs r2, 0x1 + str r2, [sp, 0x1C] + ldr r6, _0815D028 + ldr r4, _0815D02C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r7, _0815D030 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + movs r1, 0x1 + bl pokemon_getattr + mov r8, r0 + ldr r0, _0815D034 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815D054 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815D03C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + ldr r1, _0815D038 + adds r0, r1 + b _0815D048 + .align 2, 0 +_0815D028: .4byte 0x0202406e +_0815D02C: .4byte 0x02038437 +_0815D030: .4byte 0x02024744 +_0815D034: .4byte 0x020244d0 +_0815D038: .4byte 0x020244ec +_0815D03C: + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 +_0815D048: + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815D056 +_0815D054: + ldrh r6, [r1, 0x2] +_0815D056: + ldr r3, _0815D144 +_0815D058: + mov r10, r3 +_0815D05A: + ldr r0, _0815D148 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, _0815D148 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + adds r4, r1 + lsls r4, 16 + asrs r4, 16 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + ldr r0, _0815D14C + ldrb r0, [r0] + str r0, [sp, 0x10] + movs r0, 0x1 + str r0, [sp, 0x14] + adds r0, r6, 0 + ldr r1, [sp, 0x1C] + movs r2, 0 + adds r3, r4, 0 + bl sub_80A8394 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _0815D150 + lsls r5, r6, 4 + adds r5, r6 + lsls r5, 2 + adds r5, r0 + movs r0, 0x3 + ands r7, r0 + lsls r7, 2 + mov r8, r7 + ldrb r0, [r5, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r0 + mov r2, r8 + orrs r1, r2 + strb r1, [r5, 0x5] + ldrb r2, [r5, 0x1] + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r5, 0x1] + ldr r0, _0815D154 + lsrs r1, 4 + lsls r1, 4 + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + orrs r1, r2 + movs r2, 0x20 + bl rboxid_80040B8 + ldrb r0, [r5, 0x5] + ands r4, r0 + mov r0, r8 + orrs r4, r0 + strb r4, [r5, 0x5] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r0, _0815D158 + ldr r1, [sp, 0x18] + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + strh r6, [r4, 0x8] + ldr r0, _0815D15C + str r0, [r4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815D144: .4byte 0x0000ffec +_0815D148: .4byte 0x02038436 +_0815D14C: .4byte 0x02038437 +_0815D150: .4byte 0x02020630 +_0815D154: .4byte 0x00007fff +_0815D158: .4byte 0x03005e00 +_0815D15C: .4byte sub_815D160 + 1 + thumb_func_end sub_815CED8 + + thumb_func_start sub_815D160 +sub_815D160: @ 815D160 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0815D1B4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D1AE + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _0815D1AE + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x1C] + strh r0, [r4, 0x1E] + ldr r0, _0815D1B8 + str r0, [r4] +_0815D1AE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815D1B4: .4byte 0x03005e00 +_0815D1B8: .4byte sub_815D1BC + 1 + thumb_func_end sub_815D160 + + thumb_func_start sub_815D1BC +sub_815D1BC: @ 815D1BC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0815D234 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r2, [r5, 0x8] + ldrh r0, [r5, 0x1C] + subs r0, 0x10 + movs r4, 0 + strh r0, [r5, 0x1C] + ldrh r0, [r5, 0x1E] + adds r0, 0x80 + strh r0, [r5, 0x1E] + ldr r1, _0815D238 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r6, r0, r1 + ldrb r2, [r6, 0x1] + lsls r1, r2, 30 + lsrs r1, 30 + movs r0, 0x2 + orrs r1, r0 + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + movs r0, 0x1C + ldrsh r2, [r5, r0] + movs r0, 0x1E + ldrsh r3, [r5, r0] + str r4, [sp] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A73E0 + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815D22A + adds r0, r6, 0 + bl sub_80A749C + adds r0, r6, 0 + bl sub_80A8610 + ldr r0, _0815D23C + str r0, [r5] +_0815D22A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815D234: .4byte 0x03005e00 +_0815D238: .4byte 0x02020630 +_0815D23C: .4byte sub_80A6814 + 1 + thumb_func_end sub_815D1BC + + thumb_func_start sub_815D240 +sub_815D240: @ 815D240 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0815D260 + adds r4, r1, r0 + ldr r0, _0815D264 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815D26C + ldr r0, _0815D268 + b _0815D26E + .align 2, 0 +_0815D260: .4byte 0x03005e00 +_0815D264: .4byte 0x0203841e +_0815D268: .4byte 0x02038436 +_0815D26C: + ldr r0, _0815D2EC +_0815D26E: + ldrb r5, [r0] + movs r6, 0 + strh r6, [r4, 0x8] + strh r6, [r4, 0xA] + strh r6, [r4, 0xC] + movs r0, 0x10 + strh r0, [r4, 0xE] + strh r6, [r4, 0x10] + strh r5, [r4, 0x12] + movs r0, 0x20 + strh r0, [r4, 0x14] + strh r6, [r4, 0x16] + movs r0, 0x18 + strh r0, [r4, 0x18] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D2A0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x18] +_0815D2A0: + adds r0, r5, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x22 + strh r0, [r4, 0x22] + cmp r0, 0 + bge _0815D2B4 + strh r6, [r4, 0x22] +_0815D2B4: + ldrh r0, [r4, 0x22] + adds r0, 0x42 + strh r0, [r4, 0x24] + ldr r0, _0815D2F0 + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + adds r0, r5, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D304 + ldr r0, _0815D2F4 + str r0, [sp] + ldr r1, _0815D2F8 + movs r0, 0x50 + bl lcd_io_set + ldr r0, _0815D2FC + ldrh r5, [r0] + ldr r0, _0815D300 + b _0815D316 + .align 2, 0 +_0815D2EC: .4byte 0x02038437 +_0815D2F0: .4byte 0x0203841e +_0815D2F4: .4byte 0x04000014 +_0815D2F8: .4byte 0x00003f42 +_0815D2FC: .4byte 0x02022e18 +_0815D300: .4byte 0x02022e1a +_0815D304: + ldr r0, _0815D37C + str r0, [sp] + ldr r1, _0815D380 + movs r0, 0x50 + bl lcd_io_set + ldr r0, _0815D384 + ldrh r5, [r0] + ldr r0, _0815D388 +_0815D316: + ldrh r3, [r0] + movs r7, 0 + movs r2, 0 + ldr r6, _0815D38C + movs r0, 0xF0 + lsls r0, 3 + adds r0, r6 + mov r12, r0 +_0815D326: + lsls r2, 16 + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r6 + strh r5, [r0] + add r1, r12 + strh r5, [r1] + adds r0, r2, 0x1 + lsls r0, 1 + adds r1, r0, r6 + strh r3, [r1] + add r0, r12 + strh r3, [r0] + lsls r0, r7, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + adds r2, 0x2 + lsls r2, 16 + lsrs r2, 16 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0815D326 + ldr r0, _0815D390 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, _0815D394 + str r0, [r4] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815D37C: .4byte 0x04000018 +_0815D380: .4byte 0x00003f44 +_0815D384: .4byte 0x02022e1c +_0815D388: .4byte 0x02022e1e +_0815D38C: .4byte 0x02038c28 +_0815D390: .4byte 0xa6600001 +_0815D394: .4byte sub_815D398 + 1 + thumb_func_end sub_815D240 + + thumb_func_start sub_815D398 +sub_815D398: @ 815D398 + 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 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0815D3CC + adds r6, r0, r1 + ldrb r0, [r6, 0x12] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D3D8 + ldr r0, _0815D3D0 + ldrh r0, [r0] + str r0, [sp, 0x4] + ldr r0, _0815D3D4 + b _0815D3E0 + .align 2, 0 +_0815D3CC: .4byte 0x03005e00 +_0815D3D0: .4byte 0x02022e18 +_0815D3D4: .4byte 0x02022e1a +_0815D3D8: + ldr r0, _0815D3F8 + ldrh r0, [r0] + str r0, [sp, 0x4] + ldr r0, _0815D3FC +_0815D3E0: + ldrh r0, [r0] + str r0, [sp, 0x8] + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _0815D3EE + b _0815D5CC +_0815D3EE: + cmp r0, 0x1 + bgt _0815D400 + cmp r0, 0 + beq _0815D40E + b _0815D63C + .align 2, 0 +_0815D3F8: .4byte 0x02022e1c +_0815D3FC: .4byte 0x02022e1e +_0815D400: + cmp r0, 0x2 + bne _0815D406 + b _0815D5EC +_0815D406: + cmp r0, 0x3 + bne _0815D40C + b _0815D636 +_0815D40C: + b _0815D63C +_0815D40E: + movs r2, 0x24 + ldrsh r0, [r6, r2] + lsls r0, 17 + lsrs r5, r0, 16 + movs r3, 0 + str r3, [sp] + mov r9, r3 + movs r4, 0 + ldrh r0, [r6, 0xA] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0xA] + ldrh r7, [r6, 0xA] + mov r8, r7 + movs r0, 0x14 + ldrsh r1, [r6, r0] + movs r0, 0xFC + lsls r0, 3 + bl __divsi3 + strh r0, [r6, 0x1A] + movs r1, 0x16 + ldrsh r0, [r6, r1] + lsls r0, 1 + movs r2, 0x1A + ldrsh r1, [r6, r2] + bl __divsi3 + negs r0, r0 + strh r0, [r6, 0x1C] + ldrh r0, [r6, 0x16] + strh r0, [r6, 0x1E] + lsls r0, 16 + asrs r0, 21 + lsls r0, 16 + lsrs r7, r0, 16 + strh r7, [r6, 0x20] + ldrh r2, [r6, 0x24] + lsls r3, r2, 16 + mov r12, r3 + asrs r1, r3, 16 + movs r3, 0x22 + ldrsh r0, [r6, r3] + cmp r1, r0 + ble _0815D52E + ldr r0, _0815D584 + mov r10, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r0, 16 + str r0, [sp, 0x10] + ldr r2, [sp, 0x8] + lsls r0, r2, 16 + asrs r0, 16 + str r0, [sp, 0xC] +_0815D47E: + lsls r5, 16 + asrs r5, 16 + adds r2, r5, 0x1 + lsls r2, 1 + mov r3, r10 + ldrb r1, [r3, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + ldr r0, _0815D588 + adds r2, r0 + lsls r4, 16 + asrs r4, 16 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + subs r0, r4, r0 + ldr r3, [sp, 0xC] + adds r0, r3, r0 + strh r0, [r2] + lsls r3, r5, 1 + mov r0, r10 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r3, r0 + ldr r1, _0815D588 + adds r3, r1 + lsls r1, r7, 16 + asrs r1, 16 + ldr r2, [sp, 0x10] + adds r1, r2, r1 + mov r7, r8 + lsls r2, r7, 16 + asrs r2, 16 + lsls r0, r2, 1 + ldr r7, _0815D58C + adds r0, r7 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + adds r1, r0 + strh r1, [r3] + adds r2, 0xA + mov r8, r2 + movs r0, 0xFF + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldrh r0, [r6, 0x1C] + ldrh r2, [r6, 0x1E] + adds r0, r2 + strh r0, [r6, 0x1E] + lsls r0, 16 + asrs r0, 21 + lsls r0, 16 + lsrs r7, r0, 16 + strh r7, [r6, 0x20] + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + subs r5, 0x2 + lsls r5, 16 + lsrs r5, 16 + ldr r3, [sp] + lsls r0, r3, 16 + asrs r0, 16 + ldrh r1, [r6, 0x14] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + str r2, [sp] + asrs r0, 21 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, _0815D590 + add r0, r12 + lsrs r2, r0, 16 + lsls r3, r2, 16 + mov r12, r3 + asrs r1, r3, 16 + movs r3, 0x22 + ldrsh r0, [r6, r3] + cmp r1, r0 + bgt _0815D47E +_0815D52E: + lsls r1, r2, 17 + cmp r1, 0 + blt _0815D55A + ldr r4, _0815D588 + ldr r7, [sp, 0x4] + lsls r0, r7, 16 + asrs r0, 16 + adds r3, r0, 0 + adds r3, 0xF0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_0815D546: + asrs r2, r1, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + subs r2, 0x2 + lsls r1, r2, 16 + cmp r1, 0 + bge _0815D546 +_0815D55A: + ldrh r0, [r6, 0x14] + adds r0, 0x1 + strh r0, [r6, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0815D5C2 + movs r0, 0x40 + strh r0, [r6, 0x14] + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815D594 + ldrh r0, [r6, 0xE] + subs r0, 0x1 + strh r0, [r6, 0xE] + b _0815D59A + .align 2, 0 +_0815D584: .4byte 0x02039b28 +_0815D588: .4byte 0x02038c28 +_0815D58C: .4byte 0x08329f40 +_0815D590: .4byte 0xffff0000 +_0815D594: + ldrh r0, [r6, 0x10] + adds r0, 0x1 + strh r0, [r6, 0x10] +_0815D59A: + ldrh r1, [r6, 0x10] + lsls r1, 8 + ldrh r0, [r6, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0xE + ldrsh r1, [r6, r2] + cmp r1, 0 + bne _0815D63C + movs r3, 0x10 + ldrsh r0, [r6, r3] + cmp r0, 0x10 + bne _0815D63C + strh r1, [r6, 0xC] + strh r1, [r6, 0xE] + b _0815D62E +_0815D5C2: + ldrh r0, [r6, 0x18] + ldrh r7, [r6, 0x16] + adds r0, r7 + strh r0, [r6, 0x16] + b _0815D63C +_0815D5CC: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0815D63C + ldr r1, _0815D5E8 + movs r0, 0x3 + strb r0, [r1, 0x15] + movs r0, 0 + strh r0, [r6, 0xC] + b _0815D62E + .align 2, 0 +_0815D5E8: .4byte 0x02039b28 +_0815D5EC: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815D602 + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + b _0815D608 +_0815D602: + ldrh r0, [r6, 0x10] + subs r0, 0x1 + strh r0, [r6, 0x10] +_0815D608: + ldrh r1, [r6, 0x10] + lsls r1, 8 + ldrh r0, [r6, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _0815D63C + movs r2, 0x10 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0815D63C + strh r0, [r6, 0xC] + strh r0, [r6, 0xE] +_0815D62E: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0815D63C +_0815D636: + adds r0, r4, 0 + bl move_anim_task_del +_0815D63C: + 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_815D398 + + thumb_func_start sub_815D64C +sub_815D64C: @ 815D64C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0815D684 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _0815D688 + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, _0815D68C + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _0815D690 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815D684: .4byte 0x03005e00 +_0815D688: .4byte 0x0203841e +_0815D68C: .4byte 0x085ce5f0 +_0815D690: .4byte sub_815D694 + 1 + thumb_func_end sub_815D64C + + thumb_func_start sub_815D694 +sub_815D694: @ 815D694 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, _0815D6EC + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x14 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _0815D6F8 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D708 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _0815D6F8 + ldr r2, _0815D6F0 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _0815D6F4 + strh r1, [r0, 0x24] + b _0815D708 + .align 2, 0 +_0815D6EC: .4byte 0x03005e00 +_0815D6F0: .4byte 0x02020630 +_0815D6F4: .4byte 0x0000ffff +_0815D6F8: + ldr r2, _0815D728 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_0815D708: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815D720 + adds r0, r4, 0 + bl move_anim_task_del +_0815D720: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815D728: .4byte 0x02020630 + thumb_func_end sub_815D694 + + thumb_func_start sub_815D72C +sub_815D72C: @ 815D72C + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r5, r2, 0 + adds r0, r3, 0 + ldr r4, [sp, 0x14] + ldr r6, [sp, 0x18] + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + mov r2, r8 + strh r1, [r2, 0x20] + strh r5, [r2, 0x22] + lsls r1, 16 + asrs r1, 16 + lsls r2, r1, 4 + mov r3, r8 + strh r2, [r3, 0x36] + lsls r5, 16 + asrs r5, 16 + lsls r2, r5, 4 + strh r2, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + strh r0, [r1, 0x3A] + lsls r4, 16 + asrs r4, 16 + subs r4, r5 + lsls r4, 4 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815D72C + + thumb_func_start sub_815D794 +sub_815D794: @ 815D794 + ldrh r1, [r0, 0x3A] + ldrh r2, [r0, 0x36] + adds r1, r2 + strh r1, [r0, 0x36] + ldrh r2, [r0, 0x3C] + ldrh r3, [r0, 0x38] + adds r2, r3 + strh r2, [r0, 0x38] + lsls r1, 16 + asrs r1, 20 + strh r1, [r0, 0x20] + lsls r2, 16 + asrs r2, 20 + strh r2, [r0, 0x22] + bx lr + thumb_func_end sub_815D794 + + thumb_func_start sub_815D7B4 +sub_815D7B4: @ 815D7B4 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrh r6, [r4, 0x20] + ldrh r5, [r4, 0x22] + bl sub_80A6838 + ldr r0, _0815D7FC + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8008258 + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x22 + ldrsh r2, [r4, r0] + lsls r6, 16 + asrs r6, 16 + lsls r5, 16 + asrs r5, 16 + str r5, [sp] + movs r0, 0x40 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r3, r6, 0 + bl sub_815D72C + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _0815D800 + str r0, [r4, 0x1C] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815D7FC: .4byte 0x0203841e +_0815D800: .4byte sub_815D804 + 1 + thumb_func_end sub_815D7B4 + + thumb_func_start sub_815D804 +sub_815D804: @ 815D804 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r0, 0x2E + ldrsh r4, [r5, r0] + lsls r4, 3 + movs r0, 0xFF + ands r4, r0 + adds r0, r5, 0 + bl sub_815D794 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + strh r0, [r5, 0x26] + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3A + ble _0815D86A + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D86A + movs r0, 0 + strh r0, [r5, 0x30] + ldrh r1, [r5, 0x32] + adds r1, 0x1 + strh r1, [r5, 0x32] + movs r0, 0x1 + ands r1, r0 + adds r3, r5, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + ble _0815D86A + adds r0, r5, 0 + bl move_anim_8074EE0 +_0815D86A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815D804 + + thumb_func_start sub_815D870 +sub_815D870: @ 815D870 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0815D8C8 + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x2E] + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_8008258 + ldr r0, _0815D8CC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815D896 + ldrh r0, [r6, 0x2] + negs r0, r0 + strh r0, [r6, 0x2] +_0815D896: + ldr r4, _0815D8D0 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + ldr r0, _0815D8D4 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815D8C8: .4byte 0x0203841e +_0815D8CC: .4byte 0x02038437 +_0815D8D0: .4byte 0x02038436 +_0815D8D4: .4byte sub_810E2C8 + 1 + thumb_func_end sub_815D870 + + thumb_func_start sub_815D8D8 +sub_815D8D8: @ 815D8D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r2, _0815D928 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + subs r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x14 + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0815D95A + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815D95A + movs r2, 0x1A + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815D92C + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x1A] + negs r0, r0 + strh r0, [r3, 0x10] + b _0815D92E + .align 2, 0 +_0815D928: .4byte 0x03005e00 +_0815D92C: + strh r7, [r3, 0x1A] +_0815D92E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0815D94A + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x1C] + negs r0, r0 + strh r0, [r1, 0x12] + b _0815D94E +_0815D94A: + movs r0, 0 + strh r0, [r1, 0x1C] +_0815D94E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0xA] +_0815D95A: + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldrh r6, [r4, 0x16] + ldrh r7, [r4, 0x18] + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + beq _0815D998 + ldr r3, _0815D994 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsrs r2, r6, 8 + ldrh r0, [r4, 0x1A] + subs r0, r2 + strh r0, [r1, 0x24] + adds r2, r3, 0 + b _0815D9AE + .align 2, 0 +_0815D994: .4byte 0x02020630 +_0815D998: + ldr r2, _0815D9DC + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + lsrs r1, r6, 8 + ldrh r4, [r4, 0x1A] + adds r1, r4 + strh r1, [r0, 0x24] +_0815D9AE: + mov r1, r12 + adds r0, r1, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815D9E0 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r2, r7, 8 + ldrh r0, [r4, 0x1C] + subs r0, r2 + b _0815D9F2 + .align 2, 0 +_0815D9DC: .4byte 0x02020630 +_0815D9E0: + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r0, r7, 8 + ldrh r4, [r4, 0x1C] + adds r0, r4 +_0815D9F2: + strh r0, [r1, 0x26] + mov r2, r12 + adds r0, r2, r5 + lsls r0, 3 + add r0, r8 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + bgt _0815DA12 + adds r0, r5, 0 + bl remove_task + ldr r1, _0815DA1C + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0815DA12: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815DA1C: .4byte 0x020383fe + thumb_func_end sub_815D8D8 + + thumb_func_start sub_815DA20 +sub_815DA20: @ 815DA20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r2, _0815DA74 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + subs r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x14 + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0815DAA6 + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815DAA6 + movs r2, 0x1A + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815DA78 + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x1A] + negs r0, r0 + strh r0, [r3, 0x10] + b _0815DA7A + .align 2, 0 +_0815DA74: .4byte 0x03005e00 +_0815DA78: + strh r7, [r3, 0x1A] +_0815DA7A: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0815DA96 + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x1C] + negs r0, r0 + strh r0, [r1, 0x12] + b _0815DA9A +_0815DA96: + movs r0, 0 + strh r0, [r1, 0x1C] +_0815DA9A: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0xA] +_0815DAA6: + lsls r3, r6, 2 + adds r0, r3, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldrh r2, [r4, 0xC] + ldr r1, _0815DAF8 + adds r0, r1, 0 + ands r0, r2 + ldrh r2, [r4, 0x16] + adds r0, r2 + lsls r5, r0, 16 + lsrs r0, r5, 16 + mov r9, r0 + ldrh r0, [r4, 0xE] + ands r1, r0 + ldrh r2, [r4, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r7, r1, 16 + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r12, r3 + cmp r0, 0 + beq _0815DB00 + ldr r3, _0815DAFC + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsrs r2, r5, 24 + ldrh r0, [r4, 0x1A] + subs r0, r2 + strh r0, [r1, 0x24] + adds r2, r3, 0 + b _0815DB16 + .align 2, 0 +_0815DAF8: .4byte 0x00007fff +_0815DAFC: .4byte 0x02020630 +_0815DB00: + ldr r2, _0815DB44 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + lsrs r1, r5, 24 + ldrh r4, [r4, 0x1A] + adds r1, r4 + strh r1, [r0, 0x24] +_0815DB16: + mov r1, r12 + adds r0, r1, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815DB48 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r2, r7, 8 + ldrh r0, [r4, 0x1C] + subs r0, r2 + b _0815DB5A + .align 2, 0 +_0815DB44: .4byte 0x02020630 +_0815DB48: + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r0, r7, 8 + ldrh r4, [r4, 0x1C] + adds r0, r4 +_0815DB5A: + strh r0, [r1, 0x26] + mov r2, r12 + adds r0, r2, r6 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + mov r0, r9 + strh r0, [r2, 0x16] + strh r7, [r2, 0x18] + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bgt _0815DB80 + movs r0, 0x1E + strh r0, [r2, 0x8] + movs r0, 0 + strh r0, [r2, 0x22] + ldr r0, _0815DB8C + str r0, [r2] +_0815DB80: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815DB8C: .4byte sub_815D8D8 + 1 + thumb_func_end sub_815DA20 + + thumb_func_start sub_815DB90 +sub_815DB90: @ 815DB90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0815DBF0 + mov r8, r0 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldr r1, _0815DBF4 + ldr r2, _0815DBF8 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x26] + ldr r5, _0815DBFC + ldrh r0, [r5] + strh r0, [r4, 0x24] + ldrh r0, [r5] + strh r0, [r4, 0x8] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x22] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0815DBD4 + ldrh r0, [r4, 0x14] + ldr r3, _0815DC00 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r4, 0x14] +_0815DBD4: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815DC04 + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xE] + mov r3, r8 + adds r4, r7, 0 + b _0815DC74 + .align 2, 0 +_0815DBF0: .4byte 0x03005e00 +_0815DBF4: .4byte 0x020241e4 +_0815DBF8: .4byte 0x02038436 +_0815DBFC: .4byte 0x0203841e +_0815DC00: .4byte 0xffff8000 +_0815DC04: + movs r7, 0x2 + ldrsh r0, [r5, r7] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815DC20 + ldrh r1, [r5, 0x2] + ldr r0, _0815DC1C + ands r0, r1 + b _0815DC28 + .align 2, 0 +_0815DC1C: .4byte 0x00007fff +_0815DC20: + ldrh r0, [r5, 0x2] + ldr r2, _0815DC50 + adds r1, r2, 0 + orrs r0, r1 +_0815DC28: + strh r0, [r4, 0xC] + ldr r0, _0815DC54 + movs r3, 0x4 + ldrsh r1, [r0, r3] + movs r2, 0x80 + lsls r2, 8 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0815DC60 + ldr r3, _0815DC58 + lsls r4, r6, 2 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r3 + ldrh r2, [r5, 0x4] + ldr r0, _0815DC5C + ands r0, r2 + b _0815DC72 + .align 2, 0 +_0815DC50: .4byte 0xffff8000 +_0815DC54: .4byte 0x0203841e +_0815DC58: .4byte 0x03005e00 +_0815DC5C: .4byte 0x00007fff +_0815DC60: + ldr r3, _0815DC98 + lsls r4, r6, 2 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r3 + ldrh r2, [r5, 0x4] + ldr r7, _0815DC9C + adds r0, r7, 0 + orrs r0, r2 +_0815DC72: + strh r0, [r1, 0xE] +_0815DC74: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x18] + strh r1, [r0, 0x16] + ldrh r1, [r5, 0x8] + strh r1, [r0, 0x10] + ldrh r1, [r5, 0xA] + strh r1, [r0, 0x12] + ldr r1, _0815DCA0 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815DC98: .4byte 0x03005e00 +_0815DC9C: .4byte 0xffff8000 +_0815DCA0: .4byte sub_815DA20 + 1 + thumb_func_end sub_815DB90 + + thumb_func_start sub_815DCA4 +sub_815DCA4: @ 815DCA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0815DCDC + adds r5, r0, r1 + ldr r4, _0815DCE0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DCC4 + adds r0, r2, 0 + bl move_anim_task_del +_0815DCC4: + movs r0, 0 + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0xE] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DCE8 + ldr r0, _0815DCE4 + b _0815DCEA + .align 2, 0 +_0815DCDC: .4byte 0x03005e00 +_0815DCE0: .4byte 0x0203841e +_0815DCE4: .4byte 0x02038436 +_0815DCE8: + ldr r0, _0815DD38 +_0815DCEA: + ldrb r4, [r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + adds r0, r4, 0 + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldr r0, _0815DD3C + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r5, 0x26] + ldr r2, _0815DD40 + adds r0, r5, 0 + bl sub_80A7CFC + ldr r0, _0815DD44 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815DD38: .4byte 0x02038437 +_0815DD3C: .4byte 0x0203841e +_0815DD40: .4byte 0x085ce74c +_0815DD44: .4byte sub_815DD48 + 1 + thumb_func_end sub_815DCA4 + + thumb_func_start sub_815DD48 +sub_815DD48: @ 815DD48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0815DD68 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815DD6C + cmp r0, 0x1 + beq _0815DDCC + b _0815DDDA + .align 2, 0 +_0815DD68: .4byte 0x03005e00 +_0815DD6C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815DD82 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_815DDE0 +_0815DD82: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bne _0815DD92 + adds r0, r5, 0 + movs r1, 0 + bl sub_815DDE0 +_0815DD92: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0815DDDA + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0815DDB4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815DDDA +_0815DDB4: + strh r1, [r4, 0xA] + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815DDC8 + adds r0, r4, 0 + bl sub_80A7CFC + b _0815DDDA + .align 2, 0 +_0815DDC8: .4byte 0x085ce74c +_0815DDCC: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DDDA + adds r0, r5, 0 + bl move_anim_task_del +_0815DDDA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815DD48 + + thumb_func_start sub_815DDE0 +sub_815DDE0: @ 815DDE0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r2, _0815DE04 + adds r4, r0, r2 + cmp r1, 0 + bne _0815DE08 + movs r1, 0x12 + movs r3, 0xEC + b _0815DE0C + .align 2, 0 +_0815DE04: .4byte 0x03005e00 +_0815DE08: + movs r1, 0x1E + movs r3, 0x14 +_0815DE0C: + mov r2, sp + ldrh r0, [r4, 0x10] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x10] + subs r0, r1 + subs r0, 0x4 + strh r0, [r2, 0x2] + ldrh r0, [r4, 0x10] + adds r0, r1 + strh r0, [r2, 0x4] + ldrh r0, [r4, 0x10] + adds r0, r1 + adds r0, 0x4 + strh r0, [r2, 0x6] + add r2, sp, 0x8 + lsls r1, r3, 24 + asrs r1, 24 + ldrh r0, [r4, 0x12] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x12] + adds r0, r1 + adds r0, 0x6 + strh r0, [r2, 0x2] + movs r5, 0 + mov r8, r2 + ldr r7, _0815DEB0 +_0815DE44: + lsls r0, r5, 1 + add r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + ands r0, r5 + lsls r0, 1 + add r0, r8 + movs r3, 0 + ldrsh r2, [r0, r3] + ldrb r3, [r4, 0x14] + subs r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _0815DEB4 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0815DE98 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r7 + movs r0, 0 + strh r0, [r1, 0x2E] + movs r0, 0x2 + cmp r5, 0x1 + bhi _0815DE86 + movs r2, 0x2 + negs r2, r2 + adds r0, r2, 0 +_0815DE86: + strh r0, [r1, 0x30] + ldr r0, _0815DEB8 + strh r0, [r1, 0x32] + strh r6, [r1, 0x34] + movs r0, 0x2 + strh r0, [r1, 0x36] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0815DE98: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0815DE44 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815DEB0: .4byte 0x02020630 +_0815DEB4: .4byte 0x085ce76c +_0815DEB8: .4byte 0x0000ffff + thumb_func_end sub_815DDE0 + + thumb_func_start sub_815DEBC +sub_815DEBC: @ 815DEBC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _0815DF02 + ldr r3, _0815DF08 + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x34 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0815DF02: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815DF08: .4byte 0x03005e00 + thumb_func_end sub_815DEBC + + thumb_func_start sub_815DF0C +sub_815DF0C: @ 815DF0C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0815DF54 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r1, _0815DF58 + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xA] + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0815DF5C + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0xC] + ldr r0, _0815DF60 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815DF54: .4byte 0x03005e00 +_0815DF58: .4byte 0x0203841e +_0815DF5C: .4byte 0x02020630 +_0815DF60: .4byte sub_815DF64 + 1 + thumb_func_end sub_815DF0C + + thumb_func_start sub_815DF64 +sub_815DF64: @ 815DF64 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0815DFAC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815DFB4 + ldrh r0, [r4, 0xC] + ldr r2, _0815DFB0 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r1, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0x8 + bl pal_fade_1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _0815DFA4 + movs r0, 0 + strh r0, [r4, 0x8] +_0815DFA4: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + b _0815DFC6 + .align 2, 0 +_0815DFAC: .4byte 0x03005e00 +_0815DFB0: .4byte 0x085ce784 +_0815DFB4: + ldrh r0, [r4, 0xC] + movs r1, 0x10 + movs r2, 0 + movs r3, 0 + bl pal_fade_1 + adds r0, r5, 0 + bl move_anim_task_del +_0815DFC6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815DF64 + + thumb_func_start sub_815DFCC +sub_815DFCC: @ 815DFCC + push {lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xD0 + lsls r2, 1 + ldr r1, _0815E008 + ldrb r3, [r1] + ldr r1, _0815E00C + ldrb r1, [r1] + str r1, [sp] + movs r1, 0xA + str r1, [sp, 0x4] + movs r1, 0x2 + str r1, [sp, 0x8] + movs r1, 0x1E + str r1, [sp, 0xC] + ldr r1, _0815E010 + str r1, [sp, 0x10] + ldr r1, _0815E014 + str r1, [sp, 0x14] + ldr r1, _0815E018 + str r1, [sp, 0x18] + movs r1, 0 + bl sub_8117854 + add sp, 0x1C + pop {r0} + bx r0 + .align 2, 0 +_0815E008: .4byte 0x02038436 +_0815E00C: .4byte 0x0203841e +_0815E010: .4byte 0x08c2dc68 +_0815E014: .4byte 0x08c2ddc4 +_0815E018: .4byte 0x08c2dda4 + thumb_func_end sub_815DFCC + + thumb_func_start sub_815E01C +sub_815E01C: @ 815E01C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, _0815E074 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815E038 + ldr r1, _0815E078 + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0815E038: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, _0815E078 + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815E080 + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] + ldr r0, _0815E07C + strh r0, [r5, 0x30] + b _0815E0A8 + .align 2, 0 +_0815E074: .4byte 0x02038436 +_0815E078: .4byte 0x0203841e +_0815E07C: .4byte 0x0000fd80 +_0815E080: + cmp r0, 0x1 + bne _0815E09A + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + b _0815E0A8 +_0815E09A: + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] +_0815E0A8: + ldr r0, _0815E0D4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815E0C8 + ldrh r0, [r5, 0x2E] + negs r0, r0 + strh r0, [r5, 0x2E] + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0815E0C8: + ldr r0, _0815E0D8 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815E0D4: .4byte 0x02038436 +_0815E0D8: .4byte sub_815E0DC + 1 + thumb_func_end sub_815E01C + + thumb_func_start sub_815E0DC +sub_815E0DC: @ 815E0DC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x3A] + adds r0, r1 + strh r0, [r2, 0x3A] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x3C] + adds r1, r3 + strh r1, [r2, 0x3C] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r2, 0x26] + ldrh r0, [r2, 0x38] + adds r0, 0x1 + strh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bne _0815E110 + adds r0, r2, 0 + bl move_anim_8072740 +_0815E110: + pop {r0} + bx r0 + thumb_func_end sub_815E0DC + + thumb_func_start sub_815E114 +sub_815E114: @ 815E114 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0815E140 + adds r6, r1, r0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0815E144 + movs r0, 0x8 + strh r0, [r6, 0x12] + movs r0, 0x3 + strh r0, [r6, 0x14] + movs r0, 0x1 + strh r0, [r6, 0x16] + b _0815E14E + .align 2, 0 +_0815E140: .4byte 0x03005e00 +_0815E144: + movs r0, 0xC + strh r0, [r6, 0x12] + movs r0, 0x3 + strh r0, [r6, 0x14] + strh r1, [r6, 0x16] +_0815E14E: + ldr r5, _0815E184 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815E188 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E17C + adds r0, 0x3 +_0815E17C: + asrs r0, 2 + adds r0, r4, r0 + b _0815E1AC + .align 2, 0 +_0815E184: .4byte 0x02038436 +_0815E188: + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E1A8 + adds r0, 0x3 +_0815E1A8: + asrs r0, 2 + subs r0, r4, r0 +_0815E1AC: + strh r0, [r6, 0x1E] + ldr r5, _0815E200 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E1D0 + adds r0, 0x3 +_0815E1D0: + asrs r0, 2 + subs r0, r4, r0 + strh r0, [r6, 0x20] + ldr r4, _0815E204 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x24] + ldr r0, _0815E208 + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815E200: .4byte 0x02038436 +_0815E204: .4byte 0x02038437 +_0815E208: .4byte sub_815E20C + 1 + thumb_func_end sub_815E114 + + thumb_func_start sub_815E20C +sub_815E20C: @ 815E20C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0815E234 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0815E238 + cmp r1, 0x1 + bne _0815E230 + b _0815E330 +_0815E230: + b _0815E33E + .align 2, 0 +_0815E234: .4byte 0x03005e00 +_0815E238: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0815E33E + strh r1, [r5, 0xA] + movs r1, 0x1E + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + movs r4, 0x24 + ldrsh r3, [r5, r4] + ldrb r4, [r5, 0x12] + str r4, [sp] + ldrb r4, [r5, 0xC] + str r4, [sp, 0x4] + add r4, sp, 0x10 + str r4, [sp, 0x8] + adds r4, 0x2 + str r4, [sp, 0xC] + bl sub_815E34C + movs r6, 0 + mov r8, r4 + ldr r4, _0815E2AC +_0815E272: + add r0, sp, 0x10 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, _0815E2B0 + movs r3, 0x23 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0815E306 + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815E2C6 + cmp r6, 0 + bne _0815E2B4 + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + negs r0, r0 + strh r0, [r1, 0x26] + strh r0, [r1, 0x24] + b _0815E2EE + .align 2, 0 +_0815E2AC: .4byte 0x02020630 +_0815E2B0: .4byte 0x085ce7ec +_0815E2B4: + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x26] + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x24] + b _0815E2EE +_0815E2C6: + cmp r6, 0 + bne _0815E2DC + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r5, 0x14] + b _0815E2EC +_0815E2DC: + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x24] + ldrh r0, [r5, 0x14] + negs r0, r0 +_0815E2EC: + strh r0, [r1, 0x26] +_0815E2EE: + ldr r1, _0815E32C + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2E] + strh r7, [r0, 0x30] + movs r1, 0xA + strh r1, [r0, 0x32] + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] +_0815E306: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bls _0815E272 + ldrh r2, [r5, 0xC] + movs r3, 0xC + ldrsh r1, [r5, r3] + movs r4, 0x12 + ldrsh r0, [r5, r4] + cmp r1, r0 + bne _0815E324 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0815E324: + adds r0, r2, 0x1 + strh r0, [r5, 0xC] + b _0815E33E + .align 2, 0 +_0815E32C: .4byte 0x02020630 +_0815E330: + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815E33E + adds r0, r7, 0 + bl move_anim_task_del +_0815E33E: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E20C + + thumb_func_start sub_815E34C +sub_815E34C: @ 815E34C + 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] + mov r9, r6 + ldr r6, [sp, 0x34] + mov r10, r6 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r2, 16 + lsrs r2, 16 + adds r7, r2, 0 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + cmp r5, 0 + bne _0815E394 + mov r2, r9 + strh r0, [r2] + mov r6, r10 + strh r1, [r6] + b _0815E3F2 +_0815E394: + cmp r5, r6 + bcc _0815E3A2 + mov r0, r9 + strh r2, [r0] + mov r1, r10 + strh r3, [r1] + b _0815E3F2 +_0815E3A2: + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r2, r12 + lsls r1, r2, 16 + asrs r1, 16 + lsls r5, r1, 8 + lsls r0, r7, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 8 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r5, r0 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + lsls r4, r1, 8 + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 8 + adds r1, r6, 0 + bl __divsi3 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + adds r4, r0 + asrs r5, 8 + mov r0, r9 + strh r5, [r0] + asrs r4, 8 + mov r1, r10 + strh r4, [r1] +_0815E3F2: + 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_815E34C + + thumb_func_start sub_815E404 +sub_815E404: @ 815E404 + 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, 0x24 + ble _0815E43A + ldr r3, _0815E440 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0815E43A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815E440: .4byte 0x03005e00 + thumb_func_end sub_815E404 + + thumb_func_start sub_815E444 +sub_815E444: @ 815E444 + push {r4,lr} + adds r4, r0, 0 + ldr r1, _0815E470 + ldrh r0, [r1] + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldr r1, _0815E474 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, _0815E478 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815E470: .4byte 0x0203841e +_0815E474: .4byte move_anim_8072740 + 1 +_0815E478: .4byte sub_80A70C0 + 1 + thumb_func_end sub_815E444 + + thumb_func_start sub_815E47C +sub_815E47C: @ 815E47C + 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 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + ldr r1, _0815E59C + adds r7, r0, r1 + ldr r0, _0815E5A0 + mov r10, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x1E] + mov r1, r10 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x20] + ldr r0, _0815E5A4 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x22] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + mov r1, r8 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E4EE + adds r0, 0x3 +_0815E4EE: + asrs r0, 2 + adds r0, r4, r0 + strh r0, [r7, 0x24] + ldr r4, _0815E5A8 + movs r0, 0x1E + ldrsh r5, [r7, r0] + movs r1, 0x20 + ldrsh r6, [r7, r1] + mov r1, r8 + ldrb r0, [r1] + bl sub_80A82E4 + adds r3, r0, 0 + subs r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x26] + cmp r0, 0x40 + beq _0815E5B8 + ldr r4, _0815E5AC + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x10 + strh r1, [r0, 0x2E] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r7, 0x22] + strh r1, [r0, 0x32] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r7, 0x24] + strh r1, [r0, 0x36] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _0815E5B0 + strh r1, [r0, 0x38] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_80A68D4 + mov r1, r10 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815E596 + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl sub_8008258 +_0815E596: + ldr r0, _0815E5B4 + str r0, [r7] + b _0815E5BE + .align 2, 0 +_0815E59C: .4byte 0x03005e00 +_0815E5A0: .4byte 0x02038436 +_0815E5A4: .4byte 0x02038437 +_0815E5A8: .4byte 0x085ce84c +_0815E5AC: .4byte 0x02020630 +_0815E5B0: .4byte 0x0000ffe0 +_0815E5B4: .4byte sub_815E5CC + 1 +_0815E5B8: + mov r0, r9 + bl move_anim_task_del +_0815E5BE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E47C + + thumb_func_start sub_815E5CC +sub_815E5CC: @ 815E5CC + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0815E5F0 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0815E634 + cmp r1, 0x1 + bgt _0815E5F4 + cmp r1, 0 + beq _0815E5FE + b _0815E6D2 + .align 2, 0 +_0815E5F0: .4byte 0x03005e00 +_0815E5F4: + cmp r1, 0x2 + beq _0815E658 + cmp r1, 0x3 + beq _0815E6CC + b _0815E6D2 +_0815E5FE: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E6D2 + strh r1, [r4, 0xA] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0815E630 + adds r0, r1 + bl sub_80A6900 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0815E6D2 + b _0815E6BE + .align 2, 0 +_0815E630: .4byte 0x02020630 +_0815E634: + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0815E654 + adds r0, r1 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0815E6D2 + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _0815E6BE + .align 2, 0 +_0815E654: .4byte 0x02020630 +_0815E658: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E6D2 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r2, [r4, 0xC] + adds r2, 0x1 + strh r2, [r4, 0xC] + ldr r5, _0815E6C8 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x1 + ands r2, r0 + adds r1, 0x3E + lsls r2, 2 + ldrb r3, [r1] + subs r0, 0x6 + ands r0, r3 + orrs r0, r2 + strb r0, [r1] + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _0815E6D2 + movs r0, 0x26 + ldrsh r1, [r4, 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 r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles +_0815E6BE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815E6D2 + .align 2, 0 +_0815E6C8: .4byte 0x02020630 +_0815E6CC: + adds r0, r2, 0 + bl move_anim_task_del +_0815E6D2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815E5CC + + thumb_func_start sub_815E6D8 +sub_815E6D8: @ 815E6D8 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, _0815E6EC + movs r2, 0 + ldrsh r1, [r0, r2] + adds r6, r0, 0 + cmp r1, 0 + bne _0815E6F4 + ldr r0, _0815E6F0 + b _0815E6F6 + .align 2, 0 +_0815E6EC: .4byte 0x0203841e +_0815E6F0: .4byte 0x02038436 +_0815E6F4: + ldr r0, _0815E75C +_0815E6F6: + ldrb r5, [r0] + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, _0815E760 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0815E764 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r1, r6, 0 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x3A] + movs r2, 0x2 + ldrsh r0, [r1, r2] + movs r1, 0x1 + cmp r0, 0 + bne _0815E724 + movs r3, 0x1 + negs r3, r3 + adds r1, r3, 0 +_0815E724: + strh r1, [r4, 0x3C] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815E768 + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + subs r0, 0x8 + b _0815E772 + .align 2, 0 +_0815E75C: .4byte 0x02038437 +_0815E760: .4byte 0x000003ff +_0815E764: .4byte 0xfffffc00 +_0815E768: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + adds r0, 0x8 +_0815E772: + strh r0, [r4, 0x20] + ldr r0, _0815E780 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815E780: .4byte sub_815E784 + 1 + thumb_func_end sub_815E6D8 + + thumb_func_start sub_815E784 +sub_815E784: @ 815E784 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + cmp r1, 0x1 + beq _0815E7CC + cmp r1, 0x1 + bgt _0815E79A + cmp r1, 0 + beq _0815E7A4 + b _0815E83C +_0815E79A: + cmp r1, 0x2 + beq _0815E7DC + cmp r1, 0x3 + beq _0815E802 + b _0815E83C +_0815E7A4: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E83C + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x3C] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0815E83C + b _0815E7FA +_0815E7CC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0815E83C + b _0815E7F6 +_0815E7DC: + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r1, 2 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815E83C +_0815E7F6: + movs r0, 0 + strh r0, [r2, 0x30] +_0815E7FA: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _0815E83C +_0815E802: + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0815E83C + ldrh r0, [r2, 0x3A] + subs r0, 0x1 + strh r0, [r2, 0x3A] + lsls r0, 16 + cmp r0, 0 + beq _0815E836 + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + b _0815E83C +_0815E836: + adds r0, r2, 0 + bl move_anim_8072740 +_0815E83C: + pop {r0} + bx r0 + thumb_func_end sub_815E784 + + thumb_func_start sub_815E840 +sub_815E840: @ 815E840 + push {r4,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, _0815E858 + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0815E85C + adds r0, r1, 0 + bl move_anim_task_del + b _0815E884 + .align 2, 0 +_0815E858: .4byte 0x0203841e +_0815E85C: + ldr r0, _0815E88C + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x8] + ldrb r0, [r2] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, _0815E890 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _0815E894 + str r0, [r4] +_0815E884: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815E88C: .4byte 0x03005e00 +_0815E890: .4byte 0x085ce87c +_0815E894: .4byte sub_815E898 + 1 + thumb_func_end sub_815E840 + + thumb_func_start sub_815E898 +sub_815E898: @ 815E898 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0815E8D8 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E8F2 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815E8E0 + ldr r2, _0815E8DC + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + b _0815E8F0 + .align 2, 0 +_0815E8D8: .4byte 0x03005e00 +_0815E8DC: .4byte 0x02020630 +_0815E8E0: + ldr r2, _0815E938 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _0815E93C +_0815E8F0: + strh r1, [r0, 0x24] +_0815E8F2: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0815E94E + ldr r2, _0815E938 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + cmp r0, 0 + beq _0815E948 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0815E940 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _0815E944 + bl sub_80A7CFC + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + b _0815E94E + .align 2, 0 +_0815E938: .4byte 0x02020630 +_0815E93C: .4byte 0x0000fffe +_0815E940: .4byte 0x03005e00 +_0815E944: .4byte 0x085ce87c +_0815E948: + adds r0, r6, 0 + bl move_anim_task_del +_0815E94E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815E898 + + thumb_func_start sub_815E954 +sub_815E954: @ 815E954 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0815E968 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815E970 + ldr r4, _0815E96C + b _0815E972 + .align 2, 0 +_0815E968: .4byte 0x0203841e +_0815E96C: .4byte 0x02038436 +_0815E970: + ldr r4, _0815E9B0 +_0815E972: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + movs r1, 0x22 + ldrsh r0, [r5, r1] + cmp r0, 0x7 + bgt _0815E996 + movs r0, 0x8 + strh r0, [r5, 0x22] +_0815E996: + movs r2, 0 + strh r2, [r5, 0x2E] + ldr r1, _0815E9B4 + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x30] + strh r2, [r5, 0x32] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x34] + ldr r0, _0815E9B8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815E9B0: .4byte 0x02038437 +_0815E9B4: .4byte 0x0203841e +_0815E9B8: .4byte sub_815E9BC + 1 + thumb_func_end sub_815E954 + + thumb_func_start sub_815E9BC +sub_815E9BC: @ 815E9BC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r3, r2] + cmp r0, r1 + blt _0815EA10 + movs r0, 0 + strh r0, [r3, 0x2E] + ldrh r1, [r3, 0x32] + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + strh r1, [r3, 0x32] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + lsls r1, 2 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _0815EA10 + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _0815EA10 + adds r0, r3, 0 + bl move_anim_8072740 +_0815EA10: + pop {r0} + bx r0 + thumb_func_end sub_815E9BC + + thumb_func_start sub_815EA14 +sub_815EA14: @ 815EA14 + push {lr} + adds r3, r0, 0 + ldr r0, _0815EA40 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815EA44 + ldrb r2, [r3, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + movs r0, 0x64 + strh r0, [r3, 0x20] + movs r0, 0x1 + b _0815EA4A + .align 2, 0 +_0815EA40: .4byte 0x0203841e +_0815EA44: + movs r0, 0x8C + strh r0, [r3, 0x20] + ldr r0, _0815EA58 +_0815EA4A: + strh r0, [r3, 0x3C] + movs r0, 0x38 + strh r0, [r3, 0x22] + ldr r0, _0815EA5C + str r0, [r3, 0x1C] + pop {r0} + bx r0 + .align 2, 0 +_0815EA58: .4byte 0x0000ffff +_0815EA5C: .4byte sub_815EA60 + 1 + thumb_func_end sub_815EA14 + + thumb_func_start sub_815EA60 +sub_815EA60: @ 815EA60 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bls _0815EA6E + b _0815EC40 +_0815EA6E: + lsls r0, 2 + ldr r1, _0815EA78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815EA78: .4byte _0815EA7C + .align 2, 0 +_0815EA7C: + .4byte _0815EAA0 + .4byte _0815EAD2 + .4byte _0815EAE4 + .4byte _0815EB24 + .4byte _0815EB36 + .4byte _0815EB74 + .4byte _0815EBD8 + .4byte _0815EBF8 + .4byte _0815EC1E +_0815EAA0: + movs r3, 0x3C + ldrsh r0, [r4, r3] + lsls r0, 1 + ldrh r1, [r4, 0x22] + subs r1, r0 + strh r1, [r4, 0x22] + ldrh r2, [r4, 0x30] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0815EAC2 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] +_0815EAC2: + adds r0, r2, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + beq _0815EAD0 + b _0815EC40 +_0815EAD0: + b _0815EC12 +_0815EAD2: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0815EAE2 + b _0815EC40 +_0815EAE2: + b _0815EC12 +_0815EAE4: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r3, 0x3C + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r3, _0815EB20 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xC + beq _0815EB1C + b _0815EC40 +_0815EB1C: + b _0815EC12 + .align 2, 0 +_0815EB20: .4byte 0x08329f40 +_0815EB24: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + beq _0815EB34 + b _0815EC40 +_0815EB34: + b _0815EC12 +_0815EB36: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x22] + subs r0, r1 + strh r0, [r4, 0x22] + ldr r3, _0815EB70 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xC + bne _0815EC40 + b _0815EC16 + .align 2, 0 +_0815EB70: .4byte 0x08329f40 +_0815EB74: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r3, 0x3C + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r3, _0815EBCC + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xF + bne _0815EBC0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, _0815EBD0 + adds r0, r3, 0 + ands r1, r0 + ldr r0, _0815EBD4 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] +_0815EBC0: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bne _0815EC40 + b _0815EC12 + .align 2, 0 +_0815EBCC: .4byte 0x08329f40 +_0815EBD0: .4byte 0x000003ff +_0815EBD4: .4byte 0xfffffc00 +_0815EBD8: + movs r3, 0x3C + ldrsh r0, [r4, r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x20] + adds r1, r0 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815EC40 + b _0815EC12 +_0815EBF8: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 1 + ldrh r3, [r4, 0x20] + adds r0, r3 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0815EC40 +_0815EC12: + movs r0, 0 + strh r0, [r4, 0x30] +_0815EC16: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815EC40 +_0815EC1E: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x20] + subs 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, 0x5 + bne _0815EC40 + adds r0, r4, 0 + bl move_anim_8072740 +_0815EC40: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815EA60 + + thumb_func_start sub_815EC48 +sub_815EC48: @ 815EC48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0815ECA4 + adds r6, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815ECD0 + bl battle_type_is_double + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x1 + bne _0815ECB4 + ldr r5, _0815ECA8 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815ECAC + strh r7, [r6, 0x24] + b _0815ECD4 + .align 2, 0 +_0815ECA4: .4byte 0x03005e00 +_0815ECA8: .4byte 0x02038436 +_0815ECAC: + ldr r0, _0815ECB0 + b _0815ECD2 + .align 2, 0 +_0815ECB0: .4byte 0x0000ffff +_0815ECB4: + ldr r0, _0815ECC8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815ECD0 + ldr r0, _0815ECCC + b _0815ECD2 + .align 2, 0 +_0815ECC8: .4byte 0x02038436 +_0815ECCC: .4byte 0x0000ffff +_0815ECD0: + movs r0, 0x1 +_0815ECD2: + strh r0, [r6, 0x24] +_0815ECD4: + ldr r0, _0815ECE0 + str r0, [r6] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815ECE0: .4byte sub_815ECE4 + 1 + thumb_func_end sub_815EC48 + + thumb_func_start sub_815ECE4 +sub_815ECE4: @ 815ECE4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0815ED08 + adds r3, r0, r1 + movs r1, 0x8 + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bls _0815ECFE + b _0815EE78 +_0815ECFE: + lsls r0, 2 + ldr r1, _0815ED0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815ED08: .4byte 0x03005e00 +_0815ED0C: .4byte _0815ED10 + .align 2, 0 +_0815ED10: + .4byte _0815ED34 + .4byte _0815ED46 + .4byte _0815ED78 + .4byte _0815EDA8 + .4byte _0815EDCE + .4byte _0815EDF8 + .4byte _0815EE08 + .4byte _0815EE28 + .4byte _0815EE60 +_0815ED34: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + beq _0815ED44 + b _0815EE78 +_0815ED44: + b _0815EE50 +_0815ED46: + ldr r2, _0815ED74 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x24 + ldrsh r0, [r3, r2] + lsls r2, r0, 1 + adds r2, r0 + ldrh r0, [r1, 0x24] + subs r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _0815ED72 + b _0815EE78 +_0815ED72: + b _0815EE50 + .align 2, 0 +_0815ED74: .4byte 0x02020630 +_0815ED78: + ldr r2, _0815EDA4 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x24 + ldrsh r2, [r3, r0] + lsls r0, r2, 1 + adds r0, r2 + ldrh r2, [r1, 0x24] + adds r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815EE78 + b _0815EE50 + .align 2, 0 +_0815EDA4: .4byte 0x02020630 +_0815EDA8: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0815EE78 + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r1, [r3, 0xC] + movs r2, 0xC + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815EE54 + adds r0, r1, 0x1 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0x8] + b _0815EE78 +_0815EDCE: + ldr r2, _0815EDF4 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x24] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0815EE78 + b _0815EE50 + .align 2, 0 +_0815EDF4: .4byte 0x02020630 +_0815EDF8: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815EE78 + b _0815EE50 +_0815EE08: + ldr r2, _0815EE24 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x24 + ldrsh r2, [r3, r0] + lsls r2, 2 + ldrh r0, [r1, 0x24] + subs r0, r2 + b _0815EE40 + .align 2, 0 +_0815EE24: .4byte 0x02020630 +_0815EE28: + ldr r2, _0815EE5C + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x24 + ldrsh r0, [r3, r2] + lsls r0, 2 + ldrh r2, [r1, 0x24] + adds r0, r2 +_0815EE40: + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815EE78 +_0815EE50: + movs r0, 0 + strh r0, [r3, 0xA] +_0815EE54: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _0815EE78 + .align 2, 0 +_0815EE5C: .4byte 0x02020630 +_0815EE60: + ldr r2, _0815EE80 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_task_del +_0815EE78: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815EE80: .4byte 0x02020630 + thumb_func_end sub_815ECE4 + + thumb_func_start sub_815EE84 +sub_815EE84: @ 815EE84 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _0815EEA0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815EEA8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, _0815EEA4 + b _0815EEAA + .align 2, 0 +_0815EEA0: .4byte 0x0203841e +_0815EEA4: .4byte 0x02038436 +_0815EEA8: + ldr r0, _0815EF00 +_0815EEAA: + ldrb r0, [r0] + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815EECE + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r4, 0x3] +_0815EECE: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r0, [r4, 0x1] + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x1] + ldr r0, _0815EF04 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815EF00: .4byte 0x02038437 +_0815EF04: .4byte sub_815EF08 + 1 + thumb_func_end sub_815EE84 + + thumb_func_start sub_815EF08 +sub_815EF08: @ 815EF08 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _0815EF16 + b _0815F106 +_0815EF16: + lsls r0, 2 + ldr r1, _0815EF20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815EF20: .4byte _0815EF24 + .align 2, 0 +_0815EF24: + .4byte _0815EF38 + .4byte _0815F038 + .4byte _0815F0A0 + .4byte _0815F0B4 + .4byte _0815F100 +_0815EF38: + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bhi _0815EF68 + lsls r0, 2 + ldr r1, _0815EF4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815EF4C: .4byte _0815EF50 + .align 2, 0 +_0815EF50: + .4byte _0815EF6C + .4byte _0815EF88 + .4byte _0815EFAA + .4byte _0815EFC6 + .4byte _0815EF6C + .4byte _0815EFEC +_0815EF68: + movs r0, 0 + strh r0, [r4, 0x3A] +_0815EF6C: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + b _0815EFE0 +_0815EF88: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x4 + b _0815EFE6 +_0815EFAA: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + b _0815EFE0 +_0815EFC6: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 +_0815EFE0: + bl sub_80A861C + subs r0, 0x4 +_0815EFE6: + lsls r0, 16 + lsrs r1, r0, 16 + b _0815F00C +_0815EFEC: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r1, r0, 24 +_0815F00C: + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x4 + bne _0815F018 + movs r0, 0x18 + b _0815F022 +_0815F018: + cmp r0, 0x5 + bne _0815F020 + movs r0, 0x6 + b _0815F022 +_0815F020: + movs r0, 0xC +_0815F022: + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + strh r1, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + b _0815F0F8 +_0815F038: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0815F106 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0815F070 + cmp r0, 0x5 + beq _0815F090 + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0815F088 +_0815F070: + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x38] +_0815F088: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _0815F106 +_0815F090: + movs r0, 0 + strh r0, [r4, 0x2E] + movs r1, 0x10 + strh r1, [r4, 0x30] + strh r0, [r4, 0x32] + movs r0, 0x3 + strh r0, [r4, 0x38] + b _0815F106 +_0815F0A0: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815F106 + movs r0, 0 + strh r0, [r4, 0x38] + b _0815F106 +_0815F0B4: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F0C6 + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + b _0815F0CC +_0815F0C6: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0815F0CC: + ldrh r1, [r4, 0x32] + lsls r1, 8 + ldrh r0, [r4, 0x30] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + bne _0815F106 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815F0F8: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0815F106 +_0815F100: + adds r0, r4, 0 + bl move_anim_8072740 +_0815F106: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815EF08 + + thumb_func_start sub_815F10C +sub_815F10C: @ 815F10C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x38 + ldrsh r1, [r4, r2] + muls r0, r1 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + adds r5, r0, 0 + strh r5, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x38 + ldrsh r1, [r4, r2] + muls r0, r1 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + adds r3, r0, 0 + strh r3, [r4, 0x26] + ldrh r1, [r4, 0x38] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F16A + ldr r0, _0815F188 + ldrh r1, [r4, 0x20] + adds r1, r5 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x22] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x5 + bl obj_add_from_template_forward_search +_0815F16A: + movs r0, 0x38 + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0815F17C + adds r0, r4, 0 + bl move_anim_8072740 +_0815F17C: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815F188: .4byte 0x085ce3a0 + thumb_func_end sub_815F10C + + thumb_func_start sub_815F18C +sub_815F18C: @ 815F18C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0815F1C8 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815F1B8 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815F1D0 +_0815F1B8: + ldr r2, _0815F1CC + ldrh r1, [r5, 0x20] + ldrh r0, [r2] + subs r0, r1, r0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + subs r1, r0 + b _0815F1DE + .align 2, 0 +_0815F1C8: .4byte 0x02038437 +_0815F1CC: .4byte 0x0203841e +_0815F1D0: + ldr r2, _0815F204 + ldrh r1, [r5, 0x20] + ldrh r0, [r2] + adds r0, r1, r0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + adds r1, r0 +_0815F1DE: + strh r1, [r5, 0x32] + adds r3, r2, 0 + ldrh r1, [r5, 0x22] + ldrh r2, [r3, 0x2] + adds r2, r1, r2 + strh r2, [r5, 0x30] + ldrh r0, [r3, 0x6] + adds r1, r0 + strh r1, [r5, 0x34] + ldrh r0, [r3, 0x8] + strh r0, [r5, 0x36] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x20] + strh r2, [r5, 0x22] + ldr r0, _0815F208 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815F204: .4byte 0x0203841e +_0815F208: .4byte sub_815F10C + 1 + thumb_func_end sub_815F18C + + thumb_func_start sub_815F20C +sub_815F20C: @ 815F20C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r0, _0815F250 + mov r9, r0 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r0, 3 + mov r8, r0 + mov r4, r8 + add r4, r9 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815F254 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _0815F2A0 + .align 2, 0 +_0815F250: .4byte 0x03005e00 +_0815F254: + cmp r0, 0x1 + bne _0815F2AC + ldrh r0, [r4, 0xA] + adds r0, 0x60 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + subs r0, 0xD + strh r0, [r4, 0xC] + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r0, 0xC + ldrsh r2, [r4, r0] + adds r0, r5, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815F310 + movs r0, 0 + strh r0, [r4, 0xE] + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, _0815F2A8 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0815F2A0: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815F310 + .align 2, 0 +_0815F2A8: .4byte 0x02020630 +_0815F2AC: + ldr r4, _0815F31C + ldrb r0, [r4] + movs r1, 0 + bl refresh_graphics_maybe + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815F2EE + ldr r3, _0815F320 + ldr r2, _0815F324 + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, _0815F328 + str r1, [r0] + 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 + bl sub_8008258 +_0815F2EE: + mov r4, r9 + adds r3, r7, 0 + ldr r5, _0815F32C + movs r1, 0xF + mov r2, r8 + adds r0, r4, r2 + adds r0, 0x26 + movs r2, 0 +_0815F2FE: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0815F2FE + adds r0, r3, r6 + lsls r0, 3 + adds r0, r4 + str r5, [r0] +_0815F310: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815F31C: .4byte 0x02038436 +_0815F320: .4byte 0x02020630 +_0815F324: .4byte 0x020241e4 +_0815F328: .4byte 0x082ff6c0 +_0815F32C: .4byte sub_815F330 + 1 + thumb_func_end sub_815F20C + + thumb_func_start sub_815F330 +sub_815F330: @ 815F330 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _0815F35C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _0815F394 + cmp r5, 0x1 + bgt _0815F360 + cmp r5, 0 + beq _0815F36A + b _0815F482 + .align 2, 0 +_0815F35C: .4byte 0x03005e00 +_0815F360: + cmp r5, 0x2 + beq _0815F400 + cmp r5, 0x3 + beq _0815F43C + b _0815F482 +_0815F36A: + ldr r0, _0815F38C + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldr r0, _0815F390 + strh r0, [r1, 0x26] + movs r0, 0xC8 + strh r0, [r1, 0x24] + adds r1, 0x3E + ldrb r2, [r1] + subs r0, 0xCD + ands r0, r2 + strb r0, [r1] + strh r5, [r4, 0x1C] + b _0815F42E + .align 2, 0 +_0815F38C: .4byte 0x02020630 +_0815F390: .4byte 0x0000ff38 +_0815F394: + ldrh r1, [r4, 0x1C] + adds r1, 0x70 + movs r5, 0 + strh r1, [r4, 0x1C] + ldr r2, _0815F3F8 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r2 + lsls r1, 16 + asrs r1, 24 + ldrh r3, [r2, 0x26] + adds r1, r3 + strh r1, [r2, 0x26] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0815F3C4 + strh r5, [r2, 0x24] +_0815F3C4: + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _0815F3CE + strh r5, [r2, 0x26] +_0815F3CE: + movs r3, 0x26 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0815F482 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff + ldr r1, _0815F3FC + adds r0, r1, 0 + ldrh r2, [r4, 0x1C] + adds r0, r2 + strh r0, [r4, 0x1C] + b _0815F42E + .align 2, 0 +_0815F3F8: .4byte 0x02020630 +_0815F3FC: .4byte 0xfffff800 +_0815F400: + ldrh r0, [r4, 0x1C] + subs r0, 0x70 + strh r0, [r4, 0x1C] + lsls r0, 16 + cmp r0, 0 + bge _0815F410 + movs r0, 0 + strh r0, [r4, 0x1C] +_0815F410: + ldr r0, _0815F438 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r4, 0x1C] + lsls r2, 16 + asrs r2, 24 + ldrh r0, [r1, 0x26] + subs r0, r2 + strh r0, [r1, 0x26] + movs r3, 0x1C + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0815F482 +_0815F42E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815F482 + .align 2, 0 +_0815F438: .4byte 0x02020630 +_0815F43C: + ldrh r0, [r4, 0x1C] + adds r0, 0x70 + strh r0, [r4, 0x1C] + ldr r2, _0815F488 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r1, 0x26] + adds r0, r2 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + ble _0815F460 + movs r0, 0 + strh r0, [r1, 0x26] +_0815F460: + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0815F482 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff + adds r0, r6, 0 + bl move_anim_task_del +_0815F482: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0815F488: .4byte 0x02020630 + thumb_func_end sub_815F330 + + thumb_func_start sub_815F48C +sub_815F48C: @ 815F48C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0815F4B0 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815F4B8 + ldrb r0, [r4] + bl sub_80A82E4 + subs r0, 0x2 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r4, _0815F4B4 + b _0815F4C8 + .align 2, 0 +_0815F4B0: .4byte 0x02038437 +_0815F4B4: .4byte 0x0000ff70 +_0815F4B8: + ldrb r0, [r4] + bl sub_80A82E4 + adds r0, 0x2 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r4, _0815F4E4 +_0815F4C8: + ldr r0, _0815F4E8 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + strh r4, [r5, 0x26] + ldr r0, _0815F4EC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815F4E4: .4byte 0x0000ffa0 +_0815F4E8: .4byte 0x02038437 +_0815F4EC: .4byte sub_815F4F0 + 1 + thumb_func_end sub_815F48C + + thumb_func_start sub_815F4F0 +sub_815F4F0: @ 815F4F0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _0815F4FE + b _0815F61A +_0815F4FE: + lsls r0, 2 + ldr r1, _0815F508 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815F508: .4byte _0815F50C + .align 2, 0 +_0815F50C: + .4byte _0815F520 + .4byte _0815F544 + .4byte _0815F584 + .4byte _0815F5B4 + .4byte _0815F5E0 +_0815F520: + ldrh r0, [r4, 0x26] + adds r0, 0xA + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _0815F61A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl audio_play_and_stuff + movs r0, 0 + strh r0, [r4, 0x26] + b _0815F5D8 +_0815F544: + ldrh r1, [r4, 0x30] + adds r1, 0x4 + movs r5, 0 + strh r1, [r4, 0x30] + ldr r2, _0815F580 + movs r3, 0x30 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + negs r0, r0 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _0815F61A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl audio_play_and_stuff + strh r5, [r4, 0x30] + strh r5, [r4, 0x26] + b _0815F5D8 + .align 2, 0 +_0815F580: .4byte 0x08329f40 +_0815F584: + ldrh r1, [r4, 0x30] + adds r1, 0x6 + movs r3, 0 + strh r1, [r4, 0x30] + ldr r2, _0815F5B0 + movs r5, 0x30 + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _0815F61A + strh r3, [r4, 0x30] + strh r3, [r4, 0x26] + b _0815F5D8 + .align 2, 0 +_0815F5B0: .4byte 0x08329f40 +_0815F5B4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815F61A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC0 + bl audio_play_and_stuff + movs r0, 0 + strh r0, [r4, 0x30] +_0815F5D8: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815F61A +_0815F5E0: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815F61A + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + adds r1, 0x1 + strh r1, [r4, 0x32] + movs r0, 0x1 + ands r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bne _0815F61A + adds r0, r4, 0 + bl move_anim_8072740 +_0815F61A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815F4F0 + + thumb_func_start sub_815F620 +sub_815F620: @ 815F620 + 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 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0815F66E + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r10, r1 + asrs r6, r0, 16 + cmp r6, 0 + blt _0815F66E + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r9, r1 + asrs r1, r0, 16 + cmp r1, 0 + bge _0815F67C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, _0815F678 + adds r0, r1 + bl obj_delete_but_dont_free_vram +_0815F66E: + mov r0, r8 + bl move_anim_task_del + b _0815F780 + .align 2, 0 +_0815F678: .4byte 0x02020630 +_0815F67C: + ldr r4, _0815F70C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r4 + ldrh r0, [r5, 0x24] + adds r0, 0x18 + strh r0, [r5, 0x24] + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r6, r0, r4 + ldrh r0, [r6, 0x24] + subs r0, 0x18 + strh r0, [r6, 0x24] + strh r7, [r5, 0x2E] + strh r7, [r6, 0x2E] + strh r7, [r5, 0x30] + strh r7, [r6, 0x30] + strh r7, [r5, 0x32] + strh r7, [r6, 0x32] + movs r0, 0x10 + strh r0, [r5, 0x34] + ldr r0, _0815F710 + strh r0, [r6, 0x34] + strh r7, [r5, 0x36] + movs r0, 0x80 + strh r0, [r6, 0x36] + movs r0, 0x18 + strh r0, [r5, 0x38] + strh r0, [r6, 0x38] + mov r0, r8 + strh r0, [r5, 0x3A] + strh r0, [r6, 0x3A] + strh r7, [r5, 0x3C] + strh r7, [r6, 0x3C] + ldr r2, _0815F714 + mov r1, r8 + lsls r3, r1, 2 + adds r0, r3, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, _0815F718 + ldr r1, [r0] + ldr r0, _0815F71C + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r7, r4, 0 + mov r12, r3 + cmp r0, 0 + bne _0815F720 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + b _0815F736 + .align 2, 0 +_0815F70C: .4byte 0x02020630 +_0815F710: .4byte 0x0000fff0 +_0815F714: .4byte 0x03005e00 +_0815F718: .4byte 0x020244d0 +_0815F71C: .4byte 0x02038437 +_0815F720: + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] +_0815F736: + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r7 + ldrb r1, [r4, 0x1] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4, 0x1] + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r7 + ldrb r0, [r4, 0x1] + ands r3, r0 + strb r3, [r4, 0x1] + adds r3, r7, 0 + adds r3, 0x1C + adds r2, r3 + ldr r0, _0815F790 + str r0, [r2] + adds r1, r3 + str r0, [r1] + mov r0, r12 + add r0, r8 + lsls r0, 3 + ldr r1, _0815F794 + adds r0, r1 + ldr r1, _0815F798 + str r1, [r0] +_0815F780: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815F790: .4byte sub_815F7C4 + 1 +_0815F794: .4byte 0x03005e00 +_0815F798: .4byte sub_815F79C + 1 + thumb_func_end sub_815F620 + + thumb_func_start sub_815F79C +sub_815F79C: @ 815F79C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0815F7C0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815F7BA + adds r0, r2, 0 + bl move_anim_task_del +_0815F7BA: + pop {r0} + bx r0 + .align 2, 0 +_0815F7C0: .4byte 0x03005e00 + thumb_func_end sub_815F79C + + thumb_func_start sub_815F7C4 +sub_815F7C4: @ 815F7C4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815F80E + movs r0, 0 + strh r0, [r4, 0x30] + ldr r0, _0815F838 + ldr r1, [r0] + ldr r0, _0815F83C + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F80E + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r1, r2, 29 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0815F80E: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x36] + adds r0, r1 + movs r5, 0 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815F840 + cmp r0, 0x1 + beq _0815F858 + b _0815F896 + .align 2, 0 +_0815F838: .4byte 0x020244d0 +_0815F83C: .4byte 0x02038437 +_0815F840: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + bne _0815F896 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815F896 +_0815F858: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + ble _0815F896 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x38] + subs r0, 0x2 + strh r0, [r4, 0x38] + lsls r0, 16 + cmp r0, 0 + bge _0815F896 + ldr r3, _0815F89C + movs r2, 0x3C + ldrsh r1, [r4, r2] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_0815F896: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0815F89C: .4byte 0x03005e00 + thumb_func_end sub_815F7C4 + + thumb_func_start sub_815F8A0 +sub_815F8A0: @ 815F8A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, _0815F8EC + movs r2, 0 + strh r2, [r3, 0xE] + ldr r1, _0815F8F0 + ldrb r0, [r1] + ldrb r1, [r1] + adds r0, r1, 0 + subs r0, 0x3D + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + cmp r0, 0x1E + bhi _0815F8C4 + movs r0, 0x1 + strh r0, [r3, 0xE] +_0815F8C4: + adds r0, r2, 0 + subs r0, 0x5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6C + bhi _0815F8D4 + movs r0, 0x2 + strh r0, [r3, 0xE] +_0815F8D4: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xC8 + bls _0815F8E0 + movs r0, 0x3 + strh r0, [r3, 0xE] +_0815F8E0: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0815F8EC: .4byte 0x0203841e +_0815F8F0: .4byte 0x0203841a + thumb_func_end sub_815F8A0 + + thumb_func_start sub_815F8F4 +sub_815F8F4: @ 815F8F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _0815F924 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _0815F91A + b _0815FE68 +_0815F91A: + lsls r0, 2 + ldr r1, _0815F928 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815F924: .4byte 0x03005e00 +_0815F928: .4byte _0815F92C + .align 2, 0 +_0815F92C: + .4byte _0815F940 + .4byte _0815F9F4 + .4byte _0815FBE8 + .4byte _0815FD08 + .4byte _0815FD8C +_0815F940: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _0815F98C + mov r2, r8 + lsls r4, r2, 2 + adds r0, r4, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + ldrh r1, [r6, 0xA] + adds r0, r1 + strh r0, [r6, 0xA] + ldr r0, _0815F990 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815F998 + ldr r2, _0815F994 + lsls r3, r7, 4 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + b _0815F9B2 + .align 2, 0 +_0815F98C: .4byte 0x03005e00 +_0815F990: .4byte 0x02038436 +_0815F994: .4byte 0x02020630 +_0815F998: + ldr r3, _0815F9EC + lsls r4, r7, 4 + adds r2, r4, r7 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0815F9B2: + ldr r1, _0815F9F0 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + strh r0, [r4, 0xA] + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815F9DE + b _0815FE68 +_0815F9DE: + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815FE68 + .align 2, 0 +_0815F9EC: .4byte 0x02020630 +_0815F9F0: .4byte 0x03005e00 +_0815F9F4: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815FA28 + ldr r0, _0815FA20 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r2, [r0, 0x8] + mov r10, r2 + ldr r3, [r0, 0xC] + mov r9, r3 + ldrh r6, [r0] + ldr r0, _0815FA24 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + b _0815FB4E + .align 2, 0 +_0815FA20: .4byte 0x02039f34 +_0815FA24: .4byte 0x02038436 +_0815FA28: + ldr r4, _0815FA8C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815FAC8 + ldr r7, _0815FA90 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0815FA94 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + mov r9, r0 + ldr r0, _0815FA98 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FA9C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FA9E + .align 2, 0 +_0815FA8C: .4byte 0x02038436 +_0815FA90: .4byte 0x0202406e +_0815FA94: .4byte 0x020244ec +_0815FA98: .4byte 0x020244d0 +_0815FA9C: + ldrh r6, [r1, 0x2] +_0815FA9E: + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, _0815FAC4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + movs r5, 0x88 + lsls r5, 1 + b _0815FB50 + .align 2, 0 +_0815FAC4: .4byte 0x02020630 +_0815FAC8: + ldr r7, _0815FB20 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0815FB24 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + mov r9, r0 + ldr r0, _0815FB28 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FB2C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FB2E + .align 2, 0 +_0815FB20: .4byte 0x0202406e +_0815FB24: .4byte 0x02024744 +_0815FB28: .4byte 0x020244d0 +_0815FB2C: + ldrh r6, [r1, 0x2] +_0815FB2E: + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, _0815FBCC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0x1 +_0815FB4E: + ldr r5, _0815FBD0 +_0815FB50: + ldr r0, _0815FBD4 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + lsls r3, r5, 16 + asrs r3, 16 + str r0, [sp] + str r4, [sp, 0x4] + mov r4, r10 + str r4, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldr r4, _0815FBD8 + ldrb r0, [r4] + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80A8394 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0815FBDC + ldr r1, [r0] + ldrb r0, [r4] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0815FBBA + ldr r1, _0815FBCC + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r0, r1 + ldr r3, _0815FBE0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 +_0815FBBA: + ldr r0, _0815FBE4 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x26] + b _0815FD7E + .align 2, 0 +_0815FBCC: .4byte 0x02020630 +_0815FBD0: .4byte 0x0000ffe0 +_0815FBD4: .4byte 0x02038437 +_0815FBD8: .4byte 0x02038436 +_0815FBDC: .4byte 0x020244d0 +_0815FBE0: .4byte 0x00007fff +_0815FBE4: .4byte 0x03005e00 +_0815FBE8: + ldr r1, _0815FC34 + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r2, [r6, 0xA] + adds r0, r2 + strh r0, [r6, 0xA] + ldr r0, _0815FC38 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FC40 + ldr r3, _0815FC3C + lsls r4, r5, 4 + adds r2, r4, r5 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 + b _0815FC56 + .align 2, 0 +_0815FC34: .4byte 0x03005e00 +_0815FC38: .4byte 0x02038436 +_0815FC3C: .4byte 0x02020630 +_0815FC40: + ldr r2, _0815FCA4 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] +_0815FC56: + ldr r1, _0815FCA8 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrb r0, [r6, 0xA] + strh r0, [r6, 0xA] + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x24 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815FCD6 + ldr r0, _0815FCAC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815FCB4 + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, _0815FCB0 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bge _0815FCD6 + b _0815FCCA + .align 2, 0 +_0815FCA4: .4byte 0x02020630 +_0815FCA8: .4byte 0x03005e00 +_0815FCAC: .4byte 0x02038436 +_0815FCB0: .4byte 0x02038437 +_0815FCB4: + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, _0815FCF8 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815FCD6 +_0815FCCA: + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + ldr r1, _0815FCFC + ldr r0, _0815FD00 + strh r0, [r1, 0xE] +_0815FCD6: + lsls r0, r5, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r2 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815FCE8 + b _0815FE68 +_0815FCE8: + ldr r0, _0815FD04 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0xA] + b _0815FD7E + .align 2, 0 +_0815FCF8: .4byte 0x02038437 +_0815FCFC: .4byte 0x0203841e +_0815FD00: .4byte 0x0000ffff +_0815FD04: .4byte 0x03005e00 +_0815FD08: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _0815FD54 + mov r3, r8 + lsls r4, r3, 2 + adds r0, r4, r3 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r5, _0815FD58 + adds r0, r5 + bl sub_80A8610 + ldr r0, _0815FD5C + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FD60 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1, 0x20] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1, 0x24] + b _0815FD74 + .align 2, 0 +_0815FD54: .4byte 0x03005e00 +_0815FD58: .4byte 0x02020630 +_0815FD5C: .4byte 0x02038436 +_0815FD60: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r5 + ldrh r2, [r0, 0x20] + movs r4, 0x88 + lsls r4, 1 + adds r1, r4, 0 + subs r1, r2 + strh r1, [r0, 0x24] +_0815FD74: + ldr r0, _0815FD88 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815FD7E: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815FE68 + .align 2, 0 +_0815FD88: .4byte 0x03005e00 +_0815FD8C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _0815FE00 + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r3, [r2, 0xA] + adds r0, r3 + strh r0, [r2, 0xA] + ldr r0, _0815FE04 + mov r10, r0 + ldrb r0, [r0] + str r2, [sp, 0x18] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + ldr r2, [sp, 0x18] + cmp r0, 0 + bne _0815FE0C + ldr r1, _0815FE08 + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x24 + ldrsh r4, [r6, r2] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r4, r0 + mov r1, r10 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + blt _0815FE44 + movs r2, 0 + strh r2, [r6, 0x24] + b _0815FE44 + .align 2, 0 +_0815FE00: .4byte 0x03005e00 +_0815FE04: .4byte 0x02038436 +_0815FE08: .4byte 0x02020630 +_0815FE0C: + ldr r1, _0815FE78 + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r1, [r2, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r6, 0x24] + subs r0, r1 + strh r0, [r6, 0x24] + movs r3, 0x24 + ldrsh r4, [r6, r3] + movs r1, 0x20 + ldrsh r0, [r6, r1] + adds r4, r0 + mov r2, r10 + ldrb r0, [r2] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + bgt _0815FE44 + movs r4, 0 + strh r4, [r6, 0x24] +_0815FE44: + ldr r1, _0815FE7C + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xA] + strh r1, [r0, 0xA] + ldr r1, _0815FE78 + adds r0, r3, r7 + lsls r0, 2 + adds r0, r1 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815FE68 + mov r0, r8 + bl move_anim_task_del +_0815FE68: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0815FE78: .4byte 0x02020630 +_0815FE7C: .4byte 0x03005e00 + thumb_func_end sub_815F8F4 + + thumb_func_start sub_815FE80 +sub_815FE80: @ 815FE80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815FE92 + cmp r0, 0x1 + beq _0815FF3A + b _0815FFBC +_0815FE92: + ldr r0, _0815FF18 + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0815FF2C + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7A + bl audio_play_and_stuff + ldr r0, _0815FF1C + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + ldr r0, _0815FF20 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, _0815FF24 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815FFBC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815FFBC + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, _0815FF28 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + b _0815FFBC + .align 2, 0 +_0815FF18: .4byte 0x0203841e +_0815FF1C: .4byte 0x02038437 +_0815FF20: .4byte 0x0000ffe0 +_0815FF24: .4byte 0x02038436 +_0815FF28: .4byte 0x02020630 +_0815FF2C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0815FFBC +_0815FF3A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x30] + adds r0, r2, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0815FF6E + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r2, 0 + subs r0, 0x7A + strh r0, [r4, 0x30] +_0815FF6E: + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldr r0, _0815FF98 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815FF9C + ldrh r2, [r4, 0x32] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, r2, 0 + b _0815FFA8 + .align 2, 0 +_0815FF98: .4byte 0x02038436 +_0815FF9C: + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] +_0815FFA8: + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _0815FFBC + adds r0, r4, 0 + bl move_anim_8072740 +_0815FFBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815FE80 + + thumb_func_start sub_815FFC4 +sub_815FFC4: @ 815FFC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0815FFEC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x26 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815FFE0 + b _08160132 +_0815FFE0: + lsls r0, 2 + ldr r1, _0815FFF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0815FFEC: .4byte 0x03005e00 +_0815FFF0: .4byte _0815FFF4 + .align 2, 0 +_0815FFF4: + .4byte _08160008 + .4byte _08160058 + .4byte _081600B4 + .4byte _081600CC + .4byte _08160132 +_08160008: + ldr r0, _0816004C + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, _08160050 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, _08160054 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x6 + strh r0, [r1, 0x8] + cmp r5, r2 + ble _0816003E + negs r0, r0 + strh r0, [r1, 0x8] +_0816003E: + strh r5, [r1, 0xA] + strh r2, [r1, 0xC] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08160150 + .align 2, 0 +_0816004C: .4byte 0x02038436 +_08160050: .4byte 0x02038437 +_08160054: .4byte 0x03005e00 +_08160058: + ldr r1, _08160094 + ldr r0, _08160098 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, _0816009C + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _081600A0 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + b _08160126 + .align 2, 0 +_08160094: .4byte 0x020241e4 +_08160098: .4byte 0x02038436 +_0816009C: .4byte 0x02020630 +_081600A0: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A +_081600B4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r2, 0x8 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08160150 +_081600CC: + ldr r1, _0816010C + ldr r0, _08160110 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, _08160114 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08160118 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A + .align 2, 0 +_0816010C: .4byte 0x020241e4 +_08160110: .4byte 0x02038436 +_08160114: .4byte 0x02020630 +_08160118: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] +_08160126: + cmp r0, r1 + blt _08160150 +_0816012A: + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + b _08160150 +_08160132: + ldr r1, _08160158 + ldr r0, _0816015C + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, _08160160 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_task_del +_08160150: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08160158: .4byte 0x020241e4 +_0816015C: .4byte 0x02038436 +_08160160: .4byte 0x02020630 + thumb_func_end sub_815FFC4 + + thumb_func_start sub_8160164 +sub_8160164: @ 8160164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081601CC + adds r4, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0xE] + ldr r0, _081601D0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08160198 + movs r1, 0x1 +_08160198: + strh r1, [r4, 0x10] + ldr r2, _081601D4 + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1E] + movs r0, 0x1 + strh r0, [r4, 0x1C] + strh r5, [r4, 0x20] + ldr r0, _081601D8 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081601CC: .4byte 0x03005e00 +_081601D0: .4byte 0x02038436 +_081601D4: .4byte 0x02020630 +_081601D8: .4byte sub_81601DC + 1 + thumb_func_end sub_8160164 + + thumb_func_start sub_81601DC +sub_81601DC: @ 81601DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _08160200 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08160284 + cmp r0, 0x1 + bgt _08160204 + cmp r0, 0 + beq _0816020A + b _081602DA + .align 2, 0 +_08160200: .4byte 0x03005e00 +_08160204: + cmp r0, 0x2 + beq _081602D4 + b _081602DA +_0816020A: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r2, 0xFF + ands r0, r2 + strh r0, [r4, 0x1E] + ldr r5, _0816027C + movs r6, 0xE + ldrsh r0, [r4, r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r3, _08160280 + movs r6, 0x1E + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x1A] + adds r0, 0x2 + ands r0, r2 + strh r0, [r4, 0x1A] + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + movs r6, 0x1A + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x10] + muls r0, r1 + ldrh r1, [r4, 0x12] + adds r0, r1 + strh r0, [r2, 0x20] + movs r6, 0x1A + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _081602DA + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x20] + b _081602C4 + .align 2, 0 +_0816027C: .4byte 0x02020630 +_08160280: .4byte 0x08329f40 +_08160284: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x1E] + ldr r3, _081602CC + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, _081602D0 + movs r5, 0x1E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + movs r6, 0x1E + ldrsh r2, [r4, r6] + cmp r2, 0 + bne _081602DA + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + strh r2, [r1, 0x24] +_081602C4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081602DA + .align 2, 0 +_081602CC: .4byte 0x02020630 +_081602D0: .4byte 0x08329f40 +_081602D4: + adds r0, r2, 0 + bl move_anim_task_del +_081602DA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81601DC + + thumb_func_start sub_81602E0 +sub_81602E0: @ 81602E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08160334 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08160326 + adds r0, r4, 0 + bl move_anim_8072740 +_08160326: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08160334: .4byte 0x02038437 + thumb_func_end sub_81602E0 + + thumb_func_start sub_8160338 +sub_8160338: @ 8160338 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08160370 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0816037C + ldr r2, _08160374 + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, _08160378 + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + b _08160396 + .align 2, 0 +_08160370: .4byte 0x02038437 +_08160374: .4byte 0x0203841e +_08160378: .4byte 0x0000fff5 +_0816037C: + movs r0, 0xB + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + ldr r1, _081603A0 + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_08160396: + ldr r0, _081603A4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081603A0: .4byte 0x0203841e +_081603A4: .4byte sub_81602E0 + 1 + thumb_func_end sub_8160338 + + thumb_func_start sub_81603A8 +sub_81603A8: @ 81603A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081603EC + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _081603D2 + movs r0, 0x10 + strh r0, [r5, 0x22] +_081603D2: + movs r0, 0 + strh r0, [r5, 0x3A] + movs r1, 0x10 + strh r1, [r5, 0x3C] + ldr r0, _081603F0 + str r0, [r5, 0x1C] + lsls r1, 8 + movs r0, 0x52 + bl lcd_io_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081603EC: .4byte 0x02038436 +_081603F0: .4byte sub_81603F4 + 1 + thumb_func_end sub_81603A8 + + thumb_func_start sub_81603F4 +sub_81603F4: @ 81603F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0816046C + cmp r1, 0x1 + bgt _0816040A + cmp r1, 0 + beq _08160414 + b _081604E8 +_0816040A: + cmp r1, 0x2 + beq _08160482 + cmp r1, 0x3 + beq _081604E2 + b _081604E8 +_08160414: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + strh r1, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816043E + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _0816044C + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0816044C +_0816043E: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0816044C + subs r0, r2, 0x1 + strh r0, [r4, 0x3C] +_0816044C: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081604E8 + b _081604DA +_0816046C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081604E8 + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + b _081604DA +_08160482: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081604AE + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _081604BC + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _081604BC +_081604AE: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081604BC + adds r0, r2, 0x1 + strh r0, [r4, 0x3C] +_081604BC: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081604E8 +_081604DA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + b _081604E8 +_081604E2: + adds r0, r4, 0 + bl move_anim_8074EE0 +_081604E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81603F4 + + thumb_func_start sub_81604F0 +sub_81604F0: @ 81604F0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _0816050C + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, _08160510 + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08160514 + movs r0, 0x1 + b _08160536 + .align 2, 0 +_0816050C: .4byte 0x0203841e +_08160510: .4byte 0x0203841c +_08160514: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08160520 + movs r0, 0x2 + b _08160536 +_08160520: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0816052C + movs r0, 0x3 + b _08160536 +_0816052C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160538 + movs r0, 0x4 +_08160536: + strh r0, [r2, 0xE] +_08160538: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + thumb_func_end sub_81604F0 + + thumb_func_start sub_8160544 +sub_8160544: @ 8160544 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0816057C + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _08160580 + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, _08160584 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, _08160588 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816057C: .4byte 0x03005e00 +_08160580: .4byte 0x0203841e +_08160584: .4byte 0x085ce9c8 +_08160588: .4byte sub_816058C + 1 + thumb_func_end sub_8160544 + + thumb_func_start sub_816058C +sub_816058C: @ 816058C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, _081605E4 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _081605F0 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08160600 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _081605F0 + ldr r2, _081605E8 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _081605EC + strh r1, [r0, 0x24] + b _08160600 + .align 2, 0 +_081605E4: .4byte 0x03005e00 +_081605E8: .4byte 0x02020630 +_081605EC: .4byte 0x0000ffff +_081605F0: + ldr r2, _08160620 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_08160600: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08160618 + adds r0, r4, 0 + bl move_anim_task_del +_08160618: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08160620: .4byte 0x02020630 + thumb_func_end sub_816058C + + thumb_func_start sub_8160624 +sub_8160624: @ 8160624 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8160624 + + thumb_func_start sub_8160638 +sub_8160638: @ 8160638 + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, _08160660 + movs r1, 0xA + bl AddTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08160660: .4byte sub_8160664 + 1 + thumb_func_end sub_8160638 + + thumb_func_start sub_8160664 +sub_8160664: @ 8160664 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08160690 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08160688 + ldr r0, _08160694 + bl set_callback2 + ldr r1, _08160698 + ldr r0, _0816069C + str r0, [r1] + adds r0, r4, 0 + bl remove_task +_08160688: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08160690: .4byte 0x02037fd4 +_08160694: .4byte sub_81606A0 + 1 +_08160698: .4byte 0x03005dac +_0816069C: .4byte sub_80AF168 + 1 + thumb_func_end sub_8160664 + + thumb_func_start sub_81606A0 +sub_81606A0: @ 81606A0 + push {r4-r6,lr} + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + bl clear_scheduled_bg_copies_to_vram + ldr r6, _08160720 + movs r0, 0x8C + lsls r0, 1 + bl malloc_and_clear + str r0, [r6] + ldr r1, _08160724 + ldrh r1, [r1] + adds r0, 0x44 + movs r5, 0 + strb r1, [r0] + ldr r0, _08160728 + bl SetVBlankCallback + bl sub_81607EC + movs r0, 0 + bl sub_81D2824 + ldr r4, _0816072C + movs r0, 0 + strh r5, [r4] + strh r5, [r4, 0x2] + strb r0, [r4, 0x4] + bl sub_8161280 + ldr r0, _08160730 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _08160734 + bl gpu_pal_obj_alloc_tag_and_apply + bl sub_81610B8 + ldr r0, _08160738 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl calls_per_item_funcs_in_list_outer + ldr r1, [r6] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + ldr r0, _0816073C + bl set_callback2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08160720: .4byte 0x0203bc34 +_08160724: .4byte 0x020375e0 +_08160728: .4byte sub_8160624 + 1 +_0816072C: .4byte 0x0203bc38 +_08160730: .4byte 0x085cebb0 +_08160734: .4byte 0x085cebb8 +_08160738: .4byte 0x03006310 +_0816073C: .4byte sub_816082C + 1 + thumb_func_end sub_81606A0 + + thumb_func_start sub_8160740 +sub_8160740: @ 8160740 + push {r4,r5,lr} + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + bl clear_scheduled_bg_copies_to_vram + ldr r5, _081607C8 + movs r0, 0x8C + lsls r0, 1 + bl malloc_and_clear + str r0, [r5] + movs r1, 0x1C + strb r1, [r0] + ldr r0, [r5] + ldr r1, _081607CC + ldrh r1, [r1] + adds r0, 0x44 + strb r1, [r0] + ldr r0, [r5] + ldr r1, _081607D0 + ldrh r1, [r1] + adds r0, 0x45 + strb r1, [r0] + ldr r0, _081607D4 + bl SetVBlankCallback + bl sub_81607EC + ldr r4, _081607D8 + ldrb r0, [r4, 0x4] + bl sub_81D2824 + bl sub_8161280 + ldr r0, _081607DC + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _081607E0 + bl gpu_pal_obj_alloc_tag_and_apply + bl sub_81610B8 + ldr r0, _081607E4 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl calls_per_item_funcs_in_list_outer + ldr r1, [r5] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + ldr r0, _081607E8 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081607C8: .4byte 0x0203bc34 +_081607CC: .4byte 0x020375e0 +_081607D0: .4byte 0x020375e2 +_081607D4: .4byte sub_8160624 + 1 +_081607D8: .4byte 0x0203bc38 +_081607DC: .4byte 0x085cebb0 +_081607E0: .4byte 0x085cebb8 +_081607E4: .4byte 0x03006310 +_081607E8: .4byte sub_816082C + 1 + thumb_func_end sub_8160740 + + thumb_func_start sub_81607EC +sub_81607EC: @ 81607EC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08160828 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + bl sub_8121E10 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08160828: .4byte 0x085cec28 + thumb_func_end sub_81607EC + + thumb_func_start sub_816082C +sub_816082C: @ 816082C + push {lr} + bl sub_8160868 + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_816082C + + thumb_func_start sub_816084C +sub_816084C: @ 816084C + push {r4,lr} + adds r1, r0, 0 + ldr r4, _08160864 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + bl sub_81D2BF4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08160864: .4byte 0x02021fc4 + thumb_func_end sub_816084C + + thumb_func_start sub_8160868 +sub_8160868: @ 8160868 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r1, _08160888 + ldr r0, [r1] + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0x21 + bls _0816087E + b _08160E8A +_0816087E: + lsls r0, 2 + ldr r1, _0816088C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08160888: .4byte 0x0203bc34 +_0816088C: .4byte _08160890 + .align 2, 0 +_08160890: + .4byte _08160918 + .4byte _08160932 + .4byte _0816094C + .4byte _08160954 + .4byte _0816095C + .4byte _08160964 + .4byte _08160980 + .4byte _08160E8A + .4byte _08160988 + .4byte _081609A8 + .4byte _08160E8A + .4byte _08160E8A + .4byte _08160A44 + .4byte _08160A64 + .4byte _08160CB8 + .4byte _08160CD8 + .4byte _08160AB8 + .4byte _08160AD0 + .4byte _08160AEC + .4byte _08160C1C + .4byte _08160C48 + .4byte _08160C98 + .4byte _08160CA6 + .4byte _08160E8A + .4byte _08160B2C + .4byte _08160B60 + .4byte _08160B80 + .4byte _08160BDC + .4byte _08160CFC + .4byte _08160D48 + .4byte _08160E0C + .4byte _08160E38 + .4byte _08160E58 + .4byte _08160E70 +_08160918: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + movs r4, 0 + strb r0, [r1] + movs r0, 0 + bl render_previous_quest_text + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + b _08160CAE +_08160932: + ldr r0, _08160948 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160940 + b _08160E8A +_08160940: + ldr r1, [r7] + movs r0, 0x4 + b _08160E88 + .align 2, 0 +_08160948: .4byte 0x02037fd4 +_0816094C: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 +_08160954: + movs r0, 0 + bl render_previous_quest_text + b _0816096A +_0816095C: + movs r0, 0 + bl sub_8160F50 + b _08160E8A +_08160964: + movs r0, 0 + bl sub_8161074 +_0816096A: + ldr r0, _0816097C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81611AC + b _08160E8A + .align 2, 0 +_0816097C: .4byte 0x0203bc34 +_08160980: + movs r0, 0x1 + bl sub_8160F50 + b _08160E8A +_08160988: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160994 + b _08160E8A +_08160994: + bl sub_81D2C50 + ldr r0, _081609A4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .align 2, 0 +_081609A4: .4byte 0x0203bc34 +_081609A8: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A0A + ldr r5, _081609F0 + ldr r0, [r5] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, _081609F4 + adds r4, r0 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, _081609F8 + cmp r0, r1 + beq _08160A04 + ldr r0, _081609FC + bl sub_816084C + ldr r1, _08160A00 + movs r0, 0x1 + strh r0, [r1] + ldr r1, [r5] + movs r0, 0x1F + b _08160E88 + .align 2, 0 +_081609F0: .4byte 0x0203bc34 +_081609F4: .4byte 0x020244ec +_081609F8: .4byte 0xffff0000 +_081609FC: .4byte 0x085ef8e4 +_08160A00: .4byte 0x020375e0 +_08160A04: + ldr r1, [r5] + movs r0, 0x10 + b _08160E88 +_08160A0A: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A18 + cmp r1, 0x1 + beq _08160A18 + b _08160E8A +_08160A18: + ldr r0, _08160A28 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160A30 + ldr r0, _08160A2C + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .align 2, 0 +_08160A28: .4byte 0x0203bc38 +_08160A2C: .4byte 0x0203bc34 +_08160A30: + cmp r0, 0x1 + beq _08160A36 + b _08160E8A +_08160A36: + ldr r0, _08160A40 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .align 2, 0 +_08160A40: .4byte 0x0203bc34 +_08160A44: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160A50 + b _08160E8A +_08160A50: + bl sub_81D2C50 + ldr r0, _08160A60 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .align 2, 0 +_08160A60: .4byte 0x0203bc34 +_08160A64: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A7C + ldr r0, _08160A78 + strh r1, [r0] + b _08160E82 + .align 2, 0 +_08160A78: .4byte 0x020375e0 +_08160A7C: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A8A + cmp r1, 0x1 + beq _08160A8A + b _08160E8A +_08160A8A: + ldr r0, _08160A9C + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160AA4 + ldr r0, _08160AA0 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .align 2, 0 +_08160A9C: .4byte 0x0203bc38 +_08160AA0: .4byte 0x0203bc34 +_08160AA4: + cmp r0, 0x1 + beq _08160AAA + b _08160E8A +_08160AAA: + ldr r0, _08160AB4 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .align 2, 0 +_08160AB4: .4byte 0x0203bc34 +_08160AB8: + ldr r0, _08160AC8 + bl sub_816084C + ldr r0, _08160ACC + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .align 2, 0 +_08160AC8: .4byte 0x085ef8f3 +_08160ACC: .4byte 0x0203bc34 +_08160AD0: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160ADC + b _08160E8A +_08160ADC: + bl sub_81D2C50 + ldr r0, _08160AE8 + ldr r1, [r0] + movs r0, 0x12 + b _08160E88 + .align 2, 0 +_08160AE8: .4byte 0x0203bc34 +_08160AEC: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B10 + ldr r0, _08160B08 + bl sub_816084C + ldr r0, _08160B0C + ldr r1, [r0] + movs r0, 0x13 + b _08160E88 + .align 2, 0 +_08160B08: .4byte 0x085efa10 +_08160B0C: .4byte 0x0203bc34 +_08160B10: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160B1E + cmp r1, 0x1 + beq _08160B1E + b _08160E8A +_08160B1E: + ldr r0, _08160B28 + ldr r1, [r0] + movs r0, 0x18 + b _08160E88 + .align 2, 0 +_08160B28: .4byte 0x0203bc34 +_08160B2C: + ldr r4, _08160B50 + bl sub_8161054 + movs r1, 0xD + muls r1, r0 + ldr r0, _08160B54 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _08160B58 + bl sub_816084C + ldr r0, _08160B5C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .align 2, 0 +_08160B50: .4byte 0x02021dc4 +_08160B54: .4byte 0x0831977c +_08160B58: .4byte 0x085ef960 +_08160B5C: .4byte 0x0203bc34 +_08160B60: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160B6C + b _08160E8A +_08160B6C: + bl sub_81D2C50 + ldr r0, _08160B7C + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .align 2, 0 +_08160B7C: .4byte 0x0203bc34 +_08160B80: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B98 + ldr r0, _08160B94 + ldr r1, [r0] + movs r0, 0x1B + b _08160E88 + .align 2, 0 +_08160B94: .4byte 0x0203bc34 +_08160B98: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160BA6 + cmp r1, 0x1 + beq _08160BA6 + b _08160E8A +_08160BA6: + ldr r0, _08160BBC + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160BC4 + ldr r2, _08160BC0 + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1] + adds r7, r2, 0 + b _08160BD0 + .align 2, 0 +_08160BBC: .4byte 0x0203bc38 +_08160BC0: .4byte 0x0203bc34 +_08160BC4: + ldr r7, _08160BD8 + cmp r0, 0x1 + bne _08160BD0 + ldr r1, [r7] + movs r0, 0x5 + strb r0, [r1] +_08160BD0: + ldr r1, [r7] + movs r0, 0x10 + b _08160E88 + .align 2, 0 +_08160BD8: .4byte 0x0203bc34 +_08160BDC: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160BE8 + b _08160E8A +_08160BE8: + movs r0, 0x3 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _08160C00 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160C08 + ldr r0, _08160C04 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .align 2, 0 +_08160C00: .4byte 0x0203bc38 +_08160C04: .4byte 0x0203bc34 +_08160C08: + cmp r0, 0x1 + beq _08160C0E + b _08160E8A +_08160C0E: + ldr r0, _08160C18 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .align 2, 0 +_08160C18: .4byte 0x0203bc34 +_08160C1C: + bl sub_81D2C3C + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _08160C2A + b _08160E8A +_08160C2A: + ldr r0, _08160C44 + ldr r1, [r0] + movs r0, 0x14 + strb r0, [r1] + subs r0, 0x15 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _08160E8A + .align 2, 0 +_08160C44: .4byte 0x0203bc34 +_08160C48: + ldr r0, _08160C84 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160C56 + b _08160E8A +_08160C56: + bl sub_8161054 + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08160C88 + ldr r1, _08160C8C + ldr r1, [r1] + adds r1, 0x44 + ldrb r1, [r1] + ldr r2, _08160C90 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08160C94 + str r0, [sp] + adds r0, r4, 0 + bl sub_81BFA38 + bl sub_8160EA0 + b _08160E8A + .align 2, 0 +_08160C84: .4byte 0x02037fd4 +_08160C88: .4byte 0x020244ec +_08160C8C: .4byte 0x0203bc34 +_08160C90: .4byte 0x020244e9 +_08160C94: .4byte sub_8160740 + 1 +_08160C98: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160CA4 + b _08160E8A +_08160CA4: + b _08160E82 +_08160CA6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] +_08160CAE: + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _08160E8A +_08160CB8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08160CD4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .align 2, 0 +_08160CD4: .4byte 0x0203bc34 +_08160CD8: + ldr r0, _08160CF4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160CE6 + b _08160E8A +_08160CE6: + bl sub_8160EA0 + ldr r0, _08160CF8 + bl set_callback2 + b _08160E8A + .align 2, 0 +_08160CF4: .4byte 0x02037fd4 +_08160CF8: .4byte c2_exit_to_overworld_2_switch + 1 +_08160CFC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _08160D28 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, _08160D2C + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160D30 + movs r0, 0x1 + bl render_previous_quest_text + b _08160D3A + .align 2, 0 +_08160D28: .4byte 0x0203bc34 +_08160D2C: .4byte 0x0203bc38 +_08160D30: + cmp r0, 0x1 + bne _08160D3A + movs r0, 0x1 + bl sub_8161074 +_08160D3A: + bl sub_8161234 + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + b _08160E8A +_08160D48: + ldr r0, _08160D68 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160D56 + b _08160E8A +_08160D56: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x45 + ldrb r0, [r2] + cmp r0, 0x4 + bne _08160D6C + movs r0, 0x18 + b _08160E88 + .align 2, 0 +_08160D68: .4byte 0x02037fd4 +_08160D6C: + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + movs r4, 0x64 + muls r0, r4 + ldr r5, _08160DF4 + adds r0, r5 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08160DF8 + movs r1, 0xD + mov r8, r1 + mov r1, r8 + muls r1, r0 + ldr r6, _08160DFC + adds r1, r6 + adds r0, r2, 0 + bl gf_strcpy + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + adds r1, 0x45 + ldrb r1, [r1] + bl sub_806B9A8 + ldr r0, [r7] + adds r0, 0x44 + ldrb r0, [r0] + muls r4, r0 + adds r4, r5 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [r7] + adds r0, 0x45 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_80691F4 + ldr r4, _08160E00 + bl sub_8161054 + mov r1, r8 + muls r1, r0 + adds r1, r6 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _08160E04 + bl sub_816084C + ldr r1, [r7] + movs r0, 0x1E + strb r0, [r1] + ldr r1, _08160E08 + movs r0, 0x1 + strh r0, [r1] + b _08160E8A + .align 2, 0 +_08160DF4: .4byte 0x020244ec +_08160DF8: .4byte 0x02021ec4 +_08160DFC: .4byte 0x0831977c +_08160E00: .4byte 0x02021dc4 +_08160E04: .4byte 0x085ef979 +_08160E08: .4byte 0x020375e0 +_08160E0C: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, _08160E2C + bl sub_816084C + ldr r0, _08160E30 + ldr r1, [r0] + movs r0, 0x1F + strb r0, [r1] + ldr r0, _08160E34 + bl fanfare_play + b _08160E8A + .align 2, 0 +_08160E2C: .4byte 0x085ef9a6 +_08160E30: .4byte 0x0203bc34 +_08160E34: .4byte 0x0000016f +_08160E38: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, _08160E50 + bl fanfare_play + ldr r0, _08160E54 + ldr r1, [r0] + movs r0, 0x20 + b _08160E88 + .align 2, 0 +_08160E50: .4byte 0x0000016f +_08160E54: .4byte 0x0203bc34 +_08160E58: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _08160E8A + ldr r0, _08160E6C + ldr r1, [r0] + movs r0, 0x21 + b _08160E88 + .align 2, 0 +_08160E6C: .4byte 0x0203bc34 +_08160E70: + ldr r0, _08160E98 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08160E8A + movs r0, 0x5 + bl audio_play +_08160E82: + ldr r0, _08160E9C + ldr r1, [r0] + movs r0, 0xE +_08160E88: + strb r0, [r1] +_08160E8A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08160E98: .4byte 0x030022c0 +_08160E9C: .4byte 0x0203bc34 + thumb_func_end sub_8160868 + + thumb_func_start sub_8160EA0 +sub_8160EA0: @ 8160EA0 + push {r4,lr} + bl sub_8161234 + ldr r4, _08160ED8 + ldr r0, [r4] + movs r1, 0x89 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _08160EDC + adds r2, r1, 0x2 + bl sub_81AE6C8 + bl Window_FreeMemory + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + bl reset_all_obj_data + bl gpu_pal_allocator_reset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08160ED8: .4byte 0x0203bc34 +_08160EDC: .4byte 0x0203bc38 + thumb_func_end sub_8160EA0 + + thumb_func_start render_previous_quest_text +render_previous_quest_text: @ 8160EE0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r6, _08160F40 + ldr r4, _08160F44 + movs r3, 0x4 +_08160EF0: + ldr r0, [r4] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xF + ble _08160EF0 + cmp r5, 0 + bne _08160F38 + ldr r4, _08160F48 + ldr r1, _08160F4C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x3 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print +_08160F38: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08160F40: .4byte 0x02020630 +_08160F44: .4byte 0x0203bc34 +_08160F48: .4byte 0x02021fc4 +_08160F4C: .4byte 0x085ef8c2 + thumb_func_end render_previous_quest_text + + thumb_func_start sub_8160F50 +sub_8160F50: @ 8160F50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, _08160FB8 + ldr r0, [r6] + movs r4, 0x89 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + bl sub_81AE604 + adds r5, r0, 0 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ldr r4, _08160FBC + adds r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _08160FE4 + adds r0, 0x1 + cmp r5, r0 + bne _08161010 + ldr r0, _08160FC0 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _08160F9C + bl sub_81220D0 + lsls r0, 24 + cmp r0, 0 + beq _0816103E +_08160F9C: + movs r0, 0x5 + bl audio_play + cmp r7, 0 + bne _08160FC4 + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r0, [r6] + movs r1, 0x5 + strb r1, [r0] + movs r0, 0x1 + strb r0, [r4, 0x4] + b _08160FD4 + .align 2, 0 +_08160FB8: .4byte 0x0203bc34 +_08160FBC: .4byte 0x0203bc38 +_08160FC0: .4byte 0x030022c0 +_08160FC4: + movs r0, 0 + bl Window_WriteStandardTileMap + ldr r0, [r6] + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + strb r2, [r4, 0x4] +_08160FD4: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_8161054 + bl sub_816137C + b _0816103E +_08160FE4: + movs r0, 0x5 + bl audio_play + bl sub_8161234 + ldr r1, [r6] + movs r0, 0xC + strb r0, [r1] + ldr r4, _08161008 + ldr r1, _0816100C + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + bl sub_81D2BF4 + b _0816103E + .align 2, 0 +_08161008: .4byte 0x02021fc4 +_0816100C: .4byte 0x085ef9e6 +_08161010: + movs r0, 0x5 + bl audio_play + bl sub_8161234 + ldr r1, [r6] + movs r0, 0x8 + strb r0, [r1] + ldr r0, _08161044 + movs r1, 0xD + muls r1, r5 + ldr r2, _08161048 + adds r1, r2 + bl gf_strcpy + ldr r4, _0816104C + ldr r1, _08161050 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + bl sub_81D2BF4 +_0816103E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08161044: .4byte 0x02021dc4 +_08161048: .4byte 0x0831977c +_0816104C: .4byte 0x02021fc4 +_08161050: .4byte 0x085ef8da + thumb_func_end sub_8160F50 + + thumb_func_start sub_8161054 +sub_8161054: @ 8161054 + ldr r0, _0816106C + ldr r2, [r0] + ldr r1, _08161070 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + ldr r0, [r2] + bx lr + .align 2, 0 +_0816106C: .4byte 0x0203bc34 +_08161070: .4byte 0x0203bc38 + thumb_func_end sub_8161054 + + thumb_func_start sub_8161074 +sub_8161074: @ 8161074 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081610A6 + ldr r4, _081610B0 + ldr r1, _081610B4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x3 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print +_081610A6: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081610B0: .4byte 0x02021fc4 +_081610B4: .4byte 0x085ef8c2 + thumb_func_end sub_8161074 + + thumb_func_start sub_81610B8 +sub_81610B8: @ 81610B8 + push {r4-r7,lr} + ldr r2, _0816119C + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, _081611A0 + adds r1, r0, r2 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + bl sub_81611AC + movs r4, 0 + ldr r5, _081611A4 +_081610DC: + adds r2, r4, 0 + cmp r4, 0 + bge _081610E4 + adds r2, r4, 0x3 +_081610E4: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0x90 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r2, _0816119C + ldr r1, [r2] + adds r1, 0x1 + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x7 + ble _081610DC + movs r4, 0 + ldr r7, _081611A4 + adds r6, r2, 0 +_0816111C: + adds r2, r4, 0 + cmp r4, 0 + bge _08161124 + adds r2, r4, 0x3 +_08161124: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0xD0 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r7, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r6] + adds r2, r4, 0 + adds r2, 0x8 + adds r1, 0x1 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _081611A8 + adds r0, r5 + movs r1, 0x2 + bl obj_anim_image_start + adds r4, 0x1 + cmp r4, 0x7 + ble _0816111C + movs r4, 0 + ldr r3, _0816119C + movs r2, 0x4 +_08161176: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0xF + ble _08161176 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816119C: .4byte 0x0203bc34 +_081611A0: .4byte 0x00000113 +_081611A4: .4byte 0x085cec10 +_081611A8: .4byte 0x02020630 + thumb_func_end sub_81610B8 + + thumb_func_start sub_81611AC +sub_81611AC: @ 81611AC + push {r4-r6,lr} + ldr r4, _08161218 + ldr r1, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081611D4 + ldr r0, _0816121C + movs r3, 0x8B + lsls r3, 1 + adds r1, r3 + bl sub_81AF380 + ldr r1, [r4] + movs r5, 0x8A + lsls r5, 1 + adds r1, r5 + strb r0, [r1] +_081611D4: + ldr r0, [r4] + ldr r6, _08161220 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08161210 + ldr r0, _08161224 + adds r2, r0, 0 + ldr r1, _08161228 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r1, [r1] + str r1, [r2] + ldr r2, [r4] + movs r3, 0x88 + lsls r3, 1 + adds r1, r2, r3 + ldrb r1, [r1] + ldr r5, _0816122C + adds r2, r5 + ldrb r2, [r2] + subs r1, r2 + strh r1, [r0, 0x8] + ldr r1, _08161230 + bl sub_81AF380 + ldr r1, [r4] + ldr r6, _08161220 + adds r1, r6 + strb r0, [r1] +_08161210: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08161218: .4byte 0x0203bc34 +_0816121C: .4byte 0x085cebc0 +_08161220: .4byte 0x00000113 +_08161224: .4byte 0x0203ce8c +_08161228: .4byte 0x085cebd0 +_0816122C: .4byte 0x00000111 +_08161230: .4byte 0x0203bc38 + thumb_func_end sub_81611AC + + thumb_func_start sub_8161234 +sub_8161234: @ 8161234 + push {r4,lr} + ldr r4, _08161278 + ldr r0, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161256 + bl sub_81AF620 + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08161256: + ldr r0, [r4] + ldr r2, _0816127C + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161270 + bl sub_81AF620 + ldr r0, [r4] + ldr r2, _0816127C + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] +_08161270: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08161278: .4byte 0x0203bc34 +_0816127C: .4byte 0x00000113 + thumb_func_end sub_8161234 + + thumb_func_start sub_8161280 +sub_8161280: @ 8161280 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, _08161364 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _08161368 + adds r0, r2 + adds r1, 0x12 + bl sub_806E0B4 + ldr r1, [r4] + movs r6, 0x88 + lsls r6, 1 + adds r1, r6 + strb r0, [r1] + movs r5, 0 + ldr r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _081612F6 + mov r8, r4 + movs r0, 0xD + mov r12, r0 + ldr r2, _0816136C + mov r9, r2 +_081612C2: + mov r7, r8 + ldr r4, [r7] + lsls r3, r5, 3 + adds r2, r4, 0 + adds r2, 0x48 + adds r2, r3 + lsls r0, r5, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + ldrh r0, [r1] + mov r7, r12 + muls r7, r0 + adds r0, r7, 0 + add r0, r9 + str r0, [r2] + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r3 + ldrh r1, [r1] + str r1, [r0] + adds r5, 0x1 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r5, r0 + blt _081612C2 +_081612F6: + ldr r4, _08161364 + ldr r0, [r4] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08161368 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, _08161370 + mov r1, sp + bl strcpy_limit_10_chars + ldr r2, [r4] + movs r5, 0x88 + lsls r5, 1 + adds r3, r2, r5 + ldrb r0, [r3] + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x48 + adds r1, r0 + ldr r0, _08161374 + str r0, [r1] + ldrb r0, [r3] + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + movs r0, 0x2 + negs r0, r0 + str r0, [r2] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x48 + adds r1, r5 + ldrb r1, [r1] + bl sub_81D28C8 + ldr r1, [r4] + ldr r2, _08161378 + adds r1, r2 + strb r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08161364: .4byte 0x0203bc34 +_08161368: .4byte 0x020244ec +_0816136C: .4byte 0x0831977c +_08161370: .4byte 0x02021cc4 +_08161374: .4byte 0x085e8cf0 +_08161378: .4byte 0x00000111 + thumb_func_end sub_8161280 + + thumb_func_start sub_816137C +sub_816137C: @ 816137C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, _081613C0 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08161394 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081613CC +_08161394: + movs r5, 0 + ldr r4, _081613C4 + ldr r3, _081613C8 + movs r2, 0x4 +_0816139C: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r5 + 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] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _0816139C + b _081614FE + .align 2, 0 +_081613C0: .4byte 0x0203bc38 +_081613C4: .4byte 0x02020630 +_081613C8: .4byte 0x0203bc34 +_081613CC: + ldr r1, _08161410 + ldr r0, _08161414 + lsls r4, 3 + adds r0, r4, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r4 + cmp r6, 0xFF + bne _081613EE + movs r6, 0 +_081613EE: + movs r5, 0 + ldr r7, _08161418 + ldr r4, _0816141C +_081613F4: + cmp r5, r6 + bcs _08161420 + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl obj_anim_image_start + b _08161436 + .align 2, 0 +_08161410: .4byte 0x0858cdcc +_08161414: .4byte 0x0858c2b4 +_08161418: .4byte 0x0203bc34 +_0816141C: .4byte 0x02020630 +_08161420: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl obj_anim_image_start +_08161436: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _081613F4 + ldr r1, _081614A8 + ldr r0, _081614AC + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xFF + bne _0816147C + movs r6, 0 +_0816147C: + movs r5, 0 + ldr r0, _081614B0 + mov r8, r0 + ldr r7, _081614B4 +_08161484: + cmp r5, r6 + bcs _081614B8 + mov r1, r8 + ldr r0, [r1] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x3 + bl obj_anim_image_start + b _081614D4 + .align 2, 0 +_081614A8: .4byte 0x0858cdcc +_081614AC: .4byte 0x0858c2b4 +_081614B0: .4byte 0x0203bc34 +_081614B4: .4byte 0x02020630 +_081614B8: + mov r3, r8 + ldr r0, [r3] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x2 + bl obj_anim_image_start +_081614D4: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _08161484 +_081614FE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816137C + + thumb_func_start hm_prepare_dive_probably +hm_prepare_dive_probably: @ 8161508 + push {r4-r6,lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, _08161554 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + bhi _08161558 + movs r0, 0 + b _0816155A + .align 2, 0 +_08161554: .4byte 0x020244ec +_08161558: + movs r0, 0x1 +_0816155A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end hm_prepare_dive_probably + + thumb_func_start sub_8161560 +sub_8161560: @ 8161560 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0816159C + movs r1, 0xA + strb r1, [r0, 0xB] + ldrb r1, [r0, 0x9] + strb r1, [r0, 0xA] + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0x5 + bl sub_81B3054 + ldr r1, _081615A0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081615A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816159C: .4byte 0x0203cec8 +_081615A0: .4byte 0x03005e00 +_081615A4: .4byte sub_81B1370 + 1 + thumb_func_end sub_8161560 + + thumb_func_start sub_81615A8 +sub_81615A8: @ 81615A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + ldr r1, _081615E0 + ldrb r7, [r1, 0x9] + mov r8, r7 + ldrb r0, [r1, 0xA] + adds r5, r0, 0 + cmp r5, 0x6 + bls _081615EC + movs r0, 0 + strb r0, [r1, 0xB] + bl sub_81B3054 + ldr r1, _081615E4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081615E8 + str r1, [r0] + b _08161658 + .align 2, 0 +_081615E0: .4byte 0x0203cec8 +_081615E4: .4byte 0x03005e00 +_081615E8: .4byte sub_81B1370 + 1 +_081615EC: + movs r0, 0x64 + mov r10, r0 + mov r0, r10 + muls r0, r5 + ldr r1, _08161624 + mov r9, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0816161A + cmp r7, r5 + beq _0816161A + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + cmp r0, r4 + bne _08161628 +_0816161A: + ldr r0, [sp, 0x4] + bl sub_81617B8 + b _08161658 + .align 2, 0 +_08161624: .4byte 0x020244ec +_08161628: + movs r0, 0x1 + bl audio_play + mov r1, r10 + mov r0, r8 + muls r0, r1 + add r0, r9 + movs r1, 0x3A + bl pokemon_getattr + movs r1, 0x5 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 16 + asrs r3, 16 + movs r2, 0x1 + negs r2, r2 + ldr r0, _08161668 + str r0, [sp] + ldr r0, [sp, 0x4] + mov r1, r8 + bl sub_81B1F18 +_08161658: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08161668: .4byte sub_816166C + 1 + thumb_func_end sub_81615A8 + + thumb_func_start sub_816166C +sub_816166C: @ 816166C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl audio_play + ldr r5, _081616B4 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081616B8 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + movs r1, 0x5 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r5, 0xA] + ldr r0, _081616BC + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1F18 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081616B4: .4byte 0x0203cec8 +_081616B8: .4byte 0x020244ec +_081616BC: .4byte sub_81616C0 + 1 + thumb_func_end sub_816166C + + thumb_func_start sub_81616C0 +sub_81616C0: @ 81616C0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08161708 + movs r1, 0xA + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0816170C + adds r0, r1 + ldr r1, _08161710 + bl sub_81B1B44 + ldr r4, _08161714 + ldr r1, _08161718 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816171C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08161720 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08161708: .4byte 0x0203cec8 +_0816170C: .4byte 0x020244ec +_08161710: .4byte 0x02021cc4 +_08161714: .4byte 0x02021fc4 +_08161718: .4byte 0x085e9c17 +_0816171C: .4byte 0x03005e00 +_08161720: .4byte sub_8161724 + 1 + thumb_func_end sub_81616C0 + + thumb_func_start sub_8161724 +sub_8161724: @ 8161724 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08161772 + ldr r4, _08161778 + movs r0, 0 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl Window_FillTileMap + movs r0, 0 + bl sub_81B3054 + ldr r1, _0816177C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08161780 + str r1, [r0] +_08161772: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08161778: .4byte 0x0203cec8 +_0816177C: .4byte 0x03005e00 +_08161780: .4byte sub_81B1370 + 1 + thumb_func_end sub_8161724 + + thumb_func_start sub_8161784 +sub_8161784: @ 8161784 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081617AA + movs r0, 0x5 + bl sub_81B3054 + ldr r0, _081617B0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081617B4 + str r0, [r1] +_081617AA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081617B0: .4byte 0x03005e00 +_081617B4: .4byte sub_81B1370 + 1 + thumb_func_end sub_8161784 + + thumb_func_start sub_81617B8 +sub_81617B8: @ 81617B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + ldr r0, _081617E8 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081617EC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081617F0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081617E8: .4byte 0x085e9712 +_081617EC: .4byte 0x03005e00 +_081617F0: .4byte sub_8161784 + 1 + thumb_func_end sub_81617B8 + + thumb_func_start sub_81617F4 +sub_81617F4: @ 81617F4 + push {r4,lr} + ldr r0, _08161868 + mov r12, r0 + ldr r0, _0816186C + ldr r1, [r0] + ldr r2, _08161870 + adds r0, r1, r2 + mov r4, r12 + str r0, [r4] + movs r3, 0xA + strb r3, [r4, 0x4] + adds r2, 0xA + adds r0, r1, r2 + str r0, [r4, 0x8] + strb r3, [r4, 0xC] + ldr r4, _08161874 + adds r0, r1, r4 + mov r2, r12 + str r0, [r2, 0x10] + strb r3, [r2, 0x14] + adds r4, 0xA + adds r0, r1, r4 + str r0, [r2, 0x18] + movs r2, 0x1E + mov r0, r12 + strb r2, [r0, 0x1C] + adds r4, 0x1E + adds r0, r1, r4 + mov r4, r12 + str r0, [r4, 0x20] + mov r0, r12 + adds r0, 0x24 + strb r2, [r0] + ldr r2, _08161878 + adds r0, r1, r2 + str r0, [r4, 0x28] + mov r0, r12 + adds r0, 0x2C + strb r3, [r0] + ldr r4, _0816187C + adds r0, r1, r4 + mov r2, r12 + str r0, [r2, 0x30] + adds r2, 0x34 + movs r0, 0x28 + strb r0, [r2] + adds r4, 0x28 + adds r1, r4 + mov r0, r12 + str r1, [r0, 0x38] + adds r0, 0x3C + strb r3, [r0] + bl sub_8126968 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08161868: .4byte 0x0203bc40 +_0816186C: .4byte 0x03005d8c +_08161870: .4byte 0x00002734 +_08161874: .4byte 0x00002748 +_08161878: .4byte 0x0000278e +_0816187C: .4byte 0x00002798 + thumb_func_end sub_81617F4 + + thumb_func_start sub_8161880 +sub_8161880: @ 8161880 + push {r4,r5,lr} + lsls r0, 24 + movs r3, 0 + ldr r1, _081618B0 + lsrs r2, r0, 21 + adds r0, r2, r1 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcs _081618AA + adds r5, r1, 0 + movs r4, 0 +_08161896: + adds r0, r2, r5 + ldr r1, [r0] + adds r1, r3 + strb r4, [r1] + adds r1, r3, 0x1 + lsls r1, 24 + lsrs r3, r1, 24 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcc _08161896 +_081618AA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081618B0: .4byte 0x0203bc40 + thumb_func_end sub_8161880 + + thumb_func_start sub_81618B4 +sub_81618B4: @ 81618B4 + push {r4,lr} + movs r4, 0 +_081618B8: + adds r0, r4, 0 + bl sub_8161880 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081618B8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81618B4 + + thumb_func_start sub_81618D0 +sub_81618D0: @ 81618D0 + push {r4,lr} + lsls r0, 24 + movs r2, 0 + ldr r1, _081618FC + lsrs r0, 21 + adds r0, r1 + movs r1, 0x4 + ldrsb r1, [r0, r1] + cmp r2, r1 + bge _0816190C + adds r4, r0, 0 + adds r3, r1, 0 +_081618E8: + lsls r0, r2, 24 + asrs r1, r0, 24 + ldr r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08161900 + adds r0, r1, 0 + b _08161910 + .align 2, 0 +_081618FC: .4byte 0x0203bc40 +_08161900: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r3 + blt _081618E8 +_0816190C: + movs r0, 0x1 + negs r0, r0 +_08161910: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81618D0 + + thumb_func_start sub_8161918 +sub_8161918: @ 8161918 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _08161944 + lsls r0, r3, 5 + adds r0, r1 + ldrb r0, [r0, 0x13] + movs r2, 0 + ldr r1, _08161948 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + cmp r2, r1 + bcs _08161956 + ldr r4, [r0] +_08161936: + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, r3 + bne _0816194C + movs r0, 0x1 + b _08161958 + .align 2, 0 +_08161944: .4byte 0x085a5c08 +_08161948: .4byte 0x0203bc40 +_0816194C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcc _08161936 +_08161956: + movs r0, 0 +_08161958: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8161918 + + thumb_func_start sub_8161960 +sub_8161960: @ 8161960 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0 + beq _081619A0 + ldr r1, _08161998 + lsls r0, r4, 5 + adds r0, r1 + ldrb r5, [r0, 0x13] + adds r0, r5, 0 + bl sub_81618D0 + lsls r0, 24 + asrs r2, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _081619A0 + ldr r0, _0816199C + lsls r1, r5, 3 + adds r1, r0 + ldr r0, [r1] + adds r0, r2 + strb r4, [r0] + movs r0, 0x1 + b _081619A2 + .align 2, 0 +_08161998: .4byte 0x085a5c08 +_0816199C: .4byte 0x0203bc40 +_081619A0: + movs r0, 0 +_081619A2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8161960 + + thumb_func_start sub_81619A8 +sub_81619A8: @ 81619A8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081619D4 + ldr r1, _081619D0 + lsls r0, 5 + adds r0, r1 + ldrb r0, [r0, 0x13] + bl sub_81618D0 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081619D4 + movs r0, 0x1 + b _081619D6 + .align 2, 0 +_081619D0: .4byte 0x085a5c08 +_081619D4: + movs r0, 0 +_081619D6: + pop {r1} + bx r1 + thumb_func_end sub_81619A8 + + thumb_func_start sub_81619DC +sub_81619DC: @ 81619DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + cmp r5, 0 + bne _081619F8 + b _08161A26 +_081619EA: + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl sub_8161A38 + movs r0, 0x1 + b _08161A28 +_081619F8: + ldr r2, _08161A30 + ldr r1, _08161A34 + lsls r0, r5, 5 + adds r0, r1 + ldrb r4, [r0, 0x13] + lsls r0, r4, 3 + adds r0, r2 + ldrb r1, [r0, 0x4] + cmp r3, r1 + bcs _08161A26 + adds r6, r4, 0 + adds r4, r0, 0 + adds r2, r1, 0 +_08161A12: + ldr r0, [r4] + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, r5 + beq _081619EA + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _08161A12 +_08161A26: + movs r0, 0 +_08161A28: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08161A30: .4byte 0x0203bc40 +_08161A34: .4byte 0x085a5c08 + thumb_func_end sub_81619DC + + thumb_func_start sub_8161A38 +sub_8161A38: @ 8161A38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + movs r6, 0 + ldr r2, _08161ACC + lsrs r0, 21 + adds r1, r0, r2 + ldrb r3, [r1, 0x4] + cmp r6, r3 + bcs _08161ABC + adds r7, r0, 0 + mov r10, r1 + mov r0, r10 + str r0, [sp] +_08161A5C: + adds r1, r6, 0x1 + lsls r0, r1, 24 + lsrs r3, r0, 24 + adds r2, r7, 0 + mov r12, r1 + mov r1, r10 + ldrb r1, [r1, 0x4] + cmp r3, r1 + bcs _08161AAE + ldr r0, _08161ACC + mov r9, r0 + adds r1, r0, 0 + mov r8, r1 +_08161A76: + mov r0, r9 + adds r5, r2, r0 + ldr r1, [r5] + adds r0, r1, r3 + ldrb r4, [r0] + adds r2, r4, 0 + cmp r2, 0 + beq _08161A9C + adds r0, r1, r6 + ldrb r1, [r0] + cmp r1, 0 + beq _08161A92 + cmp r1, r2 + bls _08161A9C +_08161A92: + ldrb r1, [r0] + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + strb r1, [r0] +_08161A9C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, r7, 0 + mov r1, r8 + adds r0, r2, r1 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcc _08161A76 +_08161AAE: + mov r3, r12 + lsls r0, r3, 24 + lsrs r6, r0, 24 + ldr r0, [sp] + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _08161A5C +_08161ABC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08161ACC: .4byte 0x0203bc40 + thumb_func_end sub_8161A38 + + thumb_func_start sub_8161AD0 +sub_8161AD0: @ 8161AD0 + push {r4,r5,lr} + lsls r0, 24 + movs r4, 0 + movs r3, 0 + ldr r2, _08161B0C + lsrs r1, r0, 21 + adds r0, r1, r2 + ldrb r0, [r0, 0x4] + cmp r4, r0 + bcs _08161B04 + adds r5, r2, 0 +_08161AE6: + adds r2, r1, r5 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _08161AF8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08161AF8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r2, [r2, 0x4] + cmp r3, r2 + bcc _08161AE6 +_08161B04: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08161B0C: .4byte 0x0203bc40 + thumb_func_end sub_8161AD0 + + thumb_func_start sub_8161B10 +sub_8161B10: @ 8161B10 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_08161B16: + adds r0, r4, 0 + bl sub_8161AD0 + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08161B16 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8161B10 + + thumb_func_start sub_8161B34 +sub_8161B34: @ 8161B34 + push {r4,r5,lr} + ldr r5, _08161B54 + ldr r0, [r5] + ldr r4, _08161B58 + adds r0, r4 + movs r1, 0 + movs r2, 0x1C + bl memset + ldr r0, [r5] + adds r0, r4 + ldr r1, _08161B5C + strh r1, [r0, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08161B54: .4byte 0x03005d8c +_08161B58: .4byte 0x000031dc +_08161B5C: .4byte 0x00000197 + thumb_func_end sub_8161B34 + + thumb_func_start sub_8161B60 +sub_8161B60: @ 8161B60 + push {r4-r6,lr} + movs r2, 0 + ldr r6, _08161B8C + ldr r4, _08161B90 + movs r3, 0 + adds r5, r4, 0x1 +_08161B6C: + lsls r1, r2, 1 + adds r0, r1, r4 + strb r3, [r0] + adds r1, r5 + strb r3, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _08161B6C + movs r0, 0 + strb r0, [r6] + strb r0, [r6, 0x1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08161B8C: .4byte 0x0203bc86 +_08161B90: .4byte 0x0203bc80 + thumb_func_end sub_8161B60 + + thumb_func_start sub_8161B94 +sub_8161B94: @ 8161B94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + cmp r0, 0 + bne _08161BBC + ldr r0, _08161BB0 + ldr r1, [r0] + ldr r2, _08161BB4 + adds r1, r2 + ldr r2, _08161BB8 + b _08161BC8 + .align 2, 0 +_08161BB0: .4byte 0x03005d8c +_08161BB4: .4byte 0x000031dc +_08161BB8: .4byte 0x00000197 +_08161BBC: + ldr r0, _08161CA8 + ldr r1, [r0] + ldr r2, _08161CAC + adds r1, r2 + movs r2, 0xCC + lsls r2, 1 +_08161BC8: + strh r2, [r1, 0x8] + adds r7, r0, 0 + ldr r6, _08161CB0 + ldr r0, [r7] + ldr r5, _08161CAC + adds r0, r5 + ldrh r1, [r0, 0x8] + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r6, 0 + movs r2, 0x28 + movs r3, 0x20 + bl create_pokemon_set_level + ldr r0, [r7] + adds r0, r5 + movs r1, 0x28 + strb r1, [r0, 0xC] + ldr r0, [r7] + adds r0, r5 + strb r4, [r0, 0xD] + ldr r0, [r7] + adds r0, r5 + movs r1, 0x1 + strb r1, [r0, 0x13] + adds r0, r6, 0 + movs r1, 0x42 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + str r0, [r1, 0x4] + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + movs r2, 0 + mov r8, r2 + strh r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x16 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0xE] + adds r0, r6, 0 + movs r1, 0x17 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0xF] + adds r0, r6, 0 + movs r1, 0x18 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x10] + adds r0, r6, 0 + movs r1, 0x21 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x11] + adds r0, r6, 0 + movs r1, 0x2F + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x12] + ldr r4, _08161CB4 + mov r0, r8 + strb r0, [r4] + bl GenerateRandomNumber + ldr r5, _08161CB8 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r5 + ldrb r0, [r1] + strb r0, [r4, 0x1] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08161CA8: .4byte 0x03005d8c +_08161CAC: .4byte 0x000031dc +_08161CB0: .4byte 0x02024744 +_08161CB4: .4byte 0x0203bc86 +_08161CB8: .4byte 0x085cec30 + thumb_func_end sub_8161B94 + + thumb_func_start sub_8161CBC +sub_8161CBC: @ 8161CBC + push {lr} + bl sub_8161B34 + bl sub_8161B60 + ldr r0, _08161CD4 + ldrh r0, [r0] + bl sub_8161B94 + pop {r0} + bx r0 + .align 2, 0 +_08161CD4: .4byte 0x020375e0 + thumb_func_end sub_8161CBC + + thumb_func_start mapnumbers_history_shift_sav1_0_2_4_out +mapnumbers_history_shift_sav1_0_2_4_out: @ 8161CD8 + ldr r0, _08161CF8 + ldrb r1, [r0, 0x2] + strb r1, [r0, 0x4] + ldrb r1, [r0, 0x3] + strb r1, [r0, 0x5] + ldrb r1, [r0] + strb r1, [r0, 0x2] + ldrb r1, [r0, 0x1] + strb r1, [r0, 0x3] + ldr r1, _08161CFC + ldr r2, [r1] + ldrb r1, [r2, 0x4] + strb r1, [r0] + ldrb r1, [r2, 0x5] + strb r1, [r0, 0x1] + bx lr + .align 2, 0 +_08161CF8: .4byte 0x0203bc80 +_08161CFC: .4byte 0x03005d8c + thumb_func_end mapnumbers_history_shift_sav1_0_2_4_out + + thumb_func_start sub_8161D00 +sub_8161D00: @ 8161D00 + push {r4,r5,lr} + movs r1, 0 + ldr r0, _08161D44 + ldr r0, [r0] + ldr r2, _08161D48 + adds r0, r2 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161D3E + ldr r0, _08161D4C + strb r1, [r0] + ldr r5, _08161D50 + adds r4, r0, 0 +_08161D1A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r5 + ldrb r1, [r1] + ldrb r0, [r4, 0x1] + cmp r0, r1 + beq _08161D1A + strb r1, [r4, 0x1] +_08161D3E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08161D44: .4byte 0x03005d8c +_08161D48: .4byte 0x000031dc +_08161D4C: .4byte 0x0203bc86 +_08161D50: .4byte 0x085cec30 + thumb_func_end sub_8161D00 + + thumb_func_start sub_8161D54 +sub_8161D54: @ 8161D54 + push {r4-r7,lr} + movs r4, 0 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 12 + ands r1, r0 + cmp r1, 0 + bne _08161D6E + bl sub_8161D00 + b _08161DE2 +_08161D6E: + ldr r0, _08161DC4 + ldr r0, [r0] + ldr r1, _08161DC8 + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161DE2 + ldr r7, _08161DCC + ldr r3, _08161DD0 +_08161D80: + lsls r0, r4, 1 + adds r0, r4 + lsls r2, r0, 1 + adds r1, r2, r3 + ldrb r0, [r7, 0x1] + ldrb r1, [r1] + cmp r0, r1 + bne _08161DD8 + ldr r6, _08161DD0 + adds r5, r2, 0x1 + ldr r4, _08161DD4 +_08161D96: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, r5 + adds r0, r6 + ldrb r1, [r0] + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _08161DBA + ldrb r0, [r4, 0x5] + cmp r0, r1 + beq _08161D96 +_08161DBA: + cmp r1, 0xFF + beq _08161D96 + strb r1, [r7, 0x1] + b _08161DE2 + .align 2, 0 +_08161DC4: .4byte 0x03005d8c +_08161DC8: .4byte 0x000031dc +_08161DCC: .4byte 0x0203bc86 +_08161DD0: .4byte 0x085cec30 +_08161DD4: .4byte 0x0203bc80 +_08161DD8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08161D80 +_08161DE2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8161D54 + + thumb_func_start sub_8161DE8 +sub_8161DE8: @ 8161DE8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _08161E14 + ldr r0, [r0] + ldr r3, _08161E18 + adds r0, r3 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161E20 + ldr r0, _08161E1C + ldrb r3, [r0] + cmp r2, r3 + bne _08161E20 + ldrb r0, [r0, 0x1] + cmp r1, r0 + bne _08161E20 + movs r0, 0x1 + b _08161E22 + .align 2, 0 +_08161E14: .4byte 0x03005d8c +_08161E18: .4byte 0x000031dc +_08161E1C: .4byte 0x0203bc86 +_08161E20: + movs r0, 0 +_08161E22: + pop {r1} + bx r1 + thumb_func_end sub_8161DE8 + + thumb_func_start sub_8161E28 +sub_8161E28: @ 8161E28 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _08161EB4 + bl zero_enemy_party_data + ldr r4, _08161EB8 + ldr r0, [r4] + ldr r1, _08161EBC + adds r0, r1 + ldrh r1, [r0, 0x8] + ldrb r2, [r0, 0xC] + ldr r3, [r0] + ldr r0, [r0, 0x4] + str r0, [sp] + adds r0, r5, 0 + bl sub_8068060 + ldr r2, [r4] + ldr r0, _08161EC0 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl pokemon_setattr + ldr r2, [r4] + ldr r1, _08161EC4 + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_setattr + ldr r2, [r4] + ldr r0, _08161EC8 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x16 + bl pokemon_setattr + ldr r2, [r4] + ldr r1, _08161ECC + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x17 + bl pokemon_setattr + ldr r2, [r4] + ldr r0, _08161ED0 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x18 + bl pokemon_setattr + ldr r2, [r4] + ldr r1, _08161ED4 + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x21 + bl pokemon_setattr + ldr r2, [r4] + ldr r0, _08161ED8 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x2F + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08161EB4: .4byte 0x02024744 +_08161EB8: .4byte 0x03005d8c +_08161EBC: .4byte 0x000031dc +_08161EC0: .4byte 0x000031e9 +_08161EC4: .4byte 0x000031e6 +_08161EC8: .4byte 0x000031ea +_08161ECC: .4byte 0x000031eb +_08161ED0: .4byte 0x000031ec +_08161ED4: .4byte 0x000031ed +_08161ED8: .4byte 0x000031ee + thumb_func_end sub_8161E28 + + thumb_func_start sub_8161EDC +sub_8161EDC: @ 8161EDC + push {lr} + ldr r0, _08161F0C + ldr r1, [r0] + ldrb r0, [r1, 0x4] + ldrb r1, [r1, 0x5] + bl sub_8161DE8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08161F10 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _08161F10 + bl sub_8161E28 + movs r0, 0x1 + b _08161F12 + .align 2, 0 +_08161F0C: .4byte 0x03005d8c +_08161F10: + movs r0, 0 +_08161F12: + pop {r1} + bx r1 + thumb_func_end sub_8161EDC + + thumb_func_start sub_8161F18 +sub_8161F18: @ 8161F18 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x39 + bl pokemon_getattr + ldr r5, _08161F44 + ldr r1, [r5] + ldr r4, _08161F48 + adds r1, r4 + strh r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x37 + bl pokemon_getattr + ldr r1, [r5] + adds r1, r4 + strb r0, [r1, 0xD] + bl sub_8161D00 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08161F44: .4byte 0x03005d8c +_08161F48: .4byte 0x000031dc + thumb_func_end sub_8161F18 + + thumb_func_start sub_8161F4C +sub_8161F4C: @ 8161F4C + ldr r0, _08161F5C + ldr r0, [r0] + ldr r1, _08161F60 + adds r0, r1 + movs r1, 0 + strb r1, [r0, 0x13] + bx lr + .align 2, 0 +_08161F5C: .4byte 0x03005d8c +_08161F60: .4byte 0x000031dc + thumb_func_end sub_8161F4C + + thumb_func_start sub_8161F64 +sub_8161F64: @ 8161F64 + ldr r3, _08161F70 + ldrb r2, [r3] + strb r2, [r0] + ldrb r0, [r3, 0x1] + strb r0, [r1] + bx lr + .align 2, 0 +_08161F70: .4byte 0x0203bc86 + thumb_func_end sub_8161F64 + + thumb_func_start sub_8161F74 +sub_8161F74: @ 8161F74 + push {lr} + ldr r1, _08161F8C + ldr r0, _08161F90 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_08161F8C: .4byte 0x085df96c +_08161F90: .4byte 0x020375e0 + thumb_func_end sub_8161F74 + + thumb_func_start sub_8161F94 +sub_8161F94: @ 8161F94 + push {r4-r7,lr} + ldr r4, _08162034 + ldr r0, [r4] + ldr r1, _08162038 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _0816203C + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r4] + ldr r2, _08162040 + adds r0, r2 + movs r7, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r7, [r0] + ldr r0, _08162038 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, _08162038 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl sub_81A3ACC + ldr r4, [r4] + ldr r0, _08162044 + adds r3, r4, r0 + ldr r2, _08162048 + lsls r1, r5, 2 + lsls r0, r6, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0816200E + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + movs r2, 0xCE + lsls r2, 4 + adds r1, r4, r2 + adds r1, r0 + strh r7, [r1] +_0816200E: + bl sub_8164ED8 + ldr r0, _0816204C + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, _08162050 + strh r7, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08162034: .4byte 0x03005d90 +_08162038: .4byte 0x00000ca9 +_0816203C: .4byte 0x000040ce +_08162040: .4byte 0x00000ca8 +_08162044: .4byte 0x00000cdc +_08162048: .4byte 0x085df9ac +_0816204C: .4byte 0x03005d8c +_08162050: .4byte 0x02038bca + thumb_func_end sub_8161F94 + + thumb_func_start sub_8162054 +sub_8162054: @ 8162054 + push {r4-r6,lr} + ldr r5, _08162084 + ldr r0, [r5] + ldr r4, _08162088 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, _0816208C + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08162090 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08162094 + cmp r0, 0x1 + ble _081620E8 + cmp r0, 0x2 + beq _081620A8 + cmp r0, 0x3 + beq _081620D8 + b _081620E8 + .align 2, 0 +_08162084: .4byte 0x03005d90 +_08162088: .4byte 0x00000ca9 +_0816208C: .4byte 0x000040ce +_08162090: .4byte 0x020375e2 +_08162094: + adds r0, r6, 0 + lsls r1, 24 + lsrs r1, 24 + bl sub_8164FCC + ldr r1, _081620A4 + strh r0, [r1] + b _081620E8 + .align 2, 0 +_081620A4: .4byte 0x020375f0 +_081620A8: + ldr r4, _081620CC + ldr r2, [r5] + ldr r0, _081620D0 + adds r2, r0 + ldr r3, _081620D4 + lsls r0, r6, 2 + lsls r1, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _081620E8 + .align 2, 0 +_081620CC: .4byte 0x020375f0 +_081620D0: .4byte 0x00000cdc +_081620D4: .4byte 0x085df9ac +_081620D8: + ldr r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r2, _081620F0 + adds r1, r2 + strb r0, [r1] +_081620E8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081620F0: .4byte 0x00000d07 + thumb_func_end sub_8162054 + + thumb_func_start sub_81620F4 +sub_81620F4: @ 81620F4 + push {r4-r7,lr} + ldr r6, _08162124 + ldr r0, [r6] + ldr r7, _08162128 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _0816212C + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08162130 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08162134 + cmp r0, 0x1 + ble _081621B4 + cmp r0, 0x2 + beq _08162150 + cmp r0, 0x3 + beq _081621A4 + b _081621B4 + .align 2, 0 +_08162124: .4byte 0x03005d90 +_08162128: .4byte 0x00000ca9 +_0816212C: .4byte 0x000040ce +_08162130: .4byte 0x020375e2 +_08162134: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + movs r1, 0xCE + lsls r1, 4 + adds r2, r1 + adds r2, r0 + ldr r0, _0816214C + ldrh r0, [r0] + strh r0, [r2] + b _081621B4 + .align 2, 0 +_0816214C: .4byte 0x020375e4 +_08162150: + ldr r0, _08162174 + ldrh r0, [r0] + cmp r0, 0 + beq _08162180 + ldr r2, [r6] + ldr r0, _08162178 + adds r2, r0 + ldr r3, _0816217C + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _081621B4 + .align 2, 0 +_08162174: .4byte 0x020375e4 +_08162178: .4byte 0x00000cdc +_0816217C: .4byte 0x085df9ac +_08162180: + ldr r2, [r6] + ldr r1, _0816219C + adds r2, r1 + ldr r3, _081621A0 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _081621B4 + .align 2, 0 +_0816219C: .4byte 0x00000cdc +_081621A0: .4byte 0x085df9cc +_081621A4: + ldr r1, [r6] + adds r0, r1, r7 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r2, _081621BC + adds r1, r2 + strb r0, [r1] +_081621B4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081621BC: .4byte 0x00000d07 + thumb_func_end sub_81620F4 + + thumb_func_start sub_81621C0 +sub_81621C0: @ 81621C0 + push {r4,r5,lr} + ldr r0, _08162210 + ldrh r1, [r0] + movs r0, 0xFA + lsls r0, 1 + cmp r1, r0 + bne _081621DA + ldr r0, _08162214 + ldr r0, [r0] + ldr r1, _08162218 + adds r0, r1 + bl sub_816534C +_081621DA: + ldr r5, _08162214 + ldr r0, [r5] + ldr r1, _0816221C + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, _08162220 + cmp r1, r0 + bhi _081621EE + adds r0, r1, 0x1 + strh r0, [r2] +_081621EE: + ldr r1, [r5] + ldr r4, _08162224 + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl sub_8163E90 + ldr r1, _08162228 + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08162210: .4byte 0x02038bca +_08162214: .4byte 0x03005d90 +_08162218: .4byte 0x00000bec +_0816221C: .4byte 0x00000d04 +_08162220: .4byte 0x0000270e +_08162224: .4byte 0x00000cb2 +_08162228: .4byte 0x020375f0 + thumb_func_end sub_81621C0 + + thumb_func_start sub_816222C +sub_816222C: @ 816222C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + movs r0, 0 + str r0, [sp, 0x24] + ldr r4, _081623A0 + ldr r0, [r4] + ldr r1, _081623A4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + ldr r0, _081623A8 + bl var_get + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, _081623AC + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _08162266 + b _0816239C +_08162266: + mov r0, r10 + ldr r1, [sp, 0x2C] + bl sub_8164FCC + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x28] + movs r7, 0 + mov r2, sp + str r2, [sp, 0x34] +_0816227A: + movs r3, 0xEC + adds r0, r7, 0 + muls r0, r3 + movs r4, 0xE7 + lsls r4, 3 + adds r0, r4 + ldr r5, _081623A0 + ldr r1, [r5] + movs r2, 0 + mov r8, r2 + mov r9, r2 + movs r5, 0 + adds r3, r7, 0x1 + str r3, [sp, 0x30] + adds r1, r0 +_08162298: + ldm r1!, {r0} + mov r4, r8 + orrs r4, r0 + mov r8, r4 + add r9, r0 + adds r5, 0x1 + cmp r5, 0x39 + bls _08162298 + movs r6, 0 + movs r5, 0 + movs r0, 0xEC + adds r2, r7, 0 + muls r2, r0 +_081622B2: + ldr r3, _081623A0 + ldr r1, [r3] + movs r0, 0x2C + muls r0, r5 + adds r0, r2 + adds r1, r0 + ldr r4, _081623B0 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _081622E4 + movs r0, 0xEF + lsls r0, 3 + adds r4, r1, r0 + mov r0, r10 + str r2, [sp, 0x38] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x38] + cmp r1, r0 + bhi _081622E4 + adds r6, 0x1 +_081622E4: + adds r5, 0x1 + cmp r5, 0x3 + ble _081622B2 + ldr r0, _081623B4 + ldr r1, [sp, 0x2C] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r6, r0 + blt _0816233E + ldr r3, _081623A0 + ldr r2, [r3] + movs r4, 0xEC + adds r3, r7, 0 + muls r3, r4 + adds r1, r2, r3 + ldr r5, _081623B8 + adds r0, r1, r5 + ldrh r0, [r0] + ldr r4, [sp, 0x28] + cmp r0, r4 + bne _0816233E + subs r5, 0x2 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, r10 + bne _0816233E + mov r0, r8 + cmp r0, 0 + beq _0816233E + movs r1, 0x82 + lsls r1, 4 + adds r0, r2, r1 + adds r0, r3 + ldr r0, [r0] + cmp r0, r9 + bne _0816233E + movs r2, 0x96 + lsls r2, 1 + adds r0, r7, r2 + ldr r3, [sp, 0x34] + stm r3!, {r0} + str r3, [sp, 0x34] + ldr r4, [sp, 0x24] + adds r4, 0x1 + str r4, [sp, 0x24] +_0816233E: + ldr r7, [sp, 0x30] + cmp r7, 0x4 + ble _0816227A + ldr r5, [sp, 0x2C] + cmp r5, 0 + bne _08162396 + bl sub_8165B20 + movs r7, 0 + ldr r0, _081623A0 + ldr r0, [r0] + ldr r4, _081623BC + adds r2, r0, 0 + adds r2, 0xDC + ldr r1, [sp, 0x24] + lsls r0, r1, 2 + mov r5, sp + adds r3, r0, r5 +_08162362: + ldrb r0, [r2] + lsls r1, r0, 25 + lsrs r0, r1, 30 + cmp r0, 0 + beq _0816238E + ldrb r0, [r2, 0x1] + adds r0, r4 + ldrb r0, [r0] + ldr r5, [sp, 0x28] + cmp r0, r5 + bne _0816238E + lsrs r0, r1, 30 + subs r0, 0x1 + cmp r0, r10 + bne _0816238E + movs r1, 0xC8 + lsls r1, 1 + adds r0, r7, r1 + stm r3!, {r0} + ldr r5, [sp, 0x24] + adds r5, 0x1 + str r5, [sp, 0x24] +_0816238E: + adds r2, 0x44 + adds r7, 0x1 + cmp r7, 0x3 + ble _08162362 +_08162396: + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _081623C0 +_0816239C: + movs r0, 0 + b _081623DA + .align 2, 0 +_081623A0: .4byte 0x03005d90 +_081623A4: .4byte 0x00000ca9 +_081623A8: .4byte 0x000040ce +_081623AC: .4byte 0x000040cf +_081623B0: .4byte 0x0000076c +_081623B4: .4byte 0x085df9f6 +_081623B8: .4byte 0x0000073a +_081623BC: .4byte 0x085df9ec +_081623C0: + ldr r4, _081623EC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x24] + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4] + movs r0, 0x1 +_081623DA: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081623EC: .4byte 0x02038bca + thumb_func_end sub_816222C + + thumb_func_start sub_81623F0 +sub_81623F0: @ 81623F0 + push {r4-r7,lr} + ldr r6, _0816240C + ldr r0, [r6] + ldr r1, _08162410 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _08162414 + bl sub_8165E18 + b _08162530 + .align 2, 0 +_0816240C: .4byte 0x03005d90 +_08162410: .4byte 0x00000ca9 +_08162414: + ldr r0, _08162474 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + bl sub_8165C40 + subs r4, 0x2 + cmp r4, 0x1 + bhi _08162488 + ldr r1, [r6] + ldr r2, _08162478 + adds r0, r1, r2 + ldrh r3, [r0] + ldr r2, _0816247C + lsls r0, r3, 2 + ldr r4, _08162480 + adds r1, r4 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r4, _08162484 + lsls r0, r3, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4] + ldrh r0, [r2] + movs r1, 0 + bl sub_8162614 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_8162614 + b _08162530 + .align 2, 0 +_08162474: .4byte 0x000040ce +_08162478: .4byte 0x00000cb2 +_0816247C: .4byte 0x02038bca +_08162480: .4byte 0x00000cb4 +_08162484: .4byte 0x02038bcc +_08162488: + bl sub_816222C + lsls r0, 24 + cmp r0, 0 + beq _081624B4 + ldr r4, _081624AC + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + ldr r1, [r6] + ldr r2, _081624B0 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 1 + adds r2, 0x2 + b _08162528 + .align 2, 0 +_081624AC: .4byte 0x02038bca +_081624B0: .4byte 0x00000cb2 +_081624B4: + lsls r7, r5, 24 + adds r5, r6, 0 + ldr r6, _08162538 +_081624BA: + ldr r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsrs r0, r7, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, [r5] + adds r0, r1, r6 + ldrh r0, [r0] + cmp r4, r0 + bge _081624FC + ldr r2, _0816253C + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081624FC + ldr r0, _08162540 + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, _0816253C + adds r1, r0 +_081624EE: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, r2 + bge _081624FC + ldrh r0, [r1] + cmp r0, r3 + bne _081624EE +_081624FC: + ldr r0, [r5] + ldr r1, _08162538 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _081624BA + ldr r4, _08162544 + strh r3, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + ldr r0, _08162540 + ldr r1, [r0] + ldr r2, _08162538 + adds r0, r1, r2 + ldrh r2, [r0] + adds r0, r2, 0x1 + cmp r0, 0x6 + bgt _08162530 + lsls r0, r2, 1 + ldr r2, _0816253C +_08162528: + adds r1, r2 + adds r1, r0 + ldrh r0, [r4] + strh r0, [r1] +_08162530: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08162538: .4byte 0x00000cb2 +_0816253C: .4byte 0x00000cb4 +_08162540: .4byte 0x03005d90 +_08162544: .4byte 0x02038bca + thumb_func_end sub_81623F0 + + thumb_func_start sub_8162548 +sub_8162548: @ 8162548 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x7 + bhi _08162584 + cmp r1, 0x6 + bne _08162570 + ldr r2, _0816256C + lsls r1, r0, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + b _0816258A + .align 2, 0 +_0816256C: .4byte 0x085dfa1a +_08162570: + ldr r2, _08162580 + lsls r1, r3, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + b _0816258A + .align 2, 0 +_08162580: .4byte 0x085df9fa +_08162584: + ldr r1, _081625B0 + ldrh r0, [r1, 0x1E] + ldrh r4, [r1, 0x1C] +_0816258A: + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + adds r4, r0 + lsls r4, 16 + lsrs r5, r4, 16 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081625B0: .4byte 0x085df9fa + thumb_func_end sub_8162548 + + thumb_func_start sub_81625B4 +sub_81625B4: @ 81625B4 + push {r4,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x7 + bhi _081625F4 + cmp r1, 0x6 + bne _081625D4 + ldr r1, _081625D0 + lsls r2, r0, 2 + b _081625D8 + .align 2, 0 +_081625D0: .4byte 0x085dfa1a +_081625D4: + ldr r1, _081625F0 + lsls r2, 2 +_081625D8: + adds r0, r1, 0x2 + adds r0, r2, r0 + adds r2, r1 + ldrh r0, [r0] + ldrh r1, [r2] + subs r0, r1 + adds r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r0, [r2] + b _08162604 + .align 2, 0 +_081625F0: .4byte 0x085df9fa +_081625F4: + ldr r0, _08162610 + ldrh r1, [r0, 0x1E] + ldrh r2, [r0, 0x1C] + subs r1, r2 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldrh r0, [r0, 0x1C] +_08162604: + strh r0, [r4] + strb r1, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08162610: .4byte 0x085df9fa + thumb_func_end sub_81625B4 + + thumb_func_start sub_8162614 +sub_8162614: @ 8162614 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162640 + ldr r0, _08162638 + ldr r0, [r0] + ldr r1, _0816263C + adds r0, r1 + b _081626BA + .align 2, 0 +_08162638: .4byte 0x03005d90 +_0816263C: .4byte 0x00000bed +_08162640: + ldr r0, _0816264C + cmp r4, r0 + bne _08162650 + bl sub_81A4DD8 + b _08162788 + .align 2, 0 +_0816264C: .4byte 0x000003fe +_08162650: + ldr r0, _08162664 + cmp r4, r0 + bhi _0816266C + ldr r0, _08162668 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _081626BA + .align 2, 0 +_08162664: .4byte 0x0000012b +_08162668: .4byte 0x0203bc88 +_0816266C: + ldr r0, _08162688 + cmp r4, r0 + bhi _08162698 + ldr r0, _0816268C + ldr r0, [r0] + ldr r1, _08162690 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, _08162694 + adds r0, r1 + b _081626BA + .align 2, 0 +_08162688: .4byte 0x0000018f +_0816268C: .4byte 0x03005d90 +_08162690: .4byte 0xfffffed4 +_08162694: .4byte 0x00000739 +_08162698: + ldr r3, _081626EC + ldr r0, _081626F0 + ldr r1, [r0] + ldr r0, _081626F4 + adds r2, r6, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_081626BA: + ldrb r2, [r0] + movs r1, 0 + ldr r3, _081626F8 + ldrb r0, [r3] + cmp r0, r2 + beq _081626D4 +_081626C6: + adds r1, 0x1 + cmp r1, 0x1D + bhi _081626D4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081626C6 +_081626D4: + cmp r1, 0x1E + beq _08162700 + ldr r0, _081626FC + adds r0, r1, r0 + ldrb r1, [r0] + cmp r5, 0x1 + beq _08162744 + cmp r5, 0x1 + ble _0816272E + cmp r5, 0xF + bne _0816272E + b _08162750 + .align 2, 0 +_081626EC: .4byte 0x08610970 +_081626F0: .4byte 0x03005d90 +_081626F4: .4byte 0xfffffe70 +_081626F8: .4byte 0x085dcedc +_081626FC: .4byte 0x085dcf0e +_08162700: + movs r1, 0 + ldr r3, _08162738 + ldrb r0, [r3] + cmp r0, r2 + beq _08162718 +_0816270A: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08162718 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _0816270A +_08162718: + cmp r1, 0x14 + beq _0816275C + ldr r0, _0816273C + adds r0, r1, r0 + ldrb r1, [r0] + cmp r5, 0x1 + beq _08162744 + cmp r5, 0x1 + ble _0816272E + cmp r5, 0xF + beq _08162750 +_0816272E: + ldr r0, _08162740 + bl var_set + b _08162788 + .align 2, 0 +_08162738: .4byte 0x085dcefa +_0816273C: .4byte 0x085dcf2c +_08162740: .4byte 0x00004010 +_08162744: + ldr r0, _0816274C + bl var_set + b _08162788 + .align 2, 0 +_0816274C: .4byte 0x00004011 +_08162750: + ldr r0, _08162758 + bl var_set + b _08162788 + .align 2, 0 +_08162758: .4byte 0x0000401e +_0816275C: + cmp r5, 0x1 + beq _08162770 + cmp r5, 0x1 + ble _08162768 + cmp r5, 0xF + beq _08162780 +_08162768: + ldr r0, _0816276C + b _08162772 + .align 2, 0 +_0816276C: .4byte 0x00004010 +_08162770: + ldr r0, _0816277C +_08162772: + movs r1, 0x7 + bl var_set + b _08162788 + .align 2, 0 +_0816277C: .4byte 0x00004011 +_08162780: + ldr r0, _08162790 + movs r1, 0x7 + bl var_set +_08162788: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08162790: .4byte 0x0000401e + thumb_func_end sub_8162614 + + thumb_func_start sub_8162794 +sub_8162794: @ 8162794 + push {lr} + movs r0, 0xFA + lsls r0, 1 + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + thumb_func_end sub_8162794 + + thumb_func_start sub_81627A4 +sub_81627A4: @ 81627A4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _081627CC + ldr r0, _081627C4 + ldr r0, [r0] + ldr r1, _081627C8 + adds r0, r1 + b _08162836 + .align 2, 0 +_081627C4: .4byte 0x03005d90 +_081627C8: .4byte 0x00000bed +_081627CC: + ldr r0, _081627E0 + cmp r4, r0 + bhi _081627E8 + ldr r0, _081627E4 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _08162836 + .align 2, 0 +_081627E0: .4byte 0x0000012b +_081627E4: .4byte 0x0203bc88 +_081627E8: + ldr r0, _08162804 + cmp r4, r0 + bhi _08162814 + ldr r0, _08162808 + ldr r0, [r0] + ldr r1, _0816280C + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, _08162810 + adds r0, r1 + b _08162836 + .align 2, 0 +_08162804: .4byte 0x0000018f +_08162808: .4byte 0x03005d90 +_0816280C: .4byte 0xfffffed4 +_08162810: .4byte 0x00000739 +_08162814: + ldr r3, _08162858 + ldr r0, _0816285C + ldr r1, [r0] + ldr r0, _08162860 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_08162836: + ldrb r2, [r0] + movs r1, 0 + ldr r3, _08162864 + ldrb r0, [r3] + cmp r0, r2 + beq _08162850 +_08162842: + adds r1, 0x1 + cmp r1, 0x1D + bhi _08162850 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08162842 +_08162850: + cmp r1, 0x1E + beq _0816286C + ldr r0, _08162868 + b _08162892 + .align 2, 0 +_08162858: .4byte 0x08610970 +_0816285C: .4byte 0x03005d90 +_08162860: .4byte 0xfffffe70 +_08162864: .4byte 0x085dcedc +_08162868: .4byte 0x085dcf0e +_0816286C: + movs r1, 0 + ldr r3, _0816288C + ldrb r0, [r3] + cmp r0, r2 + beq _08162884 +_08162876: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08162884 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08162876 +_08162884: + cmp r1, 0x14 + bne _08162890 + movs r0, 0x7 + b _08162896 + .align 2, 0 +_0816288C: .4byte 0x085dcefa +_08162890: + ldr r0, _0816289C +_08162892: + adds r0, r1, r0 + ldrb r0, [r0] +_08162896: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0816289C: .4byte 0x085dcf2c + thumb_func_end sub_81627A4 + + thumb_func_start sub_81628A0 +sub_81628A0: @ 81628A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r1, 0 + mov r8, r1 + mov r10, r0 + movs r5, 0 + ldr r2, _08162924 + ldr r0, [r2] + mov r4, r10 + ldrb r4, [r4, 0xC] + str r4, [sp, 0x18] + mov r9, r5 + movs r7, 0x4 + str r7, [sp, 0x1C] + ldr r1, _08162928 + adds r1, r0 + mov r12, r1 +_081628CA: + movs r6, 0 + movs r3, 0 + mov r2, r12 + ldrb r0, [r2] + ldr r4, [sp, 0x18] + cmp r0, r4 + bne _081628FA + mov r4, r9 + mov r2, r10 + adds r2, 0xC +_081628DE: + adds r3, 0x1 + cmp r3, 0x3 + bgt _081628FA + ldr r7, _08162924 + ldr r0, [r7] + adds r1, r3, r4 + ldr r7, _08162928 + adds r0, r7 + adds r0, r1 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081628DE +_081628FA: + cmp r3, 0x4 + bne _08162944 + movs r6, 0 + ldr r1, _08162924 + ldr r0, [r1] + ldr r3, _0816292C + adds r0, r3 + ldr r2, [sp, 0x1C] + adds r0, r2 + ldrb r0, [r0] + mov r4, r10 + ldrb r4, [r4, 0x8] + cmp r0, r4 + bne _08162944 + adds r1, r0, 0 + mov r2, r9 + adds r2, 0x4 +_0816291C: + cmp r1, 0xFF + bne _08162930 + movs r6, 0x7 + b _08162944 + .align 2, 0 +_08162924: .4byte 0x03005d90 +_08162928: .4byte 0x00000744 +_0816292C: .4byte 0x0000073c +_08162930: + adds r6, 0x1 + cmp r6, 0x6 + bgt _08162944 + ldr r7, _08162970 + ldr r0, [r7] + adds r0, r3 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r1 + beq _0816291C +_08162944: + cmp r6, 0x7 + beq _0816295A + movs r0, 0xEC + add r9, r0 + ldr r1, [sp, 0x1C] + adds r1, 0xEC + str r1, [sp, 0x1C] + add r12, r0 + adds r5, 0x1 + cmp r5, 0x4 + ble _081628CA +_0816295A: + cmp r5, 0x4 + bgt _08162974 + ldr r2, _08162970 + ldr r0, [r2] + movs r1, 0xEC + muls r1, r5 + adds r0, r1 + movs r4, 0xE7 + lsls r4, 3 + adds r0, r4 + b _081629B2 + .align 2, 0 +_08162970: .4byte 0x03005d90 +_08162974: + movs r5, 0 + ldr r7, _081629BC + ldr r0, [r7] + ldr r1, _081629C0 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0816299E + adds r3, r7, 0 + adds r2, r1, 0 + movs r1, 0 +_0816298A: + adds r1, 0xEC + adds r5, 0x1 + cmp r5, 0x4 + bgt _081629C4 + ldr r0, [r3] + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _0816298A +_0816299E: + cmp r5, 0x4 + bgt _081629C4 + ldr r1, _081629BC + ldr r0, [r1] + movs r1, 0xEC + muls r1, r5 + adds r0, r1 + movs r2, 0xE7 + lsls r2, 3 + adds r0, r2 +_081629B2: + mov r1, r10 + movs r2, 0xEC + bl memcpy + b _08162A8A + .align 2, 0 +_081629BC: .4byte 0x03005d90 +_081629C0: .4byte 0x0000073a +_081629C4: + mov r2, sp + ldr r4, _08162A1C + ldr r0, [r4] + ldr r3, _08162A20 + adds r0, r3 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + add r0, sp, 0xC + strh r1, [r0] + movs r7, 0x1 + add r8, r7 + movs r5, 0x1 + add r0, sp, 0xC + mov r9, r0 + mov r12, r3 +_081629E4: + movs r3, 0 + adds r7, r5, 0x1 + cmp r3, r8 + bge _08162A2E + ldr r1, _08162A1C + ldr r0, [r1] + movs r2, 0xEC + adds r1, r5, 0 + muls r1, r2 + adds r0, r1 + mov r1, r12 + adds r4, r0, r1 + mov r6, sp +_081629FE: + lsls r0, r3, 1 + add r0, sp + ldrh r2, [r4] + adds r1, r2, 0 + ldrh r0, [r0] + cmp r1, r0 + bcs _08162A24 + movs r3, 0 + movs r4, 0x1 + mov r8, r4 + strh r2, [r6] + mov r0, r9 + strh r5, [r0] + b _08162A2E + .align 2, 0 +_08162A1C: .4byte 0x03005d90 +_08162A20: .4byte 0x0000073a +_08162A24: + cmp r1, r0 + bhi _08162A2E + adds r3, 0x1 + cmp r3, r8 + blt _081629FE +_08162A2E: + cmp r3, r8 + bne _08162A54 + mov r1, r8 + lsls r2, r1, 1 + mov r4, sp + adds r3, r4, r2 + ldr r1, _08162A9C + ldr r0, [r1] + movs r4, 0xEC + adds r1, r5, 0 + muls r1, r4 + adds r0, r1 + add r0, r12 + ldrh r0, [r0] + strh r0, [r3] + add r2, r9 + strh r5, [r2] + movs r0, 0x1 + add r8, r0 +_08162A54: + adds r5, r7, 0 + cmp r5, 0x4 + ble _081629E4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + adds r5, r0, 0 + ldr r0, _08162A9C + ldr r0, [r0] + lsls r1, r5, 1 + add r1, sp + adds r1, 0xC + ldrh r2, [r1] + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + mov r1, r10 + movs r2, 0xEC + bl memcpy +_08162A8A: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08162A9C: .4byte 0x03005d90 + thumb_func_end sub_81628A0 + + thumb_func_start sub_8162AA0 +sub_8162AA0: @ 8162AA0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162AD0 + ldr r1, _08162AC4 + ldr r0, _08162AC8 + ldr r0, [r0] + ldr r2, _08162ACC + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + b _08162BC8 + .align 2, 0 +_08162AC4: .4byte 0x0831f578 +_08162AC8: .4byte 0x03005d90 +_08162ACC: .4byte 0x00000bed +_08162AD0: + ldr r0, _08162AE0 + cmp r4, r0 + bne _08162AE4 + bl sub_81A4CB0 + lsls r0, 24 + lsrs r0, 24 + b _08162BCA + .align 2, 0 +_08162AE0: .4byte 0x000003fe +_08162AE4: + ldr r0, _08162AFC + cmp r4, r0 + bhi _08162B08 + ldr r2, _08162B00 + ldr r0, _08162B04 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldrb r0, [r0] + adds r0, r2 + b _08162BC8 + .align 2, 0 +_08162AFC: .4byte 0x0000012b +_08162B00: .4byte 0x0831f578 +_08162B04: .4byte 0x0203bc88 +_08162B08: + ldr r0, _08162B2C + cmp r4, r0 + bhi _08162B64 + ldr r0, _08162B30 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162B38 + ldr r4, _08162B34 + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + b _08162BC8 + .align 2, 0 +_08162B2C: .4byte 0x0000018f +_08162B30: .4byte 0x02022fec +_08162B34: .4byte 0x0831f578 +_08162B38: + ldr r3, _08162B54 + ldr r0, _08162B58 + ldr r0, [r0] + ldr r1, _08162B5C + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r2, _08162B60 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + b _08162BC8 + .align 2, 0 +_08162B54: .4byte 0x0831f578 +_08162B58: .4byte 0x03005d90 +_08162B5C: .4byte 0xfffffed4 +_08162B60: .4byte 0x00000739 +_08162B64: + ldr r0, _08162B9C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08162BB0 + ldr r4, _08162BA0 + ldr r3, _08162BA4 + ldr r0, _08162BA8 + ldr r1, [r0] + ldr r0, _08162BAC + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r4 + b _08162BC8 + .align 2, 0 +_08162B9C: .4byte 0x02022fec +_08162BA0: .4byte 0x0831f578 +_08162BA4: .4byte 0x08610970 +_08162BA8: .4byte 0x03005d90 +_08162BAC: .4byte 0xfffffe70 +_08162BB0: + ldr r5, _08162BD0 + ldr r4, _08162BD4 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r5 +_08162BC8: + ldrb r0, [r0] +_08162BCA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08162BD0: .4byte 0x0831f578 +_08162BD4: .4byte 0x08610970 + thumb_func_end sub_8162AA0 + + thumb_func_start sub_8162BD8 +sub_8162BD8: @ 8162BD8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162C08 + ldr r1, _08162BFC + ldr r0, _08162C00 + ldr r0, [r0] + ldr r2, _08162C04 + adds r0, r2 + ldrb r0, [r0] + b _08162C26 + .align 2, 0 +_08162BFC: .4byte 0x0831f5ca +_08162C00: .4byte 0x03005d90 +_08162C04: .4byte 0x00000bed +_08162C08: + ldr r0, _08162C18 + cmp r4, r0 + bne _08162C1C + bl sub_81A4D00 + lsls r0, 24 + lsrs r0, 24 + b _08162D1E + .align 2, 0 +_08162C18: .4byte 0x000003fe +_08162C1C: + ldr r0, _08162C2C + cmp r4, r0 + bne _08162C38 + ldr r0, _08162C30 + ldr r1, _08162C34 +_08162C26: + adds r0, r1 + ldrb r0, [r0] + b _08162D1E + .align 2, 0 +_08162C2C: .4byte 0x00000c03 +_08162C30: .4byte 0x08310030 +_08162C34: .4byte 0x00007da1 +_08162C38: + ldr r0, _08162C54 + cmp r4, r0 + bhi _08162C60 + ldr r2, _08162C58 + ldr r0, _08162C5C + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + b _08162D1E + .align 2, 0 +_08162C54: .4byte 0x0000012b +_08162C58: .4byte 0x0831f5ca +_08162C5C: .4byte 0x0203bc88 +_08162C60: + ldr r0, _08162C84 + cmp r4, r0 + bhi _08162CBC + ldr r0, _08162C88 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162C90 + ldr r4, _08162C8C + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + b _08162D1E + .align 2, 0 +_08162C84: .4byte 0x0000018f +_08162C88: .4byte 0x02022fec +_08162C8C: .4byte 0x0831f5ca +_08162C90: + ldr r3, _08162CAC + ldr r0, _08162CB0 + ldr r0, [r0] + ldr r1, _08162CB4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r2, _08162CB8 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r0, [r0] + b _08162D1E + .align 2, 0 +_08162CAC: .4byte 0x0831f5ca +_08162CB0: .4byte 0x03005d90 +_08162CB4: .4byte 0xfffffed4 +_08162CB8: .4byte 0x00000739 +_08162CBC: + ldr r0, _08162CE8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162CF4 + ldr r5, _08162CEC + ldr r4, _08162CF0 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r5 + ldrb r0, [r0] + b _08162D1E + .align 2, 0 +_08162CE8: .4byte 0x02022fec +_08162CEC: .4byte 0x0831f5ca +_08162CF0: .4byte 0x08610970 +_08162CF4: + ldr r4, _08162D24 + ldr r3, _08162D28 + ldr r0, _08162D2C + ldr r1, [r0] + ldr r0, _08162D30 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r4 + ldrb r0, [r0] +_08162D1E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08162D24: .4byte 0x0831f5ca +_08162D28: .4byte 0x08610970 +_08162D2C: .4byte 0x03005d90 +_08162D30: .4byte 0xfffffe70 + thumb_func_end sub_8162BD8 + + thumb_func_start sub_8162D34 +sub_8162D34: @ 8162D34 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162D5C + ldr r0, _08162D54 + ldr r0, [r0] + ldr r1, _08162D58 + adds r0, r1 + b _08162E0A + .align 2, 0 +_08162D54: .4byte 0x03005d90 +_08162D58: .4byte 0x00000bed +_08162D5C: + ldr r0, _08162D70 + cmp r4, r0 + bhi _08162D78 + ldr r0, _08162D74 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _08162E0A + .align 2, 0 +_08162D70: .4byte 0x0000012b +_08162D74: .4byte 0x0203bc88 +_08162D78: + ldr r0, _08162D98 + cmp r4, r0 + bhi _08162DC0 + ldr r0, _08162D9C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162DA0 + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + b _08162E0C + .align 2, 0 +_08162D98: .4byte 0x0000018f +_08162D9C: .4byte 0x02022fec +_08162DA0: + ldr r0, _08162DB4 + ldr r0, [r0] + ldr r1, _08162DB8 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, _08162DBC + adds r0, r1 + b _08162E0A + .align 2, 0 +_08162DB4: .4byte 0x03005d90 +_08162DB8: .4byte 0xfffffed4 +_08162DBC: .4byte 0x00000739 +_08162DC0: + ldr r0, _08162DE0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162DE8 + ldr r4, _08162DE4 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + b _08162E08 + .align 2, 0 +_08162DE0: .4byte 0x02022fec +_08162DE4: .4byte 0x08610970 +_08162DE8: + ldr r3, _08162E14 + ldr r0, _08162E18 + ldr r1, [r0] + ldr r0, _08162E1C + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 +_08162E08: + adds r0, 0x32 +_08162E0A: + ldrb r0, [r0] +_08162E0C: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08162E14: .4byte 0x08610970 +_08162E18: .4byte 0x03005d90 +_08162E1C: .4byte 0xfffffe70 + thumb_func_end sub_8162D34 + + thumb_func_start sub_8162E20 +sub_8162E20: @ 8162E20 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bne _08162E54 + ldr r0, _08162E50 + ldr r0, [r0] + movs r1, 0xBF + lsls r1, 4 + adds r2, r0, r1 +_08162E40: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E40 + b _08162F5C + .align 2, 0 +_08162E50: .4byte 0x03005d90 +_08162E54: + ldr r0, _08162E64 + cmp r5, r0 + bne _08162E68 + adds r0, r6, 0 + bl sub_81A4D50 + b _08162F62 + .align 2, 0 +_08162E64: .4byte 0x000003fe +_08162E68: + ldr r0, _08162E80 + cmp r5, r0 + bne _08162E88 + ldr r2, _08162E84 +_08162E70: + adds r0, r6, r4 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E70 + b _08162F5C + .align 2, 0 +_08162E80: .4byte 0x00000c03 +_08162E84: .4byte 0x08317dd4 +_08162E88: + ldr r0, _08162EAC + cmp r5, r0 + bhi _08162EB4 + ldr r0, _08162EB0 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_08162E9A: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E9A + b _08162F5C + .align 2, 0 +_08162EAC: .4byte 0x0000012b +_08162EB0: .4byte 0x0203bc88 +_08162EB4: + ldr r0, _08162ED0 + cmp r5, r0 + bhi _08162F00 + ldr r0, _08162ED4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162ED8 + adds r0, r6, 0 + bl sub_8186468 + b _08162F62 + .align 2, 0 +_08162ED0: .4byte 0x0000018f +_08162ED4: .4byte 0x02022fec +_08162ED8: + ldr r2, _08162EF8 + movs r0, 0xEC + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08162EFC + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r1, r0, 0x4 + adds r0, 0xE4 + ldrb r2, [r0] + adds r0, r6, 0 + bl sub_81DB5E8 + b _08162F62 + .align 2, 0 +_08162EF8: .4byte 0x03005d90 +_08162EFC: .4byte 0xfffef2a8 +_08162F00: + ldr r0, _08162F20 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162F24 + bl sub_81864A8 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81864C0 + lsls r0, 24 + lsrs r4, r0, 24 + b _08162F3E + .align 2, 0 +_08162F20: .4byte 0x02022fec +_08162F24: + ldr r1, _08162F54 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r2, _08162F58 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + ldrb r0, [r1] + lsls r0, 27 + lsrs r5, r0, 27 + adds r1, 0x3F + ldrb r4, [r1] +_08162F3E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81A1650 + adds r1, r0, 0 + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_81DB5E8 + b _08162F62 + .align 2, 0 +_08162F54: .4byte 0x03005d90 +_08162F58: .4byte 0xffff969c +_08162F5C: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08162F62: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8162E20 + + thumb_func_start sub_8162F68 +sub_8162F68: @ 8162F68 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162F90 + ldr r0, _08162F88 + ldr r0, [r0] + ldr r1, _08162F8C + adds r0, r1 + b _0816300E + .align 2, 0 +_08162F88: .4byte 0x03005d90 +_08162F8C: .4byte 0x00000bed +_08162F90: + ldr r0, _08162FA0 + cmp r4, r0 + bne _08162FA4 + bl sub_81A4DB8 + lsls r0, 24 + lsrs r0, 24 + b _08163042 + .align 2, 0 +_08162FA0: .4byte 0x000003fe +_08162FA4: + ldr r0, _08162FB8 + cmp r4, r0 + bhi _08162FC0 + ldr r0, _08162FBC + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _0816300E + .align 2, 0 +_08162FB8: .4byte 0x0000012b +_08162FBC: .4byte 0x0203bc88 +_08162FC0: + ldr r0, _08162FDC + cmp r4, r0 + bhi _08162FEC + ldr r0, _08162FE0 + ldr r0, [r0] + ldr r1, _08162FE4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, _08162FE8 + adds r0, r1 + b _0816300E + .align 2, 0 +_08162FDC: .4byte 0x0000018f +_08162FE0: .4byte 0x03005d90 +_08162FE4: .4byte 0xfffffed4 +_08162FE8: .4byte 0x00000739 +_08162FEC: + ldr r3, _08163030 + ldr r0, _08163034 + ldr r1, [r0] + ldr r0, _08163038 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_0816300E: + ldrb r2, [r0] + movs r1, 0 + ldr r3, _0816303C + ldrb r0, [r3] + cmp r0, r2 + beq _08163028 +_0816301A: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08163028 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _0816301A +_08163028: + cmp r1, 0x14 + bne _08163040 + movs r0, 0 + b _08163042 + .align 2, 0 +_08163030: .4byte 0x08610970 +_08163034: .4byte 0x03005d90 +_08163038: .4byte 0xfffffe70 +_0816303C: .4byte 0x085dcefa +_08163040: + movs r0, 0x1 +_08163042: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8162F68 + + thumb_func_start sub_8163048 +sub_8163048: @ 8163048 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl zero_enemy_party_data + ldr r0, _08163068 + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_81630C4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08163068: .4byte 0x02038bca + thumb_func_end sub_8163048 + + thumb_func_start sub_816306C +sub_816306C: @ 816306C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl zero_enemy_party_data + ldr r0, _08163098 + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_81630C4 + ldr r0, _0816309C + ldrh r0, [r0] + movs r1, 0x3 + adds r2, r4, 0 + bl sub_81630C4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08163098: .4byte 0x02038bca +_0816309C: .4byte 0x02038bcc + thumb_func_end sub_816306C + + thumb_func_start sub_81630A0 +sub_81630A0: @ 81630A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl zero_enemy_party_data + ldr r0, _081630C0 + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_8165EA4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081630C0: .4byte 0x02038bca + thumb_func_end sub_81630A0 + + thumb_func_start sub_81630C4 +sub_81630C4: @ 81630C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + add r4, sp, 0x14 + movs r0, 0xFF + strb r0, [r4] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r0, _08163128 + cmp r5, r0 + bhi _08163138 + adds r0, r5, 0 + bl sub_8165D08 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + ldr r0, _0816312C + ldrh r2, [r0] + ldr r0, _08163130 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r2 + adds r0, r1 + ldr r0, [r0, 0x30] + str r0, [sp, 0x2C] + movs r0, 0 + str r0, [sp, 0x28] + ldr r2, [sp, 0x2C] + ldrh r1, [r2] + ldr r0, _08163134 + cmp r1, r0 + bne _08163124 + b _08163278 +_08163124: + b _08163260 + .align 2, 0 +_08163128: .4byte 0x0000012b +_0816312C: .4byte 0x02038bca +_08163130: .4byte 0x0203bc88 +_08163134: .4byte 0x0000ffff +_08163138: + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bne _08163180 + ldr r7, [sp, 0x18] + adds r0, r7, 0x3 + cmp r7, r0 + blt _0816314A + b _08163426 +_0816314A: + ldr r4, _08163178 +_0816314C: + movs r0, 0x64 + muls r0, r7 + ldr r1, _0816317C + adds r0, r1 + ldr r5, [sp, 0x18] + subs r2, r7, r5 + movs r1, 0x2C + muls r2, r1 + movs r6, 0xC2 + lsls r6, 4 + adds r2, r6 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r7, 0x1 + adds r0, r5, 0 + adds r0, 0x3 + cmp r7, r0 + blt _0816314C + b _08163426 + .align 2, 0 +_08163178: .4byte 0x03005d90 +_0816317C: .4byte 0x02024744 +_08163180: + ldr r0, _0816318C + cmp r5, r0 + bne _08163190 + bl sub_81A4E04 + b _08163426 + .align 2, 0 +_0816318C: .4byte 0x000003fe +_08163190: + ldr r0, _08163200 + cmp r5, r0 + bhi _08163218 + movs r6, 0 + ldr r7, [sp, 0x18] + ldr r1, [sp, 0x1C] + adds r0, r7, r1 + cmp r7, r0 + blt _081631A4 + b _08163426 +_081631A4: + ldr r2, _08163204 + adds r1, r5, r2 + movs r0, 0xEC + adds r2, r1, 0 + muls r2, r0 + mov r8, r2 + muls r0, r5 + ldr r5, _08163208 + adds r4, r0, r5 +_081631B6: + ldr r0, _0816320C + ldr r3, [r0] + movs r0, 0x2C + adds r2, r6, 0 + muls r2, r0 + mov r1, r8 + adds r0, r2, r1 + adds r1, r3, r0 + ldr r5, _08163210 + adds r0, r1, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _081631F0 + adds r5, 0xC + adds r0, r1, r5 + ldrb r0, [r0] + ldr r1, [sp, 0x20] + cmp r0, r1 + bhi _081631F0 + movs r0, 0x64 + muls r0, r7 + ldr r1, _08163214 + adds r0, r1 + adds r1, r3, r4 + adds r2, 0x34 + adds r1, r2 + movs r2, 0 + bl sub_8068338 +_081631F0: + adds r6, 0x1 + adds r7, 0x1 + ldr r2, [sp, 0x18] + ldr r5, [sp, 0x1C] + adds r0, r2, r5 + cmp r7, r0 + blt _081631B6 + b _08163426 + .align 2, 0 +_08163200: .4byte 0x0000018f +_08163204: .4byte 0xfffffed4 +_08163208: .4byte 0xfffef2a8 +_0816320C: .4byte 0x03005d90 +_08163210: .4byte 0x0000076c +_08163214: .4byte 0x02024744 +_08163218: + ldr r7, [sp, 0x18] + adds r0, r7, 0x3 + cmp r7, r0 + blt _08163222 + b _08163426 +_08163222: + ldr r6, _08163254 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, _08163258 + adds r5, r0, r1 + movs r4, 0 +_08163230: + movs r0, 0x64 + muls r0, r7 + ldr r1, _0816325C + adds r0, r1 + ldr r1, [r6] + adds r1, r5 + lsrs r2, r4, 24 + bl sub_8068528 + movs r2, 0x80 + lsls r2, 17 + adds r4, r2 + adds r7, 0x1 + ldr r0, [sp, 0x18] + adds r0, 0x3 + cmp r7, r0 + blt _08163230 + b _08163426 + .align 2, 0 +_08163254: .4byte 0x03005d90 +_08163258: .4byte 0xffff969c +_0816325C: .4byte 0x02024744 +_08163260: + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + lsls r0, 1 + ldr r5, [sp, 0x2C] + adds r0, r5 + ldrh r1, [r0] + ldr r0, _081632C8 + cmp r1, r0 + bne _08163260 +_08163278: + movs r7, 0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x30] + ldr r6, [sp, 0x1C] + cmp r7, r6 + bne _08163296 + b _08163426 +_08163296: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x28] + bl __modsi3 + lsls r0, 1 + ldr r1, [sp, 0x2C] + adds r0, r1 + ldrh r4, [r0] + ldr r2, [sp, 0x20] + cmp r2, 0x32 + beq _081632B6 + cmp r2, 0x14 + bne _081632BE +_081632B6: + ldr r0, _081632CC + cmp r4, r0 + bls _081632BE + b _0816341E +_081632BE: + movs r6, 0 + ldr r5, [sp, 0x18] + adds r5, r7 + mov r8, r5 + b _081632D2 + .align 2, 0 +_081632C8: .4byte 0x0000ffff +_081632CC: .4byte 0x00000351 +_081632D0: + adds r6, 0x1 +_081632D2: + cmp r6, r8 + bge _081632F6 + movs r1, 0x64 + adds r0, r6, 0 + muls r0, r1 + ldr r2, _08163438 + adds r0, r2 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, _0816343C + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrh r1, [r1] + cmp r0, r1 + bne _081632D0 +_081632F6: + cmp r6, r8 + beq _081632FC + b _0816341E +_081632FC: + movs r6, 0 + cmp r6, r8 + bge _08163346 + ldr r5, _08163440 + mov r9, r5 + movs r3, 0 +_08163308: + ldr r0, _08163438 + adds r5, r3, r0 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + str r3, [sp, 0x38] + bl pokemon_getattr + ldr r3, [sp, 0x38] + cmp r0, 0 + beq _0816333E + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + ldr r1, _0816343C + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrb r1, [r1, 0xA] + lsls r1, 1 + add r1, r9 + ldr r3, [sp, 0x38] + ldrh r1, [r1] + cmp r0, r1 + beq _08163346 +_0816333E: + adds r3, 0x64 + adds r6, 0x1 + cmp r6, r8 + blt _08163308 +_08163346: + cmp r6, r8 + bne _0816341E + movs r6, 0 + cmp r6, r7 + bge _08163368 + add r0, sp, 0xC + ldrh r0, [r0] + cmp r0, r4 + beq _08163368 + add r1, sp, 0xC +_0816335A: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, r7 + bge _08163368 + ldrh r0, [r1] + cmp r0, r4 + bne _0816335A +_08163368: + cmp r6, r7 + bne _0816341E + lsls r0, r7, 1 + add r0, sp + adds r0, 0xC + strh r4, [r0] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r2, _08163438 + adds r0, r2 + ldr r5, _0816343C + ldr r2, [r5] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + ldr r6, [sp, 0x24] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + ldr r2, [sp, 0x30] + str r2, [sp, 0x8] + ldr r2, [sp, 0x20] + bl sub_8068634 + movs r0, 0xFF + mov r6, sp + strb r0, [r6, 0x14] + movs r6, 0 + adds r0, r7, 0x1 + str r0, [sp, 0x34] + mov r9, r4 + movs r0, 0x64 + mov r3, r8 + muls r3, r0 + mov r1, r9 + str r1, [sp, 0x3C] + ldr r2, _08163438 + mov r10, r2 +_081633B8: + ldr r0, [r5] + ldr r7, [sp, 0x3C] + adds r0, r7, r0 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r7, r10 + adds r0, r3, r7 + str r3, [sp, 0x38] + bl sub_80691F4 + ldr r0, [r5] + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + ldr r3, [sp, 0x38] + cmp r0, 0xDA + bne _081633EC + movs r0, 0 + mov r2, sp + strb r0, [r2, 0x14] +_081633EC: + adds r6, 0x1 + cmp r6, 0x3 + ble _081633B8 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r6, _08163438 + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x14 + bl pokemon_setattr + ldr r0, _0816343C + ldr r0, [r0] + add r0, r9 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _08163440 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + ldr r7, [sp, 0x34] +_0816341E: + ldr r0, [sp, 0x1C] + cmp r7, r0 + beq _08163426 + b _08163296 +_08163426: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08163438: .4byte 0x02024744 +_0816343C: .4byte 0x0203bc8c +_08163440: .4byte 0x085cecb0 + thumb_func_end sub_81630C4 + + thumb_func_start sub_8163444 +sub_8163444: @ 8163444 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r1, 0xFF + add r0, sp, 0x4 + strb r1, [r0] + ldr r0, _08163518 + ldr r2, [r0] + movs r0, 0xDC + adds r0, r2 + mov r10, r0 + ldrb r0, [r0, 0x1] + movs r1, 0x9 + str r1, [sp, 0x10] + cmp r0, 0x4 + bhi _08163474 + movs r0, 0x6 + str r0, [sp, 0x10] +_08163474: + ldr r1, _0816351C + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r1, 0x32 + str r1, [sp, 0xC] + cmp r0, 0 + beq _0816348A + movs r0, 0x64 + str r0, [sp, 0xC] +_0816348A: + movs r7, 0 + adds r2, 0xE2 + str r2, [sp, 0x14] + add r1, sp, 0x4 + mov r9, r1 +_08163494: + ldr r2, [sp, 0x8] + adds r6, r2, r7 + movs r0, 0x64 + muls r0, r6 + ldr r1, _08163520 + adds r0, r1 + lsls r5, r7, 1 + adds r4, r5, r7 + lsls r4, 2 + mov r2, r10 + adds r1, r2, r4 + ldrh r1, [r1, 0x4] + movs r2, 0x8 + str r2, [sp] + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl pokemon_make_ev_something + movs r0, 0xFF + mov r1, r9 + strb r0, [r1] + adds r2, r7, 0x1 + mov r8, r2 + movs r1, 0x3 +_081634C4: + ldr r2, [sp, 0x14] + adds r0, r2, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _081634D4 + movs r2, 0 + mov r0, r9 + strb r2, [r0] +_081634D4: + adds r4, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081634C4 + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _08163520 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x4 + bl pokemon_setattr + adds r2, r5, r7 + lsls r2, 2 + add r2, r10 + adds r2, 0xE + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r7, r8 + cmp r7, 0x3 + bne _08163494 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08163518: .4byte 0x03005d90 +_0816351C: .4byte 0x00000ca9 +_08163520: .4byte 0x02024744 + thumb_func_end sub_8163444 + + thumb_func_start sub_8163524 +sub_8163524: @ 8163524 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_8165C40 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08163548 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldr r5, [r0, 0x30] + movs r4, 0 + ldrh r1, [r5] + b _08163558 + .align 2, 0 +_08163548: .4byte 0x0203bc88 +_0816354C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r1, [r0] +_08163558: + ldr r0, _08163588 + cmp r1, r0 + bne _0816354C +_0816355E: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + cmp r6, 0x32 + beq _0816357A + cmp r6, 0x14 + bne _08163580 +_0816357A: + ldr r0, _0816358C + cmp r1, r0 + bhi _0816355E +_08163580: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08163588: .4byte 0x0000ffff +_0816358C: .4byte 0x00000351 + thumb_func_end sub_8163524 + + thumb_func_start sub_8163590 +sub_8163590: @ 8163590 + push {lr} + bl zero_enemy_party_data + ldr r0, _081635B4 + ldr r0, [r0] + ldr r1, _081635B8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081635C0 + ldr r0, _081635BC + ldrh r0, [r0] + movs r1, 0 + bl sub_81635D4 + b _081635CA + .align 2, 0 +_081635B4: .4byte 0x03005d90 +_081635B8: .4byte 0x00000ca9 +_081635BC: .4byte 0x02038bca +_081635C0: + ldr r0, _081635D0 + ldrh r0, [r0] + movs r1, 0 + bl sub_816379C +_081635CA: + pop {r0} + bx r0 + .align 2, 0 +_081635D0: .4byte 0x02038bca + thumb_func_end sub_8163590 + + thumb_func_start sub_81635D4 +sub_81635D4: @ 81635D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r0, _0816362C + cmp r2, r0 + bhi _0816364A + ldr r4, _08163630 + ldr r0, _08163634 + bl var_get + lsls r0, 24 + ldr r4, [r4] + lsrs r0, 22 + movs r2, 0xCE + lsls r2, 4 + adds r1, r4, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, _08163638 + adds r4, r3 + ldrh r0, [r4] + cmp r0, 0x5 + bhi _0816363C + adds r0, r1, 0 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + b _081636A6 + .align 2, 0 +_0816362C: .4byte 0x0000012b +_08163630: .4byte 0x03005d90 +_08163634: .4byte 0x000040ce +_08163638: .4byte 0x00000cb2 +_0816363C: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + b _081636A6 +_0816364A: + movs r0, 0xFA + lsls r0, 1 + cmp r2, r0 + bne _08163694 + ldr r7, [sp, 0x10] + adds r0, r7, 0x3 + cmp r7, r0 + blt _0816365C + b _08163776 +_0816365C: + ldr r4, _0816368C +_0816365E: + movs r0, 0x64 + muls r0, r7 + ldr r1, _08163690 + adds r0, r1 + ldr r1, [sp, 0x10] + subs r2, r7, r1 + movs r1, 0x2C + muls r2, r1 + movs r3, 0xC2 + lsls r3, 4 + adds r2, r3 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [sp, 0x10] + adds r0, 0x3 + cmp r7, r0 + blt _0816365E + b _08163776 + .align 2, 0 +_0816368C: .4byte 0x03005d90 +_08163690: .4byte 0x02024744 +_08163694: + ldr r0, _081636A0 + cmp r3, r0 + bne _081636A4 + bl sub_81A6CD0 + b _08163776 + .align 2, 0 +_081636A0: .4byte 0x000003fe +_081636A4: + movs r0, 0x1F +_081636A6: + str r0, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, _08163788 + ldr r1, [r0] + 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 + mov r8, r2 + movs r7, 0 +_081636CE: + ldr r1, _0816378C + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r3, [sp, 0x10] + adds r5, r3, r7 + movs r0, 0x64 + adds r6, r5, 0 + muls r6, r0 + ldr r1, _08163790 + adds r0, r6, r1 + ldr r3, _08163794 + ldr r2, [r3] + mov r1, r9 + lsls r4, r1, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + mov r10, r3 + ldr r3, [sp, 0x18] + str r3, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + mov r3, r10 + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r3, 0 + adds r7, 0x1 + mov r10, r7 + adds r7, r4, 0 +_08163718: + ldr r0, _08163794 + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 4 + adds r0, r1 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + ldr r2, _08163790 + adds r0, r6, r2 + adds r2, r3, 0 + str r3, [sp, 0x1C] + bl sub_81A7024 + ldr r3, [sp, 0x1C] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _08163718 + movs r3, 0x64 + adds r4, r5, 0 + muls r4, r3 + ldr r0, _08163790 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r1, _08163794 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _08163798 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081636CE +_08163776: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08163788: .4byte 0x03005d90 +_0816378C: .4byte 0x03006298 +_08163790: .4byte 0x02024744 +_08163794: .4byte 0x0203bc8c +_08163798: .4byte 0x085cecb0 + thumb_func_end sub_81635D4 + + thumb_func_start sub_816379C +sub_816379C: @ 816379C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r0, _08163898 + ldr r1, [r0] + ldrb r0, [r1, 0xA] + mov r9, r0 + ldrb r0, [r1, 0xB] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r9, r2 + movs r7, 0 + mov r8, r7 +_081637D0: + ldr r1, _0816389C + mov r2, r8 + lsls r0, r2, 1 + adds r0, r1 + ldrh r4, [r0] + ldr r5, [sp, 0x10] + add r5, r8 + movs r7, 0x64 + adds r6, r5, 0 + muls r6, r7 + ldr r1, _081638A0 + adds r0, r6, r1 + ldr r7, _081638A4 + ldr r2, [r7] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x14] + mov r8, r4 + mov r5, r8 +_08163818: + ldr r1, _081638A4 + ldr r0, [r1] + adds r0, r5, r0 + lsls r4, r7, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + ldr r2, _081638A0 + adds r0, r6, r2 + adds r2, r7, 0 + bl sub_81A7024 + ldr r1, _081638A4 + ldr r0, [r1] + adds r0, r5, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _08163846 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_08163846: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _08163818 + movs r2, 0x64 + mov r4, r10 + muls r4, r2 + ldr r7, _081638A0 + adds r4, r7 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r1, _081638A4 + ldr r0, [r1] + add r0, r8 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _081638A8 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + ldr r2, [sp, 0x14] + lsls r0, r2, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081637D0 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08163898: .4byte 0x03005d90 +_0816389C: .4byte 0x03006298 +_081638A0: .4byte 0x02024744 +_081638A4: .4byte 0x0203bc8c +_081638A8: .4byte 0x085cecb0 + thumb_func_end sub_816379C + + thumb_func_start sub_81638AC +sub_81638AC: @ 81638AC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08163910 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_811EC08 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r4, 0 + bl font_get_width_of_string + cmp r0, 0xCC + bls _0816390A + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl sub_811EC08 + ldrb r0, [r4] + movs r1, 0x1 + cmp r0, 0xFE + beq _081638EE + adds r2, r4, 0 +_081638E4: + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, 0x1 + cmp r0, 0xFE + bne _081638E4 +_081638EE: + ldr r2, _08163910 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r2, 0 + cmp r0, 0xFE + beq _08163904 +_081638FA: + adds r1, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFE + bne _081638FA +_08163904: + adds r1, r3 + movs r0, 0xFA + strb r0, [r1] +_0816390A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08163910: .4byte 0x02021fc4 + thumb_func_end sub_81638AC + + thumb_func_start sub_8163914 +sub_8163914: @ 8163914 + push {lr} + bl sub_8165C40 + ldr r0, _08163928 + ldrh r0, [r0] + cmp r0, 0 + beq _08163930 + ldr r0, _0816392C + b _08163932 + .align 2, 0 +_08163928: .4byte 0x020375e2 +_0816392C: .4byte 0x02038bcc +_08163930: + ldr r0, _08163944 +_08163932: + ldrh r3, [r0] + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _08163950 + ldr r0, _08163948 + ldr r0, [r0] + ldr r1, _0816394C + b _08163986 + .align 2, 0 +_08163944: .4byte 0x02038bca +_08163948: .4byte 0x03005d90 +_0816394C: .4byte 0x00000bfc +_08163950: + ldr r0, _0816396C + cmp r3, r0 + bhi _08163974 + ldr r2, _08163970 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC + b _081639A8 + .align 2, 0 +_0816396C: .4byte 0x0000012b +_08163970: .4byte 0x0203bc88 +_08163974: + ldr r0, _08163990 + cmp r3, r0 + bhi _0816399C + ldr r1, _08163994 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, _08163998 +_08163986: + adds r0, r1 + bl sub_81638AC + b _081639A8 + .align 2, 0 +_08163990: .4byte 0x0000018f +_08163994: .4byte 0x03005d90 +_08163998: .4byte 0xfffef2b8 +_0816399C: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C +_081639A8: + pop {r0} + bx r0 + thumb_func_end sub_8163914 + + thumb_func_start sub_81639AC +sub_81639AC: @ 81639AC + push {r4-r6,lr} + sub sp, 0x4 + bl sub_81864CC + ldr r0, _081639C8 + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0xA + bhi _08163A78 + lsls r0, 2 + ldr r1, _081639CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081639C8: .4byte 0x02024474 +_081639CC: .4byte _081639D0 + .align 2, 0 +_081639D0: + .4byte _081639FC + .4byte _08163A38 + .4byte _08163A74 + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _08163A78 + .4byte _081639FC + .4byte _081639FC +_081639FC: + ldr r0, _08163A20 + ldr r0, [r0] + ldr r2, _08163A24 + adds r1, r0, r2 + ldr r2, [r1] + ldr r0, _08163A28 + cmp r2, r0 + bhi _08163A2C + adds r0, r2, 0x1 + str r0, [r1] + movs r1, 0x14 + bl __umodsi3 + cmp r0, 0 + bne _08163A78 + bl sub_81DA57C + b _08163A78 + .align 2, 0 +_08163A20: .4byte 0x03005d90 +_08163A24: .4byte 0x00000ebc +_08163A28: .4byte 0x00fffffe +_08163A2C: + ldr r0, _08163A34 + str r0, [r1] + b _08163A78 + .align 2, 0 +_08163A34: .4byte 0x00ffffff +_08163A38: + movs r5, 0 + ldr r6, _08163A6C +_08163A3C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + movs r0, 0x8E + lsls r0, 2 + adds r1, r4, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + ldr r0, _08163A70 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r5, 0x1 + cmp r5, 0x5 + ble _08163A3C + b _08163A78 + .align 2, 0 +_08163A6C: .4byte 0x03005d8c +_08163A70: .4byte 0x020244ec +_08163A74: + bl sub_816537C +_08163A78: + ldr r0, _08163A88 + bl set_callback2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08163A88: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_81639AC + + thumb_func_start sub_8163A8C +sub_8163A8C: @ 8163A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8145F20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08163AB0 + ldr r0, _08163AB8 + ldr r1, _08163ABC + str r1, [r0, 0x8] + ldr r0, _08163AC0 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08163AB0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08163AB8: .4byte 0x030022c0 +_08163ABC: .4byte sub_81639AC + 1 +_08163AC0: .4byte sub_8036760 + 1 + thumb_func_end sub_8163A8C + + thumb_func_start sub_8163AC4 +sub_8163AC4: @ 8163AC4 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, _08163AE4 + ldr r2, _08163AE8 + ldrh r1, [r2] + adds r0, 0x26 + strb r1, [r0] + ldrh r0, [r2] + cmp r0, 0xA + bls _08163ADA + b _08163E68 +_08163ADA: + lsls r0, 2 + ldr r1, _08163AEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08163AE4: .4byte 0x02024474 +_08163AE8: .4byte 0x020375e0 +_08163AEC: .4byte _08163AF0 + .align 2, 0 +_08163AF0: + .4byte _08163B1C + .4byte _08163BC0 + .4byte _08163C10 + .4byte _08163C70 + .4byte _08163CC4 + .4byte _08163D28 + .4byte _08163D74 + .4byte _08163DB4 + .4byte _08163E2C + .4byte _08163DF4 + .4byte _08163DC8 +_08163B1C: + ldr r5, _08163B3C + movs r0, 0x84 + lsls r0, 1 + str r0, [r5] + ldr r0, _08163B40 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + beq _08163B56 + cmp r4, 0x1 + bgt _08163B44 + cmp r4, 0 + beq _08163B4E + b _08163BA6 + .align 2, 0 +_08163B3C: .4byte 0x02022fec +_08163B40: .4byte 0x000040ce +_08163B44: + cmp r4, 0x2 + beq _08163B64 + cmp r4, 0x3 + beq _08163B98 + b _08163BA6 +_08163B4E: + movs r0, 0x3 + bl sub_8163048 + b _08163BA6 +_08163B56: + movs r0, 0x4 + bl sub_8163048 + ldr r0, [r5] + orrs r0, r4 + str r0, [r5] + b _08163BA6 +_08163B64: + movs r0, 0x2 + bl sub_816306C + ldr r1, _08163B88 + ldr r0, _08163B8C + ldr r0, [r0] + ldr r2, _08163B90 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r1] + bl sub_8165404 + ldr r0, [r5] + ldr r1, _08163B94 + orrs r0, r1 + str r0, [r5] + b _08163BA6 + .align 2, 0 +_08163B88: .4byte 0x02038bce +_08163B8C: .4byte 0x03005d90 +_08163B90: .4byte 0x00000cd6 +_08163B94: .4byte 0x00408041 +_08163B98: + ldr r0, [r5] + ldr r1, _08163BB8 + orrs r0, r1 + str r0, [r5] + movs r0, 0x2 + bl sub_816306C +_08163BA6: + ldr r0, _08163BBC + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0 + b _08163E10 + .align 2, 0 +_08163BB8: .4byte 0x00800043 +_08163BBC: .4byte sub_8163A8C + 1 +_08163BC0: + movs r5, 0 + ldr r6, _08163C04 +_08163BC4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08163C08 + adds r0, r4, r0 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + movs r0, 0x8E + lsls r0, 2 + adds r4, r0 + ldr r0, [r6] + adds r0, r4 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r5, 0x1 + cmp r5, 0x5 + ble _08163BC4 + ldr r0, _08163C0C + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0xC + b _08163E10 + .align 2, 0 +_08163C04: .4byte 0x03005d8c +_08163C08: .4byte 0x020244ec +_08163C0C: .4byte sub_8163A8C + 1 +_08163C10: + bl zero_enemy_party_data + movs r5, 0 + ldr r4, _08163C58 +_08163C18: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08163C5C + adds r0, r1 + movs r1, 0x2C + adds r2, r5, 0 + muls r2, r1 + movs r1, 0xC2 + lsls r1, 4 + adds r2, r1 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r5, 0x1 + cmp r5, 0x2 + ble _08163C18 + ldr r1, _08163C60 + ldr r0, _08163C64 + str r0, [r1] + ldr r1, _08163C68 + movs r0, 0 + strh r0, [r1] + ldr r0, _08163C6C + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0xD + b _08163E10 + .align 2, 0 +_08163C58: .4byte 0x03005d90 +_08163C5C: .4byte 0x02024744 +_08163C60: .4byte 0x02022fec +_08163C64: .4byte 0x00000808 +_08163C68: .4byte 0x02038bca +_08163C6C: .4byte sub_8163A8C + 1 +_08163C70: + ldr r4, _08163CAC + ldr r0, _08163CB0 + str r0, [r4] + ldr r0, _08163CB4 + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163C8A + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163C8A: + ldr r0, _08163CB8 + ldrh r1, [r0] + ldr r0, _08163CBC + cmp r1, r0 + bne _08163C9A + movs r0, 0x2 + bl sub_8163048 +_08163C9A: + ldr r0, _08163CC0 + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl sub_806E694 + movs r0, 0x3 + b _08163E10 + .align 2, 0 +_08163CAC: .4byte 0x02022fec +_08163CB0: .4byte 0x00010008 +_08163CB4: .4byte 0x000040ce +_08163CB8: .4byte 0x02038bca +_08163CBC: .4byte 0x000003fe +_08163CC0: .4byte sub_8163A8C + 1 +_08163CC4: + ldr r4, _08163CF8 + ldr r0, _08163CFC + str r0, [r4] + ldr r0, _08163D00 + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163CDE + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163CDE: + ldr r0, _08163D04 + ldr r0, [r0] + ldr r2, _08163D08 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08163D0C + movs r0, 0x3 + bl sub_8163048 + b _08163D12 + .align 2, 0 +_08163CF8: .4byte 0x02022fec +_08163CFC: .4byte 0x00020008 +_08163D00: .4byte 0x000040ce +_08163D04: .4byte 0x03005d90 +_08163D08: .4byte 0x00000ca9 +_08163D0C: + movs r0, 0x3 + bl sub_81630A0 +_08163D12: + ldr r0, _08163D24 + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x4 + b _08163E10 + .align 2, 0 +_08163D24: .4byte sub_8163A8C + 1 +_08163D28: + ldr r1, _08163D48 + ldr r0, _08163D4C + str r0, [r1] + ldr r0, _08163D50 + ldr r0, [r0] + ldr r1, _08163D54 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08163D58 + movs r0, 0x3 + bl sub_8163048 + b _08163D5E + .align 2, 0 +_08163D48: .4byte 0x02022fec +_08163D4C: .4byte 0x00040008 +_08163D50: .4byte 0x03005d90 +_08163D54: .4byte 0x00000ca9 +_08163D58: + movs r0, 0x3 + bl sub_81630A0 +_08163D5E: + ldr r0, _08163D70 + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x5 + b _08163E10 + .align 2, 0 +_08163D70: .4byte sub_8163A8C + 1 +_08163D74: + ldr r4, _08163DA4 + ldr r0, _08163DA8 + str r0, [r4] + ldr r0, _08163DAC + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163D8E + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163D8E: + bl sub_8163590 + ldr r0, _08163DB0 + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x6 + b _08163E10 + .align 2, 0 +_08163DA4: .4byte 0x02022fec +_08163DA8: .4byte 0x00080008 +_08163DAC: .4byte 0x000040ce +_08163DB0: .4byte sub_8163A8C + 1 +_08163DB4: + ldr r1, _08163DC4 + movs r0, 0x84 + lsls r0, 1 + str r0, [r1] + movs r0, 0x3 + bl sub_8163048 + b _08163E00 + .align 2, 0 +_08163DC4: .4byte 0x02022fec +_08163DC8: + ldr r1, _08163DE8 + ldr r0, _08163DEC + str r0, [r1] + movs r0, 0x3 + bl sub_8163048 + ldr r0, _08163DF0 + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0xA + b _08163E10 + .align 2, 0 +_08163DE8: .4byte 0x02022fec +_08163DEC: .4byte 0x00200008 +_08163DF0: .4byte sub_8163A8C + 1 +_08163DF4: + ldr r1, _08163E20 + ldr r0, _08163E24 + str r0, [r1] + movs r0, 0x1 + bl sub_816306C +_08163E00: + ldr r0, _08163E28 + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x7 +_08163E10: + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + bl sub_8145EF4 + b _08163E68 + .align 2, 0 +_08163E20: .4byte 0x02022fec +_08163E24: .4byte 0x00008109 +_08163E28: .4byte sub_8163A8C + 1 +_08163E2C: + ldr r1, _08163E70 + ldr r0, _08163E74 + str r0, [r1] + ldr r5, _08163E78 + adds r0, r5, 0 + bl sub_8165404 + ldr r4, _08163E7C + movs r0, 0 + strb r0, [r4] + ldr r0, _08163E80 + bl battle_configure_by_script + movs r0, 0x1 + strb r0, [r4] + ldr r0, _08163E84 + bl battle_configure_by_script + ldr r0, _08163E88 + strh r5, [r0] + ldr r0, _08163E8C + movs r1, 0x1 + bl AddTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x12 + bl sub_8145EF4 +_08163E68: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08163E70: .4byte 0x02022fec +_08163E74: .4byte 0x00408049 +_08163E78: .4byte 0x00000c03 +_08163E7C: .4byte 0x02038bfc +_08163E80: .4byte 0x08224158 +_08163E84: .4byte 0x08224167 +_08163E88: .4byte 0x02038bce +_08163E8C: .4byte sub_8163A8C + 1 + thumb_func_end sub_8163AC4 + + thumb_func_start sub_8163E90 +sub_8163E90: @ 8163E90 + push {r4-r6,lr} + ldr r6, _08163ED8 + ldr r0, [r6] + ldr r1, _08163EDC + adds r0, r1 + ldrb r5, [r0] + lsls r5, 30 + lsrs r5, 30 + ldr r0, _08163EE0 + bl var_get + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8164FCC + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, [r6] + lsls r5, 1 + lsls r4, 2 + adds r5, r4 + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, r2 + bcs _08163ED0 + strh r2, [r1] +_08163ED0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08163ED8: .4byte 0x03005d90 +_08163EDC: .4byte 0x00000ca9 +_08163EE0: .4byte 0x000040ce + thumb_func_end sub_8163E90 + + thumb_func_start sub_8163EE4 +sub_8163EE4: @ 8163EE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _08163F2C + ldr r0, [r4] + ldr r1, _08163F30 + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_8164FB8 + ldr r0, [r4] + ldr r2, _08163F34 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, _08163F38 + bl var_get + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, [r4] + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08163F40 + ldr r4, _08163F3C + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x14 + b _08163F52 + .align 2, 0 +_08163F2C: .4byte 0x03005d90 +_08163F30: .4byte 0x0000064c +_08163F34: .4byte 0x00000ca9 +_08163F38: .4byte 0x000040ce +_08163F3C: .4byte 0x085dcefa +_08163F40: + ldr r4, _0816401C + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x1E +_08163F52: + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + strb r6, [r5] + strb r0, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0xC + ldr r4, _08164020 + ldr r1, [r4] + adds r1, 0xA + bl sub_80842F4 + adds r0, r5, 0x4 + ldr r1, [r4] + bl strcpy_limit_7_chars + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8164FCC + strh r0, [r5, 0x2] + movs r4, 0 + movs r2, 0x10 + adds r2, r5 + mov r12, r2 + movs r7, 0x1C + adds r7, r5 + mov r9, r7 + adds r6, r5, 0 + adds r6, 0x28 + movs r0, 0xE4 + adds r0, r5 + mov r8, r0 +_08163F96: + lsls r2, r4, 1 + mov r1, r12 + adds r3, r1, r2 + ldr r0, _08164024 + ldr r1, [r0] + ldr r7, _08164028 + adds r0, r1, r7 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + mov r0, r9 + adds r3, r0, r2 + adds r7, 0xC + adds r0, r1, r7 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r3, r6, r2 + ldr r0, _0816402C + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3] + adds r4, 0x1 + cmp r4, 0x5 + ble _08163F96 + movs r4, 0 +_08163FCC: + ldr r6, _08164020 + ldr r0, [r6] + lsls r1, r4, 1 + ldr r2, _08164030 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _08163FF4 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, _08164034 + adds r0, r1 + movs r1, 0x2C + muls r1, r4 + adds r1, 0x34 + adds r1, r5, r1 + bl sub_80686FC +_08163FF4: + adds r4, 0x1 + cmp r4, 0x3 + ble _08163FCC + ldr r0, _08164038 + ldrb r0, [r0] + mov r7, r8 + strb r0, [r7] + ldr r0, [r6] + ldr r1, _0816403C + adds r0, r1 + bl sub_8164F70 + bl sub_8163E90 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816401C: .4byte 0x085dcedc +_08164020: .4byte 0x03005d90 +_08164024: .4byte 0x03005d8c +_08164028: .4byte 0x00002bbc +_0816402C: .4byte 0x00002bd4 +_08164030: .4byte 0x00000caa +_08164034: .4byte 0x02024488 +_08164038: .4byte 0x082e9531 +_0816403C: .4byte 0x0000064c + thumb_func_end sub_8163EE4 + + thumb_func_start sub_8164040 +sub_8164040: @ 8164040 + push {r4,r5,lr} + ldr r5, _081640C0 + ldr r0, [r5] + ldr r1, _081640C4 + adds r0, r1 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r0, _081640C8 + bl var_get + lsls r0, 16 + ldr r5, [r5] + lsls r4, 1 + lsrs r0, 14 + adds r4, r0 + movs r2, 0xCE + lsls r2, 4 + adds r0, r5, r2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _081640CC + ldrh r0, [r0] + cmp r0, 0 + bne _0816408E + cmp r1, 0x1 + bgt _0816408A + ldr r1, _081640D0 + adds r0, r5, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0816408E +_0816408A: + bl sub_8163EE4 +_0816408E: + ldr r4, _081640C0 + ldr r0, [r4] + ldr r1, _081640CC + ldrh r1, [r1] + ldr r2, _081640D4 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081640C4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081640C0: .4byte 0x03005d90 +_081640C4: .4byte 0x00000ca9 +_081640C8: .4byte 0x000040ce +_081640CC: .4byte 0x020375e2 +_081640D0: .4byte 0x00000cb2 +_081640D4: .4byte 0x00000ca8 + thumb_func_end sub_8164040 + + thumb_func_start nullsub_61 +nullsub_61: @ 81640D8 + bx lr + thumb_func_end nullsub_61 + + thumb_func_start nullsub_116 +nullsub_116: @ 81640DC + bx lr + thumb_func_end nullsub_116 + + thumb_func_start sub_81640E0 +sub_81640E0: @ 81640E0 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r4, _08164178 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r6, 0 + movs r2, 0 + ldr r0, _0816417C + ldr r1, [r0] + ldr r0, _08164180 + adds r5, r0 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0xE0 + adds r0, r1 + mov r3, sp +_08164122: + ldrh r1, [r0] + cmp r1, r7 + beq _08164130 + cmp r1, r4 + beq _08164130 + stm r3!, {r2} + adds r6, 0x1 +_08164130: + adds r0, 0xC + adds r2, 0x1 + cmp r2, 0x2 + ble _08164122 + bl GenerateRandomNumber + ldr r4, _08164184 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4] +_08164150: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x2] + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08164150 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08164178: .4byte 0x020244ec +_0816417C: .4byte 0x03005d90 +_08164180: .4byte 0xfffffe70 +_08164184: .4byte 0x03006298 + thumb_func_end sub_81640E0 + + thumb_func_start sub_8164188 +sub_8164188: @ 8164188 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r6, _08164288 + ldr r0, [r6] + ldr r1, _0816428C + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0xC] + ldr r4, _08164290 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x14] + movs r3, 0 + mov r8, r3 + movs r7, 0 + adds r2, r6, 0 + ldr r0, _08164294 + adds r5, r0 + ldr r6, _08164298 + mov r10, sp + movs r0, 0xEC + adds r1, r5, 0 + muls r1, r0 + mov r9, r1 +_081641E6: + ldr r1, [r2] + movs r0, 0x2C + muls r0, r7 + mov r3, r9 + adds r5, r0, r3 + adds r1, r5 + adds r0, r1, r6 + ldrh r0, [r0] + ldr r3, [sp, 0x10] + cmp r0, r3 + beq _0816423A + ldr r3, [sp, 0x14] + cmp r0, r3 + beq _0816423A + movs r0, 0xEF + lsls r0, 3 + adds r4, r1, r0 + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + lsrs r0, 24 + str r2, [sp, 0x18] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x18] + cmp r1, r0 + bhi _0816423A + ldr r0, [r2] + adds r0, r5 + adds r0, r6 + ldrh r0, [r0] + cmp r0, 0 + beq _0816423A + mov r3, r10 + adds r3, 0x4 + mov r10, r3 + subs r3, 0x4 + stm r3!, {r7} + movs r0, 0x1 + add r8, r0 +_0816423A: + adds r7, 0x1 + cmp r7, 0x3 + ble _081641E6 + bl GenerateRandomNumber + ldr r4, _0816429C + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x4] +_08164258: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x6] + ldrh r1, [r4, 0x4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08164258 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08164288: .4byte 0x03005d90 +_0816428C: .4byte 0x00000ca9 +_08164290: .4byte 0x020244ec +_08164294: .4byte 0xfffffed4 +_08164298: .4byte 0x0000076c +_0816429C: .4byte 0x03006298 + thumb_func_end sub_8164188 + + thumb_func_start sub_81642A0 +sub_81642A0: @ 81642A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r0, _08164608 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x24] + ldr r5, _0816460C + ldr r0, [r5] + ldr r2, _08164610 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + ldr r0, _08164614 + bl var_get + lsls r0, 16 + ldr r1, [r5] + ldr r3, [sp, 0x14] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + movs r4, 0xCE + lsls r4, 4 + adds r1, r4 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + ldr r4, _08164618 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x1C] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x20] + bl sub_8165C40 + movs r7, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + mov r10, r0 +_08164318: + lsls r6, r7, 1 +_0816431A: + mov r1, r10 + lsrs r0, r1, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r2, 0 + mov r9, r2 + cmp r9, r7 + bge _08164368 + ldr r0, [r5] + ldr r3, _0816461C + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r8 + beq _08164368 + ldr r0, _08164620 + ldr r2, [r0] + movs r4, 0x34 + mov r0, r8 + muls r0, r4 + adds r0, r2 + ldrb r3, [r0] +_0816434C: + ldrh r0, [r1] + muls r0, r4 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r3 + beq _08164368 + adds r1, 0x2 + movs r0, 0x1 + add r9, r0 + cmp r9, r7 + bge _08164368 + ldrh r0, [r1] + cmp r0, r8 + bne _0816434C +_08164368: + cmp r9, r7 + bne _0816431A + ldr r0, [r5] + ldr r1, _0816461C + adds r0, r1 + adds r0, r6 + mov r2, r8 + strh r2, [r0] + mov r7, r9 + adds r7, 0x1 + cmp r7, 0x5 + ble _08164318 + movs r3, 0x8 + mov r10, r3 + movs r4, 0 + mov r9, r4 + ldr r0, [sp, 0x24] + str r0, [sp, 0x40] +_0816438C: + ldr r1, _0816460C + ldr r0, [r1] + mov r2, r9 + lsls r1, r2, 1 + ldr r3, _0816461C + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + bl sub_81627A4 + ldr r4, [sp, 0x40] + strb r0, [r4, 0x19] + movs r7, 0 +_081643A8: + adds r0, r7, 0x1 + str r0, [sp, 0x30] + mov r1, r10 + lsls r1, 1 + str r1, [sp, 0x38] + mov r2, r10 + adds r2, 0x1 + str r2, [sp, 0x34] + mov r0, r10 + subs r0, 0x1 + lsls r0, 1 + str r0, [sp, 0x28] +_081643C0: + mov r0, r8 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081643F4 + ldr r3, _0816460C + ldr r0, [r3] + ldr r4, _0816461C + adds r0, r4 + ldr r1, [sp, 0x28] + adds r0, r1 + ldrh r2, [r0] + ldr r0, _08164624 + ldr r0, [r0] + lsls r2, 4 + adds r2, r0 + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r2, 0xA] + ldrb r1, [r1, 0xA] + cmp r0, r1 + beq _081643C0 +_081643F4: + movs r5, 0x8 + cmp r5, r10 + bge _08164430 + ldr r2, _0816460C + ldr r0, [r2] + ldr r1, _08164624 + ldr r3, [r1] + lsls r1, r6, 4 + adds r1, r3 + ldr r4, _08164628 + adds r2, r0, r4 + ldrh r0, [r1] + mov r12, r0 +_0816440E: + ldrh r0, [r2] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r12 + beq _08164430 + ldrh r0, [r1] + ldr r4, [sp, 0x1C] + cmp r4, r0 + beq _08164430 + ldr r4, [sp, 0x20] + cmp r4, r0 + beq _08164430 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r10 + blt _0816440E +_08164430: + cmp r5, r10 + bne _081643C0 + ldr r1, _0816460C + ldr r0, [r1] + ldr r2, _0816461C + adds r0, r2 + ldr r3, [sp, 0x38] + adds r0, r3 + strh r6, [r0] + ldr r4, [sp, 0x34] + mov r10, r4 + ldr r7, [sp, 0x30] + cmp r7, 0x1 + ble _081643A8 + ldr r0, [sp, 0x40] + adds r0, 0x18 + str r0, [sp, 0x40] + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x5 + ble _0816438C + movs r3, 0 + mov r10, r3 + bl sub_8165B20 + movs r4, 0 + mov r9, r4 + ldr r0, _0816460C + ldr r0, [r0] + movs r2, 0 + adds r6, r0, 0 + adds r6, 0xDC + mov r8, sp +_08164474: + ldrb r0, [r6] + lsls r4, r0, 25 + lsrs r0, r4, 30 + cmp r0, 0 + beq _081644E0 + ldr r1, _0816462C + ldrb r0, [r6, 0x1] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7 + str r2, [sp, 0x44] + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x44] + ldr r1, [sp, 0x18] + cmp r0, r1 + bgt _081644E0 + lsrs r0, r4, 30 + subs r0, 0x1 + ldr r3, [sp, 0x14] + cmp r0, r3 + bne _081644E0 + movs r5, 0 + ldr r0, _0816460C + ldr r0, [r0] + adds r0, 0xE0 + adds r1, r2, r0 + movs r7, 0x2 +_081644B0: + ldrh r0, [r1] + ldr r4, [sp, 0x1C] + cmp r4, r0 + beq _081644C0 + ldr r3, [sp, 0x20] + cmp r3, r0 + beq _081644C0 + adds r5, 0x1 +_081644C0: + adds r1, 0xC + subs r7, 0x1 + cmp r7, 0 + bge _081644B0 + cmp r5, 0x2 + ble _081644E0 + movs r0, 0xC8 + lsls r0, 1 + add r0, r9 + mov r4, r8 + adds r4, 0x4 + mov r8, r4 + subs r4, 0x4 + stm r4!, {r0} + movs r0, 0x1 + add r10, r0 +_081644E0: + adds r2, 0x44 + adds r6, 0x44 + movs r1, 0x1 + add r9, r1 + mov r3, r9 + cmp r3, 0x3 + ble _08164474 + mov r4, r10 + cmp r4, 0 + beq _08164532 + bl GenerateRandomNumber + ldr r6, _0816460C + ldr r4, [r6] + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + movs r5, 0xCC + lsls r5, 4 + adds r4, r5 + strh r0, [r4] + ldrh r0, [r4] + bl sub_81627A4 + ldr r1, [sp, 0x24] + adds r1, 0xA8 + strb r0, [r1, 0x1] + movs r0, 0xD8 + lsls r0, 2 + bl flag_clear + ldr r0, [r6] + adds r0, r5 + ldrh r0, [r0] + bl sub_81640E0 +_08164532: + movs r0, 0 + mov r10, r0 + mov r9, r0 + mov r1, sp + str r1, [sp, 0x3C] +_0816453C: + ldr r0, _0816460C + movs r2, 0xEC + mov r1, r9 + muls r1, r2 + movs r3, 0xE7 + lsls r3, 3 + adds r1, r3 + ldr r0, [r0] + movs r2, 0 + movs r3, 0 + movs r7, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x2C] + adds r1, r0, r1 +_0816455A: + ldm r1!, {r0} + orrs r2, r0 + adds r3, r0 + adds r7, 0x1 + cmp r7, 0x39 + bls _0816455A + ldr r0, _0816460C + ldr r5, [r0] + movs r1, 0xEC + mov r6, r9 + muls r6, r1 + adds r4, r5, r6 + ldr r1, _08164630 + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x7 + str r2, [sp, 0x44] + str r3, [sp, 0x48] + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x44] + ldr r3, [sp, 0x48] + ldr r1, [sp, 0x18] + cmp r0, r1 + bgt _08164656 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r4, r1 + ldrb r0, [r0] + ldr r4, [sp, 0x14] + cmp r0, r4 + bne _08164656 + cmp r2, 0 + beq _08164656 + adds r1, 0xE8 + adds r0, r5, r1 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bne _08164656 + movs r5, 0 + movs r7, 0 + ldr r2, _0816460C + mov r8, r2 + ldr r3, _08164634 +_081645B8: + mov r4, r8 + ldr r2, [r4] + movs r0, 0x2C + adds r1, r7, 0 + muls r1, r0 + movs r4, 0xEC + mov r0, r9 + muls r0, r4 + adds r6, r1, r0 + adds r2, r6 + adds r0, r2, r3 + ldrh r0, [r0] + ldr r1, [sp, 0x1C] + cmp r1, r0 + beq _0816463C + ldr r4, [sp, 0x20] + cmp r4, r0 + beq _0816463C + movs r0, 0xEF + lsls r0, 3 + adds r4, r2, r0 + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r0, 24 + str r3, [sp, 0x48] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x48] + cmp r1, r0 + bhi _0816463C + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + b _08164638 + .align 2, 0 +_08164608: .4byte 0x03005d8c +_0816460C: .4byte 0x03005d90 +_08164610: .4byte 0x00000ca9 +_08164614: .4byte 0x000040ce +_08164618: .4byte 0x020244ec +_0816461C: .4byte 0x00000cb4 +_08164620: .4byte 0x0203bc88 +_08164624: .4byte 0x0203bc8c +_08164628: .4byte 0x00000cc4 +_0816462C: .4byte 0x085df9ec +_08164630: .4byte 0x0000073a +_08164634: .4byte 0x0000076c +_08164638: + beq _0816463C + adds r5, 0x1 +_0816463C: + adds r7, 0x1 + cmp r7, 0x3 + ble _081645B8 + cmp r5, 0x1 + ble _08164656 + movs r0, 0x96 + lsls r0, 1 + add r0, r9 + ldr r3, [sp, 0x3C] + stm r3!, {r0} + str r3, [sp, 0x3C] + movs r4, 0x1 + add r10, r4 +_08164656: + ldr r0, [sp, 0x2C] + mov r9, r0 + cmp r0, 0x4 + bgt _08164660 + b _0816453C +_08164660: + mov r1, r10 + cmp r1, 0 + beq _081646A0 + bl GenerateRandomNumber + ldr r6, _081646B0 + ldr r4, [r6] + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r5, _081646B4 + adds r4, r5 + strh r0, [r4] + ldrh r0, [r4] + bl sub_81627A4 + ldr r1, [sp, 0x24] + adds r1, 0xC0 + strb r0, [r1, 0x1] + ldr r0, _081646B8 + bl flag_clear + ldr r0, [r6] + adds r0, r5 + ldrh r0, [r0] + bl sub_8164188 +_081646A0: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081646B0: .4byte 0x03005d90 +_081646B4: .4byte 0x00000cc2 +_081646B8: .4byte 0x00000361 + thumb_func_end sub_81642A0 + + thumb_func_start sub_81646BC +sub_81646BC: @ 81646BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0 + mov r9, r0 + mov r10, r0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + beq _081647CE + subs r0, 0xC9 + cmp r5, r0 + bhi _081646FC + ldr r0, _081646F8 + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrh r1, [r0, 0x2] + mov r9, r1 + ldrh r0, [r0] + mov r10, r0 + b _081647CE + .align 2, 0 +_081646F8: .4byte 0x0203bc8c +_081646FC: + ldr r0, _08164738 + cmp r5, r0 + bhi _08164750 + ldr r0, _0816473C + ldr r3, [r0] + ldr r1, _08164740 + ldr r0, _08164744 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x2C + muls r1, r0 + ldr r0, _08164748 + adds r2, r5, r0 + movs r0, 0xEC + muls r0, r2 + adds r1, r0 + adds r3, r1 + movs r1, 0xEE + lsls r1, 3 + adds r0, r3, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r2, _0816474C + adds r3, r2 + ldrh r3, [r3] + mov r10, r3 + b _081647CE + .align 2, 0 +_08164738: .4byte 0x0000018f +_0816473C: .4byte 0x03005d90 +_08164740: .4byte 0x03006298 +_08164744: .4byte 0x020375e2 +_08164748: .4byte 0xfffffed4 +_0816474C: .4byte 0x0000076c +_08164750: + ldr r4, _08164800 + ldr r3, [r4] + ldr r1, _08164804 + ldr r0, _08164808 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r2, _0816480C + adds r1, r5, r2 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r0, r2 + adds r3, r0 + adds r0, r3, 0 + adds r0, 0xE2 + ldrh r0, [r0] + mov r9, r0 + adds r3, 0xE0 + ldrh r3, [r3] + mov r10, r3 + movs r3, 0 + ldr r7, _08164810 + mov r8, r7 + adds r0, r4, 0 + mov r12, r0 + adds r4, r2, 0 + movs r6, 0x8A + lsls r6, 1 +_08164794: + mov r1, r8 + adds r2, r3, r1 + mov r1, r12 + ldr r0, [r1] + adds r1, r3, r4 + adds r0, r6 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x6 + ble _08164794 + adds r1, r3, r7 + movs r0, 0xFF + strb r0, [r1] + ldr r0, _08164800 + ldr r2, [r0] + ldr r0, _0816480C + adds r1, r5, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, _08164814 + adds r0, r2, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8009308 +_081647CE: + ldr r0, _08164818 + movs r1, 0xD + mov r2, r9 + muls r2, r1 + adds r1, r2, 0 + ldr r2, _0816481C + adds r1, r2 + bl gf_strcpy + ldr r0, _08164820 + movs r1, 0xB + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + ldr r2, _08164824 + adds r1, r2 + bl gf_strcpy + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08164800: .4byte 0x03005d90 +_08164804: .4byte 0x03006298 +_08164808: .4byte 0x020375e2 +_0816480C: .4byte 0xfffffe70 +_08164810: .4byte 0x02021ec4 +_08164814: .4byte 0x0000011b +_08164818: .4byte 0x02021cc4 +_0816481C: .4byte 0x0831977c +_08164820: .4byte 0x02021dc4 +_08164824: .4byte 0x083185c8 + thumb_func_end sub_81646BC + + thumb_func_start sub_8164828 +sub_8164828: @ 8164828 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + bl sub_8165C40 + bl sub_81A39C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0816486C + ldrh r0, [r0] + subs r5, r0, 0x2 + ldr r0, _08164870 + ldr r0, [r0] + lsls r1, r5, 1 + ldr r2, _08164874 + adds r0, r2 + adds r0, r1 + ldrh r7, [r0] + movs r3, 0 + str r3, [sp] + ldr r4, _08164878 + lsls r6, r7, 16 + b _08164884 + .align 2, 0 +_0816486C: .4byte 0x020375f2 +_08164870: .4byte 0x03005d90 +_08164874: .4byte 0x00000cb4 +_08164878: .4byte 0x085dd500 +_0816487C: + adds r4, 0x8 + ldr r0, [sp] + adds r0, 0x1 + str r0, [sp] +_08164884: + ldr r1, [sp] + cmp r1, 0x31 + bhi _0816489A + lsrs r0, r6, 16 + bl sub_8162D34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + cmp r1, r0 + bne _0816487C +_0816489A: + ldr r0, _081648B0 + ldrh r0, [r0] + cmp r0, 0x4 + bls _081648A4 + b _08164AC2 +_081648A4: + lsls r0, 2 + ldr r1, _081648B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081648B0: .4byte 0x020375e2 +_081648B4: .4byte _081648B8 + .align 2, 0 +_081648B8: + .4byte _081648CC + .4byte _08164984 + .4byte _0816499C + .4byte _081649BC + .4byte _08164AC2 +_081648CC: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + bne _081648D6 + b _08164B54 +_081648D6: + subs r0, 0xC9 + cmp r7, r0 + ble _081648E2 + ldr r0, _081648EC + cmp r7, r0 + bgt _081648F4 +_081648E2: + ldr r0, _081648F0 + adds r1, r7, 0 + bl sub_8162E20 + b _08164AC2 + .align 2, 0 +_081648EC: .4byte 0x0000018f +_081648F0: .4byte 0x02021cc4 +_081648F4: + movs r3, 0 + lsls r2, r7, 16 + mov r10, r2 + ldr r6, _0816496C + mov r9, r6 + ldr r4, _08164970 + mov r8, r4 + ldr r5, _08164974 + adds r1, r7, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r4, r0, 2 + movs r5, 0x8A + lsls r5, 1 +_08164910: + mov r0, r9 + adds r2, r3, r0 + mov r1, r8 + ldr r0, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x6 + ble _08164910 + adds r1, r3, r6 + movs r0, 0xFF + strb r0, [r1] + ldr r2, _08164970 + ldr r1, [r2] + ldr r3, _08164974 + adds r0, r7, r3 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r5, _08164978 + adds r0, r1, r5 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8009308 + ldr r0, _0816497C + ldr r2, _08164970 + ldr r1, [r2] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, _08164980 + mov r3, r10 + lsrs r1, r3, 16 + bl sub_8162E20 + b _08164AC2 + .align 2, 0 +_0816496C: .4byte 0x02021cc4 +_08164970: .4byte 0x03005d90 +_08164974: .4byte 0xfffffe70 +_08164978: .4byte 0x0000011b +_0816497C: .4byte 0x02021dc4 +_08164980: .4byte 0x02021ec4 +_08164984: + ldr r0, _08164994 + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0 + ldr r4, _08164998 + adds r1, r4 + b _081649A8 + .align 2, 0 +_08164994: .4byte 0x03005d90 +_08164998: .4byte 0x00000cc4 +_0816499C: + ldr r0, _081649B4 + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0 + ldr r5, _081649B8 + adds r1, r5 +_081649A8: + adds r0, r7, 0 + ldrh r1, [r1] + bl sub_81646BC + b _08164AC2 + .align 2, 0 +_081649B4: .4byte 0x03005d90 +_081649B8: .4byte 0x00000cc6 +_081649BC: + ldr r0, _081649F0 + strh r7, [r0] + ldr r0, _081649F4 + cmp r7, r0 + bgt _08164A08 + ldr r0, _081649F8 + ldr r4, [r0] + lsls r1, r5, 1 + adds r0, r1, 0 + adds r0, 0x8 + lsls r0, 1 + ldr r3, _081649FC + adds r2, r4, r3 + adds r0, r2, r0 + ldrh r3, [r0] + ldr r5, _08164A00 + adds r0, r4, r5 + strh r3, [r0] + adds r1, 0x9 + lsls r1, 1 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _08164A04 + adds r4, r1 + strh r0, [r4] + b _08164A46 + .align 2, 0 +_081649F0: .4byte 0x02038bce +_081649F4: .4byte 0x0000012b +_081649F8: .4byte 0x03005d90 +_081649FC: .4byte 0x00000cb4 +_08164A00: .4byte 0x00000cd8 +_08164A04: .4byte 0x00000cda +_08164A08: + ldr r0, _08164A20 + cmp r7, r0 + bgt _08164A30 + ldr r0, _08164A24 + ldr r1, [r0] + ldr r3, _08164A28 + ldrh r2, [r3, 0x4] + ldr r4, _08164A2C + adds r0, r1, r4 + strh r2, [r0] + ldrh r0, [r3, 0x6] + b _08164A40 + .align 2, 0 +_08164A20: .4byte 0x0000018f +_08164A24: .4byte 0x03005d90 +_08164A28: .4byte 0x03006298 +_08164A2C: .4byte 0x00000cd8 +_08164A30: + ldr r0, _08164AD8 + ldr r1, [r0] + ldr r3, _08164ADC + ldrh r2, [r3] + ldr r4, _08164AE0 + adds r0, r1, r4 + strh r2, [r0] + ldrh r0, [r3, 0x2] +_08164A40: + ldr r5, _08164AE4 + adds r1, r5 + strh r0, [r1] +_08164A46: + movs r5, 0 + mov r0, r8 + lsls r0, 24 + str r0, [sp, 0x4] +_08164A4E: + lsls r1, r5, 1 + mov r10, r1 + adds r2, r5, 0x1 + mov r9, r2 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 24 + mov r8, r0 +_08164A60: + ldr r3, [sp, 0x4] + lsrs r0, r3, 24 + mov r4, r8 + lsrs r1, r4, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _08164AE8 + ldrh r0, [r0] + cmp r0, r3 + beq _08164A60 + movs r2, 0 + cmp r2, r5 + bge _08164AA2 + ldr r1, _08164AD8 + ldr r0, [r1] + ldr r4, _08164AEC + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _08164AA2 + adds r6, r1, 0 +_08164A8E: + adds r2, 0x1 + cmp r2, r5 + bge _08164AA2 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08164A8E +_08164AA2: + cmp r2, r5 + bne _08164A60 + ldr r5, _08164AD8 + ldr r0, [r5] + ldr r1, _08164AEC + adds r0, r1 + add r0, r10 + strh r3, [r0] + mov r5, r9 + cmp r5, 0xD + ble _08164A4E + ldr r2, _08164AD8 + ldr r0, [r2] + ldr r3, _08164AF0 + adds r0, r3 + strh r7, [r0] +_08164AC2: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + beq _08164B54 + subs r0, 0xC9 + cmp r7, r0 + bgt _08164AF8 + ldr r0, _08164AF4 + ldr r4, [sp] + lsls r1, r4, 3 + b _08164B04 + .align 2, 0 +_08164AD8: .4byte 0x03005d90 +_08164ADC: .4byte 0x03006298 +_08164AE0: .4byte 0x00000cd8 +_08164AE4: .4byte 0x00000cda +_08164AE8: .4byte 0x02038bce +_08164AEC: .4byte 0x00000cb4 +_08164AF0: .4byte 0x00000cd6 +_08164AF4: .4byte 0x085dd500 +_08164AF8: + ldr r0, _08164B1C + cmp r7, r0 + bgt _08164B28 + ldr r0, _08164B20 + ldr r5, [sp] + lsls r1, r5, 3 +_08164B04: + adds r0, 0x4 + adds r1, r0 + ldr r0, _08164B24 + ldrh r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + b _08164B54 + .align 2, 0 +_08164B1C: .4byte 0x0000018f +_08164B20: .4byte 0x085dd500 +_08164B24: .4byte 0x020375e2 +_08164B28: + ldr r0, _08164B64 + ldr r1, [r0] + ldr r0, _08164B68 + adds r2, r7, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + ldr r1, _08164B6C + lsrs r0, 25 + adds r0, r1 + ldr r1, _08164B70 + ldrh r1, [r1] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_08164B54: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08164B64: .4byte 0x03005d90 +_08164B68: .4byte 0xfffffe70 +_08164B6C: .4byte 0x085dd690 +_08164B70: .4byte 0x020375e2 + thumb_func_end sub_8164828 + + thumb_func_start sub_8164B74 +sub_8164B74: @ 8164B74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, _08164BB8 + ldr r0, [r4] + ldr r1, _08164BBC + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, _08164BC0 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldr r2, _08164BC4 + adds r0, r2 + ldrh r6, [r0] + bl link_get_multiplayer_id + ldr r0, _08164BC8 + ldrh r0, [r0] + cmp r0, 0x6 + bls _08164BAC + b _08164DB6 +_08164BAC: + lsls r0, 2 + ldr r1, _08164BCC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08164BB8: .4byte 0x03005d90 +_08164BBC: .4byte 0x00000ca9 +_08164BC0: .4byte 0x000040ce +_08164BC4: .4byte 0x00000cb2 +_08164BC8: .4byte 0x020375f0 +_08164BCC: .4byte _08164BD0 + .align 2, 0 +_08164BD0: + .4byte _08164BEC + .4byte _08164C3C + .4byte _08164CE0 + .4byte _08164D14 + .4byte _08164D98 + .4byte _08164DA8 + .4byte _08164DB6 +_08164BEC: + cmp r5, 0x3 + beq _08164BF2 + b _08164DB0 +_08164BF2: + ldr r0, _08164C30 + ldr r0, [r0] + lsls r1, r7, 1 + adds r0, r1 + ldr r3, _08164C34 + adds r0, r3 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08164C18 + b _08164DB6 +_08164C18: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0x4 + bl link_0800A448 + ldr r1, _08164C38 + movs r0, 0x1 + b _08164DB4 + .align 2, 0 +_08164C30: .4byte 0x03005d90 +_08164C34: .4byte 0x00000cec +_08164C38: .4byte 0x020375f0 +_08164C3C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08164C4A + b _08164DB6 +_08164C4A: + bl sub_800A5B4 + ldr r1, _08164CD0 + movs r0, 0x80 + lsls r0, 1 + adds r2, r1, r0 + ldrh r0, [r1] + ldrh r3, [r2] + cmp r0, r3 + bhi _08164C60 + ldrh r0, [r2] +_08164C60: + str r0, [sp] + movs r4, 0 + ldr r0, _08164CD4 + mov r9, r0 +_08164C68: + adds r1, r4, 0x1 + mov r8, r1 + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r0, 1 + lsls r7, r0, 24 +_08164C74: + ldr r0, [sp] + lsls r0, 24 + lsrs r0, 24 + lsrs r1, r7, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r4 + bge _08164CB0 + mov r1, r9 + ldr r0, [r1] + ldr r1, _08164CD8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + beq _08164CB0 + ldr r6, _08164CD4 + adds r5, r1, 0 +_08164C9C: + adds r2, 0x1 + cmp r2, r4 + bge _08164CB0 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08164C9C +_08164CB0: + cmp r4, r2 + bne _08164C74 + mov r2, r9 + ldr r0, [r2] + lsls r1, r4, 1 + ldr r2, _08164CD8 + adds r0, r2 + adds r0, r1 + strh r3, [r0] + mov r4, r8 + cmp r4, 0xD + ble _08164C68 + ldr r1, _08164CDC + movs r0, 0x2 + b _08164DB4 + .align 2, 0 +_08164CD0: .4byte 0x020223c4 +_08164CD4: .4byte 0x03005d90 +_08164CD8: .4byte 0x00000cb4 +_08164CDC: .4byte 0x020375f0 +_08164CE0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08164DB6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08164D08 + ldr r1, [r1] + ldr r3, _08164D0C + adds r1, r3 + movs r2, 0x28 + bl link_0800A448 + ldr r1, _08164D10 + movs r0, 0x3 + b _08164DB4 + .align 2, 0 +_08164D08: .4byte 0x03005d90 +_08164D0C: .4byte 0x00000cb4 +_08164D10: .4byte 0x020375f0 +_08164D14: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _08164DB6 + bl sub_800A5B4 + ldr r4, _08164D78 + ldr r0, [r4] + ldr r5, _08164D7C + adds r0, r5 + ldr r1, _08164D80 + movs r2, 0x28 + bl memcpy + ldr r2, _08164D84 + ldr r1, [r4] + lsls r0, r6, 2 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r4, _08164D88 + lsls r0, r6, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4] + ldrh r0, [r2] + movs r1, 0 + bl sub_8162614 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_8162614 + ldr r0, _08164D8C + ldrb r0, [r0] + cmp r0, 0 + beq _08164DB0 + ldr r0, _08164D90 + ldrb r0, [r0] + cmp r0, 0 + bne _08164DB0 + ldr r1, _08164D94 + movs r0, 0x4 + b _08164DB4 + .align 2, 0 +_08164D78: .4byte 0x03005d90 +_08164D7C: .4byte 0x00000cb4 +_08164D80: .4byte 0x020223c4 +_08164D84: .4byte 0x02038bca +_08164D88: .4byte 0x02038bcc +_08164D8C: .4byte 0x03003124 +_08164D90: .4byte 0x030030fc +_08164D94: .4byte 0x020375f0 +_08164D98: + bl sub_800AC34 + ldr r1, _08164DA4 + movs r0, 0x5 + b _08164DB4 + .align 2, 0 +_08164DA4: .4byte 0x020375f0 +_08164DA8: + ldr r0, _08164DC4 + ldrb r0, [r0] + cmp r0, 0 + bne _08164DB6 +_08164DB0: + ldr r1, _08164DC8 + movs r0, 0x6 +_08164DB4: + strh r0, [r1] +_08164DB6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08164DC4: .4byte 0x03003124 +_08164DC8: .4byte 0x020375f0 + thumb_func_end sub_8164B74 + + thumb_func_start sub_8164DCC +sub_8164DCC: @ 8164DCC + push {lr} + ldr r0, _08164DE0 + ldrb r0, [r0] + cmp r0, 0 + beq _08164DDA + bl sub_800AC34 +_08164DDA: + pop {r0} + bx r0 + .align 2, 0 +_08164DE0: .4byte 0x030030fc + thumb_func_end sub_8164DCC + + thumb_func_start sub_8164DE4 +sub_8164DE4: @ 8164DE4 + push {lr} + ldr r0, _08164DFC + ldr r0, [r0] + ldr r1, _08164E00 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xF + bl sub_8162614 + pop {r0} + bx r0 + .align 2, 0 +_08164DFC: .4byte 0x03005d90 +_08164E00: .4byte 0x00000cd6 + thumb_func_end sub_8164DE4 + + thumb_func_start sub_8164E04 +sub_8164E04: @ 8164E04 + push {r4-r6,lr} + sub sp, 0x20 + ldr r0, _08164EA4 + bl var_get + lsls r0, 16 + cmp r0, 0 + bne _08164E9A + ldr r5, _08164EA8 + ldrh r1, [r5] + mov r0, sp + bl sub_8162E20 + mov r0, sp + bl sub_8009370 + ldr r4, _08164EAC + ldr r0, [r4] + ldr r1, _08164EB0 + adds r0, r1 + mov r1, sp + bl gf_strcpy + ldr r0, [r4] + ldr r2, _08164EB4 + adds r0, r2 + ldrh r1, [r5] + bl sub_8165B88 + ldr r6, _08164EB8 + ldrh r0, [r6, 0x2] + movs r5, 0x64 + muls r0, r5 + ldr r1, _08164EBC + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, [r4] + ldr r2, _08164EC0 + adds r1, r2 + strh r0, [r1] + ldrh r0, [r6] + muls r0, r5 + ldr r1, _08164EC4 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, [r4] + ldr r2, _08164EC8 + adds r1, r2 + strh r0, [r1] + movs r2, 0 + movs r5, 0xBE + lsls r5, 4 + ldr r3, _08164ECC + adds r6, r4, 0 +_08164E7C: + ldr r0, [r4] + adds r0, r5 + adds r0, r2 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xA + ble _08164E7C + ldr r0, [r6] + ldr r1, _08164ED0 + ldrb r1, [r1] + ldr r2, _08164ED4 + adds r0, r2 + strb r1, [r0] +_08164E9A: + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08164EA4: .4byte 0x000040ce +_08164EA8: .4byte 0x02038bca +_08164EAC: .4byte 0x03005d90 +_08164EB0: .4byte 0x00000bd8 +_08164EB4: .4byte 0x00000beb +_08164EB8: .4byte 0x0202406e +_08164EBC: .4byte 0x02024744 +_08164EC0: .4byte 0x00000bd6 +_08164EC4: .4byte 0x020244ec +_08164EC8: .4byte 0x00000bd4 +_08164ECC: .4byte 0x020240b4 +_08164ED0: .4byte 0x0202433a +_08164ED4: .4byte 0x00000d06 + thumb_func_end sub_8164E04 + + thumb_func_start sub_8164ED8 +sub_8164ED8: @ 8164ED8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _08164F64 + ldr r0, [r0] + movs r3, 0 + movs r2, 0 + ldr r4, _08164F68 + adds r1, r0, r4 +_08164EEA: + ldm r1!, {r0} + adds r3, r0 + adds r2, 0x1 + cmp r2, 0x39 + bls _08164EEA + ldr r5, _08164F64 + ldr r1, [r5] + ldr r2, _08164F6C + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r3 + beq _08164F0A + ldr r3, _08164F68 + adds r0, r1, r3 + bl sub_8164FB8 +_08164F0A: + movs r4, 0 + adds r7, r5, 0 + movs r6, 0xEC + mov r8, r7 +_08164F12: + adds r0, r4, 0 + muls r0, r6 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r1, [r7] + movs r3, 0 + movs r2, 0 + adds r5, r4, 0x1 + adds r1, r0 +_08164F26: + ldm r1!, {r0} + adds r3, r0 + adds r2, 0x1 + cmp r2, 0x39 + bls _08164F26 + mov r0, r8 + ldr r2, [r0] + adds r1, r4, 0 + muls r1, r6 + movs r4, 0x82 + lsls r4, 4 + adds r0, r2, r4 + adds r0, r1 + ldr r0, [r0] + cmp r0, r3 + beq _08164F52 + movs r3, 0xE7 + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2, r0 + bl sub_8164FB8 +_08164F52: + adds r4, r5, 0 + cmp r4, 0x4 + ble _08164F12 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08164F64: .4byte 0x03005d90 +_08164F68: .4byte 0x0000064c +_08164F6C: .4byte 0x00000734 + thumb_func_end sub_8164ED8 + + thumb_func_start sub_8164F70 +sub_8164F70: @ 8164F70 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xE8 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08164F7E: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x39 + bls _08164F7E + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8164F70 + + thumb_func_start sub_8164F94 +sub_8164F94: @ 8164F94 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xA0 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08164FA2: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x27 + bls _08164FA2 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8164F94 + + thumb_func_start sub_8164FB8 +sub_8164FB8: @ 8164FB8 + push {lr} + movs r1, 0 + movs r2, 0 +_08164FBE: + stm r0!, {r2} + adds r1, 0x1 + cmp r1, 0x3A + bls _08164FBE + pop {r0} + bx r0 + thumb_func_end sub_8164FB8 + + thumb_func_start sub_8164FCC +sub_8164FCC: @ 8164FCC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _08164FF4 + ldr r2, [r2] + lsrs r0, 23 + lsrs r1, 22 + adds r0, r1 + movs r1, 0xCE + lsls r1, 4 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + ldr r1, _08164FF8 + cmp r0, r1 + bls _08164FEE + adds r0, r1, 0 +_08164FEE: + pop {r1} + bx r1 + .align 2, 0 +_08164FF4: .4byte 0x03005d90 +_08164FF8: .4byte 0x0000270f + thumb_func_end sub_8164FCC + + thumb_func_start sub_8164FFC +sub_8164FFC: @ 8164FFC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08165018 + mov r0, sp + movs r2, 0x4 + bl memcpy + cmp r4, 0x3 + bls _0816501C + movs r0, 0x3 + b _08165022 + .align 2, 0 +_08165018: .4byte 0x085dfa42 +_0816501C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] +_08165022: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8164FFC + + thumb_func_start sub_816502C +sub_816502C: @ 816502C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, _08165144 + ldr r0, [r0] + ldr r1, _08165148 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + ldr r0, _0816514C + bl var_get + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sub_8164FFC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0x44 + mov r10, r2 + cmp r5, 0 + beq _0816506A + movs r0, 0x45 + mov r10, r0 +_0816506A: + ldr r1, _08165150 + mov r9, r1 + movs r0, 0 + strh r0, [r1] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8164FCC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x37 + bls _081650DC + movs r6, 0 + cmp r6, r8 + bge _081650DC + ldr r7, _08165154 + mov r5, sp +_0816508C: + ldr r0, _08165144 + ldr r0, [r0] + lsls r1, r6, 1 + ldr r2, _08165158 + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] + subs r1, 0x1 + movs r0, 0 + strb r1, [r5] + strb r0, [r5, 0x1] + movs r0, 0x64 + muls r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r4, r0, r1 + ldr r0, [r7] + adds r0, r4 + mov r1, r10 + bl pokemon_getattr + cmp r0, 0 + bne _081650D4 + movs r0, 0x1 + mov r2, r9 + strh r0, [r2] + ldr r0, [r7] + adds r0, r4 + mov r1, r10 + bl pokemon_setattr + ldr r0, [r7] + adds r0, r4 + bl sub_80EE5A4 + strb r0, [r5, 0x1] +_081650D4: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, r8 + blt _0816508C +_081650DC: + ldr r0, _08165150 + ldrh r0, [r0] + cmp r0, 0 + beq _08165132 + movs r0, 0x2A + bl sav12_xor_increment + mov r0, r8 + cmp r0, 0x1 + ble _08165110 + mov r3, sp + add r2, sp, 0x4 + mov r6, r8 + subs r6, 0x1 +_081650F8: + ldrb r1, [r3, 0x1] + ldrb r0, [r2, 0x1] + cmp r0, r1 + bls _08165108 + ldr r1, [sp] + ldr r0, [r2] + str r0, [sp] + str r1, [r2] +_08165108: + adds r2, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _081650F8 +_08165110: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bls _08165132 + ldr r2, _08165154 + mov r0, sp + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + mov r1, r10 + bl sub_80EE4DC +_08165132: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08165144: .4byte 0x03005d90 +_08165148: .4byte 0x00000ca9 +_0816514C: .4byte 0x000040ce +_08165150: .4byte 0x020375f0 +_08165154: .4byte 0x03005d8c +_08165158: .4byte 0x00000caa + thumb_func_end sub_816502C + + thumb_func_start sub_816515C +sub_816515C: @ 816515C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, _08165188 + ldr r2, [r1] + ldr r0, _0816518C + adds r7, r2, r0 + ldrb r0, [r2, 0x8] + adds r5, r1, 0 + cmp r0, 0 + beq _08165194 + ldr r4, _08165190 + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x14 + b _081651A6 + .align 2, 0 +_08165188: .4byte 0x03005d90 +_0816518C: .4byte 0x00000bec +_08165190: .4byte 0x085dcefa +_08165194: + ldr r4, _08165234 + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x1E +_081651A6: + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r7, 0x1] + adds r0, r7, 0 + adds r0, 0xC + ldr r1, [r5] + adds r1, 0xA + bl sub_80842F4 + adds r0, r7, 0x4 + ldr r1, [r5] + bl strcpy_limit_7_chars + movs r0, 0x1 + strh r0, [r7, 0x2] + movs r6, 0x7 + movs r4, 0 + ldr r0, _08165238 + mov r8, r0 + adds r5, r7, 0 + adds r5, 0x10 + ldr r1, _0816523C + mov r12, r1 + adds r3, r7, 0 + adds r3, 0x28 + adds r2, r7, 0 + adds r2, 0x1C +_081651E0: + lsls r0, r4, 1 + mov r9, r0 + mov r1, r8 + ldr r0, [r1] + add r0, r12 + add r0, r9 + ldrh r0, [r0] + strh r0, [r5] + strh r6, [r2] + adds r0, r6, 0x6 + strh r0, [r3] + adds r6, 0x1 + adds r5, 0x2 + adds r3, 0x2 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x5 + ble _081651E0 + movs r4, 0 +_08165206: + movs r0, 0x64 + muls r0, r4 + ldr r1, _08165240 + adds r0, r1 + movs r1, 0x2C + muls r1, r4 + adds r1, 0x34 + adds r1, r7, r1 + bl sub_80686FC + adds r4, 0x1 + cmp r4, 0x2 + ble _08165206 + adds r0, r7, 0 + bl sub_8165328 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08165234: .4byte 0x085dcedc +_08165238: .4byte 0x03005d8c +_0816523C: .4byte 0x00002bbc +_08165240: .4byte 0x020244ec + thumb_func_end sub_816515C + + thumb_func_start sub_8165244 +sub_8165244: @ 8165244 + ldr r1, _08165258 + ldr r0, _0816525C + ldr r0, [r0] + ldr r2, _08165260 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08165258: .4byte 0x0831f578 +_0816525C: .4byte 0x03005d90 +_08165260: .4byte 0x00000bed + thumb_func_end sub_8165244 + + thumb_func_start sub_8165264 +sub_8165264: @ 8165264 + ldr r1, _08165278 + ldr r0, _0816527C + ldr r0, [r0] + ldr r2, _08165280 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08165278: .4byte 0x0831f5ca +_0816527C: .4byte 0x03005d90 +_08165280: .4byte 0x00000bed + thumb_func_end sub_8165264 + + thumb_func_start sub_8165284 +sub_8165284: @ 8165284 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, _081652B0 + ldr r0, [r0] + movs r1, 0xBF + lsls r1, 4 + adds r4, r0, r1 +_08165294: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x4 + ble _08165294 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081652B0: .4byte 0x03005d90 + thumb_func_end sub_8165284 + + thumb_func_start sub_81652B4 +sub_81652B4: @ 81652B4 + push {r4-r6,lr} + ldr r2, _081652E0 + movs r0, 0 + strh r0, [r2] + ldr r1, _081652E4 + ldr r0, [r1] + ldr r3, _081652E8 + adds r5, r0, r3 + movs r4, 0 + movs r3, 0 + adds r6, r1, 0 + adds r1, r5, 0 +_081652CC: + ldm r1!, {r0} + orrs r4, r0 + adds r3, 0x1 + cmp r3, 0x2D + bls _081652CC + cmp r4, 0 + bne _081652EC + movs r0, 0x1 + strh r0, [r2] + b _08165316 + .align 2, 0 +_081652E0: .4byte 0x020375f0 +_081652E4: .4byte 0x03005d90 +_081652E8: .4byte 0x00000bec +_081652EC: + movs r4, 0 + movs r3, 0 + adds r2, r5, 0 +_081652F2: + ldm r2!, {r0} + adds r4, r0 + adds r3, 0x1 + cmp r3, 0x2D + bls _081652F2 + ldr r1, [r6] + ldr r2, _0816531C + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r4 + beq _08165316 + ldr r3, _08165320 + adds r0, r1, r3 + bl sub_816534C + ldr r1, _08165324 + movs r0, 0x1 + strh r0, [r1] +_08165316: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816531C: .4byte 0x00000ca4 +_08165320: .4byte 0x00000bec +_08165324: .4byte 0x020375f0 + thumb_func_end sub_81652B4 + + thumb_func_start sub_8165328 +sub_8165328: @ 8165328 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xB8 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08165336: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x2D + bls _08165336 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8165328 + + thumb_func_start sub_816534C +sub_816534C: @ 816534C + push {lr} + movs r1, 0 + movs r2, 0 +_08165352: + stm r0!, {r2} + adds r1, 0x1 + cmp r1, 0x2E + bls _08165352 + pop {r0} + bx r0 + thumb_func_end sub_816534C + + thumb_func_start sub_8165360 +sub_8165360: @ 8165360 + push {lr} + ldr r0, _08165374 + ldr r0, [r0] + ldr r1, _08165378 + adds r0, r1 + bl sub_81638AC + pop {r0} + bx r0 + .align 2, 0 +_08165374: .4byte 0x03005d90 +_08165378: .4byte 0x00000bfc + thumb_func_end sub_8165360 + + thumb_func_start sub_816537C +sub_816537C: @ 816537C + push {lr} + ldr r0, _08165390 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08165398 + ldr r1, _08165394 + movs r0, 0xFF + strb r0, [r1] + b _081653C0 + .align 2, 0 +_08165390: .4byte 0x0202433a +_08165394: .4byte 0x02021fc4 +_08165398: + cmp r0, 0x1 + bne _081653B4 + ldr r0, _081653AC + ldr r0, [r0] + ldr r1, _081653B0 + adds r0, r1 + bl sub_81638AC + b _081653C0 + .align 2, 0 +_081653AC: .4byte 0x03005d90 +_081653B0: .4byte 0x00000c14 +_081653B4: + ldr r0, _081653C4 + ldr r0, [r0] + ldr r1, _081653C8 + adds r0, r1 + bl sub_81638AC +_081653C0: + pop {r0} + bx r0 + .align 2, 0 +_081653C4: .4byte 0x03005d90 +_081653C8: .4byte 0x00000c08 + thumb_func_end sub_816537C + + thumb_func_start start_menu_compose_normal +start_menu_compose_normal: @ 81653CC + push {lr} + ldr r0, _081653FC + ldr r0, [r0] + ldr r1, _08165400 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081653E0 + bl start_menu_append_item +_081653E0: + movs r0, 0x77 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081653F8 + bl start_menu_append_item + movs r0, 0x77 + bl flag_clear +_081653F8: + pop {r0} + bx r0 + .align 2, 0 +_081653FC: .4byte 0x03005d90 +_08165400: .4byte 0x00000ca8 + thumb_func_end start_menu_compose_normal + + thumb_func_start sub_8165404 +sub_8165404: @ 8165404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x70 + lsls r0, 16 + lsrs r7, r0, 16 + bl sub_8165C40 + ldr r0, _08165530 + cmp r7, r0 + beq _08165420 + b _0816554C +_08165420: + movs r0, 0 + mov r10, r0 + mov r1, sp + adds r1, 0x44 + str r1, [sp, 0x64] +_0816542A: + mov r2, r10 + lsls r2, 2 + mov r9, r2 + mov r3, r10 + adds r3, 0x1 + str r3, [sp, 0x60] + mov r0, r9 + add r0, r10 + lsls r0, 2 + ldr r6, _08165534 + adds r5, r0, r6 +_08165440: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x44] + ldr r0, _08165538 + adds r1, r4, 0 + bl sub_806EBD0 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _08165440 + ldr r0, [sp, 0x44] + bl getNature + ldrb r1, [r5, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _08165440 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r1, _0816553C + mov r8, r1 + adds r0, r6, r1 + mov r5, r9 + add r5, r10 + lsls r5, 2 + ldr r2, _08165534 + adds r3, r5, r2 + ldrh r1, [r3] + ldrb r2, [r3, 0x3] + ldrb r3, [r3, 0x2] + mov r12, r3 + movs r4, 0x1 + str r4, [sp] + mov r3, r10 + str r3, [sp, 0x4] + str r4, [sp, 0x8] + ldr r4, _08165538 + str r4, [sp, 0xC] + mov r3, r12 + bl create_pokemon_set_level + str r7, [sp, 0x44] + movs r3, 0 + mov r4, r8 + ldr r0, _08165540 + adds r5, r0 +_081654B0: + adds r1, r3, 0 + adds r1, 0x1A + adds r2, r5, r3 + adds r0, r6, r4 + bl pokemon_setattr + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r3, r0, 0 + cmp r3, 0x5 + ble _081654B0 + movs r0, 0 + str r0, [sp, 0x44] + movs r1, 0 + movs r6, 0x64 + mov r4, r10 + muls r4, r6 + ldr r7, _08165544 + ldr r6, _0816553C + mov r0, r9 + add r0, r10 + lsls r5, r0, 2 +_081654DE: + lsls r0, r1, 1 + adds r0, r5 + adds r0, r7 + ldrh r1, [r0] + ldr r0, [sp, 0x64] + ldrb r2, [r0] + adds r0, r4, r6 + bl sub_80691F4 + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r1, r0, 0 + cmp r1, 0x3 + ble _081654DE + movs r1, 0x64 + mov r4, r10 + muls r4, r1 + ldr r0, _0816553C + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, _08165548 + bl pokemon_setattr + movs r0, 0 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp, 0x60] + mov r10, r2 + cmp r2, 0x2 + bgt _0816552E + b _0816542A +_0816552E: + b _0816585A + .align 2, 0 +_08165530: .4byte 0x00000c03 +_08165534: .4byte 0x085dd6d0 +_08165538: .4byte 0x0000ef2a +_0816553C: .4byte 0x02024618 +_08165540: .4byte 0x085dd6d5 +_08165544: .4byte 0x085dd6dc +_08165548: .4byte 0x08317dd4 +_0816554C: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + bne _08165564 + add r0, sp, 0x10 + ldr r1, _08165560 + ldrb r1, [r1] + strb r1, [r0] + b _0816585A + .align 2, 0 +_08165560: .4byte 0x082e9531 +_08165564: + ldr r0, _081656CC + cmp r7, r0 + bls _0816556C + b _081656E8 +_0816556C: + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x50] + adds r0, r7, 0 + bl sub_8165D08 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4C] + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x58] + movs r3, 0 + mov r10, r3 + mov r6, sp + adds r6, 0x44 + str r6, [sp, 0x64] + mov r0, sp + adds r0, 0x48 + str r0, [sp, 0x5C] +_081655A6: + ldr r0, _081656D0 + ldr r1, [r0] + mov r0, r10 + adds r0, 0x12 + lsls r0, 1 + ldr r2, _081656D4 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + str r1, [sp, 0x54] + movs r6, 0x64 + mov r3, r10 + muls r3, r6 + mov r8, r3 + ldr r0, _081656D8 + mov r9, r0 + mov r0, r8 + add r0, r9 + ldr r6, _081656DC + ldr r4, [r6] + lsls r5, r1, 4 + adds r4, r5, r4 + ldrh r1, [r4] + ldr r3, [sp, 0x50] + lsls r2, r3, 24 + ldrb r3, [r4, 0xC] + mov r12, r3 + ldr r3, [sp, 0x4C] + str r3, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r3, [sp, 0x58] + str r3, [sp, 0x8] + lsrs r2, 24 + mov r3, r12 + bl sub_8068634 + movs r0, 0xFF + str r0, [sp, 0x48] + movs r0, 0 + str r0, [sp, 0x44] + movs r2, 0 + mov r0, r10 + adds r0, 0x1 + str r0, [sp, 0x60] + mov r4, r8 + mov r3, r9 +_08165604: + ldr r0, [r6] + adds r0, r5, r0 + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, r3 + str r3, [sp, 0x68] + bl sub_80691F4 + ldr r0, [r6] + adds r0, r5, r0 + ldr r2, [sp, 0x44] + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + ldr r3, [sp, 0x68] + cmp r0, 0xDA + bne _08165634 + movs r0, 0 + str r0, [sp, 0x48] +_08165634: + adds r0, r2, 0x1 + str r0, [sp, 0x44] + adds r2, r0, 0 + cmp r2, 0x3 + ble _08165604 + movs r1, 0x64 + mov r4, r10 + muls r4, r1 + ldr r0, _081656D8 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x5C] + bl pokemon_setattr + ldr r0, _081656DC + ldr r1, [r0] + ldr r2, [sp, 0x54] + lsls r0, r2, 4 + adds r0, r1 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _081656E0 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + movs r0, 0 + str r0, [sp, 0x44] + movs r2, 0 + ldr r0, _081656E4 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r7 + adds r0, r1 + adds r3, r0, 0x4 +_0816567E: + mov r1, sp + adds r1, r2 + adds r1, 0x10 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r2, r0, 0 + cmp r2, 0x7 + ble _0816567E + movs r3, 0x64 + mov r4, r10 + muls r4, r3 + ldr r0, _081656D8 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x7 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r7, 0 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + ldr r6, [sp, 0x60] + mov r10, r6 + cmp r6, 0x1 + bgt _081656CA + b _081655A6 +_081656CA: + b _0816585A + .align 2, 0 +_081656CC: .4byte 0x0000012b +_081656D0: .4byte 0x03005d90 +_081656D4: .4byte 0x00000cb4 +_081656D8: .4byte 0x02024618 +_081656DC: .4byte 0x0203bc8c +_081656E0: .4byte 0x085cecb0 +_081656E4: .4byte 0x0203bc88 +_081656E8: + ldr r0, _08165774 + cmp r7, r0 + bls _081656F0 + b _081657F0 +_081656F0: + ldr r1, _08165778 + adds r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0 + mov r10, r2 + mov r3, sp + adds r3, 0x44 + str r3, [sp, 0x64] + add r5, sp, 0x18 + ldr r6, _0816577C + mov r9, r6 + ldr r0, _08165780 + mov r8, r0 + movs r1, 0x24 + str r1, [sp, 0x6C] +_08165710: + ldr r1, _08165784 + movs r0, 0xEC + adds r4, r7, 0 + muls r4, r0 + movs r2, 0xE7 + lsls r2, 3 + adds r4, r2 + ldr r0, [r1] + adds r4, r0, r4 + ldr r3, _08165788 + adds r0, r3 + ldr r6, [sp, 0x6C] + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x2C + muls r1, r0 + adds r1, r4, r1 + adds r0, r5, 0 + adds r1, 0x34 + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + adds r1, r4, 0x4 + add r0, sp, 0x10 + bl gf_strcpy + adds r4, 0xE4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _0816578C + ldrh r0, [r5, 0x20] + mov r6, r8 + ands r0, r6 + cmp r0, r9 + beq _0816579C + mov r1, sp + adds r1, 0x3D + movs r0, 0xFF + strb r0, [r1] + add r0, sp, 0x38 + movs r1, 0x1 + bl sub_8009308 + b _0816579C + .align 2, 0 +_08165774: .4byte 0x0000018f +_08165778: .4byte 0xfffffed4 +_0816577C: .4byte 0x000015fc +_08165780: .4byte 0x0000ffff +_08165784: .4byte 0x03005d90 +_08165788: .4byte 0x00000cb4 +_0816578C: + ldrh r0, [r5, 0x20] + mov r1, r8 + ands r0, r1 + cmp r0, r9 + bne _0816579C + add r1, sp, 0x10 + movs r0, 0xFF + strb r0, [r1, 0x5] +_0816579C: + movs r0, 0x64 + mov r4, r10 + muls r4, r0 + ldr r0, _081657EC + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8068338 + adds r0, r4, 0 + movs r1, 0x7 + add r2, sp, 0x10 + bl pokemon_setattr + movs r2, 0x96 + lsls r2, 1 + adds r0, r7, r2 + lsls r0, 16 + lsrs r0, 16 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + ldr r3, [sp, 0x6C] + adds r3, 0x2 + str r3, [sp, 0x6C] + movs r6, 0x1 + add r10, r6 + mov r0, r10 + cmp r0, 0x1 + ble _08165710 + b _0816585A + .align 2, 0 +_081657EC: .4byte 0x02024618 +_081657F0: + ldr r1, _0816586C + adds r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0 + mov r10, r2 + mov r3, sp + adds r3, 0x44 + str r3, [sp, 0x64] + ldr r6, _08165870 + mov r8, r6 + movs r5, 0x24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r6, r0, 0 + adds r6, 0xDC +_08165812: + movs r0, 0x64 + mov r4, r10 + muls r4, r0 + ldr r0, _08165874 + adds r4, r0 + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r6 + ldr r2, _08165878 + adds r0, r2 + adds r0, r5 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8068528 + movs r3, 0xC8 + lsls r3, 1 + adds r0, r7, r3 + lsls r0, 16 + lsrs r0, 16 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + adds r5, 0x2 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x1 + ble _08165812 +_0816585A: + add sp, 0x70 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816586C: .4byte 0xfffffe70 +_08165870: .4byte 0x03005d90 +_08165874: .4byte 0x02024618 +_08165878: .4byte 0x00000cb4 + thumb_func_end sub_8165404 + + thumb_func_start sub_816587C +sub_816587C: @ 816587C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + movs r2, 0 + adds r1, r6, 0 + adds r3, r6, 0 + adds r3, 0x58 +_08165894: + ldrh r0, [r1, 0x1C] + cmp r0, 0 + beq _0816589C + adds r2, 0x1 +_0816589C: + adds r1, 0x2C + cmp r1, r3 + ble _08165894 + cmp r2, 0x3 + beq _081658B4 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xEC + bl memset + movs r0, 0 + b _081659BE +_081658B4: + ldrb r0, [r6] + strb r0, [r5] + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x2] + movs r2, 0 + ldr r0, _08165914 + ldrb r1, [r0] + ldrb r3, [r6, 0x1] + mov r12, r0 + adds r4, r5, 0x4 + adds r7, r6, 0x4 + movs r0, 0xC + adds r0, r5 + mov r9, r0 + movs r0, 0xC + adds r0, r6 + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x10 + adds r0, r6 + mov r10, r0 + adds r0, r5, 0 + adds r0, 0x1C + str r0, [sp, 0x8] + adds r0, 0xC + str r0, [sp, 0xC] + adds r0, 0x90 + str r0, [sp, 0x10] + cmp r1, r3 + beq _08165904 + mov r1, r12 +_081658F6: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x51 + bgt _08165904 + ldrb r0, [r1] + cmp r0, r3 + bne _081658F6 +_08165904: + cmp r2, 0x52 + beq _08165918 + lsls r0, r2, 1 + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _0816591A + .align 2, 0 +_08165914: .4byte 0x085dcf40 +_08165918: + movs r0, 0x2B +_0816591A: + strb r0, [r5, 0x1] + movs r2, 0 + adds r3, r7, 0 +_08165920: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08165920 + movs r2, 0 + mov r4, r9 + mov r3, r8 +_08165934: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08165934 + mov r3, r10 + ldr r1, [sp, 0x4] + movs r2, 0x5 +_08165948: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165948 + ldr r3, _081659D0 + ldr r1, [sp, 0x8] + movs r2, 0x5 +_0816595C: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _0816595C + ldr r3, _081659D4 + ldr r1, [sp, 0xC] + movs r2, 0x5 +_08165970: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165970 + adds r2, r6, 0 + adds r3, r5, 0 + movs r4, 0x58 + adds r4, r2 + mov r8, r4 +_08165988: + adds r1, r3, 0 + adds r1, 0x34 + adds r0, r2, 0 + adds r0, 0x1C + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} + adds r2, 0x2C + adds r3, 0x2C + cmp r2, r8 + ble _08165988 + movs r0, 0 + str r0, [sp] + ldr r2, _081659D8 + mov r0, sp + ldr r1, [sp, 0x10] + bl CpuSet + adds r0, r5, 0 + bl sub_8164F70 + movs r0, 0x1 +_081659BE: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081659D0: .4byte 0x085dfa46 +_081659D4: .4byte 0x085dfa52 +_081659D8: .4byte 0x0500000b + thumb_func_end sub_816587C + + thumb_func_start sub_81659DC +sub_81659DC: @ 81659DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + movs r2, 0 + adds r1, r4, 0 + adds r3, r4, 0 + adds r3, 0x58 +_081659F4: + ldrh r0, [r1, 0x34] + cmp r0, 0 + beq _081659FC + adds r2, 0x1 +_081659FC: + adds r1, 0x2C + cmp r1, r3 + ble _081659F4 + cmp r2, 0x3 + beq _08165A14 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0xA4 + bl memset + movs r0, 0 + b _08165AD8 +_08165A14: + ldrb r0, [r4] + strb r0, [r6] + ldrh r0, [r4, 0x2] + strh r0, [r6, 0x2] + movs r2, 0 + ldr r0, _08165A64 + ldrb r1, [r0, 0x1] + ldrb r3, [r4, 0x1] + mov r12, r0 + adds r5, r6, 0x4 + adds r7, r4, 0x4 + movs r0, 0xC + adds r0, r6 + mov r9, r0 + movs r0, 0xC + adds r0, r4 + mov r8, r0 + adds r0, r6, 0 + adds r0, 0x10 + str r0, [sp] + movs r0, 0x10 + adds r0, r4 + mov r10, r0 + cmp r1, r3 + beq _08165A58 + mov r1, r12 + adds r1, 0x1 +_08165A4A: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x51 + bgt _08165A58 + ldrb r0, [r1] + cmp r0, r3 + bne _08165A4A +_08165A58: + cmp r2, 0x52 + beq _08165A68 + lsls r0, r2, 1 + add r0, r12 + ldrb r0, [r0] + b _08165A6A + .align 2, 0 +_08165A64: .4byte 0x085dcf40 +_08165A68: + movs r0, 0x24 +_08165A6A: + strb r0, [r6, 0x1] + movs r2, 0 + adds r3, r7, 0 +_08165A70: + adds r0, r5, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08165A70 + movs r2, 0 + mov r5, r9 + mov r3, r8 +_08165A84: + adds r0, r5, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08165A84 + mov r3, r10 + ldr r1, [sp] + movs r2, 0x5 +_08165A98: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165A98 + adds r2, r4, 0 + adds r3, r6, 0 + movs r4, 0x58 + adds r4, r2 + mov r8, r4 +_08165AB0: + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r2, 0 + adds r0, 0x34 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r5,r7} + stm r1!, {r5,r7} + adds r2, 0x2C + adds r3, 0x2C + cmp r2, r8 + ble _08165AB0 + adds r0, r6, 0 + bl sub_8164F94 + movs r0, 0x1 +_08165AD8: + 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_81659DC + + thumb_func_start sub_8165AE8 +sub_8165AE8: @ 8165AE8 + push {r4,lr} + adds r2, r0, 0 + movs r0, 0 + str r0, [r2, 0x40] + movs r3, 0 + adds r4, r2, 0 +_08165AF4: + ldr r0, [r2, 0x40] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2, 0x40] + adds r3, 0x1 + cmp r3, 0xF + bls _08165AF4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8165AE8 + + thumb_func_start sub_8165B08 +sub_8165B08: @ 8165B08 + push {lr} + movs r1, 0 + movs r3, 0 + adds r2, r0, 0 +_08165B10: + stm r2!, {r3} + adds r1, 0x1 + cmp r1, 0x10 + bls _08165B10 + bl sub_819FA5C + pop {r0} + bx r0 + thumb_func_end sub_8165B08 + + thumb_func_start sub_8165B20 +sub_8165B20: @ 8165B20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, _08165B84 + mov r8, r0 + mov r9, r8 +_08165B30: + lsls r0, r5, 4 + adds r1, r0, r5 + lsls r1, 2 + adds r1, 0xDC + mov r3, r9 + ldr r2, [r3] + movs r4, 0 + movs r3, 0 + adds r6, r0, 0 + adds r7, r5, 0x1 + adds r2, r1 +_08165B46: + ldm r2!, {r0} + adds r4, r0 + adds r3, 0x1 + cmp r3, 0xF + bls _08165B46 + mov r0, r8 + ldr r2, [r0] + adds r0, r6, r5 + lsls r1, r0, 2 + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, r4 + beq _08165B70 + adds r0, r1, 0 + adds r0, 0xDC + adds r0, r2, r0 + bl sub_8165B08 +_08165B70: + adds r5, r7, 0 + cmp r5, 0x3 + ble _08165B30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08165B84: .4byte 0x03005d90 + thumb_func_end sub_8165B20 + + thumb_func_start sub_8165B88 +sub_8165B88: @ 8165B88 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + adds r3, r2, 0 + movs r0, 0xFA + lsls r0, 1 + cmp r2, r0 + bne _08165BA4 + ldr r0, _08165BA0 + b _08165C28 + .align 2, 0 +_08165BA0: .4byte 0x082e9531 +_08165BA4: + ldr r0, _08165BB0 + cmp r2, r0 + bhi _08165BB8 + ldr r0, _08165BB4 + b _08165C28 + .align 2, 0 +_08165BB0: .4byte 0x0000012b +_08165BB4: .4byte 0x082e9531 +_08165BB8: + ldr r0, _08165BD4 + cmp r2, r0 + bhi _08165BFC + ldr r0, _08165BD8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08165BDC + bl sub_81864B4 + b _08165C2A + .align 2, 0 +_08165BD4: .4byte 0x0000018f +_08165BD8: .4byte 0x02022fec +_08165BDC: + ldr r0, _08165BF0 + ldr r0, [r0] + ldr r1, _08165BF4 + adds r2, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, _08165BF8 + adds r0, r1 + b _08165C28 + .align 2, 0 +_08165BF0: .4byte 0x03005d90 +_08165BF4: .4byte 0xfffffed4 +_08165BF8: .4byte 0x0000081c +_08165BFC: + ldr r0, _08165C10 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08165C14 + bl sub_81864C0 + b _08165C2A + .align 2, 0 +_08165C10: .4byte 0x02022fec +_08165C14: + ldr r0, _08165C34 + ldr r2, [r0] + ldr r0, _08165C38 + adds r1, r3, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, _08165C3C + adds r0, r2, r1 +_08165C28: + ldrb r0, [r0] +_08165C2A: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08165C34: .4byte 0x03005d90 +_08165C38: .4byte 0xfffffe70 +_08165C3C: .4byte 0x0000011b + thumb_func_end sub_8165B88 + + thumb_func_start sub_8165C40 +sub_8165C40: @ 8165C40 + push {lr} + ldr r0, _08165C6C + ldr r0, [r0] + ldr r1, _08165C70 + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08165C84 + ldr r1, _08165C74 + ldr r0, _08165C78 + str r0, [r1] + ldr r1, _08165C7C + ldr r0, _08165C80 + str r0, [r1] + ldrb r0, [r2] + lsls r0, 30 + lsrs r0, 30 + bl sub_8165C90 + b _08165C88 + .align 2, 0 +_08165C6C: .4byte 0x03005d90 +_08165C70: .4byte 0x00000ca9 +_08165C74: .4byte 0x0203bc88 +_08165C78: .4byte 0x085d5acc +_08165C7C: .4byte 0x0203bc8c +_08165C80: .4byte 0x085d97bc +_08165C84: + bl sub_8165D78 +_08165C88: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8165C40 + + thumb_func_start sub_8165C90 +sub_8165C90: @ 8165C90 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08165C9E + cmp r0, 0x1 + beq _08165CA2 +_08165C9E: + movs r0, 0x32 + b _08165CB0 +_08165CA2: + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _08165CB0 + movs r0, 0x3C +_08165CB0: + pop {r1} + bx r1 + thumb_func_end sub_8165C90 + + thumb_func_start sub_8165CB4 +sub_8165CB4: @ 8165CB4 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_08165CBA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08165D04 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _08165CF4 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08165CF4 + adds r0, r4, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + cmp r0, r6 + ble _08165CF4 + adds r6, r0, 0 +_08165CF4: + adds r5, 0x1 + cmp r5, 0x5 + ble _08165CBA + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08165D04: .4byte 0x020244ec + thumb_func_end sub_8165CB4 + + thumb_func_start sub_8165D08 +sub_8165D08: @ 8165D08 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _08165D3A + movs r1, 0x6 + cmp r0, 0x77 + bls _08165D3A + movs r1, 0x9 + cmp r0, 0x8B + bls _08165D3A + movs r1, 0xC + cmp r0, 0x9F + bls _08165D3A + movs r1, 0xF + cmp r0, 0xB3 + bls _08165D3A + movs r1, 0x12 + cmp r0, 0xC7 + bls _08165D3A + movs r1, 0x1F + cmp r0, 0xDB + bhi _08165D3A + movs r1, 0x15 +_08165D3A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8165D08 + + thumb_func_start sub_8165D40 +sub_8165D40: @ 8165D40 + push {lr} + ldr r0, _08165D6C + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _08165D58 + cmp r0, 0x3 + beq _08165D58 + cmp r0, 0x4 + bne _08165D70 +_08165D58: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + b _08165D72 + .align 2, 0 +_08165D6C: .4byte 0x000040cf +_08165D70: + movs r0, 0 +_08165D72: + pop {r1} + bx r1 + thumb_func_end sub_8165D40 + + thumb_func_start sub_8165D78 +sub_8165D78: @ 8165D78 + push {lr} + ldr r0, _08165D94 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bne _08165DA8 + ldr r1, _08165D98 + ldr r0, _08165D9C + str r0, [r1] + ldr r1, _08165DA0 + ldr r0, _08165DA4 + b _08165DF2 + .align 2, 0 +_08165D94: .4byte 0x000040cf +_08165D98: .4byte 0x0203bc88 +_08165D9C: .4byte 0x085dda14 +_08165DA0: .4byte 0x0203bc8c +_08165DA4: .4byte 0x085de02c +_08165DA8: + cmp r0, 0x2 + bne _08165DC8 + ldr r1, _08165DB8 + ldr r0, _08165DBC + str r0, [r1] + ldr r1, _08165DC0 + ldr r0, _08165DC4 + b _08165DF2 + .align 2, 0 +_08165DB8: .4byte 0x0203bc88 +_08165DBC: .4byte 0x085de610 +_08165DC0: .4byte 0x0203bc8c +_08165DC4: .4byte 0x085dec28 +_08165DC8: + cmp r0, 0x3 + bne _08165DE8 + ldr r1, _08165DD8 + ldr r0, _08165DDC + str r0, [r1] + ldr r1, _08165DE0 + ldr r0, _08165DE4 + b _08165DF2 + .align 2, 0 +_08165DD8: .4byte 0x0203bc88 +_08165DDC: .4byte 0x085df084 +_08165DE0: .4byte 0x0203bc8c +_08165DE4: .4byte 0x085df69c +_08165DE8: + ldr r1, _08165E08 + ldr r0, _08165E0C + str r0, [r1] + ldr r1, _08165E10 + ldr r0, _08165E14 +_08165DF2: + str r0, [r1] + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1D + bhi _08165E02 + movs r0, 0x1E +_08165E02: + pop {r1} + bx r1 + .align 2, 0 +_08165E08: .4byte 0x0203bc88 +_08165E0C: .4byte 0x085d5acc +_08165E10: .4byte 0x0203bc8c +_08165E14: .4byte 0x085d97bc + thumb_func_end sub_8165D78 + + thumb_func_start sub_8165E18 +sub_8165E18: @ 8165E18 + push {r4,r5,lr} + ldr r5, _08165E94 +_08165E1C: + bl sub_8165D40 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, _08165E98 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r3, r0 + bge _08165E58 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _08165E58 + ldr r0, _08165E94 + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, _08165E9C + adds r1, r0 +_08165E4A: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _08165E58 + ldrh r0, [r1] + cmp r0, r4 + bne _08165E4A +_08165E58: + ldr r0, [r5] + ldr r1, _08165E98 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _08165E1C + ldr r5, _08165EA0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, _08165E94 + ldr r1, [r0] + ldr r2, _08165E98 + adds r0, r1, r2 + ldrh r2, [r0] + adds r0, r2, 0x1 + cmp r0, 0x2 + bgt _08165E8C + lsls r0, r2, 1 + ldr r2, _08165E9C + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_08165E8C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08165E94: .4byte 0x03005d90 +_08165E98: .4byte 0x00000cb2 +_08165E9C: .4byte 0x00000cb4 +_08165EA0: .4byte 0x02038bca + thumb_func_end sub_8165E18 + + thumb_func_start sub_8165EA4 +sub_8165EA4: @ 8165EA4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + bl sub_8165D78 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r0, _08165EE4 + ldrh r2, [r0] + ldr r0, _08165EE8 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r2 + adds r0, r1 + ldr r0, [r0, 0x30] + str r0, [sp, 0x28] + movs r0, 0 + str r0, [sp, 0x24] + ldr r2, [sp, 0x28] + ldrh r1, [r2] + b _08165EFE + .align 2, 0 +_08165EE4: .4byte 0x02038bca +_08165EE8: .4byte 0x0203bc88 +_08165EEC: + ldr r0, [sp, 0x24] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + lsls r0, 1 + ldr r6, [sp, 0x28] + adds r0, r6 + ldrh r1, [r0] +_08165EFE: + ldr r0, _08165F20 + cmp r1, r0 + bne _08165EEC + movs r0, 0 + mov r8, r0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x2C] + b _08166092 + .align 2, 0 +_08165F20: .4byte 0x0000ffff +_08165F24: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x24] + bl __modsi3 + lsls r0, 1 + ldr r2, [sp, 0x28] + adds r0, r2 + ldrh r4, [r0] + movs r6, 0 + ldr r7, [sp, 0x18] + add r7, r8 + b _08165F44 +_08165F42: + adds r6, 0x1 +_08165F44: + cmp r6, r7 + bge _08165F68 + movs r1, 0x64 + adds r0, r6, 0 + muls r0, r1 + ldr r2, _081660AC + adds r0, r2 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, _081660B0 + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrh r1, [r1] + cmp r0, r1 + bne _08165F42 +_08165F68: + cmp r6, r7 + beq _08165F6E + b _08166092 +_08165F6E: + movs r6, 0 + cmp r6, r7 + bge _08165FB8 + ldr r0, _081660B4 + mov r9, r0 + movs r3, 0 +_08165F7A: + ldr r1, _081660AC + adds r5, r3, r1 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + str r3, [sp, 0x34] + bl pokemon_getattr + ldr r3, [sp, 0x34] + cmp r0, 0 + beq _08165FB0 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + ldr r1, _081660B0 + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrb r1, [r1, 0xA] + lsls r1, 1 + add r1, r9 + ldr r3, [sp, 0x34] + ldrh r1, [r1] + cmp r0, r1 + beq _08165FB8 +_08165FB0: + adds r3, 0x64 + adds r6, 0x1 + cmp r6, r7 + blt _08165F7A +_08165FB8: + cmp r6, r7 + bne _08166092 + movs r6, 0 + cmp r6, r8 + bge _08165FDA + add r0, sp, 0xC + ldrh r0, [r0] + cmp r0, r4 + beq _08165FDA + add r1, sp, 0xC +_08165FCC: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, r8 + bge _08165FDA + ldrh r0, [r1] + cmp r0, r4 + bne _08165FCC +_08165FDA: + cmp r6, r8 + bne _08166092 + mov r2, r8 + lsls r0, r2, 1 + add r0, sp + adds r0, 0xC + strh r4, [r0] + movs r6, 0x64 + adds r0, r7, 0 + muls r0, r6 + ldr r1, _081660AC + adds r0, r1 + ldr r5, _081660B0 + ldr r2, [r5] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r6, 0 + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + ldr r2, [sp, 0x2C] + str r2, [sp, 0x8] + ldr r2, [sp, 0x20] + bl sub_8068634 + add r1, sp, 0x14 + movs r0, 0xFF + strb r0, [r1] + mov r9, r4 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x30] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + mov r8, r1 + adds r3, r5, 0 + mov r5, r9 + ldr r2, _081660AC + mov r10, r2 +_0816602E: + ldr r0, [r3] + adds r0, r5, r0 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r0, r8 + add r0, r10 + str r3, [sp, 0x34] + bl sub_80691F4 + ldr r3, [sp, 0x34] + ldr r0, [r3] + adds r0, r5, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0816605E + movs r0, 0 + mov r1, sp + strb r0, [r1, 0x14] +_0816605E: + adds r6, 0x1 + cmp r6, 0x3 + ble _0816602E + movs r2, 0x64 + adds r4, r7, 0 + muls r4, r2 + ldr r6, _081660AC + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x14 + bl pokemon_setattr + ldr r0, _081660B0 + ldr r0, [r0] + add r0, r9 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _081660B4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + ldr r0, [sp, 0x30] + mov r8, r0 +_08166092: + ldr r1, [sp, 0x1C] + cmp r8, r1 + beq _0816609A + b _08165F24 +_0816609A: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081660AC: .4byte 0x02024744 +_081660B0: .4byte 0x0203bc8c +_081660B4: .4byte 0x085cecb0 + thumb_func_end sub_8165EA4 + + thumb_func_start sub_81660B8 +sub_81660B8: @ 81660B8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _081660E4 + ldrb r0, [r3] + cmp r0, r2 + beq _081660DA +_081660C8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081660DA + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081660C8 +_081660DA: + cmp r1, 0x1E + beq _081660EC + ldr r0, _081660E8 + b _08166116 + .align 2, 0 +_081660E4: .4byte 0x085dcedc +_081660E8: .4byte 0x085dcf0e +_081660EC: + movs r1, 0 + ldr r3, _08166110 + ldrb r0, [r3] + cmp r0, r2 + beq _08166108 +_081660F6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _08166108 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081660F6 +_08166108: + cmp r1, 0x14 + bne _08166114 + movs r0, 0x7 + b _0816611A + .align 2, 0 +_08166110: .4byte 0x085dcefa +_08166114: + ldr r0, _08166120 +_08166116: + adds r0, r1, r0 + ldrb r0, [r0] +_0816611A: + pop {r1} + bx r1 + .align 2, 0 +_08166120: .4byte 0x085dcf2c + thumb_func_end sub_81660B8 + + thumb_func_start sub_8166124 +sub_8166124: @ 8166124 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _08166170 + movs r0, 0xEC + muls r0, r6 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r1, [r2] + movs r5, 0 + movs r4, 0 + movs r3, 0 + adds r1, r0 +_08166140: + ldm r1!, {r0} + adds r5, r0 + orrs r4, r0 + adds r3, 0x1 + cmp r3, 0x39 + bls _08166140 + cmp r5, 0 + bne _08166154 + cmp r4, 0 + beq _08166180 +_08166154: + ldr r2, [r2] + movs r0, 0xEC + adds r1, r6, 0 + muls r1, r0 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, r5 + bne _08166174 + movs r0, 0x1 + b _08166182 + .align 2, 0 +_08166170: .4byte 0x03005d90 +_08166174: + movs r3, 0xE7 + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2, r0 + bl sub_8164FB8 +_08166180: + movs r0, 0 +_08166182: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8166124 + + thumb_func_start sub_8166188 +sub_8166188: @ 8166188 + push {r4-r7,lr} + ldr r0, _081661F0 + ldr r0, [r0] + ldr r1, _081661F4 + ands r0, r1 + cmp r0, 0 + beq _081661E8 + bl sub_8165C40 + lsls r0, 24 + movs r5, 0 + ldr r7, _081661F8 + lsrs r0, 22 + ldr r1, _081661FC + adds r6, r0, r1 +_081661A6: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _08166200 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + beq _081661E2 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + adds r2, r6 + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats +_081661E2: + adds r5, 0x1 + cmp r5, 0x5 + ble _081661A6 +_081661E8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081661F0: .4byte 0x02022fec +_081661F4: .4byte 0x02000002 +_081661F8: .4byte 0x083203cc +_081661FC: .4byte 0x0831f72c +_08166200: .4byte 0x02024744 + thumb_func_end sub_8166188 + + thumb_func_start sub_8166204 +sub_8166204: @ 8166204 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _08166234 + ldr r0, _08166238 + bl malloc_and_clear + str r0, [r4] + ldr r1, _0816623C + ldr r2, _08166240 + adds r0, r2 + str r0, [r1] + str r5, [r0, 0x8] + str r6, [r0, 0x4] + ldr r0, _08166244 + bl launch_c3_walk_stairs_and_run_once + ldr r0, _08166248 + bl set_callback2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08166234: .4byte 0x0203bcac +_08166238: .4byte 0x0000806c +_0816623C: .4byte 0x0203bc90 +_08166240: .4byte 0x00007fd0 +_08166244: .4byte sub_8166380 + 1 +_08166248: .4byte sub_816631C + 1 + thumb_func_end sub_8166204 + + thumb_func_start sub_816624C +sub_816624C: @ 816624C + push {r4,r5,lr} + ldr r4, _0816629C + ldr r0, _081662A0 + bl malloc_and_clear + str r0, [r4] + ldr r5, _081662A4 + ldr r1, _081662A8 + adds r0, r1 + str r0, [r5] + ldr r1, _081662AC + ldr r1, [r1] + str r1, [r0, 0x8] + ldr r1, _081662B0 + ldr r1, [r1] + str r1, [r0, 0x4] + ldr r4, _081662B4 + ldrb r0, [r4] + bl sub_81672E4 + strb r0, [r4] + ldr r5, [r5] + movs r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08166284 + movs r1, 0x1 +_08166284: + adds r0, r5, 0 + adds r0, 0x56 + strb r1, [r0] + ldr r0, _081662B8 + bl launch_c3_walk_stairs_and_run_once + ldr r0, _081662BC + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816629C: .4byte 0x0203bcac +_081662A0: .4byte 0x0000806c +_081662A4: .4byte 0x0203bc90 +_081662A8: .4byte 0x00007fd0 +_081662AC: .4byte 0x0203bc98 +_081662B0: .4byte 0x0203bc94 +_081662B4: .4byte 0x0203bc9c +_081662B8: .4byte sub_8166380 + 1 +_081662BC: .4byte sub_81662C0 + 1 + thumb_func_end sub_816624C + + thumb_func_start sub_81662C0 +sub_81662C0: @ 81662C0 + push {r4,lr} + ldr r4, _081662F8 + ldr r0, [r4] + ldr r0, [r0] + bl _call_via_r0 + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + ldr r4, [r4] + ldr r1, [r4] + ldr r0, _081662FC + cmp r1, r0 + bne _081662F0 + adds r0, r4, 0 + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] + ldr r0, _08166300 + bl set_callback2 +_081662F0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081662F8: .4byte 0x0203bc90 +_081662FC: .4byte map_warp_consider_1_to_outside_or_stair_or_dive + 1 +_08166300: .4byte sub_8166304 + 1 + thumb_func_end sub_81662C0 + + thumb_func_start sub_8166304 +sub_8166304: @ 8166304 + push {lr} + bl sub_81668F8 + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8166304 + + thumb_func_start sub_816631C +sub_816631C: @ 816631C + push {lr} + ldr r0, _0816633C + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + pop {r0} + bx r0 + .align 2, 0 +_0816633C: .4byte 0x0203bc90 + thumb_func_end sub_816631C + + thumb_func_start sub_8166340 +sub_8166340: @ 8166340 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + ldr r0, _08166364 + ldr r0, [r0] + ldr r1, _08166368 + adds r0, r1 + bl sub_81D2108 + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_08166364: .4byte 0x0203bcac +_08166368: .4byte 0x00007c58 + thumb_func_end sub_8166340 + + thumb_func_start launch_c3_walk_stairs_and_run_once +launch_c3_walk_stairs_and_run_once: @ 816636C + ldr r1, _0816637C + ldr r1, [r1] + str r0, [r1] + adds r1, 0x50 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_0816637C: .4byte 0x0203bc90 + thumb_func_end launch_c3_walk_stairs_and_run_once + + thumb_func_start sub_8166380 +sub_8166380: @ 8166380 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _081663A0 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _08166394 + b _08166556 +_08166394: + lsls r0, 2 + ldr r1, _081663A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081663A0: .4byte 0x0203bc90 +_081663A4: .4byte _081663A8 + .align 2, 0 +_081663A8: + .4byte _081663E8 + .4byte _0816640C + .4byte _08166416 + .4byte _08166434 + .4byte _08166464 + .4byte _08166468 + .4byte _08166474 + .4byte _08166484 + .4byte _08166490 + .4byte _0816649C + .4byte _081664B8 + .4byte _081664BC + .4byte _081664E4 + .4byte _08166510 + .4byte _08166528 + .4byte _08166550 +_081663E8: + ldr r2, _08166400 + ldr r0, [r2] + ldr r1, _08166404 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, _08166408 + adds r0, r2 + bl sub_81D1ED4 + b _0816653C + .align 2, 0 +_08166400: .4byte 0x0203bcac +_08166404: .4byte 0x00007b10 +_08166408: .4byte 0x00007c58 +_0816640C: + bl reset_all_obj_data + bl gpu_pal_allocator_reset + b _0816653C +_08166416: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _08166430 + mov r0, sp + bl CpuSet + b _0816653C + .align 2, 0 +_08166430: .4byte 0x05006000 +_08166434: + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0816645C + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _08166460 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + movs r1, 0x97 + movs r2, 0xE0 + bl sub_809882C + b _0816653C + .align 2, 0 +_0816645C: .4byte 0x085dfccc +_08166460: .4byte 0x085dfcdc +_08166464: + ldr r1, [r2] + b _08166540 +_08166468: + bl sub_8168328 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166474: + ldr r1, _08166480 + movs r0, 0x14 + strh r0, [r1] + bl sub_8167420 + b _0816653C + .align 2, 0 +_08166480: .4byte 0x030022b0 +_08166484: + bl sub_8167930 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166490: + movs r0, 0 + bl sub_8167608 + bl sub_8167760 + b _0816653C +_0816649C: + ldr r0, _081664B0 + ldr r0, [r0] + ldr r1, _081664B4 + adds r0, r1 + bl sub_81D312C + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C + .align 2, 0 +_081664B0: .4byte 0x0203bcac +_081664B4: .4byte 0x00007b0e +_081664B8: + ldr r1, [r2] + b _08166540 +_081664BC: + ldr r5, _081664D8 + ldr r1, [r5] + ldr r4, _081664DC + adds r0, r1, r4 + ldr r2, _081664E0 + adds r1, r2 + bl sub_81D2754 + ldr r0, [r5] + adds r0, r4 + bl sub_81D20AC + b _0816653C + .align 2, 0 +_081664D8: .4byte 0x0203bcac +_081664DC: .4byte 0x00007c58 +_081664E0: .4byte 0x00007c6c +_081664E4: + ldr r4, _08166508 + ldr r0, [r4] + ldr r1, _0816650C + adds r0, r1 + bl sub_81D20BC + lsls r0, 24 + cmp r0, 0 + bne _08166556 + ldr r2, [r4] + ldr r1, _0816650C + adds r0, r2, r1 + adds r1, 0x14 + adds r2, r1 + adds r1, r2, 0 + bl sub_81D1F84 + b _0816653C + .align 2, 0 +_08166508: .4byte 0x0203bcac +_0816650C: .4byte 0x00007c58 +_08166510: + ldr r0, _08166520 + ldr r0, [r0] + ldr r2, _08166524 + adds r0, r2 + bl sub_81D2230 + b _0816653C + .align 2, 0 +_08166520: .4byte 0x0203bcac +_08166524: .4byte 0x00007c58 +_08166528: + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x1 + bl sub_8167BA0 +_0816653C: + ldr r0, _0816654C + ldr r1, [r0] +_08166540: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166556 + .align 2, 0 +_0816654C: .4byte 0x0203bc90 +_08166550: + ldr r0, _08166560 + bl launch_c3_walk_stairs_and_run_once +_08166556: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08166560: .4byte map_warp_consider_1_to_outside_or_stair_or_dive + 1 + thumb_func_end sub_8166380 + + thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive +map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 + push {r4,lr} + sub sp, 0x4 + ldr r4, _0816657C + ldr r0, [r4] + adds r0, 0x50 + ldrb r1, [r0] + cmp r1, 0 + beq _08166580 + cmp r1, 0x1 + beq _081665C0 + b _08166610 + .align 2, 0 +_0816657C: .4byte 0x0203bc90 +_08166580: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _081665BC + bl SetVBlankCallback + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166610 + .align 2, 0 +_081665BC: .4byte sub_8166340 + 1 +_081665C0: + ldr r0, _08166618 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166610 + ldr r4, _0816661C + ldr r0, [r4] + ldr r1, _08166620 + adds r0, r1 + bl sub_81D3464 + ldr r4, [r4] + ldr r2, _08166624 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r3, _08166628 + adds r0, r4, r3 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _0816660A + ldr r1, _0816662C + adds r0, r4, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x91 + adds r0, r4, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r3, _08166620 + adds r0, r4, r3 + subs r3, 0xC + adds r1, r4, r3 + ldrb r1, [r1] + bl sub_81D3480 +_0816660A: + ldr r0, _08166630 + bl launch_c3_walk_stairs_and_run_once +_08166610: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08166618: .4byte 0x02037fd4 +_0816661C: .4byte 0x0203bcac +_08166620: .4byte 0x00007b1c +_08166624: .4byte 0x00008041 +_08166628: .4byte 0x00008040 +_0816662C: .4byte 0x00007fb3 +_08166630: .4byte sub_8166634 + 1 + thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive + + thumb_func_start sub_8166634 +sub_8166634: @ 8166634 + push {lr} + ldr r0, _08166650 + ldr r0, [r0] + adds r0, 0x50 + ldrb r0, [r0] + cmp r0, 0x7 + bls _08166644 + b _0816680E +_08166644: + lsls r0, 2 + ldr r1, _08166654 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08166650: .4byte 0x0203bc90 +_08166654: .4byte _08166658 + .align 2, 0 +_08166658: + .4byte _08166678 + .4byte _0816675C + .4byte _0816680E + .4byte _08166788 + .4byte _0816680E + .4byte _08166794 + .4byte _081667AC + .4byte _081667F4 +_08166678: + ldr r2, _081666A8 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081666B8 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl sub_8167CA0 + ldr r0, _081666AC + ldr r0, [r0] + ldr r1, _081666B0 + adds r0, r1 + bl sub_81D3520 + ldr r0, _081666B4 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .align 2, 0 +_081666A8: .4byte 0x030022c0 +_081666AC: .4byte 0x0203bcac +_081666B0: .4byte 0x00007b1c +_081666B4: .4byte 0x0203bc90 +_081666B8: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081666F0 + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_8167CA0 + ldr r0, _081666E4 + ldr r0, [r0] + ldr r2, _081666E8 + adds r0, r2 + bl sub_81D3520 + ldr r0, _081666EC + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .align 2, 0 +_081666E4: .4byte 0x0203bcac +_081666E8: .4byte 0x00007b1c +_081666EC: .4byte 0x0203bc90 +_081666F0: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08166710 + movs r0, 0x5 + bl audio_play + ldr r0, _0816670C + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .align 2, 0 +_0816670C: .4byte 0x0203bc90 +_08166710: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816671A + b _0816680E +_0816671A: + movs r0, 0x5 + bl audio_play + ldr r0, _08166740 + ldr r0, [r0] + ldr r2, _08166744 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0816674C + ldr r0, _08166748 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .align 2, 0 +_08166740: .4byte 0x0203bcac +_08166744: .4byte 0x00008041 +_08166748: .4byte 0x0203bc90 +_0816674C: + ldr r0, _08166758 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x5 + b _0816680C + .align 2, 0 +_08166758: .4byte 0x0203bc90 +_0816675C: + ldr r0, _0816677C + ldr r0, [r0] + ldr r1, _08166780 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816680E + ldr r0, _08166784 + ldr r0, [r0] + adds r0, 0x50 + b _0816680C + .align 2, 0 +_0816677C: .4byte 0x0203bcac +_08166780: .4byte 0x00008044 +_08166784: .4byte 0x0203bc90 +_08166788: + ldr r0, _08166790 + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .align 2, 0 +_08166790: .4byte sub_8166BEC + 1 +_08166794: + bl sub_8166D44 + ldr r0, _081667A8 + ldr r1, [r0] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816680E + .align 2, 0 +_081667A8: .4byte 0x0203bc90 +_081667AC: + bl sub_8166DE4 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081667CC + cmp r1, 0 + bgt _081667C6 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166804 + b _0816680E +_081667C6: + cmp r1, 0x1 + bne _0816680E + b _08166804 +_081667CC: + bl sub_8167268 + lsls r0, 24 + cmp r0, 0 + beq _081667E8 + bl sub_8166F50 + ldr r0, _081667E4 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x7 + b _0816680C + .align 2, 0 +_081667E4: .4byte 0x0203bc90 +_081667E8: + ldr r0, _081667F0 + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .align 2, 0 +_081667F0: .4byte sub_816681C + 1 +_081667F4: + ldr r0, _08166814 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816680E + bl sub_8166F94 +_08166804: + ldr r0, _08166818 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0 +_0816680C: + strb r1, [r0] +_0816680E: + pop {r0} + bx r0 + .align 2, 0 +_08166814: .4byte 0x030022c0 +_08166818: .4byte 0x0203bc90 + thumb_func_end sub_8166634 + + thumb_func_start sub_816681C +sub_816681C: @ 816681C + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _08166834 + ldr r0, [r5] + adds r0, 0x50 + ldrb r4, [r0] + cmp r4, 0 + beq _08166838 + cmp r4, 0x1 + beq _08166888 + b _081668D4 + .align 2, 0 +_08166834: .4byte 0x0203bc90 +_08166838: + ldr r0, _08166874 + ldr r0, [r0] + ldr r1, _08166878 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + ldr r1, _0816687C + strb r0, [r1] + ldr r1, _08166880 + ldr r2, [r5] + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, _08166884 + ldr r0, [r2, 0x8] + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, [r5] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081668D4 + .align 2, 0 +_08166874: .4byte 0x0203bcac +_08166878: .4byte 0x00008041 +_0816687C: .4byte 0x0203bc9c +_08166880: .4byte 0x0203bc94 +_08166884: .4byte 0x0203bc98 +_08166888: + ldr r0, _081668DC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081668D4 + movs r0, 0 + bl SetVBlankCallback + ldr r4, _081668E0 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _081668E4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _081668E8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _081668EC + ldr r0, [r4] + bl free + str r5, [r4] + bl Window_FreeMemory + ldr r1, _081668F0 + ldr r0, _081668F4 + str r0, [r1, 0x8] + bl sub_8179D70 +_081668D4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081668DC: .4byte 0x02037fd4 +_081668E0: .4byte 0x0203bca0 +_081668E4: .4byte 0x0203bca4 +_081668E8: .4byte 0x0203bca8 +_081668EC: .4byte 0x0203bcac +_081668F0: .4byte 0x030022c0 +_081668F4: .4byte sub_816624C + 1 + thumb_func_end sub_816681C + + thumb_func_start sub_81668F8 +sub_81668F8: @ 81668F8 + push {r4,lr} + sub sp, 0x4 + ldr r1, _08166918 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0816690C + b _08166A18 +_0816690C: + lsls r0, 2 + ldr r1, _0816691C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08166918: .4byte 0x0203bc90 +_0816691C: .4byte _08166920 + .align 2, 0 +_08166920: + .4byte _0816693C + .4byte _08166972 + .4byte _08166A18 + .4byte _081669A0 + .4byte _081669AE + .4byte _081669C8 + .4byte _081669F4 +_0816693C: + ldr r0, _0816695C + ldr r0, [r0] + ldr r1, _08166960 + adds r0, r1 + ldr r1, _08166964 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _08166968 + ldr r0, [r4] + adds r0, 0x56 + ldrb r0, [r0] + bl sub_8167CA0 + ldr r1, [r4] + b _081669E2 + .align 2, 0 +_0816695C: .4byte 0x0203bcac +_08166960: .4byte 0x00008041 +_08166964: .4byte 0x0203bc9c +_08166968: + ldr r0, [r4] + adds r0, 0x50 + movs r1, 0x3 + strb r1, [r0] + b _08166A18 +_08166972: + ldr r0, _08166994 + ldr r0, [r0] + ldr r1, _08166998 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08166A18 + ldr r0, _0816699C + ldr r0, [r0] + adds r0, 0x50 + strb r1, [r0] + b _08166A18 + .align 2, 0 +_08166994: .4byte 0x0203bcac +_08166998: .4byte 0x00008044 +_0816699C: .4byte 0x0203bc90 +_081669A0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _081669DE +_081669AE: + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + b _081669DE +_081669C8: + ldr r0, _081669EC + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_081669DE: + ldr r0, _081669F0 + ldr r1, [r0] +_081669E2: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166A18 + .align 2, 0 +_081669EC: .4byte sub_8166340 + 1 +_081669F0: .4byte 0x0203bc90 +_081669F4: + ldr r0, _08166A20 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166A18 + ldr r0, _08166A24 + ldr r0, [r0] + ldr r1, _08166A28 + adds r0, r1 + bl sub_81D3464 + ldr r0, _08166A2C + bl launch_c3_walk_stairs_and_run_once + ldr r0, _08166A30 + bl set_callback2 +_08166A18: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08166A20: .4byte 0x02037fd4 +_08166A24: .4byte 0x0203bcac +_08166A28: .4byte 0x00007b1c +_08166A2C: .4byte sub_8166A34 + 1 +_08166A30: .4byte sub_816631C + 1 + thumb_func_end sub_81668F8 + + thumb_func_start sub_8166A34 +sub_8166A34: @ 8166A34 + push {r4-r6,lr} + ldr r1, _08166A50 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x5 + bls _08166A46 + b _08166BDA +_08166A46: + lsls r0, 2 + ldr r1, _08166A54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08166A50: .4byte 0x0203bc90 +_08166A54: .4byte _08166A58 + .align 2, 0 +_08166A58: + .4byte _08166A70 + .4byte _08166AAC + .4byte _08166AC0 + .4byte _08166B14 + .4byte _08166B94 + .4byte _08166BB6 +_08166A70: + ldr r4, [r5] + ldr r3, _08166A9C + str r3, [r4, 0xC] + ldr r0, _08166AA0 + ldr r0, [r0] + ldr r2, _08166AA4 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0, r1 + subs r2, 0x88 + adds r1, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + str r1, [r4, 0xC] + ldr r3, _08166AA8 + adds r0, r3 + bl sub_81D3520 + b _08166BAA + .align 2, 0 +_08166A9C: .4byte 0x020244ec +_08166AA0: .4byte 0x0203bcac +_08166AA4: .4byte 0x00008041 +_08166AA8: .4byte 0x00007b1c +_08166AAC: + ldr r0, _08166ABC + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08166ABA + b _08166BDA +_08166ABA: + b _08166BAA + .align 2, 0 +_08166ABC: .4byte 0x030022c0 +_08166AC0: + bl sub_8167104 + ldr r6, _08166B00 + ldr r0, [r6] + adds r0, 0x5C + ldr r4, _08166B04 + ldr r1, [r4] + ldr r5, _08166B08 + adds r1, r5 + bl sub_81D2754 + ldr r2, [r4] + ldr r4, _08166B0C + adds r0, r2, r4 + ldr r3, _08166B10 + adds r1, r2, r3 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r4, 0x14 + adds r1, r4 + adds r1, r2, r1 + adds r2, r5 + bl sub_81D1F84 + bl sub_8167338 + ldr r1, [r6] + b _08166BAC + .align 2, 0 +_08166B00: .4byte 0x0203bc90 +_08166B04: .4byte 0x0203bcac +_08166B08: .4byte 0x00007ca8 +_08166B0C: .4byte 0x00007c58 +_08166B10: .4byte 0x00007fb3 +_08166B14: + ldr r5, _08166B78 + ldr r0, [r5] + ldr r1, _08166B7C + adds r0, r1 + bl sub_81D2074 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08166BDA + ldr r0, [r5] + ldr r4, _08166B80 + adds r0, r4 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + bl sub_81681F4 + ldr r3, [r5] + adds r4, r3, r4 + ldrb r1, [r4] + ldr r2, _08166B84 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08166B6C + ldr r4, _08166B88 + adds r0, r3, r4 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r4, _08166B8C + adds r0, r3, r4 + subs r4, 0xC + adds r1, r3, r4 + ldrb r1, [r1] + bl sub_81D3480 +_08166B6C: + ldr r1, _08166B90 + ldr r0, [r1] + adds r0, 0x52 + strb r6, [r0] + ldr r1, [r1] + b _08166BAC + .align 2, 0 +_08166B78: .4byte 0x0203bcac +_08166B7C: .4byte 0x00007c58 +_08166B80: .4byte 0x00008041 +_08166B84: .4byte 0x00008040 +_08166B88: .4byte 0x00007fb3 +_08166B8C: .4byte 0x00007b1c +_08166B90: .4byte 0x0203bc90 +_08166B94: + ldr r1, [r5] + adds r1, 0x52 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bls _08166BDA + bl sub_8166E24 +_08166BAA: + ldr r1, [r5] +_08166BAC: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166BDA +_08166BB6: + ldr r0, _08166BE0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08166BDA + bl sub_8166EDC + lsls r0, 24 + cmp r0, 0 + bne _08166BDA + ldr r0, _08166BE4 + ldrb r0, [r0] + bl sub_8136F68 + ldr r0, _08166BE8 + bl launch_c3_walk_stairs_and_run_once +_08166BDA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08166BE0: .4byte 0x030022c0 +_08166BE4: .4byte 0x0203ce7c +_08166BE8: .4byte sub_8166BEC + 1 + thumb_func_end sub_8166A34 + + thumb_func_start sub_8166BEC +sub_8166BEC: @ 8166BEC + push {r4-r6,lr} + sub sp, 0x4 + ldr r4, _08166C08 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x50 + ldrb r1, [r2] + cmp r1, 0x1 + beq _08166C28 + cmp r1, 0x1 + bgt _08166C0C + cmp r1, 0 + beq _08166C16 + b _08166D18 + .align 2, 0 +_08166C08: .4byte 0x0203bc90 +_08166C0C: + cmp r1, 0x2 + beq _08166C40 + cmp r1, 0x3 + beq _08166C5C + b _08166D18 +_08166C16: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _08166C4A +_08166C28: + ldr r0, _08166C3C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166D18 + movs r0, 0x2 + strb r0, [r2] + b _08166D18 + .align 2, 0 +_08166C3C: .4byte 0x02037fd4 +_08166C40: + ldr r1, _08166C58 + movs r0, 0x3 + strb r0, [r1, 0x15] + bl sub_80BA0A8 +_08166C4A: + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166D18 + .align 2, 0 +_08166C58: .4byte 0x02039b28 +_08166C5C: + ldr r0, [r0, 0x4] + bl set_callback2 + ldr r0, _08166D20 + ldr r0, [r0] + ldr r1, _08166D24 + adds r0, r1 + bl sub_81D354C + movs r4, 0 +_08166C70: + ldr r5, _08166D20 + ldr r0, [r5] + ldr r2, _08166D28 + adds r0, r2 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08166D2C + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _08166C70 + movs r0, 0 + bl gpu_tile_obj_free_by_tag + movs r0, 0x1 + bl gpu_tile_obj_free_by_tag + movs r0, 0 + bl gpu_pal_free_tag + movs r0, 0x1 + bl gpu_pal_free_tag + movs r4, 0 +_08166CAE: + ldr r0, [r5] + lsls r1, r4, 2 + ldr r2, _08166D30 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _08166CAE + ldr r6, _08166D20 + ldr r0, [r6] + ldr r2, _08166D34 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08166CE6 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08166D2C + adds r0, r1 + bl obj_delete_and_free_tiles +_08166CE6: + movs r0, 0 + bl SetVBlankCallback + ldr r4, _08166D38 + ldr r0, [r4] + bl free + movs r5, 0 + str r5, [r4] + ldr r4, _08166D3C + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _08166D40 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r0, [r6] + bl free + str r5, [r6] + bl Window_FreeMemory +_08166D18: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08166D20: .4byte 0x0203bcac +_08166D24: .4byte 0x00007b1c +_08166D28: .4byte 0x00007b06 +_08166D2C: .4byte 0x02020630 +_08166D30: .4byte 0x00007b44 +_08166D34: .4byte 0x00007b10 +_08166D38: .4byte 0x0203bca0 +_08166D3C: .4byte 0x0203bca4 +_08166D40: .4byte 0x0203bca8 + thumb_func_end sub_8166BEC + + thumb_func_start sub_8166D44 +sub_8166D44: @ 8166D44 + push {r4,lr} + sub sp, 0x4C + ldr r0, _08166DCC + ldr r0, [r0] + ldr r1, _08166DD0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _08166DD4 + adds r0, r1 + movs r1, 0x2 + add r2, sp, 0xC + bl pokemon_getattr + add r0, sp, 0xC + bl get_end_of_string_ptr_limit_10_chars + ldr r1, _08166DD8 + add r0, sp, 0xC + bl gf_strcat + ldr r4, _08166DDC + adds r0, r4, 0 + add r1, sp, 0xC + bl gf_strcpy + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08166DE0 + movs r1, 0x97 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + add sp, 0x4C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08166DCC: .4byte 0x0203bcac +_08166DD0: .4byte 0x00008041 +_08166DD4: .4byte 0x020244ec +_08166DD8: .4byte 0x085ec7a0 +_08166DDC: .4byte 0x02021fc4 +_08166DE0: .4byte 0x085dfcfc + thumb_func_end sub_8166D44 + + thumb_func_start sub_8166DE4 +sub_8166DE4: @ 8166DE4 + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08166E18 + cmp r1, 0 + bgt _08166E02 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166E06 + b _08166E18 +_08166E02: + cmp r1, 0x1 + bne _08166E18 +_08166E06: + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl Window_FillTileMap +_08166E18: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8166DE4 + + thumb_func_start sub_8166E24 +sub_8166E24: @ 8166E24 + push {r4,lr} + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r3, _08166EA0 + ldr r0, [r3] + adds r0, 0x53 + movs r1, 0 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + adds r4, r3, 0 + cmp r0, 0 + bne _08166E84 + adds r2, r4, 0 +_08166E60: + ldr r0, [r2] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r3, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08166E60 +_08166E84: + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + ldr r0, _08166EA4 + ldrb r1, [r1] + adds r2, 0x61 + adds r2, r1 + ldrb r2, [r2] + bl sub_8166FD4 + b _08166EB8 + .align 2, 0 +_08166EA0: .4byte 0x0203bc90 +_08166EA4: .4byte 0x02021fc4 +_08166EA8: + ldr r0, _08166ED4 + ldr r1, _08166ED8 + ldr r1, [r1] + adds r1, 0x53 + ldrb r1, [r1] + movs r2, 0 + bl sub_8166FD4 +_08166EB8: + ldr r0, _08166ED4 + bl sub_8166FB0 + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08166ED4: .4byte 0x02021fc4 +_08166ED8: .4byte 0x0203bc90 + thumb_func_end sub_8166E24 + + thumb_func_start sub_8166EDC +sub_8166EDC: @ 8166EDC + push {r4,r5,lr} + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r5, _08166F14 + adds r3, r5, 0 + movs r4, 0x5 +_08166EEC: + ldr r0, [r3] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166F18 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08166F1E + b _08166EEC + .align 2, 0 +_08166F14: .4byte 0x0203bc90 +_08166F18: + strb r4, [r1] + movs r0, 0 + b _08166F44 +_08166F1E: + ldr r4, _08166F4C + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x53 + ldrb r1, [r1] + adds r0, 0x61 + adds r0, r1 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8166FD4 + adds r0, r4, 0 + bl sub_8166FB0 + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x1 +_08166F44: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08166F4C: .4byte 0x02021fc4 + thumb_func_end sub_8166EDC + + thumb_func_start sub_8166F50 +sub_8166F50: @ 8166F50 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + ldr r2, _08166F90 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_08166F90: .4byte 0x085ec800 + thumb_func_end sub_8166F50 + + thumb_func_start sub_8166F94 +sub_8166F94: @ 8166F94 + push {lr} + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl Window_FillTileMap + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_8166F94 + + thumb_func_start sub_8166FB0 +sub_8166FB0: @ 8166FB0 + push {lr} + sub sp, 0xC + ldr r2, _08166FD0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_08166FD0: .4byte 0x02021fc4 + thumb_func_end sub_8166FB0 + + thumb_func_start sub_8166FD4 +sub_8166FD4: @ 8166FD4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 16 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _08167010 + cmp r2, 0 + ble _08166FEC + movs r0, 0 +_08166FEC: + lsls r0, 16 + ldr r1, _08167008 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _0816700C + adds r0, r4, 0 + bl gf_strcat + b _08167018 + .align 2, 0 +_08167008: .4byte 0x085dfd04 +_0816700C: .4byte 0x085ec7e1 +_08167010: + ldr r1, _08167020 + adds r0, r4, 0 + bl gf_strcpy +_08167018: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08167020: .4byte 0x085ec7ef + thumb_func_end sub_8166FD4 + + thumb_func_start sub_8167024 +sub_8167024: @ 8167024 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 + ldr r7, _08167050 +_0816702E: + lsls r0, r4, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r6, 0 + bl pokemon_getattr + adds r1, r5, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _0816702E + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08167050: .4byte 0x085dfcb0 + thumb_func_end sub_8167024 + + thumb_func_start sub_8167054 +sub_8167054: @ 8167054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r5, r1, 0 + adds r0, r5, 0 + movs r1, 0x30 + bl pokemon_getattr + cmp r0, 0xFF + beq _081670F0 + mov r0, r8 + adds r1, r5, 0 + bl sub_8167184 + movs r4, 0 + mov r7, sp +_08167078: + ldr r1, _081670FC + lsls r0, r4, 2 + adds r0, r1 + ldr r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + strb r0, [r7] + ldr r1, _08167100 + ldr r1, [r1] + lsls r2, r4, 1 + adds r1, 0x66 + adds r1, r2 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bge _081670A6 + movs r1, 0 +_081670A6: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670B0 + movs r1, 0xFF +_081670B0: + strb r1, [r7] + adds r0, r5, 0 + adds r1, r6, 0 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167078 + adds r0, r5, 0 + movs r1, 0x30 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldrb r2, [r2, 0x6] + adds r1, r0, r2 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670E2 + movs r1, 0xFF +_081670E2: + mov r0, sp + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0x30 + mov r2, sp + bl pokemon_setattr +_081670F0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081670FC: .4byte 0x085dfcb0 +_08167100: .4byte 0x0203bc90 + thumb_func_end sub_8167054 + + thumb_func_start sub_8167104 +sub_8167104: @ 8167104 + push {r4,r5,lr} + ldr r5, _08167170 + ldr r0, _08167174 + ldr r1, [r0] + ldr r2, _08167178 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, _0816717C + adds r1, r0 + ldrb r1, [r1] + movs r0, 0x64 + muls r0, r1 + adds r5, r0, r5 + ldr r4, _08167180 + ldr r1, [r4] + adds r1, 0x57 + adds r0, r5, 0 + bl sub_8167024 + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r1, r5, 0 + bl sub_8167054 + ldr r1, [r4] + adds r1, 0x5C + adds r0, r5, 0 + bl sub_8167024 + movs r3, 0 +_08167144: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x61 + adds r2, r3 + adds r1, r0, 0 + adds r1, 0x5C + adds r1, r3 + adds r0, 0x57 + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x4 + bls _08167144 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08167170: .4byte 0x020244ec +_08167174: .4byte 0x0203bcac +_08167178: .4byte 0x00008041 +_0816717C: .4byte 0x00007fb9 +_08167180: .4byte 0x0203bc90 + thumb_func_end sub_8167104 + + thumb_func_start sub_8167184 +sub_8167184: @ 8167184 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + ldr r1, _081671CC + ldr r3, [r1] + ldrb r1, [r0, 0x1] + adds r2, r3, 0 + adds r2, 0x66 + strh r1, [r2] + ldrb r2, [r0, 0x5] + adds r1, r3, 0 + adds r1, 0x68 + strh r2, [r1] + ldrb r1, [r0, 0x4] + adds r2, r3, 0 + adds r2, 0x6A + strh r1, [r2] + ldrb r2, [r0, 0x3] + adds r1, r3, 0 + adds r1, 0x6C + strh r2, [r1] + ldrb r1, [r0, 0x2] + adds r0, r3, 0 + adds r0, 0x6E + strh r1, [r0] + ldr r0, _081671D0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _081671D4 + movs r0, 0x1 + b _081671DA + .align 2, 0 +_081671CC: .4byte 0x0203bc90 +_081671D0: .4byte 0x0203bc9e +_081671D4: + cmp r0, 0 + bge _08167250 + movs r0, 0xFF +_081671DA: + movs r2, 0 + lsls r0, 24 + mov r9, r0 + ldr r0, _08167260 + mov r8, r0 +_081671E4: + mov r0, r8 + ldr r1, [r0] + lsls r0, r2, 24 + asrs r6, r0, 24 + lsls r7, r6, 1 + adds r1, 0x66 + adds r1, r7 + movs r2, 0 + ldrsh r4, [r1, r2] + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0816721C + lsls r0, r5, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r5, r0, 24 +_0816721C: + ldr r0, _08167264 + adds r0, r6, r0 + ldrb r1, [r0] + mov r0, r10 + bl sub_806E858 + lsls r0, 24 + asrs r2, r0, 24 + cmp r0, r9 + bne _08167244 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x66 + adds r0, r7 + lsls r1, r5, 24 + asrs r1, 24 + muls r1, r2 + ldrh r2, [r0] + adds r1, r2 + strh r1, [r0] +_08167244: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x4 + ble _081671E4 +_08167250: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08167260: .4byte 0x0203bc90 +_08167264: .4byte 0x085dfcc4 + thumb_func_end sub_8167184 + + thumb_func_start sub_8167268 +sub_8167268: @ 8167268 + push {lr} + ldr r0, _08167294 + ldr r1, [r0] + ldr r2, _08167298 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + subs r2, 0x89 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0xFF + beq _0816729C + movs r0, 0 + b _0816729E + .align 2, 0 +_08167294: .4byte 0x0203bcac +_08167298: .4byte 0x00008041 +_0816729C: + movs r0, 0x1 +_0816729E: + pop {r1} + bx r1 + thumb_func_end sub_8167268 + + thumb_func_start sub_81672A4 +sub_81672A4: @ 81672A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081672AC: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081672C8 + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081672D2 + cmp r5, 0 + bne _081672CC + adds r0, r4, 0 + b _081672DE + .align 2, 0 +_081672C8: .4byte 0x020244ec +_081672CC: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081672D2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081672AC + movs r0, 0 +_081672DE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81672A4 + + thumb_func_start sub_81672E4 +sub_81672E4: @ 81672E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r6, 0 + cmp r6, r5 + bcs _08167314 +_081672F2: + movs r0, 0x64 + muls r0, r4 + ldr r1, _08167320 + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _0816730A + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0816730A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081672F2 +_08167314: + subs r0, r5, r6 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08167320: .4byte 0x020244ec + thumb_func_end sub_81672E4 + + thumb_func_start sub_8167324 +sub_8167324: @ 8167324 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8167324 + + thumb_func_start sub_8167338 +sub_8167338: @ 8167338 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _081673C0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _081673C4 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r2, _081673C8 + ldr r0, [r2] + adds r0, 0x54 + movs r1, 0 + strb r1, [r0] + movs r4, 0 + adds r5, r2, 0 + ldr r6, _081673CC + adds r0, r6, 0x2 + mov r8, r0 + ldr r7, _081673D0 +_08167360: + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673AC + lsls r2, r4, 2 + adds r0, r2, r6 + movs r3, 0 + ldrsh r1, [r0, r3] + add r2, r8 + movs r0, 0 + ldrsh r2, [r2, r0] + ldr r0, _081673D4 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081673AC + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673A2 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _081673D8 + str r1, [r0] +_081673A2: + ldr r1, [r5] + adds r1, 0x54 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081673AC: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167360 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081673C0: .4byte 0x085dfd18 +_081673C4: .4byte 0x085dfd20 +_081673C8: .4byte 0x0203bc90 +_081673CC: .4byte 0x085dfd28 +_081673D0: .4byte 0x0202064c +_081673D4: .4byte 0x085dfd5c +_081673D8: .4byte sub_81673DC + 1 + thumb_func_end sub_8167338 + + thumb_func_start sub_81673DC +sub_81673DC: @ 81673DC + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x5 + bgt _081673EE + ldrh r0, [r1, 0x26] + subs r0, 0x2 + b _081673F6 +_081673EE: + cmp r0, 0xB + bgt _081673F8 + ldrh r0, [r1, 0x26] + adds r0, 0x2 +_081673F6: + strh r0, [r1, 0x26] +_081673F8: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _08167418 + adds r0, r1, 0 + bl obj_delete_and_free_tiles + ldr r0, _0816741C + ldr r1, [r0] + adds r1, 0x54 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_08167418: + pop {r0} + bx r0 + .align 2, 0 +_0816741C: .4byte 0x0203bc90 + thumb_func_end sub_81673DC + + thumb_func_start sub_8167420 +sub_8167420: @ 8167420 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 + ldr r6, _0816742C + b _08167472 + .align 2, 0 +_0816742C: .4byte 0x0203bcac +_08167430: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081674A0 + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + adds r3, r0, 0 + cmp r3, 0 + bne _0816746C + ldr r1, [r6] + lsls r2, r5, 2 + adds r1, r2 + ldr r0, _081674A4 + adds r1, r0 + movs r0, 0xE + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldr r1, _081674A8 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + adds r0, r2 + ldr r2, _081674AC + adds r0, r2 + strh r3, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0816746C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167472: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _08167430 + ldr r2, _081674B0 + ldr r0, [r2] + ldr r1, _081674B4 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r1, r5, 0x1 + ldr r2, _081674B8 + adds r0, r2 + strb r1, [r0] + bl sub_81674BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081674A0: .4byte 0x020244ec +_081674A4: .4byte 0x00007fb8 +_081674A8: .4byte 0x00007fb9 +_081674AC: .4byte 0x00007fba +_081674B0: .4byte 0x0203bcac +_081674B4: .4byte 0x00008041 +_081674B8: .4byte 0x00008040 + thumb_func_end sub_8167420 + + thumb_func_start sub_81674BC +sub_81674BC: @ 81674BC + push {r4,r5,lr} + ldr r4, _08167528 + ldr r0, [r4] + ldr r5, _0816752C + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_816753C + ldr r0, [r4] + ldr r1, _08167530 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, _08167534 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _08167538 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + adds r5, r0, r5 + ldrb r3, [r5] + adds r1, r3, 0x1 + adds r2, 0x8C + adds r0, r2 + ldrb r2, [r0] + cmp r1, r2 + blt _08167500 + movs r1, 0 +_08167500: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r0, 0 + bge _08167510 + subs r0, r2, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167510: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_816753C + lsls r0, r4, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_816753C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08167528: .4byte 0x0203bcac +_0816752C: .4byte 0x00008041 +_08167530: .4byte 0x00007fb3 +_08167534: .4byte 0x00007fb4 +_08167538: .4byte 0x00007fb5 + thumb_func_end sub_81674BC + + thumb_func_start sub_816753C +sub_816753C: @ 816753C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081675EC + mov r9, r0 + ldr r1, [r0] + lsls r5, 16 + asrs r0, r5, 14 + adds r0, r1, r0 + ldr r3, _081675F0 + adds r2, r0, r3 + ldrb r7, [r2] + ldr r2, _081675F4 + adds r0, r2 + ldrb r0, [r0] + mov r10, r0 + adds r3, 0x88 + adds r0, r1, r3 + ldrb r6, [r0] + movs r0, 0 + mov r8, r0 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r2, _081675F8 + adds r0, r2 + adds r0, r1, r0 + lsls r2, r4, 6 + ldr r3, _081675FC + adds r2, r3 + adds r1, r2 + lsrs r5, 16 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2ED4 + mov r3, r9 + ldr r1, [r3] + ldr r2, _08167600 + adds r0, r1, r2 + ldr r3, _08167604 + adds r1, r3 + str r5, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r2, r8 + str r2, [sp, 0xC] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2F78 + lsls r0, r4, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + mov r3, r9 + ldr r1, [r3] + adds r0, r1, r0 + lsls r4, 7 + adds r4, 0x4 + adds r1, r4 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D3094 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081675EC: .4byte 0x0203bcac +_081675F0: .4byte 0x00007fb8 +_081675F4: .4byte 0x00007fb9 +_081675F8: .4byte 0x00007b4d +_081675FC: .4byte 0x00007b95 +_08167600: .4byte 0x00007c58 +_08167604: .4byte 0x00007fb0 + thumb_func_end sub_816753C + + thumb_func_start sub_8167608 +sub_8167608: @ 8167608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0816769C + ldr r3, [r1] + ldr r0, _081676A0 + mov r8, r0 + adds r0, r3, r0 + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0xFF + bne _08167714 + add r5, sp, 0x18 + add r4, sp, 0x20 + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_81D31D0 + lsls r0, r6, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + ldr r1, [r7] + adds r0, r1, r0 + str r0, [sp, 0x18] + lsls r0, r6, 7 + adds r0, 0x4 + adds r1, r0 + str r1, [sp, 0x20] + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + ldr r1, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081676A4 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r1, [r7] + ldr r3, _081676A8 + adds r1, r3 + strh r0, [r1] + mov r0, sp + movs r1, 0x26 + movs r2, 0x68 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, [r7] + ldr r2, _081676A0 + adds r0, r2 + strb r1, [r0] + cmp r1, 0x40 + bne _081676AC + movs r0, 0x64 + bl gpu_tile_obj_free_by_tag + movs r0, 0x64 + bl gpu_pal_free_tag + ldr r0, [r7] + add r0, r8 + movs r1, 0xFF + strb r1, [r0] + b _08167742 + .align 2, 0 +_0816769C: .4byte 0x0203bcac +_081676A0: .4byte 0x00007b10 +_081676A4: .4byte 0x00007b12 +_081676A8: .4byte 0x00007b14 +_081676AC: + ldr r0, [r7] + add r0, r8 + strb r1, [r0] + ldr r4, _08167700 + ldr r2, [r7] + mov r0, r8 + adds r3, r2, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _08167704 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x22 + strh r1, [r0, 0x26] + ldr r3, _08167708 + adds r1, r2, r3 + subs r3, 0x4 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 5 + ldr r3, _0816770C + adds r0, r3 + str r0, [r1] + ldr r0, _08167710 + adds r2, r0 + ldrh r0, [r2] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r2] + b _08167742 + .align 2, 0 +_08167700: .4byte 0x02020630 +_08167704: .4byte sub_8168168 + 1 +_08167708: .4byte 0x00007b18 +_0816770C: .4byte 0x06010000 +_08167710: .4byte 0x00007b12 +_08167714: + lsls r1, r6, 13 + movs r0, 0xC1 + lsls r0, 2 + adds r1, r0 + adds r1, r3, r1 + ldr r2, _08167750 + adds r0, r3, r2 + ldr r2, [r0] + ldr r0, _08167754 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, _08167758 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + lsls r0, r6, 7 + adds r0, 0x4 + adds r0, r3, r0 + ldr r2, _0816775C + adds r1, r3, r2 + ldrh r1, [r1] + movs r2, 0x20 + bl gpu_pal_apply +_08167742: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08167750: .4byte 0x00007b18 +_08167754: .4byte 0x040000d4 +_08167758: .4byte 0x80000400 +_0816775C: .4byte 0x00007b12 + thumb_func_end sub_8167608 + + thumb_func_start sub_8167760 +sub_8167760: @ 8167760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x60 + add r5, sp, 0x20 + add r4, sp, 0x38 + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_81D321C + mov r0, sp + bl gpu_tile_obj_alloc_and_load_multiple + adds r0, r4, 0 + bl gpu_pal_obj_alloc_and_load_multiple + movs r4, 0 + ldr r1, _081677E8 + ldr r0, [r1] + ldr r2, _081677EC + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r5, 0 + add r2, sp, 0x50 + mov r9, r2 + add r2, sp, 0x58 + mov r10, r2 + cmp r4, r0 + bge _0816781C + adds r5, r1, 0 + ldr r7, _081677F0 + movs r0, 0x1C + adds r0, r7 + mov r8, r0 +_081677AC: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r1, 0x80 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE2 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081677FC + ldr r0, [r5] + ldr r2, _081677F4 + adds r0, r2 + adds r0, r4 + strb r3, [r0] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r1, r0, r7 + strh r4, [r1, 0x2E] + add r0, r8 + ldr r1, _081677F8 + str r1, [r0] + b _08167808 + .align 2, 0 +_081677E8: .4byte 0x0203bcac +_081677EC: .4byte 0x00008040 +_081677F0: .4byte 0x02020630 +_081677F4: .4byte 0x00007b06 +_081677F8: .4byte sub_8168180 + 1 +_081677FC: + ldr r0, [r5] + ldr r1, _08167864 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167808: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldr r2, _08167868 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r4, r0 + blt _081677AC +_0816781C: + movs r0, 0x67 + strh r0, [r6] + cmp r4, 0x5 + bhi _0816788A + ldr r5, _0816786C + ldr r7, _08167870 +_08167828: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE6 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _08167874 + ldr r0, [r5] + ldr r1, _08167864 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x3] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x3] + b _08167880 + .align 2, 0 +_08167864: .4byte 0x00007b06 +_08167868: .4byte 0x00008040 +_0816786C: .4byte 0x0203bcac +_08167870: .4byte 0x02020630 +_08167874: + ldr r0, [r5] + ldr r2, _081678E4 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167880: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _08167828 +_0816788A: + movs r0, 0x66 + strh r0, [r6] + ldr r0, _081678E8 + str r0, [r6, 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, r6, 0 + movs r1, 0xDE + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081678F4 + ldr r0, _081678EC + ldr r0, [r0] + ldr r1, _081678E4 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + ldr r0, _081678F0 + 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 _08167902 + .align 2, 0 +_081678E4: .4byte 0x00007b06 +_081678E8: .4byte sub_81681B4 + 1 +_081678EC: .4byte 0x0203bcac +_081678F0: .4byte 0x02020630 +_081678F4: + ldr r0, _08167928 + ldr r0, [r0] + ldr r2, _0816792C + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167902: + mov r0, r9 + mov r1, r10 + bl sub_81D32B0 + mov r0, r9 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + mov r0, r10 + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x60 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08167928: .4byte 0x0203bcac +_0816792C: .4byte 0x00007b06 + thumb_func_end sub_8167760 + + thumb_func_start sub_8167930 +sub_8167930: @ 8167930 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _08167950 + ldr r0, [r0] + ldr r2, _08167954 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xB + bls _08167944 + b _08167B78 +_08167944: + lsls r0, 2 + ldr r1, _08167958 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08167950: .4byte 0x0203bcac +_08167954: .4byte 0x00008048 +_08167958: .4byte _0816795C + .align 2, 0 +_0816795C: + .4byte _0816798C + .4byte _08167A04 + .4byte _08167A38 + .4byte _08167A48 + .4byte _08167A5C + .4byte _08167A74 + .4byte _08167A9C + .4byte _08167AB0 + .4byte _08167AD4 + .4byte _08167AEC + .4byte _08167B1C + .4byte _08167B38 +_0816798C: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r1, 0x88 + lsls r1, 6 + movs r0, 0x3 + movs r2, 0 + bl bg_change_y_offset + ldr r1, _081679FC + movs r0, 0 + bl lcd_io_set + movs r1, 0x91 + lsls r1, 2 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _08167A00 + movs r0, 0x52 + bl lcd_io_set + b _08167B7E + .align 2, 0 +_081679FC: .4byte 0x00007040 +_08167A00: .4byte 0x0000040b +_08167A04: + ldr r4, _08167A2C + movs r0, 0xD0 + lsls r0, 5 + bl malloc + str r0, [r4] + ldr r5, _08167A30 + movs r4, 0xA0 + lsls r4, 3 + adds r0, r4, 0 + bl malloc + str r0, [r5] + ldr r5, _08167A34 + adds r0, r4, 0 + bl malloc + str r0, [r5] + b _08167B7E + .align 2, 0 +_08167A2C: .4byte 0x0203bca4 +_08167A30: .4byte 0x0203bca0 +_08167A34: .4byte 0x0203bca8 +_08167A38: + ldr r0, _08167A40 + ldr r1, _08167A44 + b _08167AA0 + .align 2, 0 +_08167A40: .4byte 0x085dfb60 +_08167A44: .4byte 0x0203bca8 +_08167A48: + ldr r1, _08167A58 + movs r0, 0x3 + movs r2, 0xE0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _08167B7E + .align 2, 0 +_08167A58: .4byte 0x085dfa80 +_08167A5C: + ldr r0, _08167A70 + ldr r1, [r0] + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x3 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + b _08167B7E + .align 2, 0 +_08167A70: .4byte 0x0203bca8 +_08167A74: + ldr r0, _08167A8C + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08167A90 + ldr r0, [r0] + ldr r1, _08167A94 + adds r0, r1 + ldr r1, _08167A98 + strh r1, [r0] + b _08167B7E + .align 2, 0 +_08167A8C: .4byte 0x085dfa60 +_08167A90: .4byte 0x0203bcac +_08167A94: .4byte 0x00007b0e +_08167A98: .4byte 0x0000ffb0 +_08167A9C: + ldr r0, _08167AA8 + ldr r1, _08167AAC +_08167AA0: + ldr r1, [r1] + bl LZ77UnCompVram + b _08167B7E + .align 2, 0 +_08167AA8: .4byte 0x08dccf7c +_08167AAC: .4byte 0x0203bca4 +_08167AB0: + ldr r0, _08167AC8 + ldr r1, _08167ACC + ldr r1, [r1] + bl LZ77UnCompVram + ldr r0, _08167AD0 + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + b _08167B7E + .align 2, 0 +_08167AC8: .4byte 0x08dcd81c +_08167ACC: .4byte 0x0203bca0 +_08167AD0: .4byte 0x08dccf5c +_08167AD4: + ldr r0, _08167AE8 + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 5 + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0x1 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _08167B7E + .align 2, 0 +_08167AE8: .4byte 0x0203bca4 +_08167AEC: + ldr r0, _08167B14 + ldr r1, [r0] + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, _08167B18 + movs r0, 0xC + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0xD + bl gpu_copy_to_iwram_tile_map_rect + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + b _08167B7E + .align 2, 0 +_08167B14: .4byte 0x0203bca0 +_08167B18: .4byte 0x08dcda30 +_08167B1C: + ldr r0, _08167B2C + ldr r1, _08167B30 + ldr r1, [r1] + ldr r2, _08167B34 + adds r1, r2 + bl LZ77UnCompVram + b _08167B7E + .align 2, 0 +_08167B2C: .4byte 0x085dfc0c +_08167B30: .4byte 0x0203bcac +_08167B34: .4byte 0x00007304 +_08167B38: + ldr r0, _08167B68 + ldr r1, [r0] + ldr r0, _08167B6C + adds r1, r0 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + ldr r0, _08167B70 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08167B74 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl sub_81D21DC + b _08167B7E + .align 2, 0 +_08167B68: .4byte 0x0203bcac +_08167B6C: .4byte 0x00007304 +_08167B70: .4byte 0x086231e8 +_08167B74: .4byte 0x08623208 +_08167B78: + movs r0, 0 + strb r0, [r1] + b _08167B8E +_08167B7E: + ldr r0, _08167B98 + ldr r1, [r0] + ldr r2, _08167B9C + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_08167B8E: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08167B98: .4byte 0x0203bcac +_08167B9C: .4byte 0x00008048 + thumb_func_end sub_8167930 + + thumb_func_start sub_8167BA0 +sub_8167BA0: @ 8167BA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + ldr r7, _08167C60 + ldr r3, [r7] + ldr r1, _08167C64 + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, _08167C68 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167C46 + lsls r2, r4, 6 + ldr r0, _08167C6C + adds r2, r0 + adds r2, r3, r2 + movs r0, 0x1 + str r0, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r7] + ldr r1, _08167C64 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _08167C70 + adds r0, r1 + bl get_nature + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, [r7] + ldr r6, _08167C74 + adds r0, r6 + ldr r1, _08167C78 + bl gf_strcpy + ldr r1, _08167C7C + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl gf_strcpy + ldr r0, _08167C80 + str r0, [sp] + str r5, [sp, 0x4] + ldr r0, [r7] + adds r0, r6 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl box_print +_08167C46: + mov r2, r8 + cmp r2, 0 + beq _08167C84 + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + b _08167C94 + .align 2, 0 +_08167C60: .4byte 0x0203bcac +_08167C64: .4byte 0x00008041 +_08167C68: .4byte 0x00008040 +_08167C6C: .4byte 0x00007b95 +_08167C70: .4byte 0x020244ec +_08167C74: .4byte 0x0000804a +_08167C78: .4byte 0x085ebf8d +_08167C7C: .4byte 0x0861cb50 +_08167C80: .4byte 0x085dfcc9 +_08167C84: + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram +_08167C94: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8167BA0 + + thumb_func_start sub_8167CA0 +sub_8167CA0: @ 8167CA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _08167CC0 + ldr r0, _08167CB8 + ldr r0, [r0] + ldr r1, _08167CBC + adds r0, r1 + b _08167CC8 + .align 2, 0 +_08167CB8: .4byte 0x0203bcac +_08167CBC: .4byte 0x00007fb5 +_08167CC0: + ldr r0, _08167D78 + ldr r0, [r0] + ldr r2, _08167D7C + adds r0, r2 +_08167CC8: + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, _08167D78 + ldr r2, [r5] + ldr r3, _08167D80 + adds r0, r2, r3 + ldr r4, _08167D84 + adds r1, r2, r4 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + ldr r4, _08167D88 + adds r1, r4 + adds r1, r2, r1 + lsls r3, r6, 2 + adds r3, r6 + lsls r3, 2 + adds r3, r4 + adds r2, r3 + bl sub_81D1F84 + ldr r4, [r5] + ldr r1, _08167D8C + adds r0, r4, r1 + ldrb r1, [r0] + ldr r2, _08167D90 + mov r12, r2 + adds r0, r4, r2 + ldrb r0, [r0] + subs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r8, r0 + cmp r7, 0 + beq _08167D98 + ldr r3, _08167D7C + adds r0, r4, r3 + ldrb r1, [r0] + subs r2, 0x8B + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, _08167D84 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, _08167D94 + adds r0, r2 + strb r1, [r0] + ldr r1, [r5] + adds r3, 0x8D + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08167D58 + mov r4, r12 + adds r0, r1, r4 + ldrb r0, [r0] +_08167D58: + subs r2, r0, 0x1 + ldr r0, _08167D8C + adds r1, r0 + strb r2, [r1] + ldr r1, _08167D78 + ldr r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _08167D74 + ldr r1, _08167D90 + adds r0, r3, r1 + ldrb r0, [r0] +_08167D74: + subs r1, r0, 0x1 + b _08167E1E + .align 2, 0 +_08167D78: .4byte 0x0203bcac +_08167D7C: .4byte 0x00007fb4 +_08167D80: .4byte 0x00007c58 +_08167D84: .4byte 0x00007fb3 +_08167D88: .4byte 0x00007c6c +_08167D8C: .4byte 0x00008041 +_08167D90: .4byte 0x00008040 +_08167D94: .4byte 0x00007fb6 +_08167D98: + ldr r3, _08167DDC + adds r0, r4, r3 + ldrb r1, [r0] + ldr r2, _08167DE0 + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, _08167DE4 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, _08167DE8 + adds r0, r2 + strb r1, [r0] + ldr r2, [r5] + adds r3, 0x8C + adds r0, r2, r3 + ldrb r1, [r0] + adds r4, 0x8D + adds r0, r2, r4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bge _08167DEC + adds r3, r1, 0x1 + b _08167DEE + .align 2, 0 +_08167DDC: .4byte 0x00007fb5 +_08167DE0: .4byte 0x00007fb4 +_08167DE4: .4byte 0x00007fb3 +_08167DE8: .4byte 0x00007fb6 +_08167DEC: + movs r3, 0 +_08167DEE: + ldr r1, _08167E10 + adds r0, r2, r1 + strb r3, [r0] + ldr r2, _08167E14 + ldr r3, [r2] + adds r1, r3, r1 + ldrb r1, [r1] + ldr r4, _08167E18 + adds r0, r3, r4 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0 + cmp r1, r0 + bge _08167E1C + adds r1, 0x1 + b _08167E1E + .align 2, 0 +_08167E10: .4byte 0x00008041 +_08167E14: .4byte 0x0203bcac +_08167E18: .4byte 0x00008040 +_08167E1C: + movs r1, 0 +_08167E1E: + ldr r2, _08167E58 + adds r0, r3, r2 + strb r1, [r0] + adds r5, r6, 0 + ldr r0, [r5] + ldr r3, _08167E5C + adds r1, r0, r3 + ldrb r2, [r1] + ldr r4, _08167E60 + adds r1, r0, r4 + ldrb r1, [r1] + subs r1, 0x1 + eors r2, r1 + negs r1, r2 + orrs r1, r2 + lsrs r4, r1, 31 + ldr r1, _08167E64 + adds r0, r1 + bl sub_81D3520 + mov r2, r8 + cmp r2, 0 + bne _08167E70 + ldr r0, [r5] + ldr r3, _08167E68 + adds r0, r3 + ldr r1, _08167E6C + b _08167E90 + .align 2, 0 +_08167E58: .4byte 0x00007b4c +_08167E5C: .4byte 0x00008041 +_08167E60: .4byte 0x00008040 +_08167E64: .4byte 0x00007b1c +_08167E68: .4byte 0x00008044 +_08167E6C: .4byte sub_8167EA4 + 1 +_08167E70: + cmp r4, 0 + bne _08167E88 + ldr r0, [r5] + ldr r4, _08167E80 + adds r0, r4 + ldr r1, _08167E84 + b _08167E90 + .align 2, 0 +_08167E80: .4byte 0x00008044 +_08167E84: .4byte sub_8167FA4 + 1 +_08167E88: + ldr r0, [r6] + ldr r1, _08167E9C + adds r0, r1 + ldr r1, _08167EA0 +_08167E90: + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08167E9C: .4byte 0x00008044 +_08167EA0: .4byte sub_8168048 + 1 + thumb_func_end sub_8167CA0 + + thumb_func_start sub_8167EA4 +sub_8167EA4: @ 8167EA4 + push {r4-r6,lr} + ldr r4, _08167EC0 + ldr r1, [r4] + ldr r5, _08167EC4 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08167EE4 + cmp r0, 0x1 + bgt _08167EC8 + cmp r0, 0 + beq _08167ED2 + b _08167F9C + .align 2, 0 +_08167EC0: .4byte 0x0203bcac +_08167EC4: .4byte 0x00008048 +_08167EC8: + cmp r0, 0x2 + beq _08167F08 + cmp r0, 0x3 + beq _08167F48 + b _08167F9C +_08167ED2: + ldr r2, _08167EE0 + adds r0, r1, r2 + ldrb r0, [r0] + bl sub_8167608 + b _08167F2C + .align 2, 0 +_08167EE0: .4byte 0x00007fb3 +_08167EE4: + ldr r6, _08167F00 + adds r0, r1, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, _08167F04 + adds r1, r0 + b _08167F30 + .align 2, 0 +_08167F00: .4byte 0x00007fb3 +_08167F04: .4byte 0x00008048 +_08167F08: + ldr r2, _08167F38 + adds r0, r1, r2 + ldr r6, _08167F3C + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08167F9C + ldr r1, [r4] + ldr r2, _08167F40 + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, _08167F44 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_08167F2C: + ldr r1, [r4] + adds r1, r5 +_08167F30: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08167F9C + .align 2, 0 +_08167F38: .4byte 0x00007c58 +_08167F3C: .4byte 0x00007b0e +_08167F40: .4byte 0x00007b4c +_08167F44: .4byte 0x00007fb6 +_08167F48: + ldr r2, _08167F90 + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, _08167F94 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, _08167F98 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167F82 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, _08167F90 + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08167F82: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08167F9E + .align 2, 0 +_08167F90: .4byte 0x00007b1c +_08167F94: .4byte 0x00008041 +_08167F98: .4byte 0x00008040 +_08167F9C: + movs r0, 0x1 +_08167F9E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8167EA4 + + thumb_func_start sub_8167FA4 +sub_8167FA4: @ 8167FA4 + push {r4,r5,lr} + ldr r4, _08167FC0 + ldr r1, [r4] + ldr r5, _08167FC4 + adds r2, r1, r5 + ldrb r0, [r2] + cmp r0, 0x1 + beq _08167FF0 + cmp r0, 0x1 + bgt _08167FC8 + cmp r0, 0 + beq _08167FD2 + b _0816803E + .align 2, 0 +_08167FC0: .4byte 0x0203bcac +_08167FC4: .4byte 0x00008048 +_08167FC8: + cmp r0, 0x2 + beq _08168014 + cmp r0, 0x3 + beq _08168038 + b _0816803E +_08167FD2: + ldr r2, _08167FE8 + adds r0, r1, r2 + ldr r2, _08167FEC + adds r1, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + bne _0816803E + b _08168024 + .align 2, 0 +_08167FE8: .4byte 0x00007c58 +_08167FEC: .4byte 0x00007b0e +_08167FF0: + ldr r2, _0816800C + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, _08168010 + adds r1, r0 + b _08168028 + .align 2, 0 +_0816800C: .4byte 0x00007fb3 +_08168010: .4byte 0x00008048 +_08168014: + ldr r2, _08168030 + adds r0, r1, r2 + ldrb r0, [r0] + ldr r2, _08168034 + adds r1, r2 + ldrb r1, [r1] + bl sub_816753C +_08168024: + ldr r1, [r4] + adds r1, r5 +_08168028: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816803E + .align 2, 0 +_08168030: .4byte 0x00007b4c +_08168034: .4byte 0x00007fb6 +_08168038: + movs r0, 0 + strb r0, [r2] + b _08168040 +_0816803E: + movs r0, 0x1 +_08168040: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8167FA4 + + thumb_func_start sub_8168048 +sub_8168048: @ 8168048 + push {r4-r6,lr} + ldr r4, _08168064 + ldr r1, [r4] + ldr r5, _08168068 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081680A8 + cmp r0, 0x1 + bgt _0816806C + cmp r0, 0 + beq _08168076 + b _08168160 + .align 2, 0 +_08168064: .4byte 0x0203bcac +_08168068: .4byte 0x00008048 +_0816806C: + cmp r0, 0x2 + beq _081680CC + cmp r0, 0x3 + beq _0816810C + b _08168160 +_08168076: + ldr r2, _0816809C + adds r0, r1, r2 + bl sub_81D2074 + ldr r0, [r4] + ldr r6, _081680A0 + adds r0, r6 + bl sub_81D3150 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r0, [r4] + ldr r1, _081680A4 + adds r0, r1 + ldrb r0, [r0] + bl sub_8167608 + b _081680F0 + .align 2, 0 +_0816809C: .4byte 0x00007c58 +_081680A0: .4byte 0x00007b0e +_081680A4: .4byte 0x00007fb3 +_081680A8: + ldr r2, _081680C4 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r6, _081680C8 + adds r1, r6 + b _081680F4 + .align 2, 0 +_081680C4: .4byte 0x00007fb3 +_081680C8: .4byte 0x00008048 +_081680CC: + ldr r2, _081680FC + adds r0, r1, r2 + ldr r6, _08168100 + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r1, [r4] + ldr r2, _08168104 + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, _08168108 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_081680F0: + ldr r1, [r4] + adds r1, r5 +_081680F4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08168160 + .align 2, 0 +_081680FC: .4byte 0x00007c58 +_08168100: .4byte 0x00007b0e +_08168104: .4byte 0x00007b4c +_08168108: .4byte 0x00007fb6 +_0816810C: + ldr r2, _08168154 + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, _08168158 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, _0816815C + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08168146 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, _08168154 + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08168146: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08168162 + .align 2, 0 +_08168154: .4byte 0x00007b1c +_08168158: .4byte 0x00008041 +_0816815C: .4byte 0x00008040 +_08168160: + movs r0, 0x1 +_08168162: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8168048 + + thumb_func_start sub_8168168 +sub_8168168: @ 8168168 + ldr r1, _08168178 + ldr r1, [r1] + ldr r2, _0816817C + adds r1, r2 + ldrh r1, [r1] + adds r1, 0x26 + strh r1, [r0, 0x20] + bx lr + .align 2, 0 +_08168178: .4byte 0x0203bcac +_0816817C: .4byte 0x00007b0e + thumb_func_end sub_8168168 + + thumb_func_start sub_8168180 +sub_8168180: @ 8168180 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + ldr r0, _081681A0 + ldr r0, [r0] + ldr r3, _081681A4 + adds r0, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081681A8 + adds r0, r2, 0 + movs r1, 0 + bl obj_anim_image_start + b _081681B0 + .align 2, 0 +_081681A0: .4byte 0x0203bcac +_081681A4: .4byte 0x00008041 +_081681A8: + adds r0, r2, 0 + movs r1, 0x1 + bl obj_anim_image_start +_081681B0: + pop {r0} + bx r0 + thumb_func_end sub_8168180 + + thumb_func_start sub_81681B4 +sub_81681B4: @ 81681B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081681D4 + ldr r0, [r0] + ldr r2, _081681D8 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081681DC + movs r0, 0x65 + b _081681DE + .align 2, 0 +_081681D4: .4byte 0x0203bcac +_081681D8: .4byte 0x00008041 +_081681DC: + movs r0, 0x66 +_081681DE: + bl gpu_pal_tags_index_of + lsls r0, 4 + ldrb r2, [r4, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681B4 + + thumb_func_start sub_81681F4 +sub_81681F4: @ 81681F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _08168230 + adds r0, r1 + movs r1, 0x30 + bl pokemon_getattr + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08168234 + ldr r0, [r0] + ldr r3, _08168238 + adds r1, r0, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r3, 0x3 + adds r0, r3 + adds r4, r0, r1 + cmp r2, 0xFF + beq _0816823C + adds r0, r2, 0 + movs r1, 0x1D + bl __udivsi3 + b _0816823E + .align 2, 0 +_08168230: .4byte 0x020244ec +_08168234: .4byte 0x0203bcac +_08168238: .4byte 0x00007fb3 +_0816823C: + movs r0, 0x9 +_0816823E: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681F4 + + thumb_func_start sub_8168248 +sub_8168248: @ 8168248 + push {lr} + sub sp, 0x10 + ldr r0, _08168284 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, _08168288 + str r0, [sp] + ldr r1, _0816828C + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + ldr r1, _08168290 + ands r0, r1 + adds r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_decompress_and_load + add r0, sp, 0x8 + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08168284: .4byte 0x085dfdb8 +_08168288: .4byte 0x08dccbb8 +_0816828C: .4byte 0xffff0000 +_08168290: .4byte 0x0000ffff + thumb_func_end sub_8168248 + + thumb_func_start sub_8168294 +sub_8168294: @ 8168294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _08168318 + ldr r0, [r0] + ldr r1, _0816831C + adds r7, r0, r1 + ldr r0, _08168320 + mov r10, r0 + movs r6, 0 + movs r1, 0x40 + mov r9, r1 + movs r0, 0x60 + negs r0, r0 + mov r8, r0 +_081682B6: + mov r5, r9 + muls r5, r6 + mov r0, r8 + adds r1, r0, r5 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x11 + lsls r2, r0, 16 + mov r0, r10 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081682FE + ldr r0, _08168324 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + movs r1, 0x8 + strh r1, [r4, 0x2E] + movs r0, 0x20 + orrs r5, r0 + strh r5, [r4, 0x30] + strh r6, [r4, 0x32] + lsls r1, r6, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + lsls r0, r6, 2 + adds r0, r7 + str r4, [r0] +_081682FE: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _081682B6 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08168318: .4byte 0x0203bcac +_0816831C: .4byte 0x00007b44 +_08168320: .4byte 0x085dfda0 +_08168324: .4byte 0x02020630 + thumb_func_end sub_8168294 + + thumb_func_start sub_8168328 +sub_8168328: @ 8168328 + push {r4,r5,lr} + ldr r4, _08168340 + ldr r0, [r4] + ldr r5, _08168344 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _08168348 + cmp r0, 0x1 + beq _08168360 + b _0816836C + .align 2, 0 +_08168340: .4byte 0x0203bcac +_08168344: .4byte 0x00008048 +_08168348: + bl sub_8168248 + ldr r1, [r4] + ldr r0, _0816835C + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _0816836E + .align 2, 0 +_0816835C: .4byte 0x00008048 +_08168360: + bl sub_8168294 + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] +_0816836C: + movs r0, 0 +_0816836E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8168328 + + thumb_func_start sub_8168374 +sub_8168374: @ 8168374 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + ldrh r1, [r2, 0x2E] + adds r3, r0, r1 + strh r3, [r2, 0x20] + lsls r0, 16 + asrs r4, r0, 16 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r4, r1 + bgt _08168398 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bge _081683A0 + cmp r4, r1 + blt _081683A8 +_08168398: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bgt _081683A8 +_081683A0: + ldrh r0, [r2, 0x30] + strh r0, [r2, 0x20] + ldr r0, _081683B0 + str r0, [r2, 0x1C] +_081683A8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081683B0: .4byte nullsub_12 + 1 + thumb_func_end sub_8168374 + + thumb_func_start nullsub_117 +nullsub_117: @ 81683B4 + bx lr + thumb_func_end nullsub_117 + + thumb_func_start bx_goto_buffer_A_ch0_tbl3 +bx_goto_buffer_A_ch0_tbl3: @ 81683B8 + ldr r1, _081683E4 + ldr r0, _081683E8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _081683EC + str r1, [r0] + ldr r2, _081683F0 + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x95 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x96 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x97 + strb r1, [r0] + bx lr + .align 2, 0 +_081683E4: .4byte 0x03005d60 +_081683E8: .4byte 0x02024064 +_081683EC: .4byte bx_exec_buffer_A_ch0_tbl2 + 1 +_081683F0: .4byte 0x0202449c + thumb_func_end bx_goto_buffer_A_ch0_tbl3 + + thumb_func_start bx_exec_buffer_A_ch0_tbl2 +bx_exec_buffer_A_ch0_tbl2: @ 81683F4 + push {lr} + ldr r2, _08168428 + ldr r1, _0816842C + ldr r0, _08168430 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08168440 + ldr r0, _08168434 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0816843C + ldr r0, _08168438 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08168440 + .align 2, 0 +_08168428: .4byte 0x02024068 +_0816842C: .4byte 0x0832a328 +_08168430: .4byte 0x02024064 +_08168434: .4byte 0x02023064 +_08168438: .4byte 0x085dfdc0 +_0816843C: + bl dp01_tbl5_exec_completed +_08168440: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl2 + + thumb_func_start sub_8168444 +sub_8168444: @ 8168444 + push {r4,r5,lr} + ldr r1, _08168460 + ldr r0, [r1] + adds r0, 0x94 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x5 + bls _08168456 + b _08168564 +_08168456: + lsls r0, 2 + ldr r1, _08168464 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08168460: .4byte 0x0202449c +_08168464: .4byte _08168468 + .align 2, 0 +_08168468: + .4byte _08168480 + .4byte _08168492 + .4byte _081684B0 + .4byte _081684CE + .4byte _08168508 + .4byte _08168540 +_08168480: + ldr r0, [r4] + adds r0, 0x96 + movs r1, 0x40 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x94 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08168492: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0 + b _081684E4 +_081684B0: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0 + b _081684E4 +_081684CE: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08168564 + movs r0, 0x1 + movs r1, 0x9 +_081684E4: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl5_exec_completed + ldr r1, [r4] + adds r1, 0x94 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x95 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x96 + movs r1, 0x40 + strb r1, [r0] + b _08168564 +_08168508: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_8059CF8 + movs r0, 0x1 + movs r1, 0 + bl sub_8059CB4 + ldr r0, [r4] + adds r0, 0x96 + movs r1, 0x40 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x94 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08168564 +_08168540: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl5_exec_completed +_08168564: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8168444 + + thumb_func_start sub_816856C +sub_816856C: @ 816856C + push {lr} + ldr r2, _08168594 + ldr r1, _08168598 + ldr r0, _0816859C + 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, _081685A0 + cmp r1, r0 + bne _08168590 + bl dp01_tbl5_exec_completed +_08168590: + pop {r0} + bx r0 + .align 2, 0 +_08168594: .4byte 0x02020630 +_08168598: .4byte 0x020241e4 +_0816859C: .4byte 0x02024064 +_081685A0: .4byte nullsub_12 + 1 + thumb_func_end sub_816856C + + thumb_func_start sub_81685A4 +sub_81685A4: @ 81685A4 + push {lr} + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _081685B6 + bl dp01_tbl5_exec_completed +_081685B6: + pop {r0} + bx r0 + thumb_func_end sub_81685A4 + + thumb_func_start bx_wait_t5 +bx_wait_t5: @ 81685BC + push {lr} + ldr r0, _081685D0 + ldrb r0, [r0] + cmp r0, 0 + bne _081685CA + bl dp01_tbl5_exec_completed +_081685CA: + pop {r0} + bx r0 + .align 2, 0 +_081685D0: .4byte 0x020244b9 + thumb_func_end bx_wait_t5 + + thumb_func_start sub_81685D4 +sub_81685D4: @ 81685D4 + push {lr} + ldr r0, _08168600 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081685FC + ldr r1, _08168604 + ldr r0, _08168608 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816860C + str r1, [r0] + bl nullsub_35 + bl Window_FreeMemory + bl sub_81ADD70 +_081685FC: + pop {r0} + bx r0 + .align 2, 0 +_08168600: .4byte 0x02037fd4 +_08168604: .4byte 0x03005d60 +_08168608: .4byte 0x02024064 +_0816860C: .4byte sub_8168610 + 1 + thumb_func_end sub_81685D4 + + thumb_func_start sub_8168610 +sub_8168610: @ 8168610 + push {lr} + ldr r0, _0816863C + ldr r1, [r0, 0x4] + ldr r0, _08168640 + cmp r1, r0 + bne _08168636 + ldr r0, _08168644 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08168636 + ldr r0, _08168648 + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl5_exec_completed +_08168636: + pop {r0} + bx r0 + .align 2, 0 +_0816863C: .4byte 0x030022c0 +_08168640: .4byte sub_8038420 + 1 +_08168644: .4byte 0x02037fd4 +_08168648: .4byte 0x0203ce7c + thumb_func_end sub_8168610 + + thumb_func_start sub_816864C +sub_816864C: @ 816864C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _081687E8 + ldr r0, [r4] + ldr r5, _081687EC + 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 r7, 0x88 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _08168684 + ldr r0, _081687F0 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081687F4 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08168684: + ldr r1, [r4] + ldrb r0, [r5] + 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, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _081686B6 + ldr r0, _081687F0 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081687F4 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081686B6: + ldr r0, [r4] + ldrb r2, [r5] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + movs r4, 0x8 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _081686D2 + b _081687DC +_081686D2: + adds r1, r2, 0 + eors r1, r6 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _081687DC + ldr r0, _081687F8 + mov r8, r0 + ldr r7, _081687FC + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r4, r8 + adds r4, 0x1C + adds r0, r4 + ldr r3, [r0] + ldr r0, _08168800 + cmp r3, r0 + bne _081687DC + ldr r0, _08168804 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + cmp r0, r3 + bne _081687DC + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0816877A + ldr r0, _08168808 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0816877A + ldrb r0, [r5] + eors r0, r6 + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + bl obj_delete_and_free_tiles + ldr r4, _0816880C + ldrb r0, [r5] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _081687F0 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _081687F4 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r5] + eors r0, r6 + bl sub_8076918 + ldrb r0, [r5] + eors r0, r6 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_0816877A: + ldr r1, _081687FC + ldr r4, _081687EC + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081687F8 + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r5, _0816880C + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _081687F0 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _081687F4 + 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, _081687E8 + 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, _08168810 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08168814 + str r1, [r0] +_081687DC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081687E8: .4byte 0x020244d0 +_081687EC: .4byte 0x02024064 +_081687F0: .4byte 0x0202406e +_081687F4: .4byte 0x020244ec +_081687F8: .4byte 0x02020630 +_081687FC: .4byte 0x03005d7c +_08168800: .4byte nullsub_12 + 1 +_08168804: .4byte 0x020241e4 +_08168808: .4byte 0x02022fec +_0816880C: .4byte 0x03005d70 +_08168810: .4byte 0x03005d60 +_08168814: .4byte sub_8168818 + 1 + thumb_func_end sub_816864C + + thumb_func_start sub_8168818 +sub_8168818: @ 8168818 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + ldr r2, _08168910 + ldr r0, _08168914 + ldr r1, _08168918 + mov r8, r1 + ldrb r3, [r1] + 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, _0816891C + cmp r1, r0 + bne _08168842 + movs r4, 0x1 +_08168842: + cmp r4, 0 + beq _08168904 + ldr r7, _08168920 + ldr r0, [r7] + ldr r4, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r4 + ldrb r1, [r2, 0x1] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08168904 + movs r6, 0x2 + adds r1, r6, 0 + eors r1, r3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08168904 + ldrb r1, [r2] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r7] + mov r1, r8 + 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 r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, [r7] + mov r1, r8 + ldrb r0, [r1] + 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] + ldr r2, [r7] + mov r1, r8 + ldrb r0, [r1] + 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, _08168924 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldr r0, _08168928 + movs r1, 0xA + bl AddTask + ldr r2, _0816892C + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _08168930 + adds r0, r2 + bl sub_805E990 + bl dp01_tbl5_exec_completed +_08168904: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08168910: .4byte 0x02020630 +_08168914: .4byte 0x03005d70 +_08168918: .4byte 0x02024064 +_0816891C: .4byte nullsub_12 + 1 +_08168920: .4byte 0x020244d0 +_08168924: .4byte 0x000027f9 +_08168928: .4byte c3_0802FDF4 + 1 +_0816892C: .4byte 0x0202406e +_08168930: .4byte 0x020244ec + thumb_func_end sub_8168818 + + thumb_func_start sub_8168934 +sub_8168934: @ 8168934 + push {r4-r6,lr} + ldr r5, _08168974 + ldrb r0, [r5] + ldr r6, _08168978 + 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 _0816897C + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08168996 + .align 2, 0 +_08168974: .4byte 0x02024064 +_08168978: .4byte 0x03005d70 +_0816897C: + ldr r2, _0816899C + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _081689A0 + adds r0, r2 + bl sub_805E990 + bl dp01_tbl5_exec_completed +_08168996: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816899C: .4byte 0x0202406e +_081689A0: .4byte 0x020244ec + thumb_func_end sub_8168934 + + thumb_func_start bx_blink_t5 +bx_blink_t5: @ 81689A4 + push {r4,lr} + ldr r1, _081689E0 + ldr r0, _081689E4 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _081689E8 + 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 _081689F0 + 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, _081689EC + strb r3, [r0] + bl dp01_tbl5_exec_completed + b _08168A1A + .align 2, 0 +_081689E0: .4byte 0x020241e4 +_081689E4: .4byte 0x02024064 +_081689E8: .4byte 0x02020630 +_081689EC: .4byte 0x020244b9 +_081689F0: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08168A14 + 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] +_08168A14: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08168A1A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t5 + + thumb_func_start sub_8168A20 +sub_8168A20: @ 8168A20 + push {r4-r6,lr} + ldr r0, _08168A7C + ldr r0, [r0] + ldr r6, _08168A80 + 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 _08168A74 + ldr r5, _08168A84 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08168A88 + 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 obj_delete_and_free_tiles + ldr r1, _08168A8C + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl5_exec_completed +_08168A74: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08168A7C: .4byte 0x020244d0 +_08168A80: .4byte 0x02024064 +_08168A84: .4byte 0x020241e4 +_08168A88: .4byte 0x02020630 +_08168A8C: .4byte 0x03005d70 + thumb_func_end sub_8168A20 + + thumb_func_start sub_8168A90 +sub_8168A90: @ 8168A90 + push {lr} + ldr r2, _08168AB8 + ldr r1, _08168ABC + ldr r0, _08168AC0 + 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, _08168AC4 + cmp r1, r0 + bne _08168AB4 + bl dp01_tbl5_exec_completed +_08168AB4: + pop {r0} + bx r0 + .align 2, 0 +_08168AB8: .4byte 0x02020630 +_08168ABC: .4byte 0x020241e4 +_08168AC0: .4byte 0x02024064 +_08168AC4: .4byte nullsub_12 + 1 + thumb_func_end sub_8168A90 + + thumb_func_start sub_8168AC8 +sub_8168AC8: @ 8168AC8 + push {lr} + ldr r0, _08168AF0 + ldr r2, [r0] + ldr r0, _08168AF4 + 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 _08168AEA + bl dp01_tbl5_exec_completed +_08168AEA: + pop {r0} + bx r0 + .align 2, 0 +_08168AF0: .4byte 0x020244d0 +_08168AF4: .4byte 0x02024064 + thumb_func_end sub_8168AC8 + + thumb_func_start dp01_tbl5_exec_completed +dp01_tbl5_exec_completed: @ 8168AF8 + push {r4,lr} + sub sp, 0x4 + ldr r1, _08168B38 + ldr r4, _08168B3C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08168B40 + str r1, [r0] + ldr r0, _08168B44 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08168B4C + 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, _08168B48 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _08168B5E + .align 2, 0 +_08168B38: .4byte 0x03005d60 +_08168B3C: .4byte 0x02024064 +_08168B40: .4byte bx_exec_buffer_A_ch0_tbl2 + 1 +_08168B44: .4byte 0x02022fec +_08168B48: .4byte 0x02023064 +_08168B4C: + ldr r2, _08168B68 + ldr r1, _08168B6C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_08168B5E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08168B68: .4byte 0x02024068 +_08168B6C: .4byte 0x0832a328 + thumb_func_end dp01_tbl5_exec_completed + + thumb_func_start sub_8168B70 +sub_8168B70: @ 8168B70 + push {lr} + ldr r0, _08168B98 + ldr r2, [r0] + ldr r0, _08168B9C + 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 _08168B92 + bl dp01_tbl5_exec_completed +_08168B92: + pop {r0} + bx r0 + .align 2, 0 +_08168B98: .4byte 0x020244d0 +_08168B9C: .4byte 0x02024064 + thumb_func_end sub_8168B70 + + thumb_func_start dp01t_00_5_getattr +dp01t_00_5_getattr: @ 8168BA0 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, _08168BCC + ldr r0, _08168BD0 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08168BD8 + ldr r0, _08168BD4 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8168C14 + adds r6, r0, 0 + b _08168BFA + .align 2, 0 +_08168BCC: .4byte 0x02023064 +_08168BD0: .4byte 0x02024064 +_08168BD4: .4byte 0x0202406e +_08168BD8: + ldrb r4, [r1] + movs r5, 0 +_08168BDC: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08168BF2 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_8168C14 + adds r6, r0 +_08168BF2: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08168BDC +_08168BFA: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl5_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_5_getattr + + thumb_func_start sub_8168C14 +sub_8168C14: @ 8168C14 + 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, _08168C48 + ldr r3, _08168C4C + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _08168C3E + bl _081693AA +_08168C3E: + lsls r0, 2 + ldr r1, _08168C50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08168C48: .4byte 0x02023064 +_08168C4C: .4byte 0x02024064 +_08168C50: .4byte _08168C54 + .align 2, 0 +_08168C54: + .4byte _08168D44 + .4byte _08168F68 + .4byte _08168F78 + .4byte _08168F88 + .4byte _08168FF0 + .4byte _08168FF0 + .4byte _08168FF0 + .4byte _08168FF0 + .4byte _0816900C + .4byte _08169048 + .4byte _08169048 + .4byte _08169048 + .4byte _08169048 + .4byte _081693AA + .4byte _081693AA + .4byte _081693AA + .4byte _081693AA + .4byte _08169064 + .4byte _08169074 + .4byte _081690A4 + .4byte _081690B4 + .4byte _081690C4 + .4byte _081690D4 + .4byte _081690E4 + .4byte _081690F4 + .4byte _08169104 + .4byte _08169114 + .4byte _08169124 + .4byte _08169134 + .4byte _08169144 + .4byte _08169154 + .4byte _08169164 + .4byte _081691B4 + .4byte _081691C4 + .4byte _081691D4 + .4byte _081691E4 + .4byte _081691F4 + .4byte _08169204 + .4byte _08169214 + .4byte _08169224 + .4byte _08169234 + .4byte _08169268 + .4byte _08169278 + .4byte _08169288 + .4byte _08169298 + .4byte _081692A8 + .4byte _081692B8 + .4byte _081692C8 + .4byte _081692D8 + .4byte _081692F8 + .4byte _08169308 + .4byte _08169318 + .4byte _08169328 + .4byte _08169338 + .4byte _08169348 + .4byte _08169358 + .4byte _08169368 + .4byte _08169378 + .4byte _08169388 + .4byte _08169398 +_08168D44: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08168F58 + 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 +_08168D90: + 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 _08168D90 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08168F58 + 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, _08168F5C + 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, _08168F60 + 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, _08168F64 + 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 strcpy_limit_10_chars + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_08168F48: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _08168F48 + b _081693AA + .align 2, 0 +_08168F58: .4byte 0x020244ec +_08168F5C: .4byte 0xfffffc1f +_08168F60: .4byte 0xfff07fff +_08168F64: .4byte 0xfffffe0f +_08168F68: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08168F74 + adds r0, r1 + movs r1, 0xB + b _081692E2 + .align 2, 0 +_08168F74: .4byte 0x020244ec +_08168F78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08168F84 + adds r0, r1 + movs r1, 0xC + b _081692E2 + .align 2, 0 +_08168F84: .4byte 0x020244ec +_08168F88: + 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, _08168FEC + adds r4, r1, r0 + mov r8, r9 +_08168F9E: + 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 _08168F9E + movs r0, 0x64 + muls r0, r5 + ldr r1, _08168FEC + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_08168FDC: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _08168FDC + b _081693AA + .align 2, 0 +_08168FEC: .4byte 0x020244ec +_08168FF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169008 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _081692E2 + .align 2, 0 +_08169008: .4byte 0x020244ec +_0816900C: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _08169044 + mov r8, r2 +_08169018: + 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 _08169018 + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169044 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _081693AA + .align 2, 0 +_08169044: .4byte 0x020244ec +_08169048: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169060 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _081693A2 + .align 2, 0 +_08169060: .4byte 0x020244ec +_08169064: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169070 + adds r0, r1 + movs r1, 0x1 + b _0816907E + .align 2, 0 +_08169070: .4byte 0x020244ec +_08169074: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081690A0 + adds r0, r1 + movs r1, 0x19 +_0816907E: + 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 _081693AA + .align 2, 0 +_081690A0: .4byte 0x020244ec +_081690A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081690B0 + adds r0, r1 + movs r1, 0x1A + b _081693A2 + .align 2, 0 +_081690B0: .4byte 0x020244ec +_081690B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081690C0 + adds r0, r1 + movs r1, 0x1B + b _081693A2 + .align 2, 0 +_081690C0: .4byte 0x020244ec +_081690C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081690D0 + adds r0, r1 + movs r1, 0x1C + b _081693A2 + .align 2, 0 +_081690D0: .4byte 0x020244ec +_081690D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081690E0 + adds r0, r1 + movs r1, 0x1D + b _081693A2 + .align 2, 0 +_081690E0: .4byte 0x020244ec +_081690E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081690F0 + adds r0, r1 + movs r1, 0x1E + b _081693A2 + .align 2, 0 +_081690F0: .4byte 0x020244ec +_081690F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169100 + adds r0, r1 + movs r1, 0x1F + b _081693A2 + .align 2, 0 +_08169100: .4byte 0x020244ec +_08169104: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169110 + adds r0, r1 + movs r1, 0x20 + b _081693A2 + .align 2, 0 +_08169110: .4byte 0x020244ec +_08169114: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169120 + adds r0, r1 + movs r1, 0x22 + b _081693A2 + .align 2, 0 +_08169120: .4byte 0x020244ec +_08169124: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169130 + adds r0, r1 + movs r1, 0x23 + b _081693A2 + .align 2, 0 +_08169130: .4byte 0x020244ec +_08169134: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169140 + adds r0, r1 + movs r1, 0x24 + b _081693A2 + .align 2, 0 +_08169140: .4byte 0x020244ec +_08169144: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169150 + adds r0, r1 + movs r1, 0x25 + b _081693A2 + .align 2, 0 +_08169150: .4byte 0x020244ec +_08169154: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169160 + adds r0, r1 + movs r1, 0x26 + b _081693A2 + .align 2, 0 +_08169160: .4byte 0x020244ec +_08169164: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081691B0 + 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 _081693AA + .align 2, 0 +_081691B0: .4byte 0x020244ec +_081691B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081691C0 + adds r0, r1 + movs r1, 0x27 + b _081693A2 + .align 2, 0 +_081691C0: .4byte 0x020244ec +_081691C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081691D0 + adds r0, r1 + movs r1, 0x28 + b _081693A2 + .align 2, 0 +_081691D0: .4byte 0x020244ec +_081691D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081691E0 + adds r0, r1 + movs r1, 0x29 + b _081693A2 + .align 2, 0 +_081691E0: .4byte 0x020244ec +_081691E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081691F0 + adds r0, r1 + movs r1, 0x2A + b _081693A2 + .align 2, 0 +_081691F0: .4byte 0x020244ec +_081691F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169200 + adds r0, r1 + movs r1, 0x2B + b _081693A2 + .align 2, 0 +_08169200: .4byte 0x020244ec +_08169204: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169210 + adds r0, r1 + movs r1, 0x2C + b _081693A2 + .align 2, 0 +_08169210: .4byte 0x020244ec +_08169214: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169220 + adds r0, r1 + movs r1, 0 + b _0816923E + .align 2, 0 +_08169220: .4byte 0x020244ec +_08169224: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169230 + adds r0, r1 + movs r1, 0x9 + b _081692E2 + .align 2, 0 +_08169230: .4byte 0x020244ec +_08169234: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169264 + adds r0, r1 + movs r1, 0x37 +_0816923E: + 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 _081693AA + .align 2, 0 +_08169264: .4byte 0x020244ec +_08169268: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169274 + adds r0, r1 + movs r1, 0x38 + b _081693A2 + .align 2, 0 +_08169274: .4byte 0x020244ec +_08169278: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169284 + adds r0, r1 + movs r1, 0x39 + b _081692E2 + .align 2, 0 +_08169284: .4byte 0x020244ec +_08169288: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169294 + adds r0, r1 + movs r1, 0x3A + b _081692E2 + .align 2, 0 +_08169294: .4byte 0x020244ec +_08169298: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081692A4 + adds r0, r1 + movs r1, 0x3B + b _081692E2 + .align 2, 0 +_081692A4: .4byte 0x020244ec +_081692A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081692B4 + adds r0, r1 + movs r1, 0x3C + b _081692E2 + .align 2, 0 +_081692B4: .4byte 0x020244ec +_081692B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081692C4 + adds r0, r1 + movs r1, 0x3D + b _081692E2 + .align 2, 0 +_081692C4: .4byte 0x020244ec +_081692C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081692D4 + adds r0, r1 + movs r1, 0x3E + b _081692E2 + .align 2, 0 +_081692D4: .4byte 0x020244ec +_081692D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081692F4 + adds r0, r1 + movs r1, 0x3F +_081692E2: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _081693AA + .align 2, 0 +_081692F4: .4byte 0x020244ec +_081692F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169304 + adds r0, r1 + movs r1, 0x16 + b _081693A2 + .align 2, 0 +_08169304: .4byte 0x020244ec +_08169308: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169314 + adds r0, r1 + movs r1, 0x17 + b _081693A2 + .align 2, 0 +_08169314: .4byte 0x020244ec +_08169318: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169324 + adds r0, r1 + movs r1, 0x18 + b _081693A2 + .align 2, 0 +_08169324: .4byte 0x020244ec +_08169328: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169334 + adds r0, r1 + movs r1, 0x21 + b _081693A2 + .align 2, 0 +_08169334: .4byte 0x020244ec +_08169338: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169344 + adds r0, r1 + movs r1, 0x2F + b _081693A2 + .align 2, 0 +_08169344: .4byte 0x020244ec +_08169348: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169354 + adds r0, r1 + movs r1, 0x30 + b _081693A2 + .align 2, 0 +_08169354: .4byte 0x020244ec +_08169358: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169364 + adds r0, r1 + movs r1, 0x32 + b _081693A2 + .align 2, 0 +_08169364: .4byte 0x020244ec +_08169368: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169374 + adds r0, r1 + movs r1, 0x33 + b _081693A2 + .align 2, 0 +_08169374: .4byte 0x020244ec +_08169378: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169384 + adds r0, r1 + movs r1, 0x34 + b _081693A2 + .align 2, 0 +_08169384: .4byte 0x020244ec +_08169388: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169394 + adds r0, r1 + movs r1, 0x35 + b _081693A2 + .align 2, 0 +_08169394: .4byte 0x020244ec +_08169398: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081693BC + adds r0, r1 + movs r1, 0x36 +_081693A2: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_081693AA: + 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 + .align 2, 0 +_081693BC: .4byte 0x020244ec + thumb_func_end sub_8168C14 + + thumb_func_start sub_81693C0 +sub_81693C0: @ 81693C0 + push {lr} + bl sub_805A614 + pop {r0} + bx r0 + thumb_func_end sub_81693C0 + + thumb_func_start sub_81693CC +sub_81693CC: @ 81693CC + push {r4,r5,lr} + ldr r1, _081693F0 + ldr r0, _081693F4 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _081693FC + ldr r0, _081693F8 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8169424 + b _0816941A + .align 2, 0 +_081693F0: .4byte 0x02023064 +_081693F4: .4byte 0x02024064 +_081693F8: .4byte 0x0202406e +_081693FC: + ldrb r4, [r1] + movs r5, 0 +_08169400: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0816940E + adds r0, r5, 0 + bl sub_8169424 +_0816940E: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08169400 +_0816941A: + bl dp01_tbl5_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81693CC + + thumb_func_start sub_8169424 +sub_8169424: @ 8169424 + 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, _0816945C + ldrb r0, [r0] + lsls r0, 9 + ldr r2, _08169460 + 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 _08169450 + bl _08169DEA +_08169450: + lsls r0, 2 + ldr r1, _08169464 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816945C: .4byte 0x02024064 +_08169460: .4byte 0x02023067 +_08169464: .4byte _08169468 + .align 2, 0 +_08169468: + .4byte _08169558 + .4byte _081696F0 + .4byte _08169710 + .4byte _08169730 + .4byte _08169788 + .4byte _08169788 + .4byte _08169788 + .4byte _08169788 + .4byte _081697B0 + .4byte _08169814 + .4byte _08169814 + .4byte _08169814 + .4byte _08169814 + .4byte _08169DEA + .4byte _08169DEA + .4byte _08169DEA + .4byte _08169DEA + .4byte _08169844 + .4byte _08169864 + .4byte _08169884 + .4byte _081698A4 + .4byte _081698C4 + .4byte _081698E4 + .4byte _08169904 + .4byte _08169924 + .4byte _08169944 + .4byte _08169964 + .4byte _08169984 + .4byte _081699A4 + .4byte _081699C4 + .4byte _081699E4 + .4byte _08169A04 + .4byte _08169A74 + .4byte _08169A94 + .4byte _08169AB4 + .4byte _08169AD4 + .4byte _08169AF4 + .4byte _08169B14 + .4byte _08169B34 + .4byte _08169B54 + .4byte _08169B74 + .4byte _08169B94 + .4byte _08169BB4 + .4byte _08169BD4 + .4byte _08169BF4 + .4byte _08169C14 + .4byte _08169C34 + .4byte _08169C54 + .4byte _08169C74 + .4byte _08169C94 + .4byte _08169CB4 + .4byte _08169CD4 + .4byte _08169CF4 + .4byte _08169D14 + .4byte _08169D34 + .4byte _08169D54 + .4byte _08169D74 + .4byte _08169D94 + .4byte _08169DB4 + .4byte _08169DD4 +_08169558: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081696EC + 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 +_081695BE: + 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 _081695BE + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081696EC + 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 _08169DEA + .align 2, 0 +_081696EC: .4byte 0x020244ec +_081696F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169708 + adds r0, r1 + ldr r1, _0816970C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169708: .4byte 0x020244ec +_0816970C: .4byte 0x02024064 +_08169710: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169728 + adds r0, r1 + ldr r1, _0816972C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169728: .4byte 0x020244ec +_0816972C: .4byte 0x02024064 +_08169730: + 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, _08169784 + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0816974A: + 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 _0816974A + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169784 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169784: .4byte 0x020244ec +_08169788: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081697A4 + adds r0, r1 + ldr r3, _081697A8 + ldr r1, _081697AC + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0816982C + .align 2, 0 +_081697A4: .4byte 0x020244ec +_081697A8: .4byte 0x02023064 +_081697AC: .4byte 0x02024064 +_081697B0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0816980C + adds r4, r0 + ldr r5, _08169810 + 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 _08169DEA + .align 2, 0 +_0816980C: .4byte 0x020244ec +_08169810: .4byte 0x02024064 +_08169814: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169838 + adds r0, r1 + ldr r3, _0816983C + ldr r1, _08169840 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0816982C: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169838: .4byte 0x020244ec +_0816983C: .4byte 0x02023064 +_08169840: .4byte 0x02024064 +_08169844: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816985C + adds r0, r1 + ldr r1, _08169860 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816985C: .4byte 0x020244ec +_08169860: .4byte 0x02024064 +_08169864: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816987C + adds r0, r1 + ldr r1, _08169880 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816987C: .4byte 0x020244ec +_08169880: .4byte 0x02024064 +_08169884: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816989C + adds r0, r1 + ldr r1, _081698A0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816989C: .4byte 0x020244ec +_081698A0: .4byte 0x02024064 +_081698A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081698BC + adds r0, r1 + ldr r1, _081698C0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_081698BC: .4byte 0x020244ec +_081698C0: .4byte 0x02024064 +_081698C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081698DC + adds r0, r1 + ldr r1, _081698E0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_081698DC: .4byte 0x020244ec +_081698E0: .4byte 0x02024064 +_081698E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081698FC + adds r0, r1 + ldr r1, _08169900 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_081698FC: .4byte 0x020244ec +_08169900: .4byte 0x02024064 +_08169904: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816991C + adds r0, r1 + ldr r1, _08169920 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816991C: .4byte 0x020244ec +_08169920: .4byte 0x02024064 +_08169924: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816993C + adds r0, r1 + ldr r1, _08169940 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816993C: .4byte 0x020244ec +_08169940: .4byte 0x02024064 +_08169944: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816995C + adds r0, r1 + ldr r1, _08169960 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816995C: .4byte 0x020244ec +_08169960: .4byte 0x02024064 +_08169964: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816997C + adds r0, r1 + ldr r1, _08169980 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816997C: .4byte 0x020244ec +_08169980: .4byte 0x02024064 +_08169984: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0816999C + adds r0, r1 + ldr r1, _081699A0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_0816999C: .4byte 0x020244ec +_081699A0: .4byte 0x02024064 +_081699A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081699BC + adds r0, r1 + ldr r1, _081699C0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_081699BC: .4byte 0x020244ec +_081699C0: .4byte 0x02024064 +_081699C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081699DC + adds r0, r1 + ldr r1, _081699E0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_081699DC: .4byte 0x020244ec +_081699E0: .4byte 0x02024064 +_081699E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081699FC + adds r0, r1 + ldr r1, _08169A00 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_081699FC: .4byte 0x020244ec +_08169A00: .4byte 0x02024064 +_08169A04: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08169A6C + adds r4, r0 + ldr r5, _08169A70 + 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 _08169B24 + .align 2, 0 +_08169A6C: .4byte 0x020244ec +_08169A70: .4byte 0x02024064 +_08169A74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169A8C + adds r0, r1 + ldr r1, _08169A90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169A8C: .4byte 0x020244ec +_08169A90: .4byte 0x02024064 +_08169A94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169AAC + adds r0, r1 + ldr r1, _08169AB0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169AAC: .4byte 0x020244ec +_08169AB0: .4byte 0x02024064 +_08169AB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169ACC + adds r0, r1 + ldr r1, _08169AD0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169ACC: .4byte 0x020244ec +_08169AD0: .4byte 0x02024064 +_08169AD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169AEC + adds r0, r1 + ldr r1, _08169AF0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169AEC: .4byte 0x020244ec +_08169AF0: .4byte 0x02024064 +_08169AF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169B0C + adds r0, r1 + ldr r1, _08169B10 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169B0C: .4byte 0x020244ec +_08169B10: .4byte 0x02024064 +_08169B14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169B2C + adds r0, r1 + ldr r1, _08169B30 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_08169B24: + movs r1, 0x2C + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169B2C: .4byte 0x020244ec +_08169B30: .4byte 0x02024064 +_08169B34: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169B4C + adds r0, r1 + ldr r1, _08169B50 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169B4C: .4byte 0x020244ec +_08169B50: .4byte 0x02024064 +_08169B54: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169B6C + adds r0, r1 + ldr r1, _08169B70 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169B6C: .4byte 0x020244ec +_08169B70: .4byte 0x02024064 +_08169B74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169B8C + adds r0, r1 + ldr r1, _08169B90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169B8C: .4byte 0x020244ec +_08169B90: .4byte 0x02024064 +_08169B94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169BAC + adds r0, r1 + ldr r1, _08169BB0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169BAC: .4byte 0x020244ec +_08169BB0: .4byte 0x02024064 +_08169BB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169BCC + adds r0, r1 + ldr r1, _08169BD0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169BCC: .4byte 0x020244ec +_08169BD0: .4byte 0x02024064 +_08169BD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169BEC + adds r0, r1 + ldr r1, _08169BF0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169BEC: .4byte 0x020244ec +_08169BF0: .4byte 0x02024064 +_08169BF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169C0C + adds r0, r1 + ldr r1, _08169C10 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169C0C: .4byte 0x020244ec +_08169C10: .4byte 0x02024064 +_08169C14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169C2C + adds r0, r1 + ldr r1, _08169C30 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169C2C: .4byte 0x020244ec +_08169C30: .4byte 0x02024064 +_08169C34: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169C4C + adds r0, r1 + ldr r1, _08169C50 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169C4C: .4byte 0x020244ec +_08169C50: .4byte 0x02024064 +_08169C54: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169C6C + adds r0, r1 + ldr r1, _08169C70 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169C6C: .4byte 0x020244ec +_08169C70: .4byte 0x02024064 +_08169C74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169C8C + adds r0, r1 + ldr r1, _08169C90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169C8C: .4byte 0x020244ec +_08169C90: .4byte 0x02024064 +_08169C94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169CAC + adds r0, r1 + ldr r1, _08169CB0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169CAC: .4byte 0x020244ec +_08169CB0: .4byte 0x02024064 +_08169CB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169CCC + adds r0, r1 + ldr r1, _08169CD0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169CCC: .4byte 0x020244ec +_08169CD0: .4byte 0x02024064 +_08169CD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169CEC + adds r0, r1 + ldr r1, _08169CF0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169CEC: .4byte 0x020244ec +_08169CF0: .4byte 0x02024064 +_08169CF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169D0C + adds r0, r1 + ldr r1, _08169D10 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169D0C: .4byte 0x020244ec +_08169D10: .4byte 0x02024064 +_08169D14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169D2C + adds r0, r1 + ldr r1, _08169D30 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169D2C: .4byte 0x020244ec +_08169D30: .4byte 0x02024064 +_08169D34: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169D4C + adds r0, r1 + ldr r1, _08169D50 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169D4C: .4byte 0x020244ec +_08169D50: .4byte 0x02024064 +_08169D54: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169D6C + adds r0, r1 + ldr r1, _08169D70 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169D6C: .4byte 0x020244ec +_08169D70: .4byte 0x02024064 +_08169D74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169D8C + adds r0, r1 + ldr r1, _08169D90 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169D8C: .4byte 0x020244ec +_08169D90: .4byte 0x02024064 +_08169D94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169DAC + adds r0, r1 + ldr r1, _08169DB0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169DAC: .4byte 0x020244ec +_08169DB0: .4byte 0x02024064 +_08169DB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169DCC + adds r0, r1 + ldr r1, _08169DD0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _08169DEA + .align 2, 0 +_08169DCC: .4byte 0x020244ec +_08169DD0: .4byte 0x02024064 +_08169DD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08169E14 + adds r0, r1 + ldr r1, _08169E18 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_08169DEA: + ldr r2, _08169E1C + ldr r0, _08169E18 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _08169E14 + 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 + .align 2, 0 +_08169E14: .4byte 0x020244ec +_08169E18: .4byte 0x02024064 +_08169E1C: .4byte 0x0202406e + thumb_func_end sub_8169424 + + thumb_func_start sub_8169E20 +sub_8169E20: @ 8169E20 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8169E20 + + thumb_func_start sub_8169E2C +sub_8169E2C: @ 8169E2C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8169E2C + + thumb_func_start sub_8169E38 +sub_8169E38: @ 8169E38 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8169E38 + + thumb_func_start sub_8169E44 +sub_8169E44: @ 8169E44 + push {r4-r6,lr} + ldr r0, _08169E70 + ldr r6, _08169E74 + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _08169E80 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl move_anim_start_t4 + ldr r0, _08169E78 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _08169E7C + str r0, [r1] + b _08169EB6 + .align 2, 0 +_08169E70: .4byte 0x02023064 +_08169E74: .4byte 0x02024064 +_08169E78: .4byte 0x03005d60 +_08169E7C: .4byte sub_8168A20 + 1 +_08169E80: + ldr r5, _08169EBC + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08169EC0 + 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 obj_delete_and_free_tiles + ldr r1, _08169EC4 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl5_exec_completed +_08169EB6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08169EBC: .4byte 0x020241e4 +_08169EC0: .4byte 0x02020630 +_08169EC4: .4byte 0x03005d70 + thumb_func_end sub_8169E44 + + thumb_func_start sub_8169EC8 +sub_8169EC8: @ 8169EC8 + push {r4-r6,lr} + ldr r4, _08169F70 + ldrb r1, [r4] + movs r0, 0x6 + bl sub_805DF84 + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x6 + bl template_build_for_pokemon_or_trainer + ldr r0, _08169F74 + ldr r1, _08169F78 + ldrb r1, [r1, 0x18] + 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 obj_add_from_template_forward_search + ldr r6, _08169F7C + ldrb r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r5, _08169F80 + ldrb r3, [r4] + adds r0, r3, r6 + 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 r0, [r4] + adds r0, r6 + 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, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08169F84 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, 0x1C + adds r0, r5 + ldr r1, _08169F88 + str r1, [r0] + ldr r1, _08169F8C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08169F90 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08169F70: .4byte 0x02024064 +_08169F74: .4byte 0x0202499c +_08169F78: .4byte 0x08305d2c +_08169F7C: .4byte 0x020241e4 +_08169F80: .4byte 0x02020630 +_08169F84: .4byte 0x0000fffe +_08169F88: .4byte sub_805D7AC + 1 +_08169F8C: .4byte 0x03005d60 +_08169F90: .4byte sub_816856C + 1 + thumb_func_end sub_8169EC8 + + thumb_func_start dp01t_07_6_ +dp01t_07_6_: @ 8169F94 + push {r4-r6,lr} + ldr r4, _0816A03C + ldrb r1, [r4] + movs r0, 0x6 + bl sub_805DF84 + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x6 + bl template_build_for_pokemon_or_trainer + ldr r0, _0816A040 + ldr r1, _0816A044 + ldrb r1, [r1, 0x18] + 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 obj_add_from_template_forward_search + ldr r6, _0816A048 + ldrb r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r5, _0816A04C + ldrb r3, [r4] + adds r0, r3, r6 + 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 r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0816A050 + strh r1, [r0, 0x24] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, 0x1C + adds r0, r5 + ldr r1, _0816A054 + str r1, [r0] + ldr r1, _0816A058 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A05C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816A03C: .4byte 0x02024064 +_0816A040: .4byte 0x0202499c +_0816A044: .4byte 0x08305d2c +_0816A048: .4byte 0x020241e4 +_0816A04C: .4byte 0x02020630 +_0816A050: .4byte 0x0000ffa0 +_0816A054: .4byte sub_805D7AC + 1 +_0816A058: .4byte 0x03005d60 +_0816A05C: .4byte sub_8168A90 + 1 + thumb_func_end dp01t_07_6_ + + thumb_func_start sub_816A060 +sub_816A060: @ 816A060 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A060 + + thumb_func_start sub_816A06C +sub_816A06C: @ 816A06C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A06C + + thumb_func_start sub_816A078 +sub_816A078: @ 816A078 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A078 + + thumb_func_start sub_816A084 +sub_816A084: @ 816A084 + push {r4,r5,lr} + ldr r0, _0816A0C4 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, _0816A0C8 + movs r0, 0x1 + strb r0, [r1] + ldr r5, _0816A0CC + 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, 0x4 + bl move_anim_start_t4 + ldr r1, _0816A0D0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A0D4 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816A0C4: .4byte 0x020244d0 +_0816A0C8: .4byte 0x020244b9 +_0816A0CC: .4byte 0x02024064 +_0816A0D0: .4byte 0x03005d60 +_0816A0D4: .4byte bx_wait_t5 + 1 + thumb_func_end sub_816A084 + + thumb_func_start sub_816A0D8 +sub_816A0D8: @ 816A0D8 + push {r4,r5,lr} + ldr r1, _0816A120 + ldr r5, _0816A124 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, _0816A128 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, _0816A12C + 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, 0x4 + bl move_anim_start_t4 + ldr r1, _0816A130 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A134 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816A120: .4byte 0x02023064 +_0816A124: .4byte 0x02024064 +_0816A128: .4byte 0x020244d0 +_0816A12C: .4byte 0x020244b9 +_0816A130: .4byte 0x03005d60 +_0816A134: .4byte bx_wait_t5 + 1 + thumb_func_end sub_816A0D8 + + thumb_func_start sub_816A138 +sub_816A138: @ 816A138 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A138 + + thumb_func_start sub_816A144 +sub_816A144: @ 816A144 + push {r4-r6,lr} + ldr r0, _0816A218 + mov r12, r0 + ldr r6, _0816A21C + 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, _0816A220 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, _0816A224 + 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, _0816A228 + 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, _0816A22C + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, _0816A230 + 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, _0816A234 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, _0816A238 + 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 _0816A23C + bl dp01_tbl5_exec_completed + b _0816A25A + .align 2, 0 +_0816A218: .4byte 0x02023064 +_0816A21C: .4byte 0x02024064 +_0816A220: .4byte 0x02038432 +_0816A224: .4byte 0x02038408 +_0816A228: .4byte 0x02038404 +_0816A22C: .4byte 0x0203841a +_0816A230: .4byte 0x0203841c +_0816A234: .4byte 0x02038400 +_0816A238: .4byte 0x020244bc +_0816A23C: + ldr r0, _0816A260 + 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, _0816A264 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A268 + str r1, [r0] +_0816A25A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816A260: .4byte 0x020244d0 +_0816A264: .4byte 0x03005d60 +_0816A268: .4byte bx_move_anim_5 + 1 + thumb_func_end sub_816A144 + + thumb_func_start bx_move_anim_5 +bx_move_anim_5: @ 816A26C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, _0816A2B0 + ldr r6, _0816A2B4 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r9, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r2, 0x2 + mov r8, r2 + add r1, r8 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + ldr r7, _0816A2B8 + 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 _0816A2F6 + cmp r2, 0x1 + bgt _0816A2BC + cmp r2, 0 + beq _0816A2C6 + b _0816A3AC + .align 2, 0 +_0816A2B0: .4byte 0x02023064 +_0816A2B4: .4byte 0x02024064 +_0816A2B8: .4byte 0x020244d0 +_0816A2BC: + cmp r2, 0x2 + beq _0816A320 + cmp r2, 0x3 + beq _0816A370 + b _0816A3AC +_0816A2C6: + ldr r1, [r5] + lsls r0, r3, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0816A2E2 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0816A2E2: + 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 _0816A3AC +_0816A2F6: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0816A3AC + 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 _0816A3AC +_0816A320: + ldr r0, _0816A368 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0816A36C + ldrb r0, [r0] + cmp r0, 0 + bne _0816A3AC + 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 _0816A354 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0816A354: + 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, 0x3 + strb r1, [r0, 0x4] + b _0816A3AC + .align 2, 0 +_0816A368: .4byte 0x020383f8 +_0816A36C: .4byte 0x020383fd +_0816A370: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0816A3AC + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r9 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r8 + 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_tbl5_exec_completed +_0816A3AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end bx_move_anim_5 + + thumb_func_start sub_816A3B8 +sub_816A3B8: @ 816A3B8 + push {r4,lr} + ldr r0, _0816A3F0 + movs r1, 0 + strh r1, [r0] + ldr r0, _0816A3F4 + strh r1, [r0] + ldr r4, _0816A3F8 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, _0816A3FC + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, _0816A400 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0816A404 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A408 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816A3F0: .4byte 0x02022e14 +_0816A3F4: .4byte 0x02022e16 +_0816A3F8: .4byte 0x02024064 +_0816A3FC: .4byte 0x02023066 +_0816A400: .4byte 0x02022e2c +_0816A404: .4byte 0x03005d60 +_0816A408: .4byte sub_81685A4 + 1 + thumb_func_end sub_816A3B8 + + thumb_func_start dp01t_11_5_message_for_player_only +dp01t_11_5_message_for_player_only: @ 816A40C + push {lr} + ldr r0, _0816A424 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0816A428 + bl sub_816A3B8 + b _0816A42C + .align 2, 0 +_0816A424: .4byte 0x02024064 +_0816A428: + bl dp01_tbl5_exec_completed +_0816A42C: + pop {r0} + bx r0 + thumb_func_end dp01t_11_5_message_for_player_only + + thumb_func_start sub_816A430 +sub_816A430: @ 816A430 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816A456 + ldr r0, _0816A45C + strh r1, [r0] + ldr r1, _0816A460 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _0816A464 + ldr r0, _0816A468 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A46C + str r1, [r0] +_0816A456: + pop {r0} + bx r0 + .align 2, 0 +_0816A45C: .4byte 0x02022e14 +_0816A460: .4byte 0x02022e16 +_0816A464: .4byte 0x03005d60 +_0816A468: .4byte 0x02024064 +_0816A46C: .4byte sub_8168444 + 1 + thumb_func_end sub_816A430 + + thumb_func_start dp01t_12_1_battle_menu +dp01t_12_1_battle_menu: @ 816A470 + push {r4,lr} + ldr r1, _0816A4BC + ldr r0, _0816A4C0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A4C4 + str r1, [r0] + ldr r0, _0816A4C8 + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_0816A48A: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0816A48A + ldr r1, _0816A4CC + ldr r0, _0816A4C0 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, _0816A4D0 + bl sub_814E6F0 + ldr r0, _0816A4D4 + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816A4BC: .4byte 0x03005d60 +_0816A4C0: .4byte 0x02024064 +_0816A4C4: .4byte sub_816A430 + 1 +_0816A4C8: .4byte 0x085cca3a +_0816A4CC: .4byte 0x020244ac +_0816A4D0: .4byte 0x085cca15 +_0816A4D4: .4byte 0x02022e2c + thumb_func_end dp01t_12_1_battle_menu + + thumb_func_start sub_816A4D8 +sub_816A4D8: @ 816A4D8 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A4D8 + + thumb_func_start sub_816A4E4 +sub_816A4E4: @ 816A4E4 + push {r4,lr} + ldr r4, _0816A500 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x95 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0816A522 + cmp r0, 0x1 + bgt _0816A504 + cmp r0, 0 + beq _0816A50A + b _0816A574 + .align 2, 0 +_0816A500: .4byte 0x0202449c +_0816A504: + cmp r0, 0x2 + beq _0816A550 + b _0816A574 +_0816A50A: + bl sub_805C210 + ldr r1, [r4] + adds r1, 0x95 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x97 + movs r1, 0x50 + strb r1, [r0] + b _0816A574 +_0816A522: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816A574 + ldr r0, _0816A548 + strh r1, [r0] + ldr r1, _0816A54C + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [r4] + adds r1, 0x95 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816A574 + .align 2, 0 +_0816A548: .4byte 0x02022e14 +_0816A54C: .4byte 0x02022e16 +_0816A550: + adds r1, 0x97 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0816A574 + movs r0, 0x5 + bl audio_play + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl5_exec_completed +_0816A574: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816A4E4 + + thumb_func_start sub_816A57C +sub_816A57C: @ 816A57C + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _0816A5AC + ldr r2, _0816A5B0 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A5B4 + str r1, [r0] + ldr r1, _0816A5B8 + ldrb r0, [r2] + strb r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0816A5AC: .4byte 0x03005d60 +_0816A5B0: .4byte 0x02024064 +_0816A5B4: .4byte sub_81685D4 + 1 +_0816A5B8: .4byte 0x020244b8 + thumb_func_end sub_816A57C + + thumb_func_start sub_816A5BC +sub_816A5BC: @ 816A5BC + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A5BC + + thumb_func_start sub_816A5C8 +sub_816A5C8: @ 816A5C8 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A5C8 + + thumb_func_start sub_816A5D4 +sub_816A5D4: @ 816A5D4 + 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, _0816A64C + ldr r0, _0816A650 + 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, _0816A654 + cmp r7, r0 + beq _0816A664 + ldr r6, _0816A658 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0816A65C + 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, _0816A660 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0816A69E + .align 2, 0 +_0816A64C: .4byte 0x02023064 +_0816A650: .4byte 0x02024064 +_0816A654: .4byte 0x00007fff +_0816A658: .4byte 0x0202406e +_0816A65C: .4byte 0x020244ec +_0816A660: .4byte 0x03005d70 +_0816A664: + ldr r1, _0816A6BC + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0816A6C0 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, _0816A6C4 + adds r1, r0, r4 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C + mov r1, r9 + ldrb r0, [r1] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0 + bl heathbar_draw_hp +_0816A69E: + ldr r1, _0816A6C8 + ldr r0, _0816A6CC + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A6D0 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816A6BC: .4byte 0x0202406e +_0816A6C0: .4byte 0x020244ec +_0816A6C4: .4byte 0x03005d70 +_0816A6C8: .4byte 0x03005d60 +_0816A6CC: .4byte 0x02024064 +_0816A6D0: .4byte sub_8168934 + 1 + thumb_func_end sub_816A5D4 + + thumb_func_start sub_816A6D4 +sub_816A6D4: @ 816A6D4 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6D4 + + thumb_func_start sub_816A6E0 +sub_816A6E0: @ 816A6E0 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6E0 + + thumb_func_start sub_816A6EC +sub_816A6EC: @ 816A6EC + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6EC + + thumb_func_start sub_816A6F8 +sub_816A6F8: @ 816A6F8 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6F8 + + thumb_func_start sub_816A704 +sub_816A704: @ 816A704 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A704 + + thumb_func_start sub_816A710 +sub_816A710: @ 816A710 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A710 + + thumb_func_start sub_816A71C +sub_816A71C: @ 816A71C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A71C + + thumb_func_start sub_816A728 +sub_816A728: @ 816A728 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A728 + + thumb_func_start sub_816A734 +sub_816A734: @ 816A734 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A734 + + thumb_func_start sub_816A740 +sub_816A740: @ 816A740 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A740 + + thumb_func_start sub_816A74C +sub_816A74C: @ 816A74C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A74C + + thumb_func_start sub_816A758 +sub_816A758: @ 816A758 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A758 + + thumb_func_start sub_816A764 +sub_816A764: @ 816A764 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A764 + + thumb_func_start sub_816A770 +sub_816A770: @ 816A770 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A770 + + thumb_func_start sub_816A77C +sub_816A77C: @ 816A77C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A77C + + thumb_func_start sub_816A788 +sub_816A788: @ 816A788 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A788 + + thumb_func_start sub_816A794 +sub_816A794: @ 816A794 + push {r4,lr} + ldr r3, _0816A7BC + ldr r2, _0816A7C0 + ldr r4, _0816A7C4 + 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 _0816A7C8 + bl dp01_tbl5_exec_completed + b _0816A7F2 + .align 2, 0 +_0816A7BC: .4byte 0x02020630 +_0816A7C0: .4byte 0x020241e4 +_0816A7C4: .4byte 0x02024064 +_0816A7C8: + ldr r1, _0816A7F8 + 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, _0816A7FC + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816A800 + str r1, [r0] +_0816A7F2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816A7F8: .4byte 0x020244b9 +_0816A7FC: .4byte 0x03005d60 +_0816A800: .4byte bx_blink_t5 + 1 + thumb_func_end sub_816A794 + + thumb_func_start sub_816A804 +sub_816A804: @ 816A804 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A804 + + thumb_func_start sub_816A810 +sub_816A810: @ 816A810 + push {lr} + ldr r2, _0816A838 + ldr r0, _0816A83C + 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 audio_play + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0816A838: .4byte 0x02023064 +_0816A83C: .4byte 0x02024064 + thumb_func_end sub_816A810 + + thumb_func_start sub_816A840 +sub_816A840: @ 816A840 + push {r4,r5,lr} + ldr r4, _0816A874 + ldr r5, _0816A878 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0816A87C + 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 _0816A890 + .align 2, 0 +_0816A874: .4byte 0x02023064 +_0816A878: .4byte 0x02024064 +_0816A87C: + 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 +_0816A890: + bl dp01_tbl5_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816A840 + + thumb_func_start sub_816A89C +sub_816A89C: @ 816A89C + push {lr} + ldr r1, _0816A8CC + ldr r0, _0816A8D0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0816A8D4 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl cry_related + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0816A8CC: .4byte 0x0202406e +_0816A8D0: .4byte 0x02024064 +_0816A8D4: .4byte 0x020244ec + thumb_func_end sub_816A89C + + thumb_func_start dp01t_2E_5_battle_intro +dp01t_2E_5_battle_intro: @ 816A8D8 + push {lr} + ldr r1, _0816A900 + ldr r0, _0816A904 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _0816A908 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_0816A900: .4byte 0x02023064 +_0816A904: .4byte 0x02024064 +_0816A908: .4byte 0x020243fc + thumb_func_end dp01t_2E_5_battle_intro + + thumb_func_start sub_816A90C +sub_816A90C: @ 816A90C + push {r4-r7,lr} + ldr r6, _0816AA44 + ldr r7, _0816AA48 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0816AA4C + 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, _0816AA50 + 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, _0816AA54 + 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, _0816AA58 + 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 obj_anim_image_start + ldr r0, _0816AA5C + bl gpu_pal_alloc_new + adds r4, r0, 0 + lsls r4, 24 + ldr r0, _0816AA60 + ldr r0, [r0, 0x30] + 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, _0816AA64 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0816AA68 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r7] + strh r0, [r1, 0x8] + ldr r3, _0816AA6C + 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 _0816AA24 + ldr r0, _0816AA70 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _0816AA74 + str r1, [r0] +_0816AA24: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, _0816AA78 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816AA7C + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816AA44: .4byte 0x020241e4 +_0816AA48: .4byte 0x02024064 +_0816AA4C: .4byte 0x02020630 +_0816AA50: .4byte 0x0000ffd8 +_0816AA54: .4byte sub_80A6EEC + 1 +_0816AA58: .4byte sub_805CC00 + 1 +_0816AA5C: .4byte 0x0000d6f8 +_0816AA60: .4byte 0x08305d8c +_0816AA64: .4byte sub_816AC04 + 1 +_0816AA68: .4byte 0x03005e00 +_0816AA6C: .4byte 0x020244d0 +_0816AA70: .4byte 0x020244b4 +_0816AA74: .4byte sub_8073C30 + 1 +_0816AA78: .4byte 0x03005d60 +_0816AA7C: .4byte nullsub_21 + 1 + thumb_func_end sub_816A90C + + thumb_func_start sub_816AA80 +sub_816AA80: @ 816AA80 + 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 + ldr r0, _0816ABD8 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2] + ldr r0, _0816ABDC + lsls r2, r6, 1 + adds r2, r0 + ldr r0, _0816ABE0 + 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, _0816ABE4 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0816ABE8 + bl object_new_hidden_with_callback + ldr r1, _0816ABEC + 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, _0816ABF0 + 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 obj_add_from_template_forward_search + ldr r4, _0816ABF4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _0816ABF8 + 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, _0816ABFC + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _0816AC00 + 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 + .align 2, 0 +_0816ABD8: .4byte 0x020244d0 +_0816ABDC: .4byte 0x0202406e +_0816ABE0: .4byte 0x02023064 +_0816ABE4: .4byte 0x020244ec +_0816ABE8: .4byte sub_805D714 + 1 +_0816ABEC: .4byte 0x03005d7c +_0816ABF0: .4byte 0x0202499c +_0816ABF4: .4byte 0x020241e4 +_0816ABF8: .4byte 0x02020630 +_0816ABFC: .4byte 0x020244e4 +_0816AC00: .4byte nullsub_12 + 1 + thumb_func_end sub_816AA80 + + thumb_func_start sub_816AC04 +sub_816AC04: @ 816AC04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0816AC24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x1E + bgt _0816AC28 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0816AC5E + .align 2, 0 +_0816AC24: .4byte 0x03005e00 +_0816AC28: + ldr r4, _0816AC64 + ldrb r5, [r4] + ldrh r0, [r1, 0x8] + strb r0, [r4] + ldr r0, _0816AC68 + ldrb r1, [r4] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _0816AC6C + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r4] + bl sub_816AA80 + ldr r1, _0816AC70 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0816AC74 + str r1, [r0] + strb r5, [r4] + adds r0, r6, 0 + bl remove_task +_0816AC5E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816AC64: .4byte 0x02024064 +_0816AC68: .4byte 0x02023064 +_0816AC6C: .4byte 0x0202406e +_0816AC70: .4byte 0x03005d60 +_0816AC74: .4byte sub_816864C + 1 + thumb_func_end sub_816AC04 + + thumb_func_start sub_816AC78 +sub_816AC78: @ 816AC78 + push {r4,r5,lr} + ldr r1, _0816ACA0 + ldr r0, _0816ACA4 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0816ACA8 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0816ACA8 + bl dp01_tbl5_exec_completed + b _0816ACE6 + .align 2, 0 +_0816ACA0: .4byte 0x02023064 +_0816ACA4: .4byte 0x02024064 +_0816ACA8: + ldr r0, _0816ACEC + ldr r0, [r0] + ldr r5, _0816ACF0 + 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 r4, r0, 9 + ldr r3, _0816ACF4 + adds r1, r4, r3 + subs r2, r3, 0x3 + adds r2, r4, r2 + ldrb r2, [r2] + subs r3, 0x2 + adds r4, r3 + ldrb r3, [r4] + bl sub_80735DC + ldr r2, _0816ACF8 + ldrb r1, [r5] + adds r1, r2 + strb r0, [r1] + bl dp01_tbl5_exec_completed +_0816ACE6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816ACEC: .4byte 0x020244d0 +_0816ACF0: .4byte 0x02024064 +_0816ACF4: .4byte 0x02023068 +_0816ACF8: .4byte 0x020244b4 + thumb_func_end sub_816AC78 + + thumb_func_start sub_816ACFC +sub_816ACFC: @ 816ACFC + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816ACFC + + thumb_func_start sub_816AD08 +sub_816AD08: @ 816AD08 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD08 + + thumb_func_start sub_816AD14 +sub_816AD14: @ 816AD14 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD14 + + thumb_func_start sub_816AD20 +sub_816AD20: @ 816AD20 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _0816AD58 + ldr r6, _0816AD5C + 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 _0816AD60 + bl dp01_tbl5_exec_completed + b _0816AD6C + .align 2, 0 +_0816AD58: .4byte 0x02023064 +_0816AD5C: .4byte 0x02024064 +_0816AD60: + ldr r0, _0816AD74 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _0816AD78 + str r0, [r1] +_0816AD6C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816AD74: .4byte 0x03005d60 +_0816AD78: .4byte sub_8168AC8 + 1 + thumb_func_end sub_816AD20 + + thumb_func_start sub_816AD7C +sub_816AD7C: @ 816AD7C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD7C + + thumb_func_start sub_816AD88 +sub_816AD88: @ 816AD88 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD88 + + thumb_func_start sub_816AD94 +sub_816AD94: @ 816AD94 + push {r4,lr} + ldr r2, _0816ADD8 + ldr r1, _0816ADDC + ldr r4, _0816ADE0 + 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_tbl5_exec_completed + ldr r0, _0816ADE4 + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _0816ADD0 + ldr r0, _0816ADE8 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _0816ADEC + str r0, [r1] +_0816ADD0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816ADD8: .4byte 0x0202433a +_0816ADDC: .4byte 0x02023064 +_0816ADE0: .4byte 0x02024064 +_0816ADE4: .4byte 0x02022fec +_0816ADE8: .4byte 0x03005d60 +_0816ADEC: .4byte sub_80587B0 + 1 + thumb_func_end sub_816AD94 + + thumb_func_start nullsub_118 +nullsub_118: @ 816ADF0 + bx lr + thumb_func_end nullsub_118 + + thumb_func_start sub_816ADF4 +sub_816ADF4: @ 816ADF4 + push {r4-r6,lr} + movs r4, 0 + ldr r0, _0816AE50 + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + movs r1, 0x32 + bl sub_80D6C7C + ldr r1, _0816AE54 + ldrh r0, [r1] + cmp r0, 0 + beq _0816AE48 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0816AE48 + adds r5, r1, 0 + adds r6, r5, 0x2 +_0816AE1A: + lsls r1, r4, 2 + adds r0, r1, r5 + ldrh r0, [r0] + adds r1, r6 + ldrh r1, [r1] + bl sub_80D6D70 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816AE48 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, r4, 2 + adds r0, r1, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _0816AE48 + adds r0, r1, r6 + ldrh r0, [r0] + cmp r0, 0 + bne _0816AE1A +_0816AE48: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816AE50: .4byte 0x03005d8c +_0816AE54: .4byte 0x085dfefc + thumb_func_end sub_816ADF4 + + thumb_func_start sub_816AE58 +sub_816AE58: @ 816AE58 + push {lr} + ldr r1, _0816AE80 + ldr r0, _0816AE84 + str r0, [r1] + ldr r1, _0816AE88 + movs r0, 0x4 + strb r0, [r1] + ldr r0, _0816AE8C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0816AE90 + ldr r2, _0816AE94 + bl sub_81978EC + pop {r0} + bx r0 + .align 2, 0 +_0816AE80: .4byte 0x0203bcb0 +_0816AE84: .4byte 0x085dfed4 +_0816AE88: .4byte 0x0203bcb4 +_0816AE8C: .4byte nullsub_4 + 1 +_0816AE90: .4byte 0x085e8d80 +_0816AE94: .4byte sub_816AED8 + 1 + thumb_func_end sub_816AE58 + + thumb_func_start sub_816AE98 +sub_816AE98: @ 816AE98 + push {lr} + ldr r1, _0816AEC0 + ldr r0, _0816AEC4 + str r0, [r1] + ldr r1, _0816AEC8 + movs r0, 0x3 + strb r0, [r1] + ldr r0, _0816AECC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0816AED0 + ldr r2, _0816AED4 + bl sub_81978EC + pop {r0} + bx r0 + .align 2, 0 +_0816AEC0: .4byte 0x0203bcb0 +_0816AEC4: .4byte 0x085dfed8 +_0816AEC8: .4byte 0x0203bcb4 +_0816AECC: .4byte nullsub_4 + 1 +_0816AED0: .4byte 0x085e8d80 +_0816AED4: .4byte sub_816AED8 + 1 + thumb_func_end sub_816AE98 + + thumb_func_start sub_816AED8 +sub_816AED8: @ 816AED8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0816AF00 + adds r6, r0, r1 + ldr r0, _0816AF04 + ldrb r1, [r0] + mov r8, r0 + cmp r1, 0x3 + bne _0816AF0C + ldr r0, _0816AF08 + ldr r1, [r0, 0x4] + ldr r0, [r0] + b _0816AF12 + .align 2, 0 +_0816AF00: .4byte 0x03005e08 +_0816AF04: .4byte 0x0203bcb4 +_0816AF08: .4byte 0x085dff24 +_0816AF0C: + ldr r0, _0816AF80 + ldr r1, [r0, 0xC] + ldr r0, [r0, 0x8] +_0816AF12: + str r0, [sp] + str r1, [sp, 0x4] + ldr r5, _0816AF84 + ldr r4, _0816AF88 + ldr r1, [r4] + mov r0, r8 + ldrb r2, [r0] + adds r0, r5, 0 + bl sub_81DB3D8 + lsls r0, 24 + ldr r2, _0816AF8C + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl Window_AddFromTemplate + strh r0, [r6, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r6, 0x8] + mov r2, r8 + ldrb r1, [r2] + ldr r3, [r4] + adds r2, r5, 0 + bl sub_81995E4 + ldrb r0, [r6, 0x8] + mov r2, r8 + ldrb r1, [r2] + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816AF90 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816AF94 + str r1, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816AF80: .4byte 0x085dff24 +_0816AF84: .4byte 0x085dfeb4 +_0816AF88: .4byte 0x0203bcb0 +_0816AF8C: .4byte 0x00ffffff +_0816AF90: .4byte 0x03005e00 +_0816AF94: .4byte sub_816AF98 + 1 + thumb_func_end sub_816AED8 + + thumb_func_start sub_816AF98 +sub_816AF98: @ 816AF98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0816AFB8 + adds r4, r0, r1 + ldr r0, _0816AFBC + ldrb r0, [r0] + cmp r0, 0x3 + bls _0816AFC0 + bl ProcessMenuInput + b _0816AFC4 + .align 2, 0 +_0816AFB8: .4byte 0x03005e08 +_0816AFBC: .4byte 0x0203bcb4 +_0816AFC0: + bl ProcessMenuInputNoWrapAround +_0816AFC4: + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r5, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _0816B04C + adds r0, 0x1 + cmp r5, r0 + bne _0816B014 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x8] + bl Window_FillTileMap + ldrb r0, [r4, 0x8] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816B00C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816B010 + str r1, [r0] + b _0816B04C + .align 2, 0 +_0816B00C: .4byte 0x03005e00 +_0816B010: .4byte sub_816B148 + 1 +_0816B014: + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x8] + bl Window_FillTileMap + ldrb r0, [r4, 0x8] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _0816B054 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r2, _0816B058 + ldr r0, _0816B05C + ldr r0, [r0] + adds r0, r5 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] +_0816B04C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816B054: .4byte 0x03005e00 +_0816B058: .4byte 0x085dfeb4 +_0816B05C: .4byte 0x0203bcb0 + thumb_func_end sub_816AF98 + + thumb_func_start sub_816B060 +sub_816B060: @ 816B060 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0816B074 + ldr r2, _0816B078 + bl sub_81978EC + pop {r0} + bx r0 + .align 2, 0 +_0816B074: .4byte 0x085e8d80 +_0816B078: .4byte sub_816AED8 + 1 + thumb_func_end sub_816B060 + + thumb_func_start task_pc_itemstorage +task_pc_itemstorage: @ 816B07C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_816B190 + ldr r1, _0816B0A0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816B0A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B0A0: .4byte 0x03005e00 +_0816B0A4: .4byte sub_816B248 + 1 + thumb_func_end task_pc_itemstorage + + thumb_func_start sub_816B0A8 +sub_816B0A8: @ 816B0A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl sub_816B510 + ldr r5, _0816B0CC + movs r1, 0 + strb r0, [r5, 0x5] + lsls r0, 24 + cmp r0, 0 + bne _0816B0D8 + ldr r1, _0816B0D0 + ldr r2, _0816B0D4 + adds r0, r4, 0 + bl sub_81978EC + b _0816B12A + .align 2, 0 +_0816B0CC: .4byte 0x0203bcb8 +_0816B0D0: .4byte 0x085eac4b +_0816B0D4: .4byte sub_816B060 + 1 +_0816B0D8: + strh r1, [r5] + strh r1, [r5, 0x2] + movs r0, 0xFF + strb r0, [r5, 0x9] + bl sub_816B54C + adds r0, r4, 0 + bl sub_816B4C0 + ldrb r0, [r5, 0x5] + bl sub_81D1C44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B120 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_816B5F8 + ldr r0, _0816B118 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816B11C + str r0, [r1] + b _0816B12A + .align 2, 0 +_0816B118: .4byte 0x03005e00 +_0816B11C: .4byte sub_816B674 + 1 +_0816B120: + ldr r1, _0816B130 + ldr r2, _0816B134 + adds r0, r6, 0 + bl sub_81978EC +_0816B12A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816B130: .4byte 0x085eac4b +_0816B134: .4byte sub_816B060 + 1 + thumb_func_end sub_816B0A8 + + thumb_func_start sub_816B138 +sub_816B138: @ 816B138 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8126B2C + pop {r0} + bx r0 + thumb_func_end sub_816B138 + + thumb_func_start sub_816B148 +sub_816B148: @ 816B148 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816B168 + ldrb r0, [r0] + cmp r0, 0x4 + bne _0816B180 + ldr r0, _0816B16C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0816B174 + ldr r0, _0816B170 + bl script_env_1_execute_new_script + b _0816B184 + .align 2, 0 +_0816B168: .4byte 0x0203bcb4 +_0816B16C: .4byte 0x03005d90 +_0816B170: .4byte 0x081f863f +_0816B174: + ldr r0, _0816B17C + bl script_env_1_execute_new_script + b _0816B184 + .align 2, 0 +_0816B17C: .4byte 0x081f958f +_0816B180: + bl script_env_2_enable_and_set_ctx_running +_0816B184: + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B148 + + thumb_func_start sub_816B190 +sub_816B190: @ 816B190 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0816B208 + adds r4, r0 + ldr r0, _0816B20C + ldr r1, [r0, 0x14] + ldr r0, [r0, 0x10] + str r0, [sp] + str r1, [sp, 0x4] + ldr r6, _0816B210 + adds r0, r6, 0 + movs r1, 0x4 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _0816B214 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl Window_AddFromTemplate + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4, 0x8] + movs r1, 0x4 + adds r2, r6, 0 + bl PrintMenuTable + ldrb r0, [r4, 0x8] + movs r1, 0x4 + adds r2, r5, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _0816B218 + lsls r5, 2 + adds r5, r0 + ldr r0, [r5] + bl sub_816B21C + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816B208: .4byte 0x03005e08 +_0816B20C: .4byte 0x085dff24 +_0816B210: .4byte 0x085dfedc +_0816B214: .4byte 0x00ffffff +_0816B218: .4byte 0x085dfea4 + thumb_func_end sub_816B190 + + thumb_func_start sub_816B21C +sub_816B21C: @ 816B21C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + 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 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B21C + + thumb_func_start sub_816B248 +sub_816B248: @ 816B248 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r5, r0, 24 + bl ProcessMenuInput + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r2, r0, 24 + lsls r4, 24 + asrs r4, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816B298 + adds r0, 0x1 + cmp r4, r0 + beq _0816B2B4 + movs r0, 0x5 + bl audio_play + ldr r0, _0816B294 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 + b _0816B2C0 + .align 2, 0 +_0816B294: .4byte 0x085dfedc +_0816B298: + lsls r1, r5, 24 + lsls r0, r2, 24 + asrs r2, r0, 24 + cmp r1, r0 + beq _0816B2C0 + ldr r0, _0816B2B0 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_816B21C + b _0816B2C0 + .align 2, 0 +_0816B2B0: .4byte 0x085dfea4 +_0816B2B4: + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_816B4A4 +_0816B2C0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816B248 + + thumb_func_start sub_816B2C8 +sub_816B2C8: @ 816B2C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0816B2E8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _0816B2EC + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .align 2, 0 +_0816B2E8: .4byte 0x03005e00 +_0816B2EC: .4byte sub_816B2F0 + 1 + thumb_func_end sub_816B2C8 + + thumb_func_start sub_816B2F0 +sub_816B2F0: @ 816B2F0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816B318 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816B310 + bl overworld_free_bg_tilemaps + bl sub_81AAC14 + adds r0, r4, 0 + bl remove_task +_0816B310: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B318: .4byte 0x02037fd4 + thumb_func_end sub_816B2F0 + + thumb_func_start sub_816B31C +sub_816B31C: @ 816B31C + push {lr} + ldr r0, _0816B330 + ldr r1, _0816B334 + str r1, [r0] + ldr r0, _0816B338 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0816B330: .4byte 0x03005dac +_0816B334: .4byte mapldr_080EBC0C + 1 +_0816B338: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_816B31C + + thumb_func_start mapldr_080EBC0C +mapldr_080EBC0C: @ 816B33C + push {lr} + bl sub_81973A4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + ldr r0, _0816B364 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_816B190 + bl pal_fill_black + pop {r0} + bx r0 + .align 2, 0 +_0816B364: .4byte sub_816B368 + 1 + thumb_func_end mapldr_080EBC0C + + thumb_func_start sub_816B368 +sub_816B368: @ 816B368 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B388 + ldr r0, _0816B390 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816B394 + str r0, [r1] +_0816B388: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B390: .4byte 0x03005e00 +_0816B394: .4byte sub_816B248 + 1 + thumb_func_end sub_816B368 + + thumb_func_start sub_816B398 +sub_816B398: @ 816B398 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _0816B3C0 + adds r4, r0 + bl sub_80D6CE4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + cmp r0, 0 + beq _0816B3C4 + adds r0, r5, 0 + movs r1, 0 + bl sub_816B430 + b _0816B3D4 + .align 2, 0 +_0816B3C0: .4byte 0x03005e08 +_0816B3C4: + adds r0, r5, 0 + bl sub_816B4DC + ldr r1, _0816B3DC + ldr r2, _0816B3E0 + adds r0, r5, 0 + bl sub_81978EC +_0816B3D4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816B3DC: .4byte 0x085eabd1 +_0816B3E0: .4byte task_pc_itemstorage + 1 + thumb_func_end sub_816B398 + + thumb_func_start sub_816B3E4 +sub_816B3E4: @ 816B3E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _0816B40C + adds r4, r0 + bl sub_80D6CE4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + cmp r0, 0 + beq _0816B410 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_816B430 + b _0816B420 + .align 2, 0 +_0816B40C: .4byte 0x03005e08 +_0816B410: + adds r0, r5, 0 + bl sub_816B4DC + ldr r1, _0816B428 + ldr r2, _0816B42C + adds r0, r5, 0 + bl sub_81978EC +_0816B420: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816B428: .4byte 0x085eabd1 +_0816B42C: .4byte task_pc_itemstorage + 1 + thumb_func_end sub_816B3E4 + + thumb_func_start sub_816B430 +sub_816B430: @ 816B430 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + ldr r6, _0816B494 + adds r0, r5, r6 + strh r1, [r0, 0x6] + adds r0, r4, 0 + bl sub_816B4DC + ldr r1, _0816B498 + movs r0, 0 + strh r0, [r1] + strh r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x9] + adds r0, r4, 0 + bl sub_816B4C0 + bl sub_816BC14 + bl gpu_pal_allocator_reset__manage_upper_four + bl sub_8122328 + ldr r0, _0816B49C + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + bl sub_8122344 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + subs r6, 0x8 + adds r5, r6 + ldr r0, _0816B4A0 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816B494: .4byte 0x03005e08 +_0816B498: .4byte 0x0203bcb8 +_0816B49C: .4byte 0x0203bcc4 +_0816B4A0: .4byte sub_816C158 + 1 + thumb_func_end sub_816B430 + + thumb_func_start sub_816B4A4 +sub_816B4A4: @ 816B4A4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_816B4DC + adds r0, r4, 0 + bl sub_816B060 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B4A4 + + thumb_func_start sub_816B4C0 +sub_816B4C0: @ 816B4C0 + push {lr} + ldr r1, _0816B4D0 + ldrb r0, [r1, 0x5] + cmp r0, 0x7 + bls _0816B4D4 + movs r0, 0x8 + b _0816B4D6 + .align 2, 0 +_0816B4D0: .4byte 0x0203bcb8 +_0816B4D4: + adds r0, 0x1 +_0816B4D6: + strb r0, [r1, 0x4] + pop {r0} + bx r0 + thumb_func_end sub_816B4C0 + + thumb_func_start sub_816B4DC +sub_816B4DC: @ 816B4DC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0816B50C + adds r4, r0 + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x8] + bl Window_FillTileMap + ldrb r0, [r4, 0x8] + bl Window_Remove + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B50C: .4byte 0x03005e08 + thumb_func_end sub_816B4DC + + thumb_func_start sub_816B510 +sub_816B510: @ 816B510 + push {r4,lr} + movs r2, 0 + movs r1, 0x6 + ldr r0, _0816B548 + ldr r3, [r0] + movs r4, 0xB0 + lsls r4, 6 +_0816B51E: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _0816B534 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_0816B534: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0816B51E + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0816B548: .4byte 0x03005d8c + thumb_func_end sub_816B510 + + thumb_func_start sub_816B54C +sub_816B54C: @ 816B54C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r2, 0x6 +_0816B55A: + adds r1, r2, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + mov r8, r1 + cmp r4, 0xF + bhi _0816B5D4 + ldr r0, _0816B5F0 + mov r10, r0 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + mov r12, r0 + ldr r6, _0816B5F4 +_0816B574: + mov r1, r10 + ldr r1, [r1] + mov r9, r1 + mov r2, r9 + add r2, r12 + movs r3, 0xB0 + lsls r3, 6 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _0816B5CA + adds r2, r6 + mov r1, sp + adds r0, r2, 0 + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + lsls r3, r4, 3 + adds r3, r4 + lsls r3, 2 + mov r5, r9 + adds r0, r5, r3 + adds r0, r6 + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + mov r7, r10 + ldr r1, [r7] + adds r1, r3 + adds r1, r6 + mov r0, sp + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} +_0816B5CA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0816B574 +_0816B5D4: + mov r3, r8 + lsls r0, r3, 24 + lsrs r2, r0, 24 + cmp r2, 0xE + bls _0816B55A + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816B5F0: .4byte 0x03005d8c +_0816B5F4: .4byte 0x00002be0 + thumb_func_end sub_816B54C + + thumb_func_start sub_816B5F8 +sub_816B5F8: @ 816B5F8 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + bl sub_81D1C84 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_81D1C84 + ldr r6, _0816B668 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0x40 + bl sub_81DB35C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r4, _0816B66C + adds r0, r4, 0 + bl sub_81D1DC0 + ldr r2, _0816B670 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x12] + adds r0, r4, 0 + bl sub_81D1E90 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816B668: .4byte 0x085eab4e +_0816B66C: .4byte 0x0203bcb8 +_0816B670: .4byte 0x03005e00 + thumb_func_end sub_816B5F8 + + thumb_func_start sub_816B674 +sub_816B674: @ 816B674 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r9, r0 + ldr r0, _0816B6C8 + mov r10, r0 + mov r4, r9 + add r4, r10 + ldr r0, _0816B6CC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816B71E + ldrb r0, [r4, 0xA] + bl sub_81AE604 + adds r6, r0, 0 + ldrb r0, [r4, 0xA] + ldr r7, _0816B6D0 + subs r1, r7, 0x2 + mov r8, r1 + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _0816B6D4 + adds r0, 0x1 + cmp r6, r0 + bne _0816B6EA + b _0816B71E + .align 2, 0 +_0816B6C8: .4byte 0x03005e08 +_0816B6CC: .4byte 0x02037fd4 +_0816B6D0: .4byte 0x0203bcba +_0816B6D4: + movs r0, 0x5 + bl audio_play + mov r1, r8 + ldrb r0, [r1, 0x9] + bl sub_81AF620 + adds r0, r5, 0 + bl sub_816B798 + b _0816B71E +_0816B6EA: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81D1D04 + movs r0, 0x1 + bl sub_81D1D04 + ldrb r0, [r4, 0xA] + adds r1, r7, 0 + mov r2, r8 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + mov r1, r8 + ldrb r0, [r1, 0x9] + bl sub_81AF620 + mov r0, r10 + subs r0, 0x8 + add r0, r9 + ldr r1, _0816B72C + str r1, [r0] +_0816B71E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816B72C: .4byte sub_816B730 + 1 + thumb_func_end sub_816B674 + + thumb_func_start sub_816B730 +sub_816B730: @ 816B730 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0816B77C + ldr r2, _0816B780 + ldr r1, _0816B784 + ldrh r0, [r1] + adds r0, 0x6 + ldrh r1, [r1, 0x2] + adds r0, r1 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r1, r0 + ldr r0, _0816B788 + adds r1, r0 + adds r0, r5, 0 + bl gf_strcpy + adds r0, r5, 0 + movs r1, 0 + bl sub_81DB554 + ldr r5, _0816B78C + ldr r1, _0816B790 + adds r0, r5, 0 + bl ExpandTextCodes + ldr r2, _0816B794 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81978EC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816B77C: .4byte 0x02021cc4 +_0816B780: .4byte 0x03005d8c +_0816B784: .4byte 0x0203bcb8 +_0816B788: .4byte 0x00002bf2 +_0816B78C: .4byte 0x02021fc4 +_0816B790: .4byte 0x085eac63 +_0816B794: .4byte sub_816B7DC + 1 + thumb_func_end sub_816B730 + + thumb_func_start sub_816B798 +sub_816B798: @ 816B798 + 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, _0816B7D8 + adds r4, r0 + movs r0, 0 + bl sub_81D1D04 + movs r0, 0x1 + bl sub_81D1D04 + ldrb r0, [r4, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81D1EC0 + adds r0, r5, 0 + bl sub_816B060 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816B7D8: .4byte 0x03005e08 + thumb_func_end sub_816B798 + + thumb_func_start sub_816B7DC +sub_816B7DC: @ 816B7DC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x2 + bl sub_81D1C84 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r2, _0816B820 + adds r0, r4, 0 + movs r1, 0x4 + bl PrintMenuTable + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816B824 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816B828 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816B820: .4byte 0x085dff04 +_0816B824: .4byte 0x03005e00 +_0816B828: .4byte sub_816B82C + 1 + thumb_func_end sub_816B7DC + + thumb_func_start sub_816B82C +sub_816B82C: @ 816B82C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl ProcessMenuInput_other + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816B86E + adds r0, 0x1 + cmp r4, r0 + bne _0816B858 + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816BBD4 + b _0816B86E +_0816B858: + movs r0, 0x5 + bl audio_play + ldr r0, _0816B874 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 +_0816B86E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816B874: .4byte 0x085dff04 + thumb_func_end sub_816B82C + + thumb_func_start sub_816B878 +sub_816B878: @ 816B878 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, _0816B89C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816B8A0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B89C: .4byte 0x03005e00 +_0816B8A0: .4byte sub_816B8A4 + 1 + thumb_func_end sub_816B878 + + thumb_func_start sub_816B8A4 +sub_816B8A4: @ 816B8A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816B8EC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816B8E6 + bl sub_81D1EC0 + bl overworld_free_bg_tilemaps + ldr r2, _0816B8F0 + ldr r1, _0816B8F4 + ldrh r0, [r1] + adds r0, 0x6 + ldrh r1, [r1, 0x2] + adds r0, r1 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _0816B8F8 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, _0816B8FC + movs r2, 0x1 + bl sub_8121478 + adds r0, r4, 0 + bl remove_task +_0816B8E6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B8EC: .4byte 0x02037fd4 +_0816B8F0: .4byte 0x03005d8c +_0816B8F4: .4byte 0x0203bcb8 +_0816B8F8: .4byte 0x00002be0 +_0816B8FC: .4byte sub_816B900 + 1 + thumb_func_end sub_816B8A4 + + thumb_func_start sub_816B900 +sub_816B900: @ 816B900 + push {lr} + ldr r0, _0816B914 + ldr r1, _0816B918 + str r1, [r0] + ldr r0, _0816B91C + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0816B914: .4byte 0x03005dac +_0816B918: .4byte pal_fill_for_maplights_or_black + 1 +_0816B91C: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_816B900 + + thumb_func_start pal_fill_for_maplights_or_black +pal_fill_for_maplights_or_black: @ 816B920 + push {r4,lr} + bl sub_81973A4 + ldr r0, _0816B94C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816B950 + ldrb r0, [r0, 0x5] + bl sub_81D1C44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B954 + adds r0, r4, 0 + bl sub_816B5F8 + b _0816B95A + .align 2, 0 +_0816B94C: .4byte task00_080EBBDC + 1 +_0816B950: .4byte 0x0203bcb8 +_0816B954: + adds r0, r4, 0 + bl remove_task +_0816B95A: + bl pal_fill_black + pop {r4} + pop {r0} + bx r0 + thumb_func_end pal_fill_for_maplights_or_black + + thumb_func_start task00_080EBBDC +task00_080EBBDC: @ 816B964 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B984 + ldr r0, _0816B98C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816B990 + str r0, [r1] +_0816B984: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B98C: .4byte 0x03005e00 +_0816B990: .4byte sub_816B674 + 1 + thumb_func_end task00_080EBBDC + + thumb_func_start sub_816B994 +sub_816B994: @ 816B994 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0816B9A8 + ldr r2, _0816B9AC + bl sub_81978EC + pop {r0} + bx r0 + .align 2, 0 +_0816B9A8: .4byte 0x085eac8d +_0816B9AC: .4byte sub_816B9B0 + 1 + thumb_func_end sub_816B994 + + thumb_func_start sub_816B9B0 +sub_816B9B0: @ 816B9B0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, _0816B9D0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816B9D4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816B9D0: .4byte 0x03005e00 +_0816B9D4: .4byte sub_816B9D8 + 1 + thumb_func_end sub_816B9B0 + + thumb_func_start sub_816B9D8 +sub_816B9D8: @ 816B9D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _0816BA04 + cmp r0, r1 + ble _0816BA10 + cmp r0, 0 + beq _0816B9FC + cmp r0, 0x1 + beq _0816BA0A + b _0816BA10 +_0816B9FC: + adds r0, r4, 0 + bl sub_816BA18 + b _0816BA10 +_0816BA04: + movs r0, 0x5 + bl audio_play +_0816BA0A: + adds r0, r4, 0 + bl sub_816BAAC +_0816BA10: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B9D8 + + thumb_func_start sub_816BA18 +sub_816BA18: @ 816BA18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _0816BA54 + ldr r4, _0816BA58 + ldrh r1, [r4] + adds r1, 0x6 + ldrh r0, [r4, 0x2] + adds r1, r0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0816BA5C + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldrh r0, [r5, 0x20] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _0816BA68 + ldr r1, _0816BA60 + ldr r2, _0816BA64 + adds r0, r6, 0 + bl sub_81978EC + b _0816BA9C + .align 2, 0 +_0816BA54: .4byte 0x03005d8c +_0816BA58: .4byte 0x0203bcb8 +_0816BA5C: .4byte 0x00002be0 +_0816BA60: .4byte 0x085eacb5 +_0816BA64: .4byte sub_816BBD4 + 1 +_0816BA68: + ldr r1, _0816BAA4 + ldr r2, _0816BAA8 + adds r0, r6, 0 + bl sub_81978EC + adds r0, r5, 0 + bl sub_80D439C + bl sub_816B54C + ldrb r0, [r4, 0x5] + subs r0, 0x1 + strb r0, [r4, 0x5] + ldrb r1, [r4, 0x5] + ldrb r0, [r4, 0x4] + ldrh r2, [r4, 0x2] + adds r0, r2 + cmp r1, r0 + bge _0816BA96 + cmp r2, 0 + beq _0816BA96 + subs r0, r2, 0x1 + strh r0, [r4, 0x2] +_0816BA96: + adds r0, r6, 0 + bl sub_816B4C0 +_0816BA9C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816BAA4: .4byte 0x085eacc8 +_0816BAA8: .4byte sub_816BBD4 + 1 + thumb_func_end sub_816BA18 + + thumb_func_start sub_816BAAC +sub_816BAAC: @ 816BAAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_816BBD4 + pop {r0} + bx r0 + thumb_func_end sub_816BAAC + + thumb_func_start sub_816BABC +sub_816BABC: @ 816BABC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl calc_player_party_count + lsls r0, 24 + cmp r0, 0 + bne _0816BAD4 + adds r0, r4, 0 + bl sub_816BBB8 + b _0816BAEA +_0816BAD4: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _0816BAF0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816BAF4 + str r0, [r1] +_0816BAEA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BAF0: .4byte 0x03005e00 +_0816BAF4: .4byte sub_816BAF8 + 1 + thumb_func_end sub_816BABC + + thumb_func_start sub_816BAF8 +sub_816BAF8: @ 816BAF8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816BB24 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816BB1C + bl sub_81D1EC0 + bl overworld_free_bg_tilemaps + bl sub_81B8448 + adds r0, r4, 0 + bl remove_task +_0816BB1C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BB24: .4byte 0x02037fd4 + thumb_func_end sub_816BAF8 + + thumb_func_start sub_816BB28 +sub_816BB28: @ 816BB28 + push {lr} + ldr r0, _0816BB3C + ldr r1, _0816BB40 + str r1, [r0] + ldr r0, _0816BB44 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0816BB3C: .4byte 0x03005dac +_0816BB40: .4byte sub_816BB48 + 1 +_0816BB44: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_816BB28 + + thumb_func_start sub_816BB48 +sub_816BB48: @ 816BB48 + push {r4-r6,lr} + ldr r0, _0816BBA0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _0816BBA4 + ldrb r4, [r5, 0x5] + bl sub_816B510 + strb r0, [r5, 0x5] + bl sub_816B54C + ldrb r0, [r5, 0x5] + cmp r4, r0 + beq _0816BB7E + ldrb r1, [r5, 0x5] + ldrb r0, [r5, 0x4] + ldrh r2, [r5, 0x2] + adds r0, r2 + cmp r1, r0 + bge _0816BB7E + cmp r2, 0 + beq _0816BB7E + subs r0, r2, 0x1 + strh r0, [r5, 0x2] +_0816BB7E: + adds r0, r6, 0 + bl sub_816B4C0 + bl sub_81973A4 + ldr r0, _0816BBA4 + ldrb r0, [r0, 0x5] + bl sub_81D1C44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816BBA8 + adds r0, r6, 0 + bl sub_816B5F8 + b _0816BBAE + .align 2, 0 +_0816BBA0: .4byte task00_080EBBDC + 1 +_0816BBA4: .4byte 0x0203bcb8 +_0816BBA8: + adds r0, r6, 0 + bl remove_task +_0816BBAE: + bl pal_fill_black + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816BB48 + + thumb_func_start sub_816BBB8 +sub_816BBB8: @ 816BBB8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0816BBCC + ldr r2, _0816BBD0 + bl sub_81978EC + pop {r0} + bx r0 + .align 2, 0 +_0816BBCC: .4byte 0x085e8de9 +_0816BBD0: .4byte sub_816BBD4 + 1 + thumb_func_end sub_816BBB8 + + thumb_func_start sub_816BBD4 +sub_816BBD4: @ 816BBD4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + bl sub_81D1D04 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_816B5F8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816BC0C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816BC10 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BC0C: .4byte 0x03005e00 +_0816BC10: .4byte sub_816B674 + 1 + thumb_func_end sub_816BBD4 + + thumb_func_start sub_816BC14 +sub_816BC14: @ 816BC14 + push {r4,lr} + ldr r4, _0816BC4C + movs r0, 0xCE + lsls r0, 3 + bl malloc_and_clear + str r0, [r4] + movs r1, 0xCC + lsls r1, 3 + adds r0, r1 + movs r1, 0xFF + movs r2, 0x6 + bl memset + ldr r0, [r4] + ldr r1, _0816BC50 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, _0816BC54 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BC4C: .4byte 0x0203bcc4 +_0816BC50: .4byte 0x00000666 +_0816BC54: .4byte 0x00000667 + thumb_func_end sub_816BC14 + + thumb_func_start sub_816BC58 +sub_816BC58: @ 816BC58 + push {r4,lr} + movs r4, 0 +_0816BC5C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_816BCC4 + adds r4, 0x1 + cmp r4, 0x5 + bls _0816BC5C + ldr r0, _0816BC78 + ldr r0, [r0] + bl free + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BC78: .4byte 0x0203bcc4 + thumb_func_end sub_816BC58 + + thumb_func_start sub_816BC7C +sub_816BC7C: @ 816BC7C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0816BCBC + movs r3, 0xCC + lsls r3, 3 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _0816BCB4 + lsls r0, r2, 3 + ldr r1, _0816BCC0 + adds r0, r1 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_0816BCB4: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0816BCBC: .4byte 0x0203bcc4 +_0816BCC0: .4byte 0x085dff5c + thumb_func_end sub_816BC7C + + thumb_func_start sub_816BCC4 +sub_816BCC4: @ 816BCC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0816BD00 + movs r2, 0xCC + lsls r2, 3 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _0816BCF8 + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl Window_FillTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] +_0816BCF8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BD00: .4byte 0x0203bcc4 + thumb_func_end sub_816BCC4 + + thumb_func_start sub_816BD04 +sub_816BD04: @ 816BD04 + push {r4-r6,lr} + movs r6, 0 + ldr r0, _0816BDB0 + ldrb r0, [r0, 0x5] + subs r0, 0x1 + cmp r6, r0 + bge _0816BD58 + ldr r5, _0816BDB4 +_0816BD14: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r0, 0xCC + lsls r0, 1 + adds r4, r0 + ldr r0, [r5] + adds r0, r4 + ldr r1, _0816BDB8 + ldr r1, [r1] + lsls r2, r6, 2 + adds r1, r2 + movs r2, 0x93 + lsls r2, 3 + adds r1, r2 + ldrh r1, [r1] + bl sub_816BDC8 + ldr r0, [r5] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _0816BDB0 + ldrb r0, [r0, 0x5] + subs r0, 0x1 + cmp r6, r0 + blt _0816BD14 +_0816BD58: + ldr r5, _0816BDB4 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r3, 0xCC + lsls r3, 1 + adds r4, r3 + ldr r0, [r5] + adds r0, r4 + ldr r1, _0816BDBC + bl gf_strcpy + ldr r0, [r5] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + movs r1, 0x2 + negs r1, r1 + str r1, [r0] + ldr r4, _0816BDC0 + adds r1, r4, 0 + ldr r0, _0816BDC4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + movs r0, 0 + bl sub_816BC7C + strb r0, [r4, 0x10] + ldr r1, _0816BDB0 + ldrb r0, [r1, 0x5] + strh r0, [r4, 0xC] + ldr r0, [r5] + str r0, [r4] + ldrb r0, [r1, 0x4] + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816BDB0: .4byte 0x0203bcb8 +_0816BDB4: .4byte 0x0203bcc4 +_0816BDB8: .4byte 0x03005d8c +_0816BDBC: .4byte 0x085e8cf7 +_0816BDC0: .4byte 0x03006310 +_0816BDC4: .4byte 0x085dff44 + thumb_func_end sub_816BD04 + + thumb_func_start sub_816BDC8 +sub_816BDC8: @ 816BDC8 + push {lr} + adds r2, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + adds r1, r2, 0 + bl itemid_get_name + pop {r0} + bx r0 + thumb_func_end sub_816BDC8 + + thumb_func_start sub_816BDDC +sub_816BDDC: @ 816BDDC + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _0816BDEE + movs r0, 0x5 + bl audio_play +_0816BDEE: + ldr r0, _0816BE20 + ldr r0, [r0] + ldr r1, _0816BE24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0816BE38 + bl sub_816C0C8 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816BE2C + ldr r0, _0816BE28 + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + bl sub_816C060 + b _0816BE32 + .align 2, 0 +_0816BE20: .4byte 0x0203bcc4 +_0816BE24: .4byte 0x00000666 +_0816BE28: .4byte 0x03005d8c +_0816BE2C: + ldr r0, _0816BE40 + bl sub_816C060 +_0816BE32: + adds r0, r4, 0 + bl sub_816BEF0 +_0816BE38: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BE40: .4byte 0x0000ffff + thumb_func_end sub_816BDDC + + thumb_func_start fish4_goto_x5_or_x6 +fish4_goto_x5_or_x6: @ 816BE44 + push {r4-r6,lr} + sub sp, 0xC + 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 _0816BED4 + ldr r0, _0816BE7C + ldr r0, [r0] + ldr r1, _0816BE80 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _0816BE8E + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0816BE84 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xFF + bl sub_816BFE0 + b _0816BE8E + .align 2, 0 +_0816BE7C: .4byte 0x0203bcc4 +_0816BE80: .4byte 0x00000666 +_0816BE84: + adds r0, r5, 0 + movs r1, 0xFF + movs r2, 0xFF + bl sub_816BFE0 +_0816BE8E: + ldr r0, _0816BEDC + ldr r1, _0816BEE0 + ldr r1, [r1] + lsls r2, r4, 2 + adds r1, r2 + ldr r2, _0816BEE4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _0816BEE8 + ldr r1, _0816BEEC + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x68 + bl sub_81DB368 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x7 + adds r2, r4, 0 + bl Print +_0816BED4: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816BEDC: .4byte 0x02021cc4 +_0816BEE0: .4byte 0x03005d8c +_0816BEE4: .4byte 0x0000049a +_0816BEE8: .4byte 0x02021fc4 +_0816BEEC: .4byte 0x085e8da0 + thumb_func_end fish4_goto_x5_or_x6 + + thumb_func_start sub_816BEF0 +sub_816BEF0: @ 816BEF0 + push {r4,r5,lr} + sub sp, 0xC + adds r1, r0, 0 + ldr r0, _0816BF20 + ldr r0, [r0] + ldr r2, _0816BF24 + adds r0, r2 + ldrb r5, [r0] + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _0816BF2C + ldr r0, _0816BF28 + ldr r0, [r0] + lsls r1, 2 + adds r0, r1 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + bl itemid_get_description + b _0816BF32 + .align 2, 0 +_0816BF20: .4byte 0x0203bcc4 +_0816BF24: .4byte 0x00000661 +_0816BF28: .4byte 0x03005d8c +_0816BF2C: + ldr r0, _0816BF5C + bl sub_816C228 +_0816BF32: + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816BF5C: .4byte 0x0000ffff + thumb_func_end sub_816BEF0 + + thumb_func_start sub_816BF60 +sub_816BF60: @ 816BF60 + push {r4,lr} + sub sp, 0x10 + ldr r4, _0816BF94 + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _0816BF8C + ldrb r0, [r4, 0x5] + ldrb r1, [r4, 0x4] + subs r0, r1 + str r0, [sp] + ldr r0, _0816BF98 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0x2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xB0 + movs r2, 0xC + movs r3, 0x94 + bl sub_81AF4A0 + strb r0, [r4, 0x9] +_0816BF8C: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BF94: .4byte 0x0203bcb8 +_0816BF98: .4byte 0x000013f8 + thumb_func_end sub_816BF60 + + thumb_func_start sub_816BF9C +sub_816BF9C: @ 816BF9C + push {r4,lr} + ldr r4, _0816BFB4 + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + beq _0816BFAE + bl sub_81AF620 + movs r0, 0xFF + strb r0, [r4, 0x9] +_0816BFAE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816BFB4: .4byte 0x0203bcb8 + thumb_func_end sub_816BF9C + + thumb_func_start sub_816BFB8 +sub_816BFB8: @ 816BFB8 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + bl sub_81AE88C + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_816BFE0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816BFB8 + + thumb_func_start sub_816BFE0 +sub_816BFE0: @ 816BFE0 + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0816C02C + ldr r0, [r0] + movs r3, 0xCC + lsls r3, 3 + adds r0, r3 + ldrb r5, [r0] + cmp r1, 0xFF + bne _0816C030 + movs r0, 0x1 + movs r1, 0 + bl sub_8006460 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8006460 + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0x11 + movs r2, 0 + adds r3, r6, 0 + bl Window_FillPixelRect + b _0816C050 + .align 2, 0 +_0816C02C: .4byte 0x0203bcc4 +_0816C030: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, _0816C058 + str r0, [sp, 0x8] + lsls r0, r2, 24 + asrs r0, 24 + str r0, [sp, 0xC] + ldr r0, _0816C05C + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + adds r3, r6, 0 + bl sub_8199EEC +_0816C050: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C058: .4byte 0x085dff8c +_0816C05C: .4byte 0x085e8d60 + thumb_func_end sub_816BFE0 + + thumb_func_start sub_816C060 +sub_816C060: @ 816C060 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _0816C0B8 + ldr r0, [r0] + ldr r1, _0816C0BC + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _0816C0B2 + ldr r4, _0816C0C0 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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 _0816C0B2 + strb r2, [r5] + ldr r0, _0816C0C4 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x18 + strh r0, [r1, 0x24] + movs r0, 0x50 + strh r0, [r1, 0x26] +_0816C0B2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C0B8: .4byte 0x0203bcc4 +_0816C0BC: .4byte 0x00000667 +_0816C0C0: .4byte 0x000013f6 +_0816C0C4: .4byte 0x02020630 + thumb_func_end sub_816C060 + + thumb_func_start sub_816C0C8 +sub_816C0C8: @ 816C0C8 + push {r4,r5,lr} + ldr r0, _0816C100 + ldr r0, [r0] + ldr r1, _0816C104 + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _0816C0FA + ldr r4, _0816C108 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0816C10C + adds r0, r1 + bl obj_delete_and_free_tiles + movs r0, 0xFF + strb r0, [r5] +_0816C0FA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816C100: .4byte 0x0203bcc4 +_0816C104: .4byte 0x00000667 +_0816C108: .4byte 0x000013f6 +_0816C10C: .4byte 0x02020630 + thumb_func_end sub_816C0C8 + + thumb_func_start sub_816C110 +sub_816C110: @ 816C110 + push {lr} + sub sp, 0x4 + bl sub_80D6E84 + ldr r0, _0816C138 + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldr r2, _0816C13C + adds r3, r2, 0x1 + movs r1, 0x8 + str r1, [sp] + movs r1, 0x32 + bl atk2D_jumpifarraynotequal + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0816C138: .4byte 0x03005d8c +_0816C13C: .4byte 0x0203bcbc + thumb_func_end sub_816C110 + + thumb_func_start sub_816C140 +sub_816C140: @ 816C140 + push {lr} + ldr r0, _0816C154 + subs r1, r0, 0x2 + ldrb r2, [r1, 0x4] + ldrb r3, [r1, 0x5] + bl sub_812225C + pop {r0} + bx r0 + .align 2, 0 +_0816C154: .4byte 0x0203bcba + thumb_func_end sub_816C140 + + thumb_func_start sub_816C158 +sub_816C158: @ 816C158 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0816C200 + adds r7, r0, r1 + movs r4, 0 +_0816C16C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_816BC7C + adds r4, 0x1 + cmp r4, 0x3 + bls _0816C16C + movs r1, 0x6 + ldrsh r0, [r7, r1] + ldr r5, _0816C204 + cmp r0, 0 + bne _0816C186 + ldr r5, _0816C208 +_0816C186: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x68 + bl sub_81DB35C + adds r3, r0, 0 + ldr r4, _0816C20C + ldr r0, [r4] + ldr r1, _0816C210 + adds r0, r1 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldr r0, [r4] + ldr r1, _0816C214 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram + bl sub_816C110 + bl sub_816C140 + bl sub_816BD04 + ldr r0, _0816C218 + ldr r2, _0816C21C + ldrh r1, [r2, 0x2] + ldrh r2, [r2] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0xA] + bl sub_816BF60 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816C220 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816C224 + str r1, [r0] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816C200: .4byte 0x03005e08 +_0816C204: .4byte 0x085eab71 +_0816C208: .4byte 0x085eab63 +_0816C20C: .4byte 0x0203bcc4 +_0816C210: .4byte 0x00000663 +_0816C214: .4byte 0x00000662 +_0816C218: .4byte 0x03006310 +_0816C21C: .4byte 0x0203bcb8 +_0816C220: .4byte 0x03005e00 +_0816C224: .4byte sub_816C30C + 1 + thumb_func_end sub_816C158 + + thumb_func_start sub_816C228 +sub_816C228: @ 816C228 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, _0816C240 + adds r0, r1, r2 + cmp r0, 0x8 + bhi _0816C2B4 + lsls r0, 2 + ldr r1, _0816C244 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816C240: .4byte 0xffff0009 +_0816C244: .4byte _0816C248 + .align 2, 0 +_0816C248: + .4byte _0816C2AC + .4byte _0816C2A4 + .4byte _0816C29C + .4byte _0816C294 + .4byte _0816C28C + .4byte _0816C284 + .4byte _0816C27C + .4byte _0816C274 + .4byte _0816C26C +_0816C26C: + ldr r0, _0816C270 + b _0816C2BA + .align 2, 0 +_0816C270: .4byte 0x085e8d62 +_0816C274: + ldr r0, _0816C278 + b _0816C2BA + .align 2, 0 +_0816C278: .4byte 0x085eac09 +_0816C27C: + ldr r0, _0816C280 + b _0816C2BA + .align 2, 0 +_0816C280: .4byte 0x085eac22 +_0816C284: + ldr r0, _0816C288 + b _0816C2BA + .align 2, 0 +_0816C288: .4byte 0x085e8ee0 +_0816C28C: + ldr r0, _0816C290 + b _0816C2BA + .align 2, 0 +_0816C290: .4byte 0x085e8ef9 +_0816C294: + ldr r0, _0816C298 + b _0816C2BA + .align 2, 0 +_0816C298: .4byte 0x085eabe7 +_0816C29C: + ldr r0, _0816C2A0 + b _0816C2BA + .align 2, 0 +_0816C2A0: .4byte 0x085e8eb9 +_0816C2A4: + ldr r0, _0816C2A8 + b _0816C2BA + .align 2, 0 +_0816C2A8: .4byte 0x085e8f0e +_0816C2AC: + ldr r0, _0816C2B0 + b _0816C2BA + .align 2, 0 +_0816C2B0: .4byte 0x085e8dfe +_0816C2B4: + adds r0, r1, 0 + bl itemid_get_description +_0816C2BA: + pop {r1} + bx r1 + thumb_func_end sub_816C228 + + thumb_func_start sub_816C2C0 +sub_816C2C0: @ 816C2C0 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r0, _0816C300 + ldr r0, [r0] + ldr r1, _0816C304 + adds r0, r1 + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _0816C308 + adds r0, r4, 0 + adds r1, r6, 0 + bl ExpandTextCodes + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C300: .4byte 0x0203bcc4 +_0816C304: .4byte 0x00000661 +_0816C308: .4byte 0x02021fc4 + thumb_func_end sub_816C2C0 + + thumb_func_start sub_816C30C +sub_816C30C: @ 816C30C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0816C350 + adds r4, r0, r1 + ldr r0, _0816C354 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0816C35C + ldrb r0, [r4, 0xA] + ldr r1, _0816C358 + subs r4, r1, 0x2 + adds r2, r4, 0 + bl get_coro_args_x18_x1A + ldrh r1, [r4, 0x2] + ldrh r0, [r4] + adds r1, r0 + ldrb r0, [r4, 0x5] + subs r0, 0x1 + cmp r1, r0 + beq _0816C39E + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816C450 + b _0816C39E + .align 2, 0 +_0816C350: .4byte 0x03005e08 +_0816C354: .4byte 0x030022c0 +_0816C358: .4byte 0x0203bcba +_0816C35C: + ldrb r0, [r4, 0xA] + bl sub_81AE604 + adds r6, r0, 0 + ldrb r0, [r4, 0xA] + ldr r1, _0816C380 + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _0816C384 + adds r0, 0x1 + cmp r6, r0 + bne _0816C392 + b _0816C39E + .align 2, 0 +_0816C380: .4byte 0x0203bcba +_0816C384: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816C400 + b _0816C39E +_0816C392: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816C71C +_0816C39E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816C30C + + thumb_func_start bx_battle_menu_t3 +bx_battle_menu_t3: @ 816C3A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _0816C3D8 + adds r5, r0, r1 + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _0816C3F2 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r1, 0x6 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0816C3DC + adds r0, r4, 0 + movs r1, 0 + bl sub_816B190 + b _0816C3E4 + .align 2, 0 +_0816C3D8: .4byte 0x03005e08 +_0816C3DC: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_816B190 +_0816C3E4: + ldr r0, _0816C3F8 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816C3FC + str r0, [r1] +_0816C3F2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816C3F8: .4byte 0x03005e00 +_0816C3FC: .4byte sub_816B248 + 1 + thumb_func_end bx_battle_menu_t3 + + thumb_func_start sub_816C400 +sub_816C400: @ 816C400 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, _0816C444 + adds r5, r4, r6 + bl sub_816C0C8 + bl sub_816BF9C + ldrb r0, [r5, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, _0816C448 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + bl sub_81223B0 + bl sub_816BC58 + subs r6, 0x8 + adds r4, r6 + ldr r0, _0816C44C + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C444: .4byte 0x03005e08 +_0816C448: .4byte 0x0203bcc4 +_0816C44C: .4byte bx_battle_menu_t3 + 1 + thumb_func_end sub_816C400 + + thumb_func_start sub_816C450 +sub_816C450: @ 816C450 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _0816C4DC + mov r8, r0 + adds r1, r4, 0 + add r1, r8 + mov r9, r1 + ldrb r0, [r1, 0xA] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r6, _0816C4E0 + ldr r2, [r6] + ldr r1, _0816C4E4 + ldrb r0, [r1] + ldrb r1, [r1, 0x2] + adds r0, r1 + ldr r5, _0816C4E8 + adds r2, r5 + strb r0, [r2] + mov r1, r9 + ldrb r0, [r1, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_816BFB8 + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl sub_816C690 + ldr r0, _0816C4EC + ldr r1, [r0] + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _0816C4F0 + bl itemid_get_name + ldr r0, _0816C4F4 + bl sub_816C228 + bl sub_816C2C0 + movs r1, 0x8 + negs r1, r1 + add r8, r1 + add r4, r8 + ldr r0, _0816C4F8 + str r0, [r4] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C4DC: .4byte 0x03005e08 +_0816C4E0: .4byte 0x0203bcc4 +_0816C4E4: .4byte 0x0203bcb8 +_0816C4E8: .4byte 0x00000666 +_0816C4EC: .4byte 0x03005d8c +_0816C4F0: .4byte 0x02021cc4 +_0816C4F4: .4byte 0x0000fff7 +_0816C4F8: .4byte sub_816C4FC + 1 + thumb_func_end sub_816C450 + + thumb_func_start sub_816C4FC +sub_816C4FC: @ 816C4FC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0816C524 + adds r4, r0, r1 + ldr r7, _0816C528 + ldrh r1, [r7, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0816C530 + ldrb r0, [r4, 0xA] + ldr r1, _0816C52C + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _0816C57E + .align 2, 0 +_0816C524: .4byte 0x03005e08 +_0816C528: .4byte 0x030022c0 +_0816C52C: .4byte 0x0203bcba +_0816C530: + ldrb r0, [r4, 0xA] + bl sub_81AE604 + adds r6, r0, 0 + ldrb r0, [r4, 0xA] + ldr r1, _0816C56C + subs r4, r1, 0x2 + adds r2, r4, 0 + bl get_coro_args_x18_x1A + ldr r0, _0816C570 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + movs r2, 0 + bl sub_81223FC + ldrb r0, [r4] + bl sub_816C690 + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _0816C574 + adds r0, 0x1 + cmp r6, r0 + bne _0816C592 + b _0816C59A + .align 2, 0 +_0816C56C: .4byte 0x0203bcba +_0816C570: .4byte 0x0203bcc4 +_0816C574: + ldrh r1, [r7, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816C588 +_0816C57E: + adds r0, r5, 0 + movs r1, 0 + bl sub_816C5A0 + b _0816C59A +_0816C588: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_816C5A0 + b _0816C59A +_0816C592: + adds r0, r5, 0 + movs r1, 0 + bl sub_816C5A0 +_0816C59A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816C4FC + + thumb_func_start sub_816C5A0 +sub_816C5A0: @ 816C5A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0816C670 + adds r0, r1 + mov r8, r0 + ldr r4, _0816C674 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl audio_play + mov r2, r8 + ldrb r0, [r2, 0xA] + adds r1, r4, 0x2 + adds r2, r4, 0 + bl sub_81AE6C8 + cmp r5, 0 + bne _0816C60A + ldr r1, _0816C678 + ldr r0, [r1] + ldr r2, _0816C67C + adds r0, r2 + ldrb r2, [r0] + adds r4, r1, 0 + cmp r2, r6 + beq _0816C622 + subs r0, r6, 0x1 + cmp r2, r0 + beq _0816C60A + ldr r0, _0816C680 + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + adds r2, r6, 0 + bl sub_80D702C + bl sub_816BD04 +_0816C60A: + ldr r0, _0816C678 + ldr r1, [r0] + ldr r2, _0816C67C + adds r1, r2 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, r6 + bcs _0816C622 + ldr r1, _0816C674 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_0816C622: + ldr r0, [r4] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + movs r2, 0x1 + bl sub_81223FC + ldr r0, [r4] + ldr r2, _0816C67C + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + ldr r0, _0816C684 + ldr r2, _0816C674 + ldrh r1, [r2, 0x2] + ldrh r2, [r2] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0xA] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _0816C688 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816C68C + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816C670: .4byte 0x03005e08 +_0816C674: .4byte 0x0203bcb8 +_0816C678: .4byte 0x0203bcc4 +_0816C67C: .4byte 0x00000666 +_0816C680: .4byte 0x03005d8c +_0816C684: .4byte 0x03006310 +_0816C688: .4byte 0x03005e00 +_0816C68C: .4byte sub_816C30C + 1 + thumb_func_end sub_816C5A0 + + thumb_func_start sub_816C690 +sub_816C690: @ 816C690 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, _0816C6B8 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + lsrs r3, 4 + movs r1, 0x80 + lsls r1, 13 + adds r3, r1 + lsrs r3, 16 + movs r1, 0x7 + movs r2, 0x80 + bl sub_8122448 + pop {r0} + bx r0 + .align 2, 0 +_0816C6B8: .4byte 0x0203bcc4 + thumb_func_end sub_816C690 + + thumb_func_start sub_816C6BC +sub_816C6BC: @ 816C6BC + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r5, [sp, 0x1C] + ldr r3, [sp, 0x20] + lsls r6, 24 + lsrs r6, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _0816C710 + bl decimal_int_to_string + ldr r4, _0816C714 + ldr r1, _0816C718 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x30 + bl sub_81DB35C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C710: .4byte 0x02021cc4 +_0816C714: .4byte 0x02021fc4 +_0816C718: .4byte 0x085e8da0 + thumb_func_end sub_816C6BC + + thumb_func_start sub_816C71C +sub_816C71C: @ 816C71C + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0816C764 + adds r6, r0, r1 + ldr r1, _0816C768 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_816BF9C + movs r0, 0x1 + strh r0, [r6, 0x4] + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0816C798 + ldr r0, _0816C76C + ldr r1, [r0] + lsls r0, r4, 2 + adds r1, r0 + ldr r2, _0816C770 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0816C774 + adds r0, r5, 0 + bl sub_816C8FC + b _0816C7FE + .align 2, 0 +_0816C764: .4byte 0x03005e08 +_0816C768: .4byte 0x0203bcb8 +_0816C76C: .4byte 0x03005d8c +_0816C770: .4byte 0x0000049a +_0816C774: + movs r2, 0x93 + lsls r2, 3 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r1, _0816C790 + bl itemid_get_name + ldr r0, _0816C794 + bl sub_816C228 + bl sub_816C2C0 + b _0816C7D4 + .align 2, 0 +_0816C790: .4byte 0x02021cc4 +_0816C794: .4byte 0x0000fffe +_0816C798: + ldr r0, _0816C7B4 + ldr r1, [r0] + lsls r0, r4, 2 + adds r1, r0 + ldr r2, _0816C7B8 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0816C7BC + adds r0, r5, 0 + bl sub_816C9B8 + b _0816C7FE + .align 2, 0 +_0816C7B4: .4byte 0x03005d8c +_0816C7B8: .4byte 0x0000049a +_0816C7BC: + movs r2, 0x93 + lsls r2, 3 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r1, _0816C808 + bl itemid_get_name + ldr r0, _0816C80C + bl sub_816C228 + bl sub_816C2C0 +_0816C7D4: + movs r0, 0x4 + bl sub_816BC7C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + movs r2, 0x1 + str r2, [sp] + movs r2, 0x3 + str r2, [sp, 0x4] + movs r2, 0x2 + movs r3, 0x8 + bl sub_816C6BC + ldr r1, _0816C810 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816C814 + str r1, [r0] +_0816C7FE: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816C808: .4byte 0x02021cc4 +_0816C80C: .4byte 0x0000fffc +_0816C810: .4byte 0x03005e00 +_0816C814: .4byte sub_816C818 + 1 + thumb_func_end sub_816C71C + + thumb_func_start sub_816C818 +sub_816C818: @ 816C818 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + mov r9, r5 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0816C878 + adds r6, r0, r1 + ldr r0, _0816C87C + ldrh r2, [r0, 0x2] + ldrh r0, [r0] + adds r2, r0 + lsls r2, 16 + adds r0, r6, 0x4 + ldr r1, _0816C880 + mov r8, r1 + ldr r1, [r1] + lsrs r7, r2, 14 + adds r1, r7 + ldr r2, _0816C884 + adds r1, r2 + ldrh r1, [r1] + bl sub_8122034 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0816C888 + movs r0, 0x4 + bl sub_816BC7C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + str r4, [sp] + movs r2, 0x3 + str r2, [sp, 0x4] + movs r2, 0x2 + movs r3, 0x8 + bl sub_816C6BC + b _0816C8EC + .align 2, 0 +_0816C878: .4byte 0x03005e08 +_0816C87C: .4byte 0x0203bcb8 +_0816C880: .4byte 0x03005d8c +_0816C884: .4byte 0x0000049a +_0816C888: + ldr r0, _0816C8B0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816C8BC + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + bl sub_816BCC4 + movs r3, 0x6 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _0816C8B4 + adds r0, r5, 0 + bl sub_816C8FC + b _0816C8EC + .align 2, 0 +_0816C8B0: .4byte 0x030022c0 +_0816C8B4: + adds r0, r5, 0 + bl sub_816C9B8 + b _0816C8EC +_0816C8BC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0816C8EC + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + bl sub_816BCC4 + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + movs r2, 0x93 + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + bl sub_816C228 + bl sub_816C2C0 + mov r0, r9 + bl sub_816CBC0 +_0816C8EC: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816C818 + + thumb_func_start sub_816C8FC +sub_816C8FC: @ 816C8FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r0, _0816C970 + mov r8, r0 + adds r4, r6, r0 + ldr r0, _0816C974 + ldrh r1, [r0, 0x2] + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + ldr r7, _0816C978 + ldr r0, [r7] + lsrs r5, r1, 14 + adds r0, r5 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r4, 0x4] + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816C98C + ldr r0, [r7] + adds r0, r5 + movs r2, 0x93 + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + ldr r1, _0816C97C + bl itemid_get_name + ldr r0, _0816C980 + movs r2, 0x4 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, _0816C984 + bl sub_816C228 + bl sub_816C2C0 + mov r0, r8 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, _0816C988 + b _0816C9A2 + .align 2, 0 +_0816C970: .4byte 0x03005e08 +_0816C974: .4byte 0x0203bcb8 +_0816C978: .4byte 0x03005d8c +_0816C97C: .4byte 0x02021cc4 +_0816C980: .4byte 0x02021dc4 +_0816C984: .4byte 0x0000fffd +_0816C988: .4byte sub_816CB04 + 1 +_0816C98C: + movs r0, 0 + strh r0, [r4, 0x4] + ldr r0, _0816C9B0 + bl sub_816C228 + bl sub_816C2C0 + mov r0, r8 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, _0816C9B4 +_0816C9A2: + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816C9B0: .4byte 0x0000fffa +_0816C9B4: .4byte sub_816CB74 + 1 + thumb_func_end sub_816C8FC + + thumb_func_start sub_816C9B8 +sub_816C9B8: @ 816C9B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r8, r0 + ldr r0, _0816CA44 + mov r9, r0 + mov r7, r8 + add r7, r9 + ldr r0, _0816CA48 + ldrh r1, [r0, 0x2] + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + ldr r6, _0816CA4C + ldr r0, [r6] + lsrs r4, r1, 14 + adds r0, r4 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _0816CA64 + ldr r0, [r6] + adds r0, r4 + movs r2, 0x93 + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + ldr r1, _0816CA50 + bl itemid_get_name + ldr r0, _0816CA54 + movs r2, 0x4 + ldrsh r1, [r7, r2] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, _0816CA58 + bl sub_816C228 + bl sub_816C2C0 + ldr r1, _0816CA5C + movs r0, 0x1 + str r0, [sp] + movs r0, 0x85 + lsls r0, 2 + str r0, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, _0816CA60 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8121F94 + b _0816CA7C + .align 2, 0 +_0816CA44: .4byte 0x03005e08 +_0816CA48: .4byte 0x0203bcb8 +_0816CA4C: .4byte 0x03005d8c +_0816CA50: .4byte 0x02021cc4 +_0816CA54: .4byte 0x02021dc4 +_0816CA58: .4byte 0x0000fff8 +_0816CA5C: .4byte 0x085dff84 +_0816CA60: .4byte 0x085dff3c +_0816CA64: + movs r0, 0 + strh r0, [r7, 0x4] + ldr r0, _0816CA8C + bl sub_816C228 + bl sub_816C2C0 + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, _0816CA90 + str r1, [r0] +_0816CA7C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816CA8C: .4byte 0x0000fff9 +_0816CA90: .4byte sub_816CB74 + 1 + thumb_func_end sub_816C9B8 + + thumb_func_start sub_816CA94 +sub_816CA94: @ 816CA94 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0816CABC + bl sub_816C228 + bl sub_816C2C0 + ldr r1, _0816CAC0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816CAC4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816CABC: .4byte 0x0000fffb +_0816CAC0: .4byte 0x03005e00 +_0816CAC4: .4byte sub_816CB04 + 1 + thumb_func_end sub_816CA94 + + thumb_func_start sub_816CAC8 +sub_816CAC8: @ 816CAC8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0816CAFC + ldr r2, [r0] + ldr r1, _0816CB00 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 2 + adds r2, r0 + movs r0, 0x93 + lsls r0, 3 + adds r2, r0 + ldrh r0, [r2] + bl sub_816C228 + bl sub_816C2C0 + adds r0, r4, 0 + bl sub_816CBC0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816CAFC: .4byte 0x03005d8c +_0816CB00: .4byte 0x0203bcb8 + thumb_func_end sub_816CAC8 + + thumb_func_start sub_816CB04 +sub_816CB04: @ 816CB04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _0816CB64 + adds r5, r0, r1 + ldr r0, _0816CB68 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816CB5E + ldr r4, _0816CB6C + ldrb r0, [r4, 0x2] + ldrb r1, [r4] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x4] + bl sub_80D6E48 + ldrb r0, [r5, 0xA] + adds r1, r4, 0x2 + adds r2, r4, 0 + bl sub_81AE6C8 + bl sub_816C110 + bl sub_816C140 + bl sub_816BD04 + ldr r0, _0816CB70 + ldrh r1, [r4, 0x2] + ldrh r2, [r4] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + adds r0, r6, 0 + bl sub_816CBC0 +_0816CB5E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816CB64: .4byte 0x03005e08 +_0816CB68: .4byte 0x030022c0 +_0816CB6C: .4byte 0x0203bcb8 +_0816CB70: .4byte 0x03006310 + thumb_func_end sub_816CB04 + + thumb_func_start sub_816CB74 +sub_816CB74: @ 816CB74 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816CBB4 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816CBAC + ldr r0, _0816CBB8 + ldr r2, [r0] + ldr r1, _0816CBBC + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 2 + adds r2, r0 + movs r0, 0x93 + lsls r0, 3 + adds r2, r0 + ldrh r0, [r2] + bl sub_816C228 + bl sub_816C2C0 + adds r0, r4, 0 + bl sub_816CBC0 +_0816CBAC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816CBB4: .4byte 0x030022c0 +_0816CBB8: .4byte 0x03005d8c +_0816CBBC: .4byte 0x0203bcb8 + thumb_func_end sub_816CB74 + + thumb_func_start sub_816CBC0 +sub_816CBC0: @ 816CBC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_816BF60 + ldr r1, _0816CBE0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816CBE4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816CBE0: .4byte 0x03005e00 +_0816CBE4: .4byte sub_816C30C + 1 + thumb_func_end sub_816CBC0 + + thumb_func_start sub_816CBE8 +sub_816CBE8: @ 816CBE8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_816CBE8 + + thumb_func_start sub_816CC00 +sub_816CC00: @ 816CC00 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + ldr r0, _0816CC30 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _0816CC3C + ldr r0, _0816CC34 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816CC3C + ldr r0, _0816CC38 + bl set_callback2 + b _0816CC4C + .align 2, 0 +_0816CC30: .4byte 0x030022c0 +_0816CC34: .4byte 0x02037fd4 +_0816CC38: .4byte sub_816CC54 + 1 +_0816CC3C: + ldr r2, _0816CC50 + ldr r1, [r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0816CC4C + adds r0, r1, 0x1 + str r0, [r2] +_0816CC4C: + pop {r0} + bx r0 + .align 2, 0 +_0816CC50: .4byte 0x030062a0 + thumb_func_end sub_816CC00 + + thumb_func_start sub_816CC54 +sub_816CC54: @ 816CC54 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0816CC66 + ldr r0, _0816CC6C + bl set_callback2 +_0816CC66: + pop {r0} + bx r0 + .align 2, 0 +_0816CC6C: .4byte c2_title_screen_1 + 1 + thumb_func_end sub_816CC54 + + thumb_func_start load_copyright_graphics +load_copyright_graphics: @ 816CC70 + push {r4-r6,lr} + 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, _0816CCAC + movs r6, 0xC0 + lsls r6, 19 + adds r3, r6 + adds r1, r3, 0 + bl LZ77UnCompVram + ldr r0, _0816CCB0 + adds r4, r6 + adds r1, r4, 0 + bl LZ77UnCompVram + ldr r0, _0816CCB4 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816CCAC: .4byte 0x08dc3d74 +_0816CCB0: .4byte 0x08dc3fd4 +_0816CCB4: .4byte 0x08dc3d54 + thumb_func_end load_copyright_graphics + + thumb_func_start sub_816CCB8 +sub_816CCB8: @ 816CCB8 + push {lr} + ldr r0, _0816CCC4 + bl sub_82DEEE2 + pop {r0} + bx r0 + .align 2, 0 +_0816CCC4: .4byte 0x030062b0 + thumb_func_end sub_816CCB8 + + thumb_func_start do_copyright_screen +do_copyright_screen: @ 816CCC8 + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, _0816CCE8 + movs r1, 0x87 + lsls r1, 3 + adds r5, r0, r1 + ldrb r4, [r5] + cmp r4, 0x8C + bne _0816CCDC + b _0816CE00 +_0816CCDC: + cmp r4, 0x8C + bgt _0816CCEC + cmp r4, 0 + beq _0816CCF4 + b _0816CDBC + .align 2, 0 +_0816CCE8: .4byte 0x030022c0 +_0816CCEC: + cmp r4, 0x8D + bne _0816CCF2 + b _0816CE2C +_0816CCF2: + b _0816CDBC +_0816CCF4: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _0816CDD8 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _0816CDDC + add r0, sp, 0x4 + bl CpuSet + str r4, [sp, 0x8] + add r0, sp, 0x8 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, _0816CDE0 + bl CpuSet + add r0, sp, 0xC + strh r4, [r0] + ldr r1, _0816CDE4 + ldr r2, _0816CDE8 + bl CpuSet + bl sub_80A1A74 + movs r1, 0xE0 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl load_copyright_graphics + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816CDEC + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r1, 0xE0 + lsls r1, 3 + movs r0, 0x8 + bl lcd_io_set + movs r0, 0x1 + bl enable_irqs + ldr r0, _0816CDF0 + bl SetVBlankCallback + movs r1, 0x80 + lsls r1, 19 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0816CDF4 + bl set_serial_callback + ldr r0, _0816CDF8 + bl sub_82DEE98 +_0816CDBC: + bl fade_and_return_progress_probably + ldr r0, _0816CDFC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, _0816CDF8 + bl sub_82DED84 + b _0816CEA0 + .align 2, 0 +_0816CDD8: .4byte 0x00007fff +_0816CDDC: .4byte 0x05006000 +_0816CDE0: .4byte 0x05000100 +_0816CDE4: .4byte 0x05000002 +_0816CDE8: .4byte 0x010001ff +_0816CDEC: .4byte 0x0000ffff +_0816CDF0: .4byte sub_816CBE8 + 1 +_0816CDF4: .4byte sub_816CCB8 + 1 +_0816CDF8: .4byte 0x030062b0 +_0816CDFC: .4byte 0x030022c0 +_0816CE00: + ldr r4, _0816CE28 + adds r0, r4, 0 + bl sub_82DED84 + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + beq _0816CEA0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0816CEA0 + .align 2, 0 +_0816CE28: .4byte 0x030062b0 +_0816CE2C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0816CEA0 + ldr r0, _0816CE74 + movs r1, 0 + bl AddTask + ldr r0, _0816CE78 + bl set_callback2 + ldr r5, _0816CE7C + ldrb r0, [r5, 0x2] + cmp r0, 0 + beq _0816CE8C + ldrb r0, [r5, 0x2] + cmp r0, 0x2 + bne _0816CE96 + ldr r6, _0816CE80 + ldr r4, [r6] + ldr r0, _0816CE84 + cmp r4, r0 + bne _0816CE6C + ldr r0, _0816CE88 + movs r1, 0x80 + lsls r1, 18 + movs r2, 0xA0 + lsls r2, 9 + bl CpuSet + str r4, [r6] +_0816CE6C: + adds r0, r5, 0 + bl sub_82DEE84 + b _0816CE96 + .align 2, 0 +_0816CE74: .4byte task_intro_1 + 1 +_0816CE78: .4byte sub_816CC00 + 1 +_0816CE7C: .4byte 0x030062b0 +_0816CE80: .4byte 0x020000ac +_0816CE84: .4byte 0x65366347 +_0816CE88: .4byte 0x089aa144 +_0816CE8C: + bl sub_82DF012 + ldr r0, _0816CE9C + bl set_serial_callback +_0816CE96: + movs r0, 0 + b _0816CEA2 + .align 2, 0 +_0816CE9C: .4byte sub_800BA38 + 1 +_0816CEA0: + movs r0, 0x1 +_0816CEA2: + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end do_copyright_screen + + thumb_func_start c2_copyright_1 +c2_copyright_1: @ 816CEAC + push {lr} + bl do_copyright_screen + lsls r0, 24 + cmp r0, 0 + bne _0816CEFA + bl sub_815355C + lsls r0, 16 + lsrs r0, 16 + bl sub_8076BDC + bl sub_808447C + bl sub_8152680 + movs r0, 0 + bl sub_81534D0 + ldr r0, _0816CF00 + ldrh r0, [r0] + cmp r0, 0 + beq _0816CEDE + cmp r0, 0x2 + bne _0816CEE2 +_0816CEDE: + bl init_sav2 +_0816CEE2: + ldr r0, _0816CF04 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 31 + lsrs r0, 31 + bl sub_82E1810 + ldr r0, _0816CF08 + movs r1, 0xE0 + lsls r1, 9 + bl init_malloc +_0816CEFA: + pop {r0} + bx r0 + .align 2, 0 +_0816CF00: .4byte 0x03006210 +_0816CF04: .4byte 0x03005d90 +_0816CF08: .4byte 0x02000000 + thumb_func_end c2_copyright_1 + + thumb_func_start c2_show_copyright_and_intro_again_2 +c2_show_copyright_and_intro_again_2: @ 816CF0C + push {lr} + bl do_copyright_screen + pop {r0} + bx r0 + thumb_func_end c2_show_copyright_and_intro_again_2 + + thumb_func_start task_intro_1 +task_intro_1: @ 816CF18 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0 + bl SetVBlankCallback + ldr r4, _0816D0BC + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + strh r1, [r4] + bl intro_reset_and_hide_bgs + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0x50 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0x18 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0x28 + bl lcd_io_set + ldr r0, _0816D0C0 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0816D0C4 + ldr r1, _0816D0C8 + bl LZ77UnCompVram + ldr r1, _0816D0CC + add r0, sp, 0x8 + movs r6, 0 + strh r6, [r0] + ldr r4, _0816D0D0 + str r0, [r4] + str r1, [r4, 0x4] + ldr r5, _0816D0D4 + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, _0816D0D8 + ldr r1, _0816D0DC + bl LZ77UnCompVram + ldr r1, _0816D0E0 + add r0, sp, 0x8 + strh r6, [r0] + str r0, [r4] + str r1, [r4, 0x4] + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, _0816D0E4 + ldr r1, _0816D0E8 + bl LZ77UnCompVram + ldr r1, _0816D0EC + add r0, sp, 0x8 + strh r6, [r0] + str r0, [r4] + str r1, [r4, 0x4] + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, _0816D0F0 + ldr r1, _0816D0F4 + bl LZ77UnCompVram + ldr r1, _0816D0F8 + add r0, sp, 0x8 + strh r6, [r0] + str r0, [r4] + str r1, [r4, 0x4] + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, _0816D0FC + movs r5, 0x80 + lsls r5, 2 + movs r1, 0 + adds r2, r5, 0 + bl gpu_pal_apply + ldr r1, _0816D100 + movs r0, 0xE + bl lcd_io_set + ldr r1, _0816D104 + movs r0, 0xC + bl lcd_io_set + ldr r1, _0816D108 + movs r0, 0xA + bl lcd_io_set + movs r1, 0x90 + lsls r1, 8 + movs r0, 0x8 + bl lcd_io_set + ldr r0, _0816D10C + bl gpu_tile_obj_decompress_and_load + ldr r0, _0816D110 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0816D114 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0816D118 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0816D11C + bl gpu_pal_obj_alloc_and_load_multiple + ldr r4, _0816D120 + movs r3, 0xF0 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0x10 + bl CpuSet + movs r0, 0xE1 + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xF + bl CpuSet + movs r3, 0xD2 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0xE + bl CpuSet + movs r0, 0xC3 + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xD + bl CpuSet + movs r3, 0xB4 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0xC + bl CpuSet + movs r0, 0xA5 + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xB + bl CpuSet + movs r3, 0x96 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0xA + bl CpuSet + movs r0, 0x78 + movs r1, 0x50 + movs r2, 0 + bl sub_816FDB8 + movs r1, 0xE + negs r1, r1 + movs r0, 0x78 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0xEC + adds r2, r5, 0 + movs r3, 0x1 + bl sub_816F7D0 + ldr r2, _0816D124 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r0, _0816D128 + str r0, [r1] + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816D0BC: .4byte 0x0203bcc8 +_0816D0C0: .4byte 0x085e13b4 +_0816D0C4: .4byte 0x085e07c4 +_0816D0C8: .4byte 0x06008000 +_0816D0CC: .4byte 0x06008800 +_0816D0D0: .4byte 0x040000d4 +_0816D0D4: .4byte 0x81000400 +_0816D0D8: .4byte 0x085e0b78 +_0816D0DC: .4byte 0x06009000 +_0816D0E0: .4byte 0x06009800 +_0816D0E4: .4byte 0x085e0eac +_0816D0E8: .4byte 0x0600a000 +_0816D0EC: .4byte 0x0600a800 +_0816D0F0: .4byte 0x085e119c +_0816D0F4: .4byte 0x0600b000 +_0816D0F8: .4byte 0x0600b800 +_0816D0FC: .4byte 0x085e05c4 +_0816D100: .4byte 0x00009603 +_0816D104: .4byte 0x00009402 +_0816D108: .4byte 0x00009201 +_0816D10C: .4byte 0x085e4fdc +_0816D110: .4byte 0x085e4fec +_0816D114: .4byte 0x085e4ffc +_0816D118: .4byte 0x085e4a74 +_0816D11C: .4byte 0x085e4a84 +_0816D120: .4byte 0x02037914 +_0816D124: .4byte 0x03005e00 +_0816D128: .4byte task_intro_2 + 1 + thumb_func_end task_intro_1 + + thumb_func_start task_intro_2 +task_intro_2: @ 816D12C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r5, 0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _0816D180 + bl SetVBlankCallback + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r1, _0816D184 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816D188 + str r1, [r0] + ldr r0, _0816D18C + str r5, [r0] + movs r0, 0xCF + lsls r0, 1 + bl m4aSongNumStart + bl sub_800B628 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816D180: .4byte sub_816CBE8 + 1 +_0816D184: .4byte 0x03005e00 +_0816D188: .4byte task_intro_3 + 1 +_0816D18C: .4byte 0x030062a0 + thumb_func_end task_intro_2 + + thumb_func_start task_intro_3 +task_intro_3: @ 816D190 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, _0816D284 + ldr r0, [r5] + cmp r0, 0x4C + bne _0816D1BE + ldr r2, _0816D288 + ldr r1, _0816D28C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] +_0816D1BE: + ldr r0, [r5] + cmp r0, 0x80 + bne _0816D1CC + ldr r0, _0816D290 + movs r1, 0 + bl AddTask +_0816D1CC: + ldr r0, [r5] + cmp r0, 0xFB + bne _0816D1EE + ldr r2, _0816D288 + ldr r1, _0816D28C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x2E] +_0816D1EE: + ldr r1, [r5] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _0816D200 + ldr r0, _0816D294 + movs r1, 0 + bl AddTask +_0816D200: + ldr r1, [r5] + movs r0, 0xB8 + lsls r0, 1 + cmp r1, r0 + bne _0816D220 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x70 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x30 + movs r1, 0 + movs r3, 0x5 + bl sub_816F7D0 +_0816D220: + ldr r1, [r5] + movs r0, 0xC0 + lsls r0, 1 + cmp r1, r0 + bne _0816D240 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x80 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0xC8 + movs r1, 0x3C + movs r3, 0x9 + bl sub_816F7D0 +_0816D240: + ldr r0, [r5] + movs r4, 0x8C + lsls r4, 2 + cmp r0, r4 + bne _0816D252 + ldr r0, _0816D298 + movs r1, 0 + bl AddTask +_0816D252: + ldr r0, [r5] + cmp r0, r4 + bls _0816D27A + ldr r1, _0816D28C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x50 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r1, 0x18 + strh r1, [r0, 0xE] + strh r2, [r0, 0x10] + movs r1, 0x28 + strh r1, [r0, 0x12] + strh r2, [r0, 0x14] + ldr r1, _0816D29C + str r1, [r0] +_0816D27A: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816D284: .4byte 0x030062a0 +_0816D288: .4byte 0x02020630 +_0816D28C: .4byte 0x03005e00 +_0816D290: .4byte task_intro_3_1 + 1 +_0816D294: .4byte task_intro_3_2 + 1 +_0816D298: .4byte task_intro_3_3 + 1 +_0816D29C: .4byte task_intro_4 + 1 + thumb_func_end task_intro_3 + + thumb_func_start task_intro_3_3 +task_intro_3_3: @ 816D2A0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0816D2D4 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816D2C4 + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] +_0816D2C4: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816D2D8 + cmp r0, 0x1 + beq _0816D314 + b _0816D324 + .align 2, 0 +_0816D2D4: .4byte 0x03005e08 +_0816D2D8: + ldr r0, _0816D30C + ldr r2, _0816D310 + movs r1, 0x8 + ldrsh r3, [r4, r1] + lsls r3, 1 + adds r1, r3, r2 + ldrb r1, [r1] + adds r2, 0x1 + adds r3, r2 + ldrh r2, [r4, 0x6] + ldrb r3, [r3] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0xC + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0816D324 + .align 2, 0 +_0816D30C: .4byte 0x085e4ab8 +_0816D310: .4byte 0x085e4ad0 +_0816D314: + ldrh r0, [r4, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0816D324 + strh r0, [r4] +_0816D324: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0x3C + ble _0816D332 + adds r0, r5, 0 + bl remove_task +_0816D332: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_intro_3_3 + + thumb_func_start sub_816D338 +sub_816D338: @ 816D338 + 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, 0xC + bne _0816D350 + adds r0, r1, 0 + bl obj_delete_and_free_tiles +_0816D350: + pop {r0} + bx r0 + thumb_func_end sub_816D338 + + thumb_func_start task_intro_4 +task_intro_4: @ 816D354 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r1, r0, 24 + adds r4, r1, 0 + ldr r5, _0816D3F8 + ldr r2, [r5] + ldr r0, _0816D3FC + cmp r2, r0 + bhi _0816D418 + ldr r0, _0816D400 + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0xC] + adds r1, r0, r1 + ldr r0, _0816D404 + adds r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] + ldrh r1, [r4, 0xA] + movs r0, 0x1A + bl lcd_io_set + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x10] + adds r1, r0, r1 + ldr r0, _0816D408 + adds r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldrh r1, [r4, 0xE] + movs r0, 0x16 + bl lcd_io_set + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x14] + adds r1, r0, r1 + ldr r0, _0816D40C + adds r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0x12] + strh r1, [r4, 0x14] + ldrh r1, [r4, 0x12] + movs r0, 0x12 + bl lcd_io_set + ldr r1, [r5] + movs r0, 0xD0 + lsls r0, 2 + cmp r1, r0 + bne _0816D43E + ldr r0, _0816D410 + movs r1, 0x78 + movs r2, 0xA0 + movs r3, 0xA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0816D414 + 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] + b _0816D43E + .align 2, 0 +_0816D3F8: .4byte 0x030062a0 +_0816D3FC: .4byte 0x00000387 +_0816D400: .4byte 0x03005e00 +_0816D404: .4byte 0xffffa000 +_0816D408: .4byte 0xffff8000 +_0816D40C: .4byte 0xffff4000 +_0816D410: .4byte 0x085e4fc4 +_0816D414: .4byte 0x02020630 +_0816D418: + ldr r0, _0816D448 + cmp r2, r0 + bls _0816D43E + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816D44C + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _0816D450 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816D454 + str r1, [r0] +_0816D43E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816D448: .4byte 0x000003ef +_0816D44C: .4byte 0x0000ffff +_0816D450: .4byte 0x03005e00 +_0816D454: .4byte task_intro_5 + 1 + thumb_func_end task_intro_4 + + thumb_func_start task_intro_5 +task_intro_5: @ 816D458 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0816D47C + ldr r1, [r0] + ldr r0, _0816D480 + cmp r1, r0 + bls _0816D476 + ldr r0, _0816D484 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816D488 + str r0, [r1] +_0816D476: + pop {r0} + bx r0 + .align 2, 0 +_0816D47C: .4byte 0x030062a0 +_0816D480: .4byte 0x00000402 +_0816D484: .4byte 0x03005e00 +_0816D488: .4byte task_intro_6 + 1 + thumb_func_end task_intro_5 + + thumb_func_start task_intro_6 +task_intro_6: @ 816D48C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl intro_reset_and_hide_bgs + movs r0, 0 + bl SetVBlankCallback + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _0816D4D0 + movs r1, 0 + strh r1, [r0] + ldr r0, _0816D4D4 + strh r1, [r0] + ldr r0, _0816D4D8 + strh r1, [r0] + movs r0, 0x1 + bl load_intro_part2_graphics + ldr r1, _0816D4DC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816D4E0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816D4D0: .4byte 0x0203bd24 +_0816D4D4: .4byte 0x0203bd26 +_0816D4D8: .4byte 0x0203bccc +_0816D4DC: .4byte 0x03005e00 +_0816D4E0: .4byte task_intro_7 + 1 + thumb_func_end task_intro_6 + + thumb_func_start task_intro_7 +task_intro_7: @ 816D4E4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816D4FC + ldrh r0, [r0] + cmp r0, 0 + bne _0816D504 + ldr r0, _0816D500 + bl gpu_tile_obj_decompress_and_load + b _0816D50A + .align 2, 0 +_0816D4FC: .4byte 0x0203bcc8 +_0816D500: .4byte 0x085f52bc +_0816D504: + ldr r0, _0816D56C + bl gpu_tile_obj_decompress_and_load +_0816D50A: + ldr r0, _0816D570 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0816D574 + bl gpu_tile_obj_decompress_and_load + movs r6, 0 + lsls r7, r4, 2 + ldr r5, _0816D578 +_0816D51C: + lsls r0, r6, 3 + adds r0, r5 + bl gpu_tile_obj_decompress_and_load + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0816D51C + ldr r0, _0816D57C + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0816D580 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0816D584 + movs r5, 0x88 + lsls r5, 1 + adds r1, r5, 0 + movs r2, 0x80 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r0, _0816D588 + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x6E + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r0, _0816D58C + ldrh r0, [r0] + cmp r0, 0 + bne _0816D590 + adds r0, r5, 0 + movs r1, 0x64 + bl sub_817B834 + b _0816D598 + .align 2, 0 +_0816D56C: .4byte 0x085f52cc +_0816D570: .4byte 0x085f52dc +_0816D574: .4byte 0x085f52fc +_0816D578: .4byte 0x085e4ae8 +_0816D57C: .4byte 0x085f530c +_0816D580: .4byte 0x085e4b08 +_0816D584: .4byte 0x085e4bdc +_0816D588: .4byte 0x085e4ba4 +_0816D58C: .4byte 0x0203bcc8 +_0816D590: + adds r0, r5, 0 + movs r1, 0x64 + bl sub_817B88C +_0816D598: + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _0816D62C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r5, r2, 0 + adds r5, 0x1C + adds r3, r0, r5 + ldr r1, _0816D630 + str r1, [r3] + adds r2, 0x8 + adds r0, r2 + ldr r1, _0816D634 + str r1, [r0] + ldr r0, _0816D638 + adds r4, r7, r4 + lsls r4, 3 + adds r4, r0 + strh r6, [r4, 0xA] + ldr r0, _0816D63C + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x50 + movs r3, 0x4 + bl obj_add_from_template_forward_search + movs r0, 0x40 + negs r0, r0 + movs r1, 0x3C + bl sub_817B9C4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + ldr r1, _0816D640 + str r1, [r0] + strh r6, [r4, 0xC] + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816D644 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _0816D648 + bl SetVBlankCallback + movs r1, 0x80 + lsls r1, 7 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0x10 + bl sub_817B3DC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r0, 0x1 + bl sub_817B150 + ldr r0, _0816D64C + str r0, [r4] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816D62C: .4byte 0x02020630 +_0816D630: .4byte sub_816F9D4 + 1 +_0816D634: .4byte 0x085e4dc4 +_0816D638: .4byte 0x03005e00 +_0816D63C: .4byte 0x085e4b40 +_0816D640: .4byte sub_816FAB0 + 1 +_0816D644: .4byte 0x0000ffff +_0816D648: .4byte sub_816CBE8 + 1 +_0816D64C: .4byte task_intro_8 + 1 + thumb_func_end task_intro_7 + + thumb_func_start task_intro_8 +task_intro_8: @ 816D650 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, _0816D7B0 + ldr r1, [r5] + movs r0, 0xE8 + lsls r0, 3 + cmp r1, r0 + bne _0816D67C + ldr r1, _0816D7B4 + movs r0, 0x2 + strh r0, [r1] + ldr r1, _0816D7B8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl remove_task +_0816D67C: + ldr r1, [r5] + ldr r0, _0816D7BC + cmp r1, r0 + bls _0816D6A4 + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816D7C0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _0816D7B8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816D7C4 + str r1, [r0] +_0816D6A4: + ldr r1, [r5] + ldr r0, _0816D7C8 + ldr r3, _0816D7B8 + cmp r1, r0 + bne _0816D6C8 + ldr r2, _0816D7CC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] +_0816D6C8: + ldr r1, [r5] + ldr r0, _0816D7D0 + cmp r1, r0 + bne _0816D6EA + ldr r2, _0816D7CC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x2E] +_0816D6EA: + ldr r1, [r5] + ldr r0, _0816D7D4 + cmp r1, r0 + bne _0816D70C + ldr r2, _0816D7CC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xC + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] +_0816D70C: + ldr r1, [r5] + ldr r0, _0816D7D8 + cmp r1, r0 + bne _0816D72E + ldr r2, _0816D7CC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x2E] +_0816D72E: + ldr r1, [r5] + movs r0, 0xC5 + lsls r0, 3 + cmp r1, r0 + bne _0816D752 + ldr r2, _0816D7CC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strh r1, [r0, 0x2E] +_0816D752: + ldr r1, [r5] + ldr r0, _0816D7DC + cmp r1, r0 + bne _0816D774 + ldr r2, _0816D7CC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r4, 0xA + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x4 + strh r1, [r0, 0x2E] +_0816D774: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 18 + movs r1, 0x7F + ands r0, r1 + movs r1, 0x30 + bl sine + ldr r1, _0816D7E0 + strh r0, [r1] + ldrh r2, [r4, 0xE] + movs r7, 0xE + ldrsh r1, [r4, r7] + ldr r0, _0816D7E4 + cmp r1, r0 + bgt _0816D7A0 + adds r0, r2, 0x1 + strh r0, [r4, 0xE] +_0816D7A0: + movs r0, 0 + bl sub_817B540 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816D7B0: .4byte 0x030062a0 +_0816D7B4: .4byte 0x0203bd28 +_0816D7B8: .4byte 0x03005e00 +_0816D7BC: .4byte 0x0000079a +_0816D7C0: .4byte 0x0000ffff +_0816D7C4: .4byte task_intro_9 + 1 +_0816D7C8: .4byte 0x00000455 +_0816D7CC: .4byte 0x02020630 +_0816D7D0: .4byte 0x000004be +_0816D7D4: .4byte 0x00000572 +_0816D7D8: .4byte 0x00000576 +_0816D7DC: .4byte 0x000006bf +_0816D7E0: .4byte 0x0203bccc +_0816D7E4: .4byte 0x000001ff + thumb_func_end task_intro_8 + + thumb_func_start task_intro_9 +task_intro_9: @ 816D7E8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0816D80C + ldr r1, [r0] + ldr r0, _0816D810 + cmp r1, r0 + bls _0816D806 + ldr r0, _0816D814 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816D818 + str r0, [r1] +_0816D806: + pop {r0} + bx r0 + .align 2, 0 +_0816D80C: .4byte 0x030062a0 +_0816D810: .4byte 0x00000814 +_0816D814: .4byte 0x03005e00 +_0816D818: .4byte task_intro_10 + 1 + thumb_func_end task_intro_9 + + thumb_func_start sub_816D81C +sub_816D81C: @ 816D81C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x4 + strh r0, [r4, 0x34] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bls _0816D830 + b _0816D9BA +_0816D830: + lsls r0, 2 + ldr r1, _0816D83C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816D83C: .4byte _0816D840 + .align 2, 0 +_0816D840: + .4byte _0816D864 + .4byte _0816D87A + .4byte _0816D898 + .4byte _0816D8BC + .4byte _0816D8D8 + .4byte _0816D8FA + .4byte _0816D912 + .4byte _0816D96E + .4byte _0816D99C +_0816D864: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB3 + bgt _0816D874 + b _0816D9BA +_0816D874: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816D87A: + ldrh r0, [r4, 0x20] + subs r0, 0x4 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + beq _0816D88A + b _0816D9BA +_0816D88A: + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x30] + movs r0, 0x2 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D898: + ldrh r1, [r4, 0x20] + adds r1, 0x8 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7C + beq _0816D8AE + b _0816D9BA +_0816D8AE: + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x30] + movs r0, 0x3 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D8BC: + ldrh r0, [r4, 0x22] + adds r0, 0x4 + strh r0, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x50 + bne _0816D9BA + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0xA + strh r0, [r4, 0x30] + movs r0, 0x4 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D8D8: + ldrh r1, [r4, 0x20] + subs r1, 0x8 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3C + bne _0816D9BA + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0xA + strh r0, [r4, 0x30] + movs r0, 0x5 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D8FA: + ldrh r0, [r4, 0x20] + adds r0, 0x3C + strh r0, [r4, 0x20] + movs r0, 0xC0 + strh r0, [r4, 0x36] + movs r0, 0x80 + strh r0, [r4, 0x38] + movs r0, 0x3 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816D912: + ldrh r0, [r4, 0x36] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3C + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x36] + adds r1, 0x2 + strh r1, [r4, 0x36] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + strh r0, [r4, 0x38] + movs r0, 0xFF + ands r1, r0 + cmp r1, 0x40 + bne _0816D9BA + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0816D9BA + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + b _0816D9B8 +_0816D96E: + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + strh r0, [r4, 0x38] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0816D9BA + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _0816D9BA +_0816D99C: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _0816D9BA + ldrh r0, [r4, 0x32] +_0816D9B8: + strh r0, [r4, 0x2E] +_0816D9BA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816D81C + + thumb_func_start sub_816D9C0 +sub_816D9C0: @ 816D9C0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _0816D9CE + b _0816DADA +_0816D9CE: + lsls r0, 2 + ldr r1, _0816D9D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816D9D8: .4byte _0816D9DC + .align 2, 0 +_0816D9DC: + .4byte _0816D9F4 + .4byte _0816DA08 + .4byte _0816DA20 + .4byte _0816DA64 + .4byte _0816DA9A + .4byte _0816DACA +_0816D9F4: + ldr r0, _0816DA04 + ldr r1, [r0] + movs r0, 0x99 + lsls r0, 3 + cmp r1, r0 + bne _0816DADA + b _0816DABA + .align 2, 0 +_0816DA04: .4byte 0x030062a0 +_0816DA08: + ldr r0, _0816DA1C + ldr r1, [r0] + movs r0, 0xC5 + lsls r0, 3 + cmp r1, r0 + bne _0816DA70 + adds r0, r4, 0 + movs r1, 0 + b _0816DABE + .align 2, 0 +_0816DA1C: .4byte 0x030062a0 +_0816DA20: + ldr r0, _0816DA48 + ldr r1, [r0] + ldr r0, _0816DA4C + cmp r1, r0 + beq _0816DA50 + ldrh r0, [r4, 0x30] + adds r2, r0, 0 + adds r2, 0x20 + strh r2, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0816DADA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _0816DA8A + .align 2, 0 +_0816DA48: .4byte 0x030062a0 +_0816DA4C: .4byte 0x000006c7 +_0816DA50: + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x50 + strh r0, [r4, 0x32] + b _0816DADA +_0816DA64: + ldrh r0, [r4, 0x32] + subs r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + beq _0816DA94 +_0816DA70: + ldrh r0, [r4, 0x30] + adds r2, r0, 0 + adds r2, 0x40 + strh r2, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0816DADA + ldrh r0, [r4, 0x20] + subs r0, 0x1 +_0816DA8A: + strh r0, [r4, 0x20] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x30] + b _0816DADA +_0816DA94: + adds r0, r4, 0 + movs r1, 0x2 + b _0816DABE +_0816DA9A: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0816DAAE + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] +_0816DAAE: + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0xA8 + lsls r0, 1 + cmp r1, r0 + ble _0816DADA +_0816DABA: + adds r0, r4, 0 + movs r1, 0x1 +_0816DABE: + bl obj_anim_image_start + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816DADA +_0816DACA: + ldr r0, _0816DAE0 + ldr r1, [r0] + ldr r0, _0816DAE4 + cmp r1, r0 + bls _0816DADA + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] +_0816DADA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816DAE0: .4byte 0x030062a0 +_0816DAE4: .4byte 0x0000073f + thumb_func_end sub_816D9C0 + + thumb_func_start sub_816DAE8 +sub_816DAE8: @ 816DAE8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816DB1C + cmp r0, 0x1 + bgt _0816DAFE + cmp r0, 0 + beq _0816DB04 + b _0816DBA4 +_0816DAFE: + cmp r0, 0x2 + beq _0816DB42 + b _0816DBA4 +_0816DB04: + ldr r0, _0816DB18 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 3 + cmp r1, r0 + bne _0816DBA4 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816DBA4 + .align 2, 0 +_0816DB18: .4byte 0x030062a0 +_0816DB1C: + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] + ldr r0, _0816DB5C + ldr r1, [r0] + movs r0, 0x92 + lsls r0, 3 + cmp r1, r0 + bne _0816DBA4 + ldrh r0, [r4, 0x22] + subs r0, 0xC + strh r0, [r4, 0x22] + movs r0, 0x80 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816DB42: + movs r2, 0x20 + ldrsh r0, [r4, r2] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _0816DB60 + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _0816DBA4 + .align 2, 0 +_0816DB5C: .4byte 0x030062a0 +_0816DB60: + ldrh r0, [r4, 0x30] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x3F + bgt _0816DB72 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x10 + b _0816DB84 +_0816DB72: + cmp r1, 0x40 + bne _0816DB7C + ldrh r0, [r4, 0x20] + subs r0, 0x30 + strh r0, [r4, 0x20] +_0816DB7C: + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x40 +_0816DB84: + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xC + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0816DBA4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816DAE8 + + thumb_func_start task_intro_10 +task_intro_10: @ 816DBAC + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl intro_reset_and_hide_bgs + ldr r0, _0816DC3C + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0816DC40 + ldr r1, _0816DC44 + bl LZ77UnCompVram + ldr r0, _0816DC48 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl gpu_pal_apply + ldr r0, _0816DC4C + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r5, 0 + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + movs r0, 0x78 + movs r1, 0x50 + movs r2, 0 + movs r3, 0 + bl sub_816F2A8 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816DC50 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _0816DC54 + movs r0, 0xC + bl lcd_io_set + ldr r1, _0816DC58 + movs r0, 0 + bl lcd_io_set + ldr r0, _0816DC5C + str r0, [r4] + ldr r0, _0816DC60 + str r5, [r0] + movs r0, 0xDD + lsls r0, 1 + bl m4aSongNumStart + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816DC3C: .4byte 0x085e3854 +_0816DC40: .4byte 0x085e3724 +_0816DC44: .4byte 0x06004000 +_0816DC48: .4byte 0x085e3524 +_0816DC4C: .4byte 0x03005e00 +_0816DC50: .4byte 0x0000ffff +_0816DC54: .4byte 0x00004883 +_0816DC58: .4byte 0x00001441 +_0816DC5C: .4byte task_intro_11 + 1 +_0816DC60: .4byte 0x030062a0 + thumb_func_end task_intro_10 + + thumb_func_start task_intro_11 +task_intro_11: @ 816DC64 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _0816DC9C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + movs r1, 0x80 + lsls r1, 3 + adds r0, r1, 0 + ldrh r1, [r3, 0x8] + adds r0, r1 + strh r0, [r3, 0x8] + ldrh r4, [r3, 0xA] + movs r0, 0xA + ldrsh r1, [r3, r0] + ldr r0, _0816DCA0 + cmp r1, r0 + bgt _0816DCA4 + ldrh r0, [r3, 0xC] + adds r1, r4, r0 + strh r1, [r3, 0xA] + adds r0, 0x2 + strh r0, [r3, 0xC] + b _0816DCA8 + .align 2, 0 +_0816DC9C: .4byte 0x03005e00 +_0816DCA0: .4byte 0x000006bf +_0816DCA4: + ldr r0, _0816DCF0 + str r0, [r3] +_0816DCA8: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r2 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldrh r3, [r4, 0x8] + movs r0, 0x78 + movs r1, 0x50 + bl sub_816F2A8 + ldr r0, _0816DCF4 + ldr r0, [r0] + cmp r0, 0x1C + bne _0816DCE6 + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816DCF8 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0816DCE6: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816DCF0: .4byte task_intro_12 + 1 +_0816DCF4: .4byte 0x030062a0 +_0816DCF8: .4byte 0x0000ffff + thumb_func_end task_intro_11 + + thumb_func_start task_intro_12 +task_intro_12: @ 816DCFC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0816DD1C + ldr r0, [r0] + cmp r0, 0x2B + bls _0816DD18 + ldr r0, _0816DD20 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816DD24 + str r0, [r1] +_0816DD18: + pop {r0} + bx r0 + .align 2, 0 +_0816DD1C: .4byte 0x030062a0 +_0816DD20: .4byte 0x03005e00 +_0816DD24: .4byte task_intro_13 + 1 + thumb_func_end task_intro_12 + + thumb_func_start task_intro_13 +task_intro_13: @ 816DD28 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0816DD9C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816DD94 + bl intro_reset_and_hide_bgs + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _0816DDA0 + movs r0, 0x8 + strb r0, [r1] + ldr r0, _0816DDA4 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + ldr r0, _0816DDA8 + ldr r1, _0816DDAC + bl call_LZZUnCompVram + ldr r0, _0816DDB0 + ldr r1, _0816DDB4 + bl call_LZZUnCompVram + ldr r0, _0816DDB8 + ldr r1, _0816DDBC + bl call_LZZUnCompVram + ldr r0, _0816DDC0 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _0816DDC4 + bl gpu_pal_obj_decompress_and_apply3 + ldr r0, _0816DDC8 + ldr r1, _0816DDCC + movs r2, 0x80 + lsls r2, 1 + bl CpuSet + ldr r1, _0816DDD0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816DDD4 + str r1, [r0] +_0816DD94: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816DD9C: .4byte 0x02037fd4 +_0816DDA0: .4byte 0x0300301c +_0816DDA4: .4byte 0x08d88494 +_0816DDA8: .4byte 0x08d88d40 +_0816DDAC: .4byte 0x0600c000 +_0816DDB0: .4byte 0x08d89f7c +_0816DDB4: .4byte 0x06004000 +_0816DDB8: .4byte 0x08d8a818 +_0816DDBC: .4byte 0x0600e000 +_0816DDC0: .4byte 0x08524d14 +_0816DDC4: .4byte 0x0852561c +_0816DDC8: .4byte 0x08d85cd0 +_0816DDCC: .4byte 0x02037714 +_0816DDD0: .4byte 0x03005e00 +_0816DDD4: .4byte task_intro_14 + 1 + thumb_func_end task_intro_13 + + thumb_func_start task_intro_14 +task_intro_14: @ 816DDD8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0xA0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + ldr r1, _0816DE5C + movs r0, 0xC + bl lcd_io_set + ldr r1, _0816DE60 + movs r0, 0xA + bl lcd_io_set + ldr r1, _0816DE64 + movs r0, 0 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816DE68 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _0816DE6C + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, _0816DE70 + strh r0, [r4, 0xA] + ldr r1, _0816DE74 + strh r1, [r4, 0xC] + movs r2, 0x80 + lsls r2, 1 + strh r2, [r4, 0xE] + movs r3, 0 + bl sub_816F2A8 + ldr r0, _0816DE78 + str r0, [r4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816DE5C: .4byte 0x0000b880 +_0816DE60: .4byte 0x00001c05 +_0816DE64: .4byte 0x00003641 +_0816DE68: .4byte 0x0000ffff +_0816DE6C: .4byte 0x03005e00 +_0816DE70: .4byte 0x0000ffa0 +_0816DE74: .4byte 0x0000ff51 +_0816DE78: .4byte task_intro_15 + 1 + thumb_func_end task_intro_14 + + thumb_func_start task_intro_15 +task_intro_15: @ 816DE7C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0816DEB4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r2, [r4, 0x8] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + beq _0816DEB8 + adds r0, r2, 0x4 + strh r0, [r4, 0x8] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r1, 8 + adds r0, r2, 0 + subs r0, 0x9C + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + b _0816DEC6 + .align 2, 0 +_0816DEB4: .4byte 0x03005e00 +_0816DEB8: + movs r1, 0x82 + lsls r1, 6 + movs r0, 0x44 + bl lcd_io_set + ldr r0, _0816DECC + str r0, [r4] +_0816DEC6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816DECC: .4byte task_intro_16 + 1 + thumb_func_end task_intro_15 + + thumb_func_start task_intro_16 +task_intro_16: @ 816DED0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0816DEE4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _0816DEE8 + str r0, [r1] + bx lr + .align 2, 0 +_0816DEE4: .4byte 0x03005e00 +_0816DEE8: .4byte task_intro_17 + 1 + thumb_func_end task_intro_16 + + thumb_func_start task_intro_17 +task_intro_17: @ 816DEEC + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0816DF24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + ldr r0, _0816DF28 + str r0, [r1] + movs r0, 0x1 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x4 + movs r3, 0x4 + bl sub_80BA384 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_0816DF24: .4byte 0x03005e00 +_0816DF28: .4byte task_intro_18 + 1 + thumb_func_end task_intro_17 + + thumb_func_start task_intro_18 +task_intro_18: @ 816DF2C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0816DF8C + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _0816DF62 + ldrh r0, [r4, 0xA] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816DF62 + ldrh r0, [r4, 0x8] + movs r1, 0x3 + eors r0, r1 + strh r0, [r4, 0x8] +_0816DF62: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0x8] + ldrh r2, [r4, 0x4] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r4, 0x6] + movs r3, 0 + bl sub_816F2A8 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bls _0816DF80 + b _0816E176 +_0816DF80: + lsls r0, 2 + ldr r1, _0816DF90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816DF8C: .4byte 0x03005e08 +_0816DF90: .4byte _0816DF94 + .align 2, 0 +_0816DF94: + .4byte _0816DFBC + .4byte _0816DFE6 + .4byte _0816E024 + .4byte _0816E038 + .4byte _0816E07C + .4byte _0816E09A + .4byte _0816E0C8 + .4byte _0816E0DE + .4byte _0816E13C + .4byte _0816E156 +_0816DFBC: + ldrh r0, [r4, 0x2] + adds r0, 0x10 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA0 + beq _0816DFCC + b _0816E176 +_0816DFCC: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0x2 + strh r0, [r4, 0xC] + movs r2, 0xF1 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r4, 0xE] + adds r0, r5, 0 + bl sub_816E190 + b _0816E176 +_0816DFE6: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816DFF4 + b _0816E176 +_0816DFF4: + movs r0, 0x2 + strh r0, [r4, 0xC] + movs r1, 0xE + ldrsh r0, [r4, r1] + ldr r1, _0816E01C + adds r0, r1 + ldr r1, _0816E020 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0xE] + adds r0, 0x2 + strh r0, [r4, 0xE] + lsls r0, 16 + movs r1, 0xF6 + lsls r1, 17 + cmp r0, r1 + beq _0816E01A + b _0816E176 +_0816E01A: + b _0816E14E + .align 2, 0 +_0816E01C: .4byte 0x08d85cd0 +_0816E020: .4byte 0x02037b52 +_0816E024: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E032 + b _0816E176 +_0816E032: + movs r0, 0x2 + strh r0, [r4, 0xC] + b _0816E14E +_0816E038: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E046 + b _0816E176 +_0816E046: + movs r0, 0x2 + strh r0, [r4, 0xC] + movs r2, 0xE + ldrsh r0, [r4, r2] + ldr r1, _0816E074 + adds r0, r1 + ldr r1, _0816E078 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0xE] + subs r0, 0x2 + strh r0, [r4, 0xE] + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 17 + cmp r0, r1 + beq _0816E06C + b _0816E176 +_0816E06C: + movs r0, 0x8 + strh r0, [r4, 0xC] + b _0816E14E + .align 2, 0 +_0816E074: .4byte 0x08d85cd0 +_0816E078: .4byte 0x02037b52 +_0816E07C: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816E176 + movs r1, 0x60 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r4, 0x2] + movs r0, 0xA9 + strh r0, [r4, 0x4] + movs r0, 0x3 + strh r0, [r4, 0xC] + b _0816E14E +_0816E09A: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0816E176 + movs r0, 0x50 + strh r0, [r4, 0x2] + movs r0, 0x29 + strh r0, [r4, 0x4] + movs r0, 0x10 + strh r0, [r4, 0xC] + ldr r0, _0816E0C4 + str r1, [sp] + movs r1, 0 + movs r2, 0x64 + movs r3, 0xA + bl sub_80A344C + b _0816E14E + .align 2, 0 +_0816E0C4: .4byte 0x00000195 +_0816E0C8: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816E176 + movs r0, 0x50 + strh r0, [r4, 0x2] + movs r0, 0x28 + strh r0, [r4, 0x4] + b _0816E14E +_0816E0DE: + ldrh r0, [r4, 0x2] + adds r0, 0x4 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + adds r0, 0x4 + strh r0, [r4, 0x4] + ldr r2, _0816E134 + adds r0, r2, 0 + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + lsrs r0, 8 + movs r1, 0x40 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r4, 0x6] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + bne _0816E176 + movs r0, 0x2 + negs r0, r0 + ldr r1, _0816E138 + str r1, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + strh r5, [r4, 0x6] + movs r0, 0 + strh r0, [r4, 0x8] + b _0816E14E + .align 2, 0 +_0816E134: .4byte 0x00000666 +_0816E138: .4byte 0x00007fff +_0816E13C: + ldrh r1, [r4, 0x6] + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816E14E + adds r0, r1, 0 + subs r0, 0x8 + strh r0, [r4, 0x6] + b _0816E176 +_0816E14E: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0816E176 +_0816E156: + ldr r0, _0816E180 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816E176 + ldr r1, _0816E184 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816E188 + str r1, [r0] + ldr r1, _0816E18C + movs r0, 0x3 + strb r0, [r1, 0x15] +_0816E176: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816E180: .4byte 0x02037fd4 +_0816E184: .4byte 0x03005e00 +_0816E188: .4byte task_intro_19 + 1 +_0816E18C: .4byte 0x02039b28 + thumb_func_end task_intro_18 + + thumb_func_start sub_816E190 +sub_816E190: @ 816E190 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r6, _0816E1E8 + ldr r5, _0816E1EC +_0816E19C: + movs r0, 0 + ldrsh r1, [r5, r0] + lsls r3, r4, 24 + lsrs r3, 24 + ldr r0, _0816E1F0 + movs r2, 0xA0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, _0816E1F4 + str r1, [r0] + adds r2, r6 + ldrb r0, [r2, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2, 0x5] + strh r4, [r2, 0x30] + strh r7, [r2, 0x36] + ldrb r1, [r5, 0x2] + adds r0, r2, 0 + bl obj_anim_image_start + adds r5, 0x6 + adds r4, 0x1 + cmp r4, 0x5 + ble _0816E19C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816E1E8: .4byte 0x02020630 +_0816E1EC: .4byte 0x085e4c64 +_0816E1F0: .4byte 0x08596c10 +_0816E1F4: .4byte sub_816E1F8 + 1 + thumb_func_end sub_816E190 + + thumb_func_start sub_816E1F8 +sub_816E1F8: @ 816E1F8 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + ldrh r0, [r3, 0x34] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816E214 + ldrh r0, [r3, 0x26] + movs r1, 0x3 + eors r0, r1 + strh r0, [r3, 0x26] +_0816E214: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0816E222 + cmp r0, 0x1 + beq _0816E278 + b _0816E29C +_0816E222: + ldr r2, _0816E270 + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r2, 0x4 + adds r0, r2 + ldrh r2, [r0] + ldrh r1, [r3, 0x32] + adds r2, r1 + strh r2, [r3, 0x32] + movs r0, 0x32 + ldrsh r1, [r3, r0] + movs r0, 0xFF + lsls r0, 8 + ands r1, r0 + asrs r1, 8 + ldrh r0, [r3, 0x22] + subs r0, r1 + strh r0, [r3, 0x22] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x32] + ldr r2, _0816E274 + movs r0, 0x36 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + ble _0816E29C + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _0816E29C + .align 2, 0 +_0816E270: .4byte 0x085e4c64 +_0816E274: .4byte 0x03005e00 +_0816E278: + ldrh r1, [r3, 0x20] + movs r2, 0x20 + ldrsh r0, [r3, r2] + cmp r0, 0x77 + bgt _0816E286 + subs r0, r1, 0x2 + b _0816E288 +_0816E286: + adds r0, r1, 0x2 +_0816E288: + strh r0, [r3, 0x20] + ldrh r1, [r3, 0x22] + movs r2, 0x22 + ldrsh r0, [r3, r2] + cmp r0, 0x4F + bgt _0816E298 + subs r0, r1, 0x2 + b _0816E29A +_0816E298: + adds r0, r1, 0x2 +_0816E29A: + strh r0, [r3, 0x22] +_0816E29C: + pop {r0} + bx r0 + thumb_func_end sub_816E1F8 + + thumb_func_start task_intro_19 +task_intro_19: @ 816E2A0 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl reset_all_obj_data + ldr r0, _0816E330 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + ldr r0, _0816E334 + ldr r1, _0816E338 + bl call_LZZUnCompVram + ldr r0, _0816E33C + ldr r1, _0816E340 + bl call_LZZUnCompVram + ldr r0, _0816E344 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0816E348 + bl gpu_pal_obj_alloc_tag_and_apply + movs r0, 0x2 + negs r0, r0 + ldr r1, _0816E34C + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _0816E350 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0816E354 + str r0, [r1] + movs r4, 0 + strh r4, [r1, 0x8] + movs r0, 0xA8 + lsls r0, 1 + strh r0, [r1, 0xA] + movs r2, 0x50 + strh r2, [r1, 0xC] + movs r2, 0x10 + strh r2, [r1, 0x14] + adds r2, 0xF0 + strh r2, [r1, 0xE] + movs r1, 0x50 + movs r3, 0 + bl sub_816F2A8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x4 + movs r3, 0x4 + bl sub_80BA384 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816E330: .4byte 0x08d89224 +_0816E334: .4byte 0x08d89abc +_0816E338: .4byte 0x0600c000 +_0816E33C: .4byte 0x08d8a934 +_0816E340: .4byte 0x0600e000 +_0816E344: .4byte 0x085e4c88 +_0816E348: .4byte 0x085e4c98 +_0816E34C: .4byte 0x0000ffff +_0816E350: .4byte 0x03005e00 +_0816E354: .4byte task_intro_20 + 1 + thumb_func_end task_intro_19 + + thumb_func_start task_intro_20 +task_intro_20: @ 816E358 + 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, _0816E38C + adds r5, r0, r1 + ldrh r0, [r5, 0x2] + ldrh r1, [r5, 0x4] + ldrh r2, [r5, 0x6] + movs r3, 0 + bl sub_816F2A8 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0xD + bls _0816E380 + b _0816E6BC +_0816E380: + lsls r0, 2 + ldr r1, _0816E390 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816E38C: .4byte 0x03005e08 +_0816E390: .4byte _0816E394 + .align 2, 0 +_0816E394: + .4byte _0816E3CC + .4byte _0816E3E0 + .4byte _0816E43C + .4byte _0816E488 + .4byte _0816E4C4 + .4byte _0816E4EC + .4byte _0816E544 + .4byte _0816E560 + .4byte _0816E5A0 + .4byte _0816E5BC + .4byte _0816E5FC + .4byte _0816E61A + .4byte _0816E664 + .4byte _0816E69C +_0816E3CC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E3DA + b _0816E6BC +_0816E3DA: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0816E3E0: + ldrh r0, [r5, 0xC] + adds r0, 0x4 + strh r0, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + movs r1, 0x80 + lsls r1, 1 + bl sine + ldr r1, _0816E438 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r1 + movs r2, 0xAC + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + strh r1, [r4, 0xA] + movs r1, 0xC + ldrsh r0, [r5, r1] + movs r1, 0x40 + bl cosine + movs r1, 0x54 + subs r1, r0 + strh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x40 + beq _0816E420 + b _0816E6BC +_0816E420: + movs r0, 0x19 + strh r0, [r5, 0xC] + movs r0, 0x1 + strh r0, [r5, 0xE] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0 + bl sub_816E6D4 + b _0816E6BC + .align 2, 0 +_0816E438: .4byte 0x03005e00 +_0816E43C: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E44A + b _0816E6BC +_0816E44A: + ldr r0, _0816E480 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r2, [r1, 0xA] + adds r0, r2 + strh r0, [r1, 0xA] + ldr r2, _0816E484 + adds r0, r2, 0 + ldrh r2, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xC] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0 + bl sub_816E6D4 + bl sub_816E74C + b _0816E6BC + .align 2, 0 +_0816E480: .4byte 0x03005e00 +_0816E484: .4byte 0xfffffefe +_0816E488: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E496 + b _0816E6BC +_0816E496: + ldr r0, _0816E4BC + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r2, _0816E4C0 + adds r0, r2, 0 + ldrh r2, [r1, 0xA] + adds r0, r2 + strh r0, [r1, 0xA] + movs r2, 0x81 + lsls r2, 1 + adds r0, r2, 0 + ldrh r2, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xC] + b _0816E690 + .align 2, 0 +_0816E4BC: .4byte 0x03005e00 +_0816E4C0: .4byte 0xffffff00 +_0816E4C4: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E4D2 + b _0816E6BC +_0816E4D2: + ldr r1, _0816E4E8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + subs r1, 0xFC + strh r1, [r0, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xC] + b _0816E690 + .align 2, 0 +_0816E4E8: .4byte 0x03005e00 +_0816E4EC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E4FA + b _0816E6BC +_0816E4FA: + ldr r0, _0816E524 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0xFC + strh r0, [r1, 0xC] + ldrh r2, [r5, 0xE] + movs r0, 0xE + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0816E528 + movs r0, 0xC + strh r0, [r5, 0xC] + subs r0, r2, 0x1 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5] + b _0816E6BC + .align 2, 0 +_0816E524: .4byte 0x03005e00 +_0816E528: + movs r0, 0x1 + strh r0, [r5, 0xC] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0xCA + lsls r0, 1 + str r1, [sp] + movs r1, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _0816E6BC +_0816E544: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E552 + b _0816E6BC +_0816E552: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r1, 0xF5 + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r5, 0xE] + b _0816E690 +_0816E560: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E56E + b _0816E6BC +_0816E56E: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r2, 0xE + ldrsh r0, [r5, r2] + ldr r1, _0816E598 + adds r0, r1 + ldr r1, _0816E59C + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0xE] + subs r0, 0x2 + strh r0, [r5, 0xE] + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 17 + cmp r0, r1 + beq _0816E594 + b _0816E6BC +_0816E594: + b _0816E690 + .align 2, 0 +_0816E598: .4byte 0x08d85cd0 +_0816E59C: .4byte 0x02037b72 +_0816E5A0: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E5AE + b _0816E6BC +_0816E5AE: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r1, 0xF1 + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r5, 0xE] + b _0816E690 +_0816E5BC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816E6BC + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r2, 0xE + ldrsh r0, [r5, r2] + ldr r1, _0816E5F4 + adds r0, r1 + ldr r1, _0816E5F8 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0xE] + adds r0, 0x2 + strh r0, [r5, 0xE] + lsls r0, 16 + movs r1, 0xF7 + lsls r1, 17 + cmp r0, r1 + bne _0816E6BC + movs r0, 0x10 + strh r0, [r5, 0xC] + b _0816E690 + .align 2, 0 +_0816E5F4: .4byte 0x08d85cd0 +_0816E5F8: .4byte 0x02037b72 +_0816E5FC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0816E6BC + strh r0, [r5, 0xC] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + adds r0, r6, 0 + bl sub_816E6D4 + b _0816E6BC +_0816E61A: + ldrh r0, [r5, 0xC] + adds r0, 0x4 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x6] + subs r0, 0x8 + strh r0, [r5, 0x6] + movs r1, 0xC + ldrsh r0, [r5, r1] + movs r1, 0x3C + bl sine + ldr r2, _0816E65C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + adds r0, 0x58 + strh r0, [r1, 0xA] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x40 + bne _0816E6BC + movs r0, 0x2 + negs r0, r0 + ldr r1, _0816E660 + str r1, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _0816E690 + .align 2, 0 +_0816E65C: .4byte 0x03005e00 +_0816E660: .4byte 0x00007fff +_0816E664: + ldrh r0, [r5, 0xC] + adds r0, 0x4 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x6] + subs r0, 0x8 + strh r0, [r5, 0x6] + movs r1, 0xC + ldrsh r0, [r5, r1] + movs r1, 0x14 + bl sine + ldr r2, _0816E698 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + adds r0, 0x80 + strh r0, [r1, 0xA] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x80 + bne _0816E6BC +_0816E690: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0816E6BC + .align 2, 0 +_0816E698: .4byte 0x03005e00 +_0816E69C: + ldr r0, _0816E6C4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816E6BC + ldr r1, _0816E6C8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816E6CC + str r1, [r0] + ldr r1, _0816E6D0 + movs r0, 0x3 + strb r0, [r1, 0x15] +_0816E6BC: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816E6C4: .4byte 0x02037fd4 +_0816E6C8: .4byte 0x03005e00 +_0816E6CC: .4byte task_intro_21 + 1 +_0816E6D0: .4byte 0x02039b28 + thumb_func_end task_intro_20 + + thumb_func_start sub_816E6D4 +sub_816E6D4: @ 816E6D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r7, _0816E740 + ldr r0, _0816E744 + mov r9, r0 + adds r4, r7, 0 + movs r6, 0 +_0816E6EE: + movs r3, 0 + ldrsh r1, [r4, r3] + adds r0, r7, 0x2 + adds r0, r6, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r3, r5, 24 + lsrs r3, 24 + ldr r0, _0816E748 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + mov r0, r8 + strh r0, [r2, 0x38] + ldrh r0, [r4, 0x4] + strh r0, [r2, 0x3A] + movs r0, 0x40 + strh r0, [r2, 0x3C] + adds r4, 0x6 + adds r6, 0x6 + adds r5, 0x1 + cmp r5, 0x5 + ble _0816E6EE + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816E740: .4byte 0x085e4ca8 +_0816E744: .4byte 0x02020630 +_0816E748: .4byte 0x085e4d14 + thumb_func_end sub_816E6D4 + + thumb_func_start sub_816E74C +sub_816E74C: @ 816E74C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r7, _0816E7A8 + adds r4, r7, 0x4 + movs r6, 0x24 + ldr r0, _0816E7AC + mov r8, r0 +_0816E75E: + movs r3, 0x20 + ldrsh r1, [r4, r3] + adds r0, r7, 0x2 + adds r0, r6, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r3, r5, 24 + lsrs r3, 24 + ldr r0, _0816E7B0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r4] + strh r0, [r2, 0x3A] + movs r0, 0x40 + strh r0, [r2, 0x3C] + adds r4, 0x6 + adds r6, 0x6 + adds r5, 0x1 + cmp r5, 0x5 + ble _0816E75E + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816E7A8: .4byte 0x085e4ca8 +_0816E7AC: .4byte 0x02020630 +_0816E7B0: .4byte 0x085e4d14 + thumb_func_end sub_816E74C + + thumb_func_start sub_816E7B4 +sub_816E7B4: @ 816E7B4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816E7C6 + cmp r0, 0x1 + beq _0816E84C + b _0816E882 +_0816E7C6: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0816E80A + ldrh r0, [r4, 0x30] + adds r0, 0xB + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x30 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + 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 _0816E82A + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _0816E82A +_0816E80A: + subs r0, r1, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _0816E82A + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0816E82A: + ldr r2, _0816E848 + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0xB + ble _0816E882 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816E882 + .align 2, 0 +_0816E848: .4byte 0x03005e00 +_0816E84C: + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x77 + bgt _0816E85A + subs r0, r1, 0x3 + b _0816E85C +_0816E85A: + adds r0, r1, 0x3 +_0816E85C: + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x4F + bgt _0816E86C + subs r0, r1, 0x3 + b _0816E86E +_0816E86C: + adds r0, r1, 0x3 +_0816E86E: + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x22] + subs r0, 0x14 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8C + bls _0816E882 + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0816E882: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816E7B4 + + thumb_func_start task_intro_21 +task_intro_21: @ 816E888 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x50 + movs r1, 0x87 + bl lcd_io_set + ldr r1, _0816E92C + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0x1F + bl lcd_io_set + movs r1, 0xB0 + lsls r1, 7 + movs r0, 0x8 + bl lcd_io_set + ldr r1, _0816E930 + movs r0, 0xA + bl lcd_io_set + ldr r1, _0816E934 + movs r0, 0xC + bl lcd_io_set + movs r1, 0xDD + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0x50 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + ldr r1, _0816E938 + movs r0, 0x14 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + ldr r4, _0816E93C + movs r1, 0xC0 + lsls r1, 19 + adds r0, r4, 0 + bl call_LZZUnCompVram + ldr r1, _0816E940 + adds r0, r4, 0 + bl call_LZZUnCompVram + ldr r0, _0816E944 + ldr r1, _0816E948 + bl call_LZZUnCompVram + ldr r1, _0816E94C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816E950 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816E92C: .4byte 0x00001f1f +_0816E930: .4byte 0x00005a04 +_0816E934: .4byte 0x00001c06 +_0816E938: .4byte 0x0000ffb0 +_0816E93C: .4byte 0x08d8aa54 +_0816E940: .4byte 0x06004000 +_0816E944: .4byte 0x08d8b6e8 +_0816E948: .4byte 0x0600e000 +_0816E94C: .4byte 0x03005e00 +_0816E950: .4byte task_intro_22 + 1 + thumb_func_end task_intro_21 + + thumb_func_start task_intro_22 +task_intro_22: @ 816E954 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0816E980 + ldr r1, _0816E984 + bl call_LZZUnCompVram + ldr r0, _0816E988 + ldr r1, _0816E98C + bl call_LZZUnCompVram + ldr r1, _0816E990 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816E994 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816E980: .4byte 0x08d8b180 +_0816E984: .4byte 0x0600c000 +_0816E988: .4byte 0x08d8b440 +_0816E98C: .4byte 0x0600d000 +_0816E990: .4byte 0x03005e00 +_0816E994: .4byte task_intro_23 + 1 + thumb_func_end task_intro_22 + + thumb_func_start task_intro_23 +task_intro_23: @ 816E998 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r1, _0816E9D4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816E9D8 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0x8] + movs r1, 0x10 + strh r1, [r0, 0x14] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816E9D4: .4byte 0x03005e00 +_0816E9D8: .4byte task_intro_24 + 1 + thumb_func_end task_intro_23 + + thumb_func_start task_intro_24 +task_intro_24: @ 816E9DC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, _0816EA20 + adds r4, r5, r6 + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x10 + bl lcd_io_set + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 24 + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x14 + bl lcd_io_set + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816EA24 + cmp r0, 0x1 + beq _0816EA58 + b _0816EAA6 + .align 2, 0 +_0816EA20: .4byte 0x03005e08 +_0816EA24: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EAA6 + movs r0, 0x2 + negs r0, r0 + ldr r1, _0816EA54 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r2, 0xA0 + lsls r2, 7 + adds r0, r2, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0816EAA6 + .align 2, 0 +_0816EA54: .4byte 0x0000ffff +_0816EA58: + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r0, 0xA0 + lsls r0, 6 + cmp r1, r0 + bne _0816EA74 + ldr r0, _0816EA88 + ldr r1, _0816EA8C + str r1, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0816EA74: + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816EA90 + adds r0, r1, 0 + subs r0, 0x80 + strh r0, [r4, 0xC] + b _0816EAA6 + .align 2, 0 +_0816EA88: .4byte 0x0000fffe +_0816EA8C: .4byte 0x00002949 +_0816EA90: + ldr r0, _0816EAB0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816EAA6 + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, _0816EAB4 + str r1, [r0] +_0816EAA6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816EAB0: .4byte 0x02037fd4 +_0816EAB4: .4byte task_intro_25 + 1 + thumb_func_end task_intro_24 + + thumb_func_start task_intro_25 +task_intro_25: @ 816EAB8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0816EB18 + ldr r1, _0816EB1C + bl call_LZZUnCompVram + ldr r0, _0816EB20 + ldr r1, _0816EB24 + bl call_LZZUnCompVram + ldr r0, _0816EB28 + ldr r1, _0816EB2C + bl call_LZZUnCompVram + ldr r0, _0816EB30 + movs r1, 0xC0 + lsls r1, 19 + bl call_LZZUnCompVram + movs r1, 0xD5 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + ldr r1, _0816EB34 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0816EB38 + str r1, [r0] + movs r2, 0 + strh r2, [r0, 0x8] + movs r1, 0x1 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + ldr r0, _0816EB3C + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _0816EB40 + bl gpu_pal_obj_alloc_and_load_multiple + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816EB18: .4byte 0x08d8c16c +_0816EB1C: .4byte 0x0600e000 +_0816EB20: .4byte 0x08d8ccc8 +_0816EB24: .4byte 0x0600c000 +_0816EB28: .4byte 0x08d8ba74 +_0816EB2C: .4byte 0x06004000 +_0816EB30: .4byte 0x08d8c838 +_0816EB34: .4byte 0x03005e00 +_0816EB38: .4byte task_intro_26 + 1 +_0816EB3C: .4byte 0x085e4bf4 +_0816EB40: .4byte 0x085e4c04 + thumb_func_end task_intro_25 + + thumb_func_start task_intro_26 +task_intro_26: @ 816EB44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, _0816EB68 + adds r6, r1, r2 + movs r3, 0 + ldrsh r0, [r6, r3] + cmp r0, 0x1 + beq _0816EBE0 + cmp r0, 0x1 + bgt _0816EB6C + cmp r0, 0 + beq _0816EB72 + b _0816EC62 + .align 2, 0 +_0816EB68: .4byte 0x03005e08 +_0816EB6C: + cmp r0, 0x2 + beq _0816EC4C + b _0816EC62 +_0816EB72: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EC62 + ldr r4, _0816EBD8 + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x30 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0816EBDC + adds r0, r5 + movs r1, 0x1 + bl obj_anim_image_start + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x70 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + bl obj_anim_image_start + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0x48 + strh r0, [r6, 0xC] + b _0816EC62 + .align 2, 0 +_0816EBD8: .4byte 0x085e4c4c +_0816EBDC: .4byte 0x02020630 +_0816EBE0: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EC62 + ldr r4, _0816EC44 + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x30 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x50 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0816EC48 + adds r0, r5 + movs r1, 0x1 + bl obj_anim_image_start + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x70 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + bl obj_anim_image_start + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0x30 + strh r0, [r6, 0xC] + b _0816EC62 + .align 2, 0 +_0816EC44: .4byte 0x085e4c4c +_0816EC48: .4byte 0x02020630 +_0816EC4C: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EC62 + adds r0, r2, 0 + subs r0, 0x8 + adds r0, r1, r0 + ldr r1, _0816EC68 + str r1, [r0] +_0816EC62: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816EC68: .4byte task_intro_27 + 1 + thumb_func_end task_intro_26 + + thumb_func_start sub_816EC6C +sub_816EC6C: @ 816EC6C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0816EC88 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0816EC88: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816ECAC + cmp r0, 0x1 + bgt _0816EC9A + cmp r0, 0 + beq _0816ECA0 + b _0816ED12 +_0816EC9A: + cmp r0, 0x2 + beq _0816ECDC + b _0816ED12 +_0816ECA0: + movs r0, 0xE1 + lsls r0, 1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816ECAC: + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldr r1, _0816ED18 + adds r0, r1 + ldr r1, _0816ED1C + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + movs r1, 0xE7 + lsls r1, 17 + cmp r0, r1 + bne _0816ED12 + movs r0, 0xE6 + lsls r0, 1 + strh r0, [r4, 0x30] + movs r0, 0x4 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816ECDC: + ldrh r0, [r4, 0x32] + subs r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0816ED12 + movs r0, 0x4 + strh r0, [r4, 0x32] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldr r1, _0816ED18 + adds r0, r1 + ldr r1, _0816ED1C + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0x30] + subs r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 17 + cmp r0, r1 + bne _0816ED12 + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0816ED12: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816ED18: .4byte 0x08d85cd0 +_0816ED1C: .4byte 0x02037bce + thumb_func_end sub_816EC6C + + thumb_func_start task_intro_27 +task_intro_27: @ 816ED20 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _0816ED90 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0816ED94 + bl gpu_pal_obj_alloc_and_load_multiple + movs r1, 0xD5 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set + ldr r6, _0816ED98 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldr r0, _0816ED9C + str r0, [r4] + ldr r0, _0816EDA0 + ldr r1, _0816EDA4 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0 + strh r0, [r4, 0x8] + movs r0, 0xA8 + strh r0, [r4, 0xA] + ldr r1, _0816EDA8 + strh r1, [r4, 0xC] + ldr r0, _0816EDAC + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldr r0, _0816EDB0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + strh r5, [r1, 0x10] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816ED90: .4byte 0x085e5048 +_0816ED94: .4byte 0x085e5058 +_0816ED98: .4byte 0x03005e00 +_0816ED9C: .4byte task_intro_28 + 1 +_0816EDA0: .4byte 0x0000ffde +_0816EDA4: .4byte 0x00002949 +_0816EDA8: .4byte 0x0000fff0 +_0816EDAC: .4byte 0x0000ff78 +_0816EDB0: .4byte sub_816EEA8 + 1 + thumb_func_end task_intro_27 + + thumb_func_start task_intro_28 +task_intro_28: @ 816EDB4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r5, _0816EDF0 + adds r2, r4, r5 + ldrh r0, [r2, 0xE] + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + bne _0816EDD6 + ldrh r0, [r2, 0xC] + movs r1, 0x2 + eors r0, r1 + strh r0, [r2, 0xC] +_0816EDD6: + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + movs r6, 0 + ldrsh r1, [r2, r6] + cmp r1, 0x1 + beq _0816EE2E + cmp r1, 0x1 + bgt _0816EDF4 + cmp r1, 0 + beq _0816EDFE + b _0816EE86 + .align 2, 0 +_0816EDF0: .4byte 0x03005e08 +_0816EDF4: + cmp r1, 0x2 + beq _0816EE3A + cmp r1, 0x3 + beq _0816EE70 + b _0816EE86 +_0816EDFE: + ands r0, r3 + cmp r0, 0 + beq _0816EE1C + ldrh r0, [r2, 0x2] + subs r0, 0x2 + strh r0, [r2, 0x2] + ldrh r0, [r2, 0x4] + adds r0, 0x1 + strh r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + adds r0, 0x2 + strh r0, [r2, 0x6] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0816EE1C: + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, 0x68 + bne _0816EE86 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + strh r3, [r2, 0xA] + b _0816EE86 +_0816EE2E: + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + movs r0, 0x4 + strh r0, [r2, 0xA] + b _0816EE86 +_0816EE3A: + ldrh r0, [r2, 0x2] + adds r0, 0x4 + strh r0, [r2, 0x2] + ldrh r0, [r2, 0x4] + subs r0, 0x2 + strh r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + subs r0, 0x4 + strh r0, [r2, 0x6] + ldrh r0, [r2, 0x8] + subs r0, 0x2 + strh r0, [r2, 0x8] + ldr r0, _0816EE6C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816EE86 + movs r0, 0x8C + strh r0, [r2, 0xA] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _0816EE86 + .align 2, 0 +_0816EE6C: .4byte 0x02037fd4 +_0816EE70: + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _0816EE86 + adds r0, r5, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, _0816EE8C + str r1, [r0] +_0816EE86: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816EE8C: .4byte task_intro_29 + 1 + thumb_func_end task_intro_28 + + thumb_func_start task_intro_29 +task_intro_29: @ 816EE90 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldr r0, _0816EEA4 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0816EEA4: .4byte sub_816CC54 + 1 + thumb_func_end task_intro_29 + + thumb_func_start sub_816EEA8 +sub_816EEA8: @ 816EEA8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0816EED4 + adds r5, r0, r1 + ldrh r0, [r5, 0x4] + adds r0, 0x1 + strh r0, [r5, 0x4] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _0816EECA + b _0816F0B2 +_0816EECA: + lsls r0, 2 + ldr r1, _0816EED8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816EED4: .4byte 0x03005e08 +_0816EED8: .4byte _0816EEDC + .align 2, 0 +_0816EEDC: + .4byte _0816EEF4 + .4byte _0816EF34 + .4byte _0816EF80 + .4byte _0816F00A + .4byte _0816F074 + .4byte _0816F0A0 +_0816EEF4: + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816EF16 + movs r2, 0x2 + ldrsh r0, [r5, r2] + lsls r0, 1 + ldr r1, _0816EF2C + adds r0, r1 + ldr r1, _0816EF30 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] +_0816EF16: + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + beq _0816EF20 + b _0816F0B2 +_0816EF20: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0 + strh r0, [r5, 0x2] + b _0816EF70 + .align 2, 0 +_0816EF2C: .4byte 0x08d85e72 +_0816EF30: .4byte 0x02037bd0 +_0816EF34: + ldrh r1, [r5, 0x6] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0816F004 + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816EF60 + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 1 + ldr r1, _0816EF78 + adds r0, r1 + ldr r1, _0816EF7C + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] +_0816EF60: + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x6 + beq _0816EF6A + b _0816F0B2 +_0816EF6A: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0816EF70: + movs r0, 0xA + strh r0, [r5, 0x6] + b _0816F0B2 + .align 2, 0 +_0816EF78: .4byte 0x08d85e72 +_0816EF7C: .4byte 0x02037bc4 +_0816EF80: + ldrh r1, [r5, 0x6] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0816F004 + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816EFAC + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 1 + ldr r1, _0816EFF4 + adds r0, r1 + ldr r1, _0816EFF8 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] +_0816EFAC: + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x6 + beq _0816EFB6 + b _0816F0B2 +_0816EFB6: + ldr r0, _0816EFFC + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0xF + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x67 + bl audio_play + ldr r1, _0816F000 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldrh r1, [r5, 0x8] + strh r1, [r0, 0x34] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0x10 + strh r0, [r5, 0x6] + b _0816F0B2 + .align 2, 0 +_0816EFF4: .4byte 0x08d85e52 +_0816EFF8: .4byte 0x02037bcc +_0816EFFC: .4byte 0x085e5030 +_0816F000: .4byte 0x02020630 +_0816F004: + subs r0, r1, 0x1 + strh r0, [r5, 0x6] + b _0816F0B2 +_0816F00A: + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816F0B2 + ldrh r0, [r5, 0x6] + subs r0, 0x1 + adds r2, r0, 0 + strh r0, [r5, 0x6] + lsls r0, 16 + cmp r0, 0 + beq _0816F068 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _0816F05C + movs r0, 0x50 + movs r1, 0x10 + bl pal_fade_1 + ldr r4, _0816F060 + ldr r5, _0816F064 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + adds r1, r5, 0 + subs r1, 0xC + adds r0, r4, 0 + movs r2, 0x1 + bl CpuSet + subs r4, 0x20 + subs r5, 0x4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + b _0816F0B2 + .align 2, 0 +_0816F05C: .4byte 0x00002949 +_0816F060: .4byte 0x08d85e7c +_0816F064: .4byte 0x02037bd0 +_0816F068: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0x35 + strh r0, [r5, 0x6] + b _0816F0B2 +_0816F074: + ldrh r0, [r5, 0x6] + subs r0, 0x1 + strh r0, [r5, 0x6] + lsls r0, 16 + cmp r0, 0 + bne _0816F0B2 + movs r0, 0x1 + negs r0, r0 + ldr r1, _0816F09C + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0816F0B2 + .align 2, 0 +_0816F09C: .4byte 0x00007fff +_0816F0A0: + ldr r0, _0816F0BC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816F0B2 + adds r0, r2, 0 + bl remove_task +_0816F0B2: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0816F0BC: .4byte 0x02037fd4 + thumb_func_end sub_816EEA8 + + thumb_func_start intro_reset_and_hide_bgs +intro_reset_and_hide_bgs: @ 816F0C0 + push {lr} + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + thumb_func_end intro_reset_and_hide_bgs + + thumb_func_start task_intro_3_1 +task_intro_3_1: @ 816F128 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0816F168 + 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 _0816F170 + cmp r0, 0x1 + ble _0816F148 + cmp r0, 0x2 + beq _0816F1BC +_0816F148: + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r0, _0816F16C + ldrh r1, [r0, 0x3E] + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + b _0816F1AC + .align 2, 0 +_0816F168: .4byte 0x03005e00 +_0816F16C: .4byte 0x0853ff70 +_0816F170: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F1A0 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r1, 0xFF + lsls r1, 1 + ldr r2, _0816F19C + ands r0, r1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x52 + bl lcd_io_set + b _0816F1DA + .align 2, 0 +_0816F19C: .4byte 0x0853ff70 +_0816F1A0: + ldr r0, _0816F1B8 + ldrh r1, [r0] + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x10 +_0816F1AC: + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0816F1DA + .align 2, 0 +_0816F1B8: .4byte 0x0853ff70 +_0816F1BC: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl remove_task +_0816F1DA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_intro_3_1 + + thumb_func_start task_intro_3_2 +task_intro_3_2: @ 816F1E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0816F220 + 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 _0816F228 + cmp r0, 0x1 + ble _0816F200 + cmp r0, 0x2 + beq _0816F274 +_0816F200: + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + ldr r0, _0816F224 + ldrh r1, [r0] + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + b _0816F264 + .align 2, 0 +_0816F220: .4byte 0x03005e00 +_0816F224: .4byte 0x0853ff70 +_0816F228: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x3D + bgt _0816F258 + adds r0, r1, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r1, 0xFF + lsls r1, 1 + ldr r2, _0816F254 + ands r0, r1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x52 + bl lcd_io_set + b _0816F2A2 + .align 2, 0 +_0816F254: .4byte 0x0853ff70 +_0816F258: + ldr r0, _0816F270 + ldrh r1, [r0, 0x3E] + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x10 +_0816F264: + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0816F2A2 + .align 2, 0 +_0816F270: .4byte 0x0853ff70 +_0816F274: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F284 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + b _0816F2A2 +_0816F284: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + adds r0, r5, 0 + bl remove_task +_0816F2A2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_intro_3_2 + + thumb_func_start sub_816F2A8 +sub_816F2A8: @ 816F2A8 + push {r4,lr} + sub sp, 0x24 + lsls r2, 16 + lsrs r2, 16 + movs r4, 0x80 + lsls r4, 8 + str r4, [sp] + str r4, [sp, 0x4] + mov r4, sp + strh r0, [r4, 0x8] + mov r0, sp + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + strh r3, [r0, 0x10] + add r4, sp, 0x14 + adds r1, r4, 0 + movs r2, 0x1 + bl BgAffineSet + ldrh r1, [r4] + movs r0, 0x20 + bl lcd_io_set + ldrh r1, [r4, 0x2] + movs r0, 0x22 + bl lcd_io_set + ldrh r1, [r4, 0x4] + movs r0, 0x24 + bl lcd_io_set + ldrh r1, [r4, 0x6] + movs r0, 0x26 + bl lcd_io_set + ldrh r1, [r4, 0x8] + movs r0, 0x28 + bl lcd_io_set + ldrh r1, [r4, 0xA] + movs r0, 0x2A + bl lcd_io_set + ldrh r1, [r4, 0xC] + movs r0, 0x2C + bl lcd_io_set + ldrh r1, [r4, 0xE] + movs r0, 0x2E + bl lcd_io_set + add sp, 0x24 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F2A8 + + thumb_func_start sub_816F318 +sub_816F318: @ 816F318 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0xBF + ble _0816F394 + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F336 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + b _0816F39A +_0816F336: + 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, 0x30] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x32] + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 5 + subs r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4, 0x32] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1, 0 + subs r0, 0xC0 + cmp r0, 0 + bge _0816F378 + adds r0, 0x7F +_0816F378: + asrs r0, 7 + adds r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _0816F386 + movs r0, 0xF +_0816F386: + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + b _0816F39A +_0816F394: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0816F39A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F318 + + thumb_func_start sub_816F3A4 +sub_816F3A4: @ 816F3A4 + push {r4,lr} + adds r4, r0, 0 + ldr r2, _0816F418 + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0816F420 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl obj_anim_image_start + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, _0816F41C + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl oam_center + b _0816F44C + .align 2, 0 +_0816F418: .4byte 0x02020630 +_0816F41C: .4byte sub_816F318 + 1 +_0816F420: + ldrh r0, [r1, 0x24] + strh r0, [r4, 0x24] + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x26] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x20] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x22] +_0816F44C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F3A4 + + thumb_func_start sub_816F454 +sub_816F454: @ 816F454 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0816F464 + ldr r0, _0816F468 + str r0, [r1, 0x1C] +_0816F464: + pop {r0} + bx r0 + .align 2, 0 +_0816F468: .4byte sub_816F46C + 1 + thumb_func_end sub_816F454 + + thumb_func_start sub_816F46C +sub_816F46C: @ 816F46C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + ldrh r4, [r7, 0x20] + movs r1, 0x20 + ldrsh r0, [r7, r1] + cmp r0, 0x74 + bgt _0816F4AC + ldrh r0, [r7, 0x26] + ldrh r1, [r7, 0x22] + adds r0, r1 + movs r1, 0 + strh r0, [r7, 0x22] + strh r1, [r7, 0x26] + adds r0, r4, 0x4 + strh r0, [r7, 0x20] + ldr r0, _0816F4A4 + strh r0, [r7, 0x24] + movs r0, 0x80 + strh r0, [r7, 0x36] + ldr r0, _0816F4A8 + str r0, [r7, 0x1C] + b _0816F59E + .align 2, 0 +_0816F4A4: .4byte 0x0000fffc +_0816F4A8: .4byte sub_816F5B4 + 1 +_0816F4AC: + ldrh r1, [r7, 0x36] + ldr r5, _0816F5B0 + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + adds r0, r1, 0 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r3, [r0] + adds r1, 0x2 + strh r1, [r7, 0x36] + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, 0 + bge _0816F4D2 + adds r0, 0x1F +_0816F4D2: + asrs r0, 5 + strh r0, [r7, 0x26] + subs r0, r4, 0x1 + strh r0, [r7, 0x20] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816F4E8 + ldrh r0, [r7, 0x22] + adds r0, 0x1 + strh r0, [r7, 0x22] +_0816F4E8: + lsls r0, r3, 16 + asrs r0, 16 + negs r0, r0 + cmp r0, 0 + bge _0816F4F4 + adds r0, 0xF +_0816F4F4: + lsls r1, r0, 12 + lsrs r1, 16 + ldrh r4, [r7, 0x32] + ldrh r3, [r7, 0x34] + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + adds r1, 0x30 + lsls r1, 24 + lsrs r1, 23 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r1, 0 + muls r0, r4 + cmp r0, 0 + bge _0816F51E + adds r0, 0xFF +_0816F51E: + lsls r0, 8 + lsrs r0, 16 + mov r8, r0 + lsls r0, r2, 16 + asrs r2, r0, 16 + negs r0, r2 + muls r0, r3 + cmp r0, 0 + bge _0816F532 + adds r0, 0xFF +_0816F532: + lsls r0, 8 + lsrs r0, 16 + mov r10, r0 + adds r0, r2, 0 + muls r0, r4 + cmp r0, 0 + bge _0816F542 + adds r0, 0xFF +_0816F542: + lsls r0, 8 + lsrs r5, r0, 16 + adds r0, r1, 0 + muls r0, r3 + cmp r0, 0 + bge _0816F550 + adds r0, 0xFF +_0816F550: + lsls r6, r0, 8 + lsrs r6, 16 + ldrh r0, [r7, 0x30] + lsls r0, 24 + lsrs r0, 24 + str r3, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldrh r0, [r7, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r5 + mov r1, r10 + lsls r5, r1, 16 + lsrs r3, r5, 16 + lsls r4, r6, 16 + str r6, [sp] + mov r1, r8 + mov r2, r9 + bl rotscale_set_direct + ldrh r0, [r7, 0x30] + adds r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 1 + lsrs r5, 16 + lsls r4, 1 + lsrs r4, 16 + str r4, [sp] + mov r1, r8 + mov r2, r9 + adds r3, r5, 0 + bl rotscale_set_direct +_0816F59E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0816F5B0: .4byte 0x08329f40 + thumb_func_end sub_816F46C + + thumb_func_start sub_816F5B4 +sub_816F5B4: @ 816F5B4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldrh r0, [r4, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldrh r0, [r4, 0x30] + adds r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldrh r1, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + beq _0816F64C + adds r0, r1, 0 + subs r0, 0x8 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x36] + adds r1, r0, 0 + ldr r2, _0816F648 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bge _0816F62E + adds r0, 0x3F +_0816F62E: + asrs r0, 6 + strh r0, [r4, 0x24] + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0816F642 + adds r0, 0x3F +_0816F642: + asrs r0, 6 + strh r0, [r4, 0x26] + b _0816F654 + .align 2, 0 +_0816F648: .4byte 0x08329f40 +_0816F64C: + movs r0, 0 + strh r0, [r4, 0x36] + ldr r0, _0816F65C + str r0, [r4, 0x1C] +_0816F654: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816F65C: .4byte sub_816F660 + 1 + thumb_func_end sub_816F5B4 + + thumb_func_start sub_816F660 +sub_816F660: @ 816F660 + push {r4,lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _0816F6C0 + ldrh r0, [r1, 0x36] + adds r0, 0x8 + strh r0, [r1, 0x36] + ldr r3, _0816F6BC + lsls r0, 24 + lsrs r0, 23 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + bge _0816F684 + adds r0, 0xF +_0816F684: + asrs r0, 4 + adds r0, 0x40 + lsls r0, 16 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + bge _0816F6A0 + adds r0, 0x3F +_0816F6A0: + asrs r0, 6 + strh r0, [r1, 0x24] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _0816F6B4 + adds r0, 0x3F +_0816F6B4: + asrs r0, 6 + strh r0, [r1, 0x26] + b _0816F6C4 + .align 2, 0 +_0816F6BC: .4byte 0x08329f40 +_0816F6C0: + ldr r0, _0816F6CC + str r0, [r1, 0x1C] +_0816F6C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816F6CC: .4byte sub_816F6D0 + 1 + thumb_func_end sub_816F660 + + thumb_func_start sub_816F6D0 +sub_816F6D0: @ 816F6D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0816F6E8 + adds r0, r2, 0x4 + strh r0, [r4, 0x22] + b _0816F744 +_0816F6E8: + movs r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl obj_anim_image_start + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, _0816F74C + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl oam_center +_0816F744: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816F74C: .4byte sub_816F318 + 1 + thumb_func_end sub_816F6D0 + + thumb_func_start sub_816F750 +sub_816F750: @ 816F750 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0816F768 + adds r0, r2, 0x4 + strh r0, [r4, 0x22] + b _0816F7C4 +_0816F768: + movs r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl obj_anim_image_start + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, _0816F7CC + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl oam_center +_0816F7C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816F7CC: .4byte sub_816F318 + 1 + thumb_func_end sub_816F750 + + thumb_func_start sub_816F7D0 +sub_816F7D0: @ 816F7D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r6, [sp, 0x34] + ldr r0, [sp, 0x38] + mov r8, r0 + lsls r4, 16 + lsls r5, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0xC] + lsls r6, 16 + lsrs r6, 16 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r0, _0816F88C + lsrs r2, r4, 16 + mov r10, r2 + asrs r4, 16 + lsrs r1, r5, 16 + str r1, [sp, 0x4] + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _0816F890 + mov r9, r2 + lsls r0, r7, 4 + adds r0, r7 + lsls r5, r0, 2 + adds r4, r5, r2 + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x3C] + mov r0, sp + ldrh r0, [r0, 0xC] + strh r0, [r4, 0x30] + mov r1, sp + ldrh r1, [r1, 0x8] + strh r1, [r4, 0x32] + mov r2, sp + ldrh r2, [r2, 0x8] + strh r2, [r4, 0x34] + strh r6, [r4, 0x38] + mov r0, sp + ldrh r0, [r0, 0x8] + strh r0, [r4, 0x3A] + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1F + ldr r1, [sp, 0xC] + ands r1, r0 + lsls r1, 1 + ldrb r2, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl oam_center + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start + mov r1, r8 + cmp r1, 0 + bne _0816F898 + mov r0, r9 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, _0816F894 + b _0816F8A0 + .align 2, 0 +_0816F88C: .4byte 0x085e4d64 +_0816F890: .4byte 0x02020630 +_0816F894: .4byte sub_816F454 + 1 +_0816F898: + mov r0, r9 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, _0816F9C0 +_0816F8A0: + str r1, [r0] + str r7, [sp, 0x10] + mov r2, r10 + lsls r2, 16 + asrs r2, 16 + mov r10, r2 + ldr r0, [sp, 0x4] + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + ldr r0, _0816F9C4 + mov r1, r10 + mov r2, r8 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, _0816F9C8 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r0, r4, r5 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r0, 0x3C] + ldr r2, [sp, 0xC] + adds r2, 0x1 + mov r9, r2 + strh r2, [r0, 0x30] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r2, r9 + movs r1, 0x1F + ands r2, r1 + lsls r2, 1 + ldrb r3, [r0, 0x3] + movs r6, 0x3F + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl oam_center + ldr r2, _0816F9CC + adds r4, r2 + ldr r0, _0816F9D0 + str r0, [r4] + ldr r0, _0816F9C4 + mov r1, r10 + mov r2, r8 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r5, r4, r5 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r5, 0x3C] + ldr r2, [sp, 0xC] + adds r2, 0x2 + mov r8, r2 + strh r2, [r5, 0x30] + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + mov r0, r8 + movs r2, 0x1F + ands r0, r2 + lsls r0, 1 + ldrb r1, [r5, 0x3] + ands r6, r1 + orrs r6, r0 + strb r6, [r5, 0x3] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl oam_center + ldr r0, _0816F9CC + adds r4, r0 + ldr r1, _0816F9D0 + str r1, [r4] + ldr r2, [sp, 0xC] + lsls r0, r2, 24 + lsrs r0, 24 + ldr r5, [sp, 0x8] + adds r5, 0x20 + lsls r4, r5, 16 + lsrs r4, 16 + str r4, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + str r4, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 17 + lsrs r5, 16 + str r5, [sp] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldr r0, [sp, 0x10] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0816F9C0: .4byte sub_816F750 + 1 +_0816F9C4: .4byte 0x085e4d64 +_0816F9C8: .4byte 0x02020630 +_0816F9CC: .4byte 0x0202064c +_0816F9D0: .4byte sub_816F3A4 + 1 + thumb_func_end sub_816F7D0 + + thumb_func_start sub_816F9D4 +sub_816F9D4: @ 816F9D4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _0816FA62 + lsls r0, 2 + ldr r1, _0816F9EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816F9EC: .4byte _0816F9F0 + .align 2, 0 +_0816F9F0: + .4byte _0816FA04 + .4byte _0816FA12 + .4byte _0816FA30 + .4byte _0816FA62 + .4byte _0816FA50 +_0816FA04: + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + ldrh r0, [r4, 0x20] + subs r0, 0x1 + b _0816FA60 +_0816FA12: + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + ldr r0, _0816FA2C + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0816FAAA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _0816FA60 + .align 2, 0 +_0816FA2C: .4byte 0x030062a0 +_0816FA30: + ldrh r2, [r4, 0x20] + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _0816FA46 + ldr r0, _0816FA4C + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0816FA6E +_0816FA46: + adds r0, r2, 0x1 + b _0816FA60 + .align 2, 0 +_0816FA4C: .4byte 0x030062a0 +_0816FA50: + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _0816FA62 + subs r0, r2, 0x2 +_0816FA60: + strh r0, [r4, 0x20] +_0816FA62: + ldr r0, _0816FA7C + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0816FAAA +_0816FA6E: + movs r1, 0x26 + ldrsh r5, [r4, r1] + cmp r5, 0 + beq _0816FA80 + movs r0, 0 + strh r0, [r4, 0x26] + b _0816FAAA + .align 2, 0 +_0816FA7C: .4byte 0x030062a0 +_0816FA80: + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x1 + beq _0816FAA8 + cmp r1, 0x1 + bgt _0816FA96 + cmp r1, 0 + beq _0816FA9E + b _0816FAAA +_0816FA96: + cmp r1, 0x3 + bgt _0816FAAA + strh r5, [r4, 0x26] + b _0816FAAA +_0816FA9E: + ldr r0, _0816FAA4 + strh r0, [r4, 0x26] + b _0816FAAA + .align 2, 0 +_0816FAA4: .4byte 0x0000ffff +_0816FAA8: + strh r1, [r4, 0x26] +_0816FAAA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816F9D4 + + thumb_func_start sub_816FAB0 +sub_816FAB0: @ 816FAB0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816FACA + cmp r0, 0x1 + ble _0816FB12 + cmp r0, 0x2 + beq _0816FAEA + cmp r0, 0x3 + beq _0816FB04 + b _0816FB12 +_0816FACA: + movs r2, 0x24 + ldrsh r0, [r4, r2] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + ldr r1, _0816FAE0 + cmp r0, r1 + bgt _0816FAE4 + ldrh r0, [r4, 0x24] + adds r0, 0x8 + b _0816FB10 + .align 2, 0 +_0816FAE0: .4byte 0x0000012f +_0816FAE4: + movs r0, 0x2 + strh r0, [r4, 0x2E] + b _0816FB12 +_0816FAEA: + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0x78 + ble _0816FAFE + ldrh r0, [r4, 0x24] + subs r0, 0x1 + b _0816FB10 +_0816FAFE: + movs r0, 0x3 + strh r0, [r4, 0x2E] + b _0816FB12 +_0816FB04: + ldrh r1, [r4, 0x24] + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0816FB12 + subs r0, r1, 0x2 +_0816FB10: + strh r0, [r4, 0x24] +_0816FB12: + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl sine + ldr r1, _0816FB34 + ldrh r1, [r1] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0816FB34: .4byte 0x0203bccc + thumb_func_end sub_816FAB0 + + thumb_func_start sub_816FB38 +sub_816FB38: @ 816FB38 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bls _0816FB46 + b _0816FD38 +_0816FB46: + lsls r0, 2 + ldr r1, _0816FB50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0816FB50: .4byte _0816FB54 + .align 2, 0 +_0816FB54: + .4byte _0816FB6C + .4byte _0816FB94 + .4byte _0816FBB4 + .4byte _0816FC5C + .4byte _0816FCC4 + .4byte _0816FCF4 +_0816FB6C: + ldrh r1, [r6, 0x30] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0816FB7C + subs r0, r1, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 +_0816FB7C: + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8008258 + b _0816FCE6 +_0816FB94: + ldr r0, _0816FBB0 + ldr r0, [r0] + cmp r0, 0x90 + beq _0816FB9E + b _0816FD38 +_0816FB9E: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + movs r0, 0x9 + strh r0, [r6, 0x30] + movs r0, 0x2 + strh r0, [r6, 0x34] + b _0816FD38 + .align 2, 0 +_0816FBB0: .4byte 0x030062a0 +_0816FBB4: + ldrh r1, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0816FC66 + movs r0, 0x2 + strh r0, [r6, 0x34] + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0816FC14 + lsls r0, 1 + ldr r4, _0816FC0C + adds r0, r4 + ldr r5, _0816FC10 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r6, 0x30] + subs r0, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 + .align 2, 0 +_0816FC0C: .4byte 0x08d85c50 +_0816FC10: .4byte 0x02037d52 +_0816FC14: + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + ldr r4, _0816FC54 + adds r0, r4 + ldr r5, _0816FC58 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + b _0816FCE6 + .align 2, 0 +_0816FC54: .4byte 0x08d85c50 +_0816FC58: .4byte 0x02037d52 +_0816FC5C: + ldrh r1, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0816FC6C +_0816FC66: + subs r0, r1, 0x1 + strh r0, [r6, 0x34] + b _0816FD38 +_0816FC6C: + movs r0, 0x2 + strh r0, [r6, 0x34] + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0x9 + bgt _0816FCE6 + lsls r0, 1 + ldr r4, _0816FCBC + adds r0, r4 + ldr r5, _0816FCC0 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r6, 0x30] + adds r0, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 + .align 2, 0 +_0816FCBC: .4byte 0x08d85c50 +_0816FCC0: .4byte 0x02037d52 +_0816FCC4: + ldr r0, _0816FCF0 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0816FD38 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8008258 + ldrb r1, [r6, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6, 0x1] +_0816FCE6: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + b _0816FD38 + .align 2, 0 +_0816FCF0: .4byte 0x030062a0 +_0816FCF4: + ldr r1, _0816FD40 + movs r2, 0x32 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r6, 0x34] + adds r0, r1 + strh r0, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + asrs r0, 8 + strh r0, [r6, 0x24] + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x3 + bgt _0816FD24 + movs r2, 0x24 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x24] +_0816FD24: + adds r0, r6, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0816FD38 + adds r0, r6, 0 + bl obj_delete_and_free_tiles +_0816FD38: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0816FD40: .4byte 0x085e4f48 + thumb_func_end sub_816FB38 + + thumb_func_start sub_816FD44 +sub_816FD44: @ 816FD44 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816FD7C + cmp r0, 0x1 + bgt _0816FD5A + cmp r0, 0 + beq _0816FD60 + b _0816FDB0 +_0816FD5A: + cmp r0, 0x2 + beq _0816FD9C + b _0816FDB0 +_0816FD60: + ldr r0, _0816FD78 + ldr r0, [r0] + cmp r0, 0x80 + bne _0816FDB0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + b _0816FD90 + .align 2, 0 +_0816FD78: .4byte 0x030062a0 +_0816FD7C: + ldr r0, _0816FD98 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0816FDB0 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_8008258 +_0816FD90: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816FDB0 + .align 2, 0 +_0816FD98: .4byte 0x030062a0 +_0816FD9C: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0816FDB0 + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0816FDB0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816FD44 + + thumb_func_start sub_816FDB8 +sub_816FDB8: @ 816FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + movs r7, 0 +_0816FDD2: + lsls r5, r7, 2 + ldr r0, _0816FEC4 + adds r0, 0x2 + adds r0, r5, r0 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldr r3, [sp, 0x4] + lsls r2, r3, 16 + asrs r0, r2, 16 + str r0, [sp, 0x8] + ldr r3, _0816FEC8 + adds r2, r3 + ldr r0, _0816FECC + asrs r2, 16 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + ldr r0, _0816FED0 + adds r4, r0 + movs r1, 0 + strh r1, [r4, 0x2E] + ldr r0, _0816FED4 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r4, 0x30] + strh r7, [r4, 0x32] + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + mov r10, r2 + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + adds r1, r7, 0 + adds r1, 0xC + movs r0, 0x1F + mov r9, r0 + mov r2, r9 + ands r1, r2 + lsls r1, 1 + ldrb r0, [r4, 0x3] + movs r3, 0x3F + negs r3, r3 + mov r8, r3 + mov r2, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldr r3, _0816FEC4 + adds r5, r3 + ldrb r1, [r5] + adds r0, r4, 0 + bl obj_anim_image_start + adds r0, r4, 0 + movs r1, 0 + bl sub_8008258 + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x8 + bls _0816FDD2 + ldr r0, _0816FED8 + ldr r2, [sp, 0x8] + subs r2, 0x6 + lsls r2, 16 + asrs r2, 16 + movs r1, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, _0816FED0 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x2E] + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + mov r3, r10 + orrs r1, r3 + strb r1, [r2] + adds r2, r7, 0 + adds r2, 0xC + mov r1, r9 + ands r2, r1 + lsls r2, 1 + ldrb r1, [r0, 0x3] + mov r3, r8 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r1, 0x1 + bl sub_8008258 + 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 + .align 2, 0 +_0816FEC4: .4byte 0x085e4e94 +_0816FEC8: .4byte 0xfffc0000 +_0816FECC: .4byte 0x085e4f5c +_0816FED0: .4byte 0x02020630 +_0816FED4: .4byte 0x085e4fa4 +_0816FED8: .4byte 0x085e4f8c + thumb_func_end sub_816FDB8 + + thumb_func_start sub_816FEDC +sub_816FEDC: @ 816FEDC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816FF48 + ldr r2, _0816FF98 + ldrh r1, [r4, 0x32] + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r2 + ldrh r3, [r0] + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 23 + adds r1, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r1, 0x30 + ldrsh r2, [r4, r1] + adds r1, r0, 0 + muls r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _0816FF18 + adds r0, 0xFF +_0816FF18: + lsls r0, 8 + lsrs r6, r0, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + negs r0, r3 + muls r0, r2 + cmp r0, 0 + bge _0816FF2A + adds r0, 0xFF +_0816FF2A: + lsls r0, 8 + lsrs r5, r0, 16 + adds r0, r3, 0 + muls r0, r2 + cmp r0, 0 + bge _0816FF38 + adds r0, 0xFF +_0816FF38: + lsls r0, 8 + lsrs r2, r0, 16 + adds r1, r6, 0 + adds r3, r5, 0 + str r1, [sp] + movs r0, 0x1 + bl rotscale_set_direct +_0816FF48: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0816FF9C + cmp r0, 0x1 + ble _0816FF58 + cmp r0, 0x2 + beq _0816FFFE +_0816FF58: + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl oam_center + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x80 + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + b _08170038 + .align 2, 0 +_0816FF98: .4byte 0x08329f40 +_0816FF9C: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8C + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x78 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + strh r0, [r4, 0x34] + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08170038 + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x20] + movs r0, 0x28 + strh r0, [r4, 0x22] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + movs r0, 0x10 + b _08170036 +_0816FFFE: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x22 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3C + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08170038 + ldrh r0, [r4, 0x34] + adds r0, 0x1 +_08170036: + strh r0, [r4, 0x34] +_08170038: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816FEDC + + thumb_func_start sub_8170040 +sub_8170040: @ 8170040 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08170056 + adds r4, r5, 0 + adds r4, 0x3E + cmp r0, 0x1 + beq _0817008E +_08170056: + adds r4, r5, 0 + adds r4, 0x3E + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x24 + orrs r0, r1 + strb r0, [r5, 0x3] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl oam_center + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + strh r0, [r5, 0x2E] +_0817008E: + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081700A6 + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + b _081700BE +_081700A6: + ldrb r0, [r4] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + ldrh r1, [r5, 0x30] + movs r2, 0x30 + ldrsh r0, [r5, r2] + cmp r0, 0x3F + bgt _081700BE + adds r0, r1, 0x1 + strh r0, [r5, 0x30] +_081700BE: + ldr r1, _081700F4 + ldrh r0, [r5, 0x30] + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x12 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081700F4: .4byte 0x08329f40 + thumb_func_end sub_8170040 + + thumb_func_start sub_81700F8 +sub_81700F8: @ 81700F8 + push {r4,r5,lr} + ldr r5, _08170170 + ldrh r4, [r5] + movs r0, 0 + strh r0, [r5] + movs r0, 0x1 + bl RegisterRamReset + movs r0, 0 + movs r1, 0x80 + bl lcd_io_clear_bits + strh r4, [r5] + ldr r1, _08170174 + ldr r0, _08170178 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl sub_815355C + lsls r0, 16 + lsrs r0, 16 + bl sub_8076BDC + bl sub_808447C + bl sub_8152680 + movs r0, 0 + bl sub_81534D0 + ldr r0, _0817017C + ldrh r0, [r0] + cmp r0, 0 + beq _08170148 + cmp r0, 0x2 + bne _0817014C +_08170148: + bl init_sav2 +_0817014C: + ldr r0, _08170180 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 31 + lsrs r0, 31 + bl sub_82E1810 + ldr r0, _08170184 + movs r1, 0xE0 + lsls r1, 9 + bl init_malloc + ldr r0, _08170188 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08170170: .4byte 0x04000208 +_08170174: .4byte 0x030022c0 +_08170178: .4byte 0x00000439 +_0817017C: .4byte 0x03006210 +_08170180: .4byte 0x03005d90 +_08170184: .4byte 0x02000000 +_08170188: .4byte sub_8086230 + 1 + thumb_func_end sub_81700F8 + + thumb_func_start sub_817018C +sub_817018C: @ 817018C + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0 + bl SetVBlankCallback + ldr r4, _081701B8 + movs r0, 0x89 + lsls r0, 4 + bl malloc + str r0, [r4] + ldr r1, _081701BC + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2] + str r5, [r0] + ldr r0, _081701C0 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081701B8: .4byte 0x0203bcd0 +_081701BC: .4byte 0x0000088c +_081701C0: .4byte sub_81701C4 + 1 + thumb_func_end sub_817018C + + thumb_func_start sub_81701C4 +sub_81701C4: @ 81701C4 + push {lr} + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08170250 + movs r0, 0x1 + movs r2, 0x2 + bl bg_vram_setup + ldr r0, _08170254 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + movs r1, 0x27 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + ldr r0, _08170258 + bl set_callback2 + ldr r0, _0817025C + bl SetVBlankCallback + pop {r0} + bx r0 + .align 2, 0 +_08170250: .4byte 0x085e5068 +_08170254: .4byte 0x085e5070 +_08170258: .4byte sub_8170274 + 1 +_0817025C: .4byte sub_8170260 + 1 + thumb_func_end sub_81701C4 + + thumb_func_start sub_8170260 +sub_8170260: @ 8170260 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8170260 + + thumb_func_start sub_8170274 +sub_8170274: @ 8170274 + push {lr} + bl sub_8170290 + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + thumb_func_end sub_8170274 + + thumb_func_start sub_8170290 +sub_8170290: @ 8170290 + push {r4,r5,lr} + sub sp, 0xC + ldr r1, _081702B0 + ldr r0, [r1] + ldr r2, _081702B4 + adds r0, r2 + ldrh r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _081702A6 + b _08170416 +_081702A6: + lsls r0, 2 + ldr r1, _081702B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081702B0: .4byte 0x0203bcd0 +_081702B4: .4byte 0x0000088c +_081702B8: .4byte _081702BC + .align 2, 0 +_081702BC: + .4byte _081702D8 + .4byte _08170300 + .4byte _08170358 + .4byte _08170380 + .4byte _08170394 + .4byte _081703C0 + .4byte _081703E8 +_081702D8: + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + bl sub_8122CDC + movs r0, 0 + movs r1, 0 + bl sub_8124288 + movs r0, 0x1 + movs r1, 0x1 + bl sub_81240D4 + ldr r1, [r4] + ldr r0, _081702FC + adds r1, r0 + b _081703D8 + .align 2, 0 +_081702FC: .4byte 0x0000088c +_08170300: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r5, _08170354 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl sub_81DB35C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xD + bl SetWindowBorderStyle + bl sub_8170428 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + b _081703CC + .align 2, 0 +_08170354: .4byte 0x085ee8f1 +_08170358: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set_bits + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r0, _08170378 + ldr r1, [r0] + ldr r0, _0817037C + adds r1, r0 + b _081703D8 + .align 2, 0 +_08170378: .4byte 0x0203bcd0 +_0817037C: .4byte 0x0000088c +_08170380: + ldr r0, _08170390 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08170416 + ldr r1, [r4] + b _081703D4 + .align 2, 0 +_08170390: .4byte 0x02037fd4 +_08170394: + bl sub_81230AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _081703A6 + bl sub_8170428 + b _08170416 +_081703A6: + cmp r0, 0x3 + blt _08170416 + cmp r0, 0x5 + bgt _08170416 + ldr r0, _081703B8 + ldr r1, [r0] + ldr r0, _081703BC + adds r1, r0 + b _081703D8 + .align 2, 0 +_081703B8: .4byte 0x0203bcd0 +_081703BC: .4byte 0x0000088c +_081703C0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_081703CC: + bl sub_80A1AD4 + ldr r0, _081703E0 + ldr r1, [r0] +_081703D4: + ldr r2, _081703E4 + adds r1, r2 +_081703D8: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08170416 + .align 2, 0 +_081703E0: .4byte 0x0203bcd0 +_081703E4: .4byte 0x0000088c +_081703E8: + ldr r0, _08170420 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08170416 + bl sub_812305C + ldr r4, _08170424 + ldr r0, [r4] + ldr r0, [r0] + bl set_callback2 + ldr r0, [r4] + cmp r0, 0 + beq _08170412 + bl free + str r5, [r4] +_08170412: + bl Window_FreeMemory +_08170416: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08170420: .4byte 0x02037fd4 +_08170424: .4byte 0x0203bcd0 + thumb_func_end sub_8170290 + + thumb_func_start sub_8170428 +sub_8170428: @ 8170428 + push {r4,lr} + sub sp, 0xC + ldr r4, _0817045C + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08170460 + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, [r4] + adds r2, 0xC + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _08170470 + .align 2, 0 +_0817045C: .4byte 0x0203bcd0 +_08170460: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08170470: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8170428 + + thumb_func_start sub_8170478 +sub_8170478: @ 8170478 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + ldr r0, _08170620 + ldrb r4, [r0] + ldr r0, _08170624 + movs r1, 0 + strh r1, [r0] + ldr r0, _08170628 + strh r1, [r0] + ldr r1, _0817062C + movs r0, 0x48 + bl lcd_io_set + ldr r1, _08170630 + movs r0, 0x4A + bl lcd_io_set + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl lcd_io_set_bits + ldr r1, _08170634 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, _08170638 + adds r4, r0 + ldrb r0, [r4] + ldr r1, _0817063C + mov r9, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r9 + ldrb r7, [r4, 0x6] + ldrh r6, [r4, 0x38] + lsls r6, 24 + lsrs r6, 24 + ldr r0, _08170640 + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, _08170640 + bl object_new_hidden_with_callback + mov r10, r0 + mov r2, r10 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldrb r1, [r4, 0x5] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x4 + mov r8, r1 + mov r2, r8 + orrs r0, r2 + strb r0, [r4, 0x5] + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r9 + ldrb r1, [r5, 0x5] + adds r0, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + add r1, r9 + ldrb r2, [r1, 0x5] + adds r0, r3, 0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [sp, 0x14] + lsls r6, r0, 4 + adds r6, r0 + lsls r6, 2 + mov r1, r9 + adds r7, r6, r1 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x44 + str r3, [sp, 0x18] + bl memcpy + mov r2, r10 + lsls r4, r2, 4 + add r4, r10 + lsls r4, 2 + adds r0, r4, 0 + add r0, r9 + mov r8, r0 + adds r1, r5, 0 + movs r2, 0x44 + bl memcpy + ldrb r1, [r7, 0x1] + ldr r3, [sp, 0x18] + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r7, 0x1] + mov r2, r8 + ldrb r0, [r2, 0x1] + ands r3, r0 + orrs r3, r1 + strb r3, [r2, 0x1] + movs r0, 0x1C + add r9, r0 + add r6, r9 + ldr r1, _08170640 + str r1, [r6] + add r4, r9 + str r1, [r4] + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _08170644 + bl sub_80A6D48 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, _08170648 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, _0817064C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, _08170650 + ldrh r0, [r7, 0x20] + negs r0, r0 + adds r0, 0x20 + strh r0, [r1] + ldr r1, _08170654 + ldrh r0, [r7, 0x22] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1] + ldr r1, _08170658 + ldr r2, [sp, 0x10] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA0 + lsls r1, 2 + strh r1, [r0, 0xA] + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0x8] + mov r2, r10 + strh r2, [r0, 0xC] + ldr r1, _0817065C + str r1, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08170620: .4byte 0x02038436 +_08170624: .4byte 0x02022e24 +_08170628: .4byte 0x02022e26 +_0817062C: .4byte 0x00003f3f +_08170630: .4byte 0x00003f3d +_08170634: .4byte 0x00003f42 +_08170638: .4byte 0x03005d70 +_0817063C: .4byte 0x02020630 +_08170640: .4byte nullsub_12 + 1 +_08170644: .4byte 0x08c2ea9c +_08170648: .4byte 0x08c2ea50 +_0817064C: .4byte 0x08c2dda4 +_08170650: .4byte 0x02022e18 +_08170654: .4byte 0x02022e1a +_08170658: .4byte 0x03005e00 +_0817065C: .4byte sub_8170660 + 1 + thumb_func_end sub_8170478 + + thumb_func_start sub_8170660 +sub_8170660: @ 8170660 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081706A8 + ldrb r0, [r0] + mov r8, r0 + ldr r1, _081706AC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrh r1, [r5, 0xA] + ldrh r0, [r5, 0x22] + adds r1, r0 + movs r3, 0 + strh r1, [r5, 0x22] + ldr r2, _081706B0 + lsls r0, r1, 16 + lsrs r0, 24 + ldrh r4, [r2] + adds r0, r4 + strh r0, [r2] + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x22] + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081706F0 + cmp r0, 0x1 + bgt _081706B4 + cmp r0, 0 + beq _081706BA + b _08170814 + .align 2, 0 +_081706A8: .4byte 0x02038436 +_081706AC: .4byte 0x03005e00 +_081706B0: .4byte 0x02022e1a +_081706B4: + cmp r0, 0x2 + beq _08170708 + b _08170814 +_081706BA: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _081706CA + b _08170814 +_081706CA: + strh r3, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r2, 0x20 + ldrsh r0, [r5, r2] + cmp r0, 0x8 + beq _081706EE + b _08170814 +_081706EE: + b _08170700 +_081706F0: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + beq _08170700 + b _08170814 +_08170700: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08170814 +_08170708: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08170814 + strh r3, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x20 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _08170814 + movs r0, 0 + bl sub_80A477C + ldr r0, _08170820 + strh r4, [r0] + ldr r0, _08170824 + strh r4, [r0] + ldr r4, _08170828 + movs r0, 0x48 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x4A + adds r1, r4, 0 + bl lcd_io_set + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0817076C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0817076C: + movs r0, 0 + bl lcd_io_get + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r4, 0x8 + ldrsh r1, [r5, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, _0817082C + adds r0, r6 + bl obj_delete_and_free_tiles + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_delete_and_free_tiles + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, _08170830 + add r0, r8 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x6] + mov r8, r2 + ldrh r4, [r1, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1, 0x5] + mov r0, r8 + lsls r1, r0, 4 + add r1, r8 + lsls r1, 2 + adds r1, r6 + ldrb r3, [r1, 0x5] + adds r0, r2, 0 + ands r0, r3 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + ands r2, r1 + orrs r2, r5 + strb r2, [r0, 0x5] + adds r0, r7, 0 + bl move_anim_task_del +_08170814: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08170820: .4byte 0x02022e24 +_08170824: .4byte 0x02022e26 +_08170828: .4byte 0x00003f3f +_0817082C: .4byte 0x02020630 +_08170830: .4byte 0x03005d70 + thumb_func_end sub_8170660 + + thumb_func_start sub_8170834 +sub_8170834: @ 8170834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0817090C + adds r2, r0 + ldrb r0, [r2] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, _08170910 + adds r5, r0 + ldrb r1, [r5, 0x6] + mov r10, r1 + ldrh r4, [r5, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08170914 + bl gpu_pal_alloc_new + mov r2, r9 + strb r0, [r2] + ldr r0, _08170918 + bl gpu_pal_alloc_new + strb r0, [r7] + ldrb r0, [r5, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r3, r1, 0 + orrs r0, r3 + lsls r6, r4, 4 + adds r6, r4 + lsls r6, 2 + ldr r2, _08170910 + adds r6, r2 + ldrb r4, [r6, 0x5] + lsrs r4, 4 + lsls r4, 4 + orrs r4, r3 + lsls r0, 1 + ldr r1, _0817091C + mov r8, r1 + add r0, r8 + mov r2, r9 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r3, r1 + movs r2, 0x20 + str r3, [sp] + bl gpu_pal_apply + lsls r4, 1 + add r4, r8 + ldrb r0, [r7] + lsls r0, 4 + ldr r3, [sp] + adds r3, r0 + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r0, r9 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r5, 0x5] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + mov r2, r10 + lsls r1, r2, 4 + add r1, r10 + lsls r1, 2 + ldr r0, _08170910 + adds r1, r0 + mov r0, r9 + ldrb r2, [r0] + lsls r2, 4 + ldrb r4, [r1, 0x5] + adds r0, r3, 0 + ands r0, r4 + orrs r0, r2 + strb r0, [r1, 0x5] + ldrb r0, [r7] + lsls r0, 4 + ldrb r1, [r6, 0x5] + ands r3, r1 + orrs r3, r0 + strb r3, [r6, 0x5] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817090C: .4byte 0x03005d70 +_08170910: .4byte 0x02020630 +_08170914: .4byte 0x0000d709 +_08170918: .4byte 0x0000d70a +_0817091C: .4byte 0x02037714 + thumb_func_end sub_8170834 + + thumb_func_start sub_8170920 +sub_8170920: @ 8170920 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, sp + adds r1, 0x1 + ldr r0, _08170948 + ldrb r2, [r0] + mov r0, sp + bl sub_8170834 + adds r0, r4, 0 + bl move_anim_task_del + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08170948: .4byte 0x02038436 + thumb_func_end sub_8170920 + + thumb_func_start sub_817094C +sub_817094C: @ 817094C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081709D4 + adds r0, r1 + ldrb r0, [r0] + ldr r1, _081709D8 + mov r8, r1 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + add r5, r8 + ldrb r0, [r5, 0x6] + mov r9, r0 + ldrh r6, [r5, 0x38] + lsls r6, 24 + lsrs r6, 24 + ldr r0, _081709DC + bl gpu_pal_free_tag + ldr r0, _081709E0 + bl gpu_pal_free_tag + ldr r0, _081709E4 + bl gpu_pal_tags_index_of + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081709E8 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsls r4, 4 + ldrb r2, [r5, 0x5] + movs r3, 0xF + adds r1, r3, 0 + ands r1, r2 + orrs r1, r4 + strb r1, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 4 + add r2, r9 + lsls r2, 2 + add r2, r8 + ldrb r5, [r2, 0x5] + adds r1, r3, 0 + ands r1, r5 + orrs r1, r4 + strb r1, [r2, 0x5] + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + add r1, r8 + lsrs r0, 20 + ldrb r2, [r1, 0x5] + ands r3, r2 + orrs r3, r0 + strb r3, [r1, 0x5] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081709D4: .4byte 0x03005d70 +_081709D8: .4byte 0x02020630 +_081709DC: .4byte 0x0000d709 +_081709E0: .4byte 0x0000d70a +_081709E4: .4byte 0x0000d6ff +_081709E8: .4byte 0x0000d704 + thumb_func_end sub_817094C + + thumb_func_start sub_81709EC +sub_81709EC: @ 81709EC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08170A08 + ldrb r0, [r0] + bl sub_817094C + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08170A08: .4byte 0x02038436 + thumb_func_end sub_81709EC + + thumb_func_start sub_8170A0C +sub_8170A0C: @ 8170A0C + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08170A2C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _08170A30 + ldrh r0, [r2] + strh r0, [r1, 0x1C] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0x1E] + ldr r0, _08170A34 + str r0, [r1] + bx lr + .align 2, 0 +_08170A2C: .4byte 0x03005e00 +_08170A30: .4byte 0x0203841e +_08170A34: .4byte sub_8170A38 + 1 + thumb_func_end sub_8170A0C + + thumb_func_start sub_8170A38 +sub_8170A38: @ 8170A38 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08170A84 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r6, 0 + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _08170AF8 + strh r6, [r4, 0x8] + ldr r0, _08170A88 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r2, r0, 24 + movs r3, 0x1C + ldrsh r0, [r4, r3] + movs r1, 0x2 + cmp r0, 0 + bne _08170A76 + movs r1, 0x6 +_08170A76: + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08170A8C + cmp r0, 0x1 + beq _08170AC8 + b _08170AF8 + .align 2, 0 +_08170A84: .4byte 0x03005e00 +_08170A88: .4byte 0x0000d709 +_08170A8C: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08170A9E + movs r0, 0x10 + strh r0, [r4, 0xC] +_08170A9E: + lsls r0, r2, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + orrs r0, r1 + ldrb r2, [r4, 0xC] + ldr r3, _08170AC4 + movs r1, 0x1 + bl pal_fade_1 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bne _08170AF8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _08170AF8 + .align 2, 0 +_08170AC4: .4byte 0x00007f74 +_08170AC8: + ldrh r0, [r4, 0xC] + subs r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bge _08170AD6 + strh r6, [r4, 0xC] +_08170AD6: + lsls r0, r2, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + orrs r0, r1 + ldrb r2, [r4, 0xC] + ldr r3, _08170B00 + movs r1, 0x1 + bl pal_fade_1 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _08170AF8 + adds r0, r5, 0 + bl move_anim_task_del +_08170AF8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08170B00: .4byte 0x00007f74 + thumb_func_end sub_8170A38 + + thumb_func_start sub_8170B04 +sub_8170B04: @ 8170B04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _08170B30 + ldr r0, _08170B34 + ldrb r0, [r0] + adds r0, r1 + ldrb r5, [r0] + ldr r1, _08170B38 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08170B52 + cmp r0, 0x1 + bgt _08170B3C + cmp r0, 0 + beq _08170B42 + b _08170BA4 + .align 2, 0 +_08170B30: .4byte 0x020241e4 +_08170B34: .4byte 0x02038436 +_08170B38: .4byte 0x03005e00 +_08170B3C: + cmp r0, 0x2 + beq _08170B84 + b _08170BA4 +_08170B42: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x1C] + b _08170B76 +_08170B52: + ldrh r0, [r4, 0x1C] + adds r0, 0x30 + strh r0, [r4, 0x1C] + movs r0, 0x1C + ldrsh r2, [r4, r0] + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + movs r0, 0x1C + ldrsh r1, [r4, r0] + ldr r0, _08170B80 + cmp r1, r0 + ble _08170BA4 +_08170B76: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08170BA4 + .align 2, 0 +_08170B80: .4byte 0x000002cf +_08170B84: + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, _08170BAC + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0 + bl move_anim_task_del +_08170BA4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08170BAC: .4byte 0x02020630 + thumb_func_end sub_8170B04 + + thumb_func_start sub_8170BB0 +sub_8170BB0: @ 8170BB0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08170BE8 + ldr r4, _08170BEC + ldrb r0, [r4] + adds r1, r0, r1 + ldrb r1, [r1] + mov r9, r1 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08170BF8 + ldr r1, _08170BF0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08170BF4 + b _08170C08 + .align 2, 0 +_08170BE8: .4byte 0x020241e4 +_08170BEC: .4byte 0x02038436 +_08170BF0: .4byte 0x0202406e +_08170BF4: .4byte 0x020244ec +_08170BF8: + ldr r1, _08170C38 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08170C3C +_08170C08: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, _08170C40 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r2 + movs r0, 0x8 + ldrsh r7, [r6, r0] + cmp r7, 0 + beq _08170C44 + cmp r7, 0x1 + beq _08170CC4 + b _08170CEE + .align 2, 0 +_08170C38: .4byte 0x0202406e +_08170C3C: .4byte 0x02024744 +_08170C40: .4byte 0x03005e00 +_08170C44: + ldr r5, _08170CBC + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + ldr r2, _08170CC0 + mov r3, r9 + lsls r0, r3, 4 + add r0, r9 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r0, 0x43 + ldrb r3, [r0] + movs r0, 0x80 + lsls r0, 22 + adds r1, r0 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + adds r0, r4, 0 + bl sub_8171D98 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1C] + str r7, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r2, r0, 0 + ldrb r1, [r5] + movs r0, 0 + mov r3, r8 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08170CEE + .align 2, 0 +_08170CBC: .4byte 0x02038436 +_08170CC0: .4byte 0x02020630 +_08170CC4: + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08170CEE + movs r3, 0x1E + ldrsh r0, [r6, r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08170CEE + adds r0, r5, 0 + bl move_anim_task_del +_08170CEE: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8170BB0 + + thumb_func_start sub_8170CFC +sub_8170CFC: @ 8170CFC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08170D20 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + bl sub_8076A78 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08170D20: .4byte 0x02024208 + thumb_func_end sub_8170CFC + + thumb_func_start sub_8170D24 +sub_8170D24: @ 8170D24 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08170D48 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + bl sub_8076AE8 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08170D48: .4byte 0x02024208 + thumb_func_end sub_8170D24 + + thumb_func_start sub_8170D4C +sub_8170D4C: @ 8170D4C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08170D64 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08170D70 + ldr r1, _08170D68 + ldr r0, _08170D6C + b _08170D74 + .align 2, 0 +_08170D64: .4byte 0x020244d0 +_08170D68: .4byte 0x0203841e +_08170D6C: .4byte 0x0000ffff +_08170D70: + ldr r1, _08170D80 + movs r0, 0 +_08170D74: + strh r0, [r1, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08170D80: .4byte 0x0203841e + thumb_func_end sub_8170D4C + + thumb_func_start ball_number_to_ball_processing_index +ball_number_to_ball_processing_index: @ 8170D84 + push {lr} + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r0, 0xB + bhi _08170DFC + lsls r0, 2 + ldr r1, _08170D9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08170D9C: .4byte _08170DA0 + .align 2, 0 +_08170DA0: + .4byte _08170DD0 + .4byte _08170DD4 + .4byte _08170DD8 + .4byte _08170DFC + .4byte _08170DDC + .4byte _08170DE0 + .4byte _08170DE4 + .4byte _08170DE8 + .4byte _08170DEC + .4byte _08170DF0 + .4byte _08170DF4 + .4byte _08170DF8 +_08170DD0: + movs r0, 0x4 + b _08170DFE +_08170DD4: + movs r0, 0x3 + b _08170DFE +_08170DD8: + movs r0, 0x1 + b _08170DFE +_08170DDC: + movs r0, 0x2 + b _08170DFE +_08170DE0: + movs r0, 0x5 + b _08170DFE +_08170DE4: + movs r0, 0x6 + b _08170DFE +_08170DE8: + movs r0, 0x7 + b _08170DFE +_08170DEC: + movs r0, 0x8 + b _08170DFE +_08170DF0: + movs r0, 0x9 + b _08170DFE +_08170DF4: + movs r0, 0xA + b _08170DFE +_08170DF8: + movs r0, 0xB + b _08170DFE +_08170DFC: + movs r0, 0 +_08170DFE: + pop {r1} + bx r1 + thumb_func_end ball_number_to_ball_processing_index + + thumb_func_start sub_8170E04 +sub_8170E04: @ 8170E04 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + mov r10, r0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, _08170ECC + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, _08170ED0 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl obj_add_from_template_forward_search + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _08170ED4 + mov r9, r1 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r6, r4, r1 + movs r0, 0x22 + strh r0, [r6, 0x2E] + ldr r2, _08170ED8 + mov r8, r2 + ldrb r0, [r2] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x30] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r6, 0x32] + mov r0, r9 + adds r0, 0x1C + adds r4, r0 + ldr r0, _08170EDC + str r0, [r4] + ldr r0, _08170EE0 + ldr r0, [r0] + ldr r3, [r0, 0x8] + ldr r1, _08170EE4 + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + 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 + lsls r1, 1 + ldrb r2, [r3, 0x9] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] + ldr r1, _08170EE8 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, _08170EEC + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08170ECC: .4byte 0x02024208 +_08170ED0: .4byte 0x0832c588 +_08170ED4: .4byte 0x02020630 +_08170ED8: .4byte 0x02038437 +_08170EDC: .4byte sub_8171104 + 1 +_08170EE0: .4byte 0x020244d0 +_08170EE4: .4byte 0x020241e4 +_08170EE8: .4byte 0x03005e00 +_08170EEC: .4byte sub_8170EF0 + 1 + thumb_func_end sub_8170E04 + + thumb_func_start sub_8170EF0 +sub_8170EF0: @ 8170EF0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _08170F20 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + ldr r2, _08170F24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + ldr r0, _08170F28 + cmp r1, r0 + bne _08170F1A + adds r0, r3, 0 + bl move_anim_task_del +_08170F1A: + pop {r0} + bx r0 + .align 2, 0 +_08170F20: .4byte 0x03005e00 +_08170F24: .4byte 0x02020630 +_08170F28: .4byte 0x0000ffff + thumb_func_end sub_8170EF0 + + thumb_func_start sub_8170F2C +sub_8170F2C: @ 8170F2C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _08170F4C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08170F50 + movs r6, 0x20 + movs r5, 0xB + b _08170F54 + .align 2, 0 +_08170F4C: .4byte 0x02022fec +_08170F50: + movs r6, 0x17 + movs r5, 0x5 +_08170F54: + ldr r0, _0817100C + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl sub_80A82E4 + adds r3, r0, 0 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, _08171010 + adds r0, r1 + adds r1, r6, 0 + adds r1, 0x20 + movs r2, 0x50 + orrs r5, r2 + adds r2, r5, 0 + bl obj_add_from_template_forward_search + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _08171014 + mov r9, r0 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r6, r4, r0 + movs r0, 0x22 + strh r0, [r6, 0x2E] + ldr r1, _08171018 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x30] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r6, 0x32] + movs r0, 0x1C + add r9, r0 + add r4, r9 + ldr r0, _0817101C + str r0, [r4] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _08171020 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldr r1, _08171024 + str r1, [r0] + ldr r1, _08171028 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, _0817102C + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817100C: .4byte 0x02024208 +_08171010: .4byte 0x0832c588 +_08171014: .4byte 0x02020630 +_08171018: .4byte 0x02038437 +_0817101C: .4byte nullsub_12 + 1 +_08171020: .4byte 0x020241e4 +_08171024: .4byte sub_8039E84 + 1 +_08171028: .4byte 0x03005e00 +_0817102C: .4byte sub_8171030 + 1 + thumb_func_end sub_8170F2C + + thumb_func_start sub_8171030 +sub_8171030: @ 8171030 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _08171090 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _08171094 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _0817108A + movs r0, 0x3D + movs r1, 0 + bl audio_play_and_stuff + ldr r0, _08171098 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _0817109C + str r1, [r0] + ldr r0, _081710A0 + movs r1, 0xA + bl AddTask + ldr r0, _081710A4 + str r0, [r4] +_0817108A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08171090: .4byte 0x02020630 +_08171094: .4byte 0x020241e4 +_08171098: .4byte 0x03005e00 +_0817109C: .4byte sub_8171104 + 1 +_081710A0: .4byte sub_81710A8 + 1 +_081710A4: .4byte sub_8170EF0 + 1 + thumb_func_end sub_8171030 + + thumb_func_start sub_81710A8 +sub_81710A8: @ 81710A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _081710FC + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, _08171100 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _081710F4 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0 + bl obj_anim_image_start + adds r0, r5, 0 + bl remove_task +_081710F4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081710FC: .4byte 0x02020630 +_08171100: .4byte 0x020241e4 + thumb_func_end sub_81710A8 + + thumb_func_start sub_8171104 +sub_8171104: @ 8171104 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x32] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r0, _0817112C + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, _08171130 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817112C: .4byte 0x0000ffd8 +_08171130: .4byte sub_8171134 + 1 + thumb_func_end sub_8171104 + + thumb_func_start sub_8171134 +sub_8171134: @ 8171134 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081711D2 + ldr r0, _08171158 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08171160 + ldr r0, _0817115C + str r0, [r4, 0x1C] + b _081711D2 + .align 2, 0 +_08171158: .4byte 0x020244d0 +_0817115C: .4byte sub_8171CAC + 1 +_08171160: + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + adds r1, r4, 0 + adds r1, 0x2E + movs r2, 0 + adds r0, r4, 0 + adds r0, 0x3C +_08171188: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _08171188 + movs r0, 0 + strh r0, [r4, 0x38] + ldr r0, _081711DC + str r0, [r4, 0x1C] + ldr r0, _081711E0 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xB + bgt _081711D2 + cmp r5, 0 + blt _081711D2 + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + str r5, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldr r0, _081711E4 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_081711D2: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081711DC: .4byte sub_81711E8 + 1 +_081711E0: .4byte 0x02024208 +_081711E4: .4byte 0x02038437 + thumb_func_end sub_8171134 + + thumb_func_start sub_81711E8 +sub_81711E8: @ 81711E8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08171224 + ldr r0, _0817122C + movs r1, 0x32 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x38] + ldr r0, _08171230 + str r0, [r4, 0x1C] + ldr r2, _08171234 + ldr r1, _08171238 + ldr r0, _0817123C + ldrb r0, [r0] + 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, 0x30] +_08171224: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817122C: .4byte nullsub_4 + 1 +_08171230: .4byte sub_8171240 + 1 +_08171234: .4byte 0x02020630 +_08171238: .4byte 0x020241e4 +_0817123C: .4byte 0x02038437 + thumb_func_end sub_81711E8 + + thumb_func_start sub_8171240 +sub_8171240: @ 8171240 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r1, _08171284 + ldr r0, _08171288 + ldrb r0, [r0] + adds r0, r1 + ldrb r4, [r0] + ldrh r0, [r7, 0x38] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0817128C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08171272 + movs r0, 0x3C + bl audio_play +_08171272: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081712E8 + cmp r0, 0x1 + bgt _08171290 + cmp r0, 0 + beq _08171296 + b _08171354 + .align 2, 0 +_08171284: .4byte 0x020241e4 +_08171288: .4byte 0x02038437 +_0817128C: .4byte 0x03005e00 +_08171290: + cmp r0, 0x2 + beq _0817132C + b _08171354 +_08171296: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x1C] + ldr r1, _081712D8 + movs r0, 0x1C + str r0, [r1] + ldr r2, _081712DC + ldr r1, _081712E0 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + ldrh r0, [r7, 0x26] + ldrh r7, [r7, 0x22] + adds r0, r7 + subs r1, r0 + strh r1, [r2] + ldr r4, _081712E4 + ldrh r0, [r2] + lsls r0, 8 + movs r1, 0x1C + bl __udivsi3 + strh r0, [r4] + strh r0, [r5, 0xC] + b _08171346 + .align 2, 0 +_081712D8: .4byte 0x030062dc +_081712DC: .4byte 0x030062e4 +_081712E0: .4byte 0x02020630 +_081712E4: .4byte 0x030062e0 +_081712E8: + ldrh r0, [r5, 0x1C] + adds r0, 0x20 + strh r0, [r5, 0x1C] + movs r0, 0x1C + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0xC] + ldrh r1, [r5, 0xE] + adds r0, r1 + strh r0, [r5, 0xE] + ldr r0, _08171324 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r2, 0xE + ldrsh r0, [r5, r2] + negs r0, r0 + asrs r0, 8 + strh r0, [r1, 0x26] + movs r0, 0x1C + ldrsh r1, [r5, r0] + ldr r0, _08171328 + cmp r1, r0 + ble _0817137C + b _08171346 + .align 2, 0 +_08171324: .4byte 0x02020630 +_08171328: .4byte 0x0000047f +_0817132C: + adds r0, r4, 0 + bl sub_80A7344 + ldr r1, _08171350 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08171346: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0817137C + .align 2, 0 +_08171350: .4byte 0x02020630 +_08171354: + ldr r0, _08171384 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0xA + ble _0817137C + adds r0, r6, 0 + bl remove_task + adds r0, r7, 0 + movs r1, 0x2 + bl obj_anim_image_start + movs r0, 0 + strh r0, [r7, 0x38] + ldr r0, _08171388 + str r0, [r7, 0x1C] +_0817137C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08171384: .4byte 0x03005e00 +_08171388: .4byte sub_817138C + 1 + thumb_func_end sub_8171240 + + thumb_func_start sub_817138C +sub_817138C: @ 817138C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081713C6 + movs r1, 0 + strh r1, [r4, 0x34] + movs r0, 0x28 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + movs r0, 0 + movs r1, 0x28 + 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, _081713CC + str r0, [r4, 0x1C] +_081713C6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081713CC: .4byte sub_81713D0 + 1 + thumb_func_end sub_817138C + + thumb_func_start sub_81713D0 +sub_81713D0: @ 81713D0 + 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 _081713E6 + cmp r1, 0x1 + beq _0817145A + b _08171486 +_081713E6: + 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 _08171486 + ldrh r0, [r4, 0x36] + subs r0, 0xA + strh r0, [r4, 0x36] + ldr r1, _08171430 + adds r0, r2, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _08171422 + movs r5, 0x1 +_08171422: + cmp r0, 0x2 + beq _08171442 + cmp r0, 0x2 + bgt _08171434 + cmp r0, 0x1 + beq _0817143A + b _08171452 + .align 2, 0 +_08171430: .4byte 0x00000101 +_08171434: + cmp r0, 0x3 + beq _0817144A + b _08171452 +_0817143A: + movs r0, 0x38 + bl audio_play + b _08171486 +_08171442: + movs r0, 0x39 + bl audio_play + b _08171486 +_0817144A: + movs r0, 0x3A + bl audio_play + b _08171486 +_08171452: + movs r0, 0x3B + bl audio_play + b _08171486 +_0817145A: + 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 _08171486 + strh r5, [r4, 0x38] + ldr r0, _081714B4 + ands r0, r2 + strh r0, [r4, 0x34] +_08171486: + cmp r5, 0 + beq _081714CA + movs r5, 0 + strh r5, [r4, 0x34] + movs r0, 0x40 + movs r1, 0x28 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + ldr r0, _081714B8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081714C0 + strh r5, [r4, 0x38] + ldr r0, _081714BC + str r0, [r4, 0x1C] + b _081714CA + .align 2, 0 +_081714B4: .4byte 0xffffff00 +_081714B8: .4byte 0x020244d0 +_081714BC: .4byte sub_81717B4 + 1 +_081714C0: + ldr r0, _081714D0 + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_081714CA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081714D0: .4byte sub_81714D4 + 1 + thumb_func_end sub_81713D0 + + thumb_func_start sub_81714D4 +sub_81714D4: @ 81714D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08171510 + strh r5, [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 sub_8008258 + ldr r0, _08171518 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strh r5, [r0, 0xC] + ldr r0, _0817151C + str r0, [r4, 0x1C] + movs r0, 0x17 + bl audio_play +_08171510: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08171518: .4byte 0x020244d0 +_0817151C: .4byte sub_8171520 + 1 + thumb_func_end sub_81714D4 + + thumb_func_start sub_8171520 +sub_8171520: @ 8171520 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x6 + bls _08171530 + b _08171768 +_08171530: + lsls r0, r1, 2 + ldr r1, _0817153C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817153C: .4byte _08171540 + .align 2, 0 +_08171540: + .4byte _0817155C + .4byte _081715AE + .4byte _081715F4 + .4byte _08171654 + .4byte _081716A4 + .4byte _08171708 + .4byte _08171768 +_0817155C: + ldr r1, _08171580 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _08171584 + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _0817158A + .align 2, 0 +_08171580: .4byte 0x020244d0 +_08171584: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_0817158A: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + 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, 0x7 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bhi _081715AC + b _081717AE +_081715AC: + b _08171644 +_081715AE: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08171660 + 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 r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _081715EA + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _081717AE +_081715EA: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _081717AE +_081715F4: + ldr r1, _08171618 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _0817161C + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _08171622 + .align 2, 0 +_08171618: .4byte 0x020244d0 +_0817161C: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_08171622: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + 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, 0xC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x18 + bhi _08171644 + b _081717AE +_08171644: + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r3, [r0, 0xC] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + strh r3, [r4, 0x38] + b _081717AE +_08171654: + ldrh r0, [r4, 0x38] + adds r1, r0, 0x1 + strh r1, [r4, 0x38] + lsls r0, 16 + cmp r0, 0 + bge _0817166E +_08171660: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _081717AE +_0817166E: + 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 r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _0817169C + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _081716A4 +_0817169C: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 +_081716A4: + ldr r1, _081716C8 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _081716CC + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _081716D2 + .align 2, 0 +_081716C8: .4byte 0x020244d0 +_081716CC: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_081716D2: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + 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, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _081717AE + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r3, [r0, 0xC] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + strh r3, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + b _081717AE +_08171708: + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r1, r0, 24 + ldr r0, _08171738 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r1, r0 + bne _08171740 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0817173C + str r0, [r4, 0x1C] + b _081717AE + .align 2, 0 +_08171738: .4byte 0x020244d0 +_0817173C: .4byte sub_81717B4 + 1 +_08171740: + cmp r0, 0x4 + bne _08171754 + cmp r1, 0x3 + bne _08171754 + ldr r0, _08171750 + str r0, [r4, 0x1C] + b _0817175A + .align 2, 0 +_08171750: .4byte sub_81717D8 + 1 +_08171754: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] +_0817175A: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + b _081717AE +_08171768: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _081717AE + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + ldr r0, _0817179C + ands r0, r1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_8008258 + movs r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _081717A0 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8008258 + b _081717A8 + .align 2, 0 +_0817179C: .4byte 0xffffff00 +_081717A0: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 +_081717A8: + movs r0, 0x17 + bl audio_play +_081717AE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8171520 + + thumb_func_start sub_81717B4 +sub_81717B4: @ 81717B4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x38] + adds r0, 0x1 + strh r0, [r1, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _081717CE + movs r0, 0 + strh r0, [r1, 0x38] + ldr r0, _081717D4 + str r0, [r1, 0x1C] +_081717CE: + pop {r0} + bx r0 + .align 2, 0 +_081717D4: .4byte sub_8171AE4 + 1 + thumb_func_end sub_81717B4 + + thumb_func_start sub_81717D8 +sub_81717D8: @ 81717D8 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + ldr r1, _081717F4 + str r1, [r0, 0x1C] + movs r1, 0 + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + bx lr + .align 2, 0 +_081717F4: .4byte sub_81717F8 + 1 + thumb_func_end sub_81717D8 + + thumb_func_start sub_81717F8 +sub_81717F8: @ 81717F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + ldr r7, _08171838 + ldrh r0, [r6, 0x36] + adds r0, 0x1 + movs r1, 0 + mov r8, r1 + strh r0, [r6, 0x36] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x28 + bne _0817183C + movs r0, 0xFE + bl audio_play + ldrb r1, [r6, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + movs r1, 0x6 + movs r2, 0 + bl sub_80A2A20 + adds r0, r6, 0 + bl sub_81719EC + b _081718BC + .align 2, 0 +_08171838: .4byte 0x02038437 +_0817183C: + cmp r1, 0x3C + bne _0817185A + ldrb r1, [r6, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + mov r1, r8 + str r1, [sp] + movs r1, 0x2 + movs r2, 0x6 + movs r3, 0 + bl sub_80A1AD4 + b _081718BC +_0817185A: + cmp r1, 0x5F + bne _08171880 + ldr r0, _08171878 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + bl sub_8072A88 + bl m4aMPlayAllStop + ldr r0, _0817187C + bl audio_play + b _081718BC + .align 2, 0 +_08171878: .4byte 0x020244b9 +_0817187C: .4byte 0x00000213 +_08171880: + ldr r0, _081718C8 + cmp r1, r0 + bne _081718BC + ldr r5, _081718CC + ldr r4, _081718D0 + ldrb r0, [r7] + 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 + ldrb r0, [r7] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + mov r0, r8 + strh r0, [r6, 0x2E] + ldr r0, _081718D4 + str r0, [r6, 0x1C] +_081718BC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081718C8: .4byte 0x0000013b +_081718CC: .4byte 0x02020630 +_081718D0: .4byte 0x020241e4 +_081718D4: .4byte sub_81718D8 + 1 + thumb_func_end sub_81717F8 + + thumb_func_start sub_81718D8 +sub_81718D8: @ 81718D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08171944 + cmp r0, 0x1 + bgt _081718F0 + cmp r0, 0 + beq _081718F6 + b _0817198A +_081718F0: + cmp r0, 0x2 + beq _08171976 + b _0817198A +_081718F6: + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldr r0, [r4, 0x14] + ldrh r0, [r0, 0x2] + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + ldr r0, _08171940 + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _08171982 + .align 2, 0 +_08171940: .4byte 0x00007fff +_08171944: + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + ble _081719B0 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r2, [r4, 0x32] + adds r2, 0x1 + strh r2, [r4, 0x32] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081719B0 + b _08171982 +_08171976: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08171982: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081719B0 +_0817198A: + ldr r0, _081719B8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081719B0 + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + strh r5, [r4, 0x2E] + ldr r0, _081719BC + str r0, [r4, 0x1C] +_081719B0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081719B8: .4byte 0x02037fd4 +_081719BC: .4byte sub_81719C0 + 1 + thumb_func_end sub_81718D8 + + thumb_func_start sub_81719C0 +sub_81719C0: @ 81719C0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081719D8 + ldr r0, _081719D4 + strh r0, [r4, 0x2E] + b _081719E4 + .align 2, 0 +_081719D4: .4byte 0x0000ffff +_081719D8: + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_081719E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81719C0 + + thumb_func_start sub_81719EC +sub_81719EC: @ 81719EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + adds r1, r6, 0 + adds r1, 0x43 + ldrb r0, [r1] + cmp r0, 0 + beq _08171A0C + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + b _08171A14 +_08171A0C: + movs r0, 0 + mov r8, r0 + movs r0, 0x1 + strb r0, [r1] +_08171A14: + movs r0, 0x4 + bl sub_8171D60 + movs r7, 0 + ldr r2, _08171A98 + mov r9, r2 + movs r0, 0x1C + add r0, r9 + mov r10, r0 +_08171A26: + movs r2, 0x20 + ldrsh r1, [r6, r2] + movs r0, 0x22 + ldrsh r2, [r6, r0] + ldr r0, _08171A9C + mov r3, r8 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08171A82 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r2, r9 + adds r5, r4, r2 + movs r0, 0x18 + strh r0, [r5, 0x2E] + ldr r0, _08171AA0 + lsls r1, r7, 2 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrh r2, [r6, 0x20] + adds r0, r2 + strh r0, [r5, 0x32] + movs r0, 0x1 + ldrsb r0, [r1, r0] + ldrh r2, [r6, 0x22] + adds r0, r2 + strh r0, [r5, 0x36] + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + add r4, r10 + ldr r0, _08171AA4 + str r0, [r4] + ldr r0, _08171AA8 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + bl obj_anim_image_start +_08171A82: + adds r7, 0x1 + cmp r7, 0x2 + bls _08171A26 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08171A98: .4byte 0x02020630 +_08171A9C: .4byte 0x085e5250 +_08171AA0: .4byte 0x085e5088 +_08171AA4: .4byte sub_8171AAC + 1 +_08171AA8: .4byte 0x085e51b4 + thumb_func_end sub_81719EC + + thumb_func_start sub_8171AAC +sub_8171AAC: @ 8171AAC + push {r4,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08171ADC + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08171ADC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8171AAC + + thumb_func_start sub_8171AE4 +sub_8171AE4: @ 8171AE4 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x1 + bl obj_anim_image_start + adds r0, r4, 0 + movs r1, 0 + bl sub_8008258 + ldr r0, _08171B98 + str r0, [r4, 0x1C] + ldr r0, _08171B9C + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xB + bgt _08171B36 + cmp r5, 0 + blt _08171B36 + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + str r5, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldr r0, _08171BA0 + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_08171B36: + ldr r6, _08171BA4 + ldr r5, _08171BA8 + ldr r4, _08171BA0 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl sub_8008258 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_anim_step + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x80 + lsls r1, 5 + strh r1, [r0, 0x30] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08171B98: .4byte sub_8171BAC + 1 +_08171B9C: .4byte 0x02024208 +_08171BA0: .4byte 0x02038437 +_08171BA4: .4byte 0x02020630 +_08171BA8: .4byte 0x020241e4 + thumb_func_end sub_8171AE4 + + thumb_func_start sub_8171BAC +sub_8171BAC: @ 8171BAC + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08171BCA + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08171BCA: + ldr r4, _08171BF8 + ldr r3, _08171BFC + ldr r2, _08171C00 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08171C04 + adds r0, r1, 0 + movs r1, 0 + bl sub_8008258 + movs r5, 0x1 + b _08171C24 + .align 2, 0 +_08171BF8: .4byte 0x02020630 +_08171BFC: .4byte 0x020241e4 +_08171C00: .4byte 0x02038437 +_08171C04: + ldr r6, _08171C90 + adds r0, r6, 0 + ldrh r6, [r1, 0x30] + adds r0, r6 + strh r0, [r1, 0x30] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + 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] +_08171C24: + adds r0, r7, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08171C8A + cmp r5, 0 + beq _08171C8A + ldr r4, _08171C94 + ldr r3, _08171C98 + ldr r2, _08171C9C + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0 + movs r5, 0 + strh r5, [r0, 0x26] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, _08171CA0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + lsls r1, 30 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + strh r5, [r7, 0x2E] + ldr r0, _08171CA4 + str r0, [r7, 0x1C] + ldr r0, _08171CA8 + strb r6, [r0] + movs r0, 0x1 + bl sub_8072A88 +_08171C8A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08171C90: .4byte 0xfffffee0 +_08171C94: .4byte 0x02020630 +_08171C98: .4byte 0x020241e4 +_08171C9C: .4byte 0x02038437 +_08171CA0: .4byte 0x020244d0 +_08171CA4: .4byte sub_81719C0 + 1 +_08171CA8: .4byte 0x020244b9 + thumb_func_end sub_8171BAC + + thumb_func_start sub_8171CAC +sub_8171CAC: @ 8171CAC + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x26] + ldrh r3, [r2, 0x22] + adds r0, r3 + strh r0, [r2, 0x22] + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + ldr r4, _08171CE4 + movs r3, 0 + movs r1, 0x5 + adds r0, r2, 0 + adds r0, 0x38 +_08171CD0: + strh r3, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08171CD0 + str r4, [r2, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08171CE4: .4byte sub_8171CE8 + 1 + thumb_func_end sub_8171CAC + + thumb_func_start sub_8171CE8 +sub_8171CE8: @ 8171CE8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 4 + adds r2, r0, 0 + ldrh r1, [r4, 0x2E] + adds r2, r1 + movs r0, 0xD0 + lsls r0, 3 + adds r3, r0, 0 + ldrh r1, [r4, 0x30] + adds r3, r1 + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x2E] + ands r3, r0 + strh r3, [r4, 0x30] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0xA0 + bgt _08171D3E + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _08171D52 +_08171D3E: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, _08171D58 + str r0, [r4, 0x1C] + ldr r1, _08171D5C + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + bl sub_8072A88 +_08171D52: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08171D58: .4byte sub_81719C0 + 1 +_08171D5C: .4byte 0x020244b9 + thumb_func_end sub_8171CE8 + + thumb_func_start sub_8171D60 +sub_8171D60: @ 8171D60 + push {r4,r5,lr} + lsls r0, 24 + ldr r1, _08171D8C + lsrs r5, r0, 21 + adds r4, r5, r1 + ldrh r0, [r4, 0x6] + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + ldr r1, _08171D90 + cmp r0, r1 + bne _08171D86 + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _08171D94 + adds r0, r5, r0 + bl gpu_pal_obj_decompress_and_apply3 +_08171D86: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08171D8C: .4byte 0x085e5094 +_08171D90: .4byte 0xffff0000 +_08171D94: .4byte 0x085e50f4 + thumb_func_end sub_8171D60 + + thumb_func_start sub_8171D98 +sub_8171D98: @ 8171D98 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + mov r10, r3 + ldr r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_8171D60 + ldr r1, _08171E18 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x5 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08171E1C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + mov r1, r8 + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + mov r1, r10 + strh r1, [r0, 0x10] + strh r5, [r0, 0x26] + movs r0, 0xF + bl audio_play + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08171E18: .4byte 0x085e51c0 +_08171E1C: .4byte 0x03005e00 + thumb_func_end sub_8171D98 + + thumb_func_start sub_8171E20 +sub_8171E20: @ 8171E20 + push {lr} + ldr r0, _08171E44 + ldr r1, _08171E48 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08171E3E + ldr r0, _08171E4C + ldr r0, [r0] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] +_08171E3E: + pop {r0} + bx r0 + .align 2, 0 +_08171E44: .4byte 0x030022c0 +_08171E48: .4byte 0x00000439 +_08171E4C: .4byte 0x020244d0 + thumb_func_end sub_8171E20 + + thumb_func_start sub_8171E50 +sub_8171E50: @ 8171E50 + 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 r8, r0 + ldr r1, _08171F2C + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r2, 0x8 + ldrsh r0, [r6, r2] + adds r2, r1, 0 + cmp r0, 0xF + bgt _08171F48 + ldrb r1, [r6, 0xA] + ldrb r2, [r6, 0xC] + ldrb r4, [r6, 0xE] + mov r9, r4 + ldrb r3, [r6, 0x10] + ldr r4, [sp] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r4, _08171F30 + adds r0, r4 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x40 + beq _08171EEC + bl sub_8171E20 + mov r0, r10 + lsls r4, r0, 4 + add r4, r10 + lsls r4, 2 + ldr r5, _08171F34 + adds r7, r4, r5 + ldr r0, _08171F38 + ldr r1, [sp] + adds r0, r1, r0 + ldrb r1, [r0] + adds r0, r7, 0 + bl obj_anim_image_start + adds r5, 0x1C + adds r4, r5 + ldr r0, _08171F3C + str r0, [r4] + movs r0, 0x3 + mov r2, r9 + ands r2, r0 + lsls r2, 2 + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r7, 0x5] + ldrb r0, [r6, 0x8] + cmp r0, 0x7 + bls _08171EE8 + subs r0, 0x8 + lsls r0, 24 + lsrs r0, 24 +_08171EE8: + lsls r0, 5 + strh r0, [r7, 0x2E] +_08171EEC: + ldr r0, _08171F2C + mov r4, r8 + lsls r1, r4, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r1, [r1, r2] + adds r2, r0, 0 + cmp r1, 0xF + bne _08171F48 + ldr r0, _08171F40 + ldr r4, _08171F44 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08171F22 + ldr r0, _08171F34 + mov r2, r10 + lsls r1, r2, 4 + add r1, r10 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08171F22: + mov r0, r8 + bl remove_task + b _08171F58 + .align 2, 0 +_08171F2C: .4byte 0x03005e00 +_08171F30: .4byte 0x085e51f0 +_08171F34: .4byte 0x02020630 +_08171F38: .4byte 0x085e51b4 +_08171F3C: .4byte sub_8171F68 + 1 +_08171F40: .4byte 0x030022c0 +_08171F44: .4byte 0x00000439 +_08171F48: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] +_08171F58: + 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_8171E50 + + thumb_func_start sub_8171F68 +sub_8171F68: @ 8171F68 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x30] + movs r3, 0x30 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08171F80 + ldr r0, _08171F7C + str r0, [r1, 0x1C] + b _08171F84 + .align 2, 0 +_08171F7C: .4byte sub_8171F88 + 1 +_08171F80: + subs r0, r2, 0x1 + strh r0, [r1, 0x30] +_08171F84: + pop {r0} + bx r0 + thumb_func_end sub_8171F68 + + thumb_func_start sub_8171F88 +sub_8171F88: @ 8171F88 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + 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, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bne _08171FBC + adds r0, r4, 0 + bl sub_8172944 +_08171FBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8171F88 + + thumb_func_start sub_8171FC4 +sub_8171FC4: @ 8171FC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _081720A8 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, _081720AC + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_0817200A: + ldr r0, _081720B0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817206A + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, _081720B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _081720B8 + adds r4, r0 + ldr r0, _081720BC + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0xA + strh r0, [r5, 0x36] + movs r0, 0x2 + strh r0, [r5, 0x38] + movs r0, 0x1 + strh r0, [r5, 0x3A] +_0817206A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817200A + ldr r0, _081720C0 + ldr r1, _081720C4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172092 + ldr r0, _081720AC + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172092: + mov r0, r9 + bl remove_task + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081720A8: .4byte 0x03005e00 +_081720AC: .4byte 0x02020630 +_081720B0: .4byte 0x085e51f0 +_081720B4: .4byte 0x085e51b4 +_081720B8: .4byte 0x0202064c +_081720BC: .4byte sub_8172508 + 1 +_081720C0: .4byte 0x030022c0 +_081720C4: .4byte 0x00000439 + thumb_func_end sub_8171FC4 + + thumb_func_start sub_81720C8 +sub_81720C8: @ 81720C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _081721AC + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, _081721B0 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_0817210E: + ldr r0, _081721B4 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817216E + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, _081721B8 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _081721BC + adds r4, r0 + ldr r0, _081721C0 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0xA + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + movs r0, 0x2 + strh r0, [r5, 0x3A] +_0817216E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817210E + ldr r0, _081721C4 + ldr r1, _081721C8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172196 + ldr r0, _081721B0 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172196: + mov r0, r9 + bl remove_task + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081721AC: .4byte 0x03005e00 +_081721B0: .4byte 0x02020630 +_081721B4: .4byte 0x085e51f0 +_081721B8: .4byte 0x085e51b4 +_081721BC: .4byte 0x0202064c +_081721C0: .4byte sub_8172508 + 1 +_081721C4: .4byte 0x030022c0 +_081721C8: .4byte 0x00000439 + thumb_func_end sub_81720C8 + + thumb_func_start sub_81721CC +sub_81721CC: @ 81721CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, _081722AC + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, _081722B0 + mov r8, r3 + ldr r0, _081722B4 + adds r1, r0 + mov r10, r1 +_08172212: + ldr r0, _081722B8 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817226E + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _081722BC + adds r4, r0 + ldr r0, _081722C0 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x4 + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_0817226E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172212 + ldr r0, _081722C4 + ldr r1, _081722C8 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172296 + ldr r0, _081722B0 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172296: + mov r0, r9 + bl remove_task + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081722AC: .4byte 0x03005e00 +_081722B0: .4byte 0x02020630 +_081722B4: .4byte 0x085e51b4 +_081722B8: .4byte 0x085e51f0 +_081722BC: .4byte 0x0202064c +_081722C0: .4byte sub_8172508 + 1 +_081722C4: .4byte 0x030022c0 +_081722C8: .4byte 0x00000439 + thumb_func_end sub_81721CC + + thumb_func_start sub_81722CC +sub_81722CC: @ 81722CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _081723B4 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, _081723B8 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_08172312: + ldr r0, _081723BC + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172376 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, _081723C0 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _081723C4 + adds r4, r0 + ldr r0, _081723C8 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r0, r7 + strh r0, [r5, 0x2E] + movs r0, 0x5 + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_08172376: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x9 + bls _08172312 + ldr r0, _081723CC + ldr r1, _081723D0 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817239E + ldr r0, _081723B8 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_0817239E: + mov r0, r9 + bl remove_task + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081723B4: .4byte 0x03005e00 +_081723B8: .4byte 0x02020630 +_081723BC: .4byte 0x085e51f0 +_081723C0: .4byte 0x085e51b4 +_081723C4: .4byte 0x0202064c +_081723C8: .4byte sub_8172508 + 1 +_081723CC: .4byte 0x030022c0 +_081723D0: .4byte 0x00000439 + thumb_func_end sub_81722CC + + thumb_func_start sub_81723D4 +sub_81723D4: @ 81723D4 + 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 r1, _08172400 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r3, r0, r1 + ldrh r1, [r3, 0x16] + movs r4, 0x16 + ldrsh r0, [r3, r4] + cmp r0, 0 + beq _08172404 + subs r0, r1, 0x1 + strh r0, [r3, 0x16] + b _081724D6 + .align 2, 0 +_08172400: .4byte 0x03005e00 +_08172404: + ldrh r0, [r3, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r3, 0xA] + str r1, [sp] + ldrb r4, [r3, 0xC] + str r4, [sp, 0x4] + ldrb r1, [r3, 0xE] + str r1, [sp, 0x8] + ldrb r3, [r3, 0x10] + str r3, [sp, 0xC] + movs r7, 0 + str r2, [sp, 0x14] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + str r1, [sp, 0x10] + ldr r3, _081724E8 + mov r9, r3 + ldr r1, _081724EC + adds r0, r1 + mov r10, r0 +_08172430: + ldr r0, _081724F0 + ldr r4, [sp, 0x10] + adds r0, r4, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817248C + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r0, r9 + adds r5, r4, r0 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _081724F4 + adds r4, r0 + ldr r0, _081724F8 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x8 + strh r0, [r5, 0x36] + movs r0, 0x2 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_0817248C: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172430 + ldr r0, _081724FC + ldr r1, [sp, 0x14] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x8 + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0x2 + bne _081724D6 + ldr r0, _08172500 + ldr r4, _08172504 + adds r0, r4 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081724D0 + ldr r0, _081724E8 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081724D0: + mov r0, r8 + bl remove_task +_081724D6: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081724E8: .4byte 0x02020630 +_081724EC: .4byte 0x085e51b4 +_081724F0: .4byte 0x085e51f0 +_081724F4: .4byte 0x0202064c +_081724F8: .4byte sub_8172508 + 1 +_081724FC: .4byte 0x03005e00 +_08172500: .4byte 0x030022c0 +_08172504: .4byte 0x00000439 + thumb_func_end sub_81723D4 + + thumb_func_start sub_8172508 +sub_8172508: @ 8172508 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + ldrh r2, [r4, 0x30] + adds r0, r2 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _08172558 + adds r0, r4, 0 + bl sub_8172944 +_08172558: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8172508 + + thumb_func_start sub_8172560 +sub_8172560: @ 8172560 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, _0817263C + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, _08172640 + mov r8, r3 + ldr r0, _08172644 + adds r1, r0 + mov r10, r1 +_081725A6: + ldr r0, _08172648 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _081725FE + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _0817264C + adds r4, r0 + ldr r0, _08172650 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 2 + adds r0, r7 + strh r0, [r5, 0x2E] +_081725FE: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xB + bls _081725A6 + ldr r0, _08172654 + ldr r1, _08172658 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172626 + ldr r0, _08172640 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172626: + mov r0, r9 + bl remove_task + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817263C: .4byte 0x03005e00 +_08172640: .4byte 0x02020630 +_08172644: .4byte 0x085e51b4 +_08172648: .4byte 0x085e51f0 +_0817264C: .4byte 0x0202064c +_08172650: .4byte sub_817265C + 1 +_08172654: .4byte 0x030022c0 +_08172658: .4byte 0x00000439 + thumb_func_end sub_8172560 + + thumb_func_start sub_817265C +sub_817265C: @ 817265C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + movs r2, 0x32 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sine + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl cosine + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x2E] + adds r0, 0x6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _081726B4 + adds r0, r5, 0 + bl sub_8172944 +_081726B4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817265C + + thumb_func_start sub_81726BC +sub_81726BC: @ 81726BC + 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] + ldr r0, _08172770 + ldr r2, [sp] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r3, [r1, 0xA] + str r3, [sp, 0x4] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x8] + ldrb r2, [r1, 0xE] + str r2, [sp, 0xC] + ldrb r1, [r1, 0x10] + str r1, [sp, 0x10] + movs r3, 0 + mov r8, r3 + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 3 + str r0, [sp, 0x14] +_08172700: + movs r7, 0 + movs r2, 0x1 + add r2, r8 + mov r10, r2 +_08172708: + ldr r0, _08172774 + ldr r3, [sp, 0x14] + adds r0, r3, r0 + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + ldr r3, [sp, 0x10] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172790 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + ldr r0, _08172778 + adds r5, r4, r0 + ldr r0, _0817277C + add r0, r9 + ldrb r1, [r0] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r1, _08172780 + adds r4, r1 + ldr r0, _08172784 + str r0, [r4] + movs r0, 0x3 + ldr r1, [sp, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x8 + strh r0, [r5, 0x36] + mov r0, r8 + cmp r0, 0 + bne _08172788 + movs r0, 0x2 + strh r0, [r5, 0x38] + movs r0, 0x1 + b _0817278E + .align 2, 0 +_08172770: .4byte 0x03005e00 +_08172774: .4byte 0x085e51f0 +_08172778: .4byte 0x02020630 +_0817277C: .4byte 0x085e51b4 +_08172780: .4byte 0x0202064c +_08172784: .4byte sub_8172508 + 1 +_08172788: + movs r0, 0x1 + strh r0, [r5, 0x38] + movs r0, 0x2 +_0817278E: + strh r0, [r5, 0x3A] +_08172790: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172708 + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bls _08172700 + ldr r0, _081727DC + ldr r2, _081727E0 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081727C4 + ldr r0, _081727E4 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081727C4: + ldr r0, [sp] + bl remove_task + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081727DC: .4byte 0x030022c0 +_081727E0: .4byte 0x00000439 +_081727E4: .4byte 0x02020630 + thumb_func_end sub_81726BC + + thumb_func_start sub_81727E8 +sub_81727E8: @ 81727E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, _081728C0 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, _081728C4 + mov r8, r3 + ldr r0, _081728C8 + adds r1, r0 + mov r10, r1 +_0817282E: + ldr r0, _081728CC + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172880 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl obj_anim_image_start + ldr r0, _081728D0 + adds r4, r0 + ldr r0, _081728D4 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] +_08172880: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817282E + ldr r0, _081728D8 + ldr r1, _081728DC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081728A8 + ldr r0, _081728C4 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081728A8: + mov r0, r9 + bl remove_task + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081728C0: .4byte 0x03005e00 +_081728C4: .4byte 0x02020630 +_081728C8: .4byte 0x085e51b4 +_081728CC: .4byte 0x085e51f0 +_081728D0: .4byte 0x0202064c +_081728D4: .4byte sub_81728E0 + 1 +_081728D8: .4byte 0x030022c0 +_081728DC: .4byte 0x00000439 + thumb_func_end sub_81727E8 + + thumb_func_start sub_81728E0 +sub_81728E0: @ 81728E0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + ldrh r1, [r5, 0x2E] + movs r0, 0x3F + ands r0, r1 + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl sine + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl cosine + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x2E] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0817293C + adds r0, r5, 0 + bl sub_8172944 +_0817293C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81728E0 + + thumb_func_start sub_8172944 +sub_8172944: @ 8172944 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, _08172968 + ldr r1, _0817296C + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172970 + movs r1, 0x3C + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _081729CA + adds r0, r7, 0 + bl obj_delete_and_free_resources + b _081729E2 + .align 2, 0 +_08172968: .4byte 0x030022c0 +_0817296C: .4byte 0x00000439 +_08172970: + ldr r2, _0817298C + ldr r0, [r2] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0xA] + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _081729DC + movs r4, 0 + ldr r5, _08172990 + b _08172998 + .align 2, 0 +_0817298C: .4byte 0x020244d0 +_08172990: .4byte 0x085e51c0 +_08172994: + adds r5, 0x4 + adds r4, 0x1 +_08172998: + cmp r4, 0xB + bgt _081729AA + ldr r0, [r5] + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08172994 +_081729AA: + cmp r4, 0xC + bne _081729CA + movs r6, 0 + ldr r5, _081729D4 + ldr r4, _081729D8 +_081729B4: + ldrh r0, [r5, 0x6] + bl gpu_tile_obj_free_by_tag + ldrh r0, [r4, 0x4] + bl gpu_pal_free_tag + adds r5, 0x8 + adds r4, 0x8 + adds r6, 0x1 + cmp r6, 0xB + ble _081729B4 +_081729CA: + adds r0, r7, 0 + bl obj_delete_and_free_tiles + b _081729E2 + .align 2, 0 +_081729D4: .4byte 0x085e5094 +_081729D8: .4byte 0x085e50f4 +_081729DC: + adds r0, r7, 0 + bl obj_delete_and_free_tiles +_081729E2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8172944 + + thumb_func_start sub_81729E8 +sub_81729E8: @ 81729E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + mov r9, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, _08172A4C + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _08172A50 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + strh r7, [r5, 0x26] + strh r6, [r5, 0xE] + mov r0, r9 + strh r0, [r5, 0x1C] + mov r1, r9 + lsrs r0, r1, 16 + strh r0, [r5, 0x1E] + cmp r4, 0 + bne _08172A58 + lsls r0, r6, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldr r2, _08172A54 + lsls r1, r7, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + movs r0, 0x1 + strh r0, [r5, 0xA] + b _08172A7E + .align 2, 0 +_08172A4C: .4byte sub_8172AB0 + 1 +_08172A50: .4byte 0x03005e00 +_08172A54: .4byte 0x085e5310 +_08172A58: + lsls r0, r6, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r2, _08172AA0 + lsls r1, r7, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0x10 + bl pal_fade_1 + movs r0, 0x10 + strh r0, [r5, 0x8] + ldr r0, _08172AA4 + strh r0, [r5, 0xA] + ldr r0, _08172AA8 + str r0, [r5] +_08172A7E: + ldr r0, _08172AAC + str r0, [sp] + mov r0, r9 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08172AA0: .4byte 0x085e5310 +_08172AA4: .4byte 0x0000ffff +_08172AA8: .4byte sub_8172B40 + 1 +_08172AAC: .4byte 0x00007fff + thumb_func_end sub_81729E8 + + thumb_func_start sub_8172AB0 +sub_8172AB0: @ 8172AB0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, _08172B00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bgt _08172B08 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldrb r2, [r4, 0x8] + ldr r3, _08172B04 + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08172B30 + .align 2, 0 +_08172B00: .4byte 0x03005e00 +_08172B04: .4byte 0x085e5310 +_08172B08: + ldr r0, _08172B38 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B30 + ldrh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + lsls r1, 16 + orrs r0, r1 + ldr r1, _08172B3C + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + adds r0, r5, 0 + bl remove_task +_08172B30: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08172B38: .4byte 0x02037fd4 +_08172B3C: .4byte 0x00007fff + thumb_func_end sub_8172AB0 + + thumb_func_start sub_8172B40 +sub_8172B40: @ 8172B40 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08172B80 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B78 + ldr r0, _08172B84 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + lsls r1, 16 + orrs r0, r1 + ldr r1, _08172B88 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r0, _08172B8C + str r0, [r4] +_08172B78: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08172B80: .4byte 0x02037fd4 +_08172B84: .4byte 0x03005e00 +_08172B88: .4byte 0x00007fff +_08172B8C: .4byte sub_8172B90 + 1 + thumb_func_end sub_8172B40 + + thumb_func_start sub_8172B90 +sub_8172B90: @ 8172B90 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08172BDC + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bgt _08172BE4 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 20 + movs r3, 0x80 + lsls r3, 17 + adds r0, r3 + lsrs r0, 16 + ldrb r2, [r4, 0x8] + ldr r3, _08172BE0 + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08172BEA + .align 2, 0 +_08172BDC: .4byte 0x03005e00 +_08172BE0: .4byte 0x085e5310 +_08172BE4: + adds r0, r2, 0 + bl remove_task +_08172BEA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8172B90 + + thumb_func_start sub_8172BF0 +sub_8172BF0: @ 8172BF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, _08172C24 + ldr r3, _08172C28 + ldrb r2, [r3] + adds r0, r2, r0 + ldrb r6, [r0] + ldr r1, _08172C2C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08172CC8 + cmp r0, 0x1 + bgt _08172C30 + cmp r0, 0 + beq _08172C36 + b _08172D8A + .align 2, 0 +_08172C24: .4byte 0x020241e4 +_08172C28: .4byte 0x02038436 +_08172C2C: .4byte 0x03005e00 +_08172C30: + cmp r0, 0x2 + beq _08172CDA + b _08172D8A +_08172C36: + ldr r0, _08172C70 + ldrh r0, [r0] + strh r0, [r5, 0x1E] + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r4, [r5, 0x8] + adds r0, r4 + strh r0, [r5, 0x8] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08172C78 + ldr r2, _08172C74 + lsls r3, r6, 4 + adds r1, r3, r6 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + adds r4, r3, 0 + b _08172C90 + .align 2, 0 +_08172C70: .4byte 0x0203841e +_08172C74: .4byte 0x02020630 +_08172C78: + ldr r3, _08172CC0 + lsls r4, r6, 4 + adds r2, r4, r6 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r5, 0x8] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 +_08172C90: + ldr r1, _08172CC4 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r1 + ldrb r0, [r3, 0x8] + strh r0, [r3, 0x8] + adds r0, r4, r6 + lsls r0, 2 + adds r0, r2 + movs r2, 0x20 + ldrsh r1, [r0, r2] + movs r4, 0x24 + ldrsh r0, [r0, r4] + adds r1, r0 + adds r1, 0x20 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bls _08172D8A + ldrh r0, [r3, 0x1C] + adds r0, 0x1 + strh r0, [r3, 0x1C] + b _08172D8A + .align 2, 0 +_08172CC0: .4byte 0x02020630 +_08172CC4: .4byte 0x03005e00 +_08172CC8: + ldrb r1, [r5, 0x1E] + adds r0, r2, 0 + adds r2, r6, 0 + bl refresh_graphics_maybe + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + b _08172D8A +_08172CDA: + movs r1, 0xA0 + lsls r1, 3 + adds r0, r1, 0 + ldrh r2, [r5, 0x8] + adds r0, r2 + strh r0, [r5, 0x8] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08172D10 + ldr r0, _08172D0C + lsls r3, r6, 4 + adds r2, r3, r6 + lsls r2, 2 + adds r2, r0 + ldrh r1, [r5, 0x8] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r4, r3, 0 + b _08172D28 + .align 2, 0 +_08172D0C: .4byte 0x02020630 +_08172D10: + ldr r0, _08172D5C + lsls r2, r6, 4 + adds r1, r2, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 24 + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + adds r4, r2, 0 +_08172D28: + ldr r1, _08172D60 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + strh r1, [r0, 0x8] + ldr r0, _08172D64 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08172D68 + ldr r0, _08172D5C + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + movs r4, 0x24 + ldrsh r0, [r1, r4] + cmp r0, 0 + bgt _08172D7E + movs r0, 0 + strh r0, [r1, 0x24] + b _08172D84 + .align 2, 0 +_08172D5C: .4byte 0x02020630 +_08172D60: .4byte 0x03005e00 +_08172D64: .4byte 0x02038436 +_08172D68: + ldr r0, _08172D94 + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _08172D7E + strh r2, [r1, 0x24] + movs r4, 0x1 + mov r8, r4 +_08172D7E: + mov r0, r8 + cmp r0, 0 + beq _08172D8A +_08172D84: + adds r0, r7, 0 + bl move_anim_task_del +_08172D8A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08172D94: .4byte 0x02020630 + thumb_func_end sub_8172BF0 + + thumb_func_start sub_8172D98 +sub_8172D98: @ 8172D98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08172DBC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08172E14 + cmp r0, 0x1 + bgt _08172DC0 + cmp r0, 0 + beq _08172DC6 + b _08172E84 + .align 2, 0 +_08172DBC: .4byte 0x03005e00 +_08172DC0: + cmp r0, 0x2 + beq _08172E4E + b _08172E84 +_08172DC6: + ldr r0, _08172DE0 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08172DE8 + ldr r1, _08172DE4 + movs r0, 0x50 + bl lcd_io_set + b _08172DF0 + .align 2, 0 +_08172DE0: .4byte 0x02038436 +_08172DE4: .4byte 0x00003f42 +_08172DE8: + ldr r1, _08172E0C + movs r0, 0x50 + bl lcd_io_set +_08172DF0: + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldr r0, _08172E10 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08172E84 + .align 2, 0 +_08172E0C: .4byte 0x00003f44 +_08172E10: .4byte 0x03005e00 +_08172E14: + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08172E84 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r2, [r4, 0x8] + adds r2, 0x1 + strh r2, [r4, 0x8] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08172E84 + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + b _08172E84 +_08172E4E: + ldr r1, _08172E8C + ldr r4, _08172E90 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _08172E94 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r0, _08172E98 + adds r1, r0 + movs r2, 0x80 + lsls r2, 4 + movs r0, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + ldrb r0, [r4] + bl sub_805E974 + adds r0, r5, 0 + bl move_anim_task_del +_08172E84: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08172E8C: .4byte 0x020241e4 +_08172E90: .4byte 0x02038436 +_08172E94: .4byte 0x02020630 +_08172E98: .4byte 0x06010000 + thumb_func_end sub_8172D98 + + thumb_func_start sub_8172E9C +sub_8172E9C: @ 8172E9C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08172EC4 + ldr r1, _08172EC8 + ldr r2, [r1] + ldr r1, _08172ECC + ldrb r1, [r1] + ldr r2, [r2] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r3, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08172EC4: .4byte 0x0203841e +_08172EC8: .4byte 0x020244d0 +_08172ECC: .4byte 0x02038436 + thumb_func_end sub_8172E9C + + thumb_func_start sub_8172ED0 +sub_8172ED0: @ 8172ED0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08172EE8 + ldr r1, _08172EEC + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08172EE8: .4byte 0x02038437 +_08172EEC: .4byte 0x0202420e + thumb_func_end sub_8172ED0 + + thumb_func_start sub_8172EF0 +sub_8172EF0: @ 8172EF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, _08172FAC + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08172FC8 + lsrs r0, r5, 16 + ldr r7, _08172FB0 + ands r5, r7 + eors r0, r5 + lsrs r1, r4, 16 + eors r0, r1 + ands r4, r7 + eors r0, r4 + cmp r0, 0x7 + bhi _08172F4E + movs r0, 0x1 + mov r8, r0 +_08172F4E: + mov r0, r8 + cmp r0, 0 + beq _08172FC8 + ldr r0, _08172FB4 + bl gpu_tile_obj_tag_get_range_start + lsls r0, 16 + lsrs r0, 16 + cmp r0, r7 + bne _08172F6E + ldr r0, _08172FB8 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _08172FBC + bl gpu_pal_obj_decompress_and_apply3 +_08172F6E: + ldr r5, _08172FC0 + adds r0, r5, 0 + movs r1, 0xA + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08172FC4 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + adds r2, r3 + movs r4, 0 + strh r6, [r2, 0x8] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + strh r6, [r1, 0x8] + strh r4, [r2, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xA] + b _08172FDE + .align 2, 0 +_08172FAC: .4byte 0x020244d0 +_08172FB0: .4byte 0x0000ffff +_08172FB4: .4byte 0x000027f9 +_08172FB8: .4byte 0x0852528c +_08172FBC: .4byte 0x08525b94 +_08172FC0: .4byte sub_8172FEC + 1 +_08172FC4: .4byte 0x03005e00 +_08172FC8: + ldr r0, _08172FE8 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] +_08172FDE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08172FE8: .4byte 0x020244d0 + thumb_func_end sub_8172EF0 + + thumb_func_start sub_8172FEC +sub_8172FEC: @ 8172FEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _08173014 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + bgt _08173018 + adds r0, r1, 0x1 + strh r0, [r4, 0x22] + b _08173190 + .align 2, 0 +_08173014: .4byte 0x03005e00 +_08173018: + ldr r0, _0817306C + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08173026 + b _08173190 +_08173026: + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + beq _0817303A + b _08173190 +_0817303A: + ldrb r0, [r4, 0x8] + mov r8, r0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08173074 + ldr r0, _08173070 + adds r1, r5, 0 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + b _081730D6 + .align 2, 0 +_0817306C: .4byte 0x020244d0 +_08173070: .4byte 0x085ce388 +_08173074: + cmp r0, 0 + blt _081730A8 + cmp r0, 0x3 + bgt _081730A8 + ldr r0, _081730A0 + adds r1, r5, 0 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081730A4 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x4 + b _081730C8 + .align 2, 0 +_081730A0: .4byte 0x085ce3a0 +_081730A4: .4byte 0x02020630 +_081730A8: + ldr r0, _08173100 + adds r1, r5, 0 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08173104 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x5 +_081730C8: + ldr r4, _08173108 + adds r0, r4, 0 + ands r1, r0 + ldr r0, _0817310C + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_081730D6: + ldr r2, _08173110 + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r6, r0, r2 + movs r2, 0xA + ldrsh r0, [r6, r2] + mov r9, r1 + cmp r0, 0 + bne _08173118 + ldr r1, _08173104 + lsls r2, r5, 4 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, _08173114 + str r1, [r0] + adds r4, r2, 0 + b _08173160 + .align 2, 0 +_08173100: .4byte 0x085ce3a0 +_08173104: .4byte 0x02020630 +_08173108: .4byte 0x000003ff +_0817310C: .4byte 0xfffffc00 +_08173110: .4byte 0x03005e00 +_08173114: .4byte sub_81731FC + 1 +_08173118: + ldr r3, _0817319C + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, _081731A0 + str r2, [r0] + adds r1, r3 + ldr r0, _081731A4 + strh r0, [r1, 0x24] + movs r0, 0x20 + strh r0, [r1, 0x26] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + movs r1, 0x1E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08173160 + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x3F + cmp r0, 0 + bne _08173156 + movs r1, 0xC0 +_08173156: + lsls r1, 24 + asrs r1, 24 + movs r0, 0x66 + bl audio_play_and_stuff +_08173160: + ldr r1, _0817319C + adds r0, r4, r5 + lsls r0, 2 + adds r0, r1 + strh r7, [r0, 0x2E] + ldr r1, _081731A8 + mov r2, r9 + adds r0, r2, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + cmp r5, 0x40 + beq _08173184 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_08173184: + movs r4, 0x1E + ldrsh r0, [r1, r4] + cmp r0, 0x5 + bne _08173190 + ldr r0, _081731AC + str r0, [r1] +_08173190: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817319C: .4byte 0x02020630 +_081731A0: .4byte sub_8173250 + 1 +_081731A4: .4byte 0x0000ffe0 +_081731A8: .4byte 0x03005e00 +_081731AC: .4byte sub_81731B0 + 1 + thumb_func_end sub_8172FEC + + thumb_func_start sub_81731B0 +sub_81731B0: @ 81731B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldr r1, _081731F4 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081731F0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _081731EA + ldrb r1, [r1, 0x8] + ldr r0, _081731F8 + ldr r0, [r0] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] +_081731EA: + adds r0, r3, 0 + bl remove_task +_081731F0: + pop {r0} + bx r0 + .align 2, 0 +_081731F4: .4byte 0x03005e00 +_081731F8: .4byte 0x020244d0 + thumb_func_end sub_81731B0 + + thumb_func_start sub_81731FC +sub_81731FC: @ 81731FC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0xC + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08173246 + ldr r2, _0817324C + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_08173246: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817324C: .4byte 0x03005e00 + thumb_func_end sub_81731FC + + thumb_func_start sub_8173250 +sub_8173250: @ 8173250 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bgt _08173264 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _081732A6 +_08173264: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r1, [r4, 0x24] + adds r1, 0x5 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x5 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x20 + ble _081732A6 + ldr r2, _081732AC + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_081732A6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081732AC: .4byte 0x03005e00 + thumb_func_end sub_8173250 + + thumb_func_start sub_81732B0 +sub_81732B0: @ 81732B0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081732D8 + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _081732DC + bl gpu_pal_obj_decompress_and_apply3 + ldr r0, _081732E0 + bl gpu_pal_tags_index_of + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081732D8: .4byte 0x085253ac +_081732DC: .4byte 0x08525cb4 +_081732E0: .4byte 0x0000281d + thumb_func_end sub_81732B0 + + thumb_func_start sub_81732E4 +sub_81732E4: @ 81732E4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _08173308 + adds r0, r5, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r5, 0 + bl gpu_pal_free_tag + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08173308: .4byte 0x0000281d + thumb_func_end sub_81732E4 + + thumb_func_start sub_817330C +sub_817330C: @ 817330C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r5, _08173380 + lsrs r0, 24 + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r4, 0x32] + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x6] + adds r0, r5 + strh r0, [r4, 0x36] + ldr r0, _08173384 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r2, _08173388 + ldr r1, _0817338C + ldr r0, _08173390 + 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, _08173394 + str r1, [r0] + ldr r0, _08173398 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08173380: .4byte 0x0203841e +_08173384: .4byte 0x0000ffe0 +_08173388: .4byte 0x02020630 +_0817338C: .4byte 0x020241e4 +_08173390: .4byte 0x02038436 +_08173394: .4byte sub_8039E84 + 1 +_08173398: .4byte sub_817339C + 1 + thumb_func_end sub_817330C + + thumb_func_start sub_817339C +sub_817339C: @ 817339C + push {lr} + adds r3, r0, 0 + ldr r2, _081733C4 + ldr r1, _081733C8 + ldr r0, _081733CC + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081733C0 + ldr r0, _081733D0 + str r0, [r3, 0x1C] +_081733C0: + pop {r0} + bx r0 + .align 2, 0 +_081733C4: .4byte 0x02020630 +_081733C8: .4byte 0x020241e4 +_081733CC: .4byte 0x02038436 +_081733D0: .4byte sub_81733D4 + 1 + thumb_func_end sub_817339C + + thumb_func_start sub_81733D4 +sub_81733D4: @ 81733D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081733F6 + movs r0, 0 + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _081733FC + str r0, [r4, 0x1C] +_081733F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081733FC: .4byte sub_8173400 + 1 + thumb_func_end sub_81733D4 + + thumb_func_start sub_8173400 +sub_8173400: @ 8173400 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08173450 + ldr r3, _08173454 + ldr r2, _08173458 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08173448 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + ble _08173448 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl obj_anim_image_start + adds r0, r4, 0 + bl move_anim_8072740 +_08173448: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08173450: .4byte 0x02020630 +_08173454: .4byte 0x020241e4 +_08173458: .4byte 0x02038436 + thumb_func_end sub_8173400 + + thumb_func_start sub_817345C +sub_817345C: @ 817345C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08173474 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08173478 + cmp r0, 0x1 + beq _0817348C + b _081734A0 + .align 2, 0 +_08173474: .4byte 0x0203841e +_08173478: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, _08173488 + strb r0, [r1] + movs r0, 0x1 + b _08173498 + .align 2, 0 +_08173488: .4byte 0x02038436 +_0817348C: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, _081734AC + strb r0, [r1] + movs r0, 0 +_08173498: + bl battle_get_side_with_given_state + ldr r1, _081734B0 + strb r0, [r1] +_081734A0: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081734AC: .4byte 0x02038436 +_081734B0: .4byte 0x02038437 + thumb_func_end sub_817345C + + thumb_func_start sub_81734B4 +sub_81734B4: @ 81734B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081734CC + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrh r1, [r0] + cmp r1, 0x53 + bne _081734D4 + ldr r1, _081734D0 + movs r0, 0x1 + b _0817350C + .align 2, 0 +_081734CC: .4byte 0x020244d0 +_081734D0: .4byte 0x0203841e +_081734D4: + cmp r1, 0xFA + bne _081734E4 + ldr r1, _081734E0 + movs r0, 0x2 + b _0817350C + .align 2, 0 +_081734E0: .4byte 0x0203841e +_081734E4: + cmp r1, 0x80 + bne _081734F4 + ldr r1, _081734F0 + movs r0, 0x3 + b _0817350C + .align 2, 0 +_081734F0: .4byte 0x0203841e +_081734F4: + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _08173508 + ldr r1, _08173504 + movs r0, 0x4 + b _0817350C + .align 2, 0 +_08173504: .4byte 0x0203841e +_08173508: + ldr r1, _08173518 + movs r0, 0 +_0817350C: + strh r0, [r1] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08173518: .4byte 0x0203841e + thumb_func_end sub_81734B4 + + thumb_func_start sub_817351C +sub_817351C: @ 817351C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08173540 + ldr r1, _08173544 + ldr r2, [r1] + ldr r1, [r2, 0x8] + ldrh r1, [r1] + strb r1, [r3] + ldr r3, _08173548 + ldr r1, [r2, 0x8] + ldrh r1, [r1] + lsrs r1, 8 + strb r1, [r3] + bl move_anim_task_del + pop {r0} + bx r0 + .align 2, 0 +_08173540: .4byte 0x02038436 +_08173544: .4byte 0x020244d0 +_08173548: .4byte 0x02038437 + thumb_func_end sub_817351C + + thumb_func_start sub_817354C +sub_817354C: @ 817354C + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_817354C + + thumb_func_start sub_8173560 +sub_8173560: @ 8173560 + push {lr} + bl run_active_tasks + bl run_remoboxes + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8173560 + + thumb_func_start sub_817357C +sub_817357C: @ 817357C + push {r4,lr} + sub sp, 0x4 + ldr r0, _0817359C + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bls _08173590 + b _08173688 +_08173590: + lsls r0, 2 + ldr r1, _081735A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817359C: .4byte 0x030022c0 +_081735A0: .4byte _081735A4 + .align 2, 0 +_081735A4: + .4byte _081735B8 + .4byte _081735E8 + .4byte _081735EE + .4byte _08173620 + .4byte _0817365C +_081735B8: + movs r0, 0 + bl SetVBlankCallback + bl sub_8174EC4 + ldr r4, _081735DC + ldr r0, _081735E0 + bl malloc_and_clear + str r0, [r4] + ldr r0, _081735E4 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _08173688 + .align 2, 0 +_081735DC: .4byte 0x0203bcdc +_081735E0: .4byte 0x00002014 +_081735E4: .4byte 0x030022c0 +_081735E8: + bl sub_8174F70 + b _08173642 +_081735EE: + ldr r1, _08173618 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0xE2 + lsls r1, 3 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + bl sub_8174FAC + ldr r0, _0817361C + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08173642 + .align 2, 0 +_08173618: .4byte 0x00003f42 +_0817361C: .4byte 0x0203bcdc +_08173620: + bl sub_8175024 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08173688 + ldr r0, _08173654 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_08173642: + ldr r1, _08173658 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08173688 + .align 2, 0 +_08173654: .4byte sub_817354C + 1 +_08173658: .4byte 0x030022c0 +_0817365C: + bl fade_and_return_progress_probably + ldr r0, _08173680 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08173688 + ldr r0, _08173684 + bl set_callback2 + movs r0, 0xDA + lsls r0, 1 + bl song_play_for_text + movs r0, 0 + b _0817368A + .align 2, 0 +_08173680: .4byte 0x02037fd4 +_08173684: .4byte sub_8173560 + 1 +_08173688: + movs r0, 0x1 +_0817368A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_817357C + + thumb_func_start sub_8173694 +sub_8173694: @ 8173694 + push {r4,lr} + bl sub_817357C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081736C4 + ldr r0, _081736CC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081736D0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r4, _081736D4 + movs r0, 0x78 + bl malloc_and_clear + str r0, [r4] +_081736C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081736CC: .4byte sub_817371C + 1 +_081736D0: .4byte 0x03005e00 +_081736D4: .4byte 0x0203bcd8 + thumb_func_end sub_8173694 + + thumb_func_start sub_81736D8 +sub_81736D8: @ 81736D8 + push {r4,lr} + bl sub_817357C + lsls r0, 24 + cmp r0, 0 + bne _08173708 + ldr r0, _08173710 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08173714 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + ldr r4, _08173718 + movs r0, 0x78 + bl malloc_and_clear + str r0, [r4] +_08173708: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08173710: .4byte sub_817371C + 1 +_08173714: .4byte 0x03005e00 +_08173718: .4byte 0x0203bcd8 + thumb_func_end sub_81736D8 + + thumb_func_start sub_817371C +sub_817371C: @ 817371C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _081737F8 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + movs r7, 0 + ldr r0, _081737FC + mov r9, r0 +_08173740: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _08173800 + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + cmp r5, 0 + beq _0817380C + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + mov r1, r9 + ldr r3, [r1] + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 2 + adds r3, r4 + ldr r2, _08173804 + adds r1, r2, 0 + ands r0, r1 + ldrh r1, [r3, 0x8] + ldr r5, _08173808 + adds r2, r5, 0 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r2, r9 + ldr r1, [r2] + adds r1, r4 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + mov r5, r9 + ldr r1, [r5] + adds r1, 0x4 + adds r1, r4 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r2, [r5] + adds r2, r4 + lsls r0, 1 + ldrb r3, [r2, 0x9] + movs r1, 0x1 + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x9] + adds r0, r6, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + movs r2, 0 + mov r6, r8 + lsls r5, r6, 2 + ldr r3, _081737FC +_081737CA: + ldr r0, [r3] + adds r1, r2, r4 + adds r0, 0xA + adds r0, r1 + mov r6, sp + adds r1, r6, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _081737CA + ldr r0, _081737F8 + mov r2, r8 + adds r1, r5, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + b _08173840 + .align 2, 0 +_081737F8: .4byte 0x03005e00 +_081737FC: .4byte 0x0203bcd8 +_08173800: .4byte 0x020244ec +_08173804: .4byte 0x000001ff +_08173808: .4byte 0xfffffe00 +_0817380C: + mov r6, r9 + ldr r3, [r6] + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 2 + adds r4, r3, r2 + ldrh r0, [r4, 0x8] + ldr r6, _08173894 + adds r1, r6, 0 + ands r0, r1 + strh r0, [r4, 0x8] + str r5, [r4] + adds r3, 0x4 + adds r3, r2 + str r5, [r3] + ldrb r1, [r4, 0x9] + movs r0, 0x1 + ands r0, r1 + strb r0, [r4, 0x9] + mov r1, r9 + ldr r0, [r1] + adds r0, r2 + movs r1, 0xFF + strb r1, [r0, 0xA] + mov r2, r8 + lsls r5, r2, 2 +_08173840: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bhi _0817384C + b _08173740 +_0817384C: + ldr r0, _08173898 + movs r3, 0 + str r3, [r0] + ldr r4, _0817389C + mov r6, r8 + adds r1, r5, r6 + lsls r1, 3 + adds r2, r1, r4 + strh r3, [r2, 0xA] + movs r0, 0xFF + strh r0, [r2, 0x10] + movs r7, 0 + adds r3, r4, 0 + adds r3, 0x8 + movs r2, 0xFF +_0817386A: + adds r0, r7, 0x5 + lsls r0, 1 + adds r0, r1 + adds r0, r3 + strh r2, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bls _0817386A + mov r1, r8 + adds r0, r5, r1 + lsls r0, 3 + adds r1, r0, r4 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081738A4 + ldr r0, _081738A0 + b _081738A6 + .align 2, 0 +_08173894: .4byte 0xfffffe00 +_08173898: .4byte 0x0203bcd4 +_0817389C: .4byte 0x03005e00 +_081738A0: .4byte sub_8173A8C + 1 +_081738A4: + ldr r0, _081738B8 +_081738A6: + str r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081738B8: .4byte sub_81738BC + 1 + thumb_func_end sub_817371C + + thumb_func_start sub_81738BC +sub_81738BC: @ 81738BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r7, _081738E4 + ldr r0, _081738E8 + ldrb r0, [r0] + cmp r0, 0 + bne _081738EC + movs r2, 0x80 + lsls r2, 6 + adds r0, r7, 0 + movs r1, 0 + bl memset + b _08173906 + .align 2, 0 +_081738E4: .4byte 0x0201c000 +_081738E8: .4byte 0x0203bce4 +_081738EC: + movs r0, 0x3 + bl sub_81534D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08173906 + movs r2, 0x80 + lsls r2, 6 + adds r0, r7, 0 + movs r1, 0 + bl memset +_08173906: + movs r5, 0 + ldrh r1, [r7, 0x8] + ldr r2, _081739AC + adds r0, r2, 0 + ands r0, r1 + mov r1, r9 + lsls r1, 2 + mov r8, r1 + cmp r0, 0 + beq _08173930 +_0817391A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r7, 0x78 + cmp r5, 0x31 + bhi _08173934 + ldrh r1, [r7, 0x8] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0817391A +_08173930: + cmp r5, 0x31 + bls _08173956 +_08173934: + ldr r4, _081739B0 + adds r6, r4, 0 + adds r4, 0x78 + movs r5, 0 + subs r7, 0x78 +_0817393E: + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x78 + bl memcpy + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x78 + adds r4, 0x78 + cmp r5, 0x30 + bls _0817393E +_08173956: + ldr r0, _081739B4 + ldr r1, [r0] + adds r0, r7, 0 + movs r2, 0x78 + bl memcpy + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _081739B8 + 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 text_box_related_one + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _081739BC + mov r0, r8 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, _081739C0 + str r1, [r0] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081739AC: .4byte 0x000001ff +_081739B0: .4byte 0x0201c000 +_081739B4: .4byte 0x0203bcd8 +_081739B8: .4byte 0x082c8959 +_081739BC: .4byte 0x03005e00 +_081739C0: .4byte sub_81739C4 + 1 + thumb_func_end sub_81738BC + + thumb_func_start sub_81739C4 +sub_81739C4: @ 81739C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08173A20 + ldr r0, _08173A24 + str r0, [r1] + movs r0, 0x3 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08173A34 + ldr r0, _08173A28 + ldr r0, [r0] + cmp r0, 0 + beq _08173A34 + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x3 + bl bg_unset_tilemap + bl Window_FreeMemory + ldr r5, _08173A2C + ldr r0, [r5] + cmp r0, 0 + beq _08173A06 + bl free + movs r0, 0 + str r0, [r5] +_08173A06: + ldr r5, _08173A30 + ldr r0, [r5] + cmp r0, 0 + beq _08173A16 + bl free + movs r0, 0 + str r0, [r5] +_08173A16: + adds r0, r4, 0 + bl remove_task + b _08173A4C + .align 2, 0 +_08173A20: .4byte 0x03006214 +_08173A24: .4byte sub_81736D8 + 1 +_08173A28: .4byte 0x030061fc +_08173A2C: .4byte 0x0203bcdc +_08173A30: .4byte 0x0203bcd8 +_08173A34: + movs r0, 0x37 + bl audio_play + ldr r1, _08173A54 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08173A58 + str r1, [r0] + movs r1, 0x20 + strh r1, [r0, 0xE] +_08173A4C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08173A54: .4byte 0x03005e00 +_08173A58: .4byte sub_8173A5C + 1 + thumb_func_end sub_81739C4 + + thumb_func_start sub_8173A5C +sub_8173A5C: @ 8173A5C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08173A7C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08173A80 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _08173A84 + .align 2, 0 +_08173A7C: .4byte 0x03005e00 +_08173A80: + ldr r0, _08173A88 + str r0, [r1] +_08173A84: + pop {r0} + bx r0 + .align 2, 0 +_08173A88: .4byte sub_8173A8C + 1 + thumb_func_end sub_8173A5C + + thumb_func_start sub_8173A8C +sub_8173A8C: @ 8173A8C + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08173AA0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _08173AA4 + str r0, [r1] + bx lr + .align 2, 0 +_08173AA0: .4byte 0x03005e00 +_08173AA4: .4byte sub_8173AA8 + 1 + thumb_func_end sub_8173A8C + + thumb_func_start sub_8173AA8 +sub_8173AA8: @ 8173AA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _08173AE0 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r6, [r1, 0xA] + ldr r2, _08173AE4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + ldr r2, [r2] + adds r7, r2, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0x3 + ble _08173AEC + ldr r1, _08173AE8 + b _08173AEE + .align 2, 0 +_08173AE0: .4byte 0x03005e00 +_08173AE4: .4byte 0x0203bcd8 +_08173AE8: .4byte 0x085e53b4 +_08173AEC: + ldr r1, _08173BA4 +_08173AEE: + lsls r2, r6, 3 + adds r0, r2, r1 + ldrh r3, [r0] + adds r0, r1, 0x2 + adds r0, r2, r0 + ldrh r4, [r0] + adds r0, r1, 0x4 + adds r0, r2, r0 + ldrh r0, [r0] + mov r9, r0 + adds r1, 0x6 + adds r2, r1 + ldrh r5, [r2] + ldrh r2, [r7, 0x8] + ldr r0, _08173BA8 + ands r0, r2 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08173B20 + lsls r0, r5, 16 + movs r1, 0xA0 + lsls r1, 12 + adds r0, r1 + lsrs r5, r0, 16 +_08173B20: + lsls r0, r2, 23 + lsrs r0, 23 + ldr r1, [r7] + ldr r2, [r7, 0x4] + lsls r3, 16 + asrs r3, 16 + str r3, [sp] + lsls r3, r4, 16 + asrs r3, 16 + str r3, [sp, 0x4] + lsls r3, r6, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + ldr r3, _08173BAC + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D3E4 + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08173BB0 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r4 + movs r1, 0 + mov r12, r1 + mov r1, r9 + strh r1, [r3, 0x30] + strh r5, [r3, 0x32] + mov r1, r12 + strh r1, [r3, 0x2E] + ldrh r1, [r7, 0x8] + lsls r1, 23 + lsrs r1, 23 + strh r1, [r3, 0x3C] + adds r4, 0x1C + adds r2, r4 + ldr r1, _08173BB4 + str r1, [r2] + ldr r5, _08173BB8 + adds r1, r6, 0x5 + lsls r1, 1 + mov r2, r8 + lsls r4, r2, 2 + add r4, r8 + lsls r4, 3 + adds r1, r4 + adds r2, r5, 0 + adds r2, 0x8 + adds r1, r2 + strh r0, [r1] + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r4, r5 + ldr r0, _08173BBC + str r0, [r4] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08173BA4: .4byte 0x085e53e4 +_08173BA8: .4byte 0x000001ff +_08173BAC: .4byte 0x0000ffff +_08173BB0: .4byte 0x02020630 +_08173BB4: .4byte sub_8175120 + 1 +_08173BB8: .4byte 0x03005e00 +_08173BBC: .4byte sub_8173BC0 + 1 + thumb_func_end sub_8173AA8 + + thumb_func_start sub_8173BC0 +sub_8173BC0: @ 8173BC0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08173C20 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + adds r5, r3, r4 + ldrh r0, [r5, 0xA] + ldr r2, _08173C24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, [r2] + adds r2, r1 + adds r0, 0x5 + lsls r0, 1 + adds r0, r3 + adds r4, 0x8 + adds r0, r4 + movs r3, 0 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08173C28 + adds r3, r0, r1 + ldr r1, [r3, 0x1C] + ldr r0, _08173C2C + cmp r1, r0 + bne _08173C1A + ldrb r1, [r3, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x1] + adds r0, r2, 0 + movs r1, 0 + movs r2, 0xE + bl sub_8174A88 + movs r0, 0x78 + strh r0, [r5, 0xE] + ldr r0, _08173C30 + str r0, [r5] +_08173C1A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08173C20: .4byte 0x03005e00 +_08173C24: .4byte 0x0203bcd8 +_08173C28: .4byte 0x02020630 +_08173C2C: .4byte nullsub_12 + 1 +_08173C30: .4byte sub_8173C34 + 1 + thumb_func_end sub_8173BC0 + + thumb_func_start sub_8173C34 +sub_8173C34: @ 8173C34 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _08173C70 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + adds r4, r6, r2 + ldrh r3, [r4, 0xA] + ldr r1, _08173C74 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r1, r0 + mov r9, r1 + ldrh r1, [r4, 0xE] + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r12, r2 + cmp r0, 0 + beq _08173C78 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08173D10 + .align 2, 0 +_08173C70: .4byte 0x03005e00 +_08173C74: .4byte 0x0203bcd8 +_08173C78: + ldr r2, _08173CF0 + ldr r0, _08173CF4 + mov r8, r0 + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r6 + mov r1, r12 + adds r1, 0x8 + adds r6, r0, r1 + movs r7, 0 + ldrsh r1, [r6, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r0 + ldr r3, [r2] + orrs r3, r1 + str r3, [r2] + ldrh r2, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bgt _08173D04 + mov r7, r9 + ldrh r1, [r7, 0x1C] + ldr r0, _08173CF8 + ands r0, r1 + cmp r0, 0 + beq _08173D04 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + ldr r0, _08173CFC + str r0, [sp] + adds r0, r3, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0xC + bl sub_80A1AD4 + movs r0, 0 + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, _08173D00 + str r0, [r4] + b _08173D10 + .align 2, 0 +_08173CF0: .4byte 0x0203bcd4 +_08173CF4: .4byte 0x02020630 +_08173CF8: .4byte 0x000001ff +_08173CFC: .4byte 0x000063b0 +_08173D00: .4byte sub_8173AA8 + 1 +_08173D04: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r12 + ldr r1, _08173D20 + str r1, [r0] +_08173D10: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08173D20: .4byte sub_8173D24 + 1 + thumb_func_end sub_8173C34 + + thumb_func_start sub_8173D24 +sub_8173D24: @ 8173D24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08173DAC + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80A1AD4 + movs r3, 0 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r5, r0, 3 + ldr r0, _08173DB0 + mov r12, r0 + mov r8, r1 + ldr r6, _08173DB4 + movs r7, 0xD + negs r7, r7 +_08173D52: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r5 + mov r2, r12 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + beq _08173D74 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x5] +_08173D74: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _08173D52 + movs r0, 0 + movs r1, 0xF + bl sub_8174A38 + movs r0, 0x69 + bl audio_play + ldr r1, _08173DB8 + mov r2, r8 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC8 + lsls r1, 1 + strh r1, [r0, 0xE] + ldr r1, _08173DBC + str r1, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08173DAC: .4byte 0xffff0000 +_08173DB0: .4byte 0x03005e08 +_08173DB4: .4byte 0x02020630 +_08173DB8: .4byte 0x03005e00 +_08173DBC: .4byte sub_8173DC0 + 1 + thumb_func_end sub_8173D24 + + thumb_func_start sub_8173DC0 +sub_8173DC0: @ 8173DC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _08173E00 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r5, r0, 3 + adds r1, r5, r7 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08173E04 + subs r2, 0x1 + strh r2, [r1, 0xE] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _08173E7E + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x6E + ble _08173E7E + bl sub_81751FC + b _08173E7E + .align 2, 0 +_08173E00: .4byte 0x03005e00 +_08173E04: + movs r3, 0 + mov r9, r4 + ldr r0, _08173E90 + mov r10, r0 + adds r4, r5, 0 + adds r7, 0x8 + mov r8, r7 + ldr r7, _08173E94 + movs r1, 0xD + negs r1, r1 + mov r12, r1 + movs r5, 0x4 +_08173E1C: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r4 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + beq _08173E40 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] +_08173E40: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _08173E1C + mov r3, r10 + ldr r0, [r3] + ldr r1, _08173E98 + str r1, [sp] + movs r1, 0 + movs r2, 0xC + movs r3, 0xC + bl sub_80A1AD4 + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08173E9C + mov r2, r9 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0xE] + ldr r1, _08173EA0 + str r1, [r0] +_08173E7E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08173E90: .4byte 0x0203bcd4 +_08173E94: .4byte 0x02020630 +_08173E98: .4byte 0x000063b0 +_08173E9C: .4byte 0x03005e00 +_08173EA0: .4byte sub_8173EA4 + 1 + thumb_func_end sub_8173DC0 + + thumb_func_start sub_8173EA4 +sub_8173EA4: @ 8173EA4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08173EC4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0xF + ble _08173ECC + ldr r0, _08173EC8 + str r0, [r1] + b _08173EDE + .align 2, 0 +_08173EC4: .4byte 0x03005e00 +_08173EC8: .4byte sub_8173EE4 + 1 +_08173ECC: + adds r0, r2, 0x1 + strh r0, [r1, 0xE] + movs r0, 0xE + ldrsh r1, [r1, r0] + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set +_08173EDE: + pop {r0} + bx r0 + thumb_func_end sub_8173EA4 + + thumb_func_start sub_8173EE4 +sub_8173EE4: @ 8173EE4 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r6, _08173F6C + ldr r0, [r6] + ldrb r0, [r0, 0x8] + movs r1, 0x1 + bl sub_818D97C + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + str r1, [sp] + ldr r1, _08173F70 + str r1, [sp, 0x4] + movs r1, 0x1 + movs r2, 0x78 + movs r3, 0x48 + bl sub_818D8AC + ldr r1, _08173F74 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + strh r0, [r4, 0x10] + ldr r0, _08173F78 + bl Window_AddFromTemplate + ldr r0, [r6] + ldrb r1, [r0, 0x14] + lsrs r1, 3 + ldr r2, _08173F7C + movs r0, 0x1 + movs r3, 0xD0 + bl sub_80987D4 + movs r0, 0x1 + bl stdpal_get + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x78 + strh r0, [r4, 0xE] + ldr r0, _08173F80 + str r0, [r4] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08173F6C: .4byte 0x03005d90 +_08173F70: .4byte 0x0000ffff +_08173F74: .4byte 0x03005e00 +_08173F78: .4byte 0x085e5380 +_08173F7C: .4byte 0x0000021d +_08173F80: .4byte sub_8173F84 + 1 + thumb_func_end sub_8173EE4 + + thumb_func_start sub_8173F84 +sub_8173F84: @ 8173F84 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08173FA8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0xE] + movs r1, 0xE + ldrsh r5, [r4, r1] + cmp r5, 0 + beq _08173FAC + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08174018 + .align 2, 0 +_08173FA8: .4byte 0x03005e00 +_08173FAC: + ldr r2, _08173FCC + movs r3, 0x10 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0xC0 + beq _08173FD0 + adds r0, r2, 0x1 + strh r0, [r1, 0x20] + b _08174018 + .align 2, 0 +_08173FCC: .4byte 0x02020630 +_08173FD0: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0x1 + movs r1, 0x2 + bl sub_8174C98 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _08174020 + 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, 0 + bl text_box_related_one + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08174024 + str r0, [r4] +_08174018: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08174020: .4byte 0x085e8c14 +_08174024: .4byte sub_8174028 + 1 + thumb_func_end sub_8173F84 + + thumb_func_start sub_8174028 +sub_8174028: @ 8174028 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08174054 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817404E + movs r0, 0x4 + bl play_sound_effect + ldr r0, _08174058 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0817405C + str r0, [r1] +_0817404E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08174054: .4byte 0x030022c0 +_08174058: .4byte 0x03005e00 +_0817405C: .4byte sub_8174060 + 1 + thumb_func_end sub_8174028 + + thumb_func_start sub_8174060 +sub_8174060: @ 8174060 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081740A0 + ldr r1, _081740A4 + movs r2, 0x80 + lsls r2, 2 + bl CpuSet + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _081740A8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081740AC + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081740A0: .4byte 0x02037b14 +_081740A4: .4byte 0x02037714 +_081740A8: .4byte 0x03005e00 +_081740AC: .4byte sub_81740B0 + 1 + thumb_func_end sub_8174060 + + thumb_func_start sub_81740B0 +sub_81740B0: @ 81740B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _08174170 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08174164 + lsls r0, r7, 2 + mov r8, r0 + ldr r1, _08174174 + adds r0, r7 + lsls r0, 3 + adds r1, 0x12 + adds r5, r0, r1 + ldr r2, _08174178 + mov r9, r2 + movs r6, 0x5 +_081740DC: + ldrb r4, [r5] + cmp r4, 0xFF + beq _081740FA + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl sub_818D820 +_081740FA: + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _081740DC + ldr r0, _08174174 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + bl sub_818D8F0 + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + bl Window_FreeMemory + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x3 + bl bg_unset_tilemap + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + adds r0, r7, 0 + bl remove_task + ldr r4, _0817417C + ldr r0, [r4] + cmp r0, 0 + beq _08174150 + bl free + movs r0, 0 + str r0, [r4] +_08174150: + ldr r4, _08174180 + ldr r0, [r4] + cmp r0, 0 + beq _08174160 + bl free + movs r0, 0 + str r0, [r4] +_08174160: + bl sub_8174184 +_08174164: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174170: .4byte 0x02037fd4 +_08174174: .4byte 0x03005e00 +_08174178: .4byte 0x02020630 +_0817417C: .4byte 0x0203bcdc +_08174180: .4byte 0x0203bcd8 + thumb_func_end sub_81740B0 + + thumb_func_start sub_8174184 +sub_8174184: @ 8174184 + push {lr} + ldr r0, _08174190 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08174190: .4byte sub_8175620 + 1 + thumb_func_end sub_8174184 + + thumb_func_start sub_8174194 +sub_8174194: @ 8174194 + push {r4,lr} + ldr r0, _081741B0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _081741D0 + lsls r0, 2 + ldr r1, _081741B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081741B0: .4byte 0x030022c0 +_081741B4: .4byte _081741B8 + .align 2, 0 +_081741B8: + .4byte _081741D0 + .4byte _08174200 + .4byte _08174214 + .4byte _08174240 + .4byte _08174280 + .4byte _081742B0 +_081741D0: + movs r0, 0 + bl SetVBlankCallback + bl sub_8174EC4 + ldr r4, _081741F4 + ldr r0, _081741F8 + bl malloc_and_clear + str r0, [r4] + ldr r0, _081741FC + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _08174308 + .align 2, 0 +_081741F4: .4byte 0x0203bcdc +_081741F8: .4byte 0x00002014 +_081741FC: .4byte 0x030022c0 +_08174200: + bl sub_8174F70 + ldr r1, _08174210 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _081742A2 + .align 2, 0 +_08174210: .4byte 0x030022c0 +_08174214: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + bl sub_8174FAC + ldr r1, _0817423C + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _081742A2 + .align 2, 0 +_0817423C: .4byte 0x030022c0 +_08174240: + bl sub_8175024 + lsls r0, 24 + cmp r0, 0 + bne _08174308 + ldr r1, _08174270 + ldr r0, _08174274 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80F9BCC + ldr r0, _08174278 + bl SetVBlankCallback + ldr r1, _0817427C + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _081742A2 + .align 2, 0 +_08174270: .4byte 0x0201c000 +_08174274: .4byte 0x085e56d4 +_08174278: .4byte sub_817354C + 1 +_0817427C: .4byte 0x030022c0 +_08174280: + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + bl sub_80F9C1C + lsls r0, 24 + cmp r0, 0 + bne _08174308 + ldr r1, _081742AC + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081742A2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08174308 + .align 2, 0 +_081742AC: .4byte 0x030022c0 +_081742B0: + ldr r1, _08174310 + movs r0, 0x50 + bl lcd_io_set + movs r1, 0xE2 + lsls r1, 3 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + ldr r0, _08174314 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r4, _08174318 + movs r3, 0xFF +_081742E2: + adds r0, r2, 0x5 + lsls r0, 1 + adds r0, r1 + adds r0, r4 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081742E2 + ldr r4, _0817431C + movs r0, 0x80 + lsls r0, 6 + bl malloc_and_clear + str r0, [r4] + ldr r0, _08174320 + bl set_callback2 +_08174308: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08174310: .4byte 0x00003f42 +_08174314: .4byte sub_8174324 + 1 +_08174318: .4byte 0x03005e08 +_0817431C: .4byte 0x0203bcd8 +_08174320: .4byte sub_8173560 + 1 + thumb_func_end sub_8174194 + + thumb_func_start sub_8174324 +sub_8174324: @ 8174324 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _08174358 + str r0, [sp] + movs r0, 0 + movs r1, 0x1E + movs r2, 0 + movs r3, 0xC + bl sub_81980F0 + movs r0, 0x3 + bl sub_81534D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08174364 + ldr r0, _0817435C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _08174360 + b _081743DA + .align 2, 0 +_08174358: .4byte 0x00000226 +_0817435C: .4byte 0x03005e00 +_08174360: .4byte sub_81749A0 + 1 +_08174364: + ldr r0, _081743AC + ldr r4, _081743B0 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldr r4, [r4] + movs r2, 0 + ldrh r1, [r4, 0x8] + ldr r3, _081743B4 + adds r0, r3, 0 + ands r0, r1 + lsls r5, r6, 2 + cmp r0, 0 + beq _0817439A +_08174384: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + adds r4, 0x78 + cmp r2, 0x31 + bhi _081743BC + ldrh r1, [r4, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08174384 +_0817439A: + cmp r2, 0x31 + bhi _081743BC + ldr r0, _081743B8 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + subs r0, r2, 0x1 + b _081743C6 + .align 2, 0 +_081743AC: .4byte 0x0201c000 +_081743B0: .4byte 0x0203bcd8 +_081743B4: .4byte 0x000001ff +_081743B8: .4byte 0x03005e00 +_081743BC: + ldr r0, _081743E4 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0x31 +_081743C6: + strh r0, [r1, 0x8] + movs r0, 0xA + bl sub_80847F8 + ldr r2, _081743E4 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0xA] + ldr r0, _081743E8 +_081743DA: + str r0, [r1] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081743E4: .4byte 0x03005e00 +_081743E8: .4byte sub_81743EC + 1 + thumb_func_end sub_8174324 + + thumb_func_start sub_81743EC +sub_81743EC: @ 81743EC + 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 r0, _081744A0 + ldr r3, [r0] + movs r5, 0 + ldr r1, _081744A4 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + ldr r2, _081744A8 + cmp r5, r0 + bge _0817442A + adds r1, r0, 0 +_0817441E: + adds r3, 0x78 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r1 + blt _0817441E +_0817442A: + adds r6, r3, 0 + movs r0, 0 + str r0, [r2] + mov r5, r8 + lsls r2, r5, 2 + adds r1, r2, r5 + lsls r1, 3 + adds r1, r4 + strh r0, [r1, 0xC] + strh r0, [r1, 0x10] + movs r5, 0 + str r2, [sp, 0x14] + ldr r4, _081744AC + adds r2, r1, 0 +_08174446: + ldrh r1, [r6, 0x8] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08174456 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + strh r0, [r2, 0x10] +_08174456: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x14 + cmp r5, 0x5 + bls _08174446 + adds r6, r3, 0 + movs r5, 0 + ldr r1, _081744A4 + ldr r0, [sp, 0x14] + add r0, r8 + lsls r0, 3 + mov r9, r0 + adds r0, r1 + str r0, [sp, 0x10] + ldr r1, _081744AC + mov r10, r1 +_08174478: + ldrh r0, [r6, 0x8] + mov r1, r10 + ands r1, r0 + adds r7, r0, 0 + cmp r1, 0 + beq _08174540 + ldr r2, [sp, 0x10] + movs r4, 0x10 + ldrsh r0, [r2, r4] + cmp r0, 0x3 + ble _081744B8 + lsls r1, r5, 3 + ldr r0, _081744B0 + adds r0, 0x4 + adds r0, r1, r0 + ldrh r3, [r0] + ldr r0, _081744B4 + adds r1, r0 + ldrh r4, [r1] + b _081744C8 + .align 2, 0 +_081744A0: .4byte 0x0203bcd8 +_081744A4: .4byte 0x03005e00 +_081744A8: .4byte 0x0203bcd4 +_081744AC: .4byte 0x000001ff +_081744B0: .4byte 0x085e53b4 +_081744B4: .4byte 0x085e53ba +_081744B8: + ldr r0, _08174530 + lsls r2, r5, 3 + adds r1, r0, 0x4 + adds r1, r2, r1 + ldrh r3, [r1] + adds r0, 0x6 + adds r2, r0 + ldrh r4, [r2] +_081744C8: + mov r1, r10 + ands r1, r7 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _081744DE + lsls r0, r4, 16 + movs r1, 0xA0 + lsls r1, 12 + adds r0, r1 + lsrs r4, r0, 16 +_081744DE: + lsls r0, r7, 23 + lsrs r0, 23 + ldr r1, [r6] + ldr r2, [r6, 0x4] + lsls r3, 16 + asrs r3, 16 + str r3, [sp] + lsls r3, r4, 16 + asrs r3, 16 + str r3, [sp, 0x4] + lsls r3, r5, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + ldr r3, _08174534 + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08174538 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r3, r2 + movs r2, 0x4 + orrs r3, r2 + strb r3, [r1, 0x5] + adds r1, r5, 0x5 + lsls r1, 1 + add r1, r9 + ldr r2, _0817453C + adds r1, r2 + strh r0, [r1] + b _0817454E + .align 2, 0 +_08174530: .4byte 0x085e53e4 +_08174534: .4byte 0x0000ffff +_08174538: .4byte 0x02020630 +_0817453C: .4byte 0x03005e08 +_08174540: + adds r0, r5, 0x5 + lsls r0, 1 + add r0, r9 + ldr r4, _081745A0 + adds r0, r4 + movs r1, 0xFF + strh r1, [r0] +_0817454E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x14 + cmp r5, 0x5 + bls _08174478 + ldr r0, _081745A4 + ldr r2, _081745A8 + movs r1, 0xC + bl sub_80A2A20 + ldr r0, _081745AC + ldr r1, _081745B0 + ldr r4, [sp, 0x14] + add r4, r8 + lsls r4, 3 + adds r4, r1 + movs r5, 0xA + ldrsh r1, [r4, r5] + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r5, _081745B4 + ldr r1, _081745B8 + adds r0, r5, 0 + bl ExpandTextCodes + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _081745C0 + ldr r1, _081745BC + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_8198204 + b _081745D0 + .align 2, 0 +_081745A0: .4byte 0x03005e08 +_081745A4: .4byte 0xffff0000 +_081745A8: .4byte 0x000063b0 +_081745AC: .4byte 0x02021cc4 +_081745B0: .4byte 0x03005e00 +_081745B4: .4byte 0x02021fc4 +_081745B8: .4byte 0x085e8c00 +_081745BC: .4byte 0x085e8574 +_081745C0: + ldr r1, _081745F0 + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_8198204 +_081745D0: + ldr r0, _081745F4 + ldr r1, [sp, 0x14] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, _081745F8 + str r0, [r1] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081745F0: .4byte 0x085e855c +_081745F4: .4byte 0x03005e00 +_081745F8: .4byte sub_81745FC + 1 + thumb_func_end sub_81743EC + + thumb_func_start sub_81745FC +sub_81745FC: @ 81745FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08174704 + ldr r5, [r0] + movs r3, 0 + ldr r1, _08174708 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r3, r0 + bge _08174630 + adds r1, r0, 0 +_08174624: + adds r5, 0x78 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + blt _08174624 +_08174630: + movs r3, 0 + lsls r7, r4, 2 + adds r0, r7, r4 + lsls r6, r0, 3 + ldr r0, _0817470C + mov r10, r0 + ldr r1, _08174710 + mov r8, r1 + movs r2, 0xD + negs r2, r2 + mov r9, r2 + movs r0, 0x4 + mov r12, r0 +_0817464A: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r6 + add r0, r10 + ldrh r1, [r0] + cmp r1, 0xFF + beq _0817466C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r2, [r0, 0x5] + mov r1, r9 + ands r1, r2 + mov r2, r12 + orrs r1, r2 + strb r1, [r0, 0x5] +_0817466C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _0817464A + adds r1, r7, r4 + lsls r1, 3 + ldr r0, _08174708 + adds r6, r1, r0 + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, 0x5 + lsls r0, 1 + adds r0, r1 + ldr r1, _08174708 + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08174710 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + ldr r1, _08174714 + eors r0, r1 + ldr r2, _08174718 + str r0, [r2] + ldr r2, _0817471C + movs r1, 0xC + bl sub_80A2A5C + movs r0, 0xC + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, r5, r0 + ldrh r1, [r4, 0x8] + ldr r0, _08174720 + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _081746E6 + bl sub_80A369C + ldrh r0, [r4, 0x8] + lsls r0, 23 + lsrs r0, 23 + movs r1, 0 + bl cry_related +_081746E6: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xE + bl sub_8174A88 + ldr r0, _08174724 + str r0, [r6] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174704: .4byte 0x0203bcd8 +_08174708: .4byte 0x03005e00 +_0817470C: .4byte 0x03005e08 +_08174710: .4byte 0x02020630 +_08174714: .4byte 0xffff0000 +_08174718: .4byte 0x0203bcd4 +_0817471C: .4byte 0x000063b0 +_08174720: .4byte 0x000001ff +_08174724: .4byte sub_8174728 + 1 + thumb_func_end sub_81745FC + + thumb_func_start sub_8174728 +sub_8174728: @ 8174728 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _081747AC + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + adds r3, r1, 0 + cmp r0, 0 + beq _081747E4 + ldr r0, _081747B0 + mov r12, r0 + lsls r0, r6, 2 + adds r1, r0, r6 + lsls r3, r1, 3 + mov r1, r12 + adds r4, r3, r1 + ldrh r2, [r4, 0x8] + movs r5, 0x8 + ldrsh r1, [r4, r5] + mov r9, r0 + cmp r1, 0 + beq _081747B8 + subs r0, r2, 0x1 + strh r0, [r4, 0x8] + movs r5, 0 + adds r7, r3, 0 + movs r0, 0x8 + add r0, r12 + mov r8, r0 +_0817476A: + adds r0, r5, 0x5 + lsls r0, 1 + adds r0, r7 + mov r1, r8 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08174782 + bl sub_818D820 + movs r0, 0xFF + strh r0, [r4] +_08174782: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _0817476A + ldr r0, _081747B0 + mov r2, r9 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _081747A4 + subs r0, r2, 0x1 + strh r0, [r1, 0xA] +_081747A4: + ldr r0, _081747B4 + str r0, [r1] + b _08174884 + .align 2, 0 +_081747AC: .4byte 0x030022c0 +_081747B0: .4byte 0x03005e00 +_081747B4: .4byte sub_81743EC + 1 +_081747B8: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _081747D2 + bl sub_80A369C + ldr r0, _081747D8 + ldr r1, _081747DC + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_081747D2: + ldr r0, _081747E0 + str r0, [r4] + b _08174884 + .align 2, 0 +_081747D8: .4byte 0x03007420 +_081747DC: .4byte 0x0000ffff +_081747E0: .4byte sub_8174898 + 1 +_081747E4: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08174828 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _08174806 + bl sub_80A369C + ldr r0, _08174818 + ldr r1, _0817481C + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08174806: + ldr r0, _08174820 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _08174824 + str r0, [r1] + b _08174884 + .align 2, 0 +_08174818: .4byte 0x03007420 +_0817481C: .4byte 0x0000ffff +_08174820: .4byte 0x03005e00 +_08174824: .4byte sub_8174898 + 1 +_08174828: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08174858 + ldr r0, _08174850 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xC] + movs r4, 0xC + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08174858 + subs r0, r2, 0x1 + strh r0, [r1, 0xC] + ldr r0, _08174854 + str r0, [r1] + b _08174884 + .align 2, 0 +_08174850: .4byte 0x03005e00 +_08174854: .4byte sub_81745FC + 1 +_08174858: + ldrh r1, [r3, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08174884 + ldr r1, _08174890 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + movs r5, 0xC + ldrsh r1, [r2, r5] + movs r3, 0x10 + ldrsh r0, [r2, r3] + subs r0, 0x1 + cmp r1, r0 + bge _08174884 + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + ldr r0, _08174894 + str r0, [r2] +_08174884: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174890: .4byte 0x03005e00 +_08174894: .4byte sub_81745FC + 1 + thumb_func_end sub_8174728 + + thumb_func_start sub_8174898 +sub_8174898: @ 8174898 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081748D8 + ldr r1, _081748DC + movs r2, 0x80 + lsls r2, 2 + bl CpuSet + ldr r1, _081748E0 + ldr r0, _081748E4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80F9BF4 + ldr r1, _081748E8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081748EC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081748D8: .4byte 0x02037b14 +_081748DC: .4byte 0x02037714 +_081748E0: .4byte 0x0201c000 +_081748E4: .4byte 0x085e56d4 +_081748E8: .4byte 0x03005e00 +_081748EC: .4byte sub_81748F0 + 1 + thumb_func_end sub_8174898 + + thumb_func_start sub_81748F0 +sub_81748F0: @ 81748F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80F9C30 + lsls r0, 24 + cmp r0, 0 + bne _08174988 + movs r5, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, _08174994 + mov r8, r0 +_08174910: + adds r0, r5, 0x5 + lsls r0, 1 + adds r0, r7 + mov r1, r8 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0xFF + beq _08174928 + bl sub_818D820 + movs r0, 0xFF + strh r0, [r4] +_08174928: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08174910 + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + bl sub_8198314 + bl Window_FreeMemory + movs r0, 0x1 + bl bg_unset_tilemap + movs r0, 0x3 + bl bg_unset_tilemap + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + adds r0, r6, 0 + bl remove_task + ldr r4, _08174998 + ldr r0, [r4] + cmp r0, 0 + beq _08174974 + bl free + movs r0, 0 + str r0, [r4] +_08174974: + ldr r4, _0817499C + ldr r0, [r4] + cmp r0, 0 + beq _08174984 + bl free + movs r0, 0 + str r0, [r4] +_08174984: + bl sub_8137C3C +_08174988: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174994: .4byte 0x03005e08 +_08174998: .4byte 0x0203bcdc +_0817499C: .4byte 0x0203bcd8 + thumb_func_end sub_81748F0 + + thumb_func_start sub_81749A0 +sub_81749A0: @ 81749A0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081749F8 + movs r1, 0x8 + movs r2, 0x1 + bl sub_8198180 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, _081749FC + 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 text_box_related_one + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r1, _08174A00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08174A04 + str r1, [r0] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081749F8: .4byte 0x085e8588 +_081749FC: .4byte 0x085e8bdc +_08174A00: .4byte 0x03005e00 +_08174A04: .4byte sub_8174A08 + 1 + thumb_func_end sub_81749A0 + + thumb_func_start sub_8174A08 +sub_8174A08: @ 8174A08 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08174A2C + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08174A28 + ldr r0, _08174A30 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _08174A34 + str r0, [r1] +_08174A28: + pop {r0} + bx r0 + .align 2, 0 +_08174A2C: .4byte 0x030022c0 +_08174A30: .4byte 0x03005e00 +_08174A34: .4byte sub_8174898 + 1 + thumb_func_end sub_8174A08 + + thumb_func_start sub_8174A38 +sub_8174A38: @ 8174A38 + push {r4,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + ldr r4, _08174A80 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl sub_81DB35C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _08174A84 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08174A80: .4byte 0x085e8b3e +_08174A84: .4byte 0x085e5388 + thumb_func_end sub_8174A38 + + thumb_func_start sub_8174A88 +sub_8174A88: @ 8174A88 + push {r4-r7,lr} + sub sp, 0x2C + adds r7, r0, 0 + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + ldrh r0, [r7, 0x8] + ldr r1, _08174AF8 + ands r1, r0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _08174B30 + ldr r1, _08174AFC + add r0, sp, 0xC + bl gf_strcpy + adds r6, r0, 0 + ldrh r0, [r7, 0x8] + lsls r0, 23 + lsrs r0, 23 + bl sub_806E3C0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08174B00 + cmp r4, r0 + beq _08174B04 + adds r0, r4, 0 + movs r1, 0x64 + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + adds r6, 0x1 + adds r0, r4, 0 + movs r1, 0x64 + bl __modsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + adds r6, 0x1 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + subs r0, 0x5F + b _08174B0E + .align 2, 0 +_08174AF8: .4byte 0x000001ff +_08174AFC: .4byte 0x085e8c36 +_08174B00: .4byte 0x0000ffff +_08174B04: + movs r0, 0xAC + strb r0, [r6] + adds r6, 0x1 + strb r0, [r6] + adds r6, 0x1 +_08174B0E: + strb r0, [r6] + adds r6, 0x1 + movs r0, 0xFF + strb r0, [r6] + ldr r0, _08174B84 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x1 + bl box_print +_08174B30: + adds r1, r7, 0 + adds r1, 0xA + add r0, sp, 0xC + movs r2, 0xA + bl memcpy + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0xA] + ldrh r1, [r7, 0x8] + ldr r4, _08174B88 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08174B8C + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0xD0 + bl sub_81DB35C + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _08174B84 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + b _08174C82 + .align 2, 0 +_08174B84: .4byte 0x085e5388 +_08174B88: .4byte 0x000001ff +_08174B8C: + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x80 + bl sub_81DB368 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _08174BF8 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add r1, sp, 0xC + movs r0, 0xBA + strb r0, [r1] + mov r0, sp + adds r0, 0xD + ldrh r1, [r7, 0x8] + lsls r1, 23 + lsrs r1, 23 + movs r2, 0xB + muls r1, r2 + ldr r2, _08174BFC + adds r1, r2 + bl gf_strcpy + adds r6, r0, 0 + ldrh r1, [r7, 0x8] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x20 + beq _08174C0A + cmp r0, 0x1D + beq _08174C0A + lsls r0, r1, 23 + lsrs r0, 23 + ldr r1, [r7, 0x4] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08174C00 + cmp r0, 0xFE + beq _08174C04 + b _08174C0A + .align 2, 0 +_08174BF8: .4byte 0x085e5388 +_08174BFC: .4byte 0x083185c8 +_08174C00: + movs r0, 0xB5 + b _08174C06 +_08174C04: + movs r0, 0xB6 +_08174C06: + strb r0, [r6] + adds r6, 0x1 +_08174C0A: + movs r0, 0xFF + strb r0, [r6] + ldr r5, _08174C8C + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x80 + movs r3, 0x1 + bl box_print + ldr r1, _08174C90 + add r0, sp, 0xC + bl gf_strcpy + adds r6, r0, 0 + ldrb r1, [r7, 0x9] + lsrs r1, 1 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x24 + movs r3, 0x11 + bl box_print + ldr r1, _08174C94 + add r0, sp, 0xC + bl gf_strcpy + adds r6, r0, 0 + ldrh r1, [r7] + movs r2, 0x2 + movs r3, 0x5 + bl decimal_int_to_string + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x68 + movs r3, 0x11 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08174C82: + add sp, 0x2C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174C8C: .4byte 0x085e5388 +_08174C90: .4byte 0x085e8c3b +_08174C94: .4byte 0x085e8c4d + thumb_func_end sub_8174A88 + + thumb_func_start sub_8174C98 +sub_8174C98: @ 8174C98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r0, 0x1 + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r2, _08174EA4 + movs r0, 0x1 + movs r1, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, _08174EA8 + mov r8, r0 + str r0, [sp] + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + str r1, [sp, 0x4] + ldr r0, _08174EAC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + ldr r0, _08174EB0 + mov r10, r0 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x70 + bl sub_81DB368 + lsls r2, r0, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r1, r10 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + mov r1, r10 + ldr r0, [r1] + ldrb r4, [r0, 0xA] + ldrb r0, [r0, 0xB] + lsls r0, 8 + orrs r4, r0 + mov r0, r8 + str r0, [sp] + movs r7, 0 + str r7, [sp, 0x4] + ldr r0, _08174EB4 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x11 + bl box_print + add r6, sp, 0xC + ldr r1, _08174EB8 + adds r0, r4, 0 + bl __modsi3 + ldr r5, _08174EBC + adds r1, r5, 0 + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + add r6, sp, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r5, 0xFA + lsls r5, 2 + adds r1, r5, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r6, 0x1] + add r6, sp, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r6, 0x2] + add r5, sp, 0xC + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x3] + add r5, sp, 0xC + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0x5] + movs r0, 0x1 + movs r2, 0x70 + bl sub_81DB368 + lsls r2, r0, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + mov r0, r8 + str r0, [sp] + mov r1, r9 + str r1, [sp, 0x4] + ldr r0, _08174EC0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x21 + bl box_print + add r5, sp, 0xC + mov r0, r10 + ldr r4, [r0] + ldrh r0, [r4, 0xE] + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5] + add r5, sp, 0xC + ldrh r0, [r4, 0xE] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x1] + add r5, sp, 0xC + ldrh r0, [r4, 0xE] + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + add r0, sp, 0xC + ldrb r0, [r0] + cmp r0, 0xA1 + bne _08174E1E + add r0, sp, 0xC + strb r7, [r0] +_08174E1E: + add r0, sp, 0xC + ldrb r1, [r0] + cmp r1, 0 + bne _08174E30 + ldrb r0, [r0, 0x1] + cmp r0, 0xA1 + bne _08174E30 + add r0, sp, 0xC + strb r1, [r0, 0x8] +_08174E30: + add r1, sp, 0xC + movs r0, 0xF0 + strb r0, [r1, 0x3] + adds r4, r1, 0 + ldr r0, _08174EB0 + ldr r5, [r0] + ldrb r0, [r5, 0x10] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4, 0x4] + add r4, sp, 0xC + ldrb r0, [r5, 0x10] + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4, 0x5] + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0x6] + movs r0, 0x1 + movs r2, 0x70 + bl sub_81DB368 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, _08174EA8 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x21 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174EA4: .4byte 0x0000021d +_08174EA8: .4byte 0x085e538c +_08174EAC: .4byte 0x085e8c48 +_08174EB0: .4byte 0x03005d90 +_08174EB4: .4byte 0x085e8c4d +_08174EB8: .4byte 0x000186a0 +_08174EBC: .4byte 0x00002710 +_08174EC0: .4byte 0x085e84ce + thumb_func_end sub_8174C98 + + thumb_func_start sub_8174EC4 +sub_8174EC4: @ 8174EC4 + 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, _08174F64 + movs r5, 0x80 + lsls r5, 5 + ldr r7, _08174F68 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_08174EEA: + 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 _08174EEA + 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, _08174F64 + 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] + bl sub_80A1A74 + ldr r0, _08174F6C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08174F64: .4byte 0x040000d4 +_08174F68: .4byte 0x81000800 +_08174F6C: .4byte 0x085e54e8 + thumb_func_end sub_8174EC4 + + thumb_func_start sub_8174F70 +sub_8174F70: @ 8174F70 + push {lr} + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl reset_temp_tile_data_buffers + bl dp13_810BB8C + bl gpu_pal_allocator_reset + ldr r1, _08174FA0 + movs r0, 0x8 + strb r0, [r1] + ldr r0, _08174FA4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08174FA8 + bl gpu_pal_obj_decompress_and_apply + pop {r0} + bx r0 + .align 2, 0 +_08174FA0: .4byte 0x0300301c +_08174FA4: .4byte 0x085e5394 +_08174FA8: .4byte 0x085e53a4 + thumb_func_end sub_8174F70 + + thumb_func_start sub_8174FAC +sub_8174FAC: @ 8174FAC + push {r4,lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08175018 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _0817501C + ldr r1, [r4] + adds r1, 0x12 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _08175020 + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175018: .4byte 0x085e5374 +_0817501C: .4byte 0x0203bcdc +_08175020: .4byte 0x00001012 + thumb_func_end sub_8174FAC + + thumb_func_start sub_8175024 +sub_8175024: @ 8175024 + push {r4,lr} + sub sp, 0x8 + ldr r0, _0817503C + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _08175108 + lsls r0, 2 + ldr r1, _08175040 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817503C: .4byte 0x0203bcdc +_08175040: .4byte _08175044 + .align 2, 0 +_08175044: + .4byte _08175058 + .4byte _08175070 + .4byte _0817507C + .4byte _081750D2 + .4byte _081750DC +_08175058: + ldr r1, _0817506C + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08175108 + .align 2, 0 +_0817506C: .4byte 0x085e5508 +_08175070: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08175108 + b _08175112 +_0817507C: + movs r4, 0x20 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + str r4, [sp] + movs r0, 0xB + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl bg_fill_tilemap_rect + str r4, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0xE + bl bg_fill_tilemap_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x2 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _08175108 +_081750D2: + bl sub_81971D0 + bl sub_8197200 + b _08175108 +_081750DC: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r0, _08175104 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08175114 + .align 2, 0 +_08175104: .4byte 0x0203bcdc +_08175108: + ldr r0, _0817511C + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_08175112: + movs r0, 0x1 +_08175114: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0817511C: .4byte 0x0203bcdc + thumb_func_end sub_8175024 + + thumb_func_start sub_8175120 +sub_8175120: @ 8175120 + push {r4,lr} + adds r2, r0, 0 + ldr r1, [r2, 0x20] + ldr r0, [r2, 0x30] + cmp r1, r0 + beq _08175176 + ldrh r3, [r2, 0x20] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r4, 0x30 + ldrsh r1, [r2, r4] + cmp r0, r1 + bge _08175140 + adds r0, r3, 0 + adds r0, 0xF + strh r0, [r2, 0x20] +_08175140: + ldrh r3, [r2, 0x20] + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, r1 + ble _08175150 + adds r0, r3, 0 + subs r0, 0xF + strh r0, [r2, 0x20] +_08175150: + ldrh r3, [r2, 0x22] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r4, 0x32 + ldrsh r1, [r2, r4] + cmp r0, r1 + bge _08175164 + adds r0, r3, 0 + adds r0, 0xA + strh r0, [r2, 0x22] +_08175164: + ldrh r3, [r2, 0x22] + movs r4, 0x22 + ldrsh r0, [r2, r4] + cmp r0, r1 + ble _0817519C + adds r0, r3, 0 + subs r0, 0xA + strh r0, [r2, 0x22] + b _0817519C +_08175176: + ldrh r0, [r2, 0x3C] + lsls r1, r0, 16 + movs r0, 0xCE + lsls r0, 17 + cmp r1, r0 + bne _08175190 + lsrs r1, 16 + adds r0, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl sub_806ED40 + b _0817519C +_08175190: + lsrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl sub_806ED40 +_0817519C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8175120 + + thumb_func_start sub_81751A4 +sub_81751A4: @ 81751A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x26] + movs r2, 0x26 + ldrsh r0, [r5, r2] + cmp r0, 0x78 + ble _081751BA + adds r0, r5, 0 + bl obj_delete_and_free_tiles + b _081751F2 +_081751BA: + adds r0, r1, 0x1 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r4, [r5, 0x2E] + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, 0x8 + ldr r1, _081751F8 + lsls r4, 1 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + muls r0, r1 + cmp r0, 0 + bge _081751E8 + adds r0, 0xFF +_081751E8: + asrs r0, 8 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x2E] + adds r0, 0x4 + strh r0, [r5, 0x2E] +_081751F2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081751F8: .4byte 0x08329f40 + thumb_func_end sub_81751A4 + + thumb_func_start sub_81751FC +sub_81751FC: @ 81751FC + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x7 + ands r2, r0 + negs r2, r2 + ldr r0, _0817526C + lsls r4, 16 + asrs r4, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r4, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _08175270 + adds r4, r1, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + beq _08175274 + movs r0, 0 + b _08175276 + .align 2, 0 +_0817526C: .4byte 0x085e54d0 +_08175270: .4byte 0x02020630 +_08175274: + movs r0, 0x1 +_08175276: + strh r0, [r4, 0x30] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81751FC + + thumb_func_start sub_8175280 +sub_8175280: @ 8175280 + push {r4,lr} + ldr r4, _081752B0 + movs r0, 0xB4 + strh r0, [r4] + ldr r0, _081752B4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081752AA + ldr r1, _081752B8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r4] + strh r1, [r0, 0xA] + ldr r0, _081752BC + strh r2, [r0] +_081752AA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081752B0: .4byte 0x020375e0 +_081752B4: .4byte sub_8175364 + 1 +_081752B8: .4byte 0x03005e00 +_081752BC: .4byte 0x020375e2 + thumb_func_end sub_8175280 + + thumb_func_start sub_81752C0 +sub_81752C0: @ 81752C0 + push {r4,lr} + ldr r0, _081752EC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081752D4 + bl remove_task +_081752D4: + bl sub_8152254 + ldr r4, _081752F0 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081752EC: .4byte sub_8175364 + 1 +_081752F0: .4byte 0x000003e9 + thumb_func_end sub_81752C0 + + thumb_func_start sub_81752F4 +sub_81752F4: @ 81752F4 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0xE] + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0x6E + ble _08175324 + ldr r2, _08175320 + movs r0, 0x28 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x1 + strh r1, [r0, 0x26] + ldrb r0, [r5, 0x16] + bl sub_81525D0 + b _08175358 + .align 2, 0 +_08175320: .4byte 0x03005e00 +_08175324: + adds r0, r1, 0x1 + ldrh r1, [r5, 0x1C] + adds r0, r1 + strh r0, [r5, 0xE] + ldrb r4, [r5, 0x1A] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, 0x8 + ldr r1, _08175360 + lsls r4, 1 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + muls r0, r1 + cmp r0, 0 + bge _0817534E + adds r0, 0xFF +_0817534E: + asrs r0, 8 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x1A] + adds r0, 0x4 + strh r0, [r5, 0x1A] +_08175358: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08175360: .4byte 0x08329f40 + thumb_func_end sub_81752F4 + + thumb_func_start sub_8175364 +sub_8175364: @ 8175364 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + movs r7, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08175390 + adds r6, r0, r1 + ldrh r0, [r6] + cmp r0, 0x1 + beq _081753E0 + cmp r0, 0x1 + bgt _08175394 + cmp r0, 0 + beq _0817539C + b _081754B0 + .align 2, 0 +_08175390: .4byte 0x03005e08 +_08175394: + cmp r0, 0xFF + bne _0817539A + b _081754A0 +_0817539A: + b _081754B0 +_0817539C: + movs r0, 0x40 + bl sub_81521C0 + cmp r0, 0 + bne _081753B8 + adds r0, r4, 0 + bl remove_task + ldr r0, _081753CC + strh r7, [r0] + ldr r1, _081753D0 + ldr r2, _081753D4 + adds r0, r2, 0 + strh r0, [r1] +_081753B8: + ldr r0, _081753D8 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081753DC + bl gpu_pal_obj_decompress_and_apply + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + b _081754B0 + .align 2, 0 +_081753CC: .4byte 0x020375e0 +_081753D0: .4byte 0x020375e2 +_081753D4: .4byte 0x0000ffff +_081753D8: .4byte 0x085e5394 +_081753DC: .4byte 0x085e53a4 +_081753E0: + ldrh r0, [r6, 0x2] + cmp r0, 0 + beq _08175478 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08175478 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r5, r0, 0 + lsls r5, 16 + asrs r5, 16 + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x7 + ands r4, r0 + negs r4, r4 + lsls r4, 16 + asrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08175488 + ldr r2, _0817548C + str r4, [sp] + str r0, [sp, 0x4] + str r7, [sp, 0x8] + adds r0, r1, 0 + adds r1, r2, 0 + adds r3, r5, 0 + bl sub_81524C4 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xFF + beq _08175478 + adds r4, r7, 0 + ldr r1, _08175490 + adds r0, r4, 0 + bl sub_8152438 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _08175468 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8152474 +_08175468: + adds r0, r4, 0 + movs r1, 0x7 + mov r2, r8 + bl sub_8152474 + ldrh r0, [r6, 0x1E] + adds r0, 0x1 + strh r0, [r6, 0x1E] +_08175478: + bl sub_81522D4 + ldrh r0, [r6, 0x2] + cmp r0, 0 + beq _08175494 + subs r0, 0x1 + strh r0, [r6, 0x2] + b _081754B0 + .align 2, 0 +_08175488: .4byte 0x085e53fc +_0817548C: .4byte 0x000003e9 +_08175490: .4byte sub_81752F4 + 1 +_08175494: + ldrh r0, [r6, 0x1E] + cmp r0, 0 + bne _081754B0 + movs r0, 0xFF + strh r0, [r6] + b _081754B0 +_081754A0: + bl sub_81752C0 + ldr r0, _081754BC + strh r7, [r0] + ldr r1, _081754C0 + ldr r2, _081754C4 + adds r0, r2, 0 + strh r0, [r1] +_081754B0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081754BC: .4byte 0x020375e0 +_081754C0: .4byte 0x020375e2 +_081754C4: .4byte 0x0000ffff + thumb_func_end sub_8175364 + + thumb_func_start sub_81754C8 +sub_81754C8: @ 81754C8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81754C8 + + thumb_func_start sub_81754DC +sub_81754DC: @ 81754DC + push {lr} + bl run_active_tasks + bl call_obj_callbacks + ldr r0, _08175530 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08175522 + ldr r0, _08175534 + ldrb r0, [r0] + cmp r0, 0 + beq _08175522 + ldr r2, _08175538 + ldr r0, _0817553C + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, [r0] + ldr r0, _08175540 + cmp r1, r0 + bne _08175522 + bl sub_81754C8 + bl run_active_tasks + bl call_obj_callbacks + ldr r1, _08175544 + movs r0, 0x1 + strb r0, [r1] +_08175522: + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + .align 2, 0 +_08175530: .4byte 0x030022c0 +_08175534: .4byte 0x0203bce4 +_08175538: .4byte 0x03005e00 +_0817553C: .4byte 0x0203bce2 +_08175540: .4byte sub_8175774 + 1 +_08175544: .4byte 0x0203bce5 + thumb_func_end sub_81754DC + + thumb_func_start sub_8175548 +sub_8175548: @ 8175548 + push {lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08175598 + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + movs r0, 0x80 + lsls r0, 4 + bl malloc_and_clear + adds r1, r0, 0 + movs r0, 0 + bl bg_set_tilemap + ldr r0, _0817559C + movs r1, 0x80 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, _081755A0 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0 + bl gpu_sync_bg_show + pop {r0} + bx r0 + .align 2, 0 +_08175598: .4byte 0x085e6f68 +_0817559C: .4byte 0x085e56f0 +_081755A0: .4byte 0x085e6f6c + thumb_func_end sub_8175548 + + thumb_func_start sub_81755A4 +sub_81755A4: @ 81755A4 + push {lr} + bl Window_FreeMemory + movs r0, 0 + bl bg_get_tilemap + cmp r0, 0 + beq _081755B8 + bl free +_081755B8: + pop {r0} + bx r0 + thumb_func_end sub_81755A4 + + thumb_func_start sub_81755BC +sub_81755BC: @ 81755BC + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + cmp r2, 0x1 + bne _081755DC + movs r0, 0x3 + strb r0, [r1, 0x1] + movs r0, 0x4 + b _081755E4 +_081755DC: + add r1, sp, 0x14 + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 +_081755E4: + strb r0, [r1, 0x2] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + movs r3, 0x1 + bl sub_81DB374 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r3, r5, 0 + bl sub_8199EEC + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81755BC + + thumb_func_start sub_8175620 +sub_8175620: @ 8175620 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl sub_8175CE4 + movs r0, 0 + bl SetVBlankCallback + ldr r0, _08175718 + movs r1, 0xE0 + lsls r1, 9 + bl init_malloc + bl sub_80A1A74 + bl clear_tasks + bl sub_8175548 + ldr r0, _0817571C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _08175720 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x10] + strh r1, [r0, 0x16] + strh r1, [r0, 0x1E] + movs r1, 0x1 + strh r1, [r0, 0x22] +_0817566A: + movs r0, 0 + adds r1, r7, 0 + bl sub_8176AB0 + lsls r0, 24 + cmp r0, 0 + beq _0817566A + ldr r5, _08175720 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0 + mov r8, r1 + movs r6, 0 + movs r1, 0x28 + strh r1, [r0, 0x8] + ldr r1, _08175724 + movs r0, 0x12 + bl lcd_io_set + ldr r0, _08175728 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r7, [r1, 0xA] + strh r0, [r4, 0x26] + movs r0, 0x1 + negs r0, r0 + str r6, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _0817572C + bl SetVBlankCallback + ldr r0, _08175730 + bl m4aSongNumStart + ldr r0, _08175734 + bl set_callback2 + ldr r0, _08175738 + mov r1, r8 + strb r1, [r0] + ldr r4, _0817573C + movs r0, 0xEB + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + bl sub_8177388 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8E + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + ldr r0, _08175740 + strh r7, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08175718: .4byte 0x02000000 +_0817571C: .4byte sub_8175744 + 1 +_08175720: .4byte 0x03005e00 +_08175724: .4byte 0x0000fffc +_08175728: .4byte sub_8175DA0 + 1 +_0817572C: .4byte sub_81754C8 + 1 +_08175730: .4byte 0x000001c7 +_08175734: .4byte sub_81754DC + 1 +_08175738: .4byte 0x0203bce5 +_0817573C: .4byte 0x0203bce8 +_08175740: .4byte 0x0203bce2 + thumb_func_end sub_8175620 + + thumb_func_start sub_8175744 +sub_8175744: @ 8175744 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08175768 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175764 + ldr r0, _0817576C + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _08175770 + str r0, [r1] +_08175764: + pop {r0} + bx r0 + .align 2, 0 +_08175768: .4byte 0x02037fd4 +_0817576C: .4byte 0x03005e00 +_08175770: .4byte sub_8175774 + 1 + thumb_func_end sub_8175744 + + thumb_func_start sub_8175774 +sub_8175774: @ 8175774 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081757A8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _081757B0 + movs r3, 0xA + ldrsh r1, [r4, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1E + strh r1, [r0, 0x8] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x20] + ldr r0, _081757AC + b _081757FA + .align 2, 0 +_081757A8: .4byte 0x03005e00 +_081757AC: .4byte sub_8175A9C + 1 +_081757B0: + ldr r0, _081757D8 + strh r1, [r0] + ldrh r2, [r4, 0x1E] + movs r3, 0x1E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _081757E0 + strh r2, [r4, 0x22] + strh r1, [r4, 0x1E] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _081757DC + b _081757FA + .align 2, 0 +_081757D8: .4byte 0x0203bce0 +_081757DC: .4byte sub_8175808 + 1 +_081757E0: + cmp r0, 0x2 + bne _081757FC + strh r2, [r4, 0x22] + strh r1, [r4, 0x1E] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08175804 +_081757FA: + str r0, [r4] +_081757FC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175804: .4byte sub_81758A4 + 1 + thumb_func_end sub_8175774 + + thumb_func_start sub_8175808 +sub_8175808: @ 8175808 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817583C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175836 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, _08175840 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08175844 + str r0, [r1] +_08175836: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817583C: .4byte 0x02037fd4 +_08175840: .4byte 0x03005e00 +_08175844: .4byte c2_080C9BFC + 1 + thumb_func_end sub_8175808 + + thumb_func_start c2_080C9BFC +c2_080C9BFC: @ 8175848 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl SetVBlankCallback + ldr r1, _08175898 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrb r0, [r5, 0x16] + adds r1, r4, 0 + bl sub_8176AB0 + lsls r0, 24 + cmp r0, 0 + beq _08175890 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _0817589C + bl SetVBlankCallback + ldr r0, _081758A0 + str r0, [r5] +_08175890: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08175898: .4byte 0x03005e00 +_0817589C: .4byte sub_81754C8 + 1 +_081758A0: .4byte sub_8175744 + 1 + thumb_func_end c2_080C9BFC + + thumb_func_start sub_81758A4 +sub_81758A4: @ 81758A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081758D8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081758D2 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, _081758DC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081758E0 + str r0, [r1] +_081758D2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081758D8: .4byte 0x02037fd4 +_081758DC: .4byte 0x03005e00 +_081758E0: .4byte sub_81758E4 + 1 + thumb_func_end sub_81758A4 + + thumb_func_start sub_81758E4 +sub_81758E4: @ 81758E4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _081759B0 + movs r1, 0x87 + lsls r1, 3 + adds r1, r0 + mov r8, r1 + ldrb r7, [r1] + cmp r7, 0 + beq _08175906 + cmp r7, 0x1 + beq _081759F0 +_08175906: + bl reset_all_obj_data + bl dp13_810BB8C + bl gpu_pal_allocator_reset + ldr r1, _081759B4 + movs r0, 0x8 + strb r0, [r1] + ldr r0, _081759B8 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _081759BC + ldr r1, _081759C0 + bl LZ77UnCompVram + ldr r0, _081759C4 + movs r1, 0x1 + movs r2, 0x3E + bl gpu_pal_apply + movs r1, 0 + ldr r4, _081759C8 + movs r3, 0x11 + ldr r2, _081759CC +_0817593C: + adds r0, r1, r4 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _0817593C + movs r1, 0 + ldr r2, _081759D0 + ldr r6, _081759D4 + ldr r0, _081759D8 + adds r5, r2, r0 + movs r4, 0x22 + ldr r3, _081759CC +_08175958: + adds r0, r1, r5 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bls _08175958 + movs r1, 0 + ldr r5, _081759DC + movs r4, 0x33 + ldr r3, _081759CC +_0817596E: + adds r0, r1, r5 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bls _0817596E + movs r0, 0 + strh r0, [r2] + ldr r1, _081759E0 + adds r0, r1, 0 + strh r0, [r2, 0x2] + ldr r1, _081759E4 + adds r0, r1, 0 + strh r0, [r2, 0x4] + ldr r1, _081759E8 + adds r0, r1, 0 + strh r0, [r2, 0x6] + adds r0, r6, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _081759EC + bl gpu_pal_obj_alloc_tag_and_apply + ldr r1, _081759B0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08175A7A + .align 2, 0 +_081759B0: .4byte 0x030022c0 +_081759B4: .4byte 0x0300301c +_081759B8: .4byte 0x085b0e04 +_081759BC: .4byte 0x085b0c0c +_081759C0: .4byte 0x06003800 +_081759C4: .4byte 0x085b0a02 +_081759C8: .4byte 0x0201c000 +_081759CC: .4byte 0x000007ff +_081759D0: .4byte 0x0201d800 +_081759D4: .4byte 0x085e701c +_081759D8: .4byte 0xfffff000 +_081759DC: .4byte 0x0201d000 +_081759E0: .4byte 0x000053ff +_081759E4: .4byte 0x0000529f +_081759E8: .4byte 0x00007e94 +_081759EC: .4byte 0x085e702c +_081759F0: + ldr r0, _08175A88 + movs r1, 0 + bl AddTask + ldr r2, _08175A8C + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + mov r9, r1 + movs r5, 0 + strh r0, [r4, 0xE] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r7, [r0, 0x8] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0xA] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0xC] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0x20 + bl lcd_io_set + ldr r1, _08175A90 + movs r0, 0xE + bl lcd_io_set + movs r1, 0xCA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + mov r0, r9 + mov r1, r8 + strb r0, [r1] + ldr r0, _08175A94 + strh r5, [r0] + ldr r0, _08175A98 + str r0, [r4] +_08175A7A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08175A88: .4byte sub_81760FC + 1 +_08175A8C: .4byte 0x03005e00 +_08175A90: .4byte 0x00000703 +_08175A94: .4byte 0x0203bd28 +_08175A98: .4byte sub_8175744 + 1 + thumb_func_end sub_81758E4 + + thumb_func_start sub_8175A9C +sub_8175A9C: @ 8175A9C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08175AC0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x20] + movs r2, 0x20 + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08175AC4 + subs r0, 0x1 + strh r0, [r4, 0x20] + b _08175AD8 + .align 2, 0 +_08175AC0: .4byte 0x03005e00 +_08175AC4: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0xC + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08175AE0 + str r0, [r4] +_08175AD8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175AE0: .4byte sub_8175AE4 + 1 + thumb_func_end sub_8175A9C + + thumb_func_start sub_8175AE4 +sub_8175AE4: @ 8175AE4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08175B10 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175B0A + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, _08175B14 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _08175B18 + str r0, [r1] +_08175B0A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175B10: .4byte 0x02037fd4 +_08175B14: .4byte 0x03005e00 +_08175B18: .4byte sub_8175B1C + 1 + thumb_func_end sub_8175AE4 + + thumb_func_start sub_8175B1C +sub_8175B1C: @ 8175B1C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8175CE4 + bl sub_80A1A74 + movs r1, 0xE0 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl sub_8176D1C + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r1, 0xE0 + lsls r1, 3 + movs r0, 0x8 + bl lcd_io_set + movs r0, 0x1 + bl enable_irqs + movs r1, 0xA0 + lsls r1, 1 + movs r0, 0 + bl lcd_io_set + ldr r1, _08175B88 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xEB + strh r1, [r0, 0x8] + ldr r1, _08175B8C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175B88: .4byte 0x03005e00 +_08175B8C: .4byte sub_8175B90 + 1 + thumb_func_end sub_8175B1C + + thumb_func_start sub_8175B90 +sub_8175B90: @ 8175B90 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08175BB4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08175BB8 + subs r0, 0x1 + strh r0, [r4, 0x8] + b _08175BCC + .align 2, 0 +_08175BB4: .4byte 0x03005e00 +_08175BB8: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0x6 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08175BD4 + str r0, [r4] +_08175BCC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175BD4: .4byte sub_8175BD8 + 1 + thumb_func_end sub_8175B90 + + thumb_func_start sub_8175BD8 +sub_8175BD8: @ 8175BD8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _08175C28 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08175C1E + movs r0, 0xE0 + lsls r0, 6 + movs r1, 0 + bl sub_8176E40 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _08175C2C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE1 + lsls r1, 5 + strh r1, [r0, 0x8] + ldr r1, _08175C30 + str r1, [r0] +_08175C1E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08175C28: .4byte 0x02037fd4 +_08175C2C: .4byte 0x03005e00 +_08175C30: .4byte sub_8175C34 + 1 + thumb_func_end sub_8175BD8 + + thumb_func_start sub_8175C34 +sub_8175C34: @ 8175C34 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08175C80 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CB8 + ldr r1, _08175C84 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _08175C62 + ldr r0, _08175C88 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _08175C94 +_08175C62: + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + ldr r1, _08175C8C + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08175C90 + str r0, [r4] + b _08175CB8 + .align 2, 0 +_08175C80: .4byte 0x02037fd4 +_08175C84: .4byte 0x03005e00 +_08175C88: .4byte 0x030022c0 +_08175C8C: .4byte 0x0000ffff +_08175C90: .4byte sub_8175CC8 + 1 +_08175C94: + ldr r0, _08175CC0 + cmp r1, r0 + bne _08175CA0 + movs r0, 0x8 + bl play_sound_effect +_08175CA0: + movs r0, 0x8 + ldrsh r1, [r4, r0] + ldr r0, _08175CC4 + cmp r1, r0 + bne _08175CB2 + movs r0, 0xE4 + lsls r0, 1 + bl m4aSongNumStart +_08175CB2: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] +_08175CB8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08175CC0: .4byte 0x00001be8 +_08175CC4: .4byte 0x00001ab8 + thumb_func_end sub_8175C34 + + thumb_func_start sub_8175CC8 +sub_8175CC8: @ 8175CC8 + push {lr} + ldr r0, _08175CE0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CDC + movs r0, 0xFF + bl SoftReset +_08175CDC: + pop {r0} + bx r0 + .align 2, 0 +_08175CE0: .4byte 0x02037fd4 + thumb_func_end sub_8175CC8 + + thumb_func_start sub_8175CE4 +sub_8175CE4: @ 8175CE4 + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _08175D8C + mov r0, sp + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _08175D90 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x4] + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _08175D94 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, sp + strh r2, [r0] + str r0, [r1] + ldr r0, _08175D98 + str r0, [r1, 0x4] + ldr r0, _08175D9C + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_08175D8C: .4byte 0x040000d4 +_08175D90: .4byte 0x8100c000 +_08175D94: .4byte 0x85000100 +_08175D98: .4byte 0x05000002 +_08175D9C: .4byte 0x810001ff + thumb_func_end sub_8175CE4 + + thumb_func_start sub_8175DA0 +sub_8175DA0: @ 8175DA0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08175DCC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r1, 0 + cmp r0, 0xA + bhi _08175E00 + lsls r0, 2 + ldr r1, _08175DD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08175DCC: .4byte 0x03005e00 +_08175DD0: .4byte _08175DD4 + .align 2, 0 +_08175DD4: + .4byte _08175E00 + .4byte _08175E40 + .4byte _08175E60 + .4byte _08175F38 + .4byte _08175F5C + .4byte _08175FC8 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175FFC +_08175E00: + ldr r0, _08175E38 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08175E12 + b _0817602A +_08175E12: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0x8] + movs r1, 0x48 + strh r1, [r0, 0xE] + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x24] + ldr r0, _08175E3C + strh r2, [r0] + b _0817602A + .align 2, 0 +_08175E38: .4byte 0x02037fd4 +_08175E3C: .4byte 0x0203bce0 +_08175E40: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08175E58 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _0817602A +_08175E58: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0817602A +_08175E60: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0xA + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r5, r0, r5 + ldr r1, [r5] + ldr r0, _08175F04 + mov r9, r2 + cmp r1, r0 + bne _08175F32 + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0x38 + bgt _08175F2C + movs r5, 0 + ldr r2, _08175F08 + mov r8, r2 + adds r7, r3, 0 + movs r6, 0xA0 + lsls r6, 19 +_08175E92: + movs r3, 0xC + ldrsh r1, [r7, r3] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5 + lsls r0, 2 + add r0, r8 + ldr r2, [r0] + ldr r0, [r2, 0x4] + lsrs r1, r6, 24 + ldrb r2, [r2, 0x1] + bl sub_81755BC + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r5, 0x1 + cmp r5, 0x4 + ble _08175E92 + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + ldr r3, _08175F0C + mov r2, r9 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xA + ldrsh r2, [r1, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x24] + movs r2, 0xA + ldrsh r1, [r1, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r3, 0x22 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08175F14 + movs r0, 0xC0 + lsls r0, 2 + ldr r1, _08175F10 + b _08175F1A + .align 2, 0 +_08175F04: .4byte sub_8175774 + 1 +_08175F08: .4byte 0x085e6af4 +_08175F0C: .4byte 0x03005e00 +_08175F10: .4byte 0x0000328d +_08175F14: + movs r0, 0xC0 + lsls r0, 2 + ldr r1, _08175F28 +_08175F1A: + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _0817602A + .align 2, 0 +_08175F28: .4byte 0x00001967 +_08175F2C: + movs r0, 0xA + strh r0, [r3, 0x8] + b _0817602A +_08175F32: + movs r0, 0 + strh r0, [r5, 0x24] + b _0817602A +_08175F38: + ldr r0, _08175F58 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817602A + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x73 + strh r1, [r0, 0xE] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0817602A + .align 2, 0 +_08175F58: .4byte 0x02037fd4 +_08175F5C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r5 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08175F74 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _0817602A +_08175F74: + ldrb r0, [r4, 0xC] + ldrb r1, [r4, 0xA] + bl sub_817603C + lsls r0, 24 + cmp r0, 0 + beq _08175F8A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0817602A +_08175F8A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r3, 0xA + ldrsh r1, [r4, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0x22 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _08175FB0 + movs r0, 0xC0 + lsls r0, 2 + ldr r1, _08175FAC + b _08175FB6 + .align 2, 0 +_08175FAC: .4byte 0x0000328d +_08175FB0: + movs r0, 0xC0 + lsls r0, 2 + ldr r1, _08175FC4 +_08175FB6: + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + b _0817602A + .align 2, 0 +_08175FC4: .4byte 0x00001967 +_08175FC8: + ldr r0, _08175FF4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817602A + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, _08175FF8 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + b _0817602A + .align 2, 0 +_08175FF4: .4byte 0x02037fd4 +_08175FF8: .4byte 0x03005e00 +_08175FFC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r2, 0xA + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r5, 0 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r4, 0 + bl remove_task + bl sub_81755A4 + ldr r4, _08176038 + ldr r0, [r4] + bl free + str r5, [r4] +_0817602A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08176038: .4byte 0x0203bce8 + thumb_func_end sub_8175DA0 + + thumb_func_start sub_817603C +sub_817603C: @ 817603C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + lsls r1, 24 + lsrs r2, r1, 24 + adds r5, r2, 0 + ldr r4, _081760F0 + cmp r3, 0x6 + bne _0817605C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_0817605C: + cmp r3, 0xC + bne _0817606E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x16] + strh r1, [r0, 0x1E] +_0817606E: + cmp r3, 0x12 + bne _0817607E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_0817607E: + cmp r3, 0x18 + bne _08176092 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_08176092: + cmp r3, 0x1E + bne _081760A2 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_081760A2: + cmp r3, 0x24 + bne _081760B6 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x3 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_081760B6: + cmp r3, 0x2A + bne _081760C6 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_081760C6: + cmp r6, 0x30 + bne _081760DA + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x4 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_081760DA: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r4 + movs r1, 0x1E + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081760F4 + movs r0, 0 + b _081760F6 + .align 2, 0 +_081760F0: .4byte 0x03005e00 +_081760F4: + movs r0, 0x1 +_081760F6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_817603C + + thumb_func_start sub_81760FC +sub_81760FC: @ 81760FC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08176128 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _0817612C + cmp r0, 0x1 + bgt _0817611A + b _08176244 +_0817611A: + cmp r0, 0x2 + beq _08176158 + cmp r0, 0x3 + bne _08176124 + b _08176230 +_08176124: + b _08176244 + .align 2, 0 +_08176128: .4byte 0x03005e00 +_0817612C: + ldr r0, _08176154 + ldr r0, [r0] + adds r0, 0x90 + ldrh r0, [r0] + cmp r0, 0 + bne _0817614E + movs r3, 0xA + ldrsh r0, [r2, r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0817614E + b _08176244 +_0817614E: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + b _08176242 + .align 2, 0 +_08176154: .4byte 0x0203bce8 +_08176158: + ldr r6, _081761C8 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x8E + ldrh r0, [r0] + cmp r0, 0x47 + beq _08176244 + movs r0, 0xA + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, [r0] + ldr r0, _081761CC + cmp r1, r0 + bne _08176244 + adds r0, r3, 0 + adds r0, 0x92 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r3, r0 + ldrh r0, [r0] + ldr r4, _081761D0 + adds r1, r3, 0 + adds r1, 0x90 + ldrh r3, [r1] + lsls r2, r3, 1 + adds r1, r2, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r4 + ldrb r2, [r2] + bl sub_8177224 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x92 + ldrh r3, [r1] + adds r0, 0x94 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bge _081761D8 + adds r0, r3, 0x1 + strh r0, [r1] + ldr r1, _081761D4 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x32 + b _081761EA + .align 2, 0 +_081761C8: .4byte 0x0203bce8 +_081761CC: .4byte sub_8175774 + 1 +_081761D0: .4byte 0x085e6f7c +_081761D4: .4byte 0x02020630 +_081761D8: + movs r0, 0 + strh r0, [r1] + ldr r1, _08176208 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x80 + lsls r1, 2 +_081761EA: + strh r1, [r0, 0x34] + ldr r0, _0817620C + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x8E + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrh r0, [r1] + cmp r0, 0x2 + bne _08176210 + movs r0, 0 + b _08176212 + .align 2, 0 +_08176208: .4byte 0x02020630 +_0817620C: .4byte 0x0203bce8 +_08176210: + adds r0, 0x1 +_08176212: + strh r0, [r1] + ldr r0, _0817622C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x32 + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08176244 + .align 2, 0 +_0817622C: .4byte 0x03005e00 +_08176230: + ldrh r1, [r2, 0xE] + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08176240 + subs r0, r1, 0x1 + strh r0, [r2, 0xE] + b _08176244 +_08176240: + movs r0, 0x1 +_08176242: + strh r0, [r2, 0x8] +_08176244: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81760FC + + thumb_func_start sub_817624C +sub_817624C: @ 817624C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08176274 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0x32 + bls _08176268 + b _08176514 +_08176268: + lsls r0, 2 + ldr r1, _08176278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08176274: .4byte 0x03005e00 +_08176278: .4byte _0817627C + .align 2, 0 +_0817627C: + .4byte _08176348 + .4byte _0817636C + .4byte _081763C0 + .4byte _081763D8 + .4byte _08176414 + .4byte _08176438 + .4byte _08176484 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176490 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _081764B0 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _081764D4 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176508 +_08176348: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldrh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 17 + movs r1, 0x7F + ands r0, r1 + movs r1, 0xC + bl sine + ldr r1, _08176368 + strh r0, [r1] + b _08176390 + .align 2, 0 +_08176368: .4byte 0x0203bd26 +_0817636C: + ldr r7, _08176398 + movs r3, 0 + ldrsh r4, [r7, r3] + cmp r4, 0 + beq _0817639C + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldrh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 17 + movs r1, 0x7F + ands r0, r1 + movs r1, 0xC + bl sine + strh r0, [r7] +_08176390: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + b _08176514 + .align 2, 0 +_08176398: .4byte 0x0203bd26 +_0817639C: + ldr r3, _081763BC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xC + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + strh r2, [r0, 0x2E] + strh r4, [r1, 0x12] + b _08176430 + .align 2, 0 +_081763BC: .4byte 0x02020630 +_081763C0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r6 + ldrh r2, [r1, 0x12] + movs r3, 0x12 + ldrsh r0, [r1, r3] + cmp r0, 0x3F + bgt _08176430 + adds r0, r2, 0x1 + strh r0, [r1, 0x12] + b _0817644E +_081763D8: + ldr r3, _08176410 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r6 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x3 + strh r1, [r0, 0x2E] + movs r0, 0xE + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + strh r1, [r0, 0x2E] + movs r0, 0x78 + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _08176514 + .align 2, 0 +_08176410: .4byte 0x02020630 +_08176414: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r6 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0817642C + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + b _08176514 +_0817642C: + movs r0, 0x40 + strh r0, [r1, 0x12] +_08176430: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08176514 +_08176438: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08176464 + subs r0, r1, 0x1 + strh r0, [r4, 0x12] +_0817644E: + movs r1, 0x7F + ands r0, r1 + movs r1, 0x14 + bl sine + ldr r1, _08176460 + strh r0, [r1] + b _08176514 + .align 2, 0 +_08176460: .4byte 0x0203bd26 +_08176464: + ldr r2, _08176480 + movs r3, 0xC + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08176514 + .align 2, 0 +_08176480: .4byte 0x02020630 +_08176484: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0x32 + b _08176512 +_08176490: + ldr r3, _081764AC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xE + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + b _081764C8 + .align 2, 0 +_081764AC: .4byte 0x02020630 +_081764B0: + ldr r3, _081764D0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xC + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x4 +_081764C8: + strh r2, [r0, 0x2E] + movs r0, 0x32 + strh r0, [r1, 0x8] + b _08176514 + .align 2, 0 +_081764D0: .4byte 0x02020630 +_081764D4: + ldr r3, _08176504 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r6 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x5 + strh r1, [r0, 0x2E] + movs r0, 0xE + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x3 + strh r1, [r0, 0x2E] + movs r0, 0x32 + strh r0, [r2, 0x8] + b _08176514 + .align 2, 0 +_08176504: .4byte 0x02020630 +_08176508: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0 +_08176512: + strh r1, [r0, 0x8] +_08176514: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_817624C + + thumb_func_start sub_817651C +sub_817651C: @ 817651C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _08176540 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r0, [r0, r3] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0817655C + lsls r0, 2 + ldr r1, _08176544 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08176540: .4byte 0x03005e00 +_08176544: .4byte _08176548 + .align 2, 0 +_08176548: + .4byte _0817655C + .4byte _081765A0 + .4byte _081765AC + .4byte _081765F4 + .4byte _08176640 +_0817655C: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0xA + ldrsh r0, [r2, r1] + ldr r5, _081765A8 + cmp r0, r5 + beq _081765A0 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r4 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0x2 + bne _081765A0 + movs r1, 0xA + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x14 + strh r0, [r1, 0x8] + strh r5, [r2, 0xA] +_081765A0: + movs r0, 0 + bl sub_817B540 + b _08176646 + .align 2, 0 +_081765A8: .4byte 0x00007fff +_081765AC: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + movs r3, 0xA + ldrsh r0, [r2, r3] + ldr r5, _081765F0 + cmp r0, r5 + beq _08176638 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r4 + ldrh r1, [r3, 0x12] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + movs r1, 0xA0 + lsls r1, 2 + cmp r0, r1 + bne _08176638 + movs r0, 0x1 + strh r0, [r3, 0x8] + strh r5, [r2, 0xA] + b _08176638 + .align 2, 0 +_081765F0: .4byte 0x00007fff +_081765F4: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + ldrh r3, [r2, 0xA] + movs r0, 0xA + ldrsh r1, [r2, r0] + ldr r5, _08176630 + cmp r1, r5 + beq _08176638 + movs r0, 0x92 + lsls r0, 2 + cmp r1, r0 + bne _08176634 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xA + strh r1, [r0, 0x8] + strh r5, [r2, 0xA] + b _08176638 + .align 2, 0 +_08176630: .4byte 0x00007fff +_08176634: + adds r0, r3, 0x1 + strh r0, [r2, 0xA] +_08176638: + movs r0, 0x1 + bl sub_817B540 + b _08176646 +_08176640: + movs r0, 0x2 + bl sub_817B540 +_08176646: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817651C + + thumb_func_start sub_817664C +sub_817664C: @ 817664C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r0, 0x4 + bls _08176662 + b _081769E0 +_08176662: + lsls r0, 2 + ldr r1, _0817666C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817666C: .4byte _08176670 + .align 2, 0 +_08176670: + .4byte _08176684 + .4byte _0817672C + .4byte _081767D8 + .4byte _08176884 + .4byte _08176934 +_08176684: + ldr r5, _08176724 + ldr r0, _08176728 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r2, 0x88 + lsls r2, 1 + strh r2, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0x20 + b _081769D4 + .align 2, 0 +_08176724: .4byte 0x02020630 +_08176728: .4byte 0x03005e00 +_0817672C: + ldr r5, _081767D0 + ldr r0, _081767D4 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0x20 + b _081769D4 + .align 2, 0 +_081767D0: .4byte 0x02020630 +_081767D4: .4byte 0x03005e00 +_081767D8: + ldr r5, _0817687C + ldr r0, _08176880 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + b _081769D4 + .align 2, 0 +_0817687C: .4byte 0x02020630 +_08176880: .4byte 0x03005e00 +_08176884: + ldr r5, _08176928 + ldr r0, _0817692C + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08176930 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + b _081769D4 + .align 2, 0 +_08176928: .4byte 0x02020630 +_0817692C: .4byte 0x03005e00 +_08176930: .4byte 0x0000ffe0 +_08176934: + ldr r5, _08176AA0 + ldr r0, _08176AA4 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x58 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x98 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x2 +_081769D4: + movs r3, 0x8 + bl sub_817B3DC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] +_081769E0: + ldr r0, _08176AA8 + movs r1, 0 + bl AddTask + ldr r6, _08176AA4 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r5, r1, r6 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + strh r0, [r5, 0xC] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x8] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0xA] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r7, [r0, 0xC] + ldr r0, _08176AAC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0x8] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r7, [r0, 0xA] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrh r1, [r5, 0x12] + strh r1, [r0, 0xC] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrh r1, [r5, 0x14] + strh r1, [r0, 0xE] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0x10] + mov r1, r8 + cmp r1, 0x2 + bne _08176A94 + movs r1, 0xA + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + movs r0, 0x45 + strh r0, [r1, 0x12] +_08176A94: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08176AA0: .4byte 0x02020630 +_08176AA4: .4byte 0x03005e00 +_08176AA8: .4byte sub_817651C + 1 +_08176AAC: .4byte sub_817624C + 1 + thumb_func_end sub_817664C + + thumb_func_start sub_8176AB0 +sub_8176AB0: @ 8176AB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _08176B2C + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r0, [r6] + cmp r0, 0x1 + beq _08176B30 + cmp r0, 0x1 + ble _08176AD6 + cmp r0, 0x2 + beq _08176B54 + cmp r0, 0x3 + bne _08176AD6 + b _08176C80 +_08176AD6: + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0x8 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0x1 + strb r0, [r6] + b _08176C96 + .align 2, 0 +_08176B2C: .4byte 0x030022c0 +_08176B30: + ldr r1, _08176B4C + movs r0, 0x22 + strh r0, [r1] + ldr r1, _08176B50 + movs r0, 0 + strh r0, [r1] + adds r0, r4, 0 + bl sub_817B1C8 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08176C96 + .align 2, 0 +_08176B4C: .4byte 0x0203bd24 +_08176B50: .4byte 0x0203bd26 +_08176B54: + ldr r0, _08176BB4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08176BD8 + ldr r0, _08176BB8 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08176BBC + bl gpu_tile_obj_decompress_and_load + ldr r0, _08176BC0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08176BC4 + bl gpu_pal_obj_alloc_and_load_multiple + movs r0, 0x78 + movs r1, 0x2E + bl sub_817B834 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08176BC8 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, _08176BCC + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r2, r0, r5 + ldr r1, _08176BD0 + str r1, [r2] + adds r6, 0x8 + adds r0, r6 + ldr r1, _08176BD4 + str r1, [r0] + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x2E + bl sub_817B88C + b _08176C2C + .align 2, 0 +_08176BB4: .4byte 0x03005d90 +_08176BB8: .4byte 0x085f5334 +_08176BBC: .4byte 0x085f53bc +_08176BC0: .4byte 0x085f5354 +_08176BC4: .4byte 0x085f5384 +_08176BC8: .4byte 0x03005e00 +_08176BCC: .4byte 0x02020630 +_08176BD0: .4byte sub_8176EE8 + 1 +_08176BD4: .4byte 0x085e6fd0 +_08176BD8: + ldr r0, _08176C54 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08176C58 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08176C5C + bl gpu_tile_obj_decompress_and_load + ldr r0, _08176C60 + bl gpu_pal_obj_alloc_and_load_multiple + movs r0, 0x78 + movs r1, 0x2E + bl sub_817B88C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08176C64 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, _08176C68 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r2, r0, r5 + ldr r1, _08176C6C + str r1, [r2] + adds r6, 0x8 + adds r0, r6 + ldr r1, _08176C70 + str r1, [r0] + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x2E + bl sub_817B834 +_08176C2C: + lsls r0, 24 + lsrs r2, r0, 24 + strh r2, [r4, 0x14] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r5 + ldr r1, _08176C74 + str r1, [r5] + adds r0, r6 + ldr r1, _08176C78 + str r1, [r0] + ldr r1, _08176C7C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08176C96 + .align 2, 0 +_08176C54: .4byte 0x085f5344 +_08176C58: .4byte 0x085f53ac +_08176C5C: .4byte 0x085f5354 +_08176C60: .4byte 0x085f5384 +_08176C64: .4byte 0x03005e00 +_08176C68: .4byte 0x02020630 +_08176C6C: .4byte sub_8176EE8 + 1 +_08176C70: .4byte 0x085e6fd0 +_08176C74: .4byte sub_8176F90 + 1 +_08176C78: .4byte 0x085e7010 +_08176C7C: .4byte 0x030022c0 +_08176C80: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_817664C + adds r0, r4, 0 + bl sub_817B3A8 + movs r0, 0 + strb r0, [r6] + movs r0, 0x1 + b _08176C98 +_08176C96: + movs r0, 0 +_08176C98: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8176AB0 + + thumb_func_start sub_8176CA0 +sub_8176CA0: @ 8176CA0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08176D14 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CC6 + lsls r0, r1, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + strh r0, [r4, 0x8] +_08176CC6: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CDC + lsls r0, r1, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + strh r0, [r4, 0xA] +_08176CDC: + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CF2 + lsls r0, r1, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + strh r0, [r4, 0xC] +_08176CF2: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176D08 + lsls r0, r1, 24 + lsrs r0, 24 + bl remove_task + movs r0, 0 + strh r0, [r4, 0xE] +_08176D08: + ldr r1, _08176D18 + movs r0, 0x1 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08176D14: .4byte 0x03005e00 +_08176D18: .4byte 0x0203bd28 + thumb_func_end sub_8176CA0 + + thumb_func_start sub_8176D1C +sub_8176D1C: @ 8176D1C + push {r4-r7,lr} + adds r3, r0, 0 + adds r4, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r4, 16 + lsrs r5, r4, 16 + ldr r0, _08176D6C + movs r6, 0xC0 + lsls r6, 19 + adds r3, r6 + adds r1, r3, 0 + bl LZ77UnCompVram + ldr r0, _08176D70 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + lsrs r4, 20 + lsls r4, 28 + lsrs r4, 16 + movs r1, 0 + adds r4, 0x1 + ldr r2, _08176D74 +_08176D52: + lsls r0, r1, 1 + adds r0, r7 + adds r0, r6 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _08176D52 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08176D6C: .4byte 0x085e5770 +_08176D70: .4byte 0x08dc3d54 +_08176D74: .4byte 0x000003ff + thumb_func_end sub_8176D1C + + thumb_func_start sub_8176D78 +sub_8176D78: @ 8176D78 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + movs r0, 0x3F + ands r0, r2 + adds r1, r0, 0 + adds r1, 0x50 + cmp r2, 0xFF + bne _08176D90 + movs r0, 0x1 + b _08176DB6 +_08176D90: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08176DA0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08176DA0: + movs r0, 0x40 + ands r3, r0 + cmp r3, 0 + beq _08176DB4 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r0, r1, 16 + lsrs r1, r0, 16 +_08176DB4: + adds r0, r1, 0 +_08176DB6: + pop {r1} + bx r1 + thumb_func_end sub_8176D78 + + thumb_func_start sub_8176DBC +sub_8176DBC: @ 8176DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp] + ldr r0, [sp, 0x2C] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x8] + lsls r0, 16 + lsrs r0, 20 + lsls r0, 28 + lsrs r0, 16 + mov r9, r0 + movs r5, 0 +_08176DEA: + movs r4, 0 + lsls r7, r5, 1 + ldr r1, [sp, 0x4] + adds r0, r1, r5 + adds r2, r5, 0x1 + mov r8, r2 + lsls r0, 6 + ldr r1, [sp, 0x8] + adds r6, r0, r1 +_08176DFC: + adds r0, r7, r5 + adds r0, r4 + ldr r2, [sp] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_8176D78 + mov r2, r10 + adds r1, r2, r4 + lsls r1, 1 + adds r1, r6 + movs r2, 0xC0 + lsls r2, 19 + adds r1, r2 + add r0, r9 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08176DFC + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08176DEA + 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_8176DBC + + thumb_func_start sub_8176E40 +sub_8176E40: @ 8176E40 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsrs r1, 20 + lsls r1, 28 + lsrs r1, 16 + movs r2, 0 + ldr r7, _08176ED0 + movs r4, 0xC0 + lsls r4, 19 + adds r1, 0x1 + ldr r3, _08176ED4 +_08176E5E: + lsls r0, r2, 1 + adds r0, r5 + adds r0, r4 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08176E5E + str r6, [sp] + adds r0, r7, 0 + movs r1, 0x3 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, _08176ED8 + str r6, [sp] + movs r1, 0x7 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r4, _08176EDC + str r6, [sp] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + str r6, [sp] + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, _08176EE0 + str r6, [sp] + movs r1, 0x14 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, _08176EE4 + str r6, [sp] + movs r1, 0x18 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08176ED0: .4byte 0x085e5bac +_08176ED4: .4byte 0x000003ff +_08176ED8: .4byte 0x085e5bbb +_08176EDC: .4byte 0x085e5bca +_08176EE0: .4byte 0x085e5bd9 +_08176EE4: .4byte 0x085e5be8 + thumb_func_end sub_8176E40 + + thumb_func_start sub_8176EE8 +sub_8176EE8: @ 8176EE8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08176F00 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08176F04 + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _08176F88 + .align 2, 0 +_08176F00: .4byte 0x0203bd28 +_08176F04: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bhi _08176F88 + lsls r0, 2 + ldr r1, _08176F18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08176F18: .4byte _08176F1C + .align 2, 0 +_08176F1C: + .4byte _08176F34 + .4byte _08176F3E + .4byte _08176F44 + .4byte _08176F4E + .4byte _08176F58 + .4byte _08176F6E +_08176F34: + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + b _08176F88 +_08176F3E: + adds r0, r4, 0 + movs r1, 0x1 + b _08176F72 +_08176F44: + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start_if_different + b _08176F88 +_08176F4E: + adds r0, r4, 0 + movs r1, 0x3 + bl obj_anim_image_start_if_different + b _08176F88 +_08176F58: + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + ble _08176F88 + subs r0, r1, 0x1 + b _08176F86 +_08176F6E: + adds r0, r4, 0 + movs r1, 0 +_08176F72: + bl obj_anim_image_start_if_different + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08176F88 + subs r0, r2, 0x1 +_08176F86: + strh r0, [r4, 0x20] +_08176F88: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8176EE8 + + thumb_func_start sub_8176F90 +sub_8176F90: @ 8176F90 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08176FA8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08176FAC + adds r0, r4, 0 + bl obj_delete_and_free_tiles + b _08177048 + .align 2, 0 +_08176FA8: .4byte 0x0203bd28 +_08176FAC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08176FD4 + cmp r0, 0x1 + bgt _08176FBE + cmp r0, 0 + beq _08176FC8 + b _08177048 +_08176FBE: + cmp r0, 0x2 + beq _08177010 + cmp r0, 0x3 + beq _0817702E + b _08177048 +_08176FC8: + strh r0, [r4, 0x26] + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + b _08177048 +_08176FD4: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0xC8 + ble _08176FE6 + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start_if_different + b _08176FEE +_08176FE6: + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start_if_different +_08176FEE: + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08177000 + subs r0, r2, 0x2 + strh r0, [r4, 0x20] +_08177000: + ldr r0, _0817700C + ldrh r0, [r0] + negs r0, r0 + strh r0, [r4, 0x26] + b _08177048 + .align 2, 0 +_0817700C: .4byte 0x0203bd26 +_08177010: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + ldrh r1, [r4, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08177048 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _08177046 +_0817702E: + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start_if_different + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08177048 + subs r0, r2, 0x1 +_08177046: + strh r0, [r4, 0x20] +_08177048: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8176F90 + + thumb_func_start sub_8177050 +sub_8177050: @ 8177050 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, _08177068 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0817706C + ldrh r0, [r5, 0x3A] + bl sub_818D820 + b _0817721C + .align 2, 0 +_08177068: .4byte 0x0203bd28 +_0817706C: + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0xA + bhi _081770B4 + lsls r0, 2 + ldr r1, _08177084 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08177084: .4byte _08177088 + .align 2, 0 +_08177088: + .4byte _081770B4 + .4byte _0817710E + .4byte _08177190 + .4byte _081771C6 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081771FE + .4byte _08177206 +_081770B4: + ldrb r1, [r5, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x30 + ldrsh r1, [r5, r0] + 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] + movs r0, 0x10 + strh r0, [r5, 0x32] + ldrh r4, [r5, 0x30] + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 9 + movs r1, 0x10 + bl __divsi3 + adds r1, r0, 0 + str r1, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r5, 0x2E] + b _0817721C +_0817710E: + ldrh r1, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0xFF + bgt _08177144 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r5, 0x32] + ldrh r4, [r5, 0x30] + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x32 + ldrsh r1, [r5, r0] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + b _0817714A +_08177144: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0817714A: + movs r2, 0x30 + ldrsh r1, [r5, r2] + cmp r1, 0x2 + beq _0817721C + cmp r1, 0x2 + bgt _0817715C + cmp r1, 0x1 + beq _08177162 + b _0817721C +_0817715C: + cmp r1, 0x3 + beq _0817717A + b _0817721C +_08177162: + ldrh r1, [r5, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08177172 + ldrh r0, [r5, 0x22] + adds r0, 0x1 + strh r0, [r5, 0x22] +_08177172: + ldrh r0, [r5, 0x20] + subs r0, 0x2 + strh r0, [r5, 0x20] + b _0817721C +_0817717A: + ldrh r0, [r5, 0x3C] + ands r1, r0 + cmp r1, 0 + bne _08177188 + ldrh r0, [r5, 0x22] + adds r0, 0x1 + strh r0, [r5, 0x22] +_08177188: + ldrh r0, [r5, 0x20] + adds r0, 0x2 + strh r0, [r5, 0x20] + b _0817721C +_08177190: + ldrh r1, [r5, 0x34] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _081771A0 + subs r0, r1, 0x1 + strh r0, [r5, 0x34] + b _0817721C +_081771A0: + movs r1, 0xF4 + lsls r1, 4 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x10 + strh r0, [r5, 0x34] + b _081771FE +_081771C6: + ldrh r1, [r5, 0x34] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _081771EC + subs r1, 0x1 + strh r1, [r5, 0x34] + movs r0, 0x34 + ldrsh r2, [r5, r0] + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl lcd_io_set + b _0817721C +_081771EC: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x9 + strh r0, [r5, 0x2E] + b _0817721C +_081771FE: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0817721C +_08177206: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + ldrh r0, [r5, 0x3A] + bl sub_818D820 +_0817721C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8177050 + + thumb_func_start sub_8177224 +sub_8177224: @ 8177224 + push {r4-r7,lr} + adds r5, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r3, r5, 0 + bl sub_80C0E9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _081772AC + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r2, r1, r6 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r2, 0x5] + adds r0, r5, 0x1 + strh r0, [r2, 0x30] + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r0, [r0] + orrs r0, r3 + mov r3, r12 + strb r0, [r3] + adds r0, r6, 0 + adds r0, 0x1C + adds r1, r0 + ldr r0, _081772B0 + str r0, [r1] + strh r4, [r2, 0x3A] + ldr r0, _081772B4 + movs r7, 0x20 + ldrsh r1, [r2, r7] + movs r3, 0x22 + ldrsh r2, [r2, r3] + movs r3, 0x1 + bl obj_add_from_template_forward_search + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r4, [r0, 0x2E] + lsls r5, 24 + lsrs r5, 24 + adds r1, r5, 0 + bl obj_anim_image_start_if_different + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081772AC: .4byte 0x02020630 +_081772B0: .4byte sub_8177050 + 1 +_081772B4: .4byte 0x085e7068 + thumb_func_end sub_8177224 + + thumb_func_start sub_81772B8 +sub_81772B8: @ 81772B8 + push {r4,lr} + adds r3, r0, 0 + ldr r4, _081772E4 + movs r1, 0x2E + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0xA + beq _081772DC + ldr r0, _081772E8 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _081772EC +_081772DC: + adds r0, r3, 0 + bl obj_delete_and_free_tiles + b _08177380 + .align 2, 0 +_081772E4: .4byte 0x02020630 +_081772E8: .4byte 0x0203bd28 +_081772EC: + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + movs r1, 0x4 + ands r1, r0 + mov r0, r12 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r0, 0xC + ands r0, r1 + ldrb r2, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r2, 0x4 + negs r2, r2 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + movs r1, 0x3E + ands r1, r0 + ldrb r2, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r3, 0x20] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r3, 0x22] +_08177380: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81772B8 + + thumb_func_start sub_8177388 +sub_8177388: @ 8177388 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _08177420 + bl var_get + lsls r0, 16 + lsrs r0, 16 + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r4, 0x1 + movs r6, 0 + ldr r5, _08177424 +_081773B4: + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081773D4 + ldr r0, _08177428 + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0x96 + adds r0, r1 + strh r4, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_081773D4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bls _081773B4 + adds r4, r6, 0 + ldr r0, _08177424 + ldr r1, _08177428 + mov r8, r1 + lsls r7, r4, 16 + cmp r4, r0 + bhi _08177406 + mov r5, r8 + movs r3, 0 + adds r2, r0, 0 +_081773F2: + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, 0x96 + adds r0, r1 + strh r3, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r2 + bls _081773F2 +_08177406: + mov r2, r8 + ldr r1, [r2] + ldr r2, _0817742C + adds r0, r1, r2 + strh r6, [r0] + lsrs r0, r7, 16 + cmp r0, 0x46 + bhi _08177430 + adds r0, r1, 0 + adds r0, 0x94 + strh r6, [r0] + b _08177436 + .align 2, 0 +_08177420: .4byte 0x00004023 +_08177424: .4byte 0x00000181 +_08177428: .4byte 0x0203bce8 +_0817742C: .4byte 0x0000039a +_08177430: + adds r1, 0x94 + movs r0, 0x47 + strh r0, [r1] +_08177436: + movs r6, 0 + ldr r0, _08177444 + mov r9, r0 + ldr r1, _08177448 + mov r8, r1 + movs r7, 0 + b _08177450 + .align 2, 0 +_08177444: .4byte 0x0203bce8 +_08177448: .4byte 0x0000039a +_0817744C: + cmp r6, 0x46 + bhi _081774AC +_08177450: + bl GenerateRandomNumber + mov r2, r9 + ldr r4, [r2] + mov r1, r8 + adds r5, r4, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r5] + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, r6, 1 + adds r1, r4, r1 + lsls r0, r3, 1 + adds r4, 0x96 + adds r2, r4, r0 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + strh r7, [r2] + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] + lsls r0, 16 + lsrs r0, 16 + cmp r3, r0 + beq _081774A0 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r2] + ldrh r0, [r5] + lsls r0, 1 + adds r0, r4, r0 + strh r7, [r0] +_081774A0: + mov r2, r9 + ldr r0, [r2] + add r0, r8 + ldrh r0, [r0] + cmp r0, 0 + bne _0817744C +_081774AC: + ldr r1, _081774F4 + ldr r2, [r1] + adds r3, r2, 0 + adds r3, 0x94 + ldrh r0, [r3] + mov r8, r1 + cmp r0, 0x46 + bhi _081774F8 + adds r6, r0, 0 + movs r3, 0 + cmp r6, 0x46 + bhi _081774EE + mov r4, r8 +_081774C6: + ldr r2, [r4] + lsls r1, r6, 1 + adds r1, r2, r1 + lsls r0, r3, 1 + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r2, 0x94 + ldrh r2, [r2] + cmp r3, r2 + bne _081774E4 + movs r3, 0 +_081774E4: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x46 + bls _081774C6 +_081774EE: + mov r1, r8 + ldr r0, [r1] + b _08177538 + .align 2, 0 +_081774F4: .4byte 0x0203bce8 +_081774F8: + movs r4, 0 + ldrh r0, [r2] + cmp r0, r10 + beq _08177516 + adds r1, r2, 0 +_08177502: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 1 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r10 + beq _08177516 + cmp r4, 0x46 + bls _08177502 +_08177516: + mov r0, r8 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x94 + ldrh r0, [r0] + subs r0, 0x1 + cmp r4, r0 + bge _08177536 + lsls r0, r4, 1 + adds r0, r2, r0 + adds r2, 0x8C + ldrh r1, [r2] + strh r1, [r0] + mov r1, r10 + strh r1, [r2] + b _0817753E +_08177536: + adds r0, r2, 0 +_08177538: + adds r0, 0x8C + mov r2, r10 + strh r2, [r0] +_0817753E: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x94 + movs r1, 0x47 + strh r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8177388 + + thumb_func_start sub_8177558 +sub_8177558: @ 8177558 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + orrs r0, r4 + bl sub_8177814 + ldr r0, _08177580 + movs r1, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177580: .4byte 0x00004045 + thumb_func_end sub_8177558 + + thumb_func_start sub_8177584 +sub_8177584: @ 8177584 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r1, r0, 16 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _081775C0 + cmp r4, r0 + beq _081775B4 + ldr r5, _081775C4 + ldr r3, _081775C8 + adds r2, r0, 0 +_081775A4: + adds r0, r1, 0 + muls r0, r5 + adds r1, r0, r3 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r2 + bne _081775A4 +_081775B4: + adds r0, r1, 0 + bl sub_8177814 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081775C0: .4byte 0x0000ffff +_081775C4: .4byte 0x41c64e6d +_081775C8: .4byte 0x00003039 + thumb_func_end sub_8177584 + + thumb_func_start sub_81775CC +sub_81775CC: @ 81775CC + push {lr} + bl sub_817783C + ldr r1, _081775DC + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081775DC: .4byte 0x020375f0 + thumb_func_end sub_81775CC + + thumb_func_start sub_81775E0 +sub_81775E0: @ 81775E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r1, _0817771C + movs r0, 0 + strh r0, [r1] + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0 + str r1, [sp] + movs r7, 0 +_081775FC: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _08177720 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _08177658 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0817764E + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r1, r0, 0 + ldr r0, _08177724 + ldrh r0, [r0] + lsls r1, 16 + lsrs r1, 16 + bl sub_817778C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0817771C + ldrh r2, [r1] + cmp r0, r2 + bls _0817764E + cmp r0, 0x1 + bls _0817764E + subs r0, 0x1 + strh r0, [r1] + movs r0, 0xE + str r0, [sp] + str r7, [sp, 0x4] +_0817764E: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bls _081775FC +_08177658: + movs r7, 0 + ldr r1, _08177728 + mov r9, r1 +_0817765E: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 + lsls r0, r7, 2 + adds r0, r7 + mov r8, r0 +_0817766A: + mov r1, r8 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r5, r0, 0x4 + mov r2, r9 + ldr r0, [r2] + adds r0, r5 + lsls r1, r6, 2 + adds r1, r6 + lsls r4, r1, 4 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _081776D2 + mov r1, r9 + ldr r0, [r1] + adds r0, r5 + adds r0, r4 + movs r1, 0x2D + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _081776D2 + mov r2, r9 + ldr r0, [r2] + adds r0, r5 + adds r0, r4 + movs r1, 0x1 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + ldr r0, _08177724 + ldrh r0, [r0] + lsls r1, 16 + lsrs r1, 16 + bl sub_817778C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0817771C + ldrh r2, [r1] + cmp r0, r2 + bls _081776D2 + cmp r0, 0x1 + bls _081776D2 + subs r0, 0x1 + strh r0, [r1] + str r7, [sp] + str r6, [sp, 0x4] +_081776D2: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1D + bls _0817766A + mov r1, r10 + lsls r0, r1, 16 + lsrs r7, r0, 16 + cmp r7, 0xD + bls _0817765E + ldr r3, _0817771C + ldrh r0, [r3] + cmp r0, 0 + beq _0817776E + ldr r2, _0817772C + ldr r1, _08177730 + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + ldr r2, [sp] + cmp r2, 0xE + bne _0817773C + ldr r1, _08177734 + movs r0, 0 + strh r0, [r1] + movs r0, 0x64 + ldr r1, [sp, 0x4] + muls r0, r1 + ldr r1, _08177720 + adds r0, r1 + ldr r2, _08177738 + movs r1, 0x2 + bl pokemon_getattr + b _08177768 + .align 2, 0 +_0817771C: .4byte 0x020375e0 +_08177720: .4byte 0x020244ec +_08177724: .4byte 0x020375f0 +_08177728: .4byte 0x03005d94 +_0817772C: .4byte 0x020375e2 +_08177730: .4byte 0x085e7080 +_08177734: .4byte 0x020375e4 +_08177738: .4byte 0x02021cc4 +_0817773C: + ldr r1, _08177780 + movs r0, 0x1 + strh r0, [r1] + ldr r2, _08177784 + ldr r1, [sp] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + ldr r2, [sp, 0x4] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + ldr r2, _08177788 + movs r1, 0x2 + bl pokemon_getattr_encrypted +_08177768: + ldr r0, _08177788 + bl get_end_of_string_ptr_limit_10_chars +_0817776E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08177780: .4byte 0x020375e4 +_08177784: .4byte 0x03005d94 +_08177788: .4byte 0x02021cc4 + thumb_func_end sub_81775E0 + + thumb_func_start sub_817778C +sub_817778C: @ 817778C + 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 r5, r1, 16 + movs r0, 0 + mov r8, r0 + movs r7, 0 + ldr r1, _0817780C + mov r10, r1 + ldr r0, _08177810 + mov r9, r0 +_081777AC: + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + mov r1, r10 + strh r4, [r1] + adds r0, r5, 0 + movs r1, 0xA + bl __umodsi3 + mov r1, r9 + strh r0, [r1] + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + bne _081777FA + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x4 + bls _081777AC +_081777FA: + mov r0, r8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0817780C: .4byte 0x0203bcec +_08177810: .4byte 0x0203bcee + thumb_func_end sub_817778C + + thumb_func_start sub_8177814 +sub_8177814: @ 8177814 + push {r4,lr} + adds r1, r0, 0 + lsrs r4, r1, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _08177834 + bl var_set + ldr r0, _08177838 + adds r1, r4, 0 + bl var_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177834: .4byte 0x0000404b +_08177838: .4byte 0x0000404c + thumb_func_end sub_8177814 + + thumb_func_start sub_817783C +sub_817783C: @ 817783C + push {r4,lr} + ldr r0, _0817785C + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _08177860 + bl var_get + lsls r0, 16 + orrs r0, r4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0817785C: .4byte 0x0000404b +_08177860: .4byte 0x0000404c + thumb_func_end sub_817783C + + thumb_func_start sub_8177864 +sub_8177864: @ 8177864 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_8177814 + pop {r0} + bx r0 + thumb_func_end sub_8177864 + + thumb_func_start sub_8177874 +sub_8177874: @ 8177874 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8177874 + + thumb_func_start sub_8177888 +sub_8177888: @ 8177888 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r1, _081779DC + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _081779E0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r5, 0 + str r5, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _081779E4 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0x4 + strh r5, [r0] + str r0, [r1] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _081779E8 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl remove_some_task + bl clear_tasks + bl reset_all_obj_data + bl sub_80A1A74 + bl gpu_pal_allocator_reset + ldr r0, _081779EC + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r4, _081779F0 + movs r0, 0x80 + lsls r0, 5 + bl malloc + str r0, [r4] + bl sub_8177B44 + bl sub_8177B9C + bl reset_temp_tile_data_buffers + ldr r1, _081779F4 + str r5, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_0817797C: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0817797C + ldr r0, _081779F8 + ldr r1, _081779F0 + ldr r1, [r1] + bl call_LZZUnCompWram + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + bl pokedex_diploma_something + 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 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _081779FC + bl SetVBlankCallback + ldr r0, _08177A00 + bl set_callback2 + ldr r0, _08177A04 + movs r1, 0 + bl AddTask + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081779DC: .4byte 0x040000d4 +_081779E0: .4byte 0x8100c000 +_081779E4: .4byte 0x85000100 +_081779E8: .4byte 0x81000200 +_081779EC: .4byte 0x085e7088 +_081779F0: .4byte 0x0203bcf0 +_081779F4: .4byte 0x085e7804 +_081779F8: .4byte 0x085e70c8 +_081779FC: .4byte sub_8177874 + 1 +_08177A00: .4byte sub_8177A08 + 1 +_08177A04: .4byte sub_8177A20 + 1 + thumb_func_end sub_8177888 + + thumb_func_start sub_8177A08 +sub_8177A08: @ 8177A08 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8177A08 + + thumb_func_start sub_8177A20 +sub_8177A20: @ 8177A20 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _08177A44 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08177A40 + ldr r0, _08177A48 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _08177A4C + str r0, [r1] +_08177A40: + pop {r0} + bx r0 + .align 2, 0 +_08177A44: .4byte 0x02037fd4 +_08177A48: .4byte 0x03005e00 +_08177A4C: .4byte sub_8177A50 + 1 + thumb_func_end sub_8177A20 + + thumb_func_start sub_8177A50 +sub_8177A50: @ 8177A50 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08177A8C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08177A82 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08177A90 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _08177A94 + str r1, [r0] +_08177A82: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177A8C: .4byte 0x030022c0 +_08177A90: .4byte 0x03005e00 +_08177A94: .4byte sub_8177A98 + 1 + thumb_func_end sub_8177A50 + + thumb_func_start sub_8177A98 +sub_8177A98: @ 8177A98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08177AC8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08177AC2 + ldr r0, _08177ACC + ldr r0, [r0] + bl free + bl Window_FreeMemory + adds r0, r4, 0 + bl remove_task + ldr r0, _08177AD0 + bl set_callback2 +_08177AC2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177AC8: .4byte 0x02037fd4 +_08177ACC: .4byte 0x0203bcf0 +_08177AD0: .4byte sub_80861E8 + 1 + thumb_func_end sub_8177A98 + + thumb_func_start pokedex_diploma_something +pokedex_diploma_something: @ 8177AD4 + push {r4,lr} + bl sub_80C0944 + lsls r0, 16 + cmp r0, 0 + beq _08177AFC + movs r1, 0x80 + lsls r1, 1 + movs r0, 0x14 + bl lcd_io_set + ldr r0, _08177AF4 + ldr r1, _08177AF8 + bl gf_strcpy + b _08177B0C + .align 2, 0 +_08177AF4: .4byte 0x02021cc4 +_08177AF8: .4byte 0x085ee855 +_08177AFC: + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + ldr r0, _08177B34 + ldr r1, _08177B38 + bl gf_strcpy +_08177B0C: + ldr r4, _08177B3C + ldr r1, _08177B40 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + bl sub_8177BCC + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177B34: .4byte 0x02021cc4 +_08177B38: .4byte 0x085ee84f +_08177B3C: .4byte 0x02021fc4 +_08177B40: .4byte 0x085ee85e + thumb_func_end pokedex_diploma_something + + thumb_func_start sub_8177B44 +sub_8177B44: @ 8177B44 + push {lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08177B94 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + ldr r0, _08177B98 + ldr r1, [r0] + movs r0, 0x1 + bl bg_set_tilemap + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08177B94: .4byte 0x085e81fc +_08177B98: .4byte 0x0203bcf0 + thumb_func_end sub_8177B44 + + thumb_func_start sub_8177B9C +sub_8177B9C: @ 8177B9C + push {lr} + ldr r0, _08177BC4 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r0, _08177BC8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + pop {r0} + bx r0 + .align 2, 0 +_08177BC4: .4byte 0x085e8204 +_08177BC8: .4byte 0x0860f074 + thumb_func_end sub_8177B9C + + thumb_func_start sub_8177BCC +sub_8177BCC: @ 8177BCC + push {r4-r6,lr} + sub sp, 0x18 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _08177C10 + add r0, sp, 0x14 + movs r2, 0x3 + bl memcpy + 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] + str r6, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8199EEC + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08177C10: .4byte 0x085e8214 + thumb_func_end sub_8177BCC + + thumb_func_start sub_8177C14 +sub_8177C14: @ 8177C14 + push {r4,lr} + ldr r4, _08177C44 + ldr r0, _08177C48 + bl malloc_and_clear + str r0, [r4] + ldr r0, _08177C4C + ldrh r0, [r0] + bl berryid_from_itemid + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xC0 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + ldr r0, _08177C50 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177C44: .4byte 0x0203bcf4 +_08177C48: .4byte 0x0000180c +_08177C4C: .4byte 0x0203ce7c +_08177C50: .4byte sub_8177C84 + 1 + thumb_func_end sub_8177C14 + + thumb_func_start sub_8177C54 +sub_8177C54: @ 8177C54 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8177C54 + + thumb_func_start sub_8177C70 +sub_8177C70: @ 8177C70 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8177C70 + + thumb_func_start sub_8177C84 +sub_8177C84: @ 8177C84 + push {lr} +_08177C86: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08177CAA + bl sub_8177CB0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08177CAA + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08177C86 +_08177CAA: + pop {r0} + bx r0 + thumb_func_end sub_8177C84 + + thumb_func_start sub_8177CB0 +sub_8177CB0: @ 8177CB0 + push {lr} + sub sp, 0x4 + ldr r0, _08177CD0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xF + bls _08177CC4 + b _08177DF4 +_08177CC4: + lsls r0, 2 + ldr r1, _08177CD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08177CD0: .4byte 0x030022c0 +_08177CD4: .4byte _08177CD8 + .align 2, 0 +_08177CD8: + .4byte _08177D18 + .4byte _08177D26 + .4byte _08177D2C + .4byte _08177D40 + .4byte _08177D46 + .4byte _08177D4C + .4byte _08177D5C + .4byte _08177D78 + .4byte _08177D84 + .4byte _08177D8A + .4byte _08177D90 + .4byte _08177D96 + .4byte _08177D9C + .4byte _08177DA6 + .4byte _08177DB4 + .4byte _08177DC2 +_08177D18: + bl vblank_hblank_handler_set_zero + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + b _08177DDC +_08177D26: + bl remove_some_task + b _08177DDC +_08177D2C: + bl sub_80A1A74 + ldr r2, _08177D3C + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _08177DDA + .align 2, 0 +_08177D3C: .4byte 0x02037fd4 +_08177D40: + bl reset_all_obj_data + b _08177DDC +_08177D46: + bl gpu_pal_allocator_reset + b _08177DDC +_08177D4C: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _08177DDC + bl clear_tasks + b _08177DDC +_08177D5C: + bl sub_8177E14 + ldr r0, _08177D70 + ldr r0, [r0] + ldr r1, _08177D74 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _08177DDC + .align 2, 0 +_08177D70: .4byte 0x0203bcf4 +_08177D74: .4byte 0x00001808 +_08177D78: + bl sub_8177E88 + lsls r0, 24 + cmp r0, 0 + beq _08177E0C + b _08177DDC +_08177D84: + bl sub_8178008 + b _08177DDC +_08177D8A: + bl sub_8178090 + b _08177DDC +_08177D90: + bl sub_81780F4 + b _08177DDC +_08177D96: + bl sub_8178338 + b _08177DDC +_08177D9C: + bl sub_817839C + bl sub_8178404 + b _08177DDC +_08177DA6: + ldr r0, _08177DB0 + movs r1, 0 + bl AddTask + b _08177DDC + .align 2, 0 +_08177DB0: .4byte sub_8178654 + 1 +_08177DB4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _08177DDC +_08177DC2: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _08177DEC + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_08177DDA: + strb r0, [r2, 0x8] +_08177DDC: + ldr r1, _08177DF0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08177E0C + .align 2, 0 +_08177DEC: .4byte 0x02037fd4 +_08177DF0: .4byte 0x030022c0 +_08177DF4: + ldr r0, _08177E04 + bl SetVBlankCallback + ldr r0, _08177E08 + bl set_callback2 + movs r0, 0x1 + b _08177E0E + .align 2, 0 +_08177E04: .4byte sub_8177C70 + 1 +_08177E08: .4byte sub_8177C54 + 1 +_08177E0C: + movs r0, 0 +_08177E0E: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8177CB0 + + thumb_func_start sub_8177E14 +sub_8177E14: @ 8177E14 + push {r4,lr} + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08177E80 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _08177E84 + ldr r1, [r4] + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + bl sub_8121E10 + 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 lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08177E80: .4byte 0x085efcf0 +_08177E84: .4byte 0x0203bcf4 + thumb_func_end sub_8177E14 + + thumb_func_start sub_8177E88 +sub_8177E88: @ 8177E88 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _08177EA8 + ldr r0, [r1] + ldr r2, _08177EAC + adds r0, r2 + ldrh r0, [r0] + adds r7, r1, 0 + cmp r0, 0x5 + bls _08177E9E + b _08177FEC +_08177E9E: + lsls r0, 2 + ldr r1, _08177EB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08177EA8: .4byte 0x0203bcf4 +_08177EAC: .4byte 0x00001808 +_08177EB0: .4byte _08177EB4 + .align 2, 0 +_08177EB4: + .4byte _08177ECC + .4byte _08177EF8 + .4byte _08177F1C + .4byte _08177F3C + .4byte _08177FA8 + .4byte _08177FC8 +_08177ECC: + bl reset_temp_tile_data_buffers + ldr r1, _08177EEC + 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, _08177EF0 + ldr r1, [r0] + ldr r0, _08177EF4 + adds r1, r0 + b _08177FD6 + .align 2, 0 +_08177EEC: .4byte 0x08d9bb44 +_08177EF0: .4byte 0x0203bcf4 +_08177EF4: .4byte 0x00001808 +_08177EF8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08177F06 + b _08177FFC +_08177F06: + ldr r0, _08177F14 + ldr r4, _08177F18 + ldr r1, [r4] + bl call_LZZUnCompWram + ldr r1, [r4] + b _08177FD2 + .align 2, 0 +_08177F14: .4byte 0x08d9bf98 +_08177F18: .4byte 0x0203bcf4 +_08177F1C: + ldr r0, _08177F34 + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + bl call_LZZUnCompWram + ldr r1, [r7] + ldr r0, _08177F38 + adds r1, r0 + b _08177FD6 + .align 2, 0 +_08177F34: .4byte 0x08d9c13c +_08177F38: .4byte 0x00001808 +_08177F3C: + ldr r0, _08177F68 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08177F78 + movs r2, 0 + ldr r6, _08177F6C + movs r5, 0x80 + lsls r5, 4 + ldr r4, _08177F70 + ldr r3, _08177F74 +_08177F52: + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08177F52 + b _08177F98 + .align 2, 0 +_08177F68: .4byte 0x03005d90 +_08177F6C: .4byte 0x0203bcf4 +_08177F70: .4byte 0x00004042 +_08177F74: .4byte 0x000003ff +_08177F78: + movs r2, 0 + ldr r6, _08177F9C + movs r5, 0x80 + lsls r5, 4 + ldr r4, _08177FA0 + ldr r3, _08177FA4 +_08177F84: + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08177F84 +_08177F98: + ldr r1, [r7] + b _08177FD2 + .align 2, 0 +_08177F9C: .4byte 0x0203bcf4 +_08177FA0: .4byte 0x00005042 +_08177FA4: .4byte 0x000003ff +_08177FA8: + ldr r0, _08177FBC + movs r1, 0 + movs r2, 0xC0 + bl decompress_palette + ldr r0, _08177FC0 + ldr r1, [r0] + ldr r0, _08177FC4 + adds r1, r0 + b _08177FD6 + .align 2, 0 +_08177FBC: .4byte 0x08d9bef0 +_08177FC0: .4byte 0x0203bcf4 +_08177FC4: .4byte 0x00001808 +_08177FC8: + ldr r0, _08177FE0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08177FE4 + ldr r1, [r0] +_08177FD2: + ldr r2, _08177FE8 + adds r1, r2 +_08177FD6: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08177FFC + .align 2, 0 +_08177FE0: .4byte 0x0857fdec +_08177FE4: .4byte 0x0203bcf4 +_08177FE8: .4byte 0x00001808 +_08177FEC: + ldr r0, _08177FF8 + bl gpu_pal_obj_decompress_and_apply + movs r0, 0x1 + b _08177FFE + .align 2, 0 +_08177FF8: .4byte 0x0857fdf4 +_08177FFC: + movs r0, 0 +_08177FFE: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8177E88 + + thumb_func_start sub_8178008 +sub_8178008: @ 8178008 + push {r4,lr} + ldr r0, _08178044 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r0, _08178048 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_08178020: + lsls r0, r4, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08178020 + 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 + .align 2, 0 +_08178044: .4byte 0x085efd28 +_08178048: .4byte 0x085efd00 + thumb_func_end sub_8178008 + + thumb_func_start sub_817804C +sub_817804C: @ 817804C + push {r4-r6,lr} + sub sp, 0x14 + ldr r6, [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 r5, 24 + lsrs r5, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, _0817808C + adds r4, r5 + str r4, [sp, 0x8] + lsls r6, 24 + asrs r6, 24 + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl sub_8199EEC + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817808C: .4byte 0x085efd20 + thumb_func_end sub_817804C + + thumb_func_start sub_8178090 +sub_8178090: @ 8178090 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl bg_get_tilemap + ldr r1, _081780EC + ldr r1, [r1] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + movs r2, 0x80 + lsls r2, 4 + bl memcpy + movs r0, 0x3 + movs r1, 0xFF + bl Window_FastFillPixels + ldr r4, _081780F0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl sub_81DB35C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x3 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_817804C + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081780EC: .4byte 0x0203bcf4 +_081780F0: .4byte 0x085e926b + thumb_func_end sub_8178090 + + thumb_func_start sub_81780F4 +sub_81780F4: @ 81780F4 + push {lr} + bl sub_8178110 + bl sub_8178174 + bl itemid_copy_name + bl sub_81782D0 + bl sub_8178304 + pop {r0} + bx r0 + thumb_func_end sub_81780F4 + + thumb_func_start sub_8178110 +sub_8178110: @ 8178110 + push {r4-r6,lr} + sub sp, 0x8 + ldr r5, _08178160 + ldr r0, [r5] + movs r4, 0xC0 + lsls r4, 5 + adds r0, r4 + ldrb r0, [r0] + bl sub_80E167C + adds r6, r0, 0 + ldr r0, _08178164 + ldr r1, [r5] + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _08178168 + adds r1, r6, 0 + bl gf_strcpy + ldr r4, _0817816C + ldr r1, _08178170 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_817804C + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08178160: .4byte 0x0203bcf4 +_08178164: .4byte 0x02021cc4 +_08178168: .4byte 0x02021dc4 +_0817816C: .4byte 0x02021fc4 +_08178170: .4byte 0x085e9263 + thumb_func_end sub_8178110 + + thumb_func_start sub_8178174 +sub_8178174: @ 8178174 + push {r4-r7,lr} + sub sp, 0xC + ldr r0, _08178218 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl sub_80E167C + adds r4, r0, 0 + ldr r2, _0817821C + movs r7, 0x1 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + ldrh r0, [r4, 0x8] + cmp r0, 0 + beq _08178230 + adds r1, r0, 0 + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + movs r1, 0xFE + bl __divsi3 + adds r5, r0, 0 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x4 + bls _081781C8 + adds r5, 0xA +_081781C8: + adds r0, r5, 0 + movs r1, 0x64 + bl __umodsi3 + movs r1, 0xA + bl __udivsi3 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x64 + bl __udivsi3 + adds r5, r0, 0 + ldr r0, _08178220 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _08178224 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _08178228 + ldr r1, _0817822C + adds r0, r4, 0 + bl ExpandTextCodes + str r7, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x28 + bl Print + b _08178242 + .align 2, 0 +_08178218: .4byte 0x0203bcf4 +_0817821C: .4byte 0x085e9225 +_08178220: .4byte 0x02021cc4 +_08178224: .4byte 0x02021dc4 +_08178228: .4byte 0x02021fc4 +_0817822C: .4byte 0x085e9233 +_08178230: + ldr r2, _0817824C + str r7, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x28 + bl Print +_08178242: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817824C: .4byte 0x085e8d34 + thumb_func_end sub_8178174 + + thumb_func_start itemid_copy_name +itemid_copy_name: @ 8178250 + push {r4-r6,lr} + sub sp, 0xC + ldr r0, _081782A4 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl sub_80E167C + adds r6, r0, 0 + ldr r2, _081782A8 + movs r5, 0x11 + str r5, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _081782B0 + ldr r0, _081782AC + ldrb r1, [r6, 0x7] + subs r1, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + str r5, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x28 + bl Print + b _081782C2 + .align 2, 0 +_081782A4: .4byte 0x0203bcf4 +_081782A8: .4byte 0x085e922c +_081782AC: .4byte 0x085efd50 +_081782B0: + ldr r2, _081782CC + str r5, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x28 + bl Print +_081782C2: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081782CC: .4byte 0x085e8d34 + thumb_func_end itemid_copy_name + + thumb_func_start sub_81782D0 +sub_81782D0: @ 81782D0 + push {lr} + sub sp, 0xC + ldr r0, _08178300 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl sub_80E167C + ldr r2, [r0, 0xC] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_08178300: .4byte 0x0203bcf4 + thumb_func_end sub_81782D0 + + thumb_func_start sub_8178304 +sub_8178304: @ 8178304 + push {lr} + sub sp, 0xC + ldr r0, _08178334 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl sub_80E167C + ldr r2, [r0, 0x10] + movs r0, 0x11 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_08178334: .4byte 0x0203bcf4 + thumb_func_end sub_8178304 + + thumb_func_start sub_8178338 +sub_8178338: @ 8178338 + push {r4,lr} + ldr r4, _08178364 + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x38 + movs r2, 0x40 + bl sub_80D50D4 + ldr r1, [r4] + ldr r2, _08178368 + adds r1, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08178364: .4byte 0x0203bcf4 +_08178368: .4byte 0x00001802 + thumb_func_end sub_8178338 + + thumb_func_start sub_817836C +sub_817836C: @ 817836C + push {lr} + ldr r0, _08178390 + ldr r0, [r0] + ldr r1, _08178394 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08178398 + adds r0, r1 + bl obj_delete_and_free_tiles + bl sub_80D510C + pop {r0} + bx r0 + .align 2, 0 +_08178390: .4byte 0x0203bcf4 +_08178394: .4byte 0x00001802 +_08178398: .4byte 0x02020630 + thumb_func_end sub_817836C + + thumb_func_start sub_817839C +sub_817839C: @ 817839C + push {r4,lr} + movs r0, 0x40 + bl sub_80D518C + ldr r4, _081783EC + ldr r1, [r4] + ldr r2, _081783F0 + adds r1, r2 + strb r0, [r1] + movs r0, 0x68 + bl sub_80D518C + ldr r1, [r4] + ldr r2, _081783F4 + adds r1, r2 + strb r0, [r1] + movs r0, 0x90 + bl sub_80D518C + ldr r1, [r4] + ldr r2, _081783F8 + adds r1, r2 + strb r0, [r1] + movs r0, 0xB8 + bl sub_80D518C + ldr r1, [r4] + ldr r2, _081783FC + adds r1, r2 + strb r0, [r1] + movs r0, 0xE0 + bl sub_80D518C + ldr r1, [r4] + ldr r2, _08178400 + adds r1, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081783EC: .4byte 0x0203bcf4 +_081783F0: .4byte 0x00001803 +_081783F4: .4byte 0x00001804 +_081783F8: .4byte 0x00001805 +_081783FC: .4byte 0x00001806 +_08178400: .4byte 0x00001807 + thumb_func_end sub_817839C + + thumb_func_start sub_8178404 +sub_8178404: @ 8178404 + push {r4,r5,lr} + ldr r4, _0817843C + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl sub_80E167C + adds r5, r0, 0 + ldrb r0, [r5, 0x15] + cmp r0, 0 + beq _08178448 + ldr r3, _08178440 + ldr r0, [r4] + ldr r1, _08178444 + adds r0, r1 + 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 + b _08178462 + .align 2, 0 +_0817843C: .4byte 0x0203bcf4 +_08178440: .4byte 0x02020630 +_08178444: .4byte 0x00001803 +_08178448: + ldr r3, _0817848C + ldr r0, [r4] + ldr r1, _08178490 + adds r0, r1 + 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 +_08178462: + strb r1, [r0] + adds r4, r3, 0 + ldrb r0, [r5, 0x16] + cmp r0, 0 + beq _0817849C + ldr r3, _08178494 + ldr r0, [r3] + ldr r1, _08178498 + adds r0, r1 + ldrb r1, [r0] + 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 + b _081784B6 + .align 2, 0 +_0817848C: .4byte 0x02020630 +_08178490: .4byte 0x00001803 +_08178494: .4byte 0x0203bcf4 +_08178498: .4byte 0x00001804 +_0817849C: + ldr r3, _081784DC + ldr r0, [r3] + ldr r1, _081784E0 + adds r0, r1 + ldrb r1, [r0] + 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 +_081784B6: + strb r1, [r0] + ldrb r0, [r5, 0x17] + cmp r0, 0 + beq _081784E8 + ldr r0, [r3] + ldr r1, _081784E4 + adds r0, r1 + ldrb r1, [r0] + 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 + b _08178500 + .align 2, 0 +_081784DC: .4byte 0x0203bcf4 +_081784E0: .4byte 0x00001804 +_081784E4: .4byte 0x00001805 +_081784E8: + ldr r0, [r3] + ldr r1, _08178524 + adds r0, r1 + ldrb r1, [r0] + 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 +_08178500: + strb r1, [r0] + ldrb r0, [r5, 0x18] + cmp r0, 0 + beq _0817852C + ldr r0, [r3] + ldr r1, _08178528 + adds r0, r1 + ldrb r1, [r0] + 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 + b _08178544 + .align 2, 0 +_08178524: .4byte 0x00001805 +_08178528: .4byte 0x00001806 +_0817852C: + ldr r0, [r3] + ldr r1, _08178568 + adds r0, r1 + ldrb r1, [r0] + 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 +_08178544: + strb r1, [r0] + ldrb r0, [r5, 0x19] + cmp r0, 0 + beq _08178570 + ldr r0, [r3] + ldr r1, _0817856C + adds r0, r1 + ldrb r1, [r0] + 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 + b _08178588 + .align 2, 0 +_08178568: .4byte 0x00001806 +_0817856C: .4byte 0x00001807 +_08178570: + ldr r0, [r3] + ldr r1, _08178590 + adds r0, r1 + ldrb r1, [r0] + 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 +_08178588: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08178590: .4byte 0x00001807 + thumb_func_end sub_8178404 + + thumb_func_start sub_8178594 +sub_8178594: @ 8178594 + push {r4,lr} + movs r4, 0 +_08178598: + ldr r0, _081785C4 + ldr r0, [r0] + ldr r1, _081785C8 + adds r0, r1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081785CC + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08178598 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081785C4: .4byte 0x0203bcf4 +_081785C8: .4byte 0x00001803 +_081785CC: .4byte 0x02020630 + thumb_func_end sub_8178594 + + thumb_func_start sub_81785D0 +sub_81785D0: @ 81785D0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08178608 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0817860C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08178608: .4byte 0x03005e00 +_0817860C: .4byte sub_8178610 + 1 + thumb_func_end sub_81785D0 + + thumb_func_start sub_8178610 +sub_8178610: @ 8178610 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08178648 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08178642 + bl sub_817836C + bl sub_8178594 + ldr r0, _0817864C + ldr r0, [r0] + bl free + bl Window_FreeMemory + ldr r0, _08178650 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08178642: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08178648: .4byte 0x02037fd4 +_0817864C: .4byte 0x0203bcf4 +_08178650: .4byte sub_81AD40C + 1 + thumb_func_end sub_8178610 + + thumb_func_start sub_8178654 +sub_8178654: @ 8178654 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r4, r2, 0 + ldr r0, _08178680 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081786A6 + ldr r3, _08178684 + ldrh r0, [r3, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _08178688 + movs r1, 0x1 + negs r1, r1 + adds r0, r2, 0 + bl sub_81786AC + b _081786A6 + .align 2, 0 +_08178680: .4byte 0x02037fd4 +_08178684: .4byte 0x030022c0 +_08178688: + cmp r1, 0x80 + bne _08178696 + adds r0, r2, 0 + movs r1, 0x1 + bl sub_81786AC + b _081786A6 +_08178696: + ldrh r1, [r3, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081786A6 + adds r0, r4, 0 + bl sub_81785D0 +_081786A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8178654 + + thumb_func_start sub_81786AC +sub_81786AC: @ 81786AC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r2, _081786EC + adds r4, r0, r2 + ldr r2, _081786F0 + ldrh r0, [r2, 0xE] + ldrh r2, [r2, 0x18] + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + lsrs r7, r1, 24 + asrs r6, r1, 24 + adds r0, r6 + cmp r0, 0x2D + bhi _08178718 + lsls r1, r0, 16 + lsrs r1, 16 + movs r0, 0x4 + bl bag_pocket_get_itemid + lsls r0, 16 + cmp r0, 0 + beq _08178718 + cmp r6, 0 + bge _081786F4 + movs r0, 0x2 + b _081786F6 + .align 2, 0 +_081786EC: .4byte 0x03005e08 +_081786F0: .4byte 0x0203ce58 +_081786F4: + movs r0, 0x1 +_081786F6: + strh r0, [r4, 0x2] + movs r0, 0 + strh r0, [r4] + movs r0, 0x5 + bl audio_play + lsls r0, r7, 24 + asrs r0, 24 + bl sub_8178728 + ldr r1, _08178720 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _08178724 + str r1, [r0] +_08178718: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08178720: .4byte 0x03005e00 +_08178724: .4byte sub_81787AC + 1 + thumb_func_end sub_81786AC + + thumb_func_start sub_8178728 +sub_8178728: @ 8178728 + push {r4-r6,lr} + ldr r5, _0817875C + adds r6, r5, 0 + subs r6, 0xA + lsls r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + ble _08178764 + ldrh r0, [r6] + cmp r0, 0x3 + bls _08178752 + ldrh r1, [r5] + adds r1, 0x8 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + bl bag_pocket_get_itemid + lsls r0, 16 + cmp r0, 0 + bne _08178760 +_08178752: + ldrh r0, [r6] + adds r0, r4 + strh r0, [r6] + b _0817877A + .align 2, 0 +_0817875C: .4byte 0x0203ce70 +_08178760: + ldrh r0, [r5] + b _08178776 +_08178764: + ldrh r1, [r6] + cmp r1, 0x3 + bhi _08178770 + ldrh r0, [r5] + cmp r0, 0 + bne _08178776 +_08178770: + adds r0, r1, r4 + strh r0, [r6] + b _0817877A +_08178776: + adds r0, r4 + strh r0, [r5] +_0817877A: + ldrh r1, [r6] + ldrh r5, [r5] + adds r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + bl berryid_from_itemid + ldr r1, _081787A8 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xC0 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081787A8: .4byte 0x0203bcf4 + thumb_func_end sub_8178728 + + thumb_func_start sub_81787AC +sub_81787AC: @ 81787AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _081787F0 + adds r6, r0, r1 + ldrh r0, [r6] + adds r0, 0x10 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _08178828 + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0x70 + beq _08178888 + cmp r0, 0x70 + bgt _081787FE + cmp r0, 0x40 + beq _0817881A + cmp r0, 0x40 + bgt _081787F4 + cmp r0, 0x30 + beq _08178898 + b _081788A6 + .align 2, 0 +_081787F0: .4byte 0x03005e08 +_081787F4: + cmp r0, 0x50 + beq _0817888E + cmp r0, 0x60 + beq _08178820 + b _081788A6 +_081787FE: + cmp r0, 0xA0 + beq _08178824 + cmp r0, 0xA0 + bgt _08178810 + cmp r0, 0x80 + beq _08178882 + cmp r0, 0x90 + beq _08178878 + b _081788A6 +_08178810: + cmp r0, 0xB0 + beq _08178872 + cmp r0, 0xC0 + beq _0817886C + b _081788A6 +_0817881A: + bl sub_8178110 + b _081788A6 +_08178820: + movs r0, 0x1 + b _0817889A +_08178824: + movs r0, 0x2 + b _0817889A +_08178828: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x70 + beq _0817887E + cmp r0, 0x70 + bgt _0817884C + cmp r0, 0x40 + beq _0817886C + cmp r0, 0x40 + bgt _08178842 + cmp r0, 0x30 + beq _08178868 + b _081788A6 +_08178842: + cmp r0, 0x50 + beq _08178872 + cmp r0, 0x60 + beq _08178878 + b _081788A6 +_0817884C: + cmp r0, 0xA0 + beq _0817888E + cmp r0, 0xA0 + bgt _0817885E + cmp r0, 0x80 + beq _08178882 + cmp r0, 0x90 + beq _08178888 + b _081788A6 +_0817885E: + cmp r0, 0xB0 + beq _08178898 + cmp r0, 0xC0 + beq _081788A2 + b _081788A6 +_08178868: + movs r0, 0x2 + b _0817889A +_0817886C: + bl sub_8178304 + b _081788A6 +_08178872: + bl sub_81782D0 + b _081788A6 +_08178878: + bl sub_8178404 + b _081788A6 +_0817887E: + movs r0, 0x1 + b _0817889A +_08178882: + bl itemid_copy_name + b _081788A6 +_08178888: + bl sub_8178174 + b _081788A6 +_0817888E: + bl sub_817836C + bl sub_8178338 + b _081788A6 +_08178898: + movs r0, 0 +_0817889A: + movs r1, 0 + bl Window_FastFillPixels + b _081788A6 +_081788A2: + bl sub_8178110 +_081788A6: + movs r2, 0x2 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bne _081788B8 + ldrh r0, [r6] + negs r0, r0 + lsls r0, 16 + lsrs r5, r0, 16 + b _081788BA +_081788B8: + ldrh r5, [r6] +_081788BA: + ldr r2, _0817892C + ldr r3, _08178930 + ldr r0, [r3] + ldr r1, _08178934 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x26] + movs r4, 0 + adds r7, r2, 0 + ldr r2, _08178938 +_081788D6: + ldr r0, [r3] + adds r0, r2 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r5, [r0, 0x26] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _081788D6 + movs r4, 0x80 + lsls r4, 5 + ldrb r2, [r6, 0x2] + movs r0, 0x1 + adds r1, r4, 0 + bl bg_change_y_offset + ldrb r2, [r6, 0x2] + movs r0, 0x2 + adds r1, r4, 0 + bl bg_change_y_offset + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _08178922 + ldr r0, _0817893C + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, _08178940 + str r0, [r1] +_08178922: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817892C: .4byte 0x02020630 +_08178930: .4byte 0x0203bcf4 +_08178934: .4byte 0x00001802 +_08178938: .4byte 0x00001803 +_0817893C: .4byte 0x03005e00 +_08178940: .4byte sub_8178654 + 1 + thumb_func_end sub_81787AC + + thumb_func_start sub_8178944 +sub_8178944: @ 8178944 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8178944 + + thumb_func_start sub_8178958 +sub_8178958: @ 8178958 + push {lr} + movs r2, 0 + ldr r1, _08178970 + ldrh r0, [r1, 0x1A] + ldrh r1, [r1, 0x36] + cmp r0, r1 + bne _08178968 + movs r2, 0x1 +_08178968: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_08178970: .4byte 0x020229e8 + thumb_func_end sub_8178958 + + thumb_func_start sub_8178974 +sub_8178974: @ 8178974 + push {r4,lr} + sub sp, 0x8 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl clear_tasks + ldr r0, _08178A2C + bl SetVBlankCallback + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08178A30 + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + ldr r0, _08178A34 + bl Window_InitFromTemplates + lsls r0, 16 + cmp r0, 0 + beq _08178A22 + bl TextBox_ResetSomeField + movs r4, 0 +_081789AC: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_FastFillPixels + adds r4, 0x1 + cmp r4, 0x1 + ble _081789AC + 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 bg_fill_tilemap_rect + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0xE0 + bl sub_81978B0 + movs r1, 0xA0 + lsls r1, 1 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + ldr r0, _08178A38 + movs r1, 0 + bl AddTask + bl sub_80A2F30 + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + ldr r0, _08178A3C + bl set_callback2 +_08178A22: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08178A2C: .4byte sub_8178944 + 1 +_08178A30: .4byte 0x085efd64 +_08178A34: .4byte 0x085efd68 +_08178A38: .4byte sub_8009404 + 1 +_08178A3C: .4byte sub_8178A78 + 1 + thumb_func_end sub_8178974 + + thumb_func_start sub_8178A40 +sub_8178A40: @ 8178A40 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + movs r5, 0x1 + cmp r4, 0 + bne _08178A54 + ldr r1, _08178A70 + bl gf_strcpy + movs r5, 0 +_08178A54: + cmp r4, 0x2 + bne _08178A5A + movs r5, 0 +_08178A5A: + cmp r4, 0x1 + bne _08178A66 + ldr r1, _08178A74 + adds r0, r6, 0 + bl gf_strcpy +_08178A66: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08178A70: .4byte 0x085ee80a +_08178A74: .4byte 0x085ee827 + thumb_func_end sub_8178A40 + + thumb_func_start sub_8178A78 +sub_8178A78: @ 8178A78 + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, _08178A98 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x10 + bls _08178A8E + b _08178E58 +_08178A8E: + lsls r0, 2 + ldr r1, _08178A9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08178A98: .4byte 0x030022c0 +_08178A9C: .4byte _08178AA0 + .align 2, 0 +_08178AA0: + .4byte _08178AE4 + .4byte _08178B12 + .4byte _08178B48 + .4byte _08178B80 + .4byte _08178BCC + .4byte _08178BDC + .4byte _08178C54 + .4byte _08178D28 + .4byte _08178D38 + .4byte _08178D58 + .4byte _08178D60 + .4byte _08178D74 + .4byte _08178DBC + .4byte _08178DE0 + .4byte _08178E0C + .4byte _08178E24 + .4byte _08178E48 +_08178AE4: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + b _08178E30 +_08178B12: + ldr r0, _08178B3C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08178B20 + b _08178E58 +_08178B20: + ldr r1, _08178B40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r1, _08178B44 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .align 2, 0 +_08178B3C: .4byte 0x02037fd4 +_08178B40: .4byte 0x085ee765 +_08178B44: .4byte 0x030022c0 +_08178B48: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _08178B56 + b _08178E58 +_08178B56: + ldr r1, _08178B74 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, _08178B78 + ldr r2, _08178B7C + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009734 + b _08178E58 + .align 2, 0 +_08178B74: .4byte 0x030022c0 +_08178B78: .4byte 0x020229c6 +_08178B7C: .4byte 0x00005501 +_08178B80: + ldr r0, _08178BC0 + ldr r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08178B8E + b _08178D00 +_08178B8E: + movs r0, 0x1C + ands r1, r0 + cmp r1, 0x4 + bhi _08178B98 + b _08178D00 +_08178B98: + movs r0, 0x15 + bl audio_play + ldr r1, _08178BC4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r1, _08178BC8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08178D00 + .align 2, 0 +_08178BC0: .4byte 0x030030e0 +_08178BC4: .4byte 0x085ee788 +_08178BC8: .4byte 0x030022c0 +_08178BCC: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _08178BDA + b _08178E58 +_08178BDA: + b _08178E34 +_08178BDC: + bl sub_800ABAC + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bne _08178CD0 + ldr r4, _08178C30 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08178C38 + movs r0, 0x5 + bl audio_play + bl sub_800A620 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r1, _08178C34 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + movs r2, 0x87 + lsls r2, 3 + adds r1, r4, r2 + b _08178E3C + .align 2, 0 +_08178C30: .4byte 0x030022c0 +_08178C34: .4byte 0x085ee7bf +_08178C38: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08178C42 + b _08178E58 +_08178C42: + movs r0, 0x5 + bl audio_play + bl sub_80097E8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r4, r0 + b _08178D1E +_08178C54: + bl sub_800B320 + lsls r0, 24 + cmp r0, 0 + beq _08178D00 + ldr r0, _08178CA0 + ldrb r0, [r0] + cmp r0, 0 + bne _08178C68 + b _08178E58 +_08178C68: + movs r0, 0x2 + movs r1, 0x2 + bl sub_800A0C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _08178CAC + bl sub_800AC34 + ldr r4, _08178CA4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8178A40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r0, _08178CA8 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + b _08178CF2 + .align 2, 0 +_08178CA0: .4byte 0x03003124 +_08178CA4: .4byte 0x02021fc4 +_08178CA8: .4byte 0x030022c0 +_08178CAC: + bl sub_8178958 + lsls r0, 24 + cmp r0, 0 + beq _08178CCC + ldr r1, _08178CC8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + b _08178E34 + .align 2, 0 +_08178CC8: .4byte 0x085ee7ce +_08178CCC: + bl sub_80097E8 +_08178CD0: + ldr r4, _08178CF8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8178A40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r0, _08178CFC + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 +_08178CF2: + movs r1, 0xD + strb r1, [r0] + b _08178E58 + .align 2, 0 +_08178CF8: .4byte 0x02021fc4 +_08178CFC: .4byte 0x030022c0 +_08178D00: + ldr r4, _08178D24 + ldrh r1, [r4, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08178D0E + b _08178E58 +_08178D0E: + movs r0, 0x5 + bl audio_play + bl sub_80097E8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r4, r2 +_08178D1E: + movs r0, 0xF + strb r0, [r1] + b _08178E58 + .align 2, 0 +_08178D24: .4byte 0x030022c0 +_08178D28: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + beq _08178D36 + b _08178E58 +_08178D36: + b _08178E34 +_08178D38: + bl sub_800A550 + lsls r0, 24 + cmp r0, 0 + bne _08178D44 + b _08178E58 +_08178D44: + bl sub_800A5B4 + ldr r1, _08178D54 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .align 2, 0 +_08178D54: .4byte 0x030022c0 +_08178D58: + movs r0, 0x87 + lsls r0, 3 + adds r1, r4, r0 + b _08178E3C +_08178D60: + bl sub_800AC34 + ldr r1, _08178D70 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .align 2, 0 +_08178D70: .4byte 0x030022c0 +_08178D74: + ldr r0, _08178DAC + ldrb r6, [r0] + cmp r6, 0 + bne _08178E58 + ldr r5, _08178DB0 + adds r0, r5, 0 + bl sub_81538A0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + str r6, [sp, 0x4] + ldr r2, _08178DB4 + add r0, sp, 0x4 + adds r1, r5, 0 + bl CpuSet + ldr r0, _08178DB8 + adds r1, r4, 0 + bl sub_8178A40 + lsls r0, 24 + cmp r0, 0 + bne _08178E34 + movs r0, 0 + bl save_game_when_memory_present + b _08178E34 + .align 2, 0 +_08178DAC: .4byte 0x03003124 +_08178DB0: .4byte 0x0201c000 +_08178DB4: .4byte 0x050001f5 +_08178DB8: .4byte 0x02021fc4 +_08178DBC: + ldr r1, _08178DD8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r1, _08178DDC + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .align 2, 0 +_08178DD8: .4byte 0x02021fc4 +_08178DDC: .4byte 0x030022c0 +_08178DE0: + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _08178E58 + ldr r0, _08178E04 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, _08178E08 + strb r2, [r0] + b _08178E58 + .align 2, 0 +_08178E04: .4byte 0x030022c0 +_08178E08: .4byte 0x0203bcf8 +_08178E0C: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08178E58 + movs r0, 0x5 + bl audio_play + movs r2, 0x87 + lsls r2, 3 + adds r1, r4, r2 + b _08178E3C +_08178E24: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_08178E30: + bl sub_80A1AD4 +_08178E34: + ldr r1, _08178E44 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08178E3C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08178E58 + .align 2, 0 +_08178E44: .4byte 0x030022c0 +_08178E48: + ldr r0, _08178EB4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08178E58 + bl do_reset +_08178E58: + ldr r0, _08178EB8 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08178E98 + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + bne _08178E98 + bl sub_80097E8 + ldr r4, _08178EBC + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8178A40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r0, _08178EC0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0xD + strb r1, [r0] +_08178E98: + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08178EB4: .4byte 0x02037fd4 +_08178EB8: .4byte 0x030030e0 +_08178EBC: .4byte 0x02021fc4 +_08178EC0: .4byte 0x030022c0 + thumb_func_end sub_8178A78 + + thumb_func_start sub_8178EC4 +sub_8178EC4: @ 8178EC4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x1C + adds r5, r0, 0 + mov r10, r1 + 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 r8, r1 + add r0, sp, 0x14 + mov r1, r8 + strb r1, [r0] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + adds r0, r1, 0 + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + str r3, [sp, 0x18] + bl Window_FastFillPixels + mov r0, r9 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + mov r1, r10 + str r1, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + ldr r3, [sp, 0x18] + bl sub_8199EEC + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8178EC4 + + thumb_func_start sub_8178F44 +sub_8178F44: @ 8178F44 + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r3, 24 + add r0, sp, 0x14 + movs r2, 0 + strb r2, [r0] + adds r1, r0, 0 + movs r0, 0xF + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + ldr r0, _08178F8C + ldrb r0, [r0] + lsls r4, 27 + lsrs r4, 24 + lsrs r3, 21 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r2, [sp, 0x4] + str r1, [sp, 0x8] + str r2, [sp, 0xC] + str r5, [sp, 0x10] + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8199EEC + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08178F8C: .4byte 0x0203bd0e + thumb_func_end sub_8178F44 + + thumb_func_start fullscreen_save_activate +fullscreen_save_activate: @ 8178F90 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08178FB8 + bl set_callback2 + ldr r0, _08178FBC + strh r4, [r0] + ldr r1, _08178FC0 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + strh r0, [r1, 0x2] + ldr r0, _08178FC4 + strb r2, [r0] + strb r2, [r0, 0x1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08178FB8: .4byte sub_8178FDC + 1 +_08178FBC: .4byte 0x0203bcfc +_08178FC0: .4byte 0x0203bcfe +_08178FC4: .4byte 0x0203bd0e + thumb_func_end fullscreen_save_activate + + thumb_func_start sub_8178FC8 +sub_8178FC8: @ 8178FC8 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8178FC8 + + thumb_func_start sub_8178FDC +sub_8178FDC: @ 8178FDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, _081791F4 + movs r1, 0x87 + lsls r1, 3 + adds r7, r0, r1 + ldrb r0, [r7] + cmp r0, 0 + beq _08178FF8 + cmp r0, 0x1 + bne _08178FF8 + b _0817925C +_08178FF8: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0xE + movs r1, 0 + bl lcd_io_set + movs r0, 0xC + movs r1, 0 + bl lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x18 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1A + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r2, _081791F8 + str r1, [r2] + movs r1, 0xC0 + lsls r1, 19 + str r1, [r2, 0x4] + ldr r0, _081791FC + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r3, 0 + mov r8, r3 + str r3, [sp, 0x8] + add r4, sp, 0x8 + str r4, [r2] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, _08179200 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + add r0, sp, 0x4 + mov r3, r8 + strh r3, [r0] + str r0, [r2] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, _08179204 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, _08179208 + bl LZ77UnCompVram + ldr r0, _0817920C + ldr r1, _08179210 + bl LZ77UnCompVram + ldr r0, _08179214 + ldr r1, _08179218 + bl LZ77UnCompVram + ldr r0, _0817921C + ldr r1, _08179220 + bl LZ77UnCompVram + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08179224 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r5, _08179228 + movs r0, 0 + adds r1, r5, 0 + bl bg_set_tilemap + mov r0, r8 + str r0, [sp, 0x8] + ldr r2, _0817922C + adds r0, r4, 0 + adds r1, r5, 0 + bl CpuSet + ldr r1, _08179230 + movs r2, 0x90 + lsls r2, 1 + movs r6, 0x85 + lsls r6, 2 + movs r0, 0 + adds r3, r6, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _08179234 + bl Window_InitFromTemplates + ldr r0, _08179238 + bl Window_AddFromTemplateWithoutAllocatingMemory + ldr r4, _0817923C + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0x80 + lsls r1, 4 + adds r2, r5, r1 + movs r1, 0x7 + bl Window_SetField + ldr r0, _08179240 + bl Window_AddFromTemplateWithoutAllocatingMemory + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x1] + movs r3, 0xE8 + lsls r3, 5 + adds r5, r3 + movs r1, 0x7 + adds r2, r5, 0 + bl Window_SetField + bl TextBox_ResetSomeField + bl reset_all_obj_data + bl clear_tasks + bl sub_80A1A74 + ldr r0, _08179244 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, _08179248 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817924C + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _08179250 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrb r0, [r4] + movs r1, 0 + adds r2, r6, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldrb r0, [r4, 0x1] + movs r1, 0 + adds r2, r6, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldrb r0, [r4, 0x1] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0x1] + movs r1, 0x2 + bl Window_CopyToVram + ldrb r0, [r4] + movs r1, 0x1 + bl Window_CopyToVram + ldr r0, _08179254 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + movs r0, 0x1 + negs r0, r0 + mov r1, r8 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _08179258 + bl SetVBlankCallback + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _08179272 + .align 2, 0 +_081791F4: .4byte 0x030022c0 +_081791F8: .4byte 0x040000d4 +_081791FC: .4byte 0x8100c000 +_08179200: .4byte 0x85000100 +_08179204: .4byte 0x81000200 +_08179208: .4byte 0x085b0e04 +_0817920C: .4byte 0x085b0a80 +_08179210: .4byte 0x06007000 +_08179214: .4byte 0x085b0c0c +_08179218: .4byte 0x06007800 +_0817921C: .4byte 0x085efde4 +_08179220: .4byte 0x06010020 +_08179224: .4byte 0x085efd88 +_08179228: .4byte 0x0201e000 +_0817922C: .4byte 0x05000200 +_08179230: .4byte 0x0850e87c +_08179234: .4byte 0x085efd94 +_08179238: .4byte 0x085efd9c +_0817923C: .4byte 0x0203bd0e +_08179240: .4byte 0x085efda4 +_08179244: .4byte 0x085b0a00 +_08179248: .4byte 0x085efdc4 +_0817924C: .4byte 0x0850fefc +_08179250: .4byte 0x0860f074 +_08179254: .4byte 0x085ec816 +_08179258: .4byte sub_8178FC8 + 1 +_0817925C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08179272 + ldr r0, _08179280 + bl set_callback2 + ldr r0, _08179284 + bl SetVBlankCallback +_08179272: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08179280: .4byte sub_8179288 + 1 +_08179284: .4byte sub_8179454 + 1 + thumb_func_end sub_8178FDC + + thumb_func_start sub_8179288 +sub_8179288: @ 8179288 + push {r4-r6,lr} + movs r5, 0 + ldr r0, _08179300 + movs r1, 0x1 + strh r1, [r0] + ldr r1, _08179304 + ldr r0, [r1] + cmp r0, 0 + beq _081792EC + adds r6, r1, 0 +_0817929C: + ldr r0, [r6] + bl sub_81795AC + lsls r0, 24 + cmp r0, 0 + bne _08179348 + ldr r4, _08179308 + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _0817930C + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + ldr r0, _08179310 + ldrb r0, [r0] + bl calls_flash_erase_block_3 + ldr r0, [r6] + cmp r0, 0 + beq _081792DC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _08179314 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 +_081792DC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r6] + cmp r0, 0 + beq _081792EC + cmp r5, 0x2 + bls _0817929C +_081792EC: + cmp r5, 0x3 + bne _0817931C + ldr r0, _08179308 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _08179318 + b _08179330 + .align 2, 0 +_08179300: .4byte 0x0203bcfe +_08179304: .4byte 0x030061fc +_08179308: .4byte 0x0203bd0e +_0817930C: .4byte 0x085ec917 +_08179310: .4byte 0x0203bcfc +_08179314: .4byte 0x085ec816 +_08179318: .4byte 0x085ec86f +_0817931C: + ldr r0, _0817933C + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _08179340 + ldr r0, [r0] + cmp r0, 0 + bne _08179370 + ldr r0, _08179344 +_08179330: + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + b _0817937A + .align 2, 0 +_0817933C: .4byte 0x0203bd0e +_08179340: .4byte 0x03006214 +_08179344: .4byte 0x085ec94f +_08179348: + ldr r0, _08179364 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _08179368 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + ldr r0, _0817936C + bl set_callback2 + b _08179380 + .align 2, 0 +_08179364: .4byte 0x0203bd0e +_08179368: .4byte 0x085ec86f +_0817936C: .4byte sub_8179390 + 1 +_08179370: + ldr r0, _08179388 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 +_0817937A: + ldr r0, _0817938C + bl set_callback2 +_08179380: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08179388: .4byte 0x085ec9a2 +_0817938C: .4byte sub_81793E0 + 1 + thumb_func_end sub_8179288 + + thumb_func_start sub_8179390 +sub_8179390: @ 8179390 + push {lr} + ldr r1, _081793C8 + movs r0, 0 + strh r0, [r1] + ldr r0, _081793CC + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081793C4 + ldr r0, _081793D0 + ldrb r0, [r0] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _081793D4 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + ldr r0, _081793D8 + bl SetVBlankCallback + ldr r0, _081793DC + bl set_callback2 +_081793C4: + pop {r0} + bx r0 + .align 2, 0 +_081793C8: .4byte 0x0203bcfe +_081793CC: .4byte 0x030022c0 +_081793D0: .4byte 0x0203bd0e +_081793D4: .4byte 0x085ec8d4 +_081793D8: .4byte sub_8178FC8 + 1 +_081793DC: .4byte sub_81793E0 + 1 + thumb_func_end sub_8179390 + + thumb_func_start sub_81793E0 +sub_81793E0: @ 81793E0 + push {lr} + sub sp, 0x4 + ldr r0, _08179418 + movs r2, 0 + strh r2, [r0] + ldr r0, _0817941C + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08179410 + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _08179420 + bl SetVBlankCallback + ldr r0, _08179424 + bl set_callback2 +_08179410: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08179418: .4byte 0x0203bcfe +_0817941C: .4byte 0x030022c0 +_08179420: .4byte sub_8178FC8 + 1 +_08179424: .4byte sub_8179428 + 1 + thumb_func_end sub_81793E0 + + thumb_func_start sub_8179428 +sub_8179428: @ 8179428 + push {r4,r5,lr} + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0817944E + ldr r5, _08179444 + ldr r0, [r5] + cmp r0, 0 + bne _08179448 + bl do_reset + b _0817944E + .align 2, 0 +_08179444: .4byte 0x03006214 +_08179448: + bl set_callback2 + str r4, [r5] +_0817944E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8179428 + + thumb_func_start sub_8179454 +sub_8179454: @ 8179454 + push {r4,r5,lr} + ldr r5, _081794C4 + ldr r0, [r5, 0x24] + lsrs r4, r0, 3 + movs r0, 0x7 + ands r4, r0 + ldr r0, _081794C8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r5, 0x38] + str r1, [r5, 0x3C] + ldrh r1, [r5, 0x3A] + ldr r0, _081794CC + ands r0, r1 + movs r1, 0x70 + orrs r0, r1 + strh r0, [r5, 0x3A] + adds r1, r5, 0 + adds r1, 0x38 + movs r0, 0x48 + strb r0, [r1] + ldr r0, _081794D0 + ldrh r0, [r0] + cmp r0, 0 + beq _081794DC + ldr r3, _081794D4 + lsls r2, r4, 1 + adds r2, r4 + adds r0, r2, r3 + ldrb r4, [r0] + ldrh r1, [r5, 0x3C] + ldr r0, _081794D8 + ands r0, r1 + orrs r0, r4 + strh r0, [r5, 0x3C] + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r1, 4 + adds r3, 0x1 + adds r2, r3 + ldrb r0, [r2] + lsls r0, 3 + orrs r1, r0 + adds r3, r5, 0 + adds r3, 0x3B + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _081794E8 + .align 2, 0 +_081794C4: .4byte 0x030022c0 +_081794C8: .4byte 0x085efd80 +_081794CC: .4byte 0xfffffe00 +_081794D0: .4byte 0x0203bcfe +_081794D4: .4byte 0x085efdac +_081794D8: .4byte 0xfffffc00 +_081794DC: + ldrh r0, [r5, 0x3C] + ldr r1, _08179508 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r5, 0x3C] +_081794E8: + ldr r0, _0817950C + movs r1, 0xE0 + lsls r1, 19 + movs r2, 0x1 + bl CpuFastSet + ldr r1, _08179510 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _08179500 + subs r0, 0x1 + strh r0, [r1, 0x2] +_08179500: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08179508: .4byte 0xfffffc00 +_0817950C: .4byte 0x030022f8 +_08179510: .4byte 0x0203bcfe + thumb_func_end sub_8179454 + + thumb_func_start sub_8179514 +sub_8179514: @ 8179514 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, _08179538 + movs r3, 0x80 + lsls r3, 5 + movs r1, 0 + adds r2, r4, 0 + bl ReadFlash + movs r1, 0 + ldr r2, _0817953C +_0817952C: + ldr r0, [r4] + cmp r0, 0 + beq _08179540 + movs r0, 0x1 + b _0817954E + .align 2, 0 +_08179538: .4byte 0x0203abbc +_0817953C: .4byte 0x000003ff +_08179540: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r4, 0x4 + cmp r1, r2 + bls _0817952C + movs r0, 0 +_0817954E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8179514 + + thumb_func_start sub_8179554 +sub_8179554: @ 8179554 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + ldr r1, _081795A4 + mov r8, r1 + ldr r7, _081795A8 +_08179566: + movs r4, 0 + adds r5, r0, 0x1 +_0817956A: + ldr r3, [r7] + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + bl _call_via_r3 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r8 + bls _0817956A + adds r0, r6, 0 + bl sub_8179514 + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r5, 16 + lsrs r0, 16 + cmp r1, 0 + beq _08179596 + cmp r0, 0x81 + bls _08179566 +_08179596: + adds r0, r1, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081795A4: .4byte 0x00000fff +_081795A8: .4byte 0x03007854 + thumb_func_end sub_8179554 + + thumb_func_start sub_81795AC +sub_81795AC: @ 81795AC + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 +_081795B2: + movs r4, 0x1 + lsls r4, r6 + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _081795CC + adds r0, r6, 0 + bl sub_8179554 + lsls r0, 24 + cmp r0, 0 + bne _081795CC + bics r5, r4 +_081795CC: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1F + bls _081795B2 + cmp r5, 0 + beq _081795DE + movs r0, 0x1 + b _081795E0 +_081795DE: + movs r0, 0 +_081795E0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81795AC + + thumb_func_start sub_81795E8 +sub_81795E8: @ 81795E8 + push {lr} + ldr r0, _0817961C + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08179634 + ldr r0, _08179620 + ldr r2, [r0] + ldrh r1, [r2, 0x4] + ldr r0, _08179624 + cmp r1, r0 + bne _08179634 + ldr r1, [r2] + ldr r0, _08179628 + cmp r1, r0 + beq _08179616 + ldr r0, _0817962C + cmp r1, r0 + beq _08179616 + ldr r0, _08179630 + cmp r1, r0 + bne _08179634 +_08179616: + movs r0, 0x1 + b _08179636 + .align 2, 0 +_0817961C: .4byte 0x000008af +_08179620: .4byte 0x03005d8c +_08179624: .4byte 0x00004718 +_08179628: .4byte 0x0003000a +_0817962C: .4byte 0x00030009 +_08179630: .4byte 0x0003000b +_08179634: + movs r0, 0 +_08179636: + pop {r1} + bx r1 + thumb_func_end sub_81795E8 + + thumb_func_start sub_817963C +sub_817963C: @ 817963C + push {lr} + ldr r2, _08179694 + movs r0, 0x10 + movs r1, 0x8 + bl setmaptile_0 + ldr r2, _08179698 + movs r0, 0x11 + movs r1, 0x8 + bl setmaptile_0 + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x12 + movs r1, 0x8 + bl setmaptile_0 + ldr r2, _0817969C + movs r0, 0x10 + movs r1, 0x9 + bl setmaptile_0 + ldr r2, _081796A0 + movs r0, 0x11 + movs r1, 0x9 + bl setmaptile_0 + ldr r2, _081796A4 + movs r0, 0x12 + movs r1, 0x9 + bl setmaptile_0 + bl cur_mapdata_full_redraw + movs r0, 0x14 + bl audio_play + ldr r0, _081796A8 + bl flag_set + bl script_env_2_disable + pop {r0} + bx r0 + .align 2, 0 +_08179694: .4byte 0x0000022a +_08179698: .4byte 0x0000022b +_0817969C: .4byte 0x00000e32 +_081796A0: .4byte 0x00000233 +_081796A4: .4byte 0x00000e34 +_081796A8: .4byte 0x000008af + thumb_func_end sub_817963C + + thumb_func_start sub_81796AC +sub_81796AC: @ 81796AC + push {r4,lr} + ldr r4, _081796E8 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x9D + lsls r1, 1 + cmp r0, r1 + bne _081796F4 + bl calc_player_party_count + ldr r0, _081796EC + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + adds r1, r4, 0 + subs r1, 0x64 + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + ldr r1, _081796F0 + cmp r0, r1 + bne _081796F4 + movs r0, 0x1 + b _081796F6 + .align 2, 0 +_081796E8: .4byte 0x020244ec +_081796EC: .4byte 0x020244e9 +_081796F0: .4byte 0x0000017d +_081796F4: + movs r0, 0 +_081796F6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81796AC + + thumb_func_start nullsub_84 +nullsub_84: @ 81796FC + bx lr + thumb_func_end nullsub_84 + + thumb_func_start sub_8179700 +sub_8179700: @ 8179700 + push {lr} + ldr r0, _08179734 + movs r1, 0x9 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08179738 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + movs r0, 0x2 + strh r0, [r1, 0x10] + movs r0, 0x5 + strh r0, [r1, 0x12] + movs r0, 0x32 + strh r0, [r1, 0x14] + movs r0, 0 + bl sub_808A2C0 + pop {r0} + bx r0 + .align 2, 0 +_08179734: .4byte sub_8179778 + 1 +_08179738: .4byte 0x03005e00 + thumb_func_end sub_8179700 + + thumb_func_start sub_817973C +sub_817973C: @ 817973C + push {lr} + ldr r0, _08179770 + movs r1, 0x9 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08179774 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + movs r0, 0x3 + strh r0, [r1, 0x10] + movs r0, 0x5 + strh r0, [r1, 0x12] + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0 + bl sub_808A2C0 + pop {r0} + bx r0 + .align 2, 0 +_08179770: .4byte sub_8179778 + 1 +_08179774: .4byte 0x03005e00 + thumb_func_end sub_817973C + + thumb_func_start sub_8179778 +sub_8179778: @ 8179778 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081797D8 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081797D0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + negs r0, r0 + strh r0, [r4, 0x10] + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r0, 0 + bl sub_808A2CC + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _081797D0 + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + bl sub_808A2E4 +_081797D0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081797D8: .4byte 0x03005e00 + thumb_func_end sub_8179778 + + thumb_func_start sub_81797DC +sub_81797DC: @ 81797DC + push {lr} + movs r0, 0x8B + lsls r0, 4 + bl flag_check + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0817982C + ldr r0, _08179818 + ldr r3, [r0] + ldrh r1, [r3, 0x4] + movs r0, 0xC3 + lsls r0, 3 + cmp r1, r0 + bne _0817982C + ldr r1, [r3] + ldr r0, _0817981C + cmp r1, r0 + beq _08179810 + ldr r0, _08179820 + cmp r1, r0 + beq _08179810 + ldr r0, _08179824 + cmp r1, r0 + bne _0817982C +_08179810: + ldr r0, _08179828 + strb r2, [r0] + movs r0, 0x1 + b _0817982E + .align 2, 0 +_08179818: .4byte 0x03005d8c +_0817981C: .4byte 0x00170006 +_08179820: .4byte 0x00170005 +_08179824: .4byte 0x00170007 +_08179828: .4byte 0x0203bd14 +_0817982C: + movs r0, 0 +_0817982E: + pop {r1} + bx r1 + thumb_func_end sub_81797DC + + thumb_func_start sub_8179834 +sub_8179834: @ 8179834 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _0817984C + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x3C + bl oe_exec + pop {r0} + bx r0 + .align 2, 0 +_0817984C: .4byte 0x02038c08 + thumb_func_end sub_8179834 + + thumb_func_start sub_8179850 +sub_8179850: @ 8179850 + push {lr} + movs r0, 0x3C + bl oe_active_list_remove + bl sub_8179860 + pop {r0} + bx r0 + thumb_func_end sub_8179850 + + thumb_func_start sub_8179860 +sub_8179860: @ 8179860 + push {lr} + ldr r2, _081798BC + movs r0, 0xE + movs r1, 0x1A + bl setmaptile_0 + ldr r2, _081798C0 + movs r0, 0xF + movs r1, 0x1A + bl setmaptile_0 + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x10 + movs r1, 0x1A + bl setmaptile_0 + ldr r2, _081798C4 + movs r0, 0xE + movs r1, 0x1B + bl setmaptile_0 + ldr r2, _081798C8 + movs r0, 0xF + movs r1, 0x1B + bl setmaptile_0 + ldr r2, _081798CC + movs r0, 0x10 + movs r1, 0x1B + bl setmaptile_0 + bl cur_mapdata_full_redraw + movs r0, 0x14 + bl audio_play + movs r0, 0x8B + lsls r0, 4 + bl flag_set + bl script_env_2_disable + pop {r0} + bx r0 + .align 2, 0 +_081798BC: .4byte 0x0000022a +_081798C0: .4byte 0x0000022b +_081798C4: .4byte 0x00000e32 +_081798C8: .4byte 0x00000233 +_081798CC: .4byte 0x00000e34 + thumb_func_end sub_8179860 + + thumb_func_start sub_81798D0 +sub_81798D0: @ 81798D0 + push {lr} + ldr r0, _081798FC + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08179910 + ldr r0, _08179900 + ldr r2, [r0] + ldrh r1, [r2, 0x4] + ldr r0, _08179904 + cmp r1, r0 + bne _08179910 + ldr r1, [r2] + ldr r0, _08179908 + cmp r1, r0 + bne _08179910 + ldr r1, _0817990C + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _08179912 + .align 2, 0 +_081798FC: .4byte 0x000008b2 +_08179900: .4byte 0x03005d8c +_08179904: .4byte 0x00004418 +_08179908: .4byte 0x00190008 +_0817990C: .4byte 0x0203bd14 +_08179910: + movs r0, 0 +_08179912: + pop {r1} + bx r1 + thumb_func_end sub_81798D0 + + thumb_func_start sub_8179918 +sub_8179918: @ 8179918 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _08179930 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x3C + bl oe_exec + pop {r0} + bx r0 + .align 2, 0 +_08179930: .4byte 0x02038c08 + thumb_func_end sub_8179918 + + thumb_func_start sub_8179934 +sub_8179934: @ 8179934 + push {lr} + movs r0, 0x3C + bl oe_active_list_remove + bl sub_8179944 + pop {r0} + bx r0 + thumb_func_end sub_8179934 + + thumb_func_start sub_8179944 +sub_8179944: @ 8179944 + push {lr} + ldr r2, _0817999C + movs r0, 0xE + movs r1, 0x1A + bl setmaptile_0 + ldr r2, _081799A0 + movs r0, 0xF + movs r1, 0x1A + bl setmaptile_0 + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x10 + movs r1, 0x1A + bl setmaptile_0 + ldr r2, _081799A4 + movs r0, 0xE + movs r1, 0x1B + bl setmaptile_0 + ldr r2, _081799A8 + movs r0, 0xF + movs r1, 0x1B + bl setmaptile_0 + ldr r2, _081799AC + movs r0, 0x10 + movs r1, 0x1B + bl setmaptile_0 + bl cur_mapdata_full_redraw + movs r0, 0x14 + bl audio_play + ldr r0, _081799B0 + bl flag_set + bl script_env_2_disable + pop {r0} + bx r0 + .align 2, 0 +_0817999C: .4byte 0x0000022a +_081799A0: .4byte 0x0000022b +_081799A4: .4byte 0x00000e32 +_081799A8: .4byte 0x00000233 +_081799AC: .4byte 0x00000e34 +_081799B0: .4byte 0x000008b2 + thumb_func_end sub_8179944 + + thumb_func_start nullsub_64 +nullsub_64: @ 81799B4 + bx lr + thumb_func_end nullsub_64 + + thumb_func_start sub_81799B8 +sub_81799B8: @ 81799B8 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081799D8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081799E4 + ldr r1, _081799DC + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, _081799E0 + b _081799F0 + .align 2, 0 +_081799D8: .4byte 0x0203bd14 +_081799DC: .4byte 0x03005e00 +_081799E0: .4byte sub_8179934 + 1 +_081799E4: + ldr r1, _081799FC + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, _08179A00 +_081799F0: + lsrs r1, r2, 16 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081799FC: .4byte 0x03005e00 +_08179A00: .4byte sub_8179850 + 1 + thumb_func_end sub_81799B8 + + thumb_func_start sub_8179A04 +sub_8179A04: @ 8179A04 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _08179A48 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + ldr r0, _08179A4C + cmp r1, r0 + beq _08179A1A + b _08179B5A +_08179A1A: + ldr r0, _08179A50 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08179A28 + b _08179B5A +_08179A28: + movs r0, 0x2 + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08179A36 + b _08179B5A +_08179A36: + movs r0, 0x3 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08179A58 + b _08179B5A + .align 2, 0 +_08179A48: .4byte 0x03005d8c +_08179A4C: .4byte 0x00004318 +_08179A50: .4byte 0x000008b1 +_08179A54: + movs r0, 0x1 + b _08179B5C +_08179A58: + movs r5, 0 + mov r8, r4 + ldr r4, _08179AA4 + adds r0, r4, 0x1 + mov r12, r0 + ldr r6, _08179AA8 + ldr r1, _08179AAC + mov r9, r1 +_08179A68: + lsls r0, r5, 1 + adds r1, r0, r4 + add r0, r12 + ldrb r3, [r0] + mov r7, r8 + ldr r2, [r7] + movs r7, 0 + ldrsh r0, [r2, r7] + ldrb r1, [r1] + cmp r0, r1 + bne _08179B44 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r3 + bne _08179B44 + cmp r5, 0xF + bhi _08179AB0 + adds r0, r6, 0 + bl var_get + lsls r0, 16 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r5 + orrs r1, r0 + lsrs r1, 16 + adds r0, r6, 0 + bl var_set + b _08179AF0 + .align 2, 0 +_08179AA4: .4byte 0x085efe74 +_08179AA8: .4byte 0x0000403b +_08179AAC: .4byte 0x0000403c +_08179AB0: + cmp r5, 0x1F + bhi _08179AD2 + mov r0, r9 + bl var_get + lsls r0, 16 + adds r2, r5, 0 + subs r2, 0x10 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + orrs r1, r0 + lsrs r1, 16 + mov r0, r9 + bl var_set + b _08179AF0 +_08179AD2: + ldr r4, _08179B2C + adds r0, r4, 0 + bl var_get + lsls r0, 16 + adds r2, r5, 0 + subs r2, 0x20 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + orrs r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl var_set +_08179AF0: + ldr r0, _08179B30 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08179B34 + cmp r4, r0 + bne _08179B5A + ldr r0, _08179B38 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bne _08179B5A + ldr r0, _08179B2C + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bne _08179B5A + ldr r0, _08179B3C + ldr r0, [r0] + ldr r1, [r0] + ldr r0, _08179B40 + cmp r1, r0 + beq _08179A54 + b _08179B5A + .align 2, 0 +_08179B2C: .4byte 0x0000403d +_08179B30: .4byte 0x0000403b +_08179B34: .4byte 0x0000ffff +_08179B38: .4byte 0x0000403c +_08179B3C: .4byte 0x03005d8c +_08179B40: .4byte 0x00150008 +_08179B44: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x23 + bls _08179A68 + movs r0, 0x3 + bl flag_set + movs r0, 0x2 + bl flag_clear +_08179B5A: + movs r0, 0 +_08179B5C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8179A04 + + thumb_func_start sub_8179B68 +sub_8179B68: @ 8179B68 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8179B68 + + thumb_func_start sub_8179B84 +sub_8179B84: @ 8179B84 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8179B84 + + thumb_func_start sub_8179B98 +sub_8179B98: @ 8179B98 + push {r4,lr} + sub sp, 0x4 + ldr r0, _08179BB8 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xD + bls _08179BAC + b _08179D4C +_08179BAC: + lsls r0, 2 + ldr r1, _08179BBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08179BB8: .4byte 0x030022c0 +_08179BBC: .4byte _08179BC0 + .align 2, 0 +_08179BC0: + .4byte _08179BF8 + .4byte _08179C20 + .4byte _08179C34 + .4byte _08179C48 + .4byte _08179C4E + .4byte _08179C60 + .4byte _08179C66 + .4byte _08179C78 + .4byte _08179C98 + .4byte _08179CB0 + .4byte _08179CDC + .4byte _08179CF8 + .4byte _08179CFE + .4byte _08179D18 +_08179BF8: + ldr r4, _08179C14 + ldr r0, _08179C18 + bl malloc_and_clear + str r0, [r4] + bl vblank_hblank_handler_set_zero + bl clear_scheduled_bg_copies_to_vram + ldr r1, _08179C1C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .align 2, 0 +_08179C14: .4byte 0x0203bd18 +_08179C18: .4byte 0x00001084 +_08179C1C: .4byte 0x030022c0 +_08179C20: + bl sub_80A1A74 + ldr r2, _08179C30 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _08179D30 + .align 2, 0 +_08179C30: .4byte 0x02037fd4 +_08179C34: + bl reset_all_obj_data + ldr r1, _08179C44 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .align 2, 0 +_08179C44: .4byte 0x030022c0 +_08179C48: + bl gpu_pal_allocator_reset + b _08179D32 +_08179C4E: + bl init_uns_table_pokemon_copy + ldr r1, _08179C5C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .align 2, 0 +_08179C5C: .4byte 0x030022c0 +_08179C60: + bl sub_8179D9C + b _08179D32 +_08179C66: + bl sub_8179FAC + ldr r1, _08179C74 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .align 2, 0 +_08179C74: .4byte 0x030022c0 +_08179C78: + ldr r0, _08179C90 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08179C94 + adds r0, r1 + bl sub_8179DF4 + lsls r0, 24 + cmp r0, 0 + beq _08179D64 + b _08179D32 + .align 2, 0 +_08179C90: .4byte 0x0203bc9c +_08179C94: .4byte 0x020244ec +_08179C98: + bl sub_817A4A4 + ldr r1, _08179CA8 + ldr r1, [r1] + ldr r2, _08179CAC + adds r1, r2 + strb r0, [r1] + b _08179D32 + .align 2, 0 +_08179CA8: .4byte 0x0203bd18 +_08179CAC: .4byte 0x0000105e +_08179CB0: + ldr r0, _08179CCC + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08179CD0 + adds r0, r1 + bl sub_817A358 + ldr r1, _08179CD4 + ldr r1, [r1] + ldr r2, _08179CD8 + adds r1, r2 + strb r0, [r1] + b _08179D32 + .align 2, 0 +_08179CCC: .4byte 0x0203bc9c +_08179CD0: .4byte 0x020244ec +_08179CD4: .4byte 0x0203bd18 +_08179CD8: .4byte 0x0000105d +_08179CDC: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r1, _08179CF4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .align 2, 0 +_08179CF4: .4byte 0x030022c0 +_08179CF8: + bl sub_817A168 + b _08179D32 +_08179CFE: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, _08179D14 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .align 2, 0 +_08179D14: .4byte 0x030022c0 +_08179D18: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _08179D44 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_08179D30: + strb r0, [r2, 0x8] +_08179D32: + ldr r1, _08179D48 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08179D3A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08179D64 + .align 2, 0 +_08179D44: .4byte 0x02037fd4 +_08179D48: .4byte 0x030022c0 +_08179D4C: + ldr r0, _08179D5C + bl SetVBlankCallback + ldr r0, _08179D60 + bl set_callback2 + movs r0, 0x1 + b _08179D66 + .align 2, 0 +_08179D5C: .4byte sub_8179B84 + 1 +_08179D60: .4byte sub_8179B68 + 1 +_08179D64: + movs r0, 0 +_08179D66: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8179B98 + + thumb_func_start sub_8179D70 +sub_8179D70: @ 8179D70 + push {lr} +_08179D72: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08179D96 + bl sub_8179B98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08179D96 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08179D72 +_08179D96: + pop {r0} + bx r0 + thumb_func_end sub_8179D70 + + thumb_func_start sub_8179D9C +sub_8179D9C: @ 8179D9C + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08179DEC + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + ldr r0, _08179DF0 + ldr r1, [r0] + adds r1, 0x48 + movs r0, 0x1 + bl bg_set_tilemap + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_08179DEC: .4byte 0x085f0550 +_08179DF0: .4byte 0x0203bd18 + thumb_func_end sub_8179D9C + + thumb_func_start sub_8179DF4 +sub_8179DF4: @ 8179DF4 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, _08179E18 + ldr r0, [r0] + ldr r1, _08179E1C + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x8 + bls _08179E0C + b _08179FA0 +_08179E0C: + lsls r0, 2 + ldr r1, _08179E20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08179E18: .4byte 0x0203bd18 +_08179E1C: .4byte 0x0000107e +_08179E20: .4byte _08179E24 + .align 2, 0 +_08179E24: + .4byte _08179E48 + .4byte _08179E84 + .4byte _08179EC4 + .4byte _08179ED8 + .4byte _08179EEC + .4byte _08179F00 + .4byte _08179F20 + .4byte _08179F44 + .4byte _08179F78 +_08179E48: + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r0, r5, 3 + ldr r1, _08179E78 + adds r0, r1 + ldr r1, _08179E7C + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + adds r3, r4, 0 + bl help_system_enable_unless_flashback__sp199 + ldr r0, _08179E80 + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179E78: .4byte 0x0830a18c +_08179E7C: .4byte 0x020244d4 +_08179E80: .4byte 0x0203bd18 +_08179E84: + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_806E7CC + adds r4, r0, 0 + bl gpu_pal_obj_decompress_and_apply + ldrh r0, [r4, 0x4] + movs r1, 0x1 + bl sub_806A068 + ldr r0, _08179EC0 + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179EC0: .4byte 0x0203bd18 +_08179EC4: + ldr r0, _08179ED0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08179ED4 + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179ED0: .4byte 0x085b26f4 +_08179ED4: .4byte 0x0203bd18 +_08179ED8: + ldr r0, _08179EE4 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _08179EE8 + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179EE4: .4byte 0x085b26fc +_08179EE8: .4byte 0x0203bd18 +_08179EEC: + ldr r0, _08179EF8 + bl gpu_tile_obj_decompress_and_load + ldr r0, _08179EFC + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179EF8: .4byte 0x085f06a0 +_08179EFC: .4byte 0x0203bd18 +_08179F00: + ldr r0, _08179F14 + ldrb r0, [r0] + bl sub_8179FEC + ldr r0, _08179F18 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _08179F1C + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179F14: .4byte 0x0203ce7c +_08179F18: .4byte 0x0203bd1c +_08179F1C: .4byte 0x0203bd18 +_08179F20: + bl reset_temp_tile_data_buffers + ldr r1, _08179F3C + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, _08179F40 + ldr r1, [r0] + b _08179F5E + .align 2, 0 +_08179F3C: .4byte 0x08d7c440 +_08179F40: .4byte 0x0203bd18 +_08179F44: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08179FA0 + ldr r0, _08179F6C + ldr r4, _08179F70 + ldr r1, [r4] + adds r1, 0x48 + bl call_LZZUnCompWram + ldr r1, [r4] +_08179F5E: + ldr r0, _08179F74 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08179FA0 + .align 2, 0 +_08179F6C: .4byte 0x08d9ba44 +_08179F70: .4byte 0x0203bd18 +_08179F74: .4byte 0x0000107e +_08179F78: + ldr r0, _08179F94 + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + ldr r0, _08179F98 + ldr r0, [r0] + ldr r1, _08179F9C + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _08179FA2 + .align 2, 0 +_08179F94: .4byte 0x08d7c9ec +_08179F98: .4byte 0x0203bd18 +_08179F9C: .4byte 0x0000107e +_08179FA0: + movs r0, 0 +_08179FA2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8179DF4 + + thumb_func_start sub_8179FAC +sub_8179FAC: @ 8179FAC + push {lr} + ldr r0, _08179FE4 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + ldr r0, _08179FE8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + .align 2, 0 +_08179FE4: .4byte 0x085f0558 +_08179FE8: .4byte 0x0860f074 + thumb_func_end sub_8179FAC + + thumb_func_start sub_8179FEC +sub_8179FEC: @ 8179FEC + push {lr} + lsls r0, 24 + ldr r1, _0817A01C + lsrs r0, 21 + ldr r2, _0817A020 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + movs r1, 0 + bl sub_8136F9C + lsls r0, 24 + ldr r2, _0817A024 + ldr r1, _0817A028 + lsrs r0, 22 + subs r0, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, _0817A02C + strh r0, [r2, 0x4] + pop {r0} + bx r0 + .align 2, 0 +_0817A01C: .4byte 0x03005d8c +_0817A020: .4byte 0x00000848 +_0817A024: .4byte 0x0203bd1c +_0817A028: .4byte 0x085f0568 +_0817A02C: .4byte 0x000039e2 + thumb_func_end sub_8179FEC + + thumb_func_start sub_817A030 +sub_817A030: @ 817A030 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817A068 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0817A044 + b _0817A154 +_0817A044: + ldr r0, _0817A06C + lsls r2, r4, 2 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x8 + ldrsh r3, [r1, r0] + ldr r0, _0817A070 + adds r5, r2, 0 + cmp r3, r0 + beq _0817A0C8 + cmp r3, r0 + bgt _0817A074 + cmp r3, 0 + beq _0817A088 + cmp r3, 0xFF + beq _0817A0AC + b _0817A104 + .align 2, 0 +_0817A068: .4byte 0x02037fd4 +_0817A06C: .4byte 0x03005e00 +_0817A070: .4byte 0x0000010d +_0817A074: + ldr r0, _0817A084 + cmp r3, r0 + beq _0817A0E0 + adds r0, 0x10 + cmp r3, r0 + beq _0817A0F8 + b _0817A104 + .align 2, 0 +_0817A084: .4byte 0x00000119 +_0817A088: + ldr r0, _0817A0A0 + ldr r1, [r0] + ldr r2, _0817A0A4 + adds r1, r2 + strb r3, [r1] + ldr r0, [r0] + ldr r1, _0817A0A8 + adds r0, r1 + strh r3, [r0] + bl sub_817A5CC + b _0817A104 + .align 2, 0 +_0817A0A0: .4byte 0x0203bd18 +_0817A0A4: .4byte 0x00001050 +_0817A0A8: .4byte 0x00001058 +_0817A0AC: + ldr r0, _0817A0C0 + ldr r0, [r0] + ldr r2, _0817A0C4 + adds r0, r2 + ldrb r0, [r0] + ldrb r1, [r1, 0xA] + bl sub_817A4F8 + b _0817A104 + .align 2, 0 +_0817A0C0: .4byte 0x0203bd18 +_0817A0C4: .4byte 0x0000105e +_0817A0C8: + bl sub_817A56C + ldr r1, _0817A0D8 + ldr r1, [r1] + ldr r2, _0817A0DC + adds r1, r2 + strb r0, [r1] + b _0817A104 + .align 2, 0 +_0817A0D8: .4byte 0x0203bd18 +_0817A0DC: .4byte 0x0000105f +_0817A0E0: + ldr r0, _0817A0F0 + ldr r0, [r0] + ldr r1, _0817A0F4 + adds r0, r1 + ldrb r0, [r0] + bl sub_817A434 + b _0817A104 + .align 2, 0 +_0817A0F0: .4byte 0x0203bd18 +_0817A0F4: .4byte 0x0000105d +_0817A0F8: + ldr r0, _0817A100 + str r0, [r1] + b _0817A154 + .align 2, 0 +_0817A100: .4byte sub_817A1C4 + 1 +_0817A104: + ldr r0, _0817A120 + ldr r0, [r0] + ldr r2, _0817A124 + adds r1, r0, r2 + subs r2, 0x2 + adds r0, r2 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bcs _0817A128 + bl sub_817A634 + b _0817A138 + .align 2, 0 +_0817A120: .4byte 0x0203bd18 +_0817A124: .4byte 0x00001058 +_0817A128: + cmp r1, r0 + bne _0817A138 + ldr r0, _0817A15C + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0xFE + strh r0, [r1, 0x8] +_0817A138: + ldr r0, _0817A160 + ldr r1, [r0] + ldr r0, _0817A164 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r0, _0817A15C + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0817A154: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817A15C: .4byte 0x03005e00 +_0817A160: .4byte 0x0203bd18 +_0817A164: .4byte 0x00001058 + thumb_func_end sub_817A030 + + thumb_func_start sub_817A168 +sub_817A168: @ 817A168 + push {lr} + ldr r0, _0817A18C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817A190 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x1 + strh r0, [r1, 0xA] + pop {r0} + bx r0 + .align 2, 0 +_0817A18C: .4byte sub_817A030 + 1 +_0817A190: .4byte 0x03005e00 + thumb_func_end sub_817A168 + + thumb_func_start sub_817A194 +sub_817A194: @ 817A194 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl sub_8121F20 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _0817A1B6 + ldr r0, _0817A1BC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _0817A1C0 + str r0, [r1] +_0817A1B6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817A1BC: .4byte 0x03005e00 +_0817A1C0: .4byte sub_817A320 + 1 + thumb_func_end sub_817A194 + + thumb_func_start sub_817A1C4 +sub_817A1C4: @ 817A1C4 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0817A220 + ldrb r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, _0817A224 + adds r5, r0 + ldr r1, _0817A228 + ldr r0, _0817A22C + ldrh r0, [r0] + lsls r0, 3 + ldr r2, _0817A230 + adds r0, r2 + ldr r4, [r1] + adds r4, r0 + adds r0, r5, 0 + bl get_nature + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_8136FE4 + ldr r6, _0817A234 + strh r0, [r6] + ldr r1, _0817A238 + adds r0, r5, 0 + bl sub_81B1B44 + ldr r1, _0817A23C + adds r0, r4, 0 + bl sub_8137044 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0817A248 + ldr r0, _0817A240 + ldr r1, _0817A244 + bl ExpandTextCodes + b _0817A268 + .align 2, 0 +_0817A220: .4byte 0x0203bc9c +_0817A224: .4byte 0x020244ec +_0817A228: .4byte 0x03005d8c +_0817A22C: .4byte 0x0203ce7c +_0817A230: .4byte 0x00000848 +_0817A234: .4byte 0x0203bc9e +_0817A238: .4byte 0x02021cc4 +_0817A23C: .4byte 0x02021dc4 +_0817A240: .4byte 0x02021fc4 +_0817A244: .4byte 0x085e937f +_0817A248: + cmp r0, 0 + ble _0817A260 + ldr r0, _0817A258 + ldr r1, _0817A25C + bl ExpandTextCodes + b _0817A268 + .align 2, 0 +_0817A258: .4byte 0x02021fc4 +_0817A25C: .4byte 0x085e9390 +_0817A260: + ldr r0, _0817A2AC + ldr r1, _0817A2B0 + bl ExpandTextCodes +_0817A268: + ldr r2, _0817A2B4 + 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 + ldr r2, _0817A2AC + 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 + bl text_box_related_one + ldr r1, _0817A2B8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _0817A2BC + str r1, [r0] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817A2AC: .4byte 0x02021fc4 +_0817A2B0: .4byte 0x085e93a9 +_0817A2B4: .4byte 0x03003014 +_0817A2B8: .4byte 0x03005e00 +_0817A2BC: .4byte sub_817A194 + 1 + thumb_func_end sub_817A1C4 + + thumb_func_start sub_817A2C0 +sub_817A2C0: @ 817A2C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817A30C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817A304 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _0817A310 + ldr r1, _0817A314 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, _0817A318 + ldr r0, [r0, 0x8] + bl set_callback2 + adds r0, r4, 0 + bl remove_task + bl Window_FreeMemory + ldr r0, _0817A31C + ldr r0, [r0] + bl free + bl sub_805F094 +_0817A304: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817A30C: .4byte 0x02037fd4 +_0817A310: .4byte 0x03007420 +_0817A314: .4byte 0x0000ffff +_0817A318: .4byte 0x030022c0 +_0817A31C: .4byte 0x0203bd18 + thumb_func_end sub_817A2C0 + + thumb_func_start sub_817A320 +sub_817A320: @ 817A320 + 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 sub_80A1AD4 + ldr r1, _0817A350 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0817A354 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817A350: .4byte 0x03005e00 +_0817A354: .4byte sub_817A2C0 + 1 + thumb_func_end sub_817A320 + + thumb_func_start sub_817A358 +sub_817A358: @ 817A358 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0817A410 + movs r1, 0x30 + movs r2, 0x50 + movs r3, 0x2 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _0817A414 + mov r9, r0 + ldr r0, [r0] + ldr r2, _0817A418 + adds r1, r0, r2 + strh r4, [r1] + ldr r1, _0817A41C + adds r0, r1 + mov r2, r8 + strb r2, [r0] + adds r0, r5, 0 + bl get_nature + mov r2, r9 + ldr r1, [r2] + ldr r2, _0817A420 + adds r1, r2 + strb r0, [r1] + ldr r7, _0817A424 + mov r1, r8 + lsls r0, r1, 4 + add r0, r8 + lsls r5, r0, 2 + adds r6, r5, r7 + strh r4, [r6, 0x32] + adds r0, r7, 0 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, _0817A428 + str r1, [r0] + mov r2, r9 + ldr r0, [r2] + ldr r1, _0817A42C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + adds r0, r4, 0 + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0817A402 + adds r0, r7, 0 + adds r0, 0x10 + adds r0, r5, r0 + ldr r1, _0817A430 + str r1, [r0] + ldrb r3, [r6, 0x1] + movs r0, 0x3 + orrs r3, r0 + strb r3, [r6, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r6, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r6, 0 + bl oam_center + mov r2, r9 + ldr r0, [r2] + ldr r1, _0817A42C + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0817A402: + mov r0, r8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0817A410: .4byte 0x0202499c +_0817A414: .4byte 0x0203bd18 +_0817A418: .4byte 0x00001054 +_0817A41C: .4byte 0x0000105b +_0817A420: .4byte 0x0000105a +_0817A424: .4byte 0x02020630 +_0817A428: .4byte nullsub_12 + 1 +_0817A42C: .4byte 0x00001053 +_0817A430: .4byte 0x085f05b0 + thumb_func_end sub_817A358 + + thumb_func_start sub_817A434 +sub_817A434: @ 817A434 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0817A45C + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r3 + movs r0, 0x30 + strh r0, [r2, 0x20] + movs r0, 0x50 + strh r0, [r2, 0x22] + ldr r0, _0817A460 + strh r0, [r2, 0x2E] + movs r0, 0x1 + strh r0, [r2, 0x30] + adds r3, 0x1C + adds r1, r3 + ldr r0, _0817A464 + str r0, [r1] + bx lr + .align 2, 0 +_0817A45C: .4byte 0x02020630 +_0817A460: .4byte 0x0000fff8 +_0817A464: .4byte sub_817A468 + 1 + thumb_func_end sub_817A434 + + thumb_func_start sub_817A468 +sub_817A468: @ 817A468 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x2E] + ldrh r2, [r4, 0x22] + adds r1, r0, r2 + strh r1, [r4, 0x22] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0817A48E + ldrh r0, [r4, 0x32] + movs r1, 0 + bl cry_related +_0817A48E: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bne _0817A49A + ldr r0, _0817A4A0 + str r0, [r4, 0x1C] +_0817A49A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817A4A0: .4byte nullsub_12 + 1 + thumb_func_end sub_817A468 + + thumb_func_start sub_817A4A4 +sub_817A4A4: @ 817A4A4 + push {r4,r5,lr} + movs r0, 0xBC + movs r1, 0x64 + movs r2, 0x2 + bl sub_8136444 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0817A4EC + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r0, r3, r5 + ldrb r2, [r0, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] + adds r1, r5, 0 + adds r1, 0x10 + adds r1, r3, r1 + ldr r2, _0817A4F0 + str r2, [r1] + adds r5, 0x1C + adds r3, r5 + ldr r1, _0817A4F4 + str r1, [r3] + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0817A4EC: .4byte 0x02020630 +_0817A4F0: .4byte 0x085f0664 +_0817A4F4: .4byte nullsub_12 + 1 + thumb_func_end sub_817A4A4 + + thumb_func_start sub_817A4F8 +sub_817A4F8: @ 817A4F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _0817A538 + mov r8, r0 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + mov r0, r8 + adds r4, r6, r0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + cmp r5, 0 + bne _0817A540 + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, _0817A53C + b _0817A548 + .align 2, 0 +_0817A538: .4byte 0x02020630 +_0817A53C: .4byte 0x085f0668 +_0817A540: + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, _0817A564 +_0817A548: + str r1, [r0] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _0817A568 + adds r0, r1 + bl obj_alloc_rotscale_entry + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817A564: .4byte 0x085f066c +_0817A568: .4byte 0x02020630 + thumb_func_end sub_817A4F8 + + thumb_func_start sub_817A56C +sub_817A56C: @ 817A56C + push {lr} + ldr r0, _0817A594 + movs r1, 0xAE + movs r2, 0x54 + movs r3, 0x1 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817A598 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r2, _0817A59C + strh r2, [r1, 0x2E] + movs r2, 0x1 + strh r2, [r1, 0x30] + pop {r1} + bx r1 + .align 2, 0 +_0817A594: .4byte 0x085f06a8 +_0817A598: .4byte 0x02020630 +_0817A59C: .4byte 0x0000fff4 + thumb_func_end sub_817A56C + + thumb_func_start sub_817A5A0 +sub_817A5A0: @ 817A5A0 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + subs r0, 0x4 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x2E] + ldrh r3, [r2, 0x22] + adds r1, r0, r3 + strh r1, [r2, 0x22] + ldrh r1, [r2, 0x30] + adds r0, r1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0817A5C6 + adds r0, r2, 0 + bl obj_delete_and_free_tiles +_0817A5C6: + pop {r0} + bx r0 + thumb_func_end sub_817A5A0 + + thumb_func_start sub_817A5CC +sub_817A5CC: @ 817A5CC + push {r4-r7,lr} + ldr r0, _0817A620 + ldr r1, [r0] + ldr r0, _0817A624 + adds r3, r1, r0 + movs r0, 0x1 + strh r0, [r3] + ldr r2, _0817A628 + ldr r7, _0817A62C + adds r1, r7 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrb r2, [r0] + movs r4, 0 + ldr r5, _0817A630 + adds r6, r5, 0 + subs r6, 0xA +_0817A5F0: + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, r1, r6 + ldrh r0, [r0] + ldrh r7, [r3] + adds r0, r7 + strh r0, [r3] + adds r1, r5 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0x1 + beq _0817A61A + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0x7 + bls _0817A5F0 +_0817A61A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817A620: .4byte 0x0203bd18 +_0817A624: .4byte 0x00001056 +_0817A628: .4byte 0x085efebc +_0817A62C: .4byte 0x0000105a +_0817A630: .4byte 0x085eff00 + thumb_func_end sub_817A5CC + + thumb_func_start sub_817A634 +sub_817A634: @ 817A634 + push {r4,lr} + ldr r0, _0817A650 + ldr r4, [r0] + ldr r1, _0817A654 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0x5A + bls _0817A646 + b _0817A90E +_0817A646: + lsls r0, 2 + ldr r1, _0817A658 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817A650: .4byte 0x0203bd18 +_0817A654: .4byte 0x00001050 +_0817A658: .4byte _0817A65C + .align 2, 0 +_0817A65C: + .4byte _0817A7C8 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A818 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A858 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A8A2 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A8FC + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E +_0817A7C8: + ldr r1, _0817A800 + ldr r2, _0817A804 + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r1, [r0] + ldr r3, _0817A808 + adds r0, r4, r3 + strb r1, [r0] + ldr r1, _0817A80C + adds r0, r4, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _0817A810 + adds r1, r0 + adds r0, r4, 0 + stm r0!, {r1} + movs r2, 0x44 + bl memcpy + ldr r2, _0817A814 + adds r1, r4, r2 + movs r0, 0xA + strb r0, [r1] + b _0817A90E + .align 2, 0 +_0817A800: .4byte 0x085efebc +_0817A804: .4byte 0x0000105a +_0817A808: .4byte 0x00001051 +_0817A80C: .4byte 0x0000105b +_0817A810: .4byte 0x02020630 +_0817A814: .4byte 0x00001050 +_0817A818: + bl sub_817A91C + ldr r1, _0817A884 + ldr r3, _0817A888 + adds r0, r4, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0817A850 + ldr r2, [r4] + ldrb r0, [r2, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r0, [r4] + ldr r1, _0817A88C + str r1, [r0, 0x10] + bl obj_alloc_rotscale_entry +_0817A850: + ldr r0, _0817A890 + adds r1, r4, r0 + movs r0, 0x32 + strb r0, [r1] +_0817A858: + ldr r1, _0817A884 + ldr r2, _0817A888 + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x1 + adds r2, r0, r1 + ldrb r1, [r2] + cmp r1, 0 + beq _0817A8C8 + ldr r3, _0817A894 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0817A898 + ldr r0, [r4] + adds r1, 0xA + lsls r1, 24 + lsrs r1, 24 + bl sub_8008258 + b _0817A8C8 + .align 2, 0 +_0817A884: .4byte 0x085efebc +_0817A888: .4byte 0x0000105a +_0817A88C: .4byte 0x085f04fc +_0817A890: .4byte 0x00001050 +_0817A894: .4byte 0x00001053 +_0817A898: + ldr r0, [r4] + ldrb r1, [r2] + bl sub_8008258 + b _0817A8C8 +_0817A8A2: + bl sub_817A9E4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0817A90E + ldr r1, _0817A8D4 + adds r0, r4, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0817A8E0 + ldr r3, _0817A8D8 + adds r1, r4, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_817A91C +_0817A8C8: + ldr r0, _0817A8DC + adds r1, r4, r0 + movs r0, 0x3C + strb r0, [r1] + b _0817A90E + .align 2, 0 +_0817A8D4: .4byte 0x00001072 +_0817A8D8: .4byte 0x00001051 +_0817A8DC: .4byte 0x00001050 +_0817A8E0: + ldr r0, [r4] + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r2, _0817A8F8 + adds r1, r4, r2 + movs r0, 0x46 + strb r0, [r1] + b _0817A90E + .align 2, 0 +_0817A8F8: .4byte 0x00001050 +_0817A8FC: + bl sub_817AA3C + ldr r3, _0817A914 + adds r0, r4, r3 + movs r1, 0 + strb r1, [r0] + ldr r2, _0817A918 + adds r0, r4, r2 + strb r1, [r0] +_0817A90E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817A914: .4byte 0x00001051 +_0817A918: .4byte 0x00001050 + thumb_func_end sub_817A634 + + thumb_func_start sub_817A91C +sub_817A91C: @ 817A91C + push {r4-r7,lr} + ldr r0, _0817A9C0 + ldr r5, [r0] + movs r4, 0 + movs r0, 0x83 + lsls r0, 5 + adds r7, r5, r0 + ldr r1, _0817A9C4 + mov r12, r1 + ldr r2, _0817A9C8 + adds r6, r5, r2 +_0817A932: + lsls r2, r4, 1 + adds r3, r7, r2 + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + add r2, r12 + ldrh r0, [r2] + strh r0, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _0817A932 + ldr r0, _0817A9CC + adds r6, r5, r0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0817A9DC + movs r2, 0x83 + lsls r2, 5 + adds r4, r5, r2 + movs r1, 0 + ldrsh r0, [r4, r1] + adds r2, 0x4 + adds r1, r5, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sine + ldr r2, _0817A9D0 + adds r1, r5, r2 + strh r0, [r1] + movs r1, 0 + ldrsh r0, [r4, r1] + subs r2, 0xE + adds r1, r5, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl cosine + ldr r2, _0817A9D4 + adds r1, r5, r2 + strh r0, [r1] + ldrh r0, [r6] + ldr r1, _0817A9D8 + adds r4, r5, r1 + strh r0, [r4] + ldr r0, [r5] + ldrh r1, [r0, 0x24] + adds r2, 0x4 + adds r0, r5, r2 + strh r1, [r0] + ldr r0, [r5] + ldrh r1, [r0, 0x26] + adds r2, 0x2 + adds r0, r5, r2 + strh r1, [r0] + bl sub_817AB68 + ldrh r0, [r4] + strh r0, [r6] + bl sub_817AA54 + ldrh r0, [r4] + strh r0, [r6] + movs r0, 0 + b _0817A9DE + .align 2, 0 +_0817A9C0: .4byte 0x0203bd18 +_0817A9C4: .4byte 0x085efeee +_0817A9C8: .4byte 0x00001051 +_0817A9CC: .4byte 0x00001068 +_0817A9D0: .4byte 0x00001074 +_0817A9D4: .4byte 0x00001076 +_0817A9D8: .4byte 0x00001078 +_0817A9DC: + movs r0, 0x1 +_0817A9DE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_817A91C + + thumb_func_start sub_817A9E4 +sub_817A9E4: @ 817A9E4 + push {r4,r5,lr} + ldr r0, _0817AA28 + ldr r2, [r0] + ldr r1, _0817AA2C + adds r0, r2, r1 + ldr r5, _0817AA30 + adds r4, r2, r5 + ldrh r1, [r0] + ldrh r0, [r4] + subs r1, r0 + lsls r1, 16 + ldr r3, [r2] + lsrs r1, 15 + movs r5, 0x85 + lsls r5, 4 + adds r0, r2, r5 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3, 0x24] + ldr r3, [r2] + movs r0, 0xC5 + lsls r0, 4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + strh r0, [r3, 0x26] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _0817AA34 + movs r0, 0 + b _0817AA36 + .align 2, 0 +_0817AA28: .4byte 0x0203bd18 +_0817AA2C: .4byte 0x00001078 +_0817AA30: .4byte 0x00001068 +_0817AA34: + movs r0, 0x1 +_0817AA36: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_817A9E4 + + thumb_func_start sub_817AA3C +sub_817AA3C: @ 817AA3C + push {lr} + ldr r0, _0817AA50 + ldr r0, [r0] + ldr r0, [r0] + bl obj_free_rotscale_entry + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0817AA50: .4byte 0x0203bd18 + thumb_func_end sub_817AA3C + + thumb_func_start sub_817AA54 +sub_817AA54: @ 817AA54 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, _0817AB54 + ldr r7, [r0] + ldr r1, _0817AB58 + adds r0, r7, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r2, _0817AB5C + adds r0, r7, r2 + ldrh r0, [r0] + mov r3, r9 + subs r0, r3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r4, _0817AB60 + adds r1, r7, r4 + subs r2, 0xC + adds r0, r7, r2 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + ldr r3, _0817AB64 + adds r1, r7, r3 + subs r4, 0xC + adds r0, r7, r4 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r5, 0 + mov r0, r8 + subs r0, 0x1 + cmp r5, r0 + bge _0817AB20 + ldr r1, [sp] + lsls r0, r1, 16 + asrs r0, 16 + str r0, [sp, 0x8] + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + asrs r0, 16 + mov r10, r0 +_0817AABE: + mov r3, r9 + adds r0, r3, r5 + lsls r0, 1 + movs r4, 0x85 + lsls r4, 4 + adds r2, r7, r4 + adds r2, r0 + ldrh r6, [r2] + ldr r3, [sp, 0x8] + subs r1, r6, r3 + movs r4, 0xC5 + lsls r4, 4 + adds r3, r7, r4 + adds r3, r0 + ldrh r4, [r3] + mov r0, r10 + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r5, 0x1 + adds r0, r1, 0 + muls r0, r5 + mov r1, r8 + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl __divsi3 + subs r6, r0 + ldr r2, [sp, 0xC] + strh r6, [r2] + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + muls r0, r5 + mov r1, r8 + bl __divsi3 + ldr r3, [sp, 0x10] + ldrh r1, [r3] + subs r1, r0 + strh r1, [r3] + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + subs r0, 0x1 + cmp r5, r0 + blt _0817AABE +_0817AB20: + mov r0, r9 + add r0, r8 + subs r0, 0x1 + lsls r0, 1 + movs r2, 0x85 + lsls r2, 4 + adds r1, r7, r2 + adds r1, r0 + mov r3, sp + ldrh r3, [r3] + strh r3, [r1] + movs r4, 0xC5 + lsls r4, 4 + adds r1, r7, r4 + adds r1, r0 + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r1] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817AB54: .4byte 0x0203bd18 +_0817AB58: .4byte 0x00001070 +_0817AB5C: .4byte 0x00001078 +_0817AB60: .4byte 0x0000107a +_0817AB64: .4byte 0x0000107c + thumb_func_end sub_817AA54 + + thumb_func_start sub_817AB68 +sub_817AB68: @ 817AB68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, _0817AC2C + ldr r6, [r0] + movs r0, 0 + str r0, [sp] + ldr r1, _0817AC30 + adds r0, r6, r1 + ldr r2, _0817AC34 + adds r1, r6, r2 + ldrh r2, [r0] + ldrh r0, [r1] + subs r2, r0 + ldr r3, _0817AC38 + adds r0, r6, r3 + ldr r1, _0817AC3C + adds r3, r6, r1 + ldrh r1, [r0] + ldrh r0, [r3] + subs r1, r0 + ldr r3, _0817AC40 + adds r3, r6 + mov r9, r3 + movs r0, 0x83 + lsls r0, 5 + adds r0, r6 + mov r8, r0 + lsls r2, 16 + asrs r2, 16 + str r2, [sp, 0x4] + lsls r1, 16 + asrs r1, 16 + mov r10, r1 +_0817ABB2: + ldr r1, _0817AC44 + adds r0, r6, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _0817ABC0 + negs r0, r0 +_0817ABC0: + lsls r0, 16 + ldr r3, _0817AC48 + adds r7, r6, r3 + lsrs r0, 16 + ldrh r1, [r7] + adds r0, r1 + lsls r4, r0, 16 + strh r0, [r7] + ldr r2, _0817AC4C + adds r0, r6, r2 + ldrh r2, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bge _0817ABE2 + movs r0, 0x1 + str r0, [sp] +_0817ABE2: + ldr r1, _0817AC50 + adds r0, r6, r1 + ldrh r0, [r0] + mov r3, r9 + ldrh r1, [r3] + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r1, 0 + beq _0817ACB8 + ldr r0, [sp] + cmp r0, 0 + bne _0817AC54 + mov r1, r8 + movs r3, 0 + ldrsh r0, [r1, r3] + lsrs r4, 24 + adds r1, r2, r4 + lsls r1, 16 + asrs r1, 16 + bl sine + lsls r5, 1 + movs r2, 0x85 + lsls r2, 4 + adds r1, r6, r2 + adds r1, r5 + ldr r3, [sp, 0x4] + adds r0, r3, r0 + strh r0, [r1] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + ldrh r1, [r7] + adds r1, r4 + b _0817AC80 + .align 2, 0 +_0817AC2C: .4byte 0x0203bd18 +_0817AC30: .4byte 0x0000107a +_0817AC34: .4byte 0x00001074 +_0817AC38: .4byte 0x0000107c +_0817AC3C: .4byte 0x00001076 +_0817AC40: .4byte 0x00001068 +_0817AC44: .4byte 0x0000106a +_0817AC48: .4byte 0x00001066 +_0817AC4C: .4byte 0x00001064 +_0817AC50: .4byte 0x00001078 +_0817AC54: + mov r1, r8 + movs r3, 0 + ldrsh r0, [r1, r3] + lsrs r4, 24 + subs r1, r2, r4 + lsls r1, 16 + asrs r1, 16 + bl sine + lsls r5, 1 + movs r2, 0x85 + lsls r2, 4 + adds r1, r6, r2 + adds r1, r5 + ldr r3, [sp, 0x4] + adds r0, r3, r0 + strh r0, [r1] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + ldrh r1, [r7] + subs r1, r4 +_0817AC80: + lsls r1, 16 + asrs r1, 16 + bl cosine + movs r3, 0xC5 + lsls r3, 4 + adds r1, r6, r3 + adds r1, r5 + add r0, r10 + strh r0, [r1] + ldr r1, _0817ACB4 + adds r0, r6, r1 + ldrh r0, [r0] + mov r2, r8 + ldrh r2, [r2] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + mov r3, r8 + strh r0, [r3] + mov r1, r9 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + b _0817ABB2 + .align 2, 0 +_0817ACB4: .4byte 0x00001062 +_0817ACB8: + 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_817AB68 + + thumb_func_start c2_clear_save_data_screen_2 +c2_clear_save_data_screen_2: @ 817ACC8 + push {lr} + bl sub_817AE00 + lsls r0, 24 + cmp r0, 0 + beq _0817ACDC + ldr r0, _0817ACE0 + movs r1, 0 + bl AddTask +_0817ACDC: + pop {r0} + bx r0 + .align 2, 0 +_0817ACE0: .4byte sub_817ACE4 + 1 + thumb_func_end c2_clear_save_data_screen_2 + + thumb_func_start sub_817ACE4 +sub_817ACE4: @ 817ACE4 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, _0817AD30 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, _0817AD34 + movs r1, 0x2 + movs r2, 0xE + movs r3, 0x1 + bl sub_81996C0 + ldr r1, _0817AD38 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _0817AD3C + str r1, [r0] + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817AD30: .4byte 0x085efa8f +_0817AD34: .4byte 0x085f06d8 +_0817AD38: .4byte 0x03005e00 +_0817AD3C: .4byte sub_817AD40 + 1 + thumb_func_end sub_817ACE4 + + thumb_func_start sub_817AD40 +sub_817AD40: @ 817AD40 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _0817AD68 + cmp r4, 0 + bgt _0817AD62 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0817ADA0 + b _0817ADB2 +_0817AD62: + cmp r4, 0x1 + beq _0817ADA0 + b _0817ADB2 +_0817AD68: + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _0817AD94 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r1, _0817AD98 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _0817AD9C + str r1, [r0] + b _0817ADB2 + .align 2, 0 +_0817AD94: .4byte 0x085efaaa +_0817AD98: .4byte 0x03005e00 +_0817AD9C: .4byte sub_817ADC0 + 1 +_0817ADA0: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl remove_task + ldr r0, _0817ADBC + bl set_callback2 +_0817ADB2: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817ADBC: .4byte sub_817AFD4 + 1 + thumb_func_end sub_817AD40 + + thumb_func_start sub_817ADC0 +sub_817ADC0: @ 817ADC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl calls_flash_erase_block + adds r0, r4, 0 + bl remove_task + ldr r0, _0817ADE0 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817ADE0: .4byte sub_817AFD4 + 1 + thumb_func_end sub_817ADC0 + + thumb_func_start sub_817ADE4 +sub_817ADE4: @ 817ADE4 + push {lr} + bl run_active_tasks + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_817ADE4 + + thumb_func_start sub_817ADF4 +sub_817ADF4: @ 817ADF4 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_817ADF4 + + thumb_func_start sub_817AE00 +sub_817AE00: @ 817AE00 + push {r4,lr} + sub sp, 0xC + ldr r0, _0817AF60 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0817AE18 + cmp r0, 0x1 + bne _0817AE18 + b _0817AFA4 +_0817AE18: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x1C + movs r1, 0 + bl lcd_io_set + movs r0, 0x1E + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + add r0, sp, 0x4 + movs r4, 0 + strh r4, [r0] + ldr r1, _0817AF64 + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _0817AF68 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, _0817AF6C + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0x4 + strh r2, [r0] + str r0, [r1] + ldr r0, _0817AF70 + str r0, [r1, 0x4] + ldr r0, _0817AF74 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + ldr r2, _0817AF78 + ldr r0, _0817AF7C + strh r0, [r2] + ldr r1, _0817AF80 + strh r0, [r1] + ldr r0, _0817AF84 + strh r0, [r2, 0x2] + strh r0, [r1, 0x2] + movs r1, 0 + ldr r3, _0817AF88 + ldr r0, _0817AF8C + adds r2, r0, 0 +_0817AED4: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0817AED4 + movs r1, 0 + ldr r4, _0817AF90 + movs r3, 0x1 + ldr r2, _0817AF94 +_0817AEEC: + lsls r0, r1, 1 + adds r0, r4 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _0817AEEC + bl clear_tasks + bl reset_all_obj_data + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0817AF98 + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + bl sub_817B02C + ldr r0, _0817AF9C + str r0, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r0, 0x1 + bl enable_irqs + ldr r0, _0817AFA0 + bl SetVBlankCallback + ldr r0, _0817AF60 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _0817AFC8 + .align 2, 0 +_0817AF60: .4byte 0x030022c0 +_0817AF64: .4byte 0x040000d4 +_0817AF68: .4byte 0x8100c000 +_0817AF6C: .4byte 0x85000100 +_0817AF70: .4byte 0x05000002 +_0817AF74: .4byte 0x810001ff +_0817AF78: .4byte 0x02037714 +_0817AF7C: .4byte 0x00007fff +_0817AF80: .4byte 0x02037b14 +_0817AF84: .4byte 0x00003945 +_0817AF88: .4byte 0x06000020 +_0817AF8C: .4byte 0x00001111 +_0817AF90: .4byte 0x0600f000 +_0817AF94: .4byte 0x000003ff +_0817AF98: .4byte 0x085f06c0 +_0817AF9C: .4byte 0x0000ffff +_0817AFA0: .4byte sub_817ADF4 + 1 +_0817AFA4: + bl fade_and_return_progress_probably + ldr r0, _0817AFC0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817AFC8 + ldr r0, _0817AFC4 + bl set_callback2 + movs r0, 0x1 + b _0817AFCA + .align 2, 0 +_0817AFC0: .4byte 0x02037fd4 +_0817AFC4: .4byte sub_817ADE4 + 1 +_0817AFC8: + movs r0, 0 +_0817AFCA: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_817AE00 + + thumb_func_start sub_817AFD4 +sub_817AFD4: @ 817AFD4 + push {r4,lr} + sub sp, 0x4 + ldr r0, _0817B000 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _0817AFEA + cmp r0, 0x1 + beq _0817B008 +_0817AFEA: + ldr r0, _0817B004 + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x1 + strb r0, [r4] + b _0817B020 + .align 2, 0 +_0817B000: .4byte 0x030022c0 +_0817B004: .4byte 0x0000ffff +_0817B008: + bl fade_and_return_progress_probably + ldr r0, _0817B028 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B020 + bl Window_FreeMemory + bl do_reset +_0817B020: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817B028: .4byte 0x02037fd4 + thumb_func_end sub_817AFD4 + + thumb_func_start sub_817B02C +sub_817B02C: @ 817B02C + push {lr} + ldr r0, _0817B05C + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0xE0 + bl sub_80987D4 + ldr r0, _0817B060 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0817B05C: .4byte 0x085f06c8 +_0817B060: .4byte 0x0860f074 + thumb_func_end sub_817B02C + + thumb_func_start load_intro_part2_graphics +load_intro_part2_graphics: @ 817B064 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817B0C0 + ldr r1, _0817B0C4 + bl LZ77UnCompVram + ldr r0, _0817B0C8 + ldr r1, _0817B0CC + bl LZ77UnCompVram + ldr r0, _0817B0D0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + cmp r4, 0 + beq _0817B08C + cmp r4, 0x1 + beq _0817B0EC +_0817B08C: + ldr r0, _0817B0D4 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0817B0D8 + ldr r1, _0817B0DC + bl LZ77UnCompVram + ldr r0, _0817B0E0 + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, _0817B0E4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0817B0E8 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B76C + b _0817B11E + .align 2, 0 +_0817B0C0: .4byte 0x085f0740 +_0817B0C4: .4byte 0x06004000 +_0817B0C8: .4byte 0x085f0bc0 +_0817B0CC: .4byte 0x06007800 +_0817B0D0: .4byte 0x085f06e0 +_0817B0D4: .4byte 0x085f0dbc +_0817B0D8: .4byte 0x085f1398 +_0817B0DC: .4byte 0x06003000 +_0817B0E0: .4byte 0x085f0cfc +_0817B0E4: .4byte 0x085f5064 +_0817B0E8: .4byte 0x085f1668 +_0817B0EC: + ldr r0, _0817B130 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0817B134 + ldr r1, _0817B138 + bl LZ77UnCompVram + ldr r0, _0817B13C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817B140 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0817B144 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B788 +_0817B11E: + ldr r1, _0817B148 + movs r0, 0 + strh r0, [r1] + ldr r1, _0817B14C + movs r0, 0x8 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817B130: .4byte 0x085f1824 +_0817B134: .4byte 0x085f1eac +_0817B138: .4byte 0x06003000 +_0817B13C: .4byte 0x085f17e4 +_0817B140: .4byte 0x085f50ec +_0817B144: .4byte 0x085f21b0 +_0817B148: .4byte 0x0203bd28 +_0817B14C: .4byte 0x0300301c + thumb_func_end load_intro_part2_graphics + + thumb_func_start sub_817B150 +sub_817B150: @ 817B150 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817B162 + cmp r0, 0x1 + ble _0817B162 + cmp r0, 0x2 + beq _0817B194 +_0817B162: + ldr r1, _0817B188 + movs r0, 0xE + bl lcd_io_set + ldr r1, _0817B18C + movs r0, 0xC + bl lcd_io_set + ldr r1, _0817B190 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xF2 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + b _0817B1B6 + .align 2, 0 +_0817B188: .4byte 0x00000603 +_0817B18C: .4byte 0x00000702 +_0817B190: .4byte 0x00000f05 +_0817B194: + ldr r1, _0817B1BC + movs r0, 0xE + bl lcd_io_set + ldr r1, _0817B1C0 + movs r0, 0xC + bl lcd_io_set + ldr r1, _0817B1C4 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xF2 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set +_0817B1B6: + pop {r0} + bx r0 + .align 2, 0 +_0817B1BC: .4byte 0x00000603 +_0817B1C0: .4byte 0x00000702 +_0817B1C4: .4byte 0x00000f05 + thumb_func_end sub_817B150 + + thumb_func_start sub_817B1C8 +sub_817B1C8: @ 817B1C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817B1EC + ldr r1, _0817B1F0 + bl LZ77UnCompVram + ldr r0, _0817B1F4 + ldr r1, _0817B1F8 + bl LZ77UnCompVram + cmp r4, 0x4 + bhi _0817B214 + lsls r0, r4, 2 + ldr r1, _0817B1FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817B1EC: .4byte 0x085f0740 +_0817B1F0: .4byte 0x06004000 +_0817B1F4: .4byte 0x085f0bc0 +_0817B1F8: .4byte 0x06007800 +_0817B1FC: .4byte _0817B200 + .align 2, 0 +_0817B200: + .4byte _0817B214 + .4byte _0817B270 + .4byte _0817B2DC + .4byte _0817B2DC + .4byte _0817B334 +_0817B214: + ldr r0, _0817B24C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817B250 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0817B254 + ldr r1, _0817B258 + bl LZ77UnCompVram + ldr r0, _0817B25C + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, _0817B260 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0817B264 + ldr r1, _0817B268 + bl LZ77UnCompVram + ldr r0, _0817B26C + b _0817B2A6 + .align 2, 0 +_0817B24C: .4byte 0x085f06e0 +_0817B250: .4byte 0x085f0dbc +_0817B254: .4byte 0x085f1398 +_0817B258: .4byte 0x06003000 +_0817B25C: .4byte 0x085f0cfc +_0817B260: .4byte 0x085f5064 +_0817B264: .4byte 0x085f16a8 +_0817B268: .4byte 0x06010000 +_0817B26C: .4byte 0x085f1668 +_0817B270: + ldr r0, _0817B2B8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817B2BC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0817B2C0 + ldr r1, _0817B2C4 + bl LZ77UnCompVram + ldr r0, _0817B2C8 + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, _0817B2CC + bl gpu_tile_obj_decompress_and_load + ldr r0, _0817B2D0 + ldr r1, _0817B2D4 + bl LZ77UnCompVram + ldr r0, _0817B2D8 +_0817B2A6: + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B76C + b _0817B370 + .align 2, 0 +_0817B2B8: .4byte 0x085f0700 +_0817B2BC: .4byte 0x085f0dbc +_0817B2C0: .4byte 0x085f1398 +_0817B2C4: .4byte 0x06003000 +_0817B2C8: .4byte 0x085f0d5c +_0817B2CC: .4byte 0x085f5064 +_0817B2D0: .4byte 0x085f16a8 +_0817B2D4: .4byte 0x06010000 +_0817B2D8: .4byte 0x085f1688 +_0817B2DC: + ldr r0, _0817B31C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817B320 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0817B324 + ldr r1, _0817B328 + bl LZ77UnCompVram + ldr r4, _0817B32C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817B330 + bl gpu_tile_obj_decompress_and_load + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B788 + b _0817B370 + .align 2, 0 +_0817B31C: .4byte 0x085f0700 +_0817B320: .4byte 0x085f1824 +_0817B324: .4byte 0x085f1eac +_0817B328: .4byte 0x06003000 +_0817B32C: .4byte 0x085f1804 +_0817B330: .4byte 0x085f50ec +_0817B334: + ldr r0, _0817B384 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0817B388 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, _0817B38C + ldr r1, _0817B390 + bl LZ77UnCompVram + ldr r0, _0817B394 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, _0817B398 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0817B39C + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B7A4 +_0817B370: + ldr r1, _0817B3A0 + movs r0, 0x8 + strb r0, [r1] + ldr r1, _0817B3A4 + movs r0, 0 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817B384: .4byte 0x085f0720 +_0817B388: .4byte 0x085f235c +_0817B38C: .4byte 0x085f2568 +_0817B390: .4byte 0x06003000 +_0817B394: .4byte 0x085f231c +_0817B398: .4byte 0x085f5180 +_0817B39C: .4byte 0x085f2548 +_0817B3A0: .4byte 0x0300301c +_0817B3A4: .4byte 0x0203bd28 + thumb_func_end sub_817B1C8 + + thumb_func_start sub_817B3A8 +sub_817B3A8: @ 817B3A8 + push {lr} + ldr r1, _0817B3D0 + movs r0, 0xE + bl lcd_io_set + ldr r1, _0817B3D4 + movs r0, 0xC + bl lcd_io_set + ldr r1, _0817B3D8 + movs r0, 0xA + bl lcd_io_set + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_0817B3D0: .4byte 0x00000603 +_0817B3D4: .4byte 0x00000702 +_0817B3D8: .4byte 0x00000f05 + thumb_func_end sub_817B3A8 + + thumb_func_start sub_817B3DC +sub_817B3DC: @ 817B3DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + ldr r1, _0817B450 + mov r9, r1 + mov r0, r9 + movs r1, 0 + str r3, [sp] + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _0817B454 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r5, [r0, 0x8] + strh r6, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + mov r1, r8 + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + strh r2, [r0, 0x14] + ldr r3, [sp] + strh r3, [r0, 0x16] + movs r1, 0x8 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + adds r0, r4, 0 + bl _call_via_r9 + adds r0, r4, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0817B450: .4byte sub_817B458 + 1 +_0817B454: .4byte 0x03005e00 + thumb_func_end sub_817B3DC + + thumb_func_start sub_817B458 +sub_817B458: @ 817B458 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0817B4E4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + lsls r2, r0, 16 + cmp r2, 0 + beq _0817B4A0 + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0xE] + adds r1, r0, r1 + lsrs r0, r2, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xC] + strh r1, [r4, 0xE] + ldrh r1, [r4, 0xC] + movs r0, 0x14 + bl lcd_io_set + ldr r2, _0817B4E8 + ldr r0, _0817B4EC + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x16 + bl lcd_io_set +_0817B4A0: + ldrh r0, [r4, 0x10] + lsls r2, r0, 16 + cmp r2, 0 + beq _0817B4FA + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x14] + adds r1, r0, r1 + lsrs r0, r2, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0x12] + strh r1, [r4, 0x14] + ldrh r1, [r4, 0x12] + movs r0, 0x18 + bl lcd_io_set + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0817B4F0 + ldr r2, _0817B4E8 + ldr r0, _0817B4EC + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl lcd_io_set + b _0817B4FA + .align 2, 0 +_0817B4E4: .4byte 0x03005e00 +_0817B4E8: .4byte 0x0203bd24 +_0817B4EC: .4byte 0x0203bd26 +_0817B4F0: + ldr r0, _0817B538 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set +_0817B4FA: + ldr r0, _0817B53C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r2, r1, r0 + ldrh r0, [r2, 0x16] + lsls r3, r0, 16 + cmp r3, 0 + beq _0817B532 + movs r1, 0x18 + ldrsh r0, [r2, r1] + lsls r0, 16 + ldrh r1, [r2, 0x1A] + adds r1, r0, r1 + lsrs r0, r3, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r2, 0x18] + strh r1, [r2, 0x1A] + ldrh r1, [r2, 0x18] + movs r0, 0x1C + bl lcd_io_set + ldr r0, _0817B538 + ldrh r1, [r0] + movs r0, 0x1E + bl lcd_io_set +_0817B532: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817B538: .4byte 0x0203bd24 +_0817B53C: .4byte 0x03005e00 + thumb_func_end sub_817B458 + + thumb_func_start sub_817B540 +sub_817B540: @ 817B540 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817B620 + cmp r0, 0x1 + ble _0817B554 + cmp r0, 0x2 + beq _0817B5B8 +_0817B554: + ldr r0, _0817B580 + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, _0817B584 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B620 + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _0817B58C + ldr r2, _0817B588 + ldrh r1, [r2, 0x12] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x14] + b _0817B596 + .align 2, 0 +_0817B580: .4byte 0x030022c0 +_0817B584: .4byte 0x02037fd4 +_0817B588: .4byte 0x02037714 +_0817B58C: + ldr r2, _0817B5B4 + ldrh r1, [r2, 0x14] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x12] +_0817B596: + adds r0, 0x2 + strh r1, [r0] + adds r4, r0, 0 + mov r0, sp + movs r1, 0x9 + movs r2, 0x2 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0x2 + bl gpu_pal_apply + b _0817B620 + .align 2, 0 +_0817B5B4: .4byte 0x02037714 +_0817B5B8: + ldr r0, _0817B5E8 + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, _0817B5EC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B620 + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _0817B5F8 + mov r1, sp + ldr r2, _0817B5F0 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + ldr r2, _0817B5F4 + b _0817B606 + .align 2, 0 +_0817B5E8: .4byte 0x030022c0 +_0817B5EC: .4byte 0x02037fd4 +_0817B5F0: .4byte 0x00003d27 +_0817B5F4: .4byte 0x00000295 +_0817B5F8: + mov r1, sp + movs r2, 0xC7 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + ldr r2, _0817B628 +_0817B606: + adds r0, r2, 0 + strh r0, [r1] + adds r4, r1, 0 + mov r0, sp + movs r1, 0xC + movs r2, 0x2 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xD + movs r2, 0x2 + bl gpu_pal_apply +_0817B620: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817B628: .4byte 0x00003d27 + thumb_func_end sub_817B540 + + thumb_func_start sub_817B62C +sub_817B62C: @ 817B62C + push {lr} + adds r2, r0, 0 + ldr r0, _0817B648 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _0817B690 + cmp r0, 0 + beq _0817B64C + adds r0, r2, 0 + bl obj_delete_and_free_tiles + b _0817B690 + .align 2, 0 +_0817B648: .4byte 0x0203bd28 +_0817B64C: + movs r1, 0x20 + ldrsh r0, [r2, r1] + lsls r0, 16 + ldrh r1, [r2, 0x32] + orrs r0, r1 + ldrh r1, [r2, 0x30] + adds r0, r1 + asrs r1, r0, 16 + strh r1, [r2, 0x20] + strh r0, [r2, 0x32] + cmp r1, 0xFF + ble _0817B668 + ldr r0, _0817B67C + strh r0, [r2, 0x20] +_0817B668: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0817B688 + ldr r1, _0817B680 + ldr r0, _0817B684 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + b _0817B68C + .align 2, 0 +_0817B67C: .4byte 0x0000ffe0 +_0817B680: .4byte 0x0203bd24 +_0817B684: .4byte 0x0203bd26 +_0817B688: + ldr r0, _0817B694 + ldrh r0, [r0] +_0817B68C: + negs r0, r0 + strh r0, [r2, 0x26] +_0817B690: + pop {r0} + bx r0 + .align 2, 0 +_0817B694: .4byte 0x0203bd24 + thumb_func_end sub_817B62C + + thumb_func_start sub_817B698 +sub_817B698: @ 817B698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp, 0x4] + str r2, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r7, 0 + cmp r7, r8 + bcs _0817B74E + ldr r0, _0817B760 + mov r10, r0 + movs r2, 0x3F + mov r9, r2 +_0817B6C2: + lsls r6, r7, 3 + ldr r0, [sp, 0x4] + adds r6, r0 + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrb r3, [r6, 0x3] + ldr r0, _0817B764 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + mov r2, r10 + adds r4, r5, r2 + ldrb r2, [r6] + lsls r1, r2, 26 + lsrs r1, 30 + lsrs r2, 6 + adds r0, r4, 0 + movs r3, 0 + bl oam_center + ldrb r3, [r4, 0x5] + movs r0, 0xC + orrs r3, r0 + strb r3, [r4, 0x5] + ldrb r1, [r6] + lsls r1, 26 + lsrs r1, 30 + lsls r1, 6 + ldrb r2, [r4, 0x1] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r6] + lsrs r1, 6 + lsls r1, 6 + ldrb r2, [r4, 0x3] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + movs r0, 0xF + ands r3, r0 + strb r3, [r4, 0x5] + ldr r0, _0817B768 + adds r5, r0 + ldr r2, [sp, 0x8] + str r2, [r5] + ldrb r1, [r6] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + bl obj_anim_image_start + movs r1, 0 + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x2E] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r8 + bcc _0817B6C2 +_0817B74E: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817B760: .4byte 0x02020630 +_0817B764: .4byte 0x085f504c +_0817B768: .4byte 0x02020638 + thumb_func_end sub_817B698 + + thumb_func_start sub_817B76C +sub_817B76C: @ 817B76C + push {lr} + ldr r1, _0817B780 + ldr r2, _0817B784 + movs r0, 0 + movs r3, 0x9 + bl sub_817B698 + pop {r0} + bx r0 + .align 2, 0 +_0817B780: .4byte 0x085f50a4 +_0817B784: .4byte 0x085f5094 + thumb_func_end sub_817B76C + + thumb_func_start sub_817B788 +sub_817B788: @ 817B788 + push {lr} + ldr r1, _0817B79C + ldr r2, _0817B7A0 + movs r0, 0x1 + movs r3, 0xC + bl sub_817B698 + pop {r0} + bx r0 + .align 2, 0 +_0817B79C: .4byte 0x085f5120 +_0817B7A0: .4byte 0x085f5114 + thumb_func_end sub_817B788 + + thumb_func_start sub_817B7A4 +sub_817B7A4: @ 817B7A4 + push {lr} + ldr r1, _0817B7B8 + ldr r2, _0817B7BC + movs r0, 0x1 + movs r3, 0x6 + bl sub_817B698 + pop {r0} + bx r0 + .align 2, 0 +_0817B7B8: .4byte 0x085f519c +_0817B7BC: .4byte 0x085f5198 + thumb_func_end sub_817B7A4 + + thumb_func_start nullsub_65 +nullsub_65: @ 817B7C0 + bx lr + thumb_func_end nullsub_65 + + thumb_func_start sub_817B7C4 +sub_817B7C4: @ 817B7C4 + push {r4,lr} + ldr r4, _0817B830 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r1, [r1] + movs r2, 0x3E + adds r2, r0 + mov r12, r2 + movs r2, 0x4 + ands r2, r1 + 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, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x24] + strh r1, [r0, 0x24] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817B830: .4byte 0x02020630 + thumb_func_end sub_817B7C4 + + thumb_func_start sub_817B834 +sub_817B834: @ 817B834 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, _0817B880 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _0817B884 + adds r4, 0x8 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817B888 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strh r6, [r1, 0x2E] + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0817B880: .4byte 0x085f51ec +_0817B884: .4byte 0x085f523c +_0817B888: .4byte 0x02020630 + thumb_func_end sub_817B834 + + thumb_func_start sub_817B88C +sub_817B88C: @ 817B88C + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, _0817B8D8 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _0817B8DC + adds r4, 0x8 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817B8E0 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strh r6, [r1, 0x2E] + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0817B8D8: .4byte 0x085f5204 +_0817B8DC: .4byte 0x085f5254 +_0817B8E0: .4byte 0x02020630 + thumb_func_end sub_817B88C + + thumb_func_start nullsub_66 +nullsub_66: @ 817B8E4 + bx lr + thumb_func_end nullsub_66 + + thumb_func_start sub_817B8E8 +sub_817B8E8: @ 817B8E8 + push {r4,lr} + ldr r4, _0817B944 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r1, [r1] + movs r2, 0x3E + adds r2, r0 + mov r12, r2 + movs r2, 0x4 + ands r2, r1 + 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, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x24] + strh r1, [r0, 0x24] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817B944: .4byte 0x02020630 + thumb_func_end sub_817B8E8 + + thumb_func_start sub_817B948 +sub_817B948: @ 817B948 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, _0817B9B4 + mov r8, r0 + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, _0817B9B8 + adds r2, r0 + asrs r2, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, r8 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0x5 + bl obj_add_from_template_forward_search + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x6 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0817B9BC + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + strh r6, [r0, 0x2E] + movs r1, 0x1 + bl obj_anim_image_start + adds r5, 0x1C + adds r4, r5 + ldr r0, _0817B9C0 + str r0, [r4] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0817B9B4: .4byte 0x085f528c +_0817B9B8: .4byte 0xffe00000 +_0817B9BC: .4byte 0x02020630 +_0817B9C0: .4byte sub_817B8E8 + 1 + thumb_func_end sub_817B948 + + thumb_func_start sub_817B9C4 +sub_817B9C4: @ 817B9C4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, _0817BA30 + mov r8, r0 + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, _0817BA34 + adds r2, r0 + asrs r2, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, r8 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0x5 + bl obj_add_from_template_forward_search + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x6 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r5, _0817BA38 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + strh r6, [r0, 0x2E] + movs r1, 0x1 + bl obj_anim_image_start + adds r5, 0x1C + adds r4, r5 + ldr r0, _0817BA3C + str r0, [r4] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0817BA30: .4byte 0x085f52a4 +_0817BA34: .4byte 0xffe00000 +_0817BA38: .4byte 0x02020630 +_0817BA3C: .4byte sub_817B8E8 + 1 + thumb_func_end sub_817B9C4 + + thumb_func_start nullsub_67 +nullsub_67: @ 817BA40 + bx lr + thumb_func_end nullsub_67 + + thumb_func_start sub_817BA44 +sub_817BA44: @ 817BA44 + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0 + ldr r5, _0817BA78 +_0817BA4C: + adds r0, r4, 0 + adds r0, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xB + bls _0817BA4C + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817BA78: .4byte 0x085f5458 + thumb_func_end sub_817BA44 + + thumb_func_start sub_817BA7C +sub_817BA7C: @ 817BA7C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _0817BB2A + movs r2, 0x3C + ldrsh r0, [r4, r2] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x50 + bl __divsi3 + movs r1, 0x58 + subs r1, r0 + strh r1, [r4, 0x22] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0817BAB6 + adds r0, 0x3 +_0817BAB6: + asrs r0, 2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817BAE0 + ldrh r0, [r4, 0x38] + subs r0, 0x1 + strh r0, [r4, 0x38] +_0817BAE0: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _0817BAF6 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + b _0817BAFC +_0817BAF6: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x14 +_0817BAFC: + strb r0, [r1] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _0817BB08 + adds r0, 0x3 +_0817BB08: + asrs r0, 2 + adds r0, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _0817BB16 + movs r2, 0x1F +_0817BB16: + movs r0, 0x1F + ands r2, r0 + lsls r2, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + b _0817BB30 +_0817BB2A: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0817BB30: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BA7C + + thumb_func_start sub_817BB38 +sub_817BB38: @ 817BB38 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0817BB88 + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BB82 + ldr r4, _0817BB8C + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + movs r0, 0x30 + strh r0, [r2, 0x38] + strh r5, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0x34 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r2, 0x3] + adds r4, 0x1C + adds r3, r4 + ldr r0, _0817BB90 + str r0, [r3] +_0817BB82: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817BB88: .4byte 0x085f5440 +_0817BB8C: .4byte 0x02020630 +_0817BB90: .4byte sub_817BA7C + 1 + thumb_func_end sub_817BB38 + + thumb_func_start sub_817BB94 +sub_817BB94: @ 817BB94 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0x57 + bgt _0817BBFA + movs r2, 0x3C + ldrsh r0, [r4, r2] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x8 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0817BBCC + adds r0, 0x3 +_0817BBCC: + asrs r0, 2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 26 + lsrs r0, 24 + movs r1, 0x28 + bl sine + adds r0, 0x8 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + b _0817BC00 +_0817BBFA: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0817BC00: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BB94 + + thumb_func_start sub_817BC08 +sub_817BC08: @ 817BC08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0817BC64 + movs r1, 0x78 + movs r2, 0x8 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BC5E + ldr r4, _0817BC68 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + movs r0, 0x8 + strh r0, [r2, 0x38] + strh r5, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0xC + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x32 + orrs r0, r1 + strb r0, [r2, 0x3] + adds r2, 0x43 + movs r0, 0x1 + strb r0, [r2] + adds r4, 0x1C + adds r3, r4 + ldr r0, _0817BC6C + str r0, [r3] +_0817BC5E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817BC64: .4byte 0x085f5440 +_0817BC68: .4byte 0x02020630 +_0817BC6C: .4byte sub_817BB94 + 1 + thumb_func_end sub_817BC08 + + thumb_func_start sub_817BC70 +sub_817BC70: @ 817BC70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _0817BCAC + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + subs r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + b _0817BCB2 +_0817BCAC: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0817BCB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BC70 + + thumb_func_start sub_817BCB8 +sub_817BCB8: @ 817BCB8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _0817BD14 + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BD0E + ldr r4, _0817BD18 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + strh r5, [r2, 0x34] + movs r0, 0x78 + strh r0, [r2, 0x38] + strh r6, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0x7C + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r2, 0x3] + adds r2, 0x43 + movs r0, 0x1 + strb r0, [r2] + adds r4, 0x1C + adds r3, r4 + ldr r0, _0817BD1C + str r0, [r3] +_0817BD0E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817BD14: .4byte 0x085f5440 +_0817BD18: .4byte 0x02020630 +_0817BD1C: .4byte sub_817BC70 + 1 + thumb_func_end sub_817BCB8 + + thumb_func_start sub_817BD20 +sub_817BD20: @ 817BD20 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0817BD34 + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_0817BD34: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x7F + bgt _0817BDE4 + lsls r0, r1, 24 + lsrs r0, 24 + movs r5, 0x38 + ldrsh r1, [r4, r5] + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x3C + ldrsh r0, [r4, r2] + muls r0, r1 + movs r1, 0x3 + bl __divsi3 + adds r0, 0x78 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x3A] + adds r3, r0, 0x1 + strh r3, [r4, 0x3A] + movs r5, 0x3A + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + cmp r0, 0 + bge _0817BD78 + adds r0, 0x7F +_0817BD78: + asrs r0, 7 + movs r1, 0x1F + subs r1, r0 + lsls r1, 24 + lsrs r2, r1, 24 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0817BD94 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + strb r0, [r1] + b _0817BDC4 +_0817BD94: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x14 + strb r0, [r1] + ldrh r1, [r4, 0x3A] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r0, 0x70 + ble _0817BDC4 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817BDC4 + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] +_0817BDC4: + cmp r2, 0x13 + bhi _0817BDCA + movs r2, 0x14 +_0817BDCA: + movs r0, 0x1F + ands r2, r0 + lsls r2, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + b _0817BDEA +_0817BDE4: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0817BDEA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817BD20 + + thumb_func_start sub_817BDF0 +sub_817BDF0: @ 817BDF0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _0817BE6C + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _0817BE60 + bl GenerateRandomNumber + ldr r6, _0817BE70 + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + adds r4, r5, r6 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __umodsi3 + movs r1, 0x3 + subs r1, r0 + movs r0, 0 + mov r8, r0 + strh r1, [r4, 0x34] + bl GenerateRandomNumber + movs r1, 0x3F + ands r1, r0 + adds r1, 0x30 + strh r1, [r4, 0x38] + mov r0, r8 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r4, 0x3] + adds r4, 0x43 + movs r0, 0x14 + strb r0, [r4] + adds r6, 0x1C + adds r5, r6 + ldr r0, _0817BE74 + str r0, [r5] +_0817BE60: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817BE6C: .4byte 0x085f5440 +_0817BE70: .4byte 0x02020630 +_0817BE74: .4byte sub_817BD20 + 1 + thumb_func_end sub_817BDF0 + + thumb_func_start sub_817BE78 +sub_817BE78: @ 817BE78 + push {lr} + ldr r0, _0817BE8C + bl gpu_tile_obj_decompress_and_load3 + ldr r0, _0817BE90 + bl gpu_pal_obj_alloc_and_load_multiple + pop {r0} + bx r0 + .align 2, 0 +_0817BE8C: .4byte 0x085f540c +_0817BE90: .4byte 0x085f541c + thumb_func_end sub_817BE78 + + thumb_func_start sub_817BE94 +sub_817BE94: @ 817BE94 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0817BEBC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817BEC0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0817BEBC: .4byte sub_817BEC4 + 1 +_0817BEC0: .4byte 0x03005e00 + thumb_func_end sub_817BE94 + + thumb_func_start sub_817BEC4 +sub_817BEC4: @ 817BEC4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, _0817BF08 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x3 + lsls r0, r1 + ldr r1, _0817BF0C + str r1, [sp] + movs r1, 0xA + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0817BF10 + str r0, [r5] + movs r0, 0x8C + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817BF08: .4byte 0x03005e00 +_0817BF0C: .4byte 0x00007fff +_0817BF10: .4byte sub_817BF14 + 1 + thumb_func_end sub_817BEC4 + + thumb_func_start sub_817BF14 +sub_817BF14: @ 817BF14 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0817BF6C + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x26] + movs r4, 0x26 + ldrsh r0, [r1, r4] + cmp r0, 0x3F + bgt _0817BF70 + movs r0, 0x7 + ands r0, r2 + adds r7, r3, 0 + cmp r0, 0 + bne _0817BF5A + movs r4, 0 + adds r6, r1, 0 +_0817BF3C: + ldrh r1, [r6, 0x26] + movs r0, 0x78 + ands r0, r1 + lsls r0, 1 + lsls r1, r4, 6 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl sub_817BB38 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0817BF3C +_0817BF5A: + ldr r0, _0817BF6C + adds r1, r7, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817BF78 + .align 2, 0 +_0817BF6C: .4byte 0x03005e00 +_0817BF70: + movs r0, 0x60 + strh r0, [r1, 0x26] + ldr r0, _0817BF80 + str r0, [r1] +_0817BF78: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817BF80: .4byte sub_817BF84 + 1 + thumb_func_end sub_817BF14 + + thumb_func_start sub_817BF84 +sub_817BF84: @ 817BF84 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0817BFA4 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + ldrh r3, [r1, 0x26] + movs r4, 0x26 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _0817BFA8 + subs r0, r3, 0x1 + strh r0, [r1, 0x26] + b _0817BFAE + .align 2, 0 +_0817BFA4: .4byte 0x03005e00 +_0817BFA8: + adds r0, r2, 0 + bl remove_task +_0817BFAE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BF84 + + thumb_func_start sub_817BFB4 +sub_817BFB4: @ 817BFB4 + push {lr} + ldr r0, _0817BFC8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0817BFC8: .4byte sub_817BFCC + 1 + thumb_func_end sub_817BFB4 + + thumb_func_start sub_817BFCC +sub_817BFCC: @ 817BFCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r1, _0817BFF8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r1, _0817BFFC + str r1, [r0] + movs r0, 0xB7 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817BFF8: .4byte 0x03005e00 +_0817BFFC: .4byte sub_817C000 + 1 + thumb_func_end sub_817BFCC + + thumb_func_start sub_817C000 +sub_817C000: @ 817C000 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0817C044 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0x5F + bgt _0817C048 + adds r6, r2, 0 + cmp r0, 0x5 + bgt _0817C032 + movs r4, 0 +_0817C020: + lsls r0, r4, 28 + lsrs r0, 24 + bl sub_817BC08 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _0817C020 +_0817C032: + ldr r0, _0817C044 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C04C + .align 2, 0 +_0817C044: .4byte 0x03005e00 +_0817C048: + ldr r0, _0817C054 + str r0, [r1] +_0817C04C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817C054: .4byte sub_817C058 + 1 + thumb_func_end sub_817C000 + + thumb_func_start sub_817C058 +sub_817C058: @ 817C058 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + thumb_func_end sub_817C058 + + thumb_func_start sub_817C068 +sub_817C068: @ 817C068 + push {lr} + ldr r0, _0817C07C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0817C07C: .4byte sub_817C080 + 1 + thumb_func_end sub_817C068 + + thumb_func_start sub_817C080 +sub_817C080: @ 817C080 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r1, _0817C0AC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r1, _0817C0B0 + str r1, [r0] + movs r0, 0x66 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817C0AC: .4byte 0x03005e00 +_0817C0B0: .4byte sub_817C0B4 + 1 + thumb_func_end sub_817C080 + + thumb_func_start sub_817C0B4 +sub_817C0B4: @ 817C0B4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0817C120 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0x2F + bgt _0817C124 + adds r6, r2, 0 + cmp r0, 0 + bne _0817C0E8 + movs r4, 0 +_0817C0D4: + lsls r0, r4, 28 + lsrs r0, 24 + movs r1, 0x4 + bl sub_817BCB8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0817C0D4 +_0817C0E8: + ldr r0, _0817C120 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0x20 + bne _0817C10E + movs r4, 0 +_0817C0FA: + lsls r0, r4, 28 + lsrs r0, 24 + movs r1, 0x8 + bl sub_817BCB8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0817C0FA +_0817C10E: + ldr r0, _0817C120 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C128 + .align 2, 0 +_0817C120: .4byte 0x03005e00 +_0817C124: + ldr r0, _0817C130 + str r0, [r1] +_0817C128: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817C130: .4byte sub_817C134 + 1 + thumb_func_end sub_817C0B4 + + thumb_func_start sub_817C134 +sub_817C134: @ 817C134 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + thumb_func_end sub_817C134 + + thumb_func_start sub_817C144 +sub_817C144: @ 817C144 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0817C16C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817C170 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0817C16C: .4byte sub_817C174 + 1 +_0817C170: .4byte 0x03005e00 + thumb_func_end sub_817C144 + + thumb_func_start sub_817C174 +sub_817C174: @ 817C174 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, _0817C1BC + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, _0817C1C0 + ldr r1, _0817C1C4 + movs r2, 0x30 + bl CpuSet + ldr r0, _0817C1C8 + ldr r1, _0817C1CC + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0817C1D0 + str r0, [r5] + movs r0, 0xCA + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817C1BC: .4byte 0x03005e00 +_0817C1C0: .4byte 0x02037b54 +_0817C1C4: .4byte 0x02037754 +_0817C1C8: .4byte 0xfff9041c +_0817C1CC: .4byte 0x00007fff +_0817C1D0: .4byte sub_817C1D4 + 1 + thumb_func_end sub_817C174 + + thumb_func_start sub_817C1D4 +sub_817C1D4: @ 817C1D4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0817C20C + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x26 + ldrsh r2, [r1, r0] + cmp r2, 0x7F + bgt _0817C250 + adds r0, r2, 0 + cmp r0, 0 + beq _0817C210 + cmp r0, 0x20 + beq _0817C224 + cmp r2, 0x31 + bgt _0817C234 + bl GenerateRandomNumber + movs r1, 0x7 + ands r0, r1 + bl sub_817BDF0 + b _0817C234 + .align 2, 0 +_0817C20C: .4byte 0x03005e00 +_0817C210: + movs r4, 0 +_0817C212: + adds r0, r4, 0 + bl sub_817BDF0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _0817C212 + b _0817C234 +_0817C224: + ldr r0, _0817C244 + ldr r1, _0817C248 + str r1, [sp] + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_0817C234: + ldr r0, _0817C24C + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C254 + .align 2, 0 +_0817C244: .4byte 0xffff041c +_0817C248: .4byte 0x00007fff +_0817C24C: .4byte 0x03005e00 +_0817C250: + ldr r0, _0817C25C + str r0, [r1] +_0817C254: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817C25C: .4byte sub_817C260 + 1 + thumb_func_end sub_817C1D4 + + thumb_func_start sub_817C260 +sub_817C260: @ 817C260 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _0817C27C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817C278 + adds r0, r2, 0 + bl remove_task +_0817C278: + pop {r0} + bx r0 + .align 2, 0 +_0817C27C: .4byte 0x02037fd4 + thumb_func_end sub_817C260 + + thumb_func_start sub_817C280 +sub_817C280: @ 817C280 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _0817C2A8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817C2AC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0817C2A8: .4byte sub_817C2B0 + 1 +_0817C2AC: .4byte 0x03005e00 + thumb_func_end sub_817C280 + + thumb_func_start sub_817C2B0 +sub_817C2B0: @ 817C2B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, _0817C2F8 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, _0817C2FC + ldr r1, _0817C300 + movs r2, 0x30 + bl CpuSet + ldr r0, _0817C304 + ldr r1, _0817C308 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _0817C30C + str r0, [r5] + movs r0, 0xCA + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817C2F8: .4byte 0x03005e00 +_0817C2FC: .4byte 0x02037b54 +_0817C300: .4byte 0x02037754 +_0817C304: .4byte 0xfff90400 +_0817C308: .4byte 0x00007fff +_0817C30C: .4byte sub_817C310 + 1 + thumb_func_end sub_817C2B0 + + thumb_func_start sub_817C310 +sub_817C310: @ 817C310 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0817C348 + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x26 + ldrsh r2, [r1, r0] + cmp r2, 0x7F + bgt _0817C38C + adds r0, r2, 0 + cmp r0, 0 + beq _0817C34C + cmp r0, 0x20 + beq _0817C360 + cmp r2, 0x31 + bgt _0817C370 + bl GenerateRandomNumber + movs r1, 0x7 + ands r0, r1 + bl sub_817BDF0 + b _0817C370 + .align 2, 0 +_0817C348: .4byte 0x03005e00 +_0817C34C: + movs r4, 0 +_0817C34E: + adds r0, r4, 0 + bl sub_817BDF0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _0817C34E + b _0817C370 +_0817C360: + ldr r0, _0817C380 + ldr r1, _0817C384 + str r1, [sp] + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_0817C370: + ldr r0, _0817C388 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C390 + .align 2, 0 +_0817C380: .4byte 0xffff0400 +_0817C384: .4byte 0x00007fff +_0817C388: .4byte 0x03005e00 +_0817C38C: + ldr r0, _0817C398 + str r0, [r1] +_0817C390: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817C398: .4byte sub_817C260 + 1 + thumb_func_end sub_817C310 + + thumb_func_start nullsub_68 +nullsub_68: @ 817C39C + bx lr + thumb_func_end nullsub_68 + + thumb_func_start sub_817C3A0 +sub_817C3A0: @ 817C3A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + movs r1, 0 + ldr r3, _0817C4D4 + ldr r2, _0817C4D8 +_0817C3BA: + lsls r0, r1, 1 + add r0, sp + adds r0, 0x4 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0817C3BA + adds r0, r3, 0 + movs r1, 0 + bl AddTask + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, _0817C4DC + mov r1, r8 + lsls r6, r1, 2 + add r6, r8 + lsls r6, 3 + adds r6, r0 + strh r5, [r6, 0xA] + strh r7, [r6, 0xC] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r6, 0xE] + movs r0, 0x10 + strh r0, [r6, 0x10] + movs r4, 0x80 + lsls r4, 9 + str r1, [sp] + movs r0, 0x1E + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + movs r0, 0x10 + ldrsh r1, [r6, r0] + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1F + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + ldr r1, _0817C4E0 + mov r9, r1 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + mov r3, r9 + adds r3, 0x1C + adds r0, r2, r3 + ldr r1, _0817C4E4 + str r1, [r0] + add r2, r9 + ldrb r1, [r2, 0x1] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x3C + orrs r0, r1 + strb r0, [r2, 0x3] + movs r0, 0x3E + adds r0, r2 + mov r10, r0 + ldrb r1, [r0] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + mov r1, r10 + strb r0, [r1] + ldrb r1, [r2, 0x5] + lsrs r1, 4 + lsls r1, 5 + ldr r0, _0817C4E8 + mov r10, r0 + add r1, r10 + add r0, sp, 0x4 + movs r2, 0x10 + str r3, [sp, 0x24] + bl CpuSet + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + ldr r3, [sp, 0x24] + adds r3, r1, r3 + ldr r0, _0817C4E4 + str r0, [r3] + add r1, r9 + ldrb r0, [r1, 0x1] + ands r4, r0 + movs r0, 0x1 + orrs r4, r0 + strb r4, [r1, 0x1] + ldrb r0, [r1, 0x3] + movs r2, 0x3E + orrs r0, r2 + strb r0, [r1, 0x3] + adds r2, r1, 0 + adds r2, 0x3E + ldrb r0, [r2] + ands r5, r0 + strb r5, [r2] + ldrb r1, [r1, 0x5] + lsrs r1, 4 + lsls r1, 5 + add r1, r10 + add r0, sp, 0x4 + movs r2, 0x10 + bl CpuSet + movs r1, 0 + strh r1, [r6, 0x18] + mov r0, r8 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0817C4D4: .4byte sub_817C4EC + 1 +_0817C4D8: .4byte 0x00007fff +_0817C4DC: .4byte 0x03005e00 +_0817C4E0: .4byte 0x02020630 +_0817C4E4: .4byte nullsub_68 + 1 +_0817C4E8: .4byte 0x02037d14 + thumb_func_end sub_817C3A0 + + thumb_func_start sub_817C4EC +sub_817C4EC: @ 817C4EC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817C508 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x12] + movs r0, 0x8 + strh r0, [r1, 0x14] + ldr r0, _0817C50C + str r0, [r1] + bx lr + .align 2, 0 +_0817C508: .4byte 0x03005e00 +_0817C50C: .4byte sub_817C510 + 1 + thumb_func_end sub_817C4EC + + thumb_func_start sub_817C510 +sub_817C510: @ 817C510 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _0817C530 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x18 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0817C534 + adds r0, r3, 0 + bl sub_817C72C + b _0817C556 + .align 2, 0 +_0817C530: .4byte 0x03005e00 +_0817C534: + ldrh r1, [r2, 0x14] + movs r4, 0x14 + ldrsh r0, [r2, r4] + cmp r0, 0x80 + bne _0817C546 + adds r0, r3, 0 + bl sub_817C67C + b _0817C556 +_0817C546: + adds r0, r1, 0x2 + strh r0, [r2, 0x14] + ldrh r0, [r2, 0x12] + movs r1, 0x1 + eors r0, r1 + strh r0, [r2, 0x12] + ldr r0, _0817C55C + str r0, [r2] +_0817C556: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817C55C: .4byte sub_817C560 + 1 + thumb_func_end sub_817C510 + + thumb_func_start sub_817C560 +sub_817C560: @ 817C560 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0817C584 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x18 + ldrsh r0, [r2, r3] + adds r5, r1, 0 + cmp r0, 0 + beq _0817C58C + ldr r0, _0817C588 + str r0, [r2] + b _0817C670 + .align 2, 0 +_0817C584: .4byte 0x03005e00 +_0817C588: .4byte sub_817C72C + 1 +_0817C58C: + movs r6, 0 + movs r7, 0x12 + ldrsh r0, [r2, r7] + cmp r0, 0 + bne _0817C5DC + movs r0, 0xE + ldrsh r1, [r2, r0] + movs r3, 0x14 + ldrsh r0, [r2, r3] + movs r3, 0x80 + lsls r3, 1 + subs r0, r3, r0 + cmp r1, r0 + bge _0817C5B2 + ldrh r0, [r2, 0x14] + ldrh r7, [r2, 0xE] + adds r0, r7 + strh r0, [r2, 0xE] + b _0817C5B6 +_0817C5B2: + strh r3, [r2, 0xE] + movs r6, 0x1 +_0817C5B6: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0x10 + ldrsh r1, [r3, r0] + movs r7, 0x14 + ldrsh r0, [r3, r7] + adds r0, 0x10 + cmp r1, r0 + ble _0817C5D6 + ldrh r0, [r3, 0x10] + ldrh r1, [r3, 0x14] + subs r0, r1 + strh r0, [r3, 0x10] + b _0817C626 +_0817C5D6: + movs r0, 0x10 + strh r0, [r3, 0x10] + b _0817C620 +_0817C5DC: + movs r0, 0x10 + ldrsh r1, [r2, r0] + movs r3, 0x14 + ldrsh r0, [r2, r3] + movs r3, 0x80 + lsls r3, 1 + subs r0, r3, r0 + cmp r1, r0 + bge _0817C5F8 + ldrh r0, [r2, 0x14] + ldrh r7, [r2, 0x10] + adds r0, r7 + strh r0, [r2, 0x10] + b _0817C5FC +_0817C5F8: + strh r3, [r2, 0x10] + movs r6, 0x1 +_0817C5FC: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0xE + ldrsh r1, [r3, r0] + movs r7, 0x14 + ldrsh r0, [r3, r7] + adds r0, 0x10 + cmp r1, r0 + ble _0817C61C + ldrh r0, [r3, 0xE] + ldrh r1, [r3, 0x14] + subs r0, r1 + strh r0, [r3, 0xE] + b _0817C626 +_0817C61C: + movs r0, 0x10 + strh r0, [r3, 0xE] +_0817C620: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0817C626: + adds r0, r2, r4 + lsls r0, 3 + adds r5, r0, r5 + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r4, 0x80 + lsls r4, 9 + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1E + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + movs r3, 0x10 + ldrsh r1, [r5, r3] + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1F + movs r2, 0 + movs r3, 0 + bl rotscale_set_direct + cmp r6, 0x2 + bne _0817C670 + ldr r0, _0817C678 + str r0, [r5] +_0817C670: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817C678: .4byte sub_817C510 + 1 + thumb_func_end sub_817C560 + + thumb_func_start sub_817C67C +sub_817C67C: @ 817C67C + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0817C724 + mov r8, r1 + ldr r1, _0817C728 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x1] + movs r6, 0x4 + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x1] + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x3] + movs r5, 0x3F + negs r5, r5 + adds r1, r5, 0 + ands r1, r3 + strb r1, [r2, 0x3] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x1] + ands r6, r2 + strb r6, [r1, 0x1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x3] + ands r5, r2 + strb r5, [r1, 0x3] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r1] + bl remove_task + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817C724: .4byte 0x02020630 +_0817C728: .4byte 0x03005e00 + thumb_func_end sub_817C67C + + thumb_func_start sub_817C72C +sub_817C72C: @ 817C72C + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0817C7D4 + mov r8, r1 + ldr r1, _0817C7D8 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x1] + movs r6, 0x4 + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x1] + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x3] + movs r5, 0x3F + negs r5, r5 + adds r1, r5, 0 + ands r1, r3 + strb r1, [r2, 0x3] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x1] + ands r6, r2 + strb r6, [r1, 0x1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x3] + ands r5, r2 + strb r5, [r1, 0x3] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + bl remove_task + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817C7D4: .4byte 0x02020630 +_0817C7D8: .4byte 0x03005e00 + thumb_func_end sub_817C72C + + thumb_func_start sub_817C7DC +sub_817C7DC: @ 817C7DC + ldr r2, _0817C7F0 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + bx lr + .align 2, 0 +_0817C7F0: .4byte 0x0860a320 + thumb_func_end sub_817C7DC + + thumb_func_start sub_817C7F4 +sub_817C7F4: @ 817C7F4 + push {r4,r5,lr} + lsls r4, r0, 16 + lsrs r5, r4, 16 + adds r0, r5, 0 + bl sub_811EB10 + lsls r0, 24 + cmp r0, 0 + beq _0817C810 + ldr r0, _0817C80C + b _0817C84E + .align 2, 0 +_0817C80C: .4byte 0x0860a3ac +_0817C810: + lsrs r0, r4, 25 + ldr r2, _0817C824 + ands r2, r5 + cmp r0, 0x13 + bhi _0817C828 + cmp r0, 0x12 + bcs _0817C834 + cmp r0, 0 + beq _0817C82C + b _0817C83C + .align 2, 0 +_0817C824: .4byte 0x000001ff +_0817C828: + cmp r0, 0x15 + bne _0817C83C +_0817C82C: + ldr r1, _0817C830 + b _0817C844 + .align 2, 0 +_0817C830: .4byte 0x085f5494 +_0817C834: + ldr r1, _0817C838 + b _0817C844 + .align 2, 0 +_0817C838: .4byte 0x085fa1d8 +_0817C83C: + ldr r1, _0817C854 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] +_0817C844: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r1, r0 + adds r0, r1, 0 +_0817C84E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0817C854: .4byte 0x0860a168 + thumb_func_end sub_817C7F4 + + thumb_func_start sub_817C858 +sub_817C858: @ 817C858 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r0, 0 + strh r0, [r5, 0x4] + movs r6, 0 + ldr r0, _0817C8B8 + mov r8, r0 + adds r4, r5, 0 + adds r4, 0x18 +_0817C872: + lsls r0, r6, 3 + ldr r1, [r5, 0x30] + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0817C8A0 + movs r1, 0x1 + ldrsb r1, [r2, r1] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + adds r1, r0 + strh r1, [r4] + adds r0, r7, 0 + adds r0, 0x1E + adds r1, r6, 0 + bl sub_817C7DC + strh r0, [r4, 0x2] + ldrh r0, [r4] + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r5, 0x4] +_0817C8A0: + adds r4, 0x4 + adds r6, 0x1 + cmp r6, 0x5 + ble _0817C872 + movs r0, 0 + strb r0, [r5, 0x1] + strh r0, [r5, 0xA] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817C8B8: .4byte 0x0860a3dc + thumb_func_end sub_817C858 + + thumb_func_start sub_817C8BC +sub_817C8BC: @ 817C8BC + push {lr} + ldr r0, _0817C8D4 + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817C8D8 + movs r0, 0 + b _0817C8E6 + .align 2, 0 +_0817C8D4: .4byte 0x02037318 +_0817C8D8: + ldr r1, _0817C8EC + ldr r0, _0817C8F0 + str r0, [r1] + ldr r1, _0817C8F4 + ldr r0, _0817C8F8 + str r0, [r1] + movs r0, 0x1 +_0817C8E6: + pop {r1} + bx r1 + .align 2, 0 +_0817C8EC: .4byte 0x03005db0 +_0817C8F0: .4byte hm_add_c3_launch_phase_2 + 1 +_0817C8F4: .4byte 0x0203ceec +_0817C8F8: .4byte hm_teleport_run_dp02scr + 1 + thumb_func_end sub_817C8BC + + thumb_func_start hm_teleport_run_dp02scr +hm_teleport_run_dp02scr: @ 817C8FC + push {lr} + bl new_game + movs r0, 0x3F + bl oe_exec + bl brm_get_pokemon_selection + ldr r1, _0817C918 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0817C918: .4byte 0x02038c08 + thumb_func_end hm_teleport_run_dp02scr + + thumb_func_start sub_817C91C +sub_817C91C: @ 817C91C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817C944 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _0817C948 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x1 + bl walkrun_set_bike_bits + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0817C944: .4byte 0x03005e00 +_0817C948: .4byte sub_817C94C + 1 + thumb_func_end sub_817C91C + + thumb_func_start sub_817C94C +sub_817C94C: @ 817C94C + push {lr} + movs r0, 0x3F + bl oe_active_list_remove + bl sub_80B7FC8 + pop {r0} + bx r0 + thumb_func_end sub_817C94C + + thumb_func_start sub_817C95C +sub_817C95C: @ 817C95C + 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] + ldr r0, _0817C9E0 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817C988 + ldr r0, [sp] + cmp r0, 0x1B + beq _0817C988 + cmp r0, 0xDD + beq _0817C988 + bl _0817E0A6 +_0817C988: + ldr r0, _0817C9E4 + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r7, r0, r1 + ldr r5, _0817C9E8 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817C9EC + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0817C9F0 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _0817C9F4 + ldr r0, [r0] + ldrb r0, [r0, 0x7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r4, 0 + bne _0817CA00 + ldr r2, _0817C9F8 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0817C9FC + b _0817CA10 + .align 2, 0 +_0817C9E0: .4byte 0x02022fec +_0817C9E4: .4byte 0x0202449c +_0817C9E8: .4byte 0x0202420b +_0817C9EC: .4byte 0x0202420c +_0817C9F0: .4byte 0x0202420e +_0817C9F4: .4byte 0x0203aba8 +_0817C9F8: .4byte 0x0202406e +_0817C9FC: .4byte 0x020244ec +_0817CA00: + ldr r2, _0817CA2C + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0817CA30 +_0817CA10: + adds r1, r0 + str r1, [sp, 0x8] + cmp r6, 0 + bne _0817CA3C + ldr r0, _0817CA34 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0817CA38 + b _0817CA4C + .align 2, 0 +_0817CA2C: .4byte 0x0202406e +_0817CA30: .4byte 0x02024744 +_0817CA34: .4byte 0x0202420c +_0817CA38: .4byte 0x020244ec +_0817CA3C: + ldr r0, _0817CA8C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0817CA90 +_0817CA4C: + adds r1, r0 + str r1, [sp, 0xC] + ldr r0, _0817CA94 + ldrb r0, [r0] + ldr r1, _0817CA98 + ldr r1, [r1] + ldrh r1, [r1] + bl sub_817F33C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x3 + bls _0817CA9C + ldr r0, [sp] + bl sub_817E0B8 + lsls r0, 24 + cmp r0, 0 + beq _0817CA9C + ldr r2, [sp] + cmp r2, 0xC + bls _0817CA9C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r1, [r0] + movs r2, 0x1E + bl _0817E0A2 + .align 2, 0 +_0817CA8C: .4byte 0x0202420c +_0817CA90: .4byte 0x02024744 +_0817CA94: .4byte 0x0202420b +_0817CA98: .4byte 0x0203aba8 +_0817CA9C: + ldr r0, _0817CADC + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 25 + mov r8, r0 + ldr r0, _0817CAE0 + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r5, r0, 25 + ldr r0, _0817CAE4 + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 25 + ldr r1, [sp] + subs r1, 0x2 + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + bls _0817CAD2 + bl _0817E0A6 +_0817CAD2: + lsls r0, r1, 2 + ldr r1, _0817CAE8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817CADC: .4byte 0x0202420b +_0817CAE0: .4byte 0x0202420c +_0817CAE4: .4byte 0x0202420e +_0817CAE8: .4byte _0817CAEC + .align 2, 0 +_0817CAEC: + .4byte _0817DD7A + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D070 + .4byte _0817DD74 + .4byte _0817DD80 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DA68 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D7D8 + .4byte _0817E0A6 + .4byte _0817D8A4 + .4byte _0817E0A6 + .4byte _0817D838 + .4byte _0817E0A6 + .4byte _0817D704 + .4byte _0817E0A6 + .4byte _0817D76C + .4byte _0817DB24 + .4byte _0817E0A6 + .4byte _0817DB90 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D9C2 + .4byte _0817E0A6 + .4byte _0817DA24 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DBD4 + .4byte _0817E0A6 + .4byte _0817D94C + .4byte _0817E0A6 + .4byte _0817D994 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E040 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DE10 + .4byte _0817DDC8 + .4byte _0817DEDC + .4byte _0817DF24 + .4byte _0817DF4E + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D65E + .4byte _0817D65E + .4byte _0817D65E + .4byte _0817D65E + .4byte _0817D698 + .4byte _0817E0A6 + .4byte _0817E08E + .4byte _0817DF70 + .4byte _0817DFBC + .4byte _0817E0A6 + .4byte _0817E08E + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D53C + .4byte _0817E0A6 + .4byte _0817D584 + .4byte _0817DACC + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D3A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D296 + .4byte _0817D2E4 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D5CE + .4byte _0817D608 + .4byte _0817D498 + .4byte _0817D4E0 + .4byte _0817DC62 + .4byte _0817DC98 + .4byte _0817E0A6 + .4byte _0817D1B8 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DCDC + .4byte _0817E0A6 + .4byte _0817D0DC + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D1E0 + .4byte _0817D314 + .4byte _0817D354 + .4byte _0817D372 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D216 + .4byte _0817D260 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D3C0 + .4byte _0817D3F2 + .4byte _0817D440 + .4byte _0817D45C + .4byte _0817D3B8 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D098 + .4byte _0817D0D4 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DC20 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D16C + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DD38 + .4byte _0817DCFC + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D65E + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D124 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DE58 + .4byte _0817DDC8 + .4byte _0817DE10 + .4byte _0817DFE6 +_0817D070: + movs r0, 0x1 + mov r1, r10 + movs r2, 0x2 + movs r3, 0 + bl sub_817E684 + ldr r0, _0817D094 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817D08C + bl _0817E0A6 +_0817D08C: + bl sub_817EECC + bl _0817E0A6 + .align 2, 0 +_0817D094: .4byte 0x02022fec +_0817D098: + movs r0, 0x1 + mov r1, r10 + movs r2, 0x1 + movs r3, 0 + bl sub_817E684 + ldr r0, _0817D0D0 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817D0B4 + bl _0817E0A6 +_0817D0B4: + ldr r0, [sp, 0xC] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D0C6 + bl _0817E0A6 +_0817D0C6: + bl sub_817EECC + bl _0817E0A6 + .align 2, 0 +_0817D0D0: .4byte 0x02022fec +_0817D0D4: + movs r0, 0x1 + mov r1, r10 + movs r2, 0 + b _0817D48E +_0817D0DC: + lsls r3, r4, 1 + adds r3, r4 + lsls r3, 2 + adds r3, r7, r3 + ldr r1, _0817D118 + ldr r0, _0817D11C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 15 + ldr r1, [r3, 0x50] + ldr r2, _0817D120 + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x50] + adds r3, 0x55 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0xD + negs r0, r0 + bl _0817DC0C + .align 2, 0 +_0817D118: .4byte 0x0202406e +_0817D11C: .4byte 0x0202420b +_0817D120: .4byte 0xfffc7fff +_0817D124: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817D164 + ldr r0, _0817D168 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x52 + movs r0, 0x7 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r4] + movs r0, 0x1D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x55 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x31 + negs r0, r0 + bl _0817DFAA + .align 2, 0 +_0817D164: .4byte 0x0202406e +_0817D168: .4byte 0x0202420b +_0817D16C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r5, r7, r0 + ldr r1, _0817D1B0 + ldr r0, _0817D1B4 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r3, r5, 0 + adds r3, 0x52 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x1F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r4, r5, 0 + adds r4, 0x55 + mov r0, r10 + lsls r2, r0, 6 + ldrb r1, [r4] + movs r0, 0x3F + ands r0, r1 + orrs r0, r2 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x58 + ldrb r0, [r2] + movs r1, 0x40 + bl _0817DFAC + .align 2, 0 +_0817D1B0: .4byte 0x0202406e +_0817D1B4: .4byte 0x0202420b +_0817D1B8: + ldr r1, _0817D1DC + ldrb r0, [r1] + cmp r0, 0 + beq _0817D1C4 + bl _0817E0A6 +_0817D1C4: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x14 + bl _0817E0A2 + .align 2, 0 +_0817D1DC: .4byte 0x02022f5c +_0817D1E0: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r3, r7, r0 + adds r0, r3, 0 + adds r0, 0x53 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D1FA + bl _0817E0A6 +_0817D1FA: + adds r2, r6, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x56 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + bl _0817DB10 +_0817D216: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817D258 + ldr r0, _0817D25C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x53 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x56 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + bl _0817DFAA + .align 2, 0 +_0817D258: .4byte 0x0202406e +_0817D25C: .4byte 0x0202420b +_0817D260: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r3, r7, r0 + adds r0, r3, 0 + adds r0, 0x53 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + bne _0817D27A + bl _0817E0A6 +_0817D27A: + adds r2, r6, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x56 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + bl _0817DBC2 +_0817D296: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817D2D8 + ldr r0, _0817D2DC + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r2, 0x56 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 7 + ldrh r3, [r2] + ldr r0, _0817D2E0 + ands r0, r3 + orrs r0, r1 + strh r0, [r2] + bl _0817E0A6 + .align 2, 0 +_0817D2D8: .4byte 0x0202406e +_0817D2DC: .4byte 0x0202420b +_0817D2E0: .4byte 0xfffffe7f +_0817D2E4: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x56 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 29 + cmp r0, 0 + bne _0817D2FC + bl _0817E0A6 +_0817D2FC: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x16 + bl _0817E0A2 +_0817D314: + mov r2, r8 + lsls r3, r2, 3 + lsls r0, r4, 4 + adds r3, r0 + adds r3, r7, r3 + ldr r1, _0817D34C + ldr r0, _0817D350 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r3, 0x35 + movs r0, 0x7 + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + movs r2, 0x3 + mov r1, r10 + ands r1, r2 + lsls r1, 3 + movs r2, 0x19 + negs r2, r2 + bl _0817DC0C + .align 2, 0 +_0817D34C: .4byte 0x0202406e +_0817D350: .4byte 0x0202420b +_0817D354: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r0, r7, r0 + adds r0, 0x35 + ldrb r1, [r0] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D36E + bl _0817E0A6 +_0817D36E: + adds r2, r4, 0 + b _0817D38C +_0817D372: + lsls r0, r5, 3 + lsls r1, r6, 4 + adds r0, r1 + adds r0, r7, r0 + adds r0, 0x35 + ldrb r1, [r0] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D38A + bl _0817E0A6 +_0817D38A: + adds r2, r6, 0 +_0817D38C: + subs r0, 0x1 + lsls r0, 2 + lsls r3, r1, 27 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + movs r1, 0x6 + bl sub_817E684 + bl _0817E0A6 +_0817D3A6: + ldr r0, _0817D3B4 + ldr r0, [r0] + adds r0, 0xB3 + movs r1, 0x1 + bl _0817E0A4 + .align 2, 0 +_0817D3B4: .4byte 0x0202449c +_0817D3B8: + movs r0, 0x12 + mov r1, r10 + movs r2, 0 + b _0817D48E +_0817D3C0: + ldr r0, _0817D3E0 + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D3CC + bl _0817E0A6 +_0817D3CC: + ldr r1, _0817D3E4 + ldrh r0, [r1] + cmp r0, 0xD1 + bne _0817D3E8 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x17 + b _0817D48C + .align 2, 0 +_0817D3E0: .4byte 0x02022f58 +_0817D3E4: .4byte 0x02022f6a +_0817D3E8: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x16 + b _0817D48C +_0817D3F2: + ldr r0, _0817D41C + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D3FE + bl _0817E0A6 +_0817D3FE: + ldr r0, _0817D420 + ldr r1, _0817D424 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _0817D436 + ldr r1, _0817D428 + ldrh r0, [r1] + cmp r0, 0xD1 + bne _0817D42C + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x17 + b _0817D48C + .align 2, 0 +_0817D41C: .4byte 0x02022f58 +_0817D420: .4byte 0x0202420b +_0817D424: .4byte 0x0202420c +_0817D428: .4byte 0x02022f6a +_0817D42C: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x16 + b _0817D48C +_0817D436: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1B + b _0817D48C +_0817D440: + ldr r0, _0817D458 + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D44C + bl _0817E0A6 +_0817D44C: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x18 + b _0817D48C + .align 2, 0 +_0817D458: .4byte 0x02022f58 +_0817D45C: + ldr r0, _0817D47C + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D468 + bl _0817E0A6 +_0817D468: + ldr r1, _0817D480 + ldrh r0, [r1] + cmp r0, 0xD3 + bne _0817D484 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1A + b _0817D48C + .align 2, 0 +_0817D47C: .4byte 0x02022f58 +_0817D480: .4byte 0x02022f6a +_0817D484: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x19 +_0817D48C: + mov r1, r10 +_0817D48E: + movs r3, 0 + bl sub_817E684 + bl _0817E0A6 +_0817D498: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817D4D8 + ldr r0, _0817D4DC + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x30 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x32 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + bl _0817DFAA + .align 2, 0 +_0817D4D8: .4byte 0x0202406e +_0817D4DC: .4byte 0x0202420b +_0817D4E0: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D4F2 + bl _0817E0A6 +_0817D4F2: + mov r2, r8 + lsls r0, r2, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D50E + bl _0817E0A6 +_0817D50E: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0x2 + b _0817D6F2 +_0817D53C: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817D57C + ldr r0, _0817D580 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x30 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x32 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x31 + negs r0, r0 + bl _0817DFAA + .align 2, 0 +_0817D57C: .4byte 0x0202406e +_0817D580: .4byte 0x0202420b +_0817D584: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + bne _0817D5A0 + bl _0817E0A6 +_0817D5A0: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x1 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + b _0817D6F2 +_0817D5CE: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817D5FC + ldr r0, _0817D600 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r3, [r2, 0x30] + ldr r0, _0817D604 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x30] + adds r2, 0x32 + bl _0817DF0A + .align 2, 0 +_0817D5FC: .4byte 0x0202406e +_0817D600: .4byte 0x0202420b +_0817D604: .4byte 0xfffffe3f +_0817D608: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D61A + bl _0817E0A6 +_0817D61A: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + ldrh r0, [r1, 0x30] + lsls r0, 23 + lsrs r0, 29 + cmp r0, 0 + bne _0817D632 + bl _0817E0A6 +_0817D632: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsrs r3, 6 + movs r0, 0x8 + movs r1, 0x5 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0xA + b _0817D6F2 +_0817D65E: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817D690 + ldr r0, _0817D694 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x31 + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r3, [r4] + movs r0, 0xF + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x33 + bl _0817DF9E + .align 2, 0 +_0817D690: .4byte 0x0202406e +_0817D694: .4byte 0x0202420b +_0817D698: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D6AA + bl _0817E0A6 +_0817D6AA: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x31 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _0817D6C6 + bl _0817E0A6 +_0817D6C6: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x33 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x6 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0xC +_0817D6F2: + orrs r0, r2 + mov r2, r8 + lsls r3, r2, 5 + movs r2, 0x1F + ands r0, r2 + orrs r0, r3 + strb r0, [r1] + bl _0817E0A6 +_0817D704: + ldr r5, _0817D75C + ldr r6, _0817D760 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r0, r9 + lsls r4, r0, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, _0817D764 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r3, [r2] + ldr r0, _0817D768 + ands r0, r3 + orrs r0, r1 + strh r0, [r2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + mov r2, r10 + lsls r3, r2, 6 + ldrb r2, [r1, 0x2] + movs r0, 0x3F + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x2] + bl _0817E0A6 + .align 2, 0 +_0817D75C: .4byte 0x0202406e +_0817D760: .4byte 0x0202420e +_0817D764: .4byte 0x0202420b +_0817D768: .4byte 0xfffffe3f +_0817D76C: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D77E + bl _0817E0A6 +_0817D77E: + ldr r6, _0817D7D0 + ldr r5, _0817D7D4 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + lsls r0, 2 + lsls r1, r4, 1 + adds r4, r1, r4 + lsls r1, r4, 3 + adds r0, r1 + adds r1, r7, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r0, 29 + cmp r0, 0 + beq _0817D7B2 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x2] + lsrs r3, 6 + movs r0, 0x8 + movs r1, 0x4 + bl sub_817E684 +_0817D7B2: + lsls r3, r4, 2 + adds r3, r7, r3 + adds r3, 0x57 + ldrb r0, [r3] + movs r1, 0x1F + negs r1, r1 + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r3] + ldrb r0, [r5] + lsls r0, 1 + adds r0, r6 + b _0817D934 + .align 2, 0 +_0817D7D0: .4byte 0x0202406e +_0817D7D4: .4byte 0x0202420b +_0817D7D8: + ldr r5, _0817D82C + ldr r6, _0817D830 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r0, r9 + lsls r4, r0, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, _0817D834 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x2] + movs r0, 0xD + negs r0, r0 + b _0817D88C + .align 2, 0 +_0817D82C: .4byte 0x0202406e +_0817D830: .4byte 0x0202420e +_0817D834: .4byte 0x0202420b +_0817D838: + ldr r5, _0817D898 + ldr r6, _0817D89C + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r1, r9 + lsls r4, r1, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, _0817D8A0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r2] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 4 + ldrb r3, [r1, 0x2] + movs r0, 0x31 + negs r0, r0 +_0817D88C: + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x2] + bl _0817E0A6 + .align 2, 0 +_0817D898: .4byte 0x0202406e +_0817D89C: .4byte 0x0202420e +_0817D8A0: .4byte 0x0202420b +_0817D8A4: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D8B6 + bl _0817E0A6 +_0817D8B6: + ldr r2, _0817D944 + mov r8, r2 + ldr r6, _0817D948 + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 2 + lsls r1, r4, 1 + adds r5, r1, r4 + lsls r4, r5, 3 + adds r0, r4 + adds r1, r7, r0 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + beq _0817D8EE + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x2] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x2 + bl sub_817E684 +_0817D8EE: + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r4 + adds r1, r7, r0 + ldrb r0, [r1] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + beq _0817D91A + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x2] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x3 + bl sub_817E684 +_0817D91A: + lsls r3, r5, 2 + adds r3, r7, r3 + adds r3, 0x57 + ldrb r0, [r3] + movs r1, 0x1F + negs r1, r1 + ands r1, r0 + movs r0, 0x6 + orrs r1, r0 + strb r1, [r3] + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 +_0817D934: + ldrh r0, [r0] + lsls r0, 5 + movs r2, 0x1F + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + b _0817E0A6 + .align 2, 0 +_0817D944: .4byte 0x0202406e +_0817D948: .4byte 0x0202420b +_0817D94C: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817D98C + ldr r0, _0817D990 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x31 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r4] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x33 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + b _0817DFAA + .align 2, 0 +_0817D98C: .4byte 0x0202406e +_0817D990: .4byte 0x0202420b +_0817D994: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x31 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 29 + cmp r0, 0 + bne _0817D9AE + b _0817E0A6 +_0817D9AE: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x33 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x9 + b _0817E086 +_0817D9C2: + ldr r5, _0817DA18 + ldr r6, _0817DA1C + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r0, r9 + lsls r4, r0, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, _0817DA20 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r3, [r2, 0x1] + movs r0, 0xF + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + ldrb r3, [r1, 0x3] + movs r0, 0x4 + negs r0, r0 + b _0817DB76 + .align 2, 0 +_0817DA18: .4byte 0x0202406e +_0817DA1C: .4byte 0x0202420e +_0817DA20: .4byte 0x0202420b +_0817DA24: + ldr r1, _0817DA60 + ldr r0, _0817DA64 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0 + adds r1, r7, r1 + ldrb r0, [r1, 0x1] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _0817DA48 + b _0817E0A6 +_0817DA48: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x9 + movs r1, 0x2 + bl sub_817E684 + b _0817E0A6 + .align 2, 0 +_0817DA60: .4byte 0x0202406e +_0817DA64: .4byte 0x0202420b +_0817DA68: + ldr r5, _0817DAC0 + ldr r6, _0817DAC4 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r1, r9 + lsls r4, r1, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, _0817DAC8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2, 0x1] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x3] + movs r0, 0xD + negs r0, r0 + b _0817DB76 + .align 2, 0 +_0817DAC0: .4byte 0x0202406e +_0817DAC4: .4byte 0x0202420e +_0817DAC8: .4byte 0x0202420b +_0817DACC: + ldr r1, _0817DB18 + ldr r0, _0817DB1C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0 + adds r1, r7, r1 + ldrb r0, [r1, 0x1] + lsls r0, 25 + lsrs r2, r0, 29 + cmp r2, 0 + bne _0817DAF0 + b _0817E0A6 +_0817DAF0: + ldr r0, _0817DB20 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0xAD + bne _0817DAFC + b _0817E0A6 +_0817DAFC: + cmp r0, 0xD6 + bne _0817DB02 + b _0817E0A6 +_0817DB02: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x9 +_0817DB10: + movs r1, 0x3 + bl sub_817E684 + b _0817E0A6 + .align 2, 0 +_0817DB18: .4byte 0x0202406e +_0817DB1C: .4byte 0x0202420b +_0817DB20: .4byte 0x0203aba8 +_0817DB24: + ldr r5, _0817DB80 + ldr r6, _0817DB84 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r3, [r0] + lsls r3, 2 + mov r2, r9 + lsls r4, r2, 1 + add r4, r9 + lsls r4, 3 + adds r3, r4 + adds r3, r7, r3 + ldr r0, _0817DB88 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 15 + ldr r1, [r3] + ldr r2, _0817DB8C + ands r1, r2 + orrs r1, r0 + str r1, [r3] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 4 + ldrb r3, [r1, 0x3] + movs r0, 0x31 + negs r0, r0 +_0817DB76: + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x3] + b _0817E0A6 + .align 2, 0 +_0817DB80: .4byte 0x0202406e +_0817DB84: .4byte 0x0202420e +_0817DB88: .4byte 0x0202420b +_0817DB8C: .4byte 0xfffc7fff +_0817DB90: + ldr r1, _0817DBCC + ldr r0, _0817DBD0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0 + adds r1, r7, r1 + ldr r0, [r1] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + bne _0817DBB4 + b _0817E0A6 +_0817DBB4: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x9 +_0817DBC2: + movs r1, 0x4 + bl sub_817E684 + b _0817E0A6 + .align 2, 0 +_0817DBCC: .4byte 0x0202406e +_0817DBD0: .4byte 0x0202420b +_0817DBD4: + lsls r3, 3 + mov r1, r9 + lsls r0, r1, 4 + adds r3, r0 + adds r3, r7, r3 + ldr r1, _0817DC14 + ldr r0, _0817DC18 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 15 + ldr r1, [r3, 0x30] + ldr r2, _0817DC1C + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x30] + adds r3, 0x33 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x31 + negs r0, r0 +_0817DC0C: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _0817E0A6 + .align 2, 0 +_0817DC14: .4byte 0x0202406e +_0817DC18: .4byte 0x0202420b +_0817DC1C: .4byte 0xfffc7fff +_0817DC20: + mov r2, r8 + lsls r0, r2, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r7, r0 + ldr r0, [r3, 0x30] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + beq _0817DC4C + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r3, 0 + adds r0, 0x33 + ldrb r3, [r0] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x9 + movs r1, 0x1 + bl sub_817E684 +_0817DC4C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x18 + b _0817E0A2 +_0817DC62: + lsls r2, r6, 1 + adds r2, r6 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817DC90 + ldr r0, _0817DC94 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x50 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x54 + b _0817DF9E + .align 2, 0 +_0817DC90: .4byte 0x0202406e +_0817DC94: .4byte 0x0202420b +_0817DC98: + ldr r1, [sp, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r4, r7, r0 + adds r0, r4, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 29 + lsrs r2, r0, 29 + cmp r2, 0 + bne _0817DCB2 + b _0817E0A6 +_0817DCB2: + movs r0, 0x1 + eors r1, r0 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r0, 0x54 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0xA + bl sub_817E684 + adds r2, r4, 0 + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0xE + b _0817DFAC +_0817DCDC: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrb r2, [r3] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + b _0817DF6A +_0817DCFC: + mov r0, r8 + lsls r2, r0, 3 + lsls r0, r4, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817DD30 + ldr r0, _0817DD34 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x34 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x33 + mov r1, r10 + lsls r3, r1, 6 + b _0817DF0E + .align 2, 0 +_0817DD30: .4byte 0x0202406e +_0817DD34: .4byte 0x0202420b +_0817DD38: + mov r0, r8 + lsls r2, r0, 3 + lsls r0, r4, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, _0817DD6C + ldr r0, _0817DD70 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r2, 0x34 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r2] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + mov r1, r10 + lsls r3, r1, 6 + movs r1, 0x3F + b _0817DF12 + .align 2, 0 +_0817DD6C: .4byte 0x0202406e +_0817DD70: .4byte 0x0202420b +_0817DD74: + movs r0, 0 + bl sub_817EA80 +_0817DD7A: + mov r2, r8 + lsls r0, r2, 3 + b _0817DD88 +_0817DD80: + movs r0, 0x1 + bl sub_817EA80 + lsls r0, r5, 3 +_0817DD88: + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r4, r1, 0 + adds r4, 0x34 + ldrb r5, [r4] + lsls r0, r5, 29 + cmp r0, 0 + beq _0817DDAE + movs r0, 0x8 + negs r0, r0 + ands r0, r5 + strb r0, [r4] + adds r2, r1, 0 + adds r2, 0x33 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] +_0817DDAE: + ldrb r1, [r4] + lsls r0, r1, 26 + lsrs r0, 29 + cmp r0, 0 + bne _0817DDBA + b _0817E0A6 +_0817DDBA: + movs r0, 0x39 + negs r0, r0 + ands r0, r1 + movs r1, 0x3F + ands r0, r1 + strb r0, [r4] + b _0817E0A6 +_0817DDC8: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817DE08 + ldr r0, _0817DE0C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x50 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x54 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + b _0817DFAA + .align 2, 0 +_0817DE08: .4byte 0x0202406e +_0817DE0C: .4byte 0x0202420b +_0817DE10: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817DE4C + ldr r0, _0817DE50 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x50 + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r3, [r4] + ldr r0, _0817DE54 + ands r0, r3 + orrs r0, r1 + strh r0, [r4] + adds r2, 0x54 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x31 + negs r0, r0 + b _0817DFAA + .align 2, 0 +_0817DE4C: .4byte 0x0202406e +_0817DE50: .4byte 0x0202420b +_0817DE54: .4byte 0xfffffe3f +_0817DE58: + ldr r1, _0817DED4 + ldrh r0, [r1] + cmp r0, 0x73 + bne _0817DE82 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrb r2, [r3] + movs r0, 0x39 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0817DE82: + ldr r2, _0817DED4 + ldrh r0, [r2] + cmp r0, 0x71 + bne _0817DEAA + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrh r2, [r3] + ldr r0, _0817DED8 + ands r0, r2 + strh r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0817DEAA: + ldr r1, _0817DED4 + ldrh r0, [r1] + cmp r0, 0x36 + beq _0817DEB4 + b _0817E0A6 +_0817DEB4: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r4, r1, 0 + adds r4, 0x51 + ldrb r2, [r4] + movs r0, 0x71 + negs r0, r0 + ands r0, r2 + strb r0, [r4] + adds r1, 0x55 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + b _0817DF6A + .align 2, 0 +_0817DED4: .4byte 0x02022f5a +_0817DED8: .4byte 0xfffffe3f +_0817DEDC: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817DF1C + ldr r0, _0817DF20 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x51 + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r3, [r4] + movs r0, 0xF + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x54 +_0817DF0A: + mov r0, r10 + lsls r3, r0, 6 +_0817DF0E: + ldrb r1, [r2] + movs r0, 0x3F +_0817DF12: + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + b _0817E0A6 + .align 2, 0 +_0817DF1C: .4byte 0x0202406e +_0817DF20: .4byte 0x0202420b +_0817DF24: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x51 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _0817DF3C + b _0817E0A6 +_0817DF3C: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r3, [r0] + lsrs r3, 6 + movs r0, 0xF + b _0817E086 +_0817DF4E: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r4, r1, 0 + adds r4, 0x51 + ldrb r2, [r4] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + strb r0, [r4] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0x3F +_0817DF6A: + ands r0, r2 + strb r0, [r1] + b _0817E0A6 +_0817DF70: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, _0817DFB4 + ldr r0, _0817DFB8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x51 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r4] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x55 +_0817DF9E: + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 +_0817DFAA: + ands r0, r3 +_0817DFAC: + orrs r0, r1 + strb r0, [r2] + b _0817E0A6 + .align 2, 0 +_0817DFB4: .4byte 0x0202406e +_0817DFB8: .4byte 0x0202420b +_0817DFBC: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x51 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 29 + cmp r0, 0 + beq _0817E0A6 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x10 + b _0817E086 +_0817DFE6: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrb r2, [r3] + movs r0, 0x39 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrh r2, [r3] + ldr r0, _0817E034 + ands r0, r2 + strh r0, [r3] + ldrb r2, [r1] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, _0817E038 + ldr r0, _0817E03C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0x11 + movs r1, 0 + mov r3, r10 + bl sub_817E684 + b _0817E0A6 + .align 2, 0 +_0817E034: .4byte 0xfffffe3f +_0817E038: .4byte 0x0202406e +_0817E03C: .4byte 0x0202420b +_0817E040: + lsls r0, r4, 4 + adds r4, r7, r0 + adds r0, r4, 0 + adds r0, 0x35 + ldrb r0, [r0] + lsrs r0, 5 + cmp r0, 0 + beq _0817E068 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r0, 0x36 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x15 + movs r1, 0 + bl sub_817E684 +_0817E068: + adds r0, r4, 0 + adds r0, 0x3D + ldrb r0, [r0] + lsrs r0, 5 + cmp r0, 0 + beq _0817E0A6 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x15 +_0817E086: + movs r1, 0 + bl sub_817E684 + b _0817E0A6 +_0817E08E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x1C +_0817E0A2: + orrs r1, r2 +_0817E0A4: + strb r1, [r0] +_0817E0A6: + 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_817C95C + + thumb_func_start sub_817E0B8 +sub_817E0B8: @ 817E0B8 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r4, _0817E0EC + ldr r6, _0817E0F0 + adds r2, r4, 0 + adds r1, r4, 0 +_0817E0C8: + ldrh r0, [r1] + cmp r0, r5 + beq _0817E0DA + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r2] + cmp r0, r6 + bne _0817E0C8 +_0817E0DA: + lsls r0, r3, 1 + adds r0, r4 + ldrh r1, [r0] + ldr r0, _0817E0F0 + cmp r1, r0 + beq _0817E0F4 + movs r0, 0 + b _0817E0F6 + .align 2, 0 +_0817E0EC: .4byte 0x0860a8a4 +_0817E0F0: .4byte 0x0000ffff +_0817E0F4: + movs r0, 0x1 +_0817E0F6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_817E0B8 + + thumb_func_start sub_817E0FC +sub_817E0FC: @ 817E0FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r2, [sp, 0x4] + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + ldr r0, _0817E174 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817E122 + b _0817E310 +_0817E122: + ldr r0, _0817E178 + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r1, r0, r1 + str r1, [sp, 0x8] + ldr r2, _0817E17C + mov r10, r2 + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _0817E180 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r10 + ldrb r0, [r1] + adds r1, r7, 0 + bl sub_817F33C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0817E184 + mov r2, r9 + lsls r0, r2, 1 + add r0, r9 + lsls r0, 2 + ldr r1, [sp, 0x8] + adds r0, r1, r0 + adds r0, 0x57 + ldrb r1, [r0] + movs r2, 0x1E + orrs r1, r2 + strb r1, [r0] + b _0817E310 + .align 2, 0 +_0817E174: .4byte 0x02022fec +_0817E178: .4byte 0x0202449c +_0817E17C: .4byte 0x0202420b +_0817E180: .4byte 0x0202420c +_0817E184: + mov r2, r10 + ldrb r0, [r2] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 25 + lsls r0, 3 + lsls r4, 4 + adds r0, r4 + ldr r1, [sp, 0x8] + adds r0, r1, r0 + mov r2, r10 + ldrb r1, [r2] + lsls r1, 1 + ldr r2, _0817E320 + adds r1, r2 + ldrh r2, [r1] + adds r2, 0x1 + adds r0, 0x35 + lsls r2, 5 + ldrb r3, [r0] + movs r1, 0x1F + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + mov r1, r10 + ldrb r0, [r1] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 25 + lsls r0, 3 + adds r0, r4 + ldr r2, [sp, 0x8] + adds r0, r2, r0 + adds r0, 0x36 + movs r1, 0x3 + mov r8, r6 + mov r2, r8 + ands r2, r1 + mov r8, r2 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + mov r2, r8 + orrs r1, r2 + strb r1, [r0] + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 2 + ldr r2, [sp, 0x8] + adds r0, r2, r0 + str r0, [sp, 0xC] + adds r5, r0, 0 + adds r5, 0x53 + lsls r2, r6, 6 + ldrb r1, [r5] + movs r0, 0x3F + ands r0, r1 + orrs r0, r2 + strb r0, [r5] + ldr r1, _0817E324 + lsls r4, r7, 1 + adds r0, r4, r7 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_817E684 + ldr r0, [sp] + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_817F394 + ldr r0, [sp, 0x4] + ldrb r1, [r0, 0x12] + movs r0, 0xF + ands r0, r1 + str r4, [sp, 0x10] + cmp r0, 0 + beq _0817E23C + movs r0, 0x7 + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0 + bl sub_817E684 +_0817E23C: + ldr r0, _0817E328 + cmp r7, r0 + bne _0817E272 + mov r1, r10 + ldrb r0, [r1] + lsls r0, 1 + ldr r2, _0817E320 + adds r0, r2 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + ldrb r2, [r5] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5] + ldr r2, [sp, 0xC] + adds r2, 0x56 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + mov r1, r8 + orrs r0, r1 + strb r0, [r2] +_0817E272: + cmp r7, 0x78 + beq _0817E27A + cmp r7, 0x99 + bne _0817E2D2 +_0817E27A: + movs r0, 0x1 + mov r2, r9 + eors r0, r2 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, [sp, 0x8] + adds r2, r0, r2 + mov r1, r10 + ldrb r0, [r1] + lsls r0, 1 + ldr r1, _0817E320 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x58 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + mov r1, r8 + lsls r3, r1, 1 + movs r1, 0x7 + negs r1, r1 + ands r0, r1 + orrs r0, r3 + strb r0, [r4] + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0x1A + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] +_0817E2D2: + ldr r1, _0817E324 + ldr r2, [sp, 0x10] + adds r0, r2, r7 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x2] + ldrb r5, [r0, 0x1] + movs r0, 0xD + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817E684 + movs r0, 0xE + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817E684 + movs r0, 0xB + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_817E684 + movs r0, 0xC + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_817E684 +_0817E310: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817E320: .4byte 0x0202406e +_0817E324: .4byte 0x0831c898 +_0817E328: .4byte 0x00000111 + thumb_func_end sub_817E0FC + + thumb_func_start sub_817E32C +sub_817E32C: @ 817E32C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0817E360 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817E3EE + ldr r0, _0817E364 + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r4, r0, r1 + ldr r0, _0817E368 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + cmp r5, 0x12 + beq _0817E36C + cmp r5, 0x13 + beq _0817E3AA + b _0817E3EE + .align 2, 0 +_0817E360: .4byte 0x02022fec +_0817E364: .4byte 0x0202449c +_0817E368: .4byte 0x0202420b +_0817E36C: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + ldr r0, [r4, 0x50] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + beq _0817E3EE + subs r0, 0x1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x55 + ldrb r3, [r1] + lsls r3, 28 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + movs r1, 0 + bl sub_817E684 + adds r2, r4, 0 + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + b _0817E3EA +_0817E3AA: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 29 + cmp r0, 0 + beq _0817E3EE + subs r0, 0x1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x55 + ldrb r3, [r1] + lsls r3, 26 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + movs r1, 0x1 + bl sub_817E684 + adds r2, r4, 0 + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0x12 +_0817E3EA: + orrs r0, r1 + strb r0, [r2] +_0817E3EE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817E32C + + thumb_func_start sub_817E3F4 +sub_817E3F4: @ 817E3F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r0, 0 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + ldr r3, _0817E57C + str r3, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + movs r7, 0 + str r7, [sp, 0x14] + mov r8, r0 + ldr r0, _0817E580 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB3 + ldrb r0, [r0] + cmp r0, 0 + beq _0817E42A + b _0817E670 +_0817E42A: + movs r2, 0xD2 + lsls r2, 1 + adds r2, r1 + mov r10, r2 + movs r6, 0 +_0817E434: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, _0817E584 + adds r0, r4, r0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0817E454 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_0817E454: + ldr r5, _0817E588 + adds r0, r4, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0817E46A + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0817E46A: + adds r6, 0x1 + cmp r6, 0x5 + ble _0817E434 + ldr r0, _0817E58C + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817E47E + b _0817E670 +_0817E47E: + cmp r8, r7 + beq _0817E484 + b _0817E670 +_0817E484: + movs r6, 0 + lsls r3, r6, 1 + str r3, [sp, 0x18] + movs r4, 0x64 + mov r8, r4 +_0817E48E: + mov r1, r8 + muls r1, r6 + ldr r0, _0817E584 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r6, 0x1 + mov r9, r0 + cmp r7, 0 + beq _0817E4EE + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817E4EE + movs r4, 0 + lsls r0, r6, 3 + mov r2, r10 + adds r1, r0, r2 + movs r3, 0x3 +_0817E4C4: + lsls r0, r4, 16 + asrs r0, 16 + ldrh r4, [r1] + adds r0, r4 + lsls r0, 16 + lsrs r4, r0, 16 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0817E4C4 + ldr r1, [sp, 0x8] + lsls r0, r1, 16 + lsls r1, r4, 16 + cmp r0, r1 + bge _0817E4EE + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsrs r1, 16 + str r1, [sp, 0x8] + str r7, [sp] +_0817E4EE: + mov r0, r8 + muls r0, r6 + ldr r2, _0817E588 + adds r4, r0, r2 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldr r3, [sp, 0x8] + lsls r3, 16 + str r3, [sp, 0x1C] + cmp r7, 0 + beq _0817E5A0 + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817E5A0 + movs r4, 0 + ldr r0, [sp, 0xC] + lsls r2, r0, 16 + movs r3, 0x1 + lsls r1, r3, 1 + adds r1, 0x1 + lsls r1, 4 + lsls r0, r6, 3 + adds r0, r1 + mov r3, r10 + adds r1, r0, r3 + movs r3, 0x3 +_0817E534: + lsls r0, r4, 16 + asrs r0, 16 + ldrh r4, [r1] + adds r0, r4 + lsls r0, 16 + lsrs r4, r0, 16 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0817E534 + asrs r1, r2, 16 + lsls r5, r4, 16 + asrs r0, r5, 16 + cmp r1, r0 + bne _0817E590 + mov r0, r8 + muls r0, r6 + ldr r1, _0817E588 + adds r0, r1 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + ldr r2, [sp, 0x14] + mov r0, r8 + muls r0, r2 + ldr r3, _0817E588 + adds r0, r3 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bls _0817E5A0 + b _0817E594 + .align 2, 0 +_0817E57C: .4byte 0x00007fff +_0817E580: .4byte 0x0202449c +_0817E584: .4byte 0x020244ec +_0817E588: .4byte 0x02024744 +_0817E58C: .4byte 0x02022fec +_0817E590: + cmp r1, r0 + ble _0817E5A0 +_0817E594: + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + lsrs r5, 16 + str r5, [sp, 0xC] + str r7, [sp, 0x4] +_0817E5A0: + mov r6, r9 + cmp r6, 0x5 + bgt _0817E5A8 + b _0817E48E +_0817E5A8: + movs r4, 0 + movs r6, 0 + movs r3, 0 + ldr r5, _0817E614 + ldr r7, [sp, 0x10] + lsls r0, r7, 3 + mov r1, r10 + adds r2, r0, r1 +_0817E5B8: + lsls r0, r4, 16 + asrs r0, 16 + movs r7, 0 + ldrsh r1, [r2, r7] + cmp r0, r1 + bge _0817E5C8 + ldrh r4, [r2] + adds r6, r3, 0 +_0817E5C8: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _0817E5B8 + movs r0, 0x64 + ldr r1, [sp, 0x10] + muls r0, r1 + adds r0, r5 + adds r1, r6, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r2, [sp, 0x1C] + cmp r2, 0 + beq _0817E670 + cmp r4, 0 + beq _0817E670 + ldr r0, _0817E618 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0817E65C + ldr r3, [sp, 0x10] + cmp r3, 0x2 + bhi _0817E620 + ldr r0, _0817E61C + adds r0, 0x25 + ldrb r0, [r0] + bl sub_806D82C + lsls r0, 16 + cmp r0, 0 + beq _0817E630 + b _0817E670 + .align 2, 0 +_0817E614: .4byte 0x020244ec +_0817E618: .4byte 0x02022fec +_0817E61C: .4byte 0x02024474 +_0817E620: + ldr r0, _0817E658 + adds r0, 0x25 + ldrb r0, [r0] + bl sub_806D82C + lsls r0, 16 + cmp r0, 0 + beq _0817E670 +_0817E630: + movs r3, 0 + ldr r7, [sp, 0x14] + cmp r7, 0x2 + bls _0817E63A + movs r3, 0x1 +_0817E63A: + lsls r0, r3, 24 + lsrs r0, 24 + ldr r1, _0817E658 + adds r1, 0x25 + ldrb r1, [r1] + bl sub_806EF84 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + ldr r2, [sp] + ldr r3, [sp, 0x4] + bl sub_80ECB00 + b _0817E670 + .align 2, 0 +_0817E658: .4byte 0x02024474 +_0817E65C: + ldr r0, _0817E680 + adds r0, 0x25 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + adds r1, r4, 0 + ldr r2, [sp] + ldr r3, [sp, 0x4] + bl sub_80ECB00 +_0817E670: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817E680: .4byte 0x02024474 + thumb_func_end sub_817E3F4 + + thumb_func_start sub_817E684 +sub_817E684: @ 817E684 + 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 r6, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + ldr r0, _0817E6E0 + ldr r0, [r0] + movs r1, 0xD2 + lsls r1, 1 + adds r1, r0 + mov r8, r1 + movs r2, 0x81 + lsls r2, 2 + adds r7, r0, r2 + ldr r0, _0817E6E4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817E6E8 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + mov r0, r10 + cmp r0, 0x1B + bls _0817E6D4 + b _0817EA6C +_0817E6D4: + lsls r0, 2 + ldr r1, _0817E6EC + adds r1, r0, r1 + ldr r1, [r1] + mov r12, r0 + mov pc, r1 + .align 2, 0 +_0817E6E0: .4byte 0x0202449c +_0817E6E4: .4byte 0x0202420b +_0817E6E8: .4byte 0x0202420c +_0817E6EC: .4byte _0817E6F0 + .align 2, 0 +_0817E6F0: + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E85C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E8A0 + .4byte _0817E8A0 + .4byte _0817E8CC + .4byte _0817E8F0 + .4byte _0817E978 + .4byte _0817E9E0 + .4byte _0817EA28 + .4byte _0817E8A0 + .4byte _0817E8A0 + .4byte _0817E880 + .4byte _0817E760 + .4byte _0817E80A + .4byte _0817E848 + .4byte _0817E8A0 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 +_0817E760: + ldr r1, _0817E790 + ldr r0, _0817E794 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r6 + lsls r1, 1 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E798 + add r0, r12 + ldr r2, [r0] + lsls r0, r5, 1 + adds r0, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .align 2, 0 +_0817E790: .4byte 0x0202406e +_0817E794: .4byte 0x0202420b +_0817E798: .4byte 0x0860a834 +_0817E79C: + ldr r1, _0817E7D0 + add r1, r12 + ldr r7, _0817E7D4 + lsls r0, r4, 1 + adds r0, r4 + lsls r2, r0, 4 + ldr r4, _0817E7D8 + ldr r1, [r1] + ldr r3, _0817E7DC + ldrh r0, [r1] + cmp r6, r0 + bne _0817E7E0 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + add r0, r8 + ldrh r1, [r1, 0x2] + ldrh r2, [r0] + adds r1, r2 + strh r1, [r0] + b _0817EA6C + .align 2, 0 +_0817E7D0: .4byte 0x0860a834 +_0817E7D4: .4byte 0x0202406e +_0817E7D8: .4byte 0x0000ffff +_0817E7DC: .4byte 0x0202420b +_0817E7E0: + adds r1, 0x4 + ldrh r0, [r1] + cmp r0, r4 + bne _0817E7EA + b _0817EA6C +_0817E7EA: + cmp r6, r0 + bne _0817E7E0 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + add r0, r8 + ldrh r1, [r1, 0x2] + ldrh r5, [r0] + adds r1, r5 + strh r1, [r0] + b _0817EA6C +_0817E80A: + movs r0, 0x1 + adds r1, r5, 0 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + strb r1, [r0] + mov r0, r9 + lsls r1, r0, 1 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E844 + add r0, r12 + ldr r2, [r0] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .align 2, 0 +_0817E844: .4byte 0x0860a834 +_0817E848: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_0817E85C: + mov r0, r9 + lsls r1, r0, 1 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E87C + add r0, r12 + ldr r2, [r0] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .align 2, 0 +_0817E87C: .4byte 0x0860a834 +_0817E880: + lsls r1, r5, 2 + add r1, r9 + lsls r1, 1 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E89C + add r0, r12 + ldr r2, [r0] + lsls r0, r6, 1 + adds r0, r2 + b _0817EA64 + .align 2, 0 +_0817E89C: .4byte 0x0860a834 +_0817E8A0: + lsls r2, r5, 2 + add r2, r9 + lsls r2, 1 + movs r1, 0x1 + eors r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + adds r2, r0 + add r2, r8 + ldr r0, _0817E8C8 + add r0, r12 + ldr r1, [r0] + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + b _0817EA6C + .align 2, 0 +_0817E8C8: .4byte 0x0860a834 +_0817E8CC: + lsls r1, r5, 2 + add r1, r9 + lsls r1, 1 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E8EC + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .align 2, 0 +_0817E8EC: .4byte 0x0860a834 +_0817E8F0: + lsls r0, r3, 4 + adds r2, r7, r0 + adds r0, r2, 0 + adds r0, 0x34 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + adds r4, r2, 0 + adds r4, 0x3C + ldrb r0, [r4] + lsls r0, 29 + lsrs r0, 29 + cmn r1, r0 + bne _0817E90E + b _0817EA6C +_0817E90E: + cmp r6, 0xA + beq _0817E914 + b _0817EA6C +_0817E914: + cmp r1, 0 + beq _0817E940 + subs r1, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x33 + ldrb r0, [r0] + lsrs r0, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E974 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r5, [r1] + adds r0, r5 + strh r0, [r1] +_0817E940: + ldrb r0, [r4] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817E94C + b _0817EA6C +_0817E94C: + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x3B + ldrb r0, [r0] + lsrs r0, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E974 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .align 2, 0 +_0817E974: .4byte 0x0860a834 +_0817E978: + lsls r1, r3, 4 + adds r1, r7, r1 + adds r0, r1, 0 + adds r0, 0x34 + ldrb r4, [r0] + lsls r0, r4, 26 + lsrs r2, r0, 29 + adds r5, r1, 0 + adds r5, 0x3C + ldrb r0, [r5] + lsls r0, 26 + lsrs r0, 29 + cmn r2, r0 + beq _0817EA6C + cmp r6, 0xD + bne _0817EA6C + cmp r2, 0 + beq _0817E9BE + subs r1, r2, 0x1 + lsls r1, 2 + lsrs r0, r4, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817E9DC + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] +_0817E9BE: + ldrb r2, [r5] + lsls r0, r2, 26 + lsrs r0, 29 + cmp r0, 0 + beq _0817EA6C + subs r1, r0, 0x1 + lsls r1, 2 + lsrs r0, r2, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + b _0817EA5A + .align 2, 0 +_0817E9DC: .4byte 0x0860a834 +_0817E9E0: + cmp r6, 0x8 + bhi _0817EA6C + cmp r5, 0 + beq _0817EA6C + lsls r0, r3, 1 + adds r3, r0, r3 + lsls r0, r3, 2 + adds r2, r7, r0 + adds r0, r2, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + beq _0817EA6C + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x54 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 4 + adds r1, r0 + add r1, r8 + ldr r0, _0817EA24 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .align 2, 0 +_0817EA24: .4byte 0x0860a834 +_0817EA28: + cmp r6, 0x8 + bls _0817EA6C + cmp r5, 0 + beq _0817EA6C + lsls r0, r3, 1 + adds r3, r0, r3 + lsls r0, r3, 2 + adds r2, r7, r0 + adds r0, r2, 0 + adds r0, 0x50 + ldrh r0, [r0] + lsls r0, 23 + lsrs r0, 29 + cmp r0, 0 + beq _0817EA6C + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x54 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 30 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 4 +_0817EA5A: + adds r1, r0 + add r1, r8 + ldr r0, _0817EA7C + add r0, r12 + ldr r0, [r0] +_0817EA64: + ldrh r0, [r0] + ldrh r5, [r1] + adds r0, r5 +_0817EA6A: + strh r0, [r1] +_0817EA6C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817EA7C: .4byte 0x0860a834 + thumb_func_end sub_817E684 + + thumb_func_start sub_817EA80 +sub_817EA80: @ 817EA80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0817EADC + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r5, r0, r1 + ldr r3, _0817EAE0 + mov r8, r3 + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0817EAE4 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r6, r5, r0 + adds r0, r6, 0 + adds r0, 0x57 + ldrb r0, [r0] + lsrs r3, r0, 5 + lsls r0, 27 + lsrs r0, 28 + cmp r0, 0 + bne _0817EAC8 + b _0817EE50 +_0817EAC8: + subs r0, 0x1 + cmp r0, 0xE + bls _0817EAD0 + b _0817EEBC +_0817EAD0: + lsls r0, 2 + ldr r1, _0817EAE8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817EADC: .4byte 0x0202449c +_0817EAE0: .4byte 0x0202420b +_0817EAE4: .4byte 0x0202420c +_0817EAE8: .4byte _0817EAEC + .align 2, 0 +_0817EAEC: + .4byte _0817EB28 + .4byte _0817EB54 + .4byte _0817EB80 + .4byte _0817EBD4 + .4byte _0817EBFE + .4byte _0817EC26 + .4byte _0817EC4E + .4byte _0817EC6C + .4byte _0817EC9A + .4byte _0817ECCC + .4byte _0817ED54 + .4byte _0817ED82 + .4byte _0817EDC2 + .4byte _0817EE1C + .4byte _0817EEBC +_0817EB28: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EB40 + b _0817EEBC +_0817EB40: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 28 + b _0817EE84 +_0817EB54: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 26 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EB6C + b _0817EEBC +_0817EB6C: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 26 + b _0817EE84 +_0817EB80: + lsls r0, r3, 2 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r0, r1 + adds r5, r0 + ldrb r0, [r5] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + beq _0817EBB4 + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r1, 0x1 + lsls r0, 2 + ldrb r3, [r5, 0x2] + lsls r3, 28 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + bl sub_817E684 +_0817EBB4: + ldrb r0, [r5] + lsls r0, 26 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EBC0 + b _0817EEBC +_0817EBC0: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r1, 0x1 + lsls r0, 2 + ldrb r3, [r5, 0x2] + lsls r3, 26 + lsrs r3, 30 + adds r3, r0 + b _0817EE88 +_0817EBD4: + lsls r0, r3, 2 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r0, r1 + adds r1, r5, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r3, r0, 29 + cmp r3, 0 + bne _0817EBEC + b _0817EEBC +_0817EBEC: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r3, 0x1 + lsls r0, 2 + ldrb r3, [r1, 0x2] + lsrs r3, 6 + adds r3, r0 + b _0817EE88 +_0817EBFE: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + ldrh r0, [r3, 0x30] + lsls r0, 23 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EC12 + b _0817EEBC +_0817EC12: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsrs r3, 6 + b _0817EE86 +_0817EC26: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x31 + ldrb r0, [r0] + lsls r0, 28 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EC3E + b _0817EEBC +_0817EC3E: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x33 + b _0817EE80 +_0817EC4E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EC66 + b _0817EEBC +_0817EC66: + movs r0, 0x1 + adds r2, r4, 0 + b _0817EE76 +_0817EC6C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + ldr r0, [r3, 0x50] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + bne _0817EC80 + b _0817EEBC +_0817EC80: + adds r2, r4, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + b _0817EE8E +_0817EC9A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 29 + cmp r0, 0 + bne _0817ECB2 + b _0817EEBC +_0817ECB2: + adds r2, r4, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsls r3, 26 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + b _0817EE8E +_0817ECCC: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x58 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + bge _0817ED14 + adds r0, r3, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsrs r0, 5 + subs r6, r0, 0x1 + ldr r1, _0817ED4C + ldr r0, _0817ED50 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _0817ED14 + adds r2, r4, 0 + lsls r1, r6, 2 + adds r0, r3, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsrs r3, 6 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + bl sub_817E684 +_0817ED14: + movs r1, 0x1 + eors r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r5, r0 + adds r0, r1, 0 + adds r0, 0x58 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + blt _0817ED2E + b _0817EEBC +_0817ED2E: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + adds r0, r1, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsrs r0, 5 + subs r0, 0x1 + lsls r0, 2 + adds r1, 0x55 + ldrb r3, [r1] + lsrs r3, 6 + adds r3, r0 + b _0817EE88 + .align 2, 0 +_0817ED4C: .4byte 0x0202406e +_0817ED50: .4byte 0x0202420b +_0817ED54: + movs r0, 0x1 + eors r0, r4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5, r1 + adds r1, 0x56 + ldrb r0, [r1] + lsls r0, 25 + lsrs r5, r0, 29 + cmp r5, 0 + bne _0817ED6E + b _0817EEBC +_0817ED6E: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r5, 0x1 + lsls r0, 2 + ldrh r3, [r1] + lsls r3, 23 + lsrs r3, 30 + adds r3, r0 + b _0817EE88 +_0817ED82: + lsls r2, r4, 4 + movs r1, 0x1 + adds r0, r4, 0 + eors r0, r1 + lsls r6, r0, 24 + adds r0, r5, 0 + adds r0, 0x30 + adds r4, r2, r0 + movs r5, 0x1 +_0817ED94: + ldr r0, [r4] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + beq _0817EDB8 + subs r0, 0x1 + lsls r0, 2 + ldrb r3, [r4, 0x3] + lsls r3, 26 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + lsrs r2, r6, 24 + bl sub_817E684 +_0817EDB8: + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _0817ED94 + b _0817EEBC +_0817EDC2: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0x58 + ldrb r3, [r0] + lsls r0, r3, 31 + cmp r0, 0 + beq _0817EDF0 + adds r2, r4, 0 + lsls r0, r3, 26 + lsrs r0, 29 + subs r0, 0x1 + lsls r0, 2 + lsls r3, 29 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + bl sub_817E684 +_0817EDF0: + movs r0, 0x1 + eors r0, r4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5, r1 + adds r1, 0x58 + ldrb r1, [r1] + lsls r0, r1, 31 + cmp r0, 0 + beq _0817EEBC + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + lsls r0, r1, 26 + lsrs r0, 29 + subs r0, 0x1 + lsls r0, 2 + lsls r3, r1, 29 + lsrs r3, 30 + adds r3, r0 + b _0817EE88 +_0817EE1C: + cmp r7, 0x1 + bne _0817EEBC + adds r2, r4, 0 + ldr r1, _0817EE48 + ldr r0, _0817EE4C + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0x53 + ldrb r3, [r0] + lsrs r3, 6 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + b _0817EE8E + .align 2, 0 +_0817EE48: .4byte 0x0202406e +_0817EE4C: .4byte 0x0202420b +_0817EE50: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x57 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 28 + cmp r0, 0x7 + bne _0817EE96 + adds r0, r3, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + beq _0817EEBC + movs r0, 0x1 +_0817EE76: + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x54 +_0817EE80: + ldrb r3, [r0] + lsls r3, 30 +_0817EE84: + lsrs r3, 30 +_0817EE86: + adds r3, r1 +_0817EE88: + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 +_0817EE8E: + movs r1, 0 + bl sub_817E684 + b _0817EEBC +_0817EE96: + adds r2, r4, 0 + ldr r1, _0817EEC8 + mov r3, r8 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + adds r0, r6, 0 + adds r0, 0x53 + ldrb r3, [r0] + lsrs r3, 6 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + movs r1, 0 + bl sub_817E684 +_0817EEBC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817EEC8: .4byte 0x0202406e + thumb_func_end sub_817EA80 + + thumb_func_start sub_817EECC +sub_817EECC: @ 817EECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r7, _0817F188 + ldr r0, [r7] + ldr r1, _0817F18C + ands r0, r1 + cmp r0, 0 + beq _0817EEE6 + b _0817F1FA +_0817EEE6: + ldr r4, _0817F190 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0817EEF8 + b _0817F1FA +_0817EEF8: + ldr r5, _0817F194 + ldrb r4, [r4] + movs r1, 0x58 + adds r6, r4, 0 + muls r6, r1 + adds r0, r6, r5 + ldrb r0, [r0, 0x1E] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x5 + bgt _0817EF10 + b _0817F1FA +_0817EF10: + ldr r0, _0817F198 + ldrb r0, [r0] + muls r0, r1 + adds r0, r5 + ldrb r0, [r0, 0x1F] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x6 + ble _0817EF24 + b _0817F1FA +_0817EF24: + ldr r0, _0817F19C + ldrh r1, [r0] + cmp r1, 0xED + bne _0817EF2E + b _0817F1FA +_0817EF2E: + ldr r0, _0817F1A0 + cmp r1, r0 + bne _0817EF36 + b _0817F1FA +_0817EF36: + ldr r0, [r7] + movs r1, 0xC8 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _0817EF44 + b _0817F1FA +_0817EF44: + ldr r3, _0817F1A4 + ldr r2, _0817F1A8 + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r6 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r6, r2, 0 + cmp r0, 0 + bne _0817EF6A + b _0817F1FA +_0817EF6A: + movs r5, 0 + str r1, [sp, 0x24] + ldr r1, _0817F1AC + ldr r4, _0817F1B0 + adds r3, r1, 0 + adds r2, r1, 0 +_0817EF76: + ldr r0, [sp, 0x24] + ldrh r7, [r2] + cmp r0, r7 + beq _0817EF8A + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x1 + ldrh r0, [r3] + cmp r0, r4 + bne _0817EF76 +_0817EF8A: + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, _0817F1B0 + cmp r1, r0 + beq _0817EF98 + b _0817F1FA +_0817EF98: + ldr r2, _0817F190 + ldrb r0, [r2] + adds r0, r6 + ldrb r0, [r0] + lsls r0, 2 + mov r1, sp + adds r1, r0 + adds r1, 0x10 + ldr r0, _0817F1B4 + ldr r0, [r0] + str r0, [r1] + ldr r0, _0817F19C + ldrh r1, [r0] + str r1, [sp, 0x24] + movs r5, 0 + add r3, sp, 0x20 + mov r10, r3 + mov r8, r0 + add r7, sp, 0x10 + ldr r4, _0817F198 + mov r9, r4 +_0817EFC2: + lsls r1, r5, 1 + ldr r6, _0817F190 + ldrb r0, [r6] + movs r2, 0x58 + muls r0, r2 + adds r1, r0 + ldr r0, _0817F194 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + mov r3, r8 + strh r0, [r3] + movs r6, 0 + mov r4, r10 + strh r6, [r4] + ldrh r0, [r3] + adds r1, r7, 0 + mov r2, r10 + bl sub_817F21C + lsls r0, 24 + cmp r0, 0 + beq _0817F0B4 + ldr r4, _0817F1B8 + mov r1, r9 + ldrb r0, [r1] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldr r2, _0817F190 + ldrb r0, [r2] + movs r4, 0x58 + muls r0, r4 + ldr r6, _0817F194 + adds r0, r6 + mov r2, r9 + ldrb r1, [r2] + muls r1, r4 + adds r1, r6 + mov r4, r8 + ldrh r2, [r4] + mov r6, r10 + ldrh r4, [r6] + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r6, _0817F190 + ldrb r4, [r6] + str r4, [sp, 0x8] + mov r6, r9 + ldrb r4, [r6] + str r4, [sp, 0xC] + bl sub_806957C + adds r3, r0, 0 + ldr r4, _0817F1B4 + str r3, [r4] + ldr r1, _0817F1BC + ldr r2, _0817F190 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _0817F06A + ldr r2, _0817F1A4 + mov r6, r8 + ldrh r1, [r6] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0xD + bne _0817F06A + lsls r0, r3, 1 + str r0, [r4] +_0817F06A: + ldr r0, _0817F1C0 + ldr r6, _0817F190 + ldrb r1, [r6] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + cmp r0, 0 + bge _0817F08C + ldr r4, _0817F1B4 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_0817F08C: + mov r1, r8 + ldrh r0, [r1] + ldrb r1, [r6] + mov r3, r9 + ldrb r2, [r3] + bl move_effectiveness_something + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _0817F1B4 + ldr r0, [r0] + str r0, [r7] + cmp r0, 0 + bne _0817F0B4 + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0817F0B4 + movs r0, 0x1 + str r0, [r7] +_0817F0B4: + adds r7, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _0817EFC2 + movs r5, 0 + ldr r3, _0817F190 + ldr r6, _0817F1A8 + ldr r4, _0817F1C4 + mov r8, r4 + movs r7, 0x64 + mov r9, r7 + mov r10, r6 +_0817F0CC: + ldrb r0, [r3] + adds r0, r6 + ldrb r2, [r0] + cmp r5, r2 + bne _0817F0D8 + b _0817F1D4 +_0817F0D8: + lsls r0, r5, 2 + mov r1, sp + adds r1, r0 + adds r1, 0x10 + lsls r0, r2, 2 + add r0, sp + adds r0, 0x10 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + ble _0817F1D4 + movs r7, 0x1 + cmp r2, 0 + beq _0817F0F6 + movs r7, 0 +_0817F0F6: + movs r5, 0 + ldr r4, _0817F198 + ldr r6, _0817F1C8 + ldr r0, _0817F190 + ldrb r0, [r0] + add r0, r10 + ldrb r3, [r0] + add r2, sp, 0x10 +_0817F106: + cmp r5, r3 + beq _0817F11A + lsls r0, r7, 2 + add r0, sp + adds r0, 0x10 + ldr r1, [r2] + ldr r0, [r0] + cmp r1, r0 + ble _0817F11A + adds r7, r5, 0 +_0817F11A: + adds r2, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _0817F106 + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + ldr r2, _0817F190 + ldrb r0, [r2] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + ldr r1, _0817F1CC + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, _0817F190 + ldrb r3, [r4] + mov r2, r10 + adds r0, r3, r2 + ldrb r2, [r0] + movs r0, 0x58 + adds r4, r3, 0 + muls r4, r0 + ldr r5, _0817F1D0 + adds r3, r4, r5 + lsls r0, r7, 1 + adds r0, r4 + adds r0, r5 + ldrh r0, [r0] + str r0, [sp] + adds r0, r6, 0 + bl sub_80EE35C + b _0817F1DC + .align 2, 0 +_0817F188: .4byte 0x02022fec +_0817F18C: .4byte 0x02000003 +_0817F190: .4byte 0x0202420b +_0817F194: .4byte 0x02024084 +_0817F198: .4byte 0x0202420c +_0817F19C: .4byte 0x020241ea +_0817F1A0: .4byte 0x00000137 +_0817F1A4: .4byte 0x0831c898 +_0817F1A8: .4byte 0x020244b0 +_0817F1AC: .4byte 0x0860a4ac +_0817F1B0: .4byte 0x0000ffff +_0817F1B4: .4byte 0x020241f0 +_0817F1B8: .4byte 0x0202428e +_0817F1BC: .4byte 0x020242ac +_0817F1C0: .4byte 0x0202433c +_0817F1C4: .4byte 0x0202406e +_0817F1C8: .4byte 0x02024744 +_0817F1CC: .4byte 0x020244ec +_0817F1D0: .4byte 0x02024090 +_0817F1D4: + adds r5, 0x1 + cmp r5, 0x3 + bgt _0817F1DC + b _0817F0CC +_0817F1DC: + ldr r2, _0817F20C + ldr r1, _0817F210 + ldr r0, _0817F214 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + add r0, sp + adds r0, 0x10 + ldr r0, [r0] + str r0, [r2] + ldr r0, _0817F218 + mov r3, sp + ldrh r3, [r3, 0x24] + strh r3, [r0] +_0817F1FA: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817F20C: .4byte 0x020241f0 +_0817F210: .4byte 0x020244b0 +_0817F214: .4byte 0x0202420b +_0817F218: .4byte 0x020241ea + thumb_func_end sub_817EECC + + thumb_func_start sub_817F21C +sub_817F21C: @ 817F21C + push {r4-r7,lr} + adds r6, r1, 0 + mov r12, r2 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, _0817F264 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0817F286 + movs r4, 0 + ldr r5, _0817F268 + ldr r7, _0817F26C + adds r3, r5, 0 + adds r1, r5, 0 +_0817F240: + ldrh r0, [r1] + cmp r2, r0 + beq _0817F252 + adds r3, 0x2 + adds r1, 0x2 + adds r4, 0x1 + ldrh r0, [r3] + cmp r0, r7 + bne _0817F240 +_0817F252: + lsls r0, r4, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r0, _0817F26C + cmp r1, r0 + beq _0817F270 + movs r0, 0 + str r0, [r6] + b _0817F2A0 + .align 2, 0 +_0817F264: .4byte 0x0831c898 +_0817F268: .4byte 0x0860a4ac +_0817F26C: .4byte 0x0000ffff +_0817F270: + cmp r2, 0x95 + bne _0817F294 + ldr r2, _0817F28C + ldr r0, _0817F290 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r0, [r0] + asrs r0, 1 +_0817F286: + str r0, [r6] + movs r0, 0 + b _0817F2A0 + .align 2, 0 +_0817F28C: .4byte 0x02024084 +_0817F290: .4byte 0x0202420b +_0817F294: + cmp r2, 0xDE + bne _0817F29E + movs r0, 0xA + mov r1, r12 + strh r0, [r1] +_0817F29E: + movs r0, 0x1 +_0817F2A0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_817F21C + + thumb_func_start sub_817F2A8 +sub_817F2A8: @ 817F2A8 + push {r4,r5,lr} + ldr r0, _0817F32C + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817F324 + ldr r0, _0817F330 + ldr r3, [r0] + ldr r0, _0817F334 + adds r4, r3, r0 + ldrb r2, [r4] + subs r1, 0x21 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + ldr r0, _0817F338 + adds r2, r3, r0 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + ldrb r5, [r4] + movs r1, 0x1F + adds r0, r1, 0 + ands r0, r5 + strb r0, [r4] + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + movs r0, 0x97 + lsls r0, 2 + adds r4, r3, r0 + ldrb r2, [r4] + movs r1, 0x39 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + movs r0, 0x9A + lsls r0, 2 + adds r3, r0 + ldrb r0, [r3] + ands r1, r0 + strb r1, [r3] + ldrb r2, [r4] + movs r1, 0x7 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + ldrb r0, [r3] + ands r1, r0 + strb r1, [r3] + ldrb r2, [r4] + movs r1, 0x2 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + ldrb r0, [r3] + ands r1, r0 + strb r1, [r3] +_0817F324: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817F32C: .4byte 0x02022fec +_0817F330: .4byte 0x0202449c +_0817F334: .4byte 0x0000025b +_0817F338: .4byte 0x00000267 + thumb_func_end sub_817F2A8 + + thumb_func_start sub_817F33C +sub_817F33C: @ 817F33C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r6, _0817F360 + cmp r0, 0 + bne _0817F356 + ldr r6, _0817F364 +_0817F356: + movs r4, 0 + ldr r1, _0817F368 + lsls r0, r5, 1 + adds r5, r0, r1 + b _0817F36E + .align 2, 0 +_0817F360: .4byte 0x02024744 +_0817F364: .4byte 0x020244ec +_0817F368: .4byte 0x0202406e +_0817F36C: + adds r4, 0x1 +_0817F36E: + cmp r4, 0x3 + bgt _0817F388 + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + adds r0, r6, r0 + adds r1, r4, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + cmp r0, r7 + bne _0817F36C +_0817F388: + lsls r0, r4, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_817F33C + + thumb_func_start sub_817F394 +sub_817F394: @ 817F394 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + adds r4, r3, 0 + lsls r1, 16 + lsrs r1, 16 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r5, r2, 0 + movs r0, 0x7 + ands r0, r3 + cmp r0, 0 + beq _0817F3B4 + movs r0, 0x3 + b _0817F3CA +_0817F3B4: + movs r0, 0x60 + ands r0, r3 + cmp r0, 0 + beq _0817F3C0 + movs r0, 0x4 + b _0817F3CA +_0817F3C0: + movs r0, 0x18 + ands r0, r3 + cmp r0, 0 + beq _0817F3D2 + movs r0, 0x5 +_0817F3CA: + movs r3, 0 + bl sub_817E684 + b _0817F3E6 +_0817F3D2: + movs r0, 0x80 + ands r4, r0 + cmp r4, 0 + beq _0817F3E6 + movs r0, 0x6 + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817E684 +_0817F3E6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817F394 + + thumb_func_start nullsub_69 +nullsub_69: @ 817F3EC + bx lr + thumb_func_end nullsub_69 + + thumb_func_start sub_817F3F0 +sub_817F3F0: @ 817F3F0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r9, r0 + mov r8, r1 + adds r5, r2, 0 + adds r4, r3, 0 + lsls r5, 16 + negs r5, r5 + lsls r4, 16 + negs r4, r4 + lsrs r4, 16 + mov r0, r8 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + asrs r5, 16 + adds r1, r5, 0 + bl cosine + adds r6, r0, 0 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + bl sine + subs r6, r0 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + adds r1, r4, 0 + bl cosine + adds r2, r0, 0 + mov r0, r8 + adds r1, r5, 0 + str r2, [sp] + bl sine + ldr r2, [sp] + adds r2, r0 + negs r5, r5 + negs r4, r4 + lsls r6, 16 + asrs r6, 16 + lsls r5, 16 + asrs r5, 16 + adds r6, r5 + mov r0, r9 + strh r6, [r0, 0x24] + lsls r2, 16 + asrs r2, 16 + lsls r4, 16 + asrs r4, 16 + adds r2, r4 + strh r2, [r0, 0x26] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817F3F0 + + thumb_func_start sub_817F474 +sub_817F474: @ 817F474 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0817F488 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0817F48C + movs r0, 0 + b _0817F492 + .align 2, 0 +_0817F488: .4byte 0x0860a8c8 +_0817F48C: + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_0817F492: + pop {r1} + bx r1 + thumb_func_end sub_817F474 + + thumb_func_start sub_817F498 +sub_817F498: @ 817F498 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0817F534 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0xA + ldrsh r0, [r2, r3] + lsls r3, r0, 16 + movs r4, 0xC + ldrsh r0, [r2, r4] + orrs r3, r0 + movs r0, 0x8 + ldrsh r4, [r2, r0] + mov r8, r1 + ldr r0, _0817F538 + mov r12, r0 + cmp r4, 0 + bne _0817F508 + ldrh r0, [r3, 0x2E] + strh r0, [r2, 0x10] + ldrh r0, [r3, 0x32] + strh r0, [r2, 0x12] + movs r0, 0x1 + strh r0, [r3, 0x30] + strh r4, [r3, 0x2E] + movs r0, 0x2 + adds r1, r6, 0 + ldr r6, _0817F53C + ldr r7, _0817F540 + movs r4, 0 + adds r2, r3, 0 + adds r2, 0x32 +_0817F4E2: + strh r4, [r2] + adds r2, 0x2 + adds r0, 0x1 + cmp r0, 0x7 + bls _0817F4E2 + adds r1, r5 + lsls r1, 3 + add r1, r8 + movs r2, 0xE + ldrsh r0, [r1, r2] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + str r0, [r3, 0x1C] + movs r0, 0 + str r0, [r7] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0817F508: + ldr r0, [r3, 0x1C] + cmp r0, r12 + bne _0817F528 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x10] + movs r2, 0 + strh r1, [r3, 0x2E] + ldrh r0, [r0, 0x12] + strh r0, [r3, 0x32] + strh r2, [r3, 0x30] + adds r0, r5, 0 + bl remove_task +_0817F528: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0817F534: .4byte 0x03005e00 +_0817F538: .4byte nullsub_12 + 1 +_0817F53C: .4byte 0x0860aa88 +_0817F540: .4byte 0x03001274 + thumb_func_end sub_817F498 + + thumb_func_start sub_817F544 +sub_817F544: @ 817F544 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r0, _0817F570 + movs r1, 0x80 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0817F574 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsrs r0, r5, 16 + strh r0, [r1, 0xA] + strh r5, [r1, 0xC] + strh r4, [r1, 0xE] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0817F570: .4byte sub_817F498 + 1 +_0817F574: .4byte 0x03005e00 + thumb_func_end sub_817F544 + + thumb_func_start sub_817F578 +sub_817F578: @ 817F578 + lsls r1, 24 + ldr r3, _0817F58C + movs r2, 0x1 + str r2, [r3] + ldr r2, _0817F590 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_0817F58C: .4byte 0x03001274 +_0817F590: .4byte 0x0860aa88 + thumb_func_end sub_817F578 + + thumb_func_start sub_817F594 +sub_817F594: @ 817F594 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r6, r1, 24 + lsrs r6, 24 + ldr r0, _0817F5F4 + movs r1, 0x80 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0817F5F8 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + lsrs r0, r5, 16 + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] + ldrh r0, [r5, 0x2E] + lsls r0, 24 + ldr r1, _0817F5FC + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0817F600 + adds r0, r1 + bl get_nature + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 1 + ldr r2, _0817F604 + adds r0, r2 + adds r1, r6 + ldrb r0, [r0] + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _0817F608 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0817F5F4: .4byte sub_817F498 + 1 +_0817F5F8: .4byte 0x03005e00 +_0817F5FC: .4byte 0x0202406e +_0817F600: .4byte 0x020244ec +_0817F604: .4byte 0x0860ad2f +_0817F608: .4byte 0x0860ace4 + thumb_func_end sub_817F594 + + thumb_func_start sub_817F60C +sub_817F60C: @ 817F60C + ldr r1, _0817F614 + str r1, [r0, 0x1C] + bx lr + .align 2, 0 +_0817F614: .4byte nullsub_69 + 1 + thumb_func_end sub_817F60C + + thumb_func_start sub_817F618 +sub_817F618: @ 817F618 + push {r4,r5,lr} + sub sp, 0x10 + lsls r1, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, _0817F668 + lsls r2, 16 + lsrs r1, 16 + orrs r1, r2 + str r1, [sp] + ldr r1, [sp, 0x4] + ands r1, r4 + orrs r1, r3 + str r1, [sp, 0x4] + 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 _082E709C + ldr r0, _0817F66C + 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 + .align 2, 0 +_0817F668: .4byte 0xffff0000 +_0817F66C: .4byte 0x02021bc0 + thumb_func_end sub_817F618 + + thumb_func_start sub_817F670 +sub_817F670: @ 817F670 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _0817F6A0 + str r0, [r4, 0x10] + ldr r0, _0817F6A4 + ldr r0, [r0] + cmp r0, 0x1 + bne _0817F68E + adds r0, r4, 0 + bl obj_alloc_rotscale_entry +_0817F68E: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817F6A8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8008258 + b _0817F6B0 + .align 2, 0 +_0817F6A0: .4byte 0x0860ad68 +_0817F6A4: .4byte 0x03001274 +_0817F6A8: + adds r0, r4, 0 + movs r1, 0 + bl sub_8008258 +_0817F6B0: + 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 oam_center + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F670 + + thumb_func_start sub_817F6D4 +sub_817F6D4: @ 817F6D4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + movs r5, 0x30 + ldrsh r0, [r4, r5] + cmp r0, 0 + bne _0817F6F8 + lsls r0, r1, 16 + negs r0, r0 + lsrs r1, r0, 16 + negs r0, r3 + lsls r0, 16 + lsrs r3, r0, 16 +_0817F6F8: + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + bl sub_817F618 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817F6D4 + + thumb_func_start sub_817F70C +sub_817F70C: @ 817F70C + push {lr} + adds r1, r0, 0 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0817F720 + movs r2, 0x24 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x24] +_0817F720: + pop {r0} + bx r0 + thumb_func_end sub_817F70C + + thumb_func_start sub_817F724 +sub_817F724: @ 817F724 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bhi _0817F750 + ldr r1, _0817F74C + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x6] + strh r2, [r0] + movs r1, 0x1 + strh r1, [r0, 0x4] + strh r2, [r0, 0x2] + strh r2, [r0, 0x8] + movs r0, 0x1 + b _0817F752 + .align 2, 0 +_0817F74C: .4byte 0x03001240 +_0817F750: + movs r0, 0 +_0817F752: + pop {r1} + bx r1 + thumb_func_end sub_817F724 + + thumb_func_start sub_817F758 +sub_817F758: @ 817F758 + push {r4,lr} + ldr r4, _0817F778 + ldrb r1, [r4] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 2 + lsls r0, 2 + subs r0, r2, r0 + strb r0, [r4] + ldrb r0, [r4] + bl sub_817F724 + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0817F778: .4byte 0x03001270 + thumb_func_end sub_817F758 + + thumb_func_start sub_817F77C +sub_817F77C: @ 817F77C + push {r4,r5,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + movs r3, 0x4 + negs r3, r3 + ands r3, r0 + movs r5, 0x1 + orrs r3, r5 + strb 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 oam_center + ldr r0, _0817F7BC + ldr r0, [r0] + cmp r0, 0x1 + bne _0817F800 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817F7C0 + adds r1, r4, 0 + adds r1, 0x3F + ldrb r0, [r1] + orrs r0, r5 + strb r0, [r1] + adds r5, r1, 0 + b _0817F7D0 + .align 2, 0 +_0817F7BC: .4byte 0x03001274 +_0817F7C0: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r2, [r0] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + adds r5, r0, 0 +_0817F7D0: + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + ldrb r0, [r5] + lsls r0, 31 + lsrs r0, 31 + lsls r0, 3 + orrs r1, r0 + lsls r1, 1 + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0817F800: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817F77C + + thumb_func_start pokemonanimfunc_01 +pokemonanimfunc_01: @ 817F808 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0817F81A + adds r0, r6, 0 + bl sub_817F670 +_0817F81A: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x28 + ble _0817F840 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _0817F83C + str r0, [r6, 0x1C] + b _0817F88C + .align 2, 0 +_0817F83C: .4byte sub_8184D88 + 1 +_0817F840: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 9 + movs r1, 0x28 + bl __divsi3 + adds r4, r0, 0 + cmp r0, 0 + bge _0817F854 + adds r4, 0xFF +_0817F854: + asrs r4, 8 + lsls r4, 8 + subs r4, r0, r4 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x20 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x20 + bl cosine + adds r0, r5 + strh r0, [r6, 0x38] + movs r0, 0x36 + ldrsh r1, [r6, r0] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F6D4 +_0817F88C: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_01 + + thumb_func_start pokemonanimfunc_02 +pokemonanimfunc_02: @ 817F898 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _0817F8B4 + ldr r0, _0817F8B0 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817F8EE + .align 2, 0 +_0817F8B0: .4byte sub_8184D88 + 1 +_0817F8B4: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _0817F8C0 + movs r5, 0x1 +_0817F8C0: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817F8D4 + adds r0, 0xFF +_0817F8D4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 +_0817F8EE: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_02 + + thumb_func_start sub_817F8FC +sub_817F8FC: @ 817F8FC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0817F91C + ldr r0, _0817F918 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817F946 + .align 2, 0 +_0817F918: .4byte sub_8184D88 + 1 +_0817F91C: + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 7 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817F936 + adds r0, 0xFF +_0817F936: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine +_0817F946: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F8FC + + thumb_func_start pokemonanimfunc_03 +pokemonanimfunc_03: @ 817F95C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x28 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F8FC + ldr r0, _0817F974 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817F974: .4byte sub_817F8FC + 1 + thumb_func_end pokemonanimfunc_03 + + thumb_func_start sub_817F978 +sub_817F978: @ 817F978 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0817F998 + ldr r0, _0817F994 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817F9C4 + .align 2, 0 +_0817F994: .4byte sub_8184D88 + 1 +_0817F998: + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 7 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817F9B2 + adds r0, 0xFF +_0817F9B2: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine + negs r0, r0 +_0817F9C4: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F978 + + thumb_func_start pokemonanimfunc_04 +pokemonanimfunc_04: @ 817F9D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x28 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F978 + ldr r0, _0817F9F0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817F9F0: .4byte sub_817F978 + 1 + thumb_func_end pokemonanimfunc_04 + + thumb_func_start sub_817F9F4 +sub_817F9F4: @ 817F9F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0xC0 + lsls r0, 1 + cmp r1, r0 + ble _0817FA14 + ldr r0, _0817FA10 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0817FA5E + .align 2, 0 +_0817FA10: .4byte sub_8184D88 + 1 +_0817FA14: + adds r0, r1, 0 + cmp r1, 0 + bge _0817FA1C + adds r0, 0x7F +_0817FA1C: + asrs r2, r0, 7 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0 + blt _0817FA60 + cmp r0, 0x1 + ble _0817FA48 + cmp r0, 0x3 + bgt _0817FA60 + ldr r2, _0817FA44 + adds r1, r2 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x2E + ldrsh r2, [r4, r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 16 + b _0817FA56 + .align 2, 0 +_0817FA44: .4byte 0xffffff00 +_0817FA48: + lsls r0, r2, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r1, 17 +_0817FA56: + asrs r1, 16 + bl sine + negs r0, r0 +_0817FA5E: + strh r0, [r4, 0x26] +_0817FA60: + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F9F4 + + thumb_func_start pokemonanimfunc_1E +pokemonanimfunc_1E: @ 817FA6C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F9F4 + ldr r0, _0817FA84 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817FA84: .4byte sub_817F9F4 + 1 + thumb_func_end pokemonanimfunc_1E + + thumb_func_start pokemonanimfunc_06 +pokemonanimfunc_06: @ 817FA88 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r0, 0xC0 + lsls r0, 2 + cmp r2, r0 + ble _0817FAA8 + ldr r0, _0817FAA4 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0817FB56 + .align 2, 0 +_0817FAA4: .4byte sub_8184D88 + 1 +_0817FAA8: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FAB0 + adds r0, 0x7F +_0817FAB0: + lsls r0, 9 + asrs r0, 16 + cmp r0, 0x5 + bhi _0817FB3C + lsls r0, 2 + ldr r1, _0817FAC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0817FAC4: .4byte _0817FAC8 + .align 2, 0 +_0817FAC8: + .4byte _0817FAE0 + .4byte _0817FAE0 + .4byte _0817FAE4 + .4byte _0817FAE8 + .4byte _0817FB04 + .4byte _0817FB1E +_0817FAE0: + movs r0, 0 + b _0817FB3A +_0817FAE4: + movs r2, 0 + b _0817FB3C +_0817FAE8: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FAF0 + adds r0, 0x7F +_0817FAF0: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _0817FB00 + adds r0, 0x7F +_0817FB00: + asrs r0, 7 + b _0817FB3A +_0817FB04: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FB0C + adds r0, 0x7F +_0817FB0C: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + cmp r0, 0 + bge _0817FB18 + adds r0, 0x7 +_0817FB18: + asrs r0, 3 + subs r0, 0x8 + b _0817FB3A +_0817FB1E: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FB26 + adds r0, 0x7F +_0817FB26: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _0817FB36 + adds r0, 0x7F +_0817FB36: + asrs r0, 7 + adds r0, 0x8 +_0817FB3A: + strh r0, [r4, 0x24] +_0817FB3C: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FB44 + adds r0, 0x7F +_0817FB44: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 +_0817FB56: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_06 + + thumb_func_start pokemonanimfunc_09 +pokemonanimfunc_09: @ 817FB64 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0817FB76 + adds r0, r6, 0 + bl sub_817F670 +_0817FB76: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x28 + ble _0817FB9C + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _0817FB98 + str r0, [r6, 0x1C] + b _0817FC12 + .align 2, 0 +_0817FB98: .4byte sub_8184D88 + 1 +_0817FB9C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817FBB0 + adds r0, 0xFF +_0817FBB0: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldrh r0, [r6, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0817FBE0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x20 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x20 + b _0817FBFA +_0817FBE0: + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x8 +_0817FBFA: + bl sine + adds r0, r5 + strh r0, [r6, 0x38] + movs r0, 0x36 + ldrsh r1, [r6, r0] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F6D4 +_0817FC12: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_09 + + thumb_func_start sub_817FC20 +sub_817FC20: @ 817FC20 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817FC32 + strh r0, [r4, 0x34] +_0817FC32: + ldr r2, _0817FC58 + movs r5, 0x34 + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r2, 0x2 + adds r3, r0, r1 + movs r1, 0 + ldrsb r1, [r3, r1] + movs r5, 0x32 + ldrsh r0, [r4, r5] + cmp r1, r0 + bne _0817FC6A + adds r0, r1, 0 + cmp r0, 0 + bne _0817FC60 + ldr r0, _0817FC5C + str r0, [r4, 0x1C] + b _0817FC6A + .align 2, 0 +_0817FC58: .4byte 0x0860ad70 +_0817FC5C: .4byte sub_8184D88 + 1 +_0817FC60: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x34] + strh r1, [r4, 0x32] +_0817FC6A: + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r1, r0, r1 + adds r0, r2, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _0817FC8C + ldr r0, _0817FC88 + str r0, [r4, 0x1C] + b _0817FCBE + .align 2, 0 +_0817FC88: .4byte sub_8184D88 + 1 +_0817FC8C: + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r5, 0x34 + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C +_0817FCBE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817FC20 + + thumb_func_start pokemonanimfunc_0A +pokemonanimfunc_0A: @ 817FCC4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817FC20 + ldr r0, _0817FCD8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817FCD8: .4byte sub_817FC20 + 1 + thumb_func_end pokemonanimfunc_0A + + thumb_func_start sub_817FCDC +sub_817FCDC: @ 817FCDC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x90 + lsls r0, 4 + cmp r1, r0 + ble _0817FCF8 + ldr r0, _0817FCF4 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817FD12 + .align 2, 0 +_0817FCF4: .4byte sub_8184D88 + 1 +_0817FCF8: + adds r0, r1, 0 + cmp r1, 0 + bge _0817FD00 + adds r0, 0xFF +_0817FD00: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine +_0817FD12: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817FCDC + + thumb_func_start pokemonanimfunc_0F +pokemonanimfunc_0F: @ 817FD24 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817FCDC + ldr r0, _0817FD40 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817FD40: .4byte sub_817FCDC + 1 + thumb_func_end pokemonanimfunc_0F + + thumb_func_start sub_817FD44 +sub_817FD44: @ 817FD44 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x90 + lsls r0, 4 + cmp r1, r0 + ble _0817FD60 + ldr r0, _0817FD5C + str r0, [r4, 0x1C] + movs r0, 0 + b _0817FD78 + .align 2, 0 +_0817FD5C: .4byte sub_8184D88 + 1 +_0817FD60: + adds r0, r1, 0 + cmp r1, 0 + bge _0817FD68 + adds r0, 0xFF +_0817FD68: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl sine +_0817FD78: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817FD44 + + thumb_func_start pokemonanimfunc_10 +pokemonanimfunc_10: @ 817FD88 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817FD44 + ldr r0, _0817FDA0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817FDA0: .4byte sub_817FD44 + 1 + thumb_func_end pokemonanimfunc_10 + + thumb_func_start pokemonanimfunc_11 +pokemonanimfunc_11: @ 817FDA4 + push {r4-r7,lr} + adds r7, r0, 0 + ldrh r2, [r7, 0x32] + movs r0, 0x32 + ldrsh r1, [r7, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _0817FDC8 + ldr r0, _0817FDC4 + str r0, [r7, 0x1C] + movs r0, 0 + strh r0, [r7, 0x24] + strh r0, [r7, 0x26] + b _0817FE24 + .align 2, 0 +_0817FDC4: .4byte sub_8184D88 + 1 +_0817FDC8: + movs r0, 0x1 + ands r0, r2 + movs r5, 0xFF + cmp r0, 0 + bne _0817FDD4 + movs r5, 0x1 +_0817FDD4: + movs r1, 0x32 + ldrsh r0, [r7, r1] + cmp r0, 0 + bge _0817FDDE + adds r0, 0x3 +_0817FDDE: + asrs r0, 2 + movs r1, 0x8 + bl sine + lsls r0, 16 + asrs r6, r0, 16 + movs r0, 0x32 + ldrsh r1, [r7, r0] + adds r4, r1, 0 + cmp r1, 0 + bge _0817FDF6 + adds r4, 0xFF +_0817FDF6: + asrs r4, 8 + lsls r4, 8 + subs r4, r1, r4 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + adds r1, r6, 0 + bl sine + lsls r5, 24 + asrs r5, 24 + adds r1, r0, 0 + muls r1, r5 + adds r0, r1, 0 + strh r0, [r7, 0x26] + adds r0, r4, 0 + adds r1, r6, 0 + bl cosine + adds r1, r0, 0 + muls r1, r5 + adds r0, r1, 0 + strh r0, [r7, 0x24] +_0817FE24: + ldrh r0, [r7, 0x32] + adds r0, 0x9 + strh r0, [r7, 0x32] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_11 + + thumb_func_start sub_817FE30 +sub_817FE30: @ 817FE30 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r2, _0817FE50 + ldrh r6, [r4, 0x2E] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + ldrh r0, [r5] + cmp r0, 0 + beq _0817FE54 + subs r0, 0x1 + strh r0, [r5] + b _0817FEF8 + .align 2, 0 +_0817FE50: .4byte 0x03001240 +_0817FE54: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817FE70 + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0817FE70 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0817FE70: + ldr r2, _0817FEB0 + lsls r1, r6, 16 + asrs r1, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r1, r0 + ble _0817FEC4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r5, 0x4] + movs r2, 0x4 + ldrsh r0, [r5, r2] + cmp r0, 0x1 + ble _0817FEB4 + subs r0, r1, 0x1 + movs r1, 0 + strh r0, [r5, 0x4] + movs r0, 0xA + strh r0, [r5] + strh r1, [r4, 0x32] + b _0817FEF2 + .align 2, 0 +_0817FEB0: .4byte 0x03001240 +_0817FEB4: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0817FEC0 + str r0, [r4, 0x1C] + b _0817FEF2 + .align 2, 0 +_0817FEC0: .4byte sub_8184D88 + 1 +_0817FEC4: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _0817FED0 + adds r0, 0xFF +_0817FED0: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x80 + lsls r1, 5 + bl sine + strh r0, [r4, 0x3A] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 +_0817FEF2: + ldrh r0, [r4, 0x32] + adds r0, 0x10 + strh r0, [r4, 0x32] +_0817FEF8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817FE30 + + thumb_func_start pokemonanimfunc_12 +pokemonanimfunc_12: @ 817FF00 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + strh r0, [r4, 0x2E] + ldr r2, _0817FF34 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 2 + strh r0, [r1, 0x6] + strh r3, [r1] + adds r0, r4, 0 + bl sub_817FE30 + ldr r0, _0817FF38 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817FF34: .4byte 0x03001240 +_0817FF38: .4byte sub_817FE30 + 1 + thumb_func_end pokemonanimfunc_12 + + thumb_func_start sub_817FF3C +sub_817FF3C: @ 817FF3C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817FF54 + adds r0, r4, 0 + bl sub_817F670 +_0817FF54: + movs r2, 0x32 + ldrsh r6, [r4, r2] + ldr r1, _0817FF84 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + cmp r6, r1 + ble _0817FF8C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0817FF88 + str r0, [r4, 0x1C] + b _0817FFAA + .align 2, 0 +_0817FF84: .4byte 0x03001240 +_0817FF88: .4byte sub_8184D88 + 1 +_0817FF8C: + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + muls r0, r6 + strh r0, [r4, 0x3A] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 +_0817FFAA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817FF3C + + thumb_func_start pokemonanimfunc_1F +pokemonanimfunc_1F: @ 817FFB8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _0817FFE8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3C + strh r0, [r1] + movs r0, 0x14 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_817FF3C + ldr r0, _0817FFEC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0817FFE8: .4byte 0x03001240 +_0817FFEC: .4byte sub_817FF3C + 1 + thumb_func_end pokemonanimfunc_1F + + thumb_func_start sub_817FFF0 +sub_817FFF0: @ 817FFF0 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + bl sub_817F70C + ldr r1, _08180024 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r6, r0, r1 + movs r0, 0x32 + ldrsh r1, [r5, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818002C + movs r0, 0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + ldr r0, _08180028 + str r0, [r5, 0x1C] + b _0818006A + .align 2, 0 +_08180024: .4byte 0x03001240 +_08180028: .4byte sub_8184D88 + 1 +_0818002C: + movs r0, 0x32 + ldrsh r1, [r5, r0] + adds r0, r1, 0 + adds r0, 0xC0 + adds r4, r0, 0 + cmp r0, 0 + bge _0818003E + ldr r2, _08180088 + adds r4, r1, r2 +_0818003E: + asrs r4, 8 + lsls r4, 8 + subs r4, r0, r4 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r1, 17 + asrs r1, 16 + adds r0, r4, 0 + bl cosine + negs r0, r0 + strh r0, [r5, 0x24] + movs r2, 0x8 + ldrsh r1, [r6, r2] + adds r0, r4, 0 + bl sine + ldrh r1, [r6, 0x8] + adds r0, r1 + strh r0, [r5, 0x26] +_0818006A: + ldr r0, _0818008C + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x2] + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F70C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08180088: .4byte 0x000001bf +_0818008C: .4byte 0x03001240 + thumb_func_end sub_817FFF0 + + thumb_func_start pokemonanimfunc_14 +pokemonanimfunc_14: @ 8180090 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _081800C8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 2 + strh r0, [r1, 0x6] + movs r0, 0x6 + strh r0, [r1, 0x8] + movs r0, 0x18 + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_817FFF0 + ldr r0, _081800CC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081800C8: .4byte 0x03001240 +_081800CC: .4byte sub_817FFF0 + 1 + thumb_func_end pokemonanimfunc_14 + + thumb_func_start pokemonanimfunc_15 +pokemonanimfunc_15: @ 81800D0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081800EC + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_081800EC: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _0818010C + ldrh r0, [r4, 0x3C] + movs r1, 0x10 + movs r2, 0 + movs r3, 0 + bl pal_fade_1 + ldr r0, _08180108 + str r0, [r4, 0x1C] + b _08180128 + .align 2, 0 +_08180108: .4byte sub_8184D88 + 1 +_0818010C: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x10 + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0x10 + movs r3, 0 + bl pal_fade_1 +_08180128: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_15 + + thumb_func_start pokemonanimfunc_16 +pokemonanimfunc_16: @ 8180134 + push {r4-r7,lr} + adds r6, r0, 0 + movs r7, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08180148 + adds r0, r6, 0 + bl sub_817F670 +_08180148: + ldrh r5, [r6, 0x32] + movs r2, 0x32 + ldrsh r0, [r6, r2] + cmp r0, 0x28 + ble _08180170 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _0818016C + str r0, [r6, 0x1C] + b _08180204 + .align 2, 0 +_0818016C: .4byte sub_8184D88 + 1 +_08180170: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bhi _08180196 + ldrh r0, [r6, 0x3C] + adds r0, 0x33 + strh r0, [r6, 0x3C] + movs r7, 0xFF + ands r7, r0 +_08180196: + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _081801C4 + lsls r5, r4, 16 + asrs r0, r5, 16 + movs r1, 0x28 + bl sine + adds r4, r0, 0 + adds r0, r7, 0 + movs r1, 0x10 + bl sine + ldr r1, _081801C0 + adds r0, r1 + adds r4, r0 + strh r4, [r6, 0x36] + adds r4, r5, 0 + b _081801E4 + .align 2, 0 +_081801C0: .4byte 0xffffff00 +_081801C4: + adds r0, r7, 0 + movs r1, 0x10 + bl sine + adds r5, r0, 0 + lsls r4, 16 + asrs r0, r4, 16 + movs r1, 0x28 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r5 + subs r1, r0 + strh r1, [r6, 0x36] +_081801E4: + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r6, 0x38] + movs r2, 0x36 + ldrsh r1, [r6, r2] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F618 +_08180204: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_16 + + thumb_func_start pokemonanimfunc_17 +pokemonanimfunc_17: @ 8180210 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r0, 0 + mov r8, r0 + movs r7, 0 + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0818022C + adds r0, r5, 0 + bl sub_817F670 +_0818022C: + ldrh r6, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0x28 + ble _08180258 + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r5, 0 + bl sub_817F77C + ldr r0, _08180254 + str r0, [r5, 0x1C] + mov r0, r8 + strh r0, [r5, 0x26] + b _0818030A + .align 2, 0 +_08180254: .4byte sub_8184D88 + 1 +_08180258: + movs r1, 0x32 + ldrsh r0, [r5, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r6, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bhi _0818027E + ldrh r0, [r5, 0x3C] + adds r0, 0x33 + strh r0, [r5, 0x3C] + movs r7, 0xFF + ands r7, r0 +_0818027E: + movs r2, 0x30 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _081802A0 + lsls r4, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + ldr r2, _0818029C + adds r1, r2, 0 + subs r1, r0 + strh r1, [r5, 0x36] + b _081802B2 + .align 2, 0 +_0818029C: .4byte 0xffffff00 +_081802A0: + lsls r4, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r5, 0x36] +_081802B2: + adds r6, r4, 0 + adds r0, r7, 0 + movs r1, 0x8 + bl sine + adds r4, r0, 0 + asrs r0, r6, 16 + movs r1, 0x28 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r4, r1, r4 + subs r4, r0 + strh r4, [r5, 0x38] + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + cmp r4, r1 + beq _081802F0 + movs r2, 0x38 + ldrsh r0, [r5, r2] + subs r0, r1, r0 + cmp r0, 0 + bge _081802EA + adds r0, 0x7 +_081802EA: + lsls r0, 13 + lsrs r0, 16 + mov r8, r0 +_081802F0: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r5, 0x26] + movs r2, 0x36 + ldrsh r1, [r5, r2] + movs r0, 0x38 + ldrsh r2, [r5, r0] + adds r0, r5, 0 + movs r3, 0 + bl sub_817F618 +_0818030A: + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_17 + + thumb_func_start sub_818031C +sub_818031C: @ 818031C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _08180368 + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r0, 1 + adds r1, r0, r2 + ldrb r5, [r1] + adds r2, 0x1 + adds r0, r2 + ldrb r6, [r0] + movs r1, 0 + cmp r5, 0xFE + beq _08180358 + subs r0, r6, r7 + muls r0, r5 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r1, r0, 24 +_08180358: + cmp r5, 0xFF + bne _08180370 + ldr r0, _0818036C + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x26] + b _08180394 + .align 2, 0 +_08180368: .4byte 0x0860aa80 +_0818036C: .4byte sub_8184D88 + 1 +_08180370: + mov r0, r8 + bl sine + strh r0, [r4, 0x26] + cmp r7, r6 + bne _08180386 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r0, 0 + b _08180392 +_08180386: + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 +_08180392: + strh r0, [r4, 0x3A] +_08180394: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_818031C + + thumb_func_start pokemonanimfunc_19 +pokemonanimfunc_19: @ 81803A0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x30 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_818031C + ldr r0, _081803B8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081803B8: .4byte sub_818031C + 1 + thumb_func_end pokemonanimfunc_19 + + thumb_func_start pokemonanimfunc_1A +pokemonanimfunc_1A: @ 81803BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + lsls r7, r0, 24 + lsrs r5, r7, 24 + mov r8, r5 + cmp r0, 0 + bne _081803DA + adds r0, r4, 0 + bl sub_817F670 +_081803DA: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x23 + ble _08180404 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08180400 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0818045E + .align 2, 0 +_08180400: .4byte sub_8184D88 + 1 +_08180404: + adds r6, r5, 0 + subs r6, 0xA + lsls r0, r6, 7 + movs r1, 0x14 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r5, 0x9 + bhi _0818042A + movs r2, 0x80 + lsls r2, 1 + lsrs r3, r7, 25 + lsls r3, 9 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + b _0818045E +_0818042A: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08180442 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x5 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + b _0818045E +_08180442: + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x23 + mov r0, r8 + subs r3, r0 + lsrs r0, r3, 31 + adds r3, r0 + asrs r3, 1 + lsls r3, 26 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 +_0818045E: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_1A + + thumb_func_start pokemonanimfunc_1B +pokemonanimfunc_1B: @ 8180474 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08180486 + adds r0, r6, 0 + bl sub_817F670 +_08180486: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x64 + ble _081804B0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r0, 0 + strh r0, [r6, 0x26] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _081804AC + str r0, [r6, 0x1C] + b _081804E8 + .align 2, 0 +_081804AC: .4byte sub_8184D88 + 1 +_081804B0: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl sine + strh r0, [r6, 0x26] + movs r5, 0x80 + lsls r5, 1 + ldr r1, _081804F4 + adds r0, r4, 0 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 +_081804E8: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081804F4: .4byte 0x00000ccc + thumb_func_end pokemonanimfunc_1B + + thumb_func_start sub_81804F8 +sub_81804F8: @ 81804F8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0818050C + adds r0, r6, 0 + bl sub_817F670 +_0818050C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x64 + ble _08180534 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r6, 0x26] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _08180530 + str r0, [r6, 0x1C] + b _08180582 + .align 2, 0 +_08180530: .4byte sub_8184D88 + 1 +_08180534: + movs r0, 0x32 + ldrsh r5, [r6, r0] + lsls r0, r5, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 9 + adds r0, r5, 0 + movs r1, 0x64 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0xFF + ands r5, r0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x2E + ldrsh r1, [r6, r0] + adds r0, r4, 0 + bl sine + strh r0, [r6, 0x26] + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + ldr r1, _08180590 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_817F6D4 +_08180582: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08180590: .4byte 0x00000ccc + thumb_func_end sub_81804F8 + + thumb_func_start pokemonanimfunc_1C +pokemonanimfunc_1C: @ 8180594 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_81804F8 + ldr r0, _081805AC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081805AC: .4byte sub_81804F8 + 1 + thumb_func_end pokemonanimfunc_1C + + thumb_func_start sub_81805B0 +sub_81805B0: @ 81805B0 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081805C4 + adds r0, r6, 0 + bl sub_817F670 +_081805C4: + movs r2, 0x32 + ldrsh r0, [r6, r2] + cmp r0, 0x64 + ble _081805EC + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r6, 0x26] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _081805E8 + str r0, [r6, 0x1C] + b _08180644 + .align 2, 0 +_081805E8: .4byte sub_8184D88 + 1 +_081805EC: + movs r0, 0x32 + ldrsh r5, [r6, r0] + lsls r0, r5, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 9 + adds r0, r5, 0 + movs r1, 0x64 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0xFF + ands r5, r0 + lsls r4, 16 + asrs r0, r4, 16 + lsrs r4, 31 + adds r0, r4 + asrs r0, 1 + movs r2, 0x2E + ldrsh r1, [r6, r2] + lsls r1, 17 + asrs r1, 16 + bl sine + negs r0, r0 + strh r0, [r6, 0x26] + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + ldr r1, _08180650 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_817F6D4 +_08180644: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08180650: .4byte 0x00000ccc + thumb_func_end sub_81805B0 + + thumb_func_start pokemonanimfunc_18 +pokemonanimfunc_18: @ 8180654 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_81805B0 + ldr r0, _0818066C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818066C: .4byte sub_81805B0 + 1 + thumb_func_end pokemonanimfunc_18 + + thumb_func_start pokemonanimfunc_1D +pokemonanimfunc_1D: @ 8180670 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_817F70C + movs r5, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08180688 + adds r0, r6, 0 + bl sub_817F670 +_08180688: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x64 + ble _081806B0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r6, 0x24] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _081806AC + str r0, [r6, 0x1C] + b _081806FC + .align 2, 0 +_081806AC: .4byte sub_8184D88 + 1 +_081806B0: + movs r0, 0x32 + ldrsh r5, [r6, r0] + lsls r0, r5, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 9 + adds r0, r5, 0 + movs r1, 0x64 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0xFF + ands r5, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + strh r0, [r6, 0x24] + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + ldr r1, _08180710 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_817F6D4 +_081806FC: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08180710: .4byte 0x00000ccc + thumb_func_end pokemonanimfunc_1D + + thumb_func_start sub_8180714 +sub_8180714: @ 8180714 + push {r4-r6,lr} + adds r4, r0, 0 + movs r6, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0818072A + adds r0, r4, 0 + bl sub_817F670 + strh r6, [r4, 0x34] +_0818072A: + adds r0, r4, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + cmp r2, r0 + ble _08180760 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r6, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0818075C + str r0, [r4, 0x1C] + b _081807FE + .align 2, 0 +_0818075C: .4byte sub_8184D88 + 1 +_08180760: + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08180796 + adds r2, r0, 0 + lsls r0, r2, 1 + cmp r1, r0 + bge _08180796 + movs r0, 0x80 + adds r1, r2, 0 + bl __divsi3 + ldrh r1, [r4, 0x34] + adds r1, r0 + strh r1, [r4, 0x34] +_08180796: + lsls r0, r5, 16 + asrs r1, r0, 16 + movs r2, 0x80 + lsls r2, 1 + adds r5, r0, 0 + cmp r1, r2 + ble _081807B0 + subs r0, r2, r1 + cmp r0, 0 + bge _081807AC + adds r0, 0x7 +_081807AC: + lsls r0, 13 + lsrs r6, r0, 16 +_081807B0: + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + negs r0, r0 + lsls r1, r6, 16 + asrs r1, 16 + subs r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + asrs r2, r5, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x80 + bl __divsi3 + ldrh r1, [r4, 0x36] + adds r1, r0 + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0x36] +_081807FE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8180714 + + thumb_func_start pokemonanimfunc_00 +pokemonanimfunc_00: @ 818080C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x10 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_8180714 + ldr r0, _08180824 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180824: .4byte sub_8180714 + 1 + thumb_func_end pokemonanimfunc_00 + + thumb_func_start sub_8180828 +sub_8180828: @ 8180828 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r0, 0x32 + ldrsh r4, [r5, r0] + movs r2, 0x3A + ldrsh r1, [r5, r2] + movs r0, 0x80 + bl __divsi3 + movs r2, 0x3C + ldrsh r1, [r5, r2] + muls r0, r1 + cmp r4, r0 + ble _08180868 + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r6, [r5, 0x26] + adds r0, r5, 0 + bl sub_817F77C + ldr r0, _08180864 + str r0, [r5, 0x1C] + b _081808D0 + .align 2, 0 +_08180864: .4byte sub_8184D88 + 1 +_08180868: + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + ble _08180894 + subs r0, r1, r0 + cmp r0, 0 + bge _08180890 + adds r0, 0x7 +_08180890: + lsls r0, 13 + lsrs r6, r0, 16 +_08180894: + lsls r0, r6, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r5, 0x26] + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x30 + bl sine + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + lsls r2, r4, 16 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x3A] + ldrh r1, [r5, 0x36] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x36] +_081808D0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8180828 + + thumb_func_start pokemonanimfunc_13 +pokemonanimfunc_13: @ 81808D8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081808F2 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x3 + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] +_081808F2: + adds r0, r4, 0 + bl sub_8180828 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_13 + + thumb_func_start sub_8180900 +sub_8180900: @ 8180900 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _081809A4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x6] + str r1, [sp] + ldr r5, _081809A8 + movs r3, 0x36 + ldrsh r2, [r4, r3] + lsls r1, r2, 1 + adds r1, r2 + movs r3, 0x8 + ldrsh r2, [r0, r3] + lsls r0, r2, 1 + adds r0, r2 + lsls r6, r0, 3 + adds r1, r6 + adds r2, r1, r5 + adds r0, r5, 0x1 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + mov r9, r2 + subs r0, r2 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrh r7, [r4, 0x34] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0818096C + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0818096C: + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r6 + adds r5, 0x2 + mov r8, r5 + adds r1, r0, r5 + movs r5, 0 + ldrsb r5, [r1, r5] + cmp r5, 0 + bne _081809B0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _081809AC + str r0, [r4, 0x1C] + b _08180A3A + .align 2, 0 +_081809A4: .4byte 0x03001240 +_081809A8: .4byte 0x0860ad8e +_081809AC: .4byte sub_8184D88 + 1 +_081809B0: + lsls r0, r7, 16 + asrs r5, r0, 16 + lsls r0, r5, 7 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + mov r3, r10 + lsls r0, r3, 16 + asrs r0, 16 + muls r0, r5 + movs r1, 0x36 + ldrsh r2, [r4, r1] + lsls r1, r2, 1 + adds r1, r2 + adds r1, r6 + add r1, r8 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl __divsi3 + add r0, r9 + strh r0, [r4, 0x24] + ldr r2, [sp] + lsls r0, r2, 16 + asrs r0, 16 + movs r3, 0x24 + ldrsh r1, [r4, r3] + muls r0, r1 + negs r0, r0 + cmp r0, 0 + bge _08180A04 + adds r0, 0x7 +_08180A04: + lsls r3, r0, 13 + lsrs r3, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r6 + add r0, r8 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r5, r0 + bne _08180A34 + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r0, 0 + b _08180A38 +_08180A34: + ldrh r0, [r4, 0x34] + adds r0, 0x1 +_08180A38: + strh r0, [r4, 0x34] +_08180A3A: + adds r0, r4, 0 + bl sub_817F70C + 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_8180900 + + thumb_func_start pokemonanimfunc_05 +pokemonanimfunc_05: @ 8180A50 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08180A84 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 5 + strh r0, [r1, 0x6] + ldrh r0, [r4, 0x3A] + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_8180900 + ldr r0, _08180A88 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180A84: .4byte 0x03001240 +_08180A88: .4byte sub_8180900 + 1 + thumb_func_end pokemonanimfunc_05 + + thumb_func_start pokemonanimfunc_20 +pokemonanimfunc_20: @ 8180A8C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180AA8 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180AA8: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180ACC + ldrh r0, [r4, 0x3C] + ldr r3, _08180AC4 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, _08180AC8 + str r0, [r4, 0x1C] + b _08180AE8 + .align 2, 0 +_08180AC4: .4byte 0x000002df +_08180AC8: .4byte sub_8184D88 + 1 +_08180ACC: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08180AF4 + movs r1, 0x10 + bl pal_fade_1 +_08180AE8: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180AF4: .4byte 0x000002df + thumb_func_end pokemonanimfunc_20 + + thumb_func_start pokemonanimfunc_21 +pokemonanimfunc_21: @ 8180AF8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180B14 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180B14: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180B34 + ldrh r0, [r4, 0x3C] + movs r1, 0x10 + movs r2, 0 + movs r3, 0x1F + bl pal_fade_1 + ldr r0, _08180B30 + str r0, [r4, 0x1C] + b _08180B50 + .align 2, 0 +_08180B30: .4byte sub_8184D88 + 1 +_08180B34: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0x10 + movs r3, 0x1F + bl pal_fade_1 +_08180B50: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_21 + + thumb_func_start pokemonanimfunc_22 +pokemonanimfunc_22: @ 8180B5C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180B78 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180B78: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180B98 + ldrh r0, [r4, 0x3C] + movs r3, 0xF8 + lsls r3, 7 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, _08180B94 + str r0, [r4, 0x1C] + b _08180BB6 + .align 2, 0 +_08180B94: .4byte sub_8184D88 + 1 +_08180B98: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0xF8 + lsls r3, 7 + movs r1, 0x10 + bl pal_fade_1 +_08180BB6: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_22 + + thumb_func_start pokemonanimfunc_23 +pokemonanimfunc_23: @ 8180BC4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180BE0 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180BE0: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180C04 + ldrh r0, [r4, 0x3C] + ldr r3, _08180BFC + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, _08180C00 + str r0, [r4, 0x1C] + b _08180C20 + .align 2, 0 +_08180BFC: .4byte 0x000003ff +_08180C00: .4byte sub_8184D88 + 1 +_08180C04: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08180C2C + movs r1, 0x10 + bl pal_fade_1 +_08180C20: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180C2C: .4byte 0x000003ff + thumb_func_end pokemonanimfunc_23 + + thumb_func_start pokemonanimfunc_24 +pokemonanimfunc_24: @ 8180C30 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180C4C + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180C4C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180C70 + ldrh r0, [r4, 0x3C] + ldr r3, _08180C68 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, _08180C6C + str r0, [r4, 0x1C] + b _08180C8C + .align 2, 0 +_08180C68: .4byte 0x00006018 +_08180C6C: .4byte sub_8184D88 + 1 +_08180C70: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08180C98 + movs r1, 0x10 + bl pal_fade_1 +_08180C8C: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180C98: .4byte 0x00006018 + thumb_func_end pokemonanimfunc_24 + + thumb_func_start pokemonanimfunc_25 +pokemonanimfunc_25: @ 8180C9C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, _08180CB0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180CB0: .4byte sub_8180CB4 + 1 + thumb_func_end pokemonanimfunc_25 + + thumb_func_start sub_8180CB4 +sub_8180CB4: @ 8180CB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08180CD6 + movs r0, 0x8 + strh r0, [r4, 0x24] + movs r0, 0x2 + strh r0, [r4, 0x3C] + ldr r0, _08180CE4 + str r0, [r4, 0x1C] +_08180CD6: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180CE4: .4byte sub_8180CE8 + 1 + thumb_func_end sub_8180CB4 + + thumb_func_start sub_8180CE8 +sub_8180CE8: @ 8180CE8 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x3C] + subs r1, r0 + strh r1, [r4, 0x24] + adds r0, 0x1 + adds r2, r0, 0 + strh r0, [r4, 0x3C] + lsls r1, 16 + cmp r1, 0 + bgt _08180D32 + lsls r0, r2, 24 + lsrs r2, r0, 24 + movs r0, 0 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x24] + ldr r5, _08180D40 + movs r3, 0x8 + negs r3, r3 +_08180D14: + subs r0, r1, r2 + lsls r0, 16 + ldrh r1, [r4, 0x3A] + adds r1, 0x1 + strh r1, [r4, 0x3A] + adds r1, r2, 0x1 + lsls r1, 24 + lsrs r2, r1, 24 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, r3 + bgt _08180D14 + movs r0, 0x1 + strh r0, [r4, 0x38] + str r5, [r4, 0x1C] +_08180D32: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08180D40: .4byte sub_8180D44 + 1 + thumb_func_end sub_8180CE8 + + thumb_func_start sub_8180D44 +sub_8180D44: @ 8180D44 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x3C] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, 0x1 + strh r1, [r4, 0x3C] + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r1, [r4, r3] + cmp r0, r1 + ble _08180D84 + strh r2, [r4, 0x38] +_08180D84: + movs r2, 0x80 + lsls r2, 1 + lsls r3, r5, 8 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _08180DAE + strh r1, [r4, 0x24] + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0 + strh r0, [r4, 0x34] + strh r5, [r4, 0x32] + ldr r0, _08180DBC + str r0, [r4, 0x1C] +_08180DAE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08180DBC: .4byte sub_8180DC0 + 1 + thumb_func_end sub_8180D44 + + thumb_func_start sub_8180DC0 +sub_8180DC0: @ 8180DC0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0xB + ble _08180E08 + ldrh r0, [r4, 0x32] + subs r0, 0x2 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bge _08180DE2 + movs r0, 0 + strh r0, [r4, 0x32] +_08180DE2: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x32] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180E1C + ldr r0, _08180E04 + str r0, [r4, 0x1C] + b _08180E1C + .align 2, 0 +_08180E04: .4byte sub_8180E28 + 1 +_08180E08: + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r2, 0x36 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x36] + adds r0, r1, 0x1 + strh r0, [r4, 0x34] +_08180E1C: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8180DC0 + + thumb_func_start sub_8180E28 +sub_8180E28: @ 8180E28 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + adds r0, 0x2 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _08180E4A + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08180E58 + str r0, [r4, 0x1C] +_08180E4A: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180E58: .4byte sub_8184D88 + 1 + thumb_func_end sub_8180E28 + + thumb_func_start pokemonanimfunc_26 +pokemonanimfunc_26: @ 8180E5C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x34] + ldr r0, _08180E74 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180E74: .4byte sub_8180E78 + 1 + thumb_func_end pokemonanimfunc_26 + + thumb_func_start sub_8180E78 +sub_8180E78: @ 8180E78 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x24] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08180EA2 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _08180EA2 + movs r0, 0xA + strh r0, [r4, 0x34] +_08180EA2: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + ble _08180EBA + movs r1, 0 + movs r0, 0x8 + strh r0, [r4, 0x24] + ldr r0, _08180EC8 + strh r0, [r4, 0x26] + strh r1, [r4, 0x36] + ldr r0, _08180ECC + str r0, [r4, 0x1C] +_08180EBA: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180EC8: .4byte 0x0000fff8 +_08180ECC: .4byte sub_8180ED0 + 1 + thumb_func_end sub_8180E78 + + thumb_func_start sub_8180ED0 +sub_8180ED0: @ 8180ED0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl cosine + subs r0, 0x8 + strh r0, [r4, 0x24] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + subs r0, 0x8 + strh r0, [r4, 0x26] + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _08180F08 + movs r0, 0xA0 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + ldr r0, _08180F28 + str r0, [r4, 0x1C] +_08180F08: + ldrh r0, [r4, 0x36] + adds r0, 0x8 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _08180F1A + movs r0, 0x40 + strh r0, [r4, 0x36] +_08180F1A: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08180F28: .4byte sub_8180F2C + 1 + thumb_func_end sub_8180ED0 + + thumb_func_start sub_8180F2C +sub_8180F2C: @ 8180F2C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08180F44 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + b _08180F96 +_08180F44: + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl cosine + subs r0, 0x4 + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x5 + bl sine + negs r0, r0 + adds r0, 0x4 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + subs r0, 0x4 + strh r0, [r4, 0x32] + movs r0, 0x32 + ldrsh r3, [r4, r0] + subs r3, 0x20 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 25 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bgt _08180F96 + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08180FA4 + str r0, [r4, 0x1C] +_08180F96: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08180FA4: .4byte sub_8184D88 + 1 + thumb_func_end sub_8180F2C + + thumb_func_start pokemonanimfunc_27 +pokemonanimfunc_27: @ 8180FA8 + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x34] + movs r2, 0x34 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _08180FBA + subs r0, r1, 0x1 + b _08180FFE +_08180FBA: + movs r2, 0 + movs r1, 0x36 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08180FC6 + movs r2, 0x1 +_08180FC6: + strh r2, [r3, 0x36] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + lsls r2, 2 + ldrb r1, [r0] + movs r4, 0x5 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + orrs r0, r2 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _08180FFC + ldrb r0, [r1] + adds r1, r4, 0 + ands r1, r0 + mov r2, r12 + strb r1, [r2] + ldr r0, _08181008 + str r0, [r3, 0x1C] +_08180FFC: + movs r0, 0x2 +_08180FFE: + strh r0, [r3, 0x34] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181008: .4byte sub_8184D88 + 1 + thumb_func_end pokemonanimfunc_27 + + thumb_func_start pokemonanimfunc_28 +pokemonanimfunc_28: @ 818100C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, _08181020 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181020: .4byte sub_8181024 + 1 + thumb_func_end pokemonanimfunc_28 + + thumb_func_start sub_8181024 +sub_8181024: @ 8181024 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + subs r0, 0x1 + strh r0, [r4, 0x24] + ldrh r1, [r4, 0x26] + adds r1, 0x1 + strh r1, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08181054 + ldr r0, _08181060 + strh r0, [r4, 0x24] + movs r0, 0x10 + strh r0, [r4, 0x26] + ldr r0, _08181064 + str r0, [r4, 0x1C] + movs r0, 0xA0 + strh r0, [r4, 0x32] +_08181054: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181060: .4byte 0x0000fff0 +_08181064: .4byte sub_8181068 + 1 + thumb_func_end sub_8181024 + + thumb_func_start sub_8181068 +sub_8181068: @ 8181068 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + subs r0, 0x4 + strh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x16 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x16 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r0, 0x32 + ldrsh r3, [r4, r0] + subs r3, 0x20 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 25 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bgt _081810B2 + ldr r0, _081810C0 + str r0, [r4, 0x1C] +_081810B2: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081810C0: .4byte sub_81810C4 + 1 + thumb_func_end sub_8181068 + + thumb_func_start sub_81810C4 +sub_81810C4: @ 81810C4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + subs r1, 0x1 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + lsls r1, 16 + cmp r1, 0 + bgt _081810E8 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _081810F4 + str r0, [r4, 0x1C] +_081810E8: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081810F4: .4byte sub_8184D88 + 1 + thumb_func_end sub_81810C4 + + thumb_func_start pokemonanimfunc_29 +pokemonanimfunc_29: @ 81810F8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, _0818110C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818110C: .4byte sub_8181110 + 1 + thumb_func_end pokemonanimfunc_29 + + thumb_func_start sub_8181110 +sub_8181110: @ 8181110 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + adds r1, 0x1 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF + ble _08181134 + movs r0, 0 + strh r0, [r4, 0x32] + ldr r0, _08181140 + str r0, [r4, 0x1C] +_08181134: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181140: .4byte sub_8181144 + 1 + thumb_func_end sub_8181110 + + thumb_func_start sub_8181144 +sub_8181144: @ 8181144 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + adds r0, 0x10 + strh r0, [r4, 0x32] + ldrh r2, [r4, 0x24] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bgt _0818117C + ldr r0, _08181174 + strh r0, [r4, 0x24] + movs r0, 0x10 + strh r0, [r4, 0x26] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r0, _08181178 + str r0, [r4, 0x1C] + b _08181186 + .align 2, 0 +_08181174: .4byte 0x0000fff0 +_08181178: .4byte sub_81811A4 + 1 +_0818117C: + subs r0, r2, 0x2 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] +_08181186: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x32] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8181144 + + thumb_func_start sub_81811A4 +sub_81811A4: @ 81811A4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + adds r1, 0x1 + movs r2, 0 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + lsls r1, 16 + cmp r1, 0 + blt _081811CE + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _081811DC + str r0, [r4, 0x1C] +_081811CE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081811DC: .4byte sub_8184D88 + 1 + thumb_func_end sub_81811A4 + + thumb_func_start pokemonanimfunc_2A +pokemonanimfunc_2A: @ 81811E0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _0818120C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x2 + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_8181214 + ldr r0, _08181210 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818120C: .4byte 0x03001240 +_08181210: .4byte sub_8181214 + 1 + thumb_func_end pokemonanimfunc_2A + + thumb_func_start sub_8181214 +sub_8181214: @ 8181214 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _08181234 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _08181238 + subs r0, 0x1 + strh r0, [r1] + b _0818134A + .align 2, 0 +_08181234: .4byte 0x03001240 +_08181238: + adds r0, r4, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r5, [r4, r1] + cmp r5, 0 + bne _08181270 + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r0, [r0, 0x2] + strh r0, [r4, 0x3C] + ldr r0, _081812B4 + strh r0, [r4, 0x34] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] + strh r5, [r4, 0x3A] +_08181270: + movs r3, 0x3C + ldrsh r1, [r4, r3] + movs r6, 0x34 + ldrsh r0, [r4, r6] + lsls r0, 1 + muls r1, r0 + ldrh r0, [r4, 0x24] + adds r1, r0 + strh r1, [r4, 0x24] + ldrh r2, [r4, 0x3C] + ldrh r0, [r4, 0x36] + adds r3, r0, 0 + muls r3, r2 + adds r0, r3, 0 + ldrh r6, [r4, 0x26] + adds r2, r0, r6 + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x3A] + adds r0, 0x8 + strh r0, [r4, 0x3A] + adds r1, 0xF + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x1E + bls _081812B8 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 4 + strh r0, [r4, 0x24] + movs r2, 0x34 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x34] + b _081812D4 + .align 2, 0 +_081812B4: .4byte 0x0000ffff +_081812B8: + adds r0, r2, 0 + adds r0, 0xF + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bls _081812DA + movs r3, 0x36 + ldrsh r0, [r4, r3] + lsls r0, 4 + strh r0, [r4, 0x26] + movs r6, 0x36 + ldrsh r0, [r4, r6] + negs r0, r0 + strh r0, [r4, 0x36] +_081812D4: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_081812DA: + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _08181332 + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _08181332 + movs r3, 0 + strh r3, [r4, 0x24] + strh r3, [r4, 0x26] + ldr r5, _08181324 + movs r6, 0x2E + ldrsh r0, [r4, r6] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r2, [r1, 0x4] + movs r6, 0x4 + ldrsh r0, [r1, r6] + cmp r0, 0x1 + ble _08181328 + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r3, [r4, 0x38] + strh r3, [r4, 0x3A] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xA + strh r1, [r0] + b _08181332 + .align 2, 0 +_08181324: .4byte 0x03001240 +_08181328: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08181350 + str r0, [r4, 0x1C] +_08181332: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C +_0818134A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08181350: .4byte sub_8184D88 + 1 + thumb_func_end sub_8181214 + + thumb_func_start pokemonanimfunc_2B +pokemonanimfunc_2B: @ 8181354 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x3C] + ldr r0, _0818136C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818136C: .4byte sub_8181370 + 1 + thumb_func_end pokemonanimfunc_2B + + thumb_func_start sub_8181370 +sub_8181370: @ 8181370 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + movs r1, 0xFF + ands r0, r1 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0xC0 + ble _081813BA + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081813BA + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + b _081813D2 +_081813BA: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x40 + ble _081813DE + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081813DE + ldr r1, _08181410 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 +_081813D2: + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] +_081813DE: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _08181404 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08181414 + str r0, [r4, 0x1C] +_08181404: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181410: .4byte 0xffffff00 +_08181414: .4byte sub_8184D88 + 1 + thumb_func_end sub_8181370 + + thumb_func_start pokemonanimfunc_2C +pokemonanimfunc_2C: @ 8181418 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08181442 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + strh r2, [r4, 0x3A] + strh r2, [r4, 0x38] + strh r2, [r4, 0x36] +_08181442: + ldr r1, _0818145C + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r2, r0, 1 + adds r0, r1, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08181464 + ldr r0, _08181460 + str r0, [r4, 0x1C] + b _081814CE + .align 2, 0 +_0818145C: .4byte 0x0860aa64 +_08181460: .4byte sub_8184D88 + 1 +_08181464: + movs r3, 0x36 + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _0818149A + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08181488 + ldrh r0, [r4, 0x3C] + ldr r3, _08181484 + movs r1, 0x10 + movs r2, 0x10 + bl pal_fade_1 + b _08181494 + .align 2, 0 +_08181484: .4byte 0x000003ff +_08181488: + ldrh r0, [r4, 0x3C] + ldr r3, _081814C0 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 +_08181494: + movs r0, 0 + strh r0, [r4, 0x36] + ldr r1, _081814C4 +_0818149A: + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _081814C8 + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _081814CE + .align 2, 0 +_081814C0: .4byte 0x000003ff +_081814C4: .4byte 0x0860aa64 +_081814C8: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_081814CE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_2C + + thumb_func_start sub_81814D4 +sub_81814D4: @ 81814D4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081814E6 + adds r0, r6, 0 + bl sub_817F670 +_081814E6: + adds r0, r6, 0 + bl sub_817F70C + ldr r4, _08181538 + movs r3, 0x2E + ldrsh r1, [r6, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r4 + movs r0, 0x32 + ldrsh r1, [r6, r0] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r1, r0 + ble _0818154C + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r3, 0 + strh r3, [r6, 0x24] + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrh r2, [r1, 0x4] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _0818153C + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r3, [r6, 0x32] + b _08181588 + .align 2, 0 +_08181538: .4byte 0x03001240 +_0818153C: + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _08181548 + str r0, [r6, 0x1C] + b _08181588 + .align 2, 0 +_08181548: .4byte sub_8184D88 + 1 +_0818154C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl sine + negs r0, r0 + strh r0, [r6, 0x24] + movs r5, 0x80 + lsls r5, 1 + ldr r1, _0818159C + adds r0, r4, 0 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 +_08181588: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818159C: .4byte 0x00000ccc + thumb_func_end sub_81814D4 + + thumb_func_start pokemonanimfunc_2D +pokemonanimfunc_2D: @ 81815A0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _081815CC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81814D4 + ldr r0, _081815D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081815CC: .4byte 0x03001240 +_081815D0: .4byte sub_81814D4 + 1 + thumb_func_end pokemonanimfunc_2D + + thumb_func_start sub_81815D4 +sub_81815D4: @ 81815D4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081815E6 + adds r0, r6, 0 + bl sub_817F670 +_081815E6: + adds r0, r6, 0 + bl sub_817F70C + ldr r4, _08181638 + movs r3, 0x2E + ldrsh r1, [r6, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r4 + movs r0, 0x32 + ldrsh r1, [r6, r0] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r1, r0 + ble _0818164C + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r3, 0 + strh r3, [r6, 0x24] + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrh r2, [r1, 0x4] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _0818163C + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r3, [r6, 0x32] + b _0818168A + .align 2, 0 +_08181638: .4byte 0x03001240 +_0818163C: + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _08181648 + str r0, [r6, 0x1C] + b _0818168A + .align 2, 0 +_08181648: .4byte sub_8184D88 + 1 +_0818164C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl sine + negs r0, r0 + strh r0, [r6, 0x24] + movs r5, 0x80 + lsls r5, 1 + ldr r1, _0818169C + adds r0, r4, 0 + bl sine + adds r3, r0, 0 + negs r3, r3 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 +_0818168A: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818169C: .4byte 0x00000ccc + thumb_func_end sub_81815D4 + + thumb_func_start pokemonanimfunc_2E +pokemonanimfunc_2E: @ 81816A0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _081816CC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81815D4 + ldr r0, _081816D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081816CC: .4byte 0x03001240 +_081816D0: .4byte sub_81815D4 + 1 + thumb_func_end pokemonanimfunc_2E + + thumb_func_start pokemonanimfunc_2F +pokemonanimfunc_2F: @ 81816D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + adds r0, r4, 0 + adds r0, 0x28 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + movs r1, 0xA + bl __divsi3 + negs r0, r0 + strh r0, [r4, 0x3A] + movs r0, 0x80 + strh r0, [r4, 0x3C] + ldr r0, _08181704 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181704: .4byte sub_8181708 + 1 + thumb_func_end pokemonanimfunc_2F + + thumb_func_start sub_8181708 +sub_8181708: @ 8181708 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl cosine + ldrh r1, [r4, 0x3A] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + subs r3, 0x80 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x78 + bgt _08181760 + movs r0, 0x78 + strh r0, [r4, 0x3C] + movs r0, 0 + strh r0, [r4, 0x34] + ldr r0, _0818176C + str r0, [r4, 0x1C] +_08181760: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818176C: .4byte sub_8181770 + 1 + thumb_func_end sub_8181708 + + thumb_func_start sub_8181770 +sub_8181770: @ 8181770 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x14 + bne _08181784 + ldr r0, _08181790 + str r0, [r1, 0x1C] + movs r0, 0 + strh r0, [r1, 0x34] +_08181784: + ldrh r0, [r1, 0x34] + adds r0, 0x1 + strh r0, [r1, 0x34] + pop {r0} + bx r0 + .align 2, 0 +_08181790: .4byte sub_8181794 + 1 + thumb_func_end sub_8181770 + + thumb_func_start sub_8181794 +sub_8181794: @ 8181794 + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + adds r0, 0x2 + movs r6, 0 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl cosine + ldrh r1, [r4, 0x3A] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r5, 0x80 + lsls r5, 1 + ldrh r3, [r4, 0x3C] + subs r3, 0x80 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _08181800 + strh r6, [r4, 0x24] + strh r6, [r4, 0x26] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817F6D4 + strh r6, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0818180C + str r0, [r4, 0x1C] +_08181800: + adds r0, r4, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818180C: .4byte pokemonanimfunc_10 + 1 + thumb_func_end sub_8181794 + + thumb_func_start sub_8181810 +sub_8181810: @ 8181810 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _08181830 + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrh r0, [r1] + adds r6, r0, 0 + cmp r6, 0 + beq _08181834 + subs r0, 0x1 + strh r0, [r1] + b _08181950 + .align 2, 0 +_08181830: .4byte 0x03001240 +_08181834: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0818184A + adds r0, r5, 0 + bl sub_817F670 + strh r6, [r5, 0x36] + strh r6, [r5, 0x38] + movs r0, 0x1 + strh r0, [r5, 0x32] +_0818184A: + movs r3, 0x38 + ldrsh r0, [r5, r3] + cmp r0, 0 + bne _081818A2 + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + bl sine + strh r0, [r5, 0x3C] + movs r3, 0x36 + ldrsh r0, [r5, r3] + movs r1, 0x10 + bl sine + strh r0, [r5, 0x26] + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x20 + bl sine + adds r1, r0, 0 + strh r1, [r5, 0x3A] + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r5, 0x3C] + adds r2, r4 + lsls r2, 16 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl sub_817F6D4 + movs r3, 0x36 + ldrsh r0, [r5, r3] + cmp r0, 0x80 + bne _0818193A + strh r6, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + b _0818193A +_081818A2: + cmp r0, 0x1 + bne _0818193A + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x20 + bl sine + strh r0, [r5, 0x3C] + movs r3, 0x36 + ldrsh r0, [r5, r3] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r5, 0x26] + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x80 + bl sine + adds r1, r0, 0 + strh r1, [r5, 0x3A] + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r0, [r5, 0x3C] + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl sub_817F6D4 + movs r1, 0x36 + ldrsh r0, [r5, r1] + cmp r0, 0x80 + bne _0818193A + movs r3, 0x2E + ldrsh r0, [r5, r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r2, [r1, 0x4] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + ble _08181922 + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xA + strh r1, [r0] + strh r6, [r5, 0x36] + strh r6, [r5, 0x38] + b _0818193A +_08181922: + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r5, 0 + bl sub_817F77C + ldr r0, _08181958 + str r0, [r5, 0x1C] +_0818193A: + ldr r2, _0818195C + movs r3, 0x2E + ldrsh r1, [r5, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] +_08181950: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08181958: .4byte sub_8184D88 + 1 +_0818195C: .4byte 0x03001240 + thumb_func_end sub_8181810 + + thumb_func_start pokemonanimfunc_30 +pokemonanimfunc_30: @ 8181960 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _0818198C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + adds r0, r4, 0 + bl sub_8181810 + ldr r0, _08181990 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818198C: .4byte 0x03001240 +_08181990: .4byte sub_8181810 + 1 + thumb_func_end pokemonanimfunc_30 + + thumb_func_start pokemonanimfunc_31 +pokemonanimfunc_31: @ 8181994 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r4, [r5, r0] + adds r0, r5, 0 + bl sub_817F70C + movs r0, 0x80 + lsls r0, 2 + cmp r4, r0 + ble _081819B8 + ldr r0, _081819B4 + str r0, [r5, 0x1C] + movs r0, 0 + strh r0, [r5, 0x24] + b _08181A62 + .align 2, 0 +_081819B4: .4byte sub_8184D88 + 1 +_081819B8: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _081819C2 + adds r0, 0x7F +_081819C2: + asrs r0, 7 + cmp r0, 0x1 + beq _081819F8 + cmp r0, 0x1 + bgt _081819D2 + cmp r0, 0 + beq _081819DC + b _08181A48 +_081819D2: + cmp r0, 0x2 + beq _08181A12 + cmp r0, 0x3 + beq _08181A2A + b _08181A48 +_081819DC: + adds r0, r4, 0 + cmp r4, 0 + bge _081819E4 + adds r0, 0x7F +_081819E4: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _081819F4 + adds r0, 0x7F +_081819F4: + asrs r0, 7 + b _08181A46 +_081819F8: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A00 + adds r0, 0x7F +_08181A00: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + cmp r0, 0 + bge _08181A0C + adds r0, 0xF +_08181A0C: + asrs r0, 4 + subs r0, 0x8 + b _08181A46 +_08181A12: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A1A + adds r0, 0x7F +_08181A1A: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + cmp r0, 0 + bge _08181A26 + adds r0, 0xF +_08181A26: + asrs r0, 4 + b _08181A46 +_08181A2A: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A32 + adds r0, 0x7F +_08181A32: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _08181A42 + adds r0, 0x7F +_08181A42: + asrs r0, 7 + adds r0, 0x8 +_08181A46: + strh r0, [r5, 0x24] +_08181A48: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A50 + adds r0, 0x7F +_08181A50: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 +_08181A62: + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x32] + adds r0, 0xC + strh r0, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_31 + + thumb_func_start pokemonanimfunc_32 +pokemonanimfunc_32: @ 8181A78 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x2E] + ldr r2, _08181AB0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, _08181AB4 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_817F670 + strh r5, [r4, 0x34] + adds r0, r4, 0 + bl sub_8181ABC + ldr r0, _08181AB8 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08181AB0: .4byte 0x03001240 +_08181AB4: .4byte 0x0000ffff +_08181AB8: .4byte sub_8181ABC + 1 + thumb_func_end pokemonanimfunc_32 + + thumb_func_start sub_8181ABC +sub_8181ABC: @ 8181ABC + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _08181ADC + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + ldrh r0, [r1] + adds r5, r0, 0 + cmp r5, 0 + beq _08181AE0 + subs r0, 0x1 + strh r0, [r1] + b _08181B44 + .align 2, 0 +_08181ADC: .4byte 0x03001240 +_08181AE0: + adds r0, r4, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r0, 0x80 + ble _08181AFC + strh r5, [r4, 0x32] + ldr r0, _08181AF8 + str r0, [r4, 0x1C] + b _08181B3E + .align 2, 0 +_08181AF8: .4byte sub_8181B4C + 1 +_08181AFC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r3, r0, 3 + adds r0, r2, 0 + cmp r2, 0 + bge _08181B16 + adds r0, 0x7F +_08181B16: + asrs r0, 7 + lsls r0, 7 + subs r1, r2, r0 + adds r0, r3, 0 + muls r0, r1 + cmp r0, 0 + bge _08181B26 + adds r0, 0x7F +_08181B26: + asrs r0, 7 + strh r0, [r4, 0x24] + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] +_08181B3E: + adds r0, r4, 0 + bl sub_817F70C +_08181B44: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8181ABC + + thumb_func_start sub_8181B4C +sub_8181B4C: @ 8181B4C + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x30 + ble _08181B7C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r0, 0 + strh r0, [r4, 0x26] + strh r0, [r4, 0x32] + ldr r0, _08181B78 + str r0, [r4, 0x1C] + b _08181C1A + .align 2, 0 +_08181B78: .4byte sub_8181C2C + 1 +_08181B7C: + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0x40 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r6, r1, 0 + adds r0, r6 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r0, [r4, 0x32] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bhi _08181BBA + ldrh r0, [r4, 0x34] + adds r0, 0x8 + strh r0, [r4, 0x34] + ldr r2, _08181C28 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x24] + ldrh r0, [r0, 0x8] + subs r1, r0 + strh r1, [r4, 0x24] +_08181BBA: + movs r5, 0 + lsls r1, r3, 16 + asrs r2, r1, 16 + lsls r0, r6, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r2, r0 + ble _08181BD6 + subs r0, r2 + cmp r0, 0 + bge _08181BD2 + adds r0, 0x7 +_08181BD2: + lsls r0, 13 + lsrs r5, r0, 16 +_08181BD6: + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + negs r0, r0 + lsls r1, r5, 16 + asrs r1, 16 + subs r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + asrs r2, r6, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x36] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x36] +_08181C1A: + adds r0, r4, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08181C28: .4byte 0x03001240 + thumb_func_end sub_8181B4C + + thumb_func_start sub_8181C2C +sub_8181C2C: @ 8181C2C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r3, [r4, r0] + cmp r3, 0x80 + ble _08181C90 + ldr r3, _08181C74 + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x4] + movs r5, 0x4 + ldrsh r0, [r1, r5] + cmp r0, 0x1 + ble _08181C7C + subs r0, r2, 0x1 + movs r2, 0 + strh r0, [r1, 0x4] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0xA + strh r1, [r0] + strh r2, [r4, 0x34] + strh r2, [r4, 0x32] + strh r2, [r4, 0x36] + ldr r0, _08181C78 + b _08181C84 + .align 2, 0 +_08181C74: .4byte 0x03001240 +_08181C78: .4byte sub_8181ABC + 1 +_08181C7C: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08181C8C +_08181C84: + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _08181CD0 + .align 2, 0 +_08181C8C: .4byte sub_8184D88 + 1 +_08181C90: + ldr r2, _08181CE4 + movs r5, 0x2E + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x8 + ldrsh r5, [r0, r1] + lsls r1, r5, 3 + adds r0, r3, 0 + cmp r3, 0 + bge _08181CAC + adds r0, 0x7F +_08181CAC: + asrs r0, 7 + lsls r0, 7 + subs r2, r3, r0 + adds r0, r1, 0 + muls r0, r2 + cmp r0, 0 + bge _08181CBC + adds r0, 0x7F +_08181CBC: + asrs r0, 7 + lsls r1, r5, 3 + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, r2, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 +_08181CD0: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08181CE4: .4byte 0x03001240 + thumb_func_end sub_8181C2C + + thumb_func_start sub_8181CE8 +sub_8181CE8: @ 8181CE8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08181D00 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08181D00: + adds r0, r4, 0 + bl sub_817F70C + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xFE + ble _08181D60 + movs r5, 0 + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r2, _08181D44 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r2, [r1, 0x4] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + ble _08181D48 + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r5, [r4, 0x32] + strh r5, [r4, 0x3C] + b _08181D52 + .align 2, 0 +_08181D44: .4byte 0x03001240 +_08181D48: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08181D5C + str r0, [r4, 0x1C] +_08181D52: + adds r0, r4, 0 + bl sub_817F70C + b _08181DA6 + .align 2, 0 +_08181D5C: .4byte sub_8184D88 + 1 +_08181D60: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r3, 0x3C + ldrsh r0, [r4, r3] + movs r1, 0x20 + bl sine + adds r3, r0, 0 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + ldr r2, _08181DAC + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x6] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F70C +_08181DA6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08181DAC: .4byte 0x03001240 + thumb_func_end sub_8181CE8 + + thumb_func_start pokemonanimfunc_33 +pokemonanimfunc_33: @ 8181DB0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08181DDC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + adds r0, r4, 0 + bl sub_8181CE8 + ldr r0, _08181DE0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181DDC: .4byte 0x03001240 +_08181DE0: .4byte sub_8181CE8 + 1 + thumb_func_end pokemonanimfunc_33 + + thumb_func_start pokemonanimfunc_34 +pokemonanimfunc_34: @ 8181DE4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08181DFC + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08181DFC: + adds r0, r4, 0 + bl sub_817F70C + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0xFE + ble _08181E34 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08181E30 + str r0, [r4, 0x1C] + adds r0, r4, 0 + bl sub_817F70C + b _08181E8A + .align 2, 0 +_08181E30: .4byte sub_8184D88 + 1 +_08181E34: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08181E4E + adds r0, 0x7F +_08181E4E: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + adds r3, r0, 0 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F70C +_08181E8A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_34 + + thumb_func_start pokemonanimfunc_35 +pokemonanimfunc_35: @ 8181E90 + push {r4,r5,lr} + adds r3, r0, 0 + movs r1, 0x32 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08181E9E + strh r0, [r3, 0x3C] +_08181E9E: + ldrh r4, [r3, 0x32] + movs r5, 0x32 + ldrsh r1, [r3, r5] + ldrh r2, [r3, 0x3C] + movs r5, 0x3C + ldrsh r0, [r3, r5] + cmp r1, r0 + bne _08181EC8 + movs r0, 0 + strh r0, [r3, 0x3C] + adds r0, r4, 0x1 + strh r0, [r3, 0x32] + adds r1, r3, 0 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r2, r1, 0 + b _08181ED8 +_08181EC8: + adds r0, r2, 0x1 + strh r0, [r3, 0x3C] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08181ED8: + movs r1, 0x32 + ldrsh r0, [r3, r1] + cmp r0, 0xA + ble _08181EEE + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + ldr r0, _08181EF4 + str r0, [r3, 0x1C] +_08181EEE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08181EF4: .4byte sub_8184D88 + 1 + thumb_func_end pokemonanimfunc_35 + + thumb_func_start pokemonanimfunc_36 +pokemonanimfunc_36: @ 8181EF8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x3C] + ldr r0, _08181F10 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181F10: .4byte sub_8181F14 + 1 + thumb_func_end pokemonanimfunc_36 + + thumb_func_start sub_8181F14 +sub_8181F14: @ 8181F14 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x1F + ble _08181F34 + movs r0, 0 + movs r1, 0x20 + strh r1, [r4, 0x3C] + strh r0, [r4, 0x32] + ldr r0, _08181F30 + str r0, [r4, 0x1C] + b _08181F38 + .align 2, 0 +_08181F30: .4byte sub_8181F50 + 1 +_08181F34: + adds r0, r1, 0x4 + strh r0, [r4, 0x3C] +_08181F38: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8181F14 + + thumb_func_start sub_8181F50 +sub_8181F50: @ 8181F50 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _08181F74 + ldr r0, _08181F70 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08181FAE + .align 2, 0 +_08181F70: .4byte sub_8181FC0 + 1 +_08181F74: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 4 + negs r0, r0 + cmp r0, 0 + bge _08181F84 + ldr r1, _08181FBC + adds r0, r1 +_08181F84: + asrs r0, 9 + strh r0, [r4, 0x24] + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08181F94 + adds r0, 0x7F +_08181F94: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] +_08181FAE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08181FBC: .4byte 0x000001ff + thumb_func_end sub_8181F50 + + thumb_func_start sub_8181FC0 +sub_8181FC0: @ 8181FC0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + subs r0, 0x2 + movs r1, 0 + strh r0, [r4, 0x3C] + lsls r0, 16 + cmp r0, 0 + bge _08181FEC + strh r1, [r4, 0x3C] + strh r1, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08181FE8 + str r0, [r4, 0x1C] + b _08181FFE + .align 2, 0 +_08181FE8: .4byte sub_8184D88 + 1 +_08181FEC: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 17 + asrs r0, 16 + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] +_08181FFE: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8181FC0 + + thumb_func_start pokemonanimfunc_37 +pokemonanimfunc_37: @ 818201C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182036 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_08182036: + adds r0, r4, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0xFF + ble _08182060 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0818205C + str r0, [r4, 0x1C] + b _081820A6 + .align 2, 0 +_0818205C: .4byte sub_8184D88 + 1 +_08182060: + adds r0, r1, 0 + adds r0, 0x10 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182072 + adds r0, 0x7F +_08182072: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r1, [r4, r2] + adds r0, r1, 0 + cmp r1, 0 + bge _08182092 + adds r0, 0x7F +_08182092: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_081820A6: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081820B2 + adds r0, 0x7F +_081820B2: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + adds r3, r0, 0 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_37 + + thumb_func_start pokemonanimfunc_38 +pokemonanimfunc_38: @ 81820E0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x3C] + strh r0, [r4, 0x36] + ldr r0, _081820F8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081820F8: .4byte sub_81820FC + 1 + thumb_func_end pokemonanimfunc_38 + + thumb_func_start sub_81820FC +sub_81820FC: @ 81820FC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x18 + ble _0818212C + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0818214A + movs r0, 0 + strh r0, [r4, 0x36] + ldr r0, _08182128 + str r0, [r4, 0x1C] + b _0818214A + .align 2, 0 +_08182128: .4byte sub_818216C + 1 +_0818212C: + adds r0, r1, 0x2 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_0818214A: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81820FC + + thumb_func_start sub_818216C +sub_818216C: @ 818216C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x20 + ble _0818218C + movs r0, 0x1 + strh r0, [r4, 0x3A] + ldr r0, _08182188 + str r0, [r4, 0x1C] + b _081821AA + .align 2, 0 +_08182188: .4byte sub_81821CC + 1 +_0818218C: + adds r0, r1, 0x2 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_081821AA: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818216C + + thumb_func_start sub_81821CC +sub_81821CC: @ 81821CC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 2 + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x9 + ble _081821F0 + movs r0, 0x20 + strh r0, [r4, 0x3C] + ldr r0, _08182244 + str r0, [r4, 0x1C] +_081821F0: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + subs r0, 0x1D + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _08182224 + movs r1, 0x3A + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_08182224: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182244: .4byte sub_8182248 + 1 + thumb_func_end sub_81821CC + + thumb_func_start sub_8182248 +sub_8182248: @ 8182248 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _08182270 + movs r0, 0 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0818226C + str r0, [r4, 0x1C] + b _0818228E + .align 2, 0 +_0818226C: .4byte sub_8184D88 + 1 +_08182270: + subs r0, r1, 0x2 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_0818228E: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8182248 + + thumb_func_start pokemonanimfunc_39 +pokemonanimfunc_39: @ 81822B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _081822D0 + ldr r0, _081822CC + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0818235C + .align 2, 0 +_081822CC: .4byte sub_8184D88 + 1 +_081822D0: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _081822DC + movs r5, 0x1 +_081822DC: + movs r0, 0x32 + ldrsh r2, [r4, r0] + adds r0, r2, 0 + cmp r2, 0 + bge _081822E8 + adds r0, r2, 0x3 +_081822E8: + asrs r0, 2 + lsls r0, 2 + subs r0, r2, r0 + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + asrs r1, 1 + cmp r1, 0 + bne _0818232C + lsls r0, r2, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0818230C + adds r0, 0xFF +_0818230C: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 + strh r0, [r4, 0x24] + negs r0, r0 + b _0818235A +_0818232C: + lsls r0, r2, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0818233C + adds r0, 0xFF +_0818233C: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + lsls r1, r5, 24 + asrs r1, 24 + muls r0, r1 + strh r0, [r4, 0x24] +_0818235A: + strh r0, [r4, 0x26] +_0818235C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_39 + + thumb_func_start pokemonanimfunc_3A +pokemonanimfunc_3A: @ 8182370 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182392 + adds r0, r4, 0 + bl sub_817F670 + strh r5, [r4, 0x38] + strh r5, [r4, 0x3A] + strh r5, [r4, 0x3C] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08182392: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _081823E4 + subs r0, r1, 0x1 + strh r0, [r4, 0x3A] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + beq _08182494 + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 3 + movs r1, 0x14 + bl __divsi3 + adds r1, r0, 0 + ldrh r0, [r4, 0x3C] + lsls r1, 16 + asrs r1, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x40 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r2, r1, 0 + lsls r0, 16 + asrs r0, 16 + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _08182494 +_081823E4: + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bne _08182424 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _08182410 + movs r0, 0x40 + strh r0, [r4, 0x3C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08182420 + str r0, [r4, 0x1C] +_08182410: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x40 + bl cosine + lsls r0, 16 + lsrs r3, r0, 16 + b _08182474 + .align 2, 0 +_08182420: .4byte sub_8184D88 + 1 +_08182424: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x40 + bl sine + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x3F + ble _08182448 + movs r0, 0 + movs r1, 0x3 + strh r1, [r4, 0x38] + movs r1, 0xA + strh r1, [r4, 0x3A] + strh r0, [r4, 0x3C] + b _08182474 +_08182448: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x30 + ble _0818245C + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0818245C + movs r0, 0x2 + b _0818246E +_0818245C: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08182474 + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08182474 + movs r0, 0x1 +_0818246E: + strh r0, [r4, 0x38] + movs r0, 0x14 + strh r0, [r4, 0x3A] +_08182474: + ldrh r0, [r4, 0x3C] + adds r0, 0x2 + strh r0, [r4, 0x3C] + movs r0, 0x80 + lsls r0, 1 + adds r2, r0, 0 + lsls r0, r3, 16 + asrs r0, 16 + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182494: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3A + + thumb_func_start pokemonanimfunc_3B +pokemonanimfunc_3B: @ 81824A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081824BA + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_081824BA: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _081824E8 + movs r0, 0 + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _081824E4 + str r0, [r4, 0x1C] + b _08182540 + .align 2, 0 +_081824E4: .4byte sub_8184D88 + 1 +_081824E8: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081824F4 + adds r0, 0xFF +_081824F4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182518 + adds r0, 0x7F +_08182518: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x60 + bl sine + adds r2, r0, 0 + movs r1, 0x80 + lsls r1, 1 + lsls r2, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 +_08182540: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3B + + thumb_func_start pokemonanimfunc_3C +pokemonanimfunc_3C: @ 8182548 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182562 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_08182562: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r5, 0x80 + lsls r5, 1 + cmp r0, r5 + ble _08182590 + movs r0, 0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0818258C + str r0, [r4, 0x1C] + b _081825D4 + .align 2, 0 +_0818258C: .4byte sub_8184D88 + 1 +_08182590: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x4 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081825AE + adds r0, 0x3F +_081825AE: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + lsls r0, 17 + asrs r0, 16 + movs r1, 0x80 + bl sine + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + adds r2, r5 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_817F6D4 +_081825D4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3C + + thumb_func_start pokemonanimfunc_3D +pokemonanimfunc_3D: @ 81825DC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, _081825F4 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081825F4: .4byte sub_81825F8 + 1 + thumb_func_end pokemonanimfunc_3D + + thumb_func_start sub_81825F8 +sub_81825F8: @ 81825F8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + movs r1, 0 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0818261C + strh r1, [r4, 0x3C] + strh r1, [r4, 0x3A] + ldr r0, _08182618 + str r0, [r4, 0x1C] + movs r0, 0x40 + b _08182620 + .align 2, 0 +_08182618: .4byte sub_8182648 + 1 +_0818261C: + movs r1, 0x3C + ldrsh r0, [r4, r1] +_08182620: + movs r1, 0x80 + bl sine + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x80 + lsls r1, 1 + lsls r2, r0, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81825F8 + + thumb_func_start sub_8182648 +sub_8182648: @ 8182648 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x4 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _08182672 + movs r0, 0 + movs r1, 0x80 + bl cosine + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0 + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _081826C8 +_08182672: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + movs r2, 0x3A + ldrsh r1, [r4, r2] + lsls r1, 2 + negs r1, r1 + subs r1, r0 + strh r1, [r4, 0x26] + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x3F + ble _081826A4 + ldr r5, _081826A0 + adds r0, r1, 0 + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + b _081826A8 + .align 2, 0 +_081826A0: .4byte 0x0000ffff +_081826A4: + movs r5, 0x1 + movs r0, 0 +_081826A8: + lsls r0, 16 + asrs r0, 15 + ldrh r1, [r4, 0x3C] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x80 + bl cosine + lsls r1, r5, 16 + asrs r1, 16 + adds r2, r1, 0 + muls r2, r0 + adds r0, r2, 0 + lsls r0, 16 + lsrs r2, r0, 16 +_081826C8: + movs r1, 0x80 + lsls r1, 1 + lsls r2, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x3 + bne _081826EE + movs r0, 0 + strh r0, [r4, 0x3C] + ldr r0, _081826F4 + str r0, [r4, 0x1C] +_081826EE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081826F4: .4byte sub_81826F8 + 1 + thumb_func_end sub_8182648 + + thumb_func_start sub_81826F8 +sub_81826F8: @ 81826F8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x80 + bl cosine + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0xC + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _08182742 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08182760 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182742: + movs r1, 0x80 + lsls r1, 1 + lsls r2, r5, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08182760: .4byte sub_8184D88 + 1 + thumb_func_end sub_81826F8 + + thumb_func_start sub_8182764 +sub_8182764: @ 8182764 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08182798 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08182794 + str r0, [r4, 0x1C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _081827F4 + .align 2, 0 +_08182794: .4byte sub_8184D88 + 1 +_08182798: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081827A4 + adds r0, 0xFF +_081827A4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + movs r2, 0x3C + ldrsh r1, [r4, r2] + adds r0, r1, 0 + cmp r1, 0 + bge _081827CC + adds r0, 0x7F +_081827CC: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x60 + bl sine + adds r1, r0, 0 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + asrs r1, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 +_081827F4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8182764 + + thumb_func_start pokemonanimfunc_3E +pokemonanimfunc_3E: @ 81827FC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182822 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r1, 0x8 + strh r1, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] +_08182822: + adds r0, r4, 0 + bl sub_8182764 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3E + + thumb_func_start sub_8182830 +sub_8182830: @ 8182830 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08182864 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08182860 + str r0, [r4, 0x1C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _081828C0 + .align 2, 0 +_08182860: .4byte sub_8184D88 + 1 +_08182864: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182870 + adds r0, 0xFF +_08182870: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + movs r2, 0x3C + ldrsh r1, [r4, r2] + adds r0, r1, 0 + cmp r1, 0 + bge _08182898 + adds r0, 0x3F +_08182898: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + lsls r0, 17 + asrs r0, 16 + movs r1, 0x80 + bl sine + adds r1, r0, 0 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + asrs r1, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 +_081828C0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8182830 + + thumb_func_start pokemonanimfunc_3F +pokemonanimfunc_3F: @ 81828C8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081828EE + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] + adds r0, 0xFC + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_081828EE: + adds r0, r4, 0 + bl sub_8182830 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3F + + thumb_func_start pokemonanimfunc_40 +pokemonanimfunc_40: @ 81828FC + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0818291A + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_0818291A: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _08182948 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r0, _08182944 + str r0, [r4, 0x1C] + b _0818299E + .align 2, 0 +_08182944: .4byte sub_8184D88 + 1 +_08182948: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182954 + adds r0, 0xFF +_08182954: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182978 + adds r0, 0x7F +_08182978: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x60 + bl sine + adds r2, r0, 0 + lsls r2, 16 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_0818299E: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_40 + + thumb_func_start pokemonanimfunc_41 +pokemonanimfunc_41: @ 81829AC + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081829CA + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_081829CA: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _081829F8 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r0, _081829F4 + str r0, [r4, 0x1C] + b _08182A5E + .align 2, 0 +_081829F4: .4byte sub_8184D88 + 1 +_081829F8: + movs r1, 0x3C + ldrsh r0, [r4, r1] + adds r1, r0, 0 + cmp r0, 0 + bge _08182A04 + adds r1, 0xFF +_08182A04: + asrs r1, 8 + lsls r1, 8 + subs r1, r0, r1 + lsls r1, 16 + asrs r0, r1, 16 + lsrs r1, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + adds r1, r0, 0 + cmp r0, 0 + bge _08182A30 + adds r1, 0xFF +_08182A30: + asrs r1, 8 + lsls r1, 8 + subs r1, r0, r1 + lsls r1, 16 + asrs r0, r1, 16 + lsrs r1, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x40 + bl sine + adds r2, r0, 0 + negs r2, r2 + lsls r2, 16 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182A5E: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_41 + + thumb_func_start pokemonanimfunc_42 +pokemonanimfunc_42: @ 8182A6C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182A8A + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_08182A8A: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _08182AB8 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r0, _08182AB4 + str r0, [r4, 0x1C] + b _08182B16 + .align 2, 0 +_08182AB4: .4byte sub_8184D88 + 1 +_08182AB8: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182AC4 + adds r0, 0xFF +_08182AC4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + adds r1, r0, 0 + cmp r0, 0 + bge _08182AEA + adds r1, 0xFF +_08182AEA: + asrs r1, 8 + lsls r1, 8 + subs r1, r0, r1 + lsls r1, 16 + asrs r0, r1, 16 + lsrs r1, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x60 + bl sine + adds r2, r0, 0 + lsls r2, 16 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182B16: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_42 + + thumb_func_start pokemonanimfunc_43 +pokemonanimfunc_43: @ 8182B24 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _08182B48 + ldr r0, _08182B44 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08182C08 + .align 2, 0 +_08182B44: .4byte sub_8184D88 + 1 +_08182B48: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _08182B56 + ldr r1, _08182B7C + adds r0, r2, r1 +_08182B56: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _08182B62 + adds r0, r1, 0x3 +_08182B62: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08182BA4 + cmp r0, 0x1 + bgt _08182B80 + cmp r0, 0 + beq _08182B8A + b _08182BE2 + .align 2, 0 +_08182B7C: .4byte 0x000001ff +_08182B80: + cmp r0, 0x2 + beq _08182BB8 + cmp r0, 0x3 + beq _08182BCA + b _08182BE2 +_08182B8A: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08182B9C + ldr r1, _08182BA0 + adds r0, r1 +_08182B9C: + asrs r0, 9 + b _08182BE0 + .align 2, 0 +_08182BA0: .4byte 0x000001ff +_08182BA4: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08182BB2 + adds r0, 0x1F +_08182BB2: + asrs r0, 5 + subs r0, 0x10 + b _08182BE0 +_08182BB8: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08182BC6 + adds r0, 0x1F +_08182BC6: + asrs r0, 5 + b _08182BE0 +_08182BCA: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08182BDC + ldr r1, _08182C14 + adds r0, r1 +_08182BDC: + asrs r0, 9 + adds r0, 0x10 +_08182BE0: + strh r0, [r4, 0x24] +_08182BE2: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182BEE + adds r0, 0x7F +_08182BEE: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x18 + strh r0, [r4, 0x32] +_08182C08: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182C14: .4byte 0x000001ff + thumb_func_end pokemonanimfunc_43 + + thumb_func_start pokemonanimfunc_44 +pokemonanimfunc_44: @ 8182C18 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08182C34 + strh r0, [r4, 0x3A] + movs r0, 0x40 + strh r0, [r4, 0x3C] + adds r0, r1, 0x1 + strh r0, [r4, 0x32] +_08182C34: + ldrh r0, [r4, 0x3C] + adds r1, r0, 0 + adds r1, 0x8 + movs r3, 0 + strh r1, [r4, 0x3C] + ldrh r2, [r4, 0x3A] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r0, 0x4 + bne _08182C52 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _08182C60 + b _08182C5A +_08182C52: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _08182C60 +_08182C5A: + strh r3, [r4, 0x3C] + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] +_08182C60: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _08182D08 + lsls r0, 2 + ldr r1, _08182C74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08182C74: .4byte _08182C78 + .align 2, 0 +_08182C78: + .4byte _08182CEC + .4byte _08182C8C + .4byte _08182CAA + .4byte _08182CCC + .4byte _08182CEC +_08182C8C: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl cosine + negs r0, r0 + strh r0, [r4, 0x24] + movs r5, 0x3C + ldrsh r0, [r4, r5] + movs r1, 0x8 + bl sine + subs r0, 0x8 + strh r0, [r4, 0x26] + b _08182D12 +_08182CAA: + ldrh r0, [r4, 0x3C] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + adds r0, 0x8 + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + b _08182D12 +_08182CCC: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + adds r0, 0x8 + strh r0, [r4, 0x26] + b _08182D12 +_08182CEC: + movs r5, 0x3C + ldrsh r0, [r4, r5] + movs r1, 0x8 + bl sine + subs r0, 0x8 + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x26] + b _08182D12 +_08182D08: + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + ldr r0, _08182D20 + str r0, [r4, 0x1C] +_08182D12: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08182D20: .4byte sub_8184D88 + 1 + thumb_func_end pokemonanimfunc_44 + + thumb_func_start pokemonanimfunc_45 +pokemonanimfunc_45: @ 8182D24 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x20 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_8180714 + ldr r0, _08182D3C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182D3C: .4byte sub_8180714 + 1 + thumb_func_end pokemonanimfunc_45 + + thumb_func_start pokemonanimfunc_46 +pokemonanimfunc_46: @ 8182D40 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F8FC + ldr r0, _08182D58 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182D58: .4byte sub_817F8FC + 1 + thumb_func_end pokemonanimfunc_46 + + thumb_func_start pokemonanimfunc_47 +pokemonanimfunc_47: @ 8182D5C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F978 + ldr r0, _08182D74 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182D74: .4byte sub_817F978 + 1 + thumb_func_end pokemonanimfunc_47 + + thumb_func_start pokemonanimfunc_48 +pokemonanimfunc_48: @ 8182D78 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08182DAC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1, 0x6] + ldrh r0, [r4, 0x3A] + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_8180900 + ldr r0, _08182DB0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182DAC: .4byte 0x03001240 +_08182DB0: .4byte sub_8180900 + 1 + thumb_func_end pokemonanimfunc_48 + + thumb_func_start pokemonanimfunc_49 +pokemonanimfunc_49: @ 8182DB4 + push {lr} + movs r1, 0x1 + strh r1, [r0, 0x3A] + bl pokemonanimfunc_05 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_49 + + thumb_func_start pokemonanimfunc_4A +pokemonanimfunc_4A: @ 8182DC4 + push {lr} + movs r1, 0x1 + strh r1, [r0, 0x3A] + bl pokemonanimfunc_48 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_4A + + thumb_func_start pokemonanimfunc_4B +pokemonanimfunc_4B: @ 8182DD4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08182DE2 + strh r0, [r4, 0x2E] +_08182DE2: + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _08182DF6 + adds r0, r4, 0 + bl sub_817FC20 + movs r0, 0x1 + b _08182DF8 +_08182DF6: + subs r0, r1, 0x1 +_08182DF8: + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_4B + + thumb_func_start pokemonanimfunc_4C +pokemonanimfunc_4C: @ 8182E00 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817FCDC + ldr r0, _08182E1C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182E1C: .4byte sub_817FCDC + 1 + thumb_func_end pokemonanimfunc_4C + + thumb_func_start pokemonanimfunc_4D +pokemonanimfunc_4D: @ 8182E20 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817FD44 + ldr r0, _08182E38 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182E38: .4byte sub_817FD44 + 1 + thumb_func_end pokemonanimfunc_4D + + thumb_func_start pokemonanimfunc_4E +pokemonanimfunc_4E: @ 8182E3C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + strh r0, [r4, 0x2E] + ldr r2, _08182E74 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 3 + strh r0, [r1, 0x6] + strh r3, [r1] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_817FE30 + ldr r0, _08182E78 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182E74: .4byte 0x03001240 +_08182E78: .4byte sub_817FE30 + 1 + thumb_func_end pokemonanimfunc_4E + + thumb_func_start pokemonanimfunc_4F +pokemonanimfunc_4F: @ 8182E7C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08182EB4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 2 + strh r0, [r1, 0x6] + movs r0, 0x3 + strh r0, [r1, 0x8] + movs r0, 0xC + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_817FFF0 + ldr r0, _08182EB8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182EB4: .4byte 0x03001240 +_08182EB8: .4byte sub_817FFF0 + 1 + thumb_func_end pokemonanimfunc_4F + + thumb_func_start pokemonanimfunc_50 +pokemonanimfunc_50: @ 8182EBC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x18 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_818031C + ldr r0, _08182ED4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182ED4: .4byte sub_818031C + 1 + thumb_func_end pokemonanimfunc_50 + + thumb_func_start pokemonanimfunc_51 +pokemonanimfunc_51: @ 8182ED8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_81804F8 + ldr r0, _08182EF0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182EF0: .4byte sub_81804F8 + 1 + thumb_func_end pokemonanimfunc_51 + + thumb_func_start pokemonanimfunc_52 +pokemonanimfunc_52: @ 8182EF4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F9F4 + ldr r0, _08182F0C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182F0C: .4byte sub_817F9F4 + 1 + thumb_func_end pokemonanimfunc_52 + + thumb_func_start pokemonanimfunc_53 +pokemonanimfunc_53: @ 8182F10 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08182F40 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3C + strh r0, [r1] + movs r0, 0x1E + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_817FF3C + ldr r0, _08182F44 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182F40: .4byte 0x03001240 +_08182F44: .4byte sub_817FF3C + 1 + thumb_func_end pokemonanimfunc_53 + + thumb_func_start pokemonanimfunc_54 +pokemonanimfunc_54: @ 8182F48 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08182F78 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x2] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_8181214 + ldr r0, _08182F7C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182F78: .4byte 0x03001240 +_08182F7C: .4byte sub_8181214 + 1 + thumb_func_end pokemonanimfunc_54 + + thumb_func_start pokemonanimfunc_55 +pokemonanimfunc_55: @ 8182F80 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08182FB0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_8181810 + ldr r0, _08182FB4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08182FB0: .4byte 0x03001240 +_08182FB4: .4byte sub_8181810 + 1 + thumb_func_end pokemonanimfunc_55 + + thumb_func_start pokemonanimfunc_56 +pokemonanimfunc_56: @ 8182FB8 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x2E] + ldr r2, _08182FF4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_817F670 + strh r5, [r4, 0x34] + adds r0, r4, 0 + bl sub_8181ABC + ldr r0, _08182FF8 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08182FF4: .4byte 0x03001240 +_08182FF8: .4byte sub_8181ABC + 1 + thumb_func_end pokemonanimfunc_56 + + thumb_func_start pokemonanimfunc_07 +pokemonanimfunc_07: @ 8182FFC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08183028 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x2 + strh r0, [r1, 0x6] + adds r0, r4, 0 + bl sub_8181CE8 + ldr r0, _0818302C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183028: .4byte 0x03001240 +_0818302C: .4byte sub_8181CE8 + 1 + thumb_func_end pokemonanimfunc_07 + + thumb_func_start pokemonanimfunc_08 +pokemonanimfunc_08: @ 8183030 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08183060 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_8181CE8 + ldr r0, _08183064 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183060: .4byte 0x03001240 +_08183064: .4byte sub_8181CE8 + 1 + thumb_func_end pokemonanimfunc_08 + + thumb_func_start pokemonanimfunc_0B +pokemonanimfunc_0B: @ 8183068 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08183094 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x64 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81814D4 + ldr r0, _08183098 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183094: .4byte 0x03001240 +_08183098: .4byte sub_81814D4 + 1 + thumb_func_end pokemonanimfunc_0B + + thumb_func_start pokemonanimfunc_0C +pokemonanimfunc_0C: @ 818309C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _081830CC + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81814D4 + ldr r0, _081830D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081830CC: .4byte 0x03001240 +_081830D0: .4byte sub_81814D4 + 1 + thumb_func_end pokemonanimfunc_0C + + thumb_func_start pokemonanimfunc_0D +pokemonanimfunc_0D: @ 81830D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08183100 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x64 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81815D4 + ldr r0, _08183104 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183100: .4byte 0x03001240 +_08183104: .4byte sub_81815D4 + 1 + thumb_func_end pokemonanimfunc_0D + + thumb_func_start pokemonanimfunc_0E +pokemonanimfunc_0E: @ 8183108 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _08183138 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81815D4 + ldr r0, _0818313C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183138: .4byte 0x03001240 +_0818313C: .4byte sub_81815D4 + 1 + thumb_func_end pokemonanimfunc_0E + + thumb_func_start sub_8183140 +sub_8183140: @ 8183140 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r0, 0x90 + lsls r0, 4 + cmp r2, r0 + ble _0818315C + ldr r0, _08183158 + str r0, [r4, 0x1C] + movs r0, 0 + b _08183180 + .align 2, 0 +_08183158: .4byte sub_8184D88 + 1 +_0818315C: + adds r1, r2, 0 + adds r1, 0xC0 + adds r0, r1, 0 + cmp r1, 0 + bge _0818316A + ldr r3, _08183190 + adds r0, r2, r3 +_0818316A: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x3C] + adds r0, r1 +_08183180: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + ldrh r3, [r4, 0x32] + adds r0, r3 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183190: .4byte 0x000001bf + thumb_func_end sub_8183140 + + thumb_func_start pokemonanimfunc_57 +pokemonanimfunc_57: @ 8183194 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183140 + ldr r0, _081831B0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081831B0: .4byte sub_8183140 + 1 + thumb_func_end pokemonanimfunc_57 + + thumb_func_start pokemonanimfunc_58 +pokemonanimfunc_58: @ 81831B4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183140 + ldr r0, _081831D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081831D0: .4byte sub_8183140 + 1 + thumb_func_end pokemonanimfunc_58 + + thumb_func_start pokemonanimfunc_59 +pokemonanimfunc_59: @ 81831D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _081831F8 + ldr r0, _081831F4 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _081832BC + .align 2, 0 +_081831F4: .4byte sub_8184D88 + 1 +_081831F8: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _08183206 + ldr r1, _0818322C + adds r0, r2, r1 +_08183206: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _08183212 + adds r0, r1, 0x3 +_08183212: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08183268 + cmp r0, 0x1 + bgt _08183230 + cmp r0, 0 + beq _0818323A + b _08183298 + .align 2, 0 +_0818322C: .4byte 0x000001ff +_08183230: + cmp r0, 0x2 + beq _0818324C + cmp r0, 0x3 + beq _08183284 + b _08183298 +_0818323A: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183248 + adds r0, 0x1F +_08183248: + asrs r0, 5 + b _08183296 +_0818324C: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _0818325E + ldr r1, _08183264 + adds r0, r1 +_0818325E: + asrs r0, 9 + b _08183296 + .align 2, 0 +_08183264: .4byte 0x000001ff +_08183268: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _0818327A + ldr r1, _08183280 + adds r0, r1 +_0818327A: + asrs r0, 9 + adds r0, 0x10 + b _08183296 + .align 2, 0 +_08183280: .4byte 0x000001ff +_08183284: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183292 + adds r0, 0x1F +_08183292: + asrs r0, 5 + subs r0, 0x10 +_08183296: + strh r0, [r4, 0x24] +_08183298: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081832A4 + adds r0, 0x7F +_081832A4: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x18 + strh r0, [r4, 0x32] +_081832BC: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_59 + + thumb_func_start sub_81832C8 +sub_81832C8: @ 81832C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + movs r0, 0 + mov r8, r0 + movs r2, 0x38 + ldrsh r1, [r6, r2] + movs r2, 0x3A + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818331A + mov r0, r8 + strh r0, [r6, 0x26] + strh r0, [r6, 0x38] + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r6, 0x36] + movs r2, 0x36 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bgt _08183310 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _0818330C + str r0, [r6, 0x1C] + b _081833DC + .align 2, 0 +_0818330C: .4byte sub_8184D88 + 1 +_08183310: + subs r0, r1, 0x1 + strh r0, [r6, 0x36] + mov r0, r8 + strh r0, [r6, 0x3C] + b _081833DC +_0818331A: + movs r1, 0x38 + ldrsh r5, [r6, r1] + lsls r0, r5, 7 + movs r2, 0x3A + ldrsh r4, [r6, r2] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r4, 0 + bge _08183334 + adds r4, 0x3 +_08183334: + asrs r1, r4, 2 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r1 + blt _08183358 + cmp r5, r0 + bge _08183358 + ldrh r0, [r6, 0x3C] + adds r0, 0x33 + strh r0, [r6, 0x3C] + movs r1, 0xFF + mov r8, r1 + ands r1, r0 + mov r8, r1 +_08183358: + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0818337C + lsls r4, r2, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + ldr r2, _08183378 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + b _08183392 + .align 2, 0 +_08183378: .4byte 0xffffff00 +_0818337C: + lsls r4, r2, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 +_08183392: + adds r7, r4, 0 + ldrh r4, [r6, 0x34] + lsls r4, 24 + lsrs r4, 24 + mov r5, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sine + adds r5, r0, 0 + asrs r0, r7, 16 + adds r1, r4, 0 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r2, r1, 0 + subs r2, r5 + subs r2, r0 + mov r0, r9 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r6, 0 + movs r3, 0 + bl sub_817F618 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + strh r0, [r6, 0x38] +_081833DC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81832C8 + + thumb_func_start pokemonanimfunc_5A +pokemonanimfunc_5A: @ 81833E8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _0818340A + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_0818340A: + adds r0, r5, 0 + bl sub_81832C8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_5A + + thumb_func_start sub_8183418 +sub_8183418: @ 8183418 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + movs r0, 0 + mov r8, r0 + movs r2, 0x38 + ldrsh r1, [r6, r2] + movs r2, 0x3A + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818346A + mov r0, r8 + strh r0, [r6, 0x38] + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r6, 0x36] + movs r2, 0x36 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bgt _08183460 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _0818345C + str r0, [r6, 0x1C] + b _08183538 + .align 2, 0 +_0818345C: .4byte sub_8184D88 + 1 +_08183460: + subs r0, r1, 0x1 + strh r0, [r6, 0x36] + mov r0, r8 + strh r0, [r6, 0x3C] + b _08183538 +_0818346A: + movs r1, 0x38 + ldrsh r5, [r6, r1] + lsls r0, r5, 7 + movs r2, 0x3A + ldrsh r4, [r6, r2] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r4, 0 + bge _08183486 + adds r4, 0x3 +_08183486: + asrs r1, r4, 2 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r1 + blt _081834AC + cmp r5, r0 + bge _081834AC + ldrh r0, [r6, 0x3C] + adds r0, 0x33 + strh r0, [r6, 0x3C] + movs r1, 0xFF + mov r8, r1 + mov r2, r8 + ands r2, r0 + mov r8, r2 +_081834AC: + ldrh r0, [r6, 0x34] + lsls r0, 24 + lsrs r7, r0, 24 + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081834F0 + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + adds r1, r7, 0 + bl sine + adds r4, r0, 0 + mov r5, r8 + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r5, 0 + bl sine + ldr r1, _081834EC + adds r0, r1 + adds r4, r0 + lsls r4, 16 + lsrs r1, r4, 16 + b _08183522 + .align 2, 0 +_081834EC: .4byte 0xffffff00 +_081834F0: + mov r4, r8 + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r4, 0 + bl sine + adds r4, r0, 0 + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + adds r1, r7, 0 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r4 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 +_08183522: + lsls r1, 16 + asrs r1, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + movs r3, 0 + bl sub_817F618 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + strh r0, [r6, 0x38] +_08183538: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8183418 + + thumb_func_start pokemonanimfunc_5B +pokemonanimfunc_5B: @ 8183544 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183566 + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_08183566: + adds r0, r5, 0 + bl sub_8183418 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_5B + + thumb_func_start sub_8183574 +sub_8183574: @ 8183574 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r3, _081835D0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r0, r1, r3 + ldrb r5, [r0] + adds r2, r5, 0 + cmp r5, 0xFF + beq _081835A6 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r5, r0, 24 +_081835A6: + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + movs r7, 0 + cmp r2, 0xFE + beq _081835C2 + mov r1, r9 + subs r0, r6, r1 + muls r0, r5 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r7, r0, 24 +_081835C2: + cmp r5, 0xFF + bne _081835D8 + ldr r0, _081835D4 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x26] + b _0818360A + .align 2, 0 +_081835D0: .4byte 0x0860aa80 +_081835D4: .4byte sub_8184D88 + 1 +_081835D8: + mov r1, r8 + adds r1, 0xC0 + adds r0, r1, 0 + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + adds r1, r7, 0 + bl sine + adds r0, r7 + strh r0, [r4, 0x26] + cmp r9, r6 + bne _081835FC + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r0, 0 + b _08183608 +_081835FC: + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 +_08183608: + strh r0, [r4, 0x3A] +_0818360A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8183574 + + thumb_func_start pokemonanimfunc_5C +pokemonanimfunc_5C: @ 8183618 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x28 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183574 + ldr r0, _08183634 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183634: .4byte sub_8183574 + 1 + thumb_func_end pokemonanimfunc_5C + + thumb_func_start pokemonanimfunc_5D +pokemonanimfunc_5D: @ 8183638 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x46 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817FCDC + ldr r0, _08183654 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183654: .4byte sub_817FCDC + 1 + thumb_func_end pokemonanimfunc_5D + + thumb_func_start pokemonanimfunc_5E +pokemonanimfunc_5E: @ 8183658 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x14 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F8FC + ldr r0, _08183670 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183670: .4byte sub_817F8FC + 1 + thumb_func_end pokemonanimfunc_5E + + thumb_func_start pokemonanimfunc_5F +pokemonanimfunc_5F: @ 8183674 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _08183690 + ldr r0, _0818368C + str r0, [r4, 0x1C] + movs r0, 0 + b _081836CA + .align 2, 0 +_0818368C: .4byte sub_8184D88 + 1 +_08183690: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _0818369C + movs r5, 0x1 +_0818369C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _081836B0 + adds r0, 0xFF +_081836B0: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x9 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 +_081836CA: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_5F + + thumb_func_start pokemonanimfunc_60 +pokemonanimfunc_60: @ 81836D8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _081836F4 + ldr r0, _081836F0 + str r0, [r4, 0x1C] + movs r0, 0 + b _0818372E + .align 2, 0 +_081836F0: .4byte sub_8184D88 + 1 +_081836F4: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _08183700 + movs r5, 0x1 +_08183700: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _08183714 + adds r0, 0xFF +_08183714: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0xC + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 +_0818372E: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_60 + + thumb_func_start pokemonanimfunc_61 +pokemonanimfunc_61: @ 818373C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x46 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183140 + ldr r0, _08183758 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183758: .4byte sub_8183140 + 1 + thumb_func_end pokemonanimfunc_61 + + thumb_func_start pokemonanimfunc_62 +pokemonanimfunc_62: @ 818375C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x18 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183574 + ldr r0, _08183778 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183778: .4byte sub_8183574 + 1 + thumb_func_end pokemonanimfunc_62 + + thumb_func_start pokemonanimfunc_63 +pokemonanimfunc_63: @ 818377C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x38 + strh r0, [r4, 0x2E] + movs r0, 0x9 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183574 + ldr r0, _08183798 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183798: .4byte sub_8183574 + 1 + thumb_func_end pokemonanimfunc_63 + + thumb_func_start pokemonanimfunc_64 +pokemonanimfunc_64: @ 818379C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, _081837D4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 3 + strh r0, [r1, 0x6] + movs r0, 0x6 + strh r0, [r1, 0x8] + movs r0, 0x18 + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_817FFF0 + ldr r0, _081837D8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081837D4: .4byte 0x03001240 +_081837D8: .4byte sub_817FFF0 + 1 + thumb_func_end pokemonanimfunc_64 + + thumb_func_start sub_81837DC +sub_81837DC: @ 81837DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + movs r5, 0 + movs r0, 0x38 + ldrsh r1, [r7, r0] + movs r2, 0x3A + ldrsh r0, [r7, r2] + cmp r1, r0 + ble _0818382C + strh r5, [r7, 0x26] + strh r5, [r7, 0x38] + movs r2, 0x80 + lsls r2, 1 + adds r0, r7, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r7, 0x36] + movs r2, 0x36 + ldrsh r0, [r7, r2] + cmp r0, 0x1 + bgt _08183824 + adds r0, r7, 0 + bl sub_817F77C + ldr r0, _08183820 + str r0, [r7, 0x1C] + b _0818392C + .align 2, 0 +_08183820: .4byte sub_8184D88 + 1 +_08183824: + subs r0, r1, 0x1 + strh r0, [r7, 0x36] + strh r5, [r7, 0x3C] + b _0818392C +_0818382C: + movs r0, 0x38 + ldrsh r6, [r7, r0] + lsls r0, r6, 7 + movs r1, 0x3A + ldrsh r4, [r7, r1] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r4, 0 + bge _08183846 + adds r4, 0x3 +_08183846: + asrs r1, r4, 2 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r6, r1 + blt _08183866 + cmp r6, r0 + bge _08183866 + ldrh r0, [r7, 0x3C] + adds r0, 0x33 + strh r0, [r7, 0x3C] + movs r5, 0xFF + ands r5, r0 +_08183866: + ldrh r0, [r7, 0x34] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r1, 0x30 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _081838B0 + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + mov r1, r9 + bl sine + adds r4, r0, 0 + lsls r6, r5, 16 + asrs r5, r6, 16 + mov r0, r9 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r5, 0 + bl sine + ldr r2, _081838AC + adds r4, r2 + adds r0, r4 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + mov r0, r8 + b _081838EA + .align 2, 0 +_081838AC: .4byte 0xffffff00 +_081838B0: + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + mov r1, r9 + bl sine + adds r6, r0, 0 + lsls r5, 16 + asrs r4, r5, 16 + mov r0, r9 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r4, 0 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r6 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + mov r0, r8 + adds r6, r5, 0 +_081838EA: + asrs r0, 16 + mov r1, r9 + bl sine + adds r5, r0, 0 + asrs r4, r6, 16 + mov r0, r9 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r2, r1, 0 + subs r2, r5 + subs r2, r0 + mov r0, r10 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r7, 0 + movs r3, 0 + bl sub_817F618 + ldrh r0, [r7, 0x38] + adds r0, 0x1 + strh r0, [r7, 0x38] +_0818392C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81837DC + + thumb_func_start pokemonanimfunc_65 +pokemonanimfunc_65: @ 818393C + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _0818395E + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_0818395E: + adds r0, r5, 0 + bl sub_81837DC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_65 + + thumb_func_start pokemonanimfunc_66 +pokemonanimfunc_66: @ 818396C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _08183990 + ldr r0, _0818398C + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08183A54 + .align 2, 0 +_0818398C: .4byte sub_8184D88 + 1 +_08183990: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _0818399E + ldr r1, _081839C4 + adds r0, r2, r1 +_0818399E: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _081839AA + adds r0, r1, 0x3 +_081839AA: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08183A00 + cmp r0, 0x1 + bgt _081839C8 + cmp r0, 0 + beq _081839D2 + b _08183A30 + .align 2, 0 +_081839C4: .4byte 0x000001ff +_081839C8: + cmp r0, 0x2 + beq _081839E4 + cmp r0, 0x3 + beq _08183A1C + b _08183A30 +_081839D2: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081839E0 + adds r0, 0x1F +_081839E0: + asrs r0, 5 + b _08183A2E +_081839E4: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _081839F6 + ldr r1, _081839FC + adds r0, r1 +_081839F6: + asrs r0, 9 + b _08183A2E + .align 2, 0 +_081839FC: .4byte 0x000001ff +_08183A00: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08183A12 + ldr r1, _08183A18 + adds r0, r1 +_08183A12: + asrs r0, 9 + adds r0, 0x10 + b _08183A2E + .align 2, 0 +_08183A18: .4byte 0x000001ff +_08183A1C: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183A2A + adds r0, 0x1F +_08183A2A: + asrs r0, 5 + subs r0, 0x10 +_08183A2E: + strh r0, [r4, 0x24] +_08183A30: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08183A3C + adds r0, 0x7F +_08183A3C: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x30 + strh r0, [r4, 0x32] +_08183A54: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_66 + + thumb_func_start pokemonanimfunc_67 +pokemonanimfunc_67: @ 8183A60 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _08183A84 + ldr r0, _08183A80 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08183B40 + .align 2, 0 +_08183A80: .4byte sub_8184D88 + 1 +_08183A84: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _08183A92 + ldr r1, _08183AB8 + adds r0, r2, r1 +_08183A92: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _08183A9E + adds r0, r1, 0x3 +_08183A9E: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08183AF4 + cmp r0, 0x1 + bgt _08183ABC + cmp r0, 0 + beq _08183AC6 + b _08183B24 + .align 2, 0 +_08183AB8: .4byte 0x000001ff +_08183ABC: + cmp r0, 0x2 + beq _08183AD8 + cmp r0, 0x3 + beq _08183B10 + b _08183B24 +_08183AC6: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183AD4 + adds r0, 0x1F +_08183AD4: + asrs r0, 5 + b _08183B22 +_08183AD8: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08183AEA + ldr r1, _08183AF0 + adds r0, r1 +_08183AEA: + asrs r0, 9 + b _08183B22 + .align 2, 0 +_08183AF0: .4byte 0x000001ff +_08183AF4: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08183B06 + ldr r1, _08183B0C + adds r0, r1 +_08183B06: + asrs r0, 9 + adds r0, 0x10 + b _08183B22 + .align 2, 0 +_08183B0C: .4byte 0x000001ff +_08183B10: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183B1E + adds r0, 0x1F +_08183B1E: + asrs r0, 5 + subs r0, 0x10 +_08183B22: + strh r0, [r4, 0x24] +_08183B24: + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x60 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x40 + strh r0, [r4, 0x32] +_08183B40: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_67 + + thumb_func_start sub_8183B4C +sub_8183B4C: @ 8183B4C + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08183B5E + strh r0, [r4, 0x34] +_08183B5E: + ldr r7, _08183BC0 + movs r2, 0x34 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + adds r5, r7, 0x2 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl __divsi3 + movs r2, 0x32 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08183B8C + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x34] + strh r1, [r4, 0x32] +_08183B8C: + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r6, r0, r1 + adds r0, r6, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x38 + ldrsh r5, [r4, r1] + adds r1, r5, 0 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bne _08183BCC + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _08183BC8 + ldr r0, _08183BC4 + str r0, [r4, 0x1C] + b _08183C06 + .align 2, 0 +_08183BC0: .4byte 0x0860adbe +_08183BC4: .4byte sub_8184D88 + 1 +_08183BC8: + strh r1, [r4, 0x32] + b _08183C06 +_08183BCC: + adds r0, r6, r7 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r0, r5 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r7, 0x1 + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r4, 0x38] + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C +_08183C06: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8183B4C + + thumb_func_start pokemonanimfunc_68 +pokemonanimfunc_68: @ 8183C0C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x38] + strh r0, [r4, 0x3A] + adds r0, r4, 0 + bl sub_8183B4C + ldr r0, _08183C28 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183C28: .4byte sub_8183B4C + 1 + thumb_func_end pokemonanimfunc_68 + + thumb_func_start pokemonanimfunc_69 +pokemonanimfunc_69: @ 8183C2C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + strh r0, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x3A] + adds r0, r4, 0 + bl sub_8183B4C + ldr r0, _08183C48 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183C48: .4byte sub_8183B4C + 1 + thumb_func_end pokemonanimfunc_69 + + thumb_func_start pokemonanimfunc_6A +pokemonanimfunc_6A: @ 8183C4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + strh r0, [r4, 0x38] + strh r0, [r4, 0x3A] + adds r0, r4, 0 + bl sub_8183B4C + ldr r0, _08183C68 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08183C68: .4byte sub_8183B4C + 1 + thumb_func_end pokemonanimfunc_6A + + thumb_func_start sub_8183C6C +sub_8183C6C: @ 8183C6C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0xFF + ble _08183CAE + ldrh r1, [r4, 0x38] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08183CA4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08183CA0 + str r0, [r4, 0x1C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _08183CE8 + .align 2, 0 +_08183CA0: .4byte sub_8184D88 + 1 +_08183CA4: + subs r0, r1, 0x1 + movs r1, 0 + strh r0, [r4, 0x38] + strh r1, [r4, 0x3C] + b _08183CE8 +_08183CAE: + ldrh r0, [r4, 0x3A] + adds r0, r1, r0 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + movs r5, 0x80 + lsls r5, 1 + cmp r0, r5 + ble _08183CC2 + strh r5, [r4, 0x3C] +_08183CC2: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x40 + bl sine + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + subs r2, r5, r2 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08183CE8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8183C6C + + thumb_func_start pokemonanimfunc_6B +pokemonanimfunc_6B: @ 8183CF0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183D16 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] + movs r0, 0x1 + strh r0, [r4, 0x38] +_08183D16: + adds r0, r4, 0 + bl sub_8183C6C + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6B + + thumb_func_start pokemonanimfunc_6C +pokemonanimfunc_6C: @ 8183D28 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183D4E + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0x2 + strh r0, [r4, 0x38] +_08183D4E: + adds r0, r4, 0 + bl sub_8183C6C + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6C + + thumb_func_start pokemonanimfunc_6D +pokemonanimfunc_6D: @ 8183D60 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183D88 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_08183D88: + adds r0, r4, 0 + bl sub_8182764 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6D + + thumb_func_start pokemonanimfunc_6E +pokemonanimfunc_6E: @ 8183D94 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183DBA + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] + adds r0, 0xFC + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_08183DBA: + adds r0, r4, 0 + bl sub_8182764 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6E + + thumb_func_start pokemonanimfunc_6F +pokemonanimfunc_6F: @ 8183DC8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183DF0 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_08183DF0: + adds r0, r4, 0 + bl sub_8182830 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6F + + thumb_func_start pokemonanimfunc_70 +pokemonanimfunc_70: @ 8183DFC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183E22 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r1, 0x8 + strh r1, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] +_08183E22: + adds r0, r4, 0 + bl sub_8182830 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_70 + + thumb_func_start pokemonanimfunc_71 +pokemonanimfunc_71: @ 8183E30 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08183E4A + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x5 + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] +_08183E4A: + adds r0, r4, 0 + bl sub_8180828 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_71 + + thumb_func_start pokemonanimfunc_72 +pokemonanimfunc_72: @ 8183E58 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08183E72 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x3 + strh r0, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] +_08183E72: + adds r0, r4, 0 + bl sub_8180828 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_72 + + thumb_func_start pokemonanimfunc_73 +pokemonanimfunc_73: @ 8183E80 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183EA2 + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x1E + strh r0, [r5, 0x3A] + movs r0, 0x3C + strh r0, [r5, 0x34] + strh r6, [r5, 0x3C] +_08183EA2: + adds r0, r5, 0 + bl sub_81832C8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_73 + + thumb_func_start pokemonanimfunc_74 +pokemonanimfunc_74: @ 8183EB0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183ED4 + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0x14 + strh r0, [r4, 0x3A] + movs r0, 0x46 + strh r0, [r4, 0x34] + strh r5, [r4, 0x3C] +_08183ED4: + adds r0, r4, 0 + bl sub_81832C8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_74 + + thumb_func_start pokemonanimfunc_75 +pokemonanimfunc_75: @ 8183EE0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183F06 + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0x14 + strh r0, [r4, 0x3A] + movs r0, 0x46 + strh r0, [r4, 0x34] + strh r5, [r4, 0x38] + strh r5, [r4, 0x3C] +_08183F06: + adds r0, r4, 0 + bl sub_8183418 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_75 + + thumb_func_start pokemonanimfunc_76 +pokemonanimfunc_76: @ 8183F14 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183F38 + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x1E + strh r0, [r5, 0x3A] + movs r0, 0x3C + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_08183F38: + adds r0, r5, 0 + bl sub_8183418 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_76 + + thumb_func_start pokemonanimfunc_77 +pokemonanimfunc_77: @ 8183F44 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183F6A + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0x14 + strh r0, [r4, 0x3A] + movs r0, 0x46 + strh r0, [r4, 0x34] + strh r5, [r4, 0x38] + strh r5, [r4, 0x3C] +_08183F6A: + adds r0, r4, 0 + bl sub_81837DC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_77 + + thumb_func_start pokemonanimfunc_78 +pokemonanimfunc_78: @ 8183F78 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183F9C + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x1E + strh r0, [r5, 0x3A] + movs r0, 0x3C + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_08183F9C: + adds r0, r5, 0 + bl sub_81837DC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_78 + + thumb_func_start sub_8183FA8 +sub_8183FA8: @ 8183FA8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _08183FEA + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bgt _08183FD0 + ldr r0, _08183FCC + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + b _0818403E + .align 2, 0 +_08183FCC: .4byte sub_8184D88 + 1 +_08183FD0: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08183FDC + adds r0, 0xFF +_08183FDC: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + strh r0, [r4, 0x3C] + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0818403E +_08183FEA: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r3, 0x3C + ldrsh r2, [r4, r3] + adds r1, r2, 0 + adds r1, 0xC0 + adds r0, r1, 0 + cmp r1, 0 + bge _0818400C + ldr r3, _08184044 + adds r0, r2, r3 +_0818400C: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + ble _0818402E + movs r3, 0x26 + ldrsh r0, [r4, r3] + negs r0, r0 + strh r0, [r4, 0x26] +_0818402E: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + ldrh r2, [r4, 0x3C] + adds r0, r2 + strh r0, [r4, 0x3C] +_0818403E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08184044: .4byte 0x000001bf + thumb_func_end sub_8183FA8 + + thumb_func_start pokemonanimfunc_79 +pokemonanimfunc_79: @ 8184048 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _08184066 + movs r0, 0x1 + strh r0, [r1, 0x32] + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0xC + strh r0, [r1, 0x38] + strh r0, [r1, 0x36] + movs r0, 0x4 + strh r0, [r1, 0x34] +_08184066: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_79 + + thumb_func_start pokemonanimfunc_7A +pokemonanimfunc_7A: @ 8184070 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _0818408E + movs r0, 0x1 + strh r0, [r1, 0x32] + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0xC + strh r0, [r1, 0x38] + strh r0, [r1, 0x36] + movs r0, 0x6 + strh r0, [r1, 0x34] +_0818408E: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7A + + thumb_func_start pokemonanimfunc_7B +pokemonanimfunc_7B: @ 8184098 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _081840B8 + movs r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0x2 + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0xC + strh r0, [r1, 0x38] + strh r0, [r1, 0x36] + movs r0, 0x8 + strh r0, [r1, 0x34] +_081840B8: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7B + + thumb_func_start sub_81840C4 +sub_81840C4: @ 81840C4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + ble _081840FC + movs r2, 0x3A + ldrsh r1, [r5, r2] + ldrh r2, [r5, 0x36] + movs r3, 0x36 + ldrsh r0, [r5, r3] + cmp r1, r0 + bgt _081840EC + ldr r0, _081840E8 + str r0, [r5, 0x1C] + b _081840F4 + .align 2, 0 +_081840E8: .4byte sub_8184D88 + 1 +_081840EC: + adds r0, r2, 0x1 + movs r1, 0 + strh r0, [r5, 0x36] + strh r1, [r5, 0x3C] +_081840F4: + movs r0, 0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + b _08184188 +_081840FC: + cmp r0, 0x9F + ble _08184126 + cmp r0, r1 + ble _08184106 + strh r1, [r5, 0x3C] +_08184106: + movs r0, 0x3C + ldrsh r1, [r5, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08184112 + adds r0, 0xFF +_08184112: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + b _08184154 +_08184126: + cmp r0, 0x5F + ble _0818414A + movs r0, 0x60 + movs r1, 0x6 + bl sine + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + subs r0, 0x60 + lsls r0, 17 + asrs r0, 16 + movs r1, 0x4 + bl sine + subs r4, r0 + strh r4, [r5, 0x26] + b _08184156 +_0818414A: + movs r2, 0x3C + ldrsh r0, [r5, r2] + movs r1, 0x6 + bl sine +_08184154: + strh r0, [r5, 0x26] +_08184156: + movs r3, 0x3C + ldrsh r0, [r5, r3] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r2, 0x38 + ldrsh r1, [r5, r2] + bl sine + negs r0, r0 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r5, 0x36] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0818417E + lsls r0, r2, 16 + negs r0, r0 + lsrs r2, r0, 16 +_0818417E: + strh r2, [r5, 0x24] + ldrh r0, [r5, 0x34] + ldrh r3, [r5, 0x3C] + adds r0, r3 + strh r0, [r5, 0x3C] +_08184188: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81840C4 + + thumb_func_start pokemonanimfunc_7C +pokemonanimfunc_7C: @ 8184190 + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _081841B0 + movs r1, 0x1 + strh r1, [r2, 0x32] + movs r0, 0x2 + strh r0, [r2, 0x3A] + strh r3, [r2, 0x3C] + movs r0, 0x10 + strh r0, [r2, 0x38] + strh r1, [r2, 0x36] + movs r0, 0x4 + strh r0, [r2, 0x34] +_081841B0: + adds r0, r2, 0 + bl sub_81840C4 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7C + + thumb_func_start pokemonanimfunc_7D +pokemonanimfunc_7D: @ 81841BC + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _081841DC + movs r1, 0x1 + strh r1, [r2, 0x32] + movs r0, 0x2 + strh r0, [r2, 0x3A] + strh r3, [r2, 0x3C] + movs r0, 0x10 + strh r0, [r2, 0x38] + strh r1, [r2, 0x36] + movs r0, 0x6 + strh r0, [r2, 0x34] +_081841DC: + adds r0, r2, 0 + bl sub_81840C4 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7D + + thumb_func_start pokemonanimfunc_7E +pokemonanimfunc_7E: @ 81841E8 + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _08184208 + movs r1, 0x1 + strh r1, [r2, 0x32] + movs r0, 0x3 + strh r0, [r2, 0x3A] + strh r3, [r2, 0x3C] + movs r0, 0x10 + strh r0, [r2, 0x38] + strh r1, [r2, 0x36] + movs r0, 0x8 + strh r0, [r2, 0x34] +_08184208: + adds r0, r2, 0 + bl sub_81840C4 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7E + + thumb_func_start pokemonanimfunc_7F +pokemonanimfunc_7F: @ 8184214 + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r1, [r2, r0] + cmp r1, 0 + bne _08184232 + movs r0, 0x1 + strh r0, [r2, 0x32] + strh r0, [r2, 0x3A] + strh r1, [r2, 0x3C] + movs r1, 0x4 + strh r1, [r2, 0x38] + movs r0, 0x6 + strh r0, [r2, 0x36] + strh r1, [r2, 0x34] +_08184232: + adds r0, r2, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7F + + thumb_func_start pokemonanimfunc_80 +pokemonanimfunc_80: @ 818423C + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _0818425A + movs r0, 0x1 + strh r0, [r1, 0x32] + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0x4 + strh r0, [r1, 0x38] + movs r0, 0x6 + strh r0, [r1, 0x36] + strh r0, [r1, 0x34] +_0818425A: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_80 + + thumb_func_start pokemonanimfunc_81 +pokemonanimfunc_81: @ 8184264 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _08184286 + movs r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0x2 + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0x4 + strh r0, [r1, 0x38] + movs r0, 0x6 + strh r0, [r1, 0x36] + movs r0, 0x8 + strh r0, [r1, 0x34] +_08184286: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_81 + + thumb_func_start sub_8184290 +sub_8184290: @ 8184290 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r0, r1, 8 + negs r0, r0 + strh r0, [r4, 0x3A] + movs r0, 0x36 + ldrsh r2, [r4, r0] + adds r0, r4, 0 + movs r3, 0 + bl sub_817F3F0 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8184290 + + thumb_func_start pokemonanimfunc_82 +pokemonanimfunc_82: @ 81842DC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08184300 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x3C + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x38] + ldr r0, _08184340 + strh r0, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x34] + strh r5, [r4, 0x2E] +_08184300: + movs r2, 0x32 + ldrsh r1, [r4, r2] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _0818434C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r2, 0 + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r3, 0x34 + ldrsh r1, [r4, r3] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bgt _08184348 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _08184344 + str r0, [r4, 0x1C] + b _08184358 + .align 2, 0 +_08184340: .4byte 0x0000ffe0 +_08184344: .4byte sub_8184D88 + 1 +_08184348: + strh r2, [r4, 0x32] + b _08184352 +_0818434C: + adds r0, r4, 0 + bl sub_8184290 +_08184352: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08184358: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_82 + + thumb_func_start pokemonanimfunc_83 +pokemonanimfunc_83: @ 8184360 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08184384 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x5A + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x38] + ldr r0, _081843C4 + strh r0, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x34] + strh r5, [r4, 0x2E] +_08184384: + movs r2, 0x32 + ldrsh r1, [r4, r2] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _081843D0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r2, 0 + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r3, 0x34 + ldrsh r1, [r4, r3] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bgt _081843CC + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _081843C8 + str r0, [r4, 0x1C] + b _081843DC + .align 2, 0 +_081843C4: .4byte 0x0000ffe0 +_081843C8: .4byte sub_8184D88 + 1 +_081843CC: + strh r2, [r4, 0x32] + b _081843D6 +_081843D0: + adds r0, r4, 0 + bl sub_8184290 +_081843D6: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_081843DC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_83 + + thumb_func_start pokemonanimfunc_84 +pokemonanimfunc_84: @ 81843E4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08184408 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x1E + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x38] + ldr r0, _08184448 + strh r0, [r4, 0x36] + movs r0, 0x2 + strh r0, [r4, 0x34] + strh r5, [r4, 0x2E] +_08184408: + movs r2, 0x32 + ldrsh r1, [r4, r2] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _08184454 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r2, 0 + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r3, 0x34 + ldrsh r1, [r4, r3] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bgt _08184450 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _0818444C + str r0, [r4, 0x1C] + b _08184460 + .align 2, 0 +_08184448: .4byte 0x0000ffe0 +_0818444C: .4byte sub_8184D88 + 1 +_08184450: + strh r2, [r4, 0x32] + b _0818445A +_08184454: + adds r0, r4, 0 + bl sub_8184290 +_0818445A: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08184460: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_84 + + thumb_func_start sub_8184468 +sub_8184468: @ 8184468 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0x32 + ldrsh r1, [r6, r0] + movs r2, 0x3C + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818449C + movs r0, 0 + strh r0, [r6, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, _08184498 + str r0, [r6, 0x1C] + b _08184544 + .align 2, 0 +_08184498: .4byte sub_8184D88 + 1 +_0818449C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + movs r2, 0x3A + ldrsh r4, [r6, r2] + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r0, 16 + adds r1, r4, 0 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _081844BC + adds r0, 0xFF +_081844BC: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldrh r0, [r6, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081844F8 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x20 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x20 + bl sine + adds r0, r5 + strh r0, [r6, 0x38] + adds r0, r4, 0 + movs r1, 0x20 + b _0818451E +_081844F8: + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r5, r2, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x8 + bl sine + adds r0, r5 + strh r0, [r6, 0x38] + adds r0, r4, 0 + movs r1, 0x8 +_0818451E: + bl sine + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _08184530 + adds r0, 0x7 +_08184530: + lsrs r0, 3 + strh r0, [r6, 0x26] + movs r0, 0x36 + ldrsh r1, [r6, r0] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F6D4 +_08184544: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8184468 + + thumb_func_start pokemonanimfunc_85 +pokemonanimfunc_85: @ 8184550 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08184570 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + movs r0, 0x28 + strh r0, [r4, 0x3A] + movs r0, 0x50 + strh r0, [r4, 0x3C] +_08184570: + adds r0, r4, 0 + bl sub_8184468 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_85 + + thumb_func_start pokemonanimfunc_86 +pokemonanimfunc_86: @ 818457C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0818459A + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + movs r0, 0x28 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x3C] +_0818459A: + adds r0, r4, 0 + bl sub_8184468 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_86 + + thumb_func_start pokemonanimfunc_87 +pokemonanimfunc_87: @ 81845A8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081845C6 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + movs r0, 0x50 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x3C] +_081845C6: + adds r0, r4, 0 + bl sub_8184468 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_87 + + thumb_func_start sub_81845D4 +sub_81845D4: @ 81845D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x32] + subs r0, r1 + strh r0, [r4, 0x24] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmn r1, r0 + bgt _081845FE + ldrh r0, [r4, 0x3A] + negs r0, r0 + strh r0, [r4, 0x24] + movs r0, 0x2 + strh r0, [r4, 0x3C] + ldr r0, _0818460C + str r0, [r4, 0x1C] +_081845FE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818460C: .4byte sub_8184610 + 1 + thumb_func_end sub_81845D4 + + thumb_func_start sub_8184610 +sub_8184610: @ 8184610 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x3C] + lsls r1, 16 + cmp r1, 0 + blt _0818462E + ldr r0, _0818463C + str r0, [r4, 0x1C] +_0818462E: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818463C: .4byte sub_8184640 + 1 + thumb_func_end sub_8184610 + + thumb_func_start sub_8184640 +sub_8184640: @ 8184640 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x3C] + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _08184668 + strh r2, [r4, 0x24] + ldr r0, _08184674 + str r0, [r4, 0x1C] +_08184668: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08184674: .4byte sub_8184678 + 1 + thumb_func_end sub_8184640 + + thumb_func_start sub_8184678 +sub_8184678: @ 8184678 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r2, [r4, 0x34] + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08184698 + ldr r0, _08184694 + str r0, [r4, 0x1C] + b _081846AC + .align 2, 0 +_08184694: .4byte sub_81846B8 + 1 +_08184698: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r3, 0x36 + ldrsh r0, [r4, r3] + negs r0, r0 + strh r0, [r4, 0x36] + adds r0, r2, 0x1 + strh r0, [r4, 0x34] +_081846AC: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8184678 + + thumb_func_start sub_81846B8 +sub_81846B8: @ 81846B8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + subs r0, 0x2 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bgt _081846DA + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, _081846E8 + str r0, [r4, 0x1C] +_081846DA: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081846E8: .4byte sub_8184D88 + 1 + thumb_func_end sub_81846B8 + + thumb_func_start pokemonanimfunc_88 +pokemonanimfunc_88: @ 81846EC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r2, 0 + movs r1, 0x4 + strh r1, [r4, 0x3C] + movs r0, 0xC + strh r0, [r4, 0x3A] + movs r0, 0x10 + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x2 + strh r0, [r4, 0x32] + ldr r0, _08184714 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08184714: .4byte sub_81845D4 + 1 + thumb_func_end pokemonanimfunc_88 + + thumb_func_start pokemonanimfunc_89 +pokemonanimfunc_89: @ 8184718 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r2, 0 + movs r1, 0x2 + strh r1, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0xC + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x32] + ldr r0, _08184740 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08184740: .4byte sub_81845D4 + 1 + thumb_func_end pokemonanimfunc_89 + + thumb_func_start pokemonanimfunc_8A +pokemonanimfunc_8A: @ 8184744 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r1, 0 + strh r1, [r4, 0x3C] + movs r0, 0x6 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r1, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x32] + ldr r0, _0818476C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818476C: .4byte sub_81845D4 + 1 + thumb_func_end pokemonanimfunc_8A + + thumb_func_start sub_8184770 +sub_8184770: @ 8184770 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + strh r0, [r1, 0x24] + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0x1 + ble _0818478E + movs r2, 0x30 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x30] + movs r0, 0 + b _08184790 +_0818478E: + adds r0, r2, 0x1 +_08184790: + strh r0, [r1, 0x2E] + pop {r0} + bx r0 + thumb_func_end sub_8184770 + + thumb_func_start sub_8184798 +sub_8184798: @ 8184798 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, _081847C8 + movs r2, 0x34 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + adds r0, r4, 0 + bl sub_8184770 + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _081847D0 + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, _081847CC + str r0, [r4, 0x1C] + b _0818482E + .align 2, 0 +_081847C8: .4byte 0x0860ae7c +_081847CC: .4byte sub_8184D88 + 1 +_081847D0: + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bne _08184800 + ldrb r0, [r1] + cmp r0, 0 + beq _081847F0 + ldrh r0, [r4, 0x3C] + ldr r3, _081847EC + movs r1, 0x10 + movs r2, 0x10 + bl pal_fade_1 + b _081847FC + .align 2, 0 +_081847EC: .4byte 0x000003ff +_081847F0: + ldrh r0, [r4, 0x3C] + ldr r3, _08184824 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 +_081847FC: + movs r0, 0 + strh r0, [r4, 0x36] +_08184800: + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08184828 + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _0818482E + .align 2, 0 +_08184824: .4byte 0x000003ff +_08184828: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_0818482E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8184798 + + thumb_func_start pokemonanimfunc_8B +pokemonanimfunc_8B: @ 8184834 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08184860 + ldrb r0, [r2, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + adds r0, r1 + strh r0, [r2, 0x3C] + strh r3, [r2, 0x3A] + strh r3, [r2, 0x38] + strh r3, [r2, 0x36] + strh r3, [r2, 0x34] +_08184860: + adds r0, r2, 0 + bl sub_8184798 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8B + + thumb_func_start pokemonanimfunc_8C +pokemonanimfunc_8C: @ 818486C + push {r4,r5,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0x1 + bne _08184898 + ldrb r0, [r2, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r5, 0x80 + lsls r5, 1 + adds r1, r5, 0 + adds r0, r1 + strh r0, [r2, 0x3C] + strh r3, [r2, 0x3A] + strh r3, [r2, 0x38] + strh r3, [r2, 0x36] + strh r4, [r2, 0x34] +_08184898: + adds r0, r2, 0 + bl sub_8184798 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8C + + thumb_func_start pokemonanimfunc_8D +pokemonanimfunc_8D: @ 81848A4 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081848D2 + ldrb r0, [r2, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + adds r0, r1 + strh r0, [r2, 0x3C] + strh r3, [r2, 0x3A] + strh r3, [r2, 0x38] + strh r3, [r2, 0x36] + movs r0, 0x2 + strh r0, [r2, 0x34] +_081848D2: + adds r0, r2, 0 + bl sub_8184798 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8D + + thumb_func_start sub_81848E0 +sub_81848E0: @ 81848E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _08184904 + ldrh r0, [r4, 0x3C] + movs r1, 0x10 + movs r2, 0 + movs r3, 0x1F + bl pal_fade_1 + ldr r0, _08184900 + str r0, [r4, 0x1C] + b _0818492A + .align 2, 0 +_08184900: .4byte sub_8184D88 + 1 +_08184904: + movs r5, 0x32 + ldrsh r0, [r4, r5] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, _08184930 + movs r5, 0x30 + ldrsh r1, [r4, r5] + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 +_0818492A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08184930: .4byte 0x0860ae88 + thumb_func_end sub_81848E0 + + thumb_func_start sub_8184934 +sub_8184934: @ 8184934 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _081849CC + adds r0, r4, 0 + bl sub_817F70C + movs r3, 0x38 + ldrsh r1, [r4, r3] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08184970 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0818496C + strh r2, [r4, 0x38] +_0818496C: + strh r2, [r4, 0x24] + b _081849C6 +_08184970: + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + lsls r1, 16 + asrs r1, 15 + movs r0, 0x1 + subs r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 7 + movs r3, 0x2E + ldrsh r1, [r4, r3] + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _081849A4 + adds r0, 0xFF +_081849A4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r1, 0 + muls r2, r0 + adds r0, r2, 0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_081849C6: + adds r0, r4, 0 + bl sub_817F70C +_081849CC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8184934 + + thumb_func_start pokemonanimfunc_8E +pokemonanimfunc_8E: @ 81849D4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _081849FE + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r2, [r4, 0x30] +_081849FE: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184A0E + adds r0, r4, 0 + bl sub_81848E0 +_08184A0E: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184A30 + adds r0, r4, 0 + bl sub_8184934 +_08184A30: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8E + + thumb_func_start pokemonanimfunc_8F +pokemonanimfunc_8F: @ 8184A3C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184A66 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x14 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r2, [r4, 0x30] +_08184A66: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184A76 + adds r0, r4, 0 + bl sub_81848E0 +_08184A76: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184A98 + adds r0, r4, 0 + bl sub_8184934 +_08184A98: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8F + + thumb_func_start pokemonanimfunc_90 +pokemonanimfunc_90: @ 8184AA4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184ACE + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x50 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r2, [r4, 0x30] +_08184ACE: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184ADE + adds r0, r4, 0 + bl sub_81848E0 +_08184ADE: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184B00 + adds r0, r4, 0 + bl sub_8184934 +_08184B00: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_90 + + thumb_func_start pokemonanimfunc_91 +pokemonanimfunc_91: @ 8184B0C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184B38 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x30] +_08184B38: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184B48 + adds r0, r4, 0 + bl sub_81848E0 +_08184B48: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184B6A + adds r0, r4, 0 + bl sub_8184934 +_08184B6A: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_91 + + thumb_func_start pokemonanimfunc_92 +pokemonanimfunc_92: @ 8184B78 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184BA2 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x14 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r0, [r4, 0x30] +_08184BA2: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184BB2 + adds r0, r4, 0 + bl sub_81848E0 +_08184BB2: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184BD4 + adds r0, r4, 0 + bl sub_8184934 +_08184BD4: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_92 + + thumb_func_start pokemonanimfunc_93 +pokemonanimfunc_93: @ 8184BE0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184C0A + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x50 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r0, [r4, 0x30] +_08184C0A: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184C1A + adds r0, r4, 0 + bl sub_81848E0 +_08184C1A: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184C3C + adds r0, r4, 0 + bl sub_8184934 +_08184C3C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_93 + + thumb_func_start pokemonanimfunc_94 +pokemonanimfunc_94: @ 8184C48 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184C72 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r0, [r4, 0x30] +_08184C72: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184C82 + adds r0, r4, 0 + bl sub_81848E0 +_08184C82: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184CA4 + adds r0, r4, 0 + bl sub_8184934 +_08184CA4: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_94 + + thumb_func_start pokemonanimfunc_95 +pokemonanimfunc_95: @ 8184CB0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184CDC + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x14 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x2 + strh r0, [r4, 0x30] +_08184CDC: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184CEC + adds r0, r4, 0 + bl sub_81848E0 +_08184CEC: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184D0E + adds r0, r4, 0 + bl sub_8184934 +_08184D0E: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_95 + + thumb_func_start pokemonanimfunc_96 +pokemonanimfunc_96: @ 8184D1C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184D48 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x50 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x2 + strh r0, [r4, 0x30] +_08184D48: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184D58 + adds r0, r4, 0 + bl sub_81848E0 +_08184D58: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184D7A + adds r0, r4, 0 + bl sub_8184934 +_08184D7A: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_96 + + thumb_func_start sub_8184D88 +sub_8184D88: @ 8184D88 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08184D9C + ldr r0, _08184DA0 + str r0, [r2, 0x1C] +_08184D9C: + pop {r0} + bx r0 + .align 2, 0 +_08184DA0: .4byte nullsub_12 + 1 + thumb_func_end sub_8184D88 + + thumb_func_start sub_8184DA4 +sub_8184DA4: @ 8184DA4 + 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 + ldr r0, _08184E30 + mov r1, r12 + strb r1, [r0] + ldr r1, _08184E34 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + movs r7, 0 + ldr r3, _08184E38 + mov r10, r3 + ldr r6, _08184E3C + mov r9, r6 + ldr r0, _08184E40 + mov r8, r0 +_08184DD0: + lsls r0, r2, 1 + mov r3, r9 + adds r1, r0, r3 + strh r7, [r1] + ldr r6, _08184E44 + adds r1, r0, r6 + strh r7, [r1] + ldr r1, _08184E48 + adds r0, r1 + strh r7, [r0] + adds r4, r2, 0x1 + mov r3, r12 + cmp r3, 0x1 + bne _08184E1C + ldr r5, _08184E4C + movs r3, 0xFF + movs r1, 0xA6 + lsls r1, 2 + adds r0, r2, 0 + muls r0, r1 + mov r6, r8 + adds r2, r0, r6 +_08184DFC: + ldrb r0, [r2] + orrs r0, r3 + strb r0, [r2] + adds r2, 0x1 + subs r1, 0x1 + cmp r1, 0 + bne _08184DFC + ldr r0, [r5] + ldr r1, _08184E50 + str r0, [r1] + ldr r3, _08184E54 + ldr r0, [r3] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0xC] + mov r6, r10 + str r0, [r6] +_08184E1C: + adds r2, r4, 0 + cmp r2, 0x3 + ble _08184DD0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08184E30: .4byte 0x0203c7ac +_08184E34: .4byte 0x0203ccd0 +_08184E38: .4byte 0x0203c7bc +_08184E3C: .4byte 0x0203c794 +_08184E40: .4byte 0x0203bd34 +_08184E44: .4byte 0x0203c79c +_08184E48: .4byte 0x0203c7a4 +_08184E4C: .4byte 0x02022fec +_08184E50: .4byte 0x0203c7b8 +_08184E54: .4byte 0x020244a8 + thumb_func_end sub_8184DA4 + + thumb_func_start sub_8184E58 +sub_8184E58: @ 8184E58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r0, _08184E88 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08184EA0 + ldr r1, _08184E8C + ldr r0, _08184E90 + ldr r0, [r0] + str r0, [r1] + ldr r4, _08184E94 + ldr r0, _08184E98 + bl var_get + strb r0, [r4] + ldr r4, _08184E9C + bl sub_81A513C + strb r0, [r4] + b _08184EAC + .align 2, 0 +_08184E88: .4byte 0x0203c7ac +_08184E8C: .4byte 0x0203bd2c +_08184E90: .4byte 0x03005d80 +_08184E94: .4byte 0x0203c7ae +_08184E98: .4byte 0x000040cf +_08184E9C: .4byte 0x0203c7af +_08184EA0: + cmp r0, 0x2 + bne _08184EAC + ldr r0, _08184F24 + ldr r1, _08184F28 + ldr r1, [r1] + str r1, [r0] +_08184EAC: + ldr r0, _08184F2C + ldr r5, [r0] + movs r0, 0x2 + ands r5, r0 + cmp r5, 0 + beq _08184F64 + bl link_get_multiplayer_id + ldr r1, _08184F30 + strb r0, [r1] + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r5, 0 + ldr r0, _08184F34 + mov r9, r0 + ldr r6, _08184F38 + movs r0, 0x8 + adds r0, r6 + mov r8, r0 + mov r7, r9 + adds r7, 0x4 +_08184EDC: + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 2 + mov r0, r9 + adds r2, r4, r0 + lsls r0, r5, 3 + subs r0, r5 + lsls r3, r0, 2 + adds r0, r6, 0x4 + adds r0, r3, r0 + ldr r0, [r0] + str r0, [r2] + adds r1, r3, r6 + ldrb r0, [r1, 0x13] + strb r0, [r2, 0xC] + ldrh r0, [r1, 0x18] + strh r0, [r2, 0xE] + ldrh r0, [r1, 0x1A] + strh r0, [r2, 0x10] + cmp r5, r10 + bge _08184F3C + mov r0, r8 + adds r1, r3, r0 + mov r0, sp + bl gf_strcpy + mov r0, sp + bl sub_8009370 + adds r0, r4, r7 + mov r1, sp + bl gf_strcpy + adds r5, 0x1 + b _08184F56 + .align 2, 0 +_08184F24: .4byte 0x03005d80 +_08184F28: .4byte 0x0203bd2c +_08184F2C: .4byte 0x02022fec +_08184F30: .4byte 0x0203c7b4 +_08184F34: .4byte 0x0203cc80 +_08184F38: .4byte 0x020229e8 +_08184F3C: + adds r5, 0x1 + ldr r0, _08184F5C + adds r1, r3, r0 + ldr r0, _08184F60 + adds r2, r4, r0 + movs r3, 0x7 +_08184F48: + ldrb r0, [r1] + strb r0, [r2] + adds r1, 0x1 + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08184F48 +_08184F56: + cmp r5, 0x3 + ble _08184EDC + b _08184FA0 + .align 2, 0 +_08184F5C: .4byte 0x020229f0 +_08184F60: .4byte 0x0203cc84 +_08184F64: + ldr r3, _08184FB0 + ldr r4, _08184FB4 + ldr r2, [r4] + 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, [r3] + ldrb r0, [r2, 0x8] + strb r0, [r3, 0xC] + strh r5, [r3, 0xE] + ldr r0, _08184FB8 + ldrb r0, [r0] + strh r0, [r3, 0x10] + movs r5, 0 + adds r3, 0x4 +_08184F90: + adds r0, r5, r3 + ldr r1, [r4] + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _08184F90 +_08184FA0: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08184FB0: .4byte 0x0203cc80 +_08184FB4: .4byte 0x03005d90 +_08184FB8: .4byte 0x082e9531 + thumb_func_end sub_8184E58 + + thumb_func_start sub_8184FBC +sub_8184FBC: @ 8184FBC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r1, _08184FF8 + lsls r0, r5, 1 + adds r4, r0, r1 + ldrh r2, [r4] + adds r3, r2, 0 + ldr r0, _08184FFC + cmp r3, r0 + bhi _08184FF0 + ldr r0, _08185000 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08184FF0 + ldr r1, _08185004 + adds r0, r2, 0x1 + strh r0, [r4] + movs r0, 0xA6 + lsls r0, 2 + muls r0, r5 + adds r0, r3, r0 + adds r0, r1 + strb r6, [r0] +_08184FF0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08184FF8: .4byte 0x0203c794 +_08184FFC: .4byte 0x00000297 +_08185000: .4byte 0x0203c7ac +_08185004: .4byte 0x0203bd34 + thumb_func_end sub_8184FBC + + thumb_func_start sub_8185008 +sub_8185008: @ 8185008 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + cmp r3, r4 + bge _08185046 + ldr r0, _0818504C + lsls r1, r5, 1 + adds r2, r1, r0 + ldr r7, _08185050 + movs r0, 0xA6 + lsls r0, 2 + muls r5, r0 + movs r6, 0xFF +_08185028: + ldrh r0, [r2] + subs r0, 0x1 + strh r0, [r2] + ldrh r1, [r2] + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + ldrh r0, [r2] + cmp r0, 0 + beq _08185046 + adds r3, 0x1 + cmp r3, r4 + blt _08185028 +_08185046: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818504C: .4byte 0x0203c794 +_08185050: .4byte 0x0203bd34 + thumb_func_end sub_8185008 + + thumb_func_start sub_8185054 +sub_8185054: @ 8185054 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _081850A4 + lsls r0, r3, 1 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, _081850A8 + cmp r1, r0 + bhi _0818507A + ldr r4, _081850AC + adds r0, 0x1 + muls r3, r0 + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081850BC +_0818507A: + ldr r2, _081850B0 + ldr r1, _081850B4 + 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 sub_80A1AD4 + ldr r0, _081850B8 + bl set_callback2 + movs r0, 0xFF + b _081850C6 + .align 2, 0 +_081850A4: .4byte 0x0203c794 +_081850A8: .4byte 0x00000297 +_081850AC: .4byte 0x0203bd34 +_081850B0: .4byte 0x020375f0 +_081850B4: .4byte 0x0202433a +_081850B8: .4byte sub_80384E4 + 1 +_081850BC: + adds r0, r1, 0x1 + strh r0, [r2] + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] +_081850C6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8185054 + + thumb_func_start sub_81850D0 +sub_81850D0: @ 81850D0 + ldr r0, _081850D8 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081850D8: .4byte 0x0203c7ac + thumb_func_end sub_81850D0 + + thumb_func_start sub_81850DC +sub_81850DC: @ 81850DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + movs r7, 0 + movs r0, 0 + mov r12, r0 +_081850F0: + mov r1, r12 + lsls r3, r1, 1 + ldr r0, _0818519C + adds r5, r3, r0 + ldr r1, _081851A0 + adds r6, r3, r1 + ldrh r0, [r5] + mov r9, r3 + mov r1, r12 + adds r1, 0x1 + str r1, [sp] + ldrh r1, [r6] + cmp r0, r1 + beq _0818517E + adds r1, r7, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r2, r7, 0 + add r1, r8 + mov r0, r12 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + add r2, r8 + ldrb r0, [r5] + ldrb r1, [r6] + subs r0, r1 + strb r0, [r2] + movs r4, 0 + ldrh r0, [r5] + ldrh r1, [r6] + subs r0, r1 + cmp r4, r0 + bge _08185172 + ldr r1, _081851A4 + mov r10, r1 + ldr r6, _081851A0 + movs r0, 0xA6 + lsls r0, 2 + mov r5, r12 + muls r5, r0 +_08185146: + adds r1, r7, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + add r1, r8 + adds r2, r3, r6 + ldrh r0, [r2] + adds r0, r4 + adds r0, r5 + add r0, r10 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0818519C + adds r0, r3, r1 + ldrh r1, [r0] + ldrh r0, [r2] + subs r1, r0 + cmp r4, r1 + blt _08185146 +_08185172: + ldr r0, _081851A0 + add r0, r9 + ldr r1, _0818519C + add r1, r9 + ldrh r1, [r1] + strh r1, [r0] +_0818517E: + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3 + bls _081850F0 + adds r0, r7, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818519C: .4byte 0x0203c794 +_081851A0: .4byte 0x0203c79c +_081851A4: .4byte 0x0203bd34 + thumb_func_end sub_81850DC + + thumb_func_start sub_81851A8 +sub_81851A8: @ 81851A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + movs r1, 0x2 + mov r0, sp + strb r1, [r0] + ldr r0, _081851C8 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _0818525E + movs r5, 0 + ldr r4, _081851CC + b _081851DA + .align 2, 0 +_081851C8: .4byte 0x02022fec +_081851CC: .4byte 0x020229e8 +_081851D0: + ldrb r0, [r4] + cmp r0, 0x3 + bne _0818525E + adds r4, 0x1C + adds r5, 0x1 +_081851DA: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _081851D0 + ldr r0, _0818526C + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0818525E + ldrb r0, [r7] + mov r4, sp + adds r4, 0x1 + strb r0, [r4] + ldrb r0, [r4] + mov r8, r4 + cmp r0, 0 + beq _0818525E +_08185202: + adds r0, r7, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_8185278 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_8185278 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08185256 + ldr r3, _08185270 + ldr r0, _08185274 + lsls r1, r6, 1 + adds r4, r1, r0 + adds r5, r2, 0 + movs r0, 0xA6 + lsls r0, 2 + muls r6, r0 +_08185232: + adds r0, r7, 0 + mov r1, sp + mov r2, r8 + str r3, [sp, 0x4] + bl sub_8185278 + ldrh r1, [r4] + adds r2, r1, 0x1 + strh r2, [r4] + lsls r1, 16 + lsrs r1, 16 + adds r1, r6 + ldr r3, [sp, 0x4] + adds r1, r3 + strb r0, [r1] + subs r5, 0x1 + cmp r5, 0 + bne _08185232 +_08185256: + mov r4, r8 + ldrb r0, [r4] + cmp r0, 0 + bne _08185202 +_0818525E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818526C: .4byte 0x02022fec +_08185270: .4byte 0x0203bd34 +_08185274: .4byte 0x0203c7a4 + thumb_func_end sub_81851A8 + + thumb_func_start sub_8185278 +sub_8185278: @ 8185278 + ldrb r3, [r2] + subs r3, 0x1 + strb r3, [r2] + ldrb r2, [r1] + adds r3, r2, 0x1 + strb r3, [r1] + lsls r2, 24 + lsrs r2, 24 + adds r0, r2 + ldrb r0, [r0] + bx lr + thumb_func_end sub_8185278 + + thumb_func_start sub_8185290 +sub_8185290: @ 8185290 + push {r4,r5,lr} + movs r0, 0xF8 + lsls r0, 4 + bl malloc_and_clear + adds r4, r0, 0 + bl start_ov_to_battle_anim + 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_8185290 + + thumb_func_start sub_81852B0 +sub_81852B0: @ 81852B0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _081852DC + adds r0, r5, r1 + ldr r1, [r0] + cmp r1, 0 + beq _081852E8 + ldr r0, _081852E0 + ands r1, r0 + cmp r1, 0 + bne _081852E8 + ldr r4, _081852E4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806F96C + adds r4, r5, r4 + ldr r1, [r4] + cmp r0, r1 + bne _081852E8 + movs r0, 0x1 + b _081852EA + .align 2, 0 +_081852DC: .4byte 0x000004ec +_081852E0: .4byte 0x7d007e92 +_081852E4: .4byte 0x00000f7c +_081852E8: + movs r0, 0 +_081852EA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81852B0 + + thumb_func_start sub_81852F0 +sub_81852F0: @ 81852F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r5, 0 + movs r1, 0 + bl memset + movs r2, 0xF8 + lsls r2, 4 + adds r0, r5, 0 + adds r1, r4, 0 + bl memcpy + ldr r4, _0818532C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806F96C + adds r4, r5, r4 + str r0, [r4] + movs r0, 0x1F + adds r1, r5, 0 + bl sub_8153634 + cmp r0, 0x1 + bne _08185330 + movs r0, 0x1 + b _08185332 + .align 2, 0 +_0818532C: .4byte 0x00000f7c +_08185330: + movs r0, 0 +_08185332: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81852F0 + + thumb_func_start sub_8185338 +sub_8185338: @ 8185338 + 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] + movs r0, 0xF8 + lsls r0, 4 + bl malloc_and_clear + adds r7, r0, 0 + movs r0, 0x80 + lsls r0, 5 + bl malloc_and_clear + str r0, [sp] + movs r6, 0 +_0818535E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + adds r5, r7, r4 + ldr r1, _08185430 + adds r1, r4, r1 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + movs r1, 0x96 + lsls r1, 2 + adds r5, r1 + ldr r0, _08185434 + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r6, 0x1 + cmp r6, 0x5 + ble _0818535E + movs r6, 0 + ldr r2, _08185438 + mov r9, r2 + movs r3, 0x9A + lsls r3, 3 + adds r3, r7, r3 + str r3, [sp, 0x8] + ldr r5, _0818543C + mov r8, r6 + mov r12, r6 + movs r4, 0x96 + lsls r4, 3 + adds r4, r7 + mov r10, r4 + ldr r0, _08185440 + adds r4, r7, r0 +_081853AC: + lsls r1, r6, 3 + ldr r0, _0818543C + adds r0, 0x4 + mov r3, r8 + adds r2, r3, r0 + add r1, r10 + movs r3, 0x7 +_081853BA: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _081853BA + ldr r0, [sp, 0x8] + adds r1, r0, r6 + ldrb r0, [r5, 0xC] + strb r0, [r1] + ldrh r0, [r5, 0x10] + strb r0, [r4] + ldrh r0, [r5, 0xE] + strb r0, [r4, 0xC] + ldr r1, _08185444 + adds r0, r7, r1 + add r0, r12 + ldr r1, [r5] + str r1, [r0] + adds r5, 0x14 + movs r2, 0x14 + add r8, r2 + movs r3, 0x4 + add r12, r3 + adds r4, 0x1 + adds r6, 0x1 + cmp r6, 0x3 + ble _081853AC + movs r4, 0x9D + lsls r4, 3 + adds r1, r7, r4 + ldr r5, _08185448 + ldr r0, [r5] + str r0, [r1] + ldr r0, _0818544C + ldr r2, [r0] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _081854DC + ldr r1, _08185450 + adds r3, r7, r1 + movs r1, 0x23 + negs r1, r1 + ands r1, r2 + movs r0, 0x80 + lsls r0, 18 + orrs r1, r0 + str r1, [r3] + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _08185454 + movs r0, 0x80 + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081854E2 + .align 2, 0 +_08185430: .4byte 0x0203c7c0 +_08185434: .4byte 0x0203ca18 +_08185438: .4byte 0x03005d90 +_0818543C: .4byte 0x0203cc80 +_08185440: .4byte 0x000004e4 +_08185444: .4byte 0x000004d4 +_08185448: .4byte 0x0203bd2c +_0818544C: .4byte 0x0203c7b8 +_08185450: .4byte 0x000004ec +_08185454: + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _081854E2 + ldr r2, _08185470 + ldrh r0, [r2, 0xE] + cmp r0, 0x1 + beq _081854A8 + cmp r0, 0x1 + bgt _08185474 + cmp r0, 0 + beq _0818547E + b _081854E2 + .align 2, 0 +_08185470: .4byte 0x0203cc80 +_08185474: + cmp r0, 0x2 + beq _0818547E + cmp r0, 0x3 + beq _081854A8 + b _081854E2 +_0818547E: + ldr r3, _0818549C + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r4, _081854A0 + adds r0, r4 + ldrh r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081854E2 + ldr r5, _081854A4 + adds r0, r7, r5 + b _081854C4 + .align 2, 0 +_0818549C: .4byte 0x0203c7b4 +_081854A0: .4byte 0x0203cc80 +_081854A4: .4byte 0x000004ec +_081854A8: + ldr r0, _081854D0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, _081854D4 + adds r0, r1 + ldrh r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081854E2 + ldr r2, _081854D8 + adds r0, r7, r2 +_081854C4: + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 24 + orrs r1, r2 + str r1, [r0] + b _081854E2 + .align 2, 0 +_081854D0: .4byte 0x0203c7b4 +_081854D4: .4byte 0x0203cc80 +_081854D8: .4byte 0x000004ec +_081854DC: + ldr r3, _08185610 + adds r0, r7, r3 + str r2, [r0] +_081854E2: + ldr r4, _08185614 + ldrh r1, [r4] + ldr r5, _08185618 + adds r0, r7, r5 + strh r1, [r0] + ldr r0, _0818561C + ldrh r1, [r0] + ldr r2, _08185620 + adds r0, r7, r2 + strh r1, [r0] + ldr r3, _08185624 + ldrh r1, [r3] + movs r4, 0x9F + lsls r4, 3 + adds r0, r7, r4 + strh r1, [r0] + ldr r5, _08185628 + ldrb r1, [r5] + adds r2, 0x4 + adds r0, r7, r2 + strh r1, [r0] + mov r3, r9 + ldr r0, [r3] + ldr r4, _0818562C + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r5, _08185630 + adds r1, r7, r5 + strb r0, [r1] + ldr r0, _08185634 + ldrb r1, [r0] + adds r2, 0x3 + adds r0, r7, r2 + strb r1, [r0] + ldr r3, _08185638 + ldrb r1, [r3] + ldr r4, _0818563C + adds r0, r7, r4 + strb r1, [r0] + mov r5, r9 + ldr r0, [r5] + ldrb r1, [r0, 0x15] + lsls r1, 29 + ldr r0, _08185640 + adds r3, r7, r0 + lsrs r1, 31 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldr r1, [r5] + ldrb r1, [r1, 0x14] + lsls r1, 29 + lsrs r1, 28 + movs r2, 0xF + negs r2, r2 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r2, 0xA0 + lsls r2, 3 + adds r1, r7, r2 + ldr r3, _08185644 + ldr r0, [r3] + str r0, [r1] + ldr r4, _08185648 + adds r1, r4, 0 + ldr r5, _08185614 + ldrh r5, [r5] + adds r0, r1, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x63 + bls _08185580 + b _081856C4 +_08185580: + movs r6, 0 + ldr r0, _0818564C + adds r3, r7, r0 + mov r10, r9 + ldr r1, _08185614 + mov r12, r1 + adds r2, r4, 0 + mov r8, r2 + ldr r4, _08185650 +_08185592: + adds r2, r3, r6 + mov r5, r10 + ldr r1, [r5] + mov r5, r12 + ldrh r0, [r5] + add r0, r8 + movs r5, 0xEC + muls r0, r5 + adds r0, r6, r0 + adds r1, r4 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x7 + ble _08185592 + mov r0, r9 + ldr r2, [r0] + ldr r1, _08185614 + ldrh r0, [r1] + ldr r3, _08185648 + adds r0, r3 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r4, _08185654 + adds r2, r4 + ldrb r1, [r2] + ldr r5, _08185658 + adds r0, r7, r5 + strb r1, [r0] + ldr r1, _0818565C + ldrb r0, [r1] + cmp r0, 0x1 + bne _08185664 + movs r6, 0 + ldr r2, _08185660 + adds r4, r7, r2 + mov r10, r9 + ldr r5, _08185614 + mov r8, r5 + adds r5, r3, 0 +_081855E6: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + movs r0, 0xEC + lsls r0, 3 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _081855E6 + b _08185696 + .align 2, 0 +_08185610: .4byte 0x000004ec +_08185614: .4byte 0x02038bca +_08185618: .4byte 0x000004f4 +_0818561C: .4byte 0x02038bcc +_08185620: .4byte 0x000004f6 +_08185624: .4byte 0x02038bce +_08185628: .4byte 0x0203c7b4 +_0818562C: .4byte 0x00000ca9 +_08185630: .4byte 0x000004fc +_08185634: .4byte 0x0203c7ae +_08185638: .4byte 0x0203c7af +_0818563C: .4byte 0x000004fe +_08185640: .4byte 0x000004ff +_08185644: .4byte 0x0203c7bc +_08185648: .4byte 0xfffffed4 +_0818564C: .4byte 0x00000504 +_08185650: .4byte 0x0000073c +_08185654: .4byte 0x00000739 +_08185658: .4byte 0x0000050c +_0818565C: .4byte 0x0203cce8 +_08185660: .4byte 0x0000050e +_08185664: + movs r6, 0 + ldr r1, _081856B0 + adds r4, r7, r1 + mov r10, r9 + ldr r2, _081856B4 + mov r8, r2 + adds r5, r3, 0 +_08185672: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + ldr r0, _081856B8 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185672 +_08185696: + mov r1, r9 + ldr r2, [r1] + ldr r3, _081856B4 + ldrh r0, [r3] + ldr r4, _081856BC + adds r0, r4 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r5, _081856C0 + adds r2, r5 + ldrb r1, [r2] + b _08185856 + .align 2, 0 +_081856B0: .4byte 0x0000050e +_081856B4: .4byte 0x02038bca +_081856B8: .4byte 0x00000754 +_081856BC: .4byte 0xfffffed4 +_081856C0: .4byte 0x0000081c +_081856C4: + ldr r3, _08185764 + ldrh r3, [r3] + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x63 + bls _081856D4 + b _081857E4 +_081856D4: + movs r6, 0 + ldr r4, _08185768 + adds r3, r7, r4 + mov r10, r9 + ldr r5, _08185764 + mov r12, r5 + ldr r0, _0818576C + mov r8, r0 + ldr r4, _08185770 +_081856E6: + adds r2, r3, r6 + mov r5, r10 + ldr r1, [r5] + mov r5, r12 + ldrh r0, [r5] + add r0, r8 + movs r5, 0xEC + muls r0, r5 + adds r0, r6, r0 + adds r1, r4 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x7 + ble _081856E6 + mov r0, r9 + ldr r2, [r0] + ldr r1, _08185764 + ldrh r0, [r1] + ldr r3, _0818576C + adds r0, r3 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r4, _08185774 + adds r2, r4 + ldrb r1, [r2] + ldr r5, _08185778 + adds r0, r7, r5 + strb r1, [r0] + ldr r1, _0818577C + ldrb r0, [r1] + cmp r0, 0x1 + bne _08185784 + movs r6, 0 + ldr r2, _08185780 + adds r4, r7, r2 + mov r10, r9 + ldr r5, _08185764 + mov r8, r5 + adds r5, r3, 0 +_0818573A: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + movs r0, 0xEC + lsls r0, 3 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _0818573A + b _081857B6 + .align 2, 0 +_08185764: .4byte 0x02038bcc +_08185768: .4byte 0x00000504 +_0818576C: .4byte 0xfffffed4 +_08185770: .4byte 0x0000073c +_08185774: .4byte 0x00000739 +_08185778: .4byte 0x0000050c +_0818577C: .4byte 0x0203cce8 +_08185780: .4byte 0x0000050e +_08185784: + movs r6, 0 + ldr r1, _081857D0 + adds r4, r7, r1 + mov r10, r9 + ldr r2, _081857D4 + mov r8, r2 + adds r5, r3, 0 +_08185792: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + ldr r0, _081857D8 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185792 +_081857B6: + mov r1, r9 + ldr r2, [r1] + ldr r3, _081857D4 + ldrh r0, [r3] + ldr r4, _081857DC + adds r0, r4 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r5, _081857E0 + adds r2, r5 + ldrb r1, [r2] + b _08185856 + .align 2, 0 +_081857D0: .4byte 0x0000050e +_081857D4: .4byte 0x02038bcc +_081857D8: .4byte 0x00000754 +_081857DC: .4byte 0xfffffed4 +_081857E0: .4byte 0x0000081c +_081857E4: + ldr r3, _081858CC + ldrh r3, [r3] + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x63 + bhi _0818585C + movs r6, 0 + ldr r4, _081858D0 + adds r3, r7, r4 + mov r10, r9 + ldr r5, _081858CC + mov r12, r5 + ldr r0, _081858D4 + mov r8, r0 + ldr r4, _081858D8 +_08185804: + adds r2, r3, r6 + mov r5, r10 + ldr r1, [r5] + mov r5, r12 + ldrh r0, [r5] + add r0, r8 + movs r5, 0xEC + muls r0, r5 + adds r0, r6, r0 + adds r1, r4 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x7 + ble _08185804 + mov r0, r9 + ldr r1, [r0] + ldr r2, _081858CC + ldrh r0, [r2] + ldr r3, _081858D4 + adds r0, r3 + movs r2, 0xEC + muls r0, r2 + adds r1, r0 + ldr r4, _081858DC + adds r1, r4 + ldrb r1, [r1] + ldr r5, _081858E0 + adds r0, r7, r5 + strb r1, [r0] + mov r0, r9 + ldr r1, [r0] + ldr r4, _081858CC + ldrh r0, [r4] + adds r0, r3 + muls r0, r2 + adds r1, r0 + ldr r5, _081858E4 + adds r1, r5 + ldrb r1, [r1] +_08185856: + ldr r2, _081858E8 + adds r0, r7, r2 + strb r1, [r0] +_0818585C: + ldr r3, _081858EC + ldrh r0, [r3] + ldr r1, _081858F0 + cmp r0, r1 + bls _08185900 + mov r4, r9 + ldr r2, [r4] + adds r1, r0, 0 + ldr r3, _081858F4 + adds r1, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, 0xDC + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + ldr r5, _081858F8 + adds r1, r7, r5 + strb r0, [r1] + movs r6, 0 + ldr r0, _081858FC + adds r4, r7, r0 + mov r10, r9 + ldr r1, _081858EC + mov r8, r1 + adds r5, r3, 0 +_08185894: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r0, r8 + ldrh r1, [r0] + adds r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r1, 0x82 + lsls r1, 1 + adds r2, r1 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185894 + mov r3, r9 + ldr r2, [r3] + ldr r4, _081858EC + ldrh r1, [r4] + ldr r5, _081858F4 + adds r1, r5 + b _081859AC + .align 2, 0 +_081858CC: .4byte 0x02038bce +_081858D0: .4byte 0x00000504 +_081858D4: .4byte 0xfffffed4 +_081858D8: .4byte 0x0000073c +_081858DC: .4byte 0x00000739 +_081858E0: .4byte 0x0000050c +_081858E4: .4byte 0x0000081c +_081858E8: .4byte 0x0000051a +_081858EC: .4byte 0x02038bca +_081858F0: .4byte 0x0000018f +_081858F4: .4byte 0xfffffe70 +_081858F8: .4byte 0x0000050d +_081858FC: .4byte 0x0000050e +_08185900: + ldr r3, _0818596C + ldrh r0, [r3] + cmp r0, r1 + bls _0818597C + mov r4, r9 + ldr r2, [r4] + adds r1, r0, 0 + ldr r3, _08185970 + adds r1, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, 0xDC + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + ldr r5, _08185974 + adds r1, r7, r5 + strb r0, [r1] + movs r6, 0 + ldr r0, _08185978 + adds r4, r7, r0 + mov r10, r9 + ldr r1, _0818596C + mov r8, r1 + adds r5, r3, 0 +_08185936: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r0, r8 + ldrh r1, [r0] + adds r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r1, 0x82 + lsls r1, 1 + adds r2, r1 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185936 + mov r3, r9 + ldr r2, [r3] + ldr r4, _0818596C + ldrh r1, [r4] + ldr r5, _08185970 + adds r1, r5 + b _081859AC + .align 2, 0 +_0818596C: .4byte 0x02038bcc +_08185970: .4byte 0xfffffe70 +_08185974: .4byte 0x0000050d +_08185978: .4byte 0x0000050e +_0818597C: + ldr r3, _08185A34 + ldrh r0, [r3] + cmp r0, r1 + bls _081859C0 + mov r4, r9 + ldr r2, [r4] + adds r1, r0, 0 + ldr r3, _08185A38 + adds r1, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, 0xDC + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + ldr r5, _08185A3C + adds r1, r7, r5 + strb r0, [r1] + ldr r2, [r4] + ldr r0, _08185A34 + ldrh r1, [r0] + adds r1, r3 +_081859AC: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, _08185A40 + adds r0, r2, r1 + ldrb r1, [r0] + ldr r2, _08185A44 + adds r0, r7, r2 + strb r1, [r0] +_081859C0: + movs r6, 0 + ldr r3, _08185A48 + mov r10, r3 + ldr r4, _08185A4C + mov r9, r4 + movs r5, 0xA6 + lsls r5, 2 + mov r8, r5 + ldr r0, _08185A50 + adds r5, r7, r0 +_081859D4: + adds r4, r6, 0x1 + mov r0, r8 + muls r0, r6 + mov r1, r9 + adds r2, r0, r1 + adds r1, r0, r5 + mov r3, r10 + adds r3, 0x1 +_081859E4: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _081859E4 + adds r6, r4, 0 + cmp r6, 0x3 + ble _081859D4 +_081859F8: + adds r0, r7, 0 + ldr r1, [sp] + bl sub_81852F0 + adds r4, r0, 0 + cmp r4, 0x1 + beq _08185A14 + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0x2 + bls _081859F8 +_08185A14: + adds r0, r7, 0 + bl free + ldr r0, [sp] + bl free + adds r0, r4, 0 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08185A34: .4byte 0x02038bce +_08185A38: .4byte 0xfffffe70 +_08185A3C: .4byte 0x0000050d +_08185A40: .4byte 0x0000011b +_08185A44: .4byte 0x0000051b +_08185A48: .4byte 0x00000297 +_08185A4C: .4byte 0x0203bd34 +_08185A50: .4byte 0x0000051c + thumb_func_end sub_8185338 + + thumb_func_start sub_8185A54 +sub_8185A54: @ 8185A54 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0x1F + bl sub_81535DC + cmp r0, 0x1 + bne _08185A7E + movs r2, 0xF8 + lsls r2, 4 + adds r0, r5, 0 + adds r1, r4, 0 + bl memcpy + adds r0, r5, 0 + bl sub_81852B0 + cmp r0, 0 + beq _08185A7E + movs r0, 0x1 + b _08185A80 +_08185A7E: + movs r0, 0 +_08185A80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8185A54 + + thumb_func_start start_ov_to_battle_anim +start_ov_to_battle_anim: @ 8185A88 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 5 + bl malloc_and_clear + adds r5, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8185A54 + adds r4, r0, 0 + adds r0, r5, 0 + bl free + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end start_ov_to_battle_anim + + thumb_func_start sub_8185AB0 +sub_8185AB0: @ 8185AB0 + push {lr} + ldr r0, _08185AF8 + ldr r2, [r0] + ldr r0, _08185AFC + ldrb r0, [r0] + ldr r1, _08185B00 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r1, _08185B04 + movs r0, 0 + strb r0, [r1] + ldr r0, _08185B08 + movs r1, 0 + str r1, [r0] + ldr r0, _08185B0C + strh r1, [r0] + ldr r0, _08185B10 + strh r1, [r0] + ldr r0, _08185B14 + strh r1, [r0] + bl sub_8185EFC + ldr r0, _08185B18 + ldr r0, [r0] + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08185AF8: .4byte 0x03005d90 +_08185AFC: .4byte 0x0203c7ad +_08185B00: .4byte 0x00000ca9 +_08185B04: .4byte 0x0202433a +_08185B08: .4byte 0x02022fec +_08185B0C: .4byte 0x02038bca +_08185B10: .4byte 0x02038bcc +_08185B14: .4byte 0x02038bce +_08185B18: .4byte 0x0203c7b0 + thumb_func_end sub_8185AB0 + + thumb_func_start sub_8185B1C +sub_8185B1C: @ 8185B1C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08185B50 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bne _08185B4A + ldr r0, _08185B54 + ldr r1, _08185B58 + str r1, [r0, 0x8] + ldr r0, _08185B5C + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08185B4A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08185B50: .4byte 0x03005e00 +_08185B54: .4byte 0x030022c0 +_08185B58: .4byte sub_8185AB0 + 1 +_08185B5C: .4byte sub_8036760 + 1 + thumb_func_end sub_8185B1C + + thumb_func_start sub_8185B60 +sub_8185B60: @ 8185B60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + bl zero_player_party_data + bl zero_enemy_party_data + movs r6, 0 + ldr r0, _08185D90 + mov r8, r0 +_08185B7C: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + mov r1, r8 + adds r0, r4, r1 + adds r5, r7, r4 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + ldr r0, _08185D94 + adds r4, r0 + movs r2, 0x96 + lsls r2, 2 + adds r5, r2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r6, 0x1 + cmp r6, 0x5 + ble _08185B7C + movs r6, 0 + ldr r3, _08185D98 + mov r8, r3 + mov r0, r8 + adds r0, 0x8 + str r0, [sp] + mov r4, r8 + adds r4, 0x4 + mov r10, r6 + mov r9, r6 +_08185BBE: + movs r1, 0 + mov r12, r1 + lsls r5, r6, 2 + movs r2, 0x96 + lsls r2, 3 + adds r0, r7, r2 + mov r3, r9 + adds r2, r3, r0 + mov r0, r10 + lsls r1, r0, 2 + mov r0, r8 + adds r0, 0x8 + adds r1, r0 + movs r3, 0x7 +_08185BDA: + ldrb r0, [r2] + strb r0, [r1] + ldrb r0, [r2] + cmp r0, 0xFF + bne _08185BE8 + movs r0, 0x1 + mov r12, r0 +_08185BE8: + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08185BDA + movs r1, 0x9A + lsls r1, 3 + adds r0, r7, r1 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r4, 0xF] + ldr r2, _08185D9C + adds r0, r7, r2 + adds r0, r6 + ldrb r1, [r0] + strh r1, [r4, 0x16] + movs r3, 0x9E + lsls r3, 3 + adds r0, r7, r3 + adds r0, r6 + ldrb r0, [r0] + strh r0, [r4, 0x14] + subs r2, 0x10 + adds r0, r7, r2 + adds r0, r5 + ldr r0, [r0] + str r0, [r4] + mov r3, r12 + cmp r3, 0 + beq _08185C2A + ldr r0, [sp] + bl sub_8009308 +_08185C2A: + ldr r0, [sp] + adds r0, 0x1C + str r0, [sp] + adds r4, 0x1C + movs r1, 0x7 + add r10, r1 + movs r2, 0x8 + add r9, r2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08185BBE + ldr r1, _08185DA0 + movs r3, 0x9D + lsls r3, 3 + adds r0, r7, r3 + ldr r0, [r0] + str r0, [r1] + ldr r2, _08185DA4 + ldr r1, _08185DA8 + adds r0, r7, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + orrs r0, r1 + str r0, [r2] + ldr r1, _08185DAC + ldr r2, _08185DB0 + adds r0, r7, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08185DB4 + adds r3, 0xE + adds r0, r7, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08185DB8 + adds r2, 0x4 + adds r0, r7, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08185DBC + adds r3, 0x4 + adds r0, r7, r3 + ldrh r0, [r0] + strb r0, [r1] + ldr r1, _08185DC0 + ldr r3, _08185DC4 + ldr r0, [r3] + ldr r2, _08185DC8 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r1] + ldr r1, _08185DCC + ldr r2, _08185DD0 + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, _08185DD4 + adds r2, 0x1 + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r2, _08185DD8 + ldr r1, _08185DDC + adds r0, r7, r1 + ldrb r1, [r0] + lsls r0, r1, 31 + lsrs r0, 31 + strb r0, [r2] + ldr r0, _08185DE0 + lsls r1, 28 + lsrs r1, 29 + strb r1, [r0] + ldr r1, _08185DE4 + movs r2, 0xA0 + lsls r2, 3 + adds r0, r7, r2 + ldr r0, [r0] + str r0, [r1] + movs r6, 0 + mov r10, r3 + ldr r2, _08185DE8 + ldr r3, _08185DEC + ldr r0, _08185DF0 + mov r8, r0 + ldr r1, _08185DF4 + mov r9, r1 + ldr r5, _08185DF8 + ldr r0, _08185DFC + adds r4, r7, r0 +_08185CE2: + adds r0, r6, r5 + adds r1, r4, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x7 + ble _08185CE2 + ldr r1, _08185E00 + adds r0, r7, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r2, _08185E04 + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r3] + ldr r3, _08185E08 + adds r0, r7, r3 + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + adds r2, 0xE + adds r0, r7, r2 + ldrb r0, [r0] + mov r3, r9 + strb r0, [r3] + ldr r0, _08185E0C + adds r1, r7, r0 + ldr r4, _08185E10 + movs r6, 0x5 +_08185D1C: + ldrh r0, [r1] + strh r0, [r4] + adds r1, 0x2 + adds r4, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08185D1C + mov r1, r10 + ldr r2, [r1] + ldr r3, _08185E14 + adds r0, r7, r3 + ldrb r0, [r0] + ldr r1, _08185DC8 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r6, 0 + ldr r2, _08185E18 + mov r10, r2 + ldr r3, _08185E1C + mov r9, r3 + movs r0, 0xA6 + lsls r0, 2 + mov r8, r0 + ldr r1, _08185E20 + adds r5, r7, r1 +_08185D5C: + adds r2, r6, 0x1 + mov r0, r8 + muls r0, r6 + adds r1, r0, r5 + mov r3, r9 + adds r4, r0, r3 + mov r3, r10 + adds r3, 0x1 +_08185D6C: + ldrb r0, [r1] + strb r0, [r4] + adds r1, 0x1 + adds r4, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _08185D6C + adds r6, r2, 0 + cmp r6, 0x3 + ble _08185D5C + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08185D90: .4byte 0x020244ec +_08185D94: .4byte 0x02024744 +_08185D98: .4byte 0x020229e8 +_08185D9C: .4byte 0x000004e4 +_08185DA0: .4byte 0x0203bd2c +_08185DA4: .4byte 0x02022fec +_08185DA8: .4byte 0x000004ec +_08185DAC: .4byte 0x02038bca +_08185DB0: .4byte 0x000004f4 +_08185DB4: .4byte 0x02038bcc +_08185DB8: .4byte 0x02038bce +_08185DBC: .4byte 0x0203c7b4 +_08185DC0: .4byte 0x0203c7ad +_08185DC4: .4byte 0x03005d90 +_08185DC8: .4byte 0x00000ca9 +_08185DCC: .4byte 0x0203c7ae +_08185DD0: .4byte 0x000004fd +_08185DD4: .4byte 0x0203c7af +_08185DD8: .4byte 0x0203c7b6 +_08185DDC: .4byte 0x000004ff +_08185DE0: .4byte 0x0203c7b7 +_08185DE4: .4byte 0x0203c7bc +_08185DE8: .4byte 0x0203ccd9 +_08185DEC: .4byte 0x0203ccda +_08185DF0: .4byte 0x03001278 +_08185DF4: .4byte 0x03001279 +_08185DF8: .4byte 0x0203ccd1 +_08185DFC: .4byte 0x00000504 +_08185E00: .4byte 0x0000050c +_08185E04: .4byte 0x0000050d +_08185E08: .4byte 0x0000051a +_08185E0C: .4byte 0x0000050e +_08185E10: .4byte 0x0203ccdc +_08185E14: .4byte 0x000004fc +_08185E18: .4byte 0x00000297 +_08185E1C: .4byte 0x0203bd34 +_08185E20: .4byte 0x0000051c + thumb_func_end sub_8185B60 + + thumb_func_start sub_8185E24 +sub_8185E24: @ 8185E24 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0xF8 + lsls r0, 4 + bl malloc_and_clear + adds r4, r0, 0 + bl start_ov_to_battle_anim + cmp r0, 0x1 + bne _08185E6E + bl sub_8185EB8 + adds r0, r4, 0 + bl sub_8185B60 + ldr r0, _08185E7C + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08185E80 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x80 + strh r0, [r1, 0x8] + ldr r0, _08185E84 + str r5, [r0] + movs r0, 0 + bl current_map_music_set__default_for_battle + ldr r0, _08185E88 + bl set_callback2 +_08185E6E: + adds r0, r4, 0 + bl free + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08185E7C: .4byte sub_8185B1C + 1 +_08185E80: .4byte 0x03005e00 +_08185E84: .4byte 0x0203c7b0 +_08185E88: .4byte sub_8185E8C + 1 + thumb_func_end sub_8185E24 + + thumb_func_start sub_8185E8C +sub_8185E8C: @ 8185E8C + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_8185E8C + + thumb_func_start sub_8185EA0 +sub_8185EA0: @ 8185EA0 + ldr r0, _08185EA8 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08185EA8: .4byte 0x0203c7ae + thumb_func_end sub_8185EA0 + + thumb_func_start sub_8185EAC +sub_8185EAC: @ 8185EAC + ldr r0, _08185EB4 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08185EB4: .4byte 0x0203c7af + thumb_func_end sub_8185EAC + + thumb_func_start sub_8185EB8 +sub_8185EB8: @ 8185EB8 + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08185EEC +_08185EBE: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + adds r0, r4, r6 + ldr r1, _08185EF0 + adds r1, r4, r1 + movs r2, 0x64 + bl memcpy + ldr r0, _08185EF4 + adds r0, r4, r0 + ldr r1, _08185EF8 + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x1 + cmp r5, 0x5 + ble _08185EBE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08185EEC: .4byte 0x0203c7c0 +_08185EF0: .4byte 0x020244ec +_08185EF4: .4byte 0x0203ca18 +_08185EF8: .4byte 0x02024744 + thumb_func_end sub_8185EB8 + + thumb_func_start sub_8185EFC +sub_8185EFC: @ 8185EFC + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08185F30 +_08185F02: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + adds r0, r4, r6 + ldr r1, _08185F34 + adds r1, r4, r1 + movs r2, 0x64 + bl memcpy + ldr r0, _08185F38 + adds r0, r4, r0 + ldr r1, _08185F3C + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x1 + cmp r5, 0x5 + ble _08185F02 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08185F30: .4byte 0x020244ec +_08185F34: .4byte 0x0203c7c0 +_08185F38: .4byte 0x02024744 +_08185F3C: .4byte 0x0203ca18 + thumb_func_end sub_8185EFC + + thumb_func_start sub_8185F40 +sub_8185F40: @ 8185F40 + push {r4,r5,lr} + movs r2, 0 + ldr r0, _08185F6C + ldr r3, _08185F70 + ldrh r1, [r0, 0x18] + adds r4, r0, 0 + ldrb r0, [r3] + cmp r1, r0 + beq _08185F64 + adds r1, r4, 0 +_08185F54: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + bgt _08185F64 + ldrh r0, [r1, 0x18] + ldrb r5, [r3] + cmp r0, r5 + bne _08185F54 +_08185F64: + cmp r2, 0x4 + bne _08185F74 + movs r0, 0 + b _08185F7E + .align 2, 0 +_08185F6C: .4byte 0x020229e8 +_08185F70: .4byte 0x02024064 +_08185F74: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x13] +_08185F7E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8185F40 + + thumb_func_start sub_8185F84 +sub_8185F84: @ 8185F84 + ldr r1, _08185F8C + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08185F8C: .4byte 0x0203c7b5 + thumb_func_end sub_8185F84 + + thumb_func_start sub_8185F90 +sub_8185F90: @ 8185F90 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08185FA8 + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + lsls r0, 16 + lsrs r0, 31 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + bx lr + .align 2, 0 +_08185FA8: .4byte 0x0203c7b5 + thumb_func_end sub_8185F90 + + thumb_func_start sub_8185FAC +sub_8185FAC: @ 8185FAC + ldr r0, _08185FB4 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08185FB4: .4byte 0x0203c7b5 + thumb_func_end sub_8185FAC + + thumb_func_start sub_8185FB8 +sub_8185FB8: @ 8185FB8 + ldr r0, _08185FC0 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08185FC0: .4byte 0x0203c7b6 + thumb_func_end sub_8185FB8 + + thumb_func_start sub_8185FC4 +sub_8185FC4: @ 8185FC4 + ldr r0, _08185FCC + ldrb r0, [r0] + bx lr + .align 2, 0 +_08185FCC: .4byte 0x0203c7b7 + thumb_func_end sub_8185FC4 + + thumb_func_start sub_8185FD0 +sub_8185FD0: @ 8185FD0 + push {r4-r7,lr} + ldr r4, _08186024 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0818601C + ldr r0, _08186028 + ldr r0, [r0] + ldr r1, _0818602C + ands r0, r1 + cmp r0, 0 + bne _0818601C + ldr r0, _08186030 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0818601C + movs r3, 0 + ldr r7, _08186034 + adds r6, r4, 0 + ldr r5, _08186038 + movs r4, 0x58 +_08186000: + lsls r2, r3, 1 + ldrb r1, [r6] + lsrs r0, r1, 1 + lsls r0, 3 + adds r0, r2, r0 + adds r0, r7 + muls r1, r4 + adds r2, r1 + adds r2, r5 + ldrh r1, [r2] + strh r1, [r0] + adds r3, 0x1 + cmp r3, 0x3 + ble _08186000 +_0818601C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08186024: .4byte 0x02024064 +_08186028: .4byte 0x02022fec +_0818602C: .4byte 0x02000002 +_08186030: .4byte 0x0203c7ac +_08186034: .4byte 0x0203cc70 +_08186038: .4byte 0x02024090 + thumb_func_end sub_8185FD0 + + thumb_func_start sub_818603C +sub_818603C: @ 818603C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + ldr r0, _08186064 + ldr r0, [r0] + ldr r1, _08186068 + ands r0, r1 + cmp r0, 0 + beq _0818605C + b _081863FC +_0818605C: + movs r0, 0 + mov r10, r0 + b _081863F2 + .align 2, 0 +_08186064: .4byte 0x02022fec +_08186068: .4byte 0x02000002 +_0818606C: + mov r1, r10 + lsls r4, r1, 24 + lsrs r5, r4, 24 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + str r4, [sp, 0x4C] + mov r2, r10 + adds r2, 0x1 + str r2, [sp, 0x38] + cmp r0, 0x1 + bne _0818608A + b _081863EE +_0818608A: + ldr r3, [sp, 0x24] + cmp r3, 0x1 + bne _0818611E + movs r5, 0 + ldr r4, _08186108 + mov r0, r10 + asrs r6, r0, 31 + subs r0, r6 + asrs r0, 1 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0x58 + mov r0, r10 + muls r0, r1 + ldr r3, _0818610C + adds r1, r0, r3 +_081860AA: + ldrh r0, [r1] + ldrh r4, [r2] + cmp r0, r4 + bne _081860BC + adds r2, 0x2 + adds r1, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081860AA +_081860BC: + cmp r5, 0x4 + bne _081860C2 + b _081863EE +_081860C2: + ldr r1, [sp, 0x4C] + lsrs r0, r1, 24 + movs r1, 0x6 + bl sub_8184FBC + movs r5, 0 + ldr r2, _08186108 + mov r8, r2 + movs r3, 0x58 + mov r7, r10 + muls r7, r3 + mov r4, r10 + subs r0, r4, r6 + asrs r4, r0, 1 +_081860DE: + movs r2, 0 + lsls r0, r5, 1 + adds r5, 0x1 + adds r0, r7 + ldr r1, _0818610C + adds r3, r0, r1 + lsls r0, r4, 3 + mov r6, r8 + adds r1, r0, r6 +_081860F0: + ldrh r0, [r3] + ldrh r6, [r1] + cmp r0, r6 + bne _08186110 + lsls r1, r2, 24 + lsrs r1, 24 + ldr r2, [sp, 0x4C] + lsrs r0, r2, 24 + bl sub_8184FBC + b _08186118 + .align 2, 0 +_08186108: .4byte 0x0203cc70 +_0818610C: .4byte 0x02024090 +_08186110: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _081860F0 +_08186118: + cmp r5, 0x3 + ble _081860DE + b _081863EE +_0818611E: + ldr r3, _0818640C + ldr r1, _08186410 + mov r4, r10 + lsls r2, r4, 1 + adds r1, r2, r1 + movs r0, 0xA6 + lsls r0, 2 + mov r6, r10 + muls r6, r0 + adds r0, r6, 0 + ldrh r1, [r1] + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + str r2, [sp, 0x44] + cmp r0, 0x6 + beq _08186142 + b _081863EE +_08186142: + adds r0, r5, 0 + bl sub_8185054 + movs r5, 0 + mov r0, sp + adds r0, 0x4 + str r0, [sp, 0x28] + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x30] + mov r2, sp + adds r2, 0x14 + str r2, [sp, 0x34] + mov r3, sp + adds r3, 0x18 + str r3, [sp, 0x3C] + mov r4, sp + adds r4, 0x8 + str r4, [sp, 0x2C] + mov r6, r10 + lsls r6, 3 + str r6, [sp, 0x48] + movs r1, 0x58 + mov r0, r10 + muls r0, r1 + ldr r2, _08186414 + adds r0, r2 + adds r6, r0, 0 + adds r6, 0x3B + movs r4, 0x3 +_0818617E: + mov r0, sp + adds r3, r0, r5 + ldrb r1, [r6] + lsls r2, r5, 1 + adds r0, r4, 0 + lsls r0, r2 + ands r1, r0 + asrs r1, r2 + strb r1, [r3] + adds r5, 0x1 + cmp r5, 0x3 + ble _0818617E + movs r5, 0 + ldr r1, _08186414 + mov r9, r1 + movs r2, 0x58 + mov r7, r10 + muls r7, r2 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x30] +_081861A6: + ldr r3, [sp, 0x4C] + lsrs r0, r3, 24 + bl sub_8185054 + strb r0, [r4] + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + movs r1, 0xC + add r1, r9 + mov r8, r1 + add r0, r8 + ldrh r0, [r0] + strh r0, [r6] + ldr r2, [sp, 0x34] + adds r1, r2, r5 + ldrb r0, [r4] + adds r0, r7 + ldr r3, _08186418 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x3C] + adds r1, r0, r5 + ldrb r0, [r4] + add r0, sp + ldrb r0, [r0] + strb r0, [r1] + ldr r1, [sp, 0x2C] + adds r3, r1, r5 + ldr r2, [sp, 0x48] + mov r1, r10 + subs r0, r2, r1 + lsls r0, 2 + ldr r2, _0818641C + adds r0, r2 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, _08186420 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + lsrs r1, r5 + strb r1, [r3] + adds r4, 0x1 + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081861A6 + movs r5, 0 + movs r3, 0xC + negs r3, r3 + add r3, r8 + mov r12, r3 + ldr r4, _0818641C + mov r9, r4 + movs r6, 0x58 + mov r1, r10 + muls r1, r6 + mov r0, r8 + adds r0, 0x18 + adds r4, r1, r0 + adds r3, r1, 0 + mov r7, r8 + ldr r6, [sp, 0x34] + ldr r2, [sp, 0x30] +_0818622C: + adds r1, r3, r7 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r6, r5 + ldrb r0, [r0] + strb r0, [r4] + adds r4, 0x1 + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0818622C + movs r0, 0x58 + mov r4, r10 + muls r4, r0 + mov r1, r12 + adds r0, r4, r1 + adds r0, 0x3B + movs r1, 0 + strb r1, [r0] + ldr r2, [sp, 0x48] + mov r6, r10 + subs r3, r2, r6 + lsls r3, 2 + mov r0, r9 + adds r2, r3, r0 + ldrb r1, [r2, 0x18] + movs r0, 0xF + ands r0, r1 + strb r0, [r2, 0x18] + movs r5, 0 + ldr r1, _08186414 + adds r4, r1 + adds r4, 0x3B + ldr r0, _0818641C + adds r6, r3, r0 +_08186274: + ldr r2, [sp, 0x3C] + adds r0, r2, r5 + ldrb r0, [r0] + lsls r1, r5, 1 + lsls r0, r1 + ldrb r1, [r4] + orrs r0, r1 + strb r0, [r4] + ldrb r2, [r6, 0x18] + lsrs r3, r2, 4 + ldr r1, [sp, 0x2C] + adds r0, r1, r5 + ldrb r1, [r0] + lsls r1, r5 + orrs r1, r3 + lsls r1, 4 + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x18] + adds r5, 0x1 + cmp r5, 0x3 + ble _08186274 + movs r2, 0x58 + mov r0, r10 + muls r0, r2 + mov r1, r12 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _081862BC + b _081863CA +_081862BC: + movs r5, 0 + mov r3, sp + adds r3, 0x20 + str r3, [sp, 0x40] + ldr r0, _08186424 + ldr r4, [sp, 0x44] + adds r6, r4, r0 +_081862CA: + ldrh r1, [r6] + movs r0, 0x64 + muls r0, r1 + ldr r4, _08186428 + adds r0, r4 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + mov r1, sp + adds r3, r1, r5 + lsls r2, r5, 1 + movs r1, 0x3 + lsls r1, r2 + ands r0, r1 + lsrs r0, r2 + strb r0, [r3] + adds r5, 0x1 + cmp r5, 0x3 + ble _081862CA + movs r5, 0 + ldr r0, _08186424 + ldr r2, [sp, 0x44] + adds r7, r2, r0 + movs r3, 0x64 + mov r9, r3 + mov r8, r4 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x30] +_08186304: + ldrh r0, [r7] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + ldrb r1, [r4] + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + strh r0, [r6] + ldrh r0, [r7] + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + add r0, r8 + ldrb r1, [r4] + adds r1, 0x11 + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x34] + adds r1, r3, r5 + strb r0, [r1] + ldr r0, [sp, 0x3C] + adds r1, r0, r5 + ldrb r0, [r4] + add r0, sp + ldrb r0, [r0] + strb r0, [r1] + adds r4, 0x1 + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08186304 + movs r5, 0 + ldr r0, _08186424 + ldr r1, [sp, 0x44] + adds r7, r1, r0 + movs r2, 0x64 + mov r9, r2 + ldr r3, _08186428 + mov r8, r3 + ldr r6, [sp, 0x30] + adds r6, 0x8 + ldr r4, [sp, 0x30] +_08186360: + ldrh r0, [r7] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + adds r1, r5, 0 + adds r1, 0xD + adds r2, r4, 0 + bl pokemon_setattr + ldrh r0, [r7] + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + add r0, r8 + adds r1, r5, 0 + adds r1, 0x11 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08186360 + movs r0, 0 + ldr r3, [sp, 0x40] + strb r0, [r3] + movs r5, 0 + ldr r4, _08186424 + ldr r6, _08186428 + ldr r3, [sp, 0x3C] + ldr r2, [sp, 0x40] +_081863A2: + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r5, 1 + lsls r1, r0 + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + adds r5, 0x1 + cmp r5, 0x3 + ble _081863A2 + ldr r1, [sp, 0x44] + adds r0, r1, r4 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + adds r0, r6 + movs r1, 0x15 + ldr r2, [sp, 0x40] + bl pokemon_setattr +_081863CA: + ldr r2, _0818642C + ldr r3, [sp, 0x44] + adds r2, r3, r2 + ldr r0, _08186430 + ldr r0, [r0] + add r0, r10 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r4, 0x58 + mov r1, r10 + muls r1, r4 + adds r0, r1 + ldr r1, _08186414 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] +_081863EE: + ldr r6, [sp, 0x38] + mov r10, r6 +_081863F2: + ldr r0, _08186434 + ldrb r0, [r0] + cmp r10, r0 + bge _081863FC + b _0818606C +_081863FC: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818640C: .4byte 0x0203bd34 +_08186410: .4byte 0x0203c794 +_08186414: .4byte 0x02024084 +_08186418: .4byte 0x020240a8 +_0818641C: .4byte 0x020242bc +_08186420: .4byte 0x0832a328 +_08186424: .4byte 0x0202406e +_08186428: .4byte 0x020244ec +_0818642C: .4byte 0x02024274 +_08186430: .4byte 0x0202449c +_08186434: .4byte 0x0202406c + thumb_func_end sub_818603C + + thumb_func_start sub_8186438 +sub_8186438: @ 8186438 + ldr r0, _08186440 + ldr r0, [r0] + bx lr + .align 2, 0 +_08186440: .4byte 0x0203c7bc + thumb_func_end sub_8186438 + + thumb_func_start sub_8186444 +sub_8186444: @ 8186444 + ldr r1, _0818644C + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_0818644C: .4byte 0x0203ccd0 + thumb_func_end sub_8186444 + + thumb_func_start rfu_lacks_rfufunc +rfu_lacks_rfufunc: @ 8186450 + push {lr} + movs r1, 0 + ldr r0, _08186464 + ldrb r0, [r0] + cmp r0, 0 + bne _0818645E + movs r1, 0x1 +_0818645E: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_08186464: .4byte 0x0203ccd0 + thumb_func_end rfu_lacks_rfufunc + + thumb_func_start sub_8186468 +sub_8186468: @ 8186468 + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r5, _08186494 + ldr r4, _08186498 +_08186472: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08186472 + movs r0, 0xFF + strb r0, [r3, 0x7] + ldrb r1, [r5] + adds r0, r3, 0 + bl sub_8009308 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08186494: .4byte 0x03001278 +_08186498: .4byte 0x0203ccd1 + thumb_func_end sub_8186468 + + thumb_func_start sub_818649C +sub_818649C: @ 818649C + ldr r0, _081864A4 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081864A4: .4byte 0x0203ccd9 + thumb_func_end sub_818649C + + thumb_func_start sub_81864A8 +sub_81864A8: @ 81864A8 + ldr r0, _081864B0 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081864B0: .4byte 0x0203ccda + thumb_func_end sub_81864A8 + + thumb_func_start sub_81864B4 +sub_81864B4: @ 81864B4 + ldr r0, _081864BC + ldrb r0, [r0] + bx lr + .align 2, 0 +_081864BC: .4byte 0x03001278 + thumb_func_end sub_81864B4 + + thumb_func_start sub_81864C0 +sub_81864C0: @ 81864C0 + ldr r0, _081864C8 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081864C8: .4byte 0x03001279 + thumb_func_end sub_81864C0 + + thumb_func_start sub_81864CC +sub_81864CC: @ 81864CC + ldr r0, _081864D8 + ldr r1, _081864DC + ldrb r1, [r1] + strb r1, [r0] + bx lr + .align 2, 0 +_081864D8: .4byte 0x0203cce8 +_081864DC: .4byte 0x0202433a + thumb_func_end sub_81864CC + + thumb_func_start sub_81864E0 +sub_81864E0: @ 81864E0 + ldr r0, _081864E4 + bx lr + .align 2, 0 +_081864E4: .4byte 0x0203ccdc + thumb_func_end sub_81864E0 + + thumb_func_start nullsub_70 +nullsub_70: @ 81864E8 + bx lr + thumb_func_end nullsub_70 + + thumb_func_start sub_81864EC +sub_81864EC: @ 81864EC + ldr r1, _081864FC + ldr r0, _08186500 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08186504 + str r1, [r0] + bx lr + .align 2, 0 +_081864FC: .4byte 0x03005d60 +_08186500: .4byte 0x02024064 +_08186504: .4byte sub_8186508 + 1 + thumb_func_end sub_81864EC + + thumb_func_start sub_8186508 +sub_8186508: @ 8186508 + push {lr} + ldr r2, _0818653C + ldr r1, _08186540 + ldr r0, _08186544 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08186554 + ldr r0, _08186548 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _08186550 + ldr r0, _0818654C + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08186554 + .align 2, 0 +_0818653C: .4byte 0x02024068 +_08186540: .4byte 0x0832a328 +_08186544: .4byte 0x02024064 +_08186548: .4byte 0x02023064 +_0818654C: .4byte 0x0860ae90 +_08186550: + bl sub_81871AC +_08186554: + pop {r0} + bx r0 + thumb_func_end sub_8186508 + + thumb_func_start sub_8186558 +sub_8186558: @ 8186558 + push {lr} + ldr r2, _08186580 + ldr r1, _08186584 + ldr r0, _08186588 + 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, _0818658C + cmp r1, r0 + bne _0818657C + bl sub_81871AC +_0818657C: + pop {r0} + bx r0 + .align 2, 0 +_08186580: .4byte 0x02020630 +_08186584: .4byte 0x020241e4 +_08186588: .4byte 0x02024064 +_0818658C: .4byte nullsub_12 + 1 + thumb_func_end sub_8186558 + + thumb_func_start sub_8186590 +sub_8186590: @ 8186590 + push {lr} + ldr r2, _081865B8 + ldr r1, _081865BC + ldr r0, _081865C0 + 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, _081865C4 + cmp r1, r0 + bne _081865B4 + bl sub_81871AC +_081865B4: + pop {r0} + bx r0 + .align 2, 0 +_081865B8: .4byte 0x02020630 +_081865BC: .4byte 0x020241e4 +_081865C0: .4byte 0x02024064 +_081865C4: .4byte nullsub_12 + 1 + thumb_func_end sub_8186590 + + thumb_func_start sub_81865C8 +sub_81865C8: @ 81865C8 + push {r4-r6,lr} + ldr r5, _08186620 + ldr r6, _08186624 + ldr r4, _08186628 + 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, _0818662C + cmp r1, r0 + bne _0818661A + 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 obj_delete_and_free_tiles + bl sub_81871AC +_0818661A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08186620: .4byte 0x02020630 +_08186624: .4byte 0x020241e4 +_08186628: .4byte 0x02024064 +_0818662C: .4byte nullsub_12 + 1 + thumb_func_end sub_81865C8 + + thumb_func_start sub_8186630 +sub_8186630: @ 8186630 + push {r4,lr} + ldr r4, _08186670 + ldr r1, [r4] + ldr r3, _08186674 + 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 _08186668 + 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_81871AC +_08186668: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08186670: .4byte 0x020244d0 +_08186674: .4byte 0x02024064 + thumb_func_end sub_8186630 + + thumb_func_start sub_8186678 +sub_8186678: @ 8186678 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081866A4 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081866F8 + ldr r0, _081866E0 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081866F8 +_081866A4: + ldr r4, _081866E4 + ldr r0, _081866E8 + ldr r2, _081866EC + ldrb r3, [r2] + adds r0, r3, r0 + 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, [r0] + ldr r0, _081866F0 + mov r8, r2 + cmp r1, r0 + bne _08186764 + ldr r0, _081866F4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08186764 + b _0818676A + .align 2, 0 +_081866E0: .4byte 0x02022fec +_081866E4: .4byte 0x02020630 +_081866E8: .4byte 0x03005d70 +_081866EC: .4byte 0x02024064 +_081866F0: .4byte nullsub_12 + 1 +_081866F4: .4byte 0x020241e4 +_081866F8: + ldr r6, _08186848 + ldr r7, _0818684C + ldr r2, _08186850 + ldrb r3, [r2] + adds r0, r3, r7 + 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, [r0] + ldr r0, _08186854 + mov r8, r2 + cmp r4, r0 + bne _08186764 + movs r0, 0x2 + adds r2, r3, 0 + eors r2, r0 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r4 + bne _08186764 + ldr r4, _08186858 + adds r0, r3, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08186764 + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08186764 + movs r1, 0x1 + mov r9, r1 +_08186764: + mov r2, r9 + cmp r2, 0 + beq _0818683A +_0818676A: + mov r6, r8 + ldrb r0, [r6] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bne _08186816 + ldr r0, _0818685C + mov r12, r0 + ldr r0, [r0] + ldrb r2, [r6] + ldr r5, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r5 + ldrb r1, [r4, 0x1] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0818683A + movs r7, 0x2 + adds r1, r7, 0 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0818683A + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r12 + ldr r0, [r1] + 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, r12 + ldr r2, [r0] + ldrb r0, [r6] + adds r1, r7, 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, [r6] + adds r1, r7, 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, _08186860 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag +_08186816: + ldr r0, _0818685C + ldr r0, [r0] + mov r2, r8 + 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, _08186864 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _08186868 + str r1, [r0] +_0818683A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08186848: .4byte 0x02020630 +_0818684C: .4byte 0x03005d70 +_08186850: .4byte 0x02024064 +_08186854: .4byte nullsub_12 + 1 +_08186858: .4byte 0x020241e4 +_0818685C: .4byte 0x020244d0 +_08186860: .4byte 0x000027f9 +_08186864: .4byte 0x03005d60 +_08186868: .4byte sub_8186630 + 1 + thumb_func_end sub_8186678 + + thumb_func_start sub_818686C +sub_818686C: @ 818686C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + mov r8, r0 + ldr r4, _08186A24 + ldr r0, [r4] + ldr r7, _08186A28 + 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 _081868AC + ldr r0, _08186A2C + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08186A30 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081868AC: + 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 _081868DE + ldr r0, _08186A2C + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08186A30 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081868DE: + 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 _081869AE + 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 _081869AE + ldrb r1, [r4, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08186994 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08186964 + ldr r0, _08186A34 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186964 + ldr r4, _08186A38 + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _08186A2C + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08186A30 + 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 +_08186964: + ldr r5, _08186A38 + ldr r4, _08186A28 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _08186A2C + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08186A30 + 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 +_08186994: + ldr r0, _08186A24 + ldr r2, [r0] + ldr r0, _08186A28 + 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] +_081869AE: + ldr r5, _08186A24 + ldr r0, [r5] + ldr r4, _08186A28 + 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 _08186A6A + 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 _08186A6A + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08186A6A + ldr r0, [r5] + ldrb r2, [r4] + 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 _08186A4C + ldr r0, _08186A34 + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08186A40 + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08186A4C + ldr r0, _08186A3C + bl m4aMPlayContinue + b _08186A4C + .align 2, 0 +_08186A24: .4byte 0x020244d0 +_08186A28: .4byte 0x02024064 +_08186A2C: .4byte 0x0202406e +_08186A30: .4byte 0x02024744 +_08186A34: .4byte 0x02022fec +_08186A38: .4byte 0x03005d70 +_08186A3C: .4byte 0x03007420 +_08186A40: + ldr r0, _08186AA8 + ldr r1, _08186AAC + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08186A4C: + ldr r0, _08186AB0 + ldr r2, [r0] + ldr r0, _08186AB4 + 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 +_08186A6A: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08186AC8 + ldr r2, _08186AB8 + ldr r0, _08186ABC + ldr r1, _08186AB4 + 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, _08186AC0 + cmp r3, r0 + bne _08186B26 + ldr r0, _08186AC4 + 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 _08186B26 + b _08186B22 + .align 2, 0 +_08186AA8: .4byte 0x03007420 +_08186AAC: .4byte 0x0000ffff +_08186AB0: .4byte 0x020244d0 +_08186AB4: .4byte 0x02024064 +_08186AB8: .4byte 0x02020630 +_08186ABC: .4byte 0x03005d7c +_08186AC0: .4byte nullsub_12 + 1 +_08186AC4: .4byte 0x020241e4 +_08186AC8: + ldr r2, _08186C1C + ldr r7, _08186C20 + ldr r0, _08186C24 + 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, _08186C28 + cmp r4, r0 + bne _08186B26 + ldr r6, _08186C2C + 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 _08186B26 + 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 _08186B26 + 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 _08186B26 +_08186B22: + movs r0, 0x1 + mov r8, r0 +_08186B26: + mov r0, r9 + cmp r0, 0 + beq _08186C10 + mov r0, r8 + cmp r0, 0 + beq _08186C10 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08186B8A + ldr r0, _08186C30 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186B8A + ldr r1, _08186C20 + ldr r5, _08186C24 + 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, _08186C1C + adds r0, r1 + bl obj_delete_and_free_tiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, _08186C34 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08186C38 + 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 +_08186B8A: + ldr r1, _08186C20 + ldr r4, _08186C24 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _08186C1C + adds r0, r1 + bl obj_delete_and_free_tiles + ldrb r5, [r4] + ldr r1, _08186C34 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08186C38 + 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, _08186C3C + 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, _08186C40 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08186C44 + str r1, [r0] +_08186C10: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08186C1C: .4byte 0x02020630 +_08186C20: .4byte 0x03005d7c +_08186C24: .4byte 0x02024064 +_08186C28: .4byte nullsub_12 + 1 +_08186C2C: .4byte 0x020241e4 +_08186C30: .4byte 0x02022fec +_08186C34: .4byte 0x0202406e +_08186C38: .4byte 0x02024744 +_08186C3C: .4byte 0x020244d0 +_08186C40: .4byte 0x03005d60 +_08186C44: .4byte sub_8186678 + 1 + thumb_func_end sub_818686C + + thumb_func_start sub_8186C48 +sub_8186C48: @ 8186C48 + push {r4-r7,lr} + ldr r4, _08186CA4 + ldr r0, _08186CA8 + ldr r7, _08186CAC + 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, _08186CB0 + cmp r1, r0 + bne _08186CFA + adds r0, r2, r4 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08186CFA + ldr r6, _08186CB4 + 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 _08186CC0 + ldr r0, _08186CB8 + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08186CBC + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 + b _08186CFA + .align 2, 0 +_08186CA4: .4byte 0x02020630 +_08186CA8: .4byte 0x020241e4 +_08186CAC: .4byte 0x02024064 +_08186CB0: .4byte nullsub_12 + 1 +_08186CB4: .4byte 0x020244d0 +_08186CB8: .4byte 0x0202406e +_08186CBC: .4byte 0x02024744 +_08186CC0: + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08186CFA + 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, _08186D00 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + bl sub_81871AC +_08186CFA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08186D00: .4byte 0x000027f9 + thumb_func_end sub_8186C48 + + thumb_func_start sub_8186D04 +sub_8186D04: @ 8186D04 + push {r4-r6,lr} + ldr r6, _08186D44 + ldrb r0, [r6] + ldr r5, _08186D48 + 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 _08186D4C + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08186D50 + .align 2, 0 +_08186D44: .4byte 0x02024064 +_08186D48: .4byte 0x03005d70 +_08186D4C: + bl sub_81871AC +_08186D50: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8186D04 + + thumb_func_start sub_8186D58 +sub_8186D58: @ 8186D58 + push {lr} + ldr r2, _08186D8C + ldr r0, _08186D90 + ldr r1, _08186D94 + 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 _08186D86 + ldr r0, _08186D98 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl sub_81871AC +_08186D86: + pop {r0} + bx r0 + .align 2, 0 +_08186D8C: .4byte 0x02020630 +_08186D90: .4byte 0x020241e4 +_08186D94: .4byte 0x02024064 +_08186D98: .4byte 0x03005d70 + thumb_func_end sub_8186D58 + + thumb_func_start sub_8186D9C +sub_8186D9C: @ 8186D9C + push {r4-r6,lr} + ldr r0, _08186DFC + ldr r0, [r0] + ldr r6, _08186E00 + 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 _08186DF6 + ldr r5, _08186E04 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08186E08 + 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 obj_delete_and_free_tiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, _08186E0C + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_81871AC +_08186DF6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08186DFC: .4byte 0x020244d0 +_08186E00: .4byte 0x02024064 +_08186E04: .4byte 0x020241e4 +_08186E08: .4byte 0x02020630 +_08186E0C: .4byte 0x03005d70 + thumb_func_end sub_8186D9C + + thumb_func_start sub_8186E10 +sub_8186E10: @ 8186E10 + push {lr} + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _08186E22 + bl sub_81871AC +_08186E22: + pop {r0} + bx r0 + thumb_func_end sub_8186E10 + + thumb_func_start bx_blink_t2 +bx_blink_t2: @ 8186E28 + push {r4,lr} + ldr r1, _08186E64 + ldr r0, _08186E68 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _08186E6C + 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 _08186E74 + 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, _08186E70 + strb r3, [r0] + bl sub_81871AC + b _08186E9E + .align 2, 0 +_08186E64: .4byte 0x020241e4 +_08186E68: .4byte 0x02024064 +_08186E6C: .4byte 0x02020630 +_08186E70: .4byte 0x020244b9 +_08186E74: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08186E98 + 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] +_08186E98: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08186E9E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t2 + + thumb_func_start sub_8186EA4 +sub_8186EA4: @ 8186EA4 + push {r4,lr} + ldr r2, _08186EF8 + ldr r0, _08186EFC + ldr r4, _08186F00 + 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, _08186F04 + cmp r1, r0 + bne _08186EF0 + ldr r0, _08186F08 + 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 _08186EE4 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_08186EE4: + ldr r0, _08186F0C + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _08186F10 + str r0, [r1] +_08186EF0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08186EF8: .4byte 0x02020630 +_08186EFC: .4byte 0x03005d70 +_08186F00: .4byte 0x02024064 +_08186F04: .4byte nullsub_12 + 1 +_08186F08: .4byte 0x020244d0 +_08186F0C: .4byte 0x03005d60 +_08186F10: .4byte sub_8186F14 + 1 + thumb_func_end sub_8186EA4 + + thumb_func_start sub_8186F14 +sub_8186F14: @ 8186F14 + push {r4,lr} + ldr r0, _08186F74 + ldr r0, [r0] + ldr r4, _08186F78 + 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 _08186F6E + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08186F6E + ldr r2, _08186F7C + ldr r1, _08186F80 + 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, _08186F84 + cmp r1, r0 + beq _08186F5E + ldr r0, _08186F88 + cmp r1, r0 + bne _08186F6E +_08186F5E: + ldr r0, _08186F8C + ldr r1, _08186F90 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl sub_81871AC +_08186F6E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08186F74: .4byte 0x020244d0 +_08186F78: .4byte 0x02024064 +_08186F7C: .4byte 0x02020630 +_08186F80: .4byte 0x020241e4 +_08186F84: .4byte nullsub_12 + 1 +_08186F88: .4byte nullsub_18 + 1 +_08186F8C: .4byte 0x03007420 +_08186F90: .4byte 0x0000ffff + thumb_func_end sub_8186F14 + + thumb_func_start sub_8186F94 +sub_8186F94: @ 8186F94 + push {r4-r7,lr} + ldr r4, _08187058 + ldr r0, [r4] + ldr r5, _0818705C + 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 _08187050 + ldr r7, _08187060 + ldr r6, _08187064 + 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, _08187068 + cmp r1, r0 + bne _08187050 + 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, _0818706C + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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 obj_anim_image_start + ldr r4, _08187070 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _08187074 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08187078 + 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, _0818707C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08187080 + str r1, [r0] +_08187050: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08187058: .4byte 0x020244d0 +_0818705C: .4byte 0x02024064 +_08187060: .4byte 0x02020630 +_08187064: .4byte 0x020241e4 +_08187068: .4byte nullsub_12 + 1 +_0818706C: .4byte 0x000027f9 +_08187070: .4byte 0x03005d70 +_08187074: .4byte 0x0202406e +_08187078: .4byte 0x02024744 +_0818707C: .4byte 0x03005d60 +_08187080: .4byte sub_8186EA4 + 1 + thumb_func_end sub_8186F94 + + thumb_func_start sub_8187084 +sub_8187084: @ 8187084 + push {r4-r6,lr} + ldr r6, _08187128 + ldr r0, [r6] + ldr r5, _0818712C + 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 _081870B6 + ldr r0, _08187130 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08187134 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081870B6: + ldr r4, _08187138 + ldr r0, _0818713C + 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, _08187140 + cmp r1, r0 + bne _08187120 + 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 _08187120 + adds r0, r3, r4 + bl obj_delete_and_free_tiles + ldrb r4, [r5] + ldr r1, _08187130 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08187134 + 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, _08187144 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08187148 + str r1, [r0] +_08187120: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08187128: .4byte 0x020244d0 +_0818712C: .4byte 0x02024064 +_08187130: .4byte 0x0202406e +_08187134: .4byte 0x02024744 +_08187138: .4byte 0x02020630 +_0818713C: .4byte 0x03005d7c +_08187140: .4byte nullsub_12 + 1 +_08187144: .4byte 0x03005d60 +_08187148: .4byte sub_8186F94 + 1 + thumb_func_end sub_8187084 + + thumb_func_start sub_818714C +sub_818714C: @ 818714C + push {lr} + ldr r0, _08187174 + ldr r2, [r0] + ldr r0, _08187178 + 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 _0818716E + bl sub_81871AC +_0818716E: + pop {r0} + bx r0 + .align 2, 0 +_08187174: .4byte 0x020244d0 +_08187178: .4byte 0x02024064 + thumb_func_end sub_818714C + + thumb_func_start sub_818717C +sub_818717C: @ 818717C + push {lr} + ldr r0, _081871A4 + ldr r2, [r0] + ldr r0, _081871A8 + 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 _0818719E + bl sub_81871AC +_0818719E: + pop {r0} + bx r0 + .align 2, 0 +_081871A4: .4byte 0x020244d0 +_081871A8: .4byte 0x02024064 + thumb_func_end sub_818717C + + thumb_func_start sub_81871AC +sub_81871AC: @ 81871AC + push {r4,lr} + sub sp, 0x4 + ldr r1, _081871EC + ldr r4, _081871F0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081871F4 + str r1, [r0] + ldr r0, _081871F8 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08187200 + 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, _081871FC + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _08187212 + .align 2, 0 +_081871EC: .4byte 0x03005d60 +_081871F0: .4byte 0x02024064 +_081871F4: .4byte sub_8186508 + 1 +_081871F8: .4byte 0x02022fec +_081871FC: .4byte 0x02023064 +_08187200: + ldr r2, _0818721C + ldr r1, _08187220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_08187212: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818721C: .4byte 0x02024068 +_08187220: .4byte 0x0832a328 + thumb_func_end sub_81871AC + + thumb_func_start sub_8187224 +sub_8187224: @ 8187224 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, _08187250 + ldr r0, _08187254 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818725C + ldr r0, _08187258 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8187298 + adds r6, r0, 0 + b _0818727E + .align 2, 0 +_08187250: .4byte 0x02023064 +_08187254: .4byte 0x02024064 +_08187258: .4byte 0x0202406e +_0818725C: + ldrb r4, [r1] + movs r5, 0 +_08187260: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08187276 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_8187298 + adds r6, r0 +_08187276: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08187260 +_0818727E: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl sub_81871AC + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8187224 + + thumb_func_start sub_8187298 +sub_8187298: @ 8187298 + 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, _081872CC + ldr r3, _081872D0 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _081872C2 + bl _08187A2E +_081872C2: + lsls r0, 2 + ldr r1, _081872D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081872CC: .4byte 0x02023064 +_081872D0: .4byte 0x02024064 +_081872D4: .4byte _081872D8 + .align 2, 0 +_081872D8: + .4byte _081873C8 + .4byte _081875EC + .4byte _081875FC + .4byte _0818760C + .4byte _08187674 + .4byte _08187674 + .4byte _08187674 + .4byte _08187674 + .4byte _08187690 + .4byte _081876CC + .4byte _081876CC + .4byte _081876CC + .4byte _081876CC + .4byte _08187A2E + .4byte _08187A2E + .4byte _08187A2E + .4byte _08187A2E + .4byte _081876E8 + .4byte _081876F8 + .4byte _08187728 + .4byte _08187738 + .4byte _08187748 + .4byte _08187758 + .4byte _08187768 + .4byte _08187778 + .4byte _08187788 + .4byte _08187798 + .4byte _081877A8 + .4byte _081877B8 + .4byte _081877C8 + .4byte _081877D8 + .4byte _081877E8 + .4byte _08187838 + .4byte _08187848 + .4byte _08187858 + .4byte _08187868 + .4byte _08187878 + .4byte _08187888 + .4byte _08187898 + .4byte _081878A8 + .4byte _081878B8 + .4byte _081878EC + .4byte _081878FC + .4byte _0818790C + .4byte _0818791C + .4byte _0818792C + .4byte _0818793C + .4byte _0818794C + .4byte _0818795C + .4byte _0818797C + .4byte _0818798C + .4byte _0818799C + .4byte _081879AC + .4byte _081879BC + .4byte _081879CC + .4byte _081879DC + .4byte _081879EC + .4byte _081879FC + .4byte _08187A0C + .4byte _08187A1C +_081873C8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081875DC + 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 +_08187414: + 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 _08187414 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081875DC + 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, _081875E0 + 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, _081875E4 + 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, _081875E8 + 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 strcpy_limit_10_chars + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_081875CC: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _081875CC + b _08187A2E + .align 2, 0 +_081875DC: .4byte 0x02024744 +_081875E0: .4byte 0xfffffc1f +_081875E4: .4byte 0xfff07fff +_081875E8: .4byte 0xfffffe0f +_081875EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081875F8 + adds r0, r1 + movs r1, 0xB + b _08187966 + .align 2, 0 +_081875F8: .4byte 0x02024744 +_081875FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187608 + adds r0, r1 + movs r1, 0xC + b _08187966 + .align 2, 0 +_08187608: .4byte 0x02024744 +_0818760C: + 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, _08187670 + adds r4, r1, r0 + mov r8, r9 +_08187622: + 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 _08187622 + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187670 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_08187660: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _08187660 + b _08187A2E + .align 2, 0 +_08187670: .4byte 0x02024744 +_08187674: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818768C + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _08187966 + .align 2, 0 +_0818768C: .4byte 0x02024744 +_08187690: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _081876C8 + mov r8, r2 +_0818769C: + 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 _0818769C + movs r0, 0x64 + muls r0, r5 + ldr r1, _081876C8 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _08187A2E + .align 2, 0 +_081876C8: .4byte 0x02024744 +_081876CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081876E4 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _08187A26 + .align 2, 0 +_081876E4: .4byte 0x02024744 +_081876E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081876F4 + adds r0, r1 + movs r1, 0x1 + b _08187702 + .align 2, 0 +_081876F4: .4byte 0x02024744 +_081876F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187724 + adds r0, r1 + movs r1, 0x19 +_08187702: + 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 _08187A2E + .align 2, 0 +_08187724: .4byte 0x02024744 +_08187728: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187734 + adds r0, r1 + movs r1, 0x1A + b _08187A26 + .align 2, 0 +_08187734: .4byte 0x02024744 +_08187738: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187744 + adds r0, r1 + movs r1, 0x1B + b _08187A26 + .align 2, 0 +_08187744: .4byte 0x02024744 +_08187748: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187754 + adds r0, r1 + movs r1, 0x1C + b _08187A26 + .align 2, 0 +_08187754: .4byte 0x02024744 +_08187758: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187764 + adds r0, r1 + movs r1, 0x1D + b _08187A26 + .align 2, 0 +_08187764: .4byte 0x02024744 +_08187768: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187774 + adds r0, r1 + movs r1, 0x1E + b _08187A26 + .align 2, 0 +_08187774: .4byte 0x02024744 +_08187778: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187784 + adds r0, r1 + movs r1, 0x1F + b _08187A26 + .align 2, 0 +_08187784: .4byte 0x02024744 +_08187788: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187794 + adds r0, r1 + movs r1, 0x20 + b _08187A26 + .align 2, 0 +_08187794: .4byte 0x02024744 +_08187798: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081877A4 + adds r0, r1 + movs r1, 0x22 + b _08187A26 + .align 2, 0 +_081877A4: .4byte 0x02024744 +_081877A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081877B4 + adds r0, r1 + movs r1, 0x23 + b _08187A26 + .align 2, 0 +_081877B4: .4byte 0x02024744 +_081877B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081877C4 + adds r0, r1 + movs r1, 0x24 + b _08187A26 + .align 2, 0 +_081877C4: .4byte 0x02024744 +_081877C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081877D4 + adds r0, r1 + movs r1, 0x25 + b _08187A26 + .align 2, 0 +_081877D4: .4byte 0x02024744 +_081877D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081877E4 + adds r0, r1 + movs r1, 0x26 + b _08187A26 + .align 2, 0 +_081877E4: .4byte 0x02024744 +_081877E8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08187834 + 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 _08187A2E + .align 2, 0 +_08187834: .4byte 0x02024744 +_08187838: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187844 + adds r0, r1 + movs r1, 0x27 + b _08187A26 + .align 2, 0 +_08187844: .4byte 0x02024744 +_08187848: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187854 + adds r0, r1 + movs r1, 0x28 + b _08187A26 + .align 2, 0 +_08187854: .4byte 0x02024744 +_08187858: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187864 + adds r0, r1 + movs r1, 0x29 + b _08187A26 + .align 2, 0 +_08187864: .4byte 0x02024744 +_08187868: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187874 + adds r0, r1 + movs r1, 0x2A + b _08187A26 + .align 2, 0 +_08187874: .4byte 0x02024744 +_08187878: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187884 + adds r0, r1 + movs r1, 0x2B + b _08187A26 + .align 2, 0 +_08187884: .4byte 0x02024744 +_08187888: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187894 + adds r0, r1 + movs r1, 0x2C + b _08187A26 + .align 2, 0 +_08187894: .4byte 0x02024744 +_08187898: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081878A4 + adds r0, r1 + movs r1, 0 + b _081878C2 + .align 2, 0 +_081878A4: .4byte 0x02024744 +_081878A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081878B4 + adds r0, r1 + movs r1, 0x9 + b _08187966 + .align 2, 0 +_081878B4: .4byte 0x02024744 +_081878B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081878E8 + adds r0, r1 + movs r1, 0x37 +_081878C2: + 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 _08187A2E + .align 2, 0 +_081878E8: .4byte 0x02024744 +_081878EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081878F8 + adds r0, r1 + movs r1, 0x38 + b _08187A26 + .align 2, 0 +_081878F8: .4byte 0x02024744 +_081878FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187908 + adds r0, r1 + movs r1, 0x39 + b _08187966 + .align 2, 0 +_08187908: .4byte 0x02024744 +_0818790C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187918 + adds r0, r1 + movs r1, 0x3A + b _08187966 + .align 2, 0 +_08187918: .4byte 0x02024744 +_0818791C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187928 + adds r0, r1 + movs r1, 0x3B + b _08187966 + .align 2, 0 +_08187928: .4byte 0x02024744 +_0818792C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187938 + adds r0, r1 + movs r1, 0x3C + b _08187966 + .align 2, 0 +_08187938: .4byte 0x02024744 +_0818793C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187948 + adds r0, r1 + movs r1, 0x3D + b _08187966 + .align 2, 0 +_08187948: .4byte 0x02024744 +_0818794C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187958 + adds r0, r1 + movs r1, 0x3E + b _08187966 + .align 2, 0 +_08187958: .4byte 0x02024744 +_0818795C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187978 + adds r0, r1 + movs r1, 0x3F +_08187966: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _08187A2E + .align 2, 0 +_08187978: .4byte 0x02024744 +_0818797C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187988 + adds r0, r1 + movs r1, 0x16 + b _08187A26 + .align 2, 0 +_08187988: .4byte 0x02024744 +_0818798C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187998 + adds r0, r1 + movs r1, 0x17 + b _08187A26 + .align 2, 0 +_08187998: .4byte 0x02024744 +_0818799C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081879A8 + adds r0, r1 + movs r1, 0x18 + b _08187A26 + .align 2, 0 +_081879A8: .4byte 0x02024744 +_081879AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081879B8 + adds r0, r1 + movs r1, 0x21 + b _08187A26 + .align 2, 0 +_081879B8: .4byte 0x02024744 +_081879BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081879C8 + adds r0, r1 + movs r1, 0x2F + b _08187A26 + .align 2, 0 +_081879C8: .4byte 0x02024744 +_081879CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081879D8 + adds r0, r1 + movs r1, 0x30 + b _08187A26 + .align 2, 0 +_081879D8: .4byte 0x02024744 +_081879DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081879E8 + adds r0, r1 + movs r1, 0x32 + b _08187A26 + .align 2, 0 +_081879E8: .4byte 0x02024744 +_081879EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081879F8 + adds r0, r1 + movs r1, 0x33 + b _08187A26 + .align 2, 0 +_081879F8: .4byte 0x02024744 +_081879FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187A08 + adds r0, r1 + movs r1, 0x34 + b _08187A26 + .align 2, 0 +_08187A08: .4byte 0x02024744 +_08187A0C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187A18 + adds r0, r1 + movs r1, 0x35 + b _08187A26 + .align 2, 0 +_08187A18: .4byte 0x02024744 +_08187A1C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187A40 + adds r0, r1 + movs r1, 0x36 +_08187A26: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_08187A2E: + 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 + .align 2, 0 +_08187A40: .4byte 0x02024744 + thumb_func_end sub_8187298 + + thumb_func_start sub_8187A44 +sub_8187A44: @ 8187A44 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8187A44 + + thumb_func_start sub_8187A50 +sub_8187A50: @ 8187A50 + push {r4,r5,lr} + ldr r1, _08187A74 + ldr r0, _08187A78 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08187A80 + ldr r0, _08187A7C + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl dp01_setattr_for_opponent_pokemon + b _08187A9E + .align 2, 0 +_08187A74: .4byte 0x02023064 +_08187A78: .4byte 0x02024064 +_08187A7C: .4byte 0x0202406e +_08187A80: + ldrb r4, [r1] + movs r5, 0 +_08187A84: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08187A92 + adds r0, r5, 0 + bl dp01_setattr_for_opponent_pokemon +_08187A92: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08187A84 +_08187A9E: + bl sub_81871AC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8187A50 + + thumb_func_start dp01_setattr_for_opponent_pokemon +dp01_setattr_for_opponent_pokemon: @ 8187AA8 + 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, _08187AE0 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, _08187AE4 + 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 _08187AD6 + bl _081883B4 +_08187AD6: + lsls r0, 2 + ldr r1, _08187AE8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08187AE0: .4byte 0x02024064 +_08187AE4: .4byte 0x02023067 +_08187AE8: .4byte _08187AEC + .align 2, 0 +_08187AEC: + .4byte _08187BDC + .4byte _08187D74 + .4byte _08187D90 + .4byte _08187DAC + .4byte _08187E00 + .4byte _08187E00 + .4byte _08187E00 + .4byte _08187E00 + .4byte _08187E20 + .4byte _08187E88 + .4byte _08187E88 + .4byte _08187E88 + .4byte _08187E88 + .4byte _081883B4 + .4byte _081883B4 + .4byte _081883B4 + .4byte _081883B4 + .4byte _08187EB0 + .4byte _08187ECC + .4byte _08187EE8 + .4byte _08187F04 + .4byte _08187F20 + .4byte _08187F3C + .4byte _08187F58 + .4byte _08187F74 + .4byte _08187F90 + .4byte _08187FAC + .4byte _08187FC8 + .4byte _08187FE4 + .4byte _08188000 + .4byte _0818801C + .4byte _08188038 + .4byte _081880AC + .4byte _081880C8 + .4byte _081880E4 + .4byte _08188100 + .4byte _0818811C + .4byte _08188138 + .4byte _08188154 + .4byte _08188170 + .4byte _0818818C + .4byte _081881A8 + .4byte _081881C4 + .4byte _081881E0 + .4byte _081881FC + .4byte _08188218 + .4byte _08188234 + .4byte _08188250 + .4byte _0818826C + .4byte _08188288 + .4byte _081882A4 + .4byte _081882C0 + .4byte _081882DC + .4byte _081882F8 + .4byte _08188314 + .4byte _08188330 + .4byte _0818834C + .4byte _08188368 + .4byte _08188384 + .4byte _081883A0 +_08187BDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08187D70 + 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 +_08187C42: + 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 _08187C42 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08187D70 + 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 _081883B4 + .align 2, 0 +_08187D70: .4byte 0x02024744 +_08187D74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187D8C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187D8C: .4byte 0x02024744 +_08187D90: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187DA8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187DA8: .4byte 0x02024744 +_08187DAC: + 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, _08187DFC + adds r7, r1, r0 + adds r6, r4, 0 + adds r6, 0x8 +_08187DC4: + 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 _08187DC4 + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187DFC + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187DFC: .4byte 0x02024744 +_08187E00: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187E18 + adds r0, r1 + ldr r3, _08187E1C + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08187E9E + .align 2, 0 +_08187E18: .4byte 0x02024744 +_08187E1C: .4byte 0x02023064 +_08187E20: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _08187E84 + 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 _081883B4 + .align 2, 0 +_08187E84: .4byte 0x02024744 +_08187E88: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187EA8 + adds r0, r1 + ldr r3, _08187EAC + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_08187E9E: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187EA8: .4byte 0x02024744 +_08187EAC: .4byte 0x02023064 +_08187EB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187EC8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187EC8: .4byte 0x02024744 +_08187ECC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187EE4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187EE4: .4byte 0x02024744 +_08187EE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187F00 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187F00: .4byte 0x02024744 +_08187F04: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187F1C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187F1C: .4byte 0x02024744 +_08187F20: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187F38 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187F38: .4byte 0x02024744 +_08187F3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187F54 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187F54: .4byte 0x02024744 +_08187F58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187F70 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187F70: .4byte 0x02024744 +_08187F74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187F8C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187F8C: .4byte 0x02024744 +_08187F90: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187FA8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187FA8: .4byte 0x02024744 +_08187FAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187FC4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187FC4: .4byte 0x02024744 +_08187FC8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187FE0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187FE0: .4byte 0x02024744 +_08187FE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08187FFC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08187FFC: .4byte 0x02024744 +_08188000: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188018 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188018: .4byte 0x02024744 +_0818801C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188034 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188034: .4byte 0x02024744 +_08188038: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081880A8 + 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 _08188146 + .align 2, 0 +_081880A8: .4byte 0x02024744 +_081880AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081880C4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081880C4: .4byte 0x02024744 +_081880C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081880E0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081880E0: .4byte 0x02024744 +_081880E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081880FC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081880FC: .4byte 0x02024744 +_08188100: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188118 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188118: .4byte 0x02024744 +_0818811C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188134 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188134: .4byte 0x02024744 +_08188138: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188150 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08188146: + movs r1, 0x2C + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188150: .4byte 0x02024744 +_08188154: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818816C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_0818816C: .4byte 0x02024744 +_08188170: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188188 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188188: .4byte 0x02024744 +_0818818C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081881A4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081881A4: .4byte 0x02024744 +_081881A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081881C0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081881C0: .4byte 0x02024744 +_081881C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081881DC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081881DC: .4byte 0x02024744 +_081881E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081881F8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081881F8: .4byte 0x02024744 +_081881FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188214 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188214: .4byte 0x02024744 +_08188218: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188230 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188230: .4byte 0x02024744 +_08188234: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818824C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_0818824C: .4byte 0x02024744 +_08188250: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188268 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188268: .4byte 0x02024744 +_0818826C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188284 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188284: .4byte 0x02024744 +_08188288: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081882A0 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081882A0: .4byte 0x02024744 +_081882A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081882BC + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081882BC: .4byte 0x02024744 +_081882C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081882D8 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081882D8: .4byte 0x02024744 +_081882DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081882F4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_081882F4: .4byte 0x02024744 +_081882F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188310 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188310: .4byte 0x02024744 +_08188314: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818832C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_0818832C: .4byte 0x02024744 +_08188330: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188348 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188348: .4byte 0x02024744 +_0818834C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188364 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188364: .4byte 0x02024744 +_08188368: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08188380 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_08188380: .4byte 0x02024744 +_08188384: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818839C + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _081883B4 + .align 2, 0 +_0818839C: .4byte 0x02024744 +_081883A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081883C4 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl pokemon_setattr +_081883B4: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081883C4: .4byte 0x02024744 + thumb_func_end dp01_setattr_for_opponent_pokemon + + thumb_func_start sub_81883C8 +sub_81883C8: @ 81883C8 + push {r4-r7,lr} + ldr r1, _0818842C + ldr r7, _08188430 + 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, _08188434 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _08188438 + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _08188420 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_081883FE: + 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 _081883FE +_08188420: + bl sub_81871AC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818842C: .4byte 0x0202406e +_08188430: .4byte 0x02024064 +_08188434: .4byte 0x02023064 +_08188438: .4byte 0x02024744 + thumb_func_end sub_81883C8 + + thumb_func_start sub_818843C +sub_818843C: @ 818843C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, _08188564 + ldr r6, _08188568 + 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, _0818856C + 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, _08188570 + 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 obj_add_from_template_forward_search + ldr r4, _08188574 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, _08188578 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0818857C + 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, _08188580 + adds r2, r1 + ldrb r1, [r2] + bl obj_anim_image_start + 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, _08188584 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188588 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08188564: .4byte 0x0202406e +_08188568: .4byte 0x02024064 +_0818856C: .4byte 0x02024744 +_08188570: .4byte 0x0202499c +_08188574: .4byte 0x020241e4 +_08188578: .4byte 0x02020630 +_0818857C: .4byte 0x0000ff10 +_08188580: .4byte 0x020244e4 +_08188584: .4byte 0x03005d60 +_08188588: .4byte sub_8186C48 + 1 + thumb_func_end sub_818843C + + thumb_func_start sub_818858C +sub_818858C: @ 818858C + push {r4,lr} + ldr r1, _081885C4 + ldr r4, _081885C8 + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, _081885CC + 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_81885D8 + ldr r1, _081885D0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081885D4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081885C4: .4byte 0x0202406e +_081885C8: .4byte 0x02024064 +_081885CC: .4byte 0x02023064 +_081885D0: .4byte 0x03005d60 +_081885D4: .4byte sub_8187084 + 1 + thumb_func_end sub_818858C + + thumb_func_start sub_81885D8 +sub_81885D8: @ 81885D8 + 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, _08188740 + lsls r4, r6, 1 + adds r4, r0 + ldr r0, _08188744 + 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, _08188748 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0818874C + bl object_new_hidden_with_callback + ldr r1, _08188750 + 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, _08188754 + 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 obj_add_from_template_forward_search + ldr r4, _08188758 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _0818875C + 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, _08188760 + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _08188764 + 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 + .align 2, 0 +_08188740: .4byte 0x0202406e +_08188744: .4byte 0x02023064 +_08188748: .4byte 0x02024744 +_0818874C: .4byte sub_805D714 + 1 +_08188750: .4byte 0x03005d7c +_08188754: .4byte 0x0202499c +_08188758: .4byte 0x020241e4 +_0818875C: .4byte 0x02020630 +_08188760: .4byte 0x020244e4 +_08188764: .4byte nullsub_12 + 1 + thumb_func_end sub_81885D8 + + thumb_func_start sub_8188768 +sub_8188768: @ 8188768 + push {r4-r6,lr} + ldr r1, _0818879C + ldr r6, _081887A0 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _081887B0 + ldr r0, _081887A4 + 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, _081887A8 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _081887AC + str r1, [r0] + b _081887EC + .align 2, 0 +_0818879C: .4byte 0x02023064 +_081887A0: .4byte 0x02024064 +_081887A4: .4byte 0x020244d0 +_081887A8: .4byte 0x03005d60 +_081887AC: .4byte sub_8188800 + 1 +_081887B0: + ldr r5, _081887F4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081887F8 + 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 obj_delete_and_free_tiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, _081887FC + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_81871AC +_081887EC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081887F4: .4byte 0x020241e4 +_081887F8: .4byte 0x02020630 +_081887FC: .4byte 0x03005d70 + thumb_func_end sub_8188768 + + thumb_func_start sub_8188800 +sub_8188800: @ 8188800 + push {r4-r6,lr} + ldr r6, _08188820 + ldr r4, [r6] + ldr r5, _08188824 + 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 _08188828 + cmp r0, 0x1 + beq _08188856 + b _0818887E + .align 2, 0 +_08188820: .4byte 0x020244d0 +_08188824: .4byte 0x02024064 +_08188828: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08188842 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08188842: + 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 _0818887E +_08188856: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818887E + 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, _08188884 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188888 + str r1, [r0] +_0818887E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08188884: .4byte 0x03005d60 +_08188888: .4byte sub_8186D9C + 1 + thumb_func_end sub_8188800 + + thumb_func_start sub_818888C +sub_818888C: @ 818888C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r5, _081888CC + ldr r0, [r5] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081888F6 + ldr r4, _081888D0 + ldrb r0, [r4] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0xC8 + cmp r1, 0 + beq _081888B4 + movs r7, 0x98 +_081888B4: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _081888EC + ldrb r0, [r4] + cmp r0, 0x1 + bne _081888D8 + ldr r0, _081888D4 + b _081888DA + .align 2, 0 +_081888CC: .4byte 0x02022fec +_081888D0: .4byte 0x02024064 +_081888D4: .4byte 0x02038bca +_081888D8: + ldr r0, _081888E8 +_081888DA: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + b _0818892C + .align 2, 0 +_081888E8: .4byte 0x02038bcc +_081888EC: + bl sub_8185F40 + lsls r0, 24 + lsrs r0, 24 + b _08188924 +_081888F6: + movs r7, 0xB0 + ldr r0, _0818890C + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _08188910 + bl sub_8068B48 + b _08188928 + .align 2, 0 +_0818890C: .4byte 0x02038bca +_08188910: + ldr r2, _08188A10 + ldr r0, _08188A14 + ldrb r0, [r0] + movs r1, 0x1 + eors r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] +_08188924: + bl sub_806F000 +_08188928: + lsls r0, 16 + lsrs r0, 16 +_0818892C: + mov r8, r0 + ldr r5, _08188A18 + 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, _08188A1C + mov r9, r7 + ldr r1, _08188A20 + 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 obj_add_from_template_forward_search + ldr r6, _08188A24 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _08188A28 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08188A2C + 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, _08188A30 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl gpu_pal_tags_index_of + 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, _08188A34 + str r1, [r0] + ldr r1, _08188A38 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188A3C + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08188A10: .4byte 0x020229e8 +_08188A14: .4byte 0x0203c7b4 +_08188A18: .4byte 0x02024064 +_08188A1C: .4byte 0x0202499c +_08188A20: .4byte 0x083054e0 +_08188A24: .4byte 0x020241e4 +_08188A28: .4byte 0x02020630 +_08188A2C: .4byte 0x0000ff10 +_08188A30: .4byte 0x0830593c +_08188A34: .4byte sub_805D7AC + 1 +_08188A38: .4byte 0x03005d60 +_08188A3C: .4byte sub_8186558 + 1 + thumb_func_end sub_818888C + + thumb_func_start sub_8188A40 +sub_8188A40: @ 8188A40 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188A40 + + thumb_func_start sub_8188A4C +sub_8188A4C: @ 8188A4C + push {r4-r6,lr} + ldr r6, _08188ADC + ldr r4, _08188AE0 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _08188AE4 + 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, _08188AE8 + 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, _08188AEC + bl oamt_set_x3A_32 + ldr r1, _08188AF0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188AF4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08188ADC: .4byte 0x020241e4 +_08188AE0: .4byte 0x02024064 +_08188AE4: .4byte 0x02020630 +_08188AE8: .4byte sub_80A6EEC + 1 +_08188AEC: .4byte nullsub_12 + 1 +_08188AF0: .4byte 0x03005d60 +_08188AF4: .4byte sub_81865C8 + 1 + thumb_func_end sub_8188A4C + + thumb_func_start sub_8188AF8 +sub_8188AF8: @ 8188AF8 + push {r4-r6,lr} + ldr r6, _08188B44 + ldr r4, [r6] + ldr r5, _08188B48 + 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 _08188B4C + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08188B2C + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08188B2C: + 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 _08188B88 + .align 2, 0 +_08188B44: .4byte 0x020244d0 +_08188B48: .4byte 0x02024064 +_08188B4C: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08188B88 + strb r0, [r3, 0x4] + movs r0, 0x10 + movs r1, 0x3F + bl audio_play_and_stuff + ldr r2, _08188B90 + ldr r1, _08188B94 + 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, _08188B98 + str r1, [r0] + ldr r1, _08188B9C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188BA0 + str r1, [r0] +_08188B88: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08188B90: .4byte 0x02020630 +_08188B94: .4byte 0x020241e4 +_08188B98: .4byte sub_8039934 + 1 +_08188B9C: .4byte 0x03005d60 +_08188BA0: .4byte sub_8186D58 + 1 + thumb_func_end sub_8188AF8 + + thumb_func_start sub_8188BA4 +sub_8188BA4: @ 8188BA4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188BA4 + + thumb_func_start sub_8188BB0 +sub_8188BB0: @ 8188BB0 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188BB0 + + thumb_func_start sub_8188BBC +sub_8188BBC: @ 8188BBC + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188BBC + + thumb_func_start sub_8188BC8 +sub_8188BC8: @ 8188BC8 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188BC8 + + thumb_func_start sub_8188BD4 +sub_8188BD4: @ 8188BD4 + push {r4-r6,lr} + ldr r6, _08188CB8 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08188BE6 + b _08188CFA +_08188BE6: + ldr r0, _08188CBC + 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, _08188CC0 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, _08188CC4 + 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, _08188CC8 + 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, _08188CCC + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, _08188CD0 + 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, _08188CD4 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, _08188CD8 + 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 _08188CDC + bl sub_81871AC + b _08188CFA + .align 2, 0 +_08188CB8: .4byte 0x02024064 +_08188CBC: .4byte 0x02023064 +_08188CC0: .4byte 0x02038432 +_08188CC4: .4byte 0x02038408 +_08188CC8: .4byte 0x02038404 +_08188CCC: .4byte 0x0203841a +_08188CD0: .4byte 0x0203841c +_08188CD4: .4byte 0x02038400 +_08188CD8: .4byte 0x020244bc +_08188CDC: + ldr r0, _08188D00 + 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, _08188D04 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188D08 + str r1, [r0] +_08188CFA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08188D00: .4byte 0x020244d0 +_08188D04: .4byte 0x03005d60 +_08188D08: .4byte sub_8188D0C + 1 + thumb_func_end sub_8188BD4 + + thumb_func_start sub_8188D0C +sub_8188D0C: @ 8188D0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, _08188D58 + ldr r6, _08188D5C + 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, _08188D60 + 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 _08188DA4 + cmp r2, 0x1 + bgt _08188D64 + cmp r2, 0 + beq _08188D6E + b _08188E80 + .align 2, 0 +_08188D58: .4byte 0x02023064 +_08188D5C: .4byte 0x02024064 +_08188D60: .4byte 0x020244d0 +_08188D64: + cmp r2, 0x2 + beq _08188DCE + cmp r2, 0x3 + beq _08188E44 + b _08188E80 +_08188D6E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _08188D90 + 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 +_08188D90: + 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 _08188E80 +_08188DA4: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08188E80 + 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 _08188E80 +_08188DCE: + ldr r0, _08188E34 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _08188E38 + ldrb r0, [r0] + cmp r0, 0 + bne _08188E80 + 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 _08188E1C + mov r0, r8 + cmp r0, 0x1 + bhi _08188E1C + 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] +_08188E1C: + ldr r0, _08188E3C + ldr r2, [r0] + ldr r0, _08188E40 + 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 _08188E80 + .align 2, 0 +_08188E34: .4byte 0x020383f8 +_08188E38: .4byte 0x020383fd +_08188E3C: .4byte 0x020244d0 +_08188E40: .4byte 0x02024064 +_08188E44: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08188E80 + 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_81871AC +_08188E80: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8188D0C + + thumb_func_start sub_8188E90 +sub_8188E90: @ 8188E90 + push {r4,lr} + ldr r0, _08188EC8 + movs r1, 0 + strh r1, [r0] + ldr r0, _08188ECC + strh r1, [r0] + ldr r4, _08188ED0 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, _08188ED4 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, _08188ED8 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _08188EDC + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08188EE0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08188EC8: .4byte 0x02022e14 +_08188ECC: .4byte 0x02022e16 +_08188ED0: .4byte 0x02024064 +_08188ED4: .4byte 0x02023066 +_08188ED8: .4byte 0x02022e2c +_08188EDC: .4byte 0x03005d60 +_08188EE0: .4byte sub_8186E10 + 1 + thumb_func_end sub_8188E90 + + thumb_func_start sub_8188EE4 +sub_8188EE4: @ 8188EE4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188EE4 + + thumb_func_start sub_8188EF0 +sub_8188EF0: @ 8188EF0 + push {lr} + ldr r0, _08188F10 + ldrb r0, [r0] + bl sub_8185054 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl sub_81871AC + pop {r0} + bx r0 + .align 2, 0 +_08188F10: .4byte 0x02024064 + thumb_func_end sub_8188EF0 + + thumb_func_start sub_8188F14 +sub_8188F14: @ 8188F14 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188F14 + + thumb_func_start sub_8188F20 +sub_8188F20: @ 8188F20 + push {r4,r5,lr} + ldr r0, _08188F44 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _08188F48 + 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 + b _08188F6C + .align 2, 0 +_08188F44: .4byte 0x02022fec +_08188F48: + ldr r5, _08188F78 + ldrb r0, [r5] + bl sub_8185054 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + bl sub_8185054 + 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 +_08188F6C: + bl sub_81871AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08188F78: .4byte 0x02024064 + thumb_func_end sub_8188F20 + + thumb_func_start sub_8188F7C +sub_8188F7C: @ 8188F7C + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188F7C + + thumb_func_start sub_8188F88 +sub_8188F88: @ 8188F88 + push {r4,lr} + ldr r4, _08188FBC + ldrb r0, [r4] + bl sub_8185054 + ldrb r1, [r4] + ldr r3, _08188FC0 + ldr r2, [r3] + adds r1, r2 + adds r1, 0x5C + strb r0, [r1] + ldrb r0, [r4] + ldr r1, [r3] + adds r0, r1 + adds r0, 0x5C + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl sub_81871AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08188FBC: .4byte 0x02024064 +_08188FC0: .4byte 0x0202449c + thumb_func_end sub_8188F88 + + thumb_func_start sub_8188FC4 +sub_8188FC4: @ 8188FC4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8188FC4 + + thumb_func_start sub_8188FD0 +sub_8188FD0: @ 8188FD0 + 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, _08189048 + ldr r0, _0818904C + 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, _08189050 + cmp r7, r0 + beq _08189060 + ldr r6, _08189054 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _08189058 + 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, _0818905C + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0818908A + .align 2, 0 +_08189048: .4byte 0x02023064 +_0818904C: .4byte 0x02024064 +_08189050: .4byte 0x00007fff +_08189054: .4byte 0x0202406e +_08189058: .4byte 0x02024744 +_0818905C: .4byte 0x03005d70 +_08189060: + ldr r1, _081890A8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081890AC + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, _081890B0 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0818908A: + ldr r1, _081890B4 + ldr r0, _081890B8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _081890BC + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081890A8: .4byte 0x0202406e +_081890AC: .4byte 0x02024744 +_081890B0: .4byte 0x03005d70 +_081890B4: .4byte 0x03005d60 +_081890B8: .4byte 0x02024064 +_081890BC: .4byte sub_8186D04 + 1 + thumb_func_end sub_8188FD0 + + thumb_func_start sub_81890C0 +sub_81890C0: @ 81890C0 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81890C0 + + thumb_func_start sub_81890CC +sub_81890CC: @ 81890CC + push {r4,lr} + ldr r4, _08189128 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08189120 + ldr r0, _0818912C + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _08189130 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08189134 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _08189138 + 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, _0818913C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08189140 + str r1, [r0] +_08189120: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08189128: .4byte 0x02024064 +_0818912C: .4byte 0x03005d70 +_08189130: .4byte 0x0202406e +_08189134: .4byte 0x02024744 +_08189138: .4byte 0x020244d0 +_0818913C: .4byte 0x03005d60 +_08189140: .4byte sub_818714C + 1 + thumb_func_end sub_81890CC + + thumb_func_start sub_8189144 +sub_8189144: @ 8189144 + push {r4,r5,lr} + ldr r5, _0818919C + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08189194 + ldr r4, _081891A0 + 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, _081891A4 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081891A8 + str r1, [r0] +_08189194: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818919C: .4byte 0x02024064 +_081891A0: .4byte 0x02023064 +_081891A4: .4byte 0x03005d60 +_081891A8: .4byte sub_818714C + 1 + thumb_func_end sub_8189144 + + thumb_func_start sub_81891AC +sub_81891AC: @ 81891AC + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891AC + + thumb_func_start sub_81891B8 +sub_81891B8: @ 81891B8 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891B8 + + thumb_func_start sub_81891C4 +sub_81891C4: @ 81891C4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891C4 + + thumb_func_start sub_81891D0 +sub_81891D0: @ 81891D0 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891D0 + + thumb_func_start sub_81891DC +sub_81891DC: @ 81891DC + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891DC + + thumb_func_start sub_81891E8 +sub_81891E8: @ 81891E8 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891E8 + + thumb_func_start sub_81891F4 +sub_81891F4: @ 81891F4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81891F4 + + thumb_func_start sub_8189200 +sub_8189200: @ 8189200 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_8189200 + + thumb_func_start sub_818920C +sub_818920C: @ 818920C + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_818920C + + thumb_func_start sub_8189218 +sub_8189218: @ 8189218 + push {lr} + ldr r2, _08189230 + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sub_81871AC + pop {r0} + bx r0 + .align 2, 0 +_08189230: .4byte 0x02022d0c + thumb_func_end sub_8189218 + + thumb_func_start sub_8189234 +sub_8189234: @ 8189234 + push {lr} + ldr r3, _08189260 + ldr r1, _08189264 + ldr r0, _08189268 + 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_81871AC + pop {r0} + bx r0 + .align 2, 0 +_08189260: .4byte 0x02022d0c +_08189264: .4byte 0x02023064 +_08189268: .4byte 0x02024064 + thumb_func_end sub_8189234 + + thumb_func_start sub_818926C +sub_818926C: @ 818926C + push {lr} + ldr r2, _08189280 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl sub_81871AC + pop {r0} + bx r0 + .align 2, 0 +_08189280: .4byte 0x02022d0c + thumb_func_end sub_818926C + + thumb_func_start sub_8189284 +sub_8189284: @ 8189284 + push {lr} + ldr r3, _081892A8 + 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_81871AC + pop {r0} + bx r0 + .align 2, 0 +_081892A8: .4byte 0x02022d0c + thumb_func_end sub_8189284 + + thumb_func_start sub_81892AC +sub_81892AC: @ 81892AC + push {r4,lr} + ldr r3, _081892D4 + ldr r2, _081892D8 + ldr r4, _081892DC + 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 _081892E0 + bl sub_81871AC + b _0818930A + .align 2, 0 +_081892D4: .4byte 0x02020630 +_081892D8: .4byte 0x020241e4 +_081892DC: .4byte 0x02024064 +_081892E0: + ldr r1, _08189310 + 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, _08189314 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _08189318 + str r1, [r0] +_0818930A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08189310: .4byte 0x020244b9 +_08189314: .4byte 0x03005d60 +_08189318: .4byte bx_blink_t2 + 1 + thumb_func_end sub_81892AC + + thumb_func_start sub_818931C +sub_818931C: @ 818931C + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_818931C + + thumb_func_start sub_8189328 +sub_8189328: @ 8189328 + push {r4,lr} + ldr r4, _08189364 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0818933C + movs r3, 0xC0 +_0818933C: + ldr r2, _08189368 + 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_81871AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08189364: .4byte 0x02024064 +_08189368: .4byte 0x02023064 + thumb_func_end sub_8189328 + + thumb_func_start sub_818936C +sub_818936C: @ 818936C + push {r4,r5,lr} + ldr r4, _081893A0 + ldr r5, _081893A4 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _081893A8 + 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 _081893BC + .align 2, 0 +_081893A0: .4byte 0x02023064 +_081893A4: .4byte 0x02024064 +_081893A8: + 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 +_081893BC: + bl sub_81871AC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818936C + + thumb_func_start sub_81893C8 +sub_81893C8: @ 81893C8 + push {lr} + ldr r1, _081893F8 + ldr r0, _081893FC + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08189400 + 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_81871AC + pop {r0} + bx r0 + .align 2, 0 +_081893F8: .4byte 0x0202406e +_081893FC: .4byte 0x02024064 +_08189400: .4byte 0x02024744 + thumb_func_end sub_81893C8 + + thumb_func_start sub_8189404 +sub_8189404: @ 8189404 + push {lr} + ldr r1, _0818942C + ldr r0, _08189430 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _08189434 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl sub_81871AC + pop {r0} + bx r0 + .align 2, 0 +_0818942C: .4byte 0x02023064 +_08189430: .4byte 0x02024064 +_08189434: .4byte 0x020243fc + thumb_func_end sub_8189404 + + thumb_func_start sub_8189438 +sub_8189438: @ 8189438 + push {r4-r6,lr} + ldr r5, _08189518 + ldr r6, _0818951C + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _08189520 + 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, _08189524 + 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, _08189528 + bl oamt_set_x3A_32 + ldr r0, _0818952C + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _08189530 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, _08189534 + 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 _081894FA + ldr r0, _08189538 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _0818953C + str r1, [r0] +_081894FA: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, _08189540 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _08189544 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08189518: .4byte 0x020241e4 +_0818951C: .4byte 0x02024064 +_08189520: .4byte 0x02020630 +_08189524: .4byte sub_80A6EEC + 1 +_08189528: .4byte sub_818962C + 1 +_0818952C: .4byte c3_0803D564 + 1 +_08189530: .4byte 0x03005e00 +_08189534: .4byte 0x020244d0 +_08189538: .4byte 0x020244b4 +_0818953C: .4byte sub_8073C30 + 1 +_08189540: .4byte 0x03005d60 +_08189544: .4byte nullsub_70 + 1 + thumb_func_end sub_8189438 + + thumb_func_start c3_0803D564 +c3_0803D564: @ 8189548 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r7, _081895A0 + ldrb r0, [r7] + mov r9, r0 + ldr r1, _081895A4 + 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 _08189582 + ldr r0, _081895A8 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081895B4 +_08189582: + ldr r0, _081895AC + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _081895B0 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_81885D8 + b _081895F4 + .align 2, 0 +_081895A0: .4byte 0x02024064 +_081895A4: .4byte 0x03005e00 +_081895A8: .4byte 0x02022fec +_081895AC: .4byte 0x02023064 +_081895B0: .4byte 0x0202406e +_081895B4: + ldr r4, _08189618 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, _0818961C + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_81885D8 + 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_81885D8 + ldrb r0, [r7] + eors r0, r5 + strb r0, [r7] +_081895F4: + ldr r1, _08189620 + ldr r2, _08189624 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _08189628 + 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 + .align 2, 0 +_08189618: .4byte 0x02023064 +_0818961C: .4byte 0x0202406e +_08189620: .4byte 0x03005d60 +_08189624: .4byte 0x02024064 +_08189628: .4byte sub_818686C + 1 + thumb_func_end c3_0803D564 + + thumb_func_start sub_818962C +sub_818962C: @ 818962C + 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 obj_delete_and_free_tiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818962C + + thumb_func_start sub_8189648 +sub_8189648: @ 8189648 + push {r4-r7,lr} + ldr r1, _08189670 + ldr r0, _08189674 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08189678 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08189678 + bl sub_81871AC + b _08189742 + .align 2, 0 +_08189670: .4byte 0x02023064 +_08189674: .4byte 0x02024064 +_08189678: + ldr r4, _081896D0 + ldr r0, [r4] + ldr r3, _081896D4 + 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, _081896D8 + ldrb r2, [r3] + lsls r0, r2, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r3, 0 + cmp r0, 0 + beq _081896E4 + 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 _081896DC + 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 _08189742 + .align 2, 0 +_081896D0: .4byte 0x020244d0 +_081896D4: .4byte 0x02024064 +_081896D8: .4byte 0x02023064 +_081896DC: + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + strb r0, [r3, 0x1] +_081896E4: + adds r5, r7, 0 + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, _08189748 + 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, _0818974C + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, _08189750 + 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 _08189736 + 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] +_08189736: + ldr r0, _08189754 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, _08189758 + str r0, [r1] +_08189742: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08189748: .4byte 0x02023068 +_0818974C: .4byte 0x020244b4 +_08189750: .4byte 0x020244d0 +_08189754: .4byte 0x03005d60 +_08189758: .4byte sub_818975C + 1 + thumb_func_end sub_8189648 + + thumb_func_start sub_818975C +sub_818975C: @ 818975C + push {r4,lr} + ldr r4, _0818979C + ldr r0, [r4] + ldr r3, _081897A0 + 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 _08189794 + 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_81871AC +_08189794: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818979C: .4byte 0x020244d0 +_081897A0: .4byte 0x02024064 + thumb_func_end sub_818975C + + thumb_func_start sub_81897A4 +sub_81897A4: @ 81897A4 + push {lr} + ldr r0, _081897E0 + ldr r1, [r0] + ldr r0, _081897E4 + 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 _081897D6 + ldr r2, _081897E8 + ldr r0, _081897EC + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _081897F0 + str r1, [r0] +_081897D6: + bl sub_81871AC + pop {r0} + bx r0 + .align 2, 0 +_081897E0: .4byte 0x020244d0 +_081897E4: .4byte 0x02024064 +_081897E8: .4byte 0x03005e00 +_081897EC: .4byte 0x020244b4 +_081897F0: .4byte sub_8073C30 + 1 + thumb_func_end sub_81897A4 + + thumb_func_start sub_81897F4 +sub_81897F4: @ 81897F4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81897F4 + + thumb_func_start sub_8189800 +sub_8189800: @ 8189800 + push {r4,lr} + ldr r4, _08189850 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08189846 + ldr r3, _08189854 + ldr r0, _08189858 + 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, _0818985C + 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 +_08189846: + bl sub_81871AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08189850: .4byte 0x02024064 +_08189854: .4byte 0x02020630 +_08189858: .4byte 0x020241e4 +_0818985C: .4byte 0x02023064 + thumb_func_end sub_8189800 + + thumb_func_start sub_8189860 +sub_8189860: @ 8189860 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _081898A4 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081898B8 + ldr r5, _081898A8 + 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 _081898AC + bl sub_81871AC + b _081898B8 + .align 2, 0 +_081898A4: .4byte 0x02024064 +_081898A8: .4byte 0x02023064 +_081898AC: + ldr r0, _081898C0 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _081898C4 + str r0, [r1] +_081898B8: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081898C0: .4byte 0x03005d60 +_081898C4: .4byte sub_818717C + 1 + thumb_func_end sub_8189860 + + thumb_func_start sub_81898C8 +sub_81898C8: @ 81898C8 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81898C8 + + thumb_func_start sub_81898D4 +sub_81898D4: @ 81898D4 + push {lr} + bl sub_81871AC + pop {r0} + bx r0 + thumb_func_end sub_81898D4 + + thumb_func_start sub_81898E0 +sub_81898E0: @ 81898E0 + push {lr} + ldr r1, _081898FC + ldr r0, _08189900 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x3 + bne _08189908 + ldr r0, _08189904 + strb r2, [r0] + b _08189910 + .align 2, 0 +_081898FC: .4byte 0x02023064 +_08189900: .4byte 0x02024064 +_08189904: .4byte 0x0202433a +_08189908: + ldr r0, _08189934 + movs r1, 0x3 + eors r1, r2 + strb r1, [r0] +_08189910: + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl sub_81871AC + ldr r1, _08189938 + ldr r0, _0818993C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08189940 + str r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08189934: .4byte 0x0202433a +_08189938: .4byte 0x03005d60 +_0818993C: .4byte 0x02024064 +_08189940: .4byte sub_80587B0 + 1 + thumb_func_end sub_81898E0 + + thumb_func_start nullsub_119 +nullsub_119: @ 8189944 + bx lr + thumb_func_end nullsub_119 + + thumb_func_start nullsub_120 +nullsub_120: @ 8189948 + bx lr + thumb_func_end nullsub_120 + + thumb_func_start sub_818994C +sub_818994C: @ 818994C + ldr r1, _0818995C + ldr r0, _08189960 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _08189964 + str r1, [r0] + bx lr + .align 2, 0 +_0818995C: .4byte 0x03005d60 +_08189960: .4byte 0x02024064 +_08189964: .4byte sub_8189968 + 1 + thumb_func_end sub_818994C + + thumb_func_start sub_8189968 +sub_8189968: @ 8189968 + push {lr} + ldr r2, _0818999C + ldr r1, _081899A0 + ldr r0, _081899A4 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081899B4 + ldr r0, _081899A8 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081899B0 + ldr r0, _081899AC + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081899B4 + .align 2, 0 +_0818999C: .4byte 0x02024068 +_081899A0: .4byte 0x0832a328 +_081899A4: .4byte 0x02024064 +_081899A8: .4byte 0x02023064 +_081899AC: .4byte 0x0860af74 +_081899B0: + bl sub_818A514 +_081899B4: + pop {r0} + bx r0 + thumb_func_end sub_8189968 + + thumb_func_start sub_81899B8 +sub_81899B8: @ 81899B8 + push {lr} + ldr r2, _081899E0 + ldr r1, _081899E4 + ldr r0, _081899E8 + 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, _081899EC + cmp r1, r0 + bne _081899DC + bl sub_818A514 +_081899DC: + pop {r0} + bx r0 + .align 2, 0 +_081899E0: .4byte 0x02020630 +_081899E4: .4byte 0x020241e4 +_081899E8: .4byte 0x02024064 +_081899EC: .4byte nullsub_12 + 1 + thumb_func_end sub_81899B8 + + thumb_func_start sub_81899F0 +sub_81899F0: @ 81899F0 + push {r4-r6,lr} + ldr r6, _08189A48 + ldr r5, _08189A4C + ldr r4, _08189A50 + 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, _08189A54 + cmp r1, r0 + bne _08189A40 + 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 obj_delete_and_free_tiles + bl sub_818A514 +_08189A40: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08189A48: .4byte 0x02020630 +_08189A4C: .4byte 0x020241e4 +_08189A50: .4byte 0x02024064 +_08189A54: .4byte nullsub_12 + 1 + thumb_func_end sub_81899F0 + + thumb_func_start sub_8189A58 +sub_8189A58: @ 8189A58 + push {r4,lr} + ldr r4, _08189A98 + ldr r1, [r4] + ldr r3, _08189A9C + 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 _08189A90 + 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_818A514 +_08189A90: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08189A98: .4byte 0x020244d0 +_08189A9C: .4byte 0x02024064 + thumb_func_end sub_8189A58 + + thumb_func_start sub_8189AA0 +sub_8189AA0: @ 8189AA0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + ldr r4, _08189AF8 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + beq _08189ABA + b _08189C60 +_08189ABA: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189ADA + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189B0C + ldr r0, _08189AFC + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08189B0C +_08189ADA: + ldr r2, _08189B00 + ldr r1, _08189B04 + 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, _08189B08 + cmp r1, r0 + bne _08189B42 + b _08189B48 + .align 2, 0 +_08189AF8: .4byte 0x02024064 +_08189AFC: .4byte 0x02022fec +_08189B00: .4byte 0x02020630 +_08189B04: .4byte 0x03005d70 +_08189B08: .4byte nullsub_12 + 1 +_08189B0C: + ldr r2, _08189C3C + ldr r5, _08189C40 + ldr r0, _08189C44 + ldrb r3, [r0] + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, _08189C48 + cmp r4, r0 + bne _08189B42 + 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, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08189B42 + movs r6, 0x1 +_08189B42: + cmp r6, 0 + bne _08189B48 + b _08189D18 +_08189B48: + ldr r0, _08189C4C + mov r9, r0 + ldr r0, [r0] + ldr r5, _08189C44 + ldrb r2, [r5] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4, 0x1] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189B6A + b _08189D18 +_08189B6A: + 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, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189B86 + b _08189D18 +_08189B86: + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r9 + ldr r0, [r1] + 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 r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r9 + ldr r2, [r0] + ldrb r0, [r5] + 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, [r5] + 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, _08189C50 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldr r7, _08189C54 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r4, _08189C58 + adds r0, r4 + bl sub_805E990 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189C22 + ldrb r0, [r5] + mov r1, r8 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r4 + bl sub_805E990 +_08189C22: + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r5] + 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, _08189C5C + ldrb r0, [r5] + b _08189D10 + .align 2, 0 +_08189C3C: .4byte 0x02020630 +_08189C40: .4byte 0x03005d70 +_08189C44: .4byte 0x02024064 +_08189C48: .4byte nullsub_12 + 1 +_08189C4C: .4byte 0x020244d0 +_08189C50: .4byte 0x000027f9 +_08189C54: .4byte 0x0202406e +_08189C58: .4byte 0x020244ec +_08189C5C: .4byte 0x03005d60 +_08189C60: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189C80 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189CB0 + ldr r0, _08189CA0 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08189CB0 +_08189C80: + ldr r2, _08189CA4 + ldr r1, _08189CA8 + 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, _08189CAC + cmp r1, r0 + bne _08189CE6 + b _08189CE4 + .align 2, 0 +_08189CA0: .4byte 0x02022fec +_08189CA4: .4byte 0x02020630 +_08189CA8: .4byte 0x03005d70 +_08189CAC: .4byte nullsub_12 + 1 +_08189CB0: + ldr r2, _08189D24 + ldr r5, _08189D28 + ldr r0, _08189D2C + ldrb r3, [r0] + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, _08189D30 + cmp r4, r0 + bne _08189CE6 + 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, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08189CE6 +_08189CE4: + movs r6, 0x1 +_08189CE6: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _08189CF2 + movs r6, 0 +_08189CF2: + cmp r6, 0 + beq _08189D18 + ldr r0, _08189D34 + ldr r0, [r0] + ldr r3, _08189D2C + 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, _08189D38 + ldrb r0, [r3] +_08189D10: + lsls r0, 2 + adds r0, r1 + ldr r1, _08189D3C + str r1, [r0] +_08189D18: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08189D24: .4byte 0x02020630 +_08189D28: .4byte 0x03005d70 +_08189D2C: .4byte 0x02024064 +_08189D30: .4byte nullsub_12 + 1 +_08189D34: .4byte 0x020244d0 +_08189D38: .4byte 0x03005d60 +_08189D3C: .4byte sub_8189A58 + 1 + thumb_func_end sub_8189AA0 + + thumb_func_start sub_8189D40 +sub_8189D40: @ 8189D40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + ldr r4, _08189F1C + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08189DBE + ldr r5, _08189F20 + ldr r0, [r5] + 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 r6, 0x88 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189D8C + ldr r0, _08189F24 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08189F28 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08189D8C: + 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 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189DBE + ldr r0, _08189F24 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08189F28 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_08189DBE: + ldr r3, _08189F20 + ldr r0, [r3] + ldr r2, _08189F1C + 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 r9, r2 + mov r8, r3 + cmp r0, 0 + bne _08189EA2 + 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 _08189EA2 + ldrb r1, [r6, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08189E84 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189E54 + ldr r0, _08189F2C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08189E54 + ldr r4, _08189F30 + mov r1, r9 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _08189F24 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08189F28 + 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 +_08189E54: + ldr r5, _08189F30 + ldr r4, _08189F1C + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _08189F24 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _08189F28 + 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 +_08189E84: + ldr r4, _08189F20 + ldr r0, [r4] + ldr r3, _08189F1C + 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 r9, r3 + mov r8, r4 +_08189EA2: + 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 _08189F62 + 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 _08189F62 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08189F62 + 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 _08189F44 + ldr r0, _08189F2C + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08189F38 + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08189F44 + ldr r0, _08189F34 + bl m4aMPlayContinue + b _08189F44 + .align 2, 0 +_08189F1C: .4byte 0x02024064 +_08189F20: .4byte 0x020244d0 +_08189F24: .4byte 0x0202406e +_08189F28: .4byte 0x020244ec +_08189F2C: .4byte 0x02022fec +_08189F30: .4byte 0x03005d70 +_08189F34: .4byte 0x03007420 +_08189F38: + ldr r0, _0818A038 + ldr r1, _0818A03C + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08189F44: + ldr r0, _0818A040 + ldr r2, [r0] + ldr r0, _0818A044 + 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 +_08189F62: + mov r1, r10 + cmp r1, 0 + beq _0818A02A + ldr r7, _0818A048 + ldr r6, _0818A04C + ldr r5, _0818A044 + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r7, 0 + adds r4, 0x1C + adds r0, r4 + ldr r2, [r0] + ldr r0, _0818A050 + cmp r2, r0 + bne _0818A02A + ldr r0, _0818A054 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + cmp r0, r2 + bne _0818A02A + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189FC8 + ldr r0, _0818A058 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08189FC8 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl obj_delete_and_free_tiles +_08189FC8: + ldr r1, _0818A04C + ldr r4, _0818A044 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0818A048 + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r3, _0818A040 + 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, _0818A05C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818A060 + str r1, [r0] +_0818A02A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818A038: .4byte 0x03007420 +_0818A03C: .4byte 0x0000ffff +_0818A040: .4byte 0x020244d0 +_0818A044: .4byte 0x02024064 +_0818A048: .4byte 0x02020630 +_0818A04C: .4byte 0x03005d7c +_0818A050: .4byte nullsub_12 + 1 +_0818A054: .4byte 0x020241e4 +_0818A058: .4byte 0x02022fec +_0818A05C: .4byte 0x03005d60 +_0818A060: .4byte sub_8189AA0 + 1 + thumb_func_end sub_8189D40 + + thumb_func_start sub_818A064 +sub_818A064: @ 818A064 + push {lr} + ldr r2, _0818A098 + ldr r1, _0818A09C + ldr r0, _0818A0A0 + 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 _0818A092 + movs r2, 0x24 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0818A092 + bl sub_818A514 +_0818A092: + pop {r0} + bx r0 + .align 2, 0 +_0818A098: .4byte 0x02020630 +_0818A09C: .4byte 0x020241e4 +_0818A0A0: .4byte 0x02024064 + thumb_func_end sub_818A064 + + thumb_func_start sub_818A0A4 +sub_818A0A4: @ 818A0A4 + push {r4-r6,lr} + ldr r5, _0818A0E4 + ldrb r0, [r5] + ldr r6, _0818A0E8 + 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 _0818A0EC + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _0818A106 + .align 2, 0 +_0818A0E4: .4byte 0x02024064 +_0818A0E8: .4byte 0x03005d70 +_0818A0EC: + ldr r2, _0818A10C + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0818A110 + adds r0, r2 + bl sub_805E990 + bl sub_818A514 +_0818A106: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818A10C: .4byte 0x0202406e +_0818A110: .4byte 0x020244ec + thumb_func_end sub_818A0A4 + + thumb_func_start sub_818A114 +sub_818A114: @ 818A114 + push {r4-r6,lr} + ldr r6, _0818A198 + ldr r5, _0818A19C + ldr r4, _0818A1A0 + 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 _0818A190 + ldr r1, _0818A1A4 + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0818A1A8 + 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 obj_delete_and_free_tiles + ldr r1, _0818A1AC + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_818A514 +_0818A190: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818A198: .4byte 0x02020630 +_0818A19C: .4byte 0x020241e4 +_0818A1A0: .4byte 0x02024064 +_0818A1A4: .4byte 0x0202406e +_0818A1A8: .4byte 0x020244ec +_0818A1AC: .4byte 0x03005d70 + thumb_func_end sub_818A114 + + thumb_func_start sub_818A1B0 +sub_818A1B0: @ 818A1B0 + push {r4-r6,lr} + ldr r0, _0818A20C + ldr r0, [r0] + ldr r6, _0818A210 + 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 _0818A204 + ldr r5, _0818A214 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0818A218 + 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 obj_delete_and_free_tiles + ldr r1, _0818A21C + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_818A514 +_0818A204: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818A20C: .4byte 0x020244d0 +_0818A210: .4byte 0x02024064 +_0818A214: .4byte 0x020241e4 +_0818A218: .4byte 0x02020630 +_0818A21C: .4byte 0x03005d70 + thumb_func_end sub_818A1B0 + + thumb_func_start sub_818A220 +sub_818A220: @ 818A220 + push {lr} + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + cmp r0, 0 + bne _0818A232 + bl sub_818A514 +_0818A232: + pop {r0} + bx r0 + thumb_func_end sub_818A220 + + thumb_func_start sub_818A238 +sub_818A238: @ 818A238 + push {r4,lr} + ldr r1, _0818A274 + ldr r0, _0818A278 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _0818A27C + 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 _0818A284 + 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, _0818A280 + strb r3, [r0] + bl sub_818A514 + b _0818A2AE + .align 2, 0 +_0818A274: .4byte 0x020241e4 +_0818A278: .4byte 0x02024064 +_0818A27C: .4byte 0x02020630 +_0818A280: .4byte 0x020244b9 +_0818A284: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0818A2A8 + 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] +_0818A2A8: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_0818A2AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818A238 + + thumb_func_start sub_818A2B4 +sub_818A2B4: @ 818A2B4 + push {r4,lr} + ldr r2, _0818A30C + ldr r0, _0818A310 + ldr r4, _0818A314 + 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, _0818A318 + cmp r1, r0 + bne _0818A306 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, _0818A31C + 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 _0818A2FA + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0818A2FA: + ldr r0, _0818A320 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _0818A324 + str r0, [r1] +_0818A306: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818A30C: .4byte 0x02020630 +_0818A310: .4byte 0x03005d70 +_0818A314: .4byte 0x02024064 +_0818A318: .4byte nullsub_12 + 1 +_0818A31C: .4byte 0x020244d0 +_0818A320: .4byte 0x03005d60 +_0818A324: .4byte sub_818A328 + 1 + thumb_func_end sub_818A2B4 + + thumb_func_start sub_818A328 +sub_818A328: @ 818A328 + push {lr} + ldr r0, _0818A368 + ldr r1, [r0] + ldr r0, _0818A36C + 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 _0818A364 + ldr r2, _0818A370 + ldr r0, _0818A374 + 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, _0818A378 + cmp r1, r0 + bne _0818A364 + bl sub_818A514 +_0818A364: + pop {r0} + bx r0 + .align 2, 0 +_0818A368: .4byte 0x020244d0 +_0818A36C: .4byte 0x02024064 +_0818A370: .4byte 0x02020630 +_0818A374: .4byte 0x020241e4 +_0818A378: .4byte nullsub_12 + 1 + thumb_func_end sub_818A328 + + thumb_func_start sub_818A37C +sub_818A37C: @ 818A37C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r3, _0818A444 + ldr r0, [r3] + ldr r7, _0818A448 + 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 _0818A438 + 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, _0818A44C + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldr r0, _0818A450 + movs r1, 0xA + bl AddTask + ldr r0, _0818A454 + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _0818A458 + adds r0, r5 + bl sub_805E990 + ldr r1, _0818A45C + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0818A460 + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start + ldr r4, _0818A464 + 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, _0818A468 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818A46C + str r1, [r0] +_0818A438: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818A444: .4byte 0x020244d0 +_0818A448: .4byte 0x02024064 +_0818A44C: .4byte 0x000027f9 +_0818A450: .4byte c3_0802FDF4 + 1 +_0818A454: .4byte 0x0202406e +_0818A458: .4byte 0x020244ec +_0818A45C: .4byte 0x020241e4 +_0818A460: .4byte 0x02020630 +_0818A464: .4byte 0x03005d70 +_0818A468: .4byte 0x03005d60 +_0818A46C: .4byte sub_818A2B4 + 1 + thumb_func_end sub_818A37C + + thumb_func_start sub_818A470 +sub_818A470: @ 818A470 + push {r4-r6,lr} + ldr r6, _0818A4F0 + ldr r0, [r6] + ldr r4, _0818A4F4 + 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 _0818A4A2 + ldr r0, _0818A4F8 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0818A4FC + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0818A4A2: + ldr r5, _0818A500 + ldr r0, _0818A504 + 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, _0818A508 + cmp r1, r0 + bne _0818A4E8 + 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 _0818A4E8 + adds r0, r3, r5 + bl obj_delete_and_free_tiles + ldr r1, _0818A50C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818A510 + str r1, [r0] +_0818A4E8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818A4F0: .4byte 0x020244d0 +_0818A4F4: .4byte 0x02024064 +_0818A4F8: .4byte 0x0202406e +_0818A4FC: .4byte 0x020244ec +_0818A500: .4byte 0x02020630 +_0818A504: .4byte 0x03005d7c +_0818A508: .4byte nullsub_12 + 1 +_0818A50C: .4byte 0x03005d60 +_0818A510: .4byte sub_818A37C + 1 + thumb_func_end sub_818A470 + + thumb_func_start sub_818A514 +sub_818A514: @ 818A514 + push {r4,lr} + sub sp, 0x4 + ldr r1, _0818A554 + ldr r4, _0818A558 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818A55C + str r1, [r0] + ldr r0, _0818A560 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0818A568 + 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, _0818A564 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0818A57A + .align 2, 0 +_0818A554: .4byte 0x03005d60 +_0818A558: .4byte 0x02024064 +_0818A55C: .4byte sub_8189968 + 1 +_0818A560: .4byte 0x02022fec +_0818A564: .4byte 0x02023064 +_0818A568: + ldr r2, _0818A584 + ldr r1, _0818A588 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0818A57A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818A584: .4byte 0x02024068 +_0818A588: .4byte 0x0832a328 + thumb_func_end sub_818A514 + + thumb_func_start sub_818A58C +sub_818A58C: @ 818A58C + push {lr} + ldr r0, _0818A5B4 + ldr r2, [r0] + ldr r0, _0818A5B8 + 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 _0818A5AE + bl sub_818A514 +_0818A5AE: + pop {r0} + bx r0 + .align 2, 0 +_0818A5B4: .4byte 0x020244d0 +_0818A5B8: .4byte 0x02024064 + thumb_func_end sub_818A58C + + thumb_func_start sub_818A5BC +sub_818A5BC: @ 818A5BC + push {lr} + ldr r0, _0818A5E4 + ldr r2, [r0] + ldr r0, _0818A5E8 + 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 _0818A5DE + bl sub_818A514 +_0818A5DE: + pop {r0} + bx r0 + .align 2, 0 +_0818A5E4: .4byte 0x020244d0 +_0818A5E8: .4byte 0x02024064 + thumb_func_end sub_818A5BC + + thumb_func_start sub_818A5EC +sub_818A5EC: @ 818A5EC + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, _0818A618 + ldr r0, _0818A61C + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818A624 + ldr r0, _0818A620 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_818A660 + adds r6, r0, 0 + b _0818A646 + .align 2, 0 +_0818A618: .4byte 0x02023064 +_0818A61C: .4byte 0x02024064 +_0818A620: .4byte 0x0202406e +_0818A624: + ldrb r4, [r1] + movs r5, 0 +_0818A628: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0818A63E + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_818A660 + adds r6, r0 +_0818A63E: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0818A628 +_0818A646: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl sub_818A514 + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_818A5EC + + thumb_func_start sub_818A660 +sub_818A660: @ 818A660 + 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, _0818A694 + ldr r3, _0818A698 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0818A68A + bl _0818ADF6 +_0818A68A: + lsls r0, 2 + ldr r1, _0818A69C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0818A694: .4byte 0x02023064 +_0818A698: .4byte 0x02024064 +_0818A69C: .4byte _0818A6A0 + .align 2, 0 +_0818A6A0: + .4byte _0818A790 + .4byte _0818A9B4 + .4byte _0818A9C4 + .4byte _0818A9D4 + .4byte _0818AA3C + .4byte _0818AA3C + .4byte _0818AA3C + .4byte _0818AA3C + .4byte _0818AA58 + .4byte _0818AA94 + .4byte _0818AA94 + .4byte _0818AA94 + .4byte _0818AA94 + .4byte _0818ADF6 + .4byte _0818ADF6 + .4byte _0818ADF6 + .4byte _0818ADF6 + .4byte _0818AAB0 + .4byte _0818AAC0 + .4byte _0818AAF0 + .4byte _0818AB00 + .4byte _0818AB10 + .4byte _0818AB20 + .4byte _0818AB30 + .4byte _0818AB40 + .4byte _0818AB50 + .4byte _0818AB60 + .4byte _0818AB70 + .4byte _0818AB80 + .4byte _0818AB90 + .4byte _0818ABA0 + .4byte _0818ABB0 + .4byte _0818AC00 + .4byte _0818AC10 + .4byte _0818AC20 + .4byte _0818AC30 + .4byte _0818AC40 + .4byte _0818AC50 + .4byte _0818AC60 + .4byte _0818AC70 + .4byte _0818AC80 + .4byte _0818ACB4 + .4byte _0818ACC4 + .4byte _0818ACD4 + .4byte _0818ACE4 + .4byte _0818ACF4 + .4byte _0818AD04 + .4byte _0818AD14 + .4byte _0818AD24 + .4byte _0818AD44 + .4byte _0818AD54 + .4byte _0818AD64 + .4byte _0818AD74 + .4byte _0818AD84 + .4byte _0818AD94 + .4byte _0818ADA4 + .4byte _0818ADB4 + .4byte _0818ADC4 + .4byte _0818ADD4 + .4byte _0818ADE4 +_0818A790: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818A9A4 + 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 +_0818A7DC: + 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 _0818A7DC + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818A9A4 + 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, _0818A9A8 + 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, _0818A9AC + 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, _0818A9B0 + 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 strcpy_limit_10_chars + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_0818A994: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _0818A994 + b _0818ADF6 + .align 2, 0 +_0818A9A4: .4byte 0x020244ec +_0818A9A8: .4byte 0xfffffc1f +_0818A9AC: .4byte 0xfff07fff +_0818A9B0: .4byte 0xfffffe0f +_0818A9B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818A9C0 + adds r0, r1 + movs r1, 0xB + b _0818AD2E + .align 2, 0 +_0818A9C0: .4byte 0x020244ec +_0818A9C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818A9D0 + adds r0, r1 + movs r1, 0xC + b _0818AD2E + .align 2, 0 +_0818A9D0: .4byte 0x020244ec +_0818A9D4: + 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, _0818AA38 + adds r4, r1, r0 + mov r8, r9 +_0818A9EA: + 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 _0818A9EA + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AA38 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0818AA28: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0818AA28 + b _0818ADF6 + .align 2, 0 +_0818AA38: .4byte 0x020244ec +_0818AA3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AA54 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0818AD2E + .align 2, 0 +_0818AA54: .4byte 0x020244ec +_0818AA58: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _0818AA90 + mov r8, r2 +_0818AA64: + 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 _0818AA64 + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AA90 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0818ADF6 + .align 2, 0 +_0818AA90: .4byte 0x020244ec +_0818AA94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AAAC + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0818ADEE + .align 2, 0 +_0818AAAC: .4byte 0x020244ec +_0818AAB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AABC + adds r0, r1 + movs r1, 0x1 + b _0818AACA + .align 2, 0 +_0818AABC: .4byte 0x020244ec +_0818AAC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AAEC + adds r0, r1 + movs r1, 0x19 +_0818AACA: + 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 _0818ADF6 + .align 2, 0 +_0818AAEC: .4byte 0x020244ec +_0818AAF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AAFC + adds r0, r1 + movs r1, 0x1A + b _0818ADEE + .align 2, 0 +_0818AAFC: .4byte 0x020244ec +_0818AB00: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB0C + adds r0, r1 + movs r1, 0x1B + b _0818ADEE + .align 2, 0 +_0818AB0C: .4byte 0x020244ec +_0818AB10: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB1C + adds r0, r1 + movs r1, 0x1C + b _0818ADEE + .align 2, 0 +_0818AB1C: .4byte 0x020244ec +_0818AB20: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB2C + adds r0, r1 + movs r1, 0x1D + b _0818ADEE + .align 2, 0 +_0818AB2C: .4byte 0x020244ec +_0818AB30: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB3C + adds r0, r1 + movs r1, 0x1E + b _0818ADEE + .align 2, 0 +_0818AB3C: .4byte 0x020244ec +_0818AB40: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB4C + adds r0, r1 + movs r1, 0x1F + b _0818ADEE + .align 2, 0 +_0818AB4C: .4byte 0x020244ec +_0818AB50: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB5C + adds r0, r1 + movs r1, 0x20 + b _0818ADEE + .align 2, 0 +_0818AB5C: .4byte 0x020244ec +_0818AB60: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB6C + adds r0, r1 + movs r1, 0x22 + b _0818ADEE + .align 2, 0 +_0818AB6C: .4byte 0x020244ec +_0818AB70: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB7C + adds r0, r1 + movs r1, 0x23 + b _0818ADEE + .align 2, 0 +_0818AB7C: .4byte 0x020244ec +_0818AB80: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB8C + adds r0, r1 + movs r1, 0x24 + b _0818ADEE + .align 2, 0 +_0818AB8C: .4byte 0x020244ec +_0818AB90: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AB9C + adds r0, r1 + movs r1, 0x25 + b _0818ADEE + .align 2, 0 +_0818AB9C: .4byte 0x020244ec +_0818ABA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ABAC + adds r0, r1 + movs r1, 0x26 + b _0818ADEE + .align 2, 0 +_0818ABAC: .4byte 0x020244ec +_0818ABB0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818ABFC + 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 _0818ADF6 + .align 2, 0 +_0818ABFC: .4byte 0x020244ec +_0818AC00: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC0C + adds r0, r1 + movs r1, 0x27 + b _0818ADEE + .align 2, 0 +_0818AC0C: .4byte 0x020244ec +_0818AC10: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC1C + adds r0, r1 + movs r1, 0x28 + b _0818ADEE + .align 2, 0 +_0818AC1C: .4byte 0x020244ec +_0818AC20: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC2C + adds r0, r1 + movs r1, 0x29 + b _0818ADEE + .align 2, 0 +_0818AC2C: .4byte 0x020244ec +_0818AC30: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC3C + adds r0, r1 + movs r1, 0x2A + b _0818ADEE + .align 2, 0 +_0818AC3C: .4byte 0x020244ec +_0818AC40: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC4C + adds r0, r1 + movs r1, 0x2B + b _0818ADEE + .align 2, 0 +_0818AC4C: .4byte 0x020244ec +_0818AC50: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC5C + adds r0, r1 + movs r1, 0x2C + b _0818ADEE + .align 2, 0 +_0818AC5C: .4byte 0x020244ec +_0818AC60: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC6C + adds r0, r1 + movs r1, 0 + b _0818AC8A + .align 2, 0 +_0818AC6C: .4byte 0x020244ec +_0818AC70: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AC7C + adds r0, r1 + movs r1, 0x9 + b _0818AD2E + .align 2, 0 +_0818AC7C: .4byte 0x020244ec +_0818AC80: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ACB0 + adds r0, r1 + movs r1, 0x37 +_0818AC8A: + 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 _0818ADF6 + .align 2, 0 +_0818ACB0: .4byte 0x020244ec +_0818ACB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ACC0 + adds r0, r1 + movs r1, 0x38 + b _0818ADEE + .align 2, 0 +_0818ACC0: .4byte 0x020244ec +_0818ACC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ACD0 + adds r0, r1 + movs r1, 0x39 + b _0818AD2E + .align 2, 0 +_0818ACD0: .4byte 0x020244ec +_0818ACD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ACE0 + adds r0, r1 + movs r1, 0x3A + b _0818AD2E + .align 2, 0 +_0818ACE0: .4byte 0x020244ec +_0818ACE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ACF0 + adds r0, r1 + movs r1, 0x3B + b _0818AD2E + .align 2, 0 +_0818ACF0: .4byte 0x020244ec +_0818ACF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD00 + adds r0, r1 + movs r1, 0x3C + b _0818AD2E + .align 2, 0 +_0818AD00: .4byte 0x020244ec +_0818AD04: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD10 + adds r0, r1 + movs r1, 0x3D + b _0818AD2E + .align 2, 0 +_0818AD10: .4byte 0x020244ec +_0818AD14: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD20 + adds r0, r1 + movs r1, 0x3E + b _0818AD2E + .align 2, 0 +_0818AD20: .4byte 0x020244ec +_0818AD24: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD40 + adds r0, r1 + movs r1, 0x3F +_0818AD2E: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0818ADF6 + .align 2, 0 +_0818AD40: .4byte 0x020244ec +_0818AD44: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD50 + adds r0, r1 + movs r1, 0x16 + b _0818ADEE + .align 2, 0 +_0818AD50: .4byte 0x020244ec +_0818AD54: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD60 + adds r0, r1 + movs r1, 0x17 + b _0818ADEE + .align 2, 0 +_0818AD60: .4byte 0x020244ec +_0818AD64: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD70 + adds r0, r1 + movs r1, 0x18 + b _0818ADEE + .align 2, 0 +_0818AD70: .4byte 0x020244ec +_0818AD74: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD80 + adds r0, r1 + movs r1, 0x21 + b _0818ADEE + .align 2, 0 +_0818AD80: .4byte 0x020244ec +_0818AD84: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AD90 + adds r0, r1 + movs r1, 0x2F + b _0818ADEE + .align 2, 0 +_0818AD90: .4byte 0x020244ec +_0818AD94: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ADA0 + adds r0, r1 + movs r1, 0x30 + b _0818ADEE + .align 2, 0 +_0818ADA0: .4byte 0x020244ec +_0818ADA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ADB0 + adds r0, r1 + movs r1, 0x32 + b _0818ADEE + .align 2, 0 +_0818ADB0: .4byte 0x020244ec +_0818ADB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ADC0 + adds r0, r1 + movs r1, 0x33 + b _0818ADEE + .align 2, 0 +_0818ADC0: .4byte 0x020244ec +_0818ADC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ADD0 + adds r0, r1 + movs r1, 0x34 + b _0818ADEE + .align 2, 0 +_0818ADD0: .4byte 0x020244ec +_0818ADD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818ADE0 + adds r0, r1 + movs r1, 0x35 + b _0818ADEE + .align 2, 0 +_0818ADE0: .4byte 0x020244ec +_0818ADE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818AE08 + adds r0, r1 + movs r1, 0x36 +_0818ADEE: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0818ADF6: + 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 + .align 2, 0 +_0818AE08: .4byte 0x020244ec + thumb_func_end sub_818A660 + + thumb_func_start sub_818AE0C +sub_818AE0C: @ 818AE0C + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818AE0C + + thumb_func_start sub_818AE18 +sub_818AE18: @ 818AE18 + push {r4,r5,lr} + ldr r1, _0818AE3C + ldr r0, _0818AE40 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818AE48 + ldr r0, _0818AE44 + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_818AE70 + b _0818AE66 + .align 2, 0 +_0818AE3C: .4byte 0x02023064 +_0818AE40: .4byte 0x02024064 +_0818AE44: .4byte 0x0202406e +_0818AE48: + ldrb r4, [r1] + movs r5, 0 +_0818AE4C: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0818AE5A + adds r0, r5, 0 + bl sub_818AE70 +_0818AE5A: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0818AE4C +_0818AE66: + bl sub_818A514 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818AE18 + + thumb_func_start sub_818AE70 +sub_818AE70: @ 818AE70 + 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, _0818AEA8 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, _0818AEAC + 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 _0818AE9C + bl _0818B836 +_0818AE9C: + lsls r0, 2 + ldr r1, _0818AEB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0818AEA8: .4byte 0x02024064 +_0818AEAC: .4byte 0x02023067 +_0818AEB0: .4byte _0818AEB4 + .align 2, 0 +_0818AEB4: + .4byte _0818AFA4 + .4byte _0818B13C + .4byte _0818B15C + .4byte _0818B17C + .4byte _0818B1D4 + .4byte _0818B1D4 + .4byte _0818B1D4 + .4byte _0818B1D4 + .4byte _0818B1FC + .4byte _0818B260 + .4byte _0818B260 + .4byte _0818B260 + .4byte _0818B260 + .4byte _0818B836 + .4byte _0818B836 + .4byte _0818B836 + .4byte _0818B836 + .4byte _0818B290 + .4byte _0818B2B0 + .4byte _0818B2D0 + .4byte _0818B2F0 + .4byte _0818B310 + .4byte _0818B330 + .4byte _0818B350 + .4byte _0818B370 + .4byte _0818B390 + .4byte _0818B3B0 + .4byte _0818B3D0 + .4byte _0818B3F0 + .4byte _0818B410 + .4byte _0818B430 + .4byte _0818B450 + .4byte _0818B4C0 + .4byte _0818B4E0 + .4byte _0818B500 + .4byte _0818B520 + .4byte _0818B540 + .4byte _0818B560 + .4byte _0818B580 + .4byte _0818B5A0 + .4byte _0818B5C0 + .4byte _0818B5E0 + .4byte _0818B600 + .4byte _0818B620 + .4byte _0818B640 + .4byte _0818B660 + .4byte _0818B680 + .4byte _0818B6A0 + .4byte _0818B6C0 + .4byte _0818B6E0 + .4byte _0818B700 + .4byte _0818B720 + .4byte _0818B740 + .4byte _0818B760 + .4byte _0818B780 + .4byte _0818B7A0 + .4byte _0818B7C0 + .4byte _0818B7E0 + .4byte _0818B800 + .4byte _0818B820 +_0818AFA4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818B138 + 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 +_0818B00A: + 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 _0818B00A + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818B138 + 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 _0818B836 + .align 2, 0 +_0818B138: .4byte 0x020244ec +_0818B13C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B154 + adds r0, r1 + ldr r1, _0818B158 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B154: .4byte 0x020244ec +_0818B158: .4byte 0x02024064 +_0818B15C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B174 + adds r0, r1 + ldr r1, _0818B178 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B174: .4byte 0x020244ec +_0818B178: .4byte 0x02024064 +_0818B17C: + 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, _0818B1D0 + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0818B196: + 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 _0818B196 + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B1D0 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B1D0: .4byte 0x020244ec +_0818B1D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B1F0 + adds r0, r1 + ldr r3, _0818B1F4 + ldr r1, _0818B1F8 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0818B278 + .align 2, 0 +_0818B1F0: .4byte 0x020244ec +_0818B1F4: .4byte 0x02023064 +_0818B1F8: .4byte 0x02024064 +_0818B1FC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818B258 + adds r4, r0 + ldr r5, _0818B25C + 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 _0818B836 + .align 2, 0 +_0818B258: .4byte 0x020244ec +_0818B25C: .4byte 0x02024064 +_0818B260: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B284 + adds r0, r1 + ldr r3, _0818B288 + ldr r1, _0818B28C + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0818B278: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B284: .4byte 0x020244ec +_0818B288: .4byte 0x02023064 +_0818B28C: .4byte 0x02024064 +_0818B290: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B2A8 + adds r0, r1 + ldr r1, _0818B2AC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B2A8: .4byte 0x020244ec +_0818B2AC: .4byte 0x02024064 +_0818B2B0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B2C8 + adds r0, r1 + ldr r1, _0818B2CC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B2C8: .4byte 0x020244ec +_0818B2CC: .4byte 0x02024064 +_0818B2D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B2E8 + adds r0, r1 + ldr r1, _0818B2EC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B2E8: .4byte 0x020244ec +_0818B2EC: .4byte 0x02024064 +_0818B2F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B308 + adds r0, r1 + ldr r1, _0818B30C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B308: .4byte 0x020244ec +_0818B30C: .4byte 0x02024064 +_0818B310: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B328 + adds r0, r1 + ldr r1, _0818B32C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B328: .4byte 0x020244ec +_0818B32C: .4byte 0x02024064 +_0818B330: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B348 + adds r0, r1 + ldr r1, _0818B34C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B348: .4byte 0x020244ec +_0818B34C: .4byte 0x02024064 +_0818B350: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B368 + adds r0, r1 + ldr r1, _0818B36C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B368: .4byte 0x020244ec +_0818B36C: .4byte 0x02024064 +_0818B370: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B388 + adds r0, r1 + ldr r1, _0818B38C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B388: .4byte 0x020244ec +_0818B38C: .4byte 0x02024064 +_0818B390: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B3A8 + adds r0, r1 + ldr r1, _0818B3AC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B3A8: .4byte 0x020244ec +_0818B3AC: .4byte 0x02024064 +_0818B3B0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B3C8 + adds r0, r1 + ldr r1, _0818B3CC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B3C8: .4byte 0x020244ec +_0818B3CC: .4byte 0x02024064 +_0818B3D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B3E8 + adds r0, r1 + ldr r1, _0818B3EC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B3E8: .4byte 0x020244ec +_0818B3EC: .4byte 0x02024064 +_0818B3F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B408 + adds r0, r1 + ldr r1, _0818B40C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B408: .4byte 0x020244ec +_0818B40C: .4byte 0x02024064 +_0818B410: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B428 + adds r0, r1 + ldr r1, _0818B42C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B428: .4byte 0x020244ec +_0818B42C: .4byte 0x02024064 +_0818B430: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B448 + adds r0, r1 + ldr r1, _0818B44C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B448: .4byte 0x020244ec +_0818B44C: .4byte 0x02024064 +_0818B450: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _0818B4B8 + adds r4, r0 + ldr r5, _0818B4BC + 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 _0818B570 + .align 2, 0 +_0818B4B8: .4byte 0x020244ec +_0818B4BC: .4byte 0x02024064 +_0818B4C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B4D8 + adds r0, r1 + ldr r1, _0818B4DC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B4D8: .4byte 0x020244ec +_0818B4DC: .4byte 0x02024064 +_0818B4E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B4F8 + adds r0, r1 + ldr r1, _0818B4FC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B4F8: .4byte 0x020244ec +_0818B4FC: .4byte 0x02024064 +_0818B500: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B518 + adds r0, r1 + ldr r1, _0818B51C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B518: .4byte 0x020244ec +_0818B51C: .4byte 0x02024064 +_0818B520: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B538 + adds r0, r1 + ldr r1, _0818B53C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B538: .4byte 0x020244ec +_0818B53C: .4byte 0x02024064 +_0818B540: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B558 + adds r0, r1 + ldr r1, _0818B55C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B558: .4byte 0x020244ec +_0818B55C: .4byte 0x02024064 +_0818B560: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B578 + adds r0, r1 + ldr r1, _0818B57C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0818B570: + movs r1, 0x2C + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B578: .4byte 0x020244ec +_0818B57C: .4byte 0x02024064 +_0818B580: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B598 + adds r0, r1 + ldr r1, _0818B59C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B598: .4byte 0x020244ec +_0818B59C: .4byte 0x02024064 +_0818B5A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B5B8 + adds r0, r1 + ldr r1, _0818B5BC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B5B8: .4byte 0x020244ec +_0818B5BC: .4byte 0x02024064 +_0818B5C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B5D8 + adds r0, r1 + ldr r1, _0818B5DC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B5D8: .4byte 0x020244ec +_0818B5DC: .4byte 0x02024064 +_0818B5E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B5F8 + adds r0, r1 + ldr r1, _0818B5FC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B5F8: .4byte 0x020244ec +_0818B5FC: .4byte 0x02024064 +_0818B600: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B618 + adds r0, r1 + ldr r1, _0818B61C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B618: .4byte 0x020244ec +_0818B61C: .4byte 0x02024064 +_0818B620: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B638 + adds r0, r1 + ldr r1, _0818B63C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B638: .4byte 0x020244ec +_0818B63C: .4byte 0x02024064 +_0818B640: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B658 + adds r0, r1 + ldr r1, _0818B65C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B658: .4byte 0x020244ec +_0818B65C: .4byte 0x02024064 +_0818B660: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B678 + adds r0, r1 + ldr r1, _0818B67C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B678: .4byte 0x020244ec +_0818B67C: .4byte 0x02024064 +_0818B680: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B698 + adds r0, r1 + ldr r1, _0818B69C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B698: .4byte 0x020244ec +_0818B69C: .4byte 0x02024064 +_0818B6A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B6B8 + adds r0, r1 + ldr r1, _0818B6BC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B6B8: .4byte 0x020244ec +_0818B6BC: .4byte 0x02024064 +_0818B6C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B6D8 + adds r0, r1 + ldr r1, _0818B6DC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B6D8: .4byte 0x020244ec +_0818B6DC: .4byte 0x02024064 +_0818B6E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B6F8 + adds r0, r1 + ldr r1, _0818B6FC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B6F8: .4byte 0x020244ec +_0818B6FC: .4byte 0x02024064 +_0818B700: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B718 + adds r0, r1 + ldr r1, _0818B71C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B718: .4byte 0x020244ec +_0818B71C: .4byte 0x02024064 +_0818B720: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B738 + adds r0, r1 + ldr r1, _0818B73C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B738: .4byte 0x020244ec +_0818B73C: .4byte 0x02024064 +_0818B740: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B758 + adds r0, r1 + ldr r1, _0818B75C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B758: .4byte 0x020244ec +_0818B75C: .4byte 0x02024064 +_0818B760: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B778 + adds r0, r1 + ldr r1, _0818B77C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B778: .4byte 0x020244ec +_0818B77C: .4byte 0x02024064 +_0818B780: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B798 + adds r0, r1 + ldr r1, _0818B79C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B798: .4byte 0x020244ec +_0818B79C: .4byte 0x02024064 +_0818B7A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B7B8 + adds r0, r1 + ldr r1, _0818B7BC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B7B8: .4byte 0x020244ec +_0818B7BC: .4byte 0x02024064 +_0818B7C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B7D8 + adds r0, r1 + ldr r1, _0818B7DC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B7D8: .4byte 0x020244ec +_0818B7DC: .4byte 0x02024064 +_0818B7E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B7F8 + adds r0, r1 + ldr r1, _0818B7FC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B7F8: .4byte 0x020244ec +_0818B7FC: .4byte 0x02024064 +_0818B800: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B818 + adds r0, r1 + ldr r1, _0818B81C + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0818B836 + .align 2, 0 +_0818B818: .4byte 0x020244ec +_0818B81C: .4byte 0x02024064 +_0818B820: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0818B860 + adds r0, r1 + ldr r1, _0818B864 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0818B836: + ldr r2, _0818B868 + ldr r0, _0818B864 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0818B860 + 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 + .align 2, 0 +_0818B860: .4byte 0x020244ec +_0818B864: .4byte 0x02024064 +_0818B868: .4byte 0x0202406e + thumb_func_end sub_818AE70 + + thumb_func_start sub_818B86C +sub_818B86C: @ 818B86C + push {r4-r7,lr} + ldr r1, _0818B8D0 + ldr r7, _0818B8D4 + 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, _0818B8D8 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _0818B8DC + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0818B8C4 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_0818B8A2: + 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 _0818B8A2 +_0818B8C4: + bl sub_818A514 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818B8D0: .4byte 0x0202406e +_0818B8D4: .4byte 0x02024064 +_0818B8D8: .4byte 0x02023064 +_0818B8DC: .4byte 0x020244ec + thumb_func_end sub_818B86C + + thumb_func_start sub_818B8E0 +sub_818B8E0: @ 818B8E0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _0818B9D4 + mov r8, r0 + ldr r6, _0818B9D8 + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0818B9DC + 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, _0818B9E0 + 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 obj_add_from_template_forward_search + ldr r4, _0818B9E4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, _0818B9E8 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _0818B9EC + 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, _0818B9F0 + adds r2, r1 + ldrb r1, [r2] + bl obj_anim_image_start + ldr r1, _0818B9F4 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818B9F8 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818B9D4: .4byte 0x0202406e +_0818B9D8: .4byte 0x02024064 +_0818B9DC: .4byte 0x020244ec +_0818B9E0: .4byte 0x0202499c +_0818B9E4: .4byte 0x020241e4 +_0818B9E8: .4byte 0x02020630 +_0818B9EC: .4byte 0x0000ff10 +_0818B9F0: .4byte 0x020244e4 +_0818B9F4: .4byte 0x03005d60 +_0818B9F8: .4byte sub_818A064 + 1 + thumb_func_end sub_818B8E0 + + thumb_func_start sub_818B9FC +sub_818B9FC: @ 818B9FC + push {r4-r6,lr} + ldr r5, _0818BA54 + ldrb r0, [r5] + ldr r4, _0818BA58 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, _0818BA5C + 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, _0818BA60 + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_818BA6C + ldr r1, _0818BA64 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818BA68 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818BA54: .4byte 0x02024064 +_0818BA58: .4byte 0x02023064 +_0818BA5C: .4byte 0x0202406e +_0818BA60: .4byte 0x020244ec +_0818BA64: .4byte 0x03005d60 +_0818BA68: .4byte sub_818A470 + 1 + thumb_func_end sub_818B9FC + + thumb_func_start sub_818BA6C +sub_818BA6C: @ 818BA6C + 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, _0818BBC0 + lsls r2, r6, 1 + adds r2, r0 + ldr r0, _0818BBC4 + 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, _0818BBC8 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _0818BBCC + bl object_new_hidden_with_callback + ldr r1, _0818BBD0 + 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, _0818BBD4 + 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 obj_add_from_template_forward_search + ldr r4, _0818BBD8 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _0818BBDC + 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, _0818BBE0 + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _0818BBE4 + 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 + .align 2, 0 +_0818BBC0: .4byte 0x0202406e +_0818BBC4: .4byte 0x02023064 +_0818BBC8: .4byte 0x020244ec +_0818BBCC: .4byte sub_805D714 + 1 +_0818BBD0: .4byte 0x03005d7c +_0818BBD4: .4byte 0x0202499c +_0818BBD8: .4byte 0x020241e4 +_0818BBDC: .4byte 0x02020630 +_0818BBE0: .4byte 0x020244e4 +_0818BBE4: .4byte nullsub_12 + 1 + thumb_func_end sub_818BA6C + + thumb_func_start sub_818BBE8 +sub_818BBE8: @ 818BBE8 + push {r4-r6,lr} + ldr r1, _0818BC1C + ldr r6, _0818BC20 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0818BC30 + ldr r0, _0818BC24 + 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, _0818BC28 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818BC2C + str r1, [r0] + b _0818BC66 + .align 2, 0 +_0818BC1C: .4byte 0x02023064 +_0818BC20: .4byte 0x02024064 +_0818BC24: .4byte 0x020244d0 +_0818BC28: .4byte 0x03005d60 +_0818BC2C: .4byte sub_818BC78 + 1 +_0818BC30: + ldr r5, _0818BC6C + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0818BC70 + 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 obj_delete_and_free_tiles + ldr r1, _0818BC74 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_818A514 +_0818BC66: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818BC6C: .4byte 0x020241e4 +_0818BC70: .4byte 0x02020630 +_0818BC74: .4byte 0x03005d70 + thumb_func_end sub_818BBE8 + + thumb_func_start sub_818BC78 +sub_818BC78: @ 818BC78 + push {r4-r6,lr} + ldr r6, _0818BC98 + ldr r4, [r6] + ldr r5, _0818BC9C + 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 _0818BCA0 + cmp r0, 0x1 + beq _0818BCCE + b _0818BCF6 + .align 2, 0 +_0818BC98: .4byte 0x020244d0 +_0818BC9C: .4byte 0x02024064 +_0818BCA0: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0818BCBA + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0818BCBA: + 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 _0818BCF6 +_0818BCCE: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818BCF6 + 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, _0818BCFC + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818BD00 + str r1, [r0] +_0818BCF6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818BCFC: .4byte 0x03005d60 +_0818BD00: .4byte sub_818A1B0 + 1 + thumb_func_end sub_818BC78 + + thumb_func_start sub_818BD04 +sub_818BD04: @ 818BD04 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, _0818BD2C + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0818BD48 + movs r0, 0x40 + ands r1, r0 + cmp r1, 0 + beq _0818BD30 + bl sub_8185F40 + lsls r0, 24 + lsrs r4, r0, 24 + b _0818BD4C + .align 2, 0 +_0818BD2C: .4byte 0x02022fec +_0818BD30: + ldr r2, _0818BD40 + ldr r0, _0818BD44 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + b _0818BD4A + .align 2, 0 +_0818BD40: .4byte 0x020229e8 +_0818BD44: .4byte 0x0203c7b4 +_0818BD48: + ldr r0, _0818BD88 +_0818BD4A: + ldrb r4, [r0, 0x13] +_0818BD4C: + ldr r0, _0818BD8C + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0818BD98 + ldr r0, _0818BD90 + 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 _0818BD72 + movs r1, 0x5A + mov r9, r1 +_0818BD72: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0818BD9C + movs r0, 0x5A + mov r9, r0 + ldr r1, _0818BD94 + b _0818BD9E + .align 2, 0 +_0818BD88: .4byte 0x020229e8 +_0818BD8C: .4byte 0x02022fec +_0818BD90: .4byte 0x02024064 +_0818BD94: .4byte 0x083054e0 +_0818BD98: + movs r0, 0x50 + mov r9, r0 +_0818BD9C: + ldr r1, _0818BEB8 +_0818BD9E: + 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 r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + bne _0818BDC0 + b _0818BEDC +_0818BDC0: + ldr r0, _0818BEBC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r6, _0818BEC0 + 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, _0818BEC4 + 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 obj_add_from_template_forward_search + ldr r4, _0818BEC8 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, _0818BECC + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl gpu_pal_tags_index_of + ldr r5, _0818BED0 + 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, _0818BED4 + 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, _0818BED8 + 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 _0818BF72 + .align 2, 0 +_0818BEB8: .4byte 0x08305d2c +_0818BEBC: .4byte 0x03005d90 +_0818BEC0: .4byte 0x02024064 +_0818BEC4: .4byte 0x0202499c +_0818BEC8: .4byte 0x020241e4 +_0818BECC: .4byte 0x0830593c +_0818BED0: .4byte 0x02020630 +_0818BED4: .4byte 0x0000fffe +_0818BED8: .4byte sub_805D7AC + 1 +_0818BEDC: + ldr r5, _0818BF8C + 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, _0818BF90 + 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 obj_add_from_template_forward_search + ldr r6, _0818BF94 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _0818BF98 + 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, _0818BF9C + 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, _0818BFA0 + str r1, [r0] +_0818BF72: + ldr r1, _0818BFA4 + ldr r0, _0818BF8C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818BFA8 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818BF8C: .4byte 0x02024064 +_0818BF90: .4byte 0x0202499c +_0818BF94: .4byte 0x020241e4 +_0818BF98: .4byte 0x02020630 +_0818BF9C: .4byte 0x0000fffe +_0818BFA0: .4byte sub_805D7AC + 1 +_0818BFA4: .4byte 0x03005d60 +_0818BFA8: .4byte sub_81899B8 + 1 + thumb_func_end sub_818BD04 + + thumb_func_start sub_818BFAC +sub_818BFAC: @ 818BFAC + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818BFAC + + thumb_func_start sub_818BFB8 +sub_818BFB8: @ 818BFB8 + push {r4-r6,lr} + ldr r6, _0818C044 + ldr r4, _0818C048 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0818C04C + 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, _0818C050 + 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, _0818C054 + 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, _0818C058 + bl oamt_set_x3A_32 + ldr r1, _0818C05C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C060 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818C044: .4byte 0x020241e4 +_0818C048: .4byte 0x02024064 +_0818C04C: .4byte 0x02020630 +_0818C050: .4byte 0x0000ffd8 +_0818C054: .4byte sub_80A6EEC + 1 +_0818C058: .4byte nullsub_12 + 1 +_0818C05C: .4byte 0x03005d60 +_0818C060: .4byte sub_81899F0 + 1 + thumb_func_end sub_818BFB8 + + thumb_func_start sub_818C064 +sub_818C064: @ 818C064 + push {r4-r6,lr} + ldr r6, _0818C0B0 + ldr r4, [r6] + ldr r5, _0818C0B4 + 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 _0818C0B8 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0818C098 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0818C098: + 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 _0818C12E + .align 2, 0 +_0818C0B0: .4byte 0x020244d0 +_0818C0B4: .4byte 0x02024064 +_0818C0B8: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0818C12E + strb r4, [r3, 0x4] + ldr r2, _0818C134 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _0818C138 + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, _0818C13C + ldr r3, _0818C140 + 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, _0818C144 + str r1, [r0] + ldr r1, _0818C148 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C14C + str r1, [r0] +_0818C12E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818C134: .4byte 0x0202406e +_0818C138: .4byte 0x020244ec +_0818C13C: .4byte 0x02020630 +_0818C140: .4byte 0x020241e4 +_0818C144: .4byte sub_8039C00 + 1 +_0818C148: .4byte 0x03005d60 +_0818C14C: .4byte sub_818A114 + 1 + thumb_func_end sub_818C064 + + thumb_func_start sub_818C150 +sub_818C150: @ 818C150 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C150 + + thumb_func_start sub_818C15C +sub_818C15C: @ 818C15C + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C15C + + thumb_func_start sub_818C168 +sub_818C168: @ 818C168 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C168 + + thumb_func_start sub_818C174 +sub_818C174: @ 818C174 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C174 + + thumb_func_start sub_818C180 +sub_818C180: @ 818C180 + push {r4-r6,lr} + ldr r6, _0818C264 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0818C192 + b _0818C2A6 +_0818C192: + ldr r0, _0818C268 + 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, _0818C26C + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, _0818C270 + 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, _0818C274 + 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, _0818C278 + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, _0818C27C + 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, _0818C280 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, _0818C284 + 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 _0818C288 + bl sub_818A514 + b _0818C2A6 + .align 2, 0 +_0818C264: .4byte 0x02024064 +_0818C268: .4byte 0x02023064 +_0818C26C: .4byte 0x02038432 +_0818C270: .4byte 0x02038408 +_0818C274: .4byte 0x02038404 +_0818C278: .4byte 0x0203841a +_0818C27C: .4byte 0x0203841c +_0818C280: .4byte 0x02038400 +_0818C284: .4byte 0x020244bc +_0818C288: + ldr r0, _0818C2AC + 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, _0818C2B0 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C2B4 + str r1, [r0] +_0818C2A6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818C2AC: .4byte 0x020244d0 +_0818C2B0: .4byte 0x03005d60 +_0818C2B4: .4byte bx_move_anim_2 + 1 + thumb_func_end sub_818C180 + + thumb_func_start bx_move_anim_2 +bx_move_anim_2: @ 818C2B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, _0818C304 + ldr r6, _0818C308 + 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, _0818C30C + 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 _0818C350 + cmp r2, 0x1 + bgt _0818C310 + cmp r2, 0 + beq _0818C31A + b _0818C42C + .align 2, 0 +_0818C304: .4byte 0x02023064 +_0818C308: .4byte 0x02024064 +_0818C30C: .4byte 0x020244d0 +_0818C310: + cmp r2, 0x2 + beq _0818C37A + cmp r2, 0x3 + beq _0818C3F0 + b _0818C42C +_0818C31A: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _0818C33C + 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 +_0818C33C: + 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 _0818C42C +_0818C350: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0818C42C + 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 _0818C42C +_0818C37A: + ldr r0, _0818C3E0 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _0818C3E4 + ldrb r0, [r0] + cmp r0, 0 + bne _0818C42C + 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 _0818C3C8 + mov r0, r8 + cmp r0, 0x1 + bhi _0818C3C8 + 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] +_0818C3C8: + ldr r0, _0818C3E8 + ldr r2, [r0] + ldr r0, _0818C3EC + 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 _0818C42C + .align 2, 0 +_0818C3E0: .4byte 0x020383f8 +_0818C3E4: .4byte 0x020383fd +_0818C3E8: .4byte 0x020244d0 +_0818C3EC: .4byte 0x02024064 +_0818C3F0: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0818C42C + 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_818A514 +_0818C42C: + 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_2 + + thumb_func_start sub_818C43C +sub_818C43C: @ 818C43C + push {r4,lr} + ldr r0, _0818C474 + movs r1, 0 + strh r1, [r0] + ldr r0, _0818C478 + strh r1, [r0] + ldr r4, _0818C47C + ldrb r0, [r4] + lsls r0, 9 + ldr r1, _0818C480 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, _0818C484 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _0818C488 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C48C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818C474: .4byte 0x02022e14 +_0818C478: .4byte 0x02022e16 +_0818C47C: .4byte 0x02024064 +_0818C480: .4byte 0x02023066 +_0818C484: .4byte 0x02022e2c +_0818C488: .4byte 0x03005d60 +_0818C48C: .4byte sub_818A220 + 1 + thumb_func_end sub_818C43C + + thumb_func_start sub_818C490 +sub_818C490: @ 818C490 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C490 + + thumb_func_start sub_818C49C +sub_818C49C: @ 818C49C + push {lr} + ldr r1, _0818C4CC + ldr r0, _0818C4D0 + ldrb r0, [r0] + ldrb r1, [r1, 0x4] + lsrs r0, 1 + cmp r1, r0 + bcc _0818C4C6 + ldr r0, _0818C4D4 + ldrb r0, [r0] + bl sub_8185054 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl sub_818A514 +_0818C4C6: + pop {r0} + bx r0 + .align 2, 0 +_0818C4CC: .4byte 0x02024332 +_0818C4D0: .4byte 0x0202406c +_0818C4D4: .4byte 0x02024064 + thumb_func_end sub_818C49C + + thumb_func_start sub_818C4D8 +sub_818C4D8: @ 818C4D8 + push {lr} + ldr r0, _0818C4F8 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0818C508 + ldr r1, _0818C4FC + ldr r0, _0818C500 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C504 + str r1, [r0] + b _0818C522 + .align 2, 0 +_0818C4F8: .4byte 0x02022fec +_0818C4FC: .4byte 0x03005d60 +_0818C500: .4byte 0x02024064 +_0818C504: .4byte sub_818C49C + 1 +_0818C508: + ldr r0, _0818C528 + ldrb r0, [r0] + bl sub_8185054 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl sub_818A514 +_0818C522: + pop {r0} + bx r0 + .align 2, 0 +_0818C528: .4byte 0x02024064 + thumb_func_end sub_818C4D8 + + thumb_func_start sub_818C52C +sub_818C52C: @ 818C52C + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C52C + + thumb_func_start sub_818C538 +sub_818C538: @ 818C538 + push {r4,r5,lr} + ldr r0, _0818C55C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0818C560 + 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 + b _0818C584 + .align 2, 0 +_0818C55C: .4byte 0x02022fec +_0818C560: + ldr r5, _0818C590 + ldrb r0, [r5] + bl sub_8185054 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + bl sub_8185054 + 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 +_0818C584: + bl sub_818A514 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818C590: .4byte 0x02024064 + thumb_func_end sub_818C538 + + thumb_func_start sub_818C594 +sub_818C594: @ 818C594 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C594 + + thumb_func_start sub_818C5A0 +sub_818C5A0: @ 818C5A0 + push {r4,lr} + ldr r4, _0818C5D4 + ldrb r0, [r4] + bl sub_8185054 + ldrb r1, [r4] + ldr r3, _0818C5D8 + ldr r2, [r3] + adds r1, r2 + adds r1, 0x5C + strb r0, [r1] + ldrb r0, [r4] + ldr r1, [r3] + adds r0, r1 + adds r0, 0x5C + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl sub_818A514 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818C5D4: .4byte 0x02024064 +_0818C5D8: .4byte 0x0202449c + thumb_func_end sub_818C5A0 + + thumb_func_start sub_818C5DC +sub_818C5DC: @ 818C5DC + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C5DC + + thumb_func_start sub_818C5E8 +sub_818C5E8: @ 818C5E8 + 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, _0818C660 + ldr r0, _0818C664 + 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, _0818C668 + cmp r7, r0 + beq _0818C678 + ldr r6, _0818C66C + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _0818C670 + 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, _0818C674 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0818C6B2 + .align 2, 0 +_0818C660: .4byte 0x02023064 +_0818C664: .4byte 0x02024064 +_0818C668: .4byte 0x00007fff +_0818C66C: .4byte 0x0202406e +_0818C670: .4byte 0x020244ec +_0818C674: .4byte 0x03005d70 +_0818C678: + ldr r1, _0818C6D0 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0818C6D4 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, _0818C6D8 + adds r1, r0, r4 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C + mov r1, r9 + ldrb r0, [r1] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0 + bl heathbar_draw_hp +_0818C6B2: + ldr r1, _0818C6DC + ldr r0, _0818C6E0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C6E4 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818C6D0: .4byte 0x0202406e +_0818C6D4: .4byte 0x020244ec +_0818C6D8: .4byte 0x03005d70 +_0818C6DC: .4byte 0x03005d60 +_0818C6E0: .4byte 0x02024064 +_0818C6E4: .4byte sub_818A0A4 + 1 + thumb_func_end sub_818C5E8 + + thumb_func_start sub_818C6E8 +sub_818C6E8: @ 818C6E8 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C6E8 + + thumb_func_start sub_818C6F4 +sub_818C6F4: @ 818C6F4 + push {r4,lr} + ldr r4, _0818C750 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818C748 + ldr r0, _0818C754 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _0818C758 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _0818C75C + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _0818C760 + 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, _0818C764 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C768 + str r1, [r0] +_0818C748: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818C750: .4byte 0x02024064 +_0818C754: .4byte 0x03005d70 +_0818C758: .4byte 0x0202406e +_0818C75C: .4byte 0x020244ec +_0818C760: .4byte 0x020244d0 +_0818C764: .4byte 0x03005d60 +_0818C768: .4byte sub_818A58C + 1 + thumb_func_end sub_818C6F4 + + thumb_func_start sub_818C76C +sub_818C76C: @ 818C76C + push {r4,r5,lr} + ldr r5, _0818C7C4 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818C7BC + ldr r4, _0818C7C8 + 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, _0818C7CC + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C7D0 + str r1, [r0] +_0818C7BC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818C7C4: .4byte 0x02024064 +_0818C7C8: .4byte 0x02023064 +_0818C7CC: .4byte 0x03005d60 +_0818C7D0: .4byte sub_818A58C + 1 + thumb_func_end sub_818C76C + + thumb_func_start sub_818C7D4 +sub_818C7D4: @ 818C7D4 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C7D4 + + thumb_func_start sub_818C7E0 +sub_818C7E0: @ 818C7E0 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C7E0 + + thumb_func_start sub_818C7EC +sub_818C7EC: @ 818C7EC + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C7EC + + thumb_func_start sub_818C7F8 +sub_818C7F8: @ 818C7F8 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C7F8 + + thumb_func_start sub_818C804 +sub_818C804: @ 818C804 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C804 + + thumb_func_start sub_818C810 +sub_818C810: @ 818C810 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C810 + + thumb_func_start sub_818C81C +sub_818C81C: @ 818C81C + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C81C + + thumb_func_start sub_818C828 +sub_818C828: @ 818C828 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C828 + + thumb_func_start sub_818C834 +sub_818C834: @ 818C834 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C834 + + thumb_func_start sub_818C840 +sub_818C840: @ 818C840 + push {lr} + ldr r2, _0818C858 + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sub_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818C858: .4byte 0x02022d0c + thumb_func_end sub_818C840 + + thumb_func_start sub_818C85C +sub_818C85C: @ 818C85C + push {lr} + ldr r3, _0818C888 + ldr r1, _0818C88C + ldr r0, _0818C890 + 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_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818C888: .4byte 0x02022d0c +_0818C88C: .4byte 0x02023064 +_0818C890: .4byte 0x02024064 + thumb_func_end sub_818C85C + + thumb_func_start sub_818C894 +sub_818C894: @ 818C894 + push {lr} + ldr r2, _0818C8A8 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl sub_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818C8A8: .4byte 0x02022d0c + thumb_func_end sub_818C894 + + thumb_func_start sub_818C8AC +sub_818C8AC: @ 818C8AC + push {lr} + ldr r3, _0818C8D0 + 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_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818C8D0: .4byte 0x02022d0c + thumb_func_end sub_818C8AC + + thumb_func_start sub_818C8D4 +sub_818C8D4: @ 818C8D4 + push {r4,lr} + ldr r3, _0818C8FC + ldr r2, _0818C900 + ldr r4, _0818C904 + 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 _0818C908 + bl sub_818A514 + b _0818C932 + .align 2, 0 +_0818C8FC: .4byte 0x02020630 +_0818C900: .4byte 0x020241e4 +_0818C904: .4byte 0x02024064 +_0818C908: + ldr r1, _0818C938 + 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, _0818C93C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818C940 + str r1, [r0] +_0818C932: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818C938: .4byte 0x020244b9 +_0818C93C: .4byte 0x03005d60 +_0818C940: .4byte sub_818A238 + 1 + thumb_func_end sub_818C8D4 + + thumb_func_start sub_818C944 +sub_818C944: @ 818C944 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818C944 + + thumb_func_start sub_818C950 +sub_818C950: @ 818C950 + push {r4,lr} + ldr r4, _0818C98C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0818C964 + movs r3, 0xC0 +_0818C964: + ldr r2, _0818C990 + 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_818A514 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818C98C: .4byte 0x02024064 +_0818C990: .4byte 0x02023064 + thumb_func_end sub_818C950 + + thumb_func_start sub_818C994 +sub_818C994: @ 818C994 + push {r4,r5,lr} + ldr r4, _0818C9C8 + ldr r5, _0818C9CC + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0818C9D0 + 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 _0818C9E4 + .align 2, 0 +_0818C9C8: .4byte 0x02023064 +_0818C9CC: .4byte 0x02024064 +_0818C9D0: + 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 +_0818C9E4: + bl sub_818A514 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818C994 + + thumb_func_start sub_818C9F0 +sub_818C9F0: @ 818C9F0 + push {lr} + ldr r1, _0818CA24 + ldr r0, _0818CA28 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _0818CA2C + 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 sub_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818CA24: .4byte 0x0202406e +_0818CA28: .4byte 0x02024064 +_0818CA2C: .4byte 0x020244ec + thumb_func_end sub_818C9F0 + + thumb_func_start dp01t_2E_2_battle_intro +dp01t_2E_2_battle_intro: @ 818CA30 + push {lr} + ldr r1, _0818CA58 + ldr r0, _0818CA5C + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _0818CA60 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl sub_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818CA58: .4byte 0x02023064 +_0818CA5C: .4byte 0x02024064 +_0818CA60: .4byte 0x020243fc + thumb_func_end dp01t_2E_2_battle_intro + + thumb_func_start sub_818CA64 +sub_818CA64: @ 818CA64 + push {r4-r6,lr} + ldr r5, _0818CB30 + ldr r6, _0818CB34 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0818CB38 + 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, _0818CB3C + 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, _0818CB40 + str r1, [r0] + ldrb r2, [r6] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x38] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _0818CB44 + 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 obj_anim_image_start + ldr r0, _0818CB48 + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0818CB4C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0818CB54 + ldr r4, _0818CB50 + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] + b _0818CB5A + .align 2, 0 +_0818CB30: .4byte 0x020241e4 +_0818CB34: .4byte 0x02024064 +_0818CB38: .4byte 0x02020630 +_0818CB3C: .4byte 0x0000ffd8 +_0818CB40: .4byte sub_80A6EEC + 1 +_0818CB44: .4byte sub_805CC00 + 1 +_0818CB48: .4byte 0x0000d6f9 +_0818CB4C: .4byte 0x02022fec +_0818CB50: .4byte 0x020229e8 +_0818CB54: + ldr r0, _0818CBF4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] +_0818CB5A: + ldr r1, _0818CBF8 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r4, r5, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + ldr r2, _0818CBFC + ldr r1, _0818CC00 + ldr r5, _0818CC04 + 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, _0818CC08 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0818CC0C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, _0818CC10 + 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 _0818CBD4 + ldr r0, _0818CC14 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _0818CC18 + str r1, [r0] +_0818CBD4: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, _0818CC1C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818CC20 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818CBF4: .4byte 0x03005d90 +_0818CBF8: .4byte 0x08305d8c +_0818CBFC: .4byte 0x02020630 +_0818CC00: .4byte 0x020241e4 +_0818CC04: .4byte 0x02024064 +_0818CC08: .4byte sub_818CC24 + 1 +_0818CC0C: .4byte 0x03005e00 +_0818CC10: .4byte 0x020244d0 +_0818CC14: .4byte 0x020244b4 +_0818CC18: .4byte sub_8073C30 + 1 +_0818CC1C: .4byte 0x03005d60 +_0818CC20: .4byte nullsub_120 + 1 + thumb_func_end sub_818CA64 + + thumb_func_start sub_818CC24 +sub_818CC24: @ 818CC24 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _0818CC4C + 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 _0818CC50 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0818CD0C + .align 2, 0 +_0818CC4C: .4byte 0x03005e00 +_0818CC50: + ldr r7, _0818CC90 + 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 _0818CC70 + ldr r0, _0818CC94 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0818CCA0 +_0818CC70: + ldr r0, _0818CC98 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _0818CC9C + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_818BA6C + b _0818CCF4 + .align 2, 0 +_0818CC90: .4byte 0x02024064 +_0818CC94: .4byte 0x02022fec +_0818CC98: .4byte 0x02023064 +_0818CC9C: .4byte 0x0202406e +_0818CCA0: + ldr r4, _0818CD18 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, _0818CD1C + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_818BA6C + 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, _0818CD20 + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_818BA6C + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_0818CCF4: + ldr r1, _0818CD24 + ldr r2, _0818CD28 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818CD2C + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl remove_task +_0818CD0C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818CD18: .4byte 0x02023064 +_0818CD1C: .4byte 0x0202406e +_0818CD20: .4byte 0x020244ec +_0818CD24: .4byte 0x03005d60 +_0818CD28: .4byte 0x02024064 +_0818CD2C: .4byte sub_8189D40 + 1 + thumb_func_end sub_818CC24 + + thumb_func_start sub_818CD30 +sub_818CD30: @ 818CD30 + push {r4-r6,lr} + ldr r1, _0818CD58 + ldr r0, _0818CD5C + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0818CD60 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0818CD60 + bl sub_818A514 + b _0818CDD4 + .align 2, 0 +_0818CD58: .4byte 0x02023064 +_0818CD5C: .4byte 0x02024064 +_0818CD60: + ldr r6, _0818CDDC + ldr r0, [r6] + ldr r5, _0818CDE0 + 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, _0818CDE4 + 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, _0818CDE8 + 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 _0818CDC8 + 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] +_0818CDC8: + ldr r0, _0818CDEC + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _0818CDF0 + str r0, [r1] +_0818CDD4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818CDDC: .4byte 0x020244d0 +_0818CDE0: .4byte 0x02024064 +_0818CDE4: .4byte 0x02023068 +_0818CDE8: .4byte 0x020244b4 +_0818CDEC: .4byte 0x03005d60 +_0818CDF0: .4byte bx_increment_dp11b_field_5_till_x60_then_resume + 1 + thumb_func_end sub_818CD30 + + thumb_func_start bx_increment_dp11b_field_5_till_x60_then_resume +bx_increment_dp11b_field_5_till_x60_then_resume: @ 818CDF4 + push {r4,lr} + ldr r4, _0818CE34 + ldr r0, [r4] + ldr r3, _0818CE38 + 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 _0818CE2C + 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_818A514 +_0818CE2C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818CE34: .4byte 0x020244d0 +_0818CE38: .4byte 0x02024064 + thumb_func_end bx_increment_dp11b_field_5_till_x60_then_resume + + thumb_func_start sub_818CE3C +sub_818CE3C: @ 818CE3C + push {lr} + ldr r0, _0818CE78 + ldr r1, [r0] + ldr r0, _0818CE7C + 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 _0818CE6E + ldr r2, _0818CE80 + ldr r0, _0818CE84 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _0818CE88 + str r1, [r0] +_0818CE6E: + bl sub_818A514 + pop {r0} + bx r0 + .align 2, 0 +_0818CE78: .4byte 0x020244d0 +_0818CE7C: .4byte 0x02024064 +_0818CE80: .4byte 0x03005e00 +_0818CE84: .4byte 0x020244b4 +_0818CE88: .4byte sub_8073C30 + 1 + thumb_func_end sub_818CE3C + + thumb_func_start sub_818CE8C +sub_818CE8C: @ 818CE8C + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818CE8C + + thumb_func_start sub_818CE98 +sub_818CE98: @ 818CE98 + push {r4,lr} + ldr r4, _0818CEE8 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0818CEDE + ldr r3, _0818CEEC + ldr r0, _0818CEF0 + 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, _0818CEF4 + 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 +_0818CEDE: + bl sub_818A514 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818CEE8: .4byte 0x02024064 +_0818CEEC: .4byte 0x02020630 +_0818CEF0: .4byte 0x020241e4 +_0818CEF4: .4byte 0x02023064 + thumb_func_end sub_818CE98 + + thumb_func_start sub_818CEF8 +sub_818CEF8: @ 818CEF8 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _0818CF3C + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818CF50 + ldr r5, _0818CF40 + 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 _0818CF44 + bl sub_818A514 + b _0818CF50 + .align 2, 0 +_0818CF3C: .4byte 0x02024064 +_0818CF40: .4byte 0x02023064 +_0818CF44: + ldr r0, _0818CF58 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _0818CF5C + str r0, [r1] +_0818CF50: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818CF58: .4byte 0x03005d60 +_0818CF5C: .4byte sub_818A5BC + 1 + thumb_func_end sub_818CEF8 + + thumb_func_start sub_818CF60 +sub_818CF60: @ 818CF60 + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818CF60 + + thumb_func_start sub_818CF6C +sub_818CF6C: @ 818CF6C + push {lr} + bl sub_818A514 + pop {r0} + bx r0 + thumb_func_end sub_818CF6C + + thumb_func_start sub_818CF78 +sub_818CF78: @ 818CF78 + push {r4,lr} + ldr r2, _0818CFB0 + ldr r1, _0818CFB4 + ldr r4, _0818CFB8 + 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 sub_818A514 + ldr r1, _0818CFBC + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _0818CFC0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818CFB0: .4byte 0x0202433a +_0818CFB4: .4byte 0x02023064 +_0818CFB8: .4byte 0x02024064 +_0818CFBC: .4byte 0x03005d60 +_0818CFC0: .4byte sub_80587B0 + 1 + thumb_func_end sub_818CF78 + + thumb_func_start nullsub_121 +nullsub_121: @ 818CFC4 + bx lr + thumb_func_end nullsub_121 + + thumb_func_start nullsub_122 +nullsub_122: @ 818CFC8 + bx lr + thumb_func_end nullsub_122 + + thumb_func_start dp13_810BB8C +dp13_810BB8C: @ 818CFCC + push {r4-r7,lr} + ldr r4, _0818CFEC + ldr r3, _0818CFF0 + movs r2, 0x7 +_0818CFD4: + adds r1, r3, 0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0xC + subs r2, 0x1 + cmp r2, 0 + bge _0818CFD4 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818CFEC: .4byte 0x0860b058 +_0818CFF0: .4byte 0x0203cd04 + thumb_func_end dp13_810BB8C + + thumb_func_start load_pokemon_image_TODO +load_pokemon_image_TODO: @ 818CFF4 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r1, 0 + adds r5, r3, 0 + ldr r3, [sp, 0x18] + ldr r1, [sp, 0x1C] + lsls r0, 16 + lsrs r4, r0, 16 + adds r7, r4, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + cmp r3, 0 + bne _0818D068 + cmp r2, 0 + beq _0818D034 + cmp r1, 0 + bne _0818D028 + lsls r0, r4, 3 + ldr r1, _0818D024 + b _0818D03C + .align 2, 0 +_0818D024: .4byte 0x0830a18c +_0818D028: + lsls r0, r4, 3 + ldr r1, _0818D030 + b _0818D054 + .align 2, 0 +_0818D030: .4byte 0x0830a18c +_0818D034: + cmp r0, 0 + bne _0818D050 + lsls r0, r4, 3 + ldr r1, _0818D04C +_0818D03C: + adds r0, r1 + str r2, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_8034654 + b _0818D08E + .align 2, 0 +_0818D04C: .4byte 0x083028b8 +_0818D050: + lsls r0, r4, 3 + ldr r1, _0818D064 +_0818D054: + adds r0, r1 + str r2, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_8034B7C + b _0818D08E + .align 2, 0 +_0818D064: .4byte 0x083028b8 +_0818D068: + cmp r2, 0 + beq _0818D080 + lsls r0, r4, 3 + ldr r1, _0818D07C + adds r0, r1 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80345F0 + b _0818D08E + .align 2, 0 +_0818D07C: .4byte 0x08305654 +_0818D080: + lsls r0, r7, 3 + ldr r1, _0818D098 + adds r0, r1 + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_80345F0 +_0818D08E: + movs r0, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818D098: .4byte 0x08305d4c + thumb_func_end load_pokemon_image_TODO + + thumb_func_start sub_818D09C +sub_818D09C: @ 818D09C + push {r4,lr} + sub sp, 0x8 + ldr r4, [sp, 0x10] + lsls r0, 16 + lsrs r0, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + bl load_pokemon_image_TODO + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_818D09C + + thumb_func_start sub_818D0C4 +sub_818D0C4: @ 818D0C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r1, 0 + mov r8, r2 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r3, 24 + lsrs r5, r3, 24 + mov r12, r5 + lsls r1, 16 + lsrs r3, r1, 16 + adds r1, r3, 0 + lsls r2, 24 + cmp r2, 0 + bne _0818D128 + ldr r0, _0818D108 + cmp r3, r0 + bne _0818D110 + ldr r2, _0818D10C + ldrh r1, [r2, 0x2] + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2, 0x2] + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r8 + bl species_and_otid_get_pal + lsls r1, r5, 20 + b _0818D144 + .align 2, 0 +_0818D108: .4byte 0x0000ffff +_0818D10C: .4byte 0x0203ccec +_0818D110: + ldr r0, _0818D124 + strh r3, [r0, 0x2] + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r8 + bl sub_806E7CC + bl gpu_pal_obj_decompress_and_apply + b _0818D16E + .align 2, 0 +_0818D124: .4byte 0x0203ccec +_0818D128: + ldr r0, _0818D154 + cmp r3, r0 + bne _0818D160 + ldr r2, _0818D158 + ldrh r1, [r2, 0x2] + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2, 0x2] + ldr r1, _0818D15C + lsls r0, r4, 3 + adds r0, r1 + ldr r0, [r0] + mov r2, r12 + lsls r1, r2, 20 +_0818D144: + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl decompress_palette + b _0818D16E + .align 2, 0 +_0818D154: .4byte 0x0000ffff +_0818D158: .4byte 0x0203ccec +_0818D15C: .4byte 0x0830593c +_0818D160: + ldr r0, _0818D178 + strh r1, [r0, 0x2] + lsls r0, r6, 3 + ldr r1, _0818D17C + adds r0, r1 + bl gpu_pal_obj_decompress_and_apply +_0818D16E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818D178: .4byte 0x0203ccec +_0818D17C: .4byte 0x0830593c + thumb_func_end sub_818D0C4 + + thumb_func_start sub_818D180 +sub_818D180: @ 818D180 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r1, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r4, r3, 24 + lsls r1, 24 + cmp r1, 0 + bne _0818D1A4 + adds r1, r5, 0 + bl species_and_otid_get_pal + lsls r1, r4, 4 + movs r2, 0x20 + bl decompress_palette + b _0818D1B4 +_0818D1A4: + ldr r1, _0818D1BC + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 4 + movs r2, 0x20 + bl decompress_palette +_0818D1B4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818D1BC: .4byte 0x0830593c + thumb_func_end sub_818D180 + + thumb_func_start uns_builder_assign_animtable1 +uns_builder_assign_animtable1: @ 818D1C0 + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0818D1D8 + ldr r1, _0818D1D0 + ldr r0, _0818D1D4 + str r0, [r1, 0x8] + b _0818D1E0 + .align 2, 0 +_0818D1D0: .4byte 0x0203ccec +_0818D1D4: .4byte 0x082ff70c +_0818D1D8: + ldr r0, _0818D1E4 + ldr r1, _0818D1E8 + ldr r1, [r1] + str r1, [r0, 0x8] +_0818D1E0: + pop {r0} + bx r0 + .align 2, 0 +_0818D1E4: .4byte 0x0203ccec +_0818D1E8: .4byte 0x0830536c + thumb_func_end uns_builder_assign_animtable1 + + thumb_func_start oamt_spawn_poke_or_trainer_picture +oamt_spawn_poke_or_trainer_picture: @ 818D1EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r1, [sp, 0xC] + str r2, [sp, 0x10] + ldr r1, [sp, 0x50] + ldr r2, [sp, 0x54] + ldr r4, [sp, 0x58] + ldr r5, [sp, 0x5C] + ldr r6, [sp, 0x60] + ldr r7, [sp, 0x64] + mov r8, r7 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x18] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x20] + lsls r5, 16 + lsrs r5, 16 + mov r10, r5 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + mov r0, r8 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, _0818D284 + ldrb r0, [r1, 0xB] + cmp r0, 0 + beq _0818D25C +_0818D244: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bhi _0818D25C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xB] + cmp r0, 0 + bne _0818D244 +_0818D25C: + cmp r4, 0x8 + beq _0818D280 + movs r0, 0x80 + lsls r0, 6 + bl malloc + adds r7, r0, 0 + cmp r7, 0 + beq _0818D280 + movs r0, 0x20 + bl malloc + mov r8, r0 + cmp r0, 0 + bne _0818D28C + adds r0, r7, 0 + bl free +_0818D280: + ldr r0, _0818D288 + b _0818D356 + .align 2, 0 +_0818D284: .4byte 0x0203cd04 +_0818D288: .4byte 0x0000ffff +_0818D28C: + mov r1, r9 + str r1, [sp] + str r5, [sp, 0x4] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x10] + ldr r2, [sp, 0x14] + adds r3, r7, 0 + bl load_pokemon_image_TODO + lsls r0, 16 + cmp r0, 0 + bne _0818D280 + lsls r2, r4, 1 + str r2, [sp, 0x2C] + ldr r5, _0818D368 + ldr r0, _0818D36C + mov r12, r0 + ldr r1, [sp, 0x18] + lsls r1, 16 + str r1, [sp, 0x24] + ldr r2, [sp, 0x1C] + lsls r2, 16 + str r2, [sp, 0x28] + movs r3, 0x80 + lsls r3, 4 + mov r0, r8 + adds r1, r7, 0 + adds r6, r3, 0 + movs r2, 0x3 +_0818D2C6: + str r1, [r0] + strh r3, [r0, 0x4] + adds r0, 0x8 + adds r1, r6 + subs r2, 0x1 + cmp r2, 0 + bge _0818D2C6 + ldr r0, _0818D370 + strh r0, [r5] + mov r0, r12 + str r0, [r5, 0x4] + mov r0, r9 + bl uns_builder_assign_animtable1 + mov r1, r8 + str r1, [r5, 0xC] + ldr r0, _0818D374 + str r0, [r5, 0x10] + ldr r0, _0818D378 + str r0, [r5, 0x14] + mov r2, r10 + str r2, [sp] + mov r0, r9 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x20] + bl sub_818D0C4 + ldr r2, [sp, 0x24] + asrs r1, r2, 16 + ldr r0, [sp, 0x28] + asrs r2, r0, 16 + adds r0, r5, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, _0818D370 + cmp r10, r0 + bne _0818D336 + ldr r0, _0818D37C + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r2, [sp, 0x20] + lsls r3, r2, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0818D336: + ldr r1, _0818D380 + ldr r2, [sp, 0x2C] + adds r0, r2, r4 + lsls r0, 2 + adds r2, r0, r1 + str r7, [r2] + adds r1, 0x4 + adds r0, r1 + mov r7, r8 + str r7, [r0] + mov r0, r10 + strh r0, [r2, 0x8] + strb r6, [r2, 0xA] + movs r0, 0x1 + strb r0, [r2, 0xB] + adds r0, r6, 0 +_0818D356: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818D368: .4byte 0x0203ccec +_0818D36C: .4byte 0x0860b064 +_0818D370: .4byte 0x0000ffff +_0818D374: .4byte 0x082ec6a8 +_0818D378: .4byte nullsub_122 + 1 +_0818D37C: .4byte 0x02020630 +_0818D380: .4byte 0x0203cd04 + thumb_func_end oamt_spawn_poke_or_trainer_picture + + thumb_func_start sub_818D384 +sub_818D384: @ 818D384 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r6, [sp, 0x3C] + ldr r7, [sp, 0x40] + mov r8, r7 + ldr r7, [sp, 0x44] + mov r9, r7 + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + mov r7, r8 + lsls r7, 16 + lsrs r7, 16 + mov r8, r7 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r4, r8 + str r4, [sp, 0xC] + str r7, [sp, 0x10] + movs r4, 0 + str r4, [sp, 0x14] + bl oamt_spawn_poke_or_trainer_picture + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D384 + + thumb_func_start sub_818D3E4 +sub_818D3E4: @ 818D3E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r1, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, [sp, 0x4C] + ldr r2, [sp, 0x50] + ldr r4, [sp, 0x54] + ldr r5, [sp, 0x58] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x10] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 16 + lsrs r5, 16 + str r5, [sp, 0x1C] + movs r5, 0 + ldr r1, _0818D464 + ldrb r0, [r1, 0xB] + cmp r0, 0 + beq _0818D440 +_0818D428: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bhi _0818D440 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xB] + cmp r0, 0 + bne _0818D428 +_0818D440: + cmp r5, 0x8 + beq _0818D47C + movs r0, 0x80 + lsls r0, 6 + bl malloc + adds r7, r0, 0 + cmp r7, 0 + beq _0818D47C + movs r0, 0x80 + ands r0, r6 + cmp r0, 0 + beq _0818D468 + movs r0, 0x7F + ands r6, r0 + movs r0, 0x3 + mov r9, r0 + b _0818D46A + .align 2, 0 +_0818D464: .4byte 0x0203cd04 +_0818D468: + mov r9, r6 +_0818D46A: + movs r0, 0x20 + bl malloc + mov r8, r0 + cmp r0, 0 + bne _0818D484 + adds r0, r7, 0 + bl free +_0818D47C: + ldr r0, _0818D480 + b _0818D588 + .align 2, 0 +_0818D480: .4byte 0x0000ffff +_0818D484: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r7, 0 + bl load_pokemon_image_TODO + lsls r0, 16 + cmp r0, 0 + bne _0818D47C + lsls r1, r5, 1 + str r1, [sp, 0x28] + ldr r4, _0818D4E8 + mov r2, r10 + lsls r2, 2 + mov r12, r2 + ldr r0, [sp, 0x10] + lsls r0, 16 + str r0, [sp, 0x20] + ldr r1, [sp, 0x14] + lsls r1, 16 + str r1, [sp, 0x24] + movs r3, 0x80 + lsls r3, 4 + mov r0, r8 + adds r1, r7, 0 + adds r6, r3, 0 + movs r2, 0x3 +_0818D4C0: + str r1, [r0] + strh r3, [r0, 0x4] + adds r0, 0x8 + adds r1, r6 + subs r2, 0x1 + cmp r2, 0 + bge _0818D4C0 + ldr r0, _0818D4EC + strh r0, [r4] + ldr r0, _0818D4F0 + add r0, r12 + ldr r0, [r0] + str r0, [r4, 0x8] + mov r2, r8 + str r2, [r4, 0xC] + mov r0, r9 + cmp r0, 0x1 + bne _0818D4F8 + ldr r0, _0818D4F4 + b _0818D500 + .align 2, 0 +_0818D4E8: .4byte 0x0203ccec +_0818D4EC: .4byte 0x0000ffff +_0818D4F0: .4byte 0x08309aac +_0818D4F4: .4byte 0x082ff694 +_0818D4F8: + mov r1, r9 + cmp r1, 0 + bne _0818D510 + ldr r0, _0818D508 +_0818D500: + str r0, [r4, 0x10] + ldr r0, _0818D50C + str r0, [r4, 0x4] + b _0818D518 + .align 2, 0 +_0818D508: .4byte 0x082ff618 +_0818D50C: .4byte 0x0860b06c +_0818D510: + ldr r0, _0818D598 + str r0, [r4, 0x4] + ldr r0, _0818D59C + str r0, [r4, 0x10] +_0818D518: + ldr r2, _0818D5A0 + str r2, [r4, 0x14] + ldr r0, [sp, 0x1C] + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + mov r0, r10 + ldr r1, [sp, 0x8] + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x18] + bl sub_818D0C4 + ldr r2, [sp, 0x20] + asrs r1, r2, 16 + ldr r0, [sp, 0x24] + asrs r2, r0, 16 + adds r0, r4, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, _0818D5A4 + ldr r1, [sp, 0x1C] + cmp r1, r0 + bne _0818D566 + ldr r0, _0818D5A8 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r2, [sp, 0x18] + lsls r3, r2, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0818D566: + ldr r1, _0818D5AC + ldr r2, [sp, 0x28] + adds r0, r2, r5 + lsls r0, 2 + adds r2, r0, r1 + str r7, [r2] + adds r1, 0x4 + adds r0, r1 + mov r1, r8 + str r1, [r0] + mov r0, sp + ldrh r0, [r0, 0x1C] + strh r0, [r2, 0x8] + strb r6, [r2, 0xA] + movs r0, 0x1 + strb r0, [r2, 0xB] + adds r0, r6, 0 +_0818D588: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818D598: .4byte 0x0860b064 +_0818D59C: .4byte 0x082ec6a8 +_0818D5A0: .4byte nullsub_122 + 1 +_0818D5A4: .4byte 0x0000ffff +_0818D5A8: .4byte 0x02020630 +_0818D5AC: .4byte 0x0203cd04 + thumb_func_end sub_818D3E4 + + thumb_func_start sub_818D5B0 +sub_818D5B0: @ 818D5B0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r4, r0, 16 + movs r2, 0 + ldr r0, _0818D5E8 + ldrb r1, [r0, 0xA] + adds r3, r0, 0 + cmp r1, r4 + beq _0818D5E0 + adds r1, r3, 0 +_0818D5C8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bhi _0818D5E0 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xA] + cmp r0, r4 + bne _0818D5C8 +_0818D5E0: + cmp r2, 0x8 + bne _0818D5F0 + ldr r0, _0818D5EC + b _0818D646 + .align 2, 0 +_0818D5E8: .4byte 0x0203cd04 +_0818D5EC: .4byte 0x0000ffff +_0818D5F0: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r3 + ldr r1, [r5] + mov r8, r1 + adds r1, r3, 0x4 + adds r0, r1 + ldr r7, [r0] + ldrh r1, [r5, 0x8] + ldr r0, _0818D650 + lsls r6, r4, 4 + cmp r1, r0 + beq _0818D624 + ldr r1, _0818D654 + adds r0, r6, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + bl gpu_pal_tag_by_index + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_free_tag +_0818D624: + adds r0, r6, r4 + lsls r0, 2 + ldr r1, _0818D654 + adds r0, r1 + bl obj_delete_and_free_tiles + mov r0, r8 + bl free + adds r0, r7, 0 + bl free + adds r1, r5, 0 + ldr r0, _0818D658 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0 +_0818D646: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818D650: .4byte 0x0000ffff +_0818D654: .4byte 0x02020630 +_0818D658: .4byte 0x0860b058 + thumb_func_end sub_818D5B0 + + thumb_func_start sub_818D65C +sub_818D65C: @ 818D65C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r9, r1 + adds r7, r2, 0 + adds r4, r3, 0 + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x28] + lsls r0, 16 + lsrs r5, r0, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r2, 0 + movs r1, 0x7 + bl Window_GetField + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_818D09C + lsls r0, 16 + cmp r0, 0 + bne _0818D6B8 + str r6, [sp] + adds r0, r5, 0 + mov r1, r9 + adds r2, r7, 0 + mov r3, r8 + bl sub_818D180 + movs r0, 0 + b _0818D6BA +_0818D6B8: + ldr r0, _0818D6C8 +_0818D6BA: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818D6C8: .4byte 0x0000ffff + thumb_func_end sub_818D65C + + thumb_func_start sub_818D6CC +sub_818D6CC: @ 818D6CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp, 0x18] + str r2, [sp, 0x1C] + ldr r1, [sp, 0x44] + ldr r2, [sp, 0x48] + ldr r4, [sp, 0x4C] + ldr r5, [sp, 0x50] + ldr r6, [sp, 0x54] + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x20] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x80 + lsls r0, 6 + bl malloc + adds r4, r0, 0 + cmp r4, 0 + beq _0818D762 + str r6, [sp] + mov r0, r9 + ldr r1, [sp, 0x1C] + adds r2, r7, 0 + adds r3, r4, 0 + bl sub_818D09C + lsls r0, 16 + cmp r0, 0 + bne _0818D762 + movs r0, 0x40 + str r0, [sp] + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + mov r1, r8 + str r1, [sp, 0xC] + str r0, [sp, 0x10] + str r0, [sp, 0x14] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl Window_CopyPixelRectToWindow + str r6, [sp] + mov r0, r9 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + ldr r3, [sp, 0x20] + bl sub_818D180 + adds r0, r4, 0 + bl free + movs r0, 0 + b _0818D764 +_0818D762: + ldr r0, _0818D774 +_0818D764: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818D774: .4byte 0x0000ffff + thumb_func_end sub_818D6CC + + thumb_func_start sub_818D778 +sub_818D778: @ 818D778 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r6, [sp, 0x3C] + ldr r7, [sp, 0x40] + mov r8, r7 + ldr r7, [sp, 0x44] + mov r9, r7 + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + mov r7, r8 + lsls r7, 16 + lsrs r7, 16 + mov r8, r7 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r4, r8 + str r4, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + str r7, [sp, 0x14] + bl oamt_spawn_poke_or_trainer_picture + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D778 + + thumb_func_start sub_818D7D8 +sub_818D7D8: @ 818D7D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r7, 16 + lsrs r7, 16 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + bl sub_818D778 + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D7D8 + + thumb_func_start sub_818D820 +sub_818D820: @ 818D820 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_818D5B0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_818D820 + + thumb_func_start sub_818D834 +sub_818D834: @ 818D834 + push {r4,r5,lr} + sub sp, 0xC + ldr r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + bl sub_818D65C + lsls r0, 16 + lsrs r0, 16 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818D834 + + thumb_func_start sub_818D864 +sub_818D864: @ 818D864 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r7, 24 + lsrs r7, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + bl sub_818D6CC + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D864 + + thumb_func_start sub_818D8AC +sub_818D8AC: @ 818D8AC + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r1, 0 + ldr r1, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r0, 16 + lsrs r0, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r2, 16 + asrs r2, 16 + str r2, [sp] + lsls r3, 16 + asrs r3, 16 + str r3, [sp, 0x4] + str r1, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0x1 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_818D384 + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818D8AC + + thumb_func_start sub_818D8F0 +sub_818D8F0: @ 818D8F0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_818D5B0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_818D8F0 + + thumb_func_start sub_818D904 +sub_818D904: @ 818D904 + push {r4,lr} + sub sp, 0xC + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + adds r3, r4, 0 + bl sub_818D65C + lsls r0, 16 + lsrs r0, 16 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_818D904 + + thumb_func_start sub_818D938 +sub_818D938: @ 818D938 + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r1, 0 + ldr r1, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r0, 16 + lsrs r0, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r2, [sp] + str r3, [sp, 0x4] + str r1, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0x1 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_818D6CC + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818D938 + + thumb_func_start sub_818D97C +sub_818D97C: @ 818D97C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + bne _0818D9A2 + cmp r0, 0 + beq _0818D99C + ldr r0, _0818D998 + adds r0, 0x3F + ldrb r0, [r0] + b _0818D9A2 + .align 2, 0 +_0818D998: .4byte 0x0831f578 +_0818D99C: + ldr r0, _0818D9A8 + adds r0, 0x3C + ldrb r0, [r0] +_0818D9A2: + pop {r1} + bx r1 + .align 2, 0 +_0818D9A8: .4byte 0x0831f578 + thumb_func_end sub_818D97C + + thumb_func_start sub_818D9AC +sub_818D9AC: @ 818D9AC + ldr r0, _0818D9B8 + ldr r0, [r0] + ldr r1, _0818D9BC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0818D9B8: .4byte 0x03005d8c +_0818D9BC: .4byte 0x00003b58 + thumb_func_end sub_818D9AC + + thumb_func_start sub_818D9C0 +sub_818D9C0: @ 818D9C0 + push {r4,r5,lr} + ldr r5, _0818DA04 + ldr r4, _0818DA08 + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r1, [r0] + adds r0, r5, 0 + bl var_set + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0818DA20 + ldr r0, _0818DA0C + ldr r1, [r0] + ldr r0, _0818DA10 + adds r1, r0 + ldr r0, _0818DA14 + ldr r2, _0818DA18 + ldrb r1, [r1, 0xD] + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + bl var_set + ldr r1, _0818DA1C + movs r0, 0x1 + b _0818DA24 + .align 2, 0 +_0818DA04: .4byte 0x00004010 +_0818DA08: .4byte 0x0860b07e +_0818DA0C: .4byte 0x03005d8c +_0818DA10: .4byte 0x00003b58 +_0818DA14: .4byte 0x00004011 +_0818DA18: .4byte 0x0860b074 +_0818DA1C: .4byte 0x020375f0 +_0818DA20: + ldr r1, _0818DA2C + movs r0, 0 +_0818DA24: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818DA2C: .4byte 0x020375f0 + thumb_func_end sub_818D9C0 + + thumb_func_start sub_818DA30 +sub_818DA30: @ 818DA30 + push {lr} + ldr r0, _0818DA58 + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 17 + adds r1, r0, 0 + cmp r0, 0x1 + beq _0818DA68 + cmp r0, 0x1 + bgt _0818DA5C + cmp r0, 0 + beq _0818DA62 + b _0818DA72 + .align 2, 0 +_0818DA58: .4byte 0x03005d90 +_0818DA5C: + cmp r1, 0x2 + beq _0818DA6E + b _0818DA72 +_0818DA62: + bl sub_818DF68 + b _0818DA72 +_0818DA68: + bl sub_818DB7C + b _0818DA72 +_0818DA6E: + bl sub_818E638 +_0818DA72: + pop {r0} + bx r0 + thumb_func_end sub_818DA30 + + thumb_func_start sub_818DA78 +sub_818DA78: @ 818DA78 + push {lr} + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0818DA9C + cmp r0, 0x1 + bgt _0818DA90 + cmp r0, 0 + beq _0818DA96 + b _0818DAA6 +_0818DA90: + cmp r0, 0x2 + beq _0818DAA2 + b _0818DAA6 +_0818DA96: + bl sub_818E004 + b _0818DAA6 +_0818DA9C: + bl sub_818DBC4 + b _0818DAA6 +_0818DAA2: + bl sub_818E674 +_0818DAA6: + pop {r0} + bx r0 + thumb_func_end sub_818DA78 + + thumb_func_start sub_818DAAC +sub_818DAAC: @ 818DAAC + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _0818DADC + cmp r0, 0x1 + bgt _0818DAD0 + cmp r0, 0 + beq _0818DAD6 + b _0818DAE6 +_0818DAD0: + cmp r1, 0x2 + beq _0818DAE2 + b _0818DAE6 +_0818DAD6: + bl sub_818DF68 + b _0818DAE6 +_0818DADC: + bl sub_818DB7C + b _0818DAE6 +_0818DAE2: + bl sub_818E638 +_0818DAE6: + pop {r0} + bx r0 + thumb_func_end sub_818DAAC + + thumb_func_start sub_818DAEC +sub_818DAEC: @ 818DAEC + push {r4,lr} + ldr r4, _0818DB00 + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818DB00: .4byte 0x020375f0 + thumb_func_end sub_818DAEC + + thumb_func_start sub_818DB04 +sub_818DB04: @ 818DB04 + push {lr} + adds r1, r0, 0 + movs r2, 0 + b _0818DB14 +_0818DB0C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x2 +_0818DB14: + ldrh r0, [r1] + cmp r0, 0 + bne _0818DB0C + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_818DB04 + + thumb_func_start sub_818DB20 +sub_818DB20: @ 818DB20 + push {r4-r6,lr} + bl GenerateRandomNumber + ldr r5, _0818DB74 + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + strb r0, [r4, 0xC] + ldr r6, _0818DB78 + ldr r0, [r5] + ldrb r0, [r0, 0xC] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + bl sub_818DB04 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + ldr r2, [r5] + ldrb r1, [r2, 0xC] + lsls r1, 2 + adds r1, r6 + ldr r1, [r1] + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818DB74: .4byte 0x0203cd64 +_0818DB78: .4byte 0x0860b2ec + thumb_func_end sub_818DB20 + + thumb_func_start sub_818DB7C +sub_818DB7C: @ 818DB7C + push {lr} + ldr r2, _0818DBB4 + ldr r0, _0818DBB8 + ldr r0, [r0] + ldr r1, _0818DBBC + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + ldr r1, [r2] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r2] + strb r3, [r0, 0x2] + ldr r0, [r2] + strb r3, [r0, 0x3] + ldr r1, [r2] + strh r3, [r1, 0xE] + ldr r0, _0818DBC0 + ldrb r0, [r0] + strb r0, [r1, 0x12] + bl sub_818DB20 + pop {r0} + bx r0 + .align 2, 0 +_0818DBB4: .4byte 0x0203cd64 +_0818DBB8: .4byte 0x03005d8c +_0818DBBC: .4byte 0x00003b58 +_0818DBC0: .4byte 0x082e9531 + thumb_func_end sub_818DB7C + + thumb_func_start sub_818DBC4 +sub_818DBC4: @ 818DBC4 + ldr r3, _0818DBDC + ldr r0, _0818DBE0 + ldr r0, [r0] + ldr r1, _0818DBE4 + adds r0, r1 + str r0, [r3] + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + strb r2, [r0, 0x1] + bx lr + .align 2, 0 +_0818DBDC: .4byte 0x0203cd64 +_0818DBE0: .4byte 0x03005d8c +_0818DBE4: .4byte 0x00003b58 + thumb_func_end sub_818DBC4 + + thumb_func_start sub_818DBE8 +sub_818DBE8: @ 818DBE8 + push {lr} + ldr r1, _0818DC00 + ldr r0, _0818DC04 + ldr r0, [r0] + ldr r2, _0818DC08 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0818DC0C + movs r0, 0x2 + b _0818DC16 + .align 2, 0 +_0818DC00: .4byte 0x0203cd64 +_0818DC04: .4byte 0x03005d8c +_0818DC08: .4byte 0x00003b58 +_0818DC0C: + cmp r0, 0x1 + beq _0818DC14 + movs r0, 0 + b _0818DC16 +_0818DC14: + movs r0, 0x1 +_0818DC16: + pop {r1} + bx r1 + thumb_func_end sub_818DBE8 + + thumb_func_start sub_818DC1C +sub_818DC1C: @ 818DC1C + lsls r0, 24 + ldr r1, _0818DC28 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0818DC28: .4byte 0x0860b224 + thumb_func_end sub_818DC1C + + thumb_func_start sub_818DC2C +sub_818DC2C: @ 818DC2C + push {r4,lr} + ldr r1, _0818DC50 + ldr r0, _0818DC54 + ldr r0, [r0] + ldr r2, _0818DC58 + adds r0, r2 + str r0, [r1] + ldr r4, _0818DC5C + ldrb r0, [r0, 0xC] + bl sub_818DC1C + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818DC50: .4byte 0x0203cd64 +_0818DC54: .4byte 0x03005d8c +_0818DC58: .4byte 0x00003b58 +_0818DC5C: .4byte 0x02021cc4 + thumb_func_end sub_818DC2C + + thumb_func_start sub_818DC60 +sub_818DC60: @ 818DC60 + push {r4,r5,lr} + ldr r5, _0818DC78 + ldr r0, _0818DC7C + ldr r1, [r0] + ldr r2, _0818DC80 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x4] + cmp r0, 0xFF + bne _0818DC84 + movs r0, 0 + b _0818DC9C + .align 2, 0 +_0818DC78: .4byte 0x0203cd64 +_0818DC7C: .4byte 0x03005d8c +_0818DC80: .4byte 0x00003b58 +_0818DC84: + ldr r4, _0818DCA4 + ldr r0, _0818DCA8 + adds r1, r0 + adds r0, r4, 0 + bl strcpy_limit_7_chars + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl sub_8009308 + movs r0, 0x1 +_0818DC9C: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0818DCA4: .4byte 0x02021ec4 +_0818DCA8: .4byte 0x00003b5c + thumb_func_end sub_818DC60 + + thumb_func_start sub_818DCAC +sub_818DCAC: @ 818DCAC + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818DCAC + + thumb_func_start sub_818DCC8 +sub_818DCC8: @ 818DCC8 + push {lr} + ldr r2, _0818DCE4 + ldr r0, _0818DCE8 + ldr r1, [r0] + ldr r0, _0818DCEC + adds r1, r0 + str r1, [r2] + ldr r0, _0818DCF0 + ldrh r1, [r1, 0xE] + bl sub_818DCAC + pop {r0} + bx r0 + .align 2, 0 +_0818DCE4: .4byte 0x0203cd64 +_0818DCE8: .4byte 0x03005d8c +_0818DCEC: .4byte 0x00003b58 +_0818DCF0: .4byte 0x02021dc4 + thumb_func_end sub_818DCC8 + + thumb_func_start sub_818DCF4 +sub_818DCF4: @ 818DCF4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0x8 + bl memset + adds r0, r4, 0 + adds r1, r5, 0 + bl strcpy_limit_7_chars + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818DCF4 + + thumb_func_start sub_818DD14 +sub_818DD14: @ 818DD14 + push {r4,r5,lr} + ldr r5, _0818DD40 + ldr r0, _0818DD44 + ldr r0, [r0] + ldr r2, _0818DD48 + adds r1, r0, r2 + str r1, [r5] + ldr r1, _0818DD4C + adds r0, r1 + ldr r4, _0818DD50 + adds r1, r4, 0 + bl sub_818DCF4 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl sub_8009308 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818DD40: .4byte 0x0203cd64 +_0818DD44: .4byte 0x03005d8c +_0818DD48: .4byte 0x00003b58 +_0818DD4C: .4byte 0x00003b5c +_0818DD50: .4byte 0x02021ec4 + thumb_func_end sub_818DD14 + + thumb_func_start sub_818DD54 +sub_818DD54: @ 818DD54 + ldr r1, _0818DD6C + ldr r0, _0818DD70 + ldr r0, [r0] + ldr r2, _0818DD74 + adds r0, r2 + str r0, [r1] + ldrb r1, [r0, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_0818DD6C: .4byte 0x0203cd64 +_0818DD70: .4byte 0x03005d8c +_0818DD74: .4byte 0x00003b58 + thumb_func_end sub_818DD54 + + thumb_func_start sub_818DD78 +sub_818DD78: @ 818DD78 + push {lr} + bl sub_81AAC50 + pop {r0} + bx r0 + thumb_func_end sub_818DD78 + + thumb_func_start sub_818DD84 +sub_818DD84: @ 818DD84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, _0818DE0C + ldr r0, _0818DE10 + ldr r0, [r0] + ldr r1, _0818DE14 + adds r0, r1 + str r0, [r4] + ldr r1, _0818DE18 + mov r8, r1 + ldrb r0, [r0, 0xC] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + bl sub_818DB04 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, _0818DE1C + adds r1, r5, 0 + bl sub_818DCAC + ldr r1, [r4] + strh r5, [r1, 0xE] + ldr r0, _0818DE20 + ldr r0, [r0] + adds r1, 0x4 + bl sub_818DCF4 + ldr r1, [r4] + ldr r0, _0818DE24 + ldrb r0, [r0] + strb r0, [r1, 0x12] + movs r7, 0 + movs r3, 0 + cmp r7, r6 + bcs _0818DE36 + mov r12, r8 +_0818DDDC: + ldr r2, [r4] + ldrb r0, [r2, 0xC] + lsls r0, 2 + add r0, r12 + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _0818DE28 + movs r7, 0x1 + ldrb r0, [r2, 0x3] + adds r0, 0x1 + strb r0, [r2, 0x3] + ldr r0, [r4] + strb r7, [r0, 0x2] + ldr r1, [r4] + ldrh r0, [r1, 0x10] + cmp r0, r5 + bne _0818DE36 + movs r0, 0x5 + strb r0, [r1, 0x3] + b _0818DE36 + .align 2, 0 +_0818DE0C: .4byte 0x0203cd64 +_0818DE10: .4byte 0x03005d8c +_0818DE14: .4byte 0x00003b58 +_0818DE18: .4byte 0x0860b2ec +_0818DE1C: .4byte 0x02021dc4 +_0818DE20: .4byte 0x03005d90 +_0818DE24: .4byte 0x082e9531 +_0818DE28: + movs r0, 0 + strb r0, [r2, 0x2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bcc _0818DDDC +_0818DE36: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818DD84 + + thumb_func_start sub_818DE44 +sub_818DE44: @ 818DE44 + push {lr} + ldr r0, _0818DE58 + ldrh r0, [r0] + bl sub_818DD84 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0818DE58: .4byte 0x0203ce7c + thumb_func_end sub_818DE44 + + thumb_func_start sub_818DE5C +sub_818DE5C: @ 818DE5C + push {lr} + ldr r1, _0818DE7C + ldr r0, _0818DE80 + ldr r0, [r0] + ldr r2, _0818DE84 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x3] + movs r1, 0 + cmp r0, 0x4 + bls _0818DE74 + movs r1, 0x1 +_0818DE74: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_0818DE7C: .4byte 0x0203cd64 +_0818DE80: .4byte 0x03005d8c +_0818DE84: .4byte 0x00003b58 + thumb_func_end sub_818DE5C + + thumb_func_start sub_818DE88 +sub_818DE88: @ 818DE88 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _0818DE9C + bl sub_818DCAC + pop {r0} + bx r0 + .align 2, 0 +_0818DE9C: .4byte 0x02021dc4 + thumb_func_end sub_818DE88 + + thumb_func_start sub_818DEA0 +sub_818DEA0: @ 818DEA0 + push {r4,r5,lr} + ldr r5, _0818DECC + ldr r0, _0818DED0 + ldr r0, [r0] + ldr r1, _0818DED4 + adds r0, r1 + str r0, [r5] + ldr r1, _0818DED8 + ldrb r0, [r0, 0xC] + lsls r0, 1 + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + bl sub_818DE88 + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0818DECC: .4byte 0x0203cd64 +_0818DED0: .4byte 0x03005d8c +_0818DED4: .4byte 0x00003b58 +_0818DED8: .4byte 0x0860b304 + thumb_func_end sub_818DEA0 + + thumb_func_start sub_818DEDC +sub_818DEDC: @ 818DEDC + push {lr} + bl sub_818DB7C + ldr r0, _0818DEF0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x1] + pop {r0} + bx r0 + .align 2, 0 +_0818DEF0: .4byte 0x0203cd64 + thumb_func_end sub_818DEDC + + thumb_func_start sub_818DEF4 +sub_818DEF4: @ 818DEF4 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_818DEF4 + + thumb_func_start sub_818DF00 +sub_818DF00: @ 818DF00 + push {r4-r7,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xF + ands r4, r0 + movs r3, 0 + ldr r5, _0818DF58 + ldr r1, _0818DF5C + lsls r0, r4, 2 + adds r6, r0, r1 + adds r7, r5, 0 +_0818DF1A: + ldr r2, [r5] + lsls r1, r3, 1 + adds r2, 0x2 + adds r2, r1 + ldr r0, [r6] + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0818DF1A + ldr r2, [r7] + ldr r0, _0818DF60 + lsls r1, r4, 1 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2, 0x14] + ldr r0, _0818DF64 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2, 0x28] + adds r2, 0x2B + strb r4, [r2] + ldr r1, [r7] + movs r0, 0xFF + strb r0, [r1, 0x18] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818DF58: .4byte 0x0203cd68 +_0818DF5C: .4byte 0x0860b1a4 +_0818DF60: .4byte 0x0860b1e4 +_0818DF64: .4byte 0x0860b204 + thumb_func_end sub_818DF00 + + thumb_func_start sub_818DF68 +sub_818DF68: @ 818DF68 + push {r4-r6,lr} + ldr r2, _0818DFF0 + ldr r0, _0818DFF4 + ldr r0, [r0] + ldr r1, _0818DFF8 + adds r0, r1 + str r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + movs r3, 0 + adds r4, r2, 0 + ldr r6, _0818DFFC + adds r5, r4, 0 + ldr r0, _0818E000 + adds r2, r0, 0 +_0818DF8A: + ldr r1, [r5] + lsls r0, r3, 1 + adds r1, 0x2 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0818DF8A + ldr r0, [r4] + ldr r1, _0818E000 + strh r1, [r0, 0x14] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x16] + movs r3, 0 + adds r5, r4, 0 + movs r2, 0 +_0818DFB4: + ldr r0, [r5] + lsls r1, r3, 1 + adds r0, 0x20 + adds r0, r1 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0818DFB4 + ldr r0, [r4] + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x28] + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x10 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r6] + adds r0, 0x2D + strb r1, [r0] + bl sub_818DF00 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818DFF0: .4byte 0x0203cd68 +_0818DFF4: .4byte 0x03005d8c +_0818DFF8: .4byte 0x00003b58 +_0818DFFC: .4byte 0x082e9531 +_0818E000: .4byte 0x0000ffff + thumb_func_end sub_818DF68 + + thumb_func_start sub_818E004 +sub_818E004: @ 818E004 + ldr r2, _0818E028 + ldr r0, _0818E02C + ldr r0, [r0] + ldr r1, _0818E030 + adds r0, r1 + str r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + adds r0, 0x2A + strb r1, [r0] + ldr r1, [r2] + ldr r0, _0818E034 + strh r0, [r1, 0x16] + bx lr + .align 2, 0 +_0818E028: .4byte 0x0203cd68 +_0818E02C: .4byte 0x03005d8c +_0818E030: .4byte 0x00003b58 +_0818E034: .4byte 0x0000ffff + thumb_func_end sub_818E004 + + thumb_func_start sub_818E038 +sub_818E038: @ 818E038 + push {lr} + ldr r1, _0818E050 + ldr r0, _0818E054 + ldr r0, [r0] + ldr r2, _0818E058 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0818E05C + movs r0, 0x2 + b _0818E066 + .align 2, 0 +_0818E050: .4byte 0x0203cd68 +_0818E054: .4byte 0x03005d8c +_0818E058: .4byte 0x00003b58 +_0818E05C: + cmp r0, 0x1 + beq _0818E064 + movs r0, 0 + b _0818E066 +_0818E064: + movs r0, 0x1 +_0818E066: + pop {r1} + bx r1 + thumb_func_end sub_818E038 + + thumb_func_start sub_818E06C +sub_818E06C: @ 818E06C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _0818E0FC + ldr r4, [r0] + ldr r0, _0818E100 + adds r7, r4, r0 + ldrh r0, [r7, 0x14] + bl sub_811F8D8 + cmp r0, 0 + bne _0818E0EC + ldr r1, _0818E104 + adds r0, r4, r1 + ldrb r5, [r0] + ldr r0, _0818E108 + adds r0, r4 + mov r8, r0 + adds r1, r4 + mov r10, r1 + ldr r6, _0818E10C +_0818E09A: + adds r5, 0x1 + cmp r5, 0xF + ble _0818E0A2 + movs r5, 0 +_0818E0A2: + lsls r4, r5, 1 + adds r0, r4, r6 + ldrh r0, [r0] + bl sub_811F8D8 + cmp r0, 0 + beq _0818E09A + movs r3, 0 + ldr r0, _0818E10C + mov r12, r0 + lsls r1, r5, 2 + ldr r0, _0818E110 + mov r9, r0 + ldr r0, _0818E114 + adds r6, r1, r0 + mov r2, r8 +_0818E0C2: + lsls r0, r3, 1 + ldr r1, [r6] + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x8 + ble _0818E0C2 + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0] + strh r0, [r7, 0x14] + mov r1, r9 + adds r0, r4, r1 + ldrh r0, [r0] + strh r0, [r7, 0x28] + mov r0, r10 + strb r5, [r0] + movs r0, 0xFF + strb r0, [r7, 0x18] +_0818E0EC: + bl sub_818E13C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818E118 + movs r0, 0x2 + b _0818E12C + .align 2, 0 +_0818E0FC: .4byte 0x03005d8c +_0818E100: .4byte 0x00003b58 +_0818E104: .4byte 0x00003b83 +_0818E108: .4byte 0x00003b5a +_0818E10C: .4byte 0x0860b1e4 +_0818E110: .4byte 0x0860b204 +_0818E114: .4byte 0x0860b1a4 +_0818E118: + cmp r0, 0x2 + beq _0818E126 + bl sub_818E1F4 + lsls r0, 24 + cmp r0, 0 + beq _0818E12A +_0818E126: + movs r0, 0x1 + b _0818E12C +_0818E12A: + movs r0, 0 +_0818E12C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818E06C + + thumb_func_start sub_818E13C +sub_818E13C: @ 818E13C + push {r4-r7,lr} + movs r7, 0x1 + ldr r5, _0818E160 + ldr r0, _0818E164 + ldr r1, [r0] + ldr r2, _0818E168 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0xFF + bne _0818E174 + ldr r0, _0818E16C + ldr r1, _0818E170 + bl strcpy_limit_7_chars + movs r7, 0 + b _0818E1DC + .align 2, 0 +_0818E160: .4byte 0x0203cd68 +_0818E164: .4byte 0x03005d8c +_0818E168: .4byte 0x00003b58 +_0818E16C: .4byte 0x02021cc4 +_0818E170: .4byte 0x085eeb7e +_0818E174: + ldr r4, _0818E1E4 + ldr r0, _0818E1E8 + adds r1, r0 + adds r0, r4, 0 + bl strcpy_limit_7_chars + ldr r0, [r5] + adds r0, 0x2D + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8009308 + ldr r0, [r5] + adds r0, 0x18 + bl sub_818E258 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, _0818E1EC + ldr r0, [r6] + bl sub_818E258 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0818E1DC + ldr r0, [r5] + movs r2, 0 + cmp r2, r4 + bcs _0818E1DC + ldr r1, [r6] + ldrb r0, [r0, 0x18] + ldrb r1, [r1] + cmp r0, r1 + bne _0818E1DA +_0818E1BA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcs _0818E1DC + ldr r0, _0818E1F0 + ldr r1, [r0] + adds r1, 0x18 + adds r1, r2 + ldr r0, _0818E1EC + ldr r0, [r0] + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E1BA +_0818E1DA: + movs r7, 0x2 +_0818E1DC: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818E1E4: .4byte 0x02021cc4 +_0818E1E8: .4byte 0x00003b70 +_0818E1EC: .4byte 0x03005d90 +_0818E1F0: .4byte 0x0203cd68 + thumb_func_end sub_818E13C + + thumb_func_start sub_818E1F4 +sub_818E1F4: @ 818E1F4 + push {r4-r6,lr} + ldr r3, _0818E244 + ldr r0, _0818E248 + ldr r1, [r0] + ldr r2, _0818E24C + adds r0, r1, r2 + str r0, [r3] + movs r5, 0 + movs r4, 0 + ldr r0, _0818E250 + adds r1, r0 + ldr r0, _0818E254 + ldr r2, [r0] + ldrh r1, [r1] + adds r6, r3, 0 + adds r3, r0, 0 + ldrb r2, [r2, 0xA] + cmp r1, r2 + bne _0818E23A +_0818E21A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bhi _0818E23C + ldr r1, [r6] + lsls r0, r4, 1 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r3] + adds r0, 0xA + adds r0, r4 + ldrh r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E21A +_0818E23A: + movs r5, 0x1 +_0818E23C: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0818E244: .4byte 0x0203cd68 +_0818E248: .4byte 0x03005d8c +_0818E24C: .4byte 0x00003b58 +_0818E250: .4byte 0x00003b78 +_0818E254: .4byte 0x03005d90 + thumb_func_end sub_818E1F4 + + thumb_func_start sub_818E258 +sub_818E258: @ 818E258 + push {lr} + movs r2, 0 + adds r1, r0, 0 + b _0818E268 +_0818E260: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 +_0818E268: + ldrb r0, [r1] + cmp r0, 0xFF + bne _0818E260 + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_818E258 + + thumb_func_start sub_818E274 +sub_818E274: @ 818E274 + push {r4,lr} + ldr r4, _0818E290 + ldr r0, _0818E294 + ldr r0, [r0] + ldrh r0, [r0, 0x28] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818E290: .4byte 0x02021cc4 +_0818E294: .4byte 0x0203cd68 + thumb_func_end sub_818E274 + + thumb_func_start sub_818E298 +sub_818E298: @ 818E298 + push {r4,lr} + ldr r4, _0818E2B4 + ldr r0, _0818E2B8 + ldr r0, [r0] + ldr r1, _0818E2BC + adds r0, r1 + str r0, [r4] + bl sub_818E13C + lsls r0, 24 + cmp r0, 0 + beq _0818E2C0 + movs r0, 0 + b _0818E2CC + .align 2, 0 +_0818E2B4: .4byte 0x0203cd68 +_0818E2B8: .4byte 0x03005d8c +_0818E2BC: .4byte 0x00003b58 +_0818E2C0: + ldr r0, [r4] + ldr r1, _0818E2D4 + ldrb r1, [r1] + adds r0, 0x2D + strb r1, [r0] + movs r0, 0x1 +_0818E2CC: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0818E2D4: .4byte 0x082e9531 + thumb_func_end sub_818E298 + + thumb_func_start sub_818E2D8 +sub_818E2D8: @ 818E2D8 + ldr r2, _0818E2EC + ldr r0, _0818E2F0 + ldr r0, [r0] + ldr r3, _0818E2F4 + adds r1, r0, r3 + str r1, [r2] + ldr r1, _0818E2F8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0818E2EC: .4byte 0x0203cd68 +_0818E2F0: .4byte 0x03005d8c +_0818E2F4: .4byte 0x00003b58 +_0818E2F8: .4byte 0x00003b82 + thumb_func_end sub_818E2D8 + + thumb_func_start sub_818E2FC +sub_818E2FC: @ 818E2FC + push {lr} + bl sub_811A4F0 + pop {r0} + bx r0 + thumb_func_end sub_818E2FC + + thumb_func_start sub_818E308 +sub_818E308: @ 818E308 + push {r4-r6,lr} + ldr r5, _0818E344 + ldr r0, _0818E348 + ldr r0, [r0] + ldr r1, _0818E34C + adds r0, r1 + str r0, [r5] + ldr r6, _0818E350 + ldrh r1, [r0, 0x14] + adds r0, r6, 0 + bl sub_811EBBC + ldr r4, _0818E354 + ldr r0, [r5] + ldrh r1, [r0, 0x16] + adds r0, r4, 0 + bl sub_811EBBC + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8008C44 + movs r1, 0 + cmp r0, 0 + bne _0818E33C + movs r1, 0x1 +_0818E33C: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0818E344: .4byte 0x0203cd68 +_0818E348: .4byte 0x03005d8c +_0818E34C: .4byte 0x00003b58 +_0818E350: .4byte 0x02021cc4 +_0818E354: .4byte 0x02021dc4 + thumb_func_end sub_818E308 + + thumb_func_start sub_818E358 +sub_818E358: @ 818E358 + ldr r1, _0818E36C + ldr r0, _0818E370 + ldr r0, [r0] + ldr r2, _0818E374 + adds r0, r2 + str r0, [r1] + ldr r1, _0818E378 + ldrh r0, [r0, 0x28] + strh r0, [r1] + bx lr + .align 2, 0 +_0818E36C: .4byte 0x0203cd68 +_0818E370: .4byte 0x03005d8c +_0818E374: .4byte 0x00003b58 +_0818E378: .4byte 0x020375e2 + thumb_func_end sub_818E358 + + thumb_func_start sub_818E37C +sub_818E37C: @ 818E37C + ldr r1, _0818E390 + ldr r0, _0818E394 + ldr r0, [r0] + ldr r2, _0818E398 + adds r0, r2 + str r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .align 2, 0 +_0818E390: .4byte 0x0203cd68 +_0818E394: .4byte 0x03005d8c +_0818E398: .4byte 0x00003b58 + thumb_func_end sub_818E37C + + thumb_func_start sub_818E39C +sub_818E39C: @ 818E39C + ldr r1, _0818E3B0 + ldr r0, _0818E3B4 + ldr r0, [r0] + ldr r2, _0818E3B8 + adds r0, r2 + str r0, [r1] + movs r1, 0x2 + strb r1, [r0, 0x1] + bx lr + .align 2, 0 +_0818E3B0: .4byte 0x0203cd68 +_0818E3B4: .4byte 0x03005d8c +_0818E3B8: .4byte 0x00003b58 + thumb_func_end sub_818E39C + + thumb_func_start sub_818E3BC +sub_818E3BC: @ 818E3BC + ldr r1, _0818E3D0 + ldr r0, _0818E3D4 + ldr r0, [r0] + ldr r2, _0818E3D8 + adds r0, r2 + str r0, [r1] + ldr r1, _0818E3DC + strh r1, [r0, 0x16] + bx lr + .align 2, 0 +_0818E3D0: .4byte 0x0203cd68 +_0818E3D4: .4byte 0x03005d8c +_0818E3D8: .4byte 0x00003b58 +_0818E3DC: .4byte 0x0000ffff + thumb_func_end sub_818E3BC + + thumb_func_start sub_818E3E0 +sub_818E3E0: @ 818E3E0 + push {lr} + bl sub_81AAC70 + pop {r0} + bx r0 + thumb_func_end sub_818E3E0 + + thumb_func_start sub_818E3EC +sub_818E3EC: @ 818E3EC + push {r4,lr} + ldr r4, _0818E410 + ldr r0, _0818E414 + ldr r0, [r0] + ldr r1, _0818E418 + adds r0, r1 + str r0, [r4] + bl sub_818E298 + lsls r0, 24 + cmp r0, 0 + beq _0818E41C + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x2B + ldrb r1, [r1] + adds r0, 0x2C + b _0818E422 + .align 2, 0 +_0818E410: .4byte 0x0203cd68 +_0818E414: .4byte 0x03005d8c +_0818E418: .4byte 0x00003b58 +_0818E41C: + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x10 +_0818E422: + strb r1, [r0] + bl sub_818DF00 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818E3EC + + thumb_func_start sub_818E430 +sub_818E430: @ 818E430 + push {r4,r5,lr} + ldr r1, _0818E46C + ldr r0, _0818E470 + ldr r0, [r0] + ldr r2, _0818E474 + adds r0, r2 + str r0, [r1] + movs r2, 0 + adds r5, r1, 0 + adds r4, r5, 0 + ldr r0, _0818E478 + adds r3, r0, 0 +_0818E448: + ldr r1, [r4] + lsls r0, r2, 1 + adds r1, 0x2 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bls _0818E448 + ldr r1, [r5] + ldr r0, _0818E478 + strh r0, [r1, 0x14] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818E46C: .4byte 0x0203cd68 +_0818E470: .4byte 0x03005d8c +_0818E474: .4byte 0x00003b58 +_0818E478: .4byte 0x0000ffff + thumb_func_end sub_818E430 + + thumb_func_start sub_818E47C +sub_818E47C: @ 818E47C + push {lr} + ldr r1, _0818E48C + movs r0, 0x11 + strh r0, [r1] + bl sub_811A4F0 + pop {r0} + bx r0 + .align 2, 0 +_0818E48C: .4byte 0x020375e0 + thumb_func_end sub_818E47C + + thumb_func_start sub_818E490 +sub_818E490: @ 818E490 + push {lr} + ldr r0, _0818E4A0 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 + pop {r0} + bx r0 + .align 2, 0 +_0818E4A0: .4byte 0x0203ce7c + thumb_func_end sub_818E490 + + thumb_func_start sub_818E4A4 +sub_818E4A4: @ 818E4A4 + push {r4-r6,lr} + ldr r2, _0818E4F8 + ldr r0, _0818E4FC + ldr r0, [r0] + ldr r1, _0818E500 + adds r0, r1 + str r0, [r2] + ldr r1, _0818E504 + ldrh r1, [r1] + strh r1, [r0, 0x28] + movs r3, 0 + adds r4, r2, 0 + ldr r6, _0818E508 + adds r5, r4, 0 + adds r2, r6, 0 +_0818E4C2: + ldr r1, [r5] + lsls r0, r3, 1 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r2] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0818E4C2 + ldr r0, [r4] + adds r0, 0x18 + ldr r1, [r6] + bl strcpy_limit_7_chars + ldr r0, [r4] + ldr r1, _0818E50C + ldrb r1, [r1] + adds r0, 0x2D + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818E4F8: .4byte 0x0203cd68 +_0818E4FC: .4byte 0x03005d8c +_0818E500: .4byte 0x00003b58 +_0818E504: .4byte 0x0203ce7c +_0818E508: .4byte 0x03005d90 +_0818E50C: .4byte 0x082e9531 + thumb_func_end sub_818E4A4 + + thumb_func_start sub_818E510 +sub_818E510: @ 818E510 + ldr r2, _0818E528 + ldr r0, _0818E52C + ldr r0, [r0] + ldr r3, _0818E530 + adds r1, r0, r3 + str r1, [r2] + ldr r1, _0818E534 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_0818E528: .4byte 0x0203cd68 +_0818E52C: .4byte 0x03005d8c +_0818E530: .4byte 0x00003b58 +_0818E534: .4byte 0x00003b82 + thumb_func_end sub_818E510 + + thumb_func_start sub_818E538 +sub_818E538: @ 818E538 + push {lr} + ldr r2, _0818E554 + ldr r0, _0818E558 + ldr r1, [r0] + ldr r0, _0818E55C + adds r1, r0 + str r1, [r2] + ldr r0, _0818E560 + ldrh r1, [r1, 0x14] + bl sub_811EBBC + pop {r0} + bx r0 + .align 2, 0 +_0818E554: .4byte 0x0203cd68 +_0818E558: .4byte 0x03005d8c +_0818E55C: .4byte 0x00003b58 +_0818E560: .4byte 0x02021ec4 + thumb_func_end sub_818E538 + + thumb_func_start sub_818E564 +sub_818E564: @ 818E564 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_818E564 + + thumb_func_start sub_818E570 +sub_818E570: @ 818E570 + push {r4-r7,lr} + ldr r2, _0818E5F4 + ldr r1, _0818E5F8 + ldr r1, [r1] + ldr r4, _0818E5FC + adds r3, r1, r4 + str r3, [r2] + adds r6, r0, 0 + adds r6, 0x2C + ldrb r4, [r6] + adds r7, r2, 0 + cmp r4, 0xF + bhi _0818E5EC + ldrb r0, [r3] + cmp r0, 0 + bne _0818E5EC + movs r5, 0 + ldr r2, _0818E600 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r4, r0 + bne _0818E5E4 + adds r4, r7, 0 +_0818E59E: + bl GenerateRandomNumber + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0x2B + strb r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _0818E5C6 + ldr r0, [r4] + adds r0, 0x2B + ldrb r1, [r6] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E59E +_0818E5C6: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x2B + ldrb r0, [r6] + ldr r7, _0818E5F4 + ldrb r4, [r2] + cmp r0, r4 + bne _0818E5E4 + ldrb r1, [r2] + adds r3, r1, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r2] +_0818E5E4: + ldr r0, [r7] + ldrb r1, [r6] + adds r0, 0x2C + strb r1, [r0] +_0818E5EC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818E5F4: .4byte 0x0203cd68 +_0818E5F8: .4byte 0x03005d8c +_0818E5FC: .4byte 0x00003b58 +_0818E600: .4byte 0x00003b83 + thumb_func_end sub_818E570 + + thumb_func_start sub_818E604 +sub_818E604: @ 818E604 + push {r4,lr} + ldr r4, _0818E634 + ldr r1, [r4] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x2] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r0, [r4] + strb r1, [r0, 0xC] + bl GenerateRandomNumber + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + strb r0, [r4, 0xD] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818E634: .4byte 0x0203cd6c + thumb_func_end sub_818E604 + + thumb_func_start sub_818E638 +sub_818E638: @ 818E638 + push {r4,lr} + ldr r4, _0818E664 + ldr r0, _0818E668 + ldr r0, [r0] + ldr r1, _0818E66C + adds r0, r1 + str r0, [r4] + movs r2, 0 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + strb r2, [r0, 0x1] + bl sub_818E604 + ldr r1, [r4] + ldr r0, _0818E670 + ldrb r0, [r0] + strb r0, [r1, 0xE] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818E664: .4byte 0x0203cd6c +_0818E668: .4byte 0x03005d8c +_0818E66C: .4byte 0x00003b58 +_0818E670: .4byte 0x082e9531 + thumb_func_end sub_818E638 + + thumb_func_start sub_818E674 +sub_818E674: @ 818E674 + push {lr} + ldr r2, _0818E6A4 + ldr r0, _0818E6A8 + ldr r0, [r0] + ldr r1, _0818E6AC + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + ldr r2, [r2] + ldrb r0, [r2, 0x2] + cmp r0, 0x5 + beq _0818E69A + ldrb r0, [r2, 0x3] + cmp r0, 0x5 + bne _0818E69E +_0818E69A: + bl sub_818E604 +_0818E69E: + pop {r0} + bx r0 + .align 2, 0 +_0818E6A4: .4byte 0x0203cd6c +_0818E6A8: .4byte 0x03005d8c +_0818E6AC: .4byte 0x00003b58 + thumb_func_end sub_818E674 + + thumb_func_start sub_818E6B0 +sub_818E6B0: @ 818E6B0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, _0818E6F0 + ldr r0, _0818E6F4 + ldr r0, [r0] + ldr r3, _0818E6F8 + adds r1, r0, r3 + str r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, r2 + bhi _0818E6EA + strb r2, [r1, 0xC] + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0xFF + movs r2, 0x8 + bl memset + ldr r1, [r4] + ldr r0, _0818E6FC + adds r1, 0x4 + ldr r0, [r0] + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + ldr r1, [r4] + ldr r0, _0818E700 + ldrb r0, [r0] + strb r0, [r1, 0xE] +_0818E6EA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818E6F0: .4byte 0x0203cd6c +_0818E6F4: .4byte 0x03005d8c +_0818E6F8: .4byte 0x00003b58 +_0818E6FC: .4byte 0x03005d90 +_0818E700: .4byte 0x082e9531 + thumb_func_end sub_818E6B0 + + thumb_func_start sub_818E704 +sub_818E704: @ 818E704 + push {r4,r5,lr} + adds r2, r0, 0 + movs r3, 0 + movs r4, 0 + ldr r1, _0818E72C + ldr r0, _0818E730 + ldr r0, [r0] + ldr r5, _0818E734 + adds r0, r5 + str r0, [r1] + ldrb r0, [r0, 0xD] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0818E76A + lsls r0, 2 + ldr r1, _0818E738 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0818E72C: .4byte 0x0203cd6c +_0818E730: .4byte 0x03005d8c +_0818E734: .4byte 0x00003b58 +_0818E738: .4byte _0818E73C + .align 2, 0 +_0818E73C: + .4byte _0818E750 + .4byte _0818E754 + .4byte _0818E758 + .4byte _0818E75C + .4byte _0818E760 +_0818E750: + ldrb r0, [r2, 0x1] + b _0818E762 +_0818E754: + ldrb r0, [r2, 0x2] + b _0818E762 +_0818E758: + ldrb r0, [r2, 0x3] + b _0818E762 +_0818E75C: + ldrb r0, [r2, 0x4] + b _0818E762 +_0818E760: + ldrb r0, [r2, 0x5] +_0818E762: + cmp r0, 0 + beq _0818E76A + adds r3, r0, 0 + movs r4, 0x1 +_0818E76A: + cmp r4, 0x1 + bne _0818E784 + adds r0, r3, 0 + bl sub_818E6B0 + ldr r0, _0818E780 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + b _0818E78C + .align 2, 0 +_0818E780: .4byte 0x0203cd6c +_0818E784: + ldr r1, [r5] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] +_0818E78C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818E704 + + thumb_func_start sub_818E794 +sub_818E794: @ 818E794 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r4, _0818E7CC + ldr r1, _0818E7D0 + ldr r1, [r1] + ldr r2, _0818E7D4 + adds r1, r2 + str r1, [r4] + ldr r2, _0818E7D8 + ldrb r1, [r1, 0xD] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r1, _0818E7DC + ldr r0, [r4] + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl strcpy_limit_10_chars + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818E7CC: .4byte 0x0203cd6c +_0818E7D0: .4byte 0x03005d8c +_0818E7D4: .4byte 0x00003b58 +_0818E7D8: .4byte 0x0860b324 +_0818E7DC: .4byte 0x0860b310 + thumb_func_end sub_818E794 + + thumb_func_start sub_818E7E0 +sub_818E7E0: @ 818E7E0 + push {r4,lr} + adds r3, r1, 0 + ldr r2, _0818E80C + ldr r1, _0818E810 + ldr r1, [r1] + ldr r4, _0818E814 + adds r1, r4 + str r1, [r2] + ldrb r2, [r1, 0xD] + strb r2, [r0] + ldr r2, _0818E818 + ldrb r0, [r1, 0xD] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r3, 0 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818E80C: .4byte 0x0203cd6c +_0818E810: .4byte 0x03005d8c +_0818E814: .4byte 0x00003b58 +_0818E818: .4byte 0x0860b310 + thumb_func_end sub_818E7E0 + + thumb_func_start sub_818E81C +sub_818E81C: @ 818E81C + push {r4,lr} + ldr r3, _0818E838 + ldr r1, _0818E83C + ldr r1, [r1] + ldr r4, _0818E840 + adds r2, r1, r4 + str r2, [r3] + ldr r2, _0818E844 + adds r1, r2 + bl gf_strcpy + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0818E838: .4byte 0x0203cd6c +_0818E83C: .4byte 0x03005d8c +_0818E840: .4byte 0x00003b58 +_0818E844: .4byte 0x00003b5c + thumb_func_end sub_818E81C + + thumb_func_start sub_818E848 +sub_818E848: @ 818E848 + ldr r2, _0818E85C + ldr r1, _0818E860 + ldr r1, [r1] + ldr r3, _0818E864 + adds r1, r3 + str r1, [r2] + ldrb r1, [r1, 0xE] + strb r1, [r0] + bx lr + .align 2, 0 +_0818E85C: .4byte 0x0203cd6c +_0818E860: .4byte 0x03005d8c +_0818E864: .4byte 0x00003b58 + thumb_func_end sub_818E848 + + thumb_func_start sub_818E868 +sub_818E868: @ 818E868 + push {lr} + lsls r1, 24 + ldr r2, _0818E87C + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_0818E87C: .4byte 0x0860b338 + thumb_func_end sub_818E868 + + thumb_func_start sub_818E880 +sub_818E880: @ 818E880 + push {lr} + ldr r1, _0818E898 + ldr r0, _0818E89C + ldr r0, [r0] + ldr r2, _0818E8A0 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x2] + cmp r0, 0x4 + bls _0818E8A4 + movs r0, 0x1 + b _0818E8AE + .align 2, 0 +_0818E898: .4byte 0x0203cd6c +_0818E89C: .4byte 0x03005d8c +_0818E8A0: .4byte 0x00003b58 +_0818E8A4: + cmp r0, 0 + beq _0818E8AC + movs r0, 0 + b _0818E8AE +_0818E8AC: + movs r0, 0x2 +_0818E8AE: + pop {r1} + bx r1 + thumb_func_end sub_818E880 + + thumb_func_start sub_818E8B4 +sub_818E8B4: @ 818E8B4 + push {lr} + ldr r1, _0818E8CC + ldr r0, _0818E8D0 + ldr r0, [r0] + ldr r2, _0818E8D4 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _0818E8D8 + movs r0, 0 + b _0818E8DA + .align 2, 0 +_0818E8CC: .4byte 0x0203cd6c +_0818E8D0: .4byte 0x03005d8c +_0818E8D4: .4byte 0x00003b58 +_0818E8D8: + movs r0, 0x1 +_0818E8DA: + pop {r1} + bx r1 + thumb_func_end sub_818E8B4 + + thumb_func_start sub_818E8E0 +sub_818E8E0: @ 818E8E0 + push {r4,lr} + movs r3, 0 + ldr r1, _0818E908 + ldr r0, _0818E90C + ldr r0, [r0] + ldr r4, _0818E910 + adds r2, r0, r4 + str r2, [r1] + ldrb r0, [r2, 0x2] + cmp r0, 0x4 + bhi _0818E8FC + ldrb r0, [r2, 0x3] + cmp r0, 0x4 + bls _0818E8FE +_0818E8FC: + movs r3, 0x1 +_0818E8FE: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0818E908: .4byte 0x0203cd6c +_0818E90C: .4byte 0x03005d8c +_0818E910: .4byte 0x00003b58 + thumb_func_end sub_818E8E0 + + thumb_func_start sub_818E914 +sub_818E914: @ 818E914 + push {lr} + ldr r0, _0818E924 + ldr r1, _0818E928 + bl sub_818E794 + pop {r0} + bx r0 + .align 2, 0 +_0818E924: .4byte 0x02021dc4 +_0818E928: .4byte 0x02021cc4 + thumb_func_end sub_818E914 + + thumb_func_start sub_818E92C +sub_818E92C: @ 818E92C + push {lr} + ldr r1, _0818E93C + movs r0, 0x3 + bl sub_81357FC + pop {r0} + bx r0 + .align 2, 0 +_0818E93C: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_818E92C + + thumb_func_start sub_818E940 +sub_818E940: @ 818E940 + ldr r1, _0818E954 + ldr r0, _0818E958 + ldr r0, [r0] + ldr r2, _0818E95C + adds r0, r2 + str r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .align 2, 0 +_0818E954: .4byte 0x0203cd6c +_0818E958: .4byte 0x03005d8c +_0818E95C: .4byte 0x00003b58 + thumb_func_end sub_818E940 + + thumb_func_start sub_818E960 +sub_818E960: @ 818E960 + ldr r1, _0818E97C + ldr r0, _0818E980 + ldr r0, [r0] + ldr r2, _0818E984 + adds r0, r2 + str r0, [r1] + ldr r2, _0818E988 + ldr r1, _0818E98C + ldrb r0, [r0, 0xD] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_0818E97C: .4byte 0x0203cd6c +_0818E980: .4byte 0x03005d8c +_0818E984: .4byte 0x00003b58 +_0818E988: .4byte 0x020375e2 +_0818E98C: .4byte 0x0860b34c + thumb_func_end sub_818E960 + + thumb_func_start sub_818E990 +sub_818E990: @ 818E990 + ldr r1, _0818E9A0 + ldr r0, _0818E9A4 + ldr r0, [r0] + ldr r2, _0818E9A8 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0xD] + bx lr + .align 2, 0 +_0818E9A0: .4byte 0x0203cd6c +_0818E9A4: .4byte 0x03005d8c +_0818E9A8: .4byte 0x00003b58 + thumb_func_end sub_818E990 + + thumb_func_start sub_818E9AC +sub_818E9AC: @ 818E9AC + push {lr} + ldr r1, _0818E9C4 + ldr r0, _0818E9C8 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_0818E9C4: .4byte 0x0860d090 +_0818E9C8: .4byte 0x020375e0 + thumb_func_end sub_818E9AC + + thumb_func_start sub_818E9CC +sub_818E9CC: @ 818E9CC + push {r4-r7,lr} + ldr r4, _0818EA60 + ldr r0, [r4] + ldr r1, _0818EA64 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _0818EA68 + bl var_get + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, _0818EA6C + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, _0818EA64 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, _0818EA64 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, _0818EA70 + adds r3, r4, r0 + ldr r2, _0818EA74 + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0818EA3E + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, _0818EA78 + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_0818EA3E: + ldr r0, _0818EA7C + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, _0818EA80 + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818EA60: .4byte 0x03005d90 +_0818EA64: .4byte 0x00000ca9 +_0818EA68: .4byte 0x000040ce +_0818EA6C: .4byte 0x00000ca8 +_0818EA70: .4byte 0x00000cdc +_0818EA74: .4byte 0x0860d0ec +_0818EA78: .4byte 0x00000d0c +_0818EA7C: .4byte 0x03005d8c +_0818EA80: .4byte 0x02038bca + thumb_func_end sub_818E9CC + + thumb_func_start sub_818EA84 +sub_818EA84: @ 818EA84 + push {r4-r6,lr} + ldr r0, _0818EAB4 + ldr r0, [r0] + ldr r1, _0818EAB8 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _0818EABC + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _0818EAC0 + ldrh r0, [r0] + cmp r0, 0x9 + bls _0818EAA8 + b _0818ED10 +_0818EAA8: + lsls r0, 2 + ldr r1, _0818EAC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0818EAB4: .4byte 0x03005d90 +_0818EAB8: .4byte 0x00000ca9 +_0818EABC: .4byte 0x000040ce +_0818EAC0: .4byte 0x020375e2 +_0818EAC4: .4byte _0818EAC8 + .align 2, 0 +_0818EAC8: + .4byte _0818EAF0 + .4byte _0818EB14 + .4byte _0818EB48 + .4byte _0818EB64 + .4byte _0818EB80 + .4byte _0818EB98 + .4byte _0818EBB4 + .4byte _0818EC40 + .4byte _0818ECD0 + .4byte _0818ECF4 +_0818EAF0: + ldr r3, _0818EB08 + ldr r0, _0818EB0C + ldr r0, [r0] + lsls r1, r5, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, _0818EB10 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _0818ED10 + .align 2, 0 +_0818EB08: .4byte 0x020375f0 +_0818EB0C: .4byte 0x03005d90 +_0818EB10: .4byte 0x00000d0c +_0818EB14: + ldr r4, _0818EB38 + ldr r0, _0818EB3C + ldr r2, [r0] + ldr r3, _0818EB40 + adds r2, r3 + ldr r3, _0818EB44 + lsls r0, r5, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _0818ED10 + .align 2, 0 +_0818EB38: .4byte 0x020375f0 +_0818EB3C: .4byte 0x03005d90 +_0818EB40: .4byte 0x00000cdc +_0818EB44: .4byte 0x0860d0ec +_0818EB48: + ldr r1, _0818EB58 + ldr r0, _0818EB5C + ldr r0, [r0] + ldr r2, _0818EB60 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .align 2, 0 +_0818EB58: .4byte 0x020375f0 +_0818EB5C: .4byte 0x03005d90 +_0818EB60: .4byte 0x00000d08 +_0818EB64: + ldr r1, _0818EB74 + ldr r0, _0818EB78 + ldr r0, [r0] + ldr r3, _0818EB7C + adds r0, r3 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .align 2, 0 +_0818EB74: .4byte 0x020375f0 +_0818EB78: .4byte 0x03005d90 +_0818EB7C: .4byte 0x00000d08 +_0818EB80: + ldr r1, _0818EB8C + ldr r0, _0818EB90 + ldr r0, [r0] + ldr r2, _0818EB94 + adds r0, r2 + b _0818ECBA + .align 2, 0 +_0818EB8C: .4byte 0x020375f0 +_0818EB90: .4byte 0x03005d90 +_0818EB94: .4byte 0x00000d08 +_0818EB98: + ldr r1, _0818EBA8 + ldr r0, _0818EBAC + ldr r0, [r0] + ldr r3, _0818EBB0 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .align 2, 0 +_0818EBA8: .4byte 0x020375f0 +_0818EBAC: .4byte 0x03005d90 +_0818EBB0: .4byte 0x00000d08 +_0818EBB4: + ldr r0, _0818EBD8 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC04 + cmp r5, 0 + beq _0818EBE8 + ldr r1, _0818EBDC + ldr r0, _0818EBE0 + ldr r0, [r0] + ldr r2, _0818EBE4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 26 + b _0818ECBE + .align 2, 0 +_0818EBD8: .4byte 0x000040ce +_0818EBDC: .4byte 0x020375f0 +_0818EBE0: .4byte 0x03005d90 +_0818EBE4: .4byte 0x00000d08 +_0818EBE8: + ldr r1, _0818EBF8 + ldr r0, _0818EBFC + ldr r0, [r0] + ldr r3, _0818EC00 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 27 + b _0818ECBE + .align 2, 0 +_0818EBF8: .4byte 0x020375f0 +_0818EBFC: .4byte 0x03005d90 +_0818EC00: .4byte 0x00000d08 +_0818EC04: + cmp r5, 0 + beq _0818EC24 + ldr r1, _0818EC18 + ldr r0, _0818EC1C + ldr r0, [r0] + ldr r2, _0818EC20 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .align 2, 0 +_0818EC18: .4byte 0x020375f0 +_0818EC1C: .4byte 0x03005d90 +_0818EC20: .4byte 0x00000d08 +_0818EC24: + ldr r1, _0818EC34 + ldr r0, _0818EC38 + ldr r0, [r0] + ldr r3, _0818EC3C + adds r0, r3 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .align 2, 0 +_0818EC34: .4byte 0x020375f0 +_0818EC38: .4byte 0x03005d90 +_0818EC3C: .4byte 0x00000d08 +_0818EC40: + ldr r0, _0818EC64 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC90 + cmp r5, 0 + beq _0818EC74 + ldr r1, _0818EC68 + ldr r0, _0818EC6C + ldr r0, [r0] + ldr r2, _0818EC70 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + b _0818ED10 + .align 2, 0 +_0818EC64: .4byte 0x000040ce +_0818EC68: .4byte 0x020375f0 +_0818EC6C: .4byte 0x03005d90 +_0818EC70: .4byte 0x00000d08 +_0818EC74: + ldr r1, _0818EC84 + ldr r0, _0818EC88 + ldr r0, [r0] + ldr r3, _0818EC8C + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + b _0818ECBE + .align 2, 0 +_0818EC84: .4byte 0x020375f0 +_0818EC88: .4byte 0x03005d90 +_0818EC8C: .4byte 0x00000d08 +_0818EC90: + cmp r5, 0 + beq _0818ECB0 + ldr r1, _0818ECA4 + ldr r0, _0818ECA8 + ldr r0, [r0] + ldr r2, _0818ECAC + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .align 2, 0 +_0818ECA4: .4byte 0x020375f0 +_0818ECA8: .4byte 0x03005d90 +_0818ECAC: .4byte 0x00000d08 +_0818ECB0: + ldr r1, _0818ECC4 + ldr r0, _0818ECC8 + ldr r0, [r0] + ldr r3, _0818ECCC + adds r0, r3 +_0818ECBA: + ldrb r0, [r0] + lsls r0, 29 +_0818ECBE: + lsrs r0, 31 + strh r0, [r1] + b _0818ED10 + .align 2, 0 +_0818ECC4: .4byte 0x020375f0 +_0818ECC8: .4byte 0x03005d90 +_0818ECCC: .4byte 0x00000d08 +_0818ECD0: + bl sub_81B8558 + ldr r2, _0818ECEC + ldr r0, _0818ECF0 + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 4 + adds r0, r1 + ldrh r1, [r0] + strb r1, [r2] + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r2, 0x1] + b _0818ED10 + .align 2, 0 +_0818ECEC: .4byte 0x0203cef8 +_0818ECF0: .4byte 0x03005d90 +_0818ECF4: + ldr r2, _0818ED18 + ldr r0, _0818ED1C + ldr r1, [r0] + ldr r3, _0818ED20 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r3, 0x1 + adds r1, r3 + ldr r3, _0818ED24 + adds r0, r3 + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2] +_0818ED10: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0818ED18: .4byte 0x020375f0 +_0818ED1C: .4byte 0x03005d90 +_0818ED20: .4byte 0x00000d0a +_0818ED24: .4byte 0x0000fffd + thumb_func_end sub_818EA84 + + thumb_func_start sub_818ED28 +sub_818ED28: @ 818ED28 + push {r4,r5,lr} + ldr r0, _0818ED58 + ldr r0, [r0] + ldr r1, _0818ED5C + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, _0818ED60 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0818ED64 + ldrh r0, [r0] + cmp r0, 0x8 + bls _0818ED4C + b _0818F01E +_0818ED4C: + lsls r0, 2 + ldr r1, _0818ED68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0818ED58: .4byte 0x03005d90 +_0818ED5C: .4byte 0x00000ca9 +_0818ED60: .4byte 0x000040ce +_0818ED64: .4byte 0x020375e2 +_0818ED68: .4byte _0818ED6C + .align 2, 0 +_0818ED6C: + .4byte _0818ED90 + .4byte _0818EDB4 + .4byte _0818EE10 + .4byte _0818EE34 + .4byte _0818EE5C + .4byte _0818EE78 + .4byte _0818EEA0 + .4byte _0818EF50 + .4byte _0818F008 +_0818ED90: + ldr r0, _0818EDA8 + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, _0818EDAC + adds r2, r1 + adds r2, r0 + ldr r0, _0818EDB0 + ldrh r0, [r0] + strh r0, [r2] + b _0818F01E + .align 2, 0 +_0818EDA8: .4byte 0x03005d90 +_0818EDAC: .4byte 0x00000d0c +_0818EDB0: .4byte 0x020375e4 +_0818EDB4: + ldr r0, _0818EDD8 + ldrh r0, [r0] + cmp r0, 0 + beq _0818EDE8 + ldr r0, _0818EDDC + ldr r2, [r0] + ldr r0, _0818EDE0 + adds r2, r0 + ldr r3, _0818EDE4 + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _0818F01E + .align 2, 0 +_0818EDD8: .4byte 0x020375e4 +_0818EDDC: .4byte 0x03005d90 +_0818EDE0: .4byte 0x00000cdc +_0818EDE4: .4byte 0x0860d0ec +_0818EDE8: + ldr r0, _0818EE04 + ldr r2, [r0] + ldr r1, _0818EE08 + adds r2, r1 + ldr r3, _0818EE0C + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _0818F01E + .align 2, 0 +_0818EE04: .4byte 0x03005d90 +_0818EE08: .4byte 0x00000cdc +_0818EE0C: .4byte 0x0860d0fc +_0818EE10: + ldr r0, _0818EE28 + ldr r2, [r0] + ldr r0, _0818EE2C + ldrb r0, [r0] + ldr r1, _0818EE30 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .align 2, 0 +_0818EE28: .4byte 0x03005d90 +_0818EE2C: .4byte 0x020375e4 +_0818EE30: .4byte 0x00000d08 +_0818EE34: + ldr r0, _0818EE50 + ldr r3, [r0] + ldr r0, _0818EE54 + ldrb r0, [r0] + ldr r2, _0818EE58 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EE50: .4byte 0x03005d90 +_0818EE54: .4byte 0x020375e4 +_0818EE58: .4byte 0x00000d08 +_0818EE5C: + ldr r0, _0818EE6C + ldr r3, [r0] + ldr r0, _0818EE70 + ldrb r0, [r0] + ldr r1, _0818EE74 + adds r3, r1 + b _0818EFE8 + .align 2, 0 +_0818EE6C: .4byte 0x03005d90 +_0818EE70: .4byte 0x020375e4 +_0818EE74: .4byte 0x00000d08 +_0818EE78: + ldr r0, _0818EE94 + ldr r3, [r0] + ldr r0, _0818EE98 + ldrb r0, [r0] + ldr r2, _0818EE9C + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EE94: .4byte 0x03005d90 +_0818EE98: .4byte 0x020375e4 +_0818EE9C: .4byte 0x00000d08 +_0818EEA0: + ldr r0, _0818EECC + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EF00 + cmp r4, 0 + beq _0818EEDC + ldr r0, _0818EED0 + ldr r3, [r0] + ldr r0, _0818EED4 + ldrb r0, [r0] + ldr r2, _0818EED8 + adds r3, r2 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x21 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EECC: .4byte 0x000040ce +_0818EED0: .4byte 0x03005d90 +_0818EED4: .4byte 0x020375e4 +_0818EED8: .4byte 0x00000d08 +_0818EEDC: + ldr r0, _0818EEF4 + ldr r3, [r0] + ldr r0, _0818EEF8 + ldrb r0, [r0] + ldr r2, _0818EEFC + adds r3, r2 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x11 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EEF4: .4byte 0x03005d90 +_0818EEF8: .4byte 0x020375e4 +_0818EEFC: .4byte 0x00000d08 +_0818EF00: + cmp r4, 0 + beq _0818EF2C + ldr r0, _0818EF20 + ldr r3, [r0] + ldr r0, _0818EF24 + ldrb r0, [r0] + ldr r1, _0818EF28 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EF20: .4byte 0x03005d90 +_0818EF24: .4byte 0x020375e4 +_0818EF28: .4byte 0x00000d08 +_0818EF2C: + ldr r0, _0818EF44 + ldr r2, [r0] + ldr r0, _0818EF48 + ldrb r0, [r0] + ldr r1, _0818EF4C + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .align 2, 0 +_0818EF44: .4byte 0x03005d90 +_0818EF48: .4byte 0x020375e4 +_0818EF4C: .4byte 0x00000d08 +_0818EF50: + ldr r0, _0818EF7C + bl var_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EFB0 + cmp r4, 0 + beq _0818EF8C + ldr r0, _0818EF80 + ldr r2, [r0] + ldr r0, _0818EF84 + ldrb r1, [r0] + ldr r0, _0818EF88 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F +_0818EF74: + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _0818F01E + .align 2, 0 +_0818EF7C: .4byte 0x000040ce +_0818EF80: .4byte 0x03005d90 +_0818EF84: .4byte 0x020375e4 +_0818EF88: .4byte 0x00000d08 +_0818EF8C: + ldr r0, _0818EFA4 + ldr r3, [r0] + ldr r0, _0818EFA8 + ldrb r0, [r0] + ldr r2, _0818EFAC + adds r3, r2 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x41 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EFA4: .4byte 0x03005d90 +_0818EFA8: .4byte 0x020375e4 +_0818EFAC: .4byte 0x00000d08 +_0818EFB0: + cmp r4, 0 + beq _0818EFDC + ldr r0, _0818EFD0 + ldr r3, [r0] + ldr r0, _0818EFD4 + ldrb r0, [r0] + ldr r1, _0818EFD8 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .align 2, 0 +_0818EFD0: .4byte 0x03005d90 +_0818EFD4: .4byte 0x020375e4 +_0818EFD8: .4byte 0x00000d08 +_0818EFDC: + ldr r0, _0818EFFC + ldr r3, [r0] + ldr r0, _0818F000 + ldrb r0, [r0] + ldr r2, _0818F004 + adds r3, r2 +_0818EFE8: + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 +_0818EFF4: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _0818F01E + .align 2, 0 +_0818EFFC: .4byte 0x03005d90 +_0818F000: .4byte 0x020375e4 +_0818F004: .4byte 0x00000d08 +_0818F008: + ldr r0, _0818F024 + ldr r2, [r0] + ldr r0, _0818F028 + ldrb r1, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r0, 0xCB + lsls r0, 4 + adds r2, r0 + strh r1, [r2] +_0818F01E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818F024: .4byte 0x03005d90 +_0818F028: .4byte 0x0203cef8 + thumb_func_end sub_818ED28 + + thumb_func_start sub_818F02C +sub_818F02C: @ 818F02C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x20 + bl malloc_and_clear + str r0, [sp, 0x18] + movs r0, 0x18 + bl malloc_and_clear + str r0, [sp, 0x1C] + ldr r4, _0818F1EC + ldr r1, [r4] + ldr r2, _0818F1F0 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r0, 0x1 + ldr r3, _0818F1F4 + adds r1, r3 + strb r0, [r1] + ldr r0, _0818F1F8 + bl var_get + ldr r1, [r4] + adds r0, 0x1 + ldr r5, _0818F1FC + adds r1, r5 + strb r0, [r1] + ldr r2, [r4] + ldr r7, _0818F200 + adds r3, r2, r7 + ldrh r0, [r3] + ldr r5, _0818F204 + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3] + ldr r3, _0818F208 + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + movs r7, 0 + mov r10, r7 + mov r8, r4 + ldr r0, _0818F20C + mov r9, r0 + movs r4, 0 +_0818F0BA: + mov r1, r8 + ldr r0, [r1] + ldr r2, _0818F210 + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + mov r5, r8 + ldr r1, [r5] + ldr r7, _0818F214 + adds r1, r7 + adds r1, r4 + strh r0, [r1] + movs r5, 0 + mov r0, r10 + lsls r7, r0, 4 + adds r6, r7, 0 +_0818F0E8: + mov r1, r8 + ldr r0, [r1] + ldr r2, _0818F210 + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + mov r2, r8 + ldr r1, [r2] + ldr r3, _0818F218 + adds r1, r3 + adds r1, r6 + strh r0, [r1] + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0818F0E8 + movs r5, 0 + ldr r6, _0818F1EC +_0818F11C: + ldr r0, [r6] + ldr r1, _0818F210 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + adds r1, r5, 0 + adds r1, 0x1A + movs r2, 0 + bl pokemon_getattr + ldr r1, [r6] + adds r2, r5, r7 + ldr r3, _0818F21C + adds r1, r3 + adds r1, r2 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _0818F11C + mov r5, r8 + ldr r0, [r5] + ldr r1, _0818F210 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + bl get_nature + ldr r1, [r5] + adds r1, r7 + ldr r3, _0818F220 + adds r1, r3 + strb r0, [r1] + adds r4, 0x2 + movs r5, 0x1 + add r10, r5 + mov r7, r10 + cmp r7, 0x2 + ble _0818F0BA + mov r10, r5 + movs r0, 0x4 + str r0, [sp, 0x34] + movs r1, 0x6 + str r1, [sp, 0x38] +_0818F17E: + mov r2, r10 + cmp r2, 0x5 + ble _0818F22C +_0818F184: + bl sub_81A39C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r3, _0818F1EC + ldr r0, [r3] + ldr r7, _0818F224 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r3, 0 + cmp r0, r4 + beq _0818F1CA + ldr r3, _0818F200 +_0818F1B2: + adds r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F1B2 +_0818F1CA: + cmp r5, r10 + bne _0818F184 + ldr r0, _0818F1EC + ldr r3, [r0] + ldr r1, [sp, 0x34] + adds r3, r1 + ldr r2, _0818F200 + adds r3, r2 + ldr r5, _0818F204 + adds r0, r5, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r7, _0818F228 + adds r1, r7, 0 + b _0818F292 + .align 2, 0 +_0818F1EC: .4byte 0x03005d90 +_0818F1F0: .4byte 0x00000ca9 +_0818F1F4: .4byte 0x00000d0a +_0818F1F8: .4byte 0x000040ce +_0818F1FC: .4byte 0x00000d0b +_0818F200: .4byte 0x00000d24 +_0818F204: .4byte 0x000003ff +_0818F208: .4byte 0x00000d25 +_0818F20C: .4byte 0x02024488 +_0818F210: .4byte 0x00000caa +_0818F214: .4byte 0x00000d64 +_0818F218: .4byte 0x00000efc +_0818F21C: .4byte 0x00000f04 +_0818F220: .4byte 0x00000f0a +_0818F224: .4byte 0x00000d28 +_0818F228: .4byte 0xfffffc00 +_0818F22C: + bl sub_81A39C4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r1, _0818F5D0 + ldr r0, [r1] + ldr r2, _0818F5D4 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r1, 0 + cmp r0, r4 + beq _0818F274 + ldr r3, _0818F5D8 +_0818F25C: + adds r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F25C +_0818F274: + cmp r5, r10 + bne _0818F22C + ldr r5, _0818F5D0 + ldr r3, [r5] + ldr r7, [sp, 0x34] + adds r3, r7 + ldr r0, _0818F5D8 + adds r3, r0 + ldr r1, _0818F5DC + adds r0, r1, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, _0818F5E0 + adds r1, r5, 0 +_0818F292: + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r5, 0 + lsls r4, 16 + str r4, [sp, 0x2C] + ldr r7, [sp, 0x38] + str r7, [sp, 0x20] +_0818F2A2: + lsls r0, r5, 1 + mov r9, r0 + adds r1, r5, 0x1 + str r1, [sp, 0x24] + lsls r2, r5, 2 + str r2, [sp, 0x28] +_0818F2AE: + ldr r3, [sp, 0x2C] + lsrs r0, r3, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + cmp r7, r5 + bge _0818F300 + ldr r0, _0818F5D0 + ldr r0, [r0] + ldr r1, [sp, 0x8] + mov r8, r1 + ldr r2, [sp, 0xC] + mov r12, r2 + ldr r3, _0818F5E4 + adds r0, r3 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_0818F2D4: + ldrh r3, [r4] + cmp r3, r6 + beq _0818F300 + ldr r2, _0818F5E8 + ldr r1, [r2] + lsls r0, r6, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _0818F300 + cmp r12, r0 + beq _0818F300 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _0818F300 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r5 + blt _0818F2D4 +_0818F300: + cmp r7, r5 + bne _0818F2AE + ldr r3, _0818F5D0 + ldr r0, [r3] + ldr r1, [sp, 0x38] + add r1, r9 + ldr r5, _0818F5E4 + adds r0, r5 + adds r0, r1 + strh r6, [r0] + ldr r2, [sp, 0x28] + add r2, sp + adds r2, 0x8 + ldr r0, _0818F5E8 + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r5, [sp, 0x24] + cmp r5, 0x2 + ble _0818F2A2 + ldr r2, [r3] + ldr r7, [sp, 0x34] + adds r2, r7 + ldr r0, _0818F5EC + adds r2, r0 + ldrb r0, [r2] + movs r3, 0x5 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, _0818F5D0 + ldr r2, [r5] + adds r2, r7 + ldr r7, _0818F5EC + adds r2, r7 + ldrb r0, [r2] + subs r3, 0x14 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x34] + adds r1, r5 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x34] + ldr r7, [sp, 0x38] + adds r7, 0x6 + str r7, [sp, 0x38] + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0xF + bgt _0818F37C + b _0818F17E +_0818F37C: + movs r7, 0 + ldr r2, [sp, 0x18] + strh r7, [r2] + movs r3, 0 + mov r10, r3 + ldr r6, _0818F5F0 + ldr r5, _0818F5F4 +_0818F38A: + ldr r0, _0818F5D0 + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 1 + ldr r3, _0818F5F8 + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + subs r4, r0, 0x1 + movs r0, 0x64 + muls r4, r0 + ldr r0, _0818F5FC + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl pokemon_getattr + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl pokemon_getattr + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x6] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x2 + ble _0818F38A + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F458: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F462 + adds r4, 0x1 +_0818F462: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F458 + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + adds r2, r0, 0 + adds r0, r4, 0 + muls r0, r2 + movs r1, 0x14 + bl __divsi3 + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + movs r5, 0x1 + mov r10, r5 + adds r6, r3, 0 + adds r6, 0x2 + movs r7, 0x2 + str r7, [sp, 0x30] +_0818F494: + movs r7, 0 + strh r7, [r6] + ldr r1, _0818F5D0 + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, _0818F5D8 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [sp, 0x30] + mov r9, r0 +_0818F4BC: + ldr r1, _0818F5D0 + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r5 + lsls r4, 1 + ldr r2, _0818F5E4 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, _0818F5E8 + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + ldr r1, [sp, 0x14] + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r6] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r6] + ldr r3, _0818F5D0 + ldr r0, [r3] + ldr r1, _0818F5E4 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, _0818F5E8 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, _0818F5F4 + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r2, _0818F5F0 + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + adds r5, 0x1 + cmp r5, 0x2 + ble _0818F4BC + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F54C: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F556 + adds r4, 0x1 +_0818F556: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F54C + ldr r3, [sp, 0x14] + adds r0, r4, 0 + muls r0, r3 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r6] + adds r1, r0 + strh r1, [r6] + adds r6, 0x2 + ldr r5, [sp, 0x30] + adds r5, 0x2 + str r5, [sp, 0x30] + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + ble _0818F494 + movs r1, 0 + mov r10, r1 + ldr r2, _0818F5DC + mov r8, r2 +_0818F58A: + mov r5, r10 + adds r5, 0x1 + adds r7, r5, 0 + cmp r5, 0xF + bgt _0818F626 + mov r3, r10 + lsls r0, r3, 1 + ldr r1, [sp, 0x18] + adds r6, r0, r1 + lsls r0, r5, 1 + adds r4, r0, r1 +_0818F5A0: + ldrh r1, [r6] + ldrh r0, [r4] + cmp r1, r0 + bcc _0818F5C2 + cmp r1, r0 + bne _0818F61E + ldr r0, _0818F5D0 + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1, r0 + ldr r2, _0818F5D8 + adds r0, r2 + ldrh r0, [r0] + lsls r2, r0, 22 + lsrs r0, r2, 22 + cmp r0, r8 + bne _0818F602 +_0818F5C2: + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _0818F600 + .align 2, 0 +_0818F5D0: .4byte 0x03005d90 +_0818F5D4: .4byte 0x00000d28 +_0818F5D8: .4byte 0x00000d24 +_0818F5DC: .4byte 0x000003ff +_0818F5E0: .4byte 0xfffffc00 +_0818F5E4: .4byte 0x00000d64 +_0818F5E8: .4byte 0x0203bc8c +_0818F5EC: .4byte 0x00000d25 +_0818F5F0: .4byte 0x0832a328 +_0818F5F4: .4byte 0x083203cc +_0818F5F8: .4byte 0x00000caa +_0818F5FC: .4byte 0x020244ec +_0818F600: + b _0818F61E +_0818F602: + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r1, _0818F694 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + cmp r0, r2 + bls _0818F61E + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_0818F61E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0xF + ble _0818F5A0 +_0818F626: + mov r10, r7 + mov r2, r10 + cmp r2, 0xE + ble _0818F58A + bl sub_81A3610 + lsls r0, 24 + cmp r0, 0 + beq _0818F6EE + movs r3, 0 + mov r10, r3 + ldr r0, _0818F698 + ldr r1, [r0] + ldr r4, _0818F694 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + ldr r3, _0818F69C + adds r2, r0, 0 + ldr r6, _0818F6A0 + cmp r1, r3 + beq _0818F674 + adds r5, r2, 0 +_0818F656: + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + bgt _0818F674 + ldr r0, [r5] + mov r7, r10 + lsls r1, r7, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _0818F656 +_0818F674: + mov r1, r10 + lsls r0, r1, 1 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0818F6AC + movs r5, 0 + ldr r2, [r2] + ldr r3, _0818F694 + adds r2, r3 + ldrh r1, [r2] + ldr r0, _0818F6A4 + ands r0, r1 + ldr r7, _0818F6A8 + adds r1, r7, 0 + b _0818F6BE + .align 2, 0 +_0818F694: .4byte 0x00000d24 +_0818F698: .4byte 0x03005d90 +_0818F69C: .4byte 0x000003ff +_0818F6A0: .4byte 0x0860d3f1 +_0818F6A4: .4byte 0xfffffc00 +_0818F6A8: .4byte 0x000003fe +_0818F6AC: + movs r5, 0x1 + ldr r2, [r2] + ldr r0, _0818F70C + adds r2, r0 + ldrh r1, [r2] + ldr r0, _0818F710 + ands r0, r1 + ldr r3, _0818F714 + adds r1, r3, 0 +_0818F6BE: + orrs r0, r1 + strh r0, [r2] + movs r7, 0 + mov r10, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r4, r0, 1 +_0818F6CC: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_81A4FF0 + ldr r1, _0818F718 + ldr r1, [r1] + ldr r2, _0818F71C + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r4, 0x2 + movs r3, 0x1 + add r10, r3 + mov r5, r10 + cmp r5, 0x2 + ble _0818F6CC +_0818F6EE: + ldr r0, [sp, 0x18] + bl free + ldr r0, [sp, 0x1C] + bl free + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818F70C: .4byte 0x00000d28 +_0818F710: .4byte 0xfffffc00 +_0818F714: .4byte 0x000003fe +_0818F718: .4byte 0x03005d90 +_0818F71C: .4byte 0x00000d64 + thumb_func_end sub_818F02C + + thumb_func_start sub_818F720 +sub_818F720: @ 818F720 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r1, 0 + mov r9, r2 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + mov r8, r2 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + movs r1, 0 + adds r4, r5, 0 + movs r3, 0x1 + movs r2, 0x5 +_0818F74C: + adds r0, r4, 0 + ands r0, r3 + cmp r0, 0 + beq _0818F756 + adds r1, 0x1 +_0818F756: + lsrs r4, 1 + subs r2, 0x1 + cmp r2, 0 + bge _0818F74C + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r0, r6, 3 + mov r10, r0 + movs r1, 0 + mov r12, r1 + mov r1, sp + movs r2, 0x5 +_0818F776: + mov r0, r12 + str r0, [r1] + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _0818F784 + str r3, [r1] +_0818F784: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0818F776 + ldr r0, _0818F79C + cmp r6, r0 + bne _0818F7A0 + movs r0, 0x1 + b _0818F7CA + .align 2, 0 +_0818F79C: .4byte 0x0000012f +_0818F7A0: + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, _0818F900 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp] + cmp r0, 0 + bge _0818F7BA + adds r0, 0x3 +_0818F7BA: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r0, r7 + adds r0, 0xA +_0818F7CA: + mov r1, r8 + str r0, [r1] + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, _0818F900 + adds r4, r0, r1 + ldrb r0, [r4, 0x1] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _0818F7E8 + adds r0, 0x3 +_0818F7E8: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x4] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x1 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x4] + ldrb r0, [r4, 0x2] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0818F820 + adds r0, 0x3 +_0818F820: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x8] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x2 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x8] + ldrb r0, [r4, 0x3] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0xC] + cmp r0, 0 + bge _0818F858 + adds r0, 0x3 +_0818F858: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0xC] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x3 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0xC] + ldrb r0, [r4, 0x4] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x10] + cmp r0, 0 + bge _0818F890 + adds r0, 0x3 +_0818F890: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x10] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x4 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x10] + ldrb r0, [r4, 0x5] + lsls r0, 1 + mov r1, r9 + adds r2, r0, r1 + ldr r0, [sp, 0x14] + cmp r0, 0 + bge _0818F8C8 + adds r0, 0x3 +_0818F8C8: + asrs r0, 2 + adds r0, r2, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r2, r8 + str r1, [r2, 0x14] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x5 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x14] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818F900: .4byte 0x083203cc + thumb_func_end sub_818F720 + + thumb_func_start sub_818F904 +sub_818F904: @ 818F904 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r3, r0, 1 + mov r12, r3 + adds r4, r3, r2 + ldrh r5, [r4] + lsls r7, r1, 1 + mov r9, r7 + add r2, r9 + ldrh r3, [r2] + strh r3, [r4] + strh r5, [r2] + ldr r2, _0818F9A0 + ldr r5, [r2] + lsls r6, r0, 2 + adds r6, r5, r6 + ldr r3, _0818F9A4 + adds r6, r3 + ldrh r7, [r6] + mov r10, r7 + mov r2, r10 + lsls r2, 22 + mov r8, r2 + lsls r2, r1, 2 + adds r5, r2 + adds r5, r3 + ldrh r4, [r5] + lsls r4, 22 + lsrs r4, 22 + ldr r3, _0818F9A8 + adds r2, r3, 0 + mov r7, r10 + ands r2, r7 + orrs r2, r4 + strh r2, [r6] + mov r2, r8 + lsrs r2, 22 + mov r8, r2 + ldrh r2, [r5] + ands r3, r2 + mov r7, r8 + orrs r3, r7 + strh r3, [r5] + ldr r2, _0818F9A0 + mov r8, r2 + add r12, r0 + add r9, r1 + mov r3, r9 + lsls r4, r3, 1 + mov r7, r12 + lsls r3, r7, 1 + ldr r7, _0818F9AC + movs r6, 0x2 +_0818F974: + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + adds r2, r0, r3 + ldrh r5, [r2] + adds r0, r4 + ldrh r1, [r0] + strh r1, [r2] + strh r5, [r0] + adds r4, 0x2 + adds r3, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _0818F974 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818F9A0: .4byte 0x03005d90 +_0818F9A4: .4byte 0x00000d24 +_0818F9A8: .4byte 0xfffffc00 +_0818F9AC: .4byte 0x00000d64 + thumb_func_end sub_818F904 + + thumb_func_start sub_818F9B0 +sub_818F9B0: @ 818F9B0 + push {lr} + ldr r0, _0818F9D0 + ldr r2, _0818F9D4 + ldr r1, _0818F9D8 + ldr r1, [r1] + ldr r3, _0818F9DC + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_0818F9D0: .4byte 0x02021cc4 +_0818F9D4: .4byte 0x085ccd20 +_0818F9D8: .4byte 0x03005d90 +_0818F9DC: .4byte 0x00000cb2 + thumb_func_end sub_818F9B0 + + thumb_func_start sub_818F9E0 +sub_818F9E0: @ 818F9E0 + push {lr} + ldr r0, _0818FA08 + ldr r2, _0818FA0C + ldr r1, _0818FA10 + ldr r1, [r1] + ldr r3, _0818FA14 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r0, _0818FA18 + ldr r1, _0818FA1C + ldrh r1, [r1] + bl sub_8195898 + pop {r0} + bx r0 + .align 2, 0 +_0818FA08: .4byte 0x02021cc4 +_0818FA0C: .4byte 0x085ccd20 +_0818FA10: .4byte 0x03005d90 +_0818FA14: .4byte 0x00000cb2 +_0818FA18: .4byte 0x02021dc4 +_0818FA1C: .4byte 0x02038bca + thumb_func_end sub_818F9E0 + + thumb_func_start sub_818FA20 +sub_818FA20: @ 818FA20 + push {r4,r5,lr} + ldr r1, _0818FA64 + movs r0, 0 + str r0, [r1] + ldr r4, _0818FA68 + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r5, _0818FA6C + str r0, [r5] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + bl calc_player_party_count + ldr r0, _0818FA70 + ldrh r0, [r0] + bl sub_8195358 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FBDC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0818FA64: .4byte 0x0203cd70 +_0818FA68: .4byte 0x020244ec +_0818FA6C: .4byte 0x0203cd74 +_0818FA70: .4byte 0x02038bca + thumb_func_end sub_818FA20 + + thumb_func_start sub_818FA74 +sub_818FA74: @ 818FA74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r5, r2, 0 + str r3, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x28] + lsls r5, 24 + lsrs r5, 24 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [sp, 0x28] + bl sub_8190168 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x2C] + bl sub_8165C40 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + ldr r4, [sp, 0x10] + adds r3, r4, 0 + muls r3, r0 + str r3, [sp, 0x18] + ldr r6, _0818FBC8 + adds r0, r3, r6 + ldr r7, _0818FBCC + ldr r4, [r7] + lsls r5, 1 + ldr r3, [sp, 0x28] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 1 + adds r1, r5, r1 + ldr r6, _0818FBD0 + adds r4, r6 + adds r4, r1 + ldrh r3, [r4] + ldr r7, _0818FBD4 + ldr r7, [r7] + mov r8, r7 + lsls r3, 4 + add r3, r8 + ldrh r1, [r3] + ldrb r3, [r3, 0xC] + ldr r6, [sp, 0x2C] + str r6, [sp] + ldrh r4, [r4] + lsls r4, 4 + add r4, r8 + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r7, [sp, 0x14] + str r7, [sp, 0x8] + bl sub_8068634 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r6, 0 + ldr r2, [sp, 0x18] + str r2, [sp, 0x1C] + mov r10, r5 + ldr r3, _0818FBD0 + mov r9, r3 + ldr r3, _0818FBD4 + mov r4, r10 + str r4, [sp, 0x20] +_0818FB18: + ldr r7, _0818FBCC + ldr r1, [r7] + ldr r2, [sp, 0x28] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + mov r8, r0 + mov r5, r10 + add r5, r8 + add r1, r9 + adds r1, r5 + ldrh r0, [r1] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r12, r2 + ldr r7, [sp, 0x1C] + ldr r2, _0818FBC8 + adds r0, r7, r2 + mov r2, r12 + str r3, [sp, 0x24] + bl sub_80691F4 + ldr r7, _0818FBCC + ldr r0, [r7] + add r0, r9 + adds r0, r5 + ldrh r0, [r0] + ldr r3, [sp, 0x24] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0818FB74 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_0818FB74: + adds r6, 0x1 + cmp r6, 0x3 + ble _0818FB18 + movs r0, 0x64 + ldr r1, [sp, 0x10] + adds r4, r1, 0 + muls r4, r0 + ldr r0, _0818FBC8 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r0, _0818FBCC + ldr r0, [r0] + ldr r1, [sp, 0x20] + add r1, r8 + ldr r2, _0818FBD0 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _0818FBD4 + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _0818FBD8 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0818FBC8: .4byte 0x02024744 +_0818FBCC: .4byte 0x03005d90 +_0818FBD0: .4byte 0x00000d64 +_0818FBD4: .4byte 0x0203bc8c +_0818FBD8: .4byte 0x085cecb0 + thumb_func_end sub_818FA74 + + thumb_func_start sub_818FBDC +sub_818FBDC: @ 818FBDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r6, 0 + bl zero_enemy_party_data + mov r0, r8 + bl sub_818FC78 + adds r5, r0, 0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _0818FC46 + movs r4, 0 +_0818FC20: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0818FC3C + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC3C: + asrs r5, 1 + adds r4, 0x1 + cmp r4, 0x2 + ble _0818FC20 + b _0818FC6C +_0818FC46: + movs r4, 0x2 +_0818FC48: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0818FC64 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC64: + lsls r5, 1 + subs r4, 0x1 + cmp r4, 0 + bge _0818FC48 +_0818FC6C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_818FBDC + + thumb_func_start sub_818FC78 +sub_818FC78: @ 818FC78 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0818FCA2 + adds r0, r4, 0 + movs r1, 0 + bl sub_818FCBC + cmp r0, 0 + bne _0818FCB6 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_818FDB8 + b _0818FCB6 +_0818FCA2: + adds r0, r5, 0 + movs r1, 0 + bl sub_818FDB8 + cmp r0, 0 + bne _0818FCB6 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_818FCBC +_0818FCB6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818FC78 + + thumb_func_start sub_818FCBC +sub_818FCBC: @ 818FCBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FCDE: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FCFA: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FD00: + ldr r0, _0818FD30 + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, _0818FD34 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, _0818FD38 + cmp r0, r2 + bne _0818FD3C + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FD60 + .align 2, 0 +_0818FD30: .4byte 0x03005d90 +_0818FD34: .4byte 0x00000d24 +_0818FD38: .4byte 0x000003fe +_0818FD3C: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, _0818FDAC + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _0818FDB0 + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FD60: + movs r0, 0x64 + muls r0, r6 + ldr r1, _0818FDB4 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FD00 + mov r7, r10 + cmp r7, 0x3 + ble _0818FCFA + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FCDE + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818FDAC: .4byte 0x00000d64 +_0818FDB0: .4byte 0x0203bc8c +_0818FDB4: .4byte 0x020244ec + thumb_func_end sub_818FCBC + + thumb_func_start sub_818FDB8 +sub_818FDB8: @ 818FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FDDA: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FDF6: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FDFC: + ldr r0, _0818FE2C + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, _0818FE30 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, _0818FE34 + cmp r0, r2 + bne _0818FE38 + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FE5C + .align 2, 0 +_0818FE2C: .4byte 0x03005d90 +_0818FE30: .4byte 0x00000d24 +_0818FE34: .4byte 0x000003fe +_0818FE38: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, _0818FEA8 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _0818FEAC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FE5C: + movs r0, 0x64 + muls r0, r6 + ldr r1, _0818FEB0 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FDFC + mov r7, r10 + cmp r7, 0x3 + ble _0818FDF6 + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FDDA + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818FEA8: .4byte 0x00000d64 +_0818FEAC: .4byte 0x0203bc8c +_0818FEB0: .4byte 0x020244ec + thumb_func_end sub_818FDB8 + + thumb_func_start sub_818FEB4 +sub_818FEB4: @ 818FEB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp, 0xC] + movs r3, 0x2 + add r0, sp, 0x8 +_0818FECE: + str r3, [r0] + subs r0, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0818FECE + mov r3, r10 + ldr r2, [r3] + ldr r0, [r3, 0x4] + cmp r2, r0 + bne _0818FF20 + ldr r0, [r3, 0x8] + cmp r2, r0 + bne _0818FF20 + cmp r1, 0 + beq _0818FFAA + movs r3, 0 + ldr r4, _0818FF1C +_0818FEF0: + str r3, [sp, 0x14] + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + ldr r3, [sp, 0x14] + cmp r1, 0x3 + beq _0818FF16 + lsls r0, r1, 2 + adds r0, r4 + ldr r1, [r0] + ldr r0, [sp, 0xC] + ands r0, r1 + cmp r0, 0 + bne _0818FF16 + ldr r0, [sp, 0xC] + orrs r0, r1 + str r0, [sp, 0xC] + adds r3, 0x1 +_0818FF16: + cmp r3, 0x2 + bne _0818FEF0 + b _0818FFAA + .align 2, 0 +_0818FF1C: .4byte 0x0832a328 +_0818FF20: + movs r3, 0 + mov r9, sp + mov r8, r10 +_0818FF26: + adds r2, r3, 0x1 + cmp r2, 0x2 + bgt _0818FF84 + mov r6, r8 + mov r7, r9 + lsls r0, r2, 2 + mov r1, sp + adds r5, r0, r1 + mov r1, r10 + adds r4, r0, r1 +_0818FF3A: + ldr r0, [r6] + ldr r1, [r4] + cmp r0, r1 + bge _0818FF4E + str r1, [r6] + str r0, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF4E: + ldr r1, [r6] + ldr r0, [r4] + cmp r1, r0 + bne _0818FF7A + str r2, [sp, 0x10] + str r3, [sp, 0x14] + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + cmp r1, 0 + beq _0818FF7A + ldr r1, [r6] + ldr r0, [r4] + str r0, [r6] + str r1, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF7A: + adds r5, 0x4 + adds r4, 0x4 + adds r2, 0x1 + cmp r2, 0x2 + ble _0818FF3A +_0818FF84: + movs r4, 0x4 + add r9, r4 + add r8, r4 + adds r3, 0x1 + cmp r3, 0x1 + ble _0818FF26 + ldr r2, _0818FFBC + mov r1, sp + movs r3, 0x1 +_0818FF96: + ldm r1!, {r0} + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r4, [sp, 0xC] + orrs r4, r0 + str r4, [sp, 0xC] + subs r3, 0x1 + cmp r3, 0 + bge _0818FF96 +_0818FFAA: + ldr r0, [sp, 0xC] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0818FFBC: .4byte 0x0832a328 + thumb_func_end sub_818FEB4 + + thumb_func_start sub_818FFC0 +sub_818FFC0: @ 818FFC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r1, 0 + str r2, [sp] + movs r6, 0 + movs r2, 0x14 + cmp r3, 0 + beq _0818FFF0 + ldr r0, _0818FFF4 + cmp r3, r0 + beq _0818FFF0 + ldr r0, _0818FFF8 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x1] + cmp r0, 0 + bne _0818FFFC +_0818FFF0: + movs r0, 0 + b _08190156 + .align 2, 0 +_0818FFF4: .4byte 0x0000ffff +_0818FFF8: .4byte 0x0831c898 +_0818FFFC: + ldr r1, _08190028 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + mov r10, r1 + ldrb r1, [r0, 0x7] + mov r9, r1 + ldrb r0, [r0, 0x16] + mov r8, r0 + ldrb r3, [r3, 0x2] + str r3, [sp, 0x4] + cmp r0, 0x1A + bne _0819002C + cmp r3, 0x4 + bne _0819002C + ldr r0, [sp] + cmp r0, 0x1 + bne _081900AA + movs r2, 0x8 + b _081900A4 + .align 2, 0 +_08190028: .4byte 0x083203cc +_0819002C: + ldr r0, _081900B8 + adds r1, r6, r0 + ldrb r0, [r1] + ldr r7, _081900B8 + cmp r0, 0xFF + beq _081900A4 + adds r4, r1, 0 +_0819003A: + ldrb r0, [r4] + cmp r0, 0xFE + beq _08190096 + ldrb r0, [r4] + ldr r1, [sp, 0x4] + cmp r0, r1 + bne _08190096 + ldrb r0, [r4, 0x1] + adds r5, r6, 0x1 + cmp r0, r10 + bne _0819006C + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _0819005E + ldrb r0, [r4, 0x2] + cmp r0, 0x28 + bne _0819006C +_0819005E: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_0819006C: + adds r0, r5, r7 + ldrb r0, [r0] + cmp r0, r9 + bne _08190096 + cmp r10, r9 + beq _08190096 + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _08190088 + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0x28 + bne _08190096 +_08190088: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_08190096: + adds r4, 0x3 + adds r6, 0x3 + ldr r1, _081900B8 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819003A +_081900A4: + ldr r0, [sp] + cmp r0, 0x1 + beq _081900E0 +_081900AA: + ldr r1, [sp] + cmp r1, 0x1 + bgt _081900BC + cmp r1, 0 + beq _081900C4 + b _08190154 + .align 2, 0 +_081900B8: .4byte 0x0831ace8 +_081900BC: + ldr r0, [sp] + cmp r0, 0x2 + beq _08190114 + b _08190154 +_081900C4: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + ble _08190146 + cmp r2, 0x28 + beq _0819014A + cmp r2, 0x28 + bgt _081900DA + cmp r2, 0x14 + beq _08190104 + b _08190146 +_081900DA: + cmp r2, 0x50 + bne _08190146 + b _08190100 +_081900E0: + cmp r2, 0xA + beq _08190104 + cmp r2, 0xA + bgt _081900F2 + cmp r2, 0 + beq _08190100 + cmp r2, 0x5 + beq _0819014A + b _08190146 +_081900F2: + cmp r2, 0x28 + beq _08190108 + cmp r2, 0x28 + ble _08190146 + cmp r2, 0x50 + beq _0819010E + b _08190146 +_08190100: + movs r2, 0x8 + b _08190154 +_08190104: + movs r2, 0x2 + b _08190154 +_08190108: + movs r2, 0x2 + negs r2, r2 + b _08190154 +_0819010E: + movs r2, 0x4 + negs r2, r2 + b _08190154 +_08190114: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + bgt _08190126 + cmp r2, 0 + beq _0819013A + cmp r2, 0x5 + beq _08190140 + b _08190146 +_08190126: + cmp r2, 0x28 + beq _0819014E + cmp r2, 0x28 + bgt _08190134 + cmp r2, 0x14 + beq _0819014A + b _08190146 +_08190134: + cmp r2, 0x50 + beq _08190152 + b _08190146 +_0819013A: + movs r2, 0x10 + negs r2, r2 + b _08190154 +_08190140: + movs r2, 0x8 + negs r2, r2 + b _08190154 +_08190146: + movs r2, 0 + b _08190154 +_0819014A: + movs r2, 0x4 + b _08190154 +_0819014E: + movs r2, 0xC + b _08190154 +_08190152: + movs r2, 0x14 +_08190154: + adds r0, r2, 0 +_08190156: + 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_818FFC0 + + thumb_func_start sub_8190168 +sub_8190168: @ 8190168 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _0819019A + movs r1, 0x6 + cmp r0, 0x77 + bls _0819019A + movs r1, 0x9 + cmp r0, 0x8B + bls _0819019A + movs r1, 0xC + cmp r0, 0x9F + bls _0819019A + movs r1, 0xF + cmp r0, 0xB3 + bls _0819019A + movs r1, 0x12 + cmp r0, 0xC7 + bls _0819019A + movs r1, 0x1F + cmp r0, 0xDB + bhi _0819019A + movs r1, 0x15 +_0819019A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8190168 + + thumb_func_start sub_81901A0 +sub_81901A0: @ 81901A0 + push {r4-r7,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + ldr r0, _081901F0 + ldr r1, [r0] + ldr r4, _081901F4 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + mov r12, r0 + ldr r6, _081901F8 + cmp r1, r2 + beq _081901D8 + mov r7, r12 +_081901C0: + adds r5, 0x1 + cmp r5, 0xF + bgt _081901D8 + ldr r0, [r7] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r2 + bne _081901C0 +_081901D8: + cmp r3, 0 + beq _0819026C + cmp r3, 0x3 + bne _081901FC + lsls r0, r5, 2 + adds r1, r0, 0x3 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0 + adds r4, 0x8 + b _08190206 + .align 2, 0 +_081901F0: .4byte 0x03005d90 +_081901F4: .4byte 0x00000d24 +_081901F8: .4byte 0x0860d10c +_081901FC: + lsls r0, r5, 2 + adds r1, r3, r0 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0x4 +_08190206: + adds r0, r3, r0 + adds r0, r6 + ldrb r2, [r0] + cmp r2, r4 + bge _08190256 + ldr r1, _0819022C + adds r0, r2, r1 + ldrb r3, [r0] + adds r6, r1, 0 + cmp r3, r5 + beq _08190234 + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 2 + adds r0, r1 + ldr r3, _08190230 + adds r0, r3 + b _0819024E + .align 2, 0 +_0819022C: .4byte 0x0860d14c +_08190230: .4byte 0x00000d25 +_08190234: + adds r2, 0x1 + cmp r2, r4 + bge _08190256 + adds r0, r2, r6 + ldrb r1, [r0] + cmp r1, r5 + beq _08190234 + mov r3, r12 + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + ldr r1, _08190264 + adds r0, r1 +_0819024E: + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190234 +_08190256: + cmp r2, r4 + beq _08190286 + ldr r0, _08190268 + adds r0, r2, r0 + ldrb r0, [r0] + b _08190292 + .align 2, 0 +_08190264: .4byte 0x00000d25 +_08190268: .4byte 0x0860d14c +_0819026C: + mov r3, r12 + ldr r1, [r3] + lsls r0, r5, 2 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r1, r0 + ldr r0, _0819028C + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _08190290 +_08190286: + movs r0, 0xFF + b _08190292 + .align 2, 0 +_0819028C: .4byte 0x00000d25 +_08190290: + adds r0, r2, 0 +_08190292: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81901A0 + + thumb_func_start sub_8190298 +sub_8190298: @ 8190298 + push {lr} + bl sub_81902AC + ldr r1, _081902A8 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081902A8: .4byte 0x02038bca + thumb_func_end sub_8190298 + + thumb_func_start sub_81902AC +sub_81902AC: @ 81902AC + push {r4,lr} + ldr r0, _081902D4 + ldr r4, [r0] + ldr r1, _081902D8 + adds r0, r4, r1 + ldrh r0, [r0] + ldr r1, _081902DC + bl sub_81901A0 + lsls r0, 2 + adds r4, r0 + ldr r0, _081902E0 + adds r4, r0 + ldrh r0, [r4] + lsls r0, 22 + lsrs r0, 22 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081902D4: .4byte 0x03005d90 +_081902D8: .4byte 0x00000cb2 +_081902DC: .4byte 0x000003ff +_081902E0: .4byte 0x00000d24 + thumb_func_end sub_81902AC + + thumb_func_start sub_81902E4 +sub_81902E4: @ 81902E4 + push {lr} + ldr r0, _081902F4 + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .align 2, 0 +_081902F4: .4byte 0x02038bca + thumb_func_end sub_81902E4 + + thumb_func_start sub_81902F8 +sub_81902F8: @ 81902F8 + push {r4,lr} + ldr r4, _0819032C + ldr r0, [r4] + ldr r1, _08190330 + ldrh r1, [r1] + ldr r2, _08190334 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _08190338 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819032C: .4byte 0x03005d90 +_08190330: .4byte 0x020375e2 +_08190334: .4byte 0x00000ca8 +_08190338: .4byte 0x00000ca9 + thumb_func_end sub_81902F8 + + thumb_func_start sub_819033C +sub_819033C: @ 819033C + push {r4,r5,lr} + ldr r5, _0819039C + ldr r0, [r5] + ldr r1, _081903A0 + adds r0, r1 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r0, _081903A4 + bl var_get + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r3, _081903A8 + adds r1, r3 + adds r1, r4 + ldrh r0, [r1] + ldr r2, _081903AC + cmp r0, r2 + bhi _0819036E + adds r0, 0x1 + strh r0, [r1] +_0819036E: + ldr r0, [r5] + ldr r1, _081903B0 + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r2 + bhi _08190380 + adds r0, 0x1 + strh r0, [r1] +_08190380: + ldr r0, [r5] + adds r1, r0, r3 + adds r1, r4 + ldr r2, _081903B4 + adds r0, r2 + adds r0, r4 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _08190396 + strh r1, [r0] +_08190396: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819039C: .4byte 0x03005d90 +_081903A0: .4byte 0x00000ca9 +_081903A4: .4byte 0x000040ce +_081903A8: .4byte 0x00000d0c +_081903AC: .4byte 0x000003e6 +_081903B0: .4byte 0x00000d1c +_081903B4: .4byte 0x00000d14 + thumb_func_end sub_819033C + + thumb_func_start sub_81903B8 +sub_81903B8: @ 81903B8 + push {r4,r5,lr} + ldr r0, _081903F4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081903F8 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r5, 0 + strh r5, [r4, 0x8] + bl sub_81902AC + lsls r0, 16 + lsrs r0, 16 + bl sub_8195358 + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + ldr r0, _081903FC + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081903F4: .4byte sub_8190400 + 1 +_081903F8: .4byte 0x03005e00 +_081903FC: .4byte sub_8194B54 + 1 + thumb_func_end sub_81903B8 + + thumb_func_start sub_8190400 +sub_8190400: @ 8190400 + 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 + ldr r1, _0819043C + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r6, r0, r1 + movs r0, 0xA + ldrsh r5, [r6, r0] + movs r2, 0xC + ldrsh r1, [r6, r2] + mov r9, r1 + movs r0, 0xE + ldrsh r7, [r6, r0] + movs r1, 0x8 + ldrsh r4, [r6, r1] + cmp r4, 0x1 + beq _08190508 + cmp r4, 0x1 + bgt _08190440 + cmp r4, 0 + beq _0819044E + b _08190772 + .align 2, 0 +_0819043C: .4byte 0x03005e00 +_08190440: + cmp r4, 0x2 + bne _08190446 + b _08190570 +_08190446: + cmp r4, 0x3 + bne _0819044C + b _08190634 +_0819044C: + b _08190772 +_0819044E: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x1 + bl enable_irqs + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _081904B0 + add r0, sp, 0x4 + bl CpuSet + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081904B4 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _081904B8 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r0, _081904BC + strh r4, [r0] + ldr r0, _081904C0 + strh r4, [r0] + ldr r0, _081904C4 + strh r4, [r0] + ldr r0, _081904C8 + strh r4, [r0] + ldr r0, _081904CC + strh r4, [r0] + ldr r0, _081904D0 + strh r4, [r0] + mov r2, r9 + cmp r2, 0x2 + bne _081904DC + ldr r0, _081904D4 + strh r4, [r0] + ldr r0, _081904D8 + strh r4, [r0] + b _081904E6 + .align 2, 0 +_081904B0: .4byte 0x05006000 +_081904B4: .4byte 0x0860ce84 +_081904B8: .4byte 0x0860ceb4 +_081904BC: .4byte 0x02022e14 +_081904C0: .4byte 0x02022e16 +_081904C4: .4byte 0x02022e18 +_081904C8: .4byte 0x02022e1a +_081904CC: .4byte 0x02022e20 +_081904D0: .4byte 0x02022e22 +_081904D4: .4byte 0x02022e1c +_081904D8: .4byte 0x02022e1e +_081904DC: + ldr r0, _081904FC + strh r4, [r0] + ldr r1, _08190500 + movs r0, 0xA0 + strh r0, [r1] +_081904E6: + ldr r0, _08190504 + 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] + b _08190772 + .align 2, 0 +_081904FC: .4byte 0x02022e1c +_08190500: .4byte 0x02022e1e +_08190504: .4byte 0x03005e00 +_08190508: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x3F + bl lcd_io_set + bl sub_80A1A74 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _0819056C + movs r0, 0x4 + strb r0, [r1] + b _08190602 + .align 2, 0 +_0819056C: .4byte 0x0300301c +_08190570: + ldr r1, _0819060C + movs r5, 0x80 + lsls r5, 6 + movs r7, 0 + str r7, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _08190610 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _08190614 + movs r2, 0x80 + lsls r2, 4 + str r4, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, _08190618 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0819061C + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl decompress_palette + ldr r0, _08190620 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl decompress_palette + ldr r0, _08190624 + movs r1, 0xF0 + movs r2, 0x20 + bl decompress_palette + mov r0, r9 + cmp r0, 0x2 + bne _081905DE + ldr r0, _08190628 + movs r1, 0x50 + movs r2, 0x20 + bl decompress_palette +_081905DE: + str r7, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, _0819062C + ldr r2, _08190630 + bl CpuSet + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show +_08190602: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08190772 + .align 2, 0 +_0819060C: .4byte 0x08d83d50 +_08190610: .4byte 0x08d84970 +_08190614: .4byte 0x08d84f00 +_08190618: .4byte 0x0860cf50 +_0819061C: .4byte 0x08d85358 +_08190620: .4byte 0x08d85444 +_08190624: .4byte 0x08d85600 +_08190628: .4byte 0x08d854c8 +_0819062C: .4byte 0x02037b14 +_08190630: .4byte 0x05000100 +_08190634: + ldr r0, _08190698 + bl SetVBlankCallback + ldr r4, _0819069C + movs r0, 0x14 + bl malloc_and_clear + str r0, [r4] + movs r6, 0 + lsls r5, 24 + movs r2, 0xFF +_0819064A: + ldr r1, [r4] + adds r1, r6 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0xF + ble _0819064A + bl sub_80D2F04 + ldr r0, _081906A0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _081906A4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + strh r7, [r0, 0x10] + mov r2, r9 + cmp r2, 0x2 + bne _081906A8 + lsrs r1, r5, 24 + movs r0, 0 + bl sub_819314C + ldr r0, _0819069C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _081906B0 + .align 2, 0 +_08190698: .4byte sub_8194B70 + 1 +_0819069C: .4byte 0x0203cd78 +_081906A0: .4byte sub_8190CD4 + 1 +_081906A4: .4byte 0x03005e00 +_081906A8: + lsrs r1, r5, 24 + movs r0, 0 + bl sub_81924E0 +_081906B0: + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + mov r0, r9 + cmp r0, 0 + beq _0819076C + ldr r5, _08190784 + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x4 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r1, _08190788 + mov r8, r1 + add r4, r8 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start + strh r6, [r4, 0x2E] + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x9C + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + strh r6, [r4, 0x2E] + ldr r5, _0819078C + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r2, r8 + adds r4, r0, r2 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_start + strh r6, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + mov r1, r9 + cmp r1, 0x1 + bne _08190746 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190746: + adds r0, r5, 0 + movs r1, 0xEA + movs r2, 0x50 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl obj_anim_image_start + strh r6, [r4, 0x2E] + movs r0, 0x1 + strh r0, [r4, 0x30] +_0819076C: + mov r0, r10 + bl remove_task +_08190772: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08190784: .4byte 0x0860d068 +_08190788: .4byte 0x02020630 +_0819078C: .4byte 0x0860d050 + thumb_func_end sub_8190400 + + thumb_func_start sub_8190790 +sub_8190790: @ 8190790 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + adds r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081907D4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _081907BC + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081907BC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081907F0 + ldr r0, _081907D0 + str r0, [r2, 0x1C] + b _081907F0 + .align 2, 0 +_081907D0: .4byte nullsub_12 + 1 +_081907D4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xBF + ble _081907F0 + ldr r0, _081907F4 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081907F0: + pop {r0} + bx r0 + .align 2, 0 +_081907F4: .4byte 0x0203cd78 + thumb_func_end sub_8190790 + + thumb_func_start sub_81907F8 +sub_81907F8: @ 81907F8 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + subs r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190838 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xC0 + bgt _08190820 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_08190820: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190858 + ldr r0, _08190834 + str r0, [r2, 0x1C] + b _08190858 + .align 2, 0 +_08190834: .4byte nullsub_12 + 1 +_08190838: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190858 + ldr r0, _0819085C + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190858: + pop {r0} + bx r0 + .align 2, 0 +_0819085C: .4byte 0x0203cd78 + thumb_func_end sub_81907F8 + + thumb_func_start sub_8190860 +sub_8190860: @ 8190860 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + adds r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081908A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0819088C + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0819088C: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _081908C0 + ldr r0, _081908A0 + str r0, [r2, 0x1C] + b _081908C0 + .align 2, 0 +_081908A0: .4byte nullsub_12 + 1 +_081908A4: + lsls r1, 16 + ldr r0, _081908C4 + cmp r1, r0 + ble _081908C0 + ldr r0, _081908C8 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081908C0: + pop {r0} + bx r0 + .align 2, 0 +_081908C4: .4byte 0x010f0000 +_081908C8: .4byte 0x0203cd78 + thumb_func_end sub_8190860 + + thumb_func_start sub_81908CC +sub_81908CC: @ 81908CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + subs r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190910 + lsls r1, 16 + movs r0, 0x88 + lsls r0, 17 + cmp r1, r0 + bgt _081908F6 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081908F6: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190930 + ldr r0, _0819090C + str r0, [r2, 0x1C] + b _08190930 + .align 2, 0 +_0819090C: .4byte nullsub_12 + 1 +_08190910: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190930 + ldr r0, _08190934 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190930: + pop {r0} + bx r0 + .align 2, 0 +_08190934: .4byte 0x0203cd78 + thumb_func_end sub_81908CC + + thumb_func_start sub_8190938 +sub_8190938: @ 8190938 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0819094A + adds r0, r1, 0 + bl sub_80D30DC +_0819094A: + pop {r0} + bx r0 + thumb_func_end sub_8190938 + + thumb_func_start sub_8190950 +sub_8190950: @ 8190950 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190962 + adds r0, r4, 0 + bl sub_80D30DC +_08190962: + ldrh r0, [r4, 0x22] + adds r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081909A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _0819098A + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0819098A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081909C0 + ldr r0, _081909A0 + str r0, [r4, 0x1C] + b _081909C0 + .align 2, 0 +_081909A0: .4byte sub_8190938 + 1 +_081909A4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xAF + ble _081909C0 + ldr r0, _081909C8 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_081909C0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081909C8: .4byte 0x0203cd78 + thumb_func_end sub_8190950 + + thumb_func_start sub_81909CC +sub_81909CC: @ 81909CC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081909DE + adds r0, r4, 0 + bl sub_80D30DC +_081909DE: + ldrh r0, [r4, 0x22] + subs r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A1C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xB0 + bgt _08190A02 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A02: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190A3C + ldr r0, _08190A18 + str r0, [r4, 0x1C] + b _08190A3C + .align 2, 0 +_08190A18: .4byte sub_8190938 + 1 +_08190A1C: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190A3C + ldr r0, _08190A44 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190A3C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08190A44: .4byte 0x0203cd78 + thumb_func_end sub_81909CC + + thumb_func_start sub_8190A48 +sub_8190A48: @ 8190A48 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190A5A + adds r0, r4, 0 + bl sub_80D30DC +_08190A5A: + ldrh r0, [r4, 0x20] + adds r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A9C + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _08190A82 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A82: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190AB8 + ldr r0, _08190A98 + str r0, [r4, 0x1C] + b _08190AB8 + .align 2, 0 +_08190A98: .4byte sub_8190938 + 1 +_08190A9C: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08190AB8 + ldr r0, _08190AC0 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190AB8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08190AC0: .4byte 0x0203cd78 + thumb_func_end sub_8190A48 + + thumb_func_start sub_8190AC4 +sub_8190AC4: @ 8190AC4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190AD6 + adds r0, r4, 0 + bl sub_80D30DC +_08190AD6: + ldrh r0, [r4, 0x20] + subs r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190B14 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bgt _08190AFC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190AFC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190B34 + ldr r0, _08190B10 + str r0, [r4, 0x1C] + b _08190B34 + .align 2, 0 +_08190B10: .4byte sub_8190938 + 1 +_08190B14: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190B34 + ldr r0, _08190B3C + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190B34: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08190B3C: .4byte 0x0203cd78 + thumb_func_end sub_8190AC4 + + thumb_func_start sub_8190B40 +sub_8190B40: @ 8190B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r6, [r3, r0] + ldr r2, _08190BE4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r2 + movs r7, 0x10 + ldrsh r1, [r4, r7] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + ldr r1, _08190BE8 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 + ldr r1, _08190BEC + ldr r5, [r1] + ldr r7, _08190BF0 + adds r0, r5, r7 + ldrh r0, [r0] + mov r12, r0 + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r9, r2 + mov r8, r1 + cmp r0, 0x1 + bne _08190C0C + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08190BFC + mov r2, r10 + lsls r0, r2, 2 + adds r1, r5, r0 + ldr r7, _08190BF4 + adds r1, r7 + ldrb r2, [r1] + lsls r1, r2, 29 + adds r4, r0, 0 + cmp r1, 0 + bge _08190BB6 + ldr r0, _08190BF8 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + subs r1, 0x1 + lsls r0, r2, 27 + lsrs r0, 30 + cmp r1, r0 + blt _08190C32 +_08190BB6: + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldr r2, _08190BF4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190BD4 + ldr r0, _08190BF8 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + subs r0, 0x1 + cmp r0, r12 + blt _08190C32 +_08190BD4: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r9 + movs r7, 0x8 + ldrsh r0, [r0, r7] + b _08190C4C + .align 2, 0 +_08190BE4: .4byte 0x03005e00 +_08190BE8: .4byte 0x0860d080 +_08190BEC: .4byte 0x03005d90 +_08190BF0: .4byte 0x00000cb2 +_08190BF4: .4byte 0x00000d25 +_08190BF8: .4byte 0x0203cd78 +_08190BFC: + ldr r0, _08190C08 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190C32 + b _08190C48 + .align 2, 0 +_08190C08: .4byte 0x0203cd78 +_08190C0C: + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08190C28 + ldr r0, _08190C24 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bls _08190C32 + movs r7, 0x8 + ldrsh r0, [r4, r7] + b _08190C4C + .align 2, 0 +_08190C24: .4byte 0x0203cd78 +_08190C28: + ldr r0, _08190C44 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08190C48 +_08190C32: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _08190C5C + .align 2, 0 +_08190C44: .4byte 0x0203cd78 +_08190C48: + movs r1, 0x8 + ldrsh r0, [r4, r1] +_08190C4C: + cmp r0, 0x2 + bne _08190C5C + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190C5C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8190B40 + + thumb_func_start sub_8190C6C +sub_8190C6C: @ 8190C6C + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + ldr r2, _08190C94 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _08190C9C + ldr r0, _08190C98 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190CA6 + b _08190CC0 + .align 2, 0 +_08190C94: .4byte 0x03005e00 +_08190C98: .4byte 0x0203cd78 +_08190C9C: + ldr r0, _08190CBC + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + beq _08190CC0 +_08190CA6: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + bne _08190CCE + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _08190CCE + .align 2, 0 +_08190CBC: .4byte 0x0203cd78 +_08190CC0: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190CCE: + pop {r0} + bx r0 + thumb_func_end sub_8190C6C + + thumb_func_start sub_8190CD4 +sub_8190CD4: @ 8190CD4 + 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 r8, r0 + ldr r1, _08190D10 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r2, [r0, r3] + mov r9, r2 + movs r4, 0x10 + ldrsh r7, [r0, r4] + movs r5, 0x8 + ldrsh r0, [r0, r5] + cmp r0, 0x8 + bls _08190D06 + bl _08192202 +_08190D06: + lsls r0, 2 + ldr r1, _08190D14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08190D10: .4byte 0x03005e00 +_08190D14: .4byte _08190D18 + .align 2, 0 +_08190D18: + .4byte _08190D3C + .4byte _08190D7C + .4byte _08190DA8 + .4byte _08190E48 + .4byte _08191FF8 + .4byte _08192038 + .4byte _08192078 + .4byte _081920BC + .4byte _08192106 +_08190D3C: + ldr r0, _08190D74 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08190D50 + bl _08192202 +_08190D50: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _08190D78 + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + bl _08192202 + .align 2, 0 +_08190D74: .4byte 0x02037fd4 +_08190D78: .4byte 0x03005e00 +_08190D7C: + ldr r0, _08190DA0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08190D8C + bl _08192202 +_08190D8C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r2, _08190DA4 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + bl _08192202 + .align 2, 0 +_08190DA0: .4byte 0x02037fd4 +_08190DA4: .4byte 0x03005e00 +_08190DA8: + mov r0, r8 + bl sub_819221C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bgt _08190DBE + cmp r6, 0x1 + bge _08190DF0 + bl _08192202 +_08190DBE: + cmp r6, 0x9 + beq _08190DC6 + bl _08192202 +_08190DC6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08190DEC + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0x8] + bl _08192202 + .align 2, 0 +_08190DEC: .4byte 0x03005e00 +_08190DF0: + ldr r1, _08190E44 + mov r4, r8 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x12] + movs r5, 0xC + ldrsh r0, [r0, r5] + movs r1, 0 + mov r9, r2 + cmp r0, 0 + beq _08190E0C + movs r1, 0x9 +_08190E0C: + adds r6, r1, 0 + adds r0, r6, 0 + adds r0, 0x9 + cmp r6, r0 + bge _08190E32 + adds r5, r0, 0 +_08190E18: + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r6, 0x1 + cmp r6, r5 + blt _08190E18 +_08190E32: + ldr r0, _08190E44 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x8] + bl _08192202 + .align 2, 0 +_08190E44: .4byte 0x03005e00 +_08190E48: + mov r6, r8 + lsls r1, r6, 2 + adds r0, r1, r6 + lsls r0, 3 + ldr r2, _08190E70 + adds r0, r2 + movs r3, 0x12 + ldrsh r6, [r0, r3] + subs r0, r6, 0x1 + mov r9, r1 + cmp r0, 0x7 + bls _08190E64 + bl _08192202 +_08190E64: + lsls r0, 2 + ldr r1, _08190E74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08190E70: .4byte 0x03005e00 +_08190E74: .4byte _08190E78 + .align 2, 0 +_08190E78: + .4byte _08190E98 + .4byte _08191234 + .4byte _081915CC + .4byte _08191B08 + .4byte _08190E98 + .4byte _08191234 + .4byte _0819187C + .4byte _08191D68 +_08190E98: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, _08190EC0 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08190ED4 + ldr r0, _08190EC4 + movs r1, 0 + strh r1, [r0] + ldr r0, _08190EC8 + strh r1, [r0] + ldr r0, _08190ECC + strh r1, [r0] + ldr r1, _08190ED0 + movs r0, 0xA0 + strh r0, [r1] + b _08190EE6 + .align 2, 0 +_08190EC0: .4byte 0x03005e00 +_08190EC4: .4byte 0x02022e14 +_08190EC8: .4byte 0x02022e16 +_08190ECC: .4byte 0x02022e18 +_08190ED0: .4byte 0x02022e1a +_08190ED4: + ldr r0, _08190F2C + strh r2, [r0] + ldr r1, _08190F30 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, _08190F34 + strh r2, [r0] + ldr r0, _08190F38 + strh r2, [r0] +_08190EE6: + cmp r6, 0x1 + bne _08190F9C + ldr r5, _08190F3C + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08190F50 + ldr r0, _08190F40 + strh r1, [r0] + ldr r1, _08190F44 + movs r6, 0xA0 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r3, _08190F48 + ldr r2, _08190F4C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _08191084 + .align 2, 0 +_08190F2C: .4byte 0x02022e14 +_08190F30: .4byte 0x02022e16 +_08190F34: .4byte 0x02022e18 +_08190F38: .4byte 0x02022e1a +_08190F3C: .4byte 0x0203cd78 +_08190F40: .4byte 0x02022e1c +_08190F44: .4byte 0x02022e1e +_08190F48: .4byte 0x0860d080 +_08190F4C: .4byte 0x03005e00 +_08190F50: + ldr r1, _08190F8C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r0, _08190F90 + movs r4, 0 + strh r4, [r0] + ldr r3, _08190F94 + ldr r2, _08190F98 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _08191084 + .align 2, 0 +_08190F8C: .4byte 0x02022e1c +_08190F90: .4byte 0x02022e1e +_08190F94: .4byte 0x0860d080 +_08190F98: .4byte 0x03005e00 +_08190F9C: + ldr r6, _08190FE8 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08190FF8 + ldr r4, _08190FEC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, _08190FF0 + strh r5, [r0] + ldr r1, _08190FF4 + movs r3, 0xA0 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191084 + .align 2, 0 +_08190FE8: .4byte 0x0203cd78 +_08190FEC: .4byte 0x03005e00 +_08190FF0: .4byte 0x02022e1c +_08190FF4: .4byte 0x02022e1e +_08190FF8: + cmp r5, 0x2 + bne _0819104C + ldr r4, _08191040 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, _08191044 + movs r0, 0 + strh r0, [r1] + ldr r1, _08191048 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191084 + .align 2, 0 +_08191040: .4byte 0x03005e00 +_08191044: .4byte 0x02022e1c +_08191048: .4byte 0x02022e1e +_0819104C: + ldr r1, _081910F4 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r1, _081910F8 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _081910FC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r4, 0xA + ldrsh r0, [r0, r4] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191084: + movs r6, 0 + ldr r5, _08191100 + mov r10, r5 + ldr r3, _08191104 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, _081910FC + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_0819109E: + cmp r6, 0x1 + bgt _0819110C + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191108 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191150 + .align 2, 0 +_081910F4: .4byte 0x02022e1c +_081910F8: .4byte 0x02022e1e +_081910FC: .4byte 0x03005e00 +_08191100: .4byte 0x0203cd78 +_08191104: .4byte 0x02020630 +_08191108: .4byte sub_8190790 + 1 +_0819110C: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _081911C0 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191150: + adds r6, 0x1 + cmp r6, 0x7 + ble _0819109E + movs r6, 0x8 + ldr r2, _081911C4 + mov r12, r2 + ldr r3, _081911C8 + ldr r1, _081911CC + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_0819116E: + cmp r6, 0x9 + bgt _081911D4 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _081911D0 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191214 + .align 2, 0 +_081911C0: .4byte sub_8190950 + 1 +_081911C4: .4byte 0x0203cd78 +_081911C8: .4byte 0x02020630 +_081911CC: .4byte 0x03005e00 +_081911D0: .4byte sub_8190790 + 1 +_081911D4: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _0819122C + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191214: + adds r6, 0x1 + cmp r6, 0xF + ble _0819116E + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, _08191230 + adds r0, r3 + movs r2, 0 + movs r1, 0x4 + bl _08191FE8 + .align 2, 0 +_0819122C: .4byte sub_8190950 + 1 +_08191230: .4byte 0x03005e00 +_08191234: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, _08191260 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191278 + ldr r0, _08191264 + movs r1, 0 + strh r1, [r0] + ldr r0, _08191268 + strh r1, [r0] + ldr r0, _0819126C + strh r1, [r0] + ldr r1, _08191270 + ldr r2, _08191274 + adds r0, r2, 0 + strh r0, [r1] + b _0819128C + .align 2, 0 +_08191260: .4byte 0x03005e00 +_08191264: .4byte 0x02022e14 +_08191268: .4byte 0x02022e16 +_0819126C: .4byte 0x02022e18 +_08191270: .4byte 0x02022e1a +_08191274: .4byte 0x0000ff60 +_08191278: + ldr r0, _081912CC + strh r2, [r0] + ldr r1, _081912D0 + ldr r3, _081912D4 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _081912D8 + strh r2, [r0] + ldr r0, _081912DC + strh r2, [r0] +_0819128C: + cmp r6, 0x2 + bne _0819133C + ldr r5, _081912E0 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _081912F4 + ldr r0, _081912E4 + strh r1, [r0] + ldr r1, _081912E8 + movs r0, 0xA0 + strh r0, [r1] + ldr r3, _081912EC + ldr r2, _081912F0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _0819141C + .align 2, 0 +_081912CC: .4byte 0x02022e14 +_081912D0: .4byte 0x02022e16 +_081912D4: .4byte 0x0000ff60 +_081912D8: .4byte 0x02022e18 +_081912DC: .4byte 0x02022e1a +_081912E0: .4byte 0x0203cd78 +_081912E4: .4byte 0x02022e1c +_081912E8: .4byte 0x02022e1e +_081912EC: .4byte 0x0860d080 +_081912F0: .4byte 0x03005e00 +_081912F4: + ldr r0, _0819132C + movs r4, 0 + strh r4, [r0] + ldr r0, _08191330 + strh r4, [r0] + ldr r3, _08191334 + ldr r2, _08191338 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _0819141C + .align 2, 0 +_0819132C: .4byte 0x02022e1c +_08191330: .4byte 0x02022e1e +_08191334: .4byte 0x0860d080 +_08191338: .4byte 0x03005e00 +_0819133C: + ldr r6, _08191384 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08191394 + ldr r4, _08191388 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, _0819138C + strh r5, [r0] + ldr r1, _08191390 + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _0819141C + .align 2, 0 +_08191384: .4byte 0x0203cd78 +_08191388: .4byte 0x03005e00 +_0819138C: .4byte 0x02022e1c +_08191390: .4byte 0x02022e1e +_08191394: + cmp r5, 0x2 + bne _081913E4 + ldr r4, _081913D8 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r0, [r0, r3] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, _081913DC + movs r0, 0 + strh r0, [r1] + ldr r1, _081913E0 + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _0819141C + .align 2, 0 +_081913D8: .4byte 0x03005e00 +_081913DC: .4byte 0x02022e1c +_081913E0: .4byte 0x02022e1e +_081913E4: + ldr r1, _0819148C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, _08191490 + movs r0, 0 + strh r0, [r1] + ldr r1, _08191494 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_0819141C: + movs r6, 0 + ldr r0, _08191498 + mov r10, r0 + ldr r3, _0819149C + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, _08191494 + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191436: + cmp r6, 0x1 + bgt _081914A4 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _081914A0 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081914E8 + .align 2, 0 +_0819148C: .4byte 0x02022e1c +_08191490: .4byte 0x02022e1e +_08191494: .4byte 0x03005e00 +_08191498: .4byte 0x0203cd78 +_0819149C: .4byte 0x02020630 +_081914A0: .4byte sub_81907F8 + 1 +_081914A4: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191558 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081914E8: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191436 + movs r6, 0x8 + ldr r2, _0819155C + mov r12, r2 + ldr r3, _08191560 + ldr r1, _08191564 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191506: + cmp r6, 0x9 + bgt _0819156C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191568 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081915AC + .align 2, 0 +_08191558: .4byte sub_81909CC + 1 +_0819155C: .4byte 0x0203cd78 +_08191560: .4byte 0x02020630 +_08191564: .4byte 0x03005e00 +_08191568: .4byte sub_81907F8 + 1 +_0819156C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _081915C4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081915AC: + adds r6, 0x1 + cmp r6, 0xF + ble _08191506 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, _081915C8 + adds r0, r3 + movs r2, 0 + movs r1, 0x5 + bl _08191FE8 + .align 2, 0 +_081915C4: .4byte sub_81909CC + 1 +_081915C8: .4byte 0x03005e00 +_081915CC: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, _081915F8 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _0819160C + ldr r0, _081915FC + movs r1, 0 + strh r1, [r0] + ldr r0, _08191600 + strh r1, [r0] + ldr r2, _08191604 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, _08191608 + strh r1, [r0] + b _08191622 + .align 2, 0 +_081915F8: .4byte 0x03005e00 +_081915FC: .4byte 0x02022e14 +_08191600: .4byte 0x02022e16 +_08191604: .4byte 0x02022e18 +_08191608: .4byte 0x02022e1a +_0819160C: + ldr r1, _08191664 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _08191668 + strh r2, [r0] + ldr r0, _0819166C + strh r2, [r0] + ldr r0, _08191670 + strh r2, [r0] +_08191622: + ldr r0, _08191674 + ldr r4, [r0] + ldrb r0, [r4, 0x10] + cmp r0, 0 + bne _08191688 + ldr r1, _08191678 + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, _0819167C + movs r0, 0xA0 + strh r0, [r1] + ldr r3, _08191680 + ldr r2, _08191684 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _081916C6 + .align 2, 0 +_08191664: .4byte 0x02022e14 +_08191668: .4byte 0x02022e16 +_0819166C: .4byte 0x02022e18 +_08191670: .4byte 0x02022e1a +_08191674: .4byte 0x0203cd78 +_08191678: .4byte 0x02022e1c +_0819167C: .4byte 0x02022e1e +_08191680: .4byte 0x0860d080 +_08191684: .4byte 0x03005e00 +_08191688: + ldr r1, _08191738 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r1, _0819173C + movs r0, 0 + strh r0, [r1] + ldr r3, _08191740 + ldr r2, _08191744 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + lsls r1, 2 + subs r1, 0x1 + ldrb r4, [r4, 0x10] + adds r1, r4 + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C +_081916C6: + movs r6, 0 + ldr r0, _08191748 + mov r10, r0 + ldr r3, _0819174C + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, _08191744 + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_081916E0: + cmp r6, 0x1 + bgt _08191754 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191750 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191798 + .align 2, 0 +_08191738: .4byte 0x02022e1c +_0819173C: .4byte 0x02022e1e +_08191740: .4byte 0x0860d15c +_08191744: .4byte 0x03005e00 +_08191748: .4byte 0x0203cd78 +_0819174C: .4byte 0x02020630 +_08191750: .4byte sub_8190860 + 1 +_08191754: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191808 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191798: + adds r6, 0x1 + cmp r6, 0x7 + ble _081916E0 + movs r6, 0x8 + ldr r2, _0819180C + mov r12, r2 + ldr r3, _08191810 + ldr r1, _08191814 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_081917B6: + cmp r6, 0x9 + bgt _0819181C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191818 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _0819185C + .align 2, 0 +_08191808: .4byte sub_8190A48 + 1 +_0819180C: .4byte 0x0203cd78 +_08191810: .4byte 0x02020630 +_08191814: .4byte 0x03005e00 +_08191818: .4byte sub_8190860 + 1 +_0819181C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191874 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_0819185C: + adds r6, 0x1 + cmp r6, 0xF + ble _081917B6 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, _08191878 + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .align 2, 0 +_08191874: .4byte sub_8190A48 + 1 +_08191878: .4byte 0x03005e00 +_0819187C: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, _081918A8 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _081918BC + ldr r0, _081918AC + movs r1, 0 + strh r1, [r0] + ldr r0, _081918B0 + strh r1, [r0] + ldr r2, _081918B4 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, _081918B8 + strh r1, [r0] + b _081918D2 + .align 2, 0 +_081918A8: .4byte 0x03005e00 +_081918AC: .4byte 0x02022e14 +_081918B0: .4byte 0x02022e16 +_081918B4: .4byte 0x02022e18 +_081918B8: .4byte 0x02022e1a +_081918BC: + ldr r1, _08191904 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _08191908 + strh r2, [r0] + ldr r0, _0819190C + strh r2, [r0] + ldr r0, _08191910 + strh r2, [r0] +_081918D2: + ldr r0, _08191914 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _08191924 + ldr r1, _08191918 + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, _0819191C + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _08191920 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191958 + .align 2, 0 +_08191904: .4byte 0x02022e14 +_08191908: .4byte 0x02022e16 +_0819190C: .4byte 0x02022e18 +_08191910: .4byte 0x02022e1a +_08191914: .4byte 0x0203cd78 +_08191918: .4byte 0x02022e1c +_0819191C: .4byte 0x02022e1e +_08191920: .4byte 0x03005e00 +_08191924: + ldr r1, _081919C8 + movs r0, 0 + strh r0, [r1] + ldr r1, _081919CC + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _081919D0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191958: + movs r6, 0 + ldr r0, _081919D4 + mov r10, r0 + ldr r3, _081919D8 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, _081919D0 + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191972: + cmp r6, 0x1 + bgt _081919E0 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _081919DC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191A24 + .align 2, 0 +_081919C8: .4byte 0x02022e1c +_081919CC: .4byte 0x02022e1e +_081919D0: .4byte 0x03005e00 +_081919D4: .4byte 0x0203cd78 +_081919D8: .4byte 0x02020630 +_081919DC: .4byte sub_8190860 + 1 +_081919E0: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191A94 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191A24: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191972 + movs r6, 0x8 + ldr r2, _08191A98 + mov r12, r2 + ldr r3, _08191A9C + ldr r1, _08191AA0 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191A42: + cmp r6, 0x9 + bgt _08191AA8 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191AA4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191AE8 + .align 2, 0 +_08191A94: .4byte sub_8190A48 + 1 +_08191A98: .4byte 0x0203cd78 +_08191A9C: .4byte 0x02020630 +_08191AA0: .4byte 0x03005e00 +_08191AA4: .4byte sub_8190860 + 1 +_08191AA8: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191B00 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191AE8: + adds r6, 0x1 + cmp r6, 0xF + ble _08191A42 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, _08191B04 + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .align 2, 0 +_08191B00: .4byte sub_8190A48 + 1 +_08191B04: .4byte 0x03005e00 +_08191B08: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, _08191B34 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191B48 + ldr r0, _08191B38 + movs r1, 0 + strh r1, [r0] + ldr r0, _08191B3C + strh r1, [r0] + ldr r2, _08191B40 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, _08191B44 + strh r1, [r0] + b _08191B5E + .align 2, 0 +_08191B34: .4byte 0x03005e00 +_08191B38: .4byte 0x02022e14 +_08191B3C: .4byte 0x02022e16 +_08191B40: .4byte 0x02022e18 +_08191B44: .4byte 0x02022e1a +_08191B48: + ldr r1, _08191B78 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _08191B7C + strh r2, [r0] + ldr r0, _08191B80 + strh r2, [r0] + ldr r0, _08191B84 + strh r2, [r0] +_08191B5E: + ldr r0, _08191B88 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _08191B94 + ldr r1, _08191B8C + movs r0, 0 + strh r0, [r1] + ldr r1, _08191B90 + movs r0, 0xA0 + strh r0, [r1] + b _08191B9E + .align 2, 0 +_08191B78: .4byte 0x02022e14 +_08191B7C: .4byte 0x02022e16 +_08191B80: .4byte 0x02022e18 +_08191B84: .4byte 0x02022e1a +_08191B88: .4byte 0x0203cd78 +_08191B8C: .4byte 0x02022e1c +_08191B90: .4byte 0x02022e1e +_08191B94: + ldr r0, _08191C34 + movs r1, 0 + strh r1, [r0] + ldr r0, _08191C38 + strh r1, [r0] +_08191B9E: + ldr r4, _08191C3C + ldr r5, _08191C40 + ldr r3, [r5] + ldr r2, _08191C44 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + lsls r1, 2 + subs r1, 0x1 + ldrb r3, [r3, 0x10] + adds r1, r3 + adds r1, r4 + mov r4, r9 + add r4, r8 + lsls r4, 3 + adds r4, r2 + ldrb r2, [r4, 0xC] + movs r0, 0x2 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C + movs r6, 0 + ldr r7, _08191C48 + mov r12, r6 + mov r10, r5 + adds r5, r7, 0 + adds r5, 0x1C +_08191BDC: + cmp r6, 0x1 + bgt _08191C50 + mov r1, r10 + ldr r0, [r1] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08191C4C + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r12 + strh r2, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r1, [r0, 0x34] + b _08191C96 + .align 2, 0 +_08191C34: .4byte 0x02022e1c +_08191C38: .4byte 0x02022e1e +_08191C3C: .4byte 0x0860d15c +_08191C40: .4byte 0x0203cd78 +_08191C44: .4byte 0x03005e00 +_08191C48: .4byte 0x02020630 +_08191C4C: .4byte sub_81908CC + 1 +_08191C50: + mov r3, r10 + ldr r0, [r3] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _08191D08 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] +_08191C96: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191BDC + movs r6, 0x8 + ldr r2, _08191D0C + mov r12, r2 + ldr r3, _08191D10 + ldr r1, _08191D14 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191CB4: + cmp r6, 0x9 + bgt _08191D1C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191D18 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191D5C + .align 2, 0 +_08191D08: .4byte sub_8190AC4 + 1 +_08191D0C: .4byte 0x0203cd78 +_08191D10: .4byte 0x02020630 +_08191D14: .4byte 0x03005e00 +_08191D18: .4byte sub_81908CC + 1 +_08191D1C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191D64 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191D5C: + adds r6, 0x1 + cmp r6, 0xF + ble _08191CB4 + b _08191FDA + .align 2, 0 +_08191D64: .4byte sub_8190AC4 + 1 +_08191D68: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, _08191D94 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191DA8 + ldr r0, _08191D98 + movs r1, 0 + strh r1, [r0] + ldr r0, _08191D9C + strh r1, [r0] + ldr r2, _08191DA0 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, _08191DA4 + strh r1, [r0] + b _08191DBE + .align 2, 0 +_08191D94: .4byte 0x03005e00 +_08191D98: .4byte 0x02022e14 +_08191D9C: .4byte 0x02022e16 +_08191DA0: .4byte 0x02022e18 +_08191DA4: .4byte 0x02022e1a +_08191DA8: + ldr r1, _08191DF0 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _08191DF4 + strh r2, [r0] + ldr r0, _08191DF8 + strh r2, [r0] + ldr r0, _08191DFC + strh r2, [r0] +_08191DBE: + ldr r0, _08191E00 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0x2 + bne _08191E10 + ldr r1, _08191E04 + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, _08191E08 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _08191E0C + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191E44 + .align 2, 0 +_08191DF0: .4byte 0x02022e14 +_08191DF4: .4byte 0x02022e16 +_08191DF8: .4byte 0x02022e18 +_08191DFC: .4byte 0x02022e1a +_08191E00: .4byte 0x0203cd78 +_08191E04: .4byte 0x02022e1c +_08191E08: .4byte 0x02022e1e +_08191E0C: .4byte 0x03005e00 +_08191E10: + ldr r1, _08191EB4 + movs r0, 0 + strh r0, [r1] + ldr r1, _08191EB8 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, _08191EBC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191E44: + movs r6, 0 + ldr r0, _08191EC0 + mov r10, r0 + ldr r3, _08191EC4 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, _08191EBC + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191E5E: + cmp r6, 0x1 + bgt _08191ECC + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191EC8 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191F10 + .align 2, 0 +_08191EB4: .4byte 0x02022e1c +_08191EB8: .4byte 0x02022e1e +_08191EBC: .4byte 0x03005e00 +_08191EC0: .4byte 0x0203cd78 +_08191EC4: .4byte 0x02020630 +_08191EC8: .4byte sub_81908CC + 1 +_08191ECC: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, _08191F80 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191F10: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191E5E + movs r6, 0x8 + ldr r2, _08191F84 + mov r12, r2 + ldr r3, _08191F88 + ldr r1, _08191F8C + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191F2E: + cmp r6, 0x9 + bgt _08191F94 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191F90 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191FD4 + .align 2, 0 +_08191F80: .4byte sub_8190AC4 + 1 +_08191F84: .4byte 0x0203cd78 +_08191F88: .4byte 0x02020630 +_08191F8C: .4byte 0x03005e00 +_08191F90: .4byte sub_81908CC + 1 +_08191F94: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, _08191FF0 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191FD4: + adds r6, 0x1 + cmp r6, 0xF + ble _08191F2E +_08191FDA: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, _08191FF4 + adds r0, r3 + movs r2, 0 + movs r1, 0x7 +_08191FE8: + strh r1, [r0, 0x8] + strh r2, [r0, 0x12] + b _08192202 + .align 2, 0 +_08191FF0: .4byte sub_8190AC4 + 1 +_08191FF4: .4byte 0x03005e00 +_08191FF8: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + ldr r5, _08192028 + adds r1, r0, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, _0819202C + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, _08192030 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, _08192034 + b _081920A4 + .align 2, 0 +_08192028: .4byte 0x03005e00 +_0819202C: .4byte 0x02022e16 +_08192030: .4byte 0x02022e1a +_08192034: .4byte 0x02022e1e +_08192038: + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + ldr r2, _08192068 + adds r1, r0, r2 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, _0819206C + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, _08192070 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, _08192074 + b _081920E8 + .align 2, 0 +_08192068: .4byte 0x03005e00 +_0819206C: .4byte 0x02022e16 +_08192070: .4byte 0x02022e1a +_08192074: .4byte 0x02022e1e +_08192078: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + ldr r4, _081920AC + adds r1, r0, r4 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, _081920B0 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, _081920B4 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, _081920B8 +_081920A4: + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + b _08192202 + .align 2, 0 +_081920AC: .4byte 0x03005e00 +_081920B0: .4byte 0x02022e14 +_081920B4: .4byte 0x02022e18 +_081920B8: .4byte 0x02022e1c +_081920BC: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + ldr r6, _081920F0 + adds r1, r0, r6 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, _081920F4 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, _081920F8 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, _081920FC +_081920E8: + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + b _08192202 + .align 2, 0 +_081920F0: .4byte 0x03005e00 +_081920F4: .4byte 0x02022e14 +_081920F8: .4byte 0x02022e18 +_081920FC: .4byte 0x02022e1c +_08192100: + movs r0, 0x2 + strh r0, [r1, 0x8] + b _08192202 +_08192106: + ldr r0, _0819212C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08192202 + movs r6, 0 + ldr r4, _08192130 +_08192116: + cmp r6, 0x1 + bgt _08192134 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + bl sub_818D8F0 + b _0819214E + .align 2, 0 +_0819212C: .4byte 0x02037fd4 +_08192130: .4byte 0x0203cd78 +_08192134: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0819216C + adds r0, r1 + bl sub_80D2EF8 +_0819214E: + adds r6, 0x1 + cmp r6, 0x7 + ble _08192116 + movs r6, 0x8 + ldr r4, _08192170 +_08192158: + cmp r6, 0x9 + bgt _08192174 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + bl sub_818D8F0 + b _0819218E + .align 2, 0 +_0819216C: .4byte 0x02020630 +_08192170: .4byte 0x0203cd78 +_08192174: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081921B8 + adds r0, r1 + bl sub_80D2EF8 +_0819218E: + adds r6, 0x1 + cmp r6, 0xF + ble _08192158 + bl sub_80D2F9C + ldr r4, _081921BC + ldr r0, [r4] + bl free + movs r5, 0 + str r5, [r4] + bl Window_FreeMemory + mov r0, r9 + cmp r0, 0 + bne _081921C4 + ldr r0, _081921C0 + bl set_callback2 + b _081921FC + .align 2, 0 +_081921B8: .4byte 0x02020630 +_081921BC: .4byte 0x0203cd78 +_081921C0: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_081921C4: + ldr r0, _08192214 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, _08192218 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r5, [r1, 0xA] + movs r0, 0x3 + strh r0, [r1, 0xC] + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0xE] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x14] + strh r0, [r1, 0x10] +_081921FC: + mov r0, r8 + bl remove_task +_08192202: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08192214: .4byte sub_8194220 + 1 +_08192218: .4byte 0x03005e00 + thumb_func_end sub_8190CD4 + + thumb_func_start sub_819221C +sub_819221C: @ 819221C + 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 + movs r7, 0 + ldr r2, _0819229C + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r2 + mov r12, r0 + movs r1, 0x10 + ldrsh r6, [r0, r1] + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + movs r3, 0xA + ldrsh r5, [r0, r3] + ldr r0, _081922A0 + adds r0, r5, r0 + ldrb r0, [r0] + mov r10, r0 + ldr r3, _081922A4 + ldr r0, [r3] + ldr r1, _081922A8 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r1, _081922AC + ldrh r4, [r1, 0x2E] + movs r0, 0x3 + ands r0, r4 + adds r2, r1, 0 + cmp r0, 0 + beq _0819226E + movs r7, 0x9 +_0819226E: + mov r3, r12 + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0819227A + b _081924CC +_0819227A: + cmp r0, 0x1 + beq _08192280 + b _081923B0 +_08192280: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081922BA + ldr r0, _081922B0 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922BA + cmp r5, 0 + bne _081922B4 + movs r5, 0xF + b _081922B6 + .align 2, 0 +_0819229C: .4byte 0x03005e00 +_081922A0: .4byte 0x0860d080 +_081922A4: .4byte 0x03005d90 +_081922A8: .4byte 0x00000cb2 +_081922AC: .4byte 0x030022c0 +_081922B0: .4byte 0x0203cd78 +_081922B4: + subs r5, 0x1 +_081922B6: + movs r7, 0x1 + b _08192360 +_081922BA: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081922E2 + ldr r0, _081922D8 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922E2 + cmp r5, 0xF + bne _081922DC + movs r5, 0 + b _081922DE + .align 2, 0 +_081922D8: .4byte 0x0203cd78 +_081922DC: + adds r5, 0x1 +_081922DE: + movs r7, 0x2 + b _08192360 +_081922E2: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08192304 + ldr r0, _08192300 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _08192304 + subs r0, 0x1 + strb r0, [r1, 0x10] + movs r7, 0x3 + b _08192360 + .align 2, 0 +_08192300: .4byte 0x0203cd78 +_08192304: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192360 + ldr r2, _0819238C + ldr r0, [r2] + mov r3, r10 + lsls r1, r3, 2 + adds r0, r1 + ldr r2, _08192390 + adds r0, r2 + ldrb r3, [r0] + lsls r0, r3, 29 + mov r12, r1 + cmp r0, 0 + bge _0819233C + ldr r0, _08192394 + ldr r2, [r0] + ldrb r4, [r2, 0x10] + subs r1, r4, 0x1 + lsls r0, r3, 27 + lsrs r0, 30 + cmp r1, r0 + bge _0819233C + adds r0, r4, 0x1 + strb r0, [r2, 0x10] + movs r7, 0x4 +_0819233C: + ldr r3, _0819238C + ldr r0, [r3] + add r0, r12 + ldr r1, _08192390 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192360 + ldr r0, _08192394 + ldr r3, [r0] + ldrb r1, [r3, 0x10] + subs r0, r1, 0x1 + cmp r0, r8 + bge _08192360 + adds r0, r1, 0x1 + strb r0, [r3, 0x10] + movs r7, 0x4 +_08192360: + cmp r7, 0x9 + beq _08192366 + b _081924A0 +_08192366: + ldr r0, _08192394 + ldr r3, [r0] + ldrb r0, [r3, 0x10] + cmp r0, 0 + beq _081923A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, _08192398 + adds r1, r2 + ldr r2, _0819239C + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 2 + subs r0, 0x1 + ldrb r3, [r3, 0x10] + adds r0, r3 + b _08192482 + .align 2, 0 +_0819238C: .4byte 0x03005d90 +_08192390: .4byte 0x00000d25 +_08192394: .4byte 0x0203cd78 +_08192398: .4byte 0x03005e00 +_0819239C: .4byte 0x0860d1a0 +_081923A0: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r3, _081923AC + adds r0, r3 + b _0819249E + .align 2, 0 +_081923AC: .4byte 0x03005e00 +_081923B0: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081923DE + ldr r0, _081923D0 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _081923DE + cmp r5, 0x10 + bne _081923D8 + ldr r0, _081923D4 + add r0, r8 + ldrb r5, [r0] + b _081923DA + .align 2, 0 +_081923D0: .4byte 0x0203cd78 +_081923D4: .4byte 0x0860d19c +_081923D8: + subs r5, 0x1 +_081923DA: + movs r7, 0x5 + b _08192446 +_081923DE: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819240E + ldr r0, _08192400 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819240E + ldr r0, _08192404 + add r0, r8 + ldrb r0, [r0] + cmp r5, r0 + bne _08192408 + movs r5, 0x10 + b _0819240A + .align 2, 0 +_08192400: .4byte 0x0203cd78 +_08192404: .4byte 0x0860d19c +_08192408: + adds r5, 0x1 +_0819240A: + movs r7, 0x6 + b _08192446 +_0819240E: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819242C + ldr r0, _08192428 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _0819242C + movs r7, 0x7 + subs r0, 0x1 + b _08192444 + .align 2, 0 +_08192428: .4byte 0x0203cd78 +_0819242C: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192446 + ldr r0, _08192464 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0x1 + bhi _08192446 + movs r7, 0x8 + adds r0, 0x1 +_08192444: + strb r0, [r1, 0x10] +_08192446: + cmp r7, 0x9 + bne _081924A0 + ldr r0, _08192464 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08192470 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, _08192468 + adds r1, r2 + ldr r2, _0819246C + ldrb r0, [r0, 0x11] + b _08192482 + .align 2, 0 +_08192464: .4byte 0x0203cd78 +_08192468: .4byte 0x03005e00 +_0819246C: .4byte 0x0860d1c0 +_08192470: + cmp r1, 0x2 + bne _08192494 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r3, _0819248C + adds r1, r3 + ldr r2, _08192490 + ldrb r0, [r0, 0x12] +_08192482: + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0xA] + b _081924A0 + .align 2, 0 +_0819248C: .4byte 0x03005e00 +_08192490: .4byte 0x0860d1c0 +_08192494: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081924DC + adds r0, r1 +_0819249E: + strh r5, [r0, 0xA] +_081924A0: + cmp r7, 0 + beq _081924CC + cmp r7, 0x9 + beq _081924CC + movs r0, 0x5 + bl audio_play + ldr r1, _081924DC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0xC] +_081924CC: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081924DC: .4byte 0x03005e00 + thumb_func_end sub_819221C + + thumb_func_start sub_81924E0 +sub_81924E0: @ 81924E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x20] + movs r5, 0 + movs r0, 0 + str r0, [sp, 0x28] + movs r1, 0 + str r1, [sp, 0x2C] + movs r2, 0 + str r2, [sp, 0x30] + movs r4, 0 + movs r0, 0x24 + bl malloc_and_clear + mov r8, r0 + ldr r0, _08192588 + ldr r1, [r0] + ldr r3, [sp, 0x20] + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r2, _0819258C + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [sp, 0x24] + movs r0, 0x1 + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _08192538 + movs r5, 0x8 + movs r4, 0x9 + str r4, [sp, 0x28] + movs r4, 0x2 +_08192538: + movs r0, 0x2 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192548 + movs r3, 0x80 + lsls r3, 1 + str r3, [sp, 0x2C] +_08192548: + movs r0, 0x4 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192556 + movs r3, 0xA0 + str r3, [sp, 0x30] +_08192556: + movs r0, 0x8 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192564 + ldr r3, _08192590 + str r3, [sp, 0x2C] +_08192564: + movs r0, 0x10 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192574 + movs r3, 0xA0 + negs r3, r3 + str r3, [sp, 0x30] +_08192574: + ldr r0, _08192594 + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192598 + ldrb r0, [r1, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081925B6 + .align 2, 0 +_08192588: .4byte 0x03005d90 +_0819258C: .4byte 0x00000d24 +_08192590: .4byte 0xffffff00 +_08192594: .4byte 0x000003ff +_08192598: + ldr r0, _081925A8 + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _081925AC + bl sub_8195910 + b _081925B2 + .align 2, 0 +_081925A8: .4byte 0x000003fe +_081925AC: + ldr r0, [sp, 0x24] + bl sub_8162AA0 +_081925B2: + lsls r0, 24 + lsrs r0, 24 +_081925B6: + ldr r2, [sp, 0x2C] + adds r2, 0x30 + ldr r3, [sp, 0x30] + adds r3, 0x40 + adds r1, r4, 0 + adds r1, 0xC + str r1, [sp] + ldr r1, _08192644 + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, _08192648 + ldr r1, [r1] + adds r1, r5 + strb r0, [r1] + movs r0, 0x1E + ldr r4, [sp, 0x1C] + ands r0, r4 + cmp r0, 0 + beq _081925FC + ldr r2, _0819264C + ldr r0, _08192648 + ldr r0, [r0] + adds r0, r5 + 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] +_081925FC: + movs r7, 0 + ldr r0, [sp, 0x20] + lsls r0, 1 + str r0, [sp, 0x3C] + adds r1, r5, 0x2 + ldr r2, [sp, 0x28] + lsls r2, 24 + str r2, [sp, 0x44] + ldr r3, [sp, 0x28] + adds r3, 0x4 + str r3, [sp, 0x40] + ldr r4, [sp, 0x20] + adds r0, r4 + ldr r6, _08192648 + ldr r2, _0819264C + mov r10, r2 + adds r4, r1, 0 + lsls r5, r0, 1 + movs r3, 0 + mov r9, r3 +_08192624: + ldr r0, _08192650 + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192660 + ldr r0, _08192654 + ldr r0, [r0] + ldr r2, _08192658 + adds r0, r2 + adds r0, r5 + ldrh r0, [r0] + ldr r1, _0819265C + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .align 2, 0 +_08192644: .4byte 0x0000ffff +_08192648: .4byte 0x0203cd78 +_0819264C: .4byte 0x02020630 +_08192650: .4byte 0x000003ff +_08192654: .4byte 0x03005d90 +_08192658: .4byte 0x00000d64 +_0819265C: .4byte 0x0860d340 +_08192660: + ldr r0, _08192680 + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192690 + ldr r0, _08192684 + ldr r0, [r0] + ldr r1, _08192688 + adds r0, r1 + adds r0, r5 + ldrh r0, [r0] + ldr r1, _0819268C + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .align 2, 0 +_08192680: .4byte 0x000003fe +_08192684: .4byte 0x03005d90 +_08192688: .4byte 0x00000d64 +_0819268C: .4byte 0x0860d340 +_08192690: + ldr r0, _08192764 + ldr r0, [r0] + ldr r3, _08192768 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + ldr r0, _0819276C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _08192770 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r1, [sp, 0x2C] + orrs r2, r1 +_081926B0: + ldr r1, _08192774 + adds r1, r7, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x30] + adds r3, r1 + mov r1, r9 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, _08192778 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r1, [r0, 0x5] + movs r2, 0xD + negs r2, r2 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _0819270A + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819270A: + adds r4, 0x1 + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x2 + ble _08192624 + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x2 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + adds r1, r0, 0 + adds r0, r2, 0 + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, _0819277C + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _08192784 + ldr r0, _08192780 + adds r0, 0x3C + ldrb r5, [r0] + b _081927A2 + .align 2, 0 +_08192764: .4byte 0x03005d90 +_08192768: .4byte 0x00000d64 +_0819276C: .4byte 0x0203bc8c +_08192770: .4byte 0x0860d340 +_08192774: .4byte 0x0860d343 +_08192778: .4byte sub_8190938 + 1 +_0819277C: .4byte 0x000003ff +_08192780: .4byte 0x0831f5ca +_08192784: + ldr r0, _08192794 + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192798 + bl sub_8195924 + b _0819279E + .align 2, 0 +_08192794: .4byte 0x000003fe +_08192798: + ldr r0, [sp, 0x24] + bl sub_8162BD8 +_0819279E: + lsls r0, 24 + lsrs r5, r0, 24 +_081927A2: + ldr r2, _081927F0 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + adds r0, r7, r1 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081927CA + ldr r3, _081927F4 + adds r0, r1, r2 + adds r2, r7, r0 +_081927BA: + adds r0, r7, r3 + ldrb r1, [r2] + strb r1, [r0] + adds r2, 0x1 + adds r7, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _081927BA +_081927CA: + ldr r5, _081927F4 + adds r1, r7, r5 + movs r0, 0 + strb r0, [r1] + adds r0, r7, 0x1 + adds r0, r5 + movs r1, 0xFF + strb r1, [r0] + ldr r0, _081927F8 + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192800 + ldr r0, _081927FC + ldr r1, [r0] + adds r0, r5, 0 + bl gf_strcat + b _08192836 + .align 2, 0 +_081927F0: .4byte 0x0830fcd4 +_081927F4: .4byte 0x02021cc4 +_081927F8: .4byte 0x000003ff +_081927FC: .4byte 0x03005d90 +_08192800: + ldr r0, _0819281C + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192824 + ldr r4, _08192820 + adds r0, r4, 0 + bl sub_8195938 + adds r0, r5, 0 + adds r1, r4, 0 + bl gf_strcat + b _08192836 + .align 2, 0 +_0819281C: .4byte 0x000003fe +_08192820: .4byte 0x02021dc4 +_08192824: + ldr r4, _081928A8 + ldr r1, [sp, 0x24] + adds r0, r4, 0 + bl sub_8195898 + adds r0, r5, 0 + adds r1, r4, 0 + bl gf_strcat +_08192836: + add r0, sp, 0xC + ldrb r0, [r0, 0x5] + ldr r4, _081928AC + add r1, sp, 0xC + ldrb r3, [r1, 0xA] + adds r1, r4, 0 + movs r2, 0xD0 + bl sub_81DB374 + add r1, sp, 0xC + movs r5, 0 + strb r0, [r1, 0x8] + str r4, [sp, 0xC] + adds r0, r1, 0 + add r4, sp, 0x28 + ldrb r4, [r4] + strb r4, [r0, 0x4] + ldr r0, [sp, 0x44] + lsrs r4, r0, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl remo_copy + add r0, sp, 0xC + strb r5, [r0, 0xA] + movs r7, 0 + adds r6, r0, 0 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r3, 0xB + mov r10, r3 +_0819288A: + ldr r0, _081928B0 + adds r0, r7, r0 + ldrb r0, [r0] + strb r0, [r6, 0x9] + ldr r0, _081928B4 + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928C0 + ldr r0, _081928B8 + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, _081928BC + adds r1, r2 + b _081928FA + .align 2, 0 +_081928A8: .4byte 0x02021dc4 +_081928AC: .4byte 0x02021cc4 +_081928B0: .4byte 0x0860d346 +_081928B4: .4byte 0x000003ff +_081928B8: .4byte 0x03005d90 +_081928BC: .4byte 0x00000d64 +_081928C0: + ldr r0, _081928D8 + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928E4 + ldr r0, _081928DC + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, _081928E0 + adds r1, r2 + b _081928FA + .align 2, 0 +_081928D8: .4byte 0x000003fe +_081928DC: .4byte 0x03005d90 +_081928E0: .4byte 0x00000d64 +_081928E4: + ldr r4, _08192920 + ldr r1, [r4] + lsls r0, r7, 1 + add r0, r9 + ldr r2, _08192924 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, _08192928 + ldr r0, [r0] + lsls r1, 4 +_081928FA: + adds r1, r0 + ldrh r0, [r1] + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + ldr r1, _0819292C + adds r0, r1 + str r0, [sp, 0xC] + adds r0, r7, 0x1 + ldr r4, [sp, 0x28] + adds r0, r4 + movs r1, 0 + strb r0, [r6, 0x4] + cmp r7, 0x1 + bne _08192930 + movs r0, 0x7 + strb r0, [r6, 0x8] + b _08192932 + .align 2, 0 +_08192920: .4byte 0x03005d90 +_08192924: .4byte 0x00000d64 +_08192928: .4byte 0x0203bc8c +_0819292C: .4byte 0x083185c8 +_08192930: + strb r1, [r6, 0x8] +_08192932: + adds r5, r7, 0x1 + ldr r0, [sp, 0x28] + adds r4, r5, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl remo_copy + adds r7, r5, 0 + cmp r7, 0x2 + ble _0819288A + ldr r4, [sp, 0x40] + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08192978 + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192980 + ldr r0, _0819297C + ldr r0, [r0, 0x40] + b _0819298A + .align 2, 0 +_08192978: .4byte 0x000003fe +_0819297C: .4byte 0x0860d1d0 +_08192980: + ldr r0, _081929F4 + ldr r2, [sp, 0x20] + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] +_0819298A: + str r0, [sp, 0xC] + add r1, sp, 0xC + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r1, 0 + add r3, sp, 0x40 + ldrb r3, [r3] + strb r3, [r0, 0x4] + strb r2, [r0, 0x8] + movs r1, 0x4 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + bl remo_copy + movs r7, 0 + ldr r3, _081929F8 +_081929AE: + movs r5, 0 + adds r4, r7, 0x1 + str r4, [sp, 0x38] + lsls r0, r7, 1 + str r0, [sp, 0x34] + lsls r2, r7, 4 +_081929BA: + movs r6, 0 + lsls r1, r5, 1 + mov r10, r1 + mov r4, r8 + mov r9, r2 +_081929C4: + ldr r0, _081929FC + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A00 + lsls r0, r7, 24 + lsls r1, r5, 24 + lsrs r0, 24 + lsrs r1, 24 + str r2, [sp, 0x48] + str r3, [sp, 0x4C] + bl sub_81A5060 + lsls r0, 16 + lsrs r0, 12 + adds r0, r6, r0 + ldr r3, [sp, 0x4C] + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] + ldr r2, [sp, 0x48] + b _08192A58 + .align 2, 0 +_081929F4: .4byte 0x0860d1d0 +_081929F8: .4byte 0x0860b358 +_081929FC: .4byte 0x000003fe +_08192A00: + ldr r0, _08192A14 + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A20 + ldr r0, _08192A18 + ldr r0, [r0] + ldr r1, _08192A1C + adds r0, r1 + add r0, r9 + b _08192A48 + .align 2, 0 +_08192A14: .4byte 0x000003ff +_08192A18: .4byte 0x03005d90 +_08192A1C: .4byte 0x00000efc +_08192A20: + ldr r0, _08192B08 + ldr r0, [r0] + mov r12, r0 + ldr r0, [sp, 0x3C] + ldr r1, [sp, 0x20] + adds r0, r1 + str r0, [sp, 0x50] + lsls r0, 1 + ldr r1, [sp, 0x34] + adds r0, r1, r0 + ldr r1, _08192B0C + add r1, r12 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _08192B10 + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + add r0, r10 +_08192A48: + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6, r0 + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] +_08192A58: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _081929C4 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081929BA + ldr r7, [sp, 0x38] + cmp r7, 0x2 + ble _081929AE + movs r7, 0 + ldr r2, _08192B14 + mov r9, r2 + ldr r3, _08192B18 + mov r10, r3 +_08192A78: + movs r4, 0 + movs r6, 0 + movs r5, 0 + mov r3, r8 + lsls r0, r7, 4 + mov r1, r10 + adds r2, r0, r1 +_08192A86: + ldrb r0, [r2] + cmp r0, 0 + beq _08192A9E + adds r4, 0x1 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08192A9E + ldrb r1, [r2] + cmp r0, r1 + blt _08192A9E + adds r6, 0x1 +_08192A9E: + adds r3, 0x2 + adds r2, 0x1 + adds r5, 0x1 + cmp r5, 0xF + ble _08192A86 + cmp r4, r6 + beq _08192AB2 + adds r7, 0x1 + cmp r7, 0x1E + bls _08192A78 +_08192AB2: + lsls r0, r7, 2 + add r0, r9 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x14 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl remo_copy + movs r1, 0 + mov r0, r8 + adds r0, 0x22 +_08192AD0: + strh r1, [r0] + subs r0, 0x2 + cmp r0, r8 + bge _08192AD0 + ldr r2, [sp, 0x24] + ldr r3, _08192B1C + adds r0, r2, r3 + cmp r0, 0x1 + bls _08192AE4 + b _08192C24 +_08192AE4: + movs r7, 0 + movs r4, 0 + mov r9, r4 +_08192AEA: + movs r5, 0 + mov r4, r8 + mov r6, r9 +_08192AF0: + ldr r0, _08192B20 + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B24 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl sub_81A50F0 + lsls r0, 24 + lsrs r0, 24 + b _08192B34 + .align 2, 0 +_08192B08: .4byte 0x03005d90 +_08192B0C: .4byte 0x00000d64 +_08192B10: .4byte 0x0203bc8c +_08192B14: .4byte 0x0860d214 +_08192B18: .4byte 0x0860c988 +_08192B1C: .4byte 0xfffffc02 +_08192B20: .4byte 0x000003fe +_08192B24: + ldr r0, _08192B64 + ldr r0, [r0] + lsls r1, r7, 4 + adds r1, r5, r1 + ldr r2, _08192B68 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] +_08192B34: + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08192AF0 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192B4C: + ldr r0, _08192B6C + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B70 + mov r2, r9 + lsrs r0, r2, 24 + bl sub_81A50B0 + lsls r0, 24 + lsrs r2, r0, 24 + b _08192B7E + .align 2, 0 +_08192B64: .4byte 0x03005d90 +_08192B68: .4byte 0x00000f04 +_08192B6C: .4byte 0x000003fe +_08192B70: + ldr r0, _08192BA8 + ldr r0, [r0] + lsls r1, r7, 4 + adds r0, r1 + ldr r3, _08192BAC + adds r0, r3 + ldrb r2, [r0] +_08192B7E: + ldr r1, _08192BB0 + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192BB4 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192BDC + .align 2, 0 +_08192BA8: .4byte 0x03005d90 +_08192BAC: .4byte 0x00000f0a +_08192BB0: .4byte 0x0831e818 +_08192BB4: + cmp r0, 0 + bge _08192BD4 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192BDC +_08192BD4: + ldrh r0, [r4, 0x2] + ldrh r3, [r4, 0xE] + adds r0, r3 + strh r0, [r4, 0xE] +_08192BDC: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192B4C + movs r4, 0x80 + lsls r4, 17 + add r9, r4 + adds r7, 0x1 + cmp r7, 0x2 + bgt _08192BF2 + b _08192AEA +_08192BF2: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192BF8: + movs r2, 0xC + ldrsh r0, [r1, r2] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192BF8 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192C0C: + movs r3, 0xC + ldrsh r0, [r4, r3] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192C0C + b _08192D70 +_08192C24: + ldr r4, _08192CF4 + mov r10, r4 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r7, 0x2 +_08192C34: + ldr r3, _08192CF8 + ldr r0, [r3] + ldr r4, _08192CFC + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r6, 0 + movs r4, 0 + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C54: + strh r4, [r1] + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C60 + adds r6, 0x1 +_08192C60: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C54 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + adds r6, r0, 0 + ldr r3, _08192CF8 + ldr r0, [r3] + ldr r4, _08192CFC + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C92: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C9C + strh r6, [r1] +_08192C9C: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C92 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192CB4: + ldr r1, _08192CF8 + ldr r0, [r1] + ldr r2, _08192CFC + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + mov r3, r10 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xC] + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + ldr r1, _08192D00 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192D04 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192D2C + .align 2, 0 +_08192CF4: .4byte 0x0203bc8c +_08192CF8: .4byte 0x03005d90 +_08192CFC: .4byte 0x00000d64 +_08192D00: .4byte 0x0831e818 +_08192D04: + cmp r0, 0 + bge _08192D24 + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192D2C +_08192D24: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] +_08192D2C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192CB4 + movs r2, 0x2 + add r9, r2 + subs r7, 0x1 + cmp r7, 0 + blt _08192D40 + b _08192C34 +_08192D40: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192D46: + movs r3, 0xC + ldrsh r0, [r1, r3] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D46 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192D5A: + movs r1, 0xC + ldrsh r0, [r4, r1] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D5A +_08192D70: + movs r7, 0 + movs r5, 0 + movs r6, 0 + mov r4, r8 + mov r10, r8 + mov r9, r8 +_08192D7C: + movs r2, 0 + ldrsh r1, [r4, r2] + cmp r1, 0x1D + ble _08192DDE + cmp r7, 0x2 + bne _08192DD4 + mov r3, r8 + movs r0, 0xC + ldrsh r3, [r3, r0] + mov r12, r3 + cmp r12, r1 + bge _08192DC6 + mov r2, r8 + ldrh r2, [r2, 0xE] + add r3, sp, 0x54 + strh r2, [r3] + mov r2, r8 + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, r1 + bge _08192DBA + cmp r12, r0 + bge _08192DB4 + add r0, sp, 0x54 + ldrh r0, [r0] + strh r0, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DB4: + mov r1, r8 + strh r6, [r1, 0xE] + b _08192DDE +_08192DBA: + add r2, sp, 0x54 + ldrh r3, [r2] + mov r2, r8 + strh r3, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DC6: + mov r3, r8 + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r0, r1 + bge _08192DDE + strh r6, [r3, 0xE] + b _08192DDE +_08192DD4: + mov r3, r9 + strh r6, [r3, 0xC] + movs r0, 0x2 + add r9, r0 + adds r7, 0x1 +_08192DDE: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08192E64 + cmp r5, 0x2 + bne _08192E5A + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08192E18 + cmp r0, 0x1 + bne _08192E64 + mov r3, r8 + movs r1, 0x10 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 + movs r1, 0x12 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 +_08192E18: + mov r3, r8 + ldrh r0, [r3, 0x12] + strh r0, [r3, 0x10] + strh r6, [r3, 0x12] + b _08192E64 +_08192E22: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08192E64 + mov r2, r8 + movs r3, 0x10 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E44 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x10] + strh r6, [r2, 0x12] + b _08192E64 +_08192E44: + mov r2, r8 + movs r3, 0x12 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E64 + strh r6, [r2, 0x12] + b _08192E64 +_08192E5A: + mov r2, r10 + strh r6, [r2, 0x10] + movs r3, 0x2 + add r10, r3 + adds r5, 0x1 +_08192E64: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08192D7C + cmp r7, 0x2 + bne _08192E8C + ldr r0, _08192E88 + mov r4, r8 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r0, r2, r0 + movs r3, 0xE + ldrsh r1, [r4, r3] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r7, r1, r0 + b _08192ED2 + .align 2, 0 +_08192E88: .4byte 0x0860d349 +_08192E8C: + cmp r7, 0x1 + bne _08192E9C + mov r4, r8 + movs r1, 0xC + ldrsh r0, [r4, r1] + adds r7, r0, 0 + adds r7, 0xF + b _08192ED2 +_08192E9C: + cmp r5, 0x2 + bne _08192EC0 + ldr r0, _08192EBC + mov r3, r8 + movs r4, 0x10 + ldrsh r2, [r3, r4] + adds r0, r2, r0 + movs r4, 0x12 + ldrsh r1, [r3, r4] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r1, r0 + adds r7, r1, 0 + adds r7, 0x15 + b _08192ED2 + .align 2, 0 +_08192EBC: .4byte 0x0860d349 +_08192EC0: + cmp r5, 0x1 + bne _08192ED0 + mov r1, r8 + movs r2, 0x10 + ldrsh r0, [r1, r2] + adds r7, r0, 0 + adds r7, 0x24 + b _08192ED2 +_08192ED0: + movs r7, 0x2A +_08192ED2: + lsls r0, r7, 2 + ldr r3, _08192F04 + adds r0, r3 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x24 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl remo_copy + mov r0, r8 + bl free + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08192F04: .4byte 0x0860d294 + thumb_func_end sub_81924E0 + + thumb_func_start sub_8192F08 +sub_8192F08: @ 8192F08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + str r0, [sp, 0x4] + mov r8, r0 + ldr r2, _08192F7C + lsls r0, r7, 1 + adds r0, r7 + adds r1, r0, r2 + ldrb r6, [r1] + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + adds r3, r2, 0 + cmp r6, r0 + bge _08192FD4 + ldr r5, _08192F80 + ldr r1, _08192F84 + mov r10, r1 + ldr r2, _08192F88 + mov r9, r2 +_08192F42: + ldr r0, _08192F8C + adds r0, r6, r0 + ldrb r4, [r0] + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r1 + ldr r2, _08192F90 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192FBE + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + ldr r2, [r5] + adds r0, r2, r1 + ldr r1, _08192F94 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 22 + lsrs r0, r1, 22 + cmp r0, r10 + bne _08192F9C + ldr r0, _08192F98 + adds r1, r2, 0 + bl gf_strcpy + b _08192FB8 + .align 2, 0 +_08192F7C: .4byte 0x0860d3c4 +_08192F80: .4byte 0x03005d90 +_08192F84: .4byte 0x000003ff +_08192F88: .4byte 0x000003fe +_08192F8C: .4byte 0x0860d3b4 +_08192F90: .4byte 0x00000d25 +_08192F94: .4byte 0x00000d24 +_08192F98: .4byte 0x02021cc4 +_08192F9C: + lsrs r0, r1, 22 + cmp r0, r9 + bne _08192FB0 + ldr r0, _08192FAC + bl sub_8195938 + b _08192FB8 + .align 2, 0 +_08192FAC: .4byte 0x02021cc4 +_08192FB0: + lsrs r1, 22 + ldr r0, _08192FE0 + bl sub_8195898 +_08192FB8: + movs r2, 0x1 + add r8, r2 + ldr r3, _08192FE4 +_08192FBE: + adds r6, 0x1 + lsls r1, r7, 1 + adds r1, r7 + adds r0, r1, r3 + ldrb r2, [r0] + adds r0, r3, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + blt _08192F42 +_08192FD4: + mov r5, r8 + cmp r5, 0x2 + bne _08192FE8 + movs r0, 0 + b _0819313C + .align 2, 0 +_08192FE0: .4byte 0x02021cc4 +_08192FE4: .4byte 0x0860d3c4 +_08192FE8: + mov r12, r3 + lsls r3, r7, 1 + adds r0, r3, r7 + mov r2, r12 + adds r1, r0, r2 + ldrb r6, [r1] + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + str r3, [sp, 0x8] + cmp r6, r0 + blt _08193006 + b _08193126 +_08193006: + ldr r5, _081930A8 + mov r10, r5 + ldr r0, _081930AC + mov r9, r0 +_0819300E: + ldr r0, _081930B0 + adds r0, r6, r0 + ldrb r4, [r0] + mov r1, r10 + ldr r0, [r1] + lsls r2, r4, 2 + str r2, [sp, 0xC] + adds r0, r2 + add r0, r9 + ldrb r2, [r0] + lsls r0, r2, 29 + cmp r0, 0 + bge _08193100 + lsls r2, 27 + adds r1, r3, r7 + mov r0, r12 + adds r0, 0x2 + adds r1, r0 + lsrs r2, 30 + ldrb r1, [r1] + cmp r2, r1 + bcc _08193100 + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + movs r5, 0x1 + add r8, r5 + mov r0, r10 + ldr r3, [r0] + ldr r5, [sp, 0xC] + adds r2, r3, r5 + adds r0, r2, 0 + add r0, r9 + ldrb r5, [r0] + mov r12, r5 + mov r0, r12 + lsls r0, 27 + lsrs r0, 30 + cmp r0, r1 + bne _081930BC + lsls r4, 1 + movs r1, 0xEC + lsls r1, 4 + adds r0, r3, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0xD + muls r1, r0 + ldr r0, _081930B4 + adds r1, r0 + ldr r0, _081930B8 + bl gf_strcpy + mov r2, r10 + ldr r1, [r2] + ldr r5, [sp, 0xC] + adds r0, r1, r5 + add r0, r9 + ldrb r0, [r0] + lsls r2, r0, 24 + lsrs r0, r2, 29 + lsls r0, 1 + str r0, [sp, 0x4] + movs r0, 0xEC + lsls r0, 4 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + cmp r0, 0 + bne _08193100 + lsrs r0, r2, 29 + cmp r0, 0 + bne _08193100 + movs r1, 0x4 + str r1, [sp, 0x4] + b _08193100 + .align 2, 0 +_081930A8: .4byte 0x03005d90 +_081930AC: .4byte 0x00000d25 +_081930B0: .4byte 0x0860d3b4 +_081930B4: .4byte 0x0831977c +_081930B8: .4byte 0x02021dc4 +_081930BC: + ldr r5, _081930D4 + adds r0, r2, r5 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, _081930D8 + cmp r1, r0 + bne _081930E0 + ldr r0, _081930DC + adds r1, r3, 0 + bl gf_strcpy + b _08193100 + .align 2, 0 +_081930D4: .4byte 0x00000d24 +_081930D8: .4byte 0xffc00000 +_081930DC: .4byte 0x02021cc4 +_081930E0: + ldr r0, _081930F0 + cmp r1, r0 + bne _081930F8 + ldr r0, _081930F4 + bl sub_8195938 + b _08193100 + .align 2, 0 +_081930F0: .4byte 0xff800000 +_081930F4: .4byte 0x02021cc4 +_081930F8: + lsrs r1, 22 + ldr r0, _08193130 + bl sub_8195898 +_08193100: + mov r0, r8 + cmp r0, 0x2 + beq _08193126 + adds r6, 0x1 + ldr r1, _08193134 + mov r12, r1 + ldr r3, [sp, 0x8] + adds r1, r3, r7 + mov r2, r12 + adds r0, r1, r2 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + bge _08193126 + b _0819300E +_08193126: + cmp r7, 0xE + beq _08193138 + ldr r0, [sp, 0x4] + adds r0, 0x1 + b _0819313C + .align 2, 0 +_08193130: .4byte 0x02021cc4 +_08193134: .4byte 0x0860d3c4 +_08193138: + ldr r0, [sp, 0x4] + adds r0, 0x2 +_0819313C: + 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_8192F08 + + thumb_func_start sub_819314C +sub_819314C: @ 819314C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x80 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0 + str r0, [sp, 0x3C] + movs r7, 0 + movs r1, 0 + str r1, [sp, 0x40] + movs r2, 0 + str r2, [sp, 0x44] + mov r9, r2 + movs r0, 0x1 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193186 + movs r7, 0x8 + str r7, [sp, 0x3C] + movs r7, 0x9 + movs r0, 0x2 + mov r9, r0 +_08193186: + movs r0, 0x2 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193196 + movs r2, 0x80 + lsls r2, 1 + str r2, [sp, 0x40] +_08193196: + movs r0, 0x4 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931A4 + movs r0, 0xA0 + str r0, [sp, 0x44] +_081931A4: + movs r0, 0x8 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081931B2 + ldr r2, _08193284 + str r2, [sp, 0x40] +_081931B2: + movs r0, 0x10 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931C2 + movs r0, 0xA0 + negs r0, r0 + str r0, [sp, 0x44] +_081931C2: + ldr r4, _08193288 + ldr r1, [r4] + adds r1, 0x11 + adds r0, r6, 0 + bl sub_8192F08 + str r0, [sp, 0x38] + movs r5, 0 + mov r1, sp + adds r1, 0x1C + str r1, [sp, 0x48] + mov r2, sp + adds r2, 0x24 + str r2, [sp, 0x4C] + lsls r1, r6, 1 + mov r3, sp + adds r3, 0x2C + str r3, [sp, 0x50] + ldr r0, [sp, 0x40] + adds r0, 0x30 + mov r8, r0 + ldr r2, [sp, 0x44] + adds r2, 0x58 + str r2, [sp, 0x78] + movs r3, 0xC + add r3, r9 + mov r10, r3 + ldr r0, [sp, 0x40] + adds r0, 0xC0 + str r0, [sp, 0x7C] + mov r2, r9 + adds r2, 0xD + str r2, [sp, 0x74] + ldr r3, [sp, 0x3C] + adds r3, 0x1 + mov r9, r3 + ldr r0, [sp, 0x3C] + adds r0, 0x2 + str r0, [sp, 0x54] + ldr r2, [sp, 0x3C] + adds r2, 0x5 + str r2, [sp, 0x5C] + adds r3, r7, 0 + adds r3, 0x8 + str r3, [sp, 0x6C] + adds r0, r7, 0x6 + str r0, [sp, 0x64] + adds r2, r7, 0x7 + str r2, [sp, 0x68] + lsls r3, r6, 2 + str r3, [sp, 0x58] + adds r0, r7, 0x5 + str r0, [sp, 0x60] + ldr r0, [r4] + adds r0, 0x11 + mov r12, r0 + ldr r0, _0819328C + ldr r4, [r0] + ldr r0, _08193290 + movs r3, 0 + adds r1, r6 + adds r1, r0 + ldrb r6, [r1] +_08193240: + ldr r1, [sp, 0x48] + adds r2, r3, r1 + mov r7, r12 + adds r0, r7, r5 + ldrb r0, [r0] + str r0, [r2] + ldr r7, [sp, 0x4C] + adds r1, r3, r7 + lsls r0, 2 + adds r0, r4, r0 + ldr r7, _08193294 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [r1] + ldr r0, [r2] + lsls r0, 2 + adds r0, r4, r0 + ldr r1, _08193298 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 27 + lsrs r0, 30 + cmp r0, r6 + bhi _0819329C + lsls r0, r1, 29 + cmp r0, 0 + bge _0819329C + ldr r2, [sp, 0x50] + adds r1, r3, r2 + movs r0, 0x1 + b _081932A2 + .align 2, 0 +_08193284: .4byte 0xffffff00 +_08193288: .4byte 0x0203cd78 +_0819328C: .4byte 0x03005d90 +_08193290: .4byte 0x0860d3c6 +_08193294: .4byte 0x00000d24 +_08193298: .4byte 0x00000d25 +_0819329C: + ldr r7, [sp, 0x50] + adds r1, r3, r7 + movs r0, 0 +_081932A2: + str r0, [r1] + adds r3, 0x4 + adds r5, 0x1 + cmp r5, 0x1 + ble _08193240 + ldr r1, [sp, 0x24] + ldr r0, _081932CC + cmp r1, r0 + bne _081932D4 + ldr r0, _081932D0 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r1, r10 + str r1, [sp] + b _081932F8 + .align 2, 0 +_081932CC: .4byte 0x000003ff +_081932D0: .4byte 0x03005d90 +_081932D4: + ldr r0, _081932E0 + cmp r1, r0 + bne _081932E4 + bl sub_8195910 + b _081932EC + .align 2, 0 +_081932E0: .4byte 0x000003fe +_081932E4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 +_081932EC: + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r7, r10 + str r7, [sp] +_081932F8: + ldr r1, _08193374 + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, _08193378 + ldr r1, [r1] + ldr r2, [sp, 0x3C] + adds r1, r2 + strb r0, [r1] + movs r0, 0x1E + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193334 + ldr r2, _0819337C + ldr r0, _08193378 + ldr r0, [r0] + ldr r7, [sp, 0x3C] + adds r0, r7 + 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] +_08193334: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _0819335A + ldr r2, _0819337C + ldr r0, _08193378 + ldr r0, [r0] + ldr r1, [sp, 0x3C] + 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, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_0819335A: + ldr r2, [sp, 0x4C] + ldr r1, [r2, 0x4] + ldr r0, _08193380 + cmp r1, r0 + bne _08193388 + ldr r0, _08193384 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081933B0 + .align 2, 0 +_08193374: .4byte 0x0000ffff +_08193378: .4byte 0x0203cd78 +_0819337C: .4byte 0x02020630 +_08193380: .4byte 0x000003ff +_08193384: .4byte 0x03005d90 +_08193388: + ldr r0, _081933A0 + cmp r1, r0 + bne _081933A4 + bl sub_8195910 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r1, [sp, 0x74] + str r1, [sp] + b _081933B8 + .align 2, 0 +_081933A0: .4byte 0x000003fe +_081933A4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 +_081933B0: + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r7, [sp, 0x74] + str r7, [sp] +_081933B8: + ldr r1, _0819344C + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, _08193450 + ldr r1, [r1] + add r1, r9 + strb r0, [r1] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081933F0 + ldr r2, _08193454 + ldr r0, _08193450 + ldr r0, [r0] + add r0, r9 + 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] +_081933F0: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193416 + ldr r2, _08193454 + ldr r0, _08193450 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_08193416: + movs r5, 0 + ldr r3, [sp, 0x38] + lsls r3, 2 + str r3, [sp, 0x70] + mov r8, r5 + ldr r6, _08193450 + ldr r7, _08193454 + ldr r4, [sp, 0x54] + mov r9, r5 + movs r0, 0x1 + mov r10, r0 +_0819342C: + ldr r1, [sp, 0x24] + ldr r0, _08193458 + cmp r1, r0 + bne _08193464 + ldr r0, _0819345C + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, _08193460 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .align 2, 0 +_0819344C: .4byte 0x0000ffff +_08193450: .4byte 0x0203cd78 +_08193454: .4byte 0x02020630 +_08193458: .4byte 0x000003ff +_0819345C: .4byte 0x03005d90 +_08193460: .4byte 0x00000d64 +_08193464: + ldr r0, _08193484 + cmp r1, r0 + bne _08193490 + ldr r0, _08193488 + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, _0819348C + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .align 2, 0 +_08193484: .4byte 0x000003fe +_08193488: .4byte 0x03005d90 +_0819348C: .4byte 0x00000d64 +_08193490: + ldr r0, _08193588 + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, _0819358C + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, _08193590 + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081934B0: + ldr r1, _08193594 + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, _08193598 + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + mov r1, r8 + str r1, [sp] + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + ldr r1, _0819359C + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193516 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193516: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _08193548 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r10 + strh r2, [r0, 0x34] +_08193548: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _08193556 + b _0819342C +_08193556: + movs r5, 0 + ldr r6, _081935A0 + ldr r7, _081935A4 + mov r8, r7 + ldr r4, [sp, 0x5C] + mov r9, r5 + movs r7, 0 +_08193564: + ldr r0, [sp, 0x4C] + ldr r1, [r0, 0x4] + ldr r0, _081935A8 + cmp r1, r0 + bne _081935AC + ldr r0, _08193588 + ldr r2, [r0] + ldr r3, [sp, 0x48] + ldr r1, [r3, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, _0819358C + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .align 2, 0 +_08193588: .4byte 0x03005d90 +_0819358C: .4byte 0x00000d64 +_08193590: .4byte 0x0203bc8c +_08193594: .4byte 0x0860d3a8 +_08193598: .4byte 0x0860d3ab +_0819359C: .4byte sub_8190938 + 1 +_081935A0: .4byte 0x0203cd78 +_081935A4: .4byte 0x02020630 +_081935A8: .4byte 0x000003ff +_081935AC: + ldr r0, _081935CC + cmp r1, r0 + bne _081935D8 + ldr r0, _081935D0 + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, _081935D4 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .align 2, 0 +_081935CC: .4byte 0x000003fe +_081935D0: .4byte 0x03005d90 +_081935D4: .4byte 0x00000d64 +_081935D8: + ldr r0, _08193734 + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, _08193738 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, _0819373C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081935FA: + ldr r1, _08193740 + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, _08193744 + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + str r7, [sp] + str r7, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, _08193748 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _0819365E + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819365E: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193692 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x34] +_08193692: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _081936A0 + b _08193564 +_081936A0: + add r0, sp, 0xC + movs r5, 0 + strb r5, [r0, 0x6] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x7] + adds r0, r1, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r5, [r0, 0xA] + strb r5, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + ldr r4, _0819374C + ldr r0, _08193750 + ldr r7, [sp, 0x70] + adds r0, r7, r0 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandTextCodes + str r4, [sp, 0xC] + add r0, sp, 0xC + add r1, sp, 0x6C + ldrb r1, [r1] + strb r1, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r4, [sp, 0x6C] + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add r0, sp, 0xC + strb r5, [r0, 0x8] + adds r1, r0, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + movs r1, 0 + movs r2, 0 + bl remo_copy + ldr r1, [sp, 0x24] + ldr r0, _08193754 + cmp r1, r0 + bne _0819375C + ldr r0, _08193758 + ldr r1, _08193734 + ldr r1, [r1] + bl gf_strcpy + b _0819377E + .align 2, 0 +_08193734: .4byte 0x03005d90 +_08193738: .4byte 0x00000d64 +_0819373C: .4byte 0x0203bc8c +_08193740: .4byte 0x0860d3ae +_08193744: .4byte 0x0860d3b1 +_08193748: .4byte sub_8190938 + 1 +_0819374C: .4byte 0x02021fc4 +_08193750: .4byte 0x0860d38c +_08193754: .4byte 0x000003ff +_08193758: .4byte 0x02021cc4 +_0819375C: + ldr r0, _0819376C + cmp r1, r0 + bne _08193774 + ldr r0, _08193770 + bl sub_8195938 + b _0819377E + .align 2, 0 +_0819376C: .4byte 0x000003fe +_08193770: .4byte 0x02021cc4 +_08193774: + ldr r0, _081937D8 + lsls r1, 16 + lsrs r1, 16 + bl sub_8195898 +_0819377E: + add r0, sp, 0xC + movs r4, 0x2 + strb r4, [r0, 0x5] + strb r4, [r0, 0xA] + ldr r5, _081937D8 + str r5, [sp, 0xC] + add r2, sp, 0x64 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl sub_81DB374 + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r4, [r0, 0x7] + strb r4, [r1, 0x9] + ldr r4, [sp, 0x64] + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl remo_copy + ldr r3, [sp, 0x4C] + ldr r1, [r3, 0x4] + ldr r0, _081937DC + cmp r1, r0 + bne _081937E4 + ldr r0, _081937E0 + ldr r1, [r0] + adds r0, r5, 0 + bl gf_strcpy + b _08193802 + .align 2, 0 +_081937D8: .4byte 0x02021cc4 +_081937DC: .4byte 0x000003ff +_081937E0: .4byte 0x03005d90 +_081937E4: + ldr r0, _081937F4 + cmp r1, r0 + bne _081937F8 + adds r0, r5, 0 + bl sub_8195938 + b _08193802 + .align 2, 0 +_081937F4: .4byte 0x000003fe +_081937F8: + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_8195898 +_08193802: + ldr r0, _0819389C + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r6, 0 + add r7, sp, 0x68 + ldrb r7, [r7] + strb r7, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl sub_81DB374 + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + movs r5, 0x2 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x68] + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl remo_copy + add r0, sp, 0xC + strb r6, [r0, 0xA] + ldr r0, _081938A0 + ldr r1, [sp, 0x58] + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + add r2, sp, 0x60 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0xA0 + bl sub_81DB374 + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x60] + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl remo_copy + add sp, 0x80 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819389C: .4byte 0x02021cc4 +_081938A0: .4byte 0x0860d350 + thumb_func_end sub_819314C + + thumb_func_start sub_81938A4 +sub_81938A4: @ 81938A4 + push {lr} + ldr r0, _081938D4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081938D8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, _081938DC + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081938D4: .4byte sub_8194220 + 1 +_081938D8: .4byte 0x03005e00 +_081938DC: .4byte sub_8194B54 + 1 + thumb_func_end sub_81938A4 + + thumb_func_start sub_81938E0 +sub_81938E0: @ 81938E0 + push {r4,lr} + bl sub_8194D48 + ldr r4, _08193940 + ldr r2, [r4] + ldr r1, _08193944 + adds r0, r2, r1 + ldrb r1, [r0] + subs r1, 0x1 + ldr r0, _08193948 + adds r2, r0 + movs r0, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r4] + ldr r1, _0819394C + adds r0, r1 + movs r4, 0 + movs r1, 0x3 + strh r1, [r0] + ldr r0, _08193950 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08193954 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r4, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + movs r0, 0x1 + strh r0, [r1, 0x10] + ldr r0, _08193958 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08193940: .4byte 0x03005d90 +_08193944: .4byte 0x00000d0a +_08193948: .4byte 0x00000ca9 +_0819394C: .4byte 0x00000cb2 +_08193950: .4byte sub_8194220 + 1 +_08193954: .4byte 0x03005e00 +_08193958: .4byte sub_8194B54 + 1 + thumb_func_end sub_81938E0 + + thumb_func_start sub_819395C +sub_819395C: @ 819395C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08193988 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r7, [r0, r2] + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x7 + bls _0819397E + b _08193BC2 +_0819397E: + lsls r0, 2 + ldr r1, _0819398C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08193988: .4byte 0x03005e00 +_0819398C: .4byte _08193990 + .align 2, 0 +_08193990: + .4byte _081939B0 + .4byte _08193A00 + .4byte _08193A20 + .4byte _08193AA8 + .4byte _08193BC2 + .4byte _08193B20 + .4byte _08193BC2 + .4byte _08193B84 +_081939B0: + ldr r0, _081939F4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _081939C2 + b _08193BC2 +_081939C2: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _081939F8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, _081939FC + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + b _08193BC2 + .align 2, 0 +_081939F4: .4byte 0x02037fd4 +_081939F8: .4byte 0x03005e00 +_081939FC: .4byte 0x02020630 +_08193A00: + ldr r0, _08193A1C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08193A0E + b _08193BC2 +_08193A0E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + b _08193BC2 + .align 2, 0 +_08193A1C: .4byte 0x02037fd4 +_08193A20: + adds r0, r5, 0 + bl sub_8193BDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08193A30 + b _08193BC2 +_08193A30: + cmp r0, 0x1 + ble _08193A3C + cmp r0, 0x2 + beq _08193A60 + cmp r0, 0x3 + beq _08193A84 +_08193A3C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08193A5C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0x8] + b _08193BC2 + .align 2, 0 +_08193A5C: .4byte 0x03005e00 +_08193A60: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08193A80 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x8] + b _08193BC2 + .align 2, 0 +_08193A80: .4byte 0x03005e00 +_08193A84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08193AA4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x5 + strh r1, [r0, 0x8] + b _08193BC2 + .align 2, 0 +_08193AA4: .4byte 0x03005e00 +_08193AA8: + ldr r0, _08193B08 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _08193ABA + b _08193BC2 +_08193ABA: + bl Window_FreeMemory + bl remove_some_task + ldr r4, _08193B0C + ldr r0, [r4] + bl free + str r6, [r4] + ldr r0, _08193B10 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08193B14 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + strh r6, [r1, 0x8] + ldr r0, _08193B18 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x4 + strh r1, [r0, 0x8] + ldr r0, _08193B1C + ldr r0, [r0] + strb r3, [r0, 0x10] + b _08193BC2 + .align 2, 0 +_08193B08: .4byte 0x02037fd4 +_08193B0C: .4byte 0x0203cd7c +_08193B10: .4byte sub_8190400 + 1 +_08193B14: .4byte 0x03005e00 +_08193B18: .4byte 0x0860d080 +_08193B1C: .4byte 0x0203cd78 +_08193B20: + ldr r0, _08193B74 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl Window_FreeMemory + bl remove_some_task + ldr r4, _08193B78 + ldr r0, [r4] + bl free + str r6, [r4] + ldr r0, _08193B7C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _08193B80 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0x8] + adds r1, r7, 0 + subs r1, 0x10 + strh r1, [r0, 0xA] + movs r1, 0x2 + strh r1, [r0, 0xC] + strh r5, [r0, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x8] + b _08193BC2 + .align 2, 0 +_08193B74: .4byte 0x02037fd4 +_08193B78: .4byte 0x0203cd7c +_08193B7C: .4byte sub_8190400 + 1 +_08193B80: .4byte 0x03005e00 +_08193B84: + ldr r0, _08193BCC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl Window_FreeMemory + bl remove_some_task + ldr r4, _08193BD0 + ldr r0, [r4] + bl free + str r6, [r4] + ldr r0, _08193BD4 + bl set_callback2 + ldr r1, _08193BD8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x16] + bl remove_task + adds r0, r5, 0 + bl remove_task +_08193BC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08193BCC: .4byte 0x02037fd4 +_08193BD0: .4byte 0x0203cd7c +_08193BD4: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_08193BD8: .4byte 0x03005e00 + thumb_func_end sub_819395C + + thumb_func_start sub_8193BDC +sub_8193BDC: @ 8193BDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x1 + mov r9, r0 + movs r1, 0x4 + mov r8, r1 + ldr r1, _08193C2C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r5, [r0, r1] + ldr r0, _08193C30 + ldr r0, [r0] + ldr r1, _08193C34 + adds r0, r1 + ldrh r6, [r0] + ldr r0, _08193C38 + ldrh r1, [r0, 0x2E] + adds r2, r1, 0 + adds r3, r0, 0 + cmp r2, 0x2 + beq _08193C20 + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08193C58 + cmp r5, 0x1F + bne _08193C3C +_08193C20: + movs r0, 0x5 + bl audio_play + movs r0, 0 + mov r9, r0 + b _08193CDE + .align 2, 0 +_08193C2C: .4byte 0x03005e00 +_08193C30: .4byte 0x03005d90 +_08193C34: .4byte 0x00000cb2 +_08193C38: .4byte 0x030022c0 +_08193C3C: + cmp r5, 0xF + bgt _08193C4C + movs r0, 0x5 + bl audio_play + movs r1, 0x2 + mov r9, r1 + b _08193CDE +_08193C4C: + movs r0, 0x5 + bl audio_play + movs r0, 0x3 + mov r9, r0 + b _08193CDE +_08193C58: + cmp r2, 0x40 + bne _08193C78 + ldr r0, _08193C74 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C78 + movs r1, 0 + mov r8, r1 + b _08193CDE + .align 2, 0 +_08193C74: .4byte 0x0860cbf1 +_08193C78: + ldrh r0, [r3, 0x2E] + cmp r0, 0x80 + bne _08193C9C + ldr r0, _08193C98 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C9C + movs r0, 0x1 + b _08193CDC + .align 2, 0 +_08193C98: .4byte 0x0860cbf1 +_08193C9C: + ldrh r0, [r3, 0x2E] + cmp r0, 0x20 + bne _08193CC0 + ldr r0, _08193CBC + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CC0 + movs r1, 0x2 + mov r8, r1 + b _08193CDE + .align 2, 0 +_08193CBC: .4byte 0x0860cbf1 +_08193CC0: + ldrh r0, [r3, 0x2E] + cmp r0, 0x10 + bne _08193CDE + ldr r0, _08193D34 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CDE + movs r0, 0x3 +_08193CDC: + mov r8, r0 +_08193CDE: + mov r1, r8 + cmp r1, 0x4 + beq _08193D26 + movs r0, 0x5 + bl audio_play + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, _08193D38 + adds r0, r4 + movs r1, 0 + bl obj_anim_image_start + ldr r2, _08193D34 + lsls r1, r6, 2 + add r1, r8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r5, [r1] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl obj_anim_image_start + ldr r1, _08193D3C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] +_08193D26: + mov r0, r9 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08193D34: .4byte 0x0860cbf1 +_08193D38: .4byte 0x02020630 +_08193D3C: .4byte 0x03005e00 + thumb_func_end sub_8193BDC + + thumb_func_start sub_8193D40 +sub_8193D40: @ 8193D40 + push {lr} + ldr r0, _08193D70 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08193D74 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + movs r0, 0x1 + strh r0, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, _08193D78 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_08193D70: .4byte sub_8194220 + 1 +_08193D74: .4byte 0x03005e00 +_08193D78: .4byte sub_8194B54 + 1 + thumb_func_end sub_8193D40 + + thumb_func_start sub_8193D7C +sub_8193D7C: @ 8193D7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, _08193DF8 + ldrh r0, [r7] + cmp r0, 0x1 + bne _08193E10 + ldr r5, _08193DFC + ldrh r0, [r5] + bl sub_8195358 + ldr r4, _08193E00 + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, _08193E04 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5] + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, _08193E08 + mov r8, r2 + add r1, r8 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r5] + bl sub_8195358 + ldr r2, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r2, r3 + adds r1, r0 + ldr r0, _08193E0C + ldrh r0, [r0, 0x22] + strh r0, [r1] + add r2, r8 + ldrh r0, [r2] + cmp r0, 0x2 + bhi _08193EAE + lsls r0, 24 + lsrs r0, 24 + bl sub_8195438 + b _08193EAE + .align 2, 0 +_08193DF8: .4byte 0x020375e2 +_08193DFC: .4byte 0x02038bca +_08193E00: .4byte 0x03005d90 +_08193E04: .4byte 0x00000d25 +_08193E08: .4byte 0x00000cb2 +_08193E0C: .4byte 0x03005d10 +_08193E10: + ldr r5, _08193EB8 + adds r0, r5, 0 + bl sub_8195358 + ldr r4, _08193EBC + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, _08193EC0 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, _08193EC4 + adds r1, r2 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r0 + ldr r0, _08193EC8 + ldrh r0, [r0, 0x24] + strh r0, [r1] + ldr r0, _08193ECC + ldrb r0, [r0] + cmp r0, 0x9 + beq _08193E78 + ldrh r0, [r7] + cmp r0, 0x9 + bne _08193E92 +_08193E78: + adds r0, r5, 0 + bl sub_8195358 + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + adds r2, r6 + ldrb r1, [r2] + movs r0, 0x1F + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] +_08193E92: + ldr r0, _08193EBC + ldr r0, [r0] + ldr r1, _08193EC4 + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0x3 + bgt _08193EAE +_08193EA0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8195438 + adds r4, 0x1 + cmp r4, 0x3 + ble _08193EA0 +_08193EAE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08193EB8: .4byte 0x000003ff +_08193EBC: .4byte 0x03005d90 +_08193EC0: .4byte 0x00000d25 +_08193EC4: .4byte 0x00000cb2 +_08193EC8: .4byte 0x03005d10 +_08193ECC: .4byte 0x0202433a + thumb_func_end sub_8193D7C + + thumb_func_start sub_8193ED0 +sub_8193ED0: @ 8193ED0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + lsls r4, r2, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp, 0x54] + movs r1, 0 + str r1, [sp, 0x58] + bl sub_8165C40 + movs r2, 0 + str r2, [sp, 0x50] + add r3, sp, 0x30 + mov r10, r3 + ldr r5, [sp, 0x4C] + lsls r5, 1 + str r5, [sp, 0x70] + subs r4, 0x1 + str r4, [sp, 0x78] +_08193F02: + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0x50] + lsls r1, 2 + str r1, [sp, 0x74] + ldr r2, [sp, 0x48] + lsls r2, 2 + str r2, [sp, 0x6C] + ldr r3, [sp, 0x50] + adds r3, 0x1 + str r3, [sp, 0x60] +_08193F18: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 2 + mov r5, sp + adds r1, r5, r0 + movs r0, 0 + str r0, [r1] + ldr r0, _08193F54 + ldr r3, [r0] + ldr r1, [sp, 0x6C] + adds r0, r3, r1 + ldr r2, _08193F58 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, _08193F5C + cmp r0, r1 + bne _08193F60 + ldr r3, [sp, 0x50] + lsls r0, r3, 24 + mov r5, r9 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, 24 + bl sub_81A5060 + lsls r1, r4, 1 + add r1, r10 + strh r0, [r1] + b _08193F8C + .align 2, 0 +_08193F54: .4byte 0x03005d90 +_08193F58: .4byte 0x00000d24 +_08193F5C: .4byte 0xff800000 +_08193F60: + lsls r2, r4, 1 + add r2, r10 + ldr r1, [sp, 0x48] + lsls r0, r1, 1 + adds r0, r1 + ldr r4, [sp, 0x50] + adds r0, r4 + lsls r0, 1 + ldr r5, _08193FAC + adds r1, r3, r5 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _08193FB0 + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + mov r3, r9 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] +_08193F8C: + ldr r0, _08193FB4 + ldr r1, [sp, 0x74] + add r1, r9 + lsls r1, 1 + add r1, r10 + ldrh r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r6, [r1, 0x1] + cmp r6, 0 + bne _08193FB8 + movs r6, 0x28 + b _08193FD0 + .align 2, 0 +_08193FAC: .4byte 0x00000d64 +_08193FB0: .4byte 0x0203bc8c +_08193FB4: .4byte 0x0831c898 +_08193FB8: + cmp r6, 0x1 + bne _08193FC0 + movs r6, 0x3C + b _08193FD0 +_08193FC0: + adds r1, r2, 0 + cmp r1, 0x78 + beq _08193FCA + cmp r1, 0x99 + bne _08193FD0 +_08193FCA: + lsrs r0, r6, 31 + adds r0, r6, r0 + asrs r6, r0, 1 +_08193FD0: + movs r1, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x64] + ldr r5, [sp, 0x70] + ldr r2, [sp, 0x4C] + adds r0, r5, r2 + lsls r0, 1 + str r0, [sp, 0x5C] +_08193FE2: + lsls r7, r1, 1 + adds r1, 0x1 + str r1, [sp, 0x68] + ldr r3, [sp, 0x5C] + adds r3, r7 + mov r8, r3 +_08193FEE: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + ldr r2, _08194058 + ldr r0, [r2] + ldr r4, _0819405C + adds r0, r4 + add r0, r8 + ldrh r4, [r0] + ldr r3, _08194060 + ldr r0, [r3] + lsls r4, 4 + adds r4, r0 + adds r0, r5, 0 + str r2, [sp, 0x7C] + str r3, [sp, 0x80] + bl getNature + ldrb r1, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x80] + cmp r1, r0 + bne _08193FEE + ldr r0, [r2] + ldr r2, [sp, 0x5C] + adds r1, r7, r2 + ldr r4, _0819405C + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _08194068 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r5, _08194064 + adds r0, r5 + ldrb r2, [r0, 0x17] + b _08194074 + .align 2, 0 +_08194058: .4byte 0x03005d90 +_0819405C: .4byte 0x00000d64 +_08194060: .4byte 0x0203bc8c +_08194064: .4byte 0x083203cc +_08194068: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, _08194098 + adds r0, r2 + ldrb r2, [r0, 0x16] +_08194074: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 1 + add r0, r10 + ldrh r0, [r0] + bl ai_rate_move + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x6 + ands r0, r5 + cmp r0, 0x6 + bne _0819409C + lsls r0, r4, 2 + mov r3, sp + adds r1, r3, r0 + b _081940D8 + .align 2, 0 +_08194098: .4byte 0x083203cc +_0819409C: + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _081940DE + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _081940B6 + lsls r0, r4, 2 + mov r5, sp + adds r2, r5, r0 + lsls r1, r6, 1 + b _081940CA +_081940B6: + movs r0, 0x4 + ands r5, r0 + cmp r5, 0 + beq _081940D2 + lsls r0, r4, 2 + mov r1, sp + adds r2, r1, r0 + lsrs r1, r6, 31 + adds r1, r6, r1 + asrs r1, 1 +_081940CA: + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + b _081940DE +_081940D2: + lsls r0, r4, 2 + mov r2, sp + adds r1, r2, r0 +_081940D8: + ldr r0, [r1] + adds r0, r6 + str r0, [r1] +_081940DE: + ldr r1, [sp, 0x68] + cmp r1, 0x2 + bgt _081940E6 + b _08193FE2 +_081940E6: + ldr r2, [sp, 0x74] + add r2, r9 + lsls r0, r2, 2 + add r0, sp + ldr r1, [r0] + ldr r3, [sp, 0x54] + cmp r3, r1 + bge _08194104 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] + lsls r0, r1, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194122 +_08194104: + ldr r4, [sp, 0x54] + cmp r4, r1 + bne _08194122 + ldr r5, [sp, 0x58] + lsls r0, r5, 1 + add r0, r10 + lsls r1, r2, 1 + add r1, r10 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _08194122 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] +_08194122: + ldr r0, [sp, 0x64] + mov r9, r0 + cmp r0, 0x3 + bgt _0819412C + b _08193F18 +_0819412C: + ldr r1, [sp, 0x60] + str r1, [sp, 0x50] + cmp r1, 0x2 + bgt _08194136 + b _08193F02 +_08194136: + ldr r2, [sp, 0x58] + mov r9, r2 + b _08194182 +_0819413C: + movs r3, 0 + mov r9, r3 + movs r1, 0 + mov r4, r10 + mov r3, r10 + mov r2, sp +_08194148: + ldr r0, [r2] + ldr r5, [sp, 0x54] + cmp r5, r0 + bge _0819415A + mov r9, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194170 +_0819415A: + ldr r5, [sp, 0x54] + cmp r5, r0 + bne _08194170 + mov r5, r9 + lsls r0, r5, 1 + adds r0, r4, r0 + ldrh r0, [r0] + ldrh r5, [r3] + cmp r0, r5 + bcs _08194170 + mov r9, r1 +_08194170: + adds r3, 0x2 + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0xB + ble _08194148 + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + beq _081941F4 +_08194182: + movs r2, 0 + str r2, [sp, 0x50] + mov r3, r9 + lsls r7, r3, 2 + ldr r4, [sp, 0x78] + cmp r2, r4 + bge _081941CA + lsls r0, r3, 1 + mov r5, r10 + adds r6, r5, r0 + ldr r0, [sp, 0x48] + lsls r5, r0, 24 +_0819419A: + ldr r0, _0819421C + ldr r4, [r0] + ldr r2, [sp, 0x50] + lsls r1, r2, 24 + lsrs r1, 24 + lsrs r0, r5, 24 + bl sub_81953E8 + lsls r0, 24 + lsrs r0, 23 + movs r3, 0xEC + lsls r3, 4 + adds r4, r3 + adds r4, r0 + ldrh r0, [r4] + ldrh r4, [r6] + cmp r0, r4 + beq _081941CA + ldr r0, [sp, 0x50] + adds r0, 0x1 + str r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + blt _0819419A +_081941CA: + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x78] + cmp r2, r3 + beq _081941F4 + mov r4, sp + adds r1, r4, r7 + movs r0, 0 + str r0, [r1] + movs r5, 0 + str r5, [sp, 0x54] + mov r9, r5 + mov r2, sp + movs r1, 0xB +_081941E4: + ldm r2!, {r0} + add r9, r0 + subs r1, 0x1 + cmp r1, 0 + bge _081941E4 + mov r0, r9 + cmp r0, 0 + bne _0819413C +_081941F4: + mov r1, r9 + lsls r0, r1, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08194204 + ldr r2, [sp, 0x58] + mov r9, r2 +_08194204: + mov r3, r9 + lsls r0, r3, 1 + add r0, r10 + ldrh r0, [r0] + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0819421C: .4byte 0x03005d90 + thumb_func_end sub_8193ED0 + + thumb_func_start sub_8194220 +sub_8194220: @ 8194220 + 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 r8, r0 + ldr r1, _0819425C + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r1, [r0, r2] + mov r10, r1 + movs r3, 0xC + ldrsh r4, [r0, r3] + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bls _08194250 + b _081948C2 +_08194250: + lsls r0, 2 + ldr r1, _08194260 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819425C: .4byte 0x03005e00 +_08194260: .4byte _08194264 + .align 2, 0 +_08194264: + .4byte _0819427C + .4byte _0819431C + .4byte _0819438C + .4byte _0819447C + .4byte _081944FC + .4byte _081947C8 +_0819427C: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x3 + bl enable_irqs + movs r4, 0 + str r4, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _081942FC + bl CpuSet + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _08194300 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _08194304 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r0, _08194308 + strh r4, [r0] + ldr r0, _0819430C + strh r4, [r0] + ldr r0, _08194310 + strh r4, [r0] + ldr r0, _08194314 + strh r4, [r0] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r1, 0xB0 + lsls r1, 4 + movs r0, 0x3 + movs r2, 0 + bl bg_change_y_offset + ldr r1, _08194318 + mov r2, r8 + lsls r0, r2, 2 + b _0819443C + .align 2, 0 +_081942FC: .4byte 0x05006000 +_08194300: .4byte 0x0860ce74 +_08194304: .4byte 0x0860ce94 +_08194308: .4byte 0x02022e14 +_0819430C: .4byte 0x02022e16 +_08194310: .4byte 0x02022e18 +_08194314: .4byte 0x02022e1a +_08194318: .4byte 0x03005e00 +_0819431C: + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + ldr r1, _08194380 + movs r0, 0x40 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0x9F + bl lcd_io_set + ldr r1, _08194384 + movs r0, 0x42 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0x9F + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x3F + bl lcd_io_set + bl sub_80A1A74 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r1, _08194388 + mov r3, r8 + lsls r0, r3, 2 + b _0819443C + .align 2, 0 +_08194380: .4byte 0x00005860 +_08194384: .4byte 0x00009098 +_08194388: .4byte 0x03005e00 +_0819438C: + ldr r4, _0819444C + movs r0, 0x80 + lsls r0, 4 + bl malloc_and_clear + adds r1, r0, 0 + str r1, [r4] + ldr r0, _08194450 + bl call_LZZUnCompWram + ldr r1, [r4] + movs r0, 0x1 + bl bg_set_tilemap + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r1, _08194454 + movs r5, 0x80 + lsls r5, 6 + movs r6, 0 + str r6, [sp] + movs r0, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _08194458 + str r6, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _0819445C + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, _08194460 + str r4, [sp] + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, _08194464 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl decompress_palette + ldr r0, _08194468 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl decompress_palette + ldr r0, _0819446C + movs r1, 0xF0 + movs r2, 0x20 + bl decompress_palette + str r6, [sp, 0x18] + add r0, sp, 0x18 + ldr r1, _08194470 + ldr r2, _08194474 + bl CpuSet + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r1, _08194478 + mov r4, r8 + lsls r0, r4, 2 +_0819443C: + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _081948C2 + .align 2, 0 +_0819444C: .4byte 0x0203cd7c +_08194450: .4byte 0x08d83900 +_08194454: .4byte 0x08d82f10 +_08194458: .4byte 0x08d834fc +_0819445C: .4byte 0x08d83b2c +_08194460: .4byte 0x08d83c3c +_08194464: .4byte 0x08d85358 +_08194468: .4byte 0x08d85444 +_0819446C: .4byte 0x08d85600 +_08194470: .4byte 0x02037b14 +_08194474: .4byte 0x05000100 +_08194478: .4byte 0x03005e00 +_0819447C: + ldr r0, _081944C8 + bl gpu_tile_obj_decompress_and_load + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x1C] + mov r1, r10 + cmp r1, 0 + bne _081944E8 + movs r5, 0 + ldr r4, _081944CC +_08194492: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, _081944D0 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x1E + bls _08194492 + ldr r0, _081944D4 + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081944DC + ldr r0, _081944D8 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl obj_add_from_template_forward_search + b _081944E8 + .align 2, 0 +_081944C8: .4byte 0x0860cf50 +_081944CC: .4byte 0x0860d411 +_081944D0: .4byte 0x0860cfa8 +_081944D4: .4byte 0x03005e00 +_081944D8: .4byte 0x0860d008 +_081944DC: + ldr r0, _081944F4 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl obj_add_from_template_forward_search +_081944E8: + ldr r1, _081944F8 + movs r0, 0 + bl lcd_io_set + b _081947A6 + .align 2, 0 +_081944F4: .4byte 0x0860cfd8 +_081944F8: .4byte 0x00007f40 +_081944FC: + add r0, sp, 0x4 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x5] + ldr r0, _081945AC + str r0, [sp, 0x4] + add r0, sp, 0x4 + strb r1, [r0, 0x4] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r1, [r0, 0xA] + strb r2, [r0, 0xB] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0x4] + add r2, sp, 0x4 + ldrb r3, [r2, 0xA] + movs r2, 0x70 + bl sub_81DB374 + add r1, sp, 0x4 + strb r0, [r1, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x9] + adds r3, r1, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + bl remo_copy + mov r3, r8 + lsls r3, 2 + str r3, [sp, 0x1C] + add r4, sp, 0x4 + movs r0, 0xF + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x20] + movs r2, 0 + str r2, [sp, 0x24] + movs r7, 0 + movs r5, 0xF +_0819456C: + ldr r3, _081945B0 + ldr r0, [r3] + adds r0, r7 + ldr r1, _081945B4 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + ldr r0, _081945B8 + bl sub_8195898 + mov r2, r10 + cmp r2, 0x1 + bne _081945C4 + ldr r3, _081945B0 + ldr r2, [r3] + adds r0, r2, r7 + ldr r1, _081945BC + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + blt _081945DC + ldr r3, _081945C0 + adds r0, r2, r3 + ldrh r1, [r0] + cmp r1, 0x1 + beq _08194634 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + subs r1, 0x2 + b _081945EA + .align 2, 0 +_081945AC: .4byte 0x085cccee +_081945B0: .4byte 0x03005d90 +_081945B4: .4byte 0x00000d24 +_081945B8: .4byte 0x02022e2c +_081945BC: .4byte 0x00000d25 +_081945C0: .4byte 0x00000cb2 +_081945C4: + mov r3, r10 + cmp r3, 0 + bne _08194634 + ldr r0, _081945F4 + ldr r2, [r0] + adds r0, r2, r7 + ldr r1, _081945F8 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + bge _081945FC +_081945DC: + lsls r1, 27 + lsrs r0, r1, 30 + cmp r0, 0 + beq _08194634 + subs r1, r0, 0x1 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 +_081945EA: + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC + b _08194634 + .align 2, 0 +_081945F4: .4byte 0x03005d90 +_081945F8: .4byte 0x00000d25 +_081945FC: + ldr r3, _0819461C + adds r1, r2, r3 + ldrh r0, [r1] + cmp r0, 0 + beq _08194634 + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r2, _08194620 + adds r0, r2 + movs r3, 0x10 + ldrsh r0, [r0, r3] + cmp r0, 0 + beq _08194624 + ldrh r1, [r1] + b _08194628 + .align 2, 0 +_0819461C: .4byte 0x00000cb2 +_08194620: .4byte 0x03005e00 +_08194624: + ldrh r0, [r1] + subs r1, r0, 0x1 +_08194628: + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194634: + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r3, _08194654 + adds r0, r3 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08194660 + ldr r2, _08194658 + ldr r0, [r2] + ldr r3, _0819465C + adds r0, r3 + ldrh r3, [r0] + adds r6, r2, 0 + b _0819466E + .align 2, 0 +_08194654: .4byte 0x03005e00 +_08194658: .4byte 0x03005d90 +_0819465C: .4byte 0x00000cb2 +_08194660: + ldr r1, _081946DC + ldr r0, [r1] + ldr r2, _081946E0 + adds r0, r2 + ldrh r0, [r0] + subs r3, r0, 0x1 + adds r6, r1, 0 +_0819466E: + mov r0, r10 + cmp r0, 0x1 + bne _0819468E + ldr r2, [r6] + adds r0, r2, r7 + ldr r1, _081946E4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 27 + lsrs r1, 30 + ldr r0, _081946E0 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + blt _081946A6 +_0819468E: + mov r1, r10 + cmp r1, 0 + bne _081946FA + ldr r0, [r6] + adds r0, r7 + ldr r2, _081946E4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + cmp r0, r3 + bgt _081946FA +_081946A6: + ldr r0, [r6] + adds r1, r0, r7 + ldr r3, _081946E4 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081946FA + ldr r2, _081946E8 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r3, _081946EC + cmp r0, r3 + bne _081946F0 + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .align 2, 0 +_081946DC: .4byte 0x03005d90 +_081946E0: .4byte 0x00000cb2 +_081946E4: .4byte 0x00000d25 +_081946E8: .4byte 0x00000d24 +_081946EC: .4byte 0x000003ff +_081946F0: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xB0 + b _08194734 +_081946FA: + ldr r0, [r6] + adds r0, r7 + ldr r1, _08194724 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, _08194728 + cmp r0, r2 + bne _0819472C + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .align 2, 0 +_08194724: .4byte 0x00000d24 +_08194728: .4byte 0x000003ff +_0819472C: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xE0 +_08194734: + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0xD0 +_08194740: + orrs r0, r1 + strb r0, [r4, 0xD] + ldr r0, _08194760 + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _08194768 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + ldr r1, _08194764 + movs r2, 0x3D + bl sub_81DB384 + b _0819476A + .align 2, 0 +_08194760: .4byte 0x0860d3f1 +_08194764: .4byte 0x02022e2c +_08194768: + movs r0, 0x3 +_0819476A: + strb r0, [r4, 0x8] + ldr r0, _081947B8 + str r0, [sp, 0x4] + ldr r0, _081947BC + ldr r1, [sp, 0x20] + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r4, 0x4] + ldr r2, _081947C0 + adds r0, r1, r2 + ldrb r0, [r0] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl remo_copy + ldr r3, [sp, 0x20] + adds r3, 0x2 + str r3, [sp, 0x20] + ldr r0, [sp, 0x24] + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + str r0, [sp, 0x24] + adds r7, 0x4 + subs r5, 0x1 + cmp r5, 0 + blt _081947A6 + b _0819456C +_081947A6: + ldr r0, _081947C4 + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _081948C2 + .align 2, 0 +_081947B8: .4byte 0x02022e2c +_081947BC: .4byte 0x0860d3f1 +_081947C0: .4byte 0x0860d3f2 +_081947C4: .4byte 0x03005e00 +_081947C8: + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram + movs r0, 0x2 + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _08194834 + bl SetHBlankCallback + ldr r0, _08194838 + bl SetVBlankCallback + cmp r4, 0x2 + bne _0819485C + mov r2, r10 + cmp r2, 0 + bne _08194844 + ldr r0, _0819483C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _08194840 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + mov r3, r10 + strh r3, [r1, 0x8] + strh r3, [r1, 0xA] + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0x14] + b _08194878 + .align 2, 0 +_08194834: .4byte sub_8194BEC + 1 +_08194838: .4byte sub_8194CE4 + 1 +_0819483C: .4byte sub_819395C + 1 +_08194840: .4byte 0x03005e00 +_08194844: + ldr r0, _08194854 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _08194858 + b _0819486C + .align 2, 0 +_08194854: .4byte sub_8194950 + 1 +_08194858: .4byte 0x03005e00 +_0819485C: + ldr r1, _081948D4 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r5, [r0, r3] +_0819486C: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] +_08194878: + bl dp12_8087EA4 + ldr r0, _081948D8 + ldr r2, _081948DC + movs r4, 0xF0 + lsls r4, 3 + adds r1, r0, r4 + movs r5, 0x5A +_08194888: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08194888 + movs r5, 0x5B + ldr r3, _081948E0 + ldr r0, _081948D8 + ldr r2, _081948E4 + ldr r4, _081948E8 + adds r1, r0, r4 + adds r0, 0xB6 +_081948A4: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x9F + ble _081948A4 + ldr r0, [r3] + ldr r1, [r3, 0x4] + ldr r2, [r3, 0x8] + bl sub_80BA038 + mov r0, r8 + bl remove_task +_081948C2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081948D4: .4byte 0x03005e00 +_081948D8: .4byte 0x02038c28 +_081948DC: .4byte 0x00001f0a +_081948E0: .4byte 0x0860cf44 +_081948E4: .4byte 0x00001f09 +_081948E8: .4byte 0x00000836 + thumb_func_end sub_8194220 + + thumb_func_start sub_81948EC +sub_81948EC: @ 81948EC + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r4, _08194948 + lsls r2, r1, 2 + lsls r3, r0, 4 + adds r2, r3 + adds r2, r4 + ldr r3, [r2] + ldr r2, _0819494C + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08194938 + movs r7, 0x1 + adds r4, r3, 0 + adds r5, r4, 0x2 + adds r6, r0, 0 +_0819491A: + ldrb r2, [r4] + ldrb r3, [r4, 0x1] + str r7, [sp] + str r7, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r1, r5, 0 + bl bg_copy_tilemap_rect_simple + adds r4, 0x4 + adds r5, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _0819491A +_08194938: + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08194948: .4byte 0x0860dd10 +_0819494C: .4byte 0x0860de10 + thumb_func_end sub_81948EC + + thumb_func_start sub_8194950 +sub_8194950: @ 8194950 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08194980 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _08194974 + b _08194B3C +_08194974: + lsls r0, 2 + ldr r1, _08194984 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08194980: .4byte 0x03005e00 +_08194984: .4byte _08194988 + .align 2, 0 +_08194988: + .4byte _0819499C + .4byte _081949C0 + .4byte _08194AD4 + .4byte _08194AEE + .4byte _08194B24 +_0819499C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r1, _081949BC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _08194B3C + .align 2, 0 +_081949BC: .4byte 0x03005e00 +_081949C0: + ldr r0, _08194A68 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081949CE + b _08194B3C +_081949CE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0 + movs r3, 0x2 + movs r1, 0x2 + strh r1, [r0, 0x8] + movs r1, 0x40 + strh r1, [r0, 0xE] + add r0, sp, 0x4 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + subs r1, 0x50 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xB0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, _08194A6C + mov r9, r0 + ldr r1, _08194A70 + mov r8, r1 + adds r4, r2, 0 + ldr r6, _08194A74 + movs r5, 0 +_08194A1C: + mov r2, r8 + ldr r0, [r2] + adds r0, r5 + ldr r1, _08194A78 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + mov r0, r9 + bl sub_8195898 + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldr r1, _08194A7C + adds r0, r1 + ldrb r3, [r0] + lsls r1, r3, 27 + lsrs r1, 30 + ldr r0, _08194A80 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + bne _08194A9E + lsls r0, r3, 29 + cmp r0, 0 + bge _08194A9E + ldrb r0, [r6] + cmp r0, 0 + bne _08194A84 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + mov r1, r9 + movs r2, 0x3D + bl sub_81DB384 + b _08194A86 + .align 2, 0 +_08194A68: .4byte 0x02037fd4 +_08194A6C: .4byte 0x02022e2c +_08194A70: .4byte 0x03005d90 +_08194A74: .4byte 0x0860d3f1 +_08194A78: .4byte 0x00000d24 +_08194A7C: .4byte 0x00000d25 +_08194A80: .4byte 0x00000cb2 +_08194A84: + movs r0, 0x3 +_08194A86: + strb r0, [r4, 0x8] + mov r1, r9 + str r1, [sp, 0x4] + ldrb r0, [r6] + strb r0, [r4, 0x4] + ldrb r0, [r6, 0x1] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl remo_copy +_08194A9E: + mov r2, r8 + ldr r1, [r2] + adds r0, r1, r5 + ldr r2, _08194AD0 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194AC4 + subs r2, 0x73 + adds r0, r1, r2 + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r7, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194AC4: + adds r6, 0x2 + adds r5, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _08194A1C + b _08194B3C + .align 2, 0 +_08194AD0: .4byte 0x00000d25 +_08194AD4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08194B3C + movs r0, 0x3 + strh r0, [r1, 0x8] + b _08194B3C +_08194AEE: + ldr r0, _08194B1C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08194B3C + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r1, _08194B20 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x8] + b _08194B3C + .align 2, 0 +_08194B1C: .4byte 0x030022c0 +_08194B20: .4byte 0x03005e00 +_08194B24: + ldr r0, _08194B4C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08194B3C + ldr r0, _08194B50 + bl set_callback2 + adds r0, r4, 0 + bl remove_task +_08194B3C: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08194B4C: .4byte 0x02037fd4 +_08194B50: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_8194950 + + thumb_func_start sub_8194B54 +sub_8194B54: @ 8194B54 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_8194B54 + + thumb_func_start sub_8194B70 +sub_8194B70: @ 8194B70 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x2 + bl bg_change_y_offset + ldr r0, _08194BD4 + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _08194BD8 + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _08194BDC + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _08194BE0 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + ldr r0, _08194BE4 + ldrh r1, [r0] + movs r0, 0x18 + bl lcd_io_set + ldr r0, _08194BE8 + ldrh r1, [r0] + movs r0, 0x1A + bl lcd_io_set + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + .align 2, 0 +_08194BD4: .4byte 0x02022e14 +_08194BD8: .4byte 0x02022e16 +_08194BDC: .4byte 0x02022e18 +_08194BE0: .4byte 0x02022e1a +_08194BE4: .4byte 0x02022e1c +_08194BE8: .4byte 0x02022e1e + thumb_func_end sub_8194B70 + + thumb_func_start sub_8194BEC +sub_8194BEC: @ 8194BEC + push {lr} + ldr r0, _08194C0C + ldrh r0, [r0] + adds r1, r0, 0 + cmp r0, 0x29 + bls _08194CC8 + cmp r0, 0x31 + bhi _08194C1C + ldr r1, _08194C10 + ldr r2, _08194C14 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, _08194C18 + b _08194CD4 + .align 2, 0 +_08194C0C: .4byte 0x04000006 +_08194C10: .4byte 0x04000048 +_08194C14: .4byte 0x00003b3b +_08194C18: .4byte 0x989b5558 +_08194C1C: + cmp r0, 0x39 + bls _08194CC8 + cmp r0, 0x4A + bhi _08194C40 + ldr r1, _08194C34 + ldr r2, _08194C38 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, _08194C3C + b _08194CD4 + .align 2, 0 +_08194C34: .4byte 0x04000048 +_08194C38: .4byte 0x00003b3b +_08194C3C: .4byte 0x90985860 +_08194C40: + cmp r0, 0x51 + bhi _08194C60 + ldr r1, _08194C54 + ldr r2, _08194C58 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, _08194C5C + b _08194CD4 + .align 2, 0 +_08194C54: .4byte 0x04000048 +_08194C58: .4byte 0x00003b3b +_08194C5C: .4byte 0x989b5558 +_08194C60: + cmp r0, 0x5E + bls _08194CC8 + cmp r0, 0x66 + bhi _08194C84 + ldr r1, _08194C78 + ldr r2, _08194C7C + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, _08194C80 + b _08194CD4 + .align 2, 0 +_08194C78: .4byte 0x04000048 +_08194C7C: .4byte 0x00003737 +_08194C80: .4byte 0x989b5558 +_08194C84: + cmp r0, 0x76 + bhi _08194CA4 + ldr r1, _08194C98 + ldr r2, _08194C9C + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, _08194CA0 + b _08194CD4 + .align 2, 0 +_08194C98: .4byte 0x04000048 +_08194C9C: .4byte 0x00003737 +_08194CA0: .4byte 0x90985860 +_08194CA4: + cmp r0, 0x7E + bls _08194CC8 + cmp r1, 0x86 + bhi _08194CC8 + ldr r1, _08194CBC + ldr r2, _08194CC0 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, _08194CC4 + b _08194CD4 + .align 2, 0 +_08194CBC: .4byte 0x04000048 +_08194CC0: .4byte 0x00003737 +_08194CC4: .4byte 0x989b5558 +_08194CC8: + ldr r1, _08194CDC + ldr r2, _08194CE0 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + movs r0, 0 +_08194CD4: + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08194CDC: .4byte 0x04000048 +_08194CE0: .4byte 0x00003f3f + thumb_func_end sub_8194BEC + + thumb_func_start sub_8194CE4 +sub_8194CE4: @ 8194CE4 + push {lr} + ldr r0, _08194D38 + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, _08194D3C + ldrh r1, [r0] + movs r0, 0x12 + bl lcd_io_set + ldr r0, _08194D40 + ldrh r1, [r0] + movs r0, 0x14 + bl lcd_io_set + ldr r0, _08194D44 + ldrh r1, [r0] + movs r0, 0x16 + bl lcd_io_set + movs r0, 0x2 + movs r1, 0x80 + movs r2, 0x2 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl bg_change_y_offset + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .align 2, 0 +_08194D38: .4byte 0x02022e14 +_08194D3C: .4byte 0x02022e16 +_08194D40: .4byte 0x02022e18 +_08194D44: .4byte 0x02022e1a + thumb_func_end sub_8194CE4 + + thumb_func_start sub_8194D48 +sub_8194D48: @ 8194D48 + ldr r1, _08194D58 + ldr r0, _08194D5C + str r0, [r1] + ldr r1, _08194D60 + ldr r0, _08194D64 + str r0, [r1] + bx lr + .align 2, 0 +_08194D58: .4byte 0x0203bc8c +_08194D5C: .4byte 0x085d97bc +_08194D60: .4byte 0x0203bc88 +_08194D64: .4byte 0x085d5acc + thumb_func_end sub_8194D48 + + thumb_func_start sub_8194D68 +sub_8194D68: @ 8194D68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r3, 0 +_08194D76: + ldr r0, _08194DB0 + ldr r1, [r0] + ldr r0, _08194DB4 + adds r0, r3, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, _08194DB8 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + mov r10, r0 + movs r6, 0 + adds r0, r3, 0x1 + str r0, [sp] + movs r1, 0x64 + mov r0, r10 + muls r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r2, r0 + mov r9, r2 + adds r7, r3, 0 + muls r7, r1 +_08194DA8: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _08194DBE + .align 2, 0 +_08194DB0: .4byte 0x03005d90 +_08194DB4: .4byte 0x0203cef8 +_08194DB8: .4byte 0x00000caa +_08194DBC: + adds r5, 0x1 +_08194DBE: + cmp r5, 0x3 + bgt _08194DEA + ldr r1, _08194E3C + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + str r3, [sp, 0x4] + bl pokemon_getattr + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + ldr r2, _08194E40 + adds r0, r7, r2 + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x4] + cmp r4, r0 + bne _08194DBC +_08194DEA: + cmp r5, 0x4 + bne _08194E00 + lsls r2, r6, 24 + lsrs r2, 24 + ldr r1, _08194E40 + adds r0, r7, r1 + movs r1, 0xA6 + str r3, [sp, 0x4] + bl sub_80691F4 + ldr r3, [sp, 0x4] +_08194E00: + mov r6, r8 + cmp r6, 0x3 + ble _08194DA8 + ldr r2, _08194E3C + ldr r0, [r2] + movs r2, 0x64 + mov r1, r10 + muls r1, r2 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + adds r1, r3, 0 + muls r1, r2 + ldr r2, _08194E40 + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r3, [sp] + cmp r3, 0x1 + ble _08194D76 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08194E3C: .4byte 0x03005d8c +_08194E40: .4byte 0x020244ec + thumb_func_end sub_8194D68 + + thumb_func_start sub_8194E44 +sub_8194E44: @ 8194E44 + push {r4-r7,lr} + sub sp, 0x4 + movs r4, 0 + ldr r7, _08194EA0 + movs r6, 0x64 + movs r5, 0 +_08194E50: + ldr r0, _08194EA4 + ldr r1, [r0] + ldr r0, _08194EA8 + adds r0, r4, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, _08194EAC + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r6 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + ldr r0, _08194EB0 + adds r0, r5, r0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r5, 0x64 + adds r4, 0x1 + cmp r4, 0x1 + ble _08194E50 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08194EA0: .4byte 0x03005d8c +_08194EA4: .4byte 0x03005d90 +_08194EA8: .4byte 0x0203cef8 +_08194EAC: .4byte 0x00000caa +_08194EB0: .4byte 0x020244ec + thumb_func_end sub_8194E44 + + thumb_func_start sub_8194EB4 +sub_8194EB4: @ 8194EB4 + push {lr} + bl sub_80F94E8 + pop {r0} + bx r0 + thumb_func_end sub_8194EB4 + + thumb_func_start sub_8194EC0 +sub_8194EC0: @ 8194EC0 + push {r4,lr} + ldr r0, _08194EDC + ldrh r0, [r0] + bl sub_8195358 + adds r4, r0, 0 + ldr r0, _08194EE0 + bl sub_8195358 + cmp r4, r0 + ble _08194EE8 + ldr r1, _08194EE4 + movs r0, 0x1 + b _08194EEC + .align 2, 0 +_08194EDC: .4byte 0x02038bca +_08194EE0: .4byte 0x000003ff +_08194EE4: .4byte 0x020375f0 +_08194EE8: + ldr r1, _08194EF4 + movs r0, 0x2 +_08194EEC: + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08194EF4: .4byte 0x020375f0 + thumb_func_end sub_8194EC0 + + thumb_func_start sub_8194EF8 +sub_8194EF8: @ 8194EF8 + push {r4,lr} + bl sub_8194D48 + movs r2, 0 + ldr r3, _08194F48 + ldr r0, [r3] + ldr r1, _08194F4C + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _08194F2A + adds r4, r3, 0 + adds r3, r1, 0 +_08194F14: + adds r2, 0x1 + cmp r2, 0xF + bgt _08194F2A + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194F14 +_08194F2A: + ldr r0, _08194F50 + ldr r1, _08194F48 + ldr r1, [r1] + lsls r2, 2 + adds r1, r2 + ldr r2, _08194F54 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + bl sub_8195898 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08194F48: .4byte 0x03005d90 +_08194F4C: .4byte 0x00000d25 +_08194F50: .4byte 0x02021cc4 +_08194F54: .4byte 0x00000d24 + thumb_func_end sub_8194EF8 + + thumb_func_start sub_8194F58 +sub_8194F58: @ 8194F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + ldr r4, _08194FE8 + ldr r2, [r4] + ldr r5, _08194FEC + adds r0, r2, r5 + ldrb r1, [r0] + ldr r6, _08194FF0 + adds r0, r2, r6 + ldrb r0, [r0] + cmn r1, r0 + beq _08194F8C + ldr r1, _08194FF4 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08194F8C + b _0819533E +_08194F8C: + movs r0, 0x20 + bl malloc_and_clear + str r0, [sp, 0x18] + movs r0, 0x18 + bl malloc_and_clear + str r0, [sp, 0x1C] + ldr r1, [r4] + ldr r2, _08194FF8 + adds r1, r2 + ldrb r2, [r1] + lsls r0, r2, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x1 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + adds r0, r6 + strb r1, [r0] + movs r3, 0 + mov r10, r3 + movs r4, 0 + str r4, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] +_08194FCC: + mov r0, r10 + cmp r0, 0x4 + bgt _08194FFC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + b _08195030 + .align 2, 0 +_08194FE8: .4byte 0x03005d90 +_08194FEC: .4byte 0x00000d0a +_08194FF0: .4byte 0x00000d0b +_08194FF4: .4byte 0x00000ca8 +_08194FF8: .4byte 0x00000ca9 +_08194FFC: + mov r1, r10 + cmp r1, 0xE + bgt _0819501A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0xA + b _08195030 +_0819501A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0x1E +_08195030: + movs r6, 0 + cmp r6, r10 + bge _08195064 + ldr r2, _081952A0 + ldr r0, [r2] + ldr r3, _081952A4 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + beq _08195064 + adds r3, r2, 0 + ldr r2, _081952A4 +_0819504C: + adds r6, 0x1 + cmp r6, r10 + bge _08195064 + ldr r0, [r3] + lsls r1, r6, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0819504C +_08195064: + cmp r6, r10 + bne _08194FCC + ldr r5, _081952A0 + ldr r3, [r5] + ldr r0, [sp, 0x38] + adds r3, r0 + ldr r1, _081952A4 + adds r3, r1 + ldr r2, _081952A8 + adds r0, r2, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, _081952AC + adds r1, r5, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r6, 0 + lsls r4, 16 + str r4, [sp, 0x30] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x20] +_08195092: + adds r1, r6, 0x1 + str r1, [sp, 0x24] + lsls r2, r6, 2 + str r2, [sp, 0x2C] + lsls r3, r6, 1 + str r3, [sp, 0x28] +_0819509E: + ldr r4, [sp, 0x30] + lsrs r0, r4, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r5, r0, 16 + movs r7, 0 + cmp r7, r6 + bge _081950F4 + ldr r0, _081952A0 + ldr r0, [r0] + ldr r1, _081952B0 + mov r9, r1 + ldr r2, [sp, 0x8] + mov r8, r2 + ldr r3, [sp, 0xC] + mov r12, r3 + ldr r4, _081952B4 + adds r0, r4 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_081950C8: + ldrh r3, [r4] + cmp r3, r5 + beq _081950F4 + mov r2, r9 + ldr r1, [r2] + lsls r0, r5, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _081950F4 + cmp r12, r0 + beq _081950F4 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _081950F4 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r6 + blt _081950C8 +_081950F4: + cmp r7, r6 + bne _0819509E + ldr r3, _081952A0 + ldr r0, [r3] + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x3C] + adds r1, r4, r2 + ldr r3, _081952B4 + adds r0, r3 + adds r0, r1 + strh r5, [r0] + ldr r2, [sp, 0x2C] + add r2, sp + adds r2, 0x8 + ldr r3, _081952B0 + ldr r1, [r3] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r6, [sp, 0x24] + cmp r6, 0x2 + ble _08195092 + ldr r4, _081952A0 + ldr r2, [r4] + ldr r5, [sp, 0x38] + adds r2, r5 + ldr r0, _081952B8 + adds r2, r0 + ldrb r0, [r2] + movs r4, 0x5 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, _081952A0 + ldr r2, [r5] + ldr r0, [sp, 0x38] + adds r2, r0 + ldr r1, _081952B8 + adds r2, r1 + ldrb r0, [r2] + subs r4, 0x14 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x38] + adds r1, r5 + ldr r0, _081952B8 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + adds r1, 0x6 + str r1, [sp, 0x3C] + movs r2, 0x1 + add r10, r2 + mov r4, r10 + cmp r4, 0xF + bgt _08195178 + b _08194FCC +_08195178: + movs r5, 0 + mov r10, r5 + ldr r5, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x34] +_08195182: + movs r7, 0 + strh r7, [r5] + ldr r1, _081952A0 + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, _081952A4 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + ldr r4, [sp, 0x34] + mov r9, r4 +_081951AA: + ldr r1, _081952A0 + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r6 + lsls r4, 1 + ldr r2, _081952B4 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, _081952B0 + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + movs r1, 0x32 + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r5] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r5] + ldr r3, _081952A0 + ldr r0, [r3] + ldr r1, _081952B4 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, _081952B0 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, _081952BC + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r4, _081952C0 + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + adds r6, 0x1 + cmp r6, 0x2 + ble _081951AA + movs r4, 0 + movs r1, 0x1 + movs r6, 0x1F +_0819523A: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08195244 + adds r4, 0x1 +_08195244: + asrs r7, 1 + subs r6, 0x1 + cmp r6, 0 + bge _0819523A + movs r1, 0x32 + adds r0, r4, 0 + muls r0, r1 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r5] + adds r1, r0 + strh r1, [r5] + adds r5, 0x2 + ldr r2, [sp, 0x34] + adds r2, 0x2 + str r2, [sp, 0x34] + movs r3, 0x1 + add r10, r3 + mov r4, r10 + cmp r4, 0xF + ble _08195182 + movs r5, 0 + mov r10, r5 + ldr r7, [sp, 0x18] +_08195276: + mov r6, r10 + adds r6, 0x1 + cmp r6, 0xF + bgt _081952F8 + mov r8, r7 + ldr r5, _081952A4 + lsls r0, r6, 1 + ldr r1, [sp, 0x18] + adds r4, r0, r1 +_08195288: + mov r2, r8 + ldrh r1, [r2] + ldrh r0, [r4] + cmp r1, r0 + bcs _081952C4 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _081952F0 + .align 2, 0 +_081952A0: .4byte 0x03005d90 +_081952A4: .4byte 0x00000d24 +_081952A8: .4byte 0x000003ff +_081952AC: .4byte 0xfffffc00 +_081952B0: .4byte 0x0203bc8c +_081952B4: .4byte 0x00000d64 +_081952B8: .4byte 0x00000d25 +_081952BC: .4byte 0x083203cc +_081952C0: .4byte 0x0832a328 +_081952C4: + cmp r1, r0 + bne _081952F0 + ldr r0, _08195350 + ldr r1, [r0] + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 22 + lsls r0, r6, 2 + adds r1, r0 + adds r1, r5 + ldrh r0, [r1] + lsls r0, 22 + cmp r2, r0 + bls _081952F0 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_081952F0: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _08195288 +_081952F8: + adds r7, 0x2 + movs r4, 0x1 + add r10, r4 + mov r5, r10 + cmp r5, 0xE + ble _08195276 + ldr r0, [sp, 0x18] + bl free + ldr r0, [sp, 0x1C] + bl free + movs r0, 0 + mov r10, r0 +_08195314: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_8195438 + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x3 + ble _08195314 + ldr r0, _08195350 + ldr r1, [r0] + ldr r4, _08195354 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + ldr r5, [sp, 0x14] + orrs r0, r5 + strb r0, [r1] +_0819533E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08195350: .4byte 0x03005d90 +_08195354: .4byte 0x00000ca9 + thumb_func_end sub_8194F58 + + thumb_func_start sub_8195358 +sub_8195358: @ 8195358 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, _08195398 + ldr r0, [r4] + ldr r1, _0819539C + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _0819538E + adds r5, r4, 0 + adds r4, r1, 0 +_08195376: + adds r2, 0x1 + cmp r2, 0xF + bgt _0819538E + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _08195376 +_0819538E: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08195398: .4byte 0x03005d90 +_0819539C: .4byte 0x00000d24 + thumb_func_end sub_8195358 + + thumb_func_start sub_81953A0 +sub_81953A0: @ 81953A0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, _081953E0 + ldr r0, [r4] + ldr r1, _081953E4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _081953D6 + adds r5, r4, 0 + adds r4, r1, 0 +_081953BE: + adds r2, 0x1 + cmp r2, 0xF + bgt _081953D6 + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _081953BE +_081953D6: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081953E0: .4byte 0x03005d90 +_081953E4: .4byte 0x00000d24 + thumb_func_end sub_81953A0 + + thumb_func_start sub_81953E8 +sub_81953E8: @ 81953E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08195424 + ldr r0, _08195428 + adds r0, r4, r0 + ldrb r0, [r0] + lsrs r0, 1 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_8192F08 + mov r0, sp + ldrb r0, [r0] + cmp r4, r0 + beq _0819542C + mov r0, sp + ldrb r0, [r0] + b _08195430 + .align 2, 0 +_08195424: .4byte 0x0860d1a0 +_08195428: .4byte 0x0860d1c0 +_0819542C: + mov r0, sp + ldrb r0, [r0, 0x1] +_08195430: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81953E8 + + thumb_func_start sub_8195438 +sub_8195438: @ 8195438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r1, 0 + str r1, [sp, 0x10] + movs r5, 0 + movs r1, 0x3 + ldr r0, [sp] + ands r0, r1 + lsls r0, 3 + str r0, [sp, 0x14] +_0819545E: + ldr r2, _081954F0 + ldr r0, [r2] + lsls r4, r5, 2 + adds r1, r0, r4 + ldr r3, _081954F4 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + adds r2, r5, 0x1 + str r2, [sp, 0x24] + cmp r0, 0 + bge _08195478 + b _08195876 +_08195478: + subs r3, 0x1 + adds r0, r1, r3 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, _081954F8 + cmp r1, r0 + bne _08195488 + b _08195876 +_08195488: + str r5, [sp, 0x4] + lsrs r1, 22 + ldr r0, [sp] + bl sub_81901A0 + str r0, [sp, 0x8] + ldr r0, _081954F0 + ldr r3, [r0] + adds r0, r3, r4 + ldr r1, _081954FC + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, _08195500 + cmp r0, r1 + bne _08195504 + ldr r2, [sp, 0x8] + cmp r2, 0xFF + beq _08195504 + lsls r2, 2 + adds r1, r3, r2 + ldr r3, _081954F4 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r0, _081954F0 + ldr r1, [r0] + adds r1, r2 + ldr r2, _081954F4 + adds r1, r2 + ldrb r0, [r1] + subs r3, 0x1D + ands r0, r3 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + adds r0, r5, 0 + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, _081954F0 + ldr r1, [r3] + ldr r5, [sp, 0x8] + lsls r2, r5, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + b _08195874 + .align 2, 0 +_081954F0: .4byte 0x03005d90 +_081954F4: .4byte 0x00000d25 +_081954F8: .4byte 0xffc00000 +_081954FC: .4byte 0x00000d24 +_08195500: .4byte 0xff800000 +_08195504: + ldr r4, _0819556C + ldr r3, [r4] + ldr r0, [sp, 0x8] + lsls r2, r0, 2 + adds r0, r3, r2 + ldr r1, _08195570 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, _08195574 + str r2, [sp, 0x30] + cmp r0, r1 + bne _0819557C + ldr r2, [sp, 0x4] + cmp r2, 0xFF + beq _0819557C + lsls r2, 2 + adds r1, r3, r2 + ldr r3, _08195578 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r4] + adds r1, r2 + ldr r0, _08195578 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r4] + ldr r3, [sp, 0x4] + lsls r2, r3, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r5, 0x1 + str r5, [sp, 0x24] + b _08195876 + .align 2, 0 +_0819556C: .4byte 0x03005d90 +_08195570: .4byte 0x00000d24 +_08195574: .4byte 0xff800000 +_08195578: .4byte 0x00000d25 +_0819557C: + adds r5, 0x1 + str r5, [sp, 0x24] + ldr r5, [sp, 0x8] + cmp r5, 0xFF + bne _08195588 + b _08195876 +_08195588: + movs r0, 0 + mov r10, r0 + lsls r1, r5, 1 + str r1, [sp, 0x2C] + ldr r2, [sp, 0x4] + lsls r2, 1 + str r2, [sp, 0x28] + ldr r3, [sp, 0x4] + adds r0, r2, r3 + lsls r0, 1 + mov r9, r0 + adds r0, r1, r5 + lsls r0, 1 + str r0, [sp, 0x18] +_081955A4: + movs r5, 0 + mov r0, r9 + str r0, [sp, 0x38] +_081955AA: + movs r6, 0 + lsls r7, r5, 1 + ldr r4, [sp, 0x18] +_081955B0: + ldr r2, _08195770 + ldr r1, [r2] + ldr r3, _08195774 + adds r1, r3 + ldr r2, [sp, 0x38] + adds r0, r1, r2 + ldrh r0, [r0] + ldr r3, _08195778 + mov r8, r3 + ldr r2, [r3] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + bl sub_818FFC0 + ldr r1, [sp, 0xC] + adds r1, r0 + str r1, [sp, 0xC] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x2 + ble _081955B0 + adds r5, 0x1 + cmp r5, 0x3 + ble _081955AA + ldr r2, _08195770 + ldr r0, [r2] + ldr r3, _08195774 + adds r0, r3 + add r0, r9 + ldrh r0, [r0] + mov r5, r8 + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, _0819577C + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r2, [r1, 0x2] + adds r0, r2 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r3, [r1, 0x4] + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r5, [sp, 0xC] + adds r5, r0 + str r5, [sp, 0xC] + movs r0, 0x2 + add r9, r0 + movs r1, 0x1 + add r10, r1 + mov r2, r10 + cmp r2, 0x2 + ble _081955A4 + bl GenerateRandomNumber + movs r1, 0x1F + ands r1, r0 + adds r5, r1 + ldr r3, [sp, 0x4] + adds r5, r3 + str r5, [sp, 0xC] + movs r5, 0 + mov r10, r5 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x8] + adds r0, r1, r2 + lsls r0, 1 + str r0, [sp, 0x1C] + ldr r5, [sp, 0x28] + adds r0, r5, r3 + lsls r0, 1 + str r0, [sp, 0x20] +_08195668: + movs r5, 0 + mov r0, r10 + lsls r3, r0, 1 + movs r1, 0x1 + add r10, r1 + ldr r2, [sp, 0x1C] + adds r2, r3 + mov r8, r2 +_08195678: + movs r6, 0 + lsls r7, r5, 1 + adds r5, 0x1 + str r5, [sp, 0x3C] + ldr r4, [sp, 0x20] +_08195682: + ldr r5, _08195770 + ldr r1, [r5] + ldr r0, _08195774 + adds r1, r0 + mov r2, r8 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r5, _08195778 + mov r9, r5 + ldr r2, [r5] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + str r3, [sp, 0x34] + bl sub_818FFC0 + ldr r1, [sp, 0x10] + adds r1, r0 + str r1, [sp, 0x10] + adds r4, 0x2 + adds r6, 0x1 + ldr r3, [sp, 0x34] + cmp r6, 0x2 + ble _08195682 + ldr r5, [sp, 0x3C] + cmp r5, 0x3 + ble _08195678 + ldr r2, _08195770 + ldr r0, [r2] + ldr r5, [sp, 0x1C] + adds r1, r3, r5 + ldr r2, _08195774 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + mov r3, r9 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, _0819577C + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r5, [r1, 0x2] + adds r0, r5 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r2, [r1, 0x4] + adds r0, r2 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r3, [sp, 0x10] + adds r3, r0 + str r3, [sp, 0x10] + mov r5, r10 + cmp r5, 0x2 + ble _08195668 + bl GenerateRandomNumber + movs r1, 0x1F + ands r1, r0 + ldr r0, [sp, 0x10] + adds r0, r1 + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] + ldr r2, [sp, 0xC] + cmp r2, r0 + ble _08195784 + ldr r3, _08195770 + ldr r1, [r3] + ldr r5, [sp, 0x30] + adds r1, r5 + ldr r0, _08195780 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r5 + ldr r3, _08195780 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x19 + negs r5, r5 + ands r0, r5 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, _08195770 + ldr r1, [r3] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x2C] + adds r1, r2 + b _08195874 + .align 2, 0 +_08195770: .4byte 0x03005d90 +_08195774: .4byte 0x00000d64 +_08195778: .4byte 0x0203bc8c +_0819577C: .4byte 0x083203cc +_08195780: .4byte 0x00000d25 +_08195784: + ldr r3, [sp, 0xC] + ldr r5, [sp, 0x10] + cmp r3, r5 + bge _081957DC + ldr r0, _081957D4 + ldr r1, [r0] + ldr r3, [sp, 0x4] + lsls r2, r3, 2 + adds r1, r2 + ldr r5, _081957D8 + adds r1, r5 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r5, _081957D4 + ldr r1, [r5] + adds r1, r2 + ldr r0, _081957D8 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r5] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x28] + adds r1, r2 + b _08195874 + .align 2, 0 +_081957D4: .4byte 0x03005d90 +_081957D8: .4byte 0x00000d25 +_081957DC: + ldr r3, [sp, 0x4] + ldr r5, [sp, 0x8] + cmp r3, r5 + ble _08195830 + ldr r0, _08195828 + ldr r1, [r0] + ldr r2, [sp, 0x30] + adds r1, r2 + ldr r3, _0819582C + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, _08195828 + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, _08195828 + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x2C] + b _08195872 + .align 2, 0 +_08195828: .4byte 0x03005d90 +_0819582C: .4byte 0x00000d25 +_08195830: + ldr r5, _08195890 + ldr r1, [r5] + ldr r0, [sp, 0x4] + lsls r2, r0, 2 + adds r1, r2 + ldr r3, _08195894 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, _08195890 + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, _08195890 + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x28] +_08195872: + adds r1, r3 +_08195874: + strh r0, [r1] +_08195876: + ldr r5, [sp, 0x24] + cmp r5, 0xF + bgt _0819587E + b _0819545E +_0819587E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08195890: .4byte 0x03005d90 +_08195894: .4byte 0x00000d25 + thumb_func_end sub_8195438 + + thumb_func_start sub_8195898 +sub_8195898: @ 8195898 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + ldr r0, _081958B4 + cmp r5, r0 + bne _081958B8 + adds r0, r6, 0 + bl sub_8195938 + b _08195902 + .align 2, 0 +_081958B4: .4byte 0x000003fe +_081958B8: + ldr r0, _081958D4 + cmp r5, r0 + bne _081958DC + ldr r0, _081958D8 + ldr r2, [r0] +_081958C2: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958C2 + b _081958FC + .align 2, 0 +_081958D4: .4byte 0x000003ff +_081958D8: .4byte 0x03005d90 +_081958DC: + ldr r0, _08195908 + cmp r5, r0 + bhi _081958FC + ldr r0, _0819590C + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_081958EE: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958EE +_081958FC: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08195902: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08195908: .4byte 0x0000012b +_0819590C: .4byte 0x0203bc88 + thumb_func_end sub_8195898 + + thumb_func_start sub_8195910 +sub_8195910: @ 8195910 + ldr r0, _0819591C + ldr r1, _08195920 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0819591C: .4byte 0x08310030 +_08195920: .4byte 0x00007df3 + thumb_func_end sub_8195910 + + thumb_func_start sub_8195924 +sub_8195924: @ 8195924 + ldr r0, _08195930 + ldr r1, _08195934 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08195930: .4byte 0x08310030 +_08195934: .4byte 0x00007df1 + thumb_func_end sub_8195924 + + thumb_func_start sub_8195938 +sub_8195938: @ 8195938 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r4, _0819595C +_08195940: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _08195940 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819595C: .4byte 0x08317e24 + thumb_func_end sub_8195938 + + thumb_func_start sub_8195960 +sub_8195960: @ 8195960 + push {lr} + ldr r1, _08195978 + ldr r0, _0819597C + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_08195978: .4byte 0x0860de50 +_0819597C: .4byte 0x020375e0 + thumb_func_end sub_8195960 + + thumb_func_start sub_8195980 +sub_8195980: @ 8195980 + push {r4-r7,lr} + ldr r4, _08195A14 + ldr r0, [r4] + ldr r1, _08195A18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _08195A1C + bl var_get + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, _08195A20 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, _08195A18 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, _08195A18 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, _08195A24 + adds r3, r4, r0 + ldr r2, _08195A28 + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _081959F2 + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, _08195A2C + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_081959F2: + ldr r0, _08195A30 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, _08195A34 + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08195A14: .4byte 0x03005d90 +_08195A18: .4byte 0x00000ca9 +_08195A1C: .4byte 0x000040ce +_08195A20: .4byte 0x00000ca8 +_08195A24: .4byte 0x00000cdc +_08195A28: .4byte 0x0860de98 +_08195A2C: .4byte 0x00000dc8 +_08195A30: .4byte 0x03005d8c +_08195A34: .4byte 0x02038bca + thumb_func_end sub_8195980 + + thumb_func_start sub_8195A38 +sub_8195A38: @ 8195A38 + push {r4-r7,lr} + ldr r5, _08195A64 + ldr r0, [r5] + ldr r1, _08195A68 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, _08195A6C + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _08195A70 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195A90 + cmp r0, 0x1 + bgt _08195A74 + cmp r0, 0 + beq _08195A7A + b _08195AD0 + .align 2, 0 +_08195A64: .4byte 0x03005d90 +_08195A68: .4byte 0x00000ca9 +_08195A6C: .4byte 0x000040ce +_08195A70: .4byte 0x020375e2 +_08195A74: + cmp r0, 0x2 + beq _08195AB0 + b _08195AD0 +_08195A7A: + ldr r0, _08195A88 + ldr r1, [r5] + ldr r2, _08195A8C + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0] + b _08195AD0 + .align 2, 0 +_08195A88: .4byte 0x020375f0 +_08195A8C: .4byte 0x00000dc6 +_08195A90: + ldr r3, _08195AA8 + ldr r0, [r5] + lsls r1, r7, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, _08195AAC + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _08195AD0 + .align 2, 0 +_08195AA8: .4byte 0x020375f0 +_08195AAC: .4byte 0x00000dc8 +_08195AB0: + ldr r4, _08195AD8 + ldr r2, [r5] + ldr r0, _08195ADC + adds r2, r0 + ldr r3, _08195AE0 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] +_08195AD0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08195AD8: .4byte 0x020375f0 +_08195ADC: .4byte 0x00000cdc +_08195AE0: .4byte 0x0860de98 + thumb_func_end sub_8195A38 + + thumb_func_start sub_8195AE4 +sub_8195AE4: @ 8195AE4 + push {r4-r6,lr} + ldr r6, _08195B10 + ldr r0, [r6] + ldr r1, _08195B14 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _08195B18 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _08195B1C + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195B3C + cmp r0, 0x1 + bgt _08195B20 + cmp r0, 0 + beq _08195B26 + b _08195BA0 + .align 2, 0 +_08195B10: .4byte 0x03005d90 +_08195B14: .4byte 0x00000ca9 +_08195B18: .4byte 0x000040ce +_08195B1C: .4byte 0x020375e2 +_08195B20: + cmp r0, 0x2 + beq _08195B5C + b _08195BA0 +_08195B26: + ldr r0, [r6] + ldr r1, _08195B34 + ldrh r1, [r1] + ldr r2, _08195B38 + adds r0, r2 + strh r1, [r0] + b _08195BA0 + .align 2, 0 +_08195B34: .4byte 0x020375e4 +_08195B38: .4byte 0x00000dc6 +_08195B3C: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, _08195B54 + adds r2, r1 + adds r2, r0 + ldr r0, _08195B58 + ldrh r0, [r0] + strh r0, [r2] + b _08195BA0 + .align 2, 0 +_08195B54: .4byte 0x00000dc8 +_08195B58: .4byte 0x020375e4 +_08195B5C: + ldr r0, _08195B7C + ldrh r0, [r0] + cmp r0, 0 + beq _08195B88 + ldr r2, [r6] + ldr r0, _08195B80 + adds r2, r0 + ldr r3, _08195B84 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + b _08195B9E + .align 2, 0 +_08195B7C: .4byte 0x020375e4 +_08195B80: .4byte 0x00000cdc +_08195B84: .4byte 0x0860de98 +_08195B88: + ldr r2, [r6] + ldr r1, _08195BA8 + adds r2, r1 + ldr r3, _08195BAC + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 +_08195B9E: + str r0, [r2] +_08195BA0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08195BA8: .4byte 0x00000cdc +_08195BAC: .4byte 0x0860dea8 + thumb_func_end sub_8195AE4 + + thumb_func_start sub_8195BB0 +sub_8195BB0: @ 8195BB0 + push {r4,lr} + ldr r0, _08195BEC + bl var_get + lsls r0, 16 + ldr r1, _08195BF0 + ldr r2, [r1] + ldr r3, _08195BF4 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, _08195BF8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x31 + bhi _08195C00 + ldr r4, _08195BFC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + strh r0, [r4] + b _08195C16 + .align 2, 0 +_08195BEC: .4byte 0x000040ce +_08195BF0: .4byte 0x03005d90 +_08195BF4: .4byte 0x00000ca9 +_08195BF8: .4byte 0x00000dc8 +_08195BFC: .4byte 0x020375f0 +_08195C00: + cmp r0, 0x62 + bhi _08195C10 + ldr r1, _08195C0C + movs r0, 0x3 + b _08195C14 + .align 2, 0 +_08195C0C: .4byte 0x020375f0 +_08195C10: + ldr r1, _08195C1C + movs r0, 0x4 +_08195C14: + strh r0, [r1] +_08195C16: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08195C1C: .4byte 0x020375f0 + thumb_func_end sub_8195BB0 + + thumb_func_start sub_8195C20 +sub_8195C20: @ 8195C20 + push {r4,lr} + ldr r4, _08195C4C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08195C4C: .4byte 0x02038bca + thumb_func_end sub_8195C20 + + thumb_func_start sub_8195C50 +sub_8195C50: @ 8195C50 + push {lr} + ldr r3, _08195C70 + ldrh r1, [r3] + ldr r0, _08195C74 + cmp r1, r0 + bhi _08195C6C + ldr r2, _08195C78 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC +_08195C6C: + pop {r0} + bx r0 + .align 2, 0 +_08195C70: .4byte 0x02038bca +_08195C74: .4byte 0x0000012b +_08195C78: .4byte 0x0203bc88 + thumb_func_end sub_8195C50 + + thumb_func_start sub_8195C7C +sub_8195C7C: @ 8195C7C + push {r4-r7,lr} + ldr r4, _08195CD0 + ldr r0, [r4] + ldr r1, _08195CD4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, _08195CD8 + bl var_get + lsls r0, 24 + ldr r4, [r4] + lsls r1, r7, 1 + lsrs r5, r0, 22 + adds r1, r5 + ldr r3, _08195CDC + adds r6, r4, r3 + adds r3, r6, r1 + ldrh r2, [r3] + ldr r0, _08195CE0 + cmp r2, r0 + bhi _08195CCA + adds r2, 0x1 + strh r2, [r3] + movs r3, 0xDD + lsls r3, 4 + adds r0, r4, r3 + adds r1, r0, r1 + adds r0, r5, 0 + ldrh r3, [r1] + cmp r7, r3 + bls _08195CC0 + adds r0, 0x2 +_08195CC0: + adds r0, r6, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _08195CCA + strh r2, [r1] +_08195CCA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08195CD0: .4byte 0x03005d90 +_08195CD4: .4byte 0x00000ca9 +_08195CD8: .4byte 0x000040ce +_08195CDC: .4byte 0x00000dc8 +_08195CE0: .4byte 0x0000270e + thumb_func_end sub_8195C7C + + thumb_func_start sub_8195CE4 +sub_8195CE4: @ 8195CE4 + push {r4,lr} + ldr r4, _08195D18 + ldr r0, [r4] + ldr r1, _08195D1C + ldrh r1, [r1] + ldr r2, _08195D20 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _08195D24 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08195D18: .4byte 0x03005d90 +_08195D1C: .4byte 0x020375e2 +_08195D20: .4byte 0x00000ca8 +_08195D24: .4byte 0x00000ca9 + thumb_func_end sub_8195CE4 + + thumb_func_start sub_8195D28 +sub_8195D28: @ 8195D28 + push {r4,r5,lr} + ldr r0, _08195D70 + bl var_get + lsls r0, 16 + ldr r4, _08195D74 + ldr r2, [r4] + ldr r3, _08195D78 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, _08195D7C + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x29 + bls _08195D88 + bl GenerateRandomNumber + ldr r4, [r4] + ldr r5, _08195D80 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, _08195D84 + adds r4, r1 + b _08195DA6 + .align 2, 0 +_08195D70: .4byte 0x000040ce +_08195D74: .4byte 0x03005d90 +_08195D78: .4byte 0x00000ca9 +_08195D7C: .4byte 0x00000dc8 +_08195D80: .4byte 0x0860de84 +_08195D84: .4byte 0x00000dc6 +_08195D88: + bl GenerateRandomNumber + ldr r4, [r4] + ldr r5, _08195DB0 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r3, _08195DB4 + adds r4, r3 +_08195DA6: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08195DB0: .4byte 0x0860de78 +_08195DB4: .4byte 0x00000dc6 + thumb_func_end sub_8195D28 + + thumb_func_start sub_8195DB8 +sub_8195DB8: @ 8195DB8 + push {r4,r5,lr} + ldr r4, _08195DF0 + ldr r0, [r4] + ldr r1, _08195DF4 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08195E00 + ldr r0, [r4] + ldr r1, _08195DF4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _08195DF8 + bl itemid_get_name + ldr r0, [r4] + ldr r1, _08195DF4 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, _08195DFC + strh r5, [r0] + b _08195E06 + .align 2, 0 +_08195DF0: .4byte 0x03005d90 +_08195DF4: .4byte 0x00000dc6 +_08195DF8: .4byte 0x02021cc4 +_08195DFC: .4byte 0x020375f0 +_08195E00: + ldr r1, _08195E0C + movs r0, 0 + strh r0, [r1] +_08195E06: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08195E0C: .4byte 0x020375f0 + thumb_func_end sub_8195DB8 + + thumb_func_start sub_8195E10 +sub_8195E10: @ 8195E10 + push {lr} + bl sub_802F588 + ldr r0, _08195E2C + bl sub_8195E34 + ldr r1, _08195E30 + adds r0, 0xA + str r0, [r1] + movs r0, 0 + strb r0, [r1, 0x6] + pop {r0} + bx r0 + .align 2, 0 +_08195E2C: .4byte 0x03005cf8 +_08195E30: .4byte 0x0203cd80 + thumb_func_end sub_8195E10 + + thumb_func_start sub_8195E34 +sub_8195E34: @ 8195E34 + adds r3, r0, 0 + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + movs r2, 0x2 + ldrsb r2, [r3, r2] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + ldrsb r1, [r3, r1] + adds r0, r1 + bx lr + thumb_func_end sub_8195E34 + + thumb_func_start sub_8195E58 +sub_8195E58: @ 8195E58 + push {lr} + bl sub_802F588 + ldr r0, _08195E7C + bl sub_8195E34 + adds r1, r0, 0 + ldr r2, _08195E80 + ldr r0, [r2] + cmp r0, r1 + bhi _08195E74 + subs r0, r1, r0 + cmp r0, 0x9 + bls _08195E84 +_08195E74: + str r1, [r2] + movs r0, 0x1 + b _08195E86 + .align 2, 0 +_08195E7C: .4byte 0x03005cf8 +_08195E80: .4byte 0x0203cd80 +_08195E84: + movs r0, 0 +_08195E86: + pop {r1} + bx r1 + thumb_func_end sub_8195E58 + + thumb_func_start sub_8195E8C +sub_8195E8C: @ 8195E8C + push {r4,r5,lr} + movs r5, 0x1 + ldr r4, _08195ECC + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _08195EAE + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bne _08195EAE + movs r5, 0x2 +_08195EAE: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r5, 1 + adds r1, r5 + cmp r0, r1 + blt _08195ED0 + movs r0, 0 + b _08195ED2 + .align 2, 0 +_08195ECC: .4byte 0x020244ec +_08195ED0: + movs r0, 0x1 +_08195ED2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195E8C + + thumb_func_start sub_8195ED8 +sub_8195ED8: @ 8195ED8 + push {r4,lr} + ldr r4, _08195F34 + ldrb r0, [r4, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + cmp r0, 0 + beq _08195F30 + ldrb r0, [r4, 0x14] + cmp r0, 0x39 + beq _08195F30 + cmp r0, 0xE + bne _08195F0E + movs r0, 0xF9 + lsls r0, 2 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F0E + movs r0, 0xDC + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08195F30 +_08195F0E: + ldr r0, _08195F34 + ldrb r0, [r0, 0x14] + cmp r0, 0x38 + bne _08195F38 + movs r0, 0xCF + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F38 + movs r0, 0x8B + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08195F38 +_08195F30: + movs r0, 0 + b _08195F3A + .align 2, 0 +_08195F34: .4byte 0x02037318 +_08195F38: + movs r0, 0x1 +_08195F3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195ED8 + + thumb_func_start sub_8195F40 +sub_8195F40: @ 8195F40 + push {lr} + ldr r1, _08195F58 + ldrb r0, [r1, 0x6] + adds r0, 0x1 + strb r0, [r1, 0x6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _08195F5C + movs r0, 0 + b _08195F62 + .align 2, 0 +_08195F58: .4byte 0x0203cd80 +_08195F5C: + movs r0, 0 + strb r0, [r1, 0x6] + movs r0, 0x1 +_08195F62: + pop {r1} + bx r1 + thumb_func_end sub_8195F40 + + thumb_func_start sub_8195F68 +sub_8195F68: @ 8195F68 + push {r4,lr} + bl sub_8195FCC + adds r4, r0, 0 + cmp r4, 0 + beq _08195FB8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + bl sub_8195FF8 + ldr r2, _08195FBC + movs r1, 0 + strh r0, [r2, 0x4] + strb r1, [r2, 0x7] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4E + beq _08195FB8 + ldrh r0, [r2, 0x4] + bl sub_8196844 + adds r4, r0, 0 + bl sub_819672C + ldr r1, _08195FC0 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _08195FC4 + adds r0, r4, 0 + bl sub_8196710 + cmp r0, 0 + bne _08195FC4 +_08195FB8: + movs r0, 0 + b _08195FC6 + .align 2, 0 +_08195FBC: .4byte 0x0203cd80 +_08195FC0: .4byte 0x02037318 +_08195FC4: + movs r0, 0x1 +_08195FC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195F68 + + thumb_func_start sub_8195FCC +sub_8195FCC: @ 8195FCC + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_08195FD2: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08195FE8 + adds r5, 0x1 +_08195FE8: + adds r4, 0x1 + cmp r4, 0x3F + bls _08195FD2 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195FCC + + thumb_func_start sub_8195FF8 +sub_8195FF8: @ 8195FF8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, _0819601C +_08196000: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08196022 + cmp r5, 0 + bne _08196020 + ldrh r0, [r6] + b _0819602C + .align 2, 0 +_0819601C: .4byte 0x085500a4 +_08196020: + subs r5, 0x1 +_08196022: + adds r6, 0x10 + adds r4, 0x1 + cmp r4, 0x3F + bls _08196000 + movs r0, 0x4E +_0819602C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8195FF8 + + thumb_func_start sub_8196034 +sub_8196034: @ 8196034 + push {lr} + ldr r0, _08196074 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _08196078 + bl sub_8195F40 + cmp r0, 0 + beq _08196078 + bl sub_8195E58 + cmp r0, 0 + beq _08196078 + bl sub_8195E8C + cmp r0, 0 + beq _08196078 + bl sub_8195ED8 + cmp r0, 0 + beq _08196078 + bl sub_8195F68 + cmp r0, 0 + beq _08196078 + bl task_prev_quest + movs r0, 0x1 + b _0819607A + .align 2, 0 +_08196074: .4byte 0x0000012f +_08196078: + movs r0, 0 +_0819607A: + pop {r1} + bx r1 + thumb_func_end sub_8196034 + + thumb_func_start sub_8196080 +sub_8196080: @ 8196080 + push {lr} + ldr r1, _08196090 + movs r0, 0x1 + strb r0, [r1, 0x7] + bl task_prev_quest + pop {r0} + bx r0 + .align 2, 0 +_08196090: .4byte 0x0203cd80 + thumb_func_end sub_8196080 + + thumb_func_start sub_8196094 +sub_8196094: @ 8196094 + push {lr} + ldr r0, _081960A4 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081960A4: .4byte sub_81960E0 + 1 + thumb_func_end sub_8196094 + + thumb_func_start task_prev_quest +task_prev_quest: @ 81960A8 + push {lr} + ldr r0, _081960D4 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _081960C2 + bl script_env_2_enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 +_081960C2: + ldr r0, _081960D8 + bl audio_play + ldr r0, _081960DC + movs r1, 0x1 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081960D4: .4byte 0x0203cd80 +_081960D8: .4byte 0x00000107 +_081960DC: .4byte sub_81960E0 + 1 + thumb_func_end task_prev_quest + + thumb_func_start sub_81960E0 +sub_81960E0: @ 81960E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _08196124 + adds r4, r0, r1 + ldr r1, _08196128 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + cmp r0, 0 + beq _0819611E + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r1, 0 + strh r1, [r4, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bls _0819611E + adds r0, r5, 0 + bl remove_task +_0819611E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08196124: .4byte 0x03005e08 +_08196128: .4byte 0x0860ef78 + thumb_func_end sub_81960E0 + + thumb_func_start sub_819612C +sub_819612C: @ 819612C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _08196154 + adds r5, r0, r1 + ldr r0, _08196158 + bl Window_AddFromTemplate + strh r0, [r5, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + bne _0819615C + adds r0, r4, 0 + b _081961E0 + .align 2, 0 +_08196154: .4byte 0x03005e08 +_08196158: .4byte 0x0860ef98 +_0819615C: + ldr r1, _08196180 + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x9C + lsls r3, 2 + movs r0, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + lsls r0, 16 + ldr r1, _08196184 + cmp r0, r1 + bne _08196188 + ldrb r0, [r5, 0x4] + bl Window_Remove + adds r0, r4, 0 + b _081961E0 + .align 2, 0 +_08196180: .4byte 0x0860ea6c +_08196184: .4byte 0xffff0000 +_08196188: + ldr r1, _081961C4 + ldr r3, _081961C8 + movs r0, 0 + str r0, [sp] + movs r2, 0 + bl decompress_and_copy_tile_data_to_vram + cmp r0, 0 + beq _081961D8 + ldrb r0, [r5, 0x4] + movs r1, 0x88 + bl Window_FastFillPixels + ldr r0, _081961CC + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _081961D0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, _081961D4 + movs r0, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + b _081961E6 + .align 2, 0 +_081961C4: .4byte 0x0860eb8c +_081961C8: .4byte 0x00000279 +_081961CC: .4byte 0x0860ea4c +_081961D0: .4byte 0x0860eb6c +_081961D4: .4byte 0xffffe000 +_081961D8: + ldrb r0, [r5, 0x4] + bl Window_Remove + adds r0, r6, 0 +_081961E0: + bl remove_task + movs r0, 0 +_081961E6: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819612C + + thumb_func_start sub_81961F0 +sub_81961F0: @ 81961F0 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0819625C + adds r4, r1, r0 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _08196268 + ldrb r0, [r4, 0x4] + bl Window_WriteStandardTileMap + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r1, 0x9C + lsls r1, 2 + movs r2, 0xE + bl sub_819645C + ldr r1, _08196260 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl bg_write_sequence_to_wram_tile_map_rect + ldr r0, _08196264 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + b _0819626A + .align 2, 0 +_0819625C: .4byte 0x03005e08 +_08196260: .4byte 0x0000f279 +_08196264: .4byte sub_8196694 + 1 +_08196268: + movs r0, 0 +_0819626A: + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81961F0 + + thumb_func_start sub_8196274 +sub_8196274: @ 8196274 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08196294 + adds r4, r1, r0 + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + beq _08196298 + movs r0, 0 + b _081962A4 + .align 2, 0 +_08196294: .4byte 0x03005e08 +_08196298: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, _081962AC + bl sub_81965D8 + movs r0, 0x1 +_081962A4: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081962AC: .4byte 0x0860ef70 + thumb_func_end sub_8196274 + + thumb_func_start sub_81962B0 +sub_81962B0: @ 81962B0 + push {lr} + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x1 + bl bg_change_y_offset + cmp r0, 0 + bge _081962C6 + movs r0, 0 + b _081962D2 +_081962C6: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 +_081962D2: + pop {r1} + bx r1 + thumb_func_end sub_81962B0 + + thumb_func_start sub_81962D8 +sub_81962D8: @ 81962D8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _0819631C + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196328 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl Window_FastFillPixels + ldr r1, _08196320 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0819630C + ldrh r0, [r1, 0x4] + ldr r1, _08196324 + bl sub_81967AC +_0819630C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, _08196324 + bl sub_81965D8 + movs r0, 0x1 + b _0819632A + .align 2, 0 +_0819631C: .4byte 0x03005e08 +_08196320: .4byte 0x0203cd80 +_08196324: .4byte 0x02021fc4 +_08196328: + movs r0, 0 +_0819632A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81962D8 + + thumb_func_start sub_8196330 +sub_8196330: @ 8196330 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08196380 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196388 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _08196388 + ldr r0, _08196384 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08196388 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl Window_FastFillPixels + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x84 + lsls r0, 1 + bl audio_play + movs r0, 0x1 + b _0819638A + .align 2, 0 +_08196380: .4byte 0x03005e08 +_08196384: .4byte 0x030022c0 +_08196388: + movs r0, 0 +_0819638A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196330 + + thumb_func_start sub_8196390 +sub_8196390: @ 8196390 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081963B8 + adds r4, r1, r0 + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x2 + bl bg_change_y_offset + ldr r1, _081963BC + cmp r0, r1 + ble _081963C0 + movs r0, 0 + b _081963E8 + .align 2, 0 +_081963B8: .4byte 0x03005e08 +_081963BC: .4byte 0xffffe000 +_081963C0: + movs r0, 0x1E + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xE + bl bg_fill_tilemap_rect + ldrb r0, [r4, 0xA] + bl remove_task + ldrb r0, [r4, 0x4] + bl Window_Remove + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 +_081963E8: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196390 + + thumb_func_start sub_81963F0 +sub_81963F0: @ 81963F0 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08196454 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _08196454 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _0819644C + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _08196446 + bl sub_81973A4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _08196450 + adds r0, r1 + bl sub_8093284 + bl sub_80D338C + bl sub_809757C + bl script_env_2_disable +_08196446: + movs r0, 0x1 + b _08196456 + .align 2, 0 +_0819644C: .4byte 0x0203cd80 +_08196450: .4byte 0x02037350 +_08196454: + movs r0, 0 +_08196456: + pop {r1} + bx r1 + thumb_func_end sub_81963F0 + + thumb_func_start sub_819645C +sub_819645C: @ 819645C + 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 + adds r7, r2, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl Window_GetField + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl Window_GetField + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x2 + bl Window_GetField + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x3 + bl Window_GetField + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x4 + bl Window_GetField + str r0, [sp, 0x10] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r1, 0xA + bl bg_get_field + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 + lsls r7, 12 + movs r1, 0xF0 + lsls r1, 8 + adds r0, r1, 0 + ands r7, r0 + adds r1, r7, 0 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x8] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldr r4, [sp, 0xC] + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + movs r3, 0x1 + mov r8, r3 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r3, r4, 0 + bl bg_fill_tilemap_rect + adds r1, r5, 0x1 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x8] + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl bg_fill_tilemap_rect + adds r1, r5, 0x2 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0x8] + adds r0, r3, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + mov r0, r8 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl bg_fill_tilemap_rect + adds r1, r5, 0x3 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0xC] + lsls r6, r2, 24 + lsrs r6, 24 + mov r3, r8 + str r3, [sp] + ldr r0, [sp, 0x10] + lsls r4, r0, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r6, 0 + bl bg_fill_tilemap_rect + adds r1, r5, 0x4 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + mov r2, r8 + str r2, [sp] + str r4, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r6, 0 + bl bg_fill_tilemap_rect + adds r1, r5, 0x5 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + lsrs r4, r0, 24 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl bg_fill_tilemap_rect + adds r1, r5, 0x6 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl bg_fill_tilemap_rect + adds r5, 0x7 + orrs r5, r7 + lsls r5, 16 + lsrs r5, 16 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl bg_fill_tilemap_rect + 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_819645C + + thumb_func_start sub_81965D8 +sub_81965D8: @ 81965D8 + push {lr} + sub sp, 0x10 + str r1, [sp] + mov r1, sp + movs r3, 0 + strb r0, [r1, 0x4] + mov r0, sp + movs r1, 0x1 + strb r1, [r0, 0x5] + movs r2, 0x20 + strb r2, [r0, 0x6] + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r3, 0xF + movs r0, 0xA0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r2, 0xD] + ands r1, r3 + movs r0, 0xE0 + orrs r1, r0 + strb r1, [r2, 0xD] + ldr r2, _08196644 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl remo_copy + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08196644: .4byte 0x03003014 + thumb_func_end sub_81965D8 + + thumb_func_start sub_8196648 +sub_8196648: @ 8196648 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _08196664 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819666C + ldr r0, _08196668 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08196678 + .align 2, 0 +_08196664: .4byte 0x030022c0 +_08196668: .4byte 0x03003014 +_0819666C: + ldr r2, _08196690 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08196678: + bl run_remoboxes + lsls r0, r4, 24 + lsrs r0, 24 + bl a_pressed_maybe + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08196690: .4byte 0x03003014 + thumb_func_end sub_8196648 + + thumb_func_start sub_8196694 +sub_8196694: @ 8196694 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _08196704 + adds r2, r1, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081966FC + movs r1, 0 + strh r1, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _081966C8 + strh r1, [r2, 0x2] +_081966C8: + movs r0, 0x2 + ldrsh r1, [r2, r0] + lsls r1, 4 + ldr r0, _08196708 + adds r1, r0 + strh r1, [r2, 0x4] + ldr r2, _0819670C + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl bg_write_sequence_to_wram_tile_map_rect + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_081966FC: + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08196704: .4byte 0x03005e08 +_08196708: .4byte 0x00000279 +_0819670C: .4byte 0xfffff000 + thumb_func_end sub_8196694 + + thumb_func_start sub_8196710 +sub_8196710: @ 8196710 + ldr r1, _08196724 + ldr r1, [r1] + ldr r2, _08196728 + adds r1, r2 + adds r1, r0 + ldrb r1, [r1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_08196724: .4byte 0x03005d8c +_08196728: .4byte 0x000009ca + thumb_func_end sub_8196710 + + thumb_func_start sub_819672C +sub_819672C: @ 819672C + push {lr} + ldr r1, _08196744 + 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 + .align 2, 0 +_08196744: .4byte 0x085500a4 + thumb_func_end sub_819672C + + thumb_func_start sub_8196748 +sub_8196748: @ 8196748 + push {r4-r6,lr} + movs r5, 0 + movs r6, 0 + ldr r4, _08196770 +_08196750: + ldrh r0, [r4] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819675E + adds r6, 0x1 +_0819675E: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x3F + bls _08196750 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08196770: .4byte 0x085500a4 + thumb_func_end sub_8196748 + + thumb_func_start sub_8196774 +sub_8196774: @ 8196774 + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0 + ldr r5, _08196794 +_0819677E: + ldrh r0, [r5] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819679A + cmp r6, r7 + bne _08196798 + adds r0, r4, 0 + b _081967A4 + .align 2, 0 +_08196794: .4byte 0x085500a4 +_08196798: + adds r6, 0x1 +_0819679A: + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x4D + bls _0819677E + movs r0, 0x4E +_081967A4: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196774 + + thumb_func_start sub_81967AC +sub_81967AC: @ 81967AC + push {r4-r7,lr} + adds r6, r1, 0 + movs r7, 0 + bl sub_8196844 + adds r5, r0, 0 + ldr r0, _081967E4 + strh r7, [r0] + adds r0, r5, 0 + bl sub_8196710 + cmp r0, 0 + beq _081967EC + adds r0, r5, 0 + bl sub_819672C + ldr r1, _081967E8 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081967EC + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196864 + b _08196830 + .align 2, 0 +_081967E4: .4byte 0x0203cd88 +_081967E8: .4byte 0x02037318 +_081967EC: + adds r0, r5, 0 + bl sub_8196D74 + cmp r0, 0 + beq _0819680A + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196890 + adds r4, r0, 0 + movs r7, 0x1 + adds r0, r5, 0 + bl sub_80B1E94 + b _08196832 +_0819680A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08196828 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81968BC + b _08196830 +_08196828: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196910 +_08196830: + adds r4, r0, 0 +_08196832: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81969E0 + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81967AC + + thumb_func_start sub_8196844 +sub_8196844: @ 8196844 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, _08196858 +_0819684C: + ldrh r0, [r1] + cmp r0, r3 + beq _0819685C + adds r1, 0x14 + adds r2, 0x1 + b _0819684C + .align 2, 0 +_08196858: .4byte 0x0860deb8 +_0819685C: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8196844 + + thumb_func_start sub_8196864 +sub_8196864: @ 8196864 + ldr r2, _08196888 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0xE] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, _0819688C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .align 2, 0 +_08196888: .4byte 0x0860deb8 +_0819688C: .4byte 0x0860ea2c + thumb_func_end sub_8196864 + + thumb_func_start sub_8196890 +sub_8196890: @ 8196890 + ldr r2, _081968B4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x10] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, _081968B8 + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .align 2, 0 +_081968B4: .4byte 0x0860deb8 +_081968B8: .4byte 0x0860ea2c + thumb_func_end sub_8196890 + + thumb_func_start sub_81968BC +sub_81968BC: @ 81968BC + push {r4,lr} + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + ldr r2, _08196908 + lsrs r0, 15 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r0, r1 + adds r2, 0x4 + adds r0, r2 + ldrh r4, [r0] + cmp r4, 0 + bne _081968EC + movs r0, 0 + bl nullsub_12 +_081968EC: + movs r1, 0xFF + lsrs r0, r4, 8 + subs r0, 0x1 + ands r4, r1 + subs r1, r4, 0x1 + ldr r2, _0819690C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08196908: .4byte 0x0860deb8 +_0819690C: .4byte 0x0860ea20 + thumb_func_end sub_81968BC + + thumb_func_start sub_8196910 +sub_8196910: @ 8196910 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081969AC + movs r5, 0 + movs r4, 0 + lsls r7, r6, 2 +_0819692C: + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196940 + adds r5, 0x1 +_08196940: + adds r4, 0x1 + cmp r4, 0x6 + ble _0819692C + cmp r5, 0 + beq _081969AC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + adds r5, r0, 0 + movs r4, 0 + b _08196962 +_0819695E: + subs r5, 0x1 +_08196960: + adds r4, 0x1 +_08196962: + cmp r4, 0x6 + bgt _08196980 + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + ldr r1, _081969A0 + strh r0, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196960 + cmp r5, 0 + bne _0819695E +_08196980: + ldr r0, _081969A0 + strh r4, [r0] + ldr r1, _081969A4 + adds r0, r7, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xC] + subs r2, r0, 0x1 + ldr r1, _081969A8 + ldr r0, [sp] + lsls r0, 2 + adds r0, r1 + lsls r1, r2, 3 + ldr r0, [r0] + adds r0, r1 + b _081969D0 + .align 2, 0 +_081969A0: .4byte 0x0203cd88 +_081969A4: .4byte 0x0860deb8 +_081969A8: .4byte 0x0860ea34 +_081969AC: + ldr r1, _081969D8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r2, [r0, 0xA] + lsrs r1, r2, 8 + subs r1, 0x1 + str r1, [sp] + movs r0, 0xFF + ands r0, r2 + subs r2, r0, 0x1 + ldr r0, _081969DC + lsls r1, 2 + adds r1, r0 + lsls r2, 3 + ldr r0, [r1] + adds r0, r2 +_081969D0: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081969D8: .4byte 0x0860deb8 +_081969DC: .4byte 0x0860ea34 + thumb_func_end sub_8196910 + + thumb_func_start sub_81969E0 +sub_81969E0: @ 81969E0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r1, r4, 0x4 + bl sub_81969FC + ldr r1, [r4] + adds r0, r5, 0 + bl ExpandTextCodes + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81969E0 + + thumb_func_start sub_81969FC +sub_81969FC: @ 81969FC + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + movs r4, 0 + ldr r5, _08196A28 +_08196A06: + adds r1, r6, r4 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + blt _08196A1A + adds r1, r0, 0 + ldr r2, [r5] + adds r0, r7, 0 + bl sub_8196A2C +_08196A1A: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x2 + ble _08196A06 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08196A28: .4byte 0x0860efa0 + thumb_func_end sub_81969FC + + thumb_func_start sub_8196A2C +sub_8196A2C: @ 8196A2C + push {lr} + ldr r3, _08196A40 + lsls r1, 2 + adds r1, r3 + ldr r3, [r1] + adds r1, r2, 0 + bl _call_via_r3 + pop {r0} + bx r0 + .align 2, 0 +_08196A40: .4byte 0x0860efac + thumb_func_end sub_8196A2C + + thumb_func_start sub_8196A44 +sub_8196A44: @ 8196A44 + push {r4-r6,lr} + adds r5, r1, 0 + ldr r2, _08196A70 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r4, [r1] + movs r2, 0 + ldr r3, _08196A74 + adds r6, r3, 0 +_08196A5A: + lsls r1, r2, 3 + ldrh r0, [r3] + cmp r0, r4 + bne _08196A78 + adds r0, r6, 0x4 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r5, 0 + bl gf_strcpy + b _08196A90 + .align 2, 0 +_08196A70: .4byte 0x0860deb8 +_08196A74: .4byte 0x0860efc4 +_08196A78: + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x5 + bls _08196A5A + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + ldr r0, _08196A98 + adds r1, r0 + adds r0, r5, 0 + bl gf_strcpy +_08196A90: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08196A98: .4byte 0x08310034 + thumb_func_end sub_8196A44 + + thumb_func_start sub_8196A9C +sub_8196A9C: @ 8196A9C + push {r4,lr} + adds r4, r1, 0 + bl sub_819672C + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl GetMapName + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8196A9C + + thumb_func_start sub_8196AB8 +sub_8196AB8: @ 8196AB8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x13 + bgt _08196AD4 + movs r0, 0 + b _08196B4A +_08196AD4: + adds r0, r1, 0 + subs r0, 0x14 + cmp r0, 0x13 + bhi _08196AE0 + movs r0, 0x1 + b _08196B4A +_08196AE0: + adds r0, r1, 0 + subs r0, 0x28 + cmp r0, 0x9 + bhi _08196AEC + movs r0, 0x2 + b _08196B4A +_08196AEC: + adds r0, r1, 0 + subs r0, 0x32 + cmp r0, 0x9 + bhi _08196AF8 + movs r0, 0x3 + b _08196B4A +_08196AF8: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x9 + bhi _08196B04 + movs r0, 0x4 + b _08196B4A +_08196B04: + adds r0, r1, 0 + subs r0, 0x46 + cmp r0, 0x9 + bhi _08196B10 + movs r0, 0x5 + b _08196B4A +_08196B10: + adds r0, r1, 0 + subs r0, 0x50 + cmp r0, 0x4 + bhi _08196B1C + movs r0, 0x6 + b _08196B4A +_08196B1C: + adds r0, r1, 0 + subs r0, 0x55 + cmp r0, 0x4 + bhi _08196B28 + movs r0, 0x7 + b _08196B4A +_08196B28: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x3 + bhi _08196B34 + movs r0, 0x8 + b _08196B4A +_08196B34: + adds r0, r1, 0 + subs r0, 0x5E + cmp r0, 0x3 + bhi _08196B40 + movs r0, 0x9 + b _08196B4A +_08196B40: + cmp r1, 0x62 + beq _08196B48 + movs r0, 0xB + b _08196B4A +_08196B48: + movs r0, 0xA +_08196B4A: + pop {r1} + bx r1 + thumb_func_end sub_8196AB8 + + thumb_func_start sub_8196B50 +sub_8196B50: @ 8196B50 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3B + bgt _08196B6C + movs r0, 0 + b _08196B92 +_08196B6C: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x1D + bhi _08196B78 + movs r0, 0x1 + b _08196B92 +_08196B78: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x4 + bhi _08196B84 + movs r0, 0x2 + b _08196B92 +_08196B84: + adds r0, r1, 0 + subs r0, 0x5F + cmp r0, 0x3 + bls _08196B90 + movs r0, 0x4 + b _08196B92 +_08196B90: + movs r0, 0x3 +_08196B92: + pop {r1} + bx r1 + thumb_func_end sub_8196B50 + + thumb_func_start sub_8196B98 +sub_8196B98: @ 8196B98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r2, r0, 0 + mov r8, r1 + movs r3, 0 + ldr r0, _08196C50 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _08196C5C + ldr r1, _08196C54 + lsls r0, r2, 4 + adds r2, r0, r1 + ldrh r4, [r2, 0xA] + adds r1, r7, 0 +_08196BBA: + ldrb r0, [r1] + cmp r0, r4 + bne _08196BC8 + ldrb r0, [r1, 0x1] + ldrh r5, [r2, 0xC] + cmp r0, r5 + beq _08196BD2 +_08196BC8: + adds r1, 0x14 + adds r3, 0x1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08196BBA +_08196BD2: + adds r1, r7, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r5, r0, 2 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08196C5C + movs r6, 0 + adds r0, r1, 0x4 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C02 + bl sub_8196AB8 + lsls r0, 24 + mov r2, sp + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + movs r6, 0x1 +_08196C02: + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C26 + bl sub_8196B50 + lsls r0, 24 + lsls r1, r6, 1 + mov r3, sp + adds r2, r3, r1 + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + adds r6, 0x1 +_08196C26: + cmp r6, 0 + beq _08196C5C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 1 + add r0, sp + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, _08196C58 + adds r1, r0 + mov r0, r8 + bl gf_strcpy + b _08196C62 + .align 2, 0 +_08196C50: .4byte 0x08552d48 +_08196C54: .4byte 0x085500a4 +_08196C58: .4byte 0x083185c8 +_08196C5C: + movs r0, 0xFF + mov r5, r8 + strb r0, [r5] +_08196C62: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8196B98 + + thumb_func_start sub_8196C70 +sub_8196C70: @ 8196C70 + push {r4-r7,lr} + adds r7, r1, 0 + ldr r2, _08196CC8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1] + bl sub_80B2250 + lsls r0, 16 + lsrs r0, 16 + ldr r5, _08196CCC + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r4, r0 + ldr r6, [r0] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r4, r5 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r1, 0x1 + beq _08196CD4 + cmp r1, 0x1 + ble _08196CC2 + cmp r1, 0x2 + beq _08196CD0 + cmp r1, 0x3 + beq _08196CD4 +_08196CC2: + lsls r0, 3 + b _08196CD6 + .align 2, 0 +_08196CC8: .4byte 0x0860deb8 +_08196CCC: .4byte 0x08310030 +_08196CD0: + lsls r0, 3 + b _08196CD6 +_08196CD4: + lsls r0, 4 +_08196CD6: + adds r0, r6 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r1, r0 + ldr r0, _08196CF0 + adds r1, r0 + adds r0, r7, 0 + bl gf_strcpy + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08196CF0: .4byte 0x083185c8 + thumb_func_end sub_8196C70 + + thumb_func_start sub_8196CF4 +sub_8196CF4: @ 8196CF4 + push {lr} + adds r0, r1, 0 + ldr r2, _08196D0C + ldr r1, _08196D10 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_08196D0C: .4byte 0x0860eff4 +_08196D10: .4byte 0x0203cd88 + thumb_func_end sub_8196CF4 + + thumb_func_start sub_8196D14 +sub_8196D14: @ 8196D14 + push {r4-r6,lr} + adds r5, r1, 0 + movs r4, 0 + ldr r0, _08196D48 + ldrh r1, [r0, 0x2] + adds r6, r0, 0 + cmp r1, 0 + beq _08196D34 +_08196D24: + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + adds r1, r0, 0 + adds r4, 0x1 + cmp r1, 0 + bne _08196D24 +_08196D34: + ldrh r1, [r6, 0x2] + lsls r3, r4, 24 + lsrs r3, 24 + adds r0, r5, 0 + movs r2, 0 + bl decimal_int_to_string + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08196D48: .4byte 0x0203cd88 + thumb_func_end sub_8196D14 + + thumb_func_start sub_8196D4C +sub_8196D4C: @ 8196D4C + push {r4,r5,lr} + movs r4, 0 + ldr r5, _08196D54 + b _08196D5C + .align 2, 0 +_08196D54: .4byte 0x0860f010 +_08196D58: + adds r5, 0x2 + adds r4, 0x1 +_08196D5C: + cmp r4, 0x7 + bhi _08196D6C + ldrh r0, [r5] + bl flag_check + lsls r0, 24 + cmp r0, 0 + bne _08196D58 +_08196D6C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8196D4C + + thumb_func_start sub_8196D74 +sub_8196D74: @ 8196D74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + bl sub_8196D4C + cmp r0, 0x4 + ble _08196DF4 + bl sub_802F69C + adds r4, r0, 0 + ldr r0, _08196DE4 + ldr r0, [r0] + adds r0, 0xA + bl sub_80842DC + adds r6, r0, 0 + ldr r0, _08196DE8 + ands r6, r0 + ldr r0, _08196DEC + ldr r0, [r0] + ldr r1, _08196DF0 + adds r0, r1 + ldrh r5, [r0] + bl sub_8196748 + mov r9, r0 + movs r0, 0xD + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + mov r8, r0 + movs r0, 0x9 + bl sub_80847F8 + eors r4, r5 + eors r5, r0 + adds r4, r5 + eors r4, r6 + adds r0, r4, 0 + mov r1, r8 + bl __modsi3 + cmp r0, r9 + bge _08196DF4 + bl sub_8196774 + cmp r0, r7 + bne _08196DF4 + movs r0, 0x1 + b _08196DF6 + .align 2, 0 +_08196DE4: .4byte 0x03005d90 +_08196DE8: .4byte 0x0000ffff +_08196DEC: .4byte 0x03005d8c +_08196DF0: .4byte 0x00002e6a +_08196DF4: + movs r0, 0 +_08196DF6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196D74 + + thumb_func_start sub_8196E04 +sub_8196E04: @ 8196E04 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + cmp r0, 0x6 + bls _08196E14 + b _08196F7E +_08196E14: + lsls r0, 2 + ldr r1, _08196E20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08196E20: .4byte _08196E24 + .align 2, 0 +_08196E24: + .4byte _08196E9C + .4byte _08196E40 + .4byte _08196ED0 + .4byte _08196F38 + .4byte _08196E74 + .4byte _08196F04 + .4byte _08196F60 +_08196E40: + movs r3, 0 + ldr r0, _08196E6C + ldr r0, [r0] + ldr r1, _08196E70 + adds r0, r1 +_08196E4A: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196E52: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196E5A + ldrh r4, [r1] +_08196E5A: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196E52 + cmp r3, 0x1 + ble _08196E4A + movs r0, 0x3 + b _08196F7C + .align 2, 0 +_08196E6C: .4byte 0x03005d90 +_08196E70: .4byte 0x00000d14 +_08196E74: + ldr r0, _08196E94 + ldr r0, [r0] + ldr r1, _08196E98 + adds r0, r1 + movs r3, 0x1 +_08196E7E: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196E86 + ldrh r4, [r0] +_08196E86: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196E7E + movs r0, 0x4 + b _08196F7C + .align 2, 0 +_08196E94: .4byte 0x03005d90 +_08196E98: .4byte 0x00000e08 +_08196E9C: + movs r3, 0 + ldr r0, _08196ECC + ldr r0, [r0] + movs r1, 0xCF + lsls r1, 4 + adds r0, r1 +_08196EA8: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EB0: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EB8 + ldrh r4, [r1] +_08196EB8: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EB0 + movs r2, 0x2 + cmp r3, 0x3 + ble _08196EA8 + str r2, [r5] + b _08196F7E + .align 2, 0 +_08196ECC: .4byte 0x03005d90 +_08196ED0: + movs r3, 0 + ldr r0, _08196F00 + ldr r0, [r0] + movs r1, 0xDD + lsls r1, 4 + adds r0, r1 +_08196EDC: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EE4: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EEC + ldrh r4, [r1] +_08196EEC: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EE4 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196EDC + str r2, [r5] + b _08196F7E + .align 2, 0 +_08196F00: .4byte 0x03005d90 +_08196F04: + movs r3, 0 + ldr r0, _08196F30 + ldr r0, [r0] + ldr r1, _08196F34 + adds r0, r1 +_08196F0E: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196F16: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196F1E + ldrh r4, [r1] +_08196F1E: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196F16 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196F0E + str r2, [r5] + b _08196F7E + .align 2, 0 +_08196F30: .4byte 0x03005d90 +_08196F34: .4byte 0x00000dea +_08196F38: + ldr r0, _08196F58 + ldr r0, [r0] + ldr r1, _08196F5C + adds r0, r1 + movs r3, 0x1 +_08196F42: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F4A + ldrh r4, [r0] +_08196F4A: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F42 + movs r3, 0x2 + str r3, [r5] + b _08196F7E + .align 2, 0 +_08196F58: .4byte 0x03005d90 +_08196F5C: .4byte 0x00000dde +_08196F60: + ldr r0, _08196F88 + ldr r0, [r0] + ldr r1, _08196F8C + adds r0, r1 + movs r3, 0x1 +_08196F6A: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F72 + ldrh r4, [r0] +_08196F72: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F6A + movs r0, 0x5 +_08196F7C: + str r0, [r5] +_08196F7E: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08196F88: .4byte 0x03005d90 +_08196F8C: .4byte 0x00000e1e + thumb_func_end sub_8196E04 + + thumb_func_start sub_8196F90 +sub_8196F90: @ 8196F90 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bhi _08196F9E + movs r0, 0 + b _0819707A +_08196F9E: + cmp r4, 0x13 + bhi _08196FA6 + movs r0, 0x1 + b _0819707A +_08196FA6: + cmp r4, 0x1D + bhi _08196FAE + movs r0, 0x2 + b _0819707A +_08196FAE: + cmp r4, 0x27 + bhi _08196FB6 + movs r0, 0x3 + b _0819707A +_08196FB6: + cmp r4, 0x31 + bhi _08196FBE + movs r0, 0x4 + b _0819707A +_08196FBE: + cmp r4, 0x3B + bhi _08196FC6 + movs r0, 0x5 + b _0819707A +_08196FC6: + cmp r4, 0x45 + bhi _08196FCE + movs r0, 0x6 + b _0819707A +_08196FCE: + cmp r4, 0x4F + bhi _08196FD6 + movs r0, 0x7 + b _0819707A +_08196FD6: + cmp r4, 0x59 + bhi _08196FDE + movs r0, 0x8 + b _0819707A +_08196FDE: + cmp r4, 0x63 + bhi _08196FE6 + movs r0, 0x9 + b _0819707A +_08196FE6: + cmp r4, 0x6D + bhi _08196FEE + movs r0, 0xA + b _0819707A +_08196FEE: + cmp r4, 0x77 + bhi _08196FF6 + movs r0, 0xB + b _0819707A +_08196FF6: + cmp r4, 0x81 + bhi _08196FFE + movs r0, 0xC + b _0819707A +_08196FFE: + cmp r4, 0x8B + bhi _08197006 + movs r0, 0xD + b _0819707A +_08197006: + cmp r4, 0x95 + bhi _0819700E + movs r0, 0xE + b _0819707A +_0819700E: + cmp r4, 0x9F + bhi _08197016 + movs r0, 0xF + b _0819707A +_08197016: + cmp r4, 0xA9 + bhi _0819701E + movs r0, 0x10 + b _0819707A +_0819701E: + cmp r4, 0xB3 + bhi _08197026 + movs r0, 0x11 + b _0819707A +_08197026: + cmp r4, 0xBD + bhi _0819702E + movs r0, 0x12 + b _0819707A +_0819702E: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0xCD + lsls r0, 1 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _08197050 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08197050: + ldr r0, _08197074 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _0819706C + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0819706C: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0x14 + b _0819707A + .align 2, 0 +_08197074: .4byte 0x00000199 +_08197078: + movs r0, 0x13 +_0819707A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196F90 + + thumb_func_start sub_8197080 +sub_8197080: @ 8197080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + movs r0, 0xFA + lsls r0, 2 + bl malloc + adds r7, r0, 0 + cmp r7, 0 + bne _081970A2 + movs r0, 0xFF + mov r1, r8 + strb r0, [r1] + b _0819715C +_081970A2: + movs r0, 0 + bl sub_80C0844 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _0819716C + mov r10, r0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r1, _08197170 + mov r9, r1 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r6, 0 + bl sub_8196F90 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08197174 + adds r0, r7, 0 + bl gf_strcpy + adds r5, r0, 0 + movs r6, 0xFB + strb r6, [r5] + adds r5, 0x1 + ldr r1, _08197178 + adds r0, r5, 0 + bl gf_strcpy + adds r5, r0, 0 + strb r6, [r5] + adds r5, 0x1 + ldr r0, _0819717C + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl gf_strcpy + mov r0, r8 + adds r1, r7, 0 + bl ExpandTextCodes + adds r5, r0, 0 + bl sub_809D42C + cmp r0, 0 + beq _08197156 + strb r6, [r5] + adds r5, 0x1 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl pokedex_count + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r1, _08197180 + adds r0, r5, 0 + bl ExpandTextCodes +_08197156: + adds r0, r7, 0 + bl free +_0819715C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819716C: .4byte 0x02021cc4 +_08197170: .4byte 0x02021dc4 +_08197174: .4byte 0x082a5c9c +_08197178: .4byte 0x082a5d2c +_0819717C: .4byte 0x0860f020 +_08197180: .4byte 0x082a633d + thumb_func_end sub_8197080 + + thumb_func_start sub_8197184 +sub_8197184: @ 8197184 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl Window_GetField + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081971BC + movs r2, 0x80 + lsls r2, 1 + lsls r4, 16 + lsrs r4, 16 + adds r3, r4, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _081971C0 + lsls r5, 20 + lsrs r5, 16 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081971BC: .4byte 0x0860ea6c +_081971C0: .4byte 0x0860ea4c + thumb_func_end sub_8197184 + + thumb_func_start sub_81971C4 +sub_81971C4: @ 81971C4 + push {lr} + bl sub_819645C + pop {r0} + bx r0 + thumb_func_end sub_81971C4 + + thumb_func_start sub_81971D0 +sub_81971D0: @ 81971D0 + push {lr} + ldr r0, _081971E8 + bl Window_InitFromTemplates + ldr r0, _081971EC + movs r1, 0xFF + strb r1, [r0] + ldr r0, _081971F0 + strb r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_081971E8: .4byte 0x0860f098 +_081971EC: .4byte 0x0203cd8c +_081971F0: .4byte 0x0203cd8d + thumb_func_end sub_81971D0 + + thumb_func_start sub_81971F4 +sub_81971F4: @ 81971F4 + push {lr} + bl Window_FreeMemory + pop {r0} + bx r0 + thumb_func_end sub_81971F4 + + thumb_func_start sub_8197200 +sub_8197200: @ 8197200 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + bl TextBox_ResetSomeField + bl sub_81973A4 + pop {r0} + bx r0 + thumb_func_end sub_8197200 + + thumb_func_start sub_8197224 +sub_8197224: @ 8197224 + push {lr} + bl run_remoboxes + movs r0, 0 + bl a_pressed_maybe + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8197224 + + thumb_func_start text_box_related_one +text_box_related_one: @ 8197238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r7, [sp, 0x28] + ldr r4, [sp, 0x2C] + mov r8, r4 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + str r2, [sp] + mov r2, sp + movs r4, 0 + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + strb r4, [r0, 0x6] + movs r1, 0x1 + strb r1, [r0, 0x7] + strb r4, [r0, 0x8] + strb r1, [r0, 0x9] + strb r4, [r0, 0xA] + strb r4, [r0, 0xB] + mov r4, sp + ldrb r2, [r4, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4, 0xC] + mov r0, sp + mov r2, r8 + lsls r2, 4 + movs r4, 0xF + strb r2, [r0, 0xC] + mov r2, sp + ands r5, r4 + ldrb r0, [r2, 0xD] + ands r1, r0 + orrs r1, r5 + strb r1, [r2, 0xD] + mov r0, sp + lsrs r6, 20 + ands r1, r4 + orrs r1, r6 + strb r1, [r0, 0xD] + ldr r2, _081972C0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + adds r1, r3, 0 + adds r2, r7, 0 + bl remo_copy + lsls r0, 16 + lsrs r0, 16 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081972C0: .4byte 0x03003014 + thumb_func_end text_box_related_one + + thumb_func_start get_map_name +get_map_name: @ 81972C4 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + ldr r3, _08197308 + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, _0819730C + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl text_box_related_one + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197308: .4byte 0x03003014 +_0819730C: .4byte 0x02021fc4 + thumb_func_end get_map_name + + thumb_func_start sub_8197310 +sub_8197310: @ 8197310 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08197354 + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, _08197358 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl text_box_related_one + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08197354: .4byte 0x03003014 +_08197358: .4byte 0x02021fc4 + thumb_func_end sub_8197310 + + thumb_func_start sub_819735C +sub_819735C: @ 819735C + push {r4,r5,lr} + sub sp, 0x10 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, _0819739C + movs r5, 0x1 + ands r0, r5 + ldrb r2, [r4] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + ldr r2, _081973A0 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl text_box_related_one + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819739C: .4byte 0x03003014 +_081973A0: .4byte 0x02021fc4 + thumb_func_end sub_819735C + + thumb_func_start sub_81973A4 +sub_81973A4: @ 81973A4 + push {lr} + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r1, 0x85 + lsls r1, 2 + movs r0, 0 + movs r2, 0xE0 + bl sub_809882C + pop {r0} + bx r0 + thumb_func_end sub_81973A4 + + thumb_func_start sub_81973C4 +sub_81973C4: @ 81973C4 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081973F8 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _081973F2 + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_081973F2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081973F8: .4byte sub_81975F4 + 1 + thumb_func_end sub_81973C4 + + thumb_func_start sub_81973FC +sub_81973FC: @ 81973FC + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08197430 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _0819742A + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0819742A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197430: .4byte sub_81974A4 + 1 + thumb_func_end sub_81973FC + + thumb_func_start sub_8197434 +sub_8197434: @ 8197434 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08197468 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_FillTileMap + cmp r4, 0x1 + bne _08197462 + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08197462: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197468: .4byte sub_8197804 + 1 + thumb_func_end sub_8197434 + + thumb_func_start sub_819746C +sub_819746C: @ 819746C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081974A0 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_FillTileMap + cmp r4, 0x1 + bne _0819749A + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0819749A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081974A0: .4byte sub_81977BC + 1 + thumb_func_end sub_819746C + + thumb_func_start sub_81974A4 +sub_81974A4: @ 81974A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r2, 0 + ldr r2, [sp, 0x3C] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + movs r3, 0x85 + lsls r3, 2 + lsrs r0, r1, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r2, r1 + mov r8, r2 + lsrs r2, 24 + lsrs r0, r4, 24 + mov r9, r0 + movs r0, 0xFF + lsls r0, 24 + adds r4, r0 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r1, r3, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081975DC + ldr r2, [sp, 0x10] + str r2, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081975E0 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + mov r10, r0 + lsrs r2, r0, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r5, r9 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r9, r0 + bge _08197578 + mov r3, r8 + str r3, [sp, 0x18] + movs r6, 0x1 + movs r0, 0xE + mov r8, r0 +_0819753E: + lsls r4, r5, 24 + lsrs r4, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r1, _081975E4 + ldr r3, [sp, 0x18] + lsrs r2, r3, 24 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r1, _081975E8 + mov r3, r10 + lsrs r2, r3, 24 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + adds r5, 0x1 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r5, r0 + blt _0819753E +_08197578: + ldr r1, _081975EC + ldr r2, [sp, 0xC] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081975F0 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x87 + lsls r1, 2 + ldr r3, [sp, 0xC] + ldr r0, [sp, 0x10] + adds r2, r3, r0 + lsls r2, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081975DC: .4byte 0x00000215 +_081975E0: .4byte 0x00000216 +_081975E4: .4byte 0x00000217 +_081975E8: .4byte 0x00000219 +_081975EC: .4byte 0x0000021a +_081975F0: .4byte 0x0000021b + thumb_func_end sub_81974A4 + + thumb_func_start sub_81975F4 +sub_81975F4: @ 81975F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r6, r0, 0 + adds r5, r2, 0 + mov r8, r3 + ldr r2, [sp, 0x44] + lsls r6, 24 + lsrs r6, 24 + lsls r0, r1, 24 + lsls r5, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r1, _0819778C + lsrs r2, r0, 24 + str r2, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r10, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r3, 0xF + mov r9, r3 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08197790 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r1, 0x81 + lsls r1, 2 + mov r0, r8 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08197794 + ldr r7, [sp, 0xC] + add r7, r8 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _08197798 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _0819779C + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977A0 + add r8, r4 + mov r3, r8 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977A4 + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977A8 + ldr r3, [sp, 0x10] + add r10, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977AC + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977B0 + ldr r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977B4 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x20] + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081977B8 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819778C: .4byte 0x00000201 +_08197790: .4byte 0x00000203 +_08197794: .4byte 0x00000205 +_08197798: .4byte 0x00000206 +_0819779C: .4byte 0x00000207 +_081977A0: .4byte 0x00000209 +_081977A4: .4byte 0x0000020a +_081977A8: .4byte 0x00000a01 +_081977AC: .4byte 0x00000a03 +_081977B0: .4byte 0x00000a04 +_081977B4: .4byte 0x00000a05 +_081977B8: .4byte 0x00000a06 + thumb_func_end sub_81975F4 + + thumb_func_start sub_81977BC +sub_81977BC: @ 81977BC + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81977BC + + thumb_func_start sub_8197804 +sub_8197804: @ 8197804 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197804 + + thumb_func_start SetStandardWindowBorderStyle +SetStandardWindowBorderStyle: @ 8197854 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x85 + lsls r2, 2 + movs r3, 0xE + bl SetWindowBorderStyle + pop {r0} + bx r0 + thumb_func_end SetStandardWindowBorderStyle + + thumb_func_start sub_819786C +sub_819786C: @ 819786C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r6, 0x80 + lsls r6, 2 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xF + bl sub_8197B1C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819786C + + thumb_func_start sub_819789C +sub_819789C: @ 819789C + push {lr} + ldr r0, _081978AC + movs r1, 0xE0 + movs r2, 0x14 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_081978AC: .4byte 0x0860f074 + thumb_func_end sub_819789C + + thumb_func_start sub_81978B0 +sub_81978B0: @ 81978B0 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _081978C4 + movs r2, 0x14 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_081978C4: .4byte 0x0860f074 + thumb_func_end sub_81978B0 + + thumb_func_start sub_81978C8 +sub_81978C8: @ 81978C8 + ldr r0, _081978CC + bx lr + .align 2, 0 +_081978CC: .4byte 0x0860f074 + thumb_func_end sub_81978C8 + + thumb_func_start sub_81978D0 +sub_81978D0: @ 81978D0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _081978DC + movs r1, 0 +_081978DC: + ldr r0, _081978E8 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_081978E8: .4byte 0x0860f074 + thumb_func_end sub_81978D0 + + thumb_func_start sub_81978EC +sub_81978EC: @ 81978EC + 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 + bl sub_81973A4 + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0xF + bl sub_8121E7C + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81978EC + + thumb_func_start sub_8197930 +sub_8197930: @ 8197930 + push {lr} + ldr r0, _08197944 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + pop {r0} + bx r0 + .align 2, 0 +_08197944: .4byte 0x0860f0a8 + thumb_func_end sub_8197930 + + thumb_func_start sub_8197948 +sub_8197948: @ 8197948 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _08197960 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + bl sub_81996C0 + pop {r0} + bx r0 + .align 2, 0 +_08197960: .4byte 0x0860f0a8 + thumb_func_end sub_8197948 + + thumb_func_start sub_8197964 +sub_8197964: @ 8197964 + push {lr} + ldr r0, _08197980 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08197988 + ldr r0, _08197984 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + b _0819798A + .align 2, 0 +_08197980: .4byte 0x03003014 +_08197984: .4byte 0x03005d90 +_08197988: + movs r0, 0x1 +_0819798A: + pop {r1} + bx r1 + thumb_func_end sub_8197964 + + thumb_func_start sav2_get_text_speed +sav2_get_text_speed: @ 8197990 + push {lr} + ldr r0, _081979BC + ldr r2, [r0] + ldrb r1, [r2, 0x14] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0x2 + bls _081979AC + movs r0, 0x8 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] +_081979AC: + bl sub_8197964 + ldr r1, _081979C0 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081979BC: .4byte 0x03005d90 +_081979C0: .4byte 0x0860f094 + thumb_func_end sav2_get_text_speed + + thumb_func_start sub_81979C4 +sub_81979C4: @ 81979C4 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, _08197A00 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081979F6 + lsls r0, r1, 25 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + ldr r0, _08197A04 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x16 + movs r2, 0x1 + movs r3, 0x7 + bl sub_8198AA4 + strb r0, [r4] +_081979F6: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08197A00: .4byte 0x0203cd8c +_08197A04: .4byte 0x00000139 + thumb_func_end sub_81979C4 + + thumb_func_start sub_8197A08 +sub_8197A08: @ 8197A08 + ldr r0, _08197A10 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08197A10: .4byte 0x0203cd8c + thumb_func_end sub_8197A08 + + thumb_func_start sub_8197A14 +sub_8197A14: @ 8197A14 + push {r4,lr} + ldr r4, _08197A2C + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A26 + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] +_08197A26: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08197A2C: .4byte 0x0203cd8c + thumb_func_end sub_8197A14 + + thumb_func_start sub_8197A30 +sub_8197A30: @ 8197A30 + movs r0, 0x80 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A30 + + thumb_func_start sub_8197A38 +sub_8197A38: @ 8197A38 + movs r0, 0x85 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A38 + + thumb_func_start sub_8197A40 +sub_8197A40: @ 8197A40 + push {r4,lr} + sub sp, 0xC + ldr r4, _08197A70 + ldrb r0, [r4] + cmp r0, 0xFF + bne _08197A66 + movs r0, 0x3 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0x4] + adds r0, 0xF9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xA + bl sub_8198AA4 + strb r0, [r4] +_08197A66: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08197A70: .4byte 0x0203cd8d + thumb_func_end sub_8197A40 + + thumb_func_start rboxid_upload_textbox_1_no_pal +rboxid_upload_textbox_1_no_pal: @ 8197A74 + ldr r0, _08197A7C + ldrb r0, [r0] + bx lr + .align 2, 0 +_08197A7C: .4byte 0x0203cd8d + thumb_func_end rboxid_upload_textbox_1_no_pal + + thumb_func_start sub_8197A80 +sub_8197A80: @ 8197A80 + push {r4,lr} + ldr r4, _08197A98 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A92 + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] +_08197A92: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08197A98: .4byte 0x0203cd8d + thumb_func_end sub_8197A80 + + thumb_func_start sub_8197A9C +sub_8197A9C: @ 8197A9C + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08197AE0 + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, _08197AE4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl text_box_related_one + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197AE0: .4byte 0x03003014 +_08197AE4: .4byte 0x02021fc4 + thumb_func_end sub_8197A9C + + thumb_func_start sub_8197AE8 +sub_8197AE8: @ 8197AE8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + 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 Bg_FillWramTileMapRectWithTileAndPalette + cmp r4, 0x1 + bne _08197B12 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_08197B12: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8197AE8 + + thumb_func_start sub_8197B1C +sub_8197B1C: @ 8197B1C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08197B58 + strh r2, [r0] + ldr r0, _08197B5C + strb r3, [r0] + ldr r1, _08197B60 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _08197B52 + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08197B52: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197B58: .4byte 0x0203cd9c +_08197B5C: .4byte 0x0203cd9e +_08197B60: .4byte sub_8197BB4 + 1 + thumb_func_end sub_8197B1C + + thumb_func_start sub_8197B64 +sub_8197B64: @ 8197B64 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08197BA8 + strh r2, [r0] + ldr r5, _08197BAC + adds r0, r6, 0 + movs r1, 0x5 + bl Window_GetField + strb r0, [r5] + ldr r1, _08197BB0 + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r6, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _08197BA2 + adds r0, r6, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08197BA2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08197BA8: .4byte 0x0203cd9c +_08197BAC: .4byte 0x0203cd9e +_08197BB0: .4byte sub_8197BB4 + 1 + thumb_func_end sub_8197B64 + + thumb_func_start sub_8197BB4 +sub_8197BB4: @ 8197BB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r8, r0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r2, [sp, 0x44] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsls r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r2, _08197DDC + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, r0, 24 + str r3, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r9, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + ldr r3, _08197DE0 + mov r10, r3 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _08197DDC + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DDC + ldrh r1, [r3] + adds r1, 0x4 + lsls r1, 16 + lsrs r1, 16 + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DDC + ldrh r1, [r3] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + adds r7, r0, r6 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DDC + ldrh r1, [r3] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DDC + ldrh r1, [r3] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DDC + ldrh r1, [r3] + adds r1, 0x9 + lsls r1, 16 + lsrs r1, 16 + adds r6, 0x1 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DDC + ldrh r1, [r3] + adds r1, 0xA + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DE4 + adds r1, r3, 0 + ldr r0, _08197DDC + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + add r9, r2 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DE8 + adds r1, r3, 0 + ldr r0, _08197DDC + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r3, _08197DEC + adds r1, r3, 0 + ldr r0, _08197DDC + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x1C] + str r2, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _08197DF0 + adds r1, r0, 0 + ldr r2, _08197DDC + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _08197DF4 + adds r1, r0, 0 + ldr r2, _08197DDC + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08197DDC: .4byte 0x0203cd9c +_08197DE0: .4byte 0x0203cd9e +_08197DE4: .4byte 0x00000801 +_08197DE8: .4byte 0x00000803 +_08197DEC: .4byte 0x00000804 +_08197DF0: .4byte 0x00000805 +_08197DF4: .4byte 0x00000806 + thumb_func_end sub_8197BB4 + + thumb_func_start sub_8197DF8 +sub_8197DF8: @ 8197DF8 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _08197E2C + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_FillTileMap + cmp r4, 0x1 + bne _08197E26 + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08197E26: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197E2C: .4byte sub_8197E30 + 1 + thumb_func_end sub_8197DF8 + + thumb_func_start sub_8197E30 +sub_8197E30: @ 8197E30 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197E30 + + thumb_func_start SetWindowBorderStyle +SetWindowBorderStyle: @ 8197E80 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08197EBC + strh r2, [r0] + ldr r0, _08197EC0 + strb r3, [r0] + ldr r1, _08197EC4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _08197EB6 + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08197EB6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08197EBC: .4byte 0x0203cd9c +_08197EC0: .4byte 0x0203cd9e +_08197EC4: .4byte DrawWindowBorder + 1 + thumb_func_end SetWindowBorderStyle + + thumb_func_start sub_8197EC8 +sub_8197EC8: @ 8197EC8 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08197F0C + strh r2, [r0] + ldr r5, _08197F10 + adds r0, r6, 0 + movs r1, 0x5 + bl Window_GetField + strb r0, [r5] + ldr r1, _08197F14 + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl Window_FastFillPixels + adds r0, r6, 0 + bl Window_WriteStandardTileMap + cmp r4, 0x1 + bne _08197F06 + adds r0, r6, 0 + movs r1, 0x3 + bl Window_CopyToVram +_08197F06: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08197F0C: .4byte 0x0203cd9c +_08197F10: .4byte 0x0203cd9e +_08197F14: .4byte DrawWindowBorder + 1 + thumb_func_end sub_8197EC8 + + thumb_func_start DrawWindowBorder +DrawWindowBorder: @ 8197F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r9, r0 + adds r6, r1, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x38] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r6, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r2, _08198068 + ldrh r1, [r2] + lsrs r0, r6, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r6, r2 + lsrs r6, 24 + lsrs r0, r4, 24 + mov r8, r0 + adds r4, r2 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + ldr r7, _0819806C + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r2, _08198068 + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r2, _08198068 + ldrh r1, [r2] + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _08198068 + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _08198068 + ldrh r1, [r0] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r0, _08198068 + ldrh r1, [r0] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x14] + add r8, r2 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r2, _08198068 + ldrh r1, [r2] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + mov r3, r8 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r2, _08198068 + ldrh r1, [r2] + adds r1, 0x8 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08198068: .4byte 0x0203cd9c +_0819806C: .4byte 0x0203cd9e + thumb_func_end DrawWindowBorder + + thumb_func_start sub_8198070 +sub_8198070: @ 8198070 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081980A4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r5, 0 + bl Window_FillTileMap + cmp r4, 0x1 + bne _0819809E + adds r0, r5, 0 + movs r1, 0x3 + bl Window_CopyToVram +_0819809E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081980A4: .4byte sub_81980A8 + 1 + thumb_func_end sub_8198070 + + thumb_func_start sub_81980A8 +sub_81980A8: @ 81980A8 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81980A8 + + thumb_func_start sub_81980F0 +sub_81980F0: @ 81980F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + cmp r6, 0x3 + bls _08198126 + movs r1, 0 + mov r0, sp + strb r1, [r0] + b _0819812A +_08198126: + mov r0, sp + strb r6, [r0] +_0819812A: + mov r1, sp + mov r0, r8 + strb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x4] + movs r0, 0x1E + subs r0, r7 + strb r0, [r1, 0x1] + strb r7, [r1, 0x3] + strb r5, [r1, 0x5] + strh r4, [r1, 0x6] + ldr r4, _08198154 + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r4] + cmp r5, 0xF + bls _08198158 + movs r5, 0xF0 + b _0819815C + .align 2, 0 +_08198154: .4byte 0x0203cda0 +_08198158: + lsls r0, r5, 28 + lsrs r5, r0, 24 +_0819815C: + ldr r0, _08198178 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _0819817C + ldrb r0, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08198178: .4byte 0x0860f0b0 +_0819817C: .4byte 0x0203cda0 + thumb_func_end sub_81980F0 + + thumb_func_start sub_8198180 +sub_8198180: @ 8198180 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r5, _081981FC + ldrb r0, [r5] + cmp r0, 0xFF + beq _081981EE + bl Window_WriteStandardTileMap + ldrb r0, [r5] + movs r1, 0xFF + bl Window_FastFillPixels + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl font_get_width_of_string + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl Window_GetField + movs r2, 0xEC + subs r2, r7 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + ldr r1, _08198200 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print + mov r0, r8 + cmp r0, 0 + beq _081981EE + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram +_081981EE: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081981FC: .4byte 0x0203cda0 +_08198200: .4byte 0x0860f0d0 + thumb_func_end sub_8198180 + + thumb_func_start sub_8198204 +sub_8198204: @ 8198204 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + adds r6, r1, 0 + ldr r0, [sp, 0x38] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, _08198240 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _081982C8 + cmp r2, 0 + beq _08198244 + add r0, sp, 0x14 + strb r4, [r0] + adds r1, r0, 0 + b _0819824A + .align 2, 0 +_08198240: .4byte 0x0203cda0 +_08198244: + add r1, sp, 0x14 + movs r0, 0xF + strb r0, [r1] +_0819824A: + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + adds r5, r7, 0 + ldrb r0, [r5] + bl Window_WriteStandardTileMap + ldrb r0, [r5] + movs r1, 0xFF + bl Window_FastFillPixels + cmp r6, 0 + beq _0819829E + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl font_get_width_of_string + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl Window_GetField + movs r2, 0xEC + mov r1, r8 + subs r2, r1 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + add r1, sp, 0x14 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print +_0819829E: + ldrb r0, [r7] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + str r1, [sp, 0xC] + mov r1, r10 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8199EEC + mov r2, r9 + cmp r2, 0 + beq _081982C8 + ldrb r0, [r7] + movs r1, 0x3 + bl Window_CopyToVram +_081982C8: + 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_8198204 + + thumb_func_start sub_81982D8 +sub_81982D8: @ 81982D8 + push {lr} + ldr r1, _081982EC + ldrb r0, [r1] + cmp r0, 0xFF + beq _081982E8 + movs r1, 0x3 + bl Window_CopyToVram +_081982E8: + pop {r0} + bx r0 + .align 2, 0 +_081982EC: .4byte 0x0203cda0 + thumb_func_end sub_81982D8 + + thumb_func_start sub_81982F0 +sub_81982F0: @ 81982F0 + push {r4,lr} + ldr r4, _08198310 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08198308 + movs r1, 0xFF + bl Window_FastFillPixels + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram +_08198308: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08198310: .4byte 0x0203cda0 + thumb_func_end sub_81982F0 + + thumb_func_start sub_8198314 +sub_8198314: @ 8198314 + push {r4,lr} + ldr r4, _08198344 + ldrb r0, [r4] + cmp r0, 0xFF + beq _0819833C + movs r1, 0 + bl Window_FastFillPixels + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + ldrb r0, [r4] + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] +_0819833C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08198344: .4byte 0x0203cda0 + thumb_func_end sub_8198314 + + thumb_func_start sub_8198348 +sub_8198348: @ 8198348 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + mov r8, r4 + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + ldr r6, [sp, 0x24] + mov r12, r6 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, _0819838C + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r8 + strb r0, [r5, 0x8] + mov r4, r12 + strb r4, [r5, 0xB] + cmp r7, 0 + blt _08198388 + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198390 +_08198388: + strb r6, [r5, 0x2] + b _08198392 + .align 2, 0 +_0819838C: .4byte 0x0203cd90 +_08198390: + strb r7, [r5, 0x2] +_08198392: + movs r0, 0 + bl MoveMenuCursor + ldr r0, _081983A8 + ldrb r0, [r0, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081983A8: .4byte 0x0203cd90 + thumb_func_end sub_8198348 + + thumb_func_start sub_81983AC +sub_81983AC: @ 81983AC + push {r4-r6,lr} + sub sp, 0x10 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + 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 r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r4, 0 + str r4, [sp, 0xC] + bl sub_8198348 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983AC + + thumb_func_start sub_81983EC +sub_81983EC: @ 81983EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + adds r6, r1, 0 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 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 + adds r0, r6, 0 + movs r1, 0x1 + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl sub_8006460 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl sub_81983AC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983EC + + thumb_func_start RedrawMenuCursor +RedrawMenuCursor: @ 8198448 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, _081984D0 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl sub_8006460 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl sub_8006460 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5, 0x5] + mov r9, r1 + ldrb r2, [r5] + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r6 + ldrb r6, [r5, 0x1] + adds r3, r6 + lsls r3, 16 + lsrs r3, 16 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r9 + movs r1, 0x11 + bl Window_FillPixelRect + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, _081984D4 + ldrb r3, [r5] + ldrb r4, [r5, 0x8] + mov r6, r8 + muls r6, r4 + adds r4, r6, 0 + ldrb r5, [r5, 0x1] + adds r4, r5 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + bl Print + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081984D0: .4byte 0x0203cd90 +_081984D4: .4byte 0x085ee498 + thumb_func_end RedrawMenuCursor + + thumb_func_start MoveMenuCursor +MoveMenuCursor: @ 81984D8 + push {r4,r5,lr} + ldr r1, _081984F8 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _081984FC + ldrb r0, [r4, 0x4] + b _0819850A + .align 2, 0 +_081984F8: .4byte 0x0203cd90 +_081984FC: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _08198508 + ldrb r0, [r4, 0x3] + b _0819850A +_08198508: + adds r0, r3, r5 +_0819850A: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursor + + thumb_func_start MoveMenuCursorNoWrapAround +MoveMenuCursorNoWrapAround: @ 819851C + push {r4,r5,lr} + ldr r1, _0819853C + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _08198540 + ldrb r0, [r4, 0x3] + b _0819854E + .align 2, 0 +_0819853C: .4byte 0x0203cd90 +_08198540: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _0819854C + ldrb r0, [r4, 0x4] + b _0819854E +_0819854C: + adds r0, r3, r5 +_0819854E: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursorNoWrapAround + + thumb_func_start GetMenuCursorPos +GetMenuCursorPos: @ 8198560 + ldr r0, _08198568 + ldrb r0, [r0, 0x2] + bx lr + .align 2, 0 +_08198568: .4byte 0x0203cd90 + thumb_func_end GetMenuCursorPos + + thumb_func_start ProcessMenuInput +ProcessMenuInput: @ 819856C + push {r4,lr} + ldr r0, _08198590 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198598 + ldr r4, _08198594 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198588 + movs r0, 0x5 + bl audio_play +_08198588: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081985D2 + .align 2, 0 +_08198590: .4byte 0x030022c0 +_08198594: .4byte 0x0203cd90 +_08198598: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081985A6 + movs r0, 0x1 + negs r0, r0 + b _081985D2 +_081985A6: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081985BA + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _081985CA +_081985BA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081985CE + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_081985CA: + bl MoveMenuCursor +_081985CE: + movs r0, 0x2 + negs r0, r0 +_081985D2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput + + thumb_func_start ProcessMenuInputNoWrapAround +ProcessMenuInputNoWrapAround: @ 81985D8 + push {r4-r6,lr} + ldr r4, _08198600 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r0, _08198604 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198608 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081985F8 + movs r0, 0x5 + bl audio_play +_081985F8: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _08198650 + .align 2, 0 +_08198600: .4byte 0x0203cd90 +_08198604: .4byte 0x030022c0 +_08198608: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198616 + movs r0, 0x1 + negs r0, r0 + b _08198650 +_08198616: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08198630 + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0819864C + b _08198646 +_08198630: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819864C + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0819864C +_08198646: + movs r0, 0x5 + bl audio_play +_0819864C: + movs r0, 0x2 + negs r0, r0 +_08198650: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround + + thumb_func_start ProcessMenuInput_other +ProcessMenuInput_other: @ 8198658 + push {r4,lr} + ldr r2, _0819867C + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198684 + ldr r4, _08198680 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198674 + movs r0, 0x5 + bl audio_play +_08198674: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081986BC + .align 2, 0 +_0819867C: .4byte 0x030022c0 +_08198680: .4byte 0x0203cd90 +_08198684: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198692 + movs r0, 0x1 + negs r0, r0 + b _081986BC +_08198692: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _081986A8 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _081986B4 +_081986A8: + cmp r1, 0x80 + bne _081986B8 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_081986B4: + bl MoveMenuCursor +_081986B8: + movs r0, 0x2 + negs r0, r0 +_081986BC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput_other + + thumb_func_start ProcessMenuInputNoWrapAround_other +ProcessMenuInputNoWrapAround_other: @ 81986C4 + push {r4-r6,lr} + ldr r4, _081986EC + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r2, _081986F0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081986F4 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081986E4 + movs r0, 0x5 + bl audio_play +_081986E4: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _0819873A + .align 2, 0 +_081986EC: .4byte 0x0203cd90 +_081986F0: .4byte 0x030022c0 +_081986F4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198702 + movs r0, 0x1 + negs r0, r0 + b _0819873A +_08198702: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _0819871E + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08198736 + b _08198730 +_0819871E: + cmp r1, 0x80 + bne _08198736 + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _08198736 +_08198730: + movs r0, 0x5 + bl audio_play +_08198736: + movs r0, 0x2 + negs r0, r0 +_0819873A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround_other + + thumb_func_start PrintTextArray +PrintTextArray: @ 8198740 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0 + cmp r4, r5 + bcs _081987A4 +_08198774: + lsls r0, r4, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + adds r0, r7, 0 + muls r0, r4 + add r0, r8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + mov r3, r9 + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198774 +_081987A4: + adds r0, r6, 0 + movs r1, 0x2 + bl Window_CopyToVram + 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 PrintTextArray + + thumb_func_start sub_81987BC +sub_81987BC: @ 81987BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x4C] + ldr r7, [sp, 0x50] + mov r8, r7 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + mov r0, r8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _0819883C +_08198804: + lsls r0, r4, 3 + ldr r1, [sp, 0x48] + adds r0, r1 + ldr r2, [r0] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r7, 0 + ldr r1, [sp, 0x14] + ldr r3, [sp, 0x18] + bl sub_8199F74 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198804 +_0819883C: + adds r0, r7, 0 + movs r1, 0x2 + bl Window_CopyToVram + 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_81987BC + + thumb_func_start sub_8198854 +sub_8198854: @ 8198854 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + mov r8, r0 + adds r6, r1, 0 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r7, [sp, 0x24] + 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 + adds r0, r6, 0 + movs r1, 0 + bl fbox_get_field + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r7, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + movs r3, 0x1 + bl PrintTextArray + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198854 + + thumb_func_start sub_81988A4 +sub_81988A4: @ 81988A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r1, 0 + mov r8, r2 + ldr r1, [sp, 0x38] + mov r9, r1 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r6, 24 + lsrs r6, 24 + mov r4, r8 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0x5 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl fbox_get_field + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl fbox_get_field + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r2, r9 + strb r2, [r0, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl fbox_get_field + mov r1, sp + strb r0, [r1, 0xB] + mov r0, sp + mov r4, r8 + strb r4, [r0, 0x6] + strb r4, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _0819899E + mov r5, sp +_0819896E: + ldr r1, [sp, 0x48] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x44] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl remo_copy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819896E +_0819899E: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + 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_81988A4 + + thumb_func_start sub_81989B8 +sub_81989B8: @ 81989B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + ldr r7, [sp, 0x30] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl fbox_get_field + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl fbox_get_field + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x34] + str r0, [sp, 0x10] + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_81988A4 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81989B8 + + thumb_func_start rbox_template_set +rbox_template_set: @ 8198A24 + 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 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + strb r4, [r0, 0x3] + strb r5, [r0, 0x4] + strb r6, [r0, 0x5] + mov r1, r8 + strh r1, [r0, 0x6] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end rbox_template_set + + thumb_func_start sub_8198A50 +sub_8198A50: @ 8198A50 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r0 + ldr r0, [sp, 0x2C] + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x38] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + add r0, sp, 0x10 + bl rbox_template_set + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + mov r2, r8 + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r8 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r2} + bx r2 + thumb_func_end sub_8198A50 + + thumb_func_start sub_8198AA4 +sub_8198AA4: @ 8198AA4 + push {r4-r6,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + str r3, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r2, [sp, 0xC] + add r0, sp, 0x10 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl rbox_template_set + add r0, sp, 0x10 + bl Window_AddFromTemplate + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198AA4 + + thumb_func_start sub_8198AF8 +sub_8198AF8: @ 8198AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + ldr r1, [sp, 0x44] + mov r10, r1 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + mov r1, r10 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r7, _08198C2C + bl Window_AddFromTemplate + strb r0, [r7] + ldrb r0, [r7] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, _08198C30 + str r0, [sp, 0xC] + add r1, sp, 0xC + ldrb r0, [r7] + strb r0, [r1, 0x4] + adds r0, r1, 0 + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0 + bl fbox_get_field + add r1, sp, 0xC + add r0, r8 + strb r0, [r1, 0x6] + adds r0, r1, 0 + mov r1, r9 + strb r1, [r0, 0x7] + adds r1, r0, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r6, 0 + movs r1, 0x5 + bl fbox_get_field + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl fbox_get_field + add r3, sp, 0xC + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl fbox_get_field + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl fbox_get_field + add r1, sp, 0xC + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r6, 0 + movs r1, 0x2 + bl fbox_get_field + add r1, sp, 0xC + strb r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl fbox_get_field + add r1, sp, 0xC + strb r0, [r1, 0xB] + adds r0, r1, 0 + movs r1, 0xFF + movs r2, 0 + bl remo_copy + adds r0, r6, 0 + movs r1, 0x1 + bl fbox_get_field + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r1, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_81983AC + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08198C2C: .4byte 0x0203cd9f +_08198C30: .4byte 0x085ee491 + thumb_func_end sub_8198AF8 + + thumb_func_start sub_8198C34 +sub_8198C34: @ 8198C34 + push {lr} + sub sp, 0xC + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + movs r3, 0x1 + bl sub_8198AF8 + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_8198C34 + + thumb_func_start sub_8198C58 +sub_8198C58: @ 8198C58 + push {r4,lr} + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08198C6E + bl sub_8198C78 +_08198C6E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8198C58 + + thumb_func_start sub_8198C78 +sub_8198C78: @ 8198C78 + push {r4,lr} + ldr r4, _08198C90 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08198C90: .4byte 0x0203cd9f + thumb_func_end sub_8198C78 + + thumb_func_start sub_8198C94 +sub_8198C94: @ 8198C94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + ldr r7, [sp, 0x4C] + mov r8, r7 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + 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 r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r5, r9 + bcs _08198D3A +_08198CE0: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _08198D30 + ldr r7, [sp, 0x1C] + adds r0, r7, 0 + muls r0, r5 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + lsls r0, 24 + lsrs r7, r0, 24 +_08198CF8: + adds r0, r5, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x50] + adds r0, r1 + ldr r2, [r0] + ldr r0, [sp, 0x18] + adds r3, r0, 0 + muls r3, r4 + ldr r1, [sp, 0x10] + adds r3, r1, r3 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + ldr r1, [sp, 0xC] + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _08198CF8 +_08198D30: + mov r7, r8 + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + bcc _08198CE0 +_08198D3A: + mov r0, r10 + movs r1, 0x2 + bl Window_CopyToVram + 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_8198C94 + + thumb_func_start sub_8198D54 +sub_8198D54: @ 8198D54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r9, r0 + mov r8, r1 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x34] + ldr r3, [sp, 0x38] + ldr r7, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + 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 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0 + str r3, [sp, 0x14] + bl fbox_get_field + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r3, [sp, 0x14] + str r3, [sp, 0xC] + str r7, [sp, 0x10] + mov r0, r9 + mov r1, r8 + movs r3, 0 + bl sub_8198C94 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198D54 + + thumb_func_start sub_8198DBC +sub_8198DBC: @ 8198DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x1C] + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + lsls r6, 24 + lsrs r6, 24 + mov r10, r6 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r7, [r0, 0x5] + adds r0, r7, 0 + movs r1, 0x5 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r7, 0 + movs r1, 0x6 + bl fbox_get_field + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x7 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x4 + bl fbox_get_field + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r7, 0 + movs r1, 0x2 + bl fbox_get_field + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r7, 0 + movs r1, 0x3 + bl fbox_get_field + mov r1, sp + strb r0, [r1, 0xB] + movs r6, 0 + cmp r6, r10 + bcs _08198EDE +_08198E7A: + movs r5, 0 + adds r2, r6, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08198ED4 + mov r4, sp +_08198E86: + mov r0, r8 + muls r0, r6 + adds r0, r5 + ldr r1, [sp, 0x50] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x4C] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x1C] + adds r0, r1, 0 + muls r0, r5 + ldr r2, [sp, 0x14] + adds r0, r2, r0 + strb r0, [r4, 0x6] + adds r0, r7, 0 + movs r1, 0x1 + bl fbox_get_field + adds r1, r6, 0 + muls r1, r0 + ldr r0, [sp, 0x18] + adds r1, r0, r1 + strb r1, [r4, 0x7] + ldrb r0, [r4, 0x6] + strb r0, [r4, 0x8] + strb r1, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl remo_copy + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _08198E86 +_08198ED4: + mov r1, r9 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, r10 + bcc _08198E7A +_08198EDE: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + 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_8198DBC + + thumb_func_start sub_8198EF8 +sub_8198EF8: @ 8198EF8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + mov r8, r0 + adds r3, r1, 0 + adds r4, r2, 0 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r3, 0 + movs r1, 0 + str r3, [sp, 0x14] + bl fbox_get_field + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x10] + mov r0, r8 + ldr r3, [sp, 0x14] + adds r1, r3, 0 + movs r3, 0 + bl sub_8198DBC + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198EF8 + + thumb_func_start sub_8198F58 +sub_8198F58: @ 8198F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, [sp, 0x20] + mov r12, r4 + ldr r4, [sp, 0x24] + mov r8, r4 + ldr r4, [sp, 0x28] + mov r9, r4 + ldr r4, [sp, 0x2C] + mov r10, r4 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, _08198FB0 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r12 + strb r0, [r5, 0x7] + mov r4, r8 + strb r4, [r5, 0x8] + mov r0, r9 + strb r0, [r5, 0x9] + mov r4, r10 + strb r4, [r5, 0xA] + cmp r7, 0 + blt _08198FAC + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198FB4 +_08198FAC: + strb r6, [r5, 0x2] + b _08198FB6 + .align 2, 0 +_08198FB0: .4byte 0x0203cd90 +_08198FB4: + strb r7, [r5, 0x2] +_08198FB6: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, _08198FD0 + ldrb r0, [r0, 0x2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08198FD0: .4byte 0x0203cd90 + thumb_func_end sub_8198F58 + + thumb_func_start sub_8198FD4 +sub_8198FD4: @ 8198FD4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x20 + mov r9, r0 + mov r8, r1 + mov r10, r2 + ldr r6, [sp, 0x3C] + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r2, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r2, 24 + mov r0, r8 + movs r1, 0x1 + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + bl sub_8006460 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + muls r1, r5 + lsls r1, 24 + lsrs r1, 24 + str r6, [sp] + str r0, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + str r1, [sp, 0x10] + ldr r2, [sp, 0x18] + str r2, [sp, 0x14] + mov r0, r9 + mov r1, r8 + mov r2, r10 + ldr r3, [sp, 0x1C] + bl sub_8198F58 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198FD4 + + thumb_func_start sub_8199060 +sub_8199060: @ 8199060 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsrs r7, r0, 24 + ldr r5, _0819912C + ldrb r0, [r5, 0x6] + movs r1, 0 + bl sub_8006460 + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl sub_8006460 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldrb r0, [r5, 0x9] + mov r10, r0 + mov r0, r8 + mov r1, r10 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r1, [r5] + adds r4, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + mov r1, r10 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r0, [r5, 0x1] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + mov r1, r9 + str r1, [sp] + str r6, [sp, 0x4] + movs r1, 0x11 + adds r2, r4, 0 + bl Window_FillPixelRect + ldrb r6, [r5, 0x9] + adds r0, r7, 0 + adds r1, r6, 0 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r0, [r5] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r6, 0 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r1, [r5, 0x1] + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, _08199130 + str r3, [sp] + movs r3, 0 + str r3, [sp, 0x4] + str r3, [sp, 0x8] + adds r3, r4, 0 + bl Print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819912C: .4byte 0x0203cd90 +_08199130: .4byte 0x085ee498 + thumb_func_end sub_8199060 + + thumb_func_start sub_8199134 +sub_8199134: @ 8199134 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldr r1, _08199170 + ldrb r2, [r1, 0x2] + mov r8, r2 + lsls r0, 24 + asrs r6, r0, 24 + adds r5, r1, 0 + cmp r6, 0 + beq _0819918A + movs r7, 0x2 + ldrsb r7, [r5, r7] + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + bl __modsi3 + adds r0, r6 + cmp r0, 0 + bge _08199174 + adds r0, r4, 0 + adds r0, 0xFF + add r0, r8 + b _08199188 + .align 2, 0 +_08199170: .4byte 0x0203cd90 +_08199174: + cmp r0, r4 + blt _08199184 + adds r0, r7, 0 + adds r1, r4, 0 + bl __divsi3 + muls r0, r4 + b _08199188 +_08199184: + mov r1, r8 + adds r0, r6, r1 +_08199188: + strb r0, [r5, 0x2] +_0819918A: + mov r2, r9 + lsls r0, r2, 24 + asrs r6, r0, 24 + cmp r6, 0 + beq _081991CE + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r4, [r5, 0x9] + adds r1, r4, 0 + bl __divsi3 + adds r1, r0, r6 + cmp r1, 0 + bge _081991B2 + ldrb r0, [r5, 0xA] + subs r0, 0x1 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + b _081991CC +_081991B2: + ldrb r0, [r5, 0xA] + cmp r1, r0 + blt _081991C4 + subs r0, 0x1 + adds r1, r4, 0 + muls r1, r0 + ldrb r0, [r5, 0x2] + subs r0, r1 + b _081991CC +_081991C4: + adds r0, r4, 0 + muls r0, r6 + ldrb r2, [r5, 0x2] + adds r0, r2 +_081991CC: + strb r0, [r5, 0x2] +_081991CE: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _081991E4 + ldrb r1, [r5, 0x2] + mov r0, r8 + bl sub_8199060 + b _081991E8 +_081991E4: + mov r0, r8 + strb r0, [r5, 0x2] +_081991E8: + ldrb r0, [r5, 0x2] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8199134 + + thumb_func_start sub_81991F8 +sub_81991F8: @ 81991F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r1, _08199270 + ldrb r7, [r1, 0x2] + lsls r0, 24 + asrs r4, r0, 24 + adds r5, r1, 0 + cmp r4, 0 + beq _0819922C + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __modsi3 + adds r0, r4 + cmp r0, 0 + blt _0819922C + cmp r0, r6 + bge _0819922C + adds r0, r4, r7 + strb r0, [r5, 0x2] +_0819922C: + mov r1, r8 + lsls r0, r1, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _08199258 + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __divsi3 + adds r0, r4 + cmp r0, 0 + blt _08199258 + ldrb r1, [r5, 0xA] + cmp r0, r1 + bge _08199258 + adds r0, r6, 0 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + strb r0, [r5, 0x2] +_08199258: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _08199274 + ldrb r1, [r5, 0x2] + adds r0, r7, 0 + bl sub_8199060 + b _08199276 + .align 2, 0 +_08199270: .4byte 0x0203cd90 +_08199274: + strb r7, [r5, 0x2] +_08199276: + ldrb r0, [r5, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81991F8 + + thumb_func_start sub_8199284 +sub_8199284: @ 8199284 + push {r4,lr} + ldr r4, _081992A4 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081992AC + movs r0, 0x5 + bl audio_play + ldr r0, _081992A8 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819932C + .align 2, 0 +_081992A4: .4byte 0x030022c0 +_081992A8: .4byte 0x0203cd90 +_081992AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081992BA + movs r0, 0x1 + negs r0, r0 + b _0819932C +_081992BA: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081992D0 + movs r0, 0x5 + bl audio_play + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199324 +_081992D0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081992E4 + movs r0, 0x5 + bl audio_play + movs r0, 0 + movs r1, 0x1 + b _08199324 +_081992E4: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081992F8 + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199304 +_081992F8: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _08199322 +_08199304: + ldrh r1, [r4, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0819931A + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199328 +_0819931A: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_08199322: + movs r1, 0 +_08199324: + bl sub_8199134 +_08199328: + movs r0, 0x2 + negs r0, r0 +_0819932C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8199284 + + thumb_func_start sub_8199334 +sub_8199334: @ 8199334 + push {r4-r6,lr} + ldr r5, _08199354 + ldrb r4, [r5, 0x2] + ldr r6, _08199358 + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819935C + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + ldrsb r0, [r5, r0] + b _081993D2 + .align 2, 0 +_08199354: .4byte 0x0203cd90 +_08199358: .4byte 0x030022c0 +_0819935C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819936A + movs r0, 0x1 + negs r0, r0 + b _081993D2 +_0819936A: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819937A + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _081993BC +_0819937A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08199388 + movs r0, 0 + movs r1, 0x1 + b _081993BC +_08199388: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0819939C + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081993A2 +_0819939C: + movs r0, 0x1 + negs r0, r0 + b _081993BA +_081993A2: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081993B8 + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081993CE +_081993B8: + movs r0, 0x1 +_081993BA: + movs r1, 0 +_081993BC: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _081993CE + movs r0, 0x5 + bl audio_play +_081993CE: + movs r0, 0x2 + negs r0, r0 +_081993D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199334 + + thumb_func_start sub_81993D8 +sub_81993D8: @ 81993D8 + push {r4,r5,lr} + ldr r4, _081993F8 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08199400 + movs r0, 0x5 + bl audio_play + ldr r0, _081993FC + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819947C + .align 2, 0 +_081993F8: .4byte 0x030022c0 +_081993FC: .4byte 0x0203cd90 +_08199400: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819940E + movs r0, 0x1 + negs r0, r0 + b _0819947C +_0819940E: + ldrh r0, [r4, 0x30] + movs r5, 0xF0 + adds r1, r5, 0 + ands r1, r0 + cmp r1, 0x40 + bne _08199428 + movs r0, 0x5 + bl audio_play + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199474 +_08199428: + cmp r1, 0x80 + bne _08199438 + movs r0, 0x5 + bl audio_play + movs r0, 0 + movs r1, 0x1 + b _08199474 +_08199438: + cmp r1, 0x20 + beq _08199448 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199454 +_08199448: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _08199472 +_08199454: + ldrh r1, [r4, 0x30] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x10 + beq _0819946A + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199478 +_0819946A: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_08199472: + movs r1, 0 +_08199474: + bl sub_8199134 +_08199478: + movs r0, 0x2 + negs r0, r0 +_0819947C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81993D8 + + thumb_func_start sub_8199484 +sub_8199484: @ 8199484 + push {r4-r6,lr} + ldr r6, _081994A4 + ldrb r4, [r6, 0x2] + ldr r5, _081994A8 + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081994AC + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + ldrsb r0, [r6, r0] + b _0819951E + .align 2, 0 +_081994A4: .4byte 0x0203cd90 +_081994A8: .4byte 0x030022c0 +_081994AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081994BA + movs r0, 0x1 + negs r0, r0 + b _0819951E +_081994BA: + ldrh r0, [r5, 0x30] + movs r6, 0xF0 + adds r1, r6, 0 + ands r1, r0 + cmp r1, 0x40 + bne _081994CE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199508 +_081994CE: + cmp r1, 0x80 + bne _081994D8 + movs r0, 0 + movs r1, 0x1 + b _08199508 +_081994D8: + cmp r1, 0x20 + beq _081994E8 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081994EE +_081994E8: + movs r0, 0x1 + negs r0, r0 + b _08199506 +_081994EE: + ldrh r1, [r5, 0x30] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0x10 + beq _08199504 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0819951A +_08199504: + movs r0, 0x1 +_08199506: + movs r1, 0 +_08199508: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0819951A + movs r0, 0x5 + bl audio_play +_0819951A: + movs r0, 0x2 + negs r0, r0 +_0819951E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199484 + + thumb_func_start InitMenuInUpperLeftCorner +InitMenuInUpperLeftCorner: @ 8199524 + push {r4-r6,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, _08199558 + movs r6, 0 + strb r6, [r4] + movs r2, 0x1 + strb r2, [r4, 0x1] + strb r6, [r4, 0x3] + subs r1, 0x1 + strb r1, [r4, 0x4] + strb r0, [r4, 0x5] + strb r2, [r4, 0x6] + movs r0, 0x10 + strb r0, [r4, 0x8] + strb r3, [r4, 0xB] + cmp r5, 0 + blt _08199554 + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r5, r0 + ble _0819955C +_08199554: + strb r6, [r4, 0x2] + b _0819955E + .align 2, 0 +_08199558: .4byte 0x0203cd90 +_0819955C: + strb r5, [r4, 0x2] +_0819955E: + movs r0, 0 + bl MoveMenuCursor + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCorner + + thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed +InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl InitMenuInUpperLeftCorner + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed + + thumb_func_start PrintMenuTable +PrintMenuTable: @ 819958C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r5, 0 + cmp r5, r7 + bcs _081995D0 + movs r6, 0x80 + lsls r6, 17 + adds r4, r2, 0 +_081995AA: + ldr r2, [r4] + lsrs r0, r6, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r4, 0x8 + adds r5, 0x1 + cmp r5, r7 + bcc _081995AA +_081995D0: + mov r0, r8 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintMenuTable + + thumb_func_start sub_81995E4 +sub_81995E4: @ 81995E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r2 + mov r8, r3 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + mov r0, sp + movs r1, 0 + mov r10, r1 + strb r6, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl fbox_get_field + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl fbox_get_field + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r10 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0x8 + strb r1, [r0, 0x6] + strb r1, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _081996A6 + mov r5, sp +_0819967C: + mov r1, r8 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + add r0, r9 + ldr r0, [r0] + str r0, [sp] + lsls r0, r4, 4 + adds r0, 0x1 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl remo_copy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819967C +_081996A6: + adds r0, r6, 0 + movs r1, 0x2 + bl Window_CopyToVram + 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_81995E4 + + thumb_func_start sub_81996C0 +sub_81996C0: @ 81996C0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, _081997A4 + mov r8, r1 + bl Window_AddFromTemplate + mov r2, r8 + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, _081997A8 + str r0, [sp] + mov r1, sp + mov r2, r8 + ldrb r0, [r2] + movs r2, 0 + mov r9, r2 + strb r0, [r1, 0x4] + mov r0, sp + movs r2, 0x1 + strb r2, [r0, 0x5] + movs r0, 0x8 + strb r0, [r1, 0x6] + mov r0, sp + strb r2, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + movs r0, 0x1 + movs r1, 0x5 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl fbox_get_field + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl fbox_get_field + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r9 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0xFF + movs r2, 0 + bl remo_copy + mov r2, r8 + ldrb r0, [r2] + movs r1, 0x2 + adds r2, r6, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081997A4: .4byte 0x0203cd9f +_081997A8: .4byte 0x085ee491 + thumb_func_end sub_81996C0 + + thumb_func_start sub_81997AC +sub_81997AC: @ 81997AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + movs r7, 0 + cmp r7, r3 + bcs _08199824 +_081997D4: + movs r4, 0 + adds r0, r7, 0x1 + mov r9, r0 + cmp r4, r6 + bcs _0819981C + lsls r0, r7, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0x80 + lsls r5, 20 +_081997EC: + adds r0, r7, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + lsrs r3, r5, 24 + mov r0, r8 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + movs r1, 0x1 + bl Print + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + adds r5, r0 + adds r4, 0x1 + cmp r4, r6 + bcc _081997EC +_0819981C: + mov r7, r9 + ldr r4, [sp, 0x10] + cmp r7, r4 + bcc _081997D4 +_08199824: + mov r0, r10 + movs r1, 0x2 + bl Window_CopyToVram + 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_81997AC + + thumb_func_start sub_819983C +sub_819983C: @ 819983C + 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, 0x10] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + mov r0, sp + movs r6, 0 + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl fbox_get_field + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl fbox_get_field + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + strb r6, [r0, 0xA] + strb r6, [r0, 0xB] + movs r7, 0 + cmp r7, r10 + bcs _0819992A +_081998D6: + movs r5, 0 + adds r2, r7, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08199920 + mov r4, sp + lsls r0, r7, 4 + adds r6, r0, 0x1 +_081998E6: + mov r0, r8 + muls r0, r7 + adds r0, r5 + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x38] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x14] + adds r0, r1, 0 + muls r0, r5 + adds r0, 0x8 + strb r0, [r4, 0x6] + strb r6, [r4, 0x7] + strb r0, [r4, 0x8] + strb r6, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl remo_copy + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081998E6 +_08199920: + mov r2, r9 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, r10 + bcc _081998D6 +_0819992A: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + 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_819983C + + thumb_func_start sub_8199944 +sub_8199944: @ 8199944 + push {r4-r7,lr} + ldr r4, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + ldr r6, _0819998C + movs r4, 0 + mov r12, r4 + mov r4, r12 + strb r4, [r6] + movs r5, 0x1 + strb r5, [r6, 0x1] + strb r4, [r6, 0x3] + adds r4, r2, 0 + muls r4, r3 + subs r4, 0x1 + strb r4, [r6, 0x4] + strb r0, [r6, 0x5] + strb r5, [r6, 0x6] + strb r1, [r6, 0x7] + movs r0, 0x10 + strb r0, [r6, 0x8] + strb r2, [r6, 0x9] + strb r3, [r6, 0xA] + cmp r7, 0 + blt _08199986 + movs r0, 0x4 + ldrsb r0, [r6, r0] + cmp r7, r0 + ble _08199990 +_08199986: + mov r0, r12 + strb r0, [r6, 0x2] + b _08199992 + .align 2, 0 +_0819998C: .4byte 0x0203cd90 +_08199990: + strb r7, [r6, 0x2] +_08199992: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, _081999A4 + ldrb r0, [r0, 0x2] + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081999A4: .4byte 0x0203cd90 + thumb_func_end sub_8199944 + + thumb_func_start clear_scheduled_bg_copies_to_vram +clear_scheduled_bg_copies_to_vram: @ 81999A8 + push {lr} + ldr r0, _081999B8 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_081999B8: .4byte 0x0203cda4 + thumb_func_end clear_scheduled_bg_copies_to_vram + + thumb_func_start schedule_bg_copy_tilemap_to_vram +schedule_bg_copy_tilemap_to_vram: @ 81999BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081999CC + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_081999CC: .4byte 0x0203cda4 + thumb_func_end schedule_bg_copy_tilemap_to_vram + + thumb_func_start do_scheduled_bg_tilemap_copies_to_vram +do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 + push {r4,lr} + ldr r4, _08199A1C + ldrb r0, [r4] + cmp r0, 0x1 + bne _081999E4 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + strb r0, [r4] +_081999E4: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _081999F4 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + strb r0, [r4, 0x1] +_081999F4: + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + bne _08199A04 + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + strb r0, [r4, 0x2] +_08199A04: + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _08199A14 + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + strb r0, [r4, 0x3] +_08199A14: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08199A1C: .4byte 0x0203cda4 + thumb_func_end do_scheduled_bg_tilemap_copies_to_vram + + thumb_func_start reset_temp_tile_data_buffers +reset_temp_tile_data_buffers: @ 8199A20 + push {lr} + ldr r3, _08199A3C + ldr r1, _08199A40 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x7C +_08199A2C: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08199A2C + movs r0, 0 + strh r0, [r3] + pop {r0} + bx r0 + .align 2, 0 +_08199A3C: .4byte 0x0203cda8 +_08199A40: .4byte 0x0203cdac + thumb_func_end reset_temp_tile_data_buffers + + thumb_func_start free_temp_tile_data_buffers_if_possible +free_temp_tile_data_buffers_if_possible: @ 8199A44 + push {r4-r6,lr} + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _08199A88 + ldr r1, _08199A80 + ldrh r0, [r1] + cmp r0, 0 + beq _08199A7C + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08199A76 + ldr r5, _08199A84 + movs r6, 0 +_08199A64: + ldr r0, [r5] + bl free + stm r5!, {r6} + adds r4, 0x1 + ldr r0, _08199A80 + ldrh r0, [r0] + cmp r4, r0 + blt _08199A64 +_08199A76: + ldr r1, _08199A80 + movs r0, 0 + strh r0, [r1] +_08199A7C: + movs r0, 0 + b _08199A8A + .align 2, 0 +_08199A80: .4byte 0x0203cda8 +_08199A84: .4byte 0x0203cdac +_08199A88: + movs r0, 0x1 +_08199A8A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end free_temp_tile_data_buffers_if_possible + + thumb_func_start decompress_and_copy_tile_data_to_vram +decompress_and_copy_tile_data_to_vram: @ 8199A90 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, _08199AF0 + ldrh r0, [r6] + cmp r0, 0x1F + bhi _08199AF8 + adds r0, r4, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r4, r0, 0 + cmp r5, 0 + bne _08199AC8 + ldr r5, [sp, 0x4] +_08199AC8: + cmp r4, 0 + beq _08199AEC + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, _08199AF4 + ldrh r0, [r6] + adds r1, r0, 0x1 + strh r1, [r6] + lsls r0, 16 + lsrs r0, 14 + adds r0, r2 + str r4, [r0] +_08199AEC: + adds r0, r4, 0 + b _08199AFA + .align 2, 0 +_08199AF0: .4byte 0x0203cda8 +_08199AF4: .4byte 0x0203cdac +_08199AF8: + movs r0, 0 +_08199AFA: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end decompress_and_copy_tile_data_to_vram + + thumb_func_start copy_decompressed_tile_data_to_vram_autofree +copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r2, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r1, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r6, r0, 0 + cmp r5, 0 + bne _08199B36 + ldr r5, [sp, 0x4] +_08199B36: + cmp r6, 0 + beq _08199B6E + ldr r0, _08199B7C + movs r1, 0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r6, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, _08199B80 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl set_word_task_arg +_08199B6E: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08199B7C: .4byte task_free_buf_after_copying_tile_data_to_vram + 1 +_08199B80: .4byte 0x03005e00 + thumb_func_end copy_decompressed_tile_data_to_vram_autofree + + thumb_func_start task_free_buf_after_copying_tile_data_to_vram +task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08199BBC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl dma3_transfer_queue_check_for_space + lsls r0, 16 + cmp r0, 0 + bne _08199BB4 + adds r0, r4, 0 + movs r1, 0x1 + bl get_word_task_arg + bl free + adds r0, r4, 0 + bl remove_task +_08199BB4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08199BBC: .4byte 0x03005e00 + thumb_func_end task_free_buf_after_copying_tile_data_to_vram + + thumb_func_start malloc_and_decompress +malloc_and_decompress: @ 8199BC0 + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r0, [r5, 0x1] + strb r0, [r1] + ldrb r0, [r5, 0x2] + strb r0, [r1, 0x1] + ldrb r0, [r5, 0x3] + strb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x3] + ldr r0, [r1] + bl malloc + adds r4, r0, 0 + cmp r4, 0 + beq _08199BE8 + adds r0, r5, 0 + adds r1, r4, 0 + bl LZ77UnCompWram +_08199BE8: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end malloc_and_decompress + + thumb_func_start copy_decompressed_tile_data_to_vram +copy_decompressed_tile_data_to_vram: @ 8199BF0 + push {r4,lr} + adds r4, r1, 0 + ldr r1, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _08199C18 + cmp r1, 0x1 + beq _08199C20 + ldr r0, _08199C14 + b _08199C2A + .align 2, 0 +_08199C14: .4byte 0x0000ffff +_08199C18: + adds r1, r4, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _08199C26 +_08199C20: + adds r1, r4, 0 + bl gpu_copy_bg_tile_map_to_vram +_08199C26: + lsls r0, 16 + lsrs r0, 16 +_08199C2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end copy_decompressed_tile_data_to_vram + + thumb_func_start sub_8199C30 +sub_8199C30: @ 8199C30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + bl bg_get_tilemap + mov r8, r0 + adds r0, r5, r4 + cmp r5, r0 + bge _08199CA8 + mov r9, r0 +_08199C6E: + ldr r3, [sp] + ldr r1, [sp, 0x4] + adds r0, r3, r1 + adds r7, r5, 0x1 + cmp r3, r0 + bge _08199CA0 + lsls r6, r5, 5 + ldr r1, _08199CB8 + mov r12, r1 + mov r1, r10 + lsls r5, r1, 12 + adds r4, r0, 0 +_08199C86: + adds r1, r6, r3 + lsls r1, 1 + add r1, r8 + ldrh r2, [r1] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + blt _08199C86 +_08199CA0: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + blt _08199C6E +_08199CA8: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08199CB8: .4byte 0x00000fff + thumb_func_end sub_8199C30 + + thumb_func_start sub_8199CBC +sub_8199CBC: @ 8199CBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r1 + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + bl bg_get_tilemap + adds r7, r0, 0 + movs r0, 0 + cmp r0, r8 + bcs _08199D2A +_08199CF4: + movs r2, 0 + adds r6, r0, 0x1 + cmp r2, r5 + bcs _08199D22 + adds r4, r0, 0 + muls r4, r5 + ldr r1, [sp] + adds r0, r1 + lsls r3, r0, 5 +_08199D06: + adds r1, r4, r2 + lsls r1, 1 + add r1, r10 + adds r0, r3, r2 + add r0, r9 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r5 + bcc _08199D06 +_08199D22: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _08199CF4 +_08199D2A: + 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_8199CBC + + thumb_func_start sub_8199D3C +sub_8199D3C: @ 8199D3C + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x14] + adds r4, r2, 0 + muls r4, r3 + cmp r0, 0x1 + bne _08199D64 + adds r3, r6, 0 + movs r2, 0 + cmp r2, r4 + bge _08199D8C +_08199D54: + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, r5 + strb r0, [r1] + adds r2, 0x1 + cmp r2, r4 + blt _08199D54 + b _08199D8C +_08199D64: + cmp r4, 0 + ble _08199D8C + movs r0, 0xFC + lsls r0, 8 + mov r12, r0 + ldr r0, _08199D94 + adds r7, r0, 0 + adds r3, r6, 0 + adds r2, r4, 0 +_08199D76: + ldrh r0, [r3] + mov r1, r12 + ands r1, r0 + adds r0, r5 + ands r0, r7 + orrs r1, r0 + strh r1, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08199D76 +_08199D8C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08199D94: .4byte 0x000003ff + thumb_func_end sub_8199D3C + + thumb_func_start sub_8199D98 +sub_8199D98: @ 8199D98 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + pop {r0} + bx r0 + thumb_func_end sub_8199D98 + + thumb_func_start sub_8199DF0 +sub_8199DF0: @ 8199DF0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r2 + mov r9, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x4 + bl bg_get_field + lsls r0, 16 + movs r7, 0x40 + cmp r0, 0 + bne _08199E16 + movs r7, 0x20 +_08199E16: + adds r0, r5, 0 + movs r1, 0x1 + bl bg_get_field + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl bg_get_field + lsls r4, 16 + lsrs r4, 2 + lsls r0, 16 + lsrs r0, 16 + add r0, r8 + muls r0, r7 + adds r4, r0 + lsls r0, r6, 24 + lsls r1, r6, 16 + orrs r0, r1 + lsls r1, r6, 8 + orrs r0, r1 + orrs r0, r6 + movs r1, 0xC0 + lsls r1, 19 + adds r4, r1 + mov r2, r9 + muls r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r1, r4, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_fill + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199DF0 + + thumb_func_start box_print +box_print: @ 8199E64 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r1, 0 + ldr r6, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r1, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r4, 0 + movs r1, 0x2 + bl fbox_get_field + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x3 + bl fbox_get_field + mov r1, sp + strb r0, [r1, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r4, 0xF + strb r0, [r2, 0xC] + ldrb r2, [r6] + adds r0, r4, 0 + ands r0, r2 + ldrb r2, [r3, 0xD] + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + mov r2, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r1, r4 + orrs r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + bl remo_copy + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end box_print + + thumb_func_start sub_8199EEC +sub_8199EEC: @ 8199EEC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r1, 0 + ldr r1, [sp, 0x28] + mov r8, r1 + ldr r1, [sp, 0x2C] + mov r9, r1 + ldr r6, [sp, 0x30] + ldr r1, [sp, 0x34] + ldr r4, [sp, 0x38] + str r4, [sp] + mov r4, sp + strb r0, [r4, 0x4] + mov r0, sp + strb r5, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + mov r2, sp + ldrb r0, [r0, 0x6] + strb r0, [r2, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r2, 0x9] + mov r0, sp + mov r2, r8 + strb r2, [r0, 0xA] + mov r2, r9 + strb r2, [r0, 0xB] + ldrb r3, [r4, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r4, 0xC] + mov r3, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r5, 0xF + strb r0, [r3, 0xC] + ldrb r3, [r6] + adds r0, r5, 0 + ands r0, r3 + ldrb r3, [r4, 0xD] + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0xD] + mov r3, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r2, r5 + orrs r2, r0 + strb r2, [r3, 0xD] + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl remo_copy + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8199EEC + + thumb_func_start sub_8199F74 +sub_8199F74: @ 8199F74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r1, 0 + ldr r4, [sp, 0x2C] + ldr r1, [sp, 0x30] + mov r8, r1 + ldr r7, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + str r2, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r6, [r0, 0x5] + strb r3, [r0, 0x6] + strb r4, [r0, 0x7] + strb r3, [r0, 0x8] + strb r4, [r0, 0x9] + strb r5, [r0, 0xA] + mov r1, r9 + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r5, 0x10 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0xC] + adds r0, r6, 0 + movs r1, 0x5 + bl fbox_get_field + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r4, 0xF + adds r1, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl fbox_get_field + mov r2, sp + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r2, 0xD] + ands r5, r0 + orrs r5, r1 + strb r5, [r2, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl fbox_get_field + mov r2, sp + lsls r0, 4 + ldrb r1, [r2, 0xD] + ands r4, r1 + orrs r4, r0 + strb r4, [r2, 0xD] + mov r0, sp + mov r1, r8 + adds r2, r7, 0 + bl remo_copy + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199F74 + + thumb_func_start sub_819A024 +sub_819A024: @ 819A024 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r2, 0 + ldr r0, _0819A078 + ldr r3, [r0] + ldrb r0, [r3] + ldr r6, _0819A07C + cmp r0, 0xFF + beq _0819A04C +_0819A042: + adds r2, 0x1 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819A042 +_0819A04C: + adds r0, r6, 0 + bl ExpandTextCodes + lsls r3, r4, 24 + lsrs r3, 24 + lsls r0, r5, 24 + lsrs r0, 24 + 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, r6, 0 + bl Print + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819A078: .4byte 0x03005d90 +_0819A07C: .4byte 0x02021fc4 + thumb_func_end sub_819A024 + + thumb_func_start sub_819A080 +sub_819A080: @ 819A080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x48] + ldr r4, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + lsls r4, 16 + lsrs r4, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r2, [sp, 0x4] + ldrh r0, [r2, 0x4] + ldr r2, [sp, 0xC] + subs r0, r2 + ldr r2, [sp, 0x8] + adds r2, r1, r2 + str r2, [sp, 0x10] + cmp r0, r1 + bge _0819A0CC + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] +_0819A0CC: + ldr r2, [sp, 0x4] + ldrh r1, [r2, 0x6] + subs r0, r1, r4 + cmp r0, r5 + bge _0819A0DE + adds r0, r3, r1 + subs r0, r4 + str r0, [sp, 0x14] + b _0819A0E2 +_0819A0DE: + adds r5, r3, r5 + str r5, [sp, 0x14] +_0819A0E2: + ldr r0, [sp] + ldrh r1, [r0, 0x4] + movs r2, 0x7 + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x18] + ldr r0, [sp, 0x4] + ldrh r1, [r0, 0x4] + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x1C] + mov r12, r3 + mov r8, r4 + ldr r1, [sp, 0x14] + cmp r12, r1 + blt _0819A10C + b _0819A24A +_0819A10C: + ldr r5, [sp, 0x8] + ldr r6, [sp, 0xC] + mov r2, r12 + adds r2, 0x1 + str r2, [sp, 0x20] + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x24] + ldr r1, [sp, 0x10] + cmp r5, r1 + blt _0819A124 + b _0819A23A +_0819A124: + movs r7, 0x1 + movs r2, 0xF0 + mov r10, r2 + movs r0, 0xF + mov r9, r0 +_0819A12E: + asrs r0, r5, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp] + ldr r1, [r2] + adds r1, r0 + asrs r0, r5, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + asrs r0, r2, 3 + ldr r2, [sp, 0x18] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + lsls r0, r2, 29 + lsrs r0, 27 + adds r3, r1, r0 + asrs r0, r6, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp, 0x4] + ldr r1, [r2] + adds r1, r0 + asrs r0, r6, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + asrs r0, r2, 3 + ldr r2, [sp, 0x1C] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + lsls r0, r2, 29 + lsrs r0, 27 + adds r4, r1, r0 + adds r0, r4, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1DA + subs r4, 0x1 + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1B2 + ldrh r0, [r4] + ldr r2, _0819A1A4 + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1A8 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 8 + b _0819A22A + .align 2, 0 +_0819A1A4: .4byte 0x00000fff +_0819A1A8: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 12 + b _0819A22A +_0819A1B2: + ldrh r0, [r4] + ldr r2, _0819A1CC + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1D0 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 4 + b _0819A22A + .align 2, 0 +_0819A1CC: .4byte 0x0000f0ff +_0819A1D0: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 8 + b _0819A22A +_0819A1DA: + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A206 + ldrh r0, [r4] + ldr r2, _0819A1F8 + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1FC + ldrb r1, [r3] + mov r0, r10 + b _0819A228 + .align 2, 0 +_0819A1F8: .4byte 0x0000ff0f +_0819A1FC: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 4 + b _0819A22A +_0819A206: + ldrh r0, [r4] + ldr r2, _0819A220 + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A224 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsrs r0, 4 + b _0819A22A + .align 2, 0 +_0819A220: .4byte 0x0000fff0 +_0819A224: + ldrb r1, [r3] + mov r0, r9 +_0819A228: + ands r0, r1 +_0819A22A: + orrs r2, r0 + strh r2, [r4] + adds r5, 0x1 + adds r6, 0x1 + ldr r0, [sp, 0x10] + cmp r5, r0 + bge _0819A23A + b _0819A12E +_0819A23A: + ldr r1, [sp, 0x20] + mov r12, r1 + ldr r2, [sp, 0x24] + mov r8, r2 + ldr r0, [sp, 0x14] + cmp r12, r0 + bge _0819A24A + b _0819A10C +_0819A24A: + 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_819A080 + + thumb_func_start sub_819A25C +sub_819A25C: @ 819A25C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D30B0 + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819A25C + + thumb_func_start sub_819A27C +sub_819A27C: @ 819A27C + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r4, r3, 0 + ldr r5, [sp, 0x18] + lsls r6, 24 + lsrs r6, 24 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r2, 0x1 + bl sub_80D2EDC + adds r1, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Window_CopyWholePixelBlockToWindow + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819A27C + + thumb_func_start sub_819A2BC +sub_819A2BC: @ 819A2BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _0819A2DC + cmp r1, 0x1 + ble _0819A2D2 + cmp r1, 0x2 + beq _0819A2E4 +_0819A2D2: + ldr r0, _0819A2D8 + b _0819A2E6 + .align 2, 0 +_0819A2D8: .4byte 0x08dc4318 +_0819A2DC: + ldr r0, _0819A2E0 + b _0819A2E6 + .align 2, 0 +_0819A2E0: .4byte 0x08dc4338 +_0819A2E4: + ldr r0, _0819A2F4 +_0819A2E6: + adds r1, r2, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .align 2, 0 +_0819A2F4: .4byte 0x08dc4358 + thumb_func_end sub_819A2BC + + thumb_func_start sub_819A2F8 +sub_819A2F8: @ 819A2F8 + push {r4,r5,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, _0819A33C + lsrs r1, 22 + adds r1, r4 + ldrh r5, [r1, 0x2] + lsls r5, 5 + ldr r4, _0819A340 + adds r5, r4 + movs r4, 0x80 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + ldrb r2, [r1] + str r2, [sp, 0x10] + ldrb r1, [r1, 0x1] + str r1, [sp, 0x14] + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl Window_CopyPixelRectToWindow + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819A33C: .4byte 0x0860f0d4 +_0819A340: .4byte 0x08dc4378 + thumb_func_end sub_819A2F8 + + thumb_func_start sub_819A344 +sub_819A344: @ 819A344 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r5, r1, 0 + movs r1, 0xFC + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x1 + strb r0, [r5] + adds r5, 0x1 + strb r2, [r5] + adds r5, 0x1 + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x3 + strb r0, [r5] + adds r5, 0x1 + adds r2, 0x1 + strb r2, [r5] + adds r5, 0x1 + cmp r3, 0x4 + bhi _0819A43C + lsls r0, r3, 2 + ldr r1, _0819A380 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819A380: .4byte _0819A384 + .align 2, 0 +_0819A384: + .4byte _0819A398 + .4byte _0819A3A8 + .4byte _0819A3D6 + .4byte _0819A404 + .4byte _0819A414 +_0819A398: + ldr r0, _0819A3A4 + ldr r1, [r0] + adds r0, r5, 0 + bl gf_strcpy + b _0819A43C + .align 2, 0 +_0819A3A4: .4byte 0x03005d90 +_0819A3A8: + bl sub_809D42C + cmp r0, 0 + beq _0819A3B8 + movs r0, 0x1 + bl pokedex_count + b _0819A3BE +_0819A3B8: + movs r0, 0x1 + bl sub_80C0844 +_0819A3BE: + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r5, r0, 0 + movs r0, 0xFF + strb r0, [r5] + b _0819A43C +_0819A3D6: + ldr r4, _0819A400 + ldr r0, [r4] + ldrh r1, [r0, 0xE] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r5, r0, 0 + movs r0, 0xF0 + strb r0, [r5] + adds r5, 0x1 + ldr r0, [r4] + ldrb r1, [r0, 0x10] + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + b _0819A43C + .align 2, 0 +_0819A400: .4byte 0x03005d90 +_0819A404: + ldr r0, _0819A410 + ldrb r1, [r0, 0x14] + adds r0, r5, 0 + bl sub_81245DC + b _0819A43C + .align 2, 0 +_0819A410: .4byte 0x02037318 +_0819A414: + ldr r4, _0819A444 + movs r6, 0 + adds r7, r5, 0x1 +_0819A41A: + lsls r0, r4, 16 + lsrs r0, 16 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819A42A + adds r6, 0x1 +_0819A42A: + adds r4, 0x1 + ldr r0, _0819A448 + cmp r4, r0 + ble _0819A41A + adds r0, r6, 0 + subs r0, 0x5F + strb r0, [r5] + movs r0, 0xFF + strb r0, [r7] +_0819A43C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819A444: .4byte 0x00000867 +_0819A448: .4byte 0x0000086e + thumb_func_end sub_819A344 + + thumb_func_start sub_819A44C +sub_819A44C: @ 819A44C + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + movs r0, 0x65 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsrs r0, 24 + cmp r4, r0 + bne _0819A4BA + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819A4B0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0819A484 + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A484: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _0819A4A6 + adds r0, r5, 0 + movs r1, 0 + bl obj_anim_image_start + movs r0, 0x20 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A4A6: + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start + b _0819A4C2 +_0819A4B0: + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start_if_different + b _0819A4C2 +_0819A4BA: + adds r0, r5, 0 + movs r1, 0 + bl obj_anim_image_start_if_different +_0819A4C2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A44C + + thumb_func_start sub_819A4C8 +sub_819A4C8: @ 819A4C8 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_819A4C8 + + thumb_func_start sub_819A4E4 +sub_819A4E4: @ 819A4E4 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_819A4E4 + + thumb_func_start sub_819A4F8 +sub_819A4F8: @ 819A4F8 + push {lr} + ldr r0, _0819A50C + movs r1, 0 + str r1, [r0] + ldr r0, _0819A510 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0819A50C: .4byte 0x0300127c +_0819A510: .4byte sub_819A514 + 1 + thumb_func_end sub_819A4F8 + + thumb_func_start sub_819A514 +sub_819A514: @ 819A514 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, _0819A534 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xA + bls _0819A528 + b _0819A98E +_0819A528: + lsls r0, 2 + ldr r1, _0819A538 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819A534: .4byte 0x030022c0 +_0819A538: .4byte _0819A53C + .align 2, 0 +_0819A53C: + .4byte _0819A568 + .4byte _0819A5C0 + .4byte _0819A69C + .4byte _0819A77C + .4byte _0819A7CC + .4byte _0819A868 + .4byte _0819A8A4 + .4byte _0819A8AC + .4byte _0819A8C4 + .4byte _0819A8DC + .4byte _0819A8FC +_0819A568: + ldr r4, _0819A5B0 + ldr r0, [r4] + cmp r0, 0 + beq _0819A578 + bl free + movs r0, 0 + str r0, [r4] +_0819A578: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _0819A5B4 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0819A5B8 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r0, _0819A5BC + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + b _0819A8E6 + .align 2, 0 +_0819A5B0: .4byte 0x0203ce3c +_0819A5B4: .4byte 0x05006000 +_0819A5B8: .4byte 0x08610428 +_0819A5BC: .4byte 0x08610434 +_0819A5C0: + ldr r5, _0819A688 + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl malloc + str r0, [r5] + ldr r5, _0819A68C + adds r0, r4, 0 + bl malloc_and_clear + str r0, [r5] + ldr r5, _0819A690 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc + str r0, [r5] + ldr r5, _0819A694 + adds r0, r4, 0 + bl malloc_and_clear + str r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0 + bl lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + ldr r1, _0819A698 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .align 2, 0 +_0819A688: .4byte 0x0203ce2c +_0819A68C: .4byte 0x0203ce30 +_0819A690: .4byte 0x0203ce34 +_0819A694: .4byte 0x0203ce38 +_0819A698: .4byte 0x030022c0 +_0819A69C: + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + bl gpu_pal_allocator_reset + ldr r0, _0819A74C + ldr r5, _0819A750 + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, _0819A754 + ldr r4, _0819A758 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _0819A75C + ldr r4, _0819A760 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + ldr r0, _0819A764 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r4, _0819A768 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x8 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply + ldr r0, _0819A76C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A738 + ldr r0, _0819A770 + movs r2, 0xA9 + lsls r2, 2 + adds r1, r2 + ldrh r1, [r1] + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + strh r1, [r0] +_0819A738: + ldr r0, _0819A774 + movs r1, 0x20 + movs r2, 0x4 + bl gpu_pal_apply + ldr r1, _0819A778 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .align 2, 0 +_0819A74C: .4byte 0x08dc0754 +_0819A750: .4byte 0x0203ce2c +_0819A754: .4byte 0x0861033c +_0819A758: .4byte 0x0203ce30 +_0819A75C: .4byte 0x08dc0b94 +_0819A760: .4byte 0x0203ce34 +_0819A764: .4byte 0x08dc0714 +_0819A768: .4byte 0x0861046c +_0819A76C: .4byte 0x0300127c +_0819A770: .4byte 0x02037714 +_0819A774: .4byte 0x0861039c +_0819A778: .4byte 0x030022c0 +_0819A77C: + ldr r0, _0819A7C4 + ldr r1, [r0] + movs r0, 0x3 + bl bg_set_tilemap + ldr r5, _0819A7C8 + movs r4, 0x8 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0xB + movs r3, 0x4 + bl gpu_copy_to_iwram_tile_map_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x4 + bl gpu_copy_to_iwram_tile_map_rect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x14 + movs r3, 0x4 + bl gpu_copy_to_iwram_tile_map_rect + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0819A8E6 + .align 2, 0 +_0819A7C4: .4byte 0x0203ce38 +_0819A7C8: .4byte 0x0861023c +_0819A7CC: + ldr r0, _0819A838 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0819A83C + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _0819A840 + bl gpu_tile_obj_decompress_and_load + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + ldr r0, _0819A844 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + ldr r0, _0819A848 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A854 + movs r0, 0x58 + movs r1, 0x98 + movs r2, 0x20 + movs r3, 0x60 + bl sub_819C5D0 + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r1, _0819A84C + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0819A850 + movs r0, 0x52 + bl lcd_io_set + b _0819A85A + .align 2, 0 +_0819A838: .4byte 0x086103f4 +_0819A83C: .4byte 0x086103bc +_0819A840: .4byte 0x086103e4 +_0819A844: .4byte sub_819A4E4 + 1 +_0819A848: .4byte 0x0300127c +_0819A84C: .4byte 0x00001248 +_0819A850: .4byte 0x0000040b +_0819A854: + movs r0, 0x3 + bl gpu_sync_bg_hide +_0819A85A: + ldr r1, _0819A864 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .align 2, 0 +_0819A864: .4byte 0x030022c0 +_0819A868: + ldr r4, _0819A898 + ldr r1, [r4] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A878 + ldr r0, _0819A89C + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819A878: + bl sub_819A9AC + bl sub_819AA18 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A88C + bl sub_819BE34 +_0819A88C: + ldr r1, _0819A8A0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .align 2, 0 +_0819A898: .4byte 0x0300127c +_0819A89C: .4byte 0x0203cf20 +_0819A8A0: .4byte 0x030022c0 +_0819A8A4: + bl sub_819BA64 + movs r0, 0x2 + b _0819A8E2 +_0819A8AC: + bl sub_819BCF8 + movs r0, 0x5 + bl Window_WriteStandardTileMap + ldr r1, _0819A8C0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .align 2, 0 +_0819A8C0: .4byte 0x030022c0 +_0819A8C4: + bl sub_819B9E8 + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r1, _0819A8D8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .align 2, 0 +_0819A8D8: .4byte 0x030022c0 +_0819A8DC: + bl sub_819B9B4 + movs r0, 0 +_0819A8E2: + bl Window_WriteStandardTileMap +_0819A8E6: + ldr r1, _0819A8F8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819A8EE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819A98E + .align 2, 0 +_0819A8F8: .4byte 0x030022c0 +_0819A8FC: + ldr r0, _0819A940 + movs r1, 0 + bl AddTask + ldr r2, _0819A944 + ldr r1, [r2] + ldr r3, _0819A948 + adds r1, r3 + strb r0, [r1] + ldr r3, [r2] + ldrb r5, [r3, 0x6] + cmp r5, 0 + bne _0819A954 + ldr r4, _0819A94C + ldr r1, _0819A948 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, _0819A950 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819A988 + .align 2, 0 +_0819A940: .4byte sub_819C69C + 1 +_0819A944: .4byte 0x0300127c +_0819A948: .4byte 0x000002a1 +_0819A94C: .4byte 0x03005e00 +_0819A950: .4byte sub_819B378 + 1 +_0819A954: + ldr r4, _0819A998 + ldr r2, _0819A99C + adds r0, r3, r2 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, _0819A9A0 + adds r0, r3, r1 + strb r2, [r0] + ldr r0, _0819A9A4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xD + strh r1, [r0, 0x8] +_0819A988: + ldr r0, _0819A9A8 + bl set_callback2 +_0819A98E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819A998: .4byte 0x03005e00 +_0819A99C: .4byte 0x000002a1 +_0819A9A0: .4byte 0x000002a2 +_0819A9A4: .4byte sub_819B124 + 1 +_0819A9A8: .4byte sub_819A4C8 + 1 + thumb_func_end sub_819A514 + + thumb_func_start sub_819A9AC +sub_819A9AC: @ 819A9AC + push {r4,r5,lr} + ldr r5, _0819AA00 + ldr r4, [r5] + cmp r4, 0 + bne _0819AA12 + movs r0, 0xAB + lsls r0, 2 + bl malloc_and_clear + str r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, [r5] + strb r4, [r0, 0x6] + movs r2, 0 + movs r4, 0x6C + movs r3, 0 +_0819A9D2: + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + strb r3, [r0, 0x10] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819A9D2 + ldr r0, _0819AA04 + ldr r0, [r0] + ldr r1, _0819AA08 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _0819AA0C + movs r0, 0 + bl sub_819B484 + b _0819AA12 + .align 2, 0 +_0819AA00: .4byte 0x0300127c +_0819AA04: .4byte 0x03005d90 +_0819AA08: .4byte 0x00000ca9 +_0819AA0C: + movs r0, 0 + bl sub_819B63C +_0819AA12: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A9AC + + thumb_func_start sub_819AA18 +sub_819AA18: @ 819AA18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + mov r8, r4 + ldr r7, _0819AB28 +_0819AA24: + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + subs r1, r4 + adds r1, 0x20 + lsls r1, 16 + asrs r1, 16 + ldr r0, _0819AB2C + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r6, _0819AB30 + ldr r2, [r6] + movs r5, 0x6C + adds r1, r4, 0 + muls r1, r5 + adds r2, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r2, 0xE] + ldrh r1, [r2, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r8 + strh r1, [r0, 0x2E] + adds r0, r4, 0 + bl sub_819ADAC + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AA24 + ldr r0, [r6] + ldrb r1, [r0, 0x3] + ldr r4, _0819AB28 + muls r1, r5 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, _0819AB34 + movs r2, 0x20 + ldrsh r1, [r1, r2] + movs r2, 0x58 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r6] + movs r5, 0 + strb r0, [r1, 0x4] + ldr r0, _0819AB38 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r6] + strb r0, [r1, 0x1] + ldr r0, _0819AB3C + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r6] + strb r0, [r1, 0x2] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + 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, [r6] + ldrb r1, [r0, 0x2] + 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, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819AB28: .4byte 0x02020630 +_0819AB2C: .4byte 0x086105d8 +_0819AB30: .4byte 0x0300127c +_0819AB34: .4byte 0x086105f0 +_0819AB38: .4byte 0x08610608 +_0819AB3C: .4byte 0x08610620 + thumb_func_end sub_819AA18 + + thumb_func_start sub_819AB40 +sub_819AB40: @ 819AB40 + push {r4-r6,lr} + movs r4, 0 +_0819AB44: + ldr r6, _0819ABA0 + ldr r1, [r6] + movs r0, 0x6C + muls r0, r4 + adds r1, r0 + ldrh r1, [r1, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _0819ABA4 + adds r0, r5 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AB44 + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819ABA0: .4byte 0x0300127c +_0819ABA4: .4byte 0x02020630 + thumb_func_end sub_819AB40 + + thumb_func_start sub_819ABA8 +sub_819ABA8: @ 819ABA8 + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + ble _0819ABC8 + ldr r0, _0819ABC0 + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0x5 + beq _0819ABC4 + adds r0, r3, 0x1 + b _0819ABDE + .align 2, 0 +_0819ABC0: .4byte 0x0300127c +_0819ABC4: + movs r0, 0 + b _0819ABDE +_0819ABC8: + ldr r0, _0819ABD8 + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ABDC + subs r0, r3, 0x1 + b _0819ABDE + .align 2, 0 +_0819ABD8: .4byte 0x0300127c +_0819ABDC: + movs r0, 0x5 +_0819ABDE: + strb r0, [r1, 0x3] + ldr r2, [r2] + ldrb r3, [r2, 0x3] + ldr r4, _0819AC0C + ldrb r0, [r2, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r0, 0x6C + muls r0, r3 + adds r2, r0 + ldrh r2, [r2, 0xE] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819AC0C: .4byte 0x02020630 + thumb_func_end sub_819ABA8 + + thumb_func_start sub_819AC10 +sub_819AC10: @ 819AC10 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC30 + ldr r0, _0819AC28 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819AC2C + adds r0, r3, 0x1 + b _0819AC46 + .align 2, 0 +_0819AC28: .4byte 0x0300127c +_0819AC2C: + movs r0, 0 + b _0819AC46 +_0819AC30: + ldr r0, _0819AC40 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819AC44 + subs r0, r3, 0x1 + b _0819AC46 + .align 2, 0 +_0819AC40: .4byte 0x0300127c +_0819AC44: + movs r0, 0x2 +_0819AC46: + strb r0, [r1] + ldr r3, _0819AC74 + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .align 2, 0 +_0819AC74: .4byte 0x02020630 + thumb_func_end sub_819AC10 + + thumb_func_start sub_819AC78 +sub_819AC78: @ 819AC78 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC98 + ldr r0, _0819AC90 + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819AC94 + adds r0, r3, 0x1 + b _0819ACAE + .align 2, 0 +_0819AC90: .4byte 0x0300127c +_0819AC94: + movs r0, 0 + b _0819ACAE +_0819AC98: + ldr r0, _0819ACA8 + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ACAC + subs r0, r3, 0x1 + b _0819ACAE + .align 2, 0 +_0819ACA8: .4byte 0x0300127c +_0819ACAC: + movs r0, 0x1 +_0819ACAE: + strb r0, [r1, 0x7] + ldr r3, _0819ACDC + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .align 2, 0 +_0819ACDC: .4byte 0x02020630 + thumb_func_end sub_819AC78 + + thumb_func_start sub_819ACE0 +sub_819ACE0: @ 819ACE0 + push {r4-r6,lr} + ldr r5, _0819AD5C + ldr r0, [r5] + ldrb r6, [r0, 0x3] + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r0, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819AD60 + movs r0, 0x64 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, [r5] + ldrb r0, [r1, 0x5] + cmp r0, 0x3 + bne _0819AD44 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819AD44 + movs r2, 0 + ldrb r0, [r1, 0x10] + cmp r0, 0x2 + beq _0819AD32 + movs r4, 0x6C +_0819AD1A: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bhi _0819AD32 + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0x2 + bne _0819AD1A +_0819AD32: + cmp r2, 0x6 + beq _0819AD9C + ldr r0, _0819AD5C + ldr r1, [r0] + movs r0, 0x6C + muls r0, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1, 0x10] +_0819AD44: + ldr r2, _0819AD5C + ldr r1, [r2] + movs r0, 0x6C + muls r0, r6 + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x10] + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + b _0819AD78 + .align 2, 0 +_0819AD5C: .4byte 0x0300127c +_0819AD60: + movs r0, 0x65 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r5] + adds r1, r0, r4 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x10] + ldr r1, [r5] + ldrb r0, [r1, 0x5] + adds r0, 0x1 +_0819AD78: + strb r0, [r1, 0x5] + ldr r2, _0819ADA4 + ldr r0, _0819ADA8 + ldr r0, [r0] + movs r1, 0x6C + muls r1, r6 + adds r0, r1 + ldrh r0, [r0, 0xE] + 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] +_0819AD9C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819ADA4: .4byte 0x02020630 +_0819ADA8: .4byte 0x0300127c + thumb_func_end sub_819ACE0 + + thumb_func_start sub_819ADAC +sub_819ADAC: @ 819ADAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0819ADC8 + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819ADCC + movs r0, 0x65 + b _0819ADCE + .align 2, 0 +_0819ADC8: .4byte 0x0300127c +_0819ADCC: + movs r0, 0x64 +_0819ADCE: + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, _0819AE00 + ldr r0, _0819AE04 + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrh r0, [r0, 0xE] + 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] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819AE00: .4byte 0x02020630 +_0819AE04: .4byte 0x0300127c + thumb_func_end sub_819ADAC + + thumb_func_start sub_819AE08 +sub_819AE08: @ 819AE08 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0819AE2C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819AE64 + cmp r0, 0x7 + bgt _0819AE30 + cmp r0, 0x6 + beq _0819AE36 + b _0819AF50 + .align 2, 0 +_0819AE2C: .4byte 0x03005e00 +_0819AE30: + cmp r0, 0x8 + beq _0819AEE8 + b _0819AF50 +_0819AE36: + ldr r1, _0819AE5C + ldr r0, _0819AE60 + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + adds r1, r2 + movs r2, 0 + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819AF50 + .align 2, 0 +_0819AE5C: .4byte 0x02037714 +_0819AE60: .4byte 0x02037b14 +_0819AE64: + ldr r0, _0819AECC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819AF50 + ldr r4, _0819AED0 + ldr r0, [r4] + ldr r2, _0819AED4 + adds r0, r2 + ldrb r0, [r0] + bl remove_task + ldr r1, [r4] + movs r3, 0xA6 + lsls r3, 2 + adds r0, r1, r3 + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + bl sub_819F444 + bl sub_819AB40 + ldr r4, _0819AED8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819AEDC + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819AEE0 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819AEE4 + ldr r0, [r4] + bl free + str r5, [r4] + bl Window_FreeMemory + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819AF50 + .align 2, 0 +_0819AECC: .4byte 0x02037fd4 +_0819AED0: .4byte 0x0300127c +_0819AED4: .4byte 0x000002a1 +_0819AED8: .4byte 0x0203ce2c +_0819AEDC: .4byte 0x0203ce30 +_0819AEE0: .4byte 0x0203ce34 +_0819AEE4: .4byte 0x0203ce38 +_0819AEE8: + ldr r4, _0819AF58 + ldr r1, [r4] + ldr r0, _0819AF5C + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0xDC + adds r1, r3 + strh r0, [r1] + adds r0, r2, 0 + bl remove_task + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x6] + ldr r0, [r4] + ldrb r6, [r0, 0x3] + ldr r4, _0819AF60 + movs r0, 0x96 + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + movs r4, 0 +_0819AF1A: + ldr r5, _0819AF60 + ldr r1, [r5] + movs r0, 0x64 + muls r0, r4 + adds r0, r1 + ldr r1, _0819AF58 + ldr r1, [r1] + movs r2, 0x6C + muls r2, r4 + adds r1, r2 + adds r1, 0x14 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AF1A + ldr r1, [r5] + ldr r0, _0819AF64 + str r0, [sp] + movs r0, 0x1 + adds r2, r6, 0 + movs r3, 0x5 + bl sub_81BF8EC +_0819AF50: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819AF58: .4byte 0x0300127c +_0819AF5C: .4byte 0x02037714 +_0819AF60: .4byte 0x0203ce3c +_0819AF64: .4byte sub_819A514 + 1 + thumb_func_end sub_819AE08 + + thumb_func_start bc_exit_to_overworld +bc_exit_to_overworld: @ 819AF68 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _0819AF98 + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B00E + ldr r1, _0819AF9C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _0819AFA0 + cmp r1, 0x1 + beq _0819AFB8 + b _0819B00E + .align 2, 0 +_0819AF98: .4byte 0x0300127c +_0819AF9C: .4byte 0x03005e00 +_0819AFA0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819B00E +_0819AFB8: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819B00E + bl sub_819B764 + ldr r0, [r7] + ldr r1, _0819B018 + adds r0, r1 + ldrb r0, [r0] + bl remove_task + bl sub_819AB40 + ldr r4, _0819B01C + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819B020 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819B024 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r0, [r7] + bl free + str r5, [r7] + bl Window_FreeMemory + ldr r0, _0819B028 + bl set_callback2 + adds r0, r6, 0 + bl remove_task +_0819B00E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819B018: .4byte 0x000002a1 +_0819B01C: .4byte 0x0203ce2c +_0819B020: .4byte 0x0203ce34 +_0819B024: .4byte 0x0203ce38 +_0819B028: .4byte sub_80861B0 + 1 + thumb_func_end bc_exit_to_overworld + + thumb_func_start sub_819B02C +sub_819B02C: @ 819B02C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, _0819B064 + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B11A + ldr r1, _0819B068 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + beq _0819B084 + cmp r0, 0x5 + bgt _0819B06C + cmp r0, 0x4 + beq _0819B07A + b _0819B11A + .align 2, 0 +_0819B064: .4byte 0x0300127c +_0819B068: .4byte 0x03005e00 +_0819B06C: + cmp r0, 0xA + bne _0819B11A + bl sub_819C4B4 + movs r0, 0x4 + strh r0, [r5, 0x8] + b _0819B11A +_0819B07A: + bl sub_819B8D4 + movs r0, 0x5 + strh r0, [r5, 0x8] + b _0819B11A +_0819B084: + ldr r2, _0819B0B0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B0B8 + movs r0, 0x5 + bl audio_play + ldr r0, [r7] + ldrb r4, [r0, 0x7] + cmp r4, 0 + bne _0819B0C6 + bl sub_819C568 + strh r4, [r5, 0x8] + ldr r0, _0819B0B4 + str r0, [r5] + b _0819B11A + .align 2, 0 +_0819B0B0: .4byte 0x030022c0 +_0819B0B4: .4byte bc_exit_to_overworld + 1 +_0819B0B8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B0EC + movs r0, 0x5 + bl audio_play +_0819B0C6: + movs r0, 0x4 + bl sub_819B958 + bl sub_819BC9C + ldr r0, [r7] + ldr r1, _0819B0E4 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + strh r6, [r5, 0x8] + ldr r0, _0819B0E8 + str r0, [r5] + b _0819B11A + .align 2, 0 +_0819B0E4: .4byte 0x000002a2 +_0819B0E8: .4byte sub_819B378 + 1 +_0819B0EC: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B106 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl sub_819AC78 + b _0819B11A +_0819B106: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B11A + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl sub_819AC78 +_0819B11A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B02C + + thumb_func_start sub_819B124 +sub_819B124: @ 819B124 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0819B150 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + subs r0, 0x2 + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0xB + bls _0819B144 + b _0819B36E +_0819B144: + lsls r0, 2 + ldr r1, _0819B154 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819B150: .4byte 0x03005e00 +_0819B154: .4byte _0819B158 + .align 2, 0 +_0819B158: + .4byte _0819B188 + .4byte _0819B1EC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B1BC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B300 + .4byte _0819B35C +_0819B188: + ldr r0, _0819B1B0 + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B1A2 + ldr r2, _0819B1B4 + adds r0, r1, r2 + movs r7, 0xA8 + lsls r7, 2 + adds r1, r7 + movs r2, 0 + bl sub_819F2B4 +_0819B1A2: + ldr r0, _0819B1B8 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0819B36C + .align 2, 0 +_0819B1B0: .4byte 0x0300127c +_0819B1B4: .4byte 0x00000299 +_0819B1B8: .4byte 0x03005e00 +_0819B1BC: + ldr r4, _0819B1E4 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819B1CE + b _0819B36E +_0819B1CE: + bl sub_819B844 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r1, _0819B1E8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + b _0819B344 + .align 2, 0 +_0819B1E4: .4byte 0x0300127c +_0819B1E8: .4byte 0x03005e00 +_0819B1EC: + ldr r2, _0819B21C + ldrh r1, [r2, 0x2E] + movs r7, 0x1 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B27C + movs r0, 0x5 + bl audio_play + bl sub_819BC04 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + bne _0819B228 + ldr r0, _0819B220 + ldr r0, [r0] + ldr r2, _0819B224 + adds r0, r2 + b _0819B2AC + .align 2, 0 +_0819B21C: .4byte 0x030022c0 +_0819B220: .4byte 0x0300127c +_0819B224: .4byte 0x000002a2 +_0819B228: + cmp r0, 0x2 + bne _0819B248 + ldr r1, _0819B240 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + strh r1, [r0, 0x8] + ldr r1, _0819B244 + str r1, [r0] + b _0819B36E + .align 2, 0 +_0819B240: .4byte 0x03005e00 +_0819B244: .4byte sub_819B02C + 1 +_0819B248: + cmp r1, 0x3 + bne _0819B260 + ldr r1, _0819B25C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xB + strh r1, [r0, 0x8] + b _0819B2BA + .align 2, 0 +_0819B25C: .4byte 0x03005e00 +_0819B260: + ldr r1, _0819B274 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0x8] + ldr r1, _0819B278 + str r1, [r0] + b _0819B36E + .align 2, 0 +_0819B274: .4byte 0x03005e00 +_0819B278: .4byte sub_819AE08 + 1 +_0819B27C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B2D0 + movs r0, 0x5 + bl audio_play + ldr r4, _0819B2C0 + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldr r1, _0819B2C4 + adds r0, r1 +_0819B2AC: + strb r7, [r0] + ldr r1, _0819B2C8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] +_0819B2BA: + ldr r1, _0819B2CC + str r1, [r0] + b _0819B36E + .align 2, 0 +_0819B2C0: .4byte 0x0300127c +_0819B2C4: .4byte 0x000002a2 +_0819B2C8: .4byte 0x03005e00 +_0819B2CC: .4byte sub_819B378 + 1 +_0819B2D0: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B2EA + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl sub_819AC10 + b _0819B36E +_0819B2EA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B36E + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl sub_819AC10 + b _0819B36E +_0819B300: + ldr r0, _0819B34C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0819B36E + ldr r4, _0819B350 + ldr r2, [r4] + ldrb r0, [r2, 0x6] + cmp r0, 0x1 + bne _0819B338 + ldr r1, _0819B354 + movs r7, 0xA9 + lsls r7, 2 + adds r0, r2, r7 + ldrh r0, [r0] + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + ldr r0, _0819B358 + subs r7, 0xBC + adds r1, r0, r7 + ldrh r1, [r1] + adds r0, r2 + strh r1, [r0] +_0819B338: + ldr r0, [r4] + strb r3, [r0, 0x6] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 +_0819B344: + movs r1, 0x3 + strh r1, [r0, 0x8] + b _0819B36E + .align 2, 0 +_0819B34C: .4byte 0x02037fd4 +_0819B350: .4byte 0x0300127c +_0819B354: .4byte 0x02037b14 +_0819B358: .4byte 0x02037714 +_0819B35C: + bl sub_819B844 + ldr r0, _0819B374 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0xC +_0819B36C: + strh r0, [r1, 0x8] +_0819B36E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819B374: .4byte 0x03005e00 + thumb_func_end sub_819B124 + + thumb_func_start sub_819B378 +sub_819B378: @ 819B378 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r5, _0819B3AC + ldr r3, [r5] + movs r7, 0xA8 + lsls r7, 2 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B476 + ldr r1, _0819B3B0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819B3DC + cmp r1, 0x1 + bgt _0819B3B4 + cmp r1, 0 + beq _0819B3BA + b _0819B476 + .align 2, 0 +_0819B3AC: .4byte 0x0300127c +_0819B3B0: .4byte 0x03005e00 +_0819B3B4: + cmp r1, 0xB + beq _0819B440 + b _0819B476 +_0819B3BA: + ldr r0, _0819B3D4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819B476 + movs r0, 0x1 + movs r1, 0x1 + strh r1, [r4, 0x8] + ldr r2, _0819B3D8 + adds r1, r3, r2 + strb r0, [r1] + b _0819B476 + .align 2, 0 +_0819B3D4: .4byte 0x02037fd4 +_0819B3D8: .4byte 0x000002a2 +_0819B3DC: + ldr r2, _0819B400 + ldrh r0, [r2, 0x2E] + ands r1, r0 + cmp r1, 0 + beq _0819B40C + movs r0, 0x5 + bl audio_play + ldr r0, [r5] + ldr r1, _0819B404 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r0, _0819B408 + str r0, [r4] + b _0819B476 + .align 2, 0 +_0819B400: .4byte 0x030022c0 +_0819B404: .4byte 0x000002a2 +_0819B408: .4byte sub_819B124 + 1 +_0819B40C: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819B422 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _0819B432 +_0819B422: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_0819B432: + bl sub_819ABA8 + bl sub_819BCF8 + bl sub_819B9E8 + b _0819B476 +_0819B440: + ldr r0, _0819B47C + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl audio_play + ldr r1, [r5] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r1, r7 + movs r2, 0 + bl sub_819F3F8 + bl sub_819BA64 + ldr r0, [r5] + ldr r1, _0819B480 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r6, [r4, 0x8] +_0819B476: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819B47C: .4byte 0x030022c0 +_0819B480: .4byte 0x000002a2 + thumb_func_end sub_819B378 + + thumb_func_start sub_819B484 +sub_819B484: @ 819B484 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + movs r6, 0 + add r0, sp, 0xC + strb r6, [r0] + ldr r0, _0819B554 + bl var_get + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r7, _0819B558 + ldr r2, [r7] + ldr r0, _0819B55C + adds r4, r2, r0 + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + ldr r1, _0819B560 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + ldr r1, _0819B564 + ldr r0, _0819B568 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r2, 0x32 + str r2, [sp, 0x14] + cmp r0, 0 + beq _0819B4EA + movs r3, 0x64 + str r3, [sp, 0x14] +_0819B4EA: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + ldr r1, [r7] + ldrb r0, [r1, 0xA] + mov r9, r0 + ldrb r0, [r1, 0xB] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r9, r2 + movs r3, 0 + mov r8, r3 +_0819B518: + ldr r0, _0819B558 + ldr r1, [r0] + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r5, [r1] + ldr r0, _0819B56C + ldr r1, [r0] + ldr r2, [sp, 0x10] + add r2, r8 + movs r3, 0x6C + adds r0, r2, 0 + muls r0, r3 + adds r1, r0 + strh r5, [r1, 0xC] + mov r10, r2 + ldr r0, [sp, 0x1C] + cmp r8, r0 + bcs _0819B570 + ldr r0, [sp, 0x18] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _0819B572 + .align 2, 0 +_0819B554: .4byte 0x000040ce +_0819B558: .4byte 0x03005d90 +_0819B55C: .4byte 0x00000ca9 +_0819B560: .4byte 0x00000de2 +_0819B564: .4byte 0x0203bc8c +_0819B568: .4byte 0x085d97bc +_0819B56C: .4byte 0x0300127c +_0819B570: + ldr r0, [sp, 0x18] +_0819B572: + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x6C + mov r4, r10 + muls r4, r1 + adds r4, 0xC + ldr r2, _0819B630 + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, _0819B634 + ldr r2, [r1] + lsls r5, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r6, 0 + adds r7, r5, 0 + movs r3, 0x1 + add r8, r3 + ldr r3, _0819B630 +_0819B5B8: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x8 + ldr r5, _0819B634 + ldr r1, [r5] + adds r1, r7, r1 + lsls r2, r6, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r6, 0 + str r3, [sp, 0x20] + bl sub_81A7024 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x20] + cmp r6, 0x3 + bls _0819B5B8 + movs r0, 0x6C + mov r4, r10 + muls r4, r0 + adds r4, 0xC + ldr r1, _0819B630 + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r2, _0819B630 + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, [r5] + adds r1, r7, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, _0819B638 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + mov r3, r8 + lsls r0, r3, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x5 + bhi _0819B620 + b _0819B518 +_0819B620: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819B630: .4byte 0x0300127c +_0819B634: .4byte 0x0203bc8c +_0819B638: .4byte 0x085cecb0 + thumb_func_end sub_819B484 + + thumb_func_start sub_819B63C +sub_819B63C: @ 819B63C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + add r0, sp, 0xC + movs r1, 0 + strb r1, [r0] + ldr r2, _0819B750 + ldr r0, _0819B754 + str r0, [r2] + ldr r0, _0819B758 + ldr r1, [r0] + ldrb r3, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r3, r0 + mov r10, r3 + movs r7, 0 + mov r9, r7 +_0819B678: + ldr r0, _0819B758 + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 1 + add r0, r9 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r1, [r1] + mov r8, r1 + ldr r7, _0819B75C + ldr r0, [r7] + ldr r6, [sp, 0x10] + add r6, r9 + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r1, r0, r4 + mov r2, r8 + strh r2, [r1, 0xC] + adds r4, 0xC + adds r0, r4 + adds r0, 0x8 + ldr r3, _0819B750 + ldr r2, [r3] + mov r7, r8 + lsls r5, r7, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + add r0, sp, 0xC + movs r3, 0 + strb r3, [r0] + movs r0, 0x1 + add r9, r0 +_0819B6D4: + ldr r1, _0819B75C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + ldr r3, _0819B750 + ldr r2, [r3] + mov r3, r8 + lsls r1, r3, 4 + adds r1, r2 + lsls r2, r7, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r7, 0 + bl sub_81A7024 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _0819B6D4 + movs r7, 0x6C + adds r4, r6, 0 + muls r4, r7 + adds r4, 0xC + ldr r1, _0819B75C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r2, _0819B75C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r3, _0819B750 + ldr r1, [r3] + adds r1, r5, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, _0819B760 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + mov r7, r9 + lsls r0, r7, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x5 + bls _0819B678 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819B750: .4byte 0x0203bc8c +_0819B754: .4byte 0x085de02c +_0819B758: .4byte 0x03005d90 +_0819B75C: .4byte 0x0300127c +_0819B760: .4byte 0x085cecb0 + thumb_func_end sub_819B63C + + thumb_func_start sub_819B764 +sub_819B764: @ 819B764 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r7, 0 + ldr r0, _0819B804 + mov r10, r0 + ldr r1, _0819B808 + mov r8, r1 +_0819B778: + movs r2, 0 + adds r0, r7, 0x1 + mov r9, r0 +_0819B77E: + mov r1, r10 + ldr r0, [r1] + movs r1, 0x6C + adds r6, r2, 0 + muls r6, r1 + adds r1, r0, r6 + ldrb r0, [r1, 0x10] + cmp r0, r9 + bne _0819B81C + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r2, _0819B80C + adds r5, r2 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + mov r0, r8 + ldr r1, [r0] + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r1, r4 + mov r2, r10 + ldr r0, [r2] + adds r0, r6 + ldrh r0, [r0, 0xC] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r2, r8 + ldr r1, [r2] + ldr r2, _0819B810 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, _0819B814 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, _0819B818 + adds r1, r2 + strb r0, [r1] + b _0819B826 + .align 2, 0 +_0819B804: .4byte 0x0300127c +_0819B808: .4byte 0x03005d90 +_0819B80C: .4byte 0x020244ec +_0819B810: .4byte 0x00000e74 +_0819B814: .4byte 0x00000e79 +_0819B818: .4byte 0x00000e78 +_0819B81C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819B77E +_0819B826: + mov r1, r9 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819B778 + bl calc_player_party_count + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B764 + + thumb_func_start sub_819B844 +sub_819B844: @ 819B844 + push {r4,r5,lr} + ldr r5, _0819B8CC + ldr r1, [r5] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B852 + strb r0, [r1] +_0819B852: + ldr r4, _0819B8D0 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + 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] + ldrb r1, [r0, 0x2] + 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] + bl sub_819BAFC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819B8CC: .4byte 0x0300127c +_0819B8D0: .4byte 0x02020630 + thumb_func_end sub_819B844 + + thumb_func_start sub_819B8D4 +sub_819B8D4: @ 819B8D4 + push {r4,r5,lr} + ldr r5, _0819B950 + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x7] + ldr r4, _0819B954 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + 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] + ldrb r1, [r0, 0x2] + 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] + bl sub_819BBA8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819B950: .4byte 0x0300127c +_0819B954: .4byte 0x02020630 + thumb_func_end sub_819B8D4 + + thumb_func_start sub_819B958 +sub_819B958: @ 819B958 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0819B9AC + ldr r3, _0819B9B0 + ldr r0, [r3] + ldrb r1, [r0, 0x1] + 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] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + adds r0, r4, 0 + bl Window_FillTileMap + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819B9AC: .4byte 0x02020630 +_0819B9B0: .4byte 0x0300127c + thumb_func_end sub_819B958 + + thumb_func_start sub_819B9B4 +sub_819B9B4: @ 819B9B4 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl Window_FastFillPixels + ldr r2, _0819B9E4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_0819B9E4: .4byte 0x085eebb2 + thumb_func_end sub_819B9B4 + + thumb_func_start sub_819B9E8 +sub_819B9E8: @ 819B9E8 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, _0819BA54 + ldr r0, [r5] + ldrb r4, [r0, 0x3] + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r4, _0819BA58 + movs r1, 0xB + muls r1, r0 + ldr r0, _0819BA5C + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0819BA60 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819BA54: .4byte 0x0300127c +_0819BA58: .4byte 0x02021fc4 +_0819BA5C: .4byte 0x083185c8 +_0819BA60: .4byte 0x08610479 + thumb_func_end sub_819B9E8 + + thumb_func_start sub_819BA64 +sub_819BA64: @ 819BA64 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _0819BA80 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x1 + bne _0819BA88 + ldr r2, _0819BA84 + b _0819BA9C + .align 2, 0 +_0819BA80: .4byte 0x0300127c +_0819BA84: .4byte 0x085eebc1 +_0819BA88: + cmp r0, 0x2 + bne _0819BA94 + ldr r2, _0819BA90 + b _0819BA9C + .align 2, 0 +_0819BA90: .4byte 0x085eebdb +_0819BA94: + ldr r2, _0819BAC0 + cmp r0, 0x3 + bne _0819BA9C + ldr r2, _0819BAC4 +_0819BA9C: + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_0819BAC0: .4byte 0x085eec2d +_0819BAC4: .4byte 0x085eebf6 + thumb_func_end sub_819BA64 + + thumb_func_start sub_819BAC8 +sub_819BAC8: @ 819BAC8 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + ldr r2, _0819BAF8 + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_0819BAF8: .4byte 0x085eec50 + thumb_func_end sub_819BAC8 + + thumb_func_start sub_819BAFC +sub_819BAFC: @ 819BAFC + push {r4-r6,lr} + sub sp, 0xC + ldr r0, _0819BB50 + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r5, [r0, 0x10] + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x3 + movs r1, 0 + bl Window_FastFillPixels + ldr r4, _0819BB54 + str r4, [sp] + movs r6, 0 + str r6, [sp, 0x4] + ldr r0, _0819BB58 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + cmp r5, 0 + beq _0819BB60 + str r4, [sp] + str r6, [sp, 0x4] + ldr r0, _0819BB5C + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + b _0819BB74 + .align 2, 0 +_0819BB50: .4byte 0x0300127c +_0819BB54: .4byte 0x08610476 +_0819BB58: .4byte 0x085eec15 +_0819BB5C: .4byte 0x085eec24 +_0819BB60: + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, _0819BB9C + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print +_0819BB74: + ldr r0, _0819BBA0 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, _0819BBA4 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819BB9C: .4byte 0x085eec10 +_0819BBA0: .4byte 0x08610476 +_0819BBA4: .4byte 0x085eec1d + thumb_func_end sub_819BAFC + + thumb_func_start sub_819BBA8 +sub_819BBA8: @ 819BBA8 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0x4 + movs r1, 0 + bl Window_FastFillPixels + ldr r5, _0819BBF8 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, _0819BBFC + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0819BC00 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819BBF8: .4byte 0x08610476 +_0819BBFC: .4byte 0x085eec49 +_0819BC00: .4byte 0x085eec4d + thumb_func_end sub_819BBA8 + + thumb_func_start sub_819BC04 +sub_819BC04: @ 819BC04 + push {lr} + ldr r2, _0819BC24 + ldr r1, _0819BC28 + ldr r0, _0819BC2C + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0819BC24: .4byte 0x030062e8 +_0819BC28: .4byte 0x0861041c +_0819BC2C: .4byte 0x0300127c + thumb_func_end sub_819BC04 + + thumb_func_start sub_819BC30 +sub_819BC30: @ 819BC30 + push {r4,lr} + ldr r0, _0819BC5C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r1, [r0, 0x10] + ldrh r0, [r0, 0xC] + cmp r1, 0 + bne _0819BC60 + bl sub_819C634 + cmp r0, 0 + bne _0819BC60 + bl sub_819BAC8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x3 + b _0819BC96 + .align 2, 0 +_0819BC5C: .4byte 0x0300127c +_0819BC60: + ldr r4, _0819BC90 + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BC94 + movs r0, 0x1 + b _0819BC96 + .align 2, 0 +_0819BC90: .4byte 0x0300127c +_0819BC94: + movs r0, 0x2 +_0819BC96: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_819BC30 + + thumb_func_start sub_819BC9C +sub_819BC9C: @ 819BC9C + push {lr} + bl sub_819C568 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, _0819BCC0 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BCC4 + movs r0, 0x1 + b _0819BCC6 + .align 2, 0 +_0819BCC0: .4byte 0x0300127c +_0819BCC4: + movs r0, 0x2 +_0819BCC6: + pop {r1} + bx r1 + thumb_func_end sub_819BC9C + + thumb_func_start sub_819BCCC +sub_819BCCC: @ 819BCCC + movs r0, 0 + bx lr + thumb_func_end sub_819BCCC + + thumb_func_start sub_819BCD0 +sub_819BCD0: @ 819BCD0 + push {lr} + ldr r0, _0819BCF4 + ldr r1, [r0] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0819BCF4: .4byte 0x0300127c + thumb_func_end sub_819BCD0 + + thumb_func_start sub_819BCF8 +sub_819BCF8: @ 819BCF8 + push {r4,r5,lr} + sub sp, 0x2C + ldr r5, _0819BD6C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + cmp r4, 0x5 + bhi _0819BD64 + movs r0, 0x5 + bl Window_WriteStandardTileMap + movs r0, 0x5 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl sub_81DB368 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram +_0819BD64: + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819BD6C: .4byte 0x0300127c + thumb_func_end sub_819BCF8 + + thumb_func_start sub_819BD70 +sub_819BD70: @ 819BD70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + ldr r6, _0819BE14 + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, _0819BE18 + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r8 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r4, _0819BE1C + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r6] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + strb r3, [r0] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819BE14: .4byte 0x0300127c +_0819BE18: .4byte 0x0000ffff +_0819BE1C: .4byte 0x02020630 + thumb_func_end sub_819BD70 + + thumb_func_start sub_819BE20 +sub_819BE20: @ 819BE20 + ldr r1, _0819BE30 + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_0819BE30: .4byte 0x0300127c + thumb_func_end sub_819BE20 + + thumb_func_start sub_819BE34 +sub_819BE34: @ 819BE34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, _0819BF18 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r6, _0819BF1C + ldr r1, [r6] + ldr r2, _0819BF20 + mov r10, r2 + add r1, r10 + movs r7, 0 + strb r0, [r1] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0819BF24 + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl sub_8008258 + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, _0819BF28 + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819BF18: .4byte 0x08610638 +_0819BF1C: .4byte 0x0300127c +_0819BF20: .4byte 0x00000299 +_0819BF24: .4byte 0x02020630 +_0819BF28: .4byte 0x0000ffff + thumb_func_end sub_819BE34 + + thumb_func_start sub_819BF2C +sub_819BF2C: @ 819BF2C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r7, 0 + ldr r0, _0819BFFC + mov r9, r0 +_0819BF3E: + movs r2, 0 + adds r1, r7, 0x1 + mov r10, r1 + lsls r0, r7, 2 + mov r8, r0 +_0819BF48: + mov r0, r9 + ldr r1, [r0] + movs r0, 0x6C + adds r4, r2, 0 + muls r4, r0 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, r10 + bne _0819C008 + adds r4, r1 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 19 + movs r2, 0x80 + lsls r2, 13 + adds r0, r2 + asrs r0, 16 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + adds r0, r7, 0 + adds r0, 0xD + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + ldr r0, _0819C000 + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_818D7D8 + mov r2, r9 + ldr r1, [r2] + add r1, r8 + movs r2, 0xA5 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + add r0, r8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, _0819C004 + adds r0, r2 + adds r0, 0x28 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldr r0, [r2] + add r0, r8 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, _0819C004 + adds r0, r2 + adds r0, 0x29 + movs r1, 0 + strb r1, [r0] + b _0819C012 + .align 2, 0 +_0819BFFC: .4byte 0x0300127c +_0819C000: .4byte 0x0000ffff +_0819C004: .4byte 0x02020630 +_0819C008: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819BF48 +_0819C012: + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819BF3E + ldr r0, _0819C03C + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819C03C: .4byte 0x0300127c + thumb_func_end sub_819BF2C + + thumb_func_start sub_819C040 +sub_819C040: @ 819C040 + push {r4-r6,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C0DC + ldr r3, _0819C0E4 + ldr r6, _0819C0E8 + ldr r2, [r6] + ldr r0, _0819C0EC + adds r5, r2, r0 + ldrb r0, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + ldr r1, _0819C0F0 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r5] + 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] + ldr r0, [r6] + ldr r1, _0819C0F0 + adds r0, r1 + 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] + ldr r0, _0819C0F4 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819C0F8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, _0819C0FC + str r0, [r4, 0x1C] +_0819C0DC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819C0E4: .4byte 0x02020630 +_0819C0E8: .4byte 0x0300127c +_0819C0EC: .4byte 0x00000295 +_0819C0F0: .4byte 0x0000029d +_0819C0F4: .4byte sub_819C1D0 + 1 +_0819C0F8: .4byte 0x03005e00 +_0819C0FC: .4byte nullsub_12 + 1 + thumb_func_end sub_819C040 + + thumb_func_start sub_819C100 +sub_819C100: @ 819C100 + push {r4-r7,lr} + adds r5, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C1BA + ldr r6, _0819C1C0 + ldr r4, _0819C1C4 + ldr r2, [r4] + ldr r7, _0819C1C8 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldr r1, _0819C1CC + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r0, [r4] + adds r0, r7 + 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 + ldr r0, [r4] + ldr r1, _0819C1CC + adds r0, r1 + 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 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_delete_and_free_tiles + ldr r0, [r4] + ldr r1, _0819C1CC + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl obj_delete_and_free_tiles +_0819C1BA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819C1C0: .4byte 0x02020630 +_0819C1C4: .4byte 0x0300127c +_0819C1C8: .4byte 0x00000295 +_0819C1CC: .4byte 0x0000029d + thumb_func_end sub_819C100 + + thumb_func_start sub_819C1D0 +sub_819C1D0: @ 819C1D0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _0819C1F4 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819C24E + cmp r0, 0x1 + bgt _0819C1F8 + cmp r0, 0 + beq _0819C1FE + b _0819C2BA + .align 2, 0 +_0819C1F4: .4byte 0x03005e00 +_0819C1F8: + cmp r0, 0x2 + beq _0819C270 + b _0819C2BA +_0819C1FE: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x37 + bl lcd_io_set + b _0819C2C6 +_0819C24E: + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r1, _0819C268 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0819C26C + movs r0, 0x52 + bl lcd_io_set + b _0819C2C6 + .align 2, 0 +_0819C268: .4byte 0x00001248 +_0819C26C: .4byte 0x0000040b +_0819C270: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819C28C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819C29E +_0819C28C: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits +_0819C29E: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _0819C2CC + b _0819C2C6 +_0819C2BA: + adds r0, r2, 0 + bl remove_task + bl sub_819BF2C + b _0819C2CC +_0819C2C6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C2CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819C1D0 + + thumb_func_start sub_819C2D4 +sub_819C2D4: @ 819C2D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _0819C3F0 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0819C2F6 + b _0819C410 +_0819C2F6: + cmp r0, 0x1 + bne _0819C2FC + b _0819C460 +_0819C2FC: + movs r0, 0x3 + bl gpu_sync_bg_hide + ldr r4, _0819C3F4 + ldr r0, _0819C3F8 + mov r8, r0 + ldr r0, [r0] + ldr r1, _0819C3FC + mov r12, r1 + add r0, r12 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + mov r0, r8 + ldr r2, [r0] + mov r1, r12 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r4, 0 + adds r6, 0x1C + adds r0, r6 + ldr r1, _0819C400 + str r1, [r0] + ldr r0, _0819C404 + mov r9, r0 + add r2, r9 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r1, r8 + ldr r2, [r1] + mov r1, r9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, _0819C408 + mov r10, r1 + str r1, [r0] + ldr r5, _0819C40C + adds r2, r5 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r10 + str r1, [r0] + add r2, r12 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl sub_8008258 + mov r1, r8 + ldr r0, [r1] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl sub_8008258 + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl sub_8008258 + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + adds r0, r7, 0 + bl remove_task + b _0819C4A4 + .align 2, 0 +_0819C3F0: .4byte 0x03005e00 +_0819C3F4: .4byte 0x02020630 +_0819C3F8: .4byte 0x0300127c +_0819C3FC: .4byte 0x00000299 +_0819C400: .4byte sub_819C100 + 1 +_0819C404: .4byte 0x00000295 +_0819C408: .4byte nullsub_12 + 1 +_0819C40C: .4byte 0x0000029d +_0819C410: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x37 + bl lcd_io_set + b _0819C49E +_0819C460: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819C47C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819C484 +_0819C47C: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819C484: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819C4A4 +_0819C49E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C4A4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C2D4 + + thumb_func_start sub_819C4B4 +sub_819C4B4: @ 819C4B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, _0819C548 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r6, _0819C54C + ldr r1, [r6] + ldr r2, _0819C550 + mov r8, r2 + add r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r6] + ldr r5, _0819C554 + adds r1, r5 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xC4 + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r6] + ldr r4, _0819C558 + adds r1, r4 + strb r0, [r1] + ldr r3, _0819C55C + ldr r2, [r6] + add r8, r2 + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, _0819C560 + str r1, [r0] + adds r5, r2, r5 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r5, _0819C564 + str r5, [r0] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + str r5, [r0] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + movs r0, 0x1 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819C548: .4byte 0x08610638 +_0819C54C: .4byte 0x0300127c +_0819C550: .4byte 0x00000299 +_0819C554: .4byte 0x00000295 +_0819C558: .4byte 0x0000029d +_0819C55C: .4byte 0x02020630 +_0819C560: .4byte sub_819C040 + 1 +_0819C564: .4byte nullsub_12 + 1 + thumb_func_end sub_819C4B4 + + thumb_func_start sub_819C568 +sub_819C568: @ 819C568 + push {r4,lr} + ldr r4, _0819C5C4 + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA7 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, _0819C5C8 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819C5CC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819C5C4: .4byte 0x0300127c +_0819C5C8: .4byte sub_819C2D4 + 1 +_0819C5CC: .4byte 0x03005e00 + thumb_func_end sub_819C568 + + thumb_func_start sub_819C5D0 +sub_819C5D0: @ 819C5D0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + lsls r4, 24 + lsrs r4, 16 + orrs r4, r6 + movs r0, 0x40 + adds r1, r4, 0 + bl lcd_io_set + lsls r5, 24 + lsrs r5, 16 + mov r0, r8 + orrs r5, r0 + movs r0, 0x44 + adds r1, r5, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x37 + bl lcd_io_set + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819C5D0 + + thumb_func_start sub_819C634 +sub_819C634: @ 819C634 + push {r4-r7,lr} + lsls r0, 16 + ldr r2, _0819C678 + ldr r1, [r2] + lsrs r0, 12 + adds r0, r1 + ldrh r6, [r0] + ldr r0, _0819C67C + ldr r0, [r0] + ldrb r5, [r0, 0x5] + movs r3, 0x1 + cmp r3, r5 + bcs _0819C694 + adds r4, r0, 0 + movs r0, 0x6C + mov r12, r0 + adds r7, r2, 0 +_0819C656: + movs r2, 0 +_0819C658: + mov r0, r12 + muls r0, r2 + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + cmp r0, r3 + bne _0819C680 + ldrh r0, [r1, 0xC] + ldr r1, [r7] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0819C68A + movs r0, 0 + b _0819C696 + .align 2, 0 +_0819C678: .4byte 0x0203bc8c +_0819C67C: .4byte 0x0300127c +_0819C680: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819C658 +_0819C68A: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _0819C656 +_0819C694: + movs r0, 0x1 +_0819C696: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_819C634 + + thumb_func_start sub_819C69C +sub_819C69C: @ 819C69C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0819C6C0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r2, [r5, r0] + cmp r2, 0x1 + beq _0819C6F8 + cmp r2, 0x1 + bgt _0819C6C4 + cmp r2, 0 + beq _0819C6CA + b _0819C7D8 + .align 2, 0 +_0819C6C0: .4byte 0x03005e00 +_0819C6C4: + cmp r2, 0x2 + beq _0819C7B4 + b _0819C7D8 +_0819C6CA: + ldr r1, _0819C6EC + ldr r0, [r1] + ldr r3, _0819C6F0 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + adds r3, 0x1 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + ldr r1, _0819C6F4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r5, 0x8] + b _0819C7D8 + .align 2, 0 +_0819C6EC: .4byte 0x0300127c +_0819C6F0: .4byte 0x000002a7 +_0819C6F4: .4byte 0x000002a6 +_0819C6F8: + ldr r0, _0819C718 + ldr r3, [r0] + ldr r2, _0819C71C + adds r1, r3, r2 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + beq _0819C7D8 + ldr r1, _0819C720 + adds r0, r3, r1 + ldrb r4, [r0] + cmp r4, 0 + beq _0819C724 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _0819C7D8 + .align 2, 0 +_0819C718: .4byte 0x0300127c +_0819C71C: .4byte 0x000002a2 +_0819C720: .4byte 0x000002a9 +_0819C724: + ldr r2, _0819C754 + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r7] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819C764 + strb r4, [r1] + ldr r1, [r7] + subs r2, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0819C758 + movs r3, 0xAA + lsls r3, 2 + adds r1, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _0819C762 + .align 2, 0 +_0819C754: .4byte 0x000002a7 +_0819C758: + movs r0, 0xAA + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 +_0819C762: + strb r0, [r1] +_0819C764: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r7] + movs r4, 0xAA + lsls r4, 2 + adds r1, r4 + ldrb r1, [r1] + movs r2, 0 + bl sub_80A2A20 + ldr r2, [r7] + adds r4, r2, r4 + ldrb r0, [r4] + cmp r0, 0x5 + bls _0819C790 + ldr r3, _0819C78C + adds r1, r2, r3 + movs r0, 0 + b _0819C7D6 + .align 2, 0 +_0819C78C: .4byte 0x000002a6 +_0819C790: + cmp r0, 0 + bne _0819C7D8 + ldr r1, _0819C7AC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, _0819C7B0 + adds r1, r2, r0 + movs r0, 0x1 + b _0819C7D6 + .align 2, 0 +_0819C7AC: .4byte 0x03005e00 +_0819C7B0: .4byte 0x000002a6 +_0819C7B4: + ldr r0, _0819C7CC + ldr r0, [r0] + ldr r2, _0819C7D0 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819C7D4 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _0819C7D8 + .align 2, 0 +_0819C7CC: .4byte 0x0300127c +_0819C7D0: .4byte 0x000002a9 +_0819C7D4: + adds r0, 0x1 +_0819C7D6: + strb r0, [r1] +_0819C7D8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C69C + + thumb_func_start sub_819C7E0 +sub_819C7E0: @ 819C7E0 + push {lr} + bl call_obj_callbacks + bl obj_sync_something + bl run_remoboxes + bl fade_and_return_progress_probably + bl run_active_tasks + pop {r0} + bx r0 + thumb_func_end sub_819C7E0 + + thumb_func_start sub_819C7FC +sub_819C7FC: @ 819C7FC + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_819C7FC + + thumb_func_start sub_819C810 +sub_819C810: @ 819C810 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + ldr r4, _0819C8F0 + ldr r5, _0819C8F4 + ldr r1, [r5] + ldrb r0, [r1, 0x12] + movs r6, 0x64 + muls r0, r6 + adds r0, r4 + ldr r2, _0819C8F8 + mov r9, r2 + ldrb r1, [r1, 0x13] + muls r1, r6 + add r1, r9 + movs r2, 0x64 + bl memcpy + movs r1, 0 + mov r0, sp + strb r1, [r0] + ldr r0, [r5] + ldrb r0, [r0, 0x12] + muls r0, r6 + adds r0, r4 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr + ldr r3, _0819C8FC + mov r8, r3 + ldr r3, [r3] + ldr r4, [r5] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + movs r1, 0xE7 + lsls r1, 4 + adds r0, r1 + ldrh r0, [r0] + adds r2, r1 + strh r0, [r2] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, _0819C900 + adds r3, r0 + ldrb r1, [r3] + adds r2, r0 + strb r1, [r2] + ldr r0, [r5] + ldrb r0, [r0, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r1, r8 + ldr r2, [r1] + ldr r4, [r5] + ldrb r3, [r4, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + ldr r3, _0819C904 + adds r2, r3 + adds r2, r1 + str r0, [r2] + ldrb r0, [r4, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr_encrypted + mov r1, r8 + ldr r2, [r1] + ldr r1, [r5] + ldrb r3, [r1, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r2, r1 + ldr r3, _0819C908 + adds r2, r3 + strb r0, [r2] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819C8F0: .4byte 0x020244ec +_0819C8F4: .4byte 0x03001284 +_0819C8F8: .4byte 0x02024744 +_0819C8FC: .4byte 0x03005d90 +_0819C900: .4byte 0x00000e78 +_0819C904: .4byte 0x00000e74 +_0819C908: .4byte 0x00000e79 + thumb_func_end sub_819C810 + + thumb_func_start sub_819C90C +sub_819C90C: @ 819C90C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0819C930 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819C950 + cmp r0, 0x7 + bgt _0819C934 + cmp r0, 0x6 + beq _0819C93A + b _0819C9F0 + .align 2, 0 +_0819C930: .4byte 0x03005e00 +_0819C934: + cmp r0, 0x8 + beq _0819C9C4 + b _0819C9F0 +_0819C93A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819C9F0 +_0819C950: + ldr r0, _0819C9AC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819C9F0 + ldr r4, _0819C9B0 + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl remove_task + ldr r1, [r4] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + bl sub_819F444 + bl sub_819E538 + ldr r4, _0819C9B4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819C9B8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819C9BC + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819C9C0 + ldr r0, [r4] + bl free + str r5, [r4] + bl Window_FreeMemory + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819C9F0 + .align 2, 0 +_0819C9AC: .4byte 0x02037fd4 +_0819C9B0: .4byte 0x03001284 +_0819C9B4: .4byte 0x0203ce40 +_0819C9B8: .4byte 0x0203ce44 +_0819C9BC: .4byte 0x0203ce48 +_0819C9C0: .4byte 0x0203ce4c +_0819C9C4: + adds r0, r2, 0 + bl remove_task + ldr r2, _0819C9F8 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x15] + ldr r2, [r2] + ldr r0, _0819C9FC + movs r1, 0xF4 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x24] + ldr r1, _0819CA00 + ldrb r2, [r2, 0x3] + ldr r0, _0819CA04 + str r0, [sp] + movs r0, 0 + movs r3, 0x2 + bl sub_81BF8EC +_0819C9F0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819C9F8: .4byte 0x03001284 +_0819C9FC: .4byte 0x02037714 +_0819CA00: .4byte 0x020244ec +_0819CA04: .4byte sub_819DC1C + 1 + thumb_func_end sub_819C90C + + thumb_func_start sub_819CA08 +sub_819CA08: @ 819CA08 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _0819CA3C + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CAFE + ldr r1, _0819CA40 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819CA78 + cmp r1, 0x1 + bgt _0819CA44 + cmp r1, 0 + beq _0819CA4E + b _0819CAFE + .align 2, 0 +_0819CA3C: .4byte 0x03001284 +_0819CA40: .4byte 0x03005e00 +_0819CA44: + cmp r1, 0x2 + beq _0819CA8C + cmp r1, 0x3 + beq _0819CAA4 + b _0819CAFE +_0819CA4E: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, _0819CA64 + strh r1, [r0] + b _0819CAFE + .align 2, 0 +_0819CA64: .4byte 0x020375f0 +_0819CA68: + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r1, _0819CA74 + movs r0, 0x1 + strh r0, [r1] + b _0819CAFE + .align 2, 0 +_0819CA74: .4byte 0x020375f0 +_0819CA78: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA9C + ldrb r0, [r2, 0x3] + strb r0, [r2, 0x13] + bl sub_819C810 + b _0819CA9C +_0819CA8C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0819CA9C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819CAFE +_0819CAA4: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819CAFE + ldr r0, [r7] + adds r0, 0x21 + ldrb r0, [r0] + bl remove_task + bl sub_819E538 + ldr r4, _0819CB08 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819CB0C + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819CB10 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _0819CB14 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r0, [r7] + bl free + str r5, [r7] + bl Window_FreeMemory + ldr r0, _0819CB18 + bl set_callback2 + adds r0, r6, 0 + bl remove_task +_0819CAFE: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819CB08: .4byte 0x0203ce40 +_0819CB0C: .4byte 0x0203ce44 +_0819CB10: .4byte 0x0203ce48 +_0819CB14: .4byte 0x0203ce4c +_0819CB18: .4byte sub_80861B0 + 1 + thumb_func_end sub_819CA08 + + thumb_func_start sub_819CB1C +sub_819CB1C: @ 819CB1C + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, _0819CB48 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CBD6 + ldr r1, _0819CB4C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0819CB50 + cmp r0, 0x5 + beq _0819CB5A + b _0819CBD6 + .align 2, 0 +_0819CB48: .4byte 0x03001284 +_0819CB4C: .4byte 0x03005e00 +_0819CB50: + bl sub_819E9E0 + movs r0, 0x5 + strh r0, [r4, 0x8] + b _0819CBD6 +_0819CB5A: + ldr r2, _0819CB7C + ldrh r1, [r2, 0x2E] + movs r6, 0x1 + adds r5, r6, 0 + ands r5, r1 + cmp r5, 0 + beq _0819CB86 + movs r0, 0x5 + bl audio_play + ldr r0, [r7] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _0819CB80 + strh r6, [r4, 0xA] + b _0819CB9C + .align 2, 0 +_0819CB7C: .4byte 0x030022c0 +_0819CB80: + movs r0, 0 + strh r0, [r4, 0xA] + b _0819CB96 +_0819CB86: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CBA8 + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0xA] +_0819CB96: + movs r0, 0x4 + bl sub_819EA64 +_0819CB9C: + ldrh r0, [r4, 0x14] + ldrh r1, [r4, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r4] + b _0819CBD6 +_0819CBA8: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CBC2 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl sub_819E758 + b _0819CBD6 +_0819CBC2: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CBD6 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl sub_819E758 +_0819CBD6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CB1C + + thumb_func_start sub_819CBDC +sub_819CBDC: @ 819CBDC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819CBFC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CC04 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, _0819CC00 + b _0819CC16 + .align 2, 0 +_0819CBFC: .4byte 0x03005e00 +_0819CC00: .4byte sub_819CA08 + 1 +_0819CC04: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, _0819CC1C + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, _0819CC20 +_0819CC16: + str r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_0819CC1C: .4byte sub_819CE40 + 1 +_0819CC20: .4byte sub_819D770 + 1 + thumb_func_end sub_819CBDC + + thumb_func_start sub_819CC24 +sub_819CC24: @ 819CC24 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819CC60 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0819CC5A + ldr r0, _0819CC64 + bl sub_819EBEC + ldr r0, _0819CC68 + ldr r0, [r0] + adds r0, 0x20 + strb r5, [r0] + movs r0, 0x4 + strh r0, [r4, 0x8] + ldr r1, _0819CC6C + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + ldr r0, _0819CC70 + str r0, [r4] +_0819CC5A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819CC60: .4byte 0x03005e00 +_0819CC64: .4byte 0x085eecbb +_0819CC68: .4byte 0x03001284 +_0819CC6C: .4byte sub_819CBDC + 1 +_0819CC70: .4byte sub_819CB1C + 1 + thumb_func_end sub_819CC24 + + thumb_func_start sub_819CC74 +sub_819CC74: @ 819CC74 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0819CCA4 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r1, _0819CCA8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CCB0 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, _0819CCAC + b _0819CCC2 + .align 2, 0 +_0819CCA4: .4byte 0x03001284 +_0819CCA8: .4byte 0x03005e00 +_0819CCAC: .4byte sub_819CA08 + 1 +_0819CCB0: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, _0819CCCC + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, _0819CCD0 +_0819CCC2: + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819CCCC: .4byte sub_819CE40 + 1 +_0819CCD0: .4byte sub_819D770 + 1 + thumb_func_end sub_819CC74 + + thumb_func_start sub_819CCD4 +sub_819CCD4: @ 819CCD4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819CD20 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0819CD1A + ldr r4, _0819CD24 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r0, _0819CD28 + bl sub_819EBEC + ldr r0, [r4] + adds r0, 0x20 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x4 + strh r0, [r5, 0x8] + ldr r1, _0819CD2C + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + ldr r0, _0819CD30 + str r0, [r5] +_0819CD1A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819CD20: .4byte 0x03005e00 +_0819CD24: .4byte 0x03001284 +_0819CD28: .4byte 0x085eecf0 +_0819CD2C: .4byte sub_819CC74 + 1 +_0819CD30: .4byte sub_819CB1C + 1 + thumb_func_end sub_819CCD4 + + thumb_func_start sub_819CD34 +sub_819CD34: @ 819CD34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0819CD5C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + beq _0819CDA4 + cmp r0, 0x3 + bgt _0819CD60 + cmp r0, 0x2 + beq _0819CD66 + b _0819CE36 + .align 2, 0 +_0819CD5C: .4byte 0x03005e00 +_0819CD60: + cmp r0, 0x9 + beq _0819CD88 + b _0819CE36 +_0819CD66: + ldr r0, _0819CD84 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0 + bne _0819CD7C + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 +_0819CD7C: + movs r0, 0x9 + strh r0, [r5, 0x8] + b _0819CE36 + .align 2, 0 +_0819CD84: .4byte 0x03001284 +_0819CD88: + ldr r0, _0819CDA0 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + bl sub_819E944 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _0819CE36 + .align 2, 0 +_0819CDA0: .4byte 0x03001284 +_0819CDA4: + ldr r7, _0819CDD0 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + ldr r2, _0819CDD4 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + mov r4, r8 + ands r4, r1 + cmp r4, 0 + beq _0819CDD8 + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_819F0A0 + b _0819CE36 + .align 2, 0 +_0819CDD0: .4byte 0x03001284 +_0819CDD4: .4byte 0x030022c0 +_0819CDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CE14 + movs r0, 0x5 + bl audio_play + ldr r1, [r7] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + strh r4, [r5, 0x8] + ldr r1, _0819CE0C + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + mov r1, r8 + strh r1, [r5, 0x12] + ldr r0, _0819CE10 + str r0, [r5] + b _0819CE36 + .align 2, 0 +_0819CE0C: .4byte sub_819CE40 + 1 +_0819CE10: .4byte sub_819D770 + 1 +_0819CE14: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CE28 + movs r0, 0x1 + negs r0, r0 + bl sub_819E7C0 + b _0819CE36 +_0819CE28: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CE36 + movs r0, 0x1 + bl sub_819E7C0 +_0819CE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CD34 + + thumb_func_start sub_819CE40 +sub_819CE40: @ 819CE40 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0819CE60 + 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 _0819CE64 + cmp r0, 0x1 + beq _0819CE88 + b _0819CF4C + .align 2, 0 +_0819CE60: .4byte 0x03005e00 +_0819CE64: + ldr r0, _0819CE80 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819CF4C + ldr r0, _0819CE84 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819CF4C + .align 2, 0 +_0819CE80: .4byte 0x02037fd4 +_0819CE84: .4byte 0x03001284 +_0819CE88: + ldr r2, _0819CEB4 + ldrh r1, [r2, 0x2E] + adds r5, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _0819CEBC + movs r0, 0x5 + bl audio_play + ldr r0, _0819CEB8 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0 + strb r1, [r0] + bl sub_819EE08 + bl sub_819EAC0 + adds r0, r6, 0 + bl sub_819F184 + b _0819CF4C + .align 2, 0 +_0819CEB4: .4byte 0x030022c0 +_0819CEB8: .4byte 0x03001284 +_0819CEBC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CEF8 + movs r0, 0x5 + bl audio_play + ldr r0, _0819CEEC + ldr r0, [r0] + adds r0, 0x22 + strb r5, [r0] + bl sub_819EE08 + bl sub_819EAC0 + ldr r1, _0819CEF0 + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + strh r5, [r4, 0x8] + strh r5, [r4, 0x12] + ldr r0, _0819CEF4 + str r0, [r4] + b _0819CF4C + .align 2, 0 +_0819CEEC: .4byte 0x03001284 +_0819CEF0: .4byte sub_819CC24 + 1 +_0819CEF4: .4byte sub_819D588 + 1 +_0819CEF8: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819CF0C + movs r0, 0x1 + negs r0, r0 + bl sub_819E694 + b _0819CF2A +_0819CF0C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819CF1C + movs r0, 0x1 + bl sub_819E694 + b _0819CF2A +_0819CF1C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CF34 + movs r0, 0x1 + bl sub_819E6E8 +_0819CF2A: + bl sub_819EFA8 + bl sub_819EB4C + b _0819CF4C +_0819CF34: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CF4C + movs r0, 0x1 + negs r0, r0 + bl sub_819E6E8 + bl sub_819EFA8 + bl sub_819EB4C +_0819CF4C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CE40 + + thumb_func_start sub_819CF54 +sub_819CF54: @ 819CF54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0819CF78 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _0819CFA0 + cmp r2, 0x1 + bgt _0819CF7C + cmp r2, 0 + beq _0819CF82 + b _0819D05C + .align 2, 0 +_0819CF78: .4byte 0x03005e00 +_0819CF7C: + cmp r2, 0x2 + beq _0819D03C + b _0819D05C +_0819CF82: + ldr r1, _0819CF9C + ldr r0, [r1] + adds r0, 0x27 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x28 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x26 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819D05C + .align 2, 0 +_0819CF9C: .4byte 0x03001284 +_0819CFA0: + ldr r1, _0819CFC0 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + beq _0819D05C + adds r0, r2, 0 + adds r0, 0x29 + ldrb r3, [r0] + cmp r3, 0 + beq _0819CFC4 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _0819D05C + .align 2, 0 +_0819CFC0: .4byte 0x03001284 +_0819CFC4: + adds r1, r2, 0 + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819CFF8 + strb r3, [r1] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0 + bne _0819CFF0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + b _0819CFF6 +_0819CFF0: + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 +_0819CFF6: + strb r0, [r1] +_0819CFF8: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r6] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl sub_80A2A20 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0x5 + bls _0819D01C + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0 + b _0819D05A +_0819D01C: + cmp r0, 0 + bne _0819D05C + ldr r1, _0819D038 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0x1 + b _0819D05A + .align 2, 0 +_0819D038: .4byte 0x03005e00 +_0819D03C: + ldr r0, _0819D054 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x29 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819D058 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D05C + .align 2, 0 +_0819D054: .4byte 0x03001284 +_0819D058: + adds r0, 0x1 +_0819D05A: + strb r0, [r1] +_0819D05C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CF54 + + thumb_func_start sub_819D064 +sub_819D064: @ 819D064 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819D088 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819D0A4 + cmp r1, 0x1 + bgt _0819D08C + cmp r1, 0 + beq _0819D092 + b _0819D118 + .align 2, 0 +_0819D088: .4byte 0x03005e00 +_0819D08C: + cmp r1, 0x2 + beq _0819D0BC + b _0819D118 +_0819D092: + ldr r0, _0819D0A0 + ldr r0, [r0] + adds r0, 0x27 + strb r1, [r0] + strh r1, [r4, 0x10] + b _0819D0AE + .align 2, 0 +_0819D0A0: .4byte 0x03001284 +_0819D0A4: + ldr r0, _0819D0B8 + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply +_0819D0AE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D118 + .align 2, 0 +_0819D0B8: .4byte 0x020378f4 +_0819D0BC: + ldr r2, _0819D120 + ldr r0, [r2] + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0xF + bls _0819D0D2 + movs r0, 0x1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819D0D2: + ldr r1, [r2] + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x3 + bls _0819D108 + movs r0, 0 + strb r0, [r1] + ldr r1, _0819D124 + ldr r0, _0819D128 + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0x20 + adds r1, r3 + strh r0, [r1] + ldr r1, [r2] + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0819D108: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r2] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl sub_80A2A20 +_0819D118: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819D120: .4byte 0x03001284 +_0819D124: .4byte 0x02037714 +_0819D128: .4byte 0x02037b14 + thumb_func_end sub_819D064 + + thumb_func_start sub_819D12C +sub_819D12C: @ 819D12C + 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] + ldr r1, _0819D158 + lsls r0, 2 + ldr r2, [sp] + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r2, 0x8 + ldrsh r3, [r4, r2] + cmp r3, 0 + beq _0819D15C + cmp r3, 0x1 + beq _0819D168 + b _0819D310 + .align 2, 0 +_0819D158: .4byte 0x03005e00 +_0819D15C: + strh r3, [r4, 0xA] + strh r3, [r4, 0xC] + strh r3, [r4, 0xE] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D310 +_0819D168: + movs r3, 0 + str r3, [sp, 0x4] + movs r1, 0x2 + str r0, [sp, 0x8] + ldr r0, _0819D1CC + str r0, [sp, 0xC] +_0819D174: + lsls r0, r1, 24 + asrs r4, r0, 24 + mov r9, r0 + cmp r4, 0x2 + beq _0819D1F2 + ldr r2, _0819D1D0 + ldr r3, _0819D1D4 + ldr r0, [r3] + adds r0, 0x5 + mov r8, r0 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r0, r2 + ldrh r1, [r6, 0x20] + mov r12, r1 + mov r7, r12 + ldr r1, [sp, 0x4] + subs r0, r1, r7 + lsls r0, 24 + lsrs r5, r0, 24 + mov r10, r2 + cmp r5, 0x10 + beq _0819D1BE + adds r0, r4, 0x2 + lsls r0, 1 + ldr r2, [sp, 0x8] + adds r0, r2 + ldr r1, _0819D1CC + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D1D8 +_0819D1BE: + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r12 + adds r0, 0xA + strh r0, [r6, 0x20] + b _0819D210 + .align 2, 0 +_0819D1CC: .4byte 0x03005e00 +_0819D1D0: .4byte 0x02020630 +_0819D1D4: .4byte 0x03001284 +_0819D1D8: + cmp r5, 0x10 + bls _0819D210 + adds r0, r4, 0x1 + add r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x20] + subs r0, 0x30 + strh r0, [r6, 0x20] + b _0819D210 +_0819D1F2: + ldr r3, _0819D254 + ldr r4, _0819D258 + ldr r0, [r4] + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x20] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + adds r2, 0xA + strh r2, [r0, 0x20] + mov r10, r3 +_0819D210: + mov r0, r9 + asrs r2, r0, 24 + adds r0, r2, 0x1 + lsls r0, 1 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r1, _0819D25C + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D26A + ldr r1, _0819D258 + ldr r0, [r1] + adds r0, 0x5 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r3, r10 + adds r1, r0, r3 + movs r0, 0x20 + ldrsh r3, [r1, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, 0x48 + cmp r3, r0 + ble _0819D260 + strh r0, [r1, 0x20] + movs r7, 0x1 + b _0819D26C + .align 2, 0 +_0819D254: .4byte 0x02020630 +_0819D258: .4byte 0x03001284 +_0819D25C: .4byte 0x03005e00 +_0819D260: + movs r7, 0 + cmp r3, r0 + bne _0819D26C + movs r7, 0x1 + b _0819D26C +_0819D26A: + movs r7, 0 +_0819D26C: + mov r6, r10 + ldr r5, _0819D2B8 + ldr r2, [r5] + mov r1, r9 + asrs r4, r1, 24 + adds r0, r2, 0x5 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r3, 0x20 + ldrsh r0, [r1, r3] + subs r0, 0x10 + cmp r0, 0xF0 + ble _0819D2F8 + ldrh r0, [r1, 0x20] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, _0819D2BC + strh r0, [r1, 0x20] + ldrb r0, [r2, 0x14] + cmp r0, 0x1 + bne _0819D2C0 + movs r0, 0x65 + bl gpu_pal_tags_index_of + ldr r1, [r5] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r6 + b _0819D2D8 + .align 2, 0 +_0819D2B8: .4byte 0x03001284 +_0819D2BC: .4byte 0x0000fff0 +_0819D2C0: + movs r0, 0x64 + bl gpu_pal_tags_index_of + ldr r2, _0819D320 + ldr r1, [r2] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r10 +_0819D2D8: + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + mov r3, r9 + asrs r0, r3, 23 + adds r0, 0x2 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r2, [sp, 0xC] + adds r2, 0x8 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0] +_0819D2F8: + movs r0, 0xFF + lsls r0, 24 + add r0, r9 + lsrs r1, r0, 24 + cmp r0, 0 + blt _0819D306 + b _0819D174 +_0819D306: + cmp r7, 0x1 + bne _0819D310 + ldr r0, [sp] + bl remove_task +_0819D310: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819D320: .4byte 0x03001284 + thumb_func_end sub_819D12C + + thumb_func_start sub_819D324 +sub_819D324: @ 819D324 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r1, _0819D364 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + ldrb r4, [r2, 0xE] + movs r0, 0xC + ldrsh r5, [r2, r0] + mov r10, r1 + cmp r5, 0x1 + bne _0819D352 + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_0819D352: + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0819D368 + cmp r0, 0x1 + bne _0819D360 + b _0819D480 +_0819D360: + b _0819D570 + .align 2, 0 +_0819D364: .4byte 0x03005e00 +_0819D368: + ldr r3, _0819D394 + ldr r2, _0819D398 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D39C + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D3B2 + movs r1, 0 + movs r0, 0xF0 + b _0819D3B0 + .align 2, 0 +_0819D394: .4byte 0x02020630 +_0819D398: .4byte 0x03001284 +_0819D39C: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xA0 + bgt _0819D3B2 + movs r1, 0 + movs r0, 0xA0 +_0819D3B0: + mov r8, r0 +_0819D3B2: + cmp r1, 0x1 + bne _0819D3FC + movs r3, 0 + ldr r7, _0819D3F4 + ldr r6, _0819D3F8 + asrs r5, r2, 24 +_0819D3BE: + movs r4, 0 + adds r2, r3, 0x1 +_0819D3C2: + ldr r1, [r6] + lsls r0, r4, 1 + adds r0, r4 + adds r0, r3, r0 + adds r1, 0x8 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D3C2 + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819D3BE + b _0819D570 + .align 2, 0 +_0819D3F4: .4byte 0x02020630 +_0819D3F8: .4byte 0x03001284 +_0819D3FC: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + movs r0, 0x30 + add r0, r8 + mov r9, r0 + ldr r5, _0819D478 +_0819D40E: + ldr r1, _0819D47C + ldr r2, [r1] + lsls r3, r4, 1 + adds r3, r4 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r0, r2, 0 + adds r0, 0x9 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r2, 0xA + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r9 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D40E + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0xE] + adds r0, r7, 0 + bl remove_task + b _0819D570 + .align 2, 0 +_0819D478: .4byte 0x02020630 +_0819D47C: .4byte 0x03001284 +_0819D480: + ldr r2, _0819D4AC + ldr r0, _0819D4B0 + ldr r0, [r0] + ldrb r1, [r0, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D4B4 + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D4CA + movs r1, 0 + movs r0, 0xF0 + b _0819D4C8 + .align 2, 0 +_0819D4AC: .4byte 0x02020630 +_0819D4B0: .4byte 0x03001284 +_0819D4B4: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xC0 + bgt _0819D4CA + movs r1, 0 + movs r0, 0xC0 +_0819D4C8: + mov r8, r0 +_0819D4CA: + cmp r1, 0x1 + bne _0819D510 + movs r3, 0 + ldr r7, _0819D508 + ldr r6, _0819D50C + asrs r5, r2, 24 +_0819D4D6: + movs r4, 0 + adds r2, r3, 0x1 +_0819D4DA: + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r3, r1 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D4DA + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _0819D4D6 + b _0819D570 + .align 2, 0 +_0819D508: .4byte 0x02020630 +_0819D50C: .4byte 0x03001284 +_0819D510: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + ldr r5, _0819D580 + ldr r0, _0819D584 + mov r9, r0 +_0819D520: + mov r1, r9 + ldr r2, [r1] + lsls r3, r4, 1 + adds r0, r2, 0 + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r2, 0xF + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D520 + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r7, 0 + bl remove_task +_0819D570: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819D580: .4byte 0x02020630 +_0819D584: .4byte 0x03001284 + thumb_func_end sub_819D324 + + thumb_func_start sub_819D588 +sub_819D588: @ 819D588 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, _0819D5B4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x5 + bls _0819D5AA + b _0819D762 +_0819D5AA: + lsls r0, 2 + ldr r1, _0819D5B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819D5B4: .4byte 0x03005e00 +_0819D5B8: .4byte _0819D5BC + .align 2, 0 +_0819D5BC: + .4byte _0819D5D4 + .4byte _0819D5F0 + .4byte _0819D60C + .4byte _0819D63C + .4byte _0819D6F0 + .4byte _0819D73A +_0819D5D4: + ldr r0, _0819D5EC + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply + bl sub_819ED34 + movs r0, 0x5 + bl Window_WriteStandardTileMap + b _0819D622 + .align 2, 0 +_0819D5EC: .4byte 0x08610918 +_0819D5F0: + movs r0, 0x3 + bl sub_819EA64 + ldr r0, _0819D608 + 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 _0819D762 + .align 2, 0 +_0819D608: .4byte 0x03005e00 +_0819D60C: + movs r0, 0x80 + lsls r0, 7 + ldr r1, _0819D634 + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 +_0819D622: + ldr r1, _0819D638 + 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 _0819D762 + .align 2, 0 +_0819D634: .4byte 0x0860f13c +_0819D638: .4byte 0x03005e00 +_0819D63C: + ldr r0, _0819D6A0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0819D64E + b _0819D762 +_0819D64E: + movs r0, 0x5 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, _0819D6A4 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819D6B0 + ldr r0, _0819D6A8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0819D6AC + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r1 + strh r6, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + strh r6, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0x5 + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D762 + .align 2, 0 +_0819D6A0: .4byte 0x02037fd4 +_0819D6A4: .4byte 0x03001284 +_0819D6A8: .4byte sub_819D324 + 1 +_0819D6AC: .4byte 0x03005e00 +_0819D6B0: + ldr r0, _0819D6E8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, _0819D6EC + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r3 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r6, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r5, [r0, 0xA] + strh r1, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D762 + .align 2, 0 +_0819D6E8: .4byte sub_819D324 + 1 +_0819D6EC: .4byte 0x03005e00 +_0819D6F0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r6, r0, r1 + ldrh r0, [r6, 0xC] + movs r2, 0xC + ldrsh r7, [r6, r2] + cmp r7, 0 + bne _0819D734 + ldr r0, _0819D730 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r6, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0819D762 + .align 2, 0 +_0819D730: .4byte sub_819D324 + 1 +_0819D734: + subs r0, 0x1 + strh r0, [r6, 0xC] + b _0819D762 +_0819D73A: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + movs r1, 0xE + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + movs r1, 0x10 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x8] + ldrh r0, [r2, 0x14] + ldrh r1, [r2, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r2] +_0819D762: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819D588 + + thumb_func_start sub_819D770 +sub_819D770: @ 819D770 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, _0819D7B0 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + bne _0819D78C + b _0819D9D8 +_0819D78C: + ldr r0, _0819D7B4 + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r4, 0x8 + ldrsh r1, [r1, r4] + mov r8, r0 + adds r5, r2, 0 + cmp r1, 0x8 + bls _0819D7A4 + b _0819D9D8 +_0819D7A4: + lsls r0, r1, 2 + ldr r1, _0819D7B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819D7B0: .4byte 0x03001284 +_0819D7B4: .4byte 0x03005e00 +_0819D7B8: .4byte _0819D7BC + .align 2, 0 +_0819D7BC: + .4byte _0819D7E0 + .4byte _0819D868 + .4byte _0819D8AE + .4byte _0819D8F4 + .4byte _0819D910 + .4byte _0819D928 + .4byte _0819D936 + .4byte _0819D948 + .4byte _0819D9B0 +_0819D7E0: + ldr r0, [r3] + ldrb r7, [r0, 0x14] + cmp r7, 0x1 + bne _0819D828 + ldr r0, _0819D820 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, _0819D824 + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r1, 0 + strh r1, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0xA + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D9D8 + .align 2, 0 +_0819D820: .4byte sub_819D324 + 1 +_0819D824: .4byte 0x03005e00 +_0819D828: + ldr r0, _0819D860 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, _0819D864 + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r0, 0 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D9D8 + .align 2, 0 +_0819D860: .4byte sub_819D324 + 1 +_0819D864: .4byte 0x03005e00 +_0819D868: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r5, r0, r1 + ldrh r0, [r5, 0xC] + movs r2, 0xC + ldrsh r7, [r5, r2] + cmp r7, 0 + bne _0819D8A8 + ldr r0, _0819D8A4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r5, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r6, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0819D9D8 + .align 2, 0 +_0819D8A4: .4byte sub_819D324 + 1 +_0819D8A8: + subs r0, 0x1 + strh r0, [r5, 0xC] + b _0819D9D8 +_0819D8AE: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0819D8C0 + b _0819D9D8 +_0819D8C0: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819D8CA + b _0819D9D8 +_0819D8CA: + ldr r1, _0819D8EC + ldr r0, _0819D8F0 + adds r0, 0x4A + ldrh r0, [r0] + movs r2, 0xE2 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + bl sub_819ED34 + movs r0, 0x5 + bl Window_WriteStandardTileMap + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D9D8 + .align 2, 0 +_0819D8EC: .4byte 0x02037b14 +_0819D8F0: .4byte 0x0860f13c +_0819D8F4: + movs r0, 0x80 + lsls r0, 7 + ldr r1, _0819D90C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + b _0819D990 + .align 2, 0 +_0819D90C: .4byte 0x0860f13c +_0819D910: + ldr r0, _0819D924 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819D9D8 + movs r0, 0 + bl sub_819EDBC + b _0819D990 + .align 2, 0 +_0819D924: .4byte 0x02037fd4 +_0819D928: + movs r0, 0x1 + bl sub_819EDBC + movs r0, 0x3 + bl Window_WriteStandardTileMap + b _0819D990 +_0819D936: + movs r0, 0x5 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram + b _0819D990 +_0819D948: + ldr r0, _0819D95C + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819D964 + ldr r0, _0819D960 + bl sub_819EBEC + b _0819D96A + .align 2, 0 +_0819D95C: .4byte 0x03001284 +_0819D960: .4byte 0x085eec73 +_0819D964: + ldr r0, _0819D9A0 + bl sub_819EBEC +_0819D96A: + ldr r0, _0819D9A4 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bhi _0819D98C + ldr r2, _0819D9A8 + ldrb r1, [r1, 0x4] + 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] +_0819D98C: + bl sub_819EFA8 +_0819D990: + ldr r0, _0819D9AC + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819D9D8 + .align 2, 0 +_0819D9A0: .4byte 0x085eec8b +_0819D9A4: .4byte 0x03001284 +_0819D9A8: .4byte 0x02020630 +_0819D9AC: .4byte 0x03005e00 +_0819D9B0: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, _0819D9E4 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _0819D9E8 + adds r0, r5, r6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x14] + ldrh r2, [r0, 0x16] + lsls r1, 16 + orrs r1, r2 + str r1, [r0] +_0819D9D8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819D9E4: .4byte 0x03001284 +_0819D9E8: .4byte 0x03005e00 + thumb_func_end sub_819D770 + + thumb_func_start sub_819D9EC +sub_819D9EC: @ 819D9EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0819DA24 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819DA00 + b _0819DBCA +_0819DA00: + ldr r0, _0819DA28 + 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, 0x4 + bls _0819DA18 + b _0819DBCA +_0819DA18: + lsls r0, r1, 2 + ldr r1, _0819DA2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819DA24: .4byte 0x03001284 +_0819DA28: .4byte 0x03005e00 +_0819DA2C: .4byte _0819DA30 + .align 2, 0 +_0819DA30: + .4byte _0819DA44 + .4byte _0819DA58 + .4byte _0819DA8C + .4byte _0819DABC + .4byte _0819DBB0 +_0819DA44: + bl sub_819EEF0 + ldr r0, _0819DA54 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .align 2, 0 +_0819DA54: .4byte 0x03005e00 +_0819DA58: + bl sub_819EADC + ldr r2, _0819DA80 + ldr r0, _0819DA84 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + 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, _0819DA88 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .align 2, 0 +_0819DA80: .4byte 0x02020630 +_0819DA84: .4byte 0x03001284 +_0819DA88: .4byte 0x03005e00 +_0819DA8C: + ldr r0, _0819DAAC + movs r1, 0 + bl AddTask + ldr r2, _0819DAB0 + ldr r0, _0819DAB4 + ldr r0, [r0] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _0819DAB8 + str r1, [r0] + b _0819DB90 + .align 2, 0 +_0819DAAC: .4byte sub_819D12C + 1 +_0819DAB0: .4byte 0x03005e00 +_0819DAB4: .4byte 0x03001284 +_0819DAB8: .4byte sub_819D064 + 1 +_0819DABC: + ldr r0, _0819DAF8 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0819DACA + b _0819DBCA +_0819DACA: + ldr r2, _0819DAFC + ldr r4, _0819DB00 + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0819DBCA + bl sub_819EAC0 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819DB04 + movs r0, 0x1 + bl sub_819F048 + b _0819DB32 + .align 2, 0 +_0819DAF8: .4byte sub_819D12C + 1 +_0819DAFC: .4byte 0x03005e00 +_0819DB00: .4byte 0x03001284 +_0819DB04: + movs r0, 0 + bl sub_819F048 + movs r2, 0 + ldr r5, _0819DBA0 + movs r3, 0x4 +_0819DB10: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819DB10 +_0819DB32: + ldr r5, _0819DBA0 + ldr r4, _0819DBA4 + ldr r3, [r4] + ldrb r0, [r3, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r0, r3, 0x5 + ldrb r2, [r3, 0x3] + adds r0, r2 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x20] + movs r5, 0 + strh r0, [r1, 0x20] + ldr r2, _0819DBA8 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _0819DBAC + str r1, [r0] + adds r3, 0x27 + strb r5, [r3] + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0x6 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x26 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x8] +_0819DB90: + adds r1, r7, r6 + lsls r1, 3 + adds r1, r2 +_0819DB96: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819DBCA + .align 2, 0 +_0819DBA0: .4byte 0x02020630 +_0819DBA4: .4byte 0x03001284 +_0819DBA8: .4byte 0x03005e00 +_0819DBAC: .4byte sub_819CF54 + 1 +_0819DBB0: + adds r0, r7, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, _0819DBD0 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, _0819DBD4 + str r1, [r0] +_0819DBCA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819DBD0: .4byte sub_819CE40 + 1 +_0819DBD4: .4byte sub_819D770 + 1 + thumb_func_end sub_819D9EC + + thumb_func_start sub_819DBD8 +sub_819DBD8: @ 819DBD8 + push {r4,r5,lr} + ldr r5, _0819DBFC + ldr r4, [r5] + cmp r4, 0 + bne _0819DBF6 + movs r0, 0x34 + bl malloc_and_clear + str r0, [r5] + strb r4, [r0, 0x3] + ldr r0, [r5] + adds r0, 0x30 + strb r4, [r0] + ldr r0, [r5] + strb r4, [r0, 0x15] +_0819DBF6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819DBFC: .4byte 0x03001284 + thumb_func_end sub_819DBD8 + + thumb_func_start sub_819DC00 +sub_819DC00: @ 819DC00 + push {lr} + ldr r0, _0819DC14 + movs r1, 0 + str r1, [r0] + ldr r0, _0819DC18 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_0819DC14: .4byte 0x03001284 +_0819DC18: .4byte sub_819DC1C + 1 + thumb_func_end sub_819DC00 + + thumb_func_start sub_819DC1C +sub_819DC1C: @ 819DC1C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, _0819DC3C + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _0819DC32 + b _0819E0AA +_0819DC32: + lsls r0, 2 + ldr r1, _0819DC40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819DC3C: .4byte 0x030022c0 +_0819DC40: .4byte _0819DC44 + .align 2, 0 +_0819DC44: + .4byte _0819DC84 + .4byte _0819DCD4 + .4byte _0819DDA8 + .4byte _0819DE68 + .4byte _0819DE94 + .4byte _0819DECC + .4byte _0819DEEC + .4byte _0819DF10 + .4byte _0819DF30 + .4byte _0819DF3C + .4byte _0819DF64 + .4byte _0819DF70 + .4byte _0819DF78 + .4byte _0819DF8C + .4byte _0819DFA4 + .4byte _0819E01C +_0819DC84: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _0819DCC4 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _0819DCC8 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r0, _0819DCCC + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r1, _0819DCD0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .align 2, 0 +_0819DCC4: .4byte 0x05006000 +_0819DCC8: .4byte 0x086108b8 +_0819DCCC: .4byte 0x086108c8 +_0819DCD0: .4byte 0x030022c0 +_0819DCD4: + ldr r5, _0819DD98 + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl malloc + str r0, [r5] + ldr r5, _0819DD9C + adds r0, r4, 0 + bl malloc_and_clear + str r0, [r5] + ldr r5, _0819DDA0 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc + str r0, [r5] + ldr r5, _0819DDA4 + adds r0, r4, 0 + bl malloc_and_clear + str r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4C + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0 + bl lcd_io_set + movs r0, 0x44 + movs r1, 0 + bl lcd_io_set + movs r0, 0x42 + movs r1, 0 + bl lcd_io_set + movs r0, 0x46 + movs r1, 0 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0 + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + b _0819E006 + .align 2, 0 +_0819DD98: .4byte 0x0203ce40 +_0819DD9C: .4byte 0x0203ce44 +_0819DDA0: .4byte 0x0203ce48 +_0819DDA4: .4byte 0x0203ce4c +_0819DDA8: + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + bl gpu_pal_allocator_reset + bl dp13_810BB8C + ldr r0, _0819DE40 + ldr r5, _0819DE44 + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, _0819DE48 + ldr r4, _0819DE4C + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _0819DE50 + ldr r4, _0819DE54 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_map_to_vram + ldr r0, _0819DE58 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r4, _0819DE5C + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply + ldr r0, _0819DE60 + movs r1, 0x20 + movs r2, 0x4 + bl gpu_pal_apply + ldr r1, _0819DE64 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .align 2, 0 +_0819DE40: .4byte 0x08dc0754 +_0819DE44: .4byte 0x0203ce40 +_0819DE48: .4byte 0x0861033c +_0819DE4C: .4byte 0x0203ce44 +_0819DE50: .4byte 0x08dc0b94 +_0819DE54: .4byte 0x0203ce48 +_0819DE58: .4byte 0x08dc0714 +_0819DE5C: .4byte 0x08610918 +_0819DE60: .4byte 0x0861039c +_0819DE64: .4byte 0x030022c0 +_0819DE68: + ldr r0, _0819DE8C + ldr r1, [r0] + movs r0, 0x3 + bl bg_set_tilemap + ldr r1, _0819DE90 + movs r0, 0x8 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r2, 0xB + movs r3, 0x4 + bl gpu_copy_to_iwram_tile_map_rect + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + b _0819E006 + .align 2, 0 +_0819DE8C: .4byte 0x0203ce4c +_0819DE90: .4byte 0x0861023c +_0819DE94: + ldr r0, _0819DEB8 + bl gpu_pal_obj_alloc_and_load_multiple + ldr r0, _0819DEBC + bl gpu_tile_obj_alloc_and_load_multiple + ldr r0, _0819DEC0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _0819DEC4 + bl SetVBlankCallback + ldr r1, _0819DEC8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .align 2, 0 +_0819DEB8: .4byte 0x086106b0 +_0819DEBC: .4byte 0x08610650 +_0819DEC0: .4byte 0x086106a0 +_0819DEC4: .4byte sub_819C7FC + 1 +_0819DEC8: .4byte 0x030022c0 +_0819DECC: + ldr r0, _0819DEE4 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0x1 + bne _0819DEDC + ldr r0, _0819DEE8 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819DEDC: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E + .align 2, 0 +_0819DEE4: .4byte 0x03001284 +_0819DEE8: .4byte 0x0203cf20 +_0819DEEC: + bl sub_819DBD8 + bl sub_819E0C0 + ldr r0, _0819DF0C + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819DF02 + bl sub_819F304 +_0819DF02: + movs r0, 0 + bl sub_819F048 + b _0819E006 + .align 2, 0 +_0819DF0C: .4byte 0x03001284 +_0819DF10: + ldr r0, _0819DF28 + bl sub_819EBEC + movs r0, 0x2 + bl Window_WriteStandardTileMap + ldr r1, _0819DF2C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .align 2, 0 +_0819DF28: .4byte 0x085eec73 +_0819DF2C: .4byte 0x030022c0 +_0819DF30: + bl sub_819EFA8 + movs r0, 0x8 + bl Window_WriteStandardTileMap + b _0819E006 +_0819DF3C: + ldr r0, _0819DF5C + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0819DF4A + bl sub_819EB4C +_0819DF4A: + movs r0, 0x1 + bl Window_WriteStandardTileMap + ldr r1, _0819DF60 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .align 2, 0 +_0819DF5C: .4byte 0x03001284 +_0819DF60: .4byte 0x030022c0 +_0819DF64: + bl sub_819EB18 + movs r0, 0 + bl Window_WriteStandardTileMap + b _0819E006 +_0819DF70: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E +_0819DF78: + ldr r0, _0819DF88 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + beq _0819E006 + bl sub_819EE08 + b _0819E006 + .align 2, 0 +_0819DF88: .4byte 0x03001284 +_0819DF8C: + bl sub_819ED78 + movs r0, 0x3 + bl Window_WriteStandardTileMap + ldr r1, _0819DFA0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .align 2, 0 +_0819DFA0: .4byte 0x030022c0 +_0819DFA4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r0, _0819DFF4 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819E000 + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r1, _0819DFF8 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0819DFFC + movs r0, 0x52 + bl lcd_io_set + b _0819E006 + .align 2, 0 +_0819DFF4: .4byte 0x03001284 +_0819DFF8: .4byte 0x00001248 +_0819DFFC: .4byte 0x0000040b +_0819E000: + movs r0, 0x3 + bl gpu_sync_bg_hide +_0819E006: + ldr r1, _0819E018 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819E00E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819E0AA + .align 2, 0 +_0819E018: .4byte 0x030022c0 +_0819E01C: + ldr r0, _0819E05C + movs r1, 0 + bl AddTask + ldr r6, _0819E060 + ldr r1, [r6] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r6] + ldrb r5, [r0, 0x15] + cmp r5, 0 + bne _0819E06C + ldr r4, _0819E064 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, _0819E068 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819E0A4 + .align 2, 0 +_0819E05C: .4byte sub_819CF54 + 1 +_0819E060: .4byte 0x03001284 +_0819E064: .4byte 0x03005e00 +_0819E068: .4byte sub_819CE40 + 1 +_0819E06C: + bl sub_819EAF8 + ldr r4, _0819E0B4 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + adds r2, 0x22 + strb r3, [r2] + ldr r0, _0819E0B8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x8] +_0819E0A4: + ldr r0, _0819E0BC + bl set_callback2 +_0819E0AA: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819E0B4: .4byte 0x03005e00 +_0819E0B8: .4byte sub_819CD34 + 1 +_0819E0BC: .4byte sub_819C7E0 + 1 + thumb_func_end sub_819DC1C + + thumb_func_start sub_819E0C0 +sub_819E0C0: @ 819E0C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r1, sp + ldr r0, _0819E4B0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + mov r1, sp + movs r0, 0x65 + strh r0, [r1, 0x2] + movs r6, 0 + ldr r4, _0819E4B4 + movs r7, 0 + ldr r5, _0819E4B8 +_0819E0E6: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 20 + movs r3, 0x90 + lsls r3, 15 + adds r1, r3 + asrs r1, 16 + mov r0, sp + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r4] + adds r1, 0x5 + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x5 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0819E0E6 + ldr r7, _0819E4B4 + ldr r1, [r7] + adds r0, r1, 0x5 + ldrb r1, [r1, 0x3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0819E4B8 + adds r0, r4 + movs r5, 0x20 + ldrsh r1, [r0, r5] + ldr r0, _0819E4BC + movs r2, 0x58 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + movs r4, 0 + strb r0, [r1, 0x4] + ldr r0, _0819E4C0 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0x1] + ldr r0, _0819E4C4 + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0x2] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, _0819E4B8 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r0, [r0, 0x15] + movs r1, 0xC0 + str r1, [sp, 0x18] + cmp r0, 0x1 + bne _0819E1E8 + movs r2, 0xF0 + str r2, [sp, 0x18] +_0819E1E8: + mov r1, sp + ldr r0, _0819E4BC + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r4, 0x68 + mov r10, r4 + mov r5, r10 + strh r5, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0xA + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0x8] + mov r1, sp + ldr r0, _0819E4C0 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + mov r0, sp + movs r1, 0x69 + mov r9, r1 + mov r2, r9 + strh r2, [r0] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0xA + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0x9] + movs r5, 0x90 + lsls r5, 1 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0xA + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0xA] + mov r1, sp + ldr r0, _0819E4BC + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r3, 0x6A + mov r8, r3 + mov r6, r8 + strh r6, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0xB] + mov r1, sp + ldr r0, _0819E4C0 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r1, sp + movs r0, 0x6B + strh r0, [r1] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0xC] + mov r0, sp + movs r6, 0x6C + strh r6, [r0] + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0xD] + mov r1, sp + ldr r0, _0819E4BC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r4, r10 + strh r4, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0xA + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0xE] + mov r1, sp + ldr r0, _0819E4C0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + mov r0, sp + mov r3, r9 + strh r3, [r0] + ldr r4, [sp, 0x18] + adds r4, 0x10 + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0xA + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0xF] + mov r1, sp + ldr r0, _0819E4BC + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r5, r8 + strh r5, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0x10] + mov r1, sp + ldr r0, _0819E4C0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + strh r6, [r0] + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r1, [r7] + strb r0, [r1, 0x11] + movs r6, 0 + ldr r5, _0819E4B8 + adds r4, r7, 0 + movs r7, 0 + movs r0, 0x4 + mov r10, r0 +_0819E330: + ldr r0, [r4] + lsls r3, r6, 1 + adds r2, r3, r6 + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r10 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, _0819E4B4 + mov r8, r3 + ldr r0, _0819E4B8 + mov r9, r0 + cmp r6, 0x1 + bhi _0819E496 + b _0819E330 +_0819E496: + ldr r0, [r3] + ldrb r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + b _0819E4C8 + .align 2, 0 +_0819E4B0: .4byte 0x08610834 +_0819E4B4: .4byte 0x03001284 +_0819E4B8: .4byte 0x02020630 +_0819E4BC: .4byte 0x0861084c +_0819E4C0: .4byte 0x08610864 +_0819E4C4: .4byte 0x0861087c +_0819E4C8: + ands r0, r2 + strb r0, [r1] + mov r1, r8 + ldr r0, [r1] + ldrb r1, [r0, 0xF] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r2, r8 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r4, r8 + ldr r0, [r4] + ldrb r1, [r0, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r0, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + 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_819E0C0 + + thumb_func_start sub_819E538 +sub_819E538: @ 819E538 + push {r4-r7,lr} + movs r5, 0 +_0819E53C: + ldr r6, _0819E600 + ldr r0, [r6] + adds r0, 0x5 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _0819E604 + adds r0, r4 + bl obj_delete_and_free_tiles + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819E53C + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r5, 0 +_0819E590: + movs r4, 0 + lsls r6, r5, 1 +_0819E594: + ldr r0, _0819E600 + ldr r0, [r0] + adds r1, r6, r5 + adds r1, r4, r1 + adds r0, 0x8 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0819E604 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E594 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E590 + movs r5, 0 +_0819E5C6: + movs r4, 0 + adds r7, r5, 0x1 + lsls r6, r5, 1 +_0819E5CC: + ldr r0, _0819E600 + ldr r0, [r0] + adds r1, r4, r6 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0819E604 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819E5CC + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E5C6 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819E600: .4byte 0x03001284 +_0819E604: .4byte 0x02020630 + thumb_func_end sub_819E538 + + thumb_func_start sub_819E608 +sub_819E608: @ 819E608 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _0819E65C + ldr r4, _0819E654 + ldr r5, _0819E658 + ldr r0, [r5] + ldrb r1, [r0, 0x4] + 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] + bl sub_819E8EC + ldr r0, [r5] + ldrb r2, [r0, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r0, 0x5 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + b _0819E684 + .align 2, 0 +_0819E654: .4byte 0x02020630 +_0819E658: .4byte 0x03001284 +_0819E65C: + ldr r2, _0819E68C + ldr r3, _0819E690 + ldr r0, [r3] + ldrb r1, [r0, 0x4] + 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] + ldr r1, [r0, 0x18] + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0] + bl sub_819E838 +_0819E684: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819E68C: .4byte 0x02020630 +_0819E690: .4byte 0x03001284 + thumb_func_end sub_819E608 + + thumb_func_start sub_819E694 +sub_819E694: @ 819E694 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + lsls r4, 24 + cmp r4, 0 + ble _0819E6C0 + ldr r1, _0819E6BC + ldr r2, [r1] + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r3, [r2, 0x17] + cmp r0, r3 + bne _0819E6D8 + movs r0, 0 + b _0819E6D8 + .align 2, 0 +_0819E6BC: .4byte 0x03001284 +_0819E6C0: + ldr r0, _0819E6D0 + ldr r2, [r0] + ldrb r3, [r2, 0x3] + adds r1, r0, 0 + cmp r3, 0 + beq _0819E6D4 + subs r0, r3, 0x1 + b _0819E6D8 + .align 2, 0 +_0819E6D0: .4byte 0x03001284 +_0819E6D4: + ldrb r0, [r2, 0x17] + subs r0, 0x1 +_0819E6D8: + strb r0, [r2, 0x3] + ldr r0, [r1] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E694 + + thumb_func_start sub_819E6E8 +sub_819E6E8: @ 819E6E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + lsls r4, 24 + cmp r4, 0 + ble _0819E728 + ldr r0, _0819E710 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + adds r4, r0, 0 + cmp r1, 0x2 + bhi _0819E714 + movs r0, 0x3 + strb r0, [r2, 0x3] + b _0819E74A + .align 2, 0 +_0819E710: .4byte 0x03001284 +_0819E714: + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r1, [r2, 0x17] + cmp r0, r1 + beq _0819E722 + strb r0, [r2, 0x3] + b _0819E74A +_0819E722: + movs r0, 0 + strb r0, [r2, 0x3] + b _0819E74A +_0819E728: + ldr r0, _0819E740 + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r3, 0 + adds r4, r0, 0 + cmp r2, 0x2 + bls _0819E744 + cmp r2, 0 + beq _0819E744 + subs r0, r3, 0x1 + b _0819E748 + .align 2, 0 +_0819E740: .4byte 0x03001284 +_0819E744: + ldrb r0, [r1, 0x17] + subs r0, 0x1 +_0819E748: + strb r0, [r1, 0x3] +_0819E74A: + ldr r0, [r4] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E6E8 + + thumb_func_start sub_819E758 +sub_819E758: @ 819E758 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819E778 + ldr r0, _0819E770 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819E774 + adds r0, r3, 0x1 + b _0819E78E + .align 2, 0 +_0819E770: .4byte 0x03001284 +_0819E774: + movs r0, 0 + b _0819E78E +_0819E778: + ldr r0, _0819E788 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E78C + subs r0, r3, 0x1 + b _0819E78E + .align 2, 0 +_0819E788: .4byte 0x03001284 +_0819E78C: + movs r0, 0x1 +_0819E78E: + strb r0, [r1, 0x16] + ldr r3, _0819E7BC + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .align 2, 0 +_0819E7BC: .4byte 0x02020630 + thumb_func_end sub_819E758 + + thumb_func_start sub_819E7C0 +sub_819E7C0: @ 819E7C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + lsls r4, 24 + cmp r4, 0 + ble _0819E7EC + ldr r0, _0819E7E4 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819E7E8 + adds r0, r3, 0x1 + b _0819E802 + .align 2, 0 +_0819E7E4: .4byte 0x03001284 +_0819E7E8: + movs r0, 0 + b _0819E802 +_0819E7EC: + ldr r0, _0819E7FC + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E800 + subs r0, r3, 0x1 + b _0819E802 + .align 2, 0 +_0819E7FC: .4byte 0x03001284 +_0819E800: + movs r0, 0x2 +_0819E802: + strb r0, [r1] + ldr r3, _0819E834 + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819E834: .4byte 0x02020630 + thumb_func_end sub_819E7C0 + + thumb_func_start sub_819E838 +sub_819E838: @ 819E838 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x5 + negs r0, r0 + mov r9, r0 + movs r2, 0x4 + mov r8, r2 + ldr r0, _0819E890 + mov r12, r0 + ldr r7, _0819E894 +_0819E856: + cmp r6, 0x2 + bne _0819E898 + ldr r5, _0819E890 + ldr r3, _0819E894 + ldr r0, [r3] + adds r0, 0xB + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] + cmp r4, 0x1 + bhi _0819E8D4 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + b _0819E8CA + .align 2, 0 +_0819E890: .4byte 0x02020630 +_0819E894: .4byte 0x03001284 +_0819E898: + cmp r6, 0x3 + bne _0819E8D4 + cmp r4, 0x1 + bhi _0819E8BA + ldr r0, [r7] + adds r0, 0x10 + adds r0, r4 + 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] +_0819E8BA: + ldr r0, [r7] + adds r0, 0xB + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r12 +_0819E8CA: + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r8 + orrs r1, r2 + strb r1, [r0] +_0819E8D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E856 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E838 + + thumb_func_start sub_819E8EC +sub_819E8EC: @ 819E8EC + push {r4-r6,lr} + movs r2, 0 + ldr r5, _0819E93C + ldr r4, _0819E940 + adds r6, r5, 0 + movs r3, 0x4 +_0819E8F8: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + cmp r2, 0x1 + bhi _0819E92C + ldr r0, [r4] + adds r0, 0x10 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] +_0819E92C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819E8F8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819E93C: .4byte 0x02020630 +_0819E940: .4byte 0x03001284 + thumb_func_end sub_819E8EC + + thumb_func_start sub_819E944 +sub_819E944: @ 819E944 + push {r4,r5,lr} + ldr r0, _0819E958 + ldr r3, [r0] + ldrb r1, [r3, 0x15] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0819E95C + movs r0, 0 + strb r0, [r3, 0x15] + b _0819E960 + .align 2, 0 +_0819E958: .4byte 0x03001284 +_0819E95C: + movs r0, 0 + strb r0, [r3] +_0819E960: + ldr r4, _0819E9DC + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + 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] + ldrb r1, [r0, 0x2] + 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] + bl sub_819EC20 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819E9DC: .4byte 0x02020630 + thumb_func_end sub_819E944 + + thumb_func_start sub_819E9E0 +sub_819E9E0: @ 819E9E0 + push {r4,r5,lr} + ldr r5, _0819EA5C + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x16] + ldr r4, _0819EA60 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + 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] + ldrb r1, [r0, 0x2] + 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] + bl sub_819EC94 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819EA5C: .4byte 0x03001284 +_0819EA60: .4byte 0x02020630 + thumb_func_end sub_819E9E0 + + thumb_func_start sub_819EA64 +sub_819EA64: @ 819EA64 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0819EAB8 + ldr r3, _0819EABC + ldr r0, [r3] + ldrb r1, [r0, 0x1] + 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] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + adds r0, r4, 0 + bl Window_FillTileMap + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819EAB8: .4byte 0x02020630 +_0819EABC: .4byte 0x03001284 + thumb_func_end sub_819EA64 + + thumb_func_start sub_819EAC0 +sub_819EAC0: @ 819EAC0 + push {lr} + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAC0 + + thumb_func_start sub_819EADC +sub_819EADC: @ 819EADC + push {lr} + movs r0, 0x7 + bl Window_WriteStandardTileMap + movs r0, 0x7 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x7 + movs r1, 0x2 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_819EADC + + thumb_func_start sub_819EAF8 +sub_819EAF8: @ 819EAF8 + push {lr} + bl sub_819EAC0 + movs r0, 0x5 + bl Window_WriteStandardTileMap + movs r0, 0x5 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAF8 + + thumb_func_start sub_819EB18 +sub_819EB18: @ 819EB18 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl Window_FastFillPixels + ldr r2, _0819EB48 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_0819EB48: .4byte 0x085eec66 + thumb_func_end sub_819EB18 + + thumb_func_start sub_819EB4C +sub_819EB4C: @ 819EB4C + push {r4,lr} + sub sp, 0xC + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _0819EB6C + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EB70 + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + b _0819EBD4 + .align 2, 0 +_0819EB6C: .4byte 0x03001284 +_0819EB70: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EB84 + movs r0, 0x64 + muls r0, r2 + ldr r1, _0819EB80 + b _0819EB8A + .align 2, 0 +_0819EB80: .4byte 0x020244ec +_0819EB84: + movs r0, 0x64 + muls r0, r2 + ldr r1, _0819EBDC +_0819EB8A: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, _0819EBE0 + movs r0, 0xB + muls r1, r0 + ldr r0, _0819EBE4 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0819EBE8 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram +_0819EBD4: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819EBDC: .4byte 0x02024744 +_0819EBE0: .4byte 0x02021fc4 +_0819EBE4: .4byte 0x083185c8 +_0819EBE8: .4byte 0x08610925 + thumb_func_end sub_819EB4C + + thumb_func_start sub_819EBEC +sub_819EBEC: @ 819EBEC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x2 + bl Print + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819EBEC + + thumb_func_start sub_819EC20 +sub_819EC20: @ 819EC20 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x3 + movs r1, 0 + bl Window_FastFillPixels + ldr r5, _0819EC84 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, _0819EC88 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0819EC8C + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x11 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0819EC90 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819EC84: .4byte 0x08610922 +_0819EC88: .4byte 0x085eecaa +_0819EC8C: .4byte 0x085eeca5 +_0819EC90: .4byte 0x085eecb2 + thumb_func_end sub_819EC20 + + thumb_func_start sub_819EC94 +sub_819EC94: @ 819EC94 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0x4 + movs r1, 0 + bl Window_FastFillPixels + ldr r5, _0819ECE4 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, _0819ECE8 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, _0819ECEC + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819ECE4: .4byte 0x08610922 +_0819ECE8: .4byte 0x085eecca +_0819ECEC: .4byte 0x085eecce + thumb_func_end sub_819EC94 + + thumb_func_start sub_819ECF0 +sub_819ECF0: @ 819ECF0 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r0, 0 + adds r1, r6, 0 + movs r2, 0x46 + bl sub_81DB368 + adds r2, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _0819ED30 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + adds r3, r5, 0 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819ED30: .4byte 0x08610922 + thumb_func_end sub_819ECF0 + + thumb_func_start sub_819ED34 +sub_819ED34: @ 819ED34 + push {lr} + movs r0, 0x5 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _0819ED6C + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED56 + cmp r0, 0x1 + bne _0819ED60 + ldr r0, _0819ED70 + movs r1, 0 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED56: + ldr r0, _0819ED74 + movs r1, 0x18 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED60: + movs r0, 0x5 + movs r1, 0x3 + bl Window_CopyToVram + pop {r0} + bx r0 + .align 2, 0 +_0819ED6C: .4byte 0x03001284 +_0819ED70: .4byte 0x085eecd1 +_0819ED74: .4byte 0x085eecdd + thumb_func_end sub_819ED34 + + thumb_func_start sub_819ED78 +sub_819ED78: @ 819ED78 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _0819EDB0 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED9A + cmp r0, 0x1 + bne _0819EDA4 + ldr r0, _0819EDB4 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 +_0819ED9A: + ldr r0, _0819EDB8 + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDA4: + movs r0, 0x3 + movs r1, 0x3 + bl Window_CopyToVram + pop {r0} + bx r0 + .align 2, 0 +_0819EDB0: .4byte 0x03001284 +_0819EDB4: .4byte 0x085eecd1 +_0819EDB8: .4byte 0x085eecdd + thumb_func_end sub_819ED78 + + thumb_func_start sub_819EDBC +sub_819EDBC: @ 819EDBC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0819EDCC + cmp r0, 0x1 + beq _0819EDEC + b _0819EDF6 +_0819EDCC: + ldr r0, _0819EDE4 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819EDF6 + ldr r0, _0819EDE8 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 + b _0819EDF6 + .align 2, 0 +_0819EDE4: .4byte 0x03001284 +_0819EDE8: .4byte 0x085eecd1 +_0819EDEC: + ldr r0, _0819EE04 + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDF6: + movs r0, 0x3 + movs r1, 0x3 + bl Window_CopyToVram + pop {r0} + bx r0 + .align 2, 0 +_0819EE04: .4byte 0x085eecdd + thumb_func_end sub_819EDBC + + thumb_func_start sub_819EE08 +sub_819EE08: @ 819EE08 + push {r4,lr} + sub sp, 0x18 + ldr r0, _0819EE30 + add r1, sp, 0xC + movs r2, 0x4 + bl CpuSet + ldr r0, _0819EE34 + ldr r2, [r0] + ldrb r0, [r2, 0x15] + cmp r0, 0 + bne _0819EE3C + add r0, sp, 0xC + ldr r1, _0819EE38 + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0, 0x8] + b _0819EE42 + .align 2, 0 +_0819EE30: .4byte 0x08610918 +_0819EE34: .4byte 0x03001284 +_0819EE38: .4byte 0x02037b14 +_0819EE3C: + add r1, sp, 0xC + ldrh r0, [r2, 0x24] + strh r0, [r1, 0x8] +_0819EE42: + add r0, sp, 0xC + movs r1, 0xF0 + movs r2, 0xA + bl gpu_pal_apply + movs r0, 0x7 + bl Window_WriteStandardTileMap + movs r0, 0x7 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _0819EE70 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EE74 + movs r0, 0x7 + movs r1, 0x3 + bl Window_CopyToVram + b _0819EED8 + .align 2, 0 +_0819EE70: .4byte 0x03001284 +_0819EE74: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EE88 + movs r0, 0x64 + muls r0, r2 + ldr r1, _0819EE84 + b _0819EE8E + .align 2, 0 +_0819EE84: .4byte 0x020244ec +_0819EE88: + movs r0, 0x64 + muls r0, r2 + ldr r1, _0819EEE0 +_0819EE8E: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, _0819EEE4 + movs r0, 0xB + muls r1, r0 + ldr r0, _0819EEE8 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0819EEEC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x7 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x7 + movs r1, 0x3 + bl Window_CopyToVram +_0819EED8: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819EEE0: .4byte 0x02024744 +_0819EEE4: .4byte 0x02021fc4 +_0819EEE8: .4byte 0x083185c8 +_0819EEEC: .4byte 0x08610925 + thumb_func_end sub_819EE08 + + thumb_func_start sub_819EEF0 +sub_819EEF0: @ 819EEF0 + push {r4,lr} + sub sp, 0xC + ldr r0, _0819EF1C + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply + ldr r0, _0819EF20 + ldr r1, _0819EF24 + movs r2, 0x5 + bl CpuSet + ldr r0, _0819EF28 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EF2C + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + b _0819EF90 + .align 2, 0 +_0819EF1C: .4byte 0x08610918 +_0819EF20: .4byte 0x020378f4 +_0819EF24: .4byte 0x02037cd4 +_0819EF28: .4byte 0x03001284 +_0819EF2C: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EF40 + movs r0, 0x64 + muls r0, r2 + ldr r1, _0819EF3C + b _0819EF46 + .align 2, 0 +_0819EF3C: .4byte 0x020244ec +_0819EF40: + movs r0, 0x64 + muls r0, r2 + ldr r1, _0819EF98 +_0819EF46: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, _0819EF9C + movs r0, 0xB + muls r1, r0 + ldr r0, _0819EFA0 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl sub_81DB368 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _0819EFA4 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl Window_CopyToVram +_0819EF90: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819EF98: .4byte 0x02024744 +_0819EF9C: .4byte 0x02021fc4 +_0819EFA0: .4byte 0x083185c8 +_0819EFA4: .4byte 0x08610925 + thumb_func_end sub_819EEF0 + + thumb_func_start sub_819EFA8 +sub_819EFA8: @ 819EFA8 + push {r4-r6,lr} + sub sp, 0x2C + ldr r6, _0819EFCC + ldr r0, [r6] + ldrb r4, [r0, 0x3] + adds r5, r4, 0 + movs r0, 0x8 + movs r1, 0 + bl Window_FastFillPixels + cmp r4, 0x2 + bls _0819EFD0 + movs r0, 0x8 + movs r1, 0x2 + bl Window_CopyToVram + b _0819F03A + .align 2, 0 +_0819EFCC: .4byte 0x03001284 +_0819EFD0: + movs r0, 0x8 + bl Window_WriteStandardTileMap + ldr r0, [r6] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819EFEC + movs r0, 0x64 + muls r0, r4 + ldr r1, _0819EFE8 + b _0819EFF2 + .align 2, 0 +_0819EFE8: .4byte 0x020244ec +_0819EFEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _0819F044 +_0819EFF2: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl sub_81DB368 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x8 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + movs r0, 0x8 + movs r1, 0x2 + bl Window_CopyToVram +_0819F03A: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F044: .4byte 0x02024744 + thumb_func_end sub_819EFA8 + + thumb_func_start sub_819F048 +sub_819F048: @ 819F048 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, _0819F064 + ldr r3, [r4] + ldrb r0, [r3, 0x15] + cmp r0, 0x1 + beq _0819F094 + cmp r2, 0 + beq _0819F068 + cmp r2, 0x1 + beq _0819F080 + b _0819F094 + .align 2, 0 +_0819F064: .4byte 0x03001284 +_0819F068: + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r2, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, _0819F07C + b _0819F092 + .align 2, 0 +_0819F07C: .4byte 0x08610928 +_0819F080: + movs r1, 0 + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x5 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, _0819F09C +_0819F092: + str r0, [r1, 0x18] +_0819F094: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819F09C: .4byte 0x08610948 + thumb_func_end sub_819F048 + + thumb_func_start sub_819F0A0 +sub_819F0A0: @ 819F0A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0819F0C0 + ldr r2, _0819F0C4 + ldr r1, _0819F0C8 + ldr r1, [r1] + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0819F0C0: .4byte 0x03001280 +_0819F0C4: .4byte 0x086108ac +_0819F0C8: .4byte 0x03001284 + thumb_func_end sub_819F0A0 + + thumb_func_start sub_819F0CC +sub_819F0CC: @ 819F0CC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0819F108 + ldr r1, [r5] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r0, [r5] + ldrb r1, [r0, 0x3] + movs r5, 0 + strb r1, [r0, 0x12] + movs r0, 0x3 + bl sub_819EA64 + ldr r1, _0819F10C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, _0819F110 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819F108: .4byte 0x03001284 +_0819F10C: .4byte 0x03005e00 +_0819F110: .4byte sub_819D9EC + 1 + thumb_func_end sub_819F0CC + + thumb_func_start sub_819F114 +sub_819F114: @ 819F114 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819F12C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + ldr r0, _0819F130 + str r0, [r1] + bx lr + .align 2, 0 +_0819F12C: .4byte 0x03005e00 +_0819F130: .4byte sub_819C90C + 1 + thumb_func_end sub_819F114 + + thumb_func_start sub_819F134 +sub_819F134: @ 819F134 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _0819F174 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + ldr r1, _0819F178 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, _0819F17C + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, _0819F180 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819F174: .4byte 0x03001284 +_0819F178: .4byte 0x03005e00 +_0819F17C: .4byte sub_819CE40 + 1 +_0819F180: .4byte sub_819D770 + 1 + thumb_func_end sub_819F134 + + thumb_func_start sub_819F184 +sub_819F184: @ 819F184 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _0819F1A4 + ldr r1, _0819F1A8 + ldr r2, [r1] + ldrb r1, [r2, 0x3] + ldr r2, [r2, 0x18] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1, 0x4] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_0819F1A4: .4byte 0x03001280 +_0819F1A8: .4byte 0x03001284 + thumb_func_end sub_819F184 + + thumb_func_start sub_819F1AC +sub_819F1AC: @ 819F1AC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819F1D0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _0819F1D4 + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x8] + strh r3, [r1, 0x12] + ldr r0, _0819F1D8 + str r0, [r1] + bx lr + .align 2, 0 +_0819F1D0: .4byte 0x03005e00 +_0819F1D4: .4byte sub_819CC24 + 1 +_0819F1D8: .4byte sub_819D588 + 1 + thumb_func_end sub_819F1AC + + thumb_func_start sub_819F1DC +sub_819F1DC: @ 819F1DC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819F200 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, _0819F204 + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x12] + strh r3, [r1, 0x8] + ldr r0, _0819F208 + str r0, [r1] + bx lr + .align 2, 0 +_0819F200: .4byte 0x03005e00 +_0819F204: .4byte sub_819D9EC + 1 +_0819F208: .4byte sub_819D588 + 1 + thumb_func_end sub_819F1DC + + thumb_func_start sub_819F20C +sub_819F20C: @ 819F20C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, _0819F234 + ldr r1, [r5] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F240 + ldr r3, _0819F238 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + ldr r2, _0819F23C + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x2 + strh r1, [r0, 0x12] + b _0819F292 + .align 2, 0 +_0819F234: .4byte 0x03001284 +_0819F238: .4byte 0x03005e00 +_0819F23C: .4byte sub_819CD34 + 1 +_0819F240: + ldrb r0, [r1, 0x3] + bl sub_819F59C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0819F278 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r1, _0819F270 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r4, [r0, 0x12] + ldr r1, _0819F274 + b _0819F29E + .align 2, 0 +_0819F270: .4byte 0x03005e00 +_0819F274: .4byte sub_819F488 + 1 +_0819F278: + ldr r4, _0819F2A8 + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r0, r4 + ldr r2, _0819F2AC + lsrs r1, r2, 16 + movs r3, 0 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + strh r3, [r0, 0x12] + adds r3, r4, 0 + adds r4, r5, 0 +_0819F292: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, _0819F2B0 +_0819F29E: + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F2A8: .4byte 0x03005e00 +_0819F2AC: .4byte sub_819CCD4 + 1 +_0819F2B0: .4byte sub_819D588 + 1 + thumb_func_end sub_819F20C + + thumb_func_start sub_819F2B4 +sub_819F2B4: @ 819F2B4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + ldr r0, _0819F2F8 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + strb r0, [r4] + ldr r2, _0819F2FC + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _0819F300 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x3C] + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F2F8: .4byte 0x08610894 +_0819F2FC: .4byte 0x02020630 +_0819F300: .4byte sub_819F600 + 1 + thumb_func_end sub_819F2B4 + + thumb_func_start sub_819F304 +sub_819F304: @ 819F304 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + ldr r0, _0819F3E4 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl obj_add_from_template_forward_search + ldr r6, _0819F3E8 + ldr r1, [r6] + adds r1, 0x2D + movs r2, 0 + mov r10, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _0819F3EC + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl sub_8008258 + ldr r0, [r6] + ldrb r1, [r0, 0x3] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, _0819F3F0 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r2, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, _0819F3F4 + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r1, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + adds r1, 0x2C + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + mov r2, r10 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F3E4: .4byte 0x08610894 +_0819F3E8: .4byte 0x03001284 +_0819F3EC: .4byte 0x02020630 +_0819F3F0: .4byte 0x020244ec +_0819F3F4: .4byte 0x0000ffff + thumb_func_end sub_819F304 + + thumb_func_start sub_819F3F8 +sub_819F3F8: @ 819F3F8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r0, _0819F43C + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819F440 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x16] + lsrs r4, 8 + lsls r4, 24 + lsrs r4, 24 + strh r4, [r1, 0x14] + ldr r1, [r1] + bl _call_via_r1 + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F43C: .4byte sub_819F7B4 + 1 +_0819F440: .4byte 0x03005e00 + thumb_func_end sub_819F3F8 + + thumb_func_start sub_819F444 +sub_819F444: @ 819F444 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r5, _0819F484 + lsls r4, 16 + lsrs r1, r4, 24 + 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 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl obj_delete_and_free_tiles + movs r0, 0 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F484: .4byte 0x02020630 + thumb_func_end sub_819F444 + + thumb_func_start sub_819F488 +sub_819F488: @ 819F488 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _0819F4BC + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + beq _0819F58A + ldr r2, _0819F4C0 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0819F58A + lsls r0, 2 + ldr r1, _0819F4C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0819F4BC: .4byte 0x03001284 +_0819F4C0: .4byte 0x03005e00 +_0819F4C4: .4byte _0819F4C8 + .align 2, 0 +_0819F4C8: + .4byte _0819F4DC + .4byte _0819F4F8 + .4byte _0819F52C + .4byte _0819F548 + .4byte _0819F568 +_0819F4DC: + ldr r0, _0819F4F0 + bl sub_819EBEC + ldr r0, _0819F4F4 + ldr r0, [r0] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + b _0819F54E + .align 2, 0 +_0819F4F0: .4byte 0x085eed0a +_0819F4F4: .4byte 0x03001284 +_0819F4F8: + ldr r0, _0819F524 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0819F50C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819F58A +_0819F50C: + movs r0, 0x5 + bl audio_play + ldr r0, _0819F528 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + b _0819F54E + .align 2, 0 +_0819F524: .4byte 0x030022c0 +_0819F528: .4byte 0x03001284 +_0819F52C: + ldr r0, [r3] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819F58A + movs r0, 0x5 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x5 + movs r1, 0x2 + bl Window_CopyToVram + b _0819F54E +_0819F548: + ldr r0, _0819F560 + bl sub_819EBEC +_0819F54E: + ldr r0, _0819F564 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819F58A + .align 2, 0 +_0819F560: .4byte 0x085eec8b +_0819F564: .4byte 0x03005e00 +_0819F568: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, _0819F590 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _0819F594 + adds r0, r5, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldr r1, _0819F598 + str r1, [r0] +_0819F58A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819F590: .4byte 0x03001284 +_0819F594: .4byte 0x03005e00 +_0819F598: .4byte sub_819CE40 + 1 + thumb_func_end sub_819F488 + + thumb_func_start sub_819F59C +sub_819F59C: @ 819F59C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, _0819F5E0 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0819F5B8: + ldr r0, _0819F5E4 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + cmp r4, r0 + beq _0819F5EC + movs r0, 0x64 + muls r0, r4 + ldr r1, _0819F5E8 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bne _0819F5EC + movs r0, 0x1 + b _0819F5F8 + .align 2, 0 +_0819F5E0: .4byte 0x02024744 +_0819F5E4: .4byte 0x03001284 +_0819F5E8: .4byte 0x020244ec +_0819F5EC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819F5B8 + movs r0, 0 +_0819F5F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_819F59C + + thumb_func_start sub_819F600 +sub_819F600: @ 819F600 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F640 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0819F648 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0819F64C + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r4, 0x3C] + strh r2, [r1, 0x16] + ldr r1, [r1] + bl _call_via_r1 + ldr r0, _0819F650 + str r0, [r4, 0x1C] +_0819F640: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0819F648: .4byte sub_819F69C + 1 +_0819F64C: .4byte 0x03005e00 +_0819F650: .4byte nullsub_12 + 1 + thumb_func_end sub_819F600 + + thumb_func_start sub_819F654 +sub_819F654: @ 819F654 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F694 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0819F688 + ldr r0, _0819F684 + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0 + strb r1, [r0] + b _0819F68E + .align 2, 0 +_0819F684: .4byte 0x03001284 +_0819F688: + movs r0, 0 + bl sub_819BE20 +_0819F68E: + adds r0, r4, 0 + bl obj_delete_and_free_tiles +_0819F694: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819F654 + + thumb_func_start sub_819F69C +sub_819F69C: @ 819F69C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0819F6C0 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819F71A + cmp r0, 0x1 + bgt _0819F6C4 + cmp r0, 0 + beq _0819F6CA + b _0819F77C + .align 2, 0 +_0819F6C0: .4byte 0x03005e00 +_0819F6C4: + cmp r0, 0x2 + beq _0819F73C + b _0819F77C +_0819F6CA: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x37 + bl lcd_io_set + b _0819F7A6 +_0819F71A: + movs r0, 0x3 + bl gpu_sync_bg_show + ldr r1, _0819F734 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _0819F738 + movs r0, 0x52 + bl lcd_io_set + b _0819F7A6 + .align 2, 0 +_0819F734: .4byte 0x00001248 +_0819F738: .4byte 0x0000040b +_0819F73C: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819F758 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819F760 +_0819F758: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] +_0819F760: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _0819F7AC + b _0819F7A6 +_0819F77C: + adds r0, r5, 0 + bl remove_task + ldr r0, _0819F79C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0819F7A0 + bl sub_819F8E0 + b _0819F7AC + .align 2, 0 +_0819F79C: .4byte 0x03005e00 +_0819F7A0: + bl sub_819BD70 + b _0819F7AC +_0819F7A6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F7AC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F69C + + thumb_func_start sub_819F7B4 +sub_819F7B4: @ 819F7B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _0819F838 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819F844 + cmp r0, 0x1 + beq _0819F894 + movs r0, 0x3 + bl gpu_sync_bg_hide + ldr r3, _0819F83C + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0x3C] + movs r0, 0x14 + ldrsh r1, [r4, 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] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, _0819F840 + str r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + bl sub_8008258 + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + adds r0, r5, 0 + bl remove_task + b _0819F8D8 + .align 2, 0 +_0819F838: .4byte 0x03005e00 +_0819F83C: .4byte 0x02020630 +_0819F840: .4byte sub_819F654 + 1 +_0819F844: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl lcd_io_set + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x37 + bl lcd_io_set + b _0819F8D2 +_0819F894: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819F8B0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819F8B8 +_0819F8B0: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819F8B8: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl lcd_io_set + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819F8D8 +_0819F8D2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F8D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F7B4 + + thumb_func_start sub_819F8E0 +sub_819F8E0: @ 819F8E0 + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, _0819F8F8 + ldr r1, [r0] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F900 + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0819F8FC + b _0819F908 + .align 2, 0 +_0819F8F8: .4byte 0x03001284 +_0819F8FC: .4byte 0x020244ec +_0819F900: + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, _0819F98C +_0819F908: + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, _0819F990 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_818D7D8 + ldr r2, _0819F994 + ldr r1, [r2] + adds r1, 0x2C + movs r3, 0 + strb r0, [r1] + ldr r4, _0819F998 + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x30 + strb r3, [r0] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0819F98C: .4byte 0x02024744 +_0819F990: .4byte 0x0000ffff +_0819F994: .4byte 0x03001284 +_0819F998: .4byte 0x02020630 + thumb_func_end sub_819F8E0 + + thumb_func_start sub_819F99C +sub_819F99C: @ 819F99C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _0819FA38 + ldr r1, [r2] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDE + ldrb r1, [r1] + movs r6, 0 + adds r7, r2, 0 + ldr r0, _0819FA3C + mov r8, r0 + cmp r1, 0 + beq _0819F9DC +_0819F9C2: + adds r0, r1, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r1, 0 + beq _0819F9DC + cmp r6, 0x3 + bls _0819F9C2 +_0819F9DC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, [r7] + adds r1, r4, r1 + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + mov r0, r8 + bl strcpy_limit_7_chars + ldr r0, [r7] + adds r0, r4 + ldr r1, _0819FA40 + adds r0, r1 + ldrb r1, [r0] + mov r0, r8 + bl sub_8009308 + ldr r0, _0819FA44 + ldr r1, [r7] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0x1 + adds r3, r6, 0 + bl decimal_int_to_string + ldr r1, _0819FA48 + ldr r0, [r7] + adds r0, r4 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 25 + adds r0, r1 + ldr r1, [r0] + ldr r0, _0819FA4C + bl ExpandTextCodes + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819FA38: .4byte 0x03005d90 +_0819FA3C: .4byte 0x02021cc4 +_0819FA40: .4byte 0x0000011b +_0819FA44: .4byte 0x02021dc4 +_0819FA48: .4byte 0x08611330 +_0819FA4C: .4byte 0x02021fc4 + thumb_func_end sub_819F99C + + thumb_func_start sub_819FA50 +sub_819FA50: @ 819FA50 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_819FA50 + + thumb_func_start sub_819FA5C +sub_819FA5C: @ 819FA5C + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + adds r4, r3, 0 + adds r4, 0x28 + ldr r0, _0819FA9C + adds r5, r0, 0 +_0819FA6A: + lsls r0, r2, 1 + adds r0, r4, r0 + ldrh r1, [r0] + orrs r1, r5 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FA6A + adds r1, r3, 0 + adds r1, 0x38 + movs r0, 0xFF + strb r0, [r1] + ldrb r1, [r3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0819FA9C: .4byte 0x0000ffff + thumb_func_end sub_819FA5C + + thumb_func_start sub_819FAA0 +sub_819FAA0: @ 819FAA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r3, _0819FBA0 + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0 + mov r12, r0 + adds r5, r3, 0 + mov r8, r0 + ldr r1, _0819FBA4 + mov r10, r1 +_0819FAC6: + movs r2, 0 + mov r3, r12 + lsls r7, r3, 4 + movs r4, 0x1 + add r4, r12 + mov r9, r4 + adds r0, r7, r3 + lsls r3, r0, 2 +_0819FAD6: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r3 + movs r4, 0x82 + lsls r4, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + mov r4, r10 + orrs r0, r4 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FAD6 + ldr r2, [r5] + mov r0, r12 + adds r3, r7, r0 + lsls r3, 2 + adds r2, r3 + adds r2, 0xDC + ldrb r1, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r3 + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xDC + ldrb r2, [r1] + movs r0, 0x61 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDE + mov r4, r8 + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDD + strb r4, [r0] + movs r2, 0 + ldr r6, _0819FBA0 + movs r4, 0x88 + lsls r4, 1 +_0819FB48: + ldr r0, [r6] + adds r1, r2, r3 + adds r0, r4 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0819FB48 + ldr r0, [r5] + mov r3, r12 + adds r2, r7, r3 + lsls r2, 2 + adds r0, r2 + ldr r4, _0819FBA8 + ldrb r1, [r4] + ldr r3, _0819FBAC + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + movs r4, 0x8E + lsls r4, 1 + adds r0, r4 + adds r0, r2 + mov r1, r8 + str r1, [r0] + mov r3, r9 + lsls r0, r3, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3 + bls _0819FAC6 + bl sub_81A087C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819FBA0: .4byte 0x03005d90 +_0819FBA4: .4byte 0x0000ffff +_0819FBA8: .4byte 0x082e9531 +_0819FBAC: .4byte 0x0000011b + thumb_func_end sub_819FAA0 + + thumb_func_start sub_819FBB0 +sub_819FBB0: @ 819FBB0 + ldr r0, _0819FBC4 + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + movs r1, 0x3 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_0819FBC4: .4byte 0x03005d90 + thumb_func_end sub_819FBB0 + + thumb_func_start sub_819FBC8 +sub_819FBC8: @ 819FBC8 + push {r4,r5,lr} + ldr r2, _0819FC08 + ldr r0, [r2] + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, 0 + bne _0819FC10 + adds r4, r2, 0 + ldr r5, _0819FC0C +_0819FBDA: + bl GenerateRandomNumber + ldr r2, [r4] + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 16 + adds r1, r5 + ldrb r0, [r1] + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FBDA + b _0819FC38 + .align 2, 0 +_0819FC08: .4byte 0x03005d90 +_0819FC0C: .4byte 0x08611548 +_0819FC10: + adds r4, r2, 0 +_0819FC12: + bl GenerateRandomNumber + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FC12 +_0819FC38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819FBC8 + + thumb_func_start sub_819FC40 +sub_819FC40: @ 819FC40 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0819FC5C + ldr r2, [r1] + adds r2, 0xB1 + movs r1, 0x3 + ands r0, r1 + ldrb r3, [r2] + subs r1, 0x7 + ands r1, r3 + orrs r1, r0 + strb r1, [r2] + bx lr + .align 2, 0 +_0819FC5C: .4byte 0x03005d90 + thumb_func_end sub_819FC40 + + thumb_func_start sub_819FC60 +sub_819FC60: @ 819FC60 + push {r4-r7,lr} + sub sp, 0xC + movs r5, 0 +_0819FC66: + mov r1, sp + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FC66 + movs r5, 0 +_0819FC78: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r7, sp + adds r2, r7, r4 + ldrb r3, [r2] + adds r1, r7, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FC78 + movs r5, 0 + ldr r6, _0819FCF4 + movs r4, 0xF +_0819FCBC: + ldr r3, [r6] + adds r3, 0xB4 + adds r3, r5 + lsls r2, r5, 1 + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, r4, 0 + ands r1, r0 + lsls r1, 4 + adds r2, 0x1 + mov r7, sp + adds r0, r7, r2 + ldrb r2, [r0] + adds r0, r4, 0 + ands r0, r2 + orrs r1, r0 + strb r1, [r3] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FCBC + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819FCF4: .4byte 0x03005d90 + thumb_func_end sub_819FC60 + + thumb_func_start sub_819FCF8 +sub_819FCF8: @ 819FCF8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r0, 0x2 + bne _0819FD4C + ldr r6, _0819FD48 +_0819FD06: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r1, [r6] + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 1 + adds r1, 0x2 +_0819FD26: + lsls r0, r2, 1 + adds r0, r4 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _0819FD38 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_0819FD38: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0819FD26 + cmp r3, 0x3 + bhi _0819FD06 + b _0819FD5A + .align 2, 0 +_0819FD48: .4byte 0x030062ec +_0819FD4C: + cmp r0, 0x1 + bne _0819FD5A + ldrb r0, [r2] + adds r1, r0 + ldrb r5, [r1] + adds r0, 0x1 + strb r0, [r2] +_0819FD5A: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819FCF8 + + thumb_func_start sub_819FD64 +sub_819FD64: @ 819FD64 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r5, 0 + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x14] + mov r1, sp + adds r1, 0x10 + str r1, [sp, 0x18] + adds r1, r0, 0 +_0819FD80: + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FD80 + movs r5, 0 + ldr r6, [sp, 0x14] +_0819FD92: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FD92 + movs r5, 0 + ldr r2, _0819FF8C +_0819FDD0: + mov r4, sp + adds r1, r4, r5 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FDD0 + movs r5, 0 +_0819FDE6: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r6, sp + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FDE6 + ldr r4, _0819FF90 + movs r0, 0x30 + bl malloc_and_clear + str r0, [r4] + movs r1, 0 + strb r1, [r0] + movs r5, 0 + movs r2, 0x4 +_0819FE34: + movs r3, 0 +_0819FE36: + ldr r0, [r4] + lsls r1, r3, 2 + adds r1, r3 + adds r1, r5, r1 + adds r0, 0x20 + adds r0, r1 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819FE36 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _0819FE34 + movs r0, 0 + ldr r7, [sp, 0x18] + strb r0, [r7] + movs r5, 0 +_0819FE60: + ldr r0, _0819FF94 + ldr r3, [r0] + lsls r4, r5, 2 + adds r3, r4 + mov r1, sp + adds r6, r1, r5 + ldrb r0, [r6] + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + ldrb r0, [r3] + movs r7, 0x4 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldrb r0, [r6] + adds r5, 0x1 + str r5, [sp, 0x1C] + mov r8, r4 + cmp r0, 0x3 + beq _0819FF62 + ldrb r0, [r6] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x18] + bl sub_819FCF8 + ldr r1, _0819FF94 + ldr r3, [r1] + add r3, r8 + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r0, [r3] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldr r7, _0819FF94 + ldr r0, [r7] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r7, r0, 30 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0819FF62 + lsls r0, r7, 2 + adds r0, r7 + mov r10, r0 + ldr r0, _0819FF90 + mov r9, r0 +_0819FED2: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + movs r1, 0x3 + ands r4, r1 + movs r3, 0 + mov r6, r9 + ldr r2, [r6] + ldrb r0, [r2] + adds r1, r0, 0x1 + lsls r5, r7, 2 + cmp r3, r1 + bge _0819FF12 + adds r2, 0x20 + mov r6, r10 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r4 + beq _0819FF12 + adds r6, r1, 0 + adds r1, r5, r7 +_0819FEFE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bge _0819FF12 + adds r0, r3, r1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r4 + bne _0819FEFE +_0819FF12: + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0] + adds r0, 0x1 + ldr r1, _0819FF90 + cmp r3, r0 + bne _0819FED2 + ldr r0, [r1] + orrs r5, r7 + ldrb r2, [r0] + adds r1, r5, r2 + adds r0, 0x20 + adds r0, r1 + strb r4, [r0] + ldr r6, _0819FF94 + ldr r2, [r6] + add r2, r8 + adds r2, 0xB8 + movs r7, 0x3 + ands r4, r7 + lsls r3, r4, 4 + ldrb r0, [r2] + movs r4, 0x31 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldr r0, [r6] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + bl sub_819FF98 + ldr r1, [r6] + add r1, r8 + adds r1, 0xBA + strh r0, [r1] +_0819FF62: + ldr r6, [sp, 0x1C] + lsls r0, r6, 24 + lsrs r5, r0, 24 + cmp r5, 0x8 + bhi _0819FF6E + b _0819FE60 +_0819FF6E: + ldr r4, _0819FF90 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0819FF8C: .4byte 0x086114d3 +_0819FF90: .4byte 0x030062ec +_0819FF94: .4byte 0x03005d90 + thumb_func_end sub_819FD64 + + thumb_func_start sub_819FF98 +sub_819FF98: @ 819FF98 + 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, 0xC] + movs r7, 0 + ldr r1, [sp] + cmp r1, 0x2 + bhi _0819FFE0 + ldr r2, _0819FFDC + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xB4 + ldr r3, [sp] + adds r0, r3 + ldrb r4, [r0] + adds r1, 0xB2 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r3 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r4, r0 + movs r0, 0xF + ands r4, r0 + b _0819FFE4 + .align 2, 0 +_0819FFDC: .4byte 0x03005d90 +_0819FFE0: + movs r4, 0 + ldr r2, _081A00A4 +_0819FFE4: + ldr r3, _081A00A8 + lsls r1, r4, 1 + ldr r4, [r2] + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + str r1, [sp, 0x8] + ldr r1, _081A00AC + ldr r2, [sp, 0x8] + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r3, 0 + adds r4, 0xB1 + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r5, 0x3C + cmp r0, 0x1 + bne _081A001A + movs r5, 0x32 +_081A001A: + ldrh r1, [r6] + ldr r4, _081A00B0 + cmp r1, r4 + beq _081A004C + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r5, 9 + cmp r0, r1 + bgt _081A004C + adds r5, r2, 0 + adds r2, r1, 0 +_081A0034: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r4 + beq _081A004C + adds r0, r5, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0034 +_081A004C: + adds r5, r3, 0 + movs r3, 0 + str r3, [sp, 0x4] +_081A0052: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A0068 + ldr r0, [sp, 0xC] + cmp r0, 0x1 + bne _081A00E0 +_081A0068: + ldr r1, _081A00B4 + mov r8, r1 +_081A006C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3A + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [sp, 0x8] + adds r1, r4, 0 + bl sub_806E064 + adds r2, r0, 0 + cmp r2, 0 + beq _081A006C + ldr r2, _081A00B8 + adds r0, r4, r2 + bl sub_81B6CFC + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0x1 + cmp r5, 0x4 + bhi _081A00BC + movs r3, 0 + b _081A00C6 + .align 2, 0 +_081A00A4: .4byte 0x03005d90 +_081A00A8: .4byte 0x08610970 +_081A00AC: .4byte 0x0832937c +_081A00B0: .4byte 0x0000ffff +_081A00B4: .4byte 0x000001ff +_081A00B8: .4byte 0x00000121 +_081A00BC: + subs r0, r5, 0x4 + b _081A00C2 +_081A00C0: + adds r0, r3, 0x1 +_081A00C2: + lsls r0, 24 + lsrs r3, r0, 24 +_081A00C6: + cmp r3, r5 + bcs _081A00DA + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r8 + ands r0, r1 + cmp r0, r7 + bne _081A00C0 + movs r2, 0 +_081A00DA: + cmp r2, 0x1 + bne _081A006C + b _081A0146 +_081A00E0: + cmp r5, 0x4 + bhi _081A00EA + movs r2, 0x1 + str r2, [sp, 0xC] + b _081A0168 +_081A00EA: + subs r4, r5, 0x4 + ldr r3, _081A0124 + mov r10, r3 + mov r8, r3 + lsls r0, r4, 24 + mov r9, r0 +_081A00F6: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r0, 23 + adds r0, r6 + ldrh r0, [r0] + mov r7, r8 + ands r7, r0 + movs r2, 0x1 + mov r1, r9 + lsrs r3, r1, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + mov r0, r8 + b _081A013A + .align 2, 0 +_081A0124: .4byte 0x000001ff +_081A0128: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r10 +_081A013A: + ands r0, r1 + cmp r0, r7 + bne _081A0128 + movs r2, 0 +_081A0142: + cmp r2, 0x1 + bne _081A00F6 +_081A0146: + ldr r0, [sp] + adds r1, r7, 0 + bl sub_81A0194 + lsls r0, 24 + cmp r0, 0 + beq _081A0168 + ldr r0, _081A018C + adds r0, r7, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _081A0170 + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] +_081A0168: + ldr r2, [sp, 0x4] + cmp r2, 0x4 + bhi _081A0170 + b _081A0052 +_081A0170: + ldr r0, _081A0190 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r7, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081A018C: .4byte 0x08611370 +_081A0190: .4byte 0x030062ec + thumb_func_end sub_819FF98 + + thumb_func_start sub_81A0194 +sub_81A0194: @ 81A0194 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + movs r3, 0 + ldr r0, _081A01C0 + mov r12, r0 + ldr r2, [r0] + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r6, r0, 1 + adds r2, 0x2 + adds r7, r1, 0 +_081A01B0: + lsls r0, r3, 1 + adds r0, r6 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, r5 + bne _081A01C4 + movs r0, 0 + b _081A01E2 + .align 2, 0 +_081A01C0: .4byte 0x030062ec +_081A01C4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x4 + bls _081A01B0 + mov r2, r12 + ldr r1, [r2] + adds r0, r7, r4 + ldrb r2, [r1] + adds r0, r2 + lsls r0, 1 + adds r1, 0x2 + adds r1, r0 + strh r5, [r1] + movs r0, 0x1 +_081A01E2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A0194 + + thumb_func_start sub_81A01E8 +sub_81A01E8: @ 81A01E8 + push {r4-r7,lr} + mov r12, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _081A0274 + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r4, 0x3C + cmp r0, 0x1 + bne _081A0204 + movs r4, 0x32 +_081A0204: + ldr r1, _081A0278 + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r5, 0 + ldrh r1, [r6] + ldr r3, _081A027C + cmp r1, r3 + beq _081A0240 + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r4, 9 + cmp r0, r1 + bgt _081A0240 + adds r4, r2, 0 + adds r2, r1, 0 +_081A0228: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r3 + beq _081A0240 + adds r0, r4, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0228 +_081A0240: + adds r4, r5, 0 + cmp r4, 0x4 + bls _081A0248 + movs r4, 0x4 +_081A0248: + movs r2, 0 + cmp r2, r4 + bcs _081A026C + ldr r7, _081A0280 +_081A0250: + lsls r3, r2, 1 + add r3, r12 + adds r2, 0x1 + subs r0, r5, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r0] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + lsls r2, 24 + lsrs r2, 24 + cmp r2, r4 + bcc _081A0250 +_081A026C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A0274: .4byte 0x03005d90 +_081A0278: .4byte 0x0832937c +_081A027C: .4byte 0x0000ffff +_081A0280: .4byte 0x000001ff + thumb_func_end sub_81A01E8 + + thumb_func_start sub_81A0284 +sub_81A0284: @ 81A0284 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r1, _081A02B4 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A02B8 + movs r0, 0 + b _081A037C + .align 2, 0 +_081A02B4: .4byte 0x03005d90 +_081A02B8: + movs r4, 0 + movs r3, 0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, _081A038C + mov r12, r1 + lsls r6, 1 + lsls r5, 1 + mov r9, r5 + cmp r0, 0 + beq _081A02F4 + adds r2, r7, 0 +_081A02D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bhi _081A02F4 + ldr r0, [r2] + lsls r1, r3, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A02D4 +_081A02F4: + ldr r0, [r7] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r6, r0 + mov r1, r12 + adds r1, 0x34 + adds r0, r1 + ldrh r0, [r0] + mov r1, sp + bl sub_81A01E8 + movs r3, 0 + cmp r3, r4 + bcs _081A0376 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + bge _081A0376 + adds r6, r7, 0 + adds r5, r1, 0 +_081A032A: + lsls r0, r3, 2 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _081A035C + lsls r0, r1, 28 + lsrs r0, 30 + cmp r0, r8 + bne _081A035C + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A035C + lsls r0, r1, 26 + lsrs r0, 30 + lsls r0, 1 + mov r7, sp + adds r1, r7, r0 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A035C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _081A0376 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + blt _081A032A +_081A0376: + mov r0, sp + add r0, r9 + ldrh r0, [r0] +_081A037C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081A038C: .4byte 0x08610970 + thumb_func_end sub_81A0284 + + thumb_func_start sub_81A0390 +sub_81A0390: @ 81A0390 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r7, _081A04A0 + adds r6, r7, 0 + movs r4, 0 +_081A03A6: + ldr r0, [r6] + lsls r2, r5, 1 + adds r2, r5 + lsls r2, 2 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0xE0 + strh r4, [r1] + adds r0, 0xEA + strh r4, [r0] + movs r3, 0 +_081A03BC: + ldr r0, [r6] + lsls r1, r3, 1 + adds r1, r2 + adds r0, 0xE2 + adds r0, r1 + strh r4, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _081A03BC + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03A6 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsrs r3, r0, 6 + movs r5, 0 +_081A03E6: + lsls r0, r3, 2 + mov r1, sp + adds r2, r1, r0 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, 0xE0 + ldr r1, [r7] + adds r1, r0 + str r1, [r2] + adds r0, r3, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03E6 + movs r5, 0 + ldr r7, _081A04A0 + ldr r6, _081A04A4 +_081A0416: + ldr r0, [r7] + mov r12, r0 + adds r0, 0xB4 + adds r0, r5 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r0, r5, 2 + mov r1, sp + adds r3, r1, r0 + ldr r4, [r3] + lsls r2, 1 + mov r0, r12 + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + adds r2, r6 + ldrh r0, [r2] + strh r0, [r4] + ldr r1, [r3] + ldrh r0, [r1] + adds r1, 0x2 + bl sub_81A01E8 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A0416 + movs r5, 0 + cmp r5, r8 + bcs _081A04D6 + ldr r7, _081A04A0 +_081A0470: + ldr r1, [r7] + lsls r0, r5, 2 + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r0, r2, 30 + lsrs r1, r0, 30 + lsls r0, r2, 28 + lsrs r3, r0, 30 + adds r6, r3, 0 + cmp r1, 0x1 + bne _081A04A8 + lsrs r0, r2, 6 + cmp r0, 0 + beq _081A04CC + lsls r0, r3, 2 + add r0, sp + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1, 0xA] + b _081A04CC + .align 2, 0 +_081A04A0: .4byte 0x03005d90 +_081A04A4: .4byte 0x086109a4 +_081A04A8: + cmp r1, 0x2 + bne _081A04CC + lsls r0, r2, 24 + lsrs r0, 30 + cmp r0, 0 + beq _081A04CC + lsls r2, 26 + lsrs r2, 30 + lsls r0, r6, 2 + add r0, sp + ldr r1, [r0] + lsls r2, 1 + adds r1, 0x2 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A04CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081A0470 +_081A04D6: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A0390 + + thumb_func_start sub_81A04E4 +sub_81A04E4: @ 81A04E4 + 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 + movs r7, 0x2 + cmp r0, 0x6 + bls _081A04FC + b _081A064C +_081A04FC: + lsls r0, 2 + ldr r1, _081A0508 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A0508: .4byte _081A050C + .align 2, 0 +_081A050C: + .4byte _081A0528 + .4byte _081A0540 + .4byte _081A05B4 + .4byte _081A05F4 + .4byte _081A061C + .4byte _081A064C + .4byte _081A0634 +_081A0528: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, _081A0538 + str r0, [sp, 0xC] + ldr r0, _081A053C + str r0, [sp, 0x10] + b _081A0652 + .align 2, 0 +_081A0538: .4byte 0x085eaeb1 +_081A053C: .4byte 0x085eaeb8 +_081A0540: + movs r7, 0x3 + movs r1, 0x12 + mov r10, r1 + movs r6, 0x6 + movs r4, 0 + ldr r0, _081A05A8 + mov r9, r0 + ldr r0, _081A05AC + ldr r3, [r0] + movs r1, 0xB2 + adds r1, r3 + mov r12, r1 + adds r5, r3, 0 + adds r5, 0xB0 + ldr r0, _081A05B0 + mov r8, r0 +_081A0560: + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r4 + ldrb r2, [r0] + mov r1, r12 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r2, 1 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + add r2, r8 + ldrh r1, [r2] + lsls r0, r4, 2 + mov r2, sp + adds r2, r0 + adds r2, 0xC + movs r0, 0xB + muls r0, r1 + add r0, r9 + str r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A0560 + b _081A0652 + .align 2, 0 +_081A05A8: .4byte 0x083185c8 +_081A05AC: .4byte 0x03005d90 +_081A05B0: .4byte 0x086109a4 +_081A05B4: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, _081A05E8 + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + cmp r0, 0x2 + bls _081A05CC + b _081A06FA +_081A05CC: + ldr r0, _081A05EC + ldr r3, [r0] + ldrh r0, [r3, 0x2] + movs r2, 0xB + muls r0, r2 + ldr r1, _081A05F0 + adds r0, r1 + str r0, [sp, 0x10] + ldrh r0, [r3] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0xC] + b _081A0652 + .align 2, 0 +_081A05E8: .4byte 0x03005d90 +_081A05EC: .4byte 0x030062f0 +_081A05F0: .4byte 0x083185c8 +_081A05F4: + movs r1, 0x11 + mov r10, r1 + movs r6, 0x8 + ldr r0, _081A0614 + ldr r3, [r0] + ldrh r0, [r3, 0x4] + movs r2, 0xD + muls r0, r2 + ldr r1, _081A0618 + adds r0, r1 + str r0, [sp, 0xC] + ldrh r0, [r3, 0x6] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0x10] + b _081A0652 + .align 2, 0 +_081A0614: .4byte 0x030062f0 +_081A0618: .4byte 0x0831977c +_081A061C: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, _081A062C + str r0, [sp, 0xC] + ldr r0, _081A0630 + str r0, [sp, 0x10] + b _081A0652 + .align 2, 0 +_081A062C: .4byte 0x085ed193 +_081A0630: .4byte 0x085ed198 +_081A0634: + movs r1, 0x14 + mov r10, r1 + movs r6, 0x8 + ldr r0, _081A0644 + str r0, [sp, 0xC] + ldr r0, _081A0648 + str r0, [sp, 0x10] + b _081A0652 + .align 2, 0 +_081A0644: .4byte 0x085eae62 +_081A0648: .4byte 0x085eae66 +_081A064C: + movs r0, 0 + mov r10, r0 + movs r6, 0 +_081A0652: + movs r5, 0 + movs r4, 0 + lsls r1, r7, 25 + mov r8, r1 + cmp r4, r7 + bcs _081A067E +_081A065E: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + cmp r0, r5 + ble _081A0674 + adds r5, r0, 0 +_081A0674: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A065E +_081A067E: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + adds r1, r4, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + mov r0, r8 + lsrs r3, r0, 24 + mov r0, r10 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_81A0784 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r4, 0 + cmp r4, r7 + bcs _081A06E6 +_081A06B8: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r2, [r0] + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A06B8 +_081A06E6: + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_81A0804 +_081A06FA: + 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_81A04E4 + + thumb_func_start sub_81A070C +sub_81A070C: @ 81A070C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081A072C + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0730 + bl ProcessMenuInputNoWrapAround + b _081A0734 + .align 2, 0 +_081A072C: .4byte 0x03005e08 +_081A0730: + bl ProcessMenuInput +_081A0734: + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081A0778 + adds r0, 0x1 + cmp r1, r0 + bne _081A0764 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0778 + movs r0, 0x5 + bl audio_play + ldr r1, _081A0760 + movs r0, 0x7F + strh r0, [r1] + b _081A0768 + .align 2, 0 +_081A0760: .4byte 0x020375f0 +_081A0764: + ldr r0, _081A0780 + strh r1, [r0] +_081A0768: + ldrb r0, [r4, 0xC] + bl sub_81A07E8 + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_081A0778: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A0780: .4byte 0x020375f0 + thumb_func_end sub_81A070C + + thumb_func_start sub_81A0784 +sub_81A0784: @ 81A0784 + push {r4,r5,lr} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsls r5, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + adds r5, r0 + lsrs r5, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl Window_AddFromTemplate + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x3 + bl Window_CopyToVram + adds r0, r4, 0 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A0784 + + thumb_func_start sub_81A07E8 +sub_81A07E8: @ 81A07E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8198070 + adds r0, r4, 0 + bl Window_Remove + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A07E8 + + thumb_func_start sub_81A0804 +sub_81A0804: @ 81A0804 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _081A0838 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _081A083C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r4, [r1, 0x10] + cmp r5, 0x3 + bls _081A0840 + movs r0, 0x1 + b _081A0842 + .align 2, 0 +_081A0838: .4byte sub_81A070C + 1 +_081A083C: .4byte 0x03005e00 +_081A0840: + movs r0, 0 +_081A0842: + strh r0, [r1, 0x12] + ldr r1, _081A0858 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x14] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A0858: .4byte 0x03005e00 + thumb_func_end sub_81A0804 + + thumb_func_start sub_81A085C +sub_81A085C: @ 81A085C + push {lr} + ldr r1, _081A0874 + ldr r0, _081A0878 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081A0874: .4byte 0x086114e0 +_081A0878: .4byte 0x020375e0 + thumb_func_end sub_81A085C + + thumb_func_start sub_81A087C +sub_81A087C: @ 81A087C + push {r4-r7,lr} + bl sub_819FBC8 + ldr r3, _081A0938 + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3D + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r4, 0 + movs r1, 0 +_081A08BE: + ldr r0, [r3] + adds r0, 0xB4 + adds r0, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A08BE + movs r4, 0 + ldr r5, _081A0938 + movs r0, 0x4 + negs r0, r0 + mov r12, r0 + movs r7, 0xD + negs r7, r7 + movs r6, 0x31 + negs r6, r6 +_081A08E2: + ldr r1, [r5] + lsls r3, r4, 2 + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xBA + movs r1, 0 + strh r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _081A08E2 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A0938: .4byte 0x03005d90 + thumb_func_end sub_81A087C + + thumb_func_start sub_81A093C +sub_81A093C: @ 81A093C + push {lr} + bl sub_819FBB0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081A0954 + ldr r0, _081A0950 + strh r1, [r0] + b _081A095A + .align 2, 0 +_081A0950: .4byte 0x020375f0 +_081A0954: + ldr r1, _081A0960 + movs r0, 0x1 + strh r0, [r1] +_081A095A: + pop {r0} + bx r0 + .align 2, 0 +_081A0960: .4byte 0x020375f0 + thumb_func_end sub_81A093C + + thumb_func_start sub_81A0964 +sub_81A0964: @ 81A0964 + push {lr} + ldr r0, _081A0974 + ldrb r0, [r0] + bl sub_819FC40 + pop {r0} + bx r0 + .align 2, 0 +_081A0974: .4byte 0x020375e2 + thumb_func_end sub_81A0964 + + thumb_func_start sub_81A0978 +sub_81A0978: @ 81A0978 + push {lr} + bl sub_819FBC8 + pop {r0} + bx r0 + thumb_func_end sub_81A0978 + + thumb_func_start sub_81A0984 +sub_81A0984: @ 81A0984 + push {lr} + bl sub_819FD64 + pop {r0} + bx r0 + thumb_func_end sub_81A0984 + + thumb_func_start sub_81A0990 +sub_81A0990: @ 81A0990 + ldr r0, _081A09B0 + ldr r2, [r0] + adds r2, 0xB1 + ldrb r3, [r2] + lsls r1, r3, 26 + lsrs r1, 28 + adds r1, 0x1 + movs r0, 0xF + ands r1, r0 + lsls r1, 2 + movs r0, 0x3D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .align 2, 0 +_081A09B0: .4byte 0x03005d90 + thumb_func_end sub_81A0990 + + thumb_func_start sub_81A09B4 +sub_81A09B4: @ 81A09B4 + ldr r1, _081A09C8 + ldr r0, _081A09CC + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + strh r0, [r1] + bx lr + .align 2, 0 +_081A09C8: .4byte 0x020375f0 +_081A09CC: .4byte 0x03005d90 + thumb_func_end sub_81A09B4 + + thumb_func_start sub_81A09D0 +sub_81A09D0: @ 81A09D0 + push {lr} + ldr r3, _081A09EC + ldr r0, [r3] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r1, r0, 0x3 + cmp r1, 0 + bge _081A09F4 + ldr r1, _081A09F0 + movs r0, 0 + strh r0, [r1] + b _081A0A1C + .align 2, 0 +_081A09EC: .4byte 0x03005d90 +_081A09F0: .4byte 0x020375f0 +_081A09F4: + ldr r2, _081A0A14 + cmp r1, 0x8 + ble _081A09FE + movs r0, 0x1 + strh r0, [r2] +_081A09FE: + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0A18 + movs r0, 0x1 + b _081A0A1A + .align 2, 0 +_081A0A14: .4byte 0x020375f0 +_081A0A18: + movs r0, 0 +_081A0A1A: + strh r0, [r2] +_081A0A1C: + pop {r0} + bx r0 + thumb_func_end sub_81A09D0 + + thumb_func_start sub_81A0A20 +sub_81A0A20: @ 81A0A20 + push {lr} + ldr r0, _081A0A30 + ldrb r0, [r0] + bl sub_81A04E4 + pop {r0} + bx r0 + .align 2, 0 +_081A0A30: .4byte 0x020375e2 + thumb_func_end sub_81A0A20 + + thumb_func_start sub_81A0A34 +sub_81A0A34: @ 81A0A34 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _081A0A68 + adds r0, r4, 0 + bl remove_task + ldr r0, _081A0A5C + ldrh r0, [r0] + cmp r0, 0 + beq _081A0A64 + ldr r0, _081A0A60 + bl sub_81A172C + b _081A0A68 + .align 2, 0 +_081A0A5C: .4byte 0x020375e2 +_081A0A60: .4byte script_env_2_enable_and_set_ctx_running + 1 +_081A0A64: + bl script_env_2_enable_and_set_ctx_running +_081A0A68: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A0A34 + + thumb_func_start sub_81A0A70 +sub_81A0A70: @ 81A0A70 + push {lr} + ldr r1, _081A0A88 + ldrh r0, [r1] + cmp r0, 0x6 + bne _081A0A94 + ldr r1, _081A0A8C + ldr r0, _081A0A90 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .align 2, 0 +_081A0A88: .4byte 0x020375e4 +_081A0A8C: .4byte 0x08610ff0 +_081A0A90: .4byte 0x03005d90 +_081A0A94: + cmp r0, 0x7 + bne _081A0AB0 + ldr r1, _081A0AA8 + ldr r0, _081A0AAC + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .align 2, 0 +_081A0AA8: .4byte 0x08610ff0 +_081A0AAC: .4byte 0x03005d90 +_081A0AB0: + cmp r0, 0x8 + bne _081A0ACC + ldr r1, _081A0AC4 + ldr r0, _081A0AC8 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .align 2, 0 +_081A0AC4: .4byte 0x086111b0 +_081A0AC8: .4byte 0x03005d90 +_081A0ACC: + cmp r0, 0x9 + bne _081A0AE8 + ldr r1, _081A0AE0 + ldr r0, _081A0AE4 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .align 2, 0 +_081A0AE0: .4byte 0x086111b0 +_081A0AE4: .4byte 0x03005d90 +_081A0AE8: + cmp r0, 0x4 + bne _081A0B04 + ldr r1, _081A0AFC + ldr r0, _081A0B00 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .align 2, 0 +_081A0AFC: .4byte 0x08611230 +_081A0B00: .4byte 0x03005d90 +_081A0B04: + cmp r0, 0x5 + bne _081A0B20 + ldr r1, _081A0B18 + ldr r0, _081A0B1C + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .align 2, 0 +_081A0B18: .4byte 0x08611230 +_081A0B1C: .4byte 0x03005d90 +_081A0B20: + cmp r0, 0xA + bne _081A0B40 + ldr r2, _081A0B38 + ldr r0, _081A0B3C + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + b _081A0BD6 + .align 2, 0 +_081A0B38: .4byte 0x08611070 +_081A0B3C: .4byte 0x03005d90 +_081A0B40: + cmp r0, 0xB + bne _081A0B5C + ldr r1, _081A0B54 + ldr r0, _081A0B58 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .align 2, 0 +_081A0B54: .4byte 0x086112b0 +_081A0B58: .4byte 0x03005d90 +_081A0B5C: + cmp r0, 0xC + bne _081A0B7C + ldr r2, _081A0B74 + ldr r0, _081A0B78 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0xC + b _081A0BD6 + .align 2, 0 +_081A0B74: .4byte 0x08611070 +_081A0B78: .4byte 0x03005d90 +_081A0B7C: + cmp r0, 0xD + bne _081A0B9C + ldr r2, _081A0B94 + ldr r0, _081A0B98 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + b _081A0BD6 + .align 2, 0 +_081A0B94: .4byte 0x08611070 +_081A0B98: .4byte 0x03005d90 +_081A0B9C: + ldrh r0, [r1] + cmp r0, 0x10 + bne _081A0BC0 + ldr r2, _081A0BB8 + ldr r0, _081A0BBC + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + b _081A0BD6 + .align 2, 0 +_081A0BB8: .4byte 0x08611070 +_081A0BBC: .4byte 0x03005d90 +_081A0BC0: + cmp r0, 0xE + bne _081A0BE4 + ldr r2, _081A0BDC + ldr r0, _081A0BE0 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 +_081A0BD6: + adds r0, r2 + ldr r1, [r0] + b _081A0C7A + .align 2, 0 +_081A0BDC: .4byte 0x08611070 +_081A0BE0: .4byte 0x03005d90 +_081A0BE4: + cmp r0, 0xF + bne _081A0C00 + ldr r1, _081A0BF8 + ldr r0, _081A0BFC + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .align 2, 0 +_081A0BF8: .4byte 0x086112b0 +_081A0BFC: .4byte 0x03005d90 +_081A0C00: + cmp r0, 0 + bne _081A0C1C + ldr r1, _081A0C14 + ldr r0, _081A0C18 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + b _081A0C66 + .align 2, 0 +_081A0C14: .4byte 0x08610ef0 +_081A0C18: .4byte 0x03005d90 +_081A0C1C: + cmp r0, 0x1 + bne _081A0C38 + ldr r1, _081A0C30 + ldr r0, _081A0C34 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x4 + b _081A0C66 + .align 2, 0 +_081A0C30: .4byte 0x08610ef0 +_081A0C34: .4byte 0x03005d90 +_081A0C38: + cmp r0, 0x2 + bne _081A0C54 + ldr r1, _081A0C4C + ldr r0, _081A0C50 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x8 + b _081A0C66 + .align 2, 0 +_081A0C4C: .4byte 0x08610ef0 +_081A0C50: .4byte 0x03005d90 +_081A0C54: + cmp r0, 0x3 + bne _081A0C74 + ldr r1, _081A0C6C + ldr r0, _081A0C70 + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0xC +_081A0C66: + adds r0, r1 + ldr r1, [r0] + b _081A0C7A + .align 2, 0 +_081A0C6C: .4byte 0x08610ef0 +_081A0C70: .4byte 0x03005d90 +_081A0C74: + bl script_env_2_enable_and_set_ctx_running + b _081A0C8E +_081A0C7A: + ldr r0, _081A0C94 + bl ExpandTextCodes + movs r0, 0x1 + bl get_map_name + ldr r0, _081A0C98 + movs r1, 0x1 + bl AddTask +_081A0C8E: + pop {r0} + bx r0 + .align 2, 0 +_081A0C94: .4byte 0x02021fc4 +_081A0C98: .4byte sub_81A0A34 + 1 + thumb_func_end sub_81A0A70 + + thumb_func_start sub_81A0C9C +sub_81A0C9C: @ 81A0C9C + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + bl sub_81A0A70 + pop {r0} + bx r0 + thumb_func_end sub_81A0C9C + + thumb_func_start sub_81A0CC0 +sub_81A0CC0: @ 81A0CC0 + push {lr} + ldr r0, _081A0CDC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bhi _081A0CE4 + ldr r1, _081A0CE0 + movs r0, 0x2 + b _081A0D34 + .align 2, 0 +_081A0CDC: .4byte 0x03005d90 +_081A0CE0: .4byte 0x020375f0 +_081A0CE4: + lsrs r0, r1, 28 + cmp r0, 0xB + bhi _081A0D30 + lsrs r0, r1, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r2, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0D18 + cmp r0, 0x2 + bgt _081A0D08 + cmp r0, 0x1 + beq _081A0D0E + b _081A0D30 +_081A0D08: + cmp r0, 0x3 + beq _081A0D24 + b _081A0D30 +_081A0D0E: + ldr r1, _081A0D14 + movs r0, 0x4 + b _081A0D34 + .align 2, 0 +_081A0D14: .4byte 0x020375f0 +_081A0D18: + ldr r1, _081A0D20 + movs r0, 0x3 + b _081A0D34 + .align 2, 0 +_081A0D20: .4byte 0x020375f0 +_081A0D24: + ldr r1, _081A0D2C + movs r0, 0x1 + b _081A0D34 + .align 2, 0 +_081A0D2C: .4byte 0x020375f0 +_081A0D30: + ldr r1, _081A0D3C + movs r0, 0x5 +_081A0D34: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081A0D3C: .4byte 0x020375f0 + thumb_func_end sub_81A0CC0 + + thumb_func_start sub_81A0D40 +sub_81A0D40: @ 81A0D40 + push {r4,lr} + ldr r0, _081A0D74 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0D6E + ldr r4, _081A0D78 + ldr r0, _081A0D7C + ldr r2, [r0] + adds r2, 0xB2 + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 29 + movs r1, 0x1 + ldrb r4, [r4] + lsls r1, r4 + orrs r1, r0 + movs r0, 0x7 + ands r1, r0 + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A0D6E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A0D74: .4byte 0x020375e2 +_081A0D78: .4byte 0x020375e4 +_081A0D7C: .4byte 0x03005d90 + thumb_func_end sub_81A0D40 + + thumb_func_start sub_81A0D80 +sub_81A0D80: @ 81A0D80 + push {lr} + ldr r0, _081A0DB8 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0DCE + subs r0, 0x3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081A0DBC + ldrh r0, [r0] + cmp r0, 0 + beq _081A0DC0 + lsls r2, 2 + adds r2, r3, r2 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + b _081A0DCE + .align 2, 0 +_081A0DB8: .4byte 0x03005d90 +_081A0DBC: .4byte 0x020375e2 +_081A0DC0: + lsls r0, r2, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] +_081A0DCE: + pop {r0} + bx r0 + thumb_func_end sub_81A0D80 + + thumb_func_start sub_81A0DD4 +sub_81A0DD4: @ 81A0DD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r2, 0 + ldr r1, _081A0E78 + ldr r0, [r1] + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r3, _081A0E7C + mov r9, r3 + cmp r0, 0 + beq _081A0E14 + adds r3, r1, 0 +_081A0DF4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A0E14 + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0DF4 +_081A0E14: + mov r4, r9 + movs r0, 0x8 + bl malloc_and_clear + adds r7, r0, 0 + str r7, [r4] + ldr r0, _081A0E80 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081A0E88 + ldr r0, _081A0E78 + ldr r5, [r0] + adds r6, r5, 0 + adds r6, 0xB1 + ldrb r0, [r6] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0E3C + b _081A0FCE +_081A0E3C: + adds r2, r5, 0 + adds r2, 0xB4 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r4, r0, 4 + ldr r3, _081A0E84 + lsls r1, r4, 1 + adds r5, 0xB0 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r0, [r1] + strh r0, [r7, 0x2] + ldrb r0, [r6] + lsls r0, 26 + lsrs r0, 28 + adds r2, r0 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r0, 1 + ldrb r1, [r5] + muls r1, r4 + adds r0, r1 + adds r0, r3 + b _081A0FCA + .align 2, 0 +_081A0E78: .4byte 0x03005d90 +_081A0E7C: .4byte 0x030062f0 +_081A0E80: .4byte 0x020375e2 +_081A0E84: .4byte 0x08610970 +_081A0E88: + cmp r0, 0x3 + bne _081A0F54 + ldr r0, _081A0F4C + mov r8, r0 + ldr r5, [r0] + movs r1, 0xB1 + adds r1, r5 + mov r12, r1 + ldrb r0, [r1] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bhi _081A0EA4 + b _081A0FCE +_081A0EA4: + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + blt _081A0EAE + b _081A0FCE +_081A0EAE: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0EC4 + b _081A0FCE +_081A0EC4: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r5, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r5, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r4, [r0] + lsls r1, 2 + asrs r4, r1 + movs r0, 0xF + ands r4, r0 + ldr r2, _081A0F50 + lsls r1, r4, 1 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r3, [r0] + movs r0, 0x58 + muls r0, r3 + adds r1, r0 + adds r2, 0x34 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r7] + mov r3, r12 + ldrb r0, [r3] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r2, 26 + lsrs r2, 30 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81A0284 + mov r1, r9 + ldr r2, [r1] + strh r0, [r2, 0x4] + mov r3, r8 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + strh r0, [r2, 0x6] + b _081A0FCE + .align 2, 0 +_081A0F4C: .4byte 0x03005d90 +_081A0F50: .4byte 0x08610970 +_081A0F54: + cmp r0, 0x4 + bne _081A0FCE + ldr r0, _081A0FDC + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bls _081A0FCE + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + bge _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r0, [r0] + lsls r1, 2 + asrs r0, r1 + movs r1, 0xF + ands r0, r1 + ldr r2, _081A0FE0 + lsls r0, 1 + adds r1, r3, 0 + adds r1, 0xB0 + ldrb r3, [r1] + movs r1, 0x58 + muls r1, r3 + adds r0, r1 + adds r2, 0x34 + adds r0, r2 +_081A0FCA: + ldrh r0, [r0] + strh r0, [r7] +_081A0FCE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A0FDC: .4byte 0x03005d90 +_081A0FE0: .4byte 0x08610970 + thumb_func_end sub_81A0DD4 + + thumb_func_start sub_81A0FE4 +sub_81A0FE4: @ 81A0FE4 + push {r4,lr} + ldr r4, _081A0FF8 + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A0FF8: .4byte 0x030062f0 + thumb_func_end sub_81A0FE4 + + thumb_func_start sub_81A0FFC +sub_81A0FFC: @ 81A0FFC + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, _081A1014 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A1028 + cmp r0, 0x1 + bgt _081A1018 + cmp r0, 0 + beq _081A101E + b _081A11E6 + .align 2, 0 +_081A1014: .4byte 0x020375e2 +_081A1018: + cmp r0, 0x2 + beq _081A1030 + b _081A11E6 +_081A101E: + ldr r5, _081A1024 + b _081A1032 + .align 2, 0 +_081A1024: .4byte 0x02021cc4 +_081A1028: + ldr r5, _081A102C + b _081A1032 + .align 2, 0 +_081A102C: .4byte 0x02021dc4 +_081A1030: + ldr r5, _081A1048 +_081A1032: + ldr r0, _081A104C + ldrh r0, [r0] + cmp r0, 0x9 + bls _081A103C + b _081A11E6 +_081A103C: + lsls r0, 2 + ldr r1, _081A1050 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A1048: .4byte 0x02021ec4 +_081A104C: .4byte 0x020375e4 +_081A1050: .4byte _081A1054 + .align 2, 0 +_081A1054: + .4byte _081A107C + .4byte _081A1094 + .4byte _081A10AC + .4byte _081A10C4 + .4byte _081A10DC + .4byte _081A10F4 + .4byte _081A1118 + .4byte _081A1164 + .4byte _081A1140 + .4byte _081A1184 +_081A107C: + ldr r0, _081A108C + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, _081A1090 + adds r1, r0 + b _081A1174 + .align 2, 0 +_081A108C: .4byte 0x030062f0 +_081A1090: .4byte 0x083185c8 +_081A1094: + ldr r0, _081A10A4 + ldr r0, [r0] + ldrh r1, [r0, 0x2] + movs r0, 0xB + muls r1, r0 + ldr r0, _081A10A8 + adds r1, r0 + b _081A1174 + .align 2, 0 +_081A10A4: .4byte 0x030062f0 +_081A10A8: .4byte 0x083185c8 +_081A10AC: + ldr r0, _081A10BC + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, _081A10C0 + adds r1, r0 + b _081A1174 + .align 2, 0 +_081A10BC: .4byte 0x030062f0 +_081A10C0: .4byte 0x083185c8 +_081A10C4: + ldr r0, _081A10D4 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD + muls r1, r0 + ldr r0, _081A10D8 + adds r1, r0 + b _081A1174 + .align 2, 0 +_081A10D4: .4byte 0x030062f0 +_081A10D8: .4byte 0x0831977c +_081A10DC: + ldr r0, _081A10EC + ldr r0, [r0] + ldrh r1, [r0, 0x6] + movs r0, 0xD + muls r1, r0 + ldr r0, _081A10F0 + adds r1, r0 + b _081A1174 + .align 2, 0 +_081A10EC: .4byte 0x030062f0 +_081A10F0: .4byte 0x0831977c +_081A10F4: + ldr r0, _081A1114 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + bl itemid_get_item + adds r1, r0, 0 + b _081A1174 + .align 2, 0 +_081A1114: .4byte 0x03005d90 +_081A1118: + ldr r0, _081A113C + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_81A1650 + adds r1, r0, 0 + mov r0, sp + movs r2, 0x2 + bl sub_81DB5E8 + adds r0, r5, 0 + mov r1, sp + bl gf_strcpy + b _081A11E6 + .align 2, 0 +_081A113C: .4byte 0x03005d90 +_081A1140: + ldr r0, _081A1154 + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _081A115C + ldr r1, _081A1158 + b _081A1174 + .align 2, 0 +_081A1154: .4byte 0x03005d90 +_081A1158: .4byte 0x085eaeb1 +_081A115C: + ldr r1, _081A1160 + b _081A1174 + .align 2, 0 +_081A1160: .4byte 0x085eaeb8 +_081A1164: + ldr r0, _081A117C + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + bl sub_81638AC + ldr r1, _081A1180 +_081A1174: + adds r0, r5, 0 + bl gf_strcpy + b _081A11E6 + .align 2, 0 +_081A117C: .4byte 0x03005d90 +_081A1180: .4byte 0x02021fc4 +_081A1184: + ldr r0, _081A11BC + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xB1 + ldrb r1, [r1] + lsls r4, r1, 24 + lsrs r1, r4, 30 + adds r6, r0, 0 + cmp r1, 0x2 + bhi _081A11C0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r1 + ldrb r2, [r0] + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + b _081A11C2 + .align 2, 0 +_081A11BC: .4byte 0x03005d90 +_081A11C0: + movs r2, 0 +_081A11C2: + ldr r3, _081A11F0 + lsls r1, r2, 1 + ldr r0, [r6] + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + movs r0, 0xB + muls r1, r0 + ldr r0, _081A11F4 + adds r1, r0 + adds r0, r5, 0 + bl gf_strcpy +_081A11E6: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A11F0: .4byte 0x08610970 +_081A11F4: .4byte 0x083185c8 + thumb_func_end sub_81A0FFC + + thumb_func_start sub_81A11F8 +sub_81A11F8: @ 81A11F8 + ldr r0, _081A1210 + ldr r2, [r0] + ldr r0, _081A1214 + ldrb r1, [r0] + adds r2, 0xB1 + lsls r1, 6 + ldrb r3, [r2] + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .align 2, 0 +_081A1210: .4byte 0x03005d90 +_081A1214: .4byte 0x020375e2 + thumb_func_end sub_81A11F8 + + thumb_func_start sub_81A1218 +sub_81A1218: @ 81A1218 + push {lr} + bl sub_81AAC28 + pop {r0} + bx r0 + thumb_func_end sub_81A1218 + + thumb_func_start sub_81A1224 +sub_81A1224: @ 81A1224 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, _081A12FC + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A1242 + b _081A1362 +_081A1242: + movs r5, 0 + movs r2, 0 + adds r0, r3, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, _081A1300 + mov r12, r1 + ldr r1, _081A1304 + mov r8, r1 + cmp r0, 0 + beq _081A127C + adds r3, r7, 0 +_081A125C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A127C + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A125C +_081A127C: + movs r4, 0 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + bge _081A1322 + adds r6, r7, 0 + mov r9, r4 +_081A1296: + ldr r3, [r6] + lsls r0, r4, 2 + adds r2, r3, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A1308 + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A1308 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + mov r2, r12 + ldrh r2, [r2] + cmp r0, r2 + bne _081A1308 + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + mov r1, r9 + mov r0, r8 + strh r1, [r0] + b _081A1362 + .align 2, 0 +_081A12FC: .4byte 0x03005d90 +_081A1300: .4byte 0x020375e2 +_081A1304: .4byte 0x020375f0 +_081A1308: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + blt _081A1296 +_081A1322: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r2, r0 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1] +_081A1362: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A1224 + + thumb_func_start sub_81A1370 +sub_81A1370: @ 81A1370 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _081A13B4 + ldr r1, [r0] + movs r2, 0x8A + lsls r2, 1 + adds r1, r2 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0xFF + beq _081A1422 + movs r5, 0 +_081A138E: + ldr r1, [r4] + adds r2, r5, 0x1 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, r1, r0 + movs r5, 0x8A + lsls r5, 1 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081A13B8 + adds r0, r3, 0 + adds r0, 0xDC + adds r1, 0xDC + movs r2, 0x44 + bl memcpy + b _081A1422 + .align 2, 0 +_081A13B4: .4byte 0x03005d90 +_081A13B8: + adds r5, r2, 0 + cmp r5, 0x2 + ble _081A138E + ldr r0, _081A1430 + mov r10, r0 + movs r2, 0x1 + negs r2, r2 + mov r9, r2 + movs r5, 0x1 + ldr r7, _081A1434 + movs r0, 0x90 + lsls r0, 1 + mov r8, r0 + movs r6, 0x44 +_081A13D4: + ldr r0, [r7] + add r0, r8 + adds r0, 0x34 + bl sub_80842DC + adds r4, r0, 0 + ldr r0, [r7] + adds r0, 0xA + bl sub_80842DC + cmp r4, r0 + bne _081A13FC + ldr r0, [r7] + adds r0, r6 + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, r10 + bge _081A13FC + mov r10, r0 + mov r9, r5 +_081A13FC: + movs r2, 0x44 + add r8, r2 + adds r6, 0x44 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A13D4 + mov r5, r9 + cmp r5, 0 + ble _081A1422 + ldr r0, _081A1434 + ldr r1, [r0] + lsls r0, r5, 4 + add r0, r9 + lsls r0, 2 + adds r0, r1, r0 + adds r0, 0xDC + adds r1, 0xDC + bl memcpy +_081A1422: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A1430: .4byte 0x0000ffff +_081A1434: .4byte 0x03005d90 + thumb_func_end sub_81A1370 + + thumb_func_start sub_81A1438 +sub_81A1438: @ 81A1438 + push {r4,r5,lr} + ldr r4, _081A1478 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + adds r2, 0xDC + movs r1, 0x1F + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r1, [r0] + lsls r1, 30 + adds r2, 0xDC + lsrs r1, 25 + ldrb r3, [r2] + movs r0, 0x61 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r2, 0 + ldr r0, [r4] + b _081A148C + .align 2, 0 +_081A1478: .4byte 0x03005d90 +_081A147C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A1496 + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 +_081A148C: + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A147C +_081A1496: + ldr r4, _081A1500 + ldr r0, [r4] + adds r0, 0xDD + strb r2, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xDE + ldrb r0, [r1] + cmp r0, 0xFE + bhi _081A14AE + adds r0, 0x1 + strb r0, [r1] +_081A14AE: + ldr r0, [r4] + adds r0, 0xDD + ldrb r0, [r0] + bl sub_81A0390 + movs r2, 0 + adds r3, r4, 0 + movs r4, 0x88 + lsls r4, 1 + adds r5, r3, 0 +_081A14C2: + ldr r0, [r3] + adds r1, r0, r4 + adds r1, r2 + adds r0, 0xA + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _081A14C2 + ldr r1, [r5] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + bl gf_strcpy + ldr r1, [r5] + ldr r0, _081A1504 + ldrb r0, [r0] + ldr r2, _081A1508 + adds r1, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0xDC + bl sub_8165AE8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A1500: .4byte 0x03005d90 +_081A1504: .4byte 0x082e9531 +_081A1508: .4byte 0x0000011b + thumb_func_end sub_81A1438 + + thumb_func_start sub_81A150C +sub_81A150C: @ 81A150C + push {lr} + ldr r2, _081A1554 + ldr r0, _081A1558 + ldr r0, [r0] + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, _081A155C + ldrb r0, [r3] + cmp r0, r2 + beq _081A1542 +_081A1530: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A1542 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1530 +_081A1542: + cmp r1, 0x1E + beq _081A1568 + ldr r0, _081A1560 + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, _081A1564 + bl var_set + b _081A1594 + .align 2, 0 +_081A1554: .4byte 0x08610970 +_081A1558: .4byte 0x03005d90 +_081A155C: .4byte 0x085dcedc +_081A1560: .4byte 0x085dcf0e +_081A1564: .4byte 0x00004010 +_081A1568: + movs r1, 0 + ldr r3, _081A1598 + ldrb r0, [r3] + cmp r0, r2 + beq _081A1584 +_081A1572: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1584 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1572 +_081A1584: + cmp r1, 0x14 + beq _081A1594 + ldr r0, _081A159C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, _081A15A0 + bl var_set +_081A1594: + pop {r0} + bx r0 + .align 2, 0 +_081A1598: .4byte 0x085dcefa +_081A159C: .4byte 0x085dcf2c +_081A15A0: .4byte 0x00004010 + thumb_func_end sub_81A150C + + thumb_func_start sub_81A15A4 +sub_81A15A4: @ 81A15A4 + push {lr} + ldr r2, _081A15E8 + ldr r0, _081A15EC + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, _081A15F0 + ldrb r0, [r3] + cmp r0, r2 + beq _081A15D6 +_081A15C4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A15D6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A15C4 +_081A15D6: + cmp r1, 0x1E + beq _081A15FC + ldr r0, _081A15F4 + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, _081A15F8 + bl var_set + b _081A1628 + .align 2, 0 +_081A15E8: .4byte 0x08610970 +_081A15EC: .4byte 0x03005d90 +_081A15F0: .4byte 0x085dcedc +_081A15F4: .4byte 0x085dcf0e +_081A15F8: .4byte 0x00004010 +_081A15FC: + movs r1, 0 + ldr r3, _081A162C + ldrb r0, [r3] + cmp r0, r2 + beq _081A1618 +_081A1606: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1618 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1606 +_081A1618: + cmp r1, 0x14 + beq _081A1628 + ldr r0, _081A1630 + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, _081A1634 + bl var_set +_081A1628: + pop {r0} + bx r0 + .align 2, 0 +_081A162C: .4byte 0x085dcefa +_081A1630: .4byte 0x085dcf2c +_081A1634: .4byte 0x00004010 + thumb_func_end sub_81A15A4 + + thumb_func_start sub_81A1638 +sub_81A1638: @ 81A1638 + ldr r1, _081A1640 + movs r0, 0x1 + strh r0, [r1] + bx lr + .align 2, 0 +_081A1640: .4byte 0x020375e0 + thumb_func_end sub_81A1638 + + thumb_func_start sub_81A1644 +sub_81A1644: @ 81A1644 + ldr r1, _081A164C + movs r0, 0x1 + strh r0, [r1] + bx lr + .align 2, 0 +_081A164C: .4byte 0x020375e0 + thumb_func_end sub_81A1644 + + thumb_func_start sub_81A1650 +sub_81A1650: @ 81A1650 + push {lr} + movs r2, 0x58 + muls r2, r0 + ldr r0, _081A166C + adds r2, r0 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _081A16AC + lsls r0, 2 + ldr r1, _081A1670 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A166C: .4byte 0x08610970 +_081A1670: .4byte _081A1674 + .align 2, 0 +_081A1674: + .4byte _081A1690 + .4byte _081A1694 + .4byte _081A169A + .4byte _081A16A0 + .4byte _081A16A6 + .4byte _081A16AC + .4byte _081A16AC +_081A1690: + adds r0, r2, 0 + b _081A16B0 +_081A1694: + adds r0, r2, 0 + adds r0, 0x8 + b _081A16B0 +_081A169A: + adds r0, r2, 0 + adds r0, 0x10 + b _081A16B0 +_081A16A0: + adds r0, r2, 0 + adds r0, 0x18 + b _081A16B0 +_081A16A6: + adds r0, r2, 0 + adds r0, 0x20 + b _081A16B0 +_081A16AC: + adds r0, r2, 0 + adds r0, 0x28 +_081A16B0: + pop {r1} + bx r1 + thumb_func_end sub_81A1650 + + thumb_func_start sub_81A16B4 +sub_81A16B4: @ 81A16B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081A16D8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A16D4 +_081A16CE: + adds r0, r2, 0 + bl set_task_function_to_args_14_15 +_081A16D4: + pop {r0} + bx r0 + .align 2, 0 +_081A16D8: .4byte 0x030022c0 + thumb_func_end sub_81A16B4 + + thumb_func_start sub_81A16DC +sub_81A16DC: @ 81A16DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081A1720 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16F6 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A1718 +_081A16F6: + ldr r2, _081A1724 + ldr r1, _081A1728 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + movs r3, 0xA + ldrsh r0, [r0, r3] + lsls r0, 16 + orrs r1, r0 + str r1, [r2] + bl _call_via_r1 + adds r0, r4, 0 + bl remove_task +_081A1718: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A1720: .4byte 0x030022c0 +_081A1724: .4byte 0x030062f4 +_081A1728: .4byte 0x03005e00 + thumb_func_end sub_81A16DC + + thumb_func_start sub_81A172C +sub_81A172C: @ 81A172C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081A1754 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081A1758 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + lsrs r4, 16 + strh r4, [r1, 0xA] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A1754: .4byte sub_81A16DC + 1 +_081A1758: .4byte 0x03005e00 + thumb_func_end sub_81A172C + + thumb_func_start sub_81A175C +sub_81A175C: @ 81A175C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081A177C + adds r0, r4, 0 + movs r1, 0x1 + 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 + .align 2, 0 +_081A177C: .4byte sub_81A16B4 + 1 + thumb_func_end sub_81A175C + + thumb_func_start sub_81A1780 +sub_81A1780: @ 81A1780 + push {lr} + ldr r1, _081A1798 + ldr r0, _081A179C + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081A1798: .4byte 0x08611c18 +_081A179C: .4byte 0x020375e0 + thumb_func_end sub_81A1780 + + thumb_func_start sub_81A17A0 +sub_81A17A0: @ 81A17A0 + push {lr} + movs r0, 0x80 + lsls r0, 7 + movs r1, 0xFF + bl var_set + ldr r0, _081A17C4 + ldr r0, [r0] + ldr r1, _081A17C8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _081A1822 + lsls r0, 2 + ldr r1, _081A17CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A17C4: .4byte 0x03005d90 +_081A17C8: .4byte 0x00000ca8 +_081A17CC: .4byte _081A17D0 + .align 2, 0 +_081A17D0: + .4byte _081A1822 + .4byte _081A17E4 + .4byte _081A1810 + .4byte _081A17EC + .4byte _081A17E8 +_081A17E4: + movs r0, 0 + b _081A17EE +_081A17E8: + movs r0, 0 + b _081A17EE +_081A17EC: + movs r0, 0x1 +_081A17EE: + bl sub_813A878 + movs r0, 0x80 + lsls r0, 7 + ldr r1, _081A1808 + ldr r1, [r1] + ldr r2, _081A180C + adds r1, r2 + ldrb r1, [r1] + bl var_set + b _081A1822 + .align 2, 0 +_081A1808: .4byte 0x03005d90 +_081A180C: .4byte 0x00000ca8 +_081A1810: + movs r0, 0x80 + lsls r0, 7 + ldr r1, _081A1828 + ldr r1, [r1] + ldr r2, _081A182C + adds r1, r2 + ldrb r1, [r1] + bl var_set +_081A1822: + pop {r0} + bx r0 + .align 2, 0 +_081A1828: .4byte 0x03005d90 +_081A182C: .4byte 0x00000ca8 + thumb_func_end sub_81A17A0 + + thumb_func_start sub_81A1830 +sub_81A1830: @ 81A1830 + push {r4-r6,lr} + ldr r0, _081A1860 + bl var_get + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bne _081A184C + movs r5, 0x1 +_081A184C: + ldr r0, _081A1864 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A1856 + b _081A1956 +_081A1856: + lsls r0, 2 + ldr r1, _081A1868 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A1860: .4byte 0x000040cf +_081A1864: .4byte 0x020375e2 +_081A1868: .4byte _081A186C + .align 2, 0 +_081A186C: + .4byte _081A188C + .4byte _081A18A8 + .4byte _081A18C8 + .4byte _081A18E4 + .4byte _081A1956 + .4byte _081A1900 + .4byte _081A1918 + .4byte _081A1938 +_081A188C: + ldr r1, _081A189C + ldr r0, _081A18A0 + ldr r0, [r0] + ldr r2, _081A18A4 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + b _081A1956 + .align 2, 0 +_081A189C: .4byte 0x020375f0 +_081A18A0: .4byte 0x03005d90 +_081A18A4: .4byte 0x00000ca8 +_081A18A8: + ldr r1, _081A18BC + ldr r0, _081A18C0 + ldr r0, [r0] + ldr r2, _081A18C4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + strh r0, [r1] + b _081A1956 + .align 2, 0 +_081A18BC: .4byte 0x020375f0 +_081A18C0: .4byte 0x03005d90 +_081A18C4: .4byte 0x00000ca9 +_081A18C8: + ldr r1, _081A18D8 + ldr r0, _081A18DC + ldr r0, [r0] + ldr r2, _081A18E0 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + b _081A1956 + .align 2, 0 +_081A18D8: .4byte 0x020375f0 +_081A18DC: .4byte 0x03005d90 +_081A18E0: .4byte 0x00000cb2 +_081A18E4: + ldr r1, _081A18F4 + ldr r0, _081A18F8 + ldr r0, [r0] + ldr r2, _081A18FC + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + b _081A1926 + .align 2, 0 +_081A18F4: .4byte 0x020375f0 +_081A18F8: .4byte 0x03005d90 +_081A18FC: .4byte 0x00000ca9 +_081A1900: + ldr r2, _081A1910 + ldr r1, _081A1914 + ldrb r0, [r1] + strh r0, [r2] + movs r0, 0 + strb r0, [r1] + b _081A1956 + .align 2, 0 +_081A1910: .4byte 0x020375f0 +_081A1914: .4byte 0x0202433a +_081A1918: + ldr r1, _081A192C + ldr r0, _081A1930 + ldr r0, [r0] + ldr r2, _081A1934 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 +_081A1926: + lsrs r0, 31 + strh r0, [r1] + b _081A1956 + .align 2, 0 +_081A192C: .4byte 0x020375f0 +_081A1930: .4byte 0x03005d90 +_081A1934: .4byte 0x00000ca9 +_081A1938: + ldr r4, _081A195C + ldr r0, _081A1960 + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, _081A1964 + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + adds r0, r3 + ldrh r1, [r2] + ldrh r0, [r0] + ands r0, r1 + strh r0, [r4] +_081A1956: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A195C: .4byte 0x020375f0 +_081A1960: .4byte 0x03005d90 +_081A1964: .4byte 0x08611bfc + thumb_func_end sub_81A1830 + + thumb_func_start sub_81A1968 +sub_81A1968: @ 81A1968 + push {r4,r5,lr} + ldr r0, _081A1998 + bl var_get + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A1984 + movs r4, 0x1 +_081A1984: + ldr r0, _081A199C + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A198E + b _081A1AC4 +_081A198E: + lsls r0, 2 + ldr r1, _081A19A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A1998: .4byte 0x000040cf +_081A199C: .4byte 0x020375e2 +_081A19A0: .4byte _081A19A4 + .align 2, 0 +_081A19A4: + .4byte _081A19C4 + .4byte _081A19E0 + .4byte _081A1A0C + .4byte _081A1A28 + .4byte _081A1A50 + .4byte _081A1AC4 + .4byte _081A1A7C + .4byte _081A1AA8 +_081A19C4: + ldr r0, _081A19D4 + ldr r0, [r0] + ldr r1, _081A19D8 + ldrh r1, [r1] + ldr r2, _081A19DC + adds r0, r2 + strb r1, [r0] + b _081A1AC4 + .align 2, 0 +_081A19D4: .4byte 0x03005d90 +_081A19D8: .4byte 0x020375e4 +_081A19DC: .4byte 0x00000ca8 +_081A19E0: + ldr r0, _081A1A00 + ldr r2, [r0] + ldr r0, _081A1A04 + ldrb r0, [r0] + ldr r1, _081A1A08 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _081A1AC4 + .align 2, 0 +_081A1A00: .4byte 0x03005d90 +_081A1A04: .4byte 0x020375e4 +_081A1A08: .4byte 0x00000ca9 +_081A1A0C: + ldr r0, _081A1A1C + ldr r0, [r0] + ldr r1, _081A1A20 + ldrh r1, [r1] + ldr r2, _081A1A24 + adds r0, r2 + strh r1, [r0] + b _081A1AC4 + .align 2, 0 +_081A1A1C: .4byte 0x03005d90 +_081A1A20: .4byte 0x020375e4 +_081A1A24: .4byte 0x00000cb2 +_081A1A28: + ldr r0, _081A1A44 + ldr r3, [r0] + ldr r0, _081A1A48 + ldrb r0, [r0] + ldr r1, _081A1A4C + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + b _081A1A94 + .align 2, 0 +_081A1A44: .4byte 0x03005d90 +_081A1A48: .4byte 0x020375e4 +_081A1A4C: .4byte 0x00000ca9 +_081A1A50: + movs r2, 0 + ldr r5, _081A1A70 + ldr r4, _081A1A74 + ldr r3, _081A1A78 +_081A1A58: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r2, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r2, 0x1 + cmp r2, 0x3 + ble _081A1A58 + b _081A1AC4 + .align 2, 0 +_081A1A70: .4byte 0x03005d90 +_081A1A74: .4byte 0x00000caa +_081A1A78: .4byte 0x0203cef8 +_081A1A7C: + ldr r0, _081A1A9C + ldr r3, [r0] + ldr r0, _081A1AA0 + ldrb r0, [r0] + ldr r2, _081A1AA4 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 +_081A1A94: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _081A1AC4 + .align 2, 0 +_081A1A9C: .4byte 0x03005d90 +_081A1AA0: .4byte 0x020375e4 +_081A1AA4: .4byte 0x00000ca9 +_081A1AA8: + ldr r0, _081A1ACC + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, _081A1AD0 + lsls r1, r4, 1 + lsls r0, r5, 2 + adds r1, r0 + adds r1, r3 + ldrh r0, [r2] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2] +_081A1AC4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A1ACC: .4byte 0x03005d90 +_081A1AD0: .4byte 0x08611bfc + thumb_func_end sub_81A1968 + + thumb_func_start sub_81A1AD4 +sub_81A1AD4: @ 81A1AD4 + push {r4-r7,lr} + bl sub_81B8558 + movs r3, 0 + ldr r4, _081A1B0C + ldrh r0, [r4] + cmp r3, r0 + bge _081A1B00 + ldr r7, _081A1B10 + ldr r6, _081A1B14 + ldr r5, _081A1B18 +_081A1AEA: + adds r2, r3, r7 + ldr r0, [r6] + lsls r1, r3, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + adds r3, 0x1 + ldrh r0, [r4] + cmp r3, r0 + blt _081A1AEA +_081A1B00: + bl sub_80F94E8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A1B0C: .4byte 0x020375e2 +_081A1B10: .4byte 0x0203cef8 +_081A1B14: .4byte 0x03005d90 +_081A1B18: .4byte 0x00000caa + thumb_func_end sub_81A1AD4 + + thumb_func_start sub_81A1B1C +sub_81A1B1C: @ 81A1B1C + push {lr} + bl do_reset + pop {r0} + bx r0 + thumb_func_end sub_81A1B1C + + thumb_func_start sub_81A1B28 +sub_81A1B28: @ 81A1B28 + ldr r1, _081A1B30 + ldr r0, _081A1B34 + str r0, [r1] + bx lr + .align 2, 0 +_081A1B30: .4byte 0x0203bc88 +_081A1B34: .4byte 0x085d5acc + thumb_func_end sub_81A1B28 + + thumb_func_start sub_81A1B38 +sub_81A1B38: @ 81A1B38 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0x64 +_081A1B3E: + ldr r0, _081A1B88 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A1B8C + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081A1B76 + ldr r0, _081A1B90 + ldr r0, [r0] + ldrh r1, [r1] + subs r1, 0x1 + muls r1, r5 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, _081A1B94 + adds r1, r4, 0 + muls r1, r5 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A1B76: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A1B3E + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A1B88: .4byte 0x03005d90 +_081A1B8C: .4byte 0x00000caa +_081A1B90: .4byte 0x03005d8c +_081A1B94: .4byte 0x020244ec + thumb_func_end sub_81A1B38 + + thumb_func_start sub_81A1B98 +sub_81A1B98: @ 81A1B98 + push {lr} + ldr r0, _081A1BBC + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0x3 + bls _081A1BA8 + movs r0, 0 + strh r0, [r2] +_081A1BA8: + ldr r0, _081A1BC0 + ldrh r0, [r0] + cmp r0, 0x7 + bhi _081A1C1E + lsls r0, 2 + ldr r1, _081A1BC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A1BBC: .4byte 0x020375e4 +_081A1BC0: .4byte 0x020375e2 +_081A1BC4: .4byte _081A1BC8 + .align 2, 0 +_081A1BC8: + .4byte _081A1BE8 + .4byte _081A1BF0 + .4byte _081A1BF8 + .4byte _081A1C0E + .4byte _081A1C06 + .4byte _081A1C00 + .4byte _081A1C14 + .4byte _081A1C1A +_081A1BE8: + ldrb r0, [r2] + bl sub_81A1EA8 + b _081A1C1E +_081A1BF0: + ldrb r0, [r2] + bl sub_81A2134 + b _081A1C1E +_081A1BF8: + ldrb r0, [r2] + bl sub_81A2460 + b _081A1C1E +_081A1C00: + bl sub_81A2698 + b _081A1C1E +_081A1C06: + ldrb r0, [r2] + bl sub_81A2C94 + b _081A1C1E +_081A1C0E: + bl sub_81A2968 + b _081A1C1E +_081A1C14: + bl sub_81A2F38 + b _081A1C1E +_081A1C1A: + bl sub_81A2FF8 +_081A1C1E: + pop {r0} + bx r0 + thumb_func_end sub_81A1B98 + + thumb_func_start sub_81A1C24 +sub_81A1C24: @ 81A1C24 + push {lr} + ldr r1, _081A1C3C + ldr r1, [r1] + ldr r2, _081A1C40 + adds r1, r2 + ldr r1, [r1] + ands r1, r0 + cmp r1, 0 + bne _081A1C44 + movs r0, 0 + b _081A1C46 + .align 2, 0 +_081A1C3C: .4byte 0x03005d90 +_081A1C40: .4byte 0x00000cdc +_081A1C44: + movs r0, 0x1 +_081A1C46: + pop {r1} + bx r1 + thumb_func_end sub_81A1C24 + + thumb_func_start sub_81A1C4C +sub_81A1C4C: @ 81A1C4C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xE0 + bl sub_81DB35C + adds r3, r0, 0 + lsls r0, r5, 3 + adds r5, r0, 0x1 + ldr r0, _081A1C8C + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + lsls r1, r5, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A1C8C: .4byte 0x0203ab74 + thumb_func_end sub_81A1C4C + + thumb_func_start sub_81A1C90 +sub_81A1C90: @ 81A1C90 + push {r4,lr} + sub sp, 0x34 + adds r2, r0, 0 + ldr r3, _081A1CD4 + movs r1, 0xAE + mov r0, sp + adds r0, 0x2F +_081A1C9E: + strb r1, [r0] + subs r0, 0x1 + add r4, sp, 0xC + cmp r0, r4 + bge _081A1C9E + add r1, sp, 0x30 + movs r0, 0xFF + strb r0, [r1] + lsls r0, r2, 3 + adds r2, r0, 0x1 + ldrb r0, [r3] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl Print + add sp, 0x34 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A1CD4: .4byte 0x0203ab74 + thumb_func_end sub_81A1C90 + + thumb_func_start sub_81A1CD8 +sub_81A1CD8: @ 81A1CD8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, _081A1D64 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, _081A1D68 + cmp r6, r0 + bls _081A1D24 + adds r6, r0, 0 +_081A1D24: + ldr r0, _081A1D6C + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A1D70 + ldr r1, _081A1D74 + adds r0, r4, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + 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 + .align 2, 0 +_081A1D64: .4byte 0x0203ab74 +_081A1D68: .4byte 0x0000270f +_081A1D6C: .4byte 0x02021cc4 +_081A1D70: .4byte 0x02021fc4 +_081A1D74: .4byte 0x085ee302 + thumb_func_end sub_81A1CD8 + + thumb_func_start sub_81A1D78 +sub_81A1D78: @ 81A1D78 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, _081A1DB4 + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCF + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, _081A1DB8 + str r5, [sp] + bl sub_81A1CD8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A1DB4: .4byte 0x03005d90 +_081A1DB8: .4byte 0x085ee319 + thumb_func_end sub_81A1D78 + + thumb_func_start sub_81A1DBC +sub_81A1DBC: @ 81A1DBC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _081A1DE4 + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCE + lsls r0, 4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _081A1DE8 + cmp r0, r1 + bls _081A1DDE + adds r0, r1, 0 +_081A1DDE: + pop {r1} + bx r1 + .align 2, 0 +_081A1DE4: .4byte 0x03005d90 +_081A1DE8: .4byte 0x0000270f + thumb_func_end sub_81A1DBC + + thumb_func_start sub_81A1DEC +sub_81A1DEC: @ 81A1DEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1DBC + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x1 + beq _081A1E38 + cmp r5, 0x1 + ble _081A1E2C + cmp r5, 0x2 + beq _081A1E48 + cmp r5, 0x3 + beq _081A1E58 +_081A1E2C: + cmp r6, 0 + beq _081A1E34 + movs r0, 0x2 + b _081A1E66 +_081A1E34: + movs r0, 0x1 + b _081A1E66 +_081A1E38: + cmp r6, 0 + beq _081A1E42 + movs r0, 0x80 + lsls r0, 8 + b _081A1E66 +_081A1E42: + movs r0, 0x80 + lsls r0, 7 + b _081A1E66 +_081A1E48: + cmp r6, 0 + beq _081A1E52 + movs r0, 0x80 + lsls r0, 10 + b _081A1E66 +_081A1E52: + movs r0, 0x80 + lsls r0, 9 + b _081A1E66 +_081A1E58: + cmp r6, 0 + beq _081A1E62 + movs r0, 0x80 + lsls r0, 12 + b _081A1E66 +_081A1E62: + movs r0, 0x80 + lsls r0, 11 +_081A1E66: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A1E88 + ldr r0, _081A1E84 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 + b _081A1E96 + .align 2, 0 +_081A1E84: .4byte 0x085ee311 +_081A1E88: + ldr r0, _081A1EA4 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 +_081A1E96: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A1EA4: .4byte 0x085ee320 + thumb_func_end sub_81A1DEC + + thumb_func_start sub_81A1EA8 +sub_81A1EA8: @ 81A1EA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _081A1EE0 + ldr r0, _081A1EE4 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + cmp r7, 0 + bne _081A1EF0 + ldr r0, _081A1EE8 + ldr r1, _081A1EEC + bl ExpandTextCodes + b _081A1F28 + .align 2, 0 +_081A1EE0: .4byte 0x0203ab74 +_081A1EE4: .4byte 0x08611c74 +_081A1EE8: .4byte 0x02021fc4 +_081A1EEC: .4byte 0x085ee158 +_081A1EF0: + cmp r7, 0x1 + bne _081A1F08 + ldr r0, _081A1F00 + ldr r1, _081A1F04 + bl ExpandTextCodes + b _081A1F28 + .align 2, 0 +_081A1F00: .4byte 0x02021fc4 +_081A1F04: .4byte 0x085ee178 +_081A1F08: + cmp r7, 0x2 + bne _081A1F20 + ldr r0, _081A1F18 + ldr r1, _081A1F1C + bl ExpandTextCodes + b _081A1F28 + .align 2, 0 +_081A1F18: .4byte 0x02021fc4 +_081A1F1C: .4byte 0x085ee198 +_081A1F20: + ldr r0, _081A1FC4 + ldr r1, _081A1FC8 + bl ExpandTextCodes +_081A1F28: + ldr r0, _081A1FC4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, _081A1FCC + ldrb r0, [r6] + ldr r2, _081A1FD0 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + ldrb r0, [r6] + ldr r2, _081A1FD4 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + ldrb r0, [r6] + bl Window_WriteStandardTileMap + ldrb r0, [r6] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A1FC4: .4byte 0x02021fc4 +_081A1FC8: .4byte 0x085ee1b7 +_081A1FCC: .4byte 0x0203ab74 +_081A1FD0: .4byte 0x085ee2f2 +_081A1FD4: .4byte 0x085ee2f9 + thumb_func_end sub_81A1EA8 + + thumb_func_start sub_81A1FD8 +sub_81A1FD8: @ 81A1FD8 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _081A1FFC + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, _081A2000 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _081A2004 + cmp r0, r1 + bls _081A1FF8 + adds r0, r1, 0 +_081A1FF8: + pop {r1} + bx r1 + .align 2, 0 +_081A1FFC: .4byte 0x03005d90 +_081A2000: .4byte 0x00000d0c +_081A2004: .4byte 0x0000270f + thumb_func_end sub_81A1FD8 + + thumb_func_start sub_81A2008 +sub_81A2008: @ 81A2008 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081A2088 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl Print + ldr r0, _081A208C + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A2090 + adds r0, r4, 0 + adds r1, r7, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl Print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2088: .4byte 0x0203ab74 +_081A208C: .4byte 0x02021cc4 +_081A2090: .4byte 0x02021fc4 + thumb_func_end sub_81A2008 + + thumb_func_start sub_81A2094 +sub_81A2094: @ 81A2094 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1FD8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r5, 0 + beq _081A20CC + cmp r5, 0x1 + beq _081A20D8 +_081A20CC: + cmp r6, 0 + beq _081A20D4 + movs r0, 0x8 + b _081A20E6 +_081A20D4: + movs r0, 0x4 + b _081A20E6 +_081A20D8: + cmp r6, 0 + beq _081A20E2 + movs r0, 0x80 + lsls r0, 14 + b _081A20E6 +_081A20E2: + movs r0, 0x80 + lsls r0, 13 +_081A20E6: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A210C + ldr r0, _081A2104 + ldr r1, _081A2108 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 + b _081A211C + .align 2, 0 +_081A2104: .4byte 0x085ee311 +_081A2108: .4byte 0x085ee338 +_081A210C: + ldr r0, _081A212C + ldr r1, _081A2130 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 +_081A211C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A212C: .4byte 0x085ee320 +_081A2130: .4byte 0x085ee338 + thumb_func_end sub_81A2094 + + thumb_func_start sub_81A2134 +sub_81A2134: @ 81A2134 + 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 r4, _081A216C + ldr r0, _081A2170 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + cmp r7, 0 + bne _081A217C + ldr r0, _081A2174 + ldr r1, _081A2178 + bl ExpandTextCodes + b _081A2184 + .align 2, 0 +_081A216C: .4byte 0x0203ab74 +_081A2170: .4byte 0x08611c74 +_081A2174: .4byte 0x02021fc4 +_081A2178: .4byte 0x085ee1db +_081A217C: + ldr r0, _081A2280 + ldr r1, _081A2284 + bl ExpandTextCodes +_081A2184: + ldr r0, _081A2280 + movs r1, 0 + bl sub_81A1C4C + ldr r1, _081A2288 + ldrb r0, [r1] + ldr r2, _081A228C + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r1, _081A2288 + ldrb r0, [r1] + ldr r2, _081A2290 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + str r6, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r4, _081A2294 + ldr r0, [r4] + lsls r5, r7, 2 + ldr r1, _081A2298 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x79 + mov r9, r0 + str r0, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + ldr r0, _081A229C + ldr r1, _081A22A0 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, _081A22A4 + mov r10, r1 + ldr r0, _081A22A8 + mov r8, r0 + ldr r0, [r4] + ldr r1, _081A22AC + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r6, 0x70 + str r6, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + movs r0, 0x61 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r0, [r4] + ldr r1, _081A22B0 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + ldr r0, _081A229C + ldr r1, _081A22A0 + movs r3, 0x40 + bl sub_81A2008 + ldr r0, [r4] + ldr r1, _081A22B4 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + str r6, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, _081A2288 + ldrb r0, [r1] + bl Window_WriteStandardTileMap + ldr r1, _081A2288 + ldrb r0, [r1] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2280: .4byte 0x02021fc4 +_081A2284: .4byte 0x085ee1fe +_081A2288: .4byte 0x0203ab74 +_081A228C: .4byte 0x085ee2f2 +_081A2290: .4byte 0x085ee2f9 +_081A2294: .4byte 0x03005d90 +_081A2298: .4byte 0x00000d14 +_081A229C: .4byte 0x085ee319 +_081A22A0: .4byte 0x085ee338 +_081A22A4: .4byte 0x085ee332 +_081A22A8: .4byte 0x085ee349 +_081A22AC: .4byte 0x00000d1c +_081A22B0: .4byte 0x00000d16 +_081A22B4: .4byte 0x00000d1e + thumb_func_end sub_81A2134 + + thumb_func_start sub_81A22B8 +sub_81A22B8: @ 81A22B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, _081A2344 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, _081A2348 + cmp r6, r0 + bls _081A2304 + adds r6, r0, 0 +_081A2304: + ldr r0, _081A234C + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A2350 + ldr r1, _081A2354 + adds r0, r4, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + 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 + .align 2, 0 +_081A2344: .4byte 0x0203ab74 +_081A2348: .4byte 0x0000270f +_081A234C: .4byte 0x02021cc4 +_081A2350: .4byte 0x02021fc4 +_081A2354: .4byte 0x085ee302 + thumb_func_end sub_81A22B8 + + thumb_func_start sub_81A2358 +sub_81A2358: @ 81A2358 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, _081A2394 + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xDD + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, _081A2398 + str r5, [sp] + bl sub_81A22B8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A2394: .4byte 0x03005d90 +_081A2398: .4byte 0x085ee319 + thumb_func_end sub_81A2358 + + thumb_func_start sub_81A239C +sub_81A239C: @ 81A239C + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _081A23C0 + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, _081A23C4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _081A23C8 + cmp r0, r1 + bls _081A23BC + adds r0, r1, 0 +_081A23BC: + pop {r1} + bx r1 + .align 2, 0 +_081A23C0: .4byte 0x03005d90 +_081A23C4: .4byte 0x00000dc8 +_081A23C8: .4byte 0x0000270f + thumb_func_end sub_81A239C + + thumb_func_start sub_81A23CC +sub_81A23CC: @ 81A23CC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A239C + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0 + beq _081A2404 + cmp r5, 0x1 + beq _081A2410 +_081A2404: + cmp r6, 0 + beq _081A240C + movs r0, 0x20 + b _081A241E +_081A240C: + movs r0, 0x10 + b _081A241E +_081A2410: + cmp r6, 0 + beq _081A241A + movs r0, 0x80 + lsls r0, 16 + b _081A241E +_081A241A: + movs r0, 0x80 + lsls r0, 15 +_081A241E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2440 + ldr r0, _081A243C + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 + b _081A244E + .align 2, 0 +_081A243C: .4byte 0x085ee311 +_081A2440: + ldr r0, _081A245C + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 +_081A244E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A245C: .4byte 0x085ee320 + thumb_func_end sub_81A23CC + + thumb_func_start sub_81A2460 +sub_81A2460: @ 81A2460 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _081A2498 + ldr r0, _081A249C + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + cmp r7, 0 + bne _081A24A8 + ldr r0, _081A24A0 + ldr r1, _081A24A4 + bl ExpandTextCodes + b _081A24B0 + .align 2, 0 +_081A2498: .4byte 0x0203ab74 +_081A249C: .4byte 0x08611c74 +_081A24A0: .4byte 0x02021fc4 +_081A24A4: .4byte 0x085ee221 +_081A24A8: + ldr r0, _081A254C + ldr r1, _081A2550 + bl ExpandTextCodes +_081A24B0: + ldr r0, _081A254C + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, _081A2554 + ldrb r0, [r6] + ldr r2, _081A2558 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + ldrb r0, [r6] + ldr r2, _081A255C + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + ldrb r0, [r6] + bl Window_WriteStandardTileMap + ldrb r0, [r6] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A254C: .4byte 0x02021fc4 +_081A2550: .4byte 0x085ee241 +_081A2554: .4byte 0x0203ab74 +_081A2558: .4byte 0x085ee2f2 +_081A255C: .4byte 0x085ee2f9 + thumb_func_end sub_81A2460 + + thumb_func_start sub_81A2560 +sub_81A2560: @ 81A2560 + push {lr} + lsls r0, 24 + ldr r1, _081A2580 + ldr r1, [r1] + lsrs r0, 23 + ldr r2, _081A2584 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _081A2588 + cmp r0, r1 + bls _081A257A + adds r0, r1, 0 +_081A257A: + pop {r1} + bx r1 + .align 2, 0 +_081A2580: .4byte 0x03005d90 +_081A2584: .4byte 0x00000e04 +_081A2588: .4byte 0x0000270f + thumb_func_end sub_81A2560 + + thumb_func_start sub_81A258C +sub_81A258C: @ 81A258C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081A260C + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl Print + ldr r0, _081A2610 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A2614 + adds r0, r4, 0 + adds r1, r7, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl Print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A260C: .4byte 0x0203ab74 +_081A2610: .4byte 0x02021cc4 +_081A2614: .4byte 0x02021fc4 + thumb_func_end sub_81A258C + + thumb_func_start sub_81A2618 +sub_81A2618: @ 81A2618 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2560 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r4, 0 + beq _081A2648 + movs r0, 0x80 + lsls r0, 4 + b _081A264C +_081A2648: + movs r0, 0x80 + lsls r0, 3 +_081A264C: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2674 + ldr r0, _081A266C + ldr r1, _081A2670 + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 + b _081A2684 + .align 2, 0 +_081A266C: .4byte 0x085ee311 +_081A2670: .4byte 0x085ee35b +_081A2674: + ldr r0, _081A2690 + ldr r1, _081A2694 + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 +_081A2684: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2690: .4byte 0x085ee320 +_081A2694: .4byte 0x085ee35b + thumb_func_end sub_81A2618 + + thumb_func_start sub_81A2698 +sub_81A2698: @ 81A2698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r6, _081A27AC + ldr r0, _081A27B0 + bl Window_AddFromTemplate + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _081A27B4 + ldr r1, _081A27B8 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl sub_81A1C4C + ldrb r0, [r6] + ldr r2, _081A27BC + movs r1, 0x21 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldrb r0, [r6] + ldr r2, _081A27C0 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x21 + bl sub_81A2618 + ldr r0, _081A27C4 + mov r10, r0 + ldr r7, _081A27C8 + ldr r5, _081A27CC + ldr r0, [r5] + ldr r1, _081A27D0 + adds r0, r1 + ldrh r2, [r0] + movs r4, 0x72 + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, _081A27D4 + mov r8, r0 + ldr r1, _081A27D8 + mov r9, r1 + ldr r0, [r5] + ldr r1, _081A27DC + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x61 + bl sub_81A2618 + ldr r0, [r5] + ldr r1, _081A27E0 + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, [r5] + ldr r1, _081A27E4 + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + ldrb r0, [r6] + bl Window_WriteStandardTileMap + ldrb r0, [r6] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A27AC: .4byte 0x0203ab74 +_081A27B0: .4byte 0x08611c74 +_081A27B4: .4byte 0x02021fc4 +_081A27B8: .4byte 0x085ee261 +_081A27BC: .4byte 0x085ee2f2 +_081A27C0: .4byte 0x085ee2f9 +_081A27C4: .4byte 0x085ee319 +_081A27C8: .4byte 0x085ee35b +_081A27CC: .4byte 0x03005d90 +_081A27D0: .4byte 0x00000e08 +_081A27D4: .4byte 0x085ee332 +_081A27D8: .4byte 0x085ee36d +_081A27DC: .4byte 0x00000e0c +_081A27E0: .4byte 0x00000e0a +_081A27E4: .4byte 0x00000e0e + thumb_func_end sub_81A2698 + + thumb_func_start sub_81A27E8 +sub_81A27E8: @ 81A27E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, _081A2874 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, _081A2878 + cmp r6, r0 + bls _081A2834 + adds r6, r0, 0 +_081A2834: + ldr r0, _081A287C + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A2880 + ldr r1, _081A2884 + adds r0, r4, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + 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 + .align 2, 0 +_081A2874: .4byte 0x0203ab74 +_081A2878: .4byte 0x0000270f +_081A287C: .4byte 0x02021cc4 +_081A2880: .4byte 0x02021fc4 +_081A2884: .4byte 0x085ee381 + thumb_func_end sub_81A27E8 + + thumb_func_start sub_81A2888 +sub_81A2888: @ 81A2888 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _081A28C0 + ldr r1, [r1] + lsrs r0, 23 + ldr r2, _081A28C4 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, _081A28C8 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A27E8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A28C0: .4byte 0x03005d90 +_081A28C4: .4byte 0x00000dde +_081A28C8: .4byte 0x085ee319 + thumb_func_end sub_81A2888 + + thumb_func_start sub_81A28CC +sub_81A28CC: @ 81A28CC + push {lr} + lsls r0, 24 + ldr r1, _081A28EC + ldr r1, [r1] + lsrs r0, 23 + ldr r2, _081A28F0 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _081A28F4 + cmp r0, r1 + bls _081A28E6 + adds r0, r1, 0 +_081A28E6: + pop {r1} + bx r1 + .align 2, 0 +_081A28EC: .4byte 0x03005d90 +_081A28F0: .4byte 0x00000dda +_081A28F4: .4byte 0x0000270f + thumb_func_end sub_81A28CC + + thumb_func_start sub_81A28F8 +sub_81A28F8: @ 81A28F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A28CC + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2926 + movs r0, 0x80 + b _081A2928 +_081A2926: + movs r0, 0x40 +_081A2928: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2948 + ldr r0, _081A2944 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 + b _081A2956 + .align 2, 0 +_081A2944: .4byte 0x085ee311 +_081A2948: + ldr r0, _081A2964 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 +_081A2956: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2964: .4byte 0x085ee320 + thumb_func_end sub_81A28F8 + + thumb_func_start sub_81A2968 +sub_81A2968: @ 81A2968 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, _081A2A10 + ldr r0, _081A2A14 + bl Window_AddFromTemplate + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl Window_FastFillPixels + movs r0, 0xA + bl sub_81A1C90 + ldr r4, _081A2A18 + ldr r1, _081A2A1C + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, _081A2A20 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + ldrb r0, [r5] + ldr r2, _081A2A24 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x31 + bl sub_81A28F8 + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x41 + bl sub_81A2888 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x61 + bl sub_81A28F8 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x71 + bl sub_81A2888 + ldrb r0, [r5] + bl Window_WriteStandardTileMap + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A2A10: .4byte 0x0203ab74 +_081A2A14: .4byte 0x08611c74 +_081A2A18: .4byte 0x02021fc4 +_081A2A1C: .4byte 0x085ee27c +_081A2A20: .4byte 0x085ee2f2 +_081A2A24: .4byte 0x085ee2f9 + thumb_func_end sub_81A2968 + + thumb_func_start sub_81A2A28 +sub_81A2A28: @ 81A2A28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r12, r0 + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + ldr r0, [sp, 0x40] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x10] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r0, _081A2AEC + mov r10, r0 + ldrb r0, [r0] + str r6, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl Print + ldr r0, _081A2AF0 + cmp r7, r0 + bls _081A2A80 + adds r7, r0, 0 +_081A2A80: + ldr r5, _081A2AF4 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A2AF8 + ldr r1, _081A2AFC + adds r0, r4, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x10] + bl Print + adds r0, r5, 0 + ldr r1, [sp, 0xC] + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r1, _081A2B00 + adds r0, r4, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x14] + bl Print + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2AEC: .4byte 0x0203ab74 +_081A2AF0: .4byte 0x0000270f +_081A2AF4: .4byte 0x02021cc4 +_081A2AF8: .4byte 0x02021fc4 +_081A2AFC: .4byte 0x085ee302 +_081A2B00: .4byte 0x085ee392 + thumb_func_end sub_81A2A28 + + thumb_func_start sub_81A2B04 +sub_81A2B04: @ 81A2B04 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r2, 0 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsls r1, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r2, _081A2B60 + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r7, _081A2B64 + adds r0, r2, r7 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r0, _081A2B68 + adds r2, r0 + adds r2, r1 + ldrh r2, [r2] + ldr r0, _081A2B6C + str r3, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r1, r8 + adds r3, r6, 0 + bl sub_81A2A28 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2B60: .4byte 0x03005d90 +_081A2B64: .4byte 0x00000dea +_081A2B68: .4byte 0x00000dfa +_081A2B6C: .4byte 0x085ee319 + thumb_func_end sub_81A2B04 + + thumb_func_start sub_81A2B70 +sub_81A2B70: @ 81A2B70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _081A2B94 + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, _081A2B98 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _081A2B9C + cmp r0, r1 + bls _081A2B90 + adds r0, r1, 0 +_081A2B90: + pop {r1} + bx r1 + .align 2, 0 +_081A2B94: .4byte 0x03005d90 +_081A2B98: .4byte 0x00000de2 +_081A2B9C: .4byte 0x0000270f + thumb_func_end sub_81A2B70 + + thumb_func_start sub_81A2BA0 +sub_81A2BA0: @ 81A2BA0 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _081A2BC4 + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, _081A2BC8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _081A2BCC + cmp r0, r1 + bls _081A2BC0 + adds r0, r1, 0 +_081A2BC0: + pop {r1} + bx r1 + .align 2, 0 +_081A2BC4: .4byte 0x03005d90 +_081A2BC8: .4byte 0x00000df2 +_081A2BCC: .4byte 0x0000270f + thumb_func_end sub_81A2BA0 + + thumb_func_start sub_81A2BD0 +sub_81A2BD0: @ 81A2BD0 + 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] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2B70 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2BA0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r6, 0 + beq _081A2C20 + cmp r6, 0x1 + beq _081A2C30 +_081A2C20: + cmp r7, 0 + beq _081A2C2A + movs r0, 0x80 + lsls r0, 2 + b _081A2C3E +_081A2C2A: + movs r0, 0x80 + lsls r0, 1 + b _081A2C3E +_081A2C30: + cmp r7, 0 + beq _081A2C3A + movs r0, 0x80 + lsls r0, 18 + b _081A2C3E +_081A2C3A: + movs r0, 0x80 + lsls r0, 17 +_081A2C3E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2C68 + ldr r0, _081A2C64 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 + b _081A2C80 + .align 2, 0 +_081A2C64: .4byte 0x085ee311 +_081A2C68: + ldr r0, _081A2C90 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 +_081A2C80: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2C90: .4byte 0x085ee320 + thumb_func_end sub_81A2BD0 + + thumb_func_start sub_81A2C94 +sub_81A2C94: @ 81A2C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _081A2CC8 + ldr r0, _081A2CCC + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + cmp r7, 0 + bne _081A2CD8 + ldr r0, _081A2CD0 + ldr r1, _081A2CD4 + bl ExpandTextCodes + b _081A2CE0 + .align 2, 0 +_081A2CC8: .4byte 0x0203ab74 +_081A2CCC: .4byte 0x08611c74 +_081A2CD0: .4byte 0x02021fc4 +_081A2CD4: .4byte 0x085ee298 +_081A2CD8: + ldr r0, _081A2D9C + ldr r1, _081A2DA0 + bl ExpandTextCodes +_081A2CE0: + ldr r0, _081A2D9C + movs r1, 0 + bl sub_81A1C4C + ldr r0, _081A2DA4 + mov r8, r0 + ldrb r0, [r0] + ldr r2, _081A2DA8 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + mov r1, r8 + ldrb r0, [r1] + ldr r2, _081A2DAC + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x98 + bl Print + mov r1, r8 + ldrb r0, [r1] + ldr r2, _081A2DB0 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + movs r4, 0x9E + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + mov r1, r8 + ldrb r0, [r1] + bl Window_WriteStandardTileMap + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2D9C: .4byte 0x02021fc4 +_081A2DA0: .4byte 0x085ee2b8 +_081A2DA4: .4byte 0x0203ab74 +_081A2DA8: .4byte 0x085ee2f2 +_081A2DAC: .4byte 0x085ee326 +_081A2DB0: .4byte 0x085ee2f9 + thumb_func_end sub_81A2C94 + + thumb_func_start sub_81A2DB4 +sub_81A2DB4: @ 81A2DB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, _081A2E40 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, _081A2E44 + cmp r6, r0 + bls _081A2E00 + adds r6, r0, 0 +_081A2E00: + ldr r0, _081A2E48 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r4, _081A2E4C + ldr r1, _081A2E50 + adds r0, r4, 0 + bl ExpandTextCodes + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + 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 + .align 2, 0 +_081A2E40: .4byte 0x0203ab74 +_081A2E44: .4byte 0x0000270f +_081A2E48: .4byte 0x02021cc4 +_081A2E4C: .4byte 0x02021fc4 +_081A2E50: .4byte 0x085ee39c + thumb_func_end sub_81A2DB4 + + thumb_func_start sub_81A2E54 +sub_81A2E54: @ 81A2E54 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _081A2E8C + ldr r1, [r1] + lsrs r0, 23 + ldr r2, _081A2E90 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, _081A2E94 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A2DB4 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A2E8C: .4byte 0x03005d90 +_081A2E90: .4byte 0x00000e1e +_081A2E94: .4byte 0x085ee319 + thumb_func_end sub_81A2E54 + + thumb_func_start sub_81A2E98 +sub_81A2E98: @ 81A2E98 + push {lr} + lsls r0, 24 + ldr r1, _081A2EB8 + ldr r1, [r1] + lsrs r0, 23 + ldr r2, _081A2EBC + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, _081A2EC0 + cmp r0, r1 + bls _081A2EB2 + adds r0, r1, 0 +_081A2EB2: + pop {r1} + bx r1 + .align 2, 0 +_081A2EB8: .4byte 0x03005d90 +_081A2EBC: .4byte 0x00000e1a +_081A2EC0: .4byte 0x0000270f + thumb_func_end sub_81A2E98 + + thumb_func_start sub_81A2EC4 +sub_81A2EC4: @ 81A2EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2E98 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2EF4 + movs r0, 0x80 + lsls r0, 6 + b _081A2EF8 +_081A2EF4: + movs r0, 0x80 + lsls r0, 5 +_081A2EF8: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2F18 + ldr r0, _081A2F14 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 + b _081A2F26 + .align 2, 0 +_081A2F14: .4byte 0x085ee311 +_081A2F18: + ldr r0, _081A2F34 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 +_081A2F26: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A2F34: .4byte 0x085ee320 + thumb_func_end sub_81A2EC4 + + thumb_func_start sub_81A2F38 +sub_81A2F38: @ 81A2F38 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, _081A2FE0 + ldr r0, _081A2FE4 + bl Window_AddFromTemplate + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r4, _081A2FE8 + ldr r1, _081A2FEC + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, _081A2FF0 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldrb r0, [r5] + ldr r2, _081A2FF4 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x31 + bl sub_81A2EC4 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x41 + bl sub_81A2E54 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x61 + bl sub_81A2EC4 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x71 + bl sub_81A2E54 + ldrb r0, [r5] + bl Window_WriteStandardTileMap + ldrb r0, [r5] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A2FE0: .4byte 0x0203ab74 +_081A2FE4: .4byte 0x08611c74 +_081A2FE8: .4byte 0x02021fc4 +_081A2FEC: .4byte 0x085ee2d8 +_081A2FF0: .4byte 0x085ee2f2 +_081A2FF4: .4byte 0x085ee2f9 + thumb_func_end sub_81A2F38 + + thumb_func_start sub_81A2FF8 +sub_81A2FF8: @ 81A2FF8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, _081A31C0 + ldr r0, _081A31C4 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _081A31C8 + mov r9, r0 + ldr r1, _081A31CC + bl ExpandTextCodes + movs r0, 0x1 + mov r1, r9 + movs r2, 0xD0 + bl sub_81DB35C + adds r3, r0, 0 + ldrb r0, [r4] + 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, r9 + bl Print + ldr r7, _081A31D0 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl sub_81DB368 + adds r3, r0, 0 + adds r3, 0x32 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x19 + mov r8, r1 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldr r7, _081A31D4 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl sub_81DB368 + adds r3, r0, 0 + adds r3, 0x58 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldr r7, _081A31D8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl sub_81DB368 + adds r3, r0, 0 + adds r3, 0x7E + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldr r7, _081A31DC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl sub_81DB368 + adds r3, r0, 0 + adds r3, 0xA4 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldrb r0, [r4] + ldr r2, _081A31E0 + movs r1, 0x29 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, _081A31E4 + movs r1, 0x39 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, _081A31E8 + movs r1, 0x49 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, _081A31EC + movs r1, 0x59 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, _081A31F0 + movs r1, 0x69 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + movs r1, 0 +_081A314A: + movs r5, 0 + adds r0, r1, 0x1 + mov r8, r0 + lsls r0, r1, 28 + movs r2, 0xA4 + lsls r2, 22 + adds r0, r2 + lsrs r7, r0, 24 + lsls r4, r1, 3 +_081A315C: + ldr r0, _081A31F4 + ldr r0, [r0] + ldr r1, _081A31F8 + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r6, _081A31C0 + ldrb r0, [r6] + movs r1, 0x26 + adds r3, r5, 0 + muls r3, r1 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r9 + bl Print + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A315C + mov r1, r8 + cmp r1, 0x4 + ble _081A314A + ldrb r0, [r6] + bl Window_WriteStandardTileMap + ldrb r0, [r6] + movs r1, 0x3 + bl Window_CopyToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A31C0: .4byte 0x0203ab74 +_081A31C4: .4byte 0x08611c7c +_081A31C8: .4byte 0x02021fc4 +_081A31CC: .4byte 0x085edf86 +_081A31D0: .4byte 0x085edfa0 +_081A31D4: .4byte 0x085edfa4 +_081A31D8: .4byte 0x085edfa8 +_081A31DC: .4byte 0x085edfac +_081A31E0: .4byte 0x085eb0e8 +_081A31E4: .4byte 0x085eb0ed +_081A31E8: .4byte 0x085eb0f4 +_081A31EC: .4byte 0x085eb0f9 +_081A31F0: .4byte 0x085eb0ff +_081A31F4: .4byte 0x03005d90 +_081A31F8: .4byte 0x00000624 + thumb_func_end sub_81A2FF8 + + thumb_func_start sub_81A31FC +sub_81A31FC: @ 81A31FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, _081A323C + ldr r0, [r0] + ldr r1, _081A3240 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, _081A3244 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _081A3248 + bl var_get + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0x6 + bls _081A3232 + b _081A35CE +_081A3232: + lsls r0, r4, 2 + ldr r1, _081A324C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A323C: .4byte 0x03005d90 +_081A3240: .4byte 0x00000ca9 +_081A3244: .4byte 0x000040cf +_081A3248: .4byte 0x000040ce +_081A324C: .4byte _081A3250 + .align 2, 0 +_081A3250: + .4byte _081A326C + .4byte _081A33A8 + .4byte _081A3414 + .4byte _081A347C + .4byte _081A34CC + .4byte _081A354C + .4byte _081A3594 +_081A326C: + ldr r2, _081A3324 + mov r9, r2 + ldr r0, [r2] + lsls r3, r7, 1 + mov r10, r3 + mov r2, r8 + lsls r1, r2, 2 + add r1, r10 + str r1, [sp, 0x20] + movs r3, 0xCE + lsls r3, 4 + adds r1, r0, r3 + ldr r2, [sp, 0x20] + adds r1, r2 + adds r3, 0x10 + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bhi _081A3298 + b _081A35CE +_081A3298: + strh r1, [r0] + mov r3, r8 + cmp r3, 0x3 + bne _081A32F2 + ldr r6, _081A3328 + adds r6, 0x25 + ldrb r0, [r6] + movs r4, 0x1 + eors r0, r4 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, _081A332C + adds r1, r5 + mov r0, sp + bl gf_strcpy + mov r0, sp + bl sub_8009370 + lsls r1, r7, 3 + ldr r0, _081A3330 + adds r1, r0 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + mov r1, sp + bl gf_strcpy + ldrb r0, [r6] + eors r4, r0 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + subs r5, 0x4 + adds r0, r5 + ldr r0, [r0] + lsls r2, r7, 2 + ldr r1, _081A3334 + adds r2, r1 + mov r3, r9 + ldr r1, [r3] + adds r1, r2 + bl write_word_to_mem +_081A32F2: + mov r7, r9 + ldr r0, [r7] + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + ldr r2, [sp, 0x20] + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A3308 + b _081A35CE +_081A3308: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A3314 + b _081A35CE +_081A3314: + mov r3, r8 + cmp r3, 0x1 + beq _081A335A + cmp r3, 0x1 + bgt _081A3338 + cmp r3, 0 + beq _081A3344 + b _081A35CE + .align 2, 0 +_081A3324: .4byte 0x03005d90 +_081A3328: .4byte 0x02024474 +_081A332C: .4byte 0x020229f0 +_081A3330: .4byte 0x00000ee1 +_081A3334: .4byte 0x00000ef1 +_081A3338: + mov r7, r8 + cmp r7, 0x2 + beq _081A3374 + cmp r7, 0x3 + beq _081A338E + b _081A35CE +_081A3344: + mov r1, r9 + ldr r0, [r1] + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + add r0, r10 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80EE8C8 + b _081A35CE +_081A335A: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0x4 + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x2 + bl sub_80EE8C8 + b _081A35CE +_081A3374: + mov r1, r9 + ldr r0, [r1] + mov r1, r10 + adds r1, 0x8 + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x3 + bl sub_80EE8C8 + b _081A35CE +_081A338E: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0xC + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x4 + bl sub_80EE8C8 + b _081A35CE +_081A33A8: + ldr r6, _081A33F8 + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, _081A33FC + adds r1, r0, r5 + adds r1, r4 + ldr r3, _081A3400 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A33CA + b _081A35CE +_081A33CA: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A33D4 + b _081A35CE +_081A33D4: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A33E0 + b _081A35CE +_081A33E0: + mov r0, r8 + cmp r0, 0 + bne _081A3404 + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x5 + bl sub_80EE8C8 + b _081A35CE + .align 2, 0 +_081A33F8: .4byte 0x03005d90 +_081A33FC: .4byte 0x00000d0c +_081A3400: .4byte 0x00000d14 +_081A3404: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x6 + bl sub_80EE8C8 + b _081A35CE +_081A3414: + ldr r6, _081A3464 + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, _081A3468 + adds r1, r0, r5 + adds r1, r4 + movs r3, 0xDD + lsls r3, 4 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A3438 + b _081A35CE +_081A3438: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A3442 + b _081A35CE +_081A3442: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A344E + b _081A35CE +_081A344E: + mov r0, r8 + cmp r0, 0 + bne _081A346C + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0xB + bl sub_80EE8C8 + b _081A35CE + .align 2, 0 +_081A3464: .4byte 0x03005d90 +_081A3468: .4byte 0x00000dc8 +_081A346C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xC + bl sub_80EE8C8 + b _081A35CE +_081A347C: + ldr r6, _081A34C0 + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, _081A34C4 + adds r0, r1, r5 + adds r0, r4 + ldr r2, _081A34C8 + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bhi _081A3498 + b _081A35CE +_081A3498: + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A34A2 + b _081A35CE +_081A34A2: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A34AE + b _081A35CE +_081A34AE: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xA + bl sub_80EE8C8 + b _081A35CE + .align 2, 0 +_081A34C0: .4byte 0x03005d90 +_081A34C4: .4byte 0x00000dda +_081A34C8: .4byte 0x00000dde +_081A34CC: + ldr r6, _081A3528 + ldr r2, [r6] + lsls r7, 1 + mov r9, r7 + mov r7, r8 + lsls r0, r7, 2 + mov r1, r9 + adds r4, r1, r0 + ldr r5, _081A352C + adds r0, r2, r5 + adds r3, r0, r4 + ldr r7, _081A3530 + adds r0, r2, r7 + adds r0, r4 + ldrh r1, [r3] + ldrh r7, [r0] + cmp r1, r7 + bls _081A35CE + strh r1, [r0] + ldr r0, _081A3534 + adds r1, r2, r0 + adds r1, r4 + ldr r7, _081A3538 + adds r0, r2, r7 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r3] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + mov r0, r8 + cmp r0, 0 + bne _081A353C + ldr r0, [r6] + adds r0, r5 + add r0, r9 + ldrh r0, [r0] + movs r1, 0x7 + bl sub_80EE8C8 + b _081A35CE + .align 2, 0 +_081A3528: .4byte 0x03005d90 +_081A352C: .4byte 0x00000de2 +_081A3530: .4byte 0x00000dea +_081A3534: .4byte 0x00000dfa +_081A3538: .4byte 0x00000df2 +_081A353C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x8 + bl sub_80EE8C8 + b _081A35CE +_081A354C: + ldr r6, _081A3588 + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, _081A358C + adds r0, r1, r5 + adds r0, r4 + ldr r2, _081A3590 + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x9 + bl sub_80EE8C8 + b _081A35CE + .align 2, 0 +_081A3588: .4byte 0x03005d90 +_081A358C: .4byte 0x00000e04 +_081A3590: .4byte 0x00000e08 +_081A3594: + ldr r6, _081A35E0 + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, _081A35E4 + adds r0, r1, r5 + adds r0, r4 + ldr r7, _081A35E8 + adds r1, r7 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xD + bl sub_80EE8C8 +_081A35CE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A35E0: .4byte 0x03005d90 +_081A35E4: .4byte 0x00000e1a +_081A35E8: .4byte 0x00000e1e + thumb_func_end sub_81A31FC + + thumb_func_start sub_81A35EC +sub_81A35EC: @ 81A35EC + push {r4,lr} + ldr r0, _081A3608 + bl var_get + ldr r4, _081A360C + bl sub_81A3610 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A3608: .4byte 0x000040cf +_081A360C: .4byte 0x020375f0 + thumb_func_end sub_81A35EC + + thumb_func_start sub_81A3610 +sub_81A3610: @ 81A3610 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r8, r0 + ldr r0, _081A3650 + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _081A3654 + bl var_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + ldr r1, _081A3658 + mov r9, r1 + lsls r7, r6, 2 + adds r1, 0x3 + adds r1, r7, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r5, r0, r1 + cmp r4, 0 + beq _081A365C + movs r0, 0 + b _081A36C2 + .align 2, 0 +_081A3650: .4byte 0x000040cf +_081A3654: .4byte 0x000040ce +_081A3658: .4byte 0x08611550 +_081A365C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + blt _081A3680 + cmp r1, 0x1 + bgt _081A3680 + adds r0, r1, r7 + add r0, r9 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36BC + adds r1, 0x1 + mov r8, r1 + b _081A36BC +_081A3680: + ldr r1, _081A3690 + lsls r2, r6, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r5, r0 + bne _081A3694 + movs r0, 0x3 + b _081A36BA + .align 2, 0 +_081A3690: .4byte 0x08611550 +_081A3694: + adds r0, r1, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36A4 + movs r1, 0x4 + mov r8, r1 + b _081A36BC +_081A36A4: + cmp r5, r0 + ble _081A36BC + subs r0, r5, r0 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A36BC + movs r0, 0x4 +_081A36BA: + mov r8, r0 +_081A36BC: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 +_081A36C2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A3610 + + thumb_func_start sub_81A36D0 +sub_81A36D0: @ 81A36D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r0, 0x1 + beq _081A3766 + cmp r0, 0x1 + bgt _081A36EA + cmp r0, 0 + beq _081A36F2 + b _081A38F8 +_081A36EA: + cmp r2, 0x2 + bne _081A36F0 + b _081A3818 +_081A36F0: + b _081A38F8 +_081A36F2: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A370C + ldr r0, _081A3704 + ldr r0, [r0] + ldr r1, _081A3708 + b _081A38C4 + .align 2, 0 +_081A3704: .4byte 0x03005d90 +_081A3708: .4byte 0x00000bfc +_081A370C: + ldr r0, _081A372C + cmp r3, r0 + beq _081A3786 + ldr r0, _081A3730 + cmp r3, r0 + bhi _081A3738 + ldr r2, _081A3734 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC + b _081A38F8 + .align 2, 0 +_081A372C: .4byte 0x000003fe +_081A3730: .4byte 0x0000012b +_081A3734: .4byte 0x0203bc88 +_081A3738: + ldr r0, _081A374C + cmp r3, r0 + bhi _081A3758 + ldr r1, _081A3750 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, _081A3754 + b _081A38C4 + .align 2, 0 +_081A374C: .4byte 0x0000018f +_081A3750: .4byte 0x03005d90 +_081A3754: .4byte 0xfffef2b8 +_081A3758: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C + b _081A38F8 +_081A3766: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3780 + ldr r0, _081A3778 + ldr r0, [r0] + ldr r1, _081A377C + b _081A38C4 + .align 2, 0 +_081A3778: .4byte 0x03005d90 +_081A377C: .4byte 0x00000c08 +_081A3780: + ldr r0, _081A3790 + cmp r3, r0 + bne _081A3794 +_081A3786: + movs r0, 0 + bl sub_81A51A8 + b _081A38F8 + .align 2, 0 +_081A3790: .4byte 0x000003fe +_081A3794: + ldr r0, _081A37B0 + cmp r3, r0 + bhi _081A37B8 + ldr r2, _081A37B4 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl sub_81638AC + b _081A38F8 + .align 2, 0 +_081A37B0: .4byte 0x0000012b +_081A37B4: .4byte 0x0203bc88 +_081A37B8: + ldr r0, _081A37DC + cmp r3, r0 + bhi _081A37EC + ldr r0, _081A37E0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, _081A37E4 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, _081A37E8 + b _081A38C4 + .align 2, 0 +_081A37DC: .4byte 0x0000018f +_081A37E0: .4byte 0x02022fec +_081A37E4: .4byte 0x03005d90 +_081A37E8: .4byte 0xfffef2c4 +_081A37EC: + ldr r0, _081A380C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, _081A3810 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r0, r1 + ldr r1, _081A3814 + b _081A38C4 + .align 2, 0 +_081A380C: .4byte 0x02022fec +_081A3810: .4byte 0x03005d90 +_081A3814: .4byte 0xffff96c4 +_081A3818: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3830 + ldr r0, _081A3828 + ldr r0, [r0] + ldr r1, _081A382C + b _081A38C4 + .align 2, 0 +_081A3828: .4byte 0x03005d90 +_081A382C: .4byte 0x00000c14 +_081A3830: + ldr r0, _081A3840 + cmp r3, r0 + bne _081A3844 + movs r0, 0x1 + bl sub_81A51A8 + b _081A38F8 + .align 2, 0 +_081A3840: .4byte 0x000003fe +_081A3844: + ldr r0, _081A3860 + cmp r3, r0 + bhi _081A3868 + ldr r2, _081A3864 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl sub_81638AC + b _081A38F8 + .align 2, 0 +_081A3860: .4byte 0x0000012b +_081A3864: .4byte 0x0203bc88 +_081A3868: + ldr r0, _081A3888 + cmp r3, r0 + bhi _081A38A8 + ldr r0, _081A388C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A3890 +_081A387C: + bl sub_81864E0 + bl sub_81638AC + b _081A38F8 + .align 2, 0 +_081A3888: .4byte 0x0000018f +_081A388C: .4byte 0x02022fec +_081A3890: + ldr r1, _081A38A0 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, _081A38A4 + b _081A38C4 + .align 2, 0 +_081A38A0: .4byte 0x03005d90 +_081A38A4: .4byte 0xfffef2d0 +_081A38A8: + ldr r0, _081A38CC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A38D4 + bl sub_81864A8 + lsls r0, 24 + lsrs r3, r0, 24 + movs r0, 0x58 + muls r0, r3 + ldr r1, _081A38D0 +_081A38C4: + adds r0, r1 + bl sub_81638AC + b _081A38F8 + .align 2, 0 +_081A38CC: .4byte 0x02022fec +_081A38D0: .4byte 0x086109ba +_081A38D4: + ldr r0, _081A38FC + ldr r1, [r0] + ldr r0, _081A3900 + adds r2, r3, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r3, r0, 27 + movs r0, 0x58 + muls r0, r3 + ldr r1, _081A3904 + adds r0, r1 + bl sub_81638AC +_081A38F8: + pop {r0} + bx r0 + .align 2, 0 +_081A38FC: .4byte 0x03005d90 +_081A3900: .4byte 0xfffffe70 +_081A3904: .4byte 0x086109ba + thumb_func_end sub_81A36D0 + + thumb_func_start sub_81A3908 +sub_81A3908: @ 81A3908 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _081A39AC + ldr r1, [r0] + ldr r2, _081A39B0 + adds r1, r2 + movs r2, 0 + str r2, [r1] + movs r4, 0 + mov r9, r0 + mov r8, r9 + movs r6, 0 +_081A3926: + movs r5, 0 + lsls r7, r4, 2 + mov r10, r7 + adds r0, r4, 0x1 + mov r12, r0 +_081A3930: + mov r1, r8 + ldr r2, [r1] + lsls r3, r5, 1 + mov r7, r10 + adds r1, r3, r7 + movs r7, 0xCE + lsls r7, 4 + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + cmp r4, 0x1 + bgt _081A3960 + adds r7, 0x2C + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0xBC + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0x1A + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] +_081A3960: + cmp r4, 0 + bne _081A3980 + mov r1, r8 + ldr r0, [r1] + ldr r2, _081A39B4 + adds r1, r0, r2 + adds r1, r3 + strh r4, [r1] + ldr r7, _081A39B8 + adds r1, r0, r7 + adds r1, r3 + strh r4, [r1] + ldr r1, _081A39BC + adds r0, r1 + adds r0, r3 + strh r4, [r0] +_081A3980: + adds r5, 0x1 + cmp r5, 0x1 + ble _081A3930 + mov r4, r12 + cmp r4, 0x3 + ble _081A3926 + mov r2, r9 + ldr r0, [r2] + ldr r7, _081A39C0 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0 + beq _081A399E + movs r0, 0x1 + strb r0, [r1] +_081A399E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A39AC: .4byte 0x03005d90 +_081A39B0: .4byte 0x00000cdc +_081A39B4: .4byte 0x00000dda +_081A39B8: .4byte 0x00000e04 +_081A39BC: .4byte 0x00000e1a +_081A39C0: .4byte 0x00000ca8 + thumb_func_end sub_81A3908 + + thumb_func_start sub_81A39C4 +sub_81A39C4: @ 81A39C4 + push {r4,r5,lr} + ldr r0, _081A39F8 + ldr r0, [r0] + ldr r1, _081A39FC + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, _081A3A00 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _081A3A04 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _081A3AC4 + lsls r0, 2 + ldr r1, _081A3A08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A39F8: .4byte 0x03005d90 +_081A39FC: .4byte 0x00000ca9 +_081A3A00: .4byte 0x000040ce +_081A3A04: .4byte 0x000040cf +_081A3A08: .4byte _081A3A0C + .align 2, 0 +_081A3A0C: + .4byte _081A3A28 + .4byte _081A3A3C + .4byte _081A3A54 + .4byte _081A3A6C + .4byte _081A3A80 + .4byte _081A3A98 + .4byte _081A3AAC +_081A3A28: + ldr r0, _081A3A38 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3AB4 + .align 2, 0 +_081A3A38: .4byte 0x03005d90 +_081A3A3C: + ldr r0, _081A3A4C + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, _081A3A50 + b _081A3AB4 + .align 2, 0 +_081A3A4C: .4byte 0x03005d90 +_081A3A50: .4byte 0x00000d0c +_081A3A54: + ldr r0, _081A3A64 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, _081A3A68 + b _081A3AB4 + .align 2, 0 +_081A3A64: .4byte 0x03005d90 +_081A3A68: .4byte 0x00000dc8 +_081A3A6C: + ldr r0, _081A3A78 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A3A7C + b _081A3AB4 + .align 2, 0 +_081A3A78: .4byte 0x03005d90 +_081A3A7C: .4byte 0x00000dda +_081A3A80: + ldr r0, _081A3A90 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, _081A3A94 + b _081A3AB4 + .align 2, 0 +_081A3A90: .4byte 0x03005d90 +_081A3A94: .4byte 0x00000de2 +_081A3A98: + ldr r0, _081A3AA4 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A3AA8 + b _081A3AB4 + .align 2, 0 +_081A3AA4: .4byte 0x03005d90 +_081A3AA8: .4byte 0x00000e04 +_081A3AAC: + ldr r0, _081A3ABC + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A3AC0 +_081A3AB4: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + b _081A3AC6 + .align 2, 0 +_081A3ABC: .4byte 0x03005d90 +_081A3AC0: .4byte 0x00000e1a +_081A3AC4: + movs r0, 0 +_081A3AC6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A39C4 + + thumb_func_start sub_81A3ACC +sub_81A3ACC: @ 81A3ACC + push {r4,r5,lr} + movs r2, 0 + ldr r5, _081A3AF4 + ldr r4, _081A3AF8 + ldr r0, _081A3AFC + adds r3, r0, 0 +_081A3AD8: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r2, 0x1 + cmp r2, 0x13 + ble _081A3AD8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A3AF4: .4byte 0x03005d90 +_081A3AF8: .4byte 0x00000cb4 +_081A3AFC: .4byte 0x0000ffff + thumb_func_end sub_81A3ACC + + thumb_func_start sub_81A3B00 +sub_81A3B00: @ 81A3B00 + push {lr} + ldr r0, _081A3B14 + ldrh r1, [r0] + ldr r0, _081A3B18 + cmp r1, r0 + bne _081A3B20 + ldr r1, _081A3B1C + movs r0, 0x1 + b _081A3B24 + .align 2, 0 +_081A3B14: .4byte 0x02038bca +_081A3B18: .4byte 0x000003fe +_081A3B1C: .4byte 0x020375f0 +_081A3B20: + ldr r1, _081A3B2C + movs r0, 0 +_081A3B24: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081A3B2C: .4byte 0x020375f0 + thumb_func_end sub_81A3B00 + + thumb_func_start sub_81A3B30 +sub_81A3B30: @ 81A3B30 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 23 + ldr r1, _081A3B5C + adds r0, r4, r1 + bl flag_check + adds r5, r0, 0 + ldr r0, _081A3B60 + adds r4, r0 + adds r0, r4, 0 + bl flag_check + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081A3B5C: .4byte 0x000008c4 +_081A3B60: .4byte 0x000008c5 + thumb_func_end sub_81A3B30 + + thumb_func_start sub_81A3B64 +sub_81A3B64: @ 81A3B64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, _081A3BA0 + ldr r0, [r0] + ldr r1, _081A3BA4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, _081A3BA8 + bl var_get + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, _081A3BAC + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + cmp r7, 0x6 + bhi _081A3C78 + lsls r0, r7, 2 + ldr r1, _081A3BB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A3BA0: .4byte 0x03005d90 +_081A3BA4: .4byte 0x00000ca9 +_081A3BA8: .4byte 0x000040cf +_081A3BAC: .4byte 0x000040ce +_081A3BB0: .4byte _081A3BB4 + .align 2, 0 +_081A3BB4: + .4byte _081A3BD0 + .4byte _081A3BE4 + .4byte _081A3C00 + .4byte _081A3C18 + .4byte _081A3C2C + .4byte _081A3C44 + .4byte _081A3C60 +_081A3BD0: + ldr r0, _081A3BE0 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3C68 + .align 2, 0 +_081A3BE0: .4byte 0x03005d90 +_081A3BE4: + ldr r0, _081A3BF8 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, _081A3BFC + adds r0, r2 + adds r0, r1 + ldrh r5, [r0] + b _081A3C78 + .align 2, 0 +_081A3BF8: .4byte 0x03005d90 +_081A3BFC: .4byte 0x00000d0c +_081A3C00: + ldr r0, _081A3C10 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, _081A3C14 + b _081A3C68 + .align 2, 0 +_081A3C10: .4byte 0x03005d90 +_081A3C14: .4byte 0x00000dc8 +_081A3C18: + ldr r0, _081A3C24 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A3C28 + b _081A3C68 + .align 2, 0 +_081A3C24: .4byte 0x03005d90 +_081A3C28: .4byte 0x00000dda +_081A3C2C: + ldr r0, _081A3C3C + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, _081A3C40 + b _081A3C68 + .align 2, 0 +_081A3C3C: .4byte 0x03005d90 +_081A3C40: .4byte 0x00000de2 +_081A3C44: + ldr r0, _081A3C58 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A3C5C + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xE + b _081A3C70 + .align 2, 0 +_081A3C58: .4byte 0x03005d90 +_081A3C5C: .4byte 0x00000e04 +_081A3C60: + ldr r0, _081A3D08 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A3D0C +_081A3C68: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 +_081A3C70: + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 +_081A3C78: + cmp r5, 0 + beq _081A3C7E + subs r5, 0x1 +_081A3C7E: + cmp r5, 0x1D + bls _081A3C84 + movs r5, 0x1D +_081A3C84: + ldr r2, _081A3D10 + lsls r1, r7, 2 + adds r1, r6, r1 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r1, r0 + adds r7, r1, r2 + ldrb r5, [r7] + ldr r0, _081A3D14 + mov r9, r0 + ldrh r0, [r0] + ldr r1, _081A3D18 + mov r8, r1 + cmp r0, r8 + bne _081A3CA6 + adds r5, 0xA +_081A3CA6: + ldr r6, _081A3D08 + ldr r1, [r6] + ldr r4, _081A3D1C + adds r1, r4 + ldrh r0, [r1] + adds r0, r5 + strh r0, [r1] + ldr r0, _081A3D20 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, [r6] + adds r2, r0, r4 + ldrh r0, [r2] + ldr r1, _081A3D24 + cmp r0, r1 + bls _081A3CCE + strh r1, [r2] +_081A3CCE: + ldr r0, [r6] + ldr r4, _081A3D28 + adds r0, r4 + ldrh r5, [r0] + ldrb r0, [r7] + adds r5, r0 + bl sub_80EED60 + mov r2, r9 + ldrh r0, [r2] + cmp r0, r8 + bne _081A3CEE + adds r5, 0xA + movs r0, 0xA + bl sub_80EED60 +_081A3CEE: + ldr r0, _081A3D2C + cmp r5, r0 + ble _081A3CF6 + adds r5, r0, 0 +_081A3CF6: + ldr r0, [r6] + adds r0, r4 + strh r5, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A3D08: .4byte 0x03005d90 +_081A3D0C: .4byte 0x00000e1a +_081A3D10: .4byte 0x086118b4 +_081A3D14: .4byte 0x02038bca +_081A3D18: .4byte 0x000003fe +_081A3D1C: .4byte 0x00000eb8 +_081A3D20: .4byte 0x02021cc4 +_081A3D24: .4byte 0x0000270f +_081A3D28: .4byte 0x00000eba +_081A3D2C: .4byte 0x0000ffff + thumb_func_end sub_81A3B64 + + thumb_func_start sub_81A3D30 +sub_81A3D30: @ 81A3D30 + push {r4,lr} + ldr r0, _081A3D50 + bl var_get + ldr r4, _081A3D54 + lsls r0, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A3D50: .4byte 0x000040cf +_081A3D54: .4byte 0x020375f0 + thumb_func_end sub_81A3D30 + + thumb_func_start sub_81A3D58 +sub_81A3D58: @ 81A3D58 + push {r4,lr} + ldr r0, _081A3D80 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + cmp r0, 0 + bne _081A3D88 + lsls r0, r4, 17 + ldr r1, _081A3D84 + adds r0, r1 + lsrs r0, 16 + bl flag_set + b _081A3D94 + .align 2, 0 +_081A3D80: .4byte 0x000040cf +_081A3D84: .4byte 0x08c40000 +_081A3D88: + lsls r0, r4, 17 + ldr r1, _081A3D9C + adds r0, r1 + lsrs r0, 16 + bl flag_set +_081A3D94: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A3D9C: .4byte 0x08c50000 + thumb_func_end sub_81A3D58 + + thumb_func_start sub_81A3DA0 +sub_81A3DA0: @ 81A3DA0 + push {lr} + ldr r0, _081A3DB8 + ldr r1, _081A3DBC + ldrh r1, [r1] + ldr r2, [r0] + ands r2, r1 + cmp r2, 0 + beq _081A3DC4 + ldr r1, _081A3DC0 + movs r0, 0x1 + strh r0, [r1] + b _081A3DC8 + .align 2, 0 +_081A3DB8: .4byte 0x02022fec +_081A3DBC: .4byte 0x020375e2 +_081A3DC0: .4byte 0x020375f0 +_081A3DC4: + ldr r0, _081A3DCC + strh r2, [r0] +_081A3DC8: + pop {r0} + bx r0 + .align 2, 0 +_081A3DCC: .4byte 0x020375f0 + thumb_func_end sub_81A3DA0 + + thumb_func_start sub_81A3DD0 +sub_81A3DD0: @ 81A3DD0 + push {r4-r6,lr} + adds r5, r2, 0 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + adds r0, r6, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081A3ED6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + subs r0, r4, 0x1 + cmp r0, 0xA + bhi _081A3EA0 + lsls r0, 2 + ldr r1, _081A3E08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A3E08: .4byte _081A3E0C + .align 2, 0 +_081A3E0C: + .4byte _081A3E38 + .4byte _081A3E68 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 +_081A3E38: + cmp r5, r4 + bne _081A3E50 + ldr r0, _081A3E48 + ldr r1, _081A3E4C + bl gf_strcat + b _081A3EC8 + .align 2, 0 +_081A3E48: .4byte 0x02021cc4 +_081A3E4C: .4byte 0x085ccb79 +_081A3E50: + cmp r5, r4 + ble _081A3EC8 + ldr r0, _081A3E60 + ldr r1, _081A3E64 + bl gf_strcat + b _081A3EC8 + .align 2, 0 +_081A3E60: .4byte 0x02021cc4 +_081A3E64: .4byte 0x085ccb7f +_081A3E68: + cmp r4, r5 + bne _081A3E80 + ldr r0, _081A3E78 + ldr r1, _081A3E7C + bl gf_strcat + b _081A3E88 + .align 2, 0 +_081A3E78: .4byte 0x02021cc4 +_081A3E7C: .4byte 0x085ccb79 +_081A3E80: + ldr r0, _081A3E94 + ldr r1, _081A3E98 + bl gf_strcat +_081A3E88: + ldr r0, _081A3E94 + ldr r1, _081A3E9C + bl gf_strcat + b _081A3EC8 + .align 2, 0 +_081A3E94: .4byte 0x02021cc4 +_081A3E98: .4byte 0x085ccb7f +_081A3E9C: .4byte 0x085ccb86 +_081A3EA0: + cmp r4, r5 + bne _081A3EB8 + ldr r0, _081A3EB0 + ldr r1, _081A3EB4 + bl gf_strcat + b _081A3EC0 + .align 2, 0 +_081A3EB0: .4byte 0x02021cc4 +_081A3EB4: .4byte 0x085ccb79 +_081A3EB8: + ldr r0, _081A3EE0 + ldr r1, _081A3EE4 + bl gf_strcat +_081A3EC0: + ldr r0, _081A3EE0 + ldr r1, _081A3EE8 + bl gf_strcat +_081A3EC8: + ldr r0, _081A3EE0 + movs r1, 0xB + muls r1, r6 + ldr r2, _081A3EEC + adds r1, r2 + bl gf_strcat +_081A3ED6: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081A3EE0: .4byte 0x02021cc4 +_081A3EE4: .4byte 0x085ccb7f +_081A3EE8: .4byte 0x085ccb84 +_081A3EEC: .4byte 0x083185c8 + thumb_func_end sub_81A3DD0 + + thumb_func_start sub_81A3EF0 +sub_81A3EF0: @ 81A3EF0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, [sp, 0x20] + ldr r4, [sp, 0x24] + mov r9, r4 + ldr r4, [sp, 0x28] + mov r10, r4 + ldr r7, [sp, 0x2C] + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + beq _081A3FBE + cmp r4, 0 + beq _081A3FBE + ldr r0, _081A3FCC + ldrh r1, [r0] + ldr r5, _081A3FD0 + adds r3, r0, 0 + cmp r1, r5 + beq _081A3F54 + cmp r1, r4 + beq _081A3F48 + adds r1, r3, 0 +_081A3F3A: + adds r1, 0x2 + adds r2, 0x1 + ldrh r0, [r1] + cmp r0, r5 + beq _081A3F54 + cmp r0, r4 + bne _081A3F3A +_081A3F48: + lsls r0, r2, 1 + adds r0, r3 + ldrh r1, [r0] + ldr r0, _081A3FD0 + cmp r1, r0 + bne _081A3FBE +_081A3F54: + mov r0, r12 + cmp r0, 0 + bne _081A3F60 + mov r1, r8 + cmp r1, 0x32 + bhi _081A3FBE +_081A3F60: + movs r2, 0 + ldrb r3, [r7] + cmp r2, r3 + bge _081A3F80 + mov r1, r9 + ldrh r0, [r1] + cmp r0, r4 + beq _081A3F80 + adds r5, r3, 0 +_081A3F72: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3F80 + ldrh r0, [r1] + cmp r0, r4 + bne _081A3F72 +_081A3F80: + cmp r2, r3 + bne _081A3FBE + cmp r6, 0 + beq _081A3FAA + movs r2, 0 + cmp r2, r3 + bge _081A3FA6 + mov r1, r10 + ldrh r0, [r1] + cmp r0, r6 + beq _081A3FA6 + adds r5, r3, 0 +_081A3F98: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3FA6 + ldrh r0, [r1] + cmp r0, r6 + bne _081A3F98 +_081A3FA6: + cmp r2, r3 + bne _081A3FBE +_081A3FAA: + lsls r0, r3, 1 + add r0, r9 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + add r0, r10 + strh r6, [r0] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] +_081A3FBE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A3FCC: .4byte 0x08611c9a +_081A3FD0: .4byte 0x0000ffff + thumb_func_end sub_81A3EF0 + + thumb_func_start sub_81A3FD4 +sub_81A3FD4: @ 81A3FD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + movs r0, 0 + str r0, [sp, 0x2C] + add r4, sp, 0x28 + strb r0, [r4] + ldr r0, _081A4004 + bl var_get + lsls r0, 16 + lsrs r0, 16 + mov r10, r4 + cmp r0, 0x1 + beq _081A4016 + cmp r0, 0x1 + bgt _081A4008 + cmp r0, 0 + beq _081A4010 + b _081A402A + .align 2, 0 +_081A4004: .4byte 0x000040ce +_081A4008: + cmp r0, 0x3 + bgt _081A402A + movs r0, 0x2 + b _081A4028 +_081A4010: + movs r1, 0x3 + str r1, [sp, 0x2C] + b _081A402A +_081A4016: + ldr r0, _081A4030 + bl var_get + lsls r0, 16 + movs r1, 0x3 + str r1, [sp, 0x2C] + cmp r0, 0 + bne _081A402A + movs r0, 0x4 +_081A4028: + str r0, [sp, 0x2C] +_081A402A: + movs r1, 0 + mov r9, r1 + b _081A4040 + .align 2, 0 +_081A4030: .4byte 0x000040cf +_081A4034: + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + blt _081A4040 + b _081A41E0 +_081A4040: + mov r5, r9 + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x30] +_081A404E: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081A40BC + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _081A40C0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bne _081A40C8 + cmp r7, 0 + bne _081A40E4 + ldr r0, _081A40C4 + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + movs r1, 0 + adds r2, r4, 0 + bl sub_81A3EF0 + b _081A40E4 + .align 2, 0 +_081A40BC: .4byte 0x020244ec +_081A40C0: .4byte 0x000040cf +_081A40C4: .4byte 0x020375f0 +_081A40C8: + ldr r0, _081A4188 + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_81A3EF0 +_081A40E4: + adds r5, 0x1 + cmp r5, 0x5 + ble _081A40EC + movs r5, 0 +_081A40EC: + cmp r5, r9 + bne _081A404E + ldr r1, [sp, 0x30] + mov r9, r1 + cmp r1, 0x5 + ble _081A4034 + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + bge _081A41E0 + movs r6, 0 + ldr r0, _081A418C + ldrh r2, [r0] + ldr r1, _081A4190 + mov r8, r0 + cmp r2, r1 + beq _081A4134 + mov r4, r8 +_081A4112: + adds r0, r2, 0 + bl species_to_pokedex_index + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081A412A + adds r6, 0x1 +_081A412A: + adds r4, 0x2 + ldrh r2, [r4] + ldr r0, _081A4190 + cmp r2, r0 + bne _081A4112 +_081A4134: + ldr r1, _081A4194 + movs r0, 0xFF + strb r0, [r1] + ldr r1, _081A4198 + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r1, r8 + ldrh r0, [r1] + ldr r1, _081A4190 + cmp r0, r1 + beq _081A416A + mov r5, r10 + adds r7, r1, 0 + mov r4, r8 +_081A4156: + ldrh r0, [r4] + ldrb r1, [r5] + adds r2, r6, 0 + bl sub_81A3DD0 + strb r0, [r5] + adds r4, 0x2 + ldrh r0, [r4] + cmp r0, r7 + bne _081A4156 +_081A416A: + mov r0, r10 + ldrb r4, [r0] + cmp r4, 0 + bne _081A41A4 + ldr r4, _081A4194 + ldr r1, _081A419C + adds r0, r4, 0 + bl gf_strcat + ldr r1, _081A41A0 + adds r0, r4, 0 + bl gf_strcat + b _081A4202 + .align 2, 0 +_081A4188: .4byte 0x020375f0 +_081A418C: .4byte 0x08611c9a +_081A4190: .4byte 0x0000ffff +_081A4194: .4byte 0x02021cc4 +_081A4198: .4byte 0x020375e0 +_081A419C: .4byte 0x085ccb82 +_081A41A0: .4byte 0x085ccb88 +_081A41A4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081A41C0 + ldr r0, _081A41B8 + ldr r1, _081A41BC + bl gf_strcat + b _081A41C8 + .align 2, 0 +_081A41B8: .4byte 0x02021cc4 +_081A41BC: .4byte 0x085ccb84 +_081A41C0: + ldr r0, _081A41D4 + ldr r1, _081A41D8 + bl gf_strcat +_081A41C8: + ldr r0, _081A41D4 + ldr r1, _081A41DC + bl gf_strcat + b _081A4202 + .align 2, 0 +_081A41D4: .4byte 0x02021cc4 +_081A41D8: .4byte 0x085ccb82 +_081A41DC: .4byte 0x085ccb8c +_081A41E0: + ldr r1, _081A4214 + movs r0, 0 + strh r0, [r1] + ldr r0, _081A4218 + ldr r2, [r0] + ldr r0, _081A421C + ldrb r0, [r0] + ldr r1, _081A4220 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A4202: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A4214: .4byte 0x020375e0 +_081A4218: .4byte 0x03005d90 +_081A421C: .4byte 0x020375f0 +_081A4220: .4byte 0x00000ca9 + thumb_func_end sub_81A3FD4 + + thumb_func_start sub_81A4224 +sub_81A4224: @ 81A4224 + push {lr} + bl sub_81652B4 + pop {r0} + bx r0 + thumb_func_end sub_81A4224 + + thumb_func_start sub_81A4230 +sub_81A4230: @ 81A4230 + push {r4-r7,lr} + ldr r0, _081A4264 + ldr r0, [r0] + ldr r1, _081A4268 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, _081A426C + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _081A4270 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _081A425A + b _081A4394 +_081A425A: + lsls r0, 2 + ldr r1, _081A4274 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A4264: .4byte 0x03005d90 +_081A4268: .4byte 0x00000ca9 +_081A426C: .4byte 0x000040ce +_081A4270: .4byte 0x000040cf +_081A4274: .4byte _081A4278 + .align 2, 0 +_081A4278: + .4byte _081A4294 + .4byte _081A42DC + .4byte _081A431C + .4byte _081A4338 + .4byte _081A434C + .4byte _081A4368 + .4byte _081A437C +_081A4294: + ldr r7, _081A42D0 + ldr r0, [r7] + lsls r4, 1 + lsls r1, r5, 2 + adds r1, r4, r1 + movs r6, 0xCE + lsls r6, 4 + adds r3, r0, r6 + adds r2, r3, r1 + ldrh r1, [r2] + ldr r0, _081A42D4 + cmp r1, r0 + bhi _081A4394 + adds r0, r1, 0x1 + strh r0, [r2] + cmp r5, 0 + bne _081A4394 + adds r0, r3, r4 + ldrh r1, [r0] + movs r0, 0x20 + bl sav12_xor_set + ldr r1, [r7] + adds r0, r1, r6 + adds r0, r4 + ldrh r0, [r0] + ldr r2, _081A42D8 + adds r1, r2 + b _081A4392 + .align 2, 0 +_081A42D0: .4byte 0x03005d90 +_081A42D4: .4byte 0x0000270e +_081A42D8: .4byte 0x00000d02 +_081A42DC: + ldr r6, _081A430C + ldr r0, [r6] + lsls r2, r4, 1 + lsls r1, r5, 2 + adds r1, r2, r1 + ldr r3, _081A4310 + adds r0, r3 + adds r3, r0, r1 + ldrh r0, [r3] + ldr r2, _081A4314 + cmp r0, r2 + bhi _081A42F8 + adds r0, 0x1 + strh r0, [r3] +_081A42F8: + ldr r0, [r6] + ldr r3, _081A4318 + adds r0, r3 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r2 + bhi _081A4394 + adds r0, 0x1 + b _081A4392 + .align 2, 0 +_081A430C: .4byte 0x03005d90 +_081A4310: .4byte 0x00000d0c +_081A4314: .4byte 0x0000270e +_081A4318: .4byte 0x00000d1c +_081A431C: + ldr r0, _081A4330 + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, _081A4334 + adds r2, r1 + adds r1, r2, r0 + b _081A4388 + .align 2, 0 +_081A4330: .4byte 0x03005d90 +_081A4334: .4byte 0x00000dc8 +_081A4338: + ldr r0, _081A4344 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A4348 + adds r0, r2 + b _081A4386 + .align 2, 0 +_081A4344: .4byte 0x03005d90 +_081A4348: .4byte 0x00000dda +_081A434C: + ldr r0, _081A4360 + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r3, _081A4364 + adds r2, r3 + adds r1, r2, r0 + b _081A4388 + .align 2, 0 +_081A4360: .4byte 0x03005d90 +_081A4364: .4byte 0x00000de2 +_081A4368: + ldr r0, _081A4374 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A4378 + adds r0, r2 + b _081A4386 + .align 2, 0 +_081A4374: .4byte 0x03005d90 +_081A4378: .4byte 0x00000e04 +_081A437C: + ldr r0, _081A439C + ldr r0, [r0] + lsls r1, r4, 1 + ldr r3, _081A43A0 + adds r0, r3 +_081A4386: + adds r1, r0, r1 +_081A4388: + ldrh r3, [r1] + ldr r0, _081A43A4 + cmp r3, r0 + bhi _081A4394 + adds r0, r3, 0x1 +_081A4392: + strh r0, [r1] +_081A4394: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A439C: .4byte 0x03005d90 +_081A43A0: .4byte 0x00000e1a +_081A43A4: .4byte 0x0000270e + thumb_func_end sub_81A4230 + + thumb_func_start sub_81A43A8 +sub_81A43A8: @ 81A43A8 + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + ldr r6, _081A4400 + movs r5, 0x64 +_081A43B2: + ldr r0, _081A4404 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A4408 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A43EE + adds r1, r0, 0 + muls r1, r5 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + muls r0, r5 + ldr r1, _081A440C + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_081A43EE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A43B2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A4400: .4byte 0x03005d8c +_081A4404: .4byte 0x03005d90 +_081A4408: .4byte 0x00000caa +_081A440C: .4byte 0x020244ec + thumb_func_end sub_81A43A8 + + thumb_func_start sub_81A4410 +sub_81A4410: @ 81A4410 + push {r4,lr} + ldr r4, _081A4430 + bl sub_8185338 + strh r0, [r4] + ldr r0, _081A4434 + ldr r1, [r0] + ldr r0, _081A4438 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A4430: .4byte 0x020375f0 +_081A4434: .4byte 0x03005d90 +_081A4438: .4byte 0x00000ca9 + thumb_func_end sub_81A4410 + + thumb_func_start sub_81A443C +sub_81A443C: @ 81A443C + push {lr} + ldr r0, _081A444C + ldrh r0, [r0] + cmp r0, 0 + beq _081A4450 + cmp r0, 0x1 + beq _081A4464 + b _081A446E + .align 2, 0 +_081A444C: .4byte 0x020375e2 +_081A4450: + ldr r0, _081A445C + ldr r1, _081A4460 + ldrh r1, [r1] + bl sub_8162E20 + b _081A446E + .align 2, 0 +_081A445C: .4byte 0x02021cc4 +_081A4460: .4byte 0x02038bca +_081A4464: + ldr r0, _081A4474 + ldr r1, _081A4478 + ldrh r1, [r1] + bl sub_8162E20 +_081A446E: + pop {r0} + bx r0 + .align 2, 0 +_081A4474: .4byte 0x02021dc4 +_081A4478: .4byte 0x02038bca + thumb_func_end sub_81A443C + + thumb_func_start sub_81A447C +sub_81A447C: @ 81A447C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0 + str r0, [sp] +_081A448C: + ldr r1, _081A456C + ldr r0, [r1] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r4, _081A4570 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r1 + adds r2, 0x1 + str r2, [sp, 0x4] + cmp r0, 0x5 + bhi _081A454E + movs r6, 0 + ldr r0, [sp] + movs r2, 0x64 + adds r1, r0, 0 + muls r1, r2 + ldr r0, _081A4574 + adds r7, r1, r0 +_081A44BA: + movs r5, 0 + movs r4, 0xD + adds r4, r6 + mov r8, r4 + adds r0, r6, 0x1 + mov r10, r0 +_081A44C6: + ldr r1, _081A456C + ldr r0, [r1] + ldr r2, _081A4570 + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + movs r4, 0x64 + adds r1, r0, 0 + muls r1, r4 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r2, _081A4578 + ldr r0, [r2] + adds r0, r1 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + beq _081A4508 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A44C6 +_081A4508: + cmp r5, 0x4 + bne _081A4516 + adds r0, r7, 0 + movs r1, 0xA6 + adds r2, r6, 0 + bl sub_80691F4 +_081A4516: + mov r4, r10 + lsls r0, r4, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _081A44BA + ldr r0, _081A4578 + ldr r0, [r0] + ldr r2, _081A456C + ldr r1, [r2] + ldr r4, _081A4570 + adds r1, r4 + add r1, r9 + ldrh r1, [r1] + subs r1, 0x1 + movs r3, 0x64 + muls r1, r3 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, _081A4574 + ldr r4, [sp] + adds r1, r4, 0 + muls r1, r3 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A454E: + ldr r1, [sp, 0x4] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + cmp r0, 0x3 + bls _081A448C + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A456C: .4byte 0x03005d90 +_081A4570: .4byte 0x00000caa +_081A4574: .4byte 0x020244ec +_081A4578: .4byte 0x03005d8c + thumb_func_end sub_81A447C + + thumb_func_start sub_81A457C +sub_81A457C: @ 81A457C + push {lr} + ldr r0, _081A4590 + bl var_get + lsls r0, 24 + lsrs r0, 24 + bl sub_81A5030 + pop {r0} + bx r0 + .align 2, 0 +_081A4590: .4byte 0x000040cf + thumb_func_end sub_81A457C + + thumb_func_start sub_81A4594 +sub_81A4594: @ 81A4594 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r8, r1 + adds r6, r3, 0 + ldr r1, _081A466C + ldrb r5, [r1] + lsls r4, r0, 1 + adds r4, r0 + ldr r1, _081A4670 + adds r4, r1 + mov r1, r8 + lsls r3, r1, 27 + lsrs r3, 24 + lsls r1, r0, 2 + adds r1, r0 + adds r2, r1 + lsls r2, 3 + adds r2, 0x1 + lsls r2, 24 + lsrs r7, r2, 24 + str r7, [sp] + movs r0, 0xFF + mov r10, r0 + str r0, [sp, 0x4] + movs r1, 0 + mov r9, r1 + str r1, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r0, 0xFF + strb r0, [r6, 0xD] + ldrh r0, [r6, 0x4] + cmp r0, 0 + beq _081A465C + adds r1, r6, 0x6 + ldrb r2, [r6, 0xE] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, _081A466C + ldrb r0, [r1] + mov r3, r8 + adds r3, 0x2 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrh r1, [r6, 0x4] + ldr r0, _081A4674 + cmp r1, r0 + bls _081A4618 + adds r1, r0, 0 +_081A4618: + ldr r0, _081A4678 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r5, _081A467C + ldr r1, _081A4680 + ldr r0, [sp, 0x4C] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl sub_81DB368 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, _081A466C + ldrb r0, [r1] + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print +_081A465C: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A466C: .4byte 0x0203ab74 +_081A4670: .4byte 0x085ee424 +_081A4674: .4byte 0x0000270f +_081A4678: .4byte 0x02021dc4 +_081A467C: .4byte 0x02021fc4 +_081A4680: .4byte 0x08611d08 + thumb_func_end sub_81A4594 + + thumb_func_start sub_81A4684 +sub_81A4684: @ 81A4684 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + adds r6, r0, 0 + adds r7, r1, 0 + mov r10, r2 + adds r5, r3, 0 + ldr r1, _081A472C + ldrb r0, [r1] + lsls r2, r6, 1 + adds r2, r6 + ldr r1, _081A4730 + adds r2, r1 + lsls r3, r7, 27 + lsrs r3, 24 + mov r12, r3 + lsls r1, r6, 2 + adds r1, r6 + mov r3, r10 + adds r4, r3, r1 + lsls r1, r4, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r3, 0 + mov r8, r3 + str r3, [sp, 0x8] + movs r1, 0x1 + mov r3, r12 + bl Print + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _081A47BC + movs r0, 0xFF + strb r0, [r5, 0x11] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x19] + adds r1, r5, 0 + adds r1, 0xA + ldrb r2, [r5, 0x1A] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, _081A472C + ldrb r0, [r1] + adds r3, r7, 0x2 + lsls r3, 27 + lsrs r3, 24 + subs r1, r4, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r2, r9 + str r2, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + adds r4, r5, 0 + adds r4, 0x12 + adds r0, r4, 0 + bl sub_8009228 + cmp r0, 0 + beq _081A4734 + add r0, sp, 0xC + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81DB5E8 + b _081A473C + .align 2, 0 +_081A472C: .4byte 0x0203ab74 +_081A4730: .4byte 0x085ee424 +_081A4734: + add r0, sp, 0xC + adds r1, r4, 0 + bl gf_strcpy +_081A473C: + ldr r2, _081A47CC + mov r9, r2 + ldrb r0, [r2] + adds r3, r7, 0x4 + lsls r3, 27 + lsrs r3, 24 + lsls r1, r6, 2 + adds r1, r6 + mov r2, r10 + adds r6, r2, r1 + adds r1, r6, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrh r1, [r5, 0x8] + ldr r0, _081A47D0 + cmp r1, r0 + bls _081A4778 + adds r1, r0, 0 +_081A4778: + ldr r0, _081A47D4 + movs r2, 0x1 + movs r3, 0x4 + bl decimal_int_to_string + ldr r5, _081A47D8 + ldr r0, _081A47DC + ldr r4, [r0, 0x24] + adds r0, r5, 0 + adds r1, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl sub_81DB368 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r2, r9 + ldrb r0, [r2] + lsls r1, r6, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print +_081A47BC: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A47CC: .4byte 0x0203ab74 +_081A47D0: .4byte 0x0000270f +_081A47D4: .4byte 0x02021dc4 +_081A47D8: .4byte 0x02021fc4 +_081A47DC: .4byte 0x08611d08 + thumb_func_end sub_81A4684 + + thumb_func_start sub_81A47E0 +sub_81A47E0: @ 81A47E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r9, r0 + mov r10, r1 + str r2, [sp, 0x40] + movs r0, 0xAC + lsls r0, 1 + bl malloc_and_clear + mov r8, r0 + bl sub_80E8260 + add r0, sp, 0x30 + mov r12, r0 + ldr r0, _081A48B0 + ldr r2, [r0] + ldr r3, [sp, 0x40] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 4 + mov r4, r10 + lsls r0, r4, 1 + add r0, r10 + lsls r0, 5 + adds r1, r0 + adds r4, r1, r2 + mov r3, sp + movs r2, 0x2 +_081A4820: + adds r0, r3, 0 + movs r5, 0x87 + lsls r5, 2 + adds r1, r4, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r4, 0x10 + adds r3, 0x10 + subs r2, 0x1 + cmp r2, 0 + bge _081A4820 + ldr r6, [sp, 0x40] + lsls r0, r6, 4 + mov r7, r10 + lsls r1, r7, 5 + adds r0, r1 + mov r1, r12 + add r0, r8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + movs r2, 0 +_081A4852: + movs r1, 0 + movs r4, 0 + movs r3, 0 + lsls r5, r2, 4 + adds r6, r2, 0x1 + mov r2, sp +_081A485E: + ldrh r0, [r2, 0x4] + cmp r0, r1 + ble _081A4868 + adds r4, r3, 0 + adds r1, r0, 0 +_081A4868: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x3 + ble _081A485E + mov r0, sp + ldrh r0, [r0, 0x34] + cmp r0, r1 + blt _081A487A + movs r4, 0x3 +_081A487A: + lsls r0, r4, 4 + mov r7, sp + adds r2, r7, r0 + mov r0, r9 + adds r1, r5, r0 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x4] + adds r2, r6, 0 + cmp r2, 0x2 + ble _081A4852 + mov r0, r8 + bl free + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A48B0: .4byte 0x03005d90 + thumb_func_end sub_81A47E0 + + thumb_func_start sub_81A48B4 +sub_81A48B4: @ 81A48B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x74 + mov r9, r0 + mov r10, r1 + movs r0, 0xAC + lsls r0, 1 + bl malloc_and_clear + mov r8, r0 + bl sub_80E8260 + mov r0, sp + adds r0, 0x54 + str r0, [sp, 0x70] + add r1, sp, 0x5C + mov r12, r1 + ldr r0, _081A4990 + ldr r1, [r0] + movs r0, 0x54 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r3, r0, r1 + mov r2, sp + movs r4, 0x2 +_081A48EE: + adds r0, r2, 0 + ldr r5, _081A4994 + adds r1, r3, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x1C + adds r2, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _081A48EE + mov r6, r10 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + add r0, r8 + ldr r1, [sp, 0x70] + movs r7, 0x90 + lsls r7, 1 + adds r0, r7 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r0] + str r0, [r1] + movs r4, 0 +_081A492A: + movs r1, 0 + movs r5, 0 + movs r3, 0 + lsls r6, r4, 3 + adds r7, r4, 0x1 + mov r2, sp +_081A4936: + ldrh r0, [r2, 0x8] + cmp r0, r1 + ble _081A4940 + adds r5, r3, 0 + adds r1, r0, 0 +_081A4940: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x2 + ble _081A4936 + mov r2, r12 + ldrh r0, [r2] + cmp r0, r1 + blt _081A4952 + movs r5, 0x3 +_081A4952: + subs r1, r6, r4 + lsls r1, 2 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + mov r3, sp + adds r2, r3, r0 + add r1, r9 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x8] + adds r4, r7, 0 + cmp r4, 0x2 + ble _081A492A + mov r0, r8 + bl free + add sp, 0x74 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A4990: .4byte 0x03005d90 +_081A4994: .4byte 0x0000057c + thumb_func_end sub_81A48B4 + + thumb_func_start sub_81A4998 +sub_81A4998: @ 81A4998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x94 + adds r7, r0, 0 + str r1, [sp, 0x90] + ldr r0, _081A4A50 + ldr r4, _081A4A54 + lsls r5, r7, 3 + adds r1, r5, r4 + ldr r1, [r1] + bl gf_strcpy + ldr r6, _081A4A58 + adds r4, 0x4 + adds r5, r4 + ldr r1, [r5] + adds r0, r6, 0 + bl ExpandTextCodes + ldr r0, _081A4A5C + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x1 + mov r10, r1 + str r1, [sp] + movs r2, 0xFF + mov r9, r2 + str r2, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r2, r6, 0 + movs r3, 0 + bl Print + ldr r1, _081A4A60 + ldr r2, [sp, 0x90] + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl sub_81DB368 + adds r3, r0, 0 + mov r1, r8 + ldrb r0, [r1] + lsls r3, 24 + lsrs r3, 24 + mov r2, r10 + str r2, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + cmp r7, 0x9 + bne _081A4A6C + ldr r2, _081A4A64 + ldr r0, [r2] + ldr r1, _081A4A68 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xEF + lsls r2, 4 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add r4, sp, 0x3C + adds r0, r4, 0 + ldr r1, [sp, 0x90] + bl sub_81A48B4 +_081A4A3A: + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4684 + adds r4, 0x1C + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A3A + b _081A4A90 + .align 2, 0 +_081A4A50: .4byte 0x02021cc4 +_081A4A54: .4byte 0x08611cb0 +_081A4A58: .4byte 0x02021fc4 +_081A4A5C: .4byte 0x0203ab74 +_081A4A60: .4byte 0x08611d00 +_081A4A64: .4byte 0x03005d90 +_081A4A68: .4byte 0x00000ee8 +_081A4A6C: + add r0, sp, 0xC + adds r1, r7, 0 + ldr r2, [sp, 0x90] + bl sub_81A47E0 + movs r5, 0 + add r4, sp, 0xC +_081A4A7A: + str r7, [sp] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4594 + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A7A +_081A4A90: + add sp, 0x94 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A4998 + + thumb_func_start sub_81A4AA0 +sub_81A4AA0: @ 81A4AA0 + push {r4,lr} + ldr r4, _081A4ADC + ldr r0, _081A4AE0 + bl Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _081A4AE4 + ldrh r0, [r0] + movs r1, 0 + bl sub_81A4998 + ldrb r0, [r4] + bl Window_WriteStandardTileMap + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A4ADC: .4byte 0x0203ab74 +_081A4AE0: .4byte 0x08611c84 +_081A4AE4: .4byte 0x020375e2 + thumb_func_end sub_81A4AA0 + + thumb_func_start sub_81A4AE8 +sub_81A4AE8: @ 81A4AE8 + push {r4,lr} + ldr r4, _081A4B0C + ldrb r0, [r4] + movs r1, 0x11 + bl Window_FastFillPixels + ldr r0, _081A4B10 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_81A4998 + ldrb r0, [r4] + movs r1, 0x2 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A4B0C: .4byte 0x0203ab74 +_081A4B10: .4byte 0x020375e2 + thumb_func_end sub_81A4AE8 + + thumb_func_start sub_81A4B14 +sub_81A4B14: @ 81A4B14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r1, 0 + ldr r3, _081A4C18 +_081A4B24: + movs r6, 0 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r10, r2 + adds r0, r1 + lsls r0, 5 + mov r8, r0 + movs r7, 0 + movs r0, 0x87 + lsls r0, 2 + add r0, r8 + mov r9, r0 +_081A4B3C: + movs r5, 0 + adds r2, r7, 0 + mov r1, r8 + adds r4, r7, r1 +_081A4B44: + ldr r0, [r3] + add r0, r9 + adds r0, r2 + lsls r1, r5, 4 + adds r0, r1 + movs r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl sub_80842F4 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r0, r4 + ldr r1, _081A4C1C + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r3] + adds r0, r4 + movs r1, 0x88 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x10 + adds r5, 0x1 + ldr r2, [sp] + cmp r5, 0x2 + ble _081A4B44 + adds r7, 0x30 + adds r6, 0x1 + cmp r6, 0x1 + ble _081A4B3C + mov r1, r10 + cmp r1, 0x8 + ble _081A4B24 + movs r6, 0 + ldr r7, _081A4C18 + movs r2, 0x54 + mov r10, r2 + movs r3, 0xFF + mov r9, r3 +_081A4B98: + adds r0, r6, 0x1 + mov r8, r0 + mov r1, r10 + muls r1, r6 + movs r0, 0x54 + adds r4, r6, 0 + muls r4, r0 + movs r2, 0 + ldr r3, _081A4C20 + adds r6, r1, r3 + movs r5, 0x2 +_081A4BAE: + ldr r0, [r7] + adds r0, r6 + adds r0, r2 + movs r1, 0 + str r2, [sp] + bl sub_80842F4 + ldr r0, [r7] + adds r0, r6 + ldr r2, [sp] + adds r0, r2 + adds r0, 0x4 + movs r1, 0 + bl sub_80842F4 + ldr r1, [r7] + adds r1, r4 + ldr r0, _081A4C24 + adds r1, r0 + ldrb r0, [r1] + mov r3, r9 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r7] + adds r1, r4 + ldr r0, _081A4C28 + adds r1, r0 + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + ldr r0, [r7] + adds r0, r4 + ldr r1, _081A4C2C + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x1C + ldr r2, [sp] + adds r2, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _081A4BAE + mov r6, r8 + cmp r6, 0x1 + ble _081A4B98 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A4C18: .4byte 0x03005d90 +_081A4C1C: .4byte 0x00000222 +_081A4C20: .4byte 0x0000057c +_081A4C24: .4byte 0x00000586 +_081A4C28: .4byte 0x0000058e +_081A4C2C: .4byte 0x00000584 + thumb_func_end sub_81A4B14 + + thumb_func_start sub_81A4C30 +sub_81A4C30: @ 81A4C30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x96 + lsls r0, 2 + bl malloc_and_clear + adds r7, r0, 0 + adds r4, r7, 0 + movs r5, 0 + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 + ldr r0, _081A4CA8 + mov r8, r0 +_081A4C4E: + mov r0, r8 + adds r1, r5, r0 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C4E + ldr r4, _081A4CAC + ldrb r5, [r4] + bl copy_player_party_from_sav1 + bl sub_8076D5C + movs r0, 0x1 + bl save_game_when_memory_present + bl sav2_gender2_inplace_and_xFE + strb r5, [r4] + adds r4, r7, 0 + ldr r5, _081A4CA8 + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 +_081A4C84: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C84 + adds r0, r7, 0 + bl free + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A4CA8: .4byte 0x020244ec +_081A4CAC: .4byte 0x020244e9 + thumb_func_end sub_81A4C30 + + thumb_func_start sub_81A4CB0 +sub_81A4CB0: @ 81A4CB0 + push {lr} + ldr r0, _081A4CCC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4CD0 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4CDA + .align 2, 0 +_081A4CCC: .4byte 0x02022fec +_081A4CD0: + ldr r0, _081A4CF4 + bl var_get + lsls r0, 16 + lsrs r0, 16 +_081A4CDA: + ldr r2, _081A4CF8 + ldr r1, _081A4CFC + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + pop {r1} + bx r1 + .align 2, 0 +_081A4CF4: .4byte 0x000040cf +_081A4CF8: .4byte 0x08310030 +_081A4CFC: .4byte 0x08611d30 + thumb_func_end sub_81A4CB0 + + thumb_func_start sub_81A4D00 +sub_81A4D00: @ 81A4D00 + push {lr} + ldr r0, _081A4D1C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D20 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D2A + .align 2, 0 +_081A4D1C: .4byte 0x02022fec +_081A4D20: + ldr r0, _081A4D44 + bl var_get + lsls r0, 16 + lsrs r0, 16 +_081A4D2A: + ldr r2, _081A4D48 + ldr r1, _081A4D4C + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + pop {r1} + bx r1 + .align 2, 0 +_081A4D44: .4byte 0x000040cf +_081A4D48: .4byte 0x08310030 +_081A4D4C: .4byte 0x08611d30 + thumb_func_end sub_81A4D00 + + thumb_func_start sub_81A4D50 +sub_81A4D50: @ 81A4D50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081A4D6C + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D70 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D7A + .align 2, 0 +_081A4D6C: .4byte 0x02022fec +_081A4D70: + ldr r0, _081A4DAC + bl var_get + lsls r0, 16 + lsrs r0, 16 +_081A4D7A: + movs r3, 0 + lsls r0, 1 + ldr r2, _081A4DB0 + ldr r1, _081A4DB4 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x4 + adds r2, r0, r2 +_081A4D90: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x6 + ble _081A4D90 + adds r1, r4, r3 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A4DAC: .4byte 0x000040cf +_081A4DB0: .4byte 0x08310030 +_081A4DB4: .4byte 0x08611d30 + thumb_func_end sub_81A4D50 + + thumb_func_start sub_81A4DB8 +sub_81A4DB8: @ 81A4DB8 + push {lr} + ldr r0, _081A4DD0 + bl var_get + lsls r0, 16 + ldr r1, _081A4DD4 + lsrs r0, 15 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081A4DD0: .4byte 0x000040cf +_081A4DD4: .4byte 0x08611c8c + thumb_func_end sub_81A4DB8 + + thumb_func_start sub_81A4DD8 +sub_81A4DD8: @ 81A4DD8 + push {lr} + ldr r0, _081A4DF8 + bl var_get + lsls r0, 16 + ldr r2, _081A4DFC + ldr r1, _081A4E00 + lsrs r0, 15 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_081A4DF8: .4byte 0x000040cf +_081A4DFC: .4byte 0x00004010 +_081A4E00: .4byte 0x08611c8c + thumb_func_end sub_81A4DD8 + + thumb_func_start sub_81A4E04 +sub_81A4E04: @ 81A4E04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + ldr r0, _081A4E3C + bl var_get + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x20] + bl sub_81A513C + str r0, [sp, 0x24] + ldr r0, [sp, 0x20] + cmp r0, 0x1 + bne _081A4E44 + ldr r0, _081A4E40 + bl sub_81953A0 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FC78 + adds r4, r0, 0 + b _081A4E46 + .align 2, 0 +_081A4E3C: .4byte 0x000040cf +_081A4E40: .4byte 0x000003fe +_081A4E44: + movs r4, 0x7 +_081A4E46: + bl zero_enemy_party_data + movs r1, 0 + str r1, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + movs r2, 0 + str r2, [sp, 0x14] +_081A4E5C: + movs r0, 0x1 + ands r0, r4 + asrs r4, 1 + str r4, [sp, 0x30] + ldr r3, [sp, 0x14] + adds r3, 0x1 + str r3, [sp, 0x28] + cmp r0, 0 + bne _081A4E70 + b _081A4FC4 +_081A4E70: + ldr r4, [sp, 0x14] + lsls r4, 2 + mov r9, r4 + ldr r0, [sp, 0x24] + lsls r0, 4 + str r0, [sp, 0x38] + ldr r1, [sp, 0x20] + lsls r1, 4 + str r1, [sp, 0x34] + ldr r2, [sp, 0x1C] + lsls r2, 24 + str r2, [sp, 0x3C] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x2C] + ldr r0, [sp, 0x14] + add r0, r9 + lsls r0, 2 + mov r8, r0 +_081A4E96: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + ldr r0, _081A4FE0 + adds r1, r7, 0 + bl sub_806EBD0 + lsls r0, 24 + cmp r0, 0 + bne _081A4E96 + ldr r4, [sp, 0x38] + ldr r1, [sp, 0x24] + subs r0, r4, r1 + lsls r5, r0, 2 + mov r2, r8 + adds r4, r2, r5 + ldr r3, [sp, 0x34] + ldr r1, [sp, 0x20] + subs r0, r3, r1 + lsls r6, r0, 3 + adds r4, r6 + ldr r2, _081A4FE4 + adds r4, r2 + adds r0, r7, 0 + bl getNature + ldrb r1, [r4, 0x5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081A4E96 + ldr r4, [sp, 0x18] + movs r0, 0x64 + adds r3, r4, 0 + muls r3, r0 + mov r8, r3 + ldr r1, _081A4FE8 + add r1, r8 + mov r10, r1 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 2 + adds r0, r4, r5 + adds r0, r6 + ldr r2, _081A4FE4 + adds r0, r2 + ldrh r1, [r0] + ldr r3, [sp, 0x3C] + lsrs r2, r3, 24 + ldrb r3, [r0, 0x4] + movs r0, 0x1 + str r0, [sp] + str r7, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, _081A4FE0 + str r0, [sp, 0xC] + mov r0, r10 + bl create_pokemon_set_level + ldr r0, _081A4FE4 + adds r5, r0 + adds r5, r6, r5 + adds r4, r5, r4 + adds r4, 0x2 + mov r0, r10 + movs r1, 0xC + adds r2, r4, 0 + bl pokemon_setattr + movs r7, 0 + mov r6, r8 + ldr r3, _081A4FE8 +_081A4F32: + adds r1, r7, 0 + adds r1, 0x1A + ldr r0, [sp, 0x14] + add r0, r9 + lsls r4, r0, 2 + adds r2, r5, r4 + adds r0, r7, 0x6 + adds r2, r0 + adds r0, r6, r3 + str r3, [sp, 0x40] + bl pokemon_setattr + adds r7, 0x1 + ldr r3, [sp, 0x40] + cmp r7, 0x5 + ble _081A4F32 + movs r1, 0xFF + add r0, sp, 0x10 + strb r1, [r0] + movs r7, 0 + ldr r1, [sp, 0x18] + movs r2, 0x64 + adds r6, r1, 0 + muls r6, r2 + ldr r3, _081A4FEC + mov r8, r3 + ldr r3, _081A4FE8 + adds r5, r4, 0 +_081A4F6A: + ldr r4, [sp, 0x38] + ldr r0, [sp, 0x24] + subs r1, r4, r0 + lsls r1, 2 + adds r1, r5, r1 + ldr r2, [sp, 0x34] + ldr r4, [sp, 0x20] + subs r0, r2, r4 + lsls r0, 3 + adds r1, r0 + add r1, r8 + ldrh r4, [r1] + lsls r2, r7, 24 + lsrs r2, 24 + adds r0, r6, r3 + adds r1, r4, 0 + str r3, [sp, 0x40] + bl sub_80691F4 + ldr r3, [sp, 0x40] + cmp r4, 0xDA + bne _081A4F9C + movs r1, 0 + add r0, sp, 0x10 + strb r1, [r0] +_081A4F9C: + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _081A4F6A + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, _081A4FE8 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp, 0x2C] + str r2, [sp, 0x18] +_081A4FC4: + ldr r4, [sp, 0x30] + ldr r3, [sp, 0x28] + str r3, [sp, 0x14] + cmp r3, 0x2 + bgt _081A4FD0 + b _081A4E5C +_081A4FD0: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A4FE0: .4byte 0x0000ef2a +_081A4FE4: .4byte 0x0861156c +_081A4FE8: .4byte 0x02024744 +_081A4FEC: .4byte 0x08611578 + thumb_func_end sub_81A4E04 + + thumb_func_start sub_81A4FF0 +sub_81A4FF0: @ 81A4FF0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081A5028 + bl var_get + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, _081A502C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrh r0, [r1] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081A5028: .4byte 0x000040cf +_081A502C: .4byte 0x0861156c + thumb_func_end sub_81A4FF0 + + thumb_func_start sub_81A5030 +sub_81A5030: @ 81A5030 + push {lr} + lsls r0, 24 + ldr r2, _081A5050 + ldr r3, _081A5054 + adds r1, r3, 0 + strh r1, [r2] + ldr r2, _081A5058 + ldr r1, _081A505C + lsrs r0, 23 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl var_set + pop {r0} + bx r0 + .align 2, 0 +_081A5050: .4byte 0x02038bca +_081A5054: .4byte 0x000003fe +_081A5058: .4byte 0x00004010 +_081A505C: .4byte 0x08611c8c + thumb_func_end sub_81A5030 + + thumb_func_start sub_81A5060 +sub_81A5060: @ 81A5060 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081A50A8 + bl var_get + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, _081A50AC + lsls r4, 1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0xC + adds r4, r2 + ldrh r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081A50A8: .4byte 0x000040cf +_081A50AC: .4byte 0x0861156c + thumb_func_end sub_81A5060 + + thumb_func_start sub_81A50B0 +sub_81A50B0: @ 81A50B0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081A50E8 + bl var_get + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, _081A50EC + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1, 0x5] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081A50E8: .4byte 0x000040cf +_081A50EC: .4byte 0x0861156c + thumb_func_end sub_81A50B0 + + thumb_func_start sub_81A50F0 +sub_81A50F0: @ 81A50F0 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081A5134 + bl var_get + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, _081A5138 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0x6 + adds r4, r2 + ldrb r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081A5134: .4byte 0x000040cf +_081A5138: .4byte 0x0861156c + thumb_func_end sub_81A50F0 + + thumb_func_start sub_81A513C +sub_81A513C: @ 81A513C + push {r4,r5,lr} + ldr r0, _081A5178 + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A51A0 + bl sub_81A39C4 + lsls r0, 16 + ldr r3, _081A517C + lsls r2, r5, 2 + adds r1, r3, 0x3 + adds r1, r2, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r1, r0, r1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081A5180 + movs r4, 0 + b _081A51A0 + .align 2, 0 +_081A5178: .4byte 0x000040cf +_081A517C: .4byte 0x08611550 +_081A5180: + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r1, r0 + beq _081A519E + cmp r1, r0 + ble _081A51A0 + subs r0, r1, r0 + adds r1, r3, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A51A0 +_081A519E: + movs r4, 0x1 +_081A51A0: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A513C + + thumb_func_start sub_81A51A8 +sub_81A51A8: @ 81A51A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081A51D0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A51D4 + bl sub_8185EA0 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8185EAC + lsls r0, 24 + lsrs r1, r0, 24 + b _081A51E4 + .align 2, 0 +_081A51D0: .4byte 0x02022fec +_081A51D4: + ldr r0, _081A51F0 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_81A513C + adds r1, r0, 0 +_081A51E4: + cmp r5, 0 + beq _081A51F4 + cmp r5, 0x1 + beq _081A5214 + b _081A5228 + .align 2, 0 +_081A51F0: .4byte 0x000040cf +_081A51F4: + ldr r0, _081A520C + ldr r2, _081A5210 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + b _081A5228 + .align 2, 0 +_081A520C: .4byte 0x02021fc4 +_081A5210: .4byte 0x08611db0 +_081A5214: + ldr r0, _081A5230 + ldr r2, _081A5234 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy +_081A5228: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A5230: .4byte 0x02021fc4 +_081A5234: .4byte 0x08611db8 + thumb_func_end sub_81A51A8 + + thumb_func_start sub_81A5238 +sub_81A5238: @ 81A5238 + push {lr} + ldr r1, _081A5250 + ldr r0, _081A5254 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081A5250: .4byte 0x08611f84 +_081A5254: .4byte 0x020375e0 + thumb_func_end sub_81A5238 + + thumb_func_start sub_81A5258 +sub_81A5258: @ 81A5258 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0xA + bls _081A5268 + b _081A5544 +_081A5268: + lsls r0, 2 + ldr r1, _081A5274 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A5274: .4byte _081A5278 + .align 2, 0 +_081A5278: + .4byte _081A52A4 + .4byte _081A52F4 + .4byte _081A531C + .4byte _081A53B4 + .4byte _081A540C + .4byte _081A542C + .4byte _081A544C + .4byte _081A5490 + .4byte _081A553E + .4byte _081A54D4 + .4byte _081A5520 +_081A52A4: + ldr r0, _081A52DC + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl sub_80A1AD4 + ldr r1, _081A52E0 + movs r0, 0x48 + bl lcd_io_set + ldr r0, _081A52E4 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081A52E8 + movs r1, 0xF8 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + ldr r1, _081A52EC + movs r0, 0xFF + strh r0, [r1] + ldr r1, _081A52F0 + movs r0, 0x70 + strh r0, [r1] + b _081A553E + .align 2, 0 +_081A52DC: .4byte 0x7fffff1c +_081A52E0: .4byte 0x00003f3e +_081A52E4: .4byte 0x08611f74 +_081A52E8: .4byte 0x08d855e8 +_081A52EC: .4byte 0x02022e24 +_081A52F0: .4byte 0x02022e26 +_081A52F4: + ldr r0, _081A5318 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081A5306 + b _081A5544 +_081A5306: + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + b _081A553E + .align 2, 0 +_081A5318: .4byte 0x02037fd4 +_081A531C: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + beq _081A5328 + b _081A5544 +_081A5328: + ldr r1, _081A538C + movs r2, 0xA1 + strb r2, [r1] + movs r0, 0xFF + strb r0, [r1, 0x1] + ldr r1, _081A5390 + strb r2, [r1] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x1] + ldr r0, _081A5394 + bl sub_814E6F0 + ldr r4, _081A5398 + adds r0, r4, 0 + movs r1, 0xF + bl battle_show_message_maybe + ldr r0, _081A539C + movs r1, 0x10 + bl battle_show_message_maybe + ldr r0, _081A53A0 + bl sub_814E6F0 + adds r0, r4, 0 + movs r1, 0x11 + bl battle_show_message_maybe + ldr r0, _081A53A4 + movs r1, 0x12 + bl battle_show_message_maybe + ldr r0, _081A53A8 + movs r1, 0x13 + bl battle_show_message_maybe + ldr r0, _081A53AC + movs r1, 0x14 + bl battle_show_message_maybe + ldr r0, _081A53B0 + bl sub_814E6F0 + adds r0, r4, 0 + movs r1, 0x15 + bl battle_show_message_maybe + b _081A553E + .align 2, 0 +_081A538C: .4byte 0x02022f58 +_081A5390: .4byte 0x02022f68 +_081A5394: .4byte 0x085ccdb2 +_081A5398: .4byte 0x02022e2c +_081A539C: .4byte 0x085ccdb5 +_081A53A0: .4byte 0x085ccdb8 +_081A53A4: .4byte 0x085ccdbb +_081A53A8: .4byte 0x085ccdc0 +_081A53AC: .4byte 0x085ccdc6 +_081A53B0: .4byte 0x085ccdcb +_081A53B4: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + beq _081A53C0 + b _081A5544 +_081A53C0: + ldr r1, _081A5400 + movs r0, 0x48 + bl lcd_io_set + movs r6, 0x80 + lsls r6, 15 + movs r4, 0x7 +_081A53CE: + asrs r1, r6, 16 + ldr r0, _081A5404 + movs r2, 0x54 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081A5408 + adds r0, r1 + movs r1, 0x3 + bl obj_anim_image_start + movs r0, 0x80 + lsls r0, 13 + adds r6, r0 + subs r4, 0x1 + cmp r4, 0 + bge _081A53CE + b _081A553C + .align 2, 0 +_081A5400: .4byte 0x00003f3f +_081A5404: .4byte 0x08611f5c +_081A5408: .4byte 0x02020630 +_081A540C: + ldr r0, _081A5428 + bl audio_play + movs r0, 0x50 + movs r1, 0x28 + movs r2, 0 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x28 + movs r2, 0 + b _081A5464 + .align 2, 0 +_081A5428: .4byte 0x00000109 +_081A542C: + ldr r0, _081A5448 + bl audio_play + movs r0, 0x50 + movs r1, 0x38 + movs r2, 0x1 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x38 + movs r2, 0x1 + b _081A5464 + .align 2, 0 +_081A5448: .4byte 0x00000109 +_081A544C: + ldr r0, _081A5484 + bl audio_play + movs r0, 0x50 + movs r1, 0x48 + movs r2, 0x2 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x48 + movs r2, 0x2 +_081A5464: + movs r3, 0x1 + bl sub_81A5558 + ldr r0, _081A5488 + bl sub_814E6F0 + ldr r0, _081A548C + movs r1, 0x15 + bl battle_show_message_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + movs r6, 0x1 + b _081A5544 + .align 2, 0 +_081A5484: .4byte 0x00000109 +_081A5488: .4byte 0x085ccdcb +_081A548C: .4byte 0x02022e2c +_081A5490: + movs r0, 0x85 + lsls r0, 1 + bl audio_play + ldr r0, _081A54B0 + ldr r1, _081A54B4 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bls _081A54BC + movs r6, 0x2 + ldr r1, _081A54B8 + movs r0, 0 + strb r0, [r1, 0x17] + b _081A553E + .align 2, 0 +_081A54B0: .4byte 0x02022f58 +_081A54B4: .4byte 0x02022f68 +_081A54B8: .4byte 0x02024474 +_081A54BC: + cmp r2, r0 + bcs _081A54D0 + movs r6, 0x3 + ldr r1, _081A54CC + movs r0, 0x1 + strb r0, [r1, 0x17] + b _081A553E + .align 2, 0 +_081A54CC: .4byte 0x02024474 +_081A54D0: + movs r6, 0x4 + b _081A553E +_081A54D4: + ldr r1, _081A5510 + movs r0, 0x48 + bl lcd_io_set + movs r0, 0x1 + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _081A5514 + ldr r1, _081A5518 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, _081A551C + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl sub_80A1AD4 + b _081A553E + .align 2, 0 +_081A5510: .4byte 0x00003f3e +_081A5514: .4byte 0x03007420 +_081A5518: .4byte 0x0000ffff +_081A551C: .4byte 0x7fffff1c +_081A5520: + ldr r0, _081A5550 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A5544 + ldr r1, _081A5554 + movs r0, 0x48 + bl lcd_io_set + movs r0, 0xFA + lsls r0, 2 + bl gpu_tile_obj_free_by_tag +_081A553C: + movs r6, 0x1 +_081A553E: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_081A5544: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081A5550: .4byte 0x02037fd4 +_081A5554: .4byte 0x00003f3f + thumb_func_end sub_81A5258 + + thumb_func_start sub_81A5558 +sub_81A5558: @ 81A5558 + 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] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r6, 0 + movs r1, 0 + ldr r0, _081A55A0 + ldr r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + adds r4, r0, r3 + ldr r5, _081A55A4 + adds r3, r0, r5 + adds r5, 0x2 + adds r5, r0 + mov r8, r5 + cmp r2, 0x1 + beq _081A55C4 + cmp r2, 0x1 + bgt _081A55A8 + cmp r2, 0 + beq _081A55B0 + b _081A5612 + .align 2, 0 +_081A55A0: .4byte 0x0202449c +_081A55A4: .4byte 0x0000029a +_081A55A8: + mov r0, r9 + cmp r0, 0x2 + beq _081A55D8 + b _081A5612 +_081A55B0: + adds r0, r4, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r4, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55C4: + adds r0, r3, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r3, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55D8: + ldr r3, _081A5620 + mov r9, r3 + movs r5, 0x58 + adds r0, r7, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + movs r4, 0x64 + muls r0, r4 + lsls r1, r7, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r6, r0, 0 + movs r0, 0x1 + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + muls r0, r4 + lsls r1, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r1, r0, 0 +_081A5612: + cmp r6, r1 + ble _081A5638 + movs r4, 0x2 + cmp r7, 0 + beq _081A5628 + ldr r1, _081A5624 + b _081A562A + .align 2, 0 +_081A5620: .4byte 0x02024084 +_081A5624: .4byte 0x02022f68 +_081A5628: + ldr r1, _081A5634 +_081A562A: + ldrb r0, [r1] + adds r0, 0x2 + strb r0, [r1] + b _081A565E + .align 2, 0 +_081A5634: .4byte 0x02022f58 +_081A5638: + cmp r6, r1 + bne _081A565C + movs r4, 0x1 + cmp r7, 0 + beq _081A564C + ldr r1, _081A5648 + b _081A564E + .align 2, 0 +_081A5648: .4byte 0x02022f68 +_081A564C: + ldr r1, _081A5658 +_081A564E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081A565E + .align 2, 0 +_081A5658: .4byte 0x02022f58 +_081A565C: + movs r4, 0 +_081A565E: + ldr r0, _081A5690 + ldr r1, [sp] + mov r2, r10 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, _081A5694 + adds r0, r1 + adds r1, r4, 0 + bl obj_anim_image_start + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A5690: .4byte 0x08611f5c +_081A5694: .4byte 0x02020630 + thumb_func_end sub_81A5558 + + thumb_func_start sub_81A5698 +sub_81A5698: @ 81A5698 + push {lr} + adds r1, r0, 0 + ldr r0, _081A56B0 + ldrb r0, [r0] + cmp r0, 0x8 + bls _081A56AA + adds r0, r1, 0 + bl obj_delete_and_free_tiles +_081A56AA: + pop {r0} + bx r0 + .align 2, 0 +_081A56B0: .4byte 0x02024332 + thumb_func_end sub_81A5698 + + thumb_func_start sub_81A56B4 +sub_81A56B4: @ 81A56B4 + ldr r0, _081A56E0 + ldr r2, [r0] + movs r0, 0xA6 + lsls r0, 2 + adds r1, r2, r0 + adds r0, 0x2 + adds r3, r2, r0 + adds r0, 0x2 + adds r2, r0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + strb r0, [r3] + strb r0, [r3, 0x1] + ldr r0, _081A56E4 + ldrh r1, [r0, 0x28] + strh r1, [r2] + adds r0, 0x80 + ldrh r0, [r0] + strh r0, [r2, 0x2] + bx lr + .align 2, 0 +_081A56E0: .4byte 0x0202449c +_081A56E4: .4byte 0x02024084 + thumb_func_end sub_81A56B4 + + thumb_func_start sub_81A56E8 +sub_81A56E8: @ 81A56E8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081A570C + ldr r1, [r1] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + adds r1, r0 + ldr r2, _081A5710 + ldr r0, _081A5714 + ldrh r0, [r0] + adds r0, r2 + ldrb r0, [r0] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_081A570C: .4byte 0x0202449c +_081A5710: .4byte 0x08611dc0 +_081A5714: .4byte 0x020241ea + thumb_func_end sub_81A56E8 + + thumb_func_start sub_81A5718 +sub_81A5718: @ 81A5718 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + ldr r0, _081A5758 + ldr r2, [r0] + ldr r0, _081A575C + adds r5, r2, r0 + ldr r0, _081A5760 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _081A57DA + ldr r0, _081A5764 + adds r4, r2, r0 + ldrb r2, [r4] + ldr r0, _081A5768 + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081A576C + bics r2, r1 + strb r2, [r4] + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .align 2, 0 +_081A5758: .4byte 0x0202449c +_081A575C: .4byte 0x0000029a +_081A5760: .4byte 0x02024280 +_081A5764: .4byte 0x000002a2 +_081A5768: .4byte 0x0832a328 +_081A576C: + ldr r0, _081A5790 + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _081A5798 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A5788 + ldr r0, _081A5794 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _081A57DA +_081A5788: + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .align 2, 0 +_081A5790: .4byte 0x0202427c +_081A5794: .4byte 0x02024332 +_081A5798: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0x6 + bne _081A57A4 + adds r1, r5, r3 + b _081A57D4 +_081A57A4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A57B4 + adds r1, r5, r3 + ldrb r0, [r1] + adds r0, 0x2 + b _081A57D8 +_081A57B4: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081A57C4 + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _081A57D8 +_081A57C4: + ldr r0, _081A57E0 + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + bne _081A57DA + adds r1, r5, r6 +_081A57D4: + ldrb r0, [r1] + adds r0, 0x1 +_081A57D8: + strb r0, [r1] +_081A57DA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A57E0: .4byte 0x0202433c + thumb_func_end sub_81A5718 + + thumb_func_start sub_81A57E4 +sub_81A57E4: @ 81A57E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r2, r1, 0 + ldr r0, _081A5814 + ldr r0, [r0] + ldr r5, _081A5818 + adds r3, r0, r5 + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + bgt _081A582A + subs r0, 0x1 + cmp r1, r0 + bge _081A585C + cmp r1, 0xC5 + bgt _081A581C + cmp r1, 0xC3 + bge _081A585C + cmp r1, 0x77 + beq _081A585C + b _081A5864 + .align 2, 0 +_081A5814: .4byte 0x0202449c +_081A5818: .4byte 0x0000029a +_081A581C: + cmp r1, 0xC7 + blt _081A5864 + cmp r1, 0xCC + ble _081A585C + cmp r1, 0xCE + beq _081A585C + b _081A5864 +_081A582A: + ldr r0, _081A5844 + cmp r1, r0 + beq _081A585C + cmp r1, r0 + bgt _081A5848 + subs r0, 0x12 + cmp r1, r0 + beq _081A585C + adds r0, 0x2 + cmp r1, r0 + beq _081A585C + b _081A5864 + .align 2, 0 +_081A5844: .4byte 0x00000147 +_081A5848: + movs r0, 0xAD + lsls r0, 1 + cmp r2, r0 + blt _081A5864 + adds r0, 0x1 + cmp r2, r0 + ble _081A585C + adds r0, 0x3 + cmp r2, r0 + bne _081A5864 +_081A585C: + adds r1, r3, r4 + ldrb r0, [r1] + subs r0, 0x3 + strb r0, [r1] +_081A5864: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81A57E4 + + thumb_func_start sub_81A586C +sub_81A586C: @ 81A586C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081A58AC + ldr r3, [r1] + movs r1, 0xA7 + lsls r1, 2 + adds r3, r1 + lsls r2, r0, 1 + adds r2, r3 + ldr r5, _081A58B0 + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r1, r5 + ldrh r1, [r1, 0x28] + strh r1, [r2] + movs r1, 0x1 + eors r0, r1 + lsls r1, r0, 1 + adds r1, r3 + muls r0, r4 + adds r0, r5 + ldrh r2, [r0, 0x28] + ldrh r0, [r1] + cmp r0, r2 + bls _081A58A4 + strh r2, [r1] +_081A58A4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A58AC: .4byte 0x0202449c +_081A58B0: .4byte 0x02024084 + thumb_func_end sub_81A586C + + thumb_func_start sub_81A58B4 +sub_81A58B4: @ 81A58B4 + push {r4-r6,lr} + ldr r4, _081A5900 + ldr r1, [r4] + ldr r3, _081A5904 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _081A5908 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r4] + ldr r6, _081A590C + adds r0, r1, r6 + strh r2, [r0] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A5914 + ldr r0, [r4] + ldr r1, _081A5910 + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + b _081A591E + .align 2, 0 +_081A5900: .4byte 0x03005d90 +_081A5904: .4byte 0x00000ca9 +_081A5908: .4byte 0x00000ca8 +_081A590C: .4byte 0x00000cb2 +_081A5910: .4byte 0x00000cdc +_081A5914: + ldr r0, [r4] + ldr r3, _081A5954 + adds r0, r3 + ldr r2, [r0] + movs r0, 0x40 +_081A591E: + ands r2, r0 + cmp r2, 0 + bne _081A5930 + ldr r0, [r4] + lsls r1, r5, 1 + ldr r6, _081A5958 + adds r0, r6 + adds r0, r1 + strh r2, [r0] +_081A5930: + ldr r0, _081A595C + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, _081A5960 + movs r0, 0 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A5954: .4byte 0x00000cdc +_081A5958: .4byte 0x00000dda +_081A595C: .4byte 0x03005d8c +_081A5960: .4byte 0x02038bca + thumb_func_end sub_81A58B4 + + thumb_func_start sub_81A5964 +sub_81A5964: @ 81A5964 + push {r4,lr} + ldr r0, _081A5988 + ldr r3, [r0] + ldr r1, _081A598C + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, _081A5990 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A59B0 + cmp r0, 0x1 + bgt _081A5994 + cmp r0, 0 + beq _081A599A + b _081A59EE + .align 2, 0 +_081A5988: .4byte 0x03005d90 +_081A598C: .4byte 0x00000ca9 +_081A5990: .4byte 0x020375e2 +_081A5994: + cmp r0, 0x2 + beq _081A59C8 + b _081A59EE +_081A599A: + ldr r0, _081A59A8 + ldr r2, _081A59AC + adds r1, r3, r2 + ldrh r1, [r1] + strh r1, [r0] + b _081A59EE + .align 2, 0 +_081A59A8: .4byte 0x020375f0 +_081A59AC: .4byte 0x00000dd8 +_081A59B0: + ldr r2, _081A59C0 + lsls r1, 1 + ldr r4, _081A59C4 + adds r0, r3, r4 + adds r0, r1 + ldrh r0, [r0] + b _081A59EC + .align 2, 0 +_081A59C0: .4byte 0x020375f0 +_081A59C4: .4byte 0x00000dda +_081A59C8: + cmp r1, 0 + beq _081A59E0 + ldr r2, _081A59D8 + ldr r1, _081A59DC + adds r0, r3, r1 + ldr r0, [r0] + movs r1, 0x80 + b _081A59EA + .align 2, 0 +_081A59D8: .4byte 0x020375f0 +_081A59DC: .4byte 0x00000cdc +_081A59E0: + ldr r2, _081A59F4 + ldr r4, _081A59F8 + adds r0, r3, r4 + ldr r0, [r0] + movs r1, 0x40 +_081A59EA: + ands r0, r1 +_081A59EC: + strh r0, [r2] +_081A59EE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A59F4: .4byte 0x020375f0 +_081A59F8: .4byte 0x00000cdc + thumb_func_end sub_81A5964 + + thumb_func_start sub_81A59FC +sub_81A59FC: @ 81A59FC + push {lr} + ldr r0, _081A5A20 + ldr r2, [r0] + ldr r1, _081A5A24 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, _081A5A28 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A5A48 + cmp r0, 0x1 + bgt _081A5A2C + cmp r0, 0 + beq _081A5A32 + b _081A5ABA + .align 2, 0 +_081A5A20: .4byte 0x03005d90 +_081A5A24: .4byte 0x00000ca9 +_081A5A28: .4byte 0x020375e2 +_081A5A2C: + cmp r0, 0x2 + beq _081A5A60 + b _081A5ABA +_081A5A32: + ldr r0, _081A5A40 + ldrh r1, [r0] + ldr r3, _081A5A44 + adds r0, r2, r3 + strh r1, [r0] + b _081A5ABA + .align 2, 0 +_081A5A40: .4byte 0x020375e4 +_081A5A44: .4byte 0x00000dd8 +_081A5A48: + lsls r1, 1 + ldr r3, _081A5A58 + adds r0, r2, r3 + adds r0, r1 + ldr r1, _081A5A5C + ldrh r1, [r1] + strh r1, [r0] + b _081A5ABA + .align 2, 0 +_081A5A58: .4byte 0x00000dda +_081A5A5C: .4byte 0x020375e4 +_081A5A60: + cmp r1, 0 + beq _081A5A90 + ldr r0, _081A5A78 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5A80 + ldr r1, _081A5A7C + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + orrs r1, r2 + b _081A5AB8 + .align 2, 0 +_081A5A78: .4byte 0x020375e4 +_081A5A7C: .4byte 0x00000cdc +_081A5A80: + ldr r3, _081A5A8C + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x81 + negs r2, r2 + b _081A5AB6 + .align 2, 0 +_081A5A8C: .4byte 0x00000cdc +_081A5A90: + ldr r0, _081A5AA4 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5AAC + ldr r1, _081A5AA8 + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x40 + orrs r1, r2 + b _081A5AB8 + .align 2, 0 +_081A5AA4: .4byte 0x020375e4 +_081A5AA8: .4byte 0x00000cdc +_081A5AAC: + ldr r3, _081A5AC0 + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x41 + negs r2, r2 +_081A5AB6: + ands r1, r2 +_081A5AB8: + str r1, [r0] +_081A5ABA: + pop {r0} + bx r0 + .align 2, 0 +_081A5AC0: .4byte 0x00000cdc + thumb_func_end sub_81A59FC + + thumb_func_start sub_81A5AC4 +sub_81A5AC4: @ 81A5AC4 + push {r4,lr} + ldr r4, _081A5AF8 + ldr r0, [r4] + ldr r1, _081A5AFC + ldrh r1, [r1] + ldr r2, _081A5B00 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081A5B04 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A5AF8: .4byte 0x03005d90 +_081A5AFC: .4byte 0x020375e2 +_081A5B00: .4byte 0x00000ca8 +_081A5B04: .4byte 0x00000ca9 + thumb_func_end sub_81A5AC4 + + thumb_func_start sub_81A5B08 +sub_81A5B08: @ 81A5B08 + push {r4,r5,lr} + ldr r4, _081A5B44 + ldr r1, [r4] + ldr r2, _081A5B48 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, _081A5B4C + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A5B58 + bl GenerateRandomNumber + ldr r4, [r4] + ldr r5, _081A5B50 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, _081A5B54 + adds r4, r1 + b _081A5B76 + .align 2, 0 +_081A5B44: .4byte 0x03005d90 +_081A5B48: .4byte 0x00000ca9 +_081A5B4C: .4byte 0x00000dda +_081A5B50: .4byte 0x08611fac +_081A5B54: .4byte 0x00000dd8 +_081A5B58: + bl GenerateRandomNumber + ldr r4, [r4] + ldr r5, _081A5B80 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, _081A5B84 + adds r4, r2 +_081A5B76: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A5B80: .4byte 0x08611fa0 +_081A5B84: .4byte 0x00000dd8 + thumb_func_end sub_81A5B08 + + thumb_func_start sub_81A5B88 +sub_81A5B88: @ 81A5B88 + push {r4,r5,lr} + ldr r4, _081A5BC0 + ldr r0, [r4] + ldr r1, _081A5BC4 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A5BD0 + ldr r0, [r4] + ldr r1, _081A5BC4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _081A5BC8 + bl itemid_get_name + ldr r0, [r4] + ldr r1, _081A5BC4 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, _081A5BCC + strh r5, [r0] + b _081A5BD6 + .align 2, 0 +_081A5BC0: .4byte 0x03005d90 +_081A5BC4: .4byte 0x00000dd8 +_081A5BC8: .4byte 0x02021cc4 +_081A5BCC: .4byte 0x020375f0 +_081A5BD0: + ldr r1, _081A5BDC + movs r0, 0 + strh r0, [r1] +_081A5BD6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A5BDC: .4byte 0x020375f0 + thumb_func_end sub_81A5B88 + + thumb_func_start sub_81A5BE0 +sub_81A5BE0: @ 81A5BE0 + push {lr} + ldr r0, _081A5BF0 + ldr r1, _081A5BF4 + ldrh r1, [r1] + bl sub_8162E20 + pop {r0} + bx r0 + .align 2, 0 +_081A5BF0: .4byte 0x02021cc4 +_081A5BF4: .4byte 0x02038bca + thumb_func_end sub_81A5BE0 + + thumb_func_start sub_81A5BF8 +sub_81A5BF8: @ 81A5BF8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r0, 0x1B + mov r8, r0 + movs r5, 0x7 + movs r4, 0x1 + str r4, [sp] + movs r6, 0x6 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xFE + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x20 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x31 + movs r2, 0 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x33 + movs r2, 0x1 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x34 + movs r2, 0x2 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1C + mov r8, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x35 + movs r2, 0x1C + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x36 + movs r2, 0x1D + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + movs r6, 0x5 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x37 + movs r2, 0 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x39 + movs r2, 0x1 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3A + movs r2, 0x1D + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081A5D30 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081A5D34 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081A5D38 + movs r0, 0x1A + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x2 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081A5D3C + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1C + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + ldr r1, _081A5D40 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1D + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A5D30: .4byte 0x00000831 +_081A5D34: .4byte 0x00000833 +_081A5D38: .4byte 0x00000834 +_081A5D3C: .4byte 0x00000835 +_081A5D40: .4byte 0x00000836 + thumb_func_end sub_81A5BF8 + + thumb_func_start sub_81A5D44 +sub_81A5D44: @ 81A5D44 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r5, 0 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r6, 0x4 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1B + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x5 + movs r2, 0x2 + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x6 + movs r2, 0x1C + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0xE + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x9 + movs r2, 0x1 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xA + movs r2, 0x2 + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xB + movs r2, 0x1C + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xC + movs r2, 0x1D + movs r3, 0xF + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xD + movs r2, 0 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xE + movs r2, 0x1 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xF + movs r2, 0x2 + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1C + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x11 + movs r2, 0x1D + movs r3, 0x13 + bl Bg_FillWramTileMapRectWithTileAndPalette + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A5D44 + + thumb_func_start sub_81A5E74 +sub_81A5E74: @ 81A5E74 + push {lr} + ldr r1, _081A5E8C + ldr r0, _081A5E90 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081A5E8C: .4byte 0x08612120 +_081A5E90: .4byte 0x020375e0 + thumb_func_end sub_81A5E74 + + thumb_func_start sub_81A5E94 +sub_81A5E94: @ 81A5E94 + push {r4-r7,lr} + ldr r5, _081A5F74 + ldr r0, [r5] + ldr r4, _081A5F78 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, _081A5F7C + bl var_get + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r5] + ldr r1, _081A5F80 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, [r5] + ldr r3, _081A5F84 + adds r0, r1, r3 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r5] + ldr r0, _081A5F88 + adds r3, r4, r0 + ldr r2, _081A5F8C + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r2 + ldr r3, [r3] + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + bne _081A5F0A + lsls r1, r7, 1 + lsls r0, r6, 2 + adds r1, r0 + ldr r2, _081A5F90 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] + adds r2, 0x10 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] +_081A5F0A: + ldr r1, _081A5F94 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + ldr r6, _081A5F98 + movs r4, 0xE7 + lsls r4, 4 + ldr r0, _081A5F9C + adds r3, r0, 0 +_081A5F1C: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081A5F1C + movs r2, 0 + ldr r4, _081A5FA0 + ldr r1, _081A5F9C + adds r3, r1, 0 +_081A5F40: + lsls r0, r2, 1 + adds r0, r4 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081A5F40 + ldr r0, [r6] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, _081A5FA4 + movs r0, 0 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A5F74: .4byte 0x03005d90 +_081A5F78: .4byte 0x00000ca9 +_081A5F7C: .4byte 0x000040ce +_081A5F80: .4byte 0x00000ca8 +_081A5F84: .4byte 0x00000cb2 +_081A5F88: .4byte 0x00000cdc +_081A5F8C: .4byte 0x08612164 +_081A5F90: .4byte 0x00000de2 +_081A5F94: .4byte 0x03001288 +_081A5F98: .4byte 0x03005d8c +_081A5F9C: .4byte 0x0000ffff +_081A5FA0: .4byte 0x03006298 +_081A5FA4: .4byte 0x02038bca + thumb_func_end sub_81A5E94 + + thumb_func_start sub_81A5FA8 +sub_81A5FA8: @ 81A5FA8 + push {r4-r7,lr} + ldr r7, _081A5FD4 + ldr r0, [r7] + ldr r1, _081A5FD8 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, _081A5FDC + bl var_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _081A5FE0 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A6000 + cmp r0, 0x2 + bgt _081A5FE4 + cmp r0, 0x1 + beq _081A5FEA + b _081A6044 + .align 2, 0 +_081A5FD4: .4byte 0x03005d90 +_081A5FD8: .4byte 0x00000ca9 +_081A5FDC: .4byte 0x000040ce +_081A5FE0: .4byte 0x020375e2 +_081A5FE4: + cmp r0, 0x3 + beq _081A6030 + b _081A6044 +_081A5FEA: + ldr r3, _081A5FF8 + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, _081A5FFC + b _081A603C + .align 2, 0 +_081A5FF8: .4byte 0x020375f0 +_081A5FFC: .4byte 0x00000de2 +_081A6000: + ldr r4, _081A6024 + ldr r2, [r7] + ldr r0, _081A6028 + adds r2, r0 + ldr r3, _081A602C + lsls r0, r6, 2 + lsls r1, r5, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _081A6044 + .align 2, 0 +_081A6024: .4byte 0x020375f0 +_081A6028: .4byte 0x00000cdc +_081A602C: .4byte 0x08612164 +_081A6030: + ldr r3, _081A604C + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, _081A6050 +_081A603C: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] +_081A6044: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A604C: .4byte 0x020375f0 +_081A6050: .4byte 0x00000df2 + thumb_func_end sub_81A5FA8 + + thumb_func_start sub_81A6054 +sub_81A6054: @ 81A6054 + push {r4-r6,lr} + ldr r6, _081A6080 + ldr r0, [r6] + ldr r1, _081A6084 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _081A6088 + bl var_get + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _081A608C + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A60B4 + cmp r0, 0x2 + bgt _081A6090 + cmp r0, 0x1 + beq _081A6096 + b _081A6128 + .align 2, 0 +_081A6080: .4byte 0x03005d90 +_081A6084: .4byte 0x00000ca9 +_081A6088: .4byte 0x000040ce +_081A608C: .4byte 0x020375e2 +_081A6090: + cmp r0, 0x3 + beq _081A6108 + b _081A6128 +_081A6096: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, _081A60AC + adds r2, r1 + adds r2, r0 + ldr r0, _081A60B0 + ldrh r0, [r0] + strh r0, [r2] + b _081A6128 + .align 2, 0 +_081A60AC: .4byte 0x00000de2 +_081A60B0: .4byte 0x020375e4 +_081A60B4: + ldr r0, _081A60D8 + ldrh r0, [r0] + cmp r0, 0 + beq _081A60E4 + ldr r2, [r6] + ldr r0, _081A60DC + adds r2, r0 + ldr r3, _081A60E0 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _081A6128 + .align 2, 0 +_081A60D8: .4byte 0x020375e4 +_081A60DC: .4byte 0x00000cdc +_081A60E0: .4byte 0x08612164 +_081A60E4: + ldr r2, [r6] + ldr r1, _081A6100 + adds r2, r1 + ldr r3, _081A6104 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _081A6128 + .align 2, 0 +_081A6100: .4byte 0x00000cdc +_081A6104: .4byte 0x08612174 +_081A6108: + ldr r3, _081A6130 + ldrb r0, [r3] + cmp r0, 0x1 + bne _081A6128 + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, _081A6134 + adds r2, r1 + adds r2, r0 + ldr r0, _081A6138 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + strb r1, [r3] +_081A6128: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A6130: .4byte 0x03001288 +_081A6134: .4byte 0x00000df2 +_081A6138: .4byte 0x020375e4 + thumb_func_end sub_81A6054 + + thumb_func_start sub_81A613C +sub_81A613C: @ 81A613C + push {r4,lr} + ldr r4, _081A6170 + ldr r0, [r4] + ldr r1, _081A6174 + ldrh r1, [r1] + ldr r2, _081A6178 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081A617C + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A6170: .4byte 0x03005d90 +_081A6174: .4byte 0x020375e2 +_081A6178: .4byte 0x00000ca8 +_081A617C: .4byte 0x00000ca9 + thumb_func_end sub_81A613C + + thumb_func_start nullsub_75 +nullsub_75: @ 81A6180 + bx lr + thumb_func_end nullsub_75 + + thumb_func_start nullsub_123 +nullsub_123: @ 81A6184 + bx lr + thumb_func_end nullsub_123 + + thumb_func_start sub_81A6188 +sub_81A6188: @ 81A6188 + push {lr} + bl zero_player_party_data + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81A6188 + + thumb_func_start sub_81A6198 +sub_81A6198: @ 81A6198 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81A6198 + + thumb_func_start sub_81A61A4 +sub_81A61A4: @ 81A61A4 + ldr r1, _081A61AC + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_081A61AC: .4byte 0x03001288 + thumb_func_end sub_81A61A4 + + thumb_func_start sub_81A61B0 +sub_81A61B0: @ 81A61B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, _081A6384 + ldr r0, [r4] + ldr r1, _081A6388 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x10] + ldr r0, _081A638C + bl var_get + lsls r0, 16 + ldr r1, [r4] + ldr r3, [sp, 0x10] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + ldr r6, _081A6390 + adds r1, r6 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + ldr r2, _081A6394 + ldr r1, _081A6398 + str r1, [r2] + ldr r5, _081A639C + lsls r0, 24 + str r0, [sp, 0x20] + mov r8, r0 +_081A61FA: + ldr r0, [r4] + adds r0, r5 + ldrb r1, [r0] + mov r2, r8 + lsrs r0, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r7, 0 + ldr r1, [r4] + adds r0, r1, r5 + ldr r6, [sp, 0x10] + lsls r6, 24 + str r6, [sp, 0x1C] + ldrh r0, [r0] + cmp r7, r0 + bge _081A6244 + ldr r2, _081A63A0 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r6, _081A6384 + cmp r0, r3 + beq _081A6244 + ldr r1, [r6] + ldr r6, _081A639C + adds r0, r1, r6 + ldrh r2, [r0] + ldr r0, _081A63A0 + adds r1, r0 +_081A6236: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, r2 + bge _081A6244 + ldrh r0, [r1] + cmp r0, r3 + bne _081A6236 +_081A6244: + ldr r0, [r4] + ldr r1, _081A639C + adds r0, r1 + ldr r6, _081A6384 + ldrh r0, [r0] + cmp r7, r0 + bne _081A61FA + ldr r0, _081A63A4 + strh r3, [r0] + ldr r2, [r6] + adds r1, r2, r1 + ldrh r0, [r1] + cmp r0, 0x5 + bhi _081A626C + adds r1, r0, 0 + lsls r1, 1 + ldr r4, _081A63A0 + adds r0, r2, r4 + adds r0, r1 + strh r3, [r0] +_081A626C: + movs r7, 0 + mov r10, sp + movs r6, 0 + lsls r6, 1 + str r6, [sp, 0x14] + add r6, sp + str r6, [sp, 0x18] +_081A627A: + ldr r1, [sp, 0x1C] + lsrs r0, r1, 24 + ldr r2, [sp, 0x20] + lsrs r1, r2, 24 + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r4, _081A63A8 + ldr r2, [r4] + lsls r1, r0, 4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0xC9 + beq _081A636E + movs r3, 0 + ldr r6, _081A6384 + mov r8, r1 + adds r5, r0, 0 + ldr r1, [r6] +_081A62A6: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + beq _081A62C0 + adds r1, 0xC + adds r3, 0x1 + cmp r3, 0x5 + ble _081A62A6 +_081A62C0: + cmp r3, 0x6 + bne _081A636E + ldr r6, [sp, 0x10] + cmp r6, 0 + bne _081A62D0 + ldr r0, _081A63AC + cmp r9, r0 + bhi _081A636E +_081A62D0: + movs r2, 0 + adds r4, r2, r7 + cmp r2, r4 + bge _081A6302 + ldr r1, [sp, 0x18] + ldrh r0, [r1] + cmp r0, r5 + beq _081A6302 + adds r6, r4, 0 + ldr r3, _081A63A8 + mov r12, r3 + mov r5, r8 + ldr r3, [sp, 0x14] + add r3, sp +_081A62EC: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r6 + bge _081A6302 + mov r1, r12 + ldr r0, [r1] + adds r0, r5, r0 + ldrh r1, [r3] + ldrh r0, [r0] + cmp r1, r0 + bne _081A62EC +_081A6302: + cmp r2, r4 + bne _081A636E + movs r2, 0 + cmp r2, r4 + bge _081A633E + ldr r3, _081A63B0 + mov r12, r3 + add r0, sp, 0x8 + ldr r6, [sp, 0x14] + adds r3, r0, r6 + mov r0, r8 + str r0, [sp, 0x24] + adds r5, r4, 0 +_081A631C: + ldrh r1, [r3] + cmp r1, 0 + beq _081A6336 + ldr r6, _081A63A8 + ldr r0, [r6] + ldr r6, [sp, 0x24] + adds r0, r6, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r1, r0 + beq _081A633E +_081A6336: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r5 + blt _081A631C +_081A633E: + cmp r2, r4 + bne _081A636E + lsls r4, r7, 1 + ldr r0, _081A63A8 + ldr r1, [r0] + add r1, r8 + ldrh r0, [r1] + mov r2, r10 + strh r0, [r2] + add r2, sp, 0x8 + adds r2, r4 + ldr r3, _081A63B0 + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2] + ldr r0, _081A63B4 + adds r4, r0 + mov r3, r9 + strh r3, [r4] + movs r4, 0x2 + add r10, r4 + adds r7, 0x1 +_081A636E: + cmp r7, 0x3 + bne _081A627A + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A6384: .4byte 0x03005d90 +_081A6388: .4byte 0x00000ca9 +_081A638C: .4byte 0x000040ce +_081A6390: .4byte 0x00000de2 +_081A6394: .4byte 0x0203bc88 +_081A6398: .4byte 0x085d5acc +_081A639C: .4byte 0x00000cb2 +_081A63A0: .4byte 0x00000cb4 +_081A63A4: .4byte 0x02038bca +_081A63A8: .4byte 0x0203bc8c +_081A63AC: .4byte 0x00000351 +_081A63B0: .4byte 0x085cecb0 +_081A63B4: .4byte 0x03006298 + thumb_func_end sub_81A61B0 + + thumb_func_start sub_81A63B8 +sub_81A63B8: @ 81A63B8 + push {lr} + ldr r0, _081A63C8 + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .align 2, 0 +_081A63C8: .4byte 0x02038bca + thumb_func_end sub_81A63B8 + + thumb_func_start sub_81A63CC +sub_81A63CC: @ 81A63CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _081A63EC + ldr r0, [r0] + ldr r1, _081A63F0 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A63FC + ldr r1, _081A63F4 + ldr r0, _081A63F8 + b _081A6400 + .align 2, 0 +_081A63EC: .4byte 0x03005d90 +_081A63F0: .4byte 0x00000ca9 +_081A63F4: .4byte 0x0203bc8c +_081A63F8: .4byte 0x085d97bc +_081A63FC: + ldr r1, _081A64A0 + ldr r0, _081A64A4 +_081A6400: + str r0, [r1] + movs r7, 0 + ldr r2, _081A64A8 + mov r8, r2 +_081A6408: + mov r0, r8 + ldr r1, [r0] + adds r0, r7, 0x3 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r0, _081A64AC + lsls r6, r7, 1 + adds r6, r0 + ldrh r0, [r6] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r0, _081A64B0 + adds r5, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, _081A64B4 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r2, r8 + ldr r1, [r2] + ldr r2, _081A64B8 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, _081A64BC + adds r1, r2 + strb r0, [r1] + ldrh r1, [r6] + ldr r0, _081A64A0 + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r0, _081A64C0 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_setattr + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081A6408 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A64A0: .4byte 0x0203bc8c +_081A64A4: .4byte 0x085de02c +_081A64A8: .4byte 0x03005d90 +_081A64AC: .4byte 0x03006298 +_081A64B0: .4byte 0x02024744 +_081A64B4: .4byte 0x00000e78 +_081A64B8: .4byte 0x00000e74 +_081A64BC: .4byte 0x00000e79 +_081A64C0: .4byte 0x085cecb0 + thumb_func_end sub_81A63CC + + thumb_func_start sub_81A64C4 +sub_81A64C4: @ 81A64C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, _081A64F0 + ldr r0, [r0] + ldr r1, _081A64F4 + adds r2, r0, r1 + ldrb r1, [r2] + movs r3, 0x3 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x2 + bne _081A6500 + ldr r1, _081A64F8 + ldr r0, _081A64FC + str r0, [r1] + movs r2, 0x1E + str r2, [sp, 0x14] + b _081A6518 + .align 2, 0 +_081A64F0: .4byte 0x03005d90 +_081A64F4: .4byte 0x00000ca9 +_081A64F8: .4byte 0x0203bc8c +_081A64FC: .4byte 0x085de02c +_081A6500: + ldr r1, _081A67C0 + ldr r0, _081A67C4 + str r0, [r1] + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + movs r4, 0x32 + str r4, [sp, 0x14] + cmp r0, 0 + beq _081A6518 + movs r5, 0x64 + str r5, [sp, 0x14] +_081A6518: + ldr r0, _081A67C8 + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A6522 + b _081A666C +_081A6522: + bl zero_player_party_data + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0x12 + str r1, [sp, 0x1C] + ldr r2, _081A67C0 + mov r9, r2 +_081A6534: + ldr r4, _081A67CC + ldr r2, [r4] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r3, r10 + add r3, r8 + lsls r3, 2 + adds r1, r2, r3 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, _081A67D0 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, _081A67D4 + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, _081A67D8 + adds r2, r5 + adds r2, r3 + ldr r2, [r2] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl create_pokemon_set_level + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + adds r5, 0x1 + str r5, [sp, 0x18] + movs r5, 0x5 +_081A6596: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A65A2 + adds r1, 0x1 +_081A65A2: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A6596 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, _081A67D4 +_081A65C4: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A65E2 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl pokemon_setattr + ldr r3, [sp, 0x20] +_081A65E2: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A65C4 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, _081A67D4 + adds r0, r4, r5 + bl pokemon_calc_effective_stats + movs r0, 0 + ldr r1, [sp, 0x1C] + strb r0, [r1] + movs r6, 0 +_081A6602: + mov r2, r9 + ldr r0, [r2] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A6602 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r0, _081A67D4 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _081A67DC + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r5, _081A67CC + ldr r0, [r5] + adds r2, r0 + ldr r0, _081A67E0 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_setattr + ldr r1, [sp, 0x18] + mov r8, r1 + cmp r1, 0x2 + bgt _081A666C + b _081A6534 +_081A666C: + ldr r0, _081A67C8 + ldrh r0, [r0] + cmp r0, 0 + beq _081A667A + cmp r0, 0x2 + beq _081A667A + b _081A67AE +_081A667A: + movs r2, 0 + mov r8, r2 + ldr r4, _081A67C0 + mov r9, r4 +_081A6682: + ldr r5, _081A67CC + ldr r3, [r5] + mov r0, r8 + adds r0, 0x3 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r1, r3, r2 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, _081A67D0 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, _081A67E4 + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, _081A67D8 + adds r3, r5 + adds r3, r2 + ldr r2, [r3] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl create_pokemon_set_level + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x18] + movs r5, 0x5 +_081A66E8: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A66F4 + adds r1, 0x1 +_081A66F4: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A66E8 + add r4, sp, 0x10 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + strh r0, [r4] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, _081A67E4 +_081A6716: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A6734 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl pokemon_setattr + ldr r3, [sp, 0x20] +_081A6734: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A6716 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, _081A67E4 + adds r0, r4, r5 + bl pokemon_calc_effective_stats + movs r6, 0 +_081A674E: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A674E + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r0, _081A67E4 + adds r4, r0 + mov r5, r9 + ldr r0, [r5] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _081A67DC + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r1, _081A67CC + ldr r0, [r1] + adds r2, r0 + ldr r5, _081A67E8 + adds r2, r5 + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_setattr + ldr r0, [sp, 0x18] + mov r8, r0 + cmp r0, 0x2 + bgt _081A67AE + b _081A6682 +_081A67AE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A67C0: .4byte 0x0203bc8c +_081A67C4: .4byte 0x085d97bc +_081A67C8: .4byte 0x020375e2 +_081A67CC: .4byte 0x03005d90 +_081A67D0: .4byte 0x00000e78 +_081A67D4: .4byte 0x020244ec +_081A67D8: .4byte 0x00000e74 +_081A67DC: .4byte 0x085cecb0 +_081A67E0: .4byte 0x00000e79 +_081A67E4: .4byte 0x02024744 +_081A67E8: .4byte 0x00000e9d + thumb_func_end sub_81A64C4 + + thumb_func_start sub_81A67EC +sub_81A67EC: @ 81A67EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, _081A6894 + ldr r0, _081A6898 + str r0, [r1] + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x38] + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x3C] + ldr r2, _081A689C + mov r9, r2 + movs r2, 0 + adds r3, r1, 0 + adds r1, r0, 0 + mov r0, sp + movs r4, 0x5 + mov r8, r4 +_081A681A: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r5, 0x1 + negs r5, r5 + add r8, r5 + mov r4, r8 + cmp r4, 0 + bge _081A681A + mov r5, r9 + ldr r0, [r5] + ldr r7, _081A68A0 + adds r0, r7 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r6, _081A68A4 + adds r0, r6, 0 + bl var_get + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r5, _081A68A8 + adds r1, r5 + adds r1, r4 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + adds r0, r6, 0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + movs r2, 0 + cmp r0, 0x1 + bne _081A6878 + movs r2, 0x1 +_081A6878: + ldr r1, _081A68AC + ldr r0, _081A68B0 + str r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, r7 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A68B4 + movs r4, 0x1 + str r4, [sp, 0x28] + b _081A68B8 + .align 2, 0 +_081A6894: .4byte 0x0203bc88 +_081A6898: .4byte 0x085d5acc +_081A689C: .4byte 0x03005d90 +_081A68A0: .4byte 0x00000ca9 +_081A68A4: .4byte 0x000040ce +_081A68A8: .4byte 0x00000de2 +_081A68AC: .4byte 0x0203bc8c +_081A68B0: .4byte 0x085d97bc +_081A68B4: + movs r5, 0 + str r5, [sp, 0x28] +_081A68B8: + adds r0, r2, 0 + ldr r1, [sp, 0x28] + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + movs r0, 0 + mov r10, r0 + mov r8, r0 + ldr r1, [sp, 0x3C] + str r1, [sp, 0x40] + mov r2, sp + str r2, [sp, 0x44] + lsls r4, r0, 1 + str r4, [sp, 0x30] + ldr r5, [sp, 0x38] + adds r5, r4 + str r5, [sp, 0x34] +_081A68DE: + ldr r0, [sp, 0x2C] + cmp r8, r0 + bge _081A68EC + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0x1 + b _081A68F2 +_081A68EC: + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0 +_081A68F2: + bl sub_81A6EF0 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, _081A698C + ldr r1, [r0] + lsls r2, r7, 4 + adds r4, r2, r1 + ldrh r1, [r4] + mov r9, r2 + cmp r1, 0xC9 + beq _081A69E2 + movs r3, 0 + mov r2, r8 + adds r6, r3, r2 + cmp r3, r6 + bge _081A6950 + ldr r5, [sp, 0x34] + ldrh r0, [r5] + cmp r0, r7 + beq _081A6950 + mov r12, r4 + adds r2, r1, 0 + lsls r4, r3, 1 + ldr r1, [sp, 0x30] + add r1, sp + str r6, [sp, 0x48] +_081A6928: + ldrh r0, [r1] + cmp r0, r2 + bne _081A693A + mov r0, r10 + cmp r0, 0 + bne _081A6950 + mov r5, r12 + ldrh r5, [r5] + mov r10, r5 +_081A693A: + adds r4, 0x2 + adds r1, 0x2 + adds r3, 0x1 + ldr r0, [sp, 0x48] + cmp r3, r0 + bge _081A6950 + ldr r5, [sp, 0x38] + adds r0, r5, r4 + ldrh r0, [r0] + cmp r0, r7 + bne _081A6928 +_081A6950: + cmp r3, r6 + bne _081A69E2 + movs r3, 0 + cmp r3, r6 + bge _081A699C + ldr r0, _081A6990 + mov r12, r0 + ldr r1, [sp, 0x30] + ldr r2, [sp, 0x3C] + adds r5, r1, r2 +_081A6964: + ldrh r4, [r5] + cmp r4, 0 + beq _081A6994 + ldr r1, _081A698C + ldr r0, [r1] + mov r2, r9 + adds r1, r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r4, r0 + bne _081A6994 + ldrh r0, [r1] + cmp r0, r10 + bne _081A699C + movs r4, 0 + mov r10, r4 + b _081A699C + .align 2, 0 +_081A698C: .4byte 0x0203bc8c +_081A6990: .4byte 0x085cecb0 +_081A6994: + adds r5, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _081A6964 +_081A699C: + cmp r3, r6 + bne _081A69E2 + ldr r0, _081A69FC + ldr r1, [r0] + mov r5, r8 + lsls r3, r5, 1 + adds r0, r3, r5 + lsls r0, 2 + adds r1, r0 + movs r0, 0xE7 + lsls r0, 4 + adds r1, r0 + strh r7, [r1] + ldr r2, _081A6A00 + ldr r1, [r2] + add r1, r9 + ldrh r0, [r1] + ldr r4, [sp, 0x44] + strh r0, [r4] + ldr r2, _081A6A04 + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r5, [sp, 0x40] + strh r0, [r5] + ldr r0, [sp, 0x38] + adds r3, r0, r3 + strh r7, [r3] + adds r5, 0x2 + str r5, [sp, 0x40] + adds r4, 0x2 + str r4, [sp, 0x44] + movs r1, 0x1 + add r8, r1 +_081A69E2: + mov r2, r8 + cmp r2, 0x6 + beq _081A69EA + b _081A68DE +_081A69EA: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A69FC: .4byte 0x03005d90 +_081A6A00: .4byte 0x0203bc8c +_081A6A04: .4byte 0x085cecb0 + thumb_func_end sub_81A67EC + + thumb_func_start sub_81A6A08 +sub_81A6A08: @ 81A6A08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r1, _081A6A98 + ldr r0, _081A6A9C + str r0, [r1] + movs r4, 0 + add r5, sp, 0x14 + ldr r7, _081A6AA0 + movs r1, 0 +_081A6A1E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A1E + movs r4, 0 + ldr r0, _081A6AA4 + mov r8, r0 + ldr r0, _081A6A98 + ldr r6, [r0] + ldr r1, _081A6AA8 + mov r12, r1 +_081A6A3C: + lsls r0, r4, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r12 + adds r3, r0, r2 + ldrb r2, [r3, 0x6] + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r1, [r3, 0x7] + cmp r2, r1 + beq _081A6A70 + ldrb r0, [r3, 0x7] + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081A6A70: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6A3C + movs r0, 0 + strb r0, [r5] + strb r0, [r5, 0x1] + movs r4, 0x1 + adds r3, r5, 0 +_081A6A84: + ldrb r0, [r3] + add r0, sp + mov r2, sp + adds r1, r2, r4 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bcs _081A6AAC + strb r4, [r5] + b _081A6AB2 + .align 2, 0 +_081A6A98: .4byte 0x0203bc8c +_081A6A9C: .4byte 0x085d97bc +_081A6AA0: .4byte 0x020375f0 +_081A6AA4: .4byte 0x03006298 +_081A6AA8: .4byte 0x083203cc +_081A6AAC: + cmp r2, r0 + bne _081A6AB2 + strb r4, [r3, 0x1] +_081A6AB2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A84 + ldrb r1, [r5] + mov r4, sp + adds r0, r4, r1 + ldrb r2, [r0] + cmp r2, 0 + beq _081A6ADA + ldrb r3, [r5, 0x1] + adds r0, r4, r3 + ldrb r0, [r0] + cmp r2, r0 + bhi _081A6AD6 + cmp r1, r3 + bne _081A6ADA +_081A6AD6: + strh r1, [r7] + b _081A6ADE +_081A6ADA: + movs r0, 0x12 + strh r0, [r7] +_081A6ADE: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A6A08 + + thumb_func_start sub_81A6AEC +sub_81A6AEC: @ 81A6AEC + push {r4-r7,lr} + sub sp, 0x8 + movs r7, 0 + ldr r1, _081A6B90 + ldr r0, _081A6B94 + str r0, [r1] + movs r4, 0 + movs r1, 0 +_081A6AFC: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6AFC + movs r4, 0 +_081A6B0E: + ldr r1, _081A6B98 + lsls r0, r4, 1 + adds r0, r1 + ldrh r6, [r0] + movs r5, 0 +_081A6B18: + ldr r0, _081A6B90 + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + lsls r1, r5, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + bl sub_81A6BA4 + lsls r0, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A6B18 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6B0E + ldr r1, _081A6B9C + movs r0, 0 + strh r0, [r1] + movs r4, 0x1 + adds r5, r1, 0 + ldr r3, _081A6BA0 + adds r2, r5, 0 +_081A6B5C: + mov r1, sp + adds r0, r1, r4 + subs r1, r4, 0x1 + adds r1, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _081A6B74 + strh r4, [r2] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081A6B74: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6B5C + cmp r7, 0x2 + bls _081A6B86 + movs r0, 0x8 + strh r0, [r5] +_081A6B86: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A6B90: .4byte 0x0203bc8c +_081A6B94: .4byte 0x085d97bc +_081A6B98: .4byte 0x03006298 +_081A6B9C: .4byte 0x020375f0 +_081A6BA0: .4byte 0x08611fc0 + thumb_func_end sub_81A6AEC + + thumb_func_start sub_81A6BA4 +sub_81A6BA4: @ 81A6BA4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r6, _081A6BD0 +_081A6BAE: + movs r3, 0 + lsls r0, r2, 2 + adds r0, r6 + ldr r1, [r0] + ldrh r0, [r1] + adds r4, r2, 0x1 + cmp r0, 0 + beq _081A6BE4 + lsls r0, r4, 24 + lsrs r2, r0, 24 +_081A6BC2: + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _081A6BD4 + adds r0, r2, 0 + b _081A6BEE + .align 2, 0 +_081A6BD0: .4byte 0x08612104 +_081A6BD4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081A6BC2 +_081A6BE4: + lsls r0, r4, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _081A6BAE + movs r0, 0 +_081A6BEE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A6BA4 + + thumb_func_start sub_81A6BF4 +sub_81A6BF4: @ 81A6BF4 + push {lr} + movs r2, 0 + ldr r1, _081A6C14 + ldr r3, _081A6C18 + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081A6C0C + movs r2, 0x1 +_081A6C0C: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_081A6C14: .4byte 0x02037318 +_081A6C18: .4byte 0xfffffea5 + thumb_func_end sub_81A6BF4 + + thumb_func_start sub_81A6C1C +sub_81A6C1C: @ 81A6C1C + push {r4,lr} + ldr r0, _081A6C38 + ldr r0, [r0] + ldr r1, _081A6C3C + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A6C48 + ldr r1, _081A6C40 + ldr r0, _081A6C44 + b _081A6C4C + .align 2, 0 +_081A6C38: .4byte 0x03005d90 +_081A6C3C: .4byte 0x00000ca9 +_081A6C40: .4byte 0x0203bc8c +_081A6C44: .4byte 0x085d97bc +_081A6C48: + ldr r1, _081A6C94 + ldr r0, _081A6C98 +_081A6C4C: + str r0, [r1] + movs r4, 0 +_081A6C50: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081A6C9C + adds r0, r1 + ldr r1, _081A6CA0 + ldr r2, [r1] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1 + movs r1, 0xE7 + lsls r1, 4 + adds r2, r1 + ldrh r2, [r2] + ldr r1, _081A6C94 + ldr r1, [r1] + lsls r2, 4 + adds r2, r1 + ldrb r2, [r2, 0xA] + lsls r2, 1 + ldr r1, _081A6CA4 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6C50 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A6C94: .4byte 0x0203bc8c +_081A6C98: .4byte 0x085de02c +_081A6C9C: .4byte 0x020244ec +_081A6CA0: .4byte 0x03005d90 +_081A6CA4: .4byte 0x085cecb0 + thumb_func_end sub_81A6C1C + + thumb_func_start sub_81A6CA8 +sub_81A6CA8: @ 81A6CA8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + negs r2, r1 + orrs r2, r1 + lsrs r2, 31 + lsrs r1, r0, 24 + cmp r1, 0x8 + bls _081A6CBE + movs r1, 0x7 +_081A6CBE: + ldr r0, _081A6CCC + lsls r1, 1 + adds r1, r2, r1 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_081A6CCC: .4byte 0x08612184 + thumb_func_end sub_81A6CA8 + + thumb_func_start sub_81A6CD0 +sub_81A6CD0: @ 81A6CD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r4, _081A6ED0 + ldr r0, [r4] + ldr r1, _081A6ED4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x2C] + ldr r0, _081A6ED8 + bl var_get + lsls r0, 24 + ldr r1, [r4] + ldr r3, [sp, 0x2C] + lsls r2, r3, 1 + lsrs r0, 22 + adds r2, r0 + ldr r7, _081A6EDC + adds r1, r7 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + str r1, [sp, 0x30] + movs r2, 0x80 + lsls r2, 18 + adds r0, r2 + lsrs r0, 24 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + movs r3, 0 + mov r9, r3 + ldr r1, [r4] + ldrb r4, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r4, r0 + str r4, [sp, 0x28] +_081A6D4C: + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r7, _081A6EE0 + ldr r1, [r7] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xC9 + bne _081A6D6A + b _081A6EB8 +_081A6D6A: + ldr r0, [sp, 0x20] + cmp r0, 0x32 + bne _081A6D78 + ldr r0, _081A6EE4 + cmp r5, r0 + bls _081A6D78 + b _081A6EB8 +_081A6D78: + movs r2, 0 + ldr r1, _081A6ED0 + ldr r0, [r1] + movs r3, 0xE7 + lsls r3, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + beq _081A6DA2 + adds r4, r1, 0 + movs r1, 0 +_081A6D8E: + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + bgt _081A6DA2 + ldr r0, [r4] + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + bne _081A6D8E +_081A6DA2: + cmp r2, 0x6 + beq _081A6DA8 + b _081A6EB8 +_081A6DA8: + movs r4, 0 + cmp r4, r9 + bge _081A6DDC + add r2, sp, 0xC + ldr r7, _081A6EE0 + ldr r0, [r7] + lsls r1, r5, 4 + adds r0, r1, r0 + ldrh r2, [r2] + adds r7, r1, 0 + ldrh r0, [r0] + cmp r2, r0 + beq _081A6DDC + ldr r6, _081A6EE0 + adds r3, r7, 0 + add r2, sp, 0xC +_081A6DC8: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + bge _081A6DDC + ldr r0, [r6] + adds r0, r3, r0 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081A6DC8 +_081A6DDC: + cmp r4, r9 + bne _081A6EB8 + movs r4, 0 + cmp r4, r9 + bge _081A6E0C + ldr r7, _081A6EE8 + ldr r6, _081A6EE0 + add r2, sp, 0x14 + lsls r3, r5, 4 +_081A6DEE: + ldrh r1, [r2] + cmp r1, 0 + beq _081A6E04 + ldr r0, [r6] + adds r0, r3, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r1, r0 + beq _081A6E0C +_081A6E04: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + blt _081A6DEE +_081A6E0C: + cmp r4, r9 + bne _081A6EB8 + mov r0, r9 + lsls r2, r0, 1 + mov r1, sp + adds r1, r2 + adds r1, 0xC + ldr r3, _081A6EE0 + ldr r4, [r3] + lsls r5, 4 + mov r8, r5 + add r4, r8 + ldrh r0, [r4] + strh r0, [r1] + add r1, sp, 0x14 + adds r1, r2 + ldr r2, _081A6EE8 + ldrb r0, [r4, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0x64 + mov r5, r9 + muls r5, r0 + ldr r6, _081A6EEC + adds r0, r5, r6 + ldrh r1, [r4] + ldr r7, [sp, 0x20] + lsls r2, r7, 24 + ldrb r3, [r4, 0xC] + ldr r7, [sp, 0x24] + str r7, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r4, [sp, 0x28] + str r4, [sp, 0x8] + lsrs r2, 24 + bl sub_8068634 + add r0, sp, 0x1C + movs r7, 0 + strb r7, [r0] + movs r4, 0 + mov r7, r8 + mov r10, r0 + movs r0, 0x1 + add r0, r9 + mov r8, r0 +_081A6E6E: + ldr r1, _081A6EE0 + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r4, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r5, r6 + bl sub_81A7024 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A6E6E + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, _081A6EEC + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + mov r2, r10 + bl pokemon_setattr + ldr r2, _081A6EE0 + ldr r0, [r2] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, _081A6EE8 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r9, r8 +_081A6EB8: + mov r3, r9 + cmp r3, 0x3 + beq _081A6EC0 + b _081A6D4C +_081A6EC0: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A6ED0: .4byte 0x03005d90 +_081A6ED4: .4byte 0x00000ca9 +_081A6ED8: .4byte 0x000040ce +_081A6EDC: .4byte 0x00000de2 +_081A6EE0: .4byte 0x0203bc8c +_081A6EE4: .4byte 0x00000351 +_081A6EE8: .4byte 0x085cecb0 +_081A6EEC: .4byte 0x02024744 + thumb_func_end sub_81A6CD0 + + thumb_func_start sub_81A6EF0 +sub_81A6EF0: @ 81A6EF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r4, 0x8 + negs r1, r0 + orrs r1, r0 + asrs r1, 31 + ands r1, r4 + adds r4, r1, 0 + cmp r3, 0x6 + bhi _081A6F2C + cmp r2, 0 + beq _081A6F20 + ldr r2, _081A6F1C + adds r1, r3 + adds r1, 0x1 + b _081A6F38 + .align 2, 0 +_081A6F1C: .4byte 0x08612194 +_081A6F20: + ldr r2, _081A6F28 + adds r1, r3 + b _081A6F38 + .align 2, 0 +_081A6F28: .4byte 0x08612194 +_081A6F2C: + adds r1, r3, 0 + cmp r1, 0x7 + beq _081A6F34 + movs r1, 0x7 +_081A6F34: + ldr r2, _081A6F6C + adds r1, r4, r1 +_081A6F38: + lsls r1, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, r4 + lsls r4, 16 + lsrs r0, r4, 16 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081A6F6C: .4byte 0x08612194 + thumb_func_end sub_81A6EF0 + + thumb_func_start sub_81A6F70 +sub_81A6F70: @ 81A6F70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, _081A6FAC + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, _081A6FB0 + adds r2, r0 + adds r2, r1 + ldrb r1, [r2] + movs r0, 0 + cmp r1, 0xE + bls _081A6FA8 + movs r0, 0x1 + cmp r1, 0x15 + bls _081A6FA8 + movs r0, 0x2 + cmp r1, 0x1C + bls _081A6FA8 + movs r0, 0x3 + cmp r1, 0x23 + bls _081A6FA8 + movs r0, 0x5 + cmp r1, 0x2A + bhi _081A6FA8 + movs r0, 0x4 +_081A6FA8: + pop {r1} + bx r1 + .align 2, 0 +_081A6FAC: .4byte 0x03005d90 +_081A6FB0: .4byte 0x00000df2 + thumb_func_end sub_81A6F70 + + thumb_func_start sub_81A6FB4 +sub_81A6FB4: @ 81A6FB4 + push {r4,r5,lr} + ldr r5, _081A6FFC + ldr r0, [r5] + ldr r1, _081A7000 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + cmp r4, 0x2 + beq _081A6FF8 + ldr r0, _081A7004 + bl var_get + lsls r0, 16 + ldr r1, [r5] + lsls r2, r4, 1 + lsrs r0, 14 + adds r2, r0 + ldr r0, _081A7008 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _081A700C + ldrh r1, [r0] + ldr r0, _081A7010 + cmp r1, r0 + beq _081A7018 + cmp r2, 0x1 + bgt _081A7014 +_081A6FF8: + movs r0, 0 + b _081A701E + .align 2, 0 +_081A6FFC: .4byte 0x03005d90 +_081A7000: .4byte 0x00000ca9 +_081A7004: .4byte 0x000040ce +_081A7008: .4byte 0x00000de2 +_081A700C: .4byte 0x02038bca +_081A7010: .4byte 0x000003fe +_081A7014: + cmp r2, 0x3 + ble _081A701C +_081A7018: + movs r0, 0x7 + b _081A701E +_081A701C: + movs r0, 0x1 +_081A701E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A6FB4 + + thumb_func_start sub_81A7024 +sub_81A7024: @ 81A7024 + push {lr} + lsls r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsrs r1, 16 + cmp r1, 0xD8 + bne _081A7034 + movs r1, 0xDA +_081A7034: + bl sub_80691F4 + pop {r0} + bx r0 + thumb_func_end sub_81A7024 + + thumb_func_start sub_81A703C +sub_81A703C: @ 81A703C + push {lr} + ldr r1, _081A7054 + ldr r0, _081A7058 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081A7054: .4byte 0x086125f8 +_081A7058: .4byte 0x020375e0 + thumb_func_end sub_81A703C + + thumb_func_start sub_81A705C +sub_81A705C: @ 81A705C + push {lr} + bl sub_81A79EC + ldr r1, _081A706C + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081A706C: .4byte 0x0300128c + thumb_func_end sub_81A705C + + thumb_func_start sub_81A7070 +sub_81A7070: @ 81A7070 + push {r4-r7,lr} + ldr r0, _081A709C + movs r1, 0x1C + bl var_set + ldr r0, _081A70A0 + movs r1, 0xE2 + bl var_set + movs r4, 0x1 + movs r6, 0 + movs r5, 0 + movs r7, 0 + ldr r0, _081A70A4 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _081A7132 + lsls r0, 2 + ldr r1, _081A70A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A709C: .4byte 0x00004010 +_081A70A0: .4byte 0x00004011 +_081A70A4: .4byte 0x0300128c +_081A70A8: .4byte _081A70AC + .align 2, 0 +_081A70AC: + .4byte _081A70D0 + .4byte _081A70DA + .4byte _081A70DE + .4byte _081A70E8 + .4byte _081A70FC + .4byte _081A70D6 + .4byte _081A7100 + .4byte _081A7108 + .4byte _081A710E +_081A70D0: + movs r0, 0 + bl sub_81A82A4 +_081A70D6: + movs r4, 0 + b _081A711A +_081A70DA: + movs r5, 0x1C + b _081A711A +_081A70DE: + bl sub_81A7B58 + lsls r0, 24 + lsrs r5, r0, 24 + b _081A711A +_081A70E8: + movs r5, 0x30 + ldr r0, _081A70F8 + ldrb r0, [r0] + movs r7, 0xE1 + cmp r0, 0x1 + bne _081A7118 + movs r7, 0xE2 + b _081A7118 + .align 2, 0 +_081A70F8: .4byte 0x0300128d +_081A70FC: + movs r5, 0x30 + b _081A711A +_081A7100: + movs r0, 0x1 + bl sub_81A82A4 + b _081A7114 +_081A7108: + bl sub_81A8374 + b _081A70D6 +_081A710E: + movs r0, 0x5 + bl sub_81A5030 +_081A7114: + movs r7, 0x1C + movs r4, 0 +_081A7118: + movs r6, 0x1 +_081A711A: + cmp r4, 0x1 + bne _081A7126 + ldr r0, _081A7138 + adds r1, r5, 0 + bl var_set +_081A7126: + cmp r6, 0x1 + bne _081A7132 + ldr r0, _081A713C + adds r1, r7, 0 + bl var_set +_081A7132: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A7138: .4byte 0x00004010 +_081A713C: .4byte 0x00004011 + thumb_func_end sub_81A7070 + + thumb_func_start sub_81A7140 +sub_81A7140: @ 81A7140 + push {lr} + ldr r1, _081A7164 + ldr r0, [r1] + ldr r2, _081A7168 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 30 + ldr r0, _081A716C + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x4 + bhi _081A723A + lsls r0, 2 + ldr r1, _081A7170 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A7164: .4byte 0x03005d90 +_081A7168: .4byte 0x00000ca9 +_081A716C: .4byte 0x020375e2 +_081A7170: .4byte _081A7174 + .align 2, 0 +_081A7174: + .4byte _081A7188 + .4byte _081A71A0 + .4byte _081A71C4 + .4byte _081A71E8 + .4byte _081A720C +_081A7188: + ldr r0, _081A7198 + ldr r1, [r3] + ldr r3, _081A719C + adds r1, r3 + ldrh r1, [r1] + strh r1, [r0] + b _081A723A + .align 2, 0 +_081A7198: .4byte 0x020375f0 +_081A719C: .4byte 0x00000e02 +_081A71A0: + ldr r2, _081A71B8 + ldr r1, [r3] + ldr r3, _081A71BC + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, _081A71C0 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .align 2, 0 +_081A71B8: .4byte 0x020375f0 +_081A71BC: .4byte 0x00000ca9 +_081A71C0: .4byte 0x00000e04 +_081A71C4: + ldr r2, _081A71DC + ldr r1, [r3] + ldr r3, _081A71E0 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, _081A71E4 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .align 2, 0 +_081A71DC: .4byte 0x020375f0 +_081A71E0: .4byte 0x00000ca9 +_081A71E4: .4byte 0x00000e08 +_081A71E8: + ldr r2, _081A7200 + ldr r1, [r3] + ldr r3, _081A7204 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, _081A7208 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .align 2, 0 +_081A7200: .4byte 0x020375f0 +_081A7204: .4byte 0x00000ca9 +_081A7208: .4byte 0x00000e0c +_081A720C: + cmp r2, 0 + beq _081A7228 + ldr r2, _081A7220 + ldr r0, [r3] + ldr r1, _081A7224 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + b _081A7236 + .align 2, 0 +_081A7220: .4byte 0x020375f0 +_081A7224: .4byte 0x00000cdc +_081A7228: + ldr r2, _081A7240 + ldr r0, [r3] + ldr r3, _081A7244 + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 +_081A7236: + ands r0, r1 +_081A7238: + strh r0, [r2] +_081A723A: + pop {r0} + bx r0 + .align 2, 0 +_081A7240: .4byte 0x020375f0 +_081A7244: .4byte 0x00000cdc + thumb_func_end sub_81A7140 + + thumb_func_start sub_81A7248 +sub_81A7248: @ 81A7248 + push {r4,r5,lr} + ldr r1, _081A7270 + ldr r0, [r1] + ldr r2, _081A7274 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r3, r0, 30 + ldr r0, _081A7278 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bls _081A7264 + b _081A73AA +_081A7264: + lsls r0, 2 + ldr r1, _081A727C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A7270: .4byte 0x03005d90 +_081A7274: .4byte 0x00000ca9 +_081A7278: .4byte 0x020375e2 +_081A727C: .4byte _081A7280 + .align 2, 0 +_081A7280: + .4byte _081A7294 + .4byte _081A72AC + .4byte _081A72D8 + .4byte _081A7314 + .4byte _081A7344 +_081A7294: + ldr r0, [r2] + ldr r1, _081A72A4 + ldrh r1, [r1] + ldr r5, _081A72A8 + adds r0, r5 + strh r1, [r0] + b _081A73AA + .align 2, 0 +_081A72A4: .4byte 0x020375e4 +_081A72A8: .4byte 0x00000e02 +_081A72AC: + ldr r0, _081A72C8 + ldrh r3, [r0] + ldr r0, _081A72CC + cmp r3, r0 + bls _081A72B8 + b _081A73AA +_081A72B8: + ldr r0, [r2] + ldr r2, _081A72D0 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, _081A72D4 + b _081A732C + .align 2, 0 +_081A72C8: .4byte 0x020375e4 +_081A72CC: .4byte 0x0000270f +_081A72D0: .4byte 0x00000ca9 +_081A72D4: .4byte 0x00000e04 +_081A72D8: + ldr r0, _081A7304 + ldrh r4, [r0] + adds r3, r4, 0 + ldr r0, _081A7308 + cmp r3, r0 + bhi _081A73AA + ldr r1, [r2] + ldr r2, _081A730C + adds r0, r1, r2 + ldrb r0, [r0] + lsls r2, r0, 30 + lsrs r0, r2, 29 + ldr r5, _081A7310 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r3 + bcs _081A73AA + lsrs r0, r2, 29 + adds r0, r1, r0 + strh r4, [r0] + b _081A73AA + .align 2, 0 +_081A7304: .4byte 0x020375e4 +_081A7308: .4byte 0x0000270f +_081A730C: .4byte 0x00000ca9 +_081A7310: .4byte 0x00000e08 +_081A7314: + ldr r0, _081A7334 + ldrh r3, [r0] + ldr r0, _081A7338 + cmp r3, r0 + bhi _081A73AA + ldr r0, [r2] + ldr r2, _081A733C + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, _081A7340 +_081A732C: + adds r0, r5 + adds r0, r1 + strh r3, [r0] + b _081A73AA + .align 2, 0 +_081A7334: .4byte 0x020375e4 +_081A7338: .4byte 0x0000270f +_081A733C: .4byte 0x00000ca9 +_081A7340: .4byte 0x00000e0c +_081A7344: + cmp r3, 0 + beq _081A737C + ldr r0, _081A7360 + ldrh r0, [r0] + cmp r0, 0 + beq _081A7368 + ldr r0, [r2] + ldr r1, _081A7364 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + b _081A73A8 + .align 2, 0 +_081A7360: .4byte 0x020375e4 +_081A7364: .4byte 0x00000cdc +_081A7368: + ldr r0, [r2] + ldr r2, _081A7374 + adds r0, r2 + ldr r1, [r0] + ldr r2, _081A7378 + b _081A73A6 + .align 2, 0 +_081A7374: .4byte 0x00000cdc +_081A7378: .4byte 0xfffff7ff +_081A737C: + ldr r0, _081A7394 + ldrh r0, [r0] + cmp r0, 0 + beq _081A739C + ldr r0, [r2] + ldr r5, _081A7398 + adds r0, r5 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 3 + orrs r1, r2 + b _081A73A8 + .align 2, 0 +_081A7394: .4byte 0x020375e4 +_081A7398: .4byte 0x00000cdc +_081A739C: + ldr r0, [r2] + ldr r1, _081A73B0 + adds r0, r1 + ldr r1, [r0] + ldr r2, _081A73B4 +_081A73A6: + ands r1, r2 +_081A73A8: + str r1, [r0] +_081A73AA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A73B0: .4byte 0x00000cdc +_081A73B4: .4byte 0xfffffbff + thumb_func_end sub_81A7248 + + thumb_func_start sub_81A73B8 +sub_81A73B8: @ 81A73B8 + push {lr} + ldr r0, _081A73D0 + ldr r0, [r0] + ldr r1, _081A73D4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _081A73DC + ldr r1, _081A73D8 + movs r0, 0x1 + b _081A73E0 + .align 2, 0 +_081A73D0: .4byte 0x03005d90 +_081A73D4: .4byte 0x00000cb2 +_081A73D8: .4byte 0x020375f0 +_081A73DC: + ldr r1, _081A73E8 + movs r0, 0 +_081A73E0: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081A73E8: .4byte 0x020375f0 + thumb_func_end sub_81A73B8 + + thumb_func_start sub_81A73EC +sub_81A73EC: @ 81A73EC + ldr r0, _081A73F8 + ldr r1, _081A73FC + ldrb r1, [r1] + strh r1, [r0] + bx lr + .align 2, 0 +_081A73F8: .4byte 0x020375f0 +_081A73FC: .4byte 0x0300128c + thumb_func_end sub_81A73EC + + thumb_func_start sub_81A7400 +sub_81A7400: @ 81A7400 + ldr r1, _081A7408 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_081A7408: .4byte 0x0300128e + thumb_func_end sub_81A7400 + + thumb_func_start sub_81A740C +sub_81A740C: @ 81A740C + ldr r1, _081A7414 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_081A7414: .4byte 0x0300128e + thumb_func_end sub_81A740C + + thumb_func_start sub_81A7418 +sub_81A7418: @ 81A7418 + push {r4,lr} + ldr r4, _081A7450 + ldr r0, [r4] + ldr r1, _081A7454 + ldrh r1, [r1] + ldr r2, _081A7458 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081A745C + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl save_game_when_memory_present + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A7450: .4byte 0x03005d90 +_081A7454: .4byte 0x020375e2 +_081A7458: .4byte 0x00000ca8 +_081A745C: .4byte 0x00000ca9 + thumb_func_end sub_81A7418 + + thumb_func_start nullsub_76 +nullsub_76: @ 81A7460 + bx lr + thumb_func_end nullsub_76 + + thumb_func_start nullsub_124 +nullsub_124: @ 81A7464 + bx lr + thumb_func_end nullsub_124 + + thumb_func_start sub_81A7468 +sub_81A7468: @ 81A7468 + push {lr} + ldr r0, _081A7480 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A748E + cmp r0, 0x20 + bhi _081A7484 + cmp r0, 0x7 + beq _081A74BC + cmp r0, 0x10 + beq _081A7498 + b _081A74C2 + .align 2, 0 +_081A7480: .4byte 0x03001290 +_081A7484: + cmp r0, 0x40 + beq _081A74B0 + cmp r0, 0x80 + beq _081A74A4 + b _081A74C2 +_081A748E: + ldr r1, _081A7494 + movs r0, 0 + b _081A74C0 + .align 2, 0 +_081A7494: .4byte 0x020375f0 +_081A7498: + ldr r1, _081A74A0 + movs r0, 0x1 + b _081A74C0 + .align 2, 0 +_081A74A0: .4byte 0x020375f0 +_081A74A4: + ldr r1, _081A74AC + movs r0, 0x2 + b _081A74C0 + .align 2, 0 +_081A74AC: .4byte 0x020375f0 +_081A74B0: + ldr r1, _081A74B8 + movs r0, 0x3 + b _081A74C0 + .align 2, 0 +_081A74B8: .4byte 0x020375f0 +_081A74BC: + ldr r1, _081A74C8 + movs r0, 0x4 +_081A74C0: + strh r0, [r1] +_081A74C2: + pop {r0} + bx r0 + .align 2, 0 +_081A74C8: .4byte 0x020375f0 + thumb_func_end sub_81A7468 + + thumb_func_start sub_81A74CC +sub_81A74CC: @ 81A74CC + ldr r0, _081A74D8 + ldr r1, _081A74DC + ldrb r1, [r1] + strh r1, [r0] + bx lr + .align 2, 0 +_081A74D8: .4byte 0x020375f0 +_081A74DC: .4byte 0x0300128d + thumb_func_end sub_81A74CC + + thumb_func_start sub_81A74E0 +sub_81A74E0: @ 81A74E0 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x1 + ands r4, r0 + adds r4, 0x1 + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, _081A7504 + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A7504: .4byte 0x020375f0 + thumb_func_end sub_81A74E0 + + thumb_func_start sub_81A7508 +sub_81A7508: @ 81A7508 + push {lr} + ldr r0, _081A7528 + ldr r0, [r0] + ldr r1, _081A752C + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081A7538 + ldr r1, _081A7530 + ldr r0, _081A7534 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x2] + b _081A7560 + .align 2, 0 +_081A7528: .4byte 0x03005d90 +_081A752C: .4byte 0x00000cb2 +_081A7530: .4byte 0x0861231c +_081A7534: .4byte 0x03001294 +_081A7538: + cmp r0, 0xA + bhi _081A7554 + ldr r1, _081A754C + ldr r0, _081A7550 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x3] + b _081A7560 + .align 2, 0 +_081A754C: .4byte 0x0861231c +_081A7550: .4byte 0x03001294 +_081A7554: + ldr r1, _081A7574 + ldr r0, _081A7578 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] +_081A7560: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _081A757C + adds r0, r1 + bl sub_81638AC + pop {r0} + bx r0 + .align 2, 0 +_081A7574: .4byte 0x0861231c +_081A7578: .4byte 0x03001294 +_081A757C: .4byte 0x086123e4 + thumb_func_end sub_81A7508 + + thumb_func_start sub_81A7580 +sub_81A7580: @ 81A7580 + push {lr} + ldr r0, _081A7590 + movs r1, 0x2 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081A7590: .4byte sub_81A7EE4 + 1 + thumb_func_end sub_81A7580 + + thumb_func_start sub_81A7594 +sub_81A7594: @ 81A7594 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r4, 0 + movs r1, 0 +_081A759E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A759E + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r2, r0, 16 + mov r1, sp + strb r0, [r1] + mov r0, sp + lsrs r2, 24 + strb r2, [r0, 0x1] + adds r0, r5, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 +_081A75DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r4, 0 + bl move_get_pp_info + mov r1, sp + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r5, 0 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A75DA + mov r0, sp + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + adds r0, r5, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A7594 + + thumb_func_start sub_81A7628 +sub_81A7628: @ 81A7628 + push {r4,lr} + adds r4, r1, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r4, 0x20 + beq _081A7652 + cmp r4, 0x20 + bhi _081A7648 + cmp r4, 0x7 + beq _081A7664 + cmp r4, 0x10 + beq _081A7658 + b _081A7674 +_081A7648: + cmp r4, 0x40 + beq _081A765E + cmp r4, 0x80 + beq _081A766E + b _081A7674 +_081A7652: + cmp r0, 0x28 + bne _081A7674 + b _081A7672 +_081A7658: + cmp r0, 0x29 + bne _081A7674 + b _081A7672 +_081A765E: + cmp r0, 0x7 + bne _081A7674 + b _081A7672 +_081A7664: + cmp r0, 0xF + beq _081A7672 + cmp r0, 0x48 + bne _081A7674 + b _081A7672 +_081A766E: + cmp r0, 0x11 + bne _081A7674 +_081A7672: + movs r1, 0x1 +_081A7674: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7628 + + thumb_func_start sub_81A767C +sub_81A767C: @ 81A767C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r3, 0 + cmp r1, 0x20 + beq _081A76C4 + cmp r1, 0x20 + bhi _081A7696 + cmp r1, 0x7 + beq _081A771C + cmp r1, 0x10 + beq _081A7704 + b _081A771C +_081A7696: + cmp r1, 0x40 + beq _081A76E0 + cmp r1, 0x80 + bne _081A771C + ldr r1, _081A76C0 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x8 + beq _081A771A + cmp r2, 0x3 + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x8 + beq _081A771A + cmp r0, 0x3 + bne _081A771C + b _081A771A + .align 2, 0 +_081A76C0: .4byte 0x083203cc +_081A76C4: + ldr r0, _081A76DC + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xF + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xF + bne _081A771C + b _081A771A + .align 2, 0 +_081A76DC: .4byte 0x083203cc +_081A76E0: + ldr r1, _081A7700 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x4 + beq _081A771A + cmp r2, 0xD + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x4 + beq _081A771A + cmp r0, 0xD + bne _081A771C + b _081A771A + .align 2, 0 +_081A7700: .4byte 0x083203cc +_081A7704: + ldr r0, _081A7724 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xA + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xA + bne _081A771C +_081A771A: + movs r3, 0x1 +_081A771C: + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_081A7724: .4byte 0x083203cc + thumb_func_end sub_81A767C + + thumb_func_start sub_81A7728 +sub_81A7728: @ 81A7728 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r6, 0 +_081A7736: + mov r1, sp + adds r0, r1, r6 + strb r6, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7736 + movs r4, 0 + mov r8, r4 +_081A774A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + adds r2, r1, r6 + ldrb r3, [r2] + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x9 + bls _081A774A + ldr r0, _081A77D0 + ldr r0, [r0] + ldr r4, _081A77D4 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x1 + mov r10, r1 + cmp r0, 0x4 + bls _081A77A8 + movs r4, 0x3 + mov r10, r4 + cmp r0, 0x9 + bhi _081A77A8 + movs r0, 0x2 + mov r10, r0 +_081A77A8: + movs r1, 0 + str r1, [sp, 0x4] + ldr r7, _081A77D8 +_081A77AE: + movs r4, 0 + mov r9, r4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x22 + bhi _081A77DC + movs r0, 0x80 + b _081A77FC + .align 2, 0 +_081A77D0: .4byte 0x03005d90 +_081A77D4: .4byte 0x00000cb2 +_081A77D8: .4byte 0x03001290 +_081A77DC: + cmp r0, 0x3B + bhi _081A77E4 + movs r0, 0x20 + b _081A77FC +_081A77E4: + cmp r0, 0x4F + bhi _081A77EC + movs r0, 0x40 + b _081A77FC +_081A77EC: + cmp r1, 0x59 + bhi _081A77FA + movs r0, 0x7 + b _081A77FC +_081A77F4: + movs r0, 0x1 + mov r9, r0 + b _081A786E +_081A77FA: + movs r0, 0x10 +_081A77FC: + str r0, [r7] + ldr r0, _081A7890 + ldr r0, [r0] + ldr r1, [sp, 0x4] + cmp r1, r0 + beq _081A7874 + str r0, [sp, 0x4] + movs r4, 0 + mov r8, r4 + movs r6, 0 +_081A7810: + mov r1, sp + adds r0, r1, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081A7894 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7860 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081A7860 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + beq _081A77F4 +_081A7860: + cmp r8, r10 + beq _081A786E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7810 +_081A786E: + mov r4, r8 + cmp r4, 0 + beq _081A78CC +_081A7874: + mov r0, r9 + cmp r0, 0 + beq _081A77AE + ldr r0, _081A7890 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A7898 + cmp r0, 0x20 + bhi _081A78D0 + cmp r0, 0x7 + beq _081A78D0 + cmp r0, 0x10 + beq _081A78A4 + b _081A78D0 + .align 2, 0 +_081A7890: .4byte 0x03001290 +_081A7894: .4byte 0x020244ec +_081A7898: + ldr r1, _081A78A0 + movs r0, 0x1 + b _081A78D4 + .align 2, 0 +_081A78A0: .4byte 0x0300128d +_081A78A4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r1, r0, 16 + movs r2, 0x1 + ands r1, r2 + cmp r1, 0 + beq _081A78C0 + ldr r0, _081A78BC + strb r2, [r0] + b _081A78D6 + .align 2, 0 +_081A78BC: .4byte 0x0300128d +_081A78C0: + ldr r0, _081A78C8 + strb r1, [r0] + b _081A78D6 + .align 2, 0 +_081A78C8: .4byte 0x0300128d +_081A78CC: + movs r0, 0 + b _081A7956 +_081A78D0: + ldr r1, _081A7968 + movs r0, 0 +_081A78D4: + strb r0, [r1] +_081A78D6: + movs r1, 0 + mov r8, r1 + movs r6, 0 +_081A78DC: + mov r4, sp + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081A796C + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081A7946 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, _081A7970 + ldr r1, [r7] + adds r0, r5, 0 + bl sub_81A7628 + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x37 + adds r2, r7, 0 + bl pokemon_setattr +_081A7946: + cmp r8, r10 + beq _081A7954 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A78DC +_081A7954: + movs r0, 0x1 +_081A7956: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081A7968: .4byte 0x0300128d +_081A796C: .4byte 0x020244ec +_081A7970: .4byte 0x03001290 + thumb_func_end sub_81A7728 + + thumb_func_start sub_81A7974 +sub_81A7974: @ 81A7974 + push {r4-r7,lr} + ldr r0, _081A7994 + ldr r0, [r0] + ldr r1, _081A7998 + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x1 + cmp r0, 0x4 + bls _081A798E + movs r7, 0x3 + cmp r0, 0x9 + bhi _081A798E + movs r7, 0x2 +_081A798E: + movs r6, 0 + movs r5, 0 + b _081A79A2 + .align 2, 0 +_081A7994: .4byte 0x03005d90 +_081A7998: .4byte 0x00000cb2 +_081A799C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081A79A2: + cmp r5, 0x2 + bhi _081A79D8 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081A79E0 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A79D4 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081A79D4 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A79D4: + cmp r6, r7 + bne _081A799C +_081A79D8: + cmp r6, 0 + beq _081A79E4 + movs r0, 0x1 + b _081A79E6 + .align 2, 0 +_081A79E0: .4byte 0x020244ec +_081A79E4: + movs r0, 0 +_081A79E6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A7974 + + thumb_func_start sub_81A79EC +sub_81A79EC: @ 81A79EC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, _081A7A0C + ldr r0, [r1] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r2, [r0] + movs r3, 0x78 + ands r3, r2 + adds r5, r1, 0 + cmp r3, 0x40 + bne _081A7A10 + lsls r0, r2, 25 + lsrs r0, 28 + b _081A7B48 + .align 2, 0 +_081A7A0C: .4byte 0x03005d90 +_081A7A10: + ldr r0, _081A7A30 + lsls r1, r2, 29 + ldrh r0, [r0] + lsrs r1, 29 + cmp r0, r1 + bne _081A7A34 + cmp r3, 0x18 + bne _081A7A24 + bl sub_81A7728 +_081A7A24: + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + b _081A7B48 + .align 2, 0 +_081A7A30: .4byte 0x020375e6 +_081A7A34: + movs r2, 0 + ldr r3, _081A7B50 + movs r1, 0 +_081A7A3A: + mov r4, sp + adds r0, r4, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A3A + movs r4, 0x8 + ldr r0, [r5] + movs r6, 0xE1 + lsls r6, 4 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r3 + ldrb r1, [r0] + movs r2, 0 + adds r5, r3, 0 + movs r3, 0x1 +_081A7A64: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r1 + bne _081A7A78 + mov r6, sp + adds r0, r6, r2 + strb r3, [r0] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7A78: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A64 + mov r0, sp + ldrb r0, [r0, 0x7] + cmp r0, 0x1 + beq _081A7AA0 + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A7AA0 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x7] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AA0: + mov r0, sp + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _081A7ABE + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A7ABE + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x3] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7ABE: + ldr r0, _081A7B54 + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A7AFA + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _081A7AE6 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x1] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AE6: + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + beq _081A7AFA + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x4] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AFA: + adds r0, r4, 0 + bl malloc_and_clear + adds r5, r0, 0 + movs r3, 0 + movs r2, 0 +_081A7B06: + mov r6, sp + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081A7B1C + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] +_081A7B1C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7B06 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r4, [r0] + adds r0, r5, 0 + bl free + cmp r4, 0x3 + bne _081A7B46 + bl sub_81A7728 +_081A7B46: + adds r0, r4, 0 +_081A7B48: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081A7B50: .4byte 0x0861266c +_081A7B54: .4byte 0x03005d90 + thumb_func_end sub_81A79EC + + thumb_func_start sub_81A7B58 +sub_81A7B58: @ 81A7B58 + push {r4,lr} + ldr r4, _081A7B7C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl __umodsi3 + strb r0, [r4] + ldr r1, _081A7B80 + ldrb r0, [r4] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081A7B7C: .4byte 0x03001294 +_081A7B80: .4byte 0x0861231c + thumb_func_end sub_81A7B58 + + thumb_func_start sub_81A7B84 +sub_81A7B84: @ 81A7B84 + ldr r0, _081A7B8C + ldrb r0, [r0] + bx lr + .align 2, 0 +_081A7B8C: .4byte 0x0300128e + thumb_func_end sub_81A7B84 + + thumb_func_start sub_81A7B90 +sub_81A7B90: @ 81A7B90 + 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 + bl sub_81A7D00 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _081A7C0C + ldr r0, [r7] + ldr r4, _081A7C10 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, _081A7C14 + lsrs r0, 28 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x4] + ldr r0, _081A7C18 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_81A890C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A7C1C + bl sub_8165CB4 + adds r7, r0, 0 + cmp r7, 0x3B + ble _081A7C08 + lsls r0, r6, 2 + ldr r1, [sp, 0x4] + adds r0, r1 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + subs r7, r0 + cmp r7, 0x3B + bgt _081A7C32 +_081A7C08: + movs r7, 0x3C + b _081A7C32 + .align 2, 0 +_081A7C0C: .4byte 0x03005d90 +_081A7C10: .4byte 0x00000ca9 +_081A7C14: .4byte 0x08612314 +_081A7C18: .4byte 0x02024744 +_081A7C1C: + lsls r0, r6, 2 + ldr r2, [sp, 0x4] + adds r0, r2 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x32 + subs r7, r0, r1 +_081A7C32: + mov r0, r8 + cmp r0, 0x1 + bne _081A7C4A + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_81A88B0 + lsls r0, 24 + cmp r0, 0 + bne _081A7C4A + movs r0, 0 + b _081A7CE2 +_081A7C4A: + ldr r0, _081A7CF4 + ldr r1, _081A7CF8 + mov r8, r1 + lsls r6, 2 + mov r9, r6 + ldr r2, [sp, 0x4] + add r2, r9 + mov r10, r2 + ldr r1, [r2] + lsls r6, r5, 1 + adds r4, r6, r5 + lsls r4, 2 + adds r1, r4, r1 + ldrh r2, [r1] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r2, r1 + lsls r1, r7, 2 + ldr r3, _081A7CFC + adds r1, r3 + adds r2, r1 + movs r1, 0x19 + bl pokemon_setattr + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x17] + mov r7, r9 + cmp r0, 0 + beq _081A7CA8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 +_081A7CA8: + str r0, [sp] + ldr r0, _081A7CF4 + movs r1, 0x2E + mov r2, sp + bl pokemon_setattr + movs r4, 0 + adds r0, r6, r5 + lsls r6, r0, 2 +_081A7CBA: + ldr r2, [sp, 0x4] + adds r0, r7, r2 + ldr r0, [r0] + adds r0, r6, r0 + lsls r1, r4, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, _081A7CF4 + bl sub_80691F4 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A7CBA + ldr r0, _081A7CF4 + bl pokemon_calc_effective_stats + movs r0, 0x1 +_081A7CE2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081A7CF4: .4byte 0x02024744 +_081A7CF8: .4byte 0x083203cc +_081A7CFC: .4byte 0x0831f72c + thumb_func_end sub_81A7B90 + + thumb_func_start sub_81A7D00 +sub_81A7D00: @ 81A7D00 + push {lr} + ldr r0, _081A7D28 + ldr r1, [r0] + ldr r2, _081A7D2C + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, _081A7D30 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + adds r2, r1, 0 + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bhi _081A7D34 + movs r1, 0 + b _081A7D4C + .align 2, 0 +_081A7D28: .4byte 0x03005d90 +_081A7D2C: .4byte 0x00000ca9 +_081A7D30: .4byte 0x00000e04 +_081A7D34: + movs r0, 0x8C + lsls r0, 2 + cmp r1, r0 + bhi _081A7D40 + movs r1, 0x1 + b _081A7D4C +_081A7D40: + movs r0, 0xD2 + lsls r0, 2 + movs r1, 0x3 + cmp r2, r0 + bhi _081A7D4C + movs r1, 0x2 +_081A7D4C: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81A7D00 + + thumb_func_start sub_81A7D54 +sub_81A7D54: @ 81A7D54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _081A7D84 + ldr r2, _081A7D88 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081A7D66: + 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 _081A7D66 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A7D84: .4byte 0x08612688 +_081A7D88: .4byte 0x03005e00 + thumb_func_end sub_81A7D54 + + thumb_func_start sub_81A7D8C +sub_81A7D8C: @ 81A7D8C + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7DA4 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7DC8 +_081A7DA4: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081A7DBC + movs r0, 0x10 + strh r0, [r4, 0x16] +_081A7DBC: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, _081A7DE4 + bl sub_80A2A20 +_081A7DC8: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0xF + ble _081A7DDA + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] +_081A7DDA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081A7DE4: .4byte 0x00002d6b + thumb_func_end sub_81A7D8C + + thumb_func_start sub_81A7DE8 +sub_81A7DE8: @ 81A7DE8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7E00 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7E22 +_081A7E00: + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + bge _081A7E16 + movs r0, 0 + strh r0, [r4, 0x16] +_081A7E16: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, _081A7E48 + bl sub_80A2A20 +_081A7E22: + movs r0, 0x16 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081A7E56 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _081A7E50 + ldr r0, _081A7E4C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + b _081A7E56 + .align 2, 0 +_081A7E48: .4byte 0x00002d6b +_081A7E4C: .4byte sub_81A7D54 + 1 +_081A7E50: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + strh r1, [r4, 0x8] +_081A7E56: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7DE8 + + thumb_func_start sub_81A7E60 +sub_81A7E60: @ 81A7E60 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r3, [sp, 0x18] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r0, _081A7EBC + movs r1, 0x3 + str r3, [sp] + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081A7EC0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x10] + ldr r3, [sp] + strh r3, [r1, 0x12] + strh r0, [r1, 0x14] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A7EBC: .4byte sub_81A7D54 + 1 +_081A7EC0: .4byte 0x03005e00 + thumb_func_end sub_81A7E60 + + thumb_func_start sub_81A7EC4 +sub_81A7EC4: @ 81A7EC4 + push {lr} + ldr r0, _081A7ED8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081A7EDC + movs r0, 0 + b _081A7EDE + .align 2, 0 +_081A7ED8: .4byte sub_81A7D54 + 1 +_081A7EDC: + movs r0, 0x1 +_081A7EDE: + pop {r1} + bx r1 + thumb_func_end sub_81A7EC4 + + thumb_func_start sub_81A7EE4 +sub_81A7EE4: @ 81A7EE4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, _081A7F18 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081A7F1C + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_81A7E60 + b _081A7F30 + .align 2, 0 +_081A7F18: .4byte 0x03005e00 +_081A7F1C: + bl sub_81A7EC4 + lsls r0, 24 + cmp r0, 0 + beq _081A7F30 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_081A7F30: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A7EE4 + + thumb_func_start sub_81A7F38 +sub_81A7F38: @ 81A7F38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + bne _081A7F50 + b _081A807A +_081A7F50: + movs r0, 0 + mov r8, r0 +_081A7F54: + mov r0, sp + add r0, r8 + mov r1, r8 + strb r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7F54 + movs r5, 0 +_081A7F6C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + mov r2, sp + add r2, r8 + ldrb r3, [r2] + mov r0, sp + adds r1, r0, r4 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081A7F6C + movs r1, 0 + mov r8, r1 +_081A7FB0: + movs r0, 0 + mov r10, r0 + mov r4, sp + add r4, r8 + ldrb r1, [r4] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081A7FF8 + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + str r4, [sp, 0x8] + cmp r5, r6 + bcc _081A8044 + adds r0, r7, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + beq _081A7FFC + movs r0, 0x1 + mov r10, r0 + b _081A8048 + .align 2, 0 +_081A7FF8: .4byte 0x020244ec +_081A7FFC: + adds r0, r7, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + b _081A8014 +_081A800E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A8014: + cmp r4, 0x3 + bhi _081A8048 + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r1, r9 + adds r2, r4, 0 + bl move_get_pp_info + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r6 + bcs _081A800E +_081A8044: + movs r1, 0x1 + mov r10, r1 +_081A8048: + mov r0, r10 + cmp r0, 0x1 + bne _081A806C + ldr r0, [sp, 0x8] + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081A808C + adds r0, r1 + bl sub_81A7594 + ldr r0, [sp, 0x4] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + beq _081A807A +_081A806C: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7FB0 +_081A807A: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A808C: .4byte 0x020244ec + thumb_func_end sub_81A7F38 + + thumb_func_start sub_81A8090 +sub_81A8090: @ 81A8090 + push {r4,lr} + ldr r4, _081A80A4 + bl sub_81A80A8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A80A4: .4byte 0x020375f0 + thumb_func_end sub_81A8090 + + thumb_func_start sub_81A80A8 +sub_81A80A8: @ 81A80A8 + push {lr} + movs r2, 0 + ldr r0, _081A80D4 + ldrh r1, [r0, 0x12] + ldr r3, _081A80D8 + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _081A80CA + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + beq _081A80CA + adds r0, 0x1 + cmp r1, r0 + bne _081A80CC +_081A80CA: + movs r2, 0x1 +_081A80CC: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_081A80D4: .4byte 0x02037318 +_081A80D8: .4byte 0xfffffea1 + thumb_func_end sub_81A80A8 + + thumb_func_start sub_81A80DC +sub_81A80DC: @ 81A80DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _081A8130 + movs r0, 0 + strh r0, [r4] + movs r0, 0x1 + bl sub_81A8590 + lsls r0, 24 + cmp r0, 0 + beq _081A8138 + movs r0, 0x1 + strh r0, [r4] + bl GenerateRandomNumber + ldr r5, _081A8134 + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r2, [r5] + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x40 + b _081A8248 + .align 2, 0 +_081A8130: .4byte 0x020375f0 +_081A8134: .4byte 0x03005d90 +_081A8138: + bl GenerateRandomNumber + ldr r7, _081A81AC + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r7] + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + movs r6, 0x8 + cmp r0, 0 + beq _081A8172 + movs r6, 0x6 +_081A8172: + adds r0, r6, 0 + bl malloc_and_clear + adds r5, r0, 0 + movs r2, 0 + movs r3, 0 + cmp r2, r6 + bcs _081A81BE + adds r4, r7, 0 +_081A8184: + ldr r0, [r4] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A81B0 + cmp r2, 0x1 + beq _081A81B4 + cmp r2, 0x4 + beq _081A81B4 + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] + b _081A81B4 + .align 2, 0 +_081A81AC: .4byte 0x03005d90 +_081A81B0: + adds r0, r5, r2 + strb r2, [r0] +_081A81B4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r6 + bcc _081A8184 +_081A81BE: + bl GenerateRandomNumber + ldr r7, _081A8258 + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r0, [r0] + movs r6, 0xE1 + lsls r6, 4 + adds r4, r6 + movs r1, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r4] + movs r0, 0x79 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + adds r0, r5, 0 + bl free + ldr r0, [r7] + adds r0, r6 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x18 + bne _081A821C + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A821C + ldr r2, [r7] + adds r2, r6 + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] +_081A821C: + ldr r5, _081A8258 + ldr r0, [r5] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x38 + bne _081A824C + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A824C + ldr r2, [r5] + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 +_081A8248: + orrs r0, r1 + strb r0, [r2] +_081A824C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A8258: .4byte 0x03005d90 + thumb_func_end sub_81A80DC + + thumb_func_start sub_81A825C +sub_81A825C: @ 81A825C + ldr r1, _081A8274 + ldr r0, _081A8278 + ldr r0, [r0] + movs r2, 0xE1 + lsls r2, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + strh r0, [r1] + bx lr + .align 2, 0 +_081A8274: .4byte 0x020375f0 +_081A8278: .4byte 0x03005d90 + thumb_func_end sub_81A825C + + thumb_func_start sub_81A827C +sub_81A827C: @ 81A827C + ldr r2, _081A8298 + ldr r1, _081A829C + ldr r0, _081A82A0 + ldr r0, [r0] + movs r3, 0xE1 + lsls r3, 4 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_081A8298: .4byte 0x020375f0 +_081A829C: .4byte 0x0861266c +_081A82A0: .4byte 0x03005d90 + thumb_func_end sub_81A827C + + thumb_func_start sub_81A82A4 +sub_81A82A4: @ 81A82A4 + push {r4-r7,lr} + lsls r0, 24 + movs r7, 0x6 + cmp r0, 0 + bne _081A82B0 + movs r7, 0x1 +_081A82B0: + ldr r4, _081A82F8 + ldr r1, [r4] + ldr r2, _081A82FC + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, _081A8300 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, r4, 0 +_081A82D2: + lsls r0, r6, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, _081A8304 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A831A + ldr r0, _081A8308 + adds r1, r0 + b _081A8314 + .align 2, 0 +_081A82F8: .4byte 0x03005d90 +_081A82FC: .4byte 0x00000ca9 +_081A8300: .4byte 0x00000e04 +_081A8304: .4byte 0x00000cb2 +_081A8308: .4byte 0x00000cb4 +_081A830C: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A831A +_081A8314: + ldrh r0, [r1] + cmp r0, r4 + bne _081A830C +_081A831A: + ldr r0, [r5] + ldr r1, _081A835C + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A82D2 + ldr r5, _081A8360 + strh r4, [r5] + ldr r1, _081A8364 + ldr r0, _081A8368 + str r0, [r1] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, _081A836C + ldr r1, [r0] + ldr r0, _081A835C + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A8356 + subs r0, 0x1 + lsls r0, 1 + ldr r2, _081A8370 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8356: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A835C: .4byte 0x00000cb2 +_081A8360: .4byte 0x02038bca +_081A8364: .4byte 0x0203bc88 +_081A8368: .4byte 0x085d5acc +_081A836C: .4byte 0x03005d90 +_081A8370: .4byte 0x00000cb4 + thumb_func_end sub_81A82A4 + + thumb_func_start sub_81A8374 +sub_81A8374: @ 81A8374 + push {r4-r7,lr} + ldr r4, _081A83C4 + ldr r1, [r4] + ldr r2, _081A83C8 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, _081A83CC + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, _081A83D0 + ldr r0, _081A83D4 + str r0, [r1] + lsls r7, r5, 24 + adds r6, r4, 0 +_081A83A0: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r6] + ldr r2, _081A83D8 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A83EE + ldr r0, _081A83DC + adds r1, r0 + b _081A83E8 + .align 2, 0 +_081A83C4: .4byte 0x03005d90 +_081A83C8: .4byte 0x00000ca9 +_081A83CC: .4byte 0x00000e04 +_081A83D0: .4byte 0x0203bc88 +_081A83D4: .4byte 0x085d5acc +_081A83D8: .4byte 0x00000cb2 +_081A83DC: .4byte 0x00000cb4 +_081A83E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A83EE +_081A83E8: + ldrh r0, [r1] + cmp r0, r4 + bne _081A83E0 +_081A83EE: + ldr r0, [r6] + ldr r1, _081A84A0 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A83A0 + ldr r5, _081A84A4 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r3, _081A84A8 + ldr r1, [r3] + ldr r0, _081A84A0 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xE + bhi _081A8424 + subs r0, 0x1 + lsls r0, 1 + ldr r2, _081A84AC + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8424: + adds r5, r3, 0 +_081A8426: + lsrs r0, r7, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, _081A84A0 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r3, r0 + bge _081A8466 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _081A8466 + ldr r0, _081A84A8 + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, _081A84AC + adds r1, r0 +_081A8458: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A8466 + ldrh r0, [r1] + cmp r0, r4 + bne _081A8458 +_081A8466: + ldr r0, [r5] + ldr r1, _081A84A0 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _081A8426 + ldr r5, _081A84B0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x1 + bl sub_8162614 + ldr r0, _081A84A8 + ldr r1, [r0] + ldr r0, _081A84A0 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A849A + subs r0, 0x2 + lsls r0, 1 + ldr r2, _081A84AC + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A849A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A84A0: .4byte 0x00000cb2 +_081A84A4: .4byte 0x02038bca +_081A84A8: .4byte 0x03005d90 +_081A84AC: .4byte 0x00000cb4 +_081A84B0: .4byte 0x02038bcc + thumb_func_end sub_81A8374 + + thumb_func_start sub_81A84B4 +sub_81A84B4: @ 81A84B4 + push {r4,r5,lr} + movs r2, 0 + ldr r5, _081A84E0 + ldr r4, _081A84E4 + ldr r0, _081A84E8 + adds r3, r0, 0 +_081A84C0: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xD + bls _081A84C0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A84E0: .4byte 0x03005d90 +_081A84E4: .4byte 0x00000cb4 +_081A84E8: .4byte 0x0000ffff + thumb_func_end sub_81A84B4 + + thumb_func_start sub_81A84EC +sub_81A84EC: @ 81A84EC + push {lr} + ldr r0, _081A8514 + ldrh r0, [r0] + cmp r0, 0 + bne _081A8524 + ldr r3, _081A8518 + ldrh r1, [r3] + ldr r0, _081A851C + cmp r1, r0 + bhi _081A8542 + ldr r2, _081A8520 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC + b _081A8542 + .align 2, 0 +_081A8514: .4byte 0x020375e2 +_081A8518: .4byte 0x02038bca +_081A851C: .4byte 0x0000012b +_081A8520: .4byte 0x0203bc88 +_081A8524: + cmp r0, 0x1 + bne _081A8542 + ldr r3, _081A8548 + ldrh r1, [r3] + ldr r0, _081A854C + cmp r1, r0 + bhi _081A8542 + ldr r2, _081A8550 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC +_081A8542: + pop {r0} + bx r0 + .align 2, 0 +_081A8548: .4byte 0x02038bcc +_081A854C: .4byte 0x0000012b +_081A8550: .4byte 0x0203bc88 + thumb_func_end sub_81A84EC + + thumb_func_start sub_81A8554 +sub_81A8554: @ 81A8554 + push {r4-r6,lr} + ldr r5, _081A8584 + movs r6, 0 + movs r4, 0 +_081A855C: + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081A856E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A856E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, 0x64 + cmp r4, 0x2 + bls _081A855C + cmp r6, 0x1 + bhi _081A8588 + movs r0, 0x1 + b _081A858A + .align 2, 0 +_081A8584: .4byte 0x020244ec +_081A8588: + movs r0, 0 +_081A858A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8554 + + thumb_func_start sub_81A8590 +sub_81A8590: @ 81A8590 + push {r4-r6,lr} + lsls r0, 24 + movs r6, 0 + ldr r1, _081A85E0 + ldr r2, [r1] + ldr r3, _081A85E4 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r3, _081A85E8 + adds r2, r3 + adds r2, r1 + lsrs r4, r0, 24 + ldrh r2, [r2] + adds r0, r4, r2 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x5 + bl sub_81A3B30 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + blt _081A85F0 + cmp r2, 0x1 + bgt _081A85F0 + ldr r1, _081A85EC + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r1, 0x17] + subs r0, r1 + cmp r4, r0 + bne _081A8634 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _081A8634 + .align 2, 0 +_081A85E0: .4byte 0x03005d90 +_081A85E4: .4byte 0x00000ca9 +_081A85E8: .4byte 0x00000e04 +_081A85EC: .4byte 0x086125dc +_081A85F0: + ldr r5, _081A860C + movs r0, 0x5 + lsls r3, r0, 2 + adds r0, r3, r5 + ldrb r1, [r0] + adds r0, r5, 0x3 + adds r0, r3, r0 + ldrb r2, [r0] + subs r1, r2 + cmp r4, r1 + bne _081A8610 + movs r6, 0x3 + b _081A8634 + .align 2, 0 +_081A860C: .4byte 0x086125dc +_081A8610: + adds r0, r5, 0x1 + adds r0, r3, r0 + ldrb r1, [r0] + subs r0, r1, r2 + cmp r4, r0 + beq _081A8632 + cmp r4, r1 + bls _081A8634 + subs r0, r4, r1 + adds r0, r2 + adds r1, r5, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A8634 +_081A8632: + movs r6, 0x4 +_081A8634: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8590 + + thumb_func_start sub_81A863C +sub_81A863C: @ 81A863C + push {r4,lr} + ldr r4, _081A8654 + movs r0, 0 + bl sub_81A8590 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A8654: .4byte 0x020375f0 + thumb_func_end sub_81A863C + + thumb_func_start sub_81A8658 +sub_81A8658: @ 81A8658 + push {r4,lr} + ldr r3, _081A868C + ldr r2, _081A8690 + ldr r0, _081A8694 + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + lsls r0, r1, 1 + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + adds r0, r3 + ldrb r4, [r0] + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, _081A8698 + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A868C: .4byte 0x08612675 +_081A8690: .4byte 0x020375e6 +_081A8694: .4byte 0x03005d90 +_081A8698: .4byte 0x020375f0 + thumb_func_end sub_81A8658 + + thumb_func_start sub_81A869C +sub_81A869C: @ 81A869C + ldr r0, _081A86B8 + ldr r2, [r0] + ldr r0, _081A86BC + ldrb r1, [r0] + movs r0, 0xE1 + lsls r0, 4 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .align 2, 0 +_081A86B8: .4byte 0x03005d90 +_081A86BC: .4byte 0x020375e2 + thumb_func_end sub_81A869C + + thumb_func_start sub_81A86C0 +sub_81A86C0: @ 81A86C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, _081A8724 + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r10, r0 +_081A86D4: + movs r0, 0 + mov r9, r0 + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, _081A8728 + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, r5 + bcc _081A8762 + adds r0, r7, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A8762 + adds r0, r7, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + b _081A8732 + .align 2, 0 +_081A8724: .4byte 0x020375f0 +_081A8728: .4byte 0x020244ec +_081A872C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A8732: + cmp r6, 0x3 + bhi _081A8766 + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + adds r2, r6, 0 + bl move_get_pp_info + lsls r0, 24 + lsrs r5, r0, 24 + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bcs _081A872C +_081A8762: + movs r0, 0x1 + mov r9, r0 +_081A8766: + mov r0, r9 + cmp r0, 0x1 + bne _081A8778 + ldr r1, _081A8774 + movs r0, 0 + strh r0, [r1] + b _081A8786 + .align 2, 0 +_081A8774: .4byte 0x020375f0 +_081A8778: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x2 + bls _081A86D4 +_081A8786: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A86C0 + + thumb_func_start sub_81A8794 +sub_81A8794: @ 81A8794 + push {r4-r7,lr} + movs r5, 0 + ldr r7, _081A87D8 + ldr r6, _081A87DC +_081A879C: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, _081A87E0 + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r2, 0xEA + lsls r2, 1 + adds r1, r2 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + ldr r1, [r6] + ldr r2, _081A87E4 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A879C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A87D8: .4byte 0x03005d8c +_081A87DC: .4byte 0x03005d90 +_081A87E0: .4byte 0x00000caa +_081A87E4: .4byte 0x00000e12 + thumb_func_end sub_81A8794 + + thumb_func_start sub_81A87E8 +sub_81A87E8: @ 81A87E8 + push {r4,lr} + movs r4, 0 +_081A87EC: + ldr r0, _081A8820 + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, _081A8824 + adds r0, r2, r1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081A8828 + adds r0, r1 + ldr r1, _081A882C + adds r3, r1 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A87EC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A8820: .4byte 0x03005d90 +_081A8824: .4byte 0x00000caa +_081A8828: .4byte 0x02024488 +_081A882C: .4byte 0x00000e12 + thumb_func_end sub_81A87E8 + + thumb_func_start sub_81A8830 +sub_81A8830: @ 81A8830 + push {r4-r6,lr} + ldr r3, _081A888C + ldr r1, [r3] + ldr r2, _081A8890 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _081A8894 + adds r1, r0 + movs r4, 0 + strb r4, [r1] + ldr r1, [r3] + ldr r6, _081A8898 + adds r0, r1, r6 + strh r4, [r0] + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r3, [r3] + ldr r0, _081A889C + adds r2, r3, r0 + ldr r1, _081A88A0 + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081A887C + lsls r1, r5, 1 + ldr r2, _081A88A4 + adds r0, r3, r2 + adds r0, r1 + strh r4, [r0] +_081A887C: + ldr r0, _081A88A8 + strh r4, [r0] + ldr r1, _081A88AC + movs r0, 0 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A888C: .4byte 0x03005d90 +_081A8890: .4byte 0x00000ca9 +_081A8894: .4byte 0x00000ca8 +_081A8898: .4byte 0x00000cb2 +_081A889C: .4byte 0x00000cdc +_081A88A0: .4byte 0x08612690 +_081A88A4: .4byte 0x00000e04 +_081A88A8: .4byte 0x02038bca +_081A88AC: .4byte 0x0202433a + thumb_func_end sub_81A8830 + + thumb_func_start sub_81A88B0 +sub_81A88B0: @ 81A88B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081A8900 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _081A8904 + adds r0, r4, 0 + bl sub_806B6D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _081A88D6 + cmp r0, 0x16 + bne _081A8904 +_081A88D6: + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081A8904 + subs r0, 0x5 + cmp r5, r0 + bgt _081A8904 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A8904 + movs r0, 0 + b _081A8906 + .align 2, 0 +_081A8900: .4byte 0x020244ec +_081A8904: + movs r0, 0x1 +_081A8906: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A88B0 + + thumb_func_start sub_81A890C +sub_81A890C: @ 81A890C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _081A891C + cmp r2, r0 + bne _081A8920 + movs r1, 0 + b _081A892A + .align 2, 0 +_081A891C: .4byte 0x0000017b +_081A8920: + ldr r0, _081A8930 + movs r1, 0x2 + cmp r2, r0 + bne _081A892A + movs r1, 0x1 +_081A892A: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_081A8930: .4byte 0x00000149 + thumb_func_end sub_81A890C + + thumb_func_start sub_81A8934 +sub_81A8934: @ 81A8934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081A8958 + ldr r0, [r4] + cmp r0, 0 + bne _081A894A + movs r0, 0x44 + bl malloc_and_clear + str r0, [r4] +_081A894A: + ldr r0, [r4] + adds r0, 0x41 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A8958: .4byte 0x0203ce50 + thumb_func_end sub_81A8934 + + thumb_func_start sub_81A895C +sub_81A895C: @ 81A895C + push {r4,lr} + ldr r4, _081A8998 + ldr r0, [r4] + cmp r0, 0 + beq _081A896E + bl free + movs r0, 0 + str r0, [r4] +_081A896E: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl get_npc_id_by_local_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081A899C + adds r0, r1 + bl sub_8093284 + bl sub_80D338C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A8998: .4byte 0x0203ce50 +_081A899C: .4byte 0x02037350 + thumb_func_end sub_81A895C + + thumb_func_start sub_81A89A0 +sub_81A89A0: @ 81A89A0 + 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] + ldr r0, _081A8A38 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r9, r1 + movs r3, 0 + mov r10, r3 + mov r8, r3 +_081A89C4: + mov r0, r8 + lsls r4, r0, 1 + adds r1, r4, r0 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _081A8A3C + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r2, 0xA6 + lsls r2, 2 + cmp r0, 0 + bne _081A89F8 + subs r2, 0x48 +_081A89F8: + ldr r0, _081A8A40 + cmp r1, r0 + bls _081A8AD4 + subs r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8A08 + adds r0, r1, 0x7 +_081A8A08: + asrs r2, r0, 3 + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081A8AD4 + ldr r3, [sp] + cmp r0, r3 + bne _081A8AD4 + lsls r0, r2, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _081A8AD4 + movs r1, 0 + movs r2, 0 + cmp r5, 0x1 + beq _081A8A58 + cmp r5, 0x1 + bgt _081A8A44 + cmp r5, 0 + beq _081A8A4E + b _081A8AD4 + .align 2, 0 +_081A8A38: .4byte 0x03005d8c +_081A8A3C: .4byte 0x0203ce50 +_081A8A40: .4byte 0x0000024f +_081A8A44: + cmp r5, 0x2 + beq _081A8A64 + cmp r5, 0x3 + beq _081A8A70 + b _081A8AD4 +_081A8A4E: + ldr r7, _081A8A54 + movs r1, 0x1 + b _081A8A74 + .align 2, 0 +_081A8A54: .4byte 0x08612698 +_081A8A58: + ldr r7, _081A8A60 + movs r2, 0x1 + b _081A8A74 + .align 2, 0 +_081A8A60: .4byte 0x0861269c +_081A8A64: + ldr r7, _081A8A6C + movs r1, 0xFF + b _081A8A74 + .align 2, 0 +_081A8A6C: .4byte 0x086126a0 +_081A8A70: + ldr r7, _081A8AC4 + movs r2, 0xFF +_081A8A74: + mov r3, r8 + adds r0, r4, r3 + lsls r0, 3 + mov r3, r9 + adds r4, r0, r3 + lsls r0, r1, 24 + asrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r4, 0x4] + lsls r0, r2, 24 + asrs r0, 24 + ldrh r3, [r4, 0x6] + adds r0, r3 + strh r0, [r4, 0x6] + ldrb r0, [r4] + ldr r6, _081A8AC8 + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _081A8ACC + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D60 + ldrb r4, [r4] + mov r10, r4 + mov r0, r10 + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + adds r3, r7, 0 + bl exec_movement + b _081A8AD4 + .align 2, 0 +_081A8AC4: .4byte 0x086126a4 +_081A8AC8: .4byte 0x03005d8c +_081A8ACC: + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D94 +_081A8AD4: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x3F + bhi _081A8AE4 + b _081A89C4 +_081A8AE4: + mov r0, r10 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A89A0 + + thumb_func_start sub_81A8AF8 +sub_81A8AF8: @ 81A8AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, _081A8BA4 + ldr r2, [r1] + cmp r2, 0 + bne _081A8B0C + b _081A8D4A +_081A8B0C: + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + mov r10, r3 + cmp r0, 0 + bne _081A8B22 + movs r0, 0x94 + lsls r0, 2 + mov r10, r0 +_081A8B22: + ldr r0, _081A8BA8 + ldr r0, [r0] + movs r3, 0xC7 + lsls r3, 4 + adds r7, r0, r3 + movs r0, 0 + mov r9, r0 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcc _081A8B3C + b _081A8D4A +_081A8B3C: + mov r8, r1 +_081A8B3E: + mov r1, r8 + ldr r0, [r1] + mov r2, r9 + lsls r4, r2, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r0, 16 + mov r3, r10 + subs r1, r0, r3 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8B76 + adds r0, r1, 0x7 +_081A8B76: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldrb r1, [r1] + subs r0, r1 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8B96 + cmp r1, 0x3 + bne _081A8BAC +_081A8B96: + movs r0, 0x3 + negs r0, r0 + movs r6, 0 + cmp r1, r0 + bne _081A8BB4 + b _081A8BB2 + .align 2, 0 +_081A8BA4: .4byte 0x0203ce50 +_081A8BA8: .4byte 0x03005d8c +_081A8BAC: + movs r6, 0x2 + cmp r1, 0 + ble _081A8BB4 +_081A8BB2: + movs r6, 0x1 +_081A8BB4: + ldr r5, _081A8C00 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, _081A8C04 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl get_npc_id_by_local_id + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + bne _081A8BDC + b _081A8D32 +_081A8BDC: + ldr r0, _081A8C08 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r1, r0, 0 + cmp r6, 0 + bne _081A8C9C + cmp r0, 0x2 + beq _081A8C60 + cmp r0, 0x2 + bgt _081A8C0C + cmp r0, 0x1 + beq _081A8C30 + b _081A8D32 + .align 2, 0 +_081A8C00: .4byte 0x0203ce50 +_081A8C04: .4byte 0x03005d8c +_081A8C08: .4byte 0x02037350 +_081A8C0C: + cmp r0, 0x3 + beq _081A8C48 + cmp r0, 0x4 + beq _081A8C16 + b _081A8D32 +_081A8C16: + ldr r3, _081A8C2C + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8C72 + .align 2, 0 +_081A8C2C: .4byte 0x086126ae +_081A8C30: + ldr r3, _081A8C44 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA + b _081A8C72 + .align 2, 0 +_081A8C44: .4byte 0x086126a8 +_081A8C48: + ldr r3, _081A8C5C + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8C72 + .align 2, 0 +_081A8C5C: .4byte 0x086126aa +_081A8C60: + ldr r3, _081A8C94 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 +_081A8C72: + strb r1, [r0, 0x9] + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, _081A8C98 + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + b _081A8D32 + .align 2, 0 +_081A8C94: .4byte 0x086126ac +_081A8C98: .4byte 0x03005d8c +_081A8C9C: + cmp r6, 0x1 + bne _081A8D32 + cmp r0, 0x2 + beq _081A8D00 + cmp r0, 0x2 + bgt _081A8CAE + cmp r0, 0x1 + beq _081A8CD0 + b _081A8D32 +_081A8CAE: + cmp r1, 0x3 + beq _081A8CE8 + cmp r1, 0x4 + bne _081A8D32 + ldr r3, _081A8CCC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8D12 + .align 2, 0 +_081A8CCC: .4byte 0x086126aa +_081A8CD0: + ldr r3, _081A8CE4 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 + b _081A8D12 + .align 2, 0 +_081A8CE4: .4byte 0x086126ac +_081A8CE8: + ldr r3, _081A8CFC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8D12 + .align 2, 0 +_081A8CFC: .4byte 0x086126ae +_081A8D00: + ldr r3, _081A8D58 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA +_081A8D12: + strb r1, [r0, 0x9] + mov r2, r8 + ldr r0, [r2] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, _081A8D5C + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement +_081A8D32: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcs _081A8D4A + b _081A8B3E +_081A8D4A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A8D58: .4byte 0x086126a8 +_081A8D5C: .4byte 0x03005d8c + thumb_func_end sub_81A8AF8 + + thumb_func_start sub_81A8D60 +sub_81A8D60: @ 81A8D60 + push {r4,lr} + ldr r4, _081A8D90 + ldr r3, [r4] + adds r2, r3, 0 + adds r2, 0x40 + ldrb r2, [r2] + lsls r2, 2 + adds r3, r2 + strb r0, [r3, 0x1] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0 + strb r1, [r2] + ldr r1, [r4] + adds r1, 0x40 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A8D90: .4byte 0x0203ce50 + thumb_func_end sub_81A8D60 + + thumb_func_start sub_81A8D94 +sub_81A8D94: @ 81A8D94 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, _081A8E00 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r5, r0, r1 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl cur_mapdata_get_blockid_at + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _081A8E04 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r1, 0xA6 + lsls r1, 2 + cmp r0, 0 + bne _081A8DDA + subs r1, 0x48 +_081A8DDA: + subs r1, r2, r1 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8DE4 + adds r0, r1, 0x7 +_081A8DE4: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + subs r0, r6 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8DFC + cmp r1, 0x3 + bne _081A8E08 +_081A8DFC: + movs r2, 0 + b _081A8E1A + .align 2, 0 +_081A8E00: .4byte 0x03005d8c +_081A8E04: .4byte 0x0203ce50 +_081A8E08: + cmp r1, 0 + bgt _081A8E14 + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081A8E18 +_081A8E14: + movs r2, 0x1 + b _081A8E1A +_081A8E18: + movs r2, 0x2 +_081A8E1A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrb r0, [r1, 0x9] + adds r3, r0, 0 + cmp r2, 0 + bne _081A8E4C + cmp r0, 0x8 + beq _081A8E72 + cmp r0, 0x8 + bgt _081A8E38 + cmp r0, 0x7 + beq _081A8E48 + b _081A8E76 +_081A8E38: + cmp r0, 0x9 + beq _081A8E44 + cmp r0, 0xA + bne _081A8E76 + movs r0, 0x7 + b _081A8E74 +_081A8E44: + movs r0, 0x8 + b _081A8E74 +_081A8E48: + movs r0, 0x9 + b _081A8E74 +_081A8E4C: + cmp r2, 0x1 + bne _081A8E76 + cmp r0, 0x8 + beq _081A8E6A + cmp r0, 0x8 + bgt _081A8E5E + cmp r0, 0x7 + beq _081A8E72 + b _081A8E76 +_081A8E5E: + cmp r3, 0x9 + beq _081A8E6E + cmp r3, 0xA + bne _081A8E76 + movs r0, 0x8 + b _081A8E74 +_081A8E6A: + movs r0, 0x9 + b _081A8E74 +_081A8E6E: + movs r0, 0x7 + b _081A8E74 +_081A8E72: + movs r0, 0xA +_081A8E74: + strb r0, [r1, 0x9] +_081A8E76: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A8D94 + + thumb_func_start sub_81A8E7C +sub_81A8E7C: @ 81A8E7C + push {lr} + ldr r1, _081A8E94 + ldr r0, _081A8E98 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081A8E94: .4byte 0x08613ee0 +_081A8E98: .4byte 0x020375e0 + thumb_func_end sub_81A8E7C + + thumb_func_start sub_81A8E9C +sub_81A8E9C: @ 81A8E9C + push {r4-r6,lr} + ldr r3, _081A8EDC + ldr r1, [r3] + ldr r4, _081A8EE0 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, _081A8EE4 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + ldr r6, _081A8EE8 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A8EF0 + ldr r0, [r3] + ldr r1, _081A8EEC + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 6 + b _081A8EFC + .align 2, 0 +_081A8EDC: .4byte 0x03005d90 +_081A8EE0: .4byte 0x00000ca9 +_081A8EE4: .4byte 0x00000ca8 +_081A8EE8: .4byte 0x00000cb2 +_081A8EEC: .4byte 0x00000cdc +_081A8EF0: + ldr r0, [r3] + ldr r6, _081A8F28 + adds r0, r6 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 5 +_081A8EFC: + ands r2, r0 + cmp r2, 0 + bne _081A8F14 + ldr r0, [r3] + lsls r1, r5, 1 + ldr r3, _081A8F2C + adds r0, r3 + adds r0, r1 + strh r2, [r0] + adds r0, r5, 0 + bl sub_81AAA7C +_081A8F14: + bl sub_81C4EEC + ldr r0, _081A8F30 + movs r1, 0 + strh r1, [r0] + ldr r0, _081A8F34 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A8F28: .4byte 0x00000cdc +_081A8F2C: .4byte 0x00000e1a +_081A8F30: .4byte 0x02038bca +_081A8F34: .4byte 0x0202433a + thumb_func_end sub_81A8E9C + + thumb_func_start sub_81A8F38 +sub_81A8F38: @ 81A8F38 + push {r4,lr} + ldr r1, _081A8F60 + ldr r0, [r1] + ldr r2, _081A8F64 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, _081A8F68 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + bls _081A8F54 + b _081A903A +_081A8F54: + lsls r0, 2 + ldr r1, _081A8F6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A8F60: .4byte 0x03005d90 +_081A8F64: .4byte 0x00000ca9 +_081A8F68: .4byte 0x020375e2 +_081A8F6C: .4byte _081A8F70 + .align 2, 0 +_081A8F70: + .4byte _081A8F8C + .4byte _081A8F9C + .4byte _081A8FB4 + .4byte _081A8FE4 + .4byte _081A8FF8 + .4byte _081A9010 + .4byte _081A9028 +_081A8F8C: + ldr r0, _081A8F94 + ldr r1, [r3] + ldr r3, _081A8F98 + b _081A8FFE + .align 2, 0 +_081A8F94: .4byte 0x020375f0 +_081A8F98: .4byte 0x00000e18 +_081A8F9C: + ldr r2, _081A8FAC + ldr r0, [r3] + lsls r1, r4, 1 + ldr r3, _081A8FB0 + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + b _081A9038 + .align 2, 0 +_081A8FAC: .4byte 0x020375f0 +_081A8FB0: .4byte 0x00000e1a +_081A8FB4: + cmp r4, 0 + beq _081A8FCC + ldr r2, _081A8FC4 + ldr r0, [r3] + ldr r1, _081A8FC8 + adds r0, r1 + b _081A9030 + .align 2, 0 +_081A8FC4: .4byte 0x020375f0 +_081A8FC8: .4byte 0x00000cdc +_081A8FCC: + ldr r2, _081A8FDC + ldr r0, [r3] + ldr r3, _081A8FE0 + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .align 2, 0 +_081A8FDC: .4byte 0x020375f0 +_081A8FE0: .4byte 0x00000cdc +_081A8FE4: + ldr r0, _081A8FF0 + ldr r1, [r3] + ldr r2, _081A8FF4 + adds r1, r2 + b _081A9000 + .align 2, 0 +_081A8FF0: .4byte 0x020375f0 +_081A8FF4: .4byte 0x00000e1a +_081A8FF8: + ldr r0, _081A9008 + ldr r1, [r3] + ldr r3, _081A900C +_081A8FFE: + adds r1, r3 +_081A9000: + ldrh r1, [r1] + strh r1, [r0] + b _081A903A + .align 2, 0 +_081A9008: .4byte 0x020375f0 +_081A900C: .4byte 0x00000e1c +_081A9010: + ldr r2, _081A9020 + ldr r0, [r3] + ldr r1, _081A9024 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .align 2, 0 +_081A9020: .4byte 0x020375f0 +_081A9024: .4byte 0x00000cdc +_081A9028: + ldr r2, _081A9040 + ldr r0, [r3] + ldr r3, _081A9044 + adds r0, r3 +_081A9030: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 +_081A9036: + ands r0, r1 +_081A9038: + strh r0, [r2] +_081A903A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A9040: .4byte 0x020375f0 +_081A9044: .4byte 0x00000cdc + thumb_func_end sub_81A8F38 + + thumb_func_start sub_81A9048 +sub_81A9048: @ 81A9048 + push {lr} + ldr r0, _081A906C + ldr r2, [r0] + ldr r1, _081A9070 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, _081A9074 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A9098 + cmp r0, 0x1 + bgt _081A9078 + cmp r0, 0 + beq _081A9082 + b _081A9126 + .align 2, 0 +_081A906C: .4byte 0x03005d90 +_081A9070: .4byte 0x00000ca9 +_081A9074: .4byte 0x020375e2 +_081A9078: + cmp r0, 0x2 + beq _081A90B0 + cmp r0, 0x7 + beq _081A911C + b _081A9126 +_081A9082: + ldr r0, _081A9090 + ldrh r1, [r0] + ldr r3, _081A9094 + adds r0, r2, r3 + strh r1, [r0] + b _081A9126 + .align 2, 0 +_081A9090: .4byte 0x020375e4 +_081A9094: .4byte 0x00000e18 +_081A9098: + lsls r1, 1 + ldr r3, _081A90A8 + adds r0, r2, r3 + adds r0, r1 + ldr r1, _081A90AC + ldrh r1, [r1] + strh r1, [r0] + b _081A9126 + .align 2, 0 +_081A90A8: .4byte 0x00000e1a +_081A90AC: .4byte 0x020375e4 +_081A90B0: + cmp r1, 0 + beq _081A90E4 + ldr r0, _081A90C8 + ldrh r0, [r0] + cmp r0, 0 + beq _081A90D0 + ldr r1, _081A90CC + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 6 + b _081A90F6 + .align 2, 0 +_081A90C8: .4byte 0x020375e4 +_081A90CC: .4byte 0x00000cdc +_081A90D0: + ldr r3, _081A90DC + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, _081A90E0 + b _081A910C + .align 2, 0 +_081A90DC: .4byte 0x00000cdc +_081A90E0: .4byte 0xffffdfff +_081A90E4: + ldr r0, _081A90FC + ldrh r0, [r0] + cmp r0, 0 + beq _081A9104 + ldr r1, _081A9100 + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 5 +_081A90F6: + orrs r1, r2 + str r1, [r0] + b _081A9126 + .align 2, 0 +_081A90FC: .4byte 0x020375e4 +_081A9100: .4byte 0x00000cdc +_081A9104: + ldr r3, _081A9114 + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, _081A9118 +_081A910C: + ands r1, r2 + str r1, [r0] + b _081A9126 + .align 2, 0 +_081A9114: .4byte 0x00000cdc +_081A9118: .4byte 0xffffefff +_081A911C: + ldr r0, _081A912C + ldrh r1, [r0] + ldr r3, _081A9130 + adds r0, r2, r3 + strb r1, [r0] +_081A9126: + pop {r0} + bx r0 + .align 2, 0 +_081A912C: .4byte 0x020375e4 +_081A9130: .4byte 0x00000e2a + thumb_func_end sub_81A9048 + + thumb_func_start sub_81A9134 +sub_81A9134: @ 81A9134 + push {r4,lr} + ldr r4, _081A916C + ldr r0, [r4] + ldr r1, _081A9170 + ldrh r1, [r1] + ldr r2, _081A9174 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081A9178 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl save_game_when_memory_present + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A916C: .4byte 0x03005d90 +_081A9170: .4byte 0x020375e2 +_081A9174: .4byte 0x00000ca8 +_081A9178: .4byte 0x00000ca9 + thumb_func_end sub_81A9134 + + thumb_func_start sub_81A917C +sub_81A917C: @ 81A917C + push {r4,r5,lr} + ldr r4, _081A91B8 + ldr r1, [r4] + ldr r2, _081A91BC + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, _081A91C0 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A91CC + bl GenerateRandomNumber + ldr r4, [r4] + ldr r5, _081A91C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, _081A91C8 + adds r4, r1 + b _081A91EA + .align 2, 0 +_081A91B8: .4byte 0x03005d90 +_081A91BC: .4byte 0x00000ca9 +_081A91C0: .4byte 0x00000e1a +_081A91C4: .4byte 0x08613f34 +_081A91C8: .4byte 0x00000e18 +_081A91CC: + bl GenerateRandomNumber + ldr r4, [r4] + ldr r5, _081A91F4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, _081A91F8 + adds r4, r2 +_081A91EA: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A91F4: .4byte 0x08613f28 +_081A91F8: .4byte 0x00000e18 + thumb_func_end sub_81A917C + + thumb_func_start sub_81A91FC +sub_81A91FC: @ 81A91FC + push {r4,r5,lr} + ldr r4, _081A9234 + ldr r0, [r4] + ldr r1, _081A9238 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A9244 + ldr r0, [r4] + ldr r1, _081A9238 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _081A923C + bl itemid_get_name + ldr r0, [r4] + ldr r1, _081A9238 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, _081A9240 + strh r5, [r0] + b _081A924A + .align 2, 0 +_081A9234: .4byte 0x03005d90 +_081A9238: .4byte 0x00000e18 +_081A923C: .4byte 0x02021cc4 +_081A9240: .4byte 0x020375f0 +_081A9244: + ldr r1, _081A9250 + movs r0, 0 + strh r0, [r1] +_081A924A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A9250: .4byte 0x020375f0 + thumb_func_end sub_81A91FC + + thumb_func_start sub_81A9254 +sub_81A9254: @ 81A9254 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _081A9284 +_081A925A: + bl GenerateRandomNumber + ldr r1, [r5] + lsls r2, r4, 1 + ldr r3, _081A9288 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _081A925A + ldr r0, _081A9284 + ldr r0, [r0] + ldr r1, _081A928C + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A9284: .4byte 0x03005d90 +_081A9288: .4byte 0x00000e22 +_081A928C: .4byte 0x00000e2a + thumb_func_end sub_81A9254 + + thumb_func_start sub_81A9290 +sub_81A9290: @ 81A9290 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r5, _081A9368 + ldr r1, [r5] + ldr r2, _081A936C + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + adds r2, 0x9 + adds r0, r1, r2 + ldrh r0, [r0] + str r0, [sp] + mov r2, r10 + lsls r0, r2, 1 + ldr r2, _081A9370 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x13 + bls _081A92DE + movs r0, 0x13 + mov r8, r0 +_081A92DE: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, _081A9374 + ldrh r4, [r1] + ldr r1, _081A9378 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x1] + subs r4, r0 + subs r7, r4, 0x1 + ldr r1, [r5] + lsrs r0, r7, 31 + adds r0, r7, r0 + asrs r0, 1 + lsls r0, 1 + ldr r2, _081A937C + adds r1, r2 + adds r1, r0 + ldrh r6, [r1] + adds r0, r6, 0 + bl SeedRng2 + movs r5, 0 + mov r0, r8 + lsls r0, 2 + mov r9, r0 + cmp r5, r4 + bge _081A9332 +_081A9318: + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x1 + adds r0, r7, 0x1 + cmp r5, r0 + blt _081A9318 +_081A9332: + ldr r0, _081A9380 + ldr r1, [sp] + adds r0, r1, r0 + ldrb r5, [r0] + ldr r1, _081A9384 + ldr r3, _081A9388 + ldr r4, _081A938C + cmp r5, 0x3E + bhi _081A935E + lsls r2, r5, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r6, r0 + blt _081A935E + adds r0, r2, r1 +_081A9350: + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x3E + bhi _081A935E + ldrb r2, [r0] + cmp r6, r2 + bge _081A9350 +_081A935E: + mov r0, r10 + cmp r0, 0 + beq _081A9394 + ldr r2, _081A9390 + b _081A9396 + .align 2, 0 +_081A9368: .4byte 0x03005d90 +_081A936C: .4byte 0x00000ca9 +_081A9370: .4byte 0x00000e1a +_081A9374: .4byte 0x020375f2 +_081A9378: .4byte 0x08613650 +_081A937C: .4byte 0x00000e22 +_081A9380: .4byte 0x08613b3a +_081A9384: .4byte 0x08613abc +_081A9388: .4byte 0x020375d8 +_081A938C: .4byte 0x020375da +_081A9390: .4byte 0x0861392c +_081A9394: + ldr r2, _081A93C4 +_081A9396: + lsls r0, r5, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r1, r9 + add r1, r8 + lsls r1, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + movs r0, 0x1 + strh r0, [r4] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A93C4: .4byte 0x0861379c + thumb_func_end sub_81A9290 + + thumb_func_start sub_81A93C8 +sub_81A93C8: @ 81A93C8 + push {r4,r5,lr} + ldr r0, _081A93DC + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r3, r0, r1 + movs r2, 0 + ldr r4, _081A93E0 + b _081A93F4 + .align 2, 0 +_081A93DC: .4byte 0x03005d8c +_081A93E0: .4byte 0x020375f2 +_081A93E4: + adds r2, 0x1 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _081A940A +_081A93F4: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r3 + ldrb r0, [r1] + ldrh r5, [r4] + cmp r0, r5 + bne _081A93E4 + ldr r0, _081A9410 + strh r0, [r1, 0x4] + strh r0, [r1, 0x6] +_081A940A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A9410: .4byte 0x00007fff + thumb_func_end sub_81A93C8 + + thumb_func_start sub_81A9414 +sub_81A9414: @ 81A9414 + ldr r1, _081A941C + ldr r0, _081A9420 + str r0, [r1] + bx lr + .align 2, 0 +_081A941C: .4byte 0x0203bc88 +_081A9420: .4byte 0x085d5acc + thumb_func_end sub_81A9414 + + thumb_func_start sub_81A9424 +sub_81A9424: @ 81A9424 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 + movs r7, 0 + ldr r0, _081A9474 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r8, r1 + ldr r2, _081A9478 + ldr r0, _081A947C + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r5, r0, 16 + movs r6, 0 + ldr r2, _081A9480 + ldr r0, _081A9484 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + ldrb r2, [r2, 0x1] + mov r9, r2 + b _081A94AE + .align 2, 0 +_081A9474: .4byte 0x03005d8c +_081A9478: .4byte 0x02037350 +_081A947C: .4byte 0x03005df0 +_081A9480: .4byte 0x08613c1c +_081A9484: .4byte 0x0203bc88 +_081A9488: + adds r6, 0x1 + cmp r6, 0x31 + bhi _081A94AE + ldr r4, _081A94E4 + lsls r3, r6, 1 + adds r2, r3, r4 + ldr r0, _081A94E8 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + mov r9, r0 +_081A94AE: + ldr r3, _081A94EC + ldr r2, _081A94F0 + ldr r0, _081A94F4 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + subs r0, 0x1 + adds r0, r3 + ldrb r0, [r0] + str r0, [sp] + movs r6, 0 + mov r3, r9 + lsls r3, 2 + mov r9, r3 +_081A94D0: + ldr r0, [sp] + cmp r0, 0x8 + bls _081A94D8 + b _081A95E8 +_081A94D8: + lsls r0, 2 + ldr r1, _081A94F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081A94E4: .4byte 0x08613c1c +_081A94E8: .4byte 0x0203bc88 +_081A94EC: .4byte 0x08613ed8 +_081A94F0: .4byte 0x02037350 +_081A94F4: .4byte 0x03005df0 +_081A94F8: .4byte _081A94FC + .align 2, 0 +_081A94FC: + .4byte _081A9520 + .4byte _081A9530 + .4byte _081A9572 + .4byte _081A95B4 + .4byte _081A95BA + .4byte _081A95C0 + .4byte _081A95C6 + .4byte _081A95D2 + .4byte _081A95DE +_081A9520: + mov r0, sp + movs r1, 0x8 + movs r2, 0 + bl sub_81A9998 + lsls r0, 24 + lsrs r7, r0, 24 + b _081A95EE +_081A9530: + movs r6, 0 + ldr r2, _081A953C + mov r4, r8 + adds r4, 0x4 + mov r5, r8 + b _081A9560 + .align 2, 0 +_081A953C: .4byte 0x7fff0000 +_081A9540: + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + bne _081A955A + movs r1, 0 + ldrsh r0, [r4, r1] + asrs r1, r2, 16 + cmp r0, r1 + beq _081A955A + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, r1 + beq _081A955A + adds r7, 0x1 +_081A955A: + adds r4, 0x18 + adds r5, 0x18 + adds r6, 0x1 +_081A9560: + str r2, [sp, 0x4] + bl sub_81AAA40 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x4] + cmp r6, r0 + blt _081A9540 + b _081A95EE +_081A9572: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, _081A95A4 + lsrs r0, 20 + adds r0, r1 + ldrb r7, [r0, 0x1] + ldr r0, _081A95A8 + ldr r0, [r0] + ldr r1, _081A95AC + adds r0, r1 + ldrb r2, [r0] + ldr r1, _081A95B0 + movs r6, 0x7 +_081A958E: + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _081A9598 + subs r7, 0x1 +_081A9598: + adds r1, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _081A958E + b _081A95EE + .align 2, 0 +_081A95A4: .4byte 0x08613650 +_081A95A8: .4byte 0x03005d90 +_081A95AC: .4byte 0x00000e2a +_081A95B0: .4byte 0x0832a328 +_081A95B4: + mov r0, sp + movs r1, 0x8 + b _081A95D6 +_081A95BA: + mov r0, sp + movs r1, 0x8 + b _081A95CA +_081A95C0: + mov r0, sp + movs r1, 0x10 + b _081A95D6 +_081A95C6: + mov r0, sp + movs r1, 0x10 +_081A95CA: + movs r2, 0x1 + bl sub_81A9998 + b _081A95E8 +_081A95D2: + mov r0, sp + movs r1, 0x18 +_081A95D6: + movs r2, 0x2 + bl sub_81A9998 + b _081A95E8 +_081A95DE: + mov r0, sp + movs r1, 0x18 + movs r2, 0x1 + bl sub_81A9998 +_081A95E8: + cmp r6, 0 + bne _081A95EE + b _081A94D0 +_081A95EE: + ldr r1, _081A9614 + add r1, r9 + ldr r0, [sp] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A9614: .4byte 0x08613ec0 + thumb_func_end sub_81A9424 + + thumb_func_start sub_81A9618 +sub_81A9618: @ 81A9618 + push {r4,r5,lr} + ldr r5, _081A9658 + ldr r1, [r5] + ldr r2, _081A965C + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 29 + ldr r4, _081A9660 + adds r1, r4 + adds r1, r2 + ldrh r3, [r1] + ldr r0, _081A9664 + cmp r3, r0 + bhi _081A963A + adds r0, r3, 0x1 + strh r0, [r1] +_081A963A: + ldr r0, [r5] + adds r1, r0, r4 + adds r1, r2 + ldr r3, _081A9668 + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _081A9650 + strh r1, [r0] +_081A9650: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081A9658: .4byte 0x03005d90 +_081A965C: .4byte 0x00000ca9 +_081A9660: .4byte 0x00000e1a +_081A9664: .4byte 0x000003e6 +_081A9668: .4byte 0x00000e1e + thumb_func_end sub_81A9618 + + thumb_func_start sub_81A966C +sub_81A966C: @ 81A966C + push {r4,lr} + ldr r4, _081A9680 + bl sub_81A9E40 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A9680: .4byte 0x020375f0 + thumb_func_end sub_81A966C + + thumb_func_start sub_81A9684 +sub_81A9684: @ 81A9684 + push {r4,lr} + ldr r0, _081A9694 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9698 + cmp r0, 0x1 + beq _081A96B4 + b _081A9754 + .align 2, 0 +_081A9694: .4byte 0x020375e4 +_081A9698: + ldr r0, _081A96A8 + ldr r0, [r0] + ldr r1, _081A96AC + ldrh r1, [r1] + ldr r2, _081A96B0 + adds r0, r2 + strb r1, [r0] + b _081A9754 + .align 2, 0 +_081A96A8: .4byte 0x03005d90 +_081A96AC: .4byte 0x020375e2 +_081A96B0: .4byte 0x00000e68 +_081A96B4: + ldr r4, _081A96E4 + ldrh r0, [r4] + cmp r0, 0x1 + beq _081A9710 + cmp r0, 0x1 + bgt _081A9754 + cmp r0, 0 + bne _081A9754 + ldr r0, _081A96E8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A9754 + ldr r0, _081A96EC + ldr r0, [r0] + ldr r2, _081A96F0 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x77 + bls _081A96F4 + movs r0, 0x78 + strb r0, [r1] + b _081A96FC + .align 2, 0 +_081A96E4: .4byte 0x020375f0 +_081A96E8: .4byte 0x02037fd4 +_081A96EC: .4byte 0x03005d90 +_081A96F0: .4byte 0x00000e68 +_081A96F4: + ldr r0, _081A9708 + ldrh r0, [r0] + bl audio_play +_081A96FC: + ldr r1, _081A970C + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081A9754 + .align 2, 0 +_081A9708: .4byte 0x020375e6 +_081A970C: .4byte 0x020375f0 +_081A9710: + ldr r1, _081A9744 + ldrh r0, [r1] + cmp r0, 0 + beq _081A9750 + subs r0, 0x1 + strh r0, [r1] + ldr r3, _081A9748 + ldr r1, [r3] + ldr r2, _081A974C + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x78 + bls _081A973E + movs r0, 0x78 + strb r0, [r1] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081A973E: + bl door_upload_tiles + b _081A9754 + .align 2, 0 +_081A9744: .4byte 0x020375e2 +_081A9748: .4byte 0x03005d90 +_081A974C: .4byte 0x00000e68 +_081A9750: + movs r0, 0x2 + strh r0, [r4] +_081A9754: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A9684 + + thumb_func_start sub_81A975C +sub_81A975C: @ 81A975C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r0, 0x64 + mov r9, r0 + ldr r1, _081A97BC + mov r8, r1 +_081A9776: + movs r4, 0 + adds r7, r5, 0x1 + mov r6, r9 + muls r6, r5 +_081A977E: + ldr r0, _081A97C0 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, _081A97C4 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A97A2 + subs r0, 0x1 + cmp r0, r5 + bne _081A97A2 + mov r1, r8 + adds r0, r6, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_081A97A2: + adds r4, 0x1 + cmp r4, 0x3 + ble _081A977E + adds r5, r7, 0 + cmp r5, 0x5 + ble _081A9776 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A97BC: .4byte 0x020244ec +_081A97C0: .4byte 0x03005d90 +_081A97C4: .4byte 0x00000caa + thumb_func_end sub_81A975C + + thumb_func_start sub_81A97C8 +sub_81A97C8: @ 81A97C8 + push {lr} + ldr r0, _081A97D8 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081A97D8: .4byte sub_81A97DC + 1 + thumb_func_end sub_81A97C8 + + thumb_func_start sub_81A97DC +sub_81A97DC: @ 81A97DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081A9814 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A980C + ldr r0, _081A9818 + ldr r0, [r0] + ldr r1, _081A981C + adds r0, r1 + ldrh r0, [r0] + lsls r0, 5 + ldr r1, _081A9820 + adds r0, r1 + ldr r1, _081A9824 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0 + bl remove_task +_081A980C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081A9814: .4byte 0x02037fd4 +_081A9818: .4byte 0x03005d90 +_081A981C: .4byte 0x00000cb2 +_081A9820: .4byte 0x08d856c8 +_081A9824: .4byte 0x020377d4 + thumb_func_end sub_81A97DC + + thumb_func_start sub_81A9828 +sub_81A9828: @ 81A9828 + push {lr} + bl atk17_seteffectuser + pop {r0} + bx r0 + thumb_func_end sub_81A9828 + + thumb_func_start sub_81A9834 +sub_81A9834: @ 81A9834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r0, 0 + str r0, [sp] +_081A9844: + ldr r0, _081A98B4 + ldr r0, [r0] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r5, _081A98B8 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + subs r5, r0, 0x1 + movs r0, 0 + str r0, [sp, 0x4] + movs r2, 0x64 + adds r1, r5, 0 + muls r1, r2 + str r1, [sp, 0x8] + movs r0, 0x8E + lsls r0, 2 + adds r6, r1, r0 + movs r1, 0 + str r1, [sp, 0x10] +_081A986C: + ldr r2, _081A98BC + ldr r0, [r2] + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + ldr r3, _081A98C0 + ldr r1, [sp, 0x10] + adds r0, r1, r3 + movs r1, 0xB + movs r2, 0 + str r3, [sp, 0x14] + bl pokemon_getattr + ldr r3, [sp, 0x14] + cmp r4, r0 + bne _081A993C + movs r6, 0 + adds r2, r5, 0x1 + str r2, [sp, 0xC] + movs r1, 0x64 + adds r0, r5, 0 + muls r0, r1 + movs r5, 0x8E + lsls r5, 2 + adds r5, r0 + mov r9, r5 + ldr r7, [sp, 0x4] + muls r7, r1 + mov r10, r3 +_081A98AC: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _081A98C6 + .align 2, 0 +_081A98B4: .4byte 0x03005d90 +_081A98B8: .4byte 0x00000caa +_081A98BC: .4byte 0x03005d8c +_081A98C0: .4byte 0x020244ec +_081A98C4: + adds r5, 0x1 +_081A98C6: + cmp r5, 0x3 + bgt _081A98EE + ldr r1, _081A9930 + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + mov r2, r10 + adds r0, r7, r2 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bne _081A98C4 +_081A98EE: + cmp r5, 0x4 + bne _081A9900 + lsls r2, r6, 24 + lsrs r2, 24 + mov r5, r10 + adds r0, r7, r5 + movs r1, 0xA6 + bl sub_80691F4 +_081A9900: + mov r6, r8 + cmp r6, 0x3 + ble _081A98AC + ldr r1, _081A9930 + ldr r0, [r1] + ldr r2, [sp, 0x8] + adds r0, r2 + movs r5, 0x8E + lsls r5, 2 + adds r0, r5 + ldr r1, _081A9934 + ldr r2, [sp, 0x10] + adds r1, r2, r1 + movs r2, 0x64 + bl memcpy + ldr r0, _081A9938 + ldr r5, [sp, 0x4] + adds r0, r5, r0 + mov r1, sp + ldrb r1, [r1, 0xC] + strb r1, [r0] + b _081A994C + .align 2, 0 +_081A9930: .4byte 0x03005d8c +_081A9934: .4byte 0x020244ec +_081A9938: .4byte 0x0203cef8 +_081A993C: + ldr r2, [sp, 0x10] + adds r2, 0x64 + str r2, [sp, 0x10] + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0x2 + ble _081A986C +_081A994C: + ldr r1, [sp] + adds r1, 0x1 + str r1, [sp] + cmp r1, 0x2 + bgt _081A9958 + b _081A9844 +_081A9958: + movs r2, 0 + str r2, [sp] + ldr r4, _081A998C + ldr r3, _081A9990 + ldr r2, _081A9994 +_081A9962: + ldr r1, [r4] + ldr r5, [sp] + lsls r0, r5, 1 + adds r1, r3 + adds r1, r0 + adds r0, r5, r2 + ldrb r0, [r0] + strh r0, [r1] + adds r5, 0x1 + str r5, [sp] + cmp r5, 0x2 + ble _081A9962 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A998C: .4byte 0x03005d90 +_081A9990: .4byte 0x00000caa +_081A9994: .4byte 0x0203cef8 + thumb_func_end sub_81A9834 + + thumb_func_start sub_81A9998 +sub_81A9998: @ 81A9998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r4, 0 + ldr r0, _081A9A20 + ldr r5, [r0, 0x8] + ldr r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, 0xE + adds r5, r0 + movs r3, 0 + ldr r0, _081A9A24 + mov r8, r0 + ldr r1, _081A9A28 + mov r12, r1 + ldr r0, _081A9A2C + mov r9, r0 +_081A99CC: + movs r2, 0 +_081A99CE: + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, r12 + bne _081A9A8A + adds r2, 0x7 + ldr r0, _081A9A30 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r5, 0xC + ldrsh r1, [r0, r5] + subs r2, r1 + adds r1, r3, 0x7 + movs r3, 0xE + ldrsh r0, [r0, r3] + subs r3, r1, r0 + cmp r2, r6 + bge _081A9A0E + negs r0, r6 + cmp r2, r0 + ble _081A9A0E + cmp r3, r6 + bge _081A9A0E + cmp r3, r0 + ble _081A9A0E + cmp r7, 0 + bne _081A9A84 +_081A9A0E: + cmp r2, 0 + ble _081A9A34 + cmp r3, 0 + ble _081A9A34 + movs r4, 0x3 + cmp r2, r3 + blt _081A9A7C + movs r4, 0x2 + b _081A9A7C + .align 2, 0 +_081A9A20: .4byte 0x03005dc0 +_081A9A24: .4byte 0x000003ff +_081A9A28: .4byte 0x0000028e +_081A9A2C: .4byte 0x02037350 +_081A9A30: .4byte 0x03005df0 +_081A9A34: + cmp r2, 0 + bge _081A9A46 + cmp r3, 0 + bge _081A9A46 + movs r4, 0x1 + cmp r2, r3 + ble _081A9A7C + movs r4, 0 + b _081A9A7C +_081A9A46: + cmp r2, 0 + bne _081A9A54 + movs r4, 0 + cmp r3, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A54: + cmp r3, 0 + bne _081A9A62 + movs r4, 0x1 + cmp r2, 0 + ble _081A9A7C + movs r4, 0x2 + b _081A9A7C +_081A9A62: + cmp r2, 0 + bge _081A9A72 + adds r0, r2, r3 + movs r4, 0x1 + cmp r0, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A72: + adds r0, r2, r3 + mvns r0, r0 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 +_081A9A7C: + movs r0, 0 + mov r5, r10 + str r0, [r5] + b _081A9A98 +_081A9A84: + mov r0, r10 + str r7, [r0] + b _081A9A98 +_081A9A8A: + adds r2, 0x1 + cmp r2, 0x1F + ble _081A99CE + adds r5, 0x5E + adds r3, 0x1 + cmp r3, 0x1F + ble _081A99CC +_081A9A98: + 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_81A9998 + + thumb_func_start sub_81A9AA8 +sub_81A9AA8: @ 81A9AA8 + lsls r0, 24 + ldr r1, _081A9ABC + ldr r1, [r1] + lsrs r0, 23 + adds r1, r0 + ldr r0, _081A9AC0 + adds r1, r0 + ldrh r0, [r1] + bx lr + .align 2, 0 +_081A9ABC: .4byte 0x03005d90 +_081A9AC0: .4byte 0x00000cb2 + thumb_func_end sub_81A9AA8 + + thumb_func_start sub_81A9AC4 +sub_81A9AC4: @ 81A9AC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081A9AF4 + ldr r2, [r1] + ldr r1, _081A9AF8 + adds r2, r1 + ldr r4, _081A9AFC + ldr r3, _081A9B00 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r1, 0x8] + subs r0, 0x1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081A9AF4: .4byte 0x03005d90 +_081A9AF8: .4byte 0x00000e2a +_081A9AFC: .4byte 0x0832a328 +_081A9B00: .4byte 0x02037350 + thumb_func_end sub_81A9AC4 + + thumb_func_start sub_81A9B04 +sub_81A9B04: @ 81A9B04 + push {lr} + ldr r0, _081A9B34 + ldrh r0, [r0] + bl sub_81A9B44 + ldr r0, _081A9B38 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _081A9B2E + movs r0, 0x1 + bl sub_80B47E0 + ldr r1, _081A9B3C + strb r0, [r1] + ldr r0, _081A9B40 + ldrh r0, [r0] + bl sub_81A9B44 +_081A9B2E: + pop {r0} + bx r0 + .align 2, 0 +_081A9B34: .4byte 0x02038bca +_081A9B38: .4byte 0x02022fec +_081A9B3C: .4byte 0x03005df0 +_081A9B40: .4byte 0x02038bcc + thumb_func_end sub_81A9B04 + + thumb_func_start sub_81A9B44 +sub_81A9B44: @ 81A9B44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r0, _081A9BE0 + mov r12, r0 + ldr r6, _081A9BE4 + ldr r1, _081A9BE8 + mov r10, r1 + ldr r7, _081A9BEC + mov r9, r7 + ldr r0, _081A9BF0 + mov r8, r0 + ldr r4, _081A9BF4 +_081A9B68: + mov r1, r9 + ldr r2, [r1] + lsls r0, r3, 1 + mov r7, r8 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r5 + bne _081A9B86 + ldr r1, _081A9BF8 + adds r0, r2, r1 + ldr r1, [r4] + ldrb r2, [r0] + orrs r1, r2 + strb r1, [r0] +_081A9B86: + adds r4, 0x4 + adds r3, 0x1 + cmp r3, 0x7 + ble _081A9B68 + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + movs r3, 0x2 + strb r3, [r0, 0x6] + mov r7, r10 + ldr r2, [r7] + ldr r0, _081A9BFC + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + ldr r1, _081A9C00 + adds r2, r1 + strb r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x10] + strh r1, [r0, 0xC] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0xE] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081A9BE0: .4byte 0x02037350 +_081A9BE4: .4byte 0x03005df0 +_081A9BE8: .4byte 0x03005d8c +_081A9BEC: .4byte 0x03005d90 +_081A9BF0: .4byte 0x00000cb4 +_081A9BF4: .4byte 0x0832a328 +_081A9BF8: .4byte 0x00000e2a +_081A9BFC: .4byte 0x020375f2 +_081A9C00: .4byte 0x00000c79 + thumb_func_end sub_81A9B44 + + thumb_func_start sub_81A9C04 +sub_81A9C04: @ 81A9C04 + push {r4-r6,lr} + sub sp, 0x14 + ldr r0, _081A9C44 + ldr r1, [r0] + ldr r2, _081A9C48 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + lsls r0, r5, 1 + ldr r2, _081A9C4C + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bls _081A9C3A + movs r0, 0x13 +_081A9C3A: + cmp r5, 0 + beq _081A9C54 + ldr r1, _081A9C50 + b _081A9C56 + .align 2, 0 +_081A9C44: .4byte 0x03005d90 +_081A9C48: .4byte 0x00000ca9 +_081A9C4C: .4byte 0x00000e1a +_081A9C50: .4byte 0x08613600 +_081A9C54: + ldr r1, _081A9CCC +_081A9C56: + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + ldr r4, _081A9CD0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + subs r0, 0x1 + str r0, [sp, 0x10] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r6, r2 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_setattr + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + mov r0, sp + bl get_pokemon_name + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr + cmp r5, 0 + beq _081A9CD4 + bl sub_8165C40 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + subs r5, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r0 + b _081A9CF6 + .align 2, 0 +_081A9CCC: .4byte 0x08612e30 +_081A9CD0: .4byte 0x02024744 +_081A9CD4: + bl GenerateRandomNumber + ldr r2, [sp, 0x10] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrb r4, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r4, r0 +_081A9CF6: + ldr r4, _081A9D40 + ldr r2, _081A9D44 + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + lsls r0, r5, 2 + ldr r1, _081A9D48 + adds r0, r1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x3] + cmp r1, 0 + blt _081A9D4C + cmp r1, 0x1 + bgt _081A9D4C + adds r2, r0, 0x3 + b _081A9D7C + .align 2, 0 +_081A9D40: .4byte 0x02024744 +_081A9D44: .4byte 0x083203cc +_081A9D48: .4byte 0x0831f72c +_081A9D4C: + ldr r2, _081A9D88 + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + cmp r0, 0 + beq _081A9D90 + ldr r4, _081A9D8C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1 + ands r1, r0 + str r1, [sp, 0xC] + add r2, sp, 0xC +_081A9D7C: + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_setattr + b _081A9D9C + .align 2, 0 +_081A9D88: .4byte 0x083203cc +_081A9D8C: .4byte 0x02024744 +_081A9D90: + str r0, [sp, 0xC] + ldr r0, _081A9E1C + add r2, sp, 0xC + movs r1, 0x2E + bl pokemon_setattr +_081A9D9C: + movs r0, 0 + str r0, [sp, 0xC] + movs r2, 0 + lsls r4, r5, 1 +_081A9DA4: + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + lsls r1, r2, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + ldr r0, _081A9E1C + bl sub_80691F4 + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + adds r2, r0, 0 + cmp r2, 0x3 + ble _081A9DA4 + ldr r0, _081A9E20 + ldr r0, [r0] + ldr r1, _081A9E24 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x8B + bls _081A9E0C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0xF + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0xC] +_081A9DF6: + adds r1, r0, 0 + adds r1, 0x27 + ldr r0, _081A9E1C + add r2, sp, 0x10 + bl pokemon_setattr + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + cmp r0, 0x5 + ble _081A9DF6 +_081A9E0C: + ldr r0, _081A9E1C + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081A9E1C: .4byte 0x02024744 +_081A9E20: .4byte 0x03005d90 +_081A9E24: .4byte 0x00000e1a + thumb_func_end sub_81A9C04 + + thumb_func_start sub_81A9E28 +sub_81A9E28: @ 81A9E28 + push {lr} + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, _081A9E3C + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x4] + pop {r1} + bx r1 + .align 2, 0 +_081A9E3C: .4byte 0x08613650 + thumb_func_end sub_81A9E28 + + thumb_func_start sub_81A9E40 +sub_81A9E40: @ 81A9E40 + push {lr} + ldr r0, _081A9E50 + ldrh r1, [r0, 0x12] + ldr r0, _081A9E54 + cmp r1, r0 + bne _081A9E58 + movs r0, 0x1 + b _081A9E66 + .align 2, 0 +_081A9E50: .4byte 0x02037318 +_081A9E54: .4byte 0x00000169 +_081A9E58: + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + beq _081A9E64 + movs r0, 0 + b _081A9E66 +_081A9E64: + movs r0, 0x2 +_081A9E66: + pop {r1} + bx r1 + thumb_func_end sub_81A9E40 + + thumb_func_start sub_81A9E6C +sub_81A9E6C: @ 81A9E6C + push {lr} + movs r2, 0 + ldr r0, _081A9E88 + ldrh r1, [r0, 0x12] + ldr r0, _081A9E8C + cmp r1, r0 + beq _081A9E80 + adds r0, 0x11 + cmp r1, r0 + bne _081A9E82 +_081A9E80: + movs r2, 0x1 +_081A9E82: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_081A9E88: .4byte 0x02037318 +_081A9E8C: .4byte 0x00000169 + thumb_func_end sub_81A9E6C + + thumb_func_start sub_81A9E90 +sub_81A9E90: @ 81A9E90 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _081A9EB8 + bl sub_81A9834 + ldr r0, _081A9EBC + ldr r0, [r0] + ldr r1, _081A9EC0 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, _081A9EC4 + movs r1, 0 + bl var_set + bl copy_player_party_from_sav1 +_081A9EB8: + pop {r0} + bx r0 + .align 2, 0 +_081A9EBC: .4byte 0x03005d90 +_081A9EC0: .4byte 0x00000ca8 +_081A9EC4: .4byte 0x0000400e + thumb_func_end sub_81A9E90 + + thumb_func_start sub_81A9EC8 +sub_81A9EC8: @ 81A9EC8 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + beq _081A9ED8 + bl do_reset +_081A9ED8: + pop {r0} + bx r0 + thumb_func_end sub_81A9EC8 + + thumb_func_start sub_81A9EDC +sub_81A9EDC: @ 81A9EDC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _081A9EF8 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC + pop {r0} + bx r0 + .align 2, 0 +_081A9EF8: .4byte 0x0203bc88 + thumb_func_end sub_81A9EDC + + thumb_func_start sub_81A9EFC +sub_81A9EFC: @ 81A9EFC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _081A9F18 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl sub_81638AC + pop {r0} + bx r0 + .align 2, 0 +_081A9F18: .4byte 0x0203bc88 + thumb_func_end sub_81A9EFC + + thumb_func_start sub_81A9F1C +sub_81A9F1C: @ 81A9F1C + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _081A9F38 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl sub_81638AC + pop {r0} + bx r0 + .align 2, 0 +_081A9F38: .4byte 0x0203bc88 + thumb_func_end sub_81A9F1C + + thumb_func_start sub_81A9F3C +sub_81A9F3C: @ 81A9F3C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + ldr r3, _081A9F64 + ldr r1, _081A9F68 + ldr r2, [r1] + movs r1, 0x34 + muls r0, r1 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r2, [r0] + ldr r1, _081A9F6C +_081A9F58: + ldrb r0, [r1] + cmp r0, r2 + bne _081A9F70 + ldrb r0, [r1, 0x1] + b _081A9F7A + .align 2, 0 +_081A9F64: .4byte 0x0831f5ca +_081A9F68: .4byte 0x0203bc88 +_081A9F6C: .4byte 0x08613b44 +_081A9F70: + adds r1, 0x4 + adds r4, 0x1 + cmp r4, 0x35 + bls _081A9F58 + movs r0, 0 +_081A9F7A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A9F3C + + thumb_func_start sub_81A9F80 +sub_81A9F80: @ 81A9F80 + push {lr} + ldr r0, _081A9F8C + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .align 2, 0 +_081A9F8C: .4byte 0x08252c88 + thumb_func_end sub_81A9F80 + + thumb_func_start sub_81A9F90 +sub_81A9F90: @ 81A9F90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081AA00C + ldr r4, [r0] + ldr r1, _081AA010 + adds r0, r4, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 29 + ldr r2, _081AA014 + adds r0, r4, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _081AA018 + adds r4, r1 + ldrh r1, [r4] + cmp r1, 0x7 + bne _081AA020 + adds r0, 0x1 + lsls r7, r0, 24 + lsls r1, 24 + mov r8, r1 +_081A9FCC: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA004 + ldr r1, _081AA00C + ldr r0, [r1] + ldr r4, _081AA01C + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA004 + adds r6, r1, 0 +_081A9FF0: + adds r2, 0x1 + cmp r2, r5 + bge _081AA004 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081A9FF0 +_081AA004: + cmp r2, r5 + bne _081A9FCC + b _081AA062 + .align 2, 0 +_081AA00C: .4byte 0x03005d90 +_081AA010: .4byte 0x00000ca9 +_081AA014: .4byte 0x00000e1a +_081AA018: .4byte 0x00000cb2 +_081AA01C: .4byte 0x00000cb4 +_081AA020: + lsls r1, 24 + mov r8, r1 + lsls r7, r0, 24 +_081AA026: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA05E + ldr r1, _081AA070 + ldr r0, [r1] + ldr r4, _081AA074 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA05E + adds r6, r1, 0 +_081AA04A: + adds r2, 0x1 + cmp r2, r5 + bge _081AA05E + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081AA04A +_081AA05E: + cmp r2, r5 + bne _081AA026 +_081AA062: + adds r0, r3, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AA070: .4byte 0x03005d90 +_081AA074: .4byte 0x00000cb4 + thumb_func_end sub_81A9F90 + + thumb_func_start sub_81AA078 +sub_81AA078: @ 81AA078 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + str r0, [sp, 0x4] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r0, 0x10 + bl malloc_and_clear + str r0, [sp, 0xC] + bl sub_81AA96C + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_81AA33C + movs r7, 0 +_081AA0A6: + ldr r1, [sp, 0xC] + adds r0, r1, r7 + ldrb r0, [r0] + ldr r2, _081AA178 + adds r0, r2 + lsls r0, 2 + ldr r1, _081AA17C + adds r0, r1 + ldr r6, [r0] + ldr r2, [r6, 0xC] + mov r10, r2 + ldr r0, [sp, 0x4] + ldr r1, _081AA180 + str r0, [r1, 0x8] + ldr r0, [r6] + lsls r0, 2 + adds r2, r0, 0 + adds r2, 0xF + str r2, [r1] + ldr r0, [r6, 0x4] + lsls r0, 2 + adds r0, 0xE + str r0, [r1, 0x4] + ldr r0, [sp, 0x4] + mov r9, r0 + adds r1, r7, 0 + cmp r7, 0 + bge _081AA0E0 + adds r1, r7, 0x3 +_081AA0E0: + asrs r1, 2 + ldr r4, [r6, 0x4] + adds r0, r1, 0 + muls r0, r4 + adds r0, 0x7 + muls r2, r0 + lsls r1, 2 + subs r1, r7, r1 + ldr r3, [r6] + adds r0, r1, 0 + muls r0, r3 + adds r0, 0x7 + adds r2, r0 + lsls r2, 1 + add r9, r2 + movs r1, 0 + mov r8, r1 + adds r2, r7, 0x1 + str r2, [sp, 0x10] + cmp r8, r4 + bge _081AA1B6 +_081AA10A: + movs r0, 0 + mov r12, r0 + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x14] + cmp r12, r3 + bge _081AA1A2 + ldr r2, _081AA184 + str r2, [sp, 0x18] + mov r4, r9 + mov r5, r10 +_081AA120: + ldrh r1, [r5] + ldr r0, _081AA188 + ands r0, r1 + ldr r2, _081AA18C + cmp r0, r2 + bne _081AA194 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r7, r0 + beq _081AA194 + mov r0, sp + ldrb r0, [r0] + cmp r7, r0 + bne _081AA164 + ldr r1, [sp, 0x8] + cmp r1, 0 + bne _081AA164 + ldr r2, [sp, 0x18] + ldr r3, [r2] + adds r2, r7, 0 + cmp r7, 0 + bge _081AA14E + adds r2, r7, 0x3 +_081AA14E: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r7, r1 + ldr r0, [r6] + muls r0, r1 + add r0, r12 + strh r0, [r3] + ldr r0, [r6, 0x4] + muls r0, r2 + add r0, r8 + strh r0, [r3, 0x2] +_081AA164: + ldrh r0, [r5] + movs r1, 0xFC + lsls r1, 8 + ands r1, r0 + ldr r2, _081AA190 + adds r0, r2, 0 + orrs r1, r0 + strh r1, [r4] + ldr r3, [r6] + b _081AA196 + .align 2, 0 +_081AA178: .4byte 0x00000169 +_081AA17C: .4byte 0x08481dd4 +_081AA180: .4byte 0x03005dc0 +_081AA184: .4byte 0x03005d8c +_081AA188: .4byte 0x000003ff +_081AA18C: .4byte 0x0000028e +_081AA190: .4byte 0x0000028d +_081AA194: + strh r1, [r4] +_081AA196: + adds r4, 0x2 + adds r5, 0x2 + movs r0, 0x1 + add r12, r0 + cmp r12, r3 + blt _081AA120 +_081AA1A2: + lsls r0, r3, 3 + adds r0, 0x1E + add r9, r0 + lsls r0, r3, 1 + add r10, r0 + ldr r1, [sp, 0x14] + mov r8, r1 + ldr r0, [r6, 0x4] + cmp r8, r0 + blt _081AA10A +_081AA1B6: + ldr r7, [sp, 0x10] + cmp r7, 0xF + bgt _081AA1BE + b _081AA0A6 +_081AA1BE: + bl mapheader_run_script_with_tag_x1 + ldr r0, [sp, 0xC] + bl free + 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_81AA078 + + thumb_func_start sub_81AA1D8 +sub_81AA1D8: @ 81AA1D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r5, 0 + mov r6, sp + adds r6, 0x1 + add r0, sp, 0x4 + mov r8, r0 + ldr r4, _081AA23C + ldr r3, _081AA240 + ldr r0, _081AA244 + adds r2, r0, 0 +_081AA1F2: + ldr r0, [r4] + lsls r1, r5, 1 + adds r0, r3 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r2 + strh r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _081AA1F2 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, sp + adds r1, r6, 0 + bl sub_81AA33C + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, _081AA248 + ldr r1, [r0] + movs r0, 0xC7 + lsls r0, 4 + adds r1, r0 + ldr r2, _081AA24C + mov r0, r8 + bl CpuSet + movs r5, 0 +_081AA22E: + cmp r5, 0 + bne _081AA254 + ldr r1, _081AA250 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x3] + b _081AA25C + .align 2, 0 +_081AA23C: .4byte 0x03005d90 +_081AA240: .4byte 0x00000cb4 +_081AA244: .4byte 0x0000ffff +_081AA248: .4byte 0x03005d8c +_081AA24C: .4byte 0x05000180 +_081AA250: .4byte 0x08613650 +_081AA254: + ldr r1, _081AA26C + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] +_081AA25C: + cmp r0, 0x4 + bhi _081AA2E4 + lsls r0, 2 + ldr r1, _081AA270 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AA26C: .4byte 0x08613650 +_081AA270: .4byte _081AA274 + .align 2, 0 +_081AA274: + .4byte _081AA288 + .4byte _081AA292 + .4byte _081AA2A2 + .4byte _081AA2B0 + .4byte _081AA2CC +_081AA288: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81AA398 + b _081AA2E4 +_081AA292: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2A2: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2B0: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA648 +_081AA2BE: + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 + b _081AA2E4 +_081AA2CC: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA648 + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 +_081AA2E4: + adds r5, 0x1 + cmp r5, 0x1 + ble _081AA22E + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA1D8 + + thumb_func_start sub_81AA2F8 +sub_81AA2F8: @ 81AA2F8 + push {r4,r5,lr} + ldr r0, _081AA31C + ldr r0, [r0] + ldr r5, _081AA320 + ldr r4, _081AA324 + movs r2, 0xC8 + lsls r2, 4 + adds r1, r0, r2 + movs r3, 0xC7 + lsls r3, 4 + adds r2, r0, r3 + movs r3, 0x3F +_081AA310: + ldrb r0, [r2, 0x1] + cmp r0, 0x3B + beq _081AA328 + str r5, [r1] + b _081AA32A + .align 2, 0 +_081AA31C: .4byte 0x03005d8c +_081AA320: .4byte 0x08252c4f +_081AA324: .4byte 0x08252c6a +_081AA328: + str r4, [r1] +_081AA32A: + adds r1, 0x18 + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _081AA310 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AA2F8 + + thumb_func_start sub_81AA33C +sub_81AA33C: @ 81AA33C + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r5, _081AA38C + ldr r1, [r5] + ldr r2, _081AA390 + adds r0, r1, r2 + ldrh r2, [r0] + movs r3, 0xF + ands r2, r3 + strb r2, [r4] + ldr r7, _081AA394 + adds r1, r7 + ldrh r0, [r1] + ands r0, r3 + strb r0, [r6] + cmp r2, r0 + bne _081AA386 + ldr r1, [r5] + ldr r2, _081AA390 + adds r0, r1, r2 + ldrh r2, [r0] + adds r3, r2, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r4] + adds r0, r1, r7 + ldrh r1, [r0] + adds r2, r1, 0 + adds r2, 0xF + adds r0, r2, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r2, r0 + strb r0, [r6] +_081AA386: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AA38C: .4byte 0x03005d90 +_081AA390: .4byte 0x00000e28 +_081AA394: .4byte 0x00000e22 + thumb_func_end sub_81AA33C + + thumb_func_start sub_81AA398 +sub_81AA398: @ 81AA398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r5, 0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x10 + bl malloc_and_clear + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r0, _081AA3E4 + ldr r0, [r0] + ldr r1, _081AA3E8 + adds r0, r1 + ldrh r4, [r0] + movs r0, 0xF + ands r4, r0 + ldr r0, [sp] + cmp r0, 0 + bne _081AA3F0 + ldr r1, _081AA3EC + lsls r0, r6, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x4] + b _081AA3FE + .align 2, 0 +_081AA3E4: .4byte 0x03005d90 +_081AA3E8: .4byte 0x00000e26 +_081AA3EC: .4byte 0x08613650 +_081AA3F0: + ldr r1, _081AA410 + lsls r0, r6, 4 + adds r0, r1 + ldrb r1, [r0] + mov r10, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x4] +_081AA3FE: + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AA4C0 +_081AA406: + movs r1, 0x1 + add r1, r8 + mov r9, r1 + b _081AA42E + .align 2, 0 +_081AA410: .4byte 0x08613650 +_081AA414: + lsls r2, r4, 24 + lsrs r2, 24 + ldr r3, [sp, 0x4] + add r3, r8 + lsls r3, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA4B6 +_081AA42E: + ldr r0, _081AA458 + mov r12, r0 + ldr r6, _081AA45C + ldr r7, _081AA460 + movs r3, 0x2 + lsls r0, r4, 2 + mov r1, r12 + adds r2, r0, r1 +_081AA43E: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _081AA464 + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _081AA474 + b _081AA472 + .align 2, 0 +_081AA458: .4byte 0x0832a328 +_081AA45C: .4byte 0x03005d90 +_081AA460: .4byte 0x00000e28 +_081AA464: + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _081AA474 +_081AA472: + orrs r5, r3 +_081AA474: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _081AA480 + mov r2, r12 + movs r4, 0 +_081AA480: + ldr r0, [r6] + ldr r1, _081AA4A0 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xF + ands r1, r0 + cmp r4, r1 + bne _081AA4A6 + movs r1, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081AA4A4 + movs r0, 0x6 + orrs r5, r0 + b _081AA4A6 + .align 2, 0 +_081AA4A0: .4byte 0x00000e26 +_081AA4A4: + orrs r5, r1 +_081AA4A6: + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _081AA43E + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _081AA414 +_081AA4B6: + movs r0, 0x1 + ands r5, r0 + mov r8, r9 + cmp r8, r10 + blt _081AA406 +_081AA4C0: + ldr r0, [sp, 0x8] + bl free + 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_81AA398 + + thumb_func_start sub_81AA4D8 +sub_81AA4D8: @ 81AA4D8 + 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 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r6, 0 + movs r7, 0 + movs r0, 0 + str r0, [sp, 0xC] + bl sub_81AA9E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x10 + bl malloc_and_clear + str r0, [sp, 0x14] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA524 + ldr r1, _081AA520 + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x10] + movs r0, 0 + b _081AA530 + .align 2, 0 +_081AA520: .4byte 0x08613650 +_081AA524: + ldr r1, _081AA564 + lsls r0, r4, 4 + adds r0, r1 + ldrb r2, [r0] + str r2, [sp, 0x10] + ldrb r0, [r0, 0x1] +_081AA530: + movs r3, 0 + str r3, [sp, 0x8] + ldr r1, [sp, 0x10] + asrs r1, 31 + str r1, [sp, 0x18] + ldr r2, [sp, 0x10] + cmp r3, r2 + bge _081AA622 + str r0, [sp, 0x1C] + adds r3, r0, 0 + lsls r3, 24 + mov r9, r3 +_081AA548: + cmp r7, 0 + bne _081AA56E + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x4] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA568 + movs r7, 0x1 + b _081AA56E + .align 2, 0 +_081AA564: .4byte 0x08613650 +_081AA568: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA56E: + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081AA600 + ldr r2, _081AA5A4 + mov r8, r2 + ldr r3, [sp, 0x4] + lsls r4, r3, 2 + adds r0, r6, r4 + add r0, r8 + ldrb r2, [r0] + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + ldr r1, [sp, 0x1C] + mov r10, r1 + adds r5, r4, 0 + cmp r0, 0 + beq _081AA5E8 + ldr r4, [sp, 0xC] + adds r4, 0x1 + b _081AA5C2 + .align 2, 0 +_081AA5A4: .4byte 0x08613f46 +_081AA5A8: + adds r0, r6, r5 + adds r0, r2 + ldrb r2, [r0] + mov r0, r10 + lsls r3, r0, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA5E0 +_081AA5C2: + adds r6, 0x1 + ldr r0, _081AA5E4 + adds r1, r6, r5 + adds r1, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0xFF + beq _081AA5D6 + cmp r6, 0x3 + ble _081AA5D8 +_081AA5D6: + movs r6, 0 +_081AA5D8: + adds r7, 0x2 + asrs r0, r7, 1 + cmp r0, 0x4 + bne _081AA5A8 +_081AA5E0: + str r4, [sp, 0xC] + b _081AA600 + .align 2, 0 +_081AA5E4: .4byte 0x08613f46 +_081AA5E8: + adds r6, 0x1 + adds r0, r6, r4 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA5F8 + cmp r6, 0x3 + ble _081AA5FA +_081AA5F8: + movs r6, 0 +_081AA5FA: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA600: + asrs r0, r7, 1 + cmp r0, 0x4 + beq _081AA622 + movs r0, 0x1 + ands r7, r0 + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + movs r3, 0x80 + lsls r3, 17 + add r9, r3 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + ldr r1, [sp, 0x10] + cmp r0, r1 + blt _081AA548 +_081AA622: + movs r1, 0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x18] + subs r0, r2, r3 + asrs r0, 1 + ldr r2, [sp, 0xC] + cmp r0, r2 + ble _081AA634 + movs r1, 0x1 +_081AA634: + adds r0, r1, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA4D8 + + thumb_func_start sub_81AA648 +sub_81AA648: @ 81AA648 + 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 r6, r1, 24 + movs r4, 0 + movs r7, 0 + movs r0, 0 + mov r8, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x10 + bl malloc_and_clear + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA694 + ldr r1, _081AA690 + lsls r0, r5, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r0, 0 + b _081AA6A0 + .align 2, 0 +_081AA690: .4byte 0x08613650 +_081AA694: + ldr r1, _081AA6D0 + lsls r0, r5, 4 + adds r0, r1 + ldrb r2, [r0] + mov r10, r2 + ldrb r0, [r0, 0x1] +_081AA6A0: + movs r3, 0 + str r3, [sp, 0x4] + mov r1, r10 + asrs r1, 31 + str r1, [sp, 0xC] + cmp r3, r10 + bge _081AA73E + ldr r2, _081AA6D4 + mov r9, r2 + lsls r5, r6, 2 + lsls r6, r0, 24 +_081AA6B6: + adds r0, r4, r5 + add r0, r9 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA714 + adds r7, 0x1 + b _081AA6EE + .align 2, 0 +_081AA6D0: .4byte 0x08613650 +_081AA6D4: .4byte 0x08613f46 +_081AA6D8: + adds r0, r4, r5 + adds r0, r1 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA728 +_081AA6EE: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + ldr r1, _081AA710 + cmp r0, 0xFF + beq _081AA700 + cmp r4, 0x3 + ble _081AA702 +_081AA700: + movs r4, 0 +_081AA702: + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x4 + bne _081AA6D8 + b _081AA728 + .align 2, 0 +_081AA710: .4byte 0x08613f46 +_081AA714: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA724 + cmp r4, 0x3 + ble _081AA726 +_081AA724: + movs r4, 0 +_081AA726: + adds r7, 0x1 +_081AA728: + mov r1, r8 + cmp r1, 0x4 + beq _081AA73E + movs r2, 0x80 + lsls r2, 17 + adds r6, r2 + ldr r3, [sp, 0x4] + adds r3, 0x1 + str r3, [sp, 0x4] + cmp r3, r10 + blt _081AA6B6 +_081AA73E: + movs r1, 0 + mov r2, r10 + ldr r3, [sp, 0xC] + subs r0, r2, r3 + asrs r0, 1 + cmp r0, r7 + ble _081AA74E + movs r1, 0x1 +_081AA74E: + adds r0, r1, 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_81AA648 + + thumb_func_start sub_81AA760 +sub_81AA760: @ 81AA760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, _081AA7C4 + ldr r0, [r0] + ldr r1, _081AA7C8 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AA7D0 + movs r6, 0x7 +_081AA792: + movs r4, 0x7 + lsls r5, r6, 24 +_081AA796: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + subs r4, 0x1 + cmp r4, 0 + bge _081AA796 + subs r6, 0x1 + movs r1, 0x1 + negs r1, r1 + cmp r6, r1 + bgt _081AA792 + b _081AA7FC + .align 2, 0 +_081AA7C4: .4byte 0x03005d90 +_081AA7C8: .4byte 0x00000e22 +_081AA7CC: + movs r0, 0 + b _081AA7FE +_081AA7D0: + movs r6, 0 +_081AA7D2: + movs r4, 0 + lsls r5, r6, 24 +_081AA7D6: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + adds r4, 0x1 + cmp r4, 0x7 + ble _081AA7D6 + adds r6, 0x1 + cmp r6, 0x7 + ble _081AA7D2 +_081AA7FC: + movs r0, 0x1 +_081AA7FE: + 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_81AA760 + + thumb_func_start sub_81AA810 +sub_81AA810: @ 81AA810 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r6, r5, 24 + ldr r0, _081AA944 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x8] + add r3, r10 + ldrb r1, [r3] + adds r1, 0x2C + movs r0, 0x19 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + movs r7, 0 + ldr r1, [r5, 0x4] + ldrb r2, [r1] + cmp r7, r2 + bge _081AA95A + movs r0, 0x3 + ands r0, r4 + lsls r0, 3 + str r0, [sp, 0xC] +_081AA868: + ldr r1, [r1, 0x4] + lsls r2, r7, 1 + adds r0, r2, r7 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x4 + ldrsh r0, [r3, r4] + ldr r1, [r5, 0x4] + mov r12, r1 + mov r9, r2 + ldr r2, [sp, 0x4] + cmp r0, r2 + bne _081AA950 + movs r4, 0x6 + ldrsh r0, [r3, r4] + cmp r0, r8 + bne _081AA950 + ldr r0, [sp] + cmp r0, 0 + bne _081AA896 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA8A2 +_081AA896: + ldr r1, [sp] + cmp r1, 0x1 + bne _081AA950 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA950 +_081AA8A2: + movs r3, 0 + ldr r2, [r5, 0x4] + mov r12, r2 + cmp r3, r6 + bge _081AA8DC + ldr r4, [sp, 0x4] + ldr r0, [sp, 0xC] + adds r4, r0 + str r4, [sp, 0x10] + mov r1, r10 + lsrs r0, r1, 2 + lsls r0, 3 + mov r2, r8 + adds r1, r2, r0 + ldr r2, [sp, 0x8] + adds r2, 0x4 +_081AA8C2: + movs r4, 0 + ldrsh r0, [r2, r4] + ldr r4, [sp, 0x10] + cmp r0, r4 + bne _081AA8D4 + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r0, r1 + beq _081AA8DC +_081AA8D4: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, r6 + blt _081AA8C2 +_081AA8DC: + cmp r3, r6 + bne _081AA950 + lsls r0, r6, 1 + mov r8, r0 + adds r0, r6 + lsls r0, 3 + ldr r1, [sp, 0x8] + adds r5, r0, r1 + mov r3, r12 + ldr r2, [r3, 0x4] + mov r4, r9 + adds r1, r4, r7 + lsls r1, 3 + adds r0, r5, 0 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldrh r0, [r5, 0x4] + ldr r1, [sp, 0xC] + adds r0, r1 + strh r0, [r5, 0x4] + mov r2, r10 + lsrs r0, r2, 2 + lsls r0, 3 + ldrh r3, [r5, 0x6] + adds r0, r3 + strh r0, [r5, 0x6] + adds r0, r6, 0x1 + strb r0, [r5] + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + beq _081AA940 + adds r0, r6, 0 + bl sub_81A9F90 + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, r7, 0 + adds r0, r4, 0 + bl sub_81627A4 + strb r0, [r5, 0x1] + ldr r0, _081AA948 + ldr r0, [r0] + ldr r1, _081AA94C + adds r0, r1 + add r0, r8 + strh r4, [r0] +_081AA940: + movs r0, 0 + b _081AA95C + .align 2, 0 +_081AA944: .4byte 0x03005d8c +_081AA948: .4byte 0x03005d90 +_081AA94C: .4byte 0x00000cb4 +_081AA950: + adds r7, 0x1 + mov r1, r12 + ldrb r2, [r1] + cmp r7, r2 + blt _081AA868 +_081AA95A: + movs r0, 0x1 +_081AA95C: + 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_81AA810 + + thumb_func_start sub_81AA96C +sub_81AA96C: @ 81AA96C + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, _081AA9CC + ldr r0, [r0] + ldr r2, _081AA9D0 + adds r1, r0, r2 + ldrh r4, [r1] + ldr r1, _081AA9D4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + orrs r4, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r2, _081AA9D8 + mov r12, r2 + movs r7, 0x7 +_081AA994: + adds r2, r6, r3 + adds r0, r4, 0 + ands r0, r7 + lsls r1, r5, 4 + adds r0, r1 + add r0, r12 + ldrb r0, [r0] + strb r0, [r2] + asrs r4, 3 + cmp r3, 0x7 + bne _081AA9C0 + ldr r0, _081AA9CC + ldr r1, [r0] + ldr r2, _081AA9DC + adds r0, r1, r2 + ldrh r4, [r0] + ldr r0, _081AA9E0 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 16 + orrs r4, r0 + asrs r4, 8 +_081AA9C0: + adds r3, 0x1 + cmp r3, 0xF + ble _081AA994 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AA9CC: .4byte 0x03005d90 +_081AA9D0: .4byte 0x00000e22 +_081AA9D4: .4byte 0x00000e24 +_081AA9D8: .4byte 0x08613655 +_081AA9DC: .4byte 0x00000e26 +_081AA9E0: .4byte 0x00000e28 + thumb_func_end sub_81AA96C + + thumb_func_start sub_81AA9E4 +sub_81AA9E4: @ 81AA9E4 + push {r4,lr} + ldr r0, _081AAA1C + ldr r4, [r0] + ldr r1, _081AAA20 + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, _081AAA24 + adds r4, r0 + ldrh r0, [r4] + ldr r1, _081AAA28 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x21 + bhi _081AAA38 + ldr r1, _081AAA2C + lsls r0, r2, 1 + adds r0, r1 +_081AAA10: + ldrb r1, [r0] + cmp r3, r1 + bge _081AAA30 + ldrb r0, [r0, 0x1] + b _081AAA3A + .align 2, 0 +_081AAA1C: .4byte 0x03005d90 +_081AAA20: .4byte 0x00000e28 +_081AAA24: .4byte 0x00000cb2 +_081AAA28: .4byte 0x08613794 +_081AAA2C: .4byte 0x08613750 +_081AAA30: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x21 + bls _081AAA10 +_081AAA38: + movs r0, 0 +_081AAA3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81AA9E4 + + thumb_func_start sub_81AAA40 +sub_81AAA40: @ 81AAA40 + push {lr} + ldr r0, _081AAA58 + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r2, r0, r1 + movs r1, 0 + movs r3, 0xC7 + lsls r3, 4 + adds r0, r3 + b _081AAA6E + .align 2, 0 +_081AAA58: .4byte 0x03005d8c +_081AAA5C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _081AAA74 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 +_081AAA6E: + ldrb r0, [r0] + cmp r0, 0 + bne _081AAA5C +_081AAA74: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81AAA40 + + thumb_func_start sub_81AAA7C +sub_81AAA7C: @ 81AAA7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r1, _081AAAD4 + mov r8, r1 + lsls r1, r0, 2 + adds r1, r0 + movs r0, 0 + mov r12, r0 + lsls r4, r1, 1 + ldr r7, _081AAAD8 + movs r6, 0 + ldr r5, _081AAADC + lsls r2, r1, 2 +_081AAA9E: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r7 + adds r1, r2 + strh r6, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + mov r1, r12 + strb r1, [r0] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x9 + ble _081AAA9E + movs r0, 0x15 + movs r1, 0x1 + bl sub_80D7204 + movs r0, 0x22 + movs r1, 0x1 + bl sub_80D7204 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AAAD4: .4byte 0x03005d90 +_081AAAD8: .4byte 0x00000e2c +_081AAADC: .4byte 0x00000e54 + thumb_func_end sub_81AAA7C + + thumb_func_start sub_81AAAE0 +sub_81AAAE0: @ 81AAAE0 + push {r4-r6,lr} + ldr r0, _081AAB44 + ldr r1, [r0] + ldr r2, _081AAB48 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + lsls r0, r6, 1 + ldr r2, _081AAB4C + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + ble _081AAB0A + movs r4, 0x13 +_081AAB0A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, _081AAB50 + ldrb r0, [r3] + lsls r5, r4, 2 + cmp r0, r2 + bgt _081AAB36 +_081AAB28: + adds r1, 0x1 + cmp r1, 0x9 + bhi _081AAB3A + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + ble _081AAB28 +_081AAB36: + cmp r1, 0x9 + bls _081AAB3C +_081AAB3A: + movs r1, 0x9 +_081AAB3C: + cmp r6, 0 + bne _081AAB58 + ldr r2, _081AAB54 + b _081AAB5A + .align 2, 0 +_081AAB44: .4byte 0x03005d90 +_081AAB48: .4byte 0x00000ca9 +_081AAB4C: .4byte 0x00000e1a +_081AAB50: .4byte 0x08613f86 +_081AAB54: .4byte 0x0861379c +_081AAB58: + ldr r2, _081AAB6C +_081AAB5A: + lsls r1, 1 + adds r0, r5, r4 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081AAB6C: .4byte 0x0861392c + thumb_func_end sub_81AAAE0 + + thumb_func_start sub_81AAB70 +sub_81AAB70: @ 81AAB70 + push {r4,lr} + ldr r4, _081AAB98 + movs r0, 0 + strb r0, [r4, 0x5] + adds r0, r4, 0 + adds r0, 0x8 + movs r1, 0 + movs r2, 0xA + bl memset + adds r4, 0x12 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xA + bl memset + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AAB98: .4byte 0x0203ce58 + thumb_func_end sub_81AAB70 + + thumb_func_start c2_bag +c2_bag: @ 81AAB9C + push {lr} + ldr r2, _081AABAC + movs r0, 0 + movs r1, 0x5 + bl sub_81AAC90 + pop {r0} + bx r0 + .align 2, 0 +_081AABAC: .4byte sub_8086194 + 1 + thumb_func_end c2_bag + + thumb_func_start sub_81AABB0 +sub_81AABB0: @ 81AABB0 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _081AABCC + ldr r2, _081AABC8 + movs r0, 0x1 + movs r1, 0x5 + bl sub_81AAC90 + b _081AABD4 + .align 2, 0 +_081AABC8: .4byte sub_8059D50 + 1 +_081AABCC: + ldr r1, _081AABD8 + movs r0, 0x1 + bl sub_81C4F98 +_081AABD4: + pop {r0} + bx r0 + .align 2, 0 +_081AABD8: .4byte sub_8059D50 + 1 + thumb_func_end sub_81AABB0 + + thumb_func_start c2_810A554 +c2_810A554: @ 81AABDC + push {lr} + ldr r2, _081AABEC + movs r0, 0x4 + movs r1, 0x3 + bl sub_81AAC90 + pop {r0} + bx r0 + .align 2, 0 +_081AABEC: .4byte sub_80861B0 + 1 + thumb_func_end c2_810A554 + + thumb_func_start sub_81AABF0 +sub_81AABF0: @ 81AABF0 + push {lr} + adds r2, r0, 0 + movs r0, 0x5 + movs r1, 0x3 + bl sub_81AAC90 + pop {r0} + bx r0 + thumb_func_end sub_81AABF0 + + thumb_func_start sub_81AAC00 +sub_81AAC00: @ 81AAC00 + push {lr} + ldr r2, _081AAC10 + movs r0, 0x3 + movs r1, 0x5 + bl sub_81AAC90 + pop {r0} + bx r0 + .align 2, 0 +_081AAC10: .4byte sub_80DFC48 + 1 + thumb_func_end sub_81AAC00 + + thumb_func_start sub_81AAC14 +sub_81AAC14: @ 81AAC14 + push {lr} + ldr r2, _081AAC24 + movs r0, 0x6 + movs r1, 0x5 + bl sub_81AAC90 + pop {r0} + bx r0 + .align 2, 0 +_081AAC24: .4byte sub_816B31C + 1 + thumb_func_end sub_81AAC14 + + thumb_func_start sub_81AAC28 +sub_81AAC28: @ 81AAC28 + push {lr} + ldr r2, _081AAC44 + movs r0, 0x9 + movs r1, 0x5 + bl sub_81AAC90 + ldr r0, _081AAC48 + movs r1, 0 + strh r1, [r0] + ldr r0, _081AAC4C + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_081AAC44: .4byte sub_81ADE6C + 1 +_081AAC48: .4byte 0x020375e2 +_081AAC4C: .4byte 0x020375f0 + thumb_func_end sub_81AAC28 + + thumb_func_start sub_81AAC50 +sub_81AAC50: @ 81AAC50 + push {lr} + ldr r2, _081AAC68 + movs r0, 0x7 + movs r1, 0x5 + bl sub_81AAC90 + ldr r1, _081AAC6C + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081AAC68: .4byte sub_81ADEBC + 1 +_081AAC6C: .4byte 0x020375f0 + thumb_func_end sub_81AAC50 + + thumb_func_start sub_81AAC70 +sub_81AAC70: @ 81AAC70 + push {lr} + ldr r2, _081AAC88 + movs r0, 0x8 + movs r1, 0x5 + bl sub_81AAC90 + ldr r1, _081AAC8C + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081AAC88: .4byte sub_81ADF00 + 1 +_081AAC8C: .4byte 0x020375f0 + thumb_func_end sub_81AAC70 + + thumb_func_start sub_81AAC90 +sub_81AAC90: @ 81AAC90 + push {r4-r7,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, _081AACB4 + ldr r0, _081AACB8 + bl malloc_and_clear + str r0, [r6] + cmp r0, 0 + bne _081AACBC + adds r0, r4, 0 + bl set_callback2 + b _081AAD3A + .align 2, 0 +_081AACB4: .4byte 0x0203ce54 +_081AACB8: .4byte 0x00000c48 +_081AACBC: + ldr r0, _081AAD40 + cmp r5, 0xC + beq _081AACC4 + strb r5, [r0, 0x4] +_081AACC4: + cmp r4, 0 + beq _081AACCA + str r4, [r0] +_081AACCA: + cmp r7, 0x4 + bhi _081AACD0 + strb r7, [r0, 0x5] +_081AACD0: + ldrb r0, [r0, 0x4] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081AACF0 + ldr r2, [r6] + ldr r0, _081AAD44 + adds r2, r0 + ldrb r1, [r2] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_081AACF0: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, _081AAD48 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, _081AAD4C + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, _081AAD50 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, _081AAD54 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xC + bl memset + ldr r0, [r6] + movs r1, 0x81 + lsls r1, 4 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xA + bl memset + ldr r0, _081AAD58 + bl set_callback2 +_081AAD3A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AAD40: .4byte 0x0203ce58 +_081AAD44: .4byte 0x0000081b +_081AAD48: .4byte 0x0000081a +_081AAD4C: .4byte 0x0000081e +_081AAD50: .4byte 0x0000081f +_081AAD54: .4byte 0x00000804 +_081AAD58: .4byte c2_bag_2 + 1 + thumb_func_end sub_81AAC90 + + thumb_func_start c2_bag_3 +c2_bag_3: @ 81AAD5C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end c2_bag_3 + + thumb_func_start vblank_cb_bag_menu +vblank_cb_bag_menu: @ 81AAD78 + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end vblank_cb_bag_menu + + thumb_func_start c2_bag_2 +c2_bag_2: @ 81AAD8C + push {lr} +_081AAD8E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl setup_bag_menu + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AAD8E +_081AADB2: + pop {r0} + bx r0 + thumb_func_end c2_bag_2 + + thumb_func_start setup_bag_menu +setup_bag_menu: @ 81AADB8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _081AADD8 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x14 + bls _081AADCE + b _081AB02C +_081AADCE: + lsls r0, 2 + ldr r1, _081AADDC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AADD8: .4byte 0x030022c0 +_081AADDC: .4byte _081AADE0 + .align 2, 0 +_081AADE0: + .4byte _081AAE34 + .4byte _081AAE3E + .4byte _081AAE50 + .4byte _081AAE56 + .4byte _081AAE78 + .4byte _081AAE7E + .4byte _081AAE86 + .4byte _081AAEA4 + .4byte _081AAECC + .4byte _081AAEDA + .4byte _081AAEEC + .4byte _081AAEFA + .4byte _081AAF0C + .4byte _081AAF1C + .4byte _081AAF54 + .4byte _081AAFA0 + .4byte _081AAFBC + .4byte _081AAFC2 + .4byte _081AAFD8 + .4byte _081AAFDE + .4byte _081AAFF8 +_081AAE34: + bl vblank_hblank_handler_set_zero + bl clear_scheduled_bg_copies_to_vram + b _081AB012 +_081AAE3E: + bl remove_some_task + ldr r1, _081AAE4C + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAE4C: .4byte 0x030022c0 +_081AAE50: + bl gpu_pal_allocator_reset + b _081AB012 +_081AAE56: + bl sub_80A1A74 + ldr r2, _081AAE70 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, _081AAE74 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAE70: .4byte 0x02037fd4 +_081AAE74: .4byte 0x030022c0 +_081AAE78: + bl reset_all_obj_data + b _081AB012 +_081AAE7E: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081AB01A +_081AAE86: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AAE94 + bl clear_tasks +_081AAE94: + ldr r1, _081AAEA0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAEA0: .4byte 0x030022c0 +_081AAEA4: + bl bag_menu_init_bgs + ldr r0, _081AAEC0 + ldr r0, [r0] + ldr r1, _081AAEC4 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r1, _081AAEC8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAEC0: .4byte 0x0203ce54 +_081AAEC4: .4byte 0x00000834 +_081AAEC8: .4byte 0x030022c0 +_081AAECC: + bl load_bag_menu_graphics + lsls r0, 24 + cmp r0, 0 + bne _081AAED8 + b _081AB044 +_081AAED8: + b _081AB012 +_081AAEDA: + bl setup_bag_menu_textboxes + ldr r1, _081AAEE8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAEE8: .4byte 0x030022c0 +_081AAEEC: + bl sub_81ABA6C + bl sub_81ABAC4 + bl sub_81ABAE0 + b _081AB012 +_081AAEFA: + bl allocate_bag_item_list_buffers + ldr r1, _081AAF08 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAF08: .4byte 0x030022c0 +_081AAF0C: + ldr r0, _081AAF18 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + b _081AB012 + .align 2, 0 +_081AAF18: .4byte 0x0203ce58 +_081AAF1C: + ldr r1, _081AAF48 + ldr r4, _081AAF4C + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl sub_81ADF20 + movs r0, 0 + bl sub_81ADFF8 + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + ldr r1, _081AAF50 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAF48: .4byte 0x085e91fc +_081AAF4C: .4byte 0x0203ce58 +_081AAF50: .4byte 0x030022c0 +_081AAF54: + ldr r4, _081AAF94 + ldrb r0, [r4, 0x4] + bl sub_81AB1F0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081AAF98 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x8 + adds r2, r4 + ldrh r2, [r2] + bl calls_per_item_funcs_in_list_outer + ldr r2, _081AAF9C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r1, 0xE] + strh r2, [r1, 0x18] + b _081AB012 + .align 2, 0 +_081AAF94: .4byte 0x0203ce58 +_081AAF98: .4byte 0x03006310 +_081AAF9C: .4byte 0x03005e00 +_081AAFA0: + ldr r0, _081AAFB4 + ldrb r0, [r0, 0x5] + bl sub_80D4D00 + ldr r1, _081AAFB8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAFB4: .4byte 0x0203ce58 +_081AAFB8: .4byte 0x030022c0 +_081AAFBC: + bl sub_80D4FAC + b _081AB012 +_081AAFC2: + bl sub_81AB7BC + bl sub_81AB854 + ldr r1, _081AAFD4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAFD4: .4byte 0x030022c0 +_081AAFD8: + bl sub_81AE2B4 + b _081AB012 +_081AAFDE: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, _081AAFF4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .align 2, 0 +_081AAFF4: .4byte 0x030022c0 +_081AAFF8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _081AB024 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_081AB012: + ldr r1, _081AB028 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081AB01A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081AB044 + .align 2, 0 +_081AB024: .4byte 0x02037fd4 +_081AB028: .4byte 0x030022c0 +_081AB02C: + ldr r0, _081AB03C + bl SetVBlankCallback + ldr r0, _081AB040 + bl set_callback2 + movs r0, 0x1 + b _081AB046 + .align 2, 0 +_081AB03C: .4byte vblank_cb_bag_menu + 1 +_081AB040: .4byte c2_bag_3 + 1 +_081AB044: + movs r0, 0 +_081AB046: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end setup_bag_menu + + thumb_func_start bag_menu_init_bgs +bag_menu_init_bgs: @ 81AB050 + push {r4,lr} + bl sub_8121DA0 + ldr r4, _081AB0B4 + ldr r0, [r4] + adds r0, 0x4 + movs r2, 0x80 + lsls r2, 4 + movs r1, 0 + bl memset + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081AB0B8 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0x2 + bl bg_set_tilemap + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB0B4: .4byte 0x0203ce54 +_081AB0B8: .4byte 0x08613f90 + thumb_func_end bag_menu_init_bgs + + thumb_func_start load_bag_menu_graphics +load_bag_menu_graphics: @ 81AB0BC + push {r4,lr} + sub sp, 0x4 + ldr r4, _081AB0DC + ldr r0, [r4] + ldr r1, _081AB0E0 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _081AB0D2 + b _081AB1CC +_081AB0D2: + lsls r0, 2 + ldr r1, _081AB0E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AB0DC: .4byte 0x0203ce54 +_081AB0E0: .4byte 0x00000834 +_081AB0E4: .4byte _081AB0E8 + .align 2, 0 +_081AB0E8: + .4byte _081AB0FC + .4byte _081AB118 + .4byte _081AB13C + .4byte _081AB174 + .4byte _081AB1A8 +_081AB0FC: + bl reset_temp_tile_data_buffers + ldr r1, _081AB114 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081AB1AE + .align 2, 0 +_081AB114: .4byte 0x08d9a620 +_081AB118: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB1E4 + ldr r0, _081AB134 + ldr r4, _081AB138 + ldr r1, [r4] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r1, [r4] + b _081AB1B2 + .align 2, 0 +_081AB134: .4byte 0x08d9a88c +_081AB138: .4byte 0x0203ce54 +_081AB13C: + bl sub_81ADC54 + lsls r0, 24 + cmp r0, 0 + bne _081AB164 + ldr r0, _081AB15C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _081AB164 + ldr r0, _081AB160 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _081AB1AE + .align 2, 0 +_081AB15C: .4byte 0x03005d90 +_081AB160: .4byte 0x08d9a5d4 +_081AB164: + ldr r0, _081AB170 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _081AB1AE + .align 2, 0 +_081AB170: .4byte 0x08d9a588 +_081AB174: + bl sub_81ADC54 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB18A + ldr r0, _081AB194 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081AB19C +_081AB18A: + ldr r0, _081AB198 + bl gpu_tile_obj_decompress_and_load + b _081AB1AE + .align 2, 0 +_081AB194: .4byte 0x03005d90 +_081AB198: .4byte 0x0857fb34 +_081AB19C: + ldr r0, _081AB1A4 + bl gpu_tile_obj_decompress_and_load + b _081AB1AE + .align 2, 0 +_081AB1A4: .4byte 0x0857fb3c +_081AB1A8: + ldr r0, _081AB1C0 + bl gpu_pal_obj_decompress_and_apply +_081AB1AE: + ldr r0, _081AB1C4 + ldr r1, [r0] +_081AB1B2: + ldr r0, _081AB1C8 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081AB1E4 + .align 2, 0 +_081AB1C0: .4byte 0x0857fb44 +_081AB1C4: .4byte 0x0203ce54 +_081AB1C8: .4byte 0x00000834 +_081AB1CC: + bl sub_8122328 + ldr r0, [r4] + ldr r1, _081AB1E0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081AB1E6 + .align 2, 0 +_081AB1E0: .4byte 0x00000834 +_081AB1E4: + movs r0, 0 +_081AB1E6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end load_bag_menu_graphics + + thumb_func_start sub_81AB1F0 +sub_81AB1F0: @ 81AB1F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081AB204 + ldr r0, _081AB200 + b _081AB206 + .align 2, 0 +_081AB200: .4byte sub_81ADD98 + 1 +_081AB204: + ldr r0, _081AB214 +_081AB206: + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081AB214: .4byte sub_81ABD28 + 1 + thumb_func_end sub_81AB1F0 + + thumb_func_start allocate_bag_item_list_buffers +allocate_bag_item_list_buffers: @ 81AB218 + push {r4,lr} + ldr r4, _081AB238 + movs r0, 0x82 + lsls r0, 2 + bl malloc + str r0, [r4] + ldr r4, _081AB23C + movs r0, 0xC3 + lsls r0, 3 + bl malloc + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB238: .4byte 0x0203ce74 +_081AB23C: .4byte 0x0203ce78 + thumb_func_end allocate_bag_item_list_buffers + + thumb_func_start load_bag_item_list_buffers +load_bag_item_list_buffers: @ 81AB240 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 3 + ldr r0, _081AB2E0 + adds r1, r0 + mov r8, r1 + ldr r0, _081AB2E4 + ldr r2, [r0] + ldr r1, _081AB2E8 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB2FC + movs r6, 0 + ldr r3, _081AB2EC + adds r0, r2, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081AB2B6 + ldr r5, _081AB2F0 +_081AB276: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, _081AB2F4 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _081AB2E4 + ldr r0, [r0] + ldr r3, _081AB2EC + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + blt _081AB276 +_081AB2B6: + ldr r5, _081AB2F0 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + ldr r1, _081AB2F8 + bl gf_strcpy + ldr r0, _081AB2F4 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + movs r0, 0x2 + negs r0, r0 + str r0, [r1, 0x4] + b _081AB34A + .align 2, 0 +_081AB2E0: .4byte 0x02039dd8 +_081AB2E4: .4byte 0x0203ce54 +_081AB2E8: .4byte 0x0000081b +_081AB2EC: .4byte 0x00000829 +_081AB2F0: .4byte 0x0203ce78 +_081AB2F4: .4byte 0x0203ce74 +_081AB2F8: .4byte 0x085e8db4 +_081AB2FC: + movs r6, 0 + ldr r4, _081AB380 + adds r0, r2, r4 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcs _081AB34A + ldr r5, _081AB384 +_081AB30C: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, _081AB388 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _081AB38C + ldr r0, [r0] + ldr r3, _081AB380 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcc _081AB30C +_081AB34A: + ldr r2, _081AB390 + adds r1, r2, 0 + ldr r0, _081AB394 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, _081AB38C + ldr r1, [r0] + ldr r4, _081AB380 + adds r0, r1, r4 + adds r0, r7 + ldrb r0, [r0] + strh r0, [r2, 0xC] + ldr r0, _081AB388 + ldr r0, [r0] + str r0, [r2] + ldr r5, _081AB398 + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AB380: .4byte 0x00000829 +_081AB384: .4byte 0x0203ce78 +_081AB388: .4byte 0x0203ce74 +_081AB38C: .4byte 0x0203ce54 +_081AB390: .4byte 0x03006310 +_081AB394: .4byte 0x08613f9c +_081AB398: .4byte 0x0000082e + thumb_func_end load_bag_item_list_buffers + + thumb_func_start get_name +get_name: @ 81AB39C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, _081AB3BC + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + beq _081AB3C0 + cmp r0, 0x3 + beq _081AB420 + adds r0, r5, 0 + adds r1, r6, 0 + bl itemid_get_name + b _081AB43E + .align 2, 0 +_081AB3BC: .4byte 0x0203ce58 +_081AB3C0: + ldr r4, _081AB3F4 + adds r0, r5, 0 + bl sub_81B6CFC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, _081AB3F8 + adds r1, r0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0xA9 + lsls r0, 1 + cmp r5, r0 + bls _081AB408 + ldr r0, _081AB3FC + ldr r2, _081AB400 + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x1 + bl decimal_int_to_string + ldr r1, _081AB404 + b _081AB438 + .align 2, 0 +_081AB3F4: .4byte 0x02021dc4 +_081AB3F8: .4byte 0x0831977c +_081AB3FC: .4byte 0x02021cc4 +_081AB400: .4byte 0xfffffeae +_081AB404: .4byte 0x085e921a +_081AB408: + ldr r0, _081AB418 + ldr r2, _081AB41C + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + b _081AB436 + .align 2, 0 +_081AB418: .4byte 0x02021cc4 +_081AB41C: .4byte 0xfffffee0 +_081AB420: + ldr r0, _081AB444 + adds r1, r5, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _081AB448 + adds r0, r5, 0 + bl itemid_get_name +_081AB436: + ldr r1, _081AB44C +_081AB438: + adds r0, r6, 0 + bl ExpandTextCodes +_081AB43E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AB444: .4byte 0x02021cc4 +_081AB448: .4byte 0x02021dc4 +_081AB44C: .4byte 0x085e9210 + thumb_func_end get_name + + thumb_func_start sub_81AB450 +sub_81AB450: @ 81AB450 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081AB466 + movs r0, 0x5 + bl audio_play + bl sub_80D4DC4 +_081AB466: + ldr r4, _081AB4B8 + ldr r1, [r4] + ldr r2, _081AB4BC + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB50C + adds r2, 0x1 + adds r0, r1, r2 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + bl sub_80D4F98 + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081AB4C8 + ldr r0, _081AB4C0 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 16 + lsrs r1, 16 + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + ldr r2, _081AB4C4 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl sub_80D4F38 + b _081AB4DA + .align 2, 0 +_081AB4B8: .4byte 0x0203ce54 +_081AB4BC: .4byte 0x0000081a +_081AB4C0: .4byte 0x0203ce58 +_081AB4C4: .4byte 0x0000081b +_081AB4C8: + ldr r0, _081AB514 + ldr r1, [r4] + ldr r2, _081AB518 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl sub_80D4F38 +_081AB4DA: + ldr r5, _081AB51C + ldr r2, [r5] + ldr r4, _081AB518 + adds r2, r4 + ldrb r3, [r2] + lsls r0, r3, 26 + lsrs r0, 30 + movs r1, 0x1 + eors r1, r0 + lsls r1, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081AB50C + adds r0, r6, 0 + bl bag_menu_print_description_box_text +_081AB50C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AB514: .4byte 0x0000ffff +_081AB518: .4byte 0x0000081b +_081AB51C: .4byte 0x0203ce54 + thumb_func_end sub_81AB450 + + thumb_func_start sub_81AB520 +sub_81AB520: @ 81AB520 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081AB540 + b _081AB696 +_081AB540: + ldr r0, _081AB560 + ldr r0, [r0] + ldr r1, _081AB564 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _081AB570 + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081AB568 + adds r0, r7, 0 + movs r1, 0x2 + bl sub_81AB75C + b _081AB570 + .align 2, 0 +_081AB560: .4byte 0x0203ce54 +_081AB564: .4byte 0x0000081a +_081AB568: + adds r0, r7, 0 + movs r1, 0xFF + bl sub_81AB75C +_081AB570: + ldr r5, _081AB5F8 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r6, r0, 16 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl bag_pocket_get_item_quantity + lsls r0, 16 + lsrs r4, r0, 16 + mov r9, r4 + ldr r1, _081AB5FC + adds r0, r6, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bhi _081AB5BE + ldr r1, _081AB600 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x10 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x8 + bl Window_CopyWholePixelBlockToWindow +_081AB5BE: + ldrb r0, [r5, 0x5] + cmp r0, 0x3 + bne _081AB610 + ldr r0, _081AB604 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _081AB608 + ldr r1, _081AB60C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl sub_81DB368 + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r1, [sp, 0x10] + b _081AB652 + .align 2, 0 +_081AB5F8: .4byte 0x0203ce58 +_081AB5FC: .4byte 0xfffffead +_081AB600: .4byte 0x08dc6378 +_081AB604: .4byte 0x02021cc4 +_081AB608: .4byte 0x02021fc4 +_081AB60C: .4byte 0x085e8da0 +_081AB610: + cmp r0, 0x4 + beq _081AB66C + adds r0, r6, 0 + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081AB66C + ldr r0, _081AB660 + mov r1, r9 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081AB664 + ldr r1, _081AB668 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl sub_81DB368 + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r5, [sp, 0x10] +_081AB652: + mov r0, r8 + movs r1, 0x7 + adds r2, r4, 0 + bl sub_81AE0BC + b _081AB696 + .align 2, 0 +_081AB660: .4byte 0x02021cc4 +_081AB664: .4byte 0x02021fc4 +_081AB668: .4byte 0x085e8da0 +_081AB66C: + ldr r0, _081AB6A4 + ldr r0, [r0] + ldr r1, _081AB6A8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081AB696 + cmp r0, r6 + bne _081AB696 + ldr r1, _081AB6AC + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x18 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x60 + bl Window_CopyWholePixelBlockToWindow +_081AB696: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AB6A4: .4byte 0x03005d8c +_081AB6A8: .4byte 0x00000496 +_081AB6AC: .4byte 0x086140a4 + thumb_func_end sub_81AB520 + + thumb_func_start bag_menu_print_description_box_text +bag_menu_print_description_box_text: @ 81AB6B0 + push {r4,lr} + sub sp, 0x14 + adds r1, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081AB6E0 + ldr r0, _081AB6DC + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + bl itemid_get_description + adds r4, r0, 0 + b _081AB6FC + .align 2, 0 +_081AB6DC: .4byte 0x0203ce58 +_081AB6E0: + ldr r0, _081AB728 + ldr r2, _081AB72C + ldr r1, _081AB730 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r4, _081AB734 + ldr r1, _081AB738 + adds r0, r4, 0 + bl ExpandTextCodes +_081AB6FC: + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_81AE0BC + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB728: .4byte 0x02021cc4 +_081AB72C: .4byte 0x085e9180 +_081AB730: .4byte 0x0203ce58 +_081AB734: .4byte 0x02021fc4 +_081AB738: .4byte 0x085e91c0 + thumb_func_end bag_menu_print_description_box_text + + thumb_func_start sub_81AB73C +sub_81AB73C: @ 81AB73C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl sub_81AE88C + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_81AB75C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81AB73C + + thumb_func_start sub_81AB75C +sub_81AB75C: @ 81AB75C + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0xFF + bne _081AB798 + movs r0, 0x1 + movs r1, 0 + bl sub_8006460 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8006460 + 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 Window_FillPixelRect + b _081AB7AE +_081AB798: + ldr r2, _081AB7B8 + str r5, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0 + bl sub_81AE0BC +_081AB7AE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AB7B8: .4byte 0x085e8d60 + thumb_func_end sub_81AB75C + + thumb_func_start sub_81AB7BC +sub_81AB7BC: @ 81AB7BC + push {r4-r6,lr} + sub sp, 0x10 + ldr r5, _081AB814 + ldr r4, [r5] + ldr r1, _081AB818 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB80A + ldr r2, _081AB81C + ldrb r3, [r2, 0x5] + ldr r6, _081AB820 + adds r0, r4, r6 + adds r0, r3 + ldrb r1, [r0] + adds r6, 0x5 + adds r0, r4, r6 + adds r0, r3 + ldrb r0, [r0] + subs r1, r0 + str r1, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r2, 0x12 + adds r0, r2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl sub_81AF4A0 + ldr r1, [r5] + ldr r2, _081AB818 + adds r1, r2 + strb r0, [r1] +_081AB80A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AB814: .4byte 0x0203ce54 +_081AB818: .4byte 0x0000081e +_081AB81C: .4byte 0x0203ce58 +_081AB820: .4byte 0x00000829 + thumb_func_end sub_81AB7BC + + thumb_func_start sub_81AB824 +sub_81AB824: @ 81AB824 + push {r4,lr} + ldr r4, _081AB84C + ldr r0, [r4] + ldr r2, _081AB850 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB842 + bl sub_81AF620 + ldr r0, [r4] + ldr r1, _081AB850 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB842: + bl sub_81AB89C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB84C: .4byte 0x0203ce54 +_081AB850: .4byte 0x0000081e + thumb_func_end sub_81AB824 + + thumb_func_start sub_81AB854 +sub_81AB854: @ 81AB854 + push {r4,lr} + ldr r4, _081AB888 + ldr r2, [r4] + ldr r1, _081AB88C + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + beq _081AB882 + ldr r1, _081AB890 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB882 + ldr r0, _081AB894 + ldr r1, _081AB898 + bl sub_81AF380 + ldr r1, [r4] + ldr r2, _081AB890 + adds r1, r2 + strb r0, [r1] +_081AB882: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB888: .4byte 0x0203ce54 +_081AB88C: .4byte 0x0000081b +_081AB890: .4byte 0x0000081f +_081AB894: .4byte 0x08614094 +_081AB898: .4byte 0x0203ce5e + thumb_func_end sub_81AB854 + + thumb_func_start sub_81AB89C +sub_81AB89C: @ 81AB89C + push {r4,lr} + ldr r4, _081AB8C0 + ldr r0, [r4] + ldr r2, _081AB8C4 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB8BA + bl sub_81AF620 + ldr r0, [r4] + ldr r1, _081AB8C4 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB8BA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB8C0: .4byte 0x0203ce54 +_081AB8C4: .4byte 0x0000081f + thumb_func_end sub_81AB89C + + thumb_func_start free_bag_item_list_buffers +free_bag_item_list_buffers: @ 81AB8C8 + push {lr} + ldr r0, _081AB8EC + ldr r0, [r0] + bl free + ldr r0, _081AB8F0 + ldr r0, [r0] + bl free + bl Window_FreeMemory + ldr r0, _081AB8F4 + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_081AB8EC: .4byte 0x0203ce78 +_081AB8F0: .4byte 0x0203ce74 +_081AB8F4: .4byte 0x0203ce54 + thumb_func_end free_bag_item_list_buffers + + thumb_func_start task_close_bag_menu_1 +task_close_bag_menu_1: @ 81AB8F8 + 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 sub_80A1AD4 + ldr r1, _081AB928 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081AB92C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AB928: .4byte 0x03005e00 +_081AB92C: .4byte task_close_bag_menu_2 + 1 + thumb_func_end task_close_bag_menu_1 + + thumb_func_start task_close_bag_menu_2 +task_close_bag_menu_2: @ 81AB930 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081AB974 + adds r2, r0, r1 + ldr r0, _081AB978 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB9A0 + ldrb r0, [r2] + ldr r4, _081AB97C + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, r4, 0 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + ldr r0, _081AB980 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081AB984 + bl set_callback2 + b _081AB98A + .align 2, 0 +_081AB974: .4byte 0x03005e08 +_081AB978: .4byte 0x02037fd4 +_081AB97C: .4byte 0x0203ce58 +_081AB980: .4byte 0x0203ce54 +_081AB984: + ldr r0, [r4] + bl set_callback2 +_081AB98A: + bl sub_81AB824 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl free_bag_item_list_buffers + adds r0, r5, 0 + bl remove_task +_081AB9A0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_close_bag_menu_2 + + thumb_func_start sub_81AB9A8 +sub_81AB9A8: @ 81AB9A8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 3 + ldr r0, _081AB9C4 + adds r4, r1, r0 + cmp r5, 0x3 + bgt _081AB9C8 + cmp r5, 0x2 + blt _081AB9C8 + adds r0, r4, 0 + bl sub_80D6FB4 + b _081AB9CE + .align 2, 0 +_081AB9C4: .4byte 0x02039dd8 +_081AB9C8: + adds r0, r4, 0 + bl sub_80D6F64 +_081AB9CE: + ldr r0, _081ABA48 + ldr r1, [r0] + ldr r6, _081ABA4C + adds r1, r6 + adds r1, r5 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 + ldrb r0, [r4, 0x4] + cmp r2, r0 + bcs _081ABA12 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _081ABA12 + adds r7, r3, 0 +_081AB9EE: + ldr r0, [r7] + adds r0, r6 + adds r0, r5 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r1, [r4, 0x4] + cmp r2, r1 + bcs _081ABA12 + ldr r0, [r4] + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081AB9EE +_081ABA12: + ldr r2, [r3] + ldr r1, _081ABA50 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ABA2E + ldr r0, _081ABA4C + adds r1, r2, r0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081ABA2E: + ldr r1, [r3] + ldr r2, _081ABA4C + adds r0, r1, r2 + adds r0, r5 + ldrb r2, [r0] + cmp r2, 0x8 + bls _081ABA58 + ldr r3, _081ABA54 + adds r0, r1, r3 + adds r0, r5 + movs r1, 0x8 + strb r1, [r0] + b _081ABA60 + .align 2, 0 +_081ABA48: .4byte 0x0203ce54 +_081ABA4C: .4byte 0x00000829 +_081ABA50: .4byte 0x0000081b +_081ABA54: .4byte 0x0000082e +_081ABA58: + ldr r3, _081ABA68 + adds r0, r1, r3 + adds r0, r5 + strb r2, [r0] +_081ABA60: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ABA68: .4byte 0x0000082e + thumb_func_end sub_81AB9A8 + + thumb_func_start sub_81ABA6C +sub_81ABA6C: @ 81ABA6C + push {r4,lr} + movs r4, 0 +_081ABA70: + adds r0, r4, 0 + bl sub_81AB9A8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABA70 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABA6C + + thumb_func_start sub_81ABA88 +sub_81ABA88: @ 81ABA88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + ldr r2, _081ABAB8 + adds r4, r1, r2 + subs r2, 0xA + adds r1, r2 + ldr r2, _081ABABC + ldr r3, [r2] + ldr r5, _081ABAC0 + adds r2, r3, r5 + adds r2, r0 + ldrb r2, [r2] + subs r5, 0x5 + adds r3, r5 + adds r3, r0 + ldrb r3, [r3] + adds r0, r4, 0 + bl sub_812225C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081ABAB8: .4byte 0x0203ce6a +_081ABABC: .4byte 0x0203ce54 +_081ABAC0: .4byte 0x0000082e + thumb_func_end sub_81ABA88 + + thumb_func_start sub_81ABAC4 +sub_81ABAC4: @ 81ABAC4 + push {r4,lr} + movs r4, 0 +_081ABAC8: + adds r0, r4, 0 + bl sub_81ABA88 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABAC8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABAC4 + + thumb_func_start sub_81ABAE0 +sub_81ABAE0: @ 81ABAE0 + push {r4-r7,lr} + sub sp, 0x4 + movs r5, 0 + ldr r6, _081ABB20 + adds r7, r6, 0 + subs r7, 0xA +_081ABAEC: + lsls r1, r5, 1 + adds r0, r1, r6 + adds r1, r7 + ldr r2, _081ABB24 + ldr r3, [r2] + ldr r4, _081ABB28 + adds r2, r3, r4 + adds r2, r5 + ldrb r2, [r2] + subs r4, 0x5 + adds r3, r4 + adds r3, r5 + ldrb r3, [r3] + movs r4, 0x8 + str r4, [sp] + bl sub_8122298 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _081ABAEC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ABB20: .4byte 0x0203ce6a +_081ABB24: .4byte 0x0203ce54 +_081ABB28: .4byte 0x0000082e + thumb_func_end sub_81ABAE0 + + thumb_func_start sub_81ABB2C +sub_81ABB2C: @ 81ABB2C + lsls r0, 24 + ldr r1, _081ABB48 + lsrs r0, 23 + adds r2, r1, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, 0x8 + adds r0, r1 + ldrb r0, [r0] + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_081ABB48: .4byte 0x0203ce58 + thumb_func_end sub_81ABB2C + + thumb_func_start sub_81ABB4C +sub_81ABB4C: @ 81ABB4C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _081ABBB8 + adds r4, r0 + movs r0, 0x4 + bl sub_81AE1C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x11 + bl Window_FastFillPixels + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4, 0x14] + str r6, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0xA + movs r3, 0xD + bl sub_8121E7C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081ABBB8: .4byte 0x03005e08 + thumb_func_end sub_81ABB4C + + thumb_func_start sub_81ABBBC +sub_81ABBBC: @ 81ABBBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 2 + adds r5, r6 + lsls r5, 3 + ldr r0, _081ABC30 + adds r5, r0 + ldr r7, _081ABC34 + ldrb r4, [r7, 0x5] + lsls r4, 1 + movs r0, 0x12 + adds r0, r7 + mov r8, r0 + add r8, r4 + adds r0, r7, 0 + adds r0, 0x8 + adds r4, r0 + movs r0, 0x4 + bl sub_81AE1F8 + ldrb r0, [r5] + mov r1, r8 + adds r2, r4, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081ABC38 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r4] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ABC30: .4byte 0x03005e08 +_081ABC34: .4byte 0x0203ce58 +_081ABC38: .4byte 0x03006310 + thumb_func_end sub_81ABBBC + + thumb_func_start sub_81ABC3C +sub_81ABC3C: @ 81ABC3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_81AE13C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81ABC54 + pop {r0} + bx r0 + thumb_func_end sub_81ABC3C + + thumb_func_start sub_81ABC54 +sub_81ABC54: @ 81ABC54 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r0, _081ABCB0 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABC6C + movs r3, 0x3 +_081ABC6C: + ldr r0, _081ABCB4 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + bl decimal_int_to_string + ldr r4, _081ABCB8 + ldr r1, _081ABCBC + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl sub_81DB35C + 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] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081ABCB0: .4byte 0x0203ce58 +_081ABCB4: .4byte 0x02021cc4 +_081ABCB8: .4byte 0x02021fc4 +_081ABCBC: .4byte 0x085e8da0 + thumb_func_end sub_81ABC54 + + thumb_func_start sub_81ABCC0 +sub_81ABCC0: @ 81ABCC0 + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r7, r2, 0 + ldr r0, _081ABD18 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABCD4 + movs r3, 0x3 +_081ABCD4: + ldr r0, _081ABD1C + movs r2, 0x2 + bl decimal_int_to_string + ldr r6, _081ABD20 + ldr r1, _081ABD24 + adds r0, r6, 0 + bl ExpandTextCodes + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0 + bl Print + str r5, [sp] + adds r0, r4, 0 + movs r1, 0x26 + movs r2, 0x1 + adds r3, r7, 0 + bl PrintMoneyAmount + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ABD18: .4byte 0x0203ce58 +_081ABD1C: .4byte 0x02021cc4 +_081ABD20: .4byte 0x02021fc4 +_081ABD24: .4byte 0x085e8da0 + thumb_func_end sub_81ABCC0 + + thumb_func_start sub_81ABD28 +sub_81ABD28: @ 81ABD28 + 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 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + str r0, [sp] + ldr r1, _081ABDA8 + adds r6, r0, r1 + ldr r5, _081ABDAC + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r7, r0, r1 + subs r1, 0xA + adds r0, r1 + mov r8, r0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ABD66 + b _081ABEB2 +_081ABD66: + ldr r0, _081ABDB0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ABD74 + b _081ABEB2 +_081ABD74: + bl sub_81ABF10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDB8 + cmp r0, 0x2 + beq _081ABDC0 + ldr r0, _081ABDB4 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + cmp r0, 0 + beq _081ABE10 + bl sub_81AC2C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDA4 + b _081ABEB2 +_081ABDA4: + b _081ABDCC + .align 2, 0 +_081ABDA8: .4byte 0x03005e08 +_081ABDAC: .4byte 0x0203ce58 +_081ABDB0: .4byte 0x02037fd4 +_081ABDB4: .4byte 0x030022c0 +_081ABDB8: + movs r1, 0x1 + negs r1, r1 + mov r0, r9 + b _081ABDC4 +_081ABDC0: + mov r0, r9 + movs r1, 0x1 +_081ABDC4: + movs r2, 0 + bl sub_81ABFA8 + b _081ABEB2 +_081ABDCC: + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + ldrh r2, [r7] + mov r3, r8 + ldrh r0, [r3] + adds r2, r0 + ldr r0, _081ABE04 + ldr r0, [r0] + ldr r1, _081ABE08 + ldr r3, _081ABE0C + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r2, r0 + beq _081ABEB2 + movs r0, 0x5 + bl audio_play + mov r0, r9 + bl sub_81AC2E8 + b _081ABEB2 + .align 2, 0 +_081ABE04: .4byte 0x0203ce54 +_081ABE08: .4byte 0x0203ce58 +_081ABE0C: .4byte 0x00000829 +_081ABE10: + ldrb r0, [r6] + bl sub_81AE604 + adds r4, r0, 0 + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ABE32 + adds r0, 0x1 + cmp r4, r0 + bne _081ABE68 + b _081ABEB2 +_081ABE32: + ldrb r0, [r5, 0x4] + cmp r0, 0x5 + bne _081ABE40 + movs r0, 0x20 + bl audio_play + b _081ABEB2 +_081ABE40: + movs r0, 0x5 + bl audio_play + ldr r0, _081ABE5C + mov r1, r10 + strh r1, [r0] + ldr r0, _081ABE60 + subs r0, 0x8 + ldr r3, [sp] + adds r0, r3, r0 + ldr r1, _081ABE64 + str r1, [r0] + b _081ABEB2 + .align 2, 0 +_081ABE5C: .4byte 0x0203ce7c +_081ABE60: .4byte 0x03005e08 +_081ABE64: .4byte task_close_bag_menu_1 + 1 +_081ABE68: + movs r0, 0x5 + bl audio_play + bl sub_81AB824 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_81AB73C + strh r4, [r6, 0x2] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl bag_pocket_get_item_quantity + strh r0, [r6, 0x4] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl bag_pocket_get_itemid + ldr r1, _081ABEC4 + strh r0, [r1] + ldr r1, _081ABEC8 + ldrb r0, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + mov r0, r9 + bl _call_via_r1 +_081ABEB2: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ABEC4: .4byte 0x0203ce7c +_081ABEC8: .4byte 0x08614054 + thumb_func_end sub_81ABD28 + + thumb_func_start set_callback3_to_bag +set_callback3_to_bag: @ 81ABECC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81AB7BC + bl sub_81AB854 + movs r0, 0x3 + bl Window_FillTileMap + movs r0, 0x4 + bl Window_FillTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081ABF08 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081ABF0C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081ABF08: .4byte 0x03005e00 +_081ABF0C: .4byte sub_81ABD28 + 1 + thumb_func_end set_callback3_to_bag + + thumb_func_start sub_81ABF10 +sub_81ABF10: @ 81ABF10 + push {lr} + ldr r0, _081ABF48 + ldr r0, [r0] + ldr r1, _081ABF4C + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081ABF6A + bl sub_81220D0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081ABF50 + ldrh r1, [r0, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ABF3C + cmp r2, 0x1 + bne _081ABF54 +_081ABF3C: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + b _081ABF6C + .align 2, 0 +_081ABF48: .4byte 0x0203ce54 +_081ABF4C: .4byte 0x0000081b +_081ABF50: .4byte 0x030022c0 +_081ABF54: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ABF60 + cmp r2, 0x2 + bne _081ABF6A +_081ABF60: + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + b _081ABF6C +_081ABF6A: + movs r0, 0 +_081ABF6C: + pop {r1} + bx r1 + thumb_func_end sub_81ABF10 + + thumb_func_start sub_81ABF70 +sub_81ABF70: @ 81ABF70 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + asrs r1, 24 + cmp r1, 0x1 + bne _081ABF88 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081ABF88 + movs r0, 0 + b _081ABFA0 +_081ABF88: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + ldrb r3, [r2] + cmp r0, r1 + bne _081ABF9E + cmp r3, 0 + bne _081ABF9E + movs r0, 0x4 + b _081ABFA0 +_081ABF9E: + adds r0, r3, r4 +_081ABFA0: + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABF70 + + thumb_func_start sub_81ABFA8 +sub_81ABFA8: @ 81ABFA8 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081AC060 + adds r4, r0, r1 + movs r0, 0 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x18] + strh r5, [r4, 0x16] + cmp r2, 0 + bne _081AC026 + movs r0, 0 + bl Window_FillTileMap + movs r0, 0x1 + bl Window_FillTileMap + ldrb r0, [r4] + ldr r3, _081AC064 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r3, _081AC068 + ldr r0, _081AC06C + ldr r2, [r0] + ldr r1, _081AC070 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + adds r2, r0 + ldr r0, _081AC074 + adds r2, r0 + 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] + bl sub_81AB824 +_081AC026: + ldr r4, _081AC064 + ldrb r1, [r4, 0x5] + add r0, sp, 0x8 + strb r1, [r0] + lsls r1, r5, 24 + asrs r1, 24 + bl sub_81ABF70 + lsls r0, r5, 16 + asrs r1, r0, 16 + adds r5, r0, 0 + cmp r1, 0x1 + bne _081AC07C + ldr r2, _081AC078 + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + add r1, sp, 0x8 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_81ADF20 + movs r0, 0 + bl sub_81ADFF8 + b _081AC09A + .align 2, 0 +_081AC060: .4byte 0x03005e08 +_081AC064: .4byte 0x0203ce58 +_081AC068: .4byte 0x02020630 +_081AC06C: .4byte 0x0203ce54 +_081AC070: .4byte 0x0000081b +_081AC074: .4byte 0x00000806 +_081AC078: .4byte 0x085e91fc +_081AC07C: + ldr r2, _081AC0FC + add r0, sp, 0x8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrb r1, [r4, 0x5] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_81ADF20 + movs r0, 0x8 + bl sub_81ADFF8 +_081AC09A: + ldr r0, _081AC100 + ldrb r0, [r0, 0x5] + movs r1, 0 + bl bag_menu_draw_pocket_indicator_square + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + movs r0, 0xF + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0xB + movs r2, 0xE + movs r3, 0x2 + bl bg_fill_tilemap_rect + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80D4D38 + movs r0, 0x1 + bl sub_80D4CA8 + asrs r0, r5, 16 + bl sub_80D4E34 + ldr r1, _081AC104 + ldr r2, _081AC108 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldr r2, [r0] + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AC0FC: .4byte 0x085e91fc +_081AC100: .4byte 0x0203ce58 +_081AC104: .4byte sub_81AC10C + 1 +_081AC108: .4byte 0x03005e00 + thumb_func_end sub_81ABFA8 + + thumb_func_start sub_81AC10C +sub_81AC10C: @ 81AC10C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, _081AC144 + adds r6, r0, r1 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl sub_81ADC54 + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl sub_81ABF10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC148 + cmp r0, 0x2 + beq _081AC164 + b _081AC184 + .align 2, 0 +_081AC144: .4byte 0x03005e08 +_081AC148: + ldr r0, _081AC160 + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl sub_81ABF70 + adds r0, r7, 0 + bl set_task_function_to_args_14_15 + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081AC178 + .align 2, 0 +_081AC160: .4byte 0x0203ce5d +_081AC164: + ldr r0, _081AC180 + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl sub_81ABF70 + adds r0, r7, 0 + bl set_task_function_to_args_14_15 + adds r0, r7, 0 + movs r1, 0x1 +_081AC178: + movs r2, 0x1 + bl sub_81ABFA8 + b _081AC22E + .align 2, 0 +_081AC180: .4byte 0x0203ce5d +_081AC184: + movs r1, 0x1A + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _081AC192 + cmp r0, 0x1 + beq _081AC1DC + b _081AC22E +_081AC192: + ldrb r0, [r6, 0x18] + bl sub_81AC23C + ldrh r0, [r6, 0x18] + adds r1, r0, 0x1 + strh r1, [r6, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081AC1CC + movs r2, 0x16 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bne _081AC1BC + lsls r0, r1, 16 + asrs r0, 17 + lsls r0, 24 + lsrs r0, 24 + bl sub_81ADFF8 + b _081AC1CC +_081AC1BC: + lsls r1, 16 + asrs r1, 17 + movs r0, 0x8 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81ADFF8 +_081AC1CC: + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _081AC22E + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + b _081AC22E +_081AC1DC: + ldr r4, _081AC234 + movs r1, 0x16 + ldrsb r1, [r6, r1] + adds r0, r4, 0 + bl sub_81ABF70 + subs r5, r4, 0x5 + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081AC238 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0xD + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x3 + adds r2, r4 + ldrh r2, [r2] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81AB7BC + bl sub_81AB854 + adds r0, r7, 0 + bl set_task_function_to_args_14_15 +_081AC22E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AC234: .4byte 0x0203ce5d +_081AC238: .4byte 0x03006310 + thumb_func_end sub_81AC10C + + thumb_func_start sub_81AC23C +sub_81AC23C: @ 81AC23C + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r3, 24 + movs r0, 0x80 + lsls r0, 18 + adds r3, r0 + lsrs r3, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0xE + bl bg_fill_tilemap_rect + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81AC23C + + thumb_func_start bag_menu_draw_pocket_indicator_square +bag_menu_draw_pocket_indicator_square: @ 81AC26C + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + cmp r1, 0 + bne _081AC298 + ldr r1, _081AC294 + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl bg_fill_tilemap_rect + b _081AC2AE + .align 2, 0 +_081AC294: .4byte 0x00001017 +_081AC298: + ldr r1, _081AC2BC + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl bg_fill_tilemap_rect +_081AC2AE: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_081AC2BC: .4byte 0x0000102b + thumb_func_end bag_menu_draw_pocket_indicator_square + + thumb_func_start sub_81AC2C0 +sub_81AC2C0: @ 81AC2C0 + push {lr} + ldr r1, _081AC2DC + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bhi _081AC2E0 + ldrb r0, [r1, 0x5] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081AC2E0 + movs r0, 0x1 + b _081AC2E2 + .align 2, 0 +_081AC2DC: .4byte 0x0203ce58 +_081AC2E0: + movs r0, 0 +_081AC2E2: + pop {r1} + bx r1 + thumb_func_end sub_81AC2C0 + + thumb_func_start sub_81AC2E8 +sub_81AC2E8: @ 81AC2E8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081AC3A0 + mov r9, r0 + adds r6, r4, r0 + ldrb r0, [r6] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r3, _081AC3A4 + ldrb r0, [r3, 0x5] + lsls r0, 1 + adds r2, r3, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + strh r1, [r6, 0x2] + ldr r0, _081AC3A8 + ldr r0, [r0] + ldr r2, _081AC3AC + adds r0, r2 + movs r5, 0 + strb r1, [r0] + ldrb r0, [r3, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + ldr r1, _081AC3B0 + bl itemid_get_name + ldr r0, _081AC3B4 + mov r8, r0 + ldr r1, _081AC3B8 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r1, 0x1 + mov r2, r8 + movs r3, 0x3 + bl sub_81AE0BC + ldrb r0, [r6, 0x2] + bl sub_80D4FEC + bl sub_81AB89C + ldrb r0, [r6] + movs r1, 0x2 + bl sub_81AB73C + movs r2, 0x8 + negs r2, r2 + add r9, r2 + add r4, r9 + ldr r0, _081AC3BC + str r0, [r4] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AC3A0: .4byte 0x03005e08 +_081AC3A4: .4byte 0x0203ce58 +_081AC3A8: .4byte 0x0203ce54 +_081AC3AC: .4byte 0x0000081a +_081AC3B0: .4byte 0x02021cc4 +_081AC3B4: .4byte 0x02021fc4 +_081AC3B8: .4byte 0x085e8dfe +_081AC3BC: .4byte sub_81AC3C0 + 1 + thumb_func_end sub_81AC2E8 + + thumb_func_start sub_81AC3C0 +sub_81AC3C0: @ 81AC3C0 + 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, _081AC40C + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC48E + ldr r0, _081AC410 + mov r8, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081AC418 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + ldr r3, _081AC414 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl get_coro_args_x18_x1A + b _081AC472 + .align 2, 0 +_081AC40C: .4byte 0x03005e08 +_081AC410: .4byte 0x030022c0 +_081AC414: .4byte 0x0203ce58 +_081AC418: + ldrb r0, [r4] + bl sub_81AE604 + adds r7, r0, 0 + ldrb r0, [r4] + ldr r5, _081AC45C + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r4, r5, 0 + adds r4, 0x8 + adds r2, r4 + bl get_coro_args_x18_x1A + movs r0, 0 + bl sub_80D4FC8 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r0, r4 + ldrb r0, [r0] + bl sub_80D4FEC + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _081AC460 + adds r0, 0x1 + cmp r7, r0 + bne _081AC482 + b _081AC48E + .align 2, 0 +_081AC45C: .4byte 0x0203ce58 +_081AC460: + movs r0, 0x5 + bl audio_play + mov r0, r8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AC47A +_081AC472: + adds r0, r6, 0 + bl sub_81AC498 + b _081AC48E +_081AC47A: + adds r0, r6, 0 + bl sub_81AC590 + b _081AC48E +_081AC482: + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_81AC498 +_081AC48E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AC3C0 + + thumb_func_start sub_81AC498 +sub_81AC498: @ 81AC498 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + mov r10, r0 + ldr r0, _081AC4EC + add r0, r10 + mov r9, r0 + ldr r5, _081AC4F0 + ldrb r6, [r5, 0x5] + lsls r1, r6, 1 + adds r0, r5, 0 + adds r0, 0x12 + adds r0, r1 + mov r8, r0 + ldr r2, _081AC4F4 + adds r7, r1, r2 + ldrh r0, [r7] + mov r1, r8 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + mov r0, r9 + movs r1, 0x2 + ldrsh r2, [r0, r1] + cmp r2, r4 + beq _081AC4E2 + subs r0, r4, 0x1 + cmp r2, r0 + bne _081AC4F8 +_081AC4E2: + adds r0, r3, 0 + bl sub_81AC590 + b _081AC566 + .align 2, 0 +_081AC4EC: .4byte 0x03005e08 +_081AC4F0: .4byte 0x0203ce58 +_081AC4F4: .4byte 0x0203ce60 +_081AC4F8: + ldr r1, _081AC574 + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_80D702C + ldr r0, _081AC578 + ldr r0, [r0] + ldr r2, _081AC57C + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + mov r2, r9 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r4 + bge _081AC538 + ldrb r1, [r5, 0x5] + lsls r1, 1 + ldr r2, _081AC580 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC538: + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081AC584 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + strh r0, [r1] + movs r0, 0x1 + bl sub_80D4FC8 + bl sub_81AB854 + ldr r0, _081AC588 + subs r0, 0x8 + add r0, r10 + ldr r1, _081AC58C + str r1, [r0] +_081AC566: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AC574: .4byte 0x02039dd8 +_081AC578: .4byte 0x0203ce54 +_081AC57C: .4byte 0x0000081a +_081AC580: .4byte 0x0203ce60 +_081AC584: .4byte 0x03006310 +_081AC588: .4byte 0x03005e08 +_081AC58C: .4byte sub_81ABD28 + 1 + thumb_func_end sub_81AC498 + + thumb_func_start sub_81AC590 +sub_81AC590: @ 81AC590 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + mov r9, r1 + ldr r0, _081AC62C + mov r10, r0 + mov r7, r9 + add r7, r10 + ldr r4, _081AC630 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r6, r0, r1 + movs r1, 0x8 + adds r1, r4 + mov r8, r1 + adds r5, r0, r1 + ldr r0, _081AC634 + ldr r0, [r0] + ldr r1, _081AC638 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + movs r0, 0x2 + ldrsh r2, [r7, r0] + ldrh r0, [r6] + ldrh r1, [r5] + adds r0, r1 + cmp r2, r0 + bge _081AC5F2 + ldrb r1, [r4, 0x5] + lsls r1, 1 + add r1, r8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC5F2: + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081AC63C + ldrh r1, [r6] + ldrh r2, [r5] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0x1 + bl sub_80D4FC8 + bl sub_81AB854 + mov r0, r10 + subs r0, 0x8 + add r0, r9 + ldr r1, _081AC640 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AC62C: .4byte 0x03005e08 +_081AC630: .4byte 0x0203ce58 +_081AC634: .4byte 0x0203ce54 +_081AC638: .4byte 0x0000081a +_081AC63C: .4byte 0x03006310 +_081AC640: .4byte sub_81ABD28 + 1 + thumb_func_end sub_81AC590 + + thumb_func_start sub_81AC644 +sub_81AC644: @ 81AC644 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, _081AC660 + ldrb r0, [r0, 0x4] + subs r0, 0x1 + cmp r0, 0x9 + bls _081AC654 + b _081AC82C +_081AC654: + lsls r0, 2 + ldr r1, _081AC664 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AC660: .4byte 0x0203ce58 +_081AC664: .4byte _081AC668 + .align 2, 0 +_081AC668: + .4byte _081AC690 + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC6E8 + .4byte _081AC82C + .4byte _081AC76C + .4byte _081AC7CC + .4byte _081AC70C + .4byte _081AC690 +_081AC690: + ldr r0, _081AC6B4 + ldrh r0, [r0] + bl itemid_get_usage + lsls r0, 24 + cmp r0, 0 + beq _081AC6C4 + ldr r0, _081AC6B8 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC6BC + str r0, [r2] + ldr r0, _081AC6C0 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .align 2, 0 +_081AC6B4: .4byte 0x0203ce7c +_081AC6B8: .4byte 0x0203ce54 +_081AC6BC: .4byte 0x08614042 +_081AC6C0: .4byte 0x00000828 +_081AC6C4: + ldr r0, _081AC6DC + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC6E0 + str r0, [r2] + ldr r0, _081AC6E4 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .align 2, 0 +_081AC6DC: .4byte 0x0203ce54 +_081AC6E0: .4byte 0x08614046 +_081AC6E4: .4byte 0x00000828 +_081AC6E8: + ldr r0, _081AC700 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC704 + str r0, [r2] + ldr r0, _081AC708 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .align 2, 0 +_081AC700: .4byte 0x0203ce54 +_081AC704: .4byte 0x08614047 +_081AC708: .4byte 0x00000828 +_081AC70C: + ldr r4, _081AC738 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC748 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC748 + ldr r0, _081AC73C + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC740 + str r0, [r2] + ldr r0, _081AC744 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .align 2, 0 +_081AC738: .4byte 0x0203ce7c +_081AC73C: .4byte 0x0203ce54 +_081AC740: .4byte 0x0861404b +_081AC744: .4byte 0x00000828 +_081AC748: + ldr r0, _081AC760 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC764 + str r0, [r2] + ldr r0, _081AC768 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .align 2, 0 +_081AC760: .4byte 0x0203ce54 +_081AC764: .4byte 0x08614046 +_081AC768: .4byte 0x00000828 +_081AC76C: + ldr r4, _081AC798 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC7A8 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC7A8 + ldr r0, _081AC79C + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC7A0 + str r0, [r2] + ldr r0, _081AC7A4 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .align 2, 0 +_081AC798: .4byte 0x0203ce7c +_081AC79C: .4byte 0x0203ce54 +_081AC7A0: .4byte 0x0861404d +_081AC7A4: .4byte 0x00000828 +_081AC7A8: + ldr r0, _081AC7C0 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC7C4 + str r0, [r2] + ldr r0, _081AC7C8 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .align 2, 0 +_081AC7C0: .4byte 0x0203ce54 +_081AC7C4: .4byte 0x08614046 +_081AC7C8: .4byte 0x00000828 +_081AC7CC: + ldr r4, _081AC7F8 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC808 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC808 + ldr r0, _081AC7FC + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC800 + str r0, [r2] + ldr r0, _081AC804 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .align 2, 0 +_081AC7F8: .4byte 0x0203ce7c +_081AC7FC: .4byte 0x0203ce54 +_081AC800: .4byte 0x0861404f +_081AC804: .4byte 0x00000828 +_081AC808: + ldr r0, _081AC820 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC824 + str r0, [r2] + ldr r0, _081AC828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .align 2, 0 +_081AC820: .4byte 0x0203ce54 +_081AC824: .4byte 0x08614046 +_081AC828: .4byte 0x00000828 +_081AC82C: + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC840 + bl in_trade_center + cmp r0, 0x1 + bne _081AC8A4 +_081AC840: + ldr r0, _081AC86C + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AC856 + ldr r0, _081AC870 + ldrh r0, [r0] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AC880 +_081AC856: + ldr r0, _081AC874 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC878 + str r0, [r2] + ldr r0, _081AC87C + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .align 2, 0 +_081AC86C: .4byte 0x0203ce58 +_081AC870: .4byte 0x0203ce7c +_081AC874: .4byte 0x0203ce54 +_081AC878: .4byte 0x08614046 +_081AC87C: .4byte 0x00000828 +_081AC880: + ldr r0, _081AC898 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC89C + str r0, [r2] + ldr r0, _081AC8A0 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .align 2, 0 +_081AC898: .4byte 0x0203ce54 +_081AC89C: .4byte 0x08614044 +_081AC8A0: .4byte 0x00000828 +_081AC8A4: + ldr r0, _081AC8B8 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + bls _081AC8AE + b _081ACA12 +_081AC8AE: + lsls r0, 2 + ldr r1, _081AC8BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AC8B8: .4byte 0x0203ce58 +_081AC8BC: .4byte _081AC8C0 + .align 2, 0 +_081AC8C0: + .4byte _081AC8D4 + .4byte _081AC9B4 + .4byte _081AC9D8 + .4byte _081AC9FC + .4byte _081AC92C +_081AC8D4: + ldr r4, _081AC918 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r3, _081AC91C + adds r0, r1, r3 + str r0, [r2] + ldr r0, _081AC920 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r3 + ldr r1, _081AC924 + movs r2, 0x4 + bl memcpy + ldr r0, _081AC928 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC90A + b _081ACA12 +_081AC90A: + ldr r0, [r4] + ldr r1, _081AC91C + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + b _081ACA12 + .align 2, 0 +_081AC918: .4byte 0x0203ce54 +_081AC91C: .4byte 0x00000824 +_081AC920: .4byte 0x00000828 +_081AC924: .4byte 0x0861402c +_081AC928: .4byte 0x0203ce7c +_081AC92C: + ldr r4, _081AC990 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r5, _081AC994 + adds r0, r1, r5 + str r0, [r2] + ldr r0, _081AC998 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r5 + ldr r1, _081AC99C + movs r2, 0x4 + bl memcpy + ldr r0, _081AC9A0 + ldr r0, [r0] + ldr r1, _081AC9A4 + adds r0, r1 + ldr r2, _081AC9A8 + ldrh r0, [r0] + ldrh r1, [r2] + cmp r0, r1 + bne _081AC96C + ldr r0, [r4] + ldr r1, _081AC9AC + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] +_081AC96C: + ldrh r1, [r2] + ldr r0, _081AC9B0 + cmp r1, r0 + beq _081AC97A + adds r0, 0xD + cmp r1, r0 + bne _081ACA12 +_081AC97A: + movs r0, 0x6 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _081ACA12 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x7 + strb r1, [r0] + b _081ACA12 + .align 2, 0 +_081AC990: .4byte 0x0203ce54 +_081AC994: .4byte 0x00000824 +_081AC998: .4byte 0x00000828 +_081AC99C: .4byte 0x08614030 +_081AC9A0: .4byte 0x03005d8c +_081AC9A4: .4byte 0x00000496 +_081AC9A8: .4byte 0x0203ce7c +_081AC9AC: .4byte 0x00000825 +_081AC9B0: .4byte 0x00000103 +_081AC9B4: + ldr r0, _081AC9CC + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC9D0 + str r0, [r2] + ldr r0, _081AC9D4 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .align 2, 0 +_081AC9CC: .4byte 0x0203ce54 +_081AC9D0: .4byte 0x08614034 +_081AC9D4: .4byte 0x00000828 +_081AC9D8: + ldr r0, _081AC9F0 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081AC9F4 + str r0, [r2] + ldr r0, _081AC9F8 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .align 2, 0 +_081AC9F0: .4byte 0x0203ce54 +_081AC9F4: .4byte 0x08614038 +_081AC9F8: .4byte 0x00000828 +_081AC9FC: + ldr r0, _081ACA3C + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, _081ACA40 + str r0, [r2] + ldr r0, _081ACA44 + adds r1, r0 + movs r0, 0x6 +_081ACA10: + strb r0, [r1] +_081ACA12: + ldr r0, _081ACA48 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + bne _081ACA50 + movs r0, 0x1 + bl Window_FillTileMap + ldr r0, _081ACA4C + ldrh r0, [r0] + bl sub_81AE2FC + movs r0, 0x3 + bl Window_WriteStandardTileMap + movs r0, 0x4 + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _081ACA86 + .align 2, 0 +_081ACA3C: .4byte 0x0203ce54 +_081ACA40: .4byte 0x0861403c +_081ACA44: .4byte 0x00000828 +_081ACA48: .4byte 0x0203ce58 +_081ACA4C: .4byte 0x0203ce7c +_081ACA50: + ldr r0, _081ACA98 + ldrh r0, [r0] + ldr r1, _081ACA9C + bl itemid_get_name + ldr r4, _081ACAA0 + ldr r1, _081ACAA4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_81AE0BC +_081ACA86: + ldr r0, _081ACAA8 + ldr r0, [r0] + ldr r1, _081ACAAC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACAB0 + movs r0, 0 + b _081ACAB6 + .align 2, 0 +_081ACA98: .4byte 0x0203ce7c +_081ACA9C: .4byte 0x02021cc4 +_081ACAA0: .4byte 0x02021fc4 +_081ACAA4: .4byte 0x085e8dbe +_081ACAA8: .4byte 0x0203ce54 +_081ACAAC: .4byte 0x00000828 +_081ACAB0: + cmp r0, 0x2 + bne _081ACAC4 + movs r0, 0x1 +_081ACAB6: + bl sub_81AE13C + lsls r0, 24 + lsrs r0, 24 + bl sub_81ACAF8 + b _081ACAEE +_081ACAC4: + cmp r0, 0x4 + bne _081ACADC + movs r0, 0x2 + bl sub_81AE13C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x2 + bl sub_81ACB54 + b _081ACAEE +_081ACADC: + movs r0, 0x3 + bl sub_81AE13C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x3 + bl sub_81ACB54 +_081ACAEE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AC644 + + thumb_func_start sub_81ACAF8 +sub_81ACAF8: @ 81ACAF8 + 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, _081ACB48 + ldr r1, [r6] + ldr r5, _081ACB4C + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, _081ACB50 + str r0, [sp, 0xC] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_81988A4 + 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 + .align 2, 0 +_081ACB48: .4byte 0x0203ce54 +_081ACB4C: .4byte 0x00000828 +_081ACB50: .4byte 0x08613fb4 + thumb_func_end sub_81ACAF8 + + thumb_func_start sub_81ACB54 +sub_81ACB54: @ 81ACB54 + 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, _081ACBA8 + str r0, [sp, 0xC] + ldr r0, _081ACBAC + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + 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 + .align 2, 0 +_081ACBA8: .4byte 0x08613fb4 +_081ACBAC: .4byte 0x0203ce54 + thumb_func_end sub_81ACB54 + + thumb_func_start sub_81ACBB0 +sub_81ACBB0: @ 81ACBB0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81AC644 + ldr r0, _081ACBD8 + ldr r0, [r0] + ldr r1, _081ACBDC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _081ACBE8 + ldr r0, _081ACBE0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081ACBE4 + b _081ACBF4 + .align 2, 0 +_081ACBD8: .4byte 0x0203ce54 +_081ACBDC: .4byte 0x00000828 +_081ACBE0: .4byte 0x03005e00 +_081ACBE4: .4byte sub_81ACC04 + 1 +_081ACBE8: + ldr r0, _081ACBFC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081ACC00 +_081ACBF4: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081ACBFC: .4byte 0x03005e00 +_081ACC00: .4byte sub_81ACC78 + 1 + thumb_func_end sub_81ACBB0 + + thumb_func_start sub_81ACC04 +sub_81ACC04: @ 81ACC04 + 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 _081ACC6A + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ACC6A + adds r0, 0x1 + cmp r4, r0 + bne _081ACC44 + movs r0, 0x5 + bl audio_play + ldr r0, _081ACC40 + ldr r1, [r0, 0x24] + adds r0, r5, 0 + bl _call_via_r1 + b _081ACC6A + .align 2, 0 +_081ACC40: .4byte 0x08613fb4 +_081ACC44: + movs r0, 0x5 + bl audio_play + ldr r1, _081ACC70 + ldr r0, _081ACC74 + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 4 + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081ACC6A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081ACC70: .4byte 0x08613fb4 +_081ACC74: .4byte 0x0203ce54 + thumb_func_end sub_81ACC04 + + thumb_func_start sub_81ACC78 +sub_81ACC78: @ 81ACC78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACC8C + b _081ACDF0 +_081ACC8C: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _081ACCD0 + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081ACCD4 + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0 + bgt _081ACCAA + b _081ACDF0 +_081ACCAA: + subs r0, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + bne _081ACCBC + b _081ACDF0 +_081ACCBC: + movs r0, 0x5 + bl audio_play + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + bl sub_8199134 + b _081ACDF0 + .align 2, 0 +_081ACCD0: .4byte 0x030022c0 +_081ACCD4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ACD1C + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, _081ACD14 + ldr r0, [r0] + ldr r2, _081ACD18 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x2 + cmp r1, r0 + blt _081ACCF2 + b _081ACDF0 +_081ACCF2: + adds r0, r1, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl audio_play + movs r0, 0 + movs r1, 0x1 + bl sub_8199134 + b _081ACDF0 + .align 2, 0 +_081ACD14: .4byte 0x0203ce54 +_081ACD18: .4byte 0x00000828 +_081ACD1C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ACD30 + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACD58 +_081ACD30: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + subs r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _081ACD92 +_081ACD58: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ACD6E + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081ACD9A +_081ACD6E: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081ACDF0 + adds r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_081ACD92: + movs r1, 0 + bl sub_8199134 + b _081ACDF0 +_081ACD9A: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDD8 + movs r0, 0x5 + bl audio_play + ldr r2, _081ACDD0 + ldr r0, _081ACDD4 + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + movs r3, 0x82 + lsls r3, 4 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081ACDF0 + .align 2, 0 +_081ACDD0: .4byte 0x08613fb4 +_081ACDD4: .4byte 0x0203ce54 +_081ACDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl audio_play + ldr r0, _081ACDF8 + ldr r1, [r0, 0x24] + adds r0, r6, 0 + bl _call_via_r1 +_081ACDF0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081ACDF8: .4byte 0x08613fb4 + thumb_func_end sub_81ACC78 + + thumb_func_start sub_81ACDFC +sub_81ACDFC: @ 81ACDFC + push {lr} + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081ACE30 + ldr r0, _081ACE28 + ldr r2, [r0] + ldr r3, _081ACE2C + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081ACE30 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xE + beq _081ACE30 + movs r0, 0x1 + b _081ACE32 + .align 2, 0 +_081ACE28: .4byte 0x0203ce54 +_081ACE2C: .4byte 0x00000828 +_081ACE30: + movs r0, 0 +_081ACE32: + pop {r1} + bx r1 + thumb_func_end sub_81ACDFC + + thumb_func_start sub_81ACE38 +sub_81ACE38: @ 81ACE38 + push {lr} + ldr r0, _081ACE50 + ldr r0, [r0] + ldr r1, _081ACE54 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACE58 + movs r0, 0 + bl sub_81AE184 + b _081ACE76 + .align 2, 0 +_081ACE50: .4byte 0x0203ce54 +_081ACE54: .4byte 0x00000828 +_081ACE58: + cmp r0, 0x2 + bne _081ACE64 + movs r0, 0x1 + bl sub_81AE184 + b _081ACE76 +_081ACE64: + cmp r0, 0x4 + bne _081ACE70 + movs r0, 0x2 + bl sub_81AE184 + b _081ACE76 +_081ACE70: + movs r0, 0x3 + bl sub_81AE184 +_081ACE76: + pop {r0} + bx r0 + thumb_func_end sub_81ACE38 + + thumb_func_start sub_81ACE7C +sub_81ACE7C: @ 81ACE7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _081ACEB4 + ldrh r0, [r5] + bl itemid_get_overworld_function + cmp r0, 0 + beq _081ACEEE + bl sub_81ACE38 + bl calc_player_party_count + lsls r0, 24 + cmp r0, 0 + bne _081ACEB8 + ldrh r0, [r5] + bl itemid_get_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACEB8 + adds r0, r4, 0 + bl sub_81AD2F0 + b _081ACEEE + .align 2, 0 +_081ACEB4: .4byte 0x0203ce7c +_081ACEB8: + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _081ACEE0 + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + beq _081ACEE8 + ldr r0, _081ACEE4 + ldrh r0, [r0] + bl itemid_get_overworld_function + adds r1, r0, 0 + adds r0, r4, 0 + bl _call_via_r1 + b _081ACEEE + .align 2, 0 +_081ACEE0: .4byte 0x0203ce58 +_081ACEE4: .4byte 0x0203ce7c +_081ACEE8: + adds r0, r4, 0 + bl sub_80FDD10 +_081ACEEE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81ACE7C + + thumb_func_start sub_81ACEF4 +sub_81ACEF4: @ 81ACEF4 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + ldr r7, _081ACF20 + adds r4, r6, r7 + bl sub_81ACE38 + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081ACF24 + adds r0, r5, 0 + bl sub_81ACF88 + b _081ACF6A + .align 2, 0 +_081ACF20: .4byte 0x03005e08 +_081ACF24: + ldr r0, _081ACF74 + ldrh r0, [r0] + ldr r1, _081ACF78 + bl itemid_get_name + ldr r4, _081ACF7C + ldr r1, _081ACF80 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_81AE0BC + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, _081ACF84 + str r1, [r0] +_081ACF6A: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ACF74: .4byte 0x0203ce7c +_081ACF78: .4byte 0x02021cc4 +_081ACF7C: .4byte 0x02021fc4 +_081ACF80: .4byte 0x085e8ee0 +_081ACF84: .4byte sub_81AD044 + 1 + thumb_func_end sub_81ACEF4 + + thumb_func_start sub_81ACF88 +sub_81ACF88: @ 81ACF88 + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _081ACFF4 + adds r4, r0 + ldr r0, _081ACFF8 + ldrh r0, [r0] + ldr r1, _081ACFFC + bl itemid_get_name + ldr r0, _081AD000 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _081AD004 + ldr r1, _081AD008 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_81AE0BC + ldr r2, _081AD00C + adds r0, r5, 0 + movs r1, 0x5 + bl sub_81AE238 + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081ACFF4: .4byte 0x03005e08 +_081ACFF8: .4byte 0x0203ce7c +_081ACFFC: .4byte 0x02021cc4 +_081AD000: .4byte 0x02021dc4 +_081AD004: .4byte 0x02021fc4 +_081AD008: .4byte 0x085e8f0e +_081AD00C: .4byte 0x08614084 + thumb_func_end sub_81ACF88 + + thumb_func_start sub_81AD010 +sub_81AD010: @ 81AD010 + 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, _081AD040 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r4] + movs r1, 0 + bl sub_81AB73C + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AD040: .4byte 0x03005e08 + thumb_func_end sub_81AD010 + + thumb_func_start sub_81AD044 +sub_81AD044: @ 81AD044 + 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, _081AD07C + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl sub_8122034 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD088 + ldr r0, _081AD080 + ldr r0, [r0] + ldr r1, _081AD084 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r4, r2] + bl sub_81ABC54 + b _081AD0C6 + .align 2, 0 +_081AD07C: .4byte 0x03005e08 +_081AD080: .4byte 0x0203ce54 +_081AD084: .4byte 0x00000817 +_081AD088: + ldr r0, _081AD0A8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD0AC + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + bl sub_81AE184 + adds r0, r5, 0 + bl sub_81ACF88 + b _081AD0C6 + .align 2, 0 +_081AD0A8: .4byte 0x030022c0 +_081AD0AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD0C6 + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + bl sub_81AE184 + adds r0, r6, 0 + bl sub_81AD010 +_081AD0C6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AD044 + + thumb_func_start display_threw_away_item_str +display_threw_away_item_str: @ 81AD0CC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, _081AD134 + adds r6, r4, r5 + ldr r0, _081AD138 + ldrh r0, [r0] + ldr r1, _081AD13C + bl itemid_get_name + ldr r0, _081AD140 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r6, _081AD144 + ldr r1, _081AD148 + adds r0, r6, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0x3 + bl sub_81AE0BC + subs r5, 0x8 + adds r4, r5 + ldr r0, _081AD14C + str r0, [r4] + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AD134: .4byte 0x03005e08 +_081AD138: .4byte 0x0203ce7c +_081AD13C: .4byte 0x02021cc4 +_081AD140: .4byte 0x02021dc4 +_081AD144: .4byte 0x02021fc4 +_081AD148: .4byte 0x085e8ef9 +_081AD14C: .4byte sub_81AD150 + 1 + thumb_func_end display_threw_away_item_str + + thumb_func_start sub_81AD150 +sub_81AD150: @ 81AD150 + 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, _081AD1D8 + adds r5, r0, r1 + ldr r4, _081AD1DC + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + mov r8, r1 + adds r1, r4, 0 + adds r1, 0x8 + adds r7, r0, r1 + ldr r0, _081AD1E0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD1CE + movs r0, 0x5 + bl audio_play + ldr r0, _081AD1E4 + ldrh r0, [r0] + ldrh r1, [r5, 0x10] + bl sub_80D6AA4 + ldrb r0, [r5] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x5] + bl sub_81AB9A8 + ldrb r0, [r4, 0x5] + bl sub_81ABA88 + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081AD1E8 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag +_081AD1CE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AD1D8: .4byte 0x03005e08 +_081AD1DC: .4byte 0x0203ce58 +_081AD1E0: .4byte 0x030022c0 +_081AD1E4: .4byte 0x0203ce7c +_081AD1E8: .4byte 0x03006310 + thumb_func_end sub_81AD150 + + thumb_func_start sub_81AD1EC +sub_81AD1EC: @ 81AD1EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081AD224 + adds r7, r0, r1 + ldr r0, _081AD228 + ldrb r1, [r0, 0x5] + lsls r1, 1 + adds r2, r0, 0 + adds r2, 0x12 + adds r6, r1, r2 + adds r0, 0x8 + adds r5, r1, r0 + ldr r0, _081AD22C + ldr r0, [r0] + ldr r2, _081AD230 + adds r1, r0, r2 + ldr r0, _081AD234 + ldrh r2, [r0] + ldrh r0, [r1] + cmp r0, r2 + bne _081AD238 + movs r0, 0 + strh r0, [r1] + b _081AD23A + .align 2, 0 +_081AD224: .4byte 0x03005e08 +_081AD228: .4byte 0x0203ce58 +_081AD22C: .4byte 0x03005d8c +_081AD230: .4byte 0x00000496 +_081AD234: .4byte 0x0203ce7c +_081AD238: + strh r2, [r1] +_081AD23A: + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + ldr r0, _081AD270 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081AD274 + ldrh r1, [r6] + ldrh r2, [r5] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r4, 0 + bl sub_81AD398 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AD270: .4byte 0x0203ce58 +_081AD274: .4byte 0x03006310 + thumb_func_end sub_81AD1EC + + thumb_func_start sub_81AD278 +sub_81AD278: @ 81AD278 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl sub_81ACE38 + ldr r5, _081AD2A0 + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD2AC + ldr r2, _081AD2A4 + ldr r3, _081AD2A8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _081AD2EA + .align 2, 0 +_081AD2A0: .4byte 0x0203ce7c +_081AD2A4: .4byte 0x085e8dce +_081AD2A8: .4byte sub_81AD350 + 1 +_081AD2AC: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD2E4 + bl calc_player_party_count + lsls r0, 24 + cmp r0, 0 + bne _081AD2CA + adds r0, r4, 0 + bl sub_81AD2F0 + b _081AD2EA +_081AD2CA: + ldr r0, _081AD2DC + ldr r1, [r0] + ldr r0, _081AD2E0 + str r0, [r1] + adds r0, r4, 0 + bl task_close_bag_menu_1 + b _081AD2EA + .align 2, 0 +_081AD2DC: .4byte 0x0203ce54 +_081AD2E0: .4byte sub_81B7F60 + 1 +_081AD2E4: + adds r0, r6, 0 + bl sub_81AD30C +_081AD2EA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AD278 + + thumb_func_start sub_81AD2F0 +sub_81AD2F0: @ 81AD2F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081AD304 + ldr r3, _081AD308 + movs r1, 0x1 + bl sub_81ABB4C + pop {r0} + bx r0 + .align 2, 0 +_081AD304: .4byte 0x085e8de9 +_081AD308: .4byte sub_81AD350 + 1 + thumb_func_end sub_81AD2F0 + + thumb_func_start sub_81AD30C +sub_81AD30C: @ 81AD30C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081AD33C + ldrh r0, [r0] + ldr r1, _081AD340 + bl itemid_get_name + ldr r5, _081AD344 + ldr r1, _081AD348 + adds r0, r5, 0 + bl ExpandTextCodes + ldr r3, _081AD34C + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl sub_81ABB4C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AD33C: .4byte 0x0203ce7c +_081AD340: .4byte 0x02021cc4 +_081AD344: .4byte 0x02021fc4 +_081AD348: .4byte 0x085e8e11 +_081AD34C: .4byte sub_81AD350 + 1 + thumb_func_end sub_81AD30C + + thumb_func_start sub_81AD350 +sub_81AD350: @ 81AD350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081AD374 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD36E + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81ABBBC +_081AD36E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AD374: .4byte 0x030022c0 + thumb_func_end sub_81AD350 + + thumb_func_start sub_81AD378 +sub_81AD378: @ 81AD378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081AD390 + ldr r2, [r1] + ldr r1, _081AD394 + str r1, [r2] + bl task_close_bag_menu_1 + pop {r0} + bx r0 + .align 2, 0 +_081AD390: .4byte 0x0203ce54 +_081AD394: .4byte sub_8177C14 + 1 + thumb_func_end sub_81AD378 + + thumb_func_start sub_81AD398 +sub_81AD398: @ 81AD398 + 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, _081AD3D8 + adds r4, r0 + bl sub_81ACE38 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + 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_81AB73C + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AD3D8: .4byte 0x03005e08 + thumb_func_end sub_81AD398 + + thumb_func_start brm_run_item_battle_function +brm_run_item_battle_function: @ 81AD3DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081AD408 + ldrh r0, [r4] + bl itemid_get_battle_function + cmp r0, 0 + beq _081AD400 + bl sub_81ACE38 + ldrh r0, [r4] + bl itemid_get_battle_function + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081AD400: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AD408: .4byte 0x0203ce7c + thumb_func_end brm_run_item_battle_function + + thumb_func_start sub_81AD40C +sub_81AD40C: @ 81AD40C + push {lr} + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl sub_81AAC90 + pop {r0} + bx r0 + thumb_func_end sub_81AD40C + + thumb_func_start sub_81AD41C +sub_81AD41C: @ 81AD41C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081AD440 + ldrh r0, [r4] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD44C + ldr r2, _081AD444 + ldr r3, _081AD448 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _081AD4AE + .align 2, 0 +_081AD440: .4byte 0x0203ce7c +_081AD444: .4byte 0x085e8dce +_081AD448: .4byte sub_81AD350 + 1 +_081AD44C: + ldrh r0, [r4] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AD488 + ldrh r0, [r4] + ldr r1, _081AD478 + bl itemid_get_name + ldr r4, _081AD47C + ldr r1, _081AD480 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r3, _081AD484 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C + b _081AD4AE + .align 2, 0 +_081AD478: .4byte 0x02021cc4 +_081AD47C: .4byte 0x02021fc4 +_081AD480: .4byte 0x085e8e27 +_081AD484: .4byte sub_81AD350 + 1 +_081AD488: + ldr r0, _081AD4A4 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD4A8 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD4A8 + adds r0, r5, 0 + bl task_close_bag_menu_1 + b _081AD4AE + .align 2, 0 +_081AD4A4: .4byte 0x0203ce58 +_081AD4A8: + adds r0, r5, 0 + bl sub_81AD30C +_081AD4AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AD41C + + thumb_func_start sub_81AD4B4 +sub_81AD4B4: @ 81AD4B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _081AD4D8 + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD4E4 + ldr r2, _081AD4DC + ldr r3, _081AD4E0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81ABB4C + b _081AD51A + .align 2, 0 +_081AD4D8: .4byte 0x0203ce7c +_081AD4DC: .4byte 0x085e8dce +_081AD4E0: .4byte sub_81AD350 + 1 +_081AD4E4: + ldr r0, _081AD508 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD514 + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD514 + ldr r0, _081AD50C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081AD510 + str r0, [r1] + b _081AD51A + .align 2, 0 +_081AD508: .4byte 0x0203ce58 +_081AD50C: .4byte 0x03005e00 +_081AD510: .4byte task_close_bag_menu_1 + 1 +_081AD514: + adds r0, r4, 0 + bl sub_81AD30C +_081AD51A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AD4B4 + + thumb_func_start sub_81AD520 +sub_81AD520: @ 81AD520 + push {r4-r7,lr} + bl in_trade_center + cmp r0, 0x1 + beq _081AD54C + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _081AD54C + bl sub_81A80A8 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _081AD54C + bl sub_813994C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD550 +_081AD54C: + movs r0, 0 + b _081AD5D2 +_081AD550: + bl call_203AE8C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset_to_copy_queue + ldr r4, _081AD5B4 + ldr r0, [r4] + ldr r5, _081AD5B8 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + beq _081AD5CA + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081AD5C4 + bl script_env_2_enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + ldr r2, _081AD5BC + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + strh r1, [r2] + ldrh r0, [r0] + bl itemid_get_overworld_function + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081AD5C0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0xE] + b _081AD5D0 + .align 2, 0 +_081AD5B4: .4byte 0x03005d8c +_081AD5B8: .4byte 0x00000496 +_081AD5BC: .4byte 0x0203ce7c +_081AD5C0: .4byte 0x03005e00 +_081AD5C4: + ldr r0, [r4] + adds r0, r5 + strh r7, [r0] +_081AD5CA: + ldr r0, _081AD5D8 + bl script_env_1_execute_new_script +_081AD5D0: + movs r0, 0x1 +_081AD5D2: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AD5D8: .4byte 0x082736b3 + thumb_func_end sub_81AD520 + + thumb_func_start display_sell_item_ask_str +display_sell_item_ask_str: @ 81AD5DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081AD61C + adds r4, r0, r1 + ldr r6, _081AD620 + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + cmp r0, 0 + bne _081AD634 + ldrh r0, [r6] + ldr r1, _081AD624 + bl itemid_get_name + ldr r4, _081AD628 + ldr r1, _081AD62C + adds r0, r4, 0 + bl ExpandTextCodes + ldr r3, _081AD630 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C + b _081AD66A + .align 2, 0 +_081AD61C: .4byte 0x03005e08 +_081AD620: .4byte 0x0203ce7c +_081AD624: .4byte 0x02021dc4 +_081AD628: .4byte 0x02021fc4 +_081AD62C: .4byte 0x085e960f +_081AD630: .4byte sub_81ABBBC + 1 +_081AD634: + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081AD64C + bl sub_81AE268 + adds r0, r5, 0 + bl sub_81AD680 + b _081AD66A +_081AD64C: + ldrh r0, [r6] + ldr r1, _081AD670 + bl itemid_get_name + ldr r4, _081AD674 + ldr r1, _081AD678 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r3, _081AD67C + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C +_081AD66A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AD670: .4byte 0x02021dc4 +_081AD674: .4byte 0x02021fc4 +_081AD678: .4byte 0x085e962f +_081AD67C: .4byte sub_81AD730 + 1 + thumb_func_end display_sell_item_ask_str + + thumb_func_start sub_81AD680 +sub_81AD680: @ 81AD680 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _081AD6CC + adds r4, r0 + ldr r6, _081AD6D0 + ldr r0, _081AD6D4 + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + ldr r4, _081AD6D8 + ldr r1, _081AD6DC + adds r0, r4, 0 + bl ExpandTextCodes + ldr r3, _081AD6E0 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AD6CC: .4byte 0x03005e08 +_081AD6D0: .4byte 0x02021cc4 +_081AD6D4: .4byte 0x0203ce7c +_081AD6D8: .4byte 0x02021fc4 +_081AD6DC: .4byte 0x085e9654 +_081AD6E0: .4byte sub_81AD6E4 + 1 + thumb_func_end sub_81AD680 + + thumb_func_start sub_81AD6E4 +sub_81AD6E4: @ 81AD6E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081AD6F8 + movs r1, 0x6 + bl sub_81AE238 + pop {r0} + bx r0 + .align 2, 0 +_081AD6F8: .4byte 0x0861408c + thumb_func_end sub_81AD6E4 + + thumb_func_start sub_81AD6FC +sub_81AD6FC: @ 81AD6FC + 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, _081AD72C + adds r4, r0 + bl sub_81AE2A4 + movs r0, 0x4 + bl sub_81AE1F8 + ldrb r0, [r4] + movs r1, 0 + bl sub_81AB73C + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AD72C: .4byte 0x03005e08 + thumb_func_end sub_81AD6FC + + thumb_func_start sub_81AD730 +sub_81AD730: @ 81AD730 + 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, _081AD788 + adds r0, r4, r6 + mov r8, r0 + movs r0, 0x8 + bl sub_81AE13C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081AD78C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + adds r2, r0, 0 + muls r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABCC0 + bl sub_81AE268 + subs r6, 0x8 + adds r4, r6 + ldr r0, _081AD790 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AD788: .4byte 0x03005e08 +_081AD78C: .4byte 0x0203ce7c +_081AD790: .4byte sub_81AD794 + 1 + thumb_func_end sub_81AD730 + + thumb_func_start sub_81AD794 +sub_81AD794: @ 81AD794 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081AD7E4 + adds r6, r0, r1 + adds r0, r6, 0 + adds r0, 0x10 + ldrh r1, [r6, 0x4] + bl sub_8122034 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD7F4 + ldr r0, _081AD7E8 + ldr r0, [r0] + ldr r1, _081AD7EC + adds r0, r1 + ldrb r4, [r0] + movs r2, 0x10 + ldrsh r5, [r6, r2] + ldr r0, _081AD7F0 + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r6, r2] + adds r2, r0, 0 + muls r2, r1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81ABCC0 + b _081AD844 + .align 2, 0 +_081AD7E4: .4byte 0x03005e08 +_081AD7E8: .4byte 0x0203ce54 +_081AD7EC: .4byte 0x00000818 +_081AD7F0: .4byte 0x0203ce7c +_081AD7F4: + ldr r0, _081AD814 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD818 + movs r0, 0x5 + bl audio_play + movs r0, 0x8 + bl sub_81AE184 + adds r0, r4, 0 + bl sub_81AD680 + b _081AD844 + .align 2, 0 +_081AD814: .4byte 0x030022c0 +_081AD818: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD844 + movs r0, 0x5 + bl audio_play + ldrb r0, [r6] + movs r1, 0 + bl sub_81AB73C + bl sub_81AE2A4 + movs r0, 0x8 + bl sub_81AE184 + movs r0, 0x4 + bl sub_81AE1F8 + adds r0, r5, 0 + bl set_callback3_to_bag +_081AD844: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AD794 + + thumb_func_start sub_81AD84C +sub_81AD84C: @ 81AD84C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, _081AD8AC + adds r4, r0 + ldr r6, _081AD8B0 + ldrh r0, [r6] + ldr r1, _081AD8B4 + bl itemid_get_name + ldr r0, _081AD8B8 + mov r8, r0 + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + mov r0, r8 + movs r2, 0 + movs r3, 0x6 + bl decimal_int_to_string + ldr r4, _081AD8BC + ldr r1, _081AD8C0 + adds r0, r4, 0 + bl ExpandTextCodes + ldr r3, _081AD8C4 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81ABB4C + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AD8AC: .4byte 0x03005e08 +_081AD8B0: .4byte 0x0203ce7c +_081AD8B4: .4byte 0x02021dc4 +_081AD8B8: .4byte 0x02021cc4 +_081AD8BC: .4byte 0x02021fc4 +_081AD8C0: .4byte 0x085e9677 +_081AD8C4: .4byte sub_81AD8C8 + 1 + thumb_func_end sub_81AD84C + + thumb_func_start sub_81AD8C8 +sub_81AD8C8: @ 81AD8C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + ldr r0, _081AD9A0 + adds r0, r6 + mov r10, r0 + ldr r7, _081AD9A4 + ldrb r5, [r7, 0x5] + lsls r5, 1 + movs r1, 0x12 + adds r1, r7 + mov r9, r1 + add r9, r5 + adds r0, r7, 0 + adds r0, 0x8 + adds r5, r0 + movs r0, 0x5F + bl audio_play + ldr r2, _081AD9A8 + mov r8, r2 + ldrh r0, [r2] + mov r3, r10 + ldrh r1, [r3, 0x10] + bl sub_80D6AA4 + ldr r0, _081AD9AC + ldr r4, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r4, r1 + mov r2, r8 + ldrh r0, [r2] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r3, r10 + movs r2, 0x10 + ldrsh r1, [r3, r2] + muls r1, r0 + adds r0, r4, 0 + bl add_money + mov r3, r10 + ldrb r0, [r3] + mov r1, r9 + adds r2, r5, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, _081AD9B0 + mov r2, r9 + ldrh r1, [r2] + ldrh r2, [r5] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + mov r3, r10 + strh r0, [r3] + movs r1, 0x2 + bl sub_81AB73C + ldr r0, _081AD9B4 + ldr r0, [r0] + ldr r1, _081AD9B8 + adds r0, r1 + ldrb r4, [r0] + ldr r2, _081AD9AC + ldr r0, [r2] + movs r3, 0x92 + lsls r3, 3 + adds r0, r3 + bl decrypt_money + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + ldr r0, _081AD9A0 + subs r0, 0x8 + adds r6, r0 + ldr r0, _081AD9BC + str r0, [r6] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AD9A0: .4byte 0x03005e08 +_081AD9A4: .4byte 0x0203ce58 +_081AD9A8: .4byte 0x0203ce7c +_081AD9AC: .4byte 0x03005d8c +_081AD9B0: .4byte 0x03006310 +_081AD9B4: .4byte 0x0203ce54 +_081AD9B8: .4byte 0x00000819 +_081AD9BC: .4byte sub_81AD9C0 + 1 + thumb_func_end sub_81AD8C8 + + thumb_func_start sub_81AD9C0 +sub_81AD9C0: @ 81AD9C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081AD9E8 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD9E2 + movs r0, 0x5 + bl audio_play + bl sub_81AE2A4 + adds r0, r4, 0 + bl sub_81ABBBC +_081AD9E2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AD9E8: .4byte 0x030022c0 + thumb_func_end sub_81AD9C0 + + thumb_func_start display_deposit_item_ask_str +display_deposit_item_ask_str: @ 81AD9EC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r5, r0, 3 + ldr r6, _081ADA14 + adds r1, r5, r6 + movs r0, 0x1 + strh r0, [r1, 0x10] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bne _081ADA18 + adds r0, r2, 0 + bl sub_81ADB14 + b _081ADA5E + .align 2, 0 +_081ADA14: .4byte 0x03005e08 +_081ADA18: + ldr r0, _081ADA68 + ldrh r0, [r0] + ldr r1, _081ADA6C + bl itemid_get_name + ldr r4, _081ADA70 + ldr r1, _081ADA74 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_81AE0BC + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, _081ADA78 + str r1, [r0] +_081ADA5E: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081ADA68: .4byte 0x0203ce7c +_081ADA6C: .4byte 0x02021cc4 +_081ADA70: .4byte 0x02021fc4 +_081ADA74: .4byte 0x085e8e42 +_081ADA78: .4byte sub_81ADA7C + 1 + thumb_func_end display_deposit_item_ask_str + + thumb_func_start sub_81ADA7C +sub_81ADA7C: @ 81ADA7C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081ADAB4 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x10 + ldrh r1, [r5, 0x4] + bl sub_8122034 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ADAC0 + ldr r0, _081ADAB8 + ldr r0, [r0] + ldr r1, _081ADABC + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl sub_81ABC54 + b _081ADB0E + .align 2, 0 +_081ADAB4: .4byte 0x03005e08 +_081ADAB8: .4byte 0x0203ce54 +_081ADABC: .4byte 0x00000817 +_081ADAC0: + ldr r0, _081ADAE0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ADAE4 + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + bl sub_81AE184 + adds r0, r4, 0 + bl sub_81ADB14 + b _081ADB0E + .align 2, 0 +_081ADAE0: .4byte 0x030022c0 +_081ADAE4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ADB0E + movs r0, 0x5 + bl audio_play + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl sub_81AB73C + movs r0, 0x7 + bl sub_81AE184 + adds r0, r6, 0 + bl set_callback3_to_bag +_081ADB0E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81ADA7C + + thumb_func_start sub_81ADB14 +sub_81ADB14: @ 81ADB14 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r7, r1, 3 + ldr r0, _081ADB60 + mov r9, r0 + adds r2, r7, 0 + add r2, r9 + mov r8, r2 + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + ldr r4, _081ADB64 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081ADB6C + ldr r2, _081ADB68 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + b _081ADBE2 + .align 2, 0 +_081ADB60: .4byte 0x03005e08 +_081ADB64: .4byte 0x0203ce7c +_081ADB68: .4byte 0x085e8e8e +_081ADB6C: + ldrh r0, [r4] + mov r3, r8 + ldrh r1, [r3, 0x10] + bl sub_80D6D70 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081ADBD4 + ldrh r0, [r4] + ldr r1, _081ADBC0 + bl itemid_get_name + ldr r0, _081ADBC4 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _081ADBC8 + ldr r1, _081ADBCC + adds r0, r4, 0 + bl ExpandTextCodes + str r6, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_81AE0BC + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _081ADBD0 + b _081ADBF2 + .align 2, 0 +_081ADBC0: .4byte 0x02021cc4 +_081ADBC4: .4byte 0x02021dc4 +_081ADBC8: .4byte 0x02021fc4 +_081ADBCC: .4byte 0x085e8e5a +_081ADBD0: .4byte sub_81AD150 + 1 +_081ADBD4: + ldr r2, _081ADC04 + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] +_081ADBE2: + movs r1, 0x1 + movs r3, 0x3 + bl sub_81AE0BC + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _081ADC08 +_081ADBF2: + str r1, [r0] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ADC04: .4byte 0x085e8e6e +_081ADC08: .4byte sub_81ADC0C + 1 + thumb_func_end sub_81ADB14 + + thumb_func_start sub_81ADC0C +sub_81ADC0C: @ 81ADC0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081ADC4C + adds r5, r0, r1 + ldr r0, _081ADC50 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081ADC44 + movs r0, 0x5 + bl audio_play + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl sub_81AB73C + adds r0, r4, 0 + bl set_callback3_to_bag +_081ADC44: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081ADC4C: .4byte 0x03005e08 +_081ADC50: .4byte 0x030022c0 + thumb_func_end sub_81ADC0C + + thumb_func_start sub_81ADC54 +sub_81ADC54: @ 81ADC54 + push {lr} + ldr r0, _081ADC64 + ldrb r0, [r0, 0x4] + cmp r0, 0xA + beq _081ADC68 + movs r0, 0 + b _081ADC6A + .align 2, 0 +_081ADC64: .4byte 0x0203ce58 +_081ADC68: + movs r0, 0x1 +_081ADC6A: + pop {r1} + bx r1 + thumb_func_end sub_81ADC54 + + thumb_func_start sub_81ADC70 +sub_81ADC70: @ 81ADC70 + push {r4-r6,lr} + ldr r4, _081ADCF4 + movs r0, 0xD0 + bl malloc_and_clear + str r0, [r4] + ldr r5, _081ADCF8 + ldr r1, [r5] + movs r2, 0xAC + lsls r2, 3 + adds r1, r2 + movs r2, 0x78 + bl memcpy + ldr r0, [r4] + ldr r1, [r5] + movs r2, 0xCA + lsls r2, 3 + adds r1, r2 + adds r0, 0x78 + movs r2, 0x40 + bl memcpy + ldr r0, [r4] + ldr r2, _081ADCFC + ldrb r1, [r2, 0x5] + adds r0, 0xCE + strh r1, [r0] + movs r6, 0 + adds r5, r2, 0 + adds r5, 0x8 +_081ADCAE: + ldr r2, [r4] + lsls r3, r6, 1 + adds r0, r2, 0 + adds r0, 0xB8 + adds r0, r3 + ldrh r1, [r5] + strh r1, [r0] + adds r2, 0xC2 + adds r2, r3 + ldrh r0, [r5, 0xA] + strh r0, [r2] + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + bls _081ADCAE + ldr r4, _081ADCF8 + ldr r0, [r4] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + movs r1, 0x1E + bl sub_80D6C7C + ldr r0, [r4] + movs r2, 0xCA + lsls r2, 3 + adds r0, r2 + movs r1, 0x10 + bl sub_80D6C7C + bl sub_81AAB70 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081ADCF4: .4byte 0x0203ce80 +_081ADCF8: .4byte 0x03005d8c +_081ADCFC: .4byte 0x0203ce58 + thumb_func_end sub_81ADC70 + + thumb_func_start sub_81ADD00 +sub_81ADD00: @ 81ADD00 + push {r4-r6,lr} + ldr r5, _081ADD64 + ldr r0, [r5] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + ldr r4, _081ADD68 + ldr r1, [r4] + movs r2, 0x78 + bl memcpy + ldr r0, [r5] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + ldr r1, [r4] + adds r1, 0x78 + movs r2, 0x40 + bl memcpy + ldr r1, _081ADD6C + ldr r0, [r4] + adds r0, 0xCE + ldrh r0, [r0] + strb r0, [r1, 0x5] + movs r5, 0 + adds r6, r4, 0 + adds r3, r1, 0 + adds r3, 0x8 +_081ADD3A: + lsls r2, r5, 1 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r1, 0xC2 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3, 0xA] + adds r3, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + bls _081ADD3A + ldr r0, [r6] + bl free + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081ADD64: .4byte 0x03005d8c +_081ADD68: .4byte 0x0203ce80 +_081ADD6C: .4byte 0x0203ce58 + thumb_func_end sub_81ADD00 + + thumb_func_start sub_81ADD70 +sub_81ADD70: @ 81ADD70 + push {lr} + bl sub_81ADC70 + movs r0, 0xD + movs r1, 0x1 + bl bag_add_item + movs r0, 0x4 + movs r1, 0x1 + bl bag_add_item + ldr r2, _081ADD94 + movs r0, 0xA + movs r1, 0 + bl sub_81AAC90 + pop {r0} + bx r0 + .align 2, 0 +_081ADD94: .4byte sub_8059D50 + 1 + thumb_func_end sub_81ADD70 + + thumb_func_start sub_81ADD98 +sub_81ADD98: @ 81ADD98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081ADDC8 + adds r4, r0, r1 + ldr r0, _081ADDCC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ADE32 + movs r0, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0xCC + beq _081ADDEC + cmp r1, 0xCC + bgt _081ADDD0 + cmp r1, 0x66 + beq _081ADDDA + b _081ADE2C + .align 2, 0 +_081ADDC8: .4byte 0x03005e08 +_081ADDCC: .4byte 0x02037fd4 +_081ADDD0: + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + beq _081ADE0C + b _081ADE2C +_081ADDDA: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_81ABFA8 + b _081ADE2C +_081ADDEC: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + movs r1, 0x2 + bl sub_81AB73C + ldr r1, _081ADE08 + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81AC644 + b _081ADE2C + .align 2, 0 +_081ADE08: .4byte 0x0203ce7c +_081ADE0C: + movs r0, 0x5 + bl audio_play + bl sub_81ACE38 + ldrb r0, [r4] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + bl sub_81ADD00 + adds r0, r5, 0 + bl task_close_bag_menu_1 + b _081ADE32 +_081ADE2C: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] +_081ADE32: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81ADD98 + + thumb_func_start sub_81ADE38 +sub_81ADE38: @ 81ADE38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081ADE60 + ldr r0, _081ADE64 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _081ADE68 + movs r0, 0x1 + strh r0, [r1] + bl sub_81ACE38 + adds r0, r4, 0 + bl task_close_bag_menu_1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081ADE60: .4byte 0x020375e2 +_081ADE64: .4byte 0x0203ce7c +_081ADE68: .4byte 0x020375f0 + thumb_func_end sub_81ADE38 + + thumb_func_start sub_81ADE6C +sub_81ADE6C: @ 81ADE6C + push {lr} + ldr r0, _081ADE80 + ldr r1, _081ADE84 + str r1, [r0] + ldr r0, _081ADE88 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081ADE80: .4byte 0x03005dac +_081ADE84: .4byte sub_819FA50 + 1 +_081ADE88: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81ADE6C + + thumb_func_start sub_81ADE8C +sub_81ADE8C: @ 81ADE8C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081ADEB4 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 + ldr r1, _081ADEB8 + movs r0, 0x1 + strh r0, [r1] + bl sub_81ACE38 + adds r0, r4, 0 + bl task_close_bag_menu_1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081ADEB4: .4byte 0x0203ce7c +_081ADEB8: .4byte 0x020375f0 + thumb_func_end sub_81ADE8C + + thumb_func_start sub_81ADEBC +sub_81ADEBC: @ 81ADEBC + push {lr} + ldr r0, _081ADED0 + ldr r1, _081ADED4 + str r1, [r0] + ldr r0, _081ADED8 + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081ADED0: .4byte 0x03005dac +_081ADED4: .4byte sub_818DEF4 + 1 +_081ADED8: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81ADEBC + + thumb_func_start sub_81ADEDC +sub_81ADEDC: @ 81ADEDC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _081ADEFC + movs r0, 0x1 + strh r0, [r1] + bl sub_81ACE38 + adds r0, r4, 0 + bl task_close_bag_menu_1 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081ADEFC: .4byte 0x020375f0 + thumb_func_end sub_81ADEDC + + thumb_func_start sub_81ADF00 +sub_81ADF00: @ 81ADF00 + push {lr} + ldr r0, _081ADF14 + ldr r1, _081ADF18 + str r1, [r0] + ldr r0, _081ADF1C + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081ADF14: .4byte 0x03005dac +_081ADF18: .4byte sub_818E564 + 1 +_081ADF1C: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81ADF00 + + thumb_func_start sub_81ADF20 +sub_81ADF20: @ 81ADF20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r8, r1 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x14] + str r1, [sp, 0x18] + ldr r1, _081ADFE4 + ldr r0, [sp, 0x14] + ands r0, r1 + movs r1, 0x80 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0x14] + ldr r1, _081ADFE8 + ldr r0, [sp, 0x18] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [sp, 0x18] + add r0, sp, 0x14 + bl Window_AddFromTemplate + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl sub_81DB35C + lsls r3, r0, 24 + lsrs r3, 24 + movs r7, 0x1 + str r7, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + mov r9, r0 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81AE0BC + mov r2, r8 + cmp r2, 0 + beq _081ADFBA + movs r0, 0x1 + mov r1, r8 + movs r2, 0x40 + bl sub_81DB35C + adds r3, r0, 0 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r8 + bl sub_81AE0BC +_081ADFBA: + adds r0, r6, 0 + movs r1, 0x7 + bl Window_GetField + ldr r1, _081ADFEC + ldr r1, [r1] + ldr r2, _081ADFF0 + adds r1, r2 + ldr r2, _081ADFF4 + bl CpuSet + adds r0, r6, 0 + bl Window_Remove + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081ADFE4: .4byte 0x00ffffff +_081ADFE8: .4byte 0xffffff00 +_081ADFEC: .4byte 0x0203ce54 +_081ADFF0: .4byte 0x00000844 +_081ADFF4: .4byte 0x04000100 + thumb_func_end sub_81ADF20 + + thumb_func_start sub_81ADFF8 +sub_81ADFF8: @ 81ADFF8 + push {r4-r7,lr} + adds r7, r0, 0 + cmp r7, 0x8 + bls _081AE002 + movs r7, 0x8 +_081AE002: + ldr r0, _081AE048 + ldr r4, [r0] + ldr r0, _081AE04C + adds r4, r0 + movs r0, 0x2 + movs r1, 0x7 + bl Window_GetField + adds r5, r0, 0 + lsls r0, r7, 5 + adds r0, r4, r0 + ldr r6, _081AE050 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + adds r0, r7, 0 + adds r0, 0x10 + lsls r0, 5 + adds r4, r0 + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + movs r0, 0x2 + movs r1, 0x2 + bl Window_CopyToVram + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AE048: .4byte 0x0203ce54 +_081AE04C: .4byte 0x00000844 +_081AE050: .4byte 0x04000040 + thumb_func_end sub_81ADFF8 + + thumb_func_start setup_bag_menu_textboxes +setup_bag_menu_textboxes: @ 81AE054 + push {r4,lr} + ldr r0, _081AE0B4 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + 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 + movs r0, 0xC0 + movs r1, 0x1 + bl sub_819A2BC + ldr r0, _081AE0B8 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_081AE088: + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AE088 + 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 + .align 2, 0 +_081AE0B4: .4byte 0x08614174 +_081AE0B8: .4byte 0x0860f074 + thumb_func_end setup_bag_menu_textboxes + + thumb_func_start sub_81AE0BC +sub_81AE0BC: @ 81AE0BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r3 + ldr r3, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r6, [sp, 0x38] + ldr r5, [sp, 0x3C] + mov r8, r5 + ldr r5, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + mov r9, r7 + 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, _081AE120 + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r2, [sp, 0x10] + mov r2, r9 + bl sub_8199EEC + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AE120: .4byte 0x08614164 + thumb_func_end sub_81AE0BC + + thumb_func_start sub_81AE124 +sub_81AE124: @ 81AE124 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081AE138 + ldr r1, [r1] + movs r2, 0x81 + lsls r2, 4 + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_081AE138: .4byte 0x0203ce54 + thumb_func_end sub_81AE124 + + thumb_func_start sub_81AE13C +sub_81AE13C: @ 81AE13C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081AE17C + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE172 + lsls r0, r2, 3 + ldr r1, _081AE180 + adds r0, r1 + bl Window_AddFromTemplate + 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 +_081AE172: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081AE17C: .4byte 0x0203ce54 +_081AE180: .4byte 0x086141ac + thumb_func_end sub_81AE13C + + thumb_func_start sub_81AE184 +sub_81AE184: @ 81AE184 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081AE1C0 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE1B8 + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE1B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AE1C0: .4byte 0x0203ce54 + thumb_func_end sub_81AE184 + + thumb_func_start sub_81AE1C4 +sub_81AE1C4: @ 81AE1C4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081AE1F0 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE1E8 + lsls r0, r2, 3 + ldr r1, _081AE1F4 + adds r0, r1 + bl Window_AddFromTemplate + strb r0, [r4] +_081AE1E8: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081AE1F0: .4byte 0x0203ce54 +_081AE1F4: .4byte 0x086141ac + thumb_func_end sub_81AE1C4 + + thumb_func_start sub_81AE1F8 +sub_81AE1F8: @ 81AE1F8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081AE234 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE22C + movs r1, 0 + bl sub_8197DF8 + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE22C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AE234: .4byte 0x0203ce54 + thumb_func_end sub_81AE1F8 + + thumb_func_start sub_81AE238 +sub_81AE238: @ 81AE238 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 21 + ldr r3, _081AE264 + adds r1, r3 + movs r3, 0x2 + str r3, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + movs r3, 0xE + str r3, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl sub_8121F94 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_081AE264: .4byte 0x086141ac + thumb_func_end sub_81AE238 + + thumb_func_start sub_81AE268 +sub_81AE268: @ 81AE268 + push {r4,lr} + movs r0, 0x9 + bl sub_81AE13C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081AE2A0 + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl decrypt_money + adds r3, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0xE + bl set_window_border_style_and_print_money_box + movs r0, 0x13 + movs r1, 0xB + bl AddMoneyTextObject + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AE2A0: .4byte 0x03005d8c + thumb_func_end sub_81AE268 + + thumb_func_start sub_81AE2A4 +sub_81AE2A4: @ 81AE2A4 + push {lr} + movs r0, 0x9 + bl sub_81AE184 + bl sub_80E53F4 + pop {r0} + bx r0 + thumb_func_end sub_81AE2A4 + + thumb_func_start sub_81AE2B4 +sub_81AE2B4: @ 81AE2B4 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x3 + movs r1, 0x13 + movs r2, 0 + movs r3, 0 + bl sub_819A2F8 + movs r0, 0x3 + movs r1, 0x14 + movs r2, 0 + movs r3, 0xC + bl sub_819A2F8 + movs r0, 0x3 + movs r1, 0x15 + movs r2, 0 + movs r3, 0x18 + bl sub_819A2F8 + movs r0, 0x3 + movs r1, 0x16 + movs r2, 0 + movs r3, 0x24 + bl sub_819A2F8 + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + pop {r0} + bx r0 + thumb_func_end sub_81AE2B4 + + thumb_func_start sub_81AE2FC +sub_81AE2FC: @ 81AE2FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x4 + movs r1, 0 + bl Window_FastFillPixels + cmp r4, 0 + bne _081AE354 + movs r4, 0 + movs r5, 0 +_081AE31A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 26 + lsrs r0, 24 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + ldr r2, _081AE350 + movs r3, 0x7 + bl sub_81AE0BC + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081AE31A + movs r0, 0x4 + movs r1, 0x2 + bl Window_CopyToVram + b _081AE440 + .align 2, 0 +_081AE350: .4byte 0x085e8d45 +_081AE354: + adds r0, r4, 0 + bl sub_81B6CFC + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, _081AE384 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl sub_819A2F8 + ldrb r0, [r5, 0x1] + cmp r0, 0x1 + bhi _081AE38C + ldr r2, _081AE388 + b _081AE39C + .align 2, 0 +_081AE384: .4byte 0x0831c898 +_081AE388: .4byte 0x085e8d45 +_081AE38C: + ldr r4, _081AE3CC + ldrb r1, [r5, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + adds r2, r4, 0 +_081AE39C: + movs r0, 0xC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl sub_81AE0BC + ldr r2, _081AE3D0 + lsls r1, r7, 1 + adds r0, r1, r7 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + adds r6, r1, 0 + cmp r0, 0 + bne _081AE3D8 + ldr r2, _081AE3D4 + b _081AE3E8 + .align 2, 0 +_081AE3CC: .4byte 0x02021cc4 +_081AE3D0: .4byte 0x0831c898 +_081AE3D4: .4byte 0x085e8d45 +_081AE3D8: + ldr r4, _081AE450 + ldrb r1, [r2, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + adds r2, r4, 0 +_081AE3E8: + movs r0, 0x18 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0xFF + mov r8, r0 + str r0, [sp, 0xC] + movs r0, 0x4 + mov r9, r0 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl sub_81AE0BC + ldr r5, _081AE450 + ldr r1, _081AE454 + adds r0, r6, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + movs r0, 0x24 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + movs r0, 0x4 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x7 + bl sub_81AE0BC + movs r0, 0x4 + movs r1, 0x2 + bl Window_CopyToVram +_081AE440: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AE450: .4byte 0x02021cc4 +_081AE454: .4byte 0x0831c898 + thumb_func_end sub_81AE2FC + + thumb_func_start nullsub_125 +nullsub_125: @ 81AE458 + bx lr + thumb_func_end nullsub_125 + + thumb_func_start sub_81AE45C +sub_81AE45C: @ 81AE45C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r0 + str r1, [sp] + ldr r0, [sp, 0x28] + lsls r2, 24 + lsrs r6, r2, 24 + mov r10, r6 + lsls r3, 16 + lsrs r7, r3, 16 + str r7, [sp, 0x4] + lsls r0, 16 + mov r8, r0 + lsrs r0, 16 + mov r9, r0 + ldr r5, _081AE4EC + ldrb r4, [r5, 0x4] + cmp r4, 0x1 + beq _081AE4F4 + cmp r4, 0x1 + ble _081AE492 + cmp r4, 0x2 + beq _081AE558 +_081AE492: + mov r0, r12 + bl Window_AddFromTemplate + strb r0, [r5, 0x5] + cmp r6, 0x1 + beq _081AE4B0 + cmp r6, 0x2 + bne _081AE4C0 + ldrb r0, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 24 + lsrs r2, 24 + adds r1, r7, 0 + bl sub_809882C +_081AE4B0: + ldrb r0, [r5, 0x5] + mov r3, r8 + lsrs r2, r3, 20 + lsls r2, 24 + lsrs r2, 24 + ldr r1, [sp, 0x4] + bl sub_8098858 +_081AE4C0: + ldr r0, _081AE4F0 + adds r2, r0, 0 + ldr r1, [sp] + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldr r4, _081AE4EC + ldrb r1, [r4, 0x5] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl calls_per_item_funcs_in_list_outer + strb r0, [r4, 0x6] + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl Window_CopyToVram + movs r0, 0x1 + strb r0, [r4, 0x4] + b _081AE570 + .align 2, 0 +_081AE4EC: .4byte 0x0203ce84 +_081AE4F0: .4byte 0x03006310 +_081AE4F4: + ldrb r0, [r5, 0x6] + bl sub_81AE604 + str r0, [r5] + ldr r1, _081AE530 + ldrh r0, [r1, 0x2E] + ands r4, r0 + cmp r4, 0 + beq _081AE50A + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE50A: + ldrh r1, [r1, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE51E + movs r0, 0x2 + negs r0, r0 + str r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE51E: + ldrb r0, [r5, 0x4] + cmp r0, 0x2 + bne _081AE570 + cmp r6, 0 + bne _081AE534 + ldrb r0, [r5, 0x5] + bl Window_FillTileMap + b _081AE546 + .align 2, 0 +_081AE530: .4byte 0x030022c0 +_081AE534: + mov r4, r10 + cmp r4, 0 + blt _081AE546 + cmp r4, 0x2 + bgt _081AE546 + ldrb r0, [r5, 0x5] + movs r1, 0 + bl sub_819746C +_081AE546: + ldr r0, _081AE554 + ldrb r0, [r0, 0x5] + movs r1, 0x1 + bl Window_CopyToVram + b _081AE570 + .align 2, 0 +_081AE554: .4byte 0x0203ce84 +_081AE558: + ldrb r0, [r5, 0x6] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r5, 0x5] + bl Window_Remove + movs r0, 0 + strb r0, [r5, 0x4] + ldr r0, [r5] + b _081AE574 +_081AE570: + movs r0, 0x1 + negs r0, r0 +_081AE574: + 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_81AE45C + + thumb_func_start calls_per_item_funcs_in_list_outer +calls_per_item_funcs_in_list_outer: @ 81AE584 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl calls_per_item_funcs_in_list + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x10] + bl Window_WriteStandardTileMap + ldrb r0, [r5, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end calls_per_item_funcs_in_list_outer + + thumb_func_start sub_81AE5B0 +sub_81AE5B0: @ 81AE5B0 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r4, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl calls_per_item_funcs_in_list + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4, 0x4] + cmp r0, 0xFF + beq _081AE5F0 + adds r5, r4, 0 +_081AE5D4: + ldrb r0, [r6, 0x10] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldrb r3, [r5, 0x2] + ldrb r4, [r5, 0x3] + str r4, [sp] + ldrb r4, [r5, 0x4] + str r4, [sp, 0x4] + bl Window_WriteStandardTileMapRectOverridePalette + adds r5, 0x8 + ldrb r0, [r5, 0x4] + cmp r0, 0xFF + bne _081AE5D4 +_081AE5F0: + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AE5B0 + + thumb_func_start sub_81AE604 +sub_81AE604: @ 81AE604 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AE630 + adds r3, r1, r0 + ldr r2, _081AE634 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AE638 + ldrh r0, [r3, 0x18] + ldrh r1, [r3, 0x1A] + adds r0, r1 + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + b _081AE6C2 + .align 2, 0 +_081AE630: .4byte 0x03005e08 +_081AE634: .4byte 0x030022c0 +_081AE638: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE646 + movs r0, 0x2 + negs r0, r0 + b _081AE6C2 +_081AE646: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081AE65A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0 + b _081AE6BA +_081AE65A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081AE66A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + b _081AE6B8 +_081AE66A: + ldrb r0, [r3, 0x16] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AE680 + cmp r0, 0x1 + ble _081AE67A + cmp r0, 0x2 + beq _081AE68C +_081AE67A: + movs r2, 0 + movs r0, 0 + b _081AE6A0 +_081AE680: + movs r0, 0x20 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x10 + b _081AE69A +_081AE68C: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x80 + lsls r0, 1 +_081AE69A: + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 +_081AE6A0: + cmp r2, 0 + beq _081AE6AE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 + movs r3, 0 + b _081AE6BA +_081AE6AE: + cmp r0, 0 + beq _081AE6BE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 +_081AE6B8: + movs r3, 0x1 +_081AE6BA: + bl sub_81AEF28 +_081AE6BE: + movs r0, 0x1 + negs r0, r0 +_081AE6C2: + pop {r1} + bx r1 + thumb_func_end sub_81AE604 + + thumb_func_start sub_81AE6C8 +sub_81AE6C8: @ 81AE6C8 + push {r4,lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081AE708 + adds r1, r0, r1 + cmp r3, 0 + beq _081AE6E4 + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE6E4: + cmp r2, 0 + beq _081AE6EC + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE6EC: + ldrb r0, [r1, 0x1E] + cmp r0, 0xFF + beq _081AE6FC + ldrb r1, [r1, 0x17] + lsrs r1, 6 + subs r1, 0x2 + bl sub_81AF6C4 +_081AE6FC: + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AE708: .4byte 0x03005e08 + thumb_func_end sub_81AE6C8 + + thumb_func_start sub_81AE70C +sub_81AE70C: @ 81AE70C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081AE74C + adds r4, r0 + ldrb r0, [r4, 0x10] + ldrb r2, [r4, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + ldrh r1, [r4, 0x18] + ldrh r3, [r4, 0xE] + adds r0, r4, 0 + movs r2, 0 + bl calls_printshopbuyprice + adds r0, r4, 0 + bl sub_81AEB20 + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AE74C: .4byte 0x03005e08 + thumb_func_end sub_81AE70C + + thumb_func_start sub_81AE750 +sub_81AE750: @ 81AE750 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081AE790 + adds r4, r0 + lsrs r1, 20 + ldrb r6, [r4, 0x14] + movs r5, 0xF + adds r0, r5, 0 + ands r0, r6 + orrs r0, r1 + strb r0, [r4, 0x14] + ands r2, r5 + ldrb r1, [r4, 0x15] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + orrs r0, r2 + lsrs r3, 20 + ands r0, r5 + orrs r0, r3 + strb r0, [r4, 0x15] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AE790: .4byte 0x03005e08 + thumb_func_end sub_81AE750 + + thumb_func_start sub_81AE794 +sub_81AE794: @ 81AE794 + push {r4,r5,lr} + adds r3, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081AE7CC + adds r4, r0 + ldrb r0, [r4, 0x10] + movs r1, 0x1 + adds r2, r3, 0 + bl Window_SetField + ldrb r0, [r4, 0x10] + movs r1, 0x2 + adds r2, r5, 0 + bl Window_SetField + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AE7CC: .4byte 0x03005e08 + thumb_func_end sub_81AE794 + + thumb_func_start sub_81AE7D0 +sub_81AE7D0: @ 81AE7D0 + push {r4-r7,lr} + sub sp, 0x20 + mov r12, r2 + ldr r5, [sp, 0x34] + lsls r3, 16 + lsrs r3, 16 + adds r4, r3, 0 + mov r3, sp + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + mov r0, sp + movs r3, 0 + strh r1, [r0, 0x18] + mov r1, r12 + strh r1, [r0, 0x1A] + strb r3, [r0, 0x1C] + strb r3, [r0, 0x1D] + cmp r4, 0x40 + bne _081AE804 + movs r1, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_81AEF28 +_081AE804: + cmp r4, 0x80 + bne _081AE814 + mov r0, sp + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_81AEF28 +_081AE814: + cmp r5, 0 + beq _081AE81E + mov r0, sp + ldrh r0, [r0, 0x18] + strh r0, [r5] +_081AE81E: + ldr r2, [sp, 0x38] + cmp r2, 0 + beq _081AE82A + mov r0, sp + ldrh r0, [r0, 0x1A] + strh r0, [r2] +_081AE82A: + movs r0, 0x1 + negs r0, r0 + add sp, 0x20 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AE7D0 + + thumb_func_start sub_81AE838 +sub_81AE838: @ 81AE838 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AE85C + adds r1, r0 + cmp r2, 0 + beq _081AE856 + ldrh r0, [r1, 0x1A] + ldrh r1, [r1, 0x18] + adds r0, r1 + strh r0, [r2] +_081AE856: + pop {r0} + bx r0 + .align 2, 0 +_081AE85C: .4byte 0x03005e08 + thumb_func_end sub_81AE838 + + thumb_func_start get_coro_args_x18_x1A +get_coro_args_x18_x1A: @ 81AE860 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AE888 + adds r1, r0 + cmp r3, 0 + beq _081AE87A + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE87A: + cmp r2, 0 + beq _081AE882 + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE882: + pop {r0} + bx r0 + .align 2, 0 +_081AE888: .4byte 0x03005e08 + thumb_func_end get_coro_args_x18_x1A + + thumb_func_start sub_81AE88C +sub_81AE88C: @ 81AE88C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081AE8D0 + adds r4, r0 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl fbox_get_field + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x1A] + adds r2, r1, 0 + muls r2, r0 + adds r1, r2, 0 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081AE8D0: .4byte 0x03005e08 + thumb_func_end sub_81AE88C + + thumb_func_start calls_per_item_funcs_in_list +calls_per_item_funcs_in_list: @ 81AE8D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, _081AE9A4 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _081AE9A8 + adds r7, r0, r1 + adds r0, r7, 0 + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + movs r1, 0 + strh r5, [r7, 0x18] + strh r6, [r7, 0x1A] + strb r1, [r7, 0x1C] + strb r1, [r7, 0x1D] + movs r0, 0xFF + strb r0, [r7, 0x1E] + strb r1, [r7, 0x1F] + ldr r3, _081AE9AC + ldrb r1, [r7, 0x14] + movs r5, 0xF + lsrs r1, 4 + ldrb r4, [r3] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r7, 0x15] + lsls r1, 28 + lsrs r1, 24 + ands r0, r5 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r7, 0x15] + lsrs r0, 4 + ands r5, r0 + ldrb r0, [r3, 0x1] + ands r2, r0 + orrs r2, r5 + strb r2, [r3, 0x1] + ldrb r1, [r7, 0x16] + lsls r1, 29 + lsrs r1, 17 + ldr r0, [r3] + ldr r2, _081AE9B0 + ands r0, r2 + orrs r0, r1 + str r0, [r3] + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + strb r0, [r3, 0x3] + ldrh r0, [r7, 0xC] + ldrh r1, [r7, 0xE] + cmp r0, r1 + bcs _081AE96C + strh r0, [r7, 0xE] +_081AE96C: + ldrb r0, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + ldrh r1, [r7, 0x18] + ldrh r3, [r7, 0xE] + adds r0, r7, 0 + movs r2, 0 + bl calls_printshopbuyprice + adds r0, r7, 0 + bl sub_81AEB20 + adds r0, r7, 0 + movs r1, 0x1 + bl calls_printshopitemdescription + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AE9A4: .4byte nullsub_125 + 1 +_081AE9A8: .4byte 0x03005e08 +_081AE9AC: .4byte 0x03006300 +_081AE9B0: .4byte 0xfffc0fff + thumb_func_end calls_per_item_funcs_in_list + + thumb_func_start sub_81AE9B4 +sub_81AE9B4: @ 81AE9B4 + push {r4-r7,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + ldr r5, _081AEA1C + ldrb r1, [r5, 0x3] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _081AEA20 + add r1, sp, 0x14 + ldr r2, [r5] + lsls r0, r2, 24 + lsrs r0, 28 + movs r3, 0 + strb r0, [r1] + lsls r0, r2, 28 + lsrs r0, 28 + strb r0, [r1, 0x1] + lsls r0, r2, 20 + lsrs r0, 28 + strb r0, [r1, 0x2] + ldrb r0, [r4, 0x10] + lsls r1, r2, 1 + lsrs r1, 25 + lsls r2, 14 + lsrs r2, 26 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl sub_8199EEC + ldrb r1, [r5, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r5, 0x3] + b _081AEA5E + .align 2, 0 +_081AEA1C: .4byte 0x03006300 +_081AEA20: + add r2, sp, 0x14 + ldrb r1, [r4, 0x15] + lsls r0, r1, 28 + lsrs r0, 28 + strb r0, [r2] + ldrb r0, [r4, 0x14] + lsrs r0, 4 + strb r0, [r2, 0x1] + adds r0, r2, 0 + lsls r1, 24 + lsrs r1, 28 + strb r1, [r0, 0x2] + ldrb r0, [r4, 0x10] + ldrb r1, [r4, 0x17] + lsls r1, 26 + lsrs r1, 26 + ldrb r2, [r4, 0x16] + lsls r2, 29 + lsrs r2, 29 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl sub_8199EEC +_081AEA5E: + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AE9B4 + + thumb_func_start calls_printshopbuyprice +calls_printshopbuyprice: @ 81AEA68 + 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, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl fbox_get_field + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AEB10 +_081AEAAA: + ldr r0, [r4] + mov r2, r9 + lsls r1, r2, 3 + adds r0, r1, r0 + ldr r2, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + adds r5, r1, 0 + cmp r2, r0 + beq _081AEAC2 + ldrb r6, [r4, 0x12] + b _081AEAC4 +_081AEAC2: + ldrb r6, [r4, 0x11] +_081AEAC4: + ldr r0, [sp] + add r0, r8 + ldr r2, [sp, 0x4] + adds r1, r0, 0 + muls r1, r2 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r7, r2, 0 + ldr r3, [r4, 0x8] + cmp r3, 0 + beq _081AEAEE + ldrb r0, [r4, 0x10] + ldr r1, [r4] + adds r1, r5, r1 + ldr r1, [r1, 0x4] + bl _call_via_r3 +_081AEAEE: + ldr r0, [r4] + adds r0, r5, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_81AE9B4 + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x1 + add r8, r0 + cmp r8, r10 + blt _081AEAAA +_081AEB10: + 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 calls_printshopbuyprice + + thumb_func_start sub_81AEB20 +sub_81AEB20: @ 81AEB20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl fbox_get_field + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6, 0x13] + mov r8, r1 + ldrh r1, [r6, 0x1A] + muls r1, r0 + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x17] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AEC0C + cmp r0, 0x1 + bgt _081AEB66 + cmp r0, 0 + beq _081AEB70 + b _081AEC0C +_081AEB66: + cmp r0, 0x2 + beq _081AEB84 + cmp r0, 0x3 + beq _081AEBCC + b _081AEC0C +_081AEB70: + ldr r1, _081AEB80 + adds r0, r6, 0 + mov r2, r8 + adds r3, r7, 0 + bl sub_81AE9B4 + b _081AEC0C + .align 2, 0 +_081AEB80: .4byte 0x085e8d60 +_081AEB84: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEB94 + adds r0, r6, 0 + movs r1, 0 + bl sub_81AEC18 + strb r0, [r6, 0x1E] +_081AEB94: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl Window_GetField + adds r4, r0, 0 + lsls r4, 19 + ldr r0, _081AEBC8 + adds r4, r0 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl Window_GetField + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + subs r2, 0x1 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0 + bl sub_81AF69C + b _081AEC0C + .align 2, 0 +_081AEBC8: .4byte 0xffff0000 +_081AEBCC: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEBDC + adds r0, r6, 0 + movs r1, 0x1 + bl sub_81AEC18 + strb r0, [r6, 0x1E] +_081AEBDC: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl Window_GetField + adds r4, r0, 0 + lsls r4, 3 + add r4, r8 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl Window_GetField + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81AF69C +_081AEC0C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AEB20 + + thumb_func_start sub_81AEC18 +sub_81AEC18: @ 81AEC18 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + mov r1, sp + movs r0, 0 + strb r0, [r1] + movs r0, 0xA0 + strb r0, [r1, 0x1] + ldrb r0, [r4, 0x10] + movs r1, 0x3 + bl Window_GetField + mov r1, sp + lsls r0, 3 + adds r0, 0x2 + strh r0, [r1, 0x2] + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl fbox_get_field + mov r1, sp + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x2 + strh r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r1, 0x6] + ldr r0, _081AEC74 + strh r0, [r1, 0x8] + movs r0, 0xF + strb r0, [r1, 0xA] + mov r0, sp + adds r1, r5, 0 + bl sub_81AF680 + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081AEC74: .4byte 0x0000ffff + thumb_func_end sub_81AEC18 + + thumb_func_start sub_81AEC78 +sub_81AEC78: @ 81AEC78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldrb r1, [r7, 0x17] + lsrs r0, r1, 6 + cmp r0, 0 + bne _081AECF4 + lsls r0, r1, 26 + lsrs r0, 26 + movs r1, 0x1 + bl fbox_get_field + adds r4, r0, 0 + ldrb r0, [r7, 0x16] + lsls r0, 26 + lsrs r0, 29 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0 + bl sub_8006460 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl sub_8006460 + lsls r0, 24 + lsrs r0, 24 + ldrb r6, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + ldrb r2, [r7, 0x13] + mov r3, r8 + muls r3, r4 + adds r4, r3, 0 + ldrb r3, [r7, 0x14] + lsls r3, 28 + lsrs r3, 28 + adds r3, r4 + lsls r3, 16 + lsrs r3, 16 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + bl Window_FillPixelRect +_081AECF4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AEC78 + + thumb_func_start sub_81AED00 +sub_81AED00: @ 81AED00 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + ldrh r3, [r4, 0x1A] + ldrh r5, [r4, 0x18] + cmp r1, 0 + bne _081AED74 + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED18 + movs r2, 0 + b _081AED2A +_081AED18: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 + subs r0, r2 + subs r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 +_081AED2A: + cmp r5, 0 + bne _081AED50 + cmp r3, 0 + beq _081AEDB6 + ldr r1, [r4] + movs r2, 0x3 + negs r2, r2 +_081AED38: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r2 + bne _081AEDBA + cmp r3, 0 + bne _081AED38 + b _081AEDB6 +_081AED50: + cmp r3, r2 + bls _081AED70 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AED5A: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bhi _081AED5A +_081AED70: + subs r0, r5, 0x1 + b _081AEDE2 +_081AED74: + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED7E + movs r2, 0 + b _081AED88 +_081AED7E: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 +_081AED88: + adds r1, r0, 0 + ldrh r0, [r4, 0xC] + subs r0, r1 + cmp r5, r0 + bne _081AEDC0 + subs r0, r1, 0x1 + cmp r3, r0 + bge _081AEDB6 + ldr r2, [r4] + movs r6, 0x3 + negs r6, r6 + adds r1, r0, 0 +_081AEDA0: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r2 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r1 + blt _081AEDA0 +_081AEDB6: + movs r0, 0 + b _081AEDE8 +_081AEDBA: + strh r3, [r4, 0x1A] + movs r0, 0x1 + b _081AEDE8 +_081AEDC0: + cmp r3, r2 + bcs _081AEDE0 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AEDCA: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bcc _081AEDCA +_081AEDE0: + adds r0, r5, 0x1 +_081AEDE2: + strh r2, [r4, 0x1A] + strh r0, [r4, 0x18] + movs r0, 0x2 +_081AEDE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81AED00 + + thumb_func_start sub_81AEDF0 +sub_81AEDF0: @ 81AEDF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldrh r0, [r6, 0xE] + cmp r5, r0 + bcc _081AEE2A + ldrb r0, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + ldrh r1, [r6, 0x18] + ldrh r3, [r6, 0xE] + adds r0, r6, 0 + movs r2, 0 + bl calls_printshopbuyprice + b _081AEF1A +_081AEE2A: + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl fbox_get_field + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + cmp r1, 0 + bne _081AEEBC + ldrb r0, [r6, 0x10] + adds r2, r5, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0x1 + bl Window_ScrollVertically + ldrh r1, [r6, 0x18] + adds r0, r6, 0 + movs r2, 0 + adds r3, r5, 0 + bl calls_printshopbuyprice + ldrh r0, [r6, 0xE] + adds r1, r0, 0 + muls r1, r4 + adds r0, r1, 0 + ldrb r4, [r6, 0x14] + lsls r4, 28 + lsrs r4, 28 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl Window_GetField + adds r5, r0, 0 + lsls r5, 19 + lsrs r5, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x4 + bl Window_GetField + lsls r0, 3 + subs r0, r4 + lsls r0, 16 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + adds r3, r4, 0 + bl Window_FillPixelRect + b _081AEF1A +_081AEEBC: + ldrb r0, [r6, 0x10] + adds r2, r7, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl Window_ScrollVertically + ldrh r2, [r6, 0xE] + subs r2, r7 + ldrh r1, [r6, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r3, r7, 0 + bl calls_printshopbuyprice + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl Window_GetField + lsls r0, 19 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r0, [sp] + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + movs r3, 0 + bl Window_FillPixelRect +_081AEF1A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AEDF0 + + thumb_func_start sub_81AEF28 +sub_81AEF28: @ 81AEF28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + ldrh r0, [r4, 0x1A] + mov r10, r0 + movs r7, 0 + movs r5, 0 + movs r0, 0 + cmp r7, r8 + bcs _081AEF90 +_081AEF56: + adds r6, r0, 0x1 + b _081AEF76 +_081AEF5A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x18] + ldrh r1, [r4, 0x1A] + adds r0, r1 + ldr r1, [r4] + lsls r0, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081AEF88 +_081AEF76: + adds r0, r4, 0 + mov r1, r9 + bl sub_81AED00 + lsls r0, 24 + lsrs r0, 24 + orrs r5, r0 + cmp r0, 0x2 + beq _081AEF5A +_081AEF88: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _081AEF56 +_081AEF90: + ldr r0, [sp] + cmp r0, 0 + beq _081AEFEE + cmp r5, 0x1 + beq _081AEFA6 + cmp r5, 0x1 + ble _081AEFA2 + cmp r5, 0x3 + ble _081AEFC6 +_081AEFA2: + movs r0, 0x1 + b _081AEFF0 +_081AEFA6: + adds r0, r4, 0 + mov r1, r10 + bl sub_81AEC78 + adds r0, r4, 0 + bl sub_81AEB20 + adds r0, r4, 0 + movs r1, 0 + bl calls_printshopitemdescription + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl Window_CopyToVram + b _081AEFEE +_081AEFC6: + adds r0, r4, 0 + mov r1, r10 + bl sub_81AEC78 + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r9 + bl sub_81AEDF0 + adds r0, r4, 0 + bl sub_81AEB20 + adds r0, r4, 0 + movs r1, 0 + bl calls_printshopitemdescription + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl Window_CopyToVram +_081AEFEE: + movs r0, 0 +_081AEFF0: + 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_81AEF28 + + thumb_func_start calls_printshopitemdescription +calls_printshopitemdescription: @ 81AF000 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r3, [r2, 0x4] + cmp r3, 0 + beq _081AF022 + ldrh r0, [r2, 0x18] + ldrh r1, [r2, 0x1A] + adds r0, r1 + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + bl _call_via_r3 +_081AF022: + pop {r4} + pop {r0} + bx r0 + thumb_func_end calls_printshopitemdescription + + thumb_func_start sub_81AF028 +sub_81AF028: @ 81AF028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r6, _081AF074 + movs r5, 0xF + ands r0, r5 + ldrb r3, [r6] + mov r8, r3 + movs r4, 0x10 + negs r4, r4 + adds r3, r4, 0 + mov r7, r8 + ands r3, r7 + orrs r3, r0 + lsrs r1, 20 + ands r3, r5 + orrs r3, r1 + strb r3, [r6] + ands r2, r5 + ldrb r0, [r6, 0x1] + ands r4, r0 + orrs r4, r2 + strb r4, [r6, 0x1] + ldrb r0, [r6, 0x3] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r6, 0x3] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AF074: .4byte 0x03006300 + thumb_func_end sub_81AF028 + + thumb_func_start sub_81AF078 +sub_81AF078: @ 81AF078 + push {lr} + lsls r1, 24 + cmp r1, 0 + bne _081AF086 + movs r0, 0x5 + bl audio_play +_081AF086: + pop {r0} + bx r0 + thumb_func_end sub_81AF078 + + thumb_func_start sub_81AF08C +sub_81AF08C: @ 81AF08C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AF0B0 + adds r2, r1, r0 + cmp r3, 0x10 + bhi _081AF154 + lsls r0, r3, 2 + ldr r1, _081AF0B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AF0B0: .4byte 0x03005e08 +_081AF0B4: .4byte _081AF0B8 + .align 2, 0 +_081AF0B8: + .4byte _081AF0FC + .4byte _081AF0FC + .4byte _081AF100 + .4byte _081AF104 + .4byte _081AF108 + .4byte _081AF10C + .4byte _081AF110 + .4byte _081AF114 + .4byte _081AF118 + .4byte _081AF11C + .4byte _081AF122 + .4byte _081AF12A + .4byte _081AF130 + .4byte _081AF138 + .4byte _081AF140 + .4byte _081AF146 + .4byte _081AF14E +_081AF0FC: + ldr r0, [r2, 0x4] + b _081AF158 +_081AF100: + ldrh r0, [r2, 0xC] + b _081AF158 +_081AF104: + ldrh r0, [r2, 0xE] + b _081AF158 +_081AF108: + ldrb r0, [r2, 0x10] + b _081AF158 +_081AF10C: + ldrb r0, [r2, 0x11] + b _081AF158 +_081AF110: + ldrb r0, [r2, 0x12] + b _081AF158 +_081AF114: + ldrb r0, [r2, 0x13] + b _081AF158 +_081AF118: + ldrb r0, [r2, 0x14] + b _081AF124 +_081AF11C: + ldrb r0, [r2, 0x14] + lsrs r0, 4 + b _081AF158 +_081AF122: + ldrb r0, [r2, 0x15] +_081AF124: + lsls r0, 28 + lsrs r0, 28 + b _081AF158 +_081AF12A: + ldrb r0, [r2, 0x15] + lsrs r0, 4 + b _081AF158 +_081AF130: + ldrb r0, [r2, 0x16] + lsls r0, 29 + lsrs r0, 29 + b _081AF158 +_081AF138: + ldrb r0, [r2, 0x16] + lsls r0, 26 + lsrs r0, 29 + b _081AF158 +_081AF140: + ldrb r0, [r2, 0x16] + lsrs r0, 6 + b _081AF158 +_081AF146: + ldrb r0, [r2, 0x17] + lsls r0, 26 + lsrs r0, 26 + b _081AF158 +_081AF14E: + ldrb r0, [r2, 0x17] + lsrs r0, 6 + b _081AF158 +_081AF154: + movs r0, 0x1 + negs r0, r0 +_081AF158: + pop {r1} + bx r1 + thumb_func_end sub_81AF08C + + thumb_func_start sub_81AF15C +sub_81AF15C: @ 81AF15C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AF180 + adds r3, r1, r0 + cmp r4, 0x10 + bhi _081AF25C + lsls r0, r4, 2 + ldr r1, _081AF184 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081AF180: .4byte 0x03005e08 +_081AF184: .4byte _081AF188 + .align 2, 0 +_081AF188: + .4byte _081AF1CC + .4byte _081AF1CC + .4byte _081AF1D0 + .4byte _081AF1D4 + .4byte _081AF1D8 + .4byte _081AF1DC + .4byte _081AF1E0 + .4byte _081AF1E4 + .4byte _081AF1E8 + .4byte _081AF1F4 + .4byte _081AF202 + .4byte _081AF20E + .4byte _081AF21C + .4byte _081AF228 + .4byte _081AF236 + .4byte _081AF244 + .4byte _081AF250 +_081AF1CC: + str r2, [r3, 0x4] + b _081AF25C +_081AF1D0: + strh r2, [r3, 0xC] + b _081AF25C +_081AF1D4: + strh r2, [r3, 0xE] + b _081AF25C +_081AF1D8: + strb r2, [r3, 0x10] + b _081AF25C +_081AF1DC: + strb r2, [r3, 0x11] + b _081AF25C +_081AF1E0: + strb r2, [r3, 0x12] + b _081AF25C +_081AF1E4: + strb r2, [r3, 0x13] + b _081AF25C +_081AF1E8: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x14] + movs r0, 0x10 + negs r0, r0 + b _081AF1FA +_081AF1F4: + lsls r2, 4 + ldrb r1, [r3, 0x14] + movs r0, 0xF +_081AF1FA: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x14] + b _081AF25C +_081AF202: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x15] + movs r0, 0x10 + negs r0, r0 + b _081AF214 +_081AF20E: + lsls r2, 4 + ldrb r1, [r3, 0x15] + movs r0, 0xF +_081AF214: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x15] + b _081AF25C +_081AF21C: + movs r0, 0x7 + ands r2, r0 + ldrb r1, [r3, 0x16] + movs r0, 0x8 + negs r0, r0 + b _081AF23C +_081AF228: + movs r0, 0x7 + ands r2, r0 + lsls r2, 3 + ldrb r1, [r3, 0x16] + movs r0, 0x39 + negs r0, r0 + b _081AF23C +_081AF236: + lsls r2, 6 + ldrb r1, [r3, 0x16] + movs r0, 0x3F +_081AF23C: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x16] + b _081AF25C +_081AF244: + movs r0, 0x3F + ands r2, r0 + ldrb r1, [r3, 0x17] + movs r0, 0x40 + negs r0, r0 + b _081AF256 +_081AF250: + lsls r2, 6 + ldrb r1, [r3, 0x17] + movs r0, 0x3F +_081AF256: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x17] +_081AF25C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81AF15C + + thumb_func_start sub_81AF264 +sub_81AF264: @ 81AF264 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF276 + cmp r0, 0x1 + beq _081AF28A + b _081AF2E4 +_081AF276: + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl obj_anim_image_start + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081AF2E4 +_081AF28A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF29A + cmp r0, 0x1 + beq _081AF2C0 + ldrh r2, [r4, 0x38] + b _081AF2DE +_081AF29A: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, _081AF2BC + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2B4 + adds r0, 0xFF +_081AF2B4: + asrs r0, 8 + strh r0, [r4, 0x24] + b _081AF2DE + .align 2, 0 +_081AF2BC: .4byte 0x08329f40 +_081AF2C0: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, _081AF2EC + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2DA + adds r0, 0xFF +_081AF2DA: + asrs r0, 8 + strh r0, [r4, 0x26] +_081AF2DE: + ldrh r0, [r4, 0x36] + adds r0, r2, r0 + strh r0, [r4, 0x38] +_081AF2E4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AF2EC: .4byte 0x08329f40 + thumb_func_end sub_81AF264 + + thumb_func_start sub_81AF2F0 +sub_81AF2F0: @ 81AF2F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r6, r0, 0 + ldr r5, [sp, 0x30] + lsls r6, 24 + lsrs r6, 24 + mov r8, r6 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 16 + lsrs r5, 16 + mov r12, r5 + mov r4, sp + ldr r0, _081AF374 + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + mov r0, sp + movs r4, 0 + strh r3, [r0] + mov r3, r12 + strh r3, [r0, 0x2] + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081AF378 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + adds r5, r3, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r5] + strh r4, [r3, 0x2E] + ldr r1, _081AF37C + mov r5, r8 + lsls r6, r5, 2 + adds r6, r1 + ldrb r2, [r6] + lsls r1, r2, 28 + lsrs r1, 28 + strh r1, [r3, 0x30] + lsrs r2, 4 + strh r2, [r3, 0x32] + ldrb r1, [r6, 0x1] + strh r1, [r3, 0x34] + ldrh r1, [r6, 0x2] + strh r1, [r3, 0x36] + strh r4, [r3, 0x38] + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AF374: .4byte 0x08614244 +_081AF378: .4byte 0x02020630 +_081AF37C: .4byte 0x086141fc + thumb_func_end sub_81AF2F0 + + thumb_func_start sub_81AF380 +sub_81AF380: @ 81AF380 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r6, r0, 0 + mov r9, r1 + ldr r0, _081AF3CC + str r0, [sp, 0x4] + ldr r5, _081AF3D0 + ldr r0, [sp, 0x8] + ands r0, r5 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldrh r1, [r6, 0xA] + lsls r1, 16 + ldr r4, _081AF3D4 + ands r0, r4 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + bl gpu_tile_obj_decompress_and_load + ldrh r2, [r6, 0xC] + cmp r2, r4 + bne _081AF3DC + ldr r0, _081AF3D8 + ldrb r1, [r6, 0xE] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + b _081AF3EE + .align 2, 0 +_081AF3CC: .4byte 0x086142c8 +_081AF3D0: .4byte 0xffff0000 +_081AF3D4: .4byte 0x0000ffff +_081AF3D8: .4byte 0x086142a8 +_081AF3DC: + ldr r0, _081AF48C + str r0, [sp, 0xC] + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_pal_obj_alloc_tag_and_apply +_081AF3EE: + ldr r0, _081AF490 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _081AF494 + adds r7, r0, r1 + movs r0, 0 + strb r0, [r7] + mov r0, r9 + str r0, [r7, 0x4] + ldrh r0, [r6, 0x6] + strh r0, [r7, 0x8] + ldrh r0, [r6, 0x8] + strh r0, [r7, 0xA] + ldrh r0, [r6, 0xA] + strh r0, [r7, 0xE] + ldrh r0, [r6, 0xC] + strh r0, [r7, 0x10] + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl sub_81AF2F0 + strb r0, [r7, 0xC] + ldrb r0, [r6, 0x3] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x5] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl sub_81AF2F0 + strb r0, [r7, 0xD] + ldrh r1, [r6, 0xC] + ldr r0, _081AF498 + cmp r1, r0 + bne _081AF47C + ldr r5, _081AF49C + ldrb r0, [r7, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r6, 0xE] + lsls r3, 4 + ldrb r4, [r1, 0x5] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r7, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r6, 0xE] + lsls r1, 4 + ldrb r3, [r0, 0x5] + ands r2, r3 + orrs r2, r1 + strb r2, [r0, 0x5] +_081AF47C: + mov r0, r8 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AF48C: .4byte 0x086142a8 +_081AF490: .4byte sub_81AF504 + 1 +_081AF494: .4byte 0x03005e08 +_081AF498: .4byte 0x0000ffff +_081AF49C: .4byte 0x02020630 + thumb_func_end sub_81AF380 + + thumb_func_start sub_81AF4A0 +sub_81AF4A0: @ 81AF4A0 + push {r4,lr} + adds r4, r1, 0 + subs r0, 0x2 + cmp r0, 0x1 + bhi _081AF4C4 + ldr r0, _081AF4C0 + movs r1, 0x2 + strb r1, [r0] + strb r4, [r0, 0x1] + strb r2, [r0, 0x2] + movs r1, 0x3 + strb r1, [r0, 0x3] + strb r4, [r0, 0x4] + strb r3, [r0, 0x5] + b _081AF4D6 + .align 2, 0 +_081AF4C0: .4byte 0x0203ce8c +_081AF4C4: + ldr r0, _081AF500 + movs r1, 0 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r4, [r0, 0x2] + movs r1, 0x1 + strb r1, [r0, 0x3] + strb r3, [r0, 0x4] + strb r4, [r0, 0x5] +_081AF4D6: + adds r2, r0, 0 + movs r1, 0 + movs r0, 0 + strh r0, [r2, 0x6] + ldr r0, [sp, 0x8] + strh r0, [r2, 0x8] + ldr r0, [sp, 0xC] + strh r0, [r2, 0xA] + ldr r0, [sp, 0x10] + strh r0, [r2, 0xC] + strb r1, [r2, 0xE] + adds r0, r2, 0 + ldr r1, [sp, 0x14] + bl sub_81AF380 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081AF500: .4byte 0x0203ce8c + thumb_func_end sub_81AF4A0 + + thumb_func_start sub_81AF504 +sub_81AF504: @ 81AF504 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AF53C + adds r4, r1, r0 + ldr r0, [r4, 0x4] + ldrh r5, [r0] + ldrh r0, [r4, 0x8] + cmp r5, r0 + bne _081AF548 + ldr r0, _081AF540 + cmp r5, r0 + beq _081AF548 + ldr r3, _081AF544 + ldrb r1, [r4, 0xC] + 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 + b _081AF55E + .align 2, 0 +_081AF53C: .4byte 0x03005e08 +_081AF540: .4byte 0x0000ffff +_081AF544: .4byte 0x02020630 +_081AF548: + ldr r3, _081AF57C + ldrb r1, [r4, 0xC] + 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 +_081AF55E: + strb r1, [r0] + ldrh r0, [r4, 0xA] + cmp r5, r0 + bne _081AF580 + ldrb r1, [r4, 0xD] + 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 + b _081AF594 + .align 2, 0 +_081AF57C: .4byte 0x02020630 +_081AF580: + ldrb r1, [r4, 0xD] + 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 +_081AF594: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AF504 + + thumb_func_start sub_81AF59C +sub_81AF59C: @ 81AF59C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081AF5E0 + adds r4, r1, r0 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF5E8 + ldr r3, _081AF5E4 + ldrb r1, [r4, 0xC] + 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] + ldrb r1, [r4, 0xD] + 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 + b _081AF612 + .align 2, 0 +_081AF5E0: .4byte 0x03005e08 +_081AF5E4: .4byte 0x02020630 +_081AF5E8: + ldr r3, _081AF61C + ldrb r1, [r4, 0xC] + 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] + ldrb r1, [r4, 0xD] + 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 +_081AF612: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081AF61C: .4byte 0x02020630 + thumb_func_end sub_81AF59C + + thumb_func_start sub_81AF620 +sub_81AF620: @ 81AF620 + 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, _081AF674 + adds r5, r0, r1 + ldrh r0, [r5, 0xE] + ldr r4, _081AF678 + cmp r0, r4 + beq _081AF63E + bl gpu_tile_obj_free_by_tag +_081AF63E: + ldrh r0, [r5, 0x10] + cmp r0, r4 + beq _081AF648 + bl gpu_pal_free_tag +_081AF648: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081AF67C + adds r0, r4 + bl obj_delete_and_free_tiles + ldrb r1, [r5, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + adds r0, r6, 0 + bl remove_task + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AF674: .4byte 0x03005e08 +_081AF678: .4byte 0x0000ffff +_081AF67C: .4byte 0x02020630 + thumb_func_end sub_81AF620 + + thumb_func_start sub_81AF680 +sub_81AF680: @ 81AF680 + push {lr} + cmp r1, 0 + beq _081AF68A + cmp r1, 0x1 + beq _081AF690 +_081AF68A: + bl sub_81AF828 + b _081AF694 +_081AF690: + bl sub_81AFA60 +_081AF694: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81AF680 + + thumb_func_start sub_81AF69C +sub_81AF69C: @ 81AF69C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r3, 0 + beq _081AF6B4 + cmp r3, 0x1 + beq _081AF6BA + b _081AF6BE +_081AF6B4: + bl sub_81AF994 + b _081AF6BE +_081AF6BA: + bl sub_81AFB68 +_081AF6BE: + pop {r0} + bx r0 + thumb_func_end sub_81AF69C + + thumb_func_start sub_81AF6C4 +sub_81AF6C4: @ 81AF6C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r1, 0 + beq _081AF6D4 + cmp r1, 0x1 + beq _081AF6DA + b _081AF6DE +_081AF6D4: + bl sub_81AF9D8 + b _081AF6DE +_081AF6DA: + bl sub_81AFBA0 +_081AF6DE: + pop {r0} + bx r0 + thumb_func_end sub_81AF6C4 + + thumb_func_start nullsub_126 +nullsub_126: @ 81AF6E4 + bx lr + thumb_func_end nullsub_126 + + thumb_func_start sub_81AF6E8 +sub_81AF6E8: @ 81AF6E8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + movs r3, 0x4 + cmp r0, 0x10 + bls _081AF708 + movs r2, 0x8 + subs r0, 0x8 + cmp r2, r0 + bge _081AF708 +_081AF700: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r0 + blt _081AF700 +_081AF708: + cmp r1, 0x10 + bls _081AF71C + movs r2, 0x8 + subs r1, 0x8 + cmp r2, r1 + bge _081AF71C +_081AF714: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r1 + blt _081AF714 +_081AF71C: + lsls r0, r3, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81AF6E8 + + thumb_func_start sub_81AF724 +sub_81AF724: @ 81AF724 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r3, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r0, _081AF808 + ldr r0, [r0] + str r0, [r3] + movs r1, 0x88 + strb r1, [r3] + strb r1, [r3, 0x1] + ldr r0, _081AF80C + ldr r0, [r0] + str r0, [r3, 0x4] + mov r2, r8 + adds r2, 0x80 + strb r2, [r3, 0x4] + strb r1, [r3, 0x5] + ldr r0, _081AF810 + ldr r0, [r0] + str r0, [r3, 0x8] + strb r1, [r3, 0x8] + mov r4, r9 + adds r4, 0x80 + strb r4, [r3, 0x9] + ldr r0, _081AF814 + ldr r0, [r0] + str r0, [r3, 0xC] + strb r2, [r3, 0xC] + strb r4, [r3, 0xD] + movs r0, 0x4 + mov r12, r0 + mov r2, r8 + cmp r2, 0x10 + bls _081AF7B8 + movs r2, 0x8 + mov r5, r8 + subs r5, 0x8 + cmp r2, r5 + bge _081AF7B8 + ldr r0, _081AF818 + ldr r0, [r0] + str r0, [sp] + ldr r0, _081AF81C + ldr r6, [r0] + adds r1, r3, 0 + adds r1, 0x10 + movs r7, 0x88 + mov r10, r7 +_081AF796: + ldr r0, [sp] + str r0, [r1] + adds r0, r2, 0 + subs r0, 0x78 + strb r0, [r1] + mov r7, r10 + strb r7, [r1, 0x1] + adds r1, 0x4 + str r6, [r1] + strb r0, [r1] + strb r4, [r1, 0x1] + adds r1, 0x4 + movs r0, 0x2 + add r12, r0 + adds r2, 0x8 + cmp r2, r5 + blt _081AF796 +_081AF7B8: + mov r2, r9 + cmp r2, 0x10 + bls _081AF7F6 + movs r1, 0x8 + mov r4, r9 + subs r4, 0x8 + cmp r1, r4 + bge _081AF7F6 + ldr r0, _081AF820 + ldr r6, [r0] + ldr r0, _081AF824 + ldr r5, [r0] + mov r7, r12 + lsls r0, r7, 2 + adds r2, r0, r3 + movs r7, 0x88 + mov r3, r8 + adds r3, 0x80 +_081AF7DC: + str r6, [r2] + strb r7, [r2] + adds r0, r1, 0 + subs r0, 0x78 + strb r0, [r2, 0x1] + adds r2, 0x4 + str r5, [r2] + strb r3, [r2] + strb r0, [r2, 0x1] + adds r2, 0x4 + adds r1, 0x8 + cmp r1, r4 + blt _081AF7DC +_081AF7F6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081AF808: .4byte 0x0861425c +_081AF80C: .4byte 0x08614260 +_081AF810: .4byte 0x08614274 +_081AF814: .4byte 0x08614278 +_081AF818: .4byte 0x08614264 +_081AF81C: .4byte 0x08614270 +_081AF820: .4byte 0x08614268 +_081AF824: .4byte 0x0861426c + thumb_func_end sub_81AF724 + + thumb_func_start sub_81AF828 +sub_81AF828: @ 81AF828 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + adds r6, r0, 0 + ldr r0, _081AF874 + str r0, [sp, 0x18] + ldr r5, _081AF878 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r5 + movs r2, 0x80 + lsls r2, 1 + orrs r1, r2 + ldrh r2, [r6, 0x6] + lsls r2, 16 + ldr r3, _081AF87C + ands r1, r3 + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_tile_obj_decompress_and_load + ldrh r2, [r6, 0x8] + ldr r7, _081AF87C + cmp r2, r7 + bne _081AF884 + ldr r0, _081AF880 + ldrb r1, [r6, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + b _081AF896 + .align 2, 0 +_081AF874: .4byte 0x08614338 +_081AF878: .4byte 0xffff0000 +_081AF87C: .4byte 0x0000ffff +_081AF880: .4byte 0x086142a8 +_081AF884: + ldr r0, _081AF97C + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_pal_obj_alloc_tag_and_apply +_081AF896: + ldr r0, _081AF980 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081AF984 + adds r5, r0, r1 + ldrh r0, [r6, 0x6] + movs r3, 0 + mov r8, r3 + strh r0, [r5, 0xE] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x10] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl sub_81AF6E8 + strb r0, [r5] + ldrb r0, [r5] + lsls r0, 2 + bl malloc + adds r2, r0, 0 + str r2, [r5, 0x8] + str r2, [r5, 0x4] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl sub_81AF724 + mov r1, sp + ldr r0, _081AF988 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r6, 0x6] + strh r0, [r1] + ldrh r0, [r6, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r6] + adds r1, 0x78 + ldrb r2, [r6, 0x1] + adds r2, 0x78 + mov r0, sp + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r5, 0xC] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r7, _081AF98C + adds r0, r7 + adds r1, r5, 0 + bl obj_set_f18_to_r0_f42_to_40 + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x43 + mov r1, r8 + strb r1, [r0] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x42 + ldrb r2, [r0] + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrh r1, [r6, 0x8] + ldr r0, _081AF990 + cmp r1, r0 + bne _081AF96E + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r6, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AF96E: + adds r0, r4, 0 + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AF97C: .4byte 0x086142a8 +_081AF980: .4byte nullsub_126 + 1 +_081AF984: .4byte 0x03005e08 +_081AF988: .4byte 0x082ec6ac +_081AF98C: .4byte 0x02020630 +_081AF990: .4byte 0x0000ffff + thumb_func_end sub_81AF828 + + thumb_func_start sub_81AF994 +sub_81AF994: @ 81AF994 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, _081AF9D0 + adds r3, r0 + ldr r5, _081AF9D4 + ldrb r4, [r3, 0xC] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + adds r1, 0x78 + strh r1, [r0, 0x20] + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r2, 0x78 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AF9D0: .4byte 0x03005e08 +_081AF9D4: .4byte 0x02020630 + thumb_func_end sub_81AF994 + + thumb_func_start sub_81AF9D8 +sub_81AF9D8: @ 81AF9D8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081AFA24 + adds r4, r0, r1 + ldr r0, [r4, 0x8] + bl free + ldrh r0, [r4, 0xE] + ldr r6, _081AFA28 + cmp r0, r6 + beq _081AF9FC + bl gpu_tile_obj_free_by_tag +_081AF9FC: + ldrh r0, [r4, 0x10] + cmp r0, r6 + beq _081AFA06 + bl gpu_pal_free_tag +_081AFA06: + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081AFA2C + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl remove_task + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AFA24: .4byte 0x03005e08 +_081AFA28: .4byte 0x0000ffff +_081AFA2C: .4byte 0x02020630 + thumb_func_end sub_81AF9D8 + + thumb_func_start sub_81AFA30 +sub_81AFA30: @ 81AFA30 + push {lr} + adds r2, r0, 0 + ldr r1, _081AFA58 + ldrh r3, [r2, 0x2E] + lsls r0, r3, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _081AFA48 + adds r0, 0x3F +_081AFA48: + asrs r0, 6 + strh r0, [r2, 0x24] + adds r0, r3, 0 + adds r0, 0x8 + strh r0, [r2, 0x2E] + pop {r0} + bx r0 + .align 2, 0 +_081AFA58: .4byte 0x08329f40 + thumb_func_end sub_81AFA30 + + thumb_func_start nullsub_127 +nullsub_127: @ 81AFA5C + bx lr + thumb_func_end nullsub_127 + + thumb_func_start sub_81AFA60 +sub_81AFA60: @ 81AFA60 + push {r4-r7,lr} + sub sp, 0x28 + adds r5, r0, 0 + ldr r0, _081AFAA4 + str r0, [sp, 0x18] + ldr r6, _081AFAA8 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r6 + movs r2, 0x80 + orrs r1, r2 + ldrh r2, [r5, 0x6] + lsls r2, 16 + ldr r4, _081AFAAC + ands r1, r4 + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_tile_obj_decompress_and_load + ldrh r2, [r5, 0x8] + cmp r2, r4 + bne _081AFAB4 + ldr r0, _081AFAB0 + ldrb r1, [r5, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + b _081AFAC6 + .align 2, 0 +_081AFAA4: .4byte 0x08614378 +_081AFAA8: .4byte 0xffff0000 +_081AFAAC: .4byte 0x0000ffff +_081AFAB0: .4byte 0x086142a8 +_081AFAB4: + ldr r0, _081AFB50 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r6 + orrs r1, r2 + str r1, [r0, 0x4] + bl gpu_pal_obj_alloc_tag_and_apply +_081AFAC6: + ldr r0, _081AFB54 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081AFB58 + adds r4, r0, r1 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x4] + mov r1, sp + ldr r0, _081AFB5C + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r5, 0x6] + strh r0, [r1] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + mov r0, sp + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4] + ldr r3, _081AFB60 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x8 + strh r2, [r0, 0x24] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x26] + ldrh r1, [r5, 0x8] + ldr r0, _081AFB64 + cmp r1, r0 + bne _081AFB46 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r5, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AFB46: + adds r0, r6, 0 + add sp, 0x28 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081AFB50: .4byte 0x086142a8 +_081AFB54: .4byte nullsub_127 + 1 +_081AFB58: .4byte 0x03005e08 +_081AFB5C: .4byte 0x08614290 +_081AFB60: .4byte 0x02020630 +_081AFB64: .4byte 0x0000ffff + thumb_func_end sub_81AFA60 + + thumb_func_start sub_81AFB68 +sub_81AFB68: @ 81AFB68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, _081AFB98 + adds r3, r0 + ldr r5, _081AFB9C + ldrb r4, [r3] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081AFB98: .4byte 0x03005e08 +_081AFB9C: .4byte 0x02020630 + thumb_func_end sub_81AFB68 + + thumb_func_start sub_81AFBA0 +sub_81AFBA0: @ 81AFBA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, _081AFBE4 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + ldr r6, _081AFBE8 + cmp r0, r6 + beq _081AFBBE + bl gpu_tile_obj_free_by_tag +_081AFBBE: + ldrh r0, [r4, 0x4] + cmp r0, r6 + beq _081AFBC8 + bl gpu_pal_free_tag +_081AFBC8: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081AFBEC + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r5, 0 + bl remove_task + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081AFBE4: .4byte 0x03005e08 +_081AFBE8: .4byte 0x0000ffff +_081AFBEC: .4byte 0x02020630 + thumb_func_end sub_81AFBA0 + + thumb_func_start sub_81AFBF0 +sub_81AFBF0: @ 81AFBF0 + push {lr} + ldr r1, _081AFC08 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x1C +_081AFBFA: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _081AFBFA + pop {r0} + bx r0 + .align 2, 0 +_081AFC08: .4byte 0x0203ce9c + thumb_func_end sub_81AFBF0 + + thumb_func_start sub_81AFC0C +sub_81AFC0C: @ 81AFC0C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _081AFC20 + ldr r1, _081AFC24 + lsls r0, 2 + adds r0, r1 + str r2, [r0] +_081AFC20: + pop {r0} + bx r0 + .align 2, 0 +_081AFC24: .4byte 0x0203ce9c + thumb_func_end sub_81AFC0C + + thumb_func_start sub_81AFC28 +sub_81AFC28: @ 81AFC28 + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _081AFC68 + ldr r5, _081AFC44 +_081AFC38: + cmp r1, 0xF7 + beq _081AFC48 + strb r1, [r2] + adds r4, 0x1 + adds r2, 0x1 + b _081AFC60 + .align 2, 0 +_081AFC44: .4byte 0x0203ce9c +_081AFC48: + adds r4, 0x1 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + cmp r1, 0 + beq _081AFC5E + adds r0, r2, 0 + bl gf_strcpy + adds r2, r0, 0 +_081AFC5E: + adds r4, 0x1 +_081AFC60: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _081AFC38 +_081AFC68: + movs r0, 0xFF + strb r0, [r2] + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81AFC28 + + thumb_func_start sub_81AFC74 +sub_81AFC74: @ 81AFC74 + lsls r0, 24 + ldr r1, _081AFC80 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_081AFC80: .4byte 0x0203ce9c + thumb_func_end sub_81AFC74 + + thumb_func_start sav1_are_mapnumbers_in_given_list +sav1_are_mapnumbers_in_given_list: @ 81AFC84 + push {r4,lr} + adds r2, r0, 0 + ldr r0, _081AFCB4 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r0, [r2] + ldr r1, _081AFCB8 + cmp r0, r1 + beq _081AFCC4 + adds r4, r1, 0 + adds r1, r2, 0 +_081AFCAA: + ldrh r0, [r1] + cmp r0, r3 + bne _081AFCBC + movs r0, 0x1 + b _081AFCC6 + .align 2, 0 +_081AFCB4: .4byte 0x03005d8c +_081AFCB8: .4byte 0x0000ffff +_081AFCBC: + adds r1, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _081AFCAA +_081AFCC4: + movs r0, 0 +_081AFCC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav1_are_mapnumbers_in_given_list + + thumb_func_start sav1_is_in_pokecenter +sav1_is_in_pokecenter: @ 81AFCCC + push {lr} + ldr r0, _081AFCD8 + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .align 2, 0 +_081AFCD8: .4byte 0x086143bc + thumb_func_end sav1_is_in_pokecenter + + thumb_func_start sub_81AFCDC +sub_81AFCDC: @ 81AFCDC + push {lr} + ldr r0, _081AFCE8 + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .align 2, 0 +_081AFCE8: .4byte 0x0861440a + thumb_func_end sub_81AFCDC + + thumb_func_start sub_81AFCEC +sub_81AFCEC: @ 81AFCEC + push {lr} + ldr r0, _081AFCF8 + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .align 2, 0 +_081AFCF8: .4byte 0x0861440e + thumb_func_end sub_81AFCEC + + thumb_func_start sav2_set_x9_bit3_when_sav1_in_pokecenter +sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC + push {lr} + bl sav1_is_in_pokecenter + cmp r0, 0 + bne _081AFD18 + ldr r0, _081AFD14 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFD + ands r0, r1 + b _081AFD22 + .align 2, 0 +_081AFD14: .4byte 0x03005d90 +_081AFD18: + ldr r0, _081AFD28 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + orrs r0, r1 +_081AFD22: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .align 2, 0 +_081AFD28: .4byte 0x03005d90 + thumb_func_end sav2_set_x9_bit3_when_sav1_in_pokecenter + + thumb_func_start sub_81AFD2C +sub_81AFD2C: @ 81AFD2C + push {lr} + bl sub_81AFCDC + cmp r0, 0 + bne _081AFD48 + ldr r0, _081AFD44 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFB + ands r0, r1 + b _081AFD52 + .align 2, 0 +_081AFD44: .4byte 0x03005d90 +_081AFD48: + ldr r0, _081AFD58 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x4 + orrs r0, r1 +_081AFD52: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .align 2, 0 +_081AFD58: .4byte 0x03005d90 + thumb_func_end sub_81AFD2C + + thumb_func_start sub_81AFD5C +sub_81AFD5C: @ 81AFD5C + push {lr} + bl sub_81AFCEC + cmp r0, 0 + bne _081AFD78 + ldr r0, _081AFD74 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xF7 + ands r0, r1 + b _081AFD82 + .align 2, 0 +_081AFD74: .4byte 0x03005d90 +_081AFD78: + ldr r0, _081AFD88 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x8 + orrs r0, r1 +_081AFD82: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .align 2, 0 +_081AFD88: .4byte 0x03005d90 + thumb_func_end sub_81AFD5C + + thumb_func_start sav2_set_x9_depending_on_sav1_map +sav2_set_x9_depending_on_sav1_map: @ 81AFD8C + push {lr} + bl sav2_set_x9_bit3_when_sav1_in_pokecenter + bl sub_81AFD2C + bl sub_81AFD5C + pop {r0} + bx r0 + thumb_func_end sav2_set_x9_depending_on_sav1_map + + thumb_func_start sub_81AFDA0 +sub_81AFDA0: @ 81AFDA0 + ldr r0, _081AFDCC + ldr r2, [r0] + adds r2, 0xA8 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + movs r1, 0x8 + orrs r0, r1 + str r0, [r2] + bx lr + .align 2, 0 +_081AFDCC: .4byte 0x03005d90 + thumb_func_end sub_81AFDA0 + + thumb_func_start sub_81AFDD0 +sub_81AFDD0: @ 81AFDD0 + ldr r0, _081AFDE0 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r2, 0x9] + bx lr + .align 2, 0 +_081AFDE0: .4byte 0x03005d90 + thumb_func_end sub_81AFDD0 + + thumb_func_start sub_81AFDE4 +sub_81AFDE4: @ 81AFDE4 + push {r4,r5,lr} + ldr r5, _081AFE0C + movs r0, 0x90 + lsls r0, 1 + bl malloc + str r0, [r5] + cmp r0, 0 + beq _081AFE1A + ldr r4, _081AFE10 + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + cmp r0, 0 + beq _081AFE14 + movs r0, 0x1 + b _081AFE1C + .align 2, 0 +_081AFE0C: .4byte 0x0203cebc +_081AFE10: .4byte 0x0203cec0 +_081AFE14: + ldr r0, [r5] + bl free +_081AFE1A: + movs r0, 0 +_081AFE1C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81AFDE4 + + thumb_func_start sub_81AFE24 +sub_81AFE24: @ 81AFE24 + push {lr} + ldr r0, _081AFE3C + ldr r0, [r0] + bl free + ldr r0, _081AFE40 + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_081AFE3C: .4byte 0x0203cebc +_081AFE40: .4byte 0x0203cec0 + thumb_func_end sub_81AFE24 + + thumb_func_start sub_81AFE44 +sub_81AFE44: @ 81AFE44 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 +_081AFE4C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 5 + adds r0, r6, r0 + lsls r1, r4, 7 + adds r1, r5, r1 + movs r2, 0x30 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AFE4C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AFE44 + + thumb_func_start AddItemIconObject +AddItemIconObject: @ 81AFE70 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl sub_81AFDE4 + lsls r0, 24 + cmp r0, 0 + beq _081AFF28 + adds r0, r5, 0 + movs r1, 0 + bl GetItemIconPic + ldr r4, _081AFF14 + ldr r1, [r4] + bl call_LZZUnCompWram + ldr r0, [r4] + ldr r4, _081AFF18 + ldr r1, [r4] + bl sub_81AFE44 + ldr r0, [r4] + str r0, [sp] + ldr r4, _081AFF1C + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, _081AFF20 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r5, 0 + movs r1, 0x1 + bl GetItemIconPic + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl gpu_pal_obj_decompress_and_apply + movs r0, 0x18 + bl malloc + adds r5, r0, 0 + ldr r0, _081AFF24 + adds r1, r5, 0 + movs r2, 0xC + bl CpuSet + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81AFE24 + adds r0, r5, 0 + bl free + adds r0, r4, 0 + b _081AFF2A + .align 2, 0 +_081AFF14: .4byte 0x0203cebc +_081AFF18: .4byte 0x0203cec0 +_081AFF1C: .4byte 0xffff0000 +_081AFF20: .4byte 0x0000ffff +_081AFF24: .4byte 0x08614ff4 +_081AFF28: + movs r0, 0x40 +_081AFF2A: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddItemIconObject + + thumb_func_start sub_81AFF34 +sub_81AFF34: @ 81AFF34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + bl sub_81AFDE4 + lsls r0, 24 + cmp r0, 0 + beq _081AFFEC + adds r0, r5, 0 + movs r1, 0 + bl GetItemIconPic + ldr r4, _081AFFDC + ldr r1, [r4] + bl call_LZZUnCompWram + ldr r0, [r4] + ldr r4, _081AFFE0 + ldr r1, [r4] + bl sub_81AFE44 + ldr r0, [r4] + str r0, [sp] + ldr r4, _081AFFE4 + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, _081AFFE8 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + adds r0, r5, 0 + movs r1, 0x1 + bl GetItemIconPic + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl gpu_pal_obj_decompress_and_apply + movs r0, 0x18 + bl malloc + adds r5, r0, 0 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0xC + bl CpuSet + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81AFE24 + adds r0, r5, 0 + bl free + adds r0, r4, 0 + b _081AFFEE + .align 2, 0 +_081AFFDC: .4byte 0x0203cebc +_081AFFE0: .4byte 0x0203cec0 +_081AFFE4: .4byte 0xffff0000 +_081AFFE8: .4byte 0x0000ffff +_081AFFEC: + movs r0, 0x40 +_081AFFEE: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AFF34 + + thumb_func_start GetItemIconPic +GetItemIconPic: @ 81AFFFC + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _081B0010 + cmp r3, r0 + bne _081B0018 + ldr r3, _081B0014 + b _081B0022 + .align 2, 0 +_081B0010: .4byte 0x0000ffff +_081B0014: .4byte 0x00000179 +_081B0018: + movs r0, 0xBC + lsls r0, 1 + cmp r3, r0 + bls _081B0022 + movs r3, 0 +_081B0022: + ldr r2, _081B0034 + lsls r0, r1, 2 + lsls r1, r3, 3 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081B0034: .4byte 0x08614410 + thumb_func_end GetItemIconPic + + thumb_func_start sub_81B0038 +sub_81B0038: @ 81B0038 + 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 r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r6, r4, 24 + bl reset_brm + ldr r0, _081B0084 + mov r10, r0 + movs r0, 0x8E + lsls r0, 2 + bl malloc + adds r5, r0, 0 + mov r1, r10 + str r5, [r1] + cmp r5, 0 + bne _081B0088 + ldr r0, [sp, 0x2C] + bl set_callback2 + b _081B0194 + .align 2, 0 +_081B0084: .4byte 0x0203cec4 +_081B0088: + ldr r3, _081B00EC + movs r1, 0xF + mov r4, r8 + ands r1, r4 + ldrb r2, [r3, 0x8] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + ldr r0, [sp, 0x2C] + str r0, [r3] + movs r4, 0 + strb r7, [r3, 0xB] + lsls r2, r6, 2 + ldrh r1, [r5, 0xA] + movs r0, 0x3 + ands r0, r1 + orrs r0, r2 + strh r0, [r5, 0xA] + ldr r0, [sp, 0x28] + str r0, [r5] + str r4, [r5, 0x4] + ldrb r1, [r5, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x8] + mov r1, r10 + ldr r2, [r1] + ldrh r0, [r2, 0x8] + movs r4, 0xFE + lsls r4, 3 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xFE + lsls r1, 10 + orrs r0, r1 + str r0, [r2, 0x8] + adds r6, r3, 0 + mov r5, r8 + cmp r5, 0x4 + bne _081B00F0 + ldrb r0, [r2, 0x8] + movs r1, 0x1 + orrs r0, r1 + b _081B00F8 + .align 2, 0 +_081B00EC: .4byte 0x0203cec8 +_081B00F0: + ldrb r1, [r2, 0x8] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 +_081B00F8: + strb r0, [r2, 0x8] + mov r0, r9 + cmp r0, 0xFF + beq _081B0114 + movs r0, 0x3 + mov r1, r9 + ands r0, r1 + lsls r0, 4 + ldrb r2, [r6, 0x8] + movs r1, 0x31 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x8] +_081B0114: + movs r2, 0 + ldr r5, _081B0158 + movs r4, 0x86 + lsls r4, 2 + movs r3, 0 +_081B011E: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081B011E + movs r2, 0 + ldr r4, _081B0158 + movs r3, 0xFF +_081B0138: + ldr r0, [r4] + adds r0, 0xC + adds r0, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x2 + bls _081B0138 + ldr r4, [sp] + cmp r4, 0 + bne _081B015C + strb r4, [r6, 0x9] + b _081B017E + .align 2, 0 +_081B0158: .4byte 0x0203cec4 +_081B015C: + adds r1, r6, 0 + movs r0, 0x9 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _081B017A + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B01A4 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + bne _081B017E +_081B017A: + movs r0, 0 + strb r0, [r6, 0x9] +_081B017E: + ldr r2, _081B01A8 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl calc_player_party_count + ldr r0, _081B01AC + bl set_callback2 +_081B0194: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B01A4: .4byte 0x020244ec +_081B01A8: .4byte 0x03003014 +_081B01AC: .4byte c2_811EBD0 + 1 + thumb_func_end sub_81B0038 + + thumb_func_start sub_81B01B0 +sub_81B01B0: @ 81B01B0 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81B01B0 + + thumb_func_start sub_81B01CC +sub_81B01CC: @ 81B01CC + push {lr} + bl copy_super_sprites_to_oam + bl copy_queue_process + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81B01CC + + thumb_func_start c2_811EBD0 +c2_811EBD0: @ 81B01E0 + push {lr} +_081B01E2: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81B020C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B01E2 +_081B0206: + pop {r0} + bx r0 + thumb_func_end c2_811EBD0 + + thumb_func_start sub_81B020C +sub_81B020C: @ 81B020C + push {r4,lr} + sub sp, 0x4 + ldr r1, _081B022C + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x16 + bls _081B0222 + b _081B0498 +_081B0222: + lsls r0, 2 + ldr r1, _081B0230 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B022C: .4byte 0x030022c0 +_081B0230: .4byte _081B0234 + .align 2, 0 +_081B0234: + .4byte _081B0290 + .4byte _081B02AC + .4byte _081B02B2 + .4byte _081B02D4 + .4byte _081B02DA + .4byte _081B02EC + .4byte _081B02FE + .4byte _081B0310 + .4byte _081B0338 + .4byte _081B0354 + .4byte _081B0368 + .4byte _081B038C + .4byte _081B03A0 + .4byte _081B03A6 + .4byte _081B03B8 + .4byte _081B03BE + .4byte _081B03E0 + .4byte _081B0400 + .4byte _081B0414 + .4byte _081B0428 + .4byte _081B0430 + .4byte _081B044C + .4byte _081B0474 +_081B0290: + bl vblank_hblank_handler_set_zero + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + ldr r1, _081B02A8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B02A8: .4byte 0x030022c0 +_081B02AC: + bl remove_some_task + b _081B0484 +_081B02B2: + bl sub_80A1A74 + ldr r2, _081B02CC + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, _081B02D0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B02CC: .4byte 0x02037fd4 +_081B02D0: .4byte 0x030022c0 +_081B02D4: + bl reset_all_obj_data + b _081B0484 +_081B02DA: + bl gpu_pal_allocator_reset + ldr r1, _081B02E8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B02E8: .4byte 0x030022c0 +_081B02EC: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + beq _081B02F8 + b _081B0484 +_081B02F8: + bl clear_tasks + b _081B0484 +_081B02FE: + bl sub_81B209C + ldr r1, _081B030C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B030C: .4byte 0x030022c0 +_081B0310: + bl sub_81B0550 + lsls r0, 24 + cmp r0, 0 + bne _081B0322 + bl sub_81B04BC + movs r0, 0x1 + b _081B04B2 +_081B0322: + ldr r0, _081B0334 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .align 2, 0 +_081B0334: .4byte 0x0203cec4 +_081B0338: + bl sub_81B05C8 + lsls r0, 24 + cmp r0, 0 + bne _081B0344 + b _081B04B0 +_081B0344: + ldr r1, _081B0350 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B0350: .4byte 0x030022c0 +_081B0354: + ldr r0, _081B0364 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B239C + b _081B0484 + .align 2, 0 +_081B0364: .4byte 0x0203cec8 +_081B0368: + ldr r0, _081B0384 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B0740 + ldr r0, _081B0388 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .align 2, 0 +_081B0384: .4byte 0x0203cec8 +_081B0388: .4byte 0x0203cec4 +_081B038C: + bl sub_81B5D30 + ldr r1, _081B039C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B039C: .4byte 0x030022c0 +_081B03A0: + bl sub_81B6040 + b _081B0484 +_081B03A6: + bl sub_81B6160 + ldr r1, _081B03B4 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B03B4: .4byte 0x030022c0 +_081B03B8: + bl sub_80D2F04 + b _081B0484 +_081B03BE: + bl sub_81B0EF4 + lsls r0, 24 + cmp r0, 0 + bne _081B03CA + b _081B04B0 +_081B03CA: + ldr r0, _081B03DC + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .align 2, 0 +_081B03DC: .4byte 0x0203cec4 +_081B03E0: + bl sub_81B0DA0 + lsls r0, 24 + cmp r0, 0 + beq _081B04B0 + ldr r0, _081B03FC + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .align 2, 0 +_081B03FC: .4byte 0x0203cec4 +_081B0400: + bl sub_81B0F28 + ldr r1, _081B0410 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B0410: .4byte 0x030022c0 +_081B0414: + ldr r0, _081B0424 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + lsrs r0, 31 + bl sub_81B2428 + b _081B0484 + .align 2, 0 +_081B0424: .4byte 0x0203cec4 +_081B0428: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081B048C +_081B0430: + ldr r4, _081B0448 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl AddTask + ldr r0, [r4] + ldrh r0, [r0, 0xA] + lsrs r0, 2 + bl sub_81B3054 + b _081B0484 + .align 2, 0 +_081B0448: .4byte 0x0203cec4 +_081B044C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r2, _081B046C + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r1, _081B0470 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .align 2, 0 +_081B046C: .4byte 0x02037fd4 +_081B0470: .4byte 0x030022c0 +_081B0474: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 +_081B0484: + ldr r1, _081B0494 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081B048C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081B04B0 + .align 2, 0 +_081B0494: .4byte 0x030022c0 +_081B0498: + ldr r0, _081B04A8 + bl SetVBlankCallback + ldr r0, _081B04AC + bl set_callback2 + movs r0, 0x1 + b _081B04B2 + .align 2, 0 +_081B04A8: .4byte sub_81B01CC + 1 +_081B04AC: .4byte sub_81B01B0 + 1 +_081B04B0: + movs r0, 0 +_081B04B2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B020C + + thumb_func_start sub_81B04BC +sub_81B04BC: @ 81B04BC + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + ldr r0, _081B04EC + movs r1, 0 + bl AddTask + ldr r0, _081B04F0 + bl SetVBlankCallback + ldr r0, _081B04F4 + bl set_callback2 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_081B04EC: .4byte sub_81B04F8 + 1 +_081B04F0: .4byte sub_81B01CC + 1 +_081B04F4: .4byte sub_81B01B0 + 1 + thumb_func_end sub_81B04BC + + thumb_func_start sub_81B04F8 +sub_81B04F8: @ 81B04F8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B0524 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B051C + ldr r0, _081B0528 + ldr r0, [r0] + bl set_callback2 + bl sub_81B06F4 + adds r0, r4, 0 + bl remove_task +_081B051C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B0524: .4byte 0x02037fd4 +_081B0528: .4byte 0x0203cec8 + thumb_func_end sub_81B04F8 + + thumb_func_start reset_brm +reset_brm: @ 81B052C + ldr r0, _081B0540 + movs r1, 0 + str r1, [r0] + ldr r0, _081B0544 + str r1, [r0] + ldr r0, _081B0548 + str r1, [r0] + ldr r0, _081B054C + str r1, [r0] + bx lr + .align 2, 0 +_081B0540: .4byte 0x0203cec4 +_081B0544: .4byte 0x0203cee4 +_081B0548: .4byte 0x0203cedc +_081B054C: .4byte 0x0203cee0 + thumb_func_end reset_brm + + thumb_func_start sub_81B0550 +sub_81B0550: @ 81B0550 + push {r4,r5,lr} + ldr r5, _081B05B8 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl malloc + str r0, [r5] + cmp r0, 0 + beq _081B05C0 + movs r1, 0 + adds r2, r4, 0 + bl memset + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081B05BC + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r1, [r5] + movs r0, 0x1 + bl bg_set_tilemap + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x1 + b _081B05C2 + .align 2, 0 +_081B05B8: .4byte 0x0203cee4 +_081B05BC: .4byte 0x086156b8 +_081B05C0: + movs r0, 0 +_081B05C2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0550 + + thumb_func_start sub_81B05C8 +sub_81B05C8: @ 81B05C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, _081B05E8 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + bhi _081B06B0 + lsls r0, 2 + ldr r1, _081B05EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B05E8: .4byte 0x0203cec4 +_081B05EC: .4byte _081B05F0 + .align 2, 0 +_081B05F0: + .4byte _081B0610 + .4byte _081B0638 + .4byte _081B0658 + .4byte _081B0684 + .4byte _081B0688 + .4byte _081B068C + .4byte _081B0690 + .4byte _081B0694 +_081B0610: + ldr r4, _081B0630 + ldr r0, _081B0634 + mov r1, sp + bl malloc_and_decompress + adds r1, r0, 0 + str r1, [r4] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + b _081B069A + .align 2, 0 +_081B0630: .4byte 0x0203cee0 +_081B0634: .4byte 0x08d967ec +_081B0638: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _081B06B4 + ldr r0, _081B0650 + ldr r1, _081B0654 + ldr r1, [r1] + bl call_LZZUnCompWram + b _081B069A + .align 2, 0 +_081B0650: .4byte 0x08d96ba0 +_081B0654: .4byte 0x0203cee4 +_081B0658: + ldr r0, _081B0678 + movs r2, 0xB0 + lsls r2, 1 + movs r1, 0 + bl decompress_palette + ldr r0, _081B067C + ldr r4, _081B0680 + ldr r1, [r4] + adds r1, 0x18 + movs r2, 0xB0 + bl CpuSet + ldr r1, [r4] + b _081B069E + .align 2, 0 +_081B0678: .4byte 0x08d96ab4 +_081B067C: .4byte 0x02037714 +_081B0680: .4byte 0x0203cec4 +_081B0684: + movs r0, 0x4 + b _081B0696 +_081B0688: + movs r0, 0x5 + b _081B0696 +_081B068C: + movs r0, 0x6 + b _081B0696 +_081B0690: + movs r0, 0x7 + b _081B0696 +_081B0694: + movs r0, 0x8 +_081B0696: + bl sub_81B06C0 +_081B069A: + ldr r0, _081B06AC + ldr r1, [r0] +_081B069E: + movs r0, 0x86 + lsls r0, 2 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081B06B4 + .align 2, 0 +_081B06AC: .4byte 0x0203cec4 +_081B06B0: + movs r0, 0x1 + b _081B06B6 +_081B06B4: + movs r0, 0 +_081B06B6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B05C8 + + thumb_func_start sub_81B06C0 +sub_81B06C0: @ 81B06C0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 28 + ldr r5, _081B06EC + lsrs r4, 23 + adds r1, r5, 0 + subs r1, 0x60 + adds r1, r4, r1 + adds r0, r5, 0 + movs r2, 0x10 + bl CpuSet + ldr r0, _081B06F0 + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl CpuSet + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B06EC: .4byte 0x02037774 +_081B06F0: .4byte 0x02037b14 + thumb_func_end sub_81B06C0 + + thumb_func_start sub_81B06F4 +sub_81B06F4: @ 81B06F4 + push {lr} + ldr r0, _081B0730 + ldr r0, [r0] + cmp r0, 0 + beq _081B0702 + bl free +_081B0702: + ldr r0, _081B0734 + ldr r0, [r0] + cmp r0, 0 + beq _081B070E + bl free +_081B070E: + ldr r0, _081B0738 + ldr r0, [r0] + cmp r0, 0 + beq _081B071A + bl free +_081B071A: + ldr r0, _081B073C + ldr r0, [r0] + cmp r0, 0 + beq _081B0726 + bl free +_081B0726: + bl Window_FreeMemory + pop {r0} + bx r0 + .align 2, 0 +_081B0730: .4byte 0x0203cec4 +_081B0734: .4byte 0x0203cee4 +_081B0738: .4byte 0x0203cee0 +_081B073C: .4byte 0x0203cedc + thumb_func_end sub_81B06F4 + + thumb_func_start sub_81B0740 +sub_81B0740: @ 81B0740 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _081B07C0 + movs r0, 0x60 + bl malloc + str r0, [r4] + movs r5, 0 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 4 + mov r8, r0 + movs r6, 0xFF + mov r9, r4 +_081B0764: + ldr r2, [r4] + lsls r3, r5, 4 + adds r2, r3, r2 + ldr r0, _081B07C4 + mov r12, r0 + str r0, [r2] + lsls r0, r5, 3 + ldr r1, _081B07C8 + adds r0, r1 + add r0, r8 + str r0, [r2, 0x4] + strb r5, [r2, 0x8] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0x9] + orrs r0, r6 + strb r0, [r1, 0x9] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xA] + orrs r0, r6 + strb r0, [r1, 0xA] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xB] + orrs r0, r6 + strb r0, [r1, 0xB] + ldr r0, [r4] + adds r3, r0 + ldrb r0, [r3, 0xC] + orrs r0, r6 + strb r0, [r3, 0xC] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B0764 + mov r1, r9 + ldr r0, [r1] + mov r1, r12 + subs r1, 0x20 + str r1, [r0] + cmp r7, 0x3 + bne _081B07CC + str r1, [r0, 0x30] + b _081B07D2 + .align 2, 0 +_081B07C0: .4byte 0x0203cedc +_081B07C4: .4byte 0x086156e4 +_081B07C8: .4byte 0x08615704 +_081B07CC: + cmp r7, 0 + beq _081B07D2 + str r1, [r0, 0x10] +_081B07D2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B0740 + + thumb_func_start sub_81B07E0 +sub_81B07E0: @ 81B07E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B081C + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B085C + cmp r5, 0x2 + bls _081B085C + adds r0, r5, 0 + bl sub_81B0CEC + ldr r0, _081B0820 + subs r1, r5, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081B0828 + ldr r0, _081B0824 + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x40 + bl sub_81B2748 + b _081B0836 + .align 2, 0 +_081B081C: .4byte 0x0203cec8 +_081B0820: .4byte 0x02022ff8 +_081B0824: .4byte 0x0203cedc +_081B0828: + ldr r0, _081B0858 + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x8 + bl sub_81B2748 +_081B0836: + adds r5, r4, 0 + ldr r4, _081B0858 + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl Window_WriteStandardTileMap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B093E + .align 2, 0 +_081B0858: .4byte 0x0203cedc +_081B085C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081B0894 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + bne _081B089C + ldr r4, _081B0898 + ldr r0, [r4] + lsls r5, 4 + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl sub_81B2720 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x40 + bl sub_81B2748 + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl Window_CopyToVram + b _081B092C + .align 2, 0 +_081B0894: .4byte 0x020244ec +_081B0898: .4byte 0x0203cedc +_081B089C: + ldr r0, _081B08B0 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x7 + bne _081B08B4 + adds r0, r5, 0 + bl sub_81B0B60 + b _081B08F6 + .align 2, 0 +_081B08B0: .4byte 0x0203cec8 +_081B08B4: + cmp r1, 0x2 + bne _081B08C0 + adds r0, r5, 0 + bl sub_81B0B08 + b _081B08F6 +_081B08C0: + cmp r1, 0x4 + bne _081B08CC + adds r0, r5, 0 + bl sub_81B0A9C + b _081B08F6 +_081B08CC: + cmp r1, 0xB + bne _081B08D8 + adds r0, r5, 0 + bl sub_81B0B98 + b _081B08F6 +_081B08D8: + cmp r1, 0xC + bne _081B08E4 + adds r0, r5, 0 + bl sub_81B0BC4 + b _081B08F6 +_081B08E4: + adds r0, r5, 0 + bl sub_81B0BFC + lsls r0, 24 + cmp r0, 0 + bne _081B08F6 + adds r0, r5, 0 + bl sub_81B0948 +_081B08F6: + ldr r2, _081B090C + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0910 + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC + b _081B092A + .align 2, 0 +_081B090C: .4byte 0x0203cec8 +_081B0910: + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r0, r5 + bne _081B0922 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0FCC + b _081B092A +_081B0922: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC +_081B092A: + lsls r5, 4 +_081B092C: + ldr r0, _081B0944 + ldr r0, [r0] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B093E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B0944: .4byte 0x0203cedc + thumb_func_end sub_81B07E0 + + thumb_func_start sub_81B0948 +sub_81B0948: @ 81B0948 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, _081B0998 + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_getattr + adds r2, r0, 0 + cmp r2, 0 + beq _081B09A0 + ldr r6, _081B099C + ldr r0, [r6] + lsls r5, r4, 4 + adds r0, r5, r0 + ldr r2, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r6] + adds r1, r5 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + b _081B0A02 + .align 2, 0 +_081B0998: .4byte 0x020244ec +_081B099C: .4byte 0x0203cedc +_081B09A0: + ldr r5, _081B0A0C + ldr r0, [r5] + lsls r4, 4 + adds r0, r4, r0 + ldr r1, [r0] + ldrb r0, [r0, 0x8] + str r2, [sp] + str r2, [sp, 0x4] + ldr r6, [r1] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r6 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2B8C + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2CD4 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2D74 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + bl sub_81B2E28 +_081B0A02: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B0A0C: .4byte 0x0203cedc + thumb_func_end sub_81B0948 + + thumb_func_start sub_81B0A10 +sub_81B0A10: @ 81B0A10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0x64 + adds r2, r0, 0 + muls r2, r1 + ldr r1, _081B0A94 + adds r6, r2, r1 + ldr r7, _081B0A98 + ldr r1, [r7] + lsls r5, r0, 4 + adds r1, r5, r1 + ldr r2, [r1] + ldrb r0, [r1, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2A70 + adds r0, r6, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081B0A7C + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2B8C +_081B0A7C: + ldr r1, [r7] + adds r1, r5 + mov r0, r8 + movs r2, 0 + bl sub_81B2FA8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B0A94: .4byte 0x020244ec +_081B0A98: .4byte 0x0203cedc + thumb_func_end sub_81B0A10 + + thumb_func_start sub_81B0A9C +sub_81B0A9C: @ 81B0A9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + muls r0, r5 + ldr r1, _081B0AC0 + adds r0, r1 + ldr r6, _081B0AC4 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B0AD6 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B02 + .align 2, 0 +_081B0AC0: .4byte 0x020244ec +_081B0AC4: .4byte 0x0203cef8 +_081B0AC8: + adds r1, r4, 0x2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B0A10 + b _081B0B02 +_081B0AD6: + movs r4, 0 + b _081B0AEE +_081B0ADA: + adds r1, r6, r4 + ldrb r0, [r1] + cmp r0, 0 + beq _081B0AE8 + subs r0, 0x1 + cmp r0, r5 + beq _081B0AC8 +_081B0AE8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B0AEE: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _081B0ADA + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0A10 +_081B0B02: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B0A9C + + thumb_func_start sub_81B0B08 +sub_81B0B08: @ 81B0B08 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B0B2C + adds r0, r1 + bl sub_80DAE0C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081B0B5A + lsls r0, 2 + ldr r1, _081B0B30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B0B2C: .4byte 0x020244ec +_081B0B30: .4byte _081B0B34 + .align 2, 0 +_081B0B34: + .4byte _081B0B48 + .4byte _081B0B52 + .4byte _081B0B52 + .4byte _081B0B48 + .4byte _081B0B48 +_081B0B48: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B5A +_081B0B52: + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 +_081B0B5A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B08 + + thumb_func_start sub_81B0B60 +sub_81B0B60: @ 81B0B60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B0B84 + adds r0, r1 + bl sub_806E25C + lsls r0, 24 + cmp r0, 0 + bne _081B0B88 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0B90 + .align 2, 0 +_081B0B84: .4byte 0x020244ec +_081B0B88: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0B90: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B60 + + thumb_func_start sub_81B0B98 +sub_81B0B98: @ 81B0B98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B0BB6 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 + b _081B0BBE +_081B0BB6: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 +_081B0BBE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B98 + + thumb_func_start sub_81B0BC4 +sub_81B0BC4: @ 81B0BC4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B0BE8 + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + beq _081B0BEC + adds r0, r4, 0 + movs r1, 0xB + bl sub_81B0A10 + b _081B0BF4 + .align 2, 0 +_081B0BE8: .4byte 0x020244ec +_081B0BEC: + adds r0, r4, 0 + movs r1, 0xC + bl sub_81B0A10 +_081B0BF4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0BC4 + + thumb_func_start sub_81B0BFC +sub_81B0BFC: @ 81B0BFC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081B0C2C + adds r6, r1, r0 + ldr r0, _081B0C30 + ldrh r4, [r0] + ldr r0, _081B0C34 + ldrb r0, [r0, 0xB] + cmp r0, 0xC + bne _081B0C40 + ldr r1, _081B0C38 + movs r0, 0 + strh r0, [r1] + ldr r0, _081B0C3C + ldrb r2, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0C94 + b _081B0C8A + .align 2, 0 +_081B0C2C: .4byte 0x020244ec +_081B0C30: .4byte 0x0203ce7c +_081B0C34: .4byte 0x0203cec8 +_081B0C38: .4byte 0x020375f0 +_081B0C3C: .4byte 0x020375e2 +_081B0C40: + cmp r0, 0x3 + bne _081B0C56 + adds r0, r4, 0 + bl sub_80FD21C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0C5A + cmp r0, 0x2 + beq _081B0C66 +_081B0C56: + movs r0, 0 + b _081B0C8C +_081B0C5A: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B0C94 + b _081B0C8A +_081B0C66: + adds r0, r6, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081B0C82 + adds r0, r6, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl sub_806D098 + lsls r0, 16 + cmp r0, 0 + bne _081B0C56 +_081B0C82: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0A10 +_081B0C8A: + movs r0, 0x1 +_081B0C8C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B0BFC + + thumb_func_start sub_81B0C94 +sub_81B0C94: @ 81B0C94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + muls r0, r4 + ldr r3, _081B0CC0 + adds r0, r3 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B0CD2 + cmp r0, 0x2 + bgt _081B0CC4 + cmp r0, 0x1 + beq _081B0CC8 + b _081B0CDC + .align 2, 0 +_081B0CC0: .4byte 0x020244ec +_081B0CC4: + cmp r0, 0x3 + bne _081B0CDC +_081B0CC8: + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0CE4 +_081B0CD2: + adds r0, r4, 0 + movs r1, 0xA + bl sub_81B0A10 + b _081B0CE4 +_081B0CDC: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0CE4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0C94 + + thumb_func_start sub_81B0CEC +sub_81B0CEC: @ 81B0CEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B0D1C + lsls r2, r0, 4 + ldr r1, [r1] + adds r6, r1, r2 + subs r0, 0x3 + lsls r0, 24 + ldr r5, _081B0D20 + lsrs r0, 19 + mov r8, r0 + adds r7, r0, r5 + ldrh r0, [r7] + cmp r0, 0 + bne _081B0D24 + ldrb r0, [r6, 0x8] + bl sub_81B2720 + b _081B0D8E + .align 2, 0 +_081B0D1C: .4byte 0x0203cedc +_081B0D20: .4byte 0x02022ff8 +_081B0D24: + ldr r2, [r6] + ldrb r0, [r6, 0x8] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r4, [r2] + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r4, _081B0D9C + adds r5, 0x4 + add r5, r8 + adds r0, r4, 0 + adds r1, r5, 0 + bl gf_strcpy + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + adds r0, r4, 0 + bl sub_81DB52C + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + ldrb r0, [r7, 0xF] + adds r1, r6, 0 + bl sub_81B2B40 + ldrb r0, [r7, 0x1C] + ldrh r1, [r7] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_81B2BF4 + ldrh r0, [r7, 0x10] + adds r1, r6, 0 + bl sub_81B2D3C + ldrh r0, [r7, 0x12] + adds r1, r6, 0 + bl sub_81B2DDC + ldrh r0, [r7, 0x10] + ldrh r1, [r7, 0x12] + adds r2, r6, 0 + bl sub_81B2E64 +_081B0D8E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B0D9C: .4byte 0x02021cc4 + thumb_func_end sub_81B0CEC + + thumb_func_start sub_81B0DA0 +sub_81B0DA0: @ 81B0DA0 + push {r4,r5,lr} + ldr r5, _081B0DC8 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sub_81B07E0 + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0DCC + movs r0, 0 + b _081B0DCE + .align 2, 0 +_081B0DC8: .4byte 0x0203cec4 +_081B0DCC: + movs r0, 0x1 +_081B0DCE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0DA0 + + thumb_func_start sub_81B0DD4 +sub_81B0DD4: @ 81B0DD4 + lsls r0, 16 + ldr r1, _081B0DE4 + lsrs r0, 11 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_081B0DE4: .4byte 0x0203cee0 + thumb_func_end sub_81B0DD4 + + thumb_func_start sub_81B0DE8 +sub_81B0DE8: @ 81B0DE8 + 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 + ldr r0, _081B0E5C + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0E98 + cmp r7, 0x2 + bls _081B0E98 + subs r0, r7, 0x3 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, _081B0E60 + mov r9, r0 + mov r2, r10 + lsls r2, 5 + mov r8, r2 + mov r6, r8 + add r6, r9 + ldrh r0, [r6] + cmp r0, 0 + beq _081B0EDC + mov r1, r9 + adds r1, 0x18 + add r1, r8 + ldr r1, [r1] + ldr r4, _081B0E64 + lsls r5, r7, 4 + ldr r2, [r4] + adds r2, r5 + movs r3, 0 + str r3, [sp] + bl sub_81B5A2C + ldrh r0, [r6] + ldrh r1, [r6, 0x2] + ldr r2, [r4] + adds r2, r5 + bl sub_81B5C48 + ldrh r0, [r6] + ldr r1, [r4] + adds r1, r5 + bl sub_81B5EF4 + ldrh r0, [r6, 0x10] + cmp r0, 0 + bne _081B0E68 + movs r3, 0x7 + b _081B0E78 + .align 2, 0 +_081B0E5C: .4byte 0x0203cec8 +_081B0E60: .4byte 0x02022ff8 +_081B0E64: .4byte 0x0203cedc +_081B0E68: + mov r0, r9 + adds r0, 0x14 + add r0, r8 + ldr r0, [r0] + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r3, r0, 24 +_081B0E78: + ldr r1, _081B0E90 + mov r2, r10 + lsls r0, r2, 5 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _081B0E94 + ldr r2, [r1] + adds r2, r5 + adds r1, r3, 0 + bl sub_81B6098 + b _081B0EDC + .align 2, 0 +_081B0E90: .4byte 0x02022ff8 +_081B0E94: .4byte 0x0203cedc +_081B0E98: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, _081B0EEC + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B0EDC + ldr r4, _081B0EF0 + lsls r5, r7, 4 + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + adds r2, r7, 0 + bl sub_81B59B4 + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl sub_81B5C14 + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl sub_81B5ECC + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl sub_81B6064 +_081B0EDC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B0EEC: .4byte 0x020244ec +_081B0EF0: .4byte 0x0203cedc + thumb_func_end sub_81B0DE8 + + thumb_func_start sub_81B0EF4 +sub_81B0EF4: @ 81B0EF4 + push {r4,r5,lr} + ldr r5, _081B0F1C + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sub_81B0DE8 + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0F20 + movs r0, 0 + b _081B0F22 + .align 2, 0 +_081B0F1C: .4byte 0x0203cec4 +_081B0F20: + movs r0, 0x1 +_081B0F22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0EF4 + + thumb_func_start sub_81B0F28 +sub_81B0F28: @ 81B0F28 + push {r4,lr} + sub sp, 0xC + ldr r0, _081B0F50 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0F54 + movs r0, 0x7 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r1, 0xE + movs r2, 0x17 + movs r3, 0x11 + bl Bg_FillWramTileMapRectWithTileAndPalette + b _081B0FBC + .align 2, 0 +_081B0F50: .4byte 0x0203cec8 +_081B0F54: + ldr r4, _081B0F8C + ldr r0, [r4] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B0F94 + movs r0, 0xBF + movs r1, 0x88 + bl sub_81B5F74 + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 4 + ldrh r2, [r3, 0x8] + ldr r1, _081B0F90 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + bl sub_81B120C + movs r0, 0xBF + movs r1, 0x98 + bl sub_81B5F74 + b _081B0F9C + .align 2, 0 +_081B0F8C: .4byte 0x0203cec4 +_081B0F90: .4byte 0xfffff80f +_081B0F94: + movs r0, 0xC6 + movs r1, 0x94 + bl sub_81B5F34 +_081B0F9C: + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 11 + ldr r1, [r3, 0x8] + ldr r2, _081B0FC4 + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] + ldr r0, _081B0FC8 + ldrb r0, [r0, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B0FBC: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B0FC4: .4byte 0xfffc07ff +_081B0FC8: .4byte 0x0203cec8 + thumb_func_end sub_81B0F28 + + thumb_func_start sub_81B0FCC +sub_81B0FCC: @ 81B0FCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + cmp r7, 0x6 + beq _081B1038 + cmp r7, 0x7 + beq _081B1074 + movs r0, 0x64 + muls r0, r7 + ldr r1, _081B1030 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B10E8 + ldr r6, _081B1034 + lsls r5, r7, 4 + ldr r4, [r6] + adds r4, r5 + adds r0, r7, 0 + mov r1, r8 + bl sub_81B10F8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B2748 + ldr r0, [r6] + adds r0, r5, r0 + ldrb r0, [r0, 0x9] + mov r1, r8 + bl sub_81B5B6C + ldr r0, [r6] + adds r5, r0 + ldrb r0, [r5, 0xB] + mov r1, r8 + bl sub_81B5F98 + b _081B10E8 + .align 2, 0 +_081B1030: .4byte 0x020244ec +_081B1034: .4byte 0x0203cedc +_081B1038: + mov r0, r8 + cmp r0, 0 + bne _081B1052 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 + b _081B1064 +_081B1052: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 +_081B1064: + ldr r0, _081B1070 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + lsls r0, 21 + b _081B10DA + .align 2, 0 +_081B1070: .4byte 0x0203cec4 +_081B1074: + ldr r0, _081B1094 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + bne _081B10A6 + mov r0, r8 + cmp r0, 0 + bne _081B1098 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 + .align 2, 0 +_081B1094: .4byte 0x0203cec4 +_081B1098: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 +_081B10A6: + mov r0, r8 + cmp r0, 0 + bne _081B10C0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x12 +_081B10B8: + movs r3, 0x7 + bl sub_8199C30 + b _081B10D2 +_081B10C0: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x12 + movs r3, 0x7 + bl sub_8199C30 +_081B10D2: + ldr r0, _081B10F4 + ldr r0, [r0] + ldr r0, [r0, 0x8] + lsls r0, 14 +_081B10DA: + lsrs r0, 25 + mov r1, r8 + bl sub_81B5F98 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081B10E8: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B10F4: .4byte 0x0203cec4 + thumb_func_end sub_81B0FCC + + thumb_func_start sub_81B10F8 +sub_81B10F8: @ 81B10F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r4, 0 + cmp r1, 0x1 + bne _081B110A + movs r4, 0x1 +_081B110A: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081B1184 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B1120 + movs r0, 0x2 + orrs r4, r0 +_081B1120: + adds r0, r5, 0 + bl sub_81B118C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1136 + movs r0, 0x8 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1136: + ldr r0, _081B1188 + ldrb r1, [r0, 0xB] + adds r2, r0, 0 + cmp r1, 0x9 + bne _081B1148 + movs r0, 0x10 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1148: + cmp r1, 0x8 + bne _081B1164 + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + beq _081B115C + movs r0, 0xA + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B1164 +_081B115C: + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1164: + ldrb r0, [r2, 0xB] + cmp r0, 0xA + bne _081B117A + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B117A + movs r0, 0x20 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B117A: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081B1184: .4byte 0x020244ec +_081B1188: .4byte 0x0203cec8 + thumb_func_end sub_81B10F8 + + thumb_func_start sub_81B118C +sub_81B118C: @ 81B118C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081B11B0 + ldrb r1, [r0, 0x8] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x20 + bne _081B11B4 + cmp r2, 0x1 + beq _081B11AA + cmp r2, 0x4 + beq _081B11AA + cmp r2, 0x5 + bne _081B11B4 +_081B11AA: + movs r0, 0x1 + b _081B11F8 + .align 2, 0 +_081B11B0: .4byte 0x0203cec8 +_081B11B4: + cmp r2, 0x2 + bhi _081B11F6 + ldr r0, _081B11FC + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + ldr r0, _081B1200 + ldr r1, _081B1204 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + adds r0, r2, 0 + bl sub_81B8F38 + ldr r1, _081B1208 + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 24 + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B11F8 +_081B11F6: + movs r0, 0 +_081B11F8: + pop {r1} + bx r1 + .align 2, 0 +_081B11FC: .4byte 0x02022fec +_081B1200: .4byte 0x030022c0 +_081B1204: .4byte 0x00000439 +_081B1208: .4byte 0x0202449c + thumb_func_end sub_81B118C + + thumb_func_start sub_81B120C +sub_81B120C: @ 81B120C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, _081B1248 + movs r6, 0x7 + str r6, [sp] + movs r5, 0x2 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x10 + bl bg_copy_tilemap_rect_simple + ldr r1, _081B124C + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x12 + bl bg_copy_tilemap_rect_simple + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B1248: .4byte 0x086157c4 +_081B124C: .4byte 0x086157e0 + thumb_func_end sub_81B120C + + thumb_func_start sub_81B1250 +sub_81B1250: @ 81B1250 + push {lr} + ldr r0, _081B1274 + ldr r0, [r0] + movs r1, 0x49 + ands r0, r1 + cmp r0, 0x49 + bne _081B1280 + ldr r0, _081B1278 + ldr r1, _081B127C + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B1280 + movs r0, 0x1 + b _081B1282 + .align 2, 0 +_081B1274: .4byte 0x02022fec +_081B1278: .4byte 0x030022c0 +_081B127C: .4byte 0x00000439 +_081B1280: + movs r0, 0 +_081B1282: + pop {r1} + bx r1 + thumb_func_end sub_81B1250 + + thumb_func_start sub_81B1288 +sub_81B1288: @ 81B1288 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + movs r0, 0x64 + bl malloc + adds r5, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + bl free + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B1288 + + thumb_func_start sub_81B12C0 +sub_81B12C0: @ 81B12C0 + 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 sub_80A1AD4 + ldr r1, _081B12F0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B12F4 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B12F0: .4byte 0x03005e00 +_081B12F4: .4byte c3_0811FAB4 + 1 + thumb_func_end sub_81B12C0 + + thumb_func_start c3_0811FAB4 +c3_0811FAB4: @ 81B12F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B132C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B134C + ldr r4, _081B1330 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B131A + bl sub_81B9080 +_081B131A: + ldr r0, _081B1334 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _081B1338 + bl set_callback2 + b _081B133E + .align 2, 0 +_081B132C: .4byte 0x02037fd4 +_081B1330: .4byte 0x0203cec8 +_081B1334: .4byte 0x0203cec4 +_081B1338: + ldr r0, [r4] + bl set_callback2 +_081B133E: + bl reset_all_obj_data + bl sub_81B06F4 + adds r0, r5, 0 + bl remove_task +_081B134C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end c3_0811FAB4 + + thumb_func_start brm_get_pokemon_selection +brm_get_pokemon_selection: @ 81B1354 + ldr r0, _081B135C + ldrb r0, [r0, 0x9] + bx lr + .align 2, 0 +_081B135C: .4byte 0x0203cec8 + thumb_func_end brm_get_pokemon_selection + + thumb_func_start sub_81B1360 +sub_81B1360: @ 81B1360 + ldr r0, _081B136C + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 28 + bx lr + .align 2, 0 +_081B136C: .4byte 0x0203cec8 + thumb_func_end sub_81B1360 + + thumb_func_start sub_81B1370 +sub_81B1370: @ 81B1370 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, _081B13AC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B13E0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B13E0 + bl sub_81B13EC + adds r4, r0, 0 + bl sub_81B1760 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _081B13C0 + cmp r0, 0x2 + bgt _081B13B0 + cmp r0, 0x1 + beq _081B13B6 + b _081B13E0 + .align 2, 0 +_081B13AC: .4byte 0x02037fd4 +_081B13B0: + cmp r0, 0x8 + beq _081B13CA + b _081B13E0 +_081B13B6: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B140C + b _081B13E0 +_081B13C0: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B15D0 + b _081B13E0 +_081B13CA: + ldr r0, _081B13E8 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B13E0 + movs r0, 0x5 + bl audio_play + bl sub_81B4F88 +_081B13E0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B13E8: .4byte 0x0203cec4 + thumb_func_end sub_81B1370 + + thumb_func_start sub_81B13EC +sub_81B13EC: @ 81B13EC + push {lr} + ldr r0, _081B1400 + ldrb r1, [r0, 0xB] + cmp r1, 0x8 + beq _081B13FA + cmp r1, 0xA + bne _081B1404 +_081B13FA: + adds r0, 0xA + b _081B1406 + .align 2, 0 +_081B1400: .4byte 0x0203cec8 +_081B1404: + adds r0, 0x9 +_081B1406: + pop {r1} + bx r1 + thumb_func_end sub_81B13EC + + thumb_func_start sub_81B140C +sub_81B140C: @ 81B140C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B142C + ldr r0, _081B1428 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 + b _081B159E + .align 2, 0 +_081B1428: .4byte 0x0203cec8 +_081B142C: + ldr r0, _081B1444 + ldrb r0, [r0, 0xB] + subs r0, 0x3 + cmp r0, 0xA + bls _081B1438 + b _081B1592 +_081B1438: + lsls r0, 2 + ldr r1, _081B1448 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B1444: .4byte 0x0203cec8 +_081B1448: .4byte _081B144C + .align 2, 0 +_081B144C: + .4byte _081B149C + .4byte _081B1592 + .4byte _081B1538 + .4byte _081B1538 + .4byte _081B1510 + .4byte _081B1560 + .4byte _081B1592 + .4byte _081B1478 + .4byte _081B156E + .4byte _081B14E8 + .4byte _081B157C +_081B1478: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B1486 + b _081B159E +_081B1486: + ldr r0, _081B1498 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81615A8 + b _081B159E + .align 2, 0 +_081B1498: .4byte 0x0203cec4 +_081B149C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B14AA + b _081B159E +_081B14AA: + ldr r0, _081B14D4 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + ldr r2, _081B14D8 + cmp r0, 0x1 + bne _081B14BE + ldr r1, [r2] + ldr r0, _081B14DC + str r0, [r1, 0x4] +_081B14BE: + ldr r0, [r2] + adds r0, 0xD + bl sub_81B302C + ldr r0, _081B14E0 + ldr r1, _081B14E4 + ldr r2, [r0] + adds r0, r5, 0 + bl _call_via_r2 + b _081B159E + .align 2, 0 +_081B14D4: .4byte 0x0203cec8 +_081B14D8: .4byte 0x0203cec4 +_081B14DC: .4byte sub_81B9140 + 1 +_081B14E0: .4byte 0x03006328 +_081B14E4: .4byte sub_81B6794 + 1 +_081B14E8: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl audio_play + ldr r0, _081B150C + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7E4C + b _081B159E + .align 2, 0 +_081B150C: .4byte 0x0203cec4 +_081B1510: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl audio_play + ldr r0, _081B1534 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B8474 + b _081B159E + .align 2, 0 +_081B1534: .4byte 0x0203cec4 +_081B1538: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl audio_play + ldr r0, _081B155C + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7FAC + b _081B159E + .align 2, 0 +_081B155C: .4byte 0x0203cec4 +_081B1560: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81B3938 + b _081B159E +_081B156E: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81B12C0 + b _081B159E +_081B157C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_81B21AC + b _081B159E +_081B1592: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81B36FC +_081B159E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B140C + + thumb_func_start sub_81B15A4 +sub_81B15A4: @ 81B15A4 + push {lr} + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B15C0 + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _081B15C4 + movs r0, 0x1 + b _081B15CC + .align 2, 0 +_081B15C0: .4byte 0x020244ec +_081B15C4: + movs r0, 0x20 + bl audio_play + movs r0, 0 +_081B15CC: + pop {r1} + bx r1 + thumb_func_end sub_81B15A4 + + thumb_func_start sub_81B15D0 +sub_81B15D0: @ 81B15D0 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B15EC + ldrb r0, [r0, 0xB] + cmp r0, 0x8 + beq _081B1602 + cmp r0, 0x8 + bgt _081B15F0 + cmp r0, 0x1 + beq _081B15FA + b _081B161E + .align 2, 0 +_081B15EC: .4byte 0x0203cec8 +_081B15F0: + cmp r0, 0xA + beq _081B1602 + cmp r0, 0xD + beq _081B1610 + b _081B161E +_081B15FA: + movs r0, 0x20 + bl audio_play + b _081B1652 +_081B1602: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B407C + b _081B1652 +_081B1610: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B2210 + b _081B1652 +_081B161E: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B1660 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1652 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081B1642 + ldr r1, _081B1658 + movs r0, 0x7 + strh r0, [r1] +_081B1642: + ldr r0, _081B165C + movs r1, 0 + strb r1, [r0] + movs r0, 0x7 + strb r0, [r5] + adds r0, r4, 0 + bl sub_81B12C0 +_081B1652: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1658: .4byte 0x020375e0 +_081B165C: .4byte 0x0203cee8 + thumb_func_end sub_81B15D0 + + thumb_func_start sub_81B1660 +sub_81B1660: @ 81B1660 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, _081B1678 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x2 + bne _081B1680 + ldr r5, _081B167C + b _081B168A + .align 2, 0 +_081B1678: .4byte 0x0203cec8 +_081B167C: .4byte 0x085ea110 +_081B1680: + cmp r1, 0x4 + bne _081B168A + bl sub_81B88BC + adds r5, r0, 0 +_081B168A: + cmp r5, 0 + beq _081B16CC + ldr r0, _081B16BC + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, _081B16C0 + adds r0, r4, 0 + adds r1, r5, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B16C4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B16C8 + str r1, [r0] + movs r0, 0x1 + b _081B16CE + .align 2, 0 +_081B16BC: .4byte 0x0203cec4 +_081B16C0: .4byte 0x02021fc4 +_081B16C4: .4byte 0x03005e00 +_081B16C8: .4byte sub_81B16D4 + 1 +_081B16CC: + movs r0, 0 +_081B16CE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1660 + + thumb_func_start sub_81B16D4 +sub_81B16D4: @ 81B16D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B16F8 + bl sub_81B334C + ldr r0, _081B1700 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B1704 + str r0, [r1] +_081B16F8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B1700: .4byte 0x03005e00 +_081B1704: .4byte sub_81B1708 + 1 + thumb_func_end sub_81B16D4 + + thumb_func_start sub_81B1708 +sub_81B1708: @ 81B1708 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B172E + cmp r1, 0 + bgt _081B1728 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B174C + b _081B1758 +_081B1728: + cmp r1, 0x1 + beq _081B1752 + b _081B1758 +_081B172E: + ldr r0, _081B1744 + strb r1, [r0] + ldr r1, _081B1748 + movs r0, 0x7 + strb r0, [r1, 0x9] + bl sub_81B8558 + adds r0, r4, 0 + bl sub_81B12C0 + b _081B1758 + .align 2, 0 +_081B1744: .4byte 0x0203cee8 +_081B1748: .4byte 0x0203cec8 +_081B174C: + movs r0, 0x5 + bl audio_play +_081B1752: + adds r0, r4, 0 + bl sub_81B1C1C +_081B1758: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B1708 + + thumb_func_start sub_81B1760 +sub_81B1760: @ 81B1760 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081B1778 + ldrh r1, [r0, 0x30] + adds r3, r0, 0 + cmp r1, 0x20 + beq _081B178E + cmp r1, 0x20 + bgt _081B177C + cmp r1, 0x10 + beq _081B1792 + b _081B1796 + .align 2, 0 +_081B1778: .4byte 0x030022c0 +_081B177C: + cmp r1, 0x40 + beq _081B1786 + cmp r1, 0x80 + beq _081B178A + b _081B1796 +_081B1786: + movs r1, 0xFF + b _081B17B2 +_081B178A: + movs r1, 0x1 + b _081B17B2 +_081B178E: + movs r1, 0xFE + b _081B17B2 +_081B1792: + movs r1, 0x2 + b _081B17B2 +_081B1796: + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B17AA + cmp r0, 0x2 + beq _081B17AE + movs r1, 0 + b _081B17B0 +_081B17AA: + movs r1, 0xFF + b _081B17B0 +_081B17AE: + movs r1, 0x1 +_081B17B0: + ldr r3, _081B17C0 +_081B17B2: + ldrh r2, [r3, 0x2E] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _081B17C4 + movs r0, 0x8 + b _081B17F0 + .align 2, 0 +_081B17C0: .4byte 0x030022c0 +_081B17C4: + lsls r0, r1, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B17D6 + adds r0, r4, 0 + bl sub_81B17F8 + movs r0, 0 + b _081B17F0 +_081B17D6: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081B17EA + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + bne _081B17EA + movs r0, 0x2 + b _081B17F0 +_081B17EA: + ldrh r1, [r3, 0x2E] + movs r0, 0x3 + ands r0, r1 +_081B17F0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1760 + + thumb_func_start sub_81B17F8 +sub_81B17F8: @ 81B17F8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrb r4, [r5] + ldr r0, _081B181C + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + cmp r0, 0 + bne _081B1820 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B1854 + b _081B182A + .align 2, 0 +_081B181C: .4byte 0x0203cec8 +_081B1820: + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B195C +_081B182A: + movs r1, 0 + ldrsb r1, [r5, r1] + lsls r4, 24 + asrs r0, r4, 24 + cmp r1, r0 + beq _081B184C + movs r0, 0x5 + bl audio_play + lsrs r0, r4, 24 + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r5] + movs r1, 0x1 + bl sub_81B0FCC +_081B184C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B17F8 + + thumb_func_start sub_81B1854 +sub_81B1854: @ 81B1854 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B187A + cmp r1, r0 + bgt _081B1870 + subs r0, 0x1 + cmp r1, r0 + beq _081B1924 + b _081B1952 +_081B1870: + cmp r1, 0x1 + beq _081B18C0 + cmp r1, 0x2 + beq _081B18F8 + b _081B1952 +_081B187A: + ldrb r0, [r4] + movs r1, 0 + ldrsb r1, [r4, r1] + cmp r1, 0 + bne _081B1888 + movs r0, 0x7 + b _081B1950 +_081B1888: + cmp r1, 0x6 + bne _081B1898 + ldr r0, _081B1894 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .align 2, 0 +_081B1894: .4byte 0x020244e9 +_081B1898: + cmp r1, 0x7 + bne _081B18BC + ldr r0, _081B18AC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18B0 + movs r0, 0x6 + b _081B1950 + .align 2, 0 +_081B18AC: .4byte 0x0203cec4 +_081B18B0: + ldr r0, _081B18B8 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .align 2, 0 +_081B18B8: .4byte 0x020244e9 +_081B18BC: + subs r0, 0x1 + b _081B1950 +_081B18C0: + ldrb r2, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + beq _081B194E + movs r1, 0 + ldrsb r1, [r4, r1] + ldr r0, _081B18E8 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081B18F4 + ldr r0, _081B18EC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18F0 + movs r0, 0x6 + b _081B1950 + .align 2, 0 +_081B18E8: .4byte 0x020244e9 +_081B18EC: .4byte 0x0203cec4 +_081B18F0: + movs r0, 0x7 + b _081B1950 +_081B18F4: + adds r0, r2, 0x1 + b _081B1950 +_081B18F8: + ldr r0, _081B191C + ldrb r0, [r0] + cmp r0, 0x1 + beq _081B1952 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1952 + ldr r0, _081B1920 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _081B1950 + movs r0, 0x1 + b _081B1950 + .align 2, 0 +_081B191C: .4byte 0x020244e9 +_081B1920: .4byte 0x0203cec4 +_081B1924: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + beq _081B1952 + cmp r0, 0x6 + beq _081B1952 + cmp r0, 0x7 + beq _081B1952 + ldr r0, _081B1958 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] +_081B194E: + movs r0, 0 +_081B1950: + strb r0, [r4] +_081B1952: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B1958: .4byte 0x0203cec4 + thumb_func_end sub_81B1854 + + thumb_func_start sub_81B195C +sub_81B195C: @ 81B195C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + asrs r5, r1, 24 + movs r6, 0x1 + negs r6, r6 + cmp r5, r6 + beq _081B1988 + cmp r5, r6 + bgt _081B197E + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + bne _081B197C + b _081B1A9C +_081B197C: + b _081B1AF4 +_081B197E: + cmp r5, 0x1 + beq _081B19E4 + cmp r5, 0x2 + beq _081B1A24 + b _081B1AF4 +_081B1988: + ldrb r1, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1996 + movs r0, 0x7 + b _081B1AF2 +_081B1996: + cmp r0, 0x6 + bne _081B19A8 + ldr r0, _081B19A4 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1AF2 + .align 2, 0 +_081B19A4: .4byte 0x020244e9 +_081B19A8: + cmp r0, 0x7 + bne _081B19C4 + ldr r0, _081B19BC + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B19C0 + movs r0, 0x6 + b _081B1AF2 + .align 2, 0 +_081B19BC: .4byte 0x0203cec4 +_081B19C0: + subs r0, r1, 0x1 + strb r0, [r4] +_081B19C4: + movs r0, 0 + ldrsb r0, [r4, r0] + lsls r1, r2, 24 + asrs r1, 24 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _081B19E0 + b _081B1AF4 +_081B19E0: + strb r2, [r4] + b _081B1AF4 +_081B19E4: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B19F0 + movs r0, 0x7 + b _081B1AF2 +_081B19F0: + cmp r0, 0x7 + bne _081B19F8 + movs r0, 0 + b _081B1AF2 +_081B19F8: + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r6 + bne _081B19E0 + ldr r0, _081B1A1C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B1A20 + movs r0, 0x6 + b _081B1AF2 + .align 2, 0 +_081B1A1C: .4byte 0x0203cec4 +_081B1A20: + movs r0, 0x7 + b _081B1AF2 +_081B1A24: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1A5C + ldr r0, _081B1A4C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r6, r0, 29 + cmp r6, 0x3 + bne _081B1A54 + ldr r0, _081B1A50 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B1AF4 + strb r6, [r4] + b _081B1AF4 + .align 2, 0 +_081B1A4C: .4byte 0x0203cec4 +_081B1A50: .4byte 0x02024618 +_081B1A54: + ldr r0, _081B1A58 + b _081B1A70 + .align 2, 0 +_081B1A58: .4byte 0x020245b4 +_081B1A5C: + cmp r0, 0x1 + bne _081B1AF4 + ldr r0, _081B1A80 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r5, r0, 29 + cmp r5, 0x5 + bne _081B1A88 + ldr r0, _081B1A84 +_081B1A70: + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B1AF4 + strb r5, [r4] + b _081B1AF4 + .align 2, 0 +_081B1A80: .4byte 0x0203cec4 +_081B1A84: .4byte 0x020246e0 +_081B1A88: + ldr r0, _081B1A98 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B1AF4 + movs r0, 0x4 + b _081B1AF2 + .align 2, 0 +_081B1A98: .4byte 0x0202467c +_081B1A9C: + ldrb r1, [r4] + subs r0, r1, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1ACC + ldr r0, _081B1AC8 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0 + b _081B1AF2 + .align 2, 0 +_081B1AC8: .4byte 0x0203cec4 +_081B1ACC: + subs r0, r1, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1AF4 + ldr r0, _081B1AFC + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0x1 +_081B1AF2: + strb r0, [r4] +_081B1AF4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B1AFC: .4byte 0x0203cec4 + thumb_func_end sub_81B195C + + thumb_func_start sub_81B1B00 +sub_81B1B00: @ 81B1B00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + asrs r6, r1, 24 +_081B1B0A: + lsls r0, r5, 24 + asrs r0, 24 + adds r0, r6 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 24 + lsrs r0, r1, 24 + cmp r0, 0x5 + bhi _081B1B38 + asrs r4, r1, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B1B34 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B1B0A + adds r0, r4, 0 + b _081B1B3C + .align 2, 0 +_081B1B34: .4byte 0x020244ec +_081B1B38: + movs r0, 0x1 + negs r0, r0 +_081B1B3C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1B00 + + thumb_func_start sub_81B1B44 +sub_81B1B44: @ 81B1B44 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1B44 + + thumb_func_start sub_81B1B5C +sub_81B1B5C: @ 81B1B5C + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_81B3300 + ldr r0, _081B1B84 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081B1B88 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081B1B84: .4byte sub_81B1B8C + 1 +_081B1B88: .4byte 0x03005e00 + thumb_func_end sub_81B1B5C + + thumb_func_start sub_81B1B8C +sub_81B1B8C: @ 81B1B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0x6 + bl sub_8121F20 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _081B1BC8 + ldr r0, _081B1BD0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081B1BC2 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl Window_FillTileMap +_081B1BC2: + adds r0, r5, 0 + bl remove_task +_081B1BC8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1BD0: .4byte 0x03005e00 + thumb_func_end sub_81B1B8C + + thumb_func_start sub_81B1BD4 +sub_81B1BD4: @ 81B1BD4 + push {lr} + ldr r0, _081B1BE4 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081B1BE4: .4byte sub_81B1B8C + 1 + thumb_func_end sub_81B1BD4 + + thumb_func_start sub_81B1BE8 +sub_81B1BE8: @ 81B1BE8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C0E + movs r0, 0 + bl sub_81B3054 + ldr r0, _081B1C14 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B1C18 + str r0, [r1] +_081B1C0E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B1C14: .4byte 0x03005e00 +_081B1C18: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B1BE8 + + thumb_func_start sub_81B1C1C +sub_81B1C1C: @ 81B1C1C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C74 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl Window_FillTileMap + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1C60 + ldr r0, _081B1C58 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B1C5C + b _081B1C72 + .align 2, 0 +_081B1C58: .4byte 0x03005e00 +_081B1C5C: .4byte sub_81B1BE8 + 1 +_081B1C60: + movs r0, 0 + bl sub_81B3054 + ldr r0, _081B1C7C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B1C80 +_081B1C72: + str r0, [r1] +_081B1C74: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1C7C: .4byte 0x03005e00 +_081B1C80: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B1C1C + + thumb_func_start sub_81B1C84 +sub_81B1C84: @ 81B1C84 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _081B1CC0 + bl sub_81B1B44 + ldr r1, _081B1CC4 + adds r0, r4, 0 + bl itemid_get_name + ldr r4, _081B1CC8 + ldr r1, _081B1CCC + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1CC0: .4byte 0x02021cc4 +_081B1CC4: .4byte 0x02021dc4 +_081B1CC8: .4byte 0x02021fc4 +_081B1CCC: .4byte 0x085e991b + thumb_func_end sub_81B1C84 + + thumb_func_start sub_81B1CD0 +sub_81B1CD0: @ 81B1CD0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _081B1D0C + bl sub_81B1B44 + ldr r1, _081B1D10 + adds r0, r4, 0 + bl itemid_get_name + ldr r4, _081B1D14 + ldr r1, _081B1D18 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1D0C: .4byte 0x02021cc4 +_081B1D10: .4byte 0x02021dc4 +_081B1D14: .4byte 0x02021fc4 +_081B1D18: .4byte 0x085e999d + thumb_func_end sub_81B1CD0 + + thumb_func_start sub_81B1D1C +sub_81B1D1C: @ 81B1D1C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _081B1D58 + bl sub_81B1B44 + ldr r1, _081B1D5C + adds r0, r4, 0 + bl itemid_get_name + ldr r4, _081B1D60 + ldr r1, _081B1D64 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1D58: .4byte 0x02021cc4 +_081B1D5C: .4byte 0x02021dc4 +_081B1D60: .4byte 0x02021fc4 +_081B1D64: .4byte 0x085e993a + thumb_func_end sub_81B1D1C + + thumb_func_start sub_81B1D68 +sub_81B1D68: @ 81B1D68 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _081B1DA8 + bl itemid_get_name + ldr r1, _081B1DAC + adds r0, r4, 0 + bl itemid_get_name + ldr r4, _081B1DB0 + ldr r1, _081B1DB4 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B1DA8: .4byte 0x02021cc4 +_081B1DAC: .4byte 0x02021dc4 +_081B1DB0: .4byte 0x02021fc4 +_081B1DB4: .4byte 0x085e99db + thumb_func_end sub_81B1D68 + + thumb_func_start sub_81B1DB8 +sub_81B1DB8: @ 81B1DB8 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r4, r5, 16 + adds r7, r4, 0 + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1DE2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D4420 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B1DF6 +_081B1DE2: + mov r0, sp + strb r7, [r0] + mov r1, sp + lsrs r0, r5, 24 + strb r0, [r1, 0x1] + adds r0, r6, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_081B1DF6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B1DB8 + + thumb_func_start sub_81B1E00 +sub_81B1E00: @ 81B1E00 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + cmp r0, 0 + bne _081B1E1C + movs r0, 0 + b _081B1E3E +_081B1E1C: + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + beq _081B1E3C + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + movs r0, 0x2 + b _081B1E3E +_081B1E3C: + movs r0, 0x1 +_081B1E3E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1E00 + + thumb_func_start pokemon_item_not_removed +pokemon_item_not_removed: @ 81B1E48 + push {lr} + ldr r0, _081B1E58 + ldr r1, _081B1E5C + bl ExpandTextCodes + pop {r0} + bx r0 + .align 2, 0 +_081B1E58: .4byte 0x02021fc4 +_081B1E5C: .4byte 0x085e9a69 + thumb_func_end pokemon_item_not_removed + + thumb_func_start sub_81B1E60 +sub_81B1E60: @ 81B1E60 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, _081B1F08 + adds r7, r0, r1 + ldrh r0, [r7, 0x4] + ldrh r1, [r7] + adds r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x6] + subs r0, 0x1 + strh r0, [r7, 0x6] + movs r2, 0x8 + ldrsh r0, [r7, r2] + movs r5, 0x64 + muls r0, r5 + ldr r4, _081B1F0C + adds r0, r4 + movs r1, 0x39 + adds r2, r7, 0 + bl pokemon_setattr + movs r3, 0x8 + ldrsh r2, [r7, r3] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + ldr r6, _081B1F10 + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2CD4 + movs r0, 0x8 + ldrsh r2, [r7, r0] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + bl sub_81B2E28 + movs r1, 0x6 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _081B1EDC + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + beq _081B1EDC + movs r3, 0x2 + ldrsh r0, [r7, r3] + cmp r1, r0 + bne _081B1EFE +_081B1EDC: + movs r0, 0 + ldrsh r1, [r7, r0] + movs r2, 0xA + ldrsh r0, [r7, r2] + cmp r1, r0 + ble _081B1EF8 + ldr r0, _081B1F14 + movs r3, 0xA + ldrsh r2, [r7, r3] + subs r1, r2 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string +_081B1EF8: + mov r0, r8 + bl set_task_function_to_args_14_15 +_081B1EFE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B1F08: .4byte 0x03005e08 +_081B1F0C: .4byte 0x020244ec +_081B1F10: .4byte 0x0203cedc +_081B1F14: .4byte 0x02021dc4 + thumb_func_end sub_81B1E60 + + thumb_func_start sub_81B1F18 +sub_81B1F18: @ 81B1F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + mov r10, r3 + ldr r7, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r0, 0x64 + mov r6, r9 + muls r6, r0 + ldr r0, _081B1F9C + adds r6, r0 + mov r0, r8 + lsls r4, r0, 2 + add r4, r8 + lsls r4, 3 + ldr r0, _081B1FA0 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r4] + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r4, 0x2] + lsls r5, 24 + asrs r5, 24 + strh r5, [r4, 0x4] + mov r0, r10 + strh r0, [r4, 0x6] + mov r0, r9 + strh r0, [r4, 0x8] + ldrh r0, [r4] + strh r0, [r4, 0xA] + ldr r1, _081B1FA4 + mov r0, r8 + adds r2, r7, 0 + bl set_task_function_and_args_14_15 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B1F9C: .4byte 0x020244ec +_081B1FA0: .4byte 0x03005e08 +_081B1FA4: .4byte sub_81B1E60 + 1 + thumb_func_end sub_81B1F18 + + thumb_func_start sub_81B1FA8 +sub_81B1FA8: @ 81B1FA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, _081B1FCC + adds r3, r0, r1 + cmp r5, 0x5 + bhi _081B200A + lsls r0, r5, 2 + ldr r1, _081B1FD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B1FCC: .4byte 0x03005e08 +_081B1FD0: .4byte _081B1FD4 + .align 2, 0 +_081B1FD4: + .4byte _081B1FEC + .4byte _081B1FF2 + .4byte _081B1FF6 + .4byte _081B1FFA + .4byte _081B1FFE + .4byte _081B2002 +_081B1FEC: + strh r2, [r3] + strh r2, [r3, 0xA] + b _081B200A +_081B1FF2: + strh r2, [r3, 0x2] + b _081B200A +_081B1FF6: + strh r2, [r3, 0x4] + b _081B200A +_081B1FFA: + strh r2, [r3, 0x6] + b _081B200A +_081B1FFE: + strh r2, [r3, 0x8] + b _081B200A +_081B2002: + ldr r1, _081B2010 + adds r0, r4, 0 + bl set_task_function_and_args_14_15 +_081B200A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B2010: .4byte sub_81B1E60 + 1 + thumb_func_end sub_81B1FA8 + + thumb_func_start pokemon_ailments_get_primary +pokemon_ailments_get_primary: @ 81B2014 + push {lr} + adds r1, r0, 0 + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + beq _081B2024 + movs r0, 0x1 + b _081B2056 +_081B2024: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081B2030 + movs r0, 0x2 + b _081B2056 +_081B2030: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _081B203C + movs r0, 0x3 + b _081B2056 +_081B203C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081B2048 + movs r0, 0x4 + b _081B2056 +_081B2048: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081B2054 + movs r0, 0 + b _081B2056 +_081B2054: + movs r0, 0x5 +_081B2056: + pop {r1} + bx r1 + thumb_func_end pokemon_ailments_get_primary + + thumb_func_start sub_81B205C +sub_81B205C: @ 81B205C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B206E + movs r0, 0x7 + b _081B2096 +_081B206E: + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081B2096 + adds r0, r4, 0 + movs r1, 0 + bl sub_806DD7C + lsls r0, 24 + cmp r0, 0 + bne _081B2094 + movs r0, 0 + b _081B2096 +_081B2094: + movs r0, 0x6 +_081B2096: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B205C + + thumb_func_start sub_81B209C +sub_81B209C: @ 81B209C + push {r4,r5,lr} + ldr r2, _081B20EC + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xB + bne _081B2126 + adds r5, r2, 0 + adds r5, 0xE + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, _081B20F0 + ldrh r0, [r0] + cmp r0, 0 + bne _081B20FC + movs r4, 0 + ldr r0, _081B20F4 + ldrb r0, [r0] + cmp r4, r0 + bcs _081B2126 +_081B20C4: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B20F8 + adds r0, r1 + bl sub_81B2134 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B20F4 + ldrb r0, [r0] + cmp r4, r0 + bcc _081B20C4 + b _081B2126 + .align 2, 0 +_081B20EC: .4byte 0x0203cec8 +_081B20F0: .4byte 0x020375e2 +_081B20F4: .4byte 0x020244e9 +_081B20F8: .4byte 0x020244ec +_081B20FC: + movs r4, 0 + b _081B211E +_081B2100: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B212C + adds r0, r1 + bl sub_81B2164 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B211E: + ldr r0, _081B2130 + ldrb r0, [r0] + cmp r4, r0 + bcc _081B2100 +_081B2126: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B212C: .4byte 0x020244ec +_081B2130: .4byte 0x020244e9 + thumb_func_end sub_81B209C + + thumb_func_start sub_81B2134 +sub_81B2134: @ 81B2134 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _081B215A + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl sub_802C908 + cmp r0, 0 + beq _081B215A + movs r0, 0x1 + b _081B215C +_081B215A: + movs r0, 0 +_081B215C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2134 + + thumb_func_start sub_81B2164 +sub_81B2164: @ 81B2164 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _081B2182 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0x55 + bne _081B2182 + movs r0, 0x1 + b _081B2184 +_081B2182: + movs r0, 0 +_081B2184: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2164 + + thumb_func_start sub_81B218C +sub_81B218C: @ 81B218C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B21A8 + movs r2, 0xE + ldrsh r1, [r1, r2] + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B21A4 + movs r0, 0 +_081B21A4: + pop {r1} + bx r1 + .align 2, 0 +_081B21A8: .4byte 0x0203cec8 + thumb_func_end sub_81B218C + + thumb_func_start sub_81B21AC +sub_81B21AC: @ 81B21AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r5, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B21DC + movs r0, 0x5 + bl audio_play + ldr r0, _081B21D8 + strh r5, [r0] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B21FE + .align 2, 0 +_081B21D8: .4byte 0x020375e0 +_081B21DC: + movs r0, 0x20 + bl audio_play + ldr r0, _081B2204 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B2208 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B220C + str r1, [r0] +_081B21FE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B2204: .4byte 0x085ea0ee +_081B2208: .4byte 0x03005e00 +_081B220C: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B21AC + + thumb_func_start sub_81B2210 +sub_81B2210: @ 81B2210 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081B223C + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B2240 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B2244 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B223C: .4byte 0x085ea110 +_081B2240: .4byte 0x03005e00 +_081B2244: .4byte sub_81B2248 + 1 + thumb_func_end sub_81B2210 + + thumb_func_start sub_81B2248 +sub_81B2248: @ 81B2248 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B226C + bl sub_81B334C + ldr r0, _081B2274 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B2278 + str r0, [r1] +_081B226C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B2274: .4byte 0x03005e00 +_081B2278: .4byte sub_81B227C + 1 + thumb_func_end sub_81B2248 + + thumb_func_start sub_81B227C +sub_81B227C: @ 81B227C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B22A2 + cmp r1, 0 + bgt _081B229C + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B22B4 + b _081B22C8 +_081B229C: + cmp r1, 0x1 + beq _081B22BA + b _081B22C8 +_081B22A2: + ldr r1, _081B22B0 + movs r0, 0x7 + strh r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B22C8 + .align 2, 0 +_081B22B0: .4byte 0x020375e0 +_081B22B4: + movs r0, 0x5 + bl audio_play +_081B22BA: + ldr r0, _081B22D0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B22D4 + str r0, [r1] +_081B22C8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B22D0: .4byte 0x03005e00 +_081B22D4: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B227C + + thumb_func_start sub_81B22D8 +sub_81B22D8: @ 81B22D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r7, r4, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r8, r6 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _081B22FA + movs r0, 0x3 + b _081B2356 +_081B22FA: + movs r0, 0x90 + lsls r0, 1 + cmp r4, r0 + bls _081B231C + adds r1, r4, 0 + subs r1, 0x21 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806E00C + cmp r0, 0 + beq _081B2334 + adds r0, r7, 0 + bl sub_81B6CFC + b _081B233E +_081B231C: + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2370 + lsls r0, 24 + cmp r0, 0 + bne _081B2338 +_081B2334: + movs r0, 0x1 + b _081B2356 +_081B2338: + mov r0, r8 + bl sub_81B2360 +_081B233E: + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r5, 0 + bl pokemon_has_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B2354 + movs r0, 0 + b _081B2356 +_081B2354: + movs r0, 0x2 +_081B2356: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B22D8 + + thumb_func_start sub_81B2360 +sub_81B2360: @ 81B2360 + lsls r0, 24 + ldr r1, _081B236C + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_081B236C: .4byte 0x0861500c + thumb_func_end sub_81B2360 + + thumb_func_start sub_81B2370 +sub_81B2370: @ 81B2370 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r2, _081B2390 + lsrs r0, 14 + adds r0, r2 + movs r2, 0x1 + lsls r2, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _081B2394 + movs r0, 0 + b _081B2396 + .align 2, 0 +_081B2390: .4byte 0x08615048 +_081B2394: + movs r0, 0x1 +_081B2396: + pop {r1} + bx r1 + thumb_func_end sub_81B2370 + + thumb_func_start sub_81B239C +sub_81B239C: @ 81B239C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _081B23C4 + cmp r0, 0x1 + bgt _081B23B2 + cmp r0, 0 + beq _081B23B8 + b _081B23DC +_081B23B2: + cmp r1, 0x2 + beq _081B23D0 + b _081B23DC +_081B23B8: + ldr r0, _081B23C0 + bl Window_InitFromTemplates + b _081B23E2 + .align 2, 0 +_081B23C0: .4byte 0x08615810 +_081B23C4: + ldr r0, _081B23CC + bl Window_InitFromTemplates + b _081B23E2 + .align 2, 0 +_081B23CC: .4byte 0x08615850 +_081B23D0: + ldr r0, _081B23D8 + bl Window_InitFromTemplates + b _081B23E2 + .align 2, 0 +_081B23D8: .4byte 0x08615890 +_081B23DC: + ldr r0, _081B2420 + bl Window_InitFromTemplates +_081B23E2: + bl TextBox_ResetSomeField + movs r4, 0 +_081B23E8: + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B23E8 + movs r0, 0 + movs r1, 0x4F + movs r2, 0xD0 + bl sub_809882C + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _081B2424 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B2420: .4byte 0x086158d0 +_081B2424: .4byte 0x0860f074 + thumb_func_end sub_81B239C + + thumb_func_start sub_81B2428 +sub_81B2428: @ 81B2428 + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081B24A0 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B243E + b _081B2554 +_081B243E: + cmp r2, 0x1 + bne _081B24B4 + ldr r0, _081B24A4 + bl Window_AddFromTemplate + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + ldr r5, _081B24A8 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x30 + bl sub_81DB35C + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, _081B24AC + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r5, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x1 + bl sub_8199EEC + adds r0, r4, 0 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + ldr r0, _081B24B0 + bl Window_AddFromTemplate + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + b _081B24C0 + .align 2, 0 +_081B24A0: .4byte 0x0203cec8 +_081B24A4: .4byte 0x08615918 +_081B24A8: .4byte 0x085e8ce3 +_081B24AC: .4byte 0x086157fc +_081B24B0: .4byte 0x08615910 +_081B24B4: + ldr r0, _081B2504 + bl Window_AddFromTemplate + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x3 +_081B24C0: + adds r0, r5, 0 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _081B2508 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xA + beq _081B2514 + ldr r4, _081B250C + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl sub_81DB35C + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _081B2510 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print + b _081B2540 + .align 2, 0 +_081B2504: .4byte 0x08615908 +_081B2508: .4byte 0x0203cec8 +_081B250C: .4byte 0x085e8cf0 +_081B2510: .4byte 0x086157fc +_081B2514: + ldr r4, _081B255C + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl sub_81DB35C + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _081B2560 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print +_081B2540: + adds r0, r5, 0 + bl Window_WriteStandardTileMap + adds r0, r5, 0 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B2554: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B255C: .4byte 0x085e8cf7 +_081B2560: .4byte 0x086157fc + thumb_func_end sub_81B2428 + + thumb_func_start sub_81B2564 +sub_81B2564: @ 81B2564 + lsls r0, 24 + ldr r1, _081B2574 + lsrs r0, 23 + adds r0, 0x18 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_081B2574: .4byte 0x0203cec4 + thumb_func_end sub_81B2564 + + thumb_func_start sub_81B2578 +sub_81B2578: @ 81B2578 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r1, [sp, 0xC] + ldr r1, [sp, 0x4C] + ldr r4, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + mov r0, r10 + muls r0, r6 + lsls r0, 5 + bl malloc_and_clear + mov r9, r0 + cmp r0, 0 + beq _081B2646 + movs r5, 0 + ldr r0, [sp, 0x14] + lsls r0, 19 + str r0, [sp, 0x1C] + ldr r1, [sp, 0x18] + lsls r1, 19 + str r1, [sp, 0x20] + lsls r2, r6, 19 + str r2, [sp, 0x24] + mov r0, r10 + lsls r0, 19 + str r0, [sp, 0x28] + cmp r5, r10 + bcs _081B2624 +_081B25DA: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _081B261A + ldr r2, [sp, 0x18] + adds r0, r2, r5 + ldr r2, [sp, 0x10] + adds r1, r0, 0 + muls r1, r2 + adds r7, r1, 0 +_081B25F0: + ldr r1, [sp, 0x14] + adds r0, r1, r4 + adds r0, r7 + ldr r2, [sp, 0xC] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_81B0DD4 + adds r1, r5, 0 + muls r1, r6 + adds r1, r4 + lsls r1, 5 + add r1, r9 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _081B25F0 +_081B261A: + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, r10 + bcc _081B25DA +_081B2624: + ldr r0, [sp, 0x1C] + lsrs r2, r0, 16 + ldr r1, [sp, 0x20] + lsrs r3, r1, 16 + ldr r1, [sp, 0x24] + lsrs r0, r1, 16 + str r0, [sp] + ldr r1, [sp, 0x28] + lsrs r0, r1, 16 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + mov r1, r9 + bl Window_CopyWholePixelBlockToWindow + mov r0, r9 + bl free +_081B2646: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2578 + + thumb_func_start sub_81B2658 +sub_81B2658: @ 81B2658 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 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 + cmp r3, 0 + bne _081B2684 + cmp r4, 0 + bne _081B2684 + movs r3, 0xA + movs r4, 0x7 +_081B2684: + cmp r5, 0 + bne _081B26A0 + ldr r1, _081B269C + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 + b _081B26B0 + .align 2, 0 +_081B269C: .4byte 0x08615988 +_081B26A0: + ldr r1, _081B26B8 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 +_081B26B0: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B26B8: .4byte 0x086159ce + thumb_func_end sub_81B2658 + + thumb_func_start sub_81B26BC +sub_81B26BC: @ 81B26BC + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 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 + cmp r3, 0 + bne _081B26E8 + cmp r4, 0 + bne _081B26E8 + movs r3, 0x12 + movs r4, 0x3 +_081B26E8: + cmp r5, 0 + bne _081B2704 + ldr r1, _081B2700 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 + b _081B2714 + .align 2, 0 +_081B2700: .4byte 0x08615a14 +_081B2704: + ldr r1, _081B271C + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 +_081B2714: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B271C: .4byte 0x08615a4a + thumb_func_end sub_81B26BC + + thumb_func_start sub_81B2720 +sub_81B2720: @ 81B2720 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B2744 + movs r2, 0 + str r2, [sp] + movs r2, 0x12 + str r2, [sp, 0x4] + movs r2, 0x3 + str r2, [sp, 0x8] + movs r2, 0x12 + movs r3, 0 + bl sub_81B2578 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B2744: .4byte 0x08615a80 + thumb_func_end sub_81B2720 + + thumb_func_start sub_81B2748 +sub_81B2748: @ 81B2748 + push {r4-r7,lr} + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + ldrb r0, [r0, 0x8] + movs r1, 0x5 + bl Window_GetField + lsls r0, 28 + lsrs r6, r0, 24 + adds r7, r6, 0 + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081B277C + ldr r5, _081B2774 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2778 + b _081B297E + .align 2, 0 +_081B2774: .4byte 0x08615af1 +_081B2778: .4byte 0x08615ac0 +_081B277C: + movs r0, 0x20 + ands r0, r4 + cmp r0, 0 + beq _081B27D8 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2794 + ldr r5, _081B2790 + b _081B2942 + .align 2, 0 +_081B2790: .4byte 0x08615adf +_081B2794: + ldr r5, _081B27CC + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B27D0 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B27D4 + b _081B2976 + .align 2, 0 +_081B27CC: .4byte 0x08615adf +_081B27D0: .4byte 0x08615aba +_081B27D4: .4byte 0x08615aee +_081B27D8: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _081B2824 + ldr r5, _081B2818 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B281C + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B2820 + b _081B2976 + .align 2, 0 +_081B2818: .4byte 0x08615adf +_081B281C: .4byte 0x08615aba +_081B2820: .4byte 0x08615aee +_081B2824: + movs r0, 0x4 + ands r0, r4 + cmp r0, 0 + beq _081B2880 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B283C + ldr r5, _081B2838 + b _081B2942 + .align 2, 0 +_081B2838: .4byte 0x08615adf +_081B283C: + ldr r5, _081B2874 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2878 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B287C + b _081B2976 + .align 2, 0 +_081B2874: .4byte 0x08615adf +_081B2878: .4byte 0x08615aba +_081B287C: .4byte 0x08615aee +_081B2880: + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _081B28DC + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2898 + ldr r5, _081B2894 + b _081B2942 + .align 2, 0 +_081B2894: .4byte 0x08615adc +_081B2898: + ldr r5, _081B28D0 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B28D4 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B28D8 + b _081B2976 + .align 2, 0 +_081B28D0: .4byte 0x08615ad3 +_081B28D4: .4byte 0x08615aba +_081B28D8: .4byte 0x08615ae8 +_081B28DC: + movs r0, 0x8 + ands r0, r4 + cmp r0, 0 + beq _081B2938 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B28F4 + ldr r5, _081B28F0 + b _081B2942 + .align 2, 0 +_081B28F0: .4byte 0x08615ad9 +_081B28F4: + ldr r5, _081B292C + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2930 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B2934 + b _081B2976 + .align 2, 0 +_081B292C: .4byte 0x08615ad0 +_081B2930: .4byte 0x08615aba +_081B2934: .4byte 0x08615ae5 +_081B2938: + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _081B29BC + ldr r5, _081B29AC +_081B2942: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B29B0 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B29B4 +_081B2976: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B29B8 +_081B297E: + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + b _081B2A24 + .align 2, 0 +_081B29AC: .4byte 0x08615ad6 +_081B29B0: .4byte 0x08615aba +_081B29B4: .4byte 0x08615aeb +_081B29B8: .4byte 0x08615abd +_081B29BC: + ldr r5, _081B2A2C + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2A30 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, _081B2A34 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2A38 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply +_081B2A24: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B2A2C: .4byte 0x08615acd +_081B2A30: .4byte 0x08615aba +_081B2A34: .4byte 0x08615ae2 +_081B2A38: .4byte 0x08615abd + thumb_func_end sub_81B2748 + + thumb_func_start sub_81B2A3C +sub_81B2A3C: @ 81B2A3C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldrb r5, [r3] + ldrb r3, [r3, 0x1] + lsls r4, r2, 1 + adds r4, r2 + ldr r2, _081B2A6C + adds r4, r2 + str r4, [sp] + movs r2, 0 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r5, 0 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B2A6C: .4byte 0x086157fc + thumb_func_end sub_81B2A3C + + thumb_func_start sub_81B2A70 +sub_81B2A70: @ 81B2A70 + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B2AC0 + cmp r4, 0x1 + bne _081B2AAA + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x4] + lsrs r1, 3 + ldrb r2, [r5, 0x5] + lsrs r2, 3 + ldrb r3, [r5, 0x6] + lsrs r3, 3 + ldrb r4, [r5, 0x7] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2AAA: + adds r0, r7, 0 + add r1, sp, 0x8 + bl sub_81B1B44 + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + add r1, sp, 0x8 + movs r2, 0 + bl sub_81B2A3C +_081B2AC0: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2A70 + + thumb_func_start sub_81B2AC8 +sub_81B2AC8: @ 81B2AC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B2B34 + adds r0, r6, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B2AF6 + cmp r0, 0x6 + bne _081B2B34 +_081B2AF6: + cmp r4, 0 + beq _081B2B1C + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0x8] + lsrs r1, 3 + ldrb r2, [r5, 0x9] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xA] + lsrs r3, 3 + ldrb r4, [r5, 0xB] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2B1C: + mov r0, r8 + cmp r0, 0x2 + beq _081B2B34 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_81B2B40 +_081B2B34: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2AC8 + + thumb_func_start sub_81B2B40 +sub_81B2B40: @ 81B2B40 + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r5, _081B2B80 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _081B2B84 + ldr r1, _081B2B88 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + adds r1, r5, 0 + bl gf_strcat + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x8 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B2B80: .4byte 0x02021dc4 +_081B2B84: .4byte 0x02021cc4 +_081B2B88: .4byte 0x085e8d4d + thumb_func_end sub_81B2B40 + + thumb_func_start sub_81B2B8C +sub_81B2B8C: @ 81B2B8C + push {r4-r7,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x1 + bne _081B2BBE + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0xC] + lsrs r1, 3 + ldrb r2, [r5, 0xD] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xE] + lsrs r3, 3 + ldrb r4, [r5, 0xF] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2BBE: + adds r0, r6, 0 + add r1, sp, 0x8 + bl sub_81B1B44 + adds r0, r6, 0 + bl pokemon_get_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + add r2, sp, 0x8 + adds r3, r7, 0 + bl sub_81B2BF4 + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2B8C + + thumb_func_start sub_81B2BF4 +sub_81B2BF4: @ 81B2BF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + adds r7, r3, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r5, r4, 0 + ldrb r0, [r7, 0x8] + movs r1, 0x5 + bl Window_GetField + lsls r0, 28 + lsrs r6, r0, 24 + cmp r4, 0 + beq _081B2CBA + cmp r4, 0x20 + beq _081B2C24 + cmp r4, 0x1D + bne _081B2C38 +_081B2C24: + movs r0, 0xB + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081B2C44 + adds r1, r0 + mov r0, r9 + bl sub_8008C44 + cmp r0, 0 + beq _081B2CBA +_081B2C38: + mov r0, r8 + cmp r0, 0 + beq _081B2C48 + cmp r0, 0xFE + beq _081B2C88 + b _081B2CBA + .align 2, 0 +_081B2C44: .4byte 0x083185c8 +_081B2C48: + ldr r5, _081B2C7C + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2C80 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r7, 0x8] + ldr r1, _081B2C84 + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C + b _081B2CBA + .align 2, 0 +_081B2C7C: .4byte 0x08615ac3 +_081B2C80: .4byte 0x08615ab6 +_081B2C84: .4byte 0x085e8d49 +_081B2C88: + ldr r5, _081B2CC8 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2CCC + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r7, 0x8] + ldr r1, _081B2CD0 + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C +_081B2CBA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B2CC8: .4byte 0x08615ac5 +_081B2CCC: .4byte 0x08615ab6 +_081B2CD0: .4byte 0x085e8d4b + thumb_func_end sub_81B2BF4 + + thumb_func_start sub_81B2CD4 +sub_81B2CD4: @ 81B2CD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B2D2E + cmp r4, 0 + beq _081B2D16 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x10] + lsrs r1, 3 + ldrb r2, [r5, 0x11] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x12] + lsrs r3, 3 + ldrb r4, [r5, 0x13] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2D16: + mov r0, r8 + cmp r0, 0x2 + beq _081B2D2E + adds r0, r7, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2D3C +_081B2D2E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2CD4 + + thumb_func_start sub_81B2D3C +sub_81B2D3C: @ 81B2D3C + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, _081B2D70 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + movs r1, 0xBA + strb r1, [r0] + movs r1, 0xFF + strb r1, [r0, 0x1] + ldrb r0, [r4, 0x8] + ldr r3, [r4] + adds r3, 0x10 + adds r1, r5, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B2D70: .4byte 0x02021cc4 + thumb_func_end sub_81B2D3C + + thumb_func_start sub_81B2D74 +sub_81B2D74: @ 81B2D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B2DD0 + cmp r4, 0 + beq _081B2DB8 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x14] + lsrs r1, 3 + adds r1, 0x1 + ldrb r2, [r5, 0x15] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x16] + lsrs r3, 3 + ldrb r4, [r5, 0x17] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2DB8: + mov r0, r8 + cmp r0, 0x2 + beq _081B2DD0 + adds r0, r7, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2DDC +_081B2DD0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2D74 + + thumb_func_start sub_81B2DDC +sub_81B2DDC: @ 81B2DDC + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, _081B2E1C + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _081B2E20 + ldr r1, _081B2E24 + adds r0, r4, 0 + bl gf_strcpy + adds r0, r4, 0 + adds r1, r5, 0 + bl gf_strcat + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x14 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B2E1C: .4byte 0x02021dc4 +_081B2E20: .4byte 0x02021cc4 +_081B2E24: .4byte 0x085e8d3e + thumb_func_end sub_81B2DDC + + thumb_func_start sub_81B2E28 +sub_81B2E28: @ 81B2E28 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B2E5C + 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 r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + adds r2, r6, 0 + bl sub_81B2E64 +_081B2E5C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B2E28 + + thumb_func_start sub_81B2E64 +sub_81B2E64: @ 81B2E64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrb r0, [r6, 0x8] + movs r1, 0x5 + bl Window_GetField + lsls r0, 28 + lsrs r7, r0, 24 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B2EB0 + cmp r0, 0x2 + blt _081B2EE0 + cmp r0, 0x4 + bgt _081B2EE0 + ldr r5, _081B2EAC + b _081B2EB2 + .align 2, 0 +_081B2EAC: .4byte 0x08615ac7 +_081B2EB0: + ldr r5, _081B2ED8 +_081B2EB2: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2EDC + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + b _081B2F04 + .align 2, 0 +_081B2ED8: .4byte 0x08615ac9 +_081B2EDC: .4byte 0x08615ab8 +_081B2EE0: + ldr r5, _081B2FA0 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, _081B2FA4 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply +_081B2F04: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + ldr r2, [r6] + ldrb r2, [r2, 0x1A] + bl sub_8075034 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6, 0x8] + ldr r4, _081B2FA4 + ldrb r1, [r4, 0x1] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + str r5, [sp] + movs r7, 0x1 + str r7, [sp, 0x4] + bl Window_FillPixelRect + ldrb r0, [r6, 0x8] + ldrb r1, [r4] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + adds r3, 0x1 + str r5, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + bl Window_FillPixelRect + ldr r1, [r6] + ldrb r0, [r1, 0x1A] + cmp r5, r0 + beq _081B2F88 + ldrb r0, [r6, 0x8] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0xD + bl Window_FillPixelRect + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + adds r3, 0x1 + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r4, [sp, 0x4] + movs r1, 0x2 + bl Window_FillPixelRect +_081B2F88: + ldrb r0, [r6, 0x8] + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B2FA0: .4byte 0x08615acb +_081B2FA4: .4byte 0x08615ab8 + thumb_func_end sub_81B2E64 + + thumb_func_start sub_81B2FA8 +sub_81B2FA8: @ 81B2FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r7, 0 + beq _081B2FF2 + ldr r5, [r6] + ldrb r1, [r5, 0x1C] + movs r4, 0x7 + adds r0, r1, 0 + ands r0, r4 + ldrb r2, [r5, 0x1E] + adds r0, r2 + adds r3, r0, 0x7 + asrs r3, 3 + ldrb r2, [r5, 0x1D] + adds r0, r2, 0 + ands r0, r4 + ldrb r4, [r5, 0x1F] + adds r0, r4 + adds r4, r0, 0x7 + ldrb r0, [r6, 0x8] + lsrs r1, 3 + lsrs r2, 3 + lsrs r4, 3 + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2FF2: + cmp r7, 0x2 + beq _081B3018 + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x1C] + ldrb r3, [r1, 0x1D] + ldr r1, _081B3024 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r4, _081B3028 + mov r5, r8 + lsls r1, r5, 2 + adds r1, r4 + ldr r1, [r1] + str r1, [sp, 0x8] + movs r1, 0x1 + bl box_print +_081B3018: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B3024: .4byte 0x086157fc +_081B3028: .4byte 0x08615b60 + thumb_func_end sub_81B2FA8 + + thumb_func_start sub_81B302C +sub_81B302C: @ 81B302C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081B304C + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B304C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B302C + + thumb_func_start sub_81B3054 +sub_81B3054: @ 81B3054 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r0, _081B3084 + ldr r4, [r0] + adds r5, r4, 0 + adds r5, 0xD + ldrb r0, [r4, 0xD] + cmp r0, 0xFF + beq _081B306E + adds r0, r5, 0 + bl sub_81B302C +_081B306E: + cmp r6, 0x7F + beq _081B313C + adds r0, r6, 0 + subs r0, 0x15 + cmp r0, 0x5 + bhi _081B30D4 + lsls r0, 2 + ldr r1, _081B3088 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B3084: .4byte 0x0203cec4 +_081B3088: .4byte _081B308C + .align 2, 0 +_081B308C: + .4byte _081B30A4 + .4byte _081B30BC + .4byte _081B30BC + .4byte _081B30AC + .4byte _081B30B4 + .4byte _081B30C4 +_081B30A4: + ldr r0, _081B30A8 + b _081B30C6 + .align 2, 0 +_081B30A8: .4byte 0x08615928 +_081B30AC: + ldr r0, _081B30B0 + b _081B30C6 + .align 2, 0 +_081B30B0: .4byte 0x08615930 +_081B30B4: + ldr r0, _081B30B8 + b _081B30C6 + .align 2, 0 +_081B30B8: .4byte 0x08615938 +_081B30BC: + ldr r0, _081B30C0 + b _081B30C6 + .align 2, 0 +_081B30C0: .4byte 0x08615940 +_081B30C4: + ldr r0, _081B30D0 +_081B30C6: + bl Window_AddFromTemplate + strb r0, [r5] + b _081B30DC + .align 2, 0 +_081B30D0: .4byte 0x08615948 +_081B30D4: + ldr r0, _081B30F0 + bl Window_AddFromTemplate + strb r0, [r4, 0xD] +_081B30DC: + cmp r6, 0 + bne _081B3104 + ldr r0, _081B30F4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B30F8 + movs r6, 0x2 + b _081B3104 + .align 2, 0 +_081B30F0: .4byte 0x08615920 +_081B30F4: .4byte 0x0203cec4 +_081B30F8: + bl sub_81B314C + lsls r0, 24 + cmp r0, 0 + bne _081B3104 + movs r6, 0x1 +_081B3104: + ldrb r0, [r5] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r4, _081B3144 + ldr r1, _081B3148 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandTextCodes + ldrb r0, [r5] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B313C: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B3144: .4byte 0x02021fc4 +_081B3148: .4byte 0x08615af4 + thumb_func_end sub_81B3054 + + thumb_func_start sub_81B314C +sub_81B314C: @ 81B314C + push {r4-r7,lr} + ldr r7, _081B3160 + movs r6, 0 + ldr r0, _081B3164 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B3168 +_081B315A: + movs r0, 0x1 + b _081B31AA + .align 2, 0 +_081B3160: .4byte 0x020244ec +_081B3164: .4byte 0x0203cec8 +_081B3168: + movs r5, 0 +_081B316A: + movs r0, 0x64 + muls r0, r5 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B319A + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B3194 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _081B319A +_081B3194: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081B319A: + cmp r6, 0x1 + bhi _081B315A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B316A + movs r0, 0 +_081B31AA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B314C + + thumb_func_start sub_81B31B0 +sub_81B31B0: @ 81B31B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _081B320C + cmp r4, 0x1 + bgt _081B31CC + cmp r4, 0 + beq _081B31D2 + b _081B321C +_081B31CC: + cmp r4, 0x2 + beq _081B3214 + b _081B321C +_081B31D2: + ldr r0, _081B3204 + ldr r1, [r0] + ldrb r0, [r1, 0x17] + lsls r0, 1 + movs r3, 0x13 + subs r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0xA + str r0, [sp] + ldrb r0, [r1, 0x17] + lsls r0, 25 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, _081B3208 + str r0, [sp, 0xC] + add r0, sp, 0x14 + movs r1, 0x2 + movs r2, 0x13 + bl rbox_template_set + b _081B3226 + .align 2, 0 +_081B3204: .4byte 0x0203cec4 +_081B3208: .4byte 0x000002e9 +_081B320C: + ldr r0, _081B3210 + b _081B321E + .align 2, 0 +_081B3210: .4byte 0x08615950 +_081B3214: + ldr r0, _081B3218 + b _081B321E + .align 2, 0 +_081B3218: .4byte 0x08615958 +_081B321C: + ldr r0, _081B3248 +_081B321E: + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x14] + str r1, [sp, 0x18] +_081B3226: + add r0, sp, 0x14 + bl Window_AddFromTemplate + ldr r6, _081B324C + ldr r1, [r6] + strb r0, [r1, 0xC] + ldr r0, [r6] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + cmp r4, 0x3 + bne _081B3250 + ldr r0, [r6] + b _081B32E2 + .align 2, 0 +_081B3248: .4byte 0x08615960 +_081B324C: .4byte 0x0203cec4 +_081B3250: + movs r0, 0x1 + movs r1, 0 + bl sub_8006460 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x1 + movs r1, 0x2 + bl fbox_get_field + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [r6] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcs _081B32CA + adds r7, r6, 0 + movs r6, 0 +_081B327A: + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xF + adds r4, r0, r5 + ldrb r0, [r4] + movs r2, 0x3 + cmp r0, 0x12 + bls _081B328C + movs r2, 0x4 +_081B328C: + ldrb r0, [r1, 0xC] + lsls r3, r5, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + lsls r1, r2, 1 + adds r1, r2 + ldr r2, _081B32F4 + adds r1, r2 + str r1, [sp, 0x8] + str r6, [sp, 0xC] + ldr r2, _081B32F8 + ldrb r1, [r4] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + str r1, [sp, 0x10] + movs r1, 0x1 + mov r2, r9 + bl sub_8199EEC + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcc _081B327A +_081B32CA: + ldr r4, _081B32FC + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0x17] + movs r2, 0 + movs r3, 0x1 + bl InitMenuInUpperLeftCorner + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [r4] +_081B32E2: + ldrb r0, [r0, 0xC] + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081B32F4: .4byte 0x086157fc +_081B32F8: .4byte 0x08615c08 +_081B32FC: .4byte 0x0203cec4 + thumb_func_end sub_81B31B0 + + thumb_func_start sub_81B3300 +sub_81B3300: @ 81B3300 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0x6 + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, _081B3348 + 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 r0, 0x6 + movs r1, 0x1 + adds r2, r4, 0 + bl text_box_related_one + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3348: .4byte 0x03003014 + thumb_func_end sub_81B3300 + + thumb_func_start sub_81B334C +sub_81B334C: @ 81B334C + push {lr} + ldr r0, _081B3360 + movs r1, 0x4F + movs r2, 0xD + movs r3, 0 + bl sub_81996C0 + pop {r0} + bx r0 + .align 2, 0 +_081B3360: .4byte 0x08615968 + thumb_func_end sub_81B334C + + thumb_func_start sub_81B3364 +sub_81B3364: @ 81B3364 + push {r4,lr} + ldr r0, _081B338C + bl Window_AddFromTemplate + ldr r4, _081B3390 + ldr r1, [r4] + strb r0, [r1, 0xC] + ldr r0, [r4] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, [r4] + ldrb r0, [r0, 0xC] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081B338C: .4byte 0x08615970 +_081B3390: .4byte 0x0203cec4 + thumb_func_end sub_81B3364 + + thumb_func_start sub_81B3394 +sub_81B3394: @ 81B3394 + push {r4,lr} + ldr r4, _081B33B0 + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl Window_FillTileMap + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B33B0: .4byte 0x0203cec4 + thumb_func_end sub_81B3394 + + thumb_func_start sub_81B33B4 +sub_81B33B4: @ 81B33B4 + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + bne _081B33C8 + bl sub_81B3414 + b _081B3400 +_081B33C8: + ldr r4, _081B3408 + ldr r1, [r4] + ldr r0, _081B340C + adds r0, r2, r0 + ldrb r0, [r0] + strb r0, [r1, 0x17] + movs r3, 0 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcs _081B3400 + ldr r1, _081B3410 + lsls r0, r2, 2 + adds r2, r0, r1 +_081B33E4: + ldr r1, [r4] + adds r1, 0xF + adds r1, r3 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcc _081B33E4 +_081B3400: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3408: .4byte 0x0203cec4 +_081B340C: .4byte 0x08615d70 +_081B3410: .4byte 0x08615d38 + thumb_func_end sub_81B33B4 + + thumb_func_start sub_81B3414 +sub_81B3414: @ 81B3414 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r2, _081B3488 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x17] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0 + bl append_byte + movs r7, 0 + ldr r0, _081B348C + ldrh r0, [r0] + str r0, [sp] +_081B3446: + movs r4, 0 + adds r0, r7, 0x1 + mov r8, r0 + ldr r1, [sp] + cmp r1, 0xE + beq _081B34A0 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r5, _081B348C +_081B345A: + mov r1, r9 + adds r0, r1, r6 + adds r1, r7, 0 + adds r1, 0xD + bl pokemon_getattr + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + cmp r0, r1 + bne _081B3490 + ldr r0, _081B3488 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + adds r2, r4, 0 + adds r2, 0x13 + lsls r2, 24 + lsrs r2, 24 + bl append_byte + b _081B34A0 + .align 2, 0 +_081B3488: .4byte 0x0203cec4 +_081B348C: .4byte 0x08615d7e +_081B3490: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, 0xE + bne _081B345A +_081B34A0: + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _081B3446 + bl sub_81A80A8 + lsls r0, 24 + cmp r0, 0 + bne _081B3518 + mov r0, r9 + adds r0, 0x64 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B34D2 + ldr r0, _081B3504 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x1 + bl append_byte +_081B34D2: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B3508 + ldr r0, _081B3504 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x6 + bl append_byte + b _081B3518 + .align 2, 0 +_081B3504: .4byte 0x0203cec4 +_081B3508: + ldr r0, _081B3538 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x3 + bl append_byte +_081B3518: + ldr r0, _081B3538 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x2 + bl append_byte + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B3538: .4byte 0x0203cec4 + thumb_func_end sub_81B3414 + + thumb_func_start sub_81B353C +sub_81B353C: @ 81B353C + push {r4,lr} + adds r4, r0, 0 + ldr r1, _081B3558 + ldrb r0, [r1, 0x8] + lsls r0, 28 + lsrs r0, 28 + adds r2, r1, 0 + cmp r0, 0xC + bhi _081B35FE + lsls r0, 2 + ldr r1, _081B355C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B3558: .4byte 0x0203cec8 +_081B355C: .4byte _081B3560 + .align 2, 0 +_081B3560: + .4byte _081B3594 + .4byte _081B35B0 + .4byte _081B35FE + .4byte _081B35FE + .4byte _081B35BC + .4byte _081B35FE + .4byte _081B35DC + .4byte _081B35FE + .4byte _081B35EE + .4byte _081B35F2 + .4byte _081B35F6 + .4byte _081B35FE + .4byte _081B35FA +_081B3594: + bl sub_813994C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B35AC + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _081B35FE +_081B35AC: + movs r1, 0x1 + b _081B3600 +_081B35B0: + adds r0, r4, 0 + bl sub_81B8A2C + lsls r0, 24 + lsrs r1, r0, 24 + b _081B3600 +_081B35BC: + movs r0, 0x9 + ldrsb r0, [r2, r0] + bl sub_81B856C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B35D4 + cmp r0, 0x1 + beq _081B35D8 + movs r1, 0x7 + b _081B3600 +_081B35D4: + movs r1, 0x4 + b _081B3600 +_081B35D8: + movs r1, 0x5 + b _081B3600 +_081B35DC: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + movs r1, 0x6 + cmp r0, 0 + beq _081B3600 + movs r1, 0x7 + b _081B3600 +_081B35EE: + movs r1, 0xA + b _081B3600 +_081B35F2: + movs r1, 0xB + b _081B3600 +_081B35F6: + movs r1, 0xC + b _081B3600 +_081B35FA: + movs r1, 0xD + b _081B3600 +_081B35FE: + movs r1, 0 +_081B3600: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B353C + + thumb_func_start sub_81B3608 +sub_81B3608: @ 81B3608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, _081B3664 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r7, _081B3668 + adds r5, r0, r7 + ldr r1, _081B366C + adds r0, r5, 0 + bl sub_81B1B44 + ldr r0, _081B3670 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B3674 + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl sub_81B3054 + b _081B36EA + .align 2, 0 +_081B3664: .4byte 0x0203cec8 +_081B3668: .4byte 0x020244ec +_081B366C: .4byte 0x02021cc4 +_081B3670: .4byte 0x0203cec4 +_081B3674: + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _081B36C0 + ldr r4, _081B36B0 + ldr r1, _081B36B4 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B36B8 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B36BC + str r1, [r0] + movs r0, 0 + b _081B36EC + .align 2, 0 +_081B36B0: .4byte 0x02021fc4 +_081B36B4: .4byte 0x085e9980 +_081B36B8: .4byte 0x03005e00 +_081B36BC: .4byte sub_81B469C + 1 +_081B36C0: + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + ldr r1, _081B36F8 + adds r0, r6, 0 + bl itemid_get_name + movs r0, 0x1A + bl sub_81B3054 +_081B36EA: + movs r0, 0x1 +_081B36EC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081B36F8: .4byte 0x02021dc4 + thumb_func_end sub_81B3608 + + thumb_func_start sub_81B36FC +sub_81B36FC: @ 81B36FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B3608 + lsls r0, 24 + cmp r0, 0 + beq _081B3720 + ldr r1, _081B3728 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, _081B372C + str r1, [r0] +_081B3720: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3728: .4byte 0x03005e00 +_081B372C: .4byte sub_81B3730 + 1 + thumb_func_end sub_81B36FC + + thumb_func_start sub_81B3730 +sub_81B3730: @ 81B3730 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _081B3768 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B37EE + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B37EE + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081B376C + adds r5, r0, r1 + ldr r0, _081B3770 + ldr r0, [r0] + ldrb r0, [r0, 0x17] + cmp r0, 0x3 + bhi _081B3774 + bl ProcessMenuInputNoWrapAround_other + b _081B3778 + .align 2, 0 +_081B3768: .4byte 0x02037fd4 +_081B376C: .4byte 0x03005e08 +_081B3770: .4byte 0x0203cec4 +_081B3774: + bl ProcessMenuInput_other +_081B3778: + lsls r0, 24 + lsrs r4, r0, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + lsls r0, r4, 24 + asrs r5, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _081B37EE + adds r0, 0x1 + cmp r5, r0 + bne _081B37CC + movs r0, 0x5 + bl audio_play + ldr r4, _081B37C4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r2, _081B37C8 + ldr r0, [r4] + ldrb r1, [r0, 0x17] + adds r0, r1 + ldrb r0, [r0, 0xE] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081B37EE + .align 2, 0 +_081B37C4: .4byte 0x0203cec4 +_081B37C8: .4byte 0x08615c08 +_081B37CC: + ldr r4, _081B37F4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r1, _081B37F8 + ldr r0, [r4] + adds r0, 0xF + adds r0, r5 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081B37EE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B37F4: .4byte 0x0203cec4 +_081B37F8: .4byte 0x08615c08 + thumb_func_end sub_81B3730 + + thumb_func_start sub_81B37FC +sub_81B37FC: @ 81B37FC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + ldr r0, _081B3820 + ldr r1, [r0] + ldr r0, _081B3824 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3820: .4byte 0x0203cec4 +_081B3824: .4byte sub_81B3828 + 1 + thumb_func_end sub_81B37FC + + thumb_func_start sub_81B3828 +sub_81B3828: @ 81B3828 + push {r4,lr} + sub sp, 0x4 + ldr r4, _081B3858 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B3868 + bl pokemon_change_order + ldr r1, _081B385C + ldrb r2, [r4, 0x9] + ldr r0, _081B3860 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _081B3864 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _081B3880 + .align 2, 0 +_081B3858: .4byte 0x0203cec8 +_081B385C: .4byte 0x020244ec +_081B3860: .4byte 0x020244e9 +_081B3864: .4byte sub_81B3894 + 1 +_081B3868: + ldr r1, _081B3888 + ldrb r2, [r4, 0x9] + ldr r0, _081B388C + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _081B3890 + str r0, [sp] + movs r0, 0 + bl sub_81BF8EC +_081B3880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3888: .4byte 0x020244ec +_081B388C: .4byte 0x020244e9 +_081B3890: .4byte sub_81B3894 + 1 + thumb_func_end sub_81B3828 + + thumb_func_start sub_81B3894 +sub_81B3894: @ 81B3894 + push {lr} + sub sp, 0xC + ldr r2, _081B38CC + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, _081B38D0 + ldr r0, _081B38D4 + ldrb r0, [r0] + strb r0, [r3, 0x9] + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, _081B38D8 + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B38CC: .4byte 0x02037fd4 +_081B38D0: .4byte 0x0203cec8 +_081B38D4: .4byte 0x0203cf20 +_081B38D8: .4byte sub_81B36FC + 1 + thumb_func_end sub_81B3894 + + thumb_func_start brm_switch +brm_switch: @ 81B38DC + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x5 + bl audio_play + ldr r5, _081B3928 + movs r0, 0x8 + strb r0, [r5, 0xB] + ldr r4, _081B392C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x3 + bl sub_81B3054 + ldrb r0, [r5, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r5, 0x9] + strb r0, [r5, 0xA] + ldr r1, _081B3930 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B3934 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B3928: .4byte 0x0203cec8 +_081B392C: .4byte 0x0203cec4 +_081B3930: .4byte 0x03005e00 +_081B3934: .4byte sub_81B1370 + 1 + thumb_func_end brm_switch + + thumb_func_start sub_81B3938 +sub_81B3938: @ 81B3938 + 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, _081B3960 + adds r6, r0, r1 + ldr r3, _081B3964 + movs r1, 0xA + ldrsb r1, [r3, r1] + movs r0, 0x9 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _081B3968 + adds r0, r7, 0 + bl sub_81B407C + b _081B3ABA + .align 2, 0 +_081B3960: .4byte 0x03005e08 +_081B3964: .4byte 0x0203cec8 +_081B3968: + add r2, sp, 0x8 + movs r0, 0x9 + ldrsb r0, [r3, r0] + ldr r1, _081B39C0 + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2] + adds r0, r2, 0 + ldrb r0, [r0] + movs r1, 0x1 + bl Window_GetField + strh r0, [r6] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_GetField + strh r0, [r6, 0x2] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_GetField + strh r0, [r6, 0x4] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x4 + bl Window_GetField + strh r0, [r6, 0x6] + strh r4, [r6, 0x10] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B39C4 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B39C6 + .align 2, 0 +_081B39C0: .4byte 0x0203cedc +_081B39C4: + movs r0, 0x1 +_081B39C6: + strh r0, [r6, 0x14] + add r2, sp, 0x8 + ldr r0, _081B3A24 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + ldr r1, _081B3A28 + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2, 0x1] + adds r0, r2, 0 + ldrb r0, [r0, 0x1] + movs r1, 0x1 + bl Window_GetField + strh r0, [r6, 0x8] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x2 + bl Window_GetField + strh r0, [r6, 0xA] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x3 + bl Window_GetField + strh r0, [r6, 0xC] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x4 + bl Window_GetField + strh r0, [r6, 0xE] + strh r4, [r6, 0x12] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B3A2C + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B3A2E + .align 2, 0 +_081B3A24: .4byte 0x0203cec8 +_081B3A28: .4byte 0x0203cedc +_081B3A2C: + movs r0, 0x1 +_081B3A2E: + strh r0, [r6, 0x16] + ldr r4, _081B3AC4 + movs r0, 0x4 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl malloc + str r0, [r4] + ldr r5, _081B3AC8 + movs r0, 0xC + ldrsh r1, [r6, r0] + movs r2, 0xE + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl malloc + str r0, [r5] + ldr r1, [r4] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r1, [r5] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + add r0, sp, 0x8 + ldrb r0, [r0] + bl Window_FillTileMap + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl Window_FillTileMap + ldr r4, _081B3ACC + movs r0, 0x9 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r7, 0 + bl sub_81B3CC0 + ldr r1, _081B3AD0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B3AD4 + str r1, [r0] +_081B3ABA: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B3AC4: .4byte 0x0203cef0 +_081B3AC8: .4byte 0x0203cef4 +_081B3ACC: .4byte 0x0203cec8 +_081B3AD0: .4byte 0x03005e00 +_081B3AD4: .4byte sub_81B3D48 + 1 + thumb_func_end sub_81B3938 + + thumb_func_start sub_81B3AD8 +sub_81B3AD8: @ 81B3AD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r2, 0 + mov r12, r3 + ldr r7, [sp, 0x18] + lsls r0, 16 + lsrs r3, r0, 16 + adds r5, r3, 0 + lsls r1, 16 + lsrs r2, r1, 16 + mov r8, r2 + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r2, 16 + asrs r0, 16 + adds r4, r1, r0 + cmp r4, 0 + blt _081B3B02 + cmp r1, 0x1F + ble _081B3B06 +_081B3B02: + movs r0, 0 + b _081B3B34 +_081B3B06: + cmp r1, 0 + bge _081B3B1A + negs r0, r1 + strb r0, [r6] + movs r0, 0 + mov r1, r12 + strb r0, [r1] + adds r0, r2, r3 + strb r0, [r7] + b _081B3B32 +_081B3B1A: + movs r0, 0 + strb r0, [r6] + mov r0, r12 + strb r5, [r0] + cmp r4, 0x1F + ble _081B3B2E + movs r0, 0x20 + subs r0, r5 + strb r0, [r7] + b _081B3B32 +_081B3B2E: + mov r1, r8 + strb r1, [r7] +_081B3B32: + movs r0, 0x1 +_081B3B34: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B3AD8 + + thumb_func_start sub_81B3B40 +sub_81B3B40: @ 81B3B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + str r0, [sp, 0x28] + ldr r0, [sp, 0x54] + ldr r4, [sp, 0x58] + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x30] + lsls r1, 16 + asrs r7, r1, 16 + lsrs r0, r3, 16 + str r0, [sp, 0x2C] + asrs r3, 16 + mov r8, r3 + mov r5, sp + adds r5, 0x25 + mov r6, sp + adds r6, 0x26 + str r6, [sp] + adds r0, r7, 0 + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + ldrb r2, [r5] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r6] + str r0, [sp] + mov r1, r10 + lsls r0, r1, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + mov r3, r9 + bl bg_fill_tilemap_rect + ldr r1, [sp, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + adds r0, r7, r0 + lsls r0, 16 + asrs r0, 16 + str r6, [sp] + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + add r0, sp, 0x24 + ldrb r2, [r0] + ldr r1, [sp, 0x2C] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + ldrb r0, [r5] + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldrb r0, [r6] + str r0, [sp, 0x10] + str r4, [sp, 0x14] + movs r0, 0x11 + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + ldr r1, [sp, 0x28] + movs r3, 0 + bl bg_copy_tilemap_rect +_081B3BFA: + 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_81B3B40 + + thumb_func_start sub_81B3C0C +sub_81B3C0C: @ 81B3C0C + push {r4,lr} + ldr r4, _081B3C5C + ldrb r2, [r0, 0xB] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + lsls r1, 16 + asrs r1, 13 + ldrh r2, [r3, 0x24] + adds r2, r1 + strh r2, [r3, 0x24] + ldrb r3, [r0, 0xA] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r3, [r0, 0x9] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r2, [r0, 0xC] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r2, [r0, 0x24] + adds r2, r1 + strh r2, [r0, 0x24] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3C5C: .4byte 0x02020630 + thumb_func_end sub_81B3C0C + + thumb_func_start sub_81B3C60 +sub_81B3C60: @ 81B3C60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081B3CB4 + adds r4, r1, r0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3C8E + ldr r2, _081B3CB8 + ldr r0, _081B3CBC + movs r1, 0x9 + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3C8E: + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3CAC + ldr r2, _081B3CB8 + ldr r0, _081B3CBC + movs r1, 0xA + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3CAC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B3CB4: .4byte 0x03005e08 +_081B3CB8: .4byte 0x0203cedc +_081B3CBC: .4byte 0x0203cec8 + thumb_func_end sub_81B3C60 + + thumb_func_start sub_81B3CC0 +sub_81B3CC0: @ 81B3CC0 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081B3D3C + adds r5, r1, r0 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D00 + ldr r0, _081B3D40 + ldr r0, [r0] + ldrh r1, [r5, 0x10] + ldrh r2, [r5] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0x2 + ldrsh r2, [r5, r3] + movs r4, 0x4 + ldrsh r3, [r5, r4] + movs r6, 0x6 + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x14 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D00: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D2E + ldr r0, _081B3D44 + ldr r0, [r0] + ldrh r1, [r5, 0x12] + ldrh r2, [r5, 0x8] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0xA + ldrsh r2, [r5, r3] + movs r4, 0xC + ldrsh r3, [r5, r4] + movs r6, 0xE + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x16 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D2E: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B3D3C: .4byte 0x03005e08 +_081B3D40: .4byte 0x0203cef0 +_081B3D44: .4byte 0x0203cef4 + thumb_func_end sub_81B3CC0 + + thumb_func_start sub_81B3D48 +sub_81B3D48: @ 81B3D48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r7, r0, 3 + ldr r0, _081B3E48 + mov r8, r0 + adds r6, r7, r0 + adds r0, r4, 0 + bl sub_81B3CC0 + adds r0, r4, 0 + bl sub_81B3C60 + ldrh r1, [r6, 0x14] + ldrh r2, [r6, 0x10] + adds r1, r2 + strh r1, [r6, 0x10] + ldrh r0, [r6, 0x16] + ldrh r3, [r6, 0x12] + adds r0, r3 + strh r0, [r6, 0x12] + add r2, sp, 0x8 + ldrh r0, [r6] + adds r0, r1 + strh r0, [r2] + adds r1, r2, 0 + ldrh r0, [r6, 0x12] + ldrh r3, [r6, 0x8] + adds r2, r0, r3 + strh r2, [r1, 0x2] + adds r0, r1, 0 + ldrh r0, [r0] + cmp r0, 0x21 + bls _081B3E3A + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x21 + bls _081B3E3A + movs r1, 0x14 + ldrsh r0, [r6, r1] + negs r0, r0 + strh r0, [r6, 0x14] + movs r2, 0x16 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x16] + bl swap_pokemon_and_oams + ldr r4, _081B3E4C + ldrb r0, [r4, 0x9] + bl sub_81B0948 + ldrb r0, [r4, 0xA] + bl sub_81B0948 + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r5, _081B3E50 + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl Window_WriteStandardTileMap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl Window_WriteStandardTileMap + ldr r0, _081B3E54 + ldr r1, [r0] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r0, _081B3E58 + ldr r1, [r0] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl Window_FillTileMap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl Window_FillTileMap + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _081B3E5C + str r1, [r0] +_081B3E3A: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B3E48: .4byte 0x03005e08 +_081B3E4C: .4byte 0x0203cec8 +_081B3E50: .4byte 0x0203cedc +_081B3E54: .4byte 0x0203cef0 +_081B3E58: .4byte 0x0203cef4 +_081B3E5C: .4byte sub_81B3E60 + 1 + thumb_func_end sub_81B3D48 + + thumb_func_start sub_81B3E60 +sub_81B3E60: @ 81B3E60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, _081B3ED0 + adds r4, r0, r1 + adds r0, r6, 0 + bl sub_81B3CC0 + adds r0, r6, 0 + bl sub_81B3C60 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3EE4 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081B3EE4 + ldr r5, _081B3ED4 + movs r0, 0x9 + ldrsb r0, [r5, r0] + ldr r4, _081B3ED8 + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl Window_WriteStandardTileMap + movs r0, 0xA + ldrsb r0, [r5, r0] + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl Window_WriteStandardTileMap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _081B3EDC + ldr r0, [r0] + bl free + ldr r0, _081B3EE0 + ldr r0, [r0] + bl free + adds r0, r6, 0 + bl sub_81B407C + b _081B3F08 + .align 2, 0 +_081B3ED0: .4byte 0x03005e08 +_081B3ED4: .4byte 0x0203cec8 +_081B3ED8: .4byte 0x0203cedc +_081B3EDC: .4byte 0x0203cef0 +_081B3EE0: .4byte 0x0203cef4 +_081B3EE4: + ldrh r1, [r4, 0x14] + ldrh r0, [r4, 0x10] + adds r1, r0 + strh r1, [r4, 0x10] + ldrh r0, [r4, 0x16] + ldrh r2, [r4, 0x12] + adds r0, r2 + strh r0, [r4, 0x12] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + bne _081B3EFE + strh r1, [r4, 0x14] +_081B3EFE: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3F08 + strh r0, [r4, 0x16] +_081B3F08: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B3E60 + + thumb_func_start oamt_swap_pos +oamt_swap_pos: @ 81B3F10 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldrb r3, [r0] + ldrb r2, [r1] + strb r2, [r0] + strb r3, [r1] + ldr r5, _081B3FD8 + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrh r6, [r3, 0x20] + ldrh r2, [r3, 0x22] + mov r8, r2 + ldrh r2, [r3, 0x24] + mov r9, r2 + ldrh r2, [r3, 0x26] + mov r10, r2 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x20] + strh r2, [r3, 0x20] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x22] + strh r2, [r3, 0x22] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x24] + strh r2, [r3, 0x24] + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldrb r3, [r1] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x26] + strh r0, [r2, 0x26] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r8 + strh r2, [r0, 0x22] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r9 + strh r2, [r0, 0x24] + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r10 + strh r1, [r0, 0x26] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B3FD8: .4byte 0x02020630 + thumb_func_end oamt_swap_pos + + thumb_func_start swap_pokemon_and_oams +swap_pokemon_and_oams: @ 81B3FDC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, _081B4070 + ldr r2, _081B4074 + movs r3, 0x9 + ldrsb r3, [r2, r3] + lsls r0, r3, 4 + ldr r1, [r1] + adds r0, r1, r0 + str r0, [sp] + ldrb r2, [r2, 0xA] + lsls r2, 24 + asrs r2, 24 + lsls r0, r2, 4 + adds r0, r1, r0 + str r0, [sp, 0x4] + movs r1, 0x64 + adds r4, r3, 0 + muls r4, r1 + ldr r0, _081B4078 + adds r4, r0 + adds r5, r2, 0 + muls r5, r1 + adds r5, r0 + movs r0, 0x64 + bl malloc + adds r6, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + bl free + ldr r0, [sp] + adds r0, 0xB + ldr r1, [sp, 0x4] + adds r1, 0xB + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xA + ldr r1, [sp, 0x4] + adds r1, 0xA + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0x9 + ldr r1, [sp, 0x4] + adds r1, 0x9 + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xC + ldr r1, [sp, 0x4] + adds r1, 0xC + bl oamt_swap_pos + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B4070: .4byte 0x0203cedc +_081B4074: .4byte 0x0203cec8 +_081B4078: .4byte 0x020244ec + thumb_func_end swap_pokemon_and_oams + + thumb_func_start sub_81B407C +sub_81B407C: @ 81B407C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081B40C4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, _081B40C8 + movs r0, 0 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl sub_81B3054 + ldr r1, _081B40CC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B40D0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B40C4: .4byte 0x0203cec4 +_081B40C8: .4byte 0x0203cec8 +_081B40CC: .4byte 0x03005e00 +_081B40D0: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B407C + + thumb_func_start brm_cancel_1 +brm_cancel_1: @ 81B40D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl audio_play + ldr r4, _081B4108 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, _081B410C + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x6 + bne _081B4110 + movs r0, 0xF + bl sub_81B3054 + b _081B4116 + .align 2, 0 +_081B4108: .4byte 0x0203cec4 +_081B410C: .4byte 0x0203cec8 +_081B4110: + movs r0, 0 + bl sub_81B3054 +_081B4116: + ldr r0, _081B412C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B4130 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B412C: .4byte 0x03005e00 +_081B4130: .4byte sub_81B1370 + 1 + thumb_func_end brm_cancel_1 + + thumb_func_start sub_81B4134 +sub_81B4134: @ 81B4134 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl audio_play + ldr r4, _081B4184 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, _081B4188 + ldr r1, _081B418C + ldrb r1, [r1, 0x9] + movs r2, 0x8 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + movs r0, 0x18 + bl sub_81B3054 + ldr r1, _081B4190 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, _081B4194 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B4184: .4byte 0x0203cec4 +_081B4188: .4byte 0x020244ec +_081B418C: .4byte 0x0203cec8 +_081B4190: .4byte 0x03005e00 +_081B4194: .4byte sub_81B3730 + 1 + thumb_func_end sub_81B4134 + + thumb_func_start sub_81B4198 +sub_81B4198: @ 81B4198 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + ldr r0, _081B41BC + ldr r1, [r0] + ldr r0, _081B41C0 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B41BC: .4byte 0x0203cec4 +_081B41C0: .4byte sub_81B41C4 + 1 + thumb_func_end sub_81B4198 + + thumb_func_start sub_81B41C4 +sub_81B41C4: @ 81B41C4 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _081B41E0 + ldr r2, _081B41DC + movs r0, 0x2 + movs r1, 0x5 + bl sub_81AAC90 + b _081B41E8 + .align 2, 0 +_081B41DC: .4byte c2_8123744 + 1 +_081B41E0: + ldr r1, _081B41EC + movs r0, 0x2 + bl sub_81C4F98 +_081B41E8: + pop {r0} + bx r0 + .align 2, 0 +_081B41EC: .4byte c2_8123744 + 1 + thumb_func_end sub_81B41C4 + + thumb_func_start c2_8123744 +c2_8123744: @ 81B41F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, _081B4218 + ldrh r0, [r6] + cmp r0, 0 + bne _081B4224 + ldr r3, _081B421C + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, _081B4220 + str r1, [sp, 0x4] + ldr r1, [r3] + b _081B425A + .align 2, 0 +_081B4218: .4byte 0x0203ce7c +_081B421C: .4byte 0x0203cec8 +_081B4220: .4byte sub_81B36FC + 1 +_081B4224: + ldr r4, _081B4268 + ldr r5, _081B426C + movs r0, 0x9 + ldrsb r0, [r5, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, _081B4270 + adds r0, r7 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _081B4278 + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, _081B4274 + str r1, [sp, 0x4] + ldr r1, [r5] +_081B425A: + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B42C0 + .align 2, 0 +_081B4268: .4byte 0x0203cefc +_081B426C: .4byte 0x0203cec8 +_081B4270: .4byte 0x020244ec +_081B4274: .4byte sub_81B4350 + 1 +_081B4278: + ldrh r0, [r6] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B42A4 + ldrh r0, [r6] + movs r1, 0x1 + bl sub_80D6AA4 + movs r0, 0x9 + ldrsb r0, [r5, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r6] + bl sub_81B1DB8 + bl sub_81B452C + b _081B42C0 +_081B42A4: + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, _081B42CC + str r1, [sp, 0x4] + ldr r1, [r5] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B42C0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B42CC: .4byte sub_81B42D0 + 1 + thumb_func_end c2_8123744 + + thumb_func_start sub_81B42D0 +sub_81B42D0: @ 81B42D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081B4338 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B432C + ldr r0, _081B433C + ldrh r4, [r0] + ldr r0, _081B4340 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r5, _081B4344 + adds r0, r5 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r5 + adds r1, r4, 0 + bl sub_81B1DB8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D6AA4 + ldr r1, _081B4348 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B434C + str r1, [r0] +_081B432C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B4338: .4byte 0x02037fd4 +_081B433C: .4byte 0x0203ce7c +_081B4340: .4byte 0x0203cec8 +_081B4344: .4byte 0x020244ec +_081B4348: .4byte 0x03005e00 +_081B434C: .4byte sub_81B469C + 1 + thumb_func_end sub_81B42D0 + + thumb_func_start sub_81B4350 +sub_81B4350: @ 81B4350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B4390 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B4388 + ldr r0, _081B4394 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B4398 + adds r0, r1 + ldr r1, _081B439C + ldrh r1, [r1] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, _081B43A0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B43A4 + str r1, [r0] +_081B4388: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4390: .4byte 0x02037fd4 +_081B4394: .4byte 0x0203cec8 +_081B4398: .4byte 0x020244ec +_081B439C: .4byte 0x0203cefc +_081B43A0: .4byte 0x03005e00 +_081B43A4: .4byte sub_81B43A8 + 1 + thumb_func_end sub_81B4350 + + thumb_func_start sub_81B43A8 +sub_81B43A8: @ 81B43A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B43CC + bl sub_81B334C + ldr r0, _081B43D4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B43D8 + str r0, [r1] +_081B43CC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B43D4: .4byte 0x03005e00 +_081B43D8: .4byte sub_81B43DC + 1 + thumb_func_end sub_81B43A8 + + thumb_func_start sub_81B43DC +sub_81B43DC: @ 81B43DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4402 + cmp r1, 0 + bgt _081B43FC + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B44D8 + b _081B44EC +_081B43FC: + cmp r1, 0x1 + beq _081B44DE + b _081B44EC +_081B4402: + ldr r5, _081B4444 + ldrh r0, [r5] + movs r1, 0x1 + bl sub_80D6AA4 + ldr r6, _081B4448 + ldrh r0, [r6] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _081B4458 + ldrh r0, [r5] + movs r1, 0x1 + bl bag_add_item + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, _081B444C + movs r1, 0 + bl sub_81B1B5C + ldr r1, _081B4450 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4454 + str r1, [r0] + b _081B44EC + .align 2, 0 +_081B4444: .4byte 0x0203ce7c +_081B4448: .4byte 0x0203cefc +_081B444C: .4byte 0x02021fc4 +_081B4450: .4byte 0x03005e00 +_081B4454: .4byte sub_81B1C1C + 1 +_081B4458: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B4498 + ldr r0, _081B4488 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B448C + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldr r1, _081B4490 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4494 + str r1, [r0] + b _081B44EC + .align 2, 0 +_081B4488: .4byte 0x0203cec8 +_081B448C: .4byte 0x020244ec +_081B4490: .4byte 0x03005e00 +_081B4494: .4byte sub_81B44FC + 1 +_081B4498: + ldr r0, _081B44C8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B44CC + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldrh r0, [r5] + ldrh r1, [r6] + movs r2, 0x1 + bl sub_81B1D68 + ldr r1, _081B44D0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B44D4 + str r1, [r0] + b _081B44EC + .align 2, 0 +_081B44C8: .4byte 0x0203cec8 +_081B44CC: .4byte 0x020244ec +_081B44D0: .4byte 0x03005e00 +_081B44D4: .4byte sub_81B469C + 1 +_081B44D8: + movs r0, 0x5 + bl audio_play +_081B44DE: + ldr r0, _081B44F4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B44F8 + str r0, [r1] +_081B44EC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B44F4: .4byte 0x03005e00 +_081B44F8: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B43DC + + thumb_func_start sub_81B44FC +sub_81B44FC: @ 81B44FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B451C + ldr r0, _081B4524 + ldr r1, [r0] + ldr r0, _081B4528 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B451C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4524: .4byte 0x0203cec4 +_081B4528: .4byte sub_81B452C + 1 + thumb_func_end sub_81B44FC + + thumb_func_start sub_81B452C +sub_81B452C: @ 81B452C + push {lr} + ldr r0, _081B4564 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B4568 + adds r0, r1 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B456C + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, _081B4570 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, _081B4574 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .align 2, 0 +_081B4564: .4byte 0x0203cec8 +_081B4568: .4byte 0x020244ec +_081B456C: .4byte 0x03005d8c +_081B4570: .4byte 0x00002be0 +_081B4574: .4byte sub_81B4578 + 1 + thumb_func_end sub_81B452C + + thumb_func_start sub_81B4578 +sub_81B4578: @ 81B4578 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, _081B45E4 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B45E8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _081B45EC + ldrh r7, [r0] + cmp r7, 0 + bne _081B45F8 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, _081B45F0 + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl pokemon_setattr + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6AA4 + mov r0, r8 + movs r1, 0x1 + bl bag_add_item + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + str r7, [sp] + ldr r1, _081B45F4 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B4614 + .align 2, 0 +_081B45E4: .4byte 0x0203cec8 +_081B45E8: .4byte 0x020244ec +_081B45EC: .4byte 0x020375f0 +_081B45F0: .4byte 0x0203cefc +_081B45F4: .4byte sub_81B36FC + 1 +_081B45F8: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, _081B4620 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B4614: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B4620: .4byte sub_81B4624 + 1 + thumb_func_end sub_81B4578 + + thumb_func_start sub_81B4624 +sub_81B4624: @ 81B4624 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B465C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B468A + ldr r1, _081B4660 + ldrh r0, [r1] + cmp r0, 0 + bne _081B4670 + ldr r0, _081B4664 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B4668 + adds r0, r1 + ldr r1, _081B466C + ldrh r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + b _081B467C + .align 2, 0 +_081B465C: .4byte 0x02037fd4 +_081B4660: .4byte 0x0203cefc +_081B4664: .4byte 0x0203cec8 +_081B4668: .4byte 0x020244ec +_081B466C: .4byte 0x0203ce7c +_081B4670: + ldr r0, _081B4690 + ldrh r0, [r0] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 +_081B467C: + ldr r0, _081B4694 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B4698 + str r0, [r1] +_081B468A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4690: .4byte 0x0203ce7c +_081B4694: .4byte 0x03005e00 +_081B4698: .4byte sub_81B469C + 1 + thumb_func_end sub_81B4624 + + thumb_func_start sub_81B469C +sub_81B469C: @ 81B469C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _081B46F8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B46FC + adds r6, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B471C + ldr r5, _081B4700 + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + adds r0, r6, 0 + bl sub_81B5C94 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + bne _081B4716 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + beq _081B4704 + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xB + movs r2, 0x1 + bl sub_81B2FA8 + b _081B4716 + .align 2, 0 +_081B46F8: .4byte 0x0203cec8 +_081B46FC: .4byte 0x020244ec +_081B4700: .4byte 0x0203cedc +_081B4704: + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 +_081B4716: + adds r0, r7, 0 + bl sub_81B1C1C +_081B471C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B469C + + thumb_func_start sub_81B4724 +sub_81B4724: @ 81B4724 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081B477C + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B4780 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl audio_play + ldr r4, _081B4784 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B1E00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B4788 + cmp r0, 0x1 + beq _081B47AC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_81B1CD0 + b _081B47BA + .align 2, 0 +_081B477C: .4byte 0x0203cec8 +_081B4780: .4byte 0x020244ec +_081B4784: .4byte 0x0203cec4 +_081B4788: + ldr r1, _081B47A0 + adds r0, r5, 0 + bl sub_81B1B44 + ldr r4, _081B47A4 + ldr r1, _081B47A8 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + b _081B47B4 + .align 2, 0 +_081B47A0: .4byte 0x02021cc4 +_081B47A4: .4byte 0x02021fc4 +_081B47A8: .4byte 0x085e9980 +_081B47AC: + adds r0, r6, 0 + bl pokemon_item_not_removed + ldr r0, _081B47D4 +_081B47B4: + movs r1, 0x1 + bl sub_81B1B5C +_081B47BA: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _081B47D8 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B47DC + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B47D4: .4byte 0x02021fc4 +_081B47D8: .4byte 0x03005e00 +_081B47DC: .4byte sub_81B469C + 1 + thumb_func_end sub_81B4724 + + thumb_func_start sub_81B47E0 +sub_81B47E0: @ 81B47E0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _081B4844 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B4848 + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x5 + bl audio_play + ldr r4, _081B484C + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + cmp r5, 0 + bne _081B4864 + ldr r1, _081B4850 + adds r0, r7, 0 + bl sub_81B1B44 + ldr r4, _081B4854 + ldr r1, _081B4858 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B485C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4860 + b _081B488A + .align 2, 0 +_081B4844: .4byte 0x0203cec8 +_081B4848: .4byte 0x020244ec +_081B484C: .4byte 0x0203cec4 +_081B4850: .4byte 0x02021cc4 +_081B4854: .4byte 0x02021fc4 +_081B4858: .4byte 0x085e9980 +_081B485C: .4byte 0x03005e00 +_081B4860: .4byte sub_81B469C + 1 +_081B4864: + ldr r1, _081B4894 + adds r0, r5, 0 + bl itemid_get_name + ldr r4, _081B4898 + ldr r1, _081B489C + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B48A0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B48A4 +_081B488A: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B4894: .4byte 0x02021cc4 +_081B4898: .4byte 0x02021fc4 +_081B489C: .4byte 0x085e9e00 +_081B48A0: .4byte 0x03005e00 +_081B48A4: .4byte sub_81B48A8 + 1 + thumb_func_end sub_81B47E0 + + thumb_func_start sub_81B48A8 +sub_81B48A8: @ 81B48A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B48CC + bl sub_81B334C + ldr r0, _081B48D4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B48D8 + str r0, [r1] +_081B48CC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B48D4: .4byte 0x03005e00 +_081B48D8: .4byte sub_81B48DC + 1 + thumb_func_end sub_81B48A8 + + thumb_func_start sub_81B48DC +sub_81B48DC: @ 81B48DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B490C + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B4910 + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B491A + cmp r1, 0 + bgt _081B4914 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4964 + b _081B4978 + .align 2, 0 +_081B490C: .4byte 0x0203cec8 +_081B4910: .4byte 0x020244ec +_081B4914: + cmp r1, 0x1 + beq _081B496A + b _081B4978 +_081B491A: + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, _081B4950 + bl itemid_get_name + ldr r4, _081B4954 + ldr r1, _081B4958 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + ldr r1, _081B495C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4960 + str r1, [r0] + b _081B4978 + .align 2, 0 +_081B4950: .4byte 0x02021cc4 +_081B4954: .4byte 0x02021fc4 +_081B4958: .4byte 0x085e9e14 +_081B495C: .4byte 0x03005e00 +_081B4960: .4byte sub_81B4988 + 1 +_081B4964: + movs r0, 0x5 + bl audio_play +_081B496A: + ldr r0, _081B4980 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B4984 + str r0, [r1] +_081B4978: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B4980: .4byte 0x03005e00 +_081B4984: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B48DC + + thumb_func_start sub_81B4988 +sub_81B4988: @ 81B4988 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, _081B49F4 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B49F8 + adds r5, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B49EC + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + ldr r4, _081B49FC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl sub_81B5C94 + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 + ldr r1, _081B4A00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4A04 + str r1, [r0] +_081B49EC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B49F4: .4byte 0x0203cec8 +_081B49F8: .4byte 0x020244ec +_081B49FC: .4byte 0x0203cedc +_081B4A00: .4byte 0x03005e00 +_081B4A04: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B4988 + + thumb_func_start sub_81B4A08 +sub_81B4A08: @ 81B4A08 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl audio_play + ldr r4, _081B4A58 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, _081B4A5C + ldr r1, _081B4A60 + ldrb r1, [r1, 0x9] + movs r2, 0x9 + bl sub_81B33B4 + movs r0, 0x2 + bl sub_81B31B0 + movs r0, 0x19 + bl sub_81B3054 + ldr r1, _081B4A64 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, _081B4A68 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B4A58: .4byte 0x0203cec4 +_081B4A5C: .4byte 0x020244ec +_081B4A60: .4byte 0x0203cec8 +_081B4A64: .4byte 0x03005e00 +_081B4A68: .4byte sub_81B3730 + 1 + thumb_func_end sub_81B4A08 + + thumb_func_start sub_81B4A6C +sub_81B4A6C: @ 81B4A6C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + ldr r0, _081B4A90 + ldr r1, [r0] + ldr r0, _081B4A94 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4A90: .4byte 0x0203cec4 +_081B4A94: .4byte sub_81B4A98 + 1 + thumb_func_end sub_81B4A6C + + thumb_func_start sub_81B4A98 +sub_81B4A98: @ 81B4A98 + push {lr} + ldr r0, _081B4ACC + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B4AD0 + adds r0, r1 + movs r1, 0x40 + bl pokemon_getattr + ldr r2, _081B4AD4 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _081B4AD8 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, _081B4ADC + movs r2, 0x1 + bl sub_8121478 + pop {r0} + bx r0 + .align 2, 0 +_081B4ACC: .4byte 0x0203cec8 +_081B4AD0: .4byte 0x020244ec +_081B4AD4: .4byte 0x03005d8c +_081B4AD8: .4byte 0x00002be0 +_081B4ADC: .4byte sub_81B4AE0 + 1 + thumb_func_end sub_81B4A98 + + thumb_func_start sub_81B4AE0 +sub_81B4AE0: @ 81B4AE0 + push {lr} + sub sp, 0xC + ldr r2, _081B4B14 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, _081B4B18 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, _081B4B1C + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B4B14: .4byte 0x02037fd4 +_081B4B18: .4byte 0x0203cec8 +_081B4B1C: .4byte sub_81B36FC + 1 + thumb_func_end sub_81B4AE0 + + thumb_func_start brm_take_2 +brm_take_2: @ 81B4B20 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + ldr r5, _081B4B5C + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, _081B4B60 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B4B64 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4B68 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B4B5C: .4byte 0x0203cec4 +_081B4B60: .4byte 0x085e9855 +_081B4B64: .4byte 0x03005e00 +_081B4B68: .4byte sub_81B4B6C + 1 + thumb_func_end brm_take_2 + + thumb_func_start sub_81B4B6C +sub_81B4B6C: @ 81B4B6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4B90 + bl sub_81B334C + ldr r0, _081B4B98 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B4B9C + str r0, [r1] +_081B4B90: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4B98: .4byte 0x03005e00 +_081B4B9C: .4byte sub_81B4BA0 + 1 + thumb_func_end sub_81B4B6C + + thumb_func_start sub_81B4BA0 +sub_81B4BA0: @ 81B4BA0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4BC6 + cmp r1, 0 + bgt _081B4BC0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4C30 + b _081B4C4C +_081B4BC0: + cmp r1, 0x1 + beq _081B4C36 + b _081B4C4C +_081B4BC6: + ldr r0, _081B4BF8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B4BFC + adds r0, r1 + bl sub_80D4700 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B4C0C + ldr r0, _081B4C00 + movs r1, 0 + bl sub_81B1B5C + ldr r1, _081B4C04 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4C08 + b _081B4C4A + .align 2, 0 +_081B4BF8: .4byte 0x0203cec8 +_081B4BFC: .4byte 0x020244ec +_081B4C00: .4byte 0x085e9877 +_081B4C04: .4byte 0x03005e00 +_081B4C08: .4byte sub_81B469C + 1 +_081B4C0C: + ldr r0, _081B4C24 + movs r1, 0 + bl sub_81B1B5C + ldr r1, _081B4C28 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4C2C + b _081B4C4A + .align 2, 0 +_081B4C24: .4byte 0x085e9897 +_081B4C28: .4byte 0x03005e00 +_081B4C2C: .4byte sub_81B1C1C + 1 +_081B4C30: + movs r0, 0x5 + bl audio_play +_081B4C36: + ldr r0, _081B4C54 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B4C58 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4C5C +_081B4C4A: + str r1, [r0] +_081B4C4C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4C54: .4byte 0x085e98b4 +_081B4C58: .4byte 0x03005e00 +_081B4C5C: .4byte sub_81B4C60 + 1 + thumb_func_end sub_81B4BA0 + + thumb_func_start sub_81B4C60 +sub_81B4C60: @ 81B4C60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4C84 + bl sub_81B334C + ldr r0, _081B4C8C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B4C90 + str r0, [r1] +_081B4C84: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4C8C: .4byte 0x03005e00 +_081B4C90: .4byte sub_81B4C94 + 1 + thumb_func_end sub_81B4C60 + + thumb_func_start sub_81B4C94 +sub_81B4C94: @ 81B4C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4CBE + cmp r1, 0 + bgt _081B4CB8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4D50 + b _081B4D64 +_081B4CB8: + cmp r1, 0x1 + beq _081B4D56 + b _081B4D64 +_081B4CBE: + ldr r0, _081B4D10 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, _081B4D14 + adds r0, r6 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4D24 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r7 + adds r0, r6 + bl sub_80D4680 + ldr r0, _081B4D18 + movs r1, 0 + bl sub_81B1B5C + ldr r1, _081B4D1C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4D20 + str r1, [r0] + b _081B4D64 + .align 2, 0 +_081B4D10: .4byte 0x0203cec8 +_081B4D14: .4byte 0x020244ec +_081B4D18: .4byte 0x085e99b8 +_081B4D1C: .4byte 0x03005e00 +_081B4D20: .4byte sub_81B469C + 1 +_081B4D24: + adds r0, r4, 0 + bl pokemon_item_not_removed + ldr r0, _081B4D44 + movs r1, 0 + bl sub_81B1B5C + ldr r1, _081B4D48 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4D4C + str r1, [r0] + b _081B4D64 + .align 2, 0 +_081B4D44: .4byte 0x02021fc4 +_081B4D48: .4byte 0x03005e00 +_081B4D4C: .4byte sub_81B1C1C + 1 +_081B4D50: + movs r0, 0x5 + bl audio_play +_081B4D56: + ldr r0, _081B4D70 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B4D74 + str r0, [r1] +_081B4D64: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B4D70: .4byte 0x03005e00 +_081B4D74: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B4C94 + + thumb_func_start sub_81B4D78 +sub_81B4D78: @ 81B4D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, _081B4DD8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r6, _081B4DDC + adds r7, r0, r6 + movs r0, 0x5 + bl audio_play + ldr r4, _081B4DE0 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B33B4 + ldrb r1, [r5, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B4DE4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl sub_81B3054 + b _081B4E02 + .align 2, 0 +_081B4DD8: .4byte 0x0203cec8 +_081B4DDC: .4byte 0x020244ec +_081B4DE0: .4byte 0x0203cec4 +_081B4DE4: + movs r0, 0x1 + bl sub_81B31B0 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, _081B4E20 + bl itemid_get_name + movs r0, 0x1A + bl sub_81B3054 +_081B4E02: + ldr r1, _081B4E24 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, _081B4E28 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B4E20: .4byte 0x02021dc4 +_081B4E24: .4byte 0x03005e00 +_081B4E28: .4byte sub_81B3730 + 1 + thumb_func_end sub_81B4D78 + + thumb_func_start brm_shift_sendout +brm_shift_sendout: @ 81B4E2C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl audio_play + ldr r5, _081B4E58 + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + bl sub_81B8A7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4E5C + adds r0, r4, 0 + bl sub_81B12C0 + b _081B4E7A + .align 2, 0 +_081B4E58: .4byte 0x0203cec4 +_081B4E5C: + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, _081B4E80 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B4E84 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4E88 + str r1, [r0] +_081B4E7A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B4E80: .4byte 0x02021fc4 +_081B4E84: .4byte 0x03005e00 +_081B4E88: .4byte sub_81B1C1C + 1 + thumb_func_end brm_shift_sendout + + thumb_func_start sub_81B4E8C +sub_81B4E8C: @ 81B4E8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, _081B4F14 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _081B4F36 + ldr r2, _081B4F18 + ldr r1, _081B4F1C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r8, r0 +_081B4EC6: + ldr r0, _081B4F20 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0 + bne _081B4F2C + movs r0, 0x5 + str r2, [sp] + bl audio_play + ldr r2, [sp] + ldrb r0, [r2, 0x9] + adds r0, 0x1 + strb r0, [r4] + adds r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B4F24 + ldrb r2, [r2, 0x9] + lsls r2, 24 + asrs r2, 24 + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 + subs r0, r6, 0x1 + cmp r5, r0 + bne _081B4F04 + bl sub_81B4F88 +_081B4F04: + movs r0, 0 + bl sub_81B3054 + ldr r0, _081B4F28 + mov r1, r8 + str r0, [r1] + b _081B4F68 + .align 2, 0 +_081B4F14: .4byte 0x0203cec4 +_081B4F18: .4byte 0x0203cec8 +_081B4F1C: .4byte 0x03005e00 +_081B4F20: .4byte 0x0203cef8 +_081B4F24: .4byte 0x0203cedc +_081B4F28: .4byte sub_81B1370 + 1 +_081B4F2C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _081B4EC6 +_081B4F36: + ldr r0, _081B4F74 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r4, _081B4F78 + ldr r1, _081B4F7C + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x20 + bl audio_play + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B4F80 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B4F84 + str r1, [r0] +_081B4F68: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B4F74: .4byte 0x02021cc4 +_081B4F78: .4byte 0x02021fc4 +_081B4F7C: .4byte 0x085e9830 +_081B4F80: .4byte 0x03005e00 +_081B4F84: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B4E8C + + thumb_func_start sub_81B4F88 +sub_81B4F88: @ 81B4F88 + push {r4,lr} + ldr r4, _081B4FA4 + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + movs r0, 0x6 + strb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B4FA4: .4byte 0x0203cec8 + thumb_func_end sub_81B4F88 + + thumb_func_start sub_81B4FA8 +sub_81B4FA8: @ 81B4FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x5 + bl audio_play + ldr r4, _081B5014 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _081B502A + ldr r6, _081B5018 + subs r2, r5, 0x1 + adds r7, r6, 0 + ldr r3, _081B501C +_081B4FE2: + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x9 + ldrsb r0, [r3, r0] + adds r0, 0x1 + cmp r1, r0 + bne _081B5020 + adds r0, r4, 0 + adds r4, r2, 0 + cmp r0, r4 + bge _081B500C + adds r3, r7, 0 +_081B4FFA: + adds r2, r0, r3 + adds r1, r0, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, r4 + blt _081B4FFA +_081B500C: + adds r1, r0, r6 + movs r0, 0 + strb r0, [r1] + b _081B502A + .align 2, 0 +_081B5014: .4byte 0x0203cec4 +_081B5018: .4byte 0x0203cef8 +_081B501C: .4byte 0x0203cec8 +_081B5020: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081B4FE2 +_081B502A: + ldr r6, _081B5098 + ldr r0, _081B509C + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + lsls r0, 4 + ldr r1, [r6] + adds r1, r0 + movs r0, 0x1 + movs r2, 0x1 + bl sub_81B2FA8 + movs r4, 0 + subs r5, 0x1 + mov r0, r8 + lsls r7, r0, 2 + cmp r4, r5 + bge _081B5078 +_081B504E: + ldr r0, _081B50A0 + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _081B506E + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1] + lsls r2, 4 + subs r2, 0x10 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 +_081B506E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + blt _081B504E +_081B5078: + movs r0, 0 + bl sub_81B3054 + ldr r0, _081B50A4 + mov r2, r8 + adds r1, r7, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B50A8 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B5098: .4byte 0x0203cedc +_081B509C: .4byte 0x0203cec8 +_081B50A0: .4byte 0x0203cef8 +_081B50A4: .4byte 0x03005e00 +_081B50A8: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B4FA8 + + thumb_func_start sub_81B50AC +sub_81B50AC: @ 81B50AC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B50AC + + thumb_func_start sub_81B50C8 +sub_81B50C8: @ 81B50C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081B5154 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r4, _081B5158 + adds r0, r4 + movs r1, 0x41 + bl pokemon_getattr + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0x50 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_807A8D0 + cmp r0, 0x1 + beq _081B515C + cmp r0, 0x2 + beq _081B5170 + movs r0, 0x5 + bl audio_play + adds r0, r7, 0 + bl sub_81B12C0 + b _081B51B0 + .align 2, 0 +_081B5154: .4byte 0x0203cec8 +_081B5158: .4byte 0x020244ec +_081B515C: + ldr r0, _081B5168 + ldr r1, _081B516C + bl ExpandTextCodes + b _081B5178 + .align 2, 0 +_081B5168: .4byte 0x02021fc4 +_081B516C: .4byte 0x085ea210 +_081B5170: + ldr r0, _081B51BC + ldr r1, _081B51C0 + bl ExpandTextCodes +_081B5178: + movs r0, 0x20 + bl audio_play + ldr r4, _081B51C4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r4, _081B51BC + ldr r1, _081B51C8 + adds r0, r4, 0 + bl gf_strcat + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B51CC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B51D0 + str r1, [r0] +_081B51B0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B51BC: .4byte 0x02021fc4 +_081B51C0: .4byte 0x085ea234 +_081B51C4: .4byte 0x0203cec4 +_081B51C8: .4byte 0x085ea1ca +_081B51CC: .4byte 0x03005e00 +_081B51D0: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B50C8 + + thumb_func_start brm_trade_1 +brm_trade_1: @ 81B51D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081B529C + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, _081B52A0 + adds r0, r4 + movs r1, 0x41 + bl pokemon_getattr + mov r9, r0 + mov r1, r9 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0x50 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + ldr r1, _081B52A4 + ldr r1, [r1] + ldr r2, _081B52A8 + ldrh r3, [r2] + ldr r2, _081B52AC + ldrb r2, [r2] + str r2, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + mov r2, r9 + bl sub_807A7E0 + cmp r0, 0 + beq _081B52C8 + ldr r5, _081B52B0 + ldr r1, _081B52B4 + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl ExpandTextCodes + movs r0, 0x20 + bl audio_play + ldr r4, _081B52B8 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r1, _081B52BC + adds r0, r5, 0 + bl gf_strcat + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B52C0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B52C4 + str r1, [r0] + b _081B52D4 + .align 2, 0 +_081B529C: .4byte 0x0203cec8 +_081B52A0: .4byte 0x020244ec +_081B52A4: .4byte 0x02022c38 +_081B52A8: .4byte 0x02022c3c +_081B52AC: .4byte 0x02022c3e +_081B52B0: .4byte 0x02021fc4 +_081B52B4: .4byte 0x08615e0c +_081B52B8: .4byte 0x0203cec4 +_081B52BC: .4byte 0x085ea1ca +_081B52C0: .4byte 0x03005e00 +_081B52C4: .4byte sub_81B1C1C + 1 +_081B52C8: + movs r0, 0x5 + bl audio_play + adds r0, r7, 0 + bl sub_81B12C0 +_081B52D4: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end brm_trade_1 + + thumb_func_start sub_81B52E4 +sub_81B52E4: @ 81B52E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081B531C + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, _081B5320 + ldr r1, _081B5324 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_807A918 + cmp r0, 0x2 + beq _081B5340 + cmp r0, 0x2 + bgt _081B5328 + cmp r0, 0x1 + beq _081B532E + b _081B5368 + .align 2, 0 +_081B531C: .4byte 0x0203cec4 +_081B5320: .4byte 0x020244ec +_081B5324: .4byte 0x0203cec8 +_081B5328: + cmp r0, 0x3 + beq _081B5354 + b _081B5368 +_081B532E: + ldr r0, _081B5338 + ldr r1, _081B533C + bl ExpandTextCodes + b _081B53C0 + .align 2, 0 +_081B5338: .4byte 0x02021fc4 +_081B533C: .4byte 0x085ea1e8 +_081B5340: + ldr r0, _081B534C + ldr r1, _081B5350 + bl ExpandTextCodes + b _081B53C0 + .align 2, 0 +_081B534C: .4byte 0x02021fc4 +_081B5350: .4byte 0x085ea210 +_081B5354: + ldr r0, _081B5360 + ldr r1, _081B5364 + bl ExpandTextCodes + b _081B53C0 + .align 2, 0 +_081B5360: .4byte 0x02021fc4 +_081B5364: .4byte 0x085ea234 +_081B5368: + movs r0, 0x5 + bl audio_play + ldr r0, _081B53A4 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B53A8 + adds r0, r1 + ldr r1, _081B53AC + bl sub_81B1B44 + ldr r4, _081B53B0 + ldr r1, _081B53B4 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B53B8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B53BC + b _081B53E4 + .align 2, 0 +_081B53A4: .4byte 0x0203cec8 +_081B53A8: .4byte 0x020244ec +_081B53AC: .4byte 0x02021cc4 +_081B53B0: .4byte 0x02021fc4 +_081B53B4: .4byte 0x085ea1cd +_081B53B8: .4byte 0x03005e00 +_081B53BC: .4byte sub_81B53FC + 1 +_081B53C0: + movs r0, 0x20 + bl audio_play + ldr r4, _081B53EC + ldr r1, _081B53F0 + adds r0, r4, 0 + bl gf_strcat + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B53F4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B53F8 +_081B53E4: + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B53EC: .4byte 0x02021fc4 +_081B53F0: .4byte 0x085ea1ca +_081B53F4: .4byte 0x03005e00 +_081B53F8: .4byte sub_81B1C1C + 1 + thumb_func_end sub_81B52E4 + + thumb_func_start sub_81B53FC +sub_81B53FC: @ 81B53FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5420 + bl sub_81B334C + ldr r0, _081B5428 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B542C + str r0, [r1] +_081B5420: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5428: .4byte 0x03005e00 +_081B542C: .4byte sub_81B5430 + 1 + thumb_func_end sub_81B53FC + + thumb_func_start sub_81B5430 +sub_81B5430: @ 81B5430 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B5456 + cmp r1, 0 + bgt _081B5450 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B545E + b _081B546A +_081B5450: + cmp r1, 0x1 + beq _081B5464 + b _081B546A +_081B5456: + adds r0, r4, 0 + bl sub_81B12C0 + b _081B546A +_081B545E: + movs r0, 0x5 + bl audio_play +_081B5464: + adds r0, r4, 0 + bl sub_81B1C1C +_081B546A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5430 + + thumb_func_start sub_81B5470 +sub_81B5470: @ 81B5470 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl GetMenuCursorPos + ldr r5, _081B54DC + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + adds r1, 0xF + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x13 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl audio_play + ldr r1, _081B54E0 + lsls r0, r4, 3 + adds r7, r0, r1 + ldr r0, [r7] + cmp r0, 0 + bne _081B54A2 + b _081B5664 +_081B54A2: + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B54C6 + bl in_trade_center + cmp r0, 0x1 + bne _081B54E8 +_081B54C6: + adds r0, r4, 0 + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B54E4 + movs r0, 0xD + bl sub_81B3054 + b _081B5656 + .align 2, 0 +_081B54DC: .4byte 0x0203cec4 +_081B54E0: .4byte 0x08615d9c +_081B54E4: + ldrb r0, [r7, 0x4] + b _081B5652 +_081B54E8: + cmp r4, 0x7 + bhi _081B5524 + ldr r1, _081B5514 + adds r0, r4, r1 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5524 + ldr r0, _081B5518 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B551C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B5520 + str r1, [r0] + b _081B5664 + .align 2, 0 +_081B5514: .4byte 0x00000867 +_081B5518: .4byte 0x085e97fc +_081B551C: .4byte 0x03005e00 +_081B5520: .4byte sub_81B1C1C + 1 +_081B5524: + ldr r1, _081B554C + lsls r0, r4, 3 + adds r5, r0, r1 + ldr r0, [r5] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B553A + b _081B563C +_081B553A: + subs r0, r4, 0x5 + cmp r0, 0x7 + bhi _081B5624 + lsls r0, 2 + ldr r1, _081B5550 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B554C: .4byte 0x08615d9c +_081B5550: .4byte _081B5554 + .align 2, 0 +_081B5554: + .4byte _081B5614 + .4byte _081B5624 + .4byte _081B5624 + .4byte _081B557C + .4byte _081B55B8 + .4byte _081B5624 + .4byte _081B5574 + .4byte _081B5574 +_081B5574: + adds r0, r6, 0 + bl sub_8161560 + b _081B5664 +_081B557C: + ldr r0, _081B55A8 + ldr r1, [r0] + movs r0, 0x1C + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x1D] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, _081B55AC + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, _081B55B0 + ldr r1, _081B55B4 + b _081B55E8 + .align 2, 0 +_081B55A8: .4byte 0x03005d8c +_081B55AC: .4byte 0x02021cc4 +_081B55B0: .4byte 0x02021fc4 +_081B55B4: .4byte 0x085ea196 +_081B55B8: + ldr r0, _081B5600 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x25 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, _081B5604 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, _081B5608 + ldr r1, _081B560C +_081B55E8: + bl ExpandTextCodes + adds r0, r6, 0 + bl sub_81B5674 + ldr r0, _081B5610 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + strh r4, [r0] + b _081B5664 + .align 2, 0 +_081B5600: .4byte 0x03005d8c +_081B5604: .4byte 0x02021cc4 +_081B5608: .4byte 0x02021fc4 +_081B560C: .4byte 0x085ea16b +_081B5610: .4byte 0x0203cec4 +_081B5614: + ldr r1, _081B561C + ldr r0, _081B5620 + b _081B5628 + .align 2, 0 +_081B561C: .4byte 0x0203cec8 +_081B5620: .4byte sub_8124690 + 1 +_081B5624: + ldr r1, _081B5634 + ldr r0, _081B5638 +_081B5628: + str r0, [r1] + adds r0, r6, 0 + bl sub_81B12C0 + b _081B5664 + .align 2, 0 +_081B5634: .4byte 0x0203cec8 +_081B5638: .4byte c2_exit_to_overworld_2_switch + 1 +_081B563C: + cmp r4, 0x1 + beq _081B564A + cmp r4, 0x4 + bne _081B5650 + bl sub_81B5864 + b _081B5656 +_081B564A: + bl sub_81B57DC + b _081B5656 +_081B5650: + ldrb r0, [r5, 0x4] +_081B5652: + bl sub_81B3054 +_081B5656: + ldr r0, _081B566C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B5670 + str r0, [r1] +_081B5664: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B566C: .4byte 0x03005e00 +_081B5670: .4byte task_brm_cancel_1_on_keypad_a_or_b + 1 + thumb_func_end sub_81B5470 + + thumb_func_start sub_81B5674 +sub_81B5674: @ 81B5674 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081B5698 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B569C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B56A0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5698: .4byte 0x02021fc4 +_081B569C: .4byte 0x03005e00 +_081B56A0: .4byte sub_81B56A4 + 1 + thumb_func_end sub_81B5674 + + thumb_func_start sub_81B56A4 +sub_81B56A4: @ 81B56A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B56C8 + bl sub_81B334C + ldr r0, _081B56D0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B56D4 + str r0, [r1] +_081B56C8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B56D0: .4byte 0x03005e00 +_081B56D4: .4byte sub_81B56D8 + 1 + thumb_func_end sub_81B56A4 + + thumb_func_start sub_81B56D8 +sub_81B56D8: @ 81B56D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B56FE + cmp r1, 0 + bgt _081B56F8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B5714 + b _081B572A +_081B56F8: + cmp r1, 0x1 + beq _081B571A + b _081B572A +_081B56FE: + ldr r1, _081B570C + ldr r0, _081B5710 + str r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B572A + .align 2, 0 +_081B570C: .4byte 0x0203cec8 +_081B5710: .4byte c2_exit_to_overworld_2_switch + 1 +_081B5714: + movs r0, 0x5 + bl audio_play +_081B571A: + ldr r0, _081B5730 + movs r1, 0 + str r1, [r0] + ldr r0, _081B5734 + str r1, [r0] + adds r0, r4, 0 + bl sub_81B1C1C +_081B572A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5730: .4byte 0x03005db0 +_081B5734: .4byte 0x0203ceec + thumb_func_end sub_81B56D8 + + thumb_func_start hm_add_c3_launch_phase_2 +hm_add_c3_launch_phase_2: @ 81B5738 + push {lr} + bl pal_fill_black + ldr r0, _081B574C + movs r1, 0x8 + bl AddTask + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_081B574C: .4byte task_launch_hm_phase_2 + 1 + thumb_func_end hm_add_c3_launch_phase_2 + + thumb_func_start task_launch_hm_phase_2 +task_launch_hm_phase_2: @ 81B5750 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B577C + bl brm_get_selected_species + ldr r1, _081B5784 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + ldr r0, _081B5788 + ldr r0, [r0] + bl _call_via_r0 + adds r0, r4, 0 + bl remove_task +_081B577C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5784: .4byte 0x02038c08 +_081B5788: .4byte 0x0203ceec + thumb_func_end task_launch_hm_phase_2 + + thumb_func_start brm_get_selected_species +brm_get_selected_species: @ 81B578C + push {lr} + ldr r0, _081B57AC + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B57B0 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_081B57AC: .4byte 0x0203cec8 +_081B57B0: .4byte 0x020244ec + thumb_func_end brm_get_selected_species + + thumb_func_start task_brm_cancel_1_on_keypad_a_or_b +task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081B57D8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B57CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B57D4 +_081B57CE: + adds r0, r2, 0 + bl brm_cancel_1 +_081B57D4: + pop {r0} + bx r0 + .align 2, 0 +_081B57D8: .4byte 0x030022c0 + thumb_func_end task_brm_cancel_1_on_keypad_a_or_b + + thumb_func_start sub_81B57DC +sub_81B57DC: @ 81B57DC + push {lr} + ldr r0, _081B57F4 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B57F8 + movs r0, 0xC + bl sub_81B3054 + b _081B57FE + .align 2, 0 +_081B57F4: .4byte 0x00000888 +_081B57F8: + movs r0, 0xD + bl sub_81B3054 +_081B57FE: + pop {r0} + bx r0 + thumb_func_end sub_81B57DC + + thumb_func_start hm_surf_run_dp02scr +hm_surf_run_dp02scr: @ 81B5804 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _081B581C + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x9 + bl oe_exec + pop {r0} + bx r0 + .align 2, 0 +_081B581C: .4byte 0x02038c08 + thumb_func_end hm_surf_run_dp02scr + + thumb_func_start sub_81B5820 +sub_81B5820: @ 81B5820 + push {lr} + bl party_has_pokemon_with_surf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + bl sub_808BE74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + ldr r1, _081B584C + ldr r0, _081B5850 + str r0, [r1] + ldr r1, _081B5854 + ldr r0, _081B5858 + str r0, [r1] + movs r0, 0x1 + b _081B585E + .align 2, 0 +_081B584C: .4byte 0x03005db0 +_081B5850: .4byte hm_add_c3_launch_phase_2 + 1 +_081B5854: .4byte 0x0203ceec +_081B5858: .4byte hm_surf_run_dp02scr + 1 +_081B585C: + movs r0, 0 +_081B585E: + pop {r1} + bx r1 + thumb_func_end sub_81B5820 + + thumb_func_start sub_81B5864 +sub_81B5864: @ 81B5864 + push {lr} + movs r0, 0x8 + bl walkrun_bitfield_and_r0 + lsls r0, 24 + cmp r0, 0 + beq _081B587A + movs r0, 0x9 + bl sub_81B3054 + b _081B5880 +_081B587A: + movs r0, 0x8 + bl sub_81B3054 +_081B5880: + pop {r0} + bx r0 + thumb_func_end sub_81B5864 + + thumb_func_start sub_81B5884 +sub_81B5884: @ 81B5884 + push {lr} + ldr r0, _081B589C + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B58A0 + movs r0, 0 + b _081B58A2 + .align 2, 0 +_081B589C: .4byte 0x02037318 +_081B58A0: + movs r0, 0x1 +_081B58A2: + pop {r1} + bx r1 + thumb_func_end sub_81B5884 + + thumb_func_start sub_81B58A8 +sub_81B58A8: @ 81B58A8 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, _081B58CC + str r0, [sp, 0x4] + ldr r0, _081B58D0 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B58CC: .4byte sub_81B1370 + 1 +_081B58D0: .4byte sub_8086194 + 1 + thumb_func_end sub_81B58A8 + + thumb_func_start hm2_waterfall +hm2_waterfall: @ 81B58D4 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _081B58EC + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2B + bl oe_exec + pop {r0} + bx r0 + .align 2, 0 +_081B58EC: .4byte 0x02038c08 + thumb_func_end hm2_waterfall + + thumb_func_start hm_prepare_waterfall +hm_prepare_waterfall: @ 81B58F0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl cur_mapdata_block_get_role_at + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x13_waterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + bl sub_808BE50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + ldr r1, _081B593C + ldr r0, _081B5940 + str r0, [r1] + ldr r1, _081B5944 + ldr r0, _081B5948 + str r0, [r1] + movs r0, 0x1 + b _081B594E + .align 2, 0 +_081B593C: .4byte 0x03005db0 +_081B5940: .4byte hm_add_c3_launch_phase_2 + 1 +_081B5944: .4byte 0x0203ceec +_081B5948: .4byte hm2_waterfall + 1 +_081B594C: + movs r0, 0 +_081B594E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end hm_prepare_waterfall + + thumb_func_start sub_81B5958 +sub_81B5958: @ 81B5958 + push {lr} + bl brm_get_pokemon_selection + ldr r1, _081B5970 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2C + bl oe_exec + pop {r0} + bx r0 + .align 2, 0 +_081B5970: .4byte 0x02038c08 + thumb_func_end sub_81B5958 + + thumb_func_start sub_81B5974 +sub_81B5974: @ 81B5974 + push {lr} + bl sub_809D1E8 + ldr r1, _081B598C + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x4] + cmp r0, 0 + bne _081B5990 + movs r0, 0 + b _081B599E + .align 2, 0 +_081B598C: .4byte 0x02038c08 +_081B5990: + ldr r1, _081B59A4 + ldr r0, _081B59A8 + str r0, [r1] + ldr r1, _081B59AC + ldr r0, _081B59B0 + str r0, [r1] + movs r0, 0x1 +_081B599E: + pop {r1} + bx r1 + .align 2, 0 +_081B59A4: .4byte 0x03005db0 +_081B59A8: .4byte hm_add_c3_launch_phase_2 + 1 +_081B59AC: .4byte 0x0203ceec +_081B59B0: .4byte sub_81B5958 + 1 + thumb_func_end sub_81B5974 + + thumb_func_start sub_81B59B4 +sub_81B59B4: @ 81B59B4 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + movs r6, 0x1 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B59EA + ldr r0, _081B5A20 + ldr r1, _081B5A24 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B59EA + ldr r0, _081B5A28 + adds r0, r4, r0 + ldrb r1, [r0] + eors r1, r6 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 +_081B59EA: + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r6, [sp] + adds r0, r4, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl sub_81B5A2C + ldrb r0, [r7, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B5A20: .4byte 0x030022c0 +_081B5A24: .4byte 0x00000439 +_081B5A28: .4byte 0x08616020 + thumb_func_end sub_81B59B4 + + thumb_func_start sub_81B5A2C +sub_81B5A2C: @ 81B5A2C + push {r4-r7,lr} + sub sp, 0xC + adds r6, r1, 0 + adds r4, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + lsrs r7, r3, 24 + cmp r5, 0 + beq _081B5A7A + ldr r1, _081B5A84 + ldr r0, [r4, 0x4] + ldrb r2, [r0] + ldrb r3, [r0, 0x1] + movs r0, 0x4 + str r0, [sp] + str r6, [sp, 0x4] + ldr r0, [sp, 0x20] + str r0, [sp, 0x8] + adds r0, r5, 0 + bl sub_80D2CC4 + strb r0, [r4, 0x9] + ldr r2, _081B5A88 + ldrb r0, [r4, 0x9] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r7, 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] +_081B5A7A: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B5A84: .4byte sub_80D3014 + 1 +_081B5A88: .4byte 0x02020630 + thumb_func_end sub_81B5A2C + + thumb_func_start sub_81B5A8C +sub_81B5A8C: @ 81B5A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B5AEC + cmp r0, 0x2 + bgt _081B5AB4 + cmp r0, 0x1 + beq _081B5B04 + b _081B5B1C +_081B5AB4: + cmp r0, 0x3 + beq _081B5AD4 + cmp r0, 0x4 + bne _081B5B1C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _081B5AD0 + adds r0, r1 + movs r1, 0 + bl sub_80D32C8 + b _081B5B2C + .align 2, 0 +_081B5AD0: .4byte 0x02020630 +_081B5AD4: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _081B5AE8 + adds r0, r1 + movs r1, 0x1 + bl sub_80D32C8 + b _081B5B2C + .align 2, 0 +_081B5AE8: .4byte 0x02020630 +_081B5AEC: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _081B5B00 + adds r0, r1 + movs r1, 0x2 + bl sub_80D32C8 + b _081B5B2C + .align 2, 0 +_081B5B00: .4byte 0x02020630 +_081B5B04: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _081B5B18 + adds r0, r1 + movs r1, 0x3 + bl sub_80D32C8 + b _081B5B2C + .align 2, 0 +_081B5B18: .4byte 0x02020630 +_081B5B1C: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, _081B5B34 + adds r0, r1 + movs r1, 0x4 + bl sub_80D32C8 +_081B5B2C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5B34: .4byte 0x02020630 + thumb_func_end sub_81B5A8C + + thumb_func_start sub_81B5B38 +sub_81B5B38: @ 81B5B38 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5A8C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B5B38 + + thumb_func_start sub_81B5B6C +sub_81B5B6C: @ 81B5B6C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r5, _081B5B9C + lsls r0, r4, 4 + adds r0, r4 + lsls r6, r0, 2 + adds r2, r6, r5 + movs r7, 0 + movs r3, 0 + strh r3, [r2, 0x2E] + mov r12, r5 + cmp r1, 0 + bne _081B5BC4 + movs r1, 0x20 + ldrsh r0, [r2, r1] + cmp r0, 0x10 + bne _081B5BA4 + strh r3, [r2, 0x24] + ldr r0, _081B5BA0 + strh r0, [r2, 0x26] + b _081B5BAA + .align 2, 0 +_081B5B9C: .4byte 0x02020630 +_081B5BA0: .4byte 0x0000fffc +_081B5BA4: + ldr r0, _081B5BBC + strh r0, [r2, 0x24] + strh r3, [r2, 0x26] +_081B5BAA: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + mov r1, r12 + adds r1, 0x1C + adds r0, r1 + ldr r1, _081B5BC0 + b _081B5BD0 + .align 2, 0 +_081B5BBC: .4byte 0x0000fffc +_081B5BC0: .4byte sub_81B5C08 + 1 +_081B5BC4: + strh r3, [r2, 0x24] + strh r3, [r2, 0x26] + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, _081B5BD8 +_081B5BD0: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B5BD8: .4byte sub_81B5BDC + 1 + thumb_func_end sub_81B5B6C + + thumb_func_start sub_81B5BDC +sub_81B5BDC: @ 81B5BDC + push {r4,lr} + adds r4, r0, 0 + bl sub_80D30DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B5C02 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081B5C00 + ldr r0, _081B5BFC + strh r0, [r4, 0x26] + b _081B5C02 + .align 2, 0 +_081B5BFC: .4byte 0x0000fffd +_081B5C00: + strh r1, [r4, 0x26] +_081B5C02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5BDC + + thumb_func_start sub_81B5C08 +sub_81B5C08: @ 81B5C08 + push {lr} + bl sub_80D30DC + pop {r0} + bx r0 + thumb_func_end sub_81B5C08 + + thumb_func_start sub_81B5C14 +sub_81B5C14: @ 81B5C14 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B5C3C + ldr r0, _081B5C44 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4, 0xA] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5C94 +_081B5C3C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B5C44: .4byte 0x08615ec0 + thumb_func_end sub_81B5C14 + + thumb_func_start sub_81B5C48 +sub_81B5C48: @ 81B5C48 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r0, 0 + beq _081B5C84 + ldr r0, _081B5C8C + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4, 0xA] + ldr r2, _081B5C90 + ldrb r0, [r4, 0xA] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5CB0 +_081B5C84: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B5C8C: .4byte 0x08615ec0 +_081B5C90: .4byte 0x02020630 + thumb_func_end sub_81B5C48 + + thumb_func_start sub_81B5C94 +sub_81B5C94: @ 81B5C94 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_81B5CB0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5C94 + + thumb_func_start sub_81B5CB0 +sub_81B5CB0: @ 81B5CB0 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _081B5CD8 + ldr r2, _081B5CD4 + ldrb r1, [r4, 0xA] + 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 _081B5D24 + .align 2, 0 +_081B5CD4: .4byte 0x02020630 +_081B5CD8: + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B5CFC + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081B5CF8 + adds r0, r1 + movs r1, 0x1 + bl obj_anim_image_start + b _081B5D0E + .align 2, 0 +_081B5CF8: .4byte 0x02020630 +_081B5CFC: + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081B5D2C + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start +_081B5D0E: + ldr r2, _081B5D2C + ldrb r1, [r4, 0xA] + 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 +_081B5D24: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5D2C: .4byte 0x02020630 + thumb_func_end sub_81B5CB0 + + thumb_func_start sub_81B5D30 +sub_81B5D30: @ 81B5D30 + push {lr} + ldr r0, _081B5D44 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r0, _081B5D48 + bl gpu_pal_obj_alloc_tag_and_apply + pop {r0} + bx r0 + .align 2, 0 +_081B5D44: .4byte 0x08615eb0 +_081B5D48: .4byte 0x08615eb8 + thumb_func_end sub_81B5D30 + + thumb_func_start sub_81B5D4C +sub_81B5D4C: @ 81B5D4C + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + beq _081B5D60 + cmp r2, 0x1 + beq _081B5DA8 + b _081B5DE4 +_081B5D60: + movs r5, 0 + ldrb r0, [r6] + cmp r5, r0 + bcs _081B5DE4 +_081B5D68: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081B5DA4 + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5D94 + adds r0, r7, r5 + ldrb r4, [r0] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5D94: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r6] + cmp r5, r0 + bcc _081B5D68 + b _081B5DE4 + .align 2, 0 +_081B5DA4: .4byte 0x020244ec +_081B5DA8: + movs r5, 0 + b _081B5DDE +_081B5DAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081B5DEC + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5DD8 + adds r0, r5, r7 + ldrb r4, [r0, 0x6] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5DD8: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081B5DDE: + ldrb r0, [r6, 0x1] + cmp r5, r0 + bcc _081B5DAC +_081B5DE4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B5DEC: .4byte 0x02024744 + thumb_func_end sub_81B5D4C + + thumb_func_start sub_81B5DF0 +sub_81B5DF0: @ 81B5DF0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r6, r0, 0 + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _081B5E68 + mov r8, r0 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r8 + adds r0, 0x43 + ldrb r3, [r0] + ldr r0, _081B5E6C + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0xFA + movs r2, 0xAA + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r0, r8 + adds r5, r4, r0 + movs r0, 0x4 + strh r0, [r5, 0x24] + movs r0, 0xA + strh r0, [r5, 0x26] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, _081B5E70 + str r0, [r4] + strh r6, [r5, 0x3C] + adds r0, r5, 0 + mov r1, r9 + bl obj_anim_image_start + ldr r1, [r4] + adds r0, r5, 0 + bl _call_via_r1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B5E68: .4byte 0x02020630 +_081B5E6C: .4byte 0x08615ec0 +_081B5E70: .4byte sub_81B5E74 + 1 + thumb_func_end sub_81B5DF0 + + thumb_func_start sub_81B5E74 +sub_81B5E74: @ 81B5E74 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + ldr r2, _081B5EA4 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B5EA8 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _081B5EC6 + .align 2, 0 +_081B5EA4: .4byte 0x02020630 +_081B5EA8: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] +_081B5EC6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5E74 + + thumb_func_start sub_81B5ECC +sub_81B5ECC: @ 81B5ECC + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B5EEA + ldr r0, _081B5EF0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl obj_add_from_template_forward_search + strb r0, [r4, 0xB] +_081B5EEA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5EF0: .4byte 0x08615f08 + thumb_func_end sub_81B5ECC + + thumb_func_start sub_81B5EF4 +sub_81B5EF4: @ 81B5EF4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + cmp r0, 0 + beq _081B5F24 + ldr r0, _081B5F2C + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl obj_add_from_template_forward_search + strb r0, [r4, 0xB] + ldr r2, _081B5F30 + ldrb r0, [r4, 0xB] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B5F24: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B5F2C: .4byte 0x08615f08 +_081B5F30: .4byte 0x02020630 + thumb_func_end sub_81B5EF4 + + thumb_func_start sub_81B5F34 +sub_81B5F34: @ 81B5F34 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _081B5F6C + adds r1, r3, 0 + movs r3, 0x8 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081B5F70 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + ands r2, r3 + movs r3, 0x8 + orrs r2, r3 + strb r2, [r1, 0x5] + pop {r1} + bx r1 + .align 2, 0 +_081B5F6C: .4byte 0x08615f08 +_081B5F70: .4byte 0x02020630 + thumb_func_end sub_81B5F34 + + thumb_func_start sub_81B5F74 +sub_81B5F74: @ 81B5F74 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _081B5F94 + adds r1, r3, 0 + movs r3, 0x8 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081B5F94: .4byte 0x08615f78 + thumb_func_end sub_81B5F74 + + thumb_func_start sub_81B5F98 +sub_81B5F98: @ 81B5F98 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, _081B5FB8 + adds r0, r2 + bl obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_081B5FB8: .4byte 0x02020630 + thumb_func_end sub_81B5F98 + + thumb_func_start sub_81B5FBC +sub_81B5FBC: @ 81B5FBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r6, 0 + bne _081B6000 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _081B5FFC + mov r8, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x2 + bl obj_anim_image_start + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x4 + bl obj_anim_image_start + strh r6, [r4, 0x26] + strh r6, [r5, 0x26] + b _081B602C + .align 2, 0 +_081B5FFC: .4byte 0x02020630 +_081B6000: + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, _081B6038 + mov r8, r0 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x3 + bl obj_anim_image_start + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl obj_anim_image_start + ldr r0, _081B603C + strh r0, [r5, 0x26] + movs r0, 0x4 + strh r0, [r4, 0x26] +_081B602C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6038: .4byte 0x02020630 +_081B603C: .4byte 0x0000fffc + thumb_func_end sub_81B5FBC + + thumb_func_start sub_81B6040 +sub_81B6040: @ 81B6040 + push {lr} + ldr r0, _081B6058 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081B605C + bl gpu_tile_obj_decompress_and_load + ldr r0, _081B6060 + bl gpu_pal_obj_decompress_and_apply + pop {r0} + bx r0 + .align 2, 0 +_081B6058: .4byte 0x08615ef8 +_081B605C: .4byte 0x08615f70 +_081B6060: .4byte 0x08615f00 + thumb_func_end sub_81B6040 + + thumb_func_start sub_81B6064 +sub_81B6064: @ 81B6064 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B608C + ldr r0, _081B6094 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B60E4 +_081B608C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B6094: .4byte 0x08616008 + thumb_func_end sub_81B6064 + + thumb_func_start sub_81B6098 +sub_81B6098: @ 81B6098 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0 + beq _081B60D4 + ldr r0, _081B60DC + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B60FC + ldr r2, _081B60E0 + ldrb r0, [r4, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B60D4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B60DC: .4byte 0x08616008 +_081B60E0: .4byte 0x02020630 + thumb_func_end sub_81B6098 + + thumb_func_start sub_81B60E4 +sub_81B60E4: @ 81B60E4 + push {r4,lr} + adds r4, r1, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_81B60FC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B60E4 + + thumb_func_start sub_81B60FC +sub_81B60FC: @ 81B60FC + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _081B610C + cmp r2, 0x6 + bne _081B6128 +_081B610C: + ldr r2, _081B6124 + ldrb r1, [r5, 0xC] + 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 _081B6152 + .align 2, 0 +_081B6124: .4byte 0x02020630 +_081B6128: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081B615C + adds r0, r4 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + ldrb r1, [r5, 0xC] + 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 +_081B6152: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B615C: .4byte 0x02020630 + thumb_func_end sub_81B60FC + + thumb_func_start sub_81B6160 +sub_81B6160: @ 81B6160 + push {lr} + ldr r0, _081B6174 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081B6178 + bl gpu_pal_obj_decompress_and_apply + pop {r0} + bx r0 + .align 2, 0 +_081B6174: .4byte 0x08615ff8 +_081B6178: .4byte 0x08616000 + thumb_func_end sub_81B6160 + + thumb_func_start sub_81B617C +sub_81B617C: @ 81B617C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, _081B61A4 + mov r8, r0 + ldr r0, _081B61A8 + ldr r1, _081B61AC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B61BC + movs r7, 0x1 + bl sub_81B8984 + lsls r0, 24 + lsrs r6, r0, 24 + b _081B61C0 + .align 2, 0 +_081B61A4: .4byte c2_815ABFC + 1 +_081B61A8: .4byte 0x030022c0 +_081B61AC: .4byte 0x00000439 +_081B61B0: + ldr r0, _081B61B8 + strb r5, [r0, 0x9] + b _081B6204 + .align 2, 0 +_081B61B8: .4byte 0x0203cec8 +_081B61BC: + movs r7, 0 + movs r6, 0 +_081B61C0: + ldr r4, _081B620C + ldrh r0, [r4] + bl sub_81B7CEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081B621C + ldr r1, _081B6210 + movs r0, 0 + strb r0, [r1, 0x9] + movs r5, 0 +_081B61D8: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081B6214 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B61FA + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081B61B0 +_081B61FA: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B61D8 +_081B6204: + ldr r0, _081B6218 + movs r1, 0x7F + b _081B6230 + .align 2, 0 +_081B620C: .4byte 0x0203ce7c +_081B6210: .4byte 0x0203cec8 +_081B6214: .4byte 0x020244ec +_081B6218: .4byte sub_81B6280 + 1 +_081B621C: + ldrh r0, [r4] + bl sub_80D6C68 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + cmp r0, 0x3 + bne _081B622E + movs r1, 0x4 +_081B622E: + ldr r0, _081B6250 +_081B6230: + str r1, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6250: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B617C + + thumb_func_start c2_815ABFC +c2_815ABFC: @ 81B6254 + push {lr} + bl sub_81A9E40 + lsls r0, 24 + cmp r0, 0 + bne _081B626C + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl sub_81AAC90 + b _081B6276 +_081B626C: + ldr r0, _081B627C + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 +_081B6276: + pop {r0} + bx r0 + .align 2, 0 +_081B627C: .4byte 0x0203cf30 + thumb_func_end c2_815ABFC + + thumb_func_start sub_81B6280 +sub_81B6280: @ 81B6280 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _081B62B8 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B62B2 + ldr r0, _081B62BC + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B62A6 + ldr r0, _081B62C0 + ldr r1, [r0] + ldr r0, _081B62C4 + str r0, [r1, 0x4] +_081B62A6: + ldr r0, _081B62C8 + ldr r1, _081B62CC + ldr r2, [r0] + adds r0, r3, 0 + bl _call_via_r2 +_081B62B2: + pop {r0} + bx r0 + .align 2, 0 +_081B62B8: .4byte 0x02037fd4 +_081B62BC: .4byte 0x0203cec8 +_081B62C0: .4byte 0x0203cec4 +_081B62C4: .4byte sub_81B9140 + 1 +_081B62C8: .4byte 0x03006328 +_081B62CC: .4byte sub_81B6794 + 1 + thumb_func_end sub_81B6280 + + thumb_func_start sub_81B62D0 +sub_81B62D0: @ 81B62D0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _081B62EC + ldr r0, _081B62E4 + ldr r0, [r0] + ldr r1, _081B62E8 + adds r0, r1 + b _081B62F6 + .align 2, 0 +_081B62E4: .4byte 0x03005d8c +_081B62E8: .4byte 0x00003214 +_081B62EC: + ldr r1, _081B6304 + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B62F6: + ldrb r1, [r0, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081B6308 + movs r0, 0 + b _081B630A + .align 2, 0 +_081B6304: .4byte 0x0831e58c +_081B6308: + movs r0, 0x1 +_081B630A: + pop {r1} + bx r1 + thumb_func_end sub_81B62D0 + + thumb_func_start sub_81B6310 +sub_81B6310: @ 81B6310 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_81B7CEC + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x3 + cmp r0, 0x12 + bls _081B6326 + b _081B64BC +_081B6326: + lsls r0, 2 + ldr r1, _081B6330 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B6330: .4byte _081B6334 + .align 2, 0 +_081B6334: + .4byte _081B6380 + .4byte _081B6394 + .4byte _081B63A8 + .4byte _081B63BC + .4byte _081B63D0 + .4byte _081B63E4 + .4byte _081B63F8 + .4byte _081B64BC + .4byte _081B640C + .4byte _081B6430 + .4byte _081B6420 + .4byte _081B6460 + .4byte _081B6470 + .4byte _081B6450 + .4byte _081B6440 + .4byte _081B64BC + .4byte _081B6494 + .4byte _081B6494 + .4byte _081B64A8 +_081B6380: + ldr r0, _081B638C + ldr r1, _081B6390 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B638C: .4byte 0x02021fc4 +_081B6390: .4byte 0x085e9c3e +_081B6394: + ldr r0, _081B63A0 + ldr r1, _081B63A4 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B63A0: .4byte 0x02021fc4 +_081B63A4: .4byte 0x085e9c7c +_081B63A8: + ldr r0, _081B63B4 + ldr r1, _081B63B8 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B63B4: .4byte 0x02021fc4 +_081B63B8: .4byte 0x085e9c8a +_081B63BC: + ldr r0, _081B63C8 + ldr r1, _081B63CC + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B63C8: .4byte 0x02021fc4 +_081B63CC: .4byte 0x085e9ca2 +_081B63D0: + ldr r0, _081B63DC + ldr r1, _081B63E0 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B63DC: .4byte 0x02021fc4 +_081B63E0: .4byte 0x085e9c5f +_081B63E4: + ldr r0, _081B63F0 + ldr r1, _081B63F4 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B63F0: .4byte 0x02021fc4 +_081B63F4: .4byte 0x085e9dbe +_081B63F8: + ldr r0, _081B6404 + ldr r1, _081B6408 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B6404: .4byte 0x02021fc4 +_081B6408: .4byte 0x085e9de1 +_081B640C: + ldr r0, _081B6418 + ldr r1, _081B641C + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B6418: .4byte 0x02021fc4 +_081B641C: .4byte 0x085e9ce0 +_081B6420: + ldr r0, _081B6428 + ldr r1, _081B642C + b _081B6474 + .align 2, 0 +_081B6428: .4byte 0x02021dc4 +_081B642C: .4byte 0x085e96e3 +_081B6430: + ldr r0, _081B6438 + ldr r1, _081B643C + b _081B6474 + .align 2, 0 +_081B6438: .4byte 0x02021dc4 +_081B643C: .4byte 0x085ea33c +_081B6440: + ldr r0, _081B6448 + ldr r1, _081B644C + b _081B6474 + .align 2, 0 +_081B6448: .4byte 0x02021dc4 +_081B644C: .4byte 0x085ea343 +_081B6450: + ldr r0, _081B6458 + ldr r1, _081B645C + b _081B6474 + .align 2, 0 +_081B6458: .4byte 0x02021dc4 +_081B645C: .4byte 0x085ea35b +_081B6460: + ldr r0, _081B6468 + ldr r1, _081B646C + b _081B6474 + .align 2, 0 +_081B6468: .4byte 0x02021dc4 +_081B646C: .4byte 0x085e96e6 +_081B6470: + ldr r0, _081B6484 + ldr r1, _081B6488 +_081B6474: + bl gf_strcpy + ldr r0, _081B648C + ldr r1, _081B6490 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B6484: .4byte 0x02021dc4 +_081B6488: .4byte 0x085e96ee +_081B648C: .4byte 0x02021fc4 +_081B6490: .4byte 0x085e9d25 +_081B6494: + ldr r0, _081B64A0 + ldr r1, _081B64A4 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B64A0: .4byte 0x02021fc4 +_081B64A4: .4byte 0x085e9cf5 +_081B64A8: + ldr r0, _081B64B4 + ldr r1, _081B64B8 + bl ExpandTextCodes + b _081B64C4 + .align 2, 0 +_081B64B4: .4byte 0x02021fc4 +_081B64B8: .4byte 0x085e9cb7 +_081B64BC: + ldr r0, _081B64C8 + ldr r1, _081B64CC + bl ExpandTextCodes +_081B64C4: + pop {r0} + bx r0 + .align 2, 0 +_081B64C8: .4byte 0x02021fc4 +_081B64CC: .4byte 0x085e96f6 + thumb_func_end sub_81B6310 + + thumb_func_start sub_81B64D0 +sub_81B64D0: @ 81B64D0 + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_81B7CEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bne _081B64FC + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldr r1, _081B64F8 + cmp r0, r1 + bne _081B64FC + movs r0, 0 + b _081B64FE + .align 2, 0 +_081B64F8: .4byte 0x0000012f +_081B64FC: + movs r0, 0x1 +_081B64FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B64D0 + + thumb_func_start sub_81B6504 +sub_81B6504: @ 81B6504 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x27 + beq _081B6516 + cmp r0, 0x29 + beq _081B6516 + cmp r0, 0x28 + bne _081B651A +_081B6516: + movs r0, 0x1 + b _081B651C +_081B651A: + movs r0, 0 +_081B651C: + pop {r1} + bx r1 + thumb_func_end sub_81B6504 + + thumb_func_start sub_81B6520 +sub_81B6520: @ 81B6520 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _081B654C + ldr r1, _081B6550 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081B6558 + movs r0, 0x64 + muls r0, r3 + ldr r1, _081B6554 + adds r0, r1 + adds r1, r5, 0 + adds r2, r3, 0 + b _081B6572 + .align 2, 0 +_081B654C: .4byte 0x030022c0 +_081B6550: .4byte 0x00000439 +_081B6554: .4byte 0x020244ec +_081B6558: + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r0, _081B6584 + adds r4, r0 + adds r0, r3, 0 + bl sub_81B8F38 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 +_081B6572: + adds r3, r6, 0 + bl sub_806BD04 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081B6584: .4byte 0x020244ec + thumb_func_end sub_81B6520 + + thumb_func_start sub_81B6588 +sub_81B6588: @ 81B6588 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r1, [sp, 0x4] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + mov r10, r0 + ldr r0, _081B6610 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B6614 + adds r5, r1, r0 + ldr r0, _081B6618 + ldrh r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81B64D0 + lsls r0, 24 + cmp r0, 0 + beq _081B6600 + adds r0, r6, 0 + bl sub_81B62D0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bne _081B65EE + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + cmp r10, r0 + bne _081B65EE + movs r1, 0 + mov r8, r1 +_081B65EE: + ldr r4, _081B6610 + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl sub_81B6520 + lsls r0, 24 + cmp r0, 0 + beq _081B6624 +_081B6600: + ldr r1, _081B661C + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldr r0, _081B6620 + b _081B66F4 + .align 2, 0 +_081B6610: .4byte 0x0203cec8 +_081B6614: .4byte 0x020244ec +_081B6618: .4byte 0x0203ce7c +_081B661C: .4byte 0x0203cee8 +_081B6620: .4byte 0x085e96f6 +_081B6624: + ldr r1, _081B664C + movs r0, 0x1 + strb r0, [r1] + adds r0, r6, 0 + bl sub_81B6504 + lsls r0, 24 + cmp r0, 0 + bne _081B6650 + movs r0, 0x1 + bl audio_play + ldrb r0, [r4, 0xB] + cmp r0, 0xE + beq _081B6656 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80D6AA4 + b _081B6656 + .align 2, 0 +_081B664C: .4byte 0x0203cee8 +_081B6650: + movs r0, 0x75 + bl audio_play +_081B6656: + ldr r4, _081B66D4 + ldr r7, _081B66D8 + movs r0, 0x9 + ldrsb r0, [r7, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl sub_81B60E4 + ldr r2, _081B66DC + movs r0, 0x9 + ldrsb r0, [r7, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + 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 + bge _081B6694 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B6694: + mov r2, r8 + cmp r2, 0x1 + bne _081B66E4 + mov r0, r10 + cmp r0, 0 + bne _081B66A8 + ldrb r0, [r7, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B66A8: + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + mov r1, r10 + subs r3, r1 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r7, 0x9] + ldr r0, _081B66E0 + str r0, [sp] + mov r0, r9 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r9 + movs r1, 0 + mov r2, r10 + bl sub_81B1FA8 + b _081B6710 + .align 2, 0 +_081B66D4: .4byte 0x0203cedc +_081B66D8: .4byte 0x0203cec8 +_081B66DC: .4byte 0x02020630 +_081B66E0: .4byte sub_81B672C + 1 +_081B66E4: + ldr r1, _081B6720 + adds r0, r5, 0 + bl sub_81B1B44 + adds r0, r6, 0 + bl sub_81B6310 + ldr r0, _081B6724 +_081B66F4: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B6728 + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp, 0x4] + str r1, [r0] +_081B6710: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6720: .4byte 0x02021cc4 +_081B6724: .4byte 0x02021fc4 +_081B6728: .4byte 0x03005e00 + thumb_func_end sub_81B6588 + + thumb_func_start sub_81B672C +sub_81B672C: @ 81B672C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081B6778 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B677C + adds r0, r1 + ldr r1, _081B6780 + bl sub_81B1B44 + ldr r4, _081B6784 + ldr r1, _081B6788 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + bl sub_805EAE8 + ldr r1, _081B678C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6790 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B6778: .4byte 0x0203cec8 +_081B677C: .4byte 0x020244ec +_081B6780: .4byte 0x02021cc4 +_081B6784: .4byte 0x02021fc4 +_081B6788: .4byte 0x085e9c17 +_081B678C: .4byte 0x03005e00 +_081B6790: .4byte sub_81B6794 + 1 + thumb_func_end sub_81B672C + + thumb_func_start sub_81B6794 +sub_81B6794: @ 81B6794 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B67BA + ldr r0, _081B67C0 + ldrb r1, [r0] + cmp r1, 0 + bne _081B67B4 + ldr r0, _081B67C4 + ldr r0, [r0] + str r1, [r0, 0x4] +_081B67B4: + adds r0, r4, 0 + bl sub_81B12C0 +_081B67BA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B67C0: .4byte 0x0203cee8 +_081B67C4: .4byte 0x0203cec4 + thumb_func_end sub_81B6794 + + thumb_func_start sub_81B67C8 +sub_81B67C8: @ 81B67C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, _081B6860 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B6864 + adds r5, r1, r0 + ldr r0, _081B6868 + ldrh r6, [r0] + adds r0, r6, 0 + bl sub_81B7CEC + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl sub_81B6520 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0 + bne _081B6850 + ldr r0, [sp, 0x4] + cmp r0, r9 + bne _081B6874 + ldr r1, [sp, 0x8] + cmp r1, r8 + bne _081B6874 +_081B6850: + ldr r1, _081B686C + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldr r0, _081B6870 + b _081B68E2 + .align 2, 0 +_081B6860: .4byte 0x0203cec8 +_081B6864: .4byte 0x020244ec +_081B6868: .4byte 0x0203ce7c +_081B686C: .4byte 0x0203cee8 +_081B6870: .4byte 0x085e96f6 +_081B6874: + ldr r1, _081B68B0 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl audio_play + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80D6AA4 + ldr r1, _081B68B4 + adds r0, r5, 0 + bl sub_81B1B44 + ldr r1, _081B68B8 + adds r0, r7, 0 + bl option_menu_get_string + ldr r2, [sp, 0x4] + cmp r2, r9 + beq _081B68D8 + ldr r0, [sp, 0x8] + cmp r0, r8 + beq _081B68C4 + ldr r0, _081B68BC + ldr r1, _081B68C0 + bl ExpandTextCodes + b _081B68E0 + .align 2, 0 +_081B68B0: .4byte 0x0203cee8 +_081B68B4: .4byte 0x02021cc4 +_081B68B8: .4byte 0x02021dc4 +_081B68BC: .4byte 0x02021fc4 +_081B68C0: .4byte 0x085e9d45 +_081B68C4: + ldr r0, _081B68D0 + ldr r1, _081B68D4 + bl ExpandTextCodes + b _081B68E0 + .align 2, 0 +_081B68D0: .4byte 0x02021fc4 +_081B68D4: .4byte 0x085e9d90 +_081B68D8: + ldr r0, _081B6910 + ldr r1, _081B6914 + bl ExpandTextCodes +_081B68E0: + ldr r0, _081B6910 +_081B68E2: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B6918 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp] + str r1, [r0] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6910: .4byte 0x02021fc4 +_081B6914: .4byte 0x085e9d6d +_081B6918: .4byte 0x03005e00 + thumb_func_end sub_81B67C8 + + thumb_func_start sub_81B691C +sub_81B691C: @ 81B691C + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6992 + lsls r0, 2 + ldr r1, _081B6938 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B6938: .4byte _081B693C + .align 2, 0 +_081B693C: + .4byte _081B696C + .4byte _081B6954 + .4byte _081B697E + .4byte _081B6984 + .4byte _081B6978 + .4byte _081B6972 +_081B6954: + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldr r1, _081B6968 + cmp r0, r1 + beq _081B6992 + adds r0, r4, 0 + movs r1, 0x1A + b _081B6988 + .align 2, 0 +_081B6968: .4byte 0x0000012f +_081B696C: + adds r0, r4, 0 + movs r1, 0x1B + b _081B6988 +_081B6972: + adds r0, r4, 0 + movs r1, 0x1C + b _081B6988 +_081B6978: + adds r0, r4, 0 + movs r1, 0x1D + b _081B6988 +_081B697E: + adds r0, r4, 0 + movs r1, 0x1E + b _081B6988 +_081B6984: + adds r0, r4, 0 + movs r1, 0x1F +_081B6988: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + b _081B6994 +_081B6992: + movs r0, 0 +_081B6994: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B691C + + thumb_func_start option_menu_get_string +option_menu_get_string: @ 81B699C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6A08 + lsls r0, 2 + ldr r1, _081B69B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081B69B4: .4byte _081B69B8 + .align 2, 0 +_081B69B8: + .4byte _081B69D8 + .4byte _081B69D0 + .4byte _081B69F0 + .4byte _081B6A00 + .4byte _081B69E8 + .4byte _081B69E0 +_081B69D0: + ldr r1, _081B69D4 + b _081B69F2 + .align 2, 0 +_081B69D4: .4byte 0x085e96e3 +_081B69D8: + ldr r1, _081B69DC + b _081B69F2 + .align 2, 0 +_081B69DC: .4byte 0x085ea33c +_081B69E0: + ldr r1, _081B69E4 + b _081B69F2 + .align 2, 0 +_081B69E4: .4byte 0x085ea343 +_081B69E8: + ldr r1, _081B69EC + b _081B69F2 + .align 2, 0 +_081B69EC: .4byte 0x085ea35b +_081B69F0: + ldr r1, _081B69FC +_081B69F2: + adds r0, r2, 0 + bl gf_strcpy + b _081B6A08 + .align 2, 0 +_081B69FC: .4byte 0x085e96e6 +_081B6A00: + ldr r1, _081B6A0C + adds r0, r2, 0 + bl gf_strcpy +_081B6A08: + pop {r0} + bx r0 + .align 2, 0 +_081B6A0C: .4byte 0x085e96ee + thumb_func_end option_menu_get_string + + thumb_func_start sub_81B6A10 +sub_81B6A10: @ 81B6A10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r7, 0 + movs r0, 0x1 + mov r10, r0 + movs r0, 0x3 + bl sub_81B31B0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + mov r8, r1 + ldr r0, _081B6AAC + mov r9, r0 +_081B6A40: + adds r1, r5, 0 + adds r1, 0xD + mov r0, r8 + add r0, r9 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xD + adds r2, r4, 0 + muls r2, r0 + ldr r0, _081B6AB0 + adds r2, r0 + lsls r0, r5, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + movs r3, 0x8 + bl Print + cmp r4, 0 + beq _081B6A82 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081B6A82: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081B6A40 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6AAC: .4byte 0x020244ec +_081B6AB0: .4byte 0x0831977c + thumb_func_end sub_81B6A10 + + thumb_func_start sub_81B6AB4 +sub_81B6AB4: @ 81B6AB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl ProcessMenuInput + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081B6AF0 + adds r0, 0x1 + cmp r1, r0 + bne _081B6AE0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B6BB4 + b _081B6AF0 +_081B6AE0: + ldr r0, _081B6AF8 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B6B80 +_081B6AF0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B6AF8: .4byte 0x0203cec4 + thumb_func_end sub_81B6AB4 + + thumb_func_start dp05_ether +dp05_ether: @ 81B6AFC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B6B14 + ldrh r0, [r0] + cmp r0, 0xAF + bne _081B6B20 + ldr r0, _081B6B18 + ldr r0, [r0] + ldr r1, _081B6B1C + adds r0, r1 + b _081B6B2A + .align 2, 0 +_081B6B14: .4byte 0x0203ce7c +_081B6B18: .4byte 0x03005d8c +_081B6B1C: .4byte 0x00003214 +_081B6B20: + ldr r1, _081B6B44 + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B6B2A: + ldrb r1, [r0, 0x4] + movs r0, 0x10 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081B6B4C + ldr r0, _081B6B48 + strh r1, [r0, 0xE] + adds r0, r4, 0 + bl sub_81B6BEC + b _081B6B6E + .align 2, 0 +_081B6B44: .4byte 0x0831e58c +_081B6B48: .4byte 0x0203cec8 +_081B6B4C: + movs r0, 0x5 + bl audio_play + movs r0, 0x16 + bl sub_81B3054 + ldr r0, _081B6B74 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, _081B6B78 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6B7C + str r1, [r0] +_081B6B6E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B6B74: .4byte 0x0203cec8 +_081B6B78: .4byte 0x03005e00 +_081B6B7C: .4byte sub_81B6AB4 + 1 + thumb_func_end dp05_ether + + thumb_func_start sub_81B6B80 +sub_81B6B80: @ 81B6B80 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081B6BAC + ldr r0, [r0] + adds r0, 0xC + bl sub_81B302C + bl GetMenuCursorPos + ldr r1, _081B6BB0 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl sub_81B6BEC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B6BAC: .4byte 0x0203cec4 +_081B6BB0: .4byte 0x0203cec8 + thumb_func_end sub_81B6B80 + + thumb_func_start sub_81B6BB4 +sub_81B6BB4: @ 81B6BB4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081B6BE0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, _081B6BE4 + str r0, [r1] + ldr r0, _081B6BE8 + ldr r0, [r0] + movs r1, 0 + str r1, [r0, 0x4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x5 + bl sub_81B3054 + pop {r0} + bx r0 + .align 2, 0 +_081B6BE0: .4byte 0x03005e00 +_081B6BE4: .4byte sub_81B1370 + 1 +_081B6BE8: .4byte 0x0203cec4 + thumb_func_end sub_81B6BB4 + + thumb_func_start sub_81B6BEC +sub_81B6BEC: @ 81B6BEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r7, _081B6C24 + ldr r0, _081B6C28 + ldrh r5, [r0] + movs r0, 0xE + negs r0, r0 + adds r0, r7 + mov r8, r0 + ldrb r0, [r0, 0x9] + ldrb r2, [r7] + adds r1, r5, 0 + bl sub_81B6520 + lsls r0, 24 + cmp r0, 0 + beq _081B6C34 + ldr r0, _081B6C2C + strb r4, [r0] + movs r0, 0x5 + bl audio_play + ldr r0, _081B6C30 + b _081B6C7E + .align 2, 0 +_081B6C24: .4byte 0x0203ced6 +_081B6C28: .4byte 0x0203ce7c +_081B6C2C: .4byte 0x0203cee8 +_081B6C30: .4byte 0x085e96f6 +_081B6C34: + ldr r1, _081B6CA4 + movs r0, 0x1 + strb r0, [r1] + mov r0, r8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, _081B6CA8 + adds r4, r0 + movs r0, 0x1 + bl audio_play + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80D6AA4 + movs r0, 0 + ldrsh r1, [r7, r0] + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _081B6CAC + movs r1, 0xD + muls r1, r4 + ldr r2, _081B6CB0 + adds r1, r2 + bl gf_strcpy + adds r0, r5, 0 + bl sub_81B6310 + ldr r0, _081B6CB4 +_081B6C7E: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B6CB8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6CBC + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6CA4: .4byte 0x0203cee8 +_081B6CA8: .4byte 0x020244ec +_081B6CAC: .4byte 0x02021cc4 +_081B6CB0: .4byte 0x0831977c +_081B6CB4: .4byte 0x02021fc4 +_081B6CB8: .4byte 0x03005e00 +_081B6CBC: .4byte sub_81B6794 + 1 + thumb_func_end sub_81B6BEC + + thumb_func_start dp05_pp_up +dp05_pp_up: @ 81B6CC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + movs r0, 0x17 + bl sub_81B3054 + ldr r0, _081B6CF0 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, _081B6CF4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6CF8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B6CF0: .4byte 0x0203cec8 +_081B6CF4: .4byte 0x03005e00 +_081B6CF8: .4byte sub_81B6AB4 + 1 + thumb_func_end dp05_pp_up + + thumb_func_start sub_81B6CFC +sub_81B6CFC: @ 81B6CFC + lsls r0, 16 + ldr r1, _081B6D0C + adds r0, r1 + ldr r1, _081B6D10 + lsrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_081B6D0C: .4byte 0xfedf0000 +_081B6D10: .4byte 0x08616040 + thumb_func_end sub_81B6CFC + + thumb_func_start sub_81B6D14 +sub_81B6D14: @ 81B6D14 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, _081B6D30 +_081B6D1E: + adds r0, r1, 0 + adds r0, 0x32 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B6D34 + movs r0, 0x1 + b _081B6D40 + .align 2, 0 +_081B6D30: .4byte 0x08616040 +_081B6D34: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _081B6D1E + movs r0, 0 +_081B6D40: + pop {r1} + bx r1 + thumb_func_end sub_81B6D14 + + thumb_func_start pokemon_has_move +pokemon_has_move: @ 81B6D44 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 +_081B6D4E: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + bl pokemon_getattr + cmp r0, r5 + bne _081B6D60 + movs r0, 0x1 + b _081B6D6C +_081B6D60: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B6D4E + movs r0, 0 +_081B6D6C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_has_move + + thumb_func_start sub_81B6D74 +sub_81B6D74: @ 81B6D74 + push {r4,lr} + adds r1, r0, 0 + ldr r4, _081B6D94 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B6D94: .4byte 0x02021fc4 + thumb_func_end sub_81B6D74 + + thumb_func_start sub_81B6D98 +sub_81B6D98: @ 81B6D98 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B6D74 + ldr r1, _081B6DBC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6DC0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B6DBC: .4byte 0x03005e00 +_081B6DC0: .4byte sub_81B6794 + 1 + thumb_func_end sub_81B6D98 + + thumb_func_start sub_81B6DC4 +sub_81B6DC4: @ 81B6DC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x5 + bl audio_play + ldr r7, _081B6E4C + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B6E50 + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r0, _081B6E54 + ldrh r4, [r0] + ldr r1, _081B6E58 + adds r0, r5, 0 + bl sub_81B1B44 + adds r0, r4, 0 + bl sub_81B6CFC + strh r0, [r7, 0xE] + ldr r0, _081B6E5C + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B6E60 + adds r1, r2 + bl gf_strcpy + movs r0, 0 + mov r1, r8 + strh r0, [r1, 0x2] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6E70 + cmp r0, 0x2 + beq _081B6E78 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, _081B6E64 + cmp r0, r1 + beq _081B6E88 + ldr r0, _081B6E68 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B6E6C + str r0, [r1] + b _081B6E9C + .align 2, 0 +_081B6E4C: .4byte 0x0203cec8 +_081B6E50: .4byte 0x020244ec +_081B6E54: .4byte 0x0203ce7c +_081B6E58: .4byte 0x02021cc4 +_081B6E5C: .4byte 0x02021dc4 +_081B6E60: .4byte 0x0831977c +_081B6E64: .4byte 0xffff0000 +_081B6E68: .4byte 0x03005e00 +_081B6E6C: .4byte sub_81B6EB4 + 1 +_081B6E70: + ldr r1, _081B6E74 + b _081B6E7A + .align 2, 0 +_081B6E74: .4byte 0x085e9ab4 +_081B6E78: + ldr r1, _081B6E84 +_081B6E7A: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B6E9C + .align 2, 0 +_081B6E84: .4byte 0x085e9c00 +_081B6E88: + ldr r0, _081B6EA8 + bl sub_81B6D74 + ldr r1, _081B6EAC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6EB0 + str r1, [r0] +_081B6E9C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6EA8: .4byte 0x085e9ae9 +_081B6EAC: .4byte 0x03005e00 +_081B6EB0: .4byte sub_81B6FF4 + 1 + thumb_func_end sub_81B6DC4 + + thumb_func_start sub_81B6EB4 +sub_81B6EB4: @ 81B6EB4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _081B6F38 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B6F3C + adds r5, r1, r0 + adds r6, r2, 0 + adds r6, 0xE + ldr r0, _081B6F40 + ldrh r4, [r0] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081B6EF0 + adds r0, r5, 0 + movs r1, 0x4 + bl happiness_algorithm + movs r0, 0xA9 + lsls r0, 1 + cmp r4, r0 + bhi _081B6EF0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D6AA4 +_081B6EF0: + ldr r1, _081B6F44 + adds r0, r5, 0 + bl sub_81B1B44 + ldr r0, _081B6F48 + movs r1, 0 + ldrsh r2, [r6, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B6F4C + adds r1, r2 + bl gf_strcpy + ldr r4, _081B6F50 + ldr r1, _081B6F54 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B6F58 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6F5C + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B6F38: .4byte 0x0203cec8 +_081B6F3C: .4byte 0x020244ec +_081B6F40: .4byte 0x0203ce7c +_081B6F44: .4byte 0x02021cc4 +_081B6F48: .4byte 0x02021dc4 +_081B6F4C: .4byte 0x0831977c +_081B6F50: .4byte 0x02021fc4 +_081B6F54: .4byte 0x085e9aa5 +_081B6F58: .4byte 0x03005e00 +_081B6F5C: .4byte sub_81B6F60 + 1 + thumb_func_end sub_81B6EB4 + + thumb_func_start sub_81B6F60 +sub_81B6F60: @ 81B6F60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6F86 + ldr r0, _081B6F8C + bl fanfare_play + ldr r1, _081B6F90 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B6F94 + str r1, [r0] +_081B6F86: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B6F8C: .4byte 0x0000016f +_081B6F90: .4byte 0x03005e00 +_081B6F94: .4byte sub_81B6F98 + 1 + thumb_func_end sub_81B6F60 + + thumb_func_start sub_81B6F98 +sub_81B6F98: @ 81B6F98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _081B6FEA + ldr r0, _081B6FD4 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081B6FC0 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B6FEA +_081B6FC0: + ldr r0, _081B6FD8 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _081B6FDC + adds r0, r4, 0 + bl sub_81B77AC + b _081B6FEA + .align 2, 0 +_081B6FD4: .4byte 0x030022c0 +_081B6FD8: .4byte 0x0203cec8 +_081B6FDC: + cmp r0, 0x2 + bne _081B6FE4 + ldr r0, _081B6FF0 + strh r2, [r0] +_081B6FE4: + adds r0, r5, 0 + bl sub_81B12C0 +_081B6FEA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B6FF0: .4byte 0x020375f0 + thumb_func_end sub_81B6F98 + + thumb_func_start sub_81B6FF4 +sub_81B6FF4: @ 81B6FF4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7018 + bl sub_81B334C + ldr r0, _081B7020 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7024 + str r0, [r1] +_081B7018: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B7020: .4byte 0x03005e00 +_081B7024: .4byte sub_81B7028 + 1 + thumb_func_end sub_81B6FF4 + + thumb_func_start sub_81B7028 +sub_81B7028: @ 81B7028 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B704E + cmp r1, 0 + bgt _081B7048 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B7074 + b _081B7080 +_081B7048: + cmp r1, 0x1 + beq _081B707A + b _081B7080 +_081B704E: + ldr r0, _081B7068 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, _081B706C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B7070 + str r1, [r0] + b _081B7080 + .align 2, 0 +_081B7068: .4byte 0x085e9b96 +_081B706C: .4byte 0x03005e00 +_081B7070: .4byte sub_81B7088 + 1 +_081B7074: + movs r0, 0x5 + bl audio_play +_081B707A: + adds r0, r4, 0 + bl sub_81B7230 +_081B7080: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B7028 + + thumb_func_start sub_81B7088 +sub_81B7088: @ 81B7088 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B70A8 + ldr r0, _081B70B0 + ldr r1, [r0] + ldr r0, _081B70B4 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B70A8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B70B0: .4byte 0x0203cec4 +_081B70B4: .4byte sub_81B70B8 + 1 + thumb_func_end sub_81B7088 + + thumb_func_start sub_81B70B8 +sub_81B70B8: @ 81B70B8 + push {r4,lr} + sub sp, 0x4 + ldr r0, _081B70E0 + ldr r4, _081B70E4 + ldrb r1, [r4, 0x9] + ldr r2, _081B70E8 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, _081B70EC + ldrh r4, [r4, 0xE] + str r4, [sp] + bl sub_81BFA38 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B70E0: .4byte 0x020244ec +_081B70E4: .4byte 0x0203cec8 +_081B70E8: .4byte 0x020244e9 +_081B70EC: .4byte sub_81B70F0 + 1 + thumb_func_end sub_81B70B8 + + thumb_func_start sub_81B70F0 +sub_81B70F0: @ 81B70F0 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, _081B7114 + str r0, [sp, 0x4] + ldr r0, _081B7118 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B7114: .4byte sub_81B711C + 1 +_081B7118: .4byte 0x0203cec8 + thumb_func_end sub_81B70F0 + + thumb_func_start sub_81B711C +sub_81B711C: @ 81B711C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, _081B7144 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B714E + bl sub_81C1B94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _081B7148 + adds r0, r4, 0 + bl sub_81B7154 + b _081B714E + .align 2, 0 +_081B7144: .4byte 0x02037fd4 +_081B7148: + adds r0, r5, 0 + bl sub_81B7230 +_081B714E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B711C + + thumb_func_start sub_81B7154 +sub_81B7154: @ 81B7154 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, _081B71B4 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, _081B71B8 + adds r5, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, _081B71BC + adds r0, r5, 0 + bl sub_81B1B44 + ldr r0, _081B71C0 + movs r1, 0xD + muls r1, r4 + ldr r2, _081B71C4 + adds r1, r2 + bl gf_strcpy + ldr r0, _081B71C8 + bl sub_81B6D74 + ldr r1, _081B71CC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B71D0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B71B4: .4byte 0x0203cec8 +_081B71B8: .4byte 0x020244ec +_081B71BC: .4byte 0x02021cc4 +_081B71C0: .4byte 0x02021dc4 +_081B71C4: .4byte 0x0831977c +_081B71C8: .4byte 0x085e9bb8 +_081B71CC: .4byte 0x03005e00 +_081B71D0: .4byte sub_81B71D4 + 1 + thumb_func_end sub_81B7154 + + thumb_func_start sub_81B71D4 +sub_81B71D4: @ 81B71D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7220 + ldr r5, _081B7228 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, _081B722C + adds r4, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806B9A8 + ldrh r5, [r5, 0xE] + bl sub_81C1B94 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80691F4 + adds r0, r6, 0 + bl sub_81B6EB4 +_081B7220: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B7228: .4byte 0x0203cec8 +_081B722C: .4byte 0x020244ec + thumb_func_end sub_81B71D4 + + thumb_func_start sub_81B7230 +sub_81B7230: @ 81B7230 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081B7278 + ldr r1, _081B727C + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B7280 + adds r1, r2 + bl gf_strcpy + ldr r4, _081B7284 + ldr r1, _081B7288 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B728C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B7290 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B7278: .4byte 0x02021dc4 +_081B727C: .4byte 0x0203cec8 +_081B7280: .4byte 0x0831977c +_081B7284: .4byte 0x02021fc4 +_081B7288: .4byte 0x085e9b5d +_081B728C: .4byte 0x03005e00 +_081B7290: .4byte sub_81B7294 + 1 + thumb_func_end sub_81B7230 + + thumb_func_start sub_81B7294 +sub_81B7294: @ 81B7294 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B72B8 + bl sub_81B334C + ldr r0, _081B72C0 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B72C4 + str r0, [r1] +_081B72B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B72C0: .4byte 0x03005e00 +_081B72C4: .4byte sub_81B72C8 + 1 + thumb_func_end sub_81B7294 + + thumb_func_start sub_81B72C8 +sub_81B72C8: @ 81B72C8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _081B72F8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B72FC + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _081B7306 + cmp r5, 0 + bgt _081B7300 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _081B738C + b _081B73C2 + .align 2, 0 +_081B72F8: .4byte 0x0203cec8 +_081B72FC: .4byte 0x020244ec +_081B7300: + cmp r5, 0x1 + beq _081B7392 + b _081B73C2 +_081B7306: + ldr r1, _081B734C + adds r0, r4, 0 + bl sub_81B1B44 + ldr r0, _081B7350 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B7354 + adds r1, r2 + bl gf_strcpy + ldr r4, _081B7358 + ldr r1, _081B735C + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r3, 0x10 + ldrsh r0, [r7, r3] + cmp r0, 0x1 + bne _081B7368 + ldr r0, _081B7360 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7364 + str r0, [r1] + b _081B73C2 + .align 2, 0 +_081B734C: .4byte 0x02021cc4 +_081B7350: .4byte 0x02021dc4 +_081B7354: .4byte 0x0831977c +_081B7358: .4byte 0x02021fc4 +_081B735C: .4byte 0x085e9b76 +_081B7360: .4byte 0x03005e00 +_081B7364: .4byte sub_81B73E4 + 1 +_081B7368: + cmp r0, 0x2 + bne _081B7370 + ldr r0, _081B7380 + strh r5, [r0] +_081B7370: + ldr r0, _081B7384 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7388 + str r0, [r1] + b _081B73C2 + .align 2, 0 +_081B7380: .4byte 0x020375f0 +_081B7384: .4byte 0x03005e00 +_081B7388: .4byte sub_81B6794 + 1 +_081B738C: + movs r0, 0x5 + bl audio_play +_081B7392: + ldr r1, _081B73C8 + adds r0, r4, 0 + bl sub_81B1B44 + ldr r0, _081B73CC + ldr r1, _081B73D0 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B73D4 + adds r1, r2 + bl gf_strcpy + ldr r0, _081B73D8 + bl sub_81B6D74 + ldr r1, _081B73DC + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B73E0 + str r1, [r0] +_081B73C2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B73C8: .4byte 0x02021cc4 +_081B73CC: .4byte 0x02021dc4 +_081B73D0: .4byte 0x0203cec8 +_081B73D4: .4byte 0x0831977c +_081B73D8: .4byte 0x085e9ae9 +_081B73DC: .4byte 0x03005e00 +_081B73E0: .4byte sub_81B6FF4 + 1 + thumb_func_end sub_81B72C8 + + thumb_func_start sub_81B73E4 +sub_81B73E4: @ 81B73E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B73FC + adds r0, r4, 0 + bl sub_81B77AC +_081B73FC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B73E4 + + thumb_func_start dp05_rare_candy +dp05_rare_candy: @ 81B7404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081B7468 + mov r9, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B746C + adds r5, r1, r0 + ldr r0, _081B7470 + ldr r6, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r4, r6, r1 + ldr r2, _081B7474 + mov r8, r2 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + beq _081B7478 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B79A0 + mov r1, r9 + ldrb r0, [r1, 0x9] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0 + bl sub_81B6520 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x89 + lsls r0, 2 + adds r1, r6, r0 + adds r0, r5, 0 + bl sub_81B79A0 + b _081B747A + .align 2, 0 +_081B7468: .4byte 0x0203cec8 +_081B746C: .4byte 0x020244ec +_081B7470: .4byte 0x0203cec4 +_081B7474: .4byte 0x0203ce7c +_081B7478: + movs r4, 0x1 +_081B747A: + movs r0, 0x5 + bl audio_play + cmp r4, 0 + beq _081B74B4 + ldr r1, _081B74A8 + movs r0, 0 + strb r0, [r1] + ldr r0, _081B74AC + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B74B0 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r1, r10 + b _081B7516 + .align 2, 0 +_081B74A8: .4byte 0x0203cee8 +_081B74AC: .4byte 0x085e96f6 +_081B74B0: .4byte 0x03005e00 +_081B74B4: + ldr r1, _081B7528 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl pause_music_for_sound_maybe + ldr r0, _081B752C + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B754C + ldr r0, _081B7530 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 + ldr r1, _081B7534 + adds r0, r5, 0 + bl sub_81B1B44 + ldr r4, _081B7538 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + ldr r4, _081B753C + ldr r1, _081B7540 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B7544 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B7548 +_081B7516: + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B7528: .4byte 0x0203cee8 +_081B752C: .4byte 0x0203cec8 +_081B7530: .4byte 0x0203ce7c +_081B7534: .4byte 0x02021cc4 +_081B7538: .4byte 0x02021dc4 +_081B753C: .4byte 0x02021fc4 +_081B7540: .4byte 0x085e9d0a +_081B7544: .4byte 0x03005e00 +_081B7548: .4byte sub_81B75D4 + 1 + thumb_func_end dp05_rare_candy + + thumb_func_start sub_81B754C +sub_81B754C: @ 81B754C + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r6, _081B75CC + lsls r4, r7, 4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl sub_81B60E4 + ldr r2, _081B75D0 + ldr r0, [r6] + adds r3, r4, r0 + ldrb r1, [r3, 0xC] + 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 + bge _081B7588 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7588: + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2CD4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2D74 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl sub_81B2E28 + ldr r0, [r6] + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B75CC: .4byte 0x0203cedc +_081B75D0: .4byte 0x02020630 + thumb_func_end sub_81B754C + + thumb_func_start sub_81B75D4 +sub_81B75D4: @ 81B75D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _081B7620 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7620 + ldr r0, _081B7628 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B7606 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7620 +_081B7606: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B767C + ldr r0, _081B762C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7630 + str r0, [r1] +_081B7620: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B7628: .4byte 0x030022c0 +_081B762C: .4byte 0x03005e00 +_081B7630: .4byte sub_81B7634 + 1 + thumb_func_end sub_81B75D4 + + thumb_func_start sub_81B7634 +sub_81B7634: @ 81B7634 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B7670 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B764E + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7668 +_081B764E: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B76C8 + ldr r0, _081B7674 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7678 + str r0, [r1] +_081B7668: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B7670: .4byte 0x030022c0 +_081B7674: .4byte 0x03005e00 +_081B7678: .4byte sub_81B7704 + 1 + thumb_func_end sub_81B7634 + + thumb_func_start sub_81B767C +sub_81B767C: @ 81B767C + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _081B76C4 + ldr r5, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r5, r0 + bl sub_81B3364 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldrh r0, [r4, 0x18] + movs r1, 0x89 + lsls r1, 2 + adds r2, r5, r1 + movs r1, 0x2 + str r1, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81D3640 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B76C4: .4byte 0x0203cec4 + thumb_func_end sub_81B767C + + thumb_func_start sub_81B76C8 +sub_81B76C8: @ 81B76C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, _081B7700 + ldr r1, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r1, r0 + ldrh r0, [r4, 0x18] + movs r2, 0x89 + lsls r2, 2 + adds r1, r2 + movs r2, 0x3 + str r2, [sp] + movs r2, 0x1 + movs r3, 0x2 + bl sub_81D3784 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B7700: .4byte 0x0203cec4 + thumb_func_end sub_81B76C8 + + thumb_func_start sub_81B7704 +sub_81B7704: @ 81B7704 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + bl ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _081B77A6 + ldr r0, _081B775C + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _081B772C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B77A6 +_081B772C: + bl sub_81B3394 + ldr r4, _081B7760 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B7764 + adds r0, r1 + movs r1, 0x1 + bl sub_8069318 + lsls r0, 16 + lsrs r1, r0, 16 + strh r6, [r4, 0x10] + ldr r0, _081B7768 + cmp r1, r0 + beq _081B7788 + cmp r1, r0 + bgt _081B776C + cmp r1, 0 + beq _081B7778 + b _081B77A0 + .align 2, 0 +_081B775C: .4byte 0x030022c0 +_081B7760: .4byte 0x0203cec8 +_081B7764: .4byte 0x020244ec +_081B7768: .4byte 0x0000fffe +_081B776C: + ldr r0, _081B7774 + cmp r1, r0 + beq _081B7780 + b _081B77A0 + .align 2, 0 +_081B7774: .4byte 0x0000ffff +_081B7778: + adds r0, r5, 0 + bl sub_81B7810 + b _081B77A6 +_081B7780: + adds r0, r5, 0 + bl sub_81B787C + b _081B77A6 +_081B7788: + ldr r0, _081B7798 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B779C + str r0, [r1] + b _081B77A6 + .align 2, 0 +_081B7798: .4byte 0x03005e00 +_081B779C: .4byte sub_81B77AC + 1 +_081B77A0: + adds r0, r5, 0 + bl sub_81B7910 +_081B77A6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7704 + + thumb_func_start sub_81B77AC +sub_81B77AC: @ 81B77AC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B77DC + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B77E0 + adds r0, r1 + movs r1, 0 + bl sub_8069318 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _081B77E4 + cmp r1, r0 + beq _081B780A + cmp r1, r0 + bgt _081B77E8 + cmp r1, 0 + beq _081B77F4 + b _081B7804 + .align 2, 0 +_081B77DC: .4byte 0x0203cec8 +_081B77E0: .4byte 0x020244ec +_081B77E4: .4byte 0x0000fffe +_081B77E8: + ldr r0, _081B77F0 + cmp r1, r0 + beq _081B77FC + b _081B7804 + .align 2, 0 +_081B77F0: .4byte 0x0000ffff +_081B77F4: + adds r0, r4, 0 + bl sub_81B7810 + b _081B780A +_081B77FC: + adds r0, r4, 0 + bl sub_81B787C + b _081B780A +_081B7804: + adds r0, r4, 0 + bl sub_81B7910 +_081B780A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B77AC + + thumb_func_start sub_81B7810 +sub_81B7810: @ 81B7810 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, _081B7854 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B7858 + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + bl sub_806D098 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081B7860 + bl sub_81B06F4 + ldr r0, _081B785C + ldr r1, [r6] + str r1, [r0] + ldrb r3, [r6, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_813DA40 + adds r0, r5, 0 + bl remove_task + b _081B786E + .align 2, 0 +_081B7854: .4byte 0x0203cec8 +_081B7858: .4byte 0x020244ec +_081B785C: .4byte 0x030061e8 +_081B7860: + ldr r0, _081B7874 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7878 + str r0, [r1] +_081B786E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B7874: .4byte 0x03005e00 +_081B7878: .4byte sub_81B6794 + 1 + thumb_func_end sub_81B7810 + + thumb_func_start sub_81B787C +sub_81B787C: @ 81B787C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081B78E8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B78EC + adds r0, r1 + ldr r1, _081B78F0 + bl sub_81B1B44 + ldr r0, _081B78F4 + ldr r6, _081B78F8 + ldrh r2, [r6] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B78FC + adds r1, r2 + bl gf_strcpy + ldr r4, _081B7900 + ldr r1, _081B7904 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + mov r1, r8 + strh r0, [r1, 0xE] + ldr r1, _081B7908 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B790C + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B78E8: .4byte 0x0203cec8 +_081B78EC: .4byte 0x020244ec +_081B78F0: .4byte 0x02021cc4 +_081B78F4: .4byte 0x02021dc4 +_081B78F8: .4byte 0x020244e2 +_081B78FC: .4byte 0x0831977c +_081B7900: .4byte 0x02021fc4 +_081B7904: .4byte 0x085e9ae9 +_081B7908: .4byte 0x03005e00 +_081B790C: .4byte sub_81B6FF4 + 1 + thumb_func_end sub_81B787C + + thumb_func_start sub_81B7910 +sub_81B7910: @ 81B7910 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, _081B797C + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B7980 + adds r0, r1 + ldr r1, _081B7984 + bl sub_81B1B44 + ldr r0, _081B7988 + movs r1, 0xD + muls r1, r5 + ldr r2, _081B798C + adds r1, r2 + bl gf_strcpy + ldr r4, _081B7990 + ldr r1, _081B7994 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + mov r0, r8 + strh r5, [r0, 0xE] + ldr r1, _081B7998 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B799C + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B797C: .4byte 0x0203cec8 +_081B7980: .4byte 0x020244ec +_081B7984: .4byte 0x02021cc4 +_081B7988: .4byte 0x02021dc4 +_081B798C: .4byte 0x0831977c +_081B7990: .4byte 0x02021fc4 +_081B7994: .4byte 0x085e9aa5 +_081B7998: .4byte 0x03005e00 +_081B799C: .4byte sub_81B6F60 + 1 + thumb_func_end sub_81B7910 + + thumb_func_start sub_81B79A0 +sub_81B79A0: @ 81B79A0 + 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, 0x3E + bl pokemon_getattr + strh r0, [r5, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + strh r0, [r5, 0xA] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + strh r0, [r5, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B79A0 + + thumb_func_start sub_81B79E8 +sub_81B79E8: @ 81B79E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B7A1C + ldr r2, [r1] + movs r3, 0x86 + lsls r3, 2 + adds r1, r2, r3 + movs r3, 0 + strh r3, [r1] + ldr r4, _081B7A20 + adds r1, r2, r4 + strh r3, [r1] + ldr r1, _081B7A24 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + movs r3, 0x87 + lsls r3, 2 + adds r2, r3 + strh r1, [r2] + bl sub_81B7A28 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B7A1C: .4byte 0x0203cec4 +_081B7A20: .4byte 0x0000021a +_081B7A24: .4byte 0x0203cec8 + thumb_func_end sub_81B79E8 + + thumb_func_start sub_81B7A28 +sub_81B7A28: @ 81B7A28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + ldr r6, _081B7A80 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B7A84 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B7A6E + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldrb r0, [r6, 0x9] + ldr r1, _081B7A88 + ldrh r1, [r1] + movs r2, 0 + bl sub_81B6520 + lsls r0, 24 + cmp r0, 0 + beq _081B7A94 +_081B7A6E: + ldr r0, _081B7A8C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B7A90 + str r0, [r1] + b _081B7B2A + .align 2, 0 +_081B7A80: .4byte 0x0203cec8 +_081B7A84: .4byte 0x020244ec +_081B7A88: .4byte 0x0203ce7c +_081B7A8C: .4byte 0x03005e00 +_081B7A90: .4byte task_intro_gamefreak + 1 +_081B7A94: + movs r0, 0x1 + bl audio_play + ldr r4, _081B7B38 + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl sub_81B60E4 + ldr r2, _081B7B3C + movs r0, 0x9 + ldrsb r0, [r6, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + 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 + bge _081B7AD6 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7AD6: + ldr r4, _081B7B40 + ldr r0, [r4] + movs r1, 0x87 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r6, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + subs r3, r7 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r6, 0x9] + ldr r0, _081B7B44 + str r0, [sp] + mov r0, r8 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r8 + movs r1, 0 + adds r2, r7, 0 + bl sub_81B1FA8 + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 2 + adds r1, r0, r2 + movs r2, 0x1 + strh r2, [r1] + ldr r1, _081B7B48 + adds r0, r1 + strh r2, [r0] +_081B7B2A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B7B38: .4byte 0x0203cedc +_081B7B3C: .4byte 0x02020630 +_081B7B40: .4byte 0x0203cec4 +_081B7B44: .4byte sub_81B7C10 + 1 +_081B7B48: .4byte 0x0000021a + thumb_func_end sub_81B7A28 + + thumb_func_start task_intro_gamefreak +task_intro_gamefreak: @ 81B7B4C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7C0A + ldr r5, _081B7BB4 + ldr r2, [r5] + movs r0, 0x86 + lsls r0, 2 + adds r1, r2, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + ldr r3, _081B7BB8 + cmp r0, 0x1 + bne _081B7B82 + movs r0, 0 + strh r0, [r1] + movs r1, 0x9 + ldrsb r1, [r3, r1] + movs r6, 0x87 + lsls r6, 2 + adds r0, r2, r6 + strh r1, [r0] +_081B7B82: + ldrb r0, [r3, 0x9] + adds r0, 0x1 + strb r0, [r3, 0x9] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x6 + bne _081B7C04 + ldr r0, [r5] + ldr r1, _081B7BBC + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _081B7BC8 + ldr r0, _081B7BC0 + strb r1, [r0] + ldr r0, _081B7BC4 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B7BD8 + .align 2, 0 +_081B7BB4: .4byte 0x0203cec4 +_081B7BB8: .4byte 0x0203cec8 +_081B7BBC: .4byte 0x0000021a +_081B7BC0: .4byte 0x0203cee8 +_081B7BC4: .4byte 0x085e96f6 +_081B7BC8: + ldr r1, _081B7BF0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _081B7BF4 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80D6AA4 +_081B7BD8: + ldr r1, _081B7BF8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B7BFC + str r1, [r0] + ldr r1, _081B7C00 + movs r0, 0 + strb r0, [r1, 0x9] + b _081B7C0A + .align 2, 0 +_081B7BF0: .4byte 0x0203cee8 +_081B7BF4: .4byte 0x0203ce7c +_081B7BF8: .4byte 0x03005e00 +_081B7BFC: .4byte sub_81B6794 + 1 +_081B7C00: .4byte 0x0203cec8 +_081B7C04: + adds r0, r4, 0 + bl sub_81B7A28 +_081B7C0A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task_intro_gamefreak + + thumb_func_start sub_81B7C10 +sub_81B7C10: @ 81B7C10 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _081B7C58 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B7C5C + adds r0, r1 + ldr r1, _081B7C60 + bl sub_81B1B44 + ldr r4, _081B7C64 + ldr r1, _081B7C68 + adds r0, r4, 0 + bl ExpandTextCodes + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B7C6C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B7C70 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B7C58: .4byte 0x0203cec8 +_081B7C5C: .4byte 0x020244ec +_081B7C60: .4byte 0x02021cc4 +_081B7C64: .4byte 0x02021fc4 +_081B7C68: .4byte 0x085e9c17 +_081B7C6C: .4byte 0x03005e00 +_081B7C70: .4byte task_intro_gamefreak + 1 + thumb_func_end sub_81B7C10 + + thumb_func_start sub_81B7C74 +sub_81B7C74: @ 81B7C74 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl audio_play + ldr r2, _081B7CC0 + ldr r1, _081B7CC4 + ldr r0, [r1] + str r0, [r2] + ldrb r0, [r1, 0x9] + ldr r4, _081B7CC8 + ldrh r1, [r4] + movs r2, 0 + bl sub_81B6520 + lsls r0, 24 + cmp r0, 0 + beq _081B7CD8 + ldr r1, _081B7CCC + movs r0, 0 + strb r0, [r1] + ldr r0, _081B7CD0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B7CD4 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + str r6, [r0] + b _081B7CE4 + .align 2, 0 +_081B7CC0: .4byte 0x030061e8 +_081B7CC4: .4byte 0x0203cec8 +_081B7CC8: .4byte 0x0203ce7c +_081B7CCC: .4byte 0x0203cee8 +_081B7CD0: .4byte 0x085e96f6 +_081B7CD4: .4byte 0x03005e00 +_081B7CD8: + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6AA4 + bl sub_81B06F4 +_081B7CE4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7C74 + + thumb_func_start sub_81B7CEC +sub_81B7CEC: @ 81B7CEC + push {r4,r5,lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + subs r2, 0xD + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bls _081B7D00 + b _081B7E40 +_081B7D00: + cmp r1, 0xAF + bne _081B7D18 + ldr r0, _081B7D10 + ldr r0, [r0] + ldr r1, _081B7D14 + adds r4, r0, r1 + b _081B7D20 + .align 2, 0 +_081B7D10: .4byte 0x03005d8c +_081B7D14: .4byte 0x00003214 +_081B7D18: + ldr r1, _081B7D48 + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] +_081B7D20: + ldrb r1, [r4] + movs r5, 0x3F + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _081B7D42 + ldrb r3, [r4, 0x3] + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _081B7D4C +_081B7D42: + movs r0, 0 + b _081B7E46 + .align 2, 0 +_081B7D48: .4byte 0x0831e58c +_081B7D4C: + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7D5A + movs r0, 0xA + b _081B7E46 +_081B7D5A: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _081B7D66 + movs r0, 0x1 + b _081B7E46 +_081B7D66: + adds r2, r5, 0 + ands r2, r3 + cmp r2, 0 + bne _081B7D74 + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB6 +_081B7D74: + cmp r2, 0x20 + bne _081B7D7C + movs r0, 0x4 + b _081B7E46 +_081B7D7C: + cmp r2, 0x10 + bne _081B7D84 + movs r0, 0x3 + b _081B7E46 +_081B7D84: + cmp r2, 0x8 + bne _081B7D8C + movs r0, 0x5 + b _081B7E46 +_081B7D8C: + cmp r2, 0x4 + bne _081B7D94 + movs r0, 0x6 + b _081B7E46 +_081B7D94: + cmp r2, 0x2 + bne _081B7D9C + movs r0, 0x7 + b _081B7E46 +_081B7D9C: + cmp r2, 0x1 + bne _081B7DA4 + movs r0, 0x8 + b _081B7E46 +_081B7DA4: + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB2 + cmp r2, 0 + bne _081B7DB2 + movs r0, 0x9 + b _081B7E46 +_081B7DB2: + movs r0, 0xB + b _081B7E46 +_081B7DB6: + ldrb r1, [r4, 0x4] + movs r0, 0x44 + ands r0, r1 + adds r2, r1, 0 + cmp r0, 0 + beq _081B7DC6 + movs r0, 0x2 + b _081B7E46 +_081B7DC6: + movs r5, 0x2 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DD4 + movs r0, 0xC + b _081B7E46 +_081B7DD4: + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DE2 + movs r0, 0xD + b _081B7E46 +_081B7DE2: + ldrb r1, [r4, 0x5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081B7DF0 + movs r0, 0xE + b _081B7E46 +_081B7DF0: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081B7DFC + movs r0, 0xF + b _081B7E46 +_081B7DFC: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E08 + movs r0, 0x10 + b _081B7E46 +_081B7E08: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E14 + movs r0, 0x11 + b _081B7E46 +_081B7E14: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _081B7E20 + movs r0, 0x12 + b _081B7E46 +_081B7E20: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _081B7E2C + movs r0, 0x13 + b _081B7E46 +_081B7E2C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081B7E38 + movs r0, 0x14 + b _081B7E46 +_081B7E38: + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + bne _081B7E44 +_081B7E40: + movs r0, 0x16 + b _081B7E46 +_081B7E44: + movs r0, 0x15 +_081B7E46: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B7CEC + + thumb_func_start sub_81B7E4C +sub_81B7E4C: @ 81B7E4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _081B7ED0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B7F1C + ldr r7, _081B7ED4 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B7ED8 + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r1, _081B7EDC + adds r0, r5, 0 + bl sub_81B1B44 + ldr r4, _081B7EE0 + ldrb r0, [r4] + bl sub_81B2360 + strh r0, [r7, 0xE] + ldr r0, _081B7EE4 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, _081B7EE8 + adds r1, r2 + bl gf_strcpy + movs r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x2] + ldrb r2, [r4] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7EF0 + cmp r0, 0x2 + beq _081B7EF8 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, _081B7EEC + cmp r0, r1 + beq _081B7F08 + adds r0, r6, 0 + bl sub_81B6EB4 + b _081B7F1C + .align 2, 0 +_081B7ED0: .4byte 0x02037fd4 +_081B7ED4: .4byte 0x0203cec8 +_081B7ED8: .4byte 0x020244ec +_081B7EDC: .4byte 0x02021cc4 +_081B7EE0: .4byte 0x020375e2 +_081B7EE4: .4byte 0x02021dc4 +_081B7EE8: .4byte 0x0831977c +_081B7EEC: .4byte 0xffff0000 +_081B7EF0: + ldr r1, _081B7EF4 + b _081B7EFA + .align 2, 0 +_081B7EF4: .4byte 0x085e9ab4 +_081B7EF8: + ldr r1, _081B7F04 +_081B7EFA: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B7F1C + .align 2, 0 +_081B7F04: .4byte 0x085e9c00 +_081B7F08: + ldr r0, _081B7F28 + bl sub_81B6D74 + ldr r1, _081B7F2C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B7F30 + str r1, [r0] +_081B7F1C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B7F28: .4byte 0x085e9ae9 +_081B7F2C: .4byte 0x03005e00 +_081B7F30: .4byte sub_81B6FF4 + 1 + thumb_func_end sub_81B7E4C + + thumb_func_start sub_81B7F34 +sub_81B7F34: @ 81B7F34 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, _081B7F58 + str r0, [sp, 0x4] + ldr r0, _081B7F5C + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B7F58: .4byte sub_81B1370 + 1 +_081B7F5C: .4byte sub_8086194 + 1 + thumb_func_end sub_81B7F34 + + thumb_func_start sub_81B7F60 +sub_81B7F60: @ 81B7F60 + push {lr} + sub sp, 0xC + bl sub_81A9E40 + lsls r0, 24 + ldr r1, _081B7F98 + cmp r0, 0 + bne _081B7F72 + ldr r1, _081B7F9C +_081B7F72: + movs r0, 0x6 + str r0, [sp] + ldr r0, _081B7FA0 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x5 + movs r3, 0 + bl sub_81B0038 + ldr r1, _081B7FA4 + ldr r0, _081B7FA8 + ldrh r0, [r0] + strh r0, [r1, 0xC] + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B7F98: .4byte sub_81C4F84 + 1 +_081B7F9C: .4byte c2_815ABFC + 1 +_081B7FA0: .4byte sub_81B1370 + 1 +_081B7FA4: .4byte 0x0203cec8 +_081B7FA8: .4byte 0x0203ce7c + thumb_func_end sub_81B7F60 + + thumb_func_start sub_81B7FAC +sub_81B7FAC: @ 81B7FAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, _081B7FEC + ldr r0, _081B7FF0 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, _081B7FF4 + adds r0, r7 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + bne _081B7FF8 + adds r0, r4, 0 + bl sub_81B8044 + b _081B8030 + .align 2, 0 +_081B7FEC: .4byte 0x0203cefc +_081B7FF0: .4byte 0x0203cec8 +_081B7FF4: .4byte 0x020244ec +_081B7FF8: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B800C + adds r0, r4, 0 + bl sub_81B83B8 + b _081B8030 +_081B800C: + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r5] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, _081B803C + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B8040 + str r1, [r0] +_081B8030: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B803C: .4byte 0x03005e00 +_081B8040: .4byte sub_81B82A0 + 1 + thumb_func_end sub_81B7FAC + + thumb_func_start sub_81B8044 +sub_81B8044: @ 81B8044 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, _081B8070 + ldrh r0, [r5, 0xC] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B807C + ldrh r0, [r5, 0xC] + bl sub_81B83F0 + ldr r0, _081B8074 + ldr r1, [r0] + ldr r0, _081B8078 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B8082 + .align 2, 0 +_081B8070: .4byte 0x0203cec8 +_081B8074: .4byte 0x0203cec4 +_081B8078: .4byte sub_81B814C + 1 +_081B807C: + adds r0, r4, 0 + bl sub_81B8088 +_081B8082: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B8044 + + thumb_func_start sub_81B8088 +sub_81B8088: @ 81B8088 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _081B80F0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B80E4 + ldr r4, _081B80F4 + ldrh r5, [r4, 0xC] + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, _081B80F8 + adds r0, r6 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 + movs r0, 0x9 + ldrsb r0, [r4, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + adds r1, r5, 0 + bl sub_81B1DB8 + adds r0, r5, 0 + bl sub_81B83F0 + ldr r1, _081B80FC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B8100 + str r1, [r0] +_081B80E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B80F0: .4byte 0x02037fd4 +_081B80F4: .4byte 0x0203cec8 +_081B80F8: .4byte 0x020244ec +_081B80FC: .4byte 0x03005e00 +_081B8100: .4byte sub_81B8104 + 1 + thumb_func_end sub_81B8088 + + thumb_func_start sub_81B8104 +sub_81B8104: @ 81B8104 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B8140 + ldrb r4, [r0, 0x9] + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B8138 + lsls r2, r4, 24 + asrs r2, 24 + movs r0, 0x64 + muls r0, r2 + ldr r1, _081B8144 + adds r0, r1 + ldr r1, _081B8148 + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + bl sub_81B5C94 + adds r0, r5, 0 + bl sub_81B12C0 +_081B8138: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B8140: .4byte 0x0203cec8 +_081B8144: .4byte 0x020244ec +_081B8148: .4byte 0x0203cedc + thumb_func_end sub_81B8104 + + thumb_func_start sub_81B814C +sub_81B814C: @ 81B814C + push {r4-r6,lr} + ldr r4, _081B8194 + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _081B8198 + adds r0, r5 + ldrh r1, [r4, 0xC] + bl sub_81B1DB8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B819C + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, _081B81A0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, _081B81A4 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B8194: .4byte 0x0203cec8 +_081B8198: .4byte 0x020244ec +_081B819C: .4byte 0x03005d8c +_081B81A0: .4byte 0x00002be0 +_081B81A4: .4byte sub_81B81A8 + 1 + thumb_func_end sub_81B814C + + thumb_func_start sub_81B81A8 +sub_81B81A8: @ 81B81A8 + push {r4-r7,lr} + sub sp, 0xC + ldr r6, _081B81F8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B81FC + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, _081B8200 + ldrh r0, [r0] + cmp r0, 0 + bne _081B8208 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, _081B8204 + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl pokemon_setattr + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6AA4 + adds r0, r7, 0 + bl sub_81B841C + ldr r0, [r6] + bl set_callback2 + b _081B8224 + .align 2, 0 +_081B81F8: .4byte 0x0203cec8 +_081B81FC: .4byte 0x020244ec +_081B8200: .4byte 0x020375f0 +_081B8204: .4byte 0x0203cefc +_081B8208: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, _081B822C + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B8224: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B822C: .4byte sub_81B8230 + 1 + thumb_func_end sub_81B81A8 + + thumb_func_start sub_81B8230 +sub_81B8230: @ 81B8230 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B8258 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B828A + ldr r1, _081B825C + ldrh r0, [r1] + cmp r0, 0 + beq _081B8264 + ldr r0, _081B8260 + ldrh r0, [r0, 0xC] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 + b _081B827C + .align 2, 0 +_081B8258: .4byte 0x02037fd4 +_081B825C: .4byte 0x0203cefc +_081B8260: .4byte 0x0203cec8 +_081B8264: + ldr r2, _081B8290 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B8294 + adds r0, r1 + ldrh r1, [r2, 0xC] + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 +_081B827C: + ldr r0, _081B8298 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B829C + str r0, [r1] +_081B828A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B8290: .4byte 0x0203cec8 +_081B8294: .4byte 0x020244ec +_081B8298: .4byte 0x03005e00 +_081B829C: .4byte sub_81B8104 + 1 + thumb_func_end sub_81B8230 + + thumb_func_start sub_81B82A0 +sub_81B82A0: @ 81B82A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B82C4 + bl sub_81B334C + ldr r0, _081B82CC + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B82D0 + str r0, [r1] +_081B82C4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B82CC: .4byte 0x03005e00 +_081B82D0: .4byte sub_81B82D4 + 1 + thumb_func_end sub_81B82A0 + + thumb_func_start sub_81B82D4 +sub_81B82D4: @ 81B82D4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B82FA + cmp r1, 0 + bgt _081B82F4 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B8394 + b _081B83A8 +_081B82F4: + cmp r1, 0x1 + beq _081B839A + b _081B83A8 +_081B82FA: + ldr r7, _081B832C + ldrh r4, [r7, 0xC] + adds r0, r4, 0 + bl sub_81B83F0 + ldr r6, _081B8330 + ldrh r0, [r6] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _081B8338 + adds r0, r4, 0 + bl sub_81B841C + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, _081B8334 + movs r1, 0 + bl sub_81B1B5C + b _081B8378 + .align 2, 0 +_081B832C: .4byte 0x0203cec8 +_081B8330: .4byte 0x0203cefc +_081B8334: .4byte 0x02021fc4 +_081B8338: + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B835C + ldr r0, _081B8354 + ldr r1, [r0] + ldr r0, _081B8358 + str r0, [r1, 0x4] + adds r0, r5, 0 + bl sub_81B12C0 + b _081B83A8 + .align 2, 0 +_081B8354: .4byte 0x0203cec4 +_081B8358: .4byte sub_81B814C + 1 +_081B835C: + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B8388 + adds r0, r1 + adds r1, r4, 0 + bl sub_81B1DB8 + ldrh r1, [r6] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1D68 +_081B8378: + ldr r1, _081B838C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B8390 + str r1, [r0] + b _081B83A8 + .align 2, 0 +_081B8388: .4byte 0x020244ec +_081B838C: .4byte 0x03005e00 +_081B8390: .4byte sub_81B8104 + 1 +_081B8394: + movs r0, 0x5 + bl audio_play +_081B839A: + ldr r0, _081B83B0 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B83B4 + str r0, [r1] +_081B83A8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B83B0: .4byte 0x03005e00 +_081B83B4: .4byte sub_81B8104 + 1 + thumb_func_end sub_81B82D4 + + thumb_func_start sub_81B83B8 +sub_81B83B8: @ 81B83B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081B83E4 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, _081B83E8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081B83EC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B83E4: .4byte 0x085e98ec +_081B83E8: .4byte 0x03005e00 +_081B83EC: .4byte sub_81B8104 + 1 + thumb_func_end sub_81B83B8 + + thumb_func_start sub_81B83F0 +sub_81B83F0: @ 81B83F0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _081B840C + ldrb r0, [r0, 0xB] + cmp r0, 0x6 + bne _081B8410 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80D6E48 + b _081B8418 + .align 2, 0 +_081B840C: .4byte 0x0203cec8 +_081B8410: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80D6AA4 +_081B8418: + pop {r0} + bx r0 + thumb_func_end sub_81B83F0 + + thumb_func_start sub_81B841C +sub_81B841C: @ 81B841C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _081B8434 + ldrb r0, [r0, 0xB] + cmp r0, 0x5 + beq _081B8438 + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80D6D70 + b _081B8440 + .align 2, 0 +_081B8434: .4byte 0x0203cec8 +_081B8438: + adds r0, r1, 0 + movs r1, 0x1 + bl bag_add_item +_081B8440: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81B841C + + thumb_func_start sub_81B8448 +sub_81B8448: @ 81B8448 + push {lr} + sub sp, 0xC + movs r0, 0x6 + str r0, [sp] + ldr r0, _081B846C + str r0, [sp, 0x4] + ldr r0, _081B8470 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x7 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B846C: .4byte sub_81B1370 + 1 +_081B8470: .4byte sub_816BB28 + 1 + thumb_func_end sub_81B8448 + + thumb_func_start sub_81B8474 +sub_81B8474: @ 81B8474 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _081B84C0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081B84C4 + adds r5, r1, r0 + ldr r1, _081B84C8 + movs r0, 0 + strb r0, [r1] + ldr r2, _081B84CC + ldr r0, _081B84D0 + ldrh r1, [r0] + adds r1, 0x6 + ldrh r0, [r0, 0x2] + adds r1, r0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _081B84D4 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + beq _081B84DC + ldr r0, _081B84D8 + movs r1, 0x1 + bl sub_81B1B5C + b _081B84F2 + .align 2, 0 +_081B84C0: .4byte 0x0203cec8 +_081B84C4: .4byte 0x020244ec +_081B84C8: .4byte 0x0203cee8 +_081B84CC: .4byte 0x03005d8c +_081B84D0: .4byte 0x0203bcb8 +_081B84D4: .4byte 0x00002be0 +_081B84D8: .4byte 0x085e9a08 +_081B84DC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D460C + adds r0, r4, 0 + bl sub_80D439C + ldr r0, _081B850C + movs r1, 0x1 + bl sub_81B1B5C +_081B84F2: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, _081B8510 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B8514 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B850C: .4byte 0x085e9a40 +_081B8510: .4byte 0x03005e00 +_081B8514: .4byte sub_81B8104 + 1 + thumb_func_end sub_81B8474 + + thumb_func_start sub_81B8518 +sub_81B8518: @ 81B8518 + push {lr} + sub sp, 0xC + bl sub_81B8558 + movs r0, 0 + str r0, [sp] + ldr r0, _081B8548 + str r0, [sp, 0x4] + ldr r0, _081B854C + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + ldr r1, _081B8550 + ldr r0, _081B8554 + str r0, [r1, 0x4] + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B8548: .4byte sub_81B1370 + 1 +_081B854C: .4byte 0x030022c0 +_081B8550: .4byte 0x0203cec8 +_081B8554: .4byte sub_81B879C + 1 + thumb_func_end sub_81B8518 + + thumb_func_start sub_81B8558 +sub_81B8558: @ 81B8558 + push {lr} + ldr r0, _081B8568 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .align 2, 0 +_081B8568: .4byte 0x0203cef8 + thumb_func_end sub_81B8558 + + thumb_func_start sub_81B856C +sub_81B856C: @ 81B856C + push {r4,lr} + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B8588 + adds r0, r1 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B858C + movs r0, 0x2 + b _081B85A4 + .align 2, 0 +_081B8588: .4byte 0x020244ec +_081B858C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81B8770 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B85A2 + movs r0, 0 + b _081B85A4 +_081B85A2: + movs r0, 0x1 +_081B85A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B856C + + thumb_func_start sub_81B85AC +sub_81B85AC: @ 81B85AC + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081B8608 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + bl sub_81B8888 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bhi _081B8608 + ldr r0, _081B860C + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _081B8610 + cmp r1, r0 + bne _081B85EA + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + bne _081B8608 +_081B85EA: + ldr r0, _081B8614 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B864A + cmp r0, 0x9 + bne _081B8618 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B864A +_081B8608: + movs r0, 0 + b _081B864C + .align 2, 0 +_081B860C: .4byte 0x03005d8c +_081B8610: .4byte 0x0000191a +_081B8614: .4byte 0x000040cf +_081B8618: + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r3, _081B8654 + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + ldr r2, _081B8658 + cmp r0, r2 + beq _081B864A +_081B8632: + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r4 + beq _081B8608 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B8632 +_081B864A: + movs r0, 0x1 +_081B864C: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081B8654: .4byte 0x08611c9a +_081B8658: .4byte 0x0000ffff + thumb_func_end sub_81B85AC + + thumb_func_start sub_81B865C +sub_81B865C: @ 81B865C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl sub_81B885C + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r2, 0 + ldr r3, _081B8684 + adds r0, r2, r3 + subs r0, 0x1 + ldrb r0, [r0] + cmp r0, 0 + bne _081B869C + cmp r2, 0x1 + bne _081B8688 + movs r0, 0xE + b _081B8758 + .align 2, 0 +_081B8684: .4byte 0x0203cef8 +_081B8688: + ldr r0, _081B8698 + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + movs r0, 0x11 + b _081B8758 + .align 2, 0 +_081B8698: .4byte 0x02021cc4 +_081B869C: + ldr r0, _081B86B4 + bl var_get + lsls r0, 24 + movs r1, 0xF8 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B86C0 + b _081B8756 + .align 2, 0 +_081B86B4: .4byte 0x000040cf +_081B86B8: + movs r0, 0x12 + b _081B8758 +_081B86BC: + movs r0, 0x13 + b _081B8758 +_081B86C0: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + b _081B8750 +_081B86CE: + ldr r3, _081B8768 + adds r4, r3, r5 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, _081B876C + adds r0, r3, r0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, _081B876C + adds r0, r3, r0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + mov r9, r1 + cmp r4, r8 + bcs _081B8748 + movs r7, 0x64 +_081B870E: + ldr r0, _081B8768 + adds r5, r0, r4 + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r1, _081B876C + adds r0, r1, r0 + movs r1, 0xB + bl pokemon_getattr + cmp r10, r0 + beq _081B86B8 + cmp r6, 0 + beq _081B873E + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r3, _081B876C + adds r0, r3, r0 + movs r1, 0xC + bl pokemon_getattr + cmp r6, r0 + beq _081B86BC +_081B873E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r8 + bcc _081B870E +_081B8748: + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 + mov r0, r8 +_081B8750: + subs r0, 0x1 + cmp r5, r0 + blt _081B86CE +_081B8756: + movs r0, 0xFF +_081B8758: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081B8768: .4byte 0x0203cef8 +_081B876C: .4byte 0x020244ec + thumb_func_end sub_81B865C + + thumb_func_start sub_81B8770 +sub_81B8770: @ 81B8770 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, _081B8788 +_081B877A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081B878C + movs r0, 0x1 + b _081B8798 + .align 2, 0 +_081B8788: .4byte 0x0203cef8 +_081B878C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081B877A + movs r0, 0 +_081B8798: + pop {r1} + bx r1 + thumb_func_end sub_81B8770 + + thumb_func_start sub_81B879C +sub_81B879C: @ 81B879C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B865C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _081B87D4 + movs r0, 0x20 + bl audio_play + adds r0, r4, 0 + bl sub_81B3054 + ldr r0, _081B87CC + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B87D0 + str r0, [r1] + b _081B87E0 + .align 2, 0 +_081B87CC: .4byte 0x03005e00 +_081B87D0: .4byte sub_81B87E8 + 1 +_081B87D4: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81B12C0 +_081B87E0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B879C + + thumb_func_start sub_81B87E8 +sub_81B87E8: @ 81B87E8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _081B8824 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B8802 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B881C +_081B8802: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81B3054 + ldr r0, _081B8828 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B882C + str r0, [r1] +_081B881C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B8824: .4byte 0x030022c0 +_081B8828: .4byte 0x03005e00 +_081B882C: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B87E8 + + thumb_func_start sub_81B8830 +sub_81B8830: @ 81B8830 + push {lr} + ldr r0, _081B8848 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B884C + cmp r0, 0x9 + bne _081B8850 + movs r0, 0x3 + b _081B8854 + .align 2, 0 +_081B8848: .4byte 0x000040cf +_081B884C: + movs r0, 0x2 + b _081B8854 +_081B8850: + ldr r0, _081B8858 + ldrb r0, [r0] +_081B8854: + pop {r1} + bx r1 + .align 2, 0 +_081B8858: .4byte 0x020375e2 + thumb_func_end sub_81B8830 + + thumb_func_start sub_81B885C +sub_81B885C: @ 81B885C + push {lr} + ldr r0, _081B8874 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B8878 + cmp r0, 0x9 + bne _081B887C + movs r0, 0x1 + b _081B8880 + .align 2, 0 +_081B8874: .4byte 0x000040cf +_081B8878: + movs r0, 0x2 + b _081B8880 +_081B887C: + ldr r0, _081B8884 + ldrb r0, [r0] +_081B8880: + pop {r1} + bx r1 + .align 2, 0 +_081B8884: .4byte 0x020375e2 + thumb_func_end sub_81B885C + + thumb_func_start sub_81B8888 +sub_81B8888: @ 81B8888 + push {lr} + ldr r0, _081B88A0 + bl var_get + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B88A4 + cmp r0, 0x9 + bne _081B88A8 +_081B889C: + movs r0, 0x64 + b _081B88B2 + .align 2, 0 +_081B88A0: .4byte 0x000040cf +_081B88A4: + movs r0, 0x1E + b _081B88B2 +_081B88A8: + ldr r0, _081B88B8 + ldrh r0, [r0] + cmp r0, 0 + bne _081B889C + movs r0, 0x32 +_081B88B2: + pop {r1} + bx r1 + .align 2, 0 +_081B88B8: .4byte 0x020375e0 + thumb_func_end sub_81B8888 + + thumb_func_start sub_81B88BC +sub_81B88BC: @ 81B88BC + push {lr} + ldr r0, _081B88D8 + bl var_get + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xF8 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B88E0 + ldr r0, _081B88DC + b _081B88FA + .align 2, 0 +_081B88D8: .4byte 0x000040cf +_081B88DC: .4byte 0x085ea126 +_081B88E0: + cmp r1, 0x1 + bne _081B88F8 + ldr r0, _081B88F0 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081B88F8 + ldr r0, _081B88F4 + b _081B88FA + .align 2, 0 +_081B88F0: .4byte 0x020375e2 +_081B88F4: .4byte 0x085ea139 +_081B88F8: + ldr r0, _081B8900 +_081B88FA: + pop {r1} + bx r1 + .align 2, 0 +_081B8900: .4byte 0x085ea155 + thumb_func_end sub_81B88BC + + thumb_func_start sub_81B8904 +sub_81B8904: @ 81B8904 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + str r2, [sp] + ldr r2, _081B8928 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B8928: .4byte sub_81B1370 + 1 + thumb_func_end sub_81B8904 + + thumb_func_start sub_81B892C +sub_81B892C: @ 81B892C + push {lr} + sub sp, 0xC + movs r0, 0x4 + str r0, [sp] + ldr r0, _081B8950 + str r0, [sp, 0x4] + ldr r0, _081B8954 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B8950: .4byte sub_81B1370 + 1 +_081B8954: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_81B892C + + thumb_func_start sub_81B8958 +sub_81B8958: @ 81B8958 + push {lr} + sub sp, 0xC + movs r0, 0x1 + str r0, [sp] + ldr r0, _081B897C + str r0, [sp, 0x4] + ldr r0, _081B8980 + str r0, [sp, 0x8] + movs r0, 0xB + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B897C: .4byte sub_81B1370 + 1 +_081B8980: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 + thumb_func_end sub_81B8958 + + thumb_func_start sub_81B8984 +sub_81B8984: @ 81B8984 + push {lr} + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8994 + movs r0, 0 + b _081B89A6 +_081B8994: + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B89A4 + movs r0, 0x1 + b _081B89A6 +_081B89A4: + movs r0, 0x2 +_081B89A6: + pop {r1} + bx r1 + thumb_func_end sub_81B8984 + + thumb_func_start sub_81B89AC +sub_81B89AC: @ 81B89AC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp] + ldr r0, _081B89E8 + str r0, [sp, 0x4] + ldr r0, _081B89EC + str r0, [sp, 0x8] + movs r0, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B89E8: .4byte sub_81B1370 + 1 +_081B89EC: .4byte sub_8059D40 + 1 + thumb_func_end sub_81B89AC + + thumb_func_start sub_81B89F0 +sub_81B89F0: @ 81B89F0 + push {lr} + sub sp, 0xC + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x5 + str r0, [sp] + ldr r0, _081B8A24 + str r0, [sp, 0x4] + ldr r0, _081B8A28 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x3 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B8A24: .4byte sub_81B1370 + 1 +_081B8A28: .4byte c2_815ABFC + 1 + thumb_func_end sub_81B89F0 + + thumb_func_start sub_81B8A2C +sub_81B8A2C: @ 81B8A2C + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081B8A54 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B8A74 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081B8A74 + ldr r0, _081B8A58 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B8A5C + movs r0, 0x3 + b _081B8A76 + .align 2, 0 +_081B8A54: .4byte 0x02024550 +_081B8A58: .4byte 0x0203cec8 +_081B8A5C: + ldr r0, _081B8A70 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _081B8A74 + movs r0, 0x2 + b _081B8A76 + .align 2, 0 +_081B8A70: .4byte 0x02022fec +_081B8A74: + movs r0, 0x7 +_081B8A76: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B8A2C + + thumb_func_start sub_81B8A7C +sub_81B8A7C: @ 81B8A7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8AC4 + cmp r5, 0x1 + beq _081B8AA2 + cmp r5, 0x4 + beq _081B8AA2 + cmp r5, 0x5 + bne _081B8AC4 +_081B8AA2: + ldr r4, _081B8AB8 + bl sub_806EBF8 + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r0, _081B8ABC + ldr r1, _081B8AC0 + b _081B8C42 + .align 2, 0 +_081B8AB8: .4byte 0x02021cc4 +_081B8ABC: .4byte 0x02021fc4 +_081B8AC0: .4byte 0x085e97b2 +_081B8AC4: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081B8AE8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B8AF8 + ldr r1, _081B8AEC + adds r0, r4, 0 + bl sub_81B1B44 + ldr r0, _081B8AF0 + ldr r1, _081B8AF4 + b _081B8C42 + .align 2, 0 +_081B8AE8: .4byte 0x020244ec +_081B8AEC: .4byte 0x02021cc4 +_081B8AF0: .4byte 0x02021fc4 +_081B8AF4: .4byte 0x085e978f +_081B8AF8: + movs r4, 0 + b _081B8B24 +_081B8AFC: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081B8B1E + adds r0, r5, 0 + bl sub_81B8F38 + lsls r0, 24 + ldr r2, _081B8B4C + lsls r1, r4, 1 + adds r1, r2 + lsrs r0, 24 + ldrh r1, [r1] + cmp r0, r1 + beq _081B8BFC +_081B8B1E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B8B24: + ldr r0, _081B8B50 + ldrb r0, [r0] + cmp r4, r0 + bcc _081B8AFC + movs r7, 0x64 + adds r0, r5, 0 + muls r0, r7 + ldr r1, _081B8B54 + mov r8, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _081B8B60 + ldr r0, _081B8B58 + ldr r1, _081B8B5C + b _081B8C42 + .align 2, 0 +_081B8B4C: .4byte 0x0202406e +_081B8B50: .4byte 0x0202406c +_081B8B54: .4byte 0x020244ec +_081B8B58: .4byte 0x02021fc4 +_081B8B5C: .4byte 0x085e97e5 +_081B8B60: + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, _081B8B84 + ldr r1, [r1] + adds r1, 0x8B + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _081B8B94 + ldr r1, _081B8B88 + adds r0, r6, 0 + bl sub_81B1B44 + ldr r0, _081B8B8C + ldr r1, _081B8B90 + b _081B8C42 + .align 2, 0 +_081B8B84: .4byte 0x0202449c +_081B8B88: .4byte 0x02021cc4 +_081B8B8C: .4byte 0x02021fc4 +_081B8B90: .4byte 0x085e976f +_081B8B94: + ldr r0, _081B8BA4 + ldrb r0, [r0, 0xB] + cmp r0, 0x4 + bne _081B8BA8 + bl sub_806E994 + b _081B8C46 + .align 2, 0 +_081B8BA4: .4byte 0x0203cec8 +_081B8BA8: + cmp r0, 0x2 + beq _081B8C20 + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, _081B8BEC + strb r0, [r1] + ldr r1, _081B8BF0 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _081B8BF4 + ldr r0, _081B8BF8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r6, 0 + bl sub_81B1288 + movs r0, 0x1 + b _081B8C48 + .align 2, 0 +_081B8BEC: .4byte 0x0203cee9 +_081B8BF0: .4byte 0x0203cee8 +_081B8BF4: .4byte 0x0202406e +_081B8BF8: .4byte 0x020244b8 +_081B8BFC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081B8C10 + adds r0, r1 + ldr r1, _081B8C14 + bl sub_81B1B44 + ldr r0, _081B8C18 + ldr r1, _081B8C1C + b _081B8C42 + .align 2, 0 +_081B8C10: .4byte 0x020244ec +_081B8C14: .4byte 0x02021cc4 +_081B8C18: .4byte 0x02021fc4 +_081B8C1C: .4byte 0x085e9754 +_081B8C20: + ldr r0, _081B8C54 + ldrb r0, [r0] + ldr r1, _081B8C58 + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + add r0, r8 + ldr r1, _081B8C5C + bl sub_81B1B44 + ldr r0, _081B8C60 + ldr r1, _081B8C64 +_081B8C42: + bl ExpandTextCodes +_081B8C46: + movs r0, 0 +_081B8C48: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081B8C54: .4byte 0x020244b8 +_081B8C58: .4byte 0x0202406e +_081B8C5C: .4byte 0x02021cc4 +_081B8C60: .4byte 0x02021fc4 +_081B8C64: .4byte 0x085e9738 + thumb_func_end sub_81B8A7C + + thumb_func_start sub_81B8C68 +sub_81B8C68: @ 81B8C68 + push {r4,lr} + ldr r4, _081B8C84 + bl sub_806D7EC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8C88 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B8C84: .4byte 0x0203cf00 + thumb_func_end sub_81B8C68 + + thumb_func_start sub_81B8C88 +sub_81B8C88: @ 81B8C88 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8CBE + cmp r4, 0 + beq _081B8CB0 + movs r0, 0x30 + strb r0, [r6] + movs r0, 0x45 + strb r0, [r6, 0x1] + movs r0, 0x12 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CB0: + movs r0, 0x3 + strb r0, [r6] + movs r0, 0x12 + strb r0, [r6, 0x1] + movs r0, 0x45 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CBE: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8CFC + movs r5, 0x1 + movs r0, 0 + bl battle_get_side_with_given_state + mov r2, sp + ldr r1, _081B8CF8 + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8CE2: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8CF0 + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8CF0: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8CE2 + b _081B8D40 + .align 2, 0 +_081B8CF8: .4byte 0x0202406e +_081B8CFC: + movs r5, 0x2 + movs r0, 0 + bl battle_get_side_with_given_state + mov r1, sp + ldr r4, _081B8D60 + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1] + movs r0, 0x2 + bl battle_get_side_with_given_state + mov r1, sp + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8D26: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8D3A + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8D3A + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8D3A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8D26 +_081B8D40: + movs r4, 0 + mov r3, sp +_081B8D44: + adds r0, r6, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8D44 +_081B8D58: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B8D60: .4byte 0x0202406e + thumb_func_end sub_81B8C88 + + thumb_func_start sub_81B8D64 +sub_81B8D64: @ 81B8D64 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _081B8D84 + lsls r3, r2, 1 + adds r3, r2 + adds r3, 0x60 + ldr r0, [r0] + adds r0, r3 + bl sub_81B8D88 + pop {r0} + bx r0 + .align 2, 0 +_081B8D84: .4byte 0x0202449c + thumb_func_end sub_81B8D64 + + thumb_func_start sub_81B8D88 +sub_81B8D88: @ 81B8D88 + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r0, r2, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081B8DB0 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + b _081B8DBC +_081B8DB0: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 +_081B8DBC: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8DF0 + cmp r7, 0 + beq _081B8DE2 + movs r0, 0x30 + strb r0, [r5] + movs r0, 0x45 + strb r0, [r5, 0x1] + movs r0, 0x12 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DE2: + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x12 + strb r0, [r5, 0x1] + movs r0, 0x45 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DF0: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8E28 + movs r3, 0x1 + mov r2, sp + ldr r1, _081B8E24 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8E0C: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E1A + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E1A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E0C + b _081B8E5A + .align 2, 0 +_081B8E24: .4byte 0x0202406e +_081B8E28: + movs r3, 0x2 + mov r1, sp + ldr r2, _081B8E7C + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8E40: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E54 + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8E54 + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E54: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E40 +_081B8E5A: + movs r4, 0 + mov r3, sp +_081B8E5E: + adds r0, r5, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8E5E +_081B8E72: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B8E7C: .4byte 0x0202406e + thumb_func_end sub_81B8D88 + + thumb_func_start sub_81B8E80 +sub_81B8E80: @ 81B8E80 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r7, 0 + bl sub_81B1250 + lsls r0, 24 + cmp r0, 0 + beq _081B8F2E + ldr r0, _081B8EE4 + lsls r1, r4, 1 + adds r1, r4 + adds r1, 0x60 + ldr r0, [r0] + adds r4, r0, r1 + movs r2, 0 + add r6, sp + mov r12, r6 + movs r6, 0xF + mov r3, sp +_081B8EB2: + adds r1, r4, r2 + ldrb r0, [r1] + lsrs r0, 4 + strb r0, [r3] + adds r3, 0x1 + ldrb r1, [r1] + adds r0, r6, 0 + ands r0, r1 + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _081B8EB2 + mov r0, r12 + ldrb r3, [r0] + movs r2, 0 + mov r0, sp + ldrb r0, [r0] + cmp r0, r5 + bne _081B8EE8 + mov r0, sp + ldrb r7, [r0] + strb r3, [r0] + b _081B8EFC + .align 2, 0 +_081B8EE4: .4byte 0x0202449c +_081B8EE8: + adds r2, 0x1 + cmp r2, 0x5 + bgt _081B8EFC + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, r5 + bne _081B8EE8 + adds r7, r0, 0 + strb r3, [r1] +_081B8EFC: + cmp r2, 0x6 + beq _081B8F2E + mov r0, r12 + strb r7, [r0] + mov r0, sp + ldrb r0, [r0] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x1] + orrs r0, r1 + strb r0, [r4] + mov r0, sp + ldrb r0, [r0, 0x2] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x3] + orrs r0, r1 + strb r0, [r4, 0x1] + mov r0, sp + ldrb r0, [r0, 0x4] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x5] + orrs r0, r1 + strb r0, [r4, 0x2] +_081B8F2E: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B8E80 + + thumb_func_start sub_81B8F38 +sub_81B8F38: @ 81B8F38 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1 + ands r1, r2 + lsrs r2, r0, 25 + cmp r1, 0 + beq _081B8F58 + ldr r0, _081B8F54 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + b _081B8F60 + .align 2, 0 +_081B8F54: .4byte 0x0203cf00 +_081B8F58: + ldr r0, _081B8F68 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r1, r0, 4 +_081B8F60: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_081B8F68: .4byte 0x0203cf00 + thumb_func_end sub_81B8F38 + + thumb_func_start sub_81B8F6C +sub_81B8F6C: @ 81B8F6C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r1, 0x1 + ands r1, r3 + lsrs r3, r0, 25 + cmp r1, 0 + beq _081B8F94 + ldr r0, _081B8F90 + adds r0, r3, r0 + ldrb r2, [r0] + movs r1, 0xF0 + ands r1, r2 + orrs r1, r4 + strb r1, [r0] + b _081B8FA4 + .align 2, 0 +_081B8F90: .4byte 0x0203cf00 +_081B8F94: + ldr r2, _081B8FAC + adds r2, r3, r2 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r1, r4, 4 + orrs r0, r1 + strb r0, [r2] +_081B8FA4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B8FAC: .4byte 0x0203cf00 + thumb_func_end sub_81B8F6C + + thumb_func_start sub_81B8FB0 +sub_81B8FB0: @ 81B8FB0 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_81B8F38 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B8F6C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B8F6C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B8FB0 + + thumb_func_start pokemon_order_func +pokemon_order_func: @ 81B8FEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r5, _081B9014 +_081B8FF8: + adds r0, r3, r5 + ldrb r1, [r0] + lsrs r0, r1, 4 + cmp r0, r4 + beq _081B9010 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xF + ands r0, r1 + cmp r0, r4 + bne _081B9018 +_081B9010: + adds r0, r2, 0 + b _081B902A + .align 2, 0 +_081B9014: .4byte 0x0203cf00 +_081B9018: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _081B8FF8 + movs r0, 0 +_081B902A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end pokemon_order_func + + thumb_func_start pokemon_change_order +pokemon_change_order: @ 81B9030 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl malloc + adds r5, r0, 0 + ldr r1, _081B907C + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B904A: + adds r0, r4, 0 + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, _081B907C + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B904A + adds r0, r5, 0 + bl free + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B907C: .4byte 0x020244ec + thumb_func_end pokemon_change_order + + thumb_func_start sub_81B9080 +sub_81B9080: @ 81B9080 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl malloc + adds r5, r0, 0 + ldr r1, _081B90CC + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B909A: + adds r0, r4, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, _081B90CC + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B909A + adds r0, r5, 0 + bl free + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B90CC: .4byte 0x020244ec + thumb_func_end sub_81B9080 + + thumb_func_start sub_81B90D0 +sub_81B90D0: @ 81B90D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0x1 + movs r7, 0x64 + ldr r0, _081B9128 + mov r8, r0 +_081B90DE: + adds r0, r6, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B912C + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081B912C + movs r0, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r6, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r5, 0 + bl sub_81B1288 + b _081B9136 + .align 2, 0 +_081B9128: .4byte 0x020244ec +_081B912C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B90DE +_081B9136: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B90D0 + + thumb_func_start sub_81B9140 +sub_81B9140: @ 81B9140 + push {lr} + ldr r0, _081B914C + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081B914C: .4byte sub_8059D40 + 1 + thumb_func_end sub_81B9140 + + thumb_func_start sub_81B9150 +sub_81B9150: @ 81B9150 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, _081B9174 + str r0, [sp, 0x4] + ldr r0, _081B9178 + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x3 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B9174: .4byte sub_81B917C + 1 +_081B9178: .4byte 0x030022c0 + thumb_func_end sub_81B9150 + + thumb_func_start sub_81B917C +sub_81B917C: @ 81B917C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081B91AC + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0x80 + lsls r1, 1 + strh r1, [r4, 0x8] + bl sub_81B9294 + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0 + bl bg_change_x_offset + ldr r0, _081B91B0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B91AC: .4byte 0x03005e00 +_081B91B0: .4byte sub_81B91B4 + 1 + thumb_func_end sub_81B917C + + thumb_func_start sub_81B91B4 +sub_81B91B4: @ 81B91B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r0, 3 + ldr r1, _081B9228 + adds r4, r0, r1 + ldr r0, _081B922C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B9220 + ldrh r0, [r4] + subs r0, 0x8 + strh r0, [r4] + adds r0, r5, 0 + bl sub_81B9294 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B9220 + movs r4, 0x3 + ldr r7, _081B9230 +_081B91E8: + subs r0, r4, 0x3 + lsls r0, 5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _081B9204 + ldr r0, _081B9234 + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x9] + movs r1, 0 + bl sub_81B5B6C +_081B9204: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B91E8 + movs r0, 0x78 + bl audio_play + ldr r0, _081B9238 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081B923C + str r0, [r1] +_081B9220: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B9228: .4byte 0x03005e08 +_081B922C: .4byte 0x02037fd4 +_081B9230: .4byte 0x02022ff8 +_081B9234: .4byte 0x0203cedc +_081B9238: .4byte 0x03005e00 +_081B923C: .4byte sub_81B9240 + 1 + thumb_func_end sub_81B91B4 + + thumb_func_start sub_81B9240 +sub_81B9240: @ 81B9240 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, _081B926C + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bne _081B9266 + adds r0, r2, 0 + bl sub_81B12C0 +_081B9266: + pop {r0} + bx r0 + .align 2, 0 +_081B926C: .4byte 0x03005e08 + thumb_func_end sub_81B9240 + + thumb_func_start sub_81B9270 +sub_81B9270: @ 81B9270 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r1, 0 + blt _081B928A + ldr r1, _081B9290 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strh r3, [r0, 0x24] +_081B928A: + pop {r0} + bx r0 + .align 2, 0 +_081B9290: .4byte 0x02020630 + thumb_func_end sub_81B9270 + + thumb_func_start sub_81B9294 +sub_81B9294: @ 81B9294 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, _081B931C + adds r5, r1, r0 + movs r6, 0x3 + ldr r7, _081B9320 +_081B92A8: + ldr r0, _081B9324 + subs r1, r6, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081B9300 + ldr r0, [r7] + lsls r4, r6, 4 + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xA] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xB] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r4, r0 + ldrb r0, [r4, 0xC] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 +_081B9300: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B92A8 + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x1 + bl bg_change_x_offset + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B931C: .4byte 0x03005e08 +_081B9320: .4byte 0x0203cedc +_081B9324: .4byte 0x02022ff8 + thumb_func_end sub_81B9294 + + thumb_func_start sub_81B9328 +sub_81B9328: @ 81B9328 + push {lr} + sub sp, 0xC + movs r0, 0xF + str r0, [sp] + ldr r0, _081B934C + str r0, [sp, 0x4] + ldr r0, _081B9350 + str r0, [sp, 0x8] + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B934C: .4byte sub_81B1370 + 1 +_081B9350: .4byte sub_81B9390 + 1 + thumb_func_end sub_81B9328 + + thumb_func_start sub_81B9354 +sub_81B9354: @ 81B9354 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081B9380 + ldr r1, _081B9384 + str r1, [r2] + movs r1, 0 + str r1, [sp] + ldr r1, _081B9388 + str r1, [sp, 0x4] + ldr r1, _081B938C + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .align 2, 0 +_081B9380: .4byte 0x03005db0 +_081B9384: .4byte hm_add_c3_without_phase_2 + 1 +_081B9388: .4byte sub_81B1370 + 1 +_081B938C: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81B9354 + + thumb_func_start sub_81B9390 +sub_81B9390: @ 81B9390 + push {r4,lr} + ldr r4, _081B93B8 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + cmp r0, 0x5 + bls _081B93A6 + movs r0, 0xFF + strh r0, [r4] +_081B93A6: + ldr r0, _081B93BC + ldr r1, _081B93C0 + str r1, [r0] + ldr r0, _081B93C4 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B93B8: .4byte 0x020375e0 +_081B93BC: .4byte 0x03005db0 +_081B93C0: .4byte hm_add_c3_without_phase_2 + 1 +_081B93C4: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81B9390 + + thumb_func_start hm_add_c3_without_phase_2 +hm_add_c3_without_phase_2: @ 81B93C8 + push {lr} + bl pal_fill_black + ldr r0, _081B93DC + movs r1, 0xA + bl AddTask + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_081B93DC: .4byte task_hm_without_phase_2 + 1 + thumb_func_end hm_add_c3_without_phase_2 + + thumb_func_start task_hm_without_phase_2 +task_hm_without_phase_2: @ 81B93E0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _081B93FE + adds r0, r4, 0 + bl remove_task + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running +_081B93FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_hm_without_phase_2 + + thumb_func_start sub_81B9404 +sub_81B9404: @ 81B9404 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _081B9420 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081B9420: .4byte sub_81B9424 + 1 + thumb_func_end sub_81B9404 + + thumb_func_start sub_81B9424 +sub_81B9424: @ 81B9424 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B9464 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B945C + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, _081B9468 + str r0, [sp, 0x4] + ldr r0, _081B946C + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl remove_task +_081B945C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9464: .4byte 0x02037fd4 +_081B9468: .4byte sub_81B1370 + 1 +_081B946C: .4byte sub_81B9470 + 1 + thumb_func_end sub_81B9424 + + thumb_func_start sub_81B9470 +sub_81B9470: @ 81B9470 + push {lr} + bl brm_get_pokemon_selection + ldr r2, _081B949C + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081B9486 + movs r0, 0xFF + strb r0, [r2] +_081B9486: + ldr r1, _081B94A0 + ldrb r0, [r2] + strh r0, [r1] + ldr r1, _081B94A4 + ldr r0, _081B94A8 + str r0, [r1] + ldr r0, _081B94AC + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081B949C: .4byte 0x02039f24 +_081B94A0: .4byte 0x020375e0 +_081B94A4: .4byte 0x03005db0 +_081B94A8: .4byte hm_add_c3_without_phase_2 + 1 +_081B94AC: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81B9470 + + thumb_func_start sub_81B94B0 +sub_81B94B0: @ 81B94B0 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _081B94CC + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081B94CC: .4byte sub_81B94D0 + 1 + thumb_func_end sub_81B94B0 + + thumb_func_start sub_81B94D0 +sub_81B94D0: @ 81B94D0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B9510 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9508 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, _081B9514 + str r0, [sp, 0x4] + ldr r0, _081B9518 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl remove_task +_081B9508: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9510: .4byte 0x02037fd4 +_081B9514: .4byte sub_81B1370 + 1 +_081B9518: .4byte sub_81B9390 + 1 + thumb_func_end sub_81B94D0 + + thumb_func_start sub_81B951C +sub_81B951C: @ 81B951C + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _081B9538 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081B9538: .4byte sub_81B953C + 1 + thumb_func_end sub_81B951C + + thumb_func_start sub_81B953C +sub_81B953C: @ 81B953C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B957C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9574 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, _081B9580 + str r0, [sp, 0x4] + ldr r0, _081B9584 + str r0, [sp, 0x8] + movs r0, 0x7 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl remove_task +_081B9574: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B957C: .4byte 0x02037fd4 +_081B9580: .4byte sub_81B1370 + 1 +_081B9584: .4byte sub_81B9588 + 1 + thumb_func_end sub_81B953C + + thumb_func_start sub_81B9588 +sub_81B9588: @ 81B9588 + push {r4,r5,lr} + ldr r5, _081B95A0 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + cmp r0, 0x5 + bls _081B95A4 + movs r0, 0xFF + strh r0, [r5] + b _081B95BA + .align 2, 0 +_081B95A0: .4byte 0x020375e0 +_081B95A4: + ldr r4, _081B95CC + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B95D0 + adds r0, r1 + bl sub_806E25C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_081B95BA: + ldr r0, _081B95D4 + ldr r1, _081B95D8 + str r1, [r0] + ldr r0, _081B95DC + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B95CC: .4byte 0x020375e2 +_081B95D0: .4byte 0x020244ec +_081B95D4: .4byte 0x03005db0 +_081B95D8: .4byte hm_add_c3_without_phase_2 + 1 +_081B95DC: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81B9588 + + thumb_func_start sub_81B95E0 +sub_81B95E0: @ 81B95E0 + push {r4,r5,lr} + ldr r1, _081B95F0 + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 + b _081B95FA + .align 2, 0 +_081B95F0: .4byte 0x020375f0 +_081B95F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B95FA: + cmp r4, 0x2 + bhi _081B9614 + movs r0, 0x64 + muls r0, r4 + ldr r1, _081B961C + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + beq _081B95F4 + movs r0, 0x1 + strh r0, [r5] +_081B9614: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B961C: .4byte 0x020244ec + thumb_func_end sub_81B95E0 + + thumb_func_start sub_81B9620 +sub_81B9620: @ 81B9620 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, _081B963C + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081B963C: .4byte sub_81B9640 + 1 + thumb_func_end sub_81B9620 + + thumb_func_start sub_81B9640 +sub_81B9640: @ 81B9640 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _081B9680 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9678 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, _081B9684 + str r0, [sp, 0x4] + ldr r0, _081B9688 + str r0, [sp, 0x8] + movs r0, 0xC + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl remove_task +_081B9678: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9680: .4byte 0x02037fd4 +_081B9684: .4byte sub_81B1370 + 1 +_081B9688: .4byte sub_81B9390 + 1 + thumb_func_end sub_81B9640 + + thumb_func_start sub_81B968C +sub_81B968C: @ 81B968C + push {lr} + sub sp, 0x4 + ldr r1, _081B96B8 + ldr r0, _081B96BC + ldrb r2, [r0] + ldr r0, _081B96C0 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, _081B96C4 + str r0, [sp] + movs r0, 0x3 + bl sub_81BF8EC + ldr r1, _081B96C8 + ldr r0, _081B96CC + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_081B96B8: .4byte 0x020244ec +_081B96BC: .4byte 0x020375e0 +_081B96C0: .4byte 0x020244e9 +_081B96C4: .4byte c2_exit_to_overworld_2_switch + 1 +_081B96C8: .4byte 0x03005dac +_081B96CC: .4byte sub_80AF168 + 1 + thumb_func_end sub_81B968C + + thumb_func_start sub_81B96D0 +sub_81B96D0: @ 81B96D0 + push {r4,r5,lr} + ldr r1, _081B970C + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 +_081B96DC: + ldr r0, _081B9710 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B9714 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0xD + bl pokemon_getattr + cmp r0, 0 + beq _081B96FA + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081B96FA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B96DC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B970C: .4byte 0x020375f0 +_081B9710: .4byte 0x020375e0 +_081B9714: .4byte 0x020244ec + thumb_func_end sub_81B96D0 + + thumb_func_start sub_81B9718 +sub_81B9718: @ 81B9718 + push {r4,r5,lr} + ldr r0, _081B9758 + ldrh r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, _081B975C + adds r5, r0 + ldr r0, _081B9760 + ldrh r1, [r0] + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, _081B9764 + adds r0, r5, 0 + bl sub_81B1B44 + ldr r0, _081B9768 + movs r1, 0xD + muls r1, r4 + ldr r2, _081B976C + adds r1, r2 + bl gf_strcpy + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9758: .4byte 0x020375e0 +_081B975C: .4byte 0x020244ec +_081B9760: .4byte 0x020375e2 +_081B9764: .4byte 0x02021cc4 +_081B9768: .4byte 0x02021dc4 +_081B976C: .4byte 0x0831977c + thumb_func_end sub_81B9718 + + thumb_func_start sub_81B9770 +sub_81B9770: @ 81B9770 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _081B97D0 + mov r8, r0 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _081B97D4 + adds r0, r5 + ldr r4, _081B97D8 + ldrb r2, [r4] + movs r1, 0 + bl sub_80691F4 + mov r1, r8 + ldrh r0, [r1] + muls r0, r6 + adds r0, r5 + ldrb r1, [r4] + bl sub_806B9A8 + ldrh r4, [r4] + cmp r4, 0x2 + bhi _081B97C4 +_081B97A2: + ldr r0, _081B97D0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B97D4 + adds r0, r1 + lsls r1, r4, 24 + lsrs r1, 24 + adds r4, 0x1 + lsls r2, r4, 24 + lsrs r2, 24 + bl sub_81B97DC + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x2 + bls _081B97A2 +_081B97C4: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081B97D0: .4byte 0x020375e0 +_081B97D4: .4byte 0x020244ec +_081B97D8: .4byte 0x020375e2 + thumb_func_end sub_81B9770 + + thumb_func_start sub_81B97DC +sub_81B97DC: @ 81B97DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r0, 0xD + str r0, [sp, 0x8] + mov r0, r8 + ldr r1, [sp, 0x8] + bl pokemon_getattr + mov r1, sp + adds r1, 0x2 + str r1, [sp, 0x14] + strh r0, [r1] + adds r3, r4, 0 + adds r3, 0xD + str r3, [sp, 0xC] + mov r0, r8 + adds r1, r3, 0 + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r7, r5, 0 + adds r7, 0x11 + str r7, [sp, 0x10] + mov r0, r8 + adds r1, r7, 0 + bl pokemon_getattr + mov r1, sp + adds r1, 0x5 + str r1, [sp, 0x18] + strb r0, [r1] + adds r3, r4, 0 + adds r3, 0x11 + str r3, [sp, 0x1C] + mov r0, r8 + adds r1, r3, 0 + bl pokemon_getattr + add r7, sp, 0x4 + mov r10, r7 + strb r0, [r7] + mov r0, r8 + movs r1, 0x15 + bl pokemon_getattr + mov r6, sp + adds r6, 0x6 + strb r0, [r6] + ldr r1, _081B98D8 + adds r0, r5, r1 + ldrb r0, [r0] + mov r9, r0 + ldrb r0, [r6] + adds r2, r0, 0 + mov r3, r9 + ands r2, r3 + lsls r5, 1 + asrs r2, r5 + lsls r2, 24 + lsrs r2, 24 + adds r1, r4, r1 + ldrb r3, [r1] + adds r1, r0, 0 + ands r1, r3 + lsls r4, 1 + asrs r1, r4 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + bics r0, r7 + strb r0, [r6] + ldrb r0, [r6] + bics r0, r3 + strb r0, [r6] + lsls r2, r4 + lsls r1, r5 + adds r2, r1 + ldrb r0, [r6] + orrs r0, r2 + strb r0, [r6] + mov r0, r8 + ldr r1, [sp, 0x8] + mov r2, sp + bl pokemon_setattr + mov r0, r8 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + bl pokemon_setattr + mov r0, r8 + ldr r1, [sp, 0x10] + mov r2, r10 + bl pokemon_setattr + mov r0, r8 + ldr r1, [sp, 0x1C] + ldr r2, [sp, 0x18] + bl pokemon_setattr + mov r0, r8 + movs r1, 0x15 + adds r2, r6, 0 + bl pokemon_setattr + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B98D8: .4byte 0x08329d22 + thumb_func_end sub_81B97DC + + thumb_func_start sub_81B98DC +sub_81B98DC: @ 81B98DC + push {lr} + ldr r0, _081B9900 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B9904 + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + beq _081B990C + ldr r1, _081B9908 + movs r0, 0x1 + strh r0, [r1] + b _081B9910 + .align 2, 0 +_081B9900: .4byte 0x020375e0 +_081B9904: .4byte 0x020244ec +_081B9908: .4byte 0x020375f0 +_081B990C: + ldr r0, _081B9914 + strh r1, [r0] +_081B9910: + pop {r0} + bx r0 + .align 2, 0 +_081B9914: .4byte 0x020375f0 + thumb_func_end sub_81B98DC + + thumb_func_start sub_81B9918 +sub_81B9918: @ 81B9918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, _081B9948 + movs r0, 0 + strh r0, [r1] + ldr r0, _081B994C + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081B9950 + adds r0, r1 + ldr r1, _081B9954 + ldrh r1, [r1] + adds r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x39 + bne _081B999C + movs r6, 0 + b _081B9980 + .align 2, 0 +_081B9948: .4byte 0x020375f0 +_081B994C: .4byte 0x020375e0 +_081B9950: .4byte 0x020244ec +_081B9954: .4byte 0x020375e2 +_081B9958: + ldr r0, _081B99A8 + ldrh r0, [r0] + cmp r6, r0 + beq _081B997E + movs r4, 0 + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + ldr r7, _081B99AC +_081B996A: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r7 + bl pokemon_getattr + cmp r0, 0x39 + beq _081B999C + adds r4, 0x1 + cmp r4, 0x3 + bls _081B996A +_081B997E: + adds r6, 0x1 +_081B9980: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bcc _081B9958 + mov r0, r8 + bl sub_80D23A8 + cmp r0, 0x1 + beq _081B999C + ldr r1, _081B99B0 + movs r0, 0x1 + strh r0, [r1] +_081B999C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081B99A8: .4byte 0x020375e0 +_081B99AC: .4byte 0x020244ec +_081B99B0: .4byte 0x020375f0 + thumb_func_end sub_81B9918 + + thumb_func_start sub_81B99B4 +sub_81B99B4: @ 81B99B4 + push {lr} + ldr r1, _081B99CC + ldr r0, _081B99D0 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081B99CC: .4byte 0x086160b4 +_081B99D0: .4byte 0x020375e0 + thumb_func_end sub_81B99B4 + + thumb_func_start sub_81B99D4 +sub_81B99D4: @ 81B99D4 + push {lr} + ldr r1, _081B9A14 + ldr r0, [r1] + ldr r2, _081B9A18 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, _081B9A1C + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _081B9A20 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, _081B9A24 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .align 2, 0 +_081B9A14: .4byte 0x03005d90 +_081B9A18: .4byte 0x00000ca8 +_081B9A1C: .4byte 0x00000cb2 +_081B9A20: .4byte 0x00000ca9 +_081B9A24: .4byte 0x03005d8c + thumb_func_end sub_81B99D4 + + thumb_func_start sub_81B9A28 +sub_81B9A28: @ 81B9A28 + ldr r1, _081B9A38 + ldr r0, _081B9A3C + ldr r0, [r0] + ldr r2, _081B9A40 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_081B9A38: .4byte 0x020375f0 +_081B9A3C: .4byte 0x03005d90 +_081B9A40: .4byte 0x00000e6a + thumb_func_end sub_81B9A28 + + thumb_func_start sub_81B9A44 +sub_81B9A44: @ 81B9A44 + ldr r0, _081B9A54 + ldr r0, [r0] + ldr r1, _081B9A58 + ldrh r1, [r1] + ldr r2, _081B9A5C + adds r0, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_081B9A54: .4byte 0x03005d90 +_081B9A58: .4byte 0x020375e4 +_081B9A5C: .4byte 0x00000e6a + thumb_func_end sub_81B9A44 + + thumb_func_start sub_81B9A60 +sub_81B9A60: @ 81B9A60 + push {r4,lr} + ldr r4, _081B9A8C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B9A8C: .4byte 0x02038bca + thumb_func_end sub_81B9A60 + + thumb_func_start sub_81B9A90 +sub_81B9A90: @ 81B9A90 + push {lr} + ldr r3, _081B9AB0 + ldrh r1, [r3] + ldr r0, _081B9AB4 + cmp r1, r0 + bhi _081B9AAC + ldr r2, _081B9AB8 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl sub_81638AC +_081B9AAC: + pop {r0} + bx r0 + .align 2, 0 +_081B9AB0: .4byte 0x02038bca +_081B9AB4: .4byte 0x0000012b +_081B9AB8: .4byte 0x0203bc88 + thumb_func_end sub_81B9A90 + + thumb_func_start sub_81B9ABC +sub_81B9ABC: @ 81B9ABC + push {r4,lr} + ldr r4, _081B9AF0 + ldr r0, [r4] + ldr r1, _081B9AF4 + ldrh r1, [r1] + ldr r2, _081B9AF8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081B9AFC + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B9AF0: .4byte 0x03005d90 +_081B9AF4: .4byte 0x020375e2 +_081B9AF8: .4byte 0x00000ca8 +_081B9AFC: .4byte 0x00000ca9 + thumb_func_end sub_81B9ABC + + thumb_func_start sub_81B9B00 +sub_81B9B00: @ 81B9B00 + push {r4,r5,lr} + ldr r0, _081B9B1C + ldr r4, [r0] + ldr r5, _081B9B20 + bl GenerateRandomNumber + ldrh r0, [r5] + ldr r1, _081B9B24 + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9B1C: .4byte 0x03005d90 +_081B9B20: .4byte 0x086160d4 +_081B9B24: .4byte 0x00000e6a + thumb_func_end sub_81B9B00 + + thumb_func_start sub_81B9B28 +sub_81B9B28: @ 81B9B28 + push {r4,r5,lr} + ldr r4, _081B9B60 + ldr r0, [r4] + ldr r1, _081B9B64 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9B70 + ldr r0, [r4] + ldr r1, _081B9B64 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _081B9B68 + bl itemid_get_name + ldr r0, [r4] + ldr r1, _081B9B64 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, _081B9B6C + strh r5, [r0] + b _081B9B76 + .align 2, 0 +_081B9B60: .4byte 0x03005d90 +_081B9B64: .4byte 0x00000e6a +_081B9B68: .4byte 0x02021cc4 +_081B9B6C: .4byte 0x020375f0 +_081B9B70: + ldr r1, _081B9B7C + movs r0, 0 + strh r0, [r1] +_081B9B76: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9B7C: .4byte 0x020375f0 + thumb_func_end sub_81B9B28 + + thumb_func_start sub_81B9B80 +sub_81B9B80: @ 81B9B80 + push {lr} + ldr r1, _081B9B98 + ldr r0, _081B9B9C + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081B9B98: .4byte 0x086160d8 +_081B9B9C: .4byte 0x020375e0 + thumb_func_end sub_81B9B80 + + thumb_func_start sub_81B9BA0 +sub_81B9BA0: @ 81B9BA0 + push {lr} + ldr r1, _081B9BE0 + ldr r0, [r1] + ldr r2, _081B9BE4 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, _081B9BE8 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _081B9BEC + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, _081B9BF0 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .align 2, 0 +_081B9BE0: .4byte 0x03005d90 +_081B9BE4: .4byte 0x00000ca8 +_081B9BE8: .4byte 0x00000cb2 +_081B9BEC: .4byte 0x00000ca9 +_081B9BF0: .4byte 0x03005d8c + thumb_func_end sub_81B9BA0 + + thumb_func_start sub_81B9BF4 +sub_81B9BF4: @ 81B9BF4 + ldr r1, _081B9C04 + ldr r0, _081B9C08 + ldr r0, [r0] + ldr r2, _081B9C0C + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_081B9C04: .4byte 0x020375f0 +_081B9C08: .4byte 0x03005d90 +_081B9C0C: .4byte 0x00000e6c + thumb_func_end sub_81B9BF4 + + thumb_func_start sub_81B9C10 +sub_81B9C10: @ 81B9C10 + ldr r0, _081B9C20 + ldr r0, [r0] + ldr r1, _081B9C24 + ldrh r1, [r1] + ldr r2, _081B9C28 + adds r0, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_081B9C20: .4byte 0x03005d90 +_081B9C24: .4byte 0x020375e4 +_081B9C28: .4byte 0x00000e6c + thumb_func_end sub_81B9C10 + + thumb_func_start sub_81B9C2C +sub_81B9C2C: @ 81B9C2C + push {r4,lr} + ldr r4, _081B9C60 + ldr r0, [r4] + ldr r1, _081B9C64 + ldrh r1, [r1] + ldr r2, _081B9C68 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081B9C6C + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B9C60: .4byte 0x03005d90 +_081B9C64: .4byte 0x020375e2 +_081B9C68: .4byte 0x00000ca8 +_081B9C6C: .4byte 0x00000ca9 + thumb_func_end sub_81B9C2C + + thumb_func_start sub_81B9C70 +sub_81B9C70: @ 81B9C70 + push {r4,r5,lr} + ldr r0, _081B9C8C + ldr r4, [r0] + ldr r5, _081B9C90 + bl GenerateRandomNumber + ldrh r0, [r5] + ldr r1, _081B9C94 + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9C8C: .4byte 0x03005d90 +_081B9C90: .4byte 0x086160f4 +_081B9C94: .4byte 0x00000e6c + thumb_func_end sub_81B9C70 + + thumb_func_start sub_81B9C98 +sub_81B9C98: @ 81B9C98 + push {r4,r5,lr} + ldr r4, _081B9CD0 + ldr r0, [r4] + ldr r1, _081B9CD4 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9CE0 + ldr r0, [r4] + ldr r1, _081B9CD4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, _081B9CD8 + bl itemid_get_name + ldr r0, [r4] + ldr r1, _081B9CD4 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, _081B9CDC + strh r5, [r0] + b _081B9CE6 + .align 2, 0 +_081B9CD0: .4byte 0x03005d90 +_081B9CD4: .4byte 0x00000e6c +_081B9CD8: .4byte 0x02021cc4 +_081B9CDC: .4byte 0x020375f0 +_081B9CE0: + ldr r1, _081B9CEC + movs r0, 0 + strh r0, [r1] +_081B9CE6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9CEC: .4byte 0x020375f0 + thumb_func_end sub_81B9C98 + + thumb_func_start sub_81B9CF0 +sub_81B9CF0: @ 81B9CF0 + push {lr} + ldr r0, _081B9D00 + ldr r1, _081B9D04 + ldrh r1, [r1] + bl sub_8162E20 + pop {r0} + bx r0 + .align 2, 0 +_081B9D00: .4byte 0x02021cc4 +_081B9D04: .4byte 0x02038bca + thumb_func_end sub_81B9CF0 + + thumb_func_start sub_81B9D08 +sub_81B9D08: @ 81B9D08 + push {lr} + ldr r1, _081B9D20 + ldr r0, _081B9D24 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .align 2, 0 +_081B9D20: .4byte 0x086160f8 +_081B9D24: .4byte 0x020375e0 + thumb_func_end sub_81B9D08 + + thumb_func_start sub_81B9D28 +sub_81B9D28: @ 81B9D28 + push {lr} + ldr r1, _081B9D68 + ldr r0, [r1] + ldr r2, _081B9D6C + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, _081B9D70 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _081B9D74 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, _081B9D78 + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .align 2, 0 +_081B9D68: .4byte 0x03005d90 +_081B9D6C: .4byte 0x00000ca8 +_081B9D70: .4byte 0x00000cb2 +_081B9D74: .4byte 0x00000ca9 +_081B9D78: .4byte 0x03005d8c + thumb_func_end sub_81B9D28 + + thumb_func_start sub_81B9D7C +sub_81B9D7C: @ 81B9D7C + ldr r1, _081B9D8C + ldr r0, _081B9D90 + ldr r0, [r0] + ldr r2, _081B9D94 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_081B9D8C: .4byte 0x020375f0 +_081B9D90: .4byte 0x03005d90 +_081B9D94: .4byte 0x00000e6e + thumb_func_end sub_81B9D7C + + thumb_func_start sub_81B9D98 +sub_81B9D98: @ 81B9D98 + ldr r0, _081B9DA8 + ldr r0, [r0] + ldr r1, _081B9DAC + ldrh r1, [r1] + ldr r2, _081B9DB0 + adds r0, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_081B9DA8: .4byte 0x03005d90 +_081B9DAC: .4byte 0x020375e4 +_081B9DB0: .4byte 0x00000e6e + thumb_func_end sub_81B9D98 + + thumb_func_start sub_81B9DB4 +sub_81B9DB4: @ 81B9DB4 + push {r4,lr} + ldr r4, _081B9DE8 + ldr r0, [r4] + ldr r1, _081B9DEC + ldrh r1, [r1] + ldr r2, _081B9DF0 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl var_set + ldr r1, [r4] + ldr r0, _081B9DF4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081B9DE8: .4byte 0x03005d90 +_081B9DEC: .4byte 0x020375e2 +_081B9DF0: .4byte 0x00000ca8 +_081B9DF4: .4byte 0x00000ca9 + thumb_func_end sub_81B9DB4 + + thumb_func_start sub_81B9DF8 +sub_81B9DF8: @ 81B9DF8 + push {r4,r5,lr} + ldr r0, _081B9E14 + ldr r4, [r0] + ldr r5, _081B9E18 + bl GenerateRandomNumber + ldrh r0, [r5] + ldr r1, _081B9E1C + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9E14: .4byte 0x03005d90 +_081B9E18: .4byte 0x08616120 +_081B9E1C: .4byte 0x00000e6e + thumb_func_end sub_81B9DF8 + + thumb_func_start sub_81B9E20 +sub_81B9E20: @ 81B9E20 + push {r4,r5,lr} + ldr r4, _081B9E58 + ldr r0, [r4] + ldr r1, _081B9E5C + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9E68 + ldr r0, [r4] + ldr r1, _081B9E5C + adds r0, r1 + ldrh r0, [r0] + ldr r1, _081B9E60 + bl itemid_get_name + ldr r0, [r4] + ldr r1, _081B9E5C + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, _081B9E64 + strh r5, [r0] + b _081B9E6E + .align 2, 0 +_081B9E58: .4byte 0x03005d90 +_081B9E5C: .4byte 0x00000e6e +_081B9E60: .4byte 0x02021cc4 +_081B9E64: .4byte 0x020375f0 +_081B9E68: + ldr r1, _081B9E74 + movs r0, 0 + strh r0, [r1] +_081B9E6E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081B9E74: .4byte 0x020375f0 + thumb_func_end sub_81B9E20 + + thumb_func_start sub_81B9E78 +sub_81B9E78: @ 81B9E78 + push {lr} + bl zero_player_party_data + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81B9E78 + + thumb_func_start sub_81B9E88 +sub_81B9E88: @ 81B9E88 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81B9E88 + + thumb_func_start sub_81B9E94 +sub_81B9E94: @ 81B9E94 + push {lr} + movs r2, 0 + ldr r1, _081B9EB8 + ldrb r0, [r1, 0x14] + cmp r0, 0x8 + bne _081B9EB2 + ldr r3, _081B9EBC + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081B9EB2 + movs r2, 0x1 +_081B9EB2: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_081B9EB8: .4byte 0x02037318 +_081B9EBC: .4byte 0xfffffe7f + thumb_func_end sub_81B9E94 + + thumb_func_start sub_81B9EC0 +sub_81B9EC0: @ 81B9EC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + ldr r1, _081B9FB8 + ldr r0, _081B9FBC + str r0, [r1] + add r0, sp, 0xC + mov r9, r0 + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x2C] + ldr r5, _081B9FC0 + ldr r4, _081B9FC4 + movs r2, 0 + adds r3, r1, 0 + mov r1, r9 + mov r0, sp + movs r6, 0x5 + mov r8, r6 +_081B9EEC: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r7, 0x1 + negs r7, r7 + add r8, r7 + mov r6, r8 + cmp r6, 0 + bge _081B9EEC + str r4, [r5] + movs r7, 0 + mov r10, r7 + movs r0, 0 + mov r8, r0 + ldr r1, [sp, 0x2C] + str r1, [sp, 0x30] + mov r2, sp + str r2, [sp, 0x34] + lsls r6, r0, 1 + str r6, [sp, 0x24] + add r6, r9 + str r6, [sp, 0x28] +_081B9F1E: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x46 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + mov r7, r8 + adds r6, r2, r7 + cmp r2, r6 + bge _081B9F7C + ldr r1, [sp, 0x28] + ldrh r0, [r1] + cmp r0, r5 + beq _081B9F7C + ldr r0, _081B9FC0 + ldr r1, [r0] + lsls r0, r5, 4 + adds r4, r0, r1 + ldrh r7, [r4] + mov r12, r7 + lsls r3, r2, 1 + ldr r1, [sp, 0x24] + add r1, sp + str r6, [sp, 0x38] +_081B9F56: + ldrh r0, [r1] + cmp r0, r12 + bne _081B9F66 + mov r0, r10 + cmp r0, 0 + bne _081B9F7C + ldrh r7, [r4] + mov r10, r7 +_081B9F66: + adds r3, 0x2 + adds r1, 0x2 + adds r2, 0x1 + ldr r0, [sp, 0x38] + cmp r2, r0 + bge _081B9F7C + mov r7, r9 + adds r0, r7, r3 + ldrh r0, [r0] + cmp r0, r5 + bne _081B9F56 +_081B9F7C: + cmp r2, r6 + bne _081BA01C + movs r2, 0 + cmp r2, r6 + bge _081B9FD4 + ldr r0, _081B9FC8 + mov r12, r0 + ldr r7, _081B9FC0 + ldr r1, [sp, 0x24] + ldr r0, [sp, 0x2C] + adds r4, r1, r0 +_081B9F92: + ldrh r3, [r4] + cmp r3, 0 + beq _081B9FCC + ldr r1, [r7] + lsls r0, r5, 4 + adds r1, r0, r1 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r3, r0 + bne _081B9FCC + ldrh r0, [r1] + cmp r0, r10 + bne _081B9FD4 + movs r1, 0 + mov r10, r1 + b _081B9FD4 + .align 2, 0 +_081B9FB8: .4byte 0x0203bc88 +_081B9FBC: .4byte 0x085dda14 +_081B9FC0: .4byte 0x0203bc8c +_081B9FC4: .4byte 0x085de02c +_081B9FC8: .4byte 0x085cecb0 +_081B9FCC: + adds r4, 0x2 + adds r2, 0x1 + cmp r2, r6 + blt _081B9F92 +_081B9FD4: + cmp r2, r6 + bne _081BA01C + ldr r0, _081BA034 + ldr r1, [r0] + mov r2, r8 + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r1, r0 + movs r6, 0xE7 + lsls r6, 4 + adds r1, r6 + strh r5, [r1] + ldr r0, _081BA038 + ldr r0, [r0] + lsls r1, r5, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r7, [sp, 0x34] + strh r0, [r7] + ldr r2, _081BA03C + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, [sp, 0x30] + strh r0, [r1] + add r3, r9 + strh r5, [r3] + adds r1, 0x2 + str r1, [sp, 0x30] + adds r2, r7, 0 + adds r2, 0x2 + str r2, [sp, 0x34] + movs r6, 0x1 + add r8, r6 +_081BA01C: + mov r7, r8 + cmp r7, 0x6 + beq _081BA024 + b _081B9F1E +_081BA024: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BA034: .4byte 0x03005d90 +_081BA038: .4byte 0x0203bc8c +_081BA03C: .4byte 0x085cecb0 + thumb_func_end sub_81B9EC0 + + thumb_func_start sub_81BA040 +sub_81BA040: @ 81BA040 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r0, 0 + mov r10, r0 + ldr r1, _081BA0EC + ldr r0, _081BA0F0 + str r0, [r1] + ldr r1, _081BA0F4 + ldr r0, _081BA0F8 + str r0, [r1] + ldr r7, _081BA0FC + ldr r1, _081BA100 + mov r8, r1 +_081BA062: + mov r2, r10 + lsls r6, r2, 1 +_081BA066: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r5, 0 + ldr r1, [r7] + ldr r4, _081BA104 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r5, r0 + bge _081BA0AA + ldr r2, _081BA108 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081BA0AA + ldr r0, _081BA0FC + ldr r1, [r0] + adds r0, r1, r4 + ldrh r2, [r0] + adds r4, 0x2 + adds r1, r4 +_081BA09C: + adds r1, 0x2 + adds r5, 0x1 + cmp r5, r2 + bge _081BA0AA + ldrh r0, [r1] + cmp r0, r3 + bne _081BA09C +_081BA0AA: + ldr r0, [r7] + ldr r1, _081BA104 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + bne _081BA066 + ldr r2, _081BA10C + strh r3, [r2] + ldrh r3, [r2] + ldr r4, _081BA0EC + ldr r1, [r4] + movs r0, 0x34 + muls r0, r3 + adds r0, r1 + ldr r0, [r0, 0x30] + adds r1, r6, r0 + ldrh r0, [r1] + cmp r0, r8 + beq _081BA0DE + ldr r3, _081BA100 +_081BA0D2: + adds r1, 0x2 + movs r6, 0x1 + add r10, r6 + ldrh r0, [r1] + cmp r0, r3 + bne _081BA0D2 +_081BA0DE: + mov r0, r10 + cmp r0, 0x8 + bgt _081BA110 + movs r1, 0 + mov r10, r1 + b _081BA062 + .align 2, 0 +_081BA0EC: .4byte 0x0203bc88 +_081BA0F0: .4byte 0x085dda14 +_081BA0F4: .4byte 0x0203bc8c +_081BA0F8: .4byte 0x085de02c +_081BA0FC: .4byte 0x03005d90 +_081BA100: .4byte 0x0000ffff +_081BA104: .4byte 0x00000cb2 +_081BA108: .4byte 0x00000cb4 +_081BA10C: .4byte 0x02038bca +_081BA110: + ldr r0, _081BA234 + ldr r1, [r0] + ldr r6, _081BA238 + adds r3, r1, r6 + ldrh r0, [r3] + cmp r0, 0x1 + bhi _081BA12A + lsls r0, 1 + ldr r3, _081BA23C + adds r1, r3 + adds r1, r0 + ldrh r0, [r2] + strh r0, [r1] +_081BA12A: + ldrh r1, [r2] + ldr r2, [r4] + movs r0, 0x34 + muls r0, r1 + adds r0, r2 + ldr r0, [r0, 0x30] + mov r9, r0 + movs r5, 0 + ldr r7, _081BA240 + mov r8, sp +_081BA13E: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r7] + movs r2, 0 + ldrh r0, [r7] + ldr r4, _081BA244 + ldr r3, [r4] + lsls r0, 4 + adds r0, r3 + ldr r1, _081BA234 + ldrh r6, [r0] + ldr r1, [r1] +_081BA166: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r6, r0 + beq _081BA180 + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + ble _081BA166 +_081BA180: + cmp r2, 0x6 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1B0 + mov r0, sp + ldrh r0, [r0] + cmp r0, r6 + beq _081BA1B0 + ldr r6, _081BA240 + ldr r3, _081BA244 + mov r2, sp +_081BA198: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r5 + bge _081BA1B0 + ldrh r0, [r6] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081BA198 +_081BA1B0: + cmp r4, r5 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1E6 + ldr r6, _081BA248 + mov r12, r6 + add r3, sp, 0x8 +_081BA1C0: + ldrh r2, [r3] + cmp r2, 0 + beq _081BA1DE + ldr r1, _081BA240 + ldrh r0, [r1] + ldr r6, _081BA244 + ldr r1, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r2, r0 + beq _081BA1E6 +_081BA1DE: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r5 + blt _081BA1C0 +_081BA1E6: + cmp r4, r5 + bne _081BA220 + lsls r2, r5, 1 + ldrh r0, [r7] + ldr r1, _081BA244 + ldr r4, [r1] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0] + mov r3, r8 + strh r0, [r3] + add r1, sp, 0x8 + adds r1, r2 + ldr r3, _081BA248 + ldrh r0, [r7] + lsls r0, 4 + adds r0, r4 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, _081BA24C + adds r2, r0 + ldrh r0, [r7] + strh r0, [r2] + movs r4, 0x2 + add r8, r4 + adds r5, 0x1 +_081BA220: + cmp r5, 0x3 + bne _081BA13E + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BA234: .4byte 0x03005d90 +_081BA238: .4byte 0x00000cb2 +_081BA23C: .4byte 0x00000cb4 +_081BA240: .4byte 0x03001298 +_081BA244: .4byte 0x0203bc8c +_081BA248: .4byte 0x085cecb0 +_081BA24C: .4byte 0x03006298 + thumb_func_end sub_81BA040 + + thumb_func_start fbox6_func +fbox6_func: @ 81BA250 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r6, 0 + adds r4, 0x14 + ldrb r0, [r6, 0x1C] + cmp r0, 0x6 + bls _081BA260 + b _081BA660 +_081BA260: + lsls r0, 2 + ldr r1, _081BA26C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BA26C: .4byte _081BA270 + .align 2, 0 +_081BA270: + .4byte _081BA28C + .4byte _081BA554 + .4byte _081BA566 + .4byte _081BA590 + .4byte _081BA5C8 + .4byte _081BA63C + .4byte _081BA64E +_081BA28C: + ldr r2, _081BA2E0 + ldrh r1, [r2, 0x2C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081BA2A6 + ldrb r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081BA2A6 + movs r0, 0 + strb r0, [r6, 0x1E] +_081BA2A6: + ldrb r1, [r6, 0x1E] + cmp r1, 0 + beq _081BA2E8 + ldrb r0, [r6, 0x1D] + cmp r0, 0 + beq _081BA2E8 + subs r0, r1, 0x1 + strb r0, [r6, 0x1E] + ldr r0, _081BA2E4 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BA2C4 + b _081BA50E +_081BA2C4: + ldrh r1, [r2, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081BA2D0 + b _081BA50E +_081BA2D0: + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4] + movs r0, 0 + strb r0, [r6, 0x1E] + b _081BA50E + .align 2, 0 +_081BA2E0: .4byte 0x030022c0 +_081BA2E4: .4byte 0x03003014 +_081BA2E8: + ldr r2, _081BA2F8 + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BA2FC + movs r0, 0x3 + b _081BA2FE + .align 2, 0 +_081BA2F8: .4byte 0x03003014 +_081BA2FC: + ldrb r0, [r6, 0x1D] +_081BA2FE: + strb r0, [r6, 0x1E] + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + adds r0, r3, 0 + subs r0, 0xF8 + cmp r0, 0x7 + bls _081BA312 + b _081BA52E +_081BA312: + lsls r0, 2 + ldr r1, _081BA31C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BA31C: .4byte _081BA320 + .align 2, 0 +_081BA320: + .4byte _081BA524 + .4byte _081BA512 + .4byte _081BA504 + .4byte _081BA500 + .4byte _081BA36E + .4byte _081BA368 + .4byte _081BA340 + .4byte _081BA660 +_081BA340: + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + ldrb r1, [r6, 0x5] + ldr r0, _081BA364 + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + ldrb r0, [r6, 0x9] + adds r0, r1 + strb r0, [r6, 0x9] +_081BA35E: + movs r0, 0x2 + b _081BA662 + .align 2, 0 +_081BA364: .4byte 0x03002f80 +_081BA368: + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA36E: + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + subs r0, r3, 0x1 + cmp r0, 0xF + bls _081BA37E + b _081BA52E +_081BA37E: + lsls r0, 2 + ldr r1, _081BA388 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BA388: .4byte _081BA38C + .align 2, 0 +_081BA38C: + .4byte _081BA3CC + .4byte _081BA3EE + .4byte _081BA412 + .4byte _081BA42C + .4byte _081BA478 + .4byte _081BA47E + .4byte _081BA35E + .4byte _081BA498 + .4byte _081BA4A8 + .4byte _081BA4BC + .4byte _081BA4C0 + .4byte _081BA4C8 + .4byte _081BA4D2 + .4byte _081BA4DE + .4byte _081BA4EE + .4byte _081BA4C0 +_081BA3CC: + ldr r2, [r6] + ldrb r1, [r2] + lsls r1, 4 + ldrb r3, [r6, 0xC] + movs r0, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r2, 0x1 + str r2, [r6] + lsls r0, 24 + lsrs r0, 28 + ldrb r2, [r6, 0xD] + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _081BA472 +_081BA3EE: + ldr r1, [r6] + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + ldrb r3, [r6, 0xD] + movs r2, 0x10 + negs r2, r2 + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _081BA472 +_081BA412: + ldr r1, [r6] + ldrb r0, [r1] + lsls r0, 4 + ldrb r3, [r6, 0xD] + movs r2, 0xF + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + b _081BA46A +_081BA42C: + ldr r3, [r6] + ldrb r1, [r3] + lsls r1, 4 + ldrb r4, [r6, 0xC] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r5, r3, 0x1 + str r5, [r6] + ldrb r3, [r3, 0x1] + adds r1, r2, 0 + ands r1, r3 + ldrb r4, [r6, 0xD] + movs r3, 0x10 + negs r3, r3 + ands r3, r4 + orrs r3, r1 + strb r3, [r6, 0xD] + adds r4, r5, 0x1 + str r4, [r6] + ldrb r1, [r5, 0x1] + lsls r1, 4 + ands r2, r3 + orrs r2, r1 + strb r2, [r6, 0xD] + adds r4, 0x1 + str r4, [r6] + lsls r0, 24 + lsrs r0, 28 +_081BA46A: + lsls r1, r2, 28 + lsrs r1, 28 + lsls r2, 24 + lsrs r2, 28 +_081BA472: + bl GenerateFontHalfRowLut + b _081BA35E +_081BA478: + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA47E: + ldr r0, [r6] + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA498: + ldr r0, [r6] + ldrb r1, [r0] + strb r1, [r6, 0x1E] + adds r0, 0x1 + str r0, [r6] + movs r0, 0x6 + strb r0, [r6, 0x1C] + b _081BA35E +_081BA4A8: + movs r0, 0x1 + strb r0, [r6, 0x1C] + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BA50E + movs r0, 0 + strb r0, [r4, 0x2] + b _081BA50E +_081BA4BC: + movs r0, 0x5 + b _081BA64A +_081BA4C0: + ldr r0, [r6] + adds r0, 0x2 +_081BA4C4: + str r0, [r6] + b _081BA35E +_081BA4C8: + ldr r1, [r6] + adds r0, r1, 0x1 + str r0, [r6] + ldrb r3, [r1, 0x1] + b _081BA52E +_081BA4D2: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x6] + adds r0, r2 + strb r0, [r6, 0x8] + b _081BA4E8 +_081BA4DE: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x7] + adds r0, r2 + strb r0, [r6, 0x9] +_081BA4E8: + adds r1, 0x1 + str r1, [r6] + b _081BA35E +_081BA4EE: + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + b _081BA35E +_081BA500: + movs r0, 0x2 + b _081BA506 +_081BA504: + movs r0, 0x3 +_081BA506: + strb r0, [r6, 0x1C] + adds r0, r6, 0 + bl sub_80054F8 +_081BA50E: + movs r0, 0x3 + b _081BA662 +_081BA512: + ldr r0, [r6] + ldrb r3, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r3, r1 + adds r0, 0x1 + str r0, [r6] + b _081BA52E +_081BA524: + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] + movs r0, 0 + b _081BA662 +_081BA52E: + adds r0, r3, 0 + bl sub_81BA668 + adds r0, r6, 0 + bl CopyGlyphToWindow + ldr r0, _081BA550 + adds r0, 0x80 + ldrb r1, [r6, 0xA] + ldrb r0, [r0] + adds r1, r0 + ldrb r0, [r6, 0x8] + adds r0, r1 + strb r0, [r6, 0x8] + movs r0, 0 + b _081BA662 + .align 2, 0 +_081BA550: .4byte 0x03002f90 +_081BA554: + adds r0, r6, 0 + bl remo_is_it_time_to_continue + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + movs r0, 0 + strb r0, [r6, 0x1C] + b _081BA50E +_081BA566: + adds r0, r6, 0 + bl remo_is_it_time_to_continue_plus_down_arrow + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl Window_FastFillPixels + ldrb r0, [r6, 0x6] + movs r1, 0 + strb r0, [r6, 0x8] + ldrb r0, [r6, 0x7] + strb r0, [r6, 0x9] + strb r1, [r6, 0x1C] + b _081BA50E +_081BA590: + adds r0, r6, 0 + bl remo_is_it_time_to_continue_plus_down_arrow + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + adds r0, r6, 0 + bl remo_clear_down_arrow + ldrb r1, [r6, 0x5] + ldr r0, _081BA5C4 + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + strb r1, [r6, 0x1F] + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + movs r0, 0x4 + strb r0, [r6, 0x1C] + b _081BA50E + .align 2, 0 +_081BA5C4: .4byte 0x03002f80 +_081BA5C8: + ldrb r2, [r6, 0x1F] + cmp r2, 0 + beq _081BA638 + ldr r4, _081BA5FC + ldr r5, _081BA600 + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsls r1, r0, 29 + lsrs r0, r1, 29 + adds r0, r4 + ldrb r0, [r0] + cmp r2, r0 + bcs _081BA604 + ldrb r0, [r6, 0x4] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl Window_ScrollVertically + movs r0, 0 + strb r0, [r6, 0x1F] + b _081BA62E + .align 2, 0 +_081BA5FC: .4byte 0x08616124 +_081BA600: .4byte 0x03005d90 +_081BA604: + ldrb r0, [r6, 0x4] + lsrs r1, 29 + adds r1, r4 + ldrb r2, [r1] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl Window_ScrollVertically + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + adds r0, r4 + ldrb r1, [r6, 0x1F] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r6, 0x1F] +_081BA62E: + ldrb r0, [r6, 0x4] + movs r1, 0x2 + bl Window_CopyToVram + b _081BA50E +_081BA638: + strb r2, [r6, 0x1C] + b _081BA50E +_081BA63C: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081BA64A + b _081BA50E +_081BA64A: + strb r0, [r6, 0x1C] + b _081BA50E +_081BA64E: + ldrb r0, [r6, 0x1E] + adds r1, r0, 0 + cmp r1, 0 + beq _081BA65C + subs r0, 0x1 + strb r0, [r6, 0x1E] + b _081BA50E +_081BA65C: + strb r1, [r6, 0x1C] + b _081BA50E +_081BA660: + movs r0, 0x1 +_081BA662: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end fbox6_func + + thumb_func_start sub_81BA668 +sub_81BA668: @ 81BA668 + push {r4,r5,lr} + lsls r0, 16 + lsrs r2, r0, 19 + lsls r2, 9 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 11 + ldr r0, _081BA6C4 + adds r1, r0 + adds r5, r2, r1 + ldr r4, _081BA6C8 + adds r0, r5, 0 + adds r1, r4, 0 + bl font_render_sub + adds r0, r5, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl font_render_sub + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl font_render_sub + movs r1, 0x88 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x60 + bl font_render_sub + adds r0, r4, 0 + adds r0, 0x80 + movs r1, 0x10 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BA6C4: .4byte 0x08616128 +_081BA6C8: .4byte 0x03002f90 + thumb_func_end sub_81BA668 + + thumb_func_start get_font_width_x10 +get_font_width_x10: @ 81BA6CC + movs r0, 0x10 + bx lr + thumb_func_end get_font_width_x10 + + thumb_func_start sub_81BA6D0 +sub_81BA6D0: @ 81BA6D0 + adds r2, r0, 0 + movs r1, 0 + strb r1, [r2, 0x1E] + strb r1, [r2, 0x18] + strb r1, [r2, 0x1D] + adds r3, r2, 0 + adds r3, 0x4A + movs r0, 0xF + strb r0, [r3] + adds r0, r2, 0 + adds r0, 0x48 + strb r1, [r0] + strh r1, [r2, 0x16] + ldr r0, _081BA6FC + strh r1, [r0] + ldr r2, _081BA700 + ldr r3, _081BA704 + adds r0, r3, 0 + strh r0, [r2] + ldr r0, _081BA708 + strh r1, [r0] + bx lr + .align 2, 0 +_081BA6FC: .4byte 0x04000134 +_081BA700: .4byte 0x04000128 +_081BA704: .4byte 0x00002003 +_081BA708: .4byte 0x0400012a + thumb_func_end sub_81BA6D0 + + thumb_func_start sub_81BA70C +sub_81BA70C: @ 81BA70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + bl sub_81BAC30 + cmp r0, 0 + beq _081BA722 + b _081BAAEA +_081BA722: + adds r0, r7, 0 + adds r0, 0x4A + ldrb r1, [r0] + mov r10, r0 + cmp r1, 0xF + bls _081BA736 + subs r0, r1, 0x1 + mov r1, r10 + strb r0, [r1] + b _081BAAEA +_081BA736: + adds r1, r7, 0 + adds r1, 0x48 + ldrb r0, [r1] + cmp r0, 0 + beq _081BA760 + movs r0, 0 + strb r0, [r1] + ldr r0, _081BA75C + ldrh r0, [r0] + movs r5, 0xFC + ands r5, r0 + cmp r5, 0x8 + beq _081BA760 + adds r0, r7, 0 + bl sub_81BA6D0 + movs r0, 0x8 + eors r0, r5 + b _081BAAEC + .align 2, 0 +_081BA75C: .4byte 0x04000128 +_081BA760: + ldrb r0, [r7, 0x18] + cmp r0, 0xDF + bls _081BA7B2 + adds r0, r7, 0 + bl sub_81BAC44 + adds r5, r0, 0 + cmp r5, 0 + beq _081BA774 + b _081BAAEC +_081BA774: + adds r0, r7, 0 + adds r0, 0x4B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081BA790 + ldrb r0, [r7, 0x18] + cmp r0, 0xE1 + bls _081BA790 + adds r0, r7, 0 + bl sub_81BAC30 + cmp r0, 0 + bne _081BA790 + b _081BAADA +_081BA790: + adds r0, r7, 0 + bl sub_81BAC30 + cmp r0, 0 + beq _081BA79C + b _081BAAEA +_081BA79C: + ldrh r0, [r7, 0x16] + cmp r0, 0 + bne _081BA7AC + adds r0, r7, 0 + bl sub_81BA6D0 + movs r0, 0x71 + b _081BAAEC +_081BA7AC: + subs r0, 0x1 + strh r0, [r7, 0x16] + b _081BAAEA +_081BA7B2: + ldrb r0, [r7, 0x18] + cmp r0, 0x2 + bne _081BA7BA + b _081BA8F0 +_081BA7BA: + cmp r0, 0x2 + bgt _081BA7C8 + cmp r0, 0 + beq _081BA7D6 + cmp r0, 0x1 + beq _081BA892 + b _081BAA28 +_081BA7C8: + cmp r0, 0xD0 + bne _081BA7CE + b _081BA93C +_081BA7CE: + cmp r0, 0xD1 + bne _081BA7D4 + b _081BA9D6 +_081BA7D4: + b _081BAA28 +_081BA7D6: + movs r3, 0xE + movs r5, 0x3 + ldr r0, _081BA81C + ldrh r0, [r0, 0x6] + adds r1, r0, 0 + ldr r0, _081BA820 + ldrb r2, [r7, 0x1E] + adds r6, r2, 0 + cmp r1, r0 + bne _081BA7FE + adds r4, r1, 0 + ldr r1, _081BA824 +_081BA7EE: + asrs r3, 1 + subs r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + beq _081BA7FE + ldrh r0, [r1] + cmp r0, r4 + beq _081BA7EE +_081BA7FE: + movs r0, 0xE + ands r3, r0 + strb r3, [r7, 0x1D] + movs r5, 0x3 + ldr r0, _081BA81C + ldrh r0, [r0, 0x6] + adds r4, r0, 0 + asrs r0, r2, 3 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BA82C + ldr r0, _081BA828 + b _081BA852 + .align 2, 0 +_081BA81C: .4byte 0x04000120 +_081BA820: .4byte 0x0000ffff +_081BA824: .4byte 0x04000126 +_081BA828: .4byte 0x00007208 +_081BA82C: + subs r5, 0x1 + cmp r5, 0 + beq _081BA858 + lsls r0, r5, 1 + ldr r1, _081BA880 + adds r0, r1 + ldrh r0, [r0] + adds r4, r0, 0 + adds r0, r2, 0 + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BA82C + adds r0, r1, 0 + lsls r0, r5 + movs r1, 0xE4 + lsls r1, 7 + orrs r0, r1 +_081BA852: + cmp r4, r0 + beq _081BA82C + movs r3, 0 +_081BA858: + adds r0, r3, 0 + ands r0, r6 + strb r0, [r7, 0x1E] + cmp r3, 0 + bne _081BA868 + movs r0, 0xF + mov r2, r10 + strb r0, [r2] +_081BA868: + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0 + bne _081BA884 + ldrb r0, [r7, 0x1D] + ldrb r2, [r7, 0x1E] + cmp r0, r2 + beq _081BA88A + adds r0, r7, 0 + bl sub_81BAB48 + b _081BA892 + .align 2, 0 +_081BA880: .4byte 0x04000120 +_081BA884: + subs r0, 0x1 + mov r1, r10 + strb r0, [r1] +_081BA88A: + ldrb r1, [r7, 0x1E] + movs r2, 0xC4 + lsls r2, 7 + b _081BA992 +_081BA892: + adds r1, r7, 0 + adds r1, 0x49 + movs r0, 0 + strb r0, [r1] + movs r5, 0x3 + mov r12, r1 + ldr r3, _081BA8E8 +_081BA8A0: + lsls r0, r5, 1 + ldr r2, _081BA8EC + adds r0, r2 + ldrh r0, [r0] + adds r4, r0, 0 + asrs r0, r4, 8 + subs r2, r5, 0x1 + cmp r0, 0x72 + bne _081BA8CA + lsls r0, r2, 1 + adds r0, r3 + strh r4, [r0] + movs r0, 0xFF + ands r4, r0 + movs r0, 0x1 + lsls r0, r5 + cmp r4, r0 + bne _081BA8CA + ldrb r0, [r1] + orrs r4, r0 + strb r4, [r1] +_081BA8CA: + adds r5, r2, 0 + cmp r5, 0 + bne _081BA8A0 + ldrb r0, [r7, 0x1D] + mov r1, r12 + ldrb r1, [r1] + cmp r0, r1 + bne _081BA88A + movs r0, 0x2 + strb r0, [r7, 0x18] + mov r2, r12 + ldrb r1, [r2] + movs r2, 0xC2 + lsls r2, 7 + b _081BA992 + .align 2, 0 +_081BA8E8: .4byte 0x0300129c +_081BA8EC: .4byte 0x04000120 +_081BA8F0: + movs r5, 0x3 + movs r0, 0x49 + adds r0, r7 + mov r12, r0 + mov r4, r12 + movs r6, 0x1 + ldr r1, _081BA934 + mov r9, r1 + ldr r2, _081BA938 + mov r8, r2 +_081BA904: + ldrb r3, [r4] + adds r0, r3, 0 + asrs r0, r5 + ands r0, r6 + subs r2, r5, 0x1 + cmp r0, 0 + beq _081BA92A + lsls r0, r5, 1 + add r0, r8 + ldrh r1, [r0] + lsls r0, r2, 1 + add r0, r9 + ldrh r0, [r0] + cmp r1, r0 + beq _081BA92A + adds r0, r6, 0 + lsls r0, r5 + eors r3, r0 + strb r3, [r4] +_081BA92A: + adds r5, r2, 0 + cmp r5, 0 + bne _081BA904 + b _081BAA90 + .align 2, 0 +_081BA934: .4byte 0x0300129c +_081BA938: .4byte 0x04000120 +_081BA93C: + movs r3, 0x1 + movs r5, 0x3 + movs r0, 0x49 + adds r0, r7 + mov r12, r0 + adds r6, r7, 0 + adds r6, 0x19 + ldr r1, _081BA9A0 + mov r8, r1 +_081BA94E: + lsls r0, r5, 1 + ldr r2, _081BA9A4 + adds r0, r2 + ldrh r0, [r0] + adds r4, r0, 0 + subs r2, r5, 0x1 + adds r0, r6, r2 + strb r4, [r0] + mov r0, r12 + ldrb r1, [r0] + asrs r1, r5 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _081BA982 + asrs r0, r4, 8 + subs r0, 0x72 + cmp r0, 0x1 + bls _081BA976 + b _081BAAE0 +_081BA976: + lsls r0, r2, 1 + add r0, r8 + ldrh r0, [r0] + cmp r4, r0 + bne _081BA982 + movs r3, 0 +_081BA982: + adds r5, r2, 0 + cmp r5, 0 + bne _081BA94E + cmp r3, 0 + bne _081BA9A8 + ldrb r1, [r7, 0x1C] + movs r2, 0xC6 + lsls r2, 7 +_081BA992: + adds r0, r2, 0 + orrs r1, r0 + adds r0, r7, 0 + bl sub_81BAAFC + b _081BAAEC + .align 2, 0 +_081BA9A0: .4byte 0x0300129c +_081BA9A4: .4byte 0x04000120 +_081BA9A8: + movs r0, 0xD1 + strb r0, [r7, 0x18] + movs r3, 0x11 + movs r5, 0x3 + adds r1, r6, 0x2 +_081BA9B2: + ldrb r0, [r1] + adds r3, r0 + subs r1, 0x1 + subs r5, 0x1 + cmp r5, 0 + bne _081BA9B2 + strb r3, [r7, 0x14] + movs r0, 0xFF + ands r3, r0 + movs r1, 0xC8 + lsls r1, 7 + adds r0, r1, 0 + orrs r3, r0 + adds r0, r7, 0 + adds r1, r3, 0 + bl sub_81BAAFC + b _081BAAEC +_081BA9D6: + movs r5, 0x3 + movs r2, 0x49 + ldrb r1, [r2, r7] + ldr r2, _081BAA14 + movs r3, 0x1 +_081BA9E0: + ldrh r0, [r2] + adds r4, r0, 0 + adds r0, r1, 0 + asrs r0, r5 + ands r0, r3 + cmp r0, 0 + beq _081BA9F4 + asrs r0, r4, 8 + cmp r0, 0x73 + bne _081BAAE0 +_081BA9F4: + subs r2, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _081BA9E0 + adds r0, r7, 0 + bl MultiBoot + adds r5, r0, 0 + cmp r5, 0 + bne _081BAA18 + movs r0, 0xE0 + strb r0, [r7, 0x18] + adds r0, 0xB0 + strh r0, [r7, 0x16] + b _081BAAEA + .align 2, 0 +_081BAA14: .4byte 0x04000126 +_081BAA18: + adds r0, r7, 0 + bl sub_81BA6D0 + movs r0, 0x1E + mov r1, r10 + strb r0, [r1] + movs r0, 0x70 + b _081BAAEC +_081BAA28: + movs r5, 0x3 + movs r2, 0x49 + adds r2, r7 + mov r12, r2 + mov r8, r12 + movs r0, 0x1 + mov r9, r0 +_081BAA36: + mov r1, r8 + ldrb r6, [r1] + adds r0, r6, 0 + asrs r0, r5 + mov r2, r9 + ands r0, r2 + cmp r0, 0 + beq _081BAA70 + lsls r0, r5, 1 + ldr r1, _081BAA8C + adds r0, r1 + ldrh r0, [r0] + adds r4, r0, 0 + asrs r2, r4, 8 + ldrb r0, [r7, 0x18] + lsrs r0, 1 + movs r1, 0x62 + subs r1, r0 + mov r3, r9 + lsls r3, r5 + cmp r2, r1 + bne _081BAA6A + movs r0, 0xFF + ands r4, r0 + cmp r4, r3 + beq _081BAA70 +_081BAA6A: + eors r6, r3 + mov r2, r8 + strb r6, [r2] +_081BAA70: + subs r5, 0x1 + cmp r5, 0 + bne _081BAA36 + ldrb r0, [r7, 0x18] + cmp r0, 0xC4 + bne _081BAA90 + mov r0, r12 + ldrb r1, [r0] + movs r0, 0xE + ands r0, r1 + strb r0, [r7, 0x1E] + strb r5, [r7, 0x18] + b _081BA88A + .align 2, 0 +_081BAA8C: .4byte 0x04000120 +_081BAA90: + mov r1, r12 + ldrb r0, [r1] + cmp r0, 0 + bne _081BAAA2 + adds r0, r7, 0 + bl sub_81BA6D0 + movs r0, 0x50 + b _081BAAEC +_081BAAA2: + ldrb r0, [r7, 0x18] + adds r0, 0x2 + strb r0, [r7, 0x18] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC4 + bne _081BAAB2 + b _081BA88A +_081BAAB2: + ldrb r0, [r7, 0x18] + ldr r1, [r7, 0x28] + adds r0, r1 + subs r1, r0, 0x3 + ldrb r2, [r1] + lsls r2, 8 + subs r0, 0x4 + ldrb r1, [r0] + orrs r1, r2 + adds r0, r7, 0 + bl sub_81BAAFC + adds r5, r0, 0 + cmp r5, 0 + bne _081BAAEC + adds r0, r7, 0 + adds r0, 0x4B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081BAAEA +_081BAADA: + bl sub_81BAD48 + b _081BA736 +_081BAAE0: + adds r0, r7, 0 + bl sub_81BA6D0 + movs r0, 0x60 + b _081BAAEC +_081BAAEA: + movs r0, 0 +_081BAAEC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81BA70C + + thumb_func_start sub_81BAAFC +sub_81BAAFC: @ 81BAAFC + push {r4,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, _081BAB28 + ldrh r0, [r3] + movs r4, 0x8C + ands r4, r0 + cmp r4, 0x8 + bne _081BAB34 + ldr r0, _081BAB2C + strh r1, [r0] + ldr r1, _081BAB30 + adds r0, r1, 0 + strh r0, [r3] + adds r1, r2, 0 + adds r1, 0x48 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + b _081BAB40 + .align 2, 0 +_081BAB28: .4byte 0x04000128 +_081BAB2C: .4byte 0x0400012a +_081BAB30: .4byte 0x00002083 +_081BAB34: + adds r0, r2, 0 + bl sub_81BA6D0 + movs r0, 0x8 + eors r4, r0 + adds r0, r4, 0 +_081BAB40: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81BAAFC + + thumb_func_start sub_81BAB48 +sub_81BAB48: @ 81BAB48 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x18] + cmp r0, 0 + beq _081BAB5A + adds r0, r1, 0 + bl sub_81BA6D0 + b _081BAB66 +_081BAB5A: + adds r2, r1, 0 + adds r2, 0x4A + strb r0, [r2] + strb r0, [r1, 0x1E] + movs r0, 0x1 + strb r0, [r1, 0x18] +_081BAB66: + pop {r0} + bx r0 + thumb_func_end sub_81BAB48 + + thumb_func_start sub_81BAB6C +sub_81BAB6C: @ 81BAB6C + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [sp, 0x14] + lsls r3, 24 + lsrs r5, r3, 24 + lsls r0, 24 + lsrs r7, r0, 24 + movs r3, 0 + ldrb r0, [r4, 0x18] + cmp r0, 0 + bne _081BABA8 + ldrb r0, [r4, 0x1E] + cmp r0, 0 + beq _081BABA8 + adds r0, r4, 0 + adds r0, 0x4A + ldrb r0, [r0] + cmp r0, 0 + bne _081BABA8 + str r6, [r4, 0x20] + adds r2, 0xF + movs r0, 0x10 + negs r0, r0 + ands r2, r0 + subs r0, 0xF0 + adds r1, r2, r0 + ldr r0, _081BABB0 + cmp r1, r0 + bls _081BABB4 +_081BABA8: + adds r0, r4, 0 + bl sub_81BA6D0 + b _081BAC28 + .align 2, 0 +_081BABB0: .4byte 0x0003ff00 +_081BABB4: + adds r0, r6, r2 + str r0, [r4, 0x24] + lsls r1, r7, 24 + movs r2, 0x80 + lsls r2, 19 + adds r0, r1, r2 + asrs r0, 24 + adds r2, r1, 0 + cmp r0, 0x8 + bhi _081BAC14 + lsls r0, 2 + ldr r1, _081BABD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BABD4: .4byte _081BABD8 + .align 2, 0 +_081BABD8: + .4byte _081BABFC + .4byte _081BABFC + .4byte _081BABFC + .4byte _081BABFC + .4byte _081BAC06 + .4byte _081BAC0C + .4byte _081BAC0C + .4byte _081BAC0C + .4byte _081BAC0C +_081BABFC: + lsls r3, r5, 3 + asrs r1, r2, 24 + movs r0, 0x3 + subs r0, r1 + b _081BAC12 +_081BAC06: + movs r0, 0x38 + adds r3, r5, 0 + b _081BAC12 +_081BAC0C: + lsls r3, r5, 3 + asrs r0, r2, 24 + subs r0, 0x1 +_081BAC12: + orrs r3, r0 +_081BAC14: + movs r0, 0x3F + ands r3, r0 + lsls r0, r3, 1 + movs r2, 0x7F + negs r2, r2 + adds r1, r2, 0 + orrs r0, r1 + strb r0, [r4, 0x1C] + movs r0, 0xD0 + strb r0, [r4, 0x18] +_081BAC28: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81BAB6C + + thumb_func_start sub_81BAC30 +sub_81BAC30: @ 81BAC30 + push {lr} + ldrb r0, [r0, 0x18] + cmp r0, 0xE9 + beq _081BAC3C + movs r0, 0 + b _081BAC3E +_081BAC3C: + movs r0, 0x1 +_081BAC3E: + pop {r1} + bx r1 + thumb_func_end sub_81BAC30 + + thumb_func_start sub_81BAC44 +sub_81BAC44: @ 81BAC44 + push {r4-r6,lr} + adds r3, r0, 0 + ldrb r0, [r3, 0x18] + cmp r0, 0xE0 + beq _081BAC60 + cmp r0, 0xE0 + blt _081BAC70 + cmp r0, 0xE8 + bgt _081BAC70 + cmp r0, 0xE7 + blt _081BAC70 + movs r4, 0x3 + ldrb r5, [r3, 0x1E] + b _081BACD0 +_081BAC60: + movs r1, 0 + movs r0, 0xE1 + strb r0, [r3, 0x18] + str r1, [r3, 0x4] + movs r0, 0x80 + lsls r0, 13 + str r0, [r3] + b _081BACC2 +_081BAC70: + movs r4, 0x3 + ldrb r5, [r3, 0x1E] + movs r6, 0x1 + ldr r1, _081BACCC +_081BAC78: + ldrh r0, [r1] + adds r2, r0, 0 + adds r0, r5, 0 + asrs r0, r4 + ands r0, r6 + cmp r0, 0 + beq _081BAC8C + ldr r0, [r3, 0x4] + cmp r2, r0 + bne _081BAC60 +_081BAC8C: + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bne _081BAC78 + ldrb r0, [r3, 0x18] + adds r0, 0x1 + strb r0, [r3, 0x18] + ldr r1, [r3] + ldrh r0, [r3] + str r0, [r3, 0x4] + cmp r1, 0 + bne _081BACBA + ldr r0, [r3, 0x28] + adds r1, r0, 0 + adds r1, 0xAC + ldrb r1, [r1] + adds r0, 0xAD + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + str r1, [r3, 0x4] + lsls r1, 5 + str r1, [r3] +_081BACBA: + ldr r0, [r3] + lsrs r0, 5 + str r0, [r3] +_081BACC0: + ldrh r1, [r3] +_081BACC2: + adds r0, r3, 0 + bl sub_81BAAFC + b _081BAD28 + .align 2, 0 +_081BACCC: .4byte 0x04000126 +_081BACD0: + lsls r0, r4, 1 + ldr r1, _081BAD18 + adds r0, r1 + ldrh r0, [r0] + adds r2, r0, 0 + adds r0, r5, 0 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BACEC + ldr r0, [r3, 0x4] + cmp r2, r0 + bne _081BAD1C +_081BACEC: + subs r4, 0x1 + cmp r4, 0 + bne _081BACD0 + ldrb r0, [r3, 0x18] + adds r0, 0x1 + strb r0, [r3, 0x18] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE9 + beq _081BAD26 + ldr r0, [r3, 0x28] + adds r1, r0, 0 + adds r1, 0xAE + ldrb r1, [r1] + adds r0, 0xAF + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + str r1, [r3] + str r1, [r3, 0x4] + b _081BACC0 + .align 2, 0 +_081BAD18: .4byte 0x04000120 +_081BAD1C: + adds r0, r3, 0 + bl sub_81BA6D0 + movs r0, 0x71 + b _081BAD28 +_081BAD26: + movs r0, 0 +_081BAD28: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81BAC44 + + thumb_func_start sub_81BAD30 +sub_81BAD30: @ 81BAD30 + mov r2, pc + lsrs r2, 24 + movs r1, 0xC + cmp r2, 0x2 + beq _081BAD42 + movs r1, 0xD + cmp r2, 0x8 + beq _081BAD42 + movs r1, 0x4 +_081BAD42: + subs r0, r1 + bgt _081BAD42 + bx lr + thumb_func_end sub_81BAD30 + + thumb_func_start sub_81BAD48 +sub_81BAD48: @ 81BAD48 + push {r4,r5,lr} + movs r2, 0 + ldr r3, _081BAD7C + ldrh r1, [r3] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081BAD6C + ldr r5, _081BAD80 + movs r4, 0x80 +_081BAD5C: + adds r2, 0x1 + cmp r2, r5 + bgt _081BAD6C + ldrh r1, [r3] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _081BAD5C +_081BAD6C: + movs r0, 0x96 + lsls r0, 2 + bl sub_81BAD30 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BAD7C: .4byte 0x04000128 +_081BAD80: .4byte 0x0000795c + thumb_func_end sub_81BAD48 + + 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, _081BADE0 + strh r2, [r1] + adds r1, 0x2 + strh r2, [r1] + adds r1, 0x3E + strh r2, [r1] + ldr r5, _081BADE4 + 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, _081BADE8 + 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, _081BADEC + movs r2, 0xF8 + lsls r2, 5 + adds r0, r2, 0 + strh r0, [r1] + strh r4, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BADE0: .4byte 0x04000010 +_081BADE4: .4byte 0x08617128 +_081BADE8: .4byte 0x0600f800 +_081BADEC: .4byte 0x04000008 + 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, _081BAE04 + ldr r0, _081BAE08 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BAE0C + str r1, [r0] + bx lr + .align 2, 0 +_081BAE04: .4byte 0x03005d60 +_081BAE08: .4byte 0x02024064 +_081BAE0C: .4byte bx_exec_buffer_A_ch0_tbl3 + 1 + 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, _081BAE44 + ldr r1, _081BAE48 + ldr r0, _081BAE4C + 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, _081BAE50 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081BAE58 + ldr r0, _081BAE54 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081BAE5C + .align 2, 0 +_081BAE44: .4byte 0x02024068 +_081BAE48: .4byte 0x0832a328 +_081BAE4C: .4byte 0x02024064 +_081BAE50: .4byte 0x02023064 +_081BAE54: .4byte 0x08617170 +_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, _081BAE88 + ldr r1, _081BAE8C + ldr r0, _081BAE90 + 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, _081BAE94 + cmp r1, r0 + bne _081BAE84 + bl dp01_tbl3_exec_completed +_081BAE84: + pop {r0} + bx r0 + .align 2, 0 +_081BAE88: .4byte 0x02020630 +_081BAE8C: .4byte 0x020241e4 +_081BAE90: .4byte 0x02024064 +_081BAE94: .4byte nullsub_12 + 1 + thumb_func_end sub_81BAE60 + + thumb_func_start sub_81BAE98 +sub_81BAE98: @ 81BAE98 + push {r4-r6,lr} + ldr r6, _081BAEF0 + ldr r5, _081BAEF4 + ldr r4, _081BAEF8 + 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, _081BAEFC + 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 obj_delete_and_free_tiles + bl dp01_tbl3_exec_completed +_081BAEE8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BAEF0: .4byte 0x02020630 +_081BAEF4: .4byte 0x020241e4 +_081BAEF8: .4byte 0x02024064 +_081BAEFC: .4byte nullsub_12 + 1 + thumb_func_end sub_81BAE98 + + thumb_func_start sub_81BAF00 +sub_81BAF00: @ 81BAF00 + push {r4,lr} + ldr r4, _081BAF40 + ldr r1, [r4] + ldr r3, _081BAF44 + 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 + .align 2, 0 +_081BAF40: .4byte 0x020244d0 +_081BAF44: .4byte 0x02024064 + 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, _081BAF8C + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081BAFA0 +_081BAF6C: + ldr r2, _081BAF90 + ldr r1, _081BAF94 + ldr r0, _081BAF98 + 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, _081BAF9C + cmp r1, r0 + bne _081BAFD8 + b _081BAFD6 + .align 2, 0 +_081BAF8C: .4byte 0x02022fec +_081BAF90: .4byte 0x02020630 +_081BAF94: .4byte 0x03005d70 +_081BAF98: .4byte 0x02024064 +_081BAF9C: .4byte nullsub_12 + 1 +_081BAFA0: + ldr r2, _081BB010 + ldr r5, _081BB014 + ldr r0, _081BB018 + 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, _081BB01C + 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, _081BB020 + ldr r0, [r0] + ldr r3, _081BB018 + 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, _081BB024 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BB028 + str r1, [r0] +_081BB00A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BB010: .4byte 0x02020630 +_081BB014: .4byte 0x03005d70 +_081BB018: .4byte 0x02024064 +_081BB01C: .4byte nullsub_12 + 1 +_081BB020: .4byte 0x020244d0 +_081BB024: .4byte 0x03005d60 +_081BB028: .4byte sub_81BAF00 + 1 + 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, _081BB1A4 + mov r12, r0 + ldr r0, [r0] + ldr r7, _081BB1A8 + 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, _081BB1AC + mov r10, r1 + ldr r0, _081BB1B0 + 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, _081BB1B4 + cmp r3, r0 + bne _081BB196 + ldr r0, _081BB1B8 + 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, _081BB1BC + 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 obj_delete_and_free_tiles + ldr r4, _081BB1C0 + ldrb r0, [r7] + mov r1, r8 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, _081BB1C4 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _081BB1C8 + 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, _081BB1B0 + ldr r4, _081BB1A8 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081BB1AC + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r5, _081BB1C0 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _081BB1C4 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _081BB1C8 + 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, _081BB1A4 + 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, _081BB1CC + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BB1D0 + str r1, [r0] +_081BB196: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BB1A4: .4byte 0x020244d0 +_081BB1A8: .4byte 0x02024064 +_081BB1AC: .4byte 0x02020630 +_081BB1B0: .4byte 0x03005d7c +_081BB1B4: .4byte nullsub_12 + 1 +_081BB1B8: .4byte 0x020241e4 +_081BB1BC: .4byte 0x02022fec +_081BB1C0: .4byte 0x03005d70 +_081BB1C4: .4byte 0x0202406e +_081BB1C8: .4byte 0x020244ec +_081BB1CC: .4byte 0x03005d60 +_081BB1D0: .4byte sub_81BAF48 + 1 + thumb_func_end sub_81BB02C + + thumb_func_start sub_81BB1D4 +sub_81BB1D4: @ 81BB1D4 + push {lr} + ldr r2, _081BB208 + ldr r1, _081BB20C + ldr r0, _081BB210 + 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 + .align 2, 0 +_081BB208: .4byte 0x02020630 +_081BB20C: .4byte 0x020241e4 +_081BB210: .4byte 0x02024064 + thumb_func_end sub_81BB1D4 + + thumb_func_start bx_t3_healthbar_update +bx_t3_healthbar_update: @ 81BB214 + push {r4-r6,lr} + ldr r5, _081BB254 + ldrb r0, [r5] + ldr r6, _081BB258 + 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 + .align 2, 0 +_081BB254: .4byte 0x02024064 +_081BB258: .4byte 0x03005d70 +_081BB25C: + ldr r2, _081BB27C + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _081BB280 + adds r0, r2 + bl sub_805E990 + bl dp01_tbl3_exec_completed +_081BB276: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BB27C: .4byte 0x0202406e +_081BB280: .4byte 0x020244ec + thumb_func_end bx_t3_healthbar_update + + thumb_func_start sub_81BB284 +sub_81BB284: @ 81BB284 + push {lr} + movs r0, 0 + bl a_pressed_maybe + 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, _081BB39C + 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, _081BB3A0 + 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, _081BB3A4 + 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, _081BB3A8 + adds r4, 0x1 + lsls r4, 2 + ldr r2, _081BB3AC + 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, _081BB3B0 + 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, _081BB3A0 + 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, _081BB3B4 + b _081BB3FA + .align 2, 0 +_081BB39C: .4byte 0x03005e00 +_081BB3A0: .4byte 0x0202406e +_081BB3A4: .4byte 0x020244ec +_081BB3A8: .4byte 0x0831f72c +_081BB3AC: .4byte 0x083203cc +_081BB3B0: .4byte 0x02024064 +_081BB3B4: .4byte sub_81BB628 + 1 +_081BB3B8: + ldr r0, _081BB3C8 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldr r0, _081BB3CC + b _081BB3FC + .align 2, 0 +_081BB3C8: .4byte 0x03005e00 +_081BB3CC: .4byte sub_81BB740 + 1 +_081BB3D0: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, _081BB3F0 + ldr r3, [sp, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, _081BB3F4 + str r1, [r0] + mov r0, r9 + bl remove_task + b _081BB3FE + .align 2, 0 +_081BB3F0: .4byte 0x03005d60 +_081BB3F4: .4byte sub_81BB284 + 1 +_081BB3F8: + ldr r0, _081BB410 +_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 + .align 2, 0 +_081BB410: .4byte sub_81BB414 + 1 + 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, _081BB4CC + 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, _081BB4D0 + 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, _081BB4D4 + lsls r1, r4, 2 + ldr r2, _081BB4D8 + 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, _081BB4DC + 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, _081BB4E0 + 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 + .align 2, 0 +_081BB4CC: .4byte 0x03005e00 +_081BB4D0: .4byte 0x020244ec +_081BB4D4: .4byte 0x0831f72c +_081BB4D8: .4byte 0x083203cc +_081BB4DC: .4byte 0x03005d70 +_081BB4E0: .4byte sub_81BB4E4 + 1 + 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, _081BB510 + 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 + .align 2, 0 +_081BB510: .4byte 0x03005e00 +_081BB514: + ldrb r0, [r6, 0x8] + mov r9, r0 + ldrh r2, [r6, 0xA] + mov r10, r2 + ldrb r7, [r6, 0xC] + ldr r5, _081BB5DC + 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, _081BB5E0 + 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, _081BB5E4 + adds r4, 0x1 + lsls r4, 2 + ldr r2, _081BB5E8 + 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, _081BB5EC + 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, _081BB5F0 + str r0, [r6] + b _081BB610 + .align 2, 0 +_081BB5DC: .4byte 0x03005d70 +_081BB5E0: .4byte 0x020244ec +_081BB5E4: .4byte 0x0831f72c +_081BB5E8: .4byte 0x083203cc +_081BB5EC: .4byte 0x02024064 +_081BB5F0: .4byte sub_81BB628 + 1 +_081BB5F4: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, _081BB620 + lsls r0, r7, 2 + adds r0, r1 + ldr r1, _081BB624 + 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 + .align 2, 0 +_081BB620: .4byte 0x03005d60 +_081BB624: .4byte sub_81BB284 + 1 + 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, _081BB67C + 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, _081BB680 + 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, _081BB67C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081BB684 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BB67C: .4byte 0x03005e00 +_081BB680: .4byte 0x0202406e +_081BB684: .4byte sub_81BB688 + 1 + 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, _081BB6F4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + ldrb r5, [r2, 0xC] + ldr r0, _081BB6F8 + 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, _081BB6FC + 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, _081BB700 + 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, _081BB704 + adds r0, r2, r0 + ldrb r0, [r0] + adds r1, r7, 0 + movs r2, 0 + bl healthbar_draw_field_maybe + b _081BB71C + .align 2, 0 +_081BB6F4: .4byte 0x03005e00 +_081BB6F8: .4byte 0x020244d0 +_081BB6FC: .4byte 0x020244ec +_081BB700: .4byte 0x0202406e +_081BB704: .4byte 0x03005d70 +_081BB708: + ldr r0, _081BB730 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x64 + muls r1, r4 + ldr r2, _081BB734 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_081BB71C: + ldr r0, _081BB738 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081BB73C + str r0, [r1] +_081BB72A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BB730: .4byte 0x03005d70 +_081BB734: .4byte 0x020244ec +_081BB738: .4byte 0x03005e00 +_081BB73C: .4byte sub_81BB740 + 1 + 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, _081BB77C + 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, _081BB780 + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + ldrb r0, [r4, 0xC] + ldr r1, _081BB784 + lsls r0, 2 + adds r0, r1 + ldr r1, _081BB788 + str r1, [r0] + adds r0, r5, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BB77C: .4byte 0x03005e00 +_081BB780: .4byte 0x020244ec +_081BB784: .4byte 0x03005d60 +_081BB788: .4byte sub_81BB284 + 1 + thumb_func_end sub_81BB740 + + thumb_func_start sub_81BB78C +sub_81BB78C: @ 81BB78C + push {r4-r6,lr} + ldr r6, _081BB810 + ldr r5, _081BB814 + ldr r4, _081BB818 + 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, _081BB81C + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081BB820 + 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 obj_delete_and_free_tiles + ldr r1, _081BB824 + 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 + .align 2, 0 +_081BB810: .4byte 0x02020630 +_081BB814: .4byte 0x020241e4 +_081BB818: .4byte 0x02024064 +_081BB81C: .4byte 0x0202406e +_081BB820: .4byte 0x020244ec +_081BB824: .4byte 0x03005d70 + thumb_func_end sub_81BB78C + + thumb_func_start sub_81BB828 +sub_81BB828: @ 81BB828 + push {r4-r6,lr} + ldr r0, _081BB884 + ldr r0, [r0] + ldr r6, _081BB888 + 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, _081BB88C + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081BB890 + 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 obj_delete_and_free_tiles + ldr r1, _081BB894 + 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 + .align 2, 0 +_081BB884: .4byte 0x020244d0 +_081BB888: .4byte 0x02024064 +_081BB88C: .4byte 0x020241e4 +_081BB890: .4byte 0x02020630 +_081BB894: .4byte 0x03005d70 + thumb_func_end sub_81BB828 + + thumb_func_start sub_81BB898 +sub_81BB898: @ 81BB898 + push {lr} + movs r0, 0 + bl a_pressed_maybe + 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, _081BB8EC + ldr r0, _081BB8F0 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, _081BB8F4 + 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, _081BB8F8 + strb r3, [r0] + bl dp01_tbl3_exec_completed + b _081BB926 + .align 2, 0 +_081BB8EC: .4byte 0x020241e4 +_081BB8F0: .4byte 0x02024064 +_081BB8F4: .4byte 0x02020630 +_081BB8F8: .4byte 0x020244b9 +_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, _081BB984 + ldr r0, _081BB988 + ldr r4, _081BB98C + 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, _081BB990 + cmp r1, r0 + bne _081BB97E + adds r0, r3, 0 + bl sub_805E408 + ldr r0, _081BB994 + 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, _081BB998 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _081BB99C + str r0, [r1] +_081BB97E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BB984: .4byte 0x02020630 +_081BB988: .4byte 0x03005d70 +_081BB98C: .4byte 0x02024064 +_081BB990: .4byte nullsub_12 + 1 +_081BB994: .4byte 0x020244d0 +_081BB998: .4byte 0x03005d60 +_081BB99C: .4byte dp01t_35_3_free_vram + 1 + thumb_func_end sub_81BB92C + + thumb_func_start dp01t_35_3_free_vram +dp01t_35_3_free_vram: @ 81BB9A0 + push {lr} + ldr r0, _081BB9E0 + ldr r1, [r0] + ldr r0, _081BB9E4 + 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, _081BB9E8 + ldr r0, _081BB9EC + 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, _081BB9F0 + cmp r1, r0 + bne _081BB9DC + bl dp01_tbl3_exec_completed +_081BB9DC: + pop {r0} + bx r0 + .align 2, 0 +_081BB9E0: .4byte 0x020244d0 +_081BB9E4: .4byte 0x02024064 +_081BB9E8: .4byte 0x02020630 +_081BB9EC: .4byte 0x020241e4 +_081BB9F0: .4byte nullsub_12 + 1 + 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, _081BBABC + ldr r0, [r3] + ldr r7, _081BBAC0 + 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, _081BBAC4 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldr r0, _081BBAC8 + movs r1, 0xA + bl AddTask + ldr r0, _081BBACC + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, _081BBAD0 + adds r0, r5 + bl sub_805E990 + ldr r1, _081BBAD4 + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081BBAD8 + adds r0, r1 + movs r1, 0 + bl obj_anim_image_start + ldr r4, _081BBADC + 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, _081BBAE0 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BBAE4 + str r1, [r0] +_081BBAB0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BBABC: .4byte 0x020244d0 +_081BBAC0: .4byte 0x02024064 +_081BBAC4: .4byte 0x000027f9 +_081BBAC8: .4byte c3_0802FDF4 + 1 +_081BBACC: .4byte 0x0202406e +_081BBAD0: .4byte 0x020244ec +_081BBAD4: .4byte 0x020241e4 +_081BBAD8: .4byte 0x02020630 +_081BBADC: .4byte 0x03005d70 +_081BBAE0: .4byte 0x03005d60 +_081BBAE4: .4byte sub_81BB92C + 1 + thumb_func_end sub_81BB9F4 + + thumb_func_start sub_81BBAE8 +sub_81BBAE8: @ 81BBAE8 + push {r4-r6,lr} + ldr r6, _081BBB68 + ldr r0, [r6] + ldr r4, _081BBB6C + 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, _081BBB70 + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, _081BBB74 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081BBB1A: + ldr r5, _081BBB78 + ldr r0, _081BBB7C + 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, _081BBB80 + 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 obj_delete_and_free_tiles + ldr r1, _081BBB84 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BBB88 + str r1, [r0] +_081BBB60: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BBB68: .4byte 0x020244d0 +_081BBB6C: .4byte 0x02024064 +_081BBB70: .4byte 0x0202406e +_081BBB74: .4byte 0x020244ec +_081BBB78: .4byte 0x02020630 +_081BBB7C: .4byte 0x03005d7c +_081BBB80: .4byte nullsub_12 + 1 +_081BBB84: .4byte 0x03005d60 +_081BBB88: .4byte sub_81BB9F4 + 1 + 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, _081BBBCC + ldr r4, _081BBBD0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BBBD4 + str r1, [r0] + ldr r0, _081BBBD8 + 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, _081BBBDC + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _081BBBF2 + .align 2, 0 +_081BBBCC: .4byte 0x03005d60 +_081BBBD0: .4byte 0x02024064 +_081BBBD4: .4byte bx_exec_buffer_A_ch0_tbl3 + 1 +_081BBBD8: .4byte 0x02022fec +_081BBBDC: .4byte 0x02023064 +_081BBBE0: + ldr r2, _081BBBFC + ldr r1, _081BBC00 + 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 + .align 2, 0 +_081BBBFC: .4byte 0x02024068 +_081BBC00: .4byte 0x0832a328 + thumb_func_end dp01_tbl3_exec_completed + + thumb_func_start sub_81BBC04 +sub_81BBC04: @ 81BBC04 + push {lr} + ldr r0, _081BBC2C + ldr r2, [r0] + ldr r0, _081BBC30 + 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 + .align 2, 0 +_081BBC2C: .4byte 0x020244d0 +_081BBC30: .4byte 0x02024064 + thumb_func_end sub_81BBC04 + + thumb_func_start bx_80E8A6C +bx_80E8A6C: @ 81BBC34 + push {lr} + ldr r0, _081BBC5C + ldr r2, [r0] + ldr r0, _081BBC60 + 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 + .align 2, 0 +_081BBC5C: .4byte 0x020244d0 +_081BBC60: .4byte 0x02024064 + 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, _081BBC90 + ldr r0, _081BBC94 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _081BBC9C + ldr r0, _081BBC98 + 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 + .align 2, 0 +_081BBC90: .4byte 0x02023064 +_081BBC94: .4byte 0x02024064 +_081BBC98: .4byte 0x0202406e +_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, _081BBD0C + ldr r3, _081BBD10 + 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, _081BBD14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BBD0C: .4byte 0x02023064 +_081BBD10: .4byte 0x02024064 +_081BBD14: .4byte _081BBD18 + .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, _081BC01C + 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, _081BC01C + 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, _081BC020 + 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, _081BC024 + 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, _081BC028 + 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 strcpy_limit_10_chars + 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 + .align 2, 0 +_081BC01C: .4byte 0x020244ec +_081BC020: .4byte 0xfffffc1f +_081BC024: .4byte 0xfff07fff +_081BC028: .4byte 0xfffffe0f +_081BC02C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC038 + adds r0, r1 + movs r1, 0xB + b _081BC3A6 + .align 2, 0 +_081BC038: .4byte 0x020244ec +_081BC03C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC048 + adds r0, r1 + movs r1, 0xC + b _081BC3A6 + .align 2, 0 +_081BC048: .4byte 0x020244ec +_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, _081BC0B0 + 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, _081BC0B0 + 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 + .align 2, 0 +_081BC0B0: .4byte 0x020244ec +_081BC0B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC0CC + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _081BC3A6 + .align 2, 0 +_081BC0CC: .4byte 0x020244ec +_081BC0D0: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, _081BC108 + 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, _081BC108 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _081BC46E + .align 2, 0 +_081BC108: .4byte 0x020244ec +_081BC10C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC124 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _081BC466 + .align 2, 0 +_081BC124: .4byte 0x020244ec +_081BC128: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC134 + adds r0, r1 + movs r1, 0x1 + b _081BC142 + .align 2, 0 +_081BC134: .4byte 0x020244ec +_081BC138: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC164 + 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 + .align 2, 0 +_081BC164: .4byte 0x020244ec +_081BC168: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC174 + adds r0, r1 + movs r1, 0x1A + b _081BC466 + .align 2, 0 +_081BC174: .4byte 0x020244ec +_081BC178: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC184 + adds r0, r1 + movs r1, 0x1B + b _081BC466 + .align 2, 0 +_081BC184: .4byte 0x020244ec +_081BC188: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC194 + adds r0, r1 + movs r1, 0x1C + b _081BC466 + .align 2, 0 +_081BC194: .4byte 0x020244ec +_081BC198: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC1A4 + adds r0, r1 + movs r1, 0x1D + b _081BC466 + .align 2, 0 +_081BC1A4: .4byte 0x020244ec +_081BC1A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC1B4 + adds r0, r1 + movs r1, 0x1E + b _081BC466 + .align 2, 0 +_081BC1B4: .4byte 0x020244ec +_081BC1B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC1C4 + adds r0, r1 + movs r1, 0x1F + b _081BC466 + .align 2, 0 +_081BC1C4: .4byte 0x020244ec +_081BC1C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC1D4 + adds r0, r1 + movs r1, 0x20 + b _081BC466 + .align 2, 0 +_081BC1D4: .4byte 0x020244ec +_081BC1D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC1E4 + adds r0, r1 + movs r1, 0x22 + b _081BC466 + .align 2, 0 +_081BC1E4: .4byte 0x020244ec +_081BC1E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC1F4 + adds r0, r1 + movs r1, 0x23 + b _081BC466 + .align 2, 0 +_081BC1F4: .4byte 0x020244ec +_081BC1F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC204 + adds r0, r1 + movs r1, 0x24 + b _081BC466 + .align 2, 0 +_081BC204: .4byte 0x020244ec +_081BC208: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC214 + adds r0, r1 + movs r1, 0x25 + b _081BC466 + .align 2, 0 +_081BC214: .4byte 0x020244ec +_081BC218: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC224 + adds r0, r1 + movs r1, 0x26 + b _081BC466 + .align 2, 0 +_081BC224: .4byte 0x020244ec +_081BC228: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081BC274 + 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 + .align 2, 0 +_081BC274: .4byte 0x020244ec +_081BC278: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC284 + adds r0, r1 + movs r1, 0x27 + b _081BC466 + .align 2, 0 +_081BC284: .4byte 0x020244ec +_081BC288: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC294 + adds r0, r1 + movs r1, 0x28 + b _081BC466 + .align 2, 0 +_081BC294: .4byte 0x020244ec +_081BC298: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC2A4 + adds r0, r1 + movs r1, 0x29 + b _081BC466 + .align 2, 0 +_081BC2A4: .4byte 0x020244ec +_081BC2A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC2B4 + adds r0, r1 + movs r1, 0x2A + b _081BC466 + .align 2, 0 +_081BC2B4: .4byte 0x020244ec +_081BC2B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC2C4 + adds r0, r1 + movs r1, 0x2B + b _081BC466 + .align 2, 0 +_081BC2C4: .4byte 0x020244ec +_081BC2C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC2D4 + adds r0, r1 + movs r1, 0x2C + b _081BC466 + .align 2, 0 +_081BC2D4: .4byte 0x020244ec +_081BC2D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC2E4 + adds r0, r1 + movs r1, 0 + b _081BC302 + .align 2, 0 +_081BC2E4: .4byte 0x020244ec +_081BC2E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC2F4 + adds r0, r1 + movs r1, 0x9 + b _081BC3A6 + .align 2, 0 +_081BC2F4: .4byte 0x020244ec +_081BC2F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC328 + 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 + .align 2, 0 +_081BC328: .4byte 0x020244ec +_081BC32C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC338 + adds r0, r1 + movs r1, 0x38 + b _081BC466 + .align 2, 0 +_081BC338: .4byte 0x020244ec +_081BC33C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC348 + adds r0, r1 + movs r1, 0x39 + b _081BC3A6 + .align 2, 0 +_081BC348: .4byte 0x020244ec +_081BC34C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC358 + adds r0, r1 + movs r1, 0x3A + b _081BC3A6 + .align 2, 0 +_081BC358: .4byte 0x020244ec +_081BC35C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC368 + adds r0, r1 + movs r1, 0x3B + b _081BC3A6 + .align 2, 0 +_081BC368: .4byte 0x020244ec +_081BC36C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC378 + adds r0, r1 + movs r1, 0x3C + b _081BC3A6 + .align 2, 0 +_081BC378: .4byte 0x020244ec +_081BC37C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC388 + adds r0, r1 + movs r1, 0x3D + b _081BC3A6 + .align 2, 0 +_081BC388: .4byte 0x020244ec +_081BC38C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC398 + adds r0, r1 + movs r1, 0x3E + b _081BC3A6 + .align 2, 0 +_081BC398: .4byte 0x020244ec +_081BC39C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC3B8 + 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 + .align 2, 0 +_081BC3B8: .4byte 0x020244ec +_081BC3BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC3C8 + adds r0, r1 + movs r1, 0x16 + b _081BC466 + .align 2, 0 +_081BC3C8: .4byte 0x020244ec +_081BC3CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC3D8 + adds r0, r1 + movs r1, 0x17 + b _081BC466 + .align 2, 0 +_081BC3D8: .4byte 0x020244ec +_081BC3DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC3E8 + adds r0, r1 + movs r1, 0x18 + b _081BC466 + .align 2, 0 +_081BC3E8: .4byte 0x020244ec +_081BC3EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC3F8 + adds r0, r1 + movs r1, 0x21 + b _081BC466 + .align 2, 0 +_081BC3F8: .4byte 0x020244ec +_081BC3FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC408 + adds r0, r1 + movs r1, 0x2F + b _081BC466 + .align 2, 0 +_081BC408: .4byte 0x020244ec +_081BC40C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC418 + adds r0, r1 + movs r1, 0x30 + b _081BC466 + .align 2, 0 +_081BC418: .4byte 0x020244ec +_081BC41C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC428 + adds r0, r1 + movs r1, 0x32 + b _081BC466 + .align 2, 0 +_081BC428: .4byte 0x020244ec +_081BC42C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC438 + adds r0, r1 + movs r1, 0x33 + b _081BC466 + .align 2, 0 +_081BC438: .4byte 0x020244ec +_081BC43C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC448 + adds r0, r1 + movs r1, 0x34 + b _081BC466 + .align 2, 0 +_081BC448: .4byte 0x020244ec +_081BC44C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC458 + adds r0, r1 + movs r1, 0x35 + b _081BC466 + .align 2, 0 +_081BC458: .4byte 0x020244ec +_081BC45C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC480 + 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 + .align 2, 0 +_081BC480: .4byte 0x020244ec + 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, _081BC4B4 + ldr r0, _081BC4B8 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _081BC4C0 + ldr r0, _081BC4BC + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_81BC4E8 + b _081BC4DE + .align 2, 0 +_081BC4B4: .4byte 0x02023064 +_081BC4B8: .4byte 0x02024064 +_081BC4BC: .4byte 0x0202406e +_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, _081BC520 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, _081BC524 + 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, _081BC528 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BC520: .4byte 0x02024064 +_081BC524: .4byte 0x02023067 +_081BC528: .4byte _081BC52C + .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, _081BC7B0 + 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, _081BC7B0 + 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 + .align 2, 0 +_081BC7B0: .4byte 0x020244ec +_081BC7B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC7CC + adds r0, r1 + ldr r1, _081BC7D0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC7CC: .4byte 0x020244ec +_081BC7D0: .4byte 0x02024064 +_081BC7D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC7EC + adds r0, r1 + ldr r1, _081BC7F0 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC7EC: .4byte 0x020244ec +_081BC7F0: .4byte 0x02024064 +_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, _081BC848 + 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, _081BC848 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC848: .4byte 0x020244ec +_081BC84C: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC868 + adds r0, r1 + ldr r3, _081BC86C + ldr r1, _081BC870 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _081BC8F0 + .align 2, 0 +_081BC868: .4byte 0x020244ec +_081BC86C: .4byte 0x02023064 +_081BC870: .4byte 0x02024064 +_081BC874: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081BC8D0 + adds r4, r0 + ldr r5, _081BC8D4 + 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 + .align 2, 0 +_081BC8D0: .4byte 0x020244ec +_081BC8D4: .4byte 0x02024064 +_081BC8D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC8FC + adds r0, r1 + ldr r3, _081BC900 + ldr r1, _081BC904 + 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 + .align 2, 0 +_081BC8FC: .4byte 0x020244ec +_081BC900: .4byte 0x02023064 +_081BC904: .4byte 0x02024064 +_081BC908: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC920 + adds r0, r1 + ldr r1, _081BC924 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC920: .4byte 0x020244ec +_081BC924: .4byte 0x02024064 +_081BC928: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC940 + adds r0, r1 + ldr r1, _081BC944 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC940: .4byte 0x020244ec +_081BC944: .4byte 0x02024064 +_081BC948: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC960 + adds r0, r1 + ldr r1, _081BC964 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC960: .4byte 0x020244ec +_081BC964: .4byte 0x02024064 +_081BC968: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC980 + adds r0, r1 + ldr r1, _081BC984 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC980: .4byte 0x020244ec +_081BC984: .4byte 0x02024064 +_081BC988: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC9A0 + adds r0, r1 + ldr r1, _081BC9A4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC9A0: .4byte 0x020244ec +_081BC9A4: .4byte 0x02024064 +_081BC9A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC9C0 + adds r0, r1 + ldr r1, _081BC9C4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC9C0: .4byte 0x020244ec +_081BC9C4: .4byte 0x02024064 +_081BC9C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BC9E0 + adds r0, r1 + ldr r1, _081BC9E4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BC9E0: .4byte 0x020244ec +_081BC9E4: .4byte 0x02024064 +_081BC9E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCA00 + adds r0, r1 + ldr r1, _081BCA04 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCA00: .4byte 0x020244ec +_081BCA04: .4byte 0x02024064 +_081BCA08: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCA20 + adds r0, r1 + ldr r1, _081BCA24 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCA20: .4byte 0x020244ec +_081BCA24: .4byte 0x02024064 +_081BCA28: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCA40 + adds r0, r1 + ldr r1, _081BCA44 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCA40: .4byte 0x020244ec +_081BCA44: .4byte 0x02024064 +_081BCA48: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCA60 + adds r0, r1 + ldr r1, _081BCA64 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCA60: .4byte 0x020244ec +_081BCA64: .4byte 0x02024064 +_081BCA68: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCA80 + adds r0, r1 + ldr r1, _081BCA84 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCA80: .4byte 0x020244ec +_081BCA84: .4byte 0x02024064 +_081BCA88: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCAA0 + adds r0, r1 + ldr r1, _081BCAA4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCAA0: .4byte 0x020244ec +_081BCAA4: .4byte 0x02024064 +_081BCAA8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCAC0 + adds r0, r1 + ldr r1, _081BCAC4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCAC0: .4byte 0x020244ec +_081BCAC4: .4byte 0x02024064 +_081BCAC8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, _081BCB30 + adds r4, r0 + ldr r5, _081BCB34 + 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 + .align 2, 0 +_081BCB30: .4byte 0x020244ec +_081BCB34: .4byte 0x02024064 +_081BCB38: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCB50 + adds r0, r1 + ldr r1, _081BCB54 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCB50: .4byte 0x020244ec +_081BCB54: .4byte 0x02024064 +_081BCB58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCB70 + adds r0, r1 + ldr r1, _081BCB74 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCB70: .4byte 0x020244ec +_081BCB74: .4byte 0x02024064 +_081BCB78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCB90 + adds r0, r1 + ldr r1, _081BCB94 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCB90: .4byte 0x020244ec +_081BCB94: .4byte 0x02024064 +_081BCB98: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCBB0 + adds r0, r1 + ldr r1, _081BCBB4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCBB0: .4byte 0x020244ec +_081BCBB4: .4byte 0x02024064 +_081BCBB8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCBD0 + adds r0, r1 + ldr r1, _081BCBD4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCBD0: .4byte 0x020244ec +_081BCBD4: .4byte 0x02024064 +_081BCBD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCBF0 + adds r0, r1 + ldr r1, _081BCBF4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_081BCBE8: + movs r1, 0x2C + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCBF0: .4byte 0x020244ec +_081BCBF4: .4byte 0x02024064 +_081BCBF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCC10 + adds r0, r1 + ldr r1, _081BCC14 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCC10: .4byte 0x020244ec +_081BCC14: .4byte 0x02024064 +_081BCC18: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCC30 + adds r0, r1 + ldr r1, _081BCC34 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCC30: .4byte 0x020244ec +_081BCC34: .4byte 0x02024064 +_081BCC38: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCC50 + adds r0, r1 + ldr r1, _081BCC54 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCC50: .4byte 0x020244ec +_081BCC54: .4byte 0x02024064 +_081BCC58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCC70 + adds r0, r1 + ldr r1, _081BCC74 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCC70: .4byte 0x020244ec +_081BCC74: .4byte 0x02024064 +_081BCC78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCC90 + adds r0, r1 + ldr r1, _081BCC94 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCC90: .4byte 0x020244ec +_081BCC94: .4byte 0x02024064 +_081BCC98: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCCB0 + adds r0, r1 + ldr r1, _081BCCB4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCCB0: .4byte 0x020244ec +_081BCCB4: .4byte 0x02024064 +_081BCCB8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCCD0 + adds r0, r1 + ldr r1, _081BCCD4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCCD0: .4byte 0x020244ec +_081BCCD4: .4byte 0x02024064 +_081BCCD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCCF0 + adds r0, r1 + ldr r1, _081BCCF4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCCF0: .4byte 0x020244ec +_081BCCF4: .4byte 0x02024064 +_081BCCF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCD10 + adds r0, r1 + ldr r1, _081BCD14 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCD10: .4byte 0x020244ec +_081BCD14: .4byte 0x02024064 +_081BCD18: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCD30 + adds r0, r1 + ldr r1, _081BCD34 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCD30: .4byte 0x020244ec +_081BCD34: .4byte 0x02024064 +_081BCD38: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCD50 + adds r0, r1 + ldr r1, _081BCD54 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCD50: .4byte 0x020244ec +_081BCD54: .4byte 0x02024064 +_081BCD58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCD70 + adds r0, r1 + ldr r1, _081BCD74 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCD70: .4byte 0x020244ec +_081BCD74: .4byte 0x02024064 +_081BCD78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCD90 + adds r0, r1 + ldr r1, _081BCD94 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCD90: .4byte 0x020244ec +_081BCD94: .4byte 0x02024064 +_081BCD98: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCDB0 + adds r0, r1 + ldr r1, _081BCDB4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCDB0: .4byte 0x020244ec +_081BCDB4: .4byte 0x02024064 +_081BCDB8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCDD0 + adds r0, r1 + ldr r1, _081BCDD4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCDD0: .4byte 0x020244ec +_081BCDD4: .4byte 0x02024064 +_081BCDD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCDF0 + adds r0, r1 + ldr r1, _081BCDF4 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCDF0: .4byte 0x020244ec +_081BCDF4: .4byte 0x02024064 +_081BCDF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCE10 + adds r0, r1 + ldr r1, _081BCE14 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCE10: .4byte 0x020244ec +_081BCE14: .4byte 0x02024064 +_081BCE18: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCE30 + adds r0, r1 + ldr r1, _081BCE34 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCE30: .4byte 0x020244ec +_081BCE34: .4byte 0x02024064 +_081BCE38: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCE50 + adds r0, r1 + ldr r1, _081BCE54 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCE50: .4byte 0x020244ec +_081BCE54: .4byte 0x02024064 +_081BCE58: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCE70 + adds r0, r1 + ldr r1, _081BCE74 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCE70: .4byte 0x020244ec +_081BCE74: .4byte 0x02024064 +_081BCE78: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCE90 + adds r0, r1 + ldr r1, _081BCE94 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _081BCEAE + .align 2, 0 +_081BCE90: .4byte 0x020244ec +_081BCE94: .4byte 0x02024064 +_081BCE98: + movs r0, 0x64 + muls r0, r5 + ldr r1, _081BCED8 + adds r0, r1 + ldr r1, _081BCEDC + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_081BCEAE: + ldr r2, _081BCEE0 + ldr r0, _081BCEDC + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _081BCED8 + 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 + .align 2, 0 +_081BCED8: .4byte 0x020244ec +_081BCEDC: .4byte 0x02024064 +_081BCEE0: .4byte 0x0202406e + thumb_func_end sub_81BC4E8 + + thumb_func_start sub_81BCEE4 +sub_81BCEE4: @ 81BCEE4 + push {r4-r7,lr} + ldr r1, _081BCF48 + ldr r7, _081BCF4C + 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, _081BCF50 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, _081BCF54 + 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 + .align 2, 0 +_081BCF48: .4byte 0x0202406e +_081BCF4C: .4byte 0x02024064 +_081BCF50: .4byte 0x02023064 +_081BCF54: .4byte 0x020244ec + thumb_func_end sub_81BCEE4 + + thumb_func_start sub_81BCF58 +sub_81BCF58: @ 81BCF58 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _081BD04C + mov r8, r0 + ldr r6, _081BD050 + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _081BD054 + 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, _081BD058 + 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 obj_add_from_template_forward_search + ldr r4, _081BD05C + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, _081BD060 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, _081BD064 + 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, _081BD068 + adds r2, r1 + ldrb r1, [r2] + bl obj_anim_image_start + ldr r1, _081BD06C + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD070 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BD04C: .4byte 0x0202406e +_081BD050: .4byte 0x02024064 +_081BD054: .4byte 0x020244ec +_081BD058: .4byte 0x0202499c +_081BD05C: .4byte 0x020241e4 +_081BD060: .4byte 0x02020630 +_081BD064: .4byte 0x0000ff10 +_081BD068: .4byte 0x020244e4 +_081BD06C: .4byte 0x03005d60 +_081BD070: .4byte sub_81BB1D4 + 1 + thumb_func_end sub_81BCF58 + + thumb_func_start sub_81BD074 +sub_81BD074: @ 81BD074 + push {r4-r6,lr} + ldr r5, _081BD0CC + ldrb r0, [r5] + ldr r4, _081BD0D0 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, _081BD0D4 + 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, _081BD0D8 + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_81BD0E4 + ldr r1, _081BD0DC + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD0E0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BD0CC: .4byte 0x02024064 +_081BD0D0: .4byte 0x02023064 +_081BD0D4: .4byte 0x0202406e +_081BD0D8: .4byte 0x020244ec +_081BD0DC: .4byte 0x03005d60 +_081BD0E0: .4byte sub_81BBAE8 + 1 + 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, _081BD238 + lsls r2, r6, 1 + adds r2, r0 + ldr r0, _081BD23C + 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, _081BD240 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, _081BD244 + bl object_new_hidden_with_callback + ldr r1, _081BD248 + 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, _081BD24C + 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 obj_add_from_template_forward_search + ldr r4, _081BD250 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, _081BD254 + 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, _081BD258 + adds r6, r1 + ldrb r1, [r6] + bl obj_anim_image_start + 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, _081BD25C + 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 + .align 2, 0 +_081BD238: .4byte 0x0202406e +_081BD23C: .4byte 0x02023064 +_081BD240: .4byte 0x020244ec +_081BD244: .4byte sub_805D714 + 1 +_081BD248: .4byte 0x03005d7c +_081BD24C: .4byte 0x0202499c +_081BD250: .4byte 0x020241e4 +_081BD254: .4byte 0x02020630 +_081BD258: .4byte 0x020244e4 +_081BD25C: .4byte nullsub_12 + 1 + thumb_func_end sub_81BD0E4 + + thumb_func_start sub_81BD260 +sub_81BD260: @ 81BD260 + push {r4-r6,lr} + ldr r1, _081BD294 + ldr r6, _081BD298 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _081BD2A8 + ldr r0, _081BD29C + 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, _081BD2A0 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD2A4 + str r1, [r0] + b _081BD2DE + .align 2, 0 +_081BD294: .4byte 0x02023064 +_081BD298: .4byte 0x02024064 +_081BD29C: .4byte 0x020244d0 +_081BD2A0: .4byte 0x03005d60 +_081BD2A4: .4byte sub_81BD2F0 + 1 +_081BD2A8: + ldr r5, _081BD2E4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081BD2E8 + 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 obj_delete_and_free_tiles + ldr r1, _081BD2EC + 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 + .align 2, 0 +_081BD2E4: .4byte 0x020241e4 +_081BD2E8: .4byte 0x02020630 +_081BD2EC: .4byte 0x03005d70 + thumb_func_end sub_81BD260 + + thumb_func_start sub_81BD2F0 +sub_81BD2F0: @ 81BD2F0 + push {r4-r6,lr} + ldr r6, _081BD310 + ldr r4, [r6] + ldr r5, _081BD314 + 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 + .align 2, 0 +_081BD310: .4byte 0x020244d0 +_081BD314: .4byte 0x02024064 +_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, _081BD374 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD378 + str r1, [r0] +_081BD36E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BD374: .4byte 0x03005d60 +_081BD378: .4byte sub_81BB828 + 1 + 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, _081BD39C + ldrh r1, [r2] + ldr r0, _081BD3A0 + cmp r1, r0 + bne _081BD3A8 + movs r4, 0x7 + movs r0, 0x5A + mov r9, r0 + ldr r0, _081BD3A4 + ldrb r1, [r0, 0x1C] + b _081BD3BE + .align 2, 0 +_081BD39C: .4byte 0x02038bce +_081BD3A0: .4byte 0x00000c03 +_081BD3A4: .4byte 0x08305d2c +_081BD3A8: + ldrh r0, [r2] + bl sub_8162AA0 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x20 + mov r9, r0 + ldr r1, _081BD470 + 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, _081BD474 + ldrh r1, [r0] + ldr r0, _081BD478 + cmp r1, r0 + bne _081BD494 + ldr r5, _081BD47C + 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, _081BD480 + 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 obj_add_from_template_forward_search + ldr r6, _081BD484 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, _081BD488 + 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, _081BD48C + 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, _081BD490 + str r1, [r0] + b _081BD57C + .align 2, 0 +_081BD470: .4byte 0x083054e0 +_081BD474: .4byte 0x02038bce +_081BD478: .4byte 0x00000c03 +_081BD47C: .4byte 0x02024064 +_081BD480: .4byte 0x0202499c +_081BD484: .4byte 0x020241e4 +_081BD488: .4byte 0x02020630 +_081BD48C: .4byte 0x0000fffe +_081BD490: .4byte sub_805D7AC + 1 +_081BD494: + adds r5, r4, 0 + ldr r6, _081BD598 + 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, _081BD59C + 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 obj_add_from_template_forward_search + ldr r4, _081BD5A0 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, _081BD5A4 + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl gpu_pal_tags_index_of + ldr r5, _081BD5A8 + 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, _081BD5AC + 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, _081BD5B0 + 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, _081BD5B4 + ldr r0, _081BD598 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD5B8 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BD598: .4byte 0x02024064 +_081BD59C: .4byte 0x0202499c +_081BD5A0: .4byte 0x020241e4 +_081BD5A4: .4byte 0x0830593c +_081BD5A8: .4byte 0x02020630 +_081BD5AC: .4byte 0x0000fffe +_081BD5B0: .4byte sub_805D7AC + 1 +_081BD5B4: .4byte 0x03005d60 +_081BD5B8: .4byte sub_81BAE60 + 1 + 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, _081BD654 + ldr r4, _081BD658 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, _081BD65C + 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, _081BD660 + 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, _081BD664 + 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, _081BD668 + bl oamt_set_x3A_32 + ldr r1, _081BD66C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD670 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BD654: .4byte 0x020241e4 +_081BD658: .4byte 0x02024064 +_081BD65C: .4byte 0x02020630 +_081BD660: .4byte 0x0000ffd8 +_081BD664: .4byte sub_80A6EEC + 1 +_081BD668: .4byte nullsub_12 + 1 +_081BD66C: .4byte 0x03005d60 +_081BD670: .4byte sub_81BAE98 + 1 + thumb_func_end sub_81BD5C8 + + thumb_func_start sub_81BD674 +sub_81BD674: @ 81BD674 + push {r4-r6,lr} + ldr r6, _081BD6C0 + ldr r4, [r6] + ldr r5, _081BD6C4 + 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 + .align 2, 0 +_081BD6C0: .4byte 0x020244d0 +_081BD6C4: .4byte 0x02024064 +_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, _081BD744 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, _081BD748 + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, _081BD74C + ldr r3, _081BD750 + 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, _081BD754 + str r1, [r0] + ldr r1, _081BD758 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD75C + str r1, [r0] +_081BD73E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BD744: .4byte 0x0202406e +_081BD748: .4byte 0x020244ec +_081BD74C: .4byte 0x02020630 +_081BD750: .4byte 0x020241e4 +_081BD754: .4byte sub_8039C00 + 1 +_081BD758: .4byte 0x03005d60 +_081BD75C: .4byte sub_81BB78C + 1 + 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, _081BD874 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _081BD7A2 + b _081BD8B6 +_081BD7A2: + ldr r0, _081BD878 + 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, _081BD87C + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, _081BD880 + 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, _081BD884 + 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, _081BD888 + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, _081BD88C + 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, _081BD890 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, _081BD894 + 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 + .align 2, 0 +_081BD874: .4byte 0x02024064 +_081BD878: .4byte 0x02023064 +_081BD87C: .4byte 0x02038432 +_081BD880: .4byte 0x02038408 +_081BD884: .4byte 0x02038404 +_081BD888: .4byte 0x0203841a +_081BD88C: .4byte 0x0203841c +_081BD890: .4byte 0x02038400 +_081BD894: .4byte 0x020244bc +_081BD898: + ldr r0, _081BD8BC + 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, _081BD8C0 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BD8C4 + str r1, [r0] +_081BD8B6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BD8BC: .4byte 0x020244d0 +_081BD8C0: .4byte 0x03005d60 +_081BD8C4: .4byte bx_move_anim_3 + 1 + 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, _081BD914 + ldr r6, _081BD918 + 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, _081BD91C + 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 + .align 2, 0 +_081BD914: .4byte 0x02023064 +_081BD918: .4byte 0x02024064 +_081BD91C: .4byte 0x020244d0 +_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, _081BD9F0 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, _081BD9F4 + 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, _081BD9F8 + ldr r2, [r0] + ldr r0, _081BD9FC + 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 + .align 2, 0 +_081BD9F0: .4byte 0x020383f8 +_081BD9F4: .4byte 0x020383fd +_081BD9F8: .4byte 0x020244d0 +_081BD9FC: .4byte 0x02024064 +_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, _081BDA84 + movs r1, 0 + strh r1, [r0] + ldr r0, _081BDA88 + strh r1, [r0] + ldr r4, _081BDA8C + ldrb r0, [r4] + lsls r0, 9 + ldr r1, _081BDA90 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, _081BDA94 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, _081BDA98 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BDA9C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BDA84: .4byte 0x02022e14 +_081BDA88: .4byte 0x02022e16 +_081BDA8C: .4byte 0x02024064 +_081BDA90: .4byte 0x02023066 +_081BDA94: .4byte 0x02022e2c +_081BDA98: .4byte 0x03005d60 +_081BDA9C: .4byte sub_81BB898 + 1 + 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, _081BDB58 + ldrb r4, [r6] + lsls r4, 9 + ldr r0, _081BDB5C + adds r4, r0 + movs r0, 0xF + bl sub_8130950 + bl sub_8130BA4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _081BDB60 + 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, _081BDB64 + 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, _081BDB64 + strb r0, [r4] + ldr r0, _081BDB68 + ldrb r1, [r0] + ldr r2, _081BDB6C + 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, _081BDB64 + 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 + .align 2, 0 +_081BDB58: .4byte 0x02024064 +_081BDB5C: .4byte 0x02023068 +_081BDB60: .4byte 0x0831c898 +_081BDB64: .4byte 0x0202420c +_081BDB68: .4byte 0x02024210 +_081BDB6C: .4byte 0x0832a328 + 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, _081BDBF4 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081BDBA2 + ldr r1, _081BDBF8 + 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, _081BDBFC + ldrb r0, [r0] + ldr r1, _081BDC00 + 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 + .align 2, 0 +_081BDBF4: .4byte 0x020244ec +_081BDBF8: .4byte 0x0202406e +_081BDBFC: .4byte 0x02024064 +_081BDC00: .4byte 0x0202449c + 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, _081BDC88 + ldr r0, _081BDC8C + 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, _081BDC90 + cmp r7, r0 + beq _081BDCA0 + ldr r6, _081BDC94 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, _081BDC98 + 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, _081BDC9C + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _081BDCCA + .align 2, 0 +_081BDC88: .4byte 0x02023064 +_081BDC8C: .4byte 0x02024064 +_081BDC90: .4byte 0x00007fff +_081BDC94: .4byte 0x0202406e +_081BDC98: .4byte 0x020244ec +_081BDC9C: .4byte 0x03005d70 +_081BDCA0: + ldr r1, _081BDCE8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081BDCEC + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, _081BDCF0 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_081BDCCA: + ldr r1, _081BDCF4 + ldr r0, _081BDCF8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BDCFC + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BDCE8: .4byte 0x0202406e +_081BDCEC: .4byte 0x020244ec +_081BDCF0: .4byte 0x03005d70 +_081BDCF4: .4byte 0x03005d60 +_081BDCF8: .4byte 0x02024064 +_081BDCFC: .4byte bx_t3_healthbar_update + 1 + thumb_func_end sub_81BDC10 + + thumb_func_start sub_81BDD00 +sub_81BDD00: @ 81BDD00 + push {r4-r7,lr} + ldr r5, _081BDD2C + ldr r6, _081BDD30 + 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, _081BDD34 + 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 + .align 2, 0 +_081BDD2C: .4byte 0x02023064 +_081BDD30: .4byte 0x02024064 +_081BDD34: .4byte 0x020244ec +_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, _081BDD8C + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081BDD90 + 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, _081BDD94 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BDD98 + str r1, [r0] +_081BDD84: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BDD8C: .4byte sub_81BB29C + 1 +_081BDD90: .4byte 0x03005e00 +_081BDD94: .4byte 0x03005d60 +_081BDD98: .4byte nullsub_21 + 1 + thumb_func_end sub_81BDD00 + + thumb_func_start sub_81BDD9C +sub_81BDD9C: @ 81BDD9C + push {r4,lr} + ldr r4, _081BDDF8 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081BDDF0 + ldr r0, _081BDDFC + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, _081BDE00 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, _081BDE04 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, _081BDE08 + 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, _081BDE0C + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BDE10 + str r1, [r0] +_081BDDF0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BDDF8: .4byte 0x02024064 +_081BDDFC: .4byte 0x03005d70 +_081BDE00: .4byte 0x0202406e +_081BDE04: .4byte 0x020244ec +_081BDE08: .4byte 0x020244d0 +_081BDE0C: .4byte 0x03005d60 +_081BDE10: .4byte sub_81BBC04 + 1 + thumb_func_end sub_81BDD9C + + thumb_func_start sub_81BDE14 +sub_81BDE14: @ 81BDE14 + push {r4,r5,lr} + ldr r5, _081BDE6C + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081BDE64 + ldr r4, _081BDE70 + 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, _081BDE74 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BDE78 + str r1, [r0] +_081BDE64: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BDE6C: .4byte 0x02024064 +_081BDE70: .4byte 0x02023064 +_081BDE74: .4byte 0x03005d60 +_081BDE78: .4byte sub_81BBC04 + 1 + 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, _081BDF00 + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_081BDF00: .4byte 0x02022d0c + thumb_func_end sub_81BDEE8 + + thumb_func_start sub_81BDF04 +sub_81BDF04: @ 81BDF04 + push {lr} + ldr r3, _081BDF30 + ldr r1, _081BDF34 + ldr r0, _081BDF38 + 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 + .align 2, 0 +_081BDF30: .4byte 0x02022d0c +_081BDF34: .4byte 0x02023064 +_081BDF38: .4byte 0x02024064 + thumb_func_end sub_81BDF04 + + thumb_func_start sub_81BDF3C +sub_81BDF3C: @ 81BDF3C + push {lr} + ldr r2, _081BDF50 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_081BDF50: .4byte 0x02022d0c + thumb_func_end sub_81BDF3C + + thumb_func_start sub_81BDF54 +sub_81BDF54: @ 81BDF54 + push {lr} + ldr r3, _081BDF78 + 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 + .align 2, 0 +_081BDF78: .4byte 0x02022d0c + thumb_func_end sub_81BDF54 + + thumb_func_start dp01t_29_3_blink +dp01t_29_3_blink: @ 81BDF7C + push {r4,lr} + ldr r3, _081BDFA4 + ldr r2, _081BDFA8 + ldr r4, _081BDFAC + 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 + .align 2, 0 +_081BDFA4: .4byte 0x02020630 +_081BDFA8: .4byte 0x020241e4 +_081BDFAC: .4byte 0x02024064 +_081BDFB0: + ldr r1, _081BDFE0 + 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, _081BDFE4 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BDFE8 + str r1, [r0] +_081BDFDA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BDFE0: .4byte 0x020244b9 +_081BDFE4: .4byte 0x03005d60 +_081BDFE8: .4byte bx_blink_t3 + 1 + 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, _081BE034 + 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, _081BE038 + 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 + .align 2, 0 +_081BE034: .4byte 0x02024064 +_081BE038: .4byte 0x02023064 + thumb_func_end sub_81BDFF8 + + thumb_func_start sub_81BE03C +sub_81BE03C: @ 81BE03C + push {r4,r5,lr} + ldr r4, _081BE070 + ldr r5, _081BE074 + 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 + .align 2, 0 +_081BE070: .4byte 0x02023064 +_081BE074: .4byte 0x02024064 +_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, _081BE0CC + ldr r0, _081BE0D0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081BE0D4 + 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 + .align 2, 0 +_081BE0CC: .4byte 0x0202406e +_081BE0D0: .4byte 0x02024064 +_081BE0D4: .4byte 0x020244ec + thumb_func_end sub_81BE098 + + thumb_func_start dp01t_2E_3_battle_intro +dp01t_2E_3_battle_intro: @ 81BE0D8 + push {lr} + ldr r1, _081BE100 + ldr r0, _081BE104 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, _081BE108 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_081BE100: .4byte 0x02023064 +_081BE104: .4byte 0x02024064 +_081BE108: .4byte 0x020243fc + thumb_func_end dp01t_2E_3_battle_intro + + thumb_func_start sub_81BE10C +sub_81BE10C: @ 81BE10C + push {r4-r6,lr} + ldr r6, _081BE1D4 + ldr r5, _081BE1D8 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081BE1DC + 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, _081BE1E0 + 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, _081BE1E4 + 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, _081BE1E8 + 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 obj_anim_image_start + ldr r0, _081BE1EC + bl gpu_pal_alloc_new + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _081BE1F0 + ldrh r1, [r2] + ldr r0, _081BE1F4 + cmp r1, r0 + bne _081BE1FC + ldr r0, _081BE1F8 + 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 + .align 2, 0 +_081BE1D4: .4byte 0x020241e4 +_081BE1D8: .4byte 0x02024064 +_081BE1DC: .4byte 0x02020630 +_081BE1E0: .4byte 0x0000ffd8 +_081BE1E4: .4byte sub_80A6EEC + 1 +_081BE1E8: .4byte sub_805CC00 + 1 +_081BE1EC: .4byte 0x0000d6f9 +_081BE1F0: .4byte 0x02038bce +_081BE1F4: .4byte 0x00000c03 +_081BE1F8: .4byte 0x08305d8c +_081BE1FC: + ldrh r0, [r2] + bl sub_8162AA0 + lsls r0, 24 + ldr r1, _081BE29C + 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, _081BE2A0 + ldr r1, _081BE2A4 + ldr r5, _081BE2A8 + 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, _081BE2AC + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, _081BE2B0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, _081BE2B4 + 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, _081BE2B8 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, _081BE2BC + 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, _081BE2C0 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BE2C4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BE29C: .4byte 0x0830593c +_081BE2A0: .4byte 0x02020630 +_081BE2A4: .4byte 0x020241e4 +_081BE2A8: .4byte 0x02024064 +_081BE2AC: .4byte sub_81BE2C8 + 1 +_081BE2B0: .4byte 0x03005e00 +_081BE2B4: .4byte 0x020244d0 +_081BE2B8: .4byte 0x020244b4 +_081BE2BC: .4byte sub_8073C30 + 1 +_081BE2C0: .4byte 0x03005d60 +_081BE2C4: .4byte nullsub_77 + 1 + 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, _081BE2F0 + 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 + .align 2, 0 +_081BE2F0: .4byte 0x03005e00 +_081BE2F4: + ldr r7, _081BE334 + 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, _081BE338 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081BE344 +_081BE314: + ldr r0, _081BE33C + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, _081BE340 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_81BD0E4 + b _081BE398 + .align 2, 0 +_081BE334: .4byte 0x02024064 +_081BE338: .4byte 0x02022fec +_081BE33C: .4byte 0x02023064 +_081BE340: .4byte 0x0202406e +_081BE344: + ldr r4, _081BE3BC + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, _081BE3C0 + 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, _081BE3C4 + 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, _081BE3C8 + ldr r2, _081BE3CC + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BE3D0 + 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 + .align 2, 0 +_081BE3BC: .4byte 0x02023064 +_081BE3C0: .4byte 0x0202406e +_081BE3C4: .4byte 0x020244ec +_081BE3C8: .4byte 0x03005d60 +_081BE3CC: .4byte 0x02024064 +_081BE3D0: .4byte sub_81BB02C + 1 + thumb_func_end sub_81BE2C8 + + thumb_func_start dp01t_30_3_80EB11C +dp01t_30_3_80EB11C: @ 81BE3D4 + push {r4-r6,lr} + ldr r1, _081BE3FC + ldr r0, _081BE400 + 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 + .align 2, 0 +_081BE3FC: .4byte 0x02023064 +_081BE400: .4byte 0x02024064 +_081BE404: + ldr r6, _081BE480 + ldr r0, [r6] + ldr r5, _081BE484 + 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, _081BE488 + 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, _081BE48C + 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, _081BE490 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, _081BE494 + str r0, [r1] +_081BE478: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BE480: .4byte 0x020244d0 +_081BE484: .4byte 0x02024064 +_081BE488: .4byte 0x02023068 +_081BE48C: .4byte 0x020244b4 +_081BE490: .4byte 0x03005d60 +_081BE494: .4byte sub_81BE498 + 1 + thumb_func_end dp01t_30_3_80EB11C + + thumb_func_start sub_81BE498 +sub_81BE498: @ 81BE498 + push {r4,lr} + ldr r4, _081BE4D8 + ldr r0, [r4] + ldr r3, _081BE4DC + 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 + .align 2, 0 +_081BE4D8: .4byte 0x020244d0 +_081BE4DC: .4byte 0x02024064 + thumb_func_end sub_81BE498 + + thumb_func_start sub_81BE4E0 +sub_81BE4E0: @ 81BE4E0 + push {lr} + ldr r0, _081BE51C + ldr r1, [r0] + ldr r0, _081BE520 + 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, _081BE524 + ldr r0, _081BE528 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _081BE52C + str r1, [r0] +_081BE512: + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .align 2, 0 +_081BE51C: .4byte 0x020244d0 +_081BE520: .4byte 0x02024064 +_081BE524: .4byte 0x03005e00 +_081BE528: .4byte 0x020244b4 +_081BE52C: .4byte sub_8073C30 + 1 + 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, _081BE58C + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _081BE582 + ldr r3, _081BE590 + ldr r0, _081BE594 + 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, _081BE598 + 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 + .align 2, 0 +_081BE58C: .4byte 0x02024064 +_081BE590: .4byte 0x02020630 +_081BE594: .4byte 0x020241e4 +_081BE598: .4byte 0x02023064 + thumb_func_end sub_81BE53C + + thumb_func_start sub_81BE59C +sub_81BE59C: @ 81BE59C + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _081BE5E0 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081BE5F4 + ldr r5, _081BE5E4 + 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 + .align 2, 0 +_081BE5E0: .4byte 0x02024064 +_081BE5E4: .4byte 0x02023064 +_081BE5E8: + ldr r0, _081BE5FC + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, _081BE600 + str r0, [r1] +_081BE5F4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BE5FC: .4byte 0x03005d60 +_081BE600: .4byte bx_80E8A6C + 1 + 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, _081BE654 + ldr r1, _081BE658 + ldr r4, _081BE65C + 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, _081BE660 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, _081BE664 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BE654: .4byte 0x0202433a +_081BE658: .4byte 0x02023064 +_081BE65C: .4byte 0x02024064 +_081BE660: .4byte 0x03005d60 +_081BE664: .4byte sub_80587B0 + 1 + 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, _081BE68C + 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 flag_check + lsls r0, 24 + lsrs r0, 24 + b _081BE692 + .align 2, 0 +_081BE68C: .4byte 0x03005d8c +_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, _081BE6A8 + ldr r0, [r0] + adds r0, 0x4 + bl sub_8151E50 + pop {r0} + bx r0 + .align 2, 0 +_081BE6A8: .4byte 0x0203cf18 + thumb_func_end sub_81BE698 + + thumb_func_start sub_81BE6AC +sub_81BE6AC: @ 81BE6AC + ldr r1, _081BE6B4 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_081BE6B4: .4byte 0x0203cf18 + thumb_func_end sub_81BE6AC + + thumb_func_start sub_81BE6B8 +sub_81BE6B8: @ 81BE6B8 + push {r4,lr} + ldr r4, _081BE6C8 + ldr r0, [r4] + cmp r0, 0 + beq _081BE6CC + movs r0, 0 + str r0, [r4] + b _081BE718 + .align 2, 0 +_081BE6C8: .4byte 0x0203cf18 +_081BE6CC: + ldr r0, _081BE720 + 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 flag_check + lsls r0, 24 + cmp r0, 0 + beq _081BE718 + movs r0, 0xC8 + bl malloc_and_clear + str r0, [r4] + adds r0, 0x4 + bl sub_8151B3C + ldr r0, [r4] + adds r0, 0x4 + ldr r1, _081BE724 + bl sub_8151B68 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8151CA8 + ldr r0, _081BE728 + movs r1, 0xFF + bl AddTask + ldr r1, [r4] + strb r0, [r1] +_081BE718: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BE720: .4byte 0x03005d8c +_081BE724: .4byte 0x08617e18 +_081BE728: .4byte sub_81BE698 + 1 + thumb_func_end sub_81BE6B8 + + thumb_func_start sub_81BE72C +sub_81BE72C: @ 81BE72C + push {r4,lr} + ldr r0, _081BE790 + 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 flag_check + lsls r0, 24 + cmp r0, 0 + beq _081BE788 + ldr r4, _081BE794 + ldr r0, [r4] + cmp r0, 0 + beq _081BE788 + ldr r0, _081BE798 + 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 + .align 2, 0 +_081BE790: .4byte 0x03005d8c +_081BE794: .4byte 0x0203cf18 +_081BE798: .4byte sub_81BE698 + 1 + thumb_func_end sub_81BE72C + + thumb_func_start sub_81BE79C +sub_81BE79C: @ 81BE79C + push {r4,lr} + ldr r0, _081BE7B4 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _081BE7B8 + movs r0, 0xA7 + lsls r0, 1 + bl flag_clear + b _081BE7EE + .align 2, 0 +_081BE7B4: .4byte 0x000040cb +_081BE7B8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + ands r4, r0 + movs r0, 0x9D + bl flag_check + 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 flag_set + bl sub_81BE6B8 + b _081BE7EE +_081BE7E6: + movs r0, 0xA7 + lsls r0, 1 + bl flag_clear +_081BE7EE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81BE79C + + thumb_func_start sub_81BE7F4 +sub_81BE7F4: @ 81BE7F4 + push {lr} + ldr r0, _081BE804 + movs r1, 0x8 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081BE804: .4byte sub_81BE808 + 1 + 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, _081BE88C + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x2D + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + mov r0, sp + ldrb r0, [r0] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r4, _081BE890 + adds r2, r4 + ldr r3, _081BE894 + 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, _081BE898 + 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 + .align 2, 0 +_081BE88C: .4byte 0x03005d8c +_081BE890: .4byte 0x02037350 +_081BE894: .4byte 0x02020630 +_081BE898: .4byte 0x02037590 + 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, _081BE8F8 + movs r1, 0x9 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081BE8FC + 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 sub_808A2C0 + movs r0, 0xD6 + bl audio_play + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BE8F8: .4byte sub_81BE900 + 1 +_081BE8FC: .4byte 0x03005e00 + 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, _081BE964 + 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 sub_808A2CC + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081BE95C + bl sub_81BE968 + adds r0, r5, 0 + bl remove_task + bl sub_808A2E4 +_081BE95C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BE964: .4byte 0x03005e08 + thumb_func_end sub_81BE900 + + thumb_func_start sub_81BE968 +sub_81BE968: @ 81BE968 + push {lr} + ldr r0, _081BE98C + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081BE988 + ldr r0, _081BE990 + 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 + .align 2, 0 +_081BE98C: .4byte sub_81BE9C0 + 1 +_081BE990: .4byte 0x03005e00 + thumb_func_end sub_81BE968 + + thumb_func_start sub_81BE994 +sub_81BE994: @ 81BE994 + push {lr} + ldr r0, _081BE9B8 + bl gpu_tile_obj_alloc_and_load_multiple + bl sub_81BEA20 + ldr r0, _081BE9BC + 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 + .align 2, 0 +_081BE9B8: .4byte 0x08617d94 +_081BE9BC: .4byte sub_81BE9C0 + 1 + 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, _081BE9F8 + 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, _081BE9FC + str r1, [r0] +_081BE9F0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BE9F8: .4byte 0x03005e08 +_081BE9FC: .4byte sub_81BEA00 + 1 + 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 gpu_tile_obj_free_by_tag + 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, _081BEAC8 + adds r7, r5, 0x2 + ldr r6, _081BEACC +_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, _081BEAD0 + movs r3, 0x8 + bl obj_add_from_template_forward_search + 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, _081BEAC8 + adds r7, r5, 0x2 + ldr r6, _081BEACC +_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, _081BEAD4 + movs r3, 0x8 + bl obj_add_from_template_forward_search + 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 + .align 2, 0 +_081BEAC8: .4byte 0x08617d64 +_081BEACC: .4byte 0x02020630 +_081BEAD0: .4byte 0x08617e60 +_081BEAD4: .4byte 0x08617e34 + 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, _081BEB20 + 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 obj_delete_and_free_tiles + bl sub_81BE968 +_081BEB1A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BEB20: .4byte 0x08617d64 + thumb_func_end sub_81BEAD8 + + thumb_func_start sub_81BEB24 +sub_81BEB24: @ 81BEB24 + push {r4,r5,lr} + movs r4, 0 + ldr r5, _081BEB50 +_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 setmaptile_0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081BEB2A + bl cur_mapdata_full_redraw + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BEB50: .4byte 0x08617da4 + thumb_func_end sub_81BEB24 + + thumb_func_start sub_81BEB54 +sub_81BEB54: @ 81BEB54 + push {lr} + ldr r0, _081BEB64 + movs r1, 0x9 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081BEB64: .4byte sub_81BED50 + 1 + thumb_func_end sub_81BEB54 + + thumb_func_start sub_81BEB68 +sub_81BEB68: @ 81BEB68 + push {lr} + ldr r0, _081BEB78 + movs r1, 0x9 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081BEB78: .4byte sub_81BEBF4 + 1 + thumb_func_end sub_81BEB68 + + thumb_func_start sub_81BEB7C +sub_81BEB7C: @ 81BEB7C + push {lr} + ldr r0, _081BEB8C + movs r1, 0x9 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081BEB8C: .4byte sub_81BF028 + 1 + thumb_func_end sub_81BEB7C + + thumb_func_start sub_81BEB90 +sub_81BEB90: @ 81BEB90 + push {r4,lr} + ldr r4, _081BEBB0 + ldr r0, [r4] + ldrh r1, [r0] + movs r0, 0x10 + bl lcd_io_set + ldr r0, [r4] + ldrh r1, [r0, 0x2] + movs r0, 0x12 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BEBB0: .4byte 0x0203cf14 + thumb_func_end sub_81BEB90 + + thumb_func_start sub_81BEBB4 +sub_81BEBB4: @ 81BEBB4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081BEBE4 + 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, _081BEBE8 + ldr r1, [r0] + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] + movs r0, 0x2 + strh r0, [r2, 0x8] + bl sub_81BEB90 + b _081BEBF0 + .align 2, 0 +_081BEBE4: .4byte 0x03005e00 +_081BEBE8: .4byte 0x0203cf14 +_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, _081BEC1C + 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, _081BEC20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BEC1C: .4byte 0x03005e00 +_081BEC20: .4byte _081BEC24 + .align 2, 0 +_081BEC24: + .4byte _081BEC40 + .4byte _081BEC50 + .4byte _081BEC88 + .4byte _081BECB0 + .4byte _081BECF8 + .4byte _081BED00 + .4byte _081BED1C +_081BEC40: + bl Window_FreeMemory + movs r0, 0 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + b _081BED04 +_081BEC50: + ldr r4, _081BEC80 + movs r0, 0x92 + lsls r0, 4 + bl malloc_and_clear + str r0, [r4] + ldr r4, _081BEC84 + movs r0, 0x80 + lsls r0, 4 + bl malloc_and_clear + str r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + b _081BECD8 + .align 2, 0 +_081BEC80: .4byte 0x0203cf04 +_081BEC84: .4byte 0x0203cf08 +_081BEC88: + ldr r0, _081BECA8 + ldr r4, _081BECAC + 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 gpu_copy_bg_tile_pattern_data_to_vram + b _081BECD8 + .align 2, 0 +_081BECA8: .4byte 0x08617274 +_081BECAC: .4byte 0x0203cf04 +_081BECB0: + ldr r0, _081BECEC + ldr r1, [r0] + movs r0, 0 + bl bg_set_tilemap + ldr r1, _081BECF0 + 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 bg_copy_tilemap_rect_simple + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram +_081BECD8: + ldr r1, _081BECF4 + 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 + .align 2, 0 +_081BECEC: .4byte 0x0203cf08 +_081BECF0: .4byte 0x08617b94 +_081BECF4: .4byte 0x03005e00 +_081BECF8: + movs r0, 0 + bl gpu_sync_bg_show + b _081BED04 +_081BED00: + bl sub_81BEB24 +_081BED04: + ldr r0, _081BED18 + 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 + .align 2, 0 +_081BED18: .4byte 0x03005e00 +_081BED1C: + ldr r4, _081BED48 + movs r0, 0x4 + bl malloc + str r0, [r4] + movs r2, 0 + movs r1, 0x2 + strh r1, [r0] + strh r2, [r0, 0x2] + ldr r0, _081BED4C + 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 + .align 2, 0 +_081BED48: .4byte 0x0203cf14 +_081BED4C: .4byte sub_81BEBB4 + 1 + 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, _081BED88 + 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, _081BED8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BED88: .4byte 0x03005e00 +_081BED8C: .4byte _081BED90 + .align 2, 0 +_081BED90: + .4byte _081BEDB0 + .4byte _081BF002 + .4byte _081BEDC4 + .4byte _081BEF64 + .4byte _081BEF94 + .4byte _081BEFD0 + .4byte _081BEFF0 + .4byte _081BEFF8 +_081BEDB0: + ldr r4, _081BEDC0 + movs r0, 0xC0 + lsls r0, 2 + bl malloc_and_clear + str r0, [r4] + b _081BF002 + .align 2, 0 +_081BEDC0: .4byte 0x0203cf10 +_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 malloc + ldr r3, _081BEF54 + 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, _081BEF54 + 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, _081BEF58 + 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, _081BEF5C + ldr r0, [r0] + ldr r7, _081BEF54 + 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, _081BEF58 + 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, _081BEF60 + 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, _081BEF5C + ldr r1, [r0] + movs r2, 0x92 + lsls r2, 4 + movs r0, 0 + movs r3, 0 + bl gpu_copy_bg_tile_pattern_data_to_vram + ldr r0, _081BEF54 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0, 0x4] + cmp r0, 0x2F + bhi _081BF002 + b _081BF014 + .align 2, 0 +_081BEF54: .4byte 0x0203cf10 +_081BEF58: .4byte 0x03005e00 +_081BEF5C: .4byte 0x0203cf04 +_081BEF60: .4byte 0x0203cf14 +_081BEF64: + movs r0, 0 + bl bg_unset_tilemap + ldr r0, _081BEF8C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081BEF7C + bl remove_task +_081BEF7C: + ldr r0, _081BEF90 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + strh r0, [r1, 0x2] + bl sub_81BEB90 + b _081BF002 + .align 2, 0 +_081BEF8C: .4byte sub_81BEBB4 + 1 +_081BEF90: .4byte 0x0203cf14 +_081BEF94: + ldr r4, _081BEFC0 + ldr r0, [r4] + bl free + movs r5, 0 + str r5, [r4] + ldr r4, _081BEFC4 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _081BEFC8 + ldr r0, [r4] + bl free + str r5, [r4] + ldr r4, _081BEFCC + ldr r0, [r4] + bl free + str r5, [r4] + b _081BF002 + .align 2, 0 +_081BEFC0: .4byte 0x0203cf14 +_081BEFC4: .4byte 0x0203cf10 +_081BEFC8: .4byte 0x0203cf04 +_081BEFCC: .4byte 0x0203cf08 +_081BEFD0: + movs r0, 0xC + movs r1, 0x2 + bl lcd_io_set_bits + movs r0, 0x8 + movs r1, 0 + bl lcd_io_set_bits + movs r0, 0 + movs r1, 0x7 + movs r2, 0 + bl gpu_bg_config_set_field + bl sub_81971D0 + b _081BF002 +_081BEFF0: + movs r0, 0 + bl gpu_sync_bg_show + b _081BF002 +_081BEFF8: + mov r0, r10 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_081BF002: + ldr r0, _081BF024 + 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 + .align 2, 0 +_081BF024: .4byte 0x03005e00 + 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, _081BF058 + 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, _081BF05C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BF058: .4byte 0x03005e00 +_081BF05C: .4byte _081BF060 + .align 2, 0 +_081BF060: + .4byte _081BF080 + .4byte _081BF0B4 + .4byte _081BF0DC + .4byte _081BF0F0 + .4byte _081BF148 + .4byte _081BF170 + .4byte _081BF1CC + .4byte _081BF224 +_081BF080: + ldr r4, _081BF0B0 + movs r0, 0x14 + bl malloc_and_clear + str r0, [r4] + movs r0, 0x80 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1] + movs r0, 0x8 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl malloc_and_clear + ldr r1, [r4] + str r0, [r1, 0xC] + movs r0, 0 + strh r0, [r1, 0x10] + b _081BF228 + .align 2, 0 +_081BF0B0: .4byte 0x0203cf0c +_081BF0B4: + ldr r0, _081BF0D4 + ldr r0, [r0] + ldr r1, [r0] + movs r5, 0 + ldr r2, _081BF0D8 +_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 + .align 2, 0 +_081BF0D4: .4byte 0x0203cf0c +_081BF0D8: .4byte 0x08617c44 +_081BF0DC: + ldr r0, _081BF0EC + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r1] + movs r0, 0x80 + strh r0, [r1, 0x4] + b _081BF228 + .align 2, 0 +_081BF0EC: .4byte 0x0203cf0c +_081BF0F0: + mov r1, sp + ldr r0, _081BF164 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r4, _081BF168 + 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 obj_add_from_template_forward_search + ldr r1, [r4] + movs r3, 0 + strb r0, [r1, 0x8] + ldr r2, _081BF16C + 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, _081BF168 +_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 + .align 2, 0 +_081BF164: .4byte 0x08617e00 +_081BF168: .4byte 0x0203cf0c +_081BF16C: .4byte 0x02020630 +_081BF170: + movs r5, 0 + movs r6, 0xFF + ldr r0, _081BF1BC + mov r8, r0 +_081BF178: + bl GenerateRandomNumber + adds r4, r6, 0 + ands r4, r0 + bl GenerateRandomNumber + adds r1, r6, 0 + ands r1, r0 + ldr r0, _081BF1C0 + 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, _081BF1C4 + ldrb r1, [r3, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _081BF1C8 + str r1, [r0] + b _081BF228 + .align 2, 0 +_081BF1BC: .4byte 0x000001ff +_081BF1C0: .4byte 0x0203cf0c +_081BF1C4: .4byte 0x02020630 +_081BF1C8: .4byte sub_81BF248 + 1 +_081BF1CC: + ldr r3, _081BF218 + ldr r5, _081BF21C + 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, _081BF220 + cmp r1, r0 + bne _081BF238 + adds r0, r2, r3 + bl obj_delete_and_free_tiles + 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 + .align 2, 0 +_081BF218: .4byte 0x02020630 +_081BF21C: .4byte 0x0203cf0c +_081BF220: .4byte nullsub_12 + 1 +_081BF224: + bl script_env_2_enable_and_set_ctx_running +_081BF228: + ldr r0, _081BF244 + 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 + .align 2, 0 +_081BF244: .4byte 0x03005e00 + 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, _081BF260 + ldr r0, [r0] + ldrh r0, [r0, 0x10] + cmp r0, 0xFF + bls _081BF268 + ldr r0, _081BF264 + str r0, [r5, 0x1C] + b _081BF2B0 + .align 2, 0 +_081BF260: .4byte 0x0203cf0c +_081BF264: .4byte nullsub_12 + 1 +_081BF268: + ldrh r1, [r5, 0x22] + movs r2, 0x22 + ldrsh r0, [r5, r2] + cmp r0, 0x5F + ble _081BF2AC + movs r4, 0 +_081BF274: + ldr r0, _081BF2A8 + 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 obj_anim_image_start + b _081BF2B0 + .align 2, 0 +_081BF2A8: .4byte 0x0203cf0c +_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, _081BF380 + 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 + .align 2, 0 +_081BF380: .4byte 0x030012a8 + thumb_func_end sub_81BF2B8 + + thumb_func_start sub_81BF384 +sub_81BF384: @ 81BF384 + push {r4,lr} + ldr r0, _081BF3D0 + bl disable_irqs + movs r0, 0x1 + bl enable_irqs + bl SoundVSyncOff_rev01 + movs r0, 0 + bl SetVBlankCallback + bl reset_all_obj_data + bl clear_tasks + bl remove_some_task + movs r0, 0 + movs r1, 0 + bl lcd_io_set + ldr r4, _081BF3D4 + movs r0, 0x50 + bl malloc_and_clear + str r0, [r4] + movs r1, 0 + strb r1, [r0] + ldr r1, [r4] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r0, _081BF3D8 + bl set_callback2 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BF3D0: .4byte 0x0000ffff +_081BF3D4: .4byte 0x030012b8 +_081BF3D8: .4byte sub_81BF3DC + 1 + thumb_func_end sub_81BF384 + + thumb_func_start sub_81BF3DC +sub_81BF3DC: @ 81BF3DC + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _081BF3F8 + ldr r0, [r1] + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x7 + bls _081BF3EE + b _081BF592 +_081BF3EE: + lsls r0, 2 + ldr r1, _081BF3FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BF3F8: .4byte 0x030012b8 +_081BF3FC: .4byte _081BF400 + .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, _081BF42C + ldr r1, [r0] + movs r0, 0x1 + b _081BF590 + .align 2, 0 +_081BF42C: .4byte 0x030012b8 +_081BF430: + movs r0, 0x5 + bl sub_81BF7A4 + cmp r0, 0x5 + beq _081BF43C + b _081BF592 +_081BF43C: + ldr r0, _081BF454 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BF44A + b _081BF592 +_081BF44A: + ldr r0, _081BF458 + ldr r1, [r0] + movs r0, 0x2 + b _081BF590 + .align 2, 0 +_081BF454: .4byte 0x030022c0 +_081BF458: .4byte 0x030012b8 +_081BF45C: + movs r0, 0 + bl sub_81BF7A4 + cmp r0, 0 + beq _081BF468 + b _081BF592 +_081BF468: + ldr r0, _081BF480 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BF476 + b _081BF592 +_081BF476: + ldr r0, _081BF484 + ldr r1, [r0] + movs r0, 0x3 + b _081BF590 + .align 2, 0 +_081BF480: .4byte 0x030022c0 +_081BF484: .4byte 0x030012b8 +_081BF488: + movs r0, 0x1 + bl sub_81BF7A4 + cmp r0, 0x1 + beq _081BF494 + b _081BF592 +_081BF494: + ldr r4, _081BF4B4 + ldr r0, [r4] + ldr r1, _081BF4B8 + str r1, [r0, 0x2C] + adds r0, 0x4F + movs r5, 0 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x4 + bl sub_81BA6D0 + ldr r1, [r4] + strh r5, [r1, 0x2] + movs r0, 0x4 + b _081BF590 + .align 2, 0 +_081BF4B4: .4byte 0x030012b8 +_081BF4B8: .4byte 0x089a6550 +_081BF4BC: + adds r4, r5, 0 + ldr r0, [r4] + adds r0, 0x4 + bl sub_81BA70C + ldr r4, [r4] + ldrb r0, [r4, 0x1C] + cmp r0, 0 + bne _081BF4D8 + ldr r0, [r4, 0x20] + ldr r1, _081BF4E0 + ands r0, r1 + cmp r0, r1 + beq _081BF4E4 +_081BF4D8: + movs r0, 0 + strh r0, [r4, 0x2] + b _081BF592 + .align 2, 0 +_081BF4E0: .4byte 0x00020200 +_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, _081BF50C + ldr r2, _081BF510 + subs r2, r1 + movs r3, 0x1 + str r3, [sp] + movs r3, 0x4 + bl sub_81BAB6C + ldr r1, [r5] + movs r0, 0x5 + b _081BF590 + .align 2, 0 +_081BF50C: .4byte 0x089a6610 +_081BF510: .4byte 0x089aa144 +_081BF514: + movs r0, 0x2 + bl sub_81BF7A4 + adds r4, r0, 0 + cmp r4, 0x2 + bne _081BF592 + ldr r5, _081BF53C + ldr r0, [r5] + adds r0, 0x4 + bl sub_81BA70C + ldr r0, [r5] + adds r0, 0x4 + bl sub_81BAC30 + cmp r0, 0 + beq _081BF540 + ldr r1, [r5] + movs r0, 0x6 + b _081BF590 + .align 2, 0 +_081BF53C: .4byte 0x030012b8 +_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, _081BF570 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BF592 + bl do_reset + b _081BF592 + .align 2, 0 +_081BF570: .4byte 0x030022c0 +_081BF574: + movs r0, 0x4 + bl sub_81BF7A4 + cmp r0, 0x4 + bne _081BF592 + ldr r0, _081BF59C + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BF592 + ldr r0, _081BF5A0 + ldr r1, [r0] + movs r0, 0x1 +_081BF590: + strb r0, [r1] +_081BF592: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081BF59C: .4byte 0x030022c0 +_081BF5A0: .4byte 0x030012b8 + 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 lcd_io_set + movs r0, 0xA + movs r1, 0 + bl lcd_io_set + movs r0, 0x10 + movs r1, 0 + bl lcd_io_set + movs r0, 0x12 + movs r1, 0 + bl lcd_io_set + movs r0, 0x14 + movs r1, 0 + bl lcd_io_set + movs r0, 0x16 + movs r1, 0 + bl lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r1, 0 + str r1, [sp, 0xC] + ldr r4, _081BF770 + add r0, sp, 0xC + str r0, [r4] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r4, 0x4] + ldr r0, _081BF774 + 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, _081BF778 + 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 gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081BF77C + movs r0, 0 + movs r2, 0x2 + bl bg_vram_setup + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, _081BF780 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + ldr r0, _081BF784 + str r0, [r4] + ldr r0, _081BF788 + str r0, [r4, 0x4] + ldr r0, _081BF78C + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + movs r0, 0 + movs r1, 0x40 + bl lcd_io_set + movs r0, 0x2 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x3 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0 + movs r1, 0xAA + bl Window_FastFillPixels + ldr r5, _081BF790 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl font_get_width_of_string + 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, _081BF794 + 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, _081BF798 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl font_get_width_of_string + 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 font_get_width_of_string + 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, _081BF79C + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl font_get_width_of_string + 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, _081BF7A0 + 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 Window_CopyToVram + movs r0, 0x3 + movs r1, 0x2 + bl Window_CopyToVram + movs r0, 0 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BF770: .4byte 0x040000d4 +_081BF774: .4byte 0x85006000 +_081BF778: .4byte 0x85000100 +_081BF77C: .4byte 0x08618108 +_081BF780: .4byte 0x08618110 +_081BF784: .4byte 0x08618138 +_081BF788: .4byte 0x050001e0 +_081BF78C: .4byte 0x84000008 +_081BF790: .4byte 0x08617e9b +_081BF794: .4byte 0x0861815b +_081BF798: .4byte 0x08617e8d +_081BF79C: .4byte 0x08617e78 +_081BF7A0: .4byte 0x08618158 + thumb_func_end sub_81BF5A4 + + thumb_func_start sub_81BF7A4 +sub_81BF7A4: @ 81BF7A4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _081BF7B8 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + cmp r0, r4 + bne _081BF7BC + adds r0, r4, 0 + b _081BF7DC + .align 2, 0 +_081BF7B8: .4byte 0x030012b8 +_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, _081BF7E4 + ldr r0, [r0] + ldrb r0, [r0, 0x1] +_081BF7DC: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081BF7E4: .4byte 0x030012b8 + 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 bg_fill_tilemap_rect + movs r0, 0x1 + movs r1, 0xAA + bl Window_FastFillPixels + ldr r0, _081BF844 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, _081BF848 + 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 Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0x2 + bl Window_CopyToVram + cmp r6, 0x5 + bhi _081BF87E + ldr r0, _081BF84C + adds r0, r4, r0 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BF844: .4byte 0x08618158 +_081BF848: .4byte 0x08618160 +_081BF84C: .4byte _081BF850 + .align 2, 0 +_081BF850: + .4byte _081BF868 + .4byte _081BF870 + .4byte _081BF868 + .4byte _081BF868 + .4byte _081BF868 + .4byte _081BF878 +_081BF868: + movs r0, 0x2 + bl Window_WriteStandardTileMap + b _081BF87E +_081BF870: + movs r0, 0x3 + bl Window_WriteStandardTileMap + b _081BF87E +_081BF878: + movs r0, 0 + bl Window_WriteStandardTileMap +_081BF87E: + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r5, _081BF8C8 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 2 + adds r0, r4, r5 + ldr r0, [r0] + ldr r1, _081BF8CC + bl LZ77UnCompVram + adds r0, r5, 0x4 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, _081BF8D0 + bl LZ77UnCompVram + adds r5, 0x8 + adds r4, r5 + ldr r0, [r4] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _081BF8D4 + bl CpuSet + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BF8C8: .4byte 0x08618178 +_081BF8CC: .4byte 0x06004000 +_081BF8D0: .4byte 0x0600f800 +_081BF8D4: .4byte 0x04000040 + thumb_func_end sub_81BF7E8 + + thumb_func_start sub_81BF8D8 +sub_81BF8D8: @ 81BF8D8 + push {lr} + movs r0, 0 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl gpu_sync_bg_hide + 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, _081BF93C + ldr r0, _081BF940 + bl malloc_and_clear + str r0, [r4] + ldr r1, _081BF944 + 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, _081BF948 + 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 + .align 2, 0 +_081BF93C: .4byte 0x0203cf1c +_081BF940: .4byte 0x000040f8 +_081BF944: .4byte 0x000040bc +_081BF948: .4byte 0x000040bf +_081BF94C: + ldr r0, _081BF964 + 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, _081BF968 + b _081BF9EE + .align 2, 0 +_081BF964: .4byte 0x000040bd +_081BF968: .4byte 0x0203cf1c +_081BF96C: + cmp r7, 0x2 + beq _081BF97C + cmp r7, 0x3 + beq _081BF9D0 + ldr r2, _081BF978 + b _081BF9EE + .align 2, 0 +_081BF978: .4byte 0x0203cf1c +_081BF97C: + ldr r2, _081BF994 + ldr r0, [r2] + ldr r1, _081BF998 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _081BF99C + adds r0, r1 + movs r1, 0x3 + b _081BF9EC + .align 2, 0 +_081BF994: .4byte 0x0203cf1c +_081BF998: .4byte 0x000040c1 +_081BF99C: .4byte 0x000040c2 +_081BF9A0: + ldr r2, _081BF9C0 + ldr r0, [r2] + ldr r1, _081BF9C4 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _081BF9C8 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _081BF9CC + adds r0, r1 + strb r7, [r0] + b _081BF9EE + .align 2, 0 +_081BF9C0: .4byte 0x0203cf1c +_081BF9C4: .4byte 0x000040c1 +_081BF9C8: .4byte 0x000040c2 +_081BF9CC: .4byte 0x000040c8 +_081BF9D0: + ldr r2, _081BFA24 + ldr r0, [r2] + ldr r1, _081BFA28 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _081BFA2C + 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, _081BFA28 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + strb r1, [r0] + movs r0, 0xFF + bl sub_81C488C + ldr r0, _081BFA30 + ldr r0, [r0] + cmp r0, 0 + bne _081BFA12 + movs r0, 0 + movs r1, 0 + bl sub_806F2AC +_081BFA12: + ldr r0, _081BFA34 + bl set_callback2 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081BFA24: .4byte 0x0203cf1c +_081BFA28: .4byte 0x000040c1 +_081BFA2C: .4byte 0x000040c2 +_081BFA30: .4byte 0x020244d4 +_081BFA34: .4byte sub_81BFAE4 + 1 + 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, _081BFA78 + ldr r0, [r0] + ldr r1, _081BFA7C + adds r0, r1 + strh r6, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081BFA78: .4byte 0x0203cf1c +_081BFA7C: .4byte 0x000040c4 + 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, _081BFAAC + ldr r0, [r0] + ldr r1, _081BFAB0 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BFAAC: .4byte 0x0203cf1c +_081BFAB0: .4byte 0x000040ef + thumb_func_end sub_81BFA80 + + thumb_func_start sub_81BFAB4 +sub_81BFAB4: @ 81BFAB4 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _081BFB30 + 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, _081BFB34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BFB30: .4byte 0x030022c0 +_081BFB34: .4byte _081BFB38 + .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 vblank_hblank_handler_set_zero + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + b _081BFDE6 +_081BFBAA: + bl remove_some_task + ldr r1, _081BFBB8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFBB8: .4byte 0x030022c0 +_081BFBBC: + bl sub_80A1A74 + ldr r2, _081BFBCC + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _081BFDE4 + .align 2, 0 +_081BFBCC: .4byte 0x02037fd4 +_081BFBD0: + bl reset_all_obj_data + ldr r1, _081BFBE0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFBE0: .4byte 0x030022c0 +_081BFBE4: + bl gpu_pal_allocator_reset + b _081BFDE6 +_081BFBEA: + bl sub_81BFE24 + ldr r0, _081BFBFC + ldr r0, [r0] + ldr r1, _081BFC00 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .align 2, 0 +_081BFBFC: .4byte 0x0203cf1c +_081BFC00: .4byte 0x000040f0 +_081BFC04: + bl sub_81BFEB0 + lsls r0, 24 + cmp r0, 0 + bne _081BFC10 + b _081BFE18 +_081BFC10: + ldr r1, _081BFC1C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFC1C: .4byte 0x030022c0 +_081BFC20: + bl sub_81C2554 + b _081BFDE6 +_081BFC26: + bl sub_81C1BA0 + ldr r1, _081BFC34 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFC34: .4byte 0x030022c0 +_081BFC38: + ldr r4, _081BFC50 + ldr r0, [r4] + adds r0, 0xC + bl sub_81C0098 + ldr r0, [r4] + ldr r1, _081BFC54 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .align 2, 0 +_081BFC50: .4byte 0x0203cf1c +_081BFC54: .4byte 0x000040f0 +_081BFC58: + ldr r0, _081BFC74 + ldr r0, [r0] + adds r0, 0xC + bl sub_81C00F0 + lsls r0, 24 + cmp r0, 0 + bne _081BFC6A + b _081BFE18 +_081BFC6A: + ldr r1, _081BFC78 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFC74: .4byte 0x0203cf1c +_081BFC78: .4byte 0x030022c0 +_081BFC7C: + bl sub_81C25E8 + b _081BFDE6 +_081BFC82: + bl sub_81C286C + ldr r1, _081BFC90 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFC90: .4byte 0x030022c0 +_081BFC94: + ldr r0, _081BFCA4 + ldr r0, [r0] + ldr r1, _081BFCA8 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2D9C + b _081BFDE6 + .align 2, 0 +_081BFCA4: .4byte 0x0203cf1c +_081BFCA8: .4byte 0x000040c0 +_081BFCAC: + bl sub_81C0348 + ldr r1, _081BFCBC + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFCBC: .4byte 0x030022c0 +_081BFCC0: + ldr r0, _081BFCD0 + ldr r0, [r0] + ldr r1, _081BFCD4 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2AFC + b _081BFDE6 + .align 2, 0 +_081BFCD0: .4byte 0x0203cf1c +_081BFCD4: .4byte 0x000040c0 +_081BFCD8: + bl sub_81C4190 + bl sub_81C42C8 + ldr r0, _081BFCF0 + ldr r0, [r0] + ldr r1, _081BFCF4 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .align 2, 0 +_081BFCF0: .4byte 0x0203cf1c +_081BFCF4: .4byte 0x000040f0 +_081BFCF8: + ldr r4, _081BFD28 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC + ldr r2, _081BFD2C + adds r1, r2 + bl sub_81C45F4 + ldr r1, [r4] + ldr r2, _081BFD30 + 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, _081BFD2C + adds r1, r0 + movs r0, 0 + strh r0, [r1] + b _081BFDE6 + .align 2, 0 +_081BFD28: .4byte 0x0203cf1c +_081BFD2C: .4byte 0x000040f0 +_081BFD30: .4byte 0x000040d3 +_081BFD34: + ldr r0, _081BFD48 + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4984 + ldr r1, _081BFD4C + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFD48: .4byte 0x0203cf1c +_081BFD4C: .4byte 0x030022c0 +_081BFD50: + ldr r0, _081BFD5C + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4A08 + b _081BFDE6 + .align 2, 0 +_081BFD5C: .4byte 0x0203cf1c +_081BFD60: + bl sub_81C4A88 + ldr r1, _081BFD70 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFD70: .4byte 0x030022c0 +_081BFD74: + bl sub_81C4280 + b _081BFDE6 +_081BFD7A: + ldr r0, _081BFD94 + ldr r0, [r0] + ldr r1, _081BFD98 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _081BFDA0 + ldr r0, _081BFD9C + movs r1, 0 + bl AddTask + b _081BFDE6 + .align 2, 0 +_081BFD94: .4byte 0x0203cf1c +_081BFD98: .4byte 0x000040bc +_081BFD9C: .4byte sub_81C0510 + 1 +_081BFDA0: + ldr r0, _081BFDAC + movs r1, 0 + bl AddTask + b _081BFDE6 + .align 2, 0 +_081BFDAC: .4byte sub_81C171C + 1 +_081BFDB0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, _081BFDC8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .align 2, 0 +_081BFDC8: .4byte 0x030022c0 +_081BFDCC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl sub_80A1AD4 + ldr r2, _081BFDF8 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_081BFDE4: + strb r0, [r2, 0x8] +_081BFDE6: + ldr r1, _081BFDFC + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081BFDEE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081BFE18 + .align 2, 0 +_081BFDF8: .4byte 0x02037fd4 +_081BFDFC: .4byte 0x030022c0 +_081BFE00: + ldr r0, _081BFE10 + bl SetVBlankCallback + ldr r0, _081BFE14 + bl set_callback2 + movs r0, 0x1 + b _081BFE1A + .align 2, 0 +_081BFE10: .4byte sub_81BFAD0 + 1 +_081BFE14: .4byte sub_81BFAB4 + 1 +_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 gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081BFEA0 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _081BFEA4 + ldr r1, [r4] + ldr r0, _081BFEA8 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081BFEAC + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + adds r1, 0xBC + movs r0, 0x3 + bl bg_set_tilemap + 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 lcd_io_set + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081BFEA0: .4byte 0x0861cbb4 +_081BFEA4: .4byte 0x0203cf1c +_081BFEA8: .4byte 0x000020bc +_081BFEAC: .4byte 0x000010bc + thumb_func_end sub_81BFE24 + + thumb_func_start sub_81BFEB0 +sub_81BFEB0: @ 81BFEB0 + push {r4,lr} + sub sp, 0x4 + ldr r1, _081BFED4 + ldr r0, [r1] + ldr r2, _081BFED8 + 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, _081BFEDC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081BFED4: .4byte 0x0203cf1c +_081BFED8: .4byte 0x000040f0 +_081BFEDC: .4byte _081BFEE0 + .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, _081BFF2C + 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 + .align 2, 0 +_081BFF2C: .4byte 0x08d97d0c +_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, _081BFF54 + ldr r4, _081BFF58 + ldr r1, [r4] + adds r1, 0xBC + bl call_LZZUnCompWram + ldr r1, [r4] + ldr r2, _081BFF5C + adds r1, r2 + b _081C004E + .align 2, 0 +_081BFF54: .4byte 0x08d9862c +_081BFF58: .4byte 0x0203cf1c +_081BFF5C: .4byte 0x000040f0 +_081BFF60: + ldr r0, _081BFF70 + ldr r1, [r4] + ldr r2, _081BFF74 + adds r1, r2 + bl call_LZZUnCompWram + ldr r1, [r4] + b _081C004A + .align 2, 0 +_081BFF70: .4byte 0x08d98cc8 +_081BFF74: .4byte 0x000008bc +_081BFF78: + ldr r0, _081BFF88 + ldr r1, [r4] + ldr r2, _081BFF8C + adds r1, r2 + bl call_LZZUnCompWram + ldr r1, [r4] + b _081C004A + .align 2, 0 +_081BFF88: .4byte 0x08d987fc +_081BFF8C: .4byte 0x000018bc +_081BFF90: + ldr r0, _081BFFA0 + ldr r1, [r4] + ldr r2, _081BFFA4 + adds r1, r2 + bl call_LZZUnCompWram + ldr r1, [r4] + b _081C004A + .align 2, 0 +_081BFFA0: .4byte 0x08d9898c +_081BFFA4: .4byte 0x000028bc +_081BFFA8: + ldr r0, _081BFFB8 + ldr r1, [r4] + ldr r2, _081BFFBC + adds r1, r2 + bl call_LZZUnCompWram + ldr r1, [r4] + b _081C004A + .align 2, 0 +_081BFFB8: .4byte 0x08d98b28 +_081BFFBC: .4byte 0x000038bc +_081BFFC0: + ldr r0, _081BFFE0 + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl decompress_palette + ldr r0, _081BFFE4 + movs r1, 0x81 + movs r2, 0x1E + bl gpu_pal_apply + ldr r0, _081BFFE8 + ldr r1, [r0] + ldr r2, _081BFFEC + adds r1, r2 + b _081C004E + .align 2, 0 +_081BFFE0: .4byte 0x08d9853c +_081BFFE4: .4byte 0x08d85620 +_081BFFE8: .4byte 0x0203cf1c +_081BFFEC: .4byte 0x000040f0 +_081BFFF0: + ldr r0, _081BFFF8 + bl gpu_tile_obj_decompress_and_load + b _081C0046 + .align 2, 0 +_081BFFF8: .4byte 0x0861cfbc +_081BFFFC: + ldr r0, _081C000C + bl gpu_tile_obj_decompress_and_load + ldr r0, _081C0010 + ldr r1, [r0] + ldr r2, _081C0014 + adds r1, r2 + b _081C004E + .align 2, 0 +_081C000C: .4byte 0x0861d074 +_081C0010: .4byte 0x0203cf1c +_081C0014: .4byte 0x000040f0 +_081C0018: + ldr r0, _081C0020 + bl gpu_tile_obj_decompress_and_load + b _081C0046 + .align 2, 0 +_081C0020: .4byte 0x0861d0f8 +_081C0024: + ldr r0, _081C0034 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _081C0038 + ldr r1, [r0] + ldr r2, _081C003C + adds r1, r2 + b _081C004E + .align 2, 0 +_081C0034: .4byte 0x0861d100 +_081C0038: .4byte 0x0203cf1c +_081C003C: .4byte 0x000040f0 +_081C0040: + ldr r0, _081C0058 + bl gpu_pal_obj_decompress_and_apply +_081C0046: + ldr r0, _081C005C + ldr r1, [r0] +_081C004A: + ldr r0, _081C0060 + adds r1, r0 +_081C004E: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081C008C + .align 2, 0 +_081C0058: .4byte 0x0861d07c +_081C005C: .4byte 0x0203cf1c +_081C0060: .4byte 0x000040f0 +_081C0064: + ldr r0, _081C0080 + movs r1, 0xE8 + lsls r1, 1 + movs r2, 0x60 + bl decompress_palette + ldr r0, _081C0084 + ldr r0, [r0] + ldr r1, _081C0088 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081C008E + .align 2, 0 +_081C0080: .4byte 0x08d97b84 +_081C0084: .4byte 0x0203cf1c +_081C0088: .4byte 0x000040f0 +_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, _081C00C4 + ldr r1, [r0] + ldr r2, _081C00C8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081C00D0 + ldr r2, [r1] + ldr r4, _081C00CC + 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 + .align 2, 0 +_081C00C4: .4byte 0x0203cf1c +_081C00C8: .4byte 0x000040bd +_081C00CC: .4byte 0x000040be +_081C00D0: + ldr r0, [r1] + ldr r2, _081C00EC + 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 + .align 2, 0 +_081C00EC: .4byte 0x000040be + 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, _081C0118 + ldr r7, [r0] + adds r6, r7, 0 + adds r6, 0x70 + ldr r1, _081C011C + 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 + .align 2, 0 +_081C0118: .4byte 0x0203cf1c +_081C011C: .4byte 0x000040f0 +_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, _081C0248 + cmp r1, r0 + beq _081C01F8 + ldr r2, _081C024C + adds r0, r7, r2 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C01F8 + ldr r1, _081C0250 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C0254 +_081C01F8: + adds r0, r5, 0 + bl get_nature + 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 + .align 2, 0 +_081C0248: .4byte 0x020244ec +_081C024C: .4byte 0x000040bc +_081C0250: .4byte 0x000040ef +_081C0254: + adds r0, r5, 0 + bl get_nature + 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 sub_8009308 + 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, _081C0340 + ldr r1, [r0] + ldr r2, _081C0344 + 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 + .align 2, 0 +_081C0340: .4byte 0x0203cf1c +_081C0344: .4byte 0x000040f0 + thumb_func_end sub_81C00F0 + + thumb_func_start sub_81C0348 +sub_81C0348: @ 81C0348 + push {r4-r6,lr} + ldr r6, _081C0374 + ldr r2, [r6] + ldr r1, _081C0378 + 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 + .align 2, 0 +_081C0374: .4byte 0x0203cf1c +_081C0378: .4byte 0x000040c0 +_081C037C: + ldr r1, _081C03F0 + 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, _081C03F4 + adds r0, r5 + movs r1, 0x3 + movs r2, 0 + bl sub_81C2194 + ldr r0, [r6] + ldr r4, _081C03F8 + adds r0, r4 + movs r1, 0x1 + movs r2, 0 + bl sub_81C2194 + ldr r1, [r6] + adds r1, r4 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r6] + adds r1, r5 + movs r0, 0x2 + bl bg_set_tilemap + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0x1 + bl bg_change_x_offset + movs r0, 0x13 + bl Window_FillTileMap + movs r0, 0xD + bl Window_FillTileMap +_081C03D8: + ldr r0, _081C03FC + 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 + .align 2, 0 +_081C03F0: .4byte 0x000040c6 +_081C03F4: .4byte 0x000020bc +_081C03F8: .4byte 0x000030bc +_081C03FC: .4byte 0x0203cf1c +_081C0400: + ldr r2, _081C042C + 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 Window_WriteStandardTileMap +_081C0416: + bl sub_81C2524 + ldr r0, _081C0430 + ldr r0, [r0] + adds r0, 0xC + bl sub_81C2228 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C042C: .4byte 0x000040c0 +_081C0430: .4byte 0x0203cf1c + thumb_func_end sub_81C0348 + + thumb_func_start sub_81C0434 +sub_81C0434: @ 81C0434 + push {lr} + bl Window_FreeMemory + ldr r0, _081C0448 + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_081C0448: .4byte 0x0203cf1c + 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 sub_80A1AD4 + ldr r1, _081C047C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C0480 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C047C: .4byte 0x03005e00 +_081C0480: .4byte sub_81C0484 + 1 + 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, _081C04F4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C04EC + ldr r4, _081C04F8 + ldr r0, [r4] + ldr r0, [r0, 0x4] + bl set_callback2 + ldr r1, _081C04FC + ldr r0, [r4] + ldr r2, _081C0500 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + bl sub_81C4898 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl sub_80A369C + ldr r0, _081C0504 + ldr r1, _081C0508 + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, _081C050C + 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 + .align 2, 0 +_081C04F4: .4byte 0x02037fd4 +_081C04F8: .4byte 0x0203cf1c +_081C04FC: .4byte 0x0203cf20 +_081C0500: .4byte 0x000040be +_081C0504: .4byte 0x03007420 +_081C0508: .4byte 0x0000ffff +_081C050C: .4byte 0x020244d4 + 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, _081C0548 + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081C05FE + ldr r5, _081C054C + 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 + .align 2, 0 +_081C0548: .4byte 0x02037fd4 +_081C054C: .4byte 0x030022c0 +_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 sub_81220D0 + 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 sub_81220D0 + 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, _081C05D0 + ldr r0, [r0] + ldr r1, _081C05D4 + 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 + .align 2, 0 +_081C05D0: .4byte 0x0203cf1c +_081C05D4: .4byte 0x000040c0 +_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, _081C0648 + ldr r3, [r1] + ldr r2, _081C064C + adds r0, r3, r2 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _081C06EE + ldr r1, _081C0650 + 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 + .align 2, 0 +_081C0648: .4byte 0x0203cf1c +_081C064C: .4byte 0x000040c3 +_081C0650: .4byte 0x000040bd +_081C0654: + movs r4, 0x3 + cmp r5, 0x1 + bne _081C065C + movs r4, 0x1 +_081C065C: + ldr r2, [r6] + ldr r0, [r2] + ldr r3, _081C0674 + 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 + .align 2, 0 +_081C0674: .4byte 0x000040be +_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, _081C06F4 + 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 Window_FillTileMap + 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, _081C06F8 + adds r0, r1 + movs r2, 0 + strb r4, [r0] + ldr r1, _081C06FC + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x8] + ldr r1, _081C0700 + str r1, [r0] +_081C06EE: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C06F4: .4byte 0x0203cf1c +_081C06F8: .4byte 0x000040be +_081C06FC: .4byte 0x03005e00 +_081C0700: .4byte sub_81C0704 + 1 + 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, _081C0728 + adds r5, r4, r6 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0xC + bls _081C071E + b _081C08BC +_081C071E: + lsls r0, 2 + ldr r1, _081C072C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C0728: .4byte 0x03005e08 +_081C072C: .4byte _081C0730 + .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, _081C0778 + ldr r0, [r0] + ldr r1, _081C077C + b _081C0786 + .align 2, 0 +_081C0778: .4byte 0x0203cf1c +_081C077C: .4byte 0x000040d3 +_081C0780: + ldr r0, _081C079C + ldr r0, [r0] + ldr r1, _081C07A0 +_081C0786: + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081C07A4 + adds r0, r1 + bl obj_delete_and_free_resources + b _081C08EC + .align 2, 0 +_081C079C: .4byte 0x0203cf1c +_081C07A0: .4byte 0x000040d4 +_081C07A4: .4byte 0x02020630 +_081C07A8: + ldr r4, _081C07C0 + ldr r0, [r4] + adds r0, 0xC + bl sub_81C0098 + ldr r0, [r4] + ldr r1, _081C07C4 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081C08EC + .align 2, 0 +_081C07C0: .4byte 0x0203cf1c +_081C07C4: .4byte 0x000040f0 +_081C07C8: + ldr r0, _081C07DC + ldr r0, [r0] + adds r0, 0xC + bl sub_81C00F0 + lsls r0, 24 + cmp r0, 0 + bne _081C07DA + b _081C08F2 +_081C07DA: + b _081C08EC + .align 2, 0 +_081C07DC: .4byte 0x0203cf1c +_081C07E0: + ldr r0, _081C07EC + ldr r0, [r0] + adds r0, 0xC + bl sub_81C49E0 + b _081C08EC + .align 2, 0 +_081C07EC: .4byte 0x0203cf1c +_081C07F0: + ldr r0, _081C07FC + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4A08 + b _081C08EC + .align 2, 0 +_081C07FC: .4byte 0x0203cf1c +_081C0800: + ldr r4, _081C0824 + 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 + .align 2, 0 +_081C0824: .4byte 0x0203cf1c +_081C0828: + ldr r4, _081C0860 + ldr r0, [r4] + adds r0, 0xC + adds r1, r5, 0x2 + bl sub_81C45F4 + ldr r1, [r4] + ldr r2, _081C0864 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C08F2 + ldr r2, _081C0868 + 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 + .align 2, 0 +_081C0860: .4byte 0x0203cf1c +_081C0864: .4byte 0x000040d3 +_081C0868: .4byte 0x02020630 +_081C086C: + bl sub_81C4280 + b _081C08EC +_081C0872: + bl sub_81C25E8 + b _081C08EC +_081C0878: + ldr r0, _081C088C + ldr r0, [r0] + ldr r1, _081C0890 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2D9C + bl sub_81C2524 + b _081C08EC + .align 2, 0 +_081C088C: .4byte 0x0203cf1c +_081C0890: .4byte 0x000040c0 +_081C0894: + ldr r2, _081C08B0 + ldr r0, _081C08B4 + ldr r0, [r0] + ldr r1, _081C08B8 + 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 + .align 2, 0 +_081C08B0: .4byte 0x02020630 +_081C08B4: .4byte 0x0203cf1c +_081C08B8: .4byte 0x000040d3 +_081C08BC: + bl sub_81221EC + lsls r0, 24 + cmp r0, 0 + bne _081C08F2 + ldr r0, _081C08E4 + 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, _081C08E8 + str r1, [r0] + b _081C08F2 + .align 2, 0 +_081C08E4: .4byte sub_81C20F0 + 1 +_081C08E8: .4byte sub_81C0510 + 1 +_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, _081C0950 + ldr r2, [r1] + ldr r7, [r2] + ldr r3, _081C0954 + 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, _081C0958 + 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, _081C0958 + adds r1, r0, r2 + ldr r3, _081C095C + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcs _081C0988 +_081C0940: + ldr r0, [r5] + ldr r1, _081C0958 + adds r0, r1 + ldrb r0, [r0] + adds r0, r4 + lsls r0, 24 + asrs r0, 24 + b _081C09AE + .align 2, 0 +_081C0950: .4byte 0x0203cf1c +_081C0954: .4byte 0x000040c0 +_081C0958: .4byte 0x000040be +_081C095C: .4byte 0x000040bf +_081C0960: + ldr r3, _081C0990 + 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, _081C0994 + ldr r0, [r0] + ldr r1, _081C0998 + adds r0, r1 + ldrb r0, [r0] + cmp r4, r0 + ble _081C099C +_081C0988: + movs r0, 0x1 + negs r0, r0 + b _081C09AE + .align 2, 0 +_081C0990: .4byte 0x000040be +_081C0994: .4byte 0x0203cf1c +_081C0998: .4byte 0x000040bf +_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, _081C0A34 + ldr r0, [r6] + ldr r1, [r0] + mov r8, r1 + movs r5, 0 + movs r2, 0 + ldr r3, _081C0A38 + movs r1, 0 + ldrsb r1, [r3, r1] + ldr r4, _081C0A3C + 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, _081C0A38 +_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 + .align 2, 0 +_081C0A34: .4byte 0x0203cf1c +_081C0A38: .4byte 0x0861cc1c +_081C0A3C: .4byte 0x000040be +_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, _081C0A7C + ldr r0, [r0] + ldr r1, _081C0A80 + 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 + .align 2, 0 +_081C0A7C: .4byte 0x0203cf1c +_081C0A80: .4byte 0x000040be +_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, _081C0B34 + 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, _081C0B38 + 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, _081C0B3C + adds r0, r2, r1 + ldr r3, _081C0B40 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081C0B6E +_081C0AE0: + cmp r5, 0x1 + bne _081C0AF4 + ldr r1, _081C0B3C + adds r0, r2, r1 + ldr r3, _081C0B44 + 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, _081C0B3C + 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, _081C0B48 + 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 + .align 2, 0 +_081C0B34: .4byte 0x0203cf1c +_081C0B38: .4byte 0x03005e08 +_081C0B3C: .4byte 0x000040c0 +_081C0B40: .4byte 0x000040c1 +_081C0B44: .4byte 0x000040c2 +_081C0B48: .4byte sub_81C0B8C + 1 +_081C0B4C: + ldr r1, _081C0B80 + 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, _081C0B84 + ldr r0, [r0] + ldr r2, _081C0B88 + 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 + .align 2, 0 +_081C0B80: .4byte sub_81C0CC4 + 1 +_081C0B84: .4byte 0x0203cf1c +_081C0B88: .4byte 0x000040c0 + 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, _081C0BD4 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C0C2A + ldr r0, _081C0BD8 + ldr r0, [r0] + ldr r3, _081C0BDC + 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 gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + b _081C0BFE + .align 2, 0 +_081C0BD4: .4byte 0x03005e08 +_081C0BD8: .4byte 0x0203cf1c +_081C0BDC: .4byte 0x000040c9 +_081C0BE0: + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081C0BFE: + ldrb r0, [r4, 0x2] + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + ldrb r0, [r4, 0x2] + ldr r1, _081C0C58 + ldr r1, [r1] + ldr r3, _081C0C5C + adds r2, r1, r3 + ldrb r2, [r2] + lsls r2, 12 + adds r2, 0xBC + adds r1, r2 + bl bg_set_tilemap + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show +_081C0C2A: + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x1 + bl bg_change_x_offset + ldrh r0, [r4] + adds r0, 0x20 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081C0C52 + ldr r0, _081C0C60 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081C0C64 + str r0, [r1] +_081C0C52: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C0C58: .4byte 0x0203cf1c +_081C0C5C: .4byte 0x000040c0 +_081C0C60: .4byte 0x03005e00 +_081C0C64: .4byte sub_81C0C68 + 1 + 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, _081C0CB4 + adds r2, r0 + ldr r5, _081C0CB8 + ldr r3, [r5] + ldr r0, _081C0CBC + 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, _081C0CC0 + 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 + .align 2, 0 +_081C0CB4: .4byte 0x03005e08 +_081C0CB8: .4byte 0x0203cf1c +_081C0CBC: .4byte 0x000040c9 +_081C0CC0: .4byte 0x000040c0 + 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, _081C0CF0 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C0D0C + ldr r0, _081C0CF4 + ldr r0, [r0] + ldr r1, _081C0CF8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0CFC + movs r0, 0x2 + b _081C0CFE + .align 2, 0 +_081C0CF0: .4byte 0x03005e08 +_081C0CF4: .4byte 0x0203cf1c +_081C0CF8: .4byte 0x000040c9 +_081C0CFC: + movs r0, 0x1 +_081C0CFE: + strh r0, [r4, 0x2] + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 9 + movs r2, 0 + bl bg_change_x_offset +_081C0D0C: + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x2 + bl bg_change_x_offset + ldrh r0, [r4] + adds r0, 0x20 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081C0D34 + ldr r0, _081C0D3C + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081C0D40 + str r0, [r1] +_081C0D34: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C0D3C: .4byte 0x03005e00 +_081C0D40: .4byte sub_81C0D44 + 1 + 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, _081C0D80 + adds r4, r0, r1 + ldr r0, _081C0D84 + ldr r0, [r0] + ldr r1, _081C0D88 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0D8C + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081C0DA6 + .align 2, 0 +_081C0D80: .4byte 0x03005e08 +_081C0D84: .4byte 0x0203cf1c +_081C0D88: .4byte 0x000040c9 +_081C0D8C: + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1 + bl gpu_bg_config_set_field + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl gpu_bg_config_set_field + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081C0DA6: + ldr r6, _081C0E14 + ldr r2, [r6] + ldr r7, _081C0E18 + adds r1, r2, r7 + ldrb r0, [r1] + cmp r0, 0x1 + bls _081C0DD0 + ldrb r0, [r4, 0x2] + ldrb r1, [r1] + lsls r1, 12 + ldr r3, _081C0E1C + adds r1, r3 + adds r1, r2, r1 + bl bg_set_tilemap + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 9 + movs r2, 0 + bl bg_change_x_offset +_081C0DD0: + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r2, [r6] + ldr r0, _081C0E20 + 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 + .align 2, 0 +_081C0E14: .4byte 0x0203cf1c +_081C0E18: .4byte 0x000040c0 +_081C0E1C: .4byte 0xfffff0bc +_081C0E20: .4byte 0x000040c9 + thumb_func_end sub_81C0D44 + + thumb_func_start sub_81C0E24 +sub_81C0E24: @ 81C0E24 + push {lr} + ldr r0, _081C0E40 + ldr r1, [r0] + ldr r2, _081C0E44 + 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 + .align 2, 0 +_081C0E40: .4byte 0x0203cf1c +_081C0E44: .4byte 0x000040c0 + 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, _081C0F20 + ldr r0, [r5] + ldr r2, _081C0F24 + 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 Window_FillTileMap + ldr r2, _081C0F28 + ldr r0, [r5] + ldr r1, _081C0F2C + 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 Window_FillTileMap +_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, _081C0F30 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0EC4 + movs r0, 0x5 + bl Window_FillTileMap + movs r0, 0x6 + bl Window_WriteStandardTileMap +_081C0EC4: + ldr r0, [r5] + ldr r1, _081C0F34 + adds r0, r1 + movs r1, 0x3 + movs r2, 0 + bl sub_81C2194 + ldr r0, [r5] + ldr r1, _081C0F38 + 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, _081C0F3C + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C0F40 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C0F20: .4byte 0x0203cf1c +_081C0F24: .4byte 0x000040c6 +_081C0F28: .4byte 0x02020630 +_081C0F2C: .4byte 0x000040d5 +_081C0F30: .4byte 0x000040c8 +_081C0F34: .4byte 0x000020bc +_081C0F38: .4byte 0x000030bc +_081C0F3C: .4byte 0x03005e00 +_081C0F40: .4byte sub_81C0F44 + 1 + 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, _081C0F88 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C103A + ldr r0, _081C0F8C + 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, _081C0F90 + ldr r2, [r0] + ldr r0, _081C0F94 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C103A + .align 2, 0 +_081C0F88: .4byte 0x03005e08 +_081C0F8C: .4byte 0x030022c0 +_081C0F90: .4byte 0x0203cf1c +_081C0F94: .4byte 0x000040c6 +_081C0F98: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C0FC0 + movs r0, 0x4 + strh r0, [r4] + ldr r0, _081C0FB8 + ldr r2, [r0] + ldr r0, _081C0FBC + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C103A + .align 2, 0 +_081C0FB8: .4byte 0x0203cf1c +_081C0FBC: .4byte 0x000040c6 +_081C0FC0: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C1026 + ldr r0, _081C0FF8 + ldr r1, [r0] + ldr r2, _081C0FFC + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C0FE8 + subs r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, _081C1000 + 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 + .align 2, 0 +_081C0FF8: .4byte 0x0203cf1c +_081C0FFC: .4byte 0x000040c8 +_081C1000: .4byte 0x00ffffff +_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, _081C105C + 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 + .align 2, 0 +_081C105C: .4byte 0x0203cf1c +_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, _081C11B8 + 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, _081C11B8 + ldr r0, [r0] + ldr r1, _081C11BC + 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 Window_FillTileMap + ldr r2, _081C11C0 + ldr r0, _081C11B8 + ldr r0, [r0] + ldr r1, _081C11C4 + 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 Window_FillTileMap +_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, _081C11B8 + ldr r0, [r0] + ldr r1, _081C11BC + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081C11A0 + movs r0, 0xE + bl Window_FillTileMap + movs r0, 0xF + bl Window_FillTileMap + 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, _081C11B8 + ldr r0, [r0] + ldr r1, _081C11C8 + adds r0, r1 + cmp r8, r0 + bne _081C11E0 + movs r0, 0x8 + bl sub_81C4D18 + b _081C11E6 + .align 2, 0 +_081C11B8: .4byte 0x0203cf1c +_081C11BC: .4byte 0x000040c4 +_081C11C0: .4byte 0x02020630 +_081C11C4: .4byte 0x000040d5 +_081C11C8: .4byte 0x000040c6 +_081C11CC: + ldr r0, _081C11D8 + ldr r0, [r0] + ldr r1, _081C11DC + adds r0, r1 + ldrh r5, [r0] + b _081C10E2 + .align 2, 0 +_081C11D8: .4byte 0x0203cf1c +_081C11DC: .4byte 0x000040c4 +_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 Window_FillTileMap + movs r0, 0x5 + bl Window_WriteStandardTileMap + movs r0, 0 + bl sub_81C3E9C + ldr r4, _081C1284 + ldr r0, [r4] + ldr r1, _081C1288 + adds r0, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_81C2194 + ldr r0, [r4] + ldr r1, _081C128C + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_81C2194 + bl sub_81C4064 + ldr r0, [r4] + ldr r1, _081C1290 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + beq _081C125E + movs r0, 0xE + bl Window_FillTileMap + movs r0, 0xF + bl Window_FillTileMap + 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, _081C1294 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081C1298 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C1284: .4byte 0x0203cf1c +_081C1288: .4byte 0x000020bc +_081C128C: .4byte 0x000030bc +_081C1290: .4byte 0x000040c6 +_081C1294: .4byte 0x03005e00 +_081C1298: .4byte sub_81C0510 + 1 + 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, _081C12D4 + ldr r0, [r0] + ldr r2, _081C12D8 + 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, _081C12DC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C12E0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C12D4: .4byte 0x0203cf1c +_081C12D8: .4byte 0x000040c6 +_081C12DC: .4byte 0x03005e00 +_081C12E0: .4byte sub_81C12E4 + 1 + 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, _081C1328 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C13AA + ldr r0, _081C132C + 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, _081C1330 + ldr r2, [r0] + ldr r0, _081C1334 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C13AA + .align 2, 0 +_081C1328: .4byte 0x03005e08 +_081C132C: .4byte 0x030022c0 +_081C1330: .4byte 0x0203cf1c +_081C1334: .4byte 0x000040c7 +_081C1338: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C1360 + movs r0, 0x3 + strh r0, [r4] + ldr r0, _081C1358 + ldr r2, [r0] + ldr r0, _081C135C + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C13AA + .align 2, 0 +_081C1358: .4byte 0x0203cf1c +_081C135C: .4byte 0x000040c7 +_081C1360: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C139A + ldr r0, _081C1388 + ldr r0, [r0] + ldr r2, _081C138C + 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 + .align 2, 0 +_081C1388: .4byte 0x0203cf1c +_081C138C: .4byte 0x000040c6 +_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, _081C1400 + ldr r3, [r0] + ldr r1, _081C1404 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C1410 + ldr r0, [r3] + ldr r2, _081C1408 + adds r1, r3, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r0, r1 + ldr r4, _081C140C + adds r1, r3, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r3, r4 + ldrb r2, [r2] + bl sub_81C14BC + b _081C1430 + .align 2, 0 +_081C1400: .4byte 0x0203cf1c +_081C1404: .4byte 0x000040bd +_081C1408: .4byte 0x000040be +_081C140C: .4byte 0x000040c6 +_081C1410: + ldr r0, [r3] + ldr r2, _081C14A4 + adds r1, r3, r2 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + ldr r4, _081C14A8 + adds r1, r3, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r3, r4 + ldrb r2, [r2] + bl sub_81C15EC +_081C1430: + ldr r5, _081C14AC + ldr r0, [r5] + adds r0, 0xC + bl sub_81C0098 + ldr r1, [r5] + ldr r6, _081C14A8 + adds r0, r1, r6 + ldrb r0, [r0] + ldr r4, _081C14B0 + 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, _081C14AC + ldr r1, [r0] + ldr r2, _081C14A8 + 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, _081C14B4 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C14B8 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C14A4: .4byte 0x000040be +_081C14A8: .4byte 0x000040c6 +_081C14AC: .4byte 0x0203cf1c +_081C14B0: .4byte 0x000040c7 +_081C14B4: .4byte 0x03005e00 +_081C14B8: .4byte sub_81C0F44 + 1 + 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, _081C15E4 + 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, _081C15E8 + 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 + .align 2, 0 +_081C15E4: .4byte 0x0203cf1c +_081C15E8: .4byte 0x08329d22 + 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, _081C1714 + 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, _081C1718 + 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 + .align 2, 0 +_081C1714: .4byte 0x0203cf1c +_081C1718: .4byte 0x08329d22 + 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, _081C1744 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C1748 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C1744: .4byte 0x03005e00 +_081C1748: .4byte sub_81C174C + 1 + 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, _081C17A0 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C176A + b _081C189A +_081C176A: + ldr r0, _081C17A4 + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C177A + b _081C189A +_081C177A: + ldr r6, _081C17A8 + 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, _081C17AC + ldr r2, [r0] + ldr r0, _081C17B0 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C189A + .align 2, 0 +_081C17A0: .4byte 0x03005e08 +_081C17A4: .4byte 0x02037fd4 +_081C17A8: .4byte 0x030022c0 +_081C17AC: .4byte 0x0203cf1c +_081C17B0: .4byte 0x000040c6 +_081C17B4: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C17DC + movs r0, 0x4 + strh r0, [r4] + ldr r0, _081C17D4 + ldr r2, [r0] + ldr r1, _081C17D8 + adds r2, r1 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C189A + .align 2, 0 +_081C17D4: .4byte 0x0203cf1c +_081C17D8: .4byte 0x000040c6 +_081C17DC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C17F0 + bl sub_81220D0 + 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 sub_81220D0 + 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, _081C1858 + ldr r0, _081C185C + ldr r0, [r0] + ldr r1, _081C1860 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, _081C1864 + ldrb r0, [r2] + strh r0, [r1] + adds r0, r5, 0 + bl sub_81C044C + b _081C189A + .align 2, 0 +_081C1858: .4byte 0x0203cf21 +_081C185C: .4byte 0x0203cf1c +_081C1860: .4byte 0x000040c6 +_081C1864: .4byte 0x020375e2 +_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, _081C18A0 + movs r0, 0x4 + strb r0, [r1] + ldr r1, _081C18A4 + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81C044C +_081C189A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C18A0: .4byte 0x0203cf21 +_081C18A4: .4byte 0x020375e2 + thumb_func_end sub_81C174C + + thumb_func_start sub_81C18A8 +sub_81C18A8: @ 81C18A8 + push {lr} + ldr r0, _081C18E0 + ldr r2, [r0] + ldr r0, _081C18E4 + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0x4 + beq _081C18DA + ldr r3, _081C18E8 + 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 + .align 2, 0 +_081C18E0: .4byte 0x0203cf1c +_081C18E4: .4byte 0x000040c6 +_081C18E8: .4byte 0x000040c4 +_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 Window_FillTileMap + movs r0, 0xF + bl Window_FillTileMap + 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, _081C1938 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C193C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C1938: .4byte 0x03005e00 +_081C193C: .4byte sub_81C1940 + 1 + 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, _081C199C + mov r9, r0 + mov r4, r8 + add r4, r9 + ldr r0, _081C19A0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C196C + b _081C1B74 +_081C196C: + ldr r6, _081C19A4 + 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, _081C19A8 + ldr r2, [r0] + ldr r0, _081C19AC + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + movs r0, 0 + strh r0, [r4, 0x2] + b _081C1B6A + .align 2, 0 +_081C199C: .4byte 0x03005e08 +_081C19A0: .4byte sub_81C1E20 + 1 +_081C19A4: .4byte 0x030022c0 +_081C19A8: .4byte 0x0203cf1c +_081C19AC: .4byte 0x000040c6 +_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, _081C19D4 + ldr r2, [r0] + ldr r1, _081C19D8 + adds r2, r1 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + strh r5, [r4, 0x2] + b _081C1B6A + .align 2, 0 +_081C19D4: .4byte 0x0203cf1c +_081C19D8: .4byte 0x000040c6 +_081C19DC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C19F0 + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C1A64 +_081C19F0: + ldr r4, _081C1A4C + ldr r0, [r4] + ldr r2, _081C1A50 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C1A00 + b _081C1B74 +_081C1A00: + movs r0, 0x13 + bl Window_FillTileMap + ldr r2, _081C1A54 + ldr r0, [r4] + ldr r1, _081C1A58 + 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 Window_FillTileMap +_081C1A28: + ldr r1, [r4] + ldr r2, _081C1A5C + 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, _081C1A60 + str r1, [r0] + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081C1ACE + .align 2, 0 +_081C1A4C: .4byte 0x0203cf1c +_081C1A50: .4byte 0x000040c0 +_081C1A54: .4byte 0x02020630 +_081C1A58: .4byte 0x000040d5 +_081C1A5C: .4byte 0x000040c6 +_081C1A60: .4byte sub_81C174C + 1 +_081C1A64: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C1A7A + bl sub_81220D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C1B04 +_081C1A7A: + ldr r4, _081C1AEC + ldr r0, [r4] + ldr r1, _081C1AF0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _081C1B74 + movs r0, 0x13 + bl Window_FillTileMap + ldr r2, _081C1AF4 + ldr r0, [r4] + ldr r1, _081C1AF8 + 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 Window_FillTileMap +_081C1AB0: + ldr r1, [r4] + ldr r2, _081C1AFC + 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, _081C1B00 + 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 + .align 2, 0 +_081C1AEC: .4byte 0x0203cf1c +_081C1AF0: .4byte 0x000040c0 +_081C1AF4: .4byte 0x02020630 +_081C1AF8: .4byte 0x000040d5 +_081C1AFC: .4byte 0x000040c6 +_081C1B00: .4byte sub_81C174C + 1 +_081C1B04: + ldrh r1, [r6, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081C1B74 + movs r0, 0x13 + bl Window_FillTileMap + ldr r2, _081C1B80 + ldr r4, _081C1B84 + ldr r0, [r4] + ldr r1, _081C1B88 + 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 Window_FillTileMap +_081C1B38: + ldr r1, [r4] + ldr r2, _081C1B8C + 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, _081C1B90 + str r1, [r0] +_081C1B74: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C1B80: .4byte 0x02020630 +_081C1B84: .4byte 0x0203cf1c +_081C1B88: .4byte 0x000040d5 +_081C1B8C: .4byte 0x000040c6 +_081C1B90: .4byte sub_81C174C + 1 + thumb_func_end sub_81C1940 + + thumb_func_start sub_81C1B94 +sub_81C1B94: @ 81C1B94 + ldr r0, _081C1B9C + ldrb r0, [r0] + bx lr + .align 2, 0 +_081C1B9C: .4byte 0x0203cf21 + thumb_func_end sub_81C1B94 + + thumb_func_start sub_81C1BA0 +sub_81C1BA0: @ 81C1BA0 + push {r4-r7,lr} + sub sp, 0xC + movs r0, 0x20 + bl malloc + adds r4, r0, 0 + movs r5, 0 +_081C1BAE: + lsls r0, r5, 25 + lsrs r1, r0, 24 + adds r6, r1, 0 + ldr r0, _081C1BD0 + ldr r3, [r0] + ldr r2, _081C1BD4 + 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 + .align 2, 0 +_081C1BD0: .4byte 0x0203cf1c +_081C1BD4: .4byte 0x000040c1 +_081C1BD8: + ldr r7, _081C1BF4 + 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 + .align 2, 0 +_081C1BF4: .4byte 0x000040c2 +_081C1BF8: + ldr r7, _081C1C18 + 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 + .align 2, 0 +_081C1C18: .4byte 0x000040c0 +_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 bg_copy_tilemap_rect_simple + 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 malloc + 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, _081C1D2C + 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 + .align 2, 0 +_081C1D2C: .4byte 0x001fffff +_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, _081C1D64 + 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 + .align 2, 0 +_081C1D64: .4byte 0x001fffff +_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, _081C1DDC + 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, _081C1DE0 + ldr r1, [r0] + ldr r0, _081C1DE4 + adds r1, r0 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r3, 0 + movs r3, 0x1 + bl sub_81C1CB0 + b _081C1E12 + .align 2, 0 +_081C1DDC: .4byte 0x0861cc04 +_081C1DE0: .4byte 0x0203cf1c +_081C1DE4: .4byte 0x000020bc +_081C1DE8: + ldr r5, _081C1E18 + 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, _081C1E1C + 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 + .align 2, 0 +_081C1E18: .4byte sub_81C1E20 + 1 +_081C1E1C: .4byte 0x03005e00 + 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, _081C1E48 + 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, _081C1E4C + b _081C1E60 + .align 2, 0 +_081C1E48: .4byte 0x03005e08 +_081C1E4C: .4byte 0x0861cc04 +_081C1E50: + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, _081C1E9C + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C1E60 + strh r2, [r4, 0x2] +_081C1E60: + ldr r5, _081C1EA0 + ldr r1, [r5] + ldr r0, _081C1EA4 + 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, _081C1EA8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C1ED4 + movs r0, 0xE + bl Window_WriteStandardTileMap + b _081C1ED4 + .align 2, 0 +_081C1E9C: .4byte 0x0861cc04 +_081C1EA0: .4byte 0x0203cf1c +_081C1EA4: .4byte 0x000020bc +_081C1EA8: .4byte 0x000040c0 +_081C1EAC: + ldr r2, _081C1EF4 + ldr r0, [r5] + ldr r1, _081C1EF8 + 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 Window_WriteStandardTileMap +_081C1ECE: + movs r0, 0x13 + bl Window_WriteStandardTileMap +_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 + .align 2, 0 +_081C1EF4: .4byte 0x02020630 +_081C1EF8: .4byte 0x000040d5 + 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, _081C1F38 + 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, _081C1F3C + ldr r1, [r0] + ldr r0, _081C1F40 + adds r1, r0 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r3, 0 + movs r3, 0x1 + bl sub_81C1CB0 + b _081C1F70 + .align 2, 0 +_081C1F38: .4byte 0x0861cc10 +_081C1F3C: .4byte 0x0203cf1c +_081C1F40: .4byte 0x000030bc +_081C1F44: + ldr r5, _081C1F78 + 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, _081C1F7C + 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 + .align 2, 0 +_081C1F78: .4byte sub_81C1F80 + 1 +_081C1F7C: .4byte 0x03005e00 + 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, _081C1FA8 + 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, _081C1FAC + b _081C1FC0 + .align 2, 0 +_081C1FA8: .4byte 0x03005e08 +_081C1FAC: .4byte 0x0861cc10 +_081C1FB0: + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, _081C2010 + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C1FC0 + strh r2, [r4, 0x2] +_081C1FC0: + ldr r5, _081C2014 + ldr r1, [r5] + ldr r0, _081C2018 + 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, _081C201C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2006 + ldr r0, _081C2020 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _081C2006 + movs r0, 0xF + bl Window_WriteStandardTileMap +_081C2006: + ldrh r0, [r4, 0x4] + bl sub_81C240C + b _081C204C + .align 2, 0 +_081C2010: .4byte 0x0861cc10 +_081C2014: .4byte 0x0203cf1c +_081C2018: .4byte 0x000030bc +_081C201C: .4byte 0x000040c0 +_081C2020: .4byte sub_81C0B8C + 1 +_081C2024: + ldr r2, _081C206C + ldr r0, [r5] + ldr r1, _081C2070 + 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 Window_WriteStandardTileMap +_081C2046: + movs r0, 0x13 + bl Window_WriteStandardTileMap +_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 + .align 2, 0 +_081C206C: .4byte 0x02020630 +_081C2070: .4byte 0x000040d5 + 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, _081C20BC + 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, _081C20C0 + 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, _081C20C4 + ldr r1, [r5] + adds r1, 0xBC + adds r2, r4, 0 + movs r3, 0 + bl sub_81C1CB0 + b _081C20E2 + .align 2, 0 +_081C20BC: .4byte 0x0861cbec +_081C20C0: .4byte 0x0203cf1c +_081C20C4: .4byte 0x0861cbf8 +_081C20C8: + ldr r0, _081C20E8 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081C20EC + 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 + .align 2, 0 +_081C20E8: .4byte sub_81C20F0 + 1 +_081C20EC: .4byte 0x03005e00 + 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, _081C2118 + 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, _081C211C + b _081C2130 + .align 2, 0 +_081C2118: .4byte 0x03005e08 +_081C211C: .4byte 0x0861cbec +_081C2120: + movs r0, 0x2 + ldrsh r1, [r5, r0] + ldr r0, _081C2188 + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C2130 + strh r2, [r5, 0x2] +_081C2130: + ldr r4, _081C218C + ldr r1, [r4] + adds r1, 0xBC + ldrb r2, [r5, 0x2] + adds r0, r7, 0 + movs r3, 0 + bl sub_81C1CB0 + ldr r0, _081C2190 + 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 Window_WriteStandardTileMap + 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 + .align 2, 0 +_081C2188: .4byte 0x0861cbec +_081C218C: .4byte 0x0203cf1c +_081C2190: .4byte 0x0861cbf8 + 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, _081C21DC + cmp r2, 0 + bne _081C21E4 + movs r3, 0 + ldr r5, _081C21E0 +_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 + .align 2, 0 +_081C21DC: .4byte 0x0000056a +_081C21E0: .4byte 0x08dc3cd4 +_081C21E4: + movs r3, 0 + ldr r5, _081C2224 +_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 + .align 2, 0 +_081C2224: .4byte 0x08dc3cd4 + 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, _081C2254 + ldr r0, [r0] + ldr r2, _081C2258 + adds r1, r0, r2 + movs r2, 0x2C + b _081C2266 + .align 2, 0 +_081C2254: .4byte 0x0203cf1c +_081C2258: .4byte 0x00000502 +_081C225C: + ldr r0, _081C227C + ldr r0, [r0] + ldr r2, _081C2280 + adds r1, r0, r2 + ldr r2, _081C2284 +_081C2266: + strh r2, [r1] + ldr r1, _081C2288 + adds r0, r1 + strh r2, [r0] + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C227C: .4byte 0x0203cf1c +_081C2280: .4byte 0x00000502 +_081C2284: .4byte 0x0000081a +_081C2288: .4byte 0x00000d02 + 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, _081C2334 + ldr r1, [r0] + adds r6, r1, 0 + adds r6, 0x70 + ldrb r1, [r6, 0x5] + mov r8, r0 + cmp r1, 0x63 + bhi _081C2340 + ldr r5, _081C2338 + adds r2, r1, 0 + adds r1, r2, 0x1 + lsls r1, 2 + ldr r4, _081C233C + 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 + .align 2, 0 +_081C2334: .4byte 0x0203cf1c +_081C2338: .4byte 0x0831f72c +_081C233C: .4byte 0x083203cc +_081C2340: + movs r6, 0 + movs r7, 0 +_081C2344: + mov r1, r8 + ldr r0, [r1] + ldr r2, _081C2370 + adds r2, r0 + mov r9, r2 + movs r0, 0 + mov r12, r0 + ldr r1, _081C2374 + 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, _081C2378 + adds r1, r2, 0 + strh r1, [r0] + b _081C23B6 + .align 2, 0 +_081C2370: .4byte 0x00001d66 +_081C2374: .4byte 0x00002062 +_081C2378: .4byte 0x0000206a +_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 bg_get_tilemap + ldr r1, _081C23F0 + ldr r1, [r1] + ldr r2, _081C23F4 + adds r1, r2 + cmp r0, r1 + bne _081C23F8 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + b _081C23FE + .align 2, 0 +_081C23F0: .4byte 0x0203cf1c +_081C23F4: .4byte 0x000010bc +_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, _081C2470 + ldr r0, [r0] + ldr r1, _081C2474 + adds r5, r0, r1 + cmp r3, 0 + beq _081C2510 + ldr r1, _081C2478 + ldr r2, _081C247C + 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, _081C2480 + b _081C2496 + .align 2, 0 +_081C2470: .4byte 0x0203cf1c +_081C2474: .4byte 0x000038bc +_081C2478: .4byte 0x0858cdcc +_081C247C: .4byte 0x0858c2b4 +_081C2480: .4byte 0x0000103a +_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, _081C24E4 +_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, _081C24E8 +_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, _081C24EC + b _081C2502 + .align 2, 0 +_081C24E4: .4byte 0x00001039 +_081C24E8: .4byte 0x0000044c +_081C24EC: .4byte 0x0000103c +_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, _081C2520 +_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 + .align 2, 0 +_081C2520: .4byte 0x0000103d + thumb_func_end sub_81C240C + + thumb_func_start sub_81C2524 +sub_81C2524: @ 81C2524 + push {lr} + ldr r0, _081C2540 + 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 bg_change_x_offset + b _081C254E + .align 2, 0 +_081C2540: .4byte 0x0203cf1c +_081C2544: + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset +_081C254E: + pop {r0} + bx r0 + thumb_func_end sub_81C2524 + + thumb_func_start sub_81C2554 +sub_81C2554: @ 81C2554 + push {r4,r5,lr} + ldr r0, _081C2598 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r4, 0 +_081C2562: + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _081C2562 + movs r4, 0 + ldr r5, _081C259C + ldr r3, _081C25A0 + 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 + .align 2, 0 +_081C2598: .4byte 0x0861cc24 +_081C259C: .4byte 0x0203cf1c +_081C25A0: .4byte 0x000040cb + 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, _081C25E4 + adds r4, r5 + str r4, [sp, 0x8] + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl sub_8199EEC + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C25E4: .4byte 0x0861cd2c + thumb_func_end sub_81C25A4 + + thumb_func_start sub_81C25E8 +sub_81C25E8: @ 81C25E8 + push {lr} + movs r0, 0x11 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x12 + movs r1, 0 + bl Window_FastFillPixels + movs r0, 0x13 + movs r1, 0 + bl Window_FastFillPixels + ldr r0, _081C2614 + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + bne _081C2618 + bl sub_81C2628 + b _081C261C + .align 2, 0 +_081C2614: .4byte 0x0203cf1c +_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, _081C2698 + 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, _081C269C + cmp r5, r0 + beq _081C26CE + ldr r6, _081C26A0 + ldr r1, _081C26A4 + adds r0, r6, 0 + bl gf_strcpy + ldr r4, _081C26A8 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r6, 0 + adds r1, r4, 0 + bl gf_strcat + 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 + .align 2, 0 +_081C2698: .4byte 0x0203cf1c +_081C269C: .4byte 0x0000ffff +_081C26A0: .4byte 0x02021cc4 +_081C26A4: .4byte 0x085e8d4f +_081C26A8: .4byte 0x02021dc4 +_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 Window_WriteStandardTileMap + b _081C26EE +_081C26CE: + movs r0, 0x11 + bl Window_FillTileMap + 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, _081C2784 + ldr r1, _081C2788 + adds r0, r4, 0 + bl gf_strcpy + ldr r5, _081C278C + ldrb r1, [r7, 0x5] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + adds r0, r4, 0 + adds r1, r5, 0 + bl gf_strcat + 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 sub_81B1B44 + 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, _081C2790 + adds r1, r2 + bl gf_strcpy + 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 Window_WriteStandardTileMap + movs r0, 0x13 + bl Window_WriteStandardTileMap + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C2784: .4byte 0x02021cc4 +_081C2788: .4byte 0x085e8d4d +_081C278C: .4byte 0x02021dc4 +_081C2790: .4byte 0x083185c8 + thumb_func_end sub_81C2628 + + thumb_func_start sub_81C2794 +sub_81C2794: @ 81C2794 + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C27D4 + ldr r0, [r0] + adds r0, 0xC + ldr r4, _081C27D8 + adds r1, r4, 0 + bl sub_81B1B44 + 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 Window_WriteStandardTileMap + movs r0, 0x11 + bl Window_FillTileMap + movs r0, 0x13 + bl Window_FillTileMap + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C27D4: .4byte 0x0203cf1c +_081C27D8: .4byte 0x02021cc4 + 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, _081C2814 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x13 + movs r2, 0x39 + movs r3, 0x11 + bl sub_81C25A4 + b _081C282C + .align 2, 0 +_081C2814: .4byte 0x085e8d49 +_081C2818: + ldr r1, _081C2834 + 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 + .align 2, 0 +_081C2834: .4byte 0x085e8d4b + 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, _081C2868 + 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 Window_CopyWholePixelBlockToWindow + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C2868: .4byte 0x0861cdd3 + thumb_func_end sub_81C2838 + + thumb_func_start sub_81C286C +sub_81C286C: @ 81C286C + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, _081C2AA4 + 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, _081C2AA8 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AAC + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x2 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AB0 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, _081C2AB4 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl sub_81DB368 + 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, _081C2AB8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl sub_81DB368 + 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, _081C2ABC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl sub_81DB368 + 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, _081C2AC0 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AC4 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x9 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, _081C2AC8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl sub_81DB35C + 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, _081C2ACC + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl sub_81DB35C + 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, _081C2AD0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl sub_81DB35C + 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, _081C2AD4 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl sub_81DB35C + 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, _081C2AD8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl sub_81DB35C + 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, _081C2ADC + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl sub_81DB35C + 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, _081C2AE0 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xC + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AE4 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xC + movs r2, 0x6 + movs r3, 0x11 + bl sub_81C25A4 + ldr r1, _081C2AE8 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xD + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AEC + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AF0 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + movs r2, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r1, _081C2AF4 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xF + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, _081C2AF8 + 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 + .align 2, 0 +_081C2AA4: .4byte 0x085ea3cf +_081C2AA8: .4byte 0x085ea3dc +_081C2AAC: .4byte 0x085ea3eb +_081C2AB0: .4byte 0x085ea3f8 +_081C2AB4: .4byte 0x085e8cf7 +_081C2AB8: .4byte 0x085ea406 +_081C2ABC: .4byte 0x085ea3c8 +_081C2AC0: .4byte 0x085ea369 +_081C2AC4: .4byte 0x085ea378 +_081C2AC8: .4byte 0x085ea361 +_081C2ACC: .4byte 0x085ea33c +_081C2AD0: .4byte 0x085ea343 +_081C2AD4: .4byte 0x085ea34b +_081C2AD8: .4byte 0x085ea353 +_081C2ADC: .4byte 0x085ea35b +_081C2AE0: .4byte 0x085ea39f +_081C2AE4: .4byte 0x085ea3ab +_081C2AE8: .4byte 0x085ea398 +_081C2AEC: .4byte 0x085ea37e +_081C2AF0: .4byte 0x085ea384 +_081C2AF4: .4byte 0x085ea38d +_081C2AF8: .4byte 0x085ea394 + 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 Window_FillTileMap + movs r0, 0x1 + bl Window_FillTileMap + movs r0, 0x2 + bl Window_FillTileMap + movs r0, 0x3 + bl Window_FillTileMap + 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 Window_WriteStandardTileMap + movs r0, 0x4 + bl Window_WriteStandardTileMap + 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 Window_WriteStandardTileMap +_081C2B5E: + movs r0, 0x9 + bl Window_WriteStandardTileMap + b _081C2C06 +_081C2B66: + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0xA + bl Window_WriteStandardTileMap + movs r0, 0xB + bl Window_WriteStandardTileMap + movs r0, 0xC + bl Window_WriteStandardTileMap + b _081C2C06 +_081C2B80: + movs r0, 0x2 + bl Window_WriteStandardTileMap + ldr r0, _081C2BB0 + ldr r1, [r0] + ldr r2, _081C2BB4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2BBC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, _081C2BB8 + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2C06 + movs r0, 0xE + bl Window_WriteStandardTileMap + b _081C2C06 + .align 2, 0 +_081C2BB0: .4byte 0x0203cf1c +_081C2BB4: .4byte 0x000040bc +_081C2BB8: .4byte 0x00ffffff +_081C2BBC: + movs r0, 0x5 + bl Window_WriteStandardTileMap + b _081C2C06 +_081C2BC4: + movs r0, 0x3 + bl Window_WriteStandardTileMap + ldr r0, _081C2BF4 + ldr r1, [r0] + ldr r2, _081C2BF8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2C00 + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, _081C2BFC + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2C06 + movs r0, 0xF + bl Window_WriteStandardTileMap + b _081C2C06 + .align 2, 0 +_081C2BF4: .4byte 0x0203cf1c +_081C2BF8: .4byte 0x000040bc +_081C2BFC: .4byte 0x00ffffff +_081C2C00: + movs r0, 0x5 + bl Window_WriteStandardTileMap +_081C2C06: + movs r4, 0 + ldr r5, _081C2C30 +_081C2C0A: + ldr r0, [r5] + ldr r1, _081C2C34 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + 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 + .align 2, 0 +_081C2C30: .4byte 0x0203cf1c +_081C2C34: .4byte 0x000040cb + 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 Window_FillTileMap + 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 Window_FillTileMap +_081C2C7C: + movs r0, 0x9 + bl Window_FillTileMap + b _081C2D0E +_081C2C84: + movs r0, 0xA + bl Window_FillTileMap + movs r0, 0xB + bl Window_FillTileMap + movs r0, 0xC + bl Window_FillTileMap + b _081C2D0E +_081C2C98: + ldr r0, _081C2CC0 + ldr r1, [r0] + ldr r2, _081C2CC4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2CCC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, _081C2CC8 + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2D0E + movs r0, 0xE + bl Window_FillTileMap + b _081C2D0E + .align 2, 0 +_081C2CC0: .4byte 0x0203cf1c +_081C2CC4: .4byte 0x000040bc +_081C2CC8: .4byte 0x00ffffff +_081C2CCC: + movs r0, 0x5 + bl Window_FillTileMap + b _081C2D0E +_081C2CD4: + ldr r0, _081C2CFC + ldr r1, [r0] + ldr r2, _081C2D00 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2D08 + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, _081C2D04 + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2D0E + movs r0, 0xF + bl Window_FillTileMap + b _081C2D0E + .align 2, 0 +_081C2CFC: .4byte 0x0203cf1c +_081C2D00: .4byte 0x000040bc +_081C2D04: .4byte 0x00ffffff +_081C2D08: + movs r0, 0x5 + bl Window_FillTileMap +_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, _081C2D60 + ldr r4, _081C2D64 + 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 Window_AddFromTemplate + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl Window_FastFillPixels +_081C2D56: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081C2D60: .4byte 0x0203cf1c +_081C2D64: .4byte 0x000040cb + thumb_func_end sub_81C2D2C + + thumb_func_start sub_81C2D68 +sub_81C2D68: @ 81C2D68 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081C2D94 + ldr r2, _081C2D98 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C2D8C + bl Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] +_081C2D8C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C2D94: .4byte 0x0203cf1c +_081C2D98: .4byte 0x000040cb + 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, _081C2DD8 + ldr r0, [r0] + ldr r1, _081C2DDC + adds r0, r1 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C2DBA + movs r1, 0 + bl Window_FastFillPixels +_081C2DBA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _081C2DA4 + ldr r0, _081C2DE0 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C2DD8: .4byte 0x0203cf1c +_081C2DDC: .4byte 0x000040cb +_081C2DE0: .4byte 0x0861ce54 + thumb_func_end sub_81C2D9C + + thumb_func_start sub_81C2DE4 +sub_81C2DE4: @ 81C2DE4 + push {lr} + lsls r0, 24 + ldr r1, _081C2DFC + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081C2DFC: .4byte 0x0861ce64 + thumb_func_end sub_81C2DE4 + + thumb_func_start sub_81C2E00 +sub_81C2E00: @ 81C2E00 + push {lr} + ldr r0, _081C2E20 + 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 + .align 2, 0 +_081C2E20: .4byte 0x0203cf1c +_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, _081C2E68 + 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, _081C2E6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C2E68: .4byte 0x03005e08 +_081C2E6C: .4byte _081C2E70 + .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, _081C2F34 + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _081C2F38 + 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 font_get_width_of_string + adds r2, r0, 0 + ldr r0, _081C2F3C + 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 + .align 2, 0 +_081C2F34: .4byte 0x0861cccc +_081C2F38: .4byte 0x085ea365 +_081C2F3C: .4byte 0x0203cf1c +_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, _081C2FC8 + ldr r1, _081C2FCC + adds r0, r5, 0 + bl gf_strcpy + ldr r1, _081C2FD0 + ldr r1, [r1] + adds r1, 0xB8 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x5 + bl decimal_int_to_string + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl sub_81DB368 + adds r4, r0, 0 + ldr r0, _081C2FD4 + 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 + .align 2, 0 +_081C2FC8: .4byte 0x02021cc4 +_081C2FCC: .4byte 0x085e8d59 +_081C2FD0: .4byte 0x0203cf1c +_081C2FD4: .4byte 0x0861cccc + thumb_func_end sub_81C2F5C + + thumb_func_start sub_81C2FD8 +sub_81C2FD8: @ 81C2FD8 + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C3020 + 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, _081C3024 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xD + muls r1, r4 + ldr r2, _081C3028 + 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 + .align 2, 0 +_081C3020: .4byte 0x0203cf1c +_081C3024: .4byte 0x0861cccc +_081C3028: .4byte 0x0831b6db + thumb_func_end sub_81C2FD8 + + thumb_func_start sub_81C302C +sub_81C302C: @ 81C302C + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C3070 + 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, _081C3074 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081C3078 + 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 + .align 2, 0 +_081C3070: .4byte 0x0203cf1c +_081C3074: .4byte 0x0861cccc +_081C3078: .4byte 0x0831bad4 + thumb_func_end sub_81C302C + + thumb_func_start sub_81C307C +sub_81C307C: @ 81C307C + push {r4-r6,lr} + ldr r0, _081C30CC + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x70 + bl sub_81AFBF0 + ldr r1, _081C30D0 + movs r0, 0 + bl sub_81AFC0C + ldr r1, _081C30D4 + 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, _081C30D8 + ldr r1, _081C30DC + bl sub_81AFC28 + b _081C3182 + .align 2, 0 +_081C30CC: .4byte 0x0203cf1c +_081C30D0: .4byte 0x0861ce74 +_081C30D4: .4byte 0x0861ce7b +_081C30D8: .4byte 0x02021fc4 +_081C30DC: .4byte 0x085ea5db +_081C30E0: + movs r0, 0x20 + bl malloc + adds r6, r0, 0 + movs r0, 0x20 + bl malloc + 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, _081C312C + cmp r0, 0xD4 + bls _081C3170 + ldr r1, _081C3130 + b _081C3170 + .align 2, 0 +_081C312C: .4byte 0x085ea516 +_081C3130: .4byte 0x085ea617 +_081C3134: + ldrb r0, [r4, 0x9] + ldr r1, _081C3140 + cmp r0, 0xD4 + bls _081C3170 + ldr r1, _081C3144 + b _081C3170 + .align 2, 0 +_081C3140: .4byte 0x085ea4ec +_081C3144: .4byte 0x085ea5eb +_081C3148: + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _081C3158 + ldr r1, _081C3154 + b _081C3170 + .align 2, 0 +_081C3154: .4byte 0x085ea56a +_081C3158: + cmp r0, 0xFE + beq _081C316E + bl sub_81C32BC + lsls r0, 24 + cmp r0, 0 + beq _081C316E + ldrb r0, [r4, 0x9] + ldr r1, _081C3188 + cmp r0, 0xD4 + bls _081C3170 +_081C316E: + ldr r1, _081C318C +_081C3170: + ldr r0, _081C3190 + bl sub_81AFC28 + adds r0, r6, 0 + bl free + adds r0, r5, 0 + bl free +_081C3182: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C3188: .4byte 0x085ea5a8 +_081C318C: .4byte 0x085ea544 +_081C3190: .4byte 0x02021fc4 + thumb_func_end sub_81C307C + + thumb_func_start sub_81C3194 +sub_81C3194: @ 81C3194 + push {lr} + sub sp, 0x8 + ldr r0, _081C31B8 + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081C31BC + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_081C31B8: .4byte 0x0861cccc +_081C31BC: .4byte 0x02021fc4 + thumb_func_end sub_81C3194 + + thumb_func_start sub_81C31C0 +sub_81C31C0: @ 81C31C0 + push {lr} + ldr r0, _081C31E4 + ldr r0, [r0] + ldr r1, _081C31E8 + adds r0, 0xA3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x2 + bl sub_81AFC0C + ldr r1, _081C31EC + movs r0, 0x5 + bl sub_81AFC0C + pop {r0} + bx r0 + .align 2, 0 +_081C31E4: .4byte 0x0203cf1c +_081C31E8: .4byte 0x0861cb50 +_081C31EC: .4byte 0x085ea3c0 + thumb_func_end sub_81C31C0 + + thumb_func_start sub_81C31F0 +sub_81C31F0: @ 81C31F0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081C321C + 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 decimal_int_to_string + movs r0, 0x3 + adds r1, r4, 0 + bl sub_81AFC0C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C321C: .4byte 0x0203cf1c + thumb_func_end sub_81C31F0 + + thumb_func_start sub_81C3220 +sub_81C3220: @ 81C3220 + push {r4-r6,lr} + ldr r0, _081C325C + ldr r0, [r0] + adds r6, r0, 0 + adds r6, 0x70 + ldr r1, [r0] + ldr r0, _081C3260 + cmp r1, r0 + bne _081C326C + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081C3264 + 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, _081C3268 + adds r2, 0x8 + adds r1, r2 + bl gf_strcpy + b _081C3282 + .align 2, 0 +_081C325C: .4byte 0x0203cf1c +_081C3260: .4byte 0x02024744 +_081C3264: .4byte 0x020229e8 +_081C3268: .4byte 0x02021cc4 +_081C326C: + bl sub_80F0020 + adds r4, r0, 0 + ldr r0, _081C32A8 + ands r4, r0 + ldr r0, _081C32AC + ldr r1, [r0] + ldrb r5, [r1, 0x8] + ldr r0, _081C32B0 + bl gf_strcpy +_081C3282: + adds r0, r6, 0 + adds r0, 0x32 + ldrb r0, [r0] + cmp r5, r0 + bne _081C32A4 + ldr r0, [r6, 0x48] + ldr r1, _081C32A8 + ands r0, r1 + cmp r4, r0 + bne _081C32A4 + ldr r0, _081C32B0 + adds r1, r6, 0 + adds r1, 0x36 + bl sub_80092BC + cmp r0, 0 + beq _081C32B4 +_081C32A4: + movs r0, 0 + b _081C32B6 + .align 2, 0 +_081C32A8: .4byte 0x0000ffff +_081C32AC: .4byte 0x03005d90 +_081C32B0: .4byte 0x02021cc4 +_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, _081C32D4 + 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 + .align 2, 0 +_081C32D4: .4byte 0x0203cf1c +_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, _081C32F8 + 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 + .align 2, 0 +_081C32F8: .4byte 0x0203cf1c +_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, _081C3340 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _081C3354 + ldr r0, _081C3344 + ldr r1, _081C3348 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C3354 + ldr r0, _081C334C + ldr r0, [r0] + ldr r1, _081C3350 + 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 + .align 2, 0 +_081C3340: .4byte 0x02022fec +_081C3344: .4byte 0x030022c0 +_081C3348: .4byte 0x00000439 +_081C334C: .4byte 0x0203cf1c +_081C3350: .4byte 0x000040be +_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, _081C33C0 + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _081C33C4 + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl font_get_width_of_string + 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, _081C33C8 + 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 + .align 2, 0 +_081C33C0: .4byte 0x0861cccc +_081C33C4: .4byte 0x085ea365 +_081C33C8: .4byte 0x085e8d38 + thumb_func_end sub_81C335C + + thumb_func_start sub_81C33CC +sub_81C33CC: @ 81C33CC + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, _081C3418 + ldr r1, _081C341C + adds r0, r5, 0 + bl gf_strcpy + ldr r1, _081C3420 + adds r0, r5, 0 + bl gf_strcat + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl sub_81DB368 + adds r4, r0, 0 + ldr r0, _081C3424 + 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 + .align 2, 0 +_081C3418: .4byte 0x02021cc4 +_081C341C: .4byte 0x085e8d59 +_081C3420: .4byte 0x085e8d38 +_081C3424: .4byte 0x0861cccc + thumb_func_end sub_81C33CC + + thumb_func_start sub_81C3428 +sub_81C3428: @ 81C3428 + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C3440 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x70 + adds r0, 0xA5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C3448 + ldr r4, _081C3444 + b _081C346C + .align 2, 0 +_081C3440: .4byte 0x0203cf1c +_081C3444: .4byte 0x085ea40b +_081C3448: + ldrh r0, [r1, 0x30] + cmp r0, 0x5 + bhi _081C3458 + ldr r4, _081C3454 + b _081C346C + .align 2, 0 +_081C3454: .4byte 0x085ea4a2 +_081C3458: + cmp r0, 0xA + bhi _081C3464 + ldr r4, _081C3460 + b _081C346C + .align 2, 0 +_081C3460: .4byte 0x085ea475 +_081C3464: + ldr r4, _081C3490 + cmp r0, 0x28 + bhi _081C346C + ldr r4, _081C3494 +_081C346C: + ldr r0, _081C3498 + 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 + .align 2, 0 +_081C3490: .4byte 0x085ea40b +_081C3494: .4byte 0x085ea442 +_081C3498: .4byte 0x0861cccc + thumb_func_end sub_81C3428 + + thumb_func_start sub_81C349C +sub_81C349C: @ 81C349C + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C34BC + 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, _081C34C0 + b _081C3502 + .align 2, 0 +_081C34BC: .4byte 0x0203cf1c +_081C34C0: .4byte 0x085ea678 +_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, _081C34DC + b _081C3502 + .align 2, 0 +_081C34DC: .4byte 0x085ea6ab +_081C34E0: + ldrb r0, [r4, 0x9] + cmp r0, 0xFD + bne _081C3500 + bl sub_81C32E0 + lsls r0, 24 + lsrs r0, 24 + ldr r4, _081C34F8 + cmp r0, 0x1 + bne _081C3502 + ldr r4, _081C34FC + b _081C3502 + .align 2, 0 +_081C34F8: .4byte 0x085ea702 +_081C34FC: .4byte 0x085ea6d7 +_081C3500: + ldr r4, _081C3528 +_081C3502: + ldr r0, _081C352C + 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 + .align 2, 0 +_081C3528: .4byte 0x085ea647 +_081C352C: .4byte 0x0861cccc + 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, _081C357C + 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, _081C3580 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C357C: .4byte 0x03005e08 +_081C3580: .4byte _081C3584 + .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, _081C3620 + 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, _081C3624 + 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 + .align 2, 0 +_081C3620: .4byte 0x0203cf1c +_081C3624: .4byte 0x000040be +_081C3628: + ldr r0, _081C363C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x9E + ldrh r0, [r1] + cmp r0, 0 + bne _081C3644 + ldr r5, _081C3640 + b _081C3650 + .align 2, 0 +_081C363C: .4byte 0x0203cf1c +_081C3640: .4byte 0x085e8d26 +_081C3644: + ldrh r0, [r1] + ldr r4, _081C3688 + adds r1, r4, 0 + bl itemid_get_name + adds r5, r4, 0 +_081C3650: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x48 + bl sub_81DB35C + adds r4, r0, 0 + adds r4, 0x6 + ldr r0, _081C368C + 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 + .align 2, 0 +_081C3688: .4byte 0x02021cc4 +_081C368C: .4byte 0x0861ccec + thumb_func_end sub_81C35E4 + + thumb_func_start sub_81C3690 +sub_81C3690: @ 81C3690 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, _081C36A8 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x76 + ldrb r0, [r1] + cmp r0, 0 + bne _081C36B0 + ldr r5, _081C36AC + b _081C36C8 + .align 2, 0 +_081C36A8: .4byte 0x0203cf1c +_081C36AC: .4byte 0x085e8d26 +_081C36B0: + ldr r0, _081C3700 + ldrb r1, [r1] + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081C3704 + ldr r1, _081C3708 + adds r0, r4, 0 + bl ExpandTextCodes + adds r5, r4, 0 +_081C36C8: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x46 + bl sub_81DB35C + adds r4, r0, 0 + adds r4, 0x6 + ldr r0, _081C370C + 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 + .align 2, 0 +_081C3700: .4byte 0x02021cc4 +_081C3704: .4byte 0x02021fc4 +_081C3708: .4byte 0x085ea3b4 +_081C370C: .4byte 0x0861ccec + 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 malloc + mov r9, r0 + movs r0, 0x8 + bl malloc + mov r8, r0 + movs r0, 0x8 + bl malloc + adds r6, r0, 0 + movs r0, 0x8 + bl malloc + adds r5, r0, 0 + ldr r4, _081C37CC + ldr r0, [r4] + adds r0, 0x90 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, [r4] + adds r0, 0x92 + ldrh r1, [r0] + mov r0, r8 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r0, [r4] + adds r0, 0x94 + ldrh r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x7 + bl decimal_int_to_string + ldr r0, [r4] + adds r0, 0x96 + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x7 + bl decimal_int_to_string + 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, _081C37D0 + ldr r1, _081C37D4 + 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 + .align 2, 0 +_081C37CC: .4byte 0x0203cf1c +_081C37D0: .4byte 0x02021fc4 +_081C37D4: .4byte 0x0861ce82 + thumb_func_end sub_81C3710 + + thumb_func_start sub_81C37D8 +sub_81C37D8: @ 81C37D8 + push {lr} + sub sp, 0x8 + ldr r0, _081C3800 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081C3804 + 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 + .align 2, 0 +_081C3800: .4byte 0x0861ccec +_081C3804: .4byte 0x02021fc4 + thumb_func_end sub_81C37D8 + + thumb_func_start sub_81C3808 +sub_81C3808: @ 81C3808 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _081C3878 + mov r8, r0 + ldr r4, _081C387C + ldr r0, [r4] + adds r0, 0x98 + ldrh r1, [r0] + mov r0, r8 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r6, _081C3880 + ldr r0, [r4] + adds r0, 0x9A + ldrh r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + ldr r5, _081C3884 + ldr r0, [r4] + adds r0, 0x9C + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + 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, _081C3888 + ldr r1, _081C388C + bl sub_81AFC28 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C3878: .4byte 0x02021cc4 +_081C387C: .4byte 0x0203cf1c +_081C3880: .4byte 0x02021dc4 +_081C3884: .4byte 0x02021ec4 +_081C3888: .4byte 0x02021fc4 +_081C388C: .4byte 0x0861ce8e + thumb_func_end sub_81C3808 + + thumb_func_start sub_81C3890 +sub_81C3890: @ 81C3890 + push {lr} + sub sp, 0x8 + ldr r0, _081C38B8 + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081C38BC + 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 + .align 2, 0 +_081C38B8: .4byte 0x0861ccec +_081C38BC: .4byte 0x02021fc4 + thumb_func_end sub_81C3890 + + thumb_func_start sub_81C38C0 +sub_81C38C0: @ 81C38C0 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, _081C3934 + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldr r0, _081C3938 + movs r1, 0x4 + bl sub_81C2D2C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _081C393C + ldr r1, [r5, 0x10] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x7 + bl decimal_int_to_string + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl sub_81DB368 + 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, _081C3940 + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 2 + ldr r3, _081C3944 + 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 + .align 2, 0 +_081C3934: .4byte 0x0203cf1c +_081C3938: .4byte 0x0861ccec +_081C393C: .4byte 0x02021cc4 +_081C3940: .4byte 0x0831f72c +_081C3944: .4byte 0x083203cc +_081C3948: + movs r1, 0 +_081C394A: + ldr r4, _081C3980 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x6 + bl decimal_int_to_string + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl sub_81DB368 + 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 + .align 2, 0 +_081C3980: .4byte 0x02021cc4 + 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, _081C39CC + ldr r0, [r4] + ldr r1, _081C39D0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C39EA + bl sub_81C3F44 + ldr r1, [r4] + ldr r0, _081C39D4 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081C39DC + ldr r0, _081C39D8 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081C39EA + bl sub_81C3E9C + b _081C39EA + .align 2, 0 +_081C39CC: .4byte 0x0203cf1c +_081C39D0: .4byte 0x000040bc +_081C39D4: .4byte 0x000040c6 +_081C39D8: .4byte 0x000040c4 +_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, _081C3A18 + 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, _081C3A1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C3A18: .4byte 0x03005e08 +_081C3A1C: .4byte _081C3A20 + .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, _081C3A74 + ldr r0, [r0] + ldr r1, _081C3A78 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + bl sub_81C3F44 + b _081C3AFC + .align 2, 0 +_081C3A74: .4byte 0x0203cf1c +_081C3A78: .4byte 0x000040bc +_081C3A7C: + ldr r0, _081C3AA0 + ldr r1, [r0] + ldr r2, _081C3AA4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + ldr r0, _081C3AA8 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081C3AB0 + ldr r2, _081C3AAC + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _081C3AFC + .align 2, 0 +_081C3AA0: .4byte 0x0203cf1c +_081C3AA4: .4byte 0x000040bc +_081C3AA8: .4byte 0x000040c6 +_081C3AAC: .4byte 0x000040c4 +_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, _081C3AE8 + ldr r1, [r0] + ldr r2, _081C3AEC + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, _081C3AF0 + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C3AFC + ldrh r0, [r4, 0x2] + bl sub_81C3E9C + b _081C3AFC + .align 2, 0 +_081C3AE8: .4byte 0x0203cf1c +_081C3AEC: .4byte 0x000040bc +_081C3AF0: .4byte 0x00ffffff +_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, _081C3BE4 + ldr r0, [r0] + mov r10, r0 + ldr r4, _081C3BE8 + 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 move_get_pp_info + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081C3BEC + 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, _081C3BF0 + mov r8, r0 + mov r5, r10 + adds r5, 0x8C + adds r5, r7 + ldrb r1, [r5] + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081C3BF4 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + bl sub_81AFBF0 + movs r0, 0 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, _081C3BF8 + ldr r1, _081C3BFC + 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 sub_81DB368 + mov r4, r9 + b _081C3C26 + .align 2, 0 +_081C3BE4: .4byte 0x0203cf1c +_081C3BE8: .4byte 0x0861cd14 +_081C3BEC: .4byte 0x0831977c +_081C3BF0: .4byte 0x02021cc4 +_081C3BF4: .4byte 0x02021dc4 +_081C3BF8: .4byte 0x02021fc4 +_081C3BFC: .4byte 0x0861ce97 +_081C3C00: + ldr r1, _081C3C54 + 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, _081C3C58 + movs r5, 0xC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x2C + bl sub_81DB35C +_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 + .align 2, 0 +_081C3C54: .4byte 0x085e8d40 +_081C3C58: .4byte 0x085e8d42 + 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 Window_FillPixelRect + ldr r2, _081C3C94 + 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, _081C3C98 + b _081C3CAC + .align 2, 0 +_081C3C94: .4byte 0x0831c898 +_081C3C98: .4byte 0x085e8d45 +_081C3C9C: + ldr r4, _081C3CD0 + ldrb r1, [r2, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + 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, _081C3CD4 + adds r0, r6, r5 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x3] + cmp r0, 0 + bne _081C3CDC + ldr r1, _081C3CD8 + b _081C3CEC + .align 2, 0 +_081C3CD0: .4byte 0x02021cc4 +_081C3CD4: .4byte 0x0831c898 +_081C3CD8: .4byte 0x085e8d45 +_081C3CDC: + ldr r4, _081C3D04 + ldrb r1, [r1, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + 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 + .align 2, 0 +_081C3D04: .4byte 0x02021cc4 + 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, _081C3D48 + ldr r0, [r4] + ldr r1, _081C3D4C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3D40 + bl sub_81C3F44 + ldr r0, [r4] + ldr r1, _081C3D50 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C3E2C +_081C3D40: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C3D48: .4byte 0x0203cf1c +_081C3D4C: .4byte 0x000040bc +_081C3D50: .4byte 0x000040c6 + 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, _081C3D7C + 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, _081C3D80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C3D7C: .4byte 0x03005e08 +_081C3D80: .4byte _081C3D84 + .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, _081C3DD4 + ldr r0, [r0] + ldr r1, _081C3DD8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3E20 + bl sub_81C3F44 + b _081C3E20 + .align 2, 0 +_081C3DD4: .4byte 0x0203cf1c +_081C3DD8: .4byte 0x000040bc +_081C3DDC: + ldr r0, _081C3E08 + ldr r2, [r0] + ldr r1, _081C3E0C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3E20 + adds r1, 0x8 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, _081C3E10 + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C3E20 + ldr r1, _081C3E14 + adds r0, r2, r1 + ldrb r0, [r0] + bl sub_81C3E2C + b _081C3E20 + .align 2, 0 +_081C3E08: .4byte 0x0203cf1c +_081C3E0C: .4byte 0x000040bc +_081C3E10: .4byte 0x00ffffff +_081C3E14: .4byte 0x000040c6 +_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, _081C3E40 + ldr r0, [r0] + ldr r1, _081C3E44 + b _081C3E50 + .align 2, 0 +_081C3E40: .4byte 0x0203cf1c +_081C3E44: .4byte 0x000040c4 +_081C3E48: + ldr r0, _081C3E8C + ldr r0, [r0] + lsls r1, 1 + adds r0, 0x84 +_081C3E50: + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0 + beq _081C3E82 + ldr r0, _081C3E90 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r3, _081C3E94 + ldr r2, _081C3E98 + 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 + .align 2, 0 +_081C3E8C: .4byte 0x0203cf1c +_081C3E90: .4byte 0x0861cd14 +_081C3E94: .4byte 0x08587c50 +_081C3E98: .4byte 0x0858c2b4 + 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, _081C3EF0 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl Window_FastFillPixels + cmp r4, 0 + beq _081C3F30 + ldr r0, _081C3EF4 + ldr r0, [r0] + ldr r1, _081C3EF8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C3F00 + adds r0, r4, 0 + bl sub_81C3C5C + ldr r1, _081C3EFC + 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 + .align 2, 0 +_081C3EF0: .4byte 0x0861cd14 +_081C3EF4: .4byte 0x0203cf1c +_081C3EF8: .4byte 0x000040c0 +_081C3EFC: .4byte 0x0861c524 +_081C3F00: + ldr r2, _081C3F28 + ldr r1, _081C3F2C + 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 Window_WriteStandardTileMap + b _081C3F36 + .align 2, 0 +_081C3F28: .4byte 0x08587c50 +_081C3F2C: .4byte 0x0858c2b4 +_081C3F30: + adds r0, r5, 0 + bl Window_FillTileMap +_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, _081C3F8C + 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, _081C3F90 + ldr r1, [r0] + ldr r2, _081C3F94 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0 + bne _081C3F9C + ldr r1, _081C3F98 + 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 + .align 2, 0 +_081C3F8C: .4byte 0x0861cd14 +_081C3F90: .4byte 0x0203cf1c +_081C3F94: .4byte 0x000040c4 +_081C3F98: .4byte 0x085e8cf0 +_081C3F9C: + ldrh r5, [r0] + ldr r2, _081C3FC8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C3FD0 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081C3FCC + 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 + .align 2, 0 +_081C3FC8: .4byte 0x000040c0 +_081C3FCC: .4byte 0x0831977c +_081C3FD0: + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, _081C4050 + 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, _081C4054 + ldr r1, _081C4058 + 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 decimal_int_to_string + 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, _081C405C + ldr r1, _081C4060 + adds r0, r4, 0 + bl sub_81AFC28 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2C + bl sub_81DB368 + 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 + .align 2, 0 +_081C4050: .4byte 0x0831977c +_081C4054: .4byte 0x02021cc4 +_081C4058: .4byte 0x0831c898 +_081C405C: .4byte 0x02021fc4 +_081C4060: .4byte 0x0861ce97 + thumb_func_end sub_81C3F44 + + thumb_func_start sub_81C4064 +sub_81C4064: @ 81C4064 + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C409C + 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 Window_FillPixelRect + adds r0, r4, 0 + movs r1, 0x2 + bl Window_CopyToVram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C409C: .4byte 0x0861cd14 + 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, _081C4150 + 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 Window_FillPixelRect + 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 Window_FillPixelRect + 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 Window_FillPixelRect + 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 Window_FillPixelRect + 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 + .align 2, 0 +_081C4150: .4byte 0x0861cd14 + thumb_func_end sub_81C40A0 + + thumb_func_start sub_81C4154 +sub_81C4154: @ 81C4154 + push {r4,lr} + sub sp, 0x8 + ldr r0, _081C4188 + movs r1, 0x2 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + ldr r1, _081C418C + 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 + .align 2, 0 +_081C4188: .4byte 0x0861cd14 +_081C418C: .4byte 0x085ea4cb + thumb_func_end sub_81C4154 + + thumb_func_start sub_81C4190 +sub_81C4190: @ 81C4190 + push {r4,r5,lr} + movs r2, 0 + ldr r5, _081C41B8 + ldr r4, _081C41BC + 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 + .align 2, 0 +_081C41B8: .4byte 0x0203cf1c +_081C41BC: .4byte 0x000040d3 + 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, _081C41F8 + ldr r0, [r5] + ldr r1, _081C41FC + 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, _081C4200 + adds r0, r1 + bl obj_delete_and_free_tiles + ldr r0, [r5] + ldr r1, _081C41FC + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_081C41F2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C41F8: .4byte 0x0203cf1c +_081C41FC: .4byte 0x000040d3 +_081C4200: .4byte 0x02020630 + 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, _081C4240 + ldr r2, _081C4244 + ldr r2, [r2] + ldr r4, _081C4248 + 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 + .align 2, 0 +_081C4240: .4byte 0x02020630 +_081C4244: .4byte 0x0203cf1c +_081C4248: .4byte 0x000040d3 + thumb_func_end sub_81C4204 + + thumb_func_start sub_81C424C +sub_81C424C: @ 81C424C + push {r4,lr} + movs r4, 0x3 +_081C4250: + ldr r0, _081C4278 + ldr r0, [r0] + ldr r1, _081C427C + 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 + .align 2, 0 +_081C4278: .4byte 0x0203cf1c +_081C427C: .4byte 0x000040d3 + thumb_func_end sub_81C424C + + thumb_func_start sub_81C4280 +sub_81C4280: @ 81C4280 + push {lr} + ldr r0, _081C429C + ldr r0, [r0] + ldr r1, _081C42A0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C42B0 + cmp r0, 0x2 + bgt _081C42A4 + cmp r0, 0 + beq _081C42AA + b _081C42C2 + .align 2, 0 +_081C429C: .4byte 0x0203cf1c +_081C42A0: .4byte 0x000040c0 +_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, _081C430C +_081C42CE: + ldr r0, [r5] + ldr r1, _081C4310 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C42F2 + ldr r0, _081C4314 + movs r1, 0 + movs r2, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + ldr r1, [r5] + ldr r2, _081C4310 + 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 + .align 2, 0 +_081C430C: .4byte 0x0203cf1c +_081C4310: .4byte 0x000040d3 +_081C4314: .4byte 0x0861cfc4 + 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, _081C4390 + ldr r0, [r0] + ldr r1, _081C4394 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, _081C4398 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + str r3, [sp] + bl obj_anim_image_start + ldr r0, _081C439C + 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 + .align 2, 0 +_081C4390: .4byte 0x0203cf1c +_081C4394: .4byte 0x000040d3 +_081C4398: .4byte 0x02020630 +_081C439C: .4byte 0x0861cfdc + thumb_func_end sub_81C4318 + + thumb_func_start sub_81C43A0 +sub_81C43A0: @ 81C43A0 + push {r4,r5,lr} + ldr r0, _081C43C8 + 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 + .align 2, 0 +_081C43C8: .4byte 0x0203cf1c +_081C43CC: + ldr r4, _081C440C + 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 + .align 2, 0 +_081C440C: .4byte 0x083203cc +_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, _081C4460 + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + movs r4, 0 + ldr r6, _081C4464 +_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 + .align 2, 0 +_081C4460: .4byte 0x0203cf1c +_081C4464: .4byte 0x0831c898 +_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, _081C44CC + 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, _081C44D0 + 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 + .align 2, 0 +_081C44CC: .4byte 0x0203cf1c +_081C44D0: .4byte 0x0858c2b4 +_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, _081C450C + ldr r1, [r0] + ldr r0, _081C4510 + adds r3, r1, r0 + ldrh r0, [r3] + cmp r0, 0 + bne _081C4514 + movs r0, 0x7 + movs r1, 0x1 + bl sub_81C4204 + b _081C4560 + .align 2, 0 +_081C450C: .4byte 0x0203cf1c +_081C4510: .4byte 0x000040c4 +_081C4514: + ldr r2, _081C4538 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C4540 + ldr r2, _081C453C + 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 + .align 2, 0 +_081C4538: .4byte 0x000040c0 +_081C453C: .4byte 0x0831c898 +_081C4540: + ldr r1, _081C4564 + 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 + .align 2, 0 +_081C4564: .4byte 0x0858c2b4 + 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, _081C45E8 + ldr r2, [r2] + adds r0, 0x3 + ldr r3, _081C45EC + adds r2, r3 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, _081C45F0 + 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 + .align 2, 0 +_081C45E8: .4byte 0x0203cf1c +_081C45EC: .4byte 0x000040d3 +_081C45F0: .4byte 0x02020630 + 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, _081C461C + 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 + .align 2, 0 +_081C461C: .4byte 0x0203cf1c +_081C4620: + ldr r0, _081C4654 + ldr r1, _081C4658 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C4680 + ldr r1, _081C465C + 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, _081C4660 + adds r0, r1 + ldr r1, _081C4664 + ldr r1, [r1] + ldr r1, [r1, 0x8] + b _081C46D6 + .align 2, 0 +_081C4654: .4byte 0x030022c0 +_081C4658: .4byte 0x00000439 +_081C465C: .4byte 0x000040be +_081C4660: .4byte 0x0830a18c +_081C4664: .4byte 0x020244d4 +_081C4668: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, _081C4678 + adds r0, r1 + ldr r1, _081C467C + ldr r1, [r1] + b _081C46B0 + .align 2, 0 +_081C4678: .4byte 0x0830a18c +_081C467C: .4byte 0x020244d4 +_081C4680: + ldr r0, _081C46BC + ldr r3, [r0] + adds r4, r0, 0 + cmp r3, 0 + beq _081C46E4 + ldr r1, [r2] + ldr r0, _081C46C0 + cmp r1, r0 + beq _081C46A6 + ldr r1, _081C46C4 + 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, _081C46C8 + adds r0, r1 + ldr r1, [r4] +_081C46B0: + ldr r1, [r1, 0x8] + ldr r3, [r5, 0xC] + bl help_system_enable_unless_flashback__sp199 + b _081C4768 + .align 2, 0 +_081C46BC: .4byte 0x020244d4 +_081C46C0: .4byte 0x020244ec +_081C46C4: .4byte 0x000040bc +_081C46C8: .4byte 0x0830a18c +_081C46CC: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, _081C46E0 + adds r0, r1 + ldr r1, [r3, 0x8] +_081C46D6: + ldr r3, [r5, 0xC] + bl sub_8034B50 + b _081C4768 + .align 2, 0 +_081C46E0: .4byte 0x0830a18c +_081C46E4: + ldr r1, [r2] + ldr r0, _081C4720 + cmp r1, r0 + beq _081C4700 + ldr r1, _081C4724 + 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, _081C4728 + 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 help_system_enable_unless_flashback__sp199 + b _081C4768 + .align 2, 0 +_081C4720: .4byte 0x020244ec +_081C4724: .4byte 0x000040bc +_081C4728: .4byte 0x0830a18c +_081C472C: + ldrh r4, [r5, 0x2] + lsls r4, 3 + ldr r0, _081C474C + 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 sub_8034B50 + b _081C4768 + .align 2, 0 +_081C474C: .4byte 0x0830a18c +_081C4750: + ldrh r0, [r5, 0x2] + ldr r1, [r5, 0x48] + ldr r2, [r5, 0xC] + bl sub_806E7CC + adds r4, r0, 0 + bl gpu_pal_obj_decompress_and_apply + 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, _081C47A0 + 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 + .align 2, 0 +_081C47A0: .4byte 0x0203cf1c +_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, _081C4818 + ldr r6, [r0] + adds r6, 0x70 + ldr r0, _081C481C + movs r1, 0x28 + movs r2, 0x40 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + ldr r5, _081C4820 + 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, _081C4824 + 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 + .align 2, 0 +_081C4818: .4byte 0x0203cf1c +_081C481C: .4byte 0x0202499c +_081C4820: .4byte 0x02020630 +_081C4824: .4byte sub_81C4844 + 1 +_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, _081C4884 + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldr r0, _081C4888 + 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 + .align 2, 0 +_081C4884: .4byte 0x0203cf1c +_081C4888: .4byte 0x02037fd4 + thumb_func_end sub_81C4844 + + thumb_func_start sub_81C488C +sub_81C488C: @ 81C488C + ldr r1, _081C4894 + strb r0, [r1] + bx lr + .align 2, 0 +_081C4894: .4byte 0x0203cf24 + thumb_func_end sub_81C488C + + thumb_func_start sub_81C4898 +sub_81C4898: @ 81C4898 + push {r4,lr} + ldr r4, _081C48B0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C48AA + bl remove_task + movs r0, 0xFF + strb r0, [r4] +_081C48AA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C48B0: .4byte 0x0203cf24 + thumb_func_end sub_81C4898 + + thumb_func_start sub_81C48B4 +sub_81C48B4: @ 81C48B4 + push {lr} + ldr r2, _081C48D8 + ldr r0, _081C48DC + ldr r0, [r0] + ldr r1, _081C48E0 + 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, _081C48E4 + cmp r1, r0 + beq _081C48E8 + movs r0, 0x1 + b _081C48EA + .align 2, 0 +_081C48D8: .4byte 0x02020630 +_081C48DC: .4byte 0x0203cf1c +_081C48E0: .4byte 0x000040d3 +_081C48E4: .4byte nullsub_12 + 1 +_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, _081C496C + ldr r5, _081C4970 + ldr r0, [r5] + ldr r4, _081C4974 + 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, _081C4978 + 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, _081C497C + ldr r4, _081C4980 +_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 + .align 2, 0 +_081C496C: .4byte 0x02020630 +_081C4970: .4byte 0x0203cf1c +_081C4974: .4byte 0x000040d3 +_081C4978: .4byte nullsub_12 + 1 +_081C497C: .4byte 0x02037714 +_081C4980: .4byte 0x02037b14 + thumb_func_end sub_81C48F0 + + thumb_func_start sub_81C4984 +sub_81C4984: @ 81C4984 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r1, _081C49D4 + ldr r2, _081C49D8 + adds r0, r1, 0 + bl sub_811FF94 + adds r4, r0, 0 + ldr r6, _081C49DC + 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 obj_anim_image_start + 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 + .align 2, 0 +_081C49D4: .4byte 0x00007533 +_081C49D8: .4byte 0x0861d120 +_081C49DC: .4byte 0x0203cf1c + thumb_func_end sub_81C4984 + + thumb_func_start sub_81C49E0 +sub_81C49E0: @ 81C49E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081C4A00 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl obj_delete_and_free_tiles + ldr r0, _081C4A04 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl sub_81C4984 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C4A00: .4byte 0x0203cf1c +_081C4A04: .4byte 0x00007533 + 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, _081C4A74 + adds r0, r1 + movs r1, 0x10 + movs r2, 0x88 + movs r3, 0 + bl obj_add_from_template_forward_search + ldr r2, _081C4A78 + ldr r1, [r2] + ldr r3, _081C4A7C + adds r1, r3 + strb r0, [r1] + ldr r4, _081C4A80 + 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, _081C4A84 + 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 + .align 2, 0 +_081C4A74: .4byte 0x0832c588 +_081C4A78: .4byte 0x0203cf1c +_081C4A7C: .4byte 0x000040d4 +_081C4A80: .4byte 0x02020630 +_081C4A84: .4byte nullsub_12 + 1 + thumb_func_end sub_81C4A08 + + thumb_func_start sub_81C4A88 +sub_81C4A88: @ 81C4A88 + push {r4,r5,lr} + ldr r5, _081C4AD8 + ldr r0, [r5] + ldr r1, _081C4ADC + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C4AA6 + ldr r0, _081C4AE0 + movs r1, 0x40 + movs r2, 0x98 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _081C4AE4 + adds r0, r1 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl obj_anim_image_start + movs r0, 0x2 + movs r1, 0 + bl sub_81C4204 + b _081C4AF0 + .align 2, 0 +_081C4AD8: .4byte 0x0203cf1c +_081C4ADC: .4byte 0x000040d5 +_081C4AE0: .4byte 0x0861d108 +_081C4AE4: .4byte 0x02020630 +_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, _081C4B60 + ldr r1, _081C4B64 + add r1, r8 + ldr r0, [r0] + adds r7, r0, r1 + ldr r1, _081C4B68 + 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, _081C4B6C + mov r10, r5 +_081C4B30: + lsls r1, r5, 20 + movs r0, 0xB2 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + ldr r0, _081C4B70 + movs r2, 0x28 + mov r3, r9 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + b _081C4B9A + .align 2, 0 +_081C4B60: .4byte 0x0203cf1c +_081C4B64: .4byte 0x000040d3 +_081C4B68: .4byte 0x000040c0 +_081C4B6C: .4byte 0x02020630 +_081C4B70: .4byte 0x0861d084 +_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 obj_anim_image_start + b _081C4B9A +_081C4B8A: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl obj_anim_image_start +_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, _081C4BE0 + 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 + .align 2, 0 +_081C4BE0: .4byte sub_81C4BE4 + 1 + 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, _081C4C3C + ldr r0, [r0] + ldr r1, _081C4C40 + b _081C4C4A + .align 2, 0 +_081C4C3C: .4byte 0x0203cf1c +_081C4C40: .4byte 0x000040c6 +_081C4C44: + ldr r0, _081C4C58 + ldr r0, [r0] + ldr r1, _081C4C5C +_081C4C4A: + adds r0, r1 + ldrb r0, [r0] + lsls r0, 4 + strh r0, [r3, 0x26] + pop {r0} + bx r0 + .align 2, 0 +_081C4C58: .4byte 0x0203cf1c +_081C4C5C: .4byte 0x000040c7 + 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, _081C4CC8 + ldr r0, [r0] + ldr r1, _081C4CCC + adds r5, r0, r1 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 24 + movs r4, 0 + ldr r7, _081C4CD0 + 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 + .align 2, 0 +_081C4CC8: .4byte 0x0203cf1c +_081C4CCC: .4byte 0x000040db +_081C4CD0: .4byte 0x02020630 +_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 obj_anim_image_start + 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 obj_anim_image_start +_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, _081C4D64 + ldr r2, _081C4D68 + adds r0, r2 + ldr r1, [r1] + adds r5, r1, r0 + movs r3, 0 + ldr r4, _081C4D6C + 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 + .align 2, 0 +_081C4D64: .4byte 0x0203cf1c +_081C4D68: .4byte 0x000040d3 +_081C4D6C: .4byte 0x02020630 + 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, _081C4DD0 + movs r0, 0x4 + bl malloc + 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 gpu_bg_config_set_field + ldr r3, [r5] + lsls r0, r3, 30 + lsrs r0, 30 + ldr r1, _081C4DD4 + 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, _081C4DD8 + 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 + .align 2, 0 +_081C4DD0: .4byte 0x0203cf28 +_081C4DD4: .4byte 0x0861d1a0 +_081C4DD8: .4byte 0x0861def4 +_081C4DDC: + lsls r0, r1, 30 + lsrs r0, 30 + movs r1, 0x8 + movs r2, 0x2 + bl gpu_bg_config_set_field + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x9 + movs r2, 0x1 + bl gpu_bg_config_set_field + ldr r3, [r5] + lsls r0, r3, 30 + lsrs r0, 30 + ldr r1, _081C4E78 + 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, _081C4E7C + 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 bg_change_x_offset + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x4 + movs r2, 0x1 + bl gpu_bg_config_set_field + ldr r0, _081C4E80 + ldr r1, _081C4E84 + ldr r2, _081C4E88 + bl CpuSet + ldr r0, _081C4E8C + 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 + .align 2, 0 +_081C4E78: .4byte 0x0861e208 +_081C4E7C: .4byte 0x0861ef64 +_081C4E80: .4byte 0x0861d140 +_081C4E84: .4byte 0x020377f4 +_081C4E88: .4byte 0x04000018 +_081C4E8C: .4byte 0x0203cf28 + 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, _081C4EB0 + ldr r0, [r0] + ldrb r0, [r0] + bl gpu_sync_bg_show + movs r0, 0 +_081C4EAC: + pop {r1} + bx r1 + .align 2, 0 +_081C4EB0: .4byte 0x0203cf28 + thumb_func_end sub_81C4E90 + + thumb_func_start sub_81C4EB4 +sub_81C4EB4: @ 81C4EB4 + push {r4,lr} + ldr r4, _081C4ECC + ldr r0, [r4] + cmp r0, 0 + beq _081C4EC6 + bl free + movs r0, 0 + str r0, [r4] +_081C4EC6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C4ECC: .4byte 0x0203cf28 + thumb_func_end sub_81C4EB4 + + thumb_func_start sub_81C4ED0 +sub_81C4ED0: @ 81C4ED0 + push {lr} + adds r1, r0, 0 + ldr r0, _081C4EE8 + ldr r0, [r0] + ldrb r0, [r0] + lsls r1, 8 + movs r2, 0 + bl bg_change_y_offset + pop {r0} + bx r0 + .align 2, 0 +_081C4EE8: .4byte 0x0203cf28 + thumb_func_end sub_81C4ED0 + + thumb_func_start sub_81C4EEC +sub_81C4EEC: @ 81C4EEC + ldr r1, _081C4EF8 + movs r0, 0 + strh r0, [r1, 0x6] + strh r0, [r1, 0x8] + bx lr + .align 2, 0 +_081C4EF8: .4byte 0x0203cf30 + thumb_func_end sub_81C4EEC + + thumb_func_start sub_81C4EFC +sub_81C4EFC: @ 81C4EFC + push {lr} + ldr r1, _081C4F0C + movs r0, 0 + bl sub_81C4F98 + pop {r0} + bx r0 + .align 2, 0 +_081C4F0C: .4byte sub_8086194 + 1 + thumb_func_end sub_81C4EFC + + thumb_func_start sub_81C4F10 +sub_81C4F10: @ 81C4F10 + push {lr} + ldr r1, _081C4F20 + movs r0, 0x1 + bl sub_81C4F98 + pop {r0} + bx r0 + .align 2, 0 +_081C4F20: .4byte sub_8059D50 + 1 + 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, _081C4F40 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081C4F40: .4byte sub_81C4F44 + 1 + 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, _081C4F74 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C4F6E + bl overworld_free_bg_tilemaps + ldr r0, _081C4F78 + ldr r1, _081C4F7C + str r1, [r0] + ldr r1, _081C4F80 + movs r0, 0x3 + bl sub_81C4F98 + adds r0, r4, 0 + bl remove_task +_081C4F6E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C4F74: .4byte 0x02037fd4 +_081C4F78: .4byte 0x03005db0 +_081C4F7C: .4byte hm_add_c3_without_phase_2 + 1 +_081C4F80: .4byte c2_exit_to_overworld_2_switch + 1 + thumb_func_end sub_81C4F44 + + thumb_func_start sub_81C4F84 +sub_81C4F84: @ 81C4F84 + push {lr} + ldr r0, _081C4F94 + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 + pop {r0} + bx r0 + .align 2, 0 +_081C4F94: .4byte 0x0203cf30 + 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, _081C4FFC + ldr r0, _081C5000 + bl malloc_and_clear + str r0, [r6] + cmp r4, 0x4 + beq _081C4FB2 + ldr r0, _081C5004 + strb r4, [r0, 0x4] +_081C4FB2: + cmp r5, 0 + beq _081C4FBA + ldr r0, _081C5004 + str r5, [r0] +_081C4FBA: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, _081C5008 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, _081C500C + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, _081C5010 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xB + bl memset + ldr r0, [r6] + ldr r1, _081C5014 + adds r0, r1 + movs r1, 0xFF + movs r2, 0x5 + bl memset + ldr r0, _081C5018 + bl set_callback2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C4FFC: .4byte 0x0203cf2c +_081C5000: .4byte 0x0000098c +_081C5004: .4byte 0x0203cf30 +_081C5008: .4byte 0x00000814 +_081C500C: .4byte 0x00000816 +_081C5010: .4byte 0x00000804 +_081C5014: .4byte 0x0000080f +_081C5018: .4byte sub_81C504C + 1 + thumb_func_end sub_81C4F98 + + thumb_func_start sub_81C501C +sub_81C501C: @ 81C501C + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _081C5098 + 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, _081C509C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C5098: .4byte 0x030022c0 +_081C509C: .4byte _081C50A0 + .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 vblank_hblank_handler_set_zero + bl clear_scheduled_bg_copies_to_vram + b _081C51A2 +_081C50EE: + bl remove_some_task + b _081C51A2 +_081C50F4: + bl gpu_pal_allocator_reset + b _081C51A2 +_081C50FA: + bl sub_80A1A74 + ldr r2, _081C5108 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _081C51A0 + .align 2, 0 +_081C5108: .4byte 0x02037fd4 +_081C510C: + bl reset_all_obj_data + 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, _081C5134 + ldr r0, [r0] + ldr r1, _081C5138 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081C51A2 + .align 2, 0 +_081C5134: .4byte 0x0203cf2c +_081C5138: .4byte 0x00000984 +_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 sub_80A1AD4 + ldr r2, _081C51B4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_081C51A0: + strb r0, [r2, 0x8] +_081C51A2: + ldr r1, _081C51B8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081C51D4 + .align 2, 0 +_081C51B4: .4byte 0x02037fd4 +_081C51B8: .4byte 0x030022c0 +_081C51BC: + ldr r0, _081C51CC + bl SetVBlankCallback + ldr r0, _081C51D0 + bl set_callback2 + movs r0, 0x1 + b _081C51D6 + .align 2, 0 +_081C51CC: .4byte sub_81C5038 + 1 +_081C51D0: .4byte sub_81C501C + 1 +_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 gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081C5230 + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r0, _081C5234 + ldr r1, [r0] + adds r1, 0x4 + movs r0, 0x2 + bl bg_set_tilemap + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r0} + bx r0 + .align 2, 0 +_081C5230: .4byte 0x0861f2b4 +_081C5234: .4byte 0x0203cf2c + thumb_func_end sub_81C51DC + + thumb_func_start sub_81C5238 +sub_81C5238: @ 81C5238 + push {r4,lr} + sub sp, 0x4 + ldr r4, _081C5258 + ldr r0, [r4] + ldr r1, _081C525C + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bhi _081C52F0 + lsls r0, 2 + ldr r1, _081C5260 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C5258: .4byte 0x0203cf2c +_081C525C: .4byte 0x00000984 +_081C5260: .4byte _081C5264 + .align 2, 0 +_081C5264: + .4byte _081C5278 + .4byte _081C5294 + .4byte _081C52B8 + .4byte _081C52C8 + .4byte _081C52D4 +_081C5278: + bl reset_temp_tile_data_buffers + ldr r1, _081C5290 + 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 + .align 2, 0 +_081C5290: .4byte 0x08d9a620 +_081C5294: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5308 + ldr r0, _081C52B0 + ldr r4, _081C52B4 + ldr r1, [r4] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r1, [r4] + b _081C52DC + .align 2, 0 +_081C52B0: .4byte 0x08d9ae04 +_081C52B4: .4byte 0x0203cf2c +_081C52B8: + ldr r0, _081C52C4 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + b _081C52D8 + .align 2, 0 +_081C52C4: .4byte 0x08d9af44 +_081C52C8: + ldr r0, _081C52D0 + bl gpu_tile_obj_decompress_and_load + b _081C52D8 + .align 2, 0 +_081C52D0: .4byte 0x0861f3cc +_081C52D4: + bl sub_81C6E98 +_081C52D8: + ldr r0, _081C52E8 + ldr r1, [r0] +_081C52DC: + ldr r0, _081C52EC + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081C5308 + .align 2, 0 +_081C52E8: .4byte 0x0203cf2c +_081C52EC: .4byte 0x00000984 +_081C52F0: + bl sub_8122328 + ldr r0, [r4] + ldr r1, _081C5304 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081C530A + .align 2, 0 +_081C5304: .4byte 0x00000984 +_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, _081C53DC + ldr r2, [r0] + ldr r1, _081C53E0 + 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, _081C53E4 + adds r0, r3 + adds r7, r2, r0 + movs r6, 0 + ldr r1, _081C53E8 + ldr r0, [r1] + ldr r4, _081C53EC + 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, _081C53F0 + 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, _081C53F4 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + ldr r4, _081C53F8 + adds r0, r1, r4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _081C53EC + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _081C5344 +_081C5382: + ldr r5, _081C53E8 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r1, _081C53F0 + adds r4, r1 + ldr r0, [r5] + adds r0, r4 + ldr r1, _081C53FC + bl gf_strcpy + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, _081C53F4 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + ldr r4, _081C53F8 + adds r1, r4 + adds r1, r2 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + ldr r2, _081C5400 + adds r1, r2, 0 + ldr r0, _081C5404 + 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, _081C53EC + adds r0, r1, r6 + ldrb r0, [r0] + strh r0, [r2, 0xC] + adds r3, r1, r3 + str r3, [r2] + ldr r7, _081C5408 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C53DC: .4byte 0x03005d90 +_081C53E0: .4byte 0x00000ca9 +_081C53E4: .4byte 0x00000e2c +_081C53E8: .4byte 0x0203cf2c +_081C53EC: .4byte 0x00000821 +_081C53F0: .4byte 0x0000087c +_081C53F4: .4byte 0x00000824 +_081C53F8: .4byte 0x00000828 +_081C53FC: .4byte 0x085e8db4 +_081C5400: .4byte 0x03006310 +_081C5404: .4byte 0x0861f2c0 +_081C5408: .4byte 0x00000822 + 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, _081C5444 + adds r1, r4, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r1, _081C5448 + adds r0, r4, 0 + bl itemid_get_name + ldr r1, _081C544C + adds r0, r5, 0 + bl ExpandTextCodes + b _081C5458 + .align 2, 0 +_081C5444: .4byte 0x02021cc4 +_081C5448: .4byte 0x02021dc4 +_081C544C: .4byte 0x085e9210 +_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, _081C54C8 + ldr r1, [r5] + ldr r2, _081C54CC + 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, _081C54D0 + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, _081C54D4 + 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, _081C54D8 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + ldr r1, [r5] + ldr r2, _081C54DC + adds r1, r2 + ldrb r1, [r1] + bl sub_81C6F90 + b _081C54EE + .align 2, 0 +_081C54C8: .4byte 0x0203cf2c +_081C54CC: .4byte 0x00000814 +_081C54D0: .4byte 0x03005d90 +_081C54D4: .4byte 0x00000ca9 +_081C54D8: .4byte 0x00000e2c +_081C54DC: .4byte 0x00000815 +_081C54E0: + ldr r0, _081C550C + ldr r1, [r5] + ldr r2, _081C5510 + adds r1, r2 + ldrb r1, [r1] + bl sub_81C6F90 +_081C54EE: + ldr r0, _081C5514 + ldr r1, [r0] + ldr r0, _081C5510 + 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 + .align 2, 0 +_081C550C: .4byte 0x0000ffff +_081C5510: .4byte 0x00000815 +_081C5514: .4byte 0x0203cf2c + 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, _081C5550 + ldr r0, [r0] + ldr r1, _081C5554 + 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 + .align 2, 0 +_081C5550: .4byte 0x0203cf2c +_081C5554: .4byte 0x00000814 +_081C5558: + adds r0, r5, 0 + movs r1, 0xFF + bl sub_81C5AB8 +_081C5560: + ldr r0, _081C55C0 + ldr r1, _081C55C4 + ldr r3, [r1] + ldr r2, _081C55C8 + 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, _081C55CC + adds r3, r2 + adds r3, r1 + ldrb r1, [r3] + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081C55D0 + ldr r1, _081C55D4 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl sub_81DB368 + 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 + .align 2, 0 +_081C55C0: .4byte 0x02021cc4 +_081C55C4: .4byte 0x03005d90 +_081C55C8: .4byte 0x00000ca9 +_081C55CC: .4byte 0x00000e54 +_081C55D0: .4byte 0x02021fc4 +_081C55D4: .4byte 0x085e8da0 + 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, _081C5610 + ldr r2, [r0] + lsls r3, 1 + ldr r1, _081C5614 + 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, _081C5618 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + bl itemid_get_description + adds r4, r0, 0 + b _081C5638 + .align 2, 0 +_081C5610: .4byte 0x03005d90 +_081C5614: .4byte 0x00000ca9 +_081C5618: .4byte 0x00000e2c +_081C561C: + ldr r0, _081C5660 + ldr r2, _081C5664 + ldr r1, _081C5668 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl gf_strcpy + ldr r4, _081C566C + ldr r1, _081C5670 + adds r0, r4, 0 + bl ExpandTextCodes +_081C5638: + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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 + .align 2, 0 +_081C5660: .4byte 0x02021cc4 +_081C5664: .4byte 0x085e91b0 +_081C5668: .4byte 0x0203cf30 +_081C566C: .4byte 0x02021fc4 +_081C5670: .4byte 0x085e91c0 + thumb_func_end sub_81C55D8 + + thumb_func_start sub_81C5674 +sub_81C5674: @ 81C5674 + push {r4,lr} + sub sp, 0x10 + ldr r4, _081C56BC + ldr r1, [r4] + ldr r2, _081C56C0 + 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, _081C56C4 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, _081C56C8 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl sub_81AF4A0 + ldr r1, [r4] + ldr r2, _081C56C0 + adds r1, r2 + strb r0, [r1] +_081C56B4: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C56BC: .4byte 0x0203cf2c +_081C56C0: .4byte 0x00000816 +_081C56C4: .4byte 0x00000b5e +_081C56C8: .4byte 0x0203cf38 + thumb_func_end sub_81C5674 + + thumb_func_start sub_81C56CC +sub_81C56CC: @ 81C56CC + push {r4,lr} + ldr r4, _081C56F0 + ldr r0, [r4] + ldr r2, _081C56F4 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C56EA + bl sub_81AF620 + ldr r0, [r4] + ldr r1, _081C56F4 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081C56EA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C56F0: .4byte 0x0203cf2c +_081C56F4: .4byte 0x00000816 + thumb_func_end sub_81C56CC + + thumb_func_start sub_81C56F8 +sub_81C56F8: @ 81C56F8 + push {r4,lr} + ldr r0, _081C5728 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081C572C + adds r4, r0 + ldr r0, _081C5730 + ldr r2, _081C5734 + ldrh r1, [r2, 0x8] + ldrh r2, [r2, 0x6] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C5728: .4byte sub_81C5BC8 + 1 +_081C572C: .4byte 0x03005e08 +_081C5730: .4byte 0x03006310 +_081C5734: .4byte 0x0203cf30 + 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, _081C5798 + ldr r6, [r2] + ldr r3, _081C579C + 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, _081C57A0 + adds r4, r2 + adds r4, r6, r4 + lsrs r3, 30 + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 1 + ldr r3, _081C57A4 + 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 + .align 2, 0 +_081C5798: .4byte 0x03005d90 +_081C579C: .4byte 0x00000ca9 +_081C57A0: .4byte 0x00000e2c +_081C57A4: .4byte 0x00000e54 + 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, _081C5820 + ldr r3, [r0] + ldr r1, _081C5824 + 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, _081C5828 + adds r0, r2 + adds r6, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, _081C582C + 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 + .align 2, 0 +_081C5820: .4byte 0x03005d90 +_081C5824: .4byte 0x00000ca9 +_081C5828: .4byte 0x00000e2c +_081C582C: .4byte 0x00000e54 +_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, _081C5914 + ldr r3, [r0] + ldr r1, _081C5918 + 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, _081C591C + adds r0, r2 + adds r0, r3 + mov r9, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r4, _081C5920 + 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 + .align 2, 0 +_081C5914: .4byte 0x03005d90 +_081C5918: .4byte 0x00000ca9 +_081C591C: .4byte 0x00000e2c +_081C5920: .4byte 0x00000e54 + thumb_func_end sub_81C586C + + thumb_func_start sub_81C5924 +sub_81C5924: @ 81C5924 + push {r4-r6,lr} + ldr r0, _081C5994 + ldr r2, [r0] + ldr r1, _081C5998 + 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, _081C599C + adds r0, r1 + adds r5, r2, r0 + bl sub_81C586C + ldr r3, _081C59A0 + ldr r0, [r3] + ldr r2, _081C59A4 + 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, _081C59A0 + 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, _081C59A4 + 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, _081C59A8 + adds r1, r0, r2 + movs r0, 0x8 + strb r0, [r1] + b _081C59B2 + .align 2, 0 +_081C5994: .4byte 0x03005d90 +_081C5998: .4byte 0x00000ca9 +_081C599C: .4byte 0x00000e2c +_081C59A0: .4byte 0x0203cf2c +_081C59A4: .4byte 0x00000821 +_081C59A8: .4byte 0x00000822 +_081C59AC: + ldr r1, _081C59B8 + adds r0, r1 + strb r2, [r0] +_081C59B2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C59B8: .4byte 0x00000822 + thumb_func_end sub_81C5924 + + thumb_func_start sub_81C59BC +sub_81C59BC: @ 81C59BC + push {r4,r5,lr} + ldr r0, _081C5A04 + ldrh r1, [r0, 0x8] + adds r3, r0, 0 + ldr r4, _081C5A08 + cmp r1, 0 + beq _081C59E4 + ldrh r0, [r3, 0x8] + ldr r1, [r4] + ldr r5, _081C5A0C + 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, _081C5A10 + 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 + .align 2, 0 +_081C5A04: .4byte 0x0203cf30 +_081C5A08: .4byte 0x0203cf2c +_081C5A0C: .4byte 0x00000822 +_081C5A10: .4byte 0x00000821 +_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, _081C5A88 + 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, _081C5A8C + ldr r0, [r6] + ldr r3, _081C5A90 + adds r1, r0, r3 + ldrb r1, [r1] + adds r2, r1 + ldr r7, _081C5A94 + 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, _081C5A90 + adds r0, r1, r7 + ldrb r0, [r0] + adds r2, r0 + ldr r0, _081C5A94 + adds r1, r0 + ldrb r1, [r1] + cmp r2, r1 + bne _081C5A50 +_081C5A80: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C5A88: .4byte 0x0203cf30 +_081C5A8C: .4byte 0x0203cf2c +_081C5A90: .4byte 0x00000822 +_081C5A94: .4byte 0x00000821 + 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 sub_81AE88C + 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 sub_8006460 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8006460 + 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 Window_FillPixelRect + b _081C5B08 +_081C5AF4: + ldr r1, _081C5B10 + 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 + .align 2, 0 +_081C5B10: .4byte 0x085e8d60 + 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 sub_80A1AD4 + ldr r1, _081C5B44 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C5B48 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C5B44: .4byte 0x03005e00 +_081C5B48: .4byte sub_81C5B4C + 1 + 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, _081C5B84 + adds r2, r0, r1 + ldr r0, _081C5B88 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C5BBC + ldrb r0, [r2] + ldr r4, _081C5B8C + subs r2, r4, 0x2 + adds r1, r4, 0 + bl sub_81AE6C8 + ldr r0, _081C5B90 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081C5B94 + bl set_callback2 + b _081C5B9E + .align 2, 0 +_081C5B84: .4byte 0x03005e08 +_081C5B88: .4byte 0x02037fd4 +_081C5B8C: .4byte 0x0203cf38 +_081C5B90: .4byte 0x0203cf2c +_081C5B94: + adds r0, r4, 0 + subs r0, 0x8 + ldr r0, [r0] + bl set_callback2 +_081C5B9E: + bl sub_81C56CC + bl reset_all_obj_data + bl gpu_pal_allocator_reset + bl Window_FreeMemory + ldr r0, _081C5BC4 + ldr r0, [r0] + bl free + adds r0, r5, 0 + bl remove_task +_081C5BBC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C5BC4: .4byte 0x0203cf2c + 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, _081C5C44 + adds r7, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C5BEA + b _081C5D16 +_081C5BEA: + ldr r0, _081C5C48 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C5BF8 + b _081C5D16 +_081C5BF8: + ldr r0, _081C5C4C + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081C5C5C + ldr r4, _081C5C50 + 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, _081C5C54 + ldr r0, [r0] + ldr r2, _081C5C58 + 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 + .align 2, 0 +_081C5C44: .4byte 0x03005e08 +_081C5C48: .4byte 0x02037fd4 +_081C5C4C: .4byte 0x030022c0 +_081C5C50: .4byte 0x0203cf30 +_081C5C54: .4byte 0x0203cf2c +_081C5C58: .4byte 0x00000821 +_081C5C5C: + ldrb r0, [r7] + bl sub_81AE604 + adds r6, r0, 0 + ldrb r0, [r7] + ldr r1, _081C5C84 + 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 + .align 2, 0 +_081C5C84: .4byte 0x0203cf38 +_081C5C88: + movs r0, 0x5 + bl audio_play + ldr r0, _081C5C9C + strh r4, [r0] + adds r0, r5, 0 + bl sub_81C5B14 + b _081C5D16 + .align 2, 0 +_081C5C9C: .4byte 0x0203ce7c +_081C5CA0: + movs r0, 0x5 + bl audio_play + ldr r2, _081C5CFC + mov r12, r2 + ldr r0, _081C5D00 + ldr r2, [r0] + lsls r3, r6, 1 + ldr r0, _081C5D04 + 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, _081C5D08 + 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, _081C5D0C + 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 + .align 2, 0 +_081C5CFC: .4byte 0x0203ce7c +_081C5D00: .4byte 0x03005d90 +_081C5D04: .4byte 0x00000ca9 +_081C5D08: .4byte 0x00000e2c +_081C5D0C: .4byte 0x00000e54 +_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, _081C5D60 + adds r4, r0 + bl sub_81C56CC + ldrb r0, [r4] + movs r1, 0x1 + bl sub_81C5A98 + ldr r0, _081C5D64 + ldrb r4, [r0, 0x4] + cmp r4, 0x1 + beq _081C5D74 + cmp r4, 0x3 + beq _081C5DC4 + ldr r0, _081C5D68 + ldr r1, [r0] + ldr r0, _081C5D6C + adds r2, r1, r0 + ldr r0, _081C5D70 + str r0, [r2] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + movs r0, 0x4 + b _081C5DD8 + .align 2, 0 +_081C5D60: .4byte 0x03005e08 +_081C5D64: .4byte 0x0203cf30 +_081C5D68: .4byte 0x0203cf2c +_081C5D6C: .4byte 0x00000818 +_081C5D70: .4byte 0x0861f308 +_081C5D74: + ldr r0, _081C5D90 + ldrh r0, [r0] + bl itemid_get_usage + lsls r0, 24 + cmp r0, 0 + beq _081C5DA0 + ldr r0, _081C5D94 + ldr r1, [r0] + ldr r0, _081C5D98 + adds r2, r1, r0 + ldr r0, _081C5D9C + b _081C5DCE + .align 2, 0 +_081C5D90: .4byte 0x0203ce7c +_081C5D94: .4byte 0x0203cf2c +_081C5D98: .4byte 0x00000818 +_081C5D9C: .4byte 0x0861f30e +_081C5DA0: + ldr r0, _081C5DB8 + ldr r0, [r0] + ldr r1, _081C5DBC + adds r2, r0, r1 + ldr r1, _081C5DC0 + str r1, [r2] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + strb r4, [r0] + b _081C5DDA + .align 2, 0 +_081C5DB8: .4byte 0x0203cf2c +_081C5DBC: .4byte 0x00000818 +_081C5DC0: .4byte 0x0861f310 +_081C5DC4: + ldr r0, _081C5E20 + ldr r1, [r0] + ldr r0, _081C5E24 + adds r2, r1, r0 + ldr r0, _081C5E28 +_081C5DCE: + str r0, [r2] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + movs r0, 0x2 +_081C5DD8: + strb r0, [r1] +_081C5DDA: + ldr r0, _081C5E2C + ldrh r0, [r0] + ldr r1, _081C5E30 + bl itemid_get_name + ldr r4, _081C5E34 + ldr r1, _081C5E38 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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, _081C5E20 + 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 + .align 2, 0 +_081C5E20: .4byte 0x0203cf2c +_081C5E24: .4byte 0x00000818 +_081C5E28: .4byte 0x0861f30c +_081C5E2C: .4byte 0x0203ce7c +_081C5E30: .4byte 0x02021cc4 +_081C5E34: .4byte 0x02021fc4 +_081C5E38: .4byte 0x085e8dbe +_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, _081C5E80 + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bne _081C5E8C + ldr r0, _081C5E84 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081C5E88 + b _081C5E98 + .align 2, 0 +_081C5E80: .4byte 0x0203cf2c +_081C5E84: .4byte 0x03005e00 +_081C5E88: .4byte sub_81C5FE4 + 1 +_081C5E8C: + ldr r0, _081C5EA4 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, _081C5EA8 +_081C5E98: + str r0, [r1] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C5EA4: .4byte 0x03005e00 +_081C5EA8: .4byte sub_81C5F68 + 1 + 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, _081C5EFC + ldr r1, [r6] + movs r5, 0x82 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, _081C5F00 + str r0, [sp, 0xC] + ldr r0, _081C5F04 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_81988A4 + 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 + .align 2, 0 +_081C5EFC: .4byte 0x0203cf2c +_081C5F00: .4byte 0x0861f2d8 +_081C5F04: .4byte 0x00000818 + 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, _081C5F5C + str r0, [sp, 0xC] + ldr r0, _081C5F60 + ldr r0, [r0] + ldr r1, _081C5F64 + 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 + .align 2, 0 +_081C5F5C: .4byte 0x0861f2d8 +_081C5F60: .4byte 0x0203cf2c +_081C5F64: .4byte 0x00000818 + 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, _081C5FA4 + ldr r1, [r0, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + b _081C5FD0 + .align 2, 0 +_081C5FA4: .4byte 0x0861f2d8 +_081C5FA8: + movs r0, 0x5 + bl audio_play + ldr r1, _081C5FD8 + ldr r0, _081C5FDC + ldr r0, [r0] + ldr r2, _081C5FE0 + 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 + .align 2, 0 +_081C5FD8: .4byte 0x0861f2d8 +_081C5FDC: .4byte 0x0203cf2c +_081C5FE0: .4byte 0x00000818 + 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, _081C603C + 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 + .align 2, 0 +_081C603C: .4byte 0x030022c0 +_081C6040: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C6084 + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, _081C6080 + 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 + .align 2, 0 +_081C6080: .4byte 0x0203cf2c +_081C6084: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C6098 + bl sub_81220D0 + 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 sub_81220D0 + 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, _081C613C + ldr r0, _081C6140 + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + ldr r3, _081C6144 + 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 + .align 2, 0 +_081C613C: .4byte 0x0861f2d8 +_081C6140: .4byte 0x0203cf2c +_081C6144: .4byte 0x00000818 +_081C6148: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl audio_play + ldr r0, _081C6168 + ldr r1, [r0, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 +_081C6160: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C6168: .4byte 0x0861f2d8 + 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, _081C6198 + ldr r2, [r0] + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081C61A0 + ldr r3, _081C619C + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + beq _081C61A0 + movs r0, 0x1 + b _081C61A2 + .align 2, 0 +_081C6198: .4byte 0x0203cf2c +_081C619C: .4byte 0x00000818 +_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, _081C61C4 + 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 + .align 2, 0 +_081C61C4: .4byte 0x0203cf2c +_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, _081C621C + 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, _081C6220 + ldr r2, _081C6224 + adds r0, r5, 0 + bl sub_81C6DD8 + b _081C6252 + .align 2, 0 +_081C621C: .4byte 0x0203ce7c +_081C6220: .4byte 0x085e8f31 +_081C6224: .4byte sub_81C6714 + 1 +_081C6228: + ldrh r0, [r4] + bl itemid_get_overworld_function + cmp r0, 0 + beq _081C6252 + bl sub_81C61A8 + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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, _081C6298 + 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 + .align 2, 0 +_081C6298: .4byte 0x03005e08 + 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, _081C62BC + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081C62C0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C62BC: .4byte 0x03005e00 +_081C62C0: .4byte sub_81C5BC8 + 1 + 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, _081C62F0 + 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 + .align 2, 0 +_081C62F0: .4byte 0x03005e08 +_081C62F4: + ldr r0, _081C633C + ldrh r0, [r0] + ldr r1, _081C6340 + bl itemid_get_name + ldr r4, _081C6344 + ldr r1, _081C6348 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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, _081C634C + str r1, [r0] +_081C6334: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C633C: .4byte 0x0203ce7c +_081C6340: .4byte 0x02021cc4 +_081C6344: .4byte 0x02021fc4 +_081C6348: .4byte 0x085e8ee0 +_081C634C: .4byte sub_81C64B4 + 1 + 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, _081C63B4 + adds r4, r0 + ldr r0, _081C63B8 + ldrh r0, [r0] + ldr r1, _081C63BC + bl itemid_get_name + ldr r0, _081C63C0 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081C63C4 + ldr r1, _081C63C8 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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, _081C63CC + adds r0, r5, 0 + bl sub_81C6DAC + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C63B4: .4byte 0x03005e08 +_081C63B8: .4byte 0x0203ce7c +_081C63BC: .4byte 0x02021cc4 +_081C63C0: .4byte 0x02021dc4 +_081C63C4: .4byte 0x02021fc4 +_081C63C8: .4byte 0x085e8f0e +_081C63CC: .4byte 0x0861f314 + 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, _081C6400 + 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 + .align 2, 0 +_081C6400: .4byte 0x03005e08 + thumb_func_end sub_81C63D0 + + thumb_func_start sub_81C6404 +sub_81C6404: @ 81C6404 + push {r4,lr} + sub sp, 0xC + ldr r0, _081C6450 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081C6454 + ldr r1, _081C6458 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x3 + bl sub_81C6CEC + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl sub_81DB35C + 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 + .align 2, 0 +_081C6450: .4byte 0x02021cc4 +_081C6454: .4byte 0x02021fc4 +_081C6458: .4byte 0x085e8da0 + 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, _081C64A8 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + ldr r4, _081C64AC + ldr r1, _081C64B0 + adds r0, r4, 0 + bl ExpandTextCodes + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl sub_81DB35C + 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 + .align 2, 0 +_081C64A8: .4byte 0x02021cc4 +_081C64AC: .4byte 0x02021fc4 +_081C64B0: .4byte 0x085e8da0 + 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, _081C64E4 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl sub_8122034 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C64E8 + movs r1, 0x10 + ldrsh r0, [r4, r1] + bl sub_81C645C + b _081C6544 + .align 2, 0 +_081C64E4: .4byte 0x03005e08 +_081C64E8: + ldr r0, _081C6518 + 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 Window_FillTileMap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C6350 + b _081C6544 + .align 2, 0 +_081C6518: .4byte 0x030022c0 +_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 Window_FillTileMap + 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, _081C65B0 + adds r6, r4, r5 + ldr r0, _081C65B4 + ldrh r0, [r0] + ldr r1, _081C65B8 + bl itemid_get_name + ldr r0, _081C65BC + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + ldr r6, _081C65C0 + ldr r1, _081C65C4 + adds r0, r6, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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, _081C65C8 + str r0, [r4] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C65B0: .4byte 0x03005e08 +_081C65B4: .4byte 0x0203ce7c +_081C65B8: .4byte 0x02021cc4 +_081C65BC: .4byte 0x02021dc4 +_081C65C0: .4byte 0x02021fc4 +_081C65C4: .4byte 0x085e8ef9 +_081C65C8: .4byte sub_81C65CC + 1 + 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, _081C6634 + adds r4, r0, r1 + ldr r6, _081C6638 + subs r7, r6, 0x2 + ldr r0, _081C663C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081C662E + movs r0, 0x5 + bl audio_play + ldr r0, _081C6640 + 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, _081C6644 + ldrh r1, [r6] + ldrh r2, [r7] + bl calls_per_item_funcs_in_list_outer + 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 + .align 2, 0 +_081C6634: .4byte 0x03005e08 +_081C6638: .4byte 0x0203cf38 +_081C663C: .4byte 0x030022c0 +_081C6640: .4byte 0x0203ce7c +_081C6644: .4byte 0x03006310 + 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, _081C6670 + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C667C + ldr r1, _081C6674 + ldr r2, _081C6678 + adds r0, r4, 0 + bl sub_81C6DD8 + b _081C66A6 + .align 2, 0 +_081C6670: .4byte 0x0203ce7c +_081C6674: .4byte 0x085e8dce +_081C6678: .4byte sub_81C66EC + 1 +_081C667C: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081C66A0 + ldr r0, _081C6698 + ldr r1, [r0] + ldr r0, _081C669C + str r0, [r1] + adds r0, r4, 0 + bl sub_81C5B14 + b _081C66A6 + .align 2, 0 +_081C6698: .4byte 0x0203cf2c +_081C669C: .4byte sub_81B7F60 + 1 +_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, _081C66D8 + ldrh r0, [r0] + ldr r1, _081C66DC + bl itemid_get_name + ldr r5, _081C66E0 + ldr r1, _081C66E4 + adds r0, r5, 0 + bl ExpandTextCodes + ldr r2, _081C66E8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81C6DD8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C66D8: .4byte 0x0203ce7c +_081C66DC: .4byte 0x02021cc4 +_081C66E0: .4byte 0x02021fc4 +_081C66E4: .4byte 0x085e8e11 +_081C66E8: .4byte sub_81C66EC + 1 + 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, _081C6710 + 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 + .align 2, 0 +_081C6710: .4byte 0x030022c0 + 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, _081C6748 + 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 + .align 2, 0 +_081C6748: .4byte 0x03005e08 + 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, _081C6770 + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081C677C + ldr r1, _081C6774 + ldr r2, _081C6778 + adds r0, r4, 0 + bl sub_81C6DD8 + b _081C6796 + .align 2, 0 +_081C6770: .4byte 0x0203ce7c +_081C6774: .4byte 0x085e8dce +_081C6778: .4byte sub_81C66EC + 1 +_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, _081C67C8 + 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 + .align 2, 0 +_081C67C8: .4byte 0x0203ce7c + 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, _081C6884 + mov r9, r0 + adds r5, r4, r0 + ldr r0, _081C6888 + ldrh r1, [r0, 0x6] + ldrh r0, [r0, 0x8] + adds r1, r0 + strh r1, [r5, 0x2] + ldr r0, _081C688C + ldr r0, [r0] + ldr r2, _081C6890 + 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, _081C6894 + ldr r3, [r0] + movs r0, 0x2 + ldrsh r2, [r5, r0] + lsls r2, 1 + ldr r1, _081C6898 + 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, _081C689C + adds r3, r0 + adds r3, r2 + ldrh r0, [r3] + ldr r1, _081C68A0 + bl itemid_get_name + ldr r6, _081C68A4 + ldr r1, _081C68A8 + adds r0, r6, 0 + bl ExpandTextCodes + movs r0, 0x1 + movs r1, 0 + bl Window_FastFillPixels + 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, _081C68AC + str r0, [r4] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C6884: .4byte 0x03005e08 +_081C6888: .4byte 0x0203cf30 +_081C688C: .4byte 0x0203cf2c +_081C6890: .4byte 0x00000814 +_081C6894: .4byte 0x03005d90 +_081C6898: .4byte 0x00000ca9 +_081C689C: .4byte 0x00000e2c +_081C68A0: .4byte 0x02021cc4 +_081C68A4: .4byte 0x02021fc4 +_081C68A8: .4byte 0x085e8dfe +_081C68AC: .4byte sub_81C68B0 + 1 + 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, _081C68EC + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C695C + ldr r7, _081C68F0 + 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, _081C68F4 + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _081C6940 + .align 2, 0 +_081C68EC: .4byte 0x03005e08 +_081C68F0: .4byte 0x030022c0 +_081C68F4: .4byte 0x0203cf38 +_081C68F8: + ldrb r0, [r4] + bl sub_81AE604 + adds r6, r0, 0 + ldrb r0, [r4] + ldr r4, _081C692C + 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 + .align 2, 0 +_081C692C: .4byte 0x0203cf38 +_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, _081C69A0 + adds r5, r0, r1 + ldr r7, _081C69A4 + 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 + .align 2, 0 +_081C69A0: .4byte 0x03005e08 +_081C69A4: .4byte 0x0203cf38 +_081C69A8: + ldrb r0, [r5, 0x2] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_81C57A8 + ldr r0, _081C6A08 + ldr r0, [r0] + ldr r1, _081C6A0C + 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, _081C6A10 + ldrh r1, [r7] + mov r3, r8 + ldrh r2, [r3] + bl calls_per_item_funcs_in_list_outer + 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 + .align 2, 0 +_081C6A08: .4byte 0x0203cf2c +_081C6A0C: .4byte 0x00000814 +_081C6A10: .4byte 0x03006310 + 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, _081C6A80 + adds r4, r0, r1 + ldr r5, _081C6A84 + subs r7, r5, 0x2 + ldr r0, _081C6A88 + ldr r0, [r0] + ldr r1, _081C6A8C + 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, _081C6A90 + ldrh r1, [r5] + ldrh r2, [r7] + bl calls_per_item_funcs_in_list_outer + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + adds r0, r6, 0 + bl sub_81C629C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C6A80: .4byte 0x03005e08 +_081C6A84: .4byte 0x0203cf38 +_081C6A88: .4byte 0x0203cf2c +_081C6A8C: .4byte 0x00000814 +_081C6A90: .4byte 0x03006310 + 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, _081C6B70 + mov r9, r0 + movs r0, 0x14 + bl malloc + adds r7, r0, 0 + movs r0, 0xA + bl malloc + adds r5, r0, 0 + ldr r1, _081C6B74 + mov r8, r1 + ldr r2, [r1] + ldr r4, _081C6B78 + 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, _081C6B7C + 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, _081C6B80 + 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, _081C6B7C + 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, _081C6B80 + 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, _081C6B84 + movs r0, 0x1 + strh r0, [r1] + b _081C6BC6 + .align 2, 0 +_081C6B70: .4byte 0x020244ec +_081C6B74: .4byte 0x03005d90 +_081C6B78: .4byte 0x00000ca9 +_081C6B7C: .4byte 0x00000e2c +_081C6B80: .4byte 0x00000e54 +_081C6B84: .4byte 0x020375f0 +_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, _081C6BD4 + 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 + .align 2, 0 +_081C6BD4: .4byte 0x020375f0 + thumb_func_end sub_81C6A94 + + thumb_func_start sub_81C6BD8 +sub_81C6BD8: @ 81C6BD8 + push {r4,lr} + ldr r0, _081C6C34 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + 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, _081C6C38 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_081C6C04: + adds r0, r4, 0 + movs r1, 0 + bl Window_FastFillPixels + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081C6C04 + movs r0, 0 + bl Window_WriteStandardTileMap + movs r0, 0x1 + bl Window_WriteStandardTileMap + 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 + .align 2, 0 +_081C6C34: .4byte 0x0861f328 +_081C6C38: .4byte 0x0860f074 + 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, _081C6C90 + 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 sub_8199EEC + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C6C90: .4byte 0x0861f31c + 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, _081C6CE8 + 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 sub_8199EEC + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C6CE8: .4byte 0x0861f31c + 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, _081C6D1C + ldr r1, [r1] + ldr r2, _081C6D20 + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_081C6D1C: .4byte 0x0203cf2c +_081C6D20: .4byte 0x0000080f + 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, _081C6D60 + ldr r3, _081C6D64 + 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, _081C6D68 + adds r0, r1 + bl Window_AddFromTemplate + 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 + .align 2, 0 +_081C6D60: .4byte 0x0203cf2c +_081C6D64: .4byte 0x0000080f +_081C6D68: .4byte 0x0861f350 + thumb_func_end sub_81C6D24 + + thumb_func_start sub_81C6D6C +sub_81C6D6C: @ 81C6D6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081C6DA4 + ldr r2, _081C6DA8 + 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 Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081C6D9E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C6DA4: .4byte 0x0203cf2c +_081C6DA8: .4byte 0x0000080f + 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, _081C6DD4 + 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 sub_8121F94 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_081C6DD4: .4byte 0x0861f370 + thumb_func_end sub_81C6DAC + + thumb_func_start sub_81C6DD8 +sub_81C6DD8: @ 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 Window_FastFillPixels + 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 sub_8121E7C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C6DD8 + + thumb_func_start sub_81C6E1C +sub_81C6E1C: @ 81C6E1C + push {lr} + movs r0, 0x2 + movs r1, 0 + bl sub_8197DF8 + movs r0, 0x2 + bl Window_FillTileMap + 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, _081C6E88 + ldr r2, _081C6E8C + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _081C6E80 + ldr r0, _081C6E90 + adds r4, r0 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081C6E94 + 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 obj_delete_and_free_tiles + movs r0, 0xFF + strb r0, [r5] +_081C6E80: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C6E88: .4byte 0x0203cf2c +_081C6E8C: .4byte 0x00000804 +_081C6E90: .4byte 0x00001024 +_081C6E94: .4byte 0x02020630 + thumb_func_end sub_81C6E38 + + thumb_func_start sub_81C6E98 +sub_81C6E98: @ 81C6E98 + push {r4,lr} + sub sp, 0x8 + movs r0, 0x40 + bl malloc + adds r4, r0, 0 + ldr r0, _081C6EE0 + adds r1, r4, 0 + bl call_LZZUnCompWram + ldr r0, _081C6EE4 + ldr r0, [r0] + ldr r1, _081C6EE8 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 25 + adds r0, r4, r0 + str r0, [sp] + ldr r1, _081C6EEC + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, _081C6EF0 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_pal_obj_alloc_tag_and_apply + adds r0, r4, 0 + bl free + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C6EE0: .4byte 0x08d9add0 +_081C6EE4: .4byte 0x03005d90 +_081C6EE8: .4byte 0x00000ca9 +_081C6EEC: .4byte 0xffff0000 +_081C6EF0: .4byte 0x00001024 + thumb_func_end sub_81C6E98 + + thumb_func_start sub_81C6EF4 +sub_81C6EF4: @ 81C6EF4 + push {r4,lr} + ldr r0, _081C6F14 + ldr r4, [r0] + ldr r0, _081C6F18 + adds r4, r0 + ldr r0, _081C6F1C + movs r1, 0x44 + movs r2, 0x38 + movs r3, 0 + bl obj_add_from_template_forward_search + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C6F14: .4byte 0x0203cf2c +_081C6F18: .4byte 0x00000804 +_081C6F1C: .4byte 0x0861f3d4 + thumb_func_end sub_81C6EF4 + + thumb_func_start sub_81C6F20 +sub_81C6F20: @ 81C6F20 + push {r4,lr} + ldr r0, _081C6F58 + ldr r0, [r0] + ldr r1, _081C6F5C + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081C6F60 + 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 sub_8008258 + ldr r0, _081C6F64 + str r0, [r4, 0x1C] +_081C6F50: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C6F58: .4byte 0x0203cf2c +_081C6F5C: .4byte 0x00000804 +_081C6F60: .4byte 0x02020630 +_081C6F64: .4byte sub_81C6F68 + 1 + 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 sub_8008258 + ldr r0, _081C6F8C + str r0, [r4, 0x1C] +_081C6F84: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C6F8C: .4byte nullsub_12 + 1 + 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, _081C6FE8 + ldr r2, _081C6FEC + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _081C6FE0 + ldr r0, _081C6FF0 + adds r4, r0 + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + 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, _081C6FF4 + 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 + .align 2, 0 +_081C6FE8: .4byte 0x0203cf2c +_081C6FEC: .4byte 0x00000805 +_081C6FF0: .4byte 0x00001025 +_081C6FF4: .4byte 0x02020630 + 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, _081C7020 + ldr r0, [r0] + ldr r1, _081C7024 + adds r0, r1 + movs r1, 0x8 + bl sub_8122344 + pop {r0} + bx r0 + .align 2, 0 +_081C7020: .4byte 0x0203cf2c +_081C7024: .4byte 0x00000807 + 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, _081C7044 + ldr r0, [r0] + ldr r1, _081C7048 + adds r0, r1 + movs r1, 0x8 + bl sub_81223FC + pop {r0} + bx r0 + .align 2, 0 +_081C7044: .4byte 0x0203cf2c +_081C7048: .4byte 0x00000807 + thumb_func_end sub_81C7028 + + thumb_func_start sub_81C704C +sub_81C704C: @ 81C704C + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, _081C7070 + ldr r0, [r0] + ldr r1, _081C7074 + 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 + .align 2, 0 +_081C7070: .4byte 0x0203cf2c +_081C7074: .4byte 0x00000807 + 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, _081C708C + b _081C7092 + .align 2, 0 +_081C708C: .4byte sub_81C7170 + 1 +_081C7090: + ldr r0, _081C70CC +_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, _081C70D0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, _081C70D4 + 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 + .align 2, 0 +_081C70CC: .4byte sub_81C71E4 + 1 +_081C70D0: .4byte 0x03005e00 +_081C70D4: .4byte 0x0203cf3c + thumb_func_end sub_81C7078 + + thumb_func_start sub_81C70D8 +sub_81C70D8: @ 81C70D8 + push {lr} + ldr r1, _081C710C + ands r1, r0 + lsrs r3, r0, 16 + ldr r2, _081C7110 + 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, _081C7114 + cmp r2, r0 + beq _081C70FE + ldr r0, _081C7118 + cmp r2, r0 + bne _081C711C +_081C70FE: + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, r3 + bne _081C711C + movs r0, 0x1 + b _081C711E + .align 2, 0 +_081C710C: .4byte 0x0000ffff +_081C7110: .4byte 0x03005e00 +_081C7114: .4byte sub_81C7170 + 1 +_081C7118: .4byte sub_81C71E4 + 1 +_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, _081C7154 +_081C712C: + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _081C7160 + ldr r1, [r4] + ldr r0, _081C7158 + cmp r1, r0 + beq _081C7140 + ldr r0, _081C715C + 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 + .align 2, 0 +_081C7154: .4byte 0x03005e00 +_081C7158: .4byte sub_81C7170 + 1 +_081C715C: .4byte sub_81C71E4 + 1 +_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, _081C71A4 + 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, _081C71A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C71A4: .4byte 0x03005e08 +_081C71A8: .4byte _081C71AC + .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, _081C721C + 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, _081C7220 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C721C: .4byte 0x03005e08 +_081C7220: .4byte _081C7224 + .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 sub_81C7250 +sub_81C7250: @ 81C7250 + push {r4,lr} + ldr r4, _081C7268 + movs r0, 0x5C + bl malloc + str r0, [r4] + cmp r0, 0 + bne _081C7270 + ldr r0, _081C726C + bl set_callback2 + b _081C7292 + .align 2, 0 +_081C7268: .4byte 0x0203cf40 +_081C726C: .4byte sub_8086194 + 1 +_081C7270: + bl sub_81C7360 + bl clear_tasks + movs r0, 0 + bl SetVBlankCallback + ldr r0, _081C7298 + movs r1, 0 + bl AddTask + ldr r0, _081C729C + bl set_callback2 + ldr r0, _081C72A0 + bl SetVBlankCallback +_081C7292: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C7298: .4byte sub_81C742C + 1 +_081C729C: .4byte sub_81C7400 + 1 +_081C72A0: .4byte sub_81C7418 + 1 + thumb_func_end sub_81C7250 + + thumb_func_start sub_81C72A4 +sub_81C72A4: @ 81C72A4 + push {lr} + ldr r0, _081C72B8 + bl set_callback2 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .align 2, 0 +_081C72B8: .4byte sub_81C72BC + 1 + thumb_func_end sub_81C72A4 + + thumb_func_start sub_81C72BC +sub_81C72BC: @ 81C72BC + push {r4,lr} + bl fade_and_return_progress_probably + ldr r0, _081C72E4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C7320 + ldr r4, _081C72E8 + movs r0, 0x5C + bl malloc + str r0, [r4] + cmp r0, 0 + bne _081C72F0 + ldr r0, _081C72EC + bl set_callback2 + b _081C7320 + .align 2, 0 +_081C72E4: .4byte 0x02037fd4 +_081C72E8: .4byte 0x0203cf40 +_081C72EC: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_081C72F0: + bl sub_81C7360 + ldr r1, [r4] + movs r0, 0x1 + strh r0, [r1, 0x8] + bl clear_tasks + bl reset_all_obj_data + bl gpu_pal_allocator_reset + movs r0, 0 + bl SetVBlankCallback + ldr r0, _081C7328 + movs r1, 0 + bl AddTask + ldr r0, _081C732C + bl set_callback2 + ldr r0, _081C7330 + bl SetVBlankCallback +_081C7320: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C7328: .4byte sub_81C742C + 1 +_081C732C: .4byte sub_81C7400 + 1 +_081C7330: .4byte sub_81C7418 + 1 + 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, _081C735C + ldr r0, [r4] + bl free + movs r0, 0 + str r0, [r4] + bl init_keypad_data + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C735C: .4byte 0x0203cf40 + 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, _081C73E8 + 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 + .align 2, 0 +_081C73E8: .4byte 0x020244ec +_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 run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _081C7450 + adds r7, r1, r0 + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0x5 + bls _081C7446 + b _081C7562 +_081C7446: + lsls r0, 2 + ldr r1, _081C7454 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C7450: .4byte 0x03005e08 +_081C7454: .4byte _081C7458 + .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, _081C748C + bl sub_81C756C + b _081C74E8 + .align 2, 0 +_081C748C: .4byte 0x000186a0 +_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, _081C74F0 + cmp r6, r0 + bls _081C7506 + ldr r4, _081C74F4 + ldr r5, _081C74F8 + 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 + .align 2, 0 +_081C74F0: .4byte 0x0001869f +_081C74F4: .4byte 0x0861f3ec +_081C74F8: .4byte 0x0203cf40 +_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, _081C7554 + 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, _081C7558 + bl set_callback2 + b _081C7562 + .align 2, 0 +_081C7554: .4byte 0x0203cf40 +_081C7558: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music + 1 +_081C755C: + ldr r0, _081C7568 + bl set_callback2 +_081C7562: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C7568: .4byte sub_8086194 + 1 + thumb_func_end sub_81C742C + + thumb_func_start sub_81C756C +sub_81C756C: @ 81C756C + push {r4-r6,lr} + ldr r1, _081C75C0 + adds r6, r0, r1 + bl sub_81C75F4 + ldr r5, _081C75C4 + 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, _081C75C8 + 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 + .align 2, 0 +_081C75C0: .4byte 0xfffe7960 +_081C75C4: .4byte 0x0861f3ec +_081C75C8: .4byte 0x0203cf40 +_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, _081C75F0 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + .align 2, 0 +_081C75F0: .4byte 0x0203cf40 + thumb_func_end sub_81C75E0 + + thumb_func_start sub_81C75F4 +sub_81C75F4: @ 81C75F4 + push {lr} + bl init_keypad_data + 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, _081C7618 + bl SetVBlankCallback + pop {r0} + bx r0 + .align 2, 0 +_081C7618: .4byte sub_81C7418 + 1 + 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 malloc + ldr r1, _081C7638 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x10 + adds r1, r4 + str r0, [r1] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081C7638: .4byte 0x0203cf40 + thumb_func_end sub_81C761C + + thumb_func_start sub_81C763C +sub_81C763C: @ 81C763C + ldr r1, _081C764C + ldr r1, [r1] + lsls r0, 2 + adds r1, 0x10 + adds r1, r0 + ldr r0, [r1] + bx lr + .align 2, 0 +_081C764C: .4byte 0x0203cf40 + thumb_func_end sub_81C763C + + thumb_func_start sub_81C7650 +sub_81C7650: @ 81C7650 + push {r4,r5,lr} + ldr r5, _081C7678 + 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 + .align 2, 0 +_081C7678: .4byte 0x0203cf40 + thumb_func_end sub_81C7650 + + thumb_func_start sub_81C767C +sub_81C767C: @ 81C767C + ldr r0, _081C7684 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + bx lr + .align 2, 0 +_081C7684: .4byte 0x0203cf40 + thumb_func_end sub_81C767C + + thumb_func_start sub_81C7688 +sub_81C7688: @ 81C7688 + ldr r1, _081C7690 + ldr r1, [r1] + strh r0, [r1, 0x8] + bx lr + .align 2, 0 +_081C7690: .4byte 0x0203cf40 + 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, _081C76A8 + ldr r0, [r0] + strh r1, [r0, 0xA] + pop {r0} + bx r0 + .align 2, 0 +_081C76A8: .4byte 0x0203cf40 + thumb_func_end sub_81C7694 + + thumb_func_start sub_81C76AC +sub_81C76AC: @ 81C76AC + ldr r0, _081C76B4 + ldr r0, [r0] + ldrh r0, [r0, 0xA] + bx lr + .align 2, 0 +_081C76B4: .4byte 0x0203cf40 + thumb_func_end sub_81C76AC + + thumb_func_start sub_81C76B8 +sub_81C76B8: @ 81C76B8 + ldr r0, _081C76C0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bx lr + .align 2, 0 +_081C76C0: .4byte 0x0203cf40 + thumb_func_end sub_81C76B8 + + thumb_func_start sub_81C76C4 +sub_81C76C4: @ 81C76C4 + push {r4,lr} + ldr r1, _081C76EC + movs r0, 0 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C76F4 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _081C76F0 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C76F6 + .align 2, 0 +_081C76EC: .4byte 0x0000082c +_081C76F0: .4byte sub_81C7764 + 1 +_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 sub_80A1AD4 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_81C7710 + + thumb_func_start sub_81C7738 +sub_81C7738: @ 81C7738 + push {lr} + ldr r0, _081C774C + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C7750 + movs r0, 0x1 + b _081C775E + .align 2, 0 +_081C774C: .4byte 0x02037fd4 +_081C7750: + bl sub_81C99D4 + bl sub_81C7C94 + bl Window_FreeMemory + 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 lcd_io_set + bl Window_FreeMemory + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081C77AC + movs r0, 0 + movs r2, 0x1 + bl bg_vram_setup + bl sub_8199D98 + bl reset_temp_tile_data_buffers + movs r0, 0x1 + b _081C782C + .align 2, 0 +_081C77AC: .4byte 0x0861fa04 +_081C77B0: + movs r0, 0 + bl sub_81C763C + adds r4, r0, 0 + ldr r1, _081C77F0 + 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 bg_set_tilemap + ldr r1, _081C77F4 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r0, _081C77F8 + movs r1, 0 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + b _081C782C + .align 2, 0 +_081C77F0: .4byte 0x08dc7b80 +_081C77F4: .4byte 0x08dc7d84 +_081C77F8: .4byte 0x08dc7b60 +_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 is_dma3_queue_busy_with_gpu_copy + 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 gpu_sync_bg_show +_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, _081C789C + movs r1, 0x4 + bl sub_81C7078 + str r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C789C: .4byte atk47_cmd47 + 1 + 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, _081C78BC + movs r1, 0x4 + bl sub_81C7078 + str r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C78BC: .4byte sub_81C791C + 1 + 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 bg_change_y_offset + ldr r1, _081C7904 + cmp r0, r1 + bhi _081C7908 + movs r0, 0x2 + b _081C7916 + .align 2, 0 +_081C7904: .4byte 0x00001fff +_081C7908: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl bg_change_y_offset +_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 bg_change_y_offset + cmp r0, 0 + ble _081C7932 + movs r0, 0x2 + b _081C793E +_081C7932: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + 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, _081C7958 + adds r1, r3 + lsls r2, 10 + lsrs r2, 11 + bl CpuSet + pop {r0} + bx r0 + .align 2, 0 +_081C7958: .4byte 0x02037714 + 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 gpu_pal_alloc_new + 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, _081C79B4 + adds r3, r0 + ldr r2, _081C79B8 + mov r0, sp + adds r1, r3, 0 + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_081C79B4: .4byte 0x02037d14 +_081C79B8: .4byte 0x01000010 + 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, _081C79E0 + mov r1, r10 + ands r2, r1 + ldr r0, [sp] + b _081C79F4 + .align 2, 0 +_081C79E0: .4byte 0x001fffff +_081C79E4: + ldr r2, [sp, 0x2C] + ldr r0, [sp, 0x8] + cmp r2, r0 + blt _081C7A00 + ldr r2, _081C79FC + mov r1, r10 + ands r2, r1 + ldr r0, [sp, 0x4] +_081C79F4: + ldr r1, [sp, 0x30] + bl CpuSet + b _081C7AAE + .align 2, 0 +_081C79FC: .4byte 0x001fffff +_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 sub_80A1AD4 + 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 sub_80A1AD4 + 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 sub_80A1AD4 +_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, _081C7B3C + ldrb r0, [r0, 0x7] + lsrs r0, 7 + bx lr + .align 2, 0 +_081C7B3C: .4byte 0x02037fd4 + thumb_func_end sub_81C7B34 + + thumb_func_start sub_81C7B40 +sub_81C7B40: @ 81C7B40 + push {lr} + ldr r0, _081C7B50 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + pop {r0} + bx r0 + .align 2, 0 +_081C7B50: .4byte 0xfffefffe + 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 bg_init_bg_config_2_from_bg_config_3 + 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, _081C7BA0 + bl Window_InitFromTemplates + movs r0, 0 + str r0, [r4, 0x10] + bl sub_81C7BF8 + ldrb r0, [r4, 0x10] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x10] + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C7BA0: .4byte 0x0861fa08 + 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, _081C7BE0 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, _081C7BE4 + 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 + .align 2, 0 +_081C7BE0: .4byte 0x0861fa48 +_081C7BE4: .4byte 0x0861fa18 + thumb_func_end sub_81C7BA4 + + thumb_func_start sub_81C7BE8 +sub_81C7BE8: @ 81C7BE8 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + 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 Window_FastFillPixels + 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 Window_FillPixelRect + 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, _081C7C84 +_081C7C36: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081C7C36 + ldr r0, _081C7C88 + bl sub_81C795C + movs r0, 0 + bl gpu_pal_tags_index_of + 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, _081C7C8C + movs r1, 0xDC + movs r2, 0xC + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081C7C90 + adds r1, r0 + str r1, [r6, 0x18] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C7C84: .4byte 0x0861fa4c +_081C7C88: .4byte 0x0861fa54 +_081C7C8C: .4byte 0x0861fb04 +_081C7C90: .4byte 0x02020630 + 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 obj_delete_and_free_tiles + movs r0, 0 + bl gpu_tile_obj_free_by_tag + movs r0, 0 + bl gpu_pal_free_tag + 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 bg_get_y_offset + 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, _081C7CE0 + str r1, [r0, 0x1C] + pop {r1} + bx r1 + .align 2, 0 +_081C7CE0: .4byte nullsub_12 + 1 + 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, _081C7D24 + 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 + .align 2, 0 +_081C7D24: .4byte sub_81C7CB4 + 1 + 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, _081C7DE4 + bl gpu_tile_obj_decompress_and_load + movs r0, 0x1 + bl gpu_pal_alloc_new + movs r0, 0x2 + bl gpu_pal_alloc_new + movs r5, 0 + ldr r0, _081C7DE8 + mov r8, r0 + movs r7, 0x4 +_081C7D50: + ldr r0, _081C7DEC + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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, _081C7DF0 + movs r1, 0 + movs r2, 0 + movs r3, 0x2 + bl obj_add_from_template_forward_search + 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, _081C7DF4 + adds r0, r4, 0 + ands r1, r0 + ldr r4, _081C7DF8 + 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 + .align 2, 0 +_081C7DE4: .4byte 0x0861fa64 +_081C7DE8: .4byte 0x02020630 +_081C7DEC: .4byte 0x0861fb2c +_081C7DF0: .4byte 0x0861fb44 +_081C7DF4: .4byte 0x000003ff +_081C7DF8: .4byte 0xfffffc00 + 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 gpu_tile_obj_tag_get_range_start + ldr r3, [r5, 0x20] + adds r0, 0x20 + b _081C7E3A +_081C7E30: + movs r0, 0x2 + bl gpu_tile_obj_tag_get_range_start + ldr r3, [r5, 0x20] + adds r0, 0x40 +_081C7E3A: + ldr r2, _081C7E50 + adds r1, r2, 0 + ands r0, r1 + ldrh r2, [r3, 0x4] + ldr r1, _081C7E54 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C7E50: .4byte 0x000003ff +_081C7E54: .4byte 0xfffffc00 + 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, _081C7EF8 + 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, _081C7EFC + adds r4, r0 + movs r0, 0x1 + bl gpu_pal_tags_index_of + 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, _081C7F00 + mov r0, r8 + adds r1, r4, 0 + bl LZ77UnCompWram + movs r0, 0x2 + bl gpu_tile_obj_tag_get_range_start + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 11 + ldr r2, _081C7F04 + adds r1, r2 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + movs r0, 0x2 + bl gpu_tile_obj_tag_get_range_start + ldr r3, [r7, 0x20] + ldrh r1, [r6, 0x4] + adds r0, r1 + ldr r2, _081C7F08 + adds r1, r2, 0 + ands r0, r1 + ldrh r2, [r3, 0x4] + ldr r1, _081C7F0C + 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 + .align 2, 0 +_081C7EF8: .4byte 0x0861fa6c +_081C7EFC: .4byte 0x08dc7f00 +_081C7F00: .4byte 0x0201c000 +_081C7F04: .4byte 0x06010000 +_081C7F08: .4byte 0x000003ff +_081C7F0C: .4byte 0xfffffc00 +_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, _081C7F90 + 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, _081C7F94 + adds r4, r0 + movs r0, 0x2 + bl gpu_pal_tags_index_of + 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, _081C7F98 + adds r0, r6, 0 + adds r1, r4, 0 + bl LZ77UnCompWram + movs r0, 0x2 + bl gpu_tile_obj_tag_get_range_start + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 11 + ldr r0, _081C7F9C + adds r1, r0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy +_081C7F8A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C7F90: .4byte 0x0861fa9c +_081C7F94: .4byte 0x08dc7f00 +_081C7F98: .4byte 0x0201d000 +_081C7F9C: .4byte 0x06010800 + 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, _081C8030 + cmp r2, r0 + bne _081C8034 + ldr r0, [r1, 0x24] + ldr r0, [r0, 0x1C] + cmp r0, r2 + bne _081C8034 + movs r0, 0 + b _081C8036 + .align 2, 0 +_081C8030: .4byte nullsub_12 + 1 +_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, _081C8178 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C8178: .4byte sub_81C817C + 1 + 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, _081C81D0 + str r0, [r2, 0x1C] +_081C81CC: + pop {r0} + bx r0 + .align 2, 0 +_081C81D0: .4byte nullsub_12 + 1 + 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, _081C8210 + movs r0, 0x11 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C821C + ldr r1, _081C8214 + 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, _081C8218 + movs r1, 0x6 + bl sub_81C7078 + movs r0, 0x1 + b _081C821E + .align 2, 0 +_081C8210: .4byte 0x000008a4 +_081C8214: .4byte 0x00000888 +_081C8218: .4byte sub_81C8254 + 1 +_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, _081C8230 + bl sub_81C7124 + pop {r1} + bx r1 + .align 2, 0 +_081C8230: .4byte sub_81C8254 + 1 + 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 Window_Remove + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081C8278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C8278: .4byte _081C827C + .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, _081C82B4 + adds r0, r2, r1 + adds r1, r2, 0 + bl sub_81C837C + movs r0, 0 + b _081C82D8 + .align 2, 0 +_081C82B4: .4byte 0x00000888 +_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, _081C82E0 + adds r0, r2, r1 + adds r1, r2, 0 + bl sub_81C8EF8 +_081C82D6: + movs r0, 0x4 +_081C82D8: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081C82E0: .4byte 0x00000888 + 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 bg_set_tilemap + ldrb r0, [r5] + movs r1, 0x20 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl bg_fill_tilemap_rect + ldrb r0, [r5] + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldrb r0, [r5] + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + ldrb r0, [r5] + ldrb r1, [r5, 0x3] + lsls r1, 11 + movs r2, 0x2 + bl bg_change_y_offset + ldrb r0, [r5] + bl gpu_copy_wram_bg_tilemap_to_vram + 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 Window_FastFillPixels + ldrb r0, [r4, 0x8] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x8] + movs r1, 0x1 + bl Window_CopyToVram + 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, _081C83DC + movs r1, 0x5 + bl sub_81C7078 +_081C83D6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C83DC: .4byte sub_81C83F0 + 1 + thumb_func_end sub_81C83AC + + thumb_func_start sub_81C83E0 +sub_81C83E0: @ 81C83E0 + push {lr} + ldr r0, _081C83EC + bl sub_81C7124 + pop {r1} + bx r1 + .align 2, 0 +_081C83EC: .4byte sub_81C83F0 + 1 + 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 Window_CopyToVram + b _081C8476 +_081C846E: + ldrb r0, [r4, 0x8] + movs r1, 0x2 + bl Window_CopyToVram +_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 is_dma3_queue_busy_with_gpu_copy + 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, _081C84BC + adds r0, r1 + ldrh r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r1} + bx r1 + .align 2, 0 +_081C84BC: .4byte 0x00000888 + thumb_func_end sub_81C84A4 + + thumb_func_start sub_81C84C0 +sub_81C84C0: @ 81C84C0 + push {lr} + movs r0, 0x11 + bl sub_81C763C + ldr r1, _081C84E4 + 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 + .align 2, 0 +_081C84E4: .4byte 0x00000888 + 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, _081C8520 + 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 + .align 2, 0 +_081C8520: .4byte 0x00000888 +_081C8524: + cmp r4, 0 + beq _081C854E + ldr r2, _081C8564 + 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 + .align 2, 0 +_081C8564: .4byte 0x0203cf44 + 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 bg_get_y_offset + 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, _081C859C + movs r1, 0x6 + bl sub_81C7078 + str r0, [r4, 0x28] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C859C: .4byte sub_81C85A0 + 1 + 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 bg_get_y_offset + adds r5, r0, 0 + ldrb r0, [r4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r4, 0x30] + lsls r2, 24 + lsrs r2, 24 + bl bg_change_y_offset + 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 bg_change_y_offset + 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, _081C8654 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_081C8654: .4byte 0x00000888 + 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, _081C87A4 + adds r1, r4, r0 + movs r0, 0 + str r0, [r1] + ldr r0, _081C87A8 + movs r1, 0x6 + bl sub_81C7078 + movs r1, 0x8A + lsls r1, 4 + adds r4, r1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C87A4: .4byte 0x0000089c +_081C87A8: .4byte sub_81C8870 + 1 + 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, _081C87E4 + adds r1, r5, r0 + ldrh r0, [r1] + adds r0, r4 + movs r2, 0 + strh r0, [r1] + ldr r1, _081C87E8 + adds r0, r5, r1 + str r2, [r0] + ldr r0, _081C87EC + 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 + .align 2, 0 +_081C87E4: .4byte 0x00000888 +_081C87E8: .4byte 0x0000089c +_081C87EC: .4byte sub_81C8958 + 1 + 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, _081C8818 + adds r1, r4, r0 + movs r0, 0 + str r0, [r1] + ldr r0, _081C881C + movs r1, 0x6 + bl sub_81C7078 + movs r1, 0x8A + lsls r1, 4 + adds r4, r1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C8818: .4byte 0x0000089c +_081C881C: .4byte sub_81C8A28 + 1 + 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, _081C886C + 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 Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C886C: .4byte 0x00000888 + 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, _081C888C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C888C: .4byte _081C8890 + .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, _081C88D0 + adds r5, r4, r0 + ldr r1, _081C88D4 + 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 + .align 2, 0 +_081C88D0: .4byte 0x0000089c +_081C88D4: .4byte 0x0000088e +_081C88D8: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _081C8942 + ldr r2, _081C88F8 + 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 + .align 2, 0 +_081C88F8: .4byte 0x0000089c +_081C88FC: + ldr r0, _081C8914 + 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 + .align 2, 0 +_081C8914: .4byte 0x0000088e +_081C8918: + bl is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _081C8942 + ldr r2, _081C8934 + adds r1, r4, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _081C894C + movs r1, 0 + bl sub_81C84E8 + b _081C88CA + .align 2, 0 +_081C8934: .4byte 0x0000088e +_081C8938: + bl sub_81C8630 + adds r1, r0, 0 + cmp r1, 0 + beq _081C8946 +_081C8942: + movs r0, 0x2 + b _081C894E +_081C8946: + ldr r2, _081C8954 + adds r0, r4, r2 + strh r1, [r0] +_081C894C: + movs r0, 0x4 +_081C894E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081C8954: .4byte 0x0000088e + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081C8980 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C8980: .4byte _081C8984 + .align 2, 0 +_081C8984: + .4byte _081C89A4 + .4byte _081C89B4 + .4byte _081C89BE + .4byte _081C89D0 + .4byte _081C89DA + .4byte _081C89EC + .4byte _081C89F6 + .4byte _081C8A08 +_081C89A4: + ldr r1, _081C89B0 + adds r0, r4, r1 + adds r1, r4, 0 + bl sub_81C8CB4 + b _081C8A20 + .align 2, 0 +_081C89B0: .4byte 0x00000888 +_081C89B4: + adds r0, r4, 0 + movs r1, 0 + bl sub_81C8DBC + b _081C8A20 +_081C89BE: + ldr r1, _081C89CC + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0 + bl sub_81C8E54 + b _081C8A20 + .align 2, 0 +_081C89CC: .4byte 0x00000888 +_081C89D0: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C8DBC + b _081C8A20 +_081C89DA: + ldr r1, _081C89E8 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81C8E54 + b _081C8A20 + .align 2, 0 +_081C89E8: .4byte 0x00000888 +_081C89EC: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81C8DBC + b _081C8A20 +_081C89F6: + ldr r1, _081C8A04 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0x2 + bl sub_81C8E54 + b _081C8A20 + .align 2, 0 +_081C8A04: .4byte 0x00000888 +_081C8A08: + ldr r1, _081C8A18 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0x3 + bl sub_81C8E54 + b _081C8A20 + .align 2, 0 +_081C8A18: .4byte 0x00000888 +_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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _081C8AA6 + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, _081C8A58 + adds r6, r4, r0 + adds r2, r4, 0 + cmp r5, 0x6 + bls _081C8A4C + b _081C8B64 +_081C8A4C: + lsls r0, r5, 2 + ldr r1, _081C8A5C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C8A58: .4byte 0x00000888 +_081C8A5C: .4byte _081C8A60 + .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, _081C8AAC + 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 + .align 2, 0 +_081C8AAC: .4byte 0x0000089c +_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, _081C8AF8 + adds r0, r4, r2 + ldr r0, [r0] + movs r1, 0 + bl sub_81C84E8 + movs r0, 0 + b _081C8B66 + .align 2, 0 +_081C8AF8: .4byte 0x0000089c +_081C8AFC: + bl sub_81C8630 + adds r1, r0, 0 + cmp r1, 0 + bne _081C8AA6 + ldr r3, _081C8B10 + adds r0, r4, r3 + str r1, [r0] +_081C8B0C: + movs r0, 0x1 + b _081C8B66 + .align 2, 0 +_081C8B10: .4byte 0x0000089c +_081C8B14: + ldr r0, [r6, 0x10] + ldrh r1, [r6] + ldr r3, _081C8B30 + 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 + .align 2, 0 +_081C8B30: .4byte 0x0000089c +_081C8B34: + bl sub_81C83E0 + cmp r0, 0 + bne _081C8AA6 + ldr r0, _081C8B58 + 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 + .align 2, 0 +_081C8B58: .4byte 0x0000089c +_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 Window_GetField + 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, _081C8BCC + 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, _081C8BD0 + 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 Window_CopyToVram + b _081C8C1E + .align 2, 0 +_081C8BCC: .4byte 0x11111111 +_081C8BD0: .4byte 0x001fffff +_081C8BD4: + movs r2, 0x10 + subs r2, r7 + subs r0, r6, r2 + mov r8, r0 + ldr r1, _081C8C5C + 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, _081C8C60 + ands r2, r5 + movs r4, 0x80 + lsls r4, 17 + orrs r2, r4 + str r3, [sp, 0xC] + bl CpuFastSet + ldr r0, _081C8C5C + 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 Window_CopyToVram +_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 Window_CopyToVram + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C8C5C: .4byte 0x11111111 +_081C8C60: .4byte 0x001fffff + 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 Window_GetField + lsls r0, 24 + lsrs r0, 24 + bl bg_get_tilemap + 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, _081C8D48 + 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 Window_FillPixelRect + 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 Window_CopyRectToVram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C8D48: .4byte 0x0861fbe4 + 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 Window_FillPixelRect + 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 Window_CopyToVram + 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, _081C8E4C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r0, sp, 0x18 + mov r9, r0 + ldr r1, _081C8E50 + 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 Window_FillPixelRect + 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 Window_CopyRectToVram + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C8E4C: .4byte 0x0861fbe8 +_081C8E50: .4byte 0x0861fbf4 + 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, _081C8ECC + 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 Window_CopyRectToVram +_081C8EC0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081C8ECC: .4byte 0x0861fbf7 + thumb_func_end sub_81C8E54 + + thumb_func_start sub_81C8ED0 +sub_81C8ED0: @ 81C8ED0 + push {r4,r5,lr} + movs r5, 0 + ldr r4, _081C8EF0 +_081C8ED6: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081C8ED6 + ldr r0, _081C8EF4 + bl sub_81C795C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C8EF0: .4byte 0x0861fbfc +_081C8EF4: .4byte 0x0861fc04 + 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, _081C8FC4 + ldrb r1, [r5, 0x2] + lsls r1, 3 + adds r1, 0x3 + ldrb r2, [r5, 0x3] + adds r2, 0x1 + lsls r2, 3 + movs r3, 0x7 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, _081C8FC8 + 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, _081C8FCC + 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 obj_add_from_template_forward_search + 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, _081C8FD0 + mov r9, r0 + mov r0, r9 + ands r1, r0 + ldr r4, _081C8FD4 + adds r0, r4, 0 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldr r1, [r5, 0x44] + ldr r0, _081C8FD8 + str r0, [r1, 0x1C] + ldrb r2, [r5, 0x3] + lsls r2, 3 + mov r0, r10 + adds r1, r6, 0 + movs r3, 0x7 + bl obj_add_from_template_forward_search + 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, _081C8FDC + str r0, [r1, 0x1C] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081C8FC4: .4byte 0x0861fc1c +_081C8FC8: .4byte 0x02020630 +_081C8FCC: .4byte 0x0861fc3c +_081C8FD0: .4byte 0x000003ff +_081C8FD4: .4byte 0xfffffc00 +_081C8FD8: .4byte sub_81C90A0 + 1 +_081C8FDC: .4byte sub_81C90F4 + 1 + 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 obj_delete_and_free_tiles + ldr r0, [r4, 0x40] + bl obj_delete_and_free_tiles + ldr r0, [r4, 0x44] + bl obj_delete_and_free_tiles + movs r0, 0xA + bl gpu_tile_obj_free_by_tag + movs r0, 0x14 + bl gpu_pal_free_tag + 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, _081C9024 + str r1, [r2, 0x1C] + ldr r0, [r5, 0x40] + str r1, [r0, 0x1C] + ldr r0, [r5, 0x44] + str r1, [r0, 0x1C] + b _081C903A + .align 2, 0 +_081C9024: .4byte nullsub_12 + 1 +_081C9028: + ldr r2, [r5, 0x3C] + ldr r0, _081C9074 + str r0, [r2, 0x1C] + ldr r1, [r5, 0x40] + ldr r0, _081C9078 + str r0, [r1, 0x1C] + ldr r1, [r5, 0x44] + ldr r0, _081C907C + 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 + .align 2, 0 +_081C9074: .4byte sub_81C9080 + 1 +_081C9078: .4byte sub_81C90F4 + 1 +_081C907C: .4byte sub_81C90A0 + 1 + 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, _081C909C + adds r0, r1 + ldrh r0, [r0] + lsls r0, 4 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C909C: .4byte 0x0000088e + 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, _081C9244 + mov r8, r2 + ldr r0, [sp] + ands r0, r2 + orrs r0, r4 + lsls r1, 24 + lsrs r1, 16 + ldr r2, _081C9248 + ands r0, r2 + orrs r0, r1 + ldr r1, _081C924C + ands r0, r1 + lsls r5, 24 + ldr r1, _081C9250 + 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, _081C9254 + ands r0, r1 + orrs r0, r3 + str r0, [sp, 0x4] + mov r0, sp + bl Window_AddFromTemplate + 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 + .align 2, 0 +_081C9244: .4byte 0xffffff00 +_081C9248: .4byte 0xffff00ff +_081C924C: .4byte 0xff00ffff +_081C9250: .4byte 0x00ffffff +_081C9254: .4byte 0x0000ffff +_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 flag_check + lsls r0, 24 + cmp r0, 0 + beq _081C928A + movs r4, 0x1 + ldr r0, _081C9294 + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081C928A + movs r4, 0x2 +_081C928A: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081C9294: .4byte 0x0000089b + 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, _081C93B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C93B0: .4byte _081C93B4 + .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, _081C93D8 + b _081C93DE + .align 2, 0 +_081C93D8: .4byte sub_81C963C + 1 +_081C93DC: + ldr r0, _081C93E8 +_081C93DE: + str r0, [r4, 0xC] +_081C93E0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C93E8: .4byte sub_81C96FC + 1 + 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, _081C9404 + b _081C9412 + .align 2, 0 +_081C9404: .4byte sub_81C943C + 1 +_081C9408: + ldr r0, _081C940C + b _081C9412 + .align 2, 0 +_081C940C: .4byte sub_81C9520 + 1 +_081C9410: + ldr r0, _081C9418 +_081C9412: + pop {r1} + bx r1 + .align 2, 0 +_081C9418: .4byte c2_pre_battle_1 + 1 + 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, _081C947C + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + adds r5, r2, 0 + cmp r0, 0 + beq _081C9508 + ldr r3, _081C9480 + 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, _081C9484 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C947C: .4byte 0x030022c0 +_081C9480: .4byte 0x0861fc59 +_081C9484: .4byte _081C9488 + .align 2, 0 +_081C9488: + .4byte _081C949C + .4byte _081C94BC + .4byte _081C94D4 + .4byte _081C94E0 + .4byte _081C9516 +_081C949C: + ldr r0, _081C94B4 + 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, _081C94B8 + b _081C94EE + .align 2, 0 +_081C94B4: .4byte 0x03005d90 +_081C94B8: .4byte 0x000186a6 +_081C94BC: + movs r1, 0 + movs r0, 0x3 + strh r0, [r4] + strh r1, [r4, 0x2] + ldrb r0, [r3, 0x12] + strh r0, [r4, 0x4] + ldr r0, _081C94D0 + str r0, [r4, 0xC] + movs r0, 0x2 + b _081C951A + .align 2, 0 +_081C94D0: .4byte sub_81C963C + 1 +_081C94D4: + movs r0, 0x6 + strh r0, [r4, 0x6] + ldr r1, _081C94DC + b _081C94EE + .align 2, 0 +_081C94DC: .4byte 0x000186ab +_081C94E0: + bl sub_81C76B8 + cmp r0, 0 + beq _081C94FC + movs r0, 0x9 + strh r0, [r4, 0x6] + ldr r1, _081C94F8 +_081C94EE: + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C951A + .align 2, 0 +_081C94F8: .4byte 0x000186ac +_081C94FC: + ldr r0, _081C9504 + str r0, [r4, 0xC] + movs r0, 0x6 + b _081C951A + .align 2, 0 +_081C9504: .4byte sub_81C9600 + 1 +_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, _081C9564 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C9570 + ldr r3, _081C9568 + 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, _081C956C + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C9580 + .align 2, 0 +_081C9564: .4byte 0x030022c0 +_081C9568: .4byte 0x0861fc59 +_081C956C: .4byte 0x000186ab +_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, _081C95CC + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C95E8 + ldr r3, _081C95D0 + 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 + .align 2, 0 +_081C95CC: .4byte 0x030022c0 +_081C95D0: .4byte 0x0861fc59 +_081C95D4: + movs r0, 0x6 + strh r0, [r4, 0x6] + ldr r1, _081C95E4 + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C95F8 + .align 2, 0 +_081C95E4: .4byte 0x000186ab +_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, _081C9628 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081C962C + movs r0, 0 + b _081C9634 + .align 2, 0 +_081C9628: .4byte 0x030022c0 +_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, _081C9680 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _081C96B8 + ldr r5, _081C9684 + 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 + .align 2, 0 +_081C9680: .4byte 0x030022c0 +_081C9684: .4byte 0x0861fc59 +_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, _081C96A0 + str r0, [r4, 0xC] + movs r0, 0x4 + b _081C96F6 + .align 2, 0 +_081C96A0: .4byte sub_81C96FC + 1 +_081C96A4: + strh r3, [r4, 0x6] + ldr r1, _081C96B4 + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C96F6 + .align 2, 0 +_081C96B4: .4byte 0x000186a7 +_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, _081C96DC + ldrh r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + beq _081C96E4 + strh r0, [r4, 0x2] + ldr r0, _081C96E0 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C96F6 + .align 2, 0 +_081C96DC: .4byte 0x0861fc54 +_081C96E0: .4byte sub_81C9798 + 1 +_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, _081C9748 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C9754 + ldr r3, _081C974C + 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, _081C9750 + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x3 + strh r0, [r4, 0x6] + movs r0, 0x8 + b _081C9792 + .align 2, 0 +_081C9748: .4byte 0x030022c0 +_081C974C: .4byte 0x0861fc59 +_081C9750: .4byte 0x000186a8 +_081C9754: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C9790 + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r1, _081C9778 + ldrh r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + beq _081C9780 + strh r0, [r4, 0x2] + ldr r0, _081C977C + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C9792 + .align 2, 0 +_081C9778: .4byte 0x0861fc54 +_081C977C: .4byte sub_81C97A4 + 1 +_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, _081C97B8 + str r1, [r0, 0xC] + bx lr + .align 2, 0 +_081C97B8: .4byte sub_81C97BC + 1 + 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, _081C97F0 + 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, _081C97F4 + str r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081C97F0: .4byte 0x0861fc59 +_081C97F4: .4byte sub_81C943C + 1 + 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, _081C980C + ldrb r1, [r1, 0x13] + strh r1, [r0, 0x4] + ldr r1, _081C9810 + str r1, [r0, 0xC] + bx lr + .align 2, 0 +_081C980C: .4byte 0x0861fc59 +_081C9810: .4byte sub_81C963C + 1 + thumb_func_end sub_81C97F8 + + thumb_func_start sub_81C9814 +sub_81C9814: @ 81C9814 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, _081C9840 + 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, _081C9844 + adds r0, r3, r0 + ldrb r0, [r0] + strh r0, [r4, 0x2] + b _081C986A + .align 2, 0 +_081C9840: .4byte 0x030022c0 +_081C9844: .4byte 0x0861fc54 +_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, _081C9884 + 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, _081C9888 + 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 + .align 2, 0 +_081C9884: .4byte 0x0861fc54 +_081C9888: .4byte 0x0861fc59 +_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, _081C9908 + 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, _081C990C + ldr r0, [r0] + ldr r1, _081C9910 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081C9914 + movs r0, 0x1 + b _081C991C + .align 2, 0 +_081C9908: .4byte 0x02037318 +_081C990C: .4byte 0x03005d8c +_081C9910: .4byte 0x000009ca +_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, _081C9984 + movs r0, 0x2 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C997A + movs r0, 0 + strb r0, [r4, 0xC] + ldr r0, _081C9988 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081C998C + str r0, [r4] +_081C997A: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081C9984: .4byte 0x0000088c +_081C9988: .4byte sub_81C9A10 + 1 +_081C998C: .4byte sub_81C99FC + 1 + 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, _081C99B8 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, _081C99BC + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C99B8: .4byte 0x086201a0 +_081C99BC: .4byte sub_81C99FC + 1 + 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 Window_Remove + 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, _081C9A30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081C9A30: .4byte _081C9A34 + .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, _081C9ADC + movs r1, 0x3 + bl sub_81C7B54 + ldr r1, _081C9AE0 + 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 bg_set_tilemap + ldr r1, _081C9AE4 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _081C9AE8 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset +_081C9AD6: + movs r0, 0 + b _081C9C62 + .align 2, 0 +_081C9ADC: .4byte 0x08620194 +_081C9AE0: .4byte 0x08dc90e0 +_081C9AE4: .4byte 0x08dc9130 +_081C9AE8: .4byte 0x08dc90c0 +_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, _081C9B24 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _081C9B28 + 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, _081C9B2C + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + b _081C9AD6 + .align 2, 0 +_081C9B24: .4byte 0x0861fd6c +_081C9B28: .4byte 0x0861fff4 +_081C9B2C: .4byte 0x0861fd4c +_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, _081C9B7C + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _081C9B80 + 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, _081C9B84 + 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 + .align 2, 0 +_081C9B7C: .4byte 0x0861fc98 +_081C9B80: .4byte 0x0861fcac +_081C9B84: .4byte 0x0861fc78 +_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 gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081C9FE4 +_081C9FCA: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x1 + bls _081C9FCA + ldr r0, _081C9FE8 + bl sub_81C795C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081C9FE4: .4byte 0x086201c4 +_081C9FE8: .4byte 0x086201d4 + thumb_func_end sub_81C9FC4 + + thumb_func_start sub_81C9FEC +sub_81C9FEC: @ 81C9FEC + push {lr} + movs r0, 0x3 + bl gpu_tile_obj_free_by_tag + movs r0, 0x1 + bl gpu_tile_obj_free_by_tag + movs r0, 0x4 + bl gpu_pal_free_tag + movs r0, 0x5 + bl gpu_pal_free_tag + movs r0, 0x6 + bl gpu_pal_free_tag + movs r0, 0x7 + bl gpu_pal_free_tag + movs r0, 0x8 + bl gpu_pal_free_tag + movs r0, 0x3 + bl gpu_pal_free_tag + 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, _081CA08C + movs r1, 0x8C + asrs r2, r5, 16 + movs r3, 0x3 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081CA090 + 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 + .align 2, 0 +_081CA08C: .4byte 0x0862034c +_081CA090: .4byte 0x02020630 + 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 obj_delete_and_free_tiles + 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, _081CA0E8 + adds r0, r2, r1 + subs r1, 0x4 + adds r2, r1 + ldrh r1, [r2] + ldrh r2, [r2, 0x2] + bl sub_81CA0EC + pop {r0} + bx r0 + .align 2, 0 +_081CA0E8: .4byte 0x08620244 + 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 gpu_tile_obj_tag_get_range_start + 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, _081CA1A8 + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r3, 0x4] + ldr r7, _081CA1AC + 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 gpu_pal_tags_index_of + 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 + .align 2, 0 +_081CA1A8: .4byte 0x000003ff +_081CA1AC: .4byte 0xfffffc00 +_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, _081CA350 + 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 + .align 2, 0 +_081CA350: .4byte nullsub_12 + 1 +_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, _081CA3B0 + 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 + .align 2, 0 +_081CA3B0: .4byte sub_81CA474 + 1 + 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, _081CA43C + 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 sub_8008258 + adds r5, 0x1 + cmp r5, 0x3 + ble _081CA3C8 + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + ldr r0, _081CA440 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081CA444 + 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 + .align 2, 0 +_081CA43C: .4byte sub_81CA4AC + 1 +_081CA440: .4byte sub_81CA580 + 1 +_081CA444: .4byte 0x03005e00 + 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, _081CA4A8 + str r0, [r2, 0x1C] +_081CA4A2: + pop {r0} + bx r0 + .align 2, 0 +_081CA4A8: .4byte nullsub_12 + 1 + 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 sub_8008258 + 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 oam_center + 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, _081CA570 + str r0, [r4, 0x1C] + b _081CA578 + .align 2, 0 +_081CA570: .4byte nullsub_12 + 1 +_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, _081CA5A8 + 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 + .align 2, 0 +_081CA5A8: .4byte 0x03005e08 +_081CA5AC: + movs r0, 0x10 + strh r0, [r4, 0x4] + strh r2, [r4, 0x6] + movs r1, 0xFC + lsls r1, 6 + movs r0, 0x50 + bl lcd_io_set + movs r0, 0x52 + movs r1, 0x10 + bl lcd_io_set + 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 lcd_io_set + 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 lcd_io_set + 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, _081CA678 + movs r1, 0x10 + movs r2, 0x60 + movs r3, 0x4 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081CA67C + adds r1, r0 + str r1, [r4, 0x28] + bl sub_81C98D4 + cmp r0, 0 + beq _081CA684 + ldr r1, [r4, 0x28] + ldr r0, _081CA680 + str r0, [r1, 0x1C] + b _081CA690 + .align 2, 0 +_081CA678: .4byte 0x0862036c +_081CA67C: .4byte 0x02020630 +_081CA680: .4byte sub_81CA6AC + 1 +_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 obj_delete_and_free_tiles + 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, _081CA710 + bl Window_AddFromTemplate + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x8] + movs r1, 0x66 + bl Window_FastFillPixels + ldrb r0, [r4, 0x8] + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CA710: .4byte 0x086202cc + 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, _081CA768 + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r6, 0 + bl font_get_width_of_string + adds r4, r0, 0 + ldrb r0, [r5, 0x8] + movs r1, 0x66 + bl Window_FastFillPixels + ldrb r0, [r5, 0x8] + movs r2, 0xC0 + subs r2, r4 + lsrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r1, _081CA76C + 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 + .align 2, 0 +_081CA768: .4byte 0x086202d4 +_081CA76C: .4byte 0x0862030c + 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, _081CA7BC + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r6, 0 + bl font_get_width_of_string + adds r4, r0, 0 + ldrb r0, [r5, 0x8] + movs r1, 0x66 + bl Window_FastFillPixels + ldrb r0, [r5, 0x8] + movs r2, 0xC0 + subs r2, r4 + lsrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r1, _081CA7C0 + 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 + .align 2, 0 +_081CA7BC: .4byte 0x085ebd4a +_081CA7C0: .4byte 0x0862030f + thumb_func_end sub_81CA770 + + thumb_func_start sub_81CA7C4 +sub_81CA7C4: @ 81CA7C4 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + 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, _081CA7F0 + movs r1, 0x2 + bl AddTask + strb r0, [r4, 0xA] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CA7F0: .4byte sub_81CA808 + 1 + 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 bg_change_x_offset + pop {r0} + bx r0 + thumb_func_end sub_81CA808 + + thumb_func_start sub_81CA818 +sub_81CA818: @ 81CA818 + push {r4,r5,lr} + ldr r0, _081CA848 + movs r1, 0x3 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _081CA84C + 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 + .align 2, 0 +_081CA848: .4byte sub_81CA8B0 + 1 +_081CA84C: .4byte 0x0861fc7a + thumb_func_end sub_81CA818 + + thumb_func_start sub_81CA850 +sub_81CA850: @ 81CA850 + push {lr} + ldr r0, _081CA860 + movs r1, 0x31 + movs r2, 0x4 + bl sub_81C7944 + pop {r0} + bx r0 + .align 2, 0 +_081CA860: .4byte 0x0861fc86 + thumb_func_end sub_81CA850 + + thumb_func_start sub_81CA864 +sub_81CA864: @ 81CA864 + push {r4,r5,lr} + ldr r0, _081CA894 + movs r1, 0x3 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _081CA898 + 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 + .align 2, 0 +_081CA894: .4byte sub_81CA8B0 + 1 +_081CA898: .4byte 0x0861fc86 + thumb_func_end sub_81CA864 + + thumb_func_start sub_81CA89C +sub_81CA89C: @ 81CA89C + push {lr} + ldr r0, _081CA8AC + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081CA8AC: .4byte sub_81CA8B0 + 1 + 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, _081CA910 + 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 + .align 2, 0 +_081CA910: .4byte 0x03005e08 + thumb_func_end sub_81CA8B0 + + thumb_func_start sub_81CA914 +sub_81CA914: @ 81CA914 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl copy_super_sprites_to_oam + bl copy_queue_process + 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 lcd_io_set + movs r0, 0x54 + movs r1, 0 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_set_bits + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set_bits + movs r0, 0x4A + movs r1, 0x1F + bl lcd_io_set_bits + movs r0, 0x44 + movs r1, 0xA0 + bl lcd_io_set_bits + bl remove_some_task + bl sub_81CAA3C + ldr r2, _081CA988 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + ldr r0, _081CA98C + bl c3args_set_0toR1_1to0 + ldr r0, _081CA990 + movs r1, 0x3 + bl AddTask + pop {r0} + bx r0 + .align 2, 0 +_081CA988: .4byte 0x08620384 +_081CA98C: .4byte sub_81CA914 + 1 +_081CA990: .4byte sub_81CA9EC + 1 + thumb_func_end titlescreen_0 + + thumb_func_start sub_81CA994 +sub_81CA994: @ 81CA994 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + bl remove_some_task + ldr r0, _081CA9C4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + bl sub_81C760C + pop {r0} + bx r0 + .align 2, 0 +_081CA9C4: .4byte sub_81CA9EC + 1 + thumb_func_end sub_81CA994 + + thumb_func_start sub_81CA9C8 +sub_81CA9C8: @ 81CA9C8 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + 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 lcd_io_set + 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, _081CAA34 + 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, _081CAA38 + 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 lcd_io_set +_081CAA30: + pop {r0} + bx r0 + .align 2, 0 +_081CAA34: .4byte 0x03005e08 +_081CAA38: .4byte 0x08329f40 + 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, _081CAAC8 + 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, _081CAACC + ldr r0, _081CAAD0 + 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, _081CAAD4 + adds r6, r1, 0 + strh r6, [r0] + lsls r4, 1 + adds r5, r4, r5 + ldr r1, _081CAAD8 + 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 + .align 2, 0 +_081CAAC8: .4byte 0x08620240 +_081CAACC: .4byte 0x02038c28 +_081CAAD0: .4byte 0x010000a0 +_081CAAD4: .4byte 0x000072f0 +_081CAAD8: .4byte 0x01000010 + 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, _081CAB14 + str r0, [r4, 0x18] + movs r0, 0 + strh r0, [r4, 0x8] + str r0, [r4, 0x10] + ldr r0, _081CAB18 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CAB1E + .align 2, 0 +_081CAB14: .4byte sub_81CAB44 + 1 +_081CAB18: .4byte sub_81CAD20 + 1 +_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, _081CAB58 + ldrh r1, [r3, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CAB5C + movs r0, 0x2 + b _081CABF4 + .align 2, 0 +_081CAB58: .4byte 0x030022c0 +_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, _081CABB8 + 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, _081CABBC + str r0, [r4, 0x4] + movs r0, 0x2 + strh r0, [r4, 0x2] + b _081CABC6 + .align 2, 0 +_081CABB8: .4byte sub_81CAC04 + 1 +_081CABBC: .4byte 0x0862250a +_081CABC0: + ldr r0, _081CABCC + str r0, [r4, 0x4] + strh r5, [r4, 0x2] +_081CABC6: + movs r0, 0x5 + b _081CABF4 + .align 2, 0 +_081CABCC: .4byte 0x08622508 +_081CABD0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081CABF2 + bl sub_81C767C + cmp r0, 0x1 + beq _081CABEC + ldr r0, _081CABE8 + str r0, [r4, 0x18] + movs r0, 0xF + b _081CABF4 + .align 2, 0 +_081CABE8: .4byte sub_81CABFC + 1 +_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, _081CAC00 + bx lr + .align 2, 0 +_081CAC00: .4byte 0x000186a4 + thumb_func_end sub_81CABFC + + thumb_func_start sub_81CAC04 +sub_81CAC04: @ 81CAC04 + push {r4,lr} + adds r4, r0, 0 + ldr r2, _081CAC20 + 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 + .align 2, 0 +_081CAC20: .4byte 0x030022c0 +_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, _081CAC84 + str r0, [r4, 0x18] + bl sub_81CB1D0 + cmp r0, 0 + beq _081CAC88 + movs r0, 0x9 + b _081CACAC + .align 2, 0 +_081CAC84: .4byte sub_81CACF8 + 1 +_081CAC88: + movs r0, 0x8 + b _081CACAC +_081CAC8C: + ldr r0, _081CAC94 + str r0, [r4, 0x18] + movs r0, 0xB + b _081CACAC + .align 2, 0 +_081CAC94: .4byte sub_81CACB8 + 1 +_081CAC98: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081CACA6 + movs r0, 0 + b _081CACAC +_081CACA6: + ldr r0, _081CACB4 + str r0, [r4, 0x18] + movs r0, 0x7 +_081CACAC: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CACB4: .4byte sub_81CAB44 + 1 + thumb_func_end sub_81CAC04 + + thumb_func_start sub_81CACB8 +sub_81CACB8: @ 81CACB8 + push {lr} + adds r3, r0, 0 + ldr r2, _081CACCC + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CACD0 + movs r0, 0xC + b _081CACF0 + .align 2, 0 +_081CACCC: .4byte 0x030022c0 +_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, _081CACF4 + str r0, [r3, 0x18] + movs r0, 0xE +_081CACF0: + pop {r1} + bx r1 + .align 2, 0 +_081CACF4: .4byte sub_81CAB44 + 1 + thumb_func_end sub_81CACB8 + + thumb_func_start sub_81CACF8 +sub_81CACF8: @ 81CACF8 + push {lr} + adds r2, r0, 0 + ldr r0, _081CAD0C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081CAD10 + movs r0, 0 + b _081CAD16 + .align 2, 0 +_081CAD0C: .4byte 0x030022c0 +_081CAD10: + ldr r0, _081CAD1C + str r0, [r2, 0x18] + movs r0, 0xA +_081CAD16: + pop {r1} + bx r1 + .align 2, 0 +_081CAD1C: .4byte sub_81CAB44 + 1 + 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 flag_check + 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, _081CAEF4 + ldr r0, [r0] + ldr r1, _081CAEF8 + adds r0, r1 + adds r0, r4 + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _081CAEFE + .align 2, 0 +_081CAEF4: .4byte 0x03005d8c +_081CAEF8: .4byte 0x000009ca +_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, _081CAF30 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x3] + b _081CAF6C + .align 2, 0 +_081CAF30: .4byte 0x08310030 +_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, _081CAF54 + adds r0, r4, r0 + ldrb r0, [r0] + b _081CAF6C + .align 2, 0 +_081CAF54: .4byte 0x0831f578 +_081CAF58: + adds r0, r4, 0 + bl sub_81D15BC + adds r4, r0, 0 + ldr r0, _081CAF74 + 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 + .align 2, 0 +_081CAF74: .4byte 0x08310030 + 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, _081CAF9C + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + cmp r0, 0 + bne _081CAFA4 + ldr r0, _081CAFA0 + b _081CAFCE + .align 2, 0 +_081CAF9C: .4byte 0x02037318 +_081CAFA0: .4byte 0x085eeb0b +_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, _081CAFC0 + bl sub_81967AC + strb r0, [r6] + b _081CAFCC + .align 2, 0 +_081CAFC0: .4byte 0x02021fc4 +_081CAFC4: + ldrh r0, [r1, 0x1E] + ldr r1, _081CAFD4 + bl sub_81D189C +_081CAFCC: + ldr r0, _081CAFD4 +_081CAFCE: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081CAFD4: .4byte 0x02021fc4 + 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, _081CB018 + lsls r0, r5, 2 + lsls r1, 4 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] +_081CB012: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081CB018: .4byte 0x08622028 + 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, _081CB080 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0xD + muls r0, r2 + ldr r2, _081CB084 + adds r0, r2 + str r0, [sp] + adds r1, 0x4 + str r1, [sp, 0x4] + b _081CB092 + .align 2, 0 +_081CB080: .4byte 0x08310030 +_081CB084: .4byte 0x0830fcd4 +_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, _081CB0E0 + 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 + .align 2, 0 +_081CB0E0: .4byte 0x085500a4 + 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, _081CB1B8 + ldr r0, [r0] + ldr r1, _081CB1BC + 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, _081CB1B8 + ldr r1, [r1] + ldr r2, _081CB1BC + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _081CB1C0 +_081CB1B2: + movs r0, 0x1 + b _081CB1C8 + .align 2, 0 +_081CB1B8: .4byte 0x03005d8c +_081CB1BC: .4byte 0x000009ca +_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, _081CB20C + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081CB258 + ldr r0, _081CB210 + ldr r0, [r0] + ldr r1, _081CB214 + adds r0, r1 + ldrh r4, [r4, 0x1E] + adds r0, r4 + ldrb r0, [r0] + b _081CB246 + .align 2, 0 +_081CB20C: .4byte 0x02037318 +_081CB210: .4byte 0x03005d8c +_081CB214: .4byte 0x000009ca +_081CB218: + ldrh r0, [r4, 0x1E] + cmp r0, 0xB + bne _081CB258 + adds r0, r1, 0 + bl sub_81CAEA4 + ldr r1, _081CB250 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081CB258 + ldr r0, _081CB254 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081CB258 + movs r0, 0x5B + bl flag_check + lsls r0, 24 +_081CB246: + cmp r0, 0 + bne _081CB258 + movs r0, 0x1 + b _081CB25A + .align 2, 0 +_081CB250: .4byte 0x02037318 +_081CB254: .4byte 0x0000086b +_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, _081CB288 + movs r0, 0x6 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CB294 + movs r0, 0 + strb r0, [r4, 0x19] + ldr r0, _081CB28C + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081CB290 + str r0, [r4] + movs r0, 0x1 + b _081CB296 + .align 2, 0 +_081CB288: .4byte 0x00002048 +_081CB28C: .4byte sub_81CB324 + 1 +_081CB290: .4byte sub_81CB310 + 1 +_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, _081CB2C4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, _081CB2C8 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CB2C4: .4byte 0x08622798 +_081CB2C8: .4byte sub_81CB310 + 1 + 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 Window_Remove + ldrb r0, [r4, 0x10] + bl Window_Remove + ldrb r0, [r4, 0x14] + bl Window_Remove + 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, _081CB344 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CB344: .4byte _081CB348 + .align 2, 0 +_081CB348: + .4byte _081CB368 + .4byte _081CB3D4 + .4byte _081CB424 + .4byte _081CB468 + .4byte _081CB482 + .4byte _081CB494 + .4byte _081CB4A6 + .4byte _081CB4EA +_081CB368: + ldr r0, _081CB3C0 + movs r1, 0x3 + bl sub_81C7B54 + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r1, _081CB3C4 + 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, _081CB3C8 + adds r1, r5, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, _081CB3CC + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _081CB3D0 + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x2 + b _081CB418 + .align 2, 0 +_081CB3C0: .4byte 0x0862278c +_081CB3C4: .4byte 0x08622530 +_081CB3C8: .4byte 0x00001024 +_081CB3CC: .4byte 0x086225d4 +_081CB3D0: .4byte 0x08622510 +_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 bg_set_tilemap + 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 bg_fill_tilemap_rect + ldr r0, _081CB420 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 +_081CB418: + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + b _081CB506 + .align 2, 0 +_081CB420: .4byte 0x086226e0 +_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, _081CB45C + str r4, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, _081CB460 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, _081CB464 + movs r1, 0x50 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0 + b _081CB506 + .align 2, 0 +_081CB45C: .4byte 0x08622760 +_081CB460: .4byte 0x08622700 +_081CB464: .4byte 0x08622720 +_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 bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081CB7F4 + bl audio_play + strb r4, [r5, 0xE] + movs r0, 0 + b _081CB81C + .align 2, 0 +_081CB7F4: .4byte 0x00000107 +_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, _081CB8A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CB8A4: .4byte _081CB8A8 + .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 is_dma3_queue_busy_with_gpu_copy + 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, _081CB9E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CB9E4: .4byte _081CB9E8 + .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 is_dma3_queue_busy_with_gpu_copy + 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, _081CBAF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CBAF0: .4byte _081CBAF4 + .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, _081CBC0C + str r0, [sp, 0x10] + ldr r0, _081CBC10 + str r0, [sp, 0x14] + ldr r0, _081CBC14 + movs r2, 0x2 + bl sub_81C81D4 + ldr r0, _081CBC18 + movs r1, 0x7 + bl AddTask + add sp, 0x18 + pop {r0} + bx r0 + .align 2, 0 +_081CBC0C: .4byte sub_81CB050 + 1 +_081CBC10: .4byte sub_81CBCEC + 1 +_081CBC14: .4byte 0x08622794 +_081CBC18: .4byte sub_81CBC64 + 1 + thumb_func_end sub_81CBBB8 + + thumb_func_start sub_81CBC1C +sub_81CBC1C: @ 81CBC1C + push {lr} + bl sub_81C8234 + ldr r0, _081CBC34 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + .align 2, 0 +_081CBC34: .4byte sub_81CBC64 + 1 + thumb_func_end sub_81CBC1C + + thumb_func_start sub_81CBC38 +sub_81CBC38: @ 81CBC38 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081CBC5C + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081CBC56 + ldr r1, _081CBC60 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x26] +_081CBC56: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CBC5C: .4byte sub_81CBC64 + 1 +_081CBC60: .4byte 0x03005e00 + 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, _081CBCD0 + 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, _081CBCD4 + 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, _081CBCD8 + adds r1, r0, 0 + adds r1, 0x20 + movs r3, 0x2 + ldrsh r2, [r2, r3] + str r2, [sp] + ldr r4, _081CBCDC + str r4, [sp, 0x4] + movs r2, 0x10 + movs r3, 0x10 + bl sub_81C79BC + ldr r0, _081CBCE0 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081CBCC8 + ldr r1, _081CBCE4 + ldr r2, _081CBCE8 + adds r0, r4, 0 + bl CpuSet +_081CBCC8: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CBCD0: .4byte 0x03005e08 +_081CBCD4: .4byte 0x08329f40 +_081CBCD8: .4byte 0x08622720 +_081CBCDC: .4byte 0x020377b4 +_081CBCE0: .4byte 0x02037fd4 +_081CBCE4: .4byte 0x02037bb4 +_081CBCE8: .4byte 0x04000008 + 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 Window_GetField + lsls r0, 24 + lsrs r0, 24 + bl bg_get_tilemap + 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, _081CBD2C + adds r0, r2, 0 + strh r0, [r1] + b _081CBD3C + .align 2, 0 +_081CBD2C: .4byte 0x00005001 +_081CBD30: + ldr r0, _081CBD44 + 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 + .align 2, 0 +_081CBD44: .4byte 0x00005002 + 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 Window_GetField + lsls r0, 24 + lsrs r0, 24 + bl bg_get_tilemap + lsls r4, 7 + adds r4, 0x3A + adds r0, r4 + ldr r2, _081CBD74 + adds r1, r2, 0 + strh r1, [r0] + adds r0, 0x40 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CBD74: .4byte 0x00005002 + thumb_func_end sub_81CBD48 + + thumb_func_start sub_81CBD78 +sub_81CBD78: @ 81CBD78 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081CBDB8 + bl Window_AddFromTemplate + strh r0, [r4, 0x10] + ldr r0, _081CBDBC + bl Window_AddFromTemplate + strh r0, [r4, 0x12] + ldrb r0, [r4, 0x10] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0x10] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x12] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0x12] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x10] + movs r1, 0x1 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CBDB8: .4byte 0x086227d8 +_081CBDBC: .4byte 0x086227e0 + 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 Window_FastFillPixels + 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 Window_CopyToVram + 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, _081CBE08 + movs r2, 0 + bl sub_81CBE88 + pop {r0} + bx r0 + .align 2, 0 +_081CBE08: .4byte 0x085ebe5f + 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 decimal_int_to_string + 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, _081CBE4C + movs r2, 0x2 + bl sub_81CBE88 + pop {r0} + bx r0 + .align 2, 0 +_081CBE4C: .4byte 0x085ebe6e + 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, _081CBE84 + cmp r1, r0 + ble _081CBE68 + adds r1, r0, 0 +_081CBE68: + mov r0, sp + movs r2, 0 + movs r3, 0x5 + bl decimal_int_to_string + adds r0, r4, 0 + mov r1, sp + movs r2, 0x3 + bl sub_81CBEB4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CBE84: .4byte 0x0001869f + 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 sub_81DB368 + 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, _081CBF5C + add r0, sp, 0xC + bl gf_strcpy +_081CBF24: + movs r0, 0x7 + add r1, sp, 0xC + movs r2, 0x58 + bl sub_81DB35C + adds r4, r0, 0 + ldrb r0, [r5, 0x10] + movs r1, 0x11 + bl Window_FastFillPixels + 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 + .align 2, 0 +_081CBF5C: .4byte 0x085ec00f + 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 Window_FastFillPixels + movs r4, 0 + movs r6, 0x80 + lsls r6, 17 + b _081CBF9C +_081CBF76: + ldrb r0, [r5, 0x12] + ldr r2, _081CBFC0 + 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 Window_CopyToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081CBFC0: .4byte 0x086227e8 + thumb_func_end sub_81CBF60 + + thumb_func_start sub_81CBFC4 +sub_81CBFC4: @ 81CBFC4 + push {r4,lr} + adds r4, r0, 0 + bl is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 Window_FastFillPixels + ldrb r0, [r4, 0x12] + movs r1, 0x2 + bl Window_CopyToVram + 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, _081CC054 + bl Window_AddFromTemplate + 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 + .align 2, 0 +_081CC054: .4byte 0x08622808 + 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 Window_FastFillPixels + ldrb r0, [r4, 0x14] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x14] + movs r1, 0x3 + bl Window_CopyToVram + 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 Window_FastFillPixels + ldrb r0, [r4, 0x14] + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x14] + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC09C + + thumb_func_start sub_81CC0D0 +sub_81CC0D0: @ 81CC0D0 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + 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, _081CC100 + 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 + .align 2, 0 +_081CC100: .4byte 0x086227f4 + thumb_func_end sub_81CC0E0 + + thumb_func_start sub_81CC104 +sub_81CC104: @ 81CC104 + push {r4,lr} + adds r4, r0, 0 + bl run_remoboxes + ldrb r0, [r4, 0x14] + bl a_pressed_maybe + 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, _081CC13C + 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 + .align 2, 0 +_081CC13C: .4byte 0x085ebf95 + thumb_func_end sub_81CC11C + + thumb_func_start sub_81CC140 +sub_81CC140: @ 81CC140 + push {r4,lr} + adds r4, r0, 0 + bl run_remoboxes + ldrb r0, [r4, 0x14] + bl a_pressed_maybe + 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, _081CC1B0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081CC1B8 + ldr r0, _081CC1B4 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _081CC1C4 + .align 2, 0 +_081CC1B0: .4byte 0x030022c0 +_081CC1B4: .4byte 0x03003014 +_081CC1B8: + ldr r2, _081CC1D8 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_081CC1C4: + bl run_remoboxes + ldrb r0, [r4, 0x14] + bl a_pressed_maybe + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CC1D8: .4byte 0x03003014 + 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 bg_fill_tilemap_rect + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81CC1DC + + thumb_func_start sub_81CC204 +sub_81CC204: @ 81CC204 + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + 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, _081CC298 +_081CC224: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081CC224 + ldr r0, _081CC29C + bl sub_81C795C + movs r0, 0 + str r0, [r6, 0x1C] + ldr r1, _081CC2A0 + adds r0, r6, r1 + str r0, [sp] + ldr r1, _081CC2A4 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + ldr r1, _081CC2A8 + ands r0, r1 + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r2, _081CC2AC + adds r1, r6, r2 + lsls r0, 16 + lsrs r0, 11 + ldr r2, _081CC2B0 + adds r0, r2 + str r0, [r1] + movs r0, 0xD + bl gpu_pal_alloc_new + 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 + .align 2, 0 +_081CC298: .4byte 0x08622810 +_081CC29C: .4byte 0x08622818 +_081CC2A0: .4byte 0x00001828 +_081CC2A4: .4byte 0xffff0000 +_081CC2A8: .4byte 0x0000ffff +_081CC2AC: .4byte 0x00001824 +_081CC2B0: .4byte 0x06010000 + 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 obj_delete_and_free_tiles +_081CC2C8: + ldr r0, [r4, 0x20] + cmp r0, 0 + beq _081CC2D2 + bl obj_delete_and_free_tiles +_081CC2D2: + movs r0, 0x8 + bl gpu_tile_obj_free_by_tag + movs r0, 0x7 + bl gpu_tile_obj_free_by_tag + movs r0, 0xC + bl gpu_pal_free_tag + movs r0, 0xD + bl gpu_pal_free_tag + 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, _081CC328 + movs r1, 0x4 + movs r2, 0x50 + movs r3, 0x5 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081CC32C + 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 + .align 2, 0 +_081CC328: .4byte 0x08622830 +_081CC32C: .4byte 0x02020630 + 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 obj_delete_and_free_tiles + 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, _081CC394 + movs r1, 0x2C + movs r2, 0x68 + movs r3, 0x6 + bl obj_add_from_template_forward_search + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081CC398 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_081CC394: .4byte 0x08622850 +_081CC398: .4byte 0x02020630 + 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, _081CC408 + adds r0, r4, r0 + ldr r1, _081CC40C + adds r5, r7, r1 + adds r1, r5, 0 + movs r2, 0 + bl sub_80345F0 + ldr r0, _081CC410 + adds r4, r0 + ldr r0, [r4] + ldr r1, _081CC414 + adds r6, r7, r1 + adds r1, r6, 0 + bl LZ77UnCompWram + ldr r1, _081CC418 + adds r0, r7, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + adds r0, r5, 0 + movs r3, 0x1 + bl dma3_transfer_queue_add_copy + 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, _081CC41C + str r0, [r1, 0x1C] +_081CC400: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081CC408: .4byte 0x08305654 +_081CC40C: .4byte 0x00001828 +_081CC410: .4byte 0x0830593c +_081CC414: .4byte 0x00002028 +_081CC418: .4byte 0x00001824 +_081CC41C: .4byte sub_81CC440 + 1 + thumb_func_end sub_81CC39C + + thumb_func_start sub_81CC420 +sub_81CC420: @ 81CC420 + ldr r1, [r0, 0x20] + ldr r0, _081CC428 + str r0, [r1, 0x1C] + bx lr + .align 2, 0 +_081CC428: .4byte sub_81CC4A4 + 1 + thumb_func_end sub_81CC420 + + thumb_func_start sub_81CC42C +sub_81CC42C: @ 81CC42C + ldr r0, [r0, 0x20] + ldr r1, [r0, 0x1C] + ldr r0, _081CC43C + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_081CC43C: .4byte nullsub_12 + 1 + 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 dma3_transfer_queue_check_for_space + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081CC498 + ldr r0, _081CC480 + 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 + .align 2, 0 +_081CC480: .4byte 0x0000ffb0 +_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, _081CC4A0 + str r0, [r4, 0x1C] +_081CC498: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CC4A0: .4byte nullsub_12 + 1 + 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, _081CC4D0 + str r0, [r3, 0x1C] +_081CC4CA: + pop {r0} + bx r0 + .align 2, 0 +_081CC4D0: .4byte nullsub_12 + 1 + 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, _081CC4F4 + movs r0, 0x10 + bl sub_81C761C + cmp r0, 0 + bne _081CC4F8 +_081CC4F0: + movs r0, 0 + b _081CC51A + .align 2, 0 +_081CC4F4: .4byte 0x00000884 +_081CC4F8: + ldr r0, _081CC50C + ldrb r0, [r0, 0x14] + bl sub_8124668 + str r0, [r4, 0xC] + cmp r0, 0 + bne _081CC514 + ldr r0, _081CC510 + b _081CC516 + .align 2, 0 +_081CC50C: .4byte 0x02037318 +_081CC510: .4byte sub_81CC568 + 1 +_081CC514: + ldr r0, _081CC520 +_081CC516: + str r0, [r4, 0x10] + movs r0, 0x1 +_081CC51A: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CC520: .4byte sub_81CC5B4 + 1 + thumb_func_end sub_81CC4D4 + + thumb_func_start sub_81CC524 +sub_81CC524: @ 81CC524 + push {lr} + bl sub_8124658 + ldr r1, _081CC550 + 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 + .align 2, 0 +_081CC550: .4byte 0x03005d90 + 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, _081CC5A8 + str r0, [r4, 0x10] + movs r0, 0x4 + b _081CC5AE + .align 2, 0 +_081CC5A8: .4byte sub_81CC5DC + 1 +_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, _081CC5C8 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081CC5CC + movs r0, 0 + b _081CC5D2 + .align 2, 0 +_081CC5C8: .4byte 0x030022c0 +_081CC5CC: + ldr r0, _081CC5D8 + str r0, [r2, 0x10] + movs r0, 0x4 +_081CC5D2: + pop {r1} + bx r1 + .align 2, 0 +_081CC5D8: .4byte sub_81CC5DC + 1 + thumb_func_end sub_81CC5B4 + + thumb_func_start sub_81CC5DC +sub_81CC5DC: @ 81CC5DC + ldr r0, _081CC5E0 + bx lr + .align 2, 0 +_081CC5E0: .4byte 0x000186a1 + 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, _081CC618 + movs r0, 0x4 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CC624 + ldr r0, _081CC61C + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081CC620 + str r0, [r4] + movs r0, 0x1 + b _081CC626 + .align 2, 0 +_081CC618: .4byte 0x00001948 +_081CC61C: .4byte sub_81CC6F4 + 1 +_081CC620: .4byte sub_81CC6BC + 1 +_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, _081CC654 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, _081CC658 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CC654: .4byte 0x086230e4 +_081CC658: .4byte sub_81CC6BC + 1 + 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 Window_Remove + movs r0, 0x10 + bl sub_81C7650 + movs r0, 0x4 + bl sub_81C7650 + bl sub_81C760C + movs r0, 0 + bl call_gpu_set_bg_mode + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _081CC6E8 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsrs r0, 3 + movs r1, 0x1 + ands r0, r1 + b _081CC6EE + .align 2, 0 +_081CC6E8: .4byte 0x03005d90 +_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, _081CC710 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CC710: .4byte _081CC714 + .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 gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + movs r0, 0x1 + bl call_gpu_set_bg_mode + ldr r4, _081CC780 + 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 + .align 2, 0 +_081CC780: .4byte 0x086230d8 +_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 gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + ldr r0, _081CC800 + bl c3args_set_0toR1_1to0 + b _081CC77C + .align 2, 0 +_081CC800: .4byte sub_81CC6A4 + 1 +_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 gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + 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, _081CC9E4 +_081CC9C6: + adds r0, r4, 0 + bl gpu_tile_obj_decompress_and_load + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081CC9C6 + ldr r0, _081CC9E8 + bl sub_81C795C + bl sub_81CCE58 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CC9E4: .4byte 0x086230f8 +_081CC9E8: .4byte 0x08623100 + 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 gpu_tile_obj_free_by_tag + movs r0, 0xB + bl gpu_pal_free_tag + adds r5, r4, 0 + adds r5, 0xC + movs r4, 0x2 +_081CCA08: + ldm r5!, {r0} + bl obj_delete_and_free_tiles + 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, _081CCAC8 + adds r0, r1, 0 + adds r1, r4, 0 + bl CpuSet + movs r0, 0x1 + adds r1, r4, 0 + bl bg_set_tilemap + ldr r0, _081CCACC + bl Window_AddFromTemplate + 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, _081CCAD0 + 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 Window_FastFillPixels + ldrb r0, [r5, 0x8] + bl Window_WriteStandardTileMap + ldrb r0, [r5, 0x8] + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _081CCAD4 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, _081CCAD8 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + bl sub_8124658 + lsls r0, 24 + cmp r0, 0 + bne _081CCAE0 + ldr r1, _081CCADC + movs r0, 0x1 + movs r2, 0 + bl bg_change_y_offset + b _081CCAEA + .align 2, 0 +_081CCAC8: .4byte 0x01000400 +_081CCACC: .4byte 0x08623110 +_081CCAD0: .4byte 0x08622888 +_081CCAD4: .4byte 0x08622868 +_081CCAD8: .4byte 0x08dc91e8 +_081CCADC: .4byte 0xffffa000 +_081CCAE0: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset +_081CCAEA: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + 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, _081CCB2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CCB2C: .4byte _081CCB30 + .align 2, 0 +_081CCB30: + .4byte _081CCC1C + .4byte _081CCBDC + .4byte _081CCB44 + .4byte _081CCB8E + .4byte _081CCBDC +_081CCB44: + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0x8] + movs r1, 0x2 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0xC + bl Window_WriteStandardTileMapRect + 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 Window_CopyToVram + movs r0, 0 + bl sub_81CCFA4 + b _081CCC40 +_081CCB8E: + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0x8] + movs r1, 0x2 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0xC + bl Window_WriteStandardTileMapRect + 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, _081CCBD8 + 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 Bg_FillWramTileMapRectWithTileAndPalette + b _081CCC0C + .align 2, 0 +_081CCBD8: .4byte 0x00001041 +_081CCBDC: + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0x8] + bl Window_WriteStandardTileMap + 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 Window_CopyToVram + movs r0, 0x1 + bl sub_81CCFA4 + b _081CCC40 +_081CCC1C: + ldr r1, _081CCC48 + 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 Bg_FillWramTileMapRectWithTileAndPalette + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0x1 + bl sub_81CCFA4 +_081CCC40: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CCC48: .4byte 0x00001041 + thumb_func_end sub_81CCB0C + + thumb_func_start sub_81CCC4C +sub_81CCC4C: @ 81CCC4C + push {lr} + bl is_dma3_queue_busy_with_gpu_copy + 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, _081CCC80 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, _081CCC84 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CCC80: .4byte sub_81CCC9C + 1 +_081CCC84: .4byte 0x03005e00 + thumb_func_end sub_81CCC5C + + thumb_func_start sub_81CCC88 +sub_81CCC88: @ 81CCC88 + push {lr} + ldr r0, _081CCC98 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_081CCC98: .4byte sub_81CCC9C + 1 + 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, _081CCCDC + 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 bg_change_y_offset + cmp r0, 0 + blt _081CCCD6 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + adds r0, r4, 0 + bl remove_task +_081CCCD6: + bl sub_81CCF78 + b _081CCD04 + .align 2, 0 +_081CCCDC: .4byte 0x03005e00 +_081CCCE0: + movs r1, 0x90 + lsls r1, 3 + movs r0, 0x1 + movs r2, 0x2 + bl bg_change_y_offset + ldr r1, _081CCD0C + cmp r0, r1 + bgt _081CCD00 + movs r0, 0x1 + movs r2, 0 + bl bg_change_y_offset + adds r0, r5, 0 + bl remove_task +_081CCD00: + bl sub_81CCF78 +_081CCD04: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CCD0C: .4byte 0xffffa000 + thumb_func_end sub_81CCC9C + + thumb_func_start sub_81CCD10 +sub_81CCD10: @ 81CCD10 + push {lr} + ldr r0, _081CCD20 + movs r1, 0x1 + bl sub_81C7078 + pop {r0} + bx r0 + .align 2, 0 +_081CCD20: .4byte sub_81CCD34 + 1 + thumb_func_end sub_81CCD10 + + thumb_func_start sub_81CCD24 +sub_81CCD24: @ 81CCD24 + push {lr} + ldr r0, _081CCD30 + bl sub_81C7124 + pop {r1} + bx r1 + .align 2, 0 +_081CCD30: .4byte sub_81CCD34 + 1 + 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, _081CCD68 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + movs r1, 0xC8 + muls r1, r4 + ldr r3, _081CCD6C + adds r1, r3 + adds r1, r2, r1 + bl LZ77UnCompWram + movs r0, 0x1 +_081CCD62: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CCD68: .4byte 0x08623118 +_081CCD6C: .4byte 0x00000818 + 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, _081CCDDC + 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, _081CCDE0 + movs r0, 0xC + str r0, [sp] + movs r0, 0xB + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0x11 + movs r3, 0x6 + bl bg_fill_tilemap_rect + movs r0, 0xC8 + adds r1, r4, 0 + muls r1, r0 + ldr r0, _081CCDE4 + 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 gpu_copy_to_iwram_tile_map_rect +_081CCDD4: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081CCDDC: .4byte 0x08623118 +_081CCDE0: .4byte 0x00001041 +_081CCDE4: .4byte 0x00000818 + 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, _081CCE04 + movs r4, 0x88 + lsls r4, 21 + lsls r1, 24 + mov r8, r1 + lsls r7, r2, 24 + b _081CCE34 + .align 2, 0 +_081CCE04: .4byte 0x02021cc4 +_081CCE08: + adds r0, r6, 0 + movs r2, 0 + movs r3, 0xC + bl sub_8009128 + 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, _081CCEE4 + asrs r2, r7, 16 + movs r3, 0x8 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, _081CCEE8 + 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, _081CCEEC + adds r0, r4, 0 + ands r1, r0 + ldr r4, _081CCEF0 + 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 + .align 2, 0 +_081CCEE4: .4byte 0x086231d0 +_081CCEE8: .4byte 0x02020630 +_081CCEEC: .4byte 0x000003ff +_081CCEF0: .4byte 0xfffffc00 + 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, _081CCF54 + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, _081CCF58 + 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 + .align 2, 0 +_081CCF54: .4byte 0x000003ff +_081CCF58: .4byte 0xfffffc00 +_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 bg_get_y_offset + 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, _081CD008 + movs r0, 0xB + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CD01C + ldr r1, _081CD00C + adds r0, r4, r1 + bl sub_81D1ED4 + bl sub_81CD970 + ldr r1, _081CD010 + movs r0, 0x14 + strh r0, [r1] + ldr r0, _081CD014 + adds r1, r4, r0 + ldr r0, _081CD018 + str r0, [r1] + movs r0, 0x1 + b _081CD01E + .align 2, 0 +_081CD008: .4byte 0x0000678c +_081CD00C: .4byte 0x00006428 +_081CD010: .4byte 0x030022b0 +_081CD014: .4byte 0x00006304 +_081CD018: .4byte sub_81CD08C + 1 +_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, _081CD054 + movs r0, 0xB + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CD068 + ldr r1, _081CD058 + adds r0, r4, r1 + bl sub_81D1ED4 + bl sub_81CD9F8 + ldr r1, _081CD05C + movs r0, 0x14 + strh r0, [r1] + ldr r0, _081CD060 + adds r1, r4, r0 + ldr r0, _081CD064 + str r0, [r1] + movs r0, 0x1 + b _081CD06A + .align 2, 0 +_081CD054: .4byte 0x0000678c +_081CD058: .4byte 0x00006428 +_081CD05C: .4byte 0x030022b0 +_081CD060: .4byte 0x00006304 +_081CD064: .4byte sub_81CD08C + 1 +_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, _081CD088 + adds r1, r0, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .align 2, 0 +_081CD088: .4byte 0x00006304 + 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, _081CD0E4 + 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, _081CD0E8 + adds r1, r4, r0 + ldr r0, _081CD0EC + str r0, [r1] + movs r2, 0x2 + b _081CD100 + .align 2, 0 +_081CD0E4: .4byte 0x030022c0 +_081CD0E8: .4byte 0x00006304 +_081CD0EC: .4byte sub_81CD19C + 1 +_081CD0F0: + movs r0, 0x5 + bl audio_play + movs r2, 0x5 + ldr r0, _081CD108 + adds r1, r4, r0 + ldr r0, _081CD10C + str r0, [r1] +_081CD100: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081CD108: .4byte 0x00006304 +_081CD10C: .4byte sub_81CD110 + 1 + 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, _081CD168 + adds r5, r6, r1 + movs r1, 0 + ldrsb r1, [r5, r1] + ldr r2, _081CD16C + 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, _081CD170 + adds r0, r1 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr + b _081CD180 + .align 2, 0 +_081CD168: .4byte 0x00006786 +_081CD16C: .4byte 0x00006783 +_081CD170: .4byte 0x020244ec +_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, _081CD194 + adds r1, r6, r0 + ldr r0, _081CD198 + str r0, [r1] + movs r4, 0x6 +_081CD18A: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081CD194: .4byte 0x00006304 +_081CD198: .4byte sub_81CD08C + 1 + 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, _081CD1B0 + b _081CD1B6 + .align 2, 0 +_081CD1B0: .4byte 0x000186aa +_081CD1B4: + ldr r0, _081CD1BC +_081CD1B6: + pop {r1} + bx r1 + .align 2, 0 +_081CD1BC: .4byte 0x000186a2 + 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, _081CD21C + 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 + .align 2, 0 +_081CD21C: .4byte 0x030022c0 +_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, _081CD280 + adds r0, r4, r1 + b _081CD288 + .align 2, 0 +_081CD280: .4byte 0x00006788 +_081CD284: + ldr r2, _081CD2C8 + 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, _081CD2CC + adds r0, r4, r1 + ldr r2, _081CD2D0 + adds r1, r4, r2 + movs r2, 0 + ldrsb r2, [r1, r2] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + ldr r3, _081CD2D4 + 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 + .align 2, 0 +_081CD2C8: .4byte 0x00006787 +_081CD2CC: .4byte 0x00006428 +_081CD2D0: .4byte 0x00006786 +_081CD2D4: .4byte 0x0000643c +_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, _081CD320 + adds r2, r4, r1 + ldrb r0, [r2] + adds r1, 0x1 + adds r3, r4, r1 + strb r0, [r3] + ldr r0, _081CD324 + adds r1, r4, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r7, [r1] + ldrb r1, [r3] + ldr r2, _081CD328 + 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 + .align 2, 0 +_081CD320: .4byte 0x00006787 +_081CD324: .4byte 0x00006786 +_081CD328: .4byte 0x00006789 +_081CD32C: + ldrh r0, [r5] + subs r1, r0, 0x1 + b _081CD384 +_081CD332: + ldr r0, _081CD360 + adds r2, r4, r0 + ldrb r0, [r2] + ldr r1, _081CD364 + adds r3, r4, r1 + strb r0, [r3] + ldr r0, _081CD368 + adds r1, r4, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r7, [r1] + ldrb r1, [r3] + ldr r2, _081CD36C + 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 + .align 2, 0 +_081CD360: .4byte 0x00006788 +_081CD364: .4byte 0x00006787 +_081CD368: .4byte 0x00006786 +_081CD36C: .4byte 0x00006789 +_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, _081CD398 + adds r0, r4, r2 + strh r1, [r0] + ldrh r4, [r5, 0x2] + bl sub_81CDD5C + cmp r0, 0 + beq _081CD39C + ldrh r1, [r5] + b _081CD3A0 + .align 2, 0 +_081CD398: .4byte 0x00006302 +_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, _081CD3EC + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0x9 + bls _081CD3E2 + b _081CD530 +_081CD3E2: + lsls r0, 2 + ldr r1, _081CD3F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CD3EC: .4byte 0x0000678a +_081CD3F0: .4byte _081CD3F4 + .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, _081CD464 + 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 + .align 2, 0 +_081CD464: .4byte 0x00006786 +_081CD468: + ldr r0, _081CD484 + adds r1, r4, r0 + movs r0, 0 + strb r0, [r1] + ldr r2, _081CD488 + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _081CD48C + adds r1, r4, r0 + movs r0, 0x2 + strb r0, [r1] + b _081CD530 + .align 2, 0 +_081CD484: .4byte 0x00006786 +_081CD488: .4byte 0x00006787 +_081CD48C: .4byte 0x00006788 +_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, _081CD52C + adds r1, r4, r2 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _081CD53C + .align 2, 0 +_081CD52C: .4byte 0x0000678a +_081CD530: + ldr r0, _081CD544 + adds r1, r4, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 +_081CD53C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CD544: .4byte 0x0000678a + 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, _081CD580 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, _081CD584 + adds r1, r2 + ldrb r1, [r1] + bl sub_81CD824 + b _081CD5C4 + .align 2, 0 +_081CD580: .4byte 0x00006302 +_081CD584: .4byte 0x00006789 +_081CD588: + ldr r2, _081CD59C + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, _081CD5A0 + adds r1, r2 + ldrb r1, [r1] + bl sub_81CDA1C + b _081CD5C4 + .align 2, 0 +_081CD59C: .4byte 0x00006302 +_081CD5A0: .4byte 0x00006789 +_081CD5A4: + ldr r2, _081CD5BC + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, _081CD5C0 + adds r1, r2 + ldrb r1, [r1] + bl sub_81CDB98 + movs r0, 0x1 + b _081CD5C6 + .align 2, 0 +_081CD5BC: .4byte 0x00006302 +_081CD5C0: .4byte 0x00006789 +_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, _081CD620 + 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, _081CD620 + 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, _081CD620 + 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 + .align 2, 0 +_081CD620: .4byte 0xffff0000 + 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, _081CD68C + adds r0, r5, 0 + movs r2, 0 + movs r3, 0xC + bl sub_8009128 + b _081CD80E + .align 2, 0 +_081CD68C: .4byte 0x085e8264 +_081CD690: + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + adds r3, r5, 0 + bl sub_81D2C68 + adds r0, r5, 0 + bl get_end_of_string_ptr_limit_10_chars + 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, _081CD6DC + 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 + .align 2, 0 +_081CD6DC: .4byte 0x020244ec +_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, _081CD720 + adds r1, r0 + adds r0, r5, 0 + bl sub_8008C44 + cmp r0, 0 + bne _081CD71C + movs r6, 0xFF +_081CD71C: + adds r3, r5, 0 + b _081CD726 + .align 2, 0 +_081CD720: .4byte 0x083185c8 +_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 decimal_int_to_string + 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, _081CD81C + adds r0, r1 + lsrs r4, r0, 16 + ldr r0, _081CD820 + 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 + .align 2, 0 +_081CD81C: .4byte 0xffff0000 +_081CD820: .4byte 0x0000ffff + 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, _081CD8C4 + 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, _081CD8C8 + adds r0, r5, r1 + adds r0, r4 + movs r2, 0 + movs r1, 0xFC + strb r1, [r0] + ldr r1, _081CD8CC + adds r0, r5, r1 + adds r0, r4 + movs r1, 0x4 + strb r1, [r0] + ldr r1, _081CD8D0 + adds r0, r5, r1 + adds r0, r4 + movs r1, 0x8 + strb r1, [r0] + ldr r1, _081CD8D4 + adds r0, r5, r1 + adds r0, r4 + strb r2, [r0] + ldr r2, _081CD8D8 + adds r0, r5, r2 + adds r0, r4 + movs r1, 0x9 + strb r1, [r0] + cmp r3, 0xE + bne _081CD8E4 + adds r0, r4, r5 + ldr r1, _081CD8DC + adds r0, r1 + ldr r1, _081CD8E0 + b _081CD8F4 + .align 2, 0 +_081CD8C4: .4byte 0x00006368 +_081CD8C8: .4byte 0x00006320 +_081CD8CC: .4byte 0x00006321 +_081CD8D0: .4byte 0x00006322 +_081CD8D4: .4byte 0x00006323 +_081CD8D8: .4byte 0x00006324 +_081CD8DC: .4byte 0x00006325 +_081CD8E0: .4byte 0x085ebfce +_081CD8E4: + adds r4, r5 + ldr r2, _081CD8FC + 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 + .align 2, 0 +_081CD8FC: .4byte 0x00006325 +_081CD900: + movs r1, 0 + lsls r4, r6, 6 + lsls r0, r6, 1 + mov r8, r0 + adds r3, r4, 0 + ldr r0, _081CD968 + 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, _081CD968 + 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, _081CD96C + 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, _081CD96C + 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 + .align 2, 0 +_081CD968: .4byte 0x00006368 +_081CD96C: .4byte 0x00006320 + 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, _081CD994 + 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 + .align 2, 0 +_081CD994: .4byte 0x000006ac +_081CD998: + movs r0, 0x64 + muls r0, r4 + ldr r1, _081CD9F0 + 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, _081CD9F4 + adds r0, r7, r1 + strb r2, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081CD9F0: .4byte 0x020244ec +_081CD9F4: .4byte 0x0000678a + 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, _081CDA18 + adds r0, r1 + strb r3, [r0] + pop {r0} + bx r0 + .align 2, 0 +_081CDA18: .4byte 0x0000678a + 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, _081CDAFC + 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, _081CDB00 + 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, _081CDB04 + 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, _081CDB08 + 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, _081CDB0C + 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 + .align 2, 0 +_081CDAFC: .4byte 0x00006428 +_081CDB00: .4byte 0x00006429 +_081CDB04: .4byte 0x0000642a +_081CDB08: .4byte 0x0000642b +_081CDB0C: .4byte 0x0000642c +_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, _081CDB40 + add r1, r8 + add r1, r9 + strb r0, [r1] + mov r0, r9 + adds r1, r5, r0 + ldr r2, _081CDB44 + adds r0, r1, r2 + add r0, r8 + lsls r1, 2 + adds r2, 0x14 + adds r1, r2 + add r1, r8 + bl sub_81D2754 + b _081CDB80 + .align 2, 0 +_081CDB40: .4byte 0x00006783 +_081CDB44: .4byte 0x00006428 +_081CDB48: + movs r2, 0 + mov r0, r9 + lsls r5, r0, 2 + add r5, r9 + ldr r4, _081CDB8C + add r4, r8 + lsls r3, r5, 2 + mov r9, r2 + ldr r7, _081CDB90 + 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, _081CDB94 + 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 + .align 2, 0 +_081CDB8C: .4byte 0x00006428 +_081CDB90: .4byte 0x0000643c +_081CDB94: .4byte 0x0000643e + 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, _081CDC4C + 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 sub_8034654 + 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 + .align 2, 0 +_081CDC4C: .4byte 0x0830a18c + 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, _081CDC80 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_081CDC80: .4byte 0x00006428 + thumb_func_end sub_81CDC70 + + thumb_func_start sub_81CDC84 +sub_81CDC84: @ 81CDC84 + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r1, _081CDC98 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081CDC98: .4byte 0x00006786 + thumb_func_end sub_81CDC84 + + thumb_func_start sub_81CDC9C +sub_81CDC9C: @ 81CDC9C + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r1, _081CDCB0 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081CDCB0: .4byte 0x00006302 + 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, _081CDD00 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_081CDD00: .4byte 0x00006789 + 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, _081CDD20 + adds r4, r1 + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CDD20: .4byte 0x00006368 + 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, _081CDD44 + adds r1, r2 + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CDD44: .4byte 0x00006320 + 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, _081CDDAC + 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 + .align 2, 0 +_081CDDAC: .4byte 0x00006786 + thumb_func_end sub_81CDD7C + + thumb_func_start sub_81CDDB0 +sub_81CDDB0: @ 81CDDB0 + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r2, _081CDDD0 + 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 + .align 2, 0 +_081CDDD0: .4byte 0x00006786 + thumb_func_end sub_81CDDB0 + + thumb_func_start sub_81CDDD4 +sub_81CDDD4: @ 81CDDD4 + push {r4,lr} + ldr r1, _081CDE0C + movs r0, 0xC + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CDE24 + ldr r0, _081CDE10 + adds r1, r4, r0 + movs r0, 0xFF + strb r0, [r1] + ldr r0, _081CDE14 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4] + ldr r0, _081CDE18 + adds r1, r4, r0 + ldr r0, _081CDE1C + str r0, [r1] + ldr r0, _081CDE20 + adds r1, r4, r0 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _081CDE26 + .align 2, 0 +_081CDE0C: .4byte 0x000038ac +_081CDE10: .4byte 0x00001816 +_081CDE14: .4byte sub_81CDE94 + 1 +_081CDE18: .4byte 0x00001810 +_081CDE1C: .4byte sub_81CDE80 + 1 +_081CDE20: .4byte 0x00002908 +_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, _081CDE58 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5] + ldr r0, _081CDE5C + adds r5, r0 + ldr r0, _081CDE60 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CDE58: .4byte 0x08623384 +_081CDE5C: .4byte 0x00001810 +_081CDE60: .4byte sub_81CDE80 + 1 + thumb_func_end sub_81CDE2C + + thumb_func_start sub_81CDE64 +sub_81CDE64: @ 81CDE64 + push {lr} + movs r0, 0xC + bl sub_81C763C + ldr r1, _081CDE7C + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + .align 2, 0 +_081CDE7C: .4byte 0x00001810 + 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, _081CDEB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CDEB4: .4byte _081CDEB8 + .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, _081CDF80 + movs r1, 0x3 + bl sub_81C7B54 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + ldr r1, _081CDF84 + movs r0, 0 + bl lcd_io_set + ldr r1, _081CDF88 + movs r0, 0x50 + bl lcd_io_set + ldr r1, _081CDF8C + movs r0, 0x52 + bl lcd_io_set + ldr r1, _081CDF90 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + b _081CDFA8 + .align 2, 0 +_081CDF80: .4byte 0x08623358 +_081CDF84: .4byte 0x00007940 +_081CDF88: .4byte 0x00000844 +_081CDF8C: .4byte 0x0000040b +_081CDF90: .4byte 0x08dc6548 +_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, _081CDFB4 + 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 + .align 2, 0 +_081CDFB4: .4byte 0x08623228 +_081CDFB8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CDFC4 + b _081CE2C0 +_081CDFC4: + ldr r0, _081CE018 + adds r4, r5, 0x4 + adds r1, r4, 0 + bl LZ77UnCompVram + movs r0, 0x3 + adds r1, r4, 0 + bl bg_set_tilemap + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CDFF2 + ldr r1, _081CE01C + movs r0, 0x9 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x5 + bl gpu_copy_to_iwram_tile_map_rect +_081CDFF2: + movs r0, 0x3 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _081CE020 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, _081CE024 + movs r1, 0xF0 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, _081CE028 + adds r1, r5, r0 + ldr r0, _081CE02C + strh r0, [r1] + b _081CDFB0 + .align 2, 0 +_081CE018: .4byte 0x08dc6dfc +_081CE01C: .4byte 0x08dc7070 +_081CE020: .4byte 0x08dc6528 +_081CE024: .4byte 0x08623208 +_081CE028: .4byte 0x00001814 +_081CE02C: .4byte 0x0000ffb0 +_081CE030: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CE03C + b _081CE2C0 +_081CE03C: + ldr r0, _081CE068 + ldr r1, _081CE06C + adds r4, r5, r1 + adds r1, r4, 0 + bl LZ77UnCompVram + movs r0, 0x2 + adds r1, r4, 0 + bl bg_set_tilemap + movs r0, 0x2 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _081CE070 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x2 + bl sub_81D21DC + b _081CDFB0 + .align 2, 0 +_081CE068: .4byte 0x0862323c +_081CE06C: .4byte 0x00001004 +_081CE070: .4byte 0x086231e8 +_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, _081CE0A8 + adds r4, r5, r2 + ldr r2, _081CE0AC + add r0, sp, 0x8 + adds r1, r4, 0 + bl CpuSet + movs r0, 0x1 + adds r1, r4, 0 + bl bg_set_tilemap + b _081CDFB0 + .align 2, 0 +_081CE0A8: .4byte 0x00000804 +_081CE0AC: .4byte 0x05000200 +_081CE0B0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CE0BC + b _081CE2C0 +_081CE0BC: + ldr r0, _081CE0FC + bl Window_AddFromTemplate + movs r2, 0xC1 + lsls r2, 5 + adds r1, r5, r2 + strb r0, [r1] + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CE0F6 + ldr r0, _081CE100 + bl Window_AddFromTemplate + ldr r2, _081CE104 + adds r1, r5, r2 + strb r0, [r1] + ldr r0, _081CE108 + bl Window_AddFromTemplate + ldr r2, _081CE10C + adds r1, r5, r2 + strb r0, [r1] + ldr r0, _081CE110 + bl Window_AddFromTemplate + ldr r2, _081CE114 + adds r1, r5, r2 + strb r0, [r1] +_081CE0F6: + bl TextBox_ResetSomeField + b _081CDFB0 + .align 2, 0 +_081CE0FC: .4byte 0x08623364 +_081CE100: .4byte 0x0862336c +_081CE104: .4byte 0x00001821 +_081CE108: .4byte 0x08623374 +_081CE10C: .4byte 0x00001822 +_081CE110: .4byte 0x0862337c +_081CE114: .4byte 0x00001823 +_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 Window_WriteStandardTileMap + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE19C + b _081CDFB0 +_081CE19C: + ldr r2, _081CE1BC + adds r0, r5, r2 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r1, _081CE1C0 + adds r0, r5, r1 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + ldr r2, _081CE1C4 + adds r0, r5, r2 + ldrb r0, [r0] + bl Window_WriteStandardTileMap + b _081CDFB0 + .align 2, 0 +_081CE1BC: .4byte 0x00001821 +_081CE1C0: .4byte 0x00001822 +_081CE1C4: .4byte 0x00001823 +_081CE1C8: + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_show + 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, _081CE238 + bl c3args_set_0toR1_1to0 + b _081CDFB0 + .align 2, 0 +_081CE238: .4byte sub_81CEE44 + 1 +_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, _081CE2B4 + adds r1, r5, r2 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _081CE2C0 + ldr r0, _081CE2B8 + 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, _081CE2BC + 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 + .align 2, 0 +_081CE2B4: .4byte 0x00001814 +_081CE2B8: .4byte 0x000028e0 +_081CE2BC: .4byte 0x00001816 +_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, _081CE304 + adds r0, r5, r1 + bl sub_81D3520 + movs r0, 0x1 + b _081CE376 + .align 2, 0 +_081CE304: .4byte 0x000028e0 +_081CE308: + bl sub_81CDC70 + ldr r2, _081CE324 + 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 + .align 2, 0 +_081CE324: .4byte 0x00001814 +_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, _081CE370 + adds r0, r5, r1 + bl sub_81D354C + movs r0, 0x1 + bl gpu_sync_bg_hide + movs r0, 0x2 + bl gpu_sync_bg_hide + movs r0, 0x3 + bl gpu_sync_bg_hide + movs r0, 0x1 + b _081CE376 + .align 2, 0 +_081CE370: .4byte 0x000028e0 +_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, _081CE3A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CE3A0: .4byte _081CE3A4 + .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, _081CE3EC + adds r0, r6, r1 + bl sub_81D3520 + b _081CE3D6 + .align 2, 0 +_081CE3EC: .4byte 0x000028e0 +_081CE3F0: + adds r0, r2, 0 + bl sub_81D2074 + b _081CE3D6 +_081CE3F8: + ldr r1, _081CE414 + 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 + .align 2, 0 +_081CE414: .4byte 0x00001814 +_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, _081CE4C0 + adds r1, r6, r0 + adds r0, r2, 0 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _081CE4CC + ldr r1, _081CE4C4 + 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, _081CE4C4 + adds r5, r6, r0 + ldr r1, _081CE4C8 + 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 + .align 2, 0 +_081CE4C0: .4byte 0x00001814 +_081CE4C4: .4byte 0x000028e0 +_081CE4C8: .4byte 0x00001816 +_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, _081CE4F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CE4F4: .4byte _081CE4F8 + .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, _081CE5CC + adds r1, r5, r2 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _081CE5D8 + ldr r0, _081CE5D0 + adds r4, r5, r0 + adds r0, r4, 0 + bl sub_81D3464 + ldr r1, _081CE5D4 + 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 + .align 2, 0 +_081CE5CC: .4byte 0x00001814 +_081CE5D0: .4byte 0x000028e0 +_081CE5D4: .4byte 0x00001816 +_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, _081CE600 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CE600: .4byte _081CE604 + .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, _081CE644 + adds r0, r5, r1 + bl sub_81D3520 + b _081CE62E + .align 2, 0 +_081CE644: .4byte 0x000028e0 +_081CE648: + bl sub_81CDC70 + ldr r2, _081CE65C + adds r1, r5, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + beq _081CE62E + b _081CE6AE + .align 2, 0 +_081CE65C: .4byte 0x00001814 +_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 decimal_int_to_string + ldr r1, _081CE750 + bl gf_strcpy + pop {r1} + bx r1 + .align 2, 0 +_081CE750: .4byte 0x085ebfd7 + 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 Window_FastFillPixels + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE7A6 + b _081CE924 +_081CE7A6: + ldr r1, _081CE7B4 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0 + bl Window_FastFillPixels + b _081CE924 + .align 2, 0 +_081CE7B4: .4byte 0x00001821 +_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, _081CE894 + adds r0, r5, 0 + bl gf_strcpy + ldr r0, _081CE898 + 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 decimal_int_to_string + 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 + .align 2, 0 +_081CE894: .4byte 0x085ebfd7 +_081CE898: .4byte 0x00001821 +_081CE89C: + ldr r1, _081CE8AC + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081CE8B0 + cmp r0, 0x1 + beq _081CE8EC + b _081CE924 + .align 2, 0 +_081CE8AC: .4byte 0x00002908 +_081CE8B0: + cmp r5, 0 + beq _081CE8C4 + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram + b _081CE8D2 +_081CE8C4: + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram +_081CE8D2: + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CE910 + ldr r0, _081CE8E8 + adds r1, r6, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081CE924 + .align 2, 0 +_081CE8E8: .4byte 0x00002908 +_081CE8EC: + cmp r5, 0 + beq _081CE904 + ldr r1, _081CE900 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram + b _081CE910 + .align 2, 0 +_081CE900: .4byte 0x00001821 +_081CE904: + ldr r1, _081CE91C + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl Window_CopyToVram +_081CE910: + ldr r0, _081CE920 + adds r1, r6, r0 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _081CE926 + .align 2, 0 +_081CE91C: .4byte 0x00001821 +_081CE920: .4byte 0x00002908 +_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, _081CE95C + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl Window_CopyToVram + ldr r0, _081CE960 + adds r4, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl Window_CopyToVram + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CE95C: .4byte 0x00001822 +_081CE960: .4byte 0x00001823 + 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 obj_anim_image_start + b _081CE98A +_081CE982: + adds r0, r5, 0 + movs r1, 0x1 + bl obj_anim_image_start +_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 gpu_pal_tags_index_of + 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 obj_anim_image_start + 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, _081CEA64 + adds r0, r6, r1 + movs r2, 0x6A + strh r2, [r0] + ldr r3, _081CEA68 + adds r1, r6, r3 + strh r2, [r1] + bl sub_811F90C + bl sub_811FA90 + ldr r2, _081CEA6C + 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, _081CEA70 + str r1, [r0, 0x1C] + ldr r2, _081CEA74 + adds r1, r6, r2 + str r0, [r1] + movs r0, 0x69 + bl gpu_pal_tags_index_of + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81C7990 + add r3, sp, 0x50 + mov r8, r3 + b _081CEBC6 + .align 2, 0 +_081CEA64: .4byte 0x00001824 +_081CEA68: .4byte 0x00001826 +_081CEA6C: .4byte 0x08623338 +_081CEA70: .4byte sub_81CE9C8 + 1 +_081CEA74: .4byte 0x000028dc +_081CEA78: + mov r0, sp + bl gpu_tile_obj_alloc_and_load_multiple + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081CEAD8 + ldr r2, _081CEACC + adds r0, r6, r2 + adds r0, r4 + strb r3, [r0] + ldr r2, _081CEAD0 + 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, _081CEAD4 + str r1, [r0] + b _081CEAE2 + .align 2, 0 +_081CEACC: .4byte 0x00001806 +_081CEAD0: .4byte 0x02020630 +_081CEAD4: .4byte sub_81CE964 + 1 +_081CEAD8: + ldr r3, _081CEB40 + 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, _081CEB44 + str r0, [r7, 0x14] + cmp r4, 0x5 + bhi _081CEB5C + ldr r0, _081CEB40 + adds r5, r6, r0 + ldr r1, _081CEB48 + 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 obj_add_from_template_forward_search + 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 + .align 2, 0 +_081CEB40: .4byte 0x00001806 +_081CEB44: .4byte nullsub_12 + 1 +_081CEB48: .4byte 0x02020630 +_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, _081CEBB0 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081CEBBC + ldr r1, _081CEBB4 + adds r0, r6, r1 + adds r0, r4 + strb r3, [r0] + ldr r0, _081CEBB8 + 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 + .align 2, 0 +_081CEBB0: .4byte sub_81CE990 + 1 +_081CEBB4: .4byte 0x00001806 +_081CEBB8: .4byte 0x02020630 +_081CEBBC: + ldr r2, _081CEBF0 + 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 gpu_tile_obj_alloc_tag_and_copy_to_vram + 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 + .align 2, 0 +_081CEBF0: .4byte 0x00001806 + 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, _081CEC24 + adds r0, r5, r1 + ldr r0, [r0] + bl obj_delete_and_free_tiles + movs r0, 0x6A + bl gpu_tile_obj_free_by_tag + movs r0, 0x69 + bl gpu_tile_obj_free_by_tag + movs r0, 0x6A + bl gpu_pal_free_tag + movs r0, 0x69 + bl gpu_pal_free_tag + b _081CEC68 + .align 2, 0 +_081CEC24: .4byte 0x000028dc +_081CEC28: + movs r4, 0 +_081CEC2A: + ldr r1, _081CEC94 + adds r0, r5, r1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081CEC98 + adds r0, r1 + bl obj_delete_and_free_tiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _081CEC2A + movs r0, 0x65 + bl gpu_tile_obj_free_by_tag + movs r0, 0x66 + bl gpu_tile_obj_free_by_tag + movs r0, 0x67 + bl gpu_tile_obj_free_by_tag + movs r0, 0x65 + bl gpu_pal_free_tag + movs r0, 0x66 + bl gpu_pal_free_tag +_081CEC68: + ldr r0, _081CEC9C + 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, _081CEC98 + adds r0, r1 + bl obj_delete_and_free_tiles + movs r0, 0x64 + bl gpu_tile_obj_free_by_tag + movs r0, 0x64 + bl gpu_pal_free_tag +_081CEC8E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CEC94: .4byte 0x00001806 +_081CEC98: .4byte 0x02020630 +_081CEC9C: .4byte 0x00001816 + 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 Window_Remove + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CECEC + ldr r1, _081CECE0 + adds r0, r4, r1 + ldrb r0, [r0] + bl Window_Remove + ldr r1, _081CECE4 + adds r0, r4, r1 + ldrb r0, [r0] + bl Window_Remove + ldr r1, _081CECE8 + adds r0, r4, r1 + ldrb r0, [r0] + bl Window_Remove + b _081CECF0 + .align 2, 0 +_081CECE0: .4byte 0x00001821 +_081CECE4: .4byte 0x00001822 +_081CECE8: .4byte 0x00001823 +_081CECEC: + bl sub_81C7FDC +_081CECF0: + movs r1, 0x8A + lsls r1, 5 + movs r0, 0 + bl lcd_io_set + 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, _081CED2C + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x26 + strh r0, [r4, 0x20] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CED2C: .4byte 0x00001814 + 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, _081CEDB0 + 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 gpu_pal_obj_alloc_tag_and_apply + lsls r0, 24 + lsrs r0, 24 + ldr r4, _081CEDB4 + add r4, r8 + strh r0, [r4] + adds r0, r5, 0 + bl gpu_tile_obj_alloc_tag_and_copy_to_vram + ldr r5, _081CEDB8 + add r5, r8 + strh r0, [r5] + mov r0, sp + movs r1, 0x26 + movs r2, 0x68 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strb r0, [r7] + cmp r0, 0x40 + bne _081CEDBC + movs r0, 0x64 + bl gpu_tile_obj_free_by_tag + movs r0, 0x64 + bl gpu_pal_free_tag + movs r0, 0xFF + strb r0, [r7] + b _081CEE26 + .align 2, 0 +_081CEDB0: .4byte 0x00001816 +_081CEDB4: .4byte 0x00001818 +_081CEDB8: .4byte 0x0000181a +_081CEDBC: + strb r0, [r7] + ldr r2, _081CEDEC + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, _081CEDF0 + str r1, [r0] + ldr r1, _081CEDF4 + add r1, r8 + ldrh r0, [r5] + lsls r0, 5 + ldr r2, _081CEDF8 + 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 + .align 2, 0 +_081CEDEC: .4byte 0x02020630 +_081CEDF0: .4byte sub_81CED10 + 1 +_081CEDF4: .4byte 0x0000181c +_081CEDF8: .4byte 0x06010000 +_081CEDFC: + adds r0, r6, 0 + bl sub_81CDCB4 + ldr r1, _081CEE34 + add r1, r8 + ldr r2, [r1] + ldr r1, _081CEE38 + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, _081CEE3C + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r0, r6, 0 + bl sub_81CDCD4 + ldr r1, _081CEE40 + 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 + .align 2, 0 +_081CEE34: .4byte 0x0000181c +_081CEE38: .4byte 0x040000d4 +_081CEE3C: .4byte 0x80000400 +_081CEE40: .4byte 0x00001818 + thumb_func_end sub_81CED30 + + thumb_func_start sub_81CEE44 +sub_81CEE44: @ 81CEE44 + push {r4,lr} + bl sub_81CDC70 + adds r4, r0, 0 + bl copy_super_sprites_to_oam + bl copy_queue_process + 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 gpu_sync_bg_show + b _081CEE8A +_081CEE84: + movs r0, 0x2 + bl gpu_sync_bg_hide +_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, _081CEEC4 + 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 + .align 2, 0 +_081CEEC4: .4byte 0x030012bc + 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, _081CEF38 + adds r0, r4, r1 + ldrb r0, [r0] +_081CEF30: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CEF38: .4byte 0x00001828 + 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, _081CEF80 + movs r0, 0x12 + bl sub_81C761C + str r0, [r4, 0x20] + cmp r0, 0 + beq _081CEF90 + ldr r0, _081CEF84 + str r0, [r4] + ldr r0, _081CEF88 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + movs r0, 0 + str r0, [r4, 0x18] + bl sub_81C76AC + ldr r1, _081CEF8C + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CEF92 + .align 2, 0 +_081CEF80: .4byte 0x000006ac +_081CEF84: .4byte sub_81CF010 + 1 +_081CEF88: .4byte sub_81CF11C + 1 +_081CEF8C: .4byte 0x086233a0 +_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, _081CEFCC + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0x18] + bl sub_81C76AC + ldr r1, _081CEFD0 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CEFD6 + .align 2, 0 +_081CEFCC: .4byte sub_81CF030 + 1 +_081CEFD0: .4byte 0x086233a0 +_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, _081CF02C + str r0, [r4] +_081CF022: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CF02C: .4byte sub_81CF030 + 1 + thumb_func_end sub_81CF010 + + thumb_func_start sub_81CF030 +sub_81CF030: @ 81CF030 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _081CF044 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CF048 + movs r0, 0x1 + b _081CF0A6 + .align 2, 0 +_081CF044: .4byte 0x030022c0 +_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, _081CF084 + str r0, [r4] + movs r0, 0x5 + b _081CF0A6 + .align 2, 0 +_081CF084: .4byte sub_81CF0B0 + 1 +_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, _081CF0AC + str r0, [r4] + movs r0, 0x6 +_081CF0A6: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081CF0AC: .4byte sub_81CF0B8 + 1 + thumb_func_end sub_81CF030 + + thumb_func_start sub_81CF0B0 +sub_81CF0B0: @ 81CF0B0 + ldr r0, _081CF0B4 + bx lr + .align 2, 0 +_081CF0B4: .4byte 0x000186a3 + thumb_func_end sub_81CF0B0 + + thumb_func_start sub_81CF0B8 +sub_81CF0B8: @ 81CF0B8 + ldr r0, _081CF0BC + bx lr + .align 2, 0 +_081CF0BC: .4byte 0x000186a9 + 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, _081CF130 + lsls r1, r0, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .align 2, 0 +_081CF130: .4byte 0x086233b4 + 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, _081CF1B4 + 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, _081CF1B8 + 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, _081CF1BC + 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, _081CF1C0 + 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 + .align 2, 0 +_081CF1B4: .4byte 0xffffff00 +_081CF1B8: .4byte 0x020244ec +_081CF1BC: .4byte 0xffff00ff +_081CF1C0: .4byte 0x0000ffff + 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, _081CF250 + ldr r0, [sp] + ands r0, r1 + orrs r0, r7 + lsls r1, r4, 24 + lsrs r1, 24 + lsls r3, r1, 8 + ldr r2, _081CF254 + 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, _081CF258 + 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 + .align 2, 0 +_081CF250: .4byte 0xffffff00 +_081CF254: .4byte 0xffff00ff +_081CF258: .4byte 0x0000ffff +_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, _081CF358 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081CF35C + str r0, [r4] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081CF362 + .align 2, 0 +_081CF358: .4byte sub_81CF418 + 1 +_081CF35C: .4byte sub_81CF3E4 + 1 +_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, _081CF390 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081CF394 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0xC] + b _081CF39A + .align 2, 0 +_081CF390: .4byte sub_81CF418 + 1 +_081CF394: .4byte sub_81CF3E4 + 1 +_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, _081CF3C8 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, _081CF3CC + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CF3C8: .4byte 0x08623598 +_081CF3CC: .4byte sub_81CF3E4 + 1 + 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 Window_Remove + 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, _081CF438 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CF438: .4byte _081CF43C + .align 2, 0 +_081CF43C: + .4byte _081CF454 + .4byte _081CF4AC + .4byte _081CF4C0 + .4byte _081CF4E0 + .4byte _081CF4F6 + .4byte _081CF55A +_081CF454: + ldr r0, _081CF49C + movs r1, 0x2 + bl sub_81C7B54 + ldr r1, _081CF4A0 + 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 bg_set_tilemap + ldr r1, _081CF4A4 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + ldr r0, _081CF4A8 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram +_081CF498: + movs r0, 0 + b _081CF570 + .align 2, 0 +_081CF49C: .4byte 0x08623590 +_081CF4A0: .4byte 0x086233e4 +_081CF4A4: .4byte 0x086234ac +_081CF4A8: .4byte 0x086233c4 +_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, _081CF4DC + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + bl sub_81CF88C + b _081CF498 + .align 2, 0 +_081CF4DC: .4byte 0x08623570 +_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 bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_hide + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081CF7F0 + bl Window_AddFromTemplate + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + ldrb r0, [r4, 0x8] + movs r1, 0x1 + bl Window_CopyToVram + adds r0, r4, 0 + bl sub_81CF7F4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CF7F0: .4byte 0x086235b4 + 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, _081CF880 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + movs r0, 0xFF + strb r0, [r4] + ldr r5, _081CF884 + ldr r1, _081CF888 + 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 decimal_int_to_string + 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 Window_CopyToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081CF880: .4byte 0x02021cc4 +_081CF884: .4byte 0x02021dc4 +_081CF888: .4byte 0x085ec029 + 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, _081CF8DC + str r0, [sp, 0x10] + str r4, [sp, 0x14] + ldr r0, _081CF8E0 + movs r2, 0 + bl sub_81C81D4 + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081CF8DC: .4byte sub_81CF8E4 + 1 +_081CF8E0: .4byte 0x08623594 + 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, _081CF91C + 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, _081CF920 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr + b _081CF94A + .align 2, 0 +_081CF91C: .4byte 0x020244ec +_081CF920: .4byte 0x02021ec4 +_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, _081CF96C + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr_encrypted +_081CF94A: + ldr r4, _081CF96C + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + 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, _081CF970 + b _081CF97E + .align 2, 0 +_081CF96C: .4byte 0x02021ec4 +_081CF970: .4byte 0x086235d4 +_081CF974: + ldr r1, _081CF978 + b _081CF97E + .align 2, 0 +_081CF978: .4byte 0x086235bc +_081CF97C: + ldr r1, _081CF9B4 +_081CF97E: + ldr r4, _081CF9B8 + adds r0, r4, 0 + bl gf_strcpy + 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 decimal_int_to_string + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x28 + bl sub_81DB494 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081CF9B4: .4byte 0x086235c8 +_081CF9B8: .4byte 0x02021cc4 + 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, _081CF9F0 + movs r0, 0x12 + bl sub_81C761C + str r0, [r4, 0x1C] + cmp r0, 0 + beq _081CF9FC + ldr r0, _081CF9F4 + str r0, [r4] + ldr r0, _081CF9F8 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + movs r0, 0 + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CF9FE + .align 2, 0 +_081CF9F0: .4byte 0x000006ac +_081CF9F4: .4byte sub_81CFA68 + 1 +_081CF9F8: .4byte sub_81CFB74 + 1 +_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, _081CFA28 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0x14] + b _081CFA2E + .align 2, 0 +_081CFA28: .4byte sub_81CFA88 + 1 +_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, _081CFA84 + str r0, [r4] +_081CFA7A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081CFA84: .4byte sub_81CFA88 + 1 + thumb_func_end sub_81CFA68 + + thumb_func_start sub_81CFA88 +sub_81CFA88: @ 81CFA88 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _081CFA9C + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CFAA0 + movs r0, 0x1 + b _081CFAFE + .align 2, 0 +_081CFA9C: .4byte 0x030022c0 +_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, _081CFADC + str r0, [r4] + movs r0, 0x5 + b _081CFAFE + .align 2, 0 +_081CFADC: .4byte sub_81CFB08 + 1 +_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, _081CFB04 + str r0, [r4] + movs r0, 0x6 +_081CFAFE: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081CFB04: .4byte sub_81CFB10 + 1 + thumb_func_end sub_81CFA88 + + thumb_func_start sub_81CFB08 +sub_81CFB08: @ 81CFB08 + ldr r0, _081CFB0C + bx lr + .align 2, 0 +_081CFB0C: .4byte 0x000186a5 + thumb_func_end sub_81CFB08 + + thumb_func_start sub_81CFB10 +sub_81CFB10: @ 81CFB10 + ldr r0, _081CFB14 + bx lr + .align 2, 0 +_081CFB14: .4byte 0x000186ad + 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, _081CFB88 + lsls r1, r0, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .align 2, 0 +_081CFB88: .4byte 0x086235d8 + 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, _081CFC1C + 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, _081CFC20 + 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, _081CFC24 + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r3, 16 + ldr r1, _081CFC28 + 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 + .align 2, 0 +_081CFC1C: .4byte 0xffffff00 +_081CFC20: .4byte 0x020244ec +_081CFC24: .4byte 0xffff00ff +_081CFC28: .4byte 0x0000ffff + 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, _081CFCBC + ldr r0, [sp] + ands r0, r1 + orrs r0, r5 + lsls r2, r4, 8 + ldr r1, _081CFCC0 + ands r0, r1 + orrs r0, r2 + lsls r2, r3, 16 + ldr r1, _081CFCC4 + 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 + .align 2, 0 +_081CFCBC: .4byte 0xffffff00 +_081CFCC0: .4byte 0xffff00ff +_081CFCC4: .4byte 0x0000ffff +_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, _081CFDB8 + 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 + .align 2, 0 +_081CFDB8: .4byte 0x020244ec +_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, _081CFDF8 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081CFDFC + str r0, [r4] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081CFE02 + .align 2, 0 +_081CFDF8: .4byte sub_81CFEB8 + 1 +_081CFDFC: .4byte sub_81CFE84 + 1 +_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, _081CFE30 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081CFE34 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0xC] + b _081CFE3A + .align 2, 0 +_081CFE30: .4byte sub_81CFEB8 + 1 +_081CFE34: .4byte sub_81CFE84 + 1 +_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, _081CFE68 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, _081CFE6C + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081CFE68: .4byte 0x086237b8 +_081CFE6C: .4byte sub_81CFE84 + 1 + 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 Window_Remove + 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, _081CFED8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081CFED8: .4byte _081CFEDC + .align 2, 0 +_081CFEDC: + .4byte _081CFEF4 + .4byte _081CFF48 + .4byte _081CFF76 + .4byte _081CFF94 + .4byte _081CFFA4 + .4byte _081CFFDE +_081CFEF4: + ldr r0, _081CFF38 + movs r1, 0x2 + bl sub_81C7B54 + ldr r1, _081CFF3C + 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 bg_set_tilemap + ldr r1, _081CFF40 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r0, _081CFF44 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram +_081CFF32: + movs r0, 0 + b _081CFFF4 + .align 2, 0 +_081CFF38: .4byte 0x086237b0 +_081CFF3C: .4byte 0x08623604 +_081CFF40: .4byte 0x086236cc +_081CFF44: .4byte 0x086235e4 +_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 bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + bl gpu_sync_bg_show + b _081CFF32 +_081CFF76: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CFFEE + ldr r0, _081CFF90 + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + bl sub_81D0304 + b _081CFF32 + .align 2, 0 +_081CFF90: .4byte 0x08623790 +_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 gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_hide + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081D0284 + bl Window_AddFromTemplate + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + 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 Window_CopyToVram + adds r0, r4, 0 + bl sub_81D0288 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D0284: .4byte 0x086237d4 + 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 Window_CopyToVram + 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 decimal_int_to_string + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x38 + bl sub_81DB35C + 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, _081D0354 + str r0, [sp, 0x10] + str r4, [sp, 0x14] + ldr r0, _081D0358 + movs r2, 0 + bl sub_81C81D4 + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D0354: .4byte sub_81D035C + 1 +_081D0358: .4byte 0x086237b4 + 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, _081D039C + 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, _081D03A0 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr + b _081D03CC + .align 2, 0 +_081D039C: .4byte 0x020244ec +_081D03A0: .4byte 0x02021ec4 +_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, _081D03F0 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr_encrypted +_081D03CC: + ldr r4, _081D03F0 + adds r0, r4, 0 + bl get_end_of_string_ptr_limit_10_chars + 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, _081D03F4 + b _081D0402 + .align 2, 0 +_081D03F0: .4byte 0x02021ec4 +_081D03F4: .4byte 0x086237f4 +_081D03F8: + ldr r1, _081D03FC + b _081D0402 + .align 2, 0 +_081D03FC: .4byte 0x086237dc +_081D0400: + ldr r1, _081D0448 +_081D0402: + ldr r4, _081D044C + adds r0, r4, 0 + bl gf_strcpy + 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 decimal_int_to_string + 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 decimal_int_to_string + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D0448: .4byte 0x086237e8 +_081D044C: .4byte 0x02021cc4 + 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, _081D048C + str r0, [r1] + ldr r1, _081D0490 + movs r0, 0x3 + strh r0, [r1] + ldr r1, _081D0494 + movs r0, 0xA + strh r0, [r1] + movs r0, 0x1 + b _081D049A + .align 2, 0 +_081D048C: .4byte sub_81D04C4 + 1 +_081D0490: .4byte 0x030026fc +_081D0494: .4byte 0x030022b0 +_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, _081D04E0 + 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 + .align 2, 0 +_081D04E0: .4byte 0x030022c0 +_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, _081D0524 + str r0, [r1] + movs r0, 0x2 + b _081D053E + .align 2, 0 +_081D0524: .4byte sub_81D0548 + 1 +_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, _081D0544 + str r0, [r1] + movs r0, 0x5 +_081D053E: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081D0544: .4byte sub_81D05D4 + 1 + thumb_func_end sub_81D04C4 + + thumb_func_start sub_81D0548 +sub_81D0548: @ 81D0548 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081D05A8 + 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, _081D05A8 + 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, _081D05A8 + 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, _081D05A8 + 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 + .align 2, 0 +_081D05A8: .4byte 0x030022c0 +_081D05AC: + ldr r0, _081D05BC + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081D05C0 + movs r0, 0 + b _081D05CA + .align 2, 0 +_081D05BC: .4byte 0x030022c0 +_081D05C0: + adds r1, r4, 0 + adds r1, 0x98 + ldr r0, _081D05D0 + str r0, [r1] + movs r0, 0x4 +_081D05CA: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081D05D0: .4byte sub_81D04C4 + 1 + thumb_func_end sub_81D0548 + + thumb_func_start sub_81D05D4 +sub_81D05D4: @ 81D05D4 + ldr r0, _081D05D8 + bx lr + .align 2, 0 +_081D05D8: .4byte 0x000186ae + 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, _081D072C + 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 + .align 2, 0 +_081D072C: .4byte 0x020244ec +_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 get_end_of_string_ptr_limit_10_chars + 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, _081D07A8 + 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 + .align 2, 0 +_081D07A8: .4byte 0x020244ec +_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, _081D0810 + adds r0, r1 + movs r1, 0x52 + bl pokemon_getattr +_081D080A: + pop {r1} + bx r1 + .align 2, 0 +_081D0810: .4byte 0x020244ec + 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, _081D0844 + adds r0, r1 + movs r1, 0x53 + bl pokemon_getattr + b _081D0852 + .align 2, 0 +_081D0844: .4byte 0x020244ec +_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, _081D08A8 + 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 + .align 2, 0 +_081D08A8: .4byte 0x086237f8 +_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, _081D099C + movs r0, 0xE + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081D09A8 + ldr r0, _081D09A0 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, _081D09A4 + str r0, [r4] + movs r0, 0x1 + b _081D09AA + .align 2, 0 +_081D099C: .4byte 0x0000101c +_081D09A0: .4byte sub_81D0A6C + 1 +_081D09A4: .4byte sub_81D0A58 + 1 +_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, _081D09D8 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, _081D09DC + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D09D8: .4byte 0x08624ba0 +_081D09DC: .4byte sub_81D0A58 + 1 + 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 Window_Remove + ldrb r0, [r4, 0x8] + bl Window_Remove + ldrb r0, [r4, 0xC] + bl Window_Remove + ldrb r0, [r4, 0xE] + bl Window_Remove + adds r0, r4, 0 + bl sub_81D1178 + movs r0, 0x9 + bl gpu_tile_obj_free_by_tag + movs r0, 0xF + bl gpu_pal_free_tag + movs r0, 0x10 + bl gpu_pal_free_tag + movs r0, 0x11 + bl gpu_pal_free_tag + movs r0, 0x12 + bl gpu_pal_free_tag + movs r0, 0x13 + bl gpu_pal_free_tag + ldr r0, [r4, 0x14] + bl obj_free_rotscale_entry + ldr r0, [r4, 0x14] + bl obj_delete_and_free_tiles + 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, _081D0A8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D0A8C: .4byte _081D0A90 + .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, _081D0AF4 + movs r1, 0x2 + bl sub_81C7B54 + ldr r1, _081D0AF8 + 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 bg_set_tilemap + ldr r1, _081D0AFC + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl gpu_copy_to_wram_bg_tile_map + ldr r0, _081D0B00 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + b _081D0BBA + .align 2, 0 +_081D0AF4: .4byte 0x08624b98 +_081D0AF8: .4byte 0x08dde030 +_081D0AFC: .4byte 0x08dde12c +_081D0B00: .4byte 0x08dde010 +_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, _081D0B64 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0x1 + bl decompress_and_copy_tile_data_to_vram + ldr r0, _081D0B68 + adds r1, r5, r0 + movs r0, 0x1 + bl bg_set_tilemap + 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 bg_fill_tilemap_rect + ldr r0, _081D0B6C + movs r1, 0x20 + movs r2, 0xA0 + bl sub_81C7944 + ldr r0, _081D0B70 + movs r1, 0xA0 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + b _081D0BBC + .align 2, 0 +_081D0B64: .4byte 0x086240b8 +_081D0B68: .4byte 0x0000081c +_081D0B6C: .4byte 0x08623ff8 +_081D0B70: .4byte 0x08624098 +_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 is_dma3_queue_busy_with_gpu_copy + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 +_081D0BBA: + movs r0, 0x2 +_081D0BBC: + bl gpu_copy_wram_bg_tilemap_to_vram + movs r0, 0 + b _081D0C4A +_081D0BC4: + bl is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_hide + 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, _081D0CA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D0CA0: .4byte _081D0CA4 + .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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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 is_dma3_queue_busy_with_gpu_copy + 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, _081D0E80 + bl Window_AddFromTemplate + strh r0, [r4, 0xA] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + bl sub_81D0E84 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D0E80: .4byte 0x08624bb8 + 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, _081D0EEC + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldr r4, _081D0EF0 + bl sub_81D07D8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + bl sub_81AFBF0 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, _081D0EF4 + ldr r1, _081D0EF8 + adds r0, r4, 0 + bl sub_81AFC28 + ldrb r0, [r5, 0xA] + movs r1, 0x44 + bl Window_FastFillPixels + 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 Window_CopyToVram + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D0EEC: .4byte 0x08624bc0 +_081D0EF0: .4byte 0x02021cc4 +_081D0EF4: .4byte 0x02021fc4 +_081D0EF8: .4byte 0x085ec030 + 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, _081D0F58 + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldrb r0, [r7, 0xA] + movs r1, 0x44 + bl Window_FastFillPixels + cmp r5, 0x18 + bhi _081D0F60 + lsls r1, r5, 3 + ldr r0, _081D0F5C + 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 + .align 2, 0 +_081D0F58: .4byte 0x08624bc0 +_081D0F5C: .4byte 0x086239ac +_081D0F60: + ldr r0, _081D0FC0 + ldr r0, [r0] + adds r0, r5 + ldr r1, _081D0FC4 + adds r0, r1 + ldrb r5, [r0] + cmp r5, 0 + beq _081D0FB2 + subs r5, 0x1 + movs r4, 0 + ldr r0, _081D0FC8 + 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 Window_CopyToVram +_081D0FB2: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D0FC0: .4byte 0x03005d8c +_081D0FC4: .4byte 0x0000318f +_081D0FC8: .4byte 0x08623df8 + thumb_func_end sub_81D0EFC + + thumb_func_start sub_81D0FCC +sub_81D0FCC: @ 81D0FCC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081D0FEC + bl Window_AddFromTemplate + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl Window_WriteStandardTileMap + adds r0, r4, 0 + bl sub_81D0FF0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D0FEC: .4byte 0x08624bc4 + 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 Window_FastFillPixels + ldr r4, _081D1038 + 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, _081D103C + b _081D104A + .align 2, 0 +_081D1038: .4byte 0x02021ec4 +_081D103C: .4byte 0x08624be4 +_081D1040: + ldr r1, _081D1044 + b _081D104A + .align 2, 0 +_081D1044: .4byte 0x08624bcc +_081D1048: + ldr r1, _081D109C +_081D104A: + ldr r5, _081D10A0 + adds r0, r5, 0 + bl gf_strcpy + 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 decimal_int_to_string + 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 Window_CopyToVram + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D109C: .4byte 0x08624bd8 +_081D10A0: .4byte 0x02021cc4 + thumb_func_end sub_81D0FF0 + + thumb_func_start sub_81D10A4 +sub_81D10A4: @ 81D10A4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081D10CC + bl Window_AddFromTemplate + strh r0, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x11 + bl Window_FastFillPixels + ldrb r0, [r4, 0xC] + bl Window_WriteStandardTileMap + adds r0, r4, 0 + bl sub_81D10D0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D10CC: .4byte 0x08624be8 + 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, _081D1144 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x3 + bl decimal_int_to_string + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl sub_81DB35C + 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 Window_CopyToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D1144: .4byte 0x02021cc4 + 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, _081D11D0 + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _081D11D4 + 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 + .align 2, 0 +_081D11D0: .4byte 0x0000ffff +_081D11D4: .4byte 0x02020630 + 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, _081D11F8 + adds r0, r1 + movs r2, 0x20 + negs r2, r2 + movs r1, 0x28 + movs r3, 0x6 + bl sub_81D1258 + pop {r0} + bx r0 + .align 2, 0 +_081D11F8: .4byte 0x02020630 + 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, _081D1230 + adds r0, r1 + adds r1, r5, 0 + movs r2, 0x28 + movs r3, 0x6 + bl sub_81D1258 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D1230: .4byte 0x02020630 + thumb_func_end sub_81D11FC + + thumb_func_start sub_81D1234 +sub_81D1234: @ 81D1234 + ldr r2, _081D1250 + 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, _081D1254 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_081D1250: .4byte 0x02020630 +_081D1254: .4byte nullsub_12 + 1 + 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, _081D1280 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D1280: .4byte sub_81D1284 + 1 + 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, _081D12D4 + str r0, [r2, 0x1C] +_081D12D0: + pop {r0} + bx r0 + .align 2, 0 +_081D12D4: .4byte nullsub_12 + 1 + thumb_func_end sub_81D1284 + + thumb_func_start sub_81D12D8 +sub_81D12D8: @ 81D12D8 + push {r4-r6,lr} + bl sub_81D1350 + ldr r5, _081D1348 + adds r0, r5, 0 + bl sub_81D0914 + adds r6, r0, 0 + ldr r2, _081D134C + 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, _081D1348 + adds r0, r4, 0 + bl sub_81D092C + adds r6, r0, 0 + ldr r2, _081D134C + 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, _081D1348 + ldr r0, [r0] + cmp r1, r0 + bcc _081D1322 +_081D133A: + movs r0, 0x1 + bl gpu_copy_wram_bg_tilemap_to_vram + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D1348: .4byte 0x030012c0 +_081D134C: .4byte 0x030012c4 + 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 bg_fill_tilemap_rect + 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 gpu_copy_to_iwram_tile_map_rect + 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, _081D13F8 + 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 + .align 2, 0 +_081D13F8: .4byte 0x08624bf8 + thumb_func_end sub_81D13BC + + thumb_func_start sub_81D13FC +sub_81D13FC: @ 81D13FC + push {r4,lr} + adds r4, r0, 0 + ldr r0, _081D1438 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D143C + bl sub_81C795C + ldr r0, _081D1440 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, _081D1444 + 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 + .align 2, 0 +_081D1438: .4byte 0x08624c78 +_081D143C: .4byte 0x08624c80 +_081D1440: .4byte 0x08624d04 +_081D1444: .4byte 0x02020630 + 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 gpu_tile_obj_tag_get_range_start + ldr r3, [r6, 0x14] + ldr r1, _081D14F0 + lsls r4, 2 + adds r4, r1 + ldrh r1, [r4] + lsls r1, 4 + adds r0, r1 + ldr r2, _081D14F4 + adds r1, r2, 0 + ands r0, r1 + ldrh r2, [r3, 0x4] + ldr r1, _081D14F8 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x4] + ldrh r0, [r4, 0x2] + adds r0, 0xF + lsls r0, 16 + lsrs r0, 16 + bl gpu_pal_tags_index_of + 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 sub_8008258 + 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, _081D14FC + str r0, [r1, 0x1C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D14F0: .4byte 0x08624bf8 +_081D14F4: .4byte 0x000003ff +_081D14F8: .4byte 0xfffffc00 +_081D14FC: .4byte sub_81D1538 + 1 + 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 sub_8008258 + ldr r1, [r4, 0x14] + ldr r0, _081D1520 + str r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D1520: .4byte sub_81D1538 + 1 + thumb_func_end sub_81D1500 + + thumb_func_start sub_81D1524 +sub_81D1524: @ 81D1524 + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x1C] + ldr r0, _081D1534 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_081D1534: .4byte nullsub_12 + 1 + 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, _081D1570 + str r0, [r3, 0x1C] +_081D156A: + pop {r0} + bx r0 + .align 2, 0 +_081D1570: .4byte nullsub_12 + 1 + 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, _081D1588 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D1588: .4byte _081D158C + .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, _081D15C8 + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_081D15C8: .4byte 0x085500a4 + thumb_func_end sub_81D15BC + + thumb_func_start sub_81D15CC +sub_81D15CC: @ 81D15CC + push {lr} + adds r3, r0, 0 + movs r1, 0 + ldr r2, _081D15E0 +_081D15D4: + ldrh r0, [r2] + cmp r0, r3 + bne _081D15E4 + adds r0, r1, 0 + b _081D15F0 + .align 2, 0 +_081D15E0: .4byte 0x085500a4 +_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, _081D1618 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, _081D161C + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _081D1622 + .align 2, 0 +_081D1618: .4byte 0x086252a8 +_081D161C: .4byte 0x086252fc +_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, _081D1640 + cmp r1, r0 + beq _081D1644 + adds r0, r1, 0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + b _081D1646 + .align 2, 0 +_081D1640: .4byte 0x0000ffff +_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, _081D1664 + cmp r1, r0 + beq _081D1668 + adds r0, r1, 0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + b _081D166A + .align 2, 0 +_081D1664: .4byte 0x0000ffff +_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, _081D1688 + cmp r1, r0 + beq _081D168C + adds r0, r1, 0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + b _081D168E + .align 2, 0 +_081D1688: .4byte 0x0000ffff +_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, _081D16A8 + ldr r1, [r0] + ldrb r0, [r2, 0x1] + ldrb r1, [r1, 0x8] + cmp r0, r1 + beq _081D16AC + movs r0, 0 + b _081D16C6 + .align 2, 0 +_081D16A8: .4byte 0x03005d90 +_081D16AC: + ldrh r1, [r2, 0x2] + ldr r0, _081D16C0 + cmp r1, r0 + beq _081D16C4 + adds r0, r1, 0 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + b _081D16C6 + .align 2, 0 +_081D16C0: .4byte 0x0000ffff +_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 flag_check + 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, _081D1704 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, _081D1708 + 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 + .align 2, 0 +_081D1704: .4byte 0x086252a8 +_081D1708: .4byte 0x08625310 +_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, _081D1728 + b _081D172E + .align 2, 0 +_081D1728: .4byte 0x0000ffff +_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 flag_check + 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, _081D177C + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, _081D1780 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _081D1786 + .align 2, 0 +_081D177C: .4byte 0x086252a8 +_081D1780: .4byte 0x08625324 +_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, _081D17B0 + ldr r0, [r0] + ldr r2, _081D17B4 + adds r0, r2 + ldrh r1, [r1, 0x4] + adds r0, r1 + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _081D17BA + .align 2, 0 +_081D17B0: .4byte 0x03005d8c +_081D17B4: .4byte 0x000009ca +_081D17B8: + movs r0, 0 +_081D17BA: + pop {r1} + bx r1 + thumb_func_end sub_81D1790 + + thumb_func_start sub_81D17C0 +sub_81D17C0: @ 81D17C0 + ldr r1, _081D17D8 + ldr r1, [r1] + ldr r2, _081D17DC + adds r1, r2 + ldrh r0, [r0, 0x4] + adds r1, r0 + ldrb r1, [r1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .align 2, 0 +_081D17D8: .4byte 0x03005d8c +_081D17DC: .4byte 0x000009ca + 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, _081D1818 + lsls r0, r5, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + adds r2, r0, 0 + ldr r1, _081D181C + 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 + .align 2, 0 +_081D1818: .4byte 0x086252a8 +_081D181C: .4byte 0x08625338 +_081D1820: + movs r2, 0 + ldr r1, _081D183C +_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 + .align 2, 0 +_081D183C: .4byte 0x08625388 + 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, _081D1878 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, _081D187C + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _081D1882 + .align 2, 0 +_081D1878: .4byte 0x086252a8 +_081D187C: .4byte 0x0862534c +_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, _081D18C8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, _081D18CC + 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 + .align 2, 0 +_081D18C8: .4byte 0x086252a8 +_081D18CC: .4byte 0x08625360 + 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, _081D1954 + mov r8, r0 + lsls r0, r5, 3 + adds r0, 0x4 + adds r4, r0, r6 + b _081D195C + .align 2, 0 +_081D1954: .4byte 0x0000ffff +_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 flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D1958 +_081D1974: + adds r4, r7, r6 + ldrh r1, [r4, 0x6] + ldr r0, _081D1998 + cmp r1, r0 + beq _081D1984 + adds r0, r1, 0 + bl flag_set +_081D1984: + ldr r1, [r4] + mov r0, r9 + bl ExpandTextCodes + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D1998: .4byte 0x0000ffff + 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, _081D1A14 + cmp r0, r1 + beq _081D1A24 + ldr r0, _081D1A18 + mov r9, r0 + mov r8, r1 + adds r4, r6, 0 +_081D19C6: + ldrh r0, [r4, 0x4] + cmp r0, r9 + beq _081D19D6 + bl flag_check + 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, _081D1A14 + 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, _081D1A18 + cmp r1, r0 + beq _081D1A0A + adds r0, r1, 0 + bl flag_set +_081D1A0A: + ldr r1, [r4] + mov r0, r10 + bl ExpandTextCodes + b _081D1A5C + .align 2, 0 +_081D1A14: .4byte 0x0000fffe +_081D1A18: .4byte 0x0000ffff +_081D1A1C: + adds r5, 0x2 + b _081D1A50 +_081D1A20: + adds r5, 0x3 + b _081D1A50 +_081D1A24: + ldr r0, _081D1A6C + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081D1A50 + ldr r0, _081D1A70 + ldr r0, [r0] + ldr r1, _081D1A74 + 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 ExpandTextCodes +_081D1A5C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D1A6C: .4byte 0x00000864 +_081D1A70: .4byte 0x03005d8c +_081D1A74: .4byte 0x000009ca + 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, _081D1AA8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, _081D1AAC + 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 + .align 2, 0 +_081D1AA8: .4byte 0x086252a8 +_081D1AAC: .4byte 0x08625374 + 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, _081D1B38 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0xD + muls r0, r2 + ldr r2, _081D1B3C + adds r0, r2 + str r0, [r4] + adds r1, 0x4 + str r1, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D1B38: .4byte 0x08310030 +_081D1B3C: .4byte 0x0830fcd4 + 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, _081D1BB8 + 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, _081D1BB8 +_081D1B7C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r7, 0x4 + adds r0, r1 + ldrh r0, [r0] + bl flag_check + 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 + .align 2, 0 +_081D1BB8: .4byte 0x08625388 +_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, _081D1BE4 +_081D1BD8: + ldrh r0, [r1] + cmp r0, r3 + bne _081D1BE8 + ldrh r0, [r1, 0x2] + b _081D1BF4 + .align 2, 0 +_081D1BE4: .4byte 0x08625388 +_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, _081D1C40 + 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 flag_set +_081D1C3C: + pop {r0} + bx r0 + .align 2, 0 +_081D1C40: .4byte 0x020375e0 + thumb_func_end sub_81D1C20 + + thumb_func_start sub_81D1C44 +sub_81D1C44: @ 81D1C44 + push {r4,lr} + lsls r0, 24 + ldr r4, _081D1C5C + lsrs r0, 21 + adds r0, 0x8 + bl malloc + str r0, [r4] + cmp r0, 0 + bne _081D1C60 + movs r0, 0 + b _081D1C7A + .align 2, 0 +_081D1C5C: .4byte 0x0203cf4c +_081D1C60: + movs r2, 0 + ldr r4, _081D1C80 + 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 + .align 2, 0 +_081D1C80: .4byte 0x0203cf48 + 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, _081D1CC4 + adds r5, r4, r6 + ldrb r0, [r5] + cmp r0, 0xFF + bne _081D1CEC + cmp r4, 0x2 + bne _081D1CD4 + ldr r0, _081D1CC8 + ldr r1, [r0, 0x14] + ldr r0, [r0, 0x10] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, _081D1CCC + movs r1, 0x4 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, _081D1CD0 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl Window_AddFromTemplate + strb r0, [r6, 0x2] + b _081D1CE0 + .align 2, 0 +_081D1CC4: .4byte 0x0203cf48 +_081D1CC8: .4byte 0x086253e8 +_081D1CCC: .4byte 0x085dff04 +_081D1CD0: .4byte 0x00ffffff +_081D1CD4: + lsls r0, r4, 3 + ldr r1, _081D1CFC + adds r0, r1 + bl Window_AddFromTemplate + strb r0, [r5] +_081D1CE0: + ldr r0, _081D1D00 + adds r0, r4, r0 + ldrb r0, [r0] + movs r1, 0 + bl SetStandardWindowBorderStyle +_081D1CEC: + ldr r0, _081D1D00 + adds r0, r4, r0 + ldrb r0, [r0] + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081D1CFC: .4byte 0x086253e8 +_081D1D00: .4byte 0x0203cf48 + 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, _081D1D30 + adds r4, r0 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl Window_FillTileMap + ldrb r0, [r4] + bl Window_Remove + movs r0, 0xFF + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D1D30: .4byte 0x0203cf48 + thumb_func_end sub_81D1D04 + + thumb_func_start sub_81D1D34 +sub_81D1D34: @ 81D1D34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081D1D40 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081D1D40: .4byte 0x0203cf48 + 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, _081D1DB4 + lsls r1, r3, 3 + adds r1, r3 + lsls r1, 2 + ldr r0, [r0] + adds r1, r0 + ldr r0, _081D1DB8 + adds r1, r0 + add r0, sp, 0x14 + bl gf_strcpy + add r0, sp, 0x14 + bl sub_81DB52C + add r0, sp, 0x14 + bl sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081D1D8C + add r0, sp, 0x14 + movs r1, 0x1 + bl sub_8009308 +_081D1D8C: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, _081D1DBC + 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 sub_8199EEC +_081D1DAC: + add sp, 0x34 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D1DB4: .4byte 0x03005d8c +_081D1DB8: .4byte 0x00002cca +_081D1DBC: .4byte 0x08625400 + 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, _081D1E60 + ldr r0, _081D1E64 + mov r12, r0 + ldr r4, _081D1E68 + ldr r1, _081D1E6C + mov r8, r1 + ldr r2, _081D1E70 + mov r9, r2 + ldr r0, _081D1E74 + mov r10, r0 + ldrb r1, [r5, 0x5] + cmp r3, r1 + bcs _081D1E02 + adds r6, r7, 0 + ldr r2, _081D1E78 +_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 calls_per_item_funcs_in_list_outer + 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 + .align 2, 0 +_081D1E60: .4byte 0x0203cf4c +_081D1E64: .4byte 0x085e8cf7 +_081D1E68: .4byte 0x03006310 +_081D1E6C: .4byte 0x0203cf48 +_081D1E70: .4byte sub_81D1E7C + 1 +_081D1E74: .4byte sub_81D1D44 + 1 +_081D1E78: .4byte 0x08625403 + 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 sub_81AF4A0 + 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, _081D1ED0 + ldr r0, [r0] + bl free + pop {r0} + bx r0 + .align 2, 0 +_081D1ED0: .4byte 0x0203cf4c + 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, _081D1F80 + 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 + .align 2, 0 +_081D1F80: .4byte 0x00000352 + 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, _081D2070 + 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 + .align 2, 0 +_081D2070: .4byte 0x00000352 + thumb_func_end sub_81D1F84 + + thumb_func_start sub_81D2074 +sub_81D2074: @ 81D2074 + push {r4,lr} + adds r1, r0, 0 + ldr r0, _081D2088 + adds r4, r1, r0 + ldrh r0, [r4] + cmp r0, 0x9 + bls _081D208C + movs r0, 0 + b _081D20A6 + .align 2, 0 +_081D2088: .4byte 0x00000352 +_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, _081D20B8 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_081D20B8: .4byte 0x00000355 + thumb_func_end sub_81D20AC + + thumb_func_start sub_81D20BC +sub_81D20BC: @ 81D20BC + push {r4,r5,lr} + sub sp, 0xC + ldr r1, _081D20D0 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _081D20D4 + cmp r0, 0x1 + beq _081D20E2 + b _081D20FA + .align 2, 0 +_081D20D0: .4byte 0x00000355 +_081D20D4: + bl dp12_8087EA4 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + b _081D20FC +_081D20E2: + mov r0, sp + ldr r1, _081D2104 + 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 + .align 2, 0 +_081D2104: .4byte 0x08625404 + 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, _081D21D0 + 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, _081D21D4 + 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, _081D21D8 + 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 + .align 2, 0 +_081D21D0: .4byte 0x02038c28 +_081D21D4: .4byte 0x0000ffff +_081D21D8: .4byte 0x0000024a + 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 lcd_io_set + movs r0, 0x42 + movs r1, 0x9B + bl lcd_io_set + ldr r4, _081D2228 + movs r0, 0x44 + adds r1, r4, 0 + bl lcd_io_set + movs r0, 0x46 + adds r1, r4, 0 + bl lcd_io_set + ldr r1, _081D222C + movs r0, 0x48 + bl lcd_io_set + movs r0, 0x4A + adds r1, r5, 0 + bl lcd_io_set + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D2228: .4byte 0x00003879 +_081D222C: .4byte 0x00003f3f + 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, _081D2274 + 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 + .align 2, 0 +_081D2274: .4byte 0x00000352 + 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, _081D23BC + 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, _081D23BC + 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 + .align 2, 0 +_081D23BC: .4byte 0x00026bff +_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, _081D2460 + 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 + .align 2, 0 +_081D2460: .4byte 0x00026bff +_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, _081D281C + 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, _081D2820 + 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, _081D281C + 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 + .align 2, 0 +_081D281C: .4byte 0x08625410 +_081D2820: .4byte 0x08329f40 + 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, _081D2874 + bl Window_InitFromTemplates + bl TextBox_ResetSomeField + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + ldr r0, _081D2878 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_081D284A: + adds r0, r4, 0 + movs r1, 0x11 + bl Window_FastFillPixels + 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 Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + b _081D288E + .align 2, 0 +_081D2874: .4byte 0x08625510 +_081D2878: .4byte 0x0860f074 +_081D287C: + movs r0, 0x1 + bl Window_WriteStandardTileMap + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle +_081D288E: + movs r0, 0x2 + bl Window_WriteStandardTileMap + movs r0, 0x3 + bl Window_WriteStandardTileMap + 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, _081D28E8 + adds r2, r3, 0 + ldr r1, _081D28EC + 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 + .align 2, 0 +_081D28E8: .4byte 0x03006310 +_081D28EC: .4byte 0x08625548 +_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 Window_FastFillPixels + ldr r5, _081D29B4 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl sub_81DB35C + 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, _081D29B8 + 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, _081D29BC + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x6A + bl sub_81DB368 + 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, _081D29C0 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x6A + bl sub_81DB368 + 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 Window_CopyToVram + b _081D2AB6 + .align 2, 0 +_081D29B4: .4byte 0x085efa31 +_081D29B8: .4byte 0x085efa52 +_081D29BC: .4byte 0x085efa56 +_081D29C0: .4byte 0x085efa5d +_081D29C4: + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 2 + ldr r1, _081D2A2C + adds r6, r0, r1 + ldrb r1, [r6, 0x2] + lsls r0, r1, 3 + subs r0, r1 + ldr r1, _081D2A30 + 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, _081D2A34 + movs r0, 0x1 + movs r2, 0 + bl font_get_width_of_string + adds r4, r0, 0x4 + ldrb r1, [r6, 0x4] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x2 + bl decimal_int_to_string + 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, _081D2A38 + b _081D2A4A + .align 2, 0 +_081D2A2C: .4byte 0x0831c898 +_081D2A30: .4byte 0x0831ae38 +_081D2A34: .4byte 0x085efa52 +_081D2A38: .4byte 0x085e8d45 +_081D2A3C: + ldrb r1, [r6, 0x1] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + 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, _081D2A6C + b _081D2A7E + .align 2, 0 +_081D2A6C: .4byte 0x085e8d45 +_081D2A70: + ldrb r1, [r6, 0x3] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x3 + bl decimal_int_to_string + 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, _081D2AC8 + 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 + .align 2, 0 +_081D2AC8: .4byte 0x0861c524 + 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 Window_FastFillPixels + ldr r5, _081D2B60 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl sub_81DB35C + 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, _081D2B64 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x5C + bl sub_81DB368 + 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, _081D2B68 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x5C + bl sub_81DB368 + 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 Window_CopyToVram + b _081D2BB8 + .align 2, 0 +_081D2B60: .4byte 0x085efa3e +_081D2B64: .4byte 0x085efa67 +_081D2B68: .4byte 0x085efa6e +_081D2B6C: + lsls r4, 3 + ldr r0, _081D2BC4 + adds r4, r0 + ldr r1, _081D2BC8 + 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, _081D2BCC + 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 Window_CopyToVram +_081D2BB8: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D2BC4: .4byte 0x0858c2b4 +_081D2BC8: .4byte 0x08587d48 +_081D2BCC: .4byte 0x08587c50 + 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 Window_FastFillPixels + ldr r2, _081D2C38 + 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 text_box_related_one + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D2C38: .4byte 0x03003014 + thumb_func_end sub_81D2BF4 + + thumb_func_start sub_81D2C3C +sub_81D2C3C: @ 81D2C3C + push {lr} + bl run_remoboxes + movs r0, 0x3 + bl a_pressed_maybe + 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, _081D2C64 + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl sub_81996C0 + pop {r0} + bx r0 + .align 2, 0 +_081D2C64: .4byte 0x08625540 + 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, _081D2C90 + adds r0, r1 + adds r1, r2, 0 + adds r2, r3, 0 + bl pokemon_getattr + b _081D2CCA + .align 2, 0 +_081D2C90: .4byte 0x020244ec +_081D2C94: + movs r0, 0x64 + muls r0, r1 + ldr r1, _081D2CA4 + adds r0, r1 + adds r1, r2, 0 + bl pokemon_getattr + b _081D2CCA + .align 2, 0 +_081D2CA4: .4byte 0x020244ec +_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, _081D2D1C + adds r0, r5, 0 + movs r2, 0 + movs r3, 0xC + bl sub_8009128 + b _081D2E70 + .align 2, 0 +_081D2D1C: .4byte 0x085e8264 +_081D2D20: + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + adds r3, r5, 0 + bl sub_81D2C68 + adds r0, r5, 0 + bl get_end_of_string_ptr_limit_10_chars + 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, _081D2D6C + 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 + .align 2, 0 +_081D2D6C: .4byte 0x020244ec +_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, _081D2DB4 + adds r1, r0 + adds r0, r5, 0 + bl sub_8008C44 + cmp r0, 0 + bne _081D2DB0 + movs r6, 0xFF +_081D2DB0: + adds r3, r5, 0 + b _081D2DBA + .align 2, 0 +_081D2DB4: .4byte 0x083185c8 +_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 decimal_int_to_string + 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, _081D2ED0 + 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, _081D2ED0 + 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, _081D2ED0 + 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 + .align 2, 0 +_081D2ED0: .4byte 0xffff0000 + 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, _081D2F28 + b _081D2F3A + .align 2, 0 +_081D2F28: .4byte 0x085ebfce +_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, _081D3128 + adds r0, r1 + movs r1, 0x1 + str r1, [sp] + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8034654 + 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 + .align 2, 0 +_081D3128: .4byte 0x0830a18c + 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, _081D3210 + ldr r4, [r3] + ldr r5, [r3, 0x4] + str r4, [sp, 0x18] + str r5, [sp, 0x1C] + mov r4, sp + ldr r3, _081D3214 + ldm r3!, {r5-r7} + stm r4!, {r5-r7} + ldm r3!, {r5-r7} + stm r4!, {r5-r7} + ldr r3, _081D3218 + 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 + .align 2, 0 +_081D3210: .4byte 0x08625a48 +_081D3214: .4byte 0x08625a50 +_081D3218: .4byte 0x08625a68 + 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, _081D32A4 + 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, _081D32A8 + 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, _081D32AC + 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 + .align 2, 0 +_081D32A4: .4byte 0x08625a70 +_081D32A8: .4byte 0x08625a90 +_081D32AC: .4byte 0x08625aa8 + thumb_func_end sub_81D321C + + thumb_func_start sub_81D32B0 +sub_81D32B0: @ 81D32B0 + push {r4,r5,lr} + ldr r2, _081D32CC + ldr r4, [r2] + ldr r5, [r2, 0x4] + ldr r2, _081D32D0 + 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 + .align 2, 0 +_081D32CC: .4byte 0x08625ac0 +_081D32D0: .4byte 0x08625ac8 + 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, _081D3310 + str r0, [r2, 0x1C] +_081D330C: + pop {r0} + bx r0 + .align 2, 0 +_081D3310: .4byte sub_81D32D4 + 1 + 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, _081D3358 + adds r3, r1, r0 + cmp r3, 0 + beq _081D3360 + ldrh r1, [r3, 0x24] + ldrh r2, [r3, 0x20] + adds r1, r2 + ldr r2, _081D335C + 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 + .align 2, 0 +_081D3358: .4byte 0x02020630 +_081D335C: .4byte 0x08625b2c +_081D3360: + ldr r1, _081D3388 + 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 + .align 2, 0 +_081D3388: .4byte 0x08625b2c + 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, _081D33CC + str r0, [r1, 0x1C] + b _081D33F0 + .align 2, 0 +_081D33CC: .4byte sub_81D3564 + 1 +_081D33D0: + ldr r0, [r4] + bl sub_81D3314 + ldr r0, [r4] + bl sub_81D35E8 + ldr r2, [r4] + ldr r0, _081D3404 + 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 + .align 2, 0 +_081D3404: .4byte sub_81D32F4 + 1 + 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, _081D345C + movs r7, 0x1C + adds r7, r5 + mov r12, r7 + ldr r6, _081D3460 +_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 + .align 2, 0 +_081D345C: .4byte 0x02020630 +_081D3460: .4byte sub_81D3564 + 1 + 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, _081D34E8 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _081D34EC + 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 + .align 2, 0 +_081D34E8: .4byte 0x08625b14 +_081D34EC: .4byte 0x02020630 +_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 obj_delete_and_free_tiles + 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 gpu_tile_obj_free_by_tag + movs r0, 0x68 + bl gpu_pal_free_tag + 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 obj_anim_image_seek + 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, _081D35CC + b _081D35DA + .align 2, 0 +_081D35CC: .4byte sub_81D32F4 + 1 +_081D35D0: + ldr r0, _081D35D4 + b _081D35DA + .align 2, 0 +_081D35D4: .4byte sub_81D32D4 + 1 +_081D35D8: + ldr r0, _081D35E4 +_081D35DA: + str r0, [r4, 0x1C] +_081D35DC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D35E4: .4byte nullsub_12 + 1 + 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, _081D363C + adds r4, r0 + adds r0, r4, 0 + movs r1, 0 + bl obj_anim_image_seek + 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 + .align 2, 0 +_081D363C: .4byte 0x02020630 + 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 Window_FastFillPixels + 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, _081D3778 + 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, _081D377C + cmp r0, 0 + blt _081D3704 + ldr r1, _081D3780 +_081D3704: + adds r0, r6, 0 + bl gf_strcpy + 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 decimal_int_to_string + 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 + .align 2, 0 +_081D3778: .4byte 0x08625b54 +_081D377C: .4byte 0x085eea76 +_081D3780: .4byte 0x085eea73 + 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 Window_FastFillPixels + 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 decimal_int_to_string + 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, _081D3888 + 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 + .align 2, 0 +_081D3888: .4byte 0x08625b54 + 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, _081D38F4 + ldr r0, [r0] + ldr r1, _081D38F8 + 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 + .align 2, 0 +_081D38F4: .4byte 0x03005d8c +_081D38F8: .4byte 0x00003d6d + 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, _081D3AA0 + 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 + .align 2, 0 +_081D3AA0: .4byte 0x08625b6c +_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 malloc_and_clear + 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, _081D3B00 + 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 + .align 2, 0 +_081D3B00: .4byte 0x00000ee8 +_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 malloc_and_clear + 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 malloc_and_clear + 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, _081D3B94 +_081D3B64: + bl sub_81D4170 + ldr r0, _081D3B98 + 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, _081D3B9C + strh r1, [r0] + movs r0, 0x13 + ands r0, r1 + cmp r0, 0x10 + bne _081D3BA0 + movs r4, 0 + b _081D3BC2 + .align 2, 0 +_081D3B94: .4byte 0x03003144 +_081D3B98: .4byte 0x030012e2 +_081D3B9C: .4byte 0x030012e4 +_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, _081D3BE0 + ldr r2, _081D3BE4 + mov r0, sp + bl CpuSet + bl sub_81D41F4 + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_081D3BE0: .4byte 0x030012c8 +_081D3BE4: .4byte 0x05000006 + 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, _081D3C28 +_081D3BF6: + bl sub_81D4170 + ldr r0, _081D3C2C + 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, _081D3C30 + strh r1, [r0] + movs r0, 0x13 + ands r0, r1 + cmp r0, 0x10 + bne _081D3C34 + movs r4, 0 + b _081D3C56 + .align 2, 0 +_081D3C28: .4byte 0x03003144 +_081D3C2C: .4byte 0x030012e2 +_081D3C30: .4byte 0x030012e4 +_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, _081D3C74 + ldr r2, _081D3C78 + mov r0, sp + bl CpuSet + bl sub_81D41F4 + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081D3C74: .4byte 0x030012c8 +_081D3C78: .4byte 0x05000006 + thumb_func_end sub_81D3BE8 + + thumb_func_start sub_81D3C7C +sub_81D3C7C: @ 81D3C7C + push {r4,lr} + ldr r4, _081D3CA8 + movs r3, 0 + strh r3, [r4] + ldr r2, _081D3CAC + ldrh r1, [r2] + ldr r0, _081D3CB0 + ands r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r4] + ldr r0, _081D3CB4 + strh r3, [r0] + subs r0, 0x1A + strh r3, [r0] + ldr r1, _081D3CB8 + movs r0, 0xC0 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D3CA8: .4byte 0x04000208 +_081D3CAC: .4byte 0x04000200 +_081D3CB0: .4byte 0x0000ff3f +_081D3CB4: .4byte 0x04000128 +_081D3CB8: .4byte 0x04000202 + thumb_func_end sub_81D3C7C + + thumb_func_start sub_81D3CBC +sub_81D3CBC: @ 81D3CBC + push {r4-r7,lr} + sub sp, 0x4 + ldr r5, _081D3D14 + movs r4, 0 + strh r4, [r5] + ldr r3, _081D3D18 + ldrh r1, [r3] + ldr r0, _081D3D1C + ands r0, r1 + strh r0, [r3] + movs r6, 0x1 + strh r6, [r5] + ldr r0, _081D3D20 + strh r4, [r0] + ldr r2, _081D3D24 + movs r1, 0x80 + lsls r1, 6 + adds r0, r1, 0 + strh r0, [r2] + ldrh r0, [r2] + ldr r7, _081D3D28 + 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, _081D3D2C + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _081D3D0A + str r0, [sp] + ldr r2, _081D3D30 + mov r0, sp + bl CpuSet +_081D3D0A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D3D14: .4byte 0x04000208 +_081D3D18: .4byte 0x04000200 +_081D3D1C: .4byte 0x0000ff3f +_081D3D20: .4byte 0x04000134 +_081D3D24: .4byte 0x04000128 +_081D3D28: .4byte 0x00004003 +_081D3D2C: .4byte 0x030012c8 +_081D3D30: .4byte 0x05000006 + thumb_func_end sub_81D3CBC + + thumb_func_start sub_81D3D34 +sub_81D3D34: @ 81D3D34 + ldr r0, _081D3D5C + movs r3, 0 + strh r3, [r0] + ldr r2, _081D3D60 + 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, _081D3D64 + strb r3, [r0] + ldr r0, _081D3D68 + strh r3, [r0] + ldr r1, _081D3D6C + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_081D3D5C: .4byte 0x04000134 +_081D3D60: .4byte 0x04000128 +_081D3D64: .4byte 0x03003144 +_081D3D68: .4byte 0x030012e6 +_081D3D6C: .4byte 0x030012e8 + 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, _081D3D90 + ldrb r0, [r0, 0x1] + cmp r0, 0x6 + bls _081D3D86 + b _081D3ECC +_081D3D86: + lsls r0, 2 + ldr r1, _081D3D94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D3D90: .4byte 0x030012c8 +_081D3D94: .4byte _081D3D98 + .align 2, 0 +_081D3D98: + .4byte _081D3DB4 + .4byte _081D3DC8 + .4byte _081D3DE8 + .4byte _081D3DFC + .4byte _081D3E74 + .4byte _081D3E84 + .4byte _081D3EBC +_081D3DB4: + bl sub_81D3CBC + ldr r1, _081D3DC4 + movs r0, 0x1 + strb r0, [r1, 0x2] + strb r0, [r1, 0x1] + b _081D3ECC + .align 2, 0 +_081D3DC4: .4byte 0x030012c8 +_081D3DC8: + adds r0, r2, 0 + bl sub_81D3EE8 + lsls r0, 16 + cmp r0, 0 + beq _081D3DD8 + bl sub_81D413C +_081D3DD8: + ldr r0, _081D3DE4 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081D3DE2 + b _081D3ECC +_081D3DE2: + b _081D3E04 + .align 2, 0 +_081D3DE4: .4byte 0x03003144 +_081D3DE8: + bl sub_81D3D34 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81D3F1C + ldr r1, _081D3E10 + movs r0, 0x3 + strb r0, [r1, 0x1] +_081D3DFC: + ldr r0, _081D3E14 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081D3E18 +_081D3E04: + ldr r1, _081D3E10 + strb r0, [r1, 0x4] + movs r0, 0x6 + strb r0, [r1, 0x1] + b _081D3ECC + .align 2, 0 +_081D3E10: .4byte 0x030012c8 +_081D3E14: .4byte 0x03003144 +_081D3E18: + ldr r2, _081D3E58 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + ldr r1, _081D3E5C + ldr r0, [r1] + adds r3, r0, 0x1 + str r3, [r1] + ldr r1, _081D3E60 + 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, _081D3E60 + 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 + .align 2, 0 +_081D3E58: .4byte 0x030012e6 +_081D3E5C: .4byte 0x030012e8 +_081D3E60: .4byte 0x030012c8 +_081D3E64: + bl sub_81D413C + ldr r1, _081D3E70 + movs r0, 0x2 + strb r0, [r1, 0x2] + b _081D3ECC + .align 2, 0 +_081D3E70: .4byte 0x030012c8 +_081D3E74: + bl sub_81D3CBC + ldr r1, _081D3E80 + movs r0, 0x5 + strb r0, [r1, 0x1] + b _081D3ECC + .align 2, 0 +_081D3E80: .4byte 0x030012c8 +_081D3E84: + ldr r0, _081D3EB4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081D3E98 + ldr r0, _081D3EB8 + ldrh r0, [r0] + cmp r0, 0x2 + bls _081D3E98 + bl sub_81D413C +_081D3E98: + ldr r1, _081D3EB8 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3C + bls _081D3ECC + ldr r0, _081D3EB4 + movs r1, 0x1 + strb r1, [r0, 0x4] + movs r1, 0x6 + strb r1, [r0, 0x1] + b _081D3ECC + .align 2, 0 +_081D3EB4: .4byte 0x030012c8 +_081D3EB8: .4byte 0x030012e6 +_081D3EBC: + ldr r4, _081D3EE4 + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _081D3ECC + bl sub_81D3C7C + movs r0, 0 +_081D3ECA: + strb r0, [r4, 0x2] +_081D3ECC: + ldr r2, _081D3EE4 + 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 + .align 2, 0 +_081D3EE4: .4byte 0x030012c8 + thumb_func_end sub_81D3D70 + + thumb_func_start sub_81D3EE8 +sub_81D3EE8: @ 81D3EE8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081D3F04 + ldr r0, [r0] + movs r1, 0xC + ands r0, r1 + cmp r0, 0x8 + bne _081D3F0C + cmp r2, 0 + beq _081D3F0C + ldr r1, _081D3F08 + movs r0, 0x1 + b _081D3F10 + .align 2, 0 +_081D3F04: .4byte 0x04000128 +_081D3F08: .4byte 0x030012c8 +_081D3F0C: + ldr r1, _081D3F18 + movs r0, 0 +_081D3F10: + strb r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_081D3F18: .4byte 0x030012c8 + 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, _081D3F48 + ldrb r0, [r3] + cmp r0, 0 + beq _081D3F54 + ldr r2, _081D3F4C + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + str r5, [r3, 0x8] + ldr r0, _081D3F50 + str r4, [r0] + lsrs r0, r4, 2 + adds r0, 0x1 + str r0, [r3, 0x10] + bl sub_81D3F68 + b _081D3F5C + .align 2, 0 +_081D3F48: .4byte 0x030012c8 +_081D3F4C: .4byte 0x04000128 +_081D3F50: .4byte 0x04000120 +_081D3F54: + ldr r1, _081D3F64 + ldrh r0, [r1] + strh r0, [r1] + str r2, [r3, 0x8] +_081D3F5C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D3F64: .4byte 0x04000128 + thumb_func_end sub_81D3F1C + + thumb_func_start sub_81D3F68 +sub_81D3F68: @ 81D3F68 + ldr r1, _081D3F8C + ldr r2, _081D3F90 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _081D3F94 + movs r2, 0x40 + strh r2, [r0] + ldr r3, _081D3F98 + 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 + .align 2, 0 +_081D3F8C: .4byte 0x0400010c +_081D3F90: .4byte 0x0000fda7 +_081D3F94: .4byte 0x0400010e +_081D3F98: .4byte 0x04000208 + 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, _081D3FC4 + 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 + .align 2, 0 +_081D3FC4: .4byte 0x030012c8 +_081D3FC8: + cmp r0, 0x5 + bne _081D3FCE + b _081D40FC +_081D3FCE: + b _081D412A +_081D3FD0: + ldr r1, _081D4000 + ldr r2, _081D4004 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _081D4008 + 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, _081D4004 + ldr r5, _081D400C +_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 + .align 2, 0 +_081D4000: .4byte 0x0400012a +_081D4004: .4byte 0x0000ccd0 +_081D4008: .4byte 0x04000120 +_081D400C: .4byte 0x0000ffff +_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, _081D4070 + 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, _081D4070 + 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 + .align 2, 0 +_081D4070: .4byte 0x04000120 +_081D4074: + ldr r1, _081D407C + ldr r0, [r3, 0x14] + b _081D40B8 + .align 2, 0 +_081D407C: .4byte 0x04000120 +_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, _081D40DC + 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, _081D40E0 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + b _081D412A + .align 2, 0 +_081D40DC: .4byte 0x030012e8 +_081D40E0: .4byte 0x0400010e +_081D40E4: + bl sub_81D413C + b _081D412A +_081D40EA: + movs r0, 0 + movs r1, 0x4 + strb r1, [r3, 0x1] + ldr r1, _081D40F8 + strh r0, [r1] + b _081D412A + .align 2, 0 +_081D40F8: .4byte 0x030012e6 +_081D40FC: + ldrb r3, [r2] + cmp r3, 0 + bne _081D4108 + ldr r1, _081D4134 + ldrb r0, [r2, 0x3] + strh r0, [r1] +_081D4108: + ldr r0, _081D4138 + 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 + .align 2, 0 +_081D4134: .4byte 0x0400012a +_081D4138: .4byte 0x04000120 + thumb_func_end sub_81D3FAC + + thumb_func_start sub_81D413C +sub_81D413C: @ 81D413C + ldr r0, _081D4148 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_081D4148: .4byte 0x04000128 + thumb_func_end sub_81D413C + + thumb_func_start sub_81D414C +sub_81D414C: @ 81D414C + ldr r2, _081D4160 + ldrh r1, [r2] + ldr r0, _081D4164 + ands r0, r1 + strh r0, [r2] + ldr r1, _081D4168 + ldr r2, _081D416C + adds r0, r2, 0 + strh r0, [r1] + bx lr + .align 2, 0 +_081D4160: .4byte 0x0400010e +_081D4164: .4byte 0x0000ff7f +_081D4168: .4byte 0x0400010c +_081D416C: .4byte 0x0000fda7 + thumb_func_end sub_81D414C + + thumb_func_start sub_81D4170 +sub_81D4170: @ 81D4170 + push {r4,lr} + ldr r0, _081D4190 + ldrh r0, [r0] + ldr r2, _081D4194 + adds r1, r2, 0 + eors r1, r0 + ldr r4, _081D4198 + ldr r3, _081D419C + ldrh r2, [r3] + adds r0, r1, 0 + bics r0, r2 + strh r0, [r4] + strh r1, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D4190: .4byte 0x04000130 +_081D4194: .4byte 0x000003ff +_081D4198: .4byte 0x030012e2 +_081D419C: .4byte 0x030012e0 + thumb_func_end sub_81D4170 + + thumb_func_start sub_81D41A0 +sub_81D41A0: @ 81D41A0 + ldr r1, _081D41CC + ldr r0, _081D41D0 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _081D41D4 + ldr r0, _081D41D8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _081D41DC + ldr r0, _081D41E0 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _081D41E4 + ldr r0, _081D41E8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _081D41EC + ldr r0, _081D41F0 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_081D41CC: .4byte 0x030012ec +_081D41D0: .4byte 0x04000208 +_081D41D4: .4byte 0x030012ee +_081D41D8: .4byte 0x04000200 +_081D41DC: .4byte 0x030012f0 +_081D41E0: .4byte 0x0400010e +_081D41E4: .4byte 0x030012f2 +_081D41E8: .4byte 0x04000128 +_081D41EC: .4byte 0x030012f4 +_081D41F0: .4byte 0x04000134 + thumb_func_end sub_81D41A0 + + thumb_func_start sub_81D41F4 +sub_81D41F4: @ 81D41F4 + ldr r1, _081D4220 + ldr r0, _081D4224 + ldrh r0, [r0] + strh r0, [r1] + subs r1, 0x8 + ldr r0, _081D4228 + ldrh r0, [r0] + strh r0, [r1] + subs r1, 0xF2 + ldr r0, _081D422C + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0x1A + ldr r0, _081D4230 + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0xC + ldr r0, _081D4234 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .align 2, 0 +_081D4220: .4byte 0x04000208 +_081D4224: .4byte 0x030012ec +_081D4228: .4byte 0x030012ee +_081D422C: .4byte 0x030012f0 +_081D4230: .4byte 0x030012f2 +_081D4234: .4byte 0x030012f4 + 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, _081D4250 + ldr r2, _081D4254 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_081D4250: .4byte 0x030012c8 +_081D4254: .4byte 0x05000006 + thumb_func_end sub_81D4238 + + thumb_func_start sub_81D4258 +sub_81D4258: @ 81D4258 + push {lr} + sub sp, 0x4 + ldr r0, _081D4278 + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x1 + mov r3, sp + bl npc_id_by_local_id_and_map_ret_success + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_081D4278: .4byte 0x03005d8c + 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, _081D4320 + adds r5, r1, r2 + ldr r4, _081D4324 + ldr r3, _081D4328 + 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, _081D432C + 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, _081D4330 + 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, _081D4320 + ldr r0, _081D4328 + 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, _081D4334 + bl var_get + 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 + .align 2, 0 +_081D4320: .4byte 0x02037350 +_081D4324: .4byte 0x030012f8 +_081D4328: .4byte 0x02037590 +_081D432C: .4byte 0x030012fa +_081D4330: .4byte 0x030012fc +_081D4334: .4byte 0x0000403a +_081D4338: + ldrb r0, [r5, 0x1] + movs r1, 0x20 + orrs r0, r1 +_081D433E: + strb r0, [r5, 0x1] + ldr r0, _081D435C + bl var_get + 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 + .align 2, 0 +_081D435C: .4byte 0x0000403a +_081D4360: + movs r4, 0 + mov r8, r4 + ldr r6, _081D43B0 + mov r10, r6 +_081D4368: + ldr r3, _081D43B4 + 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, _081D43B8 + adds r0, r1, r6 + movs r6, 0x14 + ldrsh r2, [r4, r6] + movs r6, 0 + ldrsh r0, [r0, r6] + ldr r6, _081D43B0 + mov r9, r6 + mov r12, r3 + adds r7, r1, 0 + cmp r2, r0 + beq _081D4394 + b _081D449E +_081D4394: + movs r3, 0 + ldr r1, _081D43BC + 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 + .align 2, 0 +_081D43B0: .4byte 0x02037350 +_081D43B4: .4byte 0x02037590 +_081D43B8: .4byte 0x0862608c +_081D43BC: .4byte 0x0862608e +_081D43C0: + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, r2 + blt _081D43CA + movs r3, 0x1 +_081D43CA: + cmp r3, 0 + bne _081D449E + ldr r0, _081D440C + 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 + .align 2, 0 +_081D440C: .4byte 0x030012f8 +_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, _081D4480 + 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, _081D4484 + 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 + .align 2, 0 +_081D4480: .4byte 0x02037590 +_081D4484: .4byte 0x030012fa +_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, _081D44E0 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + mov r3, r10 + adds r4, r0, r3 + ldr r6, _081D44E4 + ldr r1, _081D44E8 + adds r0, r7, r1 + movs r3, 0x16 + ldrsh r1, [r4, r3] + movs r3, 0 + ldrsh r0, [r0, r3] + ldr r3, _081D44EC + 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 + .align 2, 0 +_081D44E0: .4byte 0x02037590 +_081D44E4: .4byte 0x0862608c +_081D44E8: .4byte 0x0862608e +_081D44EC: .4byte 0x02037350 +_081D44F0: + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, r2 + blt _081D44FA + movs r3, 0x1 +_081D44FA: + cmp r3, 0 + bne _081D45D0 + ldr r0, _081D453C + 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 + .align 2, 0 +_081D453C: .4byte 0x030012fa +_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, _081D45B0 + 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, _081D45B4 + 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 + .align 2, 0 +_081D45B0: .4byte 0x02037590 +_081D45B4: .4byte 0x030012f8 +_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, _081D4824 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _081D476E + ldr r2, _081D4828 + ldr r0, _081D482C + 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, _081D4828 + ldr r0, _081D482C + 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, _081D4830 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _081D480C + ldr r2, _081D4828 + ldr r0, _081D482C + 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, _081D4828 + ldr r0, _081D482C + 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 + .align 2, 0 +_081D4824: .4byte 0x030012fa +_081D4828: .4byte 0x02037350 +_081D482C: .4byte 0x02037590 +_081D4830: .4byte 0x030012f8 + 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, _081D4868 + ldr r1, _081D486C + 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 + .align 2, 0 +_081D4868: .4byte 0x02037350 +_081D486C: .4byte 0x02037590 +_081D4870: + lsls r0, r3, 16 + asrs r0, 16 + lsls r1, r4, 16 + asrs r1, 16 + bl cur_mapdata_block_get_role_at + 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, _081D496C + adds r4, r1, r0 + movs r1, 0 + ldr r3, _081D4970 + 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, _081D4970 + 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, _081D4970 + 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, _081D4970 + 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, _081D4970 + 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, _081D4970 + b _081D4988 + .align 2, 0 +_081D496C: .4byte 0x02037350 +_081D4970: .4byte 0x030012fc +_081D4974: + ldr r4, _081D4990 + ldr r0, _081D4994 + bl var_get + 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 + .align 2, 0 +_081D4990: .4byte 0x030012fc +_081D4994: .4byte 0x0000403a + thumb_func_end sub_81D4890 + + thumb_func_start sub_81D4998 +sub_81D4998: @ 81D4998 + push {r4,lr} + ldr r4, _081D49C8 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _081D49CC + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _081D49D0 + cmp r1, r0 + bne _081D49E0 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _081D49D4 + cmp r2, r0 + bls _081D49D8 + adds r0, r4, 0 + movs r1, 0 + bl var_set + b _081D49E0 + .align 2, 0 +_081D49C8: .4byte 0x0000403a +_081D49CC: .4byte 0x03005d8c +_081D49D0: .4byte 0x0000391a +_081D49D4: .4byte 0x0000270e +_081D49D8: + adds r0, r4, 0 + adds r1, r2, 0 + bl var_set +_081D49E0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D4998 + + thumb_func_start sub_81D49E8 +sub_81D49E8: @ 81D49E8 + push {lr} + adds r2, r0, 0 + ldr r0, _081D4A04 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _081D4A08 + cmp r1, r0 + bne _081D4A0C + ldrb r0, [r2, 0x5] + cmp r0, 0xE5 + bne _081D4A0C + movs r0, 0x1 + b _081D4A0E + .align 2, 0 +_081D4A04: .4byte 0x03005d8c +_081D4A08: .4byte 0x0000391a +_081D4A0C: + movs r0, 0 +_081D4A0E: + pop {r1} + bx r1 + thumb_func_end sub_81D49E8 + + thumb_func_start unown_chamber_related +unown_chamber_related: @ 81D4A14 + push {lr} + ldr r0, _081D4A44 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, _081D4A48 + cmp r1, r0 + bne _081D4A50 + movs r0, 0xE5 + lsls r0, 1 + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081D4A50 + ldr r0, _081D4A4C + bl flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081D4A50 + movs r0, 0x1 + b _081D4A52 + .align 2, 0 +_081D4A44: .4byte 0x03005d8c +_081D4A48: .4byte 0x0000391a +_081D4A4C: .4byte 0x000002ce +_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, _081D4A80 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + ldr r1, _081D4A84 + cmp r0, r1 + beq _081D4A88 + adds r0, r4, 0 + bl var_get + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _081D4A88 + movs r0, 0x1 + b _081D4A8A + .align 2, 0 +_081D4A80: .4byte 0x0000403a +_081D4A84: .4byte 0xffff0000 +_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, _081D4AEC + adds r5, r1, r0 + ldrb r1, [r5, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldr r0, _081D4AF0 + ldrh r4, [r0] + cmp r4, 0x1 + bne _081D4AF8 + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r3, _081D4AF4 + 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 + .align 2, 0 +_081D4AEC: .4byte 0x02037350 +_081D4AF0: .4byte 0x020375e0 +_081D4AF4: .4byte 0x02020630 +_081D4AF8: + ldr r0, _081D4BCC + ldr r1, _081D4BD0 + bl var_set + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r6, _081D4BD4 + 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, _081D4BD8 + 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, _081D4BDC + adds r0, r4, 0 + bl gpu_pal_obj_alloc_tag_and_apply + ldrh r0, [r4, 0x4] + bl gpu_pal_tags_index_of + 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, _081D4BE0 + 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 obj_add_from_template_backward_search + ldr r1, _081D4BE4 + 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, _081D4BE8 + str r0, [r1, 0x1C] +_081D4BC4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D4BCC: .4byte 0x0000403a +_081D4BD0: .4byte 0x0000ffff +_081D4BD4: .4byte 0x02020630 +_081D4BD8: .4byte 0x020375f4 +_081D4BDC: .4byte 0x0850c9c8 +_081D4BE0: .4byte 0x085059f8 +_081D4BE4: .4byte 0x0203cf50 +_081D4BE8: .4byte nullsub_12 + 1 + thumb_func_end sub_81D4A90 + + thumb_func_start sub_81D4BEC +sub_81D4BEC: @ 81D4BEC + push {lr} + ldr r1, _081D4C0C + ldrb r0, [r1] + cmp r0, 0x40 + beq _081D4C06 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, _081D4C10 + adds r0, r1 + bl obj_delete_and_free_tiles +_081D4C06: + pop {r0} + bx r0 + .align 2, 0 +_081D4C0C: .4byte 0x0203cf50 +_081D4C10: .4byte 0x02020630 + 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, _081D4C48 + 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, _081D4C4C + adds r0, r4, r0 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0x1 + b _081D4C52 + .align 2, 0 +_081D4C48: .4byte 0x030012fa +_081D4C4C: .4byte 0x030012fc +_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, _081D4C8C + 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, _081D4C90 + adds r0, r4, r0 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0x1 + b _081D4C96 + .align 2, 0 +_081D4C8C: .4byte 0x030012f8 +_081D4C90: .4byte 0x030012fc +_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, _081D4CD0 + 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, _081D4CD4 + adds r0, r4, r0 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + b _081D4CDA + .align 2, 0 +_081D4CD0: .4byte 0x030012fa +_081D4CD4: .4byte 0x030012fc +_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, _081D4D14 + 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, _081D4D18 + adds r0, r4, r0 + movs r1, 0x3 + strb r1, [r0] + movs r0, 0x1 + b _081D4D1E + .align 2, 0 +_081D4D14: .4byte 0x030012f8 +_081D4D18: .4byte 0x030012fc +_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, _081D4D48 + ldr r0, _081D4D4C + bl var_get + 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 + .align 2, 0 +_081D4D48: .4byte 0x030012fc +_081D4D4C: .4byte 0x0000403a + 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, _081D4DA4 + ldrh r0, [r4] + strh r0, [r1] + movs r0, 0 + strh r0, [r4] + ldr r1, _081D4DA8 + ldr r0, _081D4DAC + str r0, [r1, 0x4] + ldr r0, _081D4DB0 + str r0, [r1, 0x8] + bl sub_81D41A0 + bl sub_81D4238 + ldr r2, _081D4DB4 + 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 + .align 2, 0 +_081D4DA4: .4byte 0x04000208 +_081D4DA8: .4byte 0x03002710 +_081D4DAC: .4byte sub_81D3FAC + 1 +_081D4DB0: .4byte sub_81D3F9C + 1 +_081D4DB4: .4byte 0x04000200 + thumb_func_end sub_81D4D50 + + thumb_func_start sub_81D4DB8 +sub_81D4DB8: @ 81D4DB8 + push {r4,lr} + sub sp, 0x4 + mov r1, sp + ldr r4, _081D4DE4 + ldrh r0, [r4] + strh r0, [r1] + movs r0, 0 + strh r0, [r4] + bl sub_81D4238 + bl sub_81D41F4 + bl restore_serial_timer3_irq_handlers + mov r0, sp + ldrh r0, [r0] + strh r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D4DE4: .4byte 0x04000208 + 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, _081D4E2C + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_081D4E2C: .4byte 0x03003144 + thumb_func_end sub_81D4DE8 + + thumb_func_start sub_81D4E30 +sub_81D4E30: @ 81D4E30 + push {lr} + ldr r0, _081D4E54 + movs r2, 0x80 + lsls r2, 6 + movs r1, 0 + bl memset + ldr r1, _081D4E58 + ldr r2, _081D4E5C + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009734 + movs r0, 0x1 + bl sub_800B330 + pop {r0} + bx r0 + .align 2, 0 +_081D4E54: .4byte 0x0201c000 +_081D4E58: .4byte 0x020229c6 +_081D4E5C: .4byte 0x00005503 + thumb_func_end sub_81D4E30 + + thumb_func_start sub_81D4E60 +sub_81D4E60: @ 81D4E60 + push {lr} + sub sp, 0xC + mov r1, sp + ldr r2, _081D4EA4 + ldrh r0, [r2] + strh r0, [r1] + movs r0, 0 + strh r0, [r2] + ldr r0, _081D4EA8 + 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, _081D4EAC + cmp r1, r0 + bne _081D4EB8 + ldrh r1, [r2, 0x2] + ldr r0, _081D4EB0 + cmp r1, r0 + bne _081D4EB8 + ldrh r1, [r2, 0x4] + ldr r0, _081D4EB4 + cmp r1, r0 + bne _081D4EB8 + ldrh r0, [r2, 0x6] + cmp r0, r1 + bne _081D4EB8 + movs r0, 0x1 + b _081D4EBA + .align 2, 0 +_081D4EA4: .4byte 0x04000208 +_081D4EA8: .4byte 0x03003174 +_081D4EAC: .4byte 0x0000b9a0 +_081D4EB0: .4byte 0x0000ccd0 +_081D4EB4: .4byte 0x0000ffff +_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, _081D4F1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D4F1C: .4byte _081D4F20 + .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, _081D4F9C + 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 + .align 2, 0 +_081D4F9C: .4byte 0x030022c0 +_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, _081D4FDC + 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 + .align 2, 0 +_081D4FDC: .4byte 0x03003124 +_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, _081D5008 + ldrb r0, [r0] + cmp r0, 0 + bne _081D500C + strb r0, [r4] + movs r0, 0x4 + b _081D500E + .align 2, 0 +_081D5008: .4byte 0x03003124 +_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, _081D5054 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, _081D5058 + 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 malloc_and_clear + str r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D5054: .4byte sub_81D5084 + 1 +_081D5058: .4byte 0x03005e08 + 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, _081D50A8 + adds r4, r0, r1 + ldrb r0, [r4, 0x8] + cmp r0, 0x1A + bls _081D509C + b _081D548A +_081D509C: + lsls r0, 2 + ldr r1, _081D50AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D50A8: .4byte 0x03005e08 +_081D50AC: .4byte _081D50B0 + .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, _081D5134 + bl mevent_0814257C + cmp r0, 0 + bne _081D512C + b _081D548A +_081D512C: + movs r0, 0x1 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5134: .4byte 0x085edfd6 +_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, _081D5190 + bl mevent_0814257C + cmp r0, 0 + bne _081D517C + b _081D548A +_081D517C: + ldr r0, _081D5194 + bl sub_8018884 + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x5 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5190: .4byte 0x085edff5 +_081D5194: .4byte 0x085ee014 +_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, _081D51CC + 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 + .align 2, 0 +_081D51CC: .4byte 0x030022c0 +_081D51D0: + ldr r0, _081D51F0 + 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 + .align 2, 0 +_081D51F0: .4byte 0x030022c0 +_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, _081D5264 + bl mevent_0814257C + cmp r0, 0 + bne _081D525C + b _081D548A +_081D525C: + movs r0, 0x4 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5264: .4byte 0x085ee05c +_081D5268: + ldr r0, _081D5280 + bl sub_8018884 + ldr r0, _081D5284 + ldr r1, _081D5288 + ldr r2, _081D528C + subs r1, r2 + bl sub_81D4D50 + movs r0, 0x9 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5280: .4byte 0x085ee097 +_081D5284: .4byte 0x03006370 +_081D5288: .4byte 0x089a6550 +_081D528C: .4byte 0x089a3470 +_081D5290: + ldr r0, _081D52A8 + 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 + .align 2, 0 +_081D52A8: .4byte 0x03006370 +_081D52AC: + ldr r0, _081D52D4 + 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, _081D52D8 + bl sub_8018884 + movs r0, 0xB + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D52D4: .4byte 0x03006370 +_081D52D8: .4byte 0x085ee120 +_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, _081D5304 + bl sub_8018884 +_081D52FC: + movs r0, 0xD + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5304: .4byte 0x085ee0dc +_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, _081D5324 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D5324: .4byte _081D5328 + .align 2, 0 +_081D5328: + .4byte _081D548A + .4byte _081D5350 + .4byte _081D5340 + .4byte _081D5374 + .4byte _081D5374 + .4byte _081D5360 +_081D5340: + ldr r0, _081D534C + bl sub_8018884 + movs r0, 0xE + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D534C: .4byte 0x085ee097 +_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, _081D53A4 + bl sub_81D3920 + strb r0, [r4, 0xE] + ldrb r0, [r4, 0xE] + bl sub_800ABF4 + movs r0, 0x10 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D53A4: .4byte 0x0201c000 +_081D53A8: + ldr r0, _081D53BC + 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 + .align 2, 0 +_081D53BC: .4byte 0x03003124 +_081D53C0: + movs r0, 0x14 + strb r0, [r4, 0x8] + b _081D548A +_081D53C6: + ldr r0, _081D53E4 + bl sub_81D3AB0 + cmp r0, 0 + beq _081D53EC + ldr r0, _081D53E8 + bl sub_8018884 + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x12 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D53E4: .4byte 0x0201c000 +_081D53E8: .4byte 0x085ee0fa +_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, _081D5414 + bl sub_8018884 + movs r0, 0xB9 + lsls r0, 1 + bl fanfare_play + movs r0, 0x13 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5414: .4byte 0x085ee107 +_081D5418: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _081D548A + ldr r0, _081D542C + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + b _081D543A + .align 2, 0 +_081D542C: .4byte 0x030022c0 +_081D5430: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, _081D5444 + bl mevent_0814257C +_081D543A: + cmp r0, 0 + beq _081D548A + movs r0, 0x1A + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5444: .4byte 0x085ee06b +_081D5448: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, _081D5450 + b _081D5466 + .align 2, 0 +_081D5450: .4byte 0x085ee0a3 +_081D5454: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, _081D545C + b _081D5466 + .align 2, 0 +_081D545C: .4byte 0x085ee0bf +_081D5460: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, _081D5474 +_081D5466: + bl mevent_0814257C + cmp r0, 0 + beq _081D548A +_081D546E: + movs r0, 0 + strb r0, [r4, 0x8] + b _081D548A + .align 2, 0 +_081D5474: .4byte 0x085ee12d +_081D5478: + ldr r0, [r4, 0x10] + bl free + adds r0, r5, 0 + bl remove_task + ldr r0, _081D5490 + bl set_callback2 +_081D548A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D5490: .4byte sub_80186A4 + 1 + thumb_func_end sub_81D5084 + + thumb_func_start sp194_trainer_tower +sp194_trainer_tower: @ 81D5494 + push {lr} + bl sub_81D56B0 + ldr r1, _081D54B4 + ldr r0, _081D54B8 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + bl sub_81D5710 + pop {r0} + bx r0 + .align 2, 0 +_081D54B4: .4byte 0x0862a618 +_081D54B8: .4byte 0x020375e0 + thumb_func_end sp194_trainer_tower + + thumb_func_start sub_81D54BC +sub_81D54BC: @ 81D54BC + push {r4-r6,lr} + ldr r4, _081D5508 + ldr r1, [r4] + ldr r3, _081D550C + 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, _081D5510 + ldr r0, [r2] + ldr r1, _081D5514 + adds r0, r1 + movs r1, 0 + str r1, [r0] + adds r6, r2, 0 + ldr r5, _081D5518 + movs r4, 0x3 +_081D54EE: + ldr r0, [r6] + adds r0, r5 + ldr r1, _081D551C + bl sub_81D5DF4 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _081D54EE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D5508: .4byte 0x03005d90 +_081D550C: .4byte 0x00000ef9 +_081D5510: .4byte 0x03005d8c +_081D5514: .4byte 0x00003d68 +_081D5518: .4byte 0x00003718 +_081D551C: .4byte 0x00034bbf + thumb_func_end sub_81D54BC + + thumb_func_start sub_81D5520 +sub_81D5520: @ 81D5520 + ldr r0, _081D552C + ldrb r0, [r0, 0x12] + adds r0, 0x61 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_081D552C: .4byte 0x02037318 + 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, _081D554C + ldr r1, _081D5550 + ldr r1, [r1] + adds r1, 0x16 + adds r1, r0 + ldrb r0, [r1] + adds r0, r2 + ldrb r0, [r0] + bx lr + .align 2, 0 +_081D554C: .4byte 0x0831f5ca +_081D5550: .4byte 0x0203cf58 + 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, _081D5584 + 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 + .align 2, 0 +_081D5584: .4byte 0x0203cf58 + 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, _081D55C8 + 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, _081D55CC + adds r4, r0 + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081D55C8: .4byte 0x0203cf54 +_081D55CC: .4byte 0x0831f578 + 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, _081D5684 + movs r0, 0x18 + bl malloc_and_clear + str r0, [r4] + movs r6, 0 + ldr r0, _081D5688 + 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, _081D5684 + 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, _081D5684 + 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, _081D568C + ldr r0, [r1] + ldr r1, _081D5690 + 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 + .align 2, 0 +_081D5684: .4byte 0x0203cf58 +_081D5688: .4byte 0x0203cf54 +_081D568C: .4byte 0x03005d8c +_081D5690: .4byte 0x00003d64 + thumb_func_end sub_81D55D0 + + thumb_func_start sub_81D5694 +sub_81D5694: @ 81D5694 + push {r4,lr} + ldr r4, _081D56AC + ldr r0, [r4] + cmp r0, 0 + beq _081D56A6 + bl free + movs r0, 0 + str r0, [r4] +_081D56A6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D56AC: .4byte 0x0203cf58 + thumb_func_end sub_81D5694 + + thumb_func_start sub_81D56B0 +sub_81D56B0: @ 81D56B0 + push {r4,lr} + ldr r4, _081D56F4 + ldr r0, [r4] + cmp r0, 0 + bne _081D56EC + ldr r0, _081D56F8 + bl malloc_and_clear + str r0, [r4] + ldr r1, _081D56FC + ldrb r1, [r1, 0x12] + adds r1, 0x61 + strb r1, [r0] + ldr r1, _081D5700 + ldr r0, _081D5704 + ldr r0, [r0] + ldr r2, _081D5708 + 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, _081D570C + bl CpuSet + bl nullsub_2 +_081D56EC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D56F4: .4byte 0x0203cf54 +_081D56F8: .4byte 0x00000eec +_081D56FC: .4byte 0x02037318 +_081D5700: .4byte 0x0862a5f8 +_081D5704: .4byte 0x03005d8c +_081D5708: .4byte 0x00003d6e +_081D570C: .4byte 0x040003ba + thumb_func_end sub_81D56B0 + + thumb_func_start sub_81D5710 +sub_81D5710: @ 81D5710 + push {r4,lr} + ldr r4, _081D5728 + ldr r0, [r4] + cmp r0, 0 + beq _081D5722 + bl free + movs r0, 0 + str r0, [r4] +_081D5722: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D5728: .4byte 0x0203cf54 + 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, _081D578C + 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 sub_81638AC + b _081D580E + .align 2, 0 +_081D578C: .4byte 0x0203cf54 +_081D5790: + ldr r0, _081D57B8 + 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 sub_81638AC + b _081D580E + .align 2, 0 +_081D57B8: .4byte 0x0203cf54 +_081D57BC: + ldr r0, _081D57E4 + 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 sub_81638AC + b _081D580E + .align 2, 0 +_081D57E4: .4byte 0x0203cf54 +_081D57E8: + ldr r0, _081D5818 + 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 sub_81638AC +_081D580E: + bl sub_81D5710 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D5818: .4byte 0x0203cf54 + 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, _081D583C + ldr r1, [r3] + ldr r0, _081D5840 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x20 + orrs r0, r2 + b _081D5854 + .align 2, 0 +_081D583C: .4byte 0x03005d8c +_081D5840: .4byte 0x00003d6e +_081D5844: + ldr r3, _081D58C0 + ldr r1, [r3] + ldr r0, _081D58C4 + 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, _081D58C8 + adds r0, r1 + movs r5, 0 + strb r5, [r0] + ldr r0, [r6] + ldr r4, _081D58CC + adds r0, r4 + bl sub_80008DC + ldr r1, [r6] + adds r4, r1, r4 + str r5, [r4] + ldr r3, _081D58C4 + 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, _081D58D0 + ldr r0, [r0] + movs r1, 0xEE + lsls r1, 4 + adds r0, r1 + strb r5, [r0] + ldr r0, _081D58D4 + 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 + .align 2, 0 +_081D58C0: .4byte 0x03005d8c +_081D58C4: .4byte 0x00003d6e +_081D58C8: .4byte 0x00003d6c +_081D58CC: .4byte 0x00003d64 +_081D58D0: .4byte 0x03005d90 +_081D58D4: .4byte 0x0202433a + thumb_func_end sub_81D581C + + thumb_func_start sub_81D58D8 +sub_81D58D8: @ 81D58D8 + push {lr} + bl sub_80008E8 + ldr r3, _081D5918 + movs r0, 0 + strh r0, [r3] + ldr r0, _081D591C + ldr r0, [r0] + ldr r1, _081D5920 + 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 + .align 2, 0 +_081D5918: .4byte 0x020375f0 +_081D591C: .4byte 0x03005d8c +_081D5920: .4byte 0x00003d6e + 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, _081D595C + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x4 + bne _081D5952 + ldr r0, _081D5960 + mov r8, r0 + ldr r0, [r0] + ldr r7, _081D5964 + adds r0, r7 + ldrb r0, [r0] + movs r6, 0x1 + adds r4, r6, 0 + ands r4, r0 + cmp r4, 0 + beq _081D596C +_081D5952: + ldr r1, _081D5968 + movs r0, 0x2 + strh r0, [r1] + b _081D59C0 + .align 2, 0 +_081D595C: .4byte 0x0203cf54 +_081D5960: .4byte 0x03005d8c +_081D5964: .4byte 0x00003d6e +_081D5968: .4byte 0x020375f0 +_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, _081D59AC + 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, _081D59B0 + ldr r1, [r0] + ldr r0, _081D59B4 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, _081D59B8 + strh r4, [r0] + b _081D59C0 + .align 2, 0 +_081D59AC: .4byte 0x02021dc4 +_081D59B0: .4byte 0x03005d90 +_081D59B4: .4byte 0x00000ef9 +_081D59B8: .4byte 0x020375f0 +_081D59BC: + ldr r0, _081D59CC + strh r6, [r0] +_081D59C0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D59CC: .4byte 0x020375f0 + thumb_func_end sub_81D5924 + + thumb_func_start sub_81D59D0 +sub_81D59D0: @ 81D59D0 + push {r4-r6,lr} + ldr r4, _081D59F0 + ldr r2, [r4] + ldr r6, _081D59F4 + 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, _081D59F8 + strh r3, [r0] + b _081D5A4E + .align 2, 0 +_081D59F0: .4byte 0x03005d8c +_081D59F4: .4byte 0x00003d6e +_081D59F8: .4byte 0x020375f0 +_081D59FC: + ldr r1, _081D5A38 + adds r0, r2, r1 + bl free_203F458 + ldr r2, [r4] + ldr r3, _081D5A3C + 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, _081D5A40 + adds r1, r2, r3 + adds r1, r0 + ldr r0, _081D5A38 + adds r2, r0 + ldr r0, [r2] + str r0, [r1] + ldr r0, _081D5A44 + strh r5, [r0] + b _081D5A4E + .align 2, 0 +_081D5A38: .4byte 0x00003d68 +_081D5A3C: .4byte 0x00003d64 +_081D5A40: .4byte 0x00003718 +_081D5A44: .4byte 0x020375f0 +_081D5A48: + ldr r1, _081D5A64 + movs r0, 0x1 + strh r0, [r1] +_081D5A4E: + ldr r0, _081D5A68 + ldr r1, [r0] + ldr r3, _081D5A6C + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D5A64: .4byte 0x020375f0 +_081D5A68: .4byte 0x03005d8c +_081D5A6C: .4byte 0x00003d6e + thumb_func_end sub_81D59D0 + + thumb_func_start sub_81D5A70 +sub_81D5A70: @ 81D5A70 + push {lr} + ldr r0, _081D5A98 + ldr r2, [r0] + ldr r1, _081D5A9C + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081D5AAE + ldr r0, _081D5AA0 + adds r2, r0 + ldr r1, [r2] + ldr r0, _081D5AA4 + cmp r1, r0 + bls _081D5AA8 + adds r0, 0x1 + str r0, [r2] + b _081D5AAE + .align 2, 0 +_081D5A98: .4byte 0x03005d8c +_081D5A9C: .4byte 0x00003d6e +_081D5AA0: .4byte 0x00003d64 +_081D5AA4: .4byte 0x00034bbe +_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, _081D5AC8 + ldr r1, [r0] + ldr r0, _081D5ACC + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_081D5AC8: .4byte 0x03005d8c +_081D5ACC: .4byte 0x00003d6e + thumb_func_end sub_81D5AB4 + + thumb_func_start sub_81D5AD0 +sub_81D5AD0: @ 81D5AD0 + push {lr} + ldr r0, _081D5AF4 + ldr r0, [r0] + ldr r1, _081D5AF8 + 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, _081D5AFC + movs r0, 0 + b _081D5B20 + .align 2, 0 +_081D5AF4: .4byte 0x03005d8c +_081D5AF8: .4byte 0x00003d6e +_081D5AFC: .4byte 0x020375f0 +_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, _081D5B18 + movs r0, 0x1 + b _081D5B20 + .align 2, 0 +_081D5B18: .4byte 0x020375f0 +_081D5B1C: + ldr r1, _081D5B28 + movs r0, 0x2 +_081D5B20: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081D5B28: .4byte 0x020375f0 + thumb_func_end sub_81D5AD0 + + thumb_func_start sub_81D5B2C +sub_81D5B2C: @ 81D5B2C + push {r4-r7,lr} + ldr r0, _081D5BA0 + ldr r0, [r0] + ldr r1, _081D5BA4 + adds r0, r1 + ldr r7, [r0] + ldr r0, _081D5BA8 + cmp r7, r0 + ble _081D5B40 + ldr r7, _081D5BAC +_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, _081D5BB0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _081D5BB4 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + ldr r0, _081D5BB8 + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D5BA0: .4byte 0x03005d8c +_081D5BA4: .4byte 0x00003d64 +_081D5BA8: .4byte 0x00034bbe +_081D5BAC: .4byte 0x00034bbf +_081D5BB0: .4byte 0x02021cc4 +_081D5BB4: .4byte 0x02021dc4 +_081D5BB8: .4byte 0x02021ec4 + thumb_func_end sub_81D5B2C + + thumb_func_start sub_81D5BBC +sub_81D5BBC: @ 81D5BBC + push {lr} + bl sub_81D56B0 + ldr r0, _081D5BE0 + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x4 + beq _081D5BEC + ldr r0, _081D5BE4 + ldrb r1, [r1, 0x6] + movs r2, 0 + movs r3, 0x1 + bl decimal_int_to_string + ldr r1, _081D5BE8 + movs r0, 0 + b _081D5BF0 + .align 2, 0 +_081D5BE0: .4byte 0x0203cf54 +_081D5BE4: .4byte 0x02021cc4 +_081D5BE8: .4byte 0x020375f0 +_081D5BEC: + ldr r1, _081D5BFC + movs r0, 0x1 +_081D5BF0: + strh r0, [r1] + bl sub_81D5710 + pop {r0} + bx r0 + .align 2, 0 +_081D5BFC: .4byte 0x020375f0 + thumb_func_end sub_81D5BBC + + thumb_func_start sub_81D5C00 +sub_81D5C00: @ 81D5C00 + push {lr} + bl sub_81D56B0 + ldr r1, _081D5C14 + movs r0, 0 + strh r0, [r1] + bl sub_81D5710 + pop {r0} + bx r0 + .align 2, 0 +_081D5C14: .4byte 0x020375f0 + thumb_func_end sub_81D5C00 + + thumb_func_start sub_81D5C18 +sub_81D5C18: @ 81D5C18 + push {lr} + ldr r0, _081D5C48 + bl var_get + lsls r0, 16 + cmp r0, 0 + beq _081D5C42 + ldr r0, _081D5C4C + ldr r0, [r0] + ldr r1, _081D5C50 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081D5C42 + bl sub_81D609C + lsls r0, 24 + cmp r0, 0 + bne _081D5C54 +_081D5C42: + movs r0, 0 + b _081D5C56 + .align 2, 0 +_081D5C48: .4byte 0x000040d6 +_081D5C4C: .4byte 0x03005d8c +_081D5C50: .4byte 0x00003d6e +_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, _081D5C70 + strh r1, [r0] + b _081D5C7A + .align 2, 0 +_081D5C70: .4byte 0x020375f0 +_081D5C74: + ldr r1, _081D5C80 + movs r0, 0x1 + strh r0, [r1] +_081D5C7A: + pop {r0} + bx r0 + .align 2, 0 +_081D5C80: .4byte 0x020375f0 + 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 Window_FastFillPixels + ldr r5, _081D5DC4 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0xD0 + bl sub_81DB35C + lsls r2, r0, 24 + lsrs r2, 24 + ldr r6, _081D5DC8 + 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, _081D5DCC + mov r9, r1 +_081D5CD6: + lsls r3, r7, 24 + lsrs r3, 24 + ldr r0, _081D5DC8 + str r0, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r0, _081D5DD0 + 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, _081D5DD4 + ldr r1, _081D5DD8 + 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, _081D5DDC + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + 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, _081D5DE0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl decimal_int_to_string + movs r0, 0xA8 + muls r0, r5 + movs r1, 0x64 + bl __udivsi3 + adds r1, r0, 0 + ldr r0, _081D5DE4 + movs r2, 0x2 + movs r3, 0x2 + bl decimal_int_to_string + mov r0, r9 + ldr r1, _081D5DE8 + bl gf_strcpy + ldr r1, _081D5DEC + bl ExpandTextCodes + movs r0, 0x1 + mov r1, r9 + movs r2, 0xD0 + bl sub_81DB368 + lsls r2, r0, 24 + lsrs r2, 24 + lsls r3, r7, 24 + lsrs r3, 24 + ldr r0, _081D5DC8 + 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 Window_WriteStandardTileMap + movs r0, 0 + movs r1, 0x3 + bl Window_CopyToVram + 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 + .align 2, 0 +_081D5DC4: .4byte 0x085ef88a +_081D5DC8: .4byte 0x0862a5f4 +_081D5DCC: .4byte 0x02021fc4 +_081D5DD0: .4byte 0x0862a660 +_081D5DD4: .4byte 0x03005d8c +_081D5DD8: .4byte 0x00003718 +_081D5DDC: .4byte 0x02021cc4 +_081D5DE0: .4byte 0x02021dc4 +_081D5DE4: .4byte 0x02021ec4 +_081D5DE8: .4byte 0x085ef895 +_081D5DEC: .4byte 0x085ef8a3 + 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, _081D5F20 + 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, _081D5F24 + ldr r3, _081D5F28 + ldr r0, _081D5F2C + 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, _081D5F20 + ldr r1, [r0] + movs r2, 0xC7 + lsls r2, 4 + adds r1, r2 + ldr r2, _081D5F30 + mov r0, sp + bl CpuSet + bl sub_81D5520 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r3, _081D5F34 + 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, _081D5F38 + 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, _081D5F3C + 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, _081D5F40 + adds r0, r3 + ldrb r0, [r0] + asrs r0, r1 + movs r1, 0xF + ands r0, r1 + strh r0, [r5, 0xE] + ldr r0, _081D5F44 + str r0, [r5, 0x10] + ldr r0, _081D5F24 + ldr r0, [r0] + ldr r4, _081D5F28 + 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 + .align 2, 0 +_081D5F20: .4byte 0x03005d8c +_081D5F24: .4byte 0x03005d90 +_081D5F28: .4byte 0x00000cb4 +_081D5F2C: .4byte 0x0000ffff +_081D5F30: .4byte 0x05000180 +_081D5F34: .4byte 0x0203cf54 +_081D5F38: .4byte 0x0862a670 +_081D5F3C: .4byte 0x000003c2 +_081D5F40: .4byte 0x000003c3 +_081D5F44: .4byte 0x082c83f0 + 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, _081D5FB0 + 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 + .align 2, 0 +_081D5FB0: .4byte 0x0203cf54 + 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 sub_81D609C + 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, _081D606C + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r1, _081D6070 + 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 + .align 2, 0 +_081D606C: .4byte 0x02037318 +_081D6070: .4byte 0x03005dc0 + thumb_func_end sub_81D5FB4 + + thumb_func_start sub_81D6074 +sub_81D6074: @ 81D6074 + push {lr} + ldr r1, _081D6094 + ldr r2, _081D6098 + 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 + .align 2, 0 +_081D6094: .4byte 0x02037318 +_081D6098: .4byte 0xfffffe61 + thumb_func_end sub_81D6074 + + thumb_func_start sub_81D609C +sub_81D609C: @ 81D609C + push {lr} + ldr r0, _081D60AC + ldrh r2, [r0, 0x12] + ldr r0, _081D60B0 + cmp r2, r0 + bne _081D60B4 + movs r1, 0x1 + b _081D60F8 + .align 2, 0 +_081D60AC: .4byte 0x02037318 +_081D60B0: .4byte 0x0000019f +_081D60B4: + movs r0, 0xD0 + lsls r0, 1 + cmp r2, r0 + bne _081D60C0 + movs r1, 0x2 + b _081D60F8 +_081D60C0: + ldr r0, _081D60CC + cmp r2, r0 + bne _081D60D0 + movs r1, 0x3 + b _081D60F8 + .align 2, 0 +_081D60CC: .4byte 0x000001a1 +_081D60D0: + movs r0, 0xD1 + lsls r0, 1 + cmp r2, r0 + bne _081D60DC + movs r1, 0x4 + b _081D60F8 +_081D60DC: + ldr r0, _081D60E8 + cmp r2, r0 + bne _081D60EC + movs r1, 0x5 + b _081D60F8 + .align 2, 0 +_081D60E8: .4byte 0x000001a3 +_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 sub_81D609C + + thumb_func_start sub_81D6100 +sub_81D6100: @ 81D6100 + push {lr} + ldr r0, _081D6118 + ldrh r1, [r0, 0x12] + ldr r0, _081D611C + movs r2, 0 + cmp r1, r0 + bne _081D6110 + movs r2, 0x1 +_081D6110: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_081D6118: .4byte 0x02037318 +_081D611C: .4byte 0x000001a3 + 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, _081D6148 + ldr r0, [r0, 0x4] + ldr r0, [r0, 0x8] + adds r0, 0x8 + b _081D6176 + .align 2, 0 +_081D6148: .4byte 0x02037318 +_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, _081D617C + 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 + .align 2, 0 +_081D617C: .4byte 0x0862a688 + thumb_func_end sub_81D6134 + + thumb_func_start battle_init +battle_init: @ 81D6180 + lsls r0, 24 + ldr r1, _081D6194 + ldr r1, [r1] + lsrs r0, 23 + adds r1, r0 + ldr r0, _081D6198 + adds r1, r0 + ldrh r0, [r1] + bx lr + .align 2, 0 +_081D6194: .4byte 0x03005d90 +_081D6198: .4byte 0x00000cb2 + thumb_func_end battle_init + + thumb_func_start sub_81D619C +sub_81D619C: @ 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, _081D61DC + 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, _081D61E0 + ldr r1, [r1] + movs r2, 0xEE + lsls r2, 4 + adds r1, r2 + ldr r2, _081D61E4 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ldrb r1, [r1] + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081D61DC: .4byte 0x02037350 +_081D61E0: .4byte 0x03005d90 +_081D61E4: .4byte 0x0832a328 + thumb_func_end sub_81D619C + + 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, _081D6230 + mov r8, r0 + ldr r6, _081D6234 + ldr r1, _081D6238 + mov r12, r1 + adds r5, r6, 0 +_081D6204: + ldr r2, [r5] + lsls r0, r3, 1 + ldr r7, _081D623C + 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 + .align 2, 0 +_081D6230: .4byte 0x02038bca +_081D6234: .4byte 0x03005d90 +_081D6238: .4byte 0x0832a328 +_081D623C: .4byte 0x00000cb4 +_081D6240: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _081D6204 +_081D624A: + ldr r0, _081D6288 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _081D62A2 + movs r3, 0 + ldr r5, _081D628C + ldr r0, _081D6290 + mov r8, r0 +_081D6260: + ldr r2, [r6] + lsls r0, r3, 1 + ldr r7, _081D6294 + 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 + .align 2, 0 +_081D6288: .4byte 0x02022fec +_081D628C: .4byte 0x02038bcc +_081D6290: .4byte 0x0832a328 +_081D6294: .4byte 0x00000cb4 +_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, _081D62B0 + bx lr + .align 2, 0 +_081D62B0: .4byte 0x082c83f0 + thumb_func_end sub_81D62AC + + thumb_func_start sub_81D62B4 +sub_81D62B4: @ 81D62B4 + push {lr} + ldr r0, _081D62C8 + ldrh r1, [r0] + movs r0, 0x5 + bl sub_81D572C + bl sub_80982B8 + pop {r0} + bx r0 + .align 2, 0 +_081D62C8: .4byte 0x020375f2 + 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, _081D6378 + 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, _081D637C + 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, _081D6380 + 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 + .align 2, 0 +_081D6378: .4byte 0x0862a698 +_081D637C: .4byte 0x02024744 +_081D6380: .4byte 0x0203cf54 + thumb_func_end sub_81D62CC + + thumb_func_start sub_81D6384 +sub_81D6384: @ 81D6384 + push {lr} + bl zero_enemy_party_data + ldr r0, _081D6398 + ldrh r0, [r0] + movs r1, 0 + bl sub_81D62CC + pop {r0} + bx r0 + .align 2, 0 +_081D6398: .4byte 0x02038bca + thumb_func_end sub_81D6384 + + thumb_func_start sub_81D639C +sub_81D639C: @ 81D639C + push {lr} + bl zero_enemy_party_data + ldr r0, _081D63BC + ldrh r0, [r0] + movs r1, 0 + bl sub_81D62CC + ldr r0, _081D63C0 + ldrh r0, [r0] + movs r1, 0x3 + bl sub_81D62CC + pop {r0} + bx r0 + .align 2, 0 +_081D63BC: .4byte 0x02038bca +_081D63C0: .4byte 0x02038bcc + 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, _081D6410 + 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, _081D6414 + adds r4, r0 + ldrb r3, [r4] + ldr r1, _081D6418 +_081D6406: + ldrb r0, [r1] + cmp r0, r3 + bne _081D641C + ldrb r0, [r1, 0x1] + b _081D6426 + .align 2, 0 +_081D6410: .4byte 0x0203cf54 +_081D6414: .4byte 0x0831f5ca +_081D6418: .4byte 0x0862a3b4 +_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, _081D6488 + mov r1, sp + ldrb r2, [r1] + lsls r2, 2 + ldr r3, _081D648C + 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 + .align 2, 0 +_081D6488: .4byte 0x0831f72c +_081D648C: .4byte 0x083203cc + thumb_func_end sub_81D642C + + thumb_func_start sub_81D6490 +sub_81D6490: @ 81D6490 + push {r4,lr} + bl sub_81D56B0 + ldr r0, _081D64A8 + ldr r0, [r0] + ldrb r4, [r0, 0x6] + bl sub_81D5710 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_081D64A8: .4byte 0x0203cf54 + thumb_func_end sub_81D6490 + + thumb_func_start sub_81D64AC +sub_81D64AC: @ 81D64AC + ldr r0, _081D64BC + ldr r0, [r0] + movs r1, 0xEE + lsls r1, 4 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + bx lr + .align 2, 0 +_081D64BC: .4byte 0x03005d90 + 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, _081D64D8 + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply +_081D64D4: + pop {r0} + bx r0 + .align 2, 0 +_081D64D8: .4byte 0x0862a5d4 + thumb_func_end sub_81D64C0 + + thumb_func_start sub_81D64DC +sub_81D64DC: @ 81D64DC + ldr r1, _081D64F0 + ldr r0, _081D64F4 + ldr r0, [r0] + ldr r2, _081D64F8 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + bx lr + .align 2, 0 +_081D64F0: .4byte 0x020375f0 +_081D64F4: .4byte 0x03005d90 +_081D64F8: .4byte 0x00000ef9 + thumb_func_end sub_81D64DC + + thumb_func_start sub_81D64FC +sub_81D64FC: @ 81D64FC + ldr r0, _081D6510 + ldr r1, [r0] + ldr r0, _081D6514 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x80 + orrs r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_081D6510: .4byte 0x03005d90 +_081D6514: .4byte 0x00000ef9 + thumb_func_end sub_81D64FC + + thumb_func_start sub_81D6518 +sub_81D6518: @ 81D6518 + ldr r0, _081D652C + ldr r1, [r0] + ldr r0, _081D6530 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + bx lr + .align 2, 0 +_081D652C: .4byte 0x03005d90 +_081D6530: .4byte 0x00000ef9 + 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 sub_81D609C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _081D6560 + bl sub_81D5C00 + ldr r0, _081D655C + ldrh r0, [r0] + cmp r0, 0 + beq _081D6560 + movs r0, 0x1 + b _081D6562 + .align 2, 0 +_081D655C: .4byte 0x020375f0 +_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, _081D6584 + ldr r0, [r0] + ldr r1, _081D6588 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081D6590 + ldr r1, _081D658C + movs r0, 0 + b _081D6594 + .align 2, 0 +_081D6584: .4byte 0x03005d8c +_081D6588: .4byte 0x00003d6e +_081D658C: .4byte 0x020375f0 +_081D6590: + ldr r1, _081D659C + movs r0, 0x1 +_081D6594: + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_081D659C: .4byte 0x020375f0 + thumb_func_end sub_81D6568 + + thumb_func_start sub_81D65A0 +sub_81D65A0: @ 81D65A0 + push {r4,r5,lr} + ldr r4, _081D65D4 + ldr r2, [r4] + ldr r5, _081D65D8 + ldr r0, _081D65DC + 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, _081D65E0 + adds r2, r1, r3 + ldrh r0, [r5] + lsls r0, 2 + ldr r3, _081D65E4 + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D65D4: .4byte 0x03005d8c +_081D65D8: .4byte 0x020375e2 +_081D65DC: .4byte 0x00003d6e +_081D65E0: .4byte 0x00003d68 +_081D65E4: .4byte 0x00003718 + 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, _081D663C + 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 + .align 2, 0 +_081D663C: .4byte 0x0203cf54 + 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, _081D6698 + 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, _081D669C + bl flag_check + lsls r0, 24 + cmp r0, 0 + beq _081D66A0 + ldr r0, _081D6698 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x8 + bne _081D66A0 + movs r0, 0x1 + b _081D66A2 + .align 2, 0 +_081D6698: .4byte 0x0203cf54 +_081D669C: .4byte 0x00000864 +_081D66A0: + movs r0, 0 +_081D66A2: + bl sub_81D65E8 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, _081D6710 + ldr r5, [r0] + ldr r1, _081D6714 + 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, _081D6718 + lsls r0, r4, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] + ldr r1, _081D671C + 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 + .align 2, 0 +_081D6710: .4byte 0x03005d8c +_081D6714: .4byte 0x00003d6e +_081D6718: .4byte 0x0862a5cc +_081D671C: .4byte 0x00003d64 + 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, _081D6760 + ldr r0, _081D6764 + bl malloc_and_clear + str r0, [r6] + ldr r1, _081D6768 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + mov r1, r8 + str r1, [r0] + ldr r1, _081D676C + adds r0, r1 + strb r5, [r0] + ldr r0, _081D6770 + bl set_callback2 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D6760: .4byte 0x0203cf60 +_081D6764: .4byte 0x00002018 +_081D6768: .4byte 0x00002006 +_081D676C: .4byte 0x00002007 +_081D6770: .4byte sub_81D6774 + 1 + thumb_func_end sub_81D6720 + + thumb_func_start sub_81D6774 +sub_81D6774: @ 81D6774 + push {lr} + bl vblank_hblank_handler_set_zero + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl gpu_pal_allocator_reset + bl sub_80A1A74 + bl reset_all_obj_data + bl clear_tasks + movs r0, 0 + movs r1, 0xF0 + movs r2, 0x20 + bl rboxid_80040B8 + ldr r1, _081D67C0 + ldr r0, _081D67C4 + ldr r0, [r0] + ldr r2, _081D67C8 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl AddTask + ldr r0, _081D67CC + bl set_callback2 + pop {r0} + bx r0 + .align 2, 0 +_081D67C0: .4byte 0x0862a6a0 +_081D67C4: .4byte 0x0203cf60 +_081D67C8: .4byte 0x00002006 +_081D67CC: .4byte sub_81D67D0 + 1 + thumb_func_end sub_81D6774 + + thumb_func_start sub_81D67D0 +sub_81D67D0: @ 81D67D0 + push {lr} + bl run_active_tasks + bl call_obj_callbacks + bl obj_sync_something + 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 copy_super_sprites_to_oam + bl copy_queue_process + 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, _081D6838 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D6830 + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r4, _081D683C + ldr r0, [r4] + ldr r0, [r0] + bl set_callback2 + ldr r0, [r4] + bl free + adds r0, r5, 0 + bl remove_task +_081D6830: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D6838: .4byte 0x02037fd4 +_081D683C: .4byte 0x0203cf60 + 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, _081D6874 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081D68B2 + ldr r2, _081D6878 + ldr r1, [r2] + ldr r4, _081D687C + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081D6888 + ldr r0, _081D6880 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldr r0, _081D6884 + b _081D68B0 + .align 2, 0 +_081D6874: .4byte 0x02037fd4 +_081D6878: .4byte 0x0203cf60 +_081D687C: .4byte 0x00002007 +_081D6880: .4byte 0x03005e00 +_081D6884: .4byte sub_81D6800 + 1 +_081D6888: + ldr r4, _081D68B8 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, [r2] + ldr r1, _081D68BC + adds r0, r2, r1 + strh r5, [r0] + ldr r0, _081D68C0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r3, _081D68C4 + 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 + .align 2, 0 +_081D68B8: .4byte 0x00002006 +_081D68BC: .4byte 0x00002004 +_081D68C0: .4byte 0x03005e00 +_081D68C4: .4byte 0x0862a6a0 + thumb_func_end sub_81D6840 + + thumb_func_start sub_81D68C8 +sub_81D68C8: @ 81D68C8 + push {lr} + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0 + bl lcd_io_set + movs r0, 0x40 + movs r1, 0xF0 + bl lcd_io_set + ldr r1, _081D68F8 + movs r0, 0x44 + bl lcd_io_set + ldr r0, _081D68FC + movs r1, 0 + strh r1, [r0] + ldr r0, _081D6900 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_081D68F8: .4byte 0x00001888 +_081D68FC: .4byte 0x02037714 +_081D6900: .4byte 0x02037b14 + thumb_func_end sub_81D68C8 + + thumb_func_start sub_81D6904 +sub_81D6904: @ 81D6904 + push {lr} + movs r0, 0x48 + movs r1, 0x3F + bl lcd_io_set + movs r0, 0x4A + movs r1, 0x3F + bl lcd_io_set + 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, _081D694C + adds r5, r0, r1 + bl sub_81D750C + ldr r0, _081D6950 + 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 + .align 2, 0 +_081D694C: .4byte 0x03005e08 +_081D6950: .4byte 0x02037fd4 +_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, _081D6A0C + mov r8, r0 + movs r1, 0x58 + movs r2, 0x48 + movs r3, 0x3 + bl obj_add_from_template_forward_search + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _081D6A10 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, _081D6A14 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r0, _081D6A18 + movs r1, 0x4B + movs r2, 0x65 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + ldr r0, _081D6A1C + movs r1, 0x6D + movs r2, 0x72 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081D6A0C: .4byte 0x0862a72c +_081D6A10: .4byte 0x02020630 +_081D6A14: .4byte sub_81D6A20 + 1 +_081D6A18: .4byte 0x0862a750 +_081D6A1C: .4byte 0x0862a774 + 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, _081D6A98 + 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 + .align 2, 0 +_081D6A98: .4byte 0x02020630 +_081D6A9C: + cmp r3, 0x2 + beq _081D6B24 + cmp r3, 0x3 + beq _081D6AE4 + b _081D6B68 +_081D6AA6: + ldr r2, _081D6AE0 + 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 + .align 2, 0 +_081D6AE0: .4byte 0x02020630 +_081D6AE4: + ldr r2, _081D6B1C + 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, _081D6B20 + 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 + .align 2, 0 +_081D6B1C: .4byte 0x02020630 +_081D6B20: .4byte 0x0000ffff +_081D6B24: + ldr r2, _081D6B70 + 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, _081D6B74 + 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, _081D6B78 +_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 + .align 2, 0 +_081D6B70: .4byte 0x02020630 +_081D6B74: .4byte 0x0000ffff +_081D6B78: .4byte 0x0000fffe + thumb_func_end sub_81D6A20 + + thumb_func_start sub_81D6B7C +sub_81D6B7C: @ 81D6B7C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, _081D6D0C + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x60 + movs r3, 0x1 + bl obj_add_from_template_forward_search + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, _081D6D10 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, _081D6D14 + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x70 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x80 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x68 + movs r2, 0x80 + movs r3, 0x2 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x6] + adds r0, r5, 0 + movs r1, 0xB8 + movs r2, 0x80 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, _081D6D18 + movs r1, 0xD0 + movs r2, 0x84 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x8] + ldr r0, _081D6D1C + movs r1, 0xC8 + movs r2, 0x78 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl obj_anim_image_start + 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 obj_anim_image_start + ldrb r1, [r4, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl obj_anim_image_start + 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 obj_anim_image_start + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl obj_anim_image_start + 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 obj_anim_image_start + ldrb r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x8 + bl obj_anim_image_start + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081D6D0C: .4byte 0x0862a81c +_081D6D10: .4byte 0x02020630 +_081D6D14: .4byte sub_81D6D20 + 1 +_081D6D18: .4byte 0x0862a84c +_081D6D1C: .4byte 0x0862a864 + 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, _081D6E30 + 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 + .align 2, 0 +_081D6E30: .4byte 0x02020630 +_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 gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081D705C + movs r0, 0 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _081D7060 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D7064 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D7068 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + 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 lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D705C: .4byte 0x0862a888 +_081D7060: .4byte 0x0203cf60 +_081D7064: .4byte 0x00000804 +_081D7068: .4byte 0x00001004 + 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, _081D70F4 + 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, _081D70F8 + ldr r4, _081D70FC + ldr r1, [r4] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r0, _081D7100 + ldr r1, [r4] + ldr r2, _081D7104 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D7108 + ldr r1, [r4] + ldr r2, _081D710C + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D7110 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + ldr r0, _081D7114 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D7118 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D711C + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D7120 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D7124 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D7128 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D712C + bl gpu_pal_obj_decompress_and_apply + ldr r0, _081D7130 + bl gpu_pal_obj_decompress_and_apply + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D70F4: .4byte 0x08da33c0 +_081D70F8: .4byte 0x08da3988 +_081D70FC: .4byte 0x0203cf60 +_081D7100: .4byte 0x08da3824 +_081D7104: .4byte 0x00000804 +_081D7108: .4byte 0x08da3a88 +_081D710C: .4byte 0x00001004 +_081D7110: .4byte 0x08da37e8 +_081D7114: .4byte 0x0862a8c4 +_081D7118: .4byte 0x0862a8f8 +_081D711C: .4byte 0x0862a924 +_081D7120: .4byte 0x0862a9d4 +_081D7124: .4byte 0x0862aa14 +_081D7128: .4byte 0x0862aa34 +_081D712C: .4byte 0x0862a8cc +_081D7130: .4byte 0x0862a9dc + 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, _081D71AC + adds r5, r6, r7 + bl dp12_8087EA4 + bl sub_81D6FE0 + bl sub_81D706C + movs r4, 0 + str r4, [sp, 0x4] + ldr r1, _081D71B0 + ldr r2, _081D71B4 + add r0, sp, 0x4 + bl CpuFastSet + ldr r2, _081D71B8 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + strh r4, [r5] + ldr r0, _081D71BC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + ldr r0, _081D71C0 + ldr r0, [r0] + ldr r1, _081D71C4 + 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, _081D71C8 + str r1, [r0] + b _081D71EE + .align 2, 0 +_081D71AC: .4byte 0x03005e08 +_081D71B0: .4byte 0x02038c28 +_081D71B4: .4byte 0x010003c0 +_081D71B8: .4byte 0x0862a87c +_081D71BC: .4byte sub_81D7228 + 1 +_081D71C0: .4byte 0x0203cf60 +_081D71C4: .4byte 0x00002006 +_081D71C8: .4byte sub_81D691C + 1 +_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, _081D7220 + 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 sub_80A1AD4 + ldr r0, _081D7224 + bl SetVBlankCallback + movs r0, 0x53 + bl audio_play + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D7220: .4byte sub_81D736C + 1 +_081D7224: .4byte sub_81D6FD0 + 1 + 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, _081D7260 + adds r3, r1, r0 + movs r1, 0x18 + ldr r7, _081D7264 + ldr r4, _081D7268 + 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 + .align 2, 0 +_081D7260: .4byte 0x03005e08 +_081D7264: .4byte 0x0203cf60 +_081D7268: .4byte 0x02038c28 +_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, _081D7320 + 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 + .align 2, 0 +_081D7320: .4byte 0x00002006 +_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, _081D73A4 + adds r4, r0, r7 + bl sub_81D750C + ldr r0, _081D73A8 + 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 + .align 2, 0 +_081D73A4: .4byte 0x03005e08 +_081D73A8: .4byte 0x02037fd4 +_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 lcd_io_set + 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, _081D7434 + 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 + .align 2, 0 +_081D7434: .4byte sub_81D752C + 1 + 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, _081D7474 + ldr r1, _081D7478 + 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, _081D747C + 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 + .align 2, 0 +_081D7474: .4byte 0x00007fff +_081D7478: .4byte 0x0000ffff +_081D747C: .4byte 0xffff0000 + 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, _081D74BC + ldr r1, _081D74C0 + 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, _081D74C4 + 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 + .align 2, 0 +_081D74BC: .4byte 0x00007fff +_081D74C0: .4byte 0x0000ffff +_081D74C4: .4byte 0xffff0000 + thumb_func_end sub_81D7480 + + thumb_func_start sub_81D74C8 +sub_81D74C8: @ 81D74C8 + push {r4,lr} + sub sp, 0xC + ldr r0, _081D7500 + ldr r1, _081D7504 + 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, _081D7508 + 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 + .align 2, 0 +_081D7500: .4byte 0x00007fff +_081D7504: .4byte 0x0000ffff +_081D7508: .4byte 0xffff0000 + 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 bg_change_x_offset + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x2 + bl bg_change_y_offset + 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, _081D75AC + adds r5, r1, r0 + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081D75B0 + 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 bg_get_y_offset + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl bg_get_y_offset + 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 bg_change_y_offset +_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 lcd_io_set +_081D75A6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D75AC: .4byte 0x03005e08 +_081D75B0: .4byte 0x02020630 + 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 sub_80A1AD4 + ldr r1, _081D75F8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, _081D75FC + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D75F8: .4byte 0x03005e00 +_081D75FC: .4byte sub_81D7600 + 1 + 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, _081D7658 + adds r5, r6, r7 + bl sub_81D750C + ldr r0, _081D765C + 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 bg_change_y_offset + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl reset_all_obj_data + bl gpu_pal_allocator_reset + strh r4, [r5] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, _081D7660 + str r1, [r0] +_081D7652: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D7658: .4byte 0x03005e08 +_081D765C: .4byte 0x02037fd4 +_081D7660: .4byte sub_81D6840 + 1 + thumb_func_end sub_81D7600 + + thumb_func_start sub_81D7664 +sub_81D7664: @ 81D7664 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _081D76EC + mov r8, r0 + movs r1, 0x62 + movs r2, 0x48 + movs r3, 0x3 + bl obj_add_from_template_forward_search + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _081D76F0 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, _081D76F4 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r0, _081D76F8 + movs r1, 0x55 + movs r2, 0x65 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + ldr r0, _081D76FC + movs r1, 0x77 + movs r2, 0x72 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081D76EC: .4byte 0x0862a8d4 +_081D76F0: .4byte 0x02020630 +_081D76F4: .4byte sub_81D7700 + 1 +_081D76F8: .4byte 0x0862a900 +_081D76FC: .4byte 0x0862a92c + 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, _081D777C + 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 + .align 2, 0 +_081D777C: .4byte 0x02020630 +_081D7780: + cmp r3, 0x2 + beq _081D7808 + cmp r3, 0x3 + beq _081D77C8 + b _081D784C +_081D778A: + ldr r2, _081D77C4 + 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 + .align 2, 0 +_081D77C4: .4byte 0x02020630 +_081D77C8: + ldr r2, _081D7800 + 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, _081D7804 + 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 + .align 2, 0 +_081D7800: .4byte 0x02020630 +_081D7804: .4byte 0x0000ffff +_081D7808: + ldr r2, _081D7854 + 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, _081D7858 + 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, _081D785C +_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 + .align 2, 0 +_081D7854: .4byte 0x02020630 +_081D7858: .4byte 0x0000ffff +_081D785C: .4byte 0x0000fffe + 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, _081D78B8 + 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 + .align 2, 0 +_081D78B8: .4byte 0x02020630 + thumb_func_end sub_81D7860 + + thumb_func_start sub_81D78BC +sub_81D78BC: @ 81D78BC + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, _081D7A4C + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x60 + movs r3, 0x1 + bl obj_add_from_template_forward_search + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, _081D7A50 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, _081D7A54 + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x70 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x80 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x5E + movs r2, 0x80 + movs r3, 0x2 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x6] + adds r0, r5, 0 + movs r1, 0xAE + movs r2, 0x80 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, _081D7A58 + movs r1, 0xC6 + movs r2, 0x84 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 8 + strh r0, [r4, 0x8] + ldr r0, _081D7A5C + movs r1, 0xBE + movs r2, 0x78 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl obj_anim_image_start + 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 obj_anim_image_start + ldrb r1, [r4, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl obj_anim_image_start + 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 obj_anim_image_start + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl obj_anim_image_start + 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 obj_anim_image_start + ldrb r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x8 + bl obj_anim_image_start + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_081D7A4C: .4byte 0x0862a9e4 +_081D7A50: .4byte 0x02020630 +_081D7A54: .4byte sub_81D7A60 + 1 +_081D7A58: .4byte 0x0862aa1c +_081D7A5C: .4byte 0x0862aa3c + 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, _081D7B74 + 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 + .align 2, 0 +_081D7B74: .4byte 0x02020630 +_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, _081D7E0C + 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 + .align 2, 0 +_081D7E0C: .4byte 0x02020630 + thumb_func_end sub_81D7D14 + + thumb_func_start sub_81D7E10 +sub_81D7E10: @ 81D7E10 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081D7E8C + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _081D7E90 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D7E94 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D7E98 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + 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 lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D7E8C: .4byte 0x0862aa54 +_081D7E90: .4byte 0x0203cf60 +_081D7E94: .4byte 0x00000804 +_081D7E98: .4byte 0x00001004 + 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, _081D7F1C + 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, _081D7F20 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _081D7F24 + 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, _081D7F28 + ldr r4, _081D7F2C + ldr r1, [r4] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r0, _081D7F30 + ldr r1, [r4] + ldr r2, _081D7F34 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D7F38 + ldr r1, [r4] + ldr r2, _081D7F3C + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D7F40 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + ldr r0, _081D7F44 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D7F48 + bl gpu_pal_obj_decompress_and_apply + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D7F1C: .4byte 0x08da33c0 +_081D7F20: .4byte 0x08da4f70 +_081D7F24: .4byte 0x08da3c94 +_081D7F28: .4byte 0x08da3988 +_081D7F2C: .4byte 0x0203cf60 +_081D7F30: .4byte 0x08da60b8 +_081D7F34: .4byte 0x00000804 +_081D7F38: .4byte 0x08da4dec +_081D7F3C: .4byte 0x00001004 +_081D7F40: .4byte 0x08da4da8 +_081D7F44: .4byte 0x0862aa90 +_081D7F48: .4byte 0x0862aa98 + 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, _081D7FAC + 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 lcd_io_set + ldr r1, _081D7FB0 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _081D7FB4 + bl SetVBlankCallback + ldr r0, _081D7FB8 + movs r1, 0 + bl AddTask + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + subs r5, 0x8 + adds r4, r5 + ldr r0, _081D7FBC + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D7FAC: .4byte 0x03005e08 +_081D7FB0: .4byte 0x00000808 +_081D7FB4: .4byte sub_81D67EC + 1 +_081D7FB8: .4byte sub_81D81A4 + 1 +_081D7FBC: .4byte sub_81D7FC0 + 1 + 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, _081D7FE4 + 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 + .align 2, 0 +_081D7FE4: .4byte 0x03005e08 +_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 sub_80A1AD4 + 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 call_gpu_bg_affine_set + 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 call_gpu_bg_affine_set + 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, _081D8120 + 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 sub_80A1AD4 + b _081D815A + .align 2, 0 +_081D8120: .4byte 0x00000127 +_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 call_gpu_bg_affine_set + 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, _081D8198 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D8192 + movs r0, 0 + bl SetVBlankCallback + bl reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _081D819C + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081D81A0 + str r0, [r1] +_081D8192: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D8198: .4byte 0x02037fd4 +_081D819C: .4byte 0x03005e00 +_081D81A0: .4byte sub_81D6840 + 1 + 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, _081D8240 + adds r4, r0, r1 + ldrh r1, [r4, 0x2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D8254 + ldr r0, _081D8244 + ldr r3, _081D8248 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081D824C + 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 + .align 2, 0 +_081D8240: .4byte 0x03005e08 +_081D8244: .4byte 0x0862aaa0 +_081D8248: .4byte 0x0862aab8 +_081D824C: .4byte 0x02020630 +_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, _081D82AC + 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 + .align 2, 0 +_081D82AC: .4byte 0x0862aab8 + thumb_func_end sub_81D8260 + + thumb_func_start sub_81D82B0 +sub_81D82B0: @ 81D82B0 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081D8344 + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _081D8348 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D834C + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D8350 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D8354 + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + 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 lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D8344: .4byte 0x0862aacc +_081D8348: .4byte 0x0203cf60 +_081D834C: .4byte 0x00000804 +_081D8350: .4byte 0x00001004 +_081D8354: .4byte 0x00001804 + 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, _081D8404 + 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, _081D8408 + 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, _081D840C + ldr r5, _081D8410 + ldr r1, [r5] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r0, _081D8414 + ldr r1, [r5] + ldr r4, _081D8418 + adds r1, r4 + bl call_LZZUnCompWram + str r6, [sp, 0x4] + ldr r1, [r5] + ldr r0, _081D841C + adds r1, r0 + ldr r2, _081D8420 + add r0, sp, 0x4 + bl CpuFastSet + ldr r1, [r5] + adds r4, r1, r4 + ldr r0, _081D8424 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r4, 0 + bl CpuFastSet + str r6, [sp, 0x8] + ldr r1, [r5] + ldr r0, _081D8428 + adds r1, r0 + ldr r2, _081D842C + adds r0, r7, 0 + bl CpuFastSet + ldr r0, _081D8430 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + ldr r0, _081D8434 + ldr r1, _081D8438 + strh r1, [r0] + ldr r0, _081D843C + strh r1, [r0] + ldr r0, _081D8440 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8444 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8448 + bl gpu_pal_obj_decompress_and_apply + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D8404: .4byte 0x08da7528 +_081D8408: .4byte 0x08da69bc +_081D840C: .4byte 0x08da7aac +_081D8410: .4byte 0x0203cf60 +_081D8414: .4byte 0x08da7784 +_081D8418: .4byte 0x00001804 +_081D841C: .4byte 0x00001004 +_081D8420: .4byte 0x01000200 +_081D8424: .4byte 0x00000804 +_081D8428: .4byte 0x00000904 +_081D842C: .4byte 0x010000d0 +_081D8430: .4byte 0x08da7744 +_081D8434: .4byte 0x02037714 +_081D8438: .4byte 0x00007fff +_081D843C: .4byte 0x02037b14 +_081D8440: .4byte 0x0862aafc +_081D8444: .4byte 0x0862ab04 +_081D8448: .4byte 0x0862ab0c + thumb_func_end sub_81D8358 + + thumb_func_start sub_81D844C +sub_81D844C: @ 81D844C + push {r4,r5,lr} + movs r0, 0x6 + bl lcd_io_get + 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, _081D847C + ldr r0, [r0] + ldr r3, _081D8480 + adds r0, r3 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bgt _081D848C + ldr r1, _081D8484 + ldr r3, _081D8488 + b _081D8492 + .align 2, 0 +_081D847C: .4byte 0x0203cf60 +_081D8480: .4byte 0x00002008 +_081D8484: .4byte 0x04000052 +_081D8488: .4byte 0x00000d08 +_081D848C: + ldr r1, _081D84B8 + movs r3, 0x80 + lsls r3, 5 +_081D8492: + adds r0, r3, 0 + strh r0, [r1] + cmp r2, 0 + bne _081D84E0 + ldr r0, _081D84BC + ldr r1, [r0] + ldr r2, _081D84C0 + adds r3, r1, r2 + ldrh r4, [r3] + movs r1, 0 + ldrsh r2, [r3, r1] + ldr r1, _081D84C4 + adds r5, r0, 0 + cmp r2, r1 + bgt _081D84D4 + cmp r2, 0x27 + bgt _081D84C8 + adds r0, r4, 0x4 + b _081D84D2 + .align 2, 0 +_081D84B8: .4byte 0x04000052 +_081D84BC: .4byte 0x0203cf60 +_081D84C0: .4byte 0x00002008 +_081D84C4: .4byte 0x00001fff +_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, _081D84E8 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081D84E0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D84E8: .4byte 0x0000200a + 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, _081D8560 + adds r5, r4, r6 + bl sub_81D82B0 + bl sub_81D8358 + ldr r1, _081D8564 + movs r0, 0x50 + bl lcd_io_set_bits + movs r0, 0x80 + lsls r0, 5 + mov r8, r0 + movs r0, 0x52 + mov r1, r8 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _081D8568 + bl SetVBlankCallback + ldr r0, _081D856C + ldr r0, [r0] + ldr r1, _081D8570 + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2] + ldr r2, _081D8574 + 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, _081D8578 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D8560: .4byte 0x03005e08 +_081D8564: .4byte 0x00001e41 +_081D8568: .4byte sub_81D67EC + 1 +_081D856C: .4byte 0x0203cf60 +_081D8570: .4byte 0x00002008 +_081D8574: .4byte 0x0000200a +_081D8578: .4byte sub_81D857C + 1 + 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, _081D85A0 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bhi _081D8674 + lsls r0, 2 + ldr r1, _081D85A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D85A0: .4byte 0x03005e08 +_081D85A4: .4byte _081D85A8 + .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 sub_80A1AD4 + strh r4, [r5, 0x2] + b _081D864E +_081D85DC: + ldr r0, _081D860C + 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, _081D8610 + bl SetHBlankCallback + movs r0, 0x3 + bl enable_irqs + b _081D8674 + .align 2, 0 +_081D860C: .4byte 0x02037fd4 +_081D8610: .4byte sub_81D844C + 1 +_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 sub_80A1AD4 + ldr r1, _081D867C + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, _081D8680 + str r1, [r0] +_081D8674: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D867C: .4byte 0x03005e00 +_081D8680: .4byte sub_81D8684 + 1 + 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, _081D86C0 + 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 reset_all_obj_data + bl gpu_pal_allocator_reset + ldr r0, _081D86C4 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, _081D86C8 + str r0, [r1] +_081D86B8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D86C0: .4byte 0x02037fd4 +_081D86C4: .4byte 0x03005e00 +_081D86C8: .4byte sub_81D6840 + 1 + thumb_func_end sub_81D8684 + + thumb_func_start sub_81D86CC +sub_81D86CC: @ 81D86CC + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _081D873C + movs r1, 0xA0 + movs r2, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 4 + adds r5, r6 + lsls r5, 2 + ldr r4, _081D8740 + adds r0, r5, r4 + mov r8, r0 + ldr r0, _081D8744 + movs r2, 0x30 + negs r2, r2 + movs r1, 0xB8 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _081D8748 + 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 + .align 2, 0 +_081D873C: .4byte 0x0862ab14 +_081D8740: .4byte 0x0202065e +_081D8744: .4byte 0x0862ab2c +_081D8748: .4byte sub_81D874C + 1 + 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, _081D8824 + 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, _081D8824 + 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 + .align 2, 0 +_081D8824: .4byte 0x02020630 + thumb_func_end sub_81D874C + + thumb_func_start sub_81D8828 +sub_81D8828: @ 81D8828 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081D88BC + movs r0, 0 + movs r2, 0x4 + bl bg_vram_setup + ldr r4, _081D88C0 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D88C4 + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D88C8 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D88CC + adds r1, r0 + movs r0, 0x3 + bl bg_set_tilemap + 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 lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x3 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D88BC: .4byte 0x0862ab44 +_081D88C0: .4byte 0x0203cf60 +_081D88C4: .4byte 0x00000804 +_081D88C8: .4byte 0x00001004 +_081D88CC: .4byte 0x00001804 + 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, _081D8950 + 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, _081D8954 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, _081D8958 + 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, _081D895C + ldr r4, _081D8960 + ldr r1, [r4] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r0, _081D8964 + ldr r1, [r4] + ldr r2, _081D8968 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D896C + ldr r1, [r4] + ldr r2, _081D8970 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D8974 + ldr r1, [r4] + ldr r2, _081D8978 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D897C + movs r1, 0 + movs r2, 0x80 + bl decompress_palette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D8950: .4byte 0x08da80bc +_081D8954: .4byte 0x08da7eac +_081D8958: .4byte 0x08da7c30 +_081D895C: .4byte 0x08da8d6c +_081D8960: .4byte 0x0203cf60 +_081D8964: .4byte 0x08da8b40 +_081D8968: .4byte 0x00000804 +_081D896C: .4byte 0x08da7fb4 +_081D8970: .4byte 0x00001004 +_081D8974: .4byte 0x08da7d6c +_081D8978: .4byte 0x00001804 +_081D897C: .4byte 0x08da8e84 + 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, _081D89D0 + 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, _081D89D4 + bl SetVBlankCallback + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + ldr r0, _081D89D8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x4] + subs r5, 0x8 + adds r4, r5 + ldr r0, _081D89DC + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D89D0: .4byte 0x03005e08 +_081D89D4: .4byte sub_81D67EC + 1 +_081D89D8: .4byte sub_81D8AD8 + 1 +_081D89DC: .4byte sub_81D89E0 + 1 + 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, _081D8A30 + 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 + .align 2, 0 +_081D8A30: .4byte 0x03005e08 +_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 sub_80A1AD4 + 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, _081D8A84 + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, _081D8A88 + b _081D8AC4 + .align 2, 0 +_081D8A84: .4byte 0x03005e00 +_081D8A88: .4byte sub_81D8B2C + 1 +_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 sub_80A1AD4 + ldr r1, _081D8AD0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, _081D8AD4 +_081D8AC4: + str r1, [r0] +_081D8AC6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D8AD0: .4byte 0x03005e00 +_081D8AD4: .4byte sub_81D8BEC + 1 + 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, _081D8B28 + 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 bg_change_x_offset + bl GenerateRandomNumber + ands r4, r0 + subs r4, 0x4 + lsls r4, 8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl bg_change_y_offset +_081D8B1C: + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D8B28: .4byte 0x03005e08 + 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, _081D8B6C + 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 bg_change_x_offset + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + 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 + .align 2, 0 +_081D8B6C: .4byte 0x03005e08 +_081D8B70: + cmp r0, 0x1 + bne _081D8BAC + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r1, 8 + movs r0, 0x1 + movs r2, 0x2 + bl bg_change_x_offset + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r1, 8 + movs r0, 0x1 + movs r2, 0x1 + bl bg_change_y_offset + 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 bg_change_x_offset + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + movs r4, 0x80 + lsls r4, 4 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl bg_change_x_offset + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl bg_change_y_offset + 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, _081D8C2C + adds r4, r5, r6 + bl sub_81D8BB4 + ldr r0, _081D8C30 + 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, _081D8C34 + str r1, [r0] +_081D8C26: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D8C2C: .4byte 0x03005e08 +_081D8C30: .4byte 0x02037fd4 +_081D8C34: .4byte sub_81D6840 + 1 + thumb_func_end sub_81D8BEC + + thumb_func_start sub_81D8C38 +sub_81D8C38: @ 81D8C38 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl gpu_reset_bgs_and_dma3_busy_flags + ldr r1, _081D8CB4 + movs r0, 0x1 + movs r2, 0x3 + bl bg_vram_setup + ldr r4, _081D8CB8 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D8CBC + adds r1, r0 + movs r0, 0x1 + bl bg_set_tilemap + ldr r1, [r4] + ldr r0, _081D8CC0 + adds r1, r0 + movs r0, 0x2 + bl bg_set_tilemap + 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 lcd_io_set + movs r0, 0 + bl gpu_sync_bg_show + movs r0, 0x1 + bl gpu_sync_bg_show + movs r0, 0x2 + bl gpu_sync_bg_show + movs r0, 0x50 + movs r1, 0 + bl lcd_io_set + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D8CB4: .4byte 0x0862ad08 +_081D8CB8: .4byte 0x0203cf60 +_081D8CBC: .4byte 0x00000804 +_081D8CC0: .4byte 0x00001004 + 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, _081D8D68 + 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, _081D8D6C + 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, _081D8D70 + ldr r4, _081D8D74 + ldr r1, [r4] + ldr r2, _081D8D78 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D8D7C + ldr r1, [r4] + adds r1, 0x4 + bl call_LZZUnCompWram + ldr r0, _081D8D80 + ldr r1, [r4] + ldr r2, _081D8D84 + adds r1, r2 + bl call_LZZUnCompWram + ldr r0, _081D8D88 + movs r1, 0 + movs r2, 0x60 + bl decompress_palette + ldr r0, _081D8D8C + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8D90 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8D94 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8D98 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8D9C + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8DA0 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081D8DA4 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _081D8DA8 + bl gpu_pal_obj_decompress_and_apply + ldr r0, _081D8DAC + bl gpu_pal_obj_decompress_and_apply + ldr r0, _081D8DB0 + bl gpu_pal_obj_decompress_and_apply + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081D8D68: .4byte 0x08daab24 +_081D8D6C: .4byte 0x08daa8b4 +_081D8D70: .4byte 0x08daae54 +_081D8D74: .4byte 0x0203cf60 +_081D8D78: .4byte 0x00000804 +_081D8D7C: .4byte 0x08daac1c +_081D8D80: .4byte 0x08daaf98 +_081D8D84: .4byte 0x00001004 +_081D8D88: .4byte 0x08daafec +_081D8D8C: .4byte 0x0862ac28 +_081D8D90: .4byte 0x0862ac30 +_081D8D94: .4byte 0x0862ac38 +_081D8D98: .4byte 0x0862ac40 +_081D8D9C: .4byte 0x0862ac48 +_081D8DA0: .4byte 0x0862ac50 +_081D8DA4: .4byte 0x0862ac58 +_081D8DA8: .4byte 0x0862ac60 +_081D8DAC: .4byte 0x0862ac68 +_081D8DB0: .4byte 0x0862ac70 + 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, _081D8E68 + adds r6, r4, r5 + bl sub_81D8C38 + bl sub_81D8CC4 + bl sub_81D68C8 + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_clear_bits + ldr r1, _081D8E6C + movs r0, 0x50 + bl lcd_io_set + ldr r1, _081D8E70 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, _081D8E74 + bl SetVBlankCallback + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + subs r5, 0x8 + adds r4, r5 + ldr r0, _081D8E78 + str r0, [r4] + ldr r0, _081D8E7C + 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 + .align 2, 0 +_081D8E68: .4byte 0x03005e08 +_081D8E6C: .4byte 0x00000241 +_081D8E70: .4byte 0x00000e09 +_081D8E74: .4byte sub_81D67EC + 1 +_081D8E78: .4byte sub_81D8E80 + 1 +_081D8E7C: .4byte sub_81D8FB0 + 1 + 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, _081D8EAC + 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 + .align 2, 0 +_081D8EAC: .4byte 0x03005e08 +_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 sub_80A1AD4 + strh r5, [r4, 0x2] + b _081D8F30 +_081D8EDE: + ldr r2, _081D8F10 + 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, _081D8F14 + 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 + .align 2, 0 +_081D8F10: .4byte 0x02020630 +_081D8F14: .4byte sub_81D97E0 + 1 +_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, _081D8F78 + ldr r1, _081D8F7C + 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, _081D8F80 + 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 + .align 2, 0 +_081D8F78: .4byte 0x0000fffe +_081D8F7C: .4byte 0x0000ffff +_081D8F80: .4byte 0xffff0000 +_081D8F84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl sub_80A1AD4 + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, _081D8FAC + str r1, [r0] +_081D8FA0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081D8FAC: .4byte sub_81D9034 + 1 + 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, _081D9030 + 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 lcd_io_set + 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 + .align 2, 0 +_081D9030: .4byte 0x03005e08 + 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, _081D9090 + adds r4, r6, r7 + ldr r0, _081D9094 + 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 reset_all_obj_data + bl gpu_pal_allocator_reset + 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, _081D9098 + str r1, [r0] + b _081D90A0 + .align 2, 0 +_081D9090: .4byte 0x03005e08 +_081D9094: .4byte 0x02037fd4 +_081D9098: .4byte sub_81D6840 + 1 +_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, _081D9258 + adds r4, r0 + ldr r0, _081D925C + movs r1, 0x40 + movs r2, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _081D9260 + mov r10, r1 + adds r7, r0, r1 + ldr r0, _081D9264 + movs r1, 0x10 + movs r2, 0x82 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _081D9268 + adds r0, r5, 0 + movs r1, 0xA0 + movs r2, 0x80 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + adds r0, r5, 0 + movs r1, 0xE0 + movs r2, 0x80 + movs r3, 0x1 + bl obj_add_from_template_forward_search + 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 obj_anim_image_start + movs r2, 0x2 + ldrsh r1, [r7, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x2 + bl obj_anim_image_start + ldr r0, _081D926C + movs r2, 0x41 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + 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, _081D9270 + movs r2, 0x71 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl obj_add_from_template_forward_search + 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 + .align 2, 0 +_081D9258: .4byte 0x03005e08 +_081D925C: .4byte 0x0862ac78 +_081D9260: .4byte 0x0202065e +_081D9264: .4byte 0x0862ac90 +_081D9268: .4byte 0x0862aca8 +_081D926C: .4byte 0x0862acc0 +_081D9270: .4byte 0x0862acd8 + 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, _081D932C + adds r2, r0 + ldr r3, _081D9330 + 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, _081D9334 + 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 + .align 2, 0 +_081D932C: .4byte 0x03005e08 +_081D9330: .4byte 0x02020630 +_081D9334: .4byte pokemon_alive_on_battle_side + 1 + 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, _081D936C + 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 + .align 2, 0 +_081D936C: .4byte 0x02020630 +_081D9370: + ldrh r2, [r4, 0x3A] + ldrh r1, [r4, 0x20] + adds r0, r2, r1 + strh r0, [r4, 0x20] + ldr r3, _081D93C4 + 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, _081D93C8 + str r0, [r4, 0x1C] + b _081D93D2 + .align 2, 0 +_081D93C4: .4byte 0x02020630 +_081D93C8: .4byte nullsub_12 + 1 +_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, _081D9414 + adds r2, r0 + ldr r3, _081D9418 + 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, _081D941C + 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 obj_anim_image_start + pop {r0} + bx r0 + .align 2, 0 +_081D9414: .4byte 0x03005e08 +_081D9418: .4byte 0x02020630 +_081D941C: .4byte sub_81D9420 + 1 + 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, _081D9484 + 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 + .align 2, 0 +_081D9484: .4byte 0x02020630 +_081D9488: + ldr r2, _081D94CC + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, _081D94D0 + 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 + .align 2, 0 +_081D94CC: .4byte 0x02020630 +_081D94D0: .4byte 0x0000fffe + 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, _081D951C + adds r1, r0 + movs r0, 0x8 + ldrsh r1, [r1, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, _081D9520 + adds r4, r0, r2 + subs r2, 0x12 + adds r0, r2 + ldr r3, _081D9524 + 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 + .align 2, 0 +_081D951C: .4byte 0x03005e08 +_081D9520: .4byte 0x0202065e +_081D9524: .4byte sub_81D9528 + 1 + 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, _081D9548 + b _081D954E + .align 2, 0 +_081D9548: .4byte 0x0000ffff +_081D954C: + movs r0, 0x1 +_081D954E: + strh r0, [r7, 0x24] +_081D9550: + movs r1, 0x38 + ldrsh r0, [r7, r1] + cmp r0, 0x80 + bne _081D95CE + ldr r2, _081D95F0 + mov r8, r2 + mov r0, r8 + movs r1, 0x98 + movs r2, 0x84 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x3C] + ldr r5, _081D95F4 + 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 obj_add_from_template_forward_search + 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 + .align 2, 0 +_081D95F0: .4byte 0x0862acf0 +_081D95F4: .4byte 0x02020630 +_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, _081D9684 + 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, _081D9688 + 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 + .align 2, 0 +_081D9684: .4byte 0x02020630 +_081D9688: .4byte 0x0000ffff +_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, _081D96E8 + 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 + .align 2, 0 +_081D96E8: .4byte 0x02020630 +_081D96EC: + ldr r0, _081D96FC + cmp r1, r0 + bgt _081D9700 +_081D96F2: + adds r0, r4, 0 + bl sub_81D97E0 + b _081D979E + .align 2, 0 +_081D96FC: .4byte 0x00000147 +_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, _081D9744 + 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, _081D9748 + movs r1, 0 + bl AddTask + b _081D979E + .align 2, 0 +_081D9744: .4byte 0x02020630 +_081D9748: .4byte sub_81D98B4 + 1 +_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, _081D9788 + 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, _081D978C + str r0, [r4, 0x1C] + b _081D97D2 + .align 2, 0 +_081D9788: .4byte 0x02020630 +_081D978C: .4byte sub_81D97E0 + 1 +_081D9790: + ldr r0, _081D97D8 + 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, _081D97DC + 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 + .align 2, 0 +_081D97D8: .4byte sub_81D8E80 + 1 +_081D97DC: .4byte 0x02020630 + 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, _081D9840 + 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 + .align 2, 0 +_081D9840: .4byte 0x02020630 +_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, _081D98B0 + 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 obj_anim_image_start + adds r0, r4, 0 + adds r1, r5, 0 + bl obj_anim_image_start + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D98B0: .4byte 0x02020630 + 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, _081D98D8 + 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 + .align 2, 0 +_081D98D8: .4byte 0x03005e08 +_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 call_gpu_bg_affine_set + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl lcd_io_set_bits + 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 call_gpu_bg_affine_set + 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 lcd_io_clear_bits + 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, _081D99D8 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0x1 + b _081D99DE + .align 2, 0 +_081D99D8: .4byte 0x02021cc4 +_081D99DC: + movs r0, 0 +_081D99DE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D99BC + + thumb_func_start sub_81D99E4 +sub_81D99E4: @ 81D99E4 + push {r4,lr} + sub sp, 0x8 + ldr r4, _081D9A14 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + movs r0, 0 + str r0, [sp] + ldr r0, _081D9A18 + 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 + .align 2, 0 +_081D9A14: .4byte 0x02021dc4 +_081D9A18: .4byte sub_81D9A1C + 1 + thumb_func_end sub_81D99E4 + + thumb_func_start sub_81D9A1C +sub_81D9A1C: @ 81D9A1C + push {r4,r5,lr} + ldr r4, _081D9A3C + ldr r5, _081D9A40 + 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 + .align 2, 0 +_081D9A3C: .4byte 0x020375e0 +_081D9A40: .4byte 0x02021dc4 +_081D9A44: + cmp r0, 0x2 + bne _081D9A68 + bl sub_80D2578 + cmp r0, 0 + beq _081D9A5C + ldr r0, _081D9A58 + bl sub_80D255C + b _081D9A68 + .align 2, 0 +_081D9A58: .4byte 0x085ee49a +_081D9A5C: + movs r0, 0x1 + strh r0, [r4] + b _081D9A68 +_081D9A62: + adds r0, r5, 0 + bl sub_80D255C +_081D9A68: + ldr r4, _081D9A88 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl gf_strcpy + ldr r1, _081D9A8C + ldr r0, _081D9A90 + str r0, [r1] + ldr r0, _081D9A94 + bl set_callback2 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081D9A88: .4byte 0x02021cc4 +_081D9A8C: .4byte 0x03005dac +_081D9A90: .4byte sub_80AF168 + 1 +_081D9A94: .4byte c2_exit_to_overworld_2_switch + 1 + 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 sub_8008C44 + 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, _081D9B38 + ldr r0, [r0] + adds r0, 0xA + bl sub_80842DC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, _081D9B3C + 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 + .align 2, 0 +_081D9B38: .4byte 0x03005d90 +_081D9B3C: .4byte 0x020375f0 + 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, _081D9B58 +_081D9B4A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081D9B5C + lsls r0, r1, 24 + lsrs r0, 24 + b _081D9B64 + .align 2, 0 +_081D9B58: .4byte 0x0862ad14 +_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 sub_8008C24 + 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, _081D9E08 + 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, _081D9E0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_081D9E08: .4byte 0x03005e00 +_081D9E0C: .4byte _081D9E10 + .align 2, 0 +_081D9E10: + .4byte _081D9E24 + .4byte _081D9E44 + .4byte _081D9E64 + .4byte _081D9E84 + .4byte _081D9EA4 +_081D9E24: + ldr r4, _081D9E38 + ldr r0, _081D9E3C + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081D9E40 + adds r0, r1 + movs r1, 0x32 + b _081D9EB4 + .align 2, 0 +_081D9E38: .4byte 0x02039f31 +_081D9E3C: .4byte 0x02039f24 +_081D9E40: .4byte 0x020244ec +_081D9E44: + ldr r4, _081D9E58 + ldr r0, _081D9E5C + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081D9E60 + adds r0, r1 + movs r1, 0x33 + b _081D9EB4 + .align 2, 0 +_081D9E58: .4byte 0x02039f31 +_081D9E5C: .4byte 0x02039f24 +_081D9E60: .4byte 0x020244ec +_081D9E64: + ldr r4, _081D9E78 + ldr r0, _081D9E7C + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081D9E80 + adds r0, r1 + movs r1, 0x34 + b _081D9EB4 + .align 2, 0 +_081D9E78: .4byte 0x02039f31 +_081D9E7C: .4byte 0x02039f24 +_081D9E80: .4byte 0x020244ec +_081D9E84: + ldr r4, _081D9E98 + ldr r0, _081D9E9C + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081D9EA0 + adds r0, r1 + movs r1, 0x35 + b _081D9EB4 + .align 2, 0 +_081D9E98: .4byte 0x02039f31 +_081D9E9C: .4byte 0x02039f24 +_081D9EA0: .4byte 0x020244ec +_081D9EA4: + ldr r4, _081D9EF4 + ldr r0, _081D9EF8 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, _081D9EFC + adds r0, r1 + movs r1, 0x36 +_081D9EB4: + bl pokemon_getattr + strb r0, [r4] + ldr r5, _081D9F00 + ldr r4, _081D9F04 + ldrb r0, [r4] + lsls r0, 6 + adds r0, r5 + ldr r1, _081D9EF4 + ldrb r1, [r1] + adds r0, 0x2C + strb r1, [r0] + ldr r0, _081D9F08 + bl flag_check + 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, _081D9F0C + ldr r2, _081D9F10 + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_081D9EF4: .4byte 0x02039f31 +_081D9EF8: .4byte 0x02039f24 +_081D9EFC: .4byte 0x020244ec +_081D9F00: .4byte 0x02039e00 +_081D9F04: .4byte 0x02039f25 +_081D9F08: .4byte 0x00000864 +_081D9F0C: .4byte sub_81DA160 + 1 +_081D9F10: .4byte sub_81D9F14 + 1 + thumb_func_end sub_81D9DE4 + + thumb_func_start sub_81D9F14 +sub_81D9F14: @ 81D9F14 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081D9F28 + ldr r2, _081D9F2C + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_081D9F28: .4byte sub_81DA244 + 1 +_081D9F2C: .4byte sub_81D9F30 + 1 + thumb_func_end sub_81D9F14 + + thumb_func_start sub_81D9F30 +sub_81D9F30: @ 81D9F30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081D9F44 + ldr r2, _081D9F48 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_081D9F44: .4byte sub_81DA2E8 + 1 +_081D9F48: .4byte sub_81D9F4C + 1 + thumb_func_end sub_81D9F30 + + thumb_func_start sub_81D9F4C +sub_81D9F4C: @ 81D9F4C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _081D9F60 + ldr r2, _081D9F64 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .align 2, 0 +_081D9F60: .4byte sub_81DA3B8 + 1 +_081D9F64: .4byte sub_81D9F68 + 1 + 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, _081D9FE8 + mov r8, r5 + ldr r0, _081D9FEC + 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, _081D9FF0 +_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 + .align 2, 0 +_081D9FE8: .4byte 0x02039f30 +_081D9FEC: .4byte 0x020375e0 +_081D9FF0: .4byte 0x03005e08 +_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, _081DA088 +_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, _081DA08C + 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 + .align 2, 0 +_081DA088: .4byte 0x03005e08 +_081DA08C: .4byte 0x02039e00 +_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, _081DA0D8 + strb r0, [r1] + ldr r0, _081DA0DC + ldrb r0, [r0] + cmp r0, 0x3 + bhi _081DA0E8 + ldr r1, _081DA0E0 + ldr r2, _081DA0E4 + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + b _081DA0F6 + .align 2, 0 +_081DA0D8: .4byte 0x02039f2b +_081DA0DC: .4byte 0x02039f30 +_081DA0E0: .4byte sub_81DA488 + 1 +_081DA0E4: .4byte sub_81DA10C + 1 +_081DA0E8: + ldr r0, _081DA104 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, _081DA108 + str r0, [r1] +_081DA0F6: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_081DA104: .4byte 0x03005e00 +_081DA108: .4byte sub_81DA10C + 1 + 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, _081DA12C + ldrb r0, [r0] + bl sub_80DB09C + ldr r1, _081DA130 + ldr r2, _081DA134 + adds r0, r4, 0 + bl set_task_function_and_args_14_15 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081DA12C: .4byte 0x02039f2c +_081DA130: .4byte sub_80FCF40 + 1 +_081DA134: .4byte sub_81DA138 + 1 + 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, _081DA158 + ldr r2, _081DA15C + adds r0, r4, 0 + bl set_task_function_and_args_14_15 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081DA158: .4byte sub_80FCFD0 + 1 +_081DA15C: .4byte sub_80F8714 + 1 + 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, _081DA1A0 + 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 + .align 2, 0 +_081DA1A0: .4byte 0x03005e08 +_081DA1A4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081DA224 + ldr r0, _081DA1CC + ldrb r0, [r0] + lsls r0, 6 + ldr r1, _081DA1D0 + 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 + .align 2, 0 +_081DA1CC: .4byte 0x02039f25 +_081DA1D0: .4byte 0x02039e00 +_081DA1D4: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _081DA224 + movs r5, 0 + ldr r0, _081DA230 + mov r8, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _081DA214 + ldr r6, _081DA234 +_081DA1EC: + lsls r4, r5, 6 + ldr r0, _081DA238 + adds r4, r0 + lsls r1, r5, 8 + ldr r0, _081DA23C + 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, _081DA230 + ldrb r0, [r0] + cmp r5, r0 + blt _081DA1EC +_081DA214: + ldr r0, _081DA240 + 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 + .align 2, 0 +_081DA230: .4byte 0x02039f30 +_081DA234: .4byte 0x020229e8 +_081DA238: .4byte 0x02039e00 +_081DA23C: .4byte 0x020223c4 +_081DA240: .4byte 0x03005e00 + 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, _081DA280 + 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 + .align 2, 0 +_081DA280: .4byte 0x03005e08 +_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, _081DA2A8 + movs r1, 0x4 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _081DA2D4 + b _081DA2CE + .align 2, 0 +_081DA2A8: .4byte 0x03005d80 +_081DA2AC: + movs r0, 0 + bl sub_80FC530 + lsls r0, 24 + cmp r0, 0 + beq _081DA2D4 + ldr r0, _081DA2DC + ldr r4, _081DA2E0 + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r0, _081DA2E4 + 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 + .align 2, 0 +_081DA2DC: .4byte 0x03005d80 +_081DA2E0: .4byte 0x020223c4 +_081DA2E4: .4byte 0x030060b8 + 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, _081DA334 + 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 + .align 2, 0 +_081DA334: .4byte 0x03005e08 +_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, _081DA3B0 + ldrb r0, [r7] + cmp r1, r0 + bge _081DA390 + mov r0, r8 + adds r0, 0xA + adds r3, r5, r0 + ldr r4, _081DA3B4 + 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 + .align 2, 0 +_081DA3B0: .4byte 0x02039f30 +_081DA3B4: .4byte 0x020223c4 + 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, _081DA404 + 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 + .align 2, 0 +_081DA404: .4byte 0x03005e08 +_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, _081DA480 + ldrb r0, [r7] + cmp r1, r0 + bge _081DA460 + mov r0, r8 + adds r0, 0x2 + adds r3, r5, r0 + ldr r4, _081DA484 + 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 + .align 2, 0 +_081DA480: .4byte 0x02039f30 +_081DA484: .4byte 0x020223c4 + 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, _081DA4C8 + 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 + .align 2, 0 +_081DA4C8: .4byte 0x03005e08 +_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, _081DA504 + ldrb r2, [r0] + lsls r0, r2, 6 + ldr r1, _081DA508 + 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 + .align 2, 0 +_081DA504: .4byte 0x02039f30 +_081DA508: .4byte 0x02039e00 +_081DA50C: + movs r0, 0 + bl sub_80FC530 + lsls r0, 24 + cmp r0, 0 + beq _081DA55C + ldr r4, _081DA568 + ldrb r3, [r4] + lsls r0, r3, 6 + ldr r5, _081DA56C + adds r0, r5 + ldr r1, _081DA570 + 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, _081DA574 +_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, _081DA578 + 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 + .align 2, 0 +_081DA568: .4byte 0x02039f30 +_081DA56C: .4byte 0x02039e00 +_081DA570: .4byte 0x020223c4 +_081DA574: .4byte 0x020229e8 +_081DA578: .4byte 0x03005e00 + thumb_func_end sub_81DA488 + + thumb_func_start sub_81DA57C +sub_81DA57C: @ 81DA57C + push {lr} + ldr r0, _081DA5B8 + bl flag_check + 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 flag_check + lsls r0, 24 + cmp r0, 0 + beq _081DA5C0 + ldr r0, _081DA5BC + movs r1, 0x8 + movs r2, 0x5 + bl sub_81DA5D4 + b _081DA5CA + .align 2, 0 +_081DA5B8: .4byte 0x00000864 +_081DA5BC: .4byte 0x0862ad34 +_081DA5C0: + ldr r0, _081DA5D0 + movs r1, 0x7 + movs r2, 0x1 + bl sub_81DA5D4 +_081DA5CA: + pop {r0} + bx r0 + .align 2, 0 +_081DA5D0: .4byte 0x0862ad44 + 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, _081DA6A8 + ldr r0, [r0] + ldrh r1, [r4] + ldr r2, _081DA6AC + 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, _081DA6A8 + ldr r0, [r0] + ldrh r1, [r4] + ldr r2, _081DA6AC + 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, _081DA6A8 + ldr r3, _081DA6AC + 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 + .align 2, 0 +_081DA6A8: .4byte 0x03005d8c +_081DA6AC: .4byte 0x000009ca +_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, _081DA6EC +_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 + .align 2, 0 +_081DA6EC: .4byte 0x085500a4 +_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, _081DA738 + ldr r1, [sp, 0x4] + bl LZ77UnCompVram + ldr r0, _081DA73C + ldr r1, [sp] + bl LZ77UnCompVram + ldr r0, _081DA740 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, _081DA744 + bl gpu_tile_obj_decompress_and_load + ldr r0, _081DA748 + bl gpu_pal_obj_alloc_tag_and_apply + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_081DA738: .4byte 0x0862ad54 +_081DA73C: .4byte 0x0862af30 +_081DA740: .4byte 0x0862b53c +_081DA744: .4byte 0x0862b724 +_081DA748: .4byte 0x0862b72c + 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, _081DA7A4 + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0 + bl obj_add_from_template_forward_search + lsls r0, 24 + lsrs r5, r0, 24 + cmp r7, 0x1 + beq _081DA7D0 + cmp r7, 0x1 + bgt _081DA7A8 + cmp r7, 0 + beq _081DA7B8 + b _081DA7AC + .align 2, 0 +_081DA7A4: .4byte 0x0862b758 +_081DA7A8: + cmp r7, 0x2 + beq _081DA7E4 +_081DA7AC: + ldr r6, _081DA7B4 + lsls r3, r5, 4 + b _081DA7F8 + .align 2, 0 +_081DA7B4: .4byte 0x02020630 +_081DA7B8: + ldr r2, _081DA7CC + 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 + .align 2, 0 +_081DA7CC: .4byte 0x02020630 +_081DA7D0: + ldr r2, _081DA7E0 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x59 + b _081DA7F0 + .align 2, 0 +_081DA7E0: .4byte 0x02020630 +_081DA7E4: + ldr r2, _081DA840 + 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 obj_anim_image_start + adds r0, r6, 0 + adds r0, 0x1C + adds r4, r0 + ldr r0, _081DA844 + 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 + .align 2, 0 +_081DA840: .4byte 0x02020630 +_081DA844: .4byte sub_81DA848 + 1 + 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, _081DA870 + str r0, [r3, 0x1C] + b _081DA8B4 + .align 2, 0 +_081DA870: .4byte nullsub_12 + 1 +_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, _081DA920 + 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 obj_add_from_template_forward_search + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0x1 + beq _081DA94C + cmp r5, 0x1 + bgt _081DA924 + cmp r5, 0 + beq _081DA934 + b _081DA928 + .align 2, 0 +_081DA920: .4byte 0x0862b758 +_081DA924: + cmp r5, 0x2 + beq _081DA960 +_081DA928: + ldr r2, _081DA930 + lsls r3, r6, 4 + b _081DA972 + .align 2, 0 +_081DA930: .4byte 0x02020630 +_081DA934: + ldr r2, _081DA948 + 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 + .align 2, 0 +_081DA948: .4byte 0x02020630 +_081DA94C: + ldr r2, _081DA95C + lsls r3, r6, 4 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + movs r1, 0x59 + b _081DA96C + .align 2, 0 +_081DA95C: .4byte 0x02020630 +_081DA960: + ldr r2, _081DA9B4 + 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 obj_anim_image_start + ldr r2, [sp, 0x8] + adds r0, r2, 0 + adds r0, 0x1C + adds r4, r0 + ldr r0, _081DA9B8 + 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 + .align 2, 0 +_081DA9B4: .4byte 0x02020630 +_081DA9B8: .4byte sub_81DA9BC + 1 + 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, _081DAA1C + str r0, [r4, 0x1C] +_081DAA16: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_081DAA1C: .4byte nullsub_12 + 1 + thumb_func_end sub_81DA9BC + + thumb_func_start sub_81DAA20 +sub_81DAA20: @ 81DAA20 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _081DAA6C + adds r0, r4, 0 + bl gpu_tile_obj_free_by_tag + adds r0, r4, 0 + bl gpu_pal_free_tag + movs r0, 0x10 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, _081DAA70 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r0, 0x12 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_delete_and_free_tiles + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_081DAA6C: .4byte 0x00002e90 +_081DAA70: .4byte 0x02020630 + thumb_func_end sub_81DAA20 + + thumb_func_start sub_81DAA74 +sub_81DAA74: @ 81DAA74 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r2, _081DAABC + 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, _081DAAC0 + 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 + .align 2, 0 +_081DAABC: .4byte 0x02020630 +_081DAAC0: .4byte nullsub_12 + 1 +_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, _081DAB1C + movs r0, 0x50 + bl lcd_io_set + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl lcd_io_set + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_x_offset + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl bg_change_y_offset + movs r1, 0xA0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x2 + bl bg_change_y_offset + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _081DAB46 + .align 2, 0 +_081DAB1C: .4byte 0x00003f41 +_081DAB20: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl lcd_io_clear_bits + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl lcd_io_clear_bits + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + bl lcd_io_clear_bits + 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 lcd_io_set_bits +_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 sub_80A1AD4 + 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 lcd_io_set +_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, _081DAC0C + ldr r2, _081DAC10 + 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 + .align 2, 0 +_081DAC0C: .4byte 0x0862b770 +_081DAC10: .4byte 0x03005e00 + 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, _081DACAC + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DACA4 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DACB0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DACA4: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DACAC: .4byte 0x02037fd4 +_081DACB0: .4byte sub_81DABDC + 1 + 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, _081DACE4 + ldr r2, _081DACE8 + 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 + .align 2, 0 +_081DACE4: .4byte 0x0862b784 +_081DACE8: .4byte 0x03005e00 + 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, _081DAD84 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DAD7C + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DAD88 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DAD7C: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DAD84: .4byte 0x02037fd4 +_081DAD88: .4byte sub_81DACB4 + 1 + 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, _081DADBC + ldr r2, _081DADC0 + 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 + .align 2, 0 +_081DADBC: .4byte 0x0862b798 +_081DADC0: .4byte 0x03005e00 + 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, _081DAE70 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DAE68 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DAE74 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DAE68: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DAE70: .4byte 0x02037fd4 +_081DAE74: .4byte sub_81DAD8C + 1 + 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, _081DAEA8 + ldr r2, _081DAEAC + 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 + .align 2, 0 +_081DAEA8: .4byte 0x0862b7ac +_081DAEAC: .4byte 0x03005e00 + 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, _081DAF60 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DAF58 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DAF64 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DAF58: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DAF60: .4byte 0x02037fd4 +_081DAF64: .4byte sub_81DAE78 + 1 + 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, _081DAF98 + ldr r2, _081DAF9C + 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 + .align 2, 0 +_081DAF98: .4byte 0x0862b7c0 +_081DAF9C: .4byte 0x03005e00 + 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, _081DB058 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB050 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DB05C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB050: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DB058: .4byte 0x02037fd4 +_081DB05C: .4byte sub_81DAF68 + 1 + 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, _081DB090 + ldr r2, _081DB094 + 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 + .align 2, 0 +_081DB090: .4byte 0x0862b7d4 +_081DB094: .4byte 0x03005e00 + 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, _081DB150 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB148 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DB154 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB148: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DB150: .4byte 0x02037fd4 +_081DB154: .4byte sub_81DB060 + 1 + 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, _081DB188 + ldr r2, _081DB18C + 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 + .align 2, 0 +_081DB188: .4byte 0x0862b7e8 +_081DB18C: .4byte 0x03005e00 + 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, _081DB250 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB248 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DB254 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB248: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DB250: .4byte 0x02037fd4 +_081DB254: .4byte sub_81DB158 + 1 + 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, _081DB288 + ldr r2, _081DB28C + 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 + .align 2, 0 +_081DB288: .4byte 0x0862b7fc +_081DB28C: .4byte 0x03005e00 + 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, _081DB354 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB34C + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, _081DB358 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB34C: + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_081DB354: .4byte 0x02037fd4 +_081DB358: .4byte sub_81DB258 + 1 + thumb_func_end sub_81DB328 + + thumb_func_start sub_81DB35C +sub_81DB35C: @ 81DB35C + push {lr} + movs r3, 0 + bl sub_81DB374 + pop {r1} + bx r1 + thumb_func_end sub_81DB35C + + thumb_func_start sub_81DB368 +sub_81DB368: @ 81DB368 + push {lr} + movs r3, 0 + bl sub_81DB384 + pop {r1} + bx r1 + thumb_func_end sub_81DB368 + + thumb_func_start sub_81DB374 +sub_81DB374: @ 81DB374 + push {lr} + bl sub_81DB384 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + pop {r1} + bx r1 + thumb_func_end sub_81DB374 + + thumb_func_start sub_81DB384 +sub_81DB384: @ 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 font_get_width_of_string + 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 sub_81DB384 + + 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 font_get_width_of_string + 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 font_get_width_of_string + 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 font_get_width_of_string + 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, _081DB48C + adds r2, r1 + adds r1, r2, 0 + bl gf_strcpy + movs r1, 0 + strb r1, [r0] + adds r0, 0x1 + ldr r1, _081DB490 + bl gf_strcpy + pop {r0} + bx r0 + .align 2, 0 +_081DB48C: .4byte 0x0856b5b0 +_081DB490: .4byte 0x085e8268 + 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 gf_strcpy + adds r4, r0, 0 + lsls r0, r6, 24 + lsrs r0, 24 + adds r1, r5, 0 + movs r2, 0 + bl font_get_width_of_string + 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 sub_8009370 + adds r0, r4, 0 + bl sub_8008C24 + 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 sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081DB546 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8009308 + b _081DB54C +_081DB546: + adds r0, r4, 0 + bl sub_8009370 +_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 sub_8008C24 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081DB572 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8009308 + b _081DB5A4 +_081DB572: + cmp r5, 0xFC + bne _081DB57E + adds r0, r4, 0 + bl sub_8009370 + 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 gf_strcpy + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8009308 + 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, _081DB674 + 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, _081DB678 + 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 + .align 2, 0 +_081DB674: .4byte 0x02020004 +_081DB678: .4byte 0x11111111 + thumb_func_end sub_81DB620 + + .incbin "base_emerald.gba", 0x1db67c, 0x2ded70 - 0x1db67c + thumb_func_start sub_82DED70 +sub_82DED70: @ 82DED70 + push {r4,lr} + ldr r4, _082DEE78 + eors r3, r1 + movs r2, 0x20 +_082DED78: + lsrs r3, 1 + bcc _082DED7E + eors r3, r4 +_082DED7E: + subs r2, 0x1 + bne _082DED78 + pop {r4,pc} + thumb_func_end sub_82DED70 + + thumb_func_start sub_82DED84 +sub_82DED84: @ 82DED84 + ldr r1, [r0, 0x28] + cmp r1, 0 + beq _082DEDAA + ldrb r1, [r0, 0x1] + adds r1, 0x1 + strb r1, [r0, 0x1] + ldrb r1, [r0, 0x2] + cmp r1, 0x2 + beq _082DEDF4 + ldr r3, _082DF038 + ldrh r2, [r3, 0x8] + movs r1, 0 + strh r1, [r3, 0x8] + ldrb r1, [r0] + cmp r1, 0xA + bgt _082DEDA8 + adds r1, 0x1 + strb r1, [r0] +_082DEDA8: + strh r2, [r3, 0x8] +_082DEDAA: + bcs sub_82DEE98 + ldrb r1, [r0, 0x2] + cmp r1, 0 + bne _082DEDF6 + ldr r1, [r0, 0x24] + ldr r2, [r0, 0x20] + subs r1, r2 + beq _082DEE76 + cmp r1, 0xA0 + bcc _082DEE76 + push {r4-r6} + movs r1, 0x98 + adds r2, 0x4 + ldr r4, _082DEE80 +_082DEDC6: + ldm r2!, {r5} + ldm r4!, {r6} + cmp r5, r6 + bne _082DEDDC + subs r1, 0x4 + bne _082DEDC6 + ldm r2!, {r5} + ldm r4!, {r6} + eors r5, r6 + lsrs r5, 8 + str r2, [r0, 0x20] +_082DEDDC: + pop {r4-r6} + bne sub_82DEE98 + movs r1, 0x1 + strb r1, [r0, 0x2] + ldr r1, [r0, 0x4] + ldr r2, [r0, 0x8] + eors r1, r2 + str r1, [r0, 0x18] + ldr r2, _082DEE7C + muls r1, r2 + adds r1, 0x1 + str r1, [r0, 0x14] +_082DEDF4: + bx lr +_082DEDF6: + ldr r1, [r0, 0x24] + mov r12, r1 + ldr r3, [r0, 0x18] + push {r4-r7} + ldr r4, [r0, 0x20] + ldr r5, _082DEE7C + ldr r6, [r0, 0x14] + ldr r7, _082DEE78 +_082DEE06: + cmp r4, r12 + bcs _082DEE26 + ldr r1, [r4] + eors r1, r6 + adds r1, r3 + stm r4!, {r1} + eors r3, r1 + movs r2, 0x20 +_082DEE16: + lsrs r3, 1 + bcc _082DEE1C + eors r3, r7 +_082DEE1C: + subs r2, 0x1 + bne _082DEE16 + muls r6, r5 + adds r6, 0x1 + b _082DEE06 +_082DEE26: + str r4, [r0, 0x20] + str r6, [r0, 0x14] + pop {r4-r7} + str r3, [r0, 0x18] + ldrh r1, [r0, 0x12] + cmp r1, 0 + bne _082DEE76 + ldr r1, [r0, 0x24] + ldr r2, [r0, 0x20] + cmp r1, r2 + bne _082DEE76 + ldr r1, [r0, 0xC] + cmp r1, 0 + beq _082DEE60 + ldrh r1, [r0, 0x10] + cmp r1, 0 + beq _082DEDF4 + mov r12, lr + movs r1, 0xBB + ldr r3, [r0, 0xC] + bl sub_82DED70 + ldrh r1, [r0, 0x10] + mov lr, r12 + subs r1, r3 + bne sub_82DEE98 + movs r1, 0x2 + strb r1, [r0, 0x2] + bx lr +_082DEE60: + mov r12, lr + ldrb r1, [r0, 0x3] + lsls r1, 24 + subs r1, 0x1 + str r1, [r0, 0xC] + bl sub_82DED70 + lsls r3, 8 + adds r3, 0xFF + str r3, [r0, 0x1C] + bx r12 +_082DEE76: + bx lr + .align 2, 0 +_082DEE78: .4byte 0x0000a1c1 +_082DEE7C: .4byte 0x6177614b +_082DEE80: .4byte CartridgeHeaderNintendoLogo + thumb_func_end sub_82DED84 + + thumb_func_start sub_82DEE84 +sub_82DEE84: @ 82DEE84 + ldrb r1, [r0, 0x2] + cmp r1, 0x2 + bne _082DEE96 + ldr r3, _082DF038 + movs r1, 0 + strh r1, [r3, 0x8] + ldr r1, _082DF048 + adds r1, 0xC0 + bx r1 +_082DEE96: + bx lr + thumb_func_end sub_82DEE84 + + thumb_func_start sub_82DEE98 +sub_82DEE98: @ 82DEE98 + ldr r3, _082DF038 + ldrh r2, [r3, 0x8] + movs r1, 0 + strh r1, [r3, 0x8] + adr r3, _082DEEF8 + str r3, [r0, 0x28] + ldrb r3, [r0, 0x3] + push {r3} + ldrb r3, [r0, 0x1] + push {r0,r3} + adds r3, r0, 0 + adds r3, 0x20 +_082DEEB0: + stm r0!, {r1} + cmp r0, r3 + bcc _082DEEB0 + pop {r0,r3} + lsrs r3, 1 + strb r3, [r0, 0x3] + pop {r3} + strb r3, [r0, 0x1] + ldr r3, _082DF03C + lsls r0, r3, 10 + strh r0, [r3, 0x14] + movs r0, 0xC0 + lsls r0, 8 + strh r0, [r3, 0x14] + movs r0, 0x47 + strh r0, [r3, 0x20] + strh r1, [r3, 0x38] + ldr r3, _082DF038 + movs r0, 0x80 + strh r0, [r3, 0x2] + ldrh r1, [r3] + orrs r1, r0 + strh r1, [r3] + strh r2, [r3, 0x8] + bx lr + thumb_func_end sub_82DEE98 + + non_word_aligned_thumb_func_start sub_82DEEE2 +sub_82DEEE2: @ 82DEEE2 + ldr r3, _082DF03C + ldrh r1, [r3, 0x20] + strh r1, [r3, 0x20] + movs r2, 0 + strb r2, [r0] + ldr r2, [r0, 0x28] + cmp r2, 0 + beq _082DEF04 + lsrs r1, 1 + bcs _082DEF06 + mov pc, r2 +_082DEEF8: + movs r2, 0 + strh r2, [r3, 0x38] +_082DEEFC: + str r2, [r0, 0x28] +_082DEEFE: + ldr r3, _082DF040 + ldrh r1, [r3, 0x2] + strb r1, [r0, 0x3] +_082DEF04: + bx lr +_082DEF06: + ldr r1, [r3, 0x30] + ldr r1, _082DF044 + str r1, [r3, 0x34] + movs r1, 0x10 + strh r1, [r3, 0x38] + ldrb r1, [r0, 0x3] + strb r1, [r0, 0x9] + ldrb r1, [r0, 0x2] + cmp r1, 0 + bne _082DEEF8 + ldr r1, _082DF048 + str r1, [r0, 0x20] + str r1, [r0, 0x24] + adr r2, .Lsub_82DEF24 + b _082DEEFC + thumb_func_end sub_82DEEE2 + + thumb_func_start sub_82DEF24 +.Lsub_82DEF24: +sub_82DEF24: @ 82DEF24 + lsls r1, 31 + bcc _082DEEF8 + bmi _082DEF34 + adr r2, .Lsub_82DEF30 + b _082DEEFC + thumb_func_end sub_82DEF24 + + thumb_func_start sub_82DEF30 +.Lsub_82DEF30: +sub_82DEF30: @ 82DEF30 + lsrs r1, 1 + bcc _082DEEF8 +_082DEF34: + ldr r1, [r3, 0x30] + ldr r2, _082DF044 + cmp r1, r2 + bne _082DEEF8 + ldrb r1, [r0, 0x3] + strb r1, [r0, 0xB] + adr r2, .Lsub_82DEF44 + b _082DEEFC + thumb_func_end sub_82DEF30 + + thumb_func_start sub_82DEF44 +.Lsub_82DEF44: +sub_82DEF44: @ 82DEF44 + lsrs r1, 1 + bcc _082DEEF8 + ldr r1, [r3, 0x30] + lsrs r2, r1, 24 + cmp r2, 0xDD + bne _082DEEF8 + str r1, [r0, 0x4] + ldrb r1, [r0, 0x1] + strb r1, [r0, 0xA] + movs r2, 0 + movs r3, 0 + ldr r1, [r0, 0x8] + lsrs r1, 8 +_082DEF5E: + lsrs r1, 1 + adcs r2, r3 + cmp r1, 0 + bne _082DEF5E + cmp r2, 0xE + bgt _082DEF70 + cmp r2, 0x7 + bge _082DEF72 + movs r1, 0xFF +_082DEF70: + strb r1, [r0, 0xA] +_082DEF72: + ldr r1, [r0, 0x8] + adds r1, 0xEE + ldr r3, _082DF03C + str r1, [r3, 0x34] + movs r1, 0x30 + strh r1, [r3, 0x38] + adr r2, .Lsub_82DEF84 + b _082DEEFC + thumb_func_end sub_82DEF44 + + thumb_func_start sub_82DEF84 +.Lsub_82DEF84: +sub_82DEF84: @ 82DEF84 + lsls r1, 31 + bcc _082DEEF8 + bmi _082DEF94 + adr r2, .Lsub_82DEF90 + b _082DEEFC + thumb_func_end sub_82DEF84 + + thumb_func_start sub_82DEF90 +.Lsub_82DEF90: +sub_82DEF90: @ 82DEF90 + lsrs r1, 1 + bcc _082DEEF8 +_082DEF94: + ldr r1, [r3, 0x30] + ldr r2, _082DF034 + cmp r1, r2 + bcs _082DEEF8 + adds r1, 0x1 + adds r1, r1 + strh r1, [r0, 0x12] + ldrb r1, [r0, 0x2] + cmp r1, 0 +_082DEFA6: + bne _082DEEF8 + ldr r1, _082DF048 + str r1, [r0, 0x20] + str r1, [r0, 0x24] + adr r2, .Lsub_82DEFB4 + b _082DEEFC + thumb_func_end sub_82DEF90 + + thumb_func_start sub_82DEFB4 +.Lsub_82DEFB4: +sub_82DEFB4: @ 82DEFB4 + lsrs r1, 1 + bcc _082DEEF8 + ldr r2, [r0, 0x24] + movs r1, 0x4 + ands r1, r2 + adds r1, 0x8 + lsls r1, 2 + strh r1, [r3, 0x38] + ldr r1, [r3, 0x30] + stm r2!, {r1} + str r2, [r0, 0x24] + ldrh r1, [r0, 0x12] + subs r1, 0x1 + strh r1, [r0, 0x12] + bne _082DEEFE +_082DEFD2: + ldrb r1, [r0, 0x1] + lsls r1, 8 + adds r1, 0xCC + str r1, [r3, 0x34] + adr r2, _082DEFE0 + b _082DEEFC + .align 2, 0 +_082DEFE0: + lsls r1, 31 +_082DEFE2: + bcc _082DEEF8 + ldr r1, [r0, 0x1C] + cmp r1, 0 + beq _082DEFD2 + str r1, [r3, 0x34] + adr r2, .Lsub_82DEFF0 + b _082DEEFC + thumb_func_end sub_82DEFB4 + + thumb_func_start sub_82DEFF0 +.Lsub_82DEFF0: +sub_82DEFF0: @ 82DEFF0 + lsls r1, 31 + bcc _082DEFE2 + bmi _082DF000 + adr r2, .L_082DEFFC + b _082DEEFC + .align 2, 0 +.L_082DEFFC: +_082DEFFC: + lsrs r1, 1 + bcc _082DEFE2 +_082DF000: + ldr r1, [r3, 0x30] + lsrs r2, r1, 24 + cmp r2, 0xBB + bne _082DEFA6 + strh r1, [r0, 0x10] + adr r2, .Lsub_82DF010 + b _082DEEFC + thumb_func_end sub_82DEFF0 + + thumb_func_start sub_82DF010 +.Lsub_82DF010: +sub_82DF010: @ 82DF010 + b _082DEEF8 + thumb_func_end sub_82DF010 + + non_word_aligned_thumb_func_start sub_82DF012 +sub_82DF012: @ 82DF012 + ldr r3, _082DF038 + ldrh r2, [r3, 0x8] + movs r1, 0 + strh r1, [r3, 0x8] + ldr r3, _082DF03C + movs r0, 0x7 + strh r0, [r3, 0x20] + lsls r0, r3, 10 + strh r0, [r3, 0x14] + ldr r3, _082DF038 + movs r0, 0x80 + strh r0, [r3, 0x2] + ldrh r1, [r3] + bics r1, r0 + strh r1, [r3] + strh r2, [r3, 0x8] + bx lr + .align 2, 0 +_082DF034: .4byte 0x00004000 +_082DF038: .4byte 0x04000200 +_082DF03C: .4byte 0x04000120 +_082DF040: .4byte 0x04000004 +_082DF044: .4byte 0x45565841 +_082DF048: .4byte 0x02000000 + thumb_func_end sub_82DF012 + + thumb_func_start umul3232H32 +umul3232H32: @ 82DF04C + adr r2, _082DF050 + bx r2 + .arm +_082DF050: + umull r2, r3, r0, r1 + add r0, r3, 0 + bx lr + thumb_func_end umul3232H32 + + .thumb + thumb_func_start SoundMain +SoundMain: @ 82DF05C + ldr r0, _082DF0C8 + ldr r0, [r0] + ldr r2, _082DF0CC + ldr r3, [r0] + cmp r2, r3 + beq _082DF06A + bx lr +_082DF06A: + adds r3, 0x1 + str r3, [r0] + push {r4-r7,lr} + mov r1, r8 + mov r2, r9 + mov r3, r10 + mov r4, r11 + push {r0-r4} + sub sp, 0x18 + ldrb r1, [r0, 0xC] + cmp r1, 0 + beq _082DF08E + ldr r2, _082DF0D4 + ldrb r2, [r2] + cmp r2, 0xA0 + bcs _082DF08C + adds r2, 0xE4 +_082DF08C: + adds r1, r2 +_082DF08E: + str r1, [sp, 0x14] + ldr r3, [r0, 0x20] + cmp r3, 0 + beq _082DF09E + ldr r0, [r0, 0x24] + bl _082DF496 + ldr r0, [sp, 0x18] +_082DF09E: + ldr r3, [r0, 0x28] + bl _082DF496 + ldr r0, [sp, 0x18] + ldr r3, [r0, 0x10] + mov r8, r3 + ldr r5, _082DF0D8 + adds r5, r0 + ldrb r4, [r0, 0x4] + subs r7, r4, 0x1 + bls _082DF0BE + ldrb r1, [r0, 0xB] + subs r1, r7 + mov r2, r8 + muls r2, r1 + adds r5, r2 +_082DF0BE: + str r5, [sp, 0x8] + ldr r6, _082DF0DC + ldr r3, _082DF0D0 + bx r3 + .align 2, 0 +_082DF0C8: .4byte 0x03007ff0 +_082DF0CC: .4byte 0x68736d53 +_082DF0D0: .4byte 0x03001aa9 +_082DF0D4: .4byte 0x04000006 +_082DF0D8: .4byte 0x00000350 +_082DF0DC: .4byte 0x00000630 + thumb_func_end SoundMain + + thumb_func_start SoundMainRAM +SoundMainRAM: @ 82DF0E0 + ldrb r3, [r0, 0x5] + cmp r3, 0 + beq _082DF140 + adr r1, _082DF0EC + bx r1 + .arm +_082DF0EC: + cmp r4, 0x2 + addeq r7, r0, 0x350 + addne r7, r5, r8 + mov r4, r8 +_082DF0FC: + ldrsb r0, [r5, r6] + ldrsb r1, [r5] + add r0, r0, r1 + ldrsb r1, [r7, r6] + add r0, r0, r1 + ldrsb r1, [r7], 0x1 + add r0, r0, r1 + mul r1, r0, r3 + mov r0, r1, asr 9 + tst r0, 0x80 + addne r0, r0, 0x1 + strb r0, [r5, r6] + strb r0, [r5], 0x1 + subs r4, r4, 0x1 + bgt _082DF0FC + add r0, pc, 0x2F + bx r0 + .thumb +_082DF140: + movs r0, 0 + mov r1, r8 + adds r6, r5 + lsrs r1, 3 + bcc _082DF14E + stm r5!, {r0} + stm r6!, {r0} +_082DF14E: + lsrs r1, 1 + bcc _082DF15A + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} +_082DF15A: + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + subs r1, 0x1 + bgt _082DF15A + ldr r4, [sp, 0x18] + ldr r0, [r4, 0x18] + mov r12, r0 + ldrb r0, [r4, 0x6] + adds r4, 0x50 +_082DF178: + str r0, [sp, 0x4] + ldr r3, [r4, 0x24] + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _082DF198 + ldr r1, _082DF194 + ldrb r1, [r1] + cmp r1, 0xA0 + bcs _082DF18C + adds r1, 0xE4 +_082DF18C: + cmp r1, r0 + bcc _082DF198 + b _082DF482 + .align 2, 0 +_082DF194: .4byte 0x04000006 +_082DF198: + ldrb r6, [r4] + movs r0, 0xC7 + tst r0, r6 + bne _082DF1A2 + b _082DF478 +_082DF1A2: + movs r0, 0x80 + tst r0, r6 + beq _082DF1D8 + movs r0, 0x40 + tst r0, r6 + bne _082DF1E8 + movs r6, 0x3 + strb r6, [r4] + adds r0, r3, 0 + adds r0, 0x10 + ldr r1, [r4, 0x18] + adds r0, r1 + str r0, [r4, 0x28] + ldr r0, [r3, 0xC] + subs r0, r1 + str r0, [r4, 0x18] + movs r5, 0 + strb r5, [r4, 0x9] + str r5, [r4, 0x1C] + ldrb r2, [r3, 0x3] + movs r0, 0xC0 + tst r0, r2 + beq _082DF230 + movs r0, 0x10 + orrs r6, r0 + strb r6, [r4] + b _082DF230 +_082DF1D8: + ldrb r5, [r4, 0x9] + movs r0, 0x4 + tst r0, r6 + beq _082DF1EE + ldrb r0, [r4, 0xD] + subs r0, 0x1 + strb r0, [r4, 0xD] + bhi _082DF23E +_082DF1E8: + movs r0, 0 + strb r0, [r4] + b _082DF478 +_082DF1EE: + movs r0, 0x40 + tst r0, r6 + beq _082DF20E + ldrb r0, [r4, 0x7] + muls r5, r0 + lsrs r5, 8 + ldrb r0, [r4, 0xC] + cmp r5, r0 + bhi _082DF23E +_082DF200: + ldrb r5, [r4, 0xC] + cmp r5, 0 + beq _082DF1E8 + movs r0, 0x4 + orrs r6, r0 + strb r6, [r4] + b _082DF23E +_082DF20E: + movs r2, 0x3 + ands r2, r6 + cmp r2, 0x2 + bne _082DF22C + ldrb r0, [r4, 0x5] + muls r5, r0 + lsrs r5, 8 + ldrb r0, [r4, 0x6] + cmp r5, r0 + bhi _082DF23E + adds r5, r0, 0 + beq _082DF200 + subs r6, 0x1 + strb r6, [r4] + b _082DF23E +_082DF22C: + cmp r2, 0x3 + bne _082DF23E +_082DF230: + ldrb r0, [r4, 0x4] + adds r5, r0 + cmp r5, 0xFF + bcc _082DF23E + movs r5, 0xFF + subs r6, 0x1 + strb r6, [r4] +_082DF23E: + strb r5, [r4, 0x9] + ldr r0, [sp, 0x18] + ldrb r0, [r0, 0x7] + adds r0, 0x1 + muls r0, r5 + lsrs r5, r0, 4 + ldrb r0, [r4, 0x2] + muls r0, r5 + lsrs r0, 8 + strb r0, [r4, 0xA] + ldrb r0, [r4, 0x3] + muls r0, r5 + lsrs r0, 8 + strb r0, [r4, 0xB] + movs r0, 0x10 + ands r0, r6 + str r0, [sp, 0x10] + beq _082DF272 + adds r0, r3, 0 + adds r0, 0x10 + ldr r1, [r3, 0x8] + adds r0, r1 + str r0, [sp, 0xC] + ldr r0, [r3, 0xC] + subs r0, r1 + str r0, [sp, 0x10] +_082DF272: + ldr r5, [sp, 0x8] + ldr r2, [r4, 0x18] + ldr r3, [r4, 0x28] + adr r0, _082DF27C + bx r0 + .arm +_082DF27C: + str r8, [sp] + ldr r9, [r4, 0x1C] + ldrb r10, [r4, 0xA] + ldrb r11, [r4, 0xB] + ldrb r0, [r4, 0x1] + tst r0, 0x30 + beq _082DF2A0 + bl sub_82DF49C + b _082DF460 +_082DF2A0: + mov r10, r10, lsl 16 + mov r11, r11, lsl 16 + ldrb r0, [r4, 0x1] + tst r0, 0x8 + beq _082DF3D4 +_082DF2B4: + cmp r2, 0x4 + ble _082DF324 + subs r2, r2, r8 + movgt r9, 0 + bgt _082DF2E0 + mov r9, r8 + add r2, r2, r8 + sub r8, r2, 0x4 + sub r9, r9, r8 + ands r2, r2, 0x3 + moveq r2, 0x4 +_082DF2E0: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_082DF2E8: + ldrsb r0, [r3], 0x1 + mul r1, r10, r0 + bic r1, r1, 0xFF0000 + add r6, r1, r6, ror 8 + mul r1, r11, r0 + bic r1, r1, 0xFF0000 + add r7, r1, r7, ror 8 + adds r5, r5, 0x40000000 + bcc _082DF2E8 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _082DF2E0 + adds r8, r8, r9 + beq _082DF464 +_082DF324: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_082DF32C: + ldrsb r0, [r3], 0x1 + mul r1, r10, r0 + bic r1, r1, 0xFF0000 + add r6, r1, r6, ror 8 + mul r1, r11, r0 + bic r1, r1, 0xFF0000 + add r7, r1, r7, ror 8 + subs r2, r2, 0x1 + beq _082DF39C +_082DF350: + adds r5, r5, 0x40000000 + bcc _082DF32C + str r7, [r5, 0x630] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _082DF2B4 + b _082DF464 +_082DF36C: + ldr r0, [sp, 0x18] + cmp r0, 0 + beq _082DF390 + ldr r3, [sp, 0x14] + rsb lr, r2, 0 +_082DF380: + adds r2, r0, r2 + bgt _082DF434 + sub lr, lr, r0 + b _082DF380 +_082DF390: + ldmia sp!, {r4,r12} + mov r2, 0 + b _082DF3AC +_082DF39C: + ldr r2, [sp, 0x10] + cmp r2, 0 + ldrne r3, [sp, 0xC] + bne _082DF350 +_082DF3AC: + strb r2, [r4] + mov r0, r5, lsr 30 + bic r5, r5, 0xC0000000 + rsb r0, r0, 0x3 + mov r0, r0, lsl 3 + mov r6, r6, ror r0 + mov r7, r7, ror r0 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + b _082DF46C +_082DF3D4: + stmdb sp!, {r4,r12} + ldr r1, [r4, 0x20] + mul r4, r12, r1 + ldrsb r0, [r3] + ldrsb r1, [r3, 0x1]! + sub r1, r1, r0 +_082DF3EC: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_082DF3F4: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r4 + movs lr, r9, lsr 23 + beq _082DF440 + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _082DF36C + subs lr, lr, 0x1 + addeq r0, r0, r1 +_082DF434: + ldrsbne r0, [r3, lr]! + ldrsb r1, [r3, 0x1]! + sub r1, r1, r0 +_082DF440: + adds r5, r5, 0x40000000 + bcc _082DF3F4 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _082DF3EC + sub r3, r3, 0x1 + ldmia sp!, {r4,r12} +_082DF460: + str r9, [r4, 0x1C] +_082DF464: + str r2, [r4, 0x18] + str r3, [r4, 0x28] +_082DF46C: + ldr r8, [sp] + add r0, pc, 0x1 + bx r0 + .thumb +_082DF478: + ldr r0, [sp, 0x4] + subs r0, 0x1 + ble _082DF482 + adds r4, 0x40 + b _082DF178 +_082DF482: + ldr r0, [sp, 0x18] + ldr r3, _082DF498 + str r3, [r0] + add sp, 0x1C + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r3} +_082DF496: + bx r3 + .align 2, 0 +_082DF498: .4byte 0x68736d53 + thumb_func_end SoundMainRAM + + .arm + arm_func_start sub_82DF49C +sub_82DF49C: @ 82DF49C + ldr r6, [r4, 0x24] + ldrb r0, [r4] + tst r0, 0x20 + bne _082DF4EC + orr r0, r0, 0x20 + strb r0, [r4] + ldrb r0, [r4, 0x1] + tst r0, 0x10 + beq _082DF4D4 + ldr r1, [r6, 0xC] + add r1, r1, r6, lsl 1 + add r1, r1, 0x20 + sub r3, r1, r3 + str r3, [r4, 0x28] +_082DF4D4: + ldrh r0, [r6] + cmp r0, 0 + beq _082DF4EC + sub r3, r3, r6 + sub r3, r3, 0x10 + str r3, [r4, 0x28] +_082DF4EC: + stmdb sp!, {r8,r12,lr} + mov r10, r10, lsl 16 + mov r11, r11, lsl 16 + ldr r1, [r4, 0x20] + ldrb r0, [r4, 0x1] + tst r0, 0x8 + movne r8, 0x800000 + muleq r8, r12, r1 + ldrh r0, [r6] + cmp r0, 0 + beq _082DF6A0 + mov r0, 0xFF000000 + str r0, [r4, 0x3C] + ldrb r0, [r4, 0x1] + tst r0, 0x10 + bne _082DF5F8 + bl sub_82DF758 + mov r0, r1 + add r3, r3, 0x1 + bl sub_82DF758 + sub r1, r1, r0 +_082DF540: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_082DF548: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r8 + movs lr, r9, lsr 23 + beq _082DF5A8 + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _082DF5D0 + subs lr, lr, 0x1 + bne _082DF590 + add r0, r0, r1 + b _082DF59C +_082DF590: + add r3, r3, lr + bl sub_82DF758 + mov r0, r1 +_082DF59C: + add r3, r3, 0x1 + bl sub_82DF758 + sub r1, r1, r0 +_082DF5A8: + adds r5, r5, 0x40000000 + bcc _082DF548 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + ldr r6, [sp] + subs r6, r6, 0x4 + str r6, [sp] + bgt _082DF540 + sub r3, r3, 0x1 + b _082DF728 +_082DF5D0: + ldr r0, [sp, 0x1C] + cmp r0, 0 + beq _082DF72C + ldr r3, [r4, 0x24] + ldr r3, [r3, 0x8] + rsb lr, r2, 0 +_082DF5E8: + adds r2, r2, r0 + bgt _082DF590 + sub lr, lr, r0 + b _082DF5E8 +_082DF5F8: + sub r3, r3, 0x1 + bl sub_82DF758 + mov r0, r1 + sub r3, r3, 0x1 + bl sub_82DF758 + sub r1, r1, r0 +_082DF610: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_082DF618: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r8 + movs lr, r9, lsr 23 + beq _082DF678 + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _082DF72C + subs lr, lr, 0x1 + bne _082DF660 + add r0, r0, r1 + b _082DF66C +_082DF660: + sub r3, r3, lr + bl sub_82DF758 + mov r0, r1 +_082DF66C: + sub r3, r3, 0x1 + bl sub_82DF758 + sub r1, r1, r0 +_082DF678: + adds r5, r5, 0x40000000 + bcc _082DF618 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + ldr r6, [sp] + subs r6, r6, 0x4 + str r6, [sp] + bgt _082DF610 + add r3, r3, 0x2 + b _082DF728 +_082DF6A0: + ldrb r0, [r4, 0x1] + tst r0, 0x10 + beq _082DF728 + ldrsb r0, [r3, -0x1]! + ldrsb r1, [r3, -0x1] + sub r1, r1, r0 +_082DF6B8: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_082DF6C0: + mul lr, r9, r1 + add lr, r0, lr, asr 23 + mul r12, r10, lr + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, lr + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add r9, r9, r8 + movs lr, r9, lsr 23 + beq _082DF704 + bic r9, r9, 0x3F800000 + subs r2, r2, lr + ble _082DF72C + ldrsb r0, [r3, -lr]! + ldrsb r1, [r3, -0x1] + sub r1, r1, r0 +_082DF704: + adds r5, r5, 0x40000000 + bcc _082DF6C0 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + ldr r6, [sp] + subs r6, r6, 0x4 + str r6, [sp] + bgt _082DF6B8 + add r3, r3, 0x1 +_082DF728: + ldmia sp!, {r8,r12,pc} +_082DF72C: + mov r2, 0 + strb r2, [r4] + mov r0, r5, lsr 30 + bic r5, r5, 0xC0000000 + rsb r0, r0, 0x3 + mov r0, r0, lsl 3 + mov r6, r6, ror r0 + mov r7, r7, ror r0 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + ldmia sp!, {r8,r12,pc} + arm_func_end sub_82DF49C + + arm_func_start sub_82DF758 +sub_82DF758: @ 82DF758 + stmdb sp!, {r0,r2,r5-r7,lr} + mov r0, r3, lsr 6 + ldr r1, [r4, 0x3C] + cmp r0, r1 + beq _082DF7CC + str r0, [r4, 0x3C] + mov r1, 0x21 + mul r2, r1, r0 + ldr r1, [r4, 0x24] + add r2, r2, r1 + add r2, r2, 0x10 + ldr r5, _082DF7DC + ldr r6, _082DF7E0 + mov r7, 0x40 + ldrb lr, [r2], 0x1 + strb lr, [r5], 0x1 + ldrb r1, [r2], 0x1 + b _082DF7B4 +_082DF7A0: + ldrb r1, [r2], 0x1 + mov r0, r1, lsr 4 + ldrsb r0, [r6, r0] + add lr, lr, r0 + strb lr, [r5], 0x1 +_082DF7B4: + and r0, r1, 0xF + ldrsb r0, [r6, r0] + add lr, lr, r0 + strb lr, [r5], 0x1 + subs r7, r7, 0x2 + bgt _082DF7A0 +_082DF7CC: + ldr r5, _082DF7DC + and r0, r3, 0x3F + ldrsb r1, [r5, r0] + ldmia sp!, {r0,r2,r5-r7,pc} + .align 2, 0 +_082DF7DC: .4byte 0x03001300 +_082DF7E0: .4byte 0x08675a70 + arm_func_end sub_82DF758 + + .thumb + thumb_func_start SoundMainBTM +SoundMainBTM: @ 82DF7E4 + mov r12, r4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + movs r4, 0 + stm r0!, {r1-r4} + stm r0!, {r1-r4} + stm r0!, {r1-r4} + stm r0!, {r1-r4} + mov r4, r12 + bx lr + thumb_func_end SoundMainBTM + + thumb_func_start ClearChain +ClearChain: @ 82DF7FC + ldr r3, [r0, 0x2C] + cmp r3, 0 + beq _082DF81A + ldr r1, [r0, 0x34] + ldr r2, [r0, 0x30] + cmp r2, 0 + beq _082DF80E + str r1, [r2, 0x34] + b _082DF810 +_082DF80E: + str r1, [r3, 0x20] +_082DF810: + cmp r1, 0 + beq _082DF816 + str r2, [r1, 0x30] +_082DF816: + movs r1, 0 + str r1, [r0, 0x2C] +_082DF81A: + bx lr + thumb_func_end ClearChain + + thumb_func_start ply_fine +ply_fine: @ 82DF81C + push {r4,r5,lr} + adds r5, r1, 0 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _082DF840 +_082DF826: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _082DF834 + movs r0, 0x40 + orrs r1, r0 + strb r1, [r4] +_082DF834: + adds r0, r4, 0 + bl ClearChain + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _082DF826 +_082DF840: + movs r0, 0 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ply_fine + + thumb_func_start MPlyJmpTblCopy +MPlyJmpTblCopy: @ 82DF84C + mov r12, lr + movs r1, 0x24 + ldr r2, _082DF87C +_082DF852: + ldr r3, [r2] + bl chk_adr_r2 + stm r0!, {r3} + adds r2, 0x4 + subs r1, 0x1 + bgt _082DF852 + bx r12 + thumb_func_end MPlyJmpTblCopy + + thumb_func_start ldrb_r3_r2 +ldrb_r3_r2: @ 82DF864 + ldrb r3, [r2] + thumb_func_end ldrb_r3_r2 + + non_word_aligned_thumb_func_start chk_adr_r2 +chk_adr_r2: @ 82DF866 + push {r0} + lsrs r0, r2, 25 + bne _082DF878 + ldr r0, _082DF87C + cmp r2, r0 + bcc _082DF876 + lsrs r0, r2, 14 + beq _082DF878 +_082DF876: + movs r3, 0 +_082DF878: + pop {r0} + bx lr + .align 2, 0 +_082DF87C: .4byte 0x086759e0 + thumb_func_end chk_adr_r2 + + thumb_func_start ld_r3_tp_adr_i +ld_r3_tp_adr_i: @ 82DF880 + ldr r2, [r1, 0x40] +_082DF882: + adds r3, r2, 0x1 + str r3, [r1, 0x40] + ldrb r3, [r2] + b chk_adr_r2 + thumb_func_end ld_r3_tp_adr_i + + thumb_func_start ply_goto +ply_goto: @ 82DF88C + push {lr} +_082DF88E: + ldr r2, [r1, 0x40] + ldrb r0, [r2, 0x3] + lsls r0, 8 + ldrb r3, [r2, 0x2] + orrs r0, r3 + lsls r0, 8 + ldrb r3, [r2, 0x1] + orrs r0, r3 + lsls r0, 8 + bl ldrb_r3_r2 + orrs r0, r3 + str r0, [r1, 0x40] + pop {r0} + bx r0 + thumb_func_end ply_goto + + thumb_func_start ply_patt +ply_patt: @ 82DF8AC + ldrb r2, [r1, 0x2] + cmp r2, 0x3 + bcs _082DF8C4 + lsls r2, 2 + adds r3, r1, r2 + ldr r2, [r1, 0x40] + adds r2, 0x4 + str r2, [r3, 0x44] + ldrb r2, [r1, 0x2] + adds r2, 0x1 + strb r2, [r1, 0x2] + b ply_goto +_082DF8C4: + b ply_fine + thumb_func_end ply_patt + + thumb_func_start play_pend +play_pend: @ 82DF8C8 + ldrb r2, [r1, 0x2] + cmp r2, 0 + beq _082DF8DA + subs r2, 0x1 + strb r2, [r1, 0x2] + lsls r2, 2 + adds r3, r1, r2 + ldr r2, [r3, 0x44] + str r2, [r1, 0x40] +_082DF8DA: + bx lr + thumb_func_end play_pend + + thumb_func_start ply_rept +ply_rept: @ 82DF8DC + push {lr} + ldr r2, [r1, 0x40] + ldrb r3, [r2] + cmp r3, 0 + bne _082DF8EC + adds r2, 0x1 + str r2, [r1, 0x40] + b _082DF88E +_082DF8EC: + ldrb r3, [r1, 0x3] + adds r3, 0x1 + strb r3, [r1, 0x3] + mov r12, r3 + bl ld_r3_tp_adr_i + cmp r12, r3 + bcs _082DF8FE + b _082DF88E +_082DF8FE: + movs r3, 0 + strb r3, [r1, 0x3] + adds r2, 0x5 + str r2, [r1, 0x40] + pop {r0} + bx r0 + thumb_func_end ply_rept + + thumb_func_start ply_prio +ply_prio: @ 82DF90C + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, 0x1D] + bx r12 + thumb_func_end ply_prio + + thumb_func_start ply_tempo +ply_tempo: @ 82DF918 + mov r12, lr + bl ld_r3_tp_adr_i + lsls r3, 1 + strh r3, [r0, 0x1C] + ldrh r2, [r0, 0x1E] + muls r3, r2 + lsrs r3, 8 + strh r3, [r0, 0x20] + bx r12 + thumb_func_end ply_tempo + + thumb_func_start ply_keysh +ply_keysh: @ 82DF92C + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, 0xA] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end ply_keysh + + thumb_func_start ply_voice +ply_voice: @ 82DF940 + mov r12, lr + ldr r2, [r1, 0x40] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r1, 0x40] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 2 + ldr r3, [r0, 0x30] + adds r2, r3 + ldr r3, [r2] + bl chk_adr_r2 + str r3, [r1, 0x24] + ldr r3, [r2, 0x4] + bl chk_adr_r2 + str r3, [r1, 0x28] + ldr r3, [r2, 0x8] + bl chk_adr_r2 + str r3, [r1, 0x2C] + bx r12 + thumb_func_end ply_voice + + thumb_func_start ply_vol +ply_vol: @ 82DF970 + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, 0x12] + ldrb r3, [r1] + movs r2, 0x3 + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end ply_vol + + thumb_func_start ply_pan +ply_pan: @ 82DF984 + mov r12, lr + bl ld_r3_tp_adr_i + subs r3, 0x40 + strb r3, [r1, 0x14] + ldrb r3, [r1] + movs r2, 0x3 + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end ply_pan + + thumb_func_start ply_bend +ply_bend: @ 82DF998 + mov r12, lr + bl ld_r3_tp_adr_i + subs r3, 0x40 + strb r3, [r1, 0xE] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end ply_bend + + thumb_func_start ply_bendr +ply_bendr: @ 82DF9AC + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, 0xF] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end ply_bendr + + thumb_func_start ply_lfodl +ply_lfodl: @ 82DF9C0 + mov r12, lr + bl ld_r3_tp_adr_i + strb r3, [r1, 0x1B] + bx r12 + thumb_func_end ply_lfodl + + thumb_func_start ply_modt +ply_modt: @ 82DF9CC + mov r12, lr + bl ld_r3_tp_adr_i + ldrb r0, [r1, 0x18] + cmp r0, r3 + beq _082DF9E2 + strb r3, [r1, 0x18] + ldrb r3, [r1] + movs r2, 0xF + orrs r3, r2 + strb r3, [r1] +_082DF9E2: + bx r12 + thumb_func_end ply_modt + + thumb_func_start ply_tune +ply_tune: @ 82DF9E4 + mov r12, lr + bl ld_r3_tp_adr_i + subs r3, 0x40 + strb r3, [r1, 0xC] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end ply_tune + + thumb_func_start ply_port +ply_port: @ 82DF9F8 + mov r12, lr + ldr r2, [r1, 0x40] + ldrb r3, [r2] + adds r2, 0x1 + ldr r0, _082DFA0C + adds r0, r3 + bl _082DF882 + strb r3, [r0] + bx r12 + .align 2, 0 +_082DFA0C: .4byte 0x04000060 + thumb_func_end ply_port + + thumb_func_start SoundVSync_rev01 +SoundVSync_rev01: @ 82DFA10 + ldr r0, _082DFCBC + ldr r0, [r0] + ldr r2, _082DFCC0 + ldr r3, [r0] + subs r3, r2 + cmp r3, 0x1 + bhi _082DFA50 + ldrb r1, [r0, 0x4] + subs r1, 0x1 + strb r1, [r0, 0x4] + bgt _082DFA50 + ldrb r1, [r0, 0xB] + strb r1, [r0, 0x4] + ldr r2, _082DFA54 + ldr r1, [r2, 0x8] + lsls r1, 7 + bcc _082DFA36 + ldr r1, _082DFA58 + str r1, [r2, 0x8] +_082DFA36: + ldr r1, [r2, 0x14] + lsls r1, 7 + bcc _082DFA40 + ldr r1, _082DFA58 + str r1, [r2, 0x14] +_082DFA40: + movs r1, 0x4 + lsls r1, 8 + strh r1, [r2, 0xA] + strh r1, [r2, 0x16] + movs r1, 0xB6 + lsls r1, 8 + strh r1, [r2, 0xA] + strh r1, [r2, 0x16] +_082DFA50: + bx lr + .align 2, 0 +_082DFA54: .4byte 0x040000bc +_082DFA58: .4byte 0x84400004 + thumb_func_end SoundVSync_rev01 + + thumb_func_start MPlayMain_rev01 +MPlayMain_rev01: @ 82DFA5C + ldr r2, _082DFCC0 + ldr r3, [r0, 0x34] + cmp r2, r3 + beq _082DFA66 + bx lr +_082DFA66: + adds r3, 0x1 + str r3, [r0, 0x34] + push {r0,lr} + ldr r3, [r0, 0x38] + cmp r3, 0 + beq _082DFA78 + ldr r0, [r0, 0x3C] + bl _082DFCB4 +_082DFA78: + pop {r0} + push {r4-r7} + mov r4, r8 + mov r5, r9 + mov r6, r10 + mov r7, r11 + push {r4-r7} + adds r7, r0, 0 + ldr r0, [r7, 0x4] + cmp r0, 0 + bge _082DFA90 + b _082DFCA4 +_082DFA90: + ldr r0, _082DFCBC + ldr r0, [r0] + mov r8, r0 + adds r0, r7, 0 + bl FadeOutBody_rev01 + ldr r0, [r7, 0x4] + cmp r0, 0 + bge _082DFAA4 + b _082DFCA4 +_082DFAA4: + ldrh r0, [r7, 0x22] + ldrh r1, [r7, 0x20] + adds r0, r1 + b _082DFBF4 +_082DFAAC: + ldrb r6, [r7, 0x8] + ldr r5, [r7, 0x2C] + movs r3, 0x1 + movs r4, 0 +_082DFAB4: + ldrb r0, [r5] + movs r1, 0x80 + tst r1, r0 + bne _082DFABE + b _082DFBD0 +_082DFABE: + mov r10, r3 + orrs r4, r3 + mov r11, r4 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _082DFAF2 +_082DFACA: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _082DFAE6 + ldrb r0, [r4, 0x10] + cmp r0, 0 + beq _082DFAEC + subs r0, 0x1 + strb r0, [r4, 0x10] + bne _082DFAEC + movs r0, 0x40 + orrs r1, r0 + strb r1, [r4] + b _082DFAEC +_082DFAE6: + adds r0, r4, 0 + bl ClearChain_rev +_082DFAEC: + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _082DFACA +_082DFAF2: + ldrb r3, [r5] + movs r0, 0x40 + tst r0, r3 + beq _082DFB70 + adds r0, r5, 0 + bl Clear64byte_rev + movs r0, 0x80 + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0xF] + movs r0, 0x40 + strb r0, [r5, 0x13] + movs r0, 0x16 + strb r0, [r5, 0x19] + movs r0, 0x1 + adds r1, r5, 0x6 + strb r0, [r1, 0x1E] + b _082DFB70 +_082DFB18: + ldr r2, [r5, 0x40] + ldrb r1, [r2] + cmp r1, 0x80 + bcs _082DFB24 + ldrb r1, [r5, 0x7] + b _082DFB2E +_082DFB24: + adds r2, 0x1 + str r2, [r5, 0x40] + cmp r1, 0xBD + bcc _082DFB2E + strb r1, [r5, 0x7] +_082DFB2E: + cmp r1, 0xCF + bcc _082DFB44 + mov r0, r8 + ldr r3, [r0, 0x38] + adds r0, r1, 0 + subs r0, 0xCF + adds r1, r7, 0 + adds r2, r5, 0 + bl _082DFCB4 + b _082DFB70 +_082DFB44: + cmp r1, 0xB0 + bls _082DFB66 + adds r0, r1, 0 + subs r0, 0xB1 + strb r0, [r7, 0xA] + mov r3, r8 + ldr r3, [r3, 0x34] + lsls r0, 2 + ldr r3, [r3, r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl _082DFCB4 + ldrb r0, [r5] + cmp r0, 0 + beq _082DFBCC + b _082DFB70 +_082DFB66: + ldr r0, _082DFCB8 + subs r1, 0x80 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r5, 0x1] +_082DFB70: + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _082DFB18 + subs r0, 0x1 + strb r0, [r5, 0x1] + ldrb r1, [r5, 0x19] + cmp r1, 0 + beq _082DFBCC + ldrb r0, [r5, 0x17] + cmp r0, 0 + beq _082DFBCC + ldrb r0, [r5, 0x1C] + cmp r0, 0 + beq _082DFB92 + subs r0, 0x1 + strb r0, [r5, 0x1C] + b _082DFBCC +_082DFB92: + ldrb r0, [r5, 0x1A] + adds r0, r1 + strb r0, [r5, 0x1A] + adds r1, r0, 0 + subs r0, 0x40 + lsls r0, 24 + bpl _082DFBA6 + lsls r2, r1, 24 + asrs r2, 24 + b _082DFBAA +_082DFBA6: + movs r0, 0x80 + subs r2, r0, r1 +_082DFBAA: + ldrb r0, [r5, 0x17] + muls r0, r2 + asrs r2, r0, 6 + ldrb r0, [r5, 0x16] + eors r0, r2 + lsls r0, 24 + beq _082DFBCC + strb r2, [r5, 0x16] + ldrb r0, [r5] + ldrb r1, [r5, 0x18] + cmp r1, 0 + bne _082DFBC6 + movs r1, 0xC + b _082DFBC8 +_082DFBC6: + movs r1, 0x3 +_082DFBC8: + orrs r0, r1 + strb r0, [r5] +_082DFBCC: + mov r3, r10 + mov r4, r11 +_082DFBD0: + subs r6, 0x1 + ble _082DFBDC + movs r0, 0x50 + adds r5, r0 + lsls r3, 1 + b _082DFAB4 +_082DFBDC: + ldr r0, [r7, 0xC] + adds r0, 0x1 + str r0, [r7, 0xC] + cmp r4, 0 + bne _082DFBEE + movs r0, 0x80 + lsls r0, 24 + str r0, [r7, 0x4] + b _082DFCA4 +_082DFBEE: + str r4, [r7, 0x4] + ldrh r0, [r7, 0x22] + subs r0, 0x96 +_082DFBF4: + strh r0, [r7, 0x22] + cmp r0, 0x96 + bcc _082DFBFC + b _082DFAAC +_082DFBFC: + ldrb r2, [r7, 0x8] + ldr r5, [r7, 0x2C] +_082DFC00: + ldrb r0, [r5] + movs r1, 0x80 + tst r1, r0 + beq _082DFC9A + movs r1, 0xF + tst r1, r0 + beq _082DFC9A + mov r9, r2 + adds r0, r7, 0 + adds r1, r5, 0 + bl TrkVolPitSet_rev01 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _082DFC90 +_082DFC1E: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + bne _082DFC2E + adds r0, r4, 0 + bl ClearChain_rev + b _082DFC8A +_082DFC2E: + ldrb r0, [r4, 0x1] + movs r6, 0x7 + ands r6, r0 + ldrb r3, [r5] + movs r0, 0x3 + tst r0, r3 + beq _082DFC4C + bl ChnVolSetAsm + cmp r6, 0 + beq _082DFC4C + ldrb r0, [r4, 0x1D] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1D] +_082DFC4C: + ldrb r3, [r5] + movs r0, 0xC + tst r0, r3 + beq _082DFC8A + ldrb r1, [r4, 0x8] + movs r0, 0x8 + ldrsb r0, [r5, r0] + adds r2, r1, r0 + bpl _082DFC60 + movs r2, 0 +_082DFC60: + cmp r6, 0 + beq _082DFC7E + mov r0, r8 + ldr r3, [r0, 0x30] + adds r1, r2, 0 + ldrb r2, [r5, 0x9] + adds r0, r6, 0 + bl _082DFCB4 + str r0, [r4, 0x20] + ldrb r0, [r4, 0x1D] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1D] + b _082DFC8A +_082DFC7E: + adds r1, r2, 0 + ldrb r2, [r5, 0x9] + ldr r0, [r4, 0x24] + bl MidiKey2fr + str r0, [r4, 0x20] +_082DFC8A: + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _082DFC1E +_082DFC90: + ldrb r0, [r5] + movs r1, 0xF0 + ands r0, r1 + strb r0, [r5] + mov r2, r9 +_082DFC9A: + subs r2, 0x1 + ble _082DFCA4 + movs r0, 0x50 + adds r5, r0 + bgt _082DFC00 +_082DFCA4: + ldr r0, _082DFCC0 + str r0, [r7, 0x34] + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r3} +_082DFCB4: + bx r3 + .align 2, 0 +_082DFCB8: .4byte 0x08675c64 +_082DFCBC: .4byte 0x03007ff0 +_082DFCC0: .4byte 0x68736d53 + thumb_func_end MPlayMain_rev01 + + thumb_func_start TrackStop_rev01 +TrackStop_rev01: @ 82DFCC4 + push {r4-r6,lr} + adds r5, r1, 0 + ldrb r1, [r5] + movs r0, 0x80 + tst r0, r1 + beq _082DFCFC + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _082DFCFA + movs r6, 0 +_082DFCD8: + ldrb r0, [r4] + cmp r0, 0 + beq _082DFCF2 + ldrb r0, [r4, 0x1] + movs r3, 0x7 + ands r0, r3 + beq _082DFCF0 + ldr r3, _082DFD04 + ldr r3, [r3] + ldr r3, [r3, 0x2C] + bl _082DFCB4 +_082DFCF0: + strb r6, [r4] +_082DFCF2: + str r6, [r4, 0x2C] + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _082DFCD8 +_082DFCFA: + str r4, [r5, 0x20] +_082DFCFC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082DFD04: .4byte 0x03007ff0 + thumb_func_end TrackStop_rev01 + + thumb_func_start ChnVolSetAsm +ChnVolSetAsm: @ 82DFD08 + ldrb r1, [r4, 0x12] + movs r0, 0x14 + ldrsb r2, [r4, r0] + movs r3, 0x80 + adds r3, r2 + muls r3, r1 + ldrb r0, [r5, 0x10] + muls r0, r3 + asrs r0, 14 + cmp r0, 0xFF + bls _082DFD20 + movs r0, 0xFF +_082DFD20: + strb r0, [r4, 0x2] + movs r3, 0x7F + subs r3, r2 + muls r3, r1 + ldrb r0, [r5, 0x11] + muls r0, r3 + asrs r0, 14 + cmp r0, 0xFF + bls _082DFD34 + movs r0, 0xFF +_082DFD34: + strb r0, [r4, 0x3] + bx lr + thumb_func_end ChnVolSetAsm + + thumb_func_start ply_note_rev01 +ply_note_rev01: @ 82DFD38 + push {r4-r7,lr} + mov r4, r8 + mov r5, r9 + mov r6, r10 + mov r7, r11 + push {r4-r7} + sub sp, 0x18 + str r1, [sp] + adds r5, r2, 0 + ldr r1, _082DFF34 + ldr r1, [r1] + str r1, [sp, 0x4] + ldr r1, _082DFF38 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r5, 0x4] + ldr r3, [r5, 0x40] + ldrb r0, [r3] + cmp r0, 0x80 + bcs _082DFD7E + strb r0, [r5, 0x5] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0x80 + bcs _082DFD7C + strb r0, [r5, 0x6] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0x80 + bcs _082DFD7C + ldrb r1, [r5, 0x4] + adds r1, r0 + strb r1, [r5, 0x4] + adds r3, 0x1 +_082DFD7C: + str r3, [r5, 0x40] +_082DFD7E: + movs r0, 0 + str r0, [sp, 0x14] + adds r4, r5, 0 + adds r4, 0x24 + ldrb r2, [r4] + movs r0, 0xC0 + tst r0, r2 + beq _082DFDD0 + ldrb r3, [r5, 0x5] + movs r0, 0x40 + tst r0, r2 + beq _082DFD9E + ldr r1, [r5, 0x2C] + adds r1, r3 + ldrb r0, [r1] + b _082DFDA0 +_082DFD9E: + adds r0, r3, 0 +_082DFDA0: + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, [r5, 0x28] + adds r1, r0 + mov r9, r1 + mov r6, r9 + ldrb r1, [r6] + movs r0, 0xC0 + tst r0, r1 + beq _082DFDB8 + b _082DFF22 +_082DFDB8: + movs r0, 0x80 + tst r0, r2 + beq _082DFDD4 + ldrb r1, [r6, 0x3] + movs r0, 0x80 + tst r0, r1 + beq _082DFDCC + subs r1, 0xC0 + lsls r1, 1 + str r1, [sp, 0x14] +_082DFDCC: + ldrb r3, [r6, 0x1] + b _082DFDD4 +_082DFDD0: + mov r9, r4 + ldrb r3, [r5, 0x5] +_082DFDD4: + str r3, [sp, 0x8] + ldr r6, [sp] + ldrb r1, [r6, 0x9] + ldrb r0, [r5, 0x1D] + adds r0, r1 + cmp r0, 0xFF + bls _082DFDE4 + movs r0, 0xFF +_082DFDE4: + str r0, [sp, 0x10] + mov r6, r9 + ldrb r0, [r6] + movs r6, 0x7 + ands r6, r0 + str r6, [sp, 0xC] + beq _082DFE24 + ldr r0, [sp, 0x4] + ldr r4, [r0, 0x1C] + cmp r4, 0 + bne _082DFDFC + b _082DFF22 +_082DFDFC: + subs r6, 0x1 + lsls r0, r6, 6 + adds r4, r0 + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _082DFE78 + movs r0, 0x40 + tst r0, r1 + bne _082DFE78 + ldrb r1, [r4, 0x13] + ldr r0, [sp, 0x10] + cmp r1, r0 + bcc _082DFE78 + beq _082DFE1C + b _082DFF22 +_082DFE1C: + ldr r0, [r4, 0x2C] + cmp r0, r5 + bcs _082DFE78 + b _082DFF22 +_082DFE24: + ldr r6, [sp, 0x10] + adds r7, r5, 0 + movs r2, 0 + mov r8, r2 + ldr r4, [sp, 0x4] + ldrb r3, [r4, 0x6] + adds r4, 0x50 +_082DFE32: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _082DFE78 + movs r0, 0x40 + tst r0, r1 + beq _082DFE4C + cmp r2, 0 + bne _082DFE50 + adds r2, 0x1 + ldrb r6, [r4, 0x13] + ldr r7, [r4, 0x2C] + b _082DFE6A +_082DFE4C: + cmp r2, 0 + bne _082DFE6C +_082DFE50: + ldrb r0, [r4, 0x13] + cmp r0, r6 + bcs _082DFE5C + adds r6, r0, 0 + ldr r7, [r4, 0x2C] + b _082DFE6A +_082DFE5C: + bhi _082DFE6C + ldr r0, [r4, 0x2C] + cmp r0, r7 + bls _082DFE68 + adds r7, r0, 0 + b _082DFE6A +_082DFE68: + bcc _082DFE6C +_082DFE6A: + mov r8, r4 +_082DFE6C: + adds r4, 0x40 + subs r3, 0x1 + bgt _082DFE32 + mov r4, r8 + cmp r4, 0 + beq _082DFF22 +_082DFE78: + adds r0, r4, 0 + bl ClearChain_rev + movs r1, 0 + str r1, [r4, 0x30] + ldr r3, [r5, 0x20] + str r3, [r4, 0x34] + cmp r3, 0 + beq _082DFE8C + str r4, [r3, 0x30] +_082DFE8C: + str r4, [r5, 0x20] + str r5, [r4, 0x2C] + ldrb r0, [r5, 0x1B] + strb r0, [r5, 0x1C] + cmp r0, r1 + beq _082DFE9E + adds r1, r5, 0 + bl clear_modM +_082DFE9E: + ldr r0, [sp] + adds r1, r5, 0 + bl TrkVolPitSet_rev01 + ldr r0, [r5, 0x4] + str r0, [r4, 0x10] + ldr r0, [sp, 0x10] + strb r0, [r4, 0x13] + ldr r0, [sp, 0x8] + strb r0, [r4, 0x8] + ldr r0, [sp, 0x14] + strb r0, [r4, 0x14] + mov r6, r9 + ldrb r0, [r6] + strb r0, [r4, 0x1] + ldr r7, [r6, 0x4] + str r7, [r4, 0x24] + ldr r0, [r6, 0x8] + str r0, [r4, 0x4] + ldrh r0, [r5, 0x1E] + strh r0, [r4, 0xC] + bl ChnVolSetAsm + ldrb r1, [r4, 0x8] + movs r0, 0x8 + ldrsb r0, [r5, r0] + adds r3, r1, r0 + bpl _082DFED8 + movs r3, 0 +_082DFED8: + ldr r6, [sp, 0xC] + cmp r6, 0 + beq _082DFF06 + mov r6, r9 + ldrb r0, [r6, 0x2] + strb r0, [r4, 0x1E] + ldrb r1, [r6, 0x3] + movs r0, 0x80 + tst r0, r1 + bne _082DFEF2 + movs r0, 0x70 + tst r0, r1 + bne _082DFEF4 +_082DFEF2: + movs r1, 0x8 +_082DFEF4: + strb r1, [r4, 0x1F] + ldrb r2, [r5, 0x9] + adds r1, r3, 0 + ldr r0, [sp, 0xC] + ldr r3, [sp, 0x4] + ldr r3, [r3, 0x30] + bl _082DFCB4 + b _082DFF14 +_082DFF06: + ldr r0, [r5, 0x3C] + str r0, [r4, 0x18] + ldrb r2, [r5, 0x9] + adds r1, r3, 0 + adds r0, r7, 0 + bl MidiKey2fr +_082DFF14: + str r0, [r4, 0x20] + movs r0, 0x80 + strb r0, [r4] + ldrb r1, [r5] + movs r0, 0xF0 + ands r0, r1 + strb r0, [r5] +_082DFF22: + add sp, 0x18 + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r0} + bx r0 + .align 2, 0 +_082DFF34: .4byte 0x03007ff0 +_082DFF38: .4byte 0x08675c64 + thumb_func_end ply_note_rev01 + + thumb_func_start ply_endtie_rev01 +ply_endtie_rev01: @ 82DFF3C + push {r4,r5} + ldr r2, [r1, 0x40] + ldrb r3, [r2] + cmp r3, 0x80 + bcs _082DFF4E + strb r3, [r1, 0x5] + adds r2, 0x1 + str r2, [r1, 0x40] + b _082DFF50 +_082DFF4E: + ldrb r3, [r1, 0x5] +_082DFF50: + ldr r1, [r1, 0x20] + cmp r1, 0 + beq _082DFF78 + movs r4, 0x83 + movs r5, 0x40 +_082DFF5A: + ldrb r2, [r1] + tst r2, r4 + beq _082DFF72 + tst r2, r5 + bne _082DFF72 + ldrb r0, [r1, 0x11] + cmp r0, r3 + bne _082DFF72 + movs r0, 0x40 + orrs r2, r0 + strb r2, [r1] + b _082DFF78 +_082DFF72: + ldr r1, [r1, 0x34] + cmp r1, 0 + bne _082DFF5A +_082DFF78: + pop {r4,r5} + bx lr + thumb_func_end ply_endtie_rev01 + + thumb_func_start clear_modM +clear_modM: @ 82DFF7C + movs r2, 0 + strb r2, [r1, 0x16] + strb r2, [r1, 0x1A] + ldrb r2, [r1, 0x18] + cmp r2, 0 + bne _082DFF8C + movs r2, 0xC + b _082DFF8E +_082DFF8C: + movs r2, 0x3 +_082DFF8E: + ldrb r3, [r1] + orrs r3, r2 + strb r3, [r1] + bx lr + thumb_func_end clear_modM + + thumb_func_start ld_r3_tp_adr_i_rev +ld_r3_tp_adr_i_rev: @ 82DFF98 + ldr r2, [r1, 0x40] + adds r3, r2, 0x1 + str r3, [r1, 0x40] + ldrb r3, [r2] + bx lr + thumb_func_end ld_r3_tp_adr_i_rev + + thumb_func_start ply_lfos_rev01 +ply_lfos_rev01: @ 82DFFA4 + mov r12, lr + bl ld_r3_tp_adr_i_rev + strb r3, [r1, 0x19] + cmp r3, 0 + bne _082DFFB4 + bl clear_modM +_082DFFB4: + bx r12 + thumb_func_end ply_lfos_rev01 + + thumb_func_start ply_mod_rev01 +ply_mod_rev01: @ 82DFFB8 + mov r12, lr + bl ld_r3_tp_adr_i_rev + strb r3, [r1, 0x17] + cmp r3, 0 + bne _082DFFC8 + bl clear_modM +_082DFFC8: + bx r12 + thumb_func_end ply_mod_rev01 + + thumb_func_start MidiKey2fr +MidiKey2fr: @ 82DFFCC + push {r4-r7,lr} + mov r12, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r7, r2, 24 + cmp r6, 0xB2 + bls _082DFFE0 + movs r6, 0xB2 + movs r7, 0xFF + lsls r7, 24 +_082DFFE0: + ldr r3, _082E0028 + adds r0, r6, r3 + ldrb r5, [r0] + ldr r4, _082E002C + movs r2, 0xF + adds r0, r5, 0 + ands r0, r2 + lsls r0, 2 + adds r0, r4 + lsrs r1, r5, 4 + ldr r5, [r0] + lsrs r5, r1 + adds r0, r6, 0x1 + adds r0, r3 + ldrb r1, [r0] + adds r0, r1, 0 + ands r0, r2 + lsls r0, 2 + adds r0, r4 + lsrs r1, 4 + ldr r0, [r0] + lsrs r0, r1 + mov r1, r12 + ldr r4, [r1, 0x4] + subs r0, r5 + adds r1, r7, 0 + bl umul3232H32 + adds r1, r0, 0 + adds r1, r5, r1 + adds r0, r4, 0 + bl umul3232H32 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E0028: .4byte 0x08675a80 +_082E002C: .4byte 0x08675b34 + thumb_func_end MidiKey2fr + + thumb_func_start DummyFunc +DummyFunc: @ 82E0030 + bx lr + thumb_func_end DummyFunc + + thumb_func_start MPlayContinue +MPlayContinue: @ 82E0034 + adds r2, r0, 0 + ldr r3, [r2, 0x34] + ldr r0, _082E0048 + cmp r3, r0 + bne _082E0046 + ldr r0, [r2, 0x4] + ldr r1, _082E004C + ands r0, r1 + str r0, [r2, 0x4] +_082E0046: + bx lr + .align 2, 0 +_082E0048: .4byte 0x68736d53 +_082E004C: .4byte 0x7fffffff + thumb_func_end MPlayContinue + + thumb_func_start MPlayFadeOut +MPlayFadeOut: @ 82E0050 + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _082E006C + cmp r3, r0 + bne _082E0068 + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r2, 0x28] +_082E0068: + bx lr + .align 2, 0 +_082E006C: .4byte 0x68736d53 + thumb_func_end MPlayFadeOut + + thumb_func_start m4aSoundInit +m4aSoundInit: @ 82E0070 + push {r4-r6,lr} + ldr r0, _082E00F0 + movs r1, 0x2 + negs r1, r1 + ands r0, r1 + ldr r1, _082E00F4 + ldr r2, _082E00F8 + bl CpuSet + ldr r0, _082E00FC + bl SoundInit_rev01 + ldr r0, _082E0100 + bl MPlayExtender + ldr r0, _082E0104 + bl SoundMode_rev01 + ldr r0, _082E0108 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _082E00BE + ldr r6, _082E010C + adds r5, r0, 0 +_082E00A2: + ldr r4, [r6] + ldr r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + adds r0, r4, 0 + bl MPlayOpen_rev01 + ldrh r0, [r6, 0xA] + strb r0, [r4, 0xB] + ldr r0, _082E0110 + str r0, [r4, 0x18] + adds r6, 0xC + subs r5, 0x1 + cmp r5, 0 + bne _082E00A2 +_082E00BE: + ldr r0, _082E0114 + ldr r1, _082E0118 + movs r2, 0x34 + bl memcpy + movs r5, 0 + movs r6, 0 +_082E00CC: + lsls r0, r5, 6 + ldr r1, _082E011C + adds r0, r1 + ldr r4, _082E0120 + adds r4, r6, r4 + adds r1, r4, 0 + movs r2, 0x2 + bl MPlayOpen_rev01 + movs r0, 0 + str r0, [r4, 0x20] + adds r6, 0xA0 + adds r5, 0x1 + cmp r5, 0x1 + ble _082E00CC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E00F0: .4byte SoundMainRAM + 1 +_082E00F4: .4byte 0x03001aa8 +_082E00F8: .4byte 0x04000200 +_082E00FC: .4byte 0x03006380 +_082E0100: .4byte 0x030074f0 +_082E0104: .4byte 0x0094c500 +_082E0108: .4byte 0x00000004 +_082E010C: .4byte 0x086b49c0 +_082E0110: .4byte 0x030077f0 +_082E0114: .4byte 0x030077b0 +_082E0118: .4byte 0x08675c98 +_082E011C: .4byte 0x030073a0 +_082E0120: .4byte 0x03007670 + thumb_func_end m4aSoundInit + + thumb_func_start m4aSoundMain +m4aSoundMain: @ 82E0124 + push {lr} + bl SoundMain + pop {r0} + bx r0 + thumb_func_end m4aSoundMain + + thumb_func_start m4aSongNumStart +m4aSongNumStart: @ 82E0130 + push {lr} + lsls r0, 16 + ldr r2, _082E0154 + ldr r1, _082E0158 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, [r0] + adds r0, r2, 0 + bl MPlayStart_rev01 + pop {r0} + bx r0 + .align 2, 0 +_082E0154: .4byte 0x086b49c0 +_082E0158: .4byte 0x086b49f0 + thumb_func_end m4aSongNumStart + + thumb_func_start m4aSongNumStartOrChange +m4aSongNumStartOrChange: @ 82E015C + push {lr} + lsls r0, 16 + ldr r2, _082E0188 + ldr r1, _082E018C + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + ldr r3, [r1] + ldr r2, [r0] + cmp r3, r2 + beq _082E0190 + adds r0, r1, 0 + adds r1, r2, 0 + bl MPlayStart_rev01 + b _082E01A4 + .align 2, 0 +_082E0188: .4byte 0x086b49c0 +_082E018C: .4byte 0x086b49f0 +_082E0190: + ldr r2, [r1, 0x4] + ldrh r0, [r1, 0x4] + cmp r0, 0 + beq _082E019C + cmp r2, 0 + bge _082E01A4 +_082E019C: + adds r0, r1, 0 + adds r1, r3, 0 + bl MPlayStart_rev01 +_082E01A4: + pop {r0} + bx r0 + thumb_func_end m4aSongNumStartOrChange + + thumb_func_start m4aSongNumStartOrContinue +m4aSongNumStartOrContinue: @ 82E01A8 + push {lr} + lsls r0, 16 + ldr r2, _082E01D4 + ldr r1, _082E01D8 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + ldr r3, [r1] + ldr r2, [r0] + cmp r3, r2 + beq _082E01DC + adds r0, r1, 0 + adds r1, r2, 0 + bl MPlayStart_rev01 + b _082E01F8 + .align 2, 0 +_082E01D4: .4byte 0x086b49c0 +_082E01D8: .4byte 0x086b49f0 +_082E01DC: + ldr r2, [r1, 0x4] + ldrh r0, [r1, 0x4] + cmp r0, 0 + bne _082E01EE + adds r0, r1, 0 + adds r1, r3, 0 + bl MPlayStart_rev01 + b _082E01F8 +_082E01EE: + cmp r2, 0 + bge _082E01F8 + adds r0, r1, 0 + bl MPlayContinue +_082E01F8: + pop {r0} + bx r0 + thumb_func_end m4aSongNumStartOrContinue + + thumb_func_start m4aSongNumStop +m4aSongNumStop: @ 82E01FC + push {lr} + lsls r0, 16 + ldr r2, _082E0228 + ldr r1, _082E022C + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, [r2] + ldr r0, [r0] + cmp r1, r0 + bne _082E0222 + adds r0, r2, 0 + bl MPlayStop_rev01 +_082E0222: + pop {r0} + bx r0 + .align 2, 0 +_082E0228: .4byte 0x086b49c0 +_082E022C: .4byte 0x086b49f0 + thumb_func_end m4aSongNumStop + + thumb_func_start m4aSongNumContinue +m4aSongNumContinue: @ 82E0230 + push {lr} + lsls r0, 16 + ldr r2, _082E025C + ldr r1, _082E0260 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, [r2] + ldr r0, [r0] + cmp r1, r0 + bne _082E0256 + adds r0, r2, 0 + bl MPlayContinue +_082E0256: + pop {r0} + bx r0 + .align 2, 0 +_082E025C: .4byte 0x086b49c0 +_082E0260: .4byte 0x086b49f0 + thumb_func_end m4aSongNumContinue + + thumb_func_start m4aMPlayAllStop +m4aMPlayAllStop: @ 82E0264 + push {r4,r5,lr} + ldr r0, _082E029C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _082E0282 + ldr r5, _082E02A0 + adds r4, r0, 0 +_082E0274: + ldr r0, [r5] + bl MPlayStop_rev01 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bne _082E0274 +_082E0282: + ldr r5, _082E02A4 + movs r4, 0x1 +_082E0286: + adds r0, r5, 0 + bl MPlayStop_rev01 + adds r5, 0x40 + subs r4, 0x1 + cmp r4, 0 + bge _082E0286 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E029C: .4byte 0x00000004 +_082E02A0: .4byte 0x086b49c0 +_082E02A4: .4byte 0x030073a0 + thumb_func_end m4aMPlayAllStop + + thumb_func_start m4aMPlayContinue +m4aMPlayContinue: @ 82E02A8 + push {lr} + bl MPlayContinue + pop {r0} + bx r0 + thumb_func_end m4aMPlayContinue + + thumb_func_start m4aMPlayAllContinue +m4aMPlayAllContinue: @ 82E02B2 + push {r4,r5,lr} + ldr r0, _082E02EC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _082E02D2 + ldr r5, _082E02F0 + adds r4, r0, 0 +_082E02C4: + ldr r0, [r5] + bl MPlayContinue + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bne _082E02C4 +_082E02D2: + ldr r5, _082E02F4 + movs r4, 0x1 +_082E02D6: + adds r0, r5, 0 + bl MPlayContinue + adds r5, 0x40 + subs r4, 0x1 + cmp r4, 0 + bge _082E02D6 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E02EC: .4byte 0x00000004 +_082E02F0: .4byte 0x086b49c0 +_082E02F4: .4byte 0x030073a0 + thumb_func_end m4aMPlayAllContinue + + thumb_func_start m4aMPlayFadeOut +m4aMPlayFadeOut: @ 82E02F8 + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl MPlayFadeOut + pop {r0} + bx r0 + thumb_func_end m4aMPlayFadeOut + + thumb_func_start sub_82E0308 +sub_82E0308: @ 82E0308 + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _082E0320 + cmp r3, r0 + bne _082E031E + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + ldr r0, _082E0324 + strh r0, [r2, 0x28] +_082E031E: + bx lr + .align 2, 0 +_082E0320: .4byte 0x68736d53 +_082E0324: .4byte 0x00000101 + thumb_func_end sub_82E0308 + + thumb_func_start sub_82E0328 +sub_82E0328: @ 82E0328 + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _082E0348 + cmp r3, r0 + bne _082E0346 + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + movs r0, 0x2 + strh r0, [r2, 0x28] + ldr r0, [r2, 0x4] + ldr r1, _082E034C + ands r0, r1 + str r0, [r2, 0x4] +_082E0346: + bx lr + .align 2, 0 +_082E0348: .4byte 0x68736d53 +_082E034C: .4byte 0x7fffffff + thumb_func_end sub_82E0328 + + thumb_func_start m4aMPlayImmInit +m4aMPlayImmInit: @ 82E0350 + push {r4-r7,lr} + ldrb r5, [r0, 0x8] + ldr r4, [r0, 0x2C] + cmp r5, 0 + ble _082E0392 + movs r7, 0x80 +_082E035C: + ldrb r1, [r4] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _082E038A + movs r6, 0x40 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _082E038A + adds r0, r4, 0 + bl Clear64byte_rev + strb r7, [r4] + movs r0, 0x2 + strb r0, [r4, 0xF] + strb r6, [r4, 0x13] + movs r0, 0x16 + strb r0, [r4, 0x19] + adds r1, r4, 0 + adds r1, 0x24 + movs r0, 0x1 + strb r0, [r1] +_082E038A: + subs r5, 0x1 + adds r4, 0x50 + cmp r5, 0 + bgt _082E035C +_082E0392: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end m4aMPlayImmInit + + thumb_func_start MPlayExtender +MPlayExtender: @ 82E0398 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r1, _082E0460 + movs r0, 0x8F + strh r0, [r1] + ldr r3, _082E0464 + movs r2, 0 + strh r2, [r3] + ldr r0, _082E0468 + movs r1, 0x8 + strb r1, [r0] + adds r0, 0x6 + strb r1, [r0] + adds r0, 0x10 + strb r1, [r0] + subs r0, 0x14 + movs r1, 0x80 + strb r1, [r0] + adds r0, 0x8 + strb r1, [r0] + adds r0, 0x10 + strb r1, [r0] + subs r0, 0xD + strb r2, [r0] + movs r0, 0x77 + strb r0, [r3] + ldr r0, _082E046C + ldr r4, [r0] + ldr r6, [r4] + ldr r0, _082E0470 + cmp r6, r0 + bne _082E0458 + adds r0, r6, 0x1 + str r0, [r4] + ldr r1, _082E0474 + ldr r0, _082E0478 + str r0, [r1, 0x20] + ldr r0, _082E047C + str r0, [r1, 0x44] + ldr r0, _082E0480 + str r0, [r1, 0x4C] + ldr r0, _082E0484 + str r0, [r1, 0x70] + ldr r0, _082E0488 + str r0, [r1, 0x74] + ldr r0, _082E048C + str r0, [r1, 0x78] + ldr r0, _082E0490 + str r0, [r1, 0x7C] + adds r2, r1, 0 + adds r2, 0x80 + ldr r0, _082E0494 + str r0, [r2] + adds r1, 0x84 + ldr r0, _082E0498 + str r0, [r1] + str r5, [r4, 0x1C] + ldr r0, _082E049C + str r0, [r4, 0x28] + ldr r0, _082E04A0 + str r0, [r4, 0x2C] + ldr r0, _082E04A4 + str r0, [r4, 0x30] + ldr r0, _082E04A8 + movs r1, 0 + strb r0, [r4, 0xC] + str r1, [sp] + ldr r2, _082E04AC + mov r0, sp + adds r1, r5, 0 + bl CpuSet + movs r0, 0x1 + strb r0, [r5, 0x1] + movs r0, 0x11 + strb r0, [r5, 0x1C] + adds r1, r5, 0 + adds r1, 0x41 + movs r0, 0x2 + strb r0, [r1] + adds r1, 0x1B + movs r0, 0x22 + strb r0, [r1] + adds r1, 0x25 + movs r0, 0x3 + strb r0, [r1] + adds r1, 0x1B + movs r0, 0x44 + strb r0, [r1] + adds r1, 0x24 + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x88 + strb r0, [r1, 0x1C] + str r6, [r4] +_082E0458: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E0460: .4byte 0x04000084 +_082E0464: .4byte 0x04000080 +_082E0468: .4byte 0x04000063 +_082E046C: .4byte 0x03007ff0 +_082E0470: .4byte 0x68736d53 +_082E0474: .4byte 0x03007460 +_082E0478: .4byte ply_memacc + 1 +_082E047C: .4byte ply_lfos_rev01 + 1 +_082E0480: .4byte ply_mod_rev01 + 1 +_082E0484: .4byte ply_xcmd + 1 +_082E0488: .4byte ply_endtie_rev01 + 1 +_082E048C: .4byte SampFreqSet_rev01 + 1 +_082E0490: .4byte TrackStop_rev01 + 1 +_082E0494: .4byte FadeOutBody_rev01 + 1 +_082E0498: .4byte TrkVolPitSet_rev01 + 1 +_082E049C: .4byte CgbSound + 1 +_082E04A0: .4byte CgbOscOff + 1 +_082E04A4: .4byte MidiKey2CgbFr + 1 +_082E04A8: .4byte 0x00000000 +_082E04AC: .4byte 0x05000040 + thumb_func_end MPlayExtender + + thumb_func_start MusicPlayerJumpTableCopy +MusicPlayerJumpTableCopy: @ 82E04B0 + swi 0x2A + bx lr + thumb_func_end MusicPlayerJumpTableCopy + + thumb_func_start ClearChain_rev +ClearChain_rev: @ 82E04B4 + push {lr} + ldr r1, _082E04C4 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_082E04C4: .4byte 0x030074e8 + thumb_func_end ClearChain_rev + + thumb_func_start Clear64byte_rev +Clear64byte_rev: @ 82E04C8 + push {lr} + ldr r1, _082E04D8 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_082E04D8: .4byte 0x030074ec + thumb_func_end Clear64byte_rev + + thumb_func_start SoundInit_rev01 +SoundInit_rev01: @ 82E04DC + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r3, 0 + str r3, [r5] + ldr r1, _082E0594 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 18 + ands r0, r2 + cmp r0, 0 + beq _082E04F8 + ldr r0, _082E0598 + str r0, [r1] +_082E04F8: + ldr r1, _082E059C + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _082E0506 + ldr r0, _082E0598 + str r0, [r1] +_082E0506: + ldr r0, _082E05A0 + movs r2, 0x80 + lsls r2, 3 + adds r1, r2, 0 + strh r1, [r0] + adds r0, 0xC + strh r1, [r0] + ldr r1, _082E05A4 + movs r0, 0x8F + strh r0, [r1] + subs r1, 0x2 + ldr r2, _082E05A8 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, _082E05AC + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, _082E05B0 + movs r2, 0xD4 + lsls r2, 2 + adds r0, r5, r2 + str r0, [r1] + adds r1, 0x4 + ldr r0, _082E05B4 + str r0, [r1] + adds r1, 0x8 + movs r2, 0x98 + lsls r2, 4 + adds r0, r5, r2 + str r0, [r1] + adds r1, 0x4 + ldr r0, _082E05B8 + str r0, [r1] + ldr r0, _082E05BC + str r5, [r0] + str r3, [sp] + ldr r2, _082E05C0 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + movs r0, 0x8 + strb r0, [r5, 0x6] + movs r0, 0xF + strb r0, [r5, 0x7] + ldr r0, _082E05C4 + str r0, [r5, 0x38] + ldr r0, _082E05C8 + str r0, [r5, 0x28] + str r0, [r5, 0x2C] + str r0, [r5, 0x30] + str r0, [r5, 0x3C] + ldr r4, _082E05CC + adds r0, r4, 0 + bl MPlyJmpTblCopy + str r4, [r5, 0x34] + movs r0, 0x80 + lsls r0, 11 + bl SampFreqSet_rev01 + ldr r0, _082E05D0 + str r0, [r5] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E0594: .4byte 0x040000c4 +_082E0598: .4byte 0x84400004 +_082E059C: .4byte 0x040000d0 +_082E05A0: .4byte 0x040000c6 +_082E05A4: .4byte 0x04000084 +_082E05A8: .4byte 0x0000a90e +_082E05AC: .4byte 0x04000089 +_082E05B0: .4byte 0x040000bc +_082E05B4: .4byte 0x040000a0 +_082E05B8: .4byte 0x040000a4 +_082E05BC: .4byte 0x03007ff0 +_082E05C0: .4byte 0x050003ec +_082E05C4: .4byte ply_note_rev01 + 1 +_082E05C8: .4byte DummyFunc_rev + 1 +_082E05CC: .4byte 0x03007460 +_082E05D0: .4byte 0x68736d53 + thumb_func_end SoundInit_rev01 + + thumb_func_start SampFreqSet_rev01 +SampFreqSet_rev01: @ 82E05D4 + push {r4-r6,lr} + adds r2, r0, 0 + ldr r0, _082E0654 + ldr r4, [r0] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r2 + lsrs r2, r0, 16 + movs r6, 0 + strb r2, [r4, 0x8] + ldr r1, _082E0658 + subs r0, r2, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r5, [r0] + str r5, [r4, 0x10] + movs r0, 0xC6 + lsls r0, 3 + adds r1, r5, 0 + bl __divsi3 + strb r0, [r4, 0xB] + ldr r0, _082E065C + muls r0, r5 + ldr r1, _082E0660 + adds r0, r1 + ldr r1, _082E0664 + bl __divsi3 + adds r1, r0, 0 + str r1, [r4, 0x14] + movs r0, 0x80 + lsls r0, 17 + bl __divsi3 + adds r0, 0x1 + asrs r0, 1 + str r0, [r4, 0x18] + ldr r0, _082E0668 + strh r6, [r0] + ldr r4, _082E066C + ldr r0, _082E0670 + adds r1, r5, 0 + bl __divsi3 + negs r0, r0 + strh r0, [r4] + bl SoundVSyncOn_rev01 + ldr r1, _082E0674 +_082E0638: + ldrb r0, [r1] + cmp r0, 0x9F + beq _082E0638 + ldr r1, _082E0674 +_082E0640: + ldrb r0, [r1] + cmp r0, 0x9F + bne _082E0640 + ldr r1, _082E0668 + movs r0, 0x80 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E0654: .4byte 0x03007ff0 +_082E0658: .4byte 0x08675b64 +_082E065C: .4byte 0x00091d1b +_082E0660: .4byte 0x00001388 +_082E0664: .4byte 0x00002710 +_082E0668: .4byte 0x04000102 +_082E066C: .4byte 0x04000100 +_082E0670: .4byte 0x00044940 +_082E0674: .4byte 0x04000006 + thumb_func_end SampFreqSet_rev01 + + thumb_func_start SoundMode_rev01 +SoundMode_rev01: @ 82E0678 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, _082E0704 + ldr r5, [r0] + ldr r1, [r5] + ldr r0, _082E0708 + cmp r1, r0 + bne _082E06FE + adds r0, r1, 0x1 + str r0, [r5] + movs r4, 0xFF + ands r4, r3 + cmp r4, 0 + beq _082E069A + movs r0, 0x7F + ands r4, r0 + strb r4, [r5, 0x5] +_082E069A: + movs r4, 0xF0 + lsls r4, 4 + ands r4, r3 + cmp r4, 0 + beq _082E06BA + lsrs r0, r4, 8 + strb r0, [r5, 0x6] + movs r4, 0xC + adds r0, r5, 0 + adds r0, 0x50 + movs r1, 0 +_082E06B0: + strb r1, [r0] + subs r4, 0x1 + adds r0, 0x40 + cmp r4, 0 + bne _082E06B0 +_082E06BA: + movs r4, 0xF0 + lsls r4, 8 + ands r4, r3 + cmp r4, 0 + beq _082E06C8 + lsrs r0, r4, 12 + strb r0, [r5, 0x7] +_082E06C8: + movs r4, 0xB0 + lsls r4, 16 + ands r4, r3 + cmp r4, 0 + beq _082E06E6 + movs r0, 0xC0 + lsls r0, 14 + ands r0, r4 + lsrs r4, r0, 14 + ldr r2, _082E070C + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + orrs r0, r4 + strb r0, [r2] +_082E06E6: + movs r4, 0xF0 + lsls r4, 12 + ands r4, r3 + cmp r4, 0 + beq _082E06FA + bl SoundVSyncOff_rev01 + adds r0, r4, 0 + bl SampFreqSet_rev01 +_082E06FA: + ldr r0, _082E0708 + str r0, [r5] +_082E06FE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E0704: .4byte 0x03007ff0 +_082E0708: .4byte 0x68736d53 +_082E070C: .4byte 0x04000089 + thumb_func_end SoundMode_rev01 + + thumb_func_start SoundClear_rev01 +SoundClear_rev01: @ 82E0710 + push {r4-r7,lr} + ldr r0, _082E075C + ldr r6, [r0] + ldr r1, [r6] + ldr r0, _082E0760 + cmp r1, r0 + bne _082E0756 + adds r0, r1, 0x1 + str r0, [r6] + movs r5, 0xC + adds r4, r6, 0 + adds r4, 0x50 + movs r0, 0 +_082E072A: + strb r0, [r4] + subs r5, 0x1 + adds r4, 0x40 + cmp r5, 0 + bgt _082E072A + ldr r4, [r6, 0x1C] + cmp r4, 0 + beq _082E0752 + movs r5, 0x1 + movs r7, 0 +_082E073E: + lsls r0, r5, 24 + lsrs r0, 24 + ldr r1, [r6, 0x2C] + bl _call_via_r1 + strb r7, [r4] + adds r5, 0x1 + adds r4, 0x40 + cmp r5, 0x4 + ble _082E073E +_082E0752: + ldr r0, _082E0760 + str r0, [r6] +_082E0756: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E075C: .4byte 0x03007ff0 +_082E0760: .4byte 0x68736d53 + thumb_func_end SoundClear_rev01 + + thumb_func_start SoundVSyncOff_rev01 +SoundVSyncOff_rev01: @ 82E0764 + push {lr} + sub sp, 0x4 + ldr r0, _082E07C4 + ldr r2, [r0] + ldr r1, [r2] + ldr r3, _082E07C8 + adds r0, r1, r3 + cmp r0, 0x1 + bhi _082E07BC + adds r0, r1, 0 + adds r0, 0xA + str r0, [r2] + ldr r1, _082E07CC + ldr r0, [r1] + movs r3, 0x80 + lsls r3, 18 + ands r0, r3 + cmp r0, 0 + beq _082E078E + ldr r0, _082E07D0 + str r0, [r1] +_082E078E: + ldr r1, _082E07D4 + ldr r0, [r1] + ands r0, r3 + cmp r0, 0 + beq _082E079C + ldr r0, _082E07D0 + str r0, [r1] +_082E079C: + ldr r0, _082E07D8 + movs r3, 0x80 + lsls r3, 3 + adds r1, r3, 0 + strh r1, [r0] + adds r0, 0xC + strh r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xD4 + lsls r0, 2 + adds r1, r2, r0 + ldr r2, _082E07DC + mov r0, sp + bl CpuSet +_082E07BC: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_082E07C4: .4byte 0x03007ff0 +_082E07C8: .4byte 0x978c92ad +_082E07CC: .4byte 0x040000c4 +_082E07D0: .4byte 0x84400004 +_082E07D4: .4byte 0x040000d0 +_082E07D8: .4byte 0x040000c6 +_082E07DC: .4byte 0x05000318 + thumb_func_end SoundVSyncOff_rev01 + + thumb_func_start SoundVSyncOn_rev01 +SoundVSyncOn_rev01: @ 82E07E0 + push {r4,lr} + ldr r0, _082E0810 + ldr r2, [r0] + ldr r3, [r2] + ldr r0, _082E0814 + cmp r3, r0 + beq _082E0808 + ldr r0, _082E0818 + movs r4, 0xB6 + lsls r4, 8 + adds r1, r4, 0 + strh r1, [r0] + adds r0, 0xC + strh r1, [r0] + ldrb r0, [r2, 0x4] + movs r0, 0 + strb r0, [r2, 0x4] + adds r0, r3, 0 + subs r0, 0xA + str r0, [r2] +_082E0808: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E0810: .4byte 0x03007ff0 +_082E0814: .4byte 0x68736d53 +_082E0818: .4byte 0x040000c6 + thumb_func_end SoundVSyncOn_rev01 + + thumb_func_start MPlayOpen_rev01 +MPlayOpen_rev01: @ 82E081C + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0 + beq _082E0880 + cmp r4, 0x10 + bls _082E0830 + movs r4, 0x10 +_082E0830: + ldr r0, _082E0888 + ldr r5, [r0] + ldr r1, [r5] + ldr r0, _082E088C + cmp r1, r0 + bne _082E0880 + adds r0, r1, 0x1 + str r0, [r5] + adds r0, r7, 0 + bl Clear64byte_rev + str r6, [r7, 0x2C] + strb r4, [r7, 0x8] + movs r0, 0x80 + lsls r0, 24 + str r0, [r7, 0x4] + cmp r4, 0 + beq _082E0864 + movs r1, 0 +_082E0856: + strb r1, [r6] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, 0x50 + cmp r4, 0 + bne _082E0856 +_082E0864: + ldr r0, [r5, 0x20] + cmp r0, 0 + beq _082E0874 + str r0, [r7, 0x38] + ldr r0, [r5, 0x24] + str r0, [r7, 0x3C] + movs r0, 0 + str r0, [r5, 0x20] +_082E0874: + str r7, [r5, 0x24] + ldr r0, _082E0890 + str r0, [r5, 0x20] + ldr r0, _082E088C + str r0, [r5] + str r0, [r7, 0x34] +_082E0880: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E0888: .4byte 0x03007ff0 +_082E088C: .4byte 0x68736d53 +_082E0890: .4byte MPlayMain_rev01 + 1 + thumb_func_end MPlayOpen_rev01 + + thumb_func_start MPlayStart_rev01 +MPlayStart_rev01: @ 82E0894 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r7, r1, 0 + ldr r1, [r5, 0x34] + ldr r0, _082E0974 + cmp r1, r0 + bne _082E096A + ldrb r0, [r5, 0xB] + ldrb r2, [r7, 0x2] + cmp r0, 0 + beq _082E08D6 + ldr r0, [r5] + cmp r0, 0 + beq _082E08C0 + ldr r1, [r5, 0x2C] + movs r0, 0x40 + ldrb r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _082E08CC +_082E08C0: + ldr r1, [r5, 0x4] + ldrh r0, [r5, 0x4] + cmp r0, 0 + beq _082E08D6 + cmp r1, 0 + blt _082E08D6 +_082E08CC: + ldrb r0, [r7, 0x2] + adds r2, r0, 0 + ldrb r0, [r5, 0x9] + cmp r0, r2 + bhi _082E096A +_082E08D6: + ldr r0, [r5, 0x34] + adds r0, 0x1 + str r0, [r5, 0x34] + movs r1, 0 + str r1, [r5, 0x4] + str r7, [r5] + ldr r0, [r7, 0x4] + str r0, [r5, 0x30] + strb r2, [r5, 0x9] + str r1, [r5, 0xC] + movs r0, 0x96 + strh r0, [r5, 0x1C] + strh r0, [r5, 0x20] + adds r0, 0x6A + strh r0, [r5, 0x1E] + strh r1, [r5, 0x22] + strh r1, [r5, 0x24] + movs r6, 0 + ldr r4, [r5, 0x2C] + ldrb r1, [r7] + cmp r6, r1 + bge _082E0936 + ldrb r0, [r5, 0x8] + cmp r6, r0 + bge _082E0956 + mov r8, r6 +_082E090A: + adds r0, r5, 0 + adds r1, r4, 0 + bl TrackStop_rev01 + movs r0, 0xC0 + strb r0, [r4] + mov r1, r8 + str r1, [r4, 0x20] + lsls r1, r6, 2 + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x40] + adds r6, 0x1 + adds r4, 0x50 + ldrb r0, [r7] + cmp r6, r0 + bge _082E0936 + ldrb r1, [r5, 0x8] + cmp r6, r1 + blt _082E090A +_082E0936: + ldrb r0, [r5, 0x8] + cmp r6, r0 + bge _082E0956 + movs r1, 0 + mov r8, r1 +_082E0940: + adds r0, r5, 0 + adds r1, r4, 0 + bl TrackStop_rev01 + mov r0, r8 + strb r0, [r4] + adds r6, 0x1 + adds r4, 0x50 + ldrb r1, [r5, 0x8] + cmp r6, r1 + blt _082E0940 +_082E0956: + movs r0, 0x80 + ldrb r1, [r7, 0x3] + ands r0, r1 + cmp r0, 0 + beq _082E0966 + ldrb r0, [r7, 0x3] + bl SoundMode_rev01 +_082E0966: + ldr r0, _082E0974 + str r0, [r5, 0x34] +_082E096A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E0974: .4byte 0x68736d53 + thumb_func_end MPlayStart_rev01 + + thumb_func_start MPlayStop_rev01 +MPlayStop_rev01: @ 82E0978 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r1, [r6, 0x34] + ldr r0, _082E09B4 + cmp r1, r0 + bne _082E09AE + adds r0, r1, 0x1 + str r0, [r6, 0x34] + ldr r0, [r6, 0x4] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r6, 0x4] + ldrb r4, [r6, 0x8] + ldr r5, [r6, 0x2C] + cmp r4, 0 + ble _082E09AA +_082E099A: + adds r0, r6, 0 + adds r1, r5, 0 + bl TrackStop_rev01 + subs r4, 0x1 + adds r5, 0x50 + cmp r4, 0 + bgt _082E099A +_082E09AA: + ldr r0, _082E09B4 + str r0, [r6, 0x34] +_082E09AE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E09B4: .4byte 0x68736d53 + thumb_func_end MPlayStop_rev01 + + thumb_func_start FadeOutBody_rev01 +FadeOutBody_rev01: @ 82E09B8 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r1, [r6, 0x24] + cmp r1, 0 + beq _082E0A7A + ldrh r0, [r6, 0x26] + subs r0, 0x1 + strh r0, [r6, 0x26] + ldr r3, _082E09F8 + adds r2, r3, 0 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _082E0A7A + strh r1, [r6, 0x26] + ldrh r1, [r6, 0x28] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _082E09FC + adds r0, r1, 0 + adds r0, 0x10 + strh r0, [r6, 0x28] + ands r0, r2 + cmp r0, 0xFF + bls _082E0A4E + movs r0, 0x80 + lsls r0, 1 + strh r0, [r6, 0x28] + strh r3, [r6, 0x24] + b _082E0A4E + .align 2, 0 +_082E09F8: .4byte 0x0000ffff +_082E09FC: + adds r0, r1, 0 + subs r0, 0x10 + strh r0, [r6, 0x28] + ands r0, r2 + lsls r0, 16 + cmp r0, 0 + bgt _082E0A4E + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + cmp r5, 0 + ble _082E0A2E +_082E0A12: + adds r0, r6, 0 + adds r1, r4, 0 + bl TrackStop_rev01 + movs r0, 0x1 + ldrh r7, [r6, 0x28] + ands r0, r7 + cmp r0, 0 + bne _082E0A26 + strb r0, [r4] +_082E0A26: + subs r5, 0x1 + adds r4, 0x50 + cmp r5, 0 + bgt _082E0A12 +_082E0A2E: + movs r0, 0x1 + ldrh r1, [r6, 0x28] + ands r0, r1 + cmp r0, 0 + beq _082E0A42 + ldr r0, [r6, 0x4] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + b _082E0A46 +_082E0A42: + movs r0, 0x80 + lsls r0, 24 +_082E0A46: + str r0, [r6, 0x4] + movs r0, 0 + strh r0, [r6, 0x24] + b _082E0A7A +_082E0A4E: + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + cmp r5, 0 + ble _082E0A7A + movs r3, 0x80 + movs r7, 0 + movs r2, 0x3 +_082E0A5C: + ldrb r1, [r4] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _082E0A72 + ldrh r7, [r6, 0x28] + lsrs r0, r7, 2 + strb r0, [r4, 0x13] + adds r0, r1, 0 + orrs r0, r2 + strb r0, [r4] +_082E0A72: + subs r5, 0x1 + adds r4, 0x50 + cmp r5, 0 + bgt _082E0A5C +_082E0A7A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end FadeOutBody_rev01 + + thumb_func_start TrkVolPitSet_rev01 +TrkVolPitSet_rev01: @ 82E0A80 + push {r4,lr} + adds r2, r1, 0 + movs r0, 0x1 + ldrb r1, [r2] + ands r0, r1 + cmp r0, 0 + beq _082E0AE4 + ldrb r3, [r2, 0x13] + ldrb r1, [r2, 0x12] + adds r0, r3, 0 + muls r0, r1 + lsrs r3, r0, 5 + ldrb r4, [r2, 0x18] + cmp r4, 0x1 + bne _082E0AA8 + movs r0, 0x16 + ldrsb r0, [r2, r0] + adds r0, 0x80 + muls r0, r3 + lsrs r3, r0, 7 +_082E0AA8: + movs r0, 0x14 + ldrsb r0, [r2, r0] + lsls r0, 1 + movs r1, 0x15 + ldrsb r1, [r2, r1] + adds r1, r0, r1 + cmp r4, 0x2 + bne _082E0ABE + movs r0, 0x16 + ldrsb r0, [r2, r0] + adds r1, r0 +_082E0ABE: + movs r0, 0x80 + negs r0, r0 + cmp r1, r0 + bge _082E0ACA + adds r1, r0, 0 + b _082E0AD0 +_082E0ACA: + cmp r1, 0x7F + ble _082E0AD0 + movs r1, 0x7F +_082E0AD0: + adds r0, r1, 0 + adds r0, 0x80 + muls r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x10] + movs r0, 0x7F + subs r0, r1 + muls r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x11] +_082E0AE4: + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + adds r3, r1, 0 + cmp r0, 0 + beq _082E0B28 + movs r0, 0xE + ldrsb r0, [r2, r0] + ldrb r1, [r2, 0xF] + muls r0, r1 + movs r1, 0xC + ldrsb r1, [r2, r1] + adds r1, r0 + lsls r1, 2 + movs r0, 0xA + ldrsb r0, [r2, r0] + lsls r0, 8 + adds r1, r0 + movs r0, 0xB + ldrsb r0, [r2, r0] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0xD] + adds r1, r0, r1 + ldrb r0, [r2, 0x18] + cmp r0, 0 + bne _082E0B22 + movs r0, 0x16 + ldrsb r0, [r2, r0] + lsls r0, 4 + adds r1, r0 +_082E0B22: + asrs r0, r1, 8 + strb r0, [r2, 0x8] + strb r1, [r2, 0x9] +_082E0B28: + movs r0, 0xFA + ands r0, r3 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end TrkVolPitSet_rev01 + + thumb_func_start MidiKey2CgbFr +MidiKey2CgbFr: @ 82E0B34 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + cmp r0, 0x4 + bne _082E0B6C + cmp r5, 0x14 + bhi _082E0B50 + movs r5, 0 + b _082E0B5E +_082E0B50: + adds r0, r5, 0 + subs r0, 0x15 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3B + bls _082E0B5E + movs r5, 0x3B +_082E0B5E: + ldr r0, _082E0B68 + adds r0, r5, r0 + ldrb r0, [r0] + b _082E0BCE + .align 2, 0 +_082E0B68: .4byte 0x08675c18 +_082E0B6C: + cmp r5, 0x23 + bhi _082E0B78 + movs r0, 0 + mov r12, r0 + movs r5, 0 + b _082E0B8A +_082E0B78: + adds r0, r5, 0 + subs r0, 0x24 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x82 + bls _082E0B8A + movs r5, 0x82 + movs r1, 0xFF + mov r12, r1 +_082E0B8A: + ldr r3, _082E0BD4 + adds r0, r5, r3 + ldrb r6, [r0] + ldr r4, _082E0BD8 + movs r2, 0xF + adds r0, r6, 0 + ands r0, r2 + lsls r0, 1 + adds r0, r4 + movs r7, 0 + ldrsh r1, [r0, r7] + asrs r0, r6, 4 + adds r6, r1, 0 + asrs r6, r0 + adds r0, r5, 0x1 + adds r0, r3 + ldrb r1, [r0] + adds r0, r1, 0 + ands r0, r2 + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 4 + asrs r0, r1 + subs r0, r6 + mov r7, r12 + muls r7, r0 + adds r0, r7, 0 + asrs r0, 8 + adds r0, r6, r0 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1 +_082E0BCE: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E0BD4: .4byte 0x08675b7c +_082E0BD8: .4byte 0x08675c00 + thumb_func_end MidiKey2CgbFr + + thumb_func_start CgbOscOff +CgbOscOff: @ 82E0BDC + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x2 + beq _082E0C04 + cmp r0, 0x2 + bgt _082E0BF0 + cmp r0, 0x1 + beq _082E0BF6 + b _082E0C18 +_082E0BF0: + cmp r1, 0x3 + beq _082E0C0C + b _082E0C18 +_082E0BF6: + ldr r1, _082E0C00 + movs r0, 0x8 + strb r0, [r1] + adds r1, 0x2 + b _082E0C20 + .align 2, 0 +_082E0C00: .4byte 0x04000063 +_082E0C04: + ldr r1, _082E0C08 + b _082E0C1A + .align 2, 0 +_082E0C08: .4byte 0x04000069 +_082E0C0C: + ldr r1, _082E0C14 + movs r0, 0 + b _082E0C22 + .align 2, 0 +_082E0C14: .4byte 0x04000070 +_082E0C18: + ldr r1, _082E0C28 +_082E0C1A: + movs r0, 0x8 + strb r0, [r1] + adds r1, 0x4 +_082E0C20: + movs r0, 0x80 +_082E0C22: + strb r0, [r1] + bx lr + .align 2, 0 +_082E0C28: .4byte 0x04000079 + thumb_func_end CgbOscOff + + thumb_func_start CgbModVol +CgbModVol: @ 82E0C2C + push {r4,lr} + adds r2, r0, 0 + ldr r0, _082E0C5C + ldr r1, [r0] + movs r0, 0x1 + ldrb r1, [r1, 0x9] + ands r0, r1 + cmp r0, 0 + bne _082E0C6C + ldrb r0, [r2, 0x2] + lsls r1, r0, 24 + lsrs r4, r1, 24 + ldrb r3, [r2, 0x3] + lsls r0, r3, 24 + lsrs r3, r0, 24 + cmp r4, r3 + bcc _082E0C60 + lsrs r0, r1, 25 + cmp r0, r3 + bcc _082E0C6C + movs r0, 0xF + strb r0, [r2, 0x1B] + b _082E0C7A + .align 2, 0 +_082E0C5C: .4byte 0x03007ff0 +_082E0C60: + lsrs r0, 25 + cmp r0, r4 + bcc _082E0C6C + movs r0, 0xF0 + strb r0, [r2, 0x1B] + b _082E0C7A +_082E0C6C: + movs r0, 0xFF + strb r0, [r2, 0x1B] + ldrb r1, [r2, 0x3] + ldrb r3, [r2, 0x2] + adds r0, r1, r3 + lsrs r0, 4 + b _082E0C8A +_082E0C7A: + ldrb r1, [r2, 0x3] + ldrb r3, [r2, 0x2] + adds r0, r1, r3 + lsrs r0, 4 + strb r0, [r2, 0xA] + cmp r0, 0xF + bls _082E0C8C + movs r0, 0xF +_082E0C8A: + strb r0, [r2, 0xA] +_082E0C8C: + ldrb r1, [r2, 0x6] + ldrb r3, [r2, 0xA] + adds r0, r1, 0 + muls r0, r3 + adds r0, 0xF + asrs r0, 4 + strb r0, [r2, 0x19] + ldrb r0, [r2, 0x1C] + ldrb r1, [r2, 0x1B] + ands r0, r1 + strb r0, [r2, 0x1B] + pop {r4} + pop {r0} + bx r0 + thumb_func_end CgbModVol + + thumb_func_start CgbSound +CgbSound: @ 82E0CA8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, _082E0CC8 + ldr r0, [r0] + str r0, [sp, 0x4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _082E0CCC + subs r0, 0x1 + ldr r1, [sp, 0x4] + strb r0, [r1, 0xA] + b _082E0CD2 + .align 2, 0 +_082E0CC8: .4byte 0x03007ff0 +_082E0CCC: + movs r0, 0xE + ldr r2, [sp, 0x4] + strb r0, [r2, 0xA] +_082E0CD2: + movs r6, 0x1 + ldr r0, [sp, 0x4] + ldr r4, [r0, 0x1C] +_082E0CD8: + ldrb r1, [r4] + movs r0, 0xC7 + ands r0, r1 + adds r2, r6, 0x1 + mov r10, r2 + movs r2, 0x40 + adds r2, r4 + mov r9, r2 + cmp r0, 0 + bne _082E0CEE + b _082E10D8 +_082E0CEE: + cmp r6, 0x2 + beq _082E0D20 + cmp r6, 0x2 + bgt _082E0CFC + cmp r6, 0x1 + beq _082E0D02 + b _082E0D58 +_082E0CFC: + cmp r6, 0x3 + beq _082E0D38 + b _082E0D58 +_082E0D02: + ldr r0, _082E0D14 + str r0, [sp, 0x8] + ldr r7, _082E0D18 + ldr r2, _082E0D1C + str r2, [sp, 0xC] + adds r0, 0x4 + str r0, [sp, 0x10] + adds r2, 0x2 + b _082E0D68 + .align 2, 0 +_082E0D14: .4byte 0x04000060 +_082E0D18: .4byte 0x04000062 +_082E0D1C: .4byte 0x04000063 +_082E0D20: + ldr r0, _082E0D2C + str r0, [sp, 0x8] + ldr r7, _082E0D30 + ldr r2, _082E0D34 + b _082E0D60 + .align 2, 0 +_082E0D2C: .4byte 0x04000061 +_082E0D30: .4byte 0x04000068 +_082E0D34: .4byte 0x04000069 +_082E0D38: + ldr r0, _082E0D4C + str r0, [sp, 0x8] + ldr r7, _082E0D50 + ldr r2, _082E0D54 + str r2, [sp, 0xC] + adds r0, 0x4 + str r0, [sp, 0x10] + adds r2, 0x2 + b _082E0D68 + .align 2, 0 +_082E0D4C: .4byte 0x04000070 +_082E0D50: .4byte 0x04000072 +_082E0D54: .4byte 0x04000073 +_082E0D58: + ldr r0, _082E0DB8 + str r0, [sp, 0x8] + ldr r7, _082E0DBC + ldr r2, _082E0DC0 +_082E0D60: + str r2, [sp, 0xC] + adds r0, 0xB + str r0, [sp, 0x10] + adds r2, 0x4 +_082E0D68: + str r2, [sp, 0x14] + ldr r0, [sp, 0x4] + ldrb r0, [r0, 0xA] + str r0, [sp] + ldr r2, [sp, 0xC] + ldrb r0, [r2] + mov r8, r0 + adds r2, r1, 0 + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _082E0E5E + movs r3, 0x40 + adds r0, r3, 0 + ands r0, r2 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0x1 + mov r10, r0 + movs r1, 0x40 + adds r1, r4 + mov r9, r1 + cmp r5, 0 + bne _082E0E82 + movs r0, 0x3 + strb r0, [r4] + strb r0, [r4, 0x1D] + adds r0, r4, 0 + str r3, [sp, 0x18] + bl CgbModVol + ldr r3, [sp, 0x18] + cmp r6, 0x2 + beq _082E0DD0 + cmp r6, 0x2 + bgt _082E0DC4 + cmp r6, 0x1 + beq _082E0DCA + b _082E0E24 + .align 2, 0 +_082E0DB8: .4byte 0x04000071 +_082E0DBC: .4byte 0x04000078 +_082E0DC0: .4byte 0x04000079 +_082E0DC4: + cmp r6, 0x3 + beq _082E0DDC + b _082E0E24 +_082E0DCA: + ldrb r0, [r4, 0x1F] + ldr r2, [sp, 0x8] + strb r0, [r2] +_082E0DD0: + ldr r0, [r4, 0x24] + lsls r0, 6 + ldrb r1, [r4, 0x1E] + adds r0, r1, r0 + strb r0, [r7] + b _082E0E30 +_082E0DDC: + ldr r1, [r4, 0x24] + ldr r0, [r4, 0x28] + cmp r1, r0 + beq _082E0E04 + ldr r2, [sp, 0x8] + strb r3, [r2] + ldr r1, _082E0E18 + ldr r2, [r4, 0x24] + ldr r0, [r2] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r2, 0x4] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r2, 0x8] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r2, 0xC] + str r0, [r1] + str r2, [r4, 0x28] +_082E0E04: + ldr r0, [sp, 0x8] + strb r5, [r0] + ldrb r0, [r4, 0x1E] + strb r0, [r7] + ldrb r0, [r4, 0x1E] + cmp r0, 0 + beq _082E0E1C + movs r0, 0xC0 + b _082E0E3E + .align 2, 0 +_082E0E18: .4byte 0x04000090 +_082E0E1C: + movs r1, 0x80 + negs r1, r1 + strb r1, [r4, 0x1A] + b _082E0E40 +_082E0E24: + ldrb r0, [r4, 0x1E] + strb r0, [r7] + ldr r0, [r4, 0x24] + lsls r0, 3 + ldr r2, [sp, 0x10] + strb r0, [r2] +_082E0E30: + ldrb r0, [r4, 0x4] + adds r0, 0x8 + mov r8, r0 + ldrb r0, [r4, 0x1E] + cmp r0, 0 + beq _082E0E3E + movs r0, 0x40 +_082E0E3E: + strb r0, [r4, 0x1A] +_082E0E40: + ldrb r1, [r4, 0x4] + movs r2, 0 + strb r1, [r4, 0xB] + movs r0, 0xFF + ands r0, r1 + adds r1, r6, 0x1 + mov r10, r1 + movs r1, 0x40 + adds r1, r4 + mov r9, r1 + cmp r0, 0 + bne _082E0E5A + b _082E0F96 +_082E0E5A: + strb r2, [r4, 0x9] + b _082E0FC4 +_082E0E5E: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _082E0E90 + ldrb r0, [r4, 0xD] + subs r0, 0x1 + strb r0, [r4, 0xD] + movs r2, 0xFF + ands r0, r2 + lsls r0, 24 + adds r1, r6, 0x1 + mov r10, r1 + movs r2, 0x40 + adds r2, r4 + mov r9, r2 + cmp r0, 0 + ble _082E0E82 + b _082E0FD6 +_082E0E82: + lsls r0, r6, 24 + lsrs r0, 24 + bl CgbOscOff + movs r0, 0 + strb r0, [r4] + b _082E10D4 +_082E0E90: + movs r0, 0x40 + ands r0, r1 + adds r2, r6, 0x1 + mov r10, r2 + movs r2, 0x40 + adds r2, r4 + mov r9, r2 + cmp r0, 0 + beq _082E0ED0 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _082E0ED0 + movs r0, 0xFC + ands r0, r1 + movs r2, 0 + strb r0, [r4] + ldrb r1, [r4, 0x7] + strb r1, [r4, 0xB] + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + beq _082E0F02 + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] + cmp r6, 0x3 + beq _082E0FC4 + ldrb r2, [r4, 0x7] + mov r8, r2 + b _082E0FC4 +_082E0ED0: + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _082E0FC4 + cmp r6, 0x3 + bne _082E0EE2 + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] +_082E0EE2: + adds r0, r4, 0 + bl CgbModVol + movs r0, 0x3 + ldrb r2, [r4] + ands r0, r2 + cmp r0, 0 + bne _082E0F36 + ldrb r0, [r4, 0x9] + subs r0, 0x1 + strb r0, [r4, 0x9] + movs r1, 0xFF + ands r0, r1 + lsls r0, 24 + cmp r0, 0 + bgt _082E0F32 +_082E0F02: + ldrb r2, [r4, 0xC] + ldrb r1, [r4, 0xA] + adds r0, r2, 0 + muls r0, r1 + adds r0, 0xFF + asrs r0, 8 + movs r1, 0 + strb r0, [r4, 0x9] + lsls r0, 24 + cmp r0, 0 + beq _082E0E82 + movs r0, 0x4 + ldrb r2, [r4] + orrs r0, r2 + strb r0, [r4] + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] + cmp r6, 0x3 + beq _082E0FD6 + movs r2, 0x8 + mov r8, r2 + b _082E0FD6 +_082E0F32: + ldrb r0, [r4, 0x7] + b _082E0FC2 +_082E0F36: + cmp r0, 0x1 + bne _082E0F42 +_082E0F3A: + ldrb r0, [r4, 0x19] + strb r0, [r4, 0x9] + movs r0, 0x7 + b _082E0FC2 +_082E0F42: + cmp r0, 0x2 + bne _082E0F86 + ldrb r0, [r4, 0x9] + subs r0, 0x1 + strb r0, [r4, 0x9] + movs r1, 0xFF + ands r0, r1 + lsls r0, 24 + ldrb r2, [r4, 0x19] + lsls r1, r2, 24 + cmp r0, r1 + bgt _082E0F82 +_082E0F5A: + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _082E0F6A + movs r0, 0xFC + ldrb r1, [r4] + ands r0, r1 + strb r0, [r4] + b _082E0F02 +_082E0F6A: + ldrb r0, [r4] + subs r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + ldrb r2, [r4, 0x1D] + orrs r0, r2 + strb r0, [r4, 0x1D] + cmp r6, 0x3 + beq _082E0F3A + movs r0, 0x8 + mov r8, r0 + b _082E0F3A +_082E0F82: + ldrb r0, [r4, 0x5] + b _082E0FC2 +_082E0F86: + ldrb r0, [r4, 0x9] + adds r0, 0x1 + strb r0, [r4, 0x9] + movs r1, 0xFF + ands r0, r1 + ldrb r2, [r4, 0xA] + cmp r0, r2 + bcc _082E0FC0 +_082E0F96: + ldrb r0, [r4] + subs r0, 0x1 + movs r2, 0 + strb r0, [r4] + ldrb r1, [r4, 0x5] + strb r1, [r4, 0xB] + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + beq _082E0F5A + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + cmp r6, 0x3 + beq _082E0FC4 + ldrb r2, [r4, 0x5] + mov r8, r2 + b _082E0FC4 +_082E0FC0: + ldrb r0, [r4, 0x4] +_082E0FC2: + strb r0, [r4, 0xB] +_082E0FC4: + ldrb r0, [r4, 0xB] + subs r0, 0x1 + strb r0, [r4, 0xB] + ldr r0, [sp] + cmp r0, 0 + bne _082E0FD6 + subs r0, 0x1 + str r0, [sp] + b _082E0ED0 +_082E0FD6: + movs r0, 0x2 + ldrb r1, [r4, 0x1D] + ands r0, r1 + cmp r0, 0 + beq _082E104E + cmp r6, 0x3 + bgt _082E1016 + movs r0, 0x8 + ldrb r2, [r4, 0x1] + ands r0, r2 + cmp r0, 0 + beq _082E1016 + ldr r0, _082E1000 + ldrb r0, [r0] + cmp r0, 0x3F + bgt _082E1008 + ldr r0, [r4, 0x20] + adds r0, 0x2 + ldr r1, _082E1004 + b _082E1012 + .align 2, 0 +_082E1000: .4byte 0x04000089 +_082E1004: .4byte 0x000007fc +_082E1008: + cmp r0, 0x7F + bgt _082E1016 + ldr r0, [r4, 0x20] + adds r0, 0x1 + ldr r1, _082E1024 +_082E1012: + ands r0, r1 + str r0, [r4, 0x20] +_082E1016: + cmp r6, 0x4 + beq _082E1028 + ldr r0, [r4, 0x20] + ldr r1, [sp, 0x10] + strb r0, [r1] + b _082E1036 + .align 2, 0 +_082E1024: .4byte 0x000007fe +_082E1028: + ldr r2, [sp, 0x10] + ldrb r0, [r2] + movs r1, 0x8 + ands r1, r0 + ldr r0, [r4, 0x20] + orrs r0, r1 + strb r0, [r2] +_082E1036: + movs r0, 0xC0 + ldrb r1, [r4, 0x1A] + ands r0, r1 + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r0, r1, r0 + strb r0, [r4, 0x1A] + movs r2, 0xFF + ands r0, r2 + ldr r1, [sp, 0x14] + strb r0, [r1] +_082E104E: + movs r0, 0x1 + ldrb r2, [r4, 0x1D] + ands r0, r2 + cmp r0, 0 + beq _082E10D4 + ldr r1, _082E1098 + ldrb r0, [r1] + ldrb r2, [r4, 0x1C] + bics r0, r2 + ldrb r2, [r4, 0x1B] + orrs r0, r2 + strb r0, [r1] + cmp r6, 0x3 + bne _082E10A0 + ldr r0, _082E109C + ldrb r1, [r4, 0x9] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, [sp, 0xC] + strb r0, [r2] + movs r1, 0x80 + adds r0, r1, 0 + ldrb r2, [r4, 0x1A] + ands r0, r2 + cmp r0, 0 + beq _082E10D4 + ldr r0, [sp, 0x8] + strb r1, [r0] + ldrb r0, [r4, 0x1A] + ldr r1, [sp, 0x14] + strb r0, [r1] + movs r0, 0x7F + ldrb r2, [r4, 0x1A] + ands r0, r2 + strb r0, [r4, 0x1A] + b _082E10D4 + .align 2, 0 +_082E1098: .4byte 0x04000081 +_082E109C: .4byte 0x08675c54 +_082E10A0: + movs r0, 0xF + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldrb r2, [r4, 0x9] + lsls r0, r2, 4 + add r0, r8 + ldr r1, [sp, 0xC] + strb r0, [r1] + movs r2, 0x80 + ldrb r0, [r4, 0x1A] + orrs r0, r2 + ldr r1, [sp, 0x14] + strb r0, [r1] + cmp r6, 0x1 + bne _082E10D4 + ldr r0, [sp, 0x8] + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _082E10D4 + ldrb r0, [r4, 0x1A] + orrs r0, r2 + ldr r1, [sp, 0x14] + strb r0, [r1] +_082E10D4: + movs r0, 0 + strb r0, [r4, 0x1D] +_082E10D8: + mov r6, r10 + mov r4, r9 + cmp r6, 0x4 + bgt _082E10E2 + b _082E0CD8 +_082E10E2: + 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 CgbSound + + thumb_func_start MPlayTempoControl +MPlayTempoControl: @ 82E10F4 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _082E1118 + cmp r3, r0 + bne _082E1110 + strh r1, [r2, 0x1E] + ldrh r4, [r2, 0x1C] + adds r0, r1, 0 + muls r0, r4 + asrs r0, 8 + strh r0, [r2, 0x20] +_082E1110: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E1118: .4byte 0x68736d53 + thumb_func_end MPlayTempoControl + + thumb_func_start MPlayVolumeControl +MPlayVolumeControl: @ 82E111C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r6, r2, 16 + ldr r3, [r4, 0x34] + ldr r0, _082E1180 + cmp r3, r0 + bne _082E1174 + adds r0, r3, 0x1 + str r0, [r4, 0x34] + ldrb r2, [r4, 0x8] + ldr r1, [r4, 0x2C] + movs r5, 0x1 + cmp r2, 0 + ble _082E1170 + movs r0, 0x80 + mov r8, r0 + lsrs r6, 18 + movs r0, 0x3 + mov r12, r0 +_082E114C: + adds r0, r7, 0 + ands r0, r5 + cmp r0, 0 + beq _082E1166 + ldrb r3, [r1] + mov r0, r8 + ands r0, r3 + cmp r0, 0 + beq _082E1166 + strb r6, [r1, 0x13] + mov r0, r12 + orrs r0, r3 + strb r0, [r1] +_082E1166: + subs r2, 0x1 + adds r1, 0x50 + lsls r5, 1 + cmp r2, 0 + bgt _082E114C +_082E1170: + ldr r0, _082E1180 + str r0, [r4, 0x34] +_082E1174: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E1180: .4byte 0x68736d53 + thumb_func_end MPlayVolumeControl + + thumb_func_start MPlayPitchControl +MPlayPitchControl: @ 82E1184 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r3, [r4, 0x34] + ldr r0, _082E11F4 + cmp r3, r0 + bne _082E11E6 + adds r0, r3, 0x1 + str r0, [r4, 0x34] + ldrb r2, [r4, 0x8] + ldr r3, [r4, 0x2C] + movs r5, 0x1 + cmp r2, 0 + ble _082E11E2 + movs r0, 0x80 + mov r9, r0 + lsls r0, r6, 16 + asrs r7, r0, 24 + movs r0, 0xC + mov r8, r0 +_082E11BC: + mov r0, r12 + ands r0, r5 + cmp r0, 0 + beq _082E11D8 + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _082E11D8 + strb r7, [r3, 0xB] + strb r6, [r3, 0xD] + mov r0, r8 + orrs r0, r1 + strb r0, [r3] +_082E11D8: + subs r2, 0x1 + adds r3, 0x50 + lsls r5, 1 + cmp r2, 0 + bgt _082E11BC +_082E11E2: + ldr r0, _082E11F4 + str r0, [r4, 0x34] +_082E11E6: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E11F4: .4byte 0x68736d53 + thumb_func_end MPlayPitchControl + + thumb_func_start MPlayPanpotControl +MPlayPanpotControl: @ 82E11F8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r3, [r4, 0x34] + ldr r0, _082E125C + cmp r3, r0 + bne _082E1250 + adds r0, r3, 0x1 + str r0, [r4, 0x34] + ldrb r2, [r4, 0x8] + ldr r1, [r4, 0x2C] + movs r5, 0x1 + cmp r2, 0 + ble _082E124C + movs r0, 0x80 + mov r8, r0 + movs r0, 0x3 + mov r12, r0 +_082E1228: + adds r0, r7, 0 + ands r0, r5 + cmp r0, 0 + beq _082E1242 + ldrb r3, [r1] + mov r0, r8 + ands r0, r3 + cmp r0, 0 + beq _082E1242 + strb r6, [r1, 0x15] + mov r0, r12 + orrs r0, r3 + strb r0, [r1] +_082E1242: + subs r2, 0x1 + adds r1, 0x50 + lsls r5, 1 + cmp r2, 0 + bgt _082E1228 +_082E124C: + ldr r0, _082E125C + str r0, [r4, 0x34] +_082E1250: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E125C: .4byte 0x68736d53 + thumb_func_end MPlayPanpotControl + + thumb_func_start MP_clear_modM +MP_clear_modM: @ 82E1260 + adds r1, r0, 0 + movs r2, 0 + movs r0, 0 + strb r0, [r1, 0x1A] + strb r0, [r1, 0x16] + ldrb r0, [r1, 0x18] + cmp r0, 0 + bne _082E1274 + movs r0, 0xC + b _082E1276 +_082E1274: + movs r0, 0x3 +_082E1276: + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + bx lr + thumb_func_end MP_clear_modM + + thumb_func_start MPlayModDepthSet +MPlayModDepthSet: @ 82E1280 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, [r6, 0x34] + ldr r0, _082E12F0 + cmp r1, r0 + bne _082E12E0 + adds r0, r1, 0x1 + str r0, [r6, 0x34] + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + movs r7, 0x1 + cmp r5, 0 + ble _082E12DC + mov r9, r8 +_082E12B0: + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _082E12D2 + movs r0, 0x80 + ldrb r1, [r4] + ands r0, r1 + cmp r0, 0 + beq _082E12D2 + mov r0, r8 + strb r0, [r4, 0x17] + mov r1, r9 + cmp r1, 0 + bne _082E12D2 + adds r0, r4, 0 + bl MP_clear_modM +_082E12D2: + subs r5, 0x1 + adds r4, 0x50 + lsls r7, 1 + cmp r5, 0 + bgt _082E12B0 +_082E12DC: + ldr r0, _082E12F0 + str r0, [r6, 0x34] +_082E12E0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E12F0: .4byte 0x68736d53 + thumb_func_end MPlayModDepthSet + + thumb_func_start MPlayLFOSpeedSet +MPlayLFOSpeedSet: @ 82E12F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, [r6, 0x34] + ldr r0, _082E1364 + cmp r1, r0 + bne _082E1354 + adds r0, r1, 0x1 + str r0, [r6, 0x34] + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + movs r7, 0x1 + cmp r5, 0 + ble _082E1350 + mov r9, r8 +_082E1324: + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _082E1346 + movs r0, 0x80 + ldrb r1, [r4] + ands r0, r1 + cmp r0, 0 + beq _082E1346 + mov r0, r8 + strb r0, [r4, 0x19] + mov r1, r9 + cmp r1, 0 + bne _082E1346 + adds r0, r4, 0 + bl MP_clear_modM +_082E1346: + subs r5, 0x1 + adds r4, 0x50 + lsls r7, 1 + cmp r5, 0 + bgt _082E1324 +_082E1350: + ldr r0, _082E1364 + str r0, [r6, 0x34] +_082E1354: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E1364: .4byte 0x68736d53 + thumb_func_end MPlayLFOSpeedSet + + thumb_func_start ply_memacc +ply_memacc: @ 82E1368 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r1, [r6, 0x40] + ldrb r5, [r1] + adds r2, r1, 0x1 + str r2, [r6, 0x40] + ldr r0, [r4, 0x18] + ldrb r1, [r1, 0x1] + adds r3, r1, r0 + adds r0, r2, 0x1 + str r0, [r6, 0x40] + ldrb r2, [r2, 0x1] + adds r0, 0x1 + str r0, [r6, 0x40] + cmp r5, 0x11 + bls _082E138C + b _082E14BA +_082E138C: + lsls r0, r5, 2 + ldr r1, _082E1398 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_082E1398: .4byte _082E139C + .align 2, 0 +_082E139C: + .4byte _082E13E4 + .4byte _082E13E8 + .4byte _082E13F0 + .4byte _082E13F8 + .4byte _082E1402 + .4byte _082E1410 + .4byte _082E141E + .4byte _082E1426 + .4byte _082E142E + .4byte _082E1436 + .4byte _082E143E + .4byte _082E1446 + .4byte _082E144E + .4byte _082E145C + .4byte _082E146A + .4byte _082E1478 + .4byte _082E1486 + .4byte _082E1494 +_082E13E4: + strb r2, [r3] + b _082E14BA +_082E13E8: + ldrb r1, [r3] + adds r0, r1, r2 + strb r0, [r3] + b _082E14BA +_082E13F0: + ldrb r1, [r3] + subs r0, r1, r2 + strb r0, [r3] + b _082E14BA +_082E13F8: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r3] + b _082E14BA +_082E1402: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r1, [r3] + ldrb r0, [r0] + adds r0, r1, r0 + strb r0, [r3] + b _082E14BA +_082E1410: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r1, [r3] + ldrb r0, [r0] + subs r0, r1, r0 + strb r0, [r3] + b _082E14BA +_082E141E: + ldrb r3, [r3] + cmp r3, r2 + beq _082E14A0 + b _082E14B4 +_082E1426: + ldrb r3, [r3] + cmp r3, r2 + bne _082E14A0 + b _082E14B4 +_082E142E: + ldrb r3, [r3] + cmp r3, r2 + bhi _082E14A0 + b _082E14B4 +_082E1436: + ldrb r3, [r3] + cmp r3, r2 + bcs _082E14A0 + b _082E14B4 +_082E143E: + ldrb r3, [r3] + cmp r3, r2 + bls _082E14A0 + b _082E14B4 +_082E1446: + ldrb r3, [r3] + cmp r3, r2 + bcc _082E14A0 + b _082E14B4 +_082E144E: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + beq _082E14A0 + b _082E14B4 +_082E145C: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bne _082E14A0 + b _082E14B4 +_082E146A: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bhi _082E14A0 + b _082E14B4 +_082E1478: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bcs _082E14A0 + b _082E14B4 +_082E1486: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bls _082E14A0 + b _082E14B4 +_082E1494: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bcs _082E14B4 +_082E14A0: + ldr r0, _082E14B0 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl _call_via_r2 + b _082E14BA + .align 2, 0 +_082E14B0: .4byte 0x03007464 +_082E14B4: + ldr r0, [r6, 0x40] + adds r0, 0x4 + str r0, [r6, 0x40] +_082E14BA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ply_memacc + + thumb_func_start ply_xcmd +ply_xcmd: @ 82E14C0 + push {lr} + ldr r2, [r1, 0x40] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r1, 0x40] + ldr r2, _082E14DC + lsls r3, 2 + adds r3, r2 + ldr r2, [r3] + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_082E14DC: .4byte 0x08675ccc + thumb_func_end ply_xcmd + + thumb_func_start ply_xxx +ply_xxx: @ 82E14E0 + push {lr} + ldr r2, _082E14F0 + ldr r2, [r2] + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_082E14F0: .4byte 0x03007460 + thumb_func_end ply_xxx + + thumb_func_start ply_xwave +ply_xwave: @ 82E14F4 + push {r4,lr} + ldr r2, [r1, 0x40] + ldr r0, _082E152C + ands r4, r0 + ldrb r0, [r2] + orrs r4, r0 + ldrb r0, [r2, 0x1] + lsls r3, r0, 8 + ldr r0, _082E1530 + ands r4, r0 + orrs r4, r3 + ldrb r0, [r2, 0x2] + lsls r3, r0, 16 + ldr r0, _082E1534 + ands r4, r0 + orrs r4, r3 + ldrb r0, [r2, 0x3] + lsls r3, r0, 24 + ldr r0, _082E1538 + ands r4, r0 + orrs r4, r3 + str r4, [r1, 0x28] + adds r2, 0x4 + str r2, [r1, 0x40] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E152C: .4byte 0xffffff00 +_082E1530: .4byte 0xffff00ff +_082E1534: .4byte 0xff00ffff +_082E1538: .4byte 0x00ffffff + thumb_func_end ply_xwave + + thumb_func_start ply_xtype +ply_xtype: @ 82E153C + ldr r0, [r1, 0x40] + ldrb r2, [r0] + adds r0, r1, 0 + adds r0, 0x24 + strb r2, [r0] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xtype + + thumb_func_start ply_xatta +ply_xatta: @ 82E1550 + ldr r0, [r1, 0x40] + ldrb r2, [r0] + adds r0, r1, 0 + adds r0, 0x2C + strb r2, [r0] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xatta + + thumb_func_start ply_xdeca +ply_xdeca: @ 82E1564 + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x2D + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xdeca + + thumb_func_start ply_xsust +ply_xsust: @ 82E1578 + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x2E + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xsust + + thumb_func_start ply_xrele +ply_xrele: @ 82E158C + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x2F + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xrele + + thumb_func_start ply_xiecv +ply_xiecv: @ 82E15A0 + ldr r0, [r1, 0x40] + ldrb r2, [r0] + strb r2, [r1, 0x1E] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xiecv + + thumb_func_start ply_xiecl +ply_xiecl: @ 82E15AC + ldr r0, [r1, 0x40] + ldrb r2, [r0] + strb r2, [r1, 0x1F] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xiecl + + thumb_func_start ply_xleng +ply_xleng: @ 82E15B8 + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x26 + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xleng + + thumb_func_start ply_xswee +ply_xswee: @ 82E15CC + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x27 + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xswee + + thumb_func_start ply_xcmd0C +ply_xcmd0C: @ 82E15E0 + push {r4,lr} + adds r3, r1, 0 + ldr r4, [r3, 0x40] + ldr r0, _082E1610 + ands r2, r0 + ldrb r0, [r4] + orrs r2, r0 + ldrb r0, [r4, 0x1] + lsls r1, r0, 8 + ldr r0, _082E1614 + ands r2, r0 + orrs r2, r1 + ldrh r1, [r3, 0x3A] + lsls r0, r2, 16 + lsrs r0, 16 + cmp r1, r0 + bcs _082E1618 + adds r0, r1, 0x1 + strh r0, [r3, 0x3A] + subs r0, r4, 0x2 + str r0, [r3, 0x40] + movs r0, 0x1 + strb r0, [r3, 0x1] + b _082E1620 + .align 2, 0 +_082E1610: .4byte 0xffffff00 +_082E1614: .4byte 0xffff00ff +_082E1618: + movs r0, 0 + strh r0, [r3, 0x3A] + adds r0, r4, 0x2 + str r0, [r3, 0x40] +_082E1620: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ply_xcmd0C + + thumb_func_start ply_xcmd0D +ply_xcmd0D: @ 82E1628 + push {r4,lr} + ldr r2, [r1, 0x40] + ldr r0, _082E1660 + ands r4, r0 + ldrb r0, [r2] + orrs r4, r0 + ldrb r0, [r2, 0x1] + lsls r3, r0, 8 + ldr r0, _082E1664 + ands r4, r0 + orrs r4, r3 + ldrb r0, [r2, 0x2] + lsls r3, r0, 16 + ldr r0, _082E1668 + ands r4, r0 + orrs r4, r3 + ldrb r0, [r2, 0x3] + lsls r3, r0, 24 + ldr r0, _082E166C + ands r4, r0 + orrs r4, r3 + str r4, [r1, 0x3C] + adds r2, 0x4 + str r2, [r1, 0x40] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E1660: .4byte 0xffffff00 +_082E1664: .4byte 0xffff00ff +_082E1668: .4byte 0xff00ffff +_082E166C: .4byte 0x00ffffff + thumb_func_end ply_xcmd0D + + thumb_func_start DummyFunc_rev +DummyFunc_rev: @ 82E1670 + bx lr + thumb_func_end DummyFunc_rev + + thumb_func_start sub_82E1674 +sub_82E1674: @ 82E1674 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + movs r6, 0 + movs r1, 0 + movs r4, 0 + ldr r0, _082E1730 + mov r8, r0 + ldr r7, _082E1734 + ldr r0, _082E1738 + mov r10, r0 + mov r5, r8 + adds r5, 0xC + movs r3, 0 + ldr r0, _082E173C + mov r12, r0 +_082E169A: + mov r0, r12 + adds r2, r3, r0 + ldrb r0, [r2] + cmp r0, 0 + bne _082E16B0 + ldr r0, [r2, 0x20] + cmp r0, 0 + beq _082E16C6 + ldr r0, [r0, 0x2C] + cmp r0, r2 + bne _082E16C6 +_082E16B0: + ldr r0, [r5] + cmp r6, r0 + bcs _082E16BA + adds r6, r0, 0 + adds r1, r4, 0 +_082E16BA: + adds r5, 0x40 + adds r3, 0xA0 + adds r4, 0x1 + cmp r4, 0x1 + ble _082E169A + adds r4, r1, 0 +_082E16C6: + lsls r5, r4, 6 + add r5, r8 + ldr r0, [r5, 0x34] + adds r0, 0x1 + str r0, [r5, 0x34] + movs r0, 0x34 + muls r4, r0 + adds r6, r4, r7 + adds r0, r6, 0 + mov r1, r10 + movs r2, 0x34 + bl memcpy + adds r0, r7, 0x4 + adds r0, r4, r0 + mov r1, r9 + str r1, [r0] + adds r1, r7, 0 + adds r1, 0x8 + adds r1, r4, r1 + adds r0, r7, 0 + adds r0, 0x11 + adds r0, r4, r0 + str r0, [r1] + adds r1, r7, 0 + adds r1, 0xC + adds r1, r4, r1 + adds r0, r7, 0 + adds r0, 0x18 + adds r0, r4, r0 + str r0, [r1] + adds r0, r7, 0 + adds r0, 0x14 + adds r0, r4, r0 + adds r1, r7, 0 + adds r1, 0x1A + adds r4, r1 + str r4, [r0] + ldr r0, _082E1740 + str r0, [r5, 0x34] + adds r0, r5, 0 + adds r1, r6, 0 + bl MPlayStart_rev01 + adds r0, r5, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E1730: .4byte 0x030073a0 +_082E1734: .4byte 0x03007330 +_082E1738: .4byte 0x030077b0 +_082E173C: .4byte 0x03007670 +_082E1740: .4byte 0x68736d53 + thumb_func_end sub_82E1674 + + thumb_func_start sub_82E1744 +sub_82E1744: @ 82E1744 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _082E1754 + movs r1, 0x7F + ands r0, r1 + strb r0, [r2, 0x1D] + bx lr + .align 2, 0 +_082E1754: .4byte 0x030077b0 + thumb_func_end sub_82E1744 + + thumb_func_start sub_82E1758 +sub_82E1758: @ 82E1758 + ldr r2, _082E176C + lsls r0, 24 + asrs r0, 24 + adds r0, 0x40 + movs r1, 0x7F + ands r0, r1 + adds r2, 0x28 + strb r0, [r2] + bx lr + .align 2, 0 +_082E176C: .4byte 0x030077b0 + thumb_func_end sub_82E1758 + + thumb_func_start sub_82E1770 +sub_82E1770: @ 82E1770 + push {r4-r6,lr} + lsls r0, 16 + ldr r3, _082E17A4 + ldrb r2, [r3, 0x19] + ldrb r4, [r3, 0x12] + subs r1, r2, r4 + lsls r1, 24 + lsrs r1, 24 + movs r6, 0x80 + lsls r6, 16 + adds r0, r6 + asrs r2, r0, 24 + movs r5, 0x7F + movs r4, 0x7F + ands r2, r4 + movs r6, 0x2A + strb r2, [r6, r3] + asrs r0, 17 + ands r0, r4 + strb r0, [r3, 0x12] + adds r1, r0 + ands r1, r5 + strb r1, [r3, 0x19] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E17A4: .4byte 0x030077b0 + thumb_func_end sub_82E1770 + + thumb_func_start sub_82E17A8 +sub_82E17A8: @ 82E17A8 + ldr r1, _082E17B0 + strh r0, [r1, 0x2E] + bx lr + .align 2, 0 +_082E17B0: .4byte 0x030077b0 + thumb_func_end sub_82E17A8 + + thumb_func_start sub_82E17B4 +sub_82E17B4: @ 82E17B4 + ldr r1, _082E17BC + adds r1, 0x26 + strb r0, [r1] + bx lr + .align 2, 0 +_082E17BC: .4byte 0x030077b0 + thumb_func_end sub_82E17B4 + + thumb_func_start sub_82E17C0 +sub_82E17C0: @ 82E17C0 + ldr r1, _082E17C8 + str r0, [r1, 0x20] + bx lr + .align 2, 0 +_082E17C8: .4byte 0x030077b0 + thumb_func_end sub_82E17C0 + + thumb_func_start sub_82E17CC +sub_82E17CC: @ 82E17CC + ldr r1, [r0, 0x2C] + ldr r0, [r1, 0x20] + cmp r0, 0 + beq _082E17DE + ldr r0, [r0, 0x2C] + cmp r0, r1 + bne _082E17DE + movs r0, 0x1 + b _082E17E0 +_082E17DE: + movs r0, 0 +_082E17E0: + bx lr + thumb_func_end sub_82E17CC + + thumb_func_start sub_82E17E4 +sub_82E17E4: @ 82E17E4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r0, 0 + beq _082E1804 + ldr r2, _082E1800 + movs r0, 0x2 + strb r0, [r2] + ldrb r3, [r2, 0x12] + adds r0, r3, r1 + movs r1, 0x7F + ands r0, r1 + strb r0, [r2, 0x19] + b _082E180A + .align 2, 0 +_082E1800: .4byte 0x030077b0 +_082E1804: + ldr r1, _082E180C + movs r0, 0x1 + strb r0, [r1] +_082E180A: + bx lr + .align 2, 0 +_082E180C: .4byte 0x030077b0 + thumb_func_end sub_82E17E4 + + thumb_func_start sub_82E1810 +sub_82E1810: @ 82E1810 + ldr r1, _082E1828 + ldr r2, [r1] + cmp r0, 0 + beq _082E1834 + ldr r1, _082E182C + ldr r3, _082E1830 + adds r0, r3, 0 + strh r0, [r1] + movs r0, 0xFE + ldrb r1, [r2, 0x9] + ands r0, r1 + b _082E1842 + .align 2, 0 +_082E1828: .4byte 0x03007ff0 +_082E182C: .4byte 0x04000082 +_082E1830: .4byte 0x0000210e +_082E1834: + ldr r1, _082E1848 + ldr r3, _082E184C + adds r0, r3, 0 + strh r0, [r1] + movs r0, 0x1 + ldrb r1, [r2, 0x9] + orrs r0, r1 +_082E1842: + strb r0, [r2, 0x9] + bx lr + .align 2, 0 +_082E1848: .4byte 0x04000082 +_082E184C: .4byte 0x00003302 + thumb_func_end sub_82E1810 + + thumb_func_start sub_82E1850 +sub_82E1850: @ 82E1850 + ldr r1, _082E1858 + strb r0, [r1, 0x2] + bx lr + .align 2, 0 +_082E1858: .4byte 0x030077b0 + thumb_func_end sub_82E1850 + + thumb_func_start SwitchFlashBank +SwitchFlashBank: @ 82E185C + lsls r0, 24 + lsrs r0, 24 + ldr r3, _082E1878 + movs r1, 0xAA + strb r1, [r3] + ldr r2, _082E187C + movs r1, 0x55 + strb r1, [r2] + movs r1, 0xB0 + strb r1, [r3] + movs r1, 0xE0 + lsls r1, 20 + strb r0, [r1] + bx lr + .align 2, 0 +_082E1878: .4byte 0x0e005555 +_082E187C: .4byte 0x0e002aaa + thumb_func_end SwitchFlashBank + + thumb_func_start ReadFlashID +ReadFlashID: @ 82E1880 + push {r4,r5,lr} + sub sp, 0x44 + mov r0, sp + bl SetReadFlash1 + mov r5, sp + adds r5, 0x1 + ldr r2, _082E18A8 + movs r0, 0xAA + strb r0, [r2] + ldr r1, _082E18AC + movs r0, 0x55 + strb r0, [r1] + movs r0, 0x90 + strb r0, [r2] + add r1, sp, 0x40 + ldr r2, _082E18B0 + adds r0, r2, 0 + b _082E18B8 + .align 2, 0 +_082E18A8: .4byte 0x0e005555 +_082E18AC: .4byte 0x0e002aaa +_082E18B0: .4byte 0x00004e20 +_082E18B4: + ldrh r0, [r1] + subs r0, 0x1 +_082E18B8: + strh r0, [r1] + ldrh r0, [r1] + cmp r0, 0 + bne _082E18B4 + ldr r0, _082E18F4 + bl _call_via_r5 + lsls r0, 24 + lsrs r4, r0, 16 + movs r0, 0xE0 + lsls r0, 20 + bl _call_via_r5 + lsls r0, 24 + lsrs r0, 24 + orrs r4, r0 + ldr r1, _082E18F8 + movs r0, 0xAA + strb r0, [r1] + ldr r2, _082E18FC + movs r0, 0x55 + strb r0, [r2] + movs r0, 0xF0 + strb r0, [r1] + strb r0, [r1] + add r1, sp, 0x40 + ldr r2, _082E1900 + adds r0, r2, 0 + b _082E1908 + .align 2, 0 +_082E18F4: .4byte 0x0e000001 +_082E18F8: .4byte 0x0e005555 +_082E18FC: .4byte 0x0e002aaa +_082E1900: .4byte 0x00004e20 +_082E1904: + ldrh r0, [r1] + subs r0, 0x1 +_082E1908: + strh r0, [r1] + ldrh r0, [r1] + cmp r0, 0 + bne _082E1904 + adds r0, r4, 0 + add sp, 0x44 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end ReadFlashID + + thumb_func_start FlashTimerIntr +FlashTimerIntr: @ 82E191C + push {lr} + ldr r1, _082E193C + ldrh r0, [r1] + cmp r0, 0 + beq _082E1938 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _082E1938 + ldr r1, _082E1940 + movs r0, 0x1 + strb r0, [r1] +_082E1938: + pop {r0} + bx r0 + .align 2, 0 +_082E193C: .4byte 0x03001a72 +_082E1940: .4byte 0x03007840 + thumb_func_end FlashTimerIntr + + thumb_func_start SetFlashTimerIntr +SetFlashTimerIntr: @ 82E1944 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _082E1978 + ldr r0, _082E1968 + strb r1, [r0] + ldr r1, _082E196C + ldrb r0, [r0] + lsls r0, 2 + ldr r3, _082E1970 + adds r0, r3 + str r0, [r1] + ldr r0, _082E1974 + str r0, [r2] + movs r0, 0 + b _082E197A + .align 2, 0 +_082E1968: .4byte 0x03001a70 +_082E196C: .4byte 0x03001a74 +_082E1970: .4byte 0x04000100 +_082E1974: .4byte FlashTimerIntr + 1 +_082E1978: + movs r0, 0x1 +_082E197A: + pop {r1} + bx r1 + thumb_func_end SetFlashTimerIntr + + thumb_func_start StartFlashTimer +StartFlashTimer: @ 82E1980 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _082E1A04 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 1 + ldr r0, [r1] + adds r2, r0 + ldr r1, _082E1A08 + ldr r0, _082E1A0C + mov r9, r0 + ldrh r0, [r0] + strh r0, [r1] + movs r3, 0 + mov r1, r9 + strh r3, [r1] + ldr r0, _082E1A10 + mov r8, r0 + ldr r4, [r0] + strh r3, [r4, 0x2] + ldr r6, _082E1A14 + ldr r1, _082E1A18 + mov r10, r1 + ldrb r1, [r1] + movs r5, 0x8 + adds r0, r5, 0 + lsls r0, r1 + adds r1, r0, 0 + ldrh r0, [r6] + orrs r0, r1 + strh r0, [r6] + ldr r0, _082E1A1C + strb r3, [r0] + ldr r1, _082E1A20 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + ldrh r0, [r2] + strh r0, [r4] + adds r0, r4, 0x2 + mov r1, r8 + str r0, [r1] + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x2] + str r4, [r1] + ldr r1, _082E1A24 + mov r2, r10 + ldrb r0, [r2] + lsls r5, r0 + strh r5, [r1] + movs r0, 0x1 + mov r3, r9 + strh r0, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E1A04: .4byte 0x03007864 +_082E1A08: .4byte 0x03001a78 +_082E1A0C: .4byte 0x04000208 +_082E1A10: .4byte 0x03001a74 +_082E1A14: .4byte 0x04000200 +_082E1A18: .4byte 0x03001a70 +_082E1A1C: .4byte 0x03007840 +_082E1A20: .4byte 0x03001a72 +_082E1A24: .4byte 0x04000202 + thumb_func_end StartFlashTimer + + thumb_func_start StopFlashTimer +StopFlashTimer: @ 82E1A28 + ldr r3, _082E1A58 + movs r1, 0 + strh r1, [r3] + ldr r2, _082E1A5C + ldr r0, [r2] + strh r1, [r0] + adds r0, 0x2 + str r0, [r2] + strh r1, [r0] + subs r0, 0x2 + str r0, [r2] + ldr r2, _082E1A60 + ldr r0, _082E1A64 + ldrb r0, [r0] + movs r1, 0x8 + lsls r1, r0 + ldrh r0, [r2] + bics r0, r1 + strh r0, [r2] + ldr r0, _082E1A68 + ldrh r0, [r0] + strh r0, [r3] + bx lr + .align 2, 0 +_082E1A58: .4byte 0x04000208 +_082E1A5C: .4byte 0x03001a74 +_082E1A60: .4byte 0x04000200 +_082E1A64: .4byte 0x03001a70 +_082E1A68: .4byte 0x03001a78 + thumb_func_end StopFlashTimer + + thumb_func_start ReadFlash1 +ReadFlash1: @ 82E1A6C + ldrb r0, [r0] + bx lr + thumb_func_end ReadFlash1 + + thumb_func_start SetReadFlash1 +SetReadFlash1: @ 82E1A70 + push {lr} + adds r2, r0, 0 + ldr r1, _082E1A8C + adds r0, r2, 0x1 + str r0, [r1] + ldr r3, _082E1A90 + movs r0, 0x1 + eors r3, r0 + ldr r0, _082E1A94 + ldr r1, _082E1A90 + subs r0, r1 + lsls r0, 15 + b _082E1AA4 + .align 2, 0 +_082E1A8C: .4byte 0x03007844 +_082E1A90: .4byte ReadFlash1 + 1 +_082E1A94: .4byte SetReadFlash1 + 1 +_082E1A98: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r0, r1, 0x1 + lsls r0, 16 +_082E1AA4: + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E1A98 + pop {r0} + bx r0 + thumb_func_end SetReadFlash1 + + thumb_func_start ReadFlash_Core +ReadFlash_Core: @ 82E1AB0 + push {r4,lr} + adds r4, r0, 0 + subs r3, r2, 0x1 + cmp r2, 0 + beq _082E1ACC + movs r2, 0x1 + negs r2, r2 +_082E1ABE: + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, r2 + bne _082E1ABE +_082E1ACC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ReadFlash_Core + + thumb_func_start ReadFlash +ReadFlash: @ 82E1AD4 + push {r4-r7,lr} + sub sp, 0x80 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + lsls r3, r0, 16 + lsrs r4, r3, 16 + ldr r2, _082E1B20 + ldrh r0, [r2] + ldr r1, _082E1B24 + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + strh r0, [r2] + ldr r0, _082E1B28 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + cmp r1, r0 + bne _082E1B0C + lsrs r0, r3, 20 + lsls r0, 24 + lsrs r0, 24 + bl SwitchFlashBank + movs r0, 0xF + ands r4, r0 +_082E1B0C: + ldr r3, _082E1B2C + movs r0, 0x1 + eors r3, r0 + mov r2, sp + ldr r0, _082E1B30 + ldr r1, _082E1B2C + subs r0, r1 + lsls r0, 15 + b _082E1B40 + .align 2, 0 +_082E1B20: .4byte 0x04000204 +_082E1B24: .4byte 0x0000fffc +_082E1B28: .4byte 0x03007850 +_082E1B2C: .4byte ReadFlash_Core + 1 +_082E1B30: .4byte ReadFlash + 1 +_082E1B34: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r0, r1, 0x1 + lsls r0, 16 +_082E1B40: + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E1B34 + mov r3, sp + adds r3, 0x1 + ldr r0, _082E1B6C + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r4, r0 + adds r0, r4, 0 + movs r2, 0xE0 + lsls r2, 20 + adds r1, r5, r2 + adds r0, r1 + adds r1, r6, 0 + adds r2, r7, 0 + bl _call_via_r3 + add sp, 0x80 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E1B6C: .4byte 0x03007850 + thumb_func_end ReadFlash + + thumb_func_start VerifyFlashSector_Core +VerifyFlashSector_Core: @ 82E1B70 + push {r4,r5,lr} + adds r5, r0, 0 + adds r3, r1, 0 + subs r4, r2, 0x1 + cmp r2, 0 + beq _082E1B96 + movs r2, 0x1 + negs r2, r2 +_082E1B80: + ldrb r1, [r3] + ldrb r0, [r5] + adds r5, 0x1 + adds r3, 0x1 + cmp r1, r0 + beq _082E1B90 + subs r0, r3, 0x1 + b _082E1B98 +_082E1B90: + subs r4, 0x1 + cmp r4, r2 + bne _082E1B80 +_082E1B96: + movs r0, 0 +_082E1B98: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end VerifyFlashSector_Core + + thumb_func_start VerifyFlashSector +VerifyFlashSector: @ 82E1BA0 + push {r4,r5,lr} + sub sp, 0x100 + adds r5, r1, 0 + lsls r3, r0, 16 + lsrs r4, r3, 16 + ldr r2, _082E1BE8 + ldrh r0, [r2] + ldr r1, _082E1BEC + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + strh r0, [r2] + ldr r0, _082E1BF0 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + cmp r1, r0 + bne _082E1BD4 + lsrs r0, r3, 20 + lsls r0, 24 + lsrs r0, 24 + bl SwitchFlashBank + movs r0, 0xF + ands r4, r0 +_082E1BD4: + ldr r3, _082E1BF4 + movs r0, 0x1 + eors r3, r0 + mov r2, sp + ldr r0, _082E1BF8 + ldr r1, _082E1BF4 + subs r0, r1 + lsls r0, 15 + b _082E1C08 + .align 2, 0 +_082E1BE8: .4byte 0x04000204 +_082E1BEC: .4byte 0x0000fffc +_082E1BF0: .4byte 0x03007850 +_082E1BF4: .4byte VerifyFlashSector_Core + 1 +_082E1BF8: .4byte VerifyFlashSector + 1 +_082E1BFC: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r0, r1, 0x1 + lsls r0, 16 +_082E1C08: + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E1BFC + mov r3, sp + adds r3, 0x1 + ldr r0, _082E1C34 + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r4, r1 + adds r1, r4, 0 + movs r2, 0xE0 + lsls r2, 20 + adds r1, r2 + ldrh r2, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r3 + add sp, 0x100 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_082E1C34: .4byte 0x03007850 + thumb_func_end VerifyFlashSector + + thumb_func_start VerifyFlashSectorFirstNBytes +VerifyFlashSectorFirstNBytes: @ 82E1C38 + push {r4-r6,lr} + sub sp, 0x100 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r2, r0, 16 + lsrs r4, r2, 16 + ldr r0, _082E1C80 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + cmp r1, r0 + bne _082E1C60 + lsrs r0, r2, 20 + lsls r0, 24 + lsrs r0, 24 + bl SwitchFlashBank + movs r0, 0xF + ands r4, r0 +_082E1C60: + ldr r2, _082E1C84 + ldrh r0, [r2] + ldr r1, _082E1C88 + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + strh r0, [r2] + ldr r3, _082E1C8C + movs r0, 0x1 + eors r3, r0 + mov r2, sp + ldr r0, _082E1C90 + ldr r1, _082E1C8C + subs r0, r1 + lsls r0, 15 + b _082E1CA0 + .align 2, 0 +_082E1C80: .4byte 0x03007850 +_082E1C84: .4byte 0x04000204 +_082E1C88: .4byte 0x0000fffc +_082E1C8C: .4byte VerifyFlashSector_Core + 1 +_082E1C90: .4byte VerifyFlashSector + 1 +_082E1C94: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r0, r1, 0x1 + lsls r0, 16 +_082E1CA0: + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E1C94 + mov r3, sp + adds r3, 0x1 + ldr r0, _082E1CCC + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r4, r1 + adds r1, r4, 0 + movs r0, 0xE0 + lsls r0, 20 + adds r1, r0 + adds r0, r5, 0 + adds r2, r6, 0 + bl _call_via_r3 + add sp, 0x100 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_082E1CCC: .4byte 0x03007850 + thumb_func_end VerifyFlashSectorFirstNBytes + + thumb_func_start ProgramFlashSectorsAndVerify +ProgramFlashSectorsAndVerify: @ 82E1CD0 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r4, r0, 16 + movs r6, 0 + b _082E1CE2 +_082E1CDC: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_082E1CE2: + cmp r6, 0x2 + bhi _082E1D08 + ldr r0, _082E1D10 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _082E1CDC + adds r0, r4, 0 + adds r1, r5, 0 + bl VerifyFlashSector + adds r2, r0, 0 + cmp r2, 0 + bne _082E1CDC +_082E1D08: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_082E1D10: .4byte 0x0300784c + thumb_func_end ProgramFlashSectorsAndVerify + + thumb_func_start ProgramFlashSectorsVerifyFirstNBytes +ProgramFlashSectorsVerifyFirstNBytes: @ 82E1D14 + push {r4-r7,lr} + adds r5, r1, 0 + adds r7, r2, 0 + lsls r0, 16 + lsrs r4, r0, 16 + movs r6, 0 + b _082E1D28 +_082E1D22: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_082E1D28: + cmp r6, 0x2 + bhi _082E1D50 + ldr r0, _082E1D58 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _082E1D22 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl VerifyFlashSectorFirstNBytes + adds r3, r0, 0 + cmp r3, 0 + bne _082E1D22 +_082E1D50: + adds r0, r3, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E1D58: .4byte 0x0300784c + thumb_func_end ProgramFlashSectorsVerifyFirstNBytes + + thumb_func_start IdentifyFlash +IdentifyFlash: @ 82E1D5C + push {r4,lr} + ldr r2, _082E1D7C + ldrh r0, [r2] + ldr r1, _082E1D80 + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + strh r0, [r2] + bl ReadFlashID + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, _082E1D84 + movs r4, 0x1 + b _082E1D8A + .align 2, 0 +_082E1D7C: .4byte 0x04000204 +_082E1D80: .4byte 0x0000fffc +_082E1D84: .4byte 0x089a30d0 +_082E1D88: + adds r2, 0x4 +_082E1D8A: + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _082E1D9E + ldrh r0, [r1, 0x2C] + cmp r3, r0 + bne _082E1D88 + movs r4, 0 +_082E1D9E: + ldr r1, _082E1DE0 + ldr r0, [r2] + ldr r0, [r0] + str r0, [r1] + ldr r1, _082E1DE4 + ldr r0, [r2] + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r1, _082E1DE8 + ldr r0, [r2] + ldr r0, [r0, 0x8] + str r0, [r1] + ldr r1, _082E1DEC + ldr r0, [r2] + ldr r0, [r0, 0xC] + str r0, [r1] + ldr r1, _082E1DF0 + ldr r0, [r2] + ldr r0, [r0, 0x10] + str r0, [r1] + ldr r1, _082E1DF4 + ldr r0, [r2] + ldr r0, [r0, 0x14] + str r0, [r1] + ldr r1, _082E1DF8 + ldr r0, [r2] + adds r0, 0x18 + str r0, [r1] + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_082E1DE0: .4byte 0x03007854 +_082E1DE4: .4byte 0x0300784c +_082E1DE8: .4byte 0x0300785c +_082E1DEC: .4byte 0x03007860 +_082E1DF0: .4byte 0x03007848 +_082E1DF4: .4byte 0x03007864 +_082E1DF8: .4byte 0x03007850 + thumb_func_end IdentifyFlash + + thumb_func_start PollingSR_COMMON +PollingSR_COMMON: @ 82E1DFC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0 + mov r8, r0 + adds r0, r7, 0 + bl StartFlashTimer + ldr r6, _082E1E20 + ldr r1, _082E1E24 + mov r9, r1 + b _082E1E60 + .align 2, 0 +_082E1E20: .4byte 0x03007844 +_082E1E24: .4byte 0x0e005555 +_082E1E28: + movs r0, 0xF0 + mov r1, r9 + strb r0, [r1] + movs r0, 0xA0 + lsls r0, 8 + b _082E1E56 +_082E1E34: + ldr r0, _082E1E5C + ldrb r0, [r0] + cmp r0, 0 + beq _082E1E60 + ldr r1, [r6] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + beq _082E1E88 + movs r0, 0xF0 + mov r1, r9 + strb r0, [r1] + movs r0, 0xC0 + lsls r0, 8 +_082E1E56: + orrs r7, r0 + mov r8, r7 + b _082E1E88 + .align 2, 0 +_082E1E5C: .4byte 0x03007840 +_082E1E60: + ldr r1, [r6] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r5 + beq _082E1E88 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _082E1E34 + ldr r1, [r6] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _082E1E28 +_082E1E88: + bl StopFlashTimer + mov r0, r8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end PollingSR_COMMON + + thumb_func_start EraseFlashChip +EraseFlashChip: @ 82E1E9C + push {r4-r6,lr} + sub sp, 0x40 + ldr r5, _082E1EF8 + ldrh r1, [r5] + ldr r6, _082E1EFC + ands r1, r6 + ldr r0, _082E1F00 + ldr r0, [r0] + ldrh r0, [r0, 0x10] + orrs r1, r0 + strh r1, [r5] + ldr r1, _082E1F04 + movs r4, 0xAA + strb r4, [r1] + ldr r3, _082E1F08 + movs r2, 0x55 + strb r2, [r3] + movs r0, 0x80 + strb r0, [r1] + strb r4, [r1] + strb r2, [r3] + movs r0, 0x10 + strb r0, [r1] + mov r0, sp + bl SetReadFlash1 + ldr r0, _082E1F0C + movs r1, 0xE0 + lsls r1, 20 + ldr r3, [r0] + movs r0, 0x3 + movs r2, 0xFF + bl _call_via_r3 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r5] + ands r1, r6 + movs r2, 0x3 + orrs r1, r2 + strh r1, [r5] + add sp, 0x40 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_082E1EF8: .4byte 0x04000204 +_082E1EFC: .4byte 0x0000fffc +_082E1F00: .4byte 0x03007850 +_082E1F04: .4byte 0x0e005555 +_082E1F08: .4byte 0x0e002aaa +_082E1F0C: .4byte 0x03007848 + thumb_func_end EraseFlashChip + + thumb_func_start EraseFlashSector +EraseFlashSector: @ 82E1F10 + push {r4-r7,lr} + sub sp, 0x40 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _082E1F28 + ldr r0, [r0] + ldrh r0, [r0, 0xA] + cmp r6, r0 + bcc _082E1F30 + ldr r0, _082E1F2C + b _082E1FD0 + .align 2, 0 +_082E1F28: .4byte 0x03007850 +_082E1F2C: .4byte 0x000080ff +_082E1F30: + lsrs r0, r6, 4 + lsls r0, 24 + lsrs r0, 24 + bl SwitchFlashBank + movs r0, 0xF + ands r6, r0 + movs r7, 0 +_082E1F40: + ldr r3, _082E1FA8 + ldrh r1, [r3] + ldr r0, _082E1FAC + ands r1, r0 + ldr r0, _082E1FB0 + ldr r2, [r0] + ldrh r0, [r2, 0x10] + orrs r1, r0 + strh r1, [r3] + ldrb r4, [r2, 0x8] + adds r0, r6, 0 + lsls r0, r4 + adds r4, r0, 0 + movs r0, 0xE0 + lsls r0, 20 + adds r4, r0 + ldr r1, _082E1FB4 + movs r5, 0xAA + strb r5, [r1] + ldr r3, _082E1FB8 + movs r2, 0x55 + strb r2, [r3] + movs r0, 0x80 + strb r0, [r1] + strb r5, [r1] + strb r2, [r3] + movs r0, 0x30 + strb r0, [r4] + mov r0, sp + bl SetReadFlash1 + ldr r0, _082E1FBC + ldr r3, [r0] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0xFF + bl _call_via_r3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r0, 0xA0 + lsls r0, 8 + ands r0, r3 + cmp r0, 0 + beq _082E1FC0 + cmp r7, 0x3 + bhi _082E1FC0 + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + b _082E1F40 + .align 2, 0 +_082E1FA8: .4byte 0x04000204 +_082E1FAC: .4byte 0x0000fffc +_082E1FB0: .4byte 0x03007850 +_082E1FB4: .4byte 0x0e005555 +_082E1FB8: .4byte 0x0e002aaa +_082E1FBC: .4byte 0x03007848 +_082E1FC0: + ldr r2, _082E1FD8 + ldrh r0, [r2] + ldr r1, _082E1FDC + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + strh r0, [r2] + adds r0, r3, 0 +_082E1FD0: + add sp, 0x40 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E1FD8: .4byte 0x04000204 +_082E1FDC: .4byte 0x0000fffc + thumb_func_end EraseFlashSector + + thumb_func_start ProgramFlashByte +ProgramFlashByte: @ 82E1FE0 + push {r4-r7,lr} + sub sp, 0x40 + adds r6, r1, 0 + lsls r1, r0, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r5, _082E2050 + ldr r0, [r5] + ldr r0, [r0, 0x4] + cmp r6, r0 + bcs _082E2068 + lsrs r0, r1, 20 + lsls r0, 24 + lsrs r0, 24 + bl SwitchFlashBank + movs r0, 0xF + ldr r1, [r5] + ands r4, r0 + ldrb r1, [r1, 0x8] + lsls r4, r1 + movs r1, 0xE0 + lsls r1, 20 + adds r0, r6, r1 + adds r4, r0 + mov r0, sp + bl SetReadFlash1 + ldr r2, _082E2054 + ldrh r0, [r2] + ldr r1, _082E2058 + ands r0, r1 + ldr r1, [r5] + ldrh r1, [r1, 0x10] + orrs r0, r1 + strh r0, [r2] + ldr r2, _082E205C + movs r0, 0xAA + strb r0, [r2] + ldr r1, _082E2060 + movs r0, 0x55 + strb r0, [r1] + movs r0, 0xA0 + strb r0, [r2] + strb r7, [r4] + ldr r0, _082E2064 + ldr r3, [r0] + movs r0, 0x1 + adds r1, r4, 0 + adds r2, r7, 0 + bl _call_via_r3 + lsls r0, 16 + lsrs r0, 16 + b _082E206C + .align 2, 0 +_082E2050: .4byte 0x03007850 +_082E2054: .4byte 0x04000204 +_082E2058: .4byte 0x0000fffc +_082E205C: .4byte 0x0e005555 +_082E2060: .4byte 0x0e002aaa +_082E2064: .4byte 0x03007848 +_082E2068: + movs r0, 0x80 + lsls r0, 8 +_082E206C: + add sp, 0x40 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ProgramFlashByte + + thumb_func_start ProgramFlashByteInternal +ProgramFlashByteInternal: @ 82E2074 + push {r4,lr} + ldr r4, _082E20A0 + movs r2, 0xAA + strb r2, [r4] + ldr r3, _082E20A4 + movs r2, 0x55 + strb r2, [r3] + movs r2, 0xA0 + strb r2, [r4] + ldrb r2, [r0] + strb r2, [r1] + ldr r3, _082E20A8 + ldrb r2, [r0] + ldr r3, [r3] + movs r0, 0x1 + bl _call_via_r3 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_082E20A0: .4byte 0x0e005555 +_082E20A4: .4byte 0x0e002aaa +_082E20A8: .4byte 0x03007848 + thumb_func_end ProgramFlashByteInternal + + thumb_func_start ProgramFlashSector +ProgramFlashSector: @ 82E20AC + push {r4-r7,lr} + sub sp, 0x40 + adds r7, r1, 0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _082E20C4 + ldr r0, [r0] + ldrh r0, [r0, 0xA] + cmp r4, r0 + bcc _082E20CC + ldr r0, _082E20C8 + b _082E2146 + .align 2, 0 +_082E20C4: .4byte 0x03007850 +_082E20C8: .4byte 0x000080ff +_082E20CC: + adds r0, r4, 0 + bl EraseFlashSector + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _082E2144 + lsrs r0, r4, 4 + lsls r0, 24 + lsrs r0, 24 + bl SwitchFlashBank + movs r0, 0xF + ands r4, r0 + mov r0, sp + bl SetReadFlash1 + ldr r3, _082E2114 + ldrh r1, [r3] + ldr r0, _082E2118 + ands r1, r0 + ldr r0, _082E211C + ldr r2, [r0] + ldrh r0, [r2, 0x10] + orrs r1, r0 + strh r1, [r3] + ldr r1, _082E2120 + ldr r0, [r2, 0x4] + strh r0, [r1] + ldrb r0, [r2, 0x8] + lsls r4, r0 + movs r0, 0xE0 + lsls r0, 20 + adds r4, r0 + adds r6, r1, 0 + b _082E212E + .align 2, 0 +_082E2114: .4byte 0x04000204 +_082E2118: .4byte 0x0000fffc +_082E211C: .4byte 0x03007850 +_082E2120: .4byte 0x03007858 +_082E2124: + ldrh r0, [r6] + subs r0, 0x1 + strh r0, [r6] + adds r7, 0x1 + adds r4, 0x1 +_082E212E: + ldrh r0, [r6] + cmp r0, 0 + beq _082E2144 + adds r0, r7, 0 + adds r1, r4, 0 + bl ProgramFlashByteInternal + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _082E2124 +_082E2144: + adds r0, r5, 0 +_082E2146: + add sp, 0x40 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ProgramFlashSector + + thumb_func_start sub_82E2150 +sub_82E2150: @ 82E2150 + push {r7,lr} + mov r7, sp + bl sub_82E29F0 + ldr r0, _082E2164 + movs r1, 0 + strb r1, [r0] + pop {r7} + pop {r0} + bx r0 + .align 2, 0 +_082E2164: .4byte 0x03001a7e + thumb_func_end sub_82E2150 + + thumb_func_start sub_82E2168 +sub_82E2168: @ 82E2168 + push {r7,lr} + mov r7, sp + bl sub_82E2A04 + ldr r0, _082E217C + movs r1, 0x1 + strb r1, [r0] + pop {r7} + pop {r0} + bx r0 + .align 2, 0 +_082E217C: .4byte 0x03001a7e + thumb_func_end sub_82E2168 + + thumb_func_start sub_82E2180 +sub_82E2180: @ 82E2180 + push {r7,lr} + sub sp, 0x10 + mov r7, sp + adds r1, r7, 0x4 + adds r0, r1, 0 + bl sub_82E22DC + lsls r1, r0, 24 + lsrs r0, r1, 24 + cmp r0, 0 + bne _082E219A + movs r0, 0 + b _082E224E +_082E219A: + adds r0, r7, 0 + movs r1, 0 + strb r1, [r0] + adds r0, r7, 0x4 + ldrb r1, [r0, 0x7] + movs r2, 0xC0 + adds r0, r1, 0 + ands r0, r2 + adds r2, r0, 0 + lsls r1, r2, 24 + lsrs r0, r1, 24 + cmp r0, 0x80 + beq _082E21CA + adds r0, r7, 0x4 + ldrb r1, [r0, 0x7] + movs r2, 0xC0 + adds r0, r1, 0 + ands r0, r2 + adds r2, r0, 0 + lsls r1, r2, 24 + lsrs r0, r1, 24 + cmp r0, 0 + bne _082E21E8 + b _082E21CA +_082E21CA: + bl sub_82E2258 + lsls r1, r0, 24 + lsrs r0, r1, 24 + cmp r0, 0 + bne _082E21DA + movs r0, 0 + b _082E224E +_082E21DA: + adds r1, r7, 0 + adds r0, r7, 0 + adds r1, r7, 0 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] +_082E21E8: + adds r1, r7, 0x4 + adds r0, r1, 0 + bl sub_82E259C + adds r0, r7, 0x4 + ldrb r1, [r0, 0x6] + movs r2, 0x80 + adds r0, r1, 0 + ands r0, r2 + adds r2, r0, 0 + lsls r1, r2, 24 + lsrs r0, r1, 24 + cmp r0, 0 + beq _082E2236 + bl sub_82E2258 + lsls r1, r0, 24 + lsrs r0, r1, 24 + cmp r0, 0 + bne _082E2228 + adds r0, r7, 0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r1, r0, 0 + movs r2, 0xF + adds r0, r1, 0 + bics r0, r2 + adds r1, r0, 0 + lsls r0, r1, 24 + lsrs r1, r0, 24 + adds r0, r1, 0 + b _082E224E +_082E2228: + adds r1, r7, 0 + adds r0, r7, 0 + adds r1, r7, 0 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] +_082E2236: + adds r0, r7, 0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r1, r0, 0 + movs r2, 0x1 + adds r0, r1, 0 + orrs r0, r2 + adds r1, r0, 0 + lsls r0, r1, 24 + lsrs r1, r0, 24 + adds r0, r1, 0 + b _082E224E +_082E224E: + add sp, 0x10 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2180 + + thumb_func_start sub_82E2258 +sub_82E2258: @ 82E2258 + push {r7,lr} + sub sp, 0x10 + mov r7, sp + ldr r0, _082E226C + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E2270 + movs r0, 0 + b _082E22D4 + .align 2, 0 +_082E226C: .4byte 0x03001a7e +_082E2270: + ldr r0, _082E22C8 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E22CC + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E22CC + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E22D0 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x60 + bl sub_82E2820 + ldr r0, _082E22CC + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E22CC + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E22C8 + movs r1, 0 + strb r1, [r0] + adds r0, r7, 0x4 + ldrb r1, [r0, 0x7] + movs r2, 0 + ands r1, r2 + adds r2, r1, 0 + movs r3, 0x40 + adds r1, r2, 0 + orrs r1, r3 + adds r2, r1, 0 + strb r2, [r0, 0x7] + adds r1, r7, 0x4 + adds r0, r1, 0 + bl sub_82E23A8 + adds r1, r7, 0 + strb r0, [r1] + adds r0, r7, 0 + ldrb r1, [r0] + adds r0, r1, 0 + b _082E22D4 + .align 2, 0 +_082E22C8: .4byte 0x03001a7e +_082E22CC: .4byte _080000C4 +_082E22D0: .4byte _080000C6 +_082E22D4: + add sp, 0x10 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2258 + + thumb_func_start sub_82E22DC +sub_82E22DC: @ 82E22DC + push {r4,r7,lr} + sub sp, 0x8 + mov r7, sp + str r0, [r7] + ldr r0, _082E22F0 + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E22F4 + movs r0, 0 + b _082E23A0 + .align 2, 0 +_082E22F0: .4byte 0x03001a7e +_082E22F4: + ldr r0, _082E2394 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E2398 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2398 + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E239C + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x63 + bl sub_82E2820 + ldr r0, _082E239C + movs r1, 0x5 + strh r1, [r0] + bl sub_82E2964 + adds r1, r7, 0x4 + strb r0, [r1] + ldr r0, [r7] + adds r1, r7, 0x4 + ldrb r2, [r1] + movs r3, 0xC0 + adds r1, r2, 0 + ands r1, r3 + adds r2, r7, 0x4 + ldrb r3, [r2] + movs r4, 0x20 + adds r2, r3, 0 + ands r2, r4 + adds r4, r2, 0 + lsls r3, r4, 24 + lsrs r2, r3, 24 + lsrs r3, r2, 3 + adds r2, r3, 0 + orrs r1, r2 + adds r2, r7, 0x4 + ldrb r3, [r2] + movs r4, 0x8 + adds r2, r3, 0 + ands r2, r4 + adds r4, r2, 0 + lsls r3, r4, 24 + lsrs r2, r3, 24 + lsrs r3, r2, 2 + adds r2, r3, 0 + orrs r1, r2 + adds r2, r7, 0x4 + ldrb r3, [r2] + movs r4, 0x2 + adds r2, r3, 0 + ands r2, r4 + adds r4, r2, 0 + lsls r3, r4, 24 + lsrs r2, r3, 24 + lsrs r3, r2, 1 + adds r2, r3, 0 + orrs r1, r2 + ldrb r2, [r0, 0x7] + movs r3, 0 + ands r2, r3 + adds r3, r2, 0 + adds r2, r3, 0 + orrs r2, r1 + adds r1, r2, 0 + strb r1, [r0, 0x7] + ldr r0, _082E2398 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2398 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2394 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E23A0 + .align 2, 0 +_082E2394: .4byte 0x03001a7e +_082E2398: .4byte _080000C4 +_082E239C: .4byte _080000C6 +_082E23A0: + add sp, 0x8 + pop {r4,r7} + pop {r1} + bx r1 + thumb_func_end sub_82E22DC + + thumb_func_start sub_82E23A8 +sub_82E23A8: @ 82E23A8 + push {r4,r7,lr} + sub sp, 0x8 + mov r7, sp + str r0, [r7] + ldr r0, _082E23BC + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E23C0 + movs r0, 0 + b _082E2448 + .align 2, 0 +_082E23BC: .4byte 0x03001a7e +_082E23C0: + ldr r0, _082E243C + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E2440 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2440 + movs r1, 0x5 + strh r1, [r0] + adds r0, r7, 0x4 + ldr r1, [r7] + ldrb r2, [r1, 0x7] + movs r3, 0x4 + adds r1, r2, 0 + ands r1, r3 + adds r2, r1, 0 + lsls r1, r2, 3 + ldr r2, [r7] + ldrb r3, [r2, 0x7] + movs r4, 0x2 + adds r2, r3, 0 + ands r2, r4 + adds r3, r2, 0 + lsls r2, r3, 2 + adds r3, r2, 0 + movs r4, 0x40 + adds r2, r3, 0 + orrs r2, r4 + orrs r1, r2 + ldr r2, [r7] + ldrb r3, [r2, 0x7] + movs r4, 0x1 + adds r2, r3, 0 + ands r2, r4 + adds r3, r2, 0 + lsls r2, r3, 1 + orrs r1, r2 + adds r2, r1, 0 + strb r2, [r0] + ldr r0, _082E2444 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x62 + bl sub_82E2820 + adds r0, r7, 0x4 + ldrb r1, [r0] + adds r0, r1, 0 + bl sub_82E28C4 + ldr r0, _082E2440 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2440 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E243C + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E2448 + .align 2, 0 +_082E243C: .4byte 0x03001a7e +_082E2440: .4byte _080000C4 +_082E2444: .4byte _080000C6 +_082E2448: + add sp, 0x8 + pop {r4,r7} + pop {r1} + bx r1 + thumb_func_end sub_82E23A8 + + thumb_func_start sub_82E2450 +sub_82E2450: @ 82E2450 + push {r7,lr} + sub sp, 0x8 + mov r7, sp + str r0, [r7] + ldr r0, _082E2464 + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E2468 + movs r0, 0 + b _082E24F8 + .align 2, 0 +_082E2464: .4byte 0x03001a7e +_082E2468: + ldr r0, _082E249C + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E24A0 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E24A0 + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E24A4 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x65 + bl sub_82E2820 + ldr r0, _082E24A4 + movs r1, 0x5 + strh r1, [r0] + adds r0, r7, 0x4 + movs r1, 0 + strb r1, [r0] +_082E2492: + adds r0, r7, 0x4 + ldrb r1, [r0] + cmp r1, 0x6 + bls _082E24A8 + b _082E24C6 + .align 2, 0 +_082E249C: .4byte 0x03001a7e +_082E24A0: .4byte _080000C4 +_082E24A4: .4byte _080000C6 +_082E24A8: + bl sub_82E2964 + adds r1, r7, 0x4 + ldrb r2, [r1] + ldr r3, [r7] + adds r1, r2, r3 + strb r0, [r1] + adds r1, r7, 0x4 + adds r0, r7, 0x4 + adds r1, r7, 0x4 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] + b _082E2492 +_082E24C6: + ldr r1, [r7] + adds r0, r1, 0x4 + ldr r2, [r7] + adds r1, r2, 0x4 + ldrb r2, [r1] + movs r3, 0x7F + adds r1, r2, 0 + ands r1, r3 + adds r2, r1, 0 + strb r2, [r0] + ldr r0, _082E24F0 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E24F0 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E24F4 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E24F8 + .align 2, 0 +_082E24F0: .4byte _080000C4 +_082E24F4: .4byte 0x03001a7e +_082E24F8: + add sp, 0x8 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2450 + + thumb_func_start sub_82E2500 +sub_82E2500: @ 82E2500 + push {r7,lr} + sub sp, 0x8 + mov r7, sp + str r0, [r7] + ldr r0, _082E2514 + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E2518 + movs r0, 0 + b _082E2594 + .align 2, 0 +_082E2514: .4byte 0x03001a7e +_082E2518: + ldr r0, _082E2548 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E254C + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E254C + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E2550 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x64 + bl sub_82E2820 + adds r0, r7, 0x4 + movs r1, 0 + strb r1, [r0] +_082E253C: + adds r0, r7, 0x4 + ldrb r1, [r0] + cmp r1, 0x6 + bls _082E2554 + b _082E2574 + .align 2, 0 +_082E2548: .4byte 0x03001a7e +_082E254C: .4byte _080000C4 +_082E2550: .4byte _080000C6 +_082E2554: + adds r0, r7, 0x4 + ldrb r1, [r0] + ldr r2, [r7] + adds r0, r1, r2 + ldrb r1, [r0] + adds r0, r1, 0 + bl sub_82E28C4 + adds r1, r7, 0x4 + adds r0, r7, 0x4 + adds r1, r7, 0x4 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] + b _082E253C +_082E2574: + ldr r0, _082E258C + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E258C + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2590 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E2594 + .align 2, 0 +_082E258C: .4byte _080000C4 +_082E2590: .4byte 0x03001a7e +_082E2594: + add sp, 0x8 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2500 + + thumb_func_start sub_82E259C +sub_82E259C: @ 82E259C + push {r7,lr} + sub sp, 0x8 + mov r7, sp + str r0, [r7] + ldr r0, _082E25B0 + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E25B4 + movs r0, 0 + b _082E2648 + .align 2, 0 +_082E25B0: .4byte 0x03001a7e +_082E25B4: + ldr r0, _082E25E8 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E25EC + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E25EC + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E25F0 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x67 + bl sub_82E2820 + ldr r0, _082E25F0 + movs r1, 0x5 + strh r1, [r0] + adds r0, r7, 0x4 + movs r1, 0 + strb r1, [r0] +_082E25DE: + adds r0, r7, 0x4 + ldrb r1, [r0] + cmp r1, 0x2 + bls _082E25F4 + b _082E2614 + .align 2, 0 +_082E25E8: .4byte 0x03001a7e +_082E25EC: .4byte _080000C4 +_082E25F0: .4byte _080000C6 +_082E25F4: + bl sub_82E2964 + adds r1, r7, 0x4 + ldrb r2, [r1] + ldr r3, [r7] + adds r1, r2, r3 + adds r2, r1, 0x4 + strb r0, [r2] + adds r1, r7, 0x4 + adds r0, r7, 0x4 + adds r1, r7, 0x4 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] + b _082E25DE +_082E2614: + ldr r1, [r7] + adds r0, r1, 0x4 + ldr r2, [r7] + adds r1, r2, 0x4 + ldrb r2, [r1] + movs r3, 0x7F + adds r1, r2, 0 + ands r1, r3 + adds r2, r1, 0 + strb r2, [r0] + ldr r0, _082E2640 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2640 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2644 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E2648 + .align 2, 0 +_082E2640: .4byte _080000C4 +_082E2644: .4byte 0x03001a7e +_082E2648: + add sp, 0x8 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E259C + + thumb_func_start sub_82E2650 +sub_82E2650: @ 82E2650 + push {r7,lr} + sub sp, 0x8 + mov r7, sp + str r0, [r7] + ldr r0, _082E2664 + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E2668 + movs r0, 0 + b _082E26E4 + .align 2, 0 +_082E2664: .4byte 0x03001a7e +_082E2668: + ldr r0, _082E2698 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _082E269C + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E269C + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E26A0 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x66 + bl sub_82E2820 + adds r0, r7, 0x4 + movs r1, 0 + strb r1, [r0] +_082E268C: + adds r0, r7, 0x4 + ldrb r1, [r0] + cmp r1, 0x2 + bls _082E26A4 + b _082E26C6 + .align 2, 0 +_082E2698: .4byte 0x03001a7e +_082E269C: .4byte _080000C4 +_082E26A0: .4byte _080000C6 +_082E26A4: + adds r0, r7, 0x4 + ldrb r1, [r0] + ldr r2, [r7] + adds r0, r1, r2 + adds r1, r0, 0x4 + ldrb r2, [r1] + adds r0, r2, 0 + bl sub_82E28C4 + adds r1, r7, 0x4 + adds r0, r7, 0x4 + adds r1, r7, 0x4 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] + b _082E268C +_082E26C6: + ldr r0, _082E26DC + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E26DC + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E26E0 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E26E4 + .align 2, 0 +_082E26DC: .4byte _080000C4 +_082E26E0: .4byte 0x03001a7e +_082E26E4: + add sp, 0x8 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2650 + + thumb_func_start sub_82E26EC +sub_82E26EC: @ 82E26EC + push {r4,r7,lr} + sub sp, 0xC + mov r7, sp + str r0, [r7] + ldr r0, _082E2700 + ldrb r1, [r0] + cmp r1, 0x1 + bne _082E2704 + movs r0, 0 + b _082E2818 + .align 2, 0 +_082E2700: .4byte 0x03001a7e +_082E2704: + ldr r0, _082E276C + movs r1, 0x1 + strb r1, [r0] + adds r0, r7, 0 + adds r0, 0x8 + ldr r1, [r7] + ldrb r2, [r1, 0x8] + movs r3, 0xF + adds r1, r2, 0 + ands r1, r3 + ldr r2, [r7] + ldrb r3, [r2, 0x8] + lsrs r2, r3, 4 + adds r3, r2, 0 + movs r4, 0xF + adds r2, r3, 0 + ands r2, r4 + adds r4, r2, 0 + lsls r3, r4, 24 + lsrs r2, r3, 24 + adds r4, r2, 0 + lsls r3, r4, 2 + adds r3, r2 + lsls r2, r3, 1 + adds r1, r2 + ldrb r2, [r0] + movs r3, 0 + ands r2, r3 + adds r3, r2, 0 + adds r2, r3, 0 + orrs r2, r1 + adds r1, r2, 0 + strb r1, [r0] + adds r0, r7, 0 + adds r0, 0x8 + ldrb r1, [r0] + cmp r1, 0xB + bhi _082E2770 + adds r0, r7, 0 + adds r0, 0x8 + ldr r1, [r7] + ldrb r2, [r0] + movs r3, 0 + ands r2, r3 + adds r3, r2, 0 + ldrb r1, [r1, 0x8] + adds r2, r3, 0 + orrs r2, r1 + adds r1, r2, 0 + strb r1, [r0] + b _082E278E + .align 2, 0 +_082E276C: .4byte 0x03001a7e +_082E2770: + adds r0, r7, 0 + adds r0, 0x8 + ldr r1, [r7] + ldrb r2, [r1, 0x8] + movs r3, 0x80 + adds r1, r2, 0 + orrs r1, r3 + ldrb r2, [r0] + movs r3, 0 + ands r2, r3 + adds r3, r2, 0 + adds r2, r3, 0 + orrs r2, r1 + adds r1, r2, 0 + strb r1, [r0] +_082E278E: + adds r0, r7, 0 + adds r0, 0x8 + ldr r1, [r7] + ldrb r2, [r0, 0x1] + movs r3, 0 + ands r2, r3 + adds r3, r2, 0 + ldrb r1, [r1, 0x9] + adds r2, r3, 0 + orrs r2, r1 + adds r1, r2, 0 + strb r1, [r0, 0x1] + ldr r0, _082E27D0 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E27D0 + movs r1, 0x5 + strh r1, [r0] + ldr r0, _082E27D4 + movs r1, 0x7 + strh r1, [r0] + movs r0, 0x68 + bl sub_82E2820 + adds r0, r7, 0x4 + movs r1, 0 + strb r1, [r0] +_082E27C4: + adds r0, r7, 0x4 + ldrb r1, [r0] + cmp r1, 0x1 + bls _082E27D8 + b _082E27FA + .align 2, 0 +_082E27D0: .4byte _080000C4 +_082E27D4: .4byte _080000C6 +_082E27D8: + adds r0, r7, 0 + adds r0, 0x8 + adds r1, r7, 0x4 + ldrb r2, [r1] + adds r0, r2 + ldrb r1, [r0] + adds r0, r1, 0 + bl sub_82E28C4 + adds r1, r7, 0x4 + adds r0, r7, 0x4 + adds r1, r7, 0x4 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] + b _082E27C4 +_082E27FA: + ldr r0, _082E2810 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2810 + movs r1, 0x1 + strh r1, [r0] + ldr r0, _082E2814 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _082E2818 + .align 2, 0 +_082E2810: .4byte _080000C4 +_082E2814: .4byte 0x03001a7e +_082E2818: + add sp, 0xC + pop {r4,r7} + pop {r1} + bx r1 + thumb_func_end sub_82E26EC + + thumb_func_start sub_82E2820 +sub_82E2820: @ 82E2820 + push {r4,r5,r7,lr} + sub sp, 0x4 + mov r7, sp + adds r1, r0, 0 + adds r2, r7, 0 + strb r1, [r2] + adds r1, r7, 0x1 + movs r2, 0 + strb r2, [r1] +_082E2832: + adds r1, r7, 0x1 + ldrb r2, [r1] + cmp r2, 0x7 + bls _082E283C + b _082E28BC +_082E283C: + adds r1, r7, 0x2 + adds r3, r7, 0 + ldrb r2, [r3] + adds r3, r7, 0x1 + ldrb r4, [r3] + movs r5, 0x7 + subs r3, r5, r4 + asrs r2, r3 + adds r3, r2, 0 + movs r4, 0x1 + adds r2, r3, 0 + ands r2, r4 + adds r3, r2, 0 + strb r3, [r1] + ldr r1, _082E28B8 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x4 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + ldr r1, _082E28B8 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x4 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + ldr r1, _082E28B8 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x4 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + ldr r1, _082E28B8 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x5 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + adds r2, r7, 0x1 + adds r1, r7, 0x1 + adds r2, r7, 0x1 + ldrb r3, [r2] + adds r2, r3, 0x1 + adds r3, r2, 0 + strb r3, [r1] + b _082E2832 + .align 2, 0 +_082E28B8: .4byte _080000C4 +_082E28BC: + add sp, 0x4 + pop {r4,r5,r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2820 + + thumb_func_start sub_82E28C4 +sub_82E28C4: @ 82E28C4 + push {r4,r7,lr} + sub sp, 0x4 + mov r7, sp + adds r1, r0, 0 + adds r2, r7, 0 + strb r1, [r2] + adds r1, r7, 0x1 + movs r2, 0 + strb r2, [r1] +_082E28D6: + adds r1, r7, 0x1 + ldrb r2, [r1] + cmp r2, 0x7 + bls _082E28E0 + b _082E295C +_082E28E0: + adds r1, r7, 0x2 + adds r3, r7, 0 + ldrb r2, [r3] + adds r3, r7, 0x1 + ldrb r4, [r3] + asrs r2, r4 + adds r3, r2, 0 + movs r4, 0x1 + adds r2, r3, 0 + ands r2, r4 + adds r3, r2, 0 + strb r3, [r1] + ldr r1, _082E2958 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x4 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + ldr r1, _082E2958 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x4 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + ldr r1, _082E2958 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x4 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + ldr r1, _082E2958 + adds r2, r7, 0x2 + ldrb r3, [r2] + adds r2, r3, 0 + lsls r3, r2, 1 + adds r2, r3, 0 + movs r3, 0x5 + orrs r2, r3 + adds r3, r2, 0 + strh r3, [r1] + adds r2, r7, 0x1 + adds r1, r7, 0x1 + adds r2, r7, 0x1 + ldrb r3, [r2] + adds r2, r3, 0x1 + adds r3, r2, 0 + strb r3, [r1] + b _082E28D6 + .align 2, 0 +_082E2958: .4byte _080000C4 +_082E295C: + add sp, 0x4 + pop {r4,r7} + pop {r1} + bx r1 + thumb_func_end sub_82E28C4 + + thumb_func_start sub_82E2964 +sub_82E2964: @ 82E2964 + push {r7,lr} + sub sp, 0x4 + mov r7, sp + adds r0, r7, 0 + movs r1, 0 + strb r1, [r0] +_082E2970: + adds r0, r7, 0 + ldrb r1, [r0] + cmp r1, 0x7 + bls _082E297A + b _082E29E0 +_082E297A: + ldr r0, _082E29DC + movs r1, 0x4 + strh r1, [r0] + ldr r0, _082E29DC + movs r1, 0x4 + strh r1, [r0] + ldr r0, _082E29DC + movs r1, 0x4 + strh r1, [r0] + ldr r0, _082E29DC + movs r1, 0x4 + strh r1, [r0] + ldr r0, _082E29DC + movs r1, 0x4 + strh r1, [r0] + ldr r0, _082E29DC + movs r1, 0x5 + strh r1, [r0] + adds r0, r7, 0x1 + ldr r1, _082E29DC + ldrh r2, [r1] + movs r3, 0x2 + adds r1, r2, 0 + ands r1, r3 + adds r3, r1, 0 + lsls r2, r3, 16 + lsrs r1, r2, 16 + lsrs r2, r1, 1 + adds r1, r2, 0 + strb r1, [r0] + adds r0, r7, 0x2 + adds r1, r7, 0x2 + ldrb r2, [r1] + lsrs r1, r2, 1 + adds r2, r7, 0x1 + ldrb r3, [r2] + lsls r2, r3, 7 + orrs r1, r2 + adds r2, r1, 0 + strb r2, [r0] + adds r1, r7, 0 + adds r0, r7, 0 + adds r1, r7, 0 + ldrb r2, [r1] + adds r1, r2, 0x1 + adds r2, r1, 0 + strb r2, [r0] + b _082E2970 + .align 2, 0 +_082E29DC: .4byte _080000C4 +_082E29E0: + adds r0, r7, 0x2 + ldrb r1, [r0] + adds r0, r1, 0 + b _082E29E8 +_082E29E8: + add sp, 0x4 + pop {r7} + pop {r1} + bx r1 + thumb_func_end sub_82E2964 + + thumb_func_start sub_82E29F0 +sub_82E29F0: @ 82E29F0 + push {r7,lr} + mov r7, sp + ldr r0, _082E2A00 + movs r1, 0x1 + strh r1, [r0] + pop {r7} + pop {r0} + bx r0 + .align 2, 0 +_082E2A00: .4byte _080000C8 + thumb_func_end sub_82E29F0 + + thumb_func_start sub_82E2A04 +sub_82E2A04: @ 82E2A04 + push {r7,lr} + mov r7, sp + ldr r0, _082E2A14 + movs r1, 0 + strh r1, [r0] + pop {r7} + pop {r0} + bx r0 + .align 2, 0 +_082E2A14: .4byte _080000C8 + thumb_func_end sub_82E2A04 + + thumb_func_start STWI_init_all +STWI_init_all: @ 82E2A18 + push {r4,lr} + adds r3, r0, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x1 + bne _082E2A54 + adds r2, r3, 0 + adds r2, 0xE8 + str r2, [r1] + ldr r1, _082E2A40 + ldr r0, _082E2A44 + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, _082E2A48 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r1, _082E2A4C + ldr r2, _082E2A50 + adds r0, r3, r2 + b _082E2A5E + .align 2, 0 +_082E2A40: .4byte 0x040000d4 +_082E2A44: .4byte IntrSIO32 +_082E2A48: .4byte 0x800004b0 +_082E2A4C: .4byte 0x03007868 +_082E2A50: .4byte 0x00000a48 +_082E2A54: + ldr r0, _082E2AD8 + str r0, [r1] + ldr r1, _082E2ADC + adds r0, r3, 0 + adds r0, 0xE8 +_082E2A5E: + str r0, [r1] + adds r2, r1, 0 + ldr r1, [r2] + str r3, [r1, 0x28] + adds r0, r3, 0 + adds r0, 0x74 + str r0, [r1, 0x24] + ldrb r0, [r1, 0x14] + movs r4, 0 + movs r0, 0x1 + strb r0, [r1, 0x14] + ldr r0, [r2] + str r4, [r0] + strb r4, [r0, 0x4] + ldr r0, [r2] + strb r4, [r0, 0x5] + ldr r0, [r2] + strb r4, [r0, 0x7] + ldr r0, [r2] + strb r4, [r0, 0x8] + ldr r0, [r2] + strb r4, [r0, 0x9] + ldr r0, [r2] + str r4, [r0, 0xC] + ldrb r1, [r0, 0x10] + strb r4, [r0, 0x10] + ldr r0, [r2] + ldrh r1, [r0, 0x12] + movs r1, 0 + strh r4, [r0, 0x12] + strb r1, [r0, 0x15] + ldr r0, [r2] + adds r0, 0x2C + ldrb r2, [r0] + strb r1, [r0] + ldr r1, _082E2AE0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0xC + ldr r2, _082E2AE4 + adds r0, r2, 0 + strh r0, [r1] + bl STWI_init_Callback_M + bl STWI_init_Callback_S + ldr r3, _082E2AE8 + ldrh r2, [r3] + strh r4, [r3] + ldr r4, _082E2AEC + ldrh r0, [r4] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E2AD8: .4byte IntrSIO32 +_082E2ADC: .4byte 0x03007868 +_082E2AE0: .4byte 0x04000134 +_082E2AE4: .4byte 0x00005003 +_082E2AE8: .4byte 0x04000208 +_082E2AEC: .4byte 0x04000200 + thumb_func_end STWI_init_all + + thumb_func_start STWI_init_timer +STWI_init_timer: @ 82E2AF0 + push {r4,r5,lr} + ldr r2, _082E2B1C + str r2, [r0] + ldr r5, _082E2B20 + ldr r0, [r5] + movs r4, 0 + strb r1, [r0, 0xA] + ldr r3, _082E2B24 + ldrh r2, [r3] + strh r4, [r3] + ldr r4, _082E2B28 + ldr r1, [r5] + movs r0, 0x8 + ldrb r1, [r1, 0xA] + lsls r0, r1 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E2B1C: .4byte STWI_intr_timer + 1 +_082E2B20: .4byte 0x03007868 +_082E2B24: .4byte 0x04000208 +_082E2B28: .4byte 0x04000200 + thumb_func_end STWI_init_timer + + thumb_func_start AgbRFU_SoftReset +AgbRFU_SoftReset: @ 82E2B2C + push {r4,r5,lr} + ldr r5, _082E2BC4 + movs r1, 0x80 + lsls r1, 8 + adds r0, r1, 0 + strh r0, [r5] + ldr r2, _082E2BC8 + adds r0, r2, 0 + strh r0, [r5] + ldr r1, _082E2BCC + ldr r0, [r1] + ldrb r0, [r0, 0xA] + lsls r0, 2 + ldr r3, _082E2BD0 + adds r2, r0, r3 + ldr r4, _082E2BD4 + adds r3, r0, r4 + movs r0, 0 + strh r0, [r3] + strh r0, [r2] + movs r0, 0x83 + strh r0, [r3] + ldrh r0, [r2] + adds r4, r1, 0 + cmp r0, 0x11 + bhi _082E2B6C + ldr r0, _082E2BD8 + adds r1, r0, 0 +_082E2B64: + strh r1, [r5] + ldrh r0, [r2] + cmp r0, 0x11 + bls _082E2B64 +_082E2B6C: + movs r0, 0x3 + strh r0, [r3] + ldr r1, _082E2BC4 + ldr r2, _082E2BC8 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0xC + ldr r3, _082E2BDC + adds r0, r3, 0 + strh r0, [r1] + ldr r0, [r4] + movs r2, 0 + str r2, [r0] + strb r2, [r0, 0x4] + ldr r0, [r4] + strb r2, [r0, 0x5] + ldr r0, [r4] + strb r2, [r0, 0x6] + ldr r0, [r4] + strb r2, [r0, 0x7] + ldr r0, [r4] + strb r2, [r0, 0x8] + ldr r0, [r4] + strb r2, [r0, 0x9] + ldr r0, [r4] + str r2, [r0, 0xC] + ldrb r1, [r0, 0x10] + strb r2, [r0, 0x10] + ldr r1, [r4] + ldrh r0, [r1, 0x12] + movs r3, 0 + strh r2, [r1, 0x12] + ldrb r0, [r1, 0x14] + movs r0, 0x1 + strb r0, [r1, 0x14] + ldr r0, [r4] + strb r3, [r0, 0x15] + ldr r0, [r4] + adds r0, 0x2C + ldrb r1, [r0] + strb r3, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E2BC4: .4byte 0x04000134 +_082E2BC8: .4byte 0x000080a0 +_082E2BCC: .4byte 0x03007868 +_082E2BD0: .4byte 0x04000100 +_082E2BD4: .4byte 0x04000102 +_082E2BD8: .4byte 0x000080a2 +_082E2BDC: .4byte 0x00005003 + thumb_func_end AgbRFU_SoftReset + + thumb_func_start STWI_set_MS_mode +STWI_set_MS_mode: @ 82E2BE0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _082E2BF0 + ldr r1, [r1] + ldrb r2, [r1, 0x14] + strb r0, [r1, 0x14] + bx lr + .align 2, 0 +_082E2BF0: .4byte 0x03007868 + thumb_func_end STWI_set_MS_mode + + thumb_func_start STWI_read_status +STWI_read_status: @ 82E2BF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _082E2C20 + cmp r0, 0x1 + bgt _082E2C0A + cmp r0, 0 + beq _082E2C14 + b _082E2C48 +_082E2C0A: + cmp r1, 0x2 + beq _082E2C2C + cmp r1, 0x3 + beq _082E2C3C + b _082E2C48 +_082E2C14: + ldr r0, _082E2C1C + ldr r0, [r0] + ldrh r0, [r0, 0x12] + b _082E2C4A + .align 2, 0 +_082E2C1C: .4byte 0x03007868 +_082E2C20: + ldr r0, _082E2C28 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + b _082E2C4A + .align 2, 0 +_082E2C28: .4byte 0x03007868 +_082E2C2C: + ldr r0, _082E2C38 + ldr r0, [r0] + ldr r0, [r0] + lsls r0, 16 + lsrs r0, 16 + b _082E2C4A + .align 2, 0 +_082E2C38: .4byte 0x03007868 +_082E2C3C: + ldr r0, _082E2C44 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + b _082E2C4A + .align 2, 0 +_082E2C44: .4byte 0x03007868 +_082E2C48: + ldr r0, _082E2C50 +_082E2C4A: + pop {r1} + bx r1 + .align 2, 0 +_082E2C50: .4byte 0x0000ffff + thumb_func_end STWI_read_status + + thumb_func_start STWI_init_Callback_M +STWI_init_Callback_M: @ 82E2C54 + push {lr} + movs r0, 0 + bl STWI_set_Callback_M + pop {r0} + bx r0 + thumb_func_end STWI_init_Callback_M + + thumb_func_start STWI_init_Callback_S +STWI_init_Callback_S: @ 82E2C60 + push {lr} + movs r0, 0 + bl STWI_set_Callback_S + pop {r0} + bx r0 + thumb_func_end STWI_init_Callback_S + + thumb_func_start STWI_set_Callback_M +STWI_set_Callback_M: @ 82E2C6C + ldr r1, _082E2C74 + ldr r1, [r1] + str r0, [r1, 0x18] + bx lr + .align 2, 0 +_082E2C74: .4byte 0x03007868 + thumb_func_end STWI_set_Callback_M + + thumb_func_start STWI_set_Callback_S +STWI_set_Callback_S: @ 82E2C78 + ldr r1, _082E2C80 + ldr r1, [r1] + str r0, [r1, 0x1C] + bx lr + .align 2, 0 +_082E2C80: .4byte 0x03007868 + thumb_func_end STWI_set_Callback_S + + thumb_func_start STWI_set_Callback_ID +STWI_set_Callback_ID: @ 82E2C84 + ldr r1, _082E2C8C + ldr r1, [r1] + str r0, [r1, 0x20] + bx lr + .align 2, 0 +_082E2C8C: .4byte 0x03007868 + thumb_func_end STWI_set_Callback_ID + + thumb_func_start STWI_poll_CommandEnd +STWI_poll_CommandEnd: @ 82E2C90 + push {lr} + ldr r0, _082E2CB4 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x2C + ldrb r1, [r2] + adds r3, r0, 0 + cmp r1, 0x1 + bne _082E2CAA + adds r1, r2, 0 +_082E2CA4: + ldrb r0, [r1] + cmp r0, 0x1 + beq _082E2CA4 +_082E2CAA: + ldr r0, [r3] + ldrh r0, [r0, 0x12] + pop {r1} + bx r1 + .align 2, 0 +_082E2CB4: .4byte 0x03007868 + thumb_func_end STWI_poll_CommandEnd + + thumb_func_start STWI_send_ResetREQ +STWI_send_ResetREQ: @ 82E2CB8 + push {lr} + movs r0, 0x10 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2CD2 + ldr r0, _082E2CD8 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2CD2: + pop {r0} + bx r0 + .align 2, 0 +_082E2CD8: .4byte 0x03007868 + thumb_func_end STWI_send_ResetREQ + + thumb_func_start STWI_send_LinkStatusREQ +STWI_send_LinkStatusREQ: @ 82E2CDC + push {lr} + movs r0, 0x11 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2CF6 + ldr r0, _082E2CFC + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2CF6: + pop {r0} + bx r0 + .align 2, 0 +_082E2CFC: .4byte 0x03007868 + thumb_func_end STWI_send_LinkStatusREQ + + thumb_func_start STWI_send_VersionStatusREQ +STWI_send_VersionStatusREQ: @ 82E2D00 + push {lr} + movs r0, 0x12 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2D1A + ldr r0, _082E2D20 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2D1A: + pop {r0} + bx r0 + .align 2, 0 +_082E2D20: .4byte 0x03007868 + thumb_func_end STWI_send_VersionStatusREQ + + thumb_func_start STWI_send_SystemStatusREQ +STWI_send_SystemStatusREQ: @ 82E2D24 + push {lr} + movs r0, 0x13 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2D3E + ldr r0, _082E2D44 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2D3E: + pop {r0} + bx r0 + .align 2, 0 +_082E2D44: .4byte 0x03007868 + thumb_func_end STWI_send_SystemStatusREQ + + thumb_func_start STWI_send_SlotStatusREQ +STWI_send_SlotStatusREQ: @ 82E2D48 + push {lr} + movs r0, 0x14 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2D62 + ldr r0, _082E2D68 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2D62: + pop {r0} + bx r0 + .align 2, 0 +_082E2D68: .4byte 0x03007868 + thumb_func_end STWI_send_SlotStatusREQ + + thumb_func_start STWI_send_ConfigStatusREQ +STWI_send_ConfigStatusREQ: @ 82E2D6C + push {lr} + movs r0, 0x15 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2D86 + ldr r0, _082E2D8C + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2D86: + pop {r0} + bx r0 + .align 2, 0 +_082E2D8C: .4byte 0x03007868 + thumb_func_end STWI_send_ConfigStatusREQ + + thumb_func_start STWI_send_GameConfigREQ +STWI_send_GameConfigREQ: @ 82E2D90 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x16 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E2DDC + ldr r2, _082E2DE4 + ldr r1, [r2] + movs r0, 0x6 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r1, [r0, 0x24] + adds r1, 0x4 + ldrh r0, [r4] + strh r0, [r1] + adds r1, 0x2 + adds r4, 0x2 + movs r2, 0xD +_082E2DBA: + ldrb r0, [r4] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _082E2DBA + movs r2, 0x7 +_082E2DCA: + ldrb r0, [r5] + strb r0, [r1] + adds r1, 0x1 + adds r5, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _082E2DCA + bl STWI_start_Command +_082E2DDC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E2DE4: .4byte 0x03007868 + thumb_func_end STWI_send_GameConfigREQ + + thumb_func_start STWI_send_SystemConfigREQ +STWI_send_SystemConfigREQ: @ 82E2DE8 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r0, 0x17 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E2E1E + ldr r2, _082E2E24 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r0, [r0, 0x24] + adds r0, 0x4 + strb r4, [r0] + adds r0, 0x1 + strb r5, [r0] + adds r0, 0x1 + strh r6, [r0] + bl STWI_start_Command +_082E2E1E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E2E24: .4byte 0x03007868 + thumb_func_end STWI_send_SystemConfigREQ + + thumb_func_start STWI_send_SC_StartREQ +STWI_send_SC_StartREQ: @ 82E2E28 + push {lr} + movs r0, 0x19 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2E42 + ldr r0, _082E2E48 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2E42: + pop {r0} + bx r0 + .align 2, 0 +_082E2E48: .4byte 0x03007868 + thumb_func_end STWI_send_SC_StartREQ + + thumb_func_start STWI_send_SC_PollingREQ +STWI_send_SC_PollingREQ: @ 82E2E4C + push {lr} + movs r0, 0x1A + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2E66 + ldr r0, _082E2E6C + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2E66: + pop {r0} + bx r0 + .align 2, 0 +_082E2E6C: .4byte 0x03007868 + thumb_func_end STWI_send_SC_PollingREQ + + thumb_func_start STWI_send_SC_EndREQ +STWI_send_SC_EndREQ: @ 82E2E70 + push {lr} + movs r0, 0x1B + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2E8A + ldr r0, _082E2E90 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2E8A: + pop {r0} + bx r0 + .align 2, 0 +_082E2E90: .4byte 0x03007868 + thumb_func_end STWI_send_SC_EndREQ + + thumb_func_start STWI_send_SP_StartREQ +STWI_send_SP_StartREQ: @ 82E2E94 + push {lr} + movs r0, 0x1C + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2EAE + ldr r0, _082E2EB4 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2EAE: + pop {r0} + bx r0 + .align 2, 0 +_082E2EB4: .4byte 0x03007868 + thumb_func_end STWI_send_SP_StartREQ + + thumb_func_start STWI_send_SP_PollingREQ +STWI_send_SP_PollingREQ: @ 82E2EB8 + push {lr} + movs r0, 0x1D + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2ED2 + ldr r0, _082E2ED8 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2ED2: + pop {r0} + bx r0 + .align 2, 0 +_082E2ED8: .4byte 0x03007868 + thumb_func_end STWI_send_SP_PollingREQ + + thumb_func_start STWI_send_SP_EndREQ +STWI_send_SP_EndREQ: @ 82E2EDC + push {lr} + movs r0, 0x1E + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2EF6 + ldr r0, _082E2EFC + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2EF6: + pop {r0} + bx r0 + .align 2, 0 +_082E2EFC: .4byte 0x03007868 + thumb_func_end STWI_send_SP_EndREQ + + thumb_func_start STWI_send_CP_StartREQ +STWI_send_CP_StartREQ: @ 82E2F00 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1F + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E2F24 + ldr r2, _082E2F2C + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r0, [r0, 0x24] + str r4, [r0, 0x4] + bl STWI_start_Command +_082E2F24: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E2F2C: .4byte 0x03007868 + thumb_func_end STWI_send_CP_StartREQ + + thumb_func_start STWI_send_CP_PollingREQ +STWI_send_CP_PollingREQ: @ 82E2F30 + push {lr} + movs r0, 0x20 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2F4A + ldr r0, _082E2F50 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2F4A: + pop {r0} + bx r0 + .align 2, 0 +_082E2F50: .4byte 0x03007868 + thumb_func_end STWI_send_CP_PollingREQ + + thumb_func_start STWI_send_CP_EndREQ +STWI_send_CP_EndREQ: @ 82E2F54 + push {lr} + movs r0, 0x21 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E2F6E + ldr r0, _082E2F74 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E2F6E: + pop {r0} + bx r0 + .align 2, 0 +_082E2F74: .4byte 0x03007868 + thumb_func_end STWI_send_CP_EndREQ + + thumb_func_start STWI_send_DataTxREQ +STWI_send_DataTxREQ: @ 82E2F78 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r4, r1, 24 + lsrs r5, r4, 24 + movs r0, 0x24 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E2FB6 + lsrs r2, r4, 26 + movs r0, 0x3 + ands r0, r5 + cmp r0, 0 + beq _082E2F98 + adds r2, 0x1 +_082E2F98: + ldr r1, _082E2FBC + ldr r0, [r1] + strb r2, [r0, 0x4] + ldr r0, [r1] + ldr r1, [r0, 0x24] + adds r1, 0x4 + ldrb r2, [r0, 0x4] + movs r0, 0x80 + lsls r0, 19 + orrs r2, r0 + adds r0, r6, 0 + bl CpuSet + bl STWI_start_Command +_082E2FB6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E2FBC: .4byte 0x03007868 + thumb_func_end STWI_send_DataTxREQ + + thumb_func_start STWI_send_DataTxAndChangeREQ +STWI_send_DataTxAndChangeREQ: @ 82E2FC0 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r4, r1, 24 + lsrs r5, r4, 24 + movs r0, 0x25 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E2FFE + lsrs r2, r4, 26 + movs r0, 0x3 + ands r0, r5 + cmp r0, 0 + beq _082E2FE0 + adds r2, 0x1 +_082E2FE0: + ldr r1, _082E3004 + ldr r0, [r1] + strb r2, [r0, 0x4] + ldr r0, [r1] + ldr r1, [r0, 0x24] + adds r1, 0x4 + ldrb r2, [r0, 0x4] + movs r0, 0x80 + lsls r0, 19 + orrs r2, r0 + adds r0, r6, 0 + bl CpuSet + bl STWI_start_Command +_082E2FFE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E3004: .4byte 0x03007868 + thumb_func_end STWI_send_DataTxAndChangeREQ + + thumb_func_start STWI_send_DataRxREQ +STWI_send_DataRxREQ: @ 82E3008 + push {lr} + movs r0, 0x26 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E3022 + ldr r0, _082E3028 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E3022: + pop {r0} + bx r0 + .align 2, 0 +_082E3028: .4byte 0x03007868 + thumb_func_end STWI_send_DataRxREQ + + thumb_func_start STWI_send_MS_ChangeREQ +STWI_send_MS_ChangeREQ: @ 82E302C + push {lr} + movs r0, 0x27 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E3046 + ldr r0, _082E304C + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E3046: + pop {r0} + bx r0 + .align 2, 0 +_082E304C: .4byte 0x03007868 + thumb_func_end STWI_send_MS_ChangeREQ + + thumb_func_start STWI_send_DataReadyAndChangeREQ +STWI_send_DataReadyAndChangeREQ: @ 82E3050 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0x28 + bl STWI_init + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _082E3096 + cmp r4, 0 + bne _082E3078 + ldr r0, _082E3074 + ldr r0, [r0] + strb r3, [r0, 0x4] + b _082E3092 + .align 2, 0 +_082E3074: .4byte 0x03007868 +_082E3078: + ldr r2, _082E309C + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r0, [r0, 0x24] + adds r0, 0x4 + strb r5, [r0] + adds r0, 0x1 + strb r3, [r0] + adds r0, 0x1 + strb r3, [r0] + strb r3, [r0, 0x1] +_082E3092: + bl STWI_start_Command +_082E3096: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E309C: .4byte 0x03007868 + thumb_func_end STWI_send_DataReadyAndChangeREQ + + thumb_func_start STWI_send_DisconnectedAndChangeREQ +STWI_send_DisconnectedAndChangeREQ: @ 82E30A0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x29 + bl STWI_init + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _082E30D6 + ldr r2, _082E30DC + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r0, [r0, 0x24] + adds r0, 0x4 + strb r4, [r0] + adds r0, 0x1 + strb r5, [r0] + adds r0, 0x1 + strb r3, [r0] + strb r3, [r0, 0x1] + bl STWI_start_Command +_082E30D6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E30DC: .4byte 0x03007868 + thumb_func_end STWI_send_DisconnectedAndChangeREQ + + thumb_func_start STWI_send_ResumeRetransmitAndChangeREQ +STWI_send_ResumeRetransmitAndChangeREQ: @ 82E30E0 + push {lr} + movs r0, 0x37 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E30FA + ldr r0, _082E3100 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E30FA: + pop {r0} + bx r0 + .align 2, 0 +_082E3100: .4byte 0x03007868 + thumb_func_end STWI_send_ResumeRetransmitAndChangeREQ + + thumb_func_start STWI_send_DisconnectREQ +STWI_send_DisconnectREQ: @ 82E3104 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x30 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E3128 + ldr r2, _082E3130 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r0, [r0, 0x24] + str r4, [r0, 0x4] + bl STWI_start_Command +_082E3128: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E3130: .4byte 0x03007868 + thumb_func_end STWI_send_DisconnectREQ + + thumb_func_start STWI_send_TestModeREQ +STWI_send_TestModeREQ: @ 82E3134 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r0, 0x31 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E3160 + ldr r2, _082E3168 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, [r2] + ldr r1, [r0, 0x24] + lsls r0, r4, 8 + orrs r0, r5 + str r0, [r1, 0x4] + bl STWI_start_Command +_082E3160: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E3168: .4byte 0x03007868 + thumb_func_end STWI_send_TestModeREQ + + thumb_func_start STWI_send_CPR_StartREQ +STWI_send_CPR_StartREQ: @ 82E316C + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0x32 + bl STWI_init + lsls r0, 16 + cmp r0, 0 + bne _082E319E + ldr r2, _082E31A4 + ldr r1, [r2] + movs r0, 0x2 + strb r0, [r1, 0x4] + lsls r0, r5, 16 + orrs r0, r4 + ldr r1, [r2] + ldr r1, [r1, 0x24] + str r0, [r1, 0x4] + str r6, [r1, 0x8] + bl STWI_start_Command +_082E319E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E31A4: .4byte 0x03007868 + thumb_func_end STWI_send_CPR_StartREQ + + thumb_func_start STWI_send_CPR_PollingREQ +STWI_send_CPR_PollingREQ: @ 82E31A8 + push {lr} + movs r0, 0x33 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E31C2 + ldr r0, _082E31C8 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E31C2: + pop {r0} + bx r0 + .align 2, 0 +_082E31C8: .4byte 0x03007868 + thumb_func_end STWI_send_CPR_PollingREQ + + thumb_func_start STWI_send_CPR_EndREQ +STWI_send_CPR_EndREQ: @ 82E31CC + push {lr} + movs r0, 0x34 + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E31E6 + ldr r0, _082E31EC + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E31E6: + pop {r0} + bx r0 + .align 2, 0 +_082E31EC: .4byte 0x03007868 + thumb_func_end STWI_send_CPR_EndREQ + + thumb_func_start STWI_send_StopModeREQ +STWI_send_StopModeREQ: @ 82E31F0 + push {lr} + movs r0, 0x3D + bl STWI_init + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E320A + ldr r0, _082E3210 + ldr r0, [r0] + strb r1, [r0, 0x4] + bl STWI_start_Command +_082E320A: + pop {r0} + bx r0 + .align 2, 0 +_082E3210: .4byte 0x03007868 + thumb_func_end STWI_send_StopModeREQ + + thumb_func_start STWI_intr_timer +STWI_intr_timer: @ 82E3214 + push {r4,lr} + ldr r4, _082E322C + ldr r1, [r4] + ldr r0, [r1, 0xC] + cmp r0, 0x2 + beq _082E323A + cmp r0, 0x2 + bgt _082E3230 + cmp r0, 0x1 + beq _082E3248 + b _082E3270 + .align 2, 0 +_082E322C: .4byte 0x03007868 +_082E3230: + cmp r0, 0x3 + beq _082E3252 + cmp r0, 0x4 + beq _082E3248 + b _082E3270 +_082E323A: + ldrb r0, [r1, 0x10] + movs r0, 0x1 + strb r0, [r1, 0x10] + movs r0, 0x32 + bl STWI_set_timer + b _082E3270 +_082E3248: + bl STWI_stop_timer + bl STWI_restart_Command + b _082E3270 +_082E3252: + ldrb r0, [r1, 0x10] + movs r0, 0x1 + strb r0, [r1, 0x10] + bl STWI_stop_timer + bl STWI_reset_ClockCounter + ldr r0, [r4] + ldr r2, [r0, 0x18] + cmp r2, 0 + beq _082E3270 + movs r0, 0xFF + movs r1, 0 + bl _call_via_r2 +_082E3270: + pop {r4} + pop {r0} + bx r0 + thumb_func_end STWI_intr_timer + + thumb_func_start STWI_set_timer +STWI_set_timer: @ 82E3278 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r5, r3, 0 + ldr r2, _082E32A8 + ldr r0, [r2] + ldrb r0, [r0, 0xA] + lsls r0, 2 + ldr r1, _082E32AC + adds r4, r0, r1 + adds r1, 0x2 + adds r7, r0, r1 + ldr r1, _082E32B0 + movs r0, 0 + strh r0, [r1] + adds r6, r2, 0 + cmp r3, 0x50 + beq _082E32D0 + cmp r3, 0x50 + bgt _082E32B4 + cmp r3, 0x32 + beq _082E32BE + b _082E32FC + .align 2, 0 +_082E32A8: .4byte 0x03007868 +_082E32AC: .4byte 0x04000100 +_082E32B0: .4byte 0x04000208 +_082E32B4: + cmp r5, 0x64 + beq _082E32E0 + cmp r5, 0x82 + beq _082E32F0 + b _082E32FC +_082E32BE: + ldr r1, _082E32CC + adds r0, r1, 0 + strh r0, [r4] + ldr r1, [r6] + movs r0, 0x1 + b _082E32FA + .align 2, 0 +_082E32CC: .4byte 0x0000fccb +_082E32D0: + ldr r1, _082E32DC + adds r0, r1, 0 + strh r0, [r4] + ldr r1, [r6] + movs r0, 0x2 + b _082E32FA + .align 2, 0 +_082E32DC: .4byte 0x0000fae0 +_082E32E0: + ldr r1, _082E32EC + adds r0, r1, 0 + strh r0, [r4] + ldr r1, [r6] + movs r0, 0x3 + b _082E32FA + .align 2, 0 +_082E32EC: .4byte 0x0000f996 +_082E32F0: + ldr r1, _082E3318 + adds r0, r1, 0 + strh r0, [r4] + ldr r1, [r6] + movs r0, 0x4 +_082E32FA: + str r0, [r1, 0xC] +_082E32FC: + movs r0, 0xC3 + strh r0, [r7] + ldr r2, _082E331C + ldr r1, [r6] + movs r0, 0x8 + ldrb r1, [r1, 0xA] + lsls r0, r1 + strh r0, [r2] + ldr r1, _082E3320 + movs r0, 0x1 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E3318: .4byte 0x0000f7ad +_082E331C: .4byte 0x04000202 +_082E3320: .4byte 0x04000208 + thumb_func_end STWI_set_timer + + thumb_func_start STWI_stop_timer +STWI_stop_timer: @ 82E3324 + ldr r2, _082E3344 + ldr r0, [r2] + movs r1, 0 + str r1, [r0, 0xC] + ldrb r0, [r0, 0xA] + lsls r0, 2 + ldr r3, _082E3348 + adds r0, r3 + strh r1, [r0] + ldr r0, [r2] + ldrb r0, [r0, 0xA] + lsls r0, 2 + ldr r2, _082E334C + adds r0, r2 + strh r1, [r0] + bx lr + .align 2, 0 +_082E3344: .4byte 0x03007868 +_082E3348: .4byte 0x04000100 +_082E334C: .4byte 0x04000102 + thumb_func_end STWI_stop_timer + + thumb_func_start STWI_init +STWI_init: @ 82E3350 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, _082E337C + ldrh r0, [r0] + cmp r0, 0 + bne _082E3384 + ldr r0, _082E3380 + ldr r1, [r0] + ldrh r0, [r1, 0x12] + movs r0, 0x6 + strh r0, [r1, 0x12] + ldr r2, [r1, 0x18] + cmp r2, 0 + beq _082E33CE + ldrh r1, [r1, 0x12] + adds r0, r5, 0 + bl _call_via_r2 + b _082E33CE + .align 2, 0 +_082E337C: .4byte 0x04000208 +_082E3380: .4byte 0x03007868 +_082E3384: + ldr r4, _082E33B0 + ldr r2, [r4] + adds r3, r2, 0 + adds r3, 0x2C + ldrb r0, [r3] + cmp r0, 0x1 + bne _082E33B4 + ldrh r0, [r2, 0x12] + movs r1, 0 + movs r0, 0x2 + strh r0, [r2, 0x12] + ldrb r0, [r3] + strb r1, [r3] + ldr r0, [r4] + ldr r2, [r0, 0x18] + cmp r2, 0 + beq _082E33CE + ldrh r1, [r0, 0x12] + adds r0, r5, 0 + bl _call_via_r2 + b _082E33CE + .align 2, 0 +_082E33B0: .4byte 0x03007868 +_082E33B4: + ldrb r0, [r2, 0x14] + cmp r0, 0 + bne _082E33D2 + ldrh r0, [r2, 0x12] + movs r0, 0x4 + strh r0, [r2, 0x12] + ldr r3, [r2, 0x18] + cmp r3, 0 + beq _082E33CE + ldrh r1, [r2, 0x12] + adds r0, r5, 0 + bl _call_via_r3 +_082E33CE: + movs r0, 0x1 + b _082E341A +_082E33D2: + ldrb r0, [r3] + movs r1, 0 + movs r0, 0x1 + strb r0, [r3] + ldr r0, [r4] + strb r6, [r0, 0x6] + ldr r0, [r4] + str r1, [r0] + strb r1, [r0, 0x4] + ldr r0, [r4] + strb r1, [r0, 0x5] + ldr r0, [r4] + strb r1, [r0, 0x7] + ldr r0, [r4] + strb r1, [r0, 0x8] + ldr r0, [r4] + strb r1, [r0, 0x9] + ldr r0, [r4] + str r1, [r0, 0xC] + ldrb r2, [r0, 0x10] + strb r1, [r0, 0x10] + ldr r0, [r4] + ldrh r2, [r0, 0x12] + movs r2, 0 + strh r1, [r0, 0x12] + strb r2, [r0, 0x15] + ldr r1, _082E3420 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0xC + ldr r2, _082E3424 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 +_082E341A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_082E3420: .4byte 0x04000134 +_082E3424: .4byte 0x00005003 + thumb_func_end STWI_init + + thumb_func_start STWI_start_Command +STWI_start_Command: @ 82E3428 + push {r4,r5,lr} + ldr r5, _082E3480 + ldr r0, [r5] + ldr r3, [r0, 0x24] + ldrb r1, [r0, 0x4] + lsls r1, 8 + ldrb r0, [r0, 0x6] + ldr r2, _082E3484 + orrs r0, r2 + orrs r1, r0 + str r1, [r3] + ldr r2, _082E3488 + ldr r1, [r5] + ldr r0, [r1, 0x24] + ldr r0, [r0] + str r0, [r2] + movs r2, 0 + str r2, [r1] + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r4, _082E348C + ldrh r3, [r4] + strh r2, [r4] + ldr r2, _082E3490 + ldr r1, [r5] + movs r0, 0x8 + ldrb r1, [r1, 0xA] + lsls r0, r1 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r2] + strh r3, [r4] + ldr r1, _082E3494 + ldr r2, _082E3498 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_082E3480: .4byte 0x03007868 +_082E3484: .4byte 0x99660000 +_082E3488: .4byte 0x04000120 +_082E348C: .4byte 0x04000208 +_082E3490: .4byte 0x04000200 +_082E3494: .4byte 0x04000128 +_082E3498: .4byte 0x00005083 + thumb_func_end STWI_start_Command + + thumb_func_start STWI_restart_Command +STWI_restart_Command: @ 82E349C + push {r4,lr} + ldr r4, _082E34B4 + ldr r2, [r4] + ldrb r0, [r2, 0x15] + adds r3, r4, 0 + cmp r0, 0x1 + bhi _082E34B8 + adds r0, 0x1 + strb r0, [r2, 0x15] + bl STWI_start_Command + b _082E3512 + .align 2, 0 +_082E34B4: .4byte 0x03007868 +_082E34B8: + ldrb r0, [r2, 0x6] + cmp r0, 0x27 + beq _082E34CA + cmp r0, 0x25 + beq _082E34CA + cmp r0, 0x35 + beq _082E34CA + cmp r0, 0x37 + bne _082E34EC +_082E34CA: + ldr r0, [r3] + ldrh r1, [r0, 0x12] + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x12] + adds r0, 0x2C + ldrb r1, [r0] + strb r2, [r0] + ldr r1, [r3] + ldr r2, [r1, 0x18] + cmp r2, 0 + beq _082E3512 + ldrb r0, [r1, 0x6] + ldrh r1, [r1, 0x12] + bl _call_via_r2 + b _082E3512 +_082E34EC: + ldrh r0, [r2, 0x12] + movs r1, 0 + movs r0, 0x1 + strh r0, [r2, 0x12] + adds r0, r2, 0 + adds r0, 0x2C + ldrb r2, [r0] + strb r1, [r0] + ldr r1, [r4] + ldr r2, [r1, 0x18] + cmp r2, 0 + beq _082E350C + ldrb r0, [r1, 0x6] + ldrh r1, [r1, 0x12] + bl _call_via_r2 +_082E350C: + ldr r1, [r4] + movs r0, 0x4 + str r0, [r1] +_082E3512: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end STWI_restart_Command + + thumb_func_start STWI_reset_ClockCounter +STWI_reset_ClockCounter: @ 82E351C + ldr r3, _082E3548 + ldr r1, [r3] + movs r0, 0x5 + str r0, [r1] + movs r2, 0 + strb r2, [r1, 0x4] + ldr r0, [r3] + strb r2, [r0, 0x5] + ldr r1, _082E354C + movs r0, 0x80 + lsls r0, 24 + str r0, [r1] + adds r1, 0x8 + strh r2, [r1] + ldr r2, _082E3550 + adds r0, r2, 0 + strh r0, [r1] + adds r2, 0x7F + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + bx lr + .align 2, 0 +_082E3548: .4byte 0x03007868 +_082E354C: .4byte 0x04000120 +_082E3550: .4byte 0x00005003 + thumb_func_end STWI_reset_ClockCounter + + .arm + arm_func_start IntrSIO32 +IntrSIO32: @ 82E3554 + mov r12, sp + stmdb sp!, {r11,r12,lr,pc} + ldr r3, _082E35B4 + ldr r0, [r3] + ldr r2, [r0] + sub r11, r12, 0x4 + cmp r2, 0xA + bne _082E3590 + ldr r0, [r0, 0x20] + cmp r0, 0 + ldmdbeq r11, {r11,sp,lr} + bxeq lr + bl sub_82E3EB0 + ldmdb r11, {r11,sp,lr} + bx lr +_082E3590: + ldrb r3, [r0, 0x14] + cmp r3, 0x1 + bne _082E35A8 + bl sio32intr_clock_master + ldmdb r11, {r11,sp,lr} + bx lr +_082E35A8: + bl sio32intr_clock_slave + ldmdb r11, {r11,sp,lr} + bx lr + .align 2, 0 +_082E35B4: .4byte 0x03007868 + arm_func_end IntrSIO32 + + arm_func_start sio32intr_clock_master +sio32intr_clock_master: @ 82E35B8 + mov r12, sp + stmdb sp!, {r4-r6,r11,r12,lr,pc} + mov r0, 0x50 + sub r11, r12, 0x4 + bl STWI_set_timer_in_RAM + mov r4, 0x120 + ldr r2, _082E382C + add r4, r4, 0x4000000 + ldr lr, [r4] + ldr r12, [r2] + ldr r3, [r12] + mov r6, r2 + cmp r3, 0 + bne _082E3638 + cmp lr, 0x80000000 + bne _082E36B8 + ldrb r2, [r12, 0x5] + ldrb r3, [r12, 0x4] + cmp r2, r3 + bhi _082E3628 + ldr r3, [r12, 0x24] + mov r1, r2 + ldr r2, [r3, r1, lsl 2] + str r2, [r4] + ldrb r3, [r12, 0x5] + add r3, r3, 0x1 + strb r3, [r12, 0x5] + b _082E3714 +_082E3628: + mov r3, 0x1 + str r3, [r12] + str lr, [r4] + b _082E3714 +_082E3638: + ldr r3, [r12] + cmp r3, 0x1 + bne _082E36C8 + mov r3, 0x99000000 + add r3, r3, 0x660000 + mov r5, 0x80000000 + and r2, lr, r5, asr 15 + cmp r2, r3 + bne _082E36B8 + mov r3, 0 + strb r3, [r12, 0x8] + ldr r1, [r6] + ldrb r0, [r1, 0x8] + ldr r2, [r1, 0x28] + str lr, [r2, r0, lsl 2] + ldrb r3, [r1, 0x8] + add r3, r3, 0x1 + strb r3, [r1, 0x8] + ldr r2, [r6] + strb lr, [r2, 0x9] + ldr r3, [r6] + mov r2, lr, lsr 8 + strb r2, [r3, 0x7] + ldr r1, [r6] + ldrb r2, [r1, 0x7] + ldrb r3, [r1, 0x8] + cmp r2, r3 + bcc _082E3700 + mov r3, 0x2 + str r3, [r1] + str r5, [r4] + b _082E3714 +_082E36B8: + bl STWI_stop_timer_in_RAM + mov r0, 0x82 + bl STWI_set_timer_in_RAM + b _082E3840 +_082E36C8: + ldr r3, [r12] + cmp r3, 0x2 + bne _082E3714 + ldrb r1, [r12, 0x8] + ldr r2, [r12, 0x28] + str lr, [r2, r1, lsl 2] + ldrb r3, [r12, 0x8] + add r3, r3, 0x1 + strb r3, [r12, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x7] + ldrb r3, [r1, 0x8] + cmp r2, r3 + bcs _082E370C +_082E3700: + mov r3, 0x3 + str r3, [r1] + b _082E3714 +_082E370C: + mov r3, 0x80000000 + str r3, [r4] +_082E3714: + mov r0, 0x1 + bl handshake_wait + mov r0, r0, lsl 16 + cmp r0, 0x10000 + beq _082E3840 + mov r4, 0x128 + add r4, r4, 0x4000000 + mov r5, 0x5000 + add r3, r5, 0xB + strh r3, [r4] + mov r0, 0 + bl handshake_wait + mov r0, r0, lsl 16 + cmp r0, 0x10000 + beq _082E3840 + bl STWI_stop_timer_in_RAM + ldr r1, [r6] + ldr r0, [r1] + cmp r0, 0x3 + bne _082E3830 + ldrb r3, [r1, 0x9] + cmp r3, 0xA5 + cmpne r3, 0xA7 + beq _082E3788 + and r3, r3, 0xFF + cmp r3, 0xB5 + beq _082E3788 + cmp r3, 0xB7 + bne _082E37D0 +_082E3788: + mov r1, 0x120 + add r1, r1, 0x4000000 + mov r12, 0x128 + add r12, r12, 0x4000000 + ldr r0, [r6] + mov r3, 0 + strb r3, [r0, 0x14] + mov r2, 0x80000000 + str r2, [r1] + add r3, r3, 0x5000 + add r2, r3, 0x2 + strh r2, [r12] + add r3, r3, 0x82 + strh r3, [r12] + ldr r2, [r6] + mov r3, 0x5 + str r3, [r2] + b _082E3800 +_082E37D0: + cmp r3, 0xEE + bne _082E37F0 + add r3, r5, 0x3 + strh r3, [r4] + mov r2, 0x4 + str r2, [r1] + strh r0, [r1, 0x12] + b _082E3800 +_082E37F0: + add r3, r5, 0x3 + strh r3, [r4] + mov r2, 0x4 + str r2, [r1] +_082E3800: + ldr r2, [r6] + mov r3, 0 + strb r3, [r2, 0x2C] + ldr r0, [r6] + ldr r2, [r0, 0x18] + cmp r2, r3 + beq _082E3840 + ldrh r1, [r0, 0x12] + ldrb r0, [r0, 0x6] + bl sub_82E3EA8 + b _082E3840 + .align 2, 0 +_082E382C: .4byte 0x03007868 +_082E3830: + add r3, r5, 0x3 + strh r3, [r4] + add r2, r5, 0x83 + strh r2, [r4] +_082E3840: + ldmdb r11, {r4-r6,r11,sp,lr} + bx lr + arm_func_end sio32intr_clock_master + + arm_func_start sio32intr_clock_slave +sio32intr_clock_slave: @ 82E3848 + mov r12, sp + stmdb sp!, {r4-r6,r11,r12,lr,pc} + ldr r4, _082E3BF4 + mov r0, 0x64 + ldr r3, [r4] + mov r6, 0 + strb r6, [r3, 0x10] + sub r11, r12, 0x4 + bl STWI_set_timer_in_RAM + mov r0, r6 + bl handshake_wait + mov r0, r0, lsl 16 + cmp r0, 0x10000 + mov r5, r4 + beq _082E3C4C + mov r3, 0x128 + add r3, r3, 0x4000000 + mov r2, 0x5000 + add r2, r2, 0xA + strh r2, [r3] + mov lr, 0x120 + ldr r0, [r5] + add lr, lr, 0x4000000 + ldr r12, [lr] + ldr r3, [r0] + cmp r3, 0x5 + bne _082E3978 + ldr r3, [r0, 0x28] + mov r4, 0x1 + mov r0, 0x99000000 + str r12, [r3] + add r0, r0, 0x660000 + ldr r2, [r5] + mov r3, r0, lsr 16 + strb r4, [r2, 0x5] + cmp r3, r12, lsr 16 + bne _082E3AC4 + ldr r3, [r5] + mov r2, r12, lsr 8 + strb r2, [r3, 0x4] + ldr r2, [r5] + strb r12, [r2, 0x6] + ldr r1, [r5] + ldrb r3, [r1, 0x4] + cmp r3, r6 + bne _082E395C + ldrb r2, [r1, 0x6] + sub r3, r2, 0x27 + cmp r2, 0x36 + cmpne r3, 0x2 + bhi _082E3930 + add r3, r2, 0x80 + strb r3, [r1, 0x9] + ldr r2, [r5] + ldrb r3, [r2, 0x9] + ldr r1, [r2, 0x24] + add r3, r3, r0 + b _082E39E0 +_082E3930: + ldr r2, [r1, 0x24] + ldr r3, _082E3BF8 + str r3, [r2] + ldr r2, [r5] + ldrb r3, [r2, 0x6] + sub r3, r3, 0x10 + cmp r3, 0x2D + bhi _082E3A18 + ldr r3, [r2, 0x24] + str r4, [r3, 0x4] + b _082E3A24 +_082E395C: + mov r3, 0x80000000 + str r3, [lr] + strb r4, [r1, 0x5] + ldr r2, [r5] + add r3, r3, 0x80000006 + str r3, [r2] + b _082E3AD4 +_082E3978: + ldr r3, [r0] + cmp r3, 0x6 + bne _082E3A78 + ldrb r1, [r0, 0x5] + ldr r2, [r0, 0x28] + str r12, [r2, r1, lsl 2] + ldrb r3, [r0, 0x5] + add r3, r3, 0x1 + strb r3, [r0, 0x5] + ldr r1, [r5] + ldrb r2, [r1, 0x4] + ldrb r3, [r1, 0x5] + cmp r2, r3 + bcs _082E3A6C + ldrb r2, [r1, 0x6] + sub r3, r2, 0x28 + cmp r2, 0x36 + cmpne r3, 0x1 + bhi _082E39F0 + add r3, r2, 0x80 + strb r3, [r1, 0x9] + ldr r2, [r5] + ldrb r3, [r2, 0x9] + ldr r1, [r2, 0x24] + orr r3, r3, 0x99000000 + orr r3, r3, 0x660000 +_082E39E0: + str r3, [r1] + ldr r2, [r5] + strb r6, [r2, 0x7] + b _082E3A3C +_082E39F0: + ldr r2, [r1, 0x24] + ldr r3, _082E3BF8 + str r3, [r2] + ldr r2, [r5] + ldrb r3, [r2, 0x6] + sub r3, r3, 0x10 + cmp r3, 0x2D + ldrls r2, [r2, 0x24] + movls r3, 0x1 + bls _082E3A20 +_082E3A18: + ldr r2, [r2, 0x24] + mov r3, 0x2 +_082E3A20: + str r3, [r2, 0x4] +_082E3A24: + ldr r2, [r5] + mov r3, 0x1 + strb r3, [r2, 0x7] + ldr r1, [r5] + add r3, r3, 0x2 + strh r3, [r1, 0x12] +_082E3A3C: + ldr r0, [r5] + ldr r2, [r0, 0x24] + mov r3, 0x120 + ldr r1, [r2] + add r3, r3, 0x4000000 + str r1, [r3] + mov r2, 0x1 + strb r2, [r0, 0x8] + ldr r1, [r5] + mov r3, 0x7 + str r3, [r1] + b _082E3AD4 +_082E3A6C: + mov r3, 0x80000000 + str r3, [lr] + b _082E3AD4 +_082E3A78: + ldr r3, [r0] + cmp r3, 0x7 + bne _082E3AD4 + cmp r12, 0x80000000 + bne _082E3AC4 + ldrb r2, [r0, 0x7] + ldrb r3, [r0, 0x8] + cmp r2, r3 + movcc r3, 0x8 + strcc r3, [r0] + bcc _082E3AD4 + ldrb r1, [r0, 0x8] + ldr r3, [r0, 0x24] + ldr r2, [r3, r1, lsl 2] + str r2, [lr] + ldrb r3, [r0, 0x8] + add r3, r3, 0x1 + strb r3, [r0, 0x8] + b _082E3AD4 +_082E3AC4: + bl STWI_stop_timer_in_RAM + mov r0, 0x64 + bl STWI_set_timer_in_RAM + b _082E3C4C +_082E3AD4: + mov r0, 0x1 + bl handshake_wait + mov r0, r0, lsl 16 + cmp r0, 0x10000 + beq _082E3C4C + mov r6, r5 + ldr r3, [r6] + ldr r2, [r3] + cmp r2, 0x8 + bne _082E3B9C + mov r4, 0x128 + add r4, r4, 0x4000000 + mov r3, 0x5000 + add r3, r3, 0x2 + strh r3, [r4] + bl STWI_stop_timer_in_RAM + ldr r0, [r6] + ldrh r3, [r0, 0x12] + cmp r3, 0x3 + bne _082E3B48 + bl STWI_init_slave + ldr r3, [r6] + ldr r1, [r3, 0x1C] + cmp r1, 0 + beq _082E3C4C + mov r0, 0x1EC + add r0, r0, 0x2 + bl sub_82E3EAC + b _082E3C4C +_082E3B48: + mov r3, 0x120 + add r3, r3, 0x4000000 + mov r1, 0 + str r1, [r3] + mov r2, 0x5000 + strh r1, [r4] + add r2, r2, 0x3 + strh r2, [r4] + mov r3, 0x1 + strb r3, [r0, 0x14] + ldr r0, [r5] + ldr r2, [r0, 0x1C] + str r1, [r0] + cmp r2, r1 + beq _082E3C4C + ldrb r3, [r0, 0x4] + ldrb r0, [r0, 0x6] + mov r1, r2 + orr r0, r0, r3, lsl 8 + bl sub_82E3EAC + b _082E3C4C +_082E3B9C: + mov r3, 0x208 + add r3, r3, 0x4000000 + mov r2, 0 + strh r2, [r3] + mov r1, 0x100 + add r2, r1, 0x4000002 + ldrh r3, [r2] + tst r3, 0x80 + beq _082E3C20 + ldrh r3, [r2] + tst r3, 0x3 + bne _082E3BFC + mov r2, 0xFF00 + add r1, r1, 0x4000000 + ldrh r3, [r1] + add r2, r2, 0x9B + cmp r3, r2 + bls _082E3C20 +_082E3BE4: + ldrh r3, [r1] + cmp r3, r2 + bhi _082E3BE4 + b _082E3C20 + .align 2, 0 +_082E3BF4: .4byte 0x03007868 +_082E3BF8: .4byte 0x996601ee +_082E3BFC: + mov r2, 0xFF00 + add r1, r1, 0x4000000 + ldrh r3, [r1] + add r2, r2, 0xFE + cmp r3, r2 + bls _082E3C20 +_082E3C14: + ldrh r3, [r1] + cmp r3, r2 + bhi _082E3C14 +_082E3C20: + mov r1, 0x128 + add r1, r1, 0x4000000 + mov r0, 0x208 + add r0, r0, 0x4000000 + mov r3, 0x5000 + add r2, r3, 0x2 + strh r2, [r1] + add r3, r3, 0x82 + strh r3, [r1] + mov r2, 0x1 + strh r2, [r0] +_082E3C4C: + ldmdb r11, {r4-r6,r11,sp,lr} + bx lr + arm_func_end sio32intr_clock_slave + + arm_func_start handshake_wait +handshake_wait: @ 82E3C54 + mov r12, sp + stmdb sp!, {r11,r12,lr,pc} + mov r1, 0x128 + add r1, r1, 0x4000000 + mov r0, r0, lsl 16 + ldr r2, _082E3CB8 + sub r11, r12, 0x4 + mov lr, r0, lsr 14 + ldr r12, [r2] +_082E3C78: + ldrb r3, [r12, 0x10] + and r0, r3, 0xFF + cmp r0, 0x1 + beq _082E3CA4 + ldrh r3, [r1] + and r3, r3, 0x4 + cmp r3, lr + bne _082E3C78 + mov r0, 0 + ldmdb r11, {r11,sp,lr} + bx lr +_082E3CA4: + ldr r2, [r2] + mov r3, 0 + strb r3, [r2, 0x10] + ldmdb r11, {r11,sp,lr} + bx lr + .align 2, 0 +_082E3CB8: .4byte 0x03007868 + arm_func_end handshake_wait + + arm_func_start STWI_set_timer_in_RAM +STWI_set_timer_in_RAM: @ 82E3CBC + mov r12, sp + stmdb sp!, {r4,r5,r11,r12,lr,pc} + mov r1, 0x208 + add r1, r1, 0x4000000 + mov r3, 0 + sub r11, r12, 0x4 + ldr r12, _082E3D74 + and lr, r0, 0xFF + ldr r2, [r12] + cmp lr, 0x50 + ldrb r0, [r2, 0xA] + mov r4, r12 + mov r2, lr + strh r3, [r1] + mov r0, r0, lsl 2 + add r3, r3, 0x100 + add r1, r3, 0x4000000 + add r3, r3, 0x4000002 + add r5, r0, r3 + beq _082E3D44 + bgt _082E3D1C + cmp lr, 0x32 + beq _082E3D30 + b _082E3D90 +_082E3D1C: + cmp r2, 0x64 + beq _082E3D5C + cmp r2, 0x82 + beq _082E3D78 + b _082E3D90 +_082E3D30: + mvn r3, 0x334 + strh r3, [r0, r1] + ldr r2, [r4] + mov r3, 0x1 + b _082E3D8C +_082E3D44: + mov r3, 0xAE000000 + mov r3, r3, asr 20 + strh r3, [r0, r1] + ldr r2, [r4] + mov r3, 0x2 + b _082E3D8C +_082E3D5C: + mvn r3, 0x660 + sub r3, r3, 0x9 + strh r3, [r0, r1] + ldr r2, [r4] + mov r3, 0x3 + b _082E3D8C + .align 2, 0 +_082E3D74: .4byte 0x03007868 +_082E3D78: + mvn r3, 0x850 + sub r3, r3, 0x2 + strh r3, [r0, r1] + ldr r2, [r4] + mov r3, 0x4 +_082E3D8C: + str r3, [r2, 0xC] +_082E3D90: + mov r12, 0x200 + add r12, r12, 0x4000002 + mov r3, 0xC3 + strh r3, [r5] + mov r1, 0x208 + ldr r2, [r4] + add r1, r1, 0x4000000 + ldrb r0, [r2, 0xA] + sub r3, r3, 0xBB + mov r3, r3, lsl r0 + strh r3, [r12] + mov r2, 0x1 + strh r2, [r1] + ldmdb r11, {r4,r5,r11,sp,lr} + bx lr + arm_func_end STWI_set_timer_in_RAM + + arm_func_start STWI_stop_timer_in_RAM +STWI_stop_timer_in_RAM: @ 82E3DCC + mov r12, sp + stmdb sp!, {r11,r12,lr,pc} + mov r1, 0x100 + ldr lr, _082E3E18 + add r0, r1, 0x4000000 + ldr r2, [lr] + sub r11, r12, 0x4 + ldrb r3, [r2, 0xA] + mov r12, 0 + str r12, [r2, 0xC] + mov r3, r3, lsl 2 + strh r12, [r3, r0] + ldr r2, [lr] + ldrb r3, [r2, 0xA] + add r1, r1, 0x4000002 + mov r3, r3, lsl 2 + strh r12, [r3, r1] + ldmdb r11, {r11,sp,lr} + bx lr + .align 2, 0 +_082E3E18: .4byte 0x03007868 + arm_func_end STWI_stop_timer_in_RAM + + arm_func_start STWI_init_slave +STWI_init_slave: @ 82E3E1C + mov r12, sp + stmdb sp!, {r11,r12,lr,pc} + ldr r0, _082E3EA4 + ldr r2, [r0] + mov r3, 0x5 + str r3, [r2] + mov r1, 0 + strb r1, [r2, 0x14] + ldr r3, [r0] + strb r1, [r3, 0x4] + ldr r2, [r0] + strb r1, [r2, 0x5] + ldr r3, [r0] + strb r1, [r3, 0x6] + ldr r2, [r0] + strb r1, [r2, 0x7] + ldr r3, [r0] + strb r1, [r3, 0x8] + ldr r2, [r0] + strb r1, [r2, 0x9] + ldr r3, [r0] + str r1, [r3, 0xC] + sub r11, r12, 0x4 + strb r1, [r3, 0x10] + mov r2, 0x128 + ldr r12, [r0] + add r2, r2, 0x4000000 + strh r1, [r12, 0x12] + mov r3, 0x5000 + strb r1, [r12, 0x15] + add r3, r3, 0x82 + strh r3, [r2] + ldmdb r11, {r11,sp,lr} + bx lr + .align 2, 0 +_082E3EA4: .4byte 0x03007868 + arm_func_end STWI_init_slave + + arm_func_start sub_82E3EA8 +sub_82E3EA8: @ 82E3EA8 + bx r2 + arm_func_end sub_82E3EA8 + + arm_func_start sub_82E3EAC +sub_82E3EAC: @ 82E3EAC + bx r1 + arm_func_end sub_82E3EAC + + arm_func_start sub_82E3EB0 +sub_82E3EB0: @ 82E3EB0 + bx r0 + arm_func_end sub_82E3EB0 + + .thumb + thumb_func_start rfu_initializeAPI +rfu_initializeAPI: @ 82E3EB4 + push {r4-r7,lr} + adds r4, r0, 0 + mov r12, r2 + lsls r1, 16 + lsrs r2, r1, 16 + lsls r3, 24 + lsrs r7, r3, 24 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r4 + movs r1, 0x80 + lsls r1, 18 + cmp r0, r1 + bne _082E3ED4 + cmp r7, 0 + bne _082E3EDC +_082E3ED4: + movs r0, 0x3 + ands r0, r4 + cmp r0, 0 + beq _082E3EE0 +_082E3EDC: + movs r0, 0x2 + b _082E3FB8 +_082E3EE0: + cmp r7, 0 + beq _082E3EEC + ldr r3, _082E3EE8 + b _082E3EEE + .align 2, 0 +_082E3EE8: .4byte 0x00000e64 +_082E3EEC: + ldr r3, _082E3EF8 +_082E3EEE: + cmp r2, r3 + bcs _082E3EFC + movs r0, 0x1 + b _082E3FB8 + .align 2, 0 +_082E3EF8: .4byte 0x00000504 +_082E3EFC: + ldr r0, _082E3FC0 + str r4, [r0] + ldr r1, _082E3FC4 + adds r0, r4, 0 + adds r0, 0xB4 + str r0, [r1] + ldr r1, _082E3FC8 + adds r0, 0x28 + str r0, [r1] + ldr r2, _082E3FCC + movs r1, 0xDE + lsls r1, 1 + adds r0, r4, r1 + str r0, [r2] + ldr r1, _082E3FD0 + movs r3, 0xDF + lsls r3, 2 + adds r0, r4, r3 + str r0, [r1] + movs r5, 0x1 + adds r6, r2, 0 + adds r4, r1, 0 +_082E3F28: + lsls r2, r5, 2 + adds r3, r2, r6 + subs r1, r5, 0x1 + lsls r1, 2 + adds r0, r1, r6 + ldr r0, [r0] + adds r0, 0x70 + str r0, [r3] + adds r2, r4 + adds r1, r4 + ldr r0, [r1] + adds r0, 0x1C + str r0, [r2] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _082E3F28 + ldr r0, _082E3FC8 + ldr r1, [r0] + adds r1, 0xDC + ldr r4, _082E3FD0 + ldr r0, [r4, 0xC] + adds r0, 0x1C + str r0, [r1] + mov r1, r12 + adds r2, r7, 0 + bl STWI_init_all + bl rfu_STC_clearAPIVariables + movs r5, 0 + ldr r3, _082E3FCC + movs r2, 0 +_082E3F6C: + lsls r1, r5, 2 + adds r0, r1, r3 + ldr r0, [r0] + str r2, [r0, 0x68] + str r2, [r0, 0x6C] + adds r1, r4 + ldr r0, [r1] + str r2, [r0, 0x14] + str r2, [r0, 0x18] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _082E3F6C + ldr r4, _082E3FD4 + movs r0, 0x2 + negs r0, r0 + ands r4, r0 + ldr r1, _082E3FC8 + ldr r0, [r1] + adds r2, r0, 0 + adds r2, 0x8 + movs r3, 0x2F + ldr r5, _082E3FD8 +_082E3F9C: + ldrh r0, [r4] + strh r0, [r2] + adds r4, 0x2 + adds r2, 0x2 + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r5 + bne _082E3F9C + ldr r1, [r1] + adds r0, r1, 0 + adds r0, 0x9 + str r0, [r1, 0x4] + movs r0, 0 +_082E3FB8: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E3FC0: .4byte 0x03007890 +_082E3FC4: .4byte 0x03007894 +_082E3FC8: .4byte 0x03007898 +_082E3FCC: .4byte 0x03007880 +_082E3FD0: .4byte 0x03007870 +_082E3FD4: .4byte sub_82E53F4 + 1 +_082E3FD8: .4byte 0x0000ffff + thumb_func_end rfu_initializeAPI + + thumb_func_start rfu_STC_clearAPIVariables +rfu_STC_clearAPIVariables: @ 82E3FDC + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _082E4050 + ldrh r0, [r1] + adds r7, r0, 0 + movs r6, 0 + strh r6, [r1] + ldr r5, _082E4054 + ldr r1, [r5] + ldrb r4, [r1] + mov r0, sp + strh r6, [r0] + ldr r2, _082E4058 + bl CpuSet + ldr r2, [r5] + movs r0, 0x8 + ands r4, r0 + movs r1, 0 + strb r4, [r2] + mov r0, sp + adds r0, 0x2 + strh r1, [r0] + ldr r4, _082E405C + ldr r1, [r4] + ldr r2, _082E4060 + bl CpuSet + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x9] + ldr r0, [r5] + strb r6, [r0, 0x6] + ldr r1, [r4] + movs r0, 0xFF + strb r0, [r1] + bl rfu_clearAllSlot + ldr r0, [r5] + strb r6, [r0, 0x9] + movs r2, 0 + movs r3, 0 +_082E4030: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, 0x12 + adds r0, r1 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _082E4030 + ldr r0, _082E4050 + strh r7, [r0] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E4050: .4byte 0x04000208 +_082E4054: .4byte 0x03007894 +_082E4058: .4byte 0x01000014 +_082E405C: .4byte 0x03007890 +_082E4060: .4byte 0x0100005a + thumb_func_end rfu_STC_clearAPIVariables + + thumb_func_start rfu_REQ_PARENT_resumeRetransmitAndChange +rfu_REQ_PARENT_resumeRetransmitAndChange: @ 82E4064 + push {lr} + ldr r0, _082E4074 + bl STWI_set_Callback_M + bl STWI_send_ResumeRetransmitAndChangeREQ + pop {r0} + bx r0 + .align 2, 0 +_082E4074: .4byte rfu_STC_REQ_callback + 1 + thumb_func_end rfu_REQ_PARENT_resumeRetransmitAndChange + + thumb_func_start rfu_UNI_PARENT_getDRAC_ACK +rfu_UNI_PARENT_getDRAC_ACK: @ 82E4078 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0 + strb r0, [r4] + ldr r5, _082E4090 + ldr r0, [r5] + ldrb r0, [r0] + cmp r0, 0x1 + beq _082E4094 + movs r0, 0xC0 + lsls r0, 2 + b _082E40BA + .align 2, 0 +_082E4090: .4byte 0x03007890 +_082E4094: + bl rfu_getSTWIRecvBuffer + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x28 + beq _082E40A4 + cmp r0, 0x36 + bne _082E40B8 +_082E40A4: + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _082E40B0 + ldr r0, [r5] + ldrb r0, [r0, 0x2] + b _082E40B2 +_082E40B0: + ldrb r0, [r1, 0x4] +_082E40B2: + strb r0, [r4] + movs r0, 0 + b _082E40BA +_082E40B8: + movs r0, 0x10 +_082E40BA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end rfu_UNI_PARENT_getDRAC_ACK + + thumb_func_start rfu_setTimerInterrupt +rfu_setTimerInterrupt: @ 82E40C0 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r1, r2, 0 + bl STWI_init_timer + pop {r0} + bx r0 + thumb_func_end rfu_setTimerInterrupt + + thumb_func_start rfu_getSTWIRecvBuffer +rfu_getSTWIRecvBuffer: @ 82E40D4 + ldr r0, _082E40E0 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + bx lr + .align 2, 0 +_082E40E0: .4byte 0x03007898 + thumb_func_end rfu_getSTWIRecvBuffer + + thumb_func_start rfu_setMSCCallback +rfu_setMSCCallback: @ 82E40E4 + push {lr} + bl STWI_set_Callback_S + pop {r0} + bx r0 + thumb_func_end rfu_setMSCCallback + + thumb_func_start rfu_setREQCallback +rfu_setREQCallback: @ 82E40F0 + push {lr} + adds r1, r0, 0 + ldr r0, _082E4108 + ldr r0, [r0] + str r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bl rfu_enableREQCallback + pop {r0} + bx r0 + .align 2, 0 +_082E4108: .4byte 0x03007898 + thumb_func_end rfu_setREQCallback + + thumb_func_start rfu_enableREQCallback +rfu_enableREQCallback: @ 82E410C + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _082E4124 + ldr r0, _082E4120 + ldr r2, [r0] + ldrb r1, [r2] + movs r0, 0x8 + orrs r0, r1 + b _082E412E + .align 2, 0 +_082E4120: .4byte 0x03007894 +_082E4124: + ldr r0, _082E4134 + ldr r2, [r0] + ldrb r1, [r2] + movs r0, 0xF7 + ands r0, r1 +_082E412E: + strb r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_082E4134: .4byte 0x03007894 + thumb_func_end rfu_enableREQCallback + + thumb_func_start rfu_STC_REQ_callback +rfu_STC_REQ_callback: @ 82E4138 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, _082E416C + bl STWI_set_Callback_M + ldr r0, _082E4170 + ldr r0, [r0] + strh r4, [r0, 0x1C] + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _082E4166 + ldr r0, _082E4174 + ldr r0, [r0] + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl _call_via_r2 +_082E4166: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E416C: .4byte rfu_CB_defaultCallback + 1 +_082E4170: .4byte 0x03007894 +_082E4174: .4byte 0x03007898 + thumb_func_end rfu_STC_REQ_callback + + thumb_func_start rfu_CB_defaultCallback +rfu_CB_defaultCallback: @ 82E4178 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r0, 0xFF + bne _082E41D4 + ldr r0, _082E41DC + ldr r0, [r0] + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _082E41A2 + ldr r0, _082E41E0 + ldr r0, [r0] + ldr r2, [r0] + movs r0, 0xFF + adds r1, r3, 0 + bl _call_via_r2 +_082E41A2: + ldr r0, _082E41E4 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + ldrb r0, [r0, 0x3] + adds r5, r0, 0 + orrs r5, r1 + movs r4, 0 +_082E41B0: + adds r0, r5, 0 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _082E41C2 + adds r0, r4, 0 + bl rfu_STC_removeLinkData +_082E41C2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _082E41B0 + ldr r0, _082E41E4 + ldr r1, [r0] + movs r0, 0xFF + strb r0, [r1] +_082E41D4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E41DC: .4byte 0x03007894 +_082E41E0: .4byte 0x03007898 +_082E41E4: .4byte 0x03007890 + thumb_func_end rfu_CB_defaultCallback + + thumb_func_start rfu_waitREQComplete +rfu_waitREQComplete: @ 82E41E8 + push {lr} + bl STWI_poll_CommandEnd + ldr r0, _082E41F8 + ldr r0, [r0] + ldrh r0, [r0, 0x1C] + pop {r1} + bx r1 + .align 2, 0 +_082E41F8: .4byte 0x03007894 + thumb_func_end rfu_waitREQComplete + + thumb_func_start rfu_REQ_RFUStatus +rfu_REQ_RFUStatus: @ 82E41FC + push {lr} + ldr r0, _082E420C + bl STWI_set_Callback_M + bl STWI_send_SystemStatusREQ + pop {r0} + bx r0 + .align 2, 0 +_082E420C: .4byte rfu_STC_REQ_callback + 1 + thumb_func_end rfu_REQ_RFUStatus + + thumb_func_start rfu_getRFUStatus +rfu_getRFUStatus: @ 82E4210 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _082E4228 + ldr r0, [r5] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x93 + beq _082E422C + movs r0, 0x10 + b _082E4246 + .align 2, 0 +_082E4228: .4byte 0x03007898 +_082E422C: + bl STWI_poll_CommandEnd + lsls r0, 16 + cmp r0, 0 + bne _082E4240 + ldr r0, [r5] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0, 0x7] + b _082E4242 +_082E4240: + movs r0, 0xFF +_082E4242: + strb r0, [r4] + movs r0, 0 +_082E4246: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end rfu_getRFUStatus + + thumb_func_start sub_82E424C +sub_82E424C: @ 82E424C + push {lr} + ldr r2, _082E4254 + ldr r3, _082E4258 + b _082E4266 + .align 2, 0 +_082E4254: .4byte 0x089a324c +_082E4258: .4byte 0x030000f0 + thumb_func_end sub_82E424C + + thumb_func_start sub_82E425C +sub_82E425C: @ 82E425C + ldrb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r1, r0 + bne _082E42BC +_082E4266: + ldrb r1, [r2] + cmp r1, 0 + bne sub_82E425C + movs r2, 0xC0 + lsls r2, 18 + movs r3, 0 + movs r1, 0 +_082E4274: + ldrh r0, [r2] + adds r0, r3, r0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r2, 0x2 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x59 + bls _082E4274 + ldr r0, _082E42B0 + ldrh r0, [r0] + cmp r3, r0 + bne _082E42BC + movs r0, 0xC0 + lsls r0, 18 + ldr r1, _082E42B4 + ldr r1, [r1] + movs r2, 0x5A + bl CpuSet + ldr r0, _082E42B8 + ldr r2, [r0] + ldrb r1, [r2] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0 + b _082E42BE + .align 2, 0 +_082E42B0: .4byte 0x030000fa +_082E42B4: .4byte 0x03007890 +_082E42B8: .4byte 0x03007894 +_082E42BC: + movs r0, 0x1 +_082E42BE: + pop {r1} + bx r1 + thumb_func_end sub_82E425C + + thumb_func_start rfu_REQ_stopMode +rfu_REQ_stopMode: @ 82E42C4 + push {lr} + ldr r0, _082E42E4 + ldrh r0, [r0] + cmp r0, 0 + bne _082E42EC + movs r0, 0x3D + movs r1, 0x6 + bl rfu_STC_REQ_callback + ldr r0, _082E42E8 + ldr r1, [r0] + ldrh r0, [r1, 0x12] + movs r0, 0x6 + strh r0, [r1, 0x12] + b _082E4362 + .align 2, 0 +_082E42E4: .4byte 0x04000208 +_082E42E8: .4byte 0x03007868 +_082E42EC: + bl AgbRFU_SoftReset + bl rfu_STC_clearAPIVariables + movs r0, 0x8 + bl sub_82E6D6C + ldr r1, _082E433C + cmp r0, r1 + bne _082E4350 + ldr r0, _082E4340 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + lsls r0, 2 + ldr r2, _082E4344 + adds r1, r0, r2 + movs r0, 0 + str r0, [r1] + movs r0, 0x83 + lsls r0, 16 + str r0, [r1] + ldr r0, [r1] + lsls r0, 16 + ldr r2, _082E4348 + ldr r3, _082E434C + cmp r0, r2 + bhi _082E432A +_082E4322: + ldr r0, [r1] + lsls r0, 16 + cmp r0, r2 + bls _082E4322 +_082E432A: + movs r0, 0 + str r0, [r1] + adds r0, r3, 0 + bl STWI_set_Callback_M + bl STWI_send_StopModeREQ + b _082E4362 + .align 2, 0 +_082E433C: .4byte 0x00008001 +_082E4340: .4byte 0x03007868 +_082E4344: .4byte 0x04000100 +_082E4348: .4byte 0x0105ffff +_082E434C: .4byte rfu_CB_stopMode + 1 +_082E4350: + ldr r1, _082E4368 + movs r2, 0x80 + lsls r2, 6 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0x3D + movs r1, 0 + bl rfu_STC_REQ_callback +_082E4362: + pop {r0} + bx r0 + .align 2, 0 +_082E4368: .4byte 0x04000128 + thumb_func_end rfu_REQ_stopMode + + thumb_func_start rfu_CB_stopMode +rfu_CB_stopMode: @ 82E436C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r2, r1, 0 + cmp r2, 0 + bne _082E4386 + ldr r1, _082E4394 + movs r4, 0x80 + lsls r4, 6 + adds r0, r4, 0 + strh r0, [r1] +_082E4386: + adds r0, r3, 0 + adds r1, r2, 0 + bl rfu_STC_REQ_callback + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E4394: .4byte 0x04000128 + thumb_func_end rfu_CB_stopMode + + thumb_func_start rfu_REQBN_softReset_and_checkID +rfu_REQBN_softReset_and_checkID: @ 82E4398 + push {lr} + ldr r0, _082E43A8 + ldrh r0, [r0] + cmp r0, 0 + bne _082E43AC + movs r0, 0x1 + negs r0, r0 + b _082E43CC + .align 2, 0 +_082E43A8: .4byte 0x04000208 +_082E43AC: + bl AgbRFU_SoftReset + bl rfu_STC_clearAPIVariables + movs r0, 0x1E + bl sub_82E6D6C + adds r2, r0, 0 + cmp r2, 0 + bne _082E43CA + ldr r1, _082E43D0 + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + strh r0, [r1] +_082E43CA: + adds r0, r2, 0 +_082E43CC: + pop {r1} + bx r1 + .align 2, 0 +_082E43D0: .4byte 0x04000128 + thumb_func_end rfu_REQBN_softReset_and_checkID + + thumb_func_start rfu_REQ_reset +rfu_REQ_reset: @ 82E43D4 + push {lr} + ldr r0, _082E43E4 + bl STWI_set_Callback_M + bl STWI_send_ResetREQ + pop {r0} + bx r0 + .align 2, 0 +_082E43E4: .4byte rfu_CB_reset + 1 + thumb_func_end rfu_REQ_reset + + thumb_func_start rfu_CB_reset +rfu_CB_reset: @ 82E43E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r4, r1, 0 + cmp r4, 0 + bne _082E43FC + bl rfu_STC_clearAPIVariables +_082E43FC: + adds r0, r5, 0 + adds r1, r4, 0 + bl rfu_STC_REQ_callback + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end rfu_CB_reset + + thumb_func_start rfu_REQ_configSystem +rfu_REQ_configSystem: @ 82E440C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _082E4444 + bl STWI_set_Callback_M + movs r0, 0x3 + ands r4, r0 + movs r0, 0x3C + orrs r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl STWI_send_SystemConfigREQ + cmp r6, 0 + bne _082E444C + ldr r0, _082E4448 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x1A] + b _082E4466 + .align 2, 0 +_082E4444: .4byte rfu_STC_REQ_callback + 1 +_082E4448: .4byte 0x03007894 +_082E444C: + ldr r5, _082E446C + ldrh r4, [r5] + movs r0, 0 + strh r0, [r5] + movs r0, 0x96 + lsls r0, 2 + adds r1, r6, 0 + bl Div + ldr r1, _082E4470 + ldr r1, [r1] + strh r0, [r1, 0x1A] + strh r4, [r5] +_082E4466: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E446C: .4byte 0x04000208 +_082E4470: .4byte 0x03007894 + thumb_func_end rfu_REQ_configSystem + + thumb_func_start rfu_REQ_configGameData +rfu_REQ_configGameData: @ 82E4474 + push {r4-r7,lr} + sub sp, 0x10 + adds r4, r2, 0 + adds r7, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, r1, 16 + adds r5, r4, 0 + mov r0, sp + strb r1, [r0] + lsrs r2, 24 + strb r2, [r0, 0x1] + cmp r6, 0 + beq _082E449A + movs r1, 0x80 + orrs r2, r1 + movs r1, 0 + orrs r2, r1 + strb r2, [r0, 0x1] +_082E449A: + movs r2, 0x2 + ldr r0, _082E44FC + mov r12, r0 +_082E44A0: + mov r3, sp + adds r1, r3, r2 + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xE + bls _082E44A0 + movs r3, 0 + adds r1, r7, 0 + movs r2, 0 +_082E44BA: + ldrb r0, [r1] + adds r0, r3, r0 + lsls r0, 24 + adds r1, 0x1 + lsrs r0, 24 + ldrb r3, [r5] + adds r0, r3 + lsls r0, 24 + lsrs r3, r0, 24 + adds r5, 0x1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _082E44BA + mov r1, sp + mvns r0, r3 + strb r0, [r1, 0xF] + cmp r6, 0 + beq _082E44E6 + movs r0, 0 + strb r0, [r1, 0xE] +_082E44E6: + mov r0, r12 + bl STWI_set_Callback_M + mov r0, sp + adds r1, r7, 0 + bl STWI_send_GameConfigREQ + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E44FC: .4byte rfu_CB_configGameData + 1 + thumb_func_end rfu_REQ_configGameData + + thumb_func_start rfu_CB_configGameData +rfu_CB_configGameData: @ 82E4500 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r1, 16 + lsrs r7, r1, 16 + cmp r7, 0 + bne _082E458A + ldr r0, _082E4544 + ldr r0, [r0] + ldr r1, [r0, 0x24] + ldr r0, _082E4548 + ldr r6, [r0] + ldrb r2, [r1, 0x4] + adds r5, r6, 0 + adds r5, 0x98 + strh r2, [r5] + ldrb r0, [r1, 0x5] + lsls r3, r0, 8 + orrs r3, r2 + strh r3, [r5] + adds r4, r1, 0x6 + movs r1, 0x80 + lsls r1, 8 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _082E454C + eors r3, r1 + strh r3, [r5] + adds r1, r6, 0 + adds r1, 0x97 + movs r0, 0x1 + b _082E4552 + .align 2, 0 +_082E4544: .4byte 0x03007868 +_082E4548: .4byte 0x03007890 +_082E454C: + adds r1, r6, 0 + adds r1, 0x97 + movs r0, 0 +_082E4552: + strb r0, [r1] + movs r2, 0 + ldr r3, _082E4598 +_082E4558: + ldr r0, [r3] + adds r0, 0x9A + adds r0, r2 + ldrb r1, [r4] + strb r1, [r0] + adds r4, 0x1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xC + bls _082E4558 + adds r4, 0x1 + movs r2, 0 + ldr r3, _082E4598 +_082E4574: + ldr r0, [r3] + adds r0, 0xA9 + adds r0, r2 + ldrb r1, [r4] + strb r1, [r0] + adds r4, 0x1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _082E4574 +_082E458A: + mov r0, r12 + adds r1, r7, 0 + bl rfu_STC_REQ_callback + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E4598: .4byte 0x03007890 + thumb_func_end rfu_CB_configGameData + + thumb_func_start rfu_REQ_startSearchChild +rfu_REQ_startSearchChild: @ 82E459C + push {r4,lr} + movs r1, 0 + ldr r4, _082E45E4 + ldr r3, _082E45E8 + movs r2, 0 +_082E45A6: + ldr r0, [r3] + adds r0, 0xE + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3 + bls _082E45A6 + adds r0, r4, 0 + bl STWI_set_Callback_M + bl STWI_send_SystemStatusREQ + bl STWI_poll_CommandEnd + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _082E45F0 + ldr r0, _082E45EC + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _082E45F6 + movs r0, 0x1 + bl rfu_STC_clearLinkStatus + b _082E45F6 + .align 2, 0 +_082E45E4: .4byte rfu_CB_defaultCallback + 1 +_082E45E8: .4byte 0x03007894 +_082E45EC: .4byte 0x03007898 +_082E45F0: + movs r0, 0x19 + bl rfu_STC_REQ_callback +_082E45F6: + ldr r0, _082E4608 + bl STWI_set_Callback_M + bl STWI_send_SC_StartREQ + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E4608: .4byte rfu_CB_startSearchChild + 1 + thumb_func_end rfu_REQ_startSearchChild + + thumb_func_start rfu_CB_startSearchChild +rfu_CB_startSearchChild: @ 82E460C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r2, r1, 0 + cmp r2, 0 + bne _082E4624 + ldr r0, _082E4630 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x9] +_082E4624: + adds r0, r3, 0 + adds r1, r2, 0 + bl rfu_STC_REQ_callback + pop {r0} + bx r0 + .align 2, 0 +_082E4630: .4byte 0x03007894 + thumb_func_end rfu_CB_startSearchChild + + thumb_func_start rfu_STC_clearLinkStatus +rfu_STC_clearLinkStatus: @ 82E4634 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl rfu_clearAllSlot + cmp r4, 0 + beq _082E465C + mov r0, sp + movs r5, 0 + strh r5, [r0] + ldr r4, _082E4690 + ldr r1, [r4] + adds r1, 0x14 + ldr r2, _082E4694 + bl CpuSet + ldr r0, [r4] + strb r5, [r0, 0x8] +_082E465C: + movs r1, 0 + ldr r2, _082E4690 + adds r4, r2, 0 + movs r3, 0 +_082E4664: + ldr r0, [r4] + adds r0, 0xA + adds r0, r1 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _082E4664 + ldr r0, [r2] + movs r1, 0 + strb r1, [r0, 0x1] + ldr r0, [r2] + strb r1, [r0, 0x2] + ldr r0, [r2] + strb r1, [r0, 0x3] + ldr r0, [r2] + strb r1, [r0, 0x7] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E4690: .4byte 0x03007890 +_082E4694: .4byte 0x01000040 + thumb_func_end rfu_STC_clearLinkStatus + + thumb_func_start rfu_REQ_pollSearchChild +rfu_REQ_pollSearchChild: @ 82E4698 + push {lr} + ldr r0, _082E46A8 + bl STWI_set_Callback_M + bl STWI_send_SC_PollingREQ + pop {r0} + bx r0 + .align 2, 0 +_082E46A8: .4byte rfu_CB_pollAndEndSearchChild + 1 + thumb_func_end rfu_REQ_pollSearchChild + + thumb_func_start rfu_REQ_endSearchChild +rfu_REQ_endSearchChild: @ 82E46AC + push {lr} + ldr r0, _082E46BC + bl STWI_set_Callback_M + bl STWI_send_SC_EndREQ + pop {r0} + bx r0 + .align 2, 0 +_082E46BC: .4byte rfu_CB_pollAndEndSearchChild + 1 + thumb_func_end rfu_REQ_endSearchChild + + thumb_func_start rfu_CB_pollAndEndSearchChild +rfu_CB_pollAndEndSearchChild: @ 82E46C0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + cmp r6, 0 + bne _082E46D2 + bl rfu_STC_readChildList +_082E46D2: + cmp r4, 0x1A + bne _082E4714 + ldr r5, _082E4708 + ldr r0, [r5] + adds r0, 0x94 + ldrh r0, [r0] + cmp r0, 0 + bne _082E4730 + ldr r0, _082E470C + bl STWI_set_Callback_M + bl STWI_send_SystemStatusREQ + bl STWI_poll_CommandEnd + lsls r0, 16 + cmp r0, 0 + bne _082E4730 + ldr r1, [r5] + ldr r0, _082E4710 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrh r0, [r0, 0x4] + adds r1, 0x94 + strh r0, [r1] + b _082E4730 + .align 2, 0 +_082E4708: .4byte 0x03007890 +_082E470C: .4byte rfu_CB_defaultCallback + 1 +_082E4710: .4byte 0x03007898 +_082E4714: + cmp r4, 0x1B + bne _082E4730 + ldr r0, _082E4740 + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0xFF + bne _082E4728 + adds r1, 0x94 + movs r0, 0 + strh r0, [r1] +_082E4728: + ldr r0, _082E4744 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x9] +_082E4730: + adds r0, r4, 0 + adds r1, r6, 0 + bl rfu_STC_REQ_callback + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E4740: .4byte 0x03007890 +_082E4744: .4byte 0x03007894 + thumb_func_end rfu_CB_pollAndEndSearchChild + + thumb_func_start rfu_STC_readChildList +rfu_STC_readChildList: @ 82E4748 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _082E47F8 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r7, [r0, 0x1] + adds r6, r0, 0x4 + cmp r7, 0 + beq _082E47EE + ldr r0, _082E47FC + mov r8, r0 + ldr r1, _082E4800 + mov r12, r1 +_082E4766: + ldrb r4, [r6, 0x2] + cmp r4, 0x3 + bhi _082E47E2 + mov r2, r12 + ldr r1, [r2] + ldrb r0, [r1, 0x2] + asrs r0, r4 + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _082E47E2 + ldrb r0, [r1, 0x3] + asrs r0, r4 + ands r0, r5 + cmp r0, 0 + bne _082E47E2 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xE + adds r0, r4 + movs r1, 0xF0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xA + adds r0, r4 + movs r1, 0x10 + strb r1, [r0] + ldr r2, [r2] + adds r0, r5, 0 + lsls r0, r4 + ldrb r1, [r2, 0x2] + orrs r0, r1 + strb r0, [r2, 0x2] + mov r2, r12 + ldr r1, [r2] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + ldr r1, [r2] + lsls r3, r4, 5 + adds r1, r3 + ldrh r0, [r6] + strh r0, [r1, 0x14] + strb r4, [r1, 0x16] + ldr r0, [r2] + strb r5, [r0] + mov r0, r8 + ldr r2, [r0] + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + mov r2, r8 + ldr r1, [r2] + lsls r0, r4, 1 + adds r1, 0x12 + adds r1, r0 + mov r2, r12 + ldr r0, [r2] + adds r0, r3 + ldrh r0, [r0, 0x14] + strh r0, [r1] +_082E47E2: + subs r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r6, 0x4 + cmp r7, 0 + bne _082E4766 +_082E47EE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E47F8: .4byte 0x03007898 +_082E47FC: .4byte 0x03007894 +_082E4800: .4byte 0x03007890 + thumb_func_end rfu_STC_readChildList + + thumb_func_start rfu_REQ_startSearchParent +rfu_REQ_startSearchParent: @ 82E4804 + push {lr} + ldr r0, _082E4814 + bl STWI_set_Callback_M + bl STWI_send_SP_StartREQ + pop {r0} + bx r0 + .align 2, 0 +_082E4814: .4byte rfu_CB_startSearchParent + 1 + thumb_func_end rfu_REQ_startSearchParent + + thumb_func_start rfu_CB_startSearchParent +rfu_CB_startSearchParent: @ 82E4818 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r4, r1, 0 + cmp r4, 0 + bne _082E482E + movs r0, 0 + bl rfu_STC_clearLinkStatus +_082E482E: + adds r0, r5, 0 + adds r1, r4, 0 + bl rfu_STC_REQ_callback + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end rfu_CB_startSearchParent + + thumb_func_start rfu_REQ_pollSearchParent +rfu_REQ_pollSearchParent: @ 82E483C + push {lr} + ldr r0, _082E484C + bl STWI_set_Callback_M + bl STWI_send_SP_PollingREQ + pop {r0} + bx r0 + .align 2, 0 +_082E484C: .4byte sub_82E4850 + 1 + thumb_func_end rfu_REQ_pollSearchParent + + thumb_func_start sub_82E4850 +sub_82E4850: @ 82E4850 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r4, r1, 0 + cmp r4, 0 + bne _082E4864 + bl rfu_STC_readParentCandidateList +_082E4864: + adds r0, r5, 0 + adds r1, r4, 0 + bl rfu_STC_REQ_callback + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_82E4850 + + thumb_func_start rfu_REQ_endSearchParent +rfu_REQ_endSearchParent: @ 82E4874 + push {lr} + ldr r0, _082E4884 + bl STWI_set_Callback_M + bl STWI_send_SP_EndREQ + pop {r0} + bx r0 + .align 2, 0 +_082E4884: .4byte rfu_STC_REQ_callback + 1 + thumb_func_end rfu_REQ_endSearchParent + + thumb_func_start rfu_STC_readParentCandidateList +rfu_STC_readParentCandidateList: @ 82E4888 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r0, sp + movs r4, 0 + strh r4, [r0] + ldr r5, _082E4930 + ldr r1, [r5] + adds r1, 0x14 + ldr r2, _082E4934 + bl CpuSet + ldr r0, _082E4938 + ldr r0, [r0] + adds r0, 0xDC + ldr r2, [r0] + ldrb r7, [r2, 0x1] + adds r2, 0x4 + ldr r0, [r5] + strb r4, [r0, 0x8] + movs r6, 0 + cmp r7, 0 + beq _082E498C + mov r12, r5 + ldr r0, _082E493C + mov r8, r0 +_082E48BE: + subs r0, r7, 0x7 + lsls r0, 24 + lsrs r7, r0, 24 + adds r1, r2, 0x6 + adds r2, 0x13 + ldrb r0, [r2] + mvns r0, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, 0x1 + movs r4, 0 + movs r3, 0 + adds r6, 0x1 +_082E48D8: + ldrb r0, [r2] + adds r0, r4, r0 + lsls r0, 24 + adds r2, 0x1 + lsrs r0, 24 + ldrb r4, [r1] + adds r0, r4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r1, 0x1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x7 + bls _082E48D8 + cmp r4, r5 + bne _082E4980 + subs r2, 0x1C + mov r0, r12 + ldr r1, [r0] + ldrb r0, [r1, 0x8] + lsls r0, 5 + adds r0, 0x14 + adds r4, r1, r0 + ldrh r0, [r2] + movs r3, 0 + strh r0, [r4] + adds r2, 0x2 + ldrb r0, [r2] + strb r0, [r4, 0x2] + adds r2, 0x2 + ldrh r1, [r2] + mov r0, r8 + ands r0, r1 + strh r0, [r4, 0x4] + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _082E4940 + movs r0, 0x1 + strb r0, [r4, 0x3] + b _082E4942 + .align 2, 0 +_082E4930: .4byte 0x03007890 +_082E4934: .4byte 0x01000040 +_082E4938: .4byte 0x03007898 +_082E493C: .4byte 0x00007fff +_082E4940: + strb r3, [r4, 0x3] +_082E4942: + adds r2, 0x2 + movs r3, 0 + adds r5, r4, 0 + adds r5, 0x15 + adds r4, 0x6 +_082E494C: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xC + bls _082E494C + adds r2, 0x1 + movs r3, 0 + adds r4, r5, 0 +_082E4964: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x7 + bls _082E4964 + mov r4, r12 + ldr r1, [r4] + ldrb r0, [r1, 0x8] + adds r0, 0x1 + strb r0, [r1, 0x8] +_082E4980: + lsls r0, r6, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bhi _082E498C + cmp r7, 0 + bne _082E48BE +_082E498C: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end rfu_STC_readParentCandidateList + + thumb_func_start rfu_REQ_startConnectParent +rfu_REQ_startConnectParent: @ 82E4998 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + movs r2, 0 + ldr r1, _082E49E4 + ldr r0, [r1] + ldrh r0, [r0, 0x14] + cmp r0, r4 + beq _082E49C4 + adds r5, r1, 0 +_082E49AE: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bhi _082E49C4 + ldr r0, [r5] + lsls r1, r2, 5 + adds r0, r1 + ldrh r0, [r0, 0x14] + cmp r0, r4 + bne _082E49AE +_082E49C4: + cmp r2, 0x4 + bne _082E49CC + movs r3, 0x80 + lsls r3, 1 +_082E49CC: + cmp r3, 0 + bne _082E49F0 + ldr r0, _082E49E8 + ldr r0, [r0] + strh r4, [r0, 0x1E] + ldr r0, _082E49EC + bl STWI_set_Callback_M + adds r0, r4, 0 + bl STWI_send_CP_StartREQ + b _082E49F8 + .align 2, 0 +_082E49E4: .4byte 0x03007890 +_082E49E8: .4byte 0x03007894 +_082E49EC: .4byte rfu_STC_REQ_callback + 1 +_082E49F0: + movs r0, 0x1F + adds r1, r3, 0 + bl rfu_STC_REQ_callback +_082E49F8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end rfu_REQ_startConnectParent + + thumb_func_start rfu_REQ_pollConnectParent +rfu_REQ_pollConnectParent: @ 82E4A00 + push {lr} + ldr r0, _082E4A10 + bl STWI_set_Callback_M + bl STWI_send_CP_PollingREQ + pop {r0} + bx r0 + .align 2, 0 +_082E4A10: .4byte rfu_CB_pollConnectParent + 1 + thumb_func_end rfu_REQ_pollConnectParent + + thumb_func_start rfu_CB_pollConnectParent +rfu_CB_pollConnectParent: @ 82E4A14 + 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, 0x24] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x28] + cmp r1, 0 + bne _082E4B16 + ldr r0, _082E4AD0 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrh r5, [r0, 0x4] + ldrb r1, [r0, 0x6] + mov r10, r1 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _082E4B16 + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r2, r0, 24 + ldr r4, _082E4AD4 + ldr r3, [r4] + ldrb r1, [r3, 0x2] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _082E4B16 + adds r0, r2, 0 + orrs r0, r1 + strb r0, [r3, 0x2] + ldr r1, [r4] + ldrb r0, [r1, 0x3] + bics r0, r2 + strb r0, [r1, 0x3] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x94 + movs r2, 0 + strh r5, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, [r4] + strb r2, [r0] + ldr r3, _082E4AD8 + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r5, 0 + adds r7, r4, 0 + add r6, sp, 0x20 + movs r0, 0 + mov r8, r0 +_082E4A92: + ldr r2, [r7] + lsls r4, r5, 5 + adds r0, r2, r4 + ldr r1, [r3] + ldrh r0, [r0, 0x14] + ldrh r1, [r1, 0x1E] + cmp r0, r1 + bne _082E4AEA + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _082E4AE0 + mov r9, sp + adds r0, r4, 0 + adds r0, 0x14 + adds r0, r2, r0 + mov r1, sp + movs r2, 0x10 + bl CpuSet + mov r1, r8 + strh r1, [r6] + ldr r1, [r7] + adds r1, 0x14 + adds r0, r6, 0 + ldr r2, _082E4ADC + bl CpuSet + ldr r0, [r7] + mov r1, r8 + strb r1, [r0, 0x8] + b _082E4AF4 + .align 2, 0 +_082E4AD0: .4byte 0x03007898 +_082E4AD4: .4byte 0x03007890 +_082E4AD8: .4byte 0x03007894 +_082E4ADC: .4byte 0x01000040 +_082E4AE0: + adds r0, r4, 0 + adds r0, 0x14 + adds r2, r0 + mov r9, r2 + b _082E4AF4 +_082E4AEA: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _082E4A92 +_082E4AF4: + cmp r5, 0x3 + bhi _082E4B16 + ldr r4, _082E4B30 + mov r0, r10 + lsls r5, r0, 5 + adds r0, r5, 0 + adds r0, 0x14 + ldr r1, [r4] + adds r1, r0 + mov r0, r9 + movs r2, 0x10 + bl CpuSet + ldr r0, [r4] + adds r0, r5 + mov r1, r10 + strb r1, [r0, 0x16] +_082E4B16: + ldr r0, [sp, 0x24] + ldr r1, [sp, 0x28] + bl rfu_STC_REQ_callback + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E4B30: .4byte 0x03007890 + thumb_func_end rfu_CB_pollConnectParent + + thumb_func_start rfu_getConnectParentStatus +rfu_getConnectParentStatus: @ 82E4B34 + push {lr} + adds r3, r0, 0 + movs r0, 0xFF + strb r0, [r3] + ldr r0, _082E4B54 + ldr r0, [r0] + adds r0, 0xDC + ldr r2, [r0] + ldrb r0, [r2] + adds r0, 0x60 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _082E4B58 + movs r0, 0x10 + b _082E4B64 + .align 2, 0 +_082E4B54: .4byte 0x03007898 +_082E4B58: + adds r2, 0x6 + ldrb r0, [r2] + strb r0, [r1] + ldrb r0, [r2, 0x1] + strb r0, [r3] + movs r0, 0 +_082E4B64: + pop {r1} + bx r1 + thumb_func_end rfu_getConnectParentStatus + + thumb_func_start rfu_REQ_endConnectParent +rfu_REQ_endConnectParent: @ 82E4B68 + push {lr} + ldr r0, _082E4B94 + bl STWI_set_Callback_M + bl STWI_send_CP_EndREQ + ldr r0, _082E4B98 + ldr r0, [r0] + adds r0, 0xDC + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x3 + bhi _082E4B90 + ldr r0, _082E4B9C + ldr r0, [r0] + adds r0, 0xA + ldrb r1, [r1, 0x6] + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_082E4B90: + pop {r0} + bx r0 + .align 2, 0 +_082E4B94: .4byte rfu_CB_pollConnectParent + 1 +_082E4B98: .4byte 0x03007898 +_082E4B9C: .4byte 0x03007894 + thumb_func_end rfu_REQ_endConnectParent + + thumb_func_start rfu_syncVBlank +rfu_syncVBlank: @ 82E4BA0 + push {r4,r5,lr} + bl rfu_NI_checkCommFailCounter + ldr r0, _082E4BE8 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + beq _082E4C78 + ldr r4, _082E4BEC + ldr r1, [r4] + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _082E4BBE + subs r0, 0x1 + strb r0, [r1, 0x6] +_082E4BBE: + bl rfu_getMasterSlave + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, [r4] + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _082E4BF0 + cmp r3, 0 + bne _082E4BFE + movs r0, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r4] + movs r0, 0xB4 + lsls r0, 1 + strh r0, [r1, 0x20] + b _082E4BFA + .align 2, 0 +_082E4BE8: .4byte 0x03007890 +_082E4BEC: .4byte 0x03007894 +_082E4BF0: + cmp r3, 0 + beq _082E4C10 + movs r0, 0xFB + ands r0, r1 + strb r0, [r2] +_082E4BFA: + cmp r3, 0 + beq _082E4C10 +_082E4BFE: + ldr r3, _082E4C0C + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + b _082E4C1A + .align 2, 0 +_082E4C0C: .4byte 0x03007894 +_082E4C10: + ldr r3, _082E4C6C + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0x2 + orrs r0, r1 +_082E4C1A: + strb r0, [r2] + ldr r3, [r3] + ldrb r1, [r3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _082E4C78 + ldrh r0, [r3, 0x20] + cmp r0, 0 + bne _082E4C74 + movs r0, 0xFB + ands r0, r1 + strb r0, [r3] + ldr r0, _082E4C70 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + ldrb r0, [r0, 0x3] + adds r5, r0, 0 + orrs r5, r1 + movs r4, 0 +_082E4C42: + adds r0, r5, 0 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _082E4C54 + adds r0, r4, 0 + bl rfu_STC_removeLinkData +_082E4C54: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _082E4C42 + ldr r0, _082E4C70 + ldr r1, [r0] + movs r0, 0xFF + strb r0, [r1] + movs r0, 0x1 + b _082E4C7A + .align 2, 0 +_082E4C6C: .4byte 0x03007894 +_082E4C70: .4byte 0x03007890 +_082E4C74: + subs r0, 0x1 + strh r0, [r3, 0x20] +_082E4C78: + movs r0, 0 +_082E4C7A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end rfu_syncVBlank + + thumb_func_start rfu_REQBN_watchLink +rfu_REQBN_watchLink: @ 82E4C80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r8, r1 + str r2, [sp] + str r3, [sp, 0x4] + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0 + str r1, [sp, 0xC] + mov r2, r8 + strb r1, [r2] + mov r0, sp + ldrb r1, [r0, 0xC] + ldr r0, [sp] + strb r1, [r0] + mov r2, sp + ldrb r0, [r2, 0xC] + ldr r2, [sp, 0x4] + strb r0, [r2] + ldr r5, _082E4D20 + ldr r0, [r5] + ldrb r0, [r0] + cmp r0, 0xFF + bne _082E4CBE + b _082E504E +_082E4CBE: + ldr r0, _082E4D24 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _082E4CCA + b _082E504E +_082E4CCA: + ldr r3, _082E4D28 + ldr r2, [r3] + ldrb r1, [r2] + movs r4, 0x4 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _082E4CE0 + movs r0, 0xB4 + lsls r0, 1 + strh r0, [r2, 0x20] +_082E4CE0: + ldr r1, [r3] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _082E4CEE + strb r4, [r1, 0x6] + movs r1, 0x1 + str r1, [sp, 0x8] +_082E4CEE: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x29 + bne _082E4D30 + ldr r0, _082E4D2C + ldr r0, [r0] + adds r0, 0xDC + ldr r1, [r0] + ldrb r0, [r1, 0x4] + mov r2, r8 + strb r0, [r2] + ldrb r0, [r1, 0x5] + ldr r1, [sp] + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _082E4D18 + ldr r0, [r5] + ldrb r0, [r0, 0x2] + strb r0, [r2] +_082E4D18: + movs r2, 0x2 + str r2, [sp, 0x8] + b _082E4D88 + .align 2, 0 +_082E4D20: .4byte 0x03007890 +_082E4D24: .4byte 0x03007868 +_082E4D28: .4byte 0x03007894 +_082E4D2C: .4byte 0x03007898 +_082E4D30: + movs r0, 0x9B + lsls r0, 1 + cmp r6, r0 + bne _082E4D80 + ldr r0, _082E4DDC + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r6, [r0, 0x5] + ldr r0, [r5] + ldrb r0, [r0, 0x2] + eors r6, r0 + ands r6, r0 + mov r0, r8 + strb r6, [r0] + movs r0, 0x1 + ldr r1, [sp] + strb r0, [r1] + movs r5, 0 +_082E4D56: + mov r2, r8 + ldrb r0, [r2] + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _082E4D76 + ldr r0, _082E4DE0 + ldr r0, [r0] + adds r0, 0xA + adds r0, r5 + movs r1, 0 + strb r1, [r0] + adds r0, r5, 0 + bl rfu_STC_removeLinkData +_082E4D76: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _082E4D56 +_082E4D80: + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _082E4D88 + b _082E504E +_082E4D88: + ldr r4, _082E4DDC + ldr r0, [r4] + adds r0, 0xDC + ldr r0, [r0] + ldr r1, [r0] + str r1, [sp, 0x10] + ldr r0, [r0, 0x4] + str r0, [sp, 0x14] + ldr r0, _082E4DE4 + bl STWI_set_Callback_M + bl STWI_send_LinkStatusREQ + bl STWI_poll_CommandEnd + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + cmp r0, 0 + bne _082E4DE8 + ldr r0, [r4] + adds r0, 0xDC + ldr r0, [r0] + adds r2, r0, 0x4 + movs r5, 0 + ldr r3, _082E4DE0 +_082E4DBC: + ldr r0, [r3] + adds r0, 0xA + adds r0, r5 + ldrb r1, [r2] + strb r1, [r0] + adds r2, 0x1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _082E4DBC + movs r2, 0 + mov r9, r2 + movs r5, 0 + b _082E4DF4 + .align 2, 0 +_082E4DDC: .4byte 0x03007898 +_082E4DE0: .4byte 0x03007890 +_082E4DE4: .4byte rfu_CB_defaultCallback + 1 +_082E4DE8: + movs r0, 0x11 + ldr r1, [sp, 0xC] + bl rfu_STC_REQ_callback + ldr r0, [sp, 0xC] + b _082E5050 +_082E4DF4: + ldr r1, _082E4E7C + ldr r0, [r1] + adds r0, 0xE + adds r2, r0, r5 + ldrb r0, [r2] + adds r3, r1, 0 + cmp r0, 0 + beq _082E4E1A + subs r0, 0x4 + strb r0, [r2] + ldr r0, _082E4E80 + ldr r0, [r0] + adds r0, 0xA + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0xF + bhi _082E4E1A + movs r0, 0x10 + strb r0, [r1] +_082E4E1A: + movs r0, 0x80 + lsls r0, 17 + lsls r0, r5 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + mov r10, r0 + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _082E4E2E + b _082E5002 +_082E4E2E: + ldr r2, [sp, 0x8] + cmp r2, 0x1 + bne _082E4F10 + ldr r4, _082E4E80 + ldr r1, [r4] + ldrb r0, [r1, 0x2] + ands r0, r6 + cmp r0, 0 + beq _082E4F10 + adds r0, r1, 0 + adds r0, 0xA + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _082E4F04 + ldrb r0, [r1] + cmp r0, 0x1 + bne _082E4E84 + ldr r1, [r3] + adds r1, 0xA + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0xA + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x3 + bls _082E4F10 + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + orrs r0, r1 + mov r1, r8 + strb r0, [r1] + ldr r0, [sp] + strb r2, [r0] + b _082E4F10 + .align 2, 0 +_082E4E7C: .4byte 0x03007894 +_082E4E80: .4byte 0x03007890 +_082E4E84: + bl STWI_send_SystemStatusREQ + bl STWI_poll_CommandEnd + lsls r0, 16 + cmp r0, 0 + bne _082E4F10 + ldr r0, _082E4EB4 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _082E4EB8 + mov r2, r8 + ldrb r1, [r2] + adds r0, r6, 0 + orrs r0, r1 + strb r0, [r2] + mov r0, sp + ldrb r1, [r0, 0x8] + ldr r0, [sp] + b _082E4F0E + .align 2, 0 +_082E4EB4: .4byte 0x03007898 +_082E4EB8: + ldr r2, _082E4F00 + ldr r1, [r2] + adds r1, 0xA + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + ldr r2, [r2] + lsrs r0, 24 + ldrh r1, [r2, 0x1A] + cmp r0, r1 + bls _082E4F10 + adds r0, r2, 0 + adds r0, 0xA + adds r0, r5 + mov r2, sp + ldrb r2, [r2, 0xC] + strb r2, [r0] + ldr r0, [r4] + ldrb r0, [r0, 0x2] + bl STWI_send_DisconnectREQ + bl STWI_poll_CommandEnd + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + orrs r0, r1 + mov r1, r8 + strb r0, [r1] + mov r2, sp + ldrb r0, [r2, 0x8] + ldr r2, [sp] + strb r0, [r2] + b _082E4F10 + .align 2, 0 +_082E4F00: .4byte 0x03007894 +_082E4F04: + ldr r0, [r3] + adds r0, 0xA + adds r0, r5 + mov r1, sp + ldrb r1, [r1, 0xC] +_082E4F0E: + strb r1, [r0] +_082E4F10: + ldr r2, _082E4F70 + mov r12, r2 + ldr r1, [r2] + ldrb r7, [r1] + adds r0, r5, 0x1 + mov r10, r0 + cmp r7, 0x1 + bne _082E5002 + adds r0, r1, 0 + adds r0, 0xA + adds r4, r0, r5 + ldrb r3, [r4] + cmp r3, 0 + beq _082E5002 + ldrb r2, [r1, 0x3] + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + beq _082E4F7E + cmp r3, 0xA + bls _082E4F78 + ldr r2, [sp, 0x4] + ldrb r1, [r2] + adds r0, r6, 0 + orrs r0, r1 + strb r0, [r2] + mov r0, r12 + ldr r2, [r0] + ldrb r1, [r2, 0x2] + adds r0, r6, 0 + orrs r0, r1 + movs r3, 0 + strb r0, [r2, 0x2] + mov r2, r12 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + bics r0, r6 + strb r0, [r1, 0x3] + ldr r1, [r2] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, _082E4F74 + ldr r0, [r0] + adds r0, 0xA + adds r0, r5 + strb r3, [r0] + b _082E5002 + .align 2, 0 +_082E4F70: .4byte 0x03007890 +_082E4F74: .4byte 0x03007894 +_082E4F78: + movs r0, 0 + strb r0, [r4] + b _082E5002 +_082E4F7E: + ldrb r0, [r1, 0x2] + orrs r0, r2 + ands r0, r6 + cmp r0, 0 + bne _082E5002 + bl STWI_send_SlotStatusREQ + bl STWI_poll_CommandEnd + ldr r0, _082E4FC8 + ldr r0, [r0] + adds r0, 0xDC + ldr r2, [r0] + ldrb r0, [r2, 0x1] + subs r0, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, 0x8 + cmp r3, 0 + beq _082E5002 + ldrh r4, [r2] + ldrb r0, [r2, 0x2] + cmp r0, r5 + bne _082E4FD0 + ldr r0, _082E4FCC + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x12 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _082E4FD0 + lsls r7, r5 + mov r0, r9 + orrs r0, r7 + lsls r0, 24 + b _082E4FFE + .align 2, 0 +_082E4FC8: .4byte 0x03007898 +_082E4FCC: .4byte 0x03007894 +_082E4FD0: + adds r2, 0x4 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _082E5002 + ldrh r4, [r2] + ldrb r0, [r2, 0x2] + cmp r0, r5 + bne _082E4FD0 + ldr r0, _082E5060 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x12 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _082E4FD0 + movs r0, 0x1 + lsls r0, r5 + mov r1, r9 + orrs r1, r0 + lsls r0, r1, 24 +_082E4FFE: + lsrs r0, 24 + mov r9, r0 +_082E5002: + ldr r0, _082E5064 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + mov r2, r8 + ldrb r0, [r2] + ands r0, r1 + ands r6, r0 + cmp r6, 0 + beq _082E501C + adds r0, r5, 0 + movs r1, 0 + bl rfu_STC_removeLinkData +_082E501C: + mov r1, r10 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _082E5028 + b _082E4DF4 +_082E5028: + mov r2, r9 + cmp r2, 0 + beq _082E5038 + mov r0, r9 + bl STWI_send_DisconnectREQ + bl STWI_poll_CommandEnd +_082E5038: + ldr r1, _082E5068 + ldr r0, [r1] + adds r0, 0xDC + ldr r0, [r0] + ldr r2, [sp, 0x10] + str r2, [r0] + ldr r0, [r1] + adds r0, 0xDC + ldr r0, [r0] + ldr r1, [sp, 0x14] + str r1, [r0, 0x4] +_082E504E: + movs r0, 0 +_082E5050: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E5060: .4byte 0x03007894 +_082E5064: .4byte 0x03007890 +_082E5068: .4byte 0x03007898 + thumb_func_end rfu_REQBN_watchLink + + thumb_func_start rfu_STC_removeLinkData +rfu_STC_removeLinkData: @ 82E506C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + movs r0, 0x80 + lsls r0, 17 + lsls r0, r7 + lsrs r6, r0, 24 + ldr r0, _082E511C + ldr r0, [r0] + adds r0, 0xE + adds r0, r7 + movs r1, 0 + strb r1, [r0] + ldr r1, _082E5120 + ldr r4, [r1] + ldrb r0, [r4, 0x2] + ands r0, r6 + mov r8, r1 + cmp r0, 0 + beq _082E50AA + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _082E50AA + subs r0, 0x1 + strb r0, [r4, 0x1] +_082E50AA: + mov r3, r8 + ldr r2, [r3] + mvns r5, r6 + ldrb r1, [r2, 0x2] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x2] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + adds r0, r6, 0 + orrs r0, r1 + strb r0, [r2, 0x3] + ldr r3, [r3] + ldr r0, [r3] + ldr r1, _082E5124 + ands r0, r1 + cmp r0, 0 + bne _082E50D2 + movs r0, 0xFF + strb r0, [r3] +_082E50D2: + mov r0, r12 + cmp r0, 0 + beq _082E5110 + mov r1, sp + movs r4, 0 + movs r0, 0 + strh r0, [r1] + lsls r0, r7, 5 + adds r0, 0x14 + mov r2, r8 + ldr r1, [r2] + adds r1, r0 + ldr r2, _082E5128 + mov r0, sp + bl CpuSet + mov r0, r8 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x3] + mov r2, r8 + ldr r1, [r2] + ldrb r0, [r1, 0x7] + ands r5, r0 + strb r5, [r1, 0x7] + ldr r0, [r2] + adds r0, 0xA + adds r0, r7 + strb r4, [r0] +_082E5110: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E511C: .4byte 0x03007894 +_082E5120: .4byte 0x03007890 +_082E5124: .4byte 0x00ff00ff +_082E5128: .4byte 0x01000010 + thumb_func_end rfu_STC_removeLinkData + + thumb_func_start rfu_REQ_disconnect +rfu_REQ_disconnect: @ 82E512C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, _082E5170 + ldr r1, [r2] + ldrb r0, [r1, 0x2] + ldrb r1, [r1, 0x3] + orrs r0, r1 + ands r0, r4 + cmp r0, 0 + beq _082E51B0 + ldr r0, _082E5174 + ldr r1, [r0] + strb r4, [r1, 0x5] + ldr r2, [r2] + ldrb r1, [r2] + adds r3, r0, 0 + cmp r1, 0xFF + bne _082E5178 + ldr r0, [r3] + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _082E5178 + ldrb r0, [r2, 0x3] + ands r0, r4 + cmp r0, 0 + beq _082E51B0 + movs r0, 0x30 + movs r1, 0 + bl rfu_CB_disconnect + b _082E51B0 + .align 2, 0 +_082E5170: .4byte 0x03007890 +_082E5174: .4byte 0x03007894 +_082E5178: + ldr r0, [r3] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _082E51A4 + ldr r0, _082E51A0 + bl STWI_set_Callback_M + bl STWI_send_SC_EndREQ + bl STWI_poll_CommandEnd + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _082E51A4 + movs r0, 0x1B + bl rfu_STC_REQ_callback + b _082E51B0 + .align 2, 0 +_082E51A0: .4byte rfu_CB_defaultCallback + 1 +_082E51A4: + ldr r0, _082E51B8 + bl STWI_set_Callback_M + adds r0, r4, 0 + bl STWI_send_DisconnectREQ +_082E51B0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E51B8: .4byte rfu_CB_disconnect + 1 + thumb_func_end rfu_REQ_disconnect + + thumb_func_start rfu_CB_disconnect +rfu_CB_disconnect: @ 82E51BC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r5, 0x3 + bne _082E51F8 + ldr r0, _082E528C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + bne _082E51F8 + ldr r0, _082E5290 + bl STWI_set_Callback_M + bl STWI_send_SystemStatusREQ + bl STWI_poll_CommandEnd + lsls r0, 16 + cmp r0, 0 + bne _082E51F8 + ldr r0, _082E5294 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _082E51F8 + movs r5, 0 +_082E51F8: + ldr r3, _082E5298 + ldr r2, [r3] + ldr r0, _082E528C + ldr r1, [r0] + ldrb r0, [r1, 0x2] + ldrb r1, [r1, 0x3] + orrs r0, r1 + ldrb r1, [r2, 0x5] + ands r0, r1 + strb r0, [r2, 0x5] + ldr r0, _082E5294 + ldr r0, [r0] + adds r0, 0xDC + ldr r1, [r0] + ldr r0, [r3] + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x8] + cmp r5, 0 + bne _082E5246 + movs r4, 0 +_082E5220: + movs r0, 0x80 + lsls r0, 17 + lsls r0, r4 + lsrs r0, 24 + ldr r1, _082E5298 + ldr r1, [r1] + ldrb r1, [r1, 0x5] + ands r0, r1 + cmp r0, 0 + beq _082E523C + adds r0, r4, 0 + movs r1, 0x1 + bl rfu_STC_removeLinkData +_082E523C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _082E5220 +_082E5246: + ldr r0, _082E528C + ldr r2, [r0] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + orrs r0, r1 + cmp r0, 0 + bne _082E5258 + movs r0, 0xFF + strb r0, [r2] +_082E5258: + adds r0, r6, 0 + adds r1, r5, 0 + bl rfu_STC_REQ_callback + ldr r0, _082E5298 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _082E5286 + ldr r0, _082E5290 + bl STWI_set_Callback_M + bl STWI_send_SC_StartREQ + bl STWI_poll_CommandEnd + adds r5, r0, 0 + cmp r5, 0 + beq _082E5286 + movs r0, 0x19 + adds r1, r5, 0 + bl rfu_STC_REQ_callback +_082E5286: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E528C: .4byte 0x03007890 +_082E5290: .4byte rfu_CB_defaultCallback + 1 +_082E5294: .4byte 0x03007898 +_082E5298: .4byte 0x03007894 + thumb_func_end rfu_CB_disconnect + + thumb_func_start rfu_REQ_CHILD_startConnectRecovery +rfu_REQ_CHILD_startConnectRecovery: @ 82E529C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _082E52EC + ldr r0, [r0] + strb r5, [r0, 0x5] + movs r4, 0 + movs r0, 0x1 + ands r0, r5 + ldr r2, _082E52F0 + cmp r0, 0 + bne _082E52CA + movs r1, 0x1 +_082E52B6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bhi _082E52CA + adds r0, r5, 0 + asrs r0, r4 + ands r0, r1 + cmp r0, 0 + beq _082E52B6 +_082E52CA: + adds r0, r2, 0 + bl STWI_set_Callback_M + ldr r0, _082E52F4 + ldr r1, [r0] + lsls r0, r4, 5 + adds r0, r1, r0 + ldrh r0, [r0, 0x14] + adds r1, 0x94 + ldrh r1, [r1] + adds r2, r5, 0 + bl STWI_send_CPR_StartREQ + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E52EC: .4byte 0x03007894 +_082E52F0: .4byte rfu_STC_REQ_callback + 1 +_082E52F4: .4byte 0x03007890 + thumb_func_end rfu_REQ_CHILD_startConnectRecovery + + thumb_func_start rfu_REQ_CHILD_pollConnectRecovery +rfu_REQ_CHILD_pollConnectRecovery: @ 82E52F8 + push {lr} + ldr r0, _082E5308 + bl STWI_set_Callback_M + bl STWI_send_CPR_PollingREQ + pop {r0} + bx r0 + .align 2, 0 +_082E5308: .4byte rfu_CB_CHILD_pollConnectRecovery + 1 + thumb_func_end rfu_REQ_CHILD_pollConnectRecovery + + thumb_func_start rfu_CB_CHILD_pollConnectRecovery +rfu_CB_CHILD_pollConnectRecovery: @ 82E530C + 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 + cmp r7, 0 + bne _082E5390 + ldr r0, _082E53A4 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _082E5390 + ldr r0, _082E53A8 + ldr r1, [r0] + ldrb r1, [r1, 0x5] + adds r6, r0, 0 + cmp r1, 0 + beq _082E5390 + ldr r1, _082E53AC + ldr r0, [r1] + strb r7, [r0] + movs r4, 0 + adds r5, r1, 0 + mov r12, r4 +_082E5346: + movs r0, 0x80 + lsls r0, 17 + lsls r0, r4 + lsrs r3, r0, 24 + ldr r2, [r5] + ldr r0, [r6] + ldrb r0, [r0, 0x5] + ands r0, r3 + ldrb r1, [r2, 0x3] + ands r0, r1 + cmp r0, 0 + beq _082E5380 + ldrb r1, [r2, 0x2] + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r5] + ldrb r0, [r1, 0x3] + bics r0, r3 + strb r0, [r1, 0x3] + ldr r1, [r5] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, [r6] + adds r0, 0xA + adds r0, r4 + mov r1, r12 + strb r1, [r0] +_082E5380: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _082E5346 + ldr r1, [r6] + movs r0, 0 + strb r0, [r1, 0x5] +_082E5390: + mov r0, r8 + adds r1, r7, 0 + bl rfu_STC_REQ_callback + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E53A4: .4byte 0x03007898 +_082E53A8: .4byte 0x03007894 +_082E53AC: .4byte 0x03007890 + thumb_func_end rfu_CB_CHILD_pollConnectRecovery + + thumb_func_start rfu_CHILD_getConnectRecoveryStatus +rfu_CHILD_getConnectRecoveryStatus: @ 82E53B0 + push {lr} + adds r2, r0, 0 + movs r0, 0xFF + strb r0, [r2] + ldr r0, _082E53D0 + ldr r0, [r0] + adds r0, 0xDC + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x4D + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _082E53D4 + movs r0, 0x10 + b _082E53DA + .align 2, 0 +_082E53D0: .4byte 0x03007898 +_082E53D4: + ldrb r0, [r1, 0x4] + strb r0, [r2] + movs r0, 0 +_082E53DA: + pop {r1} + bx r1 + thumb_func_end rfu_CHILD_getConnectRecoveryStatus + + thumb_func_start rfu_REQ_CHILD_endConnectRecovery +rfu_REQ_CHILD_endConnectRecovery: @ 82E53E0 + push {lr} + ldr r0, _082E53F0 + bl STWI_set_Callback_M + bl STWI_send_CPR_EndREQ + pop {r0} + bx r0 + .align 2, 0 +_082E53F0: .4byte rfu_CB_CHILD_pollConnectRecovery + 1 + thumb_func_end rfu_REQ_CHILD_endConnectRecovery + + thumb_func_start sub_82E53F4 +sub_82E53F4: @ 82E53F4 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r3, [r5] + ldr r1, [r6] + subs r2, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _082E5418 + adds r4, r0, 0 + thumb_func_end sub_82E53F4 + + non_word_aligned_thumb_func_start sub_82E540A +sub_82E540A: @ 82E540A + ldrb r0, [r3] + strb r0, [r1] + adds r3, 0x1 + adds r1, 0x1 + subs r2, 0x1 + cmp r2, r4 + bne sub_82E540A +_082E5418: + str r3, [r5] + str r1, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_82E540A + + thumb_func_start rfu_REQ_changeMasterSlave +rfu_REQ_changeMasterSlave: @ 82E5424 + push {lr} + movs r0, 0x1 + bl STWI_read_status + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _082E5444 + ldr r0, _082E5440 + bl STWI_set_Callback_M + bl STWI_send_MS_ChangeREQ + b _082E544C + .align 2, 0 +_082E5440: .4byte rfu_STC_REQ_callback + 1 +_082E5444: + movs r0, 0x27 + movs r1, 0 + bl rfu_STC_REQ_callback +_082E544C: + pop {r0} + bx r0 + thumb_func_end rfu_REQ_changeMasterSlave + + thumb_func_start rfu_getMasterSlave +rfu_getMasterSlave: @ 82E5450 + push {lr} + movs r0, 0x1 + bl STWI_read_status + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bne _082E547E + ldr r0, _082E5484 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _082E547E + ldrb r0, [r1, 0x6] + cmp r0, 0x27 + beq _082E547C + cmp r0, 0x25 + beq _082E547C + cmp r0, 0x37 + bne _082E547E +_082E547C: + movs r2, 0 +_082E547E: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_082E5484: .4byte 0x03007868 + thumb_func_end rfu_getMasterSlave + + thumb_func_start rfu_clearAllSlot +rfu_clearAllSlot: @ 82E5488 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r1, _082E550C + ldrh r0, [r1] + mov r8, r0 + movs r0, 0 + strh r0, [r1] + movs r5, 0 + mov r0, sp + adds r0, 0x2 + movs r7, 0 + adds r6, r0, 0 +_082E54A4: + mov r0, sp + strh r7, [r0] + ldr r0, _082E5510 + lsls r4, r5, 2 + adds r0, r4, r0 + ldr r1, [r0] + mov r0, sp + ldr r2, _082E5514 + bl CpuSet + strh r7, [r6] + ldr r0, _082E5518 + adds r4, r0 + ldr r1, [r4] + adds r0, r6, 0 + ldr r2, _082E551C + bl CpuSet + ldr r3, _082E5520 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r5 + movs r1, 0x10 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _082E54A4 + ldr r2, [r3] + movs r1, 0 + movs r0, 0x57 + strb r0, [r2, 0xF] + ldr r0, [r3] + strb r1, [r0, 0x4] + ldr r0, [r3] + strb r1, [r0, 0x5] + ldr r0, [r3] + strb r1, [r0, 0x6] + ldr r0, _082E5524 + ldr r0, [r0] + strb r1, [r0, 0x2] + ldr r0, _082E550C + mov r1, r8 + strh r1, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E550C: .4byte 0x04000208 +_082E5510: .4byte 0x03007880 +_082E5514: .4byte 0x01000034 +_082E5518: .4byte 0x03007870 +_082E551C: .4byte 0x0100000a +_082E5520: .4byte 0x03007890 +_082E5524: .4byte 0x03007894 + thumb_func_end rfu_clearAllSlot + + thumb_func_start rfu_STC_releaseFrame +rfu_STC_releaseFrame: @ 82E5528 + push {r4-r6,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r0, _082E5560 + ldr r0, [r0] + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _082E5568 + ldr r6, _082E5564 + cmp r3, 0 + bne _082E5554 + ldr r1, [r6] + ldrb r0, [r1, 0xF] + ldrh r4, [r4, 0x2E] + adds r0, r4 + strb r0, [r1, 0xF] +_082E5554: + ldr r1, [r6] + ldrb r0, [r1, 0xF] + adds r0, 0x3 + strb r0, [r1, 0xF] + b _082E5588 + .align 2, 0 +_082E5560: .4byte 0x03007894 +_082E5564: .4byte 0x03007890 +_082E5568: + ldr r6, _082E5590 + cmp r3, 0 + bne _082E557C + ldr r1, [r6] + adds r1, 0x10 + adds r1, r2 + ldrb r0, [r1] + ldrh r4, [r4, 0x2E] + adds r0, r4 + strb r0, [r1] +_082E557C: + ldr r1, [r6] + adds r1, 0x10 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x2 + strb r0, [r1] +_082E5588: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E5590: .4byte 0x03007890 + thumb_func_end rfu_STC_releaseFrame + + thumb_func_start rfu_clearSlot +rfu_clearSlot: @ 82E5594 + 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 r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r7, 0x3 + bls _082E55B4 + movs r0, 0x80 + lsls r0, 3 + b _082E572C +_082E55B4: + movs r0, 0xF + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _082E55C4 + movs r0, 0xC0 + lsls r0, 3 + b _082E572C +_082E55C4: + ldr r1, _082E5608 + ldrh r0, [r1] + mov r10, r0 + movs r0, 0 + strh r0, [r1] + movs r0, 0xC + mov r2, r8 + ands r0, r2 + cmp r0, 0 + beq _082E568C + movs r3, 0 + ldr r1, _082E560C + lsls r0, r7, 2 + adds r0, r1 + mov r9, r0 +_082E55E2: + movs r4, 0 + cmp r3, 0 + bne _082E5614 + movs r0, 0x4 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _082E5634 + mov r2, r9 + ldr r4, [r2] + ldr r0, _082E5610 + ldr r2, [r0] + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + ldrb r0, [r2, 0x4] + bics r0, r1 + strb r0, [r2, 0x4] + b _082E5634 + .align 2, 0 +_082E5608: .4byte 0x04000208 +_082E560C: .4byte 0x03007880 +_082E5610: .4byte 0x03007890 +_082E5614: + movs r0, 0x8 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _082E5634 + mov r2, r9 + ldr r0, [r2] + adds r4, r0, 0 + adds r4, 0x34 + ldr r0, _082E56C8 + ldr r2, [r0] + movs r1, 0x1 + lsls r1, r7 + ldrb r0, [r2, 0x5] + bics r0, r1 + strb r0, [r2, 0x5] +_082E5634: + adds r6, r3, 0x1 + cmp r4, 0 + beq _082E5684 + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _082E5674 + lsls r1, r3, 24 + lsrs r1, 24 + adds r0, r7, 0 + adds r2, r4, 0 + bl rfu_STC_releaseFrame + movs r1, 0 + adds r2, r4, 0 + adds r2, 0x2C + movs r5, 0x1 + movs r3, 0 +_082E565E: + ldrb r0, [r2] + asrs r0, r1 + ands r0, r5 + cmp r0, 0 + beq _082E566A + strh r3, [r4, 0x2] +_082E566A: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3 + bls _082E565E +_082E5674: + mov r1, sp + movs r0, 0 + strh r0, [r1] + mov r0, sp + adds r1, r4, 0 + ldr r2, _082E56CC + bl CpuSet +_082E5684: + lsls r0, r6, 16 + lsrs r3, r0, 16 + cmp r3, 0x1 + bls _082E55E2 +_082E568C: + movs r0, 0x1 + mov r4, r8 + ands r0, r4 + cmp r0, 0 + beq _082E5702 + ldr r1, _082E56D0 + lsls r0, r7, 2 + adds r0, r1 + ldr r3, [r0] + ldrh r1, [r3] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _082E56F4 + ldr r0, _082E56D4 + ldr r0, [r0] + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _082E56D8 + ldr r2, _082E56C8 + ldr r1, [r2] + ldrb r0, [r1, 0xF] + adds r0, 0x3 + ldrb r4, [r3, 0x4] + adds r0, r4 + strb r0, [r1, 0xF] + b _082E56EA + .align 2, 0 +_082E56C8: .4byte 0x03007890 +_082E56CC: .4byte 0x0100001a +_082E56D0: .4byte 0x03007870 +_082E56D4: .4byte 0x03007894 +_082E56D8: + ldr r2, _082E573C + ldr r1, [r2] + adds r1, 0x10 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x2 + ldrb r4, [r3, 0x4] + adds r0, r4 + strb r0, [r1] +_082E56EA: + ldr r2, [r2] + ldrb r1, [r3, 0x3] + ldrb r0, [r2, 0x6] + bics r0, r1 + strb r0, [r2, 0x6] +_082E56F4: + mov r0, sp + movs r1, 0 + strh r1, [r0] + ldr r2, _082E5740 + adds r1, r3, 0 + bl CpuSet +_082E5702: + movs r0, 0x2 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _082E5724 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, _082E5744 + lsls r0, r7, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0xC + ldr r2, _082E5748 + mov r0, sp + bl CpuSet +_082E5724: + ldr r0, _082E574C + mov r2, r10 + strh r2, [r0] + movs r0, 0 +_082E572C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E573C: .4byte 0x03007890 +_082E5740: .4byte 0x01000006 +_082E5744: .4byte 0x03007870 +_082E5748: .4byte 0x01000004 +_082E574C: .4byte 0x04000208 + thumb_func_end rfu_clearSlot + + thumb_func_start rfu_setRecvBuffer +rfu_setRecvBuffer: @ 82E5750 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, r3, 0 + lsls r1, 24 + lsrs r1, 24 + adds r4, r1, 0 + cmp r1, 0x3 + bls _082E576C + movs r0, 0x80 + lsls r0, 3 + b _082E57A4 +_082E576C: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _082E5788 + ldr r0, _082E5784 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + str r5, [r0, 0x68] + str r6, [r0, 0x6C] + b _082E57A2 + .align 2, 0 +_082E5784: .4byte 0x03007880 +_082E5788: + movs r0, 0x10 + ands r2, r0 + cmp r2, 0 + bne _082E5796 + movs r0, 0xC0 + lsls r0, 3 + b _082E57A4 +_082E5796: + ldr r0, _082E57AC + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + str r5, [r0, 0x14] + str r6, [r0, 0x18] +_082E57A2: + movs r0, 0 +_082E57A4: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_082E57AC: .4byte 0x03007870 + thumb_func_end rfu_setRecvBuffer + + thumb_func_start rfu_NI_setSendData +rfu_NI_setSendData: @ 82E57B0 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r3, [sp] + movs r0, 0x20 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl rfu_STC_setSendData_org + lsls r0, 16 + lsrs r0, 16 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end rfu_NI_setSendData + + thumb_func_start rfu_UNI_setSendData +rfu_UNI_setSendData: @ 82E57DC + push {lr} + sub sp, 0x4 + adds r3, r1, 0 + lsls r0, 24 + lsrs r1, r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _082E57F8 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _082E57FC + adds r0, r2, 0x3 + b _082E57FE + .align 2, 0 +_082E57F8: .4byte 0x03007890 +_082E57FC: + adds r0, r2, 0x2 +_082E57FE: + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + bl rfu_STC_setSendData_org + lsls r0, 16 + lsrs r0, 16 + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end rfu_UNI_setSendData + + thumb_func_start rfu_NI_CHILD_setSendGameName +rfu_NI_CHILD_setSendGameName: @ 82E5818 + push {lr} + sub sp, 0x4 + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0x80 + lsls r1, 17 + lsls r1, r0 + lsrs r1, 24 + ldr r0, _082E5848 + ldr r3, [r0] + adds r3, 0x98 + movs r0, 0x1A + str r0, [sp] + movs r0, 0x40 + bl rfu_STC_setSendData_org + lsls r0, 16 + lsrs r0, 16 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_082E5848: .4byte 0x03007890 + thumb_func_end rfu_NI_CHILD_setSendGameName + + thumb_func_start rfu_STC_setSendData_org +rfu_STC_setSendData_org: @ 82E584C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r3, [sp] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r0, _082E5878 + ldr r2, [r0] + ldrb r1, [r2] + mov r10, r0 + cmp r1, 0xFF + bne _082E5880 + ldr r0, _082E587C + b _082E5A36 + .align 2, 0 +_082E5878: .4byte 0x03007890 +_082E587C: .4byte 0x00000301 +_082E5880: + movs r0, 0xF + ands r0, r3 + cmp r0, 0 + bne _082E588E + movs r0, 0x80 + lsls r0, 3 + b _082E5A36 +_082E588E: + ldrb r0, [r2, 0x2] + ldrb r1, [r2, 0x3] + orrs r0, r1 + ands r0, r3 + cmp r0, r3 + beq _082E58A4 + ldr r0, _082E58A0 + b _082E5A36 + .align 2, 0 +_082E58A0: .4byte 0x00000401 +_082E58A4: + movs r0, 0x10 + ands r0, r6 + cmp r0, 0 + beq _082E58B0 + ldrb r0, [r2, 0x6] + b _082E58B2 +_082E58B0: + ldrb r0, [r2, 0x4] +_082E58B2: + ands r0, r3 + cmp r0, 0 + beq _082E58C0 + ldr r0, _082E58BC + b _082E5A36 + .align 2, 0 +_082E58BC: .4byte 0x00000402 +_082E58C0: + movs r2, 0 + movs r0, 0x1 + ands r0, r3 + ldr r4, _082E58F0 + cmp r0, 0 + bne _082E58E2 + movs r1, 0x1 +_082E58CE: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bhi _082E58E2 + adds r0, r3, 0 + asrs r0, r2 + ands r0, r1 + cmp r0, 0 + beq _082E58CE +_082E58E2: + mov r0, r10 + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0x1 + bne _082E58F4 + adds r1, 0xF + b _082E58FE + .align 2, 0 +_082E58F0: .4byte 0x089a3220 +_082E58F4: + cmp r0, 0 + bne _082E5900 + adds r0, r2, 0 + adds r0, 0x10 + adds r1, r0 +_082E58FE: + mov r9, r1 +_082E5900: + mov r1, r10 + ldr r0, [r1] + ldrb r0, [r0] + lsls r0, 4 + adds r0, r4 + ldrb r4, [r0] + mov r0, r9 + ldrb r0, [r0] + cmp r8, r0 + bhi _082E5918 + cmp r8, r4 + bhi _082E591E +_082E5918: + movs r0, 0xA0 + lsls r0, 3 + b _082E5A36 +_082E591E: + ldr r1, _082E596C + ldrh r0, [r1] + str r0, [sp, 0x4] + movs r7, 0 + strh r7, [r1] + movs r0, 0x20 + ands r0, r6 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _082E5938 + cmp r6, 0x40 + bne _082E59F4 +_082E5938: + ldr r1, _082E5970 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + mov r12, r0 + movs r1, 0 + strh r1, [r0, 0x18] + mov r1, r12 + adds r1, 0x2D + mov r2, r12 + str r1, [r2, 0x4] + movs r0, 0x7 + str r0, [r2, 0x14] + mov r0, r12 + adds r0, 0x2C + strb r3, [r0] + strb r3, [r2, 0x1A] + mov r2, r8 + subs r0, r2, r4 + mov r2, r12 + strh r0, [r2, 0x2E] + cmp r5, 0 + beq _082E5974 + strb r7, [r1] + b _082E5978 + .align 2, 0 +_082E596C: .4byte 0x04000208 +_082E5970: .4byte 0x03007880 +_082E5974: + movs r0, 0x1 + strb r0, [r1] +_082E5978: + ldr r0, [sp, 0x28] + mov r1, r12 + str r0, [r1, 0x30] + ldr r2, [sp] + str r2, [r1, 0x28] + movs r1, 0 + mov r0, r12 + strb r1, [r0, 0x1F] + adds r0, 0x20 + strb r1, [r0] + mov r4, r12 + adds r4, 0x1B + movs r6, 0 + mov r2, r12 + adds r2, 0x21 + movs r5, 0x1 +_082E5998: + adds r0, r4, r1 + strb r6, [r0] + adds r0, r2, r1 + strb r5, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _082E5998 + movs r2, 0 + movs r5, 0x1 + ldr r4, _082E59EC + movs r1, 0 +_082E59B2: + adds r0, r3, 0 + asrs r0, r2 + ands r0, r5 + cmp r0, 0 + beq _082E59C4 + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + strh r1, [r0, 0x2] +_082E59C4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _082E59B2 + mov r1, r10 + ldr r2, [r1] + ldrb r1, [r2, 0x4] + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2, 0x4] + mov r2, r9 + ldrb r0, [r2] + mov r1, r8 + subs r0, r1 + strb r0, [r2] + ldr r0, _082E59F0 + mov r2, r12 + strh r0, [r2] + b _082E5A2C + .align 2, 0 +_082E59EC: .4byte 0x03007880 +_082E59F0: .4byte 0x00008021 +_082E59F4: + movs r0, 0x10 + ands r0, r6 + cmp r0, 0 + beq _082E5A2C + ldr r1, _082E5A48 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + strb r3, [r1, 0x3] + ldr r0, [sp] + str r0, [r1, 0x8] + mov r2, r8 + subs r0, r2, r4 + strh r0, [r1, 0x4] + mov r2, r9 + ldrb r0, [r2] + mov r2, r8 + subs r0, r2 + mov r2, r9 + strb r0, [r2] + ldr r0, _082E5A4C + strh r0, [r1] + mov r0, r10 + ldr r2, [r0] + ldrb r1, [r2, 0x6] + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2, 0x6] +_082E5A2C: + ldr r0, _082E5A50 + mov r1, sp + ldrh r1, [r1, 0x4] + strh r1, [r0] + movs r0, 0 +_082E5A36: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E5A48: .4byte 0x03007870 +_082E5A4C: .4byte 0x00008024 +_082E5A50: .4byte 0x04000208 + thumb_func_end rfu_STC_setSendData_org + + thumb_func_start rfu_changeSendTarget +rfu_changeSendTarget: @ 82E5A54 + 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 + adds r3, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r7, 0x3 + bls _082E5A78 + movs r0, 0x80 + lsls r0, 3 + b _082E5BAC +_082E5A78: + cmp r0, 0x20 + bne _082E5B18 + ldr r0, _082E5B08 + mov r12, r0 + lsls r0, r7, 2 + add r0, r12 + ldr r5, [r0] + ldrh r2, [r5] + ldr r1, _082E5B0C + adds r0, r1, 0 + ands r0, r2 + cmp r0, r1 + bne _082E5B2E + ldrb r0, [r5, 0x1A] + adds r3, r6, 0 + eors r3, r0 + adds r2, r3, 0 + ands r2, r6 + cmp r2, 0 + bne _082E5B66 + cmp r3, 0 + bne _082E5AA6 + b _082E5BAA +_082E5AA6: + ldr r1, _082E5B10 + ldrh r0, [r1] + mov r8, r0 + strh r2, [r1] + movs r2, 0 + mvns r1, r3 + str r1, [sp] + lsls r4, r6, 24 + mov r10, r4 + movs r0, 0x1 + mov r9, r0 + movs r1, 0 +_082E5ABE: + adds r0, r3, 0 + asrs r0, r2 + mov r4, r9 + ands r0, r4 + cmp r0, 0 + beq _082E5AD2 + lsls r0, r2, 2 + add r0, r12 + ldr r0, [r0] + strh r1, [r0, 0x2] +_082E5AD2: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _082E5ABE + ldr r0, _082E5B14 + ldr r1, [r0] + ldrb r0, [r1, 0x4] + ldr r2, [sp] + ands r2, r0 + strb r2, [r1, 0x4] + strb r6, [r5, 0x1A] + mov r0, r10 + cmp r0, 0 + bne _082E5AFE + adds r0, r7, 0 + movs r1, 0 + adds r2, r5, 0 + bl rfu_STC_releaseFrame + movs r0, 0x27 + strh r0, [r5] +_082E5AFE: + ldr r0, _082E5B10 + mov r1, r8 + strh r1, [r0] + b _082E5BAA + .align 2, 0 +_082E5B08: .4byte 0x03007880 +_082E5B0C: .4byte 0x00008020 +_082E5B10: .4byte 0x04000208 +_082E5B14: .4byte 0x03007890 +_082E5B18: + cmp r3, 0x10 + bne _082E5BA4 + ldr r3, _082E5B34 + lsls r1, r7, 2 + adds r0, r1, r3 + ldr r0, [r0] + ldrh r2, [r0] + ldr r0, _082E5B38 + adds r5, r3, 0 + cmp r2, r0 + beq _082E5B40 +_082E5B2E: + ldr r0, _082E5B3C + b _082E5BAC + .align 2, 0 +_082E5B34: .4byte 0x03007870 +_082E5B38: .4byte 0x00008024 +_082E5B3C: .4byte 0x00000403 +_082E5B40: + movs r3, 0 + movs r2, 0 + adds r4, r5, 0 +_082E5B46: + cmp r2, r7 + beq _082E5B54 + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + orrs r3, r0 +_082E5B54: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _082E5B46 + adds r2, r6, 0 + ands r2, r3 + cmp r2, 0 + beq _082E5B70 +_082E5B66: + ldr r0, _082E5B6C + b _082E5BAC + .align 2, 0 +_082E5B6C: .4byte 0x00000404 +_082E5B70: + ldr r3, _082E5B9C + ldrh r0, [r3] + mov r8, r0 + strh r2, [r3] + ldr r4, _082E5BA0 + ldr r2, [r4] + adds r5, r1, r5 + ldr r0, [r5] + ldrb r1, [r0, 0x3] + ldrb r0, [r2, 0x6] + bics r0, r1 + strb r0, [r2, 0x6] + ldr r2, [r4] + ldrb r1, [r2, 0x6] + adds r0, r6, 0 + orrs r0, r1 + strb r0, [r2, 0x6] + ldr r0, [r5] + strb r6, [r0, 0x3] + mov r2, r8 + strh r2, [r3] + b _082E5BAA + .align 2, 0 +_082E5B9C: .4byte 0x04000208 +_082E5BA0: .4byte 0x03007890 +_082E5BA4: + movs r0, 0xC0 + lsls r0, 3 + b _082E5BAC +_082E5BAA: + movs r0, 0 +_082E5BAC: + 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 rfu_changeSendTarget + + thumb_func_start rfu_NI_stopReceivingData +rfu_NI_stopReceivingData: @ 82E5BBC + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _082E5BCC + movs r0, 0x80 + lsls r0, 3 + b _082E5C26 +_082E5BCC: + ldr r1, _082E5BF8 + lsls r0, r3, 2 + adds r0, r1 + ldr r2, [r0] + adds r5, r2, 0 + adds r5, 0x34 + ldr r1, _082E5BFC + ldrh r0, [r1] + adds r4, r0, 0 + movs r0, 0 + strh r0, [r1] + ldrh r1, [r2, 0x34] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _082E5C20 + ldr r0, _082E5C00 + cmp r1, r0 + bne _082E5C04 + movs r0, 0x48 + b _082E5C06 + .align 2, 0 +_082E5BF8: .4byte 0x03007880 +_082E5BFC: .4byte 0x04000208 +_082E5C00: .4byte 0x00008043 +_082E5C04: + movs r0, 0x47 +_082E5C06: + strh r0, [r2, 0x34] + ldr r0, _082E5C2C + ldr r2, [r0] + movs r1, 0x1 + lsls r1, r3 + ldrb r0, [r2, 0x5] + bics r0, r1 + strb r0, [r2, 0x5] + adds r0, r3, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl rfu_STC_releaseFrame +_082E5C20: + ldr r0, _082E5C30 + strh r4, [r0] + movs r0, 0 +_082E5C26: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_082E5C2C: .4byte 0x03007890 +_082E5C30: .4byte 0x04000208 + thumb_func_end rfu_NI_stopReceivingData + + thumb_func_start rfu_UNI_changeAndReadySendData +rfu_UNI_changeAndReadySendData: @ 82E5C34 + push {r4-r7,lr} + adds r7, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r2, 24 + lsrs r5, r2, 24 + cmp r0, 0x3 + bls _082E5C4C + movs r0, 0x80 + lsls r0, 3 + b _082E5CC0 +_082E5C4C: + ldr r1, _082E5C60 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + ldrh r1, [r4] + ldr r0, _082E5C64 + cmp r1, r0 + beq _082E5C6C + ldr r0, _082E5C68 + b _082E5CC0 + .align 2, 0 +_082E5C60: .4byte 0x03007870 +_082E5C64: .4byte 0x00008024 +_082E5C68: .4byte 0x00000403 +_082E5C6C: + ldr r0, _082E5C80 + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0x1 + bne _082E5C84 + adds r6, r1, 0 + adds r6, 0xF + ldrb r0, [r4, 0x4] + ldrb r1, [r1, 0xF] + b _082E5C92 + .align 2, 0 +_082E5C80: .4byte 0x03007890 +_082E5C84: + adds r0, r3, 0 + adds r0, 0x10 + adds r6, r1, r0 + adds r1, 0x10 + adds r1, r3 + ldrb r0, [r4, 0x4] + ldrb r1, [r1] +_082E5C92: + adds r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _082E5CBC + ldr r2, _082E5CB8 + ldrh r1, [r2] + movs r0, 0 + strh r0, [r2] + str r7, [r4, 0x8] + subs r0, r3, r5 + strb r0, [r6] + strh r5, [r4, 0x4] + movs r0, 0x1 + strb r0, [r4, 0x2] + strh r1, [r2] + movs r0, 0 + b _082E5CC0 + .align 2, 0 +_082E5CB8: .4byte 0x04000208 +_082E5CBC: + movs r0, 0xA0 + lsls r0, 3 +_082E5CC0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end rfu_UNI_changeAndReadySendData + + thumb_func_start rfu_UNI_readySendData +rfu_UNI_readySendData: @ 82E5CC8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _082E5CE6 + ldr r1, _082E5CEC + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + ldrh r1, [r2] + ldr r0, _082E5CF0 + cmp r1, r0 + bne _082E5CE6 + movs r0, 0x1 + strb r0, [r2, 0x2] +_082E5CE6: + pop {r0} + bx r0 + .align 2, 0 +_082E5CEC: .4byte 0x03007870 +_082E5CF0: .4byte 0x00008024 + thumb_func_end rfu_UNI_readySendData + + thumb_func_start rfu_UNI_clearRecvNewDataFlag +rfu_UNI_clearRecvNewDataFlag: @ 82E5CF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _082E5D0A + ldr r1, _082E5D10 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x12] +_082E5D0A: + pop {r0} + bx r0 + .align 2, 0 +_082E5D10: .4byte 0x03007870 + thumb_func_end rfu_UNI_clearRecvNewDataFlag + + thumb_func_start rfu_REQ_sendData +rfu_REQ_sendData: @ 82E5D14 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _082E5D60 + ldr r2, [r0] + ldrb r1, [r2] + adds r4, r0, 0 + cmp r1, 0xFF + bne _082E5D28 + b _082E5E4E +_082E5D28: + cmp r1, 0x1 + bne _082E5DB8 + ldrb r0, [r2, 0x4] + ldrb r1, [r2, 0x5] + adds r3, r0, 0 + orrs r3, r1 + ldrb r0, [r2, 0x6] + orrs r3, r0 + cmp r3, 0 + bne _082E5DB8 + ldr r0, _082E5D64 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + adds r4, r0, 0 + cmp r1, 0 + beq _082E5D50 + movs r0, 0x10 + strb r0, [r2, 0x8] + ldr r0, [r4] + strb r3, [r0, 0x7] +_082E5D50: + ldr r1, [r4] + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _082E5D68 + subs r0, 0x1 + strb r0, [r1, 0x8] + b _082E5D6E + .align 2, 0 +_082E5D60: .4byte 0x03007890 +_082E5D64: .4byte 0x03007894 +_082E5D68: + ldrb r0, [r1, 0x7] + adds r0, 0x1 + strb r0, [r1, 0x7] +_082E5D6E: + ldr r1, [r4] + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _082E5D80 + ldrb r1, [r1, 0x7] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _082E5E12 +_082E5D80: + ldr r4, _082E5DA4 + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0x68] + movs r0, 0xFF + str r0, [r1, 0x78] + ldr r0, _082E5DA8 + bl STWI_set_Callback_M + cmp r5, 0 + bne _082E5DAC + ldr r0, [r4] + adds r0, 0x68 + movs r1, 0x1 + bl STWI_send_DataTxREQ + b _082E5E4E + .align 2, 0 +_082E5DA4: .4byte 0x03007898 +_082E5DA8: .4byte sub_82E5F00 + 1 +_082E5DAC: + ldr r0, [r4] + adds r0, 0x68 + movs r1, 0x1 + bl STWI_send_DataTxAndChangeREQ + b _082E5E4E +_082E5DB8: + ldr r0, [r4] + ldrb r0, [r0, 0xE] + cmp r0, 0 + bne _082E5DC4 + bl rfu_constructSendLLFrame +_082E5DC4: + ldr r0, [r4] + ldrb r0, [r0, 0xE] + cmp r0, 0 + beq _082E5E12 + ldr r0, _082E5DF0 + bl STWI_set_Callback_M + cmp r5, 0 + beq _082E5DFC + ldr r0, _082E5DF4 + ldr r0, [r0] + adds r0, 0x68 + ldr r1, _082E5DF8 + ldr r1, [r1] + ldr r1, [r1, 0x24] + adds r1, 0x4 + lsls r1, 24 + lsrs r1, 24 + bl STWI_send_DataTxAndChangeREQ + b _082E5E4E + .align 2, 0 +_082E5DF0: .4byte rfu_CB_sendData + 1 +_082E5DF4: .4byte 0x03007898 +_082E5DF8: .4byte 0x03007894 +_082E5DFC: + ldr r0, _082E5E34 + ldr r0, [r0] + adds r0, 0x68 + ldr r1, _082E5E38 + ldr r1, [r1] + ldr r1, [r1, 0x24] + adds r1, 0x4 + lsls r1, 24 + lsrs r1, 24 + bl STWI_send_DataTxREQ +_082E5E12: + cmp r5, 0 + beq _082E5E4E + ldr r0, _082E5E3C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _082E5E44 + ldr r0, _082E5E40 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + cmp r1, 0 + beq _082E5E4E + movs r0, 0x27 + bl _call_via_r1 + b _082E5E4E + .align 2, 0 +_082E5E34: .4byte 0x03007898 +_082E5E38: .4byte 0x03007894 +_082E5E3C: .4byte 0x03007890 +_082E5E40: .4byte 0x03007868 +_082E5E44: + ldr r0, _082E5E54 + bl STWI_set_Callback_M + bl STWI_send_MS_ChangeREQ +_082E5E4E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E5E54: .4byte rfu_CB_sendData2 + 1 + thumb_func_end rfu_REQ_sendData + + thumb_func_start rfu_CB_sendData +rfu_CB_sendData: @ 82E5E58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 16 + lsrs r7, r1, 16 + cmp r7, 0 + bne _082E5EC2 + movs r6, 0 + ldr r0, _082E5EE0 + mov r8, r0 +_082E5E6C: + ldr r0, _082E5EE4 + lsls r2, r6, 2 + adds r0, r2, r0 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _082E5E7E + movs r0, 0 + strb r0, [r1, 0x2] +_082E5E7E: + ldr r0, _082E5EE8 + adds r0, r2, r0 + ldr r4, [r0] + ldrh r0, [r4] + cmp r0, r8 + bne _082E5EB8 + adds r0, r6, 0 + movs r1, 0 + adds r2, r4, 0 + bl rfu_STC_releaseFrame + ldr r5, _082E5EEC + ldr r2, [r5] + ldrb r1, [r4, 0x1A] + ldrb r0, [r2, 0x4] + bics r0, r1 + strb r0, [r2, 0x4] + adds r0, r4, 0 + adds r0, 0x2D + ldrb r3, [r0] + cmp r3, 0x1 + bne _082E5EB4 + ldr r1, [r5] + lsls r3, r6 + ldrb r0, [r1, 0x7] + orrs r3, r0 + strb r3, [r1, 0x7] +_082E5EB4: + movs r0, 0x26 + strh r0, [r4] +_082E5EB8: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _082E5E6C +_082E5EC2: + ldr r0, _082E5EEC + ldr r1, [r0] + ldrb r0, [r1, 0xE] + movs r0, 0 + strb r0, [r1, 0xE] + movs r0, 0x24 + adds r1, r7, 0 + bl rfu_STC_REQ_callback + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E5EE0: .4byte 0x00008020 +_082E5EE4: .4byte 0x03007870 +_082E5EE8: .4byte 0x03007880 +_082E5EEC: .4byte 0x03007890 + thumb_func_end rfu_CB_sendData + + thumb_func_start rfu_CB_sendData2 +rfu_CB_sendData2: @ 82E5EF0 + push {lr} + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x24 + bl rfu_STC_REQ_callback + pop {r0} + bx r0 + thumb_func_end rfu_CB_sendData2 + + thumb_func_start sub_82E5F00 +sub_82E5F00: @ 82E5F00 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _082E5F16 + movs r0, 0x24 + bl rfu_STC_REQ_callback + b _082E5F22 +_082E5F16: + cmp r0, 0xFF + bne _082E5F22 + movs r0, 0xFF + movs r1, 0 + bl rfu_STC_REQ_callback +_082E5F22: + pop {r0} + bx r0 + thumb_func_end sub_82E5F00 + + thumb_func_start rfu_constructSendLLFrame +rfu_constructSendLLFrame: @ 82E5F28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _082E5FD4 + ldr r2, [r0] + ldrb r0, [r2] + cmp r0, 0xFF + bne _082E5F40 + b _082E6044 +_082E5F40: + ldrb r0, [r2, 0x4] + ldrb r1, [r2, 0x5] + orrs r0, r1 + ldrb r1, [r2, 0x6] + orrs r0, r1 + cmp r0, 0 + beq _082E6044 + ldrb r0, [r2, 0xE] + movs r0, 0 + strb r0, [r2, 0xE] + mov r8, r0 + ldr r0, _082E5FD8 + ldr r0, [r0] + adds r0, 0x6C + str r0, [sp] + movs r6, 0 + movs r0, 0x80 + lsls r0, 8 + mov r9, r0 + ldr r1, _082E5FDC + mov r10, r1 +_082E5F6A: + movs r5, 0 + ldr r0, _082E5FE0 + lsls r7, r6, 2 + adds r4, r7, r0 + ldr r2, [r4] + ldrh r1, [r2] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _082E5F8A + adds r0, r6, 0 + mov r1, sp + bl rfu_STC_NI_constructLLSF + lsls r0, 16 + lsrs r5, r0, 16 +_082E5F8A: + ldr r2, [r4] + ldrh r1, [r2, 0x34] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _082E5FA6 + adds r2, 0x34 + adds r0, r6, 0 + mov r1, sp + bl rfu_STC_NI_constructLLSF + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 +_082E5FA6: + ldr r0, _082E5FE4 + adds r0, r7, r0 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, r10 + bne _082E5FC0 + adds r0, r6, 0 + mov r1, sp + bl rfu_STC_UNI_constructLLSF + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 +_082E5FC0: + cmp r5, 0 + beq _082E5FF4 + ldr r0, _082E5FD4 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _082E5FE8 + add r8, r5 + b _082E5FF4 + .align 2, 0 +_082E5FD4: .4byte 0x03007890 +_082E5FD8: .4byte 0x03007898 +_082E5FDC: .4byte 0x00008024 +_082E5FE0: .4byte 0x03007880 +_082E5FE4: .4byte 0x03007870 +_082E5FE8: + adds r0, r7, r6 + adds r0, 0x8 + lsls r5, r0 + mov r2, r8 + orrs r2, r5 + mov r8, r2 +_082E5FF4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _082E5F6A + ldr r6, _082E6054 + mov r0, r8 + cmp r0, 0 + beq _082E603E + ldr r2, [sp] + movs r0, 0x3 + ands r0, r2 + ldr r5, _082E6058 + ldr r1, _082E605C + cmp r0, 0 + beq _082E6026 + movs r4, 0 + movs r3, 0x3 +_082E6018: + strb r4, [r2] + adds r0, r2, 0x1 + str r0, [sp] + adds r2, r0, 0 + ands r0, r3 + cmp r0, 0 + bne _082E6018 +_082E6026: + ldr r0, [r1] + mov r2, r8 + str r2, [r0, 0x68] + ldr r0, [r5] + ldrb r0, [r0] + cmp r0, 0 + bne _082E603E + ldr r0, [sp] + subs r0, 0x6C + ldr r1, [r1] + subs r0, r1 + mov r8, r0 +_082E603E: + ldr r0, [r6] + mov r1, r8 + str r1, [r0, 0x24] +_082E6044: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E6054: .4byte 0x03007894 +_082E6058: .4byte 0x03007890 +_082E605C: .4byte 0x03007898 + thumb_func_end rfu_constructSendLLFrame + + thumb_func_start rfu_STC_NI_constructLLSF +rfu_STC_NI_constructLLSF: @ 82E6060 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r1 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r2, _082E60DC + ldr r0, [r2] + ldrb r0, [r0] + lsls r0, 4 + ldr r1, _082E60E0 + adds r0, r1 + mov r8, r0 + ldrh r1, [r4] + ldr r0, _082E60E4 + cmp r1, r0 + bne _082E60CA + adds r3, r4, 0 + adds r3, 0x20 + ldrb r1, [r3] + lsls r1, 2 + adds r5, r4, 0x4 + adds r1, r5, r1 + ldr r2, [r4, 0x28] + ldr r0, [r4, 0x30] + adds r2, r0 + ldr r0, [r1] + adds r6, r3, 0 + cmp r0, r2 + bcc _082E60CA + movs r7, 0 +_082E60A8: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _082E60B8 + strb r7, [r6] +_082E60B8: + ldrb r1, [r3] + lsls r1, 2 + adds r1, r5, r1 + ldr r2, [r4, 0x28] + ldr r0, [r4, 0x30] + adds r2, r0 + ldr r0, [r1] + cmp r0, r2 + bcs _082E60A8 +_082E60CA: + ldrh r1, [r4] + movs r0, 0x40 + ands r0, r1 + mov r9, r1 + cmp r0, 0 + beq _082E60E8 + movs r5, 0 + b _082E612C + .align 2, 0 +_082E60DC: .4byte 0x03007890 +_082E60E0: .4byte 0x089a3220 +_082E60E4: .4byte 0x00008022 +_082E60E8: + ldr r0, _082E6114 + cmp r9, r0 + bne _082E611C + adds r3, r4, 0 + adds r3, 0x20 + ldrb r0, [r3] + lsls r0, 2 + adds r1, r4, 0x4 + adds r1, r0 + ldrh r7, [r4, 0x2E] + ldr r5, [r1] + adds r2, r5, r7 + ldr r1, [r4, 0x28] + ldr r0, [r4, 0x30] + adds r0, r1, r0 + adds r6, r3, 0 + cmp r2, r0 + bls _082E6118 + subs r0, r5 + lsls r0, 16 + lsrs r5, r0, 16 + b _082E6130 + .align 2, 0 +_082E6114: .4byte 0x00008022 +_082E6118: + adds r5, r7, 0 + b _082E6130 +_082E611C: + ldrh r2, [r4, 0x2E] + ldr r0, [r4, 0x14] + cmp r0, r2 + bcc _082E6128 + adds r5, r2, 0 + b _082E612C +_082E6128: + lsls r0, 16 + lsrs r5, r0, 16 +_082E612C: + adds r6, r4, 0 + adds r6, 0x20 +_082E6130: + movs r3, 0xF + mov r0, r9 + ands r3, r0 + mov r1, r8 + ldrb r1, [r1, 0x3] + lsls r3, r1 + ldrb r0, [r4, 0x1F] + mov r2, r8 + ldrb r2, [r2, 0x4] + lsls r0, r2 + orrs r3, r0 + ldrb r1, [r6] + adds r0, r1, 0 + mov r7, r8 + ldrb r7, [r7, 0x5] + lsls r0, r7 + orrs r3, r0 + adds r0, r4, 0 + adds r0, 0x21 + adds r0, r1 + ldrb r0, [r0] + mov r1, r8 + ldrb r1, [r1, 0x6] + lsls r0, r1 + orrs r3, r0 + orrs r3, r5 + str r3, [sp] + ldr r2, _082E61EC + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0x1 + bne _082E6178 + ldrb r0, [r4, 0x1A] + lsls r0, 18 + orrs r3, r0 + str r3, [sp] +_082E6178: + mov r2, sp + movs r3, 0 + mov r7, r8 + ldrb r7, [r7] + cmp r3, r7 + bcs _082E61A2 +_082E6184: + mov r0, r12 + ldr r1, [r0] + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + mov r7, r12 + str r1, [r7] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + mov r0, r8 + ldrb r0, [r0] + cmp r3, r0 + bcc _082E6184 +_082E61A2: + cmp r5, 0 + beq _082E61C2 + ldrb r1, [r6] + lsls r1, 2 + adds r0, r4, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x4] + ldr r0, _082E61F0 + ldr r1, [r0] + add r0, sp, 0x4 + ldr r3, [r1, 0x4] + mov r1, r12 + adds r2, r5, 0 + bl _call_via_r3 +_082E61C2: + ldrh r1, [r4] + ldr r0, _082E61F4 + cmp r1, r0 + bne _082E61DC + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _082E61DC + movs r0, 0 + strb r0, [r6] +_082E61DC: + ldr r0, _082E61EC + ldr r2, [r0] + ldrb r1, [r2] + cmp r1, 0x1 + bne _082E61F8 + ldrb r0, [r2, 0xE] + strb r1, [r2, 0xE] + b _082E6206 + .align 2, 0 +_082E61EC: .4byte 0x03007890 +_082E61F0: .4byte 0x03007898 +_082E61F4: .4byte 0x00008022 +_082E61F8: + movs r0, 0x1 + mov r1, r10 + lsls r0, r1 + ldrb r1, [r2, 0xE] + orrs r0, r1 + ldrb r1, [r2, 0xE] + strb r0, [r2, 0xE] +_082E6206: + mov r2, r8 + ldrb r0, [r2] + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + 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 rfu_STC_NI_constructLLSF + + thumb_func_start rfu_STC_UNI_constructLLSF +rfu_STC_UNI_constructLLSF: @ 82E6220 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _082E6248 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _082E6244 + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _082E624C +_082E6244: + movs r0, 0 + b _082E62E8 + .align 2, 0 +_082E6248: .4byte 0x03007870 +_082E624C: + ldr r0, _082E62C4 + ldr r2, [r0] + ldrb r0, [r2] + lsls r0, 4 + ldr r1, _082E62C8 + adds r5, r0, r1 + ldrh r0, [r4] + movs r1, 0xF + ands r1, r0 + ldrb r0, [r5, 0x3] + lsls r1, r0 + ldrh r0, [r4, 0x4] + orrs r1, r0 + str r1, [sp] + ldrb r0, [r2] + cmp r0, 0x1 + bne _082E6276 + ldrb r0, [r4, 0x3] + lsls r0, 18 + orrs r1, r0 + str r1, [sp] +_082E6276: + mov r2, sp + movs r3, 0 + ldr r1, _082E62CC + mov r12, r1 + add r7, sp, 0x4 + ldrb r0, [r5] + cmp r3, r0 + bcs _082E629E +_082E6286: + ldr r1, [r6] + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + str r1, [r6] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r1, [r5] + cmp r3, r1 + bcc _082E6286 +_082E629E: + ldr r0, [r4, 0x8] + str r0, [sp, 0x4] + mov r2, r12 + ldr r0, [r2] + ldrh r2, [r4, 0x4] + ldr r3, [r0, 0x4] + adds r0, r7, 0 + adds r1, r6, 0 + bl _call_via_r3 + ldr r0, _082E62C4 + ldr r2, [r0] + ldrb r0, [r2] + cmp r0, 0x1 + bne _082E62D0 + ldrb r0, [r2, 0xE] + movs r0, 0x10 + b _082E62DC + .align 2, 0 +_082E62C4: .4byte 0x03007890 +_082E62C8: .4byte 0x089a3220 +_082E62CC: .4byte 0x03007898 +_082E62D0: + movs r0, 0x10 + mov r1, r8 + lsls r0, r1 + ldrb r1, [r2, 0xE] + orrs r0, r1 + ldrb r1, [r2, 0xE] +_082E62DC: + strb r0, [r2, 0xE] + ldrh r0, [r4, 0x4] + ldrb r5, [r5] + adds r0, r5 + lsls r0, 16 + lsrs r0, 16 +_082E62E8: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end rfu_STC_UNI_constructLLSF + + thumb_func_start rfu_REQ_recvData +rfu_REQ_recvData: @ 82E62F4 + push {r4,lr} + ldr r0, _082E6328 + ldr r4, [r0] + ldrb r0, [r4] + cmp r0, 0xFF + beq _082E6320 + ldr r2, _082E632C + ldr r3, [r2] + ldrb r0, [r4, 0x4] + ldrb r1, [r4, 0x5] + orrs r0, r1 + ldrb r1, [r4, 0x6] + orrs r0, r1 + movs r1, 0 + strb r0, [r3, 0x3] + ldr r0, [r2] + strb r1, [r0, 0x4] + ldr r0, _082E6330 + bl STWI_set_Callback_M + bl STWI_send_DataRxREQ +_082E6320: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_082E6328: .4byte 0x03007890 +_082E632C: .4byte 0x03007894 +_082E6330: .4byte rfu_CB_recvData + 1 + thumb_func_end rfu_REQ_recvData + + thumb_func_start rfu_CB_recvData +rfu_CB_recvData: @ 82E6334 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r7, r1, 16 + cmp r7, 0 + bne _082E63F8 + ldr r0, _082E6370 + ldr r0, [r0] + adds r0, 0xDC + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _082E63F8 + ldr r0, _082E6374 + ldr r0, [r0] + strb r7, [r0, 0x1] + ldr r0, _082E6378 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _082E637C + bl rfu_STC_PARENT_analyzeRecvPacket + b _082E6380 + .align 2, 0 +_082E6370: .4byte 0x03007898 +_082E6374: .4byte 0x03007894 +_082E6378: .4byte 0x03007890 +_082E637C: + bl rfu_STC_CHILD_analyzeRecvPacket +_082E6380: + movs r6, 0 + ldr r0, _082E6410 + mov r8, r0 + ldr r3, _082E6414 +_082E6388: + ldr r0, _082E6418 + lsls r1, r6, 2 + adds r1, r0 + ldr r4, [r1] + ldrh r0, [r4, 0x34] + cmp r0, r8 + bne _082E63DA + ldr r0, _082E641C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + asrs r0, r6 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _082E63DA + adds r5, r4, 0 + adds r5, 0x34 + adds r0, r4, 0 + adds r0, 0x61 + ldrb r2, [r0] + cmp r2, 0x1 + bne _082E63BE + ldr r1, [r3] + lsls r2, r6 + ldrb r0, [r1, 0x7] + orrs r2, r0 + strb r2, [r1, 0x7] +_082E63BE: + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r5, 0 + str r3, [sp] + bl rfu_STC_releaseFrame + ldr r3, [sp] + ldr r2, [r3] + ldrb r1, [r5, 0x1A] + ldrb r0, [r2, 0x5] + bics r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x46 + strh r0, [r4, 0x34] +_082E63DA: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _082E6388 + ldr r0, _082E641C + ldr r1, [r0] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _082E63F8 + adds r7, r0, 0 + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1, 0 + orrs r7, r0 +_082E63F8: + mov r0, r9 + adds r1, r7, 0 + bl rfu_STC_REQ_callback + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E6410: .4byte 0x00008043 +_082E6414: .4byte 0x03007890 +_082E6418: .4byte 0x03007880 +_082E641C: .4byte 0x03007894 + thumb_func_end rfu_CB_recvData + + thumb_func_start rfu_STC_PARENT_analyzeRecvPacket +rfu_STC_PARENT_analyzeRecvPacket: @ 82E6420 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, _082E64B0 + ldr r0, [r1] + adds r0, 0xDC + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsrs r3, r0, 8 + movs r5, 0 + mov r12, r1 + movs r7, 0x1F + ldr r4, _082E64B4 + movs r6, 0x1 +_082E643A: + mov r0, sp + adds r1, r0, r5 + adds r0, r3, 0 + ands r0, r7 + strb r0, [r1] + lsrs r3, 5 + cmp r0, 0 + bne _082E6456 + ldr r0, [r4] + adds r1, r6, 0 + lsls r1, r5 + ldrb r2, [r0, 0x1] + orrs r1, r2 + strb r1, [r0, 0x1] +_082E6456: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _082E643A + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDC + ldr r0, [r0] + adds r6, r0, 0 + adds r6, 0x8 + movs r5, 0 +_082E646E: + mov r0, sp + adds r1, r0, r5 + ldrb r0, [r1] + adds r7, r5, 0x1 + cmp r0, 0 + beq _082E64A0 + adds r4, r1, 0 +_082E647C: + ldrb r2, [r4] + adds r0, r5, 0 + adds r1, r6, 0 + bl rfu_STC_analyzeLLSF + lsls r0, 24 + lsrs r0, 24 + adds r6, r0 + ldrb r1, [r4] + subs r1, r0 + strb r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _082E64A0 + lsls r0, r1, 24 + cmp r0, 0 + bne _082E647C +_082E64A0: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _082E646E + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E64B0: .4byte 0x03007898 +_082E64B4: .4byte 0x03007894 + thumb_func_end rfu_STC_PARENT_analyzeRecvPacket + + thumb_func_start rfu_STC_CHILD_analyzeRecvPacket +rfu_STC_CHILD_analyzeRecvPacket: @ 82E64B8 + push {r4-r6,lr} + ldr r0, _082E6508 + ldr r0, [r0] + adds r0, 0xDC + ldr r1, [r0] + ldrh r0, [r1, 0x4] + movs r4, 0x7F + ands r4, r0 + adds r5, r1, 0 + adds r5, 0x8 + cmp r4, 0 + bne _082E64D8 + ldr r0, _082E650C + ldr r1, [r0] + movs r0, 0xF + strb r0, [r1, 0x1] +_082E64D8: + movs r0, 0x80 + lsls r0, 8 + adds r6, r0, 0 +_082E64DE: + cmp r4, 0 + beq _082E6500 + movs r0, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl rfu_STC_analyzeLLSF + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + ands r0, r6 + cmp r0, 0 + beq _082E64DE +_082E6500: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_082E6508: .4byte 0x03007898 +_082E650C: .4byte 0x03007894 + thumb_func_end rfu_STC_CHILD_analyzeRecvPacket + + thumb_func_start rfu_STC_analyzeLLSF +rfu_STC_analyzeLLSF: @ 82E6510 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r7, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r2, 16 + lsrs r3, r2, 16 + ldr r2, _082E6544 + ldr r0, [r2] + ldrb r0, [r0] + mvns r0, r0 + movs r1, 0x1 + ands r0, r1 + lsls r0, 4 + ldr r1, _082E6548 + adds r6, r0, r1 + ldrb r0, [r6] + cmp r3, r0 + bcs _082E654C + adds r0, r3, 0 + b _082E673E + .align 2, 0 +_082E6544: .4byte 0x03007890 +_082E6548: .4byte 0x089a3220 +_082E654C: + movs r5, 0 + movs r4, 0 + ldrb r3, [r6, 0x1] + ldrb r1, [r6, 0x7] + mov r8, r1 + ldr r2, [sp] + mov r9, r2 + cmp r4, r0 + bcs _082E6574 + adds r2, r0, 0 +_082E6560: + ldrb r0, [r7] + lsls r1, r4, 3 + lsls r0, r1 + orrs r5, r0 + adds r7, 0x1 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r2 + bcc _082E6560 +_082E6574: + adds r0, r5, 0 + lsrs r0, r3 + mov r3, r8 + ands r0, r3 + ldr r1, _082E664C + mov r10, r1 + mov r3, r10 + mov r2, r9 + ands r3, r2 + orrs r3, r0 + str r3, [sp] + adds r0, r5, 0 + ldrb r1, [r6, 0x2] + lsrs r0, r1 + ldrb r1, [r6, 0x8] + ands r0, r1 + lsls r0, 8 + ldr r4, _082E6650 + adds r2, r4, 0 + ands r2, r3 + orrs r2, r0 + str r2, [sp] + adds r0, r5, 0 + ldrb r3, [r6, 0x3] + lsrs r0, r3 + ldrb r1, [r6, 0x9] + ands r0, r1 + lsls r0, 16 + ldr r3, _082E6654 + ands r3, r2 + orrs r3, r0 + str r3, [sp] + adds r0, r5, 0 + ldrb r1, [r6, 0x4] + lsrs r0, r1 + ldrb r1, [r6, 0xA] + ands r0, r1 + lsls r0, 24 + ldr r2, _082E6658 + mov r8, r2 + mov r1, r8 + ands r1, r3 + orrs r1, r0 + mov r8, r1 + str r1, [sp] + adds r1, r5, 0 + ldrb r2, [r6, 0x5] + lsrs r1, r2 + ldrb r0, [r6, 0xB] + ands r1, r0 + mov r9, sp + ldr r2, [sp, 0x4] + mov r3, r10 + ands r2, r3 + orrs r2, r1 + str r2, [sp, 0x4] + adds r0, r5, 0 + ldrb r1, [r6, 0x6] + lsrs r0, r1 + ldrb r1, [r6, 0xC] + ands r0, r1 + lsls r0, 8 + ands r4, r2 + orrs r4, r0 + str r4, [sp, 0x4] + ldrh r0, [r6, 0xE] + ands r5, r0 + lsls r1, r5, 16 + ldr r0, _082E665C + ands r0, r4 + orrs r0, r1 + str r0, [sp, 0x4] + lsrs r0, 16 + ldrb r6, [r6] + adds r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _082E661A + b _082E673C +_082E661A: + ldr r2, _082E6660 + ldr r3, [r2] + ldrb r2, [r3] + cmp r2, 0x1 + bne _082E66D8 + ldrb r0, [r3, 0x2] + mov r5, r12 + asrs r0, r5 + ands r0, r2 + cmp r0, 0 + bne _082E6632 + b _082E673C +_082E6632: + mov r1, r8 + lsrs r0, r1, 16 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _082E6664 + mov r0, r12 + mov r1, sp + adds r2, r7, 0 + bl rfu_STC_UNI_receive + b _082E673C + .align 2, 0 +_082E664C: .4byte 0xffffff00 +_082E6650: .4byte 0xffff00ff +_082E6654: .4byte 0xff00ffff +_082E6658: .4byte 0x00ffffff +_082E665C: .4byte 0x0000ffff +_082E6660: .4byte 0x03007890 +_082E6664: + mov r5, r9 + ldrb r0, [r5, 0x3] + cmp r0, 0 + bne _082E6678 + mov r0, r12 + mov r1, sp + adds r2, r7, 0 + bl rfu_STC_NI_receive_Receiver + b _082E673C +_082E6678: + movs r4, 0 + ldr r1, _082E6690 + ldr r0, [r1] + ldrb r0, [r0, 0x1A] + mov r5, r12 + asrs r0, r5 + ands r0, r2 + cmp r0, 0 + beq _082E6694 + ldrb r0, [r3, 0x4] + b _082E66BA + .align 2, 0 +_082E6690: .4byte 0x03007880 +_082E6694: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bhi _082E673C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + mov r2, r12 + asrs r0, r2 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _082E6694 + ldr r3, _082E66D4 + ldr r0, [r3] + ldrb r0, [r0, 0x4] + mov r5, r12 +_082E66BA: + asrs r0, r5 + ands r0, r2 + cmp r0, 0 + beq _082E6694 + cmp r4, 0x3 + bhi _082E673C + adds r0, r4, 0 + mov r1, r12 + mov r2, sp + adds r3, r7, 0 + bl rfu_STC_NI_receive_Sender + b _082E673C + .align 2, 0 +_082E66D4: .4byte 0x03007890 +_082E66D8: + ldrb r1, [r3, 0x2] + mov r2, r9 + ldrb r0, [r2, 0x1] + adds r5, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _082E673C + movs r4, 0 + movs r6, 0x1 +_082E66EA: + adds r0, r5, 0 + asrs r0, r4 + ands r0, r6 + cmp r0, 0 + beq _082E6732 + mov r1, sp + ldrb r0, [r1, 0x2] + cmp r0, 0x4 + bne _082E6706 + adds r0, r4, 0 + adds r2, r7, 0 + bl rfu_STC_UNI_receive + b _082E6732 +_082E6706: + ldrb r0, [r1, 0x3] + cmp r0, 0 + bne _082E6718 + adds r0, r4, 0 + mov r1, sp + adds r2, r7, 0 + bl rfu_STC_NI_receive_Receiver + b _082E6732 +_082E6718: + ldr r0, _082E6750 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + asrs r0, r4 + ands r0, r6 + cmp r0, 0 + beq _082E6732 + adds r0, r4, 0 + adds r1, r4, 0 + mov r2, sp + adds r3, r7, 0 + bl rfu_STC_NI_receive_Sender +_082E6732: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _082E66EA +_082E673C: + mov r0, r10 +_082E673E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E6750: .4byte 0x03007890 + thumb_func_end rfu_STC_analyzeLLSF + + thumb_func_start rfu_STC_UNI_receive +rfu_STC_UNI_receive: @ 82E6754 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r1, 0 + str r2, [sp] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, _082E6788 + lsls r1, r7, 2 + adds r1, r2 + ldr r3, [r1] + adds r5, r3, 0 + adds r5, 0xC + movs r4, 0 + movs r0, 0 + strh r0, [r5, 0x2] + ldr r0, [r1] + ldr r0, [r0, 0x18] + adds r1, r2, 0 + ldrh r2, [r6, 0x6] + cmp r0, r2 + bcs _082E6790 + movs r0, 0x49 + strh r0, [r3, 0xC] + ldr r0, _082E678C + strh r0, [r5, 0x2] + b _082E67DE + .align 2, 0 +_082E6788: .4byte 0x03007870 +_082E678C: .4byte 0x00000701 +_082E6790: + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _082E67A8 + ldrb r0, [r5, 0x6] + cmp r0, 0 + beq _082E67B4 + ldr r0, _082E67A4 + strh r0, [r5, 0x2] + b _082E67DE + .align 2, 0 +_082E67A4: .4byte 0x00000709 +_082E67A8: + ldrb r0, [r5, 0x6] + cmp r0, 0 + beq _082E67B4 + movs r0, 0xE1 + lsls r0, 3 + strh r0, [r5, 0x2] +_082E67B4: + movs r4, 0 + ldr r0, _082E67FC + strh r0, [r5] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x4] + ldrh r2, [r6, 0x6] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0, 0x14] + str r0, [sp, 0x4] + ldr r0, _082E6800 + ldr r0, [r0] + add r1, sp, 0x4 + ldr r3, [r0, 0x4] + mov r0, sp + bl _call_via_r3 + movs r0, 0x1 + strb r0, [r5, 0x6] + strh r4, [r5] +_082E67DE: + ldrh r0, [r5, 0x2] + cmp r0, 0 + beq _082E67F2 + ldr r0, _082E6804 + ldr r2, [r0] + movs r0, 0x10 + lsls r0, r7 + ldrb r1, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] +_082E67F2: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E67FC: .4byte 0x00008042 +_082E6800: .4byte 0x03007898 +_082E6804: .4byte 0x03007894 + thumb_func_end rfu_STC_UNI_receive + + thumb_func_start rfu_STC_NI_receive_Sender +rfu_STC_NI_receive_Sender: @ 82E6808 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r2, 0 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r1, _082E68D4 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + mov r12, r0 + ldrh r0, [r0] + mov r9, r0 + mov r0, r12 + adds r0, 0x21 + ldrb r2, [r6, 0x4] + adds r0, r2 + ldrb r0, [r0] + str r0, [sp] + ldrb r2, [r6, 0x2] + cmp r2, 0x2 + bne _082E6844 + ldr r0, _082E68D8 + cmp r9, r0 + beq _082E685E +_082E6844: + cmp r2, 0x1 + bne _082E684E + ldr r0, _082E68DC + cmp r9, r0 + beq _082E685E +_082E684E: + movs r3, 0x1B + add r3, r12 + mov r8, r3 + cmp r2, 0x3 + bne _082E6882 + ldr r0, _082E68E0 + cmp r9, r0 + bne _082E6882 +_082E685E: + ldrb r1, [r6, 0x4] + mov r0, r12 + adds r0, 0x21 + adds r0, r1 + ldrb r0, [r0] + movs r7, 0x1B + add r7, r12 + mov r8, r7 + ldrb r2, [r6, 0x5] + cmp r0, r2 + bne _082E6882 + adds r0, r7, r1 + movs r1, 0x1 + mov r3, r10 + lsls r1, r3 + ldrb r2, [r0] + orrs r1, r2 + strb r1, [r0] +_082E6882: + ldrb r2, [r6, 0x4] + mov r7, r8 + adds r0, r7, r2 + ldrb r0, [r0] + mov r3, r12 + ldrb r1, [r3, 0x1A] + ands r0, r1 + cmp r0, r1 + bne _082E697E + adds r3, 0x21 + adds r2, r3, r2 + ldrb r0, [r2] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + movs r1, 0 + strb r0, [r2] + ldrb r0, [r6, 0x4] + add r0, r8 + strb r1, [r0] + mov r7, r12 + ldrh r1, [r7] + ldr r2, _082E68E4 + adds r0, r1, r2 + lsls r0, 16 + lsrs r0, 16 + adds r5, r3, 0 + cmp r0, 0x1 + bhi _082E6970 + ldr r0, _082E68DC + cmp r1, r0 + bne _082E68E8 + ldrb r1, [r6, 0x4] + lsls r1, 2 + subs r3, 0x1D + adds r1, r3, r1 + ldrh r2, [r7, 0x2E] + ldr r0, [r1] + adds r0, r2 + str r0, [r1] + b _082E68FE + .align 2, 0 +_082E68D4: .4byte 0x03007880 +_082E68D8: .4byte 0x00008022 +_082E68DC: .4byte 0x00008021 +_082E68E0: .4byte 0x00008023 +_082E68E4: .4byte 0x00007fdf +_082E68E8: + ldrb r2, [r6, 0x4] + lsls r2, 2 + mov r3, r12 + adds r3, 0x4 + adds r2, r3, r2 + mov r7, r12 + ldrh r1, [r7, 0x2E] + lsls r1, 2 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] +_082E68FE: + mov r0, r12 + ldrh r1, [r0, 0x2E] + ldr r0, [r0, 0x14] + subs r0, r1 + mov r1, r12 + str r0, [r1, 0x14] + cmp r0, 0 + beq _082E6912 + cmp r0, 0 + bge _082E697E +_082E6912: + mov r0, r12 + adds r0, 0x20 + movs r2, 0 + strb r2, [r0] + mov r7, r12 + ldrh r1, [r7] + ldr r0, _082E6954 + cmp r1, r0 + bne _082E695C + movs r4, 0 +_082E6926: + adds r0, r5, r4 + movs r1, 0x1 + strb r1, [r0] + lsls r1, r4, 2 + adds r1, r3, r1 + mov r2, r12 + ldrh r0, [r2, 0x2E] + adds r2, r0, 0 + muls r2, r4 + mov r7, r12 + ldr r0, [r7, 0x28] + adds r0, r2 + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _082E6926 + ldr r0, [r7, 0x30] + str r0, [r7, 0x14] + ldr r0, _082E6958 + strh r0, [r7] + b _082E697E + .align 2, 0 +_082E6954: .4byte 0x00008021 +_082E6958: .4byte 0x00008022 +_082E695C: + strb r2, [r5] + mov r0, r12 + str r2, [r0, 0x14] + ldr r0, _082E696C + mov r1, r12 + strh r0, [r1] + b _082E697E + .align 2, 0 +_082E696C: .4byte 0x00008023 +_082E6970: + lsls r1, 16 + ldr r0, _082E69E0 + cmp r1, r0 + bne _082E697E + ldr r0, _082E69E4 + mov r2, r12 + strh r0, [r2] +_082E697E: + mov r3, r12 + ldrh r0, [r3] + cmp r0, r9 + bne _082E69A8 + ldrb r2, [r6, 0x4] + mov r0, r12 + adds r0, 0x21 + adds r0, r2 + ldrb r0, [r0] + ldr r7, [sp] + cmp r0, r7 + bne _082E69A8 + mov r1, r8 + adds r0, r1, r2 + ldrb r0, [r0] + mov r2, r10 + asrs r0, r2 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _082E69CE +_082E69A8: + ldr r4, _082E69E8 + ldrh r2, [r4] + movs r0, 0 + strh r0, [r4] + ldr r0, _082E69EC + ldr r3, [r0] + movs r0, 0x10 + mov r7, r10 + lsls r0, r7 + ldrb r1, [r3, 0x2] + orrs r0, r1 + movs r1, 0 + strb r0, [r3, 0x2] + lsls r0, r7, 2 + ldr r3, _082E69F0 + adds r0, r3 + ldr r0, [r0] + strh r1, [r0, 0x2] + strh r2, [r4] +_082E69CE: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E69E0: .4byte 0x80230000 +_082E69E4: .4byte 0x00008020 +_082E69E8: .4byte 0x04000208 +_082E69EC: .4byte 0x03007894 +_082E69F0: .4byte 0x03007880 + thumb_func_end rfu_STC_NI_receive_Sender + + thumb_func_start rfu_STC_NI_receive_Receiver +rfu_STC_NI_receive_Receiver: @ 82E69F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r1, 0 + str r2, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + ldr r1, _082E6A54 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r5, r4, 0 + adds r5, 0x34 + ldrh r0, [r4, 0x34] + mov r9, r0 + ldrb r0, [r6, 0x4] + adds r3, r4, 0 + adds r3, 0x55 + adds r0, r3, r0 + ldrb r0, [r0] + mov r10, r0 + ldrb r0, [r6, 0x2] + cmp r0, 0x3 + bne _082E6A64 + ldr r0, _082E6A58 + ldr r2, [r0] + movs r0, 0x1 + mov r1, r8 + lsls r0, r1 + ldrb r1, [r2, 0x1] + orrs r0, r1 + strb r0, [r2, 0x1] + ldrh r1, [r4, 0x34] + ldr r0, _082E6A5C + cmp r1, r0 + bne _082E6AAA + adds r0, r4, 0 + adds r0, 0x54 + strb r7, [r0] + strb r7, [r3] + ldr r0, _082E6A60 + strh r0, [r4, 0x34] + b _082E6AAA + .align 2, 0 +_082E6A54: .4byte 0x03007880 +_082E6A58: .4byte 0x03007894 +_082E6A5C: .4byte 0x00008042 +_082E6A60: .4byte 0x00008043 +_082E6A64: + cmp r0, 0x2 + bne _082E6A90 + ldr r0, _082E6A88 + cmp r9, r0 + bne _082E6A7C + ldr r0, [r5, 0x14] + cmp r0, 0 + bne _082E6A7C + mov r0, r8 + adds r1, r5, 0 + bl rfu_STC_NI_initSlot_asRecvDataEntity +_082E6A7C: + ldrh r1, [r5] + ldr r0, _082E6A8C + cmp r1, r0 + bne _082E6AAA + b _082E6AAE + .align 2, 0 +_082E6A88: .4byte 0x00008041 +_082E6A8C: .4byte 0x00008042 +_082E6A90: + cmp r0, 0x1 + bne _082E6AAA + ldr r7, _082E6B5C + cmp r9, r7 + beq _082E6AAE + mov r0, r8 + adds r1, r5, 0 + bl rfu_STC_NI_initSlot_asRecvControllData + ldrh r0, [r4, 0x34] + cmp r0, r7 + bne _082E6B4A + movs r7, 0x1 +_082E6AAA: + cmp r7, 0 + beq _082E6B04 +_082E6AAE: + ldrb r2, [r6, 0x5] + ldrb r3, [r6, 0x4] + adds r4, r5, 0 + adds r4, 0x21 + adds r0, r4, r3 + ldrb r0, [r0] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + cmp r2, r0 + bne _082E6B04 + ldr r0, _082E6B60 + ldr r0, [r0] + lsls r1, r3, 2 + adds r1, 0x4 + adds r1, r5, r1 + ldrh r2, [r6, 0x6] + ldr r3, [r0, 0x4] + mov r0, sp + bl _call_via_r3 + ldrh r1, [r5] + ldr r0, _082E6B64 + cmp r1, r0 + bne _082E6AF4 + ldrb r0, [r6, 0x4] + lsls r0, 2 + adds r2, r5, 0x4 + adds r2, r0 + ldrh r0, [r5, 0x2E] + lsls r1, r0, 1 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] +_082E6AF4: + ldrh r1, [r6, 0x6] + ldr r0, [r5, 0x14] + subs r0, r1 + str r0, [r5, 0x14] + ldrb r0, [r6, 0x4] + adds r0, r4, r0 + ldrb r1, [r6, 0x5] + strb r1, [r0] +_082E6B04: + ldrh r0, [r5, 0x18] + cmp r0, 0 + bne _082E6B4A + ldrb r0, [r6, 0x4] + adds r1, r5, 0 + adds r1, 0x20 + strb r0, [r1] + ldrh r0, [r5] + cmp r0, r9 + bne _082E6B2C + adds r0, r5, 0 + adds r0, 0x21 + ldrb r2, [r6, 0x4] + adds r0, r2 + ldrb r0, [r0] + cmp r0, r10 + bne _082E6B2C + ldrb r6, [r6, 0x5] + cmp r0, r6 + bne _082E6B4A +_082E6B2C: + ldr r3, _082E6B68 + ldrh r2, [r3] + movs r0, 0 + strh r0, [r3] + ldr r0, _082E6B6C + ldr r4, [r0] + movs r0, 0x1 + mov r1, r8 + lsls r0, r1 + ldrb r1, [r4, 0x2] + orrs r0, r1 + movs r1, 0 + strb r0, [r4, 0x2] + strh r1, [r5, 0x2] + strh r2, [r3] +_082E6B4A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E6B5C: .4byte 0x00008041 +_082E6B60: .4byte 0x03007898 +_082E6B64: .4byte 0x00008042 +_082E6B68: .4byte 0x04000208 +_082E6B6C: .4byte 0x03007894 + thumb_func_end rfu_STC_NI_receive_Receiver + + thumb_func_start rfu_STC_NI_initSlot_asRecvControllData +rfu_STC_NI_initSlot_asRecvControllData: @ 82E6B70 + push {r4-r7,lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _082E6B8C + ldr r3, [r0] + ldrb r1, [r3] + mov r12, r0 + cmp r1, 0x1 + bne _082E6B90 + movs r5, 0x3 + adds r1, r3, 0 + adds r1, 0xF + b _082E6B98 + .align 2, 0 +_082E6B8C: .4byte 0x03007890 +_082E6B90: + movs r5, 0x2 + adds r0, r4, 0 + adds r0, 0x10 + adds r1, r3, r0 +_082E6B98: + movs r7, 0x1 + adds r0, r7, 0 + lsls r0, r4 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r6, 0 + ldrh r3, [r2] + cmp r3, 0 + bne _082E6BF6 + ldrb r0, [r1] + cmp r0, r5 + bcs _082E6BD0 + movs r0, 0x49 + strh r0, [r2] + ldr r0, _082E6BC8 + strh r0, [r2, 0x18] + ldr r0, _082E6BCC + ldr r2, [r0] + ldrb r1, [r2, 0x4] + adds r0, r6, 0 + orrs r0, r1 + strb r0, [r2, 0x4] + b _082E6BF6 + .align 2, 0 +_082E6BC8: .4byte 0x00000702 +_082E6BCC: .4byte 0x03007894 +_082E6BD0: + strh r3, [r2, 0x18] + ldrb r0, [r1] + subs r0, r5 + strb r0, [r1] + adds r0, r2, 0 + adds r0, 0x2D + str r0, [r2, 0x4] + movs r0, 0x7 + str r0, [r2, 0x14] + strb r7, [r2, 0x1F] + strh r3, [r2, 0x2E] + strb r4, [r2, 0x1A] + ldr r0, _082E6BFC + strh r0, [r2] + mov r0, r12 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + orrs r4, r0 + strb r4, [r1, 0x5] +_082E6BF6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E6BFC: .4byte 0x00008041 + thumb_func_end rfu_STC_NI_initSlot_asRecvControllData + + thumb_func_start rfu_STC_NI_initSlot_asRecvDataEntity +rfu_STC_NI_initSlot_asRecvDataEntity: @ 82E6C00 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + adds r0, 0x2D + ldrb r0, [r0] + cmp r0, 0x1 + bne _082E6C24 + ldr r0, _082E6C20 + lsls r1, r5, 5 + adds r1, 0x14 + ldr r0, [r0] + adds r0, r1 + adds r0, 0x4 + b _082E6C7A + .align 2, 0 +_082E6C20: .4byte 0x03007890 +_082E6C24: + ldr r1, _082E6C68 + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + ldr r1, [r4, 0x30] + ldr r0, [r2, 0x6C] + cmp r1, r0 + bls _082E6C78 + movs r1, 0x80 + lsls r1, 17 + lsls r1, r5 + lsrs r1, 24 + ldr r0, _082E6C6C + ldr r3, [r0] + ldrb r2, [r3, 0x4] + adds r0, r1, 0 + orrs r0, r2 + strb r0, [r3, 0x4] + ldr r0, _082E6C70 + ldr r2, [r0] + ldrb r0, [r2, 0x5] + bics r0, r1 + strb r0, [r2, 0x5] + ldr r0, _082E6C74 + strh r0, [r4, 0x18] + movs r0, 0x47 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl rfu_STC_releaseFrame + b _082E6CAC + .align 2, 0 +_082E6C68: .4byte 0x03007880 +_082E6C6C: .4byte 0x03007894 +_082E6C70: .4byte 0x03007890 +_082E6C74: .4byte 0x00000701 +_082E6C78: + ldr r0, [r2, 0x68] +_082E6C7A: + str r0, [r4, 0x4] + movs r3, 0 + adds r6, r4, 0 + adds r6, 0x21 + movs r7, 0 + adds r5, r4, 0x4 +_082E6C86: + adds r0, r6, r3 + strb r7, [r0] + lsls r1, r3, 2 + adds r1, r5, r1 + ldrh r0, [r4, 0x2E] + adds r2, r0, 0 + muls r2, r3 + ldr r0, [r4, 0x4] + adds r0, r2 + str r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _082E6C86 + ldr r0, [r4, 0x30] + str r0, [r4, 0x14] + ldr r0, _082E6CB4 + strh r0, [r4] +_082E6CAC: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E6CB4: .4byte 0x00008042 + thumb_func_end rfu_STC_NI_initSlot_asRecvDataEntity + + thumb_func_start rfu_NI_checkCommFailCounter +rfu_NI_checkCommFailCounter: @ 82E6CB8 + push {r4-r7,lr} + ldr r2, _082E6D44 + ldr r0, [r2] + ldrb r1, [r0, 0x4] + ldrb r0, [r0, 0x5] + orrs r0, r1 + cmp r0, 0 + beq _082E6D3E + ldr r1, _082E6D48 + ldrh r0, [r1] + mov r12, r0 + movs r0, 0 + strh r0, [r1] + ldr r1, _082E6D4C + ldr r0, [r1] + ldrb r0, [r0, 0x2] + lsrs r7, r0, 4 + movs r3, 0 + adds r6, r1, 0 + adds r5, r2, 0 + ldr r4, _082E6D50 +_082E6CE2: + movs r0, 0x80 + lsls r0, 17 + lsls r0, r3 + lsrs r2, r0, 24 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + ands r0, r2 + cmp r0, 0 + beq _082E6D0A + ldr r0, [r6] + ldrb r0, [r0, 0x2] + ands r0, r2 + cmp r0, 0 + bne _082E6D0A + lsls r0, r3, 2 + adds r0, r4 + ldr r1, [r0] + ldrh r0, [r1, 0x2] + adds r0, 0x1 + strh r0, [r1, 0x2] +_082E6D0A: + ldr r0, [r5] + ldrb r0, [r0, 0x5] + ands r0, r2 + cmp r0, 0 + beq _082E6D28 + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + bne _082E6D28 + lsls r0, r3, 2 + adds r0, r4 + ldr r1, [r0] + ldrh r0, [r1, 0x36] + adds r0, 0x1 + strh r0, [r1, 0x36] +_082E6D28: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _082E6CE2 + ldr r0, [r6] + movs r1, 0 + strb r1, [r0, 0x2] + ldr r0, _082E6D48 + mov r1, r12 + strh r1, [r0] +_082E6D3E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_082E6D44: .4byte 0x03007890 +_082E6D48: .4byte 0x04000208 +_082E6D4C: .4byte 0x03007894 +_082E6D50: .4byte 0x03007880 + thumb_func_end rfu_NI_checkCommFailCounter + + thumb_func_start rfu_REQ_noise +rfu_REQ_noise: @ 82E6D54 + push {lr} + ldr r0, _082E6D68 + bl STWI_set_Callback_M + movs r0, 0x1 + movs r1, 0 + bl STWI_send_TestModeREQ + pop {r0} + bx r0 + .align 2, 0 +_082E6D68: .4byte rfu_STC_REQ_callback + 1 + thumb_func_end rfu_REQ_noise + + thumb_func_start sub_82E6D6C +sub_82E6D6C: @ 82E6D6C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _082E6D84 + ldrh r0, [r0] + cmp r0, 0 + bne _082E6D88 + movs r0, 0x1 + negs r0, r0 + b _082E6E08 + .align 2, 0 +_082E6D84: .4byte 0x04000208 +_082E6D88: + ldr r0, _082E6DB4 + ldrh r0, [r0] + mov r8, r0 + ldr r4, _082E6DB8 + ldr r1, [r4] + movs r0, 0xA + str r0, [r1] + ldr r0, _082E6DBC + bl STWI_set_Callback_ID + bl sub_82E6E20 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + lsls r0, 2 + ldr r1, _082E6DC0 + adds r4, r0, r1 + lsls r0, r5, 27 + lsrs r5, r0, 24 + movs r7, 0 + b _082E6DD6 + .align 2, 0 +_082E6DB4: .4byte 0x04000200 +_082E6DB8: .4byte 0x03007868 +_082E6DBC: .4byte sub_82E6F88 + 1 +_082E6DC0: .4byte 0x04000100 +_082E6DC4: + strh r6, [r4, 0x2] + strh r6, [r4] + movs r0, 0x83 + strh r0, [r4, 0x2] +_082E6DCC: + ldrh r0, [r4] + cmp r0, 0x1F + bls _082E6DCC + strh r7, [r4, 0x2] + strh r7, [r4] +_082E6DD6: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xFF + beq _082E6DEA + bl sub_82E6E94 + adds r6, r0, 0 + cmp r6, 0 + beq _082E6DC4 +_082E6DEA: + ldr r1, _082E6E14 + movs r0, 0 + strh r0, [r1] + ldr r0, _082E6E18 + mov r2, r8 + strh r2, [r0] + movs r0, 0x1 + strh r0, [r1] + ldr r0, _082E6E1C + ldr r1, [r0] + movs r0, 0 + str r0, [r1] + bl STWI_set_Callback_ID + adds r0, r6, 0 +_082E6E08: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_082E6E14: .4byte 0x04000208 +_082E6E18: .4byte 0x04000200 +_082E6E1C: .4byte 0x03007868 + thumb_func_end sub_82E6D6C + + thumb_func_start sub_82E6E20 +sub_82E6E20: @ 82E6E20 + push {r4,r5,lr} + sub sp, 0x4 + ldr r3, _082E6E78 + movs r4, 0 + strh r4, [r3] + ldr r2, _082E6E7C + ldr r0, _082E6E80 + ldr r0, [r0] + movs r1, 0x8 + ldrb r0, [r0, 0xA] + lsls r1, r0 + movs r5, 0x80 + orrs r1, r5 + ldrh r0, [r2] + bics r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r3] + ldr r0, _082E6E84 + strh r4, [r0] + subs r2, 0xD8 + movs r1, 0x80 + lsls r1, 5 + adds r0, r1, 0 + strh r0, [r2] + ldrh r0, [r2] + movs r3, 0x81 + lsls r3, 7 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + movs r0, 0 + str r0, [sp] + ldr r1, _082E6E88 + ldr r2, _082E6E8C + mov r0, sp + bl CpuSet + ldr r0, _082E6E90 + strh r5, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E6E78: .4byte 0x04000208 +_082E6E7C: .4byte 0x04000200 +_082E6E80: .4byte 0x03007868 +_082E6E84: .4byte 0x04000134 +_082E6E88: .4byte 0x030078a0 +_082E6E8C: .4byte 0x05000003 +_082E6E90: .4byte 0x04000202 + thumb_func_end sub_82E6E20 + + thumb_func_start sub_82E6E94 +sub_82E6E94: @ 82E6E94 + push {r4-r7,lr} + ldr r0, _082E6EA8 + ldrb r1, [r0, 0x1] + mov r12, r1 + adds r7, r0, 0 + cmp r1, 0 + beq _082E6EAC + cmp r1, 0x1 + beq _082E6EE4 + b _082E6F7C + .align 2, 0 +_082E6EA8: .4byte 0x030078a0 +_082E6EAC: + movs r6, 0x1 + strb r6, [r7] + ldr r3, _082E6ED8 + ldrh r0, [r3] + movs r5, 0x1 + orrs r0, r5 + strh r0, [r3] + ldr r4, _082E6EDC + mov r0, r12 + strh r0, [r4] + ldr r2, _082E6EE0 + ldrh r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r2] + strh r6, [r4] + strb r5, [r7, 0x1] + ldrb r0, [r3] + orrs r0, r1 + strb r0, [r3] + b _082E6F80 + .align 2, 0 +_082E6ED8: .4byte 0x04000128 +_082E6EDC: .4byte 0x04000208 +_082E6EE0: .4byte 0x04000200 +_082E6EE4: + ldrh r0, [r7, 0xA] + cmp r0, 0 + bne _082E6F78 + ldrb r0, [r7] + cmp r0, 0x1 + bne _082E6F14 + ldrh r0, [r7, 0x2] + cmp r0, 0 + bne _082E6F80 + ldr r3, _082E6F0C + strh r0, [r3] + ldr r2, _082E6F10 + ldrh r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r2] + mov r1, r12 + strh r1, [r3] + b _082E6F80 + .align 2, 0 +_082E6F0C: .4byte 0x04000208 +_082E6F10: .4byte 0x04000128 +_082E6F14: + ldrh r1, [r7, 0x4] + ldr r0, _082E6F60 + cmp r1, r0 + beq _082E6F80 + ldrh r6, [r7, 0x2] + cmp r6, 0 + bne _082E6F80 + ldr r4, _082E6F64 + strh r6, [r4] + ldr r3, _082E6F68 + ldrh r1, [r3] + ldr r0, _082E6F6C + ands r0, r1 + strh r0, [r3] + mov r7, r12 + strh r7, [r4] + ldr r2, _082E6F70 + strh r6, [r2] + movs r1, 0x80 + lsls r1, 5 + adds r0, r1, 0 + strh r0, [r2] + ldr r0, _082E6F74 + movs r5, 0x80 + strh r5, [r0] + ldrh r0, [r2] + movs r7, 0x81 + lsls r7, 7 + adds r1, r7, 0 + orrs r0, r1 + strh r0, [r2] + strh r6, [r4] + ldrh r0, [r3] + orrs r0, r5 + strh r0, [r3] + mov r0, r12 + strh r0, [r4] + b _082E6F80 + .align 2, 0 +_082E6F60: .4byte 0x00008001 +_082E6F64: .4byte 0x04000208 +_082E6F68: .4byte 0x04000200 +_082E6F6C: .4byte 0x0000ff7f +_082E6F70: .4byte 0x04000128 +_082E6F74: .4byte 0x04000202 +_082E6F78: + movs r0, 0x2 + strb r0, [r7, 0x1] +_082E6F7C: + ldrh r0, [r7, 0xA] + b _082E6F82 +_082E6F80: + movs r0, 0 +_082E6F82: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_82E6E94 + + thumb_func_start sub_82E6F88 +sub_82E6F88: @ 82E6F88 + push {r4,r5,lr} + ldr r0, _082E6FD0 + ldr r5, [r0] + ldr r0, _082E6FD4 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x1 + beq sub_82E6FA2 + ldr r0, _082E6FD8 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + thumb_func_end sub_82E6F88 + + non_word_aligned_thumb_func_start sub_82E6FA2 +sub_82E6FA2: @ 82E6FA2 + ldrb r2, [r4] + lsls r1, r2, 4 + adds r0, r5, 0 + lsls r0, r1 + lsrs r1, r0, 16 + movs r0, 0x1 + subs r0, r2 + lsls r0, 4 + lsls r5, r0 + adds r0, r5, 0 + lsrs r5, r0, 16 + ldrh r0, [r4, 0xA] + cmp r0, 0 + bne _082E6FF6 + ldrh r2, [r4, 0x6] + cmp r1, r2 + bne _082E6FF4 + ldrh r3, [r4, 0x2] + cmp r3, 0x3 + bls _082E6FDC + strh r5, [r4, 0xA] + b _082E6FF6 + .align 2, 0 +_082E6FD0: .4byte 0x04000120 +_082E6FD4: .4byte 0x030078a0 +_082E6FD8: .4byte 0x04000128 +_082E6FDC: + ldrh r0, [r4, 0x4] + mvns r0, r0 + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bne _082E6FF6 + mvns r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r5, r0 + bne _082E6FF6 + adds r0, r3, 0x1 +_082E6FF4: + strh r0, [r4, 0x2] +_082E6FF6: + ldrh r0, [r4, 0x2] + cmp r0, 0x3 + bhi _082E700C + lsls r0, 1 + ldr r1, _082E7008 + adds r0, r1 + ldrh r0, [r0] + b _082E700E + .align 2, 0 +_082E7008: .4byte 0x089a3258 +_082E700C: + ldr r0, _082E7064 +_082E700E: + strh r0, [r4, 0x4] + mvns r0, r5 + strh r0, [r4, 0x6] + ldr r3, _082E7068 + ldrh r2, [r4, 0x4] + ldrb r1, [r4] + movs r0, 0x1 + subs r0, r1 + lsls r0, 4 + lsls r2, r0 + ldrh r0, [r4, 0x6] + lsls r1, 4 + lsls r0, r1 + adds r2, r0 + str r2, [r3] + ldrb r0, [r4] + cmp r0, 0x1 + bne _082E705C + ldrh r0, [r4, 0x2] + cmp r0, 0 + bne _082E703E + ldr r0, _082E706C + cmp r5, r0 + bne _082E705C +_082E703E: + movs r0, 0 + ldr r1, _082E7070 +_082E7042: + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bls _082E7042 + ldrh r0, [r4, 0xA] + cmp r0, 0 + bne _082E705C + ldr r0, _082E7074 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] +_082E705C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_082E7064: .4byte 0x00008001 +_082E7068: .4byte 0x04000120 +_082E706C: .4byte 0x0000494e +_082E7070: .4byte 0x00000257 +_082E7074: .4byte 0x04000128 + thumb_func_end sub_82E6FA2 + + thumb_func_start ArcTan2 +ArcTan2: @ 82E7078 + swi 0xA + bx lr + thumb_func_end ArcTan2 + + thumb_func_start BgAffineSet +BgAffineSet: @ 82E707C + swi 0xE + bx lr + thumb_func_end BgAffineSet + + thumb_func_start CpuFastSet +CpuFastSet: @ 82E7080 + swi 0xC + bx lr + thumb_func_end CpuFastSet + + thumb_func_start CpuSet +CpuSet: @ 82E7084 + swi 0xB + bx lr + thumb_func_end CpuSet + + thumb_func_start Div +Div: @ 82E7088 + swi 0x6 + bx lr + thumb_func_end Div + + thumb_func_start LZ77UnCompVram +LZ77UnCompVram: @ 82E708C + swi 0x12 + bx lr + thumb_func_end LZ77UnCompVram + + thumb_func_start LZ77UnCompWram +LZ77UnCompWram: @ 82E7090 + swi 0x11 + bx lr + thumb_func_end LZ77UnCompWram + + thumb_func_start MultiBoot +MultiBoot: @ 82E7094 + movs r1, 0x1 + swi 0x25 + bx lr + thumb_func_end MultiBoot + + thumb_func_start ObjAffineSet +ObjAffineSet: @ 82E709A +_082E709C: + swi 0xF + bx lr + thumb_func_end ObjAffineSet + + thumb_func_start RLUnCompVram +RLUnCompVram: @ 82E70A0 + swi 0x15 + bx lr + thumb_func_end RLUnCompVram + + thumb_func_start RLUnCompWram +RLUnCompWram: @ 82E70A4 + swi 0x14 + bx lr + thumb_func_end RLUnCompWram + + thumb_func_start RegisterRamReset +RegisterRamReset: @ 82E70A8 + swi 0x1 + bx lr + thumb_func_end RegisterRamReset + + thumb_func_start SoftReset +SoftReset: @ 82E70AC + ldr r3, _082E70BC + movs r2, 0 + strb r2, [r3] + ldr r1, _082E70C0 + mov sp, r1 + swi 0x1 + swi 0 + .align 2, 0 +_082E70BC: .4byte 0x04000208 +_082E70C0: .4byte 0x03007f00 + thumb_func_end SoftReset + + thumb_func_start Sqrt +Sqrt: @ 82E70C4 + swi 0x8 + bx lr + thumb_func_end Sqrt + + thumb_func_start VBlankIntrWait +VBlankIntrWait: @ 82E70C8 + movs r2, 0 + swi 0x5 + bx lr + thumb_func_end VBlankIntrWait + + 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 0x089a3270 +_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 0x089a3270 +_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 0x089a3270 +_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 +__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 0x089a3370 +_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 0x089a3370 +_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 0x089a3370 +_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 +__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 +__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 +__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 +__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 +__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 +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 +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 +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} + + .incbin "base_emerald.gba", 0x2e952e